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
package/dist/realtime.js
CHANGED
|
@@ -1,804 +1 @@
|
|
|
1
|
-
import { f as e } from "./themes-BbJanqiC.js";
|
|
2
|
-
import { m as t } from "./tkx-mOKMzvUK.js";
|
|
3
|
-
import { createElement as n, useCallback as r, useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
|
|
4
|
-
//#region src/components/TkxLiveFeed.tsx
|
|
5
|
-
var c = 64, l = 5, u = !1;
|
|
6
|
-
function d() {
|
|
7
|
-
if (u || typeof document > "u") return;
|
|
8
|
-
u = !0;
|
|
9
|
-
let e = document.createElement("style");
|
|
10
|
-
e.id = "tkx-live-feed-styles", e.textContent = "@keyframes tkx-feed-slide-in {\n from { transform: translateY(-20px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n}\n.tkx-feed-item-new {\n animation: tkx-feed-slide-in 0.25s ease-out both;\n}", document.head.appendChild(e);
|
|
11
|
-
}
|
|
12
|
-
function f(e) {
|
|
13
|
-
let t = Date.now() - e;
|
|
14
|
-
return t < 1e4 ? "just now" : t < 6e4 ? `${Math.floor(t / 1e3)}s ago` : t < 36e5 ? `${Math.floor(t / 6e4)}m ago` : t < 864e5 ? `${Math.floor(t / 36e5)}h ago` : `${Math.floor(t / 864e5)}d ago`;
|
|
15
|
-
}
|
|
16
|
-
function p(e, t) {
|
|
17
|
-
switch (e) {
|
|
18
|
-
case "info": return t.info;
|
|
19
|
-
case "success": return t.success;
|
|
20
|
-
case "warning": return t.warning;
|
|
21
|
-
case "error": return t.danger;
|
|
22
|
-
default: return t.border;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
function m(e) {
|
|
26
|
-
return e ? e.split(" ").map((e) => e[0] ?? "").slice(0, 2).join("").toUpperCase() : "?";
|
|
27
|
-
}
|
|
28
|
-
function h({ item: e, isNew: r, showTimestamps: i, onItemClick: a, renderItem: o, theme: s, style: l }) {
|
|
29
|
-
let u = p(e.type, s);
|
|
30
|
-
return o ? n("div", {
|
|
31
|
-
style: l,
|
|
32
|
-
className: r ? "tkx-feed-item-new" : void 0
|
|
33
|
-
}, o(e)) : n("div", {
|
|
34
|
-
style: {
|
|
35
|
-
...l,
|
|
36
|
-
display: "flex",
|
|
37
|
-
alignItems: "center",
|
|
38
|
-
gap: 10,
|
|
39
|
-
padding: "0 12px",
|
|
40
|
-
borderLeft: `3px solid ${u}`,
|
|
41
|
-
cursor: a ? "pointer" : "default",
|
|
42
|
-
boxSizing: "border-box",
|
|
43
|
-
height: c,
|
|
44
|
-
background: s.surface,
|
|
45
|
-
transition: "background 0.15s"
|
|
46
|
-
},
|
|
47
|
-
className: r ? "tkx-feed-item-new" : void 0,
|
|
48
|
-
onClick: a ? () => a(e) : void 0,
|
|
49
|
-
role: a ? "button" : void 0,
|
|
50
|
-
tabIndex: a ? 0 : void 0,
|
|
51
|
-
onKeyDown: a ? (t) => {
|
|
52
|
-
(t.key === "Enter" || t.key === " ") && a(e);
|
|
53
|
-
} : void 0
|
|
54
|
-
}, n("div", { style: {
|
|
55
|
-
width: 36,
|
|
56
|
-
height: 36,
|
|
57
|
-
borderRadius: "50%",
|
|
58
|
-
background: u,
|
|
59
|
-
display: "flex",
|
|
60
|
-
alignItems: "center",
|
|
61
|
-
justifyContent: "center",
|
|
62
|
-
fontSize: 13,
|
|
63
|
-
fontWeight: 700,
|
|
64
|
-
color: s.bg,
|
|
65
|
-
flexShrink: 0,
|
|
66
|
-
overflow: "hidden"
|
|
67
|
-
} }, e.avatar ? n("img", {
|
|
68
|
-
src: e.avatar,
|
|
69
|
-
alt: e.author ?? "",
|
|
70
|
-
style: {
|
|
71
|
-
width: "100%",
|
|
72
|
-
height: "100%",
|
|
73
|
-
objectFit: "cover"
|
|
74
|
-
}
|
|
75
|
-
}) : m(e.author)), n("div", { style: {
|
|
76
|
-
flex: 1,
|
|
77
|
-
minWidth: 0
|
|
78
|
-
} }, n("div", { style: {
|
|
79
|
-
display: "flex",
|
|
80
|
-
alignItems: "center",
|
|
81
|
-
gap: 6,
|
|
82
|
-
marginBottom: 2
|
|
83
|
-
} }, e.author && n("span", { style: {
|
|
84
|
-
fontWeight: 600,
|
|
85
|
-
fontSize: 13,
|
|
86
|
-
color: s.text
|
|
87
|
-
} }, t(e.author)), e.meta && n("span", { style: {
|
|
88
|
-
fontSize: 11,
|
|
89
|
-
color: s.textMuted,
|
|
90
|
-
background: s.surfaceAlt,
|
|
91
|
-
borderRadius: 4,
|
|
92
|
-
padding: "1px 5px"
|
|
93
|
-
} }, t(e.meta))), n("div", { style: {
|
|
94
|
-
fontSize: 13,
|
|
95
|
-
color: s.text,
|
|
96
|
-
overflow: "hidden",
|
|
97
|
-
textOverflow: "ellipsis",
|
|
98
|
-
whiteSpace: "nowrap"
|
|
99
|
-
} }, t(e.content))), i && n("div", { style: {
|
|
100
|
-
fontSize: 11,
|
|
101
|
-
color: s.textMuted,
|
|
102
|
-
flexShrink: 0
|
|
103
|
-
} }, f(e.timestamp)));
|
|
104
|
-
}
|
|
105
|
-
function g({ items: u, maxItems: f = 100, height: p = 400, autoScroll: m = !0, showTimestamps: g = !0, onItemClick: _, emptyMessage: v = "No activity yet.", pauseOnHover: y = !0, renderItem: b }) {
|
|
106
|
-
let x = e();
|
|
107
|
-
d();
|
|
108
|
-
let S = o(null), [C, w] = s(0), [T, E] = s(!1), [D, O] = s(/* @__PURE__ */ new Set()), k = o([]), A = a(() => u.slice(-f), [u, f]), j = typeof p == "number" ? p : 400, M = A.length * c;
|
|
109
|
-
i(() => {
|
|
110
|
-
let e = new Set(k.current.map((e) => e.id)), t = A.filter((t) => !e.has(t.id)).map((e) => e.id);
|
|
111
|
-
if (t.length > 0) {
|
|
112
|
-
O((e) => {
|
|
113
|
-
let n = new Set(e);
|
|
114
|
-
return t.forEach((e) => n.add(e)), n;
|
|
115
|
-
});
|
|
116
|
-
let e = window.setTimeout(() => {
|
|
117
|
-
O((e) => {
|
|
118
|
-
let n = new Set(e);
|
|
119
|
-
return t.forEach((e) => n.delete(e)), n;
|
|
120
|
-
});
|
|
121
|
-
}, 400);
|
|
122
|
-
return () => clearTimeout(e);
|
|
123
|
-
}
|
|
124
|
-
}, [A]), i(() => {
|
|
125
|
-
k.current = A;
|
|
126
|
-
}, [A]);
|
|
127
|
-
let N = m && !(y && T);
|
|
128
|
-
i(() => {
|
|
129
|
-
if (!N || !S.current) return;
|
|
130
|
-
let e = S.current;
|
|
131
|
-
(e.scrollHeight - e.scrollTop - e.clientHeight < c * 3 || A.length <= 5) && (e.scrollTop = e.scrollHeight);
|
|
132
|
-
}, [A.length, N]);
|
|
133
|
-
let P = r(() => {
|
|
134
|
-
S.current && w(S.current.scrollTop);
|
|
135
|
-
}, []), F = Math.max(0, Math.floor(C / c) - l), I = Math.min(A.length - 1, Math.ceil((C + j) / c) + l), L = {
|
|
136
|
-
position: "relative",
|
|
137
|
-
overflow: "auto",
|
|
138
|
-
height: typeof p == "number" ? `${p}px` : p,
|
|
139
|
-
background: x.bg,
|
|
140
|
-
border: `1px solid ${x.border}`,
|
|
141
|
-
borderRadius: 8,
|
|
142
|
-
boxSizing: "border-box"
|
|
143
|
-
}, R = {
|
|
144
|
-
position: "relative",
|
|
145
|
-
height: M,
|
|
146
|
-
minHeight: "100%"
|
|
147
|
-
};
|
|
148
|
-
if (A.length === 0) return n("div", { style: {
|
|
149
|
-
...L,
|
|
150
|
-
display: "flex",
|
|
151
|
-
alignItems: "center",
|
|
152
|
-
justifyContent: "center"
|
|
153
|
-
} }, n("span", { style: {
|
|
154
|
-
color: x.textMuted,
|
|
155
|
-
fontSize: 14
|
|
156
|
-
} }, t(v)));
|
|
157
|
-
let z = [];
|
|
158
|
-
for (let e = F; e <= I; e++) {
|
|
159
|
-
let t = A[e];
|
|
160
|
-
t && z.push(n(h, {
|
|
161
|
-
key: t.id,
|
|
162
|
-
item: t,
|
|
163
|
-
isNew: D.has(t.id),
|
|
164
|
-
showTimestamps: g,
|
|
165
|
-
onItemClick: _,
|
|
166
|
-
renderItem: b,
|
|
167
|
-
theme: x,
|
|
168
|
-
style: {
|
|
169
|
-
position: "absolute",
|
|
170
|
-
top: e * c,
|
|
171
|
-
left: 0,
|
|
172
|
-
right: 0
|
|
173
|
-
}
|
|
174
|
-
}));
|
|
175
|
-
}
|
|
176
|
-
return n("div", {
|
|
177
|
-
ref: S,
|
|
178
|
-
style: L,
|
|
179
|
-
onScroll: P,
|
|
180
|
-
onMouseEnter: y ? () => E(!0) : void 0,
|
|
181
|
-
onMouseLeave: y ? () => E(!1) : void 0,
|
|
182
|
-
"aria-label": "Live feed",
|
|
183
|
-
role: "feed"
|
|
184
|
-
}, n("div", { style: R }, ...z));
|
|
185
|
-
}
|
|
186
|
-
//#endregion
|
|
187
|
-
//#region src/components/TkxLiveMetrics.tsx
|
|
188
|
-
var _ = !1;
|
|
189
|
-
function v() {
|
|
190
|
-
if (_ || typeof document > "u") return;
|
|
191
|
-
_ = !0;
|
|
192
|
-
let e = document.createElement("style");
|
|
193
|
-
e.id = "tkx-live-metrics-styles", e.textContent = "@keyframes tkx-metric-pulse {\n 0% { opacity: 1; }\n 40% { opacity: 0.4; }\n 100% { opacity: 1; }\n}\n@keyframes tkx-metric-shimmer {\n 0% { background-position: -200% 0; }\n 100% { background-position: 200% 0; }\n}\n.tkx-metric-shimmer {\n animation: tkx-metric-shimmer 0.6s ease-in-out;\n}\n@media (prefers-reduced-motion: reduce) {\n .tkx-metric-shimmer { animation: none; }\n .tkx-metric-pulse { animation: none; }\n}", document.head.appendChild(e);
|
|
194
|
-
}
|
|
195
|
-
function y(e, t) {
|
|
196
|
-
if (typeof e == "string") return e;
|
|
197
|
-
let n = e >= 1e6 ? `${(e / 1e6).toFixed(1)}M` : e >= 1e3 ? `${(e / 1e3).toFixed(1)}k` : String(Number.isInteger(e) ? e : e.toFixed(2));
|
|
198
|
-
return t ? `${n}${t}` : n;
|
|
199
|
-
}
|
|
200
|
-
function b(e, t) {
|
|
201
|
-
switch (e) {
|
|
202
|
-
case "warning": return t.warning;
|
|
203
|
-
case "critical": return t.danger;
|
|
204
|
-
default: return t.primary;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
function x() {
|
|
208
|
-
let [e, t] = s(() => typeof window < "u" ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : !1);
|
|
209
|
-
return i(() => {
|
|
210
|
-
if (typeof window > "u") return;
|
|
211
|
-
let e = window.matchMedia("(prefers-reduced-motion: reduce)"), n = (e) => t(e.matches);
|
|
212
|
-
return e.addEventListener("change", n), () => e.removeEventListener("change", n);
|
|
213
|
-
}, []), e;
|
|
214
|
-
}
|
|
215
|
-
function S(e, t, n) {
|
|
216
|
-
let [r, a] = s(e), c = o(e), l = o(null), u = o(null), d = x();
|
|
217
|
-
return i(() => {
|
|
218
|
-
if (!n || d) {
|
|
219
|
-
a(e), c.current = e;
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
let r = c.current;
|
|
223
|
-
if (r === e) return;
|
|
224
|
-
l.current = null;
|
|
225
|
-
let i = (n) => {
|
|
226
|
-
l.current === null && (l.current = n);
|
|
227
|
-
let o = n - l.current, s = Math.min(o / t, 1), d = 1 - (1 - s) ** 3;
|
|
228
|
-
a(r + (e - r) * d), s < 1 ? u.current = requestAnimationFrame(i) : c.current = e;
|
|
229
|
-
};
|
|
230
|
-
return u.current = requestAnimationFrame(i), () => {
|
|
231
|
-
u.current !== null && cancelAnimationFrame(u.current);
|
|
232
|
-
};
|
|
233
|
-
}, [
|
|
234
|
-
e,
|
|
235
|
-
t,
|
|
236
|
-
n,
|
|
237
|
-
d
|
|
238
|
-
]), r;
|
|
239
|
-
}
|
|
240
|
-
function C({ data: e, color: t }) {
|
|
241
|
-
if (e.length < 2) return null;
|
|
242
|
-
let r = Math.min(...e), i = Math.max(...e) - r || 1;
|
|
243
|
-
return n("svg", {
|
|
244
|
-
width: 80,
|
|
245
|
-
height: 24,
|
|
246
|
-
viewBox: "0 0 80 24",
|
|
247
|
-
"aria-hidden": "true"
|
|
248
|
-
}, n("polyline", {
|
|
249
|
-
points: e.map((t, n) => {
|
|
250
|
-
let a = n / (e.length - 1) * 80, o = 24 - (t - r) / i * 22 - 1;
|
|
251
|
-
return `${a.toFixed(1)},${o.toFixed(1)}`;
|
|
252
|
-
}).join(" "),
|
|
253
|
-
fill: "none",
|
|
254
|
-
stroke: t,
|
|
255
|
-
strokeWidth: 1.5,
|
|
256
|
-
strokeLinejoin: "round",
|
|
257
|
-
strokeLinecap: "round"
|
|
258
|
-
}));
|
|
259
|
-
}
|
|
260
|
-
function w({ trend: e, theme: t }) {
|
|
261
|
-
return e === "up" ? n("span", { style: {
|
|
262
|
-
color: t.success,
|
|
263
|
-
fontSize: 14,
|
|
264
|
-
fontWeight: 700
|
|
265
|
-
} }, "▲") : e === "down" ? n("span", { style: {
|
|
266
|
-
color: t.danger,
|
|
267
|
-
fontSize: 14,
|
|
268
|
-
fontWeight: 700
|
|
269
|
-
} }, "▼") : n("span", { style: {
|
|
270
|
-
color: t.textMuted,
|
|
271
|
-
fontSize: 14
|
|
272
|
-
} }, "→");
|
|
273
|
-
}
|
|
274
|
-
function T({ metric: e, animate: r, onMetricClick: a, theme: c }) {
|
|
275
|
-
let l = e.color ?? b(e.status, c), u = typeof e.value == "number" ? e.value : NaN, d = S(isNaN(u) ? 0 : u, 600, r && !isNaN(u)), [f, p] = s(!1), m = o(e.value);
|
|
276
|
-
i(() => {
|
|
277
|
-
if (m.current !== e.value) {
|
|
278
|
-
m.current = e.value, p(!0);
|
|
279
|
-
let t = window.setTimeout(() => p(!1), 700);
|
|
280
|
-
return () => clearTimeout(t);
|
|
281
|
-
}
|
|
282
|
-
}, [e.value]);
|
|
283
|
-
let h = e.previousValue !== void 0 && e.previousValue !== u, g = {
|
|
284
|
-
background: c.surface,
|
|
285
|
-
border: `1px solid ${c.border}`,
|
|
286
|
-
borderLeft: `4px solid ${l}`,
|
|
287
|
-
borderRadius: 8,
|
|
288
|
-
padding: "14px 16px",
|
|
289
|
-
cursor: a ? "pointer" : "default",
|
|
290
|
-
position: "relative",
|
|
291
|
-
overflow: "hidden",
|
|
292
|
-
boxSizing: "border-box"
|
|
293
|
-
}, _ = f ? {
|
|
294
|
-
position: "absolute",
|
|
295
|
-
inset: 0,
|
|
296
|
-
background: `linear-gradient(90deg, transparent 0%, ${l}22 50%, transparent 100%)`,
|
|
297
|
-
backgroundSize: "200% 100%",
|
|
298
|
-
animation: "tkx-metric-shimmer 0.6s ease-in-out",
|
|
299
|
-
pointerEvents: "none"
|
|
300
|
-
} : {}, v = isNaN(u) ? t(String(e.value)) : y(d, e.unit);
|
|
301
|
-
return n("div", {
|
|
302
|
-
style: g,
|
|
303
|
-
className: f ? "tkx-metric-shimmer" : void 0,
|
|
304
|
-
onClick: a ? () => a(e) : void 0,
|
|
305
|
-
role: a ? "button" : void 0,
|
|
306
|
-
tabIndex: a ? 0 : void 0
|
|
307
|
-
}, f && n("div", { style: _ }), n("div", { style: {
|
|
308
|
-
fontSize: 12,
|
|
309
|
-
color: c.textMuted,
|
|
310
|
-
marginBottom: 6,
|
|
311
|
-
fontWeight: 500,
|
|
312
|
-
letterSpacing: "0.03em"
|
|
313
|
-
} }, t(e.label)), n("div", { style: {
|
|
314
|
-
display: "flex",
|
|
315
|
-
alignItems: "flex-end",
|
|
316
|
-
gap: 6,
|
|
317
|
-
marginBottom: 6
|
|
318
|
-
} }, n("span", { style: {
|
|
319
|
-
fontSize: 28,
|
|
320
|
-
fontWeight: 700,
|
|
321
|
-
color: c.text,
|
|
322
|
-
lineHeight: 1
|
|
323
|
-
} }, v), e.unit && isNaN(u) && n("span", { style: {
|
|
324
|
-
fontSize: 14,
|
|
325
|
-
color: c.textMuted,
|
|
326
|
-
marginBottom: 2
|
|
327
|
-
} }, t(e.unit))), (e.trend || e.trendValue) && n("div", { style: {
|
|
328
|
-
display: "flex",
|
|
329
|
-
alignItems: "center",
|
|
330
|
-
gap: 4,
|
|
331
|
-
marginBottom: e.sparkline ? 8 : 0
|
|
332
|
-
} }, e.trend && n(w, {
|
|
333
|
-
trend: e.trend,
|
|
334
|
-
theme: c
|
|
335
|
-
}), e.trendValue && n("span", { style: {
|
|
336
|
-
fontSize: 12,
|
|
337
|
-
color: c.textMuted
|
|
338
|
-
} }, t(e.trendValue))), h && n("div", { style: {
|
|
339
|
-
fontSize: 11,
|
|
340
|
-
color: c.textMuted,
|
|
341
|
-
marginTop: 2
|
|
342
|
-
} }, `was ${y(e.previousValue)}`), e.sparkline && e.sparkline.length >= 2 && n("div", { style: { marginTop: 8 } }, n(C, {
|
|
343
|
-
data: e.sparkline,
|
|
344
|
-
color: l
|
|
345
|
-
})));
|
|
346
|
-
}
|
|
347
|
-
function E({ metrics: t, columns: r = 3, animate: i = !0, onMetricClick: a }) {
|
|
348
|
-
let o = e();
|
|
349
|
-
return v(), n("div", { style: {
|
|
350
|
-
display: "grid",
|
|
351
|
-
gridTemplateColumns: `repeat(${r}, minmax(0, 1fr))`,
|
|
352
|
-
gap: 16
|
|
353
|
-
} }, ...t.map((e) => n(T, {
|
|
354
|
-
key: e.id,
|
|
355
|
-
metric: e,
|
|
356
|
-
animate: i,
|
|
357
|
-
onMetricClick: a,
|
|
358
|
-
theme: o
|
|
359
|
-
})));
|
|
360
|
-
}
|
|
361
|
-
//#endregion
|
|
362
|
-
//#region src/components/TkxRealTimeChart.tsx
|
|
363
|
-
function D(e) {
|
|
364
|
-
let t = new Date(e);
|
|
365
|
-
return `${String(t.getHours()).padStart(2, "0")}:${String(t.getMinutes()).padStart(2, "0")}:${String(t.getSeconds()).padStart(2, "0")}`;
|
|
366
|
-
}
|
|
367
|
-
function O(e) {
|
|
368
|
-
return Math.abs(e) >= 1e6 ? `${(e / 1e6).toFixed(1)}M` : Math.abs(e) >= 1e3 ? `${(e / 1e3).toFixed(1)}k` : Number.isInteger(e) ? String(e) : e.toFixed(2);
|
|
369
|
-
}
|
|
370
|
-
function k({ data: c, maxPoints: l = 60, height: u = 200, width: d = "100%", color: f, fill: p = !0, showGrid: m = !0, showLabels: h = !0, showTooltip: g = !0, label: _, unit: v, animate: y = !0, yMin: b, yMax: x }) {
|
|
371
|
-
let S = e(), C = f ?? S.primary, w = o(null), [T, E] = s(600), [k, A] = s(null), [j, M] = s(0), N = o(c.length);
|
|
372
|
-
i(() => {
|
|
373
|
-
if (!w.current) return;
|
|
374
|
-
let e = new ResizeObserver((e) => {
|
|
375
|
-
let t = e[0];
|
|
376
|
-
t && E(t.contentRect.width);
|
|
377
|
-
});
|
|
378
|
-
return e.observe(w.current), E(w.current.offsetWidth), () => e.disconnect();
|
|
379
|
-
}, []);
|
|
380
|
-
let P = a(() => c.slice(-l), [c, l]);
|
|
381
|
-
i(() => {
|
|
382
|
-
P.length > N.current && M((e) => e + 1), N.current = P.length;
|
|
383
|
-
}, [P.length]);
|
|
384
|
-
let F = h ? 48 : 12, I = _ ? 28 : 12, L = Math.max(T - F - 12, 1), R = Math.max(u - I - 28, 1), z = P.length ? Math.min(...P.map((e) => e.value)) : 0, B = P.length ? Math.max(...P.map((e) => e.value)) : 1, V = B - z || 1, H = b === void 0 ? z - V * .1 : b, U = (x === void 0 ? B + V * .1 : x) - H || 1;
|
|
385
|
-
function W(e) {
|
|
386
|
-
return P.length < 2 ? L / 2 : e / (P.length - 1) * L;
|
|
387
|
-
}
|
|
388
|
-
function G(e) {
|
|
389
|
-
return R - (e - H) / U * R;
|
|
390
|
-
}
|
|
391
|
-
let K = P.length >= 2 ? P.map((e, t) => `${t === 0 ? "M" : "L"}${W(t).toFixed(2)},${G(e.value).toFixed(2)}`).join(" ") : "", q = K ? `${K} L${W(P.length - 1).toFixed(2)},${R} L${W(0).toFixed(2)},${R} Z` : "", J = [];
|
|
392
|
-
for (let e = 0; e <= 4; e++) J.push(e);
|
|
393
|
-
let Y = J.map((e) => {
|
|
394
|
-
let t = H + e / 4 * U;
|
|
395
|
-
return {
|
|
396
|
-
y: G(t),
|
|
397
|
-
text: O(t)
|
|
398
|
-
};
|
|
399
|
-
}), X = Math.min(4, P.length), ee = X > 0 ? Array.from({ length: X }, (e, t) => Math.round(t / Math.max(X - 1, 1) * (P.length - 1))) : [], te = r((e) => {
|
|
400
|
-
if (!g || P.length === 0) return;
|
|
401
|
-
let t = e.currentTarget.getBoundingClientRect(), n = e.clientX - t.left - F, r = 0, i = Infinity;
|
|
402
|
-
P.forEach((e, t) => {
|
|
403
|
-
let a = Math.abs(W(t) - n);
|
|
404
|
-
a < i && (i = a, r = t);
|
|
405
|
-
});
|
|
406
|
-
let a = P[r];
|
|
407
|
-
a && A({
|
|
408
|
-
x: W(r) + F,
|
|
409
|
-
y: G(a.value) + I,
|
|
410
|
-
point: a
|
|
411
|
-
});
|
|
412
|
-
}, [
|
|
413
|
-
P,
|
|
414
|
-
g,
|
|
415
|
-
F,
|
|
416
|
-
I
|
|
417
|
-
]), ne = r(() => A(null), []), Z = T, Q = u, $ = `tkx-chart-clip-${j}`;
|
|
418
|
-
return n("div", {
|
|
419
|
-
ref: w,
|
|
420
|
-
style: {
|
|
421
|
-
position: "relative",
|
|
422
|
-
width: typeof d == "number" ? `${d}px` : d,
|
|
423
|
-
background: S.surface,
|
|
424
|
-
border: `1px solid ${S.border}`,
|
|
425
|
-
borderRadius: 8,
|
|
426
|
-
overflow: "hidden",
|
|
427
|
-
boxSizing: "border-box"
|
|
428
|
-
}
|
|
429
|
-
}, n("svg", {
|
|
430
|
-
width: Z,
|
|
431
|
-
height: Q,
|
|
432
|
-
viewBox: `0 0 ${Z} ${Q}`,
|
|
433
|
-
onMouseMove: te,
|
|
434
|
-
onMouseLeave: ne,
|
|
435
|
-
style: {
|
|
436
|
-
display: "block",
|
|
437
|
-
userSelect: "none"
|
|
438
|
-
},
|
|
439
|
-
"aria-label": _ ? t(_) : "Real-time chart"
|
|
440
|
-
}, y && P.length >= 2 && n("defs", null, n("clipPath", { id: $ }, n("rect", {
|
|
441
|
-
x: 0,
|
|
442
|
-
y: 0,
|
|
443
|
-
width: L,
|
|
444
|
-
height: Q
|
|
445
|
-
}, n("animate", {
|
|
446
|
-
attributeName: "width",
|
|
447
|
-
from: Math.max(0, L - L / Math.max(P.length - 1, 1)),
|
|
448
|
-
to: L,
|
|
449
|
-
dur: "0.3s",
|
|
450
|
-
fill: "freeze"
|
|
451
|
-
})))), _ && n("text", {
|
|
452
|
-
x: F,
|
|
453
|
-
y: 18,
|
|
454
|
-
fill: S.textMuted,
|
|
455
|
-
fontSize: 12,
|
|
456
|
-
fontWeight: 500
|
|
457
|
-
}, t(_)), m && J.map((e) => {
|
|
458
|
-
let t = G(H + e / 4 * U) + I;
|
|
459
|
-
return n("line", {
|
|
460
|
-
key: `grid-${e}`,
|
|
461
|
-
x1: F,
|
|
462
|
-
y1: t,
|
|
463
|
-
x2: F + L,
|
|
464
|
-
y2: t,
|
|
465
|
-
stroke: S.border,
|
|
466
|
-
strokeWidth: 1,
|
|
467
|
-
strokeDasharray: "4 4"
|
|
468
|
-
});
|
|
469
|
-
}), h && Y.map((e, t) => n("text", {
|
|
470
|
-
key: `yl-${t}`,
|
|
471
|
-
x: F - 4,
|
|
472
|
-
y: e.y + I + 4,
|
|
473
|
-
fill: S.textMuted,
|
|
474
|
-
fontSize: 10,
|
|
475
|
-
textAnchor: "end"
|
|
476
|
-
}, e.text)), v && n("text", {
|
|
477
|
-
x: 4,
|
|
478
|
-
y: I + 10,
|
|
479
|
-
fill: S.textMuted,
|
|
480
|
-
fontSize: 9
|
|
481
|
-
}, t(v)), p && q && n("path", {
|
|
482
|
-
d: q,
|
|
483
|
-
fill: `${C}22`,
|
|
484
|
-
clipPath: y ? `url(#${$})` : void 0,
|
|
485
|
-
transform: `translate(${F}, ${I})`
|
|
486
|
-
}), K && n("path", {
|
|
487
|
-
d: K,
|
|
488
|
-
fill: "none",
|
|
489
|
-
stroke: C,
|
|
490
|
-
strokeWidth: 2,
|
|
491
|
-
strokeLinejoin: "round",
|
|
492
|
-
strokeLinecap: "round",
|
|
493
|
-
clipPath: y ? `url(#${$})` : void 0,
|
|
494
|
-
transform: `translate(${F}, ${I})`
|
|
495
|
-
}), ee.map((e) => {
|
|
496
|
-
let t = P[e];
|
|
497
|
-
return t ? n("text", {
|
|
498
|
-
key: `xl-${e}`,
|
|
499
|
-
x: F + W(e),
|
|
500
|
-
y: Q - 8,
|
|
501
|
-
fill: S.textMuted,
|
|
502
|
-
fontSize: 9,
|
|
503
|
-
textAnchor: "middle"
|
|
504
|
-
}, D(t.timestamp)) : null;
|
|
505
|
-
}), k && n("line", {
|
|
506
|
-
x1: k.x,
|
|
507
|
-
y1: I,
|
|
508
|
-
x2: k.x,
|
|
509
|
-
y2: I + R,
|
|
510
|
-
stroke: C,
|
|
511
|
-
strokeWidth: 1,
|
|
512
|
-
strokeDasharray: "3 3",
|
|
513
|
-
opacity: .6
|
|
514
|
-
}), k && n("circle", {
|
|
515
|
-
cx: k.x,
|
|
516
|
-
cy: k.y,
|
|
517
|
-
r: 4,
|
|
518
|
-
fill: C,
|
|
519
|
-
stroke: S.surface,
|
|
520
|
-
strokeWidth: 2
|
|
521
|
-
}), k && (() => {
|
|
522
|
-
let e = Math.min(k.x + 8, Z - 100), t = Math.max(k.y - 36, 4), r = `${O(k.point.value)}${v || ""}`, i = D(k.point.timestamp);
|
|
523
|
-
return n("g", null, n("rect", {
|
|
524
|
-
x: e - 4,
|
|
525
|
-
y: t - 2,
|
|
526
|
-
width: 90,
|
|
527
|
-
height: 34,
|
|
528
|
-
rx: 4,
|
|
529
|
-
fill: S.surfaceAlt,
|
|
530
|
-
stroke: S.border,
|
|
531
|
-
strokeWidth: 1
|
|
532
|
-
}), n("text", {
|
|
533
|
-
x: e,
|
|
534
|
-
y: t + 11,
|
|
535
|
-
fill: S.text,
|
|
536
|
-
fontSize: 12,
|
|
537
|
-
fontWeight: 700
|
|
538
|
-
}, r), n("text", {
|
|
539
|
-
x: e,
|
|
540
|
-
y: t + 26,
|
|
541
|
-
fill: S.textMuted,
|
|
542
|
-
fontSize: 10
|
|
543
|
-
}, i));
|
|
544
|
-
})()));
|
|
545
|
-
}
|
|
546
|
-
//#endregion
|
|
547
|
-
//#region src/components/TkxLiveLog.tsx
|
|
548
|
-
var A = 28, j = 8, M = {
|
|
549
|
-
debug: 0,
|
|
550
|
-
info: 1,
|
|
551
|
-
warn: 2,
|
|
552
|
-
error: 3,
|
|
553
|
-
fatal: 4
|
|
554
|
-
}, N = !1;
|
|
555
|
-
function P() {
|
|
556
|
-
if (N || typeof document > "u") return;
|
|
557
|
-
N = !0;
|
|
558
|
-
let e = document.createElement("style");
|
|
559
|
-
e.id = "tkx-live-log-styles", e.textContent = ".tkx-log-row:hover { filter: brightness(1.12); }\n.tkx-log-highlight { background: #ffbe0b55; border-radius: 2px; padding: 0 1px; }", document.head.appendChild(e);
|
|
560
|
-
}
|
|
561
|
-
function F(e) {
|
|
562
|
-
let t = new Date(e);
|
|
563
|
-
return `${String(t.getHours()).padStart(2, "0")}:${String(t.getMinutes()).padStart(2, "0")}:${String(t.getSeconds()).padStart(2, "0")}.${String(t.getMilliseconds()).padStart(3, "0")}`;
|
|
564
|
-
}
|
|
565
|
-
function I(e, t) {
|
|
566
|
-
switch (e) {
|
|
567
|
-
case "debug": return t.textMuted;
|
|
568
|
-
case "info": return t.info;
|
|
569
|
-
case "warn": return t.warning;
|
|
570
|
-
case "error": return t.danger;
|
|
571
|
-
case "fatal": return t.danger;
|
|
572
|
-
default: return t.textMuted;
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
function L(e, t) {
|
|
576
|
-
return e === "fatal" ? `${t.danger}22` : "transparent";
|
|
577
|
-
}
|
|
578
|
-
function R(e) {
|
|
579
|
-
return `[${e.toUpperCase().padEnd(5)}]`;
|
|
580
|
-
}
|
|
581
|
-
function z(e, r) {
|
|
582
|
-
if (!r) return [e];
|
|
583
|
-
let i = t(e), a = t(r);
|
|
584
|
-
if (!a) return [i];
|
|
585
|
-
try {
|
|
586
|
-
let e = RegExp(`(${a.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")})`, "gi");
|
|
587
|
-
return i.split(e).map((t, r) => e.test(t) ? n("mark", {
|
|
588
|
-
key: r,
|
|
589
|
-
className: "tkx-log-highlight"
|
|
590
|
-
}, t) : t);
|
|
591
|
-
} catch {
|
|
592
|
-
return [i];
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
function B({ entry: e, showLevel: r, showTimestamp: i, showSource: a, searchQuery: o, monospace: s, isExpanded: c, onToggle: l, onEntryClick: u, theme: d, style: f }) {
|
|
596
|
-
let p = I(e.level, d), m = L(e.level, d), h = e.metadata && Object.keys(e.metadata).length > 0;
|
|
597
|
-
return n("div", {
|
|
598
|
-
style: {
|
|
599
|
-
...f,
|
|
600
|
-
display: "flex",
|
|
601
|
-
alignItems: "center",
|
|
602
|
-
gap: 6,
|
|
603
|
-
padding: "0 10px",
|
|
604
|
-
fontSize: 12,
|
|
605
|
-
fontFamily: s ? "\"JetBrains Mono\", \"Fira Mono\", Consolas, monospace" : "inherit",
|
|
606
|
-
cursor: h || u ? "pointer" : "default",
|
|
607
|
-
background: m,
|
|
608
|
-
boxSizing: "border-box",
|
|
609
|
-
height: A,
|
|
610
|
-
overflow: "hidden",
|
|
611
|
-
whiteSpace: "nowrap",
|
|
612
|
-
borderBottom: `1px solid ${d.border}22`
|
|
613
|
-
},
|
|
614
|
-
className: "tkx-log-row",
|
|
615
|
-
onClick: () => {
|
|
616
|
-
h && l(), u && u(e);
|
|
617
|
-
},
|
|
618
|
-
role: h ? "button" : void 0,
|
|
619
|
-
tabIndex: h ? 0 : void 0,
|
|
620
|
-
onKeyDown: h ? (e) => {
|
|
621
|
-
(e.key === "Enter" || e.key === " ") && l();
|
|
622
|
-
} : void 0,
|
|
623
|
-
"aria-expanded": h ? c : void 0
|
|
624
|
-
}, i && n("span", { style: {
|
|
625
|
-
color: d.textMuted,
|
|
626
|
-
flexShrink: 0,
|
|
627
|
-
minWidth: 84
|
|
628
|
-
} }, F(e.timestamp)), r && n("span", { style: {
|
|
629
|
-
color: p,
|
|
630
|
-
flexShrink: 0,
|
|
631
|
-
fontWeight: e.level === "fatal" ? 700 : 500,
|
|
632
|
-
minWidth: 56
|
|
633
|
-
} }, R(e.level)), a && e.source && n("span", { style: {
|
|
634
|
-
background: d.surfaceAlt,
|
|
635
|
-
border: `1px solid ${d.border}`,
|
|
636
|
-
borderRadius: 10,
|
|
637
|
-
padding: "0 5px",
|
|
638
|
-
fontSize: 10,
|
|
639
|
-
color: d.textMuted,
|
|
640
|
-
flexShrink: 0,
|
|
641
|
-
maxWidth: 80,
|
|
642
|
-
overflow: "hidden",
|
|
643
|
-
textOverflow: "ellipsis"
|
|
644
|
-
} }, t(e.source)), n("span", { style: {
|
|
645
|
-
flex: 1,
|
|
646
|
-
color: d.text,
|
|
647
|
-
overflow: "hidden",
|
|
648
|
-
textOverflow: "ellipsis"
|
|
649
|
-
} }, ...z(e.message, o)), h && n("span", { style: {
|
|
650
|
-
color: d.textMuted,
|
|
651
|
-
fontSize: 10,
|
|
652
|
-
flexShrink: 0
|
|
653
|
-
} }, c ? "▲" : "▼"));
|
|
654
|
-
}
|
|
655
|
-
function V({ metadata: e, theme: r, style: i }) {
|
|
656
|
-
return n("div", { style: {
|
|
657
|
-
...i,
|
|
658
|
-
background: r.surfaceAlt,
|
|
659
|
-
borderBottom: `1px solid ${r.border}`,
|
|
660
|
-
padding: "6px 10px 6px 56px",
|
|
661
|
-
display: "flex",
|
|
662
|
-
flexWrap: "wrap",
|
|
663
|
-
gap: 6,
|
|
664
|
-
boxSizing: "border-box"
|
|
665
|
-
} }, ...Object.entries(e).map(([e, i]) => n("span", {
|
|
666
|
-
key: e,
|
|
667
|
-
style: {
|
|
668
|
-
fontSize: 11,
|
|
669
|
-
fontFamily: "monospace",
|
|
670
|
-
color: r.textMuted,
|
|
671
|
-
background: r.surface,
|
|
672
|
-
border: `1px solid ${r.border}`,
|
|
673
|
-
borderRadius: 4,
|
|
674
|
-
padding: "1px 6px"
|
|
675
|
-
}
|
|
676
|
-
}, n("span", { style: { color: r.info } }, `${t(e)}: `), t(String(i)))));
|
|
677
|
-
}
|
|
678
|
-
function H({ entries: t, maxEntries: c = 500, height: l = 400, autoScroll: u = !0, showLevel: d = !0, showTimestamp: f = !0, showSource: p = !0, filterLevel: m, searchQuery: h = "", monospace: g = !0, onEntryClick: _ }) {
|
|
679
|
-
let v = e();
|
|
680
|
-
P();
|
|
681
|
-
let y = o(null), [b, x] = s(0), [S, C] = s(/* @__PURE__ */ new Set()), [w, T] = s(!1), E = o(t.length), D = a(() => {
|
|
682
|
-
let e = t.slice(-c);
|
|
683
|
-
if (m !== void 0) {
|
|
684
|
-
let t = M[m];
|
|
685
|
-
e = e.filter((e) => M[e.level] >= t);
|
|
686
|
-
}
|
|
687
|
-
if (h) {
|
|
688
|
-
let t = h.toLowerCase();
|
|
689
|
-
e = e.filter((e) => e.message.toLowerCase().includes(t) || (e.source ?? "").toLowerCase().includes(t));
|
|
690
|
-
}
|
|
691
|
-
return e;
|
|
692
|
-
}, [
|
|
693
|
-
t,
|
|
694
|
-
c,
|
|
695
|
-
m,
|
|
696
|
-
h
|
|
697
|
-
]), O = typeof l == "number" ? l : 400, k = a(() => {
|
|
698
|
-
let e = [], t = 0;
|
|
699
|
-
for (let n of D) e.push(t), t += A + (S.has(n.id) ? 40 : 0);
|
|
700
|
-
return e.push(t), e;
|
|
701
|
-
}, [D, S]), N = k[k.length - 1] ?? 0;
|
|
702
|
-
i(() => {
|
|
703
|
-
!u || w || D.length !== E.current && (E.current = D.length, y.current && (y.current.scrollTop = y.current.scrollHeight));
|
|
704
|
-
}, [
|
|
705
|
-
D.length,
|
|
706
|
-
u,
|
|
707
|
-
w
|
|
708
|
-
]);
|
|
709
|
-
let F = r(() => {
|
|
710
|
-
if (!y.current) return;
|
|
711
|
-
let e = y.current;
|
|
712
|
-
T(!(e.scrollHeight - e.scrollTop - e.clientHeight < A * 2)), x(e.scrollTop);
|
|
713
|
-
}, []), I = r((e) => {
|
|
714
|
-
C((t) => {
|
|
715
|
-
let n = new Set(t);
|
|
716
|
-
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
717
|
-
});
|
|
718
|
-
}, []);
|
|
719
|
-
function L(e) {
|
|
720
|
-
let t = 0, n = D.length - 1;
|
|
721
|
-
for (; t < n;) {
|
|
722
|
-
let r = t + n >> 1;
|
|
723
|
-
(k[r + 1] ?? 0) <= e ? t = r + 1 : n = r;
|
|
724
|
-
}
|
|
725
|
-
return Math.max(0, t - j);
|
|
726
|
-
}
|
|
727
|
-
function R(e) {
|
|
728
|
-
let t = 0, n = D.length - 1;
|
|
729
|
-
for (; t < n;) {
|
|
730
|
-
let r = t + n + 1 >> 1;
|
|
731
|
-
(k[r] ?? 0) >= e + O ? n = r - 1 : t = r;
|
|
732
|
-
}
|
|
733
|
-
return Math.min(D.length - 1, t + j);
|
|
734
|
-
}
|
|
735
|
-
let z = D.length > 0 ? L(b) : 0, H = D.length > 0 ? R(b) : -1, U = {
|
|
736
|
-
position: "relative",
|
|
737
|
-
overflow: "auto",
|
|
738
|
-
height: typeof l == "number" ? `${l}px` : l,
|
|
739
|
-
background: v.bg,
|
|
740
|
-
border: `1px solid ${v.border}`,
|
|
741
|
-
borderRadius: 8,
|
|
742
|
-
boxSizing: "border-box"
|
|
743
|
-
}, W = {
|
|
744
|
-
position: "relative",
|
|
745
|
-
height: N,
|
|
746
|
-
minHeight: "100%"
|
|
747
|
-
};
|
|
748
|
-
if (D.length === 0) return n("div", { style: {
|
|
749
|
-
...U,
|
|
750
|
-
display: "flex",
|
|
751
|
-
alignItems: "center",
|
|
752
|
-
justifyContent: "center"
|
|
753
|
-
} }, n("span", { style: {
|
|
754
|
-
color: v.textMuted,
|
|
755
|
-
fontSize: 13,
|
|
756
|
-
fontFamily: "monospace"
|
|
757
|
-
} }, "No log entries."));
|
|
758
|
-
let G = [];
|
|
759
|
-
for (let e = z; e <= H; e++) {
|
|
760
|
-
let t = D[e];
|
|
761
|
-
if (!t) continue;
|
|
762
|
-
let r = k[e] ?? 0, i = S.has(t.id);
|
|
763
|
-
G.push(n(B, {
|
|
764
|
-
key: t.id,
|
|
765
|
-
entry: t,
|
|
766
|
-
showLevel: d,
|
|
767
|
-
showTimestamp: f,
|
|
768
|
-
showSource: p,
|
|
769
|
-
searchQuery: h,
|
|
770
|
-
monospace: g,
|
|
771
|
-
isExpanded: i,
|
|
772
|
-
onToggle: () => I(t.id),
|
|
773
|
-
onEntryClick: _,
|
|
774
|
-
theme: v,
|
|
775
|
-
style: {
|
|
776
|
-
position: "absolute",
|
|
777
|
-
top: r,
|
|
778
|
-
left: 0,
|
|
779
|
-
right: 0
|
|
780
|
-
}
|
|
781
|
-
})), i && t.metadata && Object.keys(t.metadata).length > 0 && G.push(n(V, {
|
|
782
|
-
key: `${t.id}-meta`,
|
|
783
|
-
metadata: t.metadata,
|
|
784
|
-
theme: v,
|
|
785
|
-
style: {
|
|
786
|
-
position: "absolute",
|
|
787
|
-
top: r + A,
|
|
788
|
-
left: 0,
|
|
789
|
-
right: 0,
|
|
790
|
-
height: 40
|
|
791
|
-
}
|
|
792
|
-
}));
|
|
793
|
-
}
|
|
794
|
-
return n("div", {
|
|
795
|
-
ref: y,
|
|
796
|
-
style: U,
|
|
797
|
-
onScroll: F,
|
|
798
|
-
role: "log",
|
|
799
|
-
"aria-live": "polite",
|
|
800
|
-
"aria-label": "Log viewer"
|
|
801
|
-
}, n("div", { style: W }, ...G));
|
|
802
|
-
}
|
|
803
|
-
//#endregion
|
|
804
|
-
export { g as TkxLiveFeed, H as TkxLiveLog, E as TkxLiveMetrics, k as TkxRealTimeChart };
|
|
1
|
+
import{f as e}from"./chunk-PJ50l0JC.js";import{E as t}from"./chunk-DnCXUUx5.js";import{createElement as n,useCallback as o,useEffect as i,useMemo as r,useRef as s,useState as a}from"react";var l=!1;function c({item:e,isNew:o,showTimestamps:i,onItemClick:r,renderItem:s,theme:a,style:l}){const c=function(e,t){switch(e){case"info":return t.info;case"success":return t.success;case"warning":return t.warning;case"error":return t.danger;default:return t.border}}(e.type,a);return s?n("div",{style:l,className:o?"tkx-feed-item-new":void 0},s(e)):n("div",{style:{...l,display:"flex",alignItems:"center",gap:10,padding:"0 12px",borderLeft:`3px solid ${c}`,cursor:r?"pointer":"default",boxSizing:"border-box",height:64,background:a.surface,transition:"background 0.15s"},className:o?"tkx-feed-item-new":void 0,onClick:r?()=>r(e):void 0,role:r?"button":void 0,tabIndex:r?0:void 0,onKeyDown:r?t=>{"Enter"!==t.key&&" "!==t.key||r(e)}:void 0},n("div",{style:{width:36,height:36,borderRadius:"50%",background:c,display:"flex",alignItems:"center",justifyContent:"center",fontSize:13,fontWeight:700,color:a.bg,flexShrink:0,overflow:"hidden"}},e.avatar?n("img",{src:e.avatar,alt:e.author??"",style:{width:"100%",height:"100%",objectFit:"cover"}}):(d=e.author)?d.split(" ").map(e=>e[0]??"").slice(0,2).join("").toUpperCase():"?"),n("div",{style:{flex:1,minWidth:0}},n("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:2}},e.author&&n("span",{style:{fontWeight:600,fontSize:13,color:a.text}},t(e.author)),e.meta&&n("span",{style:{fontSize:11,color:a.textMuted,background:a.surfaceAlt,borderRadius:4,padding:"1px 5px"}},t(e.meta))),n("div",{style:{fontSize:13,color:a.text,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t(e.content))),i&&n("div",{style:{fontSize:11,color:a.textMuted,flexShrink:0}},function(e){const t=Date.now()-e;return t<1e4?"just now":t<6e4?`${Math.floor(t/1e3)}s ago`:t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${Math.floor(t/864e5)}d ago`}(e.timestamp)));var d}function d({items:d,maxItems:u=100,height:f=400,autoScroll:h=!0,showTimestamps:m=!0,onItemClick:p,emptyMessage:g="No activity yet.",pauseOnHover:y=!0,renderItem:x}){const b=e();!function(){if(l||"undefined"==typeof document)return;l=!0;const e=document.createElement("style");e.id="tkx-live-feed-styles",e.textContent="\n@keyframes tkx-feed-slide-in {\n from { transform: translateY(-20px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n}\n.tkx-feed-item-new {\n animation: tkx-feed-slide-in 0.25s ease-out both;\n}\n ".trim(),document.head.appendChild(e)}();const k=s(null),[v,w]=a(0),[S,$]=a(!1),[M,z]=a(/* @__PURE__ */new Set),N=s([]),W=r(()=>d.slice(-u),[d,u]),I="number"==typeof f?f:400,L=64*W.length;i(()=>{const e=new Set(N.current.map(e=>e.id)),t=W.filter(t=>!e.has(t.id)).map(e=>e.id);if(t.length>0){z(e=>{const n=new Set(e);return t.forEach(e=>n.add(e)),n});const e=window.setTimeout(()=>{z(e=>{const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},400);return()=>clearTimeout(e)}},[W]),i(()=>{N.current=W},[W]);const C=h&&!(y&&S);i(()=>{if(!C||!k.current)return;const e=k.current;(e.scrollHeight-e.scrollTop-e.clientHeight<192||W.length<=5)&&(e.scrollTop=e.scrollHeight)},[W.length,C]);const T=o(()=>{k.current&&w(k.current.scrollTop)},[]),j=Math.max(0,Math.floor(v/64)-5),E=Math.min(W.length-1,Math.ceil((v+I)/64)+5),R={position:"relative",overflow:"auto",height:"number"==typeof f?`${f}px`:f,background:b.bg,border:`1px solid ${b.border}`,borderRadius:8,boxSizing:"border-box"},B={position:"relative",height:L,minHeight:"100%"};if(0===W.length)return n("div",{style:{...R,display:"flex",alignItems:"center",justifyContent:"center"}},n("span",{style:{color:b.textMuted,fontSize:14}},t(g)));const F=[];for(let e=j;e<=E;e++){const t=W[e];t&&F.push(n(c,{key:t.id,item:t,isNew:M.has(t.id),showTimestamps:m,onItemClick:p,renderItem:x,theme:b,style:{position:"absolute",top:64*e,left:0,right:0}}))}return n("div",{ref:k,style:R,onScroll:T,onMouseEnter:y?()=>$(!0):void 0,onMouseLeave:y?()=>$(!1):void 0,"aria-label":"Live feed",role:"feed"},n("div",{style:B},...F))}var u=!1;function f(e,t){if("string"==typeof e)return e;const n=e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Number.isInteger(e)?e:e.toFixed(2));return t?`${n}${t}`:n}function h({data:e,color:t}){if(e.length<2)return null;const o=Math.min(...e),i=Math.max(...e)-o||1,r=e.map((t,n)=>{const r=n/(e.length-1)*80,s=24-(t-o)/i*22-1;return`${r.toFixed(1)},${s.toFixed(1)}`});return n("svg",{width:80,height:24,viewBox:"0 0 80 24","aria-hidden":"true"},n("polyline",{points:r.join(" "),fill:"none",stroke:t,strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"}))}function m({trend:e,theme:t}){return"up"===e?n("span",{style:{color:t.success,fontSize:14,fontWeight:700}},"▲"):"down"===e?n("span",{style:{color:t.danger,fontSize:14,fontWeight:700}},"▼"):n("span",{style:{color:t.textMuted,fontSize:14}},"→")}function p({metric:e,animate:o,onMetricClick:r,theme:l}){const c=e.color??function(e,t){switch(e){case"warning":return t.warning;case"critical":return t.danger;default:return t.primary}}(e.status,l),d="number"==typeof e.value?e.value:NaN,u=function(e,t,n){const[o,r]=a(e),l=s(e),c=s(null),d=s(null),u=function(){const[e,t]=a(()=>"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches);return i(()=>{if("undefined"==typeof window)return;const e=window.matchMedia("(prefers-reduced-motion: reduce)"),n=e=>t(e.matches);return e.addEventListener("change",n),()=>e.removeEventListener("change",n)},[]),e}();return i(()=>{if(!n||u)return r(e),void(l.current=e);const t=l.current;if(t===e)return;c.current=null;const o=n=>{null===c.current&&(c.current=n);const i=n-c.current,s=Math.min(i/600,1),a=1-Math.pow(1-s,3);r(t+(e-t)*a),s<1?d.current=requestAnimationFrame(o):l.current=e};return d.current=requestAnimationFrame(o),()=>{null!==d.current&&cancelAnimationFrame(d.current)}},[e,600,n,u]),o}(isNaN(d)?0:d,0,o&&!isNaN(d)),[p,g]=a(!1),y=s(e.value);i(()=>{if(y.current!==e.value){y.current=e.value,g(!0);const t=window.setTimeout(()=>g(!1),700);return()=>clearTimeout(t)}},[e.value]);const x=void 0!==e.previousValue&&e.previousValue!==d,b={background:l.surface,border:`1px solid ${l.border}`,borderLeft:`4px solid ${c}`,borderRadius:8,padding:"14px 16px",cursor:r?"pointer":"default",position:"relative",overflow:"hidden",boxSizing:"border-box"},k=p?{position:"absolute",inset:0,background:`linear-gradient(90deg, transparent 0%, ${c}22 50%, transparent 100%)`,backgroundSize:"200% 100%",animation:"tkx-metric-shimmer 0.6s ease-in-out",pointerEvents:"none"}:{},v=isNaN(d)?t(String(e.value)):f(u,e.unit);return n("div",{style:b,className:p?"tkx-metric-shimmer":void 0,onClick:r?()=>r(e):void 0,role:r?"button":void 0,tabIndex:r?0:void 0},p&&n("div",{style:k}),n("div",{style:{fontSize:12,color:l.textMuted,marginBottom:6,fontWeight:500,letterSpacing:"0.03em"}},t(e.label)),n("div",{style:{display:"flex",alignItems:"flex-end",gap:6,marginBottom:6}},n("span",{style:{fontSize:28,fontWeight:700,color:l.text,lineHeight:1}},v),e.unit&&isNaN(d)&&n("span",{style:{fontSize:14,color:l.textMuted,marginBottom:2}},t(e.unit))),(e.trend||e.trendValue)&&n("div",{style:{display:"flex",alignItems:"center",gap:4,marginBottom:e.sparkline?8:0}},e.trend&&n(m,{trend:e.trend,theme:l}),e.trendValue&&n("span",{style:{fontSize:12,color:l.textMuted}},t(e.trendValue))),x&&n("div",{style:{fontSize:11,color:l.textMuted,marginTop:2}},`was ${f(e.previousValue)}`),e.sparkline&&e.sparkline.length>=2&&n("div",{style:{marginTop:8}},n(h,{data:e.sparkline,color:c})))}function g({metrics:t,columns:o=3,animate:i=!0,onMetricClick:r}){const s=e();return function(){if(u||"undefined"==typeof document)return;u=!0;const e=document.createElement("style");e.id="tkx-live-metrics-styles",e.textContent="\n@keyframes tkx-metric-pulse {\n 0% { opacity: 1; }\n 40% { opacity: 0.4; }\n 100% { opacity: 1; }\n}\n@keyframes tkx-metric-shimmer {\n 0% { background-position: -200% 0; }\n 100% { background-position: 200% 0; }\n}\n.tkx-metric-shimmer {\n animation: tkx-metric-shimmer 0.6s ease-in-out;\n}\n@media (prefers-reduced-motion: reduce) {\n .tkx-metric-shimmer { animation: none; }\n .tkx-metric-pulse { animation: none; }\n}\n ".trim(),document.head.appendChild(e)}(),n("div",{style:{display:"grid",gridTemplateColumns:`repeat(${o}, minmax(0, 1fr))`,gap:16}},...t.map(e=>n(p,{key:e.id,metric:e,animate:i,onMetricClick:r,theme:s})))}function y(e){const t=new Date(e);return`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}:${String(t.getSeconds()).padStart(2,"0")}`}function x(e){return Math.abs(e)>=1e6?`${(e/1e6).toFixed(1)}M`:Math.abs(e)>=1e3?`${(e/1e3).toFixed(1)}k`:Number.isInteger(e)?String(e):e.toFixed(2)}function b({data:l,maxPoints:c=60,height:d=200,width:u="100%",color:f,fill:h=!0,showGrid:m=!0,showLabels:p=!0,showTooltip:g=!0,label:b,unit:k,animate:v=!0,yMin:w,yMax:S}){const $=e(),M=f??$.primary,z=s(null),[N,W]=a(600),[I,L]=a(null),[C,T]=a(0),j=s(l.length);i(()=>{if(!z.current)return;const e=new ResizeObserver(e=>{const t=e[0];t&&W(t.contentRect.width)});return e.observe(z.current),W(z.current.offsetWidth),()=>e.disconnect()},[]);const E=r(()=>l.slice(-c),[l,c]);i(()=>{E.length>j.current&&T(e=>e+1),j.current=E.length},[E.length]);const R=p?48:12,B=b?28:12,F=Math.max(N-R-12,1),O=Math.max(d-B-28,1),D=E.length?Math.min(...E.map(e=>e.value)):0,A=E.length?Math.max(...E.map(e=>e.value)):1,H=A-D||1,P=void 0!==w?w:D-.1*H,Q=(void 0!==S?S:A+.1*H)-P||1;function q(e){return E.length<2?F/2:e/(E.length-1)*F}function K(e){return O-(e-P)/Q*O}const Y=E.length>=2?E.map((e,t)=>`${0===t?"M":"L"}${q(t).toFixed(2)},${K(e.value).toFixed(2)}`).join(" "):"",G=Y?`${Y} L${q(E.length-1).toFixed(2)},${O} L${q(0).toFixed(2)},${O} Z`:"",J=[];for(let e=0;e<=4;e++)J.push(e);const Z=J.map(e=>{const t=P+e/4*Q;return{y:K(t),text:x(t)}}),U=Math.min(4,E.length),V=U>0?Array.from({length:U},(e,t)=>Math.round(t/Math.max(U-1,1)*(E.length-1))):[],X=o(e=>{if(!g||0===E.length)return;const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left-R;let o=0,i=1/0;E.forEach((e,t)=>{const r=Math.abs(q(t)-n);r<i&&(i=r,o=t)});const r=E[o];r&&L({x:q(o)+R,y:K(r.value)+B,point:r})},[E,g,R,B]),_=o(()=>L(null),[]),ee=N,te=d,ne=`tkx-chart-clip-${C}`;return n("div",{ref:z,style:{position:"relative",width:"number"==typeof u?`${u}px`:u,background:$.surface,border:`1px solid ${$.border}`,borderRadius:8,overflow:"hidden",boxSizing:"border-box"}},n("svg",{width:ee,height:te,viewBox:`0 0 ${ee} ${te}`,onMouseMove:X,onMouseLeave:_,style:{display:"block",userSelect:"none"},"aria-label":b?t(b):"Real-time chart"},v&&E.length>=2&&n("defs",null,n("clipPath",{id:ne},n("rect",{x:0,y:0,width:F,height:te},n("animate",{attributeName:"width",from:Math.max(0,F-F/Math.max(E.length-1,1)),to:F,dur:"0.3s",fill:"freeze"})))),b&&n("text",{x:R,y:18,fill:$.textMuted,fontSize:12,fontWeight:500},t(b)),m&&J.map(e=>{const t=K(P+e/4*Q)+B;return n("line",{key:`grid-${e}`,x1:R,y1:t,x2:R+F,y2:t,stroke:$.border,strokeWidth:1,strokeDasharray:"4 4"})}),p&&Z.map((e,t)=>n("text",{key:`yl-${t}`,x:R-4,y:e.y+B+4,fill:$.textMuted,fontSize:10,textAnchor:"end"},e.text)),k&&n("text",{x:4,y:B+10,fill:$.textMuted,fontSize:9},t(k)),h&&G&&n("path",{d:G,fill:`${M}22`,clipPath:v?`url(#${ne})`:void 0,transform:`translate(${R}, ${B})`}),Y&&n("path",{d:Y,fill:"none",stroke:M,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",clipPath:v?`url(#${ne})`:void 0,transform:`translate(${R}, ${B})`}),V.map(e=>{const t=E[e];return t?n("text",{key:`xl-${e}`,x:R+q(e),y:te-8,fill:$.textMuted,fontSize:9,textAnchor:"middle"},y(t.timestamp)):null}),I&&n("line",{x1:I.x,y1:B,x2:I.x,y2:B+O,stroke:M,strokeWidth:1,strokeDasharray:"3 3",opacity:.6}),I&&n("circle",{cx:I.x,cy:I.y,r:4,fill:M,stroke:$.surface,strokeWidth:2}),I&&(()=>{const e=Math.min(I.x+8,ee-100),t=Math.max(I.y-36,4),o=`${x(I.point.value)}${k||""}`,i=y(I.point.timestamp);return n("g",null,n("rect",{x:e-4,y:t-2,width:90,height:34,rx:4,fill:$.surfaceAlt,stroke:$.border,strokeWidth:1}),n("text",{x:e,y:t+11,fill:$.text,fontSize:12,fontWeight:700},o),n("text",{x:e,y:t+26,fill:$.textMuted,fontSize:10},i))})()))}var k={debug:0,info:1,warn:2,error:3,fatal:4},v=!1;function w({entry:e,showLevel:o,showTimestamp:i,showSource:r,searchQuery:s,monospace:a,isExpanded:l,onToggle:c,onEntryClick:d,theme:u,style:f}){const h=function(e,t){switch(e){case"debug":default:return t.textMuted;case"info":return t.info;case"warn":return t.warning;case"error":case"fatal":return t.danger}}(e.level,u),m=function(e,t){return"fatal"===e?`${t.danger}22`:"transparent"}(e.level,u),p=e.metadata&&Object.keys(e.metadata).length>0,g={...f,display:"flex",alignItems:"center",gap:6,padding:"0 10px",fontSize:12,fontFamily:a?'"JetBrains Mono", "Fira Mono", Consolas, monospace':"inherit",cursor:p||d?"pointer":"default",background:m,boxSizing:"border-box",height:28,overflow:"hidden",whiteSpace:"nowrap",borderBottom:`1px solid ${u.border}22`};return n("div",{style:g,className:"tkx-log-row",onClick:()=>{p&&c(),d&&d(e)},role:p?"button":void 0,tabIndex:p?0:void 0,onKeyDown:p?e=>{"Enter"!==e.key&&" "!==e.key||c()}:void 0,"aria-expanded":p?l:void 0},i&&n("span",{style:{color:u.textMuted,flexShrink:0,minWidth:84}},function(e){const t=new Date(e);return`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}:${String(t.getSeconds()).padStart(2,"0")}.${String(t.getMilliseconds()).padStart(3,"0")}`}(e.timestamp)),o&&n("span",{style:{color:h,flexShrink:0,fontWeight:"fatal"===e.level?700:500,minWidth:56}},`[${e.level.toUpperCase().padEnd(5)}]`),r&&e.source&&n("span",{style:{background:u.surfaceAlt,border:`1px solid ${u.border}`,borderRadius:10,padding:"0 5px",fontSize:10,color:u.textMuted,flexShrink:0,maxWidth:80,overflow:"hidden",textOverflow:"ellipsis"}},t(e.source)),n("span",{style:{flex:1,color:u.text,overflow:"hidden",textOverflow:"ellipsis"}},...function(e,o){if(!o)return[e];const i=t(e),r=t(o);if(!r)return[i];try{const e=new RegExp(`(${r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi");return i.split(e).map((t,o)=>e.test(t)?n("mark",{key:o,className:"tkx-log-highlight"},t):t)}catch{return[i]}}(e.message,s)),p&&n("span",{style:{color:u.textMuted,fontSize:10,flexShrink:0}},l?"▲":"▼"))}function S({metadata:e,theme:o,style:i}){return n("div",{style:{...i,background:o.surfaceAlt,borderBottom:`1px solid ${o.border}`,padding:"6px 10px 6px 56px",display:"flex",flexWrap:"wrap",gap:6,boxSizing:"border-box"}},...Object.entries(e).map(([e,i])=>n("span",{key:e,style:{fontSize:11,fontFamily:"monospace",color:o.textMuted,background:o.surface,border:`1px solid ${o.border}`,borderRadius:4,padding:"1px 6px"}},n("span",{style:{color:o.info}},`${t(e)}: `),t(String(i)))))}function $({entries:t,maxEntries:l=500,height:c=400,autoScroll:d=!0,showLevel:u=!0,showTimestamp:f=!0,showSource:h=!0,filterLevel:m,searchQuery:p="",monospace:g=!0,onEntryClick:y}){const x=e();!function(){if(v||"undefined"==typeof document)return;v=!0;const e=document.createElement("style");e.id="tkx-live-log-styles",e.textContent="\n.tkx-log-row:hover { filter: brightness(1.12); }\n.tkx-log-highlight { background: #ffbe0b55; border-radius: 2px; padding: 0 1px; }\n ".trim(),document.head.appendChild(e)}();const b=s(null),[$,M]=a(0),[z,N]=a(/* @__PURE__ */new Set),[W,I]=a(!1),L=s(t.length),C=r(()=>{let e=t.slice(-l);if(void 0!==m){const t=k[m];e=e.filter(e=>k[e.level]>=t)}if(p){const t=p.toLowerCase();e=e.filter(e=>e.message.toLowerCase().includes(t)||(e.source??"").toLowerCase().includes(t))}return e},[t,l,m,p]),T="number"==typeof c?c:400,j=r(()=>{const e=[];let t=0;for(const n of C)e.push(t),t+=28+(z.has(n.id)?40:0);return e.push(t),e},[C,z]),E=j[j.length-1]??0;i(()=>{d&&!W&&C.length!==L.current&&(L.current=C.length,b.current&&(b.current.scrollTop=b.current.scrollHeight))},[C.length,d,W]);const R=o(()=>{if(!b.current)return;const e=b.current;I(!(e.scrollHeight-e.scrollTop-e.clientHeight<56)),M(e.scrollTop)},[]),B=o(e=>{N(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),F=C.length>0?function(e){let t=0,n=C.length-1;for(;t<n;){const o=t+n>>1;(j[o+1]??0)<=e?t=o+1:n=o}return Math.max(0,t-8)}($):0,O=C.length>0?function(e){let t=0,n=C.length-1;for(;t<n;){const o=t+n+1>>1;(j[o]??0)>=e+T?n=o-1:t=o}return Math.min(C.length-1,t+8)}($):-1,D={position:"relative",overflow:"auto",height:"number"==typeof c?`${c}px`:c,background:x.bg,border:`1px solid ${x.border}`,borderRadius:8,boxSizing:"border-box"},A={position:"relative",height:E,minHeight:"100%"};if(0===C.length)return n("div",{style:{...D,display:"flex",alignItems:"center",justifyContent:"center"}},n("span",{style:{color:x.textMuted,fontSize:13,fontFamily:"monospace"}},"No log entries."));const H=[];for(let e=F;e<=O;e++){const t=C[e];if(!t)continue;const o=j[e]??0,i=z.has(t.id);H.push(n(w,{key:t.id,entry:t,showLevel:u,showTimestamp:f,showSource:h,searchQuery:p,monospace:g,isExpanded:i,onToggle:()=>B(t.id),onEntryClick:y,theme:x,style:{position:"absolute",top:o,left:0,right:0}})),i&&t.metadata&&Object.keys(t.metadata).length>0&&H.push(n(S,{key:`${t.id}-meta`,metadata:t.metadata,theme:x,style:{position:"absolute",top:o+28,left:0,right:0,height:40}}))}return n("div",{ref:b,style:D,onScroll:R,role:"log","aria-live":"polite","aria-label":"Log viewer"},n("div",{style:A},...H))}export{d as TkxLiveFeed,$ as TkxLiveLog,g as TkxLiveMetrics,b as TkxRealTimeChart};
|