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,397 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
useState,
|
|
5
|
-
useRef,
|
|
6
|
-
useEffect,
|
|
7
|
-
useCallback,
|
|
8
|
-
useId,
|
|
9
|
-
type ReactNode,
|
|
10
|
-
type CSSProperties,
|
|
11
|
-
type KeyboardEvent,
|
|
12
|
-
} from 'react';
|
|
13
|
-
import { createPortal } from 'react-dom';
|
|
14
|
-
import { useTheme } from '../themes';
|
|
15
|
-
import { sanitizeString } from '../engine/security';
|
|
16
|
-
import { useReducedMotion, useEscapeKey } from '../hooks';
|
|
17
|
-
import { tkx } from '../engine/tkx';
|
|
18
|
-
|
|
19
|
-
// ── Types ─────────────────────────────────────────────────────────────────────
|
|
20
|
-
|
|
21
|
-
export interface SpeedDialAction {
|
|
22
|
-
id: string;
|
|
23
|
-
icon: ReactNode;
|
|
24
|
-
label: string;
|
|
25
|
-
onClick?: () => void;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface TkxSpeedDialProps {
|
|
29
|
-
actions: SpeedDialAction[];
|
|
30
|
-
icon?: ReactNode;
|
|
31
|
-
direction?: 'up' | 'down' | 'left' | 'right';
|
|
32
|
-
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
33
|
-
className?: string;
|
|
34
|
-
style?: CSSProperties;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// ── Default plus icon ───────────────────────────────────────────────────────
|
|
38
|
-
|
|
39
|
-
function PlusIcon({ color, rotated, reducedMotion }: { color: string; rotated: boolean; reducedMotion: boolean }) {
|
|
40
|
-
return (
|
|
41
|
-
<svg
|
|
42
|
-
width="24"
|
|
43
|
-
height="24"
|
|
44
|
-
viewBox="0 0 24 24"
|
|
45
|
-
fill="none"
|
|
46
|
-
aria-hidden="true"
|
|
47
|
-
style={{
|
|
48
|
-
transform: rotated ? 'rotate(45deg)' : 'rotate(0deg)',
|
|
49
|
-
transition: reducedMotion ? 'none' : 'transform 200ms ease',
|
|
50
|
-
}}
|
|
51
|
-
>
|
|
52
|
-
<path
|
|
53
|
-
d="M12 5v14M5 12h14"
|
|
54
|
-
stroke={color}
|
|
55
|
-
strokeWidth="2.5"
|
|
56
|
-
strokeLinecap="round"
|
|
57
|
-
/>
|
|
58
|
-
</svg>
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// ── Position styles ─────────────────────────────────────────────────────────
|
|
63
|
-
|
|
64
|
-
type PositionKey = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
65
|
-
|
|
66
|
-
const POSITION_STYLES: Record<PositionKey, CSSProperties> = {
|
|
67
|
-
'bottom-right': { bottom: 24, right: 24 },
|
|
68
|
-
'bottom-left': { bottom: 24, left: 24 },
|
|
69
|
-
'top-right': { top: 24, right: 24 },
|
|
70
|
-
'top-left': { top: 24, left: 24 },
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
// ── Direction offsets for action placement ──────────────────────────────────
|
|
74
|
-
|
|
75
|
-
function getActionOffset(
|
|
76
|
-
direction: 'up' | 'down' | 'left' | 'right',
|
|
77
|
-
index: number,
|
|
78
|
-
spacing: number,
|
|
79
|
-
): CSSProperties {
|
|
80
|
-
const offset = (index + 1) * spacing;
|
|
81
|
-
switch (direction) {
|
|
82
|
-
case 'up':
|
|
83
|
-
return { bottom: offset, left: '50%', transform: 'translateX(-50%)' };
|
|
84
|
-
case 'down':
|
|
85
|
-
return { top: offset, left: '50%', transform: 'translateX(-50%)' };
|
|
86
|
-
case 'left':
|
|
87
|
-
return { right: offset, top: '50%', transform: 'translateY(-50%)' };
|
|
88
|
-
case 'right':
|
|
89
|
-
return { left: offset, top: '50%', transform: 'translateY(-50%)' };
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// ── Tooltip placement relative to action button direction ───────────────────
|
|
94
|
-
|
|
95
|
-
function getTooltipPlacement(direction: 'up' | 'down' | 'left' | 'right'): CSSProperties {
|
|
96
|
-
switch (direction) {
|
|
97
|
-
case 'up':
|
|
98
|
-
case 'down':
|
|
99
|
-
return { right: '100%', top: '50%', transform: 'translateY(-50%)', marginRight: 10 };
|
|
100
|
-
case 'left':
|
|
101
|
-
return { bottom: '100%', left: '50%', transform: 'translateX(-50%)', marginBottom: 10 };
|
|
102
|
-
case 'right':
|
|
103
|
-
return { bottom: '100%', left: '50%', transform: 'translateX(-50%)', marginBottom: 10 };
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// ── Component ───────────────────────────────────────────────────────────────
|
|
108
|
-
|
|
109
|
-
const MAIN_BUTTON_SIZE = 56;
|
|
110
|
-
const ACTION_BUTTON_SIZE = 48;
|
|
111
|
-
const SPACING = 64;
|
|
112
|
-
|
|
113
|
-
export function TkxSpeedDial({
|
|
114
|
-
actions,
|
|
115
|
-
icon,
|
|
116
|
-
direction = 'up',
|
|
117
|
-
position = 'bottom-right',
|
|
118
|
-
className,
|
|
119
|
-
style,
|
|
120
|
-
}: TkxSpeedDialProps) {
|
|
121
|
-
const theme = useTheme();
|
|
122
|
-
const reducedMotion = useReducedMotion();
|
|
123
|
-
const menuId = useId();
|
|
124
|
-
|
|
125
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
126
|
-
const [focusedIndex, setFocusedIndex] = useState(-1);
|
|
127
|
-
const containerRef = useRef<HTMLDivElement>(null);
|
|
128
|
-
const actionRefs = useRef<Map<number, HTMLButtonElement>>(new Map());
|
|
129
|
-
|
|
130
|
-
const toggle = useCallback(() => {
|
|
131
|
-
setIsOpen((prev) => !prev);
|
|
132
|
-
setFocusedIndex(-1);
|
|
133
|
-
}, []);
|
|
134
|
-
|
|
135
|
-
const close = useCallback(() => {
|
|
136
|
-
setIsOpen(false);
|
|
137
|
-
setFocusedIndex(-1);
|
|
138
|
-
}, []);
|
|
139
|
-
|
|
140
|
-
useEscapeKey(close, isOpen);
|
|
141
|
-
|
|
142
|
-
// Close on click outside
|
|
143
|
-
useEffect(() => {
|
|
144
|
-
if (!isOpen) return;
|
|
145
|
-
const handler = (e: PointerEvent) => {
|
|
146
|
-
if (!containerRef.current?.contains(e.target as Node)) {
|
|
147
|
-
close();
|
|
148
|
-
}
|
|
149
|
-
};
|
|
150
|
-
document.addEventListener('pointerdown', handler);
|
|
151
|
-
return () => document.removeEventListener('pointerdown', handler);
|
|
152
|
-
}, [isOpen, close]);
|
|
153
|
-
|
|
154
|
-
// Focus management
|
|
155
|
-
useEffect(() => {
|
|
156
|
-
if (focusedIndex >= 0) {
|
|
157
|
-
actionRefs.current.get(focusedIndex)?.focus();
|
|
158
|
-
}
|
|
159
|
-
}, [focusedIndex]);
|
|
160
|
-
|
|
161
|
-
const handleMainKeyDown = (e: KeyboardEvent<HTMLButtonElement>) => {
|
|
162
|
-
if (e.key === 'Enter' || e.key === ' ') {
|
|
163
|
-
e.preventDefault();
|
|
164
|
-
toggle();
|
|
165
|
-
}
|
|
166
|
-
if (isOpen) {
|
|
167
|
-
if (e.key === 'ArrowUp' || e.key === 'ArrowLeft') {
|
|
168
|
-
e.preventDefault();
|
|
169
|
-
setFocusedIndex(0);
|
|
170
|
-
}
|
|
171
|
-
if (e.key === 'ArrowDown' || e.key === 'ArrowRight') {
|
|
172
|
-
e.preventDefault();
|
|
173
|
-
setFocusedIndex(0);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
const handleActionKeyDown = (e: KeyboardEvent<HTMLButtonElement>, index: number) => {
|
|
179
|
-
switch (e.key) {
|
|
180
|
-
case 'ArrowUp':
|
|
181
|
-
case 'ArrowLeft': {
|
|
182
|
-
e.preventDefault();
|
|
183
|
-
setFocusedIndex(index > 0 ? index - 1 : actions.length - 1);
|
|
184
|
-
break;
|
|
185
|
-
}
|
|
186
|
-
case 'ArrowDown':
|
|
187
|
-
case 'ArrowRight': {
|
|
188
|
-
e.preventDefault();
|
|
189
|
-
setFocusedIndex(index < actions.length - 1 ? index + 1 : 0);
|
|
190
|
-
break;
|
|
191
|
-
}
|
|
192
|
-
case 'Enter':
|
|
193
|
-
case ' ': {
|
|
194
|
-
e.preventDefault();
|
|
195
|
-
actions[index].onClick?.();
|
|
196
|
-
close();
|
|
197
|
-
break;
|
|
198
|
-
}
|
|
199
|
-
case 'Escape': {
|
|
200
|
-
close();
|
|
201
|
-
break;
|
|
202
|
-
}
|
|
203
|
-
case 'Home': {
|
|
204
|
-
e.preventDefault();
|
|
205
|
-
setFocusedIndex(0);
|
|
206
|
-
break;
|
|
207
|
-
}
|
|
208
|
-
case 'End': {
|
|
209
|
-
e.preventDefault();
|
|
210
|
-
setFocusedIndex(actions.length - 1);
|
|
211
|
-
break;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
const getAnimationDelay = (index: number): string => {
|
|
217
|
-
if (reducedMotion) return '0ms';
|
|
218
|
-
return `${index * 40}ms`;
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
return (
|
|
222
|
-
<>
|
|
223
|
-
{/* Backdrop */}
|
|
224
|
-
{isOpen && typeof document !== 'undefined' &&
|
|
225
|
-
createPortal(
|
|
226
|
-
<div
|
|
227
|
-
aria-hidden="true"
|
|
228
|
-
onClick={close}
|
|
229
|
-
style={{
|
|
230
|
-
position: 'fixed',
|
|
231
|
-
inset: 0,
|
|
232
|
-
backgroundColor: 'rgba(0,0,0,0.3)',
|
|
233
|
-
zIndex: 9000,
|
|
234
|
-
transition: reducedMotion ? 'none' : 'opacity 200ms ease',
|
|
235
|
-
}}
|
|
236
|
-
/>,
|
|
237
|
-
document.body,
|
|
238
|
-
)}
|
|
239
|
-
|
|
240
|
-
{/* Speed dial container */}
|
|
241
|
-
<div
|
|
242
|
-
ref={containerRef}
|
|
243
|
-
className={tkx('fixed z-[9100] font-sans', className ?? '')}
|
|
244
|
-
style={{
|
|
245
|
-
...POSITION_STYLES[position],
|
|
246
|
-
...style,
|
|
247
|
-
}}
|
|
248
|
-
>
|
|
249
|
-
{/* Action buttons */}
|
|
250
|
-
{isOpen &&
|
|
251
|
-
actions.map((action, index) => {
|
|
252
|
-
const safeLabel = sanitizeString(action.label);
|
|
253
|
-
const offsetStyle = getActionOffset(direction, index, SPACING);
|
|
254
|
-
const tooltipStyle = getTooltipPlacement(direction);
|
|
255
|
-
|
|
256
|
-
return (
|
|
257
|
-
<div
|
|
258
|
-
key={action.id}
|
|
259
|
-
className={tkx('absolute')}
|
|
260
|
-
style={{
|
|
261
|
-
...offsetStyle,
|
|
262
|
-
opacity: reducedMotion ? 1 : 0,
|
|
263
|
-
animation: reducedMotion
|
|
264
|
-
? 'none'
|
|
265
|
-
: `tkxSpeedDialIn 180ms ease forwards`,
|
|
266
|
-
animationDelay: getAnimationDelay(index),
|
|
267
|
-
}}
|
|
268
|
-
>
|
|
269
|
-
<div className={tkx('relative inline-flex')}>
|
|
270
|
-
{/* Tooltip */}
|
|
271
|
-
<span
|
|
272
|
-
className={tkx(
|
|
273
|
-
'absolute z-10 whitespace-nowrap text-xs py-1 px-2 rounded-md pointer-events-none',
|
|
274
|
-
)}
|
|
275
|
-
style={{
|
|
276
|
-
...tooltipStyle,
|
|
277
|
-
backgroundColor: theme.surfaceAlt,
|
|
278
|
-
color: theme.text,
|
|
279
|
-
border: `1px solid ${theme.border}`,
|
|
280
|
-
boxShadow: `0 2px 8px rgba(0,0,0,0.15)`,
|
|
281
|
-
}}
|
|
282
|
-
role="tooltip"
|
|
283
|
-
>
|
|
284
|
-
{safeLabel}
|
|
285
|
-
</span>
|
|
286
|
-
|
|
287
|
-
{/* Action button */}
|
|
288
|
-
<button
|
|
289
|
-
ref={(el) => {
|
|
290
|
-
if (el) actionRefs.current.set(index, el);
|
|
291
|
-
else actionRefs.current.delete(index);
|
|
292
|
-
}}
|
|
293
|
-
type="button"
|
|
294
|
-
aria-label={safeLabel}
|
|
295
|
-
tabIndex={isOpen ? 0 : -1}
|
|
296
|
-
onClick={() => {
|
|
297
|
-
action.onClick?.();
|
|
298
|
-
close();
|
|
299
|
-
}}
|
|
300
|
-
onKeyDown={(e) => handleActionKeyDown(e, index)}
|
|
301
|
-
className={tkx(
|
|
302
|
-
'inline-flex items-center justify-center rounded-full border-none cursor-pointer',
|
|
303
|
-
'outline-none focus-visible:ring-2 focus-visible:ring-offset-2',
|
|
304
|
-
'shadow-lg',
|
|
305
|
-
)}
|
|
306
|
-
style={{
|
|
307
|
-
width: ACTION_BUTTON_SIZE,
|
|
308
|
-
height: ACTION_BUTTON_SIZE,
|
|
309
|
-
backgroundColor: theme.surface,
|
|
310
|
-
color: theme.text,
|
|
311
|
-
border: `1px solid ${theme.border}`,
|
|
312
|
-
boxShadow: `0 4px 12px rgba(0,0,0,0.15)`,
|
|
313
|
-
transition: reducedMotion ? 'none' : 'all 150ms ease',
|
|
314
|
-
}}
|
|
315
|
-
onMouseEnter={(e) => {
|
|
316
|
-
(e.currentTarget as HTMLElement).style.backgroundColor = theme.surfaceAlt;
|
|
317
|
-
(e.currentTarget as HTMLElement).style.transform = 'scale(1.1)';
|
|
318
|
-
}}
|
|
319
|
-
onMouseLeave={(e) => {
|
|
320
|
-
(e.currentTarget as HTMLElement).style.backgroundColor = theme.surface;
|
|
321
|
-
(e.currentTarget as HTMLElement).style.transform = 'scale(1)';
|
|
322
|
-
}}
|
|
323
|
-
>
|
|
324
|
-
{action.icon}
|
|
325
|
-
</button>
|
|
326
|
-
</div>
|
|
327
|
-
</div>
|
|
328
|
-
);
|
|
329
|
-
})}
|
|
330
|
-
|
|
331
|
-
{/* Main FAB */}
|
|
332
|
-
<button
|
|
333
|
-
type="button"
|
|
334
|
-
aria-label={isOpen ? 'Close actions menu' : 'Open actions menu'}
|
|
335
|
-
aria-expanded={isOpen}
|
|
336
|
-
aria-controls={menuId}
|
|
337
|
-
aria-haspopup="true"
|
|
338
|
-
onClick={toggle}
|
|
339
|
-
onKeyDown={handleMainKeyDown}
|
|
340
|
-
className={tkx(
|
|
341
|
-
'inline-flex items-center justify-center rounded-full border-none cursor-pointer',
|
|
342
|
-
'outline-none focus-visible:ring-2 focus-visible:ring-offset-2',
|
|
343
|
-
)}
|
|
344
|
-
style={{
|
|
345
|
-
width: MAIN_BUTTON_SIZE,
|
|
346
|
-
height: MAIN_BUTTON_SIZE,
|
|
347
|
-
backgroundColor: theme.primary,
|
|
348
|
-
color: theme.bg,
|
|
349
|
-
boxShadow: `0 6px 20px ${theme.primary}40`,
|
|
350
|
-
transition: reducedMotion ? 'none' : 'all 200ms ease',
|
|
351
|
-
position: 'relative',
|
|
352
|
-
zIndex: 1,
|
|
353
|
-
}}
|
|
354
|
-
onMouseEnter={(e) => {
|
|
355
|
-
(e.currentTarget as HTMLElement).style.boxShadow = `0 8px 28px ${theme.primary}60`;
|
|
356
|
-
if (!reducedMotion) {
|
|
357
|
-
(e.currentTarget as HTMLElement).style.transform = 'scale(1.05)';
|
|
358
|
-
}
|
|
359
|
-
}}
|
|
360
|
-
onMouseLeave={(e) => {
|
|
361
|
-
(e.currentTarget as HTMLElement).style.boxShadow = `0 6px 20px ${theme.primary}40`;
|
|
362
|
-
(e.currentTarget as HTMLElement).style.transform = 'scale(1)';
|
|
363
|
-
}}
|
|
364
|
-
>
|
|
365
|
-
{icon ?? (
|
|
366
|
-
<PlusIcon
|
|
367
|
-
color={theme.bg}
|
|
368
|
-
rotated={isOpen}
|
|
369
|
-
reducedMotion={reducedMotion}
|
|
370
|
-
/>
|
|
371
|
-
)}
|
|
372
|
-
</button>
|
|
373
|
-
|
|
374
|
-
{/* Hidden menu region for a11y */}
|
|
375
|
-
<div id={menuId} role="menu" aria-label="Speed dial actions" style={{ display: 'none' }}>
|
|
376
|
-
{actions.map((action) => (
|
|
377
|
-
<div key={action.id} role="menuitem">
|
|
378
|
-
{sanitizeString(action.label)}
|
|
379
|
-
</div>
|
|
380
|
-
))}
|
|
381
|
-
</div>
|
|
382
|
-
</div>
|
|
383
|
-
|
|
384
|
-
{/* Keyframes */}
|
|
385
|
-
{isOpen && !reducedMotion && (
|
|
386
|
-
<style>{`
|
|
387
|
-
@keyframes tkxSpeedDialIn {
|
|
388
|
-
from { opacity: 0; transform: translateX(-50%) scale(0.5); }
|
|
389
|
-
to { opacity: 1; transform: translateX(-50%) scale(1); }
|
|
390
|
-
}
|
|
391
|
-
`}</style>
|
|
392
|
-
)}
|
|
393
|
-
</>
|
|
394
|
-
);
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
export default TkxSpeedDial;
|
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
useState,
|
|
5
|
-
useEffect,
|
|
6
|
-
useRef,
|
|
7
|
-
type ReactNode,
|
|
8
|
-
type CSSProperties,
|
|
9
|
-
createElement,
|
|
10
|
-
} from 'react';
|
|
11
|
-
import { useTheme } from '../themes';
|
|
12
|
-
import { sanitizeString } from '../engine/security';
|
|
13
|
-
import { useReducedMotion } from '../hooks';
|
|
14
|
-
|
|
15
|
-
// ── Interface ───────────────────────────────────────────────────────────────
|
|
16
|
-
|
|
17
|
-
export interface TkxSpinProps {
|
|
18
|
-
spinning?: boolean;
|
|
19
|
-
size?: 'sm' | 'md' | 'lg';
|
|
20
|
-
tip?: string;
|
|
21
|
-
indicator?: ReactNode;
|
|
22
|
-
children?: ReactNode;
|
|
23
|
-
fullscreen?: boolean;
|
|
24
|
-
delay?: number;
|
|
25
|
-
style?: CSSProperties;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// ── Size Config ─────────────────────────────────────────────────────────────
|
|
29
|
-
|
|
30
|
-
const SIZE_MAP: Record<string, { dimension: number; borderWidth: number; fontSize: string }> = {
|
|
31
|
-
sm: { dimension: 20, borderWidth: 2, fontSize: '0.75rem' },
|
|
32
|
-
md: { dimension: 32, borderWidth: 3, fontSize: '0.875rem' },
|
|
33
|
-
lg: { dimension: 48, borderWidth: 4, fontSize: '1rem' },
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
// ── Keyframes Injection ─────────────────────────────────────────────────────
|
|
37
|
-
|
|
38
|
-
let stylesInjected = false;
|
|
39
|
-
|
|
40
|
-
function injectSpinStyles() {
|
|
41
|
-
if (stylesInjected || typeof document === 'undefined') return;
|
|
42
|
-
stylesInjected = true;
|
|
43
|
-
const styleEl = document.createElement('style');
|
|
44
|
-
styleEl.id = 'tkx-spin-styles';
|
|
45
|
-
styleEl.textContent = `
|
|
46
|
-
@keyframes tkx-spin-rotate {
|
|
47
|
-
0% { transform: rotate(0deg); }
|
|
48
|
-
100% { transform: rotate(360deg); }
|
|
49
|
-
}
|
|
50
|
-
`;
|
|
51
|
-
document.head.appendChild(styleEl);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// ── Static Indicator (reduced motion) ───────────────────────────────────────
|
|
55
|
-
|
|
56
|
-
function StaticIndicator({ size, color }: { size: number; color: string }) {
|
|
57
|
-
return createElement(
|
|
58
|
-
'svg',
|
|
59
|
-
{
|
|
60
|
-
width: size,
|
|
61
|
-
height: size,
|
|
62
|
-
viewBox: '0 0 24 24',
|
|
63
|
-
fill: 'none',
|
|
64
|
-
role: 'img',
|
|
65
|
-
'aria-label': 'Loading',
|
|
66
|
-
},
|
|
67
|
-
createElement('circle', {
|
|
68
|
-
cx: 12,
|
|
69
|
-
cy: 12,
|
|
70
|
-
r: 10,
|
|
71
|
-
stroke: `${color}33`,
|
|
72
|
-
strokeWidth: 2.5,
|
|
73
|
-
fill: 'none',
|
|
74
|
-
}),
|
|
75
|
-
createElement('path', {
|
|
76
|
-
d: 'M12 2a10 10 0 0 1 10 10',
|
|
77
|
-
stroke: color,
|
|
78
|
-
strokeWidth: 2.5,
|
|
79
|
-
strokeLinecap: 'round',
|
|
80
|
-
fill: 'none',
|
|
81
|
-
}),
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// ── Default Spinner ─────────────────────────────────────────────────────────
|
|
86
|
-
|
|
87
|
-
function DefaultSpinner({
|
|
88
|
-
size,
|
|
89
|
-
borderWidth,
|
|
90
|
-
color,
|
|
91
|
-
reducedMotion,
|
|
92
|
-
}: {
|
|
93
|
-
size: number;
|
|
94
|
-
borderWidth: number;
|
|
95
|
-
color: string;
|
|
96
|
-
reducedMotion: boolean;
|
|
97
|
-
}) {
|
|
98
|
-
if (reducedMotion) {
|
|
99
|
-
return createElement(StaticIndicator, { size, color });
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
injectSpinStyles();
|
|
103
|
-
|
|
104
|
-
return createElement('div', {
|
|
105
|
-
role: 'img',
|
|
106
|
-
'aria-label': 'Loading',
|
|
107
|
-
style: {
|
|
108
|
-
width: `${size}px`,
|
|
109
|
-
height: `${size}px`,
|
|
110
|
-
border: `${borderWidth}px solid ${color}33`,
|
|
111
|
-
borderTopColor: color,
|
|
112
|
-
borderRadius: '50%',
|
|
113
|
-
animation: 'tkx-spin-rotate 0.8s linear infinite',
|
|
114
|
-
boxSizing: 'border-box',
|
|
115
|
-
},
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// ── TkxSpin ─────────────────────────────────────────────────────────────────
|
|
120
|
-
|
|
121
|
-
export function TkxSpin({
|
|
122
|
-
spinning = true,
|
|
123
|
-
size = 'md',
|
|
124
|
-
tip,
|
|
125
|
-
indicator,
|
|
126
|
-
children,
|
|
127
|
-
fullscreen = false,
|
|
128
|
-
delay = 0,
|
|
129
|
-
style,
|
|
130
|
-
}: TkxSpinProps) {
|
|
131
|
-
const theme = useTheme();
|
|
132
|
-
const reducedMotion = useReducedMotion();
|
|
133
|
-
const [visible, setVisible] = useState(delay === 0 && spinning);
|
|
134
|
-
const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
135
|
-
|
|
136
|
-
useEffect(() => {
|
|
137
|
-
if (spinning && delay > 0) {
|
|
138
|
-
timerRef.current = setTimeout(() => setVisible(true), delay);
|
|
139
|
-
} else {
|
|
140
|
-
setVisible(spinning);
|
|
141
|
-
}
|
|
142
|
-
return () => {
|
|
143
|
-
if (timerRef.current !== null) clearTimeout(timerRef.current);
|
|
144
|
-
};
|
|
145
|
-
}, [spinning, delay]);
|
|
146
|
-
|
|
147
|
-
if (!visible) {
|
|
148
|
-
return children ? createElement('div', { style }, children) : null;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
const sizeConfig = SIZE_MAP[size];
|
|
152
|
-
const safeTip = tip ? sanitizeString(tip) : undefined;
|
|
153
|
-
|
|
154
|
-
const spinnerContent = createElement(
|
|
155
|
-
'div',
|
|
156
|
-
{
|
|
157
|
-
role: 'status',
|
|
158
|
-
'aria-live': 'polite',
|
|
159
|
-
'aria-label': safeTip ?? 'Loading',
|
|
160
|
-
style: {
|
|
161
|
-
display: 'flex',
|
|
162
|
-
flexDirection: 'column' as const,
|
|
163
|
-
alignItems: 'center',
|
|
164
|
-
justifyContent: 'center',
|
|
165
|
-
gap: '8px',
|
|
166
|
-
},
|
|
167
|
-
},
|
|
168
|
-
indicator ??
|
|
169
|
-
createElement(DefaultSpinner, {
|
|
170
|
-
size: sizeConfig.dimension,
|
|
171
|
-
borderWidth: sizeConfig.borderWidth,
|
|
172
|
-
color: theme.primary,
|
|
173
|
-
reducedMotion,
|
|
174
|
-
}),
|
|
175
|
-
safeTip &&
|
|
176
|
-
createElement(
|
|
177
|
-
'span',
|
|
178
|
-
{
|
|
179
|
-
style: {
|
|
180
|
-
color: theme.primary,
|
|
181
|
-
fontSize: sizeConfig.fontSize,
|
|
182
|
-
marginTop: '4px',
|
|
183
|
-
},
|
|
184
|
-
},
|
|
185
|
-
safeTip,
|
|
186
|
-
),
|
|
187
|
-
);
|
|
188
|
-
|
|
189
|
-
// Fullscreen overlay
|
|
190
|
-
if (fullscreen) {
|
|
191
|
-
return createElement(
|
|
192
|
-
'div',
|
|
193
|
-
{
|
|
194
|
-
style: {
|
|
195
|
-
position: 'fixed',
|
|
196
|
-
inset: 0,
|
|
197
|
-
display: 'flex',
|
|
198
|
-
alignItems: 'center',
|
|
199
|
-
justifyContent: 'center',
|
|
200
|
-
backgroundColor: `${theme.bg}cc`,
|
|
201
|
-
zIndex: 9999,
|
|
202
|
-
...style,
|
|
203
|
-
},
|
|
204
|
-
},
|
|
205
|
-
spinnerContent,
|
|
206
|
-
);
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
// Wrapper mode: overlay on children
|
|
210
|
-
if (children) {
|
|
211
|
-
return createElement(
|
|
212
|
-
'div',
|
|
213
|
-
{
|
|
214
|
-
style: {
|
|
215
|
-
position: 'relative',
|
|
216
|
-
...style,
|
|
217
|
-
},
|
|
218
|
-
},
|
|
219
|
-
createElement(
|
|
220
|
-
'div',
|
|
221
|
-
{
|
|
222
|
-
style: {
|
|
223
|
-
filter: 'blur(1px)',
|
|
224
|
-
opacity: 0.5,
|
|
225
|
-
pointerEvents: 'none',
|
|
226
|
-
userSelect: 'none',
|
|
227
|
-
transition: reducedMotion ? 'none' : 'opacity 0.2s, filter 0.2s',
|
|
228
|
-
},
|
|
229
|
-
},
|
|
230
|
-
children,
|
|
231
|
-
),
|
|
232
|
-
createElement(
|
|
233
|
-
'div',
|
|
234
|
-
{
|
|
235
|
-
style: {
|
|
236
|
-
position: 'absolute',
|
|
237
|
-
inset: 0,
|
|
238
|
-
display: 'flex',
|
|
239
|
-
alignItems: 'center',
|
|
240
|
-
justifyContent: 'center',
|
|
241
|
-
backgroundColor: `${theme.bg}66`,
|
|
242
|
-
borderRadius: '4px',
|
|
243
|
-
},
|
|
244
|
-
},
|
|
245
|
-
spinnerContent,
|
|
246
|
-
),
|
|
247
|
-
);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
// Standalone spinner
|
|
251
|
-
return createElement(
|
|
252
|
-
'div',
|
|
253
|
-
{
|
|
254
|
-
style: {
|
|
255
|
-
display: 'inline-flex',
|
|
256
|
-
alignItems: 'center',
|
|
257
|
-
justifyContent: 'center',
|
|
258
|
-
...style,
|
|
259
|
-
},
|
|
260
|
-
},
|
|
261
|
-
spinnerContent,
|
|
262
|
-
);
|
|
263
|
-
}
|