@shohojdhara/atomix 0.1.30 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -0
- package/LICENSE +0 -0
- package/README.md +128 -43
- package/dist/atomix.css +15025 -0
- package/dist/atomix.min.css +15 -0
- package/dist/index.d.ts +6459 -1748
- package/dist/index.esm.js +17559 -8364
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +17603 -8369
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/themes/boomdevs.css +14677 -0
- package/dist/themes/boomdevs.min.css +405 -0
- package/dist/themes/esrar.css +16870 -0
- package/dist/themes/esrar.min.css +189 -0
- package/dist/themes/mashroom.css +29578 -0
- package/dist/themes/mashroom.min.css +403 -0
- package/dist/themes/shaj-default.css +15702 -0
- package/dist/themes/shaj-default.min.css +500 -0
- package/dist/themes/yabai.css +15207 -0
- package/dist/themes/yabai.min.css +189 -0
- package/package.json +126 -99
- package/src/components/Accordion/Accordion.stories.tsx +271 -0
- package/src/components/Accordion/Accordion.tsx +131 -0
- package/src/components/Accordion/index.ts +3 -0
- package/src/components/AtomixLogo/AtomixLogo.tsx +36 -0
- package/src/components/AtomixLogo/index.ts +3 -0
- package/src/components/AtomixLogo.tsx +40 -0
- package/src/components/Avatar/Avatar.stories.tsx +257 -0
- package/src/components/Avatar/Avatar.tsx +68 -0
- package/src/components/Avatar/AvatarGroup.tsx +73 -0
- package/src/components/Avatar/index.ts +3 -0
- package/src/components/Badge/Badge.stories.tsx +371 -0
- package/src/components/Badge/Badge.tsx +39 -0
- package/src/components/Badge/index.ts +3 -0
- package/src/components/Block/Block.stories.tsx +408 -0
- package/src/components/Block/Block.tsx +137 -0
- package/src/components/Block/index.ts +1 -0
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +106 -0
- package/src/components/Breadcrumb/Breadcrumb.tsx +112 -0
- package/src/components/Breadcrumb/index.ts +3 -0
- package/src/components/Button/Button.stories.tsx +312 -0
- package/src/components/Button/Button.tsx +69 -0
- package/src/components/Button/index.ts +3 -0
- package/src/components/Callout/Callout.stories.tsx +588 -0
- package/src/components/Callout/Callout.tsx +78 -0
- package/src/components/Callout/index.ts +1 -0
- package/src/components/Card/Card.stories.tsx +105 -0
- package/src/components/Card/Card.tsx +69 -0
- package/src/components/Card/ElevationCard.tsx +47 -0
- package/src/components/Card/index.ts +15 -0
- package/src/components/Chart/AdvancedChart.tsx +624 -0
- package/src/components/Chart/AnimatedChart.tsx +206 -0
- package/src/components/Chart/AreaChart.tsx +27 -0
- package/src/components/Chart/BarChart.tsx +148 -0
- package/src/components/Chart/BubbleChart.tsx +411 -0
- package/src/components/Chart/CandlestickChart.tsx +765 -0
- package/src/components/Chart/Chart.stories.tsx +527 -0
- package/src/components/Chart/Chart.tsx +218 -0
- package/src/components/Chart/ChartRenderer.tsx +322 -0
- package/src/components/Chart/ChartToolbar.tsx +436 -0
- package/src/components/Chart/ChartTooltip.tsx +101 -0
- package/src/components/Chart/DonutChart.tsx +370 -0
- package/src/components/Chart/FunnelChart.tsx +393 -0
- package/src/components/Chart/GaugeChart.tsx +550 -0
- package/src/components/Chart/HeatmapChart.tsx +614 -0
- package/src/components/Chart/LineChart.tsx +172 -0
- package/src/components/Chart/LineChartNew.tsx +167 -0
- package/src/components/Chart/MultiAxisChart.tsx +498 -0
- package/src/components/Chart/PieChart.tsx +103 -0
- package/src/components/Chart/RadarChart.tsx +332 -0
- package/src/components/Chart/RealTimeChart.tsx +436 -0
- package/src/components/Chart/ScatterChart.tsx +152 -0
- package/src/components/Chart/TreemapChart.tsx +574 -0
- package/src/components/Chart/WaterfallChart.tsx +450 -0
- package/src/components/Chart/index.ts +119 -0
- package/src/components/Chart/types.ts +338 -0
- package/src/components/ColorModeToggle/ColorModeToggle.stories.tsx +44 -0
- package/src/components/ColorModeToggle/ColorModeToggle.tsx +85 -0
- package/src/components/ColorModeToggle/index.ts +2 -0
- package/src/components/Countdown/Countdown.stories.tsx +46 -0
- package/src/components/Countdown/Countdown.tsx +90 -0
- package/src/components/Countdown/index.ts +2 -0
- package/src/components/DataTable/DataTable.stories.tsx +248 -0
- package/src/components/DataTable/DataTable.tsx +213 -0
- package/src/components/DataTable/index.ts +3 -0
- package/src/components/DatePicker/DatePicker.stories.tsx +364 -0
- package/src/components/DatePicker/DatePicker.tsx +504 -0
- package/src/components/DatePicker/index.ts +4 -0
- package/src/components/DatePicker/readme.md +106 -0
- package/src/components/DatePicker/types.ts +167 -0
- package/src/components/DatePicker/utils.ts +185 -0
- package/src/components/Dropdown/Dropdown.stories.tsx +358 -0
- package/src/components/Dropdown/Dropdown.tsx +352 -0
- package/src/components/Dropdown/index.ts +14 -0
- package/src/components/Dropdown/readme.md +151 -0
- package/src/components/EdgePanel/EdgePanel.stories.tsx +266 -0
- package/src/components/EdgePanel/EdgePanel.tsx +73 -0
- package/src/components/EdgePanel/index.ts +1 -0
- package/src/components/Footer/Footer.stories.tsx +388 -0
- package/src/components/Footer/Footer.tsx +197 -0
- package/src/components/Footer/FooterLink.tsx +72 -0
- package/src/components/Footer/FooterSection.tsx +87 -0
- package/src/components/Footer/FooterSocialLink.tsx +117 -0
- package/src/components/Footer/README.md +261 -0
- package/src/components/Footer/index.ts +13 -0
- package/src/components/Form/Checkbox.stories.tsx +76 -0
- package/src/components/Form/Checkbox.tsx +69 -0
- package/src/components/Form/Form.stories.tsx +497 -0
- package/src/components/Form/Form.tsx +46 -0
- package/src/components/Form/FormGroup.stories.tsx +162 -0
- package/src/components/Form/FormGroup.tsx +53 -0
- package/src/components/Form/Input.stories.tsx +106 -0
- package/src/components/Form/Input.tsx +87 -0
- package/src/components/Form/Radio.stories.tsx +94 -0
- package/src/components/Form/Radio.tsx +65 -0
- package/src/components/Form/Select.stories.tsx +151 -0
- package/src/components/Form/Select.tsx +191 -0
- package/src/components/Form/Textarea.stories.tsx +123 -0
- package/src/components/Form/Textarea.tsx +78 -0
- package/src/components/Form/index.ts +7 -0
- package/src/components/Hero/Hero.stories.tsx +295 -0
- package/src/components/Hero/Hero.tsx +175 -0
- package/src/components/Hero/index.ts +6 -0
- package/src/components/Icon/Icon.tsx +87 -0
- package/src/components/Icon/index.ts +2 -0
- package/src/components/List/List.stories.tsx +122 -0
- package/src/components/List/List.tsx +35 -0
- package/src/components/List/ListGroup.tsx +35 -0
- package/src/components/List/index.ts +2 -0
- package/src/components/Messages/Messages.stories.tsx +160 -0
- package/src/components/Messages/Messages.tsx +172 -0
- package/src/components/Messages/index.ts +3 -0
- package/src/components/Modal/Modal.stories.tsx +284 -0
- package/src/components/Modal/Modal.tsx +198 -0
- package/src/components/Modal/README.md +169 -0
- package/src/components/Modal/index.ts +1 -0
- package/src/components/Navigation/Menu/MegaMenu.tsx +109 -0
- package/src/components/Navigation/Menu/Menu.stories.tsx +339 -0
- package/src/components/Navigation/Menu/Menu.tsx +111 -0
- package/src/components/Navigation/Nav/Nav.stories.tsx +456 -0
- package/src/components/Navigation/Nav/Nav.tsx +51 -0
- package/src/components/Navigation/Nav/NavDropdown.tsx +105 -0
- package/src/components/Navigation/Nav/NavItem.tsx +168 -0
- package/src/components/Navigation/Navbar/Navbar.stories.tsx +569 -0
- package/src/components/Navigation/Navbar/Navbar.tsx +150 -0
- package/src/components/Navigation/README.md +314 -0
- package/src/components/Navigation/SideMenu/SideMenu.README.md +494 -0
- package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +609 -0
- package/src/components/Navigation/SideMenu/SideMenu.tsx +101 -0
- package/src/components/Navigation/SideMenu/SideMenuItem.tsx +103 -0
- package/src/components/Navigation/SideMenu/SideMenuList.tsx +41 -0
- package/src/components/Navigation/index.ts +23 -0
- package/src/components/Pagination/Pagination.stories.tsx +188 -0
- package/src/components/Pagination/Pagination.tsx +162 -0
- package/src/components/Pagination/index.ts +1 -0
- package/src/components/PhotoViewer/PhotoViewer.stories.tsx +397 -0
- package/src/components/PhotoViewer/PhotoViewer.tsx +246 -0
- package/src/components/PhotoViewer/PhotoViewerHeader.tsx +184 -0
- package/src/components/PhotoViewer/PhotoViewerImage.tsx +173 -0
- package/src/components/PhotoViewer/PhotoViewerInfo.tsx +91 -0
- package/src/components/PhotoViewer/PhotoViewerNavigation.tsx +85 -0
- package/src/components/PhotoViewer/PhotoViewerThumbnails.tsx +63 -0
- package/src/components/PhotoViewer/README.md +358 -0
- package/src/components/PhotoViewer/examples/ImageGallery.tsx +187 -0
- package/src/components/PhotoViewer/examples/SimpleGallery.tsx +73 -0
- package/src/components/PhotoViewer/examples/index.ts +2 -0
- package/src/components/PhotoViewer/index.ts +14 -0
- package/src/components/Popover/Popover.stories.tsx +143 -0
- package/src/components/Popover/Popover.tsx +137 -0
- package/src/components/Popover/index.ts +5 -0
- package/src/components/Popover/readme.md +120 -0
- package/src/components/ProductReview/ProductReview.stories.tsx +88 -0
- package/src/components/ProductReview/ProductReview.tsx +169 -0
- package/src/components/ProductReview/index.ts +3 -0
- package/src/components/Progress/Progress.stories.tsx +75 -0
- package/src/components/Progress/Progress.tsx +45 -0
- package/src/components/Progress/index.ts +1 -0
- package/src/components/Rating/Rating.stories.tsx +109 -0
- package/src/components/Rating/Rating.tsx +286 -0
- package/src/components/Rating/index.ts +6 -0
- package/src/components/River/River.stories.tsx +230 -0
- package/src/components/River/River.tsx +134 -0
- package/src/components/River/index.ts +2 -0
- package/src/components/SectionIntro/SectionIntro.stories.tsx +143 -0
- package/src/components/SectionIntro/SectionIntro.tsx +182 -0
- package/src/components/SectionIntro/index.ts +3 -0
- package/src/components/Slider/Slider.stories.tsx +825 -0
- package/src/components/Slider/Slider.tsx +227 -0
- package/src/components/Slider/index.ts +24 -0
- package/src/components/Spinner/Spinner.stories.tsx +65 -0
- package/src/components/Spinner/Spinner.tsx +36 -0
- package/src/components/Spinner/index.ts +2 -0
- package/src/components/Steps/Steps.stories.tsx +158 -0
- package/src/components/Steps/Steps.tsx +115 -0
- package/src/components/Steps/index.ts +3 -0
- package/src/components/Tab/Tab.stories.tsx +129 -0
- package/src/components/Tab/Tab.tsx +111 -0
- package/src/components/Tab/index.ts +2 -0
- package/src/components/Testimonial/Testimonial.stories.tsx +180 -0
- package/src/components/Testimonial/Testimonial.tsx +138 -0
- package/src/components/Testimonial/index.ts +3 -0
- package/src/components/Todo/Todo.stories.tsx +103 -0
- package/src/components/Todo/Todo.tsx +158 -0
- package/src/components/Todo/index.ts +1 -0
- package/src/components/Toggle/Toggle.stories.tsx +49 -0
- package/src/components/Toggle/Toggle.tsx +84 -0
- package/src/components/Toggle/index.ts +2 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +115 -0
- package/src/components/Tooltip/Tooltip.tsx +150 -0
- package/src/components/Tooltip/index.ts +3 -0
- package/src/components/Upload/Upload.stories.tsx +220 -0
- package/src/components/Upload/Upload.tsx +354 -0
- package/src/components/Upload/index.ts +3 -0
- package/src/components/VideoPlayer/VideoPlayer.stories.tsx +484 -0
- package/src/components/VideoPlayer/VideoPlayer.tsx +574 -0
- package/src/components/VideoPlayer/index.ts +7 -0
- package/src/components/index.ts +124 -0
- package/src/layouts/Grid/Container.tsx +58 -0
- package/src/layouts/Grid/Grid.stories.tsx +928 -0
- package/src/layouts/Grid/Grid.tsx +68 -0
- package/src/layouts/Grid/GridCol.tsx +161 -0
- package/src/layouts/Grid/README.md +108 -0
- package/src/layouts/Grid/Row.tsx +70 -0
- package/src/layouts/Grid/index.ts +8 -0
- package/src/layouts/MasonryGrid/MasonryGrid.stories.tsx +387 -0
- package/src/layouts/MasonryGrid/MasonryGrid.tsx +408 -0
- package/src/layouts/MasonryGrid/MasonryGridItem.tsx +44 -0
- package/src/layouts/MasonryGrid/README.md +117 -0
- package/src/layouts/MasonryGrid/index.ts +4 -0
- package/src/layouts/index.ts +7 -0
- package/src/lib/README.md +89 -0
- package/src/lib/composables/index.ts +63 -0
- package/src/lib/composables/useAccordion.ts +129 -0
- package/src/lib/composables/useAmbientMode.ts +90 -0
- package/src/lib/composables/useBadge.ts +42 -0
- package/src/lib/composables/useBarChart.ts +365 -0
- package/src/lib/composables/useBlock.ts +56 -0
- package/src/lib/composables/useBreadcrumb.ts +81 -0
- package/src/lib/composables/useButton.ts +59 -0
- package/src/lib/composables/useCallout.ts +55 -0
- package/src/lib/composables/useCard.ts +155 -0
- package/src/lib/composables/useChart.ts +1082 -0
- package/src/lib/composables/useChartAnalytics.ts +505 -0
- package/src/lib/composables/useChartData.ts +38 -0
- package/src/lib/composables/useChartExport.ts +392 -0
- package/src/lib/composables/useChartInteraction.ts +34 -0
- package/src/lib/composables/useChartInteractions.ts +123 -0
- package/src/lib/composables/useChartPerformance.ts +323 -0
- package/src/lib/composables/useChartScale.ts +48 -0
- package/src/lib/composables/useChartToolbar.ts +532 -0
- package/src/lib/composables/useCheckbox.ts +70 -0
- package/src/lib/composables/useDataTable.ts +208 -0
- package/src/lib/composables/useDatePicker.ts +564 -0
- package/src/lib/composables/useDropdown.ts +272 -0
- package/src/lib/composables/useEdgePanel.ts +261 -0
- package/src/lib/composables/useFooter.ts +85 -0
- package/src/lib/composables/useForm.ts +62 -0
- package/src/lib/composables/useFormGroup.ts +51 -0
- package/src/lib/composables/useHero.ts +250 -0
- package/src/lib/composables/useInput.ts +58 -0
- package/src/lib/composables/useLineChart.ts +319 -0
- package/src/lib/composables/useMessages.ts +77 -0
- package/src/lib/composables/useModal.ts +110 -0
- package/src/lib/composables/useNavbar.ts +288 -0
- package/src/lib/composables/usePagination.ts +101 -0
- package/src/lib/composables/usePhotoViewer.ts +937 -0
- package/src/lib/composables/usePieChart.ts +362 -0
- package/src/lib/composables/usePopover.ts +354 -0
- package/src/lib/composables/useProgress.ts +74 -0
- package/src/lib/composables/useRadio.ts +47 -0
- package/src/lib/composables/useRating.ts +174 -0
- package/src/lib/composables/useRiver.ts +205 -0
- package/src/lib/composables/useSelect.ts +52 -0
- package/src/lib/composables/useSideMenu.ts +197 -0
- package/src/lib/composables/useSlider.ts +526 -0
- package/src/lib/composables/useSpinner.ts +42 -0
- package/src/lib/composables/useTextarea.ts +55 -0
- package/src/lib/composables/useTodo.ts +141 -0
- package/src/lib/composables/useVideoPlayer.ts +398 -0
- package/src/lib/constants/components.ts +1518 -0
- package/src/lib/constants/index.ts +4 -0
- package/src/lib/index.ts +11 -0
- package/src/lib/types/components.ts +5020 -0
- package/src/lib/types/index.ts +2 -0
- package/src/lib/utils/dom.ts +41 -0
- package/src/lib/utils/icons.ts +74 -0
- package/src/lib/utils/index.ts +55 -0
- package/src/lib/utils/useForkRef.test.tsx +64 -0
- package/src/lib/utils/useForkRef.ts +36 -0
- package/src/lib/utils.test.ts +14 -0
- package/src/styles/01-settings/_index.scss +3 -0
- package/src/styles/01-settings/_settings.accordion.scss +22 -19
- package/src/styles/01-settings/_settings.animations.scss +5 -5
- package/src/styles/01-settings/_settings.avatar-group.scss +7 -4
- package/src/styles/01-settings/_settings.avatar.scss +19 -20
- package/src/styles/01-settings/_settings.background.scss +9 -0
- package/src/styles/01-settings/_settings.badge.scss +15 -9
- package/src/styles/01-settings/_settings.block.scss +11 -0
- package/src/styles/01-settings/_settings.border-radius.scss +12 -9
- package/src/styles/01-settings/_settings.border.scss +4 -1
- package/src/styles/01-settings/_settings.box-shadow.scss +1 -1
- package/src/styles/01-settings/_settings.breadcrumb.scss +16 -9
- package/src/styles/01-settings/_settings.breakpoints.scss +0 -0
- package/src/styles/01-settings/_settings.btn-group.scss +4 -1
- package/src/styles/01-settings/_settings.button.scss +19 -21
- package/src/styles/01-settings/_settings.callout.scss +42 -24
- package/src/styles/01-settings/_settings.card.scss +13 -11
- package/src/styles/01-settings/_settings.chart.scss +199 -0
- package/src/styles/01-settings/_settings.checkbox-group.scss +5 -2
- package/src/styles/01-settings/_settings.checkbox.scss +10 -4
- package/src/styles/01-settings/_settings.color-mode.scss +0 -0
- package/src/styles/01-settings/_settings.colors.scss +20 -0
- package/src/styles/01-settings/_settings.config.scss +1 -1
- package/src/styles/01-settings/_settings.countdown.scss +6 -4
- package/src/styles/01-settings/_settings.data-table.scss +0 -0
- package/src/styles/01-settings/_settings.datepicker.scss +0 -0
- package/src/styles/01-settings/_settings.dropdown.scss +9 -7
- package/src/styles/01-settings/_settings.edge-panel.scss +3 -2
- package/src/styles/01-settings/_settings.fonts.scss +1 -1
- package/src/styles/01-settings/_settings.footer.scss +125 -0
- package/src/styles/01-settings/_settings.form-group.scss +3 -1
- package/src/styles/01-settings/_settings.form.scss +4 -2
- package/src/styles/01-settings/_settings.grid.scss +3 -3
- package/src/styles/01-settings/_settings.hero.scss +10 -8
- package/src/styles/01-settings/_settings.input.scss +9 -7
- package/src/styles/01-settings/_settings.link.scss +0 -0
- package/src/styles/01-settings/_settings.list-group.scss +4 -2
- package/src/styles/01-settings/_settings.list.scss +4 -2
- package/src/styles/01-settings/_settings.maps.scss +43 -8
- package/src/styles/01-settings/_settings.masonry-grid.scss +0 -0
- package/src/styles/01-settings/_settings.menu.scss +10 -8
- package/src/styles/01-settings/_settings.messages.scss +19 -17
- package/src/styles/01-settings/_settings.modal.scss +7 -5
- package/src/styles/01-settings/_settings.nav.scss +6 -4
- package/src/styles/01-settings/_settings.navbar.scss +8 -5
- package/src/styles/01-settings/_settings.pagination.scss +5 -3
- package/src/styles/01-settings/_settings.photoviewer.scss +89 -23
- package/src/styles/01-settings/_settings.popover.scss +6 -4
- package/src/styles/01-settings/_settings.position.scss +0 -0
- package/src/styles/01-settings/_settings.progress.scss +0 -0
- package/src/styles/01-settings/_settings.rating.scss +5 -3
- package/src/styles/01-settings/_settings.river.scss +8 -6
- package/src/styles/01-settings/_settings.sectionintro.scss +8 -6
- package/src/styles/01-settings/_settings.select.scss +7 -5
- package/src/styles/01-settings/_settings.side-menu.scss +15 -13
- package/src/styles/01-settings/_settings.skeleton.scss +0 -0
- package/src/styles/01-settings/_settings.slider.scss +59 -0
- package/src/styles/01-settings/_settings.spacing.scss +15 -3
- package/src/styles/01-settings/_settings.spinner.scss +0 -0
- package/src/styles/01-settings/_settings.steps.scss +8 -6
- package/src/styles/01-settings/_settings.tabs.scss +11 -9
- package/src/styles/01-settings/_settings.testimonials.scss +6 -4
- package/src/styles/01-settings/_settings.todo.scss +0 -0
- package/src/styles/01-settings/_settings.toggle.scss +4 -2
- package/src/styles/01-settings/_settings.tooltip.scss +5 -3
- package/src/styles/01-settings/_settings.typography.scss +2 -0
- package/src/styles/01-settings/_settings.upload.scss +22 -20
- package/src/styles/01-settings/_settings.video-player.scss +64 -0
- package/src/styles/01-settings/_settings.z-layers.scss +0 -0
- package/src/styles/02-tools/_index.scss +1 -0
- package/src/styles/02-tools/_tools.animations.scss +82 -0
- package/src/styles/02-tools/_tools.background.scss +85 -0
- package/src/styles/02-tools/_tools.border-radius.scss +0 -0
- package/src/styles/02-tools/_tools.breakpoints.scss +0 -0
- package/src/styles/02-tools/_tools.button.scss +5 -0
- package/src/styles/02-tools/_tools.clearfix.scss +0 -0
- package/src/styles/02-tools/_tools.color-functions.scss +0 -0
- package/src/styles/02-tools/_tools.color-mode.scss +1 -1
- package/src/styles/02-tools/_tools.component.scss +479 -0
- package/src/styles/02-tools/_tools.event.scss +0 -0
- package/src/styles/02-tools/_tools.grid.scss +0 -0
- package/src/styles/02-tools/_tools.hidden-visually.scss +0 -0
- package/src/styles/02-tools/_tools.hidden.scss +0 -0
- package/src/styles/02-tools/_tools.map-loop.scss +0 -0
- package/src/styles/02-tools/_tools.media-queries.scss +0 -0
- package/src/styles/02-tools/_tools.object-fit.scss +0 -0
- package/src/styles/02-tools/_tools.placeholder.scss +0 -0
- package/src/styles/02-tools/_tools.rem.scss +19 -2
- package/src/styles/02-tools/_tools.size.scss +0 -0
- package/src/styles/02-tools/_tools.spacing.scss +0 -0
- package/src/styles/02-tools/_tools.to-rgb.scss +0 -0
- package/src/styles/02-tools/_tools.transition.scss +0 -0
- package/src/styles/02-tools/_tools.utilities.scss +0 -0
- package/src/styles/02-tools/_tools.utility-api.scss +55 -28
- package/src/styles/03-generic/_generic.fonts.scss +0 -0
- package/src/styles/03-generic/_generic.reset.scss +0 -0
- package/src/styles/03-generic/_generic.root.scss +19 -3
- package/src/styles/03-generic/_generic.selection.scss +0 -0
- package/src/styles/03-generic/_index.scss +0 -0
- package/src/styles/04-elements/_elements.all.scss +0 -0
- package/src/styles/04-elements/_elements.body.scss +24 -0
- package/src/styles/04-elements/_elements.heading.scss +0 -0
- package/src/styles/04-elements/_elements.html.scss +0 -0
- package/src/styles/04-elements/_elements.links.scss +0 -0
- package/src/styles/04-elements/_index.scss +0 -0
- package/src/styles/05-objects/_index.scss +1 -0
- package/src/styles/05-objects/_objects.block.scss +122 -0
- package/src/styles/05-objects/_objects.container.scss +14 -10
- package/src/styles/05-objects/_objects.grid.scss +0 -0
- package/src/styles/05-objects/_objects.masonry-grid.scss +0 -0
- package/src/styles/06-components/_components.accordion.scss +10 -4
- package/src/styles/06-components/_components.avatar-group.scss +2 -1
- package/src/styles/06-components/_components.avatar.scss +2 -1
- package/src/styles/06-components/_components.badge.scss +11 -10
- package/src/styles/06-components/_components.breadcrumb.scss +2 -1
- package/src/styles/06-components/_components.btn-group.scss +0 -0
- package/src/styles/06-components/_components.button.scss +4 -3
- package/src/styles/06-components/_components.callout.scss +5 -3
- package/src/styles/06-components/_components.card.scss +4 -3
- package/src/styles/06-components/_components.chart.scss +2103 -0
- package/src/styles/06-components/_components.checkbox-group.scss +0 -0
- package/src/styles/06-components/_components.checkbox.scss +2 -1
- package/src/styles/06-components/_components.color-mode-toggle.scss +3 -2
- package/src/styles/06-components/_components.countdown.scss +2 -1
- package/src/styles/06-components/_components.data-table.scss +7 -6
- package/src/styles/06-components/_components.datepicker.scss +2 -1
- package/src/styles/06-components/_components.dropdown.scss +4 -3
- package/src/styles/06-components/_components.edge-panel.scss +4 -3
- package/src/styles/06-components/_components.footer.scss +825 -0
- package/src/styles/06-components/_components.form-group.scss +1 -0
- package/src/styles/06-components/_components.form.scss +0 -0
- package/src/styles/06-components/_components.hero.scss +4 -2
- package/src/styles/06-components/_components.icon.scss +2 -2
- package/src/styles/06-components/_components.image-gallery.scss +1 -0
- package/src/styles/06-components/_components.input.scss +2 -1
- package/src/styles/06-components/_components.list-group.scss +3 -2
- package/src/styles/06-components/_components.list.scss +2 -1
- package/src/styles/06-components/_components.menu.scss +5 -4
- package/src/styles/06-components/_components.messages.scss +8 -7
- package/src/styles/06-components/_components.modal.scss +6 -2
- package/src/styles/06-components/_components.nav.scss +6 -5
- package/src/styles/06-components/_components.navbar.scss +4 -3
- package/src/styles/06-components/_components.pagination.scss +2 -1
- package/src/styles/06-components/_components.photoviewer.scss +604 -545
- package/src/styles/06-components/_components.popover.scss +3 -2
- package/src/styles/06-components/_components.product-review.scss +3 -2
- package/src/styles/06-components/_components.progress.scss +3 -2
- package/src/styles/06-components/_components.rating.scss +0 -0
- package/src/styles/06-components/_components.river.scss +3 -2
- package/src/styles/06-components/_components.sectionintro.scss +2 -1
- package/src/styles/06-components/_components.select.scss +5 -4
- package/src/styles/06-components/_components.side-menu.scss +8 -7
- package/src/styles/06-components/_components.skeleton.scss +3 -2
- package/src/styles/06-components/_components.slider.scss +274 -0
- package/src/styles/06-components/_components.spinner.scss +1 -0
- package/src/styles/06-components/_components.steps.scss +4 -2
- package/src/styles/06-components/_components.tabs.scss +4 -3
- package/src/styles/06-components/_components.testimonials.scss +2 -1
- package/src/styles/06-components/_components.todo.scss +3 -2
- package/src/styles/06-components/_components.toggle.scss +5 -4
- package/src/styles/06-components/_components.tooltip.scss +7 -11
- package/src/styles/06-components/_components.upload.scss +4 -3
- package/src/styles/06-components/_components.video-player.scss +624 -0
- package/src/styles/06-components/_index.scss +4 -0
- package/src/styles/06-components/old.chart.styles.scss +2819 -0
- package/src/styles/99-utilities/_index.scss +0 -0
- package/src/styles/99-utilities/_utilities.background.scss +0 -0
- package/src/styles/99-utilities/_utilities.border.scss +0 -0
- package/src/styles/99-utilities/_utilities.clearfix.scss +0 -0
- package/src/styles/99-utilities/_utilities.display.scss +0 -0
- package/src/styles/99-utilities/_utilities.flex.scss +0 -0
- package/src/styles/99-utilities/_utilities.link.scss +0 -0
- package/src/styles/99-utilities/_utilities.object-fit.scss +0 -0
- package/src/styles/99-utilities/_utilities.opacity.scss +0 -0
- package/src/styles/99-utilities/_utilities.overflow.scss +0 -0
- package/src/styles/99-utilities/_utilities.position.scss +0 -0
- package/src/styles/99-utilities/_utilities.scss +2 -1
- package/src/styles/99-utilities/_utilities.shadow.scss +0 -0
- package/src/styles/99-utilities/_utilities.sizes.scss +0 -0
- package/src/styles/99-utilities/_utilities.spacing.scss +0 -0
- package/src/styles/99-utilities/_utilities.text.scss +5 -0
- package/src/styles/99-utilities/_utilities.visibility.scss +0 -0
- package/src/styles/99-utilities/_utilities.visually-hidden.scss +0 -0
- package/src/styles/99-utilities/_utilities.z-index.scss +0 -0
- package/src/styles/css-modules.d.ts +0 -0
- package/src/styles/index.scss +0 -0
- package/dist/index.css +0 -15
- package/dist/index.esm.css +0 -15
- package/dist/index.min.css +0 -15
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import React, { useState, useEffect, useRef, forwardRef } from 'react';
|
|
2
|
+
import { NavbarProps } from '../../../lib/types/components';
|
|
3
|
+
import { useNavbar } from '../../../lib/composables/useNavbar';
|
|
4
|
+
import { NAVBAR } from '../../../lib/constants/components';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Navbar component provides a responsive navigation header with brand, navigation items,
|
|
8
|
+
* and collapsible mobile menu functionality.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <Navbar brand="My App" position="fixed" collapsible>
|
|
13
|
+
* <Nav>
|
|
14
|
+
* <NavItem href="/">Home</NavItem>
|
|
15
|
+
* <NavItem href="/about">About</NavItem>
|
|
16
|
+
* </Nav>
|
|
17
|
+
* </Navbar>
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export const Navbar = forwardRef<HTMLElement, NavbarProps>(
|
|
21
|
+
(
|
|
22
|
+
{
|
|
23
|
+
brand,
|
|
24
|
+
children,
|
|
25
|
+
variant,
|
|
26
|
+
position = 'static',
|
|
27
|
+
containerWidth,
|
|
28
|
+
collapsible = true,
|
|
29
|
+
expanded,
|
|
30
|
+
onToggle,
|
|
31
|
+
className = '',
|
|
32
|
+
disabled = false,
|
|
33
|
+
backdrop = false,
|
|
34
|
+
closeOnOutsideClick = true,
|
|
35
|
+
closeOnEscape = true,
|
|
36
|
+
ariaLabel = 'Main navigation',
|
|
37
|
+
id,
|
|
38
|
+
},
|
|
39
|
+
ref
|
|
40
|
+
) => {
|
|
41
|
+
const { generateNavbarClass, generateContainerStyle, generateCollapseClass } = useNavbar({
|
|
42
|
+
position,
|
|
43
|
+
collapsible,
|
|
44
|
+
expanded,
|
|
45
|
+
onToggle,
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// Use controlled or uncontrolled expanded state
|
|
49
|
+
const [navbarExpanded, setNavbarExpanded] = useState(expanded || false);
|
|
50
|
+
|
|
51
|
+
// Ref for the collapse element to handle responsive behavior
|
|
52
|
+
const collapseRef = useRef<HTMLDivElement>(null);
|
|
53
|
+
|
|
54
|
+
// Update local state when external state changes
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
if (typeof expanded !== 'undefined') {
|
|
57
|
+
setNavbarExpanded(expanded);
|
|
58
|
+
}
|
|
59
|
+
}, [expanded]);
|
|
60
|
+
|
|
61
|
+
// Handle resize to reset mobile menu state when switching to desktop
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
const handleResize = () => {
|
|
64
|
+
const isMobile = window.innerWidth < 768; // MD breakpoint
|
|
65
|
+
if (!isMobile && collapsible) {
|
|
66
|
+
// Reset expanded state on desktop
|
|
67
|
+
if (typeof onToggle === 'function') {
|
|
68
|
+
// Only update if different to avoid unnecessary renders
|
|
69
|
+
if (expanded) onToggle(false);
|
|
70
|
+
} else {
|
|
71
|
+
setNavbarExpanded(false);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
window.addEventListener('resize', handleResize);
|
|
77
|
+
return () => {
|
|
78
|
+
window.removeEventListener('resize', handleResize);
|
|
79
|
+
};
|
|
80
|
+
}, [collapsible, expanded, onToggle]);
|
|
81
|
+
|
|
82
|
+
// Generate the navbar class
|
|
83
|
+
const navbarClass = generateNavbarClass({
|
|
84
|
+
position,
|
|
85
|
+
variant,
|
|
86
|
+
collapsible,
|
|
87
|
+
className,
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// Generate the container style
|
|
91
|
+
const containerStyle = generateContainerStyle(containerWidth);
|
|
92
|
+
|
|
93
|
+
// Generate collapse class
|
|
94
|
+
const collapseClass = generateCollapseClass(navbarExpanded);
|
|
95
|
+
|
|
96
|
+
// Handle toggler click
|
|
97
|
+
const handleToggleClick = () => {
|
|
98
|
+
if (disabled) return;
|
|
99
|
+
|
|
100
|
+
const newState = !navbarExpanded;
|
|
101
|
+
|
|
102
|
+
if (typeof onToggle === 'function') {
|
|
103
|
+
// Controlled component
|
|
104
|
+
onToggle(newState);
|
|
105
|
+
} else {
|
|
106
|
+
// Uncontrolled component
|
|
107
|
+
setNavbarExpanded(newState);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
return (
|
|
112
|
+
<nav ref={ref} className={navbarClass} aria-label={ariaLabel} id={id}>
|
|
113
|
+
<div className="c-navbar__container" style={containerStyle}>
|
|
114
|
+
{brand &&
|
|
115
|
+
(typeof brand === 'string' ? (
|
|
116
|
+
<a href="/" className="c-navbar__brand">
|
|
117
|
+
{brand}
|
|
118
|
+
</a>
|
|
119
|
+
) : (
|
|
120
|
+
<div className="c-navbar__brand">{brand}</div>
|
|
121
|
+
))}
|
|
122
|
+
|
|
123
|
+
{collapsible && (
|
|
124
|
+
<button
|
|
125
|
+
className="c-navbar__toggler"
|
|
126
|
+
onClick={handleToggleClick}
|
|
127
|
+
aria-expanded={navbarExpanded}
|
|
128
|
+
aria-label="Toggle navigation"
|
|
129
|
+
aria-controls="navbar-collapse"
|
|
130
|
+
disabled={disabled}
|
|
131
|
+
type="button"
|
|
132
|
+
>
|
|
133
|
+
<span className="c-navbar__toggler-icon"></span>
|
|
134
|
+
</button>
|
|
135
|
+
)}
|
|
136
|
+
|
|
137
|
+
<div id="navbar-collapse" className={collapseClass} ref={collapseRef}>
|
|
138
|
+
{children}
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
</nav>
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
export type { NavbarProps };
|
|
147
|
+
|
|
148
|
+
Navbar.displayName = 'Navbar';
|
|
149
|
+
|
|
150
|
+
export default Navbar;
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
# Navbar Component
|
|
2
|
+
|
|
3
|
+
The Navbar component provides a responsive navigation header with brand, navigation items, and collapsible mobile menu functionality. It follows the Atomix design system guidelines and includes both React and vanilla JavaScript implementations.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Responsive Design**: Automatically collapses on mobile devices
|
|
8
|
+
- **Multiple Positions**: Static, fixed top, or fixed bottom positioning
|
|
9
|
+
- **Theme Variants**: Support for all theme colors
|
|
10
|
+
- **Accessibility**: Full keyboard navigation and screen reader support
|
|
11
|
+
- **Dropdown & Mega Menus**: Support for both regular dropdowns and full-width mega menus
|
|
12
|
+
- **Vanilla JS Support**: Complete vanilla JavaScript implementation available
|
|
13
|
+
|
|
14
|
+
## React Usage
|
|
15
|
+
|
|
16
|
+
### Basic Navbar
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
import { Navbar, Nav, NavItem } from '@atomix/components';
|
|
20
|
+
|
|
21
|
+
<Navbar brand="My App">
|
|
22
|
+
<Nav>
|
|
23
|
+
<NavItem href="/">Home</NavItem>
|
|
24
|
+
<NavItem href="/about">About</NavItem>
|
|
25
|
+
<NavItem href="/contact">Contact</NavItem>
|
|
26
|
+
</Nav>
|
|
27
|
+
</Navbar>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### With Dropdown Menu
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
import { Navbar, Nav, NavItem, NavDropdown, Menu, MenuItem } from '@atomix/components';
|
|
34
|
+
|
|
35
|
+
<Navbar brand="My App">
|
|
36
|
+
<Nav>
|
|
37
|
+
<NavItem href="/">Home</NavItem>
|
|
38
|
+
<NavDropdown title="Services">
|
|
39
|
+
<Menu>
|
|
40
|
+
<MenuItem href="/web">Web Design</MenuItem>
|
|
41
|
+
<MenuItem href="/mobile">Mobile Apps</MenuItem>
|
|
42
|
+
<MenuItem href="/seo">SEO Services</MenuItem>
|
|
43
|
+
</Menu>
|
|
44
|
+
</NavDropdown>
|
|
45
|
+
<NavItem href="/contact">Contact</NavItem>
|
|
46
|
+
</Nav>
|
|
47
|
+
</Navbar>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### With Mega Menu
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
import {
|
|
54
|
+
Navbar, Nav, NavItem, NavDropdown,
|
|
55
|
+
MegaMenu, MegaMenuColumn, MegaMenuLink
|
|
56
|
+
} from '@atomix/components';
|
|
57
|
+
|
|
58
|
+
<Navbar brand="My App">
|
|
59
|
+
<Nav>
|
|
60
|
+
<NavItem href="/">Home</NavItem>
|
|
61
|
+
<NavDropdown title="Products" megaMenu>
|
|
62
|
+
<MegaMenu>
|
|
63
|
+
<MegaMenuColumn title="Web Solutions" icon="icon-web">
|
|
64
|
+
<MegaMenuLink href="/websites">Websites</MegaMenuLink>
|
|
65
|
+
<MegaMenuLink href="/web-apps">Web Applications</MegaMenuLink>
|
|
66
|
+
<MegaMenuLink href="/ecommerce">E-commerce</MegaMenuLink>
|
|
67
|
+
</MegaMenuColumn>
|
|
68
|
+
<MegaMenuColumn title="Mobile Solutions" icon="icon-mobile">
|
|
69
|
+
<MegaMenuLink href="/ios">iOS Apps</MegaMenuLink>
|
|
70
|
+
<MegaMenuLink href="/android">Android Apps</MegaMenuLink>
|
|
71
|
+
<MegaMenuLink href="/hybrid">Hybrid Apps</MegaMenuLink>
|
|
72
|
+
</MegaMenuColumn>
|
|
73
|
+
</MegaMenu>
|
|
74
|
+
</NavDropdown>
|
|
75
|
+
</Nav>
|
|
76
|
+
</Navbar>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Controlled Navbar
|
|
80
|
+
|
|
81
|
+
```tsx
|
|
82
|
+
import { useState } from 'react';
|
|
83
|
+
import { Navbar, Nav, NavItem } from '@atomix/components';
|
|
84
|
+
|
|
85
|
+
function MyNavbar() {
|
|
86
|
+
const [expanded, setExpanded] = useState(false);
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<Navbar
|
|
90
|
+
brand="My App"
|
|
91
|
+
expanded={expanded}
|
|
92
|
+
onToggle={setExpanded}
|
|
93
|
+
>
|
|
94
|
+
<Nav>
|
|
95
|
+
<NavItem href="/">Home</NavItem>
|
|
96
|
+
<NavItem href="/about">About</NavItem>
|
|
97
|
+
</Nav>
|
|
98
|
+
</Navbar>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Vanilla JavaScript Usage
|
|
104
|
+
|
|
105
|
+
### HTML Structure
|
|
106
|
+
|
|
107
|
+
```html
|
|
108
|
+
<nav class="c-navbar" data-navbar data-collapsible="true" data-auto-close="true">
|
|
109
|
+
<div class="c-navbar__container">
|
|
110
|
+
<!-- Brand -->
|
|
111
|
+
<a href="/" class="c-navbar__brand">My App</a>
|
|
112
|
+
|
|
113
|
+
<!-- Mobile Toggle Button -->
|
|
114
|
+
<button class="c-navbar__toggler" aria-expanded="false" aria-controls="navbar-collapse">
|
|
115
|
+
<span class="c-navbar__toggler-icon"></span>
|
|
116
|
+
</button>
|
|
117
|
+
|
|
118
|
+
<!-- Collapsible Content -->
|
|
119
|
+
<div id="navbar-collapse" class="c-navbar__collapse">
|
|
120
|
+
<ul class="c-nav">
|
|
121
|
+
<li class="c-nav__item">
|
|
122
|
+
<a href="/" class="c-nav__link">Home</a>
|
|
123
|
+
</li>
|
|
124
|
+
<li class="c-nav__item c-nav__item--dropdown">
|
|
125
|
+
<a href="#" class="c-nav__link c-nav__dropdown-toggle">
|
|
126
|
+
Services
|
|
127
|
+
<i class="c-nav__icon icon-caret-down"></i>
|
|
128
|
+
</a>
|
|
129
|
+
<div class="c-nav__dropdown-menu">
|
|
130
|
+
<div class="c-menu">
|
|
131
|
+
<a href="/web" class="c-menu__item">Web Design</a>
|
|
132
|
+
<a href="/mobile" class="c-menu__item">Mobile Apps</a>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
</li>
|
|
136
|
+
<li class="c-nav__item">
|
|
137
|
+
<a href="/contact" class="c-nav__link">Contact</a>
|
|
138
|
+
</li>
|
|
139
|
+
</ul>
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
</nav>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### JavaScript Initialization
|
|
146
|
+
|
|
147
|
+
#### Automatic Initialization (Recommended)
|
|
148
|
+
|
|
149
|
+
The navbar will automatically initialize when the DOM is ready if you include the bundle:
|
|
150
|
+
|
|
151
|
+
```html
|
|
152
|
+
<script src="path/to/atomix-navbar.js"></script>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
#### Manual Initialization
|
|
156
|
+
|
|
157
|
+
```javascript
|
|
158
|
+
// Initialize all navbars with data attributes
|
|
159
|
+
const navbars = Atomix.Navbar.init();
|
|
160
|
+
|
|
161
|
+
// Initialize a specific navbar
|
|
162
|
+
const navbar = new Atomix.Navbar.Navbar('.my-navbar', {
|
|
163
|
+
collapsible: true,
|
|
164
|
+
autoClose: true,
|
|
165
|
+
keyboard: true
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
// Or using the create helper
|
|
169
|
+
const navbar = Atomix.Navbar.create('.my-navbar', {
|
|
170
|
+
collapsible: true,
|
|
171
|
+
autoClose: true
|
|
172
|
+
});
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
#### Programmatic Control
|
|
176
|
+
|
|
177
|
+
```javascript
|
|
178
|
+
// Get navbar instance
|
|
179
|
+
const navbar = Atomix.Navbar.get('.my-navbar');
|
|
180
|
+
|
|
181
|
+
// Control the navbar
|
|
182
|
+
navbar.expand();
|
|
183
|
+
navbar.collapse();
|
|
184
|
+
navbar.toggle();
|
|
185
|
+
|
|
186
|
+
// Check state
|
|
187
|
+
console.log(navbar.isOpen()); // true/false
|
|
188
|
+
|
|
189
|
+
// Update options
|
|
190
|
+
navbar.updateOptions({ autoClose: false });
|
|
191
|
+
|
|
192
|
+
// Clean up
|
|
193
|
+
navbar.destroy();
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
#### Event Handling
|
|
197
|
+
|
|
198
|
+
```javascript
|
|
199
|
+
// Listen for navbar events
|
|
200
|
+
document.querySelector('.c-navbar').addEventListener('navbar:expanded', (event) => {
|
|
201
|
+
console.log('Navbar expanded', event.detail);
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
document.querySelector('.c-navbar').addEventListener('navbar:collapsed', (event) => {
|
|
205
|
+
console.log('Navbar collapsed', event.detail);
|
|
206
|
+
});
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## Configuration Options
|
|
210
|
+
|
|
211
|
+
### React Props
|
|
212
|
+
|
|
213
|
+
| Prop | Type | Default | Description |
|
|
214
|
+
|------|------|---------|-------------|
|
|
215
|
+
| `brand` | `ReactNode` | - | Brand/logo component or text |
|
|
216
|
+
| `children` | `ReactNode` | - | Navigation items |
|
|
217
|
+
| `variant` | `ThemeColor` | - | Color variant |
|
|
218
|
+
| `position` | `'static' \| 'fixed' \| 'fixed-bottom'` | `'static'` | Navbar position |
|
|
219
|
+
| `containerWidth` | `string` | - | Custom container width |
|
|
220
|
+
| `collapsible` | `boolean` | `true` | Whether to collapse on mobile |
|
|
221
|
+
| `expanded` | `boolean` | - | Controlled expanded state |
|
|
222
|
+
| `onToggle` | `(expanded: boolean) => void` | - | Toggle callback |
|
|
223
|
+
| `backdrop` | `boolean` | `false` | Show backdrop on mobile |
|
|
224
|
+
| `closeOnOutsideClick` | `boolean` | `true` | Close on outside click |
|
|
225
|
+
| `closeOnEscape` | `boolean` | `true` | Close on escape key |
|
|
226
|
+
| `ariaLabel` | `string` | `'Main navigation'` | Accessible label |
|
|
227
|
+
| `className` | `string` | - | Additional CSS classes |
|
|
228
|
+
| `disabled` | `boolean` | `false` | Disable the navbar |
|
|
229
|
+
|
|
230
|
+
### Vanilla JS Options
|
|
231
|
+
|
|
232
|
+
| Option | Type | Default | Description |
|
|
233
|
+
|--------|------|---------|-------------|
|
|
234
|
+
| `collapsible` | `boolean` | `true` | Whether navbar is collapsible |
|
|
235
|
+
| `expanded` | `boolean` | `false` | Initial expanded state |
|
|
236
|
+
| `position` | `string` | `'static'` | Navbar position |
|
|
237
|
+
| `backdrop` | `boolean` | `false` | Show backdrop overlay |
|
|
238
|
+
| `keyboard` | `boolean` | `true` | Enable keyboard support |
|
|
239
|
+
| `autoClose` | `boolean` | `true` | Auto-close on outside click |
|
|
240
|
+
|
|
241
|
+
### Data Attributes
|
|
242
|
+
|
|
243
|
+
| Attribute | Type | Description |
|
|
244
|
+
|-----------|------|-------------|
|
|
245
|
+
| `data-navbar` | - | Marks element for auto-initialization |
|
|
246
|
+
| `data-collapsible` | `boolean` | Whether navbar is collapsible |
|
|
247
|
+
| `data-expanded` | `boolean` | Initial expanded state |
|
|
248
|
+
| `data-position` | `string` | Navbar position |
|
|
249
|
+
| `data-backdrop` | `boolean` | Show backdrop overlay |
|
|
250
|
+
| `data-auto-close` | `boolean` | Auto-close on outside click |
|
|
251
|
+
| `data-keyboard` | `boolean` | Enable keyboard support |
|
|
252
|
+
|
|
253
|
+
## CSS Classes
|
|
254
|
+
|
|
255
|
+
### Base Classes
|
|
256
|
+
|
|
257
|
+
- `.c-navbar` - Base navbar class
|
|
258
|
+
- `.c-navbar__container` - Container wrapper
|
|
259
|
+
- `.c-navbar__brand` - Brand/logo element
|
|
260
|
+
- `.c-navbar__toggler` - Mobile toggle button
|
|
261
|
+
- `.c-navbar__toggler-icon` - Toggle button icon
|
|
262
|
+
- `.c-navbar__collapse` - Collapsible content wrapper
|
|
263
|
+
- `.c-navbar__backdrop` - Mobile backdrop overlay
|
|
264
|
+
|
|
265
|
+
### Modifier Classes
|
|
266
|
+
|
|
267
|
+
- `.c-navbar--fixed` - Fixed to top
|
|
268
|
+
- `.c-navbar--fixed-bottom` - Fixed to bottom
|
|
269
|
+
- `.c-navbar--collapsible` - Collapsible navbar
|
|
270
|
+
- `.c-navbar--{variant}` - Theme variants (primary, secondary, etc.)
|
|
271
|
+
|
|
272
|
+
### State Classes
|
|
273
|
+
|
|
274
|
+
- `.is-expanded` - Expanded state
|
|
275
|
+
- `.is-open` - Open state (for backdrop)
|
|
276
|
+
|
|
277
|
+
## Accessibility
|
|
278
|
+
|
|
279
|
+
The Navbar component follows WCAG guidelines and includes:
|
|
280
|
+
|
|
281
|
+
- **Keyboard Navigation**: Full keyboard support with Tab, Enter, Escape, and Arrow keys
|
|
282
|
+
- **Screen Reader Support**: Proper ARIA attributes and labels
|
|
283
|
+
- **Focus Management**: Logical focus order and visible focus indicators
|
|
284
|
+
- **Semantic HTML**: Uses proper navigation landmarks and list structures
|
|
285
|
+
|
|
286
|
+
### ARIA Attributes
|
|
287
|
+
|
|
288
|
+
- `aria-label` - Navigation landmark label
|
|
289
|
+
- `aria-expanded` - Toggle button state
|
|
290
|
+
- `aria-controls` - Associates toggle with collapsible content
|
|
291
|
+
- `aria-current="page"` - Indicates current page link
|
|
292
|
+
- `aria-haspopup` - Indicates dropdown presence
|
|
293
|
+
|
|
294
|
+
## Browser Support
|
|
295
|
+
|
|
296
|
+
- Chrome 60+
|
|
297
|
+
- Firefox 60+
|
|
298
|
+
- Safari 12+
|
|
299
|
+
- Edge 79+
|
|
300
|
+
- iOS Safari 12+
|
|
301
|
+
- Android Chrome 60+
|
|
302
|
+
|
|
303
|
+
## Migration Guide
|
|
304
|
+
|
|
305
|
+
### From v1.x to v2.x
|
|
306
|
+
|
|
307
|
+
The navbar component has been completely rewritten to follow Atomix guidelines:
|
|
308
|
+
|
|
309
|
+
1. **New Vanilla JS API**: The JavaScript API has changed significantly
|
|
310
|
+
2. **Updated CSS Classes**: Some class names have been updated for consistency
|
|
311
|
+
3. **Enhanced Accessibility**: Improved ARIA support and keyboard navigation
|
|
312
|
+
4. **New Props**: Additional React props for better control
|
|
313
|
+
|
|
314
|
+
See the [migration guide](./MIGRATION.md) for detailed upgrade instructions.
|