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,107 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { forwardRef, type HTMLAttributes } from 'react';
|
|
4
|
-
import { useTheme } from '../themes';
|
|
5
|
-
import { useReducedMotion } from '../hooks';
|
|
6
|
-
import { tkx, cx } from '../engine/tkx';
|
|
7
|
-
|
|
8
|
-
export type SkeletonVariant = 'text' | 'circular' | 'rectangular';
|
|
9
|
-
export type SkeletonAnimation = 'pulse' | 'wave' | false;
|
|
10
|
-
|
|
11
|
-
export interface TkxSkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
12
|
-
variant?: SkeletonVariant;
|
|
13
|
-
width?: string | number;
|
|
14
|
-
height?: string | number;
|
|
15
|
-
lines?: number;
|
|
16
|
-
animation?: SkeletonAnimation;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
interface SingleProps {
|
|
20
|
-
variant: SkeletonVariant;
|
|
21
|
-
width?: string | number;
|
|
22
|
-
height?: string | number;
|
|
23
|
-
animation: SkeletonAnimation;
|
|
24
|
-
bgColor: string;
|
|
25
|
-
accentColor: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function SingleSkeleton({ variant, width, height, animation, bgColor, accentColor }: SingleProps) {
|
|
29
|
-
const w = width !== undefined ? (typeof width === 'number' ? `${width}px` : width) : '100%';
|
|
30
|
-
const defaultH: Record<SkeletonVariant, string> = { text: '1em', circular: w, rectangular: '80px' };
|
|
31
|
-
const h = height !== undefined ? (typeof height === 'number' ? `${height}px` : height) : defaultH[variant];
|
|
32
|
-
|
|
33
|
-
const shapeClass = tkx(variant === 'circular' ? 'rounded-full' : variant === 'text' ? 'rounded' : 'rounded-lg');
|
|
34
|
-
const animClass = animation === 'pulse'
|
|
35
|
-
? tkx('animate-pulse')
|
|
36
|
-
: animation === 'wave'
|
|
37
|
-
? tkx('animate-shimmer')
|
|
38
|
-
: '';
|
|
39
|
-
|
|
40
|
-
const waveStyle = animation === 'wave'
|
|
41
|
-
? { background: `linear-gradient(90deg,${bgColor} 25%,${accentColor} 50%,${bgColor} 75%)`, backgroundSize: '200% 100%' }
|
|
42
|
-
: { backgroundColor: bgColor };
|
|
43
|
-
|
|
44
|
-
return (
|
|
45
|
-
<div
|
|
46
|
-
className={cx(shapeClass, animClass)}
|
|
47
|
-
style={{ width: w, height: h, ...waveStyle }}
|
|
48
|
-
/>
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export const TkxSkeleton = forwardRef<HTMLDivElement, TkxSkeletonProps>(
|
|
53
|
-
({ variant = 'rectangular', width, height, lines, animation = 'pulse', className, style, ...rest }, ref) => {
|
|
54
|
-
const theme = useTheme();
|
|
55
|
-
const reducedMotion = useReducedMotion();
|
|
56
|
-
const effectiveAnimation = reducedMotion ? false : animation;
|
|
57
|
-
|
|
58
|
-
if (variant === 'text' && lines && lines > 1) {
|
|
59
|
-
return (
|
|
60
|
-
<div
|
|
61
|
-
ref={ref}
|
|
62
|
-
role="progressbar"
|
|
63
|
-
aria-busy="true"
|
|
64
|
-
aria-label="Loading..."
|
|
65
|
-
className={cx(tkx('flex flex-col gap-2'), className)}
|
|
66
|
-
style={style}
|
|
67
|
-
{...rest}
|
|
68
|
-
>
|
|
69
|
-
{Array.from({ length: lines }, (_, i) => (
|
|
70
|
-
<SingleSkeleton
|
|
71
|
-
key={i}
|
|
72
|
-
variant="text"
|
|
73
|
-
width={i === lines - 1 ? '75%' : width}
|
|
74
|
-
height={height}
|
|
75
|
-
animation={effectiveAnimation}
|
|
76
|
-
bgColor={theme.surfaceAlt}
|
|
77
|
-
accentColor={theme.border}
|
|
78
|
-
/>
|
|
79
|
-
))}
|
|
80
|
-
</div>
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return (
|
|
85
|
-
<div
|
|
86
|
-
ref={ref}
|
|
87
|
-
role="progressbar"
|
|
88
|
-
aria-busy="true"
|
|
89
|
-
aria-label="Loading..."
|
|
90
|
-
className={className}
|
|
91
|
-
style={style}
|
|
92
|
-
{...rest}
|
|
93
|
-
>
|
|
94
|
-
<SingleSkeleton
|
|
95
|
-
variant={variant}
|
|
96
|
-
width={width}
|
|
97
|
-
height={height}
|
|
98
|
-
animation={effectiveAnimation}
|
|
99
|
-
bgColor={theme.surfaceAlt}
|
|
100
|
-
accentColor={theme.border}
|
|
101
|
-
/>
|
|
102
|
-
</div>
|
|
103
|
-
);
|
|
104
|
-
},
|
|
105
|
-
);
|
|
106
|
-
|
|
107
|
-
TkxSkeleton.displayName = 'TkxSkeleton';
|
|
@@ -1,495 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
useState,
|
|
5
|
-
useRef,
|
|
6
|
-
useId,
|
|
7
|
-
useCallback,
|
|
8
|
-
type PointerEvent as ReactPointerEvent,
|
|
9
|
-
} from 'react';
|
|
10
|
-
import { useTheme } from '../themes';
|
|
11
|
-
import { tkx } from '../engine/tkx';
|
|
12
|
-
import { sanitizeString } from '../engine/security';
|
|
13
|
-
import { useReducedMotion } from '../hooks';
|
|
14
|
-
|
|
15
|
-
export interface TkxSliderProps {
|
|
16
|
-
value?: number;
|
|
17
|
-
defaultValue?: number;
|
|
18
|
-
onChange?: (value: number) => void;
|
|
19
|
-
rangeValue?: [number, number];
|
|
20
|
-
onRangeChange?: (range: [number, number]) => void;
|
|
21
|
-
min?: number;
|
|
22
|
-
max?: number;
|
|
23
|
-
step?: number;
|
|
24
|
-
isRange?: boolean;
|
|
25
|
-
label?: string;
|
|
26
|
-
showValue?: boolean;
|
|
27
|
-
showTicks?: boolean;
|
|
28
|
-
tickCount?: number;
|
|
29
|
-
isDisabled?: boolean;
|
|
30
|
-
colorScheme?: 'primary' | 'success' | 'danger' | 'warning';
|
|
31
|
-
size?: 'sm' | 'md' | 'lg';
|
|
32
|
-
marks?: { value: number; label: string }[];
|
|
33
|
-
orientation?: 'horizontal' | 'vertical';
|
|
34
|
-
showTooltip?: boolean | 'hover' | 'always';
|
|
35
|
-
formatValue?: (value: number) => string;
|
|
36
|
-
onChangeEnd?: (value: number) => void;
|
|
37
|
-
onRangeChangeEnd?: (range: [number, number]) => void;
|
|
38
|
-
gradient?: boolean;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const SIZE_MAP = {
|
|
42
|
-
sm: { track: 4, thumb: 14, fontSize: '0.75rem' },
|
|
43
|
-
md: { track: 6, thumb: 18, fontSize: '0.875rem' },
|
|
44
|
-
lg: { track: 8, thumb: 22, fontSize: '1rem' },
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
function clamp(v: number, min: number, max: number): number {
|
|
48
|
-
return Math.min(Math.max(v, min), max);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function snapToStep(v: number, min: number, step: number): number {
|
|
52
|
-
return Math.round((v - min) / step) * step + min;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function toPercent(v: number, min: number, max: number): number {
|
|
56
|
-
return ((v - min) / (max - min)) * 100;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
interface ThumbProps {
|
|
60
|
-
value: number;
|
|
61
|
-
min: number;
|
|
62
|
-
max: number;
|
|
63
|
-
step: number;
|
|
64
|
-
isDisabled: boolean;
|
|
65
|
-
trackColor: string;
|
|
66
|
-
trackHeight: number;
|
|
67
|
-
thumbSize: number;
|
|
68
|
-
ariaLabel: string;
|
|
69
|
-
tooltipMode: false | 'hover' | 'always';
|
|
70
|
-
formatValue: (v: number) => string;
|
|
71
|
-
orientation: 'horizontal' | 'vertical';
|
|
72
|
-
onChange: (v: number) => void;
|
|
73
|
-
onChangeEnd?: () => void;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function Thumb({ value, min, max, step, isDisabled, trackColor, thumbSize, ariaLabel, tooltipMode, formatValue, orientation, onChange, onChangeEnd }: ThumbProps) {
|
|
77
|
-
const [focused, setFocused] = useState(false);
|
|
78
|
-
const [dragging, setDragging] = useState(false);
|
|
79
|
-
const [hovered, setHovered] = useState(false);
|
|
80
|
-
|
|
81
|
-
const handleKeyDown = (e: React.KeyboardEvent) => {
|
|
82
|
-
if (isDisabled) return;
|
|
83
|
-
if (e.key === 'ArrowRight' || e.key === 'ArrowUp') {
|
|
84
|
-
e.preventDefault();
|
|
85
|
-
onChange(clamp(snapToStep(value + step, min, step), min, max));
|
|
86
|
-
} else if (e.key === 'ArrowLeft' || e.key === 'ArrowDown') {
|
|
87
|
-
e.preventDefault();
|
|
88
|
-
onChange(clamp(snapToStep(value - step, min, step), min, max));
|
|
89
|
-
} else if (e.key === 'Home') {
|
|
90
|
-
e.preventDefault(); onChange(min);
|
|
91
|
-
} else if (e.key === 'End') {
|
|
92
|
-
e.preventDefault(); onChange(max);
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
const isVertical = orientation === 'vertical';
|
|
97
|
-
const percent = toPercent(value, min, max);
|
|
98
|
-
const showTip =
|
|
99
|
-
tooltipMode === 'always' ||
|
|
100
|
-
(tooltipMode === 'hover' && (hovered || dragging || focused));
|
|
101
|
-
|
|
102
|
-
const positionStyle: React.CSSProperties = isVertical
|
|
103
|
-
? {
|
|
104
|
-
position: 'absolute',
|
|
105
|
-
bottom: `${percent}%`,
|
|
106
|
-
transform: 'translateY(50%)',
|
|
107
|
-
left: '50%',
|
|
108
|
-
marginLeft: `-${thumbSize / 2}px`,
|
|
109
|
-
zIndex: 2,
|
|
110
|
-
cursor: isDisabled ? 'not-allowed' : 'grab',
|
|
111
|
-
}
|
|
112
|
-
: {
|
|
113
|
-
position: 'absolute',
|
|
114
|
-
left: `${percent}%`,
|
|
115
|
-
transform: 'translateX(-50%)',
|
|
116
|
-
top: '50%',
|
|
117
|
-
marginTop: `-${thumbSize / 2}px`,
|
|
118
|
-
zIndex: 2,
|
|
119
|
-
cursor: isDisabled ? 'not-allowed' : 'grab',
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
const tooltipStyle: React.CSSProperties = isVertical
|
|
123
|
-
? {
|
|
124
|
-
position: 'absolute',
|
|
125
|
-
left: thumbSize + 6,
|
|
126
|
-
top: '50%',
|
|
127
|
-
transform: 'translateY(-50%)',
|
|
128
|
-
backgroundColor: trackColor,
|
|
129
|
-
color: '#fff',
|
|
130
|
-
borderRadius: '4px',
|
|
131
|
-
padding: '2px 6px',
|
|
132
|
-
fontSize: '0.75rem',
|
|
133
|
-
whiteSpace: 'nowrap',
|
|
134
|
-
pointerEvents: 'none',
|
|
135
|
-
}
|
|
136
|
-
: {
|
|
137
|
-
position: 'absolute',
|
|
138
|
-
bottom: thumbSize + 6,
|
|
139
|
-
left: '50%',
|
|
140
|
-
transform: 'translateX(-50%)',
|
|
141
|
-
backgroundColor: trackColor,
|
|
142
|
-
color: '#fff',
|
|
143
|
-
borderRadius: '4px',
|
|
144
|
-
padding: '2px 6px',
|
|
145
|
-
fontSize: '0.75rem',
|
|
146
|
-
whiteSpace: 'nowrap',
|
|
147
|
-
pointerEvents: 'none',
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
return (
|
|
151
|
-
<div style={positionStyle}>
|
|
152
|
-
{showTip && (
|
|
153
|
-
<div style={tooltipStyle}>
|
|
154
|
-
{formatValue(value)}
|
|
155
|
-
</div>
|
|
156
|
-
)}
|
|
157
|
-
<div
|
|
158
|
-
role="slider"
|
|
159
|
-
tabIndex={isDisabled ? -1 : 0}
|
|
160
|
-
aria-label={ariaLabel}
|
|
161
|
-
aria-valuemin={min}
|
|
162
|
-
aria-valuemax={max}
|
|
163
|
-
aria-valuenow={value}
|
|
164
|
-
aria-disabled={isDisabled}
|
|
165
|
-
aria-orientation={orientation}
|
|
166
|
-
onKeyDown={handleKeyDown}
|
|
167
|
-
onFocus={() => setFocused(true)}
|
|
168
|
-
onBlur={() => setFocused(false)}
|
|
169
|
-
onPointerEnter={() => setHovered(true)}
|
|
170
|
-
onPointerLeave={() => setHovered(false)}
|
|
171
|
-
onPointerDown={(e) => { if (!isDisabled) { setDragging(true); (e.target as HTMLElement).setPointerCapture(e.pointerId); }}}
|
|
172
|
-
onPointerUp={() => { setDragging(false); onChangeEnd?.(); }}
|
|
173
|
-
style={{
|
|
174
|
-
width: thumbSize,
|
|
175
|
-
height: thumbSize,
|
|
176
|
-
borderRadius: '50%',
|
|
177
|
-
backgroundColor: isDisabled ? '#888' : trackColor,
|
|
178
|
-
border: `3px solid #fff`,
|
|
179
|
-
boxShadow: focused ? `0 0 0 3px ${trackColor}44` : '0 1px 4px rgba(0,0,0,0.3)',
|
|
180
|
-
outline: 'none',
|
|
181
|
-
display: 'block',
|
|
182
|
-
transition: 'box-shadow 150ms ease',
|
|
183
|
-
}}
|
|
184
|
-
/>
|
|
185
|
-
</div>
|
|
186
|
-
);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
export function TkxSlider({
|
|
190
|
-
value,
|
|
191
|
-
defaultValue = 0,
|
|
192
|
-
onChange,
|
|
193
|
-
rangeValue,
|
|
194
|
-
onRangeChange,
|
|
195
|
-
min = 0,
|
|
196
|
-
max = 100,
|
|
197
|
-
step = 1,
|
|
198
|
-
isRange = false,
|
|
199
|
-
label,
|
|
200
|
-
showValue = false,
|
|
201
|
-
showTicks = false,
|
|
202
|
-
tickCount = 5,
|
|
203
|
-
isDisabled = false,
|
|
204
|
-
colorScheme = 'primary',
|
|
205
|
-
size = 'md',
|
|
206
|
-
marks,
|
|
207
|
-
orientation = 'horizontal',
|
|
208
|
-
showTooltip = false,
|
|
209
|
-
formatValue: formatValueProp,
|
|
210
|
-
onChangeEnd,
|
|
211
|
-
onRangeChangeEnd,
|
|
212
|
-
gradient = false,
|
|
213
|
-
}: TkxSliderProps) {
|
|
214
|
-
const theme = useTheme();
|
|
215
|
-
const id = useId();
|
|
216
|
-
const reducedMotion = useReducedMotion();
|
|
217
|
-
|
|
218
|
-
const isControlled = value !== undefined;
|
|
219
|
-
const [internalValue, setInternalValue] = useState(defaultValue);
|
|
220
|
-
const singleValue = isControlled ? value! : internalValue;
|
|
221
|
-
|
|
222
|
-
const isRangeControlled = rangeValue !== undefined;
|
|
223
|
-
const [internalRange, setInternalRange] = useState<[number, number]>([min, max]);
|
|
224
|
-
const rangeVal = isRangeControlled ? rangeValue! : internalRange;
|
|
225
|
-
|
|
226
|
-
const trackRef = useRef<HTMLDivElement>(null);
|
|
227
|
-
const singleValueRef = useRef(singleValue);
|
|
228
|
-
singleValueRef.current = singleValue;
|
|
229
|
-
const rangeValRef = useRef(rangeVal);
|
|
230
|
-
rangeValRef.current = rangeVal;
|
|
231
|
-
|
|
232
|
-
const trackColor = {
|
|
233
|
-
primary: theme.primary,
|
|
234
|
-
success: theme.success,
|
|
235
|
-
danger: theme.danger,
|
|
236
|
-
warning: theme.warning,
|
|
237
|
-
}[colorScheme];
|
|
238
|
-
|
|
239
|
-
const sizes = SIZE_MAP[size];
|
|
240
|
-
const isVertical = orientation === 'vertical';
|
|
241
|
-
|
|
242
|
-
const tooltipMode: false | 'hover' | 'always' =
|
|
243
|
-
showTooltip === true ? 'hover' :
|
|
244
|
-
showTooltip === false ? false :
|
|
245
|
-
showTooltip; // 'hover' | 'always'
|
|
246
|
-
|
|
247
|
-
const formatVal = formatValueProp ?? ((v: number) => String(v));
|
|
248
|
-
|
|
249
|
-
const trackColorLight = trackColor + '66'; // 40% opacity variant for gradient end
|
|
250
|
-
|
|
251
|
-
const getValueFromPointer = useCallback((clientX: number, clientY?: number): number => {
|
|
252
|
-
const track = trackRef.current;
|
|
253
|
-
if (!track) return min;
|
|
254
|
-
const rect = track.getBoundingClientRect();
|
|
255
|
-
let ratio: number;
|
|
256
|
-
if (isVertical) {
|
|
257
|
-
// vertical: bottom = min, top = max
|
|
258
|
-
ratio = clamp((rect.bottom - (clientY ?? 0)) / rect.height, 0, 1);
|
|
259
|
-
} else {
|
|
260
|
-
ratio = clamp((clientX - rect.left) / rect.width, 0, 1);
|
|
261
|
-
}
|
|
262
|
-
const raw = ratio * (max - min) + min;
|
|
263
|
-
return clamp(snapToStep(raw, min, step), min, max);
|
|
264
|
-
}, [min, max, step, isVertical]);
|
|
265
|
-
|
|
266
|
-
const handleTrackPointerDown = useCallback((e: ReactPointerEvent<HTMLDivElement>) => {
|
|
267
|
-
if (isDisabled) return;
|
|
268
|
-
const v = getValueFromPointer(e.clientX, e.clientY);
|
|
269
|
-
|
|
270
|
-
if (!isRange) {
|
|
271
|
-
if (!isControlled) setInternalValue(v);
|
|
272
|
-
onChange?.(v);
|
|
273
|
-
} else {
|
|
274
|
-
const [lo, hi] = rangeVal;
|
|
275
|
-
const distLo = Math.abs(v - lo);
|
|
276
|
-
const distHi = Math.abs(v - hi);
|
|
277
|
-
const newRange: [number, number] = distLo <= distHi ? [v, hi] : [lo, v];
|
|
278
|
-
if (!isRangeControlled) setInternalRange(newRange);
|
|
279
|
-
onRangeChange?.(newRange);
|
|
280
|
-
}
|
|
281
|
-
}, [isDisabled, isRange, isControlled, isRangeControlled, getValueFromPointer, onChange, onRangeChange, rangeVal]);
|
|
282
|
-
|
|
283
|
-
const setSingleValue = (v: number) => {
|
|
284
|
-
if (!isControlled) setInternalValue(v);
|
|
285
|
-
onChange?.(v);
|
|
286
|
-
};
|
|
287
|
-
|
|
288
|
-
const setRangeStart = (v: number) => {
|
|
289
|
-
const newRange: [number, number] = [clamp(v, min, rangeVal[1]), rangeVal[1]];
|
|
290
|
-
if (!isRangeControlled) setInternalRange(newRange);
|
|
291
|
-
onRangeChange?.(newRange);
|
|
292
|
-
};
|
|
293
|
-
|
|
294
|
-
const setRangeEnd = (v: number) => {
|
|
295
|
-
const newRange: [number, number] = [rangeVal[0], clamp(v, rangeVal[0], max)];
|
|
296
|
-
if (!isRangeControlled) setInternalRange(newRange);
|
|
297
|
-
onRangeChange?.(newRange);
|
|
298
|
-
};
|
|
299
|
-
|
|
300
|
-
const fillLeft = isRange ? toPercent(rangeVal[0], min, max) : 0;
|
|
301
|
-
const fillRight = isRange ? toPercent(rangeVal[1], min, max) : toPercent(singleValue, min, max);
|
|
302
|
-
|
|
303
|
-
const ticks = showTicks
|
|
304
|
-
? Array.from({ length: tickCount }, (_, i) => min + (i / (tickCount - 1)) * (max - min))
|
|
305
|
-
: [];
|
|
306
|
-
|
|
307
|
-
const safeLabel = label ? sanitizeString(label) : undefined;
|
|
308
|
-
const transition = reducedMotion ? 'none' : 'background 150ms ease';
|
|
309
|
-
|
|
310
|
-
return (
|
|
311
|
-
<div className={tkx('flex flex-col gap-2')} style={{ opacity: isDisabled ? 0.55 : 1, ...(isVertical ? { height: 200, width: 'auto', display: 'inline-flex' } : { width: '100%' }) }}>
|
|
312
|
-
{(safeLabel || showValue) && (
|
|
313
|
-
<div className={tkx('flex items-center justify-between')}>
|
|
314
|
-
{safeLabel && (
|
|
315
|
-
<label
|
|
316
|
-
htmlFor={id}
|
|
317
|
-
className={tkx('text-sm font-medium')}
|
|
318
|
-
style={{ color: theme.text, fontSize: sizes.fontSize }}
|
|
319
|
-
>
|
|
320
|
-
{safeLabel}
|
|
321
|
-
</label>
|
|
322
|
-
)}
|
|
323
|
-
{showValue && !isRange && (
|
|
324
|
-
<span className={tkx('text-sm tabular-nums')} style={{ color: theme.textMuted, fontSize: sizes.fontSize }}>
|
|
325
|
-
{formatVal(singleValue)}
|
|
326
|
-
</span>
|
|
327
|
-
)}
|
|
328
|
-
{showValue && isRange && (
|
|
329
|
-
<span className={tkx('text-sm tabular-nums')} style={{ color: theme.textMuted, fontSize: sizes.fontSize }}>
|
|
330
|
-
{formatVal(rangeVal[0])} – {formatVal(rangeVal[1])}
|
|
331
|
-
</span>
|
|
332
|
-
)}
|
|
333
|
-
</div>
|
|
334
|
-
)}
|
|
335
|
-
|
|
336
|
-
{/* Track container */}
|
|
337
|
-
<div style={{
|
|
338
|
-
position: 'relative',
|
|
339
|
-
...(isVertical
|
|
340
|
-
? { paddingLeft: sizes.thumb / 2, paddingRight: sizes.thumb / 2, flex: 1 }
|
|
341
|
-
: { paddingTop: sizes.thumb / 2, paddingBottom: sizes.thumb / 2 }),
|
|
342
|
-
}}>
|
|
343
|
-
<div
|
|
344
|
-
ref={trackRef}
|
|
345
|
-
onPointerDown={handleTrackPointerDown}
|
|
346
|
-
style={{
|
|
347
|
-
position: 'relative',
|
|
348
|
-
...(isVertical
|
|
349
|
-
? { width: sizes.track, height: '100%' }
|
|
350
|
-
: { height: sizes.track }),
|
|
351
|
-
borderRadius: 9999,
|
|
352
|
-
backgroundColor: theme.border,
|
|
353
|
-
cursor: isDisabled ? 'not-allowed' : 'pointer',
|
|
354
|
-
userSelect: 'none',
|
|
355
|
-
touchAction: 'none',
|
|
356
|
-
}}
|
|
357
|
-
>
|
|
358
|
-
{/* Fill */}
|
|
359
|
-
<div
|
|
360
|
-
style={{
|
|
361
|
-
position: 'absolute',
|
|
362
|
-
...(isVertical
|
|
363
|
-
? { left: 0, bottom: `${fillLeft}%`, height: `${fillRight - fillLeft}%`, width: '100%' }
|
|
364
|
-
: { top: 0, left: `${fillLeft}%`, width: `${fillRight - fillLeft}%`, height: '100%' }),
|
|
365
|
-
borderRadius: 9999,
|
|
366
|
-
...(isDisabled
|
|
367
|
-
? { backgroundColor: theme.textMuted }
|
|
368
|
-
: gradient
|
|
369
|
-
? { background: isVertical
|
|
370
|
-
? `linear-gradient(to top, ${trackColorLight}, ${trackColor})`
|
|
371
|
-
: `linear-gradient(to right, ${trackColorLight}, ${trackColor})` }
|
|
372
|
-
: { backgroundColor: trackColor }),
|
|
373
|
-
transition,
|
|
374
|
-
}}
|
|
375
|
-
/>
|
|
376
|
-
|
|
377
|
-
{/* Tick marks */}
|
|
378
|
-
{ticks.map((t, i) => (
|
|
379
|
-
<div
|
|
380
|
-
key={i}
|
|
381
|
-
style={{
|
|
382
|
-
position: 'absolute',
|
|
383
|
-
...(isVertical
|
|
384
|
-
? { bottom: `${toPercent(t, min, max)}%`, left: '50%', transform: 'translate(-50%, 50%)', height: 3, width: sizes.track + 4 }
|
|
385
|
-
: { left: `${toPercent(t, min, max)}%`, top: '50%', transform: 'translate(-50%, -50%)', width: 3, height: sizes.track + 4 }),
|
|
386
|
-
backgroundColor: theme.surface,
|
|
387
|
-
borderRadius: 9999,
|
|
388
|
-
pointerEvents: 'none',
|
|
389
|
-
}}
|
|
390
|
-
/>
|
|
391
|
-
))}
|
|
392
|
-
|
|
393
|
-
{/* Thumbs */}
|
|
394
|
-
{!isRange ? (
|
|
395
|
-
<Thumb
|
|
396
|
-
value={singleValue}
|
|
397
|
-
min={min}
|
|
398
|
-
max={max}
|
|
399
|
-
step={step}
|
|
400
|
-
isDisabled={isDisabled}
|
|
401
|
-
trackColor={trackColor}
|
|
402
|
-
trackHeight={sizes.track}
|
|
403
|
-
thumbSize={sizes.thumb}
|
|
404
|
-
ariaLabel={safeLabel ?? 'Slider'}
|
|
405
|
-
tooltipMode={tooltipMode}
|
|
406
|
-
formatValue={formatVal}
|
|
407
|
-
orientation={orientation}
|
|
408
|
-
onChange={setSingleValue}
|
|
409
|
-
onChangeEnd={onChangeEnd ? () => onChangeEnd(singleValueRef.current) : undefined}
|
|
410
|
-
/>
|
|
411
|
-
) : (
|
|
412
|
-
<>
|
|
413
|
-
<Thumb
|
|
414
|
-
value={rangeVal[0]}
|
|
415
|
-
min={min}
|
|
416
|
-
max={rangeVal[1]}
|
|
417
|
-
step={step}
|
|
418
|
-
isDisabled={isDisabled}
|
|
419
|
-
trackColor={trackColor}
|
|
420
|
-
trackHeight={sizes.track}
|
|
421
|
-
thumbSize={sizes.thumb}
|
|
422
|
-
ariaLabel={`${safeLabel ?? 'Range'} start`}
|
|
423
|
-
tooltipMode={tooltipMode}
|
|
424
|
-
formatValue={formatVal}
|
|
425
|
-
orientation={orientation}
|
|
426
|
-
onChange={setRangeStart}
|
|
427
|
-
onChangeEnd={onRangeChangeEnd ? () => onRangeChangeEnd(rangeValRef.current) : undefined}
|
|
428
|
-
/>
|
|
429
|
-
<Thumb
|
|
430
|
-
value={rangeVal[1]}
|
|
431
|
-
min={rangeVal[0]}
|
|
432
|
-
max={max}
|
|
433
|
-
step={step}
|
|
434
|
-
isDisabled={isDisabled}
|
|
435
|
-
trackColor={trackColor}
|
|
436
|
-
trackHeight={sizes.track}
|
|
437
|
-
thumbSize={sizes.thumb}
|
|
438
|
-
ariaLabel={`${safeLabel ?? 'Range'} end`}
|
|
439
|
-
tooltipMode={tooltipMode}
|
|
440
|
-
formatValue={formatVal}
|
|
441
|
-
orientation={orientation}
|
|
442
|
-
onChange={setRangeEnd}
|
|
443
|
-
onChangeEnd={onRangeChangeEnd ? () => onRangeChangeEnd(rangeValRef.current) : undefined}
|
|
444
|
-
/>
|
|
445
|
-
</>
|
|
446
|
-
)}
|
|
447
|
-
</div>
|
|
448
|
-
|
|
449
|
-
{/* Mark labels */}
|
|
450
|
-
{marks && marks.length > 0 && (
|
|
451
|
-
<div style={{ position: isVertical ? 'absolute' : 'relative', ...(isVertical ? { left: '100%', top: 0, bottom: 0, marginLeft: 8 } : { marginTop: 8 }) }}>
|
|
452
|
-
{marks.map((mark, i) => (
|
|
453
|
-
<div
|
|
454
|
-
key={i}
|
|
455
|
-
style={{
|
|
456
|
-
position: 'absolute',
|
|
457
|
-
...(isVertical
|
|
458
|
-
? { bottom: `${toPercent(mark.value, min, max)}%`, transform: 'translateY(50%)', left: 0 }
|
|
459
|
-
: { left: `${toPercent(mark.value, min, max)}%`, transform: 'translateX(-50%)' }),
|
|
460
|
-
fontSize: '0.6875rem',
|
|
461
|
-
color: theme.textMuted,
|
|
462
|
-
whiteSpace: 'nowrap',
|
|
463
|
-
}}
|
|
464
|
-
>
|
|
465
|
-
{sanitizeString(mark.label)}
|
|
466
|
-
</div>
|
|
467
|
-
))}
|
|
468
|
-
</div>
|
|
469
|
-
)}
|
|
470
|
-
</div>
|
|
471
|
-
|
|
472
|
-
{/* Tick labels when no marks */}
|
|
473
|
-
{showTicks && !marks && !isVertical && (
|
|
474
|
-
<div style={{ position: 'relative', height: '1rem' }}>
|
|
475
|
-
{ticks.map((t, i) => (
|
|
476
|
-
<span
|
|
477
|
-
key={i}
|
|
478
|
-
style={{
|
|
479
|
-
position: 'absolute',
|
|
480
|
-
left: `${toPercent(t, min, max)}%`,
|
|
481
|
-
transform: 'translateX(-50%)',
|
|
482
|
-
fontSize: '0.6875rem',
|
|
483
|
-
color: theme.textMuted,
|
|
484
|
-
}}
|
|
485
|
-
>
|
|
486
|
-
{formatVal(Math.round(t))}
|
|
487
|
-
</span>
|
|
488
|
-
))}
|
|
489
|
-
</div>
|
|
490
|
-
)}
|
|
491
|
-
</div>
|
|
492
|
-
);
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
TkxSlider.displayName = 'TkxSlider';
|