@me1a/ui 2.2.1 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (376) hide show
  1. package/dist/atoms/accordion.d.mts +94 -0
  2. package/dist/atoms/accordion.d.ts +94 -0
  3. package/dist/atoms/accordion.js +2 -0
  4. package/dist/atoms/accordion.js.map +1 -0
  5. package/dist/atoms/accordion.mjs +2 -0
  6. package/dist/atoms/accordion.mjs.map +1 -0
  7. package/dist/atoms/avatar.d.mts +34 -0
  8. package/dist/atoms/avatar.d.ts +34 -0
  9. package/dist/atoms/avatar.js +2 -0
  10. package/dist/atoms/avatar.js.map +1 -0
  11. package/dist/atoms/avatar.mjs +2 -0
  12. package/dist/atoms/avatar.mjs.map +1 -0
  13. package/dist/atoms/badge.d.mts +40 -0
  14. package/dist/atoms/badge.d.ts +40 -0
  15. package/dist/atoms/badge.js +2 -0
  16. package/dist/atoms/badge.js.map +1 -0
  17. package/dist/atoms/badge.mjs +2 -0
  18. package/dist/atoms/badge.mjs.map +1 -0
  19. package/dist/atoms/box.d.mts +50 -0
  20. package/dist/atoms/box.d.ts +50 -0
  21. package/dist/atoms/box.js +2 -0
  22. package/dist/atoms/box.js.map +1 -0
  23. package/dist/atoms/box.mjs +2 -0
  24. package/dist/atoms/box.mjs.map +1 -0
  25. package/dist/atoms/breadcrumb.d.mts +35 -0
  26. package/dist/atoms/breadcrumb.d.ts +35 -0
  27. package/dist/atoms/breadcrumb.js +2 -0
  28. package/dist/atoms/breadcrumb.js.map +1 -0
  29. package/dist/atoms/breadcrumb.mjs +2 -0
  30. package/dist/atoms/breadcrumb.mjs.map +1 -0
  31. package/dist/{tooltip-B4jzaurK.d.mts → atoms/button.d.mts} +1 -23
  32. package/dist/{tooltip-B4jzaurK.d.ts → atoms/button.d.ts} +1 -23
  33. package/dist/atoms/button.js +2 -0
  34. package/dist/atoms/button.js.map +1 -0
  35. package/dist/atoms/button.mjs +2 -0
  36. package/dist/atoms/button.mjs.map +1 -0
  37. package/dist/atoms/checkbox.d.mts +21 -0
  38. package/dist/atoms/checkbox.d.ts +21 -0
  39. package/dist/atoms/checkbox.js +2 -0
  40. package/dist/atoms/checkbox.js.map +1 -0
  41. package/dist/atoms/checkbox.mjs +2 -0
  42. package/dist/atoms/checkbox.mjs.map +1 -0
  43. package/dist/atoms/collapsible.d.mts +26 -0
  44. package/dist/atoms/collapsible.d.ts +26 -0
  45. package/dist/atoms/collapsible.js +2 -0
  46. package/dist/atoms/collapsible.js.map +1 -0
  47. package/dist/atoms/collapsible.mjs +2 -0
  48. package/dist/atoms/collapsible.mjs.map +1 -0
  49. package/dist/atoms/command.d.mts +122 -0
  50. package/dist/atoms/command.d.ts +122 -0
  51. package/dist/atoms/command.js +2 -0
  52. package/dist/atoms/command.js.map +1 -0
  53. package/dist/atoms/command.mjs +2 -0
  54. package/dist/atoms/command.mjs.map +1 -0
  55. package/dist/atoms/container.js +2 -0
  56. package/dist/atoms/container.js.map +1 -0
  57. package/dist/atoms/container.mjs +2 -0
  58. package/dist/atoms/container.mjs.map +1 -0
  59. package/dist/atoms/dialog.d.mts +35 -0
  60. package/dist/atoms/dialog.d.ts +35 -0
  61. package/dist/atoms/dialog.js +2 -0
  62. package/dist/atoms/dialog.js.map +1 -0
  63. package/dist/atoms/dialog.mjs +2 -0
  64. package/dist/atoms/dialog.mjs.map +1 -0
  65. package/dist/atoms/input.d.mts +12 -0
  66. package/dist/atoms/input.d.ts +12 -0
  67. package/dist/atoms/input.js +2 -0
  68. package/dist/atoms/input.js.map +1 -0
  69. package/dist/atoms/input.mjs +2 -0
  70. package/dist/atoms/input.mjs.map +1 -0
  71. package/dist/atoms/label.d.mts +18 -0
  72. package/dist/atoms/label.d.ts +18 -0
  73. package/dist/atoms/label.js +2 -0
  74. package/dist/atoms/label.js.map +1 -0
  75. package/dist/atoms/label.mjs +2 -0
  76. package/dist/atoms/label.mjs.map +1 -0
  77. package/dist/atoms/page-loader.d.mts +29 -0
  78. package/dist/atoms/page-loader.d.ts +29 -0
  79. package/dist/atoms/page-loader.js +2 -0
  80. package/dist/atoms/page-loader.js.map +1 -0
  81. package/dist/atoms/page-loader.mjs +2 -0
  82. package/dist/atoms/page-loader.mjs.map +1 -0
  83. package/dist/atoms/pagination.d.mts +105 -0
  84. package/dist/atoms/pagination.d.ts +105 -0
  85. package/dist/atoms/pagination.js +2 -0
  86. package/dist/atoms/pagination.js.map +1 -0
  87. package/dist/atoms/pagination.mjs +2 -0
  88. package/dist/atoms/pagination.mjs.map +1 -0
  89. package/dist/atoms/popover.d.mts +30 -0
  90. package/dist/atoms/popover.d.ts +30 -0
  91. package/dist/atoms/popover.js +2 -0
  92. package/dist/atoms/popover.js.map +1 -0
  93. package/dist/atoms/popover.mjs +2 -0
  94. package/dist/atoms/popover.mjs.map +1 -0
  95. package/dist/{checkbox-DxgDKaHx.d.mts → atoms/radio-group.d.mts} +4 -50
  96. package/dist/{checkbox-DxgDKaHx.d.ts → atoms/radio-group.d.ts} +4 -50
  97. package/dist/atoms/radio-group.js +2 -0
  98. package/dist/atoms/radio-group.js.map +1 -0
  99. package/dist/atoms/radio-group.mjs +2 -0
  100. package/dist/atoms/radio-group.mjs.map +1 -0
  101. package/dist/atoms/resizable.d.mts +53 -0
  102. package/dist/atoms/resizable.d.ts +53 -0
  103. package/dist/atoms/resizable.js +2 -0
  104. package/dist/atoms/resizable.js.map +1 -0
  105. package/dist/atoms/resizable.mjs +2 -0
  106. package/dist/atoms/resizable.mjs.map +1 -0
  107. package/dist/atoms/separator.d.mts +13 -0
  108. package/dist/atoms/separator.d.ts +13 -0
  109. package/dist/atoms/separator.js +2 -0
  110. package/dist/atoms/separator.js.map +1 -0
  111. package/dist/atoms/separator.mjs +2 -0
  112. package/dist/atoms/separator.mjs.map +1 -0
  113. package/dist/atoms/sheet.d.mts +42 -0
  114. package/dist/atoms/sheet.d.ts +42 -0
  115. package/dist/atoms/sheet.js +2 -0
  116. package/dist/atoms/sheet.js.map +1 -0
  117. package/dist/atoms/sheet.mjs +2 -0
  118. package/dist/atoms/sheet.mjs.map +1 -0
  119. package/dist/atoms/skeleton.js +2 -0
  120. package/dist/atoms/skeleton.js.map +1 -0
  121. package/dist/atoms/skeleton.mjs +2 -0
  122. package/dist/atoms/skeleton.mjs.map +1 -0
  123. package/dist/atoms/stack.d.mts +121 -0
  124. package/dist/atoms/stack.d.ts +121 -0
  125. package/dist/atoms/stack.js +2 -0
  126. package/dist/atoms/stack.js.map +1 -0
  127. package/dist/atoms/stack.mjs +2 -0
  128. package/dist/atoms/stack.mjs.map +1 -0
  129. package/dist/atoms/switch.d.mts +21 -0
  130. package/dist/atoms/switch.d.ts +21 -0
  131. package/dist/atoms/switch.js +2 -0
  132. package/dist/atoms/switch.js.map +1 -0
  133. package/dist/atoms/switch.mjs +2 -0
  134. package/dist/atoms/switch.mjs.map +1 -0
  135. package/dist/atoms/table.d.mts +53 -0
  136. package/dist/atoms/table.d.ts +53 -0
  137. package/dist/atoms/table.js +2 -0
  138. package/dist/atoms/table.js.map +1 -0
  139. package/dist/atoms/table.mjs +2 -0
  140. package/dist/atoms/table.mjs.map +1 -0
  141. package/dist/atoms/text-field.d.mts +65 -0
  142. package/dist/atoms/text-field.d.ts +65 -0
  143. package/dist/atoms/text-field.js +2 -0
  144. package/dist/atoms/text-field.js.map +1 -0
  145. package/dist/atoms/text-field.mjs +2 -0
  146. package/dist/atoms/text-field.mjs.map +1 -0
  147. package/dist/atoms/textarea.js +2 -0
  148. package/dist/atoms/textarea.js.map +1 -0
  149. package/dist/atoms/textarea.mjs +2 -0
  150. package/dist/atoms/textarea.mjs.map +1 -0
  151. package/dist/{toast-2xT7L1tJ.d.mts → atoms/toast.d.mts} +1 -1
  152. package/dist/{toast-2xT7L1tJ.d.ts → atoms/toast.d.ts} +1 -1
  153. package/dist/atoms/toast.js +2 -0
  154. package/dist/atoms/toast.js.map +1 -0
  155. package/dist/atoms/toast.mjs +2 -0
  156. package/dist/atoms/toast.mjs.map +1 -0
  157. package/dist/atoms/toaster.d.mts +26 -0
  158. package/dist/atoms/toaster.d.ts +26 -0
  159. package/dist/atoms/toaster.js +2 -0
  160. package/dist/atoms/toaster.js.map +1 -0
  161. package/dist/atoms/toaster.mjs +2 -0
  162. package/dist/atoms/toaster.mjs.map +1 -0
  163. package/dist/atoms/tooltip.d.mts +25 -0
  164. package/dist/atoms/tooltip.d.ts +25 -0
  165. package/dist/atoms/tooltip.js +2 -0
  166. package/dist/atoms/tooltip.js.map +1 -0
  167. package/dist/atoms/tooltip.mjs +2 -0
  168. package/dist/atoms/tooltip.mjs.map +1 -0
  169. package/dist/atoms/typography.d.mts +24 -0
  170. package/dist/atoms/typography.d.ts +24 -0
  171. package/dist/atoms/typography.js +2 -0
  172. package/dist/atoms/typography.js.map +1 -0
  173. package/dist/atoms/typography.mjs +2 -0
  174. package/dist/atoms/typography.mjs.map +1 -0
  175. package/dist/atoms.d.mts +213 -27
  176. package/dist/atoms.d.ts +213 -27
  177. package/dist/atoms.js +2 -0
  178. package/dist/atoms.js.map +1 -0
  179. package/dist/atoms.mjs +2 -0
  180. package/dist/atoms.mjs.map +1 -0
  181. package/dist/hooks.d.mts +10 -4
  182. package/dist/hooks.d.ts +10 -4
  183. package/dist/hooks.js +2 -0
  184. package/dist/hooks.js.map +1 -0
  185. package/dist/hooks.mjs +2 -0
  186. package/dist/hooks.mjs.map +1 -0
  187. package/dist/index.d.mts +2619 -30
  188. package/dist/index.d.ts +2619 -30
  189. package/dist/index.js +2 -0
  190. package/dist/index.js.map +1 -0
  191. package/dist/index.mjs +2 -0
  192. package/dist/index.mjs.map +1 -0
  193. package/dist/molecules/card.d.mts +72 -0
  194. package/dist/molecules/card.d.ts +72 -0
  195. package/dist/molecules/card.js +2 -0
  196. package/dist/molecules/card.js.map +1 -0
  197. package/dist/molecules/card.mjs +2 -0
  198. package/dist/molecules/card.mjs.map +1 -0
  199. package/dist/molecules/navigation-menu.d.mts +103 -0
  200. package/dist/molecules/navigation-menu.d.ts +103 -0
  201. package/dist/molecules/navigation-menu.js +2 -0
  202. package/dist/molecules/navigation-menu.js.map +1 -0
  203. package/dist/molecules/navigation-menu.mjs +2 -0
  204. package/dist/molecules/navigation-menu.mjs.map +1 -0
  205. package/dist/molecules/tabs.d.mts +32 -0
  206. package/dist/molecules/tabs.d.ts +32 -0
  207. package/dist/molecules/tabs.js +2 -0
  208. package/dist/molecules/tabs.js.map +1 -0
  209. package/dist/molecules/tabs.mjs +2 -0
  210. package/dist/molecules/tabs.mjs.map +1 -0
  211. package/dist/molecules.d.mts +1 -1
  212. package/dist/molecules.d.ts +1 -1
  213. package/dist/molecules.js +2 -0
  214. package/dist/molecules.js.map +1 -0
  215. package/dist/molecules.mjs +2 -0
  216. package/dist/molecules.mjs.map +1 -0
  217. package/dist/organisms/drawer.d.mts +63 -0
  218. package/dist/organisms/drawer.d.ts +63 -0
  219. package/dist/organisms/drawer.js +2 -0
  220. package/dist/organisms/drawer.js.map +1 -0
  221. package/dist/organisms/drawer.mjs +2 -0
  222. package/dist/organisms/drawer.mjs.map +1 -0
  223. package/dist/organisms/dropdown-menu.d.mts +335 -0
  224. package/dist/organisms/dropdown-menu.d.ts +335 -0
  225. package/dist/organisms/dropdown-menu.js +2 -0
  226. package/dist/organisms/dropdown-menu.js.map +1 -0
  227. package/dist/organisms/dropdown-menu.mjs +2 -0
  228. package/dist/organisms/dropdown-menu.mjs.map +1 -0
  229. package/dist/organisms/sidebar.d.mts +328 -0
  230. package/dist/organisms/sidebar.d.ts +328 -0
  231. package/dist/organisms/sidebar.js +2 -0
  232. package/dist/organisms/sidebar.js.map +1 -0
  233. package/dist/organisms/sidebar.mjs +2 -0
  234. package/dist/organisms/sidebar.mjs.map +1 -0
  235. package/dist/organisms.d.mts +56 -12
  236. package/dist/organisms.d.ts +56 -12
  237. package/dist/organisms.js +2 -0
  238. package/dist/organisms.js.map +1 -0
  239. package/dist/organisms.mjs +2 -0
  240. package/dist/organisms.mjs.map +1 -0
  241. package/dist/rhf/form.d.mts +96 -0
  242. package/dist/rhf/form.d.ts +96 -0
  243. package/dist/rhf/form.js +2 -0
  244. package/dist/rhf/form.js.map +1 -0
  245. package/dist/rhf/form.mjs +2 -0
  246. package/dist/rhf/form.mjs.map +1 -0
  247. package/dist/rhf/rhf-checkbox.d.mts +57 -0
  248. package/dist/rhf/rhf-checkbox.d.ts +57 -0
  249. package/dist/rhf/rhf-checkbox.js +2 -0
  250. package/dist/rhf/rhf-checkbox.js.map +1 -0
  251. package/dist/rhf/rhf-checkbox.mjs +2 -0
  252. package/dist/rhf/rhf-checkbox.mjs.map +1 -0
  253. package/dist/rhf/rhf-multi-select.d.mts +84 -0
  254. package/dist/rhf/rhf-multi-select.d.ts +84 -0
  255. package/dist/rhf/rhf-multi-select.js +2 -0
  256. package/dist/rhf/rhf-multi-select.js.map +1 -0
  257. package/dist/rhf/rhf-multi-select.mjs +2 -0
  258. package/dist/rhf/rhf-multi-select.mjs.map +1 -0
  259. package/dist/rhf/rhf-radio-button-group.d.mts +73 -0
  260. package/dist/rhf/rhf-radio-button-group.d.ts +73 -0
  261. package/dist/rhf/rhf-radio-button-group.js +2 -0
  262. package/dist/rhf/rhf-radio-button-group.js.map +1 -0
  263. package/dist/rhf/rhf-radio-button-group.mjs +2 -0
  264. package/dist/rhf/rhf-radio-button-group.mjs.map +1 -0
  265. package/dist/rhf/rhf-radio-group.d.mts +103 -0
  266. package/dist/rhf/rhf-radio-group.d.ts +103 -0
  267. package/dist/rhf/rhf-radio-group.js +2 -0
  268. package/dist/rhf/rhf-radio-group.js.map +1 -0
  269. package/dist/rhf/rhf-radio-group.mjs +2 -0
  270. package/dist/rhf/rhf-radio-group.mjs.map +1 -0
  271. package/dist/rhf/rhf-select.d.mts +80 -0
  272. package/dist/rhf/rhf-select.d.ts +80 -0
  273. package/dist/rhf/rhf-select.js +2 -0
  274. package/dist/rhf/rhf-select.js.map +1 -0
  275. package/dist/rhf/rhf-select.mjs +2 -0
  276. package/dist/rhf/rhf-select.mjs.map +1 -0
  277. package/dist/rhf/rhf-switch.d.mts +57 -0
  278. package/dist/rhf/rhf-switch.d.ts +57 -0
  279. package/dist/rhf/rhf-switch.js +2 -0
  280. package/dist/rhf/rhf-switch.js.map +1 -0
  281. package/dist/rhf/rhf-switch.mjs +2 -0
  282. package/dist/rhf/rhf-switch.mjs.map +1 -0
  283. package/dist/rhf/rhf-textarea.d.mts +66 -0
  284. package/dist/rhf/rhf-textarea.d.ts +66 -0
  285. package/dist/rhf/rhf-textarea.js +2 -0
  286. package/dist/rhf/rhf-textarea.js.map +1 -0
  287. package/dist/rhf/rhf-textarea.mjs +2 -0
  288. package/dist/rhf/rhf-textarea.mjs.map +1 -0
  289. package/dist/rhf.d.mts +213 -7
  290. package/dist/rhf.d.ts +213 -7
  291. package/dist/rhf.js +2 -0
  292. package/dist/rhf.js.map +1 -0
  293. package/dist/rhf.mjs +2 -0
  294. package/dist/rhf.mjs.map +1 -0
  295. package/dist/types.js +2 -0
  296. package/dist/{types.cjs.js.map → types.js.map} +1 -1
  297. package/dist/types.mjs +2 -0
  298. package/dist/{types.esm.js.map → types.mjs.map} +1 -1
  299. package/dist/{chunk-SL2ZUI4G.cjs.js → utils.js} +2 -2
  300. package/dist/utils.js.map +1 -0
  301. package/dist/utils.mjs +2 -0
  302. package/dist/utils.mjs.map +1 -0
  303. package/package.json +241 -15
  304. package/dist/atoms.cjs.js +0 -2
  305. package/dist/atoms.cjs.js.map +0 -1
  306. package/dist/atoms.esm.js +0 -2
  307. package/dist/atoms.esm.js.map +0 -1
  308. package/dist/chunk-23T2PH5G.esm.js +0 -2
  309. package/dist/chunk-23T2PH5G.esm.js.map +0 -1
  310. package/dist/chunk-2QG3QTSW.cjs.js +0 -2
  311. package/dist/chunk-2QG3QTSW.cjs.js.map +0 -1
  312. package/dist/chunk-C26U3FL4.esm.js +0 -2
  313. package/dist/chunk-C26U3FL4.esm.js.map +0 -1
  314. package/dist/chunk-DTM5LZHM.cjs.js +0 -2
  315. package/dist/chunk-DTM5LZHM.cjs.js.map +0 -1
  316. package/dist/chunk-HW32JE75.cjs.js +0 -2
  317. package/dist/chunk-HW32JE75.cjs.js.map +0 -1
  318. package/dist/chunk-JIRS6MWF.cjs.js +0 -2
  319. package/dist/chunk-JIRS6MWF.cjs.js.map +0 -1
  320. package/dist/chunk-JKTYFZ5M.esm.js +0 -2
  321. package/dist/chunk-JKTYFZ5M.esm.js.map +0 -1
  322. package/dist/chunk-JUZG25DH.esm.js +0 -2
  323. package/dist/chunk-JUZG25DH.esm.js.map +0 -1
  324. package/dist/chunk-KOYJODOP.cjs.js +0 -2
  325. package/dist/chunk-KOYJODOP.cjs.js.map +0 -1
  326. package/dist/chunk-M4S5YZ56.esm.js +0 -2
  327. package/dist/chunk-M4S5YZ56.esm.js.map +0 -1
  328. package/dist/chunk-MOYOCJW6.esm.js +0 -2
  329. package/dist/chunk-MOYOCJW6.esm.js.map +0 -1
  330. package/dist/chunk-MVWMLXLL.cjs.js +0 -2
  331. package/dist/chunk-MVWMLXLL.cjs.js.map +0 -1
  332. package/dist/chunk-SL2ZUI4G.cjs.js.map +0 -1
  333. package/dist/chunk-STRDPP3B.esm.js +0 -2
  334. package/dist/chunk-STRDPP3B.esm.js.map +0 -1
  335. package/dist/chunk-U4NMIMU7.esm.js +0 -2
  336. package/dist/chunk-U4NMIMU7.esm.js.map +0 -1
  337. package/dist/chunk-UK47BFA3.cjs.js +0 -2
  338. package/dist/chunk-UK47BFA3.cjs.js.map +0 -1
  339. package/dist/chunk-UTVXFZLD.esm.js +0 -2
  340. package/dist/chunk-UTVXFZLD.esm.js.map +0 -1
  341. package/dist/chunk-WJNYKJP6.cjs.js +0 -2
  342. package/dist/chunk-WJNYKJP6.cjs.js.map +0 -1
  343. package/dist/chunk-YEZB7AOJ.esm.js +0 -2
  344. package/dist/chunk-YEZB7AOJ.esm.js.map +0 -1
  345. package/dist/chunk-YGLYFSF6.cjs.js +0 -2
  346. package/dist/chunk-YGLYFSF6.cjs.js.map +0 -1
  347. package/dist/hooks.cjs.js +0 -2
  348. package/dist/hooks.cjs.js.map +0 -1
  349. package/dist/hooks.esm.js +0 -2
  350. package/dist/hooks.esm.js.map +0 -1
  351. package/dist/index.cjs.js +0 -2
  352. package/dist/index.cjs.js.map +0 -1
  353. package/dist/index.esm.js +0 -2
  354. package/dist/index.esm.js.map +0 -1
  355. package/dist/molecules.cjs.js +0 -2
  356. package/dist/molecules.cjs.js.map +0 -1
  357. package/dist/molecules.esm.js +0 -2
  358. package/dist/molecules.esm.js.map +0 -1
  359. package/dist/organisms.cjs.js +0 -2
  360. package/dist/organisms.cjs.js.map +0 -1
  361. package/dist/organisms.esm.js +0 -2
  362. package/dist/organisms.esm.js.map +0 -1
  363. package/dist/rhf.cjs.js +0 -2
  364. package/dist/rhf.cjs.js.map +0 -1
  365. package/dist/rhf.esm.js +0 -2
  366. package/dist/rhf.esm.js.map +0 -1
  367. package/dist/types.cjs.js +0 -2
  368. package/dist/types.d.mts +0 -2
  369. package/dist/types.d.ts +0 -2
  370. package/dist/types.esm.js +0 -2
  371. package/dist/utils.cjs.js +0 -2
  372. package/dist/utils.cjs.js.map +0 -1
  373. package/dist/utils.d.mts +0 -5
  374. package/dist/utils.d.ts +0 -5
  375. package/dist/utils.esm.js +0 -2
  376. package/dist/utils.esm.js.map +0 -1
