@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
|
@@ -30,14 +30,14 @@ const DEFAULT_AVATAR_OPTIONS: AvatarOptions = {
|
|
|
30
30
|
alt: 'Avatar',
|
|
31
31
|
size: 'md',
|
|
32
32
|
circle: false,
|
|
33
|
-
disabled: false
|
|
33
|
+
disabled: false,
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* Default options for the AvatarGroup component
|
|
38
38
|
*/
|
|
39
39
|
const DEFAULT_AVATAR_GROUP_OPTIONS: AvatarGroupOptions = {
|
|
40
|
-
stacked: false
|
|
40
|
+
stacked: false,
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
/**
|
|
@@ -56,7 +56,7 @@ function createUserIcon(size: number = 24): string {
|
|
|
56
56
|
export class Avatar {
|
|
57
57
|
// DOM element
|
|
58
58
|
private element: HTMLElement;
|
|
59
|
-
|
|
59
|
+
|
|
60
60
|
// Options
|
|
61
61
|
private options: AvatarOptions;
|
|
62
62
|
|
|
@@ -67,17 +67,16 @@ export class Avatar {
|
|
|
67
67
|
*/
|
|
68
68
|
constructor(element: string | HTMLElement, options: AvatarOptions = {}) {
|
|
69
69
|
// Get element reference
|
|
70
|
-
this.element =
|
|
71
|
-
? document.querySelector(element) as HTMLElement
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
this.element =
|
|
71
|
+
typeof element === 'string' ? (document.querySelector(element) as HTMLElement) : element;
|
|
72
|
+
|
|
74
73
|
if (!this.element) {
|
|
75
74
|
throw new Error('Avatar: Element not found');
|
|
76
75
|
}
|
|
77
|
-
|
|
76
|
+
|
|
78
77
|
// Merge default options with provided options
|
|
79
78
|
this.options = { ...DEFAULT_AVATAR_OPTIONS, ...options };
|
|
80
|
-
|
|
79
|
+
|
|
81
80
|
// Initialize the component
|
|
82
81
|
this._initialize();
|
|
83
82
|
}
|
|
@@ -89,31 +88,31 @@ export class Avatar {
|
|
|
89
88
|
private _initialize(): void {
|
|
90
89
|
// Clear element
|
|
91
90
|
this.element.innerHTML = '';
|
|
92
|
-
|
|
91
|
+
|
|
93
92
|
// Add base class
|
|
94
93
|
this.element.classList.add(AVATAR.CLASSES.BASE);
|
|
95
|
-
|
|
94
|
+
|
|
96
95
|
// Add size class if not default
|
|
97
96
|
if (this.options.size && this.options.size !== 'md') {
|
|
98
97
|
this.element.classList.add(`c-avatar--${this.options.size}`);
|
|
99
98
|
}
|
|
100
|
-
|
|
99
|
+
|
|
101
100
|
// Add circle class if needed
|
|
102
101
|
if (this.options.circle) {
|
|
103
102
|
this.element.classList.add(AVATAR.CLASSES.CIRCLE);
|
|
104
103
|
}
|
|
105
|
-
|
|
104
|
+
|
|
106
105
|
// Add disabled class if needed
|
|
107
106
|
if (this.options.disabled) {
|
|
108
107
|
this.element.classList.add('is-disabled');
|
|
109
108
|
}
|
|
110
|
-
|
|
109
|
+
|
|
111
110
|
// Set role and tabindex if clickable
|
|
112
111
|
if (this.options.onClick && !this.options.disabled) {
|
|
113
112
|
this.element.setAttribute('role', 'button');
|
|
114
113
|
this.element.setAttribute('tabindex', '0');
|
|
115
114
|
this.element.addEventListener('click', this.options.onClick);
|
|
116
|
-
|
|
115
|
+
|
|
117
116
|
// Add keyboard accessibility
|
|
118
117
|
this.element.addEventListener('keydown', (e: KeyboardEvent) => {
|
|
119
118
|
if ((e.key === 'Enter' || e.key === ' ') && this.options.onClick) {
|
|
@@ -122,7 +121,7 @@ export class Avatar {
|
|
|
122
121
|
}
|
|
123
122
|
});
|
|
124
123
|
}
|
|
125
|
-
|
|
124
|
+
|
|
126
125
|
// Create content
|
|
127
126
|
this._createContent();
|
|
128
127
|
}
|
|
@@ -138,12 +137,12 @@ export class Avatar {
|
|
|
138
137
|
img.src = this.options.src;
|
|
139
138
|
img.alt = this.options.alt || 'Avatar';
|
|
140
139
|
img.className = 'c-avatar__image';
|
|
141
|
-
|
|
140
|
+
|
|
142
141
|
// Handle image error
|
|
143
142
|
img.addEventListener('error', () => {
|
|
144
143
|
this._handleImageError();
|
|
145
144
|
});
|
|
146
|
-
|
|
145
|
+
|
|
147
146
|
this.element.appendChild(img);
|
|
148
147
|
} else if (this.options.initials) {
|
|
149
148
|
// Create initials
|
|
@@ -161,7 +160,7 @@ export class Avatar {
|
|
|
161
160
|
// Create default user icon
|
|
162
161
|
const iconSpan = document.createElement('span');
|
|
163
162
|
iconSpan.className = 'c-avatar__icon';
|
|
164
|
-
|
|
163
|
+
|
|
165
164
|
// Determine icon size based on avatar size
|
|
166
165
|
let iconSize = 24;
|
|
167
166
|
switch (this.options.size) {
|
|
@@ -178,7 +177,7 @@ export class Avatar {
|
|
|
178
177
|
iconSize = 32;
|
|
179
178
|
break;
|
|
180
179
|
}
|
|
181
|
-
|
|
180
|
+
|
|
182
181
|
iconSpan.innerHTML = createUserIcon(iconSize);
|
|
183
182
|
this.element.appendChild(iconSpan);
|
|
184
183
|
}
|
|
@@ -191,7 +190,7 @@ export class Avatar {
|
|
|
191
190
|
private _handleImageError(): void {
|
|
192
191
|
// Clear element
|
|
193
192
|
this.element.innerHTML = '';
|
|
194
|
-
|
|
193
|
+
|
|
195
194
|
// Fall back to initials or icon
|
|
196
195
|
if (this.options.initials) {
|
|
197
196
|
const initialsSpan = document.createElement('span');
|
|
@@ -206,7 +205,7 @@ export class Avatar {
|
|
|
206
205
|
} else {
|
|
207
206
|
const iconSpan = document.createElement('span');
|
|
208
207
|
iconSpan.className = 'c-avatar__icon';
|
|
209
|
-
|
|
208
|
+
|
|
210
209
|
// Determine icon size based on avatar size
|
|
211
210
|
let iconSize = 24;
|
|
212
211
|
switch (this.options.size) {
|
|
@@ -223,7 +222,7 @@ export class Avatar {
|
|
|
223
222
|
iconSize = 32;
|
|
224
223
|
break;
|
|
225
224
|
}
|
|
226
|
-
|
|
225
|
+
|
|
227
226
|
iconSpan.innerHTML = createUserIcon(iconSize);
|
|
228
227
|
this.element.appendChild(iconSpan);
|
|
229
228
|
}
|
|
@@ -236,7 +235,7 @@ export class Avatar {
|
|
|
236
235
|
public update(options: Partial<AvatarOptions>): void {
|
|
237
236
|
// Update options
|
|
238
237
|
this.options = { ...this.options, ...options };
|
|
239
|
-
|
|
238
|
+
|
|
240
239
|
// Re-initialize
|
|
241
240
|
this._initialize();
|
|
242
241
|
}
|
|
@@ -250,7 +249,7 @@ export class Avatar {
|
|
|
250
249
|
if (this.options.onClick) {
|
|
251
250
|
this.element.removeEventListener('click', this.options.onClick);
|
|
252
251
|
}
|
|
253
|
-
|
|
252
|
+
|
|
254
253
|
// Remove all classes
|
|
255
254
|
this.element.classList.remove(
|
|
256
255
|
AVATAR.CLASSES.BASE,
|
|
@@ -262,10 +261,10 @@ export class Avatar {
|
|
|
262
261
|
AVATAR.CLASSES.CIRCLE,
|
|
263
262
|
'is-disabled'
|
|
264
263
|
);
|
|
265
|
-
|
|
264
|
+
|
|
266
265
|
// Clear content
|
|
267
266
|
this.element.innerHTML = '';
|
|
268
|
-
|
|
267
|
+
|
|
269
268
|
// Remove attributes
|
|
270
269
|
this.element.removeAttribute('role');
|
|
271
270
|
this.element.removeAttribute('tabindex');
|
|
@@ -281,35 +280,35 @@ export class Avatar {
|
|
|
281
280
|
return Array.from(elements).map(element => {
|
|
282
281
|
// Try to get options from data attributes
|
|
283
282
|
const options: AvatarOptions = {};
|
|
284
|
-
|
|
283
|
+
|
|
285
284
|
// Get src
|
|
286
285
|
const src = element.getAttribute('data-src');
|
|
287
286
|
if (src) options.src = src;
|
|
288
|
-
|
|
287
|
+
|
|
289
288
|
// Get alt
|
|
290
289
|
const alt = element.getAttribute('data-alt');
|
|
291
290
|
if (alt) options.alt = alt;
|
|
292
|
-
|
|
291
|
+
|
|
293
292
|
// Get initials
|
|
294
293
|
const initials = element.getAttribute('data-initials');
|
|
295
294
|
if (initials) options.initials = initials;
|
|
296
|
-
|
|
295
|
+
|
|
297
296
|
// Get icon
|
|
298
297
|
const icon = element.getAttribute('data-icon');
|
|
299
298
|
if (icon) options.icon = icon;
|
|
300
|
-
|
|
299
|
+
|
|
301
300
|
// Get size
|
|
302
301
|
const size = element.getAttribute('data-size') as 'xs' | 'sm' | 'md' | 'lg' | 'xl' | null;
|
|
303
302
|
if (size && ['xs', 'sm', 'md', 'lg', 'xl'].includes(size)) options.size = size;
|
|
304
|
-
|
|
303
|
+
|
|
305
304
|
// Get circle
|
|
306
305
|
const circle = element.getAttribute('data-circle');
|
|
307
306
|
options.circle = circle === 'true';
|
|
308
|
-
|
|
307
|
+
|
|
309
308
|
// Get disabled
|
|
310
309
|
const disabled = element.getAttribute('data-disabled');
|
|
311
310
|
options.disabled = disabled === 'true';
|
|
312
|
-
|
|
311
|
+
|
|
313
312
|
return new Avatar(element as HTMLElement, options);
|
|
314
313
|
});
|
|
315
314
|
}
|
|
@@ -321,10 +320,10 @@ export class Avatar {
|
|
|
321
320
|
export class AvatarGroup {
|
|
322
321
|
// DOM element
|
|
323
322
|
private element: HTMLElement;
|
|
324
|
-
|
|
323
|
+
|
|
325
324
|
// Options
|
|
326
325
|
private options: AvatarGroupOptions;
|
|
327
|
-
|
|
326
|
+
|
|
328
327
|
// Child avatars
|
|
329
328
|
private avatars: HTMLElement[] = [];
|
|
330
329
|
|
|
@@ -335,20 +334,19 @@ export class AvatarGroup {
|
|
|
335
334
|
*/
|
|
336
335
|
constructor(element: string | HTMLElement, options: AvatarGroupOptions = {}) {
|
|
337
336
|
// Get element reference
|
|
338
|
-
this.element =
|
|
339
|
-
? document.querySelector(element) as HTMLElement
|
|
340
|
-
|
|
341
|
-
|
|
337
|
+
this.element =
|
|
338
|
+
typeof element === 'string' ? (document.querySelector(element) as HTMLElement) : element;
|
|
339
|
+
|
|
342
340
|
if (!this.element) {
|
|
343
341
|
throw new Error('AvatarGroup: Element not found');
|
|
344
342
|
}
|
|
345
|
-
|
|
343
|
+
|
|
346
344
|
// Merge default options with provided options
|
|
347
345
|
this.options = { ...DEFAULT_AVATAR_GROUP_OPTIONS, ...options };
|
|
348
|
-
|
|
346
|
+
|
|
349
347
|
// Find child avatars
|
|
350
348
|
this.avatars = Array.from(this.element.querySelectorAll('.c-avatar'));
|
|
351
|
-
|
|
349
|
+
|
|
352
350
|
// Initialize the component
|
|
353
351
|
this._initialize();
|
|
354
352
|
}
|
|
@@ -360,12 +358,12 @@ export class AvatarGroup {
|
|
|
360
358
|
private _initialize(): void {
|
|
361
359
|
// Add base class
|
|
362
360
|
this.element.classList.add(AVATAR_GROUP.CLASSES.BASE);
|
|
363
|
-
|
|
361
|
+
|
|
364
362
|
// Add stacked class if needed
|
|
365
363
|
if (this.options.stacked) {
|
|
366
364
|
this.element.classList.add(AVATAR_GROUP.CLASSES.STACKED);
|
|
367
365
|
}
|
|
368
|
-
|
|
366
|
+
|
|
369
367
|
// Handle max avatars
|
|
370
368
|
if (this.options.max !== undefined && this.avatars.length > this.options.max) {
|
|
371
369
|
this._handleMaxAvatars();
|
|
@@ -378,21 +376,21 @@ export class AvatarGroup {
|
|
|
378
376
|
*/
|
|
379
377
|
private _handleMaxAvatars(): void {
|
|
380
378
|
if (!this.options.max) return;
|
|
381
|
-
|
|
379
|
+
|
|
382
380
|
// Hide avatars beyond the max
|
|
383
381
|
const visibleAvatars = this.avatars.slice(0, this.options.max);
|
|
384
382
|
const hiddenAvatars = this.avatars.slice(this.options.max);
|
|
385
|
-
|
|
383
|
+
|
|
386
384
|
// Hide extra avatars
|
|
387
385
|
hiddenAvatars.forEach(avatar => {
|
|
388
386
|
avatar.style.display = 'none';
|
|
389
387
|
});
|
|
390
|
-
|
|
388
|
+
|
|
391
389
|
// Get size and shape from first avatar to ensure consistent styling
|
|
392
390
|
const firstAvatar = this.avatars[0];
|
|
393
391
|
let avatarSize = 'md';
|
|
394
392
|
let isCircle = false;
|
|
395
|
-
|
|
393
|
+
|
|
396
394
|
if (firstAvatar) {
|
|
397
395
|
// Extract size from class name
|
|
398
396
|
['xs', 'sm', 'md', 'lg', 'xl'].forEach(size => {
|
|
@@ -400,26 +398,26 @@ export class AvatarGroup {
|
|
|
400
398
|
avatarSize = size;
|
|
401
399
|
}
|
|
402
400
|
});
|
|
403
|
-
|
|
401
|
+
|
|
404
402
|
// Check if circular
|
|
405
403
|
isCircle = firstAvatar.classList.contains('c-avatar--circle');
|
|
406
404
|
}
|
|
407
|
-
|
|
405
|
+
|
|
408
406
|
// Create "more" indicator
|
|
409
407
|
const moreElement = document.createElement('div');
|
|
410
408
|
moreElement.className = AVATAR_GROUP.CLASSES.MORE;
|
|
411
|
-
|
|
409
|
+
|
|
412
410
|
// Add size and shape classes to match avatars
|
|
413
411
|
if (avatarSize !== 'md') {
|
|
414
412
|
moreElement.classList.add(`c-avatar--${avatarSize}`);
|
|
415
413
|
}
|
|
416
|
-
|
|
414
|
+
|
|
417
415
|
if (isCircle) {
|
|
418
416
|
moreElement.classList.add('c-avatar--circle');
|
|
419
417
|
}
|
|
420
|
-
|
|
418
|
+
|
|
421
419
|
moreElement.textContent = this.options.moreText || `+${hiddenAvatars.length}`;
|
|
422
|
-
|
|
420
|
+
|
|
423
421
|
// Append to element
|
|
424
422
|
this.element.appendChild(moreElement);
|
|
425
423
|
}
|
|
@@ -431,21 +429,21 @@ export class AvatarGroup {
|
|
|
431
429
|
public update(options: Partial<AvatarGroupOptions>): void {
|
|
432
430
|
// Update options
|
|
433
431
|
this.options = { ...this.options, ...options };
|
|
434
|
-
|
|
432
|
+
|
|
435
433
|
// Clear "more" indicator
|
|
436
434
|
const moreElement = this.element.querySelector(`.${AVATAR_GROUP.CLASSES.MORE}`);
|
|
437
435
|
if (moreElement) {
|
|
438
436
|
moreElement.remove();
|
|
439
437
|
}
|
|
440
|
-
|
|
438
|
+
|
|
441
439
|
// Reset hidden avatars
|
|
442
440
|
this.avatars.forEach(avatar => {
|
|
443
441
|
avatar.style.display = '';
|
|
444
442
|
});
|
|
445
|
-
|
|
443
|
+
|
|
446
444
|
// Remove stacked class
|
|
447
445
|
this.element.classList.remove(AVATAR_GROUP.CLASSES.STACKED);
|
|
448
|
-
|
|
446
|
+
|
|
449
447
|
// Re-initialize
|
|
450
448
|
this._initialize();
|
|
451
449
|
}
|
|
@@ -456,16 +454,13 @@ export class AvatarGroup {
|
|
|
456
454
|
*/
|
|
457
455
|
public destroy(): void {
|
|
458
456
|
// Remove classes
|
|
459
|
-
this.element.classList.remove(
|
|
460
|
-
|
|
461
|
-
AVATAR_GROUP.CLASSES.STACKED
|
|
462
|
-
);
|
|
463
|
-
|
|
457
|
+
this.element.classList.remove(AVATAR_GROUP.CLASSES.BASE, AVATAR_GROUP.CLASSES.STACKED);
|
|
458
|
+
|
|
464
459
|
// Show all avatars
|
|
465
460
|
this.avatars.forEach(avatar => {
|
|
466
461
|
avatar.style.display = '';
|
|
467
462
|
});
|
|
468
|
-
|
|
463
|
+
|
|
469
464
|
// Remove "more" indicator
|
|
470
465
|
const moreElement = this.element.querySelector(`.${AVATAR_GROUP.CLASSES.MORE}`);
|
|
471
466
|
if (moreElement) {
|
|
@@ -483,20 +478,20 @@ export class AvatarGroup {
|
|
|
483
478
|
return Array.from(elements).map(element => {
|
|
484
479
|
// Try to get options from data attributes
|
|
485
480
|
const options: AvatarGroupOptions = {};
|
|
486
|
-
|
|
481
|
+
|
|
487
482
|
// Get max
|
|
488
483
|
const max = element.getAttribute('data-max');
|
|
489
484
|
if (max) options.max = parseInt(max, 10);
|
|
490
|
-
|
|
485
|
+
|
|
491
486
|
// Get stacked
|
|
492
487
|
const stacked = element.getAttribute('data-stacked');
|
|
493
488
|
options.stacked = stacked === 'true';
|
|
494
|
-
|
|
489
|
+
|
|
495
490
|
// Get more text
|
|
496
491
|
const moreText = element.getAttribute('data-more-text');
|
|
497
492
|
if (moreText) options.moreText = moreText;
|
|
498
|
-
|
|
493
|
+
|
|
499
494
|
return new AvatarGroup(element as HTMLElement, options);
|
|
500
495
|
});
|
|
501
496
|
}
|
|
502
|
-
}
|
|
497
|
+
}
|
|
@@ -18,20 +18,20 @@ const meta = {
|
|
|
18
18
|
variant: {
|
|
19
19
|
control: { type: 'select' },
|
|
20
20
|
options: THEME_COLORS,
|
|
21
|
-
description: 'The visual style of the badge'
|
|
21
|
+
description: 'The visual style of the badge',
|
|
22
22
|
},
|
|
23
23
|
size: {
|
|
24
24
|
control: { type: 'select' },
|
|
25
25
|
options: SIZES,
|
|
26
|
-
description: 'The size of the badge'
|
|
26
|
+
description: 'The size of the badge',
|
|
27
27
|
},
|
|
28
28
|
disabled: {
|
|
29
29
|
control: 'boolean',
|
|
30
|
-
description: 'Whether the badge is disabled'
|
|
30
|
+
description: 'Whether the badge is disabled',
|
|
31
31
|
},
|
|
32
32
|
icon: {
|
|
33
33
|
control: 'text',
|
|
34
|
-
description: 'Optional icon element to display in the badge'
|
|
34
|
+
description: 'Optional icon element to display in the badge',
|
|
35
35
|
},
|
|
36
36
|
},
|
|
37
37
|
} satisfies Meta<typeof Badge>;
|
|
@@ -41,7 +41,17 @@ type Story = StoryObj<typeof meta>;
|
|
|
41
41
|
|
|
42
42
|
// Mock icon component for stories
|
|
43
43
|
const Icon = () => (
|
|
44
|
-
<svg
|
|
44
|
+
<svg
|
|
45
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
46
|
+
width="16"
|
|
47
|
+
height="16"
|
|
48
|
+
viewBox="0 0 24 24"
|
|
49
|
+
fill="none"
|
|
50
|
+
stroke="currentColor"
|
|
51
|
+
strokeWidth="2"
|
|
52
|
+
strokeLinecap="round"
|
|
53
|
+
strokeLinejoin="round"
|
|
54
|
+
>
|
|
45
55
|
<path d="M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20z"></path>
|
|
46
56
|
<path d="M12 8v8"></path>
|
|
47
57
|
<path d="M8 12h8"></path>
|
|
@@ -166,7 +176,7 @@ export const AllVariants: Story = {
|
|
|
166
176
|
},
|
|
167
177
|
render: () => (
|
|
168
178
|
<div className="u-d-flex u-flex-wrap u-gap-2">
|
|
169
|
-
{THEME_COLORS.map(
|
|
179
|
+
{THEME_COLORS.map(color => (
|
|
170
180
|
<Badge key={color} label={color} variant={color} />
|
|
171
181
|
))}
|
|
172
182
|
</div>
|
|
@@ -253,7 +263,7 @@ export const UsageExamples: Story = {
|
|
|
253
263
|
</div>
|
|
254
264
|
</div>
|
|
255
265
|
</div>
|
|
256
|
-
|
|
266
|
+
|
|
257
267
|
<div>
|
|
258
268
|
<h3 className="u-mt-0 u-mb-2">In cards</h3>
|
|
259
269
|
<div className="u-p-4 u-shadow u-d-flex u-flex-column u-gap-2">
|
|
@@ -268,15 +278,21 @@ export const UsageExamples: Story = {
|
|
|
268
278
|
</div>
|
|
269
279
|
</div>
|
|
270
280
|
</div>
|
|
271
|
-
|
|
281
|
+
|
|
272
282
|
<div>
|
|
273
283
|
<h3 className="u-mt-0 u-mb-2">In lists</h3>
|
|
274
284
|
<ul className="u-p-0 u-m-0" style={{ listStyle: 'none' }}>
|
|
275
|
-
<li
|
|
285
|
+
<li
|
|
286
|
+
className="u-py-2 u-d-flex u-justify-content-between"
|
|
287
|
+
style={{ borderBottom: '1px solid #e0e0e0' }}
|
|
288
|
+
>
|
|
276
289
|
<span>Task 1</span>
|
|
277
290
|
<Badge label="Completed" variant="success" size="sm" />
|
|
278
291
|
</li>
|
|
279
|
-
<li
|
|
292
|
+
<li
|
|
293
|
+
className="u-py-2 u-d-flex u-justify-content-between"
|
|
294
|
+
style={{ borderBottom: '1px solid #e0e0e0' }}
|
|
295
|
+
>
|
|
280
296
|
<span>Task 2</span>
|
|
281
297
|
<Badge label="In Progress" variant="warning" size="sm" />
|
|
282
298
|
</li>
|
|
@@ -300,45 +316,59 @@ export const ThemeAwareBadges: Story = {
|
|
|
300
316
|
<div className="u-d-flex u-flex-column u-gap-6">
|
|
301
317
|
<div>
|
|
302
318
|
<h3 className="u-mt-0 u-mb-2">Theme Aware Badges</h3>
|
|
303
|
-
<p className="u-mb-4">
|
|
319
|
+
<p className="u-mb-4">
|
|
320
|
+
The badges below demonstrate how they adapt to different theme modes.
|
|
321
|
+
</p>
|
|
304
322
|
<div className="u-d-flex u-gap-5 u-mt-4">
|
|
305
323
|
<div className="u-p-5 u-shadow u-flex-1">
|
|
306
324
|
<h4 className="u-mt-0">Current Theme</h4>
|
|
307
325
|
<div className="u-d-flex u-flex-wrap u-gap-2">
|
|
308
|
-
{THEME_COLORS.map(
|
|
326
|
+
{THEME_COLORS.map(color => (
|
|
309
327
|
<Badge key={color} label={color} variant={color} />
|
|
310
328
|
))}
|
|
311
329
|
</div>
|
|
312
330
|
</div>
|
|
313
331
|
</div>
|
|
314
332
|
</div>
|
|
315
|
-
|
|
333
|
+
|
|
316
334
|
<div>
|
|
317
335
|
<h3 className="u-mt-2 u-mb-2">Accessibility Considerations</h3>
|
|
318
|
-
<p className="u-mb-2">
|
|
336
|
+
<p className="u-mb-2">
|
|
337
|
+
Our badges are designed to maintain proper contrast in both light and dark modes.
|
|
338
|
+
</p>
|
|
319
339
|
<div className="u-d-flex u-flex-column u-gap-2 u-mt-2">
|
|
320
340
|
<div className="u-d-flex u-align-items-center u-gap-2">
|
|
321
|
-
<span className="u-d-inline-block" style={{ width: '120px' }}>
|
|
341
|
+
<span className="u-d-inline-block" style={{ width: '120px' }}>
|
|
342
|
+
Primary:
|
|
343
|
+
</span>
|
|
322
344
|
<Badge label="New Feature" variant="primary" />
|
|
323
345
|
</div>
|
|
324
346
|
<div className="u-d-flex u-align-items-center u-gap-2">
|
|
325
|
-
<span className="u-d-inline-block" style={{ width: '120px' }}>
|
|
347
|
+
<span className="u-d-inline-block" style={{ width: '120px' }}>
|
|
348
|
+
Success:
|
|
349
|
+
</span>
|
|
326
350
|
<Badge label="Completed" variant="success" />
|
|
327
351
|
</div>
|
|
328
352
|
<div className="u-d-flex u-align-items-center u-gap-2">
|
|
329
|
-
<span className="u-d-inline-block" style={{ width: '120px' }}>
|
|
353
|
+
<span className="u-d-inline-block" style={{ width: '120px' }}>
|
|
354
|
+
Warning:
|
|
355
|
+
</span>
|
|
330
356
|
<Badge label="In Progress" variant="warning" />
|
|
331
357
|
</div>
|
|
332
358
|
<div className="u-d-flex u-align-items-center u-gap-2">
|
|
333
|
-
<span className="u-d-inline-block" style={{ width: '120px' }}>
|
|
359
|
+
<span className="u-d-inline-block" style={{ width: '120px' }}>
|
|
360
|
+
error:
|
|
361
|
+
</span>
|
|
334
362
|
<Badge label="Failed" variant="error" />
|
|
335
363
|
</div>
|
|
336
364
|
</div>
|
|
337
365
|
</div>
|
|
338
|
-
|
|
366
|
+
|
|
339
367
|
<div className="u-mt-4">
|
|
340
|
-
<p>
|
|
368
|
+
<p>
|
|
369
|
+
Use the Color Mode toggle in the Storybook toolbar to switch between light and dark mode!
|
|
370
|
+
</p>
|
|
341
371
|
</div>
|
|
342
372
|
</div>
|
|
343
373
|
),
|
|
344
|
-
};
|
|
374
|
+
};
|
|
@@ -11,27 +11,29 @@ export const Badge: React.FC<BadgeProps> = ({
|
|
|
11
11
|
icon,
|
|
12
12
|
className = '',
|
|
13
13
|
}) => {
|
|
14
|
-
const { generateBadgeClass } = useBadge({
|
|
15
|
-
variant,
|
|
14
|
+
const { generateBadgeClass } = useBadge({
|
|
15
|
+
variant,
|
|
16
|
+
size,
|
|
17
|
+
disabled,
|
|
16
18
|
});
|
|
17
|
-
|
|
18
|
-
const badgeClass = generateBadgeClass({
|
|
19
|
-
variant,
|
|
19
|
+
|
|
20
|
+
const badgeClass = generateBadgeClass({
|
|
21
|
+
variant,
|
|
22
|
+
size,
|
|
23
|
+
disabled,
|
|
24
|
+
className,
|
|
20
25
|
});
|
|
21
|
-
|
|
26
|
+
|
|
22
27
|
return (
|
|
23
|
-
<span
|
|
24
|
-
className={badgeClass}
|
|
25
|
-
aria-disabled={disabled}
|
|
26
|
-
>
|
|
28
|
+
<span className={badgeClass} aria-disabled={disabled}>
|
|
27
29
|
{icon && <span className={BADGE.ICON_CLASS}>{icon}</span>}
|
|
28
30
|
<span>{label}</span>
|
|
29
31
|
</span>
|
|
30
32
|
);
|
|
31
|
-
};
|
|
33
|
+
};
|
|
32
34
|
|
|
33
35
|
Badge.displayName = 'Badge';
|
|
34
36
|
|
|
35
37
|
export type { BadgeProps };
|
|
36
38
|
|
|
37
|
-
export default Badge;
|
|
39
|
+
export default Badge;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { Badge } from
|
|
2
|
-
export { default } from
|
|
3
|
-
export type { BadgeProps } from
|
|
1
|
+
export { Badge } from './Badge';
|
|
2
|
+
export { default } from './Badge';
|
|
3
|
+
export type { BadgeProps } from './Badge';
|