@me1a/ui 2.2.2 → 2.2.4

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 (353) hide show
  1. package/dist/{atoms/accordion.mjs → accordion/index.mjs} +2 -2
  2. package/dist/accordion/index.mjs.map +1 -0
  3. package/dist/{atoms/avatar.mjs → avatar/index.mjs} +2 -2
  4. package/dist/avatar/index.mjs.map +1 -0
  5. package/dist/{atoms/badge.d.mts → badge/index.d.mts} +9 -8
  6. package/dist/{atoms/badge.mjs → badge/index.mjs} +2 -2
  7. package/dist/{atoms/badge.mjs.map → badge/index.mjs.map} +1 -1
  8. package/dist/{atoms/box.mjs → box/index.mjs} +2 -2
  9. package/dist/box/index.mjs.map +1 -0
  10. package/dist/{atoms/breadcrumb.mjs → breadcrumb/index.mjs} +2 -2
  11. package/dist/breadcrumb/index.mjs.map +1 -0
  12. package/dist/{atoms/button.d.mts → button/index.d.mts} +2 -2
  13. package/dist/{atoms/button.mjs → button/index.mjs} +2 -2
  14. package/dist/button/index.mjs.map +1 -0
  15. package/dist/card/index.d.mts +127 -0
  16. package/dist/card/index.mjs +2 -0
  17. package/dist/card/index.mjs.map +1 -0
  18. package/dist/{atoms/checkbox.mjs → checkbox/index.mjs} +2 -2
  19. package/dist/checkbox/index.mjs.map +1 -0
  20. package/dist/{atoms/collapsible.mjs → collapsible/index.mjs} +2 -2
  21. package/dist/collapsible/index.mjs.map +1 -0
  22. package/dist/{atoms/command.mjs → command/index.mjs} +2 -2
  23. package/dist/command/index.mjs.map +1 -0
  24. package/dist/container/index.d.mts +33 -0
  25. package/dist/{atoms/container.mjs → container/index.mjs} +2 -2
  26. package/dist/container/index.mjs.map +1 -0
  27. package/dist/{atoms/dialog.mjs → dialog/index.mjs} +2 -2
  28. package/dist/dialog/index.mjs.map +1 -0
  29. package/dist/{organisms/drawer.mjs → drawer/index.mjs} +2 -2
  30. package/dist/drawer/index.mjs.map +1 -0
  31. package/dist/{organisms/dropdown-menu.d.mts → dropdown-menu/index.d.mts} +2 -2
  32. package/dist/{organisms/dropdown-menu.mjs → dropdown-menu/index.mjs} +2 -2
  33. package/dist/dropdown-menu/index.mjs.map +1 -0
  34. package/dist/{rhf/form.mjs → form/index.mjs} +2 -2
  35. package/dist/form/index.mjs.map +1 -0
  36. package/dist/{hooks.d.mts → hooks/index.d.mts} +2 -2
  37. package/dist/{hooks.mjs → hooks/index.mjs} +2 -2
  38. package/dist/{hooks.js.map → hooks/index.mjs.map} +1 -1
  39. package/dist/index.d.mts +159 -39
  40. package/dist/index.mjs +47 -2
  41. package/dist/index.mjs.map +1 -1
  42. package/dist/{atoms/input.mjs → input/index.mjs} +2 -2
  43. package/dist/{atoms/input.mjs.map → input/index.mjs.map} +1 -1
  44. package/dist/{atoms/label.d.mts → label/index.d.mts} +2 -2
  45. package/dist/{atoms/label.mjs → label/index.mjs} +2 -2
  46. package/dist/{atoms/label.mjs.map → label/index.mjs.map} +1 -1
  47. package/dist/{molecules/navigation-menu.d.mts → navigation-menu/index.d.mts} +21 -20
  48. package/dist/{molecules/navigation-menu.mjs → navigation-menu/index.mjs} +2 -2
  49. package/dist/navigation-menu/index.mjs.map +1 -0
  50. package/dist/{atoms/page-loader.d.mts → page-loader/index.d.mts} +2 -2
  51. package/dist/{atoms/page-loader.mjs → page-loader/index.mjs} +2 -2
  52. package/dist/page-loader/index.mjs.map +1 -0
  53. package/dist/{atoms/pagination.d.mts → pagination/index.d.mts} +2 -2
  54. package/dist/{atoms/pagination.mjs → pagination/index.mjs} +2 -2
  55. package/dist/pagination/index.mjs.map +1 -0
  56. package/dist/{atoms/popover.mjs → popover/index.mjs} +2 -2
  57. package/dist/popover/index.mjs.map +1 -0
  58. package/dist/{atoms/radio-group.d.mts → radio-group/index.d.mts} +2 -2
  59. package/dist/{atoms/radio-group.mjs → radio-group/index.mjs} +2 -2
  60. package/dist/radio-group/index.mjs.map +1 -0
  61. package/dist/{atoms/resizable.mjs → resizable/index.mjs} +2 -2
  62. package/dist/resizable/index.mjs.map +1 -0
  63. package/dist/{rhf/rhf-checkbox.mjs → rhf-checkbox/index.mjs} +2 -2
  64. package/dist/rhf-checkbox/index.mjs.map +1 -0
  65. package/dist/{rhf/rhf-multi-select.mjs → rhf-multi-select/index.mjs} +2 -2
  66. package/dist/rhf-multi-select/index.mjs.map +1 -0
  67. package/dist/{rhf/rhf-radio-button-group.mjs → rhf-radio-button-group/index.mjs} +2 -2
  68. package/dist/rhf-radio-button-group/index.mjs.map +1 -0
  69. package/dist/{rhf/rhf-radio-group.mjs → rhf-radio-group/index.mjs} +2 -2
  70. package/dist/rhf-radio-group/index.mjs.map +1 -0
  71. package/dist/{rhf/rhf-select.mjs → rhf-select/index.mjs} +2 -2
  72. package/dist/rhf-select/index.mjs.map +1 -0
  73. package/dist/{rhf/rhf-switch.mjs → rhf-switch/index.mjs} +2 -2
  74. package/dist/rhf-switch/index.mjs.map +1 -0
  75. package/dist/{rhf/rhf-textarea.mjs → rhf-textarea/index.mjs} +2 -2
  76. package/dist/rhf-textarea/index.mjs.map +1 -0
  77. package/dist/{atoms/separator.mjs → separator/index.mjs} +2 -2
  78. package/dist/separator/index.mjs.map +1 -0
  79. package/dist/{atoms/sheet.d.mts → sheet/index.d.mts} +2 -2
  80. package/dist/{atoms/sheet.mjs → sheet/index.mjs} +2 -2
  81. package/dist/{atoms/sheet.mjs.map → sheet/index.mjs.map} +1 -1
  82. package/dist/{organisms/sidebar.d.mts → sidebar/index.d.mts} +4 -4
  83. package/dist/{organisms/sidebar.mjs → sidebar/index.mjs} +2 -2
  84. package/dist/sidebar/index.mjs.map +1 -0
  85. package/dist/skeleton/index.d.mts +17 -0
  86. package/dist/skeleton/index.mjs +2 -0
  87. package/dist/skeleton/index.mjs.map +1 -0
  88. package/dist/{atoms/stack.mjs → stack/index.mjs} +2 -2
  89. package/dist/{atoms/stack.mjs.map → stack/index.mjs.map} +1 -1
  90. package/dist/{atoms/switch.mjs → switch/index.mjs} +2 -2
  91. package/dist/switch/index.mjs.map +1 -0
  92. package/dist/{atoms/table.mjs → table/index.mjs} +2 -2
  93. package/dist/{atoms/table.mjs.map → table/index.mjs.map} +1 -1
  94. package/dist/tabs/index.d.mts +97 -0
  95. package/dist/tabs/index.mjs +2 -0
  96. package/dist/tabs/index.mjs.map +1 -0
  97. package/dist/{atoms/text-field.d.mts → text-field/index.d.mts} +2 -2
  98. package/dist/{atoms/text-field.mjs → text-field/index.mjs} +2 -2
  99. package/dist/text-field/index.mjs.map +1 -0
  100. package/dist/textarea/index.d.mts +24 -0
  101. package/dist/{atoms/textarea.mjs → textarea/index.mjs} +2 -2
  102. package/dist/textarea/index.mjs.map +1 -0
  103. package/dist/{atoms/toast.d.mts → toast/index.d.mts} +2 -2
  104. package/dist/{atoms/toast.mjs → toast/index.mjs} +2 -2
  105. package/dist/{atoms/toast.mjs.map → toast/index.mjs.map} +1 -1
  106. package/dist/{atoms/toaster.mjs → toaster/index.mjs} +2 -2
  107. package/dist/toaster/index.mjs.map +1 -0
  108. package/dist/{atoms/tooltip.mjs → tooltip/index.mjs} +2 -2
  109. package/dist/tooltip/index.mjs.map +1 -0
  110. package/dist/types/index.d.mts +2 -0
  111. package/dist/types/index.mjs +2 -0
  112. package/dist/types/index.mjs.map +1 -0
  113. package/dist/{atoms/typography.d.mts → typography/index.d.mts} +2 -2
  114. package/dist/{atoms/typography.mjs → typography/index.mjs} +2 -2
  115. package/dist/typography/index.mjs.map +1 -0
  116. package/dist/utils/index.d.mts +5 -0
  117. package/dist/{utils.mjs → utils/index.mjs} +2 -2
  118. package/dist/utils/index.mjs.map +1 -0
  119. package/package.json +197 -257
  120. package/dist/atoms/accordion.d.ts +0 -94
  121. package/dist/atoms/accordion.js +0 -2
  122. package/dist/atoms/accordion.js.map +0 -1
  123. package/dist/atoms/accordion.mjs.map +0 -1
  124. package/dist/atoms/avatar.d.ts +0 -34
  125. package/dist/atoms/avatar.js +0 -2
  126. package/dist/atoms/avatar.js.map +0 -1
  127. package/dist/atoms/avatar.mjs.map +0 -1
  128. package/dist/atoms/badge.d.ts +0 -40
  129. package/dist/atoms/badge.js +0 -2
  130. package/dist/atoms/badge.js.map +0 -1
  131. package/dist/atoms/box.d.ts +0 -50
  132. package/dist/atoms/box.js +0 -2
  133. package/dist/atoms/box.js.map +0 -1
  134. package/dist/atoms/box.mjs.map +0 -1
  135. package/dist/atoms/breadcrumb.d.ts +0 -35
  136. package/dist/atoms/breadcrumb.js +0 -2
  137. package/dist/atoms/breadcrumb.js.map +0 -1
  138. package/dist/atoms/breadcrumb.mjs.map +0 -1
  139. package/dist/atoms/button.d.ts +0 -82
  140. package/dist/atoms/button.js +0 -2
  141. package/dist/atoms/button.js.map +0 -1
  142. package/dist/atoms/button.mjs.map +0 -1
  143. package/dist/atoms/checkbox.d.ts +0 -21
  144. package/dist/atoms/checkbox.js +0 -2
  145. package/dist/atoms/checkbox.js.map +0 -1
  146. package/dist/atoms/checkbox.mjs.map +0 -1
  147. package/dist/atoms/collapsible.d.ts +0 -26
  148. package/dist/atoms/collapsible.js +0 -2
  149. package/dist/atoms/collapsible.js.map +0 -1
  150. package/dist/atoms/collapsible.mjs.map +0 -1
  151. package/dist/atoms/command.d.ts +0 -122
  152. package/dist/atoms/command.js +0 -2
  153. package/dist/atoms/command.js.map +0 -1
  154. package/dist/atoms/command.mjs.map +0 -1
  155. package/dist/atoms/container.js +0 -2
  156. package/dist/atoms/container.js.map +0 -1
  157. package/dist/atoms/container.mjs.map +0 -1
  158. package/dist/atoms/dialog.d.ts +0 -35
  159. package/dist/atoms/dialog.js +0 -2
  160. package/dist/atoms/dialog.js.map +0 -1
  161. package/dist/atoms/dialog.mjs.map +0 -1
  162. package/dist/atoms/input.d.ts +0 -12
  163. package/dist/atoms/input.js +0 -2
  164. package/dist/atoms/input.js.map +0 -1
  165. package/dist/atoms/label.d.ts +0 -18
  166. package/dist/atoms/label.js +0 -2
  167. package/dist/atoms/label.js.map +0 -1
  168. package/dist/atoms/page-loader.d.ts +0 -29
  169. package/dist/atoms/page-loader.js +0 -2
  170. package/dist/atoms/page-loader.js.map +0 -1
  171. package/dist/atoms/page-loader.mjs.map +0 -1
  172. package/dist/atoms/pagination.d.ts +0 -105
  173. package/dist/atoms/pagination.js +0 -2
  174. package/dist/atoms/pagination.js.map +0 -1
  175. package/dist/atoms/pagination.mjs.map +0 -1
  176. package/dist/atoms/popover.d.ts +0 -30
  177. package/dist/atoms/popover.js +0 -2
  178. package/dist/atoms/popover.js.map +0 -1
  179. package/dist/atoms/popover.mjs.map +0 -1
  180. package/dist/atoms/radio-group.d.ts +0 -62
  181. package/dist/atoms/radio-group.js +0 -2
  182. package/dist/atoms/radio-group.js.map +0 -1
  183. package/dist/atoms/radio-group.mjs.map +0 -1
  184. package/dist/atoms/resizable.d.ts +0 -53
  185. package/dist/atoms/resizable.js +0 -2
  186. package/dist/atoms/resizable.js.map +0 -1
  187. package/dist/atoms/resizable.mjs.map +0 -1
  188. package/dist/atoms/separator.d.ts +0 -13
  189. package/dist/atoms/separator.js +0 -2
  190. package/dist/atoms/separator.js.map +0 -1
  191. package/dist/atoms/separator.mjs.map +0 -1
  192. package/dist/atoms/sheet.d.ts +0 -42
  193. package/dist/atoms/sheet.js +0 -2
  194. package/dist/atoms/sheet.js.map +0 -1
  195. package/dist/atoms/skeleton.js +0 -2
  196. package/dist/atoms/skeleton.js.map +0 -1
  197. package/dist/atoms/skeleton.mjs +0 -2
  198. package/dist/atoms/skeleton.mjs.map +0 -1
  199. package/dist/atoms/stack.d.ts +0 -121
  200. package/dist/atoms/stack.js +0 -2
  201. package/dist/atoms/stack.js.map +0 -1
  202. package/dist/atoms/switch.d.ts +0 -21
  203. package/dist/atoms/switch.js +0 -2
  204. package/dist/atoms/switch.js.map +0 -1
  205. package/dist/atoms/switch.mjs.map +0 -1
  206. package/dist/atoms/table.d.ts +0 -53
  207. package/dist/atoms/table.js +0 -2
  208. package/dist/atoms/table.js.map +0 -1
  209. package/dist/atoms/text-field.d.ts +0 -65
  210. package/dist/atoms/text-field.js +0 -2
  211. package/dist/atoms/text-field.js.map +0 -1
  212. package/dist/atoms/text-field.mjs.map +0 -1
  213. package/dist/atoms/textarea.js +0 -2
  214. package/dist/atoms/textarea.js.map +0 -1
  215. package/dist/atoms/textarea.mjs.map +0 -1
  216. package/dist/atoms/toast.d.ts +0 -18
  217. package/dist/atoms/toast.js +0 -2
  218. package/dist/atoms/toast.js.map +0 -1
  219. package/dist/atoms/toaster.d.ts +0 -26
  220. package/dist/atoms/toaster.js +0 -2
  221. package/dist/atoms/toaster.js.map +0 -1
  222. package/dist/atoms/toaster.mjs.map +0 -1
  223. package/dist/atoms/tooltip.d.ts +0 -25
  224. package/dist/atoms/tooltip.js +0 -2
  225. package/dist/atoms/tooltip.js.map +0 -1
  226. package/dist/atoms/tooltip.mjs.map +0 -1
  227. package/dist/atoms/typography.d.ts +0 -24
  228. package/dist/atoms/typography.js +0 -2
  229. package/dist/atoms/typography.js.map +0 -1
  230. package/dist/atoms/typography.mjs.map +0 -1
  231. package/dist/atoms.d.mts +0 -1237
  232. package/dist/atoms.d.ts +0 -1237
  233. package/dist/atoms.js +0 -2
  234. package/dist/atoms.js.map +0 -1
  235. package/dist/atoms.mjs +0 -2
  236. package/dist/atoms.mjs.map +0 -1
  237. package/dist/hooks.d.ts +0 -57
  238. package/dist/hooks.js +0 -2
  239. package/dist/hooks.mjs.map +0 -1
  240. package/dist/index.d.ts +0 -2619
  241. package/dist/index.js +0 -2
  242. package/dist/index.js.map +0 -1
  243. package/dist/molecules/card.d.mts +0 -72
  244. package/dist/molecules/card.d.ts +0 -72
  245. package/dist/molecules/card.js +0 -2
  246. package/dist/molecules/card.js.map +0 -1
  247. package/dist/molecules/card.mjs +0 -2
  248. package/dist/molecules/card.mjs.map +0 -1
  249. package/dist/molecules/navigation-menu.d.ts +0 -103
  250. package/dist/molecules/navigation-menu.js +0 -2
  251. package/dist/molecules/navigation-menu.js.map +0 -1
  252. package/dist/molecules/navigation-menu.mjs.map +0 -1
  253. package/dist/molecules/tabs.d.mts +0 -32
  254. package/dist/molecules/tabs.d.ts +0 -32
  255. package/dist/molecules/tabs.js +0 -2
  256. package/dist/molecules/tabs.js.map +0 -1
  257. package/dist/molecules/tabs.mjs +0 -2
  258. package/dist/molecules/tabs.mjs.map +0 -1
  259. package/dist/molecules.d.mts +0 -201
  260. package/dist/molecules.d.ts +0 -201
  261. package/dist/molecules.js +0 -2
  262. package/dist/molecules.js.map +0 -1
  263. package/dist/molecules.mjs +0 -2
  264. package/dist/molecules.mjs.map +0 -1
  265. package/dist/organisms/drawer.d.ts +0 -63
  266. package/dist/organisms/drawer.js +0 -2
  267. package/dist/organisms/drawer.js.map +0 -1
  268. package/dist/organisms/drawer.mjs.map +0 -1
  269. package/dist/organisms/dropdown-menu.d.ts +0 -335
  270. package/dist/organisms/dropdown-menu.js +0 -2
  271. package/dist/organisms/dropdown-menu.js.map +0 -1
  272. package/dist/organisms/dropdown-menu.mjs.map +0 -1
  273. package/dist/organisms/sidebar.d.ts +0 -328
  274. package/dist/organisms/sidebar.js +0 -2
  275. package/dist/organisms/sidebar.js.map +0 -1
  276. package/dist/organisms/sidebar.mjs.map +0 -1
  277. package/dist/organisms.d.mts +0 -717
  278. package/dist/organisms.d.ts +0 -717
  279. package/dist/organisms.js +0 -2
  280. package/dist/organisms.js.map +0 -1
  281. package/dist/organisms.mjs +0 -2
  282. package/dist/organisms.mjs.map +0 -1
  283. package/dist/rhf/form.d.ts +0 -96
  284. package/dist/rhf/form.js +0 -2
  285. package/dist/rhf/form.js.map +0 -1
  286. package/dist/rhf/form.mjs.map +0 -1
  287. package/dist/rhf/rhf-checkbox.d.ts +0 -57
  288. package/dist/rhf/rhf-checkbox.js +0 -2
  289. package/dist/rhf/rhf-checkbox.js.map +0 -1
  290. package/dist/rhf/rhf-checkbox.mjs.map +0 -1
  291. package/dist/rhf/rhf-multi-select.d.ts +0 -84
  292. package/dist/rhf/rhf-multi-select.js +0 -2
  293. package/dist/rhf/rhf-multi-select.js.map +0 -1
  294. package/dist/rhf/rhf-multi-select.mjs.map +0 -1
  295. package/dist/rhf/rhf-radio-button-group.d.ts +0 -73
  296. package/dist/rhf/rhf-radio-button-group.js +0 -2
  297. package/dist/rhf/rhf-radio-button-group.js.map +0 -1
  298. package/dist/rhf/rhf-radio-button-group.mjs.map +0 -1
  299. package/dist/rhf/rhf-radio-group.d.ts +0 -103
  300. package/dist/rhf/rhf-radio-group.js +0 -2
  301. package/dist/rhf/rhf-radio-group.js.map +0 -1
  302. package/dist/rhf/rhf-radio-group.mjs.map +0 -1
  303. package/dist/rhf/rhf-select.d.ts +0 -80
  304. package/dist/rhf/rhf-select.js +0 -2
  305. package/dist/rhf/rhf-select.js.map +0 -1
  306. package/dist/rhf/rhf-select.mjs.map +0 -1
  307. package/dist/rhf/rhf-switch.d.ts +0 -57
  308. package/dist/rhf/rhf-switch.js +0 -2
  309. package/dist/rhf/rhf-switch.js.map +0 -1
  310. package/dist/rhf/rhf-switch.mjs.map +0 -1
  311. package/dist/rhf/rhf-textarea.d.ts +0 -66
  312. package/dist/rhf/rhf-textarea.js +0 -2
  313. package/dist/rhf/rhf-textarea.js.map +0 -1
  314. package/dist/rhf/rhf-textarea.mjs.map +0 -1
  315. package/dist/rhf.d.mts +0 -614
  316. package/dist/rhf.d.ts +0 -614
  317. package/dist/rhf.js +0 -2
  318. package/dist/rhf.js.map +0 -1
  319. package/dist/rhf.mjs +0 -2
  320. package/dist/rhf.mjs.map +0 -1
  321. package/dist/types.js +0 -2
  322. package/dist/types.js.map +0 -1
  323. package/dist/types.mjs +0 -2
  324. package/dist/types.mjs.map +0 -1
  325. package/dist/utils.js +0 -2
  326. package/dist/utils.js.map +0 -1
  327. package/dist/utils.mjs.map +0 -1
  328. /package/dist/{atoms/accordion.d.mts → accordion/index.d.mts} +0 -0
  329. /package/dist/{atoms/avatar.d.mts → avatar/index.d.mts} +0 -0
  330. /package/dist/{atoms/box.d.mts → box/index.d.mts} +0 -0
  331. /package/dist/{atoms/breadcrumb.d.mts → breadcrumb/index.d.mts} +0 -0
  332. /package/dist/{atoms/checkbox.d.mts → checkbox/index.d.mts} +0 -0
  333. /package/dist/{atoms/collapsible.d.mts → collapsible/index.d.mts} +0 -0
  334. /package/dist/{atoms/command.d.mts → command/index.d.mts} +0 -0
  335. /package/dist/{atoms/dialog.d.mts → dialog/index.d.mts} +0 -0
  336. /package/dist/{organisms/drawer.d.mts → drawer/index.d.mts} +0 -0
  337. /package/dist/{rhf/form.d.mts → form/index.d.mts} +0 -0
  338. /package/dist/{atoms/input.d.mts → input/index.d.mts} +0 -0
  339. /package/dist/{atoms/popover.d.mts → popover/index.d.mts} +0 -0
  340. /package/dist/{atoms/resizable.d.mts → resizable/index.d.mts} +0 -0
  341. /package/dist/{rhf/rhf-checkbox.d.mts → rhf-checkbox/index.d.mts} +0 -0
  342. /package/dist/{rhf/rhf-multi-select.d.mts → rhf-multi-select/index.d.mts} +0 -0
  343. /package/dist/{rhf/rhf-radio-button-group.d.mts → rhf-radio-button-group/index.d.mts} +0 -0
  344. /package/dist/{rhf/rhf-radio-group.d.mts → rhf-radio-group/index.d.mts} +0 -0
  345. /package/dist/{rhf/rhf-select.d.mts → rhf-select/index.d.mts} +0 -0
  346. /package/dist/{rhf/rhf-switch.d.mts → rhf-switch/index.d.mts} +0 -0
  347. /package/dist/{rhf/rhf-textarea.d.mts → rhf-textarea/index.d.mts} +0 -0
  348. /package/dist/{atoms/separator.d.mts → separator/index.d.mts} +0 -0
  349. /package/dist/{atoms/stack.d.mts → stack/index.d.mts} +0 -0
  350. /package/dist/{atoms/switch.d.mts → switch/index.d.mts} +0 -0
  351. /package/dist/{atoms/table.d.mts → table/index.d.mts} +0 -0
  352. /package/dist/{atoms/toaster.d.mts → toaster/index.d.mts} +0 -0
  353. /package/dist/{atoms/tooltip.d.mts → tooltip/index.d.mts} +0 -0
@@ -1,96 +0,0 @@
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 };
package/dist/rhf/form.js DELETED
@@ -1,2 +0,0 @@
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
@@ -1 +0,0 @@
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,CAA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CAAA,CAAA,cAAA,CAAc,CAAC,CAACH,CAAAA,CACf,GAAGrB,CACN,CAAA,CAEJ,CAAC,EACDuB,CAAAA,CAAY,WAAc,CAAA,aAAA,CAEpBI,IAAAA,CAAAA,CAAwBpB,wBAG5B,CAAC,CAAE,UAAAR,CAAW,CAAA,GAAGC,CAAM,CAAGC,CAAAA,CAAAA,GAAQ,CAClC,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"]}
@@ -1 +0,0 @@
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,C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AA,GAAGC,CAAM,CAAGC,CAAAA,CAAAA,GAAQ,CAClC,GAAM,CAAE,iBAAA,CAAAqB,CAAkB,CAAId,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"]}
@@ -1,57 +0,0 @@
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 };
@@ -1,2 +0,0 @@
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
@@ -1 +0,0 @@
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,C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ind-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"]}
@@ -1 +0,0 @@
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,SAAA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AAC,MAAK,CAAA,CAAA,SAAA,CAAU,uBAAwB,CAAA,QAAA,CAAA,GAAA,CAAC,GACxD,CAEDiC,CAAAA,CAAAA,EAAejC,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"]}
@@ -1,84 +0,0 @@
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 };
@@ -1,2 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/cn.ts","../../src/components/atoms/button/button.tsx","../../src/components/atoms/command/command.tsx","../../src/components/atoms/typography/typography.tsx","../../src/components/atoms/select/multi-select.tsx","../../src/components/atoms/label/label.tsx","../../src/components/rhf/form/form.tsx","../../src/components/rhf/rhf-multi-select/rhf-multi-select.tsx"],"names":["cn","inputs","twMerge","clsx","buttonVariants","cva","Button","J","className","variant","size","asChild","startIcon","endIcon","loading","disabled","children","type","ariaLabel","props","ref","Comp","Slot","isDisabled","buttonAriaLabel","handleKeyDown","event","jsx","jsxs","Loader2","Command","C","CommandPrimitive","CommandInput","Search","CommandList","CommandEmpty","CommandGroup","CommandSeparator","CommandItem","typographyVariants","Typography","U","align","Component","MultiSelect","options","value","onChange","placeholder","required","error","fullWidth","searchable","id","maxSelections","showSelectAll","renderCommandList","open","setOpen","Z","selectedOptions","option","handleSelect","optionId","selectedId","handleSelectAll","enabledOptions","handleRemove","e","Popover","PopoverTrigger","X","ChevronDown","PopoverContent","o","Check","labelVariants","Label","te","W","FormFieldContext","l","FormField","Controller","useFormField","fieldContext","itemContext","FormItemContext","getFieldState","formState","useFormContext","fieldState","FormItem","FormLabel","formItemId","FormControl","formDescriptionId","formMessageId","FormDescription","FormMessage","body","RHFMultiSelect","name","label","description","warningText","readOnly","ariaDescribedby","other","control","field"],"mappings":"4zBAGO,SAASA,CAAAA,CAAAA,GAAMC,EAAsB,CAC1C,OAAOC,sBAAQC,SAAKF,CAAAA,CAAM,CAAC,CAC7B,CCYA,IAAMG,CAAiBC,CAAAA,0BAAAA,CACrB,wRACA,CAAA,CACE,QAAU,CAAA,CACR,QAAS,CACP,OAAA,CAAS,gEACT,WAAa,CAAA,8EAAA,CACb,QACE,0FACF,CAAA,SAAA,CAAW,wEACX,CAAA,KAAA,CAAO,8CACP,CAAA,IAAA,CAAM,iDACR,CACA,CAAA,IAAA,CAAM,CACJ,OAAS,CAAA,eAAA,CACT,GAAI,6BACJ,CAAA,EAAA,CAAI,sBACJ,CA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, 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 { Slot } from \"@radix-ui/react-slot\"\nimport { cva } from \"class-variance-authority\"\nimport { cn } from \"@/utils/cn\"\nimport { Loader2 } from \"lucide-react\"\nimport { ButtonProps } from \"./button.types\"\n\n/**\n * Button variant styles using class-variance-authority.\n * Defines the visual styles for different button variants and sizes.\n * Follows WCAG 2.1 Level AA guidelines for accessibility.\n *\n * @example\n * ```tsx\n * <Button variant=\"primary\" size=\"lg\">Click me</Button>\n * ```\n */\nconst buttonVariants = cva(\n \"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\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground shadow hover:bg-primary/90\",\n destructive: \"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90\",\n outline:\n \"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground\",\n secondary: \"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\"\n } as const,\n size: {\n default: \"h-9 px-4 py-2\",\n sm: \"h-8 rounded-md px-3 text-xs\",\n lg: \"h-10 rounded-md px-8\",\n icon: \"h-9 w-9\"\n } as const\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\"\n }\n }\n)\n\n/**\n * A versatile button component that supports multiple variants, sizes, and can be rendered as a child component.\n * Built on top of Radix UI's Slot primitive for maximum flexibility.\n * Implements proper accessibility features and follows WCAG 2.1 Level AA guidelines.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-button--docs\n *\n * @component\n * @example\n * ```tsx\n * // Default button\n * <Button>Click me</Button>\n *\n * // Destructive button with small size\n * <Button variant=\"destructive\" size=\"sm\">Delete</Button>\n *\n * // As a link\n * <Button variant=\"link\" asChild>\n * <a href=\"/about\">About</a>\n * </Button>\n *\n * // With icons\n * <Button startIcon={<Icon />}>With Start Icon</Button>\n * <Button endIcon={<Icon />}>With End Icon</Button>\n *\n * // Loading state\n * <Button loading>Loading</Button>\n * ```\n *\n * @param {ButtonProps} props - The component props\n * @param {React.Ref<HTMLButtonElement>} ref - Forwarded ref\n * @returns {JSX.Element} A button element\n */\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n asChild = false,\n startIcon,\n endIcon,\n loading = false,\n disabled,\n children,\n type = \"button\",\n \"aria-label\": ariaLabel,\n ...props\n },\n ref\n ) => {\n const Comp = asChild ? Slot : \"button\"\n const isDisabled = disabled || loading\n const buttonAriaLabel = ariaLabel || (typeof children === \"string\" ? children : undefined)\n\n // Handle keyboard interaction\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault()\n if (!isDisabled && props.onClick) {\n props.onClick(event as unknown as React.MouseEvent<HTMLButtonElement>)\n }\n }\n }\n\n if (asChild) {\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n disabled={isDisabled}\n type={type}\n aria-label={buttonAriaLabel}\n aria-disabled={isDisabled}\n {...props}\n >\n {children}\n </Comp>\n )\n }\n\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n disabled={isDisabled}\n type={type}\n aria-label={buttonAriaLabel}\n aria-disabled={isDisabled}\n onKeyDown={handleKeyDown}\n {...props}\n >\n {loading && (\n <Loader2\n className=\"mr-2 h-4 w-4 animate-spin\"\n role=\"status\"\n aria-label=\"Loading\"\n aria-hidden=\"true\"\n />\n )}\n {!loading && startIcon && (\n <span className=\"mr-2\" aria-hidden=\"true\">\n {startIcon}\n </span>\n )}\n {children}\n {!loading && endIcon && (\n <span className=\"ml-2\" aria-hidden=\"true\">\n {endIcon}\n </span>\n )}\n </Comp>\n )\n }\n)\nButton.displayName = \"Button\"\n\nexport { Button, buttonVariants }\n","import * as React from \"react\"\nimport { Command as CommandPrimitive } from \"cmdk\"\nimport { Search } from \"lucide-react\"\n\nimport { cn } from \"@/utils/index\"\nimport { Dialog, DialogContent } from \"@/components/atoms/dialog\"\nimport {\n type CommandProps,\n type CommandRef,\n type CommandDialogProps,\n type CommandInputProps,\n type CommandInputRef,\n type CommandListProps,\n type CommandListRef,\n type CommandEmptyProps,\n type CommandEmptyRef,\n type CommandGroupProps,\n type CommandGroupRef,\n type CommandSeparatorProps,\n type CommandSeparatorRef,\n type CommandItemProps,\n type CommandItemRef,\n type CommandShortcutProps\n} from \"./command.types\"\n\n/**\n * Command component that provides a command palette interface.\n * Built on top of cmdk and Radix UI's Dialog primitive.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-command--docs\n *\n * @example\n * ```tsx\n * <Command>\n * <CommandInput placeholder=\"Search...\" />\n * <CommandList>\n * <CommandEmpty>No results found.</CommandEmpty>\n * <CommandGroup heading=\"Suggestions\">\n * <CommandItem>Calendar</CommandItem>\n * <CommandItem>Search</CommandItem>\n * </CommandGroup>\n * </CommandList>\n * </Command>\n * ```\n */\nconst Command = React.forwardRef<CommandRef, CommandProps>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground\",\n className\n )}\n {...props}\n />\n))\nCommand.displayName = CommandPrimitive.displayName\n\nconst CommandDialog = ({ children, ...props }: CommandDialogProps) => {\n return (\n <Dialog {...props}>\n <DialogContent className=\"overflow-hidden p-0\">\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n )\n}\n\nconst CommandInput = React.forwardRef<CommandInputRef, CommandInputProps>(\n ({ className, ...props }, ref) => (\n <div className=\"flex items-center border-b px-3\" cmdk-input-wrapper=\"\">\n <Search className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"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\",\n className\n )}\n {...props}\n />\n </div>\n )\n)\nCommandInput.displayName = CommandPrimitive.Input.displayName\n\nconst CommandList = React.forwardRef<CommandListRef, CommandListProps>(\n ({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\"max-h-[300px] overflow-y-auto overflow-x-hidden\", className)}\n {...props}\n />\n )\n)\nCommandList.displayName = CommandPrimitive.List.displayName\n\nconst CommandEmpty = React.forwardRef<CommandEmptyRef, CommandEmptyProps>((props, ref) => (\n <CommandPrimitive.Empty ref={ref} className=\"py-6 text-center text-sm\" {...props} />\n))\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName\n\nconst CommandGroup = React.forwardRef<CommandGroupRef, CommandGroupProps>(\n ({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"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\",\n className\n )}\n {...props}\n />\n )\n)\nCommandGroup.displayName = CommandPrimitive.Group.displayName\n\nconst CommandSeparator = React.forwardRef<CommandSeparatorRef, CommandSeparatorProps>(\n ({ className, ...props }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 h-px bg-border\", className)}\n {...props}\n />\n )\n)\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName\n\nconst CommandItem = React.forwardRef<CommandItemRef, CommandItemProps>(\n ({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"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\",\n className\n )}\n {...props}\n />\n )\n)\nCommandItem.displayName = CommandPrimitive.Item.displayName\n\nconst CommandShortcut = ({ className, ...props }: CommandShortcutProps) => {\n return (\n <span\n className={cn(\"ml-auto text-xs tracking-widest text-muted-foreground\", className)}\n {...props}\n />\n )\n}\nCommandShortcut.displayName = \"CommandShortcut\"\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator\n}\n","import * as React from \"react\"\nimport { cn } from \"@/utils\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nconst typographyVariants = cva(\"\", {\n variants: {\n variant: {\n h1: \"scroll-m-5 text-4xl font-extrabold tracking-tight lg:text-5xl\",\n h2: \"scroll-m-5 text-3xl font-semibold tracking-tight\",\n h3: \"scroll-m-5 text-2xl font-semibold tracking-tight\",\n h4: \"scroll-m-5 text-xl font-semibold tracking-tight\",\n h5: \"scroll-m-5 text-lg font-semibold tracking-tight\",\n h6: \"scroll-m-5 text-base font-semibold tracking-tight\",\n p: \"leading-7 [&:not(:first-child)]:mt-6\",\n blockquote: \"mt-6 border-l-2 border-slate-300 pl-6 italic\",\n list: \"my-6 ml-6 list-disc [&>li]:mt-2\",\n lead: \"text-xl text-muted-foreground\",\n large: \"text-lg font-semibold\",\n small: \"text-sm font-medium leading-none\",\n muted: \"text-sm text-muted-foreground\"\n },\n align: {\n left: \"text-left\",\n center: \"text-center\",\n right: \"text-right\",\n justify: \"text-justify\"\n }\n },\n defaultVariants: {\n variant: \"p\",\n align: \"left\"\n }\n})\n\nexport interface TypographyProps\n extends React.HTMLAttributes<HTMLElement>,\n VariantProps<typeof typographyVariants> {\n as?: React.ElementType\n}\n\n/**\n * Typography component for creating accessible text elements.\n * Built on top of shadcn/ui's Typography component.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-typography--docs\n *\n */\nconst Typography = React.forwardRef<HTMLElement, TypographyProps>(\n ({ className, variant, align, as: Component = \"p\", ...props }, ref) => {\n return (\n <Component\n className={cn(typographyVariants({ variant, align, className }))}\n ref={ref}\n {...props}\n />\n )\n }\n)\n\nTypography.displayName = \"Typography\"\n\nexport { Typography, typographyVariants }\n","\"use client\"\n\nimport * as React from \"react\"\nimport { Check, ChevronDown, X } from \"lucide-react\"\n\nimport { cn } from \"@/utils\"\n\nimport { Popover, PopoverContent, PopoverTrigger } from \"@radix-ui/react-popover\"\nimport { Button } from \"../button\"\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandSeparator\n} from \"../command\"\nimport { Typography } from \"../typography\"\n\nexport type MultiSelectOption = {\n id: string\n label: string\n startIcon?: React.ReactNode\n endIcon?: React.ReactNode\n className?: string\n disabled?: boolean\n}\n\nexport type MultiSelectProps = {\n /** Whether the select is searchable */\n searchable?: boolean\n /** Whether the select should take up the full width of its container */\n fullWidth?: boolean\n /** Array of options to display in the select */\n options: MultiSelectOption[]\n /** Currently selected values */\n value: string[]\n /** Callback fired when the values change */\n // eslint-disable-next-line no-unused-vars\n onChange: (value: string[]) => void\n /** Render a custom CommandList for the select, if not provided, the select will render a default CommandList with the options */\n // eslint-disable-next-line no-unused-vars\n renderCommandList?: (options: MultiSelectOption[]) => React.ReactNode\n /** Placeholder text to show when no value is selected */\n placeholder?: string\n /** Whether the select is disabled */\n disabled?: boolean\n /** Whether the select is required */\n required?: boolean\n /** Error message to display */\n error?: string\n /** Additional class name for the select */\n className?: string\n /** ID for the select element */\n id?: string\n /** Maximum number of selections allowed */\n maxSelections?: number\n /** Whether to show the select all option */\n showSelectAll?: boolean\n}\n\n/**\n * MultiSelect component that provides a searchable dropdown select input with multiple selection.\n * Built on top of Radix UI's Select primitive.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs-atoms-multiselect--docs\n *\n * @example\n * ```tsx\n * <MultiSelect\n * options={[\n * { id: \"1\", label: \"Option 1\" },\n * { id: \"2\", label: \"Option 2\" }\n * ]}\n * value={[\"1\"]}\n * onChange={setValue}\n * showSelectAll\n * />\n * ```\n */\nexport function MultiSelect({\n options,\n value,\n onChange,\n placeholder = \"Select options\",\n disabled,\n required,\n error,\n className,\n fullWidth,\n searchable,\n id,\n maxSelections,\n showSelectAll,\n renderCommandList\n}: MultiSelectProps) {\n const [open, setOpen] = React.useState(false)\n const selectedOptions = options.filter((option) => value.includes(option.id))\n\n const handleSelect = (optionId: string) => {\n if (value.includes(optionId)) {\n onChange(value.filter((selectedId) => selectedId !== optionId))\n } else {\n if (maxSelections && value.length >= maxSelections) {\n return\n }\n onChange([...value, optionId])\n }\n }\n\n const handleSelectAll = () => {\n const enabledOptions = options.filter((option) => !option.disabled)\n if (value.length === enabledOptions.length) {\n onChange([])\n } else {\n onChange(enabledOptions.map((option) => option.id))\n }\n }\n\n const handleRemove = (optionId: string, e: React.MouseEvent) => {\n e.stopPropagation()\n onChange(value.filter((selectedId) => selectedId !== optionId))\n }\n\n return (\n <div className={cn(fullWidth && \"w-full\")}>\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n role=\"combobox\"\n aria-expanded={open}\n aria-controls={id ? `${id}-content` : undefined}\n aria-label={placeholder}\n aria-required={required}\n aria-invalid={!!error}\n disabled={disabled}\n id={id}\n className={cn(\n \"w-[13rem] justify-between min-h-[2.5rem] h-auto\",\n !value.length && \"text-muted-foreground\",\n fullWidth && \"w-full\",\n error && \"border-destructive focus-visible:ring-destructive\",\n className\n )}\n >\n <div className=\"flex flex-wrap gap-1\">\n {selectedOptions.length > 0 ? (\n selectedOptions.map((option) => (\n <div\n key={option.id}\n className=\"flex items-center gap-1 bg-secondary text-secondary-foreground px-2 py-0.5 rounded-md text-sm\"\n >\n <span>{option.label}</span>\n <span\n onClick={(e) => handleRemove(option.id, e)}\n className=\"hover:bg-secondary-foreground/20 rounded-sm\"\n >\n <X className=\"h-3 w-3\" />\n </span>\n </div>\n ))\n ) : (\n <span>{placeholder}</span>\n )}\n </div>\n <ChevronDown className={cn(\"opacity-50\", open && \"rotate-180\")} />\n </Button>\n </PopoverTrigger>\n <PopoverContent\n id={id ? `${id}-content` : undefined}\n className={cn(\n \"w-[13rem] p-0 rounded-md border bg-popover text-popover-foreground shadow-md\",\n fullWidth && \"w-full\"\n )}\n align=\"start\"\n >\n <Command>\n {searchable && (\n <CommandInput placeholder=\"Search...\" className=\"h-9\" disabled={disabled} />\n )}\n <CommandList className=\"max-h-[12rem] overflow-y-auto\">\n <CommandEmpty>No items found.</CommandEmpty>\n <CommandGroup>\n {showSelectAll && (\n <CommandItem\n onSelect={handleSelectAll}\n className=\"flex items-center gap-2 cursor-pointer my-1\"\n >\n <div className=\"flex h-4 w-4 items-center justify-center rounded border border-primary\">\n {value.length === options.filter((o) => !o.disabled).length && (\n <Check className=\"h-3 w-3\" />\n )}\n </div>\n <Typography variant=\"small\">Select All</Typography>\n </CommandItem>\n )}\n <CommandSeparator />\n </CommandGroup>\n {renderCommandList ? (\n renderCommandList(options)\n ) : (\n <CommandGroup>\n {options.map((option) => (\n <CommandItem\n value={option.id}\n key={option.id}\n onSelect={() => handleSelect(option.id)}\n disabled={option.disabled}\n className={cn(\n \"flex items-center justify-between cursor-pointer my-1\",\n option.disabled && \"opacity-50 cursor-not-allowed\",\n option.className\n )}\n >\n <div className=\"flex items-center gap-2\">\n <div className=\"flex h-4 w-4 items-center justify-center rounded border border-primary\">\n {value.includes(option.id) && <Check className=\"h-3 w-3\" />}\n </div>\n <div className=\"flex items-center gap-1\">\n {option.startIcon && option.startIcon}\n <Typography variant=\"small\">{option.label}</Typography>\n </div>\n </div>\n {option.endIcon && <div className=\"ml-2\">{option.endIcon}</div>}\n </CommandItem>\n ))}\n </CommandGroup>\n )}\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n </div>\n )\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","import * as React from \"react\"\nimport { useFormContext, type FieldValues, type FieldPath } from \"react-hook-form\"\nimport { MultiSelect } from \"@/components/atoms/select\"\n\nimport { cn } from \"@/utils/cn\"\nimport {\n FormControl,\n FormItem,\n FormMessage,\n FormLabel,\n FormDescription,\n FormField\n} from \"@/components/rhf/form\"\nimport { type RHFMultiSelectProps } from \"./rhf-multi-select.types\"\n\n// ----------------------------------------------------------------------\n\n/**\n * A multi-select 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-rhfmultiselect--docs\n *\n * @example\n * ```tsx\n * <Form>\n * <RHFMultiSelect\n * name=\"countries\"\n * label=\"Countries\"\n * options={[\n * { id: \"us\", label: \"United States\" },\n * { id: \"ca\", label: \"Canada\" }\n * ]}\n *\n * />\n * </Form>\n * ```\n */\nexport function RHFMultiSelect<\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 placeholder,\n \"aria-label\": ariaLabel,\n \"aria-describedby\": ariaDescribedby,\n options,\n ...other\n}: RHFMultiSelectProps<TFieldValues, TName>) {\n const { control } = useFormContext<TFieldValues>()\n\n return (\n <FormField\n name={name}\n control={control}\n render={({ field, fieldState: { error } }) => {\n return (\n <FormItem>\n {label && (\n <FormLabel>\n {label}\n {required && <span className=\"text-destructive ml-1\">*</span>}\n </FormLabel>\n )}\n <FormControl>\n <MultiSelect\n {...field}\n options={options}\n value={field.value || []}\n onChange={field.onChange}\n className={cn(\n error && \"border-destructive focus-visible:ring-destructive\",\n className\n )}\n disabled={disabled || readOnly}\n required={required}\n placeholder={placeholder}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-invalid={!!error}\n aria-required={required}\n {...other}\n />\n </FormControl>\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 </FormItem>\n )\n }}\n />\n )\n}\n"]}