@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,184 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ImageType } from '../../lib/types/components';
|
|
3
|
+
import { Badge } from '../Badge';
|
|
4
|
+
import { Button } from '../Button';
|
|
5
|
+
import { Icon } from '../Icon';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Props for the PhotoViewerHeader component
|
|
9
|
+
*/
|
|
10
|
+
export interface PhotoViewerHeaderProps {
|
|
11
|
+
/** Current image index */
|
|
12
|
+
currentIndex: number;
|
|
13
|
+
/** Total number of images */
|
|
14
|
+
imagesLength: number;
|
|
15
|
+
/** Callback to zoom out */
|
|
16
|
+
onZoomOut: () => void;
|
|
17
|
+
/** Callback to reset zoom */
|
|
18
|
+
onResetZoom: () => void;
|
|
19
|
+
/** Callback to zoom in */
|
|
20
|
+
onZoomIn: () => void;
|
|
21
|
+
/** Callback to toggle fullscreen */
|
|
22
|
+
onToggleFullscreen: () => void;
|
|
23
|
+
/** Callback to close the viewer */
|
|
24
|
+
onClose: () => void;
|
|
25
|
+
/** Whether fullscreen is active */
|
|
26
|
+
isFullscreen: boolean;
|
|
27
|
+
/** Current zoom level */
|
|
28
|
+
zoomLevel: number;
|
|
29
|
+
/** Callback to rotate image */
|
|
30
|
+
onRotate: () => void;
|
|
31
|
+
/** Callback to download image */
|
|
32
|
+
onDownload: () => void;
|
|
33
|
+
/** Callback to share image */
|
|
34
|
+
onShare: () => void;
|
|
35
|
+
/** Whether info panel is shown */
|
|
36
|
+
showInfo: boolean;
|
|
37
|
+
/** Callback to toggle info panel */
|
|
38
|
+
onToggleInfo: () => void;
|
|
39
|
+
/** Current image object */
|
|
40
|
+
currentImage?: ImageType;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* PhotoViewerHeader component - displays controls and counter for the photo viewer
|
|
45
|
+
*
|
|
46
|
+
* @param props - PhotoViewerHeaderProps
|
|
47
|
+
* @returns JSX.Element
|
|
48
|
+
*/
|
|
49
|
+
export const PhotoViewerHeader: React.FC<PhotoViewerHeaderProps> = ({
|
|
50
|
+
currentIndex,
|
|
51
|
+
imagesLength,
|
|
52
|
+
onZoomOut,
|
|
53
|
+
onResetZoom,
|
|
54
|
+
onZoomIn,
|
|
55
|
+
onToggleFullscreen,
|
|
56
|
+
onClose,
|
|
57
|
+
isFullscreen,
|
|
58
|
+
zoomLevel,
|
|
59
|
+
onRotate,
|
|
60
|
+
onDownload,
|
|
61
|
+
onShare,
|
|
62
|
+
showInfo,
|
|
63
|
+
onToggleInfo,
|
|
64
|
+
currentImage,
|
|
65
|
+
}) => (
|
|
66
|
+
<div className="c-photo-viewer__header">
|
|
67
|
+
<div className="c-photo-viewer__header-left">
|
|
68
|
+
<Badge label={`${currentIndex + 1} / ${imagesLength}`} variant="primary" size="sm" />
|
|
69
|
+
{currentImage?.title && <h3 className="c-photo-viewer__image-title">{currentImage.title}</h3>}
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<div className="c-photo-viewer__actions">
|
|
73
|
+
<Button
|
|
74
|
+
iconOnly
|
|
75
|
+
size="sm"
|
|
76
|
+
variant="ghost"
|
|
77
|
+
rounded
|
|
78
|
+
onClick={onZoomOut}
|
|
79
|
+
disabled={zoomLevel <= 0.1}
|
|
80
|
+
aria-label="Zoom out"
|
|
81
|
+
className="c-photo-viewer__action-button"
|
|
82
|
+
icon={<Icon name="Minus" size="sm" />}
|
|
83
|
+
/>
|
|
84
|
+
|
|
85
|
+
<Button
|
|
86
|
+
iconOnly
|
|
87
|
+
size="sm"
|
|
88
|
+
variant="ghost"
|
|
89
|
+
rounded
|
|
90
|
+
onClick={onResetZoom}
|
|
91
|
+
disabled={zoomLevel === 1}
|
|
92
|
+
aria-label="Reset zoom"
|
|
93
|
+
className="c-photo-viewer__action-button"
|
|
94
|
+
icon={<Icon name="MagnifyingGlass" size="sm" />}
|
|
95
|
+
/>
|
|
96
|
+
|
|
97
|
+
<Button
|
|
98
|
+
iconOnly
|
|
99
|
+
size="sm"
|
|
100
|
+
variant="ghost"
|
|
101
|
+
rounded
|
|
102
|
+
onClick={onZoomIn}
|
|
103
|
+
disabled={zoomLevel >= 5}
|
|
104
|
+
aria-label="Zoom in"
|
|
105
|
+
className="c-photo-viewer__action-button"
|
|
106
|
+
icon={<Icon name="Plus" size="sm" />}
|
|
107
|
+
/>
|
|
108
|
+
|
|
109
|
+
<div className="c-photo-viewer__divider" />
|
|
110
|
+
|
|
111
|
+
<Button
|
|
112
|
+
iconOnly
|
|
113
|
+
size="sm"
|
|
114
|
+
variant="ghost"
|
|
115
|
+
rounded
|
|
116
|
+
onClick={onRotate}
|
|
117
|
+
aria-label="Rotate image"
|
|
118
|
+
className="c-photo-viewer__action-button"
|
|
119
|
+
icon={<Icon name="ArrowsClockwise" size="sm" />}
|
|
120
|
+
/>
|
|
121
|
+
|
|
122
|
+
<Button
|
|
123
|
+
iconOnly
|
|
124
|
+
size="sm"
|
|
125
|
+
variant="ghost"
|
|
126
|
+
rounded
|
|
127
|
+
onClick={onDownload}
|
|
128
|
+
aria-label="Download image"
|
|
129
|
+
className="c-photo-viewer__action-button"
|
|
130
|
+
icon={<Icon name="Download" size="sm" />}
|
|
131
|
+
/>
|
|
132
|
+
|
|
133
|
+
{'share' in navigator && typeof navigator.share === 'function' && (
|
|
134
|
+
<Button
|
|
135
|
+
iconOnly
|
|
136
|
+
size="sm"
|
|
137
|
+
variant="ghost"
|
|
138
|
+
rounded
|
|
139
|
+
onClick={onShare}
|
|
140
|
+
aria-label="Share image"
|
|
141
|
+
className="c-photo-viewer__action-button"
|
|
142
|
+
icon={<Icon name="Share" size="sm" />}
|
|
143
|
+
/>
|
|
144
|
+
)}
|
|
145
|
+
|
|
146
|
+
<Button
|
|
147
|
+
iconOnly
|
|
148
|
+
size="sm"
|
|
149
|
+
variant="ghost"
|
|
150
|
+
rounded
|
|
151
|
+
onClick={onToggleInfo}
|
|
152
|
+
aria-label="Toggle info panel"
|
|
153
|
+
className={`c-photo-viewer__action-button ${showInfo ? 'is-active' : ''}`}
|
|
154
|
+
icon={<Icon name="Info" size="sm" />}
|
|
155
|
+
/>
|
|
156
|
+
|
|
157
|
+
<div className="c-photo-viewer__divider" />
|
|
158
|
+
|
|
159
|
+
<Button
|
|
160
|
+
iconOnly
|
|
161
|
+
size="sm"
|
|
162
|
+
variant="ghost"
|
|
163
|
+
rounded
|
|
164
|
+
onClick={onToggleFullscreen}
|
|
165
|
+
aria-label={isFullscreen ? 'Exit fullscreen' : 'Enter fullscreen'}
|
|
166
|
+
className="c-photo-viewer__action-button"
|
|
167
|
+
icon={<Icon name={isFullscreen ? 'ArrowsIn' : 'ArrowsOut'} size="sm" />}
|
|
168
|
+
/>
|
|
169
|
+
|
|
170
|
+
<Button
|
|
171
|
+
iconOnly
|
|
172
|
+
size="sm"
|
|
173
|
+
variant="ghost"
|
|
174
|
+
rounded
|
|
175
|
+
onClick={onClose}
|
|
176
|
+
aria-label="Close viewer"
|
|
177
|
+
className="c-photo-viewer__action-button c-photo-viewer__close-button"
|
|
178
|
+
icon={<Icon name="X" size="sm" />}
|
|
179
|
+
/>
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
export default PhotoViewerHeader;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import React, { useRef, useEffect, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Props for the PhotoViewerImage component
|
|
5
|
+
*/
|
|
6
|
+
export interface PhotoViewerImageProps {
|
|
7
|
+
/** Ref to the image element */
|
|
8
|
+
imageRef: React.RefObject<HTMLImageElement | null>;
|
|
9
|
+
/** Ref to the container element */
|
|
10
|
+
containerRef?: React.RefObject<HTMLDivElement | null>;
|
|
11
|
+
/** Image source URL */
|
|
12
|
+
src: string;
|
|
13
|
+
/** Image alt text */
|
|
14
|
+
alt?: string;
|
|
15
|
+
/** Current zoom level */
|
|
16
|
+
zoomLevel: number;
|
|
17
|
+
/** Current drag position */
|
|
18
|
+
dragPosition: { x: number; y: number };
|
|
19
|
+
/** Whether image is being dragged */
|
|
20
|
+
isDragging: boolean;
|
|
21
|
+
/** Current rotation angle in degrees */
|
|
22
|
+
rotationAngle: number;
|
|
23
|
+
/** Whether image is transitioning */
|
|
24
|
+
isTransitioning?: boolean;
|
|
25
|
+
/** Mouse down event handler */
|
|
26
|
+
onMouseDown: (event: React.MouseEvent<HTMLDivElement | HTMLImageElement, MouseEvent>) => void;
|
|
27
|
+
/** Mouse move event handler */
|
|
28
|
+
onMouseMove: (event: React.MouseEvent<HTMLDivElement | HTMLImageElement, MouseEvent>) => void;
|
|
29
|
+
/** Mouse up event handler */
|
|
30
|
+
onMouseUp: (event: React.MouseEvent<HTMLDivElement | HTMLImageElement, MouseEvent>) => void;
|
|
31
|
+
/** Wheel event handler for zoom */
|
|
32
|
+
onWheel: (event: React.WheelEvent<HTMLDivElement>) => void;
|
|
33
|
+
/** Touch start event handler */
|
|
34
|
+
onTouchStart: (event: React.TouchEvent<HTMLDivElement | HTMLImageElement>) => void;
|
|
35
|
+
/** Touch move event handler */
|
|
36
|
+
onTouchMove: (event: React.TouchEvent<HTMLDivElement | HTMLImageElement>) => void;
|
|
37
|
+
/** Touch end event handler */
|
|
38
|
+
onTouchEnd: (event: React.TouchEvent<HTMLDivElement | HTMLImageElement>) => void;
|
|
39
|
+
/** Double click event handler */
|
|
40
|
+
onDoubleClick?: (event: React.MouseEvent<HTMLDivElement | HTMLImageElement, MouseEvent>) => void;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* PhotoViewerImage component - displays the main image with zoom and pan capabilities
|
|
45
|
+
*
|
|
46
|
+
* @param props - PhotoViewerImageProps
|
|
47
|
+
* @returns JSX.Element
|
|
48
|
+
*/
|
|
49
|
+
export const PhotoViewerImage: React.FC<PhotoViewerImageProps> = ({
|
|
50
|
+
imageRef,
|
|
51
|
+
containerRef,
|
|
52
|
+
src,
|
|
53
|
+
alt,
|
|
54
|
+
zoomLevel,
|
|
55
|
+
dragPosition,
|
|
56
|
+
isDragging,
|
|
57
|
+
rotationAngle,
|
|
58
|
+
isTransitioning = false,
|
|
59
|
+
onMouseDown,
|
|
60
|
+
onMouseMove,
|
|
61
|
+
onMouseUp,
|
|
62
|
+
onWheel,
|
|
63
|
+
onTouchStart,
|
|
64
|
+
onTouchMove,
|
|
65
|
+
onTouchEnd,
|
|
66
|
+
onDoubleClick,
|
|
67
|
+
}) => {
|
|
68
|
+
const internalContainerRef = useRef<HTMLDivElement>(null);
|
|
69
|
+
const effectiveContainerRef = containerRef || internalContainerRef;
|
|
70
|
+
const [isMounted, setIsMounted] = useState(false);
|
|
71
|
+
|
|
72
|
+
// Track mounting state
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
setIsMounted(true);
|
|
75
|
+
return () => setIsMounted(false);
|
|
76
|
+
}, []);
|
|
77
|
+
|
|
78
|
+
// Add double-click to zoom
|
|
79
|
+
const handleDoubleClick = (
|
|
80
|
+
e: React.MouseEvent<HTMLDivElement | HTMLImageElement, MouseEvent>
|
|
81
|
+
) => {
|
|
82
|
+
if (isMounted && onDoubleClick) onDoubleClick(e);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
// Add non-passive event listeners to prevent page scrolling/zooming
|
|
86
|
+
useEffect(() => {
|
|
87
|
+
const container = effectiveContainerRef.current;
|
|
88
|
+
if (!container) return undefined;
|
|
89
|
+
|
|
90
|
+
const handleWheelEvent = (e: WheelEvent) => {
|
|
91
|
+
// Only call if mounted and handler exists
|
|
92
|
+
if (isMounted && container && onWheel) {
|
|
93
|
+
onWheel(e as unknown as React.WheelEvent<HTMLDivElement>);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const handleTouchStartEvent = (e: TouchEvent) => {
|
|
98
|
+
// Only call if mounted and handler exists
|
|
99
|
+
if (isMounted && container && onTouchStart) {
|
|
100
|
+
onTouchStart(e as unknown as React.TouchEvent<HTMLDivElement>);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const handleTouchMoveEvent = (e: TouchEvent) => {
|
|
105
|
+
// Only call if mounted and handler exists
|
|
106
|
+
if (isMounted && container && onTouchMove) {
|
|
107
|
+
onTouchMove(e as unknown as React.TouchEvent<HTMLDivElement>);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const handleTouchEndEvent = (e: TouchEvent) => {
|
|
112
|
+
// Only call if mounted and handler exists
|
|
113
|
+
if (isMounted && container && onTouchEnd) {
|
|
114
|
+
onTouchEnd(e as unknown as React.TouchEvent<HTMLDivElement>);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
// Only add event listeners if mounted
|
|
119
|
+
if (isMounted) {
|
|
120
|
+
container.addEventListener('wheel', handleWheelEvent, { passive: false });
|
|
121
|
+
container.addEventListener('touchstart', handleTouchStartEvent, { passive: false });
|
|
122
|
+
container.addEventListener('touchmove', handleTouchMoveEvent, { passive: false });
|
|
123
|
+
container.addEventListener('touchend', handleTouchEndEvent, { passive: false });
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Clean up
|
|
127
|
+
return () => {
|
|
128
|
+
container.removeEventListener('wheel', handleWheelEvent);
|
|
129
|
+
container.removeEventListener('touchstart', handleTouchStartEvent);
|
|
130
|
+
container.removeEventListener('touchmove', handleTouchMoveEvent);
|
|
131
|
+
container.removeEventListener('touchend', handleTouchEndEvent);
|
|
132
|
+
};
|
|
133
|
+
}, [isMounted, onWheel, onTouchStart, onTouchMove, onTouchEnd, effectiveContainerRef]);
|
|
134
|
+
|
|
135
|
+
return (
|
|
136
|
+
<div
|
|
137
|
+
ref={effectiveContainerRef}
|
|
138
|
+
className={`c-photo-viewer__image-container ${isTransitioning ? 'is-transitioning' : ''}`}
|
|
139
|
+
style={{
|
|
140
|
+
cursor: isDragging ? 'grabbing' : zoomLevel > 1 ? 'grab' : 'default',
|
|
141
|
+
opacity: isTransitioning ? 0.7 : 1,
|
|
142
|
+
touchAction: 'none', // Prevent browser touch behaviors
|
|
143
|
+
}}
|
|
144
|
+
onMouseDown={onMouseDown}
|
|
145
|
+
onMouseMove={onMouseMove}
|
|
146
|
+
onMouseUp={onMouseUp}
|
|
147
|
+
onMouseLeave={onMouseUp}
|
|
148
|
+
onDoubleClick={handleDoubleClick}
|
|
149
|
+
>
|
|
150
|
+
<img
|
|
151
|
+
ref={imageRef}
|
|
152
|
+
src={src}
|
|
153
|
+
alt={alt}
|
|
154
|
+
className="c-photo-viewer__image"
|
|
155
|
+
style={{
|
|
156
|
+
transform: `scale(${zoomLevel}) translate(${dragPosition.x}px, ${dragPosition.y}px) rotate(${rotationAngle}deg)`,
|
|
157
|
+
transition: isDragging
|
|
158
|
+
? 'none'
|
|
159
|
+
: isTransitioning
|
|
160
|
+
? 'opacity 0.15s ease-out'
|
|
161
|
+
: 'transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94)',
|
|
162
|
+
transformOrigin: 'center center',
|
|
163
|
+
willChange: isDragging ? 'transform' : 'auto',
|
|
164
|
+
touchAction: 'none', // Prevent image-specific touch behaviors
|
|
165
|
+
}}
|
|
166
|
+
draggable={false}
|
|
167
|
+
onContextMenu={e => e.preventDefault()} // Prevent context menu on long press
|
|
168
|
+
/>
|
|
169
|
+
</div>
|
|
170
|
+
);
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export default PhotoViewerImage;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ImageType } from '../../lib/types/components';
|
|
3
|
+
import { Badge } from '../Badge';
|
|
4
|
+
import { Button } from '../Button';
|
|
5
|
+
import { Icon } from '../Icon';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Props for the PhotoViewerInfo component
|
|
9
|
+
*/
|
|
10
|
+
export interface PhotoViewerInfoProps {
|
|
11
|
+
/** Whether to show the info panel */
|
|
12
|
+
show: boolean;
|
|
13
|
+
/** Image data to display */
|
|
14
|
+
image?: ImageType;
|
|
15
|
+
/** Callback to close the info panel */
|
|
16
|
+
onClose: () => void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* PhotoViewerInfo component - displays image metadata and information
|
|
21
|
+
*
|
|
22
|
+
* @param props - PhotoViewerInfoProps
|
|
23
|
+
* @returns JSX.Element
|
|
24
|
+
*/
|
|
25
|
+
export const PhotoViewerInfo: React.FC<PhotoViewerInfoProps> = ({ show, image, onClose }) => {
|
|
26
|
+
if (!show || !image) return null;
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<div className="c-photo-viewer__info-panel">
|
|
30
|
+
<div className="c-photo-viewer__info-header">
|
|
31
|
+
<h4 className="c-photo-viewer__info-panel-title">Image Details</h4>
|
|
32
|
+
<Button
|
|
33
|
+
iconOnly
|
|
34
|
+
size="sm"
|
|
35
|
+
variant="ghost"
|
|
36
|
+
rounded
|
|
37
|
+
onClick={onClose}
|
|
38
|
+
aria-label="Close info panel"
|
|
39
|
+
className="c-photo-viewer__info-close"
|
|
40
|
+
icon={<Icon name="X" size="sm" />}
|
|
41
|
+
/>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<div className="c-photo-viewer__info-content">
|
|
45
|
+
{image.title && (
|
|
46
|
+
<div className="c-photo-viewer__info-section">
|
|
47
|
+
<h5 className="c-photo-viewer__info-title">{image.title}</h5>
|
|
48
|
+
</div>
|
|
49
|
+
)}
|
|
50
|
+
|
|
51
|
+
{image.description && (
|
|
52
|
+
<div className="c-photo-viewer__info-section">
|
|
53
|
+
<p className="c-photo-viewer__info-description">{image.description}</p>
|
|
54
|
+
</div>
|
|
55
|
+
)}
|
|
56
|
+
|
|
57
|
+
{(image.date || image.author) && (
|
|
58
|
+
<div className="c-photo-viewer__info-section">
|
|
59
|
+
<div className="c-photo-viewer__info-meta">
|
|
60
|
+
{image.date && (
|
|
61
|
+
<div className="c-photo-viewer__info-meta-item">
|
|
62
|
+
<Icon name="Calendar" size={14} />
|
|
63
|
+
<span>{image.date}</span>
|
|
64
|
+
</div>
|
|
65
|
+
)}
|
|
66
|
+
{image.author && (
|
|
67
|
+
<div className="c-photo-viewer__info-meta-item">
|
|
68
|
+
<Icon name="User" size={14} />
|
|
69
|
+
<span>{image.author}</span>
|
|
70
|
+
</div>
|
|
71
|
+
)}
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
)}
|
|
75
|
+
|
|
76
|
+
{image.tags && image.tags.length > 0 && (
|
|
77
|
+
<div className="c-photo-viewer__info-section">
|
|
78
|
+
<h6 className="c-photo-viewer__info-section-title">Tags</h6>
|
|
79
|
+
<div className="c-photo-viewer__info-tags">
|
|
80
|
+
{image.tags.map((tag: string, index: number) => (
|
|
81
|
+
<Badge key={index} label={tag} variant="secondary" size="sm" />
|
|
82
|
+
))}
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
)}
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export default PhotoViewerInfo;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { Button } from '../Button';
|
|
3
|
+
import { Icon } from '../Icon';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Props for the PhotoViewerNavigation component
|
|
7
|
+
*/
|
|
8
|
+
export interface PhotoViewerNavigationProps {
|
|
9
|
+
/** Whether to show navigation buttons */
|
|
10
|
+
show: boolean;
|
|
11
|
+
/** Callback to go to previous image */
|
|
12
|
+
onPrev: () => void;
|
|
13
|
+
/** Callback to go to next image */
|
|
14
|
+
onNext: () => void;
|
|
15
|
+
/** Current image index */
|
|
16
|
+
currentIndex: number;
|
|
17
|
+
/** Total number of images */
|
|
18
|
+
imagesLength: number;
|
|
19
|
+
/** Whether keyboard navigation is enabled */
|
|
20
|
+
enableKeyboardNav: boolean;
|
|
21
|
+
/** Callback to close the viewer */
|
|
22
|
+
onClose: () => void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* PhotoViewerNavigation component - handles navigation between images
|
|
27
|
+
*
|
|
28
|
+
* @param props - PhotoViewerNavigationProps
|
|
29
|
+
* @returns JSX.Element
|
|
30
|
+
*/
|
|
31
|
+
export const PhotoViewerNavigation: React.FC<PhotoViewerNavigationProps> = ({
|
|
32
|
+
show,
|
|
33
|
+
onPrev,
|
|
34
|
+
onNext,
|
|
35
|
+
currentIndex,
|
|
36
|
+
imagesLength,
|
|
37
|
+
enableKeyboardNav,
|
|
38
|
+
onClose,
|
|
39
|
+
}) => {
|
|
40
|
+
// Add keyboard navigation
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
if (!enableKeyboardNav) return undefined;
|
|
43
|
+
|
|
44
|
+
const handleKeyDown = (e: KeyboardEvent) => {
|
|
45
|
+
if (e.key === 'ArrowLeft') onPrev();
|
|
46
|
+
if (e.key === 'ArrowRight') onNext();
|
|
47
|
+
if (e.key === 'Escape') onClose();
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
window.addEventListener('keydown', handleKeyDown);
|
|
51
|
+
return () => window.removeEventListener('keydown', handleKeyDown);
|
|
52
|
+
}, [enableKeyboardNav, onPrev, onNext, onClose]);
|
|
53
|
+
|
|
54
|
+
if (!show) return null;
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<>
|
|
58
|
+
<Button
|
|
59
|
+
iconOnly
|
|
60
|
+
size="md"
|
|
61
|
+
variant="ghost"
|
|
62
|
+
rounded
|
|
63
|
+
onClick={onPrev}
|
|
64
|
+
disabled={currentIndex === 0}
|
|
65
|
+
aria-label="Previous image"
|
|
66
|
+
className="c-photo-viewer__nav-button c-photo-viewer__nav-button--prev"
|
|
67
|
+
icon={<Icon name="CaretLeft" size="md" />}
|
|
68
|
+
/>
|
|
69
|
+
|
|
70
|
+
<Button
|
|
71
|
+
iconOnly
|
|
72
|
+
size="md"
|
|
73
|
+
variant="ghost"
|
|
74
|
+
rounded
|
|
75
|
+
onClick={onNext}
|
|
76
|
+
disabled={currentIndex === imagesLength - 1}
|
|
77
|
+
aria-label="Next image"
|
|
78
|
+
className="c-photo-viewer__nav-button c-photo-viewer__nav-button--next"
|
|
79
|
+
icon={<Icon name="CaretRight" size="md" />}
|
|
80
|
+
/>
|
|
81
|
+
</>
|
|
82
|
+
);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export default PhotoViewerNavigation;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ImageType } from '../../lib/types/components';
|
|
3
|
+
import { Button } from '../Button/Button';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Props for the PhotoViewerThumbnails component
|
|
7
|
+
*/
|
|
8
|
+
export interface PhotoViewerThumbnailsProps {
|
|
9
|
+
/** Array of images to display thumbnails for */
|
|
10
|
+
images: ImageType[];
|
|
11
|
+
/** Current active image index */
|
|
12
|
+
currentIndex: number;
|
|
13
|
+
/** Callback to navigate to a specific image */
|
|
14
|
+
goToImage: (index: number) => void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* PhotoViewerThumbnails component - displays thumbnail navigation for images
|
|
19
|
+
*
|
|
20
|
+
* @param props - PhotoViewerThumbnailsProps
|
|
21
|
+
* @returns JSX.Element
|
|
22
|
+
*/
|
|
23
|
+
export const PhotoViewerThumbnails: React.FC<PhotoViewerThumbnailsProps> = ({
|
|
24
|
+
images,
|
|
25
|
+
currentIndex,
|
|
26
|
+
goToImage,
|
|
27
|
+
}) => {
|
|
28
|
+
if (images.length <= 1) return null;
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<div className="c-photo-viewer__thumbnails">
|
|
32
|
+
<div className="c-photo-viewer__thumbnails-container">
|
|
33
|
+
{images.map((image: ImageType, index: number) => {
|
|
34
|
+
const thumbnailSrc = image.thumbnail || image.src;
|
|
35
|
+
const isActive = index === currentIndex;
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<Button
|
|
39
|
+
key={index}
|
|
40
|
+
variant="ghost"
|
|
41
|
+
className={`c-photo-viewer__thumbnail ${isActive ? 'is-active' : ''}`}
|
|
42
|
+
onClick={() => goToImage(index)}
|
|
43
|
+
aria-label={`View image ${index + 1}${image.title ? `: ${image.title}` : ''}`}
|
|
44
|
+
aria-current={isActive}
|
|
45
|
+
>
|
|
46
|
+
<div className="c-photo-viewer__thumbnail-wrapper">
|
|
47
|
+
<img
|
|
48
|
+
loading="lazy"
|
|
49
|
+
src={thumbnailSrc}
|
|
50
|
+
alt={image.alt || `Thumbnail ${index + 1}`}
|
|
51
|
+
className="c-photo-viewer__thumbnail-img"
|
|
52
|
+
/>
|
|
53
|
+
{isActive && <div className="c-photo-viewer__thumbnail-indicator" />}
|
|
54
|
+
</div>
|
|
55
|
+
</Button>
|
|
56
|
+
);
|
|
57
|
+
})}
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export default PhotoViewerThumbnails;
|