@shohojdhara/atomix 0.1.30 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -0
- package/LICENSE +0 -0
- package/README.md +151 -39
- package/dist/atomix.css +13529 -0
- package/dist/atomix.min.css +15 -0
- package/dist/index.d.ts +6112 -1757
- package/dist/index.esm.js +16852 -8364
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +16892 -8369
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/themes/boomdevs.css +13241 -0
- package/dist/themes/boomdevs.min.css +353 -0
- package/dist/themes/esrar.css +15374 -0
- package/dist/themes/esrar.min.css +189 -0
- package/dist/themes/mashroom.css +28079 -0
- package/dist/themes/mashroom.min.css +403 -0
- package/dist/themes/shaj-default.css +14203 -0
- package/dist/themes/shaj-default.min.css +500 -0
- package/dist/themes/yabai.css +13711 -0
- package/dist/themes/yabai.min.css +189 -0
- package/package.json +126 -99
- package/src/components/Accordion/Accordion.stories.tsx +271 -0
- package/src/components/Accordion/Accordion.tsx +131 -0
- package/src/components/Accordion/index.ts +3 -0
- package/src/components/AtomixLogo/AtomixLogo.tsx +36 -0
- package/src/components/AtomixLogo/index.ts +3 -0
- package/src/components/AtomixLogo.tsx +40 -0
- package/src/components/Avatar/Avatar.stories.tsx +257 -0
- package/src/components/Avatar/Avatar.tsx +68 -0
- package/src/components/Avatar/AvatarGroup.tsx +73 -0
- package/src/components/Avatar/index.ts +3 -0
- package/src/components/Badge/Badge.stories.tsx +371 -0
- package/src/components/Badge/Badge.tsx +39 -0
- package/src/components/Badge/index.ts +3 -0
- package/src/components/Block/Block.stories.tsx +408 -0
- package/src/components/Block/Block.tsx +137 -0
- package/src/components/Block/index.ts +1 -0
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +106 -0
- package/src/components/Breadcrumb/Breadcrumb.tsx +112 -0
- package/src/components/Breadcrumb/index.ts +3 -0
- package/src/components/Button/Button.stories.tsx +312 -0
- package/src/components/Button/Button.tsx +69 -0
- package/src/components/Button/index.ts +3 -0
- package/src/components/Callout/Callout.stories.tsx +588 -0
- package/src/components/Callout/Callout.tsx +78 -0
- package/src/components/Callout/index.ts +1 -0
- package/src/components/Card/Card.stories.tsx +105 -0
- package/src/components/Card/Card.tsx +69 -0
- package/src/components/Card/ElevationCard.tsx +47 -0
- package/src/components/Card/index.ts +15 -0
- package/src/components/Chart/AdvancedChart.tsx +624 -0
- package/src/components/Chart/AnimatedChart.tsx +206 -0
- package/src/components/Chart/AreaChart.tsx +27 -0
- package/src/components/Chart/BarChart.tsx +148 -0
- package/src/components/Chart/BubbleChart.tsx +411 -0
- package/src/components/Chart/CandlestickChart.tsx +765 -0
- package/src/components/Chart/Chart.stories.tsx +527 -0
- package/src/components/Chart/Chart.tsx +218 -0
- package/src/components/Chart/ChartRenderer.tsx +322 -0
- package/src/components/Chart/ChartToolbar.tsx +436 -0
- package/src/components/Chart/ChartTooltip.tsx +101 -0
- package/src/components/Chart/DonutChart.tsx +370 -0
- package/src/components/Chart/FunnelChart.tsx +393 -0
- package/src/components/Chart/GaugeChart.tsx +550 -0
- package/src/components/Chart/HeatmapChart.tsx +614 -0
- package/src/components/Chart/LineChart.tsx +172 -0
- package/src/components/Chart/LineChartNew.tsx +167 -0
- package/src/components/Chart/MultiAxisChart.tsx +498 -0
- package/src/components/Chart/PieChart.tsx +103 -0
- package/src/components/Chart/RadarChart.tsx +332 -0
- package/src/components/Chart/RealTimeChart.tsx +436 -0
- package/src/components/Chart/ScatterChart.tsx +152 -0
- package/src/components/Chart/TreemapChart.tsx +574 -0
- package/src/components/Chart/WaterfallChart.tsx +450 -0
- package/src/components/Chart/index.ts +119 -0
- package/src/components/Chart/types.ts +338 -0
- package/src/components/ColorModeToggle/ColorModeToggle.stories.tsx +44 -0
- package/src/components/ColorModeToggle/ColorModeToggle.tsx +85 -0
- package/src/components/ColorModeToggle/index.ts +2 -0
- package/src/components/Countdown/Countdown.stories.tsx +46 -0
- package/src/components/Countdown/Countdown.tsx +90 -0
- package/src/components/Countdown/index.ts +2 -0
- package/src/components/DataTable/DataTable.stories.tsx +248 -0
- package/src/components/DataTable/DataTable.tsx +213 -0
- package/src/components/DataTable/index.ts +3 -0
- package/src/components/DatePicker/DatePicker.stories.tsx +364 -0
- package/src/components/DatePicker/DatePicker.tsx +504 -0
- package/src/components/DatePicker/index.ts +4 -0
- package/src/components/DatePicker/readme.md +106 -0
- package/src/components/DatePicker/types.ts +167 -0
- package/src/components/DatePicker/utils.ts +185 -0
- package/src/components/Dropdown/Dropdown.stories.tsx +358 -0
- package/src/components/Dropdown/Dropdown.tsx +352 -0
- package/src/components/Dropdown/index.ts +14 -0
- package/src/components/Dropdown/readme.md +151 -0
- package/src/components/EdgePanel/EdgePanel.stories.tsx +266 -0
- package/src/components/EdgePanel/EdgePanel.tsx +73 -0
- package/src/components/EdgePanel/index.ts +1 -0
- package/src/components/Form/Checkbox.stories.tsx +76 -0
- package/src/components/Form/Checkbox.tsx +69 -0
- package/src/components/Form/Form.stories.tsx +497 -0
- package/src/components/Form/Form.tsx +46 -0
- package/src/components/Form/FormGroup.stories.tsx +162 -0
- package/src/components/Form/FormGroup.tsx +53 -0
- package/src/components/Form/Input.stories.tsx +106 -0
- package/src/components/Form/Input.tsx +87 -0
- package/src/components/Form/Radio.stories.tsx +94 -0
- package/src/components/Form/Radio.tsx +65 -0
- package/src/components/Form/Select.stories.tsx +151 -0
- package/src/components/Form/Select.tsx +191 -0
- package/src/components/Form/Textarea.stories.tsx +123 -0
- package/src/components/Form/Textarea.tsx +78 -0
- package/src/components/Form/index.ts +7 -0
- package/src/components/Hero/Hero.stories.tsx +295 -0
- package/src/components/Hero/Hero.tsx +175 -0
- package/src/components/Hero/index.ts +6 -0
- package/src/components/Icon/Icon.tsx +87 -0
- package/src/components/Icon/index.ts +2 -0
- package/src/components/List/List.stories.tsx +122 -0
- package/src/components/List/List.tsx +35 -0
- package/src/components/List/ListGroup.tsx +35 -0
- package/src/components/List/index.ts +2 -0
- package/src/components/Messages/Messages.stories.tsx +160 -0
- package/src/components/Messages/Messages.tsx +172 -0
- package/src/components/Messages/index.ts +3 -0
- package/src/components/Modal/Modal.stories.tsx +284 -0
- package/src/components/Modal/Modal.tsx +198 -0
- package/src/components/Modal/README.md +169 -0
- package/src/components/Modal/index.ts +1 -0
- package/src/components/Navigation/Menu/MegaMenu.tsx +109 -0
- package/src/components/Navigation/Menu/Menu.stories.tsx +339 -0
- package/src/components/Navigation/Menu/Menu.tsx +111 -0
- package/src/components/Navigation/Nav/Nav.stories.tsx +456 -0
- package/src/components/Navigation/Nav/Nav.tsx +51 -0
- package/src/components/Navigation/Nav/NavDropdown.tsx +105 -0
- package/src/components/Navigation/Nav/NavItem.tsx +168 -0
- package/src/components/Navigation/Navbar/Navbar.stories.tsx +569 -0
- package/src/components/Navigation/Navbar/Navbar.tsx +150 -0
- package/src/components/Navigation/README.md +314 -0
- package/src/components/Navigation/SideMenu/SideMenu.README.md +494 -0
- package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +609 -0
- package/src/components/Navigation/SideMenu/SideMenu.tsx +101 -0
- package/src/components/Navigation/SideMenu/SideMenuItem.tsx +103 -0
- package/src/components/Navigation/SideMenu/SideMenuList.tsx +41 -0
- package/src/components/Navigation/index.ts +23 -0
- package/src/components/Pagination/Pagination.stories.tsx +188 -0
- package/src/components/Pagination/Pagination.tsx +162 -0
- package/src/components/Pagination/index.ts +1 -0
- package/src/components/PhotoViewer/PhotoViewer.stories.tsx +397 -0
- package/src/components/PhotoViewer/PhotoViewer.tsx +246 -0
- package/src/components/PhotoViewer/PhotoViewerHeader.tsx +184 -0
- package/src/components/PhotoViewer/PhotoViewerImage.tsx +173 -0
- package/src/components/PhotoViewer/PhotoViewerInfo.tsx +91 -0
- package/src/components/PhotoViewer/PhotoViewerNavigation.tsx +85 -0
- package/src/components/PhotoViewer/PhotoViewerThumbnails.tsx +63 -0
- package/src/components/PhotoViewer/README.md +358 -0
- package/src/components/PhotoViewer/examples/ImageGallery.tsx +187 -0
- package/src/components/PhotoViewer/examples/SimpleGallery.tsx +73 -0
- package/src/components/PhotoViewer/examples/index.ts +2 -0
- package/src/components/PhotoViewer/index.ts +14 -0
- package/src/components/Popover/Popover.stories.tsx +143 -0
- package/src/components/Popover/Popover.tsx +137 -0
- package/src/components/Popover/index.ts +5 -0
- package/src/components/Popover/readme.md +120 -0
- package/src/components/ProductReview/ProductReview.stories.tsx +88 -0
- package/src/components/ProductReview/ProductReview.tsx +169 -0
- package/src/components/ProductReview/index.ts +3 -0
- package/src/components/Progress/Progress.stories.tsx +75 -0
- package/src/components/Progress/Progress.tsx +45 -0
- package/src/components/Progress/index.ts +1 -0
- package/src/components/Rating/Rating.stories.tsx +109 -0
- package/src/components/Rating/Rating.tsx +286 -0
- package/src/components/Rating/index.ts +6 -0
- package/src/components/River/River.stories.tsx +230 -0
- package/src/components/River/River.tsx +134 -0
- package/src/components/River/index.ts +2 -0
- package/src/components/SectionIntro/SectionIntro.stories.tsx +143 -0
- package/src/components/SectionIntro/SectionIntro.tsx +184 -0
- package/src/components/SectionIntro/index.ts +3 -0
- package/src/components/Slider/Slider.stories.tsx +241 -0
- package/src/components/Slider/Slider.tsx +225 -0
- package/src/components/Slider/index.ts +24 -0
- package/src/components/Spinner/Spinner.stories.tsx +65 -0
- package/src/components/Spinner/Spinner.tsx +36 -0
- package/src/components/Spinner/index.ts +2 -0
- package/src/components/Steps/Steps.stories.tsx +158 -0
- package/src/components/Steps/Steps.tsx +115 -0
- package/src/components/Steps/index.ts +3 -0
- package/src/components/Tab/Tab.stories.tsx +129 -0
- package/src/components/Tab/Tab.tsx +111 -0
- package/src/components/Tab/index.ts +2 -0
- package/src/components/Testimonial/Testimonial.stories.tsx +180 -0
- package/src/components/Testimonial/Testimonial.tsx +138 -0
- package/src/components/Testimonial/index.ts +3 -0
- package/src/components/Todo/Todo.stories.tsx +103 -0
- package/src/components/Todo/Todo.tsx +158 -0
- package/src/components/Todo/index.ts +1 -0
- package/src/components/Toggle/Toggle.stories.tsx +49 -0
- package/src/components/Toggle/Toggle.tsx +84 -0
- package/src/components/Toggle/index.ts +2 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +115 -0
- package/src/components/Tooltip/Tooltip.tsx +150 -0
- package/src/components/Tooltip/index.ts +3 -0
- package/src/components/Upload/Upload.stories.tsx +220 -0
- package/src/components/Upload/Upload.tsx +354 -0
- package/src/components/Upload/index.ts +3 -0
- package/src/components/VideoPlayer/VideoPlayer.stories.tsx +484 -0
- package/src/components/VideoPlayer/VideoPlayer.tsx +574 -0
- package/src/components/VideoPlayer/index.ts +7 -0
- package/src/components/index.ts +111 -0
- package/src/layouts/Grid/Container.tsx +58 -0
- package/src/layouts/Grid/Grid.stories.tsx +861 -0
- package/src/layouts/Grid/Grid.tsx +68 -0
- package/src/layouts/Grid/GridCol.tsx +161 -0
- package/src/layouts/Grid/README.md +108 -0
- package/src/layouts/Grid/Row.tsx +70 -0
- package/src/layouts/Grid/index.ts +8 -0
- package/src/layouts/MasonryGrid/MasonryGrid.stories.tsx +387 -0
- package/src/layouts/MasonryGrid/MasonryGrid.tsx +408 -0
- package/src/layouts/MasonryGrid/MasonryGridItem.tsx +44 -0
- package/src/layouts/MasonryGrid/README.md +117 -0
- package/src/layouts/MasonryGrid/index.ts +4 -0
- package/src/layouts/index.ts +7 -0
- package/src/lib/README.md +89 -0
- package/src/lib/composables/index.ts +63 -0
- package/src/lib/composables/useAccordion.ts +129 -0
- package/src/lib/composables/useAmbientMode.ts +90 -0
- package/src/lib/composables/useBadge.ts +42 -0
- package/src/lib/composables/useBarChart.ts +365 -0
- package/src/lib/composables/useBlock.ts +56 -0
- package/src/lib/composables/useBreadcrumb.ts +81 -0
- package/src/lib/composables/useButton.ts +59 -0
- package/src/lib/composables/useCallout.ts +55 -0
- package/src/lib/composables/useCard.ts +155 -0
- package/src/lib/composables/useChart.ts +1082 -0
- package/src/lib/composables/useChartAnalytics.ts +505 -0
- package/src/lib/composables/useChartData.ts +38 -0
- package/src/lib/composables/useChartExport.ts +392 -0
- package/src/lib/composables/useChartInteraction.ts +34 -0
- package/src/lib/composables/useChartInteractions.ts +123 -0
- package/src/lib/composables/useChartPerformance.ts +323 -0
- package/src/lib/composables/useChartScale.ts +48 -0
- package/src/lib/composables/useChartToolbar.ts +532 -0
- package/src/lib/composables/useCheckbox.ts +70 -0
- package/src/lib/composables/useDataTable.ts +208 -0
- package/src/lib/composables/useDatePicker.ts +564 -0
- package/src/lib/composables/useDropdown.ts +272 -0
- package/src/lib/composables/useEdgePanel.ts +261 -0
- package/src/lib/composables/useForm.ts +62 -0
- package/src/lib/composables/useFormGroup.ts +51 -0
- package/src/lib/composables/useHero.ts +250 -0
- package/src/lib/composables/useInput.ts +58 -0
- package/src/lib/composables/useLineChart.ts +319 -0
- package/src/lib/composables/useMessages.ts +77 -0
- package/src/lib/composables/useModal.ts +110 -0
- package/src/lib/composables/useNavbar.ts +288 -0
- package/src/lib/composables/usePagination.ts +101 -0
- package/src/lib/composables/usePhotoViewer.ts +937 -0
- package/src/lib/composables/usePieChart.ts +362 -0
- package/src/lib/composables/usePopover.ts +354 -0
- package/src/lib/composables/useProgress.ts +74 -0
- package/src/lib/composables/useRadio.ts +47 -0
- package/src/lib/composables/useRating.ts +174 -0
- package/src/lib/composables/useRiver.ts +205 -0
- package/src/lib/composables/useSelect.ts +52 -0
- package/src/lib/composables/useSideMenu.ts +197 -0
- package/src/lib/composables/useSlider.ts +339 -0
- package/src/lib/composables/useSpinner.ts +42 -0
- package/src/lib/composables/useTextarea.ts +55 -0
- package/src/lib/composables/useTodo.ts +141 -0
- package/src/lib/composables/useVideoPlayer.ts +398 -0
- package/src/lib/constants/components.ts +1433 -0
- package/src/lib/constants/index.ts +4 -0
- package/src/lib/index.ts +11 -0
- package/src/lib/types/components.ts +4750 -0
- package/src/lib/types/index.ts +2 -0
- package/src/lib/utils/dom.ts +41 -0
- package/src/lib/utils/icons.ts +74 -0
- package/src/lib/utils/index.ts +55 -0
- package/src/lib/utils/useForkRef.test.tsx +64 -0
- package/src/lib/utils/useForkRef.ts +36 -0
- package/src/lib/utils.test.ts +14 -0
- package/src/styles/01-settings/_index.scss +2 -0
- package/src/styles/01-settings/_settings.accordion.scss +7 -5
- package/src/styles/01-settings/_settings.animations.scss +0 -0
- package/src/styles/01-settings/_settings.avatar-group.scss +6 -3
- package/src/styles/01-settings/_settings.avatar.scss +2 -2
- package/src/styles/01-settings/_settings.badge.scss +15 -9
- package/src/styles/01-settings/_settings.block.scss +11 -0
- package/src/styles/01-settings/_settings.border-radius.scss +12 -9
- package/src/styles/01-settings/_settings.border.scss +4 -1
- package/src/styles/01-settings/_settings.box-shadow.scss +1 -1
- package/src/styles/01-settings/_settings.breadcrumb.scss +9 -8
- package/src/styles/01-settings/_settings.breakpoints.scss +0 -0
- package/src/styles/01-settings/_settings.btn-group.scss +4 -1
- package/src/styles/01-settings/_settings.button.scss +19 -21
- package/src/styles/01-settings/_settings.callout.scss +42 -24
- package/src/styles/01-settings/_settings.card.scss +12 -10
- package/src/styles/01-settings/_settings.chart.scss +199 -0
- package/src/styles/01-settings/_settings.checkbox-group.scss +0 -0
- package/src/styles/01-settings/_settings.checkbox.scss +0 -0
- package/src/styles/01-settings/_settings.color-mode.scss +0 -0
- package/src/styles/01-settings/_settings.colors.scss +20 -0
- package/src/styles/01-settings/_settings.config.scss +1 -1
- package/src/styles/01-settings/_settings.countdown.scss +0 -0
- package/src/styles/01-settings/_settings.data-table.scss +0 -0
- package/src/styles/01-settings/_settings.datepicker.scss +0 -0
- package/src/styles/01-settings/_settings.dropdown.scss +0 -0
- package/src/styles/01-settings/_settings.edge-panel.scss +0 -0
- package/src/styles/01-settings/_settings.fonts.scss +1 -1
- package/src/styles/01-settings/_settings.form-group.scss +0 -0
- package/src/styles/01-settings/_settings.form.scss +0 -0
- package/src/styles/01-settings/_settings.grid.scss +3 -3
- package/src/styles/01-settings/_settings.hero.scss +1 -1
- package/src/styles/01-settings/_settings.input.scss +1 -1
- package/src/styles/01-settings/_settings.link.scss +0 -0
- package/src/styles/01-settings/_settings.list-group.scss +0 -0
- package/src/styles/01-settings/_settings.list.scss +0 -0
- package/src/styles/01-settings/_settings.maps.scss +43 -8
- package/src/styles/01-settings/_settings.masonry-grid.scss +0 -0
- package/src/styles/01-settings/_settings.menu.scss +0 -0
- package/src/styles/01-settings/_settings.messages.scss +0 -0
- package/src/styles/01-settings/_settings.modal.scss +1 -1
- package/src/styles/01-settings/_settings.nav.scss +0 -0
- package/src/styles/01-settings/_settings.navbar.scss +0 -0
- package/src/styles/01-settings/_settings.pagination.scss +0 -0
- package/src/styles/01-settings/_settings.photoviewer.scss +89 -23
- package/src/styles/01-settings/_settings.popover.scss +0 -0
- package/src/styles/01-settings/_settings.position.scss +0 -0
- package/src/styles/01-settings/_settings.progress.scss +0 -0
- package/src/styles/01-settings/_settings.rating.scss +0 -0
- package/src/styles/01-settings/_settings.river.scss +0 -0
- package/src/styles/01-settings/_settings.sectionintro.scss +0 -0
- package/src/styles/01-settings/_settings.select.scss +0 -0
- package/src/styles/01-settings/_settings.side-menu.scss +0 -0
- package/src/styles/01-settings/_settings.skeleton.scss +0 -0
- package/src/styles/01-settings/_settings.slider.scss +59 -0
- package/src/styles/01-settings/_settings.spacing.scss +11 -3
- package/src/styles/01-settings/_settings.spinner.scss +0 -0
- package/src/styles/01-settings/_settings.steps.scss +1 -1
- package/src/styles/01-settings/_settings.tabs.scss +4 -4
- package/src/styles/01-settings/_settings.testimonials.scss +0 -0
- package/src/styles/01-settings/_settings.todo.scss +0 -0
- package/src/styles/01-settings/_settings.toggle.scss +1 -1
- package/src/styles/01-settings/_settings.tooltip.scss +0 -0
- package/src/styles/01-settings/_settings.typography.scss +2 -0
- package/src/styles/01-settings/_settings.upload.scss +0 -0
- package/src/styles/01-settings/_settings.video-player.scss +64 -0
- package/src/styles/01-settings/_settings.z-layers.scss +0 -0
- package/src/styles/02-tools/_index.scss +1 -0
- package/src/styles/02-tools/_tools.animations.scss +82 -0
- package/src/styles/02-tools/_tools.border-radius.scss +0 -0
- package/src/styles/02-tools/_tools.breakpoints.scss +0 -0
- package/src/styles/02-tools/_tools.button.scss +5 -0
- package/src/styles/02-tools/_tools.clearfix.scss +0 -0
- package/src/styles/02-tools/_tools.color-functions.scss +0 -0
- package/src/styles/02-tools/_tools.color-mode.scss +1 -1
- package/src/styles/02-tools/_tools.component.scss +479 -0
- package/src/styles/02-tools/_tools.event.scss +0 -0
- package/src/styles/02-tools/_tools.grid.scss +0 -0
- package/src/styles/02-tools/_tools.hidden-visually.scss +0 -0
- package/src/styles/02-tools/_tools.hidden.scss +0 -0
- package/src/styles/02-tools/_tools.map-loop.scss +0 -0
- package/src/styles/02-tools/_tools.media-queries.scss +0 -0
- package/src/styles/02-tools/_tools.object-fit.scss +0 -0
- package/src/styles/02-tools/_tools.placeholder.scss +0 -0
- package/src/styles/02-tools/_tools.rem.scss +5 -1
- package/src/styles/02-tools/_tools.size.scss +0 -0
- package/src/styles/02-tools/_tools.spacing.scss +0 -0
- package/src/styles/02-tools/_tools.to-rgb.scss +0 -0
- package/src/styles/02-tools/_tools.transition.scss +0 -0
- package/src/styles/02-tools/_tools.utilities.scss +0 -0
- package/src/styles/02-tools/_tools.utility-api.scss +23 -2
- package/src/styles/03-generic/_generic.fonts.scss +0 -0
- package/src/styles/03-generic/_generic.reset.scss +0 -0
- package/src/styles/03-generic/_generic.root.scss +5 -1
- package/src/styles/03-generic/_generic.selection.scss +0 -0
- package/src/styles/03-generic/_index.scss +0 -0
- package/src/styles/04-elements/_elements.all.scss +0 -0
- package/src/styles/04-elements/_elements.body.scss +0 -0
- package/src/styles/04-elements/_elements.heading.scss +0 -0
- package/src/styles/04-elements/_elements.html.scss +0 -0
- package/src/styles/04-elements/_elements.links.scss +0 -0
- package/src/styles/04-elements/_index.scss +0 -0
- package/src/styles/05-objects/_index.scss +1 -0
- package/src/styles/05-objects/_objects.block.scss +122 -0
- package/src/styles/05-objects/_objects.container.scss +14 -10
- package/src/styles/05-objects/_objects.grid.scss +0 -0
- package/src/styles/05-objects/_objects.masonry-grid.scss +0 -0
- package/src/styles/06-components/_components.accordion.scss +3 -1
- package/src/styles/06-components/_components.avatar-group.scss +0 -0
- package/src/styles/06-components/_components.avatar.scss +0 -0
- package/src/styles/06-components/_components.badge.scss +9 -9
- package/src/styles/06-components/_components.breadcrumb.scss +0 -0
- package/src/styles/06-components/_components.btn-group.scss +0 -0
- package/src/styles/06-components/_components.button.scss +0 -0
- package/src/styles/06-components/_components.callout.scss +2 -1
- package/src/styles/06-components/_components.card.scss +0 -1
- package/src/styles/06-components/_components.chart.scss +2102 -0
- package/src/styles/06-components/_components.checkbox-group.scss +0 -0
- package/src/styles/06-components/_components.checkbox.scss +0 -0
- package/src/styles/06-components/_components.color-mode-toggle.scss +0 -0
- package/src/styles/06-components/_components.countdown.scss +0 -0
- package/src/styles/06-components/_components.data-table.scss +0 -0
- package/src/styles/06-components/_components.datepicker.scss +0 -0
- package/src/styles/06-components/_components.dropdown.scss +0 -0
- package/src/styles/06-components/_components.edge-panel.scss +0 -0
- package/src/styles/06-components/_components.form-group.scss +0 -0
- package/src/styles/06-components/_components.form.scss +0 -0
- package/src/styles/06-components/_components.hero.scss +1 -0
- package/src/styles/06-components/_components.icon.scss +2 -2
- package/src/styles/06-components/_components.image-gallery.scss +0 -0
- package/src/styles/06-components/_components.input.scss +0 -0
- package/src/styles/06-components/_components.list-group.scss +0 -0
- package/src/styles/06-components/_components.list.scss +0 -0
- package/src/styles/06-components/_components.menu.scss +0 -0
- package/src/styles/06-components/_components.messages.scss +0 -0
- package/src/styles/06-components/_components.modal.scss +3 -0
- package/src/styles/06-components/_components.nav.scss +0 -0
- package/src/styles/06-components/_components.navbar.scss +0 -0
- package/src/styles/06-components/_components.pagination.scss +0 -0
- package/src/styles/06-components/_components.photoviewer.scss +603 -545
- package/src/styles/06-components/_components.popover.scss +0 -0
- package/src/styles/06-components/_components.product-review.scss +0 -0
- package/src/styles/06-components/_components.progress.scss +0 -0
- package/src/styles/06-components/_components.rating.scss +0 -0
- package/src/styles/06-components/_components.river.scss +0 -0
- package/src/styles/06-components/_components.sectionintro.scss +0 -0
- package/src/styles/06-components/_components.select.scss +0 -0
- package/src/styles/06-components/_components.side-menu.scss +0 -0
- package/src/styles/06-components/_components.skeleton.scss +0 -0
- package/src/styles/06-components/_components.slider.scss +273 -0
- package/src/styles/06-components/_components.spinner.scss +0 -0
- package/src/styles/06-components/_components.steps.scss +1 -0
- package/src/styles/06-components/_components.tabs.scss +0 -0
- package/src/styles/06-components/_components.testimonials.scss +0 -0
- package/src/styles/06-components/_components.todo.scss +0 -0
- package/src/styles/06-components/_components.toggle.scss +0 -0
- package/src/styles/06-components/_components.tooltip.scss +4 -9
- package/src/styles/06-components/_components.upload.scss +0 -0
- package/src/styles/06-components/_components.video-player.scss +623 -0
- package/src/styles/06-components/_index.scss +3 -0
- package/src/styles/06-components/old.chart.styles.scss +2819 -0
- package/src/styles/99-utilities/_index.scss +0 -0
- package/src/styles/99-utilities/_utilities.background.scss +0 -0
- package/src/styles/99-utilities/_utilities.border.scss +0 -0
- package/src/styles/99-utilities/_utilities.clearfix.scss +0 -0
- package/src/styles/99-utilities/_utilities.display.scss +0 -0
- package/src/styles/99-utilities/_utilities.flex.scss +0 -0
- package/src/styles/99-utilities/_utilities.link.scss +0 -0
- package/src/styles/99-utilities/_utilities.object-fit.scss +0 -0
- package/src/styles/99-utilities/_utilities.opacity.scss +0 -0
- package/src/styles/99-utilities/_utilities.overflow.scss +0 -0
- package/src/styles/99-utilities/_utilities.position.scss +0 -0
- package/src/styles/99-utilities/_utilities.scss +2 -1
- package/src/styles/99-utilities/_utilities.shadow.scss +0 -0
- package/src/styles/99-utilities/_utilities.sizes.scss +0 -0
- package/src/styles/99-utilities/_utilities.spacing.scss +0 -0
- package/src/styles/99-utilities/_utilities.text.scss +5 -0
- package/src/styles/99-utilities/_utilities.visibility.scss +0 -0
- package/src/styles/99-utilities/_utilities.visually-hidden.scss +0 -0
- package/src/styles/99-utilities/_utilities.z-index.scss +0 -0
- package/src/styles/css-modules.d.ts +0 -0
- package/src/styles/index.scss +0 -0
- package/dist/index.css +0 -15
- package/dist/index.esm.css +0 -15
- package/dist/index.min.css +0 -15
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { forwardRef, memo, useCallback, useEffect, useState } from 'react';
|
|
2
|
+
import { useChart } from '../../lib/composables/useChart';
|
|
3
|
+
import { useChartToolbar } from '../../lib/composables/useChartToolbar';
|
|
4
|
+
import { CHART } from '../../lib/constants/components';
|
|
5
|
+
import { ChartProps } from '../../lib/types/components';
|
|
6
|
+
import ChartToolbar from './ChartToolbar';
|
|
7
|
+
|
|
8
|
+
const Chart = memo(
|
|
9
|
+
forwardRef<HTMLDivElement, ChartProps>(
|
|
10
|
+
(
|
|
11
|
+
{
|
|
12
|
+
children,
|
|
13
|
+
type = 'line',
|
|
14
|
+
size = 'md',
|
|
15
|
+
variant = 'primary',
|
|
16
|
+
title,
|
|
17
|
+
subtitle,
|
|
18
|
+
loading = false,
|
|
19
|
+
error,
|
|
20
|
+
className = '',
|
|
21
|
+
'aria-label': ariaLabel,
|
|
22
|
+
onFullscreen,
|
|
23
|
+
onExport,
|
|
24
|
+
onRefresh,
|
|
25
|
+
showToolbar = false,
|
|
26
|
+
enableFullscreen = false,
|
|
27
|
+
enableExport = false,
|
|
28
|
+
enableRefresh = false,
|
|
29
|
+
exportFormats = ['png', 'svg', 'csv'],
|
|
30
|
+
datasets,
|
|
31
|
+
config,
|
|
32
|
+
...props
|
|
33
|
+
},
|
|
34
|
+
ref
|
|
35
|
+
) => {
|
|
36
|
+
const [isFullscreen, setIsFullscreen] = useState(false);
|
|
37
|
+
const [isExporting, setIsExporting] = useState(false);
|
|
38
|
+
|
|
39
|
+
// Enhanced toolbar with dynamic configuration
|
|
40
|
+
const {
|
|
41
|
+
state: toolbarState,
|
|
42
|
+
handlers: toolbarHandlers,
|
|
43
|
+
toolbarGroups,
|
|
44
|
+
} = useChartToolbar(
|
|
45
|
+
type,
|
|
46
|
+
{
|
|
47
|
+
enableDefaults: showToolbar,
|
|
48
|
+
defaults: {
|
|
49
|
+
refresh: enableRefresh,
|
|
50
|
+
export: enableExport,
|
|
51
|
+
fullscreen: enableFullscreen,
|
|
52
|
+
zoom: true, // Enable zoom by default
|
|
53
|
+
pan: true, // Enable pan by default
|
|
54
|
+
reset: true, // Enable reset by default
|
|
55
|
+
grid: true, // Enable grid toggle by default
|
|
56
|
+
legend: true, // Enable legend toggle by default
|
|
57
|
+
tooltips: true, // Enable tooltips toggle by default
|
|
58
|
+
animations: true, // Enable animations toggle by default
|
|
59
|
+
settings: true, // Enable settings by default
|
|
60
|
+
},
|
|
61
|
+
exportFormats,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
onRefresh,
|
|
65
|
+
onExport,
|
|
66
|
+
onFullscreen: fullscreen => {
|
|
67
|
+
setIsFullscreen(fullscreen);
|
|
68
|
+
onFullscreen?.(fullscreen);
|
|
69
|
+
},
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
const { generateChartClass, chartAttributes } = useChart({
|
|
74
|
+
type,
|
|
75
|
+
size,
|
|
76
|
+
variant,
|
|
77
|
+
loading,
|
|
78
|
+
error,
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
const chartClass = generateChartClass({
|
|
82
|
+
type,
|
|
83
|
+
size,
|
|
84
|
+
variant,
|
|
85
|
+
loading,
|
|
86
|
+
error,
|
|
87
|
+
className,
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// Legacy handlers for backward compatibility
|
|
91
|
+
const handleFullscreen = useCallback(() => {
|
|
92
|
+
toolbarHandlers.onFullscreen(!toolbarState.isFullscreen);
|
|
93
|
+
}, [toolbarHandlers, toolbarState.isFullscreen]);
|
|
94
|
+
|
|
95
|
+
const handleExport = useCallback(
|
|
96
|
+
async (format: string) => {
|
|
97
|
+
await toolbarHandlers.onExport(format);
|
|
98
|
+
},
|
|
99
|
+
[toolbarHandlers]
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
const handleRefresh = useCallback(() => {
|
|
103
|
+
toolbarHandlers.onRefresh();
|
|
104
|
+
}, [toolbarHandlers]);
|
|
105
|
+
|
|
106
|
+
// Sync all toolbar state with component state
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
setIsFullscreen(toolbarState.isFullscreen);
|
|
109
|
+
setIsExporting(toolbarState.isExporting);
|
|
110
|
+
}, [toolbarState.isFullscreen, toolbarState.isExporting]);
|
|
111
|
+
|
|
112
|
+
// Render enhanced toolbar
|
|
113
|
+
const renderToolbar = () => {
|
|
114
|
+
if (!showToolbar) return null;
|
|
115
|
+
|
|
116
|
+
return (
|
|
117
|
+
<ChartToolbar
|
|
118
|
+
chartType={type}
|
|
119
|
+
groups={toolbarGroups}
|
|
120
|
+
enableDefaults={toolbarGroups.length === 0}
|
|
121
|
+
exportFormats={exportFormats}
|
|
122
|
+
state={{
|
|
123
|
+
isFullscreen: toolbarState.isFullscreen,
|
|
124
|
+
isExporting: toolbarState.isExporting,
|
|
125
|
+
isRefreshing: toolbarState.isRefreshing,
|
|
126
|
+
zoomLevel: toolbarState.zoomLevel,
|
|
127
|
+
panEnabled: toolbarState.panEnabled,
|
|
128
|
+
showGrid: toolbarState.showGrid,
|
|
129
|
+
showLegend: toolbarState.showLegend,
|
|
130
|
+
showTooltips: toolbarState.showTooltips,
|
|
131
|
+
animationsEnabled: toolbarState.animationsEnabled,
|
|
132
|
+
}}
|
|
133
|
+
onRefresh={toolbarHandlers.onRefresh}
|
|
134
|
+
onExport={toolbarHandlers.onExport}
|
|
135
|
+
onFullscreen={toolbarHandlers.onFullscreen}
|
|
136
|
+
onZoomIn={toolbarHandlers.onZoomIn}
|
|
137
|
+
onZoomOut={toolbarHandlers.onZoomOut}
|
|
138
|
+
onZoomReset={toolbarHandlers.onZoomReset}
|
|
139
|
+
onPanToggle={toolbarHandlers.onPanToggle}
|
|
140
|
+
onReset={toolbarHandlers.onReset}
|
|
141
|
+
onSettings={toolbarHandlers.onSettings}
|
|
142
|
+
onGridToggle={toolbarHandlers.onGridToggle}
|
|
143
|
+
onLegendToggle={toolbarHandlers.onLegendToggle}
|
|
144
|
+
onTooltipsToggle={toolbarHandlers.onTooltipsToggle}
|
|
145
|
+
onAnimationsToggle={toolbarHandlers.onAnimationsToggle}
|
|
146
|
+
/>
|
|
147
|
+
);
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
const fullChartClass = `${chartClass}${isFullscreen ? ` ${CHART.CLASSES.FULLSCREEN}` : ''}`;
|
|
151
|
+
|
|
152
|
+
return (
|
|
153
|
+
<div
|
|
154
|
+
ref={ref}
|
|
155
|
+
className={fullChartClass}
|
|
156
|
+
aria-label={ariaLabel || `${type} chart`}
|
|
157
|
+
role="img"
|
|
158
|
+
tabIndex={0}
|
|
159
|
+
{...chartAttributes}
|
|
160
|
+
{...props}
|
|
161
|
+
>
|
|
162
|
+
{(title || subtitle || showToolbar) && (
|
|
163
|
+
<div
|
|
164
|
+
className={`${CHART.HEADER_CLASS} u-d-flex u-justify-between u-align-items-start u-gap-4`}
|
|
165
|
+
>
|
|
166
|
+
<div className={`${CHART.HEADER_CONTENT_CLASS} u-flex-1`}>
|
|
167
|
+
{title && <h3 className={`${CHART.TITLE_CLASS} u-mb-1`}>{title}</h3>}
|
|
168
|
+
{subtitle && <p className={`${CHART.SUBTITLE_CLASS} u-mb-0`}>{subtitle}</p>}
|
|
169
|
+
</div>
|
|
170
|
+
{renderToolbar()}
|
|
171
|
+
</div>
|
|
172
|
+
)}
|
|
173
|
+
|
|
174
|
+
<div className={CHART.CONTENT_CLASS}>
|
|
175
|
+
{loading && (
|
|
176
|
+
<div className={CHART.LOADING_CLASS}>
|
|
177
|
+
<div className={CHART.LOADING_SPINNER_CLASS}></div>
|
|
178
|
+
<span className={CHART.LOADING_TEXT_CLASS}>
|
|
179
|
+
{toolbarState.isExporting
|
|
180
|
+
? 'Exporting chart...'
|
|
181
|
+
: toolbarState.isRefreshing
|
|
182
|
+
? 'Refreshing chart...'
|
|
183
|
+
: 'Loading chart...'}
|
|
184
|
+
</span>
|
|
185
|
+
</div>
|
|
186
|
+
)}
|
|
187
|
+
|
|
188
|
+
{error && (
|
|
189
|
+
<div className={CHART.ERROR_CLASS}>
|
|
190
|
+
<div className={CHART.ERROR_ICON_CLASS}>⚠</div>
|
|
191
|
+
<div className={CHART.ERROR_CONTENT_CLASS}>
|
|
192
|
+
<div className={CHART.ERROR_MESSAGE_CLASS}>Chart Error</div>
|
|
193
|
+
<div className={CHART.ERROR_DETAILS_CLASS}>{error}</div>
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
)}
|
|
197
|
+
|
|
198
|
+
{!loading && !error && !children && (
|
|
199
|
+
<div className={CHART.EMPTY_CLASS}>
|
|
200
|
+
<div className={CHART.EMPTY_ICON_CLASS}>📊</div>
|
|
201
|
+
<div className={CHART.EMPTY_MESSAGE_CLASS}>No data available</div>
|
|
202
|
+
<div className={CHART.EMPTY_DETAILS_CLASS}>
|
|
203
|
+
Add data to your chart to see visualizations
|
|
204
|
+
</div>
|
|
205
|
+
</div>
|
|
206
|
+
)}
|
|
207
|
+
|
|
208
|
+
{!loading && !error && children && <div className={CHART.CANVAS_CLASS}>{children}</div>}
|
|
209
|
+
</div>
|
|
210
|
+
</div>
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
)
|
|
214
|
+
);
|
|
215
|
+
|
|
216
|
+
Chart.displayName = 'Chart';
|
|
217
|
+
export default Chart;
|
|
218
|
+
export type { ChartProps };
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import { forwardRef, memo, useCallback, useMemo } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
useChart,
|
|
4
|
+
useChartAccessibility,
|
|
5
|
+
useChartData,
|
|
6
|
+
useChartPerformance,
|
|
7
|
+
} from '../../lib/composables/useChart';
|
|
8
|
+
import { CHART } from '../../lib/constants/components';
|
|
9
|
+
import { ChartProps } from '../../lib/types/components';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Enhanced chart renderer component with comprehensive functionality
|
|
13
|
+
*/
|
|
14
|
+
const ChartRenderer = memo(
|
|
15
|
+
forwardRef<
|
|
16
|
+
SVGSVGElement,
|
|
17
|
+
{
|
|
18
|
+
datasets: ChartProps['datasets'];
|
|
19
|
+
config?: ChartProps['config'];
|
|
20
|
+
width?: number;
|
|
21
|
+
height?: number;
|
|
22
|
+
onDataPointClick?: ChartProps['onDataPointClick'];
|
|
23
|
+
interactive?: boolean;
|
|
24
|
+
enableRealTime?: boolean;
|
|
25
|
+
enableAccessibility?: boolean;
|
|
26
|
+
enablePerformanceOptimization?: boolean;
|
|
27
|
+
renderContent: (params: {
|
|
28
|
+
scales: any;
|
|
29
|
+
colors: string[];
|
|
30
|
+
datasets: any[];
|
|
31
|
+
interactionState: any;
|
|
32
|
+
handlers: {
|
|
33
|
+
onDataPointClick?: ChartProps['onDataPointClick'];
|
|
34
|
+
onPointHover: (
|
|
35
|
+
datasetIndex: number,
|
|
36
|
+
pointIndex: number,
|
|
37
|
+
x: number,
|
|
38
|
+
y: number,
|
|
39
|
+
clientX: number,
|
|
40
|
+
clientY: number
|
|
41
|
+
) => void;
|
|
42
|
+
onPointLeave: () => void;
|
|
43
|
+
onMouseMove: (event: React.MouseEvent<SVGSVGElement>) => void;
|
|
44
|
+
onMouseDown: (event: React.MouseEvent<SVGSVGElement>) => void;
|
|
45
|
+
onMouseUp: () => void;
|
|
46
|
+
onWheel: (event: React.WheelEvent<SVGSVGElement>) => void;
|
|
47
|
+
};
|
|
48
|
+
accessibility: {
|
|
49
|
+
announcement: string;
|
|
50
|
+
focusedPoint: { datasetIndex: number; pointIndex: number };
|
|
51
|
+
getAccessibleDescription: () => string;
|
|
52
|
+
};
|
|
53
|
+
}) => React.ReactNode;
|
|
54
|
+
}
|
|
55
|
+
>(
|
|
56
|
+
(
|
|
57
|
+
{
|
|
58
|
+
datasets = [],
|
|
59
|
+
config,
|
|
60
|
+
width = CHART.DEFAULT_WIDTH,
|
|
61
|
+
height = CHART.DEFAULT_HEIGHT,
|
|
62
|
+
onDataPointClick,
|
|
63
|
+
interactive = true,
|
|
64
|
+
enableRealTime = false,
|
|
65
|
+
enableAccessibility = true,
|
|
66
|
+
enablePerformanceOptimization = true,
|
|
67
|
+
renderContent,
|
|
68
|
+
},
|
|
69
|
+
ref
|
|
70
|
+
) => {
|
|
71
|
+
// Enhanced chart hooks
|
|
72
|
+
const {
|
|
73
|
+
calculateScales,
|
|
74
|
+
getChartColors,
|
|
75
|
+
interactionState,
|
|
76
|
+
handlePointHover,
|
|
77
|
+
handlePointLeave,
|
|
78
|
+
handlePointClick,
|
|
79
|
+
handleZoom,
|
|
80
|
+
handlePan,
|
|
81
|
+
handleDragStart,
|
|
82
|
+
handleDragEnd,
|
|
83
|
+
handleCrosshair,
|
|
84
|
+
clearCrosshair,
|
|
85
|
+
handleTouchStart,
|
|
86
|
+
handleTouchMove,
|
|
87
|
+
handleTouchEnd,
|
|
88
|
+
handlePointerDown,
|
|
89
|
+
handlePointerMove,
|
|
90
|
+
handlePointerUp,
|
|
91
|
+
svgRef,
|
|
92
|
+
} = useChart({ interactive });
|
|
93
|
+
|
|
94
|
+
const { processedData, isProcessing } = useChartData(datasets, {
|
|
95
|
+
enableRealTime,
|
|
96
|
+
enableDecimation: enablePerformanceOptimization,
|
|
97
|
+
maxDataPoints: 1000,
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
const { announcement, focusedPoint, getAccessibleDescription, handleKeyDown } =
|
|
101
|
+
useChartAccessibility(processedData, {
|
|
102
|
+
enableKeyboardNavigation: enableAccessibility,
|
|
103
|
+
enableScreenReader: enableAccessibility,
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
const { isOptimizing, debouncedUpdate } = useChartPerformance(processedData, {
|
|
107
|
+
enableMemoization: enablePerformanceOptimization,
|
|
108
|
+
debounceMs: 100,
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// Enhanced interaction handlers with touch/pen support
|
|
112
|
+
const handleMouseMove = useCallback(
|
|
113
|
+
(event: React.MouseEvent<SVGSVGElement>) => {
|
|
114
|
+
if (!interactive || interactionState.touchState.isTouch) return;
|
|
115
|
+
|
|
116
|
+
const rect = event.currentTarget.getBoundingClientRect();
|
|
117
|
+
const x = event.clientX - rect.left;
|
|
118
|
+
const y = event.clientY - rect.top;
|
|
119
|
+
|
|
120
|
+
handleCrosshair(x, y);
|
|
121
|
+
|
|
122
|
+
if (interactionState.isDragging && interactionState.dragStart) {
|
|
123
|
+
const deltaX = x - interactionState.dragStart.x;
|
|
124
|
+
const deltaY = y - interactionState.dragStart.y;
|
|
125
|
+
handlePan(deltaX, deltaY);
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
[interactive, interactionState, handleCrosshair, handlePan]
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
const handleMouseDown = useCallback(
|
|
132
|
+
(event: React.MouseEvent<SVGSVGElement>) => {
|
|
133
|
+
if (!interactive || interactionState.touchState.isTouch) return;
|
|
134
|
+
|
|
135
|
+
const rect = event.currentTarget.getBoundingClientRect();
|
|
136
|
+
const x = event.clientX - rect.left;
|
|
137
|
+
const y = event.clientY - rect.top;
|
|
138
|
+
|
|
139
|
+
handleDragStart(x, y);
|
|
140
|
+
},
|
|
141
|
+
[interactive, interactionState.touchState.isTouch, handleDragStart]
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
const handleMouseUp = useCallback(() => {
|
|
145
|
+
if (!interactive || interactionState.touchState.isTouch) return;
|
|
146
|
+
handleDragEnd();
|
|
147
|
+
}, [interactive, interactionState.touchState.isTouch, handleDragEnd]);
|
|
148
|
+
|
|
149
|
+
const handleWheel = useCallback(
|
|
150
|
+
(event: React.WheelEvent<SVGSVGElement>) => {
|
|
151
|
+
if (!interactive) return;
|
|
152
|
+
|
|
153
|
+
event.preventDefault();
|
|
154
|
+
const rect = event.currentTarget.getBoundingClientRect();
|
|
155
|
+
const centerX = event.clientX - rect.left;
|
|
156
|
+
const centerY = event.clientY - rect.top;
|
|
157
|
+
|
|
158
|
+
// Detect trackpad vs mouse wheel
|
|
159
|
+
const isTrackpad = Math.abs(event.deltaY) < 50;
|
|
160
|
+
const sensitivity = isTrackpad ? 0.01 : 0.1;
|
|
161
|
+
const adjustedDelta = event.deltaY * sensitivity;
|
|
162
|
+
|
|
163
|
+
handleZoom(adjustedDelta, centerX, centerY);
|
|
164
|
+
},
|
|
165
|
+
[interactive, handleZoom]
|
|
166
|
+
);
|
|
167
|
+
|
|
168
|
+
const enhancedOnDataPointClick = useCallback(
|
|
169
|
+
(dataPoint: any, datasetIndex: number, pointIndex: number) => {
|
|
170
|
+
if (!interactive) return;
|
|
171
|
+
|
|
172
|
+
handlePointClick(datasetIndex, pointIndex);
|
|
173
|
+
onDataPointClick?.(dataPoint, datasetIndex, pointIndex);
|
|
174
|
+
},
|
|
175
|
+
[interactive, handlePointClick, onDataPointClick]
|
|
176
|
+
);
|
|
177
|
+
|
|
178
|
+
// Calculate chart data with enhanced features
|
|
179
|
+
const chartData = useMemo(() => {
|
|
180
|
+
const scales = calculateScales(processedData, width, height, undefined, config);
|
|
181
|
+
if (!scales) return null;
|
|
182
|
+
|
|
183
|
+
const colors = getChartColors(processedData.length).filter(
|
|
184
|
+
(color): color is string => color !== undefined
|
|
185
|
+
);
|
|
186
|
+
|
|
187
|
+
return {
|
|
188
|
+
scales,
|
|
189
|
+
colors,
|
|
190
|
+
datasets: processedData.map((dataset, i) => ({
|
|
191
|
+
...dataset,
|
|
192
|
+
color: dataset.color || colors[i],
|
|
193
|
+
})),
|
|
194
|
+
};
|
|
195
|
+
}, [processedData, config, width, height, calculateScales, getChartColors]);
|
|
196
|
+
|
|
197
|
+
if (!chartData) {
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return (
|
|
202
|
+
<svg
|
|
203
|
+
ref={ref || svgRef}
|
|
204
|
+
width="100%"
|
|
205
|
+
height="100%"
|
|
206
|
+
viewBox={`0 0 ${chartData.scales.width} ${chartData.scales.height}`}
|
|
207
|
+
preserveAspectRatio="xMidYMid meet"
|
|
208
|
+
className={CHART.CHART_SVG_CLASS}
|
|
209
|
+
onMouseMove={handleMouseMove}
|
|
210
|
+
onMouseDown={handleMouseDown}
|
|
211
|
+
onMouseUp={handleMouseUp}
|
|
212
|
+
onMouseLeave={() => {
|
|
213
|
+
clearCrosshair();
|
|
214
|
+
handleMouseUp();
|
|
215
|
+
}}
|
|
216
|
+
onWheel={handleWheel}
|
|
217
|
+
onTouchStart={e => handleTouchStart(e.nativeEvent)}
|
|
218
|
+
onTouchMove={e => handleTouchMove(e.nativeEvent)}
|
|
219
|
+
onTouchEnd={e => handleTouchEnd(e.nativeEvent)}
|
|
220
|
+
onPointerDown={e => handlePointerDown(e.nativeEvent)}
|
|
221
|
+
onPointerMove={e => handlePointerMove(e.nativeEvent)}
|
|
222
|
+
onPointerUp={e => handlePointerUp(e.nativeEvent)}
|
|
223
|
+
tabIndex={enableAccessibility ? 0 : undefined}
|
|
224
|
+
role={enableAccessibility ? 'img' : undefined}
|
|
225
|
+
aria-label={enableAccessibility ? getAccessibleDescription() : undefined}
|
|
226
|
+
onKeyDown={
|
|
227
|
+
enableAccessibility
|
|
228
|
+
? e =>
|
|
229
|
+
handleKeyDown(e.nativeEvent, (datasetIndex: number, pointIndex: number) => {
|
|
230
|
+
const dataPoint = processedData[datasetIndex]?.data[pointIndex];
|
|
231
|
+
enhancedOnDataPointClick(dataPoint, datasetIndex, pointIndex);
|
|
232
|
+
})
|
|
233
|
+
: undefined
|
|
234
|
+
}
|
|
235
|
+
style={{
|
|
236
|
+
touchAction: 'none',
|
|
237
|
+
userSelect: 'none',
|
|
238
|
+
WebkitUserSelect: 'none',
|
|
239
|
+
}}
|
|
240
|
+
>
|
|
241
|
+
{/* Accessibility announcement */}
|
|
242
|
+
{enableAccessibility && announcement && (
|
|
243
|
+
<text x="-9999" y="-9999" className="sr-only" aria-live="polite">
|
|
244
|
+
{announcement}
|
|
245
|
+
</text>
|
|
246
|
+
)}
|
|
247
|
+
|
|
248
|
+
{renderContent({
|
|
249
|
+
...chartData,
|
|
250
|
+
interactionState,
|
|
251
|
+
handlers: {
|
|
252
|
+
onDataPointClick: enhancedOnDataPointClick,
|
|
253
|
+
onPointHover: handlePointHover,
|
|
254
|
+
onPointLeave: handlePointLeave,
|
|
255
|
+
onMouseMove: handleMouseMove,
|
|
256
|
+
onMouseDown: handleMouseDown,
|
|
257
|
+
onMouseUp: handleMouseUp,
|
|
258
|
+
onWheel: handleWheel,
|
|
259
|
+
},
|
|
260
|
+
accessibility: {
|
|
261
|
+
announcement,
|
|
262
|
+
focusedPoint,
|
|
263
|
+
getAccessibleDescription,
|
|
264
|
+
},
|
|
265
|
+
})}
|
|
266
|
+
|
|
267
|
+
{/* Crosshair overlay */}
|
|
268
|
+
{interactive && interactionState.crosshair && (
|
|
269
|
+
<g className="chart-crosshair" style={{ pointerEvents: 'none' }}>
|
|
270
|
+
<line
|
|
271
|
+
x1={interactionState.crosshair.x}
|
|
272
|
+
y1={0}
|
|
273
|
+
x2={interactionState.crosshair.x}
|
|
274
|
+
y2={chartData.scales.height}
|
|
275
|
+
stroke="var(--atomix-gray-4)"
|
|
276
|
+
strokeWidth="1"
|
|
277
|
+
strokeDasharray="4,4"
|
|
278
|
+
opacity="0.6"
|
|
279
|
+
/>
|
|
280
|
+
<line
|
|
281
|
+
x1={0}
|
|
282
|
+
y1={interactionState.crosshair.y}
|
|
283
|
+
x2={chartData.scales.width}
|
|
284
|
+
y2={interactionState.crosshair.y}
|
|
285
|
+
stroke="var(--atomix-gray-4)"
|
|
286
|
+
strokeWidth="1"
|
|
287
|
+
strokeDasharray="4,4"
|
|
288
|
+
opacity="0.6"
|
|
289
|
+
/>
|
|
290
|
+
</g>
|
|
291
|
+
)}
|
|
292
|
+
|
|
293
|
+
{/* Zoom indicator */}
|
|
294
|
+
{interactive && interactionState.zoomLevel !== 1 && (
|
|
295
|
+
<g className="chart-zoom-indicator">
|
|
296
|
+
<rect
|
|
297
|
+
x={chartData.scales.width - 80}
|
|
298
|
+
y={10}
|
|
299
|
+
width="70"
|
|
300
|
+
height="20"
|
|
301
|
+
fill="rgba(0, 0, 0, 0.8)"
|
|
302
|
+
rx="4"
|
|
303
|
+
/>
|
|
304
|
+
<text
|
|
305
|
+
x={chartData.scales.width - 45}
|
|
306
|
+
y={24}
|
|
307
|
+
textAnchor="middle"
|
|
308
|
+
fill="white"
|
|
309
|
+
fontSize="12"
|
|
310
|
+
>
|
|
311
|
+
{Math.round(interactionState.zoomLevel * 100)}%
|
|
312
|
+
</text>
|
|
313
|
+
</g>
|
|
314
|
+
)}
|
|
315
|
+
</svg>
|
|
316
|
+
);
|
|
317
|
+
}
|
|
318
|
+
)
|
|
319
|
+
);
|
|
320
|
+
|
|
321
|
+
ChartRenderer.displayName = 'ChartRenderer';
|
|
322
|
+
export default ChartRenderer;
|