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,603 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import React, {
|
|
4
|
-
useState,
|
|
5
|
-
useEffect,
|
|
6
|
-
useRef,
|
|
7
|
-
type CSSProperties,
|
|
8
|
-
} from 'react';
|
|
9
|
-
import { useTheme } from '../themes';
|
|
10
|
-
import { sanitizeString } from '../engine/security';
|
|
11
|
-
import { useReducedMotion } from '../hooks';
|
|
12
|
-
|
|
13
|
-
// ── Types ────────────────────────────────────────────────────────────────────
|
|
14
|
-
|
|
15
|
-
export type ClockVariant = 'analog' | 'digital' | 'both';
|
|
16
|
-
export type DigitalFormat = '12h' | '24h';
|
|
17
|
-
export type AnalogStyle = 'classic' | 'minimal' | 'modern';
|
|
18
|
-
|
|
19
|
-
export interface TkxClockProps {
|
|
20
|
-
variant?: ClockVariant;
|
|
21
|
-
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
22
|
-
showSeconds?: boolean;
|
|
23
|
-
showDate?: boolean;
|
|
24
|
-
format?: DigitalFormat;
|
|
25
|
-
timezone?: string;
|
|
26
|
-
timezone2?: string;
|
|
27
|
-
label?: string;
|
|
28
|
-
theme?: 'auto' | 'light' | 'dark';
|
|
29
|
-
analogStyle?: AnalogStyle;
|
|
30
|
-
className?: string;
|
|
31
|
-
style?: CSSProperties;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// ── Size map ─────────────────────────────────────────────────────────────────
|
|
35
|
-
|
|
36
|
-
const SIZE_PX = { sm: 120, md: 180, lg: 240, xl: 320 } as const;
|
|
37
|
-
|
|
38
|
-
// ── Time helpers ─────────────────────────────────────────────────────────────
|
|
39
|
-
|
|
40
|
-
interface ClockTime {
|
|
41
|
-
hours: number;
|
|
42
|
-
minutes: number;
|
|
43
|
-
seconds: number;
|
|
44
|
-
milliseconds: number;
|
|
45
|
-
dateString: string;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function getTimeInZone(timezone?: string): ClockTime {
|
|
49
|
-
const now = new Date();
|
|
50
|
-
|
|
51
|
-
if (timezone) {
|
|
52
|
-
try {
|
|
53
|
-
const parts = new Intl.DateTimeFormat('en-US', {
|
|
54
|
-
timeZone: timezone,
|
|
55
|
-
hour: 'numeric',
|
|
56
|
-
minute: 'numeric',
|
|
57
|
-
second: 'numeric',
|
|
58
|
-
hour12: false,
|
|
59
|
-
weekday: 'long',
|
|
60
|
-
month: 'long',
|
|
61
|
-
day: '2-digit',
|
|
62
|
-
year: 'numeric',
|
|
63
|
-
}).formatToParts(now);
|
|
64
|
-
|
|
65
|
-
const get = (type: string) => parts.find((p) => p.type === type)?.value ?? '0';
|
|
66
|
-
|
|
67
|
-
let hours = parseInt(get('hour'), 10);
|
|
68
|
-
if (hours === 24) hours = 0;
|
|
69
|
-
const minutes = parseInt(get('minute'), 10);
|
|
70
|
-
const seconds = parseInt(get('second'), 10);
|
|
71
|
-
const weekday = get('weekday');
|
|
72
|
-
const month = get('month');
|
|
73
|
-
const day = get('day');
|
|
74
|
-
const year = get('year');
|
|
75
|
-
const dateString = `${weekday}, ${month} ${day}, ${year}`;
|
|
76
|
-
|
|
77
|
-
return { hours, minutes, seconds, milliseconds: now.getMilliseconds(), dateString };
|
|
78
|
-
} catch {
|
|
79
|
-
// fall through to local
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
const hours = now.getHours();
|
|
84
|
-
const minutes = now.getMinutes();
|
|
85
|
-
const seconds = now.getSeconds();
|
|
86
|
-
const dateString = now.toLocaleDateString('en-US', {
|
|
87
|
-
weekday: 'long',
|
|
88
|
-
month: 'long',
|
|
89
|
-
day: '2-digit',
|
|
90
|
-
year: 'numeric',
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
return { hours, minutes, seconds, milliseconds: now.getMilliseconds(), dateString };
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// ── Analog face ───────────────────────────────────────────────────────────────
|
|
97
|
-
|
|
98
|
-
interface AnalogFaceProps {
|
|
99
|
-
time: ClockTime;
|
|
100
|
-
size: number;
|
|
101
|
-
analogStyle: AnalogStyle;
|
|
102
|
-
showSeconds: boolean;
|
|
103
|
-
reducedMotion: boolean;
|
|
104
|
-
primary: string;
|
|
105
|
-
danger: string;
|
|
106
|
-
text: string;
|
|
107
|
-
textMuted: string;
|
|
108
|
-
border: string;
|
|
109
|
-
surface: string;
|
|
110
|
-
bg: string;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
function AnalogFace({
|
|
114
|
-
time,
|
|
115
|
-
size,
|
|
116
|
-
analogStyle,
|
|
117
|
-
showSeconds,
|
|
118
|
-
reducedMotion,
|
|
119
|
-
primary,
|
|
120
|
-
danger,
|
|
121
|
-
text,
|
|
122
|
-
textMuted,
|
|
123
|
-
border,
|
|
124
|
-
surface,
|
|
125
|
-
bg,
|
|
126
|
-
}: AnalogFaceProps) {
|
|
127
|
-
const cx = size / 2;
|
|
128
|
-
const cy = size / 2;
|
|
129
|
-
const r = size / 2 - 4;
|
|
130
|
-
|
|
131
|
-
const { hours, minutes, seconds, milliseconds } = time;
|
|
132
|
-
|
|
133
|
-
const smoothMs = reducedMotion ? 0 : milliseconds;
|
|
134
|
-
|
|
135
|
-
const secondAngle = ((seconds + smoothMs / 1000) / 60) * 360;
|
|
136
|
-
const minuteAngle = (minutes / 60) * 360 + (seconds / 60) * 6;
|
|
137
|
-
const hourAngle = ((hours % 12) / 12) * 360 + (minutes / 60) * 30;
|
|
138
|
-
|
|
139
|
-
const handPoint = (angle: number, length: number) => {
|
|
140
|
-
const rad = ((angle - 90) * Math.PI) / 180;
|
|
141
|
-
return {
|
|
142
|
-
x: cx + Math.cos(rad) * length,
|
|
143
|
-
y: cy + Math.sin(rad) * length,
|
|
144
|
-
};
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
const transition = reducedMotion ? 'none' : 'transform 0.15s cubic-bezier(0.4, 2.08, 0.55, 0.44)';
|
|
148
|
-
|
|
149
|
-
if (analogStyle === 'modern') {
|
|
150
|
-
// Arc-based progress indicators
|
|
151
|
-
const describeArc = (percent: number, radius: number) => {
|
|
152
|
-
const startAngle = -90;
|
|
153
|
-
const endAngle = startAngle + percent * 360;
|
|
154
|
-
const start = {
|
|
155
|
-
x: cx + Math.cos((startAngle * Math.PI) / 180) * radius,
|
|
156
|
-
y: cy + Math.sin((startAngle * Math.PI) / 180) * radius,
|
|
157
|
-
};
|
|
158
|
-
const end = {
|
|
159
|
-
x: cx + Math.cos((endAngle * Math.PI) / 180) * radius,
|
|
160
|
-
y: cy + Math.sin((endAngle * Math.PI) / 180) * radius,
|
|
161
|
-
};
|
|
162
|
-
const largeArc = percent > 0.5 ? 1 : 0;
|
|
163
|
-
return `M ${start.x} ${start.y} A ${radius} ${radius} 0 ${largeArc} 1 ${end.x} ${end.y}`;
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
const hourPct = ((hours % 12) / 12) + (minutes / 60) / 12;
|
|
167
|
-
const minPct = minutes / 60 + seconds / 3600;
|
|
168
|
-
const secPct = (seconds + (reducedMotion ? 0 : milliseconds / 1000)) / 60;
|
|
169
|
-
|
|
170
|
-
const outerR = r - 2;
|
|
171
|
-
const midR = r - 10;
|
|
172
|
-
const innerR = r - 18;
|
|
173
|
-
|
|
174
|
-
return (
|
|
175
|
-
<svg width={size} height={size} viewBox={`0 0 ${size} ${size}`} aria-hidden="true">
|
|
176
|
-
{/* Background rings */}
|
|
177
|
-
<circle cx={cx} cy={cy} r={outerR} fill="none" stroke={border} strokeWidth={4} />
|
|
178
|
-
<circle cx={cx} cy={cy} r={midR} fill="none" stroke={border} strokeWidth={4} />
|
|
179
|
-
{showSeconds && <circle cx={cx} cy={cy} r={innerR} fill="none" stroke={border} strokeWidth={3} />}
|
|
180
|
-
|
|
181
|
-
{/* Hour arc */}
|
|
182
|
-
<path d={describeArc(hourPct, outerR)} fill="none" stroke={primary} strokeWidth={4} strokeLinecap="round" />
|
|
183
|
-
{/* Minute arc */}
|
|
184
|
-
<path d={describeArc(minPct, midR)} fill="none" stroke={text} strokeWidth={4} strokeLinecap="round" />
|
|
185
|
-
{/* Second arc */}
|
|
186
|
-
{showSeconds && (
|
|
187
|
-
<path d={describeArc(secPct, innerR)} fill="none" stroke={danger} strokeWidth={3} strokeLinecap="round" />
|
|
188
|
-
)}
|
|
189
|
-
|
|
190
|
-
{/* Center dot */}
|
|
191
|
-
<circle cx={cx} cy={cy} r={4} fill={primary} />
|
|
192
|
-
|
|
193
|
-
{/* Time digits in center */}
|
|
194
|
-
<text
|
|
195
|
-
x={cx}
|
|
196
|
-
y={cy + 20}
|
|
197
|
-
textAnchor="middle"
|
|
198
|
-
fontSize={size * 0.12}
|
|
199
|
-
fill={textMuted}
|
|
200
|
-
fontFamily="monospace"
|
|
201
|
-
style={{ fontVariantNumeric: 'tabular-nums' }}
|
|
202
|
-
>
|
|
203
|
-
{String(hours).padStart(2, '0')}:{String(minutes).padStart(2, '0')}
|
|
204
|
-
</text>
|
|
205
|
-
</svg>
|
|
206
|
-
);
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
// Classic and Minimal styles use hands
|
|
210
|
-
const hourEnd = handPoint(hourAngle, r * 0.5);
|
|
211
|
-
const minuteEnd = handPoint(minuteAngle, r * 0.75);
|
|
212
|
-
const secondEnd = handPoint(secondAngle, r * 0.85);
|
|
213
|
-
const secondTailEnd = handPoint(secondAngle + 180, r * 0.2);
|
|
214
|
-
|
|
215
|
-
const tickMarks: React.JSX.Element[] = [];
|
|
216
|
-
|
|
217
|
-
if (analogStyle === 'classic') {
|
|
218
|
-
// 12 hour ticks + minor ticks
|
|
219
|
-
for (let i = 0; i < 60; i++) {
|
|
220
|
-
const angle = (i / 60) * 360;
|
|
221
|
-
const isHour = i % 5 === 0;
|
|
222
|
-
const rad = ((angle - 90) * Math.PI) / 180;
|
|
223
|
-
const innerR = isHour ? r - 10 : r - 6;
|
|
224
|
-
const x1 = cx + Math.cos(rad) * r;
|
|
225
|
-
const y1 = cy + Math.sin(rad) * r;
|
|
226
|
-
const x2 = cx + Math.cos(rad) * innerR;
|
|
227
|
-
const y2 = cy + Math.sin(rad) * innerR;
|
|
228
|
-
tickMarks.push(
|
|
229
|
-
<line
|
|
230
|
-
key={i}
|
|
231
|
-
x1={x1}
|
|
232
|
-
y1={y1}
|
|
233
|
-
x2={x2}
|
|
234
|
-
y2={y2}
|
|
235
|
-
stroke={isHour ? text : textMuted}
|
|
236
|
-
strokeWidth={isHour ? 2 : 1}
|
|
237
|
-
strokeLinecap="round"
|
|
238
|
-
/>,
|
|
239
|
-
);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
// Numbers 12, 3, 6, 9
|
|
243
|
-
const numberPositions = [
|
|
244
|
-
{ n: 12, angle: 0 },
|
|
245
|
-
{ n: 3, angle: 90 },
|
|
246
|
-
{ n: 6, angle: 180 },
|
|
247
|
-
{ n: 9, angle: 270 },
|
|
248
|
-
];
|
|
249
|
-
for (const { n, angle } of numberPositions) {
|
|
250
|
-
const rad = ((angle - 90) * Math.PI) / 180;
|
|
251
|
-
const nr = r - 20;
|
|
252
|
-
tickMarks.push(
|
|
253
|
-
<text
|
|
254
|
-
key={`n${n}`}
|
|
255
|
-
x={cx + Math.cos(rad) * nr}
|
|
256
|
-
y={cy + Math.sin(rad) * nr}
|
|
257
|
-
textAnchor="middle"
|
|
258
|
-
dominantBaseline="central"
|
|
259
|
-
fontSize={size * 0.09}
|
|
260
|
-
fill={text}
|
|
261
|
-
fontFamily="system-ui, sans-serif"
|
|
262
|
-
fontWeight="600"
|
|
263
|
-
>
|
|
264
|
-
{n}
|
|
265
|
-
</text>,
|
|
266
|
-
);
|
|
267
|
-
}
|
|
268
|
-
} else {
|
|
269
|
-
// Minimal: just dots at hour positions
|
|
270
|
-
for (let i = 0; i < 12; i++) {
|
|
271
|
-
const angle = (i / 12) * 360;
|
|
272
|
-
const rad = ((angle - 90) * Math.PI) / 180;
|
|
273
|
-
const dr = r - 8;
|
|
274
|
-
tickMarks.push(
|
|
275
|
-
<circle
|
|
276
|
-
key={i}
|
|
277
|
-
cx={cx + Math.cos(rad) * dr}
|
|
278
|
-
cy={cy + Math.sin(rad) * dr}
|
|
279
|
-
r={i % 3 === 0 ? 3 : 2}
|
|
280
|
-
fill={i % 3 === 0 ? text : textMuted}
|
|
281
|
-
/>,
|
|
282
|
-
);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
return (
|
|
287
|
-
<svg
|
|
288
|
-
width={size}
|
|
289
|
-
height={size}
|
|
290
|
-
viewBox={`0 0 ${size} ${size}`}
|
|
291
|
-
aria-hidden="true"
|
|
292
|
-
style={{ display: 'block' }}
|
|
293
|
-
>
|
|
294
|
-
{/* Face background */}
|
|
295
|
-
<circle cx={cx} cy={cy} r={r} fill={surface} stroke={border} strokeWidth={2} />
|
|
296
|
-
|
|
297
|
-
{/* Tick marks / numbers */}
|
|
298
|
-
{tickMarks}
|
|
299
|
-
|
|
300
|
-
{/* Hour hand */}
|
|
301
|
-
<line
|
|
302
|
-
x1={cx}
|
|
303
|
-
y1={cy}
|
|
304
|
-
x2={hourEnd.x}
|
|
305
|
-
y2={hourEnd.y}
|
|
306
|
-
stroke={primary}
|
|
307
|
-
strokeWidth={analogStyle === 'minimal' ? 3 : 4}
|
|
308
|
-
strokeLinecap="round"
|
|
309
|
-
style={{
|
|
310
|
-
transformOrigin: `${cx}px ${cy}px`,
|
|
311
|
-
transition,
|
|
312
|
-
}}
|
|
313
|
-
/>
|
|
314
|
-
|
|
315
|
-
{/* Minute hand */}
|
|
316
|
-
<line
|
|
317
|
-
x1={cx}
|
|
318
|
-
y1={cy}
|
|
319
|
-
x2={minuteEnd.x}
|
|
320
|
-
y2={minuteEnd.y}
|
|
321
|
-
stroke={text}
|
|
322
|
-
strokeWidth={analogStyle === 'minimal' ? 2 : 3}
|
|
323
|
-
strokeLinecap="round"
|
|
324
|
-
style={{
|
|
325
|
-
transformOrigin: `${cx}px ${cy}px`,
|
|
326
|
-
transition,
|
|
327
|
-
}}
|
|
328
|
-
/>
|
|
329
|
-
|
|
330
|
-
{/* Second hand */}
|
|
331
|
-
{showSeconds && (
|
|
332
|
-
<>
|
|
333
|
-
<line
|
|
334
|
-
x1={secondTailEnd.x}
|
|
335
|
-
y1={secondTailEnd.y}
|
|
336
|
-
x2={secondEnd.x}
|
|
337
|
-
y2={secondEnd.y}
|
|
338
|
-
stroke={danger}
|
|
339
|
-
strokeWidth={1.5}
|
|
340
|
-
strokeLinecap="round"
|
|
341
|
-
style={{
|
|
342
|
-
transformOrigin: `${cx}px ${cy}px`,
|
|
343
|
-
transition: reducedMotion ? 'none' : 'none', // second hand: no CSS transition, update via state
|
|
344
|
-
}}
|
|
345
|
-
/>
|
|
346
|
-
<circle cx={cx} cy={cy} r={3} fill={danger} />
|
|
347
|
-
</>
|
|
348
|
-
)}
|
|
349
|
-
|
|
350
|
-
{/* Center cap */}
|
|
351
|
-
<circle cx={cx} cy={cy} r={analogStyle === 'minimal' ? 3 : 5} fill={primary} />
|
|
352
|
-
</svg>
|
|
353
|
-
);
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
// ── Digital display ───────────────────────────────────────────────────────────
|
|
357
|
-
|
|
358
|
-
interface DigitalDisplayProps {
|
|
359
|
-
time: ClockTime;
|
|
360
|
-
format: DigitalFormat;
|
|
361
|
-
showSeconds: boolean;
|
|
362
|
-
showDate: boolean;
|
|
363
|
-
label?: string;
|
|
364
|
-
size: number;
|
|
365
|
-
primary: string;
|
|
366
|
-
text: string;
|
|
367
|
-
textMuted: string;
|
|
368
|
-
colonVisible: boolean;
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
function DigitalDisplay({
|
|
372
|
-
time,
|
|
373
|
-
format,
|
|
374
|
-
showSeconds,
|
|
375
|
-
showDate,
|
|
376
|
-
label,
|
|
377
|
-
size,
|
|
378
|
-
primary,
|
|
379
|
-
text,
|
|
380
|
-
textMuted,
|
|
381
|
-
colonVisible,
|
|
382
|
-
}: DigitalDisplayProps) {
|
|
383
|
-
const { hours, minutes, seconds, dateString } = time;
|
|
384
|
-
|
|
385
|
-
let displayHours = hours;
|
|
386
|
-
let ampm = '';
|
|
387
|
-
|
|
388
|
-
if (format === '12h') {
|
|
389
|
-
ampm = hours >= 12 ? 'PM' : 'AM';
|
|
390
|
-
displayHours = hours % 12 || 12;
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
const fontSize = size * 0.2;
|
|
394
|
-
const colonStyle: CSSProperties = {
|
|
395
|
-
opacity: colonVisible ? 1 : 0,
|
|
396
|
-
transition: 'opacity 0.1s',
|
|
397
|
-
display: 'inline-block',
|
|
398
|
-
minWidth: '0.5ch',
|
|
399
|
-
textAlign: 'center',
|
|
400
|
-
};
|
|
401
|
-
|
|
402
|
-
return (
|
|
403
|
-
<div
|
|
404
|
-
style={{
|
|
405
|
-
textAlign: 'center',
|
|
406
|
-
fontFamily: "'Courier New', Courier, monospace",
|
|
407
|
-
fontVariantNumeric: 'tabular-nums',
|
|
408
|
-
lineHeight: 1.1,
|
|
409
|
-
}}
|
|
410
|
-
>
|
|
411
|
-
<div
|
|
412
|
-
style={{
|
|
413
|
-
fontSize,
|
|
414
|
-
color: primary,
|
|
415
|
-
fontWeight: 700,
|
|
416
|
-
letterSpacing: '0.05em',
|
|
417
|
-
display: 'flex',
|
|
418
|
-
alignItems: 'center',
|
|
419
|
-
justifyContent: 'center',
|
|
420
|
-
gap: 0,
|
|
421
|
-
}}
|
|
422
|
-
>
|
|
423
|
-
<span>{String(displayHours).padStart(2, '0')}</span>
|
|
424
|
-
<span style={colonStyle}>:</span>
|
|
425
|
-
<span>{String(minutes).padStart(2, '0')}</span>
|
|
426
|
-
{showSeconds && (
|
|
427
|
-
<>
|
|
428
|
-
<span style={colonStyle}>:</span>
|
|
429
|
-
<span>{String(seconds).padStart(2, '0')}</span>
|
|
430
|
-
</>
|
|
431
|
-
)}
|
|
432
|
-
{format === '12h' && (
|
|
433
|
-
<span
|
|
434
|
-
style={{
|
|
435
|
-
fontSize: fontSize * 0.45,
|
|
436
|
-
color: textMuted,
|
|
437
|
-
marginLeft: '0.4ch',
|
|
438
|
-
alignSelf: 'flex-end',
|
|
439
|
-
marginBottom: fontSize * 0.05,
|
|
440
|
-
}}
|
|
441
|
-
>
|
|
442
|
-
{ampm}
|
|
443
|
-
</span>
|
|
444
|
-
)}
|
|
445
|
-
</div>
|
|
446
|
-
|
|
447
|
-
{showDate && (
|
|
448
|
-
<div
|
|
449
|
-
style={{
|
|
450
|
-
fontSize: size * 0.072,
|
|
451
|
-
color: textMuted,
|
|
452
|
-
marginTop: size * 0.025,
|
|
453
|
-
letterSpacing: '0.03em',
|
|
454
|
-
}}
|
|
455
|
-
>
|
|
456
|
-
{dateString}
|
|
457
|
-
</div>
|
|
458
|
-
)}
|
|
459
|
-
|
|
460
|
-
{label && (
|
|
461
|
-
<div
|
|
462
|
-
style={{
|
|
463
|
-
fontSize: size * 0.065,
|
|
464
|
-
color: textMuted,
|
|
465
|
-
marginTop: size * 0.015,
|
|
466
|
-
textTransform: 'uppercase',
|
|
467
|
-
letterSpacing: '0.08em',
|
|
468
|
-
}}
|
|
469
|
-
>
|
|
470
|
-
{sanitizeString(label)}
|
|
471
|
-
</div>
|
|
472
|
-
)}
|
|
473
|
-
</div>
|
|
474
|
-
);
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
// ── Main component ────────────────────────────────────────────────────────────
|
|
478
|
-
|
|
479
|
-
export function TkxClock({
|
|
480
|
-
variant = 'both',
|
|
481
|
-
size = 'md',
|
|
482
|
-
showSeconds = true,
|
|
483
|
-
showDate = false,
|
|
484
|
-
format = '24h',
|
|
485
|
-
timezone,
|
|
486
|
-
timezone2,
|
|
487
|
-
label,
|
|
488
|
-
analogStyle = 'classic',
|
|
489
|
-
className,
|
|
490
|
-
style,
|
|
491
|
-
}: TkxClockProps) {
|
|
492
|
-
const theme = useTheme();
|
|
493
|
-
const reducedMotion = useReducedMotion();
|
|
494
|
-
|
|
495
|
-
const [time, setTime] = useState<ClockTime>(() => getTimeInZone(timezone));
|
|
496
|
-
const [time2, setTime2] = useState<ClockTime | null>(() =>
|
|
497
|
-
timezone2 ? getTimeInZone(timezone2) : null,
|
|
498
|
-
);
|
|
499
|
-
const [colonVisible, setColonVisible] = useState(true);
|
|
500
|
-
const [mounted, setMounted] = useState(false);
|
|
501
|
-
|
|
502
|
-
const colonRef = useRef<ReturnType<typeof setInterval> | null>(null);
|
|
503
|
-
|
|
504
|
-
useEffect(() => {
|
|
505
|
-
setMounted(true);
|
|
506
|
-
}, []);
|
|
507
|
-
|
|
508
|
-
useEffect(() => {
|
|
509
|
-
const tick = () => {
|
|
510
|
-
setTime(getTimeInZone(timezone));
|
|
511
|
-
if (timezone2) setTime2(getTimeInZone(timezone2));
|
|
512
|
-
};
|
|
513
|
-
tick();
|
|
514
|
-
const id = setInterval(tick, 1000);
|
|
515
|
-
return () => clearInterval(id);
|
|
516
|
-
}, [timezone, timezone2]);
|
|
517
|
-
|
|
518
|
-
useEffect(() => {
|
|
519
|
-
colonRef.current = setInterval(() => {
|
|
520
|
-
setColonVisible((v) => !v);
|
|
521
|
-
}, 500);
|
|
522
|
-
return () => {
|
|
523
|
-
if (colonRef.current) clearInterval(colonRef.current);
|
|
524
|
-
};
|
|
525
|
-
}, []);
|
|
526
|
-
|
|
527
|
-
const sizePx = SIZE_PX[size];
|
|
528
|
-
const isAnalog = variant === 'analog' || variant === 'both';
|
|
529
|
-
const isDigital = variant === 'digital' || variant === 'both';
|
|
530
|
-
|
|
531
|
-
const containerStyle: CSSProperties = {
|
|
532
|
-
display: 'inline-flex',
|
|
533
|
-
flexDirection: 'column',
|
|
534
|
-
alignItems: 'center',
|
|
535
|
-
gap: variant === 'both' ? `${sizePx * 0.06}px` : 0,
|
|
536
|
-
opacity: mounted ? 1 : 0,
|
|
537
|
-
transition: reducedMotion ? 'none' : 'opacity 0.4s ease',
|
|
538
|
-
...style,
|
|
539
|
-
};
|
|
540
|
-
|
|
541
|
-
return (
|
|
542
|
-
<div className={className} style={containerStyle} role="timer" aria-live="off">
|
|
543
|
-
{isAnalog && (
|
|
544
|
-
<AnalogFace
|
|
545
|
-
time={time}
|
|
546
|
-
size={sizePx}
|
|
547
|
-
analogStyle={analogStyle}
|
|
548
|
-
showSeconds={showSeconds}
|
|
549
|
-
reducedMotion={reducedMotion}
|
|
550
|
-
primary={theme.primary}
|
|
551
|
-
danger={theme.danger}
|
|
552
|
-
text={theme.text}
|
|
553
|
-
textMuted={theme.textMuted}
|
|
554
|
-
border={theme.border}
|
|
555
|
-
surface={theme.surface}
|
|
556
|
-
bg={theme.bg}
|
|
557
|
-
/>
|
|
558
|
-
)}
|
|
559
|
-
|
|
560
|
-
{isDigital && (
|
|
561
|
-
<DigitalDisplay
|
|
562
|
-
time={time}
|
|
563
|
-
format={format}
|
|
564
|
-
showSeconds={showSeconds}
|
|
565
|
-
showDate={showDate}
|
|
566
|
-
label={label}
|
|
567
|
-
size={sizePx}
|
|
568
|
-
primary={theme.primary}
|
|
569
|
-
text={theme.text}
|
|
570
|
-
textMuted={theme.textMuted}
|
|
571
|
-
colonVisible={colonVisible}
|
|
572
|
-
/>
|
|
573
|
-
)}
|
|
574
|
-
|
|
575
|
-
{/* Dual timezone display */}
|
|
576
|
-
{time2 && timezone2 && (
|
|
577
|
-
<div
|
|
578
|
-
style={{
|
|
579
|
-
marginTop: sizePx * 0.04,
|
|
580
|
-
padding: `${sizePx * 0.03}px ${sizePx * 0.06}px`,
|
|
581
|
-
borderTop: `1px solid ${theme.border}`,
|
|
582
|
-
textAlign: 'center',
|
|
583
|
-
}}
|
|
584
|
-
>
|
|
585
|
-
<DigitalDisplay
|
|
586
|
-
time={time2}
|
|
587
|
-
format={format}
|
|
588
|
-
showSeconds={false}
|
|
589
|
-
showDate={false}
|
|
590
|
-
label={timezone2}
|
|
591
|
-
size={sizePx * 0.7}
|
|
592
|
-
primary={theme.secondary}
|
|
593
|
-
text={theme.text}
|
|
594
|
-
textMuted={theme.textMuted}
|
|
595
|
-
colonVisible={colonVisible}
|
|
596
|
-
/>
|
|
597
|
-
</div>
|
|
598
|
-
)}
|
|
599
|
-
</div>
|
|
600
|
-
);
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
TkxClock.displayName = 'TkxClock';
|