@shohojdhara/atomix 0.1.16 → 0.1.18
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/CONTRIBUTING.md +151 -0
- package/NEXTJS_INTEGRATION.md +358 -0
- package/README.md +168 -119
- package/babel.config.js +58 -0
- package/css.d.ts +10 -0
- package/dist/css/atomix.css +1 -2
- package/dist/js/194.js +1 -2
- package/dist/js/244.js +1 -0
- package/dist/js/atomix.react.cjs.js +1 -0
- package/dist/js/atomix.react.esm.js +1 -2
- package/dist/js/atomix.react.umd.js +1 -2
- package/dist/js/chunks/cjs/202.9d3b1ef1eaa0d5c8a309.js +1 -0
- package/dist/js/chunks/cjs/308.6ea9685ea38ead4120d0.js +1 -0
- package/dist/js/chunks/cjs/54.73db6922594e421ba6b1.js +1 -0
- package/dist/js/chunks/cjs/619.51feecaadcab819780d4.js +1 -0
- package/dist/js/chunks/cjs/690.90f6d11164081cbcbc4d.js +1 -0
- package/dist/js/chunks/cjs/894.24877561df336a8dfd14.js +1 -0
- package/dist/js/chunks/cjs/897.6c2a71fae95338890de7.js +1 -0
- package/dist/js/chunks/esm/{202.ff48d27672233280e021.js → 202.82aa7b3244e53c9edb72.js} +1 -2
- package/dist/js/chunks/esm/{308.f873332126eba90e5c62.js → 308.27e1e4005705ae320432.js} +1 -2
- package/dist/js/chunks/esm/{54.4db919e5e4e5cc6d7c72.js → 54.ece1fd6964f98d4d994f.js} +1 -2
- package/dist/js/chunks/esm/{619.afc5a718eff77fa423b5.js → 619.ebeb0298432a066ac05c.js} +1 -2
- package/dist/js/chunks/esm/{690.a9e968c7497d61e56cdc.js → 690.c5f412cc979b55740359.js} +1 -2
- package/dist/js/chunks/esm/{894.f1091a4a8758c26d29e4.js → 894.3604ddc9367d75191198.js} +1 -2
- package/dist/js/chunks/esm/{897.561a50f7d043d42169da.js → 897.a4aab2fad9401693eb12.js} +1 -2
- package/dist/js/chunks/umd/{202.dac7605cc555b6bda542.js → 202.5017dd0403d696bf1644.js} +1 -2
- package/dist/js/chunks/umd/{308.6709979849dcbdb90c9b.js → 308.4bc14b9d7b16b6ee0ab8.js} +1 -2
- package/dist/js/chunks/umd/{54.403470e1f7d0ef4424a7.js → 54.7fdfb4a031989470a70d.js} +1 -2
- package/dist/js/chunks/umd/{619.fa05ea98c10270eb64c5.js → 619.84a0c35ecee695250085.js} +1 -2
- package/dist/js/chunks/umd/{690.aa7054d1c53e5402c2d6.js → 690.d7041094a34a4a434be2.js} +1 -2
- package/dist/js/chunks/umd/{894.3e1eaf0a2aadf4434390.js → 894.c127ee4e9513c22ee97d.js} +1 -2
- package/dist/js/chunks/umd/{897.554ea37be4453698c167.js → 897.26932ac837a39fc91907.js} +1 -2
- package/dist/types/components/Badge/index.d.ts +3 -3
- package/dist/types/components/{Navbar → Navigation/Menu}/MegaMenu.d.ts +1 -1
- package/dist/types/components/{Navbar → Navigation/Menu}/Menu.d.ts +1 -1
- package/dist/types/components/Navigation/Nav/Nav.d.ts +20 -0
- package/dist/types/components/{Navbar → Navigation/Nav}/NavDropdown.d.ts +1 -1
- package/dist/types/components/Navigation/Nav/NavItem.d.ts +33 -0
- package/dist/types/components/Navigation/Navbar/Navbar.d.ts +19 -0
- package/dist/types/components/Navigation/SideMenu/SideMenu.d.ts +20 -0
- package/dist/types/components/Navigation/SideMenu/SideMenuItem.d.ts +30 -0
- package/dist/types/components/Navigation/SideMenu/SideMenuList.d.ts +17 -0
- package/dist/types/components/Navigation/index.d.ts +10 -0
- package/dist/types/components/PhotoViewer/PhotoViewer.d.ts +2 -2
- package/dist/types/components/PhotoViewer/PhotoViewerHeader.d.ts +2 -2
- package/dist/types/components/Tab/index.d.ts +2 -2
- package/dist/types/components/Toggle/index.d.ts +2 -2
- package/dist/types/components/Tooltip/index.d.ts +3 -3
- package/dist/types/components/index.d.ts +1 -1
- package/dist/types/lib/composables/index.d.ts +1 -0
- package/dist/types/lib/composables/useDatePicker.d.ts +1 -1
- package/dist/types/lib/composables/useDropdown.d.ts +1 -1
- package/dist/types/lib/composables/useModal.d.ts +1 -1
- package/dist/types/lib/composables/usePhotoViewer.d.ts +1 -1
- package/dist/types/lib/composables/useRating.d.ts +1 -1
- package/dist/types/lib/composables/useSideMenu.d.ts +28 -0
- package/dist/types/lib/constants/components.d.ts +72 -0
- package/dist/types/lib/types/components.d.ts +103 -0
- package/examples/nextjs-example.tsx +271 -0
- package/implementation-guide.md +505 -0
- package/next.config.js +69 -0
- package/package.json +80 -42
- package/postcss.config.js +28 -0
- package/src/Introduction.mdx +3 -5
- package/src/assets/fonts/HelveticaNeue/stylesheet.css +140 -127
- package/src/components/Accordion/Accordion.stories.tsx +58 -45
- package/src/components/Accordion/Accordion.tsx +14 -4
- package/src/components/Accordion/scripts/accordionInteractions.ts +9 -9
- package/src/components/Accordion/scripts/bundle.ts +1 -1
- package/src/components/Accordion/scripts/index.ts +3 -3
- package/src/components/AtomixLogo.tsx +13 -19
- package/src/components/Avatar/Avatar.stories.tsx +24 -21
- package/src/components/Avatar/Avatar.tsx +5 -8
- package/src/components/Avatar/AvatarGroup.tsx +11 -11
- package/src/components/Avatar/index.ts +1 -1
- package/src/components/Avatar/scripts/index.ts +66 -71
- package/src/components/Badge/Badge.stories.tsx +51 -21
- package/src/components/Badge/Badge.tsx +14 -12
- package/src/components/Badge/index.ts +3 -3
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +40 -40
- package/src/components/Breadcrumb/Breadcrumb.tsx +19 -26
- package/src/components/Breadcrumb/index.ts +1 -1
- package/src/components/Breadcrumb/scripts/breadcrumb.ts +36 -34
- package/src/components/Breadcrumb/scripts/index.ts +1 -1
- package/src/components/Breadcrumb/scripts/types.ts +9 -9
- package/src/components/Button/Button.stories.tsx +36 -12
- package/src/components/Button/Button.tsx +52 -39
- package/src/components/Button/index.ts +1 -1
- package/src/components/Button/scripts/buttonInteractions.ts +9 -9
- package/src/components/Button/scripts/index.ts +1 -1
- package/src/components/Callout/Callout.stories.tsx +207 -114
- package/src/components/Callout/Callout.tsx +12 -12
- package/src/components/Callout/index.ts +1 -1
- package/src/components/Callout/scripts/CalloutInteractions.ts +58 -48
- package/src/components/Callout/scripts/bundle.ts +2 -2
- package/src/components/Callout/scripts/index.ts +19 -15
- package/src/components/Card/Card.stories.tsx +2 -2
- package/src/components/Card/Card.tsx +49 -72
- package/src/components/Card/ElevationCard.tsx +4 -8
- package/src/components/Card/index.ts +1 -1
- package/src/components/Card/scripts/bundle.ts +7 -7
- package/src/components/Card/scripts/cardInteractions.ts +24 -24
- package/src/components/Card/scripts/index.ts +25 -26
- package/src/components/ColorModeToggle/ColorModeToggle.stories.tsx +6 -3
- package/src/components/ColorModeToggle/ColorModeToggle.tsx +12 -15
- package/src/components/ColorModeToggle/index.ts +1 -1
- package/src/components/Countdown/Countdown.stories.tsx +6 -2
- package/src/components/Countdown/Countdown.tsx +56 -48
- package/src/components/Countdown/index.ts +1 -1
- package/src/components/Countdown/scripts/index.ts +33 -28
- package/src/components/DataTable/DataTable.stories.tsx +23 -18
- package/src/components/DataTable/DataTable.tsx +39 -39
- package/src/components/DataTable/index.ts +1 -1
- package/src/components/DataTable/scripts/bundle.ts +8 -3
- package/src/components/DataTable/scripts/index.ts +182 -164
- package/src/components/DatePicker/DatePicker.stories.tsx +136 -148
- package/src/components/DatePicker/DatePicker.tsx +461 -420
- package/src/components/DatePicker/scripts/bundle.ts +12 -7
- package/src/components/DatePicker/scripts/componentInteractions.ts +76 -46
- package/src/components/DatePicker/scripts/index.ts +176 -156
- package/src/components/DatePicker/types.ts +32 -32
- package/src/components/DatePicker/utils.ts +41 -30
- package/src/components/Dropdown/Dropdown.stories.tsx +85 -55
- package/src/components/Dropdown/Dropdown.tsx +97 -88
- package/src/components/Dropdown/index.ts +5 -10
- package/src/components/Dropdown/scripts/bundle.ts +10 -10
- package/src/components/Dropdown/scripts/componentInteractions.ts +10 -2
- package/src/components/Dropdown/scripts/index.ts +122 -117
- package/src/components/EdgePanel/EdgePanel.stories.tsx +142 -58
- package/src/components/EdgePanel/EdgePanel.tsx +7 -13
- package/src/components/EdgePanel/index.ts +1 -1
- package/src/components/EdgePanel/scripts/bundle.ts +5 -5
- package/src/components/EdgePanel/scripts/edgePanelInteractions.ts +26 -26
- package/src/components/EdgePanel/scripts/index.ts +53 -53
- package/src/components/Form/Checkbox.stories.tsx +2 -2
- package/src/components/Form/Checkbox.tsx +13 -7
- package/src/components/Form/Form.stories.tsx +144 -218
- package/src/components/Form/Form.tsx +6 -6
- package/src/components/Form/FormGroup.stories.tsx +21 -38
- package/src/components/Form/FormGroup.tsx +18 -20
- package/src/components/Form/Input.stories.tsx +1 -1
- package/src/components/Form/Input.tsx +18 -8
- package/src/components/Form/Radio.stories.tsx +12 -25
- package/src/components/Form/Radio.tsx +11 -6
- package/src/components/Form/Select.stories.tsx +6 -6
- package/src/components/Form/Select.tsx +31 -33
- package/src/components/Form/Textarea.stories.tsx +7 -2
- package/src/components/Form/Textarea.tsx +17 -8
- package/src/components/Form/index.ts +1 -1
- package/src/components/Hero/Hero.stories.tsx +44 -42
- package/src/components/Hero/Hero.tsx +28 -38
- package/src/components/Hero/index.ts +1 -1
- package/src/components/Hero/scripts/bundle.ts +6 -6
- package/src/components/Hero/scripts/heroInteractions.ts +24 -29
- package/src/components/Hero/scripts/index.ts +16 -17
- package/src/components/Icon/Icon.tsx +16 -18
- package/src/components/Icon/index.ts +1 -1
- package/src/components/List/List.stories.tsx +1 -3
- package/src/components/List/List.tsx +6 -10
- package/src/components/List/ListGroup.tsx +1 -1
- package/src/components/List/index.ts +1 -1
- package/src/components/Messages/Messages.stories.tsx +30 -29
- package/src/components/Messages/Messages.tsx +60 -55
- package/src/components/Messages/index.ts +1 -1
- package/src/components/Messages/scripts/bundle.ts +1 -6
- package/src/components/Messages/scripts/componentInteractions.ts +32 -37
- package/src/components/Messages/scripts/index.ts +61 -55
- package/src/components/Modal/Modal.stories.tsx +77 -53
- package/src/components/Modal/Modal.tsx +63 -62
- package/src/components/Modal/index.ts +1 -1
- package/src/components/Modal/scripts/bundle.ts +3 -3
- package/src/components/Modal/scripts/index.ts +96 -84
- package/src/components/Modal/scripts/modalInteractions.ts +16 -14
- package/src/components/{Navbar → Navigation/Menu}/MegaMenu.tsx +50 -59
- package/src/components/Navigation/Menu/Menu.stories.tsx +340 -0
- package/src/components/Navigation/Menu/Menu.tsx +110 -0
- package/src/components/Navigation/Nav/Nav.stories.tsx +458 -0
- package/src/components/Navigation/Nav/Nav.tsx +50 -0
- package/src/components/Navigation/Nav/NavDropdown.tsx +105 -0
- package/src/components/Navigation/Nav/NavItem.tsx +159 -0
- package/src/components/{Navbar → Navigation/Navbar}/Navbar.stories.tsx +198 -104
- 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 +618 -0
- package/src/components/Navigation/SideMenu/SideMenu.tsx +101 -0
- package/src/components/Navigation/SideMenu/SideMenuItem.tsx +95 -0
- package/src/components/Navigation/SideMenu/SideMenuList.tsx +41 -0
- package/src/components/Navigation/index.ts +23 -0
- package/src/components/Navigation/scripts/NavbarInteractions.ts +171 -0
- package/src/components/Navigation/scripts/SideMenu.ts +319 -0
- package/src/components/Navigation/scripts/SideMenuBundle.ts +69 -0
- package/src/components/Navigation/scripts/SideMenuInteractions.ts +250 -0
- package/src/components/Navigation/scripts/bundle.ts +58 -0
- package/src/components/Navigation/scripts/index.ts +248 -0
- package/src/components/Pagination/Pagination.stories.tsx +34 -33
- package/src/components/Pagination/Pagination.tsx +25 -35
- package/src/components/Pagination/index.ts +1 -1
- package/src/components/Pagination/scripts/index.ts +42 -37
- package/src/components/PhotoViewer/PhotoViewer.stories.tsx +48 -48
- package/src/components/PhotoViewer/PhotoViewer.tsx +29 -46
- package/src/components/PhotoViewer/PhotoViewerHeader.tsx +20 -26
- package/src/components/PhotoViewer/PhotoViewerImage.tsx +19 -17
- package/src/components/PhotoViewer/PhotoViewerInfo.tsx +13 -5
- package/src/components/PhotoViewer/PhotoViewerNavigation.tsx +5 -5
- package/src/components/PhotoViewer/PhotoViewerThumbnails.tsx +31 -30
- package/src/components/PhotoViewer/examples/ImageGallery.tsx +27 -37
- package/src/components/PhotoViewer/examples/SimpleGallery.tsx +19 -13
- package/src/components/PhotoViewer/examples/index.ts +1 -1
- package/src/components/PhotoViewer/index.ts +1 -1
- package/src/components/PhotoViewer/scripts/PhotoViewerInteractions.ts +43 -33
- package/src/components/PhotoViewer/scripts/bundle.ts +14 -14
- package/src/components/PhotoViewer/scripts/index.ts +173 -129
- package/src/components/Popover/Popover.stories.tsx +11 -12
- package/src/components/Popover/Popover.tsx +36 -36
- package/src/components/Popover/index.ts +1 -1
- package/src/components/Popover/scripts/bundle.ts +1 -1
- package/src/components/Popover/scripts/componentInteractions.ts +34 -46
- package/src/components/Popover/scripts/index.ts +64 -53
- package/src/components/ProductReview/ProductReview.stories.tsx +10 -8
- package/src/components/ProductReview/ProductReview.tsx +28 -32
- package/src/components/ProductReview/scripts/componentInteractions.ts +20 -20
- package/src/components/Progress/Progress.tsx +36 -34
- package/src/components/Progress/scripts/bundle.ts +7 -2
- package/src/components/Progress/scripts/componentInteractions.ts +29 -23
- package/src/components/Progress/scripts/index.ts +45 -39
- package/src/components/Rating/Rating.stories.tsx +3 -16
- package/src/components/Rating/Rating.tsx +250 -231
- package/src/components/Rating/scripts/bundle.ts +11 -6
- package/src/components/Rating/scripts/index.ts +85 -80
- package/src/components/Rating/scripts/ratingInteractions.ts +27 -24
- package/src/components/River/River.stories.tsx +70 -24
- package/src/components/River/River.tsx +28 -38
- package/src/components/River/index.ts +1 -1
- package/src/components/River/scripts/index.ts +11 -12
- package/src/components/SectionIntro/SectionIntro.stories.tsx +12 -9
- package/src/components/SectionIntro/SectionIntro.tsx +25 -31
- package/src/components/SectionIntro/scripts/componentInteractions.ts +1 -1
- package/src/components/SectionIntro/scripts/index.ts +30 -16
- package/src/components/Spinner/Spinner.stories.tsx +5 -7
- package/src/components/Spinner/Spinner.tsx +11 -6
- package/src/components/Spinner/index.ts +2 -2
- package/src/components/Steps/Steps.stories.tsx +44 -48
- package/src/components/Steps/Steps.tsx +20 -20
- package/src/components/Steps/index.ts +1 -1
- package/src/components/Steps/scripts/index.ts +9 -9
- package/src/components/Tab/Tab.stories.tsx +14 -6
- package/src/components/Tab/Tab.tsx +16 -18
- package/src/components/Tab/index.ts +2 -2
- package/src/components/Tab/scripts/index.ts +13 -13
- package/src/components/Testimonial/Testimonial.stories.tsx +54 -51
- package/src/components/Testimonial/Testimonial.tsx +18 -19
- package/src/components/Testimonial/index.ts +1 -1
- package/src/components/Testimonial/scripts/index.ts +19 -8
- package/src/components/Todo/Todo.stories.tsx +7 -24
- package/src/components/Todo/Todo.tsx +35 -46
- package/src/components/Todo/index.ts +1 -1
- package/src/components/Todo/scripts/bundle.ts +1 -1
- package/src/components/Todo/scripts/index.ts +99 -81
- package/src/components/Todo/scripts/todoInteractions.ts +12 -12
- package/src/components/Todo/scripts/types.ts +3 -3
- package/src/components/Toggle/Toggle.stories.tsx +2 -2
- package/src/components/Toggle/Toggle.tsx +18 -18
- package/src/components/Toggle/index.ts +2 -2
- package/src/components/Toggle/scripts/bundle.ts +7 -2
- package/src/components/Toggle/scripts/index.ts +14 -10
- package/src/components/Toggle/scripts/toggleInteractions.ts +11 -14
- package/src/components/Tooltip/Tooltip.stories.tsx +13 -6
- package/src/components/Tooltip/Tooltip.tsx +25 -15
- package/src/components/Tooltip/index.ts +3 -3
- package/src/components/Tooltip/scripts/bundle.ts +0 -1
- package/src/components/Tooltip/scripts/index.ts +44 -41
- package/src/components/Tooltip/scripts/tooltipInteractions.ts +22 -22
- package/src/components/Upload/Upload.stories.tsx +28 -34
- package/src/components/Upload/Upload.tsx +86 -71
- package/src/components/Upload/index.ts +1 -1
- package/src/components/Upload/scripts/index.ts +58 -43
- package/src/components/index.ts +5 -6
- package/src/design-tokens/BoxShadow/BoxShadow.stories.tsx +13 -10
- package/src/design-tokens/Colors/colors.scss +10 -7
- package/src/design-tokens/Colors/colors.stories.tsx +46 -59
- package/src/design-tokens/Spacing/Spacing.scss +7 -5
- package/src/design-tokens/Spacing/Spacing.stories.tsx +19 -18
- package/src/design-tokens/Typography/Typography.scss +88 -25
- package/src/design-tokens/Typography/Typography.stories.tsx +22 -25
- package/src/docs/implementation-guide.mdx +2 -2
- package/src/htmlComponentsEntry.ts +23 -23
- package/src/index.ts +1 -1
- package/src/layouts/Grid/Container.tsx +6 -10
- package/src/layouts/Grid/Grid.stories.tsx +72 -34
- package/src/layouts/Grid/Grid.tsx +6 -13
- package/src/layouts/Grid/GridCol.tsx +29 -26
- package/src/layouts/Grid/Row.tsx +6 -13
- package/src/layouts/MasonryGrid/MasonryGrid.stories.tsx +79 -72
- package/src/layouts/MasonryGrid/MasonryGrid.tsx +23 -25
- package/src/layouts/MasonryGrid/MasonryGridItem.tsx +4 -12
- package/src/layouts/index.ts +3 -4
- package/src/lib/composables/index.ts +3 -3
- package/src/lib/composables/useAccordion.ts +15 -6
- package/src/lib/composables/useBadge.ts +3 -3
- package/src/lib/composables/useBreadcrumb.ts +6 -12
- package/src/lib/composables/useButton.ts +3 -3
- package/src/lib/composables/useCallout.ts +3 -3
- package/src/lib/composables/useCard.ts +50 -28
- package/src/lib/composables/useCheckbox.ts +7 -7
- package/src/lib/composables/useDataTable.ts +61 -57
- package/src/lib/composables/useDatePicker.ts +255 -231
- package/src/lib/composables/useDropdown.ts +90 -75
- package/src/lib/composables/useEdgePanel.ts +50 -47
- package/src/lib/composables/useForm.ts +4 -7
- package/src/lib/composables/useFormGroup.ts +11 -12
- package/src/lib/composables/useHero.ts +36 -38
- package/src/lib/composables/useInput.ts +9 -10
- package/src/lib/composables/useMessages.ts +12 -14
- package/src/lib/composables/useModal.ts +37 -34
- package/src/lib/composables/useNavbar.ts +33 -22
- package/src/lib/composables/usePagination.ts +3 -10
- package/src/lib/composables/usePhotoViewer.ts +625 -578
- package/src/lib/composables/usePopover.ts +68 -62
- package/src/lib/composables/useProgress.ts +9 -12
- package/src/lib/composables/useRadio.ts +4 -4
- package/src/lib/composables/useRating.ts +82 -70
- package/src/lib/composables/useRiver.ts +28 -31
- package/src/lib/composables/useSelect.ts +7 -8
- package/src/lib/composables/useSideMenu.ts +197 -0
- package/src/lib/composables/useSpinner.ts +3 -3
- package/src/lib/composables/useTextarea.ts +8 -9
- package/src/lib/composables/useTodo.ts +14 -18
- package/src/lib/constants/components.ts +191 -118
- package/src/lib/constants/index.ts +1 -1
- package/src/lib/types/components.ts +454 -324
- package/src/lib/utils/dom.ts +2 -6
- package/src/lib/utils/icons.ts +20 -12
- package/src/lib/utils/index.ts +2 -2
- package/src/lib/utils/useForkRef.ts +1 -2
- package/src/styles/01-settings/_index.scss +59 -59
- package/src/styles/01-settings/_settings.accordion.scss +21 -21
- package/src/styles/01-settings/_settings.animations.scss +2 -2
- package/src/styles/01-settings/_settings.avatar-group.scss +14 -14
- package/src/styles/01-settings/_settings.avatar.scss +31 -31
- package/src/styles/01-settings/_settings.badge.scss +11 -11
- package/src/styles/01-settings/_settings.border-radius.scss +10 -9
- package/src/styles/01-settings/_settings.border.scss +7 -7
- package/src/styles/01-settings/_settings.box-shadow.scss +24 -12
- package/src/styles/01-settings/_settings.breadcrumb.scss +18 -18
- package/src/styles/01-settings/_settings.btn-group.scss +1 -1
- package/src/styles/01-settings/_settings.button.scss +63 -49
- package/src/styles/01-settings/_settings.callout.scss +27 -7
- package/src/styles/01-settings/_settings.card.scss +27 -30
- package/src/styles/01-settings/_settings.checkbox-group.scss +2 -3
- package/src/styles/01-settings/_settings.checkbox.scss +17 -18
- package/src/styles/01-settings/_settings.color-mode.scss +1 -1
- package/src/styles/01-settings/_settings.colors.scss +197 -214
- package/src/styles/01-settings/_settings.config.scss +1 -3
- package/src/styles/01-settings/_settings.countdown.scss +14 -14
- package/src/styles/01-settings/_settings.data-table.scss +6 -6
- package/src/styles/01-settings/_settings.datepicker.scss +40 -42
- package/src/styles/01-settings/_settings.dropdown.scss +30 -30
- package/src/styles/01-settings/_settings.edge-panel.scss +16 -16
- package/src/styles/01-settings/_settings.fonts.scss +14 -12
- package/src/styles/01-settings/_settings.form-group.scss +10 -10
- package/src/styles/01-settings/_settings.form.scss +3 -3
- package/src/styles/01-settings/_settings.grid.scss +1 -1
- package/src/styles/01-settings/_settings.hero.scss +23 -23
- package/src/styles/01-settings/_settings.input.scss +32 -32
- package/src/styles/01-settings/_settings.link.scss +6 -6
- package/src/styles/01-settings/_settings.list-group.scss +12 -12
- package/src/styles/01-settings/_settings.list.scss +2 -2
- package/src/styles/01-settings/_settings.maps.scss +183 -188
- package/src/styles/01-settings/_settings.masonry-grid.scss +2 -2
- package/src/styles/01-settings/_settings.menu.scss +35 -38
- package/src/styles/01-settings/_settings.messages.scss +71 -77
- package/src/styles/01-settings/_settings.modal.scss +24 -24
- package/src/styles/01-settings/_settings.nav.scss +15 -15
- package/src/styles/01-settings/_settings.navbar.scss +39 -12
- package/src/styles/01-settings/_settings.pagination.scss +21 -21
- package/src/styles/01-settings/_settings.photoviewer.scss +1 -1
- package/src/styles/01-settings/_settings.popover.scss +3 -3
- package/src/styles/01-settings/_settings.position.scss +2 -2
- package/src/styles/01-settings/_settings.progress.scss +15 -18
- package/src/styles/01-settings/_settings.rating.scss +7 -7
- package/src/styles/01-settings/_settings.river.scss +25 -25
- package/src/styles/01-settings/_settings.sectionintro.scss +15 -16
- package/src/styles/01-settings/_settings.select.scss +31 -31
- package/src/styles/01-settings/_settings.side-menu.scss +64 -16
- package/src/styles/01-settings/_settings.skeleton.scss +12 -12
- package/src/styles/01-settings/_settings.spacing.scss +62 -33
- package/src/styles/01-settings/_settings.spinner.scss +10 -10
- package/src/styles/01-settings/_settings.steps.scss +22 -22
- package/src/styles/01-settings/_settings.tabs.scss +25 -25
- package/src/styles/01-settings/_settings.testimonials.scss +17 -19
- package/src/styles/01-settings/_settings.todo.scss +1 -1
- package/src/styles/01-settings/_settings.toggle.scss +26 -26
- package/src/styles/01-settings/_settings.tooltip.scss +15 -15
- package/src/styles/01-settings/_settings.typography.scss +65 -48
- package/src/styles/01-settings/_settings.upload.scss +70 -77
- package/src/styles/01-settings/_settings.z-layers.scss +1 -1
- package/src/styles/02-tools/_index.scss +19 -19
- package/src/styles/02-tools/_tools.animations.scss +4 -4
- package/src/styles/02-tools/_tools.border-radius.scss +4 -5
- package/src/styles/02-tools/_tools.breakpoints.scss +33 -34
- package/src/styles/02-tools/_tools.button.scss +49 -25
- package/src/styles/02-tools/_tools.color-mode.scss +11 -11
- package/src/styles/02-tools/_tools.event.scss +1 -1
- package/src/styles/02-tools/_tools.hidden-visually.scss +1 -1
- package/src/styles/02-tools/_tools.hidden.scss +1 -1
- package/src/styles/02-tools/_tools.map-loop.scss +9 -9
- package/src/styles/02-tools/_tools.media-queries.scss +5 -3
- package/src/styles/02-tools/_tools.object-fit.scss +3 -3
- package/src/styles/02-tools/_tools.placeholder.scss +0 -1
- package/src/styles/02-tools/_tools.rem.scss +1 -1
- package/src/styles/02-tools/_tools.spacing.scss +8 -34
- package/src/styles/02-tools/_tools.to-rgb.scss +3 -3
- package/src/styles/02-tools/_tools.transition.scss +1 -1
- package/src/styles/02-tools/_tools.utility-api.scss +29 -14
- package/src/styles/03-generic/_generic.fonts.scss +0 -1
- package/src/styles/03-generic/_generic.reset.scss +13 -8
- package/src/styles/03-generic/_generic.root.scss +5 -5
- package/src/styles/03-generic/_index.scss +4 -4
- package/src/styles/04-elements/_elements.all.scss +2 -2
- package/src/styles/04-elements/_elements.body.scss +1 -2
- package/src/styles/04-elements/_elements.heading.scss +37 -21
- package/src/styles/04-elements/_elements.links.scss +0 -1
- package/src/styles/04-elements/_index.scss +5 -5
- package/src/styles/05-objects/_index.scss +3 -3
- package/src/styles/05-objects/_objects.container.scss +5 -4
- package/src/styles/05-objects/_objects.grid.scss +12 -12
- package/src/styles/05-objects/_objects.masonry-grid.scss +80 -74
- package/src/styles/06-components/_components.accordion.scss +12 -6
- package/src/styles/06-components/_components.avatar-group.scss +9 -8
- package/src/styles/06-components/_components.avatar.scss +78 -77
- package/src/styles/06-components/_components.badge.scss +48 -48
- package/src/styles/06-components/_components.breadcrumb.scss +57 -58
- package/src/styles/06-components/_components.btn-group.scss +22 -22
- package/src/styles/06-components/_components.button.scss +118 -110
- package/src/styles/06-components/_components.callout.scss +21 -15
- package/src/styles/06-components/_components.card.scss +6 -10
- package/src/styles/06-components/_components.checkbox-group.scss +9 -10
- package/src/styles/06-components/_components.checkbox.scss +10 -17
- package/src/styles/06-components/_components.color-mode-toggle.scss +6 -6
- package/src/styles/06-components/_components.countdown.scss +53 -54
- package/src/styles/06-components/_components.data-table.scss +40 -36
- package/src/styles/06-components/_components.datepicker.scss +95 -73
- package/src/styles/06-components/_components.dropdown.scss +15 -9
- package/src/styles/06-components/_components.edge-panel.scss +87 -46
- package/src/styles/06-components/_components.form-group.scss +5 -4
- package/src/styles/06-components/_components.hero.scss +128 -132
- package/src/styles/06-components/_components.icon.scss +16 -16
- package/src/styles/06-components/_components.image-gallery.scss +9 -7
- package/src/styles/06-components/_components.input.scss +18 -16
- package/src/styles/06-components/_components.list-group.scss +52 -51
- package/src/styles/06-components/_components.list.scss +15 -15
- package/src/styles/06-components/_components.menu.scss +225 -220
- package/src/styles/06-components/_components.messages.scss +45 -32
- package/src/styles/06-components/_components.modal.scss +0 -1
- package/src/styles/06-components/_components.nav.scss +56 -11
- package/src/styles/06-components/_components.navbar.scss +278 -202
- package/src/styles/06-components/_components.pagination.scss +7 -6
- package/src/styles/06-components/_components.photoviewer.scss +121 -116
- package/src/styles/06-components/_components.popover.scss +10 -10
- package/src/styles/06-components/_components.product-review.scss +3 -3
- package/src/styles/06-components/_components.progress.scss +32 -35
- package/src/styles/06-components/_components.rating.scss +9 -8
- package/src/styles/06-components/_components.river.scss +4 -2
- package/src/styles/06-components/_components.sectionintro.scss +19 -26
- package/src/styles/06-components/_components.select.scss +7 -8
- package/src/styles/06-components/_components.side-menu.scss +154 -28
- package/src/styles/06-components/_components.skeleton.scss +0 -1
- package/src/styles/06-components/_components.spinner.scss +2 -4
- package/src/styles/06-components/_components.steps.scss +76 -77
- package/src/styles/06-components/_components.tabs.scss +17 -12
- package/src/styles/06-components/_components.testimonials.scss +49 -52
- package/src/styles/06-components/_components.todo.scss +26 -26
- package/src/styles/06-components/_components.tooltip.scss +114 -115
- package/src/styles/06-components/_components.upload.scss +8 -18
- package/src/styles/06-components/_index.scss +48 -48
- package/src/styles/99-utilities/_index.scss +18 -18
- package/src/styles/99-utilities/_utilities.background.scss +13 -13
- package/src/styles/99-utilities/_utilities.border.scss +30 -30
- package/src/styles/99-utilities/_utilities.clearfix.scss +1 -1
- package/src/styles/99-utilities/_utilities.display.scss +5 -4
- package/src/styles/99-utilities/_utilities.flex.scss +19 -19
- package/src/styles/99-utilities/_utilities.link.scss +52 -35
- package/src/styles/99-utilities/_utilities.object-fit.scss +3 -3
- package/src/styles/99-utilities/_utilities.opacity.scss +6 -6
- package/src/styles/99-utilities/_utilities.overflow.scss +4 -4
- package/src/styles/99-utilities/_utilities.position.scss +8 -8
- package/src/styles/99-utilities/_utilities.shadow.scss +13 -13
- package/src/styles/99-utilities/_utilities.sizes.scss +17 -17
- package/src/styles/99-utilities/_utilities.spacing.scss +72 -37
- package/src/styles/99-utilities/_utilities.text.scss +15 -15
- package/src/styles/99-utilities/_utilities.visibility.scss +8 -8
- package/src/styles/99-utilities/_utilities.visually-hidden.scss +1 -1
- package/src/styles/99-utilities/_utilities.z-index.scss +2 -2
- package/tsconfig.json +74 -0
- package/webpack.config.js +463 -0
- package/NPM_PUBLISHING.md +0 -221
- package/dist/css/atomix.css.map +0 -1
- package/dist/js/194.js.map +0 -1
- package/dist/js/atomix.react.esm.js.map +0 -1
- package/dist/js/atomix.react.umd.js.map +0 -1
- package/dist/js/chunks/esm/202.ff48d27672233280e021.js.map +0 -1
- package/dist/js/chunks/esm/308.f873332126eba90e5c62.js.map +0 -1
- package/dist/js/chunks/esm/54.4db919e5e4e5cc6d7c72.js.map +0 -1
- package/dist/js/chunks/esm/619.afc5a718eff77fa423b5.js.map +0 -1
- package/dist/js/chunks/esm/690.a9e968c7497d61e56cdc.js.map +0 -1
- package/dist/js/chunks/esm/894.f1091a4a8758c26d29e4.js.map +0 -1
- package/dist/js/chunks/esm/897.561a50f7d043d42169da.js.map +0 -1
- package/dist/js/chunks/umd/202.dac7605cc555b6bda542.js.map +0 -1
- package/dist/js/chunks/umd/308.6709979849dcbdb90c9b.js.map +0 -1
- package/dist/js/chunks/umd/54.403470e1f7d0ef4424a7.js.map +0 -1
- package/dist/js/chunks/umd/619.fa05ea98c10270eb64c5.js.map +0 -1
- package/dist/js/chunks/umd/690.aa7054d1c53e5402c2d6.js.map +0 -1
- package/dist/js/chunks/umd/894.3e1eaf0a2aadf4434390.js.map +0 -1
- package/dist/js/chunks/umd/897.554ea37be4453698c167.js.map +0 -1
- package/dist/types/components/Navbar/Nav.d.ts +0 -5
- package/dist/types/components/Navbar/NavItem.d.ts +0 -5
- package/dist/types/components/Navbar/Navbar.d.ts +0 -5
- package/dist/types/components/Navbar/index.d.ts +0 -6
- package/src/components/Navbar/Menu.tsx +0 -122
- package/src/components/Navbar/Nav.tsx +0 -35
- package/src/components/Navbar/NavDropdown.tsx +0 -108
- package/src/components/Navbar/NavItem.tsx +0 -128
- package/src/components/Navbar/Navbar.tsx +0 -124
- package/src/components/Navbar/index.ts +0 -6
|
@@ -27,24 +27,24 @@ const meta = {
|
|
|
27
27
|
iconPosition: {
|
|
28
28
|
control: { type: 'radio' },
|
|
29
29
|
options: ['right', 'left'],
|
|
30
|
-
description: 'Position of the icon'
|
|
30
|
+
description: 'Position of the icon',
|
|
31
31
|
},
|
|
32
32
|
defaultOpen: {
|
|
33
33
|
control: 'boolean',
|
|
34
|
-
description: 'Whether the accordion is initially open'
|
|
34
|
+
description: 'Whether the accordion is initially open',
|
|
35
35
|
},
|
|
36
36
|
disabled: {
|
|
37
37
|
control: 'boolean',
|
|
38
|
-
description: 'Whether the accordion is disabled'
|
|
38
|
+
description: 'Whether the accordion is disabled',
|
|
39
39
|
},
|
|
40
40
|
title: {
|
|
41
41
|
control: 'text',
|
|
42
|
-
description: 'Title of the accordion'
|
|
42
|
+
description: 'Title of the accordion',
|
|
43
43
|
},
|
|
44
44
|
children: {
|
|
45
45
|
control: 'text',
|
|
46
|
-
description: 'Content inside the accordion'
|
|
47
|
-
}
|
|
46
|
+
description: 'Content inside the accordion',
|
|
47
|
+
},
|
|
48
48
|
},
|
|
49
49
|
} satisfies Meta<typeof Accordion>;
|
|
50
50
|
|
|
@@ -56,7 +56,7 @@ export const Default: Story = {
|
|
|
56
56
|
args: {
|
|
57
57
|
title: 'Accordion Title',
|
|
58
58
|
children: <p>This is the content of the accordion that appears when expanded.</p>,
|
|
59
|
-
}
|
|
59
|
+
},
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
// Open Accordion
|
|
@@ -65,7 +65,7 @@ export const Open: Story = {
|
|
|
65
65
|
title: 'Open Accordion',
|
|
66
66
|
children: <p>This accordion is open, showing its content.</p>,
|
|
67
67
|
defaultOpen: true,
|
|
68
|
-
}
|
|
68
|
+
},
|
|
69
69
|
};
|
|
70
70
|
|
|
71
71
|
// Disabled Accordion
|
|
@@ -74,7 +74,7 @@ export const Disabled: Story = {
|
|
|
74
74
|
title: 'Disabled Accordion',
|
|
75
75
|
children: <p>This accordion is disabled.</p>,
|
|
76
76
|
disabled: true,
|
|
77
|
-
}
|
|
77
|
+
},
|
|
78
78
|
};
|
|
79
79
|
|
|
80
80
|
// Icon on Left
|
|
@@ -83,7 +83,7 @@ export const IconLeft: Story = {
|
|
|
83
83
|
title: 'Icon on Left',
|
|
84
84
|
children: <p>This accordion has the icon on the left side.</p>,
|
|
85
85
|
iconPosition: 'left',
|
|
86
|
-
}
|
|
86
|
+
},
|
|
87
87
|
};
|
|
88
88
|
|
|
89
89
|
// Custom Icon
|
|
@@ -93,15 +93,24 @@ export const CustomIcon: Story = {
|
|
|
93
93
|
children: <p>This accordion uses a custom plus icon.</p>,
|
|
94
94
|
icon: (
|
|
95
95
|
<i className="c-accordion__icon">
|
|
96
|
-
<svg
|
|
97
|
-
|
|
96
|
+
<svg
|
|
97
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
98
|
+
width="24"
|
|
99
|
+
height="24"
|
|
100
|
+
viewBox="0 0 24 24"
|
|
101
|
+
fill="none"
|
|
102
|
+
stroke="currentColor"
|
|
103
|
+
strokeWidth="2"
|
|
104
|
+
strokeLinecap="round"
|
|
105
|
+
strokeLinejoin="round"
|
|
106
|
+
>
|
|
98
107
|
<circle cx="12" cy="12" r="10" />
|
|
99
108
|
<line x1="12" y1="8" x2="12" y2="16" />
|
|
100
109
|
<line x1="8" y1="12" x2="16" y2="12" />
|
|
101
110
|
</svg>
|
|
102
111
|
</i>
|
|
103
112
|
),
|
|
104
|
-
}
|
|
113
|
+
},
|
|
105
114
|
};
|
|
106
115
|
|
|
107
116
|
// Accordion Group
|
|
@@ -113,23 +122,16 @@ export const AccordionGroup: Story = {
|
|
|
113
122
|
render: () => (
|
|
114
123
|
<div>
|
|
115
124
|
<h2>Accordion Group</h2>
|
|
116
|
-
<div className="u-d-flex u-flex-column u-gap-3" style={{ width:
|
|
117
|
-
<Accordion
|
|
118
|
-
title="First Accordion"
|
|
119
|
-
defaultOpen={true}
|
|
120
|
-
>
|
|
125
|
+
<div className="u-d-flex u-flex-column u-gap-3" style={{ width: '500px' }}>
|
|
126
|
+
<Accordion title="First Accordion" defaultOpen={true}>
|
|
121
127
|
<p>Content of the first accordion.</p>
|
|
122
128
|
</Accordion>
|
|
123
129
|
|
|
124
|
-
<Accordion
|
|
125
|
-
title="Second Accordion"
|
|
126
|
-
>
|
|
130
|
+
<Accordion title="Second Accordion">
|
|
127
131
|
<p>Content of the second accordion.</p>
|
|
128
132
|
</Accordion>
|
|
129
133
|
|
|
130
|
-
<Accordion
|
|
131
|
-
title="Third Accordion"
|
|
132
|
-
>
|
|
134
|
+
<Accordion title="Third Accordion">
|
|
133
135
|
<p>Content of the third accordion with more content.</p>
|
|
134
136
|
<p>Additional paragraph to demonstrate scrolling.</p>
|
|
135
137
|
<ul>
|
|
@@ -140,7 +142,7 @@ export const AccordionGroup: Story = {
|
|
|
140
142
|
</Accordion>
|
|
141
143
|
</div>
|
|
142
144
|
</div>
|
|
143
|
-
)
|
|
145
|
+
),
|
|
144
146
|
};
|
|
145
147
|
|
|
146
148
|
// All Variants
|
|
@@ -183,12 +185,21 @@ export const AllVariants: Story = {
|
|
|
183
185
|
|
|
184
186
|
<div>
|
|
185
187
|
<h3>Custom Icon</h3>
|
|
186
|
-
<Accordion
|
|
187
|
-
title="Custom Icon"
|
|
188
|
+
<Accordion
|
|
189
|
+
title="Custom Icon"
|
|
188
190
|
icon={
|
|
189
191
|
<i className="c-accordion__icon">
|
|
190
|
-
<svg
|
|
191
|
-
|
|
192
|
+
<svg
|
|
193
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
194
|
+
width="24"
|
|
195
|
+
height="24"
|
|
196
|
+
viewBox="0 0 24 24"
|
|
197
|
+
fill="none"
|
|
198
|
+
stroke="currentColor"
|
|
199
|
+
strokeWidth="2"
|
|
200
|
+
strokeLinecap="round"
|
|
201
|
+
strokeLinejoin="round"
|
|
202
|
+
>
|
|
192
203
|
<circle cx="12" cy="12" r="10" />
|
|
193
204
|
<line x1="12" y1="8" x2="12" y2="16" />
|
|
194
205
|
<line x1="8" y1="12" x2="16" y2="12" />
|
|
@@ -205,11 +216,19 @@ export const AllVariants: Story = {
|
|
|
205
216
|
<Accordion title="Rich Content">
|
|
206
217
|
<div>
|
|
207
218
|
<h4>Section Title</h4>
|
|
208
|
-
<p>
|
|
219
|
+
<p>
|
|
220
|
+
This accordion contains rich HTML content including headings, paragraphs, and lists.
|
|
221
|
+
</p>
|
|
209
222
|
<ul>
|
|
210
|
-
<li>
|
|
211
|
-
|
|
212
|
-
|
|
223
|
+
<li>
|
|
224
|
+
List item with <a href="#">link</a>
|
|
225
|
+
</li>
|
|
226
|
+
<li>
|
|
227
|
+
List item with <strong>bold text</strong>
|
|
228
|
+
</li>
|
|
229
|
+
<li>
|
|
230
|
+
List item with <em>italic text</em>
|
|
231
|
+
</li>
|
|
213
232
|
</ul>
|
|
214
233
|
<div className="u-p-3 u-mt-3 u-bg-light u-border-radius-1">
|
|
215
234
|
<code>This is a code block inside the accordion</code>
|
|
@@ -219,7 +238,7 @@ export const AllVariants: Story = {
|
|
|
219
238
|
</div>
|
|
220
239
|
</div>
|
|
221
240
|
</div>
|
|
222
|
-
)
|
|
241
|
+
),
|
|
223
242
|
};
|
|
224
243
|
|
|
225
244
|
// Controlled Accordion
|
|
@@ -232,17 +251,10 @@ export const Controlled: Story = {
|
|
|
232
251
|
const [open, setOpen] = React.useState(false);
|
|
233
252
|
return (
|
|
234
253
|
<div>
|
|
235
|
-
<button
|
|
236
|
-
className="c-btn c-btn--primary u-mb-3"
|
|
237
|
-
onClick={() => setOpen((prev) => !prev)}
|
|
238
|
-
>
|
|
254
|
+
<button className="c-btn c-btn--primary u-mb-3" onClick={() => setOpen(prev => !prev)}>
|
|
239
255
|
Toggle Accordion (Controlled)
|
|
240
256
|
</button>
|
|
241
|
-
<Accordion
|
|
242
|
-
title="Controlled Accordion"
|
|
243
|
-
isOpen={open}
|
|
244
|
-
onOpenChange={setOpen}
|
|
245
|
-
>
|
|
257
|
+
<Accordion title="Controlled Accordion" isOpen={open} onOpenChange={setOpen}>
|
|
246
258
|
<p>This accordion is controlled by external state.</p>
|
|
247
259
|
</Accordion>
|
|
248
260
|
</div>
|
|
@@ -251,8 +263,9 @@ export const Controlled: Story = {
|
|
|
251
263
|
parameters: {
|
|
252
264
|
docs: {
|
|
253
265
|
description: {
|
|
254
|
-
story:
|
|
266
|
+
story:
|
|
267
|
+
'This story demonstrates a controlled Accordion using the `isOpen` and `onOpenChange` props.',
|
|
255
268
|
},
|
|
256
269
|
},
|
|
257
270
|
},
|
|
258
|
-
};
|
|
271
|
+
};
|
|
@@ -41,7 +41,7 @@ export interface AccordionProps extends BaseComponentProps {
|
|
|
41
41
|
* Callback when open state changes (for controlled mode)
|
|
42
42
|
*/
|
|
43
43
|
onOpenChange?: (open: boolean) => void;
|
|
44
|
-
}
|
|
44
|
+
}
|
|
45
45
|
|
|
46
46
|
export const Accordion: React.FC<AccordionProps> = ({
|
|
47
47
|
title,
|
|
@@ -67,19 +67,29 @@ export const Accordion: React.FC<AccordionProps> = ({
|
|
|
67
67
|
panelRef,
|
|
68
68
|
contentRef,
|
|
69
69
|
generateClassNames,
|
|
70
|
-
generateHeaderClassNames
|
|
70
|
+
generateHeaderClassNames,
|
|
71
71
|
} = useAccordion({
|
|
72
72
|
defaultOpen,
|
|
73
73
|
disabled,
|
|
74
74
|
iconPosition,
|
|
75
75
|
isOpen: controlledOpen,
|
|
76
|
-
onOpenChange
|
|
76
|
+
onOpenChange,
|
|
77
77
|
});
|
|
78
78
|
|
|
79
79
|
// Default icon
|
|
80
80
|
const defaultIcon = (
|
|
81
81
|
<i className="c-accordion__icon">
|
|
82
|
-
<svg
|
|
82
|
+
<svg
|
|
83
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
84
|
+
width="24"
|
|
85
|
+
height="24"
|
|
86
|
+
viewBox="0 0 24 24"
|
|
87
|
+
fill="none"
|
|
88
|
+
stroke="currentColor"
|
|
89
|
+
strokeWidth="2"
|
|
90
|
+
strokeLinecap="round"
|
|
91
|
+
strokeLinejoin="round"
|
|
92
|
+
>
|
|
83
93
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
84
94
|
</svg>
|
|
85
95
|
</i>
|
|
@@ -8,12 +8,12 @@ import { addClass, removeClass } from '../../../lib/utils/dom';
|
|
|
8
8
|
*/
|
|
9
9
|
export function applyEnterAnimation(accordion: HTMLElement): void {
|
|
10
10
|
const header = accordion.querySelector(ACCORDION.SELECTORS.HEADER) as HTMLElement;
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
if (!header) return;
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
header.addEventListener('click', () => {
|
|
15
15
|
const isOpen = accordion.classList.contains(ACCORDION.CLASSES.IS_OPEN);
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
if (isOpen) {
|
|
18
18
|
addClass(accordion, ACCORDION.CLASSES.IS_ANIMATING);
|
|
19
19
|
setTimeout(() => {
|
|
@@ -29,15 +29,15 @@ export function applyEnterAnimation(accordion: HTMLElement): void {
|
|
|
29
29
|
*/
|
|
30
30
|
export function initializeAccordionsWithCustomBehavior(): Accordion[] {
|
|
31
31
|
const instances = initializeAccordions() as Accordion[];
|
|
32
|
-
|
|
32
|
+
|
|
33
33
|
// Get all accordion elements
|
|
34
34
|
const accordions = document.querySelectorAll<HTMLElement>(ACCORDION.SELECTORS.ACCORDION);
|
|
35
|
-
|
|
35
|
+
|
|
36
36
|
// Apply custom animations to each accordion
|
|
37
37
|
accordions.forEach(accordion => {
|
|
38
38
|
applyEnterAnimation(accordion);
|
|
39
39
|
});
|
|
40
|
-
|
|
40
|
+
|
|
41
41
|
return instances;
|
|
42
42
|
}
|
|
43
43
|
|
|
@@ -46,7 +46,7 @@ export function initializeAccordionsWithCustomBehavior(): Accordion[] {
|
|
|
46
46
|
*/
|
|
47
47
|
export function openAllAccordions(): void {
|
|
48
48
|
const accordions = document.querySelectorAll<HTMLElement>(ACCORDION.SELECTORS.ACCORDION);
|
|
49
|
-
|
|
49
|
+
|
|
50
50
|
accordions.forEach(accordion => {
|
|
51
51
|
const header = accordion.querySelector(ACCORDION.SELECTORS.HEADER) as HTMLButtonElement;
|
|
52
52
|
if (header && !accordion.classList.contains(ACCORDION.CLASSES.IS_OPEN)) {
|
|
@@ -60,11 +60,11 @@ export function openAllAccordions(): void {
|
|
|
60
60
|
*/
|
|
61
61
|
export function closeAllAccordions(): void {
|
|
62
62
|
const accordions = document.querySelectorAll<HTMLElement>(ACCORDION.SELECTORS.ACCORDION);
|
|
63
|
-
|
|
63
|
+
|
|
64
64
|
accordions.forEach(accordion => {
|
|
65
65
|
const header = accordion.querySelector(ACCORDION.SELECTORS.HEADER) as HTMLButtonElement;
|
|
66
66
|
if (header && accordion.classList.contains(ACCORDION.CLASSES.IS_OPEN)) {
|
|
67
67
|
header.click();
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
|
-
}
|
|
70
|
+
}
|
|
@@ -21,4 +21,4 @@ if (typeof window !== 'undefined') {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
// Export for module bundling
|
|
24
|
-
export { Accordion as default, initializeAccordions, openAllAccordions, closeAllAccordions };
|
|
24
|
+
export { Accordion as default, initializeAccordions, openAllAccordions, closeAllAccordions };
|
|
@@ -108,7 +108,7 @@ class Accordion implements AccordionInstance {
|
|
|
108
108
|
*/
|
|
109
109
|
private _observeResizing(): void {
|
|
110
110
|
if (!this.$body) return;
|
|
111
|
-
|
|
111
|
+
|
|
112
112
|
this._resizeObserver = new ResizeObserver(() => {
|
|
113
113
|
if (this.$accordion.classList.contains(ACCORDION.CLASSES.IS_OPEN)) {
|
|
114
114
|
this._updatePanelHeight();
|
|
@@ -188,7 +188,7 @@ export function initializeAccordions(): AccordionInstance[] {
|
|
|
188
188
|
|
|
189
189
|
if (!$accordions.length) return accordionInstances;
|
|
190
190
|
|
|
191
|
-
$accordions.forEach(
|
|
191
|
+
$accordions.forEach($accordion => {
|
|
192
192
|
try {
|
|
193
193
|
const instance = new Accordion($accordion);
|
|
194
194
|
accordionInstances.push(instance);
|
|
@@ -209,4 +209,4 @@ export const CSS_VARS = ACCORDION.CSS_VARS;
|
|
|
209
209
|
// Export component interactions
|
|
210
210
|
export * from './accordionInteractions';
|
|
211
211
|
|
|
212
|
-
export default Accordion;
|
|
212
|
+
export default Accordion;
|
|
@@ -6,35 +6,29 @@ export interface AtomixLogoProps {
|
|
|
6
6
|
className?: string;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export const AtomixLogo: React.FC<AtomixLogoProps> = ({
|
|
10
|
-
height = 40,
|
|
11
|
-
width = 100,
|
|
12
|
-
className = ''
|
|
9
|
+
export const AtomixLogo: React.FC<AtomixLogoProps> = ({
|
|
10
|
+
height = 40,
|
|
11
|
+
width = 100,
|
|
12
|
+
className = '',
|
|
13
13
|
}) => {
|
|
14
14
|
return (
|
|
15
|
-
<svg
|
|
16
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
17
|
-
width={width}
|
|
18
|
-
height={height}
|
|
15
|
+
<svg
|
|
16
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
17
|
+
width={width}
|
|
18
|
+
height={height}
|
|
19
19
|
viewBox="0 0 120 48"
|
|
20
20
|
className={className}
|
|
21
21
|
>
|
|
22
22
|
{/* Atom icon */}
|
|
23
23
|
<g transform="translate(0, 8) scale(0.06)">
|
|
24
|
-
<path
|
|
25
|
-
fill="currentColor"
|
|
24
|
+
<path
|
|
25
|
+
fill="currentColor"
|
|
26
26
|
d="M256 398.8c-11.8 5.1-23.4 9.7-34.9 13.5c16.7 33.8 31 35.7 34.9 35.7s18.1-1.9 34.9-35.7c-11.4-3.9-23.1-8.4-34.9-13.5zM446 256c33 45.2 44.3 90.9 23.6 128c-20.2 36.3-62.5 49.3-115.2 43.2c-22 52.1-55.6 84.8-98.4 84.8s-76.4-32.7-98.4-84.8c-52.7 6.1-95-6.8-115.2-43.2C21.7 346.9 33 301.2 66 256c-33-45.2-44.3-90.9-23.6-128c20.2-36.3 62.5-49.3 115.2-43.2C179.6 32.7 213.2 0 256 0s76.4 32.7 98.4 84.8c52.7-6.1 95 6.8 115.2 43.2c20.7 37.1 9.4 82.8-23.6 128zm-65.8 67.4c-1.7 14.2-3.9 28-6.7 41.2c31.8 1.4 38.6-8.7 40.2-11.7c2.3-4.2 7-17.9-11.9-48.1c-6.8 6.3-14 12.5-21.6 18.6zm-6.7-175.9c2.8 13.1 5 26.9 6.7 41.2c7.6 6.1 14.8 12.3 21.6 18.6c18.9-30.2 14.2-44 11.9-48.1c-1.6-2.9-8.4-13-40.2-11.7zM290.9 99.7C274.1 65.9 259.9 64 256 64s-18.1 1.9-34.9 35.7c11.4 3.9 23.1 8.4 34.9 13.5c11.8-5.1 23.4-9.7 34.9-13.5zm-159 88.9c1.7-14.3 3.9-28 6.7-41.2c-31.8-1.4-38.6 8.7-40.2 11.7c-2.3 4.2-7 17.9 11.9 48.1c6.8-6.3 14-12.5 21.6-18.6zM110.2 304.8C91.4 335 96 348.7 98.3 352.9c1.6 2.9 8.4 13 40.2 11.7c-2.8-13.1-5-26.9-6.7-41.2c-7.6-6.1-14.8-12.3-21.6-18.6zM336 256a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zm-80-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"
|
|
27
27
|
/>
|
|
28
28
|
</g>
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
{/* Atomix text */}
|
|
31
|
-
<text
|
|
32
|
-
x="32"
|
|
33
|
-
y="32"
|
|
34
|
-
fontSize="22"
|
|
35
|
-
fontWeight="700"
|
|
36
|
-
fill="currentColor"
|
|
37
|
-
>
|
|
31
|
+
<text x="32" y="32" fontSize="22" fontWeight="700" fill="currentColor">
|
|
38
32
|
Atomix
|
|
39
33
|
</text>
|
|
40
34
|
</svg>
|
|
@@ -43,4 +37,4 @@ export const AtomixLogo: React.FC<AtomixLogoProps> = ({
|
|
|
43
37
|
|
|
44
38
|
AtomixLogo.displayName = 'AtomixLogo';
|
|
45
39
|
|
|
46
|
-
export default AtomixLogo;
|
|
40
|
+
export default AtomixLogo;
|
|
@@ -72,7 +72,7 @@ export const VariantsShowcase: Story = {
|
|
|
72
72
|
icon: null,
|
|
73
73
|
fallback: 'invalid-url.jpg',
|
|
74
74
|
};
|
|
75
|
-
|
|
75
|
+
|
|
76
76
|
return (
|
|
77
77
|
<div className="u-d-grid u-gap-6" style={{ gridTemplateColumns: 'auto 1fr 1fr 1fr 1fr 1fr' }}>
|
|
78
78
|
{/* Header Row */}
|
|
@@ -82,7 +82,7 @@ export const VariantsShowcase: Story = {
|
|
|
82
82
|
{size.toUpperCase()}
|
|
83
83
|
</div>
|
|
84
84
|
))}
|
|
85
|
-
|
|
85
|
+
|
|
86
86
|
{/* Square Avatars */}
|
|
87
87
|
<div>Square</div>
|
|
88
88
|
{sizeOptions.map(size => (
|
|
@@ -90,7 +90,7 @@ export const VariantsShowcase: Story = {
|
|
|
90
90
|
<Avatar src={variantImages.square} size={size} />
|
|
91
91
|
</div>
|
|
92
92
|
))}
|
|
93
|
-
|
|
93
|
+
|
|
94
94
|
{/* Circle Avatars */}
|
|
95
95
|
<div>Circle</div>
|
|
96
96
|
{sizeOptions.map(size => (
|
|
@@ -98,7 +98,7 @@ export const VariantsShowcase: Story = {
|
|
|
98
98
|
<Avatar src={variantImages.circle} size={size} circle={true} />
|
|
99
99
|
</div>
|
|
100
100
|
))}
|
|
101
|
-
|
|
101
|
+
|
|
102
102
|
{/* Initials Avatars */}
|
|
103
103
|
<div>Initials</div>
|
|
104
104
|
{sizeOptions.map(size => (
|
|
@@ -106,15 +106,18 @@ export const VariantsShowcase: Story = {
|
|
|
106
106
|
<Avatar initials="JD" size={size} />
|
|
107
107
|
</div>
|
|
108
108
|
))}
|
|
109
|
-
|
|
109
|
+
|
|
110
110
|
{/* Icon Avatars */}
|
|
111
111
|
<div>Icon</div>
|
|
112
112
|
{sizeOptions.map(size => (
|
|
113
113
|
<div key={size} className="u-d-flex u-justify-content-center">
|
|
114
|
-
<Avatar
|
|
114
|
+
<Avatar
|
|
115
|
+
icon={<Icon name="User" size={size === 'xs' ? 'xs' : size === 'sm' ? 'sm' : 'md'} />}
|
|
116
|
+
size={size}
|
|
117
|
+
/>
|
|
115
118
|
</div>
|
|
116
119
|
))}
|
|
117
|
-
|
|
120
|
+
|
|
118
121
|
{/* Fallback Avatars */}
|
|
119
122
|
<div>Fallback</div>
|
|
120
123
|
{sizeOptions.map(size => (
|
|
@@ -122,27 +125,27 @@ export const VariantsShowcase: Story = {
|
|
|
122
125
|
<Avatar src={variantImages.fallback} size={size} />
|
|
123
126
|
</div>
|
|
124
127
|
))}
|
|
125
|
-
|
|
128
|
+
|
|
126
129
|
{/* Interactive Avatars */}
|
|
127
130
|
<div>Interactive</div>
|
|
128
131
|
{sizeOptions.map(size => (
|
|
129
132
|
<div key={size} className="u-d-flex u-justify-content-center">
|
|
130
|
-
<Avatar
|
|
131
|
-
src={`https://i.pravatar.cc/150?img=${size === 'xs' ? 4 : size === 'sm' ? 5 : size === 'md' ? 6 : size === 'lg' ? 7 : 8}`}
|
|
132
|
-
size={size}
|
|
133
|
+
<Avatar
|
|
134
|
+
src={`https://i.pravatar.cc/150?img=${size === 'xs' ? 4 : size === 'sm' ? 5 : size === 'md' ? 6 : size === 'lg' ? 7 : 8}`}
|
|
135
|
+
size={size}
|
|
133
136
|
circle={true}
|
|
134
137
|
onClick={() => alert(`${size.toUpperCase()} Avatar clicked!`)}
|
|
135
138
|
/>
|
|
136
139
|
</div>
|
|
137
140
|
))}
|
|
138
|
-
|
|
141
|
+
|
|
139
142
|
{/* Disabled Avatars */}
|
|
140
143
|
<div>Disabled</div>
|
|
141
144
|
{sizeOptions.map(size => (
|
|
142
145
|
<div key={size} className="u-d-flex u-justify-content-center">
|
|
143
|
-
<Avatar
|
|
144
|
-
src={`https://i.pravatar.cc/150?img=${size === 'xs' ? 9 : size === 'sm' ? 10 : size === 'md' ? 11 : size === 'lg' ? 12 : 13}`}
|
|
145
|
-
size={size}
|
|
146
|
+
<Avatar
|
|
147
|
+
src={`https://i.pravatar.cc/150?img=${size === 'xs' ? 9 : size === 'sm' ? 10 : size === 'md' ? 11 : size === 'lg' ? 12 : 13}`}
|
|
148
|
+
size={size}
|
|
146
149
|
circle={true}
|
|
147
150
|
disabled={true}
|
|
148
151
|
onClick={() => alert('This will not be triggered')}
|
|
@@ -158,7 +161,7 @@ export const VariantsShowcase: Story = {
|
|
|
158
161
|
export const AvatarGroupShowcase: Story = {
|
|
159
162
|
render: () => {
|
|
160
163
|
const sizes = ['xs', 'sm', 'md', 'lg', 'xl'] as const;
|
|
161
|
-
|
|
164
|
+
|
|
162
165
|
return (
|
|
163
166
|
<div className="u-d-flex u-flex-column u-gap-8">
|
|
164
167
|
{/* First row: Standard and Stacked side by side */}
|
|
@@ -181,7 +184,7 @@ export const AvatarGroupShowcase: Story = {
|
|
|
181
184
|
))}
|
|
182
185
|
</div>
|
|
183
186
|
</div>
|
|
184
|
-
|
|
187
|
+
|
|
185
188
|
{/* Stacked Avatar Groups */}
|
|
186
189
|
<div className="u-flex-grow-1">
|
|
187
190
|
<h3 className="u-mb-4 u-fw-normal">Stacked Avatar Groups</h3>
|
|
@@ -201,7 +204,7 @@ export const AvatarGroupShowcase: Story = {
|
|
|
201
204
|
</div>
|
|
202
205
|
</div>
|
|
203
206
|
</div>
|
|
204
|
-
|
|
207
|
+
|
|
205
208
|
{/* Second row: Max and Stacked+Max side by side */}
|
|
206
209
|
<div className="u-d-flex u-gap-12">
|
|
207
210
|
{/* Avatar Groups with Max Limit */}
|
|
@@ -222,7 +225,7 @@ export const AvatarGroupShowcase: Story = {
|
|
|
222
225
|
))}
|
|
223
226
|
</div>
|
|
224
227
|
</div>
|
|
225
|
-
|
|
228
|
+
|
|
226
229
|
{/* Stacked Avatar Groups with Max Limit */}
|
|
227
230
|
<div className="u-flex-grow-1">
|
|
228
231
|
<h3 className="u-mb-4 u-fw-normal">Stacked Groups with Max Limit</h3>
|
|
@@ -242,7 +245,7 @@ export const AvatarGroupShowcase: Story = {
|
|
|
242
245
|
</div>
|
|
243
246
|
</div>
|
|
244
247
|
</div>
|
|
245
|
-
|
|
248
|
+
|
|
246
249
|
{/* Mixed Content Avatar Groups */}
|
|
247
250
|
<div>
|
|
248
251
|
<h3 className="u-mb-4 u-fw-normal">Mixed Content Avatar Groups</h3>
|
|
@@ -257,4 +260,4 @@ export const AvatarGroupShowcase: Story = {
|
|
|
257
260
|
</div>
|
|
258
261
|
);
|
|
259
262
|
},
|
|
260
|
-
};
|
|
263
|
+
};
|
|
@@ -27,7 +27,9 @@ export const Avatar: React.FC<AvatarProps> = ({
|
|
|
27
27
|
circle && AVATAR.CLASSES.CIRCLE,
|
|
28
28
|
disabled && 'is-disabled',
|
|
29
29
|
className,
|
|
30
|
-
]
|
|
30
|
+
]
|
|
31
|
+
.filter(Boolean)
|
|
32
|
+
.join(' ');
|
|
31
33
|
|
|
32
34
|
// Handle click event
|
|
33
35
|
const handleClick = (e: React.MouseEvent<HTMLDivElement>) => {
|
|
@@ -37,7 +39,7 @@ export const Avatar: React.FC<AvatarProps> = ({
|
|
|
37
39
|
};
|
|
38
40
|
|
|
39
41
|
return (
|
|
40
|
-
<div
|
|
42
|
+
<div
|
|
41
43
|
className={avatarClasses}
|
|
42
44
|
onClick={onClick ? handleClick : undefined}
|
|
43
45
|
role={onClick ? 'button' : undefined}
|
|
@@ -45,12 +47,7 @@ export const Avatar: React.FC<AvatarProps> = ({
|
|
|
45
47
|
aria-disabled={disabled || undefined}
|
|
46
48
|
>
|
|
47
49
|
{src && !imageError ? (
|
|
48
|
-
<img
|
|
49
|
-
src={src}
|
|
50
|
-
alt={alt}
|
|
51
|
-
className="c-avatar__image"
|
|
52
|
-
onError={handleImageError}
|
|
53
|
-
/>
|
|
50
|
+
<img src={src} alt={alt} className="c-avatar__image" onError={handleImageError} />
|
|
54
51
|
) : initials ? (
|
|
55
52
|
<span className="c-avatar__initials">{initials}</span>
|
|
56
53
|
) : icon ? (
|
|
@@ -15,7 +15,9 @@ export const AvatarGroup: React.FC<AvatarGroupProps> = ({
|
|
|
15
15
|
AVATAR_GROUP.CLASSES.BASE,
|
|
16
16
|
stacked && AVATAR_GROUP.CLASSES.STACKED,
|
|
17
17
|
className,
|
|
18
|
-
]
|
|
18
|
+
]
|
|
19
|
+
.filter(Boolean)
|
|
20
|
+
.join(' ');
|
|
19
21
|
|
|
20
22
|
// Get valid Avatar children
|
|
21
23
|
const avatarChildren = Children.toArray(children).filter(
|
|
@@ -24,14 +26,12 @@ export const AvatarGroup: React.FC<AvatarGroupProps> = ({
|
|
|
24
26
|
|
|
25
27
|
// Determine if we need to show the "more" indicator
|
|
26
28
|
const showMoreIndicator = max !== undefined && avatarChildren.length > max;
|
|
27
|
-
const visibleAvatars = showMoreIndicator
|
|
28
|
-
? avatarChildren.slice(0, max)
|
|
29
|
-
: avatarChildren;
|
|
29
|
+
const visibleAvatars = showMoreIndicator ? avatarChildren.slice(0, max) : avatarChildren;
|
|
30
30
|
const hiddenAvatarCount = avatarChildren.length - (max || 0);
|
|
31
31
|
|
|
32
32
|
// Extract size and shape from first avatar to ensure consistent styling
|
|
33
|
-
const firstAvatar = isValidElement<AvatarProps>(avatarChildren[0])
|
|
34
|
-
? avatarChildren[0].props
|
|
33
|
+
const firstAvatar = isValidElement<AvatarProps>(avatarChildren[0])
|
|
34
|
+
? avatarChildren[0].props
|
|
35
35
|
: null;
|
|
36
36
|
const avatarSize = firstAvatar?.size || 'md';
|
|
37
37
|
const isCircle = firstAvatar?.circle || false;
|
|
@@ -42,7 +42,9 @@ export const AvatarGroup: React.FC<AvatarGroupProps> = ({
|
|
|
42
42
|
AVATAR_GROUP.CLASSES.MORE,
|
|
43
43
|
avatarSize !== 'md' && `c-avatar--${avatarSize}`,
|
|
44
44
|
isCircle && 'c-avatar--circle',
|
|
45
|
-
]
|
|
45
|
+
]
|
|
46
|
+
.filter(Boolean)
|
|
47
|
+
.join(' ');
|
|
46
48
|
|
|
47
49
|
return (
|
|
48
50
|
<div className={avatarGroupClasses}>
|
|
@@ -58,15 +60,13 @@ export const AvatarGroup: React.FC<AvatarGroupProps> = ({
|
|
|
58
60
|
})}
|
|
59
61
|
|
|
60
62
|
{showMoreIndicator && (
|
|
61
|
-
<div className={moreClasses}>
|
|
62
|
-
{moreText || `+${hiddenAvatarCount}`}
|
|
63
|
-
</div>
|
|
63
|
+
<div className={moreClasses}>{moreText || `+${hiddenAvatarCount}`}</div>
|
|
64
64
|
)}
|
|
65
65
|
</div>
|
|
66
66
|
);
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
-
export type { AvatarGroupProps }
|
|
69
|
+
export type { AvatarGroupProps };
|
|
70
70
|
|
|
71
71
|
AvatarGroup.displayName = 'AvatarGroup';
|
|
72
72
|
|