@shohojdhara/atomix 0.1.30 → 0.2.2
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/CHANGELOG.md +0 -0
- package/LICENSE +0 -0
- package/README.md +128 -43
- package/dist/atomix.css +15025 -0
- package/dist/atomix.min.css +15 -0
- package/dist/index.d.ts +6459 -1748
- package/dist/index.esm.js +17559 -8364
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +17603 -8369
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/themes/boomdevs.css +14677 -0
- package/dist/themes/boomdevs.min.css +405 -0
- package/dist/themes/esrar.css +16870 -0
- package/dist/themes/esrar.min.css +189 -0
- package/dist/themes/mashroom.css +29578 -0
- package/dist/themes/mashroom.min.css +403 -0
- package/dist/themes/shaj-default.css +15702 -0
- package/dist/themes/shaj-default.min.css +500 -0
- package/dist/themes/yabai.css +15207 -0
- package/dist/themes/yabai.min.css +189 -0
- package/package.json +126 -99
- package/src/components/Accordion/Accordion.stories.tsx +271 -0
- package/src/components/Accordion/Accordion.tsx +131 -0
- package/src/components/Accordion/index.ts +3 -0
- package/src/components/AtomixLogo/AtomixLogo.tsx +36 -0
- package/src/components/AtomixLogo/index.ts +3 -0
- package/src/components/AtomixLogo.tsx +40 -0
- package/src/components/Avatar/Avatar.stories.tsx +257 -0
- package/src/components/Avatar/Avatar.tsx +68 -0
- package/src/components/Avatar/AvatarGroup.tsx +73 -0
- package/src/components/Avatar/index.ts +3 -0
- package/src/components/Badge/Badge.stories.tsx +371 -0
- package/src/components/Badge/Badge.tsx +39 -0
- package/src/components/Badge/index.ts +3 -0
- package/src/components/Block/Block.stories.tsx +408 -0
- package/src/components/Block/Block.tsx +137 -0
- package/src/components/Block/index.ts +1 -0
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +106 -0
- package/src/components/Breadcrumb/Breadcrumb.tsx +112 -0
- package/src/components/Breadcrumb/index.ts +3 -0
- package/src/components/Button/Button.stories.tsx +312 -0
- package/src/components/Button/Button.tsx +69 -0
- package/src/components/Button/index.ts +3 -0
- package/src/components/Callout/Callout.stories.tsx +588 -0
- package/src/components/Callout/Callout.tsx +78 -0
- package/src/components/Callout/index.ts +1 -0
- package/src/components/Card/Card.stories.tsx +105 -0
- package/src/components/Card/Card.tsx +69 -0
- package/src/components/Card/ElevationCard.tsx +47 -0
- package/src/components/Card/index.ts +15 -0
- package/src/components/Chart/AdvancedChart.tsx +624 -0
- package/src/components/Chart/AnimatedChart.tsx +206 -0
- package/src/components/Chart/AreaChart.tsx +27 -0
- package/src/components/Chart/BarChart.tsx +148 -0
- package/src/components/Chart/BubbleChart.tsx +411 -0
- package/src/components/Chart/CandlestickChart.tsx +765 -0
- package/src/components/Chart/Chart.stories.tsx +527 -0
- package/src/components/Chart/Chart.tsx +218 -0
- package/src/components/Chart/ChartRenderer.tsx +322 -0
- package/src/components/Chart/ChartToolbar.tsx +436 -0
- package/src/components/Chart/ChartTooltip.tsx +101 -0
- package/src/components/Chart/DonutChart.tsx +370 -0
- package/src/components/Chart/FunnelChart.tsx +393 -0
- package/src/components/Chart/GaugeChart.tsx +550 -0
- package/src/components/Chart/HeatmapChart.tsx +614 -0
- package/src/components/Chart/LineChart.tsx +172 -0
- package/src/components/Chart/LineChartNew.tsx +167 -0
- package/src/components/Chart/MultiAxisChart.tsx +498 -0
- package/src/components/Chart/PieChart.tsx +103 -0
- package/src/components/Chart/RadarChart.tsx +332 -0
- package/src/components/Chart/RealTimeChart.tsx +436 -0
- package/src/components/Chart/ScatterChart.tsx +152 -0
- package/src/components/Chart/TreemapChart.tsx +574 -0
- package/src/components/Chart/WaterfallChart.tsx +450 -0
- package/src/components/Chart/index.ts +119 -0
- package/src/components/Chart/types.ts +338 -0
- package/src/components/ColorModeToggle/ColorModeToggle.stories.tsx +44 -0
- package/src/components/ColorModeToggle/ColorModeToggle.tsx +85 -0
- package/src/components/ColorModeToggle/index.ts +2 -0
- package/src/components/Countdown/Countdown.stories.tsx +46 -0
- package/src/components/Countdown/Countdown.tsx +90 -0
- package/src/components/Countdown/index.ts +2 -0
- package/src/components/DataTable/DataTable.stories.tsx +248 -0
- package/src/components/DataTable/DataTable.tsx +213 -0
- package/src/components/DataTable/index.ts +3 -0
- package/src/components/DatePicker/DatePicker.stories.tsx +364 -0
- package/src/components/DatePicker/DatePicker.tsx +504 -0
- package/src/components/DatePicker/index.ts +4 -0
- package/src/components/DatePicker/readme.md +106 -0
- package/src/components/DatePicker/types.ts +167 -0
- package/src/components/DatePicker/utils.ts +185 -0
- package/src/components/Dropdown/Dropdown.stories.tsx +358 -0
- package/src/components/Dropdown/Dropdown.tsx +352 -0
- package/src/components/Dropdown/index.ts +14 -0
- package/src/components/Dropdown/readme.md +151 -0
- package/src/components/EdgePanel/EdgePanel.stories.tsx +266 -0
- package/src/components/EdgePanel/EdgePanel.tsx +73 -0
- package/src/components/EdgePanel/index.ts +1 -0
- package/src/components/Footer/Footer.stories.tsx +388 -0
- package/src/components/Footer/Footer.tsx +197 -0
- package/src/components/Footer/FooterLink.tsx +72 -0
- package/src/components/Footer/FooterSection.tsx +87 -0
- package/src/components/Footer/FooterSocialLink.tsx +117 -0
- package/src/components/Footer/README.md +261 -0
- package/src/components/Footer/index.ts +13 -0
- package/src/components/Form/Checkbox.stories.tsx +76 -0
- package/src/components/Form/Checkbox.tsx +69 -0
- package/src/components/Form/Form.stories.tsx +497 -0
- package/src/components/Form/Form.tsx +46 -0
- package/src/components/Form/FormGroup.stories.tsx +162 -0
- package/src/components/Form/FormGroup.tsx +53 -0
- package/src/components/Form/Input.stories.tsx +106 -0
- package/src/components/Form/Input.tsx +87 -0
- package/src/components/Form/Radio.stories.tsx +94 -0
- package/src/components/Form/Radio.tsx +65 -0
- package/src/components/Form/Select.stories.tsx +151 -0
- package/src/components/Form/Select.tsx +191 -0
- package/src/components/Form/Textarea.stories.tsx +123 -0
- package/src/components/Form/Textarea.tsx +78 -0
- package/src/components/Form/index.ts +7 -0
- package/src/components/Hero/Hero.stories.tsx +295 -0
- package/src/components/Hero/Hero.tsx +175 -0
- package/src/components/Hero/index.ts +6 -0
- package/src/components/Icon/Icon.tsx +87 -0
- package/src/components/Icon/index.ts +2 -0
- package/src/components/List/List.stories.tsx +122 -0
- package/src/components/List/List.tsx +35 -0
- package/src/components/List/ListGroup.tsx +35 -0
- package/src/components/List/index.ts +2 -0
- package/src/components/Messages/Messages.stories.tsx +160 -0
- package/src/components/Messages/Messages.tsx +172 -0
- package/src/components/Messages/index.ts +3 -0
- package/src/components/Modal/Modal.stories.tsx +284 -0
- package/src/components/Modal/Modal.tsx +198 -0
- package/src/components/Modal/README.md +169 -0
- package/src/components/Modal/index.ts +1 -0
- package/src/components/Navigation/Menu/MegaMenu.tsx +109 -0
- package/src/components/Navigation/Menu/Menu.stories.tsx +339 -0
- package/src/components/Navigation/Menu/Menu.tsx +111 -0
- package/src/components/Navigation/Nav/Nav.stories.tsx +456 -0
- package/src/components/Navigation/Nav/Nav.tsx +51 -0
- package/src/components/Navigation/Nav/NavDropdown.tsx +105 -0
- package/src/components/Navigation/Nav/NavItem.tsx +168 -0
- package/src/components/Navigation/Navbar/Navbar.stories.tsx +569 -0
- package/src/components/Navigation/Navbar/Navbar.tsx +150 -0
- package/src/components/Navigation/README.md +314 -0
- package/src/components/Navigation/SideMenu/SideMenu.README.md +494 -0
- package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +609 -0
- package/src/components/Navigation/SideMenu/SideMenu.tsx +101 -0
- package/src/components/Navigation/SideMenu/SideMenuItem.tsx +103 -0
- package/src/components/Navigation/SideMenu/SideMenuList.tsx +41 -0
- package/src/components/Navigation/index.ts +23 -0
- package/src/components/Pagination/Pagination.stories.tsx +188 -0
- package/src/components/Pagination/Pagination.tsx +162 -0
- package/src/components/Pagination/index.ts +1 -0
- package/src/components/PhotoViewer/PhotoViewer.stories.tsx +397 -0
- package/src/components/PhotoViewer/PhotoViewer.tsx +246 -0
- package/src/components/PhotoViewer/PhotoViewerHeader.tsx +184 -0
- package/src/components/PhotoViewer/PhotoViewerImage.tsx +173 -0
- package/src/components/PhotoViewer/PhotoViewerInfo.tsx +91 -0
- package/src/components/PhotoViewer/PhotoViewerNavigation.tsx +85 -0
- package/src/components/PhotoViewer/PhotoViewerThumbnails.tsx +63 -0
- package/src/components/PhotoViewer/README.md +358 -0
- package/src/components/PhotoViewer/examples/ImageGallery.tsx +187 -0
- package/src/components/PhotoViewer/examples/SimpleGallery.tsx +73 -0
- package/src/components/PhotoViewer/examples/index.ts +2 -0
- package/src/components/PhotoViewer/index.ts +14 -0
- package/src/components/Popover/Popover.stories.tsx +143 -0
- package/src/components/Popover/Popover.tsx +137 -0
- package/src/components/Popover/index.ts +5 -0
- package/src/components/Popover/readme.md +120 -0
- package/src/components/ProductReview/ProductReview.stories.tsx +88 -0
- package/src/components/ProductReview/ProductReview.tsx +169 -0
- package/src/components/ProductReview/index.ts +3 -0
- package/src/components/Progress/Progress.stories.tsx +75 -0
- package/src/components/Progress/Progress.tsx +45 -0
- package/src/components/Progress/index.ts +1 -0
- package/src/components/Rating/Rating.stories.tsx +109 -0
- package/src/components/Rating/Rating.tsx +286 -0
- package/src/components/Rating/index.ts +6 -0
- package/src/components/River/River.stories.tsx +230 -0
- package/src/components/River/River.tsx +134 -0
- package/src/components/River/index.ts +2 -0
- package/src/components/SectionIntro/SectionIntro.stories.tsx +143 -0
- package/src/components/SectionIntro/SectionIntro.tsx +182 -0
- package/src/components/SectionIntro/index.ts +3 -0
- package/src/components/Slider/Slider.stories.tsx +825 -0
- package/src/components/Slider/Slider.tsx +227 -0
- package/src/components/Slider/index.ts +24 -0
- package/src/components/Spinner/Spinner.stories.tsx +65 -0
- package/src/components/Spinner/Spinner.tsx +36 -0
- package/src/components/Spinner/index.ts +2 -0
- package/src/components/Steps/Steps.stories.tsx +158 -0
- package/src/components/Steps/Steps.tsx +115 -0
- package/src/components/Steps/index.ts +3 -0
- package/src/components/Tab/Tab.stories.tsx +129 -0
- package/src/components/Tab/Tab.tsx +111 -0
- package/src/components/Tab/index.ts +2 -0
- package/src/components/Testimonial/Testimonial.stories.tsx +180 -0
- package/src/components/Testimonial/Testimonial.tsx +138 -0
- package/src/components/Testimonial/index.ts +3 -0
- package/src/components/Todo/Todo.stories.tsx +103 -0
- package/src/components/Todo/Todo.tsx +158 -0
- package/src/components/Todo/index.ts +1 -0
- package/src/components/Toggle/Toggle.stories.tsx +49 -0
- package/src/components/Toggle/Toggle.tsx +84 -0
- package/src/components/Toggle/index.ts +2 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +115 -0
- package/src/components/Tooltip/Tooltip.tsx +150 -0
- package/src/components/Tooltip/index.ts +3 -0
- package/src/components/Upload/Upload.stories.tsx +220 -0
- package/src/components/Upload/Upload.tsx +354 -0
- package/src/components/Upload/index.ts +3 -0
- package/src/components/VideoPlayer/VideoPlayer.stories.tsx +484 -0
- package/src/components/VideoPlayer/VideoPlayer.tsx +574 -0
- package/src/components/VideoPlayer/index.ts +7 -0
- package/src/components/index.ts +124 -0
- package/src/layouts/Grid/Container.tsx +58 -0
- package/src/layouts/Grid/Grid.stories.tsx +928 -0
- package/src/layouts/Grid/Grid.tsx +68 -0
- package/src/layouts/Grid/GridCol.tsx +161 -0
- package/src/layouts/Grid/README.md +108 -0
- package/src/layouts/Grid/Row.tsx +70 -0
- package/src/layouts/Grid/index.ts +8 -0
- package/src/layouts/MasonryGrid/MasonryGrid.stories.tsx +387 -0
- package/src/layouts/MasonryGrid/MasonryGrid.tsx +408 -0
- package/src/layouts/MasonryGrid/MasonryGridItem.tsx +44 -0
- package/src/layouts/MasonryGrid/README.md +117 -0
- package/src/layouts/MasonryGrid/index.ts +4 -0
- package/src/layouts/index.ts +7 -0
- package/src/lib/README.md +89 -0
- package/src/lib/composables/index.ts +63 -0
- package/src/lib/composables/useAccordion.ts +129 -0
- package/src/lib/composables/useAmbientMode.ts +90 -0
- package/src/lib/composables/useBadge.ts +42 -0
- package/src/lib/composables/useBarChart.ts +365 -0
- package/src/lib/composables/useBlock.ts +56 -0
- package/src/lib/composables/useBreadcrumb.ts +81 -0
- package/src/lib/composables/useButton.ts +59 -0
- package/src/lib/composables/useCallout.ts +55 -0
- package/src/lib/composables/useCard.ts +155 -0
- package/src/lib/composables/useChart.ts +1082 -0
- package/src/lib/composables/useChartAnalytics.ts +505 -0
- package/src/lib/composables/useChartData.ts +38 -0
- package/src/lib/composables/useChartExport.ts +392 -0
- package/src/lib/composables/useChartInteraction.ts +34 -0
- package/src/lib/composables/useChartInteractions.ts +123 -0
- package/src/lib/composables/useChartPerformance.ts +323 -0
- package/src/lib/composables/useChartScale.ts +48 -0
- package/src/lib/composables/useChartToolbar.ts +532 -0
- package/src/lib/composables/useCheckbox.ts +70 -0
- package/src/lib/composables/useDataTable.ts +208 -0
- package/src/lib/composables/useDatePicker.ts +564 -0
- package/src/lib/composables/useDropdown.ts +272 -0
- package/src/lib/composables/useEdgePanel.ts +261 -0
- package/src/lib/composables/useFooter.ts +85 -0
- package/src/lib/composables/useForm.ts +62 -0
- package/src/lib/composables/useFormGroup.ts +51 -0
- package/src/lib/composables/useHero.ts +250 -0
- package/src/lib/composables/useInput.ts +58 -0
- package/src/lib/composables/useLineChart.ts +319 -0
- package/src/lib/composables/useMessages.ts +77 -0
- package/src/lib/composables/useModal.ts +110 -0
- package/src/lib/composables/useNavbar.ts +288 -0
- package/src/lib/composables/usePagination.ts +101 -0
- package/src/lib/composables/usePhotoViewer.ts +937 -0
- package/src/lib/composables/usePieChart.ts +362 -0
- package/src/lib/composables/usePopover.ts +354 -0
- package/src/lib/composables/useProgress.ts +74 -0
- package/src/lib/composables/useRadio.ts +47 -0
- package/src/lib/composables/useRating.ts +174 -0
- package/src/lib/composables/useRiver.ts +205 -0
- package/src/lib/composables/useSelect.ts +52 -0
- package/src/lib/composables/useSideMenu.ts +197 -0
- package/src/lib/composables/useSlider.ts +526 -0
- package/src/lib/composables/useSpinner.ts +42 -0
- package/src/lib/composables/useTextarea.ts +55 -0
- package/src/lib/composables/useTodo.ts +141 -0
- package/src/lib/composables/useVideoPlayer.ts +398 -0
- package/src/lib/constants/components.ts +1518 -0
- package/src/lib/constants/index.ts +4 -0
- package/src/lib/index.ts +11 -0
- package/src/lib/types/components.ts +5020 -0
- package/src/lib/types/index.ts +2 -0
- package/src/lib/utils/dom.ts +41 -0
- package/src/lib/utils/icons.ts +74 -0
- package/src/lib/utils/index.ts +55 -0
- package/src/lib/utils/useForkRef.test.tsx +64 -0
- package/src/lib/utils/useForkRef.ts +36 -0
- package/src/lib/utils.test.ts +14 -0
- package/src/styles/01-settings/_index.scss +3 -0
- package/src/styles/01-settings/_settings.accordion.scss +22 -19
- package/src/styles/01-settings/_settings.animations.scss +5 -5
- package/src/styles/01-settings/_settings.avatar-group.scss +7 -4
- package/src/styles/01-settings/_settings.avatar.scss +19 -20
- package/src/styles/01-settings/_settings.background.scss +9 -0
- package/src/styles/01-settings/_settings.badge.scss +15 -9
- package/src/styles/01-settings/_settings.block.scss +11 -0
- package/src/styles/01-settings/_settings.border-radius.scss +12 -9
- package/src/styles/01-settings/_settings.border.scss +4 -1
- package/src/styles/01-settings/_settings.box-shadow.scss +1 -1
- package/src/styles/01-settings/_settings.breadcrumb.scss +16 -9
- package/src/styles/01-settings/_settings.breakpoints.scss +0 -0
- package/src/styles/01-settings/_settings.btn-group.scss +4 -1
- package/src/styles/01-settings/_settings.button.scss +19 -21
- package/src/styles/01-settings/_settings.callout.scss +42 -24
- package/src/styles/01-settings/_settings.card.scss +13 -11
- package/src/styles/01-settings/_settings.chart.scss +199 -0
- package/src/styles/01-settings/_settings.checkbox-group.scss +5 -2
- package/src/styles/01-settings/_settings.checkbox.scss +10 -4
- package/src/styles/01-settings/_settings.color-mode.scss +0 -0
- package/src/styles/01-settings/_settings.colors.scss +20 -0
- package/src/styles/01-settings/_settings.config.scss +1 -1
- package/src/styles/01-settings/_settings.countdown.scss +6 -4
- package/src/styles/01-settings/_settings.data-table.scss +0 -0
- package/src/styles/01-settings/_settings.datepicker.scss +0 -0
- package/src/styles/01-settings/_settings.dropdown.scss +9 -7
- package/src/styles/01-settings/_settings.edge-panel.scss +3 -2
- package/src/styles/01-settings/_settings.fonts.scss +1 -1
- package/src/styles/01-settings/_settings.footer.scss +125 -0
- package/src/styles/01-settings/_settings.form-group.scss +3 -1
- package/src/styles/01-settings/_settings.form.scss +4 -2
- package/src/styles/01-settings/_settings.grid.scss +3 -3
- package/src/styles/01-settings/_settings.hero.scss +10 -8
- package/src/styles/01-settings/_settings.input.scss +9 -7
- package/src/styles/01-settings/_settings.link.scss +0 -0
- package/src/styles/01-settings/_settings.list-group.scss +4 -2
- package/src/styles/01-settings/_settings.list.scss +4 -2
- package/src/styles/01-settings/_settings.maps.scss +43 -8
- package/src/styles/01-settings/_settings.masonry-grid.scss +0 -0
- package/src/styles/01-settings/_settings.menu.scss +10 -8
- package/src/styles/01-settings/_settings.messages.scss +19 -17
- package/src/styles/01-settings/_settings.modal.scss +7 -5
- package/src/styles/01-settings/_settings.nav.scss +6 -4
- package/src/styles/01-settings/_settings.navbar.scss +8 -5
- package/src/styles/01-settings/_settings.pagination.scss +5 -3
- package/src/styles/01-settings/_settings.photoviewer.scss +89 -23
- package/src/styles/01-settings/_settings.popover.scss +6 -4
- package/src/styles/01-settings/_settings.position.scss +0 -0
- package/src/styles/01-settings/_settings.progress.scss +0 -0
- package/src/styles/01-settings/_settings.rating.scss +5 -3
- package/src/styles/01-settings/_settings.river.scss +8 -6
- package/src/styles/01-settings/_settings.sectionintro.scss +8 -6
- package/src/styles/01-settings/_settings.select.scss +7 -5
- package/src/styles/01-settings/_settings.side-menu.scss +15 -13
- package/src/styles/01-settings/_settings.skeleton.scss +0 -0
- package/src/styles/01-settings/_settings.slider.scss +59 -0
- package/src/styles/01-settings/_settings.spacing.scss +15 -3
- package/src/styles/01-settings/_settings.spinner.scss +0 -0
- package/src/styles/01-settings/_settings.steps.scss +8 -6
- package/src/styles/01-settings/_settings.tabs.scss +11 -9
- package/src/styles/01-settings/_settings.testimonials.scss +6 -4
- package/src/styles/01-settings/_settings.todo.scss +0 -0
- package/src/styles/01-settings/_settings.toggle.scss +4 -2
- package/src/styles/01-settings/_settings.tooltip.scss +5 -3
- package/src/styles/01-settings/_settings.typography.scss +2 -0
- package/src/styles/01-settings/_settings.upload.scss +22 -20
- package/src/styles/01-settings/_settings.video-player.scss +64 -0
- package/src/styles/01-settings/_settings.z-layers.scss +0 -0
- package/src/styles/02-tools/_index.scss +1 -0
- package/src/styles/02-tools/_tools.animations.scss +82 -0
- package/src/styles/02-tools/_tools.background.scss +85 -0
- package/src/styles/02-tools/_tools.border-radius.scss +0 -0
- package/src/styles/02-tools/_tools.breakpoints.scss +0 -0
- package/src/styles/02-tools/_tools.button.scss +5 -0
- package/src/styles/02-tools/_tools.clearfix.scss +0 -0
- package/src/styles/02-tools/_tools.color-functions.scss +0 -0
- package/src/styles/02-tools/_tools.color-mode.scss +1 -1
- package/src/styles/02-tools/_tools.component.scss +479 -0
- package/src/styles/02-tools/_tools.event.scss +0 -0
- package/src/styles/02-tools/_tools.grid.scss +0 -0
- package/src/styles/02-tools/_tools.hidden-visually.scss +0 -0
- package/src/styles/02-tools/_tools.hidden.scss +0 -0
- package/src/styles/02-tools/_tools.map-loop.scss +0 -0
- package/src/styles/02-tools/_tools.media-queries.scss +0 -0
- package/src/styles/02-tools/_tools.object-fit.scss +0 -0
- package/src/styles/02-tools/_tools.placeholder.scss +0 -0
- package/src/styles/02-tools/_tools.rem.scss +19 -2
- package/src/styles/02-tools/_tools.size.scss +0 -0
- package/src/styles/02-tools/_tools.spacing.scss +0 -0
- package/src/styles/02-tools/_tools.to-rgb.scss +0 -0
- package/src/styles/02-tools/_tools.transition.scss +0 -0
- package/src/styles/02-tools/_tools.utilities.scss +0 -0
- package/src/styles/02-tools/_tools.utility-api.scss +55 -28
- package/src/styles/03-generic/_generic.fonts.scss +0 -0
- package/src/styles/03-generic/_generic.reset.scss +0 -0
- package/src/styles/03-generic/_generic.root.scss +19 -3
- package/src/styles/03-generic/_generic.selection.scss +0 -0
- package/src/styles/03-generic/_index.scss +0 -0
- package/src/styles/04-elements/_elements.all.scss +0 -0
- package/src/styles/04-elements/_elements.body.scss +24 -0
- package/src/styles/04-elements/_elements.heading.scss +0 -0
- package/src/styles/04-elements/_elements.html.scss +0 -0
- package/src/styles/04-elements/_elements.links.scss +0 -0
- package/src/styles/04-elements/_index.scss +0 -0
- package/src/styles/05-objects/_index.scss +1 -0
- package/src/styles/05-objects/_objects.block.scss +122 -0
- package/src/styles/05-objects/_objects.container.scss +14 -10
- package/src/styles/05-objects/_objects.grid.scss +0 -0
- package/src/styles/05-objects/_objects.masonry-grid.scss +0 -0
- package/src/styles/06-components/_components.accordion.scss +10 -4
- package/src/styles/06-components/_components.avatar-group.scss +2 -1
- package/src/styles/06-components/_components.avatar.scss +2 -1
- package/src/styles/06-components/_components.badge.scss +11 -10
- package/src/styles/06-components/_components.breadcrumb.scss +2 -1
- package/src/styles/06-components/_components.btn-group.scss +0 -0
- package/src/styles/06-components/_components.button.scss +4 -3
- package/src/styles/06-components/_components.callout.scss +5 -3
- package/src/styles/06-components/_components.card.scss +4 -3
- package/src/styles/06-components/_components.chart.scss +2103 -0
- package/src/styles/06-components/_components.checkbox-group.scss +0 -0
- package/src/styles/06-components/_components.checkbox.scss +2 -1
- package/src/styles/06-components/_components.color-mode-toggle.scss +3 -2
- package/src/styles/06-components/_components.countdown.scss +2 -1
- package/src/styles/06-components/_components.data-table.scss +7 -6
- package/src/styles/06-components/_components.datepicker.scss +2 -1
- package/src/styles/06-components/_components.dropdown.scss +4 -3
- package/src/styles/06-components/_components.edge-panel.scss +4 -3
- package/src/styles/06-components/_components.footer.scss +825 -0
- package/src/styles/06-components/_components.form-group.scss +1 -0
- package/src/styles/06-components/_components.form.scss +0 -0
- package/src/styles/06-components/_components.hero.scss +4 -2
- package/src/styles/06-components/_components.icon.scss +2 -2
- package/src/styles/06-components/_components.image-gallery.scss +1 -0
- package/src/styles/06-components/_components.input.scss +2 -1
- package/src/styles/06-components/_components.list-group.scss +3 -2
- package/src/styles/06-components/_components.list.scss +2 -1
- package/src/styles/06-components/_components.menu.scss +5 -4
- package/src/styles/06-components/_components.messages.scss +8 -7
- package/src/styles/06-components/_components.modal.scss +6 -2
- package/src/styles/06-components/_components.nav.scss +6 -5
- package/src/styles/06-components/_components.navbar.scss +4 -3
- package/src/styles/06-components/_components.pagination.scss +2 -1
- package/src/styles/06-components/_components.photoviewer.scss +604 -545
- package/src/styles/06-components/_components.popover.scss +3 -2
- package/src/styles/06-components/_components.product-review.scss +3 -2
- package/src/styles/06-components/_components.progress.scss +3 -2
- package/src/styles/06-components/_components.rating.scss +0 -0
- package/src/styles/06-components/_components.river.scss +3 -2
- package/src/styles/06-components/_components.sectionintro.scss +2 -1
- package/src/styles/06-components/_components.select.scss +5 -4
- package/src/styles/06-components/_components.side-menu.scss +8 -7
- package/src/styles/06-components/_components.skeleton.scss +3 -2
- package/src/styles/06-components/_components.slider.scss +274 -0
- package/src/styles/06-components/_components.spinner.scss +1 -0
- package/src/styles/06-components/_components.steps.scss +4 -2
- package/src/styles/06-components/_components.tabs.scss +4 -3
- package/src/styles/06-components/_components.testimonials.scss +2 -1
- package/src/styles/06-components/_components.todo.scss +3 -2
- package/src/styles/06-components/_components.toggle.scss +5 -4
- package/src/styles/06-components/_components.tooltip.scss +7 -11
- package/src/styles/06-components/_components.upload.scss +4 -3
- package/src/styles/06-components/_components.video-player.scss +624 -0
- package/src/styles/06-components/_index.scss +4 -0
- package/src/styles/06-components/old.chart.styles.scss +2819 -0
- package/src/styles/99-utilities/_index.scss +0 -0
- package/src/styles/99-utilities/_utilities.background.scss +0 -0
- package/src/styles/99-utilities/_utilities.border.scss +0 -0
- package/src/styles/99-utilities/_utilities.clearfix.scss +0 -0
- package/src/styles/99-utilities/_utilities.display.scss +0 -0
- package/src/styles/99-utilities/_utilities.flex.scss +0 -0
- package/src/styles/99-utilities/_utilities.link.scss +0 -0
- package/src/styles/99-utilities/_utilities.object-fit.scss +0 -0
- package/src/styles/99-utilities/_utilities.opacity.scss +0 -0
- package/src/styles/99-utilities/_utilities.overflow.scss +0 -0
- package/src/styles/99-utilities/_utilities.position.scss +0 -0
- package/src/styles/99-utilities/_utilities.scss +2 -1
- package/src/styles/99-utilities/_utilities.shadow.scss +0 -0
- package/src/styles/99-utilities/_utilities.sizes.scss +0 -0
- package/src/styles/99-utilities/_utilities.spacing.scss +0 -0
- package/src/styles/99-utilities/_utilities.text.scss +5 -0
- package/src/styles/99-utilities/_utilities.visibility.scss +0 -0
- package/src/styles/99-utilities/_utilities.visually-hidden.scss +0 -0
- package/src/styles/99-utilities/_utilities.z-index.scss +0 -0
- package/src/styles/css-modules.d.ts +0 -0
- package/src/styles/index.scss +0 -0
- package/dist/index.css +0 -15
- package/dist/index.esm.css +0 -15
- package/dist/index.min.css +0 -15
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { forwardRef, useMemo } from 'react';
|
|
2
|
+
import { useSlider } from '../../lib/composables/useSlider';
|
|
3
|
+
import { SliderProps } from '../../lib/types/components';
|
|
4
|
+
|
|
5
|
+
export const Slider = forwardRef<HTMLDivElement, SliderProps>((props, ref) => {
|
|
6
|
+
const {
|
|
7
|
+
slides = [],
|
|
8
|
+
height = 300,
|
|
9
|
+
width = '100%',
|
|
10
|
+
slidesToShow = 1,
|
|
11
|
+
spaceBetween = 0,
|
|
12
|
+
loop = false,
|
|
13
|
+
initialSlide = 0,
|
|
14
|
+
direction = 'horizontal',
|
|
15
|
+
speed = 300,
|
|
16
|
+
allowTouchMove = true,
|
|
17
|
+
threshold = 50,
|
|
18
|
+
grabCursor = true,
|
|
19
|
+
autoplay,
|
|
20
|
+
navigation,
|
|
21
|
+
pagination,
|
|
22
|
+
className,
|
|
23
|
+
onSlideChange,
|
|
24
|
+
...rest
|
|
25
|
+
} = props;
|
|
26
|
+
|
|
27
|
+
if (!slides || slides.length === 0) {
|
|
28
|
+
return (
|
|
29
|
+
<div className="c-slider c-slider--empty" style={{ height, width }}>
|
|
30
|
+
<div className="c-slider__empty-message">No slides available</div>
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const slider = useSlider({
|
|
36
|
+
slides,
|
|
37
|
+
slidesToShow,
|
|
38
|
+
spaceBetween,
|
|
39
|
+
loop,
|
|
40
|
+
initialSlide,
|
|
41
|
+
direction,
|
|
42
|
+
speed,
|
|
43
|
+
allowTouchMove,
|
|
44
|
+
threshold,
|
|
45
|
+
autoplay,
|
|
46
|
+
onSlideChange,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const {
|
|
50
|
+
containerRef,
|
|
51
|
+
wrapperRef,
|
|
52
|
+
allSlides,
|
|
53
|
+
realIndex,
|
|
54
|
+
translateValue,
|
|
55
|
+
slideWidth,
|
|
56
|
+
transitioning,
|
|
57
|
+
touching,
|
|
58
|
+
slideNext,
|
|
59
|
+
slidePrev,
|
|
60
|
+
goToSlide,
|
|
61
|
+
canSlideNext,
|
|
62
|
+
canSlidePrev,
|
|
63
|
+
handleTouchStart,
|
|
64
|
+
handleTouchMove,
|
|
65
|
+
handleTouchEnd,
|
|
66
|
+
loopedSlides,
|
|
67
|
+
} = slider;
|
|
68
|
+
|
|
69
|
+
const totalWrapperWidth = useMemo(() => {
|
|
70
|
+
if (slideWidth === 0) return 0;
|
|
71
|
+
return allSlides.length * (slideWidth + spaceBetween) - spaceBetween;
|
|
72
|
+
}, [allSlides.length, slideWidth, spaceBetween]);
|
|
73
|
+
|
|
74
|
+
const containerClasses = [
|
|
75
|
+
'c-slider',
|
|
76
|
+
direction === 'vertical' && 'c-slider--vertical',
|
|
77
|
+
grabCursor && 'c-slider--grab-cursor',
|
|
78
|
+
touching && 'c-slider--grabbing',
|
|
79
|
+
loop && 'c-slider--loop',
|
|
80
|
+
className,
|
|
81
|
+
]
|
|
82
|
+
.filter(Boolean)
|
|
83
|
+
.join(' ');
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<div
|
|
87
|
+
ref={ref || (containerRef as React.RefObject<HTMLDivElement>)}
|
|
88
|
+
className={containerClasses}
|
|
89
|
+
style={{
|
|
90
|
+
height: typeof height === 'number' ? `${height}px` : height,
|
|
91
|
+
width: typeof width === 'number' ? `${width}px` : width,
|
|
92
|
+
overflow: 'hidden',
|
|
93
|
+
position: 'relative',
|
|
94
|
+
cursor: grabCursor && !touching ? 'grab' : touching ? 'grabbing' : 'default',
|
|
95
|
+
...(rest as any).style,
|
|
96
|
+
}}
|
|
97
|
+
onTouchStart={handleTouchStart}
|
|
98
|
+
onTouchMove={handleTouchMove}
|
|
99
|
+
onTouchEnd={handleTouchEnd}
|
|
100
|
+
onMouseDown={handleTouchStart}
|
|
101
|
+
onMouseMove={handleTouchMove}
|
|
102
|
+
onMouseUp={handleTouchEnd}
|
|
103
|
+
onMouseLeave={handleTouchEnd}
|
|
104
|
+
>
|
|
105
|
+
<div
|
|
106
|
+
ref={wrapperRef as React.RefObject<HTMLDivElement>}
|
|
107
|
+
className="c-slider__wrapper"
|
|
108
|
+
style={{
|
|
109
|
+
display: 'flex',
|
|
110
|
+
flexDirection: direction === 'vertical' ? 'column' : 'row',
|
|
111
|
+
width: direction === 'horizontal' ? `${totalWrapperWidth}px` : '100%',
|
|
112
|
+
height: direction === 'vertical' ? `${totalWrapperWidth}px` : '100%',
|
|
113
|
+
transform:
|
|
114
|
+
direction === 'horizontal'
|
|
115
|
+
? `translateX(${translateValue}px)`
|
|
116
|
+
: `translateY(${translateValue}px)`,
|
|
117
|
+
transition:
|
|
118
|
+
transitioning && !slider.repositioningRef?.current
|
|
119
|
+
? `transform ${speed}ms ease-out`
|
|
120
|
+
: 'none',
|
|
121
|
+
willChange: 'transform',
|
|
122
|
+
}}
|
|
123
|
+
>
|
|
124
|
+
{allSlides.map((slide, index) => (
|
|
125
|
+
<div
|
|
126
|
+
key={slide.id || index}
|
|
127
|
+
className={[
|
|
128
|
+
'c-slider__slide',
|
|
129
|
+
(() => {
|
|
130
|
+
if (!loop) return index === realIndex;
|
|
131
|
+
// For triple array: check if this slide index matches current real index
|
|
132
|
+
return index % slides.length === realIndex;
|
|
133
|
+
})() && 'c-slider__slide--active',
|
|
134
|
+
(slide as any).isClone && 'c-slider__slide--duplicate',
|
|
135
|
+
]
|
|
136
|
+
.filter(Boolean)
|
|
137
|
+
.join(' ')}
|
|
138
|
+
style={{
|
|
139
|
+
width: direction === 'vertical' ? '100%' : `${slideWidth}px`,
|
|
140
|
+
height: direction === 'vertical' ? `${slideWidth}px` : '100%',
|
|
141
|
+
flexShrink: 0,
|
|
142
|
+
marginRight:
|
|
143
|
+
direction === 'horizontal' && index < allSlides.length - 1
|
|
144
|
+
? `${spaceBetween}px`
|
|
145
|
+
: 0,
|
|
146
|
+
marginBottom:
|
|
147
|
+
direction === 'vertical' && index < allSlides.length - 1 ? `${spaceBetween}px` : 0,
|
|
148
|
+
}}
|
|
149
|
+
>
|
|
150
|
+
{slide.video ? (
|
|
151
|
+
<video
|
|
152
|
+
src={slide.video.src}
|
|
153
|
+
poster={slide.video.poster}
|
|
154
|
+
autoPlay={slide.video.autoplay}
|
|
155
|
+
loop={slide.video.loop}
|
|
156
|
+
muted={slide.video.muted}
|
|
157
|
+
style={{ width: '100%', height: '100%', objectFit: 'cover' }}
|
|
158
|
+
/>
|
|
159
|
+
) : slide.backgroundImage ? (
|
|
160
|
+
<div
|
|
161
|
+
style={{
|
|
162
|
+
width: '100%',
|
|
163
|
+
height: '100%',
|
|
164
|
+
backgroundImage: `url(${slide.backgroundImage})`,
|
|
165
|
+
backgroundSize: 'cover',
|
|
166
|
+
backgroundPosition: 'center',
|
|
167
|
+
}}
|
|
168
|
+
>
|
|
169
|
+
{slide.content}
|
|
170
|
+
</div>
|
|
171
|
+
) : slide.image ? (
|
|
172
|
+
<img
|
|
173
|
+
src={slide.image}
|
|
174
|
+
alt={slide.alt || slide.title || ''}
|
|
175
|
+
style={{ width: '100%', height: '100%', objectFit: 'cover' }}
|
|
176
|
+
/>
|
|
177
|
+
) : (
|
|
178
|
+
slide.content
|
|
179
|
+
)}
|
|
180
|
+
|
|
181
|
+
{(slide.title || slide.description) && (
|
|
182
|
+
<div className="c-slider__slide-content">
|
|
183
|
+
{slide.title && <h3>{slide.title}</h3>}
|
|
184
|
+
{slide.description && <p>{slide.description}</p>}
|
|
185
|
+
</div>
|
|
186
|
+
)}
|
|
187
|
+
</div>
|
|
188
|
+
))}
|
|
189
|
+
</div>
|
|
190
|
+
|
|
191
|
+
{navigation && (
|
|
192
|
+
<div className="c-slider__navigation">
|
|
193
|
+
<button
|
|
194
|
+
type="button"
|
|
195
|
+
className="c-slider__navigation-prev"
|
|
196
|
+
onClick={slidePrev}
|
|
197
|
+
disabled={!canSlidePrev}
|
|
198
|
+
aria-label="Previous slide"
|
|
199
|
+
/>
|
|
200
|
+
<button
|
|
201
|
+
type="button"
|
|
202
|
+
className="c-slider__navigation-next"
|
|
203
|
+
onClick={slideNext}
|
|
204
|
+
disabled={!canSlideNext}
|
|
205
|
+
aria-label="Next slide"
|
|
206
|
+
/>
|
|
207
|
+
</div>
|
|
208
|
+
)}
|
|
209
|
+
|
|
210
|
+
{pagination && (
|
|
211
|
+
<div className="c-slider__pagination">
|
|
212
|
+
{slides.map((_, index) => (
|
|
213
|
+
<button
|
|
214
|
+
key={index}
|
|
215
|
+
type="button"
|
|
216
|
+
className={`c-slider__pagination-bullet ${index === realIndex ? 'c-slider__pagination-bullet--active' : ''}`}
|
|
217
|
+
onClick={() => goToSlide(index)}
|
|
218
|
+
aria-label={`Go to slide ${index + 1}`}
|
|
219
|
+
/>
|
|
220
|
+
))}
|
|
221
|
+
</div>
|
|
222
|
+
)}
|
|
223
|
+
</div>
|
|
224
|
+
);
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
Slider.displayName = 'Slider';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slider component exports
|
|
3
|
+
* Following Atomix design system patterns
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export type {
|
|
7
|
+
SliderProps,
|
|
8
|
+
SliderRefs,
|
|
9
|
+
SliderSlide,
|
|
10
|
+
SliderState,
|
|
11
|
+
SliderAutoplay,
|
|
12
|
+
SliderPagination,
|
|
13
|
+
SliderNavigation,
|
|
14
|
+
SliderScrollbar,
|
|
15
|
+
SliderEffect,
|
|
16
|
+
SliderThumbs,
|
|
17
|
+
SliderZoom,
|
|
18
|
+
SliderLazy,
|
|
19
|
+
SliderVirtual,
|
|
20
|
+
SliderBreakpoint,
|
|
21
|
+
} from '../../lib/types/components';
|
|
22
|
+
export { Slider } from './Slider';
|
|
23
|
+
export { useSlider } from '../../lib/composables/useSlider';
|
|
24
|
+
export type { UseSliderOptions, UseSliderReturn } from '../../lib/composables/useSlider';
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Spinner } from './Spinner';
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Components/Spinner',
|
|
6
|
+
component: Spinner,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'centered',
|
|
9
|
+
},
|
|
10
|
+
argTypes: {
|
|
11
|
+
variant: {
|
|
12
|
+
control: { type: 'select' },
|
|
13
|
+
options: ['primary', 'secondary', 'success', 'info', 'warning', 'error', 'light', 'dark'],
|
|
14
|
+
description: 'The color variant of the spinner',
|
|
15
|
+
},
|
|
16
|
+
size: {
|
|
17
|
+
control: { type: 'select' },
|
|
18
|
+
options: ['sm', 'md', 'lg'],
|
|
19
|
+
description: 'The size of the spinner',
|
|
20
|
+
},
|
|
21
|
+
fullscreen: {
|
|
22
|
+
control: 'boolean',
|
|
23
|
+
description: 'Whether the spinner should be centered and fixed in the viewport',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
} satisfies Meta<typeof Spinner>;
|
|
27
|
+
|
|
28
|
+
export default meta;
|
|
29
|
+
type Story = StoryObj<typeof Spinner>;
|
|
30
|
+
|
|
31
|
+
// Default Spinner
|
|
32
|
+
export const Default: Story = {
|
|
33
|
+
args: {
|
|
34
|
+
variant: 'primary',
|
|
35
|
+
size: 'md',
|
|
36
|
+
fullscreen: false,
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// Size Variants
|
|
41
|
+
export const Sizes: Story = {
|
|
42
|
+
render: () => (
|
|
43
|
+
<div className="u-d-flex u-flex-wrap u-gap-3 u-align-items-center">
|
|
44
|
+
<Spinner size="sm" />
|
|
45
|
+
<Spinner size="md" />
|
|
46
|
+
<Spinner size="lg" />
|
|
47
|
+
</div>
|
|
48
|
+
),
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
// Color Variants
|
|
52
|
+
export const ColorVariants: Story = {
|
|
53
|
+
render: () => (
|
|
54
|
+
<div className="u-d-flex u-flex-wrap u-gap-3 u-align-items-center">
|
|
55
|
+
<Spinner variant="primary" />
|
|
56
|
+
<Spinner variant="secondary" />
|
|
57
|
+
<Spinner variant="success" />
|
|
58
|
+
<Spinner variant="info" />
|
|
59
|
+
<Spinner variant="warning" />
|
|
60
|
+
<Spinner variant="error" />
|
|
61
|
+
<Spinner variant="light" />
|
|
62
|
+
<Spinner variant="dark" />
|
|
63
|
+
</div>
|
|
64
|
+
),
|
|
65
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SpinnerProps } from '../../lib/types/components';
|
|
3
|
+
import { useSpinner } from '../../lib/composables/useSpinner';
|
|
4
|
+
import { SPINNER } from '../../lib/constants/components';
|
|
5
|
+
|
|
6
|
+
export const Spinner: React.FC<SpinnerProps> = ({
|
|
7
|
+
size = 'md',
|
|
8
|
+
variant = 'primary',
|
|
9
|
+
fullscreen = false,
|
|
10
|
+
className = '',
|
|
11
|
+
}) => {
|
|
12
|
+
const { generateSpinnerClass } = useSpinner({
|
|
13
|
+
size,
|
|
14
|
+
variant,
|
|
15
|
+
fullscreen,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const spinnerClass = generateSpinnerClass({
|
|
19
|
+
size,
|
|
20
|
+
variant,
|
|
21
|
+
fullscreen,
|
|
22
|
+
className,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<div className={spinnerClass} role="status">
|
|
27
|
+
<span className={SPINNER.VISUALLY_HIDDEN}>Loading...</span>
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type { SpinnerProps };
|
|
33
|
+
|
|
34
|
+
Spinner.displayName = 'Spinner';
|
|
35
|
+
|
|
36
|
+
export default Spinner;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StoryFn, Meta } from '@storybook/react';
|
|
3
|
+
import { fn } from '@storybook/test';
|
|
4
|
+
import { Steps } from './Steps';
|
|
5
|
+
import type { StepsProps } from './Steps';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Components/Steps',
|
|
9
|
+
component: Steps,
|
|
10
|
+
argTypes: {
|
|
11
|
+
activeIndex: {
|
|
12
|
+
control: { type: 'number' },
|
|
13
|
+
defaultValue: 1,
|
|
14
|
+
},
|
|
15
|
+
vertical: {
|
|
16
|
+
control: { type: 'boolean' },
|
|
17
|
+
defaultValue: false,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
} as Meta<typeof Steps>;
|
|
21
|
+
|
|
22
|
+
const Template: StoryFn<typeof Steps> = args => (
|
|
23
|
+
<div style={{ padding: '30px' }}>
|
|
24
|
+
<Steps {...args} />
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
// Default horizontal steps
|
|
29
|
+
export const Default = Template.bind({});
|
|
30
|
+
Default.args = {
|
|
31
|
+
items: [
|
|
32
|
+
{ number: 1, text: 'Step 1' },
|
|
33
|
+
{ number: 2, text: 'Step 2' },
|
|
34
|
+
{ number: 3, text: 'Step 3' },
|
|
35
|
+
{ number: 4, text: 'Step 4' },
|
|
36
|
+
{ number: 5, text: 'Step 5' },
|
|
37
|
+
],
|
|
38
|
+
activeIndex: 1,
|
|
39
|
+
vertical: false,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// Vertical steps
|
|
43
|
+
export const Vertical = Template.bind({});
|
|
44
|
+
Vertical.args = {
|
|
45
|
+
items: [
|
|
46
|
+
{ number: 1, text: 'Step 1' },
|
|
47
|
+
{ number: 2, text: 'Step 2' },
|
|
48
|
+
{ number: 3, text: 'Step 3' },
|
|
49
|
+
{ number: 4, text: 'Step 4' },
|
|
50
|
+
{ number: 5, text: 'Step 5' },
|
|
51
|
+
],
|
|
52
|
+
activeIndex: 1,
|
|
53
|
+
vertical: true,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// Steps with custom content
|
|
57
|
+
export const WithCustomContent = Template.bind({});
|
|
58
|
+
WithCustomContent.args = {
|
|
59
|
+
items: [
|
|
60
|
+
{
|
|
61
|
+
number: 1,
|
|
62
|
+
text: 'Registration',
|
|
63
|
+
content: <p style={{ marginTop: '10px', fontSize: '0.85em' }}>Create your account</p>,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
number: 2,
|
|
67
|
+
text: 'Personal Info',
|
|
68
|
+
content: <p style={{ marginTop: '10px', fontSize: '0.85em' }}>Tell us about yourself</p>,
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
number: 3,
|
|
72
|
+
text: 'Preferences',
|
|
73
|
+
content: <p style={{ marginTop: '10px', fontSize: '0.85em' }}>Select your preferences</p>,
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
number: 4,
|
|
77
|
+
text: 'Payment',
|
|
78
|
+
content: <p style={{ marginTop: '10px', fontSize: '0.85em' }}>Add payment information</p>,
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
number: 5,
|
|
82
|
+
text: 'Confirmation',
|
|
83
|
+
content: <p style={{ marginTop: '10px', fontSize: '0.85em' }}>Complete your signup</p>,
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
activeIndex: 1,
|
|
87
|
+
vertical: false,
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
// Steps with custom icons instead of numbers
|
|
91
|
+
export const WithIcons = Template.bind({});
|
|
92
|
+
WithIcons.args = {
|
|
93
|
+
items: [
|
|
94
|
+
{
|
|
95
|
+
number: <i className="icon-lux-user" style={{ fontSize: '16px' }}></i>,
|
|
96
|
+
text: 'Account',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
number: <i className="icon-lux-settings" style={{ fontSize: '16px' }}></i>,
|
|
100
|
+
text: 'Settings',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
number: <i className="icon-lux-calendar" style={{ fontSize: '16px' }}></i>,
|
|
104
|
+
text: 'Schedule',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
number: <i className="icon-lux-card" style={{ fontSize: '16px' }}></i>,
|
|
108
|
+
text: 'Payment',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
number: <i className="icon-lux-check" style={{ fontSize: '16px' }}></i>,
|
|
112
|
+
text: 'Complete',
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
activeIndex: 1,
|
|
116
|
+
vertical: false,
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
// Interactive steps with buttons for navigation
|
|
120
|
+
const InteractiveSteps: React.FC = () => {
|
|
121
|
+
const [activeStep, setActiveStep] = React.useState(0);
|
|
122
|
+
|
|
123
|
+
const items = [
|
|
124
|
+
{ number: 1, text: 'Step 1' },
|
|
125
|
+
{ number: 2, text: 'Step 2' },
|
|
126
|
+
{ number: 3, text: 'Step 3' },
|
|
127
|
+
{ number: 4, text: 'Step 4' },
|
|
128
|
+
{ number: 5, text: 'Step 5' },
|
|
129
|
+
];
|
|
130
|
+
|
|
131
|
+
return (
|
|
132
|
+
<div>
|
|
133
|
+
<Steps items={items} activeIndex={activeStep} onStepChange={setActiveStep} />
|
|
134
|
+
<div style={{ marginTop: '30px', display: 'flex', gap: '10px' }}>
|
|
135
|
+
<button
|
|
136
|
+
className="c-btn c-btn--primary"
|
|
137
|
+
onClick={() => setActiveStep(Math.max(0, activeStep - 1))}
|
|
138
|
+
disabled={activeStep === 0}
|
|
139
|
+
>
|
|
140
|
+
Previous
|
|
141
|
+
</button>
|
|
142
|
+
<button
|
|
143
|
+
className="c-btn c-btn--primary"
|
|
144
|
+
onClick={() => setActiveStep(Math.min(items.length - 1, activeStep + 1))}
|
|
145
|
+
disabled={activeStep === items.length - 1}
|
|
146
|
+
>
|
|
147
|
+
Next
|
|
148
|
+
</button>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
);
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
export const Interactive: StoryFn<typeof Steps> = () => (
|
|
155
|
+
<div style={{ padding: '30px' }}>
|
|
156
|
+
<InteractiveSteps />
|
|
157
|
+
</div>
|
|
158
|
+
);
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import React, { useEffect, useState, ReactNode } from 'react';
|
|
2
|
+
import { STEPS } from '../../lib/constants/components';
|
|
3
|
+
|
|
4
|
+
export interface StepItem {
|
|
5
|
+
/**
|
|
6
|
+
* The number for the step
|
|
7
|
+
*/
|
|
8
|
+
number: number | string | ReactNode;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The text label for the step
|
|
12
|
+
*/
|
|
13
|
+
text: string;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Optional custom content for the step
|
|
17
|
+
*/
|
|
18
|
+
content?: React.ReactNode;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface StepsProps {
|
|
22
|
+
/**
|
|
23
|
+
* Array of step items
|
|
24
|
+
*/
|
|
25
|
+
items: StepItem[];
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Current active step index (0-based)
|
|
29
|
+
*/
|
|
30
|
+
activeIndex?: number;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Whether to display steps vertically
|
|
34
|
+
*/
|
|
35
|
+
vertical?: boolean;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Called when active step changes
|
|
39
|
+
*/
|
|
40
|
+
onStepChange?: (index: number) => void;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Additional CSS class
|
|
44
|
+
*/
|
|
45
|
+
className?: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Steps component for displaying a sequence of steps
|
|
50
|
+
*/
|
|
51
|
+
export const Steps: React.FC<StepsProps> = ({
|
|
52
|
+
items,
|
|
53
|
+
activeIndex = 0,
|
|
54
|
+
vertical = false,
|
|
55
|
+
onStepChange,
|
|
56
|
+
className = '',
|
|
57
|
+
}) => {
|
|
58
|
+
const [currentStep, setCurrentStep] = useState(activeIndex);
|
|
59
|
+
|
|
60
|
+
// Update steps when activeIndex prop changes
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (currentStep !== activeIndex) {
|
|
63
|
+
setCurrentStep(activeIndex);
|
|
64
|
+
}
|
|
65
|
+
}, [activeIndex]);
|
|
66
|
+
|
|
67
|
+
// Method to go to next step
|
|
68
|
+
const goToNextStep = () => {
|
|
69
|
+
const nextIndex = currentStep + 1;
|
|
70
|
+
if (nextIndex < items.length) {
|
|
71
|
+
setCurrentStep(nextIndex);
|
|
72
|
+
if (onStepChange) {
|
|
73
|
+
onStepChange(nextIndex);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// Method to go to previous step
|
|
79
|
+
const goToPreviousStep = () => {
|
|
80
|
+
const prevIndex = currentStep - 1;
|
|
81
|
+
if (prevIndex >= 0) {
|
|
82
|
+
setCurrentStep(prevIndex);
|
|
83
|
+
if (onStepChange) {
|
|
84
|
+
onStepChange(prevIndex);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
return (
|
|
90
|
+
<div
|
|
91
|
+
className={`c-steps ${vertical ? STEPS.CLASSES.VERTICAL : ''} ${className}`}
|
|
92
|
+
role="navigation"
|
|
93
|
+
aria-label="Steps"
|
|
94
|
+
>
|
|
95
|
+
{items.map((item, index) => (
|
|
96
|
+
<div
|
|
97
|
+
key={`step-${index}`}
|
|
98
|
+
className={`c-steps__item ${index <= currentStep ? STEPS.CLASSES.ACTIVE : ''} ${index < currentStep ? STEPS.CLASSES.COMPLETED : ''}`}
|
|
99
|
+
aria-current={index === currentStep ? 'step' : undefined}
|
|
100
|
+
>
|
|
101
|
+
<div className="c-steps__line"></div>
|
|
102
|
+
<div className="c-steps__content">
|
|
103
|
+
<div className="c-steps__number">{item.number}</div>
|
|
104
|
+
<div className="c-steps__text">{item.text}</div>
|
|
105
|
+
{item.content && <div className="c-steps__custom-content">{item.content}</div>}
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
))}
|
|
109
|
+
</div>
|
|
110
|
+
);
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
Steps.displayName = 'Steps';
|
|
114
|
+
|
|
115
|
+
export default Steps;
|