@tokis/react 1.0.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.
Files changed (354) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +50 -0
  3. package/dist/cjs/components/accordion/index.js +36 -0
  4. package/dist/cjs/components/alert/index.js +14 -0
  5. package/dist/cjs/components/app-bar/index.js +9 -0
  6. package/dist/cjs/components/avatar/index.js +64 -0
  7. package/dist/cjs/components/badge/index.js +6 -0
  8. package/dist/cjs/components/bottom-nav/index.js +12 -0
  9. package/dist/cjs/components/breadcrumbs/index.js +19 -0
  10. package/dist/cjs/components/button/ButtonIcon.js +9 -0
  11. package/dist/cjs/components/button/ButtonLabel.js +9 -0
  12. package/dist/cjs/components/button/ButtonRoot.js +23 -0
  13. package/dist/cjs/components/button/index.js +11 -0
  14. package/dist/cjs/components/button/useButton.js +14 -0
  15. package/dist/cjs/components/card/index.js +25 -0
  16. package/dist/cjs/components/charts/index.js +214 -0
  17. package/dist/cjs/components/checkbox/index.js +18 -0
  18. package/dist/cjs/components/chip/index.js +6 -0
  19. package/dist/cjs/components/circular-progress/index.js +28 -0
  20. package/dist/cjs/components/codeblock/CodeBlock.js +35 -0
  21. package/dist/cjs/components/codeblock/index.js +5 -0
  22. package/dist/cjs/components/command-palette/index.js +84 -0
  23. package/dist/cjs/components/confirm-dialog/index.js +10 -0
  24. package/dist/cjs/components/context-menu/index.js +82 -0
  25. package/dist/cjs/components/dialog/index.js +43 -0
  26. package/dist/cjs/components/divider/index.js +6 -0
  27. package/dist/cjs/components/drawer/index.js +37 -0
  28. package/dist/cjs/components/dropdown/index.js +104 -0
  29. package/dist/cjs/components/emptystate/index.js +9 -0
  30. package/dist/cjs/components/extended/index.js +329 -0
  31. package/dist/cjs/components/hover-card/index.js +107 -0
  32. package/dist/cjs/components/infinite-scroll/index.js +21 -0
  33. package/dist/cjs/components/input/index.js +27 -0
  34. package/dist/cjs/components/layout/index.js +34 -0
  35. package/dist/cjs/components/link/index.js +7 -0
  36. package/dist/cjs/components/list/index.js +14 -0
  37. package/dist/cjs/components/menu/index.js +120 -0
  38. package/dist/cjs/components/nav-rail/index.js +12 -0
  39. package/dist/cjs/components/pagination/index.js +46 -0
  40. package/dist/cjs/components/popover/index.js +114 -0
  41. package/dist/cjs/components/portal/index.js +10 -0
  42. package/dist/cjs/components/progress/index.js +21 -0
  43. package/dist/cjs/components/radio/index.js +60 -0
  44. package/dist/cjs/components/result/index.js +25 -0
  45. package/dist/cjs/components/search-field/index.js +30 -0
  46. package/dist/cjs/components/select/index.js +88 -0
  47. package/dist/cjs/components/skeleton/index.js +6 -0
  48. package/dist/cjs/components/slider/index.js +73 -0
  49. package/dist/cjs/components/snackbar/index.js +41 -0
  50. package/dist/cjs/components/spinner/index.js +6 -0
  51. package/dist/cjs/components/statistic/index.js +17 -0
  52. package/dist/cjs/components/stepper/index.js +24 -0
  53. package/dist/cjs/components/switch/index.js +19 -0
  54. package/dist/cjs/components/table/index.js +26 -0
  55. package/dist/cjs/components/tabs/index.js +44 -0
  56. package/dist/cjs/components/tag/index.js +6 -0
  57. package/dist/cjs/components/timeline/index.js +12 -0
  58. package/dist/cjs/components/toggle/index.js +32 -0
  59. package/dist/cjs/components/tooltip/index.js +116 -0
  60. package/dist/cjs/components/treeview/index.js +89 -0
  61. package/dist/cjs/components/typography/index.js +20 -0
  62. package/dist/cjs/components/virtual-list/index.js +25 -0
  63. package/dist/cjs/context/ConfigProvider.js +22 -0
  64. package/dist/cjs/context/ThemeContext.js +25 -0
  65. package/dist/cjs/hooks/useControllableState.js +31 -0
  66. package/dist/cjs/hooks/useDialog.js +35 -0
  67. package/dist/cjs/hooks/useId.js +13 -0
  68. package/dist/cjs/hooks/useMenu.js +64 -0
  69. package/dist/cjs/hooks/usePopover.js +32 -0
  70. package/dist/cjs/hooks/useTabs.js +51 -0
  71. package/dist/cjs/index.js +102 -0
  72. package/dist/cjs/package.json +3 -0
  73. package/dist/cjs/utils/cn.js +10 -0
  74. package/dist/components/accordion/index.d.ts +19 -0
  75. package/dist/components/accordion/index.d.ts.map +1 -0
  76. package/dist/components/accordion/index.js +34 -0
  77. package/dist/components/accordion/index.js.map +1 -0
  78. package/dist/components/alert/index.d.ts +11 -0
  79. package/dist/components/alert/index.d.ts.map +1 -0
  80. package/dist/components/alert/index.js +12 -0
  81. package/dist/components/alert/index.js.map +1 -0
  82. package/dist/components/app-bar/index.d.ts +17 -0
  83. package/dist/components/app-bar/index.d.ts.map +1 -0
  84. package/dist/components/app-bar/index.js +7 -0
  85. package/dist/components/app-bar/index.js.map +1 -0
  86. package/dist/components/avatar/index.d.ts +33 -0
  87. package/dist/components/avatar/index.d.ts.map +1 -0
  88. package/dist/components/avatar/index.js +28 -0
  89. package/dist/components/avatar/index.js.map +1 -0
  90. package/dist/components/badge/index.d.ts +3 -0
  91. package/dist/components/badge/index.d.ts.map +1 -0
  92. package/dist/components/badge/index.js +3 -0
  93. package/dist/components/badge/index.js.map +1 -0
  94. package/dist/components/bottom-nav/index.d.ts +18 -0
  95. package/dist/components/bottom-nav/index.d.ts.map +1 -0
  96. package/dist/components/bottom-nav/index.js +10 -0
  97. package/dist/components/bottom-nav/index.js.map +1 -0
  98. package/dist/components/breadcrumbs/index.d.ts +19 -0
  99. package/dist/components/breadcrumbs/index.d.ts.map +1 -0
  100. package/dist/components/breadcrumbs/index.js +17 -0
  101. package/dist/components/breadcrumbs/index.js.map +1 -0
  102. package/dist/components/button/ButtonIcon.d.ts +8 -0
  103. package/dist/components/button/ButtonIcon.d.ts.map +1 -0
  104. package/dist/components/button/ButtonIcon.js +6 -0
  105. package/dist/components/button/ButtonIcon.js.map +1 -0
  106. package/dist/components/button/ButtonLabel.d.ts +6 -0
  107. package/dist/components/button/ButtonLabel.d.ts.map +1 -0
  108. package/dist/components/button/ButtonLabel.js +6 -0
  109. package/dist/components/button/ButtonLabel.js.map +1 -0
  110. package/dist/components/button/ButtonRoot.d.ts +15 -0
  111. package/dist/components/button/ButtonRoot.d.ts.map +1 -0
  112. package/dist/components/button/ButtonRoot.js +21 -0
  113. package/dist/components/button/ButtonRoot.js.map +1 -0
  114. package/dist/components/button/index.d.ts +9 -0
  115. package/dist/components/button/index.d.ts.map +1 -0
  116. package/dist/components/button/index.js +5 -0
  117. package/dist/components/button/index.js.map +1 -0
  118. package/dist/components/button/useButton.d.ts +16 -0
  119. package/dist/components/button/useButton.d.ts.map +1 -0
  120. package/dist/components/button/useButton.js +12 -0
  121. package/dist/components/button/useButton.js.map +1 -0
  122. package/dist/components/card/index.d.ts +17 -0
  123. package/dist/components/card/index.d.ts.map +1 -0
  124. package/dist/components/card/index.js +23 -0
  125. package/dist/components/card/index.js.map +1 -0
  126. package/dist/components/charts/index.d.ts +60 -0
  127. package/dist/components/charts/index.d.ts.map +1 -0
  128. package/dist/components/charts/index.js +209 -0
  129. package/dist/components/charts/index.js.map +1 -0
  130. package/dist/components/checkbox/index.d.ts +17 -0
  131. package/dist/components/checkbox/index.d.ts.map +1 -0
  132. package/dist/components/checkbox/index.js +16 -0
  133. package/dist/components/checkbox/index.js.map +1 -0
  134. package/dist/components/chip/index.d.ts +3 -0
  135. package/dist/components/chip/index.d.ts.map +1 -0
  136. package/dist/components/chip/index.js +3 -0
  137. package/dist/components/chip/index.js.map +1 -0
  138. package/dist/components/circular-progress/index.d.ts +15 -0
  139. package/dist/components/circular-progress/index.d.ts.map +1 -0
  140. package/dist/components/circular-progress/index.js +26 -0
  141. package/dist/components/circular-progress/index.js.map +1 -0
  142. package/dist/components/codeblock/CodeBlock.d.ts +13 -0
  143. package/dist/components/codeblock/CodeBlock.d.ts.map +1 -0
  144. package/dist/components/codeblock/CodeBlock.js +32 -0
  145. package/dist/components/codeblock/CodeBlock.js.map +1 -0
  146. package/dist/components/codeblock/index.d.ts +3 -0
  147. package/dist/components/codeblock/index.d.ts.map +1 -0
  148. package/dist/components/codeblock/index.js +2 -0
  149. package/dist/components/codeblock/index.js.map +1 -0
  150. package/dist/components/command-palette/index.d.ts +22 -0
  151. package/dist/components/command-palette/index.d.ts.map +1 -0
  152. package/dist/components/command-palette/index.js +82 -0
  153. package/dist/components/command-palette/index.js.map +1 -0
  154. package/dist/components/confirm-dialog/index.d.ts +17 -0
  155. package/dist/components/confirm-dialog/index.d.ts.map +1 -0
  156. package/dist/components/confirm-dialog/index.js +8 -0
  157. package/dist/components/confirm-dialog/index.js.map +1 -0
  158. package/dist/components/context-menu/index.d.ts +19 -0
  159. package/dist/components/context-menu/index.d.ts.map +1 -0
  160. package/dist/components/context-menu/index.js +47 -0
  161. package/dist/components/context-menu/index.js.map +1 -0
  162. package/dist/components/dialog/index.d.ts +16 -0
  163. package/dist/components/dialog/index.d.ts.map +1 -0
  164. package/dist/components/dialog/index.js +41 -0
  165. package/dist/components/dialog/index.js.map +1 -0
  166. package/dist/components/divider/index.d.ts +3 -0
  167. package/dist/components/divider/index.d.ts.map +1 -0
  168. package/dist/components/divider/index.js +3 -0
  169. package/dist/components/divider/index.js.map +1 -0
  170. package/dist/components/drawer/index.d.ts +16 -0
  171. package/dist/components/drawer/index.d.ts.map +1 -0
  172. package/dist/components/drawer/index.js +35 -0
  173. package/dist/components/drawer/index.js.map +1 -0
  174. package/dist/components/dropdown/index.d.ts +16 -0
  175. package/dist/components/dropdown/index.d.ts.map +1 -0
  176. package/dist/components/dropdown/index.js +69 -0
  177. package/dist/components/dropdown/index.js.map +1 -0
  178. package/dist/components/emptystate/index.d.ts +13 -0
  179. package/dist/components/emptystate/index.d.ts.map +1 -0
  180. package/dist/components/emptystate/index.js +7 -0
  181. package/dist/components/emptystate/index.js.map +1 -0
  182. package/dist/components/extended/index.d.ts +163 -0
  183. package/dist/components/extended/index.d.ts.map +1 -0
  184. package/dist/components/extended/index.js +267 -0
  185. package/dist/components/extended/index.js.map +1 -0
  186. package/dist/components/hover-card/index.d.ts +14 -0
  187. package/dist/components/hover-card/index.d.ts.map +1 -0
  188. package/dist/components/hover-card/index.js +72 -0
  189. package/dist/components/hover-card/index.js.map +1 -0
  190. package/dist/components/infinite-scroll/index.d.ts +16 -0
  191. package/dist/components/infinite-scroll/index.d.ts.map +1 -0
  192. package/dist/components/infinite-scroll/index.js +19 -0
  193. package/dist/components/infinite-scroll/index.js.map +1 -0
  194. package/dist/components/input/index.d.ts +19 -0
  195. package/dist/components/input/index.d.ts.map +1 -0
  196. package/dist/components/input/index.js +25 -0
  197. package/dist/components/input/index.js.map +1 -0
  198. package/dist/components/layout/index.d.ts +39 -0
  199. package/dist/components/layout/index.d.ts.map +1 -0
  200. package/dist/components/layout/index.js +32 -0
  201. package/dist/components/layout/index.js.map +1 -0
  202. package/dist/components/link/index.d.ts +3 -0
  203. package/dist/components/link/index.d.ts.map +1 -0
  204. package/dist/components/link/index.js +3 -0
  205. package/dist/components/link/index.js.map +1 -0
  206. package/dist/components/list/index.d.ts +13 -0
  207. package/dist/components/list/index.d.ts.map +1 -0
  208. package/dist/components/list/index.js +12 -0
  209. package/dist/components/list/index.js.map +1 -0
  210. package/dist/components/menu/index.d.ts +19 -0
  211. package/dist/components/menu/index.d.ts.map +1 -0
  212. package/dist/components/menu/index.js +85 -0
  213. package/dist/components/menu/index.js.map +1 -0
  214. package/dist/components/nav-rail/index.d.ts +20 -0
  215. package/dist/components/nav-rail/index.d.ts.map +1 -0
  216. package/dist/components/nav-rail/index.js +10 -0
  217. package/dist/components/nav-rail/index.js.map +1 -0
  218. package/dist/components/pagination/index.d.ts +9 -0
  219. package/dist/components/pagination/index.d.ts.map +1 -0
  220. package/dist/components/pagination/index.js +44 -0
  221. package/dist/components/pagination/index.js.map +1 -0
  222. package/dist/components/popover/index.d.ts +16 -0
  223. package/dist/components/popover/index.d.ts.map +1 -0
  224. package/dist/components/popover/index.js +79 -0
  225. package/dist/components/popover/index.js.map +1 -0
  226. package/dist/components/portal/index.d.ts +7 -0
  227. package/dist/components/portal/index.d.ts.map +1 -0
  228. package/dist/components/portal/index.js +8 -0
  229. package/dist/components/portal/index.js.map +1 -0
  230. package/dist/components/progress/index.d.ts +25 -0
  231. package/dist/components/progress/index.d.ts.map +1 -0
  232. package/dist/components/progress/index.js +19 -0
  233. package/dist/components/progress/index.js.map +1 -0
  234. package/dist/components/radio/index.d.ts +25 -0
  235. package/dist/components/radio/index.d.ts.map +1 -0
  236. package/dist/components/radio/index.js +24 -0
  237. package/dist/components/radio/index.js.map +1 -0
  238. package/dist/components/result/index.d.ts +14 -0
  239. package/dist/components/result/index.d.ts.map +1 -0
  240. package/dist/components/result/index.js +23 -0
  241. package/dist/components/result/index.js.map +1 -0
  242. package/dist/components/search-field/index.d.ts +15 -0
  243. package/dist/components/search-field/index.d.ts.map +1 -0
  244. package/dist/components/search-field/index.js +28 -0
  245. package/dist/components/search-field/index.js.map +1 -0
  246. package/dist/components/select/index.d.ts +23 -0
  247. package/dist/components/select/index.d.ts.map +1 -0
  248. package/dist/components/select/index.js +86 -0
  249. package/dist/components/select/index.js.map +1 -0
  250. package/dist/components/skeleton/index.d.ts +3 -0
  251. package/dist/components/skeleton/index.d.ts.map +1 -0
  252. package/dist/components/skeleton/index.js +3 -0
  253. package/dist/components/skeleton/index.js.map +1 -0
  254. package/dist/components/slider/index.d.ts +18 -0
  255. package/dist/components/slider/index.d.ts.map +1 -0
  256. package/dist/components/slider/index.js +71 -0
  257. package/dist/components/slider/index.js.map +1 -0
  258. package/dist/components/snackbar/index.d.ts +27 -0
  259. package/dist/components/snackbar/index.d.ts.map +1 -0
  260. package/dist/components/snackbar/index.js +38 -0
  261. package/dist/components/snackbar/index.js.map +1 -0
  262. package/dist/components/spinner/index.d.ts +3 -0
  263. package/dist/components/spinner/index.d.ts.map +1 -0
  264. package/dist/components/spinner/index.js +3 -0
  265. package/dist/components/spinner/index.js.map +1 -0
  266. package/dist/components/statistic/index.d.ts +13 -0
  267. package/dist/components/statistic/index.d.ts.map +1 -0
  268. package/dist/components/statistic/index.js +15 -0
  269. package/dist/components/statistic/index.js.map +1 -0
  270. package/dist/components/stepper/index.d.ts +17 -0
  271. package/dist/components/stepper/index.d.ts.map +1 -0
  272. package/dist/components/stepper/index.js +22 -0
  273. package/dist/components/stepper/index.js.map +1 -0
  274. package/dist/components/switch/index.d.ts +16 -0
  275. package/dist/components/switch/index.d.ts.map +1 -0
  276. package/dist/components/switch/index.js +17 -0
  277. package/dist/components/switch/index.js.map +1 -0
  278. package/dist/components/table/index.d.ts +17 -0
  279. package/dist/components/table/index.d.ts.map +1 -0
  280. package/dist/components/table/index.js +24 -0
  281. package/dist/components/table/index.js.map +1 -0
  282. package/dist/components/tabs/index.d.ts +19 -0
  283. package/dist/components/tabs/index.d.ts.map +1 -0
  284. package/dist/components/tabs/index.js +42 -0
  285. package/dist/components/tabs/index.js.map +1 -0
  286. package/dist/components/tag/index.d.ts +3 -0
  287. package/dist/components/tag/index.d.ts.map +1 -0
  288. package/dist/components/tag/index.js +3 -0
  289. package/dist/components/tag/index.js.map +1 -0
  290. package/dist/components/timeline/index.d.ts +16 -0
  291. package/dist/components/timeline/index.d.ts.map +1 -0
  292. package/dist/components/timeline/index.js +10 -0
  293. package/dist/components/timeline/index.js.map +1 -0
  294. package/dist/components/toggle/index.d.ts +32 -0
  295. package/dist/components/toggle/index.d.ts.map +1 -0
  296. package/dist/components/toggle/index.js +29 -0
  297. package/dist/components/toggle/index.js.map +1 -0
  298. package/dist/components/tooltip/index.d.ts +11 -0
  299. package/dist/components/tooltip/index.d.ts.map +1 -0
  300. package/dist/components/tooltip/index.js +81 -0
  301. package/dist/components/tooltip/index.js.map +1 -0
  302. package/dist/components/treeview/index.d.ts +19 -0
  303. package/dist/components/treeview/index.d.ts.map +1 -0
  304. package/dist/components/treeview/index.js +87 -0
  305. package/dist/components/treeview/index.js.map +1 -0
  306. package/dist/components/typography/index.d.ts +11 -0
  307. package/dist/components/typography/index.d.ts.map +1 -0
  308. package/dist/components/typography/index.js +18 -0
  309. package/dist/components/typography/index.js.map +1 -0
  310. package/dist/components/virtual-list/index.d.ts +15 -0
  311. package/dist/components/virtual-list/index.d.ts.map +1 -0
  312. package/dist/components/virtual-list/index.js +23 -0
  313. package/dist/components/virtual-list/index.js.map +1 -0
  314. package/dist/context/ConfigProvider.d.ts +12 -0
  315. package/dist/context/ConfigProvider.d.ts.map +1 -0
  316. package/dist/context/ConfigProvider.js +18 -0
  317. package/dist/context/ConfigProvider.js.map +1 -0
  318. package/dist/context/ThemeContext.d.ts +15 -0
  319. package/dist/context/ThemeContext.d.ts.map +1 -0
  320. package/dist/context/ThemeContext.js +21 -0
  321. package/dist/context/ThemeContext.js.map +1 -0
  322. package/dist/hooks/useControllableState.d.ts +10 -0
  323. package/dist/hooks/useControllableState.d.ts.map +1 -0
  324. package/dist/hooks/useControllableState.js +29 -0
  325. package/dist/hooks/useControllableState.js.map +1 -0
  326. package/dist/hooks/useDialog.d.ts +24 -0
  327. package/dist/hooks/useDialog.d.ts.map +1 -0
  328. package/dist/hooks/useDialog.js +33 -0
  329. package/dist/hooks/useDialog.js.map +1 -0
  330. package/dist/hooks/useId.d.ts +7 -0
  331. package/dist/hooks/useId.d.ts.map +1 -0
  332. package/dist/hooks/useId.js +11 -0
  333. package/dist/hooks/useId.js.map +1 -0
  334. package/dist/hooks/useMenu.d.ts +21 -0
  335. package/dist/hooks/useMenu.d.ts.map +1 -0
  336. package/dist/hooks/useMenu.js +62 -0
  337. package/dist/hooks/useMenu.js.map +1 -0
  338. package/dist/hooks/usePopover.d.ts +22 -0
  339. package/dist/hooks/usePopover.d.ts.map +1 -0
  340. package/dist/hooks/usePopover.js +30 -0
  341. package/dist/hooks/usePopover.js.map +1 -0
  342. package/dist/hooks/useTabs.d.ts +22 -0
  343. package/dist/hooks/useTabs.d.ts.map +1 -0
  344. package/dist/hooks/useTabs.js +49 -0
  345. package/dist/hooks/useTabs.js.map +1 -0
  346. package/dist/index.d.ts +65 -0
  347. package/dist/index.d.ts.map +1 -0
  348. package/dist/index.js +85 -0
  349. package/dist/index.js.map +1 -0
  350. package/dist/utils/cn.d.ts +6 -0
  351. package/dist/utils/cn.d.ts.map +1 -0
  352. package/dist/utils/cn.js +8 -0
  353. package/dist/utils/cn.js.map +1 -0
  354. package/package.json +79 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Tokis Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,50 @@
1
+ # /react
2
+
3
+ React adapter for the Tokis design system — composable, accessible components, hooks, and theming context.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install /react /theme
9
+ ```
10
+
11
+ > Or install everything at once: `npm install tokis`
12
+
13
+ ## Usage
14
+
15
+ ```tsx
16
+ import '/theme';
17
+ import { ButtonRoot, ButtonLabel, ThemeProvider } from '/react';
18
+
19
+ function App() {
20
+ return (
21
+ <ThemeProvider>
22
+ <ButtonRoot variant="primary" size="lg">
23
+ <ButtonLabel>Save changes</ButtonLabel>
24
+ </ButtonRoot>
25
+ </ThemeProvider>
26
+ );
27
+ }
28
+ ```
29
+
30
+ ## What's Included
31
+
32
+ - **60+ components** — Button, Dialog, Drawer, Menu, Table, Charts, TreeView, and more
33
+ - **Hooks** — `useTheme`, `useControllableState`, `useDialog`, `usePopover`, `useTabs`, `useMenu`
34
+ - **ThemeProvider** — Light/dark mode with `toggle()` and `setMode()`
35
+ - **Composition** — Compound component patterns (`ButtonRoot` + `ButtonLabel` + `ButtonIcon`)
36
+ - **Full TypeScript** — Exported interfaces for every component and hook
37
+
38
+ ## Peer Dependencies
39
+
40
+ - `react` >= 18.0.0
41
+ - `react-dom` >= 18.0.0
42
+ - `/theme` ^0.1.0
43
+
44
+ ## Documentation
45
+
46
+ Visit [tokis.dev](https://tokis.dev/docs/introduction) for interactive demos and full API reference.
47
+
48
+ ## License
49
+
50
+ MIT
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Accordion = Accordion;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const cn_js_1 = require("../../utils/cn");
7
+ function Accordion({ items, type = 'single', defaultValue, value, onChange, collapsible = true, variant = 'bordered', className }) {
8
+ const normalize = (v) => {
9
+ if (!v)
10
+ return [];
11
+ return Array.isArray(v) ? v : [v];
12
+ };
13
+ const [internal, setInternal] = (0, react_1.useState)(normalize(defaultValue));
14
+ const controlled = value !== undefined;
15
+ const openValues = controlled ? normalize(value) : internal;
16
+ const toggle = (val) => {
17
+ const isOpen = openValues.includes(val);
18
+ let next;
19
+ if (type === 'single') {
20
+ next = isOpen && collapsible ? [] : [val];
21
+ }
22
+ else {
23
+ next = isOpen ? openValues.filter((v) => v !== val) : [...openValues, val];
24
+ }
25
+ if (!controlled)
26
+ setInternal(next);
27
+ onChange?.(type === 'single' ? (next[0] ?? '') : next);
28
+ };
29
+ return ((0, jsx_runtime_1.jsx)("div", { className: (0, cn_js_1.cn)('tokis-accordion-root', variant === 'flush' && 'tokis-accordion-root--flush', className), children: items.map((item) => ((0, jsx_runtime_1.jsx)(AccordionItemComponent, { item: item, isOpen: openValues.includes(item.value), onToggle: toggle }, item.value))) }));
30
+ }
31
+ function AccordionItemComponent({ item, isOpen, onToggle }) {
32
+ const triggerId = (0, react_1.useId)();
33
+ const panelId = (0, react_1.useId)();
34
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "tokis-accordion-item", children: [(0, jsx_runtime_1.jsxs)("button", { id: triggerId, type: "button", "aria-expanded": isOpen, "aria-controls": panelId, "aria-disabled": item.disabled || undefined, disabled: item.disabled, className: "tokis-accordion-trigger", onClick: () => { if (!item.disabled)
35
+ onToggle(item.value); }, children: [(0, jsx_runtime_1.jsx)("span", { style: { flex: 1, textAlign: 'left' }, children: item.trigger }), (0, jsx_runtime_1.jsx)("svg", { className: "tokis-accordion-trigger__icon", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: (0, jsx_runtime_1.jsx)("path", { d: "M4 6l4 4 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })] }), (0, jsx_runtime_1.jsx)("div", { id: panelId, role: "region", "aria-labelledby": triggerId, className: "tokis-accordion-content", "data-open": isOpen ? 'true' : 'false', "aria-hidden": !isOpen, children: (0, jsx_runtime_1.jsx)("div", { className: "tokis-accordion-content-inner", children: item.content }) })] }));
36
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Alert = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const cn_js_1 = require("../../utils/cn");
7
+ const AlertIcons = {
8
+ info: (0, jsx_runtime_1.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "8", cy: "8", r: "7", stroke: "currentColor", strokeWidth: "1.5" }), (0, jsx_runtime_1.jsx)("path", { d: "M8 7v4M8 5.5v.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })] }),
9
+ success: (0, jsx_runtime_1.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "8", cy: "8", r: "7", stroke: "currentColor", strokeWidth: "1.5" }), (0, jsx_runtime_1.jsx)("path", { d: "M5 8l2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] }),
10
+ warning: (0, jsx_runtime_1.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [(0, jsx_runtime_1.jsx)("path", { d: "M8 2L1.5 13h13L8 2z", stroke: "currentColor", strokeWidth: "1.5", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)("path", { d: "M8 7v2.5M8 11v.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })] }),
11
+ error: (0, jsx_runtime_1.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "8", cy: "8", r: "7", stroke: "currentColor", strokeWidth: "1.5" }), (0, jsx_runtime_1.jsx)("path", { d: "M6 6l4 4M10 6l-4 4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })] }),
12
+ };
13
+ exports.Alert = (0, react_1.forwardRef)(({ variant = 'info', title, onClose, icon, action, className, children, ...props }, ref) => ((0, jsx_runtime_1.jsxs)("div", { ref: ref, role: "alert", "aria-live": "polite", className: (0, cn_js_1.cn)('tokis-alert', `tokis-alert--${variant}`, className), ...props, children: [(0, jsx_runtime_1.jsx)("span", { className: "tokis-alert__icon", children: icon ?? AlertIcons[variant] }), (0, jsx_runtime_1.jsxs)("div", { className: "tokis-alert__body", children: [title && (0, jsx_runtime_1.jsx)("div", { className: "tokis-alert__title", children: title }), children && (0, jsx_runtime_1.jsx)("div", { className: "tokis-alert__message", children: children }), action && (0, jsx_runtime_1.jsx)("div", { style: { marginTop: 'var(--tokis-spacing-2)' }, children: action })] }), onClose && ((0, jsx_runtime_1.jsx)("button", { className: "tokis-alert__close", onClick: onClose, "aria-label": "Dismiss", children: (0, jsx_runtime_1.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", children: (0, jsx_runtime_1.jsx)("path", { d: "M2 2l10 10M12 2L2 12", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }) }))] })));
14
+ exports.Alert.displayName = 'Alert';
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AppBar = AppBar;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const cn_js_1 = require("../../utils/cn");
6
+ function AppBar({ leading, title, trailing, variant = 'default', elevation = 'sm', sticky = false, className, }) {
7
+ return ((0, jsx_runtime_1.jsxs)("header", { className: (0, cn_js_1.cn)('tokis-app-bar', variant !== 'default' && `tokis-app-bar--${variant}`, elevation !== 'none' && `tokis-app-bar--elevation-${elevation}`, sticky && 'tokis-app-bar--sticky', className), children: [leading && (0, jsx_runtime_1.jsx)("div", { className: "tokis-app-bar__leading", children: leading }), title && (0, jsx_runtime_1.jsx)("div", { className: "tokis-app-bar__title", children: title }), trailing && (0, jsx_runtime_1.jsx)("div", { className: "tokis-app-bar__trailing", children: trailing })] }));
8
+ }
9
+ AppBar.displayName = 'AppBar';
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Chip = exports.Badge = exports.Avatar = void 0;
37
+ exports.AvatarGroup = AvatarGroup;
38
+ const jsx_runtime_1 = require("react/jsx-runtime");
39
+ const react_1 = __importStar(require("react"));
40
+ const cn_js_1 = require("../../utils/cn");
41
+ function getInitials(name) {
42
+ return name.split(' ').slice(0, 2).map((p) => p[0]).join('').toUpperCase();
43
+ }
44
+ exports.Avatar = (0, react_1.forwardRef)(({ src, alt, name, size = 'md', shape = 'circle', className }, ref) => ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: (0, cn_js_1.cn)('tokis-avatar', `tokis-avatar--${size}`, shape === 'square' && 'tokis-avatar--square', className), "aria-label": name ?? alt, role: name ? 'img' : undefined, children: src ? (0, jsx_runtime_1.jsx)("img", { src: src, alt: alt ?? name ?? '' }) : name ? getInitials(name) : null })));
45
+ exports.Avatar.displayName = 'Avatar';
46
+ function AvatarGroup({ children, max, size = 'md', className }) {
47
+ const items = react_1.default.Children.toArray(children);
48
+ const visible = max ? items.slice(0, max) : items;
49
+ const overflow = max && items.length > max ? items.length - max : 0;
50
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, cn_js_1.cn)('tokis-avatar-group', className), children: [visible, overflow > 0 && ((0, jsx_runtime_1.jsxs)("div", { className: (0, cn_js_1.cn)('tokis-avatar', `tokis-avatar--${size}`), "aria-label": `${overflow} more`, children: ["+", overflow] }))] }));
51
+ }
52
+ exports.Badge = (0, react_1.forwardRef)(({ variant = 'default', dot = false, className, children, ...props }, ref) => ((0, jsx_runtime_1.jsx)("span", { ref: ref, className: (0, cn_js_1.cn)('tokis-badge', `tokis-badge--${variant}`, dot && 'tokis-badge--dot', className), ...props, children: children })));
53
+ exports.Badge.displayName = 'Badge';
54
+ exports.Chip = (0, react_1.forwardRef)(({ selected = false, onDelete, disabled = false, icon, className, children, onClick, ...props }, ref) => ((0, jsx_runtime_1.jsxs)("div", { ref: ref, role: onClick ? 'button' : undefined, tabIndex: onClick && !disabled ? 0 : undefined, "aria-pressed": onClick ? selected : undefined, "aria-disabled": disabled || undefined, className: (0, cn_js_1.cn)('tokis-chip', onClick && 'tokis-chip--clickable', selected && 'tokis-chip--selected', className), onClick: !disabled ? onClick : undefined, onKeyDown: onClick && !disabled ? (e) => { if (e.key === 'Enter' || e.key === ' ') {
55
+ e.preventDefault();
56
+ onClick(e);
57
+ } } : undefined, ...props, children: [icon && (0, jsx_runtime_1.jsx)("span", { "aria-hidden": "true", style: { display: 'inline-flex', alignItems: 'center' }, children: icon }), children, onDelete && ((0, jsx_runtime_1.jsx)("span", { role: "button", tabIndex: 0, className: "tokis-chip__delete", "aria-label": "Remove", onClick: (e) => { e.stopPropagation(); if (!disabled)
58
+ onDelete(); }, onKeyDown: (e) => { if (e.key === 'Enter' || e.key === ' ') {
59
+ e.preventDefault();
60
+ e.stopPropagation();
61
+ if (!disabled)
62
+ onDelete();
63
+ } }, children: (0, jsx_runtime_1.jsx)("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", "aria-hidden": "true", children: (0, jsx_runtime_1.jsx)("path", { d: "M1 1l8 8M9 1L1 9", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }) }))] })));
64
+ exports.Chip.displayName = 'Chip';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Badge = void 0;
4
+ // Re-export Badge from avatar
5
+ var index_js_1 = require("../avatar/index");
6
+ Object.defineProperty(exports, "Badge", { enumerable: true, get: function () { return index_js_1.Badge; } });
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BottomNavigation = BottomNavigation;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const cn_js_1 = require("../../utils/cn");
6
+ function BottomNavigation({ items, value, onChange, className }) {
7
+ return ((0, jsx_runtime_1.jsx)("nav", { className: (0, cn_js_1.cn)('tokis-bottom-nav', className), "aria-label": "Bottom navigation", children: items.map((item) => {
8
+ const isActive = item.value === value;
9
+ return ((0, jsx_runtime_1.jsxs)("button", { className: (0, cn_js_1.cn)('tokis-bottom-nav__item', isActive && 'tokis-bottom-nav__item--active'), onClick: () => onChange(item.value), "aria-current": isActive ? 'page' : undefined, "aria-label": item.label, children: [(0, jsx_runtime_1.jsxs)("span", { className: "tokis-bottom-nav__icon", children: [item.badge !== undefined && ((0, jsx_runtime_1.jsx)("span", { className: "tokis-bottom-nav__badge", "aria-label": `${item.badge} notifications`, children: item.badge })), item.icon] }), (0, jsx_runtime_1.jsx)("span", { className: "tokis-bottom-nav__label", children: item.label })] }, item.value));
10
+ }) }));
11
+ }
12
+ BottomNavigation.displayName = 'BottomNavigation';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Link = exports.Breadcrumbs = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const cn_js_1 = require("../../utils/cn");
7
+ exports.Breadcrumbs = (0, react_1.forwardRef)(({ items, separator = '/', maxItems, className, ...props }, ref) => {
8
+ const visible = maxItems && items.length > maxItems
9
+ ? [items[0], { label: '…', onClick: undefined }, ...items.slice(-(maxItems - 1))]
10
+ : items;
11
+ return ((0, jsx_runtime_1.jsx)("nav", { ref: ref, "aria-label": "Breadcrumb", className: (0, cn_js_1.cn)('tokis-breadcrumbs', className), ...props, children: (0, jsx_runtime_1.jsx)("ol", { style: { display: 'flex', alignItems: 'center', flexWrap: 'wrap', listStyle: 'none', margin: 0, padding: 0 }, children: visible.map((item, i) => {
12
+ const isLast = i === visible.length - 1;
13
+ const isCurrent = item.current || isLast;
14
+ return ((0, jsx_runtime_1.jsxs)("li", { className: (0, cn_js_1.cn)('tokis-breadcrumbs-item', isCurrent && 'tokis-breadcrumbs-item--current'), "aria-current": isCurrent ? 'page' : undefined, children: [item.href ? ((0, jsx_runtime_1.jsx)("a", { href: item.href, className: "tokis-breadcrumbs-link", children: item.label })) : item.onClick ? ((0, jsx_runtime_1.jsx)("button", { className: "tokis-breadcrumbs-link", onClick: item.onClick, style: { background: 'none', border: 'none', padding: 0, font: 'inherit', cursor: 'pointer' }, children: item.label })) : ((0, jsx_runtime_1.jsx)("span", { children: item.label })), !isLast && (0, jsx_runtime_1.jsx)("span", { className: "tokis-breadcrumbs-separator", "aria-hidden": "true", children: separator })] }, i));
15
+ }) }) }));
16
+ });
17
+ exports.Breadcrumbs.displayName = 'Breadcrumbs';
18
+ exports.Link = (0, react_1.forwardRef)(({ external = false, underline = 'hover', className, children, ...props }, ref) => ((0, jsx_runtime_1.jsx)("a", { ref: ref, target: external ? '_blank' : undefined, rel: external ? 'noopener noreferrer' : undefined, className: (0, cn_js_1.cn)('tokis-link', external && 'tokis-link--external', className), ...props, children: children })));
19
+ exports.Link.displayName = 'Link';
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ButtonIcon = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const ButtonIcon = ({ children, 'aria-label': ariaLabel }) => {
6
+ return ((0, jsx_runtime_1.jsx)("span", { className: "button-icon", "aria-hidden": ariaLabel ? undefined : true, "aria-label": ariaLabel, children: children }));
7
+ };
8
+ exports.ButtonIcon = ButtonIcon;
9
+ exports.ButtonIcon.displayName = 'ButtonIcon';
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ButtonLabel = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const ButtonLabel = ({ children }) => {
6
+ return (0, jsx_runtime_1.jsx)("span", { className: "button-label", children: children });
7
+ };
8
+ exports.ButtonLabel = ButtonLabel;
9
+ exports.ButtonLabel.displayName = 'ButtonLabel';
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ButtonRoot = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const cn_js_1 = require("../../utils/cn");
7
+ const useButton_js_1 = require("./useButton");
8
+ exports.ButtonRoot = (0, react_1.forwardRef)(({ as: Component = 'button', variant = 'primary', size = 'md', fullWidth = false, loading = false, iconOnly = false, disabled = false, className, onClick, children, ...props }, ref) => {
9
+ const { state, send } = (0, useButton_js_1.useButton)();
10
+ const id = (0, react_1.useId)();
11
+ const isNativeButton = Component === 'button';
12
+ const isDisabled = disabled || loading;
13
+ const handleClick = (0, react_1.useCallback)((e) => {
14
+ if (isDisabled)
15
+ return;
16
+ send({ type: 'PRESS' });
17
+ // Allow PRESS to register then immediately RELEASE for stateless click semantics
18
+ send({ type: 'RELEASE' });
19
+ onClick?.(e);
20
+ }, [isDisabled, onClick, send]);
21
+ return ((0, jsx_runtime_1.jsxs)(Component, { ref: ref, id: id, disabled: isNativeButton ? isDisabled : undefined, "aria-disabled": !isNativeButton && isDisabled ? true : undefined, "aria-busy": loading || undefined, "data-state": state.value, className: (0, cn_js_1.cn)('tokis-btn', `tokis-btn--${variant}`, size !== 'md' && `tokis-btn--${size}`, fullWidth && 'tokis-btn--full', loading && 'tokis-btn--loading', iconOnly && 'tokis-btn--icon-only', className), onClick: handleClick, ...props, children: [loading && (0, jsx_runtime_1.jsx)("span", { className: "tokis-spinner tokis-spinner--sm tokis-spinner--white", "aria-hidden": "true" }), children] }));
22
+ });
23
+ exports.ButtonRoot.displayName = 'ButtonRoot';
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useButton = exports.ButtonLabel = exports.ButtonIcon = exports.ButtonRoot = void 0;
4
+ var ButtonRoot_js_1 = require("./ButtonRoot");
5
+ Object.defineProperty(exports, "ButtonRoot", { enumerable: true, get: function () { return ButtonRoot_js_1.ButtonRoot; } });
6
+ var ButtonIcon_js_1 = require("./ButtonIcon");
7
+ Object.defineProperty(exports, "ButtonIcon", { enumerable: true, get: function () { return ButtonIcon_js_1.ButtonIcon; } });
8
+ var ButtonLabel_js_1 = require("./ButtonLabel");
9
+ Object.defineProperty(exports, "ButtonLabel", { enumerable: true, get: function () { return ButtonLabel_js_1.ButtonLabel; } });
10
+ var useButton_js_1 = require("./useButton");
11
+ Object.defineProperty(exports, "useButton", { enumerable: true, get: function () { return useButton_js_1.useButton; } });
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useButton = useButton;
4
+ const react_1 = require("react");
5
+ function useButton() {
6
+ const [value, setValue] = (0, react_1.useState)('idle');
7
+ const send = (0, react_1.useCallback)((event) => {
8
+ if (event.type === 'PRESS')
9
+ setValue('pressed');
10
+ else if (event.type === 'RELEASE')
11
+ setValue('idle');
12
+ }, []);
13
+ return { state: { value }, send };
14
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Divider = exports.CardDescription = exports.CardTitle = exports.CardFooter = exports.CardBody = exports.CardHeader = exports.Card = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const cn_js_1 = require("../../utils/cn");
7
+ exports.Card = (0, react_1.forwardRef)(({ variant = 'default', clickable = false, className, children, ...props }, ref) => ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: (0, cn_js_1.cn)('tokis-card', variant !== 'default' && `tokis-card--${variant}`, clickable && 'tokis-card--clickable', className), role: clickable ? 'button' : undefined, tabIndex: clickable ? 0 : undefined, ...props, children: children })));
8
+ exports.Card.displayName = 'Card';
9
+ exports.CardHeader = (0, react_1.forwardRef)(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: (0, cn_js_1.cn)('tokis-card-header', className), ...props })));
10
+ exports.CardHeader.displayName = 'CardHeader';
11
+ exports.CardBody = (0, react_1.forwardRef)(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: (0, cn_js_1.cn)('tokis-card-body', className), ...props })));
12
+ exports.CardBody.displayName = 'CardBody';
13
+ exports.CardFooter = (0, react_1.forwardRef)(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: (0, cn_js_1.cn)('tokis-card-footer', className), ...props })));
14
+ exports.CardFooter.displayName = 'CardFooter';
15
+ exports.CardTitle = (0, react_1.forwardRef)(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)("h3", { ref: ref, className: (0, cn_js_1.cn)('tokis-card-title', className), ...props })));
16
+ exports.CardTitle.displayName = 'CardTitle';
17
+ exports.CardDescription = (0, react_1.forwardRef)(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)("p", { ref: ref, className: (0, cn_js_1.cn)('tokis-card-description', className), ...props })));
18
+ exports.CardDescription.displayName = 'CardDescription';
19
+ exports.Divider = (0, react_1.forwardRef)(({ orientation = 'horizontal', label, className, ...props }, ref) => {
20
+ if (label) {
21
+ return ((0, jsx_runtime_1.jsx)("div", { className: (0, cn_js_1.cn)('tokis-divider tokis-divider--with-text', className), children: (0, jsx_runtime_1.jsx)("span", { className: "tokis-divider__text", children: label }) }));
22
+ }
23
+ return ((0, jsx_runtime_1.jsx)("hr", { ref: ref, role: "separator", "aria-orientation": orientation, className: (0, cn_js_1.cn)('tokis-divider', orientation === 'vertical' && 'tokis-divider--vertical', className), ...props }));
24
+ });
25
+ exports.Divider.displayName = 'Divider';
@@ -0,0 +1,214 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BarChart = BarChart;
4
+ exports.LineChart = LineChart;
5
+ exports.PieChart = PieChart;
6
+ exports.Sparkline = Sparkline;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const react_1 = require("react");
9
+ const cn_js_1 = require("../../utils/cn");
10
+ const DEFAULT_COLORS = [
11
+ 'var(--tokis-color-primary)',
12
+ '#7c3aed',
13
+ '#059669',
14
+ '#d97706',
15
+ '#dc2626',
16
+ '#0284c7',
17
+ '#db2777',
18
+ ];
19
+ function useContainerWidth(ref) {
20
+ const [width, setWidth] = (0, react_1.useState)(300);
21
+ (0, react_1.useEffect)(() => {
22
+ if (!ref.current)
23
+ return;
24
+ const ro = new ResizeObserver(([entry]) => setWidth(entry.contentRect.width));
25
+ ro.observe(ref.current);
26
+ setWidth(ref.current.clientWidth);
27
+ return () => ro.disconnect();
28
+ }, [ref]);
29
+ return width;
30
+ }
31
+ function BarChart({ data, height = 200, barColor, animated = true, horizontal = false, className, }) {
32
+ const containerRef = (0, react_1.useRef)(null);
33
+ const containerWidth = useContainerWidth(containerRef);
34
+ const [mounted, setMounted] = (0, react_1.useState)(false);
35
+ (0, react_1.useEffect)(() => { if (animated)
36
+ setTimeout(() => setMounted(true), 50); }, [animated]);
37
+ const [hoveredBar, setHoveredBar] = (0, react_1.useState)(null);
38
+ const maxVal = Math.max(...data.map((d) => d.value), 1);
39
+ const padding = { top: 8, right: 8, bottom: 32, left: 40 };
40
+ const w = containerWidth;
41
+ const h = height;
42
+ const chartW = w - padding.left - padding.right;
43
+ const chartH = h - padding.top - padding.bottom;
44
+ const barWidth = (chartW / data.length) * 0.6;
45
+ const barGap = (chartW / data.length) * 0.4;
46
+ if (!horizontal) {
47
+ return ((0, jsx_runtime_1.jsx)("div", { ref: containerRef, className: (0, cn_js_1.cn)('tokis-chart tokis-chart--bar', className), children: (0, jsx_runtime_1.jsx)("svg", { width: w, height: h, "aria-label": "Bar chart", onMouseMove: (e) => {
48
+ const svgRect = e.currentTarget.getBoundingClientRect();
49
+ const mouseX = e.clientX - svgRect.left - padding.left;
50
+ const colW = chartW / data.length;
51
+ const idx = Math.floor(mouseX / colW);
52
+ setHoveredBar(idx >= 0 && idx < data.length ? idx : null);
53
+ }, onMouseLeave: () => setHoveredBar(null), children: (0, jsx_runtime_1.jsxs)("g", { transform: `translate(${padding.left},${padding.top})`, children: [[0, 0.25, 0.5, 0.75, 1].map((t) => ((0, jsx_runtime_1.jsxs)("g", { transform: `translate(0,${chartH * (1 - t)})`, children: [(0, jsx_runtime_1.jsx)("line", { x1: -4, x2: chartW, stroke: "var(--tokis-color-border)", strokeWidth: "1" }), (0, jsx_runtime_1.jsx)("text", { x: -8, y: 4, fontSize: "10", fill: "var(--tokis-text-tertiary)", textAnchor: "end", children: Math.round(maxVal * t) })] }, t))), data.map((d, i) => {
54
+ const x = i * (chartW / data.length) + barGap / 2;
55
+ const barH = (d.value / maxVal) * chartH;
56
+ const y = chartH - (mounted || !animated ? barH : 0);
57
+ const color = d.color ?? barColor ?? DEFAULT_COLORS[i % DEFAULT_COLORS.length];
58
+ return ((0, jsx_runtime_1.jsxs)("g", { children: [(0, jsx_runtime_1.jsx)("rect", { x: x, y: y, width: barWidth, height: mounted || !animated ? barH : 0, fill: color, rx: 3, opacity: hoveredBar !== null && hoveredBar !== i ? 0.5 : 1, style: { transition: animated ? 'y 0.6s ease, height 0.6s ease' : undefined } }), (0, jsx_runtime_1.jsx)("text", { x: x + barWidth / 2, y: chartH + 18, fontSize: "10", fill: "var(--tokis-text-secondary)", textAnchor: "middle", children: d.label })] }, i));
59
+ }), hoveredBar !== null && (() => {
60
+ const d = data[hoveredBar];
61
+ const x = hoveredBar * (chartW / data.length) + barGap / 2 + barWidth / 2;
62
+ const barH = (d.value / maxVal) * chartH;
63
+ const tipY = Math.max(4, chartH - (mounted || !animated ? barH : 0) - 28);
64
+ const txt = String(d.value);
65
+ const tw = Math.max(36, txt.length * 7 + 16);
66
+ return ((0, jsx_runtime_1.jsxs)("g", { style: { pointerEvents: 'none' }, children: [(0, jsx_runtime_1.jsx)("rect", { x: x - tw / 2, y: tipY, width: tw, height: 20, rx: 4, fill: "rgba(17,24,39,0.92)" }), (0, jsx_runtime_1.jsx)("text", { x: x, y: tipY + 13, fontSize: "10", textAnchor: "middle", fill: "#fff", fontWeight: "600", children: txt })] }));
67
+ })()] }) }) }));
68
+ }
69
+ // Horizontal
70
+ const barH = (chartH / data.length) * 0.6;
71
+ const barGapH = (chartH / data.length) * 0.4;
72
+ return ((0, jsx_runtime_1.jsx)("div", { ref: containerRef, className: (0, cn_js_1.cn)('tokis-chart tokis-chart--bar', className), children: (0, jsx_runtime_1.jsx)("svg", { width: w, height: h, "aria-label": "Bar chart horizontal", children: (0, jsx_runtime_1.jsx)("g", { transform: `translate(${padding.left},${padding.top})`, children: data.map((d, i) => {
73
+ const y = i * (chartH / data.length) + barGapH / 2;
74
+ const barW = (d.value / maxVal) * chartW;
75
+ const color = d.color ?? barColor ?? DEFAULT_COLORS[i % DEFAULT_COLORS.length];
76
+ return ((0, jsx_runtime_1.jsxs)("g", { children: [(0, jsx_runtime_1.jsx)("text", { x: -8, y: y + barH / 2 + 4, fontSize: "10", fill: "var(--tokis-text-secondary)", textAnchor: "end", children: d.label }), (0, jsx_runtime_1.jsx)("rect", { x: 0, y: y, width: mounted || !animated ? barW : 0, height: barH, fill: color, rx: 3, style: { transition: animated ? 'width 0.6s ease' : undefined } })] }, i));
77
+ }) }) }) }));
78
+ }
79
+ BarChart.displayName = 'BarChart';
80
+ function toPath(points, smooth) {
81
+ if (points.length < 2)
82
+ return '';
83
+ if (!smooth) {
84
+ return points.map((p, i) => `${i === 0 ? 'M' : 'L'}${p.x},${p.y}`).join(' ');
85
+ }
86
+ let d = `M${points[0].x},${points[0].y}`;
87
+ for (let i = 1; i < points.length; i++) {
88
+ const prev = points[i - 1];
89
+ const curr = points[i];
90
+ const cpx = (prev.x + curr.x) / 2;
91
+ d += ` C${cpx},${prev.y} ${cpx},${curr.y} ${curr.x},${curr.y}`;
92
+ }
93
+ return d;
94
+ }
95
+ function LineChart({ labels, datasets, height = 200, smooth = true, animated = true, className, }) {
96
+ const containerRef = (0, react_1.useRef)(null);
97
+ const containerWidth = useContainerWidth(containerRef);
98
+ const [mounted, setMounted] = (0, react_1.useState)(false);
99
+ const [hoveredCol, setHoveredCol] = (0, react_1.useState)(null);
100
+ (0, react_1.useEffect)(() => { if (animated)
101
+ setTimeout(() => setMounted(true), 50); }, [animated]);
102
+ const padding = { top: 12, right: 12, bottom: 32, left: 44 };
103
+ const w = containerWidth;
104
+ const h = height;
105
+ const chartW = w - padding.left - padding.right;
106
+ const chartH = h - padding.top - padding.bottom;
107
+ const allValues = datasets.flatMap((d) => d.data);
108
+ const maxVal = Math.max(...allValues, 1);
109
+ const minVal = Math.min(...allValues, 0);
110
+ const range = maxVal - minVal || 1;
111
+ const toPoint = (val, idx) => ({
112
+ x: (idx / (labels.length - 1 || 1)) * chartW,
113
+ y: chartH - ((val - minVal) / range) * chartH,
114
+ });
115
+ return ((0, jsx_runtime_1.jsxs)("div", { ref: containerRef, className: (0, cn_js_1.cn)('tokis-chart tokis-chart--line', className), children: [(0, jsx_runtime_1.jsx)("svg", { width: w, height: h, "aria-label": "Line chart", onMouseMove: (e) => {
116
+ const svgRect = e.currentTarget.getBoundingClientRect();
117
+ const mouseX = e.clientX - svgRect.left - padding.left;
118
+ const colW = chartW / (labels.length - 1 || 1);
119
+ const idx = Math.round(mouseX / colW);
120
+ setHoveredCol(idx >= 0 && idx < labels.length ? idx : null);
121
+ }, onMouseLeave: () => setHoveredCol(null), children: (0, jsx_runtime_1.jsxs)("g", { transform: `translate(${padding.left},${padding.top})`, children: [[0, 0.25, 0.5, 0.75, 1].map((t) => ((0, jsx_runtime_1.jsxs)("g", { transform: `translate(0,${chartH * (1 - t)})`, children: [(0, jsx_runtime_1.jsx)("line", { x1: 0, x2: chartW, stroke: "var(--tokis-color-border)", strokeWidth: "1" }), (0, jsx_runtime_1.jsx)("text", { x: -8, y: 4, fontSize: "10", fill: "var(--tokis-text-tertiary)", textAnchor: "end", children: Math.round(minVal + range * t) })] }, t))), labels.map((lbl, i) => ((0, jsx_runtime_1.jsx)("text", { x: toPoint(0, i).x, y: chartH + 18, fontSize: "10", fill: "var(--tokis-text-secondary)", textAnchor: "middle", children: lbl }, i))), datasets.map((dataset, di) => {
122
+ const points = dataset.data.map((v, i) => toPoint(v, i));
123
+ const pathD = toPath(points, smooth);
124
+ const color = dataset.color ?? DEFAULT_COLORS[di % DEFAULT_COLORS.length];
125
+ return ((0, jsx_runtime_1.jsxs)("g", { children: [(0, jsx_runtime_1.jsx)("path", { d: pathD, fill: "none", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", style: animated ? { strokeDasharray: 2000, strokeDashoffset: mounted ? 0 : 2000, transition: 'stroke-dashoffset 1s ease' } : undefined }), points.map((p, pi) => ((0, jsx_runtime_1.jsx)("circle", { cx: p.x, cy: p.y, r: 3, fill: color, style: animated ? { opacity: mounted ? 1 : 0, transition: `opacity 0.5s ease ${pi * 0.05}s` } : undefined }, pi)))] }, di));
126
+ }), hoveredCol !== null && (() => {
127
+ const x = toPoint(0, hoveredCol).x;
128
+ const vals = datasets.map((ds) => ({ val: ds.data[hoveredCol], color: ds.color ?? DEFAULT_COLORS[datasets.indexOf(ds) % DEFAULT_COLORS.length], label: ds.label }));
129
+ const firstVal = vals[0];
130
+ if (!firstVal || firstVal.val === undefined)
131
+ return null;
132
+ const y = toPoint(firstVal.val, hoveredCol).y;
133
+ const isMulti = vals.length > 1;
134
+ return ((0, jsx_runtime_1.jsxs)("g", { style: { pointerEvents: 'none' }, children: [(0, jsx_runtime_1.jsx)("line", { x1: x, x2: x, y1: 0, y2: chartH, stroke: "var(--tokis-color-border)", strokeWidth: "1", strokeDasharray: "3,3" }), vals.map(({ val, color }, vi) => {
135
+ if (val === undefined)
136
+ return null;
137
+ const py = toPoint(val, hoveredCol).y;
138
+ return (0, jsx_runtime_1.jsx)("circle", { cx: x, cy: py, r: 4, fill: color, stroke: "#fff", strokeWidth: "1.5" }, vi);
139
+ }), !isMulti && ((() => {
140
+ const txt = String(firstVal.val);
141
+ const tw = Math.max(36, txt.length * 7 + 16);
142
+ const tipX = Math.min(Math.max(x, tw / 2 + 2), chartW - tw / 2 - 2);
143
+ const tipY = Math.max(4, y - 30);
144
+ return ((0, jsx_runtime_1.jsxs)("g", { children: [(0, jsx_runtime_1.jsx)("rect", { x: tipX - tw / 2, y: tipY, width: tw, height: 20, rx: 4, fill: "rgba(17,24,39,0.92)" }), (0, jsx_runtime_1.jsx)("text", { x: tipX, y: tipY + 13, fontSize: "10", textAnchor: "middle", fill: "#fff", fontWeight: "600", children: txt })] }));
145
+ })()), isMulti && ((() => {
146
+ const lines = vals.filter(v => v.val !== undefined);
147
+ const tw = 90;
148
+ const th = lines.length * 16 + 8;
149
+ const tipX = Math.min(Math.max(x + 8, tw / 2 + 2), chartW - tw / 2 - 2);
150
+ const tipY = Math.max(4, Math.min(y - th / 2, chartH - th - 4));
151
+ return ((0, jsx_runtime_1.jsxs)("g", { children: [(0, jsx_runtime_1.jsx)("rect", { x: tipX - tw / 2, y: tipY, width: tw, height: th, rx: 4, fill: "rgba(17,24,39,0.92)" }), lines.map(({ val, color, label }, li) => ((0, jsx_runtime_1.jsxs)("g", { children: [(0, jsx_runtime_1.jsx)("circle", { cx: tipX - tw / 2 + 10, cy: tipY + 12 + li * 16, r: 3, fill: color }), (0, jsx_runtime_1.jsxs)("text", { x: tipX - tw / 2 + 18, y: tipY + 16 + li * 16, fontSize: "10", fill: "#fff", children: [label, ": ", val] })] }, li)))] }));
152
+ })())] }));
153
+ })()] }) }), datasets.length > 1 && ((0, jsx_runtime_1.jsx)("div", { className: "tokis-chart__legend", children: datasets.map((d, i) => ((0, jsx_runtime_1.jsxs)("span", { className: "tokis-chart__legend-item", children: [(0, jsx_runtime_1.jsx)("span", { className: "tokis-chart__legend-dot", style: { background: d.color ?? DEFAULT_COLORS[i % DEFAULT_COLORS.length] } }), d.label] }, i))) }))] }));
154
+ }
155
+ LineChart.displayName = 'LineChart';
156
+ function PieChart({ data, donut = false, size = 200, animated = true, showLegend = true, className, }) {
157
+ const [mounted, setMounted] = (0, react_1.useState)(false);
158
+ (0, react_1.useEffect)(() => { if (animated)
159
+ setTimeout(() => setMounted(true), 50); }, [animated]);
160
+ const [hovered, setHovered] = (0, react_1.useState)(null);
161
+ const total = data.reduce((s, d) => s + d.value, 0) || 1;
162
+ const cx = size / 2;
163
+ const cy = size / 2;
164
+ const r = (size / 2) * 0.78;
165
+ const innerR = donut ? r * 0.55 : 0;
166
+ let cumAngle = -Math.PI / 2;
167
+ const slices = data.map((d, i) => {
168
+ const angle = (d.value / total) * Math.PI * 2;
169
+ const startAngle = cumAngle;
170
+ cumAngle += angle;
171
+ const endAngle = cumAngle;
172
+ const expand = hovered === i ? 6 : 0;
173
+ const midAngle = startAngle + angle / 2;
174
+ const offsetX = expand * Math.cos(midAngle);
175
+ const offsetY = expand * Math.sin(midAngle);
176
+ const x1 = cx + offsetX + r * Math.cos(startAngle);
177
+ const y1 = cy + offsetY + r * Math.sin(startAngle);
178
+ const x2 = cx + offsetX + r * Math.cos(endAngle);
179
+ const y2 = cy + offsetY + r * Math.sin(endAngle);
180
+ const ix1 = cx + offsetX + innerR * Math.cos(endAngle);
181
+ const iy1 = cy + offsetY + innerR * Math.sin(endAngle);
182
+ const ix2 = cx + offsetX + innerR * Math.cos(startAngle);
183
+ const iy2 = cy + offsetY + innerR * Math.sin(startAngle);
184
+ const largeArc = angle > Math.PI ? 1 : 0;
185
+ const pathD = donut
186
+ ? `M${x1},${y1} A${r},${r} 0 ${largeArc},1 ${x2},${y2} L${ix1},${iy1} A${innerR},${innerR} 0 ${largeArc},0 ${ix2},${iy2} Z`
187
+ : `M${cx + offsetX},${cy + offsetY} L${x1},${y1} A${r},${r} 0 ${largeArc},1 ${x2},${y2} Z`;
188
+ return { ...d, pathD, color: d.color ?? DEFAULT_COLORS[i % DEFAULT_COLORS.length] };
189
+ });
190
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, cn_js_1.cn)('tokis-chart tokis-chart--pie', className), children: [(0, jsx_runtime_1.jsx)("svg", { width: size, height: size, "aria-label": "Pie chart", children: slices.map((s, i) => ((0, jsx_runtime_1.jsx)("path", { d: s.pathD, fill: s.color, style: { opacity: mounted || !animated ? 1 : 0, transition: animated ? `opacity 0.4s ease ${i * 0.07}s` : undefined, cursor: 'pointer' }, onMouseEnter: () => setHovered(i), onMouseLeave: () => setHovered(null), children: (0, jsx_runtime_1.jsxs)("title", { children: [s.label, ": ", s.value, " (", ((s.value / total) * 100).toFixed(1), "%)"] }) }, i))) }), showLegend && ((0, jsx_runtime_1.jsx)("div", { className: "tokis-chart__legend", children: slices.map((s, i) => ((0, jsx_runtime_1.jsxs)("span", { className: "tokis-chart__legend-item", children: [(0, jsx_runtime_1.jsx)("span", { className: "tokis-chart__legend-dot", style: { background: s.color } }), s.label] }, i))) }))] }));
191
+ }
192
+ PieChart.displayName = 'PieChart';
193
+ function Sparkline({ data, type = 'line', width = 80, height = 24, color = 'var(--tokis-color-primary)', className, }) {
194
+ if (data.length < 2)
195
+ return (0, jsx_runtime_1.jsx)("span", { className: (0, cn_js_1.cn)('tokis-sparkline', className) });
196
+ const maxVal = Math.max(...data, 1);
197
+ const minVal = Math.min(...data);
198
+ const range = maxVal - minVal || 1;
199
+ const xStep = width / (data.length - 1);
200
+ const toX = (i) => i * xStep;
201
+ const toY = (v) => height - ((v - minVal) / range) * (height - 2) - 1;
202
+ if (type === 'bar') {
203
+ const bw = Math.max(1, (width / data.length) * 0.7);
204
+ return ((0, jsx_runtime_1.jsx)("svg", { width: width, height: height, className: (0, cn_js_1.cn)('tokis-sparkline', className), "aria-hidden": "true", children: data.map((v, i) => {
205
+ const bh = ((v - minVal) / range) * height;
206
+ return (0, jsx_runtime_1.jsx)("rect", { x: i * (width / data.length), y: height - bh, width: bw, height: bh, fill: color, rx: 1 }, i);
207
+ }) }));
208
+ }
209
+ const points = data.map((v, i) => ({ x: toX(i), y: toY(v) }));
210
+ const lineD = points.map((p, i) => `${i === 0 ? 'M' : 'L'}${p.x},${p.y}`).join(' ');
211
+ const areaD = `${lineD} L${points[points.length - 1].x},${height} L${points[0].x},${height} Z`;
212
+ return ((0, jsx_runtime_1.jsxs)("svg", { width: width, height: height, className: (0, cn_js_1.cn)('tokis-sparkline', className), "aria-hidden": "true", children: [type === 'area' && (0, jsx_runtime_1.jsx)("path", { d: areaD, fill: color, opacity: 0.2 }), (0, jsx_runtime_1.jsx)("path", { d: lineD, fill: "none", stroke: color, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] }));
213
+ }
214
+ Sparkline.displayName = 'Sparkline';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Checkbox = Checkbox;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const cn_js_1 = require("../../utils/cn");
7
+ function Checkbox({ label, description, checked, defaultChecked, indeterminate = false, disabled = false, onChange, id, name, value, className, 'aria-label': ariaLabel, }) {
8
+ const autoId = (0, react_1.useId)();
9
+ const inputId = id ?? `checkbox-${autoId}`;
10
+ const descId = description ? `${inputId}-desc` : undefined;
11
+ const inputRef = (0, react_1.useRef)(null);
12
+ (0, react_1.useEffect)(() => {
13
+ if (inputRef.current) {
14
+ inputRef.current.indeterminate = indeterminate;
15
+ }
16
+ }, [indeterminate]);
17
+ return ((0, jsx_runtime_1.jsxs)("label", { className: (0, cn_js_1.cn)('tokis-checkbox-root', className), "data-disabled": disabled || undefined, htmlFor: inputId, children: [(0, jsx_runtime_1.jsx)("input", { ref: inputRef, type: "checkbox", id: inputId, name: name, value: value, checked: checked, defaultChecked: defaultChecked, disabled: disabled, onChange: (e) => onChange?.(e.target.checked), className: "tokis-checkbox-native", "aria-label": !label ? ariaLabel : undefined, "aria-describedby": descId }), (0, jsx_runtime_1.jsx)("span", { "aria-hidden": "true", className: "tokis-checkbox-control", "data-checked": checked && !indeterminate ? 'true' : undefined, "data-indeterminate": indeterminate ? 'true' : undefined }), (label || description) && ((0, jsx_runtime_1.jsxs)("div", { children: [label && (0, jsx_runtime_1.jsx)("span", { className: "tokis-checkbox-label", children: label }), description && (0, jsx_runtime_1.jsx)("p", { id: descId, className: "tokis-checkbox-description", children: description })] }))] }));
18
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Chip = void 0;
4
+ // Re-export Chip from avatar
5
+ var index_js_1 = require("../avatar/index");
6
+ Object.defineProperty(exports, "Chip", { enumerable: true, get: function () { return index_js_1.Chip; } });