@udixio/ui-react 0.0.1 → 0.1.0
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/.eslintrc.mjs +22 -0
- package/.storybook/main.ts +20 -0
- package/.storybook/preview.ts +1 -0
- package/CHANGELOG.md +141 -0
- package/dist/index.cjs +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2820 -0
- package/dist/lib/components/Button.d.ts.map +1 -0
- package/dist/lib/components/Card.d.ts.map +1 -0
- package/dist/lib/components/Carousel.d.ts.map +1 -0
- package/dist/lib/components/CarouselItem.d.ts.map +1 -0
- package/{lib → dist/lib}/components/Divided.d.ts +1 -1
- package/dist/lib/components/Divided.d.ts.map +1 -0
- package/dist/lib/components/Fab.d.ts.map +1 -0
- package/dist/lib/components/IconButton.d.ts.map +1 -0
- package/dist/lib/components/NavigationRail.d.ts.map +1 -0
- package/dist/lib/components/NavigationRailItem.d.ts.map +1 -0
- package/dist/lib/components/ProgressIndicator.d.ts.map +1 -0
- package/dist/lib/components/Slider.d.ts.map +1 -0
- package/dist/lib/components/Snackbar.d.ts.map +1 -0
- package/dist/lib/components/Switch.d.ts.map +1 -0
- package/dist/lib/components/Tab.d.ts.map +1 -0
- package/dist/lib/components/Tabs.d.ts.map +1 -0
- package/dist/lib/components/TextField.d.ts.map +1 -0
- package/dist/lib/components/ToolTip.d.ts.map +1 -0
- package/dist/lib/components/index.d.ts.map +1 -0
- package/dist/lib/effects/SyncedFixedWrapper.d.ts.map +1 -0
- package/dist/lib/effects/custom-scroll/custom-scroll.effect.d.ts.map +1 -0
- package/dist/lib/effects/custom-scroll/custom-scroll.interface.d.ts.map +1 -0
- package/dist/lib/effects/custom-scroll/custom-scroll.style.d.ts.map +1 -0
- package/dist/lib/effects/custom-scroll/index.d.ts.map +1 -0
- package/dist/lib/effects/index.d.ts.map +1 -0
- package/dist/lib/effects/ripple/RippleEffect.d.ts.map +1 -0
- package/dist/lib/effects/ripple/index.d.ts.map +1 -0
- package/dist/lib/effects/smooth-scroll.effect.d.ts.map +1 -0
- package/dist/lib/icon/icon.d.ts.map +1 -0
- package/dist/lib/icon/index.d.ts.map +1 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/interfaces/button.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/card.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/carousel-item.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/carousel.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/divider.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/fab.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/icon-button.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/index.d.ts.map +1 -0
- package/dist/lib/interfaces/navigation-rail-item.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/navigation-rail.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/progress-indicator.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/slider.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/snackbar.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/switch.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/tab.interface.d.ts.map +1 -0
- package/{lib → dist/lib}/interfaces/tabs.interface.d.ts +1 -1
- package/dist/lib/interfaces/tabs.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/text-field.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/tooltip.interface.d.ts.map +1 -0
- package/dist/lib/styles/button.style.d.ts.map +1 -0
- package/dist/lib/styles/card.style.d.ts.map +1 -0
- package/dist/lib/styles/carousel-item.style.d.ts.map +1 -0
- package/dist/lib/styles/carousel.style.d.ts.map +1 -0
- package/dist/lib/styles/divider.style.d.ts.map +1 -0
- package/dist/lib/styles/fab.style.d.ts.map +1 -0
- package/dist/lib/styles/icon-button.style.d.ts.map +1 -0
- package/dist/lib/styles/index.d.ts.map +1 -0
- package/dist/lib/styles/navigation-rail-item.style.d.ts.map +1 -0
- package/dist/lib/styles/navigation-rail.style.d.ts.map +1 -0
- package/dist/lib/styles/progress-indicator.style.d.ts.map +1 -0
- package/dist/lib/styles/slider.style.d.ts.map +1 -0
- package/dist/lib/styles/snackbar.style.d.ts.map +1 -0
- package/dist/lib/styles/switch.style.d.ts.map +1 -0
- package/dist/lib/styles/tab.style.d.ts.map +1 -0
- package/{lib → dist/lib}/styles/tabs.style.d.ts +1 -1
- package/dist/lib/styles/tabs.style.d.ts.map +1 -0
- package/dist/lib/styles/text-field.style.d.ts.map +1 -0
- package/dist/lib/styles/tooltip.style.d.ts.map +1 -0
- package/dist/lib/utils/component-helper.d.ts.map +1 -0
- package/dist/lib/utils/component.d.ts.map +1 -0
- package/dist/lib/utils/index.d.ts.map +1 -0
- package/dist/lib/utils/string.d.ts.map +1 -0
- package/dist/lib/utils/styles/classnames.d.ts.map +1 -0
- package/dist/lib/utils/styles/get-classname.d.ts.map +1 -0
- package/dist/lib/utils/styles/index.d.ts.map +1 -0
- package/package.json +12 -7
- package/postcss.config.mjs +5 -0
- package/src/index.css +4 -0
- package/src/index.ts +1 -0
- package/src/lib/components/Button.tsx +140 -0
- package/src/lib/components/Card.tsx +31 -0
- package/src/lib/components/Carousel.tsx +190 -0
- package/src/lib/components/CarouselItem.tsx +53 -0
- package/src/lib/components/Divided.tsx +13 -0
- package/src/lib/components/Fab.tsx +109 -0
- package/src/lib/components/IconButton.tsx +141 -0
- package/src/lib/components/NavigationRail.tsx +178 -0
- package/src/lib/components/NavigationRailItem.tsx +199 -0
- package/src/lib/components/ProgressIndicator.tsx +157 -0
- package/src/lib/components/Slider.tsx +361 -0
- package/src/lib/components/Snackbar.tsx +66 -0
- package/src/lib/components/Switch.tsx +94 -0
- package/src/lib/components/Tab.tsx +110 -0
- package/src/lib/components/Tabs.tsx +85 -0
- package/src/lib/components/TextField.tsx +269 -0
- package/src/lib/components/ToolTip.tsx +232 -0
- package/src/lib/components/index.ts +19 -0
- package/src/lib/effects/SyncedFixedWrapper.tsx +64 -0
- package/src/lib/effects/custom-scroll/custom-scroll.effect.tsx +287 -0
- package/src/lib/effects/custom-scroll/custom-scroll.interface.ts +25 -0
- package/src/lib/effects/custom-scroll/custom-scroll.style.ts +32 -0
- package/src/lib/effects/custom-scroll/index.ts +3 -0
- package/src/lib/effects/index.ts +4 -0
- package/src/lib/effects/ripple/RippleEffect.tsx +103 -0
- package/src/lib/effects/ripple/index.tsx +1 -0
- package/src/lib/effects/smooth-scroll.effect.tsx +91 -0
- package/src/lib/icon/icon.tsx +47 -0
- package/src/lib/icon/index.ts +1 -0
- package/src/lib/index.ts +6 -0
- package/src/lib/interfaces/button.interface.ts +46 -0
- package/src/lib/interfaces/card.interface.ts +8 -0
- package/src/lib/interfaces/carousel-item.interface.ts +11 -0
- package/src/lib/interfaces/carousel.interface.ts +21 -0
- package/src/lib/interfaces/divider.interface.ts +7 -0
- package/src/lib/interfaces/fab.interface.ts +19 -0
- package/src/lib/interfaces/icon-button.interface.ts +35 -0
- package/src/lib/interfaces/index.ts +16 -0
- package/src/lib/interfaces/navigation-rail-item.interface.ts +38 -0
- package/src/lib/interfaces/navigation-rail.interface.ts +39 -0
- package/src/lib/interfaces/progress-indicator.interface.ts +35 -0
- package/src/lib/interfaces/slider.interface.ts +29 -0
- package/src/lib/interfaces/snackbar.interface.ts +13 -0
- package/src/lib/interfaces/switch.interface.ts +14 -0
- package/src/lib/interfaces/tab.interface.ts +30 -0
- package/src/lib/interfaces/tabs.interface.ts +22 -0
- package/src/lib/interfaces/text-field.interface.ts +48 -0
- package/src/lib/interfaces/tooltip.interface.ts +35 -0
- package/src/lib/styles/button.style.ts +155 -0
- package/src/lib/styles/card.style.ts +22 -0
- package/src/lib/styles/carousel-item.style.ts +11 -0
- package/src/lib/styles/carousel.style.ts +12 -0
- package/src/lib/styles/divider.style.ts +17 -0
- package/src/lib/styles/fab.style.ts +55 -0
- package/src/lib/styles/icon-button.style.ts +140 -0
- package/src/lib/styles/index.ts +15 -0
- package/src/lib/styles/navigation-rail-item.style.ts +44 -0
- package/src/lib/styles/navigation-rail.style.ts +20 -0
- package/src/lib/styles/progress-indicator.style.ts +30 -0
- package/src/lib/styles/slider.style.ts +27 -0
- package/src/lib/styles/snackbar.style.ts +14 -0
- package/src/lib/styles/switch.style.ts +51 -0
- package/src/lib/styles/tab.style.ts +68 -0
- package/src/lib/styles/tabs.style.ts +13 -0
- package/src/lib/styles/text-field.style.ts +104 -0
- package/src/lib/styles/tooltip.style.ts +37 -0
- package/src/lib/utils/component-helper.ts +134 -0
- package/src/lib/utils/component.ts +34 -0
- package/src/lib/utils/index.ts +7 -0
- package/src/lib/utils/string.ts +9 -0
- package/src/lib/utils/styles/classnames.ts +49 -0
- package/src/lib/utils/styles/get-classname.ts +73 -0
- package/src/lib/utils/styles/index.ts +3 -0
- package/src/stories/action/button.stories.tsx +86 -0
- package/src/stories/action/fab.stories.tsx +54 -0
- package/src/stories/action/icon-button.stories.tsx +134 -0
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +5 -0
- 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 +15 -0
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +3 -0
- 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 +12 -0
- package/src/stories/assets/youtube.svg +4 -0
- package/src/stories/communication/ProgressIndicator.stories.tsx +57 -0
- package/src/stories/communication/SnackBar.stories.tsx +32 -0
- package/src/stories/communication/tool-tip.stories.tsx +133 -0
- package/src/stories/containment/card.stories.tsx +42 -0
- package/src/stories/containment/carousel.stories.tsx +65 -0
- package/src/stories/containment/divider.stories.tsx +35 -0
- package/src/stories/effect/smooth-scroll.stories.tsx +45 -0
- package/src/stories/navigation/navigation-rail/navigation-rail-item.stories.tsx +65 -0
- package/src/stories/navigation/navigation-rail/navigation-rail.stories.tsx +122 -0
- package/src/stories/navigation/tabs/tab.stories.tsx +57 -0
- package/src/stories/navigation/tabs/tabs.stories.tsx +102 -0
- package/src/stories/selection/slider.stories.tsx +85 -0
- package/src/stories/selection/switch.stories.tsx +46 -0
- package/src/stories/text-inputs/text-field.stories.tsx +135 -0
- package/src/tests/Button.spec.tsx +67 -0
- package/src/udixio.css +120 -0
- package/theme.config.ts +7 -0
- package/tsconfig.json +22 -0
- package/tsconfig.lib.json +51 -0
- package/tsconfig.spec.json +37 -0
- package/tsconfig.storybook.json +38 -0
- package/vite.config.ts +75 -0
- package/index.d.ts.map +0 -1
- package/index.js +0 -10841
- package/lib/components/Button.d.ts.map +0 -1
- package/lib/components/Card.d.ts.map +0 -1
- package/lib/components/Carousel.d.ts.map +0 -1
- package/lib/components/CarouselItem.d.ts.map +0 -1
- package/lib/components/Divided.d.ts.map +0 -1
- package/lib/components/Fab.d.ts.map +0 -1
- package/lib/components/IconButton.d.ts.map +0 -1
- package/lib/components/NavigationRail.d.ts.map +0 -1
- package/lib/components/NavigationRailItem.d.ts.map +0 -1
- package/lib/components/ProgressIndicator.d.ts.map +0 -1
- package/lib/components/Slider.d.ts.map +0 -1
- package/lib/components/Snackbar.d.ts.map +0 -1
- package/lib/components/Switch.d.ts.map +0 -1
- package/lib/components/Tab.d.ts.map +0 -1
- package/lib/components/Tabs.d.ts.map +0 -1
- package/lib/components/TextField.d.ts.map +0 -1
- package/lib/components/ToolTip.d.ts.map +0 -1
- package/lib/components/index.d.ts.map +0 -1
- package/lib/effects/SyncedFixedWrapper.d.ts.map +0 -1
- package/lib/effects/custom-scroll/custom-scroll.effect.d.ts.map +0 -1
- package/lib/effects/custom-scroll/custom-scroll.interface.d.ts.map +0 -1
- package/lib/effects/custom-scroll/custom-scroll.style.d.ts.map +0 -1
- package/lib/effects/custom-scroll/index.d.ts.map +0 -1
- package/lib/effects/index.d.ts.map +0 -1
- package/lib/effects/ripple/RippleEffect.d.ts.map +0 -1
- package/lib/effects/ripple/index.d.ts.map +0 -1
- package/lib/effects/smooth-scroll.effect.d.ts.map +0 -1
- package/lib/icon/icon.d.ts.map +0 -1
- package/lib/icon/index.d.ts.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/interfaces/button.interface.d.ts.map +0 -1
- package/lib/interfaces/card.interface.d.ts.map +0 -1
- package/lib/interfaces/carousel-item.interface.d.ts.map +0 -1
- package/lib/interfaces/carousel.interface.d.ts.map +0 -1
- package/lib/interfaces/divider.interface.d.ts.map +0 -1
- package/lib/interfaces/fab.interface.d.ts.map +0 -1
- package/lib/interfaces/icon-button.interface.d.ts.map +0 -1
- package/lib/interfaces/index.d.ts.map +0 -1
- package/lib/interfaces/navigation-rail-item.interface.d.ts.map +0 -1
- package/lib/interfaces/navigation-rail.interface.d.ts.map +0 -1
- package/lib/interfaces/progress-indicator.interface.d.ts.map +0 -1
- package/lib/interfaces/slider.interface.d.ts.map +0 -1
- package/lib/interfaces/snackbar.interface.d.ts.map +0 -1
- package/lib/interfaces/switch.interface.d.ts.map +0 -1
- package/lib/interfaces/tab.interface.d.ts.map +0 -1
- package/lib/interfaces/tabs.interface.d.ts.map +0 -1
- package/lib/interfaces/text-field.interface.d.ts.map +0 -1
- package/lib/interfaces/tooltip.interface.d.ts.map +0 -1
- package/lib/styles/button.style.d.ts.map +0 -1
- package/lib/styles/card.style.d.ts.map +0 -1
- package/lib/styles/carousel-item.style.d.ts.map +0 -1
- package/lib/styles/carousel.style.d.ts.map +0 -1
- package/lib/styles/divider.style.d.ts.map +0 -1
- package/lib/styles/fab.style.d.ts.map +0 -1
- package/lib/styles/icon-button.style.d.ts.map +0 -1
- package/lib/styles/index.d.ts.map +0 -1
- package/lib/styles/navigation-rail-item.style.d.ts.map +0 -1
- package/lib/styles/navigation-rail.style.d.ts.map +0 -1
- package/lib/styles/progress-indicator.style.d.ts.map +0 -1
- package/lib/styles/slider.style.d.ts.map +0 -1
- package/lib/styles/snackbar.style.d.ts.map +0 -1
- package/lib/styles/switch.style.d.ts.map +0 -1
- package/lib/styles/tab.style.d.ts.map +0 -1
- package/lib/styles/tabs.style.d.ts.map +0 -1
- package/lib/styles/text-field.style.d.ts.map +0 -1
- package/lib/styles/tooltip.style.d.ts.map +0 -1
- package/lib/utils/component-helper.d.ts.map +0 -1
- package/lib/utils/component.d.ts.map +0 -1
- package/lib/utils/index.d.ts.map +0 -1
- package/lib/utils/string.d.ts.map +0 -1
- package/lib/utils/styles/classnames.d.ts.map +0 -1
- package/lib/utils/styles/get-classname.d.ts.map +0 -1
- package/lib/utils/styles/index.d.ts.map +0 -1
- /package/{LICENSE → dist/LICENSE} +0 -0
- /package/{index.d.ts → dist/index.d.ts} +0 -0
- /package/{lib → dist/lib}/components/Button.d.ts +0 -0
- /package/{lib → dist/lib}/components/Card.d.ts +0 -0
- /package/{lib → dist/lib}/components/Carousel.d.ts +0 -0
- /package/{lib → dist/lib}/components/CarouselItem.d.ts +0 -0
- /package/{lib → dist/lib}/components/Fab.d.ts +0 -0
- /package/{lib → dist/lib}/components/IconButton.d.ts +0 -0
- /package/{lib → dist/lib}/components/NavigationRail.d.ts +0 -0
- /package/{lib → dist/lib}/components/NavigationRailItem.d.ts +0 -0
- /package/{lib → dist/lib}/components/ProgressIndicator.d.ts +0 -0
- /package/{lib → dist/lib}/components/Slider.d.ts +0 -0
- /package/{lib → dist/lib}/components/Snackbar.d.ts +0 -0
- /package/{lib → dist/lib}/components/Switch.d.ts +0 -0
- /package/{lib → dist/lib}/components/Tab.d.ts +0 -0
- /package/{lib → dist/lib}/components/Tabs.d.ts +0 -0
- /package/{lib → dist/lib}/components/TextField.d.ts +0 -0
- /package/{lib → dist/lib}/components/ToolTip.d.ts +0 -0
- /package/{lib → dist/lib}/components/index.d.ts +0 -0
- /package/{lib → dist/lib}/effects/SyncedFixedWrapper.d.ts +0 -0
- /package/{lib → dist/lib}/effects/custom-scroll/custom-scroll.effect.d.ts +0 -0
- /package/{lib → dist/lib}/effects/custom-scroll/custom-scroll.interface.d.ts +0 -0
- /package/{lib → dist/lib}/effects/custom-scroll/custom-scroll.style.d.ts +0 -0
- /package/{lib → dist/lib}/effects/custom-scroll/index.d.ts +0 -0
- /package/{lib → dist/lib}/effects/index.d.ts +0 -0
- /package/{lib → dist/lib}/effects/ripple/RippleEffect.d.ts +0 -0
- /package/{lib → dist/lib}/effects/ripple/index.d.ts +0 -0
- /package/{lib → dist/lib}/effects/smooth-scroll.effect.d.ts +0 -0
- /package/{lib → dist/lib}/icon/icon.d.ts +0 -0
- /package/{lib → dist/lib}/icon/index.d.ts +0 -0
- /package/{lib → dist/lib}/index.d.ts +0 -0
- /package/{lib → dist/lib}/interfaces/button.interface.d.ts +0 -0
- /package/{lib → dist/lib}/interfaces/card.interface.d.ts +0 -0
- /package/{lib → dist/lib}/interfaces/carousel-item.interface.d.ts +0 -0
- /package/{lib → dist/lib}/interfaces/carousel.interface.d.ts +0 -0
- /package/{lib → dist/lib}/interfaces/divider.interface.d.ts +0 -0
- /package/{lib → dist/lib}/interfaces/fab.interface.d.ts +0 -0
- /package/{lib → dist/lib}/interfaces/icon-button.interface.d.ts +0 -0
- /package/{lib → dist/lib}/interfaces/index.d.ts +0 -0
- /package/{lib → dist/lib}/interfaces/navigation-rail-item.interface.d.ts +0 -0
- /package/{lib → dist/lib}/interfaces/navigation-rail.interface.d.ts +0 -0
- /package/{lib → dist/lib}/interfaces/progress-indicator.interface.d.ts +0 -0
- /package/{lib → dist/lib}/interfaces/slider.interface.d.ts +0 -0
- /package/{lib → dist/lib}/interfaces/snackbar.interface.d.ts +0 -0
- /package/{lib → dist/lib}/interfaces/switch.interface.d.ts +0 -0
- /package/{lib → dist/lib}/interfaces/tab.interface.d.ts +0 -0
- /package/{lib → dist/lib}/interfaces/text-field.interface.d.ts +0 -0
- /package/{lib → dist/lib}/interfaces/tooltip.interface.d.ts +0 -0
- /package/{lib → dist/lib}/styles/button.style.d.ts +0 -0
- /package/{lib → dist/lib}/styles/card.style.d.ts +0 -0
- /package/{lib → dist/lib}/styles/carousel-item.style.d.ts +0 -0
- /package/{lib → dist/lib}/styles/carousel.style.d.ts +0 -0
- /package/{lib → dist/lib}/styles/divider.style.d.ts +0 -0
- /package/{lib → dist/lib}/styles/fab.style.d.ts +0 -0
- /package/{lib → dist/lib}/styles/icon-button.style.d.ts +0 -0
- /package/{lib → dist/lib}/styles/index.d.ts +0 -0
- /package/{lib → dist/lib}/styles/navigation-rail-item.style.d.ts +0 -0
- /package/{lib → dist/lib}/styles/navigation-rail.style.d.ts +0 -0
- /package/{lib → dist/lib}/styles/progress-indicator.style.d.ts +0 -0
- /package/{lib → dist/lib}/styles/slider.style.d.ts +0 -0
- /package/{lib → dist/lib}/styles/snackbar.style.d.ts +0 -0
- /package/{lib → dist/lib}/styles/switch.style.d.ts +0 -0
- /package/{lib → dist/lib}/styles/tab.style.d.ts +0 -0
- /package/{lib → dist/lib}/styles/text-field.style.d.ts +0 -0
- /package/{lib → dist/lib}/styles/tooltip.style.d.ts +0 -0
- /package/{lib → dist/lib}/utils/component-helper.d.ts +0 -0
- /package/{lib → dist/lib}/utils/component.d.ts +0 -0
- /package/{lib → dist/lib}/utils/index.d.ts +0 -0
- /package/{lib → dist/lib}/utils/string.d.ts +0 -0
- /package/{lib → dist/lib}/utils/styles/classnames.d.ts +0 -0
- /package/{lib → dist/lib}/utils/styles/get-classname.d.ts +0 -0
- /package/{lib → dist/lib}/utils/styles/index.d.ts +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { SmoothScroll } from '../../';
|
|
3
|
+
import { JSX } from 'react/jsx-runtime';
|
|
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: 'effect/SmoothScroll',
|
|
8
|
+
component: SmoothScroll,
|
|
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
|
+
argTypes: {},
|
|
16
|
+
} satisfies Meta<typeof SmoothScroll>;
|
|
17
|
+
|
|
18
|
+
export default meta;
|
|
19
|
+
type Story = StoryObj<typeof meta>;
|
|
20
|
+
|
|
21
|
+
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
|
22
|
+
|
|
23
|
+
const createSmoothScrollStory = () => {
|
|
24
|
+
const SmoothScrollStory: () => JSX.Element = () => (
|
|
25
|
+
<div className={'h-96'}>
|
|
26
|
+
<SmoothScroll transition={'1s'}>
|
|
27
|
+
<div className={' h-52 bg-primary'} />
|
|
28
|
+
<div className={' h-52 bg-secondary'} />
|
|
29
|
+
<div className={' h-52 bg-tertiary'} />{' '}
|
|
30
|
+
<div className={' h-52 bg-primary'} />
|
|
31
|
+
<div className={' h-52 bg-secondary'} />
|
|
32
|
+
<div className={' h-52 bg-tertiary'} />{' '}
|
|
33
|
+
<div className={' h-52 bg-primary'} />
|
|
34
|
+
<div className={' h-52 bg-secondary'} />
|
|
35
|
+
<div className={' h-52 bg-tertiary'} />{' '}
|
|
36
|
+
<div className={' h-52 bg-primary'} />
|
|
37
|
+
<div className={' h-52 bg-secondary'} />
|
|
38
|
+
<div className={' h-52 bg-tertiary'} />
|
|
39
|
+
</SmoothScroll>
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
return SmoothScrollStory;
|
|
44
|
+
};
|
|
45
|
+
export const SmoothScrollStory = createSmoothScrollStory();
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,122 @@
|
|
|
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();
|
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,102 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,85 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
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 });
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
5
|
+
import {
|
|
6
|
+
faCircleXmark,
|
|
7
|
+
faMagnifyingGlass,
|
|
8
|
+
} from '@fortawesome/free-solid-svg-icons';
|
|
9
|
+
import {
|
|
10
|
+
IconButton,
|
|
11
|
+
ReactProps,
|
|
12
|
+
TextField,
|
|
13
|
+
TextFieldInterface,
|
|
14
|
+
TextFieldVariant,
|
|
15
|
+
} from '../../';
|
|
16
|
+
|
|
17
|
+
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
18
|
+
const meta = {
|
|
19
|
+
title: 'Text Inputs/TextField',
|
|
20
|
+
component: TextField,
|
|
21
|
+
parameters: {
|
|
22
|
+
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
|
23
|
+
},
|
|
24
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
25
|
+
tags: ['autodocs'],
|
|
26
|
+
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
|
27
|
+
argTypes: {},
|
|
28
|
+
} satisfies Meta<typeof TextField>;
|
|
29
|
+
|
|
30
|
+
export default meta;
|
|
31
|
+
type Story = StoryObj<typeof meta>;
|
|
32
|
+
|
|
33
|
+
// Function to create TextField stories
|
|
34
|
+
const createTextFieldStory = (
|
|
35
|
+
variant: TextFieldVariant,
|
|
36
|
+
args?: Partial<ReactProps<TextFieldInterface>>,
|
|
37
|
+
) => {
|
|
38
|
+
const TextFieldStory: Story = (args: ReactProps<TextFieldInterface>) => (
|
|
39
|
+
<div className="">
|
|
40
|
+
<div className="flex m-4 gap-4 items-center">
|
|
41
|
+
<TextField {...args} name={'example' + uuidv4()} value="Input" />
|
|
42
|
+
<TextField
|
|
43
|
+
{...args}
|
|
44
|
+
name={'example' + uuidv4()}
|
|
45
|
+
value="Input"
|
|
46
|
+
errorText="invalid value"
|
|
47
|
+
/>
|
|
48
|
+
<TextField
|
|
49
|
+
{...args}
|
|
50
|
+
name={'example' + uuidv4()}
|
|
51
|
+
value="Input"
|
|
52
|
+
disabled
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
55
|
+
<div className="flex m-4 gap-4 items-center">
|
|
56
|
+
<TextField {...args} name={'example' + uuidv4()} />
|
|
57
|
+
<TextField
|
|
58
|
+
{...args}
|
|
59
|
+
name={'example' + uuidv4()}
|
|
60
|
+
errorText="invalid value"
|
|
61
|
+
/>
|
|
62
|
+
<TextField {...args} name={'example' + uuidv4()} disabled />
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
TextFieldStory.args = {
|
|
67
|
+
variant: variant,
|
|
68
|
+
label: 'Label',
|
|
69
|
+
placeholder: 'Placeholder',
|
|
70
|
+
supportingText: 'Supporting text',
|
|
71
|
+
...args,
|
|
72
|
+
};
|
|
73
|
+
return TextFieldStory;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const Filled = createTextFieldStory('filled');
|
|
77
|
+
|
|
78
|
+
export const FilledTrailingIcon = createTextFieldStory('filled', {
|
|
79
|
+
trailingIcon: (
|
|
80
|
+
<IconButton
|
|
81
|
+
onClick={() => console.log('clicked')}
|
|
82
|
+
arialLabel="Action description"
|
|
83
|
+
icon={faCircleXmark}
|
|
84
|
+
/>
|
|
85
|
+
),
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
export const FilledLealingIconAndTrailingIcon = createTextFieldStory('filled', {
|
|
89
|
+
leadingIcon: faMagnifyingGlass,
|
|
90
|
+
trailingIcon: (
|
|
91
|
+
<IconButton
|
|
92
|
+
onClick={() => console.log('clicked')}
|
|
93
|
+
arialLabel="Action description"
|
|
94
|
+
icon={faCircleXmark}
|
|
95
|
+
/>
|
|
96
|
+
),
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
export const FilledLealingIcon = createTextFieldStory('filled', {
|
|
100
|
+
leadingIcon: faMagnifyingGlass,
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
export const Outlined = createTextFieldStory('outlined');
|
|
104
|
+
|
|
105
|
+
export const OutlinedTrailingIcon = createTextFieldStory('outlined', {
|
|
106
|
+
trailingIcon: (
|
|
107
|
+
<IconButton
|
|
108
|
+
onClick={() => console.log('clicked')}
|
|
109
|
+
arialLabel="Action description"
|
|
110
|
+
icon={faCircleXmark}
|
|
111
|
+
/>
|
|
112
|
+
),
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
export const OutlinedLealingIconAndTrailingIcon = createTextFieldStory(
|
|
116
|
+
'outlined',
|
|
117
|
+
{
|
|
118
|
+
leadingIcon: faMagnifyingGlass,
|
|
119
|
+
trailingIcon: (
|
|
120
|
+
<IconButton
|
|
121
|
+
onClick={() => console.log('clicked')}
|
|
122
|
+
arialLabel="Action description"
|
|
123
|
+
icon={faCircleXmark}
|
|
124
|
+
/>
|
|
125
|
+
),
|
|
126
|
+
},
|
|
127
|
+
);
|
|
128
|
+
|
|
129
|
+
export const OutlinedLealingIcon = createTextFieldStory('outlined', {
|
|
130
|
+
leadingIcon: faMagnifyingGlass,
|
|
131
|
+
className: () => ({
|
|
132
|
+
textField: 'w-full md:w-fit md:flex-1 ',
|
|
133
|
+
content: 'rounded-full overflow-hidden bg-surface',
|
|
134
|
+
}),
|
|
135
|
+
});
|