@@ -0,0 +1 @@
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/select.tsx","../../src/components/atoms/label/label.tsx","../../src/components/rhf/form/form.tsx","../../src/components/rhf/rhf-select/rhf-select.tsx"],"names":["cn","inputs","twMerge","clsx","buttonVariants","cva","Button","z","className","variant","size","asChild","startIcon","endIcon","loading","disabled","children","type","ariaLabel","props","ref","Comp","Slot","isDisabled","buttonAriaLabel","handleKeyDown","event","jsx","jsxs","Loader2","Command","x","CommandPrimitive","CommandInput","Search","CommandList","CommandEmpty","CommandGroup","CommandSeparator","CommandItem","typographyVariants","Typography","Q","align","Component","Select","options","value","onChange","placeholder","required","error","fullWidth","searchable","id","renderCommandList","open","setOpen","U","selectedOption","option","Popover","PopoverTrigger","ChevronDown","PopoverContent","labelVariants","Label","Y","A","FormFieldContext","d","FormField","Controller","useFormField","fieldContext","itemContext","FormItemContext","getFieldState","formState","useFormContext","fieldState","FormItem","FormLabel","formItemId","FormControl","formDescriptionId","formMessageId","FormDescription","FormMessage","body","RHFSelect","name","label","description","warningText","readOnly","ariaDescribedby","other","control","field"],"mappings":"4zBAGO,SAASA,CAAAA,CAAAA,GAAMC,CAAsB,CAAA,CAC1C,OAAOC,qBAAQC,CAAAA,SAAAA,CAAKF,CAAM,CAAC,CAC7B,CCYA,IAAMG,CAAAA,CAAiBC,2BACrB,wRACA,CAAA,CACE,SAAU,CACR,OAAA,CAAS,CACP,OAAA,CAAS,gEACT,WAAa,CAAA,8EAAA,CACb,QACE,0FACF,CAAA,SAAA,CAAW,yEACX,KAAO,CAAA,8CAAA,CACP,KAAM,iDACR,CAAA,CACA,KAAM,CACJ,OAAA,CAAS,gBACT,EAAI,CAAA,6BAAA,CACJ,GAAI,sBACJ,CAAA,IAAA,CAAM,SACR,CACF,EACA,eAAiB,CAAA,CACf,QAAS,SACT,CAAA,IAAA,CAAM,SACR,CACF,CACF,CAmCMC,CAAAA,CAAAA,CAAeC,wBACnB,CACE,CACE,UAAAC,CACA,CAAA,OAAA,CAAAC,EACA,IAAAC,CAAAA,CAAAA,CACA,OAAAC,CAAAA,CAAAA,CAAU,MACV,SAAAC,CAAAA,CAAAA,CACA,QAAAC,CACA,CAAA,OAAA,CAAAC,EAAU,KACV,CAAA,QAAA,CAAAC,EACA,QAAAC,CAAAA,CAAAA,CACA,KAAAC,CAAO,CAAA,QAAA,CACP,aAAcC,CACd,CAAA,GAAGC,CACL,CACAC,CAAAA,CAAAA,GACG,CACH,IAAMC,EAAOV,CAAUW,CAAAA,cAAAA,CAAO,SACxBC,CAAa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AiB,SAAAM,CAAY,CAAA,CAAA,CAC7C1C,CAASxB,EAAAA,cAAAA,CAAC6D,EAAA,CAAa,QAAA,CAAArC,EAAM,OAAQ,CAAA,CAAA,CACrC,CAACA,CAAS2C,EAAAA,CAAAA,EACTnE,eAAC,GAAE,CAAA,CAAA,SAAA,CAAU,+CAA+C,IAAK,CAAA,OAAA,CAC9D,SAAAmE,CACH,CAAA,CAAA,CAAA,CAEJ,EAEJ,CAEJ","file":"rhf-select.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 { 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 { ChevronDown } 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} from \"../command\"\nimport { Typography } from \"../typography\"\n\nexport type SelectOption = {\n id: string\n label: string\n startIcon?: React.ReactNode\n endIcon?: React.ReactNode\n className?: string\n disabled?: boolean\n}\n\nexport type SelectProps = {\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 /** Currently selected value */\n value: string\n /** Array of options to display in the select */\n options: SelectOption[]\n /** Callback fired when the value changes */\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: SelectOption[]) => 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}\n\n/**\n * SearchableSelect component that provides a searchable dropdown select input.\n * Built on top of Radix UI's Select primitive.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs-atoms-select--docs\n *\n * @example\n * ```tsx\n * <Select\n * options={[\n * { id: \"1\", label: \"Option 1\" },\n * { id: \"2\", label: \"Option 2\" }\n * ]}\n * value=\"1\"\n * onChange={setValue}\n * required\n * />\n * ```\n */\nexport function Select({\n options,\n value,\n onChange,\n placeholder = \"Select an option\",\n disabled,\n required,\n error,\n className,\n fullWidth,\n searchable,\n id,\n renderCommandList\n}: SelectProps) {\n const [open, setOpen] = React.useState(false)\n const selectedOption = options?.find((option) => option.id === value)\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-required={required}\n aria-invalid={!!error}\n disabled={disabled}\n className={cn(\n \"w-[13rem] justify-between\",\n !value && \"text-muted-foreground\",\n fullWidth && \"w-full\",\n error && \"border-destructive focus-visible:ring-destructive\",\n className\n )}\n >\n {selectedOption ? selectedOption.label : placeholder}\n <ChevronDown className={cn(\"opacity-50\", open && \"rotate-180\")} />\n </Button>\n </PopoverTrigger>\n <PopoverContent\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 {renderCommandList ? (\n renderCommandList(options)\n ) : (\n <CommandGroup>\n {options?.map((option) => (\n <CommandItem\n value={option.label}\n key={option.id}\n onSelect={() => {\n onChange(option.id)\n setOpen(false)\n }}\n disabled={option.disabled}\n className={cn(\n \"flex items-center justify-between cursor-pointer my-1\",\n value === option.id && \"bg-accent text-accent-foreground\",\n option.disabled && \"opacity-50 cursor-not-allowed\",\n option.className\n )}\n >\n <div className=\"flex items-center gap-1\">\n {option.startIcon && option.startIcon}\n <Typography variant=\"small\">{option.label}</Typography>\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 { Select } from \"@/components/atoms/select\"\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 RHFSelectProps } from \"./rhf-select.types\"\n\n// ----------------------------------------------------------------------\n\n/**\n * A 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-rhfselect--docs\n *\n * @example\n * ```tsx\n * <Form>\n * <RHFSelect\n * name=\"country\"\n * label=\"Country\"\n * options={[\n * { id: \"us\", label: \"United States\" },\n * { id: \"ca\", label: \"Canada\" }\n * ]}\n * />\n * </Form>\n * ```\n */\nexport function RHFSelect<\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}: RHFSelectProps<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>\n {label && (\n <FormLabel>\n {label}\n {required && <span className=\"text-destructive ml-1\">*</span>}\n </FormLabel>\n )}\n <FormControl>\n <Select\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"]}
@@ -0,0 +1,2 @@
1
+ import {useFormContext,Controller}from'react-hook-form';import*as d from'react';import {Loader2,Search,ChevronDown}from'lucide-react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {Popover,PopoverTrigger,PopoverContent}from'@radix-ui/react-popover';import {Slot}from'@radix-ui/react-slot';import {cva}from'class-variance-authority';import {jsx,jsxs}from'react/jsx-runtime';import {Command}from'cmdk';import*as A from'@radix-ui/react-label';function r(...e){return twMerge(clsx(e))}var K=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"}}),$=d.forwardRef(({className:e,variant:t,size:o,asChild:m=false,startIcon:n,endIcon:s,loading:l=false,disabled:P,children:c,type:F="button","aria-label":v,...f},y)=>{let C=m?Slot:"button",p=P||l,a=v||(typeof c=="string"?c:void 0),te=w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),!p&&f.onClick&&f.onClick(w));};return m?jsx(C,{className:r(K({variant:t,size:o,className:e})),ref:y,disabled:p,type:F,"aria-label":a,"aria-disabled":p,...f,children:c}):jsxs(C,{className:r(K({variant:t,size:o,className:e})),ref:y,disabled:p,type:F,"aria-label":a,"aria-disabled":p,onKeyDown:te,...f,children:[l&&jsx(Loader2,{className:"mr-2 h-4 w-4 animate-spin",role:"status","aria-label":"Loading","aria-hidden":"true"}),!l&&n&&jsx("span",{className:"mr-2","aria-hidden":"true",children:n}),c,!l&&s&&jsx("span",{className:"ml-2","aria-hidden":"true",children:s})]})});$.displayName="Button";var L=d.forwardRef(({className:e,...t},o)=>jsx(Command,{ref:o,className:r("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));L.displayName=Command.displayName;var V=d.forwardRef(({className:e,...t},o)=>jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[jsx(Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),jsx(Command.Input,{ref:o,className:r("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})]}));V.displayName=Command.Input.displayName;var T=d.forwardRef(({className:e,...t},o)=>jsx(Command.List,{ref:o,className:r("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));T.displayName=Command.List.displayName;var k=d.forwardRef((e,t)=>jsx(Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));k.displayName=Command.Empty.displayName;var S=d.forwardRef(({className:e,...t},o)=>jsx(Command.Group,{ref:o,className:r("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}));S.displayName=Command.Group.displayName;var W=d.forwardRef(({className:e,...t},o)=>jsx(Command.Separator,{ref:o,className:r("-mx-1 h-px bg-border",e),...t}));W.displayName=Command.Separator.displayName;var E=d.forwardRef(({className:e,...t},o)=>jsx(Command.Item,{ref:o,className:r("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}));E.displayName=Command.Item.displayName;var pe=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"}}),O=d.forwardRef(({className:e,variant:t,align:o,as:m="p",...n},s)=>jsx(m,{className:r(pe({variant:t,align:o,className:e})),ref:s,...n}));O.displayName="Typography";function X({options:e,value:t,onChange:o,placeholder:m="Select an option",disabled:n,required:s,error:l,className:P,fullWidth:c,searchable:F,id:v,renderCommandList:f}){let[y,C]=d.useState(false),p=e?.find(a=>a.id===t);return jsx("div",{className:r(c&&"w-full"),children:jsxs(Popover,{open:y,onOpenChange:C,children:[jsx(PopoverTrigger,{asChild:true,children:jsxs($,{variant:"outline",role:"combobox","aria-expanded":y,"aria-controls":v?`${v}-content`:void 0,"aria-required":s,"aria-invalid":!!l,disabled:n,className:r("w-[13rem] justify-between",!t&&"text-muted-foreground",c&&"w-full",l&&"border-destructive focus-visible:ring-destructive",P),children:[p?p.label:m,jsx(ChevronDown,{className:r("opacity-50",y&&"rotate-180")})]})}),jsx(PopoverContent,{className:r("w-[13rem] p-0 rounded-md border bg-popover text-popover-foreground shadow-md",c&&"w-full"),align:"start",children:jsxs(L,{children:[F&&jsx(V,{placeholder:"Search...",className:"h-9",disabled:n}),jsxs(T,{className:"max-h-[12rem] overflow-y-auto",children:[jsx(k,{children:"No items found."}),f?f(e):jsx(S,{children:e?.map(a=>jsxs(E,{value:a.label,onSelect:()=>{o(a.id),C(false);},disabled:a.disabled,className:r("flex items-center justify-between cursor-pointer my-1",t===a.id&&"bg-accent text-accent-foreground",a.disabled&&"opacity-50 cursor-not-allowed",a.className),children:[jsxs("div",{className:"flex items-center gap-1",children:[a.startIcon&&a.startIcon,jsx(O,{variant:"small",children:a.label})]}),a.endIcon&&jsx("div",{className:"ml-2",children:a.endIcon})]},a.id))})]})]})})]})})}var be=cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),M=d.forwardRef(({className:e,...t},o)=>jsx(A.Root,{ref:o,className:r(be(),e),...t}));M.displayName=A.Root.displayName;var Z=d.createContext({}),q=({...e})=>jsx(Z.Provider,{value:{name:e.name},children:jsx(Controller,{...e})}),N=()=>{let e=d.useContext(Z),t=d.useContext(j),{getFieldState:o,formState:m}=useFormContext(),n=o(e.name,m);if(!e)throw new Error("useFormField should be used within <FormField>");let{id:s}=t;return {id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...n}},j=d.createContext({}),_=d.forwardRef(({className:e,...t},o)=>{let m=d.useId();return jsx(j.Provider,{value:{id:m},children:jsx("div",{ref:o,className:r("space-y-2",e),...t})})});_.displayName="FormItem";var D=d.forwardRef(({className:e,...t},o)=>{let{error:m,formItemId:n}=N();return jsx(M,{ref:o,className:r(m&&"text-destructive",e),htmlFor:n,...t})});D.displayName="FormLabel";var H=d.forwardRef(({...e},t)=>{let{error:o,formItemId:m,formDescriptionId:n,formMessageId:s}=N();return jsx(Slot,{ref:t,id:m,"aria-describedby":o?`${n} ${s}`:`${n}`,"aria-invalid":!!o,...e})});H.displayName="FormControl";var G=d.forwardRef(({className:e,...t},o)=>{let{formDescriptionId:m}=N();return jsx("p",{ref:o,id:m,className:r("text-sm text-muted-foreground",e),...t})});G.displayName="FormDescription";var B=d.forwardRef(({className:e,children:t,...o},m)=>{let{error:n,formMessageId:s}=N(),l=n?String(n?.message??""):t;return l?jsx("p",{ref:m,id:s,className:r("text-sm font-medium text-destructive",e),...o,children:l}):null});B.displayName="FormMessage";function vt({name:e,label:t,description:o,className:m,warningText:n,required:s,disabled:l,readOnly:P,placeholder:c,"aria-label":F,"aria-describedby":v,options:f,...y}){let{control:C}=useFormContext();return jsx(q,{name:e,control:C,render:({field:p,fieldState:{error:a}})=>jsxs(_,{children:[t&&jsxs(D,{children:[t,s&&jsx("span",{className:"text-destructive ml-1",children:"*"})]}),jsx(H,{children:jsx(X,{...p,options:f,value:p.value||"",onChange:p.onChange,className:r(a&&"border-destructive focus-visible:ring-destructive",m),disabled:l||P,required:s,placeholder:c,"aria-label":F,"aria-describedby":v,"aria-invalid":!!a,"aria-required":s,...y})}),o&&jsx(G,{children:o}),a&&jsx(B,{children:a.message}),!a&&n&&jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-500",role:"alert",children:n})]})})}export{vt as RHFSelect};//# sourceMappingURL=rhf-select.mjs.map
2
+ //# sourceMappingURL=rhf-select.mjs.map
@@ -0,0 +1 @@
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/select.tsx","../../src/components/atoms/label/label.tsx","../../src/components/rhf/form/form.tsx","../../src/components/rhf/rhf-select/rhf-select.tsx"],"names":["cn","inputs","twMerge","clsx","buttonVariants","cva","Button","z","className","variant","size","asChild","startIcon","endIcon","loading","disabled","children","type","ariaLabel","props","ref","Comp","Slot","isDisabled","buttonAriaLabel","handleKeyDown","event","jsx","jsxs","Loader2","Command","x","CommandPrimitive","CommandInput","Search","CommandList","CommandEmpty","CommandGroup","CommandSeparator","CommandItem","typographyVariants","Typography","Q","align","Component","Select","options","value","onChange","placeholder","required","error","fullWidth","searchable","id","renderCommandList","open","setOpen","U","selectedOption","option","Popover","PopoverTrigger","ChevronDown","PopoverContent","labelVariants","Label","Y","FormFieldContext","FormField","Controller","useFormField","fieldContext","itemContext","FormItemContext","getFieldState","formState","useFormContext","fieldState","FormItem","FormLabel","formItemId","FormControl","formDescriptionId","formMessageId","FormDescription","FormMessage","body","RHFSelect","name","label","description","warningText","readOnly","ariaDescribedby","other","control","field"],"mappings":"8cAGO,SAASA,CAAAA,CAAAA,GAAMC,CAAsB,CAAA,CAC1C,OAAOC,OAAQC,CAAAA,IAAAA,CAAKF,CAAM,CAAC,CAC7B,CCYA,IAAMG,CAAAA,CAAiBC,IACrB,wRACA,CAAA,CACE,SAAU,CACR,OAAA,CAAS,CACP,OAAA,CAAS,gEACT,WAAa,CAAA,8EAAA,CACb,QACE,0FACF,CAAA,SAAA,CAAW,yEACX,KAAO,CAAA,8CAAA,CACP,KAAM,iDACR,CAAA,CACA,KAAM,CACJ,OAAA,CAAS,gBACT,EAAI,CAAA,6BAAA,CACJ,GAAI,sBACJ,CAAA,IAAA,CAAM,SACR,CACF,EACA,eAAiB,CAAA,CACf,QAAS,SACT,CAAA,IAAA,CAAM,SACR,CACF,CACF,CAmCMC,CAAAA,CAAAA,CAAeC,aACnB,CACE,CACE,UAAAC,CACA,CAAA,OAAA,CAAAC,EACA,IAAAC,CAAAA,CAAAA,CACA,OAAAC,CAAAA,CAAAA,CAAU,MACV,SAAAC,CAAAA,CAAAA,CACA,QAAAC,CACA,CAAA,OAAA,CAAAC,EAAU,KACV,CAAA,QAAA,CAAAC,EACA,QAAAC,CAAAA,CAAAA,CACA,KAAAC,CAAO,CAAA,QAAA,CACP,aAAcC,CACd,CAAA,GAAGC,CACL,CACAC,CAAAA,CAAAA,GACG,CACH,IAAMC,EAAOV,CAAUW,CAAAA,IAAAA,CAAO,SACxBC,CAAaR,CAAAA,CAAAA,EAAYD,EACzBU,CAAkBN,CAAAA,CAAAA,GAAc,OAAOF,CAAa,EAAA,QAAA,CAAWA,EAAW,MAG1ES,CAAAA,CAAAA,EAAAA,CAAiBC,GAA+B,CAChDA,CAAAA,CAAAA,CAAM,MAAQ,OAAWA,EAAAA,CAAAA,CAAM,GAAQ,GAAA,G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,EAEJ,CAEJ","file":"rhf-select.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 { 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 { ChevronDown } 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} from \"../command\"\nimport { Typography } from \"../typography\"\n\nexport type SelectOption = {\n id: string\n label: string\n startIcon?: React.ReactNode\n endIcon?: React.ReactNode\n className?: string\n disabled?: boolean\n}\n\nexport type SelectProps = {\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 /** Currently selected value */\n value: string\n /** Array of options to display in the select */\n options: SelectOption[]\n /** Callback fired when the value changes */\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: SelectOption[]) => 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}\n\n/**\n * SearchableSelect component that provides a searchable dropdown select input.\n * Built on top of Radix UI's Select primitive.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs-atoms-select--docs\n *\n * @example\n * ```tsx\n * <Select\n * options={[\n * { id: \"1\", label: \"Option 1\" },\n * { id: \"2\", label: \"Option 2\" }\n * ]}\n * value=\"1\"\n * onChange={setValue}\n * required\n * />\n * ```\n */\nexport function Select({\n options,\n value,\n onChange,\n placeholder = \"Select an option\",\n disabled,\n required,\n error,\n className,\n fullWidth,\n searchable,\n id,\n renderCommandList\n}: SelectProps) {\n const [open, setOpen] = React.useState(false)\n const selectedOption = options?.find((option) => option.id === value)\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-required={required}\n aria-invalid={!!error}\n disabled={disabled}\n className={cn(\n \"w-[13rem] justify-between\",\n !value && \"text-muted-foreground\",\n fullWidth && \"w-full\",\n error && \"border-destructive focus-visible:ring-destructive\",\n className\n )}\n >\n {selectedOption ? selectedOption.label : placeholder}\n <ChevronDown className={cn(\"opacity-50\", open && \"rotate-180\")} />\n </Button>\n </PopoverTrigger>\n <PopoverContent\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 {renderCommandList ? (\n renderCommandList(options)\n ) : (\n <CommandGroup>\n {options?.map((option) => (\n <CommandItem\n value={option.label}\n key={option.id}\n onSelect={() => {\n onChange(option.id)\n setOpen(false)\n }}\n disabled={option.disabled}\n className={cn(\n \"flex items-center justify-between cursor-pointer my-1\",\n value === option.id && \"bg-accent text-accent-foreground\",\n option.disabled && \"opacity-50 cursor-not-allowed\",\n option.className\n )}\n >\n <div className=\"flex items-center gap-1\">\n {option.startIcon && option.startIcon}\n <Typography variant=\"small\">{option.label}</Typography>\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 { Select } from \"@/components/atoms/select\"\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 RHFSelectProps } from \"./rhf-select.types\"\n\n// ----------------------------------------------------------------------\n\n/**\n * A 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-rhfselect--docs\n *\n * @example\n * ```tsx\n * <Form>\n * <RHFSelect\n * name=\"country\"\n * label=\"Country\"\n * options={[\n * { id: \"us\", label: \"United States\" },\n * { id: \"ca\", label: \"Canada\" }\n * ]}\n * />\n * </Form>\n * ```\n */\nexport function RHFSelect<\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}: RHFSelectProps<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>\n {label && (\n <FormLabel>\n {label}\n {required && <span className=\"text-destructive ml-1\">*</span>}\n </FormLabel>\n )}\n <FormControl>\n <Select\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"]}
@@ -0,0 +1,57 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { FieldValues, FieldPath } from 'react-hook-form';
3
+ import * as React from 'react';
4
+ import * as SwitchPrimitives from '@radix-ui/react-switch';
5
+
6
+ /**
7
+ * Switch component that provides a toggle input control.
8
+ * Built on top of Radix UI's Switch primitive.
9
+ *
10
+ * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-switch--docs
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * <Switch />
15
+ * <Switch defaultChecked />
16
+ * <Switch disabled />
17
+ * ```
18
+ */
19
+ declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
20
+
21
+ interface RHFSwitchProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React.ComponentProps<typeof Switch>, "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 switch 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-rhfswitch--docs
47
+ *
48
+ * @example
49
+ * ```tsx
50
+ * <Form>
51
+ * <RHFSwitch name="notifications" label="Enable notifications" />
52
+ * </Form>
53
+ * ```
54
+ */
55
+ declare function RHFSwitch<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 }: RHFSwitchProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
56
+
57
+ export { RHFSwitch };
@@ -0,0 +1,57 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { FieldValues, FieldPath } from 'react-hook-form';
3
+ import * as React from 'react';
4
+ import * as SwitchPrimitives from '@radix-ui/react-switch';
5
+
6
+ /**
7
+ * Switch component that provides a toggle input control.
8
+ * Built on top of Radix UI's Switch primitive.
9
+ *
10
+ * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-switch--docs
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * <Switch />
15
+ * <Switch defaultChecked />
16
+ * <Switch disabled />
17
+ * ```
18
+ */
19
+ declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
20
+
21
+ interface RHFSwitchProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React.ComponentProps<typeof Switch>, "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 switch 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-rhfswitch--docs
47
+ *
48
+ * @example
49
+ * ```tsx
50
+ * <Form>
51
+ * <RHFSwitch name="notifications" label="Enable notifications" />
52
+ * </Form>
53
+ * ```
54
+ */
55
+ declare function RHFSwitch<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 }: RHFSwitchProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
56
+
57
+ export { RHFSwitch };
@@ -0,0 +1,2 @@
1
+ 'use strict';var reactHookForm=require('react-hook-form'),r=require('react'),d=require('@radix-ui/react-switch'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime'),reactSlot=require('@radix-ui/react-slot'),y=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 y__namespace=/*#__PURE__*/_interopNamespace(y);function m(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var F=r__namespace.forwardRef(({className:e,...o},t)=>jsxRuntime.jsx(d__namespace.Root,{className:m("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...o,ref:t,children:jsxRuntime.jsx(d__namespace.Thumb,{className:m("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));F.displayName=d__namespace.Root.displayName;var $=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(y__namespace.Root,{ref:t,className:m($(),e),...o}));u.displayName=y__namespace.Root.displayName;var N=r__namespace.createContext({}),v=({...e})=>jsxRuntime.jsx(N.Provider,{value:{name:e.name},children:jsxRuntime.jsx(reactHookForm.Controller,{...e})}),c=()=>{let e=r__namespace.useContext(N),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:s}=o;return {id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...i}},T=r__namespace.createContext({}),b=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:m("space-y-2",e),...o})})});b.displayName="FormItem";var P=r__namespace.forwardRef(({className:e,...o},t)=>{let{error:a,formItemId:i}=c();return jsxRuntime.jsx(u,{ref:t,className:m(a&&"text-destructive",e),htmlFor:i,...o})});P.displayName="FormLabel";var R=r__namespace.forwardRef(({...e},o)=>{let{error:t,formItemId:a,formDescriptionId:i,formMessageId:s}=c();return jsxRuntime.jsx(reactSlot.Slot,{ref:o,id:a,"aria-describedby":t?`${i} ${s}`:`${i}`,"aria-invalid":!!t,...e})});R.displayName="FormControl";var x=r__namespace.forwardRef(({className:e,...o},t)=>{let{formDescriptionId:a}=c();return jsxRuntime.jsx("p",{ref:t,id:a,className:m("text-sm text-muted-foreground",e),...o})});x.displayName="FormDescription";var h=r__namespace.forwardRef(({className:e,children:o,...t},a)=>{let{error:i,formMessageId:s}=c(),p=i?String(i?.message??""):o;return p?jsxRuntime.jsx("p",{ref:a,id:s,className:m("text-sm font-medium text-destructive",e),...t,children:p}):null});h.displayName="FormMessage";function xe({name:e,label:o,description:t,className:a,warningText:i,required:s,disabled:p,readOnly:B,"aria-label":I,"aria-describedby":S,...M}){let{control:H}=reactHookForm.useFormContext();return jsxRuntime.jsx(v,{name:e,control:H,render:({field:g,fieldState:{error:f}})=>jsxRuntime.jsxs(b,{className:"flex flex-row items-start space-x-3 space-y-0",children:[jsxRuntime.jsx(R,{children:jsxRuntime.jsx(F,{checked:g.value,onCheckedChange:g.onChange,disabled:p,"aria-label":I,"aria-describedby":S,"aria-invalid":!!f,"aria-required":s,...M})}),jsxRuntime.jsxs("div",{className:"space-y-1 leading-none",children:[o&&jsxRuntime.jsxs(P,{children:[o,s&&jsxRuntime.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),t&&jsxRuntime.jsx(x,{children:t}),f&&jsxRuntime.jsx(h,{children:f.message}),!f&&i&&jsxRuntime.jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-500",role:"alert",children:i})]})]})})}exports.RHFSwitch=xe;//# sourceMappingURL=rhf-switch.js.map
2
+ //# sourceMappingURL=rhf-switch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/cn.ts","../../src/components/atoms/switch/switch.tsx","../../src/components/atoms/label/label.tsx","../../src/components/rhf/form/form.tsx","../../src/components/rhf/rhf-switch/rhf-switch.tsx"],"names":["cn","inputs","twMerge","clsx","Switch","V","className","props","ref","jsx","d","labelVariants","cva","Label","L","y","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","RHFSwitch","name","label","description","warningText","required","disabled","readOnly","ariaLabel","ariaDescribedby","other","control","field","jsxs"],"mappings":"0yBAGO,SAASA,CAAAA,CAAAA,GAAMC,CAAsB,CAAA,CAC1C,OAAOC,qBAAAA,CAAQC,UAAKF,CAAM,CAAC,CAC7B,CCcA,IAAMG,CAAAA,CAAeC,wBACnB,CAAC,CAAE,SAAAC,CAAAA,CAAAA,CAAW,GAAGC,CAAM,CAAGC,CAAAA,CAAAA,GACxBC,eAAkBC,YAAjB,CAAA,IAAA,CAAA,CACC,SAAWV,CAAAA,CAAAA,CACT,8XACAM,CACF,CAAA,CACC,GAAGC,CAAAA,CACJ,IAAKC,CAEL,CAAA,QAAA,CAAAC,cAAkB,CAAAC,YAAA,CAAA,KAAA,CAAjB,CACC,SAAA,CAAWV,CACT,CAAA,4KACF,EACF,CAC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Aee,CAAAA,CAAAA,CACd,GAAGK,CAAAA,CACN,EACF,CACAG,CAAAA,eAAAA,CAAC,KAAI,CAAA,CAAA,SAAA,CAAU,yBACZ,QAAAX,CAAAA,CAAAA,CAAAA,EACCW,eAACxB,CAAAA,CAAAA,CAAA,CACE,QAAAa,CAAAA,CAAAA,CAAAA,CACAG,CAAYrC,EAAAA,cAAAA,CAAC,MAAK,CAAA,CAAA,SAAA,CAAU,uBAAwB,CAAA,QAAA,CAAA,GAAA,CAAC,GACxD,CAEDmC,CAAAA,CAAAA,EAAenC,cAAC4B,CAAAA,CAAAA,CAAA,CAAiB,QAAAO,CAAAA,CAAAA,CAAY,CAC7Cb,CAAAA,CAAAA,EAAStB,eAAC6B,CAAA,CAAA,CAAa,QAAAP,CAAAA,CAAAA,CAAM,QAAQ,CACrC,CAAA,CAACA,CAASc,EAAAA,CAAAA,EACTpC,eAAC,GAAE,CAAA,CAAA,SAAA,CAAU,8CAA+C,CAAA,IAAA,CAAK,QAC9D,QAAAoC,CAAAA,CAAAA,CACH,CAEJ,CAAA,CAAA,CAAA,CAAA,CACF,EAEJ,CAEJ","file":"rhf-switch.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 SwitchPrimitives from \"@radix-ui/react-switch\"\n\nimport { cn } from \"@/utils/index\"\nimport { SwitchProps } from \"./switch.types\"\n\n/**\n * Switch component that provides a toggle input control.\n * Built on top of Radix UI's Switch primitive.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-switch--docs\n *\n * @example\n * ```tsx\n * <Switch />\n * <Switch defaultChecked />\n * <Switch disabled />\n * ```\n */\nconst Switch = React.forwardRef<React.ElementRef<typeof SwitchPrimitives.Root>, SwitchProps>(\n ({ className, ...props }, ref) => (\n <SwitchPrimitives.Root\n className={cn(\n \"peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input\",\n className\n )}\n {...props}\n ref={ref}\n >\n <SwitchPrimitives.Thumb\n className={cn(\n \"pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0\"\n )}\n />\n </SwitchPrimitives.Root>\n )\n)\nSwitch.displayName = SwitchPrimitives.Root.displayName\n\nexport { Switch }\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 { Switch } from \"@/components/atoms/switch\"\nimport {\n FormControl,\n FormItem,\n FormMessage,\n FormLabel,\n FormDescription,\n FormField\n} from \"@/components/rhf/form\"\nimport { type RHFSwitchProps } from \"./rhf-switch.types\"\n\n// ----------------------------------------------------------------------\n\n/**\n * A switch 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-rhfswitch--docs\n *\n * @example\n * ```tsx\n * <Form>\n * <RHFSwitch name=\"notifications\" label=\"Enable notifications\" />\n * </Form>\n * ```\n */\nexport function RHFSwitch<\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}: RHFSwitchProps<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 <Switch\n checked={field.value}\n onCheckedChange={field.onChange}\n disabled={disabled}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-invalid={!!error}\n aria-required={required}\n {...other}\n />\n </FormControl>\n <div className=\"space-y-1 leading-none\">\n {label && (\n <FormLabel>\n {label}\n {required && <span className=\"text-destructive ml-1\">*</span>}\n </FormLabel>\n )}\n {description && <FormDescription>{description}</FormDescription>}\n {error && <FormMessage>{error.message}</FormMessage>}\n {!error && warningText && (\n <p className=\"text-sm text-yellow-600 dark:text-yellow-500\" role=\"alert\">\n {warningText}\n </p>\n )}\n </div>\n </FormItem>\n )}\n />\n )\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import {useFormContext,Controller}from'react-hook-form';import*as r from'react';import*as d from'@radix-ui/react-switch';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsx,jsxs}from'react/jsx-runtime';import {Slot}from'@radix-ui/react-slot';import*as y from'@radix-ui/react-label';import {cva}from'class-variance-authority';function m(...e){return twMerge(clsx(e))}var F=r.forwardRef(({className:e,...o},t)=>jsx(d.Root,{className:m("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...o,ref:t,children:jsx(d.Thumb,{className:m("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));F.displayName=d.Root.displayName;var $=cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),u=r.forwardRef(({className:e,...o},t)=>jsx(y.Root,{ref:t,className:m($(),e),...o}));u.displayName=y.Root.displayName;var N=r.createContext({}),v=({...e})=>jsx(N.Provider,{value:{name:e.name},children:jsx(Controller,{...e})}),c=()=>{let e=r.useContext(N),o=r.useContext(T),{getFieldState:t,formState:a}=useFormContext(),i=t(e.name,a);if(!e)throw new Error("useFormField should be used within <FormField>");let{id:s}=o;return {id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...i}},T=r.createContext({}),b=r.forwardRef(({className:e,...o},t)=>{let a=r.useId();return jsx(T.Provider,{value:{id:a},children:jsx("div",{ref:t,className:m("space-y-2",e),...o})})});b.displayName="FormItem";var P=r.forwardRef(({className:e,...o},t)=>{let{error:a,formItemId:i}=c();return jsx(u,{ref:t,className:m(a&&"text-destructive",e),htmlFor:i,...o})});P.displayName="FormLabel";var R=r.forwardRef(({...e},o)=>{let{error:t,formItemId:a,formDescriptionId:i,formMessageId:s}=c();return jsx(Slot,{ref:o,id:a,"aria-describedby":t?`${i} ${s}`:`${i}`,"aria-invalid":!!t,...e})});R.displayName="FormControl";var x=r.forwardRef(({className:e,...o},t)=>{let{formDescriptionId:a}=c();return jsx("p",{ref:t,id:a,className:m("text-sm text-muted-foreground",e),...o})});x.displayName="FormDescription";var h=r.forwardRef(({className:e,children:o,...t},a)=>{let{error:i,formMessageId:s}=c(),p=i?String(i?.message??""):o;return p?jsx("p",{ref:a,id:s,className:m("text-sm font-medium text-destructive",e),...t,children:p}):null});h.displayName="FormMessage";function xe({name:e,label:o,description:t,className:a,warningText:i,required:s,disabled:p,readOnly:B,"aria-label":I,"aria-describedby":S,...M}){let{control:H}=useFormContext();return jsx(v,{name:e,control:H,render:({field:g,fieldState:{error:f}})=>jsxs(b,{className:"flex flex-row items-start space-x-3 space-y-0",children:[jsx(R,{children:jsx(F,{checked:g.value,onCheckedChange:g.onChange,disabled:p,"aria-label":I,"aria-describedby":S,"aria-invalid":!!f,"aria-required":s,...M})}),jsxs("div",{className:"space-y-1 leading-none",children:[o&&jsxs(P,{children:[o,s&&jsx("span",{className:"text-destructive ml-1",children:"*"})]}),t&&jsx(x,{children:t}),f&&jsx(h,{children:f.message}),!f&&i&&jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-500",role:"alert",children:i})]})]})})}export{xe as RHFSwitch};//# sourceMappingURL=rhf-switch.mjs.map
2
+ //# sourceMappingURL=rhf-switch.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/cn.ts","../../src/components/atoms/switch/switch.tsx","../../src/components/atoms/label/label.tsx","../../src/components/rhf/form/form.tsx","../../src/components/rhf/rhf-switch/rhf-switch.tsx"],"names":["cn","inputs","twMerge","clsx","Switch","V","className","props","ref","jsx","labelVariants","cva","Label","L","FormFieldContext","FormField","Controller","useFormField","fieldContext","itemContext","FormItemContext","getFieldState","formState","useFormContext","fieldState","id","FormItem","FormLabel","error","formItemId","FormControl","formDescriptionId","formMessageId","Slot","FormDescription","FormMessage","children","body","RHFSwitch","name","label","description","warningText","required","disabled","readOnly","ariaLabel","ariaDescribedby","other","control","field","jsxs"],"mappings":"0VAGO,SAASA,CAAAA,CAAAA,GAAMC,CAAsB,CAAA,CAC1C,OAAOC,OAAAA,CAAQC,KAAKF,CAAM,CAAC,CAC7B,CCcA,IAAMG,CAAAA,CAAeC,aACnB,CAAC,CAAE,SAAAC,CAAAA,CAAAA,CAAW,GAAGC,CAAM,CAAGC,CAAAA,CAAAA,GACxBC,IAAkB,CAAjB,CAAA,IAAA,CAAA,CACC,SAAWT,CAAAA,CAAAA,CACT,8XACAM,CACF,CAAA,CACC,GAA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AAUN,CACV,CAAA,YAAA,CAAYE,CACZ,CAAA,kBAAA,CAAkBC,EAClB,cAAc,CAAA,CAAC,CAACnB,CAAAA,CAChB,eAAee,CAAAA,CAAAA,CACd,GAAGK,CAAAA,CACN,EACF,CACAG,CAAAA,IAAAA,CAAC,KAAI,CAAA,CAAA,SAAA,CAAU,yBACZ,QAAAX,CAAAA,CAAAA,CAAAA,EACCW,IAACxB,CAAAA,CAAAA,CAAA,CACE,QAAAa,CAAAA,CAAAA,CAAAA,CACAG,CAAYlC,EAAAA,GAAAA,CAAC,MAAK,CAAA,CAAA,SAAA,CAAU,uBAAwB,CAAA,QAAA,CAAA,GAAA,CAAC,GACxD,CAEDgC,CAAAA,CAAAA,EAAehC,GAACyB,CAAAA,CAAAA,CAAA,CAAiB,QAAAO,CAAAA,CAAAA,CAAY,CAC7Cb,CAAAA,CAAAA,EAASnB,IAAC0B,CAAA,CAAA,CAAa,QAAAP,CAAAA,CAAAA,CAAM,QAAQ,CACrC,CAAA,CAACA,CAASc,EAAAA,CAAAA,EACTjC,IAAC,GAAE,CAAA,CAAA,SAAA,CAAU,8CAA+C,CAAA,IAAA,CAAK,QAC9D,QAAAiC,CAAAA,CAAAA,CACH,CAEJ,CAAA,CAAA,CAAA,CAAA,CACF,EAEJ,CAEJ","file":"rhf-switch.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 SwitchPrimitives from \"@radix-ui/react-switch\"\n\nimport { cn } from \"@/utils/index\"\nimport { SwitchProps } from \"./switch.types\"\n\n/**\n * Switch component that provides a toggle input control.\n * Built on top of Radix UI's Switch primitive.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-switch--docs\n *\n * @example\n * ```tsx\n * <Switch />\n * <Switch defaultChecked />\n * <Switch disabled />\n * ```\n */\nconst Switch = React.forwardRef<React.ElementRef<typeof SwitchPrimitives.Root>, SwitchProps>(\n ({ className, ...props }, ref) => (\n <SwitchPrimitives.Root\n className={cn(\n \"peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input\",\n className\n )}\n {...props}\n ref={ref}\n >\n <SwitchPrimitives.Thumb\n className={cn(\n \"pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0\"\n )}\n />\n </SwitchPrimitives.Root>\n )\n)\nSwitch.displayName = SwitchPrimitives.Root.displayName\n\nexport { Switch }\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 { Switch } from \"@/components/atoms/switch\"\nimport {\n FormControl,\n FormItem,\n FormMessage,\n FormLabel,\n FormDescription,\n FormField\n} from \"@/components/rhf/form\"\nimport { type RHFSwitchProps } from \"./rhf-switch.types\"\n\n// ----------------------------------------------------------------------\n\n/**\n * A switch 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-rhfswitch--docs\n *\n * @example\n * ```tsx\n * <Form>\n * <RHFSwitch name=\"notifications\" label=\"Enable notifications\" />\n * </Form>\n * ```\n */\nexport function RHFSwitch<\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}: RHFSwitchProps<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 <Switch\n checked={field.value}\n onCheckedChange={field.onChange}\n disabled={disabled}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-invalid={!!error}\n aria-required={required}\n {...other}\n />\n </FormControl>\n <div className=\"space-y-1 leading-none\">\n {label && (\n <FormLabel>\n {label}\n {required && <span className=\"text-destructive ml-1\">*</span>}\n </FormLabel>\n )}\n {description && <FormDescription>{description}</FormDescription>}\n {error && <FormMessage>{error.message}</FormMessage>}\n {!error && warningText && (\n <p className=\"text-sm text-yellow-600 dark:text-yellow-500\" role=\"alert\">\n {warningText}\n </p>\n )}\n </div>\n </FormItem>\n )}\n />\n )\n}\n"]}
@@ -0,0 +1,66 @@
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 { TextareaHTMLAttributes } from 'react';
5
+
6
+ interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
7
+ /**
8
+ * Whether the textarea should automatically resize
9
+ */
10
+ autoResize?: boolean;
11
+ }
12
+
13
+ /**
14
+ * Textarea component for creating accessible text areas.
15
+ * Built on top of shadcn/ui's Textarea component.
16
+ *
17
+ * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-textarea--docs
18
+ *
19
+ * @example
20
+ * ```tsx
21
+ * <Textarea placeholder="Enter text" />
22
+ * ```
23
+ */
24
+ declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
25
+
26
+ interface RHFTextareaProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React.ComponentProps<typeof Textarea>, "name"> {
27
+ /** The name of the field in the form */
28
+ name: TName;
29
+ /** Optional label for the field */
30
+ label?: string;
31
+ /** Optional description text below the field */
32
+ description?: string;
33
+ /** Optional warning text to display */
34
+ warningText?: string;
35
+ /** Whether the field is required */
36
+ required?: boolean;
37
+ /** Whether the field is disabled */
38
+ disabled?: boolean;
39
+ /** Whether the field is read-only */
40
+ readOnly?: boolean;
41
+ /** Optional placeholder text */
42
+ placeholder?: string;
43
+ /** Optional aria-label for accessibility */
44
+ "aria-label"?: string;
45
+ /** Optional aria-describedby for accessibility */
46
+ "aria-describedby"?: string;
47
+ /** Whether the textarea should automatically resize */
48
+ autoResize?: boolean;
49
+ }
50
+
51
+ /**
52
+ * A textarea component that integrates with React Hook Form.
53
+ * Provides form validation, error handling, and accessibility features.
54
+ *
55
+ * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhftextarea--docs
56
+ *
57
+ * @example
58
+ * ```tsx
59
+ * <Form>
60
+ * <RHFTextarea name="description" label="Description" />
61
+ * </Form>
62
+ * ```
63
+ */
64
+ declare function RHFTextarea<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, warningText, required, disabled, readOnly, placeholder, autoResize, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, onBlur, ...other }: RHFTextareaProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
65
+
66
+ export { RHFTextarea };
@@ -0,0 +1,66 @@
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 { TextareaHTMLAttributes } from 'react';
5
+
6
+ interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
7
+ /**
8
+ * Whether the textarea should automatically resize
9
+ */
10
+ autoResize?: boolean;
11
+ }
12
+
13
+ /**
14
+ * Textarea component for creating accessible text areas.
15
+ * Built on top of shadcn/ui's Textarea component.
16
+ *
17
+ * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-textarea--docs
18
+ *
19
+ * @example
20
+ * ```tsx
21
+ * <Textarea placeholder="Enter text" />
22
+ * ```
23
+ */
24
+ declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
25
+
26
+ interface RHFTextareaProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React.ComponentProps<typeof Textarea>, "name"> {
27
+ /** The name of the field in the form */
28
+ name: TName;
29
+ /** Optional label for the field */
30
+ label?: string;
31
+ /** Optional description text below the field */
32
+ description?: string;
33
+ /** Optional warning text to display */
34
+ warningText?: string;
35
+ /** Whether the field is required */
36
+ required?: boolean;
37
+ /** Whether the field is disabled */
38
+ disabled?: boolean;
39
+ /** Whether the field is read-only */
40
+ readOnly?: boolean;
41
+ /** Optional placeholder text */
42
+ placeholder?: string;
43
+ /** Optional aria-label for accessibility */
44
+ "aria-label"?: string;
45
+ /** Optional aria-describedby for accessibility */
46
+ "aria-describedby"?: string;
47
+ /** Whether the textarea should automatically resize */
48
+ autoResize?: boolean;
49
+ }
50
+
51
+ /**
52
+ * A textarea component that integrates with React Hook Form.
53
+ * Provides form validation, error handling, and accessibility features.
54
+ *
55
+ * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhftextarea--docs
56
+ *
57
+ * @example
58
+ * ```tsx
59
+ * <Form>
60
+ * <RHFTextarea name="description" label="Description" />
61
+ * </Form>
62
+ * ```
63
+ */
64
+ declare function RHFTextarea<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, warningText, required, disabled, readOnly, placeholder, autoResize, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, onBlur, ...other }: RHFTextareaProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
65
+
66
+ export { RHFTextarea };
@@ -0,0 +1,2 @@
1
+ 'use strict';var reactHookForm=require('react-hook-form'),s=require('react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime'),reactSlot=require('@radix-ui/react-slot'),C=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 s__namespace=/*#__PURE__*/_interopNamespace(s);var C__namespace=/*#__PURE__*/_interopNamespace(C);function i(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var v=s__namespace.forwardRef(({className:e,autoResize:t=false,...r},a)=>{let m=s__namespace.useRef(null);return s__namespace.useEffect(()=>{if(!t||!m.current)return;let o=m.current,l=()=>{o.style.height="auto",o.style.height=`${o.scrollHeight}px`;};return o.addEventListener("input",l),l(),()=>o.removeEventListener("input",l)},[t]),jsxRuntime.jsx("textarea",{className:i("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:a,...r})});v.displayName="Textarea";var z=classVarianceAuthority.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),f=s__namespace.forwardRef(({className:e,...t},r)=>jsxRuntime.jsx(C__namespace.Root,{ref:r,className:i(z(),e),...t}));f.displayName=C__namespace.Root.displayName;var L=s__namespace.createContext({}),g=({...e})=>jsxRuntime.jsx(L.Provider,{value:{name:e.name},children:jsxRuntime.jsx(reactHookForm.Controller,{...e})}),u=()=>{let e=s__namespace.useContext(L),t=s__namespace.useContext(h),{getFieldState:r,formState:a}=reactHookForm.useFormContext(),m=r(e.name,a);if(!e)throw new Error("useFormField should be used within <FormField>");let{id:o}=t;return {id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...m}},h=s__namespace.createContext({}),x=s__namespace.forwardRef(({className:e,...t},r)=>{let a=s__namespace.useId();return jsxRuntime.jsx(h.Provider,{value:{id:a},children:jsxRuntime.jsx("div",{ref:r,className:i("space-y-2",e),...t})})});x.displayName="FormItem";var R=s__namespace.forwardRef(({className:e,...t},r)=>{let{error:a,formItemId:m}=u();return jsxRuntime.jsx(f,{ref:r,className:i(a&&"text-destructive",e),htmlFor:m,...t})});R.displayName="FormLabel";var b=s__namespace.forwardRef(({...e},t)=>{let{error:r,formItemId:a,formDescriptionId:m,formMessageId:o}=u();return jsxRuntime.jsx(reactSlot.Slot,{ref:t,id:a,"aria-describedby":r?`${m} ${o}`:`${m}`,"aria-invalid":!!r,...e})});b.displayName="FormControl";var P=s__namespace.forwardRef(({className:e,...t},r)=>{let{formDescriptionId:a}=u();return jsxRuntime.jsx("p",{ref:r,id:a,className:i("text-sm text-muted-foreground",e),...t})});P.displayName="FormDescription";var y=s__namespace.forwardRef(({className:e,children:t,...r},a)=>{let{error:m,formMessageId:o}=u(),l=m?String(m?.message??""):t;return l?jsxRuntime.jsx("p",{ref:a,id:o,className:i("text-sm font-medium text-destructive",e),...r,children:l}):null});y.displayName="FormMessage";function Te({name:e,label:t,description:r,className:a,warningText:m,required:o,disabled:l,readOnly:N,placeholder:M,autoResize:w,"aria-label":E,"aria-describedby":H,onBlur:D,...S}){let{control:$}=reactHookForm.useFormContext();return jsxRuntime.jsx(g,{name:e,control:$,render:({field:d,fieldState:{error:F}})=>jsxRuntime.jsxs(x,{children:[t&&jsxRuntime.jsxs(R,{children:[t,o&&jsxRuntime.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),jsxRuntime.jsx(b,{children:jsxRuntime.jsx(v,{...d,value:d.value,onChange:T=>{d.onChange(T.target.value);},onBlur:T=>{typeof d.value=="string"&&d.onChange(d.value.trim()),d.onBlur(),D?.(T);},className:i(F&&"border-destructive focus-visible:ring-destructive",a),disabled:l,readOnly:N,required:o,placeholder:M,"aria-label":E,"aria-describedby":H,"aria-invalid":!!F,"aria-required":o,autoResize:w,...S})}),r&&jsxRuntime.jsx(P,{children:r}),F&&jsxRuntime.jsx(y,{children:F.message}),!F&&m&&jsxRuntime.jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-500",role:"alert",children:m})]})})}exports.RHFTextarea=Te;//# sourceMappingURL=rhf-textarea.js.map
2
+ //# sourceMappingURL=rhf-textarea.js.map