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,646 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
useState,
|
|
5
|
-
useEffect,
|
|
6
|
-
useRef,
|
|
7
|
-
useCallback,
|
|
8
|
-
useId,
|
|
9
|
-
type CSSProperties,
|
|
10
|
-
type ReactNode,
|
|
11
|
-
type KeyboardEvent,
|
|
12
|
-
} from 'react';
|
|
13
|
-
import { createPortal } from 'react-dom';
|
|
14
|
-
import { useTheme } from '../themes';
|
|
15
|
-
import { tkx, cx } from '../engine/tkx';
|
|
16
|
-
import { sanitizeString } from '../engine/security';
|
|
17
|
-
|
|
18
|
-
// ── Inline hooks ──────────────────────────────────────────────────────────────
|
|
19
|
-
|
|
20
|
-
function useEscapeKey(onEscape: () => void, enabled: boolean) {
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
if (!enabled) return;
|
|
23
|
-
const handler = (e: globalThis.KeyboardEvent) => {
|
|
24
|
-
if (e.key === 'Escape') onEscape();
|
|
25
|
-
};
|
|
26
|
-
document.addEventListener('keydown', handler);
|
|
27
|
-
return () => document.removeEventListener('keydown', handler);
|
|
28
|
-
}, [onEscape, enabled]);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function useFocusTrap(enabled: boolean) {
|
|
32
|
-
const ref = useRef<HTMLDivElement>(null);
|
|
33
|
-
useEffect(() => {
|
|
34
|
-
if (!enabled || !ref.current) return;
|
|
35
|
-
const el = ref.current;
|
|
36
|
-
const focusable = el.querySelectorAll<HTMLElement>(
|
|
37
|
-
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
38
|
-
);
|
|
39
|
-
const first = focusable[0];
|
|
40
|
-
const last = focusable[focusable.length - 1];
|
|
41
|
-
const trap = (e: globalThis.KeyboardEvent) => {
|
|
42
|
-
if (e.key !== 'Tab') return;
|
|
43
|
-
if (e.shiftKey) {
|
|
44
|
-
if (document.activeElement === first) { e.preventDefault(); last?.focus(); }
|
|
45
|
-
} else {
|
|
46
|
-
if (document.activeElement === last) { e.preventDefault(); first?.focus(); }
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
el.addEventListener('keydown', trap);
|
|
50
|
-
return () => el.removeEventListener('keydown', trap);
|
|
51
|
-
}, [enabled]);
|
|
52
|
-
return ref;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// ── Types ─────────────────────────────────────────────────────────────────────
|
|
56
|
-
|
|
57
|
-
export interface CommandItem {
|
|
58
|
-
id: string;
|
|
59
|
-
label: string;
|
|
60
|
-
description?: string;
|
|
61
|
-
icon?: ReactNode;
|
|
62
|
-
shortcut?: string;
|
|
63
|
-
group?: string;
|
|
64
|
-
keywords?: string[];
|
|
65
|
-
disabled?: boolean;
|
|
66
|
-
onSelect?: () => void;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export interface TkxCommandProps {
|
|
70
|
-
items: CommandItem[];
|
|
71
|
-
isOpen?: boolean;
|
|
72
|
-
onClose?: () => void;
|
|
73
|
-
placeholder?: string;
|
|
74
|
-
emptyMessage?: string;
|
|
75
|
-
maxItems?: number;
|
|
76
|
-
onItemSelect?: (item: CommandItem) => void;
|
|
77
|
-
className?: string;
|
|
78
|
-
style?: CSSProperties;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// ── Hook ──────────────────────────────────────────────────────────────────────
|
|
82
|
-
|
|
83
|
-
export function useTkxCommand(): { isOpen: boolean; open: () => void; close: () => void; toggle: () => void } {
|
|
84
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
85
|
-
const open = useCallback(() => setIsOpen(true), []);
|
|
86
|
-
const close = useCallback(() => setIsOpen(false), []);
|
|
87
|
-
const toggle = useCallback(() => setIsOpen((v) => !v), []);
|
|
88
|
-
return { isOpen, open, close, toggle };
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// ── Fuzzy search ──────────────────────────────────────────────────────────────
|
|
92
|
-
|
|
93
|
-
interface MatchResult {
|
|
94
|
-
item: CommandItem;
|
|
95
|
-
score: number;
|
|
96
|
-
labelRanges: [number, number][];
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
function fuzzyMatch(query: string, text: string): { matched: boolean; ranges: [number, number][]; score: number } {
|
|
100
|
-
if (!query) return { matched: true, ranges: [], score: 0 };
|
|
101
|
-
const q = query.toLowerCase();
|
|
102
|
-
const t = text.toLowerCase();
|
|
103
|
-
|
|
104
|
-
// Try substring match first (highest score)
|
|
105
|
-
const subIdx = t.indexOf(q);
|
|
106
|
-
if (subIdx !== -1) {
|
|
107
|
-
return {
|
|
108
|
-
matched: true,
|
|
109
|
-
ranges: [[subIdx, subIdx + q.length - 1]],
|
|
110
|
-
score: subIdx === 0 ? 100 : 80,
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// Fuzzy character-by-character match
|
|
115
|
-
const ranges: [number, number][] = [];
|
|
116
|
-
let qi = 0;
|
|
117
|
-
let start = -1;
|
|
118
|
-
let prevIdx = -1;
|
|
119
|
-
|
|
120
|
-
for (let i = 0; i < t.length && qi < q.length; i++) {
|
|
121
|
-
if (t[i] === q[qi]) {
|
|
122
|
-
if (prevIdx === -1 || i !== prevIdx + 1) {
|
|
123
|
-
if (start !== -1) ranges.push([start, prevIdx]);
|
|
124
|
-
start = i;
|
|
125
|
-
}
|
|
126
|
-
prevIdx = i;
|
|
127
|
-
qi++;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
if (start !== -1 && prevIdx !== -1) ranges.push([start, prevIdx]);
|
|
131
|
-
|
|
132
|
-
if (qi < q.length) return { matched: false, ranges: [], score: 0 };
|
|
133
|
-
return { matched: true, ranges, score: 40 };
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
function searchItems(query: string, items: CommandItem[]): MatchResult[] {
|
|
137
|
-
if (!query.trim()) {
|
|
138
|
-
return items
|
|
139
|
-
.filter((item) => !item.disabled)
|
|
140
|
-
.map((item) => ({ item, score: 0, labelRanges: [] }));
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
const results: MatchResult[] = [];
|
|
144
|
-
|
|
145
|
-
for (const item of items) {
|
|
146
|
-
if (item.disabled) continue;
|
|
147
|
-
|
|
148
|
-
const labelMatch = fuzzyMatch(query, item.label);
|
|
149
|
-
const descMatch = item.description ? fuzzyMatch(query, item.description) : { matched: false, score: 0 };
|
|
150
|
-
const kwMatch = (item.keywords ?? []).some((kw) => fuzzyMatch(query, kw).matched);
|
|
151
|
-
|
|
152
|
-
if (labelMatch.matched) {
|
|
153
|
-
results.push({ item, score: labelMatch.score + 20, labelRanges: labelMatch.ranges });
|
|
154
|
-
} else if (descMatch.matched) {
|
|
155
|
-
results.push({ item, score: descMatch.score, labelRanges: [] });
|
|
156
|
-
} else if (kwMatch) {
|
|
157
|
-
results.push({ item, score: 20, labelRanges: [] });
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
return results.sort((a, b) => b.score - a.score);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
// ── Highlighted label ─────────────────────────────────────────────────────────
|
|
165
|
-
|
|
166
|
-
function HighlightedText({ text, ranges, color }: { text: string; ranges: [number, number][]; color: string }) {
|
|
167
|
-
if (!ranges.length) return <>{text}</>;
|
|
168
|
-
|
|
169
|
-
const parts: ReactNode[] = [];
|
|
170
|
-
let cursor = 0;
|
|
171
|
-
|
|
172
|
-
for (const [start, end] of ranges) {
|
|
173
|
-
if (cursor < start) parts.push(<span key={`t-${cursor}`}>{text.slice(cursor, start)}</span>);
|
|
174
|
-
parts.push(
|
|
175
|
-
<span key={`h-${start}`} style={{ color, fontWeight: 700 }}>
|
|
176
|
-
{text.slice(start, end + 1)}
|
|
177
|
-
</span>,
|
|
178
|
-
);
|
|
179
|
-
cursor = end + 1;
|
|
180
|
-
}
|
|
181
|
-
if (cursor < text.length) parts.push(<span key={`t-end`}>{text.slice(cursor)}</span>);
|
|
182
|
-
|
|
183
|
-
return <>{parts}</>;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
// ── Skeleton shimmer items ────────────────────────────────────────────────────
|
|
187
|
-
|
|
188
|
-
function SkeletonItem({ surface, border }: { surface: string; border: string }) {
|
|
189
|
-
return (
|
|
190
|
-
<div
|
|
191
|
-
style={{
|
|
192
|
-
display: 'flex',
|
|
193
|
-
alignItems: 'center',
|
|
194
|
-
gap: 10,
|
|
195
|
-
padding: '10px 12px',
|
|
196
|
-
borderRadius: 8,
|
|
197
|
-
overflow: 'hidden',
|
|
198
|
-
}}
|
|
199
|
-
>
|
|
200
|
-
<div
|
|
201
|
-
style={{
|
|
202
|
-
width: 24,
|
|
203
|
-
height: 24,
|
|
204
|
-
borderRadius: 6,
|
|
205
|
-
background: `linear-gradient(90deg, ${border} 25%, ${surface} 50%, ${border} 75%)`,
|
|
206
|
-
backgroundSize: '200% 100%',
|
|
207
|
-
animation: 'tkx-shimmer 1.4s ease-in-out infinite',
|
|
208
|
-
flexShrink: 0,
|
|
209
|
-
}}
|
|
210
|
-
/>
|
|
211
|
-
<div style={{ flex: 1, display: 'flex', flexDirection: 'column', gap: 5 }}>
|
|
212
|
-
<div
|
|
213
|
-
style={{
|
|
214
|
-
height: 13,
|
|
215
|
-
borderRadius: 4,
|
|
216
|
-
width: '60%',
|
|
217
|
-
background: `linear-gradient(90deg, ${border} 25%, ${surface} 50%, ${border} 75%)`,
|
|
218
|
-
backgroundSize: '200% 100%',
|
|
219
|
-
animation: 'tkx-shimmer 1.4s ease-in-out infinite',
|
|
220
|
-
}}
|
|
221
|
-
/>
|
|
222
|
-
<div
|
|
223
|
-
style={{
|
|
224
|
-
height: 10,
|
|
225
|
-
borderRadius: 4,
|
|
226
|
-
width: '40%',
|
|
227
|
-
background: `linear-gradient(90deg, ${border} 25%, ${surface} 50%, ${border} 75%)`,
|
|
228
|
-
backgroundSize: '200% 100%',
|
|
229
|
-
animation: 'tkx-shimmer 1.4s ease-in-out 0.2s infinite',
|
|
230
|
-
}}
|
|
231
|
-
/>
|
|
232
|
-
</div>
|
|
233
|
-
</div>
|
|
234
|
-
);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
// ── Main component ────────────────────────────────────────────────────────────
|
|
238
|
-
|
|
239
|
-
export function TkxCommand({
|
|
240
|
-
items,
|
|
241
|
-
isOpen = false,
|
|
242
|
-
onClose,
|
|
243
|
-
placeholder = 'Type a command or search…',
|
|
244
|
-
emptyMessage,
|
|
245
|
-
maxItems = 8,
|
|
246
|
-
onItemSelect,
|
|
247
|
-
className,
|
|
248
|
-
style,
|
|
249
|
-
}: TkxCommandProps) {
|
|
250
|
-
const theme = useTheme();
|
|
251
|
-
const [query, setQuery] = useState('');
|
|
252
|
-
const [activeIdx, setActiveIdx] = useState(0);
|
|
253
|
-
const [loading, setLoading] = useState(false);
|
|
254
|
-
const inputRef = useRef<HTMLInputElement>(null);
|
|
255
|
-
const listRef = useRef<HTMLDivElement>(null);
|
|
256
|
-
const panelId = useId();
|
|
257
|
-
const trapRef = useFocusTrap(isOpen);
|
|
258
|
-
|
|
259
|
-
const results = searchItems(query, items).slice(0, maxItems);
|
|
260
|
-
|
|
261
|
-
// Group results
|
|
262
|
-
const grouped: { group: string | undefined; items: MatchResult[] }[] = [];
|
|
263
|
-
for (const r of results) {
|
|
264
|
-
const group = r.item.group;
|
|
265
|
-
const existing = grouped.find((g) => g.group === group);
|
|
266
|
-
if (existing) existing.items.push(r);
|
|
267
|
-
else grouped.push({ group, items: [r] });
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
const flatResults = grouped.flatMap((g) => g.items);
|
|
271
|
-
|
|
272
|
-
useEscapeKey(() => { onClose?.(); }, isOpen);
|
|
273
|
-
|
|
274
|
-
// Reset state when opened
|
|
275
|
-
useEffect(() => {
|
|
276
|
-
if (isOpen) {
|
|
277
|
-
setQuery('');
|
|
278
|
-
setActiveIdx(0);
|
|
279
|
-
setTimeout(() => inputRef.current?.focus(), 30);
|
|
280
|
-
}
|
|
281
|
-
}, [isOpen]);
|
|
282
|
-
|
|
283
|
-
// Clamp activeIdx when results change
|
|
284
|
-
useEffect(() => {
|
|
285
|
-
if (activeIdx >= flatResults.length) setActiveIdx(Math.max(0, flatResults.length - 1));
|
|
286
|
-
}, [flatResults.length, activeIdx]);
|
|
287
|
-
|
|
288
|
-
const scrollActiveIntoView = useCallback((idx: number) => {
|
|
289
|
-
const list = listRef.current;
|
|
290
|
-
if (!list) return;
|
|
291
|
-
const active = list.querySelectorAll<HTMLElement>('[data-command-item]')[idx];
|
|
292
|
-
active?.scrollIntoView({ block: 'nearest' });
|
|
293
|
-
}, []);
|
|
294
|
-
|
|
295
|
-
const handleKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {
|
|
296
|
-
if (e.key === 'ArrowDown') {
|
|
297
|
-
e.preventDefault();
|
|
298
|
-
const next = Math.min(flatResults.length - 1, activeIdx + 1);
|
|
299
|
-
setActiveIdx(next);
|
|
300
|
-
scrollActiveIntoView(next);
|
|
301
|
-
} else if (e.key === 'ArrowUp') {
|
|
302
|
-
e.preventDefault();
|
|
303
|
-
const next = Math.max(0, activeIdx - 1);
|
|
304
|
-
setActiveIdx(next);
|
|
305
|
-
scrollActiveIntoView(next);
|
|
306
|
-
} else if (e.key === 'Enter') {
|
|
307
|
-
e.preventDefault();
|
|
308
|
-
const selected = flatResults[activeIdx];
|
|
309
|
-
if (selected) selectItem(selected.item);
|
|
310
|
-
}
|
|
311
|
-
};
|
|
312
|
-
|
|
313
|
-
const selectItem = (item: CommandItem) => {
|
|
314
|
-
if (item.disabled) return;
|
|
315
|
-
item.onSelect?.();
|
|
316
|
-
onItemSelect?.(item);
|
|
317
|
-
onClose?.();
|
|
318
|
-
};
|
|
319
|
-
|
|
320
|
-
if (!isOpen || typeof document === 'undefined') return null;
|
|
321
|
-
|
|
322
|
-
const safePlaceholder = sanitizeString(placeholder);
|
|
323
|
-
const safeEmptyMsg = emptyMessage ? sanitizeString(emptyMessage) : `No results for "${sanitizeString(query)}"`;
|
|
324
|
-
|
|
325
|
-
// Shimmer CSS injection (idempotent)
|
|
326
|
-
if (typeof document !== 'undefined' && !document.getElementById('tkx-shimmer-style')) {
|
|
327
|
-
const s = document.createElement('style');
|
|
328
|
-
s.id = 'tkx-shimmer-style';
|
|
329
|
-
s.textContent = `@keyframes tkx-shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }`;
|
|
330
|
-
document.head.appendChild(s);
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
return createPortal(
|
|
334
|
-
<div
|
|
335
|
-
role="presentation"
|
|
336
|
-
style={{
|
|
337
|
-
position: 'fixed',
|
|
338
|
-
inset: 0,
|
|
339
|
-
zIndex: 10000,
|
|
340
|
-
display: 'flex',
|
|
341
|
-
alignItems: 'flex-start',
|
|
342
|
-
justifyContent: 'center',
|
|
343
|
-
paddingTop: '15vh',
|
|
344
|
-
paddingLeft: 16,
|
|
345
|
-
paddingRight: 16,
|
|
346
|
-
}}
|
|
347
|
-
>
|
|
348
|
-
{/* Backdrop */}
|
|
349
|
-
<div
|
|
350
|
-
aria-hidden="true"
|
|
351
|
-
onClick={onClose}
|
|
352
|
-
style={{
|
|
353
|
-
position: 'absolute',
|
|
354
|
-
inset: 0,
|
|
355
|
-
backgroundColor: 'rgba(0,0,0,0.55)',
|
|
356
|
-
backdropFilter: 'blur(4px)',
|
|
357
|
-
animation: 'tkx-fade-in 120ms ease',
|
|
358
|
-
}}
|
|
359
|
-
/>
|
|
360
|
-
|
|
361
|
-
{/* Panel */}
|
|
362
|
-
<div
|
|
363
|
-
ref={trapRef as React.RefObject<HTMLDivElement>}
|
|
364
|
-
role="dialog"
|
|
365
|
-
aria-modal="true"
|
|
366
|
-
aria-label="Command palette"
|
|
367
|
-
id={panelId}
|
|
368
|
-
className={cx(className)}
|
|
369
|
-
style={{
|
|
370
|
-
position: 'relative',
|
|
371
|
-
zIndex: 1,
|
|
372
|
-
width: '100%',
|
|
373
|
-
maxWidth: 560,
|
|
374
|
-
backgroundColor: theme.surface,
|
|
375
|
-
border: `1px solid ${theme.border}`,
|
|
376
|
-
borderRadius: 16,
|
|
377
|
-
boxShadow: `0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px ${theme.border}`,
|
|
378
|
-
overflow: 'hidden',
|
|
379
|
-
display: 'flex',
|
|
380
|
-
flexDirection: 'column',
|
|
381
|
-
maxHeight: '70vh',
|
|
382
|
-
...style,
|
|
383
|
-
}}
|
|
384
|
-
>
|
|
385
|
-
{/* Search bar */}
|
|
386
|
-
<div
|
|
387
|
-
style={{
|
|
388
|
-
display: 'flex',
|
|
389
|
-
alignItems: 'center',
|
|
390
|
-
gap: 10,
|
|
391
|
-
padding: '14px 16px',
|
|
392
|
-
borderBottom: `1px solid ${theme.border}`,
|
|
393
|
-
}}
|
|
394
|
-
>
|
|
395
|
-
<svg
|
|
396
|
-
width="18"
|
|
397
|
-
height="18"
|
|
398
|
-
viewBox="0 0 24 24"
|
|
399
|
-
fill="none"
|
|
400
|
-
stroke={theme.textMuted}
|
|
401
|
-
strokeWidth={2}
|
|
402
|
-
aria-hidden="true"
|
|
403
|
-
style={{ flexShrink: 0 }}
|
|
404
|
-
>
|
|
405
|
-
<circle cx="11" cy="11" r="8" />
|
|
406
|
-
<line x1="21" y1="21" x2="16.65" y2="16.65" />
|
|
407
|
-
</svg>
|
|
408
|
-
<input
|
|
409
|
-
ref={inputRef}
|
|
410
|
-
type="text"
|
|
411
|
-
role="combobox"
|
|
412
|
-
aria-expanded={true}
|
|
413
|
-
aria-autocomplete="list"
|
|
414
|
-
aria-controls={`${panelId}-list`}
|
|
415
|
-
aria-activedescendant={flatResults[activeIdx] ? `${panelId}-item-${flatResults[activeIdx].item.id}` : undefined}
|
|
416
|
-
value={query}
|
|
417
|
-
onChange={(e) => { setQuery(e.target.value); setActiveIdx(0); }}
|
|
418
|
-
onKeyDown={handleKeyDown}
|
|
419
|
-
placeholder={safePlaceholder}
|
|
420
|
-
style={{
|
|
421
|
-
flex: 1,
|
|
422
|
-
border: 'none',
|
|
423
|
-
background: 'transparent',
|
|
424
|
-
outline: 'none',
|
|
425
|
-
fontSize: 16,
|
|
426
|
-
fontFamily: 'inherit',
|
|
427
|
-
color: theme.text,
|
|
428
|
-
}}
|
|
429
|
-
/>
|
|
430
|
-
{query && (
|
|
431
|
-
<button
|
|
432
|
-
type="button"
|
|
433
|
-
aria-label="Clear search"
|
|
434
|
-
onClick={() => { setQuery(''); setActiveIdx(0); inputRef.current?.focus(); }}
|
|
435
|
-
style={{
|
|
436
|
-
border: 'none',
|
|
437
|
-
background: 'transparent',
|
|
438
|
-
cursor: 'pointer',
|
|
439
|
-
color: theme.textMuted,
|
|
440
|
-
display: 'flex',
|
|
441
|
-
alignItems: 'center',
|
|
442
|
-
padding: 0,
|
|
443
|
-
}}
|
|
444
|
-
>
|
|
445
|
-
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={2} aria-hidden="true">
|
|
446
|
-
<line x1="18" y1="6" x2="6" y2="18" />
|
|
447
|
-
<line x1="6" y1="6" x2="18" y2="18" />
|
|
448
|
-
</svg>
|
|
449
|
-
</button>
|
|
450
|
-
)}
|
|
451
|
-
</div>
|
|
452
|
-
|
|
453
|
-
{/* Results */}
|
|
454
|
-
<div
|
|
455
|
-
id={`${panelId}-list`}
|
|
456
|
-
ref={listRef}
|
|
457
|
-
role="listbox"
|
|
458
|
-
aria-label="Command results"
|
|
459
|
-
style={{ overflowY: 'auto', flex: 1, padding: '6px 8px' }}
|
|
460
|
-
>
|
|
461
|
-
{loading ? (
|
|
462
|
-
Array.from({ length: 4 }, (_, i) => (
|
|
463
|
-
<SkeletonItem key={i} surface={theme.surface} border={theme.border} />
|
|
464
|
-
))
|
|
465
|
-
) : flatResults.length === 0 ? (
|
|
466
|
-
/* Empty state */
|
|
467
|
-
<div
|
|
468
|
-
style={{
|
|
469
|
-
display: 'flex',
|
|
470
|
-
flexDirection: 'column',
|
|
471
|
-
alignItems: 'center',
|
|
472
|
-
justifyContent: 'center',
|
|
473
|
-
gap: 8,
|
|
474
|
-
padding: '32px 16px',
|
|
475
|
-
color: theme.textMuted,
|
|
476
|
-
}}
|
|
477
|
-
>
|
|
478
|
-
<svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={1.5} aria-hidden="true">
|
|
479
|
-
<circle cx="11" cy="11" r="8" />
|
|
480
|
-
<line x1="21" y1="21" x2="16.65" y2="16.65" />
|
|
481
|
-
<line x1="8" y1="11" x2="14" y2="11" />
|
|
482
|
-
</svg>
|
|
483
|
-
<span style={{ fontSize: '0.875rem' }}>{safeEmptyMsg}</span>
|
|
484
|
-
</div>
|
|
485
|
-
) : (
|
|
486
|
-
grouped.map(({ group, items: groupItems }, gi) => {
|
|
487
|
-
// Build flat index offset for this group
|
|
488
|
-
const offset = grouped.slice(0, gi).reduce((acc, g) => acc + g.items.length, 0);
|
|
489
|
-
|
|
490
|
-
return (
|
|
491
|
-
<div key={group ?? '__default__'}>
|
|
492
|
-
{group && (
|
|
493
|
-
<div
|
|
494
|
-
role="presentation"
|
|
495
|
-
style={{
|
|
496
|
-
fontSize: '0.6875rem',
|
|
497
|
-
fontWeight: 600,
|
|
498
|
-
textTransform: 'uppercase',
|
|
499
|
-
letterSpacing: '0.08em',
|
|
500
|
-
color: theme.textMuted,
|
|
501
|
-
padding: '10px 12px 4px',
|
|
502
|
-
}}
|
|
503
|
-
>
|
|
504
|
-
{sanitizeString(group)}
|
|
505
|
-
</div>
|
|
506
|
-
)}
|
|
507
|
-
{groupItems.map((r, localIdx) => {
|
|
508
|
-
const flatIdx = offset + localIdx;
|
|
509
|
-
const isActive = flatIdx === activeIdx;
|
|
510
|
-
const item = r.item;
|
|
511
|
-
|
|
512
|
-
return (
|
|
513
|
-
<div
|
|
514
|
-
key={item.id}
|
|
515
|
-
id={`${panelId}-item-${item.id}`}
|
|
516
|
-
role="option"
|
|
517
|
-
aria-selected={isActive}
|
|
518
|
-
aria-disabled={item.disabled}
|
|
519
|
-
data-command-item
|
|
520
|
-
onClick={() => selectItem(item)}
|
|
521
|
-
onMouseEnter={() => setActiveIdx(flatIdx)}
|
|
522
|
-
style={{
|
|
523
|
-
display: 'flex',
|
|
524
|
-
alignItems: 'center',
|
|
525
|
-
gap: 10,
|
|
526
|
-
padding: '9px 12px',
|
|
527
|
-
borderRadius: 8,
|
|
528
|
-
cursor: item.disabled ? 'not-allowed' : 'pointer',
|
|
529
|
-
opacity: item.disabled ? 0.45 : 1,
|
|
530
|
-
backgroundColor: isActive ? `${theme.primary}18` : 'transparent',
|
|
531
|
-
borderLeft: isActive ? `2px solid ${theme.primary}` : '2px solid transparent',
|
|
532
|
-
transition: 'background 80ms ease',
|
|
533
|
-
userSelect: 'none',
|
|
534
|
-
}}
|
|
535
|
-
>
|
|
536
|
-
{/* Icon */}
|
|
537
|
-
{item.icon && (
|
|
538
|
-
<span
|
|
539
|
-
style={{
|
|
540
|
-
width: 20,
|
|
541
|
-
height: 20,
|
|
542
|
-
flexShrink: 0,
|
|
543
|
-
display: 'flex',
|
|
544
|
-
alignItems: 'center',
|
|
545
|
-
justifyContent: 'center',
|
|
546
|
-
color: isActive ? theme.primary : theme.textMuted,
|
|
547
|
-
}}
|
|
548
|
-
>
|
|
549
|
-
{item.icon}
|
|
550
|
-
</span>
|
|
551
|
-
)}
|
|
552
|
-
|
|
553
|
-
{/* Label + description */}
|
|
554
|
-
<div style={{ flex: 1, minWidth: 0 }}>
|
|
555
|
-
<div
|
|
556
|
-
style={{
|
|
557
|
-
fontSize: '0.875rem',
|
|
558
|
-
fontWeight: 500,
|
|
559
|
-
color: isActive ? theme.text : theme.text,
|
|
560
|
-
whiteSpace: 'nowrap',
|
|
561
|
-
overflow: 'hidden',
|
|
562
|
-
textOverflow: 'ellipsis',
|
|
563
|
-
}}
|
|
564
|
-
>
|
|
565
|
-
<HighlightedText
|
|
566
|
-
text={item.label}
|
|
567
|
-
ranges={r.labelRanges}
|
|
568
|
-
color={theme.primary}
|
|
569
|
-
/>
|
|
570
|
-
</div>
|
|
571
|
-
{item.description && (
|
|
572
|
-
<div
|
|
573
|
-
style={{
|
|
574
|
-
fontSize: '0.75rem',
|
|
575
|
-
color: theme.textMuted,
|
|
576
|
-
marginTop: 1,
|
|
577
|
-
whiteSpace: 'nowrap',
|
|
578
|
-
overflow: 'hidden',
|
|
579
|
-
textOverflow: 'ellipsis',
|
|
580
|
-
}}
|
|
581
|
-
>
|
|
582
|
-
{sanitizeString(item.description)}
|
|
583
|
-
</div>
|
|
584
|
-
)}
|
|
585
|
-
</div>
|
|
586
|
-
|
|
587
|
-
{/* Shortcut badge */}
|
|
588
|
-
{item.shortcut && (
|
|
589
|
-
<span
|
|
590
|
-
style={{
|
|
591
|
-
flexShrink: 0,
|
|
592
|
-
fontSize: '0.6875rem',
|
|
593
|
-
fontWeight: 500,
|
|
594
|
-
color: theme.textMuted,
|
|
595
|
-
backgroundColor: theme.surfaceAlt,
|
|
596
|
-
border: `1px solid ${theme.border}`,
|
|
597
|
-
borderRadius: 6,
|
|
598
|
-
padding: '2px 6px',
|
|
599
|
-
fontFamily: 'monospace',
|
|
600
|
-
letterSpacing: '0.04em',
|
|
601
|
-
}}
|
|
602
|
-
>
|
|
603
|
-
{sanitizeString(item.shortcut)}
|
|
604
|
-
</span>
|
|
605
|
-
)}
|
|
606
|
-
</div>
|
|
607
|
-
);
|
|
608
|
-
})}
|
|
609
|
-
</div>
|
|
610
|
-
);
|
|
611
|
-
})
|
|
612
|
-
)}
|
|
613
|
-
</div>
|
|
614
|
-
|
|
615
|
-
{/* Footer hint */}
|
|
616
|
-
{flatResults.length > 0 && (
|
|
617
|
-
<div
|
|
618
|
-
aria-hidden="true"
|
|
619
|
-
style={{
|
|
620
|
-
display: 'flex',
|
|
621
|
-
alignItems: 'center',
|
|
622
|
-
gap: 12,
|
|
623
|
-
padding: '8px 16px',
|
|
624
|
-
borderTop: `1px solid ${theme.border}`,
|
|
625
|
-
fontSize: '0.6875rem',
|
|
626
|
-
color: theme.textMuted,
|
|
627
|
-
}}
|
|
628
|
-
>
|
|
629
|
-
<span>
|
|
630
|
-
<kbd style={{ fontFamily: 'monospace' }}>↑↓</kbd> navigate
|
|
631
|
-
</span>
|
|
632
|
-
<span>
|
|
633
|
-
<kbd style={{ fontFamily: 'monospace' }}>↵</kbd> select
|
|
634
|
-
</span>
|
|
635
|
-
<span>
|
|
636
|
-
<kbd style={{ fontFamily: 'monospace' }}>Esc</kbd> close
|
|
637
|
-
</span>
|
|
638
|
-
</div>
|
|
639
|
-
)}
|
|
640
|
-
</div>
|
|
641
|
-
</div>,
|
|
642
|
-
document.body,
|
|
643
|
-
);
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
TkxCommand.displayName = 'TkxCommand';
|