tekivex-ui 2.5.15 → 2.6.0
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/dist/charts.cjs +1 -1
- package/dist/charts.js +22 -553
- package/dist/chunk-B3ph66Zb.js +1 -0
- package/dist/chunk-Bc16rJT-.js +1 -0
- package/dist/chunk-Dike2DLU.js +3 -0
- package/dist/chunk-DjxOP8W4.js +1 -0
- package/dist/chunk-DkoFTL1O.js +1 -0
- package/dist/chunk-DmRB1Blb.js +1 -0
- package/dist/chunk-DnCXUUx5.js +1 -0
- package/dist/chunk-LWkKqC8d.js +1 -0
- package/dist/chunk-PJ50l0JC.js +1 -0
- package/dist/headless.cjs +1 -1
- package/dist/headless.js +1 -442
- package/dist/i18n.cjs +1 -1
- package/dist/i18n.js +1 -733
- package/dist/index.cjs +1 -152
- package/dist/index.d.ts +4 -2
- package/dist/index.js +429 -16786
- package/dist/quantum.cjs +1 -89
- package/dist/quantum.js +74 -2551
- package/dist/realtime.cjs +1 -23
- package/dist/realtime.js +1 -804
- package/dist/src/a11y/index.d.ts +0 -1
- package/dist/src/charts/TkxAreaChart.d.ts +0 -5
- package/dist/src/charts/TkxBarChart.d.ts +0 -3
- package/dist/src/charts/TkxDonutChart.d.ts +0 -5
- package/dist/src/charts/TkxLineChart.d.ts +0 -1
- package/dist/src/charts/TkxPieChart.d.ts +0 -3
- package/dist/src/charts/TkxRadarChart.d.ts +0 -3
- package/dist/src/charts/TkxScatterChart.d.ts +0 -2
- package/dist/src/charts/index.d.ts +0 -1
- package/dist/src/charts/shared.d.ts +0 -3
- package/dist/src/components/TkxAIChatBubble.d.ts +0 -9
- package/dist/src/components/TkxAIConfidenceBar.d.ts +0 -6
- package/dist/src/components/TkxAIThinking.d.ts +0 -6
- package/dist/src/components/TkxAccordion.d.ts +0 -1
- package/dist/src/components/TkxAffix.d.ts +0 -1
- package/dist/src/components/TkxAlert.d.ts +0 -1
- package/dist/src/components/TkxAnchor.d.ts +0 -1
- package/dist/src/components/TkxAppBar.d.ts +0 -1
- package/dist/src/components/TkxAutocomplete.d.ts +0 -1
- package/dist/src/components/TkxAvatar.d.ts +0 -1
- package/dist/src/components/TkxBadge.d.ts +0 -1
- package/dist/src/components/TkxBottomNav.d.ts +0 -1
- package/dist/src/components/TkxBreadcrumb.d.ts +0 -1
- package/dist/src/components/TkxButton.d.ts +0 -1
- package/dist/src/components/TkxCard.d.ts +0 -1
- package/dist/src/components/TkxCarousel.d.ts +0 -1
- package/dist/src/components/TkxCascader.d.ts +0 -1
- package/dist/src/components/TkxChat.d.ts +0 -1
- package/dist/src/components/TkxCheckbox.d.ts +0 -1
- package/dist/src/components/TkxClock.d.ts +0 -1
- package/dist/src/components/TkxColorPicker.d.ts +0 -1
- package/dist/src/components/TkxCommand.d.ts +0 -1
- package/dist/src/components/TkxConfigProvider.d.ts +0 -30
- package/dist/src/components/TkxDataGrid.d.ts +0 -15
- package/dist/src/components/TkxDatePicker.d.ts +0 -1
- package/dist/src/components/TkxDivider.d.ts +0 -1
- package/dist/src/components/TkxDrawer.d.ts +0 -1
- package/dist/src/components/TkxDropdown.d.ts +0 -1
- package/dist/src/components/TkxEmpty.d.ts +0 -1
- package/dist/src/components/TkxFileUpload.d.ts +0 -1
- package/dist/src/components/TkxForm.d.ts +0 -35
- package/dist/src/components/TkxIcon.d.ts +0 -1
- package/dist/src/components/TkxImage.d.ts +0 -1
- package/dist/src/components/TkxInput.d.ts +1 -1
- package/dist/src/components/TkxLayout.d.ts +0 -22
- package/dist/src/components/TkxList.d.ts +0 -1
- package/dist/src/components/TkxLiveFeed.d.ts +0 -1
- package/dist/src/components/TkxLiveLog.d.ts +0 -1
- package/dist/src/components/TkxLiveMetrics.d.ts +0 -1
- package/dist/src/components/TkxLogo.d.ts +0 -1
- package/dist/src/components/TkxMarkdown.d.ts +0 -10
- package/dist/src/components/TkxMasonry.d.ts +0 -1
- package/dist/src/components/TkxMentions.d.ts +0 -1
- package/dist/src/components/TkxMenu.d.ts +0 -1
- package/dist/src/components/TkxModal.d.ts +0 -1
- package/dist/src/components/TkxNumberInput.d.ts +0 -1
- package/dist/src/components/TkxOTP.d.ts +0 -1
- package/dist/src/components/TkxOrgChart.d.ts +32 -0
- package/dist/src/components/TkxPagination.d.ts +0 -1
- package/dist/src/components/TkxPlayground.d.ts +0 -13
- package/dist/src/components/TkxPopover.d.ts +0 -1
- package/dist/src/components/TkxProgress.d.ts +0 -1
- package/dist/src/components/TkxQRCode.d.ts +0 -1
- package/dist/src/components/TkxQuantumForm.d.ts +0 -1
- package/dist/src/components/TkxRadio.d.ts +0 -1
- package/dist/src/components/TkxRating.d.ts +0 -1
- package/dist/src/components/TkxRealTimeChart.d.ts +0 -1
- package/dist/src/components/TkxResult.d.ts +0 -1
- package/dist/src/components/TkxRichTextDisplay.d.ts +0 -1
- package/dist/src/components/TkxSegmented.d.ts +0 -1
- package/dist/src/components/TkxSelect.d.ts +0 -3
- package/dist/src/components/TkxSkeleton.d.ts +0 -1
- package/dist/src/components/TkxSlider.d.ts +0 -1
- package/dist/src/components/TkxSnackbar.d.ts +0 -1
- package/dist/src/components/TkxSpeedDial.d.ts +0 -1
- package/dist/src/components/TkxSpin.d.ts +0 -1
- package/dist/src/components/TkxStatistic.d.ts +0 -1
- package/dist/src/components/TkxStepper.d.ts +0 -1
- package/dist/src/components/TkxTable.d.ts +0 -1
- package/dist/src/components/TkxTabs.d.ts +0 -1
- package/dist/src/components/TkxTag.d.ts +0 -1
- package/dist/src/components/TkxThemeBuilder.d.ts +0 -1
- package/dist/src/components/TkxTimeline.d.ts +0 -1
- package/dist/src/components/TkxToast.d.ts +0 -1
- package/dist/src/components/TkxToggle.d.ts +0 -1
- package/dist/src/components/TkxToolbar.d.ts +0 -1
- package/dist/src/components/TkxTooltip.d.ts +0 -1
- package/dist/src/components/TkxTour.d.ts +0 -1
- package/dist/src/components/TkxTransferList.d.ts +0 -1
- package/dist/src/components/TkxTreeView.d.ts +0 -1
- package/dist/src/components/TkxTypography.d.ts +0 -1
- package/dist/src/components/TkxVideoPlayer.d.ts +0 -1
- package/dist/src/components/TkxWatermark.d.ts +0 -1
- package/dist/src/components/index.d.ts +1 -1
- package/dist/src/engine/css.d.ts +0 -1
- package/dist/src/engine/index.d.ts +0 -1
- package/dist/src/engine/quantum-ai.d.ts +0 -73
- package/dist/src/engine/quantum.d.ts +0 -1
- package/dist/src/engine/security.d.ts +45 -9
- package/dist/src/engine/tkx.d.ts +0 -53
- package/dist/src/engine/wcag.d.ts +0 -1
- package/dist/src/headless/index.d.ts +0 -1
- package/dist/src/headless/useControllable.d.ts +0 -15
- package/dist/src/headless/useDebounce.d.ts +0 -12
- package/dist/src/headless/useDisclosure.d.ts +0 -13
- package/dist/src/headless/useFormState.d.ts +0 -13
- package/dist/src/headless/useInfiniteQuery.d.ts +0 -11
- package/dist/src/headless/useIntersectionObserver.d.ts +0 -10
- package/dist/src/headless/useListSelection.d.ts +0 -9
- package/dist/src/headless/useLocalStorage.d.ts +0 -8
- package/dist/src/headless/useMediaQuery.d.ts +0 -10
- package/dist/src/headless/useRovingTabIndex.d.ts +0 -15
- package/dist/src/headless/useSSE.d.ts +0 -9
- package/dist/src/headless/useThrottle.d.ts +0 -7
- package/dist/src/headless/useWebSocket.d.ts +0 -9
- package/dist/src/hooks/index.d.ts +0 -1
- package/dist/src/i18n/I18nProvider.d.ts +0 -1
- package/dist/src/i18n/index.d.ts +0 -1
- package/dist/src/quantum/index.d.ts +0 -1
- package/dist/src/realtime/index.d.ts +0 -1
- package/dist/src/themes/index.d.ts +0 -1
- package/package.json +5 -3
- package/dist/TkxForm-BaO4wvXt.js +0 -320
- package/dist/TkxForm-M6ttomry.cjs +0 -12
- package/dist/chunk-Bmb41Sf3.cjs +0 -1
- package/dist/hooks-6pRsPOyG.js +0 -58
- package/dist/hooks-mivgRljH.cjs +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/src/a11y/index.d.ts.map +0 -1
- package/dist/src/charts/TkxAreaChart.d.ts.map +0 -1
- package/dist/src/charts/TkxBarChart.d.ts.map +0 -1
- package/dist/src/charts/TkxDonutChart.d.ts.map +0 -1
- package/dist/src/charts/TkxLineChart.d.ts.map +0 -1
- package/dist/src/charts/TkxPieChart.d.ts.map +0 -1
- package/dist/src/charts/TkxRadarChart.d.ts.map +0 -1
- package/dist/src/charts/TkxScatterChart.d.ts.map +0 -1
- package/dist/src/charts/index.d.ts.map +0 -1
- package/dist/src/charts/shared.d.ts.map +0 -1
- package/dist/src/components/TkxAIChatBubble.d.ts.map +0 -1
- package/dist/src/components/TkxAIConfidenceBar.d.ts.map +0 -1
- package/dist/src/components/TkxAIThinking.d.ts.map +0 -1
- package/dist/src/components/TkxAccordion.d.ts.map +0 -1
- package/dist/src/components/TkxAffix.d.ts.map +0 -1
- package/dist/src/components/TkxAlert.d.ts.map +0 -1
- package/dist/src/components/TkxAnchor.d.ts.map +0 -1
- package/dist/src/components/TkxAppBar.d.ts.map +0 -1
- package/dist/src/components/TkxAutocomplete.d.ts.map +0 -1
- package/dist/src/components/TkxAvatar.d.ts.map +0 -1
- package/dist/src/components/TkxBadge.d.ts.map +0 -1
- package/dist/src/components/TkxBottomNav.d.ts.map +0 -1
- package/dist/src/components/TkxBreadcrumb.d.ts.map +0 -1
- package/dist/src/components/TkxButton.d.ts.map +0 -1
- package/dist/src/components/TkxCard.d.ts.map +0 -1
- package/dist/src/components/TkxCarousel.d.ts.map +0 -1
- package/dist/src/components/TkxCascader.d.ts.map +0 -1
- package/dist/src/components/TkxChat.d.ts.map +0 -1
- package/dist/src/components/TkxCheckbox.d.ts.map +0 -1
- package/dist/src/components/TkxClock.d.ts.map +0 -1
- package/dist/src/components/TkxColorPicker.d.ts.map +0 -1
- package/dist/src/components/TkxCommand.d.ts.map +0 -1
- package/dist/src/components/TkxConfigProvider.d.ts.map +0 -1
- package/dist/src/components/TkxDataGrid.d.ts.map +0 -1
- package/dist/src/components/TkxDatePicker.d.ts.map +0 -1
- package/dist/src/components/TkxDivider.d.ts.map +0 -1
- package/dist/src/components/TkxDrawer.d.ts.map +0 -1
- package/dist/src/components/TkxDropdown.d.ts.map +0 -1
- package/dist/src/components/TkxEmpty.d.ts.map +0 -1
- package/dist/src/components/TkxFileUpload.d.ts.map +0 -1
- package/dist/src/components/TkxForm.d.ts.map +0 -1
- package/dist/src/components/TkxIcon.d.ts.map +0 -1
- package/dist/src/components/TkxImage.d.ts.map +0 -1
- package/dist/src/components/TkxInput.d.ts.map +0 -1
- package/dist/src/components/TkxLayout.d.ts.map +0 -1
- package/dist/src/components/TkxList.d.ts.map +0 -1
- package/dist/src/components/TkxLiveFeed.d.ts.map +0 -1
- package/dist/src/components/TkxLiveLog.d.ts.map +0 -1
- package/dist/src/components/TkxLiveMetrics.d.ts.map +0 -1
- package/dist/src/components/TkxLogo.d.ts.map +0 -1
- package/dist/src/components/TkxMarkdown.d.ts.map +0 -1
- package/dist/src/components/TkxMasonry.d.ts.map +0 -1
- package/dist/src/components/TkxMentions.d.ts.map +0 -1
- package/dist/src/components/TkxMenu.d.ts.map +0 -1
- package/dist/src/components/TkxModal.d.ts.map +0 -1
- package/dist/src/components/TkxNumberInput.d.ts.map +0 -1
- package/dist/src/components/TkxOTP.d.ts.map +0 -1
- package/dist/src/components/TkxPagination.d.ts.map +0 -1
- package/dist/src/components/TkxPlayground.d.ts.map +0 -1
- package/dist/src/components/TkxPopover.d.ts.map +0 -1
- package/dist/src/components/TkxProgress.d.ts.map +0 -1
- package/dist/src/components/TkxQRCode.d.ts.map +0 -1
- package/dist/src/components/TkxQuantumForm.d.ts.map +0 -1
- package/dist/src/components/TkxRadio.d.ts.map +0 -1
- package/dist/src/components/TkxRating.d.ts.map +0 -1
- package/dist/src/components/TkxRealTimeChart.d.ts.map +0 -1
- package/dist/src/components/TkxResult.d.ts.map +0 -1
- package/dist/src/components/TkxRichTextDisplay.d.ts.map +0 -1
- package/dist/src/components/TkxSegmented.d.ts.map +0 -1
- package/dist/src/components/TkxSelect.d.ts.map +0 -1
- package/dist/src/components/TkxSkeleton.d.ts.map +0 -1
- package/dist/src/components/TkxSlider.d.ts.map +0 -1
- package/dist/src/components/TkxSnackbar.d.ts.map +0 -1
- package/dist/src/components/TkxSpeedDial.d.ts.map +0 -1
- package/dist/src/components/TkxSpin.d.ts.map +0 -1
- package/dist/src/components/TkxStatistic.d.ts.map +0 -1
- package/dist/src/components/TkxStepper.d.ts.map +0 -1
- package/dist/src/components/TkxTable.d.ts.map +0 -1
- package/dist/src/components/TkxTabs.d.ts.map +0 -1
- package/dist/src/components/TkxTag.d.ts.map +0 -1
- package/dist/src/components/TkxThemeBuilder.d.ts.map +0 -1
- package/dist/src/components/TkxTimeline.d.ts.map +0 -1
- package/dist/src/components/TkxToast.d.ts.map +0 -1
- package/dist/src/components/TkxToggle.d.ts.map +0 -1
- package/dist/src/components/TkxToolbar.d.ts.map +0 -1
- package/dist/src/components/TkxTooltip.d.ts.map +0 -1
- package/dist/src/components/TkxTour.d.ts.map +0 -1
- package/dist/src/components/TkxTransferList.d.ts.map +0 -1
- package/dist/src/components/TkxTreeView.d.ts.map +0 -1
- package/dist/src/components/TkxTypography.d.ts.map +0 -1
- package/dist/src/components/TkxVideoPlayer.d.ts.map +0 -1
- package/dist/src/components/TkxWatermark.d.ts.map +0 -1
- package/dist/src/components/index.d.ts.map +0 -1
- package/dist/src/engine/css.d.ts.map +0 -1
- package/dist/src/engine/index.d.ts.map +0 -1
- package/dist/src/engine/quantum-ai.d.ts.map +0 -1
- package/dist/src/engine/quantum.d.ts.map +0 -1
- package/dist/src/engine/security.d.ts.map +0 -1
- package/dist/src/engine/tkx.d.ts.map +0 -1
- package/dist/src/engine/wcag.d.ts.map +0 -1
- package/dist/src/headless/index.d.ts.map +0 -1
- package/dist/src/headless/useControllable.d.ts.map +0 -1
- package/dist/src/headless/useDebounce.d.ts.map +0 -1
- package/dist/src/headless/useDisclosure.d.ts.map +0 -1
- package/dist/src/headless/useFormState.d.ts.map +0 -1
- package/dist/src/headless/useInfiniteQuery.d.ts.map +0 -1
- package/dist/src/headless/useIntersectionObserver.d.ts.map +0 -1
- package/dist/src/headless/useListSelection.d.ts.map +0 -1
- package/dist/src/headless/useLocalStorage.d.ts.map +0 -1
- package/dist/src/headless/useMediaQuery.d.ts.map +0 -1
- package/dist/src/headless/useRovingTabIndex.d.ts.map +0 -1
- package/dist/src/headless/useSSE.d.ts.map +0 -1
- package/dist/src/headless/useThrottle.d.ts.map +0 -1
- package/dist/src/headless/useWebSocket.d.ts.map +0 -1
- package/dist/src/hooks/index.d.ts.map +0 -1
- package/dist/src/i18n/I18nProvider.d.ts.map +0 -1
- package/dist/src/i18n/index.d.ts.map +0 -1
- package/dist/src/quantum/index.d.ts.map +0 -1
- package/dist/src/realtime/index.d.ts.map +0 -1
- package/dist/src/themes/index.d.ts.map +0 -1
- package/dist/themes-BbJanqiC.js +0 -498
- package/dist/themes-CMq2vWXj.cjs +0 -2
- package/dist/tkx-BoP5V5zy.cjs +0 -4
- package/dist/tkx-mOKMzvUK.js +0 -1174
- package/src/a11y/index.tsx +0 -87
- package/src/charts/TkxAreaChart.tsx +0 -121
- package/src/charts/TkxBarChart.tsx +0 -117
- package/src/charts/TkxDonutChart.tsx +0 -164
- package/src/charts/TkxLineChart.tsx +0 -137
- package/src/charts/TkxPieChart.tsx +0 -103
- package/src/charts/TkxRadarChart.tsx +0 -92
- package/src/charts/TkxScatterChart.tsx +0 -104
- package/src/charts/index.ts +0 -22
- package/src/charts/shared.ts +0 -47
- package/src/components/TkxAIChatBubble.tsx +0 -256
- package/src/components/TkxAIConfidenceBar.tsx +0 -133
- package/src/components/TkxAIThinking.tsx +0 -193
- package/src/components/TkxAccordion.tsx +0 -590
- package/src/components/TkxAffix.tsx +0 -140
- package/src/components/TkxAlert.tsx +0 -94
- package/src/components/TkxAnchor.tsx +0 -195
- package/src/components/TkxAppBar.tsx +0 -262
- package/src/components/TkxAutocomplete.tsx +0 -455
- package/src/components/TkxAvatar.tsx +0 -103
- package/src/components/TkxBadge.tsx +0 -75
- package/src/components/TkxBottomNav.tsx +0 -241
- package/src/components/TkxBreadcrumb.tsx +0 -324
- package/src/components/TkxButton.tsx +0 -155
- package/src/components/TkxCard.tsx +0 -96
- package/src/components/TkxCarousel.tsx +0 -554
- package/src/components/TkxCascader.tsx +0 -278
- package/src/components/TkxChat.tsx +0 -356
- package/src/components/TkxCheckbox.tsx +0 -220
- package/src/components/TkxClock.tsx +0 -603
- package/src/components/TkxColorPicker.tsx +0 -635
- package/src/components/TkxCommand.tsx +0 -646
- package/src/components/TkxConfigProvider.tsx +0 -460
- package/src/components/TkxDataGrid.tsx +0 -941
- package/src/components/TkxDatePicker.tsx +0 -1625
- package/src/components/TkxDivider.tsx +0 -51
- package/src/components/TkxDrawer.tsx +0 -236
- package/src/components/TkxDropdown.tsx +0 -804
- package/src/components/TkxEmpty.tsx +0 -221
- package/src/components/TkxFileUpload.tsx +0 -373
- package/src/components/TkxForm.tsx +0 -683
- package/src/components/TkxIcon.tsx +0 -685
- package/src/components/TkxImage.tsx +0 -279
- package/src/components/TkxInput.tsx +0 -103
- package/src/components/TkxLayout.tsx +0 -649
- package/src/components/TkxList.tsx +0 -244
- package/src/components/TkxLiveFeed.tsx +0 -331
- package/src/components/TkxLiveLog.tsx +0 -472
- package/src/components/TkxLiveMetrics.tsx +0 -315
- package/src/components/TkxLogo.tsx +0 -299
- package/src/components/TkxMarkdown.tsx +0 -855
- package/src/components/TkxMasonry.tsx +0 -178
- package/src/components/TkxMentions.tsx +0 -212
- package/src/components/TkxMenu.tsx +0 -1044
- package/src/components/TkxModal.tsx +0 -122
- package/src/components/TkxNumberInput.tsx +0 -410
- package/src/components/TkxOTP.tsx +0 -297
- package/src/components/TkxPagination.tsx +0 -390
- package/src/components/TkxPlayground.tsx +0 -845
- package/src/components/TkxPopover.tsx +0 -297
- package/src/components/TkxProgress.tsx +0 -114
- package/src/components/TkxQRCode.tsx +0 -176
- package/src/components/TkxQuantumForm.tsx +0 -594
- package/src/components/TkxRadio.tsx +0 -286
- package/src/components/TkxRating.tsx +0 -288
- package/src/components/TkxRealTimeChart.tsx +0 -383
- package/src/components/TkxResult.tsx +0 -130
- package/src/components/TkxRichTextDisplay.tsx +0 -396
- package/src/components/TkxSegmented.tsx +0 -171
- package/src/components/TkxSelect.tsx +0 -1130
- package/src/components/TkxSkeleton.tsx +0 -107
- package/src/components/TkxSlider.tsx +0 -495
- package/src/components/TkxSnackbar.tsx +0 -316
- package/src/components/TkxSpeedDial.tsx +0 -397
- package/src/components/TkxSpin.tsx +0 -263
- package/src/components/TkxStatistic.tsx +0 -263
- package/src/components/TkxStepper.tsx +0 -487
- package/src/components/TkxTable.tsx +0 -424
- package/src/components/TkxTabs.tsx +0 -126
- package/src/components/TkxTag.tsx +0 -321
- package/src/components/TkxThemeBuilder.tsx +0 -687
- package/src/components/TkxTimeline.tsx +0 -305
- package/src/components/TkxToast.tsx +0 -287
- package/src/components/TkxToggle.tsx +0 -95
- package/src/components/TkxToolbar.tsx +0 -262
- package/src/components/TkxTooltip.tsx +0 -85
- package/src/components/TkxTour.tsx +0 -241
- package/src/components/TkxTransferList.tsx +0 -489
- package/src/components/TkxTreeView.tsx +0 -423
- package/src/components/TkxTypography.tsx +0 -267
- package/src/components/TkxVideoPlayer.tsx +0 -1015
- package/src/components/TkxWatermark.tsx +0 -145
- package/src/components/index.ts +0 -80
- package/src/engine/css.ts +0 -126
- package/src/engine/index.ts +0 -12
- package/src/engine/quantum-ai.ts +0 -1045
- package/src/engine/quantum.ts +0 -207
- package/src/engine/security.ts +0 -232
- package/src/engine/tkx.ts +0 -1084
- package/src/engine/wcag.ts +0 -276
- package/src/headless/index.ts +0 -52
- package/src/headless/useControllable.ts +0 -42
- package/src/headless/useDebounce.ts +0 -37
- package/src/headless/useDisclosure.ts +0 -30
- package/src/headless/useFormState.ts +0 -113
- package/src/headless/useInfiniteQuery.ts +0 -155
- package/src/headless/useIntersectionObserver.ts +0 -53
- package/src/headless/useListSelection.ts +0 -103
- package/src/headless/useLocalStorage.ts +0 -48
- package/src/headless/useMediaQuery.ts +0 -39
- package/src/headless/useRovingTabIndex.ts +0 -86
- package/src/headless/useSSE.ts +0 -167
- package/src/headless/useThrottle.ts +0 -48
- package/src/headless/useWebSocket.ts +0 -231
- package/src/hooks/index.ts +0 -122
- package/src/i18n/I18nProvider.tsx +0 -36
- package/src/i18n/index.ts +0 -877
- package/src/quantum/index.ts +0 -39
- package/src/realtime/index.ts +0 -21
- package/src/styles/global.css +0 -167
- package/src/themes/index.ts +0 -294
|
@@ -1,554 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
useState,
|
|
5
|
-
useRef,
|
|
6
|
-
useEffect,
|
|
7
|
-
useCallback,
|
|
8
|
-
useId,
|
|
9
|
-
type CSSProperties,
|
|
10
|
-
type ReactNode,
|
|
11
|
-
type TouchEvent,
|
|
12
|
-
type MouseEvent as ReactMouseEvent,
|
|
13
|
-
} from 'react';
|
|
14
|
-
import { useTheme } from '../themes';
|
|
15
|
-
import { tkx, cx } from '../engine/tkx';
|
|
16
|
-
import { useReducedMotion } from '../hooks';
|
|
17
|
-
|
|
18
|
-
// ── Types ─────────────────────────────────────────────────────────────────────
|
|
19
|
-
|
|
20
|
-
export interface CarouselSlide {
|
|
21
|
-
id: string;
|
|
22
|
-
content: ReactNode;
|
|
23
|
-
thumbnail?: string;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface TkxCarouselProps {
|
|
27
|
-
slides: CarouselSlide[];
|
|
28
|
-
autoPlay?: boolean;
|
|
29
|
-
autoPlayInterval?: number;
|
|
30
|
-
pauseOnHover?: boolean;
|
|
31
|
-
loop?: boolean;
|
|
32
|
-
showArrows?: boolean;
|
|
33
|
-
showDots?: boolean;
|
|
34
|
-
showThumbnails?: boolean;
|
|
35
|
-
orientation?: 'horizontal' | 'vertical';
|
|
36
|
-
slidesToShow?: number;
|
|
37
|
-
gap?: number;
|
|
38
|
-
transitionDuration?: number;
|
|
39
|
-
swipeable?: boolean;
|
|
40
|
-
initialIndex?: number;
|
|
41
|
-
onChange?: (index: number) => void;
|
|
42
|
-
arrowPosition?: 'inside' | 'outside';
|
|
43
|
-
height?: string | number;
|
|
44
|
-
className?: string;
|
|
45
|
-
style?: CSSProperties;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// ── Arrow button ──────────────────────────────────────────────────────────────
|
|
49
|
-
|
|
50
|
-
interface ArrowBtnProps {
|
|
51
|
-
direction: 'prev' | 'next';
|
|
52
|
-
onClick: () => void;
|
|
53
|
-
isDisabled: boolean;
|
|
54
|
-
primaryColor: string;
|
|
55
|
-
position: 'inside' | 'outside';
|
|
56
|
-
orientation: 'horizontal' | 'vertical';
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function ArrowBtn({ direction, onClick, isDisabled, primaryColor, position, orientation }: ArrowBtnProps) {
|
|
60
|
-
const isVertical = orientation === 'vertical';
|
|
61
|
-
const isPrev = direction === 'prev';
|
|
62
|
-
|
|
63
|
-
const posStyle: CSSProperties = position === 'inside'
|
|
64
|
-
? {
|
|
65
|
-
position: 'absolute',
|
|
66
|
-
zIndex: 3,
|
|
67
|
-
...(isVertical
|
|
68
|
-
? { [isPrev ? 'top' : 'bottom']: 10, left: '50%', transform: 'translateX(-50%)' }
|
|
69
|
-
: { [isPrev ? 'left' : 'right']: 10, top: '50%', transform: 'translateY(-50%)' }),
|
|
70
|
-
}
|
|
71
|
-
: {
|
|
72
|
-
flexShrink: 0,
|
|
73
|
-
position: 'relative',
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
return (
|
|
77
|
-
<button
|
|
78
|
-
type="button"
|
|
79
|
-
aria-label={isPrev ? 'Previous slide' : 'Next slide'}
|
|
80
|
-
disabled={isDisabled}
|
|
81
|
-
onClick={onClick}
|
|
82
|
-
style={{
|
|
83
|
-
...posStyle,
|
|
84
|
-
width: 36,
|
|
85
|
-
height: 36,
|
|
86
|
-
borderRadius: '50%',
|
|
87
|
-
border: 'none',
|
|
88
|
-
backgroundColor: 'rgba(0,0,0,0.45)',
|
|
89
|
-
backdropFilter: 'blur(4px)',
|
|
90
|
-
color: '#fff',
|
|
91
|
-
display: 'flex',
|
|
92
|
-
alignItems: 'center',
|
|
93
|
-
justifyContent: 'center',
|
|
94
|
-
cursor: isDisabled ? 'not-allowed' : 'pointer',
|
|
95
|
-
opacity: isDisabled ? 0.35 : 1,
|
|
96
|
-
transition: 'background 150ms ease, opacity 150ms ease',
|
|
97
|
-
outline: 'none',
|
|
98
|
-
}}
|
|
99
|
-
onFocus={(e) => { (e.currentTarget as HTMLElement).style.boxShadow = `0 0 0 3px ${primaryColor}55`; }}
|
|
100
|
-
onBlur={(e) => { (e.currentTarget as HTMLElement).style.boxShadow = 'none'; }}
|
|
101
|
-
onMouseEnter={(e) => { if (!isDisabled) (e.currentTarget as HTMLElement).style.backgroundColor = 'rgba(0,0,0,0.65)'; }}
|
|
102
|
-
onMouseLeave={(e) => { (e.currentTarget as HTMLElement).style.backgroundColor = 'rgba(0,0,0,0.45)'; }}
|
|
103
|
-
>
|
|
104
|
-
{isVertical ? (
|
|
105
|
-
isPrev ? (
|
|
106
|
-
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={2.5} aria-hidden="true">
|
|
107
|
-
<polyline points="18 15 12 9 6 15" />
|
|
108
|
-
</svg>
|
|
109
|
-
) : (
|
|
110
|
-
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={2.5} aria-hidden="true">
|
|
111
|
-
<polyline points="6 9 12 15 18 9" />
|
|
112
|
-
</svg>
|
|
113
|
-
)
|
|
114
|
-
) : isPrev ? (
|
|
115
|
-
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={2.5} aria-hidden="true">
|
|
116
|
-
<polyline points="15 18 9 12 15 6" />
|
|
117
|
-
</svg>
|
|
118
|
-
) : (
|
|
119
|
-
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={2.5} aria-hidden="true">
|
|
120
|
-
<polyline points="9 18 15 12 9 6" />
|
|
121
|
-
</svg>
|
|
122
|
-
)}
|
|
123
|
-
</button>
|
|
124
|
-
);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// ── Main component ────────────────────────────────────────────────────────────
|
|
128
|
-
|
|
129
|
-
export function TkxCarousel({
|
|
130
|
-
slides,
|
|
131
|
-
autoPlay = false,
|
|
132
|
-
autoPlayInterval = 4000,
|
|
133
|
-
pauseOnHover = true,
|
|
134
|
-
loop = true,
|
|
135
|
-
showArrows = true,
|
|
136
|
-
showDots = true,
|
|
137
|
-
showThumbnails = false,
|
|
138
|
-
orientation = 'horizontal',
|
|
139
|
-
slidesToShow = 1,
|
|
140
|
-
gap = 0,
|
|
141
|
-
transitionDuration = 400,
|
|
142
|
-
swipeable = true,
|
|
143
|
-
initialIndex = 0,
|
|
144
|
-
onChange,
|
|
145
|
-
arrowPosition = 'inside',
|
|
146
|
-
height = 320,
|
|
147
|
-
className,
|
|
148
|
-
style,
|
|
149
|
-
}: TkxCarouselProps) {
|
|
150
|
-
const theme = useTheme();
|
|
151
|
-
const reducedMotion = useReducedMotion();
|
|
152
|
-
const carouselId = useId();
|
|
153
|
-
|
|
154
|
-
const count = slides.length;
|
|
155
|
-
|
|
156
|
-
// ── Index state ──────────────────────────────────────────────────────────
|
|
157
|
-
// When loop=true we clone first & last slides → real slides are at indices 1..count
|
|
158
|
-
// displayed index is the "real" index (0-based, 0..count-1)
|
|
159
|
-
const [currentIdx, setCurrentIdx] = useState(initialIndex);
|
|
160
|
-
// internal track index (for cloned-slide loop trick)
|
|
161
|
-
const [trackIdx, setTrackIdx] = useState(loop ? initialIndex + 1 : initialIndex);
|
|
162
|
-
const [isTransitioning, setIsTransitioning] = useState(false);
|
|
163
|
-
const [paused, setPaused] = useState(false);
|
|
164
|
-
|
|
165
|
-
const trackRef = useRef<HTMLDivElement>(null);
|
|
166
|
-
const autoPlayRef = useRef<ReturnType<typeof setInterval> | null>(null);
|
|
167
|
-
|
|
168
|
-
// Drag / swipe state
|
|
169
|
-
const dragStartRef = useRef<number | null>(null);
|
|
170
|
-
const dragDeltaRef = useRef<number>(0);
|
|
171
|
-
const isDraggingRef = useRef(false);
|
|
172
|
-
|
|
173
|
-
const isVertical = orientation === 'vertical';
|
|
174
|
-
const actualDuration = reducedMotion ? 0 : transitionDuration;
|
|
175
|
-
|
|
176
|
-
// Slides to render (with optional clones for seamless loop)
|
|
177
|
-
const renderSlides: CarouselSlide[] = loop && count > 1
|
|
178
|
-
? [slides[count - 1], ...slides, slides[0]]
|
|
179
|
-
: slides;
|
|
180
|
-
|
|
181
|
-
const totalTracks = renderSlides.length;
|
|
182
|
-
|
|
183
|
-
// Compute transform for current trackIdx
|
|
184
|
-
const slideWidthPct = 100 / slidesToShow;
|
|
185
|
-
|
|
186
|
-
const getTransform = (idx: number, extra = 0) => {
|
|
187
|
-
const px = extra !== 0 ? ` - ${extra}px` : '';
|
|
188
|
-
if (isVertical) return `translateY(calc(-${idx * slideWidthPct}%${px}))`;
|
|
189
|
-
return `translateX(calc(-${idx * slideWidthPct}%${px}))`;
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
// Navigate to a real index
|
|
193
|
-
const goTo = useCallback((realIdx: number, skipTransition = false) => {
|
|
194
|
-
const clamped = loop
|
|
195
|
-
? ((realIdx % count) + count) % count
|
|
196
|
-
: Math.max(0, Math.min(count - 1, realIdx));
|
|
197
|
-
|
|
198
|
-
const newTrackIdx = loop ? clamped + 1 : clamped;
|
|
199
|
-
|
|
200
|
-
if (skipTransition && trackRef.current) {
|
|
201
|
-
trackRef.current.style.transition = 'none';
|
|
202
|
-
setTrackIdx(newTrackIdx);
|
|
203
|
-
setCurrentIdx(clamped);
|
|
204
|
-
// Force reflow
|
|
205
|
-
void trackRef.current.offsetHeight;
|
|
206
|
-
trackRef.current.style.transition = '';
|
|
207
|
-
} else {
|
|
208
|
-
setIsTransitioning(true);
|
|
209
|
-
setTrackIdx(newTrackIdx);
|
|
210
|
-
setCurrentIdx(clamped);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
onChange?.(clamped);
|
|
214
|
-
}, [count, loop, onChange]);
|
|
215
|
-
|
|
216
|
-
const prev = useCallback(() => goTo(currentIdx - 1), [currentIdx, goTo]);
|
|
217
|
-
const next = useCallback(() => goTo(currentIdx + 1), [currentIdx, goTo]);
|
|
218
|
-
|
|
219
|
-
// Handle seamless loop: after transition ends, snap without animation
|
|
220
|
-
const handleTransitionEnd = useCallback(() => {
|
|
221
|
-
setIsTransitioning(false);
|
|
222
|
-
if (!loop || count <= 1) return;
|
|
223
|
-
|
|
224
|
-
if (trackIdx === 0) {
|
|
225
|
-
// Was on cloned-last → snap to real last
|
|
226
|
-
goTo(count - 1, true);
|
|
227
|
-
} else if (trackIdx === totalTracks - 1) {
|
|
228
|
-
// Was on cloned-first → snap to real first
|
|
229
|
-
goTo(0, true);
|
|
230
|
-
}
|
|
231
|
-
}, [loop, count, trackIdx, totalTracks, goTo]);
|
|
232
|
-
|
|
233
|
-
// Auto-play
|
|
234
|
-
useEffect(() => {
|
|
235
|
-
if (!autoPlay || paused || count <= 1) return;
|
|
236
|
-
autoPlayRef.current = setInterval(next, autoPlayInterval);
|
|
237
|
-
return () => { if (autoPlayRef.current) clearInterval(autoPlayRef.current); };
|
|
238
|
-
}, [autoPlay, paused, autoPlayInterval, next, count]);
|
|
239
|
-
|
|
240
|
-
// Keyboard navigation
|
|
241
|
-
useEffect(() => {
|
|
242
|
-
const handler = (e: KeyboardEvent) => {
|
|
243
|
-
const focused = document.activeElement;
|
|
244
|
-
const container = document.getElementById(carouselId);
|
|
245
|
-
if (!container?.contains(focused as Node)) return;
|
|
246
|
-
|
|
247
|
-
if (e.key === (isVertical ? 'ArrowUp' : 'ArrowLeft')) { e.preventDefault(); prev(); }
|
|
248
|
-
if (e.key === (isVertical ? 'ArrowDown' : 'ArrowRight')) { e.preventDefault(); next(); }
|
|
249
|
-
};
|
|
250
|
-
document.addEventListener('keydown', handler);
|
|
251
|
-
return () => document.removeEventListener('keydown', handler);
|
|
252
|
-
}, [carouselId, isVertical, prev, next]);
|
|
253
|
-
|
|
254
|
-
// ── Swipe handling ────────────────────────────────────────────────────────
|
|
255
|
-
|
|
256
|
-
const getEventCoord = (e: TouchEvent | ReactMouseEvent): number => {
|
|
257
|
-
if ('touches' in e) {
|
|
258
|
-
return isVertical ? e.touches[0].clientY : e.touches[0].clientX;
|
|
259
|
-
}
|
|
260
|
-
return isVertical ? (e as ReactMouseEvent).clientY : (e as ReactMouseEvent).clientX;
|
|
261
|
-
};
|
|
262
|
-
|
|
263
|
-
const onDragStart = (e: TouchEvent | ReactMouseEvent) => {
|
|
264
|
-
if (!swipeable) return;
|
|
265
|
-
dragStartRef.current = getEventCoord(e);
|
|
266
|
-
dragDeltaRef.current = 0;
|
|
267
|
-
isDraggingRef.current = true;
|
|
268
|
-
};
|
|
269
|
-
|
|
270
|
-
const onDragMove = (e: TouchEvent | ReactMouseEvent) => {
|
|
271
|
-
if (!isDraggingRef.current || dragStartRef.current === null) return;
|
|
272
|
-
const delta = getEventCoord(e) - dragStartRef.current;
|
|
273
|
-
dragDeltaRef.current = delta;
|
|
274
|
-
// Live-drag offset
|
|
275
|
-
if (trackRef.current) {
|
|
276
|
-
trackRef.current.style.transition = 'none';
|
|
277
|
-
trackRef.current.style.transform = getTransform(trackIdx, -delta);
|
|
278
|
-
}
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
const onDragEnd = () => {
|
|
282
|
-
if (!isDraggingRef.current) return;
|
|
283
|
-
isDraggingRef.current = false;
|
|
284
|
-
|
|
285
|
-
const delta = dragDeltaRef.current;
|
|
286
|
-
const threshold = 50;
|
|
287
|
-
|
|
288
|
-
// Restore transition
|
|
289
|
-
if (trackRef.current) {
|
|
290
|
-
trackRef.current.style.transition = '';
|
|
291
|
-
trackRef.current.style.transform = '';
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
if (delta < -threshold) next();
|
|
295
|
-
else if (delta > threshold) prev();
|
|
296
|
-
else {
|
|
297
|
-
// Snap back
|
|
298
|
-
if (trackRef.current) {
|
|
299
|
-
trackRef.current.style.transform = getTransform(trackIdx);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
dragStartRef.current = null;
|
|
304
|
-
dragDeltaRef.current = 0;
|
|
305
|
-
};
|
|
306
|
-
|
|
307
|
-
// ── Sizing ────────────────────────────────────────────────────────────────
|
|
308
|
-
|
|
309
|
-
const heightVal = typeof height === 'number' ? `${height}px` : height;
|
|
310
|
-
|
|
311
|
-
const trackStyle: CSSProperties = {
|
|
312
|
-
display: 'flex',
|
|
313
|
-
flexDirection: isVertical ? 'column' : 'row',
|
|
314
|
-
width: isVertical ? '100%' : `${(totalTracks / slidesToShow) * 100}%`,
|
|
315
|
-
height: isVertical ? `${(totalTracks / slidesToShow) * 100}%` : '100%',
|
|
316
|
-
transform: getTransform(trackIdx),
|
|
317
|
-
transition: isTransitioning || !reducedMotion
|
|
318
|
-
? `transform ${actualDuration}ms cubic-bezier(0.4, 0, 0.2, 1)`
|
|
319
|
-
: 'none',
|
|
320
|
-
willChange: 'transform',
|
|
321
|
-
gap: gap > 0 ? gap : undefined,
|
|
322
|
-
};
|
|
323
|
-
|
|
324
|
-
const slideStyle: CSSProperties = {
|
|
325
|
-
flexShrink: 0,
|
|
326
|
-
width: isVertical ? '100%' : `${slideWidthPct / (totalTracks / slidesToShow)}%`,
|
|
327
|
-
height: isVertical ? `${slideWidthPct / (totalTracks / slidesToShow)}%` : '100%',
|
|
328
|
-
overflow: 'hidden',
|
|
329
|
-
position: 'relative',
|
|
330
|
-
};
|
|
331
|
-
|
|
332
|
-
const canPrev = loop || currentIdx > 0;
|
|
333
|
-
const canNext = loop || currentIdx < count - 1;
|
|
334
|
-
|
|
335
|
-
const outsideArrows = arrowPosition === 'outside';
|
|
336
|
-
|
|
337
|
-
return (
|
|
338
|
-
<div
|
|
339
|
-
id={carouselId}
|
|
340
|
-
className={cx(tkx('flex flex-col gap-2'), className)}
|
|
341
|
-
style={style}
|
|
342
|
-
aria-roledescription="carousel"
|
|
343
|
-
aria-label="Content carousel"
|
|
344
|
-
>
|
|
345
|
-
{/* Main carousel row */}
|
|
346
|
-
<div
|
|
347
|
-
className={tkx('flex items-center gap-2')}
|
|
348
|
-
style={{ gap: outsideArrows && showArrows ? 8 : 0 }}
|
|
349
|
-
>
|
|
350
|
-
{/* Outside prev arrow */}
|
|
351
|
-
{showArrows && outsideArrows && (
|
|
352
|
-
<ArrowBtn
|
|
353
|
-
direction="prev"
|
|
354
|
-
onClick={prev}
|
|
355
|
-
isDisabled={!canPrev}
|
|
356
|
-
primaryColor={theme.primary}
|
|
357
|
-
position="outside"
|
|
358
|
-
orientation={orientation}
|
|
359
|
-
/>
|
|
360
|
-
)}
|
|
361
|
-
|
|
362
|
-
{/* Viewport */}
|
|
363
|
-
<div
|
|
364
|
-
style={{
|
|
365
|
-
position: 'relative',
|
|
366
|
-
flex: 1,
|
|
367
|
-
overflow: 'hidden',
|
|
368
|
-
height: isVertical ? heightVal : heightVal,
|
|
369
|
-
borderRadius: 12,
|
|
370
|
-
cursor: swipeable ? (isDraggingRef.current ? 'grabbing' : 'grab') : 'default',
|
|
371
|
-
userSelect: 'none',
|
|
372
|
-
}}
|
|
373
|
-
onMouseEnter={() => pauseOnHover && setPaused(true)}
|
|
374
|
-
onMouseLeave={() => { setPaused(false); onDragEnd(); }}
|
|
375
|
-
onTouchStart={onDragStart}
|
|
376
|
-
onTouchMove={onDragMove}
|
|
377
|
-
onTouchEnd={onDragEnd}
|
|
378
|
-
onMouseDown={onDragStart}
|
|
379
|
-
onMouseMove={onDragMove}
|
|
380
|
-
onMouseUp={onDragEnd}
|
|
381
|
-
aria-live="polite"
|
|
382
|
-
aria-atomic="false"
|
|
383
|
-
>
|
|
384
|
-
{/* Inside arrows */}
|
|
385
|
-
{showArrows && !outsideArrows && (
|
|
386
|
-
<>
|
|
387
|
-
<ArrowBtn
|
|
388
|
-
direction="prev"
|
|
389
|
-
onClick={prev}
|
|
390
|
-
isDisabled={!canPrev}
|
|
391
|
-
primaryColor={theme.primary}
|
|
392
|
-
position="inside"
|
|
393
|
-
orientation={orientation}
|
|
394
|
-
/>
|
|
395
|
-
<ArrowBtn
|
|
396
|
-
direction="next"
|
|
397
|
-
onClick={next}
|
|
398
|
-
isDisabled={!canNext}
|
|
399
|
-
primaryColor={theme.primary}
|
|
400
|
-
position="inside"
|
|
401
|
-
orientation={orientation}
|
|
402
|
-
/>
|
|
403
|
-
</>
|
|
404
|
-
)}
|
|
405
|
-
|
|
406
|
-
{/* Track */}
|
|
407
|
-
<div ref={trackRef} style={trackStyle} onTransitionEnd={handleTransitionEnd}>
|
|
408
|
-
{renderSlides.map((slide, idx) => (
|
|
409
|
-
<div
|
|
410
|
-
key={`${slide.id}-${idx}`}
|
|
411
|
-
style={slideStyle}
|
|
412
|
-
role="group"
|
|
413
|
-
aria-roledescription="slide"
|
|
414
|
-
aria-label={`Slide ${((idx - (loop ? 1 : 0) + count) % count) + 1} of ${count}`}
|
|
415
|
-
aria-hidden={((idx - (loop ? 1 : 0) + count) % count) !== currentIdx}
|
|
416
|
-
>
|
|
417
|
-
{slide.content}
|
|
418
|
-
</div>
|
|
419
|
-
))}
|
|
420
|
-
</div>
|
|
421
|
-
|
|
422
|
-
{/* Dot indicators (inside) */}
|
|
423
|
-
{showDots && !showThumbnails && (
|
|
424
|
-
<div
|
|
425
|
-
aria-label="Slide indicators"
|
|
426
|
-
style={{
|
|
427
|
-
position: 'absolute',
|
|
428
|
-
bottom: 12,
|
|
429
|
-
left: '50%',
|
|
430
|
-
transform: 'translateX(-50%)',
|
|
431
|
-
display: 'flex',
|
|
432
|
-
gap: 6,
|
|
433
|
-
zIndex: 2,
|
|
434
|
-
}}
|
|
435
|
-
>
|
|
436
|
-
{slides.map((slide, idx) => (
|
|
437
|
-
<button
|
|
438
|
-
key={slide.id}
|
|
439
|
-
type="button"
|
|
440
|
-
aria-label={`Go to slide ${idx + 1}`}
|
|
441
|
-
aria-current={idx === currentIdx ? 'true' : undefined}
|
|
442
|
-
onClick={() => goTo(idx)}
|
|
443
|
-
style={{
|
|
444
|
-
width: idx === currentIdx ? 20 : 8,
|
|
445
|
-
height: 8,
|
|
446
|
-
borderRadius: 9999,
|
|
447
|
-
border: 'none',
|
|
448
|
-
backgroundColor: idx === currentIdx ? theme.primary : 'rgba(255,255,255,0.5)',
|
|
449
|
-
cursor: 'pointer',
|
|
450
|
-
padding: 0,
|
|
451
|
-
transition: 'width 250ms ease, background 250ms ease',
|
|
452
|
-
outline: 'none',
|
|
453
|
-
}}
|
|
454
|
-
onFocus={(e) => { (e.currentTarget as HTMLElement).style.boxShadow = `0 0 0 3px ${theme.primary}66`; }}
|
|
455
|
-
onBlur={(e) => { (e.currentTarget as HTMLElement).style.boxShadow = 'none'; }}
|
|
456
|
-
/>
|
|
457
|
-
))}
|
|
458
|
-
</div>
|
|
459
|
-
)}
|
|
460
|
-
</div>
|
|
461
|
-
|
|
462
|
-
{/* Outside next arrow */}
|
|
463
|
-
{showArrows && outsideArrows && (
|
|
464
|
-
<ArrowBtn
|
|
465
|
-
direction="next"
|
|
466
|
-
onClick={next}
|
|
467
|
-
isDisabled={!canNext}
|
|
468
|
-
primaryColor={theme.primary}
|
|
469
|
-
position="outside"
|
|
470
|
-
orientation={orientation}
|
|
471
|
-
/>
|
|
472
|
-
)}
|
|
473
|
-
</div>
|
|
474
|
-
|
|
475
|
-
{/* Thumbnail strip */}
|
|
476
|
-
{showThumbnails && (
|
|
477
|
-
<div
|
|
478
|
-
role="tablist"
|
|
479
|
-
aria-label="Slide thumbnails"
|
|
480
|
-
style={{
|
|
481
|
-
display: 'flex',
|
|
482
|
-
gap: 6,
|
|
483
|
-
overflowX: 'auto',
|
|
484
|
-
paddingBottom: 4,
|
|
485
|
-
scrollbarWidth: 'thin',
|
|
486
|
-
}}
|
|
487
|
-
>
|
|
488
|
-
{slides.map((slide, idx) => (
|
|
489
|
-
<button
|
|
490
|
-
key={slide.id}
|
|
491
|
-
type="button"
|
|
492
|
-
role="tab"
|
|
493
|
-
aria-selected={idx === currentIdx}
|
|
494
|
-
aria-label={`Thumbnail for slide ${idx + 1}`}
|
|
495
|
-
onClick={() => goTo(idx)}
|
|
496
|
-
style={{
|
|
497
|
-
flexShrink: 0,
|
|
498
|
-
width: 60,
|
|
499
|
-
height: 42,
|
|
500
|
-
border: `2px solid ${idx === currentIdx ? theme.primary : theme.border}`,
|
|
501
|
-
borderRadius: 6,
|
|
502
|
-
overflow: 'hidden',
|
|
503
|
-
cursor: 'pointer',
|
|
504
|
-
padding: 0,
|
|
505
|
-
background: theme.surfaceAlt,
|
|
506
|
-
transition: 'border-color 150ms ease',
|
|
507
|
-
outline: 'none',
|
|
508
|
-
position: 'relative',
|
|
509
|
-
}}
|
|
510
|
-
onFocus={(e) => { (e.currentTarget as HTMLElement).style.boxShadow = `0 0 0 3px ${theme.primary}55`; }}
|
|
511
|
-
onBlur={(e) => { (e.currentTarget as HTMLElement).style.boxShadow = 'none'; }}
|
|
512
|
-
>
|
|
513
|
-
{slide.thumbnail ? (
|
|
514
|
-
<img
|
|
515
|
-
src={slide.thumbnail}
|
|
516
|
-
alt=""
|
|
517
|
-
aria-hidden="true"
|
|
518
|
-
style={{ width: '100%', height: '100%', objectFit: 'cover', display: 'block' }}
|
|
519
|
-
/>
|
|
520
|
-
) : (
|
|
521
|
-
<div
|
|
522
|
-
style={{
|
|
523
|
-
width: '100%',
|
|
524
|
-
height: '100%',
|
|
525
|
-
display: 'flex',
|
|
526
|
-
alignItems: 'center',
|
|
527
|
-
justifyContent: 'center',
|
|
528
|
-
fontSize: '0.625rem',
|
|
529
|
-
color: theme.textMuted,
|
|
530
|
-
fontWeight: 600,
|
|
531
|
-
}}
|
|
532
|
-
>
|
|
533
|
-
{idx + 1}
|
|
534
|
-
</div>
|
|
535
|
-
)}
|
|
536
|
-
{idx === currentIdx && (
|
|
537
|
-
<div
|
|
538
|
-
aria-hidden="true"
|
|
539
|
-
style={{
|
|
540
|
-
position: 'absolute',
|
|
541
|
-
inset: 0,
|
|
542
|
-
backgroundColor: `${theme.primary}22`,
|
|
543
|
-
}}
|
|
544
|
-
/>
|
|
545
|
-
)}
|
|
546
|
-
</button>
|
|
547
|
-
))}
|
|
548
|
-
</div>
|
|
549
|
-
)}
|
|
550
|
-
</div>
|
|
551
|
-
);
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
TkxCarousel.displayName = 'TkxCarousel';
|