@shohojdhara/atomix 0.1.30 → 0.2.1
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 +151 -39
- package/dist/atomix.css +13529 -0
- package/dist/atomix.min.css +15 -0
- package/dist/index.d.ts +6112 -1757
- package/dist/index.esm.js +16852 -8364
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +16892 -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 +13241 -0
- package/dist/themes/boomdevs.min.css +353 -0
- package/dist/themes/esrar.css +15374 -0
- package/dist/themes/esrar.min.css +189 -0
- package/dist/themes/mashroom.css +28079 -0
- package/dist/themes/mashroom.min.css +403 -0
- package/dist/themes/shaj-default.css +14203 -0
- package/dist/themes/shaj-default.min.css +500 -0
- package/dist/themes/yabai.css +13711 -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/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 +184 -0
- package/src/components/SectionIntro/index.ts +3 -0
- package/src/components/Slider/Slider.stories.tsx +241 -0
- package/src/components/Slider/Slider.tsx +225 -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 +111 -0
- package/src/layouts/Grid/Container.tsx +58 -0
- package/src/layouts/Grid/Grid.stories.tsx +861 -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/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 +339 -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 +1433 -0
- package/src/lib/constants/index.ts +4 -0
- package/src/lib/index.ts +11 -0
- package/src/lib/types/components.ts +4750 -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 +2 -0
- package/src/styles/01-settings/_settings.accordion.scss +7 -5
- package/src/styles/01-settings/_settings.animations.scss +0 -0
- package/src/styles/01-settings/_settings.avatar-group.scss +6 -3
- package/src/styles/01-settings/_settings.avatar.scss +2 -2
- 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 +9 -8
- 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 +12 -10
- package/src/styles/01-settings/_settings.chart.scss +199 -0
- package/src/styles/01-settings/_settings.checkbox-group.scss +0 -0
- package/src/styles/01-settings/_settings.checkbox.scss +0 -0
- 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 +0 -0
- 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 +0 -0
- package/src/styles/01-settings/_settings.edge-panel.scss +0 -0
- package/src/styles/01-settings/_settings.fonts.scss +1 -1
- package/src/styles/01-settings/_settings.form-group.scss +0 -0
- package/src/styles/01-settings/_settings.form.scss +0 -0
- package/src/styles/01-settings/_settings.grid.scss +3 -3
- package/src/styles/01-settings/_settings.hero.scss +1 -1
- package/src/styles/01-settings/_settings.input.scss +1 -1
- package/src/styles/01-settings/_settings.link.scss +0 -0
- package/src/styles/01-settings/_settings.list-group.scss +0 -0
- package/src/styles/01-settings/_settings.list.scss +0 -0
- 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 +0 -0
- package/src/styles/01-settings/_settings.messages.scss +0 -0
- package/src/styles/01-settings/_settings.modal.scss +1 -1
- package/src/styles/01-settings/_settings.nav.scss +0 -0
- package/src/styles/01-settings/_settings.navbar.scss +0 -0
- package/src/styles/01-settings/_settings.pagination.scss +0 -0
- package/src/styles/01-settings/_settings.photoviewer.scss +89 -23
- package/src/styles/01-settings/_settings.popover.scss +0 -0
- 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 +0 -0
- package/src/styles/01-settings/_settings.river.scss +0 -0
- package/src/styles/01-settings/_settings.sectionintro.scss +0 -0
- package/src/styles/01-settings/_settings.select.scss +0 -0
- package/src/styles/01-settings/_settings.side-menu.scss +0 -0
- 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 +11 -3
- package/src/styles/01-settings/_settings.spinner.scss +0 -0
- package/src/styles/01-settings/_settings.steps.scss +1 -1
- package/src/styles/01-settings/_settings.tabs.scss +4 -4
- package/src/styles/01-settings/_settings.testimonials.scss +0 -0
- package/src/styles/01-settings/_settings.todo.scss +0 -0
- package/src/styles/01-settings/_settings.toggle.scss +1 -1
- package/src/styles/01-settings/_settings.tooltip.scss +0 -0
- package/src/styles/01-settings/_settings.typography.scss +2 -0
- package/src/styles/01-settings/_settings.upload.scss +0 -0
- 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.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 +5 -1
- 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 +23 -2
- 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 +5 -1
- 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 +0 -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 +3 -1
- package/src/styles/06-components/_components.avatar-group.scss +0 -0
- package/src/styles/06-components/_components.avatar.scss +0 -0
- package/src/styles/06-components/_components.badge.scss +9 -9
- package/src/styles/06-components/_components.breadcrumb.scss +0 -0
- package/src/styles/06-components/_components.btn-group.scss +0 -0
- package/src/styles/06-components/_components.button.scss +0 -0
- package/src/styles/06-components/_components.callout.scss +2 -1
- package/src/styles/06-components/_components.card.scss +0 -1
- package/src/styles/06-components/_components.chart.scss +2102 -0
- package/src/styles/06-components/_components.checkbox-group.scss +0 -0
- package/src/styles/06-components/_components.checkbox.scss +0 -0
- package/src/styles/06-components/_components.color-mode-toggle.scss +0 -0
- package/src/styles/06-components/_components.countdown.scss +0 -0
- package/src/styles/06-components/_components.data-table.scss +0 -0
- package/src/styles/06-components/_components.datepicker.scss +0 -0
- package/src/styles/06-components/_components.dropdown.scss +0 -0
- package/src/styles/06-components/_components.edge-panel.scss +0 -0
- package/src/styles/06-components/_components.form-group.scss +0 -0
- package/src/styles/06-components/_components.form.scss +0 -0
- package/src/styles/06-components/_components.hero.scss +1 -0
- package/src/styles/06-components/_components.icon.scss +2 -2
- package/src/styles/06-components/_components.image-gallery.scss +0 -0
- package/src/styles/06-components/_components.input.scss +0 -0
- package/src/styles/06-components/_components.list-group.scss +0 -0
- package/src/styles/06-components/_components.list.scss +0 -0
- package/src/styles/06-components/_components.menu.scss +0 -0
- package/src/styles/06-components/_components.messages.scss +0 -0
- package/src/styles/06-components/_components.modal.scss +3 -0
- package/src/styles/06-components/_components.nav.scss +0 -0
- package/src/styles/06-components/_components.navbar.scss +0 -0
- package/src/styles/06-components/_components.pagination.scss +0 -0
- package/src/styles/06-components/_components.photoviewer.scss +603 -545
- package/src/styles/06-components/_components.popover.scss +0 -0
- package/src/styles/06-components/_components.product-review.scss +0 -0
- package/src/styles/06-components/_components.progress.scss +0 -0
- package/src/styles/06-components/_components.rating.scss +0 -0
- package/src/styles/06-components/_components.river.scss +0 -0
- package/src/styles/06-components/_components.sectionintro.scss +0 -0
- package/src/styles/06-components/_components.select.scss +0 -0
- package/src/styles/06-components/_components.side-menu.scss +0 -0
- package/src/styles/06-components/_components.skeleton.scss +0 -0
- package/src/styles/06-components/_components.slider.scss +273 -0
- package/src/styles/06-components/_components.spinner.scss +0 -0
- package/src/styles/06-components/_components.steps.scss +1 -0
- package/src/styles/06-components/_components.tabs.scss +0 -0
- package/src/styles/06-components/_components.testimonials.scss +0 -0
- package/src/styles/06-components/_components.todo.scss +0 -0
- package/src/styles/06-components/_components.toggle.scss +0 -0
- package/src/styles/06-components/_components.tooltip.scss +4 -9
- package/src/styles/06-components/_components.upload.scss +0 -0
- package/src/styles/06-components/_components.video-player.scss +623 -0
- package/src/styles/06-components/_index.scss +3 -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,175 @@
|
|
|
1
|
+
import React, { CSSProperties, useEffect } from 'react';
|
|
2
|
+
import { HeroProps, HeroAlignment } from '../../lib/types/components';
|
|
3
|
+
import { useHero } from '../../lib/composables/useHero';
|
|
4
|
+
import { HERO } from '../../lib/constants/components';
|
|
5
|
+
|
|
6
|
+
export const Hero: React.FC<HeroProps> = ({
|
|
7
|
+
title,
|
|
8
|
+
subtitle,
|
|
9
|
+
text,
|
|
10
|
+
imageSrc,
|
|
11
|
+
imageAlt = 'Hero image',
|
|
12
|
+
alignment = 'left',
|
|
13
|
+
backgroundImageSrc,
|
|
14
|
+
showOverlay = true,
|
|
15
|
+
fullViewportHeight = false,
|
|
16
|
+
actions,
|
|
17
|
+
imageColSize = 7,
|
|
18
|
+
contentColSize = 5,
|
|
19
|
+
contentWidth,
|
|
20
|
+
className = '',
|
|
21
|
+
parallax = false,
|
|
22
|
+
parallaxIntensity = 0.5,
|
|
23
|
+
videoBackground,
|
|
24
|
+
videoOptions = {
|
|
25
|
+
autoplay: true,
|
|
26
|
+
loop: true,
|
|
27
|
+
muted: true,
|
|
28
|
+
},
|
|
29
|
+
}) => {
|
|
30
|
+
const {
|
|
31
|
+
generateHeroClassNames,
|
|
32
|
+
generateImageColClass,
|
|
33
|
+
generateContentColClass,
|
|
34
|
+
hasBackgroundImage,
|
|
35
|
+
hasForegroundImage,
|
|
36
|
+
useGridLayout,
|
|
37
|
+
heroRef,
|
|
38
|
+
videoRef,
|
|
39
|
+
} = useHero({
|
|
40
|
+
alignment,
|
|
41
|
+
imageColSize,
|
|
42
|
+
contentColSize,
|
|
43
|
+
imageSrc,
|
|
44
|
+
backgroundImageSrc,
|
|
45
|
+
showOverlay,
|
|
46
|
+
fullViewportHeight,
|
|
47
|
+
contentWidth,
|
|
48
|
+
parallax,
|
|
49
|
+
parallaxIntensity,
|
|
50
|
+
videoBackground,
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// Create custom style for hero element with content width if provided
|
|
54
|
+
const heroStyle: React.CSSProperties | undefined = contentWidth
|
|
55
|
+
? ({
|
|
56
|
+
'--atomix-hero-content-width': contentWidth,
|
|
57
|
+
} as React.CSSProperties)
|
|
58
|
+
: undefined;
|
|
59
|
+
|
|
60
|
+
const renderVideoBackground = () => {
|
|
61
|
+
if (!videoBackground) return null;
|
|
62
|
+
|
|
63
|
+
const { autoplay, loop, muted, posterUrl } = videoOptions;
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<video
|
|
67
|
+
ref={videoRef}
|
|
68
|
+
className="c-hero__video"
|
|
69
|
+
autoPlay={autoplay}
|
|
70
|
+
loop={loop}
|
|
71
|
+
muted={muted}
|
|
72
|
+
playsInline
|
|
73
|
+
poster={posterUrl}
|
|
74
|
+
>
|
|
75
|
+
<source src={videoBackground} type={`video/${videoBackground.split('.').pop() || 'mp4'}`} />
|
|
76
|
+
Your browser does not support the video tag.
|
|
77
|
+
</video>
|
|
78
|
+
);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const renderBackground = () => {
|
|
82
|
+
if (!hasBackgroundImage && !videoBackground) return null;
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<div className={HERO.SELECTORS.BG.replace('.', '')}>
|
|
86
|
+
{backgroundImageSrc && (
|
|
87
|
+
<img
|
|
88
|
+
src={backgroundImageSrc}
|
|
89
|
+
alt="Background"
|
|
90
|
+
className={HERO.SELECTORS.BG_IMAGE.replace('.', '')}
|
|
91
|
+
/>
|
|
92
|
+
)}
|
|
93
|
+
{renderVideoBackground()}
|
|
94
|
+
{showOverlay && <div className={HERO.SELECTORS.OVERLAY.replace('.', '')}></div>}
|
|
95
|
+
</div>
|
|
96
|
+
);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const renderContent = () => (
|
|
100
|
+
<div className={HERO.SELECTORS.CONTENT.replace('.', '')}>
|
|
101
|
+
{subtitle && <p className={HERO.SELECTORS.SUBTITLE.replace('.', '')}>{subtitle}</p>}
|
|
102
|
+
<h1 className={HERO.SELECTORS.TITLE.replace('.', '')}>{title}</h1>
|
|
103
|
+
{text && <p className={HERO.SELECTORS.TEXT.replace('.', '')}>{text}</p>}
|
|
104
|
+
{actions && <div className={HERO.SELECTORS.ACTIONS.replace('.', '')}>{actions}</div>}
|
|
105
|
+
</div>
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
const renderForegroundImage = () => {
|
|
109
|
+
if (!hasForegroundImage) return null;
|
|
110
|
+
|
|
111
|
+
if (alignment === 'center') {
|
|
112
|
+
return (
|
|
113
|
+
<div className={HERO.SELECTORS.IMAGE_WRAPPER.replace('.', '')}>
|
|
114
|
+
<img src={imageSrc} alt={imageAlt} className={HERO.SELECTORS.IMAGE.replace('.', '')} />
|
|
115
|
+
</div>
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return (
|
|
120
|
+
<div className={generateImageColClass()}>
|
|
121
|
+
<img src={imageSrc} alt={imageAlt} className={HERO.SELECTORS.IMAGE.replace('.', '')} />
|
|
122
|
+
</div>
|
|
123
|
+
);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const renderGridContent = () => {
|
|
127
|
+
// For left-aligned content, render content first then image
|
|
128
|
+
if (alignment === 'left') {
|
|
129
|
+
return (
|
|
130
|
+
<>
|
|
131
|
+
<div className={generateContentColClass()}>{renderContent()}</div>
|
|
132
|
+
{renderForegroundImage()}
|
|
133
|
+
</>
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// For right-aligned or default, render image first then content
|
|
138
|
+
return (
|
|
139
|
+
<>
|
|
140
|
+
{renderForegroundImage()}
|
|
141
|
+
<div className={generateContentColClass()}>{renderContent()}</div>
|
|
142
|
+
</>
|
|
143
|
+
);
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
return (
|
|
147
|
+
<div
|
|
148
|
+
ref={heroRef}
|
|
149
|
+
className={generateHeroClassNames(className)}
|
|
150
|
+
style={heroStyle}
|
|
151
|
+
data-parallax={parallax ? 'true' : undefined}
|
|
152
|
+
data-parallax-intensity={parallax ? parallaxIntensity : undefined}
|
|
153
|
+
>
|
|
154
|
+
{renderBackground()}
|
|
155
|
+
<div className={`${HERO.SELECTORS.CONTAINER.replace('.', '')} o-container`}>
|
|
156
|
+
{useGridLayout ? (
|
|
157
|
+
<div className={`${HERO.SELECTORS.GRID.replace('.', '')} o-grid`}>
|
|
158
|
+
{renderGridContent()}
|
|
159
|
+
</div>
|
|
160
|
+
) : (
|
|
161
|
+
<>
|
|
162
|
+
{renderContent()}
|
|
163
|
+
{renderForegroundImage()}
|
|
164
|
+
</>
|
|
165
|
+
)}
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
);
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
export type { HeroProps };
|
|
172
|
+
|
|
173
|
+
Hero.displayName = 'Hero';
|
|
174
|
+
|
|
175
|
+
export default Hero;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import * as PhosphorIcons from '@phosphor-icons/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
export type IconSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
5
|
+
export type IconWeight = 'thin' | 'light' | 'regular' | 'bold' | 'fill' | 'duotone';
|
|
6
|
+
|
|
7
|
+
// We need to filter out non-icon exports from the Phosphor package
|
|
8
|
+
export type PhosphorIconsType = Exclude<
|
|
9
|
+
keyof typeof PhosphorIcons,
|
|
10
|
+
'Icon' | 'IconContext' | 'IconBase' | 'IconProps' | 'createIcon' | 'default' | 'SSR'
|
|
11
|
+
>;
|
|
12
|
+
|
|
13
|
+
export interface IconProps {
|
|
14
|
+
/**
|
|
15
|
+
* Icon name from Phosphor Icons
|
|
16
|
+
*/
|
|
17
|
+
name: PhosphorIconsType;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Icon size
|
|
21
|
+
*/
|
|
22
|
+
size?: IconSize | number;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Icon weight/style
|
|
26
|
+
*/
|
|
27
|
+
weight?: IconWeight;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Icon color
|
|
31
|
+
*/
|
|
32
|
+
color?: string;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Additional CSS class names
|
|
36
|
+
*/
|
|
37
|
+
className?: string;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Alt text for accessibility
|
|
41
|
+
*/
|
|
42
|
+
alt?: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Map string sizes to pixel values
|
|
46
|
+
const sizeMap: Record<IconSize, number> = {
|
|
47
|
+
xs: 16,
|
|
48
|
+
sm: 20,
|
|
49
|
+
md: 24,
|
|
50
|
+
lg: 32,
|
|
51
|
+
xl: 40,
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Icon component that displays a Phosphor icon
|
|
56
|
+
*/
|
|
57
|
+
export const Icon: React.FC<IconProps> = ({
|
|
58
|
+
name,
|
|
59
|
+
size = 'md',
|
|
60
|
+
weight = 'regular',
|
|
61
|
+
color,
|
|
62
|
+
className = '',
|
|
63
|
+
alt,
|
|
64
|
+
}) => {
|
|
65
|
+
// Get the icon component from Phosphor
|
|
66
|
+
const IconComponent = PhosphorIcons[name] as React.FC<
|
|
67
|
+
PhosphorIcons.IconProps & { ref?: React.Ref<SVGSVGElement> }
|
|
68
|
+
>;
|
|
69
|
+
|
|
70
|
+
if (!IconComponent) {
|
|
71
|
+
console.warn(`Icon "${name}" not found in Phosphor Icons`);
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Convert string size to pixel value if needed
|
|
76
|
+
const pixelSize = typeof size === 'string' ? sizeMap[size as IconSize] || 24 : size;
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<span className={`c-icon c-icon--${size} ${className}`} aria-hidden={!alt} title={alt}>
|
|
80
|
+
<IconComponent size={pixelSize} weight={weight} color={color} aria-label={alt} />
|
|
81
|
+
</span>
|
|
82
|
+
);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
Icon.displayName = 'Icon';
|
|
86
|
+
|
|
87
|
+
export default Icon;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { List } from './List';
|
|
4
|
+
import { ListGroup } from './ListGroup';
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Components/List',
|
|
8
|
+
component: List,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'centered',
|
|
11
|
+
},
|
|
12
|
+
argTypes: {
|
|
13
|
+
variant: {
|
|
14
|
+
control: { type: 'select' },
|
|
15
|
+
options: ['default', 'dash', 'number', 'text'],
|
|
16
|
+
description: 'List style variant',
|
|
17
|
+
},
|
|
18
|
+
children: {
|
|
19
|
+
control: { type: 'text' },
|
|
20
|
+
description: 'List items content',
|
|
21
|
+
},
|
|
22
|
+
className: {
|
|
23
|
+
control: 'text',
|
|
24
|
+
description: 'Additional CSS class names',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
} satisfies Meta<typeof List>;
|
|
28
|
+
|
|
29
|
+
export default meta;
|
|
30
|
+
type Story = StoryObj<typeof meta>;
|
|
31
|
+
|
|
32
|
+
// Basic list items for reuse
|
|
33
|
+
const ITEMS = ['item 1', 'item 2', 'item 3'];
|
|
34
|
+
|
|
35
|
+
const sectionStyle = { marginBottom: '16px' };
|
|
36
|
+
const titleStyle = { fontWeight: 'normal', marginBottom: '8px' };
|
|
37
|
+
|
|
38
|
+
const ListItem = ({ children }: { children: React.ReactNode }) => <span>{children}</span>;
|
|
39
|
+
const ListItems = ({ variant }: { variant: string }) => (
|
|
40
|
+
<>
|
|
41
|
+
{ITEMS.map((item, index) => (
|
|
42
|
+
<ListItem key={index}>{variant === 'number' ? `${index + 1}. ${item}` : item}</ListItem>
|
|
43
|
+
))}
|
|
44
|
+
</>
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
const createListSection = (title: string, variant: string) => (
|
|
48
|
+
<div style={sectionStyle}>
|
|
49
|
+
<h3 style={titleStyle}>{title}</h3>
|
|
50
|
+
<List variant={variant as any}>
|
|
51
|
+
<ListItems variant={variant} />
|
|
52
|
+
</List>
|
|
53
|
+
</div>
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
// Basic List example
|
|
57
|
+
export const Basic: Story = {
|
|
58
|
+
args: {
|
|
59
|
+
children: ITEMS,
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// List Variants Showcase
|
|
64
|
+
export const VariantsShowcase: Story = {
|
|
65
|
+
render: () => {
|
|
66
|
+
return (
|
|
67
|
+
<div className="u-d-flex u-flex-column u-gap-8">
|
|
68
|
+
{['Default', 'Dash', 'Number', 'Text'].map((title, index) => {
|
|
69
|
+
const variant = index === 0 ? 'default' : title.toLowerCase();
|
|
70
|
+
return createListSection(`${title} List`, variant);
|
|
71
|
+
})}
|
|
72
|
+
</div>
|
|
73
|
+
);
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
// ListGroup Showcase
|
|
78
|
+
export const ListGroupShowcase: Story = {
|
|
79
|
+
render: () => {
|
|
80
|
+
const listGroupConfig = [
|
|
81
|
+
{ title: 'Standard', compact: false, divided: false },
|
|
82
|
+
{ title: 'Compact', compact: true, divided: false },
|
|
83
|
+
{ title: 'Divided', compact: false, divided: true },
|
|
84
|
+
];
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<div className="u-d-flex u-flex-column u-gap-8">
|
|
88
|
+
<div>
|
|
89
|
+
<h3 style={titleStyle}>Mixed Variants ListGroup</h3>
|
|
90
|
+
<ListGroup>
|
|
91
|
+
<List variant="dash">
|
|
92
|
+
<ListItems variant="dash" />
|
|
93
|
+
</List>
|
|
94
|
+
<List variant="number">
|
|
95
|
+
<ListItems variant="number" />
|
|
96
|
+
</List>
|
|
97
|
+
<List variant="text">
|
|
98
|
+
<ListItems variant="text" />
|
|
99
|
+
</List>
|
|
100
|
+
</ListGroup>
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
{listGroupConfig.map(({ title, compact, divided }) => (
|
|
104
|
+
<div key={title}>
|
|
105
|
+
<h3 style={titleStyle}>{title} ListGroup</h3>
|
|
106
|
+
<ListGroup>
|
|
107
|
+
{ITEMS.map((section, idx) => (
|
|
108
|
+
<List key={idx}>
|
|
109
|
+
{[1, 2].map(item => (
|
|
110
|
+
<ListItem key={item}>
|
|
111
|
+
{`${section.charAt(0).toUpperCase() + section.slice(1)} - item ${item}`}
|
|
112
|
+
</ListItem>
|
|
113
|
+
))}
|
|
114
|
+
</List>
|
|
115
|
+
))}
|
|
116
|
+
</ListGroup>
|
|
117
|
+
</div>
|
|
118
|
+
))}
|
|
119
|
+
</div>
|
|
120
|
+
);
|
|
121
|
+
},
|
|
122
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ListProps } from '../../lib/types/components';
|
|
3
|
+
import { LIST } from '../../lib/constants/components';
|
|
4
|
+
|
|
5
|
+
export const List: React.FC<ListProps> = ({
|
|
6
|
+
children,
|
|
7
|
+
variant = 'default',
|
|
8
|
+
className = '',
|
|
9
|
+
...props
|
|
10
|
+
}) => {
|
|
11
|
+
// Generate CSS classes
|
|
12
|
+
const listClasses = [LIST.BASE_CLASS, variant !== 'default' && `c-list--${variant}`, className]
|
|
13
|
+
.filter(Boolean)
|
|
14
|
+
.join(' ');
|
|
15
|
+
|
|
16
|
+
// Determine the HTML element based on variant
|
|
17
|
+
const ListElement = ['number', 'text'].includes(variant) ? 'ol' : 'ul';
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<ListElement className={listClasses} {...props}>
|
|
21
|
+
{React.Children.map(children, child => {
|
|
22
|
+
if (React.isValidElement(child)) {
|
|
23
|
+
return <li className="c-list__item">{child}</li>;
|
|
24
|
+
}
|
|
25
|
+
return <li className="c-list__item">{child}</li>;
|
|
26
|
+
})}
|
|
27
|
+
</ListElement>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type { ListProps };
|
|
32
|
+
|
|
33
|
+
List.displayName = 'List';
|
|
34
|
+
|
|
35
|
+
export default List;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { ListGroupProps } from '../../lib/types/components';
|
|
4
|
+
import { LIST_GROUP } from '../../lib/constants/components';
|
|
5
|
+
import { List } from './List';
|
|
6
|
+
|
|
7
|
+
export const ListGroup: React.FC<ListGroupProps> = ({
|
|
8
|
+
children,
|
|
9
|
+
className = '',
|
|
10
|
+
variant = 'default',
|
|
11
|
+
}) => {
|
|
12
|
+
// Generate CSS classes
|
|
13
|
+
const listGroupClasses = classNames(LIST_GROUP.BASE_CLASS, className);
|
|
14
|
+
|
|
15
|
+
// Get valid List children
|
|
16
|
+
const validLists = React.Children.toArray(children).filter(
|
|
17
|
+
child => React.isValidElement(child) && child.type === List
|
|
18
|
+
) as React.ReactElement[];
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<div className={listGroupClasses}>
|
|
22
|
+
{validLists.map((child, index) => {
|
|
23
|
+
const childProps = child.props as any;
|
|
24
|
+
return React.cloneElement(child as React.ReactElement<any>, {
|
|
25
|
+
key: index,
|
|
26
|
+
variant: childProps?.variant ?? variant,
|
|
27
|
+
});
|
|
28
|
+
})}
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
ListGroup.displayName = 'ListGroup';
|
|
34
|
+
|
|
35
|
+
export default ListGroup;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { MessageItem } from '../../lib/types/components';
|
|
4
|
+
import { Messages } from './Messages';
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof Messages> = {
|
|
7
|
+
title: 'Components/Messages',
|
|
8
|
+
component: Messages,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'centered',
|
|
11
|
+
docs: {
|
|
12
|
+
description: {
|
|
13
|
+
component:
|
|
14
|
+
'Messages component for displaying chat conversations with support for text messages, images, and file attachments.',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
argTypes: {
|
|
19
|
+
messages: { control: 'object' },
|
|
20
|
+
width: { control: 'text' },
|
|
21
|
+
bodyHeight: { control: 'text' },
|
|
22
|
+
|
|
23
|
+
otherName: { control: 'text' },
|
|
24
|
+
otherAvatar: { control: 'text' },
|
|
25
|
+
selfAvatar: { control: 'text' },
|
|
26
|
+
placeholder: { control: 'text' },
|
|
27
|
+
disabled: { control: 'boolean' },
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default meta;
|
|
32
|
+
type Story = StoryObj<typeof Messages>;
|
|
33
|
+
|
|
34
|
+
export const Default: Story = {
|
|
35
|
+
args: {
|
|
36
|
+
width: '800px',
|
|
37
|
+
bodyHeight: '400px',
|
|
38
|
+
otherName: 'Meghan',
|
|
39
|
+
otherAvatar:
|
|
40
|
+
'https://images.unsplash.com/photo-1648074074225-16189e7ad8c9?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1935&q=80',
|
|
41
|
+
selfAvatar:
|
|
42
|
+
'https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1780&q=80',
|
|
43
|
+
messages: [
|
|
44
|
+
{
|
|
45
|
+
id: '1',
|
|
46
|
+
text: "Hi, I hope you're having a good day.",
|
|
47
|
+
time: '12:12 AM',
|
|
48
|
+
isSelf: false,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: '2',
|
|
52
|
+
text: "I'm writing to remind you of your appointment tomorrow at 10 am. Please confirm if you can make it or reschedule if needed.",
|
|
53
|
+
time: '12:13 AM',
|
|
54
|
+
isSelf: false,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: '3',
|
|
58
|
+
image: 'https://picsum.photos/g/400/260',
|
|
59
|
+
time: '12:14 AM',
|
|
60
|
+
isSelf: false,
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: '4',
|
|
64
|
+
file: {
|
|
65
|
+
name: 'File ABCDE.pdf',
|
|
66
|
+
size: '1.2 MB',
|
|
67
|
+
},
|
|
68
|
+
time: '12:15 AM',
|
|
69
|
+
isSelf: false,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: '5',
|
|
73
|
+
text: "Sure, I'll be there",
|
|
74
|
+
time: '12:18 AM',
|
|
75
|
+
isSelf: true,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
id: '6',
|
|
79
|
+
file: {
|
|
80
|
+
name: 'Meeting Notes.pdf',
|
|
81
|
+
size: '2.4 MB',
|
|
82
|
+
},
|
|
83
|
+
time: '12:19 AM',
|
|
84
|
+
isSelf: true,
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: '7',
|
|
88
|
+
image: 'https://picsum.photos/400/260',
|
|
89
|
+
time: '12:20 AM',
|
|
90
|
+
isSelf: true,
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export const EmptyChat: Story = {
|
|
97
|
+
args: {
|
|
98
|
+
width: '800px',
|
|
99
|
+
bodyHeight: '400px',
|
|
100
|
+
otherName: 'Meghan',
|
|
101
|
+
otherAvatar:
|
|
102
|
+
'https://images.unsplash.com/photo-1648074074225-16189e7ad8c9?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1935&q=80',
|
|
103
|
+
selfAvatar:
|
|
104
|
+
'https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1780&q=80',
|
|
105
|
+
messages: [],
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export const DisabledChat: Story = {
|
|
110
|
+
args: {
|
|
111
|
+
...Default.args,
|
|
112
|
+
disabled: true,
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
// Interactive example with state management
|
|
117
|
+
export const Interactive: StoryObj<typeof Messages> = {
|
|
118
|
+
render: args => {
|
|
119
|
+
const [messages, setMessages] = useState<MessageItem[]>(args.messages || []);
|
|
120
|
+
|
|
121
|
+
const handleSendMessage = (text: string) => {
|
|
122
|
+
const newMessage: MessageItem = {
|
|
123
|
+
id: `msg-${Date.now()}`,
|
|
124
|
+
text,
|
|
125
|
+
time: new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }),
|
|
126
|
+
isSelf: true,
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
setMessages([...messages, newMessage]);
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
return <Messages {...args} messages={messages} onSendMessage={handleSendMessage} />;
|
|
133
|
+
},
|
|
134
|
+
args: {
|
|
135
|
+
width: '800px',
|
|
136
|
+
bodyHeight: '400px',
|
|
137
|
+
otherName: 'Meghan',
|
|
138
|
+
otherAvatar:
|
|
139
|
+
'https://images.unsplash.com/photo-1648074074225-16189e7ad8c9?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1935&q=80',
|
|
140
|
+
selfAvatar:
|
|
141
|
+
'https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1780&q=80',
|
|
142
|
+
messages: [
|
|
143
|
+
{
|
|
144
|
+
id: '1',
|
|
145
|
+
text: 'Hi there! How can I help you today?',
|
|
146
|
+
time: '12:00 PM',
|
|
147
|
+
isSelf: false,
|
|
148
|
+
},
|
|
149
|
+
],
|
|
150
|
+
placeholder: 'Type your message here...',
|
|
151
|
+
},
|
|
152
|
+
parameters: {
|
|
153
|
+
docs: {
|
|
154
|
+
description: {
|
|
155
|
+
story:
|
|
156
|
+
'An interactive example where you can send messages and see them appear in the chat.',
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
};
|