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,103 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { useEffect, useState } from 'react';
|
|
4
|
-
import {
|
|
5
|
-
ResponsiveContainer,
|
|
6
|
-
PieChart,
|
|
7
|
-
Pie,
|
|
8
|
-
Cell,
|
|
9
|
-
Tooltip,
|
|
10
|
-
Legend,
|
|
11
|
-
} from 'recharts';
|
|
12
|
-
import { useTheme } from '../themes';
|
|
13
|
-
import { useReducedMotion } from '../hooks';
|
|
14
|
-
import { getDefaultColors, tooltipStyle } from './shared';
|
|
15
|
-
|
|
16
|
-
export interface TkxPieChartSlice {
|
|
17
|
-
name: string;
|
|
18
|
-
value: number;
|
|
19
|
-
color?: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface TkxPieChartProps {
|
|
23
|
-
data: TkxPieChartSlice[];
|
|
24
|
-
height?: number;
|
|
25
|
-
showLegend?: boolean;
|
|
26
|
-
showTooltip?: boolean;
|
|
27
|
-
showLabels?: boolean;
|
|
28
|
-
/** Outer radius as a number (px) or percentage string. Default: '70%' */
|
|
29
|
-
outerRadius?: number | string;
|
|
30
|
-
/** Start angle in degrees. Default: 90 (12 o'clock) */
|
|
31
|
-
startAngle?: number;
|
|
32
|
-
ariaLabel?: string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export function TkxPieChart({
|
|
36
|
-
data,
|
|
37
|
-
height = 300,
|
|
38
|
-
showLegend = true,
|
|
39
|
-
showTooltip = true,
|
|
40
|
-
showLabels = false,
|
|
41
|
-
outerRadius = '70%',
|
|
42
|
-
startAngle = 90,
|
|
43
|
-
ariaLabel = 'Pie chart',
|
|
44
|
-
}: TkxPieChartProps) {
|
|
45
|
-
const theme = useTheme();
|
|
46
|
-
const reduced = useReducedMotion();
|
|
47
|
-
const colors = getDefaultColors(theme);
|
|
48
|
-
const tt = tooltipStyle(theme);
|
|
49
|
-
// Force ResponsiveContainer to re-measure after the parent layout settles.
|
|
50
|
-
// Without this, recharts can compute 0x0 on first paint inside CSS grids/flex
|
|
51
|
-
// and the chart silently disappears.
|
|
52
|
-
// When reduced motion is preferred, skip the animation and mount immediately.
|
|
53
|
-
const [mounted, setMounted] = useState(reduced);
|
|
54
|
-
useEffect(() => {
|
|
55
|
-
if (reduced) { setMounted(true); return; }
|
|
56
|
-
const id = requestAnimationFrame(() => setMounted(true));
|
|
57
|
-
return () => cancelAnimationFrame(id);
|
|
58
|
-
}, [reduced]);
|
|
59
|
-
|
|
60
|
-
return (
|
|
61
|
-
<div
|
|
62
|
-
role="img"
|
|
63
|
-
aria-label={ariaLabel}
|
|
64
|
-
style={{ width: '100%', minWidth: 240, height, position: 'relative' }}
|
|
65
|
-
>
|
|
66
|
-
{mounted && (
|
|
67
|
-
<ResponsiveContainer width="100%" height="100%" debounce={50}>
|
|
68
|
-
<PieChart>
|
|
69
|
-
{showTooltip && (
|
|
70
|
-
<Tooltip
|
|
71
|
-
contentStyle={tt.contentStyle}
|
|
72
|
-
labelStyle={tt.labelStyle}
|
|
73
|
-
itemStyle={tt.itemStyle}
|
|
74
|
-
/>
|
|
75
|
-
)}
|
|
76
|
-
{showLegend && (
|
|
77
|
-
<Legend wrapperStyle={{ fontSize: 13, color: theme.textMuted }} />
|
|
78
|
-
)}
|
|
79
|
-
<Pie
|
|
80
|
-
data={data}
|
|
81
|
-
dataKey="value"
|
|
82
|
-
nameKey="name"
|
|
83
|
-
outerRadius={outerRadius}
|
|
84
|
-
startAngle={startAngle}
|
|
85
|
-
endAngle={startAngle - 360}
|
|
86
|
-
label={showLabels ? ({ name, percent }) => `${name} (${((percent ?? 0) * 100).toFixed(0)}%)` : undefined}
|
|
87
|
-
labelLine={showLabels}
|
|
88
|
-
strokeWidth={2}
|
|
89
|
-
stroke={theme.bg}
|
|
90
|
-
>
|
|
91
|
-
{data.map((entry, i) => (
|
|
92
|
-
<Cell
|
|
93
|
-
key={entry.name}
|
|
94
|
-
fill={entry.color ?? colors[i % colors.length]}
|
|
95
|
-
/>
|
|
96
|
-
))}
|
|
97
|
-
</Pie>
|
|
98
|
-
</PieChart>
|
|
99
|
-
</ResponsiveContainer>
|
|
100
|
-
)}
|
|
101
|
-
</div>
|
|
102
|
-
);
|
|
103
|
-
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
ResponsiveContainer,
|
|
5
|
-
RadarChart,
|
|
6
|
-
PolarGrid,
|
|
7
|
-
PolarAngleAxis,
|
|
8
|
-
PolarRadiusAxis,
|
|
9
|
-
Radar,
|
|
10
|
-
Legend,
|
|
11
|
-
Tooltip,
|
|
12
|
-
} from 'recharts';
|
|
13
|
-
import { useTheme } from '../themes';
|
|
14
|
-
import { getDefaultColors, tooltipStyle } from './shared';
|
|
15
|
-
|
|
16
|
-
export interface TkxRadarSeries {
|
|
17
|
-
key: string;
|
|
18
|
-
label?: string;
|
|
19
|
-
color?: string;
|
|
20
|
-
fillOpacity?: number;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface TkxRadarChartProps {
|
|
24
|
-
data: Record<string, any>[];
|
|
25
|
-
series: TkxRadarSeries[];
|
|
26
|
-
/** Key in data for the axis labels (e.g. 'subject', 'metric') */
|
|
27
|
-
angleKey: string;
|
|
28
|
-
height?: number;
|
|
29
|
-
showLegend?: boolean;
|
|
30
|
-
showTooltip?: boolean;
|
|
31
|
-
/** Outer radius as percentage string or number. Default: '70%' */
|
|
32
|
-
outerRadius?: string | number;
|
|
33
|
-
ariaLabel?: string;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function TkxRadarChart({
|
|
37
|
-
data,
|
|
38
|
-
series,
|
|
39
|
-
angleKey,
|
|
40
|
-
height = 300,
|
|
41
|
-
showLegend = true,
|
|
42
|
-
showTooltip = true,
|
|
43
|
-
outerRadius = '70%',
|
|
44
|
-
ariaLabel = 'Radar chart',
|
|
45
|
-
}: TkxRadarChartProps) {
|
|
46
|
-
const theme = useTheme();
|
|
47
|
-
const colors = getDefaultColors(theme);
|
|
48
|
-
const tt = tooltipStyle(theme);
|
|
49
|
-
|
|
50
|
-
return (
|
|
51
|
-
<div role="img" aria-label={ariaLabel} style={{ width: '100%', height }}>
|
|
52
|
-
<ResponsiveContainer width="100%" height="100%">
|
|
53
|
-
<RadarChart data={data} outerRadius={outerRadius}>
|
|
54
|
-
<PolarGrid stroke={theme.border} />
|
|
55
|
-
<PolarAngleAxis
|
|
56
|
-
dataKey={angleKey}
|
|
57
|
-
tick={{ fill: theme.textMuted, fontSize: 12 }}
|
|
58
|
-
/>
|
|
59
|
-
<PolarRadiusAxis
|
|
60
|
-
tick={{ fill: theme.textMuted, fontSize: 10 }}
|
|
61
|
-
axisLine={false}
|
|
62
|
-
tickLine={false}
|
|
63
|
-
/>
|
|
64
|
-
{showTooltip && (
|
|
65
|
-
<Tooltip
|
|
66
|
-
contentStyle={tt.contentStyle}
|
|
67
|
-
labelStyle={tt.labelStyle}
|
|
68
|
-
itemStyle={tt.itemStyle}
|
|
69
|
-
/>
|
|
70
|
-
)}
|
|
71
|
-
{showLegend && (
|
|
72
|
-
<Legend wrapperStyle={{ fontSize: 13, color: theme.textMuted }} />
|
|
73
|
-
)}
|
|
74
|
-
{series.map((s, i) => {
|
|
75
|
-
const color = s.color ?? colors[i % colors.length];
|
|
76
|
-
return (
|
|
77
|
-
<Radar
|
|
78
|
-
key={s.key}
|
|
79
|
-
name={s.label ?? s.key}
|
|
80
|
-
dataKey={s.key}
|
|
81
|
-
stroke={color}
|
|
82
|
-
fill={color}
|
|
83
|
-
fillOpacity={s.fillOpacity ?? 0.2}
|
|
84
|
-
strokeWidth={2}
|
|
85
|
-
/>
|
|
86
|
-
);
|
|
87
|
-
})}
|
|
88
|
-
</RadarChart>
|
|
89
|
-
</ResponsiveContainer>
|
|
90
|
-
</div>
|
|
91
|
-
);
|
|
92
|
-
}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
ResponsiveContainer,
|
|
5
|
-
ScatterChart,
|
|
6
|
-
Scatter,
|
|
7
|
-
XAxis,
|
|
8
|
-
YAxis,
|
|
9
|
-
ZAxis,
|
|
10
|
-
CartesianGrid,
|
|
11
|
-
Tooltip,
|
|
12
|
-
Legend,
|
|
13
|
-
} from 'recharts';
|
|
14
|
-
import { useTheme } from '../themes';
|
|
15
|
-
import { getDefaultColors, tooltipStyle, DEFAULT_MARGIN, type ChartMargin } from './shared';
|
|
16
|
-
|
|
17
|
-
export interface TkxScatterSeries {
|
|
18
|
-
data: { x: number; y: number; z?: number; label?: string }[];
|
|
19
|
-
name?: string;
|
|
20
|
-
color?: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface TkxScatterChartProps {
|
|
24
|
-
series: TkxScatterSeries[];
|
|
25
|
-
height?: number;
|
|
26
|
-
margin?: ChartMargin;
|
|
27
|
-
showGrid?: boolean;
|
|
28
|
-
showLegend?: boolean;
|
|
29
|
-
showTooltip?: boolean;
|
|
30
|
-
xLabel?: string;
|
|
31
|
-
yLabel?: string;
|
|
32
|
-
xTickFormatter?: (value: any) => string;
|
|
33
|
-
yTickFormatter?: (value: any) => string;
|
|
34
|
-
/** Z-axis range (bubble size). Default: [20, 400] */
|
|
35
|
-
zRange?: [number, number];
|
|
36
|
-
ariaLabel?: string;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export function TkxScatterChart({
|
|
40
|
-
series,
|
|
41
|
-
height = 300,
|
|
42
|
-
margin = DEFAULT_MARGIN,
|
|
43
|
-
showGrid = true,
|
|
44
|
-
showLegend = true,
|
|
45
|
-
showTooltip = true,
|
|
46
|
-
xTickFormatter,
|
|
47
|
-
yTickFormatter,
|
|
48
|
-
zRange = [20, 400],
|
|
49
|
-
ariaLabel = 'Scatter chart',
|
|
50
|
-
}: TkxScatterChartProps) {
|
|
51
|
-
const theme = useTheme();
|
|
52
|
-
const colors = getDefaultColors(theme);
|
|
53
|
-
const tt = tooltipStyle(theme);
|
|
54
|
-
const tickStyle = { fill: theme.textMuted, fontSize: 12 };
|
|
55
|
-
|
|
56
|
-
return (
|
|
57
|
-
<div role="img" aria-label={ariaLabel} style={{ width: '100%', height }}>
|
|
58
|
-
<ResponsiveContainer width="100%" height="100%">
|
|
59
|
-
<ScatterChart margin={margin}>
|
|
60
|
-
{showGrid && (
|
|
61
|
-
<CartesianGrid strokeDasharray="3 3" stroke={theme.border} />
|
|
62
|
-
)}
|
|
63
|
-
<XAxis
|
|
64
|
-
type="number"
|
|
65
|
-
dataKey="x"
|
|
66
|
-
tick={tickStyle}
|
|
67
|
-
axisLine={{ stroke: theme.border }}
|
|
68
|
-
tickLine={false}
|
|
69
|
-
tickFormatter={xTickFormatter}
|
|
70
|
-
/>
|
|
71
|
-
<YAxis
|
|
72
|
-
type="number"
|
|
73
|
-
dataKey="y"
|
|
74
|
-
tick={tickStyle}
|
|
75
|
-
axisLine={false}
|
|
76
|
-
tickLine={false}
|
|
77
|
-
tickFormatter={yTickFormatter}
|
|
78
|
-
/>
|
|
79
|
-
<ZAxis type="number" dataKey="z" range={zRange} />
|
|
80
|
-
{showTooltip && (
|
|
81
|
-
<Tooltip
|
|
82
|
-
contentStyle={tt.contentStyle}
|
|
83
|
-
labelStyle={tt.labelStyle}
|
|
84
|
-
itemStyle={tt.itemStyle}
|
|
85
|
-
cursor={{ strokeDasharray: '3 3' }}
|
|
86
|
-
/>
|
|
87
|
-
)}
|
|
88
|
-
{showLegend && (
|
|
89
|
-
<Legend wrapperStyle={{ fontSize: 13, color: theme.textMuted, paddingTop: 8 }} />
|
|
90
|
-
)}
|
|
91
|
-
{series.map((s, i) => (
|
|
92
|
-
<Scatter
|
|
93
|
-
key={s.name ?? i}
|
|
94
|
-
name={s.name}
|
|
95
|
-
data={s.data}
|
|
96
|
-
fill={s.color ?? colors[i % colors.length]}
|
|
97
|
-
fillOpacity={0.8}
|
|
98
|
-
/>
|
|
99
|
-
))}
|
|
100
|
-
</ScatterChart>
|
|
101
|
-
</ResponsiveContainer>
|
|
102
|
-
</div>
|
|
103
|
-
);
|
|
104
|
-
}
|
package/src/charts/index.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
// ── @tekivex/ui/charts ───────────────────────────────────────────────────────
|
|
4
|
-
// Theme-aware chart components built on Recharts.
|
|
5
|
-
// Import from '@tekivex/ui/charts' — zero impact on the main bundle.
|
|
6
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
7
|
-
|
|
8
|
-
export { TkxAreaChart } from './TkxAreaChart';
|
|
9
|
-
export { TkxBarChart } from './TkxBarChart';
|
|
10
|
-
export { TkxLineChart } from './TkxLineChart';
|
|
11
|
-
export { TkxPieChart } from './TkxPieChart';
|
|
12
|
-
export { TkxDonutChart } from './TkxDonutChart';
|
|
13
|
-
export { TkxScatterChart } from './TkxScatterChart';
|
|
14
|
-
export { TkxRadarChart } from './TkxRadarChart';
|
|
15
|
-
|
|
16
|
-
export type { TkxAreaChartProps } from './TkxAreaChart';
|
|
17
|
-
export type { TkxBarChartProps } from './TkxBarChart';
|
|
18
|
-
export type { TkxLineChartProps } from './TkxLineChart';
|
|
19
|
-
export type { TkxPieChartProps } from './TkxPieChart';
|
|
20
|
-
export type { TkxDonutChartProps } from './TkxDonutChart';
|
|
21
|
-
export type { TkxScatterChartProps } from './TkxScatterChart';
|
|
22
|
-
export type { TkxRadarChartProps } from './TkxRadarChart';
|
package/src/charts/shared.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
// ── Shared chart utilities ───────────────────────────────────────────────────
|
|
4
|
-
|
|
5
|
-
import type { ThemeTokens } from '../themes';
|
|
6
|
-
|
|
7
|
-
/** Default palette: uses theme tokens then falls back to categorical colors */
|
|
8
|
-
export function getDefaultColors(theme: ThemeTokens): string[] {
|
|
9
|
-
return [
|
|
10
|
-
theme.primary,
|
|
11
|
-
theme.secondary,
|
|
12
|
-
theme.info,
|
|
13
|
-
theme.success,
|
|
14
|
-
theme.warning,
|
|
15
|
-
theme.danger,
|
|
16
|
-
theme.primary + 'aa', // primary at 67% opacity
|
|
17
|
-
theme.secondary + 'aa', // secondary at 67% opacity
|
|
18
|
-
theme.info + 'aa', // info at 67% opacity
|
|
19
|
-
theme.success + 'aa', // success at 67% opacity
|
|
20
|
-
];
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface ChartMargin {
|
|
24
|
-
top?: number;
|
|
25
|
-
right?: number;
|
|
26
|
-
bottom?: number;
|
|
27
|
-
left?: number;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export const DEFAULT_MARGIN: ChartMargin = { top: 10, right: 30, bottom: 10, left: 0 };
|
|
31
|
-
|
|
32
|
-
/** Common recharts tooltip style that matches TekiVex theme */
|
|
33
|
-
export function tooltipStyle(theme: ThemeTokens) {
|
|
34
|
-
return {
|
|
35
|
-
contentStyle: {
|
|
36
|
-
backgroundColor: theme.surface,
|
|
37
|
-
border: `1px solid ${theme.border}`,
|
|
38
|
-
borderRadius: 8,
|
|
39
|
-
boxShadow: '0 4px 12px rgba(0,0,0,0.15)',
|
|
40
|
-
color: theme.text,
|
|
41
|
-
fontSize: 13,
|
|
42
|
-
},
|
|
43
|
-
labelStyle: { color: theme.textMuted, fontWeight: 600, marginBottom: 4 },
|
|
44
|
-
itemStyle: { color: theme.text },
|
|
45
|
-
cursor: { fill: `${theme.primary}15` },
|
|
46
|
-
};
|
|
47
|
-
}
|
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { useState, useEffect, useRef, type CSSProperties, type ReactNode } from 'react';
|
|
4
|
-
import { useTheme } from '../themes';
|
|
5
|
-
import { cx, tkx } from '../engine/tkx';
|
|
6
|
-
import { sanitizeString } from '../engine/security';
|
|
7
|
-
|
|
8
|
-
export type AIRole = 'user' | 'assistant' | 'system';
|
|
9
|
-
|
|
10
|
-
export interface TkxAIChatBubbleProps {
|
|
11
|
-
/** Who sent this message */
|
|
12
|
-
role: AIRole;
|
|
13
|
-
/** Message text (will be sanitized) or arbitrary ReactNode */
|
|
14
|
-
content: string | ReactNode;
|
|
15
|
-
/** Optional avatar URL or initials */
|
|
16
|
-
avatar?: string;
|
|
17
|
-
/** Optional display name */
|
|
18
|
-
name?: string;
|
|
19
|
-
/** ISO timestamp string */
|
|
20
|
-
timestamp?: string;
|
|
21
|
-
/** Animate text in character-by-character (streaming effect) */
|
|
22
|
-
streaming?: boolean;
|
|
23
|
-
/** AI confidence 0–100 — renders a mini confidence bar when provided */
|
|
24
|
-
confidence?: number;
|
|
25
|
-
/** Show copy-to-clipboard button */
|
|
26
|
-
copyable?: boolean;
|
|
27
|
-
className?: string;
|
|
28
|
-
style?: CSSProperties;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function confidenceColor(v: number, primary: string) {
|
|
32
|
-
if (v >= 80) return '#10b981';
|
|
33
|
-
if (v >= 55) return primary;
|
|
34
|
-
if (v >= 30) return '#f59e0b';
|
|
35
|
-
return '#ef4444';
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function Avatar({ src, name, size = 32 }: { src?: string; name?: string; size?: number }) {
|
|
39
|
-
const theme = useTheme();
|
|
40
|
-
const initials = name
|
|
41
|
-
? name.split(' ').map(w => w[0]).join('').slice(0, 2).toUpperCase()
|
|
42
|
-
: '?';
|
|
43
|
-
|
|
44
|
-
if (src) {
|
|
45
|
-
return (
|
|
46
|
-
<img src={src} alt={name ?? 'avatar'} width={size} height={size}
|
|
47
|
-
style={{ borderRadius: '50%', objectFit: 'cover', flexShrink: 0 }} />
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
return (
|
|
51
|
-
<div style={{
|
|
52
|
-
width: size, height: size, borderRadius: '50%', flexShrink: 0,
|
|
53
|
-
background: `${theme.primary}22`, border: `1px solid ${theme.primary}44`,
|
|
54
|
-
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
|
55
|
-
fontSize: size * 0.35, fontWeight: 700, color: theme.primary,
|
|
56
|
-
}}>
|
|
57
|
-
{initials}
|
|
58
|
-
</div>
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export function TkxAIChatBubble({
|
|
63
|
-
role,
|
|
64
|
-
content,
|
|
65
|
-
avatar,
|
|
66
|
-
name,
|
|
67
|
-
timestamp,
|
|
68
|
-
streaming = false,
|
|
69
|
-
confidence,
|
|
70
|
-
copyable = false,
|
|
71
|
-
className,
|
|
72
|
-
style,
|
|
73
|
-
}: TkxAIChatBubbleProps) {
|
|
74
|
-
const theme = useTheme();
|
|
75
|
-
const isUser = role === 'user';
|
|
76
|
-
const isSystem = role === 'system';
|
|
77
|
-
|
|
78
|
-
// Streaming typewriter effect
|
|
79
|
-
const fullText = typeof content === 'string' ? sanitizeString(content) : '';
|
|
80
|
-
const [displayed, setDisplayed] = useState(streaming ? '' : fullText);
|
|
81
|
-
const [copied, setCopied] = useState(false);
|
|
82
|
-
// Debounced text exposed to assistive tech. We deliberately avoid
|
|
83
|
-
// announcing each keystroke — screen readers would read every character.
|
|
84
|
-
// Instead we publish on word boundaries (~350ms idle) and on completion.
|
|
85
|
-
const [liveAnnouncement, setLiveAnnouncement] = useState(streaming ? '' : fullText);
|
|
86
|
-
const idxRef = useRef(0);
|
|
87
|
-
const liveDebounceRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
88
|
-
|
|
89
|
-
useEffect(() => {
|
|
90
|
-
if (!streaming || typeof content !== 'string') {
|
|
91
|
-
setLiveAnnouncement(fullText);
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
idxRef.current = 0;
|
|
95
|
-
setDisplayed('');
|
|
96
|
-
setLiveAnnouncement('');
|
|
97
|
-
const interval = setInterval(() => {
|
|
98
|
-
idxRef.current++;
|
|
99
|
-
const next = fullText.slice(0, idxRef.current);
|
|
100
|
-
setDisplayed(next);
|
|
101
|
-
// Queue a debounced live-region update. Clear prior timer so
|
|
102
|
-
// only the latest pause flushes — AT hears words, not letters.
|
|
103
|
-
if (liveDebounceRef.current) clearTimeout(liveDebounceRef.current);
|
|
104
|
-
liveDebounceRef.current = setTimeout(() => setLiveAnnouncement(next), 350);
|
|
105
|
-
if (idxRef.current >= fullText.length) {
|
|
106
|
-
clearInterval(interval);
|
|
107
|
-
if (liveDebounceRef.current) clearTimeout(liveDebounceRef.current);
|
|
108
|
-
setLiveAnnouncement(fullText);
|
|
109
|
-
}
|
|
110
|
-
}, 18);
|
|
111
|
-
return () => {
|
|
112
|
-
clearInterval(interval);
|
|
113
|
-
if (liveDebounceRef.current) clearTimeout(liveDebounceRef.current);
|
|
114
|
-
};
|
|
115
|
-
}, [fullText, streaming, content]);
|
|
116
|
-
|
|
117
|
-
const handleCopy = () => {
|
|
118
|
-
navigator.clipboard?.writeText(fullText);
|
|
119
|
-
setCopied(true);
|
|
120
|
-
setTimeout(() => setCopied(false), 2000);
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
// System message style
|
|
124
|
-
if (isSystem) {
|
|
125
|
-
return (
|
|
126
|
-
<div style={{
|
|
127
|
-
display: 'flex', justifyContent: 'center', padding: '8px 0',
|
|
128
|
-
}}>
|
|
129
|
-
<div style={{
|
|
130
|
-
padding: '6px 16px', borderRadius: 999, fontSize: 12,
|
|
131
|
-
background: `${theme.border}`, color: theme.textMuted,
|
|
132
|
-
fontStyle: 'italic',
|
|
133
|
-
}}>
|
|
134
|
-
{typeof content === 'string' ? sanitizeString(content) : content}
|
|
135
|
-
</div>
|
|
136
|
-
</div>
|
|
137
|
-
);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
const bubbleStyle: CSSProperties = {
|
|
141
|
-
maxWidth: '75%',
|
|
142
|
-
padding: '12px 16px',
|
|
143
|
-
borderRadius: isUser ? '18px 18px 4px 18px' : '18px 18px 18px 4px',
|
|
144
|
-
background: isUser
|
|
145
|
-
? `linear-gradient(135deg, ${theme.primary}, ${theme.primary}cc)`
|
|
146
|
-
: `${theme.surface}`,
|
|
147
|
-
border: isUser ? 'none' : `1px solid ${theme.border}`,
|
|
148
|
-
color: isUser ? '#fff' : theme.text,
|
|
149
|
-
fontSize: 14,
|
|
150
|
-
lineHeight: 1.65,
|
|
151
|
-
boxShadow: isUser
|
|
152
|
-
? `0 4px 16px -4px ${theme.primary}55`
|
|
153
|
-
: `0 2px 8px -2px rgba(0,0,0,0.2)`,
|
|
154
|
-
position: 'relative',
|
|
155
|
-
wordBreak: 'break-word',
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
return (
|
|
159
|
-
<div
|
|
160
|
-
className={cx(tkx('flex gap-2'), className)}
|
|
161
|
-
style={{
|
|
162
|
-
flexDirection: isUser ? 'row-reverse' : 'row',
|
|
163
|
-
alignItems: 'flex-end',
|
|
164
|
-
...style,
|
|
165
|
-
}}
|
|
166
|
-
>
|
|
167
|
-
{/* Avatar */}
|
|
168
|
-
<Avatar src={avatar} name={name ?? (isUser ? 'You' : 'AI')} />
|
|
169
|
-
|
|
170
|
-
<div style={{ display: 'flex', flexDirection: 'column', gap: 4, alignItems: isUser ? 'flex-end' : 'flex-start' }}>
|
|
171
|
-
{/* Name + timestamp */}
|
|
172
|
-
{(name || timestamp) && (
|
|
173
|
-
<div style={{ display: 'flex', gap: 8, alignItems: 'center', paddingInline: 4 }}>
|
|
174
|
-
{name && <span style={{ fontSize: 11, fontWeight: 700, color: theme.textMuted }}>{name}</span>}
|
|
175
|
-
{timestamp && <span style={{ fontSize: 10, color: theme.textMuted }}>{timestamp}</span>}
|
|
176
|
-
</div>
|
|
177
|
-
)}
|
|
178
|
-
|
|
179
|
-
{/* Bubble */}
|
|
180
|
-
<div style={bubbleStyle} role="article" aria-label={isUser ? 'Your message' : 'Assistant message'}>
|
|
181
|
-
{typeof content === 'string' ? (
|
|
182
|
-
<>
|
|
183
|
-
{/* Visible (noisy) streamed text: hidden from AT during streaming
|
|
184
|
-
so screen readers aren't spammed with every character. */}
|
|
185
|
-
<span aria-hidden={streaming ? 'true' : undefined}>
|
|
186
|
-
{streaming ? displayed : sanitizeString(content)}
|
|
187
|
-
</span>
|
|
188
|
-
{streaming && displayed.length < fullText.length && (
|
|
189
|
-
<span aria-hidden="true" style={{ display: 'inline-block', width: 2, height: 14, background: isUser ? '#fff' : theme.primary, marginLeft: 2, animation: 'tkx-blink 1s step-end infinite', verticalAlign: 'text-bottom' }} />
|
|
190
|
-
)}
|
|
191
|
-
{/* Debounced polite live region — announces completed words, not keystrokes. */}
|
|
192
|
-
{streaming && (
|
|
193
|
-
<span
|
|
194
|
-
aria-live="polite"
|
|
195
|
-
aria-atomic="false"
|
|
196
|
-
style={{
|
|
197
|
-
position: 'absolute',
|
|
198
|
-
width: 1,
|
|
199
|
-
height: 1,
|
|
200
|
-
padding: 0,
|
|
201
|
-
margin: -1,
|
|
202
|
-
overflow: 'hidden',
|
|
203
|
-
clip: 'rect(0,0,0,0)',
|
|
204
|
-
whiteSpace: 'nowrap',
|
|
205
|
-
border: 0,
|
|
206
|
-
}}
|
|
207
|
-
>
|
|
208
|
-
{liveAnnouncement}
|
|
209
|
-
</span>
|
|
210
|
-
)}
|
|
211
|
-
</>
|
|
212
|
-
) : content}
|
|
213
|
-
|
|
214
|
-
{/* Copy button */}
|
|
215
|
-
{copyable && !isUser && (
|
|
216
|
-
<button
|
|
217
|
-
onClick={handleCopy}
|
|
218
|
-
title="Copy message"
|
|
219
|
-
style={{
|
|
220
|
-
position: 'absolute', top: 8, right: 8,
|
|
221
|
-
background: 'none', border: 'none', cursor: 'pointer',
|
|
222
|
-
fontSize: 13, color: copied ? '#10b981' : theme.textMuted,
|
|
223
|
-
padding: '2px 4px', borderRadius: 4,
|
|
224
|
-
transition: 'color 0.2s',
|
|
225
|
-
}}
|
|
226
|
-
>
|
|
227
|
-
{copied ? '✓' : '⎘'}
|
|
228
|
-
</button>
|
|
229
|
-
)}
|
|
230
|
-
</div>
|
|
231
|
-
|
|
232
|
-
{/* Confidence bar (AI only) */}
|
|
233
|
-
{!isUser && confidence !== undefined && (
|
|
234
|
-
<div style={{ paddingInline: 4, width: '100%', maxWidth: 240 }}>
|
|
235
|
-
<div style={{ display: 'flex', alignItems: 'center', gap: 6 }}>
|
|
236
|
-
<div style={{ flex: 1, height: 3, borderRadius: 3, background: theme.border, overflow: 'hidden' }}>
|
|
237
|
-
<div style={{
|
|
238
|
-
height: '100%', width: `${confidence}%`,
|
|
239
|
-
background: confidenceColor(confidence, theme.primary),
|
|
240
|
-
borderRadius: 3, transition: 'width 0.8s ease',
|
|
241
|
-
}} />
|
|
242
|
-
</div>
|
|
243
|
-
<span style={{ fontSize: 10, color: theme.textMuted, whiteSpace: 'nowrap' }}>
|
|
244
|
-
{confidence}% confident
|
|
245
|
-
</span>
|
|
246
|
-
</div>
|
|
247
|
-
</div>
|
|
248
|
-
)}
|
|
249
|
-
</div>
|
|
250
|
-
|
|
251
|
-
<style>{`
|
|
252
|
-
@keyframes tkx-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
|
|
253
|
-
`}</style>
|
|
254
|
-
</div>
|
|
255
|
-
);
|
|
256
|
-
}
|