@udixio/ui-react 2.10.13 → 2.10.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -1
- package/.eslintrc.mjs +0 -22
- package/.storybook/main.ts +0 -20
- package/.storybook/preview.ts +0 -1
- package/CHANGELOG.md +0 -1144
- package/postcss.config.mjs +0 -5
- package/src/index.css +0 -4
- package/src/index.ts +0 -1
- package/src/lib/components/AnchorPositioner.tsx +0 -185
- package/src/lib/components/Button.tsx +0 -208
- package/src/lib/components/Card.tsx +0 -47
- package/src/lib/components/Carousel.tsx +0 -437
- package/src/lib/components/CarouselItem.tsx +0 -61
- package/src/lib/components/Checkbox.tsx +0 -120
- package/src/lib/components/Chip.tsx +0 -341
- package/src/lib/components/Chips.tsx +0 -331
- package/src/lib/components/ContextMenu.tsx +0 -109
- package/src/lib/components/DatePicker.tsx +0 -432
- package/src/lib/components/Divider.tsx +0 -20
- package/src/lib/components/Fab.tsx +0 -127
- package/src/lib/components/FabMenu.tsx +0 -239
- package/src/lib/components/IconButton.tsx +0 -146
- package/src/lib/components/Menu.tsx +0 -88
- package/src/lib/components/MenuGroup.tsx +0 -34
- package/src/lib/components/MenuHeadline.tsx +0 -9
- package/src/lib/components/MenuItem.tsx +0 -215
- package/src/lib/components/NavigationRail.tsx +0 -186
- package/src/lib/components/NavigationRailItem.tsx +0 -227
- package/src/lib/components/ProgressIndicator.tsx +0 -214
- package/src/lib/components/SideSheet.tsx +0 -135
- package/src/lib/components/Slider.tsx +0 -374
- package/src/lib/components/Snackbar.tsx +0 -77
- package/src/lib/components/Switch.tsx +0 -107
- package/src/lib/components/Tab.tsx +0 -123
- package/src/lib/components/TabGroup.tsx +0 -66
- package/src/lib/components/TabGroupContext.tsx +0 -16
- package/src/lib/components/TabPanel.tsx +0 -27
- package/src/lib/components/TabPanels.tsx +0 -76
- package/src/lib/components/Tabs.tsx +0 -105
- package/src/lib/components/TextField.tsx +0 -586
- package/src/lib/components/Tooltip.tsx +0 -217
- package/src/lib/components/index.ts +0 -34
- package/src/lib/config/config.interface.ts +0 -9
- package/src/lib/config/define-config.ts +0 -16
- package/src/lib/config/index.ts +0 -2
- package/src/lib/effects/AnimateOnScroll.ts +0 -391
- package/src/lib/effects/State.tsx +0 -90
- package/src/lib/effects/SyncedFixedWrapper.tsx +0 -62
- package/src/lib/effects/ThemeProvider.tsx +0 -174
- package/src/lib/effects/block-scroll.effect.tsx +0 -313
- package/src/lib/effects/custom-scroll/custom-scroll.effect.tsx +0 -407
- package/src/lib/effects/custom-scroll/custom-scroll.interface.ts +0 -29
- package/src/lib/effects/custom-scroll/custom-scroll.style.ts +0 -32
- package/src/lib/effects/custom-scroll/index.ts +0 -3
- package/src/lib/effects/index.ts +0 -7
- package/src/lib/effects/ripple/RippleEffect.tsx +0 -116
- package/src/lib/effects/ripple/index.tsx +0 -1
- package/src/lib/effects/scrollDriven.ts +0 -239
- package/src/lib/effects/smooth-scroll.effect.tsx +0 -112
- package/src/lib/effects/theme.worker.ts +0 -97
- package/src/lib/hooks/index.ts +0 -10
- package/src/lib/hooks/useTooltipTrigger.ts +0 -270
- package/src/lib/icon/icon.tsx +0 -125
- package/src/lib/icon/index.ts +0 -1
- package/src/lib/index.ts +0 -8
- package/src/lib/interfaces/button.interface.ts +0 -65
- package/src/lib/interfaces/card.interface.ts +0 -11
- package/src/lib/interfaces/carousel-item.interface.ts +0 -12
- package/src/lib/interfaces/carousel.interface.ts +0 -41
- package/src/lib/interfaces/checkbox.interface.ts +0 -39
- package/src/lib/interfaces/chip.interface.ts +0 -97
- package/src/lib/interfaces/chips.interface.ts +0 -37
- package/src/lib/interfaces/date-picker.interface.ts +0 -79
- package/src/lib/interfaces/divider.interface.ts +0 -7
- package/src/lib/interfaces/fab-menu.interface.ts +0 -12
- package/src/lib/interfaces/fab.interface.ts +0 -27
- package/src/lib/interfaces/icon-button.interface.ts +0 -38
- package/src/lib/interfaces/index.ts +0 -26
- package/src/lib/interfaces/menu-group.interface.ts +0 -13
- package/src/lib/interfaces/menu-item.interface.ts +0 -29
- package/src/lib/interfaces/menu.interface.ts +0 -19
- package/src/lib/interfaces/navigation-rail-item.interface.ts +0 -39
- package/src/lib/interfaces/navigation-rail.interface.ts +0 -39
- package/src/lib/interfaces/progress-indicator.interface.ts +0 -41
- package/src/lib/interfaces/side-sheet.interface.tsx +0 -28
- package/src/lib/interfaces/slider.interface.ts +0 -27
- package/src/lib/interfaces/snackbar.interface.ts +0 -13
- package/src/lib/interfaces/switch.interface.ts +0 -14
- package/src/lib/interfaces/tab-group.interface.ts +0 -13
- package/src/lib/interfaces/tab-panels.interface.ts +0 -21
- package/src/lib/interfaces/tab.interface.ts +0 -31
- package/src/lib/interfaces/tabs.interface.ts +0 -22
- package/src/lib/interfaces/text-field.interface.ts +0 -61
- package/src/lib/interfaces/tooltip.interface.ts +0 -61
- package/src/lib/styles/button.style.ts +0 -136
- package/src/lib/styles/card.style.ts +0 -29
- package/src/lib/styles/carousel-item.style.ts +0 -24
- package/src/lib/styles/carousel.style.ts +0 -22
- package/src/lib/styles/checkbox.style.ts +0 -64
- package/src/lib/styles/chip.style.ts +0 -62
- package/src/lib/styles/chips.style.ts +0 -20
- package/src/lib/styles/date-picker.style.ts +0 -43
- package/src/lib/styles/divider.style.ts +0 -31
- package/src/lib/styles/fab-menu.style.ts +0 -29
- package/src/lib/styles/fab.style.ts +0 -49
- package/src/lib/styles/icon-button.style.ts +0 -168
- package/src/lib/styles/index.ts +0 -25
- package/src/lib/styles/menu-group.style.ts +0 -34
- package/src/lib/styles/menu-headline.style.ts +0 -20
- package/src/lib/styles/menu-item.style.ts +0 -45
- package/src/lib/styles/menu.style.ts +0 -32
- package/src/lib/styles/navigation-rail-item.style.ts +0 -56
- package/src/lib/styles/navigation-rail.style.ts +0 -36
- package/src/lib/styles/progress-indicator.style.ts +0 -72
- package/src/lib/styles/side-sheet.style.ts +0 -45
- package/src/lib/styles/slider.style.ts +0 -41
- package/src/lib/styles/snackbar.style.ts +0 -26
- package/src/lib/styles/switch.style.ts +0 -67
- package/src/lib/styles/tab-panels.style.ts +0 -35
- package/src/lib/styles/tab.style.ts +0 -78
- package/src/lib/styles/tabs.style.ts +0 -22
- package/src/lib/styles/text-field.style.ts +0 -115
- package/src/lib/styles/tooltip.style.ts +0 -48
- package/src/lib/utils/component-helper.ts +0 -134
- package/src/lib/utils/component.ts +0 -34
- package/src/lib/utils/index.ts +0 -7
- package/src/lib/utils/string.ts +0 -9
- package/src/lib/utils/styles/classnames.ts +0 -49
- package/src/lib/utils/styles/get-classname.ts +0 -96
- package/src/lib/utils/styles/index.ts +0 -4
- package/src/lib/utils/styles/use-classnames.ts +0 -25
- package/src/stories/action/button.stories.tsx +0 -86
- package/src/stories/action/fab.stories.tsx +0 -54
- package/src/stories/action/icon-button.stories.tsx +0 -134
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +0 -5
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +0 -15
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +0 -3
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +0 -12
- package/src/stories/assets/youtube.svg +0 -4
- package/src/stories/communication/ProgressIndicator.stories.tsx +0 -57
- package/src/stories/communication/SnackBar.stories.tsx +0 -32
- package/src/stories/communication/tool-tip.stories.tsx +0 -133
- package/src/stories/containment/card.stories.tsx +0 -42
- package/src/stories/containment/carousel.stories.tsx +0 -65
- package/src/stories/containment/divider.stories.tsx +0 -35
- package/src/stories/containment/slide-sheet.stories.tsx +0 -45
- package/src/stories/effect/smooth-scroll.stories.tsx +0 -54
- package/src/stories/navigation/navigation-rail/navigation-rail-item.stories.tsx +0 -65
- package/src/stories/navigation/navigation-rail/navigation-rail.stories.tsx +0 -122
- package/src/stories/navigation/tabs/tab.stories.tsx +0 -57
- package/src/stories/navigation/tabs/tabs.stories.tsx +0 -102
- package/src/stories/selection/slider.stories.tsx +0 -85
- package/src/stories/selection/switch.stories.tsx +0 -46
- package/src/stories/text-inputs/text-field.stories.tsx +0 -135
- package/src/tests/Button.spec.tsx +0 -67
- package/src/tests/useClassNames.spec.tsx +0 -82
- package/src/udixio.css +0 -120
- package/theme.config.ts +0 -7
- package/tsconfig.json +0 -16
- package/tsconfig.lib.json +0 -51
- package/tsconfig.spec.json +0 -37
- package/tsconfig.storybook.json +0 -38
- package/vite.config.ts +0 -96
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Carousel, CarouselInterface, CarouselItem, ReactProps } from '../../';
|
|
3
|
-
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
4
|
-
const meta = {
|
|
5
|
-
title: 'containment/Carousel',
|
|
6
|
-
component: Carousel,
|
|
7
|
-
parameters: {
|
|
8
|
-
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
|
9
|
-
},
|
|
10
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
11
|
-
tags: ['autodocs'],
|
|
12
|
-
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
|
13
|
-
} satisfies Meta<typeof Carousel>;
|
|
14
|
-
|
|
15
|
-
export default meta;
|
|
16
|
-
type Story = StoryObj<typeof meta>;
|
|
17
|
-
|
|
18
|
-
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
|
19
|
-
|
|
20
|
-
const src: string[] = [
|
|
21
|
-
'https://images.unsplash.com/photo-1738694237335-a537515c0b7b?q=80&w=2342&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
|
|
22
|
-
'https://images.unsplash.com/photo-1738189669835-61808a9d5981?q=80&w=2487&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
|
|
23
|
-
'https://images.unsplash.com/photo-1737995720044-8d9bd388ff4f?q=80&w=2487&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
|
|
24
|
-
'https://images.unsplash.com/photo-1737625751736-49f5d69fe450?q=80&w=2487&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
|
|
25
|
-
'https://images.unsplash.com/photo-1737099049906-fdf13033c12b?q=80&w=2487&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
|
|
26
|
-
'https://images.unsplash.com/photo-1736182792109-2db1c298a703?q=80&w=2340&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
|
|
27
|
-
'https://plus.unsplash.com/premium_photo-1727342635651-6695593ee0d6?q=80&w=2487&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
|
|
28
|
-
'https://images.unsplash.com/photo-1734249201319-e7227b1b4f54?q=80&w=2427&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
|
|
29
|
-
'https://images.unsplash.com/photo-1733392898848-72e6a57df7fe?q=80&w=2342&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
|
|
30
|
-
'https://images.unsplash.com/photo-1512389136781-65f9031df878?q=80&w=2500&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
|
|
31
|
-
];
|
|
32
|
-
|
|
33
|
-
const createCarouselStory = (args?: Partial<ReactProps<CarouselInterface>>) => {
|
|
34
|
-
const carouselStory: Story = (args: ReactProps<CarouselInterface>) => (
|
|
35
|
-
<div className="">
|
|
36
|
-
<div className="flex m-4 gap-4 items-center">
|
|
37
|
-
<Carousel
|
|
38
|
-
className={'md:h-[600px] h-[200px]'}
|
|
39
|
-
outputRange={[40, 500]}
|
|
40
|
-
{...args}
|
|
41
|
-
>
|
|
42
|
-
{Array.from({ length: 10 }).map((_, index) => (
|
|
43
|
-
<CarouselItem key={index}>
|
|
44
|
-
<img
|
|
45
|
-
className={'object-cover h-full w-full'}
|
|
46
|
-
alt={'illustration'}
|
|
47
|
-
src={src[index]}
|
|
48
|
-
/>
|
|
49
|
-
</CarouselItem>
|
|
50
|
-
))}
|
|
51
|
-
</Carousel>
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
);
|
|
55
|
-
carouselStory.args = {
|
|
56
|
-
onChange: (e) => console.log(e),
|
|
57
|
-
...args,
|
|
58
|
-
};
|
|
59
|
-
return carouselStory;
|
|
60
|
-
};
|
|
61
|
-
export const hero = createCarouselStory();
|
|
62
|
-
export const centerAlignedHero = createCarouselStory();
|
|
63
|
-
export const multiBrowse = createCarouselStory();
|
|
64
|
-
export const unContained = createCarouselStory();
|
|
65
|
-
export const fullScreen = createCarouselStory();
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Divider, DividerInterface, ReactProps } from '../../';
|
|
3
|
-
|
|
4
|
-
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'Data Display/Divider',
|
|
7
|
-
component: Divider,
|
|
8
|
-
parameters: {
|
|
9
|
-
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
|
10
|
-
},
|
|
11
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
12
|
-
tags: ['autodocs'],
|
|
13
|
-
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
|
14
|
-
argTypes: {},
|
|
15
|
-
} satisfies Meta<typeof Divider>;
|
|
16
|
-
|
|
17
|
-
export default meta;
|
|
18
|
-
type Story = StoryObj<typeof meta>;
|
|
19
|
-
|
|
20
|
-
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
|
21
|
-
|
|
22
|
-
const createTabStory = (args?: Partial<ReactProps<DividerInterface>>) => {
|
|
23
|
-
const tabStory: Story = (args: ReactProps<DividerInterface>) => (
|
|
24
|
-
<div className="h-96 w-96 flex">
|
|
25
|
-
<Divider {...args} />
|
|
26
|
-
</div>
|
|
27
|
-
);
|
|
28
|
-
tabStory.args = {
|
|
29
|
-
...args,
|
|
30
|
-
};
|
|
31
|
-
return tabStory;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export const Horizontal = createTabStory();
|
|
35
|
-
export const Vertical = createTabStory({ orientation: 'vertical' });
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { MotionProps, ReactProps, SideSheet, SideSheetInterface } from '../../';
|
|
3
|
-
|
|
4
|
-
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'containment/SlideSheet',
|
|
7
|
-
component: SideSheet,
|
|
8
|
-
parameters: {
|
|
9
|
-
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
|
10
|
-
},
|
|
11
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
12
|
-
tags: ['autodocs'],
|
|
13
|
-
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
|
14
|
-
argTypes: {},
|
|
15
|
-
} satisfies Meta<typeof SideSheet>;
|
|
16
|
-
|
|
17
|
-
export default meta;
|
|
18
|
-
type Story = StoryObj<typeof meta>;
|
|
19
|
-
|
|
20
|
-
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
|
21
|
-
|
|
22
|
-
const createSlideSheetStory = (
|
|
23
|
-
variant: ReactProps<SideSheetInterface>['variant'],
|
|
24
|
-
) => {
|
|
25
|
-
const SlideSheetStory: Story = (args: MotionProps<SideSheetInterface>) => (
|
|
26
|
-
<>
|
|
27
|
-
<div
|
|
28
|
-
className={
|
|
29
|
-
'bg-surface-container-highest h-screen w-full flex justify-between'
|
|
30
|
-
}
|
|
31
|
-
>
|
|
32
|
-
<SideSheet position={'left'} {...args}></SideSheet>
|
|
33
|
-
<SideSheet position={'right'} {...args}></SideSheet>
|
|
34
|
-
</div>
|
|
35
|
-
</>
|
|
36
|
-
);
|
|
37
|
-
SlideSheetStory.args = {
|
|
38
|
-
children: <div className={'h-96 w-96 bg-secondary-container'}></div>,
|
|
39
|
-
variant: variant,
|
|
40
|
-
title: 'SlideSheet',
|
|
41
|
-
};
|
|
42
|
-
return SlideSheetStory;
|
|
43
|
-
};
|
|
44
|
-
export const Standard = createSlideSheetStory('standard');
|
|
45
|
-
export const Modal = createSlideSheetStory('modal');
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { SmoothScroll } from '../../';
|
|
3
|
-
import { JSX } from 'react/jsx-runtime';
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'effect/SmoothScroll',
|
|
7
|
-
component: SmoothScroll,
|
|
8
|
-
parameters: {},
|
|
9
|
-
tags: ['autodocs'],
|
|
10
|
-
argTypes: {
|
|
11
|
-
transition: {
|
|
12
|
-
control: { type: 'text' },
|
|
13
|
-
description: 'Duration of the scroll animation (e.g., "1s", "500ms", or number in seconds)',
|
|
14
|
-
},
|
|
15
|
-
orientation: {
|
|
16
|
-
control: { type: 'select' },
|
|
17
|
-
options: ['vertical', 'horizontal'],
|
|
18
|
-
},
|
|
19
|
-
smoothTouch: {
|
|
20
|
-
control: { type: 'boolean' },
|
|
21
|
-
description: 'Enable smooth scrolling on touch devices',
|
|
22
|
-
},
|
|
23
|
-
touchMultiplier: {
|
|
24
|
-
control: { type: 'number' },
|
|
25
|
-
description: 'Multiplier for touch scroll sensitivity',
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
} satisfies Meta<typeof SmoothScroll>;
|
|
29
|
-
|
|
30
|
-
export default meta;
|
|
31
|
-
type Story = StoryObj<typeof meta>;
|
|
32
|
-
|
|
33
|
-
const createSmoothScrollStory = () => {
|
|
34
|
-
const SmoothScrollStory: () => JSX.Element = () => (
|
|
35
|
-
<>
|
|
36
|
-
<SmoothScroll transition="1s" />
|
|
37
|
-
<div className="h-52 bg-primary" />
|
|
38
|
-
<div className="h-52 bg-secondary" />
|
|
39
|
-
<div className="h-52 bg-tertiary" />
|
|
40
|
-
<div className="h-52 bg-primary" />
|
|
41
|
-
<div className="h-52 bg-secondary" />
|
|
42
|
-
<div className="h-52 bg-tertiary" />
|
|
43
|
-
<div className="h-52 bg-primary" />
|
|
44
|
-
<div className="h-52 bg-secondary" />
|
|
45
|
-
<div className="h-52 bg-tertiary" />
|
|
46
|
-
<div className="h-52 bg-primary" />
|
|
47
|
-
<div className="h-52 bg-secondary" />
|
|
48
|
-
<div className="h-52 bg-tertiary" />
|
|
49
|
-
</>
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
return SmoothScrollStory;
|
|
53
|
-
};
|
|
54
|
-
export const SmoothScrollStory = createSmoothScrollStory();
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import {
|
|
3
|
-
NavigationRailItem,
|
|
4
|
-
NavigationRailItemInterface,
|
|
5
|
-
ReactProps,
|
|
6
|
-
} from '../../../';
|
|
7
|
-
import { faCircleUser as fasCircleUser } from '@fortawesome/free-solid-svg-icons';
|
|
8
|
-
import { faCircleUser as farCircleUser } from '@fortawesome/free-regular-svg-icons';
|
|
9
|
-
|
|
10
|
-
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
11
|
-
const meta = {
|
|
12
|
-
title: 'Navigation/Navigation rail item',
|
|
13
|
-
component: NavigationRailItem,
|
|
14
|
-
parameters: {
|
|
15
|
-
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
|
16
|
-
},
|
|
17
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
18
|
-
tags: ['autodocs'],
|
|
19
|
-
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
|
20
|
-
argTypes: {
|
|
21
|
-
type: { table: { disable: true } },
|
|
22
|
-
icon: { table: { disable: true } },
|
|
23
|
-
},
|
|
24
|
-
} satisfies Meta<typeof NavigationRailItem>;
|
|
25
|
-
|
|
26
|
-
export default meta;
|
|
27
|
-
type Story = StoryObj<typeof meta>;
|
|
28
|
-
|
|
29
|
-
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
|
30
|
-
|
|
31
|
-
const createNavigationRailItemStory = (
|
|
32
|
-
args?: Partial<ReactProps<NavigationRailItemInterface>>,
|
|
33
|
-
) => {
|
|
34
|
-
const navigationRailItemStory: Story = (
|
|
35
|
-
args: ReactProps<NavigationRailItemInterface>,
|
|
36
|
-
) => (
|
|
37
|
-
<div className="">
|
|
38
|
-
<div className="flex m-4 gap-4 items-center">
|
|
39
|
-
<NavigationRailItem {...args} />
|
|
40
|
-
<NavigationRailItem {...args} selected />
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
);
|
|
44
|
-
navigationRailItemStory.args = {
|
|
45
|
-
...args,
|
|
46
|
-
|
|
47
|
-
icon: farCircleUser,
|
|
48
|
-
iconSelected: fasCircleUser,
|
|
49
|
-
};
|
|
50
|
-
return navigationRailItemStory;
|
|
51
|
-
};
|
|
52
|
-
export const VerticalIconAndLabel = createNavigationRailItemStory({
|
|
53
|
-
variant: 'vertical',
|
|
54
|
-
label: 'Label',
|
|
55
|
-
});
|
|
56
|
-
export const VerticalIconOnly = createNavigationRailItemStory({
|
|
57
|
-
variant: 'vertical',
|
|
58
|
-
});
|
|
59
|
-
export const HorizontalIconAndLabel = createNavigationRailItemStory({
|
|
60
|
-
variant: 'horizontal',
|
|
61
|
-
label: 'Label',
|
|
62
|
-
});
|
|
63
|
-
export const HorizontalLabelOnly = createNavigationRailItemStory({
|
|
64
|
-
variant: 'vertical',
|
|
65
|
-
});
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
import { faCircleUser as fasCircleUser } from '@fortawesome/free-solid-svg-icons';
|
|
4
|
-
import {
|
|
5
|
-
Fab,
|
|
6
|
-
NavigationRail,
|
|
7
|
-
NavigationRailItem,
|
|
8
|
-
NavigationRailSection,
|
|
9
|
-
ReactProps,
|
|
10
|
-
} from '../../../';
|
|
11
|
-
import { NavigationRailInterface } from '../../..//interfaces/navigation-rail.interface';
|
|
12
|
-
import { faCircleUser as farCircleUser } from '@fortawesome/free-regular-svg-icons';
|
|
13
|
-
|
|
14
|
-
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
15
|
-
const meta = {
|
|
16
|
-
title: 'Navigation/Navigation rail',
|
|
17
|
-
component: NavigationRail,
|
|
18
|
-
parameters: {
|
|
19
|
-
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
|
20
|
-
},
|
|
21
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
22
|
-
tags: ['autodocs'],
|
|
23
|
-
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
|
24
|
-
argTypes: {},
|
|
25
|
-
} satisfies Meta<typeof NavigationRail>;
|
|
26
|
-
|
|
27
|
-
export default meta;
|
|
28
|
-
type Story = StoryObj<typeof meta>;
|
|
29
|
-
|
|
30
|
-
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
|
31
|
-
|
|
32
|
-
const createStory = (args?: Partial<ReactProps<NavigationRailInterface>>) => {
|
|
33
|
-
const story: Story = (
|
|
34
|
-
args?: Partial<ReactProps<NavigationRailInterface>>,
|
|
35
|
-
) => (
|
|
36
|
-
<div className="w-full h-[90vh] flex bg-surface">
|
|
37
|
-
<NavigationRail alignment={'middle'} {...args}>
|
|
38
|
-
<Fab icon={farCircleUser} label={'Add Timer'} />
|
|
39
|
-
<NavigationRailItem
|
|
40
|
-
icon={farCircleUser}
|
|
41
|
-
iconSelected={fasCircleUser}
|
|
42
|
-
label={'Explorer'}
|
|
43
|
-
selected
|
|
44
|
-
></NavigationRailItem>
|
|
45
|
-
<NavigationRailItem
|
|
46
|
-
icon={farCircleUser}
|
|
47
|
-
iconSelected={fasCircleUser}
|
|
48
|
-
label={'Favoris'}
|
|
49
|
-
></NavigationRailItem>
|
|
50
|
-
<NavigationRailItem
|
|
51
|
-
icon={farCircleUser}
|
|
52
|
-
iconSelected={fasCircleUser}
|
|
53
|
-
label={'Voyages'}
|
|
54
|
-
></NavigationRailItem>
|
|
55
|
-
<NavigationRailItem
|
|
56
|
-
icon={farCircleUser}
|
|
57
|
-
iconSelected={fasCircleUser}
|
|
58
|
-
label={'Messages'}
|
|
59
|
-
></NavigationRailItem>
|
|
60
|
-
<NavigationRailItem
|
|
61
|
-
icon={farCircleUser}
|
|
62
|
-
iconSelected={fasCircleUser}
|
|
63
|
-
label={'Profil'}
|
|
64
|
-
></NavigationRailItem>
|
|
65
|
-
<NavigationRailSection label={'Section Header'}></NavigationRailSection>
|
|
66
|
-
<NavigationRailItem
|
|
67
|
-
icon={farCircleUser}
|
|
68
|
-
iconSelected={fasCircleUser}
|
|
69
|
-
label={'Explorer'}
|
|
70
|
-
></NavigationRailItem>
|
|
71
|
-
<NavigationRailItem
|
|
72
|
-
icon={farCircleUser}
|
|
73
|
-
iconSelected={fasCircleUser}
|
|
74
|
-
label={'Favoris'}
|
|
75
|
-
></NavigationRailItem>
|
|
76
|
-
<NavigationRailItem
|
|
77
|
-
icon={farCircleUser}
|
|
78
|
-
iconSelected={fasCircleUser}
|
|
79
|
-
label={'Voyages'}
|
|
80
|
-
></NavigationRailItem>
|
|
81
|
-
<NavigationRailItem
|
|
82
|
-
icon={farCircleUser}
|
|
83
|
-
iconSelected={fasCircleUser}
|
|
84
|
-
label={'Messages'}
|
|
85
|
-
></NavigationRailItem>
|
|
86
|
-
<NavigationRailItem
|
|
87
|
-
icon={farCircleUser}
|
|
88
|
-
iconSelected={fasCircleUser}
|
|
89
|
-
label={'Profil'}
|
|
90
|
-
></NavigationRailItem>
|
|
91
|
-
<NavigationRailSection label={'Section Header'}></NavigationRailSection>
|
|
92
|
-
<NavigationRailItem
|
|
93
|
-
icon={farCircleUser}
|
|
94
|
-
iconSelected={fasCircleUser}
|
|
95
|
-
label={'Explorer'}
|
|
96
|
-
></NavigationRailItem>
|
|
97
|
-
<NavigationRailItem
|
|
98
|
-
icon={farCircleUser}
|
|
99
|
-
iconSelected={fasCircleUser}
|
|
100
|
-
label={'Favoris'}
|
|
101
|
-
></NavigationRailItem>
|
|
102
|
-
</NavigationRail>
|
|
103
|
-
<div className={'flex-1 bg-surface-container'}></div>
|
|
104
|
-
</div>
|
|
105
|
-
);
|
|
106
|
-
|
|
107
|
-
story.args = {
|
|
108
|
-
...(args as any),
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
return story;
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
export const PrimaryLabelOnly = createStory();
|
|
115
|
-
|
|
116
|
-
export const PrimaryIconAndLabel = createStory();
|
|
117
|
-
|
|
118
|
-
export const PrimaryIconOnly = createStory();
|
|
119
|
-
|
|
120
|
-
export const SecondaryLabelOnly = createStory();
|
|
121
|
-
|
|
122
|
-
export const SecondaryIconAndLabel = createStory();
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
import { faHome } from '@fortawesome/free-solid-svg-icons';
|
|
4
|
-
import { Tab, TabProps, TabsVariant } from '../../../';
|
|
5
|
-
import { fn } from '@storybook/test';
|
|
6
|
-
|
|
7
|
-
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
8
|
-
const meta = {
|
|
9
|
-
title: 'Navigation/Tab',
|
|
10
|
-
component: Tab,
|
|
11
|
-
parameters: {
|
|
12
|
-
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
|
13
|
-
},
|
|
14
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
15
|
-
tags: ['autodocs'],
|
|
16
|
-
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
|
17
|
-
argTypes: {
|
|
18
|
-
type: { table: { disable: true } },
|
|
19
|
-
icon: { table: { disable: true } },
|
|
20
|
-
},
|
|
21
|
-
} satisfies Meta<typeof Tab>;
|
|
22
|
-
|
|
23
|
-
export default meta;
|
|
24
|
-
type Story = StoryObj<typeof meta>;
|
|
25
|
-
|
|
26
|
-
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
|
27
|
-
|
|
28
|
-
const createTabStory = (variant: TabsVariant, args?: Partial<TabProps>) => {
|
|
29
|
-
const tabStory: Story = (args: TabProps) => (
|
|
30
|
-
<div className="">
|
|
31
|
-
<div className="flex m-4 gap-4 items-center">
|
|
32
|
-
<Tab {...args} />
|
|
33
|
-
<Tab {...args} selected />
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
);
|
|
37
|
-
tabStory.args = {
|
|
38
|
-
label: 'Tab',
|
|
39
|
-
variant: variant,
|
|
40
|
-
onClick: fn(),
|
|
41
|
-
onTabSelected: fn(),
|
|
42
|
-
...args,
|
|
43
|
-
};
|
|
44
|
-
return tabStory;
|
|
45
|
-
};
|
|
46
|
-
export const PrimaryIconAndLabel = createTabStory('primary', {
|
|
47
|
-
icon: faHome,
|
|
48
|
-
});
|
|
49
|
-
export const PrimaryIconOnly = createTabStory('primary', {
|
|
50
|
-
label: undefined,
|
|
51
|
-
icon: faHome,
|
|
52
|
-
});
|
|
53
|
-
export const PrimaryLabelOnly = createTabStory('primary');
|
|
54
|
-
export const SecondaryLabelOnly = createTabStory('secondary');
|
|
55
|
-
export const SecondaryIconAndLabel = createTabStory('secondary', {
|
|
56
|
-
icon: faHome,
|
|
57
|
-
});
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
faCircleUser,
|
|
5
|
-
faHeart,
|
|
6
|
-
faMagnifyingGlass,
|
|
7
|
-
faMessage,
|
|
8
|
-
faPlane,
|
|
9
|
-
} from '@fortawesome/free-solid-svg-icons';
|
|
10
|
-
import { ReactProps, Tab, Tabs, TabsInterface, TabsVariant } from '../../../';
|
|
11
|
-
|
|
12
|
-
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
13
|
-
const meta = {
|
|
14
|
-
title: 'Navigation/Tabs',
|
|
15
|
-
component: Tabs,
|
|
16
|
-
parameters: {
|
|
17
|
-
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
|
18
|
-
},
|
|
19
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
20
|
-
tags: ['autodocs'],
|
|
21
|
-
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
|
22
|
-
argTypes: {},
|
|
23
|
-
} satisfies Meta<typeof Tabs>;
|
|
24
|
-
|
|
25
|
-
export default meta;
|
|
26
|
-
type Story = StoryObj<typeof meta>;
|
|
27
|
-
|
|
28
|
-
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
|
29
|
-
|
|
30
|
-
const createTabStory = (
|
|
31
|
-
variant?: TabsVariant,
|
|
32
|
-
args?: Partial<ReactProps<TabsInterface>>,
|
|
33
|
-
) => {
|
|
34
|
-
const tabStory: Story = (args: ReactProps<TabsInterface>) => (
|
|
35
|
-
<div className="w-full flex flex-col gap-8">
|
|
36
|
-
<Tabs {...args} onTabSelected={(tab: any) => console.log(tab)}>
|
|
37
|
-
{
|
|
38
|
-
// @ts-ignore
|
|
39
|
-
args.children.map((child) => child)
|
|
40
|
-
}
|
|
41
|
-
</Tabs>
|
|
42
|
-
<Tabs scrollable {...args} onTabSelected={(tab: any) => console.log(tab)}>
|
|
43
|
-
{
|
|
44
|
-
// @ts-ignore
|
|
45
|
-
args.children.map((child) => child)
|
|
46
|
-
}
|
|
47
|
-
{
|
|
48
|
-
// @ts-ignore
|
|
49
|
-
args.children.slice(1).map((child) => child)
|
|
50
|
-
}
|
|
51
|
-
</Tabs>
|
|
52
|
-
</div>
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
tabStory.args = {
|
|
56
|
-
variant,
|
|
57
|
-
children: [
|
|
58
|
-
<Tab label={'Explorer'} selected></Tab>,
|
|
59
|
-
<Tab label={'Favoris'}></Tab>,
|
|
60
|
-
<Tab label={'Voyages'}></Tab>,
|
|
61
|
-
<Tab label={'Messages'}></Tab>,
|
|
62
|
-
<Tab label={'Profil'}></Tab>,
|
|
63
|
-
],
|
|
64
|
-
...args,
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
return tabStory;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
export const PrimaryLabelOnly = createTabStory('primary');
|
|
71
|
-
|
|
72
|
-
export const PrimaryIconAndLabel = createTabStory('primary', {
|
|
73
|
-
children: [
|
|
74
|
-
<Tab label={'Explorer'} icon={faMagnifyingGlass} selected />,
|
|
75
|
-
<Tab label={'Favoris'} icon={faHeart} />,
|
|
76
|
-
<Tab label={'Voyages'} icon={faPlane} />,
|
|
77
|
-
<Tab label={'Messages'} icon={faMessage} />,
|
|
78
|
-
<Tab label={'Profil'} icon={faCircleUser} />,
|
|
79
|
-
],
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
export const PrimaryIconOnly = createTabStory('primary', {
|
|
83
|
-
children: [
|
|
84
|
-
<Tab icon={faMagnifyingGlass} selected />,
|
|
85
|
-
<Tab icon={faHeart} />,
|
|
86
|
-
<Tab icon={faPlane} />,
|
|
87
|
-
<Tab icon={faMessage} />,
|
|
88
|
-
<Tab icon={faCircleUser} />,
|
|
89
|
-
],
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
export const SecondaryLabelOnly = createTabStory('secondary');
|
|
93
|
-
|
|
94
|
-
export const SecondaryIconAndLabel = createTabStory('secondary', {
|
|
95
|
-
children: [
|
|
96
|
-
<Tab label={'Explorer'} icon={faMagnifyingGlass} selected />,
|
|
97
|
-
<Tab label={'Favoris'} icon={faHeart} />,
|
|
98
|
-
<Tab label={'Voyages'} icon={faPlane} />,
|
|
99
|
-
<Tab label={'Messages'} icon={faMessage} />,
|
|
100
|
-
<Tab label={'Profil'} icon={faCircleUser} />,
|
|
101
|
-
],
|
|
102
|
-
});
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { ReactProps, Slider, SliderInterface } from '../../';
|
|
3
|
-
|
|
4
|
-
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'Selection/Slider',
|
|
7
|
-
component: Slider,
|
|
8
|
-
parameters: {
|
|
9
|
-
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
|
10
|
-
},
|
|
11
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
12
|
-
tags: ['autodocs'],
|
|
13
|
-
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
|
14
|
-
} satisfies Meta<typeof Slider>;
|
|
15
|
-
|
|
16
|
-
export default meta;
|
|
17
|
-
type Story = StoryObj<typeof meta>;
|
|
18
|
-
|
|
19
|
-
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
|
20
|
-
|
|
21
|
-
const createSliderStory = (args?: Partial<ReactProps<SliderInterface>>) => {
|
|
22
|
-
const sliderStory: Story = (args: ReactProps<SliderInterface>) => (
|
|
23
|
-
<div className="">
|
|
24
|
-
<div className="flex flex-col m-4 gap-4 items-center">
|
|
25
|
-
<Slider value={0} min={0} max={100} step={1} {...args} />
|
|
26
|
-
<Slider value={50} min={0} max={100} step={1} {...args} />
|
|
27
|
-
<Slider value={100} min={0} max={100} step={1} {...args} />
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
);
|
|
31
|
-
sliderStory.args = {
|
|
32
|
-
name: 'test',
|
|
33
|
-
...args,
|
|
34
|
-
};
|
|
35
|
-
return sliderStory;
|
|
36
|
-
};
|
|
37
|
-
export const continuousSlider = createSliderStory({});
|
|
38
|
-
export const discreteSlider = createSliderStory({
|
|
39
|
-
marks: [
|
|
40
|
-
{
|
|
41
|
-
value: 0,
|
|
42
|
-
label: '0%',
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
value: 10,
|
|
46
|
-
label: '10%',
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
value: 20,
|
|
50
|
-
label: '20%',
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
value: 30,
|
|
54
|
-
label: '30%',
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
value: 40,
|
|
58
|
-
label: '40%',
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
value: 50,
|
|
62
|
-
label: '50%',
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
value: 60,
|
|
66
|
-
label: '60%',
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
value: 70,
|
|
70
|
-
label: '70%',
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
value: 80,
|
|
74
|
-
label: '80%',
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
value: 90,
|
|
78
|
-
label: '90%',
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
value: 100,
|
|
82
|
-
label: '100%',
|
|
83
|
-
},
|
|
84
|
-
],
|
|
85
|
-
});
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { ReactProps, Switch, SwitchInterface } from '../../';
|
|
3
|
-
import { faCheck, faXmark } from '@fortawesome/free-solid-svg-icons';
|
|
4
|
-
|
|
5
|
-
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
6
|
-
const meta = {
|
|
7
|
-
title: 'Selection/Switch',
|
|
8
|
-
component: Switch,
|
|
9
|
-
parameters: {
|
|
10
|
-
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
|
11
|
-
},
|
|
12
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
13
|
-
tags: ['autodocs'],
|
|
14
|
-
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
|
15
|
-
} satisfies Meta<typeof Switch>;
|
|
16
|
-
|
|
17
|
-
export default meta;
|
|
18
|
-
type Story = StoryObj<typeof meta>;
|
|
19
|
-
|
|
20
|
-
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
|
21
|
-
|
|
22
|
-
const createSwitchStory = (args?: Partial<ReactProps<SwitchInterface>>) => {
|
|
23
|
-
const switchStory: Story = (args: ReactProps<SwitchInterface>) => (
|
|
24
|
-
<div className="">
|
|
25
|
-
<div className="flex m-4 gap-4 items-center">
|
|
26
|
-
<Switch {...args} />
|
|
27
|
-
<Switch disabled {...args} />
|
|
28
|
-
</div>
|
|
29
|
-
<div className="flex m-4 gap-4 items-center">
|
|
30
|
-
<Switch activeIcon={faCheck} inactiveIcon={faXmark} {...args} />
|
|
31
|
-
<Switch
|
|
32
|
-
activeIcon={faCheck}
|
|
33
|
-
inactiveIcon={faXmark}
|
|
34
|
-
disabled
|
|
35
|
-
{...args}
|
|
36
|
-
/>
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
39
|
-
);
|
|
40
|
-
switchStory.args = {
|
|
41
|
-
...args,
|
|
42
|
-
};
|
|
43
|
-
return switchStory;
|
|
44
|
-
};
|
|
45
|
-
export const switchSelected = createSwitchStory({ selected: true });
|
|
46
|
-
export const switchUnselected = createSwitchStory({ selected: false });
|