tekivex-ui 2.5.15 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/charts.cjs +1 -1
- package/dist/charts.js +22 -553
- package/dist/chunk-B3ph66Zb.js +1 -0
- package/dist/chunk-Bc16rJT-.js +1 -0
- package/dist/chunk-Dike2DLU.js +3 -0
- package/dist/chunk-DjxOP8W4.js +1 -0
- package/dist/chunk-DkoFTL1O.js +1 -0
- package/dist/chunk-DmRB1Blb.js +1 -0
- package/dist/chunk-DnCXUUx5.js +1 -0
- package/dist/chunk-LWkKqC8d.js +1 -0
- package/dist/chunk-PJ50l0JC.js +1 -0
- package/dist/headless.cjs +1 -1
- package/dist/headless.js +1 -442
- package/dist/i18n.cjs +1 -1
- package/dist/i18n.js +1 -733
- package/dist/index.cjs +1 -152
- package/dist/index.d.ts +4 -2
- package/dist/index.js +429 -16786
- package/dist/quantum.cjs +1 -89
- package/dist/quantum.js +74 -2551
- package/dist/realtime.cjs +1 -23
- package/dist/realtime.js +1 -804
- package/dist/src/a11y/index.d.ts +0 -1
- package/dist/src/charts/TkxAreaChart.d.ts +0 -5
- package/dist/src/charts/TkxBarChart.d.ts +0 -3
- package/dist/src/charts/TkxDonutChart.d.ts +0 -5
- package/dist/src/charts/TkxLineChart.d.ts +0 -1
- package/dist/src/charts/TkxPieChart.d.ts +0 -3
- package/dist/src/charts/TkxRadarChart.d.ts +0 -3
- package/dist/src/charts/TkxScatterChart.d.ts +0 -2
- package/dist/src/charts/index.d.ts +0 -1
- package/dist/src/charts/shared.d.ts +0 -3
- package/dist/src/components/TkxAIChatBubble.d.ts +0 -9
- package/dist/src/components/TkxAIConfidenceBar.d.ts +0 -6
- package/dist/src/components/TkxAIThinking.d.ts +0 -6
- package/dist/src/components/TkxAccordion.d.ts +0 -1
- package/dist/src/components/TkxAffix.d.ts +0 -1
- package/dist/src/components/TkxAlert.d.ts +0 -1
- package/dist/src/components/TkxAnchor.d.ts +0 -1
- package/dist/src/components/TkxAppBar.d.ts +0 -1
- package/dist/src/components/TkxAutocomplete.d.ts +0 -1
- package/dist/src/components/TkxAvatar.d.ts +0 -1
- package/dist/src/components/TkxBadge.d.ts +0 -1
- package/dist/src/components/TkxBottomNav.d.ts +0 -1
- package/dist/src/components/TkxBreadcrumb.d.ts +0 -1
- package/dist/src/components/TkxButton.d.ts +0 -1
- package/dist/src/components/TkxCard.d.ts +0 -1
- package/dist/src/components/TkxCarousel.d.ts +0 -1
- package/dist/src/components/TkxCascader.d.ts +0 -1
- package/dist/src/components/TkxChat.d.ts +0 -1
- package/dist/src/components/TkxCheckbox.d.ts +0 -1
- package/dist/src/components/TkxClock.d.ts +0 -1
- package/dist/src/components/TkxColorPicker.d.ts +0 -1
- package/dist/src/components/TkxCommand.d.ts +0 -1
- package/dist/src/components/TkxConfigProvider.d.ts +0 -30
- package/dist/src/components/TkxDataGrid.d.ts +0 -15
- package/dist/src/components/TkxDatePicker.d.ts +0 -1
- package/dist/src/components/TkxDivider.d.ts +0 -1
- package/dist/src/components/TkxDrawer.d.ts +0 -1
- package/dist/src/components/TkxDropdown.d.ts +0 -1
- package/dist/src/components/TkxEmpty.d.ts +0 -1
- package/dist/src/components/TkxFileUpload.d.ts +0 -1
- package/dist/src/components/TkxForm.d.ts +0 -35
- package/dist/src/components/TkxIcon.d.ts +0 -1
- package/dist/src/components/TkxImage.d.ts +0 -1
- package/dist/src/components/TkxInput.d.ts +1 -1
- package/dist/src/components/TkxLayout.d.ts +0 -22
- package/dist/src/components/TkxList.d.ts +0 -1
- package/dist/src/components/TkxLiveFeed.d.ts +0 -1
- package/dist/src/components/TkxLiveLog.d.ts +0 -1
- package/dist/src/components/TkxLiveMetrics.d.ts +0 -1
- package/dist/src/components/TkxLogo.d.ts +0 -1
- package/dist/src/components/TkxMarkdown.d.ts +0 -10
- package/dist/src/components/TkxMasonry.d.ts +0 -1
- package/dist/src/components/TkxMentions.d.ts +0 -1
- package/dist/src/components/TkxMenu.d.ts +0 -1
- package/dist/src/components/TkxModal.d.ts +0 -1
- package/dist/src/components/TkxNumberInput.d.ts +0 -1
- package/dist/src/components/TkxOTP.d.ts +0 -1
- package/dist/src/components/TkxOrgChart.d.ts +32 -0
- package/dist/src/components/TkxPagination.d.ts +0 -1
- package/dist/src/components/TkxPlayground.d.ts +0 -13
- package/dist/src/components/TkxPopover.d.ts +0 -1
- package/dist/src/components/TkxProgress.d.ts +0 -1
- package/dist/src/components/TkxQRCode.d.ts +0 -1
- package/dist/src/components/TkxQuantumForm.d.ts +0 -1
- package/dist/src/components/TkxRadio.d.ts +0 -1
- package/dist/src/components/TkxRating.d.ts +0 -1
- package/dist/src/components/TkxRealTimeChart.d.ts +0 -1
- package/dist/src/components/TkxResult.d.ts +0 -1
- package/dist/src/components/TkxRichTextDisplay.d.ts +0 -1
- package/dist/src/components/TkxSegmented.d.ts +0 -1
- package/dist/src/components/TkxSelect.d.ts +0 -3
- package/dist/src/components/TkxSkeleton.d.ts +0 -1
- package/dist/src/components/TkxSlider.d.ts +0 -1
- package/dist/src/components/TkxSnackbar.d.ts +0 -1
- package/dist/src/components/TkxSpeedDial.d.ts +0 -1
- package/dist/src/components/TkxSpin.d.ts +0 -1
- package/dist/src/components/TkxStatistic.d.ts +0 -1
- package/dist/src/components/TkxStepper.d.ts +0 -1
- package/dist/src/components/TkxTable.d.ts +0 -1
- package/dist/src/components/TkxTabs.d.ts +0 -1
- package/dist/src/components/TkxTag.d.ts +0 -1
- package/dist/src/components/TkxThemeBuilder.d.ts +0 -1
- package/dist/src/components/TkxTimeline.d.ts +0 -1
- package/dist/src/components/TkxToast.d.ts +0 -1
- package/dist/src/components/TkxToggle.d.ts +0 -1
- package/dist/src/components/TkxToolbar.d.ts +0 -1
- package/dist/src/components/TkxTooltip.d.ts +0 -1
- package/dist/src/components/TkxTour.d.ts +0 -1
- package/dist/src/components/TkxTransferList.d.ts +0 -1
- package/dist/src/components/TkxTreeView.d.ts +0 -1
- package/dist/src/components/TkxTypography.d.ts +0 -1
- package/dist/src/components/TkxVideoPlayer.d.ts +0 -1
- package/dist/src/components/TkxWatermark.d.ts +0 -1
- package/dist/src/components/index.d.ts +1 -1
- package/dist/src/engine/css.d.ts +0 -1
- package/dist/src/engine/index.d.ts +0 -1
- package/dist/src/engine/quantum-ai.d.ts +0 -73
- package/dist/src/engine/quantum.d.ts +0 -1
- package/dist/src/engine/security.d.ts +45 -9
- package/dist/src/engine/tkx.d.ts +0 -53
- package/dist/src/engine/wcag.d.ts +0 -1
- package/dist/src/headless/index.d.ts +0 -1
- package/dist/src/headless/useControllable.d.ts +0 -15
- package/dist/src/headless/useDebounce.d.ts +0 -12
- package/dist/src/headless/useDisclosure.d.ts +0 -13
- package/dist/src/headless/useFormState.d.ts +0 -13
- package/dist/src/headless/useInfiniteQuery.d.ts +0 -11
- package/dist/src/headless/useIntersectionObserver.d.ts +0 -10
- package/dist/src/headless/useListSelection.d.ts +0 -9
- package/dist/src/headless/useLocalStorage.d.ts +0 -8
- package/dist/src/headless/useMediaQuery.d.ts +0 -10
- package/dist/src/headless/useRovingTabIndex.d.ts +0 -15
- package/dist/src/headless/useSSE.d.ts +0 -9
- package/dist/src/headless/useThrottle.d.ts +0 -7
- package/dist/src/headless/useWebSocket.d.ts +0 -9
- package/dist/src/hooks/index.d.ts +0 -1
- package/dist/src/i18n/I18nProvider.d.ts +0 -1
- package/dist/src/i18n/index.d.ts +0 -1
- package/dist/src/quantum/index.d.ts +0 -1
- package/dist/src/realtime/index.d.ts +0 -1
- package/dist/src/themes/index.d.ts +0 -1
- package/package.json +5 -3
- package/dist/TkxForm-BaO4wvXt.js +0 -320
- package/dist/TkxForm-M6ttomry.cjs +0 -12
- package/dist/chunk-Bmb41Sf3.cjs +0 -1
- package/dist/hooks-6pRsPOyG.js +0 -58
- package/dist/hooks-mivgRljH.cjs +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/src/a11y/index.d.ts.map +0 -1
- package/dist/src/charts/TkxAreaChart.d.ts.map +0 -1
- package/dist/src/charts/TkxBarChart.d.ts.map +0 -1
- package/dist/src/charts/TkxDonutChart.d.ts.map +0 -1
- package/dist/src/charts/TkxLineChart.d.ts.map +0 -1
- package/dist/src/charts/TkxPieChart.d.ts.map +0 -1
- package/dist/src/charts/TkxRadarChart.d.ts.map +0 -1
- package/dist/src/charts/TkxScatterChart.d.ts.map +0 -1
- package/dist/src/charts/index.d.ts.map +0 -1
- package/dist/src/charts/shared.d.ts.map +0 -1
- package/dist/src/components/TkxAIChatBubble.d.ts.map +0 -1
- package/dist/src/components/TkxAIConfidenceBar.d.ts.map +0 -1
- package/dist/src/components/TkxAIThinking.d.ts.map +0 -1
- package/dist/src/components/TkxAccordion.d.ts.map +0 -1
- package/dist/src/components/TkxAffix.d.ts.map +0 -1
- package/dist/src/components/TkxAlert.d.ts.map +0 -1
- package/dist/src/components/TkxAnchor.d.ts.map +0 -1
- package/dist/src/components/TkxAppBar.d.ts.map +0 -1
- package/dist/src/components/TkxAutocomplete.d.ts.map +0 -1
- package/dist/src/components/TkxAvatar.d.ts.map +0 -1
- package/dist/src/components/TkxBadge.d.ts.map +0 -1
- package/dist/src/components/TkxBottomNav.d.ts.map +0 -1
- package/dist/src/components/TkxBreadcrumb.d.ts.map +0 -1
- package/dist/src/components/TkxButton.d.ts.map +0 -1
- package/dist/src/components/TkxCard.d.ts.map +0 -1
- package/dist/src/components/TkxCarousel.d.ts.map +0 -1
- package/dist/src/components/TkxCascader.d.ts.map +0 -1
- package/dist/src/components/TkxChat.d.ts.map +0 -1
- package/dist/src/components/TkxCheckbox.d.ts.map +0 -1
- package/dist/src/components/TkxClock.d.ts.map +0 -1
- package/dist/src/components/TkxColorPicker.d.ts.map +0 -1
- package/dist/src/components/TkxCommand.d.ts.map +0 -1
- package/dist/src/components/TkxConfigProvider.d.ts.map +0 -1
- package/dist/src/components/TkxDataGrid.d.ts.map +0 -1
- package/dist/src/components/TkxDatePicker.d.ts.map +0 -1
- package/dist/src/components/TkxDivider.d.ts.map +0 -1
- package/dist/src/components/TkxDrawer.d.ts.map +0 -1
- package/dist/src/components/TkxDropdown.d.ts.map +0 -1
- package/dist/src/components/TkxEmpty.d.ts.map +0 -1
- package/dist/src/components/TkxFileUpload.d.ts.map +0 -1
- package/dist/src/components/TkxForm.d.ts.map +0 -1
- package/dist/src/components/TkxIcon.d.ts.map +0 -1
- package/dist/src/components/TkxImage.d.ts.map +0 -1
- package/dist/src/components/TkxInput.d.ts.map +0 -1
- package/dist/src/components/TkxLayout.d.ts.map +0 -1
- package/dist/src/components/TkxList.d.ts.map +0 -1
- package/dist/src/components/TkxLiveFeed.d.ts.map +0 -1
- package/dist/src/components/TkxLiveLog.d.ts.map +0 -1
- package/dist/src/components/TkxLiveMetrics.d.ts.map +0 -1
- package/dist/src/components/TkxLogo.d.ts.map +0 -1
- package/dist/src/components/TkxMarkdown.d.ts.map +0 -1
- package/dist/src/components/TkxMasonry.d.ts.map +0 -1
- package/dist/src/components/TkxMentions.d.ts.map +0 -1
- package/dist/src/components/TkxMenu.d.ts.map +0 -1
- package/dist/src/components/TkxModal.d.ts.map +0 -1
- package/dist/src/components/TkxNumberInput.d.ts.map +0 -1
- package/dist/src/components/TkxOTP.d.ts.map +0 -1
- package/dist/src/components/TkxPagination.d.ts.map +0 -1
- package/dist/src/components/TkxPlayground.d.ts.map +0 -1
- package/dist/src/components/TkxPopover.d.ts.map +0 -1
- package/dist/src/components/TkxProgress.d.ts.map +0 -1
- package/dist/src/components/TkxQRCode.d.ts.map +0 -1
- package/dist/src/components/TkxQuantumForm.d.ts.map +0 -1
- package/dist/src/components/TkxRadio.d.ts.map +0 -1
- package/dist/src/components/TkxRating.d.ts.map +0 -1
- package/dist/src/components/TkxRealTimeChart.d.ts.map +0 -1
- package/dist/src/components/TkxResult.d.ts.map +0 -1
- package/dist/src/components/TkxRichTextDisplay.d.ts.map +0 -1
- package/dist/src/components/TkxSegmented.d.ts.map +0 -1
- package/dist/src/components/TkxSelect.d.ts.map +0 -1
- package/dist/src/components/TkxSkeleton.d.ts.map +0 -1
- package/dist/src/components/TkxSlider.d.ts.map +0 -1
- package/dist/src/components/TkxSnackbar.d.ts.map +0 -1
- package/dist/src/components/TkxSpeedDial.d.ts.map +0 -1
- package/dist/src/components/TkxSpin.d.ts.map +0 -1
- package/dist/src/components/TkxStatistic.d.ts.map +0 -1
- package/dist/src/components/TkxStepper.d.ts.map +0 -1
- package/dist/src/components/TkxTable.d.ts.map +0 -1
- package/dist/src/components/TkxTabs.d.ts.map +0 -1
- package/dist/src/components/TkxTag.d.ts.map +0 -1
- package/dist/src/components/TkxThemeBuilder.d.ts.map +0 -1
- package/dist/src/components/TkxTimeline.d.ts.map +0 -1
- package/dist/src/components/TkxToast.d.ts.map +0 -1
- package/dist/src/components/TkxToggle.d.ts.map +0 -1
- package/dist/src/components/TkxToolbar.d.ts.map +0 -1
- package/dist/src/components/TkxTooltip.d.ts.map +0 -1
- package/dist/src/components/TkxTour.d.ts.map +0 -1
- package/dist/src/components/TkxTransferList.d.ts.map +0 -1
- package/dist/src/components/TkxTreeView.d.ts.map +0 -1
- package/dist/src/components/TkxTypography.d.ts.map +0 -1
- package/dist/src/components/TkxVideoPlayer.d.ts.map +0 -1
- package/dist/src/components/TkxWatermark.d.ts.map +0 -1
- package/dist/src/components/index.d.ts.map +0 -1
- package/dist/src/engine/css.d.ts.map +0 -1
- package/dist/src/engine/index.d.ts.map +0 -1
- package/dist/src/engine/quantum-ai.d.ts.map +0 -1
- package/dist/src/engine/quantum.d.ts.map +0 -1
- package/dist/src/engine/security.d.ts.map +0 -1
- package/dist/src/engine/tkx.d.ts.map +0 -1
- package/dist/src/engine/wcag.d.ts.map +0 -1
- package/dist/src/headless/index.d.ts.map +0 -1
- package/dist/src/headless/useControllable.d.ts.map +0 -1
- package/dist/src/headless/useDebounce.d.ts.map +0 -1
- package/dist/src/headless/useDisclosure.d.ts.map +0 -1
- package/dist/src/headless/useFormState.d.ts.map +0 -1
- package/dist/src/headless/useInfiniteQuery.d.ts.map +0 -1
- package/dist/src/headless/useIntersectionObserver.d.ts.map +0 -1
- package/dist/src/headless/useListSelection.d.ts.map +0 -1
- package/dist/src/headless/useLocalStorage.d.ts.map +0 -1
- package/dist/src/headless/useMediaQuery.d.ts.map +0 -1
- package/dist/src/headless/useRovingTabIndex.d.ts.map +0 -1
- package/dist/src/headless/useSSE.d.ts.map +0 -1
- package/dist/src/headless/useThrottle.d.ts.map +0 -1
- package/dist/src/headless/useWebSocket.d.ts.map +0 -1
- package/dist/src/hooks/index.d.ts.map +0 -1
- package/dist/src/i18n/I18nProvider.d.ts.map +0 -1
- package/dist/src/i18n/index.d.ts.map +0 -1
- package/dist/src/quantum/index.d.ts.map +0 -1
- package/dist/src/realtime/index.d.ts.map +0 -1
- package/dist/src/themes/index.d.ts.map +0 -1
- package/dist/themes-BbJanqiC.js +0 -498
- package/dist/themes-CMq2vWXj.cjs +0 -2
- package/dist/tkx-BoP5V5zy.cjs +0 -4
- package/dist/tkx-mOKMzvUK.js +0 -1174
- package/src/a11y/index.tsx +0 -87
- package/src/charts/TkxAreaChart.tsx +0 -121
- package/src/charts/TkxBarChart.tsx +0 -117
- package/src/charts/TkxDonutChart.tsx +0 -164
- package/src/charts/TkxLineChart.tsx +0 -137
- package/src/charts/TkxPieChart.tsx +0 -103
- package/src/charts/TkxRadarChart.tsx +0 -92
- package/src/charts/TkxScatterChart.tsx +0 -104
- package/src/charts/index.ts +0 -22
- package/src/charts/shared.ts +0 -47
- package/src/components/TkxAIChatBubble.tsx +0 -256
- package/src/components/TkxAIConfidenceBar.tsx +0 -133
- package/src/components/TkxAIThinking.tsx +0 -193
- package/src/components/TkxAccordion.tsx +0 -590
- package/src/components/TkxAffix.tsx +0 -140
- package/src/components/TkxAlert.tsx +0 -94
- package/src/components/TkxAnchor.tsx +0 -195
- package/src/components/TkxAppBar.tsx +0 -262
- package/src/components/TkxAutocomplete.tsx +0 -455
- package/src/components/TkxAvatar.tsx +0 -103
- package/src/components/TkxBadge.tsx +0 -75
- package/src/components/TkxBottomNav.tsx +0 -241
- package/src/components/TkxBreadcrumb.tsx +0 -324
- package/src/components/TkxButton.tsx +0 -155
- package/src/components/TkxCard.tsx +0 -96
- package/src/components/TkxCarousel.tsx +0 -554
- package/src/components/TkxCascader.tsx +0 -278
- package/src/components/TkxChat.tsx +0 -356
- package/src/components/TkxCheckbox.tsx +0 -220
- package/src/components/TkxClock.tsx +0 -603
- package/src/components/TkxColorPicker.tsx +0 -635
- package/src/components/TkxCommand.tsx +0 -646
- package/src/components/TkxConfigProvider.tsx +0 -460
- package/src/components/TkxDataGrid.tsx +0 -941
- package/src/components/TkxDatePicker.tsx +0 -1625
- package/src/components/TkxDivider.tsx +0 -51
- package/src/components/TkxDrawer.tsx +0 -236
- package/src/components/TkxDropdown.tsx +0 -804
- package/src/components/TkxEmpty.tsx +0 -221
- package/src/components/TkxFileUpload.tsx +0 -373
- package/src/components/TkxForm.tsx +0 -683
- package/src/components/TkxIcon.tsx +0 -685
- package/src/components/TkxImage.tsx +0 -279
- package/src/components/TkxInput.tsx +0 -103
- package/src/components/TkxLayout.tsx +0 -649
- package/src/components/TkxList.tsx +0 -244
- package/src/components/TkxLiveFeed.tsx +0 -331
- package/src/components/TkxLiveLog.tsx +0 -472
- package/src/components/TkxLiveMetrics.tsx +0 -315
- package/src/components/TkxLogo.tsx +0 -299
- package/src/components/TkxMarkdown.tsx +0 -855
- package/src/components/TkxMasonry.tsx +0 -178
- package/src/components/TkxMentions.tsx +0 -212
- package/src/components/TkxMenu.tsx +0 -1044
- package/src/components/TkxModal.tsx +0 -122
- package/src/components/TkxNumberInput.tsx +0 -410
- package/src/components/TkxOTP.tsx +0 -297
- package/src/components/TkxPagination.tsx +0 -390
- package/src/components/TkxPlayground.tsx +0 -845
- package/src/components/TkxPopover.tsx +0 -297
- package/src/components/TkxProgress.tsx +0 -114
- package/src/components/TkxQRCode.tsx +0 -176
- package/src/components/TkxQuantumForm.tsx +0 -594
- package/src/components/TkxRadio.tsx +0 -286
- package/src/components/TkxRating.tsx +0 -288
- package/src/components/TkxRealTimeChart.tsx +0 -383
- package/src/components/TkxResult.tsx +0 -130
- package/src/components/TkxRichTextDisplay.tsx +0 -396
- package/src/components/TkxSegmented.tsx +0 -171
- package/src/components/TkxSelect.tsx +0 -1130
- package/src/components/TkxSkeleton.tsx +0 -107
- package/src/components/TkxSlider.tsx +0 -495
- package/src/components/TkxSnackbar.tsx +0 -316
- package/src/components/TkxSpeedDial.tsx +0 -397
- package/src/components/TkxSpin.tsx +0 -263
- package/src/components/TkxStatistic.tsx +0 -263
- package/src/components/TkxStepper.tsx +0 -487
- package/src/components/TkxTable.tsx +0 -424
- package/src/components/TkxTabs.tsx +0 -126
- package/src/components/TkxTag.tsx +0 -321
- package/src/components/TkxThemeBuilder.tsx +0 -687
- package/src/components/TkxTimeline.tsx +0 -305
- package/src/components/TkxToast.tsx +0 -287
- package/src/components/TkxToggle.tsx +0 -95
- package/src/components/TkxToolbar.tsx +0 -262
- package/src/components/TkxTooltip.tsx +0 -85
- package/src/components/TkxTour.tsx +0 -241
- package/src/components/TkxTransferList.tsx +0 -489
- package/src/components/TkxTreeView.tsx +0 -423
- package/src/components/TkxTypography.tsx +0 -267
- package/src/components/TkxVideoPlayer.tsx +0 -1015
- package/src/components/TkxWatermark.tsx +0 -145
- package/src/components/index.ts +0 -80
- package/src/engine/css.ts +0 -126
- package/src/engine/index.ts +0 -12
- package/src/engine/quantum-ai.ts +0 -1045
- package/src/engine/quantum.ts +0 -207
- package/src/engine/security.ts +0 -232
- package/src/engine/tkx.ts +0 -1084
- package/src/engine/wcag.ts +0 -276
- package/src/headless/index.ts +0 -52
- package/src/headless/useControllable.ts +0 -42
- package/src/headless/useDebounce.ts +0 -37
- package/src/headless/useDisclosure.ts +0 -30
- package/src/headless/useFormState.ts +0 -113
- package/src/headless/useInfiniteQuery.ts +0 -155
- package/src/headless/useIntersectionObserver.ts +0 -53
- package/src/headless/useListSelection.ts +0 -103
- package/src/headless/useLocalStorage.ts +0 -48
- package/src/headless/useMediaQuery.ts +0 -39
- package/src/headless/useRovingTabIndex.ts +0 -86
- package/src/headless/useSSE.ts +0 -167
- package/src/headless/useThrottle.ts +0 -48
- package/src/headless/useWebSocket.ts +0 -231
- package/src/hooks/index.ts +0 -122
- package/src/i18n/I18nProvider.tsx +0 -36
- package/src/i18n/index.ts +0 -877
- package/src/quantum/index.ts +0 -39
- package/src/realtime/index.ts +0 -21
- package/src/styles/global.css +0 -167
- package/src/themes/index.ts +0 -294
|
@@ -1,649 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
forwardRef,
|
|
5
|
-
createContext,
|
|
6
|
-
useContext,
|
|
7
|
-
useState,
|
|
8
|
-
useEffect,
|
|
9
|
-
useCallback,
|
|
10
|
-
type ReactNode,
|
|
11
|
-
type CSSProperties,
|
|
12
|
-
type HTMLAttributes,
|
|
13
|
-
} from 'react';
|
|
14
|
-
import { useTheme } from '../themes';
|
|
15
|
-
import { useReducedMotion } from '../hooks';
|
|
16
|
-
import { tkx, cx } from '../engine/tkx';
|
|
17
|
-
|
|
18
|
-
// ══════════════════════════════════════════════════════════════════════════════
|
|
19
|
-
// TkxLayout — Enterprise layout system with Header, Sider, Content, Footer
|
|
20
|
-
// plus a 24-column responsive Grid (TkxRow / TkxCol).
|
|
21
|
-
// ══════════════════════════════════════════════════════════════════════════════
|
|
22
|
-
|
|
23
|
-
// ── Layout Props ─────────────────────────────────────────────────────────────
|
|
24
|
-
|
|
25
|
-
export interface TkxLayoutProps extends HTMLAttributes<HTMLElement> {
|
|
26
|
-
children: ReactNode;
|
|
27
|
-
/** When true the layout flows horizontally (used when Sider is present). */
|
|
28
|
-
hasSider?: boolean;
|
|
29
|
-
style?: CSSProperties;
|
|
30
|
-
className?: string;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface TkxHeaderProps extends HTMLAttributes<HTMLElement> {
|
|
34
|
-
children: ReactNode;
|
|
35
|
-
/** Header height in px or CSS string. Default 64. */
|
|
36
|
-
height?: number | string;
|
|
37
|
-
/** Stick to top of viewport. */
|
|
38
|
-
fixed?: boolean;
|
|
39
|
-
style?: CSSProperties;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export interface TkxSiderProps extends HTMLAttributes<HTMLElement> {
|
|
43
|
-
children: ReactNode;
|
|
44
|
-
/** Expanded width. Default 240. */
|
|
45
|
-
width?: number | string;
|
|
46
|
-
/** Width when collapsed. Default 64. */
|
|
47
|
-
collapsedWidth?: number;
|
|
48
|
-
/** Controlled collapsed state. */
|
|
49
|
-
collapsed?: boolean;
|
|
50
|
-
/** Callback fired when collapsed state changes. */
|
|
51
|
-
onCollapse?: (collapsed: boolean) => void;
|
|
52
|
-
/** Show built-in collapse trigger at the bottom. */
|
|
53
|
-
collapsible?: boolean;
|
|
54
|
-
/** Auto-collapse when viewport is narrower than this breakpoint. */
|
|
55
|
-
breakpoint?: 'sm' | 'md' | 'lg' | 'xl';
|
|
56
|
-
/** Custom trigger node. Pass null to hide the default trigger entirely. */
|
|
57
|
-
trigger?: ReactNode | null;
|
|
58
|
-
style?: CSSProperties;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export interface TkxContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
62
|
-
children: ReactNode;
|
|
63
|
-
style?: CSSProperties;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export interface TkxFooterProps extends HTMLAttributes<HTMLElement> {
|
|
67
|
-
children: ReactNode;
|
|
68
|
-
style?: CSSProperties;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// ── Grid Props ───────────────────────────────────────────────────────────────
|
|
72
|
-
|
|
73
|
-
export interface TkxRowProps extends HTMLAttributes<HTMLDivElement> {
|
|
74
|
-
children: ReactNode;
|
|
75
|
-
/** Gutter in px — single number or [horizontal, vertical]. */
|
|
76
|
-
gutter?: number | [number, number];
|
|
77
|
-
justify?: 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'space-evenly';
|
|
78
|
-
align?: 'top' | 'middle' | 'bottom' | 'stretch';
|
|
79
|
-
/** Allow wrapping. Default true. */
|
|
80
|
-
wrap?: boolean;
|
|
81
|
-
style?: CSSProperties;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
interface ColSpanConfig {
|
|
85
|
-
span: number;
|
|
86
|
-
offset?: number;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export interface TkxColProps extends HTMLAttributes<HTMLDivElement> {
|
|
90
|
-
children?: ReactNode;
|
|
91
|
-
/** Column span out of 24. */
|
|
92
|
-
span?: number;
|
|
93
|
-
/** Left offset in columns. */
|
|
94
|
-
offset?: number;
|
|
95
|
-
/** Push columns to the right via relative positioning. */
|
|
96
|
-
push?: number;
|
|
97
|
-
/** Pull columns to the left via relative positioning. */
|
|
98
|
-
pull?: number;
|
|
99
|
-
/** Flex order override. */
|
|
100
|
-
order?: number;
|
|
101
|
-
/** Responsive config at >= 576px. */
|
|
102
|
-
sm?: number | ColSpanConfig;
|
|
103
|
-
/** Responsive config at >= 768px. */
|
|
104
|
-
md?: number | ColSpanConfig;
|
|
105
|
-
/** Responsive config at >= 992px. */
|
|
106
|
-
lg?: number | ColSpanConfig;
|
|
107
|
-
/** Responsive config at >= 1200px. */
|
|
108
|
-
xl?: number | ColSpanConfig;
|
|
109
|
-
style?: CSSProperties;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// ── Constants ────────────────────────────────────────────────────────────────
|
|
113
|
-
|
|
114
|
-
const BREAKPOINTS: Record<string, number> = {
|
|
115
|
-
sm: 576,
|
|
116
|
-
md: 768,
|
|
117
|
-
lg: 992,
|
|
118
|
-
xl: 1200,
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
// ── Utility ──────────────────────────────────────────────────────────────────
|
|
122
|
-
|
|
123
|
-
function normDim(value: number | string): string {
|
|
124
|
-
return typeof value === 'number' ? `${value}px` : value;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// ── Gutter Context (Row -> Col communication) ────────────────────────────────
|
|
128
|
-
|
|
129
|
-
interface GutterValue {
|
|
130
|
-
h: number;
|
|
131
|
-
v: number;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
const GutterContext = createContext<GutterValue>({ h: 0, v: 0 });
|
|
135
|
-
|
|
136
|
-
// ══════════════════════════════════════════════════════════════════════════════
|
|
137
|
-
// TkxLayout
|
|
138
|
-
// ══════════════════════════════════════════════════════════════════════════════
|
|
139
|
-
|
|
140
|
-
export const TkxLayout = forwardRef<HTMLElement, TkxLayoutProps>(
|
|
141
|
-
({ children, hasSider = false, className, style, ...rest }, ref) => {
|
|
142
|
-
const theme = useTheme();
|
|
143
|
-
|
|
144
|
-
const base = tkx('flex min-h-0 w-full font-sans');
|
|
145
|
-
const direction: CSSProperties = hasSider
|
|
146
|
-
? { flexDirection: 'row' }
|
|
147
|
-
: { flexDirection: 'column' };
|
|
148
|
-
|
|
149
|
-
return (
|
|
150
|
-
<section
|
|
151
|
-
ref={ref}
|
|
152
|
-
className={cx('tkx-layout', base, className)}
|
|
153
|
-
style={{
|
|
154
|
-
minHeight: '100%',
|
|
155
|
-
color: theme.text,
|
|
156
|
-
backgroundColor: theme.bg,
|
|
157
|
-
...direction,
|
|
158
|
-
...style,
|
|
159
|
-
}}
|
|
160
|
-
{...rest}
|
|
161
|
-
>
|
|
162
|
-
{children}
|
|
163
|
-
</section>
|
|
164
|
-
);
|
|
165
|
-
},
|
|
166
|
-
);
|
|
167
|
-
|
|
168
|
-
TkxLayout.displayName = 'TkxLayout';
|
|
169
|
-
|
|
170
|
-
// ══════════════════════════════════════════════════════════════════════════════
|
|
171
|
-
// TkxHeader
|
|
172
|
-
// ══════════════════════════════════════════════════════════════════════════════
|
|
173
|
-
|
|
174
|
-
export const TkxHeader = forwardRef<HTMLElement, TkxHeaderProps>(
|
|
175
|
-
({ children, height = 64, fixed = false, className, style, ...rest }, ref) => {
|
|
176
|
-
const theme = useTheme();
|
|
177
|
-
const h = normDim(height);
|
|
178
|
-
|
|
179
|
-
const base = tkx('flex items-center px-6 shrink-0 w-full');
|
|
180
|
-
|
|
181
|
-
const fixedStyles: CSSProperties = fixed
|
|
182
|
-
? { position: 'fixed', top: 0, left: 0, right: 0, zIndex: 1000 }
|
|
183
|
-
: {};
|
|
184
|
-
|
|
185
|
-
return (
|
|
186
|
-
<header
|
|
187
|
-
ref={ref}
|
|
188
|
-
className={cx('tkx-layout-header', base, className)}
|
|
189
|
-
style={{
|
|
190
|
-
height: h,
|
|
191
|
-
minHeight: h,
|
|
192
|
-
backgroundColor: theme.surface,
|
|
193
|
-
borderBottom: `1px solid ${theme.border}`,
|
|
194
|
-
...fixedStyles,
|
|
195
|
-
...style,
|
|
196
|
-
}}
|
|
197
|
-
{...rest}
|
|
198
|
-
>
|
|
199
|
-
{children}
|
|
200
|
-
</header>
|
|
201
|
-
);
|
|
202
|
-
},
|
|
203
|
-
);
|
|
204
|
-
|
|
205
|
-
TkxHeader.displayName = 'TkxHeader';
|
|
206
|
-
|
|
207
|
-
// ══════════════════════════════════════════════════════════════════════════════
|
|
208
|
-
// TkxSider
|
|
209
|
-
// ══════════════════════════════════════════════════════════════════════════════
|
|
210
|
-
|
|
211
|
-
/** Default chevron trigger for collapsible sidebars. */
|
|
212
|
-
function DefaultTrigger({
|
|
213
|
-
collapsed,
|
|
214
|
-
onClick,
|
|
215
|
-
color,
|
|
216
|
-
}: {
|
|
217
|
-
collapsed: boolean;
|
|
218
|
-
onClick: () => void;
|
|
219
|
-
color: string;
|
|
220
|
-
}) {
|
|
221
|
-
const reducedMotion = useReducedMotion();
|
|
222
|
-
|
|
223
|
-
return (
|
|
224
|
-
<button
|
|
225
|
-
type="button"
|
|
226
|
-
aria-label={collapsed ? 'Expand sidebar' : 'Collapse sidebar'}
|
|
227
|
-
onClick={onClick}
|
|
228
|
-
className={tkx(
|
|
229
|
-
'flex items-center justify-center w-full py-3 cursor-pointer',
|
|
230
|
-
'border-0 bg-transparent',
|
|
231
|
-
)}
|
|
232
|
-
style={{ color }}
|
|
233
|
-
>
|
|
234
|
-
<svg
|
|
235
|
-
width="16"
|
|
236
|
-
height="16"
|
|
237
|
-
viewBox="0 0 16 16"
|
|
238
|
-
fill="none"
|
|
239
|
-
style={{
|
|
240
|
-
transform: collapsed ? 'rotate(0deg)' : 'rotate(180deg)',
|
|
241
|
-
transition: reducedMotion ? 'none' : 'transform 200ms ease',
|
|
242
|
-
}}
|
|
243
|
-
aria-hidden="true"
|
|
244
|
-
>
|
|
245
|
-
<path
|
|
246
|
-
d="M6 3l5 5-5 5"
|
|
247
|
-
stroke="currentColor"
|
|
248
|
-
strokeWidth="2"
|
|
249
|
-
strokeLinecap="round"
|
|
250
|
-
strokeLinejoin="round"
|
|
251
|
-
/>
|
|
252
|
-
</svg>
|
|
253
|
-
</button>
|
|
254
|
-
);
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
export const TkxSider = forwardRef<HTMLElement, TkxSiderProps>(
|
|
258
|
-
(
|
|
259
|
-
{
|
|
260
|
-
children,
|
|
261
|
-
width = 240,
|
|
262
|
-
collapsedWidth = 64,
|
|
263
|
-
collapsed: controlledCollapsed,
|
|
264
|
-
onCollapse,
|
|
265
|
-
collapsible = false,
|
|
266
|
-
breakpoint,
|
|
267
|
-
trigger,
|
|
268
|
-
className,
|
|
269
|
-
style,
|
|
270
|
-
...rest
|
|
271
|
-
},
|
|
272
|
-
ref,
|
|
273
|
-
) => {
|
|
274
|
-
const theme = useTheme();
|
|
275
|
-
const reducedMotion = useReducedMotion();
|
|
276
|
-
|
|
277
|
-
// Internal collapsed state (uncontrolled fallback).
|
|
278
|
-
const [internalCollapsed, setInternalCollapsed] = useState(false);
|
|
279
|
-
const isCollapsed = controlledCollapsed ?? internalCollapsed;
|
|
280
|
-
|
|
281
|
-
const handleCollapse = useCallback(
|
|
282
|
-
(next: boolean) => {
|
|
283
|
-
if (controlledCollapsed === undefined) {
|
|
284
|
-
setInternalCollapsed(next);
|
|
285
|
-
}
|
|
286
|
-
onCollapse?.(next);
|
|
287
|
-
},
|
|
288
|
-
[controlledCollapsed, onCollapse],
|
|
289
|
-
);
|
|
290
|
-
|
|
291
|
-
// Breakpoint-based auto-collapse.
|
|
292
|
-
useEffect(() => {
|
|
293
|
-
if (!breakpoint) return;
|
|
294
|
-
const bp = BREAKPOINTS[breakpoint];
|
|
295
|
-
if (!bp) return;
|
|
296
|
-
|
|
297
|
-
const mq = window.matchMedia(`(max-width: ${bp - 1}px)`);
|
|
298
|
-
|
|
299
|
-
const handler = (e: MediaQueryListEvent) => {
|
|
300
|
-
handleCollapse(e.matches);
|
|
301
|
-
};
|
|
302
|
-
|
|
303
|
-
// Set initial state based on current viewport.
|
|
304
|
-
handleCollapse(mq.matches);
|
|
305
|
-
|
|
306
|
-
mq.addEventListener('change', handler);
|
|
307
|
-
return () => mq.removeEventListener('change', handler);
|
|
308
|
-
}, [breakpoint, handleCollapse]);
|
|
309
|
-
|
|
310
|
-
const expandedWidth = normDim(width);
|
|
311
|
-
const currentWidth = isCollapsed ? `${collapsedWidth}px` : expandedWidth;
|
|
312
|
-
|
|
313
|
-
const showTrigger = collapsible && trigger !== null;
|
|
314
|
-
|
|
315
|
-
const transitionCSS = reducedMotion
|
|
316
|
-
? 'none'
|
|
317
|
-
: 'width 200ms ease, min-width 200ms ease, max-width 200ms ease';
|
|
318
|
-
|
|
319
|
-
return (
|
|
320
|
-
<aside
|
|
321
|
-
ref={ref}
|
|
322
|
-
className={cx(
|
|
323
|
-
'tkx-layout-sider',
|
|
324
|
-
tkx('shrink-0 overflow-hidden flex flex-col'),
|
|
325
|
-
className,
|
|
326
|
-
)}
|
|
327
|
-
style={{
|
|
328
|
-
width: currentWidth,
|
|
329
|
-
minWidth: currentWidth,
|
|
330
|
-
maxWidth: currentWidth,
|
|
331
|
-
backgroundColor: theme.surface,
|
|
332
|
-
borderRight: `1px solid ${theme.border}`,
|
|
333
|
-
transition: transitionCSS,
|
|
334
|
-
...style,
|
|
335
|
-
}}
|
|
336
|
-
{...rest}
|
|
337
|
-
>
|
|
338
|
-
<div
|
|
339
|
-
className={tkx('flex-1 overflow-y-auto overflow-x-hidden')}
|
|
340
|
-
style={{ width: currentWidth, transition: transitionCSS }}
|
|
341
|
-
>
|
|
342
|
-
{children}
|
|
343
|
-
</div>
|
|
344
|
-
|
|
345
|
-
{showTrigger && (
|
|
346
|
-
<div
|
|
347
|
-
className={tkx('shrink-0')}
|
|
348
|
-
style={{ borderTop: `1px solid ${theme.border}` }}
|
|
349
|
-
>
|
|
350
|
-
{trigger !== undefined ? (
|
|
351
|
-
trigger
|
|
352
|
-
) : (
|
|
353
|
-
<DefaultTrigger
|
|
354
|
-
collapsed={isCollapsed}
|
|
355
|
-
onClick={() => handleCollapse(!isCollapsed)}
|
|
356
|
-
color={theme.textMuted}
|
|
357
|
-
/>
|
|
358
|
-
)}
|
|
359
|
-
</div>
|
|
360
|
-
)}
|
|
361
|
-
</aside>
|
|
362
|
-
);
|
|
363
|
-
},
|
|
364
|
-
);
|
|
365
|
-
|
|
366
|
-
TkxSider.displayName = 'TkxSider';
|
|
367
|
-
|
|
368
|
-
// ══════════════════════════════════════════════════════════════════════════════
|
|
369
|
-
// TkxContent
|
|
370
|
-
// ══════════════════════════════════════════════════════════════════════════════
|
|
371
|
-
|
|
372
|
-
export const TkxContent = forwardRef<HTMLDivElement, TkxContentProps>(
|
|
373
|
-
({ children, className, style, ...rest }, ref) => {
|
|
374
|
-
const theme = useTheme();
|
|
375
|
-
|
|
376
|
-
return (
|
|
377
|
-
<main
|
|
378
|
-
ref={ref}
|
|
379
|
-
className={cx('tkx-layout-content', tkx('flex-1 min-w-0 min-h-0'), className)}
|
|
380
|
-
style={{
|
|
381
|
-
backgroundColor: theme.bg,
|
|
382
|
-
padding: '24px',
|
|
383
|
-
...style,
|
|
384
|
-
}}
|
|
385
|
-
{...rest}
|
|
386
|
-
>
|
|
387
|
-
{children}
|
|
388
|
-
</main>
|
|
389
|
-
);
|
|
390
|
-
},
|
|
391
|
-
);
|
|
392
|
-
|
|
393
|
-
TkxContent.displayName = 'TkxContent';
|
|
394
|
-
|
|
395
|
-
// ══════════════════════════════════════════════════════════════════════════════
|
|
396
|
-
// TkxFooter
|
|
397
|
-
// ══════════════════════════════════════════════════════════════════════════════
|
|
398
|
-
|
|
399
|
-
export const TkxFooter = forwardRef<HTMLElement, TkxFooterProps>(
|
|
400
|
-
({ children, className, style, ...rest }, ref) => {
|
|
401
|
-
const theme = useTheme();
|
|
402
|
-
|
|
403
|
-
return (
|
|
404
|
-
<footer
|
|
405
|
-
ref={ref}
|
|
406
|
-
className={cx('tkx-layout-footer', tkx('flex items-center px-6 py-4 shrink-0'), className)}
|
|
407
|
-
style={{
|
|
408
|
-
backgroundColor: theme.surface,
|
|
409
|
-
borderTop: `1px solid ${theme.border}`,
|
|
410
|
-
color: theme.textMuted,
|
|
411
|
-
...style,
|
|
412
|
-
}}
|
|
413
|
-
{...rest}
|
|
414
|
-
>
|
|
415
|
-
{children}
|
|
416
|
-
</footer>
|
|
417
|
-
);
|
|
418
|
-
},
|
|
419
|
-
);
|
|
420
|
-
|
|
421
|
-
TkxFooter.displayName = 'TkxFooter';
|
|
422
|
-
|
|
423
|
-
// ══════════════════════════════════════════════════════════════════════════════
|
|
424
|
-
// TkxRow — 24-column flexbox grid row
|
|
425
|
-
// ══════════════════════════════════════════════════════════════════════════════
|
|
426
|
-
|
|
427
|
-
const JUSTIFY_MAP: Record<string, string> = {
|
|
428
|
-
start: 'flex-start',
|
|
429
|
-
center: 'center',
|
|
430
|
-
end: 'flex-end',
|
|
431
|
-
'space-between': 'space-between',
|
|
432
|
-
'space-around': 'space-around',
|
|
433
|
-
'space-evenly': 'space-evenly',
|
|
434
|
-
};
|
|
435
|
-
|
|
436
|
-
const ALIGN_MAP: Record<string, string> = {
|
|
437
|
-
top: 'flex-start',
|
|
438
|
-
middle: 'center',
|
|
439
|
-
bottom: 'flex-end',
|
|
440
|
-
stretch: 'stretch',
|
|
441
|
-
};
|
|
442
|
-
|
|
443
|
-
export const TkxRow = forwardRef<HTMLDivElement, TkxRowProps>(
|
|
444
|
-
(
|
|
445
|
-
{
|
|
446
|
-
children,
|
|
447
|
-
gutter,
|
|
448
|
-
justify = 'start',
|
|
449
|
-
align = 'top',
|
|
450
|
-
wrap = true,
|
|
451
|
-
className,
|
|
452
|
-
style,
|
|
453
|
-
...rest
|
|
454
|
-
},
|
|
455
|
-
ref,
|
|
456
|
-
) => {
|
|
457
|
-
const [hGutter, vGutter] = Array.isArray(gutter)
|
|
458
|
-
? gutter
|
|
459
|
-
: [gutter ?? 0, 0];
|
|
460
|
-
|
|
461
|
-
const halfH = hGutter / 2;
|
|
462
|
-
const halfV = vGutter / 2;
|
|
463
|
-
|
|
464
|
-
// Negative margins on the row compensate for column padding,
|
|
465
|
-
// keeping the outer edges flush with the layout.
|
|
466
|
-
const marginStyle: CSSProperties =
|
|
467
|
-
hGutter || vGutter
|
|
468
|
-
? { marginLeft: -halfH, marginRight: -halfH, marginTop: -halfV, marginBottom: -halfV }
|
|
469
|
-
: {};
|
|
470
|
-
|
|
471
|
-
const gutterValue: GutterValue = { h: halfH, v: halfV };
|
|
472
|
-
|
|
473
|
-
return (
|
|
474
|
-
<GutterContext.Provider value={gutterValue}>
|
|
475
|
-
<div
|
|
476
|
-
ref={ref}
|
|
477
|
-
className={cx('tkx-row', tkx('flex w-full'), className)}
|
|
478
|
-
style={{
|
|
479
|
-
flexWrap: wrap ? 'wrap' : 'nowrap',
|
|
480
|
-
justifyContent: JUSTIFY_MAP[justify] ?? 'flex-start',
|
|
481
|
-
alignItems: ALIGN_MAP[align] ?? 'flex-start',
|
|
482
|
-
...marginStyle,
|
|
483
|
-
...style,
|
|
484
|
-
}}
|
|
485
|
-
{...rest}
|
|
486
|
-
>
|
|
487
|
-
{children}
|
|
488
|
-
</div>
|
|
489
|
-
</GutterContext.Provider>
|
|
490
|
-
);
|
|
491
|
-
},
|
|
492
|
-
);
|
|
493
|
-
|
|
494
|
-
TkxRow.displayName = 'TkxRow';
|
|
495
|
-
|
|
496
|
-
// ══════════════════════════════════════════════════════════════════════════════
|
|
497
|
-
// TkxCol — 24-column flexbox grid column
|
|
498
|
-
// ══════════════════════════════════════════════════════════════════════════════
|
|
499
|
-
|
|
500
|
-
/** Inject responsive media-query classes once into the document head. */
|
|
501
|
-
let responsiveStyleInjected = false;
|
|
502
|
-
|
|
503
|
-
function injectResponsiveStyles(): void {
|
|
504
|
-
if (responsiveStyleInjected || typeof document === 'undefined') return;
|
|
505
|
-
responsiveStyleInjected = true;
|
|
506
|
-
|
|
507
|
-
const rules: string[] = [];
|
|
508
|
-
|
|
509
|
-
for (const [bp, minWidth] of Object.entries(BREAKPOINTS)) {
|
|
510
|
-
// Span classes: .tkx-col-{bp}-{1..24}
|
|
511
|
-
for (let i = 1; i <= 24; i++) {
|
|
512
|
-
const pct = `${(i / 24) * 100}%`;
|
|
513
|
-
rules.push(
|
|
514
|
-
`@media (min-width: ${minWidth}px) { .tkx-col-${bp}-${i} { flex: 0 0 ${pct} !important; max-width: ${pct} !important; } }`,
|
|
515
|
-
);
|
|
516
|
-
}
|
|
517
|
-
// Offset classes: .tkx-col-{bp}-offset-{0..24}
|
|
518
|
-
for (let i = 0; i <= 24; i++) {
|
|
519
|
-
const pct = `${(i / 24) * 100}%`;
|
|
520
|
-
rules.push(
|
|
521
|
-
`@media (min-width: ${minWidth}px) { .tkx-col-${bp}-offset-${i} { margin-left: ${pct} !important; } }`,
|
|
522
|
-
);
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
const el = document.createElement('style');
|
|
527
|
-
el.id = 'tkx-col-responsive';
|
|
528
|
-
el.textContent = rules.join('\n');
|
|
529
|
-
document.head.appendChild(el);
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
function normaliseBreakpointProp(
|
|
533
|
-
value: number | ColSpanConfig | undefined,
|
|
534
|
-
): ColSpanConfig | undefined {
|
|
535
|
-
if (value === undefined) return undefined;
|
|
536
|
-
return typeof value === 'number' ? { span: value } : value;
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
export const TkxCol = forwardRef<HTMLDivElement, TkxColProps>(
|
|
540
|
-
(
|
|
541
|
-
{
|
|
542
|
-
children,
|
|
543
|
-
span,
|
|
544
|
-
offset = 0,
|
|
545
|
-
push,
|
|
546
|
-
pull,
|
|
547
|
-
order,
|
|
548
|
-
sm,
|
|
549
|
-
md,
|
|
550
|
-
lg,
|
|
551
|
-
xl,
|
|
552
|
-
className,
|
|
553
|
-
style,
|
|
554
|
-
...rest
|
|
555
|
-
},
|
|
556
|
-
ref,
|
|
557
|
-
) => {
|
|
558
|
-
// Inject responsive stylesheet on first render.
|
|
559
|
-
useEffect(() => {
|
|
560
|
-
injectResponsiveStyles();
|
|
561
|
-
}, []);
|
|
562
|
-
|
|
563
|
-
// Read gutter from parent TkxRow via context.
|
|
564
|
-
const gutter = useContext(GutterContext);
|
|
565
|
-
|
|
566
|
-
// Base span/offset (no breakpoint).
|
|
567
|
-
const baseWidth = span !== undefined ? `${(span / 24) * 100}%` : undefined;
|
|
568
|
-
const baseOffset = offset ? `${(offset / 24) * 100}%` : undefined;
|
|
569
|
-
|
|
570
|
-
// Build responsive class list.
|
|
571
|
-
const responsiveClasses: string[] = [];
|
|
572
|
-
|
|
573
|
-
const bpEntries: [string, number | ColSpanConfig | undefined][] = [
|
|
574
|
-
['sm', sm],
|
|
575
|
-
['md', md],
|
|
576
|
-
['lg', lg],
|
|
577
|
-
['xl', xl],
|
|
578
|
-
];
|
|
579
|
-
|
|
580
|
-
for (const [bp, raw] of bpEntries) {
|
|
581
|
-
const cfg = normaliseBreakpointProp(raw);
|
|
582
|
-
if (!cfg) continue;
|
|
583
|
-
responsiveClasses.push(`tkx-col-${bp}-${cfg.span}`);
|
|
584
|
-
if (cfg.offset !== undefined && cfg.offset > 0) {
|
|
585
|
-
responsiveClasses.push(`tkx-col-${bp}-offset-${cfg.offset}`);
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
// Positional overrides (push/pull/order).
|
|
590
|
-
const positional: CSSProperties = {};
|
|
591
|
-
if (push !== undefined) {
|
|
592
|
-
positional.left = `${(push / 24) * 100}%`;
|
|
593
|
-
positional.position = 'relative';
|
|
594
|
-
}
|
|
595
|
-
if (pull !== undefined) {
|
|
596
|
-
positional.right = `${(pull / 24) * 100}%`;
|
|
597
|
-
positional.position = 'relative';
|
|
598
|
-
}
|
|
599
|
-
if (order !== undefined) {
|
|
600
|
-
positional.order = order;
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
return (
|
|
604
|
-
<div
|
|
605
|
-
ref={ref}
|
|
606
|
-
className={cx(
|
|
607
|
-
'tkx-col',
|
|
608
|
-
tkx('box-border min-h-[1px]'),
|
|
609
|
-
...responsiveClasses,
|
|
610
|
-
className,
|
|
611
|
-
)}
|
|
612
|
-
style={{
|
|
613
|
-
flex: baseWidth ? `0 0 ${baseWidth}` : '1',
|
|
614
|
-
maxWidth: baseWidth ?? '100%',
|
|
615
|
-
marginLeft: baseOffset,
|
|
616
|
-
paddingLeft: gutter.h || undefined,
|
|
617
|
-
paddingRight: gutter.h || undefined,
|
|
618
|
-
paddingTop: gutter.v || undefined,
|
|
619
|
-
paddingBottom: gutter.v || undefined,
|
|
620
|
-
...positional,
|
|
621
|
-
...style,
|
|
622
|
-
}}
|
|
623
|
-
{...rest}
|
|
624
|
-
>
|
|
625
|
-
{children}
|
|
626
|
-
</div>
|
|
627
|
-
);
|
|
628
|
-
},
|
|
629
|
-
);
|
|
630
|
-
|
|
631
|
-
TkxCol.displayName = 'TkxCol';
|
|
632
|
-
|
|
633
|
-
// ══════════════════════════════════════════════════════════════════════════════
|
|
634
|
-
// Usage example:
|
|
635
|
-
//
|
|
636
|
-
// <TkxLayout>
|
|
637
|
-
// <TkxHeader fixed>Logo / Nav</TkxHeader>
|
|
638
|
-
// <TkxLayout hasSider>
|
|
639
|
-
// <TkxSider collapsible breakpoint="md">Menu</TkxSider>
|
|
640
|
-
// <TkxContent>
|
|
641
|
-
// <TkxRow gutter={[16, 16]}>
|
|
642
|
-
// <TkxCol span={12} md={8}>Column A</TkxCol>
|
|
643
|
-
// <TkxCol span={12} md={16}>Column B</TkxCol>
|
|
644
|
-
// </TkxRow>
|
|
645
|
-
// </TkxContent>
|
|
646
|
-
// </TkxLayout>
|
|
647
|
-
// <TkxFooter>Footer</TkxFooter>
|
|
648
|
-
// </TkxLayout>
|
|
649
|
-
// ══════════════════════════════════════════════════════════════════════════════
|