@k8ordo/ui 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 (425) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +624 -0
  3. package/dist/components/_internal/focus-ring.d.mts +8 -0
  4. package/dist/components/_internal/focus-ring.mjs +8 -0
  5. package/dist/components/ai/_internal/collapsible.d.mts +13 -0
  6. package/dist/components/ai/_internal/collapsible.mjs +49 -0
  7. package/dist/components/ai/_internal/streaming-cursor.d.mts +5 -0
  8. package/dist/components/ai/_internal/streaming-cursor.mjs +8 -0
  9. package/dist/components/ai/conversation/conversation.d.mts +18 -0
  10. package/dist/components/ai/conversation/conversation.mjs +111 -0
  11. package/dist/components/ai/conversation/index.d.mts +2 -0
  12. package/dist/components/ai/conversation/index.mjs +2 -0
  13. package/dist/components/ai/index.d.mts +14 -0
  14. package/dist/components/ai/index.mjs +7 -0
  15. package/dist/components/ai/message/index.d.mts +2 -0
  16. package/dist/components/ai/message/index.mjs +2 -0
  17. package/dist/components/ai/message/message.d.mts +17 -0
  18. package/dist/components/ai/message/message.mjs +34 -0
  19. package/dist/components/ai/prompt-input/index.d.mts +2 -0
  20. package/dist/components/ai/prompt-input/index.mjs +2 -0
  21. package/dist/components/ai/prompt-input/prompt-input.d.mts +27 -0
  22. package/dist/components/ai/prompt-input/prompt-input.mjs +108 -0
  23. package/dist/components/ai/reasoning/index.d.mts +2 -0
  24. package/dist/components/ai/reasoning/index.mjs +2 -0
  25. package/dist/components/ai/reasoning/reasoning.d.mts +12 -0
  26. package/dist/components/ai/reasoning/reasoning.mjs +25 -0
  27. package/dist/components/ai/response/index.d.mts +2 -0
  28. package/dist/components/ai/response/index.mjs +2 -0
  29. package/dist/components/ai/response/response.d.mts +20 -0
  30. package/dist/components/ai/response/response.mjs +57 -0
  31. package/dist/components/ai/suggestion/index.d.mts +2 -0
  32. package/dist/components/ai/suggestion/index.mjs +2 -0
  33. package/dist/components/ai/suggestion/suggestion.d.mts +17 -0
  34. package/dist/components/ai/suggestion/suggestion.mjs +29 -0
  35. package/dist/components/ai/tool-invocation/index.d.mts +2 -0
  36. package/dist/components/ai/tool-invocation/index.mjs +2 -0
  37. package/dist/components/ai/tool-invocation/tool-invocation.d.mts +17 -0
  38. package/dist/components/ai/tool-invocation/tool-invocation.mjs +73 -0
  39. package/dist/components/ai/types.d.mts +5 -0
  40. package/dist/components/ai/types.mjs +1 -0
  41. package/dist/components/buttons/button/button.d.mts +27 -0
  42. package/dist/components/buttons/button/button.mjs +60 -0
  43. package/dist/components/buttons/button/index.d.mts +2 -0
  44. package/dist/components/buttons/button/index.mjs +2 -0
  45. package/dist/components/buttons/icon-button/icon-button.d.mts +29 -0
  46. package/dist/components/buttons/icon-button/icon-button.mjs +84 -0
  47. package/dist/components/buttons/icon-button/index.d.mts +2 -0
  48. package/dist/components/buttons/icon-button/index.mjs +2 -0
  49. package/dist/components/data-display/accordion/accordion-button.d.mts +5 -0
  50. package/dist/components/data-display/accordion/accordion-button.mjs +26 -0
  51. package/dist/components/data-display/accordion/accordion-item.d.mts +9 -0
  52. package/dist/components/data-display/accordion/accordion-item.mjs +20 -0
  53. package/dist/components/data-display/accordion/accordion-panel.d.mts +5 -0
  54. package/dist/components/data-display/accordion/accordion-panel.mjs +18 -0
  55. package/dist/components/data-display/accordion/accordion.d.mts +5 -0
  56. package/dist/components/data-display/accordion/accordion.mjs +8 -0
  57. package/dist/components/data-display/accordion/context.d.mts +14 -0
  58. package/dist/components/data-display/accordion/context.mjs +32 -0
  59. package/dist/components/data-display/accordion/index.d.mts +19 -0
  60. package/dist/components/data-display/accordion/index.mjs +13 -0
  61. package/dist/components/data-display/avatar/avatar.d.mts +14 -0
  62. package/dist/components/data-display/avatar/avatar.mjs +43 -0
  63. package/dist/components/data-display/avatar/index.d.mts +2 -0
  64. package/dist/components/data-display/avatar/index.mjs +2 -0
  65. package/dist/components/data-display/badge/badge.d.mts +21 -0
  66. package/dist/components/data-display/badge/badge.mjs +27 -0
  67. package/dist/components/data-display/badge/index.d.mts +2 -0
  68. package/dist/components/data-display/badge/index.mjs +2 -0
  69. package/dist/components/data-display/card/card.d.mts +10 -0
  70. package/dist/components/data-display/card/card.mjs +10 -0
  71. package/dist/components/data-display/card/index.d.mts +2 -0
  72. package/dist/components/data-display/card/index.mjs +2 -0
  73. package/dist/components/data-display/code/code.d.mts +8 -0
  74. package/dist/components/data-display/code/code.mjs +35 -0
  75. package/dist/components/data-display/code/find-all-colors.d.mts +16 -0
  76. package/dist/components/data-display/code/find-all-colors.mjs +267 -0
  77. package/dist/components/data-display/code/index.d.mts +2 -0
  78. package/dist/components/data-display/code/index.mjs +2 -0
  79. package/dist/components/data-display/heading/heading.d.mts +9 -0
  80. package/dist/components/data-display/heading/heading.mjs +46 -0
  81. package/dist/components/data-display/heading/index.d.mts +2 -0
  82. package/dist/components/data-display/heading/index.mjs +2 -0
  83. package/dist/components/data-display/table/index.d.mts +2 -0
  84. package/dist/components/data-display/table/index.mjs +2 -0
  85. package/dist/components/data-display/table/table.d.mts +33 -0
  86. package/dist/components/data-display/table/table.mjs +62 -0
  87. package/dist/components/feedback/alert/alert.d.mts +19 -0
  88. package/dist/components/feedback/alert/alert.mjs +71 -0
  89. package/dist/components/feedback/alert/index.d.mts +2 -0
  90. package/dist/components/feedback/alert/index.mjs +2 -0
  91. package/dist/components/feedback/progress/index.d.mts +2 -0
  92. package/dist/components/feedback/progress/index.mjs +2 -0
  93. package/dist/components/feedback/progress/progress.d.mts +11 -0
  94. package/dist/components/feedback/progress/progress.mjs +21 -0
  95. package/dist/components/feedback/skeleton/index.d.mts +2 -0
  96. package/dist/components/feedback/skeleton/index.mjs +2 -0
  97. package/dist/components/feedback/skeleton/skeleton.d.mts +10 -0
  98. package/dist/components/feedback/skeleton/skeleton.mjs +10 -0
  99. package/dist/components/feedback/spinner/index.d.mts +2 -0
  100. package/dist/components/feedback/spinner/index.mjs +2 -0
  101. package/dist/components/feedback/spinner/spinner.d.mts +9 -0
  102. package/dist/components/feedback/spinner/spinner.mjs +24 -0
  103. package/dist/components/feedback/toast/context.d.mts +34 -0
  104. package/dist/components/feedback/toast/context.mjs +7 -0
  105. package/dist/components/feedback/toast/index.d.mts +3 -0
  106. package/dist/components/feedback/toast/index.mjs +3 -0
  107. package/dist/components/feedback/toast/provider.d.mts +8 -0
  108. package/dist/components/feedback/toast/provider.mjs +171 -0
  109. package/dist/components/feedback/toast/toast.d.mts +15 -0
  110. package/dist/components/feedback/toast/toast.mjs +32 -0
  111. package/dist/components/form/autocomplete/autocomplete.d.mts +23 -0
  112. package/dist/components/form/autocomplete/autocomplete.mjs +225 -0
  113. package/dist/components/form/autocomplete/index.d.mts +2 -0
  114. package/dist/components/form/autocomplete/index.mjs +2 -0
  115. package/dist/components/form/checkbox/checkbox.d.mts +21 -0
  116. package/dist/components/form/checkbox/checkbox.mjs +59 -0
  117. package/dist/components/form/checkbox/index.d.mts +2 -0
  118. package/dist/components/form/checkbox/index.mjs +2 -0
  119. package/dist/components/form/checkbox-card/checkbox-card.d.mts +29 -0
  120. package/dist/components/form/checkbox-card/checkbox-card.mjs +76 -0
  121. package/dist/components/form/checkbox-card/index.d.mts +2 -0
  122. package/dist/components/form/checkbox-card/index.mjs +2 -0
  123. package/dist/components/form/checkbox-group/checkbox-group.d.mts +29 -0
  124. package/dist/components/form/checkbox-group/checkbox-group.mjs +43 -0
  125. package/dist/components/form/checkbox-group/index.d.mts +34 -0
  126. package/dist/components/form/checkbox-group/index.mjs +9 -0
  127. package/dist/components/form/file-field/file-field.d.mts +27 -0
  128. package/dist/components/form/file-field/file-field.mjs +129 -0
  129. package/dist/components/form/file-field/index.d.mts +2 -0
  130. package/dist/components/form/file-field/index.mjs +2 -0
  131. package/dist/components/form/form/form.d.mts +9 -0
  132. package/dist/components/form/form/form.mjs +11 -0
  133. package/dist/components/form/form/index.d.mts +2 -0
  134. package/dist/components/form/form/index.mjs +2 -0
  135. package/dist/components/form/form-control/form-control.d.mts +23 -0
  136. package/dist/components/form/form-control/form-control.mjs +61 -0
  137. package/dist/components/form/form-control/index.d.mts +2 -0
  138. package/dist/components/form/form-control/index.mjs +2 -0
  139. package/dist/components/form/number-field/cast.d.mts +4 -0
  140. package/dist/components/form/number-field/cast.mjs +32 -0
  141. package/dist/components/form/number-field/index.d.mts +2 -0
  142. package/dist/components/form/number-field/index.mjs +2 -0
  143. package/dist/components/form/number-field/number-field.d.mts +25 -0
  144. package/dist/components/form/number-field/number-field.mjs +115 -0
  145. package/dist/components/form/password-input/index.d.mts +2 -0
  146. package/dist/components/form/password-input/index.mjs +2 -0
  147. package/dist/components/form/password-input/password-input.d.mts +11 -0
  148. package/dist/components/form/password-input/password-input.mjs +36 -0
  149. package/dist/components/form/radio/index.d.mts +2 -0
  150. package/dist/components/form/radio/index.mjs +2 -0
  151. package/dist/components/form/radio/radio.d.mts +24 -0
  152. package/dist/components/form/radio/radio.mjs +51 -0
  153. package/dist/components/form/radio-card/index.d.mts +2 -0
  154. package/dist/components/form/radio-card/index.mjs +2 -0
  155. package/dist/components/form/radio-card/radio-card.d.mts +29 -0
  156. package/dist/components/form/radio-card/radio-card.mjs +74 -0
  157. package/dist/components/form/select/index.d.mts +2 -0
  158. package/dist/components/form/select/index.mjs +2 -0
  159. package/dist/components/form/select/select.d.mts +11 -0
  160. package/dist/components/form/select/select.mjs +33 -0
  161. package/dist/components/form/slider/index.d.mts +2 -0
  162. package/dist/components/form/slider/index.mjs +2 -0
  163. package/dist/components/form/slider/slider.d.mts +23 -0
  164. package/dist/components/form/slider/slider.mjs +50 -0
  165. package/dist/components/form/switch/index.d.mts +2 -0
  166. package/dist/components/form/switch/index.mjs +2 -0
  167. package/dist/components/form/switch/switch.d.mts +21 -0
  168. package/dist/components/form/switch/switch.mjs +50 -0
  169. package/dist/components/form/text-field/index.d.mts +2 -0
  170. package/dist/components/form/text-field/index.mjs +2 -0
  171. package/dist/components/form/text-field/text-field.d.mts +11 -0
  172. package/dist/components/form/text-field/text-field.mjs +19 -0
  173. package/dist/components/form/textarea/index.d.mts +2 -0
  174. package/dist/components/form/textarea/index.mjs +2 -0
  175. package/dist/components/form/textarea/textarea.d.mts +11 -0
  176. package/dist/components/form/textarea/textarea.mjs +38 -0
  177. package/dist/components/icons/base.d.mts +15 -0
  178. package/dist/components/icons/base.mjs +18 -0
  179. package/dist/components/icons/browsers.d.mts +9 -0
  180. package/dist/components/icons/browsers.mjs +891 -0
  181. package/dist/components/icons/color-scale.d.mts +6 -0
  182. package/dist/components/icons/color-scale.mjs +44 -0
  183. package/dist/components/icons/github-mark.d.mts +6 -0
  184. package/dist/components/icons/github-mark.mjs +19 -0
  185. package/dist/components/icons/index.d.mts +10 -0
  186. package/dist/components/icons/index.mjs +9 -0
  187. package/dist/components/icons/logo.d.mts +7 -0
  188. package/dist/components/icons/logo.mjs +29 -0
  189. package/dist/components/icons/lucide-deep.d.mts +9 -0
  190. package/dist/components/icons/lucide-imports.d.mts +65 -0
  191. package/dist/components/icons/lucide-imports.mjs +65 -0
  192. package/dist/components/icons/lucide.d.mts +69 -0
  193. package/dist/components/icons/lucide.mjs +256 -0
  194. package/dist/components/icons/qiita.d.mts +6 -0
  195. package/dist/components/icons/qiita.mjs +28 -0
  196. package/dist/components/icons/twitter.d.mts +6 -0
  197. package/dist/components/icons/twitter.mjs +20 -0
  198. package/dist/components/icons/vertical-writing.d.mts +6 -0
  199. package/dist/components/icons/vertical-writing.mjs +26 -0
  200. package/dist/components/index.d.mts +106 -0
  201. package/dist/components/index.mjs +57 -0
  202. package/dist/components/layout/_shared/gap.d.mts +11 -0
  203. package/dist/components/layout/_shared/gap.mjs +10 -0
  204. package/dist/components/layout/_shared/padding.d.mts +11 -0
  205. package/dist/components/layout/_shared/padding.mjs +10 -0
  206. package/dist/components/layout/grid/grid.d.mts +16 -0
  207. package/dist/components/layout/grid/grid.mjs +35 -0
  208. package/dist/components/layout/grid/index.d.mts +2 -0
  209. package/dist/components/layout/grid/index.mjs +2 -0
  210. package/dist/components/layout/scroll-linked/index.d.mts +2 -0
  211. package/dist/components/layout/scroll-linked/index.mjs +2 -0
  212. package/dist/components/layout/scroll-linked/scroll-linked.d.mts +14 -0
  213. package/dist/components/layout/scroll-linked/scroll-linked.mjs +59 -0
  214. package/dist/components/layout/separator/index.d.mts +2 -0
  215. package/dist/components/layout/separator/index.mjs +2 -0
  216. package/dist/components/layout/separator/separator.d.mts +9 -0
  217. package/dist/components/layout/separator/separator.mjs +14 -0
  218. package/dist/components/layout/stack/index.d.mts +2 -0
  219. package/dist/components/layout/stack/index.mjs +2 -0
  220. package/dist/components/layout/stack/stack.d.mts +15 -0
  221. package/dist/components/layout/stack/stack.mjs +24 -0
  222. package/dist/components/navigation/anchor/anchor.d.mts +20 -0
  223. package/dist/components/navigation/anchor/anchor.mjs +28 -0
  224. package/dist/components/navigation/anchor/index.d.mts +2 -0
  225. package/dist/components/navigation/anchor/index.mjs +2 -0
  226. package/dist/components/navigation/breadcrumb/breadcrumb.d.mts +19 -0
  227. package/dist/components/navigation/breadcrumb/breadcrumb.mjs +43 -0
  228. package/dist/components/navigation/breadcrumb/index.d.mts +14 -0
  229. package/dist/components/navigation/breadcrumb/index.mjs +10 -0
  230. package/dist/components/navigation/pagination/index.d.mts +2 -0
  231. package/dist/components/navigation/pagination/index.mjs +2 -0
  232. package/dist/components/navigation/pagination/pagination.d.mts +15 -0
  233. package/dist/components/navigation/pagination/pagination.mjs +74 -0
  234. package/dist/components/navigation/tabs/index.d.mts +2 -0
  235. package/dist/components/navigation/tabs/index.mjs +2 -0
  236. package/dist/components/navigation/tabs/tabs.d.mts +21 -0
  237. package/dist/components/navigation/tabs/tabs.mjs +130 -0
  238. package/dist/components/overlays/_internal/index.d.mts +4 -0
  239. package/dist/components/overlays/_internal/index.mjs +4 -0
  240. package/dist/components/overlays/_internal/modal-dialog-context.d.mts +14 -0
  241. package/dist/components/overlays/_internal/modal-dialog-context.mjs +13 -0
  242. package/dist/components/overlays/_internal/use-can-hover.d.mts +9 -0
  243. package/dist/components/overlays/_internal/use-can-hover.mjs +20 -0
  244. package/dist/components/overlays/_internal/use-hover-intent.d.mts +25 -0
  245. package/dist/components/overlays/_internal/use-hover-intent.mjs +56 -0
  246. package/dist/components/overlays/_internal/use-list-navigation.d.mts +36 -0
  247. package/dist/components/overlays/_internal/use-list-navigation.mjs +98 -0
  248. package/dist/components/overlays/dialog/dialog.d.mts +19 -0
  249. package/dist/components/overlays/dialog/dialog.mjs +87 -0
  250. package/dist/components/overlays/dialog/index.d.mts +2 -0
  251. package/dist/components/overlays/dialog/index.mjs +2 -0
  252. package/dist/components/overlays/drawer/drawer.d.mts +12 -0
  253. package/dist/components/overlays/drawer/drawer.mjs +60 -0
  254. package/dist/components/overlays/drawer/index.d.mts +2 -0
  255. package/dist/components/overlays/drawer/index.mjs +2 -0
  256. package/dist/components/overlays/dropdown-menu/dropdown-menu.d.mts +34 -0
  257. package/dist/components/overlays/dropdown-menu/dropdown-menu.mjs +85 -0
  258. package/dist/components/overlays/dropdown-menu/hooks.d.mts +24 -0
  259. package/dist/components/overlays/dropdown-menu/hooks.mjs +26 -0
  260. package/dist/components/overlays/dropdown-menu/index.d.mts +2 -0
  261. package/dist/components/overlays/dropdown-menu/index.mjs +2 -0
  262. package/dist/components/overlays/dropdown-menu/shared.d.mts +7 -0
  263. package/dist/components/overlays/dropdown-menu/shared.mjs +8 -0
  264. package/dist/components/overlays/dropdown-menu/sub-menu.d.mts +10 -0
  265. package/dist/components/overlays/dropdown-menu/sub-menu.mjs +143 -0
  266. package/dist/components/overlays/dropdown-menu/use-safe-triangle.d.mts +18 -0
  267. package/dist/components/overlays/dropdown-menu/use-safe-triangle.mjs +57 -0
  268. package/dist/components/overlays/list-box/hooks.d.mts +35 -0
  269. package/dist/components/overlays/list-box/hooks.mjs +43 -0
  270. package/dist/components/overlays/list-box/index.d.mts +2 -0
  271. package/dist/components/overlays/list-box/index.mjs +2 -0
  272. package/dist/components/overlays/list-box/list-box.d.mts +28 -0
  273. package/dist/components/overlays/list-box/list-box.mjs +150 -0
  274. package/dist/components/overlays/modal/index.d.mts +2 -0
  275. package/dist/components/overlays/modal/index.mjs +2 -0
  276. package/dist/components/overlays/modal/modal.d.mts +15 -0
  277. package/dist/components/overlays/modal/modal.mjs +72 -0
  278. package/dist/components/overlays/popover/anchor-positioning.d.mts +26 -0
  279. package/dist/components/overlays/popover/anchor-positioning.mjs +49 -0
  280. package/dist/components/overlays/popover/escape-stack.d.mts +7 -0
  281. package/dist/components/overlays/popover/escape-stack.mjs +34 -0
  282. package/dist/components/overlays/popover/hooks.d.mts +53 -0
  283. package/dist/components/overlays/popover/hooks.mjs +141 -0
  284. package/dist/components/overlays/popover/index.d.mts +3 -0
  285. package/dist/components/overlays/popover/index.mjs +3 -0
  286. package/dist/components/overlays/popover/popover.d.mts +25 -0
  287. package/dist/components/overlays/popover/popover.mjs +90 -0
  288. package/dist/components/overlays/tooltip/bridge.d.mts +5 -0
  289. package/dist/components/overlays/tooltip/bridge.mjs +29 -0
  290. package/dist/components/overlays/tooltip/index.d.mts +2 -0
  291. package/dist/components/overlays/tooltip/index.mjs +2 -0
  292. package/dist/components/overlays/tooltip/tooltip.d.mts +34 -0
  293. package/dist/components/overlays/tooltip/tooltip.mjs +87 -0
  294. package/dist/components/providers/index.d.mts +4 -0
  295. package/dist/components/providers/index.mjs +3 -0
  296. package/dist/components/providers/portal-root.d.mts +8 -0
  297. package/dist/components/providers/portal-root.mjs +12 -0
  298. package/dist/components/providers/ui-provider.d.mts +8 -0
  299. package/dist/components/providers/ui-provider.mjs +11 -0
  300. package/dist/helpers/chain.d.mts +5 -0
  301. package/dist/helpers/chain.mjs +29 -0
  302. package/dist/helpers/cn.d.mts +5 -0
  303. package/dist/helpers/cn.mjs +27 -0
  304. package/dist/helpers/create-safe-context.d.mts +6 -0
  305. package/dist/helpers/create-safe-context.mjs +30 -0
  306. package/dist/helpers/index.d.mts +6 -0
  307. package/dist/helpers/index.mjs +6 -0
  308. package/dist/helpers/merge-props.d.mts +6 -0
  309. package/dist/helpers/merge-props.mjs +56 -0
  310. package/dist/helpers/merge-refs.d.mts +5 -0
  311. package/dist/helpers/merge-refs.mjs +55 -0
  312. package/dist/hooks/breakpoint/index.d.mts +5 -0
  313. package/dist/hooks/breakpoint/index.mjs +24 -0
  314. package/dist/hooks/click-away/index.d.mts +5 -0
  315. package/dist/hooks/click-away/index.mjs +24 -0
  316. package/dist/hooks/client/index.d.mts +4 -0
  317. package/dist/hooks/client/index.mjs +6 -0
  318. package/dist/hooks/clipboard/index.d.mts +7 -0
  319. package/dist/hooks/clipboard/index.mjs +15 -0
  320. package/dist/hooks/controllable-state/index.d.mts +9 -0
  321. package/dist/hooks/controllable-state/index.mjs +21 -0
  322. package/dist/hooks/debounced-transition/index.d.mts +5 -0
  323. package/dist/hooks/debounced-transition/index.mjs +49 -0
  324. package/dist/hooks/deferred-debounce/index.d.mts +4 -0
  325. package/dist/hooks/deferred-debounce/index.mjs +9 -0
  326. package/dist/hooks/disclosure/index.d.mts +10 -0
  327. package/dist/hooks/disclosure/index.mjs +20 -0
  328. package/dist/hooks/focus-trap/index.d.mts +18 -0
  329. package/dist/hooks/focus-trap/index.mjs +51 -0
  330. package/dist/hooks/hash/index.d.mts +4 -0
  331. package/dist/hooks/hash/index.mjs +25 -0
  332. package/dist/hooks/hover/index.d.mts +12 -0
  333. package/dist/hooks/hover/index.mjs +19 -0
  334. package/dist/hooks/index.d.mts +25 -0
  335. package/dist/hooks/index.mjs +24 -0
  336. package/dist/hooks/intersection-observer/index.d.mts +3 -0
  337. package/dist/hooks/intersection-observer/index.mjs +3 -0
  338. package/dist/hooks/intersection-observer/use-in-view.d.mts +11 -0
  339. package/dist/hooks/intersection-observer/use-in-view.mjs +18 -0
  340. package/dist/hooks/intersection-observer/use-intersection-observer.d.mts +11 -0
  341. package/dist/hooks/intersection-observer/use-intersection-observer.mjs +33 -0
  342. package/dist/hooks/interval/index.d.mts +4 -0
  343. package/dist/hooks/interval/index.mjs +19 -0
  344. package/dist/hooks/local-storage/index.d.mts +4 -0
  345. package/dist/hooks/local-storage/index.mjs +46 -0
  346. package/dist/hooks/resize/index.d.mts +8 -0
  347. package/dist/hooks/resize/index.mjs +24 -0
  348. package/dist/hooks/scroll-direction/index.d.mts +13 -0
  349. package/dist/hooks/scroll-direction/index.mjs +67 -0
  350. package/dist/hooks/scroll-lock/index.d.mts +9 -0
  351. package/dist/hooks/scroll-lock/index.mjs +59 -0
  352. package/dist/hooks/session-storage/index.d.mts +4 -0
  353. package/dist/hooks/session-storage/index.mjs +46 -0
  354. package/dist/hooks/step/index.d.mts +15 -0
  355. package/dist/hooks/step/index.mjs +39 -0
  356. package/dist/hooks/timeout/index.d.mts +4 -0
  357. package/dist/hooks/timeout/index.mjs +19 -0
  358. package/dist/hooks/window-resize/index.d.mts +11 -0
  359. package/dist/hooks/window-resize/index.mjs +21 -0
  360. package/dist/hooks/window-size/index.d.mts +8 -0
  361. package/dist/hooks/window-size/index.mjs +31 -0
  362. package/dist/hooks/writing-mode/index.d.mts +6 -0
  363. package/dist/hooks/writing-mode/index.mjs +24 -0
  364. package/dist/i18n/context.d.mts +9 -0
  365. package/dist/i18n/context.mjs +19 -0
  366. package/dist/i18n/en.d.mts +5 -0
  367. package/dist/i18n/en.mjs +64 -0
  368. package/dist/i18n/index.d.mts +5 -0
  369. package/dist/i18n/index.mjs +4 -0
  370. package/dist/i18n/ja.d.mts +5 -0
  371. package/dist/i18n/ja.mjs +64 -0
  372. package/dist/i18n/messages.d.mts +84 -0
  373. package/dist/i18n/messages.mjs +1 -0
  374. package/dist/index.d.mts +94 -0
  375. package/dist/index.mjs +85 -0
  376. package/dist/integrations/_shared/openui-defs.d.mts +18 -0
  377. package/dist/integrations/_shared/openui-defs.mjs +162 -0
  378. package/dist/integrations/_shared/renderers.d.mts +71 -0
  379. package/dist/integrations/_shared/renderers.mjs +679 -0
  380. package/dist/integrations/_shared/schemas.d.mts +718 -0
  381. package/dist/integrations/_shared/schemas.mjs +545 -0
  382. package/dist/integrations/ai-sdk/index.d.mts +3 -0
  383. package/dist/integrations/ai-sdk/index.mjs +2 -0
  384. package/dist/integrations/ai-sdk/map-parts.d.mts +28 -0
  385. package/dist/integrations/ai-sdk/map-parts.mjs +32 -0
  386. package/dist/integrations/json-render/catalog.d.mts +838 -0
  387. package/dist/integrations/json-render/catalog.mjs +311 -0
  388. package/dist/integrations/json-render/registry.d.mts +29 -0
  389. package/dist/integrations/json-render/registry.mjs +159 -0
  390. package/dist/integrations/openui/form-views.d.mts +21 -0
  391. package/dist/integrations/openui/form-views.mjs +66 -0
  392. package/dist/integrations/openui/library.d.mts +151 -0
  393. package/dist/integrations/openui/library.mjs +69 -0
  394. package/dist/integrations/openui/prompt.d.mts +5 -0
  395. package/dist/integrations/openui/prompt.mjs +19 -0
  396. package/dist/internal/clamp.d.mts +4 -0
  397. package/dist/internal/clamp.mjs +15 -0
  398. package/dist/internal/to-precision.d.mts +4 -0
  399. package/dist/internal/to-precision.mjs +15 -0
  400. package/dist/styles/base.css +315 -0
  401. package/dist/styles/index.css +2677 -0
  402. package/dist/styles/tailwind.css +22 -0
  403. package/dist/styles/tokens.css +380 -0
  404. package/dist/styles/tokens.d.mts +2 -0
  405. package/dist/styles/tokens.generated.d.mts +840 -0
  406. package/dist/styles/tokens.generated.mjs +813 -0
  407. package/dist/styles/tokens.mjs +2 -0
  408. package/dist/styles/utilities.css +62 -0
  409. package/dist/types/index.d.mts +2 -0
  410. package/dist/types/index.mjs +1 -0
  411. package/dist/types/variables.d.mts +23 -0
  412. package/dist/types/variables.mjs +1 -0
  413. package/docs/GUIDE.md +324 -0
  414. package/docs/llms.txt +25 -0
  415. package/docs/props.generated.json +3519 -0
  416. package/docs/references/ai-chat.md +354 -0
  417. package/docs/references/color.md +121 -0
  418. package/docs/references/components.md +1466 -0
  419. package/docs/references/generative-ui.md +112 -0
  420. package/docs/references/helpers.md +120 -0
  421. package/docs/references/hooks.md +314 -0
  422. package/docs/references/interaction-design.md +95 -0
  423. package/docs/references/spatial-design.md +137 -0
  424. package/docs/references/typography.md +110 -0
  425. package/package.json +197 -0
@@ -0,0 +1,25 @@
1
+ import { FC, InputHTMLAttributes, Ref } from "react";
2
+ //#region src/components/form/number-field/number-field.d.ts
3
+ type BaseProps = {
4
+ invalid?: boolean;
5
+ precision?: number;
6
+ ref?: Ref<HTMLInputElement>;
7
+ } & Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'role' | 'className' | 'style' | 'value' | 'onChange' | 'defaultValue' | 'children' | 'step' | 'min' | 'max'> & {
8
+ step?: number;
9
+ min?: number;
10
+ max?: number;
11
+ };
12
+ type ControlledProps = {
13
+ value: number;
14
+ onChange: (value: number) => void;
15
+ defaultValue?: never;
16
+ };
17
+ type UncontrolledProps = {
18
+ defaultValue?: number;
19
+ value?: never;
20
+ onChange?: (value: number) => void;
21
+ };
22
+ type Props = BaseProps & (ControlledProps | UncontrolledProps);
23
+ declare const NumberField: FC<Props>;
24
+ //#endregion
25
+ export { NumberField };
@@ -0,0 +1,115 @@
1
+ "use client";
2
+ import { FOCUS_RING_WITHIN } from "../../_internal/focus-ring.mjs";
3
+ import { cn } from "../../../helpers/cn.mjs";
4
+ import { useMessages } from "../../../i18n/context.mjs";
5
+ import { chain } from "../../../helpers/chain.mjs";
6
+ import { useControllableState } from "../../../hooks/controllable-state/index.mjs";
7
+ import { ChevronIcon } from "../../icons/lucide.mjs";
8
+ import { toPrecision } from "../../../internal/to-precision.mjs";
9
+ import { clamp } from "../../../internal/clamp.mjs";
10
+ import { cast } from "./cast.mjs";
11
+ import { useState } from "react";
12
+ import { useFormStatus } from "react-dom";
13
+ import { jsx, jsxs } from "react/jsx-runtime";
14
+ //#region src/components/form/number-field/number-field.tsx
15
+ const NumberField = ({ invalid = false, disabled = false, required = false, value, defaultValue, onChange, onBlur, onKeyDown, ref, step = 1, precision = 0, max = 9007199254740991, min = -9007199254740991, ...rest }) => {
16
+ const messages = useMessages();
17
+ const [currentValue, setCurrentValue] = useControllableState({
18
+ value,
19
+ defaultValue: defaultValue ?? 0,
20
+ onChange
21
+ });
22
+ const [displayValue, setDisplayValue] = useState(() => currentValue.toFixed(precision));
23
+ const [prevValue, setPrevValue] = useState(currentValue);
24
+ const { pending } = useFormStatus();
25
+ if (currentValue !== prevValue) {
26
+ setDisplayValue(currentValue.toFixed(precision));
27
+ setPrevValue(currentValue);
28
+ }
29
+ const handleChange = (newValue) => {
30
+ setCurrentValue(newValue);
31
+ };
32
+ return /* @__PURE__ */ jsxs("div", {
33
+ className: cn("relative flex h-12 w-full items-center justify-between gap-2 rounded-xl border border-border-base bg-bg-base vertical:h-auto vertical:w-12", FOCUS_RING_WITHIN, "has-aria-invalid:border-border-error", "has-disabled:cursor-not-allowed has-disabled:border-border-mute has-disabled:bg-bg-mute hover:has-disabled:has-hover:bg-bg-mute"),
34
+ children: [/* @__PURE__ */ jsx("input", {
35
+ autoComplete: "off",
36
+ autoCorrect: "off",
37
+ inputMode: "decimal",
38
+ ...rest,
39
+ "aria-invalid": invalid,
40
+ "aria-required": required,
41
+ "aria-valuemax": max,
42
+ "aria-valuemin": min,
43
+ "aria-valuenow": currentValue,
44
+ className: cn("grow bg-transparent pe-8 ps-3 focus-visible:outline-hidden size-full", "disabled:cursor-not-allowed", "read-only:cursor-not-allowed"),
45
+ disabled,
46
+ readOnly: pending || void 0,
47
+ onBlur: chain(onBlur, () => {
48
+ const newValue = clamp(cast(displayValue, precision), min, max);
49
+ handleChange(newValue);
50
+ setDisplayValue(newValue.toFixed(precision));
51
+ }),
52
+ onChange: (e) => {
53
+ if (e.nativeEvent instanceof InputEvent && e.nativeEvent.isComposing) return;
54
+ setDisplayValue(e.target.value);
55
+ },
56
+ onKeyDown: chain(onKeyDown, (e) => {
57
+ if (e.key === "ArrowUp") {
58
+ const newValue = clamp(toPrecision(cast(displayValue, precision) + step, precision), min, max);
59
+ handleChange(newValue);
60
+ setDisplayValue(newValue.toFixed(precision));
61
+ }
62
+ if (e.key === "ArrowDown") {
63
+ const newValue = clamp(toPrecision(cast(displayValue, precision) - step, precision), min, max);
64
+ handleChange(newValue);
65
+ setDisplayValue(newValue.toFixed(precision));
66
+ }
67
+ }),
68
+ pattern: "[0-9]*(.[0-9]+)?",
69
+ ref,
70
+ role: "spinbutton",
71
+ type: "text",
72
+ value: displayValue
73
+ }), /* @__PURE__ */ jsxs("div", {
74
+ "aria-hidden": "true",
75
+ className: "vertical:inset-e-auto vertical:bottom-1 vertical:h-auto vertical:w-full vertical:flex-row vertical:px-1 vertical:py-0 absolute inset-e-1 flex h-full flex-col py-1",
76
+ children: [/* @__PURE__ */ jsxs("button", {
77
+ className: cn("flex w-6 grow items-center justify-center rounded-md text-fg-mute transition-colors vertical:h-6 vertical:w-auto", "hover:bg-bg-mute hover:text-fg-base", "disabled:cursor-not-allowed disabled:text-fg-mute hover:disabled:bg-transparent"),
78
+ disabled: disabled || pending,
79
+ onClick: () => {
80
+ const newValue = clamp(toPrecision(cast(displayValue, precision) + step, precision), min, max);
81
+ handleChange(newValue);
82
+ setDisplayValue(newValue.toFixed(precision));
83
+ },
84
+ tabIndex: -1,
85
+ type: "button",
86
+ children: [/* @__PURE__ */ jsx("span", {
87
+ className: "sr-only",
88
+ children: messages.numberFieldIncrement
89
+ }), /* @__PURE__ */ jsx(ChevronIcon, {
90
+ direction: "up",
91
+ size: "sm"
92
+ })]
93
+ }), /* @__PURE__ */ jsxs("button", {
94
+ className: cn("flex w-6 grow items-center justify-center rounded-md text-fg-mute transition-colors vertical:h-6 vertical:w-auto", "hover:bg-bg-mute hover:text-fg-base", "disabled:cursor-not-allowed disabled:text-fg-mute hover:disabled:bg-transparent"),
95
+ disabled: disabled || pending,
96
+ onClick: () => {
97
+ const newValue = clamp(toPrecision(cast(displayValue, precision) - step, precision), min, max);
98
+ handleChange(newValue);
99
+ setDisplayValue(newValue.toFixed(precision));
100
+ },
101
+ tabIndex: -1,
102
+ type: "button",
103
+ children: [/* @__PURE__ */ jsx("span", {
104
+ className: "sr-only",
105
+ children: messages.numberFieldDecrement
106
+ }), /* @__PURE__ */ jsx(ChevronIcon, {
107
+ direction: "down",
108
+ size: "sm"
109
+ })]
110
+ })]
111
+ })]
112
+ });
113
+ };
114
+ //#endregion
115
+ export { NumberField };
@@ -0,0 +1,2 @@
1
+ import { PasswordInput } from "./password-input.mjs";
2
+ export { PasswordInput };
@@ -0,0 +1,2 @@
1
+ import { PasswordInput } from "./password-input.mjs";
2
+ export { PasswordInput };
@@ -0,0 +1,11 @@
1
+ import { FC, InputHTMLAttributes, Ref } from "react";
2
+ //#region src/components/form/password-input/password-input.d.ts
3
+ type Props = {
4
+ invalid?: boolean;
5
+ showLabel?: string;
6
+ hideLabel?: string;
7
+ ref?: Ref<HTMLInputElement>;
8
+ } & Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'className' | 'style'>;
9
+ declare const PasswordInput: FC<Props>;
10
+ //#endregion
11
+ export { PasswordInput };
@@ -0,0 +1,36 @@
1
+ "use client";
2
+ import { FOCUS_RING_NO_BORDER, FOCUS_RING_WITHIN } from "../../_internal/focus-ring.mjs";
3
+ import { cn } from "../../../helpers/cn.mjs";
4
+ import { useMessages } from "../../../i18n/context.mjs";
5
+ import { useDisclosure } from "../../../hooks/disclosure/index.mjs";
6
+ import { ViewIcon, ViewOffIcon } from "../../icons/lucide.mjs";
7
+ import { useFormStatus } from "react-dom";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ //#region src/components/form/password-input/password-input.tsx
10
+ const PasswordInput = ({ invalid = false, autoComplete = "current-password", showLabel, hideLabel, disabled = false, readOnly, ref, ...rest }) => {
11
+ const messages = useMessages();
12
+ const { isOpen: isVisible, toggle: toggleVisible } = useDisclosure();
13
+ const { pending } = useFormStatus();
14
+ return /* @__PURE__ */ jsxs("div", {
15
+ className: cn("relative flex w-full items-center rounded-xl border border-border-base bg-bg-base vertical:h-full vertical:w-auto", invalid && "border-border-error", (disabled || pending) && "cursor-not-allowed border-border-mute bg-bg-mute", FOCUS_RING_WITHIN),
16
+ children: [/* @__PURE__ */ jsx("input", {
17
+ "aria-invalid": invalid,
18
+ autoComplete,
19
+ className: cn("w-full grow bg-transparent px-3 py-2 focus-visible:outline-hidden vertical:h-full vertical:w-auto", "disabled:cursor-not-allowed", "read-only:cursor-not-allowed read-only:bg-bg-subtle"),
20
+ disabled,
21
+ readOnly: pending || readOnly,
22
+ ref,
23
+ type: isVisible ? "text" : "password",
24
+ ...rest
25
+ }), /* @__PURE__ */ jsx("button", {
26
+ "aria-label": isVisible ? hideLabel ?? messages.passwordHide : showLabel ?? messages.passwordShow,
27
+ className: cn("me-2 inline-flex shrink-0 items-center justify-center rounded-md p-1 text-fg-mute transition-colors", FOCUS_RING_NO_BORDER, !disabled && !pending && "hover:bg-bg-mute hover:text-fg-base", (disabled || pending) && "cursor-not-allowed text-fg-mute/70"),
28
+ disabled: disabled || pending,
29
+ onClick: toggleVisible,
30
+ type: "button",
31
+ children: isVisible ? /* @__PURE__ */ jsx(ViewOffIcon, { size: "sm" }) : /* @__PURE__ */ jsx(ViewIcon, { size: "sm" })
32
+ })]
33
+ });
34
+ };
35
+ //#endregion
36
+ export { PasswordInput };
@@ -0,0 +1,2 @@
1
+ import { Radio } from "./radio.mjs";
2
+ export { Radio };
@@ -0,0 +1,2 @@
1
+ import { Radio } from "./radio.mjs";
2
+ export { Radio };
@@ -0,0 +1,24 @@
1
+ import { Option } from "../../../types/variables.mjs";
2
+ import { ChangeEvent, FC, HTMLAttributes, Ref } from "react";
3
+ //#region src/components/form/radio/radio.d.ts
4
+ type BaseProps = {
5
+ 'aria-labelledby': string;
6
+ name?: string;
7
+ disabled?: boolean;
8
+ options: readonly Option[];
9
+ ref?: Ref<HTMLDivElement>;
10
+ } & Omit<HTMLAttributes<HTMLDivElement>, 'role' | 'className' | 'style' | 'children' | 'aria-labelledby' | 'onChange'>;
11
+ type ControlledProps = {
12
+ value: string;
13
+ onChange: (value: string, event: ChangeEvent<HTMLInputElement>) => void;
14
+ defaultValue?: never;
15
+ };
16
+ type UncontrolledProps = {
17
+ defaultValue?: string;
18
+ value?: never;
19
+ onChange?: (value: string, event: ChangeEvent<HTMLInputElement>) => void;
20
+ };
21
+ type Props = BaseProps & (ControlledProps | UncontrolledProps);
22
+ declare const Radio: FC<Props>;
23
+ //#endregion
24
+ export { Radio };
@@ -0,0 +1,51 @@
1
+ "use client";
2
+ import { FOCUS_RING_PEER } from "../../_internal/focus-ring.mjs";
3
+ import { cn } from "../../../helpers/cn.mjs";
4
+ import { useControllableState } from "../../../hooks/controllable-state/index.mjs";
5
+ import { useFormStatus } from "react-dom";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ //#region src/components/form/radio/radio.tsx
8
+ const Radio = ({ "aria-labelledby": labelledbyId, name, disabled = false, value, defaultValue, onChange, options, ref, ...rest }) => {
9
+ const [selectedValue, setSelectedValue] = useControllableState({
10
+ value,
11
+ defaultValue
12
+ });
13
+ const { pending } = useFormStatus();
14
+ const isControlled = value !== void 0;
15
+ const disabledResolved = disabled || pending;
16
+ const selectValue = (nextValue, event) => {
17
+ setSelectedValue(nextValue);
18
+ onChange?.(nextValue, event);
19
+ };
20
+ return /* @__PURE__ */ jsx("div", {
21
+ ...rest,
22
+ "aria-labelledby": labelledbyId,
23
+ className: cn("flex cursor-pointer flex-col gap-2", disabledResolved && "cursor-not-allowed"),
24
+ ref,
25
+ role: "radiogroup",
26
+ children: options.map((option) => /* @__PURE__ */ jsxs("label", {
27
+ className: cn("flex items-center gap-2 text-left", disabledResolved ? "cursor-not-allowed" : "cursor-pointer"),
28
+ children: [
29
+ /* @__PURE__ */ jsx("input", {
30
+ ...isControlled ? { checked: value === option.value } : { defaultChecked: defaultValue === option.value },
31
+ className: "peer sr-only",
32
+ disabled: disabledResolved,
33
+ name: name ?? labelledbyId,
34
+ onChange: (event) => {
35
+ selectValue(option.value, event);
36
+ },
37
+ type: "radio",
38
+ value: option.value
39
+ }),
40
+ /* @__PURE__ */ jsx("span", {
41
+ "aria-hidden": true,
42
+ className: cn("inline-flex size-5 items-center justify-center rounded-full border-2 transition-colors", FOCUS_RING_PEER, selectedValue === option.value ? "border-border-base bg-primary-bg" : "border-border-mute bg-bg-base", disabledResolved && "border-border-mute bg-bg-mute"),
43
+ children: /* @__PURE__ */ jsx("span", { className: cn("size-2 rounded-full transition-opacity", selectedValue === option.value ? "bg-primary-border opacity-100" : "bg-transparent opacity-0") })
44
+ }),
45
+ /* @__PURE__ */ jsx("span", { children: option.label })
46
+ ]
47
+ }, option.value))
48
+ });
49
+ };
50
+ //#endregion
51
+ export { Radio };
@@ -0,0 +1,2 @@
1
+ import { RadioCard, RadioCardOption } from "./radio-card.mjs";
2
+ export { RadioCard, type RadioCardOption };
@@ -0,0 +1,2 @@
1
+ import { RadioCard } from "./radio-card.mjs";
2
+ export { RadioCard };
@@ -0,0 +1,29 @@
1
+ import { FC, FieldsetHTMLAttributes, ReactNode, Ref } from "react";
2
+ //#region src/components/form/radio-card/radio-card.d.ts
3
+ type RadioCardOption = Readonly<{
4
+ value: string;
5
+ label: string;
6
+ description?: string;
7
+ visual?: ReactNode;
8
+ disabled?: boolean;
9
+ }>;
10
+ type BaseProps = {
11
+ 'aria-labelledby': string;
12
+ invalid?: boolean;
13
+ options: readonly RadioCardOption[];
14
+ ref?: Ref<HTMLFieldSetElement>;
15
+ } & Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, 'className' | 'style' | 'children' | 'onChange' | 'defaultValue' | 'aria-labelledby' | 'role'>;
16
+ type ControlledProps = {
17
+ value: string;
18
+ onChange: (value: string) => void;
19
+ defaultValue?: never;
20
+ };
21
+ type UncontrolledProps = {
22
+ defaultValue?: string;
23
+ value?: never;
24
+ onChange?: (value: string) => void;
25
+ };
26
+ type Props = BaseProps & (ControlledProps | UncontrolledProps);
27
+ declare const RadioCard: FC<Props>;
28
+ //#endregion
29
+ export { RadioCard, RadioCardOption };
@@ -0,0 +1,74 @@
1
+ "use client";
2
+ import { cn } from "../../../helpers/cn.mjs";
3
+ import { useControllableState } from "../../../hooks/controllable-state/index.mjs";
4
+ import { useId } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ //#region src/components/form/radio-card/radio-card.tsx
7
+ const RadioCard = ({ "aria-labelledby": labelledbyId, name, disabled = false, invalid = false, options, value, defaultValue, onChange, ref, ...rest }) => {
8
+ const groupId = useId();
9
+ const [currentValue, setCurrentValue] = useControllableState({
10
+ value,
11
+ defaultValue
12
+ });
13
+ const selectValue = (nextValue) => {
14
+ setCurrentValue(nextValue);
15
+ onChange?.(nextValue);
16
+ };
17
+ return /* @__PURE__ */ jsx("fieldset", {
18
+ ...rest,
19
+ "aria-labelledby": labelledbyId,
20
+ className: cn("m-0 min-w-0 border-0 p-0 inline-full", "grid gap-3", disabled && "opacity-70"),
21
+ ref,
22
+ role: "radiogroup",
23
+ children: options.map((option) => {
24
+ const checked = currentValue === option.value;
25
+ const optionDisabled = disabled || option.disabled === true;
26
+ const hasDescription = option.description !== void 0 && option.description !== "";
27
+ const hasVisual = option.visual !== void 0 && option.visual !== null;
28
+ const optionId = `${groupId}-${option.value}`;
29
+ return /* @__PURE__ */ jsxs("label", {
30
+ className: cn("flex min-w-0 rounded-xl border bg-bg-base p-4 text-left transition-colors inline-full", "has-[input:focus-visible]:outline-hidden has-[input:focus-visible]:ring-2 has-[input:focus-visible]:ring-border-info", checked && "border-primary-border bg-primary-bg-subtle hover:bg-primary-bg-mute", invalid ? "border-border-error" : !checked && "border-border-mute hover:bg-bg-subtle", optionDisabled && "cursor-not-allowed border-border-mute bg-bg-subtle text-fg-mute"),
31
+ id: optionId,
32
+ children: [
33
+ /* @__PURE__ */ jsx("input", {
34
+ "aria-describedby": hasDescription ? `${optionId}-description` : void 0,
35
+ "aria-labelledby": `${optionId}-label`,
36
+ checked,
37
+ className: "sr-only",
38
+ disabled: optionDisabled,
39
+ name: name ?? groupId,
40
+ onChange: () => {
41
+ selectValue(option.value);
42
+ },
43
+ type: "radio",
44
+ value: option.value
45
+ }),
46
+ hasVisual ? /* @__PURE__ */ jsx("span", {
47
+ "aria-hidden": true,
48
+ className: "mr-4 shrink-0",
49
+ children: option.visual
50
+ }) : null,
51
+ /* @__PURE__ */ jsxs("span", {
52
+ className: "flex min-w-0 flex-1 flex-col gap-1",
53
+ children: [/* @__PURE__ */ jsx("span", {
54
+ className: "text-fg-base font-medium",
55
+ id: `${optionId}-label`,
56
+ children: option.label
57
+ }), hasDescription ? /* @__PURE__ */ jsx("span", {
58
+ className: "text-fg-mute text-sm",
59
+ id: `${optionId}-description`,
60
+ children: option.description
61
+ }) : null]
62
+ }),
63
+ /* @__PURE__ */ jsx("span", {
64
+ "aria-hidden": true,
65
+ className: cn("mt-0.5 ml-4 inline-flex size-5 shrink-0 items-center justify-center rounded-full border", checked ? "border-border-base bg-primary-bg" : "border-border-mute bg-bg-base"),
66
+ children: /* @__PURE__ */ jsx("span", { className: cn("size-2 rounded-full bg-primary-border transition-opacity", checked ? "opacity-100" : "opacity-0") })
67
+ })
68
+ ]
69
+ }, option.value);
70
+ })
71
+ });
72
+ };
73
+ //#endregion
74
+ export { RadioCard };
@@ -0,0 +1,2 @@
1
+ import { Select } from "./select.mjs";
2
+ export { Select };
@@ -0,0 +1,2 @@
1
+ import { Select } from "./select.mjs";
2
+ export { Select };
@@ -0,0 +1,11 @@
1
+ import { Option } from "../../../types/variables.mjs";
2
+ import { FC, Ref, SelectHTMLAttributes } from "react";
3
+ //#region src/components/form/select/select.d.ts
4
+ type Props = {
5
+ invalid?: boolean;
6
+ options: readonly Option[];
7
+ ref?: Ref<HTMLSelectElement>;
8
+ } & Omit<SelectHTMLAttributes<HTMLSelectElement>, 'className' | 'style'>;
9
+ declare const Select: FC<Props>;
10
+ //#endregion
11
+ export { Select };
@@ -0,0 +1,33 @@
1
+ "use client";
2
+ import { FOCUS_RING_WITHIN } from "../../_internal/focus-ring.mjs";
3
+ import { cn } from "../../../helpers/cn.mjs";
4
+ import { ChevronIcon } from "../../icons/lucide.mjs";
5
+ import { useFormStatus } from "react-dom";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ //#region src/components/form/select/select.tsx
8
+ const Select = ({ invalid = false, options, disabled = false, ref, ...rest }) => {
9
+ const { pending } = useFormStatus();
10
+ return /* @__PURE__ */ jsxs("div", {
11
+ className: cn("relative flex h-fit w-full items-center rounded-xl border border-border-base bg-bg-base vertical:h-full vertical:w-fit", invalid && "border-border-error", (disabled || pending) && "cursor-not-allowed border-border-mute bg-bg-mute", FOCUS_RING_WITHIN),
12
+ children: [/* @__PURE__ */ jsx("select", {
13
+ "aria-invalid": invalid,
14
+ className: cn("w-full grow appearance-none bg-transparent px-3 py-2 text-fg-base focus-visible:outline-hidden vertical:h-full vertical:w-auto", "disabled:cursor-not-allowed"),
15
+ disabled: disabled || pending,
16
+ ref,
17
+ ...rest,
18
+ children: options.map((option) => /* @__PURE__ */ jsx("option", {
19
+ value: option.value,
20
+ children: option.label
21
+ }, option.value))
22
+ }), /* @__PURE__ */ jsx("span", {
23
+ "aria-hidden": true,
24
+ className: "vertical:-rotate-90 pointer-events-none me-3 shrink-0",
25
+ children: /* @__PURE__ */ jsx(ChevronIcon, {
26
+ direction: "down",
27
+ size: "sm"
28
+ })
29
+ })]
30
+ });
31
+ };
32
+ //#endregion
33
+ export { Select };
@@ -0,0 +1,2 @@
1
+ import { Slider } from "./slider.mjs";
2
+ export { Slider };
@@ -0,0 +1,2 @@
1
+ import { Slider } from "./slider.mjs";
2
+ export { Slider };
@@ -0,0 +1,23 @@
1
+ import { FC, InputHTMLAttributes, Ref } from "react";
2
+ //#region src/components/form/slider/slider.d.ts
3
+ type BaseProps = {
4
+ invalid?: boolean;
5
+ step?: number;
6
+ max?: number;
7
+ min?: number;
8
+ ref?: Ref<HTMLInputElement>;
9
+ } & Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'className' | 'style' | 'value' | 'onChange' | 'defaultValue' | 'children' | 'step' | 'max' | 'min'>;
10
+ type ControlledProps = {
11
+ value: number;
12
+ onChange: (value: number) => void;
13
+ defaultValue?: never;
14
+ };
15
+ type UncontrolledProps = {
16
+ defaultValue?: number;
17
+ value?: never;
18
+ onChange?: (value: number) => void;
19
+ };
20
+ type Props = BaseProps & (ControlledProps | UncontrolledProps);
21
+ declare const Slider: FC<Props>;
22
+ //#endregion
23
+ export { Slider };
@@ -0,0 +1,50 @@
1
+ "use client";
2
+ import { cn } from "../../../helpers/cn.mjs";
3
+ import { useControllableState } from "../../../hooks/controllable-state/index.mjs";
4
+ import { useFormStatus } from "react-dom";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ //#region src/components/form/slider/slider.tsx
7
+ const Slider = ({ invalid = false, disabled = false, required = false, value, defaultValue, onChange, ref, step = 1, max = 100, min = 0, ...rest }) => {
8
+ const [currentValue, handleChange] = useControllableState({
9
+ value,
10
+ defaultValue: defaultValue ?? min,
11
+ onChange
12
+ });
13
+ const { pending } = useFormStatus();
14
+ const disabledResolved = disabled || pending;
15
+ const range = max > min ? max - min : 1;
16
+ const progress = (currentValue - min) / range * 100;
17
+ const clampedProgress = `${Math.min(Math.max(progress, 0), 100)}%`;
18
+ return /* @__PURE__ */ jsxs("div", {
19
+ className: cn("relative flex items-center justify-center", "block-8 inline-full vertical:inline-48", disabledResolved && "opacity-50"),
20
+ style: { "--slider-progress": clampedProgress },
21
+ children: [/* @__PURE__ */ jsx("span", {
22
+ "aria-hidden": true,
23
+ className: "bg-bg-mute relative rounded-full block-2 inline-full",
24
+ children: /* @__PURE__ */ jsx("span", {
25
+ "aria-hidden": true,
26
+ className: cn("bg-primary-bg absolute inset-s-0 inset-be-0 block-full inline-(--slider-progress) rounded-full", invalid && "bg-bg-error")
27
+ })
28
+ }), /* @__PURE__ */ jsx("input", {
29
+ ...rest,
30
+ "aria-invalid": invalid,
31
+ "aria-valuemax": max,
32
+ "aria-valuemin": min,
33
+ "aria-valuenow": currentValue,
34
+ className: cn("absolute inset-0 z-10 appearance-none bg-transparent", "h-8 w-full vertical:h-auto vertical:w-8 vertical:[writing-mode:vertical-lr]", "focus:outline-none", "disabled:cursor-not-allowed", "[&::-webkit-slider-runnable-track]:h-2 [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-transparent", "[&::-webkit-slider-thumb]:-mt-1 [&::-webkit-slider-thumb]:size-4 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border [&::-webkit-slider-thumb]:border-border-base [&::-webkit-slider-thumb]:bg-bg-base [&::-webkit-slider-thumb]:shadow-xs", "[&:focus-visible::-webkit-slider-thumb]:border-transparent [&:focus-visible::-webkit-slider-thumb]:ring-2 [&:focus-visible::-webkit-slider-thumb]:ring-border-info", "[&::-moz-range-track]:h-2 [&::-moz-range-track]:rounded-full [&::-moz-range-track]:bg-transparent", "[&::-moz-range-progress]:h-2 [&::-moz-range-progress]:rounded-full [&::-moz-range-progress]:bg-transparent", "[&::-moz-range-thumb]:size-4 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border [&::-moz-range-thumb]:border-border-base [&::-moz-range-thumb]:bg-bg-base [&::-moz-range-thumb]:shadow-xs", "[&:focus-visible::-moz-range-thumb]:border-transparent [&:focus-visible::-moz-range-thumb]:ring-2 [&:focus-visible::-moz-range-thumb]:ring-border-info", invalid && "[&::-moz-range-thumb]:border-border-error [&::-webkit-slider-thumb]:border-border-error [&:focus-visible::-moz-range-thumb]:ring-border-error [&:focus-visible::-webkit-slider-thumb]:ring-border-error"),
35
+ disabled: disabledResolved,
36
+ max,
37
+ min,
38
+ onChange: (event) => {
39
+ handleChange(Number(event.target.value));
40
+ },
41
+ ref,
42
+ required,
43
+ step,
44
+ type: "range",
45
+ value: currentValue
46
+ })]
47
+ });
48
+ };
49
+ //#endregion
50
+ export { Slider };
@@ -0,0 +1,2 @@
1
+ import { Switch } from "./switch.mjs";
2
+ export { Switch };
@@ -0,0 +1,2 @@
1
+ import { Switch } from "./switch.mjs";
2
+ export { Switch };
@@ -0,0 +1,21 @@
1
+ import { ChangeEvent, FC, InputHTMLAttributes, Ref } from "react";
2
+ //#region src/components/form/switch/switch.d.ts
3
+ type BaseProps = {
4
+ invalid?: boolean;
5
+ label: string;
6
+ ref?: Ref<HTMLInputElement>;
7
+ } & Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'role' | 'className' | 'style' | 'value' | 'onChange' | 'defaultChecked' | 'checked' | 'children'>;
8
+ type ControlledProps = {
9
+ checked: boolean;
10
+ onChange: (checked: boolean, event: ChangeEvent<HTMLInputElement>) => void;
11
+ defaultChecked?: never;
12
+ };
13
+ type UncontrolledProps = {
14
+ defaultChecked?: boolean;
15
+ checked?: never;
16
+ onChange?: (checked: boolean, event: ChangeEvent<HTMLInputElement>) => void;
17
+ };
18
+ type Props = BaseProps & (ControlledProps | UncontrolledProps);
19
+ declare const Switch: FC<Props>;
20
+ //#endregion
21
+ export { Switch };
@@ -0,0 +1,50 @@
1
+ "use client";
2
+ import { FOCUS_RING_PEER_NO_BORDER } from "../../_internal/focus-ring.mjs";
3
+ import { cn } from "../../../helpers/cn.mjs";
4
+ import { useControllableState } from "../../../hooks/controllable-state/index.mjs";
5
+ import { useId } from "react";
6
+ import { useFormStatus } from "react-dom";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ //#region src/components/form/switch/switch.tsx
9
+ const Switch = ({ checked, defaultChecked, id, disabled = false, invalid = false, required = false, label, onChange, ref, ...rest }) => {
10
+ const generatedId = useId();
11
+ const inputId = id ?? generatedId;
12
+ const [isSelected, setSelected] = useControllableState({
13
+ value: checked,
14
+ defaultValue: defaultChecked ?? false
15
+ });
16
+ const { pending } = useFormStatus();
17
+ const isControlled = checked !== void 0;
18
+ const disabledResolved = disabled || pending;
19
+ return /* @__PURE__ */ jsxs("label", {
20
+ className: cn("inline-flex w-fit items-center gap-3", disabledResolved ? "cursor-not-allowed text-fg-mute" : "cursor-pointer"),
21
+ htmlFor: inputId,
22
+ children: [/* @__PURE__ */ jsxs("span", {
23
+ className: "relative inline-flex shrink-0",
24
+ children: [/* @__PURE__ */ jsx("input", {
25
+ ...rest,
26
+ "aria-checked": isSelected,
27
+ "aria-invalid": invalid,
28
+ "aria-required": required,
29
+ ...isControlled ? { checked: isSelected } : { defaultChecked },
30
+ className: "peer sr-only",
31
+ disabled: disabledResolved,
32
+ id: inputId,
33
+ onChange: (event) => {
34
+ setSelected(event.target.checked);
35
+ onChange?.(event.target.checked, event);
36
+ },
37
+ ref,
38
+ required,
39
+ role: "switch",
40
+ type: "checkbox"
41
+ }), /* @__PURE__ */ jsx("span", {
42
+ "aria-hidden": true,
43
+ className: cn("inline-flex items-center rounded-full transition-colors", "h-7 w-12 vertical:h-12 vertical:w-7", invalid && "ring-2 ring-border-error", isSelected ? "bg-primary-bg" : "bg-bg-mute", disabledResolved && "bg-bg-subtle", FOCUS_RING_PEER_NO_BORDER, "peer-focus-visible:ring-offset-2"),
44
+ children: /* @__PURE__ */ jsx("span", { className: cn("ms-0.5 size-5 rounded-full bg-bg-base shadow-xs transition-transform", isSelected && "translate-x-5 vertical:translate-x-0 vertical:translate-y-5", disabledResolved && "bg-bg-emphasize") })
45
+ })]
46
+ }), label ? /* @__PURE__ */ jsx("span", { children: label }) : null]
47
+ });
48
+ };
49
+ //#endregion
50
+ export { Switch };
@@ -0,0 +1,2 @@
1
+ import { TextField } from "./text-field.mjs";
2
+ export { TextField };
@@ -0,0 +1,2 @@
1
+ import { TextField } from "./text-field.mjs";
2
+ export { TextField };
@@ -0,0 +1,11 @@
1
+ import { FC, HTMLInputTypeAttribute, InputHTMLAttributes, Ref } from "react";
2
+ //#region src/components/form/text-field/text-field.d.ts
3
+ type TextInputType = Extract<HTMLInputTypeAttribute, 'text' | 'email' | 'tel' | 'url' | 'search'>;
4
+ type Props = {
5
+ invalid?: boolean;
6
+ ref?: Ref<HTMLInputElement>;
7
+ type?: TextInputType;
8
+ } & Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'style' | 'type'>;
9
+ declare const TextField: FC<Props>;
10
+ //#endregion
11
+ export { TextField };