tekivex-ui 2.5.14 → 2.5.16

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.
Files changed (392) hide show
  1. package/dist/charts.cjs +1 -1
  2. package/dist/charts.js +22 -553
  3. package/dist/chunk-B3ph66Zb.js +1 -0
  4. package/dist/chunk-Bc16rJT-.js +1 -0
  5. package/dist/chunk-BiHAhNbu.js +3 -0
  6. package/dist/chunk-CVRuGUFA.js +1 -0
  7. package/dist/chunk-Dc4_ud5s.js +1 -0
  8. package/dist/chunk-Dj40UFcz.js +1 -0
  9. package/dist/chunk-DjxOP8W4.js +1 -0
  10. package/dist/chunk-DmRB1Blb.js +1 -0
  11. package/dist/chunk-PJ50l0JC.js +1 -0
  12. package/dist/headless.cjs +1 -1
  13. package/dist/headless.js +1 -442
  14. package/dist/i18n.cjs +1 -1
  15. package/dist/i18n.js +1 -733
  16. package/dist/index.cjs +1 -147
  17. package/dist/index.d.ts +1 -1
  18. package/dist/index.js +419 -16193
  19. package/dist/quantum.cjs +1 -89
  20. package/dist/quantum.js +74 -2551
  21. package/dist/realtime.cjs +1 -23
  22. package/dist/realtime.js +1 -804
  23. package/dist/src/a11y/index.d.ts +0 -1
  24. package/dist/src/charts/TkxAreaChart.d.ts +0 -5
  25. package/dist/src/charts/TkxBarChart.d.ts +0 -3
  26. package/dist/src/charts/TkxDonutChart.d.ts +0 -5
  27. package/dist/src/charts/TkxLineChart.d.ts +0 -1
  28. package/dist/src/charts/TkxPieChart.d.ts +0 -3
  29. package/dist/src/charts/TkxRadarChart.d.ts +0 -3
  30. package/dist/src/charts/TkxScatterChart.d.ts +0 -2
  31. package/dist/src/charts/index.d.ts +0 -1
  32. package/dist/src/charts/shared.d.ts +0 -3
  33. package/dist/src/components/TkxAIChatBubble.d.ts +0 -9
  34. package/dist/src/components/TkxAIConfidenceBar.d.ts +0 -6
  35. package/dist/src/components/TkxAIThinking.d.ts +0 -6
  36. package/dist/src/components/TkxAccordion.d.ts +0 -1
  37. package/dist/src/components/TkxAffix.d.ts +0 -1
  38. package/dist/src/components/TkxAlert.d.ts +0 -1
  39. package/dist/src/components/TkxAnchor.d.ts +0 -1
  40. package/dist/src/components/TkxAppBar.d.ts +0 -1
  41. package/dist/src/components/TkxAutocomplete.d.ts +0 -1
  42. package/dist/src/components/TkxAvatar.d.ts +0 -1
  43. package/dist/src/components/TkxBadge.d.ts +0 -1
  44. package/dist/src/components/TkxBottomNav.d.ts +0 -1
  45. package/dist/src/components/TkxBreadcrumb.d.ts +0 -1
  46. package/dist/src/components/TkxButton.d.ts +0 -1
  47. package/dist/src/components/TkxCard.d.ts +0 -1
  48. package/dist/src/components/TkxCarousel.d.ts +0 -1
  49. package/dist/src/components/TkxCascader.d.ts +0 -1
  50. package/dist/src/components/TkxChat.d.ts +0 -1
  51. package/dist/src/components/TkxCheckbox.d.ts +0 -1
  52. package/dist/src/components/TkxClock.d.ts +0 -1
  53. package/dist/src/components/TkxColorPicker.d.ts +0 -1
  54. package/dist/src/components/TkxCommand.d.ts +0 -1
  55. package/dist/src/components/TkxConfigProvider.d.ts +0 -30
  56. package/dist/src/components/TkxDataGrid.d.ts +0 -15
  57. package/dist/src/components/TkxDatePicker.d.ts +0 -1
  58. package/dist/src/components/TkxDivider.d.ts +0 -1
  59. package/dist/src/components/TkxDrawer.d.ts +0 -1
  60. package/dist/src/components/TkxDropdown.d.ts +0 -1
  61. package/dist/src/components/TkxEmpty.d.ts +0 -1
  62. package/dist/src/components/TkxFileUpload.d.ts +0 -1
  63. package/dist/src/components/TkxForm.d.ts +0 -35
  64. package/dist/src/components/TkxIcon.d.ts +0 -1
  65. package/dist/src/components/TkxImage.d.ts +0 -1
  66. package/dist/src/components/TkxInput.d.ts +0 -1
  67. package/dist/src/components/TkxLayout.d.ts +0 -22
  68. package/dist/src/components/TkxList.d.ts +0 -1
  69. package/dist/src/components/TkxLiveFeed.d.ts +0 -1
  70. package/dist/src/components/TkxLiveLog.d.ts +0 -1
  71. package/dist/src/components/TkxLiveMetrics.d.ts +0 -1
  72. package/dist/src/components/TkxLogo.d.ts +0 -1
  73. package/dist/src/components/TkxMarkdown.d.ts +19 -0
  74. package/dist/src/components/TkxMasonry.d.ts +0 -1
  75. package/dist/src/components/TkxMentions.d.ts +0 -1
  76. package/dist/src/components/TkxMenu.d.ts +0 -1
  77. package/dist/src/components/TkxModal.d.ts +0 -1
  78. package/dist/src/components/TkxNumberInput.d.ts +0 -1
  79. package/dist/src/components/TkxOTP.d.ts +0 -1
  80. package/dist/src/components/TkxPagination.d.ts +0 -1
  81. package/dist/src/components/TkxPlayground.d.ts +0 -13
  82. package/dist/src/components/TkxPopover.d.ts +0 -1
  83. package/dist/src/components/TkxProgress.d.ts +0 -1
  84. package/dist/src/components/TkxQRCode.d.ts +0 -1
  85. package/dist/src/components/TkxQuantumForm.d.ts +0 -1
  86. package/dist/src/components/TkxRadio.d.ts +0 -1
  87. package/dist/src/components/TkxRating.d.ts +0 -1
  88. package/dist/src/components/TkxRealTimeChart.d.ts +0 -1
  89. package/dist/src/components/TkxResult.d.ts +0 -1
  90. package/dist/src/components/TkxRichTextDisplay.d.ts +0 -1
  91. package/dist/src/components/TkxSegmented.d.ts +0 -1
  92. package/dist/src/components/TkxSelect.d.ts +0 -3
  93. package/dist/src/components/TkxSkeleton.d.ts +0 -1
  94. package/dist/src/components/TkxSlider.d.ts +0 -1
  95. package/dist/src/components/TkxSnackbar.d.ts +0 -1
  96. package/dist/src/components/TkxSpeedDial.d.ts +0 -1
  97. package/dist/src/components/TkxSpin.d.ts +0 -1
  98. package/dist/src/components/TkxStatistic.d.ts +0 -1
  99. package/dist/src/components/TkxStepper.d.ts +0 -1
  100. package/dist/src/components/TkxTable.d.ts +0 -1
  101. package/dist/src/components/TkxTabs.d.ts +0 -1
  102. package/dist/src/components/TkxTag.d.ts +0 -1
  103. package/dist/src/components/TkxThemeBuilder.d.ts +0 -1
  104. package/dist/src/components/TkxTimeline.d.ts +0 -1
  105. package/dist/src/components/TkxToast.d.ts +0 -1
  106. package/dist/src/components/TkxToggle.d.ts +0 -1
  107. package/dist/src/components/TkxToolbar.d.ts +0 -1
  108. package/dist/src/components/TkxTooltip.d.ts +0 -1
  109. package/dist/src/components/TkxTour.d.ts +0 -1
  110. package/dist/src/components/TkxTransferList.d.ts +0 -1
  111. package/dist/src/components/TkxTreeView.d.ts +0 -1
  112. package/dist/src/components/TkxTypography.d.ts +0 -1
  113. package/dist/src/components/TkxVideoPlayer.d.ts +0 -1
  114. package/dist/src/components/TkxWatermark.d.ts +0 -1
  115. package/dist/src/components/index.d.ts +1 -1
  116. package/dist/src/engine/css.d.ts +0 -1
  117. package/dist/src/engine/index.d.ts +0 -1
  118. package/dist/src/engine/quantum-ai.d.ts +0 -73
  119. package/dist/src/engine/quantum.d.ts +0 -1
  120. package/dist/src/engine/security.d.ts +0 -9
  121. package/dist/src/engine/tkx.d.ts +0 -53
  122. package/dist/src/engine/wcag.d.ts +0 -1
  123. package/dist/src/headless/index.d.ts +0 -1
  124. package/dist/src/headless/useControllable.d.ts +0 -15
  125. package/dist/src/headless/useDebounce.d.ts +0 -12
  126. package/dist/src/headless/useDisclosure.d.ts +0 -13
  127. package/dist/src/headless/useFormState.d.ts +0 -13
  128. package/dist/src/headless/useInfiniteQuery.d.ts +0 -11
  129. package/dist/src/headless/useIntersectionObserver.d.ts +0 -10
  130. package/dist/src/headless/useListSelection.d.ts +0 -9
  131. package/dist/src/headless/useLocalStorage.d.ts +0 -8
  132. package/dist/src/headless/useMediaQuery.d.ts +0 -10
  133. package/dist/src/headless/useRovingTabIndex.d.ts +0 -15
  134. package/dist/src/headless/useSSE.d.ts +0 -9
  135. package/dist/src/headless/useThrottle.d.ts +0 -7
  136. package/dist/src/headless/useWebSocket.d.ts +0 -9
  137. package/dist/src/hooks/index.d.ts +0 -1
  138. package/dist/src/i18n/I18nProvider.d.ts +0 -1
  139. package/dist/src/i18n/index.d.ts +0 -1
  140. package/dist/src/quantum/index.d.ts +0 -1
  141. package/dist/src/realtime/index.d.ts +0 -1
  142. package/dist/src/themes/index.d.ts +0 -1
  143. package/package.json +5 -3
  144. package/dist/TkxForm-BaO4wvXt.js +0 -320
  145. package/dist/TkxForm-M6ttomry.cjs +0 -12
  146. package/dist/chunk-Bmb41Sf3.cjs +0 -1
  147. package/dist/hooks-6pRsPOyG.js +0 -58
  148. package/dist/hooks-mivgRljH.cjs +0 -1
  149. package/dist/index.d.ts.map +0 -1
  150. package/dist/src/a11y/index.d.ts.map +0 -1
  151. package/dist/src/charts/TkxAreaChart.d.ts.map +0 -1
  152. package/dist/src/charts/TkxBarChart.d.ts.map +0 -1
  153. package/dist/src/charts/TkxDonutChart.d.ts.map +0 -1
  154. package/dist/src/charts/TkxLineChart.d.ts.map +0 -1
  155. package/dist/src/charts/TkxPieChart.d.ts.map +0 -1
  156. package/dist/src/charts/TkxRadarChart.d.ts.map +0 -1
  157. package/dist/src/charts/TkxScatterChart.d.ts.map +0 -1
  158. package/dist/src/charts/index.d.ts.map +0 -1
  159. package/dist/src/charts/shared.d.ts.map +0 -1
  160. package/dist/src/components/TkxAIChatBubble.d.ts.map +0 -1
  161. package/dist/src/components/TkxAIConfidenceBar.d.ts.map +0 -1
  162. package/dist/src/components/TkxAIThinking.d.ts.map +0 -1
  163. package/dist/src/components/TkxAccordion.d.ts.map +0 -1
  164. package/dist/src/components/TkxAffix.d.ts.map +0 -1
  165. package/dist/src/components/TkxAlert.d.ts.map +0 -1
  166. package/dist/src/components/TkxAnchor.d.ts.map +0 -1
  167. package/dist/src/components/TkxAppBar.d.ts.map +0 -1
  168. package/dist/src/components/TkxAutocomplete.d.ts.map +0 -1
  169. package/dist/src/components/TkxAvatar.d.ts.map +0 -1
  170. package/dist/src/components/TkxBadge.d.ts.map +0 -1
  171. package/dist/src/components/TkxBottomNav.d.ts.map +0 -1
  172. package/dist/src/components/TkxBreadcrumb.d.ts.map +0 -1
  173. package/dist/src/components/TkxButton.d.ts.map +0 -1
  174. package/dist/src/components/TkxCard.d.ts.map +0 -1
  175. package/dist/src/components/TkxCarousel.d.ts.map +0 -1
  176. package/dist/src/components/TkxCascader.d.ts.map +0 -1
  177. package/dist/src/components/TkxChat.d.ts.map +0 -1
  178. package/dist/src/components/TkxCheckbox.d.ts.map +0 -1
  179. package/dist/src/components/TkxClock.d.ts.map +0 -1
  180. package/dist/src/components/TkxColorPicker.d.ts.map +0 -1
  181. package/dist/src/components/TkxCommand.d.ts.map +0 -1
  182. package/dist/src/components/TkxConfigProvider.d.ts.map +0 -1
  183. package/dist/src/components/TkxDataGrid.d.ts.map +0 -1
  184. package/dist/src/components/TkxDatePicker.d.ts.map +0 -1
  185. package/dist/src/components/TkxDivider.d.ts.map +0 -1
  186. package/dist/src/components/TkxDrawer.d.ts.map +0 -1
  187. package/dist/src/components/TkxDropdown.d.ts.map +0 -1
  188. package/dist/src/components/TkxEmpty.d.ts.map +0 -1
  189. package/dist/src/components/TkxFileUpload.d.ts.map +0 -1
  190. package/dist/src/components/TkxForm.d.ts.map +0 -1
  191. package/dist/src/components/TkxIcon.d.ts.map +0 -1
  192. package/dist/src/components/TkxImage.d.ts.map +0 -1
  193. package/dist/src/components/TkxInput.d.ts.map +0 -1
  194. package/dist/src/components/TkxLayout.d.ts.map +0 -1
  195. package/dist/src/components/TkxList.d.ts.map +0 -1
  196. package/dist/src/components/TkxLiveFeed.d.ts.map +0 -1
  197. package/dist/src/components/TkxLiveLog.d.ts.map +0 -1
  198. package/dist/src/components/TkxLiveMetrics.d.ts.map +0 -1
  199. package/dist/src/components/TkxLogo.d.ts.map +0 -1
  200. package/dist/src/components/TkxMasonry.d.ts.map +0 -1
  201. package/dist/src/components/TkxMentions.d.ts.map +0 -1
  202. package/dist/src/components/TkxMenu.d.ts.map +0 -1
  203. package/dist/src/components/TkxModal.d.ts.map +0 -1
  204. package/dist/src/components/TkxNumberInput.d.ts.map +0 -1
  205. package/dist/src/components/TkxOTP.d.ts.map +0 -1
  206. package/dist/src/components/TkxPagination.d.ts.map +0 -1
  207. package/dist/src/components/TkxPlayground.d.ts.map +0 -1
  208. package/dist/src/components/TkxPopover.d.ts.map +0 -1
  209. package/dist/src/components/TkxProgress.d.ts.map +0 -1
  210. package/dist/src/components/TkxQRCode.d.ts.map +0 -1
  211. package/dist/src/components/TkxQuantumForm.d.ts.map +0 -1
  212. package/dist/src/components/TkxRadio.d.ts.map +0 -1
  213. package/dist/src/components/TkxRating.d.ts.map +0 -1
  214. package/dist/src/components/TkxRealTimeChart.d.ts.map +0 -1
  215. package/dist/src/components/TkxResult.d.ts.map +0 -1
  216. package/dist/src/components/TkxRichTextDisplay.d.ts.map +0 -1
  217. package/dist/src/components/TkxSegmented.d.ts.map +0 -1
  218. package/dist/src/components/TkxSelect.d.ts.map +0 -1
  219. package/dist/src/components/TkxSkeleton.d.ts.map +0 -1
  220. package/dist/src/components/TkxSlider.d.ts.map +0 -1
  221. package/dist/src/components/TkxSnackbar.d.ts.map +0 -1
  222. package/dist/src/components/TkxSpeedDial.d.ts.map +0 -1
  223. package/dist/src/components/TkxSpin.d.ts.map +0 -1
  224. package/dist/src/components/TkxStatistic.d.ts.map +0 -1
  225. package/dist/src/components/TkxStepper.d.ts.map +0 -1
  226. package/dist/src/components/TkxTable.d.ts.map +0 -1
  227. package/dist/src/components/TkxTabs.d.ts.map +0 -1
  228. package/dist/src/components/TkxTag.d.ts.map +0 -1
  229. package/dist/src/components/TkxThemeBuilder.d.ts.map +0 -1
  230. package/dist/src/components/TkxTimeline.d.ts.map +0 -1
  231. package/dist/src/components/TkxToast.d.ts.map +0 -1
  232. package/dist/src/components/TkxToggle.d.ts.map +0 -1
  233. package/dist/src/components/TkxToolbar.d.ts.map +0 -1
  234. package/dist/src/components/TkxTooltip.d.ts.map +0 -1
  235. package/dist/src/components/TkxTour.d.ts.map +0 -1
  236. package/dist/src/components/TkxTransferList.d.ts.map +0 -1
  237. package/dist/src/components/TkxTreeView.d.ts.map +0 -1
  238. package/dist/src/components/TkxTypography.d.ts.map +0 -1
  239. package/dist/src/components/TkxVideoPlayer.d.ts.map +0 -1
  240. package/dist/src/components/TkxWatermark.d.ts.map +0 -1
  241. package/dist/src/components/index.d.ts.map +0 -1
  242. package/dist/src/engine/css.d.ts.map +0 -1
  243. package/dist/src/engine/index.d.ts.map +0 -1
  244. package/dist/src/engine/quantum-ai.d.ts.map +0 -1
  245. package/dist/src/engine/quantum.d.ts.map +0 -1
  246. package/dist/src/engine/security.d.ts.map +0 -1
  247. package/dist/src/engine/tkx.d.ts.map +0 -1
  248. package/dist/src/engine/wcag.d.ts.map +0 -1
  249. package/dist/src/headless/index.d.ts.map +0 -1
  250. package/dist/src/headless/useControllable.d.ts.map +0 -1
  251. package/dist/src/headless/useDebounce.d.ts.map +0 -1
  252. package/dist/src/headless/useDisclosure.d.ts.map +0 -1
  253. package/dist/src/headless/useFormState.d.ts.map +0 -1
  254. package/dist/src/headless/useInfiniteQuery.d.ts.map +0 -1
  255. package/dist/src/headless/useIntersectionObserver.d.ts.map +0 -1
  256. package/dist/src/headless/useListSelection.d.ts.map +0 -1
  257. package/dist/src/headless/useLocalStorage.d.ts.map +0 -1
  258. package/dist/src/headless/useMediaQuery.d.ts.map +0 -1
  259. package/dist/src/headless/useRovingTabIndex.d.ts.map +0 -1
  260. package/dist/src/headless/useSSE.d.ts.map +0 -1
  261. package/dist/src/headless/useThrottle.d.ts.map +0 -1
  262. package/dist/src/headless/useWebSocket.d.ts.map +0 -1
  263. package/dist/src/hooks/index.d.ts.map +0 -1
  264. package/dist/src/i18n/I18nProvider.d.ts.map +0 -1
  265. package/dist/src/i18n/index.d.ts.map +0 -1
  266. package/dist/src/quantum/index.d.ts.map +0 -1
  267. package/dist/src/realtime/index.d.ts.map +0 -1
  268. package/dist/src/themes/index.d.ts.map +0 -1
  269. package/dist/themes-BbJanqiC.js +0 -498
  270. package/dist/themes-CMq2vWXj.cjs +0 -2
  271. package/dist/tkx-BoP5V5zy.cjs +0 -4
  272. package/dist/tkx-mOKMzvUK.js +0 -1174
  273. package/src/a11y/index.tsx +0 -87
  274. package/src/charts/TkxAreaChart.tsx +0 -121
  275. package/src/charts/TkxBarChart.tsx +0 -117
  276. package/src/charts/TkxDonutChart.tsx +0 -164
  277. package/src/charts/TkxLineChart.tsx +0 -137
  278. package/src/charts/TkxPieChart.tsx +0 -103
  279. package/src/charts/TkxRadarChart.tsx +0 -92
  280. package/src/charts/TkxScatterChart.tsx +0 -104
  281. package/src/charts/index.ts +0 -22
  282. package/src/charts/shared.ts +0 -47
  283. package/src/components/TkxAIChatBubble.tsx +0 -256
  284. package/src/components/TkxAIConfidenceBar.tsx +0 -133
  285. package/src/components/TkxAIThinking.tsx +0 -193
  286. package/src/components/TkxAccordion.tsx +0 -590
  287. package/src/components/TkxAffix.tsx +0 -140
  288. package/src/components/TkxAlert.tsx +0 -94
  289. package/src/components/TkxAnchor.tsx +0 -195
  290. package/src/components/TkxAppBar.tsx +0 -262
  291. package/src/components/TkxAutocomplete.tsx +0 -455
  292. package/src/components/TkxAvatar.tsx +0 -103
  293. package/src/components/TkxBadge.tsx +0 -75
  294. package/src/components/TkxBottomNav.tsx +0 -241
  295. package/src/components/TkxBreadcrumb.tsx +0 -324
  296. package/src/components/TkxButton.tsx +0 -155
  297. package/src/components/TkxCard.tsx +0 -96
  298. package/src/components/TkxCarousel.tsx +0 -554
  299. package/src/components/TkxCascader.tsx +0 -278
  300. package/src/components/TkxChat.tsx +0 -356
  301. package/src/components/TkxCheckbox.tsx +0 -220
  302. package/src/components/TkxClock.tsx +0 -603
  303. package/src/components/TkxColorPicker.tsx +0 -635
  304. package/src/components/TkxCommand.tsx +0 -646
  305. package/src/components/TkxConfigProvider.tsx +0 -460
  306. package/src/components/TkxDataGrid.tsx +0 -941
  307. package/src/components/TkxDatePicker.tsx +0 -1625
  308. package/src/components/TkxDivider.tsx +0 -51
  309. package/src/components/TkxDrawer.tsx +0 -236
  310. package/src/components/TkxDropdown.tsx +0 -804
  311. package/src/components/TkxEmpty.tsx +0 -221
  312. package/src/components/TkxFileUpload.tsx +0 -373
  313. package/src/components/TkxForm.tsx +0 -683
  314. package/src/components/TkxIcon.tsx +0 -685
  315. package/src/components/TkxImage.tsx +0 -279
  316. package/src/components/TkxInput.tsx +0 -103
  317. package/src/components/TkxLayout.tsx +0 -649
  318. package/src/components/TkxList.tsx +0 -244
  319. package/src/components/TkxLiveFeed.tsx +0 -331
  320. package/src/components/TkxLiveLog.tsx +0 -472
  321. package/src/components/TkxLiveMetrics.tsx +0 -315
  322. package/src/components/TkxLogo.tsx +0 -299
  323. package/src/components/TkxMasonry.tsx +0 -178
  324. package/src/components/TkxMentions.tsx +0 -212
  325. package/src/components/TkxMenu.tsx +0 -1044
  326. package/src/components/TkxModal.tsx +0 -122
  327. package/src/components/TkxNumberInput.tsx +0 -410
  328. package/src/components/TkxOTP.tsx +0 -297
  329. package/src/components/TkxPagination.tsx +0 -390
  330. package/src/components/TkxPlayground.tsx +0 -845
  331. package/src/components/TkxPopover.tsx +0 -297
  332. package/src/components/TkxProgress.tsx +0 -114
  333. package/src/components/TkxQRCode.tsx +0 -176
  334. package/src/components/TkxQuantumForm.tsx +0 -594
  335. package/src/components/TkxRadio.tsx +0 -286
  336. package/src/components/TkxRating.tsx +0 -288
  337. package/src/components/TkxRealTimeChart.tsx +0 -383
  338. package/src/components/TkxResult.tsx +0 -130
  339. package/src/components/TkxRichTextDisplay.tsx +0 -396
  340. package/src/components/TkxSegmented.tsx +0 -171
  341. package/src/components/TkxSelect.tsx +0 -1130
  342. package/src/components/TkxSkeleton.tsx +0 -107
  343. package/src/components/TkxSlider.tsx +0 -495
  344. package/src/components/TkxSnackbar.tsx +0 -316
  345. package/src/components/TkxSpeedDial.tsx +0 -397
  346. package/src/components/TkxSpin.tsx +0 -263
  347. package/src/components/TkxStatistic.tsx +0 -263
  348. package/src/components/TkxStepper.tsx +0 -487
  349. package/src/components/TkxTable.tsx +0 -424
  350. package/src/components/TkxTabs.tsx +0 -126
  351. package/src/components/TkxTag.tsx +0 -321
  352. package/src/components/TkxThemeBuilder.tsx +0 -687
  353. package/src/components/TkxTimeline.tsx +0 -305
  354. package/src/components/TkxToast.tsx +0 -287
  355. package/src/components/TkxToggle.tsx +0 -95
  356. package/src/components/TkxToolbar.tsx +0 -262
  357. package/src/components/TkxTooltip.tsx +0 -85
  358. package/src/components/TkxTour.tsx +0 -241
  359. package/src/components/TkxTransferList.tsx +0 -489
  360. package/src/components/TkxTreeView.tsx +0 -423
  361. package/src/components/TkxTypography.tsx +0 -267
  362. package/src/components/TkxVideoPlayer.tsx +0 -1015
  363. package/src/components/TkxWatermark.tsx +0 -145
  364. package/src/components/index.ts +0 -79
  365. package/src/engine/css.ts +0 -126
  366. package/src/engine/index.ts +0 -12
  367. package/src/engine/quantum-ai.ts +0 -1045
  368. package/src/engine/quantum.ts +0 -207
  369. package/src/engine/security.ts +0 -232
  370. package/src/engine/tkx.ts +0 -1084
  371. package/src/engine/wcag.ts +0 -276
  372. package/src/headless/index.ts +0 -52
  373. package/src/headless/useControllable.ts +0 -42
  374. package/src/headless/useDebounce.ts +0 -37
  375. package/src/headless/useDisclosure.ts +0 -30
  376. package/src/headless/useFormState.ts +0 -113
  377. package/src/headless/useInfiniteQuery.ts +0 -155
  378. package/src/headless/useIntersectionObserver.ts +0 -53
  379. package/src/headless/useListSelection.ts +0 -103
  380. package/src/headless/useLocalStorage.ts +0 -48
  381. package/src/headless/useMediaQuery.ts +0 -39
  382. package/src/headless/useRovingTabIndex.ts +0 -86
  383. package/src/headless/useSSE.ts +0 -167
  384. package/src/headless/useThrottle.ts +0 -48
  385. package/src/headless/useWebSocket.ts +0 -231
  386. package/src/hooks/index.ts +0 -122
  387. package/src/i18n/I18nProvider.tsx +0 -36
  388. package/src/i18n/index.ts +0 -877
  389. package/src/quantum/index.ts +0 -39
  390. package/src/realtime/index.ts +0 -21
  391. package/src/styles/global.css +0 -167
  392. package/src/themes/index.ts +0 -294
@@ -1,305 +0,0 @@
1
- 'use client';
2
-
3
- import { useEffect, useRef, type ReactNode } from 'react';
4
- import { useTheme } from '../themes';
5
- import { tkx, cx } from '../engine/tkx';
6
- import { sanitizeString } from '../engine/security';
7
- import { useReducedMotion } from '../hooks';
8
-
9
- // ── Types ─────────────────────────────────────────────────────────────────────
10
-
11
- export type TimelineVariant = 'default' | 'compact' | 'alternating';
12
- export type TimelineItemStatus = 'completed' | 'active' | 'pending' | 'error';
13
-
14
- export interface TimelineItem {
15
- id: string;
16
- title: ReactNode;
17
- description?: ReactNode;
18
- timestamp?: string;
19
- status?: TimelineItemStatus;
20
- icon?: ReactNode;
21
- badge?: ReactNode;
22
- }
23
-
24
- export interface TkxTimelineProps {
25
- items: TimelineItem[];
26
- variant?: TimelineVariant;
27
- orientation?: 'vertical' | 'horizontal';
28
- connectorStyle?: 'solid' | 'dashed' | 'dotted';
29
- }
30
-
31
- // ── Animation injection ───────────────────────────────────────────────────────
32
-
33
- let _timelineStyleInjected = false;
34
- function injectTimelineStyles() {
35
- if (_timelineStyleInjected || typeof document === 'undefined') return;
36
- _timelineStyleInjected = true;
37
- const style = document.createElement('style');
38
- style.textContent = `
39
- @keyframes tkx-pulse-dot { 0%,100% { box-shadow:0 0 0 0 currentColor; opacity:1; } 70% { box-shadow:0 0 0 8px transparent; opacity:0.7; } }
40
- @keyframes tkx-draw-line { from { transform:scaleY(0); transform-origin:top center; } to { transform:scaleY(1); } }
41
- @keyframes tkx-draw-line-h { from { transform:scaleX(0); transform-origin:left center; } to { transform:scaleX(1); } }
42
- .tkx-pulse-dot { animation: tkx-pulse-dot 1.5s ease-in-out infinite; }
43
- .tkx-draw-v { animation: tkx-draw-line 0.6s ease forwards; }
44
- .tkx-draw-h { animation: tkx-draw-line-h 0.6s ease forwards; }
45
- `;
46
- document.head.appendChild(style);
47
- }
48
-
49
- // ── Status color helper ───────────────────────────────────────────────────────
50
-
51
- function useStatusColor(status: TimelineItemStatus = 'pending') {
52
- const theme = useTheme();
53
- const map: Record<TimelineItemStatus, string> = {
54
- completed: theme.success,
55
- active: theme.primary,
56
- pending: theme.border,
57
- error: theme.danger,
58
- };
59
- return map[status];
60
- }
61
-
62
- // ── Dot component ─────────────────────────────────────────────────────────────
63
-
64
- function TimelineDot({
65
- status = 'pending',
66
- icon,
67
- size = 28,
68
- }: {
69
- status?: TimelineItemStatus;
70
- icon?: ReactNode;
71
- size?: number;
72
- }) {
73
- const theme = useTheme();
74
- const reducedMotion = useReducedMotion();
75
- const color = useStatusColor(status);
76
- const isActive = status === 'active';
77
-
78
- return (
79
- <div
80
- className={cx(
81
- tkx('relative flex items-center justify-center rounded-full shrink-0 z-10'),
82
- isActive && !reducedMotion ? 'tkx-pulse-dot' : '',
83
- )}
84
- style={{
85
- width: size,
86
- height: size,
87
- backgroundColor: status === 'pending' ? theme.surface : color,
88
- border: `2px solid ${color}`,
89
- color: status === 'pending' ? color : theme.bg,
90
- }}
91
- aria-hidden="true"
92
- >
93
- {icon ? (
94
- <span style={{ fontSize: size * 0.45, lineHeight: 1 }}>{icon}</span>
95
- ) : (
96
- <span
97
- style={{
98
- width: size * 0.35,
99
- height: size * 0.35,
100
- borderRadius: '50%',
101
- backgroundColor: status === 'pending' ? color : theme.bg,
102
- display: 'block',
103
- }}
104
- />
105
- )}
106
- </div>
107
- );
108
- }
109
-
110
- // ── Connector segment ─────────────────────────────────────────────────────────
111
-
112
- function VerticalConnector({
113
- style: lineStyle,
114
- color,
115
- animate,
116
- }: {
117
- style: 'solid' | 'dashed' | 'dotted';
118
- color: string;
119
- animate: boolean;
120
- }) {
121
- const theme = useTheme();
122
- return (
123
- <div
124
- className={cx(tkx('w-0.5 flex-1 min-h-[24px]'), animate ? 'tkx-draw-v' : '')}
125
- style={{
126
- borderLeft: `2px ${lineStyle} ${color}`,
127
- backgroundColor: 'transparent',
128
- alignSelf: 'stretch',
129
- borderColor: color,
130
- marginLeft: 1,
131
- }}
132
- aria-hidden="true"
133
- />
134
- );
135
- }
136
-
137
- function HorizontalConnector({
138
- style: lineStyle,
139
- color,
140
- animate,
141
- }: {
142
- style: 'solid' | 'dashed' | 'dotted';
143
- color: string;
144
- animate: boolean;
145
- }) {
146
- return (
147
- <div
148
- className={cx(tkx('h-0.5 flex-1 min-w-[24px]'), animate ? 'tkx-draw-h' : '')}
149
- style={{
150
- borderTop: `2px ${lineStyle} ${color}`,
151
- borderColor: color,
152
- }}
153
- aria-hidden="true"
154
- />
155
- );
156
- }
157
-
158
- // ── Item content block ────────────────────────────────────────────────────────
159
-
160
- function ItemContent({
161
- item,
162
- compact,
163
- }: {
164
- item: TimelineItem;
165
- compact: boolean;
166
- }) {
167
- const theme = useTheme();
168
- const safeTimestamp = item.timestamp ? sanitizeString(item.timestamp) : null;
169
-
170
- return (
171
- <div className={tkx('flex flex-col gap-0.5', compact ? 'pb-3' : 'pb-5')}>
172
- <div className={tkx('flex items-center gap-2 flex-wrap')}>
173
- <span
174
- className={tkx('text-sm font-semibold leading-snug')}
175
- style={{ color: theme.text }}
176
- >
177
- {typeof item.title === 'string' ? sanitizeString(item.title) : item.title}
178
- </span>
179
- {item.badge && (
180
- <span>{item.badge}</span>
181
- )}
182
- {safeTimestamp && (
183
- <span className={tkx('text-[11px] ml-auto')} style={{ color: theme.textMuted }}>
184
- {safeTimestamp}
185
- </span>
186
- )}
187
- </div>
188
- {item.description && !compact && (
189
- <div className={tkx('text-xs leading-relaxed mt-0.5')} style={{ color: theme.textMuted }}>
190
- {typeof item.description === 'string' ? sanitizeString(item.description) : item.description}
191
- </div>
192
- )}
193
- </div>
194
- );
195
- }
196
-
197
- // ── Main TkxTimeline ──────────────────────────────────────────────────────────
198
-
199
- export function TkxTimeline({
200
- items,
201
- variant = 'default',
202
- orientation = 'vertical',
203
- connectorStyle = 'solid',
204
- }: TkxTimelineProps) {
205
- const theme = useTheme();
206
- const reducedMotion = useReducedMotion();
207
- const mounted = useRef(false);
208
-
209
- useEffect(() => {
210
- injectTimelineStyles();
211
- mounted.current = true;
212
- }, []);
213
-
214
- const animate = !reducedMotion;
215
- const isCompact = variant === 'compact';
216
- const isAlternating = variant === 'alternating' && orientation === 'vertical';
217
- const isHorizontal = orientation === 'horizontal';
218
-
219
- if (isHorizontal) {
220
- return (
221
- <div role="list" aria-label="Timeline" className={tkx('flex items-start w-full overflow-x-auto')}>
222
- {items.map((item, idx) => {
223
- const status = item.status ?? 'pending';
224
- const connColor = status === 'completed' ? theme.success : theme.border;
225
- const isLast = idx === items.length - 1;
226
-
227
- return (
228
- <div key={item.id} role="listitem" className={tkx('flex items-start flex-1 min-w-0')}>
229
- <div className={tkx('flex flex-col items-center flex-1 min-w-0')}>
230
- <div className={tkx('flex items-center w-full')}>
231
- {idx > 0 && (
232
- <HorizontalConnector style={connectorStyle} color={connColor} animate={animate} />
233
- )}
234
- <TimelineDot status={status} icon={item.icon} size={24} />
235
- {!isLast && (
236
- <HorizontalConnector style={connectorStyle} color={connColor} animate={animate} />
237
- )}
238
- </div>
239
- <div className={tkx('mt-2 px-1 text-center min-w-0 w-full')}>
240
- <div className={tkx('text-xs font-semibold truncate')} style={{ color: theme.text }}>
241
- {typeof item.title === 'string' ? sanitizeString(item.title) : item.title}
242
- </div>
243
- {item.timestamp && (
244
- <div className={tkx('text-[10px] mt-0.5')} style={{ color: theme.textMuted }}>
245
- {sanitizeString(item.timestamp)}
246
- </div>
247
- )}
248
- </div>
249
- </div>
250
- </div>
251
- );
252
- })}
253
- </div>
254
- );
255
- }
256
-
257
- // Vertical layouts
258
- return (
259
- <div role="list" aria-label="Timeline" className={tkx('flex flex-col')}>
260
- {items.map((item, idx) => {
261
- const status = item.status ?? 'pending';
262
- const isLast = idx === items.length - 1;
263
- const connColor = status === 'completed' ? theme.success : theme.border;
264
- const isRight = isAlternating && idx % 2 === 0;
265
-
266
- if (isAlternating) {
267
- return (
268
- <div key={item.id} role="listitem" className={tkx('flex items-stretch gap-0')}>
269
- {/* Left content (even indexes) */}
270
- <div className={tkx('flex-1 flex flex-col items-end pr-4', !isRight ? 'invisible' : '')}>
271
- {isRight && <ItemContent item={item} compact={isCompact} />}
272
- </div>
273
- {/* Center axis */}
274
- <div className={tkx('flex flex-col items-center')}>
275
- <TimelineDot status={status} icon={item.icon} size={28} />
276
- {!isLast && (
277
- <VerticalConnector style={connectorStyle} color={connColor} animate={animate} />
278
- )}
279
- </div>
280
- {/* Right content (odd indexes) */}
281
- <div className={tkx('flex-1 flex flex-col items-start pl-4', isRight ? 'invisible' : '')}>
282
- {!isRight && <ItemContent item={item} compact={isCompact} />}
283
- </div>
284
- </div>
285
- );
286
- }
287
-
288
- // Default / compact — left-side connector
289
- return (
290
- <div key={item.id} role="listitem" className={tkx('flex gap-3 items-stretch')}>
291
- <div className={tkx('flex flex-col items-center')}>
292
- <TimelineDot status={status} icon={item.icon} size={isCompact ? 22 : 28} />
293
- {!isLast && (
294
- <VerticalConnector style={connectorStyle} color={connColor} animate={animate} />
295
- )}
296
- </div>
297
- <div className={tkx('flex-1 min-w-0 pt-0.5')}>
298
- <ItemContent item={item} compact={isCompact} />
299
- </div>
300
- </div>
301
- );
302
- })}
303
- </div>
304
- );
305
- }
@@ -1,287 +0,0 @@
1
- 'use client';
2
-
3
- import {
4
- useState,
5
- useEffect,
6
- useCallback,
7
- useRef,
8
- useId,
9
- type ReactNode,
10
- } from 'react';
11
- import { createPortal } from 'react-dom';
12
- import { useTheme } from '../themes';
13
- import { sanitizeString } from '../engine/security';
14
- import { useReducedMotion } from '../hooks';
15
- import { tkx } from '../engine/tkx';
16
-
17
- // ── Types ─────────────────────────────────────────────────────────────────────
18
-
19
- export type ToastVariant = 'default' | 'success' | 'danger' | 'warning' | 'info';
20
- export type ToastPosition = 'top-right' | 'top-left' | 'top-center' | 'bottom-right' | 'bottom-left' | 'bottom-center';
21
-
22
- export interface ToastItem {
23
- id: string;
24
- title?: string;
25
- description?: string;
26
- variant?: ToastVariant;
27
- duration?: number;
28
- action?: { label: string; onClick: () => void };
29
- }
30
-
31
- export interface TkxToastProps {
32
- position?: ToastPosition;
33
- children?: React.ReactNode;
34
- }
35
-
36
- // ── Module-level store ────────────────────────────────────────────────────────
37
-
38
- type Listener = (toasts: ToastItem[]) => void;
39
-
40
- const MAX_VISIBLE = 5;
41
- let queue: ToastItem[] = [];
42
- let visible: ToastItem[] = [];
43
- const listeners = new Set<Listener>();
44
- const timers = new Map<string, ReturnType<typeof setTimeout>>();
45
-
46
- function notify() {
47
- const snapshot = [...visible];
48
- listeners.forEach((fn) => fn(snapshot));
49
- }
50
-
51
- function scheduleRemove(id: string, duration: number) {
52
- if (duration === 0) return;
53
- timers.set(id, setTimeout(() => removeToast(id), duration));
54
- }
55
-
56
- function removeToast(id: string) {
57
- clearTimeout(timers.get(id));
58
- timers.delete(id);
59
- const wasVisible = visible.some((t) => t.id === id);
60
- visible = visible.filter((t) => t.id !== id);
61
- queue = queue.filter((t) => t.id !== id);
62
- if (wasVisible && queue.length > 0 && visible.length < MAX_VISIBLE) {
63
- const next = queue.shift()!;
64
- visible = [...visible, next];
65
- scheduleRemove(next.id, next.duration ?? 4000);
66
- }
67
- notify();
68
- }
69
-
70
- function addToast(item: Omit<ToastItem, 'id'>): string {
71
- const id = `tkx-toast-${Date.now()}-${Math.random().toString(36).slice(2, 7)}`;
72
- const toast: ToastItem = { ...item, id, duration: item.duration ?? 4000 };
73
- if (visible.length < MAX_VISIBLE) {
74
- visible = [...visible, toast];
75
- scheduleRemove(id, toast.duration!);
76
- } else {
77
- queue = [...queue, toast];
78
- }
79
- notify();
80
- return id;
81
- }
82
-
83
- function dismissAll() {
84
- timers.forEach((t) => clearTimeout(t));
85
- timers.clear();
86
- visible = [];
87
- queue = [];
88
- notify();
89
- }
90
-
91
- // ── Hook ──────────────────────────────────────────────────────────────────────
92
-
93
- export function useToast() {
94
- const toast = useCallback((item: Omit<ToastItem, 'id'>) => addToast(item), []);
95
- const dismiss = useCallback((id: string) => removeToast(id), []);
96
- const dismissAllToasts = useCallback(() => dismissAll(), []);
97
- return { toast, dismiss, dismissAll: dismissAllToasts };
98
- }
99
-
100
- // ── Variant config ────────────────────────────────────────────────────────────
101
-
102
- const VARIANT_ICONS: Record<ToastVariant, ReactNode> = {
103
- default: (
104
- <svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
105
- <path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" />
106
- </svg>
107
- ),
108
- success: (
109
- <svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
110
- <path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm-2 14.5l-4-4 1.41-1.41L10 13.67l6.59-6.59L18 8.5l-8 8z" />
111
- </svg>
112
- ),
113
- danger: (
114
- <svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
115
- <path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z" />
116
- </svg>
117
- ),
118
- warning: (
119
- <svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
120
- <path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z" />
121
- </svg>
122
- ),
123
- info: (
124
- <svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
125
- <path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" />
126
- </svg>
127
- ),
128
- };
129
-
130
- // ── Position styles ───────────────────────────────────────────────────────────
131
-
132
- const POSITION_STYLES: Record<ToastPosition, React.CSSProperties> = {
133
- 'top-right': { top: 16, right: 16, alignItems: 'flex-end' },
134
- 'top-left': { top: 16, left: 16, alignItems: 'flex-start' },
135
- 'top-center': { top: 16, left: '50%', transform: 'translateX(-50%)', alignItems: 'center' },
136
- 'bottom-right': { bottom: 16, right: 16, alignItems: 'flex-end' },
137
- 'bottom-left': { bottom: 16, left: 16, alignItems: 'flex-start' },
138
- 'bottom-center':{ bottom: 16, left: '50%', transform: 'translateX(-50%)', alignItems: 'center' },
139
- };
140
-
141
- function slideInStyle(position: ToastPosition, reduced: boolean): React.CSSProperties {
142
- if (reduced) return {};
143
- const isTop = position.startsWith('top');
144
- return {
145
- animation: `tkx-toast-slide-${isTop ? 'down' : 'up'} 220ms cubic-bezier(0.16,1,0.3,1) both`,
146
- };
147
- }
148
-
149
- // ── Single toast card ─────────────────────────────────────────────────────────
150
-
151
- interface ToastCardProps {
152
- toast: ToastItem;
153
- position: ToastPosition;
154
- onDismiss: (id: string) => void;
155
- reduced: boolean;
156
- }
157
-
158
- function ToastCard({ toast, position, onDismiss, reduced }: ToastCardProps) {
159
- const theme = useTheme();
160
- const labelId = useId();
161
-
162
- const variantColorMap: Record<ToastVariant, string> = {
163
- default: theme.textMuted,
164
- success: theme.success,
165
- danger: theme.danger,
166
- warning: theme.warning,
167
- info: theme.info,
168
- };
169
-
170
- const variant = toast.variant ?? 'default';
171
- const accentColor = variantColorMap[variant];
172
- const isDanger = variant === 'danger';
173
- const safeTitle = toast.title ? sanitizeString(toast.title) : undefined;
174
- const safeDesc = toast.description ? sanitizeString(toast.description) : undefined;
175
-
176
- return (
177
- <div
178
- role={isDanger ? 'alert' : 'status'}
179
- aria-live={isDanger ? 'assertive' : 'polite'}
180
- aria-atomic="true"
181
- aria-labelledby={safeTitle ? labelId : undefined}
182
- className={tkx('flex items-start gap-3 px-4 py-3 rounded-lg shadow-lg font-sans min-w-[280px] max-w-[380px]')}
183
- style={{
184
- backgroundColor: theme.surface,
185
- border: `1px solid ${accentColor}55`,
186
- boxShadow: `0 8px 24px ${theme.bg}cc`,
187
- color: theme.text,
188
- ...slideInStyle(position, reduced),
189
- }}
190
- >
191
- <span className={tkx('shrink-0 mt-[2px]')} style={{ color: accentColor }}>
192
- {VARIANT_ICONS[variant]}
193
- </span>
194
-
195
- <div className={tkx('flex-1 min-w-0')}>
196
- {safeTitle && (
197
- <p id={labelId} className={tkx('m-0 font-semibold text-sm leading-snug')}>
198
- {safeTitle}
199
- </p>
200
- )}
201
- {safeDesc && (
202
- <p className={tkx('m-0 text-xs mt-[2px] leading-relaxed')} style={{ color: theme.textMuted }}>
203
- {safeDesc}
204
- </p>
205
- )}
206
- {toast.action && (
207
- <button
208
- onClick={() => { toast.action!.onClick(); onDismiss(toast.id); }}
209
- className={tkx('border-none bg-transparent cursor-pointer p-0 mt-2 text-xs font-semibold focus-visible:focus-ring')}
210
- style={{ color: accentColor }}
211
- >
212
- {sanitizeString(toast.action.label)}
213
- </button>
214
- )}
215
- </div>
216
-
217
- <button
218
- aria-label="Dismiss notification"
219
- onClick={() => onDismiss(toast.id)}
220
- className={tkx('bg-transparent border-none cursor-pointer rounded p-[2px] shrink-0 flex items-center justify-center focus-visible:focus-ring')}
221
- style={{ color: theme.textMuted }}
222
- >
223
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={2.5} aria-hidden="true">
224
- <line x1="18" y1="6" x2="6" y2="18" /><line x1="6" y1="6" x2="18" y2="18" />
225
- </svg>
226
- </button>
227
- </div>
228
- );
229
- }
230
-
231
- // ── Provider ──────────────────────────────────────────────────────────────────
232
-
233
- export function TkxToastProvider({ position = 'top-right', children }: TkxToastProps) {
234
- const [toasts, setToasts] = useState<ToastItem[]>([...visible]);
235
- const reduced = useReducedMotion();
236
-
237
- useEffect(() => {
238
- setToasts([...visible]);
239
- const handler: Listener = (next) => setToasts([...next]);
240
- listeners.add(handler);
241
- return () => { listeners.delete(handler); };
242
- }, []);
243
-
244
- const isBottom = position.startsWith('bottom');
245
- const posStyle = POSITION_STYLES[position];
246
-
247
- // Inject keyframes once
248
- const injectedRef = useRef(false);
249
- useEffect(() => {
250
- if (injectedRef.current || typeof document === 'undefined') return;
251
- injectedRef.current = true;
252
- if (!document.getElementById('tkx-toast-kf')) {
253
- const style = document.createElement('style');
254
- style.id = 'tkx-toast-kf';
255
- style.textContent = `
256
- @keyframes tkx-toast-slide-down {
257
- from { opacity: 0; transform: translateY(-16px); }
258
- to { opacity: 1; transform: translateY(0); }
259
- }
260
- @keyframes tkx-toast-slide-up {
261
- from { opacity: 0; transform: translateY(16px); }
262
- to { opacity: 1; transform: translateY(0); }
263
- }
264
- `;
265
- document.head.appendChild(style);
266
- }
267
- }, []);
268
-
269
- if (typeof document === 'undefined') return <>{children}</>;
270
-
271
- const ordered = isBottom ? [...toasts].reverse() : toasts;
272
-
273
- return <>{children}{createPortal(
274
- <div
275
- aria-label="Notifications"
276
- className={tkx('fixed z-[9999] flex flex-col gap-2 pointer-events-none')}
277
- style={posStyle}
278
- >
279
- {ordered.map((t) => (
280
- <div key={t.id} className={tkx('pointer-events-auto')}>
281
- <ToastCard toast={t} position={position} onDismiss={removeToast} reduced={reduced} />
282
- </div>
283
- ))}
284
- </div>,
285
- document.body,
286
- )}</>;
287
- }
@@ -1,95 +0,0 @@
1
- 'use client';
2
-
3
- import { forwardRef, useId, type ButtonHTMLAttributes } from 'react';
4
- import { useTheme } from '../themes';
5
- import { useReducedMotion } from '../hooks';
6
- import { validateProps } from '../engine/security';
7
- import { tkx, cx } from '../engine/tkx';
8
-
9
- export type ToggleSize = 'sm' | 'md' | 'lg';
10
-
11
- export interface TkxToggleProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'> {
12
- checked: boolean;
13
- onChange: (checked: boolean) => void;
14
- label: string;
15
- size?: ToggleSize;
16
- hideLabel?: boolean;
17
- }
18
-
19
- const SIZES: Record<ToggleSize, { tw: number; th: number; td: number; gap: number }> = {
20
- sm: { tw: 28, th: 16, td: 10, gap: 3 },
21
- md: { tw: 40, th: 22, td: 14, gap: 4 },
22
- lg: { tw: 52, th: 28, td: 18, gap: 5 },
23
- };
24
-
25
- export const TkxToggle = forwardRef<HTMLButtonElement, TkxToggleProps>(
26
- ({ checked, onChange, label, size = 'md', hideLabel, disabled, className, style, ...rest }, ref) => {
27
- const theme = useTheme();
28
- const reducedMotion = useReducedMotion();
29
- const id = useId();
30
-
31
- validateProps(
32
- { label, checked },
33
- { label: { type: 'string', required: true }, checked: { type: 'boolean', required: true } },
34
- );
35
-
36
- const { tw, th, td, gap } = SIZES[size];
37
- const thumbOffset = checked ? tw - td - gap : gap;
38
- const trackBg = checked ? theme.primary : theme.border;
39
-
40
- return (
41
- <div
42
- className={cx(tkx('inline-flex items-center gap-2', disabled ? 'opacity-50' : ''), className)}
43
- style={style}
44
- >
45
- {!hideLabel && (
46
- <label
47
- htmlFor={id}
48
- className={tkx('text-sm font-sans', disabled ? 'cursor-not-allowed' : 'cursor-pointer', 'select-none')}
49
- style={{ color: theme.text }}
50
- >
51
- {label}
52
- </label>
53
- )}
54
- <button
55
- ref={ref}
56
- id={id}
57
- role="switch"
58
- aria-checked={checked}
59
- aria-label={hideLabel ? label : undefined}
60
- disabled={disabled}
61
- onClick={() => !disabled && onChange(!checked)}
62
- onKeyDown={(e) => {
63
- if ((e.key === 'Enter' || e.key === ' ') && !disabled) {
64
- e.preventDefault();
65
- onChange(!checked);
66
- }
67
- }}
68
- className={cx(
69
- tkx('relative border-none p-0 outline-none shrink-0 focus-visible:focus-ring',
70
- disabled ? 'cursor-not-allowed' : 'cursor-pointer',
71
- !reducedMotion && 'transition-colors duration-200',
72
- ),
73
- )}
74
- style={{ width: tw, height: th, borderRadius: th, backgroundColor: trackBg }}
75
- {...rest}
76
- >
77
- <span
78
- aria-hidden="true"
79
- className={tkx('absolute rounded-full')}
80
- style={{
81
- top: '50%', left: thumbOffset,
82
- width: td, height: td,
83
- transform: 'translateY(-50%)',
84
- backgroundColor: '#ffffff',
85
- boxShadow: '0 1px 3px rgba(0,0,0,0.3)',
86
- transition: reducedMotion ? 'none' : 'left 200ms ease',
87
- }}
88
- />
89
- </button>
90
- </div>
91
- );
92
- },
93
- );
94
-
95
- TkxToggle.displayName = 'TkxToggle';