@me1a/ui 2.2.1 → 2.2.2

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 (376) hide show
  1. package/dist/atoms/accordion.d.mts +94 -0
  2. package/dist/atoms/accordion.d.ts +94 -0
  3. package/dist/atoms/accordion.js +2 -0
  4. package/dist/atoms/accordion.js.map +1 -0
  5. package/dist/atoms/accordion.mjs +2 -0
  6. package/dist/atoms/accordion.mjs.map +1 -0
  7. package/dist/atoms/avatar.d.mts +34 -0
  8. package/dist/atoms/avatar.d.ts +34 -0
  9. package/dist/atoms/avatar.js +2 -0
  10. package/dist/atoms/avatar.js.map +1 -0
  11. package/dist/atoms/avatar.mjs +2 -0
  12. package/dist/atoms/avatar.mjs.map +1 -0
  13. package/dist/atoms/badge.d.mts +40 -0
  14. package/dist/atoms/badge.d.ts +40 -0
  15. package/dist/atoms/badge.js +2 -0
  16. package/dist/atoms/badge.js.map +1 -0
  17. package/dist/atoms/badge.mjs +2 -0
  18. package/dist/atoms/badge.mjs.map +1 -0
  19. package/dist/atoms/box.d.mts +50 -0
  20. package/dist/atoms/box.d.ts +50 -0
  21. package/dist/atoms/box.js +2 -0
  22. package/dist/atoms/box.js.map +1 -0
  23. package/dist/atoms/box.mjs +2 -0
  24. package/dist/atoms/box.mjs.map +1 -0
  25. package/dist/atoms/breadcrumb.d.mts +35 -0
  26. package/dist/atoms/breadcrumb.d.ts +35 -0
  27. package/dist/atoms/breadcrumb.js +2 -0
  28. package/dist/atoms/breadcrumb.js.map +1 -0
  29. package/dist/atoms/breadcrumb.mjs +2 -0
  30. package/dist/atoms/breadcrumb.mjs.map +1 -0
  31. package/dist/{tooltip-B4jzaurK.d.mts → atoms/button.d.mts} +1 -23
  32. package/dist/{tooltip-B4jzaurK.d.ts → atoms/button.d.ts} +1 -23
  33. package/dist/atoms/button.js +2 -0
  34. package/dist/atoms/button.js.map +1 -0
  35. package/dist/atoms/button.mjs +2 -0
  36. package/dist/atoms/button.mjs.map +1 -0
  37. package/dist/atoms/checkbox.d.mts +21 -0
  38. package/dist/atoms/checkbox.d.ts +21 -0
  39. package/dist/atoms/checkbox.js +2 -0
  40. package/dist/atoms/checkbox.js.map +1 -0
  41. package/dist/atoms/checkbox.mjs +2 -0
  42. package/dist/atoms/checkbox.mjs.map +1 -0
  43. package/dist/atoms/collapsible.d.mts +26 -0
  44. package/dist/atoms/collapsible.d.ts +26 -0
  45. package/dist/atoms/collapsible.js +2 -0
  46. package/dist/atoms/collapsible.js.map +1 -0
  47. package/dist/atoms/collapsible.mjs +2 -0
  48. package/dist/atoms/collapsible.mjs.map +1 -0
  49. package/dist/atoms/command.d.mts +122 -0
  50. package/dist/atoms/command.d.ts +122 -0
  51. package/dist/atoms/command.js +2 -0
  52. package/dist/atoms/command.js.map +1 -0
  53. package/dist/atoms/command.mjs +2 -0
  54. package/dist/atoms/command.mjs.map +1 -0
  55. package/dist/atoms/container.js +2 -0
  56. package/dist/atoms/container.js.map +1 -0
  57. package/dist/atoms/container.mjs +2 -0
  58. package/dist/atoms/container.mjs.map +1 -0
  59. package/dist/atoms/dialog.d.mts +35 -0
  60. package/dist/atoms/dialog.d.ts +35 -0
  61. package/dist/atoms/dialog.js +2 -0
  62. package/dist/atoms/dialog.js.map +1 -0
  63. package/dist/atoms/dialog.mjs +2 -0
  64. package/dist/atoms/dialog.mjs.map +1 -0
  65. package/dist/atoms/input.d.mts +12 -0
  66. package/dist/atoms/input.d.ts +12 -0
  67. package/dist/atoms/input.js +2 -0
  68. package/dist/atoms/input.js.map +1 -0
  69. package/dist/atoms/input.mjs +2 -0
  70. package/dist/atoms/input.mjs.map +1 -0
  71. package/dist/atoms/label.d.mts +18 -0
  72. package/dist/atoms/label.d.ts +18 -0
  73. package/dist/atoms/label.js +2 -0
  74. package/dist/atoms/label.js.map +1 -0
  75. package/dist/atoms/label.mjs +2 -0
  76. package/dist/atoms/label.mjs.map +1 -0
  77. package/dist/atoms/page-loader.d.mts +29 -0
  78. package/dist/atoms/page-loader.d.ts +29 -0
  79. package/dist/atoms/page-loader.js +2 -0
  80. package/dist/atoms/page-loader.js.map +1 -0
  81. package/dist/atoms/page-loader.mjs +2 -0
  82. package/dist/atoms/page-loader.mjs.map +1 -0
  83. package/dist/atoms/pagination.d.mts +105 -0
  84. package/dist/atoms/pagination.d.ts +105 -0
  85. package/dist/atoms/pagination.js +2 -0
  86. package/dist/atoms/pagination.js.map +1 -0
  87. package/dist/atoms/pagination.mjs +2 -0
  88. package/dist/atoms/pagination.mjs.map +1 -0
  89. package/dist/atoms/popover.d.mts +30 -0
  90. package/dist/atoms/popover.d.ts +30 -0
  91. package/dist/atoms/popover.js +2 -0
  92. package/dist/atoms/popover.js.map +1 -0
  93. package/dist/atoms/popover.mjs +2 -0
  94. package/dist/atoms/popover.mjs.map +1 -0
  95. package/dist/{checkbox-DxgDKaHx.d.mts → atoms/radio-group.d.mts} +4 -50
  96. package/dist/{checkbox-DxgDKaHx.d.ts → atoms/radio-group.d.ts} +4 -50
  97. package/dist/atoms/radio-group.js +2 -0
  98. package/dist/atoms/radio-group.js.map +1 -0
  99. package/dist/atoms/radio-group.mjs +2 -0
  100. package/dist/atoms/radio-group.mjs.map +1 -0
  101. package/dist/atoms/resizable.d.mts +53 -0
  102. package/dist/atoms/resizable.d.ts +53 -0
  103. package/dist/atoms/resizable.js +2 -0
  104. package/dist/atoms/resizable.js.map +1 -0
  105. package/dist/atoms/resizable.mjs +2 -0
  106. package/dist/atoms/resizable.mjs.map +1 -0
  107. package/dist/atoms/separator.d.mts +13 -0
  108. package/dist/atoms/separator.d.ts +13 -0
  109. package/dist/atoms/separator.js +2 -0
  110. package/dist/atoms/separator.js.map +1 -0
  111. package/dist/atoms/separator.mjs +2 -0
  112. package/dist/atoms/separator.mjs.map +1 -0
  113. package/dist/atoms/sheet.d.mts +42 -0
  114. package/dist/atoms/sheet.d.ts +42 -0
  115. package/dist/atoms/sheet.js +2 -0
  116. package/dist/atoms/sheet.js.map +1 -0
  117. package/dist/atoms/sheet.mjs +2 -0
  118. package/dist/atoms/sheet.mjs.map +1 -0
  119. package/dist/atoms/skeleton.js +2 -0
  120. package/dist/atoms/skeleton.js.map +1 -0
  121. package/dist/atoms/skeleton.mjs +2 -0
  122. package/dist/atoms/skeleton.mjs.map +1 -0
  123. package/dist/atoms/stack.d.mts +121 -0
  124. package/dist/atoms/stack.d.ts +121 -0
  125. package/dist/atoms/stack.js +2 -0
  126. package/dist/atoms/stack.js.map +1 -0
  127. package/dist/atoms/stack.mjs +2 -0
  128. package/dist/atoms/stack.mjs.map +1 -0
  129. package/dist/atoms/switch.d.mts +21 -0
  130. package/dist/atoms/switch.d.ts +21 -0
  131. package/dist/atoms/switch.js +2 -0
  132. package/dist/atoms/switch.js.map +1 -0
  133. package/dist/atoms/switch.mjs +2 -0
  134. package/dist/atoms/switch.mjs.map +1 -0
  135. package/dist/atoms/table.d.mts +53 -0
  136. package/dist/atoms/table.d.ts +53 -0
  137. package/dist/atoms/table.js +2 -0
  138. package/dist/atoms/table.js.map +1 -0
  139. package/dist/atoms/table.mjs +2 -0
  140. package/dist/atoms/table.mjs.map +1 -0
  141. package/dist/atoms/text-field.d.mts +65 -0
  142. package/dist/atoms/text-field.d.ts +65 -0
  143. package/dist/atoms/text-field.js +2 -0
  144. package/dist/atoms/text-field.js.map +1 -0
  145. package/dist/atoms/text-field.mjs +2 -0
  146. package/dist/atoms/text-field.mjs.map +1 -0
  147. package/dist/atoms/textarea.js +2 -0
  148. package/dist/atoms/textarea.js.map +1 -0
  149. package/dist/atoms/textarea.mjs +2 -0
  150. package/dist/atoms/textarea.mjs.map +1 -0
  151. package/dist/{toast-2xT7L1tJ.d.mts → atoms/toast.d.mts} +1 -1
  152. package/dist/{toast-2xT7L1tJ.d.ts → atoms/toast.d.ts} +1 -1
  153. package/dist/atoms/toast.js +2 -0
  154. package/dist/atoms/toast.js.map +1 -0
  155. package/dist/atoms/toast.mjs +2 -0
  156. package/dist/atoms/toast.mjs.map +1 -0
  157. package/dist/atoms/toaster.d.mts +26 -0
  158. package/dist/atoms/toaster.d.ts +26 -0
  159. package/dist/atoms/toaster.js +2 -0
  160. package/dist/atoms/toaster.js.map +1 -0
  161. package/dist/atoms/toaster.mjs +2 -0
  162. package/dist/atoms/toaster.mjs.map +1 -0
  163. package/dist/atoms/tooltip.d.mts +25 -0
  164. package/dist/atoms/tooltip.d.ts +25 -0
  165. package/dist/atoms/tooltip.js +2 -0
  166. package/dist/atoms/tooltip.js.map +1 -0
  167. package/dist/atoms/tooltip.mjs +2 -0
  168. package/dist/atoms/tooltip.mjs.map +1 -0
  169. package/dist/atoms/typography.d.mts +24 -0
  170. package/dist/atoms/typography.d.ts +24 -0
  171. package/dist/atoms/typography.js +2 -0
  172. package/dist/atoms/typography.js.map +1 -0
  173. package/dist/atoms/typography.mjs +2 -0
  174. package/dist/atoms/typography.mjs.map +1 -0
  175. package/dist/atoms.d.mts +213 -27
  176. package/dist/atoms.d.ts +213 -27
  177. package/dist/atoms.js +2 -0
  178. package/dist/atoms.js.map +1 -0
  179. package/dist/atoms.mjs +2 -0
  180. package/dist/atoms.mjs.map +1 -0
  181. package/dist/hooks.d.mts +10 -4
  182. package/dist/hooks.d.ts +10 -4
  183. package/dist/hooks.js +2 -0
  184. package/dist/hooks.js.map +1 -0
  185. package/dist/hooks.mjs +2 -0
  186. package/dist/hooks.mjs.map +1 -0
  187. package/dist/index.d.mts +2619 -30
  188. package/dist/index.d.ts +2619 -30
  189. package/dist/index.js +2 -0
  190. package/dist/index.js.map +1 -0
  191. package/dist/index.mjs +2 -0
  192. package/dist/index.mjs.map +1 -0
  193. package/dist/molecules/card.d.mts +72 -0
  194. package/dist/molecules/card.d.ts +72 -0
  195. package/dist/molecules/card.js +2 -0
  196. package/dist/molecules/card.js.map +1 -0
  197. package/dist/molecules/card.mjs +2 -0
  198. package/dist/molecules/card.mjs.map +1 -0
  199. package/dist/molecules/navigation-menu.d.mts +103 -0
  200. package/dist/molecules/navigation-menu.d.ts +103 -0
  201. package/dist/molecules/navigation-menu.js +2 -0
  202. package/dist/molecules/navigation-menu.js.map +1 -0
  203. package/dist/molecules/navigation-menu.mjs +2 -0
  204. package/dist/molecules/navigation-menu.mjs.map +1 -0
  205. package/dist/molecules/tabs.d.mts +32 -0
  206. package/dist/molecules/tabs.d.ts +32 -0
  207. package/dist/molecules/tabs.js +2 -0
  208. package/dist/molecules/tabs.js.map +1 -0
  209. package/dist/molecules/tabs.mjs +2 -0
  210. package/dist/molecules/tabs.mjs.map +1 -0
  211. package/dist/molecules.d.mts +1 -1
  212. package/dist/molecules.d.ts +1 -1
  213. package/dist/molecules.js +2 -0
  214. package/dist/molecules.js.map +1 -0
  215. package/dist/molecules.mjs +2 -0
  216. package/dist/molecules.mjs.map +1 -0
  217. package/dist/organisms/drawer.d.mts +63 -0
  218. package/dist/organisms/drawer.d.ts +63 -0
  219. package/dist/organisms/drawer.js +2 -0
  220. package/dist/organisms/drawer.js.map +1 -0
  221. package/dist/organisms/drawer.mjs +2 -0
  222. package/dist/organisms/drawer.mjs.map +1 -0
  223. package/dist/organisms/dropdown-menu.d.mts +335 -0
  224. package/dist/organisms/dropdown-menu.d.ts +335 -0
  225. package/dist/organisms/dropdown-menu.js +2 -0
  226. package/dist/organisms/dropdown-menu.js.map +1 -0
  227. package/dist/organisms/dropdown-menu.mjs +2 -0
  228. package/dist/organisms/dropdown-menu.mjs.map +1 -0
  229. package/dist/organisms/sidebar.d.mts +328 -0
  230. package/dist/organisms/sidebar.d.ts +328 -0
  231. package/dist/organisms/sidebar.js +2 -0
  232. package/dist/organisms/sidebar.js.map +1 -0
  233. package/dist/organisms/sidebar.mjs +2 -0
  234. package/dist/organisms/sidebar.mjs.map +1 -0
  235. package/dist/organisms.d.mts +56 -12
  236. package/dist/organisms.d.ts +56 -12
  237. package/dist/organisms.js +2 -0
  238. package/dist/organisms.js.map +1 -0
  239. package/dist/organisms.mjs +2 -0
  240. package/dist/organisms.mjs.map +1 -0
  241. package/dist/rhf/form.d.mts +96 -0
  242. package/dist/rhf/form.d.ts +96 -0
  243. package/dist/rhf/form.js +2 -0
  244. package/dist/rhf/form.js.map +1 -0
  245. package/dist/rhf/form.mjs +2 -0
  246. package/dist/rhf/form.mjs.map +1 -0
  247. package/dist/rhf/rhf-checkbox.d.mts +57 -0
  248. package/dist/rhf/rhf-checkbox.d.ts +57 -0
  249. package/dist/rhf/rhf-checkbox.js +2 -0
  250. package/dist/rhf/rhf-checkbox.js.map +1 -0
  251. package/dist/rhf/rhf-checkbox.mjs +2 -0
  252. package/dist/rhf/rhf-checkbox.mjs.map +1 -0
  253. package/dist/rhf/rhf-multi-select.d.mts +84 -0
  254. package/dist/rhf/rhf-multi-select.d.ts +84 -0
  255. package/dist/rhf/rhf-multi-select.js +2 -0
  256. package/dist/rhf/rhf-multi-select.js.map +1 -0
  257. package/dist/rhf/rhf-multi-select.mjs +2 -0
  258. package/dist/rhf/rhf-multi-select.mjs.map +1 -0
  259. package/dist/rhf/rhf-radio-button-group.d.mts +73 -0
  260. package/dist/rhf/rhf-radio-button-group.d.ts +73 -0
  261. package/dist/rhf/rhf-radio-button-group.js +2 -0
  262. package/dist/rhf/rhf-radio-button-group.js.map +1 -0
  263. package/dist/rhf/rhf-radio-button-group.mjs +2 -0
  264. package/dist/rhf/rhf-radio-button-group.mjs.map +1 -0
  265. package/dist/rhf/rhf-radio-group.d.mts +103 -0
  266. package/dist/rhf/rhf-radio-group.d.ts +103 -0
  267. package/dist/rhf/rhf-radio-group.js +2 -0
  268. package/dist/rhf/rhf-radio-group.js.map +1 -0
  269. package/dist/rhf/rhf-radio-group.mjs +2 -0
  270. package/dist/rhf/rhf-radio-group.mjs.map +1 -0
  271. package/dist/rhf/rhf-select.d.mts +80 -0
  272. package/dist/rhf/rhf-select.d.ts +80 -0
  273. package/dist/rhf/rhf-select.js +2 -0
  274. package/dist/rhf/rhf-select.js.map +1 -0
  275. package/dist/rhf/rhf-select.mjs +2 -0
  276. package/dist/rhf/rhf-select.mjs.map +1 -0
  277. package/dist/rhf/rhf-switch.d.mts +57 -0
  278. package/dist/rhf/rhf-switch.d.ts +57 -0
  279. package/dist/rhf/rhf-switch.js +2 -0
  280. package/dist/rhf/rhf-switch.js.map +1 -0
  281. package/dist/rhf/rhf-switch.mjs +2 -0
  282. package/dist/rhf/rhf-switch.mjs.map +1 -0
  283. package/dist/rhf/rhf-textarea.d.mts +66 -0
  284. package/dist/rhf/rhf-textarea.d.ts +66 -0
  285. package/dist/rhf/rhf-textarea.js +2 -0
  286. package/dist/rhf/rhf-textarea.js.map +1 -0
  287. package/dist/rhf/rhf-textarea.mjs +2 -0
  288. package/dist/rhf/rhf-textarea.mjs.map +1 -0
  289. package/dist/rhf.d.mts +213 -7
  290. package/dist/rhf.d.ts +213 -7
  291. package/dist/rhf.js +2 -0
  292. package/dist/rhf.js.map +1 -0
  293. package/dist/rhf.mjs +2 -0
  294. package/dist/rhf.mjs.map +1 -0
  295. package/dist/types.js +2 -0
  296. package/dist/{types.cjs.js.map → types.js.map} +1 -1
  297. package/dist/types.mjs +2 -0
  298. package/dist/{types.esm.js.map → types.mjs.map} +1 -1
  299. package/dist/{chunk-SL2ZUI4G.cjs.js → utils.js} +2 -2
  300. package/dist/utils.js.map +1 -0
  301. package/dist/utils.mjs +2 -0
  302. package/dist/utils.mjs.map +1 -0
  303. package/package.json +241 -15
  304. package/dist/atoms.cjs.js +0 -2
  305. package/dist/atoms.cjs.js.map +0 -1
  306. package/dist/atoms.esm.js +0 -2
  307. package/dist/atoms.esm.js.map +0 -1
  308. package/dist/chunk-23T2PH5G.esm.js +0 -2
  309. package/dist/chunk-23T2PH5G.esm.js.map +0 -1
  310. package/dist/chunk-2QG3QTSW.cjs.js +0 -2
  311. package/dist/chunk-2QG3QTSW.cjs.js.map +0 -1
  312. package/dist/chunk-C26U3FL4.esm.js +0 -2
  313. package/dist/chunk-C26U3FL4.esm.js.map +0 -1
  314. package/dist/chunk-DTM5LZHM.cjs.js +0 -2
  315. package/dist/chunk-DTM5LZHM.cjs.js.map +0 -1
  316. package/dist/chunk-HW32JE75.cjs.js +0 -2
  317. package/dist/chunk-HW32JE75.cjs.js.map +0 -1
  318. package/dist/chunk-JIRS6MWF.cjs.js +0 -2
  319. package/dist/chunk-JIRS6MWF.cjs.js.map +0 -1
  320. package/dist/chunk-JKTYFZ5M.esm.js +0 -2
  321. package/dist/chunk-JKTYFZ5M.esm.js.map +0 -1
  322. package/dist/chunk-JUZG25DH.esm.js +0 -2
  323. package/dist/chunk-JUZG25DH.esm.js.map +0 -1
  324. package/dist/chunk-KOYJODOP.cjs.js +0 -2
  325. package/dist/chunk-KOYJODOP.cjs.js.map +0 -1
  326. package/dist/chunk-M4S5YZ56.esm.js +0 -2
  327. package/dist/chunk-M4S5YZ56.esm.js.map +0 -1
  328. package/dist/chunk-MOYOCJW6.esm.js +0 -2
  329. package/dist/chunk-MOYOCJW6.esm.js.map +0 -1
  330. package/dist/chunk-MVWMLXLL.cjs.js +0 -2
  331. package/dist/chunk-MVWMLXLL.cjs.js.map +0 -1
  332. package/dist/chunk-SL2ZUI4G.cjs.js.map +0 -1
  333. package/dist/chunk-STRDPP3B.esm.js +0 -2
  334. package/dist/chunk-STRDPP3B.esm.js.map +0 -1
  335. package/dist/chunk-U4NMIMU7.esm.js +0 -2
  336. package/dist/chunk-U4NMIMU7.esm.js.map +0 -1
  337. package/dist/chunk-UK47BFA3.cjs.js +0 -2
  338. package/dist/chunk-UK47BFA3.cjs.js.map +0 -1
  339. package/dist/chunk-UTVXFZLD.esm.js +0 -2
  340. package/dist/chunk-UTVXFZLD.esm.js.map +0 -1
  341. package/dist/chunk-WJNYKJP6.cjs.js +0 -2
  342. package/dist/chunk-WJNYKJP6.cjs.js.map +0 -1
  343. package/dist/chunk-YEZB7AOJ.esm.js +0 -2
  344. package/dist/chunk-YEZB7AOJ.esm.js.map +0 -1
  345. package/dist/chunk-YGLYFSF6.cjs.js +0 -2
  346. package/dist/chunk-YGLYFSF6.cjs.js.map +0 -1
  347. package/dist/hooks.cjs.js +0 -2
  348. package/dist/hooks.cjs.js.map +0 -1
  349. package/dist/hooks.esm.js +0 -2
  350. package/dist/hooks.esm.js.map +0 -1
  351. package/dist/index.cjs.js +0 -2
  352. package/dist/index.cjs.js.map +0 -1
  353. package/dist/index.esm.js +0 -2
  354. package/dist/index.esm.js.map +0 -1
  355. package/dist/molecules.cjs.js +0 -2
  356. package/dist/molecules.cjs.js.map +0 -1
  357. package/dist/molecules.esm.js +0 -2
  358. package/dist/molecules.esm.js.map +0 -1
  359. package/dist/organisms.cjs.js +0 -2
  360. package/dist/organisms.cjs.js.map +0 -1
  361. package/dist/organisms.esm.js +0 -2
  362. package/dist/organisms.esm.js.map +0 -1
  363. package/dist/rhf.cjs.js +0 -2
  364. package/dist/rhf.cjs.js.map +0 -1
  365. package/dist/rhf.esm.js +0 -2
  366. package/dist/rhf.esm.js.map +0 -1
  367. package/dist/types.cjs.js +0 -2
  368. package/dist/types.d.mts +0 -2
  369. package/dist/types.d.ts +0 -2
  370. package/dist/types.esm.js +0 -2
  371. package/dist/utils.cjs.js +0 -2
  372. package/dist/utils.cjs.js.map +0 -1
  373. package/dist/utils.d.mts +0 -5
  374. package/dist/utils.d.ts +0 -5
  375. package/dist/utils.esm.js +0 -2
  376. package/dist/utils.esm.js.map +0 -1
@@ -0,0 +1,96 @@
1
+ import * as _radix_ui_react_slot from '@radix-ui/react-slot';
2
+ import { Slot } from '@radix-ui/react-slot';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
+ import * as react_hook_form from 'react-hook-form';
5
+ import { FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
6
+ import * as React from 'react';
7
+ import * as LabelPrimitive from '@radix-ui/react-label';
8
+
9
+ declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
10
+ declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => react_jsx_runtime.JSX.Element;
11
+ declare const useFormField: () => {
12
+ invalid: boolean;
13
+ isDirty: boolean;
14
+ isTouched: boolean;
15
+ isValidating: boolean;
16
+ error?: react_hook_form.FieldError;
17
+ id: string;
18
+ name: string;
19
+ formItemId: string;
20
+ formDescriptionId: string;
21
+ formMessageId: string;
22
+ };
23
+ declare const FormItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
24
+ declare const FormLabel: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
25
+ declare const FormControl: React.ForwardRefExoticComponent<Omit<_radix_ui_react_slot.SlotProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
26
+ declare const FormDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
27
+ declare const FormMessage: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
28
+
29
+ /**
30
+ * Props interface for the Form component.
31
+ * Extends react-hook-form's FormProvider props.
32
+ */
33
+ interface FormProps<TFieldValues extends FieldValues = FieldValues> {
34
+ /**
35
+ * The form context value
36
+ */
37
+ context: React.Context<TFieldValues>;
38
+ /**
39
+ * The form children
40
+ */
41
+ children: React.ReactNode;
42
+ }
43
+ /**
44
+ * Props interface for the FormField component.
45
+ * Extends react-hook-form's Controller props.
46
+ */
47
+ interface FormFieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends ControllerProps<TFieldValues, TName> {
48
+ }
49
+ /**
50
+ * Props interface for the FormItem component.
51
+ * Extends HTML div attributes.
52
+ */
53
+ interface FormItemProps extends React.HTMLAttributes<HTMLDivElement> {
54
+ }
55
+ /**
56
+ * Props interface for the FormLabel component.
57
+ * Extends Radix UI Label props.
58
+ */
59
+ interface FormLabelProps extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> {
60
+ }
61
+ /**
62
+ * Props interface for the FormControl component.
63
+ * Extends Radix UI Slot props.
64
+ */
65
+ interface FormControlProps extends React.ComponentPropsWithoutRef<typeof Slot> {
66
+ }
67
+ /**
68
+ * Props interface for the FormDescription component.
69
+ * Extends HTML paragraph attributes.
70
+ */
71
+ interface FormDescriptionProps extends React.HTMLAttributes<HTMLParagraphElement> {
72
+ }
73
+ /**
74
+ * Props interface for the FormMessage component.
75
+ * Extends HTML paragraph attributes.
76
+ */
77
+ interface FormMessageProps extends React.HTMLAttributes<HTMLParagraphElement> {
78
+ /**
79
+ * The message content
80
+ */
81
+ children?: React.ReactNode;
82
+ }
83
+ /**
84
+ * Context value type for form field context
85
+ */
86
+ type FormFieldContextValue<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {
87
+ name: TName;
88
+ };
89
+ /**
90
+ * Context value type for form item context
91
+ */
92
+ type FormItemContextValue = {
93
+ id: string;
94
+ };
95
+
96
+ export { Form, FormControl, type FormControlProps, FormDescription, type FormDescriptionProps, FormField, type FormFieldContextValue, type FormFieldProps, FormItem, type FormItemContextValue, type FormItemProps, FormLabel, type FormLabelProps, FormMessage, type FormMessageProps, type FormProps, useFormField };
@@ -0,0 +1,2 @@
1
+ 'use strict';var o=require('react'),reactSlot=require('@radix-ui/react-slot'),reactHookForm=require('react-hook-form'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),p=require('@radix-ui/react-label'),classVarianceAuthority=require('class-variance-authority'),jsxRuntime=require('react/jsx-runtime');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var o__namespace=/*#__PURE__*/_interopNamespace(o);var p__namespace=/*#__PURE__*/_interopNamespace(p);function s(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var I=classVarianceAuthority.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),d=o__namespace.forwardRef(({className:e,...r},t)=>jsxRuntime.jsx(p__namespace.Root,{ref:t,className:s(I(),e),...r}));d.displayName=p__namespace.Root.displayName;var N=reactHookForm.FormProvider,f=o__namespace.createContext({}),w=({...e})=>jsxRuntime.jsx(f.Provider,{value:{name:e.name},children:jsxRuntime.jsx(reactHookForm.Controller,{...e})}),n=()=>{let e=o__namespace.useContext(f),r=o__namespace.useContext(u),{getFieldState:t,formState:a}=reactHookForm.useFormContext(),m=t(e.name,a);if(!e)throw new Error("useFormField should be used within <FormField>");let{id:i}=r;return {id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...m}},u=o__namespace.createContext({}),R=o__namespace.forwardRef(({className:e,...r},t)=>{let a=o__namespace.useId();return jsxRuntime.jsx(u.Provider,{value:{id:a},children:jsxRuntime.jsx("div",{ref:t,className:s("space-y-2",e),...r})})});R.displayName="FormItem";var P=o__namespace.forwardRef(({className:e,...r},t)=>{let{error:a,formItemId:m}=n();return jsxRuntime.jsx(d,{ref:t,className:s(a&&"text-destructive",e),htmlFor:m,...r})});P.displayName="FormLabel";var x=o__namespace.forwardRef(({...e},r)=>{let{error:t,formItemId:a,formDescriptionId:m,formMessageId:i}=n();return jsxRuntime.jsx(reactSlot.Slot,{ref:r,id:a,"aria-describedby":t?`${m} ${i}`:`${m}`,"aria-invalid":!!t,...e})});x.displayName="FormControl";var C=o__namespace.forwardRef(({className:e,...r},t)=>{let{formDescriptionId:a}=n();return jsxRuntime.jsx("p",{ref:t,id:a,className:s("text-sm text-muted-foreground",e),...r})});C.displayName="FormDescription";var b=o__namespace.forwardRef(({className:e,children:r,...t},a)=>{let{error:m,formMessageId:i}=n(),F=m?String(m?.message??""):r;return F?jsxRuntime.jsx("p",{ref:a,id:i,className:s("text-sm font-medium text-destructive",e),...t,children:F}):null});b.displayName="FormMessage";exports.Form=N;exports.FormControl=x;exports.FormDescription=C;exports.FormField=w;exports.FormItem=R;exports.FormLabel=P;exports.FormMessage=b;exports.useFormField=n;//# sourceMappingURL=form.js.map
2
+ //# sourceMappingURL=form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/cn.ts","../../src/components/atoms/label/label.tsx","../../src/components/rhf/form/form.tsx"],"names":["cn","inputs","twMerge","clsx","labelVariants","cva","Label","c","className","props","ref","jsx","p","Form","FormProvider","FormFieldContext","o","FormField","Controller","useFormField","fieldContext","itemContext","FormItemContext","getFieldState","formState","useFormContext","fieldState","id","FormItem","FormLabel","error","formItemId","FormControl","formDescriptionId","formMessageId","Slot","FormDescription","FormMessage","children","body"],"mappings":"mtBAGO,SAASA,CAAAA,CAAAA,GAAMC,EAAsB,CAC1C,OAAOC,sBAAQC,SAAKF,CAAAA,CAAM,CAAC,CAC7B,CCCA,IAAMG,CAAAA,CAAgBC,0BACpB,CAAA,4FACF,EAaMC,CAAc,CAAAC,YAAA,CAAA,UAAA,CAClB,CAAC,CAAE,SAAA,CAAAC,EAAW,GAAGC,CAAM,CAAGC,CAAAA,CAAAA,GACxBC,cAAgB,CAAAC,YAAA,CAAA,IAAA,CAAf,CAAoB,GAAKF,CAAAA,CAAAA,CAAK,UAAWV,CAAGI,CAAAA,CAAAA,GAAiBI,CAAS,CAAA,CAAI,GAAGC,CAAAA,CAAO,CAEzF,CAAA,CACAH,EAAM,WAA6B,CAAAM,YAAA,CAAA,IAAA,CAAK,YCTlCC,IAAAA,CAAAA,CAAOC,0BASPC,CAAAA,CAAAA,CAAyBC,YAAqC,CAAA,aAAA,CAAA,EAA2B,CAEzFC,CAAAA,CAAAA,CAAY,CAGhB,CACA,GAAGR,CACL,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,GAAM,CAAE,iBAAA,CAAAuB,CAAkB,CAAId,CAAAA,CAAAA,GAE9B,OACER,cAAAA,CAAC,KACC,GAAKD,CAAAA,CAAAA,CACL,EAAIuB,CAAAA,CAAAA,CACJ,SAAWjC,CAAAA,CAAAA,CAAG,gCAAiCQ,CAAS,CAAA,CACvD,GAAGC,CACN,CAAA,CAEJ,CAAC,EACD2B,CAAAA,CAAgB,WAAc,CAAA,iBAAA,CAExBC,IAAAA,CAAAA,CAAoBrB,wBAGxB,CAAC,CAAE,UAAAR,CAAW,CAAA,QAAA,CAAA8B,EAAU,GAAG7B,CAAM,CAAGC,CAAAA,CAAAA,GAAQ,CAC5C,GAAM,CAAE,KAAAoB,CAAAA,CAAAA,CAAO,cAAAI,CAAc,CAAA,CAAIf,GAC3BoB,CAAAA,CAAAA,CAAOT,CAAQ,CAAA,MAAA,CAAOA,CAAO,EAAA,OAAA,EAAW,EAAE,CAAIQ,CAAAA,CAAAA,CAEpD,OAAKC,CAKH5B,CAAAA,cAAAA,CAAC,KACC,GAAKD,CAAAA,CAAAA,CACL,EAAIwB,CAAAA,CAAAA,CACJ,SAAWlC,CAAAA,CAAAA,CAAG,uCAAwCQ,CAAS,CAAA,CAC9D,GAAGC,CAAAA,CAEH,QAAA8B,CAAAA,CAAAA,CACH,EAXO,IAaX,CAAC,EACDF,CAAAA,CAAY,WAAc,CAAA,aAAA","file":"form.js","sourcesContent":["import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/utils/index\"\n\nconst labelVariants = cva(\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n)\n\nexport interface LabelProps\n extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>,\n VariantProps<typeof labelVariants> {}\n\n/**\n * Label component for creating accessible labels.\n * Built on top of Radix UI's Label primitive.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-label--docs\n *\n */\nconst Label = React.forwardRef<React.ElementRef<typeof LabelPrimitive.Root>, LabelProps>(\n ({ className, ...props }, ref) => (\n <LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props} />\n )\n)\nLabel.displayName = LabelPrimitive.Root.displayName\n\nexport { Label }\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport {\n Controller,\n FormProvider,\n useFormContext,\n type ControllerProps,\n type FieldPath,\n type FieldValues\n} from \"react-hook-form\"\n\nimport { cn } from \"@/utils/cn\"\nimport { Label } from \"@/components/atoms/label\"\n\nconst Form = FormProvider\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n> = {\n name: TName\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue)\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n )\n}\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext)\n const itemContext = React.useContext(FormItemContext)\n const { getFieldState, formState } = useFormContext()\n\n const fieldState = getFieldState(fieldContext.name, formState)\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\")\n }\n\n const { id } = itemContext\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState\n }\n}\n\ntype FormItemContextValue = {\n id: string\n}\n\nconst FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue)\n\nconst FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const id = React.useId()\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn(\"space-y-2\", className)} {...props} />\n </FormItemContext.Provider>\n )\n }\n)\nFormItem.displayName = \"FormItem\"\n\nconst FormLabel = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField()\n\n return (\n <Label\n ref={ref}\n className={cn(error && \"text-destructive\", className)}\n htmlFor={formItemId}\n {...props}\n />\n )\n})\nFormLabel.displayName = \"FormLabel\"\n\nconst FormControl = React.forwardRef<\n React.ElementRef<typeof Slot>,\n React.ComponentPropsWithoutRef<typeof Slot>\n>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField()\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n )\n})\nFormControl.displayName = \"FormControl\"\n\nconst FormDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField()\n\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n )\n})\nFormDescription.displayName = \"FormDescription\"\n\nconst FormMessage = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField()\n const body = error ? String(error?.message ?? \"\") : children\n\n if (!body) {\n return null\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn(\"text-sm font-medium text-destructive\", className)}\n {...props}\n >\n {body}\n </p>\n )\n})\nFormMessage.displayName = \"FormMessage\"\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import*as o from'react';import {Slot}from'@radix-ui/react-slot';import {useFormContext,FormProvider,Controller}from'react-hook-form';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import*as p from'@radix-ui/react-label';import {cva}from'class-variance-authority';import {jsx}from'react/jsx-runtime';function s(...e){return twMerge(clsx(e))}var I=cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),d=o.forwardRef(({className:e,...r},t)=>jsx(p.Root,{ref:t,className:s(I(),e),...r}));d.displayName=p.Root.displayName;var N=FormProvider,f=o.createContext({}),w=({...e})=>jsx(f.Provider,{value:{name:e.name},children:jsx(Controller,{...e})}),n=()=>{let e=o.useContext(f),r=o.useContext(u),{getFieldState:t,formState:a}=useFormContext(),m=t(e.name,a);if(!e)throw new Error("useFormField should be used within <FormField>");let{id:i}=r;return {id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...m}},u=o.createContext({}),R=o.forwardRef(({className:e,...r},t)=>{let a=o.useId();return jsx(u.Provider,{value:{id:a},children:jsx("div",{ref:t,className:s("space-y-2",e),...r})})});R.displayName="FormItem";var P=o.forwardRef(({className:e,...r},t)=>{let{error:a,formItemId:m}=n();return jsx(d,{ref:t,className:s(a&&"text-destructive",e),htmlFor:m,...r})});P.displayName="FormLabel";var x=o.forwardRef(({...e},r)=>{let{error:t,formItemId:a,formDescriptionId:m,formMessageId:i}=n();return jsx(Slot,{ref:r,id:a,"aria-describedby":t?`${m} ${i}`:`${m}`,"aria-invalid":!!t,...e})});x.displayName="FormControl";var C=o.forwardRef(({className:e,...r},t)=>{let{formDescriptionId:a}=n();return jsx("p",{ref:t,id:a,className:s("text-sm text-muted-foreground",e),...r})});C.displayName="FormDescription";var b=o.forwardRef(({className:e,children:r,...t},a)=>{let{error:m,formMessageId:i}=n(),F=m?String(m?.message??""):r;return F?jsx("p",{ref:a,id:i,className:s("text-sm font-medium text-destructive",e),...t,children:F}):null});b.displayName="FormMessage";export{N as Form,x as FormControl,C as FormDescription,w as FormField,R as FormItem,P as FormLabel,b as FormMessage,n as useFormField};//# sourceMappingURL=form.mjs.map
2
+ //# sourceMappingURL=form.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/cn.ts","../../src/components/atoms/label/label.tsx","../../src/components/rhf/form/form.tsx"],"names":["cn","inputs","twMerge","clsx","labelVariants","cva","Label","c","className","props","ref","jsx","Form","FormProvider","FormFieldContext","FormField","Controller","useFormField","fieldContext","itemContext","FormItemContext","getFieldState","formState","useFormContext","fieldState","id","FormItem","FormLabel","error","formItemId","FormControl","formDescriptionId","formMessageId","Slot","FormDescription","FormMessage","children","body"],"mappings":"yTAGO,SAASA,CAAAA,CAAAA,GAAMC,EAAsB,CAC1C,OAAOC,QAAQC,IAAKF,CAAAA,CAAM,CAAC,CAC7B,CCCA,IAAMG,CAAAA,CAAgBC,GACpB,CAAA,4FACF,EAaMC,CAAc,CAAAC,CAAA,CAAA,UAAA,CAClB,CAAC,CAAE,SAAA,CAAAC,EAAW,GAAGC,CAAM,CAAGC,CAAAA,CAAAA,GACxBC,GAAgB,CAAA,CAAA,CAAA,IAAA,CAAf,CAAoB,GAAKD,CAAAA,CAAAA,CAAK,UAAWV,CAAGI,CAAAA,CAAAA,GAAiBI,CAAS,CAAA,CAAI,GAAGC,CAAAA,CAAO,CAEzF,CAAA,CACAH,EAAM,WAA6B,CAAA,CAAA,CAAA,IAAA,CAAK,YCTlCM,IAAAA,CAAAA,CAAOC,YASPC,CAAAA,CAAAA,CAAyB,CAAqC,CAAA,aAAA,CAAA,EAA2B,CAEzFC,CAAAA,CAAAA,CAAY,CAGhB,CACA,GAAGN,CACL,CAEIE,GAAAA,GAAAA,CAACG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,CAAAA,CAAAA,GAE9B,OACEN,GAAAA,CAAC,KACC,GAAKD,CAAAA,CAAAA,CACL,EAAIqB,CAAAA,CAAAA,CACJ,SAAW/B,CAAAA,CAAAA,CAAG,gCAAiCQ,CAAS,CAAA,CACvD,GAAGC,CACN,CAAA,CAEJ,CAAC,EACDyB,CAAAA,CAAgB,WAAc,CAAA,iBAAA,CAExBC,IAAAA,CAAAA,CAAoB,aAGxB,CAAC,CAAE,UAAA3B,CAAW,CAAA,QAAA,CAAA4B,EAAU,GAAG3B,CAAM,CAAGC,CAAAA,CAAAA,GAAQ,CAC5C,GAAM,CAAE,KAAAkB,CAAAA,CAAAA,CAAO,cAAAI,CAAc,CAAA,CAAIf,GAC3BoB,CAAAA,CAAAA,CAAOT,CAAQ,CAAA,MAAA,CAAOA,CAAO,EAAA,OAAA,EAAW,EAAE,CAAIQ,CAAAA,CAAAA,CAEpD,OAAKC,CAKH1B,CAAAA,GAAAA,CAAC,KACC,GAAKD,CAAAA,CAAAA,CACL,EAAIsB,CAAAA,CAAAA,CACJ,SAAWhC,CAAAA,CAAAA,CAAG,uCAAwCQ,CAAS,CAAA,CAC9D,GAAGC,CAAAA,CAEH,QAAA4B,CAAAA,CAAAA,CACH,EAXO,IAaX,CAAC,EACDF,CAAAA,CAAY,WAAc,CAAA,aAAA","file":"form.mjs","sourcesContent":["import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/utils/index\"\n\nconst labelVariants = cva(\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n)\n\nexport interface LabelProps\n extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>,\n VariantProps<typeof labelVariants> {}\n\n/**\n * Label component for creating accessible labels.\n * Built on top of Radix UI's Label primitive.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-label--docs\n *\n */\nconst Label = React.forwardRef<React.ElementRef<typeof LabelPrimitive.Root>, LabelProps>(\n ({ className, ...props }, ref) => (\n <LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props} />\n )\n)\nLabel.displayName = LabelPrimitive.Root.displayName\n\nexport { Label }\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport {\n Controller,\n FormProvider,\n useFormContext,\n type ControllerProps,\n type FieldPath,\n type FieldValues\n} from \"react-hook-form\"\n\nimport { cn } from \"@/utils/cn\"\nimport { Label } from \"@/components/atoms/label\"\n\nconst Form = FormProvider\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n> = {\n name: TName\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue)\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n )\n}\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext)\n const itemContext = React.useContext(FormItemContext)\n const { getFieldState, formState } = useFormContext()\n\n const fieldState = getFieldState(fieldContext.name, formState)\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\")\n }\n\n const { id } = itemContext\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState\n }\n}\n\ntype FormItemContextValue = {\n id: string\n}\n\nconst FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue)\n\nconst FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const id = React.useId()\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn(\"space-y-2\", className)} {...props} />\n </FormItemContext.Provider>\n )\n }\n)\nFormItem.displayName = \"FormItem\"\n\nconst FormLabel = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField()\n\n return (\n <Label\n ref={ref}\n className={cn(error && \"text-destructive\", className)}\n htmlFor={formItemId}\n {...props}\n />\n )\n})\nFormLabel.displayName = \"FormLabel\"\n\nconst FormControl = React.forwardRef<\n React.ElementRef<typeof Slot>,\n React.ComponentPropsWithoutRef<typeof Slot>\n>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField()\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n )\n})\nFormControl.displayName = \"FormControl\"\n\nconst FormDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField()\n\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n )\n})\nFormDescription.displayName = \"FormDescription\"\n\nconst FormMessage = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField()\n const body = error ? String(error?.message ?? \"\") : children\n\n if (!body) {\n return null\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn(\"text-sm font-medium text-destructive\", className)}\n {...props}\n >\n {body}\n </p>\n )\n})\nFormMessage.displayName = \"FormMessage\"\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField\n}\n"]}
@@ -0,0 +1,57 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { FieldValues, FieldPath } from 'react-hook-form';
3
+ import * as React from 'react';
4
+ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
5
+
6
+ /**
7
+ * Checkbox component built on top of Radix UI's Checkbox primitive.
8
+ * Provides a customizable checkbox input with proper accessibility and keyboard navigation.
9
+ *
10
+ * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-checkbox--docs
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * <Checkbox id="terms" name="terms" />
15
+ * <label htmlFor="terms">Accept terms and conditions</label>
16
+ * ```
17
+ */
18
+
19
+ declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
20
+
21
+ interface RHFCheckboxProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React.ComponentProps<typeof Checkbox>, "name"> {
22
+ /** The name of the field in the form */
23
+ name: TName;
24
+ /** Optional label for the field */
25
+ label?: string;
26
+ /** Optional description text below the field */
27
+ description?: string;
28
+ /** Optional warning text to display */
29
+ warningText?: string;
30
+ /** Whether the field is required */
31
+ required?: boolean;
32
+ /** Whether the field is disabled */
33
+ disabled?: boolean;
34
+ /** Whether the field is read-only */
35
+ readOnly?: boolean;
36
+ /** Optional aria-label for accessibility */
37
+ "aria-label"?: string;
38
+ /** Optional aria-describedby for accessibility */
39
+ "aria-describedby"?: string;
40
+ }
41
+
42
+ /**
43
+ * A checkbox component that integrates with React Hook Form.
44
+ * Provides form validation, error handling, and accessibility features.
45
+ *
46
+ * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhfcheckbox--docs
47
+ *
48
+ * @example
49
+ * ```tsx
50
+ * <Form>
51
+ * <RHFCheckbox name="terms" label="Accept terms and conditions" />
52
+ * </Form>
53
+ * ```
54
+ */
55
+ declare function RHFCheckbox<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, warningText, required, disabled, readOnly, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, ...other }: RHFCheckboxProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
56
+
57
+ export { RHFCheckbox };
@@ -0,0 +1,57 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { FieldValues, FieldPath } from 'react-hook-form';
3
+ import * as React from 'react';
4
+ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
5
+
6
+ /**
7
+ * Checkbox component built on top of Radix UI's Checkbox primitive.
8
+ * Provides a customizable checkbox input with proper accessibility and keyboard navigation.
9
+ *
10
+ * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-checkbox--docs
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * <Checkbox id="terms" name="terms" />
15
+ * <label htmlFor="terms">Accept terms and conditions</label>
16
+ * ```
17
+ */
18
+
19
+ declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
20
+
21
+ interface RHFCheckboxProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React.ComponentProps<typeof Checkbox>, "name"> {
22
+ /** The name of the field in the form */
23
+ name: TName;
24
+ /** Optional label for the field */
25
+ label?: string;
26
+ /** Optional description text below the field */
27
+ description?: string;
28
+ /** Optional warning text to display */
29
+ warningText?: string;
30
+ /** Whether the field is required */
31
+ required?: boolean;
32
+ /** Whether the field is disabled */
33
+ disabled?: boolean;
34
+ /** Whether the field is read-only */
35
+ readOnly?: boolean;
36
+ /** Optional aria-label for accessibility */
37
+ "aria-label"?: string;
38
+ /** Optional aria-describedby for accessibility */
39
+ "aria-describedby"?: string;
40
+ }
41
+
42
+ /**
43
+ * A checkbox component that integrates with React Hook Form.
44
+ * Provides form validation, error handling, and accessibility features.
45
+ *
46
+ * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhfcheckbox--docs
47
+ *
48
+ * @example
49
+ * ```tsx
50
+ * <Form>
51
+ * <RHFCheckbox name="terms" label="Accept terms and conditions" />
52
+ * </Form>
53
+ * ```
54
+ */
55
+ declare function RHFCheckbox<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, warningText, required, disabled, readOnly, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, ...other }: RHFCheckboxProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
56
+
57
+ export { RHFCheckbox };
@@ -0,0 +1,2 @@
1
+ 'use strict';var reactHookForm=require('react-hook-form'),r=require('react'),d=require('@radix-ui/react-checkbox'),lucideReact=require('lucide-react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime'),reactSlot=require('@radix-ui/react-slot'),h=require('@radix-ui/react-label'),classVarianceAuthority=require('class-variance-authority');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var r__namespace=/*#__PURE__*/_interopNamespace(r);var d__namespace=/*#__PURE__*/_interopNamespace(d);var h__namespace=/*#__PURE__*/_interopNamespace(h);function s(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var f=r__namespace.forwardRef(({className:e,...o},t)=>jsxRuntime.jsx(d__namespace.Root,{ref:t,className:s("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...o,children:jsxRuntime.jsx(d__namespace.Indicator,{className:s("flex items-center justify-center text-current"),"aria-hidden":"true",children:jsxRuntime.jsx(lucideReact.Check,{className:"h-4 w-4"})})}));f.displayName=d__namespace.Root.displayName;var A=classVarianceAuthority.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),u=r__namespace.forwardRef(({className:e,...o},t)=>jsxRuntime.jsx(h__namespace.Root,{ref:t,className:s(A(),e),...o}));u.displayName=h__namespace.Root.displayName;var I=r__namespace.createContext({}),v=({...e})=>jsxRuntime.jsx(I.Provider,{value:{name:e.name},children:jsxRuntime.jsx(reactHookForm.Controller,{...e})}),c=()=>{let e=r__namespace.useContext(I),o=r__namespace.useContext(T),{getFieldState:t,formState:a}=reactHookForm.useFormContext(),i=t(e.name,a);if(!e)throw new Error("useFormField should be used within <FormField>");let{id:m}=o;return {id:m,name:e.name,formItemId:`${m}-form-item`,formDescriptionId:`${m}-form-item-description`,formMessageId:`${m}-form-item-message`,...i}},T=r__namespace.createContext({}),x=r__namespace.forwardRef(({className:e,...o},t)=>{let a=r__namespace.useId();return jsxRuntime.jsx(T.Provider,{value:{id:a},children:jsxRuntime.jsx("div",{ref:t,className:s("space-y-2",e),...o})})});x.displayName="FormItem";var b=r__namespace.forwardRef(({className:e,...o},t)=>{let{error:a,formItemId:i}=c();return jsxRuntime.jsx(u,{ref:t,className:s(a&&"text-destructive",e),htmlFor:i,...o})});b.displayName="FormLabel";var C=r__namespace.forwardRef(({...e},o)=>{let{error:t,formItemId:a,formDescriptionId:i,formMessageId:m}=c();return jsxRuntime.jsx(reactSlot.Slot,{ref:o,id:a,"aria-describedby":t?`${i} ${m}`:`${i}`,"aria-invalid":!!t,...e})});C.displayName="FormControl";var P=r__namespace.forwardRef(({className:e,...o},t)=>{let{formDescriptionId:a}=c();return jsxRuntime.jsx("p",{ref:t,id:a,className:s("text-sm text-muted-foreground",e),...o})});P.displayName="FormDescription";var R=r__namespace.forwardRef(({className:e,children:o,...t},a)=>{let{error:i,formMessageId:m}=c(),p=i?String(i?.message??""):o;return p?jsxRuntime.jsx("p",{ref:a,id:m,className:s("text-sm font-medium text-destructive",e),...t,children:p}):null});R.displayName="FormMessage";function ye({name:e,label:o,description:t,className:a,warningText:i,required:m,disabled:p,readOnly:G,"aria-label":k,"aria-describedby":M,...w}){let{control:H}=reactHookForm.useFormContext();return jsxRuntime.jsx(v,{name:e,control:H,render:({field:g,fieldState:{error:F}})=>jsxRuntime.jsxs(x,{className:"flex flex-row items-start space-x-3 space-y-0",children:[jsxRuntime.jsx(C,{children:jsxRuntime.jsx(f,{checked:g.value,onCheckedChange:g.onChange,disabled:p,"aria-label":k,"aria-describedby":M,"aria-invalid":!!F,"aria-required":m,...w})}),jsxRuntime.jsxs("div",{className:"space-y-1 leading-none",children:[o&&jsxRuntime.jsxs(b,{children:[o,m&&jsxRuntime.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),t&&jsxRuntime.jsx(P,{children:t}),F&&jsxRuntime.jsx(R,{children:F.message}),!F&&i&&jsxRuntime.jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-500",role:"alert",children:i})]})]})})}exports.RHFCheckbox=ye;//# sourceMappingURL=rhf-checkbox.js.map
2
+ //# sourceMappingURL=rhf-checkbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/cn.ts","../../src/components/atoms/checkbox/checkbox.tsx","../../src/components/atoms/label/label.tsx","../../src/components/rhf/form/form.tsx","../../src/components/rhf/rhf-checkbox/rhf-checkbox.tsx"],"names":["cn","inputs","twMerge","clsx","Checkbox","L","className","props","ref","jsx","d","Check","labelVariants","cva","Label","N","h","FormFieldContext","r","FormField","Controller","useFormField","fieldContext","itemContext","FormItemContext","getFieldState","formState","useFormContext","fieldState","id","FormItem","FormLabel","error","formItemId","FormControl","formDescriptionId","formMessageId","Slot","FormDescription","FormMessage","children","body","RHFCheckbox","name","label","description","warningText","required","disabled","readOnly","ariaLabel","ariaDescribedby","other","control","field","jsxs"],"mappings":"g1BAGO,SAASA,CAAMC,CAAAA,GAAAA,CAAAA,CAAsB,CAC1C,OAAOC,qBAAAA,CAAQC,SAAKF,CAAAA,CAAM,CAAC,CAC7B,CCcA,IAAMG,CAAAA,CAAiBC,YACrB,CAAA,UAAA,CAAA,CAAC,CAAE,SAAA,CAAAC,CAAW,CAAA,GAAGC,CAAM,CAAGC,CAAAA,CAAAA,GACxBC,cAAmB,CAAAC,YAAA,CAAA,IAAA,CAAlB,CACC,GAAKF,CAAAA,CAAAA,CACL,SAAWR,CAAAA,CAAAA,CACT,qQACAM,CACF,CAAA,CACC,GAAGC,CAAAA,CAEJ,SAAAE,cAAmB,CAAAC,YAAA,CAAA,SAAA,CAAlB,CACC,SAAA,CAAWV,EAAG,+CAA+C,CAAA,CAC7D,aAAY,CAAA,MAAA,CAEZ,SAAAS,cAACE,CAAAA,iBAAAA,CAAA,CAAM,SAAA,CAAU,UAAU,CAC7B,CAAA,CAAA,CACF,CAEJ,CAAA,CACAP,CAAS,CAAA,WAAA,CAAgCM,YAAK,CAAA,IAAA,CAAA,WAAA,CChC9C,IAAME,CAAAA,CAAgBC,2BACpB,4FACF,CAAA,CAaMC,CAAc,CAAAC,YAAA,CAAA,UAAA,CAClB,CAAC,CAAE,SAAAT,CAAAA,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAGC,CACxBC,GAAAA,cAAAA,CAAgBO,kBAAf,CAAoB,GAAA,CAAKR,CAAK,CAAA,SAAA,CAAWR,EAAGY,CAAc,EAAA,CAAGN,CAAS,CAAA,CAAI,GAAGC,CAAO,CAAA,CAEzF,CACAO,CAAAA,CAAAA,CAAM,YAA6BE,YAAK,CAAA,IAAA,CAAA,WAAA,CCAxC,IAAMC,CAAAA,CAAyBC,YAAqC,CAAA,aAAA,CAAA,EAA2B,CAEzFC,CAAAA,CAA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E,CAAA,CAAA,SAAA,CAAU,8CAA+C,CAAA,IAAA,CAAK,QAC9D,QAAAqC,CAAAA,CAAAA,CACH,CAEJ,CAAA,CAAA,CAAA,CAAA,CACF,EAEJ,CAEJ","file":"rhf-checkbox.js","sourcesContent":["import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","/**\n * Checkbox component built on top of Radix UI's Checkbox primitive.\n * Provides a customizable checkbox input with proper accessibility and keyboard navigation.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-checkbox--docs\n *\n * @example\n * ```tsx\n * <Checkbox id=\"terms\" name=\"terms\" />\n * <label htmlFor=\"terms\">Accept terms and conditions</label>\n * ```\n */\nimport * as React from \"react\"\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\"\nimport { Check } from \"lucide-react\"\n\nimport { cn } from \"@/utils/index\"\nimport type { CheckboxProps } from \"./checkbox.types\"\n\nconst Checkbox = React.forwardRef<React.ElementRef<typeof CheckboxPrimitive.Root>, CheckboxProps>(\n ({ className, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n \"peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground\",\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n className={cn(\"flex items-center justify-center text-current\")}\n aria-hidden=\"true\"\n >\n <Check className=\"h-4 w-4\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n)\nCheckbox.displayName = CheckboxPrimitive.Root.displayName\n\nexport { Checkbox }\n","import * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/utils/index\"\n\nconst labelVariants = cva(\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n)\n\nexport interface LabelProps\n extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>,\n VariantProps<typeof labelVariants> {}\n\n/**\n * Label component for creating accessible labels.\n * Built on top of Radix UI's Label primitive.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-label--docs\n *\n */\nconst Label = React.forwardRef<React.ElementRef<typeof LabelPrimitive.Root>, LabelProps>(\n ({ className, ...props }, ref) => (\n <LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props} />\n )\n)\nLabel.displayName = LabelPrimitive.Root.displayName\n\nexport { Label }\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport {\n Controller,\n FormProvider,\n useFormContext,\n type ControllerProps,\n type FieldPath,\n type FieldValues\n} from \"react-hook-form\"\n\nimport { cn } from \"@/utils/cn\"\nimport { Label } from \"@/components/atoms/label\"\n\nconst Form = FormProvider\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n> = {\n name: TName\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue)\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n )\n}\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext)\n const itemContext = React.useContext(FormItemContext)\n const { getFieldState, formState } = useFormContext()\n\n const fieldState = getFieldState(fieldContext.name, formState)\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\")\n }\n\n const { id } = itemContext\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState\n }\n}\n\ntype FormItemContextValue = {\n id: string\n}\n\nconst FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue)\n\nconst FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const id = React.useId()\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn(\"space-y-2\", className)} {...props} />\n </FormItemContext.Provider>\n )\n }\n)\nFormItem.displayName = \"FormItem\"\n\nconst FormLabel = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField()\n\n return (\n <Label\n ref={ref}\n className={cn(error && \"text-destructive\", className)}\n htmlFor={formItemId}\n {...props}\n />\n )\n})\nFormLabel.displayName = \"FormLabel\"\n\nconst FormControl = React.forwardRef<\n React.ElementRef<typeof Slot>,\n React.ComponentPropsWithoutRef<typeof Slot>\n>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField()\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n )\n})\nFormControl.displayName = \"FormControl\"\n\nconst FormDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField()\n\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n )\n})\nFormDescription.displayName = \"FormDescription\"\n\nconst FormMessage = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField()\n const body = error ? String(error?.message ?? \"\") : children\n\n if (!body) {\n return null\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn(\"text-sm font-medium text-destructive\", className)}\n {...props}\n >\n {body}\n </p>\n )\n})\nFormMessage.displayName = \"FormMessage\"\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField\n}\n","import * as React from \"react\"\nimport { useFormContext, type FieldValues, type FieldPath } from \"react-hook-form\"\nimport { Checkbox } from \"@/components/atoms/checkbox\"\nimport {\n FormControl,\n FormItem,\n FormMessage,\n FormLabel,\n FormDescription,\n FormField\n} from \"@/components/rhf/form\"\nimport { type RHFCheckboxProps } from \"./rhf-checkbox.types\"\n\n// ----------------------------------------------------------------------\n\n/**\n * A checkbox component that integrates with React Hook Form.\n * Provides form validation, error handling, and accessibility features.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhfcheckbox--docs\n *\n * @example\n * ```tsx\n * <Form>\n * <RHFCheckbox name=\"terms\" label=\"Accept terms and conditions\" />\n * </Form>\n * ```\n */\nexport function RHFCheckbox<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n name,\n label,\n description,\n className,\n warningText,\n required,\n disabled,\n readOnly,\n \"aria-label\": ariaLabel,\n \"aria-describedby\": ariaDescribedby,\n ...other\n}: RHFCheckboxProps<TFieldValues, TName>) {\n const { control } = useFormContext<TFieldValues>()\n\n return (\n <FormField\n name={name}\n control={control}\n render={({ field, fieldState: { error } }) => (\n <FormItem className=\"flex flex-row items-start space-x-3 space-y-0\">\n <FormControl>\n <Checkbox\n checked={field.value}\n onCheckedChange={field.onChange}\n disabled={disabled}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-invalid={!!error}\n aria-required={required}\n {...other}\n />\n </FormControl>\n <div className=\"space-y-1 leading-none\">\n {label && (\n <FormLabel>\n {label}\n {required && <span className=\"text-destructive ml-1\">*</span>}\n </FormLabel>\n )}\n {description && <FormDescription>{description}</FormDescription>}\n {error && <FormMessage>{error.message}</FormMessage>}\n {!error && warningText && (\n <p className=\"text-sm text-yellow-600 dark:text-yellow-500\" role=\"alert\">\n {warningText}\n </p>\n )}\n </div>\n </FormItem>\n )}\n />\n )\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import {useFormContext,Controller}from'react-hook-form';import*as r from'react';import*as d from'@radix-ui/react-checkbox';import {Check}from'lucide-react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsx,jsxs}from'react/jsx-runtime';import {Slot}from'@radix-ui/react-slot';import*as h from'@radix-ui/react-label';import {cva}from'class-variance-authority';function s(...e){return twMerge(clsx(e))}var f=r.forwardRef(({className:e,...o},t)=>jsx(d.Root,{ref:t,className:s("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...o,children:jsx(d.Indicator,{className:s("flex items-center justify-center text-current"),"aria-hidden":"true",children:jsx(Check,{className:"h-4 w-4"})})}));f.displayName=d.Root.displayName;var A=cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),u=r.forwardRef(({className:e,...o},t)=>jsx(h.Root,{ref:t,className:s(A(),e),...o}));u.displayName=h.Root.displayName;var I=r.createContext({}),v=({...e})=>jsx(I.Provider,{value:{name:e.name},children:jsx(Controller,{...e})}),c=()=>{let e=r.useContext(I),o=r.useContext(T),{getFieldState:t,formState:a}=useFormContext(),i=t(e.name,a);if(!e)throw new Error("useFormField should be used within <FormField>");let{id:m}=o;return {id:m,name:e.name,formItemId:`${m}-form-item`,formDescriptionId:`${m}-form-item-description`,formMessageId:`${m}-form-item-message`,...i}},T=r.createContext({}),x=r.forwardRef(({className:e,...o},t)=>{let a=r.useId();return jsx(T.Provider,{value:{id:a},children:jsx("div",{ref:t,className:s("space-y-2",e),...o})})});x.displayName="FormItem";var b=r.forwardRef(({className:e,...o},t)=>{let{error:a,formItemId:i}=c();return jsx(u,{ref:t,className:s(a&&"text-destructive",e),htmlFor:i,...o})});b.displayName="FormLabel";var C=r.forwardRef(({...e},o)=>{let{error:t,formItemId:a,formDescriptionId:i,formMessageId:m}=c();return jsx(Slot,{ref:o,id:a,"aria-describedby":t?`${i} ${m}`:`${i}`,"aria-invalid":!!t,...e})});C.displayName="FormControl";var P=r.forwardRef(({className:e,...o},t)=>{let{formDescriptionId:a}=c();return jsx("p",{ref:t,id:a,className:s("text-sm text-muted-foreground",e),...o})});P.displayName="FormDescription";var R=r.forwardRef(({className:e,children:o,...t},a)=>{let{error:i,formMessageId:m}=c(),p=i?String(i?.message??""):o;return p?jsx("p",{ref:a,id:m,className:s("text-sm font-medium text-destructive",e),...t,children:p}):null});R.displayName="FormMessage";function ye({name:e,label:o,description:t,className:a,warningText:i,required:m,disabled:p,readOnly:G,"aria-label":k,"aria-describedby":M,...w}){let{control:H}=useFormContext();return jsx(v,{name:e,control:H,render:({field:g,fieldState:{error:F}})=>jsxs(x,{className:"flex flex-row items-start space-x-3 space-y-0",children:[jsx(C,{children:jsx(f,{checked:g.value,onCheckedChange:g.onChange,disabled:p,"aria-label":k,"aria-describedby":M,"aria-invalid":!!F,"aria-required":m,...w})}),jsxs("div",{className:"space-y-1 leading-none",children:[o&&jsxs(b,{children:[o,m&&jsx("span",{className:"text-destructive ml-1",children:"*"})]}),t&&jsx(P,{children:t}),F&&jsx(R,{children:F.message}),!F&&i&&jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-500",role:"alert",children:i})]})]})})}export{ye as RHFCheckbox};//# sourceMappingURL=rhf-checkbox.mjs.map
2
+ //# sourceMappingURL=rhf-checkbox.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/cn.ts","../../src/components/atoms/checkbox/checkbox.tsx","../../src/components/atoms/label/label.tsx","../../src/components/rhf/form/form.tsx","../../src/components/rhf/rhf-checkbox/rhf-checkbox.tsx"],"names":["cn","inputs","twMerge","clsx","Checkbox","L","className","props","ref","jsx","Check","labelVariants","cva","Label","N","FormFieldContext","FormField","Controller","useFormField","fieldContext","itemContext","FormItemContext","getFieldState","formState","useFormContext","fieldState","id","FormItem","FormLabel","error","formItemId","FormControl","formDescriptionId","formMessageId","Slot","FormDescription","FormMessage","children","body","RHFCheckbox","name","label","description","warningText","required","disabled","readOnly","ariaLabel","ariaDescribedby","other","control","field","jsxs"],"mappings":"6XAGO,SAASA,CAAMC,CAAAA,GAAAA,CAAAA,CAAsB,CAC1C,OAAOC,OAAAA,CAAQC,IAAKF,CAAAA,CAAM,CAAC,CAC7B,CCcA,IAAMG,CAAAA,CAAiBC,CACrB,CAAA,UAAA,CAAA,CAAC,CAAE,SAAA,CAAAC,CAAW,CAAA,GAAGC,CAAM,CAAGC,CAAAA,CAAAA,GACxBC,GAAmB,CAAA,CAAA,CAAA,IAAA,CAAlB,CACC,GAAKD,CAAAA,CAAAA,CACL,SAAWR,CAAAA,CAAAA,CACT,qQACAM,CACF,CAAA,CACC,GAAGC,CAAAA,CAEJ,SAAAE,GAAmB,CAAA,CAAA,CAAA,SAAA,CAAlB,CACC,SAAA,CAAWT,EAAG,+CAA+C,CAAA,CAC7D,aAAY,CAAA,MAAA,CAEZ,SAAAS,GAACC,CAAAA,KAAAA,CAAA,CAAM,SAAA,CAAU,UAAU,CAC7B,CAAA,CAAA,CACF,CAEJ,CAAA,CACAN,CAAS,CAAA,WAAA,CAAgC,CAAK,CAAA,IAAA,CAAA,WAAA,CChC9C,IAAMO,CAAAA,CAAgBC,IACpB,4FACF,CAAA,CAaMC,CAAc,CAAAC,CAAA,CAAA,UAAA,CAClB,CAAC,CAAE,SAAAR,CAAAA,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAGC,CACxBC,GAAAA,GAAAA,CAAgB,OAAf,CAAoB,GAAA,CAAKD,CAAK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GAAC0B,CAAAA,CAAAA,CAAA,CAAiB,QAAAO,CAAAA,CAAAA,CAAY,CAC7Cb,CAAAA,CAAAA,EAASpB,IAAC2B,CAAA,CAAA,CAAa,QAAAP,CAAAA,CAAAA,CAAM,QAAQ,CACrC,CAAA,CAACA,CAASc,EAAAA,CAAAA,EACTlC,IAAC,GAAE,CAAA,CAAA,SAAA,CAAU,8CAA+C,CAAA,IAAA,CAAK,QAC9D,QAAAkC,CAAAA,CAAAA,CACH,CAEJ,CAAA,CAAA,CAAA,CAAA,CACF,EAEJ,CAEJ","file":"rhf-checkbox.mjs","sourcesContent":["import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","/**\n * Checkbox component built on top of Radix UI's Checkbox primitive.\n * Provides a customizable checkbox input with proper accessibility and keyboard navigation.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-checkbox--docs\n *\n * @example\n * ```tsx\n * <Checkbox id=\"terms\" name=\"terms\" />\n * <label htmlFor=\"terms\">Accept terms and conditions</label>\n * ```\n */\nimport * as React from \"react\"\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\"\nimport { Check } from \"lucide-react\"\n\nimport { cn } from \"@/utils/index\"\nimport type { CheckboxProps } from \"./checkbox.types\"\n\nconst Checkbox = React.forwardRef<React.ElementRef<typeof CheckboxPrimitive.Root>, CheckboxProps>(\n ({ className, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n \"peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground\",\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n className={cn(\"flex items-center justify-center text-current\")}\n aria-hidden=\"true\"\n >\n <Check className=\"h-4 w-4\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n)\nCheckbox.displayName = CheckboxPrimitive.Root.displayName\n\nexport { Checkbox }\n","import * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/utils/index\"\n\nconst labelVariants = cva(\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n)\n\nexport interface LabelProps\n extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>,\n VariantProps<typeof labelVariants> {}\n\n/**\n * Label component for creating accessible labels.\n * Built on top of Radix UI's Label primitive.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-label--docs\n *\n */\nconst Label = React.forwardRef<React.ElementRef<typeof LabelPrimitive.Root>, LabelProps>(\n ({ className, ...props }, ref) => (\n <LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props} />\n )\n)\nLabel.displayName = LabelPrimitive.Root.displayName\n\nexport { Label }\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport {\n Controller,\n FormProvider,\n useFormContext,\n type ControllerProps,\n type FieldPath,\n type FieldValues\n} from \"react-hook-form\"\n\nimport { cn } from \"@/utils/cn\"\nimport { Label } from \"@/components/atoms/label\"\n\nconst Form = FormProvider\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n> = {\n name: TName\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue)\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n )\n}\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext)\n const itemContext = React.useContext(FormItemContext)\n const { getFieldState, formState } = useFormContext()\n\n const fieldState = getFieldState(fieldContext.name, formState)\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\")\n }\n\n const { id } = itemContext\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState\n }\n}\n\ntype FormItemContextValue = {\n id: string\n}\n\nconst FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue)\n\nconst FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const id = React.useId()\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn(\"space-y-2\", className)} {...props} />\n </FormItemContext.Provider>\n )\n }\n)\nFormItem.displayName = \"FormItem\"\n\nconst FormLabel = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField()\n\n return (\n <Label\n ref={ref}\n className={cn(error && \"text-destructive\", className)}\n htmlFor={formItemId}\n {...props}\n />\n )\n})\nFormLabel.displayName = \"FormLabel\"\n\nconst FormControl = React.forwardRef<\n React.ElementRef<typeof Slot>,\n React.ComponentPropsWithoutRef<typeof Slot>\n>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField()\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n )\n})\nFormControl.displayName = \"FormControl\"\n\nconst FormDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField()\n\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n )\n})\nFormDescription.displayName = \"FormDescription\"\n\nconst FormMessage = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField()\n const body = error ? String(error?.message ?? \"\") : children\n\n if (!body) {\n return null\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn(\"text-sm font-medium text-destructive\", className)}\n {...props}\n >\n {body}\n </p>\n )\n})\nFormMessage.displayName = \"FormMessage\"\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField\n}\n","import * as React from \"react\"\nimport { useFormContext, type FieldValues, type FieldPath } from \"react-hook-form\"\nimport { Checkbox } from \"@/components/atoms/checkbox\"\nimport {\n FormControl,\n FormItem,\n FormMessage,\n FormLabel,\n FormDescription,\n FormField\n} from \"@/components/rhf/form\"\nimport { type RHFCheckboxProps } from \"./rhf-checkbox.types\"\n\n// ----------------------------------------------------------------------\n\n/**\n * A checkbox component that integrates with React Hook Form.\n * Provides form validation, error handling, and accessibility features.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhfcheckbox--docs\n *\n * @example\n * ```tsx\n * <Form>\n * <RHFCheckbox name=\"terms\" label=\"Accept terms and conditions\" />\n * </Form>\n * ```\n */\nexport function RHFCheckbox<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n name,\n label,\n description,\n className,\n warningText,\n required,\n disabled,\n readOnly,\n \"aria-label\": ariaLabel,\n \"aria-describedby\": ariaDescribedby,\n ...other\n}: RHFCheckboxProps<TFieldValues, TName>) {\n const { control } = useFormContext<TFieldValues>()\n\n return (\n <FormField\n name={name}\n control={control}\n render={({ field, fieldState: { error } }) => (\n <FormItem className=\"flex flex-row items-start space-x-3 space-y-0\">\n <FormControl>\n <Checkbox\n checked={field.value}\n onCheckedChange={field.onChange}\n disabled={disabled}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-invalid={!!error}\n aria-required={required}\n {...other}\n />\n </FormControl>\n <div className=\"space-y-1 leading-none\">\n {label && (\n <FormLabel>\n {label}\n {required && <span className=\"text-destructive ml-1\">*</span>}\n </FormLabel>\n )}\n {description && <FormDescription>{description}</FormDescription>}\n {error && <FormMessage>{error.message}</FormMessage>}\n {!error && warningText && (\n <p className=\"text-sm text-yellow-600 dark:text-yellow-500\" role=\"alert\">\n {warningText}\n </p>\n )}\n </div>\n </FormItem>\n )}\n />\n )\n}\n"]}
@@ -0,0 +1,84 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { FieldValues, FieldPath } from 'react-hook-form';
3
+ import * as React from 'react';
4
+
5
+ type MultiSelectOption = {
6
+ id: string;
7
+ label: string;
8
+ startIcon?: React.ReactNode;
9
+ endIcon?: React.ReactNode;
10
+ className?: string;
11
+ disabled?: boolean;
12
+ };
13
+ type MultiSelectProps = {
14
+ /** Whether the select is searchable */
15
+ searchable?: boolean;
16
+ /** Whether the select should take up the full width of its container */
17
+ fullWidth?: boolean;
18
+ /** Array of options to display in the select */
19
+ options: MultiSelectOption[];
20
+ /** Currently selected values */
21
+ value: string[];
22
+ /** Callback fired when the values change */
23
+ onChange: (value: string[]) => void;
24
+ /** Render a custom CommandList for the select, if not provided, the select will render a default CommandList with the options */
25
+ renderCommandList?: (options: MultiSelectOption[]) => React.ReactNode;
26
+ /** Placeholder text to show when no value is selected */
27
+ placeholder?: string;
28
+ /** Whether the select is disabled */
29
+ disabled?: boolean;
30
+ /** Whether the select is required */
31
+ required?: boolean;
32
+ /** Error message to display */
33
+ error?: string;
34
+ /** Additional class name for the select */
35
+ className?: string;
36
+ /** ID for the select element */
37
+ id?: string;
38
+ /** Maximum number of selections allowed */
39
+ maxSelections?: number;
40
+ /** Whether to show the select all option */
41
+ showSelectAll?: boolean;
42
+ };
43
+
44
+ interface RHFMultiSelectProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<MultiSelectProps, "name" | "value" | "onChange"> {
45
+ /** The name of the field in the form */
46
+ name: TName;
47
+ /** Optional label for the field */
48
+ label?: string;
49
+ /** Optional description text below the field */
50
+ description?: string;
51
+ /** Optional warning text to display */
52
+ warningText?: string;
53
+ /** Whether the field is read-only */
54
+ readOnly?: boolean;
55
+ /** Optional aria-label for accessibility */
56
+ "aria-label"?: string;
57
+ /** Optional aria-describedby for accessibility */
58
+ "aria-describedby"?: string;
59
+ }
60
+
61
+ /**
62
+ * A multi-select component that integrates with React Hook Form.
63
+ * Provides form validation, error handling, and accessibility features.
64
+ *
65
+ * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhfmultiselect--docs
66
+ *
67
+ * @example
68
+ * ```tsx
69
+ * <Form>
70
+ * <RHFMultiSelect
71
+ * name="countries"
72
+ * label="Countries"
73
+ * options={[
74
+ * { id: "us", label: "United States" },
75
+ * { id: "ca", label: "Canada" }
76
+ * ]}
77
+ *
78
+ * />
79
+ * </Form>
80
+ * ```
81
+ */
82
+ declare function RHFMultiSelect<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, warningText, required, disabled, readOnly, placeholder, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, options, ...other }: RHFMultiSelectProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
83
+
84
+ export { RHFMultiSelect };
@@ -0,0 +1,84 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { FieldValues, FieldPath } from 'react-hook-form';
3
+ import * as React from 'react';
4
+
5
+ type MultiSelectOption = {
6
+ id: string;
7
+ label: string;
8
+ startIcon?: React.ReactNode;
9
+ endIcon?: React.ReactNode;
10
+ className?: string;
11
+ disabled?: boolean;
12
+ };
13
+ type MultiSelectProps = {
14
+ /** Whether the select is searchable */
15
+ searchable?: boolean;
16
+ /** Whether the select should take up the full width of its container */
17
+ fullWidth?: boolean;
18
+ /** Array of options to display in the select */
19
+ options: MultiSelectOption[];
20
+ /** Currently selected values */
21
+ value: string[];
22
+ /** Callback fired when the values change */
23
+ onChange: (value: string[]) => void;
24
+ /** Render a custom CommandList for the select, if not provided, the select will render a default CommandList with the options */
25
+ renderCommandList?: (options: MultiSelectOption[]) => React.ReactNode;
26
+ /** Placeholder text to show when no value is selected */
27
+ placeholder?: string;
28
+ /** Whether the select is disabled */
29
+ disabled?: boolean;
30
+ /** Whether the select is required */
31
+ required?: boolean;
32
+ /** Error message to display */
33
+ error?: string;
34
+ /** Additional class name for the select */
35
+ className?: string;
36
+ /** ID for the select element */
37
+ id?: string;
38
+ /** Maximum number of selections allowed */
39
+ maxSelections?: number;
40
+ /** Whether to show the select all option */
41
+ showSelectAll?: boolean;
42
+ };
43
+
44
+ interface RHFMultiSelectProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<MultiSelectProps, "name" | "value" | "onChange"> {
45
+ /** The name of the field in the form */
46
+ name: TName;
47
+ /** Optional label for the field */
48
+ label?: string;
49
+ /** Optional description text below the field */
50
+ description?: string;
51
+ /** Optional warning text to display */
52
+ warningText?: string;
53
+ /** Whether the field is read-only */
54
+ readOnly?: boolean;
55
+ /** Optional aria-label for accessibility */
56
+ "aria-label"?: string;
57
+ /** Optional aria-describedby for accessibility */
58
+ "aria-describedby"?: string;
59
+ }
60
+
61
+ /**
62
+ * A multi-select component that integrates with React Hook Form.
63
+ * Provides form validation, error handling, and accessibility features.
64
+ *
65
+ * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhfmultiselect--docs
66
+ *
67
+ * @example
68
+ * ```tsx
69
+ * <Form>
70
+ * <RHFMultiSelect
71
+ * name="countries"
72
+ * label="Countries"
73
+ * options={[
74
+ * { id: "us", label: "United States" },
75
+ * { id: "ca", label: "Canada" }
76
+ * ]}
77
+ *
78
+ * />
79
+ * </Form>
80
+ * ```
81
+ */
82
+ declare function RHFMultiSelect<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, warningText, required, disabled, readOnly, placeholder, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, options, ...other }: RHFMultiSelectProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
83
+
84
+ export { RHFMultiSelect };
@@ -0,0 +1,2 @@
1
+ 'use strict';var reactHookForm=require('react-hook-form'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),l=require('react'),reactSlot=require('@radix-ui/react-slot'),classVarianceAuthority=require('class-variance-authority'),lucideReact=require('lucide-react'),jsxRuntime=require('react/jsx-runtime'),cmdk=require('cmdk'),reactPopover=require('@radix-ui/react-popover'),W=require('@radix-ui/react-label');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var l__namespace=/*#__PURE__*/_interopNamespace(l);var W__namespace=/*#__PURE__*/_interopNamespace(W);function a(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var j=classVarianceAuthority.cva("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),z=l__namespace.forwardRef(({className:e,variant:t,size:o,asChild:m=false,startIcon:s,endIcon:i,loading:c=false,disabled:I,children:f,type:N="button","aria-label":y,...x},P)=>{let F=m?reactSlot.Slot:"button",p=I||c,u=y||(typeof f=="string"?f:void 0),T=w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),!p&&x.onClick&&x.onClick(w));};return m?jsxRuntime.jsx(F,{className:a(j({variant:t,size:o,className:e})),ref:P,disabled:p,type:N,"aria-label":u,"aria-disabled":p,...x,children:f}):jsxRuntime.jsxs(F,{className:a(j({variant:t,size:o,className:e})),ref:P,disabled:p,type:N,"aria-label":u,"aria-disabled":p,onKeyDown:T,...x,children:[c&&jsxRuntime.jsx(lucideReact.Loader2,{className:"mr-2 h-4 w-4 animate-spin",role:"status","aria-label":"Loading","aria-hidden":"true"}),!c&&s&&jsxRuntime.jsx("span",{className:"mr-2","aria-hidden":"true",children:s}),f,!c&&i&&jsxRuntime.jsx("span",{className:"ml-2","aria-hidden":"true",children:i})]})});z.displayName="Button";var M=l__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(cmdk.Command,{ref:o,className:a("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));M.displayName=cmdk.Command.displayName;var E=l__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[jsxRuntime.jsx(lucideReact.Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),jsxRuntime.jsx(cmdk.Command.Input,{ref:o,className:a("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));E.displayName=cmdk.Command.Input.displayName;var _=l__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(cmdk.Command.List,{ref:o,className:a("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));_.displayName=cmdk.Command.List.displayName;var D=l__namespace.forwardRef((e,t)=>jsxRuntime.jsx(cmdk.Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));D.displayName=cmdk.Command.Empty.displayName;var L=l__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(cmdk.Command.Group,{ref:o,className:a("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));L.displayName=cmdk.Command.Group.displayName;var H=l__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(cmdk.Command.Separator,{ref:o,className:a("-mx-1 h-px bg-border",e),...t}));H.displayName=cmdk.Command.Separator.displayName;var S=l__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(cmdk.Command.Item,{ref:o,className:a("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));S.displayName=cmdk.Command.Item.displayName;var xe=classVarianceAuthority.cva("",{variants:{variant:{h1:"scroll-m-5 text-4xl font-extrabold tracking-tight lg:text-5xl",h2:"scroll-m-5 text-3xl font-semibold tracking-tight",h3:"scroll-m-5 text-2xl font-semibold tracking-tight",h4:"scroll-m-5 text-xl font-semibold tracking-tight",h5:"scroll-m-5 text-lg font-semibold tracking-tight",h6:"scroll-m-5 text-base font-semibold tracking-tight",p:"leading-7 [&:not(:first-child)]:mt-6",blockquote:"mt-6 border-l-2 border-slate-300 pl-6 italic",list:"my-6 ml-6 list-disc [&>li]:mt-2",lead:"text-xl text-muted-foreground",large:"text-lg font-semibold",small:"text-sm font-medium leading-none",muted:"text-sm text-muted-foreground"},align:{left:"text-left",center:"text-center",right:"text-right",justify:"text-justify"}},defaultVariants:{variant:"p",align:"left"}}),G=l__namespace.forwardRef(({className:e,variant:t,align:o,as:m="p",...s},i)=>jsxRuntime.jsx(m,{className:a(xe({variant:t,align:o,className:e})),ref:i,...s}));G.displayName="Typography";function ee({options:e,value:t,onChange:o,placeholder:m="Select options",disabled:s,required:i,error:c,className:I,fullWidth:f,searchable:N,id:y,maxSelections:x,showSelectAll:P,renderCommandList:F}){let[p,u]=l__namespace.useState(false),T=e.filter(r=>t.includes(r.id)),w=r=>{if(t.includes(r))o(t.filter(b=>b!==r));else {if(x&&t.length>=x)return;o([...t,r]);}},me=()=>{let r=e.filter(b=>!b.disabled);t.length===r.length?o([]):o(r.map(b=>b.id));},se=(r,b)=>{b.stopPropagation(),o(t.filter(ne=>ne!==r));};return jsxRuntime.jsx("div",{className:a(f&&"w-full"),children:jsxRuntime.jsxs(reactPopover.Popover,{open:p,onOpenChange:u,children:[jsxRuntime.jsx(reactPopover.PopoverTrigger,{asChild:true,children:jsxRuntime.jsxs(z,{variant:"outline",role:"combobox","aria-expanded":p,"aria-controls":y?`${y}-content`:void 0,"aria-label":m,"aria-required":i,"aria-invalid":!!c,disabled:s,id:y,className:a("w-[13rem] justify-between min-h-[2.5rem] h-auto",!t.length&&"text-muted-foreground",f&&"w-full",c&&"border-destructive focus-visible:ring-destructive",I),children:[jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1",children:T.length>0?T.map(r=>jsxRuntime.jsxs("div",{className:"flex items-center gap-1 bg-secondary text-secondary-foreground px-2 py-0.5 rounded-md text-sm",children:[jsxRuntime.jsx("span",{children:r.label}),jsxRuntime.jsx("span",{onClick:b=>se(r.id,b),className:"hover:bg-secondary-foreground/20 rounded-sm",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3 w-3"})})]},r.id)):jsxRuntime.jsx("span",{children:m})}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:a("opacity-50",p&&"rotate-180")})]})}),jsxRuntime.jsx(reactPopover.PopoverContent,{id:y?`${y}-content`:void 0,className:a("w-[13rem] p-0 rounded-md border bg-popover text-popover-foreground shadow-md",f&&"w-full"),align:"start",children:jsxRuntime.jsxs(M,{children:[N&&jsxRuntime.jsx(E,{placeholder:"Search...",className:"h-9",disabled:s}),jsxRuntime.jsxs(_,{className:"max-h-[12rem] overflow-y-auto",children:[jsxRuntime.jsx(D,{children:"No items found."}),jsxRuntime.jsxs(L,{children:[P&&jsxRuntime.jsxs(S,{onSelect:me,className:"flex items-center gap-2 cursor-pointer my-1",children:[jsxRuntime.jsx("div",{className:"flex h-4 w-4 items-center justify-center rounded border border-primary",children:t.length===e.filter(r=>!r.disabled).length&&jsxRuntime.jsx(lucideReact.Check,{className:"h-3 w-3"})}),jsxRuntime.jsx(G,{variant:"small",children:"Select All"})]}),jsxRuntime.jsx(H,{})]}),F?F(e):jsxRuntime.jsx(L,{children:e.map(r=>jsxRuntime.jsxs(S,{value:r.id,onSelect:()=>w(r.id),disabled:r.disabled,className:a("flex items-center justify-between cursor-pointer my-1",r.disabled&&"opacity-50 cursor-not-allowed",r.className),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"flex h-4 w-4 items-center justify-center rounded border border-primary",children:t.includes(r.id)&&jsxRuntime.jsx(lucideReact.Check,{className:"h-3 w-3"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[r.startIcon&&r.startIcon,jsxRuntime.jsx(G,{variant:"small",children:r.label})]})]}),r.endIcon&&jsxRuntime.jsx("div",{className:"ml-2",children:r.endIcon})]},r.id))})]})]})})]})})}var Pe=classVarianceAuthority.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),A=l__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(W__namespace.Root,{ref:o,className:a(Pe(),e),...t}));A.displayName=W__namespace.Root.displayName;var oe=l__namespace.createContext({}),X=({...e})=>jsxRuntime.jsx(oe.Provider,{value:{name:e.name},children:jsxRuntime.jsx(reactHookForm.Controller,{...e})}),k=()=>{let e=l__namespace.useContext(oe),t=l__namespace.useContext(re),{getFieldState:o,formState:m}=reactHookForm.useFormContext(),s=o(e.name,m);if(!e)throw new Error("useFormField should be used within <FormField>");let{id:i}=t;return {id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...s}},re=l__namespace.createContext({}),B=l__namespace.forwardRef(({className:e,...t},o)=>{let m=l__namespace.useId();return jsxRuntime.jsx(re.Provider,{value:{id:m},children:jsxRuntime.jsx("div",{ref:o,className:a("space-y-2",e),...t})})});B.displayName="FormItem";var $=l__namespace.forwardRef(({className:e,...t},o)=>{let{error:m,formItemId:s}=k();return jsxRuntime.jsx(A,{ref:o,className:a(m&&"text-destructive",e),htmlFor:s,...t})});$.displayName="FormLabel";var O=l__namespace.forwardRef(({...e},t)=>{let{error:o,formItemId:m,formDescriptionId:s,formMessageId:i}=k();return jsxRuntime.jsx(reactSlot.Slot,{ref:t,id:m,"aria-describedby":o?`${s} ${i}`:`${s}`,"aria-invalid":!!o,...e})});O.displayName="FormControl";var q=l__namespace.forwardRef(({className:e,...t},o)=>{let{formDescriptionId:m}=k();return jsxRuntime.jsx("p",{ref:o,id:m,className:a("text-sm text-muted-foreground",e),...t})});q.displayName="FormDescription";var K=l__namespace.forwardRef(({className:e,children:t,...o},m)=>{let{error:s,formMessageId:i}=k(),c=s?String(s?.message??""):t;return c?jsxRuntime.jsx("p",{ref:m,id:i,className:a("text-sm font-medium text-destructive",e),...o,children:c}):null});K.displayName="FormMessage";function St({name:e,label:t,description:o,className:m,warningText:s,required:i,disabled:c,readOnly:I,placeholder:f,"aria-label":N,"aria-describedby":y,options:x,...P}){let{control:F}=reactHookForm.useFormContext();return jsxRuntime.jsx(X,{name:e,control:F,render:({field:p,fieldState:{error:u}})=>jsxRuntime.jsxs(B,{children:[t&&jsxRuntime.jsxs($,{children:[t,i&&jsxRuntime.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),jsxRuntime.jsx(O,{children:jsxRuntime.jsx(ee,{...p,options:x,value:p.value||[],onChange:p.onChange,className:a(u&&"border-destructive focus-visible:ring-destructive",m),disabled:c||I,required:i,placeholder:f,"aria-label":N,"aria-describedby":y,"aria-invalid":!!u,"aria-required":i,...P})}),o&&jsxRuntime.jsx(q,{children:o}),u&&jsxRuntime.jsx(K,{children:u.message}),!u&&s&&jsxRuntime.jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-500",role:"alert",children:s})]})})}exports.RHFMultiSelect=St;//# sourceMappingURL=rhf-multi-select.js.map
2
+ //# sourceMappingURL=rhf-multi-select.js.map