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,221 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { type ReactNode, type CSSProperties, createElement } from 'react';
|
|
4
|
-
import { useTheme } from '../themes';
|
|
5
|
-
import { sanitizeString } from '../engine/security';
|
|
6
|
-
|
|
7
|
-
// ── Interface ───────────────────────────────────────────────────────────────
|
|
8
|
-
|
|
9
|
-
export interface TkxEmptyProps {
|
|
10
|
-
image?: ReactNode | 'default' | 'simple';
|
|
11
|
-
description?: ReactNode;
|
|
12
|
-
children?: ReactNode;
|
|
13
|
-
style?: CSSProperties;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// ── Default SVG Illustration (empty box) ────────────────────────────────────
|
|
17
|
-
|
|
18
|
-
function DefaultImage({ color, mutedColor }: { color: string; mutedColor: string }) {
|
|
19
|
-
return createElement(
|
|
20
|
-
'svg',
|
|
21
|
-
{
|
|
22
|
-
width: 120,
|
|
23
|
-
height: 100,
|
|
24
|
-
viewBox: '0 0 120 100',
|
|
25
|
-
fill: 'none',
|
|
26
|
-
'aria-hidden': 'true',
|
|
27
|
-
},
|
|
28
|
-
// Box base
|
|
29
|
-
createElement('path', {
|
|
30
|
-
d: 'M20 40 L60 20 L100 40 L60 60 Z',
|
|
31
|
-
fill: `${mutedColor}18`,
|
|
32
|
-
stroke: mutedColor,
|
|
33
|
-
strokeWidth: 1.5,
|
|
34
|
-
strokeLinejoin: 'round',
|
|
35
|
-
}),
|
|
36
|
-
// Box left side
|
|
37
|
-
createElement('path', {
|
|
38
|
-
d: 'M20 40 L20 65 L60 85 L60 60 Z',
|
|
39
|
-
fill: `${mutedColor}10`,
|
|
40
|
-
stroke: mutedColor,
|
|
41
|
-
strokeWidth: 1.5,
|
|
42
|
-
strokeLinejoin: 'round',
|
|
43
|
-
}),
|
|
44
|
-
// Box right side
|
|
45
|
-
createElement('path', {
|
|
46
|
-
d: 'M100 40 L100 65 L60 85 L60 60 Z',
|
|
47
|
-
fill: `${mutedColor}0d`,
|
|
48
|
-
stroke: mutedColor,
|
|
49
|
-
strokeWidth: 1.5,
|
|
50
|
-
strokeLinejoin: 'round',
|
|
51
|
-
}),
|
|
52
|
-
// Box opening flap left
|
|
53
|
-
createElement('path', {
|
|
54
|
-
d: 'M20 40 L40 28 L60 40 L40 52 Z',
|
|
55
|
-
fill: `${color}15`,
|
|
56
|
-
stroke: color,
|
|
57
|
-
strokeWidth: 1,
|
|
58
|
-
strokeLinejoin: 'round',
|
|
59
|
-
strokeDasharray: '3 2',
|
|
60
|
-
}),
|
|
61
|
-
// Box opening flap right
|
|
62
|
-
createElement('path', {
|
|
63
|
-
d: 'M60 40 L80 28 L100 40 L80 52 Z',
|
|
64
|
-
fill: `${color}15`,
|
|
65
|
-
stroke: color,
|
|
66
|
-
strokeWidth: 1,
|
|
67
|
-
strokeLinejoin: 'round',
|
|
68
|
-
strokeDasharray: '3 2',
|
|
69
|
-
}),
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// ── Simple SVG Icon (minimal) ───────────────────────────────────────────────
|
|
74
|
-
|
|
75
|
-
function SimpleImage({ mutedColor }: { mutedColor: string }) {
|
|
76
|
-
return createElement(
|
|
77
|
-
'svg',
|
|
78
|
-
{
|
|
79
|
-
width: 64,
|
|
80
|
-
height: 64,
|
|
81
|
-
viewBox: '0 0 64 64',
|
|
82
|
-
fill: 'none',
|
|
83
|
-
'aria-hidden': 'true',
|
|
84
|
-
},
|
|
85
|
-
// Page outline
|
|
86
|
-
createElement('rect', {
|
|
87
|
-
x: 16,
|
|
88
|
-
y: 8,
|
|
89
|
-
width: 32,
|
|
90
|
-
height: 40,
|
|
91
|
-
rx: 3,
|
|
92
|
-
fill: `${mutedColor}12`,
|
|
93
|
-
stroke: mutedColor,
|
|
94
|
-
strokeWidth: 1.5,
|
|
95
|
-
}),
|
|
96
|
-
// Lines on page
|
|
97
|
-
createElement('line', {
|
|
98
|
-
x1: 24,
|
|
99
|
-
y1: 20,
|
|
100
|
-
x2: 40,
|
|
101
|
-
y2: 20,
|
|
102
|
-
stroke: mutedColor,
|
|
103
|
-
strokeWidth: 1.5,
|
|
104
|
-
strokeLinecap: 'round',
|
|
105
|
-
}),
|
|
106
|
-
createElement('line', {
|
|
107
|
-
x1: 24,
|
|
108
|
-
y1: 28,
|
|
109
|
-
x2: 36,
|
|
110
|
-
y2: 28,
|
|
111
|
-
stroke: mutedColor,
|
|
112
|
-
strokeWidth: 1.5,
|
|
113
|
-
strokeLinecap: 'round',
|
|
114
|
-
}),
|
|
115
|
-
createElement('line', {
|
|
116
|
-
x1: 24,
|
|
117
|
-
y1: 36,
|
|
118
|
-
x2: 32,
|
|
119
|
-
y2: 36,
|
|
120
|
-
stroke: mutedColor,
|
|
121
|
-
strokeWidth: 1.5,
|
|
122
|
-
strokeLinecap: 'round',
|
|
123
|
-
}),
|
|
124
|
-
// Circle with dash (empty indicator)
|
|
125
|
-
createElement('circle', {
|
|
126
|
-
cx: 32,
|
|
127
|
-
cy: 54,
|
|
128
|
-
r: 6,
|
|
129
|
-
stroke: mutedColor,
|
|
130
|
-
strokeWidth: 1.2,
|
|
131
|
-
fill: 'none',
|
|
132
|
-
}),
|
|
133
|
-
createElement('line', {
|
|
134
|
-
x1: 28,
|
|
135
|
-
y1: 54,
|
|
136
|
-
x2: 36,
|
|
137
|
-
y2: 54,
|
|
138
|
-
stroke: mutedColor,
|
|
139
|
-
strokeWidth: 1.2,
|
|
140
|
-
strokeLinecap: 'round',
|
|
141
|
-
}),
|
|
142
|
-
);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// ── TkxEmpty ────────────────────────────────────────────────────────────────
|
|
146
|
-
|
|
147
|
-
export function TkxEmpty({
|
|
148
|
-
image = 'default',
|
|
149
|
-
description = 'No data',
|
|
150
|
-
children,
|
|
151
|
-
style,
|
|
152
|
-
}: TkxEmptyProps) {
|
|
153
|
-
const theme = useTheme();
|
|
154
|
-
|
|
155
|
-
const safeDescription =
|
|
156
|
-
typeof description === 'string' ? sanitizeString(description) : description;
|
|
157
|
-
|
|
158
|
-
let imageContent: ReactNode;
|
|
159
|
-
if (image === 'default') {
|
|
160
|
-
imageContent = createElement(DefaultImage, {
|
|
161
|
-
color: theme.primary,
|
|
162
|
-
mutedColor: theme.textMuted,
|
|
163
|
-
});
|
|
164
|
-
} else if (image === 'simple') {
|
|
165
|
-
imageContent = createElement(SimpleImage, { mutedColor: theme.textMuted });
|
|
166
|
-
} else {
|
|
167
|
-
imageContent = image;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
return createElement(
|
|
171
|
-
'div',
|
|
172
|
-
{
|
|
173
|
-
role: 'status',
|
|
174
|
-
style: {
|
|
175
|
-
display: 'flex',
|
|
176
|
-
flexDirection: 'column' as const,
|
|
177
|
-
alignItems: 'center',
|
|
178
|
-
justifyContent: 'center',
|
|
179
|
-
padding: '32px 16px',
|
|
180
|
-
textAlign: 'center' as const,
|
|
181
|
-
...style,
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
// Image area
|
|
185
|
-
createElement(
|
|
186
|
-
'div',
|
|
187
|
-
{
|
|
188
|
-
style: {
|
|
189
|
-
marginBottom: '12px',
|
|
190
|
-
opacity: 0.85,
|
|
191
|
-
},
|
|
192
|
-
},
|
|
193
|
-
imageContent,
|
|
194
|
-
),
|
|
195
|
-
// Description
|
|
196
|
-
safeDescription &&
|
|
197
|
-
createElement(
|
|
198
|
-
'div',
|
|
199
|
-
{
|
|
200
|
-
style: {
|
|
201
|
-
color: theme.textMuted,
|
|
202
|
-
fontSize: '0.875rem',
|
|
203
|
-
lineHeight: '1.5',
|
|
204
|
-
maxWidth: '320px',
|
|
205
|
-
},
|
|
206
|
-
},
|
|
207
|
-
safeDescription,
|
|
208
|
-
),
|
|
209
|
-
// Action area (children)
|
|
210
|
-
children &&
|
|
211
|
-
createElement(
|
|
212
|
-
'div',
|
|
213
|
-
{
|
|
214
|
-
style: {
|
|
215
|
-
marginTop: '16px',
|
|
216
|
-
},
|
|
217
|
-
},
|
|
218
|
-
children,
|
|
219
|
-
),
|
|
220
|
-
);
|
|
221
|
-
}
|
|
@@ -1,373 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
useState,
|
|
5
|
-
useRef,
|
|
6
|
-
useCallback,
|
|
7
|
-
useEffect,
|
|
8
|
-
useId,
|
|
9
|
-
type DragEvent,
|
|
10
|
-
type ChangeEvent,
|
|
11
|
-
} from 'react';
|
|
12
|
-
import { useTheme } from '../themes';
|
|
13
|
-
import { sanitizeString } from '../engine/security';
|
|
14
|
-
import { useReducedMotion } from '../hooks';
|
|
15
|
-
import { tkx, cx } from '../engine/tkx';
|
|
16
|
-
|
|
17
|
-
export interface TkxFileUploadProps {
|
|
18
|
-
accept?: string;
|
|
19
|
-
multiple?: boolean;
|
|
20
|
-
maxSize?: number;
|
|
21
|
-
maxFiles?: number;
|
|
22
|
-
onChange?: (files: File[]) => void;
|
|
23
|
-
onError?: (error: string) => void;
|
|
24
|
-
label?: string;
|
|
25
|
-
hint?: string;
|
|
26
|
-
isDisabled?: boolean;
|
|
27
|
-
preview?: boolean;
|
|
28
|
-
dragDrop?: boolean;
|
|
29
|
-
variant?: 'dropzone' | 'button';
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
interface UploadedFile {
|
|
33
|
-
file: File;
|
|
34
|
-
id: string;
|
|
35
|
-
objectUrl?: string;
|
|
36
|
-
progress: number;
|
|
37
|
-
error?: string;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function formatSize(bytes: number): string {
|
|
41
|
-
if (bytes < 1024) return `${bytes} B`;
|
|
42
|
-
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
43
|
-
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function FileTypeIcon({ mimeType, color }: { mimeType: string; color: string }) {
|
|
47
|
-
if (mimeType.startsWith('image/')) {
|
|
48
|
-
return (
|
|
49
|
-
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth={1.5} aria-hidden="true">
|
|
50
|
-
<rect x="3" y="3" width="18" height="18" rx="2" />
|
|
51
|
-
<circle cx="8.5" cy="8.5" r="1.5" />
|
|
52
|
-
<path d="M21 15l-5-5L5 21" />
|
|
53
|
-
</svg>
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
if (mimeType === 'application/pdf') {
|
|
57
|
-
return (
|
|
58
|
-
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth={1.5} aria-hidden="true">
|
|
59
|
-
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" />
|
|
60
|
-
<polyline points="14 2 14 8 20 8" />
|
|
61
|
-
<line x1="9" y1="13" x2="15" y2="13" />
|
|
62
|
-
<line x1="9" y1="17" x2="11" y2="17" />
|
|
63
|
-
</svg>
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
return (
|
|
67
|
-
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth={1.5} aria-hidden="true">
|
|
68
|
-
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" />
|
|
69
|
-
<polyline points="14 2 14 8 20 8" />
|
|
70
|
-
</svg>
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
let idCounter = 0;
|
|
75
|
-
function uniqueId() { return `tkx-file-${++idCounter}`; }
|
|
76
|
-
|
|
77
|
-
export function TkxFileUpload({
|
|
78
|
-
accept,
|
|
79
|
-
multiple = false,
|
|
80
|
-
maxSize,
|
|
81
|
-
maxFiles,
|
|
82
|
-
onChange,
|
|
83
|
-
onError,
|
|
84
|
-
label = 'Upload files',
|
|
85
|
-
hint,
|
|
86
|
-
isDisabled = false,
|
|
87
|
-
preview = true,
|
|
88
|
-
dragDrop = true,
|
|
89
|
-
variant = 'dropzone',
|
|
90
|
-
}: TkxFileUploadProps) {
|
|
91
|
-
const theme = useTheme();
|
|
92
|
-
const reducedMotion = useReducedMotion();
|
|
93
|
-
const hintId = useId();
|
|
94
|
-
const inputRef = useRef<HTMLInputElement>(null);
|
|
95
|
-
const [isDragOver, setIsDragOver] = useState(false);
|
|
96
|
-
const [files, setFiles] = useState<UploadedFile[]>([]);
|
|
97
|
-
|
|
98
|
-
// Cleanup object URLs on unmount
|
|
99
|
-
useEffect(() => {
|
|
100
|
-
return () => {
|
|
101
|
-
files.forEach((f) => { if (f.objectUrl) URL.revokeObjectURL(f.objectUrl); });
|
|
102
|
-
};
|
|
103
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
104
|
-
}, []);
|
|
105
|
-
|
|
106
|
-
const simulateProgress = useCallback((id: string) => {
|
|
107
|
-
let current = 0;
|
|
108
|
-
const interval = setInterval(() => {
|
|
109
|
-
current += Math.floor(Math.random() * 20) + 10;
|
|
110
|
-
if (current >= 100) {
|
|
111
|
-
current = 100;
|
|
112
|
-
clearInterval(interval);
|
|
113
|
-
}
|
|
114
|
-
setFiles((prev) =>
|
|
115
|
-
prev.map((f) => (f.id === id ? { ...f, progress: current } : f)),
|
|
116
|
-
);
|
|
117
|
-
}, 100);
|
|
118
|
-
}, []);
|
|
119
|
-
|
|
120
|
-
const validateFile = useCallback((file: File): string | undefined => {
|
|
121
|
-
if (maxSize && file.size > maxSize) {
|
|
122
|
-
return `"${sanitizeString(file.name)}" exceeds max size of ${formatSize(maxSize)}`;
|
|
123
|
-
}
|
|
124
|
-
if (accept) {
|
|
125
|
-
const accepted = accept.split(',').map((s) => s.trim());
|
|
126
|
-
const matched = accepted.some((pattern) => {
|
|
127
|
-
if (pattern.startsWith('.')) return file.name.toLowerCase().endsWith(pattern.toLowerCase());
|
|
128
|
-
if (pattern.endsWith('/*')) return file.type.startsWith(pattern.slice(0, -1));
|
|
129
|
-
return file.type === pattern;
|
|
130
|
-
});
|
|
131
|
-
if (!matched) {
|
|
132
|
-
return `"${sanitizeString(file.name)}" is not an accepted file type`;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
return undefined;
|
|
136
|
-
}, [accept, maxSize]);
|
|
137
|
-
|
|
138
|
-
const processFiles = useCallback((incoming: File[]) => {
|
|
139
|
-
const available = maxFiles ? maxFiles - files.length : Infinity;
|
|
140
|
-
if (available <= 0) {
|
|
141
|
-
onError?.(`Maximum of ${maxFiles} file${maxFiles === 1 ? '' : 's'} allowed`);
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
const toAdd = incoming.slice(0, available);
|
|
145
|
-
const newEntries: UploadedFile[] = toAdd.map((file) => {
|
|
146
|
-
const error = validateFile(file);
|
|
147
|
-
const objectUrl = preview && file.type.startsWith('image/') && !error
|
|
148
|
-
? URL.createObjectURL(file)
|
|
149
|
-
: undefined;
|
|
150
|
-
return { file, id: uniqueId(), objectUrl, progress: error ? 0 : 0, error };
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
setFiles((prev) => {
|
|
154
|
-
const updated = multiple ? [...prev, ...newEntries] : newEntries;
|
|
155
|
-
const valid = updated.filter((f) => !f.error).map((f) => f.file);
|
|
156
|
-
onChange?.(valid);
|
|
157
|
-
return updated;
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
// Report per-file errors
|
|
161
|
-
newEntries.forEach((entry) => {
|
|
162
|
-
if (entry.error) onError?.(entry.error);
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
// Start progress simulation for valid files
|
|
166
|
-
newEntries.forEach((entry) => {
|
|
167
|
-
if (!entry.error) simulateProgress(entry.id);
|
|
168
|
-
});
|
|
169
|
-
}, [files.length, maxFiles, multiple, onChange, onError, preview, simulateProgress, validateFile]);
|
|
170
|
-
|
|
171
|
-
const handleInputChange = useCallback((e: ChangeEvent<HTMLInputElement>) => {
|
|
172
|
-
const selected = Array.from(e.target.files ?? []);
|
|
173
|
-
if (selected.length) processFiles(selected);
|
|
174
|
-
// Reset input so same file can be re-added after removal
|
|
175
|
-
e.target.value = '';
|
|
176
|
-
}, [processFiles]);
|
|
177
|
-
|
|
178
|
-
const handleDrop = useCallback((e: DragEvent<HTMLDivElement>) => {
|
|
179
|
-
e.preventDefault();
|
|
180
|
-
setIsDragOver(false);
|
|
181
|
-
if (isDisabled) return;
|
|
182
|
-
const dropped = Array.from(e.dataTransfer.files);
|
|
183
|
-
if (dropped.length) processFiles(dropped);
|
|
184
|
-
}, [isDisabled, processFiles]);
|
|
185
|
-
|
|
186
|
-
const handleDragOver = useCallback((e: DragEvent<HTMLDivElement>) => {
|
|
187
|
-
e.preventDefault();
|
|
188
|
-
if (!isDisabled) setIsDragOver(true);
|
|
189
|
-
}, [isDisabled]);
|
|
190
|
-
|
|
191
|
-
const handleDragLeave = useCallback(() => setIsDragOver(false), []);
|
|
192
|
-
|
|
193
|
-
const removeFile = useCallback((id: string) => {
|
|
194
|
-
setFiles((prev) => {
|
|
195
|
-
const target = prev.find((f) => f.id === id);
|
|
196
|
-
if (target?.objectUrl) URL.revokeObjectURL(target.objectUrl);
|
|
197
|
-
const next = prev.filter((f) => f.id !== id);
|
|
198
|
-
onChange?.(next.filter((f) => !f.error).map((f) => f.file));
|
|
199
|
-
return next;
|
|
200
|
-
});
|
|
201
|
-
}, [onChange]);
|
|
202
|
-
|
|
203
|
-
const openPicker = useCallback(() => {
|
|
204
|
-
if (!isDisabled) inputRef.current?.click();
|
|
205
|
-
}, [isDisabled]);
|
|
206
|
-
|
|
207
|
-
const borderColor = isDragOver ? theme.primary : theme.border;
|
|
208
|
-
const safeLabel = sanitizeString(label);
|
|
209
|
-
const safeHint = hint ? sanitizeString(hint) : '';
|
|
210
|
-
|
|
211
|
-
const dropzoneContent = (
|
|
212
|
-
<div
|
|
213
|
-
role="button"
|
|
214
|
-
tabIndex={isDisabled ? -1 : 0}
|
|
215
|
-
aria-label={safeLabel}
|
|
216
|
-
aria-describedby={hint ? hintId : undefined}
|
|
217
|
-
aria-disabled={isDisabled}
|
|
218
|
-
onClick={openPicker}
|
|
219
|
-
onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); openPicker(); } }}
|
|
220
|
-
onDrop={dragDrop ? handleDrop : undefined}
|
|
221
|
-
onDragOver={dragDrop ? handleDragOver : undefined}
|
|
222
|
-
onDragLeave={dragDrop ? handleDragLeave : undefined}
|
|
223
|
-
className={tkx('flex flex-col items-center justify-center gap-3 w-full p-8 rounded-lg')}
|
|
224
|
-
style={{
|
|
225
|
-
border: `2px dashed ${borderColor}`,
|
|
226
|
-
backgroundColor: isDragOver ? `${theme.primary}10` : theme.surface,
|
|
227
|
-
cursor: isDisabled ? 'not-allowed' : 'pointer',
|
|
228
|
-
opacity: isDisabled ? 0.5 : 1,
|
|
229
|
-
transition: reducedMotion ? 'none' : 'border-color 150ms ease, background-color 150ms ease',
|
|
230
|
-
outline: 'none',
|
|
231
|
-
}}
|
|
232
|
-
>
|
|
233
|
-
<svg width="40" height="40" viewBox="0 0 24 24" fill="none" stroke={isDragOver ? theme.primary : theme.textMuted} strokeWidth={1.5} aria-hidden="true">
|
|
234
|
-
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
|
|
235
|
-
<polyline points="17 8 12 3 7 8" />
|
|
236
|
-
<line x1="12" y1="3" x2="12" y2="15" />
|
|
237
|
-
</svg>
|
|
238
|
-
<div className={tkx('text-center')}>
|
|
239
|
-
<p className={tkx('m-0 text-sm font-medium')} style={{ color: theme.text }}>
|
|
240
|
-
{isDragOver ? 'Drop files here' : safeLabel}
|
|
241
|
-
</p>
|
|
242
|
-
{safeHint && (
|
|
243
|
-
<p id={hintId} className={tkx('m-0 text-xs mt-1')} style={{ color: theme.textMuted }}>
|
|
244
|
-
{safeHint}
|
|
245
|
-
</p>
|
|
246
|
-
)}
|
|
247
|
-
</div>
|
|
248
|
-
</div>
|
|
249
|
-
);
|
|
250
|
-
|
|
251
|
-
const buttonContent = (
|
|
252
|
-
<button
|
|
253
|
-
type="button"
|
|
254
|
-
disabled={isDisabled}
|
|
255
|
-
onClick={openPicker}
|
|
256
|
-
aria-describedby={hint ? hintId : undefined}
|
|
257
|
-
className={tkx('flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium font-sans border-none cursor-pointer')}
|
|
258
|
-
style={{
|
|
259
|
-
backgroundColor: theme.primary,
|
|
260
|
-
color: theme.bg,
|
|
261
|
-
opacity: isDisabled ? 0.5 : 1,
|
|
262
|
-
cursor: isDisabled ? 'not-allowed' : 'pointer',
|
|
263
|
-
}}
|
|
264
|
-
>
|
|
265
|
-
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={2} aria-hidden="true">
|
|
266
|
-
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
|
|
267
|
-
<polyline points="17 8 12 3 7 8" />
|
|
268
|
-
<line x1="12" y1="3" x2="12" y2="15" />
|
|
269
|
-
</svg>
|
|
270
|
-
{safeLabel}
|
|
271
|
-
{hint && (
|
|
272
|
-
<span id={hintId} className={tkx('sr-only')}>{safeHint}</span>
|
|
273
|
-
)}
|
|
274
|
-
</button>
|
|
275
|
-
);
|
|
276
|
-
|
|
277
|
-
return (
|
|
278
|
-
<div className={tkx('flex flex-col gap-3 w-full font-sans')}>
|
|
279
|
-
<input
|
|
280
|
-
ref={inputRef}
|
|
281
|
-
type="file"
|
|
282
|
-
accept={accept}
|
|
283
|
-
multiple={multiple}
|
|
284
|
-
disabled={isDisabled}
|
|
285
|
-
onChange={handleInputChange}
|
|
286
|
-
className={tkx('sr-only')}
|
|
287
|
-
tabIndex={-1}
|
|
288
|
-
aria-hidden="true"
|
|
289
|
-
/>
|
|
290
|
-
|
|
291
|
-
{variant === 'dropzone' ? dropzoneContent : buttonContent}
|
|
292
|
-
|
|
293
|
-
{files.length > 0 && (
|
|
294
|
-
<ul
|
|
295
|
-
role="status"
|
|
296
|
-
aria-live="polite"
|
|
297
|
-
aria-label="Uploaded files"
|
|
298
|
-
className={tkx('m-0 p-0 flex flex-col gap-2')}
|
|
299
|
-
style={{ listStyle: 'none' }}
|
|
300
|
-
>
|
|
301
|
-
{files.map((entry) => (
|
|
302
|
-
<li
|
|
303
|
-
key={entry.id}
|
|
304
|
-
className={tkx('flex flex-col gap-1 rounded-md p-3')}
|
|
305
|
-
style={{
|
|
306
|
-
backgroundColor: theme.surfaceAlt,
|
|
307
|
-
border: `1px solid ${entry.error ? theme.danger : theme.border}`,
|
|
308
|
-
}}
|
|
309
|
-
>
|
|
310
|
-
<div className={tkx('flex items-center gap-3')}>
|
|
311
|
-
{entry.objectUrl && preview ? (
|
|
312
|
-
<img
|
|
313
|
-
src={entry.objectUrl}
|
|
314
|
-
alt={sanitizeString(entry.file.name)}
|
|
315
|
-
className={tkx('rounded')}
|
|
316
|
-
style={{ width: 40, height: 40, objectFit: 'cover', flexShrink: 0 }}
|
|
317
|
-
/>
|
|
318
|
-
) : (
|
|
319
|
-
<span style={{ flexShrink: 0 }}>
|
|
320
|
-
<FileTypeIcon mimeType={entry.file.type} color={entry.error ? theme.danger : theme.textMuted} />
|
|
321
|
-
</span>
|
|
322
|
-
)}
|
|
323
|
-
<div className={tkx('flex flex-col gap-0.5 flex-1 min-w-0')}>
|
|
324
|
-
<span
|
|
325
|
-
className={tkx('text-sm font-medium truncate')}
|
|
326
|
-
style={{ color: entry.error ? theme.danger : theme.text }}
|
|
327
|
-
title={entry.file.name}
|
|
328
|
-
>
|
|
329
|
-
{sanitizeString(entry.file.name)}
|
|
330
|
-
</span>
|
|
331
|
-
<span className={tkx('text-xs')} style={{ color: theme.textMuted }}>
|
|
332
|
-
{formatSize(entry.file.size)}
|
|
333
|
-
{entry.error && ` — ${entry.error}`}
|
|
334
|
-
</span>
|
|
335
|
-
</div>
|
|
336
|
-
<button
|
|
337
|
-
type="button"
|
|
338
|
-
aria-label={`Remove ${sanitizeString(entry.file.name)}`}
|
|
339
|
-
onClick={() => removeFile(entry.id)}
|
|
340
|
-
className={tkx('flex items-center justify-center bg-transparent border-none cursor-pointer rounded p-1')}
|
|
341
|
-
style={{ color: theme.textMuted, flexShrink: 0 }}
|
|
342
|
-
>
|
|
343
|
-
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={2} aria-hidden="true">
|
|
344
|
-
<line x1="18" y1="6" x2="6" y2="18" />
|
|
345
|
-
<line x1="6" y1="6" x2="18" y2="18" />
|
|
346
|
-
</svg>
|
|
347
|
-
</button>
|
|
348
|
-
</div>
|
|
349
|
-
|
|
350
|
-
{!entry.error && entry.progress < 100 && (
|
|
351
|
-
<div
|
|
352
|
-
className={tkx('w-full overflow-hidden')}
|
|
353
|
-
style={{ height: '3px', borderRadius: '3px', backgroundColor: theme.border }}
|
|
354
|
-
aria-hidden="true"
|
|
355
|
-
>
|
|
356
|
-
<div
|
|
357
|
-
style={{
|
|
358
|
-
height: '100%',
|
|
359
|
-
borderRadius: '3px',
|
|
360
|
-
backgroundColor: theme.primary,
|
|
361
|
-
width: `${entry.progress}%`,
|
|
362
|
-
transition: reducedMotion ? 'none' : 'width 100ms ease',
|
|
363
|
-
}}
|
|
364
|
-
/>
|
|
365
|
-
</div>
|
|
366
|
-
)}
|
|
367
|
-
</li>
|
|
368
|
-
))}
|
|
369
|
-
</ul>
|
|
370
|
-
)}
|
|
371
|
-
</div>
|
|
372
|
-
);
|
|
373
|
-
}
|