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/src/a11y/index.tsx
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type ReactNode,
|
|
3
|
-
type ElementType,
|
|
4
|
-
type ComponentPropsWithoutRef,
|
|
5
|
-
} from 'react';
|
|
6
|
-
import { useFocusTrap } from '../hooks';
|
|
7
|
-
|
|
8
|
-
// ── SkipNav ──────────────────────────────────────────────────────────────────
|
|
9
|
-
|
|
10
|
-
export interface SkipNavProps {
|
|
11
|
-
contentId?: string;
|
|
12
|
-
label?: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function SkipNav({
|
|
16
|
-
contentId = 'tkx-main-content',
|
|
17
|
-
label = 'Skip to main content',
|
|
18
|
-
}: SkipNavProps) {
|
|
19
|
-
return (
|
|
20
|
-
<a href={`#${contentId}`} className="tkx-skip-nav">
|
|
21
|
-
{label}
|
|
22
|
-
</a>
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// ── LiveRegion ───────────────────────────────────────────────────────────────
|
|
27
|
-
|
|
28
|
-
export interface LiveRegionProps {
|
|
29
|
-
politeness?: 'polite' | 'assertive';
|
|
30
|
-
children?: ReactNode;
|
|
31
|
-
atomic?: boolean;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export function LiveRegion({
|
|
35
|
-
politeness = 'polite',
|
|
36
|
-
children,
|
|
37
|
-
atomic = true,
|
|
38
|
-
}: LiveRegionProps) {
|
|
39
|
-
return (
|
|
40
|
-
<div
|
|
41
|
-
role="status"
|
|
42
|
-
aria-live={politeness}
|
|
43
|
-
aria-atomic={atomic}
|
|
44
|
-
className="tkx-sr-only"
|
|
45
|
-
>
|
|
46
|
-
{children}
|
|
47
|
-
</div>
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// ── FocusTrap ────────────────────────────────────────────────────────────────
|
|
52
|
-
|
|
53
|
-
export interface FocusTrapProps {
|
|
54
|
-
active: boolean;
|
|
55
|
-
children: ReactNode;
|
|
56
|
-
as?: ElementType;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export function FocusTrap({ active, children, as: Tag = 'div' }: FocusTrapProps) {
|
|
60
|
-
const ref = useFocusTrap(active);
|
|
61
|
-
return (
|
|
62
|
-
<Tag ref={ref as React.Ref<HTMLElement>}>
|
|
63
|
-
{children}
|
|
64
|
-
</Tag>
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// ── VisuallyHidden ────────────────────────────────────────────────────────────
|
|
69
|
-
|
|
70
|
-
export type VisuallyHiddenProps<T extends ElementType = 'span'> = {
|
|
71
|
-
as?: T;
|
|
72
|
-
children: ReactNode;
|
|
73
|
-
} & Omit<ComponentPropsWithoutRef<T>, 'as' | 'children'>;
|
|
74
|
-
|
|
75
|
-
export function VisuallyHidden<T extends ElementType = 'span'>({
|
|
76
|
-
as,
|
|
77
|
-
children,
|
|
78
|
-
...rest
|
|
79
|
-
}: VisuallyHiddenProps<T>) {
|
|
80
|
-
const Tag = (as ?? 'span') as ElementType;
|
|
81
|
-
return (
|
|
82
|
-
<Tag className="tkx-sr-only" {...rest}>
|
|
83
|
-
{children}
|
|
84
|
-
</Tag>
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
ResponsiveContainer,
|
|
5
|
-
AreaChart,
|
|
6
|
-
Area,
|
|
7
|
-
XAxis,
|
|
8
|
-
YAxis,
|
|
9
|
-
CartesianGrid,
|
|
10
|
-
Tooltip,
|
|
11
|
-
Legend,
|
|
12
|
-
} from 'recharts';
|
|
13
|
-
import { useTheme } from '../themes';
|
|
14
|
-
import { getDefaultColors, tooltipStyle, DEFAULT_MARGIN, type ChartMargin } from './shared';
|
|
15
|
-
|
|
16
|
-
export interface TkxAreaChartSeries {
|
|
17
|
-
key: string;
|
|
18
|
-
label?: string;
|
|
19
|
-
color?: string;
|
|
20
|
-
/** Fill opacity. Default: 0.2 */
|
|
21
|
-
fillOpacity?: number;
|
|
22
|
-
/** Whether to stack this series. Default: false */
|
|
23
|
-
stacked?: boolean;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface TkxAreaChartProps {
|
|
27
|
-
data: Record<string, any>[];
|
|
28
|
-
series: TkxAreaChartSeries[];
|
|
29
|
-
xKey: string;
|
|
30
|
-
height?: number;
|
|
31
|
-
margin?: ChartMargin;
|
|
32
|
-
showGrid?: boolean;
|
|
33
|
-
showLegend?: boolean;
|
|
34
|
-
showTooltip?: boolean;
|
|
35
|
-
/** Smooth curves. Default: true */
|
|
36
|
-
smooth?: boolean;
|
|
37
|
-
xTickFormatter?: (value: any) => string;
|
|
38
|
-
yTickFormatter?: (value: any) => string;
|
|
39
|
-
yDomain?: [number | 'auto' | 'dataMin' | 'dataMax', number | 'auto' | 'dataMin' | 'dataMax'];
|
|
40
|
-
/** aria-label for the chart container */
|
|
41
|
-
ariaLabel?: string;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export function TkxAreaChart({
|
|
45
|
-
data,
|
|
46
|
-
series,
|
|
47
|
-
xKey,
|
|
48
|
-
height = 300,
|
|
49
|
-
margin = DEFAULT_MARGIN,
|
|
50
|
-
showGrid = true,
|
|
51
|
-
showLegend = true,
|
|
52
|
-
showTooltip = true,
|
|
53
|
-
smooth = true,
|
|
54
|
-
xTickFormatter,
|
|
55
|
-
yTickFormatter,
|
|
56
|
-
yDomain,
|
|
57
|
-
ariaLabel = 'Area chart',
|
|
58
|
-
}: TkxAreaChartProps) {
|
|
59
|
-
const theme = useTheme();
|
|
60
|
-
const colors = getDefaultColors(theme);
|
|
61
|
-
const tt = tooltipStyle(theme);
|
|
62
|
-
|
|
63
|
-
const tickStyle = { fill: theme.textMuted, fontSize: 12 };
|
|
64
|
-
|
|
65
|
-
return (
|
|
66
|
-
<div role="img" aria-label={ariaLabel} style={{ width: '100%', height }}>
|
|
67
|
-
<ResponsiveContainer width="100%" height="100%">
|
|
68
|
-
<AreaChart data={data} margin={margin}>
|
|
69
|
-
{showGrid && (
|
|
70
|
-
<CartesianGrid strokeDasharray="3 3" stroke={theme.border} vertical={false} />
|
|
71
|
-
)}
|
|
72
|
-
<XAxis
|
|
73
|
-
dataKey={xKey}
|
|
74
|
-
tick={tickStyle}
|
|
75
|
-
axisLine={{ stroke: theme.border }}
|
|
76
|
-
tickLine={false}
|
|
77
|
-
tickFormatter={xTickFormatter}
|
|
78
|
-
/>
|
|
79
|
-
<YAxis
|
|
80
|
-
tick={tickStyle}
|
|
81
|
-
axisLine={false}
|
|
82
|
-
tickLine={false}
|
|
83
|
-
tickFormatter={yTickFormatter}
|
|
84
|
-
domain={yDomain}
|
|
85
|
-
/>
|
|
86
|
-
{showTooltip && (
|
|
87
|
-
<Tooltip
|
|
88
|
-
contentStyle={tt.contentStyle}
|
|
89
|
-
labelStyle={tt.labelStyle}
|
|
90
|
-
itemStyle={tt.itemStyle}
|
|
91
|
-
cursor={tt.cursor}
|
|
92
|
-
/>
|
|
93
|
-
)}
|
|
94
|
-
{showLegend && (
|
|
95
|
-
<Legend
|
|
96
|
-
wrapperStyle={{ fontSize: 13, color: theme.textMuted, paddingTop: 8 }}
|
|
97
|
-
/>
|
|
98
|
-
)}
|
|
99
|
-
{series.map((s, i) => {
|
|
100
|
-
const color = s.color ?? colors[i % colors.length];
|
|
101
|
-
return (
|
|
102
|
-
<Area
|
|
103
|
-
key={s.key}
|
|
104
|
-
type={smooth ? 'monotone' : 'linear'}
|
|
105
|
-
dataKey={s.key}
|
|
106
|
-
name={s.label ?? s.key}
|
|
107
|
-
stroke={color}
|
|
108
|
-
strokeWidth={2}
|
|
109
|
-
fill={color}
|
|
110
|
-
fillOpacity={s.fillOpacity ?? 0.2}
|
|
111
|
-
stackId={s.stacked ? 'stack' : undefined}
|
|
112
|
-
dot={false}
|
|
113
|
-
activeDot={{ r: 5, strokeWidth: 0 }}
|
|
114
|
-
/>
|
|
115
|
-
);
|
|
116
|
-
})}
|
|
117
|
-
</AreaChart>
|
|
118
|
-
</ResponsiveContainer>
|
|
119
|
-
</div>
|
|
120
|
-
);
|
|
121
|
-
}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
ResponsiveContainer,
|
|
5
|
-
BarChart,
|
|
6
|
-
Bar,
|
|
7
|
-
XAxis,
|
|
8
|
-
YAxis,
|
|
9
|
-
CartesianGrid,
|
|
10
|
-
Tooltip,
|
|
11
|
-
Legend,
|
|
12
|
-
Cell,
|
|
13
|
-
} from 'recharts';
|
|
14
|
-
import { useTheme } from '../themes';
|
|
15
|
-
import { getDefaultColors, tooltipStyle, DEFAULT_MARGIN, type ChartMargin } from './shared';
|
|
16
|
-
|
|
17
|
-
export interface TkxBarChartSeries {
|
|
18
|
-
key: string;
|
|
19
|
-
label?: string;
|
|
20
|
-
color?: string;
|
|
21
|
-
/** Stack ID — bars with the same stackId are stacked. */
|
|
22
|
-
stackId?: string;
|
|
23
|
-
radius?: number | [number, number, number, number];
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface TkxBarChartProps {
|
|
27
|
-
data: Record<string, any>[];
|
|
28
|
-
series: TkxBarChartSeries[];
|
|
29
|
-
xKey: string;
|
|
30
|
-
height?: number;
|
|
31
|
-
margin?: ChartMargin;
|
|
32
|
-
showGrid?: boolean;
|
|
33
|
-
showLegend?: boolean;
|
|
34
|
-
showTooltip?: boolean;
|
|
35
|
-
layout?: 'vertical' | 'horizontal';
|
|
36
|
-
barSize?: number;
|
|
37
|
-
/** Use gradient fill per series. Default: false */
|
|
38
|
-
gradient?: boolean;
|
|
39
|
-
xTickFormatter?: (value: any) => string;
|
|
40
|
-
yTickFormatter?: (value: any) => string;
|
|
41
|
-
ariaLabel?: string;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export function TkxBarChart({
|
|
45
|
-
data,
|
|
46
|
-
series,
|
|
47
|
-
xKey,
|
|
48
|
-
height = 300,
|
|
49
|
-
margin = DEFAULT_MARGIN,
|
|
50
|
-
showGrid = true,
|
|
51
|
-
showLegend = true,
|
|
52
|
-
showTooltip = true,
|
|
53
|
-
layout = 'horizontal',
|
|
54
|
-
barSize,
|
|
55
|
-
xTickFormatter,
|
|
56
|
-
yTickFormatter,
|
|
57
|
-
ariaLabel = 'Bar chart',
|
|
58
|
-
}: TkxBarChartProps) {
|
|
59
|
-
const theme = useTheme();
|
|
60
|
-
const colors = getDefaultColors(theme);
|
|
61
|
-
const tt = tooltipStyle(theme);
|
|
62
|
-
const tickStyle = { fill: theme.textMuted, fontSize: 12 };
|
|
63
|
-
const isVertical = layout === 'vertical';
|
|
64
|
-
|
|
65
|
-
return (
|
|
66
|
-
<div role="img" aria-label={ariaLabel} style={{ width: '100%', height }}>
|
|
67
|
-
<ResponsiveContainer width="100%" height="100%">
|
|
68
|
-
<BarChart data={data} margin={margin} layout={layout}>
|
|
69
|
-
{showGrid && (
|
|
70
|
-
<CartesianGrid
|
|
71
|
-
strokeDasharray="3 3"
|
|
72
|
-
stroke={theme.border}
|
|
73
|
-
vertical={isVertical}
|
|
74
|
-
horizontal={!isVertical}
|
|
75
|
-
/>
|
|
76
|
-
)}
|
|
77
|
-
{isVertical ? (
|
|
78
|
-
<>
|
|
79
|
-
<YAxis dataKey={xKey} type="category" tick={tickStyle} axisLine={false} tickLine={false} tickFormatter={xTickFormatter} width={100} />
|
|
80
|
-
<XAxis type="number" tick={tickStyle} axisLine={{ stroke: theme.border }} tickLine={false} tickFormatter={yTickFormatter} />
|
|
81
|
-
</>
|
|
82
|
-
) : (
|
|
83
|
-
<>
|
|
84
|
-
<XAxis dataKey={xKey} tick={tickStyle} axisLine={{ stroke: theme.border }} tickLine={false} tickFormatter={xTickFormatter} />
|
|
85
|
-
<YAxis tick={tickStyle} axisLine={false} tickLine={false} tickFormatter={yTickFormatter} />
|
|
86
|
-
</>
|
|
87
|
-
)}
|
|
88
|
-
{showTooltip && (
|
|
89
|
-
<Tooltip
|
|
90
|
-
contentStyle={tt.contentStyle}
|
|
91
|
-
labelStyle={tt.labelStyle}
|
|
92
|
-
itemStyle={tt.itemStyle}
|
|
93
|
-
cursor={{ fill: `${theme.surfaceAlt}` }}
|
|
94
|
-
/>
|
|
95
|
-
)}
|
|
96
|
-
{showLegend && (
|
|
97
|
-
<Legend wrapperStyle={{ fontSize: 13, color: theme.textMuted, paddingTop: 8 }} />
|
|
98
|
-
)}
|
|
99
|
-
{series.map((s, i) => {
|
|
100
|
-
const color = s.color ?? colors[i % colors.length];
|
|
101
|
-
return (
|
|
102
|
-
<Bar
|
|
103
|
-
key={s.key}
|
|
104
|
-
dataKey={s.key}
|
|
105
|
-
name={s.label ?? s.key}
|
|
106
|
-
fill={color}
|
|
107
|
-
stackId={s.stackId}
|
|
108
|
-
maxBarSize={barSize ?? 40}
|
|
109
|
-
radius={s.radius ?? [4, 4, 0, 0]}
|
|
110
|
-
/>
|
|
111
|
-
);
|
|
112
|
-
})}
|
|
113
|
-
</BarChart>
|
|
114
|
-
</ResponsiveContainer>
|
|
115
|
-
</div>
|
|
116
|
-
);
|
|
117
|
-
}
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { useEffect, useState } from 'react';
|
|
4
|
-
import {
|
|
5
|
-
ResponsiveContainer,
|
|
6
|
-
PieChart,
|
|
7
|
-
Pie,
|
|
8
|
-
Cell,
|
|
9
|
-
Tooltip,
|
|
10
|
-
Legend,
|
|
11
|
-
} from 'recharts';
|
|
12
|
-
import { useTheme } from '../themes';
|
|
13
|
-
import { useReducedMotion } from '../hooks';
|
|
14
|
-
import { getDefaultColors, tooltipStyle } from './shared';
|
|
15
|
-
|
|
16
|
-
export interface TkxDonutChartSlice {
|
|
17
|
-
name: string;
|
|
18
|
-
value: number;
|
|
19
|
-
color?: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface TkxDonutChartProps {
|
|
23
|
-
data: TkxDonutChartSlice[];
|
|
24
|
-
height?: number;
|
|
25
|
-
showLegend?: boolean;
|
|
26
|
-
showTooltip?: boolean;
|
|
27
|
-
/** Center label — large text (e.g. total value) */
|
|
28
|
-
centerLabel?: string;
|
|
29
|
-
/** Center sublabel — small text below centerLabel */
|
|
30
|
-
centerSublabel?: string;
|
|
31
|
-
/** Inner radius as number or percentage string. Default: '55%' */
|
|
32
|
-
innerRadius?: number | string;
|
|
33
|
-
/** Outer radius as number or percentage string. Default: '75%' */
|
|
34
|
-
outerRadius?: number | string;
|
|
35
|
-
startAngle?: number;
|
|
36
|
-
ariaLabel?: string;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function CenterLabel({
|
|
40
|
-
cx, cy, label, sublabel, theme,
|
|
41
|
-
}: {
|
|
42
|
-
cx: number; cy: number;
|
|
43
|
-
label?: string; sublabel?: string;
|
|
44
|
-
theme: any;
|
|
45
|
-
}) {
|
|
46
|
-
if (!label && !sublabel) return null;
|
|
47
|
-
return (
|
|
48
|
-
<>
|
|
49
|
-
{label && (
|
|
50
|
-
<text x={cx} y={cy - (sublabel ? 8 : 0)} textAnchor="middle" dominantBaseline="middle"
|
|
51
|
-
fill={theme.text} fontSize={22} fontWeight={700} fontFamily="inherit">
|
|
52
|
-
{label}
|
|
53
|
-
</text>
|
|
54
|
-
)}
|
|
55
|
-
{sublabel && (
|
|
56
|
-
<text x={cx} y={cy + (label ? 18 : 0)} textAnchor="middle" dominantBaseline="middle"
|
|
57
|
-
fill={theme.textMuted} fontSize={13} fontFamily="inherit">
|
|
58
|
-
{sublabel}
|
|
59
|
-
</text>
|
|
60
|
-
)}
|
|
61
|
-
</>
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export function TkxDonutChart({
|
|
66
|
-
data,
|
|
67
|
-
height = 300,
|
|
68
|
-
showLegend = true,
|
|
69
|
-
showTooltip = true,
|
|
70
|
-
centerLabel,
|
|
71
|
-
centerSublabel,
|
|
72
|
-
innerRadius = '55%',
|
|
73
|
-
outerRadius = '75%',
|
|
74
|
-
startAngle = 90,
|
|
75
|
-
ariaLabel = 'Donut chart',
|
|
76
|
-
}: TkxDonutChartProps) {
|
|
77
|
-
const theme = useTheme();
|
|
78
|
-
const reduced = useReducedMotion();
|
|
79
|
-
const colors = getDefaultColors(theme);
|
|
80
|
-
const tt = tooltipStyle(theme);
|
|
81
|
-
// Force ResponsiveContainer to re-measure after the parent layout settles.
|
|
82
|
-
// When reduced motion is preferred, skip the animation and mount immediately.
|
|
83
|
-
const [mounted, setMounted] = useState(reduced);
|
|
84
|
-
useEffect(() => {
|
|
85
|
-
if (reduced) { setMounted(true); return; }
|
|
86
|
-
const id = requestAnimationFrame(() => setMounted(true));
|
|
87
|
-
return () => cancelAnimationFrame(id);
|
|
88
|
-
}, [reduced]);
|
|
89
|
-
|
|
90
|
-
return (
|
|
91
|
-
<div
|
|
92
|
-
role="img"
|
|
93
|
-
aria-label={ariaLabel}
|
|
94
|
-
style={{ width: '100%', minWidth: 240, height, position: 'relative' }}
|
|
95
|
-
>
|
|
96
|
-
{mounted && (
|
|
97
|
-
<ResponsiveContainer width="100%" height="100%" debounce={50}>
|
|
98
|
-
<PieChart>
|
|
99
|
-
{showTooltip && (
|
|
100
|
-
<Tooltip
|
|
101
|
-
contentStyle={tt.contentStyle}
|
|
102
|
-
labelStyle={tt.labelStyle}
|
|
103
|
-
itemStyle={tt.itemStyle}
|
|
104
|
-
/>
|
|
105
|
-
)}
|
|
106
|
-
{showLegend && (
|
|
107
|
-
<Legend wrapperStyle={{ fontSize: 13, color: theme.textMuted }} />
|
|
108
|
-
)}
|
|
109
|
-
<Pie
|
|
110
|
-
data={data}
|
|
111
|
-
dataKey="value"
|
|
112
|
-
nameKey="name"
|
|
113
|
-
innerRadius={innerRadius}
|
|
114
|
-
outerRadius={outerRadius}
|
|
115
|
-
startAngle={startAngle}
|
|
116
|
-
endAngle={startAngle - 360}
|
|
117
|
-
strokeWidth={3}
|
|
118
|
-
stroke={theme.bg}
|
|
119
|
-
label={false}
|
|
120
|
-
labelLine={false}
|
|
121
|
-
>
|
|
122
|
-
{data.map((entry, i) => (
|
|
123
|
-
<Cell key={entry.name} fill={entry.color ?? colors[i % colors.length]} />
|
|
124
|
-
))}
|
|
125
|
-
{/* Center text via customized label — recharts passes cx/cy to label */}
|
|
126
|
-
</Pie>
|
|
127
|
-
{/* SVG center label rendered as a separate layer */}
|
|
128
|
-
{(centerLabel || centerSublabel) && (
|
|
129
|
-
<text>
|
|
130
|
-
{/* This renders nothing — actual center text needs PieChart customization */}
|
|
131
|
-
</text>
|
|
132
|
-
)}
|
|
133
|
-
</PieChart>
|
|
134
|
-
</ResponsiveContainer>
|
|
135
|
-
)}
|
|
136
|
-
{/* Overlay center label using absolute positioning */}
|
|
137
|
-
{(centerLabel || centerSublabel) && (
|
|
138
|
-
<div
|
|
139
|
-
style={{
|
|
140
|
-
position: 'absolute',
|
|
141
|
-
inset: 0,
|
|
142
|
-
display: 'flex',
|
|
143
|
-
flexDirection: 'column',
|
|
144
|
-
alignItems: 'center',
|
|
145
|
-
justifyContent: 'center',
|
|
146
|
-
pointerEvents: 'none',
|
|
147
|
-
marginTop: showLegend ? -24 : 0,
|
|
148
|
-
}}
|
|
149
|
-
>
|
|
150
|
-
{centerLabel && (
|
|
151
|
-
<span style={{ fontSize: 22, fontWeight: 700, color: theme.text, lineHeight: 1 }}>
|
|
152
|
-
{centerLabel}
|
|
153
|
-
</span>
|
|
154
|
-
)}
|
|
155
|
-
{centerSublabel && (
|
|
156
|
-
<span style={{ fontSize: 13, color: theme.textMuted, marginTop: 4 }}>
|
|
157
|
-
{centerSublabel}
|
|
158
|
-
</span>
|
|
159
|
-
)}
|
|
160
|
-
</div>
|
|
161
|
-
)}
|
|
162
|
-
</div>
|
|
163
|
-
);
|
|
164
|
-
}
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
ResponsiveContainer,
|
|
5
|
-
LineChart,
|
|
6
|
-
Line,
|
|
7
|
-
XAxis,
|
|
8
|
-
YAxis,
|
|
9
|
-
CartesianGrid,
|
|
10
|
-
Tooltip,
|
|
11
|
-
Legend,
|
|
12
|
-
ReferenceLine,
|
|
13
|
-
} from 'recharts';
|
|
14
|
-
import { useTheme } from '../themes';
|
|
15
|
-
import { getDefaultColors, tooltipStyle, DEFAULT_MARGIN, type ChartMargin } from './shared';
|
|
16
|
-
|
|
17
|
-
export interface TkxLineChartSeries {
|
|
18
|
-
key: string;
|
|
19
|
-
label?: string;
|
|
20
|
-
color?: string;
|
|
21
|
-
strokeWidth?: number;
|
|
22
|
-
dashed?: boolean;
|
|
23
|
-
dot?: boolean;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface TkxReferenceLineConfig {
|
|
27
|
-
y?: number;
|
|
28
|
-
x?: number | string;
|
|
29
|
-
label?: string;
|
|
30
|
-
color?: string;
|
|
31
|
-
dashed?: boolean;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface TkxLineChartProps {
|
|
35
|
-
data: Record<string, any>[];
|
|
36
|
-
series: TkxLineChartSeries[];
|
|
37
|
-
xKey: string;
|
|
38
|
-
height?: number;
|
|
39
|
-
margin?: ChartMargin;
|
|
40
|
-
showGrid?: boolean;
|
|
41
|
-
showLegend?: boolean;
|
|
42
|
-
showTooltip?: boolean;
|
|
43
|
-
smooth?: boolean;
|
|
44
|
-
referenceLines?: TkxReferenceLineConfig[];
|
|
45
|
-
xTickFormatter?: (value: any) => string;
|
|
46
|
-
yTickFormatter?: (value: any) => string;
|
|
47
|
-
yDomain?: [number | 'auto' | 'dataMin' | 'dataMax', number | 'auto' | 'dataMin' | 'dataMax'];
|
|
48
|
-
connectNulls?: boolean;
|
|
49
|
-
ariaLabel?: string;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export function TkxLineChart({
|
|
53
|
-
data,
|
|
54
|
-
series,
|
|
55
|
-
xKey,
|
|
56
|
-
height = 300,
|
|
57
|
-
margin = DEFAULT_MARGIN,
|
|
58
|
-
showGrid = true,
|
|
59
|
-
showLegend = true,
|
|
60
|
-
showTooltip = true,
|
|
61
|
-
smooth = true,
|
|
62
|
-
referenceLines = [],
|
|
63
|
-
xTickFormatter,
|
|
64
|
-
yTickFormatter,
|
|
65
|
-
yDomain,
|
|
66
|
-
connectNulls = false,
|
|
67
|
-
ariaLabel = 'Line chart',
|
|
68
|
-
}: TkxLineChartProps) {
|
|
69
|
-
const theme = useTheme();
|
|
70
|
-
const colors = getDefaultColors(theme);
|
|
71
|
-
const tt = tooltipStyle(theme);
|
|
72
|
-
const tickStyle = { fill: theme.textMuted, fontSize: 12 };
|
|
73
|
-
|
|
74
|
-
return (
|
|
75
|
-
<div role="img" aria-label={ariaLabel} style={{ width: '100%', height }}>
|
|
76
|
-
<ResponsiveContainer width="100%" height="100%">
|
|
77
|
-
<LineChart data={data} margin={margin}>
|
|
78
|
-
{showGrid && (
|
|
79
|
-
<CartesianGrid strokeDasharray="3 3" stroke={theme.border} vertical={false} />
|
|
80
|
-
)}
|
|
81
|
-
<XAxis
|
|
82
|
-
dataKey={xKey}
|
|
83
|
-
tick={tickStyle}
|
|
84
|
-
axisLine={{ stroke: theme.border }}
|
|
85
|
-
tickLine={false}
|
|
86
|
-
tickFormatter={xTickFormatter}
|
|
87
|
-
/>
|
|
88
|
-
<YAxis
|
|
89
|
-
tick={tickStyle}
|
|
90
|
-
axisLine={false}
|
|
91
|
-
tickLine={false}
|
|
92
|
-
tickFormatter={yTickFormatter}
|
|
93
|
-
domain={yDomain}
|
|
94
|
-
/>
|
|
95
|
-
{showTooltip && (
|
|
96
|
-
<Tooltip
|
|
97
|
-
contentStyle={tt.contentStyle}
|
|
98
|
-
labelStyle={tt.labelStyle}
|
|
99
|
-
itemStyle={tt.itemStyle}
|
|
100
|
-
cursor={{ stroke: theme.border, strokeWidth: 1 }}
|
|
101
|
-
/>
|
|
102
|
-
)}
|
|
103
|
-
{showLegend && (
|
|
104
|
-
<Legend wrapperStyle={{ fontSize: 13, color: theme.textMuted, paddingTop: 8 }} />
|
|
105
|
-
)}
|
|
106
|
-
{referenceLines.map((rl, i) => (
|
|
107
|
-
<ReferenceLine
|
|
108
|
-
key={i}
|
|
109
|
-
y={rl.y}
|
|
110
|
-
x={rl.x}
|
|
111
|
-
label={rl.label ? { value: rl.label, fill: theme.textMuted, fontSize: 11 } : undefined}
|
|
112
|
-
stroke={rl.color ?? theme.border}
|
|
113
|
-
strokeDasharray={rl.dashed ? '4 4' : undefined}
|
|
114
|
-
/>
|
|
115
|
-
))}
|
|
116
|
-
{series.map((s, i) => {
|
|
117
|
-
const color = s.color ?? colors[i % colors.length];
|
|
118
|
-
return (
|
|
119
|
-
<Line
|
|
120
|
-
key={s.key}
|
|
121
|
-
type={smooth ? 'monotone' : 'linear'}
|
|
122
|
-
dataKey={s.key}
|
|
123
|
-
name={s.label ?? s.key}
|
|
124
|
-
stroke={color}
|
|
125
|
-
strokeWidth={s.strokeWidth ?? 2}
|
|
126
|
-
strokeDasharray={s.dashed ? '6 3' : undefined}
|
|
127
|
-
dot={s.dot ?? false}
|
|
128
|
-
activeDot={{ r: 5, strokeWidth: 0, fill: color }}
|
|
129
|
-
connectNulls={connectNulls}
|
|
130
|
-
/>
|
|
131
|
-
);
|
|
132
|
-
})}
|
|
133
|
-
</LineChart>
|
|
134
|
-
</ResponsiveContainer>
|
|
135
|
-
</div>
|
|
136
|
-
);
|
|
137
|
-
}
|