Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

storybook: move manchette's stories into /storybook #959

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 0 additions & 34 deletions storybook/stories/ManchetteSplit/sampleData.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Manchette } from '@osrd-project/ui-charts';
import '@osrd-project/ui-core/dist/theme.css';
import '@osrd-project/ui-charts/dist/theme.css';
import type { Meta, StoryObj } from '@storybook/react';

import { SAMPLE_WAYPOINTS } from './assets/sampleData';
import Manchette from '../components/Manchette';

const meta: Meta<typeof Manchette> = {
component: Manchette,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Manchette } from '@osrd-project/ui-charts';
import '@osrd-project/ui-core/dist/theme.css';
import type { Meta, StoryObj } from '@storybook/react';

import WAYPOINTS_DATA from './sampleData';
import { SAMPLE_WAYPOINTS } from './assets/sampleData';

const meta: Meta<typeof Manchette> = {
component: Manchette,
Expand All @@ -26,12 +26,12 @@ const customDiv = (
export const Default: Story = {
args: {
contents: [
WAYPOINTS_DATA[0],
SAMPLE_WAYPOINTS[0],
customDiv,
WAYPOINTS_DATA[1],
WAYPOINTS_DATA[2],
SAMPLE_WAYPOINTS[1],
SAMPLE_WAYPOINTS[2],
customDiv,
WAYPOINTS_DATA[3],
SAMPLE_WAYPOINTS[3],
customDiv,
],
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Waypoint } from '../../types';
import { type Waypoint } from '@osrd-project/ui-charts';

export const SAMPLE_WAYPOINTS: Waypoint[] = [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type ProjectPathTrainResult, type Waypoint } from '../../Manchette';
import { type ProjectPathTrainResult, type Waypoint } from '@osrd-project/ui-charts';

export const SAMPLE_WAYPOINTS: Waypoint[] = [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
import React, { useEffect, useRef, useState } from 'react';

import {
PathLayer,
SpaceTimeChart,
Manchette,
type ProjectPathTrainResult,
type Waypoint,
useManchetteWithSpaceTimeChart,
} from '@osrd-project/ui-charts';
import { EyeClosed, Telescope } from '@osrd-project/ui-icons';
import type { Meta } from '@storybook/react';
import '@osrd-project/ui-core/dist/theme.css';
import '@osrd-project/ui-charts/dist/theme.css';
import cx from 'classnames';
import { createPortal } from 'react-dom';

import { SAMPLE_PATHS_DATA, SAMPLE_WAYPOINTS } from './assets/sampleData';
import Menu, { type MenuItem } from './Menu';
import { PathLayer, SpaceTimeChart } from '../../../spaceTimeChart';
import Manchette, { type ProjectPathTrainResult, type Waypoint } from '../../Manchette';
import { SAMPLE_WAYPOINTS, SAMPLE_PATHS_DATA } from '../assets/sampleData';
import useManchettesWithSpaceTimeChart from '../hooks/useManchetteWithSpaceTimeChart';

type ManchetteWithSpaceTimeWrapperProps = {
waypoints: Waypoint[];
Expand Down Expand Up @@ -63,7 +68,7 @@ const ManchetteWithSpaceTimeWrapper = ({
setActiveWaypointId(waypointId);
};

const { manchetteProps, spaceTimeChartProps, handleScroll } = useManchettesWithSpaceTimeChart(
const { manchetteProps, spaceTimeChartProps, handleScroll } = useManchetteWithSpaceTimeChart(
waypoints,
projectPathTrainResult,
manchetteWithSpaceTimeChartRef,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import React, { useRef } from 'react';

import type { Meta } from '@storybook/react';

import '@osrd-project/ui-core/dist/theme.css';
import '@osrd-project/ui-charts/dist/theme.css';
import {
PathLayer,
SpaceTimeChart,
Manchette,
useManchetteWithSpaceTimeChart,
type ProjectPathTrainResult,
type Waypoint,
} from '@osrd-project/ui-charts';
import type { Meta } from '@storybook/react';

import { PathLayer, SpaceTimeChart } from '../../../spaceTimeChart';
import Manchette, { type ProjectPathTrainResult, type Waypoint } from '../../Manchette';
import { SAMPLE_WAYPOINTS, SAMPLE_PATHS_DATA } from '../assets/sampleData';
import useManchettesWithSpaceTimeChart from '../hooks/useManchetteWithSpaceTimeChart';
import { SAMPLE_WAYPOINTS, SAMPLE_PATHS_DATA } from './assets/sampleData';

type ManchetteWithSpaceTimeWrapperProps = {
waypoints: Waypoint[];
Expand All @@ -25,7 +29,7 @@ const ManchetteWithSpaceTimeWrapper = ({
}: ManchetteWithSpaceTimeWrapperProps) => {
const manchetteWithSpaceTimeChartRef = useRef<HTMLDivElement>(null);

const { manchetteProps, spaceTimeChartProps, handleScroll } = useManchettesWithSpaceTimeChart(
const { manchetteProps, spaceTimeChartProps, handleScroll } = useManchetteWithSpaceTimeChart(
waypoints,
projectPathTrainResult,
manchetteWithSpaceTimeChartRef,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import type { Meta } from '@storybook/react';

import '@osrd-project/ui-core/dist/theme.css';
import { ManchetteWithSpaceTimeChart } from '@osrd-project/ui-charts';
import '@osrd-project/ui-charts/dist/theme.css';
import '@osrd-project/ui-core/dist/theme.css';
import type { Meta } from '@storybook/react';

import { SAMPLE_WAYPOINTS, SAMPLE_PATHS_DATA } from '../assets/sampleData';
import ManchetteWithSpaceTimeChart from '../components/ManchetteWithSpaceTimeChart';
import { SAMPLE_WAYPOINTS, SAMPLE_PATHS_DATA } from './assets/sampleData';

const meta: Meta<typeof ManchetteWithSpaceTimeChart> = {
title: 'Manchette with SpaceTimeChart/simple',
Expand Down
21 changes: 0 additions & 21 deletions ui-charts/src/manchette/Manchette/stories/Waypoint.stories.ts

This file was deleted.

This file was deleted.