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,244 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { type ReactNode } from 'react';
|
|
4
|
-
import { useTheme } from '../themes';
|
|
5
|
-
import { sanitizeString } from '../engine/security';
|
|
6
|
-
import { useReducedMotion } from '../hooks';
|
|
7
|
-
import { tkx } from '../engine/tkx';
|
|
8
|
-
|
|
9
|
-
// ── Types ────────────────────────────────────────────────────────────────────
|
|
10
|
-
|
|
11
|
-
export interface ListItem {
|
|
12
|
-
key: string;
|
|
13
|
-
title: string;
|
|
14
|
-
description?: string;
|
|
15
|
-
avatar?: ReactNode;
|
|
16
|
-
actions?: ReactNode;
|
|
17
|
-
extra?: ReactNode;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface TkxListProps {
|
|
21
|
-
items: ListItem[];
|
|
22
|
-
header?: ReactNode;
|
|
23
|
-
footer?: ReactNode;
|
|
24
|
-
bordered?: boolean;
|
|
25
|
-
size?: 'sm' | 'md' | 'lg';
|
|
26
|
-
loading?: boolean;
|
|
27
|
-
emptyText?: string;
|
|
28
|
-
grid?: { column?: number; gutter?: number };
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// ── Size Tokens ──────────────────────────────────────────────────────────────
|
|
32
|
-
|
|
33
|
-
const SIZE_PADDING = {
|
|
34
|
-
sm: '8px 12px',
|
|
35
|
-
md: '12px 16px',
|
|
36
|
-
lg: '16px 20px',
|
|
37
|
-
} as const;
|
|
38
|
-
|
|
39
|
-
// ── Loading Skeleton ─────────────────────────────────────────────────────────
|
|
40
|
-
|
|
41
|
-
function Skeleton({ theme, reducedMotion }: { theme: ReturnType<typeof useTheme>; reducedMotion: boolean }) {
|
|
42
|
-
return (
|
|
43
|
-
<div className={tkx('flex items-center gap-3 px-4 py-3')} aria-hidden="true">
|
|
44
|
-
<div
|
|
45
|
-
style={{
|
|
46
|
-
width: 40,
|
|
47
|
-
height: 40,
|
|
48
|
-
borderRadius: '50%',
|
|
49
|
-
backgroundColor: theme.surfaceAlt,
|
|
50
|
-
animation: reducedMotion ? 'none' : 'tkxPulse 1.5s ease infinite',
|
|
51
|
-
}}
|
|
52
|
-
/>
|
|
53
|
-
<div className={tkx('flex-1')}>
|
|
54
|
-
<div
|
|
55
|
-
style={{
|
|
56
|
-
width: '60%',
|
|
57
|
-
height: 14,
|
|
58
|
-
borderRadius: 4,
|
|
59
|
-
backgroundColor: theme.surfaceAlt,
|
|
60
|
-
marginBottom: 8,
|
|
61
|
-
animation: reducedMotion ? 'none' : 'tkxPulse 1.5s ease infinite',
|
|
62
|
-
}}
|
|
63
|
-
/>
|
|
64
|
-
<div
|
|
65
|
-
style={{
|
|
66
|
-
width: '40%',
|
|
67
|
-
height: 12,
|
|
68
|
-
borderRadius: 4,
|
|
69
|
-
backgroundColor: theme.surfaceAlt,
|
|
70
|
-
animation: reducedMotion ? 'none' : 'tkxPulse 1.5s ease infinite',
|
|
71
|
-
}}
|
|
72
|
-
/>
|
|
73
|
-
</div>
|
|
74
|
-
</div>
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// ── Component ────────────────────────────────────────────────────────────────
|
|
79
|
-
|
|
80
|
-
export function TkxList({
|
|
81
|
-
items,
|
|
82
|
-
header,
|
|
83
|
-
footer,
|
|
84
|
-
bordered = true,
|
|
85
|
-
size = 'md',
|
|
86
|
-
loading = false,
|
|
87
|
-
emptyText = 'No data',
|
|
88
|
-
grid,
|
|
89
|
-
}: TkxListProps) {
|
|
90
|
-
const theme = useTheme();
|
|
91
|
-
const reducedMotion = useReducedMotion();
|
|
92
|
-
const safeEmptyText = sanitizeString(emptyText);
|
|
93
|
-
const padding = SIZE_PADDING[size];
|
|
94
|
-
|
|
95
|
-
const isGrid = !!grid;
|
|
96
|
-
const columns = grid?.column ?? 1;
|
|
97
|
-
const gutter = grid?.gutter ?? 16;
|
|
98
|
-
|
|
99
|
-
return (
|
|
100
|
-
<div
|
|
101
|
-
role="list"
|
|
102
|
-
aria-label="List"
|
|
103
|
-
aria-busy={loading}
|
|
104
|
-
className={tkx('font-sans rounded-lg overflow-hidden')}
|
|
105
|
-
style={{
|
|
106
|
-
border: bordered ? `1px solid ${theme.border}` : 'none',
|
|
107
|
-
backgroundColor: theme.surface,
|
|
108
|
-
}}
|
|
109
|
-
>
|
|
110
|
-
{/* Header */}
|
|
111
|
-
{header && (
|
|
112
|
-
<div
|
|
113
|
-
className={tkx('font-semibold text-sm')}
|
|
114
|
-
style={{
|
|
115
|
-
padding,
|
|
116
|
-
color: theme.text,
|
|
117
|
-
borderBottom: `1px solid ${theme.border}`,
|
|
118
|
-
backgroundColor: theme.surfaceAlt,
|
|
119
|
-
}}
|
|
120
|
-
>
|
|
121
|
-
{header}
|
|
122
|
-
</div>
|
|
123
|
-
)}
|
|
124
|
-
|
|
125
|
-
{/* Loading */}
|
|
126
|
-
{loading && (
|
|
127
|
-
<div>
|
|
128
|
-
{Array.from({ length: 3 }).map((_, i) => (
|
|
129
|
-
<Skeleton key={i} theme={theme} reducedMotion={reducedMotion} />
|
|
130
|
-
))}
|
|
131
|
-
</div>
|
|
132
|
-
)}
|
|
133
|
-
|
|
134
|
-
{/* Empty State */}
|
|
135
|
-
{!loading && items.length === 0 && (
|
|
136
|
-
<div
|
|
137
|
-
role="status"
|
|
138
|
-
className={tkx('text-center py-12 text-sm')}
|
|
139
|
-
style={{ color: theme.textMuted }}
|
|
140
|
-
>
|
|
141
|
-
{safeEmptyText}
|
|
142
|
-
</div>
|
|
143
|
-
)}
|
|
144
|
-
|
|
145
|
-
{/* Items */}
|
|
146
|
-
{!loading && items.length > 0 && (
|
|
147
|
-
<div
|
|
148
|
-
style={
|
|
149
|
-
isGrid
|
|
150
|
-
? {
|
|
151
|
-
display: 'grid',
|
|
152
|
-
gridTemplateColumns: `repeat(${columns}, 1fr)`,
|
|
153
|
-
gap: gutter,
|
|
154
|
-
padding: gutter,
|
|
155
|
-
}
|
|
156
|
-
: undefined
|
|
157
|
-
}
|
|
158
|
-
>
|
|
159
|
-
{items.map((item, idx) => {
|
|
160
|
-
const safeTitle = sanitizeString(item.title);
|
|
161
|
-
const safeDesc = item.description ? sanitizeString(item.description) : undefined;
|
|
162
|
-
|
|
163
|
-
return (
|
|
164
|
-
<div
|
|
165
|
-
key={item.key}
|
|
166
|
-
role="listitem"
|
|
167
|
-
className={tkx('flex items-start gap-3')}
|
|
168
|
-
style={{
|
|
169
|
-
padding: isGrid ? padding : padding,
|
|
170
|
-
borderBottom:
|
|
171
|
-
!isGrid && idx < items.length - 1
|
|
172
|
-
? `1px solid ${theme.border}`
|
|
173
|
-
: 'none',
|
|
174
|
-
...(isGrid
|
|
175
|
-
? {
|
|
176
|
-
border: `1px solid ${theme.border}`,
|
|
177
|
-
borderRadius: 8,
|
|
178
|
-
backgroundColor: theme.surface,
|
|
179
|
-
}
|
|
180
|
-
: {}),
|
|
181
|
-
animation: reducedMotion ? 'none' : `tkxFadeIn 0.2s ease ${idx * 0.03}s both`,
|
|
182
|
-
}}
|
|
183
|
-
>
|
|
184
|
-
{/* Avatar */}
|
|
185
|
-
{item.avatar && (
|
|
186
|
-
<div aria-hidden="true" className={tkx('shrink-0')}>
|
|
187
|
-
{item.avatar}
|
|
188
|
-
</div>
|
|
189
|
-
)}
|
|
190
|
-
|
|
191
|
-
{/* Content */}
|
|
192
|
-
<div className={tkx('flex-1 min-w-0')}>
|
|
193
|
-
<div
|
|
194
|
-
className={tkx('text-sm font-medium')}
|
|
195
|
-
style={{ color: theme.text }}
|
|
196
|
-
>
|
|
197
|
-
{safeTitle}
|
|
198
|
-
</div>
|
|
199
|
-
{safeDesc && (
|
|
200
|
-
<div
|
|
201
|
-
className={tkx('text-xs mt-1 leading-relaxed')}
|
|
202
|
-
style={{ color: theme.textMuted }}
|
|
203
|
-
>
|
|
204
|
-
{safeDesc}
|
|
205
|
-
</div>
|
|
206
|
-
)}
|
|
207
|
-
</div>
|
|
208
|
-
|
|
209
|
-
{/* Extra */}
|
|
210
|
-
{item.extra && (
|
|
211
|
-
<div className={tkx('shrink-0 ml-auto')} style={{ color: theme.textMuted }}>
|
|
212
|
-
{item.extra}
|
|
213
|
-
</div>
|
|
214
|
-
)}
|
|
215
|
-
|
|
216
|
-
{/* Actions */}
|
|
217
|
-
{item.actions && (
|
|
218
|
-
<div className={tkx('shrink-0 flex items-center gap-2')}>
|
|
219
|
-
{item.actions}
|
|
220
|
-
</div>
|
|
221
|
-
)}
|
|
222
|
-
</div>
|
|
223
|
-
);
|
|
224
|
-
})}
|
|
225
|
-
</div>
|
|
226
|
-
)}
|
|
227
|
-
|
|
228
|
-
{/* Footer */}
|
|
229
|
-
{footer && (
|
|
230
|
-
<div
|
|
231
|
-
className={tkx('text-sm')}
|
|
232
|
-
style={{
|
|
233
|
-
padding,
|
|
234
|
-
color: theme.textMuted,
|
|
235
|
-
borderTop: `1px solid ${theme.border}`,
|
|
236
|
-
backgroundColor: theme.surfaceAlt,
|
|
237
|
-
}}
|
|
238
|
-
>
|
|
239
|
-
{footer}
|
|
240
|
-
</div>
|
|
241
|
-
)}
|
|
242
|
-
</div>
|
|
243
|
-
);
|
|
244
|
-
}
|
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
useState,
|
|
5
|
-
useEffect,
|
|
6
|
-
useRef,
|
|
7
|
-
useCallback,
|
|
8
|
-
useMemo,
|
|
9
|
-
createElement,
|
|
10
|
-
type CSSProperties,
|
|
11
|
-
} from 'react';
|
|
12
|
-
import { useTheme } from '../themes';
|
|
13
|
-
import { sanitizeString } from '../engine/security';
|
|
14
|
-
import { tkx } from '../engine/tkx';
|
|
15
|
-
|
|
16
|
-
// ── Types ────────────────────────────────────────────────────────────────────
|
|
17
|
-
|
|
18
|
-
export interface FeedItem {
|
|
19
|
-
id: string;
|
|
20
|
-
content: string;
|
|
21
|
-
timestamp: number;
|
|
22
|
-
type?: 'info' | 'success' | 'warning' | 'error' | 'default';
|
|
23
|
-
avatar?: string;
|
|
24
|
-
author?: string;
|
|
25
|
-
meta?: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface TkxLiveFeedProps {
|
|
29
|
-
items: FeedItem[];
|
|
30
|
-
maxItems?: number;
|
|
31
|
-
height?: number | string;
|
|
32
|
-
autoScroll?: boolean;
|
|
33
|
-
showTimestamps?: boolean;
|
|
34
|
-
onItemClick?: (item: FeedItem) => void;
|
|
35
|
-
emptyMessage?: string;
|
|
36
|
-
pauseOnHover?: boolean;
|
|
37
|
-
renderItem?: (item: FeedItem) => React.ReactNode;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// ── Constants ────────────────────────────────────────────────────────────────
|
|
41
|
-
|
|
42
|
-
const ITEM_HEIGHT = 64;
|
|
43
|
-
const OVERSCAN = 5;
|
|
44
|
-
|
|
45
|
-
// ── CSS injection ────────────────────────────────────────────────────────────
|
|
46
|
-
|
|
47
|
-
let feedStylesInjected = false;
|
|
48
|
-
function injectFeedStyles() {
|
|
49
|
-
if (feedStylesInjected || typeof document === 'undefined') return;
|
|
50
|
-
feedStylesInjected = true;
|
|
51
|
-
const el = document.createElement('style');
|
|
52
|
-
el.id = 'tkx-live-feed-styles';
|
|
53
|
-
el.textContent = `
|
|
54
|
-
@keyframes tkx-feed-slide-in {
|
|
55
|
-
from { transform: translateY(-20px); opacity: 0; }
|
|
56
|
-
to { transform: translateY(0); opacity: 1; }
|
|
57
|
-
}
|
|
58
|
-
.tkx-feed-item-new {
|
|
59
|
-
animation: tkx-feed-slide-in 0.25s ease-out both;
|
|
60
|
-
}
|
|
61
|
-
`.trim();
|
|
62
|
-
document.head.appendChild(el);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// ── Helpers ──────────────────────────────────────────────────────────────────
|
|
66
|
-
|
|
67
|
-
function relativeTime(ts: number): string {
|
|
68
|
-
const diff = Date.now() - ts;
|
|
69
|
-
if (diff < 10_000) return 'just now';
|
|
70
|
-
if (diff < 60_000) return `${Math.floor(diff / 1_000)}s ago`;
|
|
71
|
-
if (diff < 3_600_000) return `${Math.floor(diff / 60_000)}m ago`;
|
|
72
|
-
if (diff < 86_400_000) return `${Math.floor(diff / 3_600_000)}h ago`;
|
|
73
|
-
return `${Math.floor(diff / 86_400_000)}d ago`;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function getTypeColor(type: FeedItem['type'], theme: ReturnType<typeof useTheme>): string {
|
|
77
|
-
switch (type) {
|
|
78
|
-
case 'info': return theme.info;
|
|
79
|
-
case 'success': return theme.success;
|
|
80
|
-
case 'warning': return theme.warning;
|
|
81
|
-
case 'error': return theme.danger;
|
|
82
|
-
default: return theme.border;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
function getInitials(author?: string): string {
|
|
87
|
-
if (!author) return '?';
|
|
88
|
-
return author
|
|
89
|
-
.split(' ')
|
|
90
|
-
.map((w) => w[0] ?? '')
|
|
91
|
-
.slice(0, 2)
|
|
92
|
-
.join('')
|
|
93
|
-
.toUpperCase();
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// ── FeedRow ──────────────────────────────────────────────────────────────────
|
|
97
|
-
|
|
98
|
-
interface FeedRowProps {
|
|
99
|
-
item: FeedItem;
|
|
100
|
-
isNew: boolean;
|
|
101
|
-
showTimestamps: boolean;
|
|
102
|
-
onItemClick?: (item: FeedItem) => void;
|
|
103
|
-
renderItem?: (item: FeedItem) => React.ReactNode;
|
|
104
|
-
theme: ReturnType<typeof useTheme>;
|
|
105
|
-
style?: CSSProperties;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
function FeedRow({ item, isNew, showTimestamps, onItemClick, renderItem, theme, style }: FeedRowProps) {
|
|
109
|
-
const accentColor = getTypeColor(item.type, theme);
|
|
110
|
-
|
|
111
|
-
if (renderItem) {
|
|
112
|
-
return createElement('div', { style, className: isNew ? 'tkx-feed-item-new' : undefined }, renderItem(item));
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
const rowStyle: CSSProperties = {
|
|
116
|
-
...style,
|
|
117
|
-
display: 'flex',
|
|
118
|
-
alignItems: 'center',
|
|
119
|
-
gap: 10,
|
|
120
|
-
padding: '0 12px',
|
|
121
|
-
borderLeft: `3px solid ${accentColor}`,
|
|
122
|
-
cursor: onItemClick ? 'pointer' : 'default',
|
|
123
|
-
boxSizing: 'border-box',
|
|
124
|
-
height: ITEM_HEIGHT,
|
|
125
|
-
background: theme.surface,
|
|
126
|
-
transition: 'background 0.15s',
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
return createElement(
|
|
130
|
-
'div',
|
|
131
|
-
{
|
|
132
|
-
style: rowStyle,
|
|
133
|
-
className: isNew ? 'tkx-feed-item-new' : undefined,
|
|
134
|
-
onClick: onItemClick ? () => onItemClick(item) : undefined,
|
|
135
|
-
role: onItemClick ? 'button' : undefined,
|
|
136
|
-
tabIndex: onItemClick ? 0 : undefined,
|
|
137
|
-
onKeyDown: onItemClick
|
|
138
|
-
? (e: React.KeyboardEvent) => { if (e.key === 'Enter' || e.key === ' ') onItemClick(item); }
|
|
139
|
-
: undefined,
|
|
140
|
-
},
|
|
141
|
-
// Avatar
|
|
142
|
-
createElement(
|
|
143
|
-
'div',
|
|
144
|
-
{
|
|
145
|
-
style: {
|
|
146
|
-
width: 36,
|
|
147
|
-
height: 36,
|
|
148
|
-
borderRadius: '50%',
|
|
149
|
-
background: accentColor,
|
|
150
|
-
display: 'flex',
|
|
151
|
-
alignItems: 'center',
|
|
152
|
-
justifyContent: 'center',
|
|
153
|
-
fontSize: 13,
|
|
154
|
-
fontWeight: 700,
|
|
155
|
-
color: theme.bg,
|
|
156
|
-
flexShrink: 0,
|
|
157
|
-
overflow: 'hidden',
|
|
158
|
-
},
|
|
159
|
-
},
|
|
160
|
-
item.avatar
|
|
161
|
-
? createElement('img', { src: item.avatar, alt: item.author ?? '', style: { width: '100%', height: '100%', objectFit: 'cover' } })
|
|
162
|
-
: getInitials(item.author),
|
|
163
|
-
),
|
|
164
|
-
// Body
|
|
165
|
-
createElement(
|
|
166
|
-
'div',
|
|
167
|
-
{ style: { flex: 1, minWidth: 0 } },
|
|
168
|
-
createElement(
|
|
169
|
-
'div',
|
|
170
|
-
{ style: { display: 'flex', alignItems: 'center', gap: 6, marginBottom: 2 } },
|
|
171
|
-
item.author && createElement('span', { style: { fontWeight: 600, fontSize: 13, color: theme.text } }, sanitizeString(item.author)),
|
|
172
|
-
item.meta && createElement('span', { style: { fontSize: 11, color: theme.textMuted, background: theme.surfaceAlt, borderRadius: 4, padding: '1px 5px' } }, sanitizeString(item.meta)),
|
|
173
|
-
),
|
|
174
|
-
createElement(
|
|
175
|
-
'div',
|
|
176
|
-
{ style: { fontSize: 13, color: theme.text, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } },
|
|
177
|
-
sanitizeString(item.content),
|
|
178
|
-
),
|
|
179
|
-
),
|
|
180
|
-
// Timestamp
|
|
181
|
-
showTimestamps && createElement(
|
|
182
|
-
'div',
|
|
183
|
-
{ style: { fontSize: 11, color: theme.textMuted, flexShrink: 0 } },
|
|
184
|
-
relativeTime(item.timestamp),
|
|
185
|
-
),
|
|
186
|
-
);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
// ── TkxLiveFeed ──────────────────────────────────────────────────────────────
|
|
190
|
-
|
|
191
|
-
export function TkxLiveFeed({
|
|
192
|
-
items,
|
|
193
|
-
maxItems = 100,
|
|
194
|
-
height = 400,
|
|
195
|
-
autoScroll = true,
|
|
196
|
-
showTimestamps = true,
|
|
197
|
-
onItemClick,
|
|
198
|
-
emptyMessage = 'No activity yet.',
|
|
199
|
-
pauseOnHover = true,
|
|
200
|
-
renderItem,
|
|
201
|
-
}: TkxLiveFeedProps) {
|
|
202
|
-
const theme = useTheme();
|
|
203
|
-
injectFeedStyles();
|
|
204
|
-
|
|
205
|
-
const containerRef = useRef<HTMLDivElement>(null);
|
|
206
|
-
const [scrollTop, setScrollTop] = useState(0);
|
|
207
|
-
const [isHovered, setIsHovered] = useState(false);
|
|
208
|
-
const [newIds, setNewIds] = useState<Set<string>>(new Set());
|
|
209
|
-
const prevItemsRef = useRef<FeedItem[]>([]);
|
|
210
|
-
|
|
211
|
-
// Trim to maxItems
|
|
212
|
-
const visibleItems = useMemo(
|
|
213
|
-
() => items.slice(-maxItems),
|
|
214
|
-
[items, maxItems],
|
|
215
|
-
);
|
|
216
|
-
|
|
217
|
-
const containerHeight = typeof height === 'number' ? height : 400;
|
|
218
|
-
const totalHeight = visibleItems.length * ITEM_HEIGHT;
|
|
219
|
-
|
|
220
|
-
// Track new items for animation
|
|
221
|
-
useEffect(() => {
|
|
222
|
-
const prevIds = new Set(prevItemsRef.current.map((i) => i.id));
|
|
223
|
-
const added = visibleItems.filter((i) => !prevIds.has(i.id)).map((i) => i.id);
|
|
224
|
-
if (added.length > 0) {
|
|
225
|
-
setNewIds((prev) => {
|
|
226
|
-
const next = new Set(prev);
|
|
227
|
-
added.forEach((id) => next.add(id));
|
|
228
|
-
return next;
|
|
229
|
-
});
|
|
230
|
-
const timer = window.setTimeout(() => {
|
|
231
|
-
setNewIds((prev) => {
|
|
232
|
-
const next = new Set(prev);
|
|
233
|
-
added.forEach((id) => next.delete(id));
|
|
234
|
-
return next;
|
|
235
|
-
});
|
|
236
|
-
}, 400);
|
|
237
|
-
return () => clearTimeout(timer);
|
|
238
|
-
}
|
|
239
|
-
return undefined;
|
|
240
|
-
}, [visibleItems]);
|
|
241
|
-
|
|
242
|
-
useEffect(() => {
|
|
243
|
-
prevItemsRef.current = visibleItems;
|
|
244
|
-
}, [visibleItems]);
|
|
245
|
-
|
|
246
|
-
// Auto-scroll
|
|
247
|
-
const shouldAutoScroll = autoScroll && !(pauseOnHover && isHovered);
|
|
248
|
-
useEffect(() => {
|
|
249
|
-
if (!shouldAutoScroll || !containerRef.current) return;
|
|
250
|
-
const el = containerRef.current;
|
|
251
|
-
const nearBottom = el.scrollHeight - el.scrollTop - el.clientHeight < ITEM_HEIGHT * 3;
|
|
252
|
-
if (nearBottom || visibleItems.length <= 5) {
|
|
253
|
-
el.scrollTop = el.scrollHeight;
|
|
254
|
-
}
|
|
255
|
-
}, [visibleItems.length, shouldAutoScroll]);
|
|
256
|
-
|
|
257
|
-
const handleScroll = useCallback(() => {
|
|
258
|
-
if (containerRef.current) setScrollTop(containerRef.current.scrollTop);
|
|
259
|
-
}, []);
|
|
260
|
-
|
|
261
|
-
// Virtualization
|
|
262
|
-
const startIndex = Math.max(0, Math.floor(scrollTop / ITEM_HEIGHT) - OVERSCAN);
|
|
263
|
-
const endIndex = Math.min(
|
|
264
|
-
visibleItems.length - 1,
|
|
265
|
-
Math.ceil((scrollTop + containerHeight) / ITEM_HEIGHT) + OVERSCAN,
|
|
266
|
-
);
|
|
267
|
-
|
|
268
|
-
const containerStyle: CSSProperties = {
|
|
269
|
-
position: 'relative',
|
|
270
|
-
overflow: 'auto',
|
|
271
|
-
height: typeof height === 'number' ? `${height}px` : height,
|
|
272
|
-
background: theme.bg,
|
|
273
|
-
border: `1px solid ${theme.border}`,
|
|
274
|
-
borderRadius: 8,
|
|
275
|
-
boxSizing: 'border-box',
|
|
276
|
-
};
|
|
277
|
-
|
|
278
|
-
const innerStyle: CSSProperties = {
|
|
279
|
-
position: 'relative',
|
|
280
|
-
height: totalHeight,
|
|
281
|
-
minHeight: '100%',
|
|
282
|
-
};
|
|
283
|
-
|
|
284
|
-
if (visibleItems.length === 0) {
|
|
285
|
-
return createElement(
|
|
286
|
-
'div',
|
|
287
|
-
{ style: { ...containerStyle, display: 'flex', alignItems: 'center', justifyContent: 'center' } },
|
|
288
|
-
createElement('span', { style: { color: theme.textMuted, fontSize: 14 } }, sanitizeString(emptyMessage)),
|
|
289
|
-
);
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
const rows: React.ReactNode[] = [];
|
|
293
|
-
for (let i = startIndex; i <= endIndex; i++) {
|
|
294
|
-
const item = visibleItems[i];
|
|
295
|
-
if (!item) continue;
|
|
296
|
-
rows.push(
|
|
297
|
-
createElement(FeedRow, {
|
|
298
|
-
key: item.id,
|
|
299
|
-
item,
|
|
300
|
-
isNew: newIds.has(item.id),
|
|
301
|
-
showTimestamps,
|
|
302
|
-
onItemClick,
|
|
303
|
-
renderItem,
|
|
304
|
-
theme,
|
|
305
|
-
style: {
|
|
306
|
-
position: 'absolute',
|
|
307
|
-
top: i * ITEM_HEIGHT,
|
|
308
|
-
left: 0,
|
|
309
|
-
right: 0,
|
|
310
|
-
},
|
|
311
|
-
}),
|
|
312
|
-
);
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
return createElement(
|
|
316
|
-
'div',
|
|
317
|
-
{
|
|
318
|
-
ref: containerRef,
|
|
319
|
-
style: containerStyle,
|
|
320
|
-
onScroll: handleScroll,
|
|
321
|
-
onMouseEnter: pauseOnHover ? () => setIsHovered(true) : undefined,
|
|
322
|
-
onMouseLeave: pauseOnHover ? () => setIsHovered(false) : undefined,
|
|
323
|
-
'aria-label': 'Live feed',
|
|
324
|
-
role: 'feed',
|
|
325
|
-
},
|
|
326
|
-
createElement('div', { style: innerStyle }, ...rows),
|
|
327
|
-
);
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
// Ensure tkx is referenced (satisfies import requirement)
|
|
331
|
-
void tkx;
|