@customafk/lunas-ui 0.0.64 → 0.0.66

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 (379) hide show
  1. package/dist/{add-new-Dw0uZWxo.js → add-new-Dvke5DtJ.js} +2 -2
  2. package/dist/{add-new-Dw0uZWxo.js.map → add-new-Dvke5DtJ.js.map} +1 -1
  3. package/dist/{add-new-C2dDiCV3.cjs → add-new-vx3iCRLK.cjs} +2 -2
  4. package/dist/{add-new-C2dDiCV3.cjs.map → add-new-vx3iCRLK.cjs.map} +1 -1
  5. package/dist/{alert-dialog-BOMy-TmT.js → alert-dialog-BELDR1IC.js} +1 -1
  6. package/dist/{alert-dialog-BOMy-TmT.js.map → alert-dialog-BELDR1IC.js.map} +1 -1
  7. package/dist/{alert-dialog-lwTxSl-r.cjs → alert-dialog-CAeBwm2W.cjs} +1 -1
  8. package/dist/{alert-dialog-lwTxSl-r.cjs.map → alert-dialog-CAeBwm2W.cjs.map} +1 -1
  9. package/dist/{avatar-BaNIRUku.cjs → avatar-CGYZELuM.cjs} +1 -1
  10. package/dist/{avatar-BaNIRUku.cjs.map → avatar-CGYZELuM.cjs.map} +1 -1
  11. package/dist/{avatar-DZU7feMQ.js → avatar-DYfrjbMs.js} +1 -1
  12. package/dist/{avatar-DZU7feMQ.js.map → avatar-DYfrjbMs.js.map} +1 -1
  13. package/dist/{badge-6RQPy3Eo.js → badge-BE7eawbg.js} +1 -1
  14. package/dist/{badge-6RQPy3Eo.js.map → badge-BE7eawbg.js.map} +1 -1
  15. package/dist/{badge-BMXpbMfX.cjs → badge-BMNKZpjB.cjs} +1 -1
  16. package/dist/{badge-BMXpbMfX.cjs.map → badge-BMNKZpjB.cjs.map} +1 -1
  17. package/dist/{button-De2032Bs.d.cts → button-Bz9yIbYt.d.ts} +5 -5
  18. package/dist/{button-CS4aajjP.d.ts → button-D8OpZBOr.d.cts} +4 -4
  19. package/dist/{calendar-CUDdTiC-.cjs → calendar-B6F_Lppz.cjs} +1 -1
  20. package/dist/{calendar-CUDdTiC-.cjs.map → calendar-B6F_Lppz.cjs.map} +1 -1
  21. package/dist/{calendar-BZRNZdsJ.js → calendar-CXddeN7A.js} +1 -1
  22. package/dist/{calendar-BZRNZdsJ.js.map → calendar-CXddeN7A.js.map} +1 -1
  23. package/dist/cards/simple-card.d.ts +2 -2
  24. package/dist/{command-DKD5gHi_.js → command-BJ6dPKIN.js} +2 -2
  25. package/dist/{command-DKD5gHi_.js.map → command-BJ6dPKIN.js.map} +1 -1
  26. package/dist/{command-D7AHVkgQ.d.ts → command-D0Yqyd7M.d.ts} +12 -12
  27. package/dist/{command-Db5JViIx.d.cts → command-Dk_NXe3X.d.cts} +12 -12
  28. package/dist/{command-B9nlrxXh.cjs → command-tDhBQnm6.cjs} +2 -2
  29. package/dist/{command-B9nlrxXh.cjs.map → command-tDhBQnm6.cjs.map} +1 -1
  30. package/dist/data-display/country.cjs +1 -1
  31. package/dist/data-display/country.js +1 -1
  32. package/dist/data-display/data-list.cjs +1 -1
  33. package/dist/data-display/data-list.js +1 -1
  34. package/dist/data-display/date-tooltip.cjs +1 -1
  35. package/dist/data-display/date-tooltip.js +1 -1
  36. package/dist/data-display/date.cjs +1 -1
  37. package/dist/data-display/date.js +1 -1
  38. package/dist/data-display/empty.cjs +1 -1
  39. package/dist/data-display/empty.d.cts +2 -2
  40. package/dist/data-display/empty.js +1 -1
  41. package/dist/data-display/name.cjs +1 -1
  42. package/dist/data-display/name.js +1 -1
  43. package/dist/data-display/phone-number.cjs +1 -1
  44. package/dist/data-display/phone-number.js +1 -1
  45. package/dist/data-display/role-badge.cjs +1 -1
  46. package/dist/data-display/role-badge.js +1 -1
  47. package/dist/data-display/statistic.cjs +1 -1
  48. package/dist/data-display/statistic.d.ts +2 -2
  49. package/dist/data-display/statistic.js +1 -1
  50. package/dist/data-display/user.cjs +2 -0
  51. package/dist/data-display/user.cjs.map +1 -0
  52. package/dist/data-display/user.d.cts +10 -0
  53. package/dist/data-display/user.d.ts +10 -0
  54. package/dist/data-display/user.js +2 -0
  55. package/dist/data-display/user.js.map +1 -0
  56. package/dist/{date-DWxL795U.js → date-D_78qgVx.js} +1 -1
  57. package/dist/{date-DWxL795U.js.map → date-D_78qgVx.js.map} +1 -1
  58. package/dist/{date-wo9LyN6l.cjs → date-XHYNYGxU.cjs} +1 -1
  59. package/dist/{date-wo9LyN6l.cjs.map → date-XHYNYGxU.cjs.map} +1 -1
  60. package/dist/{dialog-yE-2SRfz.d.ts → dialog-BJ1YyPJ1.d.cts} +12 -12
  61. package/dist/{dialog-CiqPVetj.d.cts → dialog-BfzZHsN5.d.ts} +12 -12
  62. package/dist/{dialog-DbI18XF9.js → dialog-DIvrOnbv.js} +1 -1
  63. package/dist/{dialog-DbI18XF9.js.map → dialog-DIvrOnbv.js.map} +1 -1
  64. package/dist/{dialog-CGrbU7PO.cjs → dialog-DQ9MCS8A.cjs} +1 -1
  65. package/dist/{dialog-CGrbU7PO.cjs.map → dialog-DQ9MCS8A.cjs.map} +1 -1
  66. package/dist/dialogs/confirm-dialog.cjs +1 -1
  67. package/dist/dialogs/confirm-dialog.js +1 -1
  68. package/dist/dialogs/detail-dialog/component/sidebar.cjs +1 -1
  69. package/dist/dialogs/detail-dialog/component/sidebar.d.cts +28 -28
  70. package/dist/dialogs/detail-dialog/component/sidebar.d.ts +30 -30
  71. package/dist/dialogs/detail-dialog/component/sidebar.js +1 -1
  72. package/dist/dialogs/detail-dialog/index.cjs +1 -1
  73. package/dist/dialogs/detail-dialog/index.cjs.map +1 -1
  74. package/dist/dialogs/detail-dialog/index.js +1 -1
  75. package/dist/dialogs/error-dialog.cjs +1 -1
  76. package/dist/dialogs/error-dialog.js +1 -1
  77. package/dist/dialogs/form-dialog.cjs +1 -1
  78. package/dist/dialogs/form-dialog.d.cts +2 -2
  79. package/dist/dialogs/form-dialog.d.ts +2 -2
  80. package/dist/dialogs/form-dialog.js +1 -1
  81. package/dist/dialogs/loading-dialog.cjs +1 -1
  82. package/dist/dialogs/loading-dialog.js +1 -1
  83. package/dist/{drawer-Dh9uXVnU.cjs → drawer-CjLYonvG.cjs} +1 -1
  84. package/dist/{drawer-Dh9uXVnU.cjs.map → drawer-CjLYonvG.cjs.map} +1 -1
  85. package/dist/{drawer-B7OJzlXZ.js → drawer-DDwXRMGp.js} +1 -1
  86. package/dist/{drawer-B7OJzlXZ.js.map → drawer-DDwXRMGp.js.map} +1 -1
  87. package/dist/{dropdown-menu-BtNJk8EZ.cjs → dropdown-menu-4TQefUjw.cjs} +1 -1
  88. package/dist/{dropdown-menu-BtNJk8EZ.cjs.map → dropdown-menu-4TQefUjw.cjs.map} +1 -1
  89. package/dist/{dropdown-menu-Cn96vqMy.js → dropdown-menu-BTtuJiO_.js} +1 -1
  90. package/dist/{dropdown-menu-Cn96vqMy.js.map → dropdown-menu-BTtuJiO_.js.map} +1 -1
  91. package/dist/{error-dialog-D3tnycqF.js → error-dialog-DFfdCNGJ.js} +2 -2
  92. package/dist/{error-dialog-D3tnycqF.js.map → error-dialog-DFfdCNGJ.js.map} +1 -1
  93. package/dist/{error-dialog-BkCaUR7F.cjs → error-dialog-DJwjY5C8.cjs} +2 -2
  94. package/dist/{error-dialog-BkCaUR7F.cjs.map → error-dialog-DJwjY5C8.cjs.map} +1 -1
  95. package/dist/{flex-BZHWRUkz.js → flex-DHGKjMIL.js} +1 -1
  96. package/dist/{flex-BZHWRUkz.js.map → flex-DHGKjMIL.js.map} +1 -1
  97. package/dist/{flex-DMgD86BT.cjs → flex-e9OPvFYl.cjs} +1 -1
  98. package/dist/{flex-DMgD86BT.cjs.map → flex-e9OPvFYl.cjs.map} +1 -1
  99. package/dist/{form-CaxhlWxK.cjs → form-A2qAueDp.cjs} +2 -2
  100. package/dist/{form-CaxhlWxK.cjs.map → form-A2qAueDp.cjs.map} +1 -1
  101. package/dist/{form-D-gDMD-J.js → form-C4Zn5Meu.js} +2 -2
  102. package/dist/{form-D-gDMD-J.js.map → form-C4Zn5Meu.js.map} +1 -1
  103. package/dist/{form-wrapper-BbScjpBv.js → form-wrapper-BvnGERhM.js} +2 -2
  104. package/dist/{form-wrapper-BbScjpBv.js.map → form-wrapper-BvnGERhM.js.map} +1 -1
  105. package/dist/{form-wrapper-BUkoh-c7.cjs → form-wrapper-p2OwxpA0.cjs} +2 -2
  106. package/dist/{form-wrapper-BUkoh-c7.cjs.map → form-wrapper-p2OwxpA0.cjs.map} +1 -1
  107. package/dist/forms/combobox-field.cjs +1 -1
  108. package/dist/forms/combobox-field.d.cts +2 -2
  109. package/dist/forms/combobox-field.d.ts +2 -2
  110. package/dist/forms/combobox-field.js +1 -1
  111. package/dist/forms/date-field.cjs +1 -1
  112. package/dist/forms/date-field.d.cts +2 -2
  113. package/dist/forms/date-field.js +1 -1
  114. package/dist/forms/form-wrapper.cjs +1 -1
  115. package/dist/forms/form-wrapper.d.cts +2 -2
  116. package/dist/forms/form-wrapper.js +1 -1
  117. package/dist/forms/multi-select-field.cjs +1 -1
  118. package/dist/forms/multi-select-field.d.cts +2 -2
  119. package/dist/forms/multi-select-field.d.ts +2 -2
  120. package/dist/forms/multi-select-field.js +1 -1
  121. package/dist/forms/number-field.cjs +1 -1
  122. package/dist/forms/number-field.d.cts +2 -2
  123. package/dist/forms/number-field.d.ts +2 -2
  124. package/dist/forms/number-field.js +1 -1
  125. package/dist/forms/password-field.cjs +1 -1
  126. package/dist/forms/password-field.cjs.map +1 -1
  127. package/dist/forms/password-field.d.cts +2 -2
  128. package/dist/forms/password-field.d.ts +2 -2
  129. package/dist/forms/password-field.js +1 -1
  130. package/dist/forms/password-field.js.map +1 -1
  131. package/dist/forms/select-field.cjs +1 -1
  132. package/dist/forms/select-field.d.cts +2 -2
  133. package/dist/forms/select-field.d.ts +2 -2
  134. package/dist/forms/select-field.js +1 -1
  135. package/dist/forms/switch-field.cjs +1 -1
  136. package/dist/forms/switch-field.d.cts +2 -2
  137. package/dist/forms/switch-field.d.ts +2 -2
  138. package/dist/forms/switch-field.js +1 -1
  139. package/dist/forms/text-field.cjs +1 -1
  140. package/dist/forms/text-field.d.cts +2 -2
  141. package/dist/forms/text-field.d.ts +2 -2
  142. package/dist/forms/text-field.js +1 -1
  143. package/dist/forms/textarea-field.cjs +1 -1
  144. package/dist/forms/textarea-field.d.cts +2 -2
  145. package/dist/forms/textarea-field.d.ts +2 -2
  146. package/dist/forms/textarea-field.js +1 -1
  147. package/dist/{input-BFZuwsER.js → input-BUYJ4_aj.js} +1 -1
  148. package/dist/{input-BFZuwsER.js.map → input-BUYJ4_aj.js.map} +1 -1
  149. package/dist/{input-BayoSfCE.d.cts → input-CZXCSepU.d.ts} +3 -3
  150. package/dist/{input-BjiwI6EW.d.ts → input-Cn3ENNm6.d.cts} +3 -3
  151. package/dist/{input-ERPHY3v4.cjs → input-DgtTVBtN.cjs} +1 -1
  152. package/dist/{input-ERPHY3v4.cjs.map → input-DgtTVBtN.cjs.map} +1 -1
  153. package/dist/{label-BBPPT0-L.cjs → label-BM6rVDz-.cjs} +1 -1
  154. package/dist/{label-BBPPT0-L.cjs.map → label-BM6rVDz-.cjs.map} +1 -1
  155. package/dist/{label-DdpIoRiG.js → label-D4GUfxTB.js} +1 -1
  156. package/dist/{label-DdpIoRiG.js.map → label-D4GUfxTB.js.map} +1 -1
  157. package/dist/layouts/app-layout/index.cjs +1 -1
  158. package/dist/layouts/app-layout/index.d.cts +3 -3
  159. package/dist/layouts/app-layout/index.d.ts +3 -3
  160. package/dist/layouts/app-layout/index.js +1 -1
  161. package/dist/layouts/flex.cjs +1 -1
  162. package/dist/layouts/flex.d.cts +2 -2
  163. package/dist/layouts/flex.d.ts +2 -2
  164. package/dist/layouts/flex.js +1 -1
  165. package/dist/layouts/service-layout/index.cjs +1 -1
  166. package/dist/layouts/service-layout/index.cjs.map +1 -1
  167. package/dist/layouts/service-layout/index.d.cts +3 -3
  168. package/dist/layouts/service-layout/index.d.ts +3 -3
  169. package/dist/layouts/service-layout/index.js +1 -1
  170. package/dist/layouts/service-layout/index.js.map +1 -1
  171. package/dist/{multi-select-oXuLHx0A.js → multi-select-B5ACggbh.js} +2 -2
  172. package/dist/{multi-select-oXuLHx0A.js.map → multi-select-B5ACggbh.js.map} +1 -1
  173. package/dist/{multi-select-BAXHYtlU.cjs → multi-select-BGoJRW7y.cjs} +2 -2
  174. package/dist/{multi-select-BAXHYtlU.cjs.map → multi-select-BGoJRW7y.cjs.map} +1 -1
  175. package/dist/{paragraph-CI28eVP0.cjs → paragraph-D466nycw.cjs} +1 -1
  176. package/dist/{paragraph-CI28eVP0.cjs.map → paragraph-D466nycw.cjs.map} +1 -1
  177. package/dist/{paragraph-BwSskqDY.js → paragraph-TwyIN27a.js} +1 -1
  178. package/dist/{paragraph-BwSskqDY.js.map → paragraph-TwyIN27a.js.map} +1 -1
  179. package/dist/{popover-ByL6Igxn.cjs → popover-Bi7GLJT5.cjs} +1 -1
  180. package/dist/{popover-ByL6Igxn.cjs.map → popover-Bi7GLJT5.cjs.map} +1 -1
  181. package/dist/{popover-DMt7GPSm.js → popover-CxOK3oy2.js} +1 -1
  182. package/dist/{popover-DMt7GPSm.js.map → popover-CxOK3oy2.js.map} +1 -1
  183. package/dist/{refresh-CHzDlf3i.js → refresh-BjCic3TP.js} +2 -2
  184. package/dist/{refresh-CHzDlf3i.js.map → refresh-BjCic3TP.js.map} +1 -1
  185. package/dist/{refresh-BVSXOk3A.cjs → refresh-CayYkwzH.cjs} +2 -2
  186. package/dist/{refresh-BVSXOk3A.cjs.map → refresh-CayYkwzH.cjs.map} +1 -1
  187. package/dist/{scroll-area-C4Mg89Qh.js → scroll-area-C7kyYKAP.js} +1 -1
  188. package/dist/{scroll-area-C4Mg89Qh.js.map → scroll-area-C7kyYKAP.js.map} +1 -1
  189. package/dist/{scroll-area-qPdEy4lg.cjs → scroll-area-CrifnXd7.cjs} +1 -1
  190. package/dist/{scroll-area-qPdEy4lg.cjs.map → scroll-area-CrifnXd7.cjs.map} +1 -1
  191. package/dist/{search-input-DWLfcXEU.cjs → search-input-BZnoWja5.cjs} +2 -2
  192. package/dist/{search-input-DWLfcXEU.cjs.map → search-input-BZnoWja5.cjs.map} +1 -1
  193. package/dist/{search-input-B_L6kaz-.js → search-input-CLO-QRF1.js} +2 -2
  194. package/dist/{search-input-B_L6kaz-.js.map → search-input-CLO-QRF1.js.map} +1 -1
  195. package/dist/{select-CijI0HX0.js → select-Cmq5a3Wg.js} +1 -1
  196. package/dist/{select-CijI0HX0.js.map → select-Cmq5a3Wg.js.map} +1 -1
  197. package/dist/{select-oxr4KoHx.cjs → select-DAE3Xg7g.cjs} +1 -1
  198. package/dist/{select-oxr4KoHx.cjs.map → select-DAE3Xg7g.cjs.map} +1 -1
  199. package/dist/{separator-zD-G3xIG.d.ts → separator-ClWRPBeh.d.ts} +3 -3
  200. package/dist/{separator-BSmwGEtT.d.cts → separator-N8MVZxoC.d.cts} +3 -3
  201. package/dist/{sidebar-BxGyCuTJ.cjs → sidebar-BOj6aD9h.cjs} +2 -2
  202. package/dist/{sidebar-BxGyCuTJ.cjs.map → sidebar-BOj6aD9h.cjs.map} +1 -1
  203. package/dist/{sidebar-CMWETVDr.js → sidebar-DP3pg9uN.js} +2 -2
  204. package/dist/{sidebar-CMWETVDr.js.map → sidebar-DP3pg9uN.js.map} +1 -1
  205. package/dist/{switch-BPSKvrTw.cjs → switch-BnHSwQ5T.cjs} +1 -1
  206. package/dist/{switch-BPSKvrTw.cjs.map → switch-BnHSwQ5T.cjs.map} +1 -1
  207. package/dist/{switch-Crju8DJO.js → switch-iwm2-R_e.js} +1 -1
  208. package/dist/{switch-Crju8DJO.js.map → switch-iwm2-R_e.js.map} +1 -1
  209. package/dist/table/index.cjs +1 -1
  210. package/dist/table/index.d.cts +2 -2
  211. package/dist/table/index.d.ts +2 -2
  212. package/dist/table/index.js +1 -1
  213. package/dist/{table-DCmuhHSH.js → table-BiZjONQ-.js} +2 -2
  214. package/dist/{table-DCmuhHSH.js.map → table-BiZjONQ-.js.map} +1 -1
  215. package/dist/{table-CSvLRXlk.cjs → table-Btz3llJc.cjs} +2 -2
  216. package/dist/{table-CSvLRXlk.cjs.map → table-Btz3llJc.cjs.map} +1 -1
  217. package/dist/{textarea-BtACo9UF.cjs → textarea-DK_bNV0u.cjs} +1 -1
  218. package/dist/{textarea-BtACo9UF.cjs.map → textarea-DK_bNV0u.cjs.map} +1 -1
  219. package/dist/{textarea-BCZiUxv7.js → textarea-DbNqKCAi.js} +1 -1
  220. package/dist/{textarea-BCZiUxv7.js.map → textarea-DbNqKCAi.js.map} +1 -1
  221. package/dist/{title-sD8UJhwY.cjs → title-BX8MBhB_.cjs} +1 -1
  222. package/dist/{title-sD8UJhwY.cjs.map → title-BX8MBhB_.cjs.map} +1 -1
  223. package/dist/{title-CtD4oOTk.js → title-C4w7vOR0.js} +1 -1
  224. package/dist/{title-CtD4oOTk.js.map → title-C4w7vOR0.js.map} +1 -1
  225. package/dist/{toggle-CP8phE7Y.d.cts → toggle-C_TsU7XT.d.cts} +5 -5
  226. package/dist/{toggle-BtGh6fdx.d.ts → toggle-D1jSpEk0.d.ts} +5 -5
  227. package/dist/{tooltip-CQ8hkJ42.cjs → tooltip-BMKX80GV.cjs} +1 -1
  228. package/dist/{tooltip-CQ8hkJ42.cjs.map → tooltip-BMKX80GV.cjs.map} +1 -1
  229. package/dist/{tooltip-CTUSyCdh.js → tooltip-Bmdk684V.js} +1 -1
  230. package/dist/{tooltip-CTUSyCdh.js.map → tooltip-Bmdk684V.js.map} +1 -1
  231. package/dist/{tooltip-DLNDOfBF.d.cts → tooltip-CbhtsOGz.d.cts} +6 -6
  232. package/dist/{tooltip-CamHYf1v.d.ts → tooltip-DHJrQ0qt.d.ts} +6 -6
  233. package/dist/{types-DMNCf28U.cjs → types-B5_UaDJF.cjs} +1 -1
  234. package/dist/{types-DMNCf28U.cjs.map → types-B5_UaDJF.cjs.map} +1 -1
  235. package/dist/{types-Cgr_eoPF.js → types-D8BVDfSP.js} +1 -1
  236. package/dist/{types-Cgr_eoPF.js.map → types-D8BVDfSP.js.map} +1 -1
  237. package/dist/typography/paragraph.cjs +1 -1
  238. package/dist/typography/paragraph.d.cts +2 -2
  239. package/dist/typography/paragraph.d.ts +2 -2
  240. package/dist/typography/paragraph.js +1 -1
  241. package/dist/typography/title.cjs +1 -1
  242. package/dist/typography/title.d.cts +2 -2
  243. package/dist/typography/title.d.ts +2 -2
  244. package/dist/typography/title.js +1 -1
  245. package/dist/ui/alert-dialog.cjs +1 -1
  246. package/dist/ui/alert-dialog.d.cts +12 -12
  247. package/dist/ui/alert-dialog.d.ts +12 -12
  248. package/dist/ui/alert-dialog.js +1 -1
  249. package/dist/ui/alert.d.cts +6 -6
  250. package/dist/ui/alert.d.ts +4 -4
  251. package/dist/ui/aspect-ratio.d.cts +2 -2
  252. package/dist/ui/aspect-ratio.d.ts +2 -2
  253. package/dist/ui/avatar.cjs +1 -1
  254. package/dist/ui/avatar.d.cts +4 -4
  255. package/dist/ui/avatar.d.ts +4 -4
  256. package/dist/ui/avatar.js +1 -1
  257. package/dist/ui/badge.cjs +1 -1
  258. package/dist/ui/badge.d.cts +4 -4
  259. package/dist/ui/badge.d.ts +4 -4
  260. package/dist/ui/badge.js +1 -1
  261. package/dist/ui/breadcrumb.d.cts +8 -8
  262. package/dist/ui/breadcrumb.d.ts +8 -8
  263. package/dist/ui/button.d.cts +1 -1
  264. package/dist/ui/button.d.ts +1 -1
  265. package/dist/ui/buttons/add-new.cjs +1 -1
  266. package/dist/ui/buttons/add-new.js +1 -1
  267. package/dist/ui/buttons/refresh.cjs +1 -1
  268. package/dist/ui/buttons/refresh.js +1 -1
  269. package/dist/ui/calendar.cjs +1 -1
  270. package/dist/ui/calendar.d.cts +4 -4
  271. package/dist/ui/calendar.d.ts +4 -4
  272. package/dist/ui/calendar.js +1 -1
  273. package/dist/ui/card.d.cts +8 -8
  274. package/dist/ui/card.d.ts +8 -8
  275. package/dist/ui/carousel.d.cts +7 -7
  276. package/dist/ui/carousel.d.ts +7 -7
  277. package/dist/ui/collapsible.d.cts +4 -4
  278. package/dist/ui/collapsible.d.ts +4 -4
  279. package/dist/ui/command.cjs +1 -1
  280. package/dist/ui/command.d.cts +2 -2
  281. package/dist/ui/command.d.ts +2 -2
  282. package/dist/ui/command.js +1 -1
  283. package/dist/ui/context-menu.d.cts +16 -16
  284. package/dist/ui/context-menu.d.ts +16 -16
  285. package/dist/ui/dialog.cjs +1 -1
  286. package/dist/ui/dialog.d.cts +1 -1
  287. package/dist/ui/dialog.d.ts +1 -1
  288. package/dist/ui/dialog.js +1 -1
  289. package/dist/ui/dropdown-menu.cjs +1 -1
  290. package/dist/ui/dropdown-menu.d.cts +16 -16
  291. package/dist/ui/dropdown-menu.d.ts +16 -16
  292. package/dist/ui/dropdown-menu.js +1 -1
  293. package/dist/ui/file-uploader.d.cts +2 -2
  294. package/dist/ui/file-uploader.d.ts +2 -2
  295. package/dist/ui/form.cjs +1 -1
  296. package/dist/ui/form.d.cts +7 -7
  297. package/dist/ui/form.d.ts +7 -7
  298. package/dist/ui/form.js +1 -1
  299. package/dist/ui/hover-card.d.cts +4 -4
  300. package/dist/ui/hover-card.d.ts +4 -4
  301. package/dist/ui/input-otp.d.cts +5 -5
  302. package/dist/ui/input-otp.d.ts +5 -5
  303. package/dist/ui/input.cjs +1 -1
  304. package/dist/ui/input.d.cts +1 -1
  305. package/dist/ui/input.d.ts +1 -1
  306. package/dist/ui/input.js +1 -1
  307. package/dist/ui/inputs/search-input.cjs +1 -1
  308. package/dist/ui/inputs/search-input.d.cts +3 -3
  309. package/dist/ui/inputs/search-input.d.ts +3 -3
  310. package/dist/ui/inputs/search-input.js +1 -1
  311. package/dist/ui/label.cjs +1 -1
  312. package/dist/ui/label.d.cts +2 -2
  313. package/dist/ui/label.d.ts +2 -2
  314. package/dist/ui/label.js +1 -1
  315. package/dist/ui/menubar.d.cts +17 -17
  316. package/dist/ui/menubar.d.ts +17 -17
  317. package/dist/ui/multi-select.cjs +1 -1
  318. package/dist/ui/multi-select.d.cts +2 -2
  319. package/dist/ui/multi-select.d.ts +2 -2
  320. package/dist/ui/multi-select.js +1 -1
  321. package/dist/ui/navigation-menu.d.cts +11 -11
  322. package/dist/ui/navigation-menu.d.ts +9 -9
  323. package/dist/ui/pagination.d.cts +9 -9
  324. package/dist/ui/pagination.d.ts +9 -9
  325. package/dist/ui/popover.cjs +1 -1
  326. package/dist/ui/popover.d.cts +5 -5
  327. package/dist/ui/popover.d.ts +5 -5
  328. package/dist/ui/popover.js +1 -1
  329. package/dist/ui/progress.d.cts +2 -2
  330. package/dist/ui/progress.d.ts +2 -2
  331. package/dist/ui/radio-group.d.cts +3 -3
  332. package/dist/ui/radio-group.d.ts +3 -3
  333. package/dist/ui/resizable.d.cts +4 -4
  334. package/dist/ui/resizable.d.ts +4 -4
  335. package/dist/ui/scroll-area.cjs +1 -1
  336. package/dist/ui/scroll-area.d.cts +3 -3
  337. package/dist/ui/scroll-area.d.ts +3 -3
  338. package/dist/ui/scroll-area.js +1 -1
  339. package/dist/ui/select.cjs +1 -1
  340. package/dist/ui/select.d.cts +11 -11
  341. package/dist/ui/select.d.ts +11 -11
  342. package/dist/ui/select.js +1 -1
  343. package/dist/ui/separator.d.cts +1 -1
  344. package/dist/ui/separator.d.ts +1 -1
  345. package/dist/ui/sheet.d.cts +9 -9
  346. package/dist/ui/sheet.d.ts +9 -9
  347. package/dist/ui/sidebar.cjs +1 -1
  348. package/dist/ui/sidebar.d.cts +30 -30
  349. package/dist/ui/sidebar.d.ts +30 -30
  350. package/dist/ui/sidebar.js +1 -1
  351. package/dist/ui/skeleton.d.cts +2 -2
  352. package/dist/ui/skeleton.d.ts +2 -2
  353. package/dist/ui/slider.d.cts +2 -2
  354. package/dist/ui/slider.d.ts +2 -2
  355. package/dist/ui/sonner.d.cts +2 -2
  356. package/dist/ui/sonner.d.ts +2 -2
  357. package/dist/ui/switch.cjs +1 -1
  358. package/dist/ui/switch.d.cts +2 -2
  359. package/dist/ui/switch.d.ts +2 -2
  360. package/dist/ui/switch.js +1 -1
  361. package/dist/ui/table.cjs +1 -1
  362. package/dist/ui/table.d.cts +9 -9
  363. package/dist/ui/table.d.ts +9 -9
  364. package/dist/ui/table.js +1 -1
  365. package/dist/ui/tabs.d.cts +5 -5
  366. package/dist/ui/tabs.d.ts +5 -5
  367. package/dist/ui/textarea.cjs +1 -1
  368. package/dist/ui/textarea.d.cts +2 -2
  369. package/dist/ui/textarea.d.ts +2 -2
  370. package/dist/ui/textarea.js +1 -1
  371. package/dist/ui/toggle-group.d.cts +4 -4
  372. package/dist/ui/toggle-group.d.ts +4 -4
  373. package/dist/ui/toggle.d.cts +1 -1
  374. package/dist/ui/toggle.d.ts +1 -1
  375. package/dist/ui/tooltip.cjs +1 -1
  376. package/dist/ui/tooltip.d.cts +1 -1
  377. package/dist/ui/tooltip.d.ts +1 -1
  378. package/dist/ui/tooltip.js +1 -1
  379. package/package.json +6 -2
@@ -1,2 +1,2 @@
1
- import{ErrorDialog as e}from"./error-dialog-D3tnycqF.js";import{Form as t}from"./form-D-gDMD-J.js";import{AlertCircleIcon as n}from"lucide-react";import{Fragment as r,jsx as i,jsxs as a}from"react/jsx-runtime";import{useCallback as o,useEffect as s,useState as c}from"react";import{useForm as l}from"react-hook-form";import{ErrorMessage as u}from"@hookform/error-message";const d=({form:d,isResetAfterSubmit:f=!0,className:p,onSubmit:m,onError:h,onSubcribe:g,children:_})=>{let v=l({...d,criteriaMode:`all`}),{formState:y,reset:b,handleSubmit:x,subscribe:S}=v,{dirtyFields:C}=y,[w,T]=c(!1),E=o(e=>{m(e,y,C),f&&b()},[C,y,f,m,b]),D=o(e=>{let t=Object.keys(e);t.length!==0&&(h?.(e),T(!0))},[h]);return s(()=>{if(!g)return;let e=S({formState:{values:!0},callback:({values:e})=>{g(e)}});return()=>e()},[g,S]),a(t,{...v,children:[i(`form`,{className:p,onSubmit:x(E,D),children:_}),i(e,{open:w,title:`Lỗi nhập dữ liệu`,description:`An unexpected error has occurred. Please check the errors below and try again.`,onOpenChange:T,children:w&&i(r,{children:Object.keys(y.errors).length>0?a(`div`,{className:`flex max-w-100 flex-col gap-2 px-4`,children:[i(`p`,{className:`text-muted-foreground text-sm font-semibold`,children:`Cảnh báo: Vui lòng kiểm tra các lỗi sau:`}),i(`div`,{className:`flex flex-col space-y-1`,children:Object.entries(y.errors).map(([e])=>i(u,{errors:y.errors,name:e,render:({messages:e})=>i(r,{children:e?Object.entries(e).map(([e,t])=>a(`div`,{className:`text-accent-foreground flex items-start gap-x-1 truncate text-sm font-normal`,children:[i(n,{size:16,className:`text-destructive mt-0.5 min-w-4 flex-0`}),i(`p`,{className:`line-clamp-2 flex-1 text-wrap`,children:t})]},e)):null})},e))})]}):i(`p`,{className:`text-muted-foreground text-sm`,children:`No errors found.`})})})]})};export{d as FormWrapper};
2
- //# sourceMappingURL=form-wrapper-BbScjpBv.js.map
1
+ import{ErrorDialog as e}from"./error-dialog-DFfdCNGJ.js";import{Form as t}from"./form-C4Zn5Meu.js";import{AlertCircleIcon as n}from"lucide-react";import{Fragment as r,jsx as i,jsxs as a}from"react/jsx-runtime";import{useCallback as o,useEffect as s,useState as c}from"react";import{useForm as l}from"react-hook-form";import{ErrorMessage as u}from"@hookform/error-message";const d=({form:d,isResetAfterSubmit:f=!0,className:p,onSubmit:m,onError:h,onSubcribe:g,children:_})=>{let v=l({...d,criteriaMode:`all`}),{formState:y,reset:b,handleSubmit:x,subscribe:S}=v,{dirtyFields:C}=y,[w,T]=c(!1),E=o(e=>{m(e,y,C),f&&b()},[C,y,f,m,b]),D=o(e=>{let t=Object.keys(e);t.length!==0&&(h?.(e),T(!0))},[h]);return s(()=>{if(!g)return;let e=S({formState:{values:!0},callback:({values:e})=>{g(e)}});return()=>e()},[g,S]),a(t,{...v,children:[i(`form`,{className:p,onSubmit:x(E,D),children:_}),i(e,{open:w,title:`Lỗi nhập dữ liệu`,description:`An unexpected error has occurred. Please check the errors below and try again.`,onOpenChange:T,children:w&&i(r,{children:Object.keys(y.errors).length>0?a(`div`,{className:`flex max-w-100 flex-col gap-2 px-4`,children:[i(`p`,{className:`text-muted-foreground text-sm font-semibold`,children:`Cảnh báo: Vui lòng kiểm tra các lỗi sau:`}),i(`div`,{className:`flex flex-col space-y-1`,children:Object.entries(y.errors).map(([e])=>i(u,{errors:y.errors,name:e,render:({messages:e})=>i(r,{children:e?Object.entries(e).map(([e,t])=>a(`div`,{className:`text-accent-foreground flex items-start gap-x-1 truncate text-sm font-normal`,children:[i(n,{size:16,className:`text-destructive mt-0.5 min-w-4 flex-0`}),i(`p`,{className:`line-clamp-2 flex-1 text-wrap`,children:t})]},e)):null})},e))})]}):i(`p`,{className:`text-muted-foreground text-sm`,children:`No errors found.`})})})]})};export{d as FormWrapper};
2
+ //# sourceMappingURL=form-wrapper-BvnGERhM.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-wrapper-BbScjpBv.js","names":[],"sources":["../packages/components/forms/form-wrapper.tsx"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react'\nimport { type FieldValues, type FormState, type SubmitErrorHandler, type SubmitHandler, useForm, type UseFormProps } from 'react-hook-form'\n\nimport { AlertCircleIcon } from 'lucide-react'\n\nimport type { AnyEntity } from '@/types'\nimport { ErrorMessage } from '@hookform/error-message'\n\nimport { ErrorDialog } from '../dialogs/error-dialog'\nimport { Form } from '../ui/form'\n\ntype Props<TFieldValues extends FieldValues = FieldValues> = {\n form: UseFormProps<TFieldValues>\n isResetAfterSubmit?: boolean\n className?: string\n onSubmit: (data: TFieldValues, formState: FormState<FieldValues>, dirtyFields: FormState<FieldValues>['dirtyFields']) => void | Promise<void>\n onError?: SubmitErrorHandler<TFieldValues>\n onSubcribe?: (values: TFieldValues) => void\n}\n\nexport const FormWrapper = <TFieldValues extends FieldValues = FieldValues>({\n form: FormConfig,\n isResetAfterSubmit = true,\n className,\n onSubmit,\n onError,\n onSubcribe,\n children,\n}: React.PropsWithChildren<Props<TFieldValues>>) => {\n const form = useForm({\n ...FormConfig,\n criteriaMode: 'all',\n })\n\n const { formState, reset, handleSubmit, subscribe } = form\n const { dirtyFields } = formState\n\n const [errorOpen, setErrorOpen] = useState<boolean>(false)\n\n const handleFormSubmit = useCallback<SubmitHandler<TFieldValues>>(\n (data) => {\n onSubmit(data, formState, dirtyFields)\n if (isResetAfterSubmit) {\n reset()\n }\n },\n [dirtyFields, formState, isResetAfterSubmit, onSubmit, reset],\n )\n\n const handleFormError = useCallback<SubmitErrorHandler<TFieldValues>>(\n (errors) => {\n const errorKeys = Object.keys(errors)\n if (errorKeys.length === 0) return\n onError?.(errors)\n setErrorOpen(true)\n },\n [onError],\n )\n\n useEffect(() => {\n if (!onSubcribe) return\n const callback = subscribe({\n formState: { values: true },\n callback: ({ values }) => {\n onSubcribe(values)\n },\n })\n return () => callback()\n }, [onSubcribe, subscribe])\n\n return (\n <Form {...form}>\n <form className={className} onSubmit={handleSubmit(handleFormSubmit, handleFormError)}>\n {children}\n </form>\n <ErrorDialog\n open={errorOpen}\n title=\"Lỗi nhập dữ liệu\"\n description=\"An unexpected error has occurred. Please check the errors below and try again.\"\n onOpenChange={setErrorOpen}\n >\n {errorOpen && (\n <>\n {Object.keys(formState.errors).length > 0 ? (\n <div className=\"flex max-w-100 flex-col gap-2 px-4\">\n <p className=\"text-muted-foreground text-sm font-semibold\">Cảnh báo: Vui lòng kiểm tra các lỗi sau:</p>\n <div className=\"flex flex-col space-y-1\">\n {Object.entries(formState.errors).map(([key]) => (\n <ErrorMessage\n key={key}\n errors={formState.errors}\n name={key as AnyEntity}\n render={({ messages }) => {\n return (\n <>\n {messages\n ? Object.entries(messages).map(([type, message]) => {\n return (\n <div key={type} className=\"text-accent-foreground flex items-start gap-x-1 truncate text-sm font-normal\">\n <AlertCircleIcon size={16} className=\"text-destructive mt-0.5 min-w-4 flex-0\" />\n <p className=\"line-clamp-2 flex-1 text-wrap\">{message}</p>\n </div>\n )\n })\n : null}\n </>\n )\n }}\n />\n ))}\n </div>\n </div>\n ) : (\n <p className=\"text-muted-foreground text-sm\">No errors found.</p>\n )}\n </>\n )}\n </ErrorDialog>\n </Form>\n )\n}\n"],"mappings":"oXAoBA,MAAa,GAA+D,CAC1E,KAAM,EACN,qBAAqB,GACrB,YACA,WACA,UACA,aACA,cACkD,CAClD,IAAM,EAAO,EAAQ,CACnB,GAAG,EACH,aAAc,QAGV,CAAE,YAAW,QAAO,eAAc,aAAc,EAChD,CAAE,eAAgB,EAElB,CAAC,EAAW,GAAgB,EAAkB,IAE9C,EAAmB,EACtB,GAAS,CACR,EAAS,EAAM,EAAW,GACtB,GACF,KAGJ,CAAC,EAAa,EAAW,EAAoB,EAAU,IAGnD,EAAkB,EACrB,GAAW,CACV,IAAM,EAAY,OAAO,KAAK,GAC1B,EAAU,SAAW,IACzB,IAAU,GACV,EAAa,MAEf,CAAC,IAcH,OAXA,MAAgB,CACd,GAAI,CAAC,EAAY,OACjB,IAAM,EAAW,EAAU,CACzB,UAAW,CAAE,OAAQ,IACrB,UAAW,CAAE,YAAa,CACxB,EAAW,MAGf,UAAa,KACZ,CAAC,EAAY,IAGd,EAAC,EAAA,CAAK,GAAI,YACR,EAAC,OAAA,CAAgB,YAAW,SAAU,EAAa,EAAkB,GAClE,aAEH,EAAC,EAAA,CACC,KAAM,EACN,MAAM,mBACN,YAAY,iFACZ,aAAc,WAEb,GACC,EAAA,EAAA,CAAA,SACG,OAAO,KAAK,EAAU,QAAQ,OAAS,EACtC,EAAC,MAAA,CAAI,UAAU,+CACb,EAAC,IAAA,CAAE,UAAU,uDAA8C,6CAC3D,EAAC,MAAA,CAAI,UAAU,mCACZ,OAAO,QAAQ,EAAU,QAAQ,KAAK,CAAC,KACtC,EAAC,EAAA,CAEC,OAAQ,EAAU,OAClB,KAAM,EACN,QAAS,CAAE,cAEP,EAAA,EAAA,CAAA,SACG,EACG,OAAO,QAAQ,GAAU,KAAK,CAAC,EAAM,KAEjC,EAAC,MAAA,CAAe,UAAU,yFACxB,EAAC,EAAA,CAAgB,KAAM,GAAI,UAAU,2CACrC,EAAC,IAAA,CAAE,UAAU,yCAAiC,MAFtC,IAMd,QAfL,SAwBb,EAAC,IAAA,CAAE,UAAU,yCAAgC"}
1
+ {"version":3,"file":"form-wrapper-BvnGERhM.js","names":[],"sources":["../packages/components/forms/form-wrapper.tsx"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react'\nimport { type FieldValues, type FormState, type SubmitErrorHandler, type SubmitHandler, useForm, type UseFormProps } from 'react-hook-form'\n\nimport { AlertCircleIcon } from 'lucide-react'\n\nimport type { AnyEntity } from '@/types'\nimport { ErrorMessage } from '@hookform/error-message'\n\nimport { ErrorDialog } from '../dialogs/error-dialog'\nimport { Form } from '../ui/form'\n\ntype Props<TFieldValues extends FieldValues = FieldValues> = {\n form: UseFormProps<TFieldValues>\n isResetAfterSubmit?: boolean\n className?: string\n onSubmit: (data: TFieldValues, formState: FormState<FieldValues>, dirtyFields: FormState<FieldValues>['dirtyFields']) => void | Promise<void>\n onError?: SubmitErrorHandler<TFieldValues>\n onSubcribe?: (values: TFieldValues) => void\n}\n\nexport const FormWrapper = <TFieldValues extends FieldValues = FieldValues>({\n form: FormConfig,\n isResetAfterSubmit = true,\n className,\n onSubmit,\n onError,\n onSubcribe,\n children,\n}: React.PropsWithChildren<Props<TFieldValues>>) => {\n const form = useForm({\n ...FormConfig,\n criteriaMode: 'all',\n })\n\n const { formState, reset, handleSubmit, subscribe } = form\n const { dirtyFields } = formState\n\n const [errorOpen, setErrorOpen] = useState<boolean>(false)\n\n const handleFormSubmit = useCallback<SubmitHandler<TFieldValues>>(\n (data) => {\n onSubmit(data, formState, dirtyFields)\n if (isResetAfterSubmit) {\n reset()\n }\n },\n [dirtyFields, formState, isResetAfterSubmit, onSubmit, reset],\n )\n\n const handleFormError = useCallback<SubmitErrorHandler<TFieldValues>>(\n (errors) => {\n const errorKeys = Object.keys(errors)\n if (errorKeys.length === 0) return\n onError?.(errors)\n setErrorOpen(true)\n },\n [onError],\n )\n\n useEffect(() => {\n if (!onSubcribe) return\n const callback = subscribe({\n formState: { values: true },\n callback: ({ values }) => {\n onSubcribe(values)\n },\n })\n return () => callback()\n }, [onSubcribe, subscribe])\n\n return (\n <Form {...form}>\n <form className={className} onSubmit={handleSubmit(handleFormSubmit, handleFormError)}>\n {children}\n </form>\n <ErrorDialog\n open={errorOpen}\n title=\"Lỗi nhập dữ liệu\"\n description=\"An unexpected error has occurred. Please check the errors below and try again.\"\n onOpenChange={setErrorOpen}\n >\n {errorOpen && (\n <>\n {Object.keys(formState.errors).length > 0 ? (\n <div className=\"flex max-w-100 flex-col gap-2 px-4\">\n <p className=\"text-muted-foreground text-sm font-semibold\">Cảnh báo: Vui lòng kiểm tra các lỗi sau:</p>\n <div className=\"flex flex-col space-y-1\">\n {Object.entries(formState.errors).map(([key]) => (\n <ErrorMessage\n key={key}\n errors={formState.errors}\n name={key as AnyEntity}\n render={({ messages }) => {\n return (\n <>\n {messages\n ? Object.entries(messages).map(([type, message]) => {\n return (\n <div key={type} className=\"text-accent-foreground flex items-start gap-x-1 truncate text-sm font-normal\">\n <AlertCircleIcon size={16} className=\"text-destructive mt-0.5 min-w-4 flex-0\" />\n <p className=\"line-clamp-2 flex-1 text-wrap\">{message}</p>\n </div>\n )\n })\n : null}\n </>\n )\n }}\n />\n ))}\n </div>\n </div>\n ) : (\n <p className=\"text-muted-foreground text-sm\">No errors found.</p>\n )}\n </>\n )}\n </ErrorDialog>\n </Form>\n )\n}\n"],"mappings":"oXAoBA,MAAa,GAA+D,CAC1E,KAAM,EACN,qBAAqB,GACrB,YACA,WACA,UACA,aACA,cACkD,CAClD,IAAM,EAAO,EAAQ,CACnB,GAAG,EACH,aAAc,QAGV,CAAE,YAAW,QAAO,eAAc,aAAc,EAChD,CAAE,eAAgB,EAElB,CAAC,EAAW,GAAgB,EAAkB,IAE9C,EAAmB,EACtB,GAAS,CACR,EAAS,EAAM,EAAW,GACtB,GACF,KAGJ,CAAC,EAAa,EAAW,EAAoB,EAAU,IAGnD,EAAkB,EACrB,GAAW,CACV,IAAM,EAAY,OAAO,KAAK,GAC1B,EAAU,SAAW,IACzB,IAAU,GACV,EAAa,MAEf,CAAC,IAcH,OAXA,MAAgB,CACd,GAAI,CAAC,EAAY,OACjB,IAAM,EAAW,EAAU,CACzB,UAAW,CAAE,OAAQ,IACrB,UAAW,CAAE,YAAa,CACxB,EAAW,MAGf,UAAa,KACZ,CAAC,EAAY,IAGd,EAAC,EAAA,CAAK,GAAI,YACR,EAAC,OAAA,CAAgB,YAAW,SAAU,EAAa,EAAkB,GAClE,aAEH,EAAC,EAAA,CACC,KAAM,EACN,MAAM,mBACN,YAAY,iFACZ,aAAc,WAEb,GACC,EAAA,EAAA,CAAA,SACG,OAAO,KAAK,EAAU,QAAQ,OAAS,EACtC,EAAC,MAAA,CAAI,UAAU,+CACb,EAAC,IAAA,CAAE,UAAU,uDAA8C,6CAC3D,EAAC,MAAA,CAAI,UAAU,mCACZ,OAAO,QAAQ,EAAU,QAAQ,KAAK,CAAC,KACtC,EAAC,EAAA,CAEC,OAAQ,EAAU,OAClB,KAAM,EACN,QAAS,CAAE,cAEP,EAAA,EAAA,CAAA,SACG,EACG,OAAO,QAAQ,GAAU,KAAK,CAAC,EAAM,KAEjC,EAAC,MAAA,CAAe,UAAU,yFACxB,EAAC,EAAA,CAAgB,KAAM,GAAI,UAAU,2CACrC,EAAC,IAAA,CAAE,UAAU,yCAAiC,MAFtC,IAMd,QAfL,SAwBb,EAAC,IAAA,CAAE,UAAU,yCAAgC"}
@@ -1,2 +1,2 @@
1
- const e=require(`./chunk-CUT6urMc.cjs`),t=require(`./error-dialog-BkCaUR7F.cjs`),n=require(`./form-CaxhlWxK.cjs`),r=e.__toESM(require(`lucide-react`)),i=e.__toESM(require(`react/jsx-runtime`)),a=e.__toESM(require(`react`)),o=e.__toESM(require(`react-hook-form`)),s=e.__toESM(require(`@hookform/error-message`)),c=({form:e,isResetAfterSubmit:c=!0,className:l,onSubmit:u,onError:d,onSubcribe:f,children:p})=>{let m=(0,o.useForm)({...e,criteriaMode:`all`}),{formState:h,reset:g,handleSubmit:_,subscribe:v}=m,{dirtyFields:y}=h,[b,x]=(0,a.useState)(!1),S=(0,a.useCallback)(e=>{u(e,h,y),c&&g()},[y,h,c,u,g]),C=(0,a.useCallback)(e=>{let t=Object.keys(e);t.length!==0&&(d?.(e),x(!0))},[d]);return(0,a.useEffect)(()=>{if(!f)return;let e=v({formState:{values:!0},callback:({values:e})=>{f(e)}});return()=>e()},[f,v]),(0,i.jsxs)(n.Form,{...m,children:[(0,i.jsx)(`form`,{className:l,onSubmit:_(S,C),children:p}),(0,i.jsx)(t.ErrorDialog,{open:b,title:`Lỗi nhập dữ liệu`,description:`An unexpected error has occurred. Please check the errors below and try again.`,onOpenChange:x,children:b&&(0,i.jsx)(i.Fragment,{children:Object.keys(h.errors).length>0?(0,i.jsxs)(`div`,{className:`flex max-w-100 flex-col gap-2 px-4`,children:[(0,i.jsx)(`p`,{className:`text-muted-foreground text-sm font-semibold`,children:`Cảnh báo: Vui lòng kiểm tra các lỗi sau:`}),(0,i.jsx)(`div`,{className:`flex flex-col space-y-1`,children:Object.entries(h.errors).map(([e])=>(0,i.jsx)(s.ErrorMessage,{errors:h.errors,name:e,render:({messages:e})=>(0,i.jsx)(i.Fragment,{children:e?Object.entries(e).map(([e,t])=>(0,i.jsxs)(`div`,{className:`text-accent-foreground flex items-start gap-x-1 truncate text-sm font-normal`,children:[(0,i.jsx)(r.AlertCircleIcon,{size:16,className:`text-destructive mt-0.5 min-w-4 flex-0`}),(0,i.jsx)(`p`,{className:`line-clamp-2 flex-1 text-wrap`,children:t})]},e)):null})},e))})]}):(0,i.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`No errors found.`})})})]})};Object.defineProperty(exports,`FormWrapper`,{enumerable:!0,get:function(){return c}});
2
- //# sourceMappingURL=form-wrapper-BUkoh-c7.cjs.map
1
+ const e=require(`./chunk-CUT6urMc.cjs`),t=require(`./error-dialog-DJwjY5C8.cjs`),n=require(`./form-A2qAueDp.cjs`),r=e.__toESM(require(`lucide-react`)),i=e.__toESM(require(`react/jsx-runtime`)),a=e.__toESM(require(`react`)),o=e.__toESM(require(`react-hook-form`)),s=e.__toESM(require(`@hookform/error-message`)),c=({form:e,isResetAfterSubmit:c=!0,className:l,onSubmit:u,onError:d,onSubcribe:f,children:p})=>{let m=(0,o.useForm)({...e,criteriaMode:`all`}),{formState:h,reset:g,handleSubmit:_,subscribe:v}=m,{dirtyFields:y}=h,[b,x]=(0,a.useState)(!1),S=(0,a.useCallback)(e=>{u(e,h,y),c&&g()},[y,h,c,u,g]),C=(0,a.useCallback)(e=>{let t=Object.keys(e);t.length!==0&&(d?.(e),x(!0))},[d]);return(0,a.useEffect)(()=>{if(!f)return;let e=v({formState:{values:!0},callback:({values:e})=>{f(e)}});return()=>e()},[f,v]),(0,i.jsxs)(n.Form,{...m,children:[(0,i.jsx)(`form`,{className:l,onSubmit:_(S,C),children:p}),(0,i.jsx)(t.ErrorDialog,{open:b,title:`Lỗi nhập dữ liệu`,description:`An unexpected error has occurred. Please check the errors below and try again.`,onOpenChange:x,children:b&&(0,i.jsx)(i.Fragment,{children:Object.keys(h.errors).length>0?(0,i.jsxs)(`div`,{className:`flex max-w-100 flex-col gap-2 px-4`,children:[(0,i.jsx)(`p`,{className:`text-muted-foreground text-sm font-semibold`,children:`Cảnh báo: Vui lòng kiểm tra các lỗi sau:`}),(0,i.jsx)(`div`,{className:`flex flex-col space-y-1`,children:Object.entries(h.errors).map(([e])=>(0,i.jsx)(s.ErrorMessage,{errors:h.errors,name:e,render:({messages:e})=>(0,i.jsx)(i.Fragment,{children:e?Object.entries(e).map(([e,t])=>(0,i.jsxs)(`div`,{className:`text-accent-foreground flex items-start gap-x-1 truncate text-sm font-normal`,children:[(0,i.jsx)(r.AlertCircleIcon,{size:16,className:`text-destructive mt-0.5 min-w-4 flex-0`}),(0,i.jsx)(`p`,{className:`line-clamp-2 flex-1 text-wrap`,children:t})]},e)):null})},e))})]}):(0,i.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`No errors found.`})})})]})};Object.defineProperty(exports,`FormWrapper`,{enumerable:!0,get:function(){return c}});
2
+ //# sourceMappingURL=form-wrapper-p2OwxpA0.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-wrapper-BUkoh-c7.cjs","names":["Form","ErrorDialog","ErrorMessage","AlertCircleIcon"],"sources":["../packages/components/forms/form-wrapper.tsx"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react'\nimport { type FieldValues, type FormState, type SubmitErrorHandler, type SubmitHandler, useForm, type UseFormProps } from 'react-hook-form'\n\nimport { AlertCircleIcon } from 'lucide-react'\n\nimport type { AnyEntity } from '@/types'\nimport { ErrorMessage } from '@hookform/error-message'\n\nimport { ErrorDialog } from '../dialogs/error-dialog'\nimport { Form } from '../ui/form'\n\ntype Props<TFieldValues extends FieldValues = FieldValues> = {\n form: UseFormProps<TFieldValues>\n isResetAfterSubmit?: boolean\n className?: string\n onSubmit: (data: TFieldValues, formState: FormState<FieldValues>, dirtyFields: FormState<FieldValues>['dirtyFields']) => void | Promise<void>\n onError?: SubmitErrorHandler<TFieldValues>\n onSubcribe?: (values: TFieldValues) => void\n}\n\nexport const FormWrapper = <TFieldValues extends FieldValues = FieldValues>({\n form: FormConfig,\n isResetAfterSubmit = true,\n className,\n onSubmit,\n onError,\n onSubcribe,\n children,\n}: React.PropsWithChildren<Props<TFieldValues>>) => {\n const form = useForm({\n ...FormConfig,\n criteriaMode: 'all',\n })\n\n const { formState, reset, handleSubmit, subscribe } = form\n const { dirtyFields } = formState\n\n const [errorOpen, setErrorOpen] = useState<boolean>(false)\n\n const handleFormSubmit = useCallback<SubmitHandler<TFieldValues>>(\n (data) => {\n onSubmit(data, formState, dirtyFields)\n if (isResetAfterSubmit) {\n reset()\n }\n },\n [dirtyFields, formState, isResetAfterSubmit, onSubmit, reset],\n )\n\n const handleFormError = useCallback<SubmitErrorHandler<TFieldValues>>(\n (errors) => {\n const errorKeys = Object.keys(errors)\n if (errorKeys.length === 0) return\n onError?.(errors)\n setErrorOpen(true)\n },\n [onError],\n )\n\n useEffect(() => {\n if (!onSubcribe) return\n const callback = subscribe({\n formState: { values: true },\n callback: ({ values }) => {\n onSubcribe(values)\n },\n })\n return () => callback()\n }, [onSubcribe, subscribe])\n\n return (\n <Form {...form}>\n <form className={className} onSubmit={handleSubmit(handleFormSubmit, handleFormError)}>\n {children}\n </form>\n <ErrorDialog\n open={errorOpen}\n title=\"Lỗi nhập dữ liệu\"\n description=\"An unexpected error has occurred. Please check the errors below and try again.\"\n onOpenChange={setErrorOpen}\n >\n {errorOpen && (\n <>\n {Object.keys(formState.errors).length > 0 ? (\n <div className=\"flex max-w-100 flex-col gap-2 px-4\">\n <p className=\"text-muted-foreground text-sm font-semibold\">Cảnh báo: Vui lòng kiểm tra các lỗi sau:</p>\n <div className=\"flex flex-col space-y-1\">\n {Object.entries(formState.errors).map(([key]) => (\n <ErrorMessage\n key={key}\n errors={formState.errors}\n name={key as AnyEntity}\n render={({ messages }) => {\n return (\n <>\n {messages\n ? Object.entries(messages).map(([type, message]) => {\n return (\n <div key={type} className=\"text-accent-foreground flex items-start gap-x-1 truncate text-sm font-normal\">\n <AlertCircleIcon size={16} className=\"text-destructive mt-0.5 min-w-4 flex-0\" />\n <p className=\"line-clamp-2 flex-1 text-wrap\">{message}</p>\n </div>\n )\n })\n : null}\n </>\n )\n }}\n />\n ))}\n </div>\n </div>\n ) : (\n <p className=\"text-muted-foreground text-sm\">No errors found.</p>\n )}\n </>\n )}\n </ErrorDialog>\n </Form>\n )\n}\n"],"mappings":"uTAoBa,GAA+D,CAC1E,KAAM,EACN,qBAAqB,GACrB,YACA,WACA,UACA,aACA,cACkD,CAClD,IAAM,GAAA,EAAA,EAAA,SAAe,CACnB,GAAG,EACH,aAAc,QAGV,CAAE,YAAW,QAAO,eAAc,aAAc,EAChD,CAAE,eAAgB,EAElB,CAAC,EAAW,IAAA,EAAA,EAAA,UAAkC,IAE9C,GAAA,EAAA,EAAA,aACH,GAAS,CACR,EAAS,EAAM,EAAW,GACtB,GACF,KAGJ,CAAC,EAAa,EAAW,EAAoB,EAAU,IAGnD,GAAA,EAAA,EAAA,aACH,GAAW,CACV,IAAM,EAAY,OAAO,KAAK,GAC1B,EAAU,SAAW,IACzB,IAAU,GACV,EAAa,MAEf,CAAC,IAcH,OAXA,EAAA,EAAA,eAAgB,CACd,GAAI,CAAC,EAAY,OACjB,IAAM,EAAW,EAAU,CACzB,UAAW,CAAE,OAAQ,IACrB,UAAW,CAAE,YAAa,CACxB,EAAW,MAGf,UAAa,KACZ,CAAC,EAAY,KAGd,EAAA,EAAA,MAACA,EAAAA,KAAAA,CAAK,GAAI,aACR,EAAA,EAAA,KAAC,OAAA,CAAgB,YAAW,SAAU,EAAa,EAAkB,GAClE,cAEH,EAAA,EAAA,KAACC,EAAAA,YAAAA,CACC,KAAM,EACN,MAAM,mBACN,YAAY,iFACZ,aAAc,WAEb,IACC,EAAA,EAAA,KAAA,EAAA,SAAA,CAAA,SACG,OAAO,KAAK,EAAU,QAAQ,OAAS,GACtC,EAAA,EAAA,MAAC,MAAA,CAAI,UAAU,gDACb,EAAA,EAAA,KAAC,IAAA,CAAE,UAAU,uDAA8C,8CAC3D,EAAA,EAAA,KAAC,MAAA,CAAI,UAAU,mCACZ,OAAO,QAAQ,EAAU,QAAQ,KAAK,CAAC,MACtC,EAAA,EAAA,KAACC,EAAAA,aAAAA,CAEC,OAAQ,EAAU,OAClB,KAAM,EACN,QAAS,CAAE,eAEP,EAAA,EAAA,KAAA,EAAA,SAAA,CAAA,SACG,EACG,OAAO,QAAQ,GAAU,KAAK,CAAC,EAAM,MAEjC,EAAA,EAAA,MAAC,MAAA,CAAe,UAAU,0FACxB,EAAA,EAAA,KAACC,EAAAA,gBAAAA,CAAgB,KAAM,GAAI,UAAU,4CACrC,EAAA,EAAA,KAAC,IAAA,CAAE,UAAU,yCAAiC,MAFtC,IAMd,QAfL,UAwBb,EAAA,EAAA,KAAC,IAAA,CAAE,UAAU,yCAAgC"}
1
+ {"version":3,"file":"form-wrapper-p2OwxpA0.cjs","names":["Form","ErrorDialog","ErrorMessage","AlertCircleIcon"],"sources":["../packages/components/forms/form-wrapper.tsx"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react'\nimport { type FieldValues, type FormState, type SubmitErrorHandler, type SubmitHandler, useForm, type UseFormProps } from 'react-hook-form'\n\nimport { AlertCircleIcon } from 'lucide-react'\n\nimport type { AnyEntity } from '@/types'\nimport { ErrorMessage } from '@hookform/error-message'\n\nimport { ErrorDialog } from '../dialogs/error-dialog'\nimport { Form } from '../ui/form'\n\ntype Props<TFieldValues extends FieldValues = FieldValues> = {\n form: UseFormProps<TFieldValues>\n isResetAfterSubmit?: boolean\n className?: string\n onSubmit: (data: TFieldValues, formState: FormState<FieldValues>, dirtyFields: FormState<FieldValues>['dirtyFields']) => void | Promise<void>\n onError?: SubmitErrorHandler<TFieldValues>\n onSubcribe?: (values: TFieldValues) => void\n}\n\nexport const FormWrapper = <TFieldValues extends FieldValues = FieldValues>({\n form: FormConfig,\n isResetAfterSubmit = true,\n className,\n onSubmit,\n onError,\n onSubcribe,\n children,\n}: React.PropsWithChildren<Props<TFieldValues>>) => {\n const form = useForm({\n ...FormConfig,\n criteriaMode: 'all',\n })\n\n const { formState, reset, handleSubmit, subscribe } = form\n const { dirtyFields } = formState\n\n const [errorOpen, setErrorOpen] = useState<boolean>(false)\n\n const handleFormSubmit = useCallback<SubmitHandler<TFieldValues>>(\n (data) => {\n onSubmit(data, formState, dirtyFields)\n if (isResetAfterSubmit) {\n reset()\n }\n },\n [dirtyFields, formState, isResetAfterSubmit, onSubmit, reset],\n )\n\n const handleFormError = useCallback<SubmitErrorHandler<TFieldValues>>(\n (errors) => {\n const errorKeys = Object.keys(errors)\n if (errorKeys.length === 0) return\n onError?.(errors)\n setErrorOpen(true)\n },\n [onError],\n )\n\n useEffect(() => {\n if (!onSubcribe) return\n const callback = subscribe({\n formState: { values: true },\n callback: ({ values }) => {\n onSubcribe(values)\n },\n })\n return () => callback()\n }, [onSubcribe, subscribe])\n\n return (\n <Form {...form}>\n <form className={className} onSubmit={handleSubmit(handleFormSubmit, handleFormError)}>\n {children}\n </form>\n <ErrorDialog\n open={errorOpen}\n title=\"Lỗi nhập dữ liệu\"\n description=\"An unexpected error has occurred. Please check the errors below and try again.\"\n onOpenChange={setErrorOpen}\n >\n {errorOpen && (\n <>\n {Object.keys(formState.errors).length > 0 ? (\n <div className=\"flex max-w-100 flex-col gap-2 px-4\">\n <p className=\"text-muted-foreground text-sm font-semibold\">Cảnh báo: Vui lòng kiểm tra các lỗi sau:</p>\n <div className=\"flex flex-col space-y-1\">\n {Object.entries(formState.errors).map(([key]) => (\n <ErrorMessage\n key={key}\n errors={formState.errors}\n name={key as AnyEntity}\n render={({ messages }) => {\n return (\n <>\n {messages\n ? Object.entries(messages).map(([type, message]) => {\n return (\n <div key={type} className=\"text-accent-foreground flex items-start gap-x-1 truncate text-sm font-normal\">\n <AlertCircleIcon size={16} className=\"text-destructive mt-0.5 min-w-4 flex-0\" />\n <p className=\"line-clamp-2 flex-1 text-wrap\">{message}</p>\n </div>\n )\n })\n : null}\n </>\n )\n }}\n />\n ))}\n </div>\n </div>\n ) : (\n <p className=\"text-muted-foreground text-sm\">No errors found.</p>\n )}\n </>\n )}\n </ErrorDialog>\n </Form>\n )\n}\n"],"mappings":"uTAoBa,GAA+D,CAC1E,KAAM,EACN,qBAAqB,GACrB,YACA,WACA,UACA,aACA,cACkD,CAClD,IAAM,GAAA,EAAA,EAAA,SAAe,CACnB,GAAG,EACH,aAAc,QAGV,CAAE,YAAW,QAAO,eAAc,aAAc,EAChD,CAAE,eAAgB,EAElB,CAAC,EAAW,IAAA,EAAA,EAAA,UAAkC,IAE9C,GAAA,EAAA,EAAA,aACH,GAAS,CACR,EAAS,EAAM,EAAW,GACtB,GACF,KAGJ,CAAC,EAAa,EAAW,EAAoB,EAAU,IAGnD,GAAA,EAAA,EAAA,aACH,GAAW,CACV,IAAM,EAAY,OAAO,KAAK,GAC1B,EAAU,SAAW,IACzB,IAAU,GACV,EAAa,MAEf,CAAC,IAcH,OAXA,EAAA,EAAA,eAAgB,CACd,GAAI,CAAC,EAAY,OACjB,IAAM,EAAW,EAAU,CACzB,UAAW,CAAE,OAAQ,IACrB,UAAW,CAAE,YAAa,CACxB,EAAW,MAGf,UAAa,KACZ,CAAC,EAAY,KAGd,EAAA,EAAA,MAACA,EAAAA,KAAAA,CAAK,GAAI,aACR,EAAA,EAAA,KAAC,OAAA,CAAgB,YAAW,SAAU,EAAa,EAAkB,GAClE,cAEH,EAAA,EAAA,KAACC,EAAAA,YAAAA,CACC,KAAM,EACN,MAAM,mBACN,YAAY,iFACZ,aAAc,WAEb,IACC,EAAA,EAAA,KAAA,EAAA,SAAA,CAAA,SACG,OAAO,KAAK,EAAU,QAAQ,OAAS,GACtC,EAAA,EAAA,MAAC,MAAA,CAAI,UAAU,gDACb,EAAA,EAAA,KAAC,IAAA,CAAE,UAAU,uDAA8C,8CAC3D,EAAA,EAAA,KAAC,MAAA,CAAI,UAAU,mCACZ,OAAO,QAAQ,EAAU,QAAQ,KAAK,CAAC,MACtC,EAAA,EAAA,KAACC,EAAAA,aAAAA,CAEC,OAAQ,EAAU,OAClB,KAAM,EACN,QAAS,CAAE,eAEP,EAAA,EAAA,KAAA,EAAA,SAAA,CAAA,SACG,EACG,OAAO,QAAQ,GAAU,KAAK,CAAC,EAAM,MAEjC,EAAA,EAAA,MAAC,MAAA,CAAe,UAAU,0FACxB,EAAA,EAAA,KAACC,EAAAA,gBAAAA,CAAgB,KAAM,GAAI,UAAU,4CACrC,EAAA,EAAA,KAAC,IAAA,CAAE,UAAU,yCAAiC,MAFtC,IAMd,QAfL,UAwBb,EAAA,EAAA,KAAC,IAAA,CAAE,UAAU,yCAAgC"}
@@ -1,2 +1,2 @@
1
- "use client";const e=require(`../chunk-CUT6urMc.cjs`),t=require(`../button-119IIVCy.cjs`);require(`../label-BBPPT0-L.cjs`);const n=require(`../form-CaxhlWxK.cjs`);require(`../dialog-CGrbU7PO.cjs`);const r=require(`../command-B9nlrxXh.cjs`),i=require(`../popover-ByL6Igxn.cjs`),a=e.__toESM(require(`lucide-react`)),o=e.__toESM(require(`@customafk/react-toolkit/utils`)),s=e.__toESM(require(`react/jsx-runtime`)),c=({name:e,label:c=`Combobox`,placeholder:l=`Chọn một mục`,description:u,options:d,onAddNewItem:f})=>(0,s.jsx)(n.FormField,{name:e,render:({field:e})=>(0,s.jsxs)(n.FormItem,{className:`w-full`,children:[(0,s.jsx)(n.FormLabel,{children:c}),(0,s.jsxs)(i.Popover,{modal:!0,children:[(0,s.jsx)(i.PopoverTrigger,{asChild:!0,children:(0,s.jsx)(n.FormControl,{children:(0,s.jsxs)(t.Button,{type:`button`,variant:`outline`,role:`combobox`,color:`muted`,className:(0,o.cn)(`shadow-input flex justify-between rounded-md px-3`,`outline-border-weak font-normal`,`[&_div]:w-full`,`[&_div]:justify-between`,`hover:outline-border`,`data-[state=open]:text-text-positive-muted`,`data-[state=open]:outline-1`,`data-[state=open]:outline-primary-strong`,`data-[state=open]:ring-primary-weak`,`data-[state=open]:ring-4`,`focus:border-primary-strong`,`focus:ring-4`,`focus:ring-primary-weak`,`focus:outline-1`,`focus:outline-primary-strong`),children:[e.value?(0,s.jsx)(`span`,{className:`flex min-w-0 items-center gap-2`,children:d?.find(({value:t})=>t===e.value)?.label}):(0,s.jsx)(`span`,{className:`text-text-positive-muted`,children:l}),(0,s.jsx)(a.ChevronDownIcon,{size:16,className:`text-text-positive-weak shrink-0`,"aria-hidden":`true`})]})})}),(0,s.jsx)(i.PopoverContent,{className:`w-[var(--radix-popover-trigger-width)] p-0`,children:(0,s.jsxs)(r.Command,{className:`border-none`,children:[(0,s.jsx)(r.CommandInput,{placeholder:l??`Tìm kiếm`}),(0,s.jsxs)(r.CommandList,{children:[(0,s.jsx)(r.CommandGroup,{className:`max-h-40 overflow-y-auto`,children:d?.map(({value:t,label:n})=>(0,s.jsx)(r.CommandItem,{value:n,onSelect:()=>e.onChange(t),children:n},t))}),f&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.CommandSeparator,{}),(0,s.jsx)(r.CommandGroup,{children:(0,s.jsxs)(t.Button,{type:`button`,variant:`ghost`,className:`w-full justify-start font-normal`,children:[(0,s.jsx)(a.PlusIcon,{size:14,className:`-ms-2 opacity-60`,"aria-hidden":`true`}),`Thêm mới`]})})]})]}),(0,s.jsx)(r.CommandEmpty,{children:`Không có kết quả`})]})})]}),!!u&&(0,s.jsx)(n.FormDescription,{children:u})]})});exports.ComboboxField=c;
1
+ "use client";const e=require(`../chunk-CUT6urMc.cjs`),t=require(`../button-119IIVCy.cjs`);require(`../label-BM6rVDz-.cjs`);const n=require(`../form-A2qAueDp.cjs`);require(`../dialog-DQ9MCS8A.cjs`);const r=require(`../command-tDhBQnm6.cjs`),i=require(`../popover-Bi7GLJT5.cjs`),a=e.__toESM(require(`lucide-react`)),o=e.__toESM(require(`@customafk/react-toolkit/utils`)),s=e.__toESM(require(`react/jsx-runtime`)),c=({name:e,label:c=`Combobox`,placeholder:l=`Chọn một mục`,description:u,options:d,onAddNewItem:f})=>(0,s.jsx)(n.FormField,{name:e,render:({field:e})=>(0,s.jsxs)(n.FormItem,{className:`w-full`,children:[(0,s.jsx)(n.FormLabel,{children:c}),(0,s.jsxs)(i.Popover,{modal:!0,children:[(0,s.jsx)(i.PopoverTrigger,{asChild:!0,children:(0,s.jsx)(n.FormControl,{children:(0,s.jsxs)(t.Button,{type:`button`,variant:`outline`,role:`combobox`,color:`muted`,className:(0,o.cn)(`shadow-input flex justify-between rounded-md px-3`,`outline-border-weak font-normal`,`[&_div]:w-full`,`[&_div]:justify-between`,`hover:outline-border`,`data-[state=open]:text-text-positive-muted`,`data-[state=open]:outline-1`,`data-[state=open]:outline-primary-strong`,`data-[state=open]:ring-primary-weak`,`data-[state=open]:ring-4`,`focus:border-primary-strong`,`focus:ring-4`,`focus:ring-primary-weak`,`focus:outline-1`,`focus:outline-primary-strong`),children:[e.value?(0,s.jsx)(`span`,{className:`flex min-w-0 items-center gap-2`,children:d?.find(({value:t})=>t===e.value)?.label}):(0,s.jsx)(`span`,{className:`text-text-positive-muted`,children:l}),(0,s.jsx)(a.ChevronDownIcon,{size:16,className:`text-text-positive-weak shrink-0`,"aria-hidden":`true`})]})})}),(0,s.jsx)(i.PopoverContent,{className:`w-[var(--radix-popover-trigger-width)] p-0`,children:(0,s.jsxs)(r.Command,{className:`border-none`,children:[(0,s.jsx)(r.CommandInput,{placeholder:l??`Tìm kiếm`}),(0,s.jsxs)(r.CommandList,{children:[(0,s.jsx)(r.CommandGroup,{className:`max-h-40 overflow-y-auto`,children:d?.map(({value:t,label:n})=>(0,s.jsx)(r.CommandItem,{value:n,onSelect:()=>e.onChange(t),children:n},t))}),f&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.CommandSeparator,{}),(0,s.jsx)(r.CommandGroup,{children:(0,s.jsxs)(t.Button,{type:`button`,variant:`ghost`,className:`w-full justify-start font-normal`,children:[(0,s.jsx)(a.PlusIcon,{size:14,className:`-ms-2 opacity-60`,"aria-hidden":`true`}),`Thêm mới`]})})]})]}),(0,s.jsx)(r.CommandEmpty,{children:`Không có kết quả`})]})})]}),!!u&&(0,s.jsx)(n.FormDescription,{children:u})]})});exports.ComboboxField=c;
2
2
  //# sourceMappingURL=combobox-field.cjs.map
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime3 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime9 from "react/jsx-runtime";
2
2
  import { FieldPath, FieldValues } from "react-hook-form";
3
3
 
4
4
  //#region packages/components/forms/combobox-field.d.ts
@@ -22,7 +22,7 @@ declare const ComboboxField: <TFieldValues extends FieldValues = FieldValues>({
22
22
  description,
23
23
  options,
24
24
  onAddNewItem
25
- }: Props<TFieldValues>) => react_jsx_runtime3.JSX.Element;
25
+ }: Props<TFieldValues>) => react_jsx_runtime9.JSX.Element;
26
26
  //#endregion
27
27
  export { ComboboxField };
28
28
  //# sourceMappingURL=combobox-field.d.cts.map
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime2 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime4 from "react/jsx-runtime";
2
2
  import { FieldPath, FieldValues } from "react-hook-form";
3
3
 
4
4
  //#region packages/components/forms/combobox-field.d.ts
@@ -22,7 +22,7 @@ declare const ComboboxField: <TFieldValues extends FieldValues = FieldValues>({
22
22
  description,
23
23
  options,
24
24
  onAddNewItem
25
- }: Props<TFieldValues>) => react_jsx_runtime2.JSX.Element;
25
+ }: Props<TFieldValues>) => react_jsx_runtime4.JSX.Element;
26
26
  //#endregion
27
27
  export { ComboboxField };
28
28
  //# sourceMappingURL=combobox-field.d.ts.map
@@ -1,2 +1,2 @@
1
- "use client";import{Button as e}from"../button-CvQQTSka.js";import"../label-DdpIoRiG.js";import{FormControl as t,FormDescription as n,FormField as r,FormItem as i,FormLabel as a}from"../form-D-gDMD-J.js";import"../dialog-DbI18XF9.js";import{Command as o,CommandEmpty as s,CommandGroup as c,CommandInput as l,CommandItem as u,CommandList as d,CommandSeparator as f}from"../command-DKD5gHi_.js";import{Popover as p,PopoverContent as m,PopoverTrigger as h}from"../popover-DMt7GPSm.js";import{ChevronDownIcon as g,PlusIcon as _}from"lucide-react";import{cn as v}from"@customafk/react-toolkit/utils";import{Fragment as y,jsx as b,jsxs as x}from"react/jsx-runtime";const S=({name:S,label:C=`Combobox`,placeholder:w=`Chọn một mục`,description:T,options:E,onAddNewItem:D})=>b(r,{name:S,render:({field:r})=>x(i,{className:`w-full`,children:[b(a,{children:C}),x(p,{modal:!0,children:[b(h,{asChild:!0,children:b(t,{children:x(e,{type:`button`,variant:`outline`,role:`combobox`,color:`muted`,className:v(`shadow-input flex justify-between rounded-md px-3`,`outline-border-weak font-normal`,`[&_div]:w-full`,`[&_div]:justify-between`,`hover:outline-border`,`data-[state=open]:text-text-positive-muted`,`data-[state=open]:outline-1`,`data-[state=open]:outline-primary-strong`,`data-[state=open]:ring-primary-weak`,`data-[state=open]:ring-4`,`focus:border-primary-strong`,`focus:ring-4`,`focus:ring-primary-weak`,`focus:outline-1`,`focus:outline-primary-strong`),children:[r.value?b(`span`,{className:`flex min-w-0 items-center gap-2`,children:E?.find(({value:e})=>e===r.value)?.label}):b(`span`,{className:`text-text-positive-muted`,children:w}),b(g,{size:16,className:`text-text-positive-weak shrink-0`,"aria-hidden":`true`})]})})}),b(m,{className:`w-[var(--radix-popover-trigger-width)] p-0`,children:x(o,{className:`border-none`,children:[b(l,{placeholder:w??`Tìm kiếm`}),x(d,{children:[b(c,{className:`max-h-40 overflow-y-auto`,children:E?.map(({value:e,label:t})=>b(u,{value:t,onSelect:()=>r.onChange(e),children:t},e))}),D&&x(y,{children:[b(f,{}),b(c,{children:x(e,{type:`button`,variant:`ghost`,className:`w-full justify-start font-normal`,children:[b(_,{size:14,className:`-ms-2 opacity-60`,"aria-hidden":`true`}),`Thêm mới`]})})]})]}),b(s,{children:`Không có kết quả`})]})})]}),!!T&&b(n,{children:T})]})});export{S as ComboboxField};
1
+ "use client";import{Button as e}from"../button-CvQQTSka.js";import"../label-D4GUfxTB.js";import{FormControl as t,FormDescription as n,FormField as r,FormItem as i,FormLabel as a}from"../form-C4Zn5Meu.js";import"../dialog-DIvrOnbv.js";import{Command as o,CommandEmpty as s,CommandGroup as c,CommandInput as l,CommandItem as u,CommandList as d,CommandSeparator as f}from"../command-BJ6dPKIN.js";import{Popover as p,PopoverContent as m,PopoverTrigger as h}from"../popover-CxOK3oy2.js";import{ChevronDownIcon as g,PlusIcon as _}from"lucide-react";import{cn as v}from"@customafk/react-toolkit/utils";import{Fragment as y,jsx as b,jsxs as x}from"react/jsx-runtime";const S=({name:S,label:C=`Combobox`,placeholder:w=`Chọn một mục`,description:T,options:E,onAddNewItem:D})=>b(r,{name:S,render:({field:r})=>x(i,{className:`w-full`,children:[b(a,{children:C}),x(p,{modal:!0,children:[b(h,{asChild:!0,children:b(t,{children:x(e,{type:`button`,variant:`outline`,role:`combobox`,color:`muted`,className:v(`shadow-input flex justify-between rounded-md px-3`,`outline-border-weak font-normal`,`[&_div]:w-full`,`[&_div]:justify-between`,`hover:outline-border`,`data-[state=open]:text-text-positive-muted`,`data-[state=open]:outline-1`,`data-[state=open]:outline-primary-strong`,`data-[state=open]:ring-primary-weak`,`data-[state=open]:ring-4`,`focus:border-primary-strong`,`focus:ring-4`,`focus:ring-primary-weak`,`focus:outline-1`,`focus:outline-primary-strong`),children:[r.value?b(`span`,{className:`flex min-w-0 items-center gap-2`,children:E?.find(({value:e})=>e===r.value)?.label}):b(`span`,{className:`text-text-positive-muted`,children:w}),b(g,{size:16,className:`text-text-positive-weak shrink-0`,"aria-hidden":`true`})]})})}),b(m,{className:`w-[var(--radix-popover-trigger-width)] p-0`,children:x(o,{className:`border-none`,children:[b(l,{placeholder:w??`Tìm kiếm`}),x(d,{children:[b(c,{className:`max-h-40 overflow-y-auto`,children:E?.map(({value:e,label:t})=>b(u,{value:t,onSelect:()=>r.onChange(e),children:t},e))}),D&&x(y,{children:[b(f,{}),b(c,{children:x(e,{type:`button`,variant:`ghost`,className:`w-full justify-start font-normal`,children:[b(_,{size:14,className:`-ms-2 opacity-60`,"aria-hidden":`true`}),`Thêm mới`]})})]})]}),b(s,{children:`Không có kết quả`})]})})]}),!!T&&b(n,{children:T})]})});export{S as ComboboxField};
2
2
  //# sourceMappingURL=combobox-field.js.map
@@ -1,2 +1,2 @@
1
- "use client";const e=require(`../chunk-CUT6urMc.cjs`),t=require(`../button-119IIVCy.cjs`);require(`../label-BBPPT0-L.cjs`);const n=require(`../form-CaxhlWxK.cjs`),r=require(`../popover-ByL6Igxn.cjs`),i=require(`../calendar-CUDdTiC-.cjs`),a=e.__toESM(require(`lucide-react`)),o=e.__toESM(require(`@customafk/react-toolkit/utils`)),s=e.__toESM(require(`react/jsx-runtime`)),c=e.__toESM(require(`@customafk/react-toolkit/date-fns`)),l=({name:e,label:l=`Date Field`,placeholder:u=`Select a date`,description:d=``,isShowErrorMsg:f=!1})=>(0,s.jsx)(n.FormField,{name:e,render:({field:e})=>(0,s.jsxs)(n.FormItem,{className:`w-full`,children:[(0,s.jsx)(n.FormLabel,{children:l}),(0,s.jsxs)(r.Popover,{modal:!0,children:[(0,s.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,s.jsx)(n.FormControl,{children:(0,s.jsxs)(t.Button,{variant:`outline`,color:`muted`,className:(0,o.cn)(`w-full pl-3 text-left font-normal`,`outline-border-weak font-normal`,`hover:outline-border`,`data-[state=open]:text-text-positive-muted`,`data-[state=open]:outline-1`,`data-[state=open]:outline-primary-strong`,`data-[state=open]:ring-primary-weak`,`data-[state=open]:ring-4`,`focus:border-primary-strong`,`focus:ring-4`,`focus:ring-primary-weak`,`focus:outline-1`,`focus:outline-primary-strong`,!e.value&&`text-text-positive-muted`),children:[e.value?(0,c.format)(e.value,`PPP`):(0,s.jsxs)(`span`,{children:[` `,u||`Pick a date`]}),(0,s.jsx)(a.CalendarIcon,{className:`text-text-positive-weak ml-auto size-4`})]})})}),(0,s.jsx)(r.PopoverContent,{className:`w-auto p-0`,align:`start`,children:(0,s.jsx)(i.Calendar,{mode:`single`,selected:e.value,onSelect:t=>{e.onChange(t?.toISOString())},captionLayout:`dropdown`,disabled:e=>e<new Date(`2022-01-01`)})})]}),!!d&&(0,s.jsx)(n.FormDescription,{children:d}),f&&(0,s.jsx)(n.FormMessage,{})]})});exports.DateField=l;
1
+ "use client";const e=require(`../chunk-CUT6urMc.cjs`),t=require(`../button-119IIVCy.cjs`);require(`../label-BM6rVDz-.cjs`);const n=require(`../form-A2qAueDp.cjs`),r=require(`../popover-Bi7GLJT5.cjs`),i=require(`../calendar-B6F_Lppz.cjs`),a=e.__toESM(require(`lucide-react`)),o=e.__toESM(require(`@customafk/react-toolkit/utils`)),s=e.__toESM(require(`react/jsx-runtime`)),c=e.__toESM(require(`@customafk/react-toolkit/date-fns`)),l=({name:e,label:l=`Date Field`,placeholder:u=`Select a date`,description:d=``,isShowErrorMsg:f=!1})=>(0,s.jsx)(n.FormField,{name:e,render:({field:e})=>(0,s.jsxs)(n.FormItem,{className:`w-full`,children:[(0,s.jsx)(n.FormLabel,{children:l}),(0,s.jsxs)(r.Popover,{modal:!0,children:[(0,s.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,s.jsx)(n.FormControl,{children:(0,s.jsxs)(t.Button,{variant:`outline`,color:`muted`,className:(0,o.cn)(`w-full pl-3 text-left font-normal`,`outline-border-weak font-normal`,`hover:outline-border`,`data-[state=open]:text-text-positive-muted`,`data-[state=open]:outline-1`,`data-[state=open]:outline-primary-strong`,`data-[state=open]:ring-primary-weak`,`data-[state=open]:ring-4`,`focus:border-primary-strong`,`focus:ring-4`,`focus:ring-primary-weak`,`focus:outline-1`,`focus:outline-primary-strong`,!e.value&&`text-text-positive-muted`),children:[e.value?(0,c.format)(e.value,`PPP`):(0,s.jsxs)(`span`,{children:[` `,u||`Pick a date`]}),(0,s.jsx)(a.CalendarIcon,{className:`text-text-positive-weak ml-auto size-4`})]})})}),(0,s.jsx)(r.PopoverContent,{className:`w-auto p-0`,align:`start`,children:(0,s.jsx)(i.Calendar,{mode:`single`,selected:e.value,onSelect:t=>{e.onChange(t?.toISOString())},captionLayout:`dropdown`,disabled:e=>e<new Date(`2022-01-01`)})})]}),!!d&&(0,s.jsx)(n.FormDescription,{children:d}),f&&(0,s.jsx)(n.FormMessage,{})]})});exports.DateField=l;
2
2
  //# sourceMappingURL=date-field.cjs.map
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime2 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime5 from "react/jsx-runtime";
2
2
  import { FieldPath, FieldValues } from "react-hook-form";
3
3
 
4
4
  //#region packages/components/forms/date-field.d.ts
@@ -16,7 +16,7 @@ declare const DateField: <TFieldValues extends FieldValues = FieldValues>({
16
16
  placeholder,
17
17
  description,
18
18
  isShowErrorMsg
19
- }: Props<TFieldValues>) => react_jsx_runtime2.JSX.Element;
19
+ }: Props<TFieldValues>) => react_jsx_runtime5.JSX.Element;
20
20
  //#endregion
21
21
  export { DateField };
22
22
  //# sourceMappingURL=date-field.d.cts.map
@@ -1,2 +1,2 @@
1
- "use client";import{Button as e}from"../button-CvQQTSka.js";import"../label-DdpIoRiG.js";import{FormControl as t,FormDescription as n,FormField as r,FormItem as i,FormLabel as a,FormMessage as o}from"../form-D-gDMD-J.js";import{Popover as s,PopoverContent as c,PopoverTrigger as l}from"../popover-DMt7GPSm.js";import{Calendar as u}from"../calendar-BZRNZdsJ.js";import{CalendarIcon as d}from"lucide-react";import{cn as f}from"@customafk/react-toolkit/utils";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{format as h}from"@customafk/react-toolkit/date-fns";const g=({name:g,label:_=`Date Field`,placeholder:v=`Select a date`,description:y=``,isShowErrorMsg:b=!1})=>p(r,{name:g,render:({field:r})=>m(i,{className:`w-full`,children:[p(a,{children:_}),m(s,{modal:!0,children:[p(l,{asChild:!0,children:p(t,{children:m(e,{variant:`outline`,color:`muted`,className:f(`w-full pl-3 text-left font-normal`,`outline-border-weak font-normal`,`hover:outline-border`,`data-[state=open]:text-text-positive-muted`,`data-[state=open]:outline-1`,`data-[state=open]:outline-primary-strong`,`data-[state=open]:ring-primary-weak`,`data-[state=open]:ring-4`,`focus:border-primary-strong`,`focus:ring-4`,`focus:ring-primary-weak`,`focus:outline-1`,`focus:outline-primary-strong`,!r.value&&`text-text-positive-muted`),children:[r.value?h(r.value,`PPP`):m(`span`,{children:[` `,v||`Pick a date`]}),p(d,{className:`text-text-positive-weak ml-auto size-4`})]})})}),p(c,{className:`w-auto p-0`,align:`start`,children:p(u,{mode:`single`,selected:r.value,onSelect:e=>{r.onChange(e?.toISOString())},captionLayout:`dropdown`,disabled:e=>e<new Date(`2022-01-01`)})})]}),!!y&&p(n,{children:y}),b&&p(o,{})]})});export{g as DateField};
1
+ "use client";import{Button as e}from"../button-CvQQTSka.js";import"../label-D4GUfxTB.js";import{FormControl as t,FormDescription as n,FormField as r,FormItem as i,FormLabel as a,FormMessage as o}from"../form-C4Zn5Meu.js";import{Popover as s,PopoverContent as c,PopoverTrigger as l}from"../popover-CxOK3oy2.js";import{Calendar as u}from"../calendar-CXddeN7A.js";import{CalendarIcon as d}from"lucide-react";import{cn as f}from"@customafk/react-toolkit/utils";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{format as h}from"@customafk/react-toolkit/date-fns";const g=({name:g,label:_=`Date Field`,placeholder:v=`Select a date`,description:y=``,isShowErrorMsg:b=!1})=>p(r,{name:g,render:({field:r})=>m(i,{className:`w-full`,children:[p(a,{children:_}),m(s,{modal:!0,children:[p(l,{asChild:!0,children:p(t,{children:m(e,{variant:`outline`,color:`muted`,className:f(`w-full pl-3 text-left font-normal`,`outline-border-weak font-normal`,`hover:outline-border`,`data-[state=open]:text-text-positive-muted`,`data-[state=open]:outline-1`,`data-[state=open]:outline-primary-strong`,`data-[state=open]:ring-primary-weak`,`data-[state=open]:ring-4`,`focus:border-primary-strong`,`focus:ring-4`,`focus:ring-primary-weak`,`focus:outline-1`,`focus:outline-primary-strong`,!r.value&&`text-text-positive-muted`),children:[r.value?h(r.value,`PPP`):m(`span`,{children:[` `,v||`Pick a date`]}),p(d,{className:`text-text-positive-weak ml-auto size-4`})]})})}),p(c,{className:`w-auto p-0`,align:`start`,children:p(u,{mode:`single`,selected:r.value,onSelect:e=>{r.onChange(e?.toISOString())},captionLayout:`dropdown`,disabled:e=>e<new Date(`2022-01-01`)})})]}),!!y&&p(n,{children:y}),b&&p(o,{})]})});export{g as DateField};
2
2
  //# sourceMappingURL=date-field.js.map
@@ -1 +1 @@
1
- require(`../button-119IIVCy.cjs`),require(`../alert-dialog-lwTxSl-r.cjs`),require(`../error-dialog-BkCaUR7F.cjs`),require(`../label-BBPPT0-L.cjs`),require(`../form-CaxhlWxK.cjs`);const e=require(`../form-wrapper-BUkoh-c7.cjs`);exports.FormWrapper=e.FormWrapper;
1
+ require(`../button-119IIVCy.cjs`),require(`../alert-dialog-CAeBwm2W.cjs`),require(`../error-dialog-DJwjY5C8.cjs`),require(`../label-BM6rVDz-.cjs`),require(`../form-A2qAueDp.cjs`);const e=require(`../form-wrapper-p2OwxpA0.cjs`);exports.FormWrapper=e.FormWrapper;
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime63 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
2
  import { FieldValues, FormState, SubmitErrorHandler, UseFormProps } from "react-hook-form";
3
3
 
4
4
  //#region packages/components/forms/form-wrapper.d.ts
@@ -18,7 +18,7 @@ declare const FormWrapper: <TFieldValues extends FieldValues = FieldValues>({
18
18
  onError,
19
19
  onSubcribe,
20
20
  children
21
- }: React.PropsWithChildren<Props<TFieldValues>>) => react_jsx_runtime63.JSX.Element;
21
+ }: React.PropsWithChildren<Props<TFieldValues>>) => react_jsx_runtime0.JSX.Element;
22
22
  //#endregion
23
23
  export { FormWrapper };
24
24
  //# sourceMappingURL=form-wrapper.d.cts.map
@@ -1 +1 @@
1
- import"../button-CvQQTSka.js";import"../alert-dialog-BOMy-TmT.js";import"../error-dialog-D3tnycqF.js";import"../label-DdpIoRiG.js";import"../form-D-gDMD-J.js";import{FormWrapper as e}from"../form-wrapper-BbScjpBv.js";export{e as FormWrapper};
1
+ import"../button-CvQQTSka.js";import"../alert-dialog-BELDR1IC.js";import"../error-dialog-DFfdCNGJ.js";import"../label-D4GUfxTB.js";import"../form-C4Zn5Meu.js";import{FormWrapper as e}from"../form-wrapper-BvnGERhM.js";export{e as FormWrapper};
@@ -1,2 +1,2 @@
1
- "use client";const e=require(`../chunk-CUT6urMc.cjs`);require(`../button-119IIVCy.cjs`),require(`../label-BBPPT0-L.cjs`);const t=require(`../form-CaxhlWxK.cjs`);require(`../dialog-CGrbU7PO.cjs`),require(`../command-B9nlrxXh.cjs`);const n=require(`../multi-select-BAXHYtlU.cjs`),r=e.__toESM(require(`react/jsx-runtime`)),i=({name:e,label:i=`Multi Select Field`,isShowLabel:a=!0,isShowErrorMsg:o,placeholder:s=`Select options`,description:c=``,options:l=[],onAdd:u})=>(0,r.jsx)(t.FormField,{name:e,render:({field:{value:e,onChange:d}})=>{let f=l.filter(t=>e?.includes(t.value)),p=e=>{let t=e.map(e=>e.value);d(t)};return(0,r.jsxs)(t.FormItem,{className:`w-full gap-0`,children:[a&&(0,r.jsx)(t.FormLabel,{children:i}),(0,r.jsx)(t.FormControl,{children:(0,r.jsx)(n.MultipleSelector,{placeholder:s,emptyIndicator:`No options available`,value:f,options:l,onChange:p,onAddNewItem:u})}),!!c&&(0,r.jsx)(t.FormDescription,{children:c}),o&&(0,r.jsx)(t.FormMessage,{})]})}});exports.MultiSelectField=i;
1
+ "use client";const e=require(`../chunk-CUT6urMc.cjs`);require(`../button-119IIVCy.cjs`),require(`../label-BM6rVDz-.cjs`);const t=require(`../form-A2qAueDp.cjs`);require(`../dialog-DQ9MCS8A.cjs`),require(`../command-tDhBQnm6.cjs`);const n=require(`../multi-select-BGoJRW7y.cjs`),r=e.__toESM(require(`react/jsx-runtime`)),i=({name:e,label:i=`Multi Select Field`,isShowLabel:a=!0,isShowErrorMsg:o,placeholder:s=`Select options`,description:c=``,options:l=[],onAdd:u})=>(0,r.jsx)(t.FormField,{name:e,render:({field:{value:e,onChange:d}})=>{let f=l.filter(t=>e?.includes(t.value)),p=e=>{let t=e.map(e=>e.value);d(t)};return(0,r.jsxs)(t.FormItem,{className:`w-full gap-0`,children:[a&&(0,r.jsx)(t.FormLabel,{children:i}),(0,r.jsx)(t.FormControl,{children:(0,r.jsx)(n.MultipleSelector,{placeholder:s,emptyIndicator:`No options available`,value:f,options:l,onChange:p,onAddNewItem:u})}),!!c&&(0,r.jsx)(t.FormDescription,{children:c}),o&&(0,r.jsx)(t.FormMessage,{})]})}});exports.MultiSelectField=i;
2
2
  //# sourceMappingURL=multi-select-field.cjs.map
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime5 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime2 from "react/jsx-runtime";
2
2
  import { FieldPath, FieldValues } from "react-hook-form";
3
3
 
4
4
  //#region packages/components/forms/multi-select-field.d.ts
@@ -24,7 +24,7 @@ declare const MultiSelectField: <TFieldValues extends FieldValues = FieldValues>
24
24
  description,
25
25
  options,
26
26
  onAdd
27
- }: Props<TFieldValues>) => react_jsx_runtime5.JSX.Element;
27
+ }: Props<TFieldValues>) => react_jsx_runtime2.JSX.Element;
28
28
  //#endregion
29
29
  export { MultiSelectField };
30
30
  //# sourceMappingURL=multi-select-field.d.cts.map
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime8 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime5 from "react/jsx-runtime";
2
2
  import { FieldPath, FieldValues } from "react-hook-form";
3
3
 
4
4
  //#region packages/components/forms/multi-select-field.d.ts
@@ -24,7 +24,7 @@ declare const MultiSelectField: <TFieldValues extends FieldValues = FieldValues>
24
24
  description,
25
25
  options,
26
26
  onAdd
27
- }: Props<TFieldValues>) => react_jsx_runtime8.JSX.Element;
27
+ }: Props<TFieldValues>) => react_jsx_runtime5.JSX.Element;
28
28
  //#endregion
29
29
  export { MultiSelectField };
30
30
  //# sourceMappingURL=multi-select-field.d.ts.map
@@ -1,2 +1,2 @@
1
- "use client";import"../button-CvQQTSka.js";import"../label-DdpIoRiG.js";import{FormControl as e,FormDescription as t,FormField as n,FormItem as r,FormLabel as i,FormMessage as a}from"../form-D-gDMD-J.js";import"../dialog-DbI18XF9.js";import"../command-DKD5gHi_.js";import{MultipleSelector as o}from"../multi-select-oXuLHx0A.js";import{jsx as s,jsxs as c}from"react/jsx-runtime";const l=({name:l,label:u=`Multi Select Field`,isShowLabel:d=!0,isShowErrorMsg:f,placeholder:p=`Select options`,description:m=``,options:h=[],onAdd:g})=>s(n,{name:l,render:({field:{value:n,onChange:l}})=>{let _=h.filter(e=>n?.includes(e.value)),v=e=>{let t=e.map(e=>e.value);l(t)};return c(r,{className:`w-full gap-0`,children:[d&&s(i,{children:u}),s(e,{children:s(o,{placeholder:p,emptyIndicator:`No options available`,value:_,options:h,onChange:v,onAddNewItem:g})}),!!m&&s(t,{children:m}),f&&s(a,{})]})}});export{l as MultiSelectField};
1
+ "use client";import"../button-CvQQTSka.js";import"../label-D4GUfxTB.js";import{FormControl as e,FormDescription as t,FormField as n,FormItem as r,FormLabel as i,FormMessage as a}from"../form-C4Zn5Meu.js";import"../dialog-DIvrOnbv.js";import"../command-BJ6dPKIN.js";import{MultipleSelector as o}from"../multi-select-B5ACggbh.js";import{jsx as s,jsxs as c}from"react/jsx-runtime";const l=({name:l,label:u=`Multi Select Field`,isShowLabel:d=!0,isShowErrorMsg:f,placeholder:p=`Select options`,description:m=``,options:h=[],onAdd:g})=>s(n,{name:l,render:({field:{value:n,onChange:l}})=>{let _=h.filter(e=>n?.includes(e.value)),v=e=>{let t=e.map(e=>e.value);l(t)};return c(r,{className:`w-full gap-0`,children:[d&&s(i,{children:u}),s(e,{children:s(o,{placeholder:p,emptyIndicator:`No options available`,value:_,options:h,onChange:v,onAddNewItem:g})}),!!m&&s(t,{children:m}),f&&s(a,{})]})}});export{l as MultiSelectField};
2
2
  //# sourceMappingURL=multi-select-field.js.map
@@ -1,2 +1,2 @@
1
- const e=require(`../chunk-CUT6urMc.cjs`);require(`../label-BBPPT0-L.cjs`);const t=require(`../form-CaxhlWxK.cjs`),n=require(`../input-ERPHY3v4.cjs`),r=e.__toESM(require(`@customafk/react-toolkit/utils`)),i=e.__toESM(require(`react/jsx-runtime`)),a=e.__toESM(require(`react`)),o=e.__toESM(require(`react-hook-form`)),s=e=>e?/^-?\d*\.?\d*$/:/^\d*\.?\d*$/,c=e=>Number(e).toLocaleString(),l=({disabled:e=!1,readonly:t=!1,allowNegative:o=!1,numberAfterDecimalPoint:l=2,roundingRule:u=`none`,value:d=``,unitText:f,decimal:p,placeholder:m,precision:h,onChange:g,onValueChange:_,onBlur:v,...y})=>{let b=(0,a.useRef)(null),x=(0,a.useRef)(null),[S,C]=(0,a.useState)(d.toString()),w=p?.[1]??l,T=p&&p[0]-p[1],E=(0,a.useMemo)(()=>s(o),[o]),D=(0,a.useCallback)(e=>{if(!w&&e.includes(`.`))return!1;let t=e.split(`.`)[1];return!t||t.length<=w},[w]),O=(0,a.useCallback)(e=>{if(!p||e===`-`)return!0;let[t,n=``]=e.split(`.`);return n.length<=p[1]&&(t.startsWith(`-`)?t.length-1:t.length)<=T},[p,T]),k=(0,a.useCallback)((e,t)=>{if(u===`none`)return e;let n=Math.pow(10,t),r=e*n;switch(u){case`up`:return Math.ceil(r)/n;case`down`:return Math.floor(r)/n;case`nearest`:return r%1<.1?Math.floor(r)/n:r%1>=.59?Math.ceil(r)/n:(Math.floor(r)+.5)/n;default:return e}},[u]),A=(0,a.useCallback)(e=>!l&&e.includes(`.`)||e.split(`.`)[1]?.length>l,[l]),j=(0,a.useCallback)(e=>{if(e===`0`)return`0`;if(!Number(e))return``;let t=parseFloat(e),n=Math.min(w-1,h||0),r=k(t,n).toString(),[i,a=``]=r.split(`.`),o=c(i);return a?`${o}.${a}`:o},[k,w,h]),M=(0,a.useCallback)(e=>{if(!p||e===`-`)return!0;let[t,n=``]=e.split(`.`),r=t.startsWith(`-`)?t.length-1:t.length,i=p[0]-p[1];return n.length<=p[1]&&r<=i},[p]),N=(0,a.useCallback)(e=>{g?.(e);let{value:t}=e.target;if(!t){_?.(void 0),C(``);return}let n=t===`0`,r=t===`-`&&o;if(n||r){_?.(0),C(t);return}let i=E.test(t)&&O(t)&&(p||D(t));if(!i)return;let a=parseFloat(t)||0;_?.(a),C(t)},[o,p,D,O,g,_,E]),P=(0,a.useCallback)(()=>{t||C(e=>e.replace(/,/g,``))},[t]),F=(0,a.useCallback)(()=>{t||(v?.(),C(e=>j(e)))},[t,v,j]);return(0,a.useEffect)(()=>{let e=document.activeElement===x.current;if(!d||!E.test(d.toString())||!M(d.toString())||!p&&A(d.toString())){C(``);return}C(t=>t===`-`?`-`:t?e?d.toString():j(d.toString()):``)},[p,j,d,A,M,E]),(0,a.useEffect)(()=>{if(!b.current||!x.current||!f)return;let e=b.current.offsetWidth;x.current.style.setProperty(`padding-right`,`${(e+10)/16}rem`)},[e,f]),(0,i.jsxs)(`div`,{className:`relative`,children:[(0,i.jsx)(n.Input,{...y,ref:x,value:S||(t?`0`:``),placeholder:m,disabled:e,readOnly:t,className:(0,r.cn)(`font-number text-end`,t&&`bg-muted text-muted-foreground`),onChange:N,onFocus:P,onBlur:F}),f&&(0,i.jsx)(`span`,{ref:b,className:`text-muted-foreground pointer-events-none absolute top-1/2 right-2 -translate-y-1/2 text-sm`,children:f})]})},u=({name:e,label:n=`Number Field`,placeholder:r=`0`,isShowErrorMsg:a=!1,isShowCount:s=!1,unitText:c=``,description:u=``,onValueChange:d})=>{let f=(0,o.useWatch)({name:e});return(0,i.jsx)(t.FormField,{name:e,render:({field:{onChange:e,...o}})=>(0,i.jsxs)(t.FormItem,{className:`w-full gap-0`,children:[(0,i.jsx)(t.FormLabel,{children:n}),(0,i.jsx)(t.FormControl,{children:(0,i.jsx)(l,{...o,placeholder:r,className:`w-full`,unitText:c,onValueChange:t=>{e(t),d?.(t)}})}),s&&(0,i.jsxs)(`div`,{className:`text-muted-foreground text-end text-xs`,children:[f?.length??0,` characters`]}),!!u&&(0,i.jsx)(t.FormDescription,{children:u}),a&&(0,i.jsx)(t.FormMessage,{})]})})};exports.NumberField=u;
1
+ const e=require(`../chunk-CUT6urMc.cjs`);require(`../label-BM6rVDz-.cjs`);const t=require(`../form-A2qAueDp.cjs`),n=require(`../input-DgtTVBtN.cjs`),r=e.__toESM(require(`@customafk/react-toolkit/utils`)),i=e.__toESM(require(`react/jsx-runtime`)),a=e.__toESM(require(`react`)),o=e.__toESM(require(`react-hook-form`)),s=e=>e?/^-?\d*\.?\d*$/:/^\d*\.?\d*$/,c=e=>Number(e).toLocaleString(),l=({disabled:e=!1,readonly:t=!1,allowNegative:o=!1,numberAfterDecimalPoint:l=2,roundingRule:u=`none`,value:d=``,unitText:f,decimal:p,placeholder:m,precision:h,onChange:g,onValueChange:_,onBlur:v,...y})=>{let b=(0,a.useRef)(null),x=(0,a.useRef)(null),[S,C]=(0,a.useState)(d.toString()),w=p?.[1]??l,T=p&&p[0]-p[1],E=(0,a.useMemo)(()=>s(o),[o]),D=(0,a.useCallback)(e=>{if(!w&&e.includes(`.`))return!1;let t=e.split(`.`)[1];return!t||t.length<=w},[w]),O=(0,a.useCallback)(e=>{if(!p||e===`-`)return!0;let[t,n=``]=e.split(`.`);return n.length<=p[1]&&(t.startsWith(`-`)?t.length-1:t.length)<=T},[p,T]),k=(0,a.useCallback)((e,t)=>{if(u===`none`)return e;let n=Math.pow(10,t),r=e*n;switch(u){case`up`:return Math.ceil(r)/n;case`down`:return Math.floor(r)/n;case`nearest`:return r%1<.1?Math.floor(r)/n:r%1>=.59?Math.ceil(r)/n:(Math.floor(r)+.5)/n;default:return e}},[u]),A=(0,a.useCallback)(e=>!l&&e.includes(`.`)||e.split(`.`)[1]?.length>l,[l]),j=(0,a.useCallback)(e=>{if(e===`0`)return`0`;if(!Number(e))return``;let t=parseFloat(e),n=Math.min(w-1,h||0),r=k(t,n).toString(),[i,a=``]=r.split(`.`),o=c(i);return a?`${o}.${a}`:o},[k,w,h]),M=(0,a.useCallback)(e=>{if(!p||e===`-`)return!0;let[t,n=``]=e.split(`.`),r=t.startsWith(`-`)?t.length-1:t.length,i=p[0]-p[1];return n.length<=p[1]&&r<=i},[p]),N=(0,a.useCallback)(e=>{g?.(e);let{value:t}=e.target;if(!t){_?.(void 0),C(``);return}let n=t===`0`,r=t===`-`&&o;if(n||r){_?.(0),C(t);return}let i=E.test(t)&&O(t)&&(p||D(t));if(!i)return;let a=parseFloat(t)||0;_?.(a),C(t)},[o,p,D,O,g,_,E]),P=(0,a.useCallback)(()=>{t||C(e=>e.replace(/,/g,``))},[t]),F=(0,a.useCallback)(()=>{t||(v?.(),C(e=>j(e)))},[t,v,j]);return(0,a.useEffect)(()=>{let e=document.activeElement===x.current;if(!d||!E.test(d.toString())||!M(d.toString())||!p&&A(d.toString())){C(``);return}C(t=>t===`-`?`-`:t?e?d.toString():j(d.toString()):``)},[p,j,d,A,M,E]),(0,a.useEffect)(()=>{if(!b.current||!x.current||!f)return;let e=b.current.offsetWidth;x.current.style.setProperty(`padding-right`,`${(e+10)/16}rem`)},[e,f]),(0,i.jsxs)(`div`,{className:`relative`,children:[(0,i.jsx)(n.Input,{...y,ref:x,value:S||(t?`0`:``),placeholder:m,disabled:e,readOnly:t,className:(0,r.cn)(`font-number text-end`,t&&`bg-muted text-muted-foreground`),onChange:N,onFocus:P,onBlur:F}),f&&(0,i.jsx)(`span`,{ref:b,className:`text-muted-foreground pointer-events-none absolute top-1/2 right-2 -translate-y-1/2 text-sm`,children:f})]})},u=({name:e,label:n=`Number Field`,placeholder:r=`0`,isShowErrorMsg:a=!1,isShowCount:s=!1,unitText:c=``,description:u=``,onValueChange:d})=>{let f=(0,o.useWatch)({name:e});return(0,i.jsx)(t.FormField,{name:e,render:({field:{onChange:e,...o}})=>(0,i.jsxs)(t.FormItem,{className:`w-full gap-0`,children:[(0,i.jsx)(t.FormLabel,{children:n}),(0,i.jsx)(t.FormControl,{children:(0,i.jsx)(l,{...o,placeholder:r,className:`w-full`,unitText:c,onValueChange:t=>{e(t),d?.(t)}})}),s&&(0,i.jsxs)(`div`,{className:`text-muted-foreground text-end text-xs`,children:[f?.length??0,` characters`]}),!!u&&(0,i.jsx)(t.FormDescription,{children:u}),a&&(0,i.jsx)(t.FormMessage,{})]})})};exports.NumberField=u;
2
2
  //# sourceMappingURL=number-field.cjs.map
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime1 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime58 from "react/jsx-runtime";
2
2
  import { FieldPath, FieldValues } from "react-hook-form";
3
3
 
4
4
  //#region packages/components/forms/number-field.d.ts
@@ -22,7 +22,7 @@ declare const NumberField: <TFieldValues extends FieldValues = FieldValues>({
22
22
  unitText,
23
23
  description,
24
24
  onValueChange
25
- }: Props<TFieldValues>) => react_jsx_runtime1.JSX.Element;
25
+ }: Props<TFieldValues>) => react_jsx_runtime58.JSX.Element;
26
26
  //#endregion
27
27
  export { NumberField };
28
28
  //# sourceMappingURL=number-field.d.cts.map
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime5 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime6 from "react/jsx-runtime";
2
2
  import { FieldPath, FieldValues } from "react-hook-form";
3
3
 
4
4
  //#region packages/components/forms/number-field.d.ts
@@ -22,7 +22,7 @@ declare const NumberField: <TFieldValues extends FieldValues = FieldValues>({
22
22
  unitText,
23
23
  description,
24
24
  onValueChange
25
- }: Props<TFieldValues>) => react_jsx_runtime5.JSX.Element;
25
+ }: Props<TFieldValues>) => react_jsx_runtime6.JSX.Element;
26
26
  //#endregion
27
27
  export { NumberField };
28
28
  //# sourceMappingURL=number-field.d.ts.map
@@ -1,2 +1,2 @@
1
- import"../label-DdpIoRiG.js";import{FormControl as e,FormDescription as t,FormField as n,FormItem as r,FormLabel as i,FormMessage as a}from"../form-D-gDMD-J.js";import{Input as o}from"../input-BFZuwsER.js";import{cn as s}from"@customafk/react-toolkit/utils";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{useCallback as u,useEffect as d,useMemo as f,useRef as p,useState as m}from"react";import{useWatch as h}from"react-hook-form";const g=e=>e?/^-?\d*\.?\d*$/:/^\d*\.?\d*$/,_=e=>Number(e).toLocaleString(),v=({disabled:e=!1,readonly:t=!1,allowNegative:n=!1,numberAfterDecimalPoint:r=2,roundingRule:i=`none`,value:a=``,unitText:h,decimal:v,placeholder:y,precision:b,onChange:x,onValueChange:S,onBlur:C,...w})=>{let T=p(null),E=p(null),[D,O]=m(a.toString()),k=v?.[1]??r,A=v&&v[0]-v[1],j=f(()=>g(n),[n]),M=u(e=>{if(!k&&e.includes(`.`))return!1;let t=e.split(`.`)[1];return!t||t.length<=k},[k]),N=u(e=>{if(!v||e===`-`)return!0;let[t,n=``]=e.split(`.`);return n.length<=v[1]&&(t.startsWith(`-`)?t.length-1:t.length)<=A},[v,A]),P=u((e,t)=>{if(i===`none`)return e;let n=Math.pow(10,t),r=e*n;switch(i){case`up`:return Math.ceil(r)/n;case`down`:return Math.floor(r)/n;case`nearest`:return r%1<.1?Math.floor(r)/n:r%1>=.59?Math.ceil(r)/n:(Math.floor(r)+.5)/n;default:return e}},[i]),F=u(e=>!r&&e.includes(`.`)||e.split(`.`)[1]?.length>r,[r]),I=u(e=>{if(e===`0`)return`0`;if(!Number(e))return``;let t=parseFloat(e),n=Math.min(k-1,b||0),r=P(t,n).toString(),[i,a=``]=r.split(`.`),o=_(i);return a?`${o}.${a}`:o},[P,k,b]),L=u(e=>{if(!v||e===`-`)return!0;let[t,n=``]=e.split(`.`),r=t.startsWith(`-`)?t.length-1:t.length,i=v[0]-v[1];return n.length<=v[1]&&r<=i},[v]),R=u(e=>{x?.(e);let{value:t}=e.target;if(!t){S?.(void 0),O(``);return}let r=t===`0`,i=t===`-`&&n;if(r||i){S?.(0),O(t);return}let a=j.test(t)&&N(t)&&(v||M(t));if(!a)return;let o=parseFloat(t)||0;S?.(o),O(t)},[n,v,M,N,x,S,j]),z=u(()=>{t||O(e=>e.replace(/,/g,``))},[t]),B=u(()=>{t||(C?.(),O(e=>I(e)))},[t,C,I]);return d(()=>{let e=document.activeElement===E.current;if(!a||!j.test(a.toString())||!L(a.toString())||!v&&F(a.toString())){O(``);return}O(t=>t===`-`?`-`:t?e?a.toString():I(a.toString()):``)},[v,I,a,F,L,j]),d(()=>{if(!T.current||!E.current||!h)return;let e=T.current.offsetWidth;E.current.style.setProperty(`padding-right`,`${(e+10)/16}rem`)},[e,h]),l(`div`,{className:`relative`,children:[c(o,{...w,ref:E,value:D||(t?`0`:``),placeholder:y,disabled:e,readOnly:t,className:s(`font-number text-end`,t&&`bg-muted text-muted-foreground`),onChange:R,onFocus:z,onBlur:B}),h&&c(`span`,{ref:T,className:`text-muted-foreground pointer-events-none absolute top-1/2 right-2 -translate-y-1/2 text-sm`,children:h})]})},y=({name:o,label:s=`Number Field`,placeholder:u=`0`,isShowErrorMsg:d=!1,isShowCount:f=!1,unitText:p=``,description:m=``,onValueChange:g})=>{let _=h({name:o});return c(n,{name:o,render:({field:{onChange:n,...o}})=>l(r,{className:`w-full gap-0`,children:[c(i,{children:s}),c(e,{children:c(v,{...o,placeholder:u,className:`w-full`,unitText:p,onValueChange:e=>{n(e),g?.(e)}})}),f&&l(`div`,{className:`text-muted-foreground text-end text-xs`,children:[_?.length??0,` characters`]}),!!m&&c(t,{children:m}),d&&c(a,{})]})})};export{y as NumberField};
1
+ import"../label-D4GUfxTB.js";import{FormControl as e,FormDescription as t,FormField as n,FormItem as r,FormLabel as i,FormMessage as a}from"../form-C4Zn5Meu.js";import{Input as o}from"../input-BUYJ4_aj.js";import{cn as s}from"@customafk/react-toolkit/utils";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{useCallback as u,useEffect as d,useMemo as f,useRef as p,useState as m}from"react";import{useWatch as h}from"react-hook-form";const g=e=>e?/^-?\d*\.?\d*$/:/^\d*\.?\d*$/,_=e=>Number(e).toLocaleString(),v=({disabled:e=!1,readonly:t=!1,allowNegative:n=!1,numberAfterDecimalPoint:r=2,roundingRule:i=`none`,value:a=``,unitText:h,decimal:v,placeholder:y,precision:b,onChange:x,onValueChange:S,onBlur:C,...w})=>{let T=p(null),E=p(null),[D,O]=m(a.toString()),k=v?.[1]??r,A=v&&v[0]-v[1],j=f(()=>g(n),[n]),M=u(e=>{if(!k&&e.includes(`.`))return!1;let t=e.split(`.`)[1];return!t||t.length<=k},[k]),N=u(e=>{if(!v||e===`-`)return!0;let[t,n=``]=e.split(`.`);return n.length<=v[1]&&(t.startsWith(`-`)?t.length-1:t.length)<=A},[v,A]),P=u((e,t)=>{if(i===`none`)return e;let n=Math.pow(10,t),r=e*n;switch(i){case`up`:return Math.ceil(r)/n;case`down`:return Math.floor(r)/n;case`nearest`:return r%1<.1?Math.floor(r)/n:r%1>=.59?Math.ceil(r)/n:(Math.floor(r)+.5)/n;default:return e}},[i]),F=u(e=>!r&&e.includes(`.`)||e.split(`.`)[1]?.length>r,[r]),I=u(e=>{if(e===`0`)return`0`;if(!Number(e))return``;let t=parseFloat(e),n=Math.min(k-1,b||0),r=P(t,n).toString(),[i,a=``]=r.split(`.`),o=_(i);return a?`${o}.${a}`:o},[P,k,b]),L=u(e=>{if(!v||e===`-`)return!0;let[t,n=``]=e.split(`.`),r=t.startsWith(`-`)?t.length-1:t.length,i=v[0]-v[1];return n.length<=v[1]&&r<=i},[v]),R=u(e=>{x?.(e);let{value:t}=e.target;if(!t){S?.(void 0),O(``);return}let r=t===`0`,i=t===`-`&&n;if(r||i){S?.(0),O(t);return}let a=j.test(t)&&N(t)&&(v||M(t));if(!a)return;let o=parseFloat(t)||0;S?.(o),O(t)},[n,v,M,N,x,S,j]),z=u(()=>{t||O(e=>e.replace(/,/g,``))},[t]),B=u(()=>{t||(C?.(),O(e=>I(e)))},[t,C,I]);return d(()=>{let e=document.activeElement===E.current;if(!a||!j.test(a.toString())||!L(a.toString())||!v&&F(a.toString())){O(``);return}O(t=>t===`-`?`-`:t?e?a.toString():I(a.toString()):``)},[v,I,a,F,L,j]),d(()=>{if(!T.current||!E.current||!h)return;let e=T.current.offsetWidth;E.current.style.setProperty(`padding-right`,`${(e+10)/16}rem`)},[e,h]),l(`div`,{className:`relative`,children:[c(o,{...w,ref:E,value:D||(t?`0`:``),placeholder:y,disabled:e,readOnly:t,className:s(`font-number text-end`,t&&`bg-muted text-muted-foreground`),onChange:R,onFocus:z,onBlur:B}),h&&c(`span`,{ref:T,className:`text-muted-foreground pointer-events-none absolute top-1/2 right-2 -translate-y-1/2 text-sm`,children:h})]})},y=({name:o,label:s=`Number Field`,placeholder:u=`0`,isShowErrorMsg:d=!1,isShowCount:f=!1,unitText:p=``,description:m=``,onValueChange:g})=>{let _=h({name:o});return c(n,{name:o,render:({field:{onChange:n,...o}})=>l(r,{className:`w-full gap-0`,children:[c(i,{children:s}),c(e,{children:c(v,{...o,placeholder:u,className:`w-full`,unitText:p,onValueChange:e=>{n(e),g?.(e)}})}),f&&l(`div`,{className:`text-muted-foreground text-end text-xs`,children:[_?.length??0,` characters`]}),!!m&&c(t,{children:m}),d&&c(a,{})]})})};export{y as NumberField};
2
2
  //# sourceMappingURL=number-field.js.map
@@ -1,2 +1,2 @@
1
- "use client";const e=require(`../chunk-CUT6urMc.cjs`);require(`../label-BBPPT0-L.cjs`);const t=require(`../form-CaxhlWxK.cjs`),n=require(`../input-ERPHY3v4.cjs`),r=e.__toESM(require(`lucide-react`)),i=e.__toESM(require(`@customafk/react-toolkit/utils`)),a=e.__toESM(require(`react/jsx-runtime`)),o=({className:e,...t})=>{let o=React.useId(),[s,c]=React.useState(!1),l=React.useCallback(()=>c(e=>!e),[]);return(0,a.jsxs)(`div`,{className:`relative`,children:[(0,a.jsx)(n.Input,{...t,id:o,placeholder:`Password`,type:s?`text`:`password`,className:(0,i.cn)(`pe-9`,e)}),(0,a.jsx)(`button`,{className:`text-muted-foreground/80 hover:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 absolute inset-y-0 end-0 flex h-full w-9 items-center justify-center rounded-e-md transition-[color,box-shadow] outline-none focus:z-10 focus-visible:ring-[3px] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,type:`button`,onClick:l,"aria-label":s?`Hide password`:`Show password`,"aria-pressed":s,"aria-controls":`password`,children:s?(0,a.jsx)(r.EyeOffIcon,{size:16,"aria-hidden":`true`}):(0,a.jsx)(r.EyeIcon,{size:16,"aria-hidden":`true`})})]})},s=({name:e,label:n=`Text Field`,placeholder:r=`Enter text here`,isShowErrorMsg:i=!1,description:s,onValueChange:c})=>(0,a.jsx)(t.FormField,{name:e,render:({field:e})=>(0,a.jsxs)(t.FormItem,{className:`w-full`,children:[(0,a.jsx)(t.FormLabel,{children:n}),(0,a.jsx)(t.FormControl,{children:(0,a.jsx)(o,{placeholder:r,...e,onValueChange:c})}),!!s&&(0,a.jsx)(t.FormDescription,{children:s}),i&&(0,a.jsx)(t.FormMessage,{})]})});exports.PasswordField=s;
1
+ "use client";const e=require(`../chunk-CUT6urMc.cjs`);require(`../label-BM6rVDz-.cjs`);const t=require(`../form-A2qAueDp.cjs`),n=require(`../input-DgtTVBtN.cjs`),r=e.__toESM(require(`lucide-react`)),i=e.__toESM(require(`@customafk/react-toolkit/utils`)),a=e.__toESM(require(`react/jsx-runtime`)),o=e.__toESM(require(`react`)),s=({className:e,...t})=>{let s=(0,o.useId)(),[c,l]=(0,o.useState)(!1),u=(0,o.useCallback)(()=>l(e=>!e),[]);return(0,a.jsxs)(`div`,{className:`relative`,children:[(0,a.jsx)(n.Input,{...t,id:s,placeholder:`Password`,type:c?`text`:`password`,className:(0,i.cn)(`pe-9`,e)}),(0,a.jsx)(`button`,{className:`text-muted-foreground/80 hover:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 absolute inset-y-0 end-0 flex h-full w-9 items-center justify-center rounded-e-md transition-[color,box-shadow] outline-none focus:z-10 focus-visible:ring-[3px] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,type:`button`,onClick:u,"aria-label":c?`Hide password`:`Show password`,"aria-pressed":c,"aria-controls":`password`,children:c?(0,a.jsx)(r.EyeOffIcon,{size:16,"aria-hidden":`true`}):(0,a.jsx)(r.EyeIcon,{size:16,"aria-hidden":`true`})})]})},c=({name:e,label:n=`Text Field`,placeholder:r=`Enter text here`,isShowErrorMsg:i=!1,description:o,onValueChange:c})=>(0,a.jsx)(t.FormField,{name:e,render:({field:e})=>(0,a.jsxs)(t.FormItem,{className:`w-full`,children:[(0,a.jsx)(t.FormLabel,{children:n}),(0,a.jsx)(t.FormControl,{children:(0,a.jsx)(s,{placeholder:r,...e,onValueChange:c})}),!!o&&(0,a.jsx)(t.FormDescription,{children:o}),i&&(0,a.jsx)(t.FormMessage,{})]})});exports.PasswordField=c;
2
2
  //# sourceMappingURL=password-field.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"password-field.cjs","names":["PasswordInput: React.FC<Props>","Input","EyeOffIcon","EyeIcon","FormField","FormItem","FormLabel","FormControl","FormDescription","FormMessage"],"sources":["../../packages/components/ui/inputs/password-input.tsx","../../packages/components/forms/password-field.tsx"],"sourcesContent":["'use client'\nimport { cn } from '@customafk/react-toolkit/utils'\n\nimport { EyeIcon, EyeOffIcon } from 'lucide-react'\n\nimport { Input } from '../input'\n\ntype Props = React.ComponentPropsWithoutRef<typeof Input>\nexport const PasswordInput: React.FC<Props> = ({ className, ...rest }) => {\n const id = React.useId()\n const [isVisible, setIsVisible] = React.useState<boolean>(false)\n const toggleVisibility = React.useCallback(() => setIsVisible((prevState) => !prevState), [])\n return (\n <div className=\"relative\">\n <Input {...rest} id={id} placeholder=\"Password\" type={isVisible ? 'text' : 'password'} className={cn('pe-9', className)} />\n <button\n className=\"text-muted-foreground/80 hover:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 absolute inset-y-0 end-0 flex h-full w-9 items-center justify-center rounded-e-md transition-[color,box-shadow] outline-none focus:z-10 focus-visible:ring-[3px] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50\"\n type=\"button\"\n onClick={toggleVisibility}\n aria-label={isVisible ? 'Hide password' : 'Show password'}\n aria-pressed={isVisible}\n aria-controls=\"password\"\n >\n {isVisible ? <EyeOffIcon size={16} aria-hidden=\"true\" /> : <EyeIcon size={16} aria-hidden=\"true\" />}\n </button>\n </div>\n )\n}\n","'use client'\nimport type { FieldPath, FieldValues } from 'react-hook-form'\n\nimport { FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from '../ui/form'\nimport { PasswordInput } from '../ui/inputs/password-input'\n\ntype Props<TFieldValues extends FieldValues = FieldValues> = {\n name: FieldPath<TFieldValues>\n label?: string\n description?: string\n placeholder?: string\n isShowErrorMsg?: boolean\n onValueChange?: (value: string) => void\n}\nexport const PasswordField = <TFieldValues extends FieldValues = FieldValues>({\n name,\n label = 'Text Field',\n placeholder = 'Enter text here',\n isShowErrorMsg = false,\n description,\n onValueChange,\n}: Props<TFieldValues>) => {\n return (\n <FormField\n name={name}\n render={({ field }) => (\n <FormItem className=\"w-full\">\n <FormLabel>{label}</FormLabel>\n <FormControl>\n <PasswordInput placeholder={placeholder} {...field} onValueChange={onValueChange} />\n </FormControl>\n {!!description && <FormDescription>{description}</FormDescription>}\n {isShowErrorMsg && <FormMessage />}\n </FormItem>\n )}\n />\n )\n}\n"],"mappings":"wSAQaA,GAAkC,CAAE,YAAW,GAAG,KAAW,CACxE,IAAM,EAAK,MAAM,QACX,CAAC,EAAW,GAAgB,MAAM,SAAkB,IACpD,EAAmB,MAAM,gBAAkB,EAAc,GAAc,CAAC,GAAY,IAC1F,OACE,EAAA,EAAA,MAAC,MAAA,CAAI,UAAU,sBACb,EAAA,EAAA,KAACC,EAAAA,MAAAA,CAAM,GAAI,EAAU,KAAI,YAAY,WAAW,KAAM,EAAY,OAAS,WAAY,WAAA,EAAA,EAAA,IAAc,OAAQ,MAC7G,EAAA,EAAA,KAAC,SAAA,CACC,UAAU,oVACV,KAAK,SACL,QAAS,EACT,aAAY,EAAY,gBAAkB,gBAC1C,eAAc,EACd,gBAAc,oBAEb,GAAY,EAAA,EAAA,KAACC,EAAAA,WAAAA,CAAW,KAAM,GAAI,cAAY,UAAY,EAAA,EAAA,KAACC,EAAAA,QAAAA,CAAQ,KAAM,GAAI,cAAY,eCTrF,GAAiE,CAC5E,OACA,QAAQ,aACR,cAAc,kBACd,iBAAiB,GACjB,cACA,oBAGE,EAAA,EAAA,KAACC,EAAAA,UAAAA,CACO,OACN,QAAS,CAAE,YACT,EAAA,EAAA,MAACC,EAAAA,SAAAA,CAAS,UAAU,oBAClB,EAAA,EAAA,KAACC,EAAAA,UAAAA,CAAAA,SAAW,KACZ,EAAA,EAAA,KAACC,EAAAA,YAAAA,CAAAA,UACC,EAAA,EAAA,KAAC,EAAA,CAA2B,cAAa,GAAI,EAAsB,oBAEpE,CAAC,CAAC,IAAe,EAAA,EAAA,KAACC,EAAAA,gBAAAA,CAAAA,SAAiB,IACnC,IAAkB,EAAA,EAAA,KAACC,EAAAA,YAAAA"}
1
+ {"version":3,"file":"password-field.cjs","names":["PasswordInput: React.FC<Props>","Input","EyeOffIcon","EyeIcon","FormField","FormItem","FormLabel","FormControl","FormDescription","FormMessage"],"sources":["../../packages/components/ui/inputs/password-input.tsx","../../packages/components/forms/password-field.tsx"],"sourcesContent":["'use client'\nimport { cn } from '@customafk/react-toolkit/utils'\nimport { EyeIcon, EyeOffIcon } from 'lucide-react'\nimport { useCallback, useId, useState } from 'react'\n\nimport { Input } from '../input'\n\ntype Props = React.ComponentPropsWithoutRef<typeof Input>\nexport const PasswordInput: React.FC<Props> = ({ className, ...rest }) => {\n const id = useId()\n const [isVisible, setIsVisible] = useState<boolean>(false)\n const toggleVisibility = useCallback(() => setIsVisible((prevState) => !prevState), [])\n return (\n <div className=\"relative\">\n <Input {...rest} id={id} placeholder=\"Password\" type={isVisible ? 'text' : 'password'} className={cn('pe-9', className)} />\n <button\n className=\"text-muted-foreground/80 hover:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 absolute inset-y-0 end-0 flex h-full w-9 items-center justify-center rounded-e-md transition-[color,box-shadow] outline-none focus:z-10 focus-visible:ring-[3px] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50\"\n type=\"button\"\n onClick={toggleVisibility}\n aria-label={isVisible ? 'Hide password' : 'Show password'}\n aria-pressed={isVisible}\n aria-controls=\"password\"\n >\n {isVisible ? <EyeOffIcon size={16} aria-hidden=\"true\" /> : <EyeIcon size={16} aria-hidden=\"true\" />}\n </button>\n </div>\n )\n}\n","'use client'\nimport type { FieldPath, FieldValues } from 'react-hook-form'\n\nimport { FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from '../ui/form'\nimport { PasswordInput } from '../ui/inputs/password-input'\n\ntype Props<TFieldValues extends FieldValues = FieldValues> = {\n name: FieldPath<TFieldValues>\n label?: string\n description?: string\n placeholder?: string\n isShowErrorMsg?: boolean\n onValueChange?: (value: string) => void\n}\nexport const PasswordField = <TFieldValues extends FieldValues = FieldValues>({\n name,\n label = 'Text Field',\n placeholder = 'Enter text here',\n isShowErrorMsg = false,\n description,\n onValueChange,\n}: Props<TFieldValues>) => {\n return (\n <FormField\n name={name}\n render={({ field }) => (\n <FormItem className=\"w-full\">\n <FormLabel>{label}</FormLabel>\n <FormControl>\n <PasswordInput placeholder={placeholder} {...field} onValueChange={onValueChange} />\n </FormControl>\n {!!description && <FormDescription>{description}</FormDescription>}\n {isShowErrorMsg && <FormMessage />}\n </FormItem>\n )}\n />\n )\n}\n"],"mappings":"sUAQaA,GAAkC,CAAE,YAAW,GAAG,KAAW,CACxE,IAAM,GAAA,EAAA,EAAA,SACA,CAAC,EAAW,IAAA,EAAA,EAAA,UAAkC,IAC9C,GAAA,EAAA,EAAA,iBAAqC,EAAc,GAAc,CAAC,GAAY,IACpF,OACE,EAAA,EAAA,MAAC,MAAA,CAAI,UAAU,sBACb,EAAA,EAAA,KAACC,EAAAA,MAAAA,CAAM,GAAI,EAAU,KAAI,YAAY,WAAW,KAAM,EAAY,OAAS,WAAY,WAAA,EAAA,EAAA,IAAc,OAAQ,MAC7G,EAAA,EAAA,KAAC,SAAA,CACC,UAAU,oVACV,KAAK,SACL,QAAS,EACT,aAAY,EAAY,gBAAkB,gBAC1C,eAAc,EACd,gBAAc,oBAEb,GAAY,EAAA,EAAA,KAACC,EAAAA,WAAAA,CAAW,KAAM,GAAI,cAAY,UAAY,EAAA,EAAA,KAACC,EAAAA,QAAAA,CAAQ,KAAM,GAAI,cAAY,eCTrF,GAAiE,CAC5E,OACA,QAAQ,aACR,cAAc,kBACd,iBAAiB,GACjB,cACA,oBAGE,EAAA,EAAA,KAACC,EAAAA,UAAAA,CACO,OACN,QAAS,CAAE,YACT,EAAA,EAAA,MAACC,EAAAA,SAAAA,CAAS,UAAU,oBAClB,EAAA,EAAA,KAACC,EAAAA,UAAAA,CAAAA,SAAW,KACZ,EAAA,EAAA,KAACC,EAAAA,YAAAA,CAAAA,UACC,EAAA,EAAA,KAAC,EAAA,CAA2B,cAAa,GAAI,EAAsB,oBAEpE,CAAC,CAAC,IAAe,EAAA,EAAA,KAACC,EAAAA,gBAAAA,CAAAA,SAAiB,IACnC,IAAkB,EAAA,EAAA,KAACC,EAAAA,YAAAA"}
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime12 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
2
2
  import { FieldPath, FieldValues } from "react-hook-form";
3
3
 
4
4
  //#region packages/components/forms/password-field.d.ts
@@ -17,7 +17,7 @@ declare const PasswordField: <TFieldValues extends FieldValues = FieldValues>({
17
17
  isShowErrorMsg,
18
18
  description,
19
19
  onValueChange
20
- }: Props<TFieldValues>) => react_jsx_runtime12.JSX.Element;
20
+ }: Props<TFieldValues>) => react_jsx_runtime1.JSX.Element;
21
21
  //#endregion
22
22
  export { PasswordField };
23
23
  //# sourceMappingURL=password-field.d.cts.map
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime9 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime8 from "react/jsx-runtime";
2
2
  import { FieldPath, FieldValues } from "react-hook-form";
3
3
 
4
4
  //#region packages/components/forms/password-field.d.ts
@@ -17,7 +17,7 @@ declare const PasswordField: <TFieldValues extends FieldValues = FieldValues>({
17
17
  isShowErrorMsg,
18
18
  description,
19
19
  onValueChange
20
- }: Props<TFieldValues>) => react_jsx_runtime9.JSX.Element;
20
+ }: Props<TFieldValues>) => react_jsx_runtime8.JSX.Element;
21
21
  //#endregion
22
22
  export { PasswordField };
23
23
  //# sourceMappingURL=password-field.d.ts.map
@@ -1,2 +1,2 @@
1
- "use client";import"../label-DdpIoRiG.js";import{FormControl as e,FormDescription as t,FormField as n,FormItem as r,FormLabel as i,FormMessage as a}from"../form-D-gDMD-J.js";import{Input as o}from"../input-BFZuwsER.js";import{EyeIcon as s,EyeOffIcon as c}from"lucide-react";import{cn as l}from"@customafk/react-toolkit/utils";import{jsx as u,jsxs as d}from"react/jsx-runtime";const f=({className:e,...t})=>{let n=React.useId(),[r,i]=React.useState(!1),a=React.useCallback(()=>i(e=>!e),[]);return d(`div`,{className:`relative`,children:[u(o,{...t,id:n,placeholder:`Password`,type:r?`text`:`password`,className:l(`pe-9`,e)}),u(`button`,{className:`text-muted-foreground/80 hover:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 absolute inset-y-0 end-0 flex h-full w-9 items-center justify-center rounded-e-md transition-[color,box-shadow] outline-none focus:z-10 focus-visible:ring-[3px] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,type:`button`,onClick:a,"aria-label":r?`Hide password`:`Show password`,"aria-pressed":r,"aria-controls":`password`,children:u(r?c:s,{size:16,"aria-hidden":`true`})})]})},p=({name:o,label:s=`Text Field`,placeholder:c=`Enter text here`,isShowErrorMsg:l=!1,description:p,onValueChange:m})=>u(n,{name:o,render:({field:n})=>d(r,{className:`w-full`,children:[u(i,{children:s}),u(e,{children:u(f,{placeholder:c,...n,onValueChange:m})}),!!p&&u(t,{children:p}),l&&u(a,{})]})});export{p as PasswordField};
1
+ "use client";import"../label-D4GUfxTB.js";import{FormControl as e,FormDescription as t,FormField as n,FormItem as r,FormLabel as i,FormMessage as a}from"../form-C4Zn5Meu.js";import{Input as o}from"../input-BUYJ4_aj.js";import{EyeIcon as s,EyeOffIcon as c}from"lucide-react";import{cn as l}from"@customafk/react-toolkit/utils";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{useCallback as f,useId as p,useState as m}from"react";const h=({className:e,...t})=>{let n=p(),[r,i]=m(!1),a=f(()=>i(e=>!e),[]);return d(`div`,{className:`relative`,children:[u(o,{...t,id:n,placeholder:`Password`,type:r?`text`:`password`,className:l(`pe-9`,e)}),u(`button`,{className:`text-muted-foreground/80 hover:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 absolute inset-y-0 end-0 flex h-full w-9 items-center justify-center rounded-e-md transition-[color,box-shadow] outline-none focus:z-10 focus-visible:ring-[3px] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,type:`button`,onClick:a,"aria-label":r?`Hide password`:`Show password`,"aria-pressed":r,"aria-controls":`password`,children:u(r?c:s,{size:16,"aria-hidden":`true`})})]})},g=({name:o,label:s=`Text Field`,placeholder:c=`Enter text here`,isShowErrorMsg:l=!1,description:f,onValueChange:p})=>u(n,{name:o,render:({field:n})=>d(r,{className:`w-full`,children:[u(i,{children:s}),u(e,{children:u(h,{placeholder:c,...n,onValueChange:p})}),!!f&&u(t,{children:f}),l&&u(a,{})]})});export{g as PasswordField};
2
2
  //# sourceMappingURL=password-field.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"password-field.js","names":["PasswordInput: React.FC<Props>"],"sources":["../../packages/components/ui/inputs/password-input.tsx","../../packages/components/forms/password-field.tsx"],"sourcesContent":["'use client'\nimport { cn } from '@customafk/react-toolkit/utils'\n\nimport { EyeIcon, EyeOffIcon } from 'lucide-react'\n\nimport { Input } from '../input'\n\ntype Props = React.ComponentPropsWithoutRef<typeof Input>\nexport const PasswordInput: React.FC<Props> = ({ className, ...rest }) => {\n const id = React.useId()\n const [isVisible, setIsVisible] = React.useState<boolean>(false)\n const toggleVisibility = React.useCallback(() => setIsVisible((prevState) => !prevState), [])\n return (\n <div className=\"relative\">\n <Input {...rest} id={id} placeholder=\"Password\" type={isVisible ? 'text' : 'password'} className={cn('pe-9', className)} />\n <button\n className=\"text-muted-foreground/80 hover:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 absolute inset-y-0 end-0 flex h-full w-9 items-center justify-center rounded-e-md transition-[color,box-shadow] outline-none focus:z-10 focus-visible:ring-[3px] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50\"\n type=\"button\"\n onClick={toggleVisibility}\n aria-label={isVisible ? 'Hide password' : 'Show password'}\n aria-pressed={isVisible}\n aria-controls=\"password\"\n >\n {isVisible ? <EyeOffIcon size={16} aria-hidden=\"true\" /> : <EyeIcon size={16} aria-hidden=\"true\" />}\n </button>\n </div>\n )\n}\n","'use client'\nimport type { FieldPath, FieldValues } from 'react-hook-form'\n\nimport { FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from '../ui/form'\nimport { PasswordInput } from '../ui/inputs/password-input'\n\ntype Props<TFieldValues extends FieldValues = FieldValues> = {\n name: FieldPath<TFieldValues>\n label?: string\n description?: string\n placeholder?: string\n isShowErrorMsg?: boolean\n onValueChange?: (value: string) => void\n}\nexport const PasswordField = <TFieldValues extends FieldValues = FieldValues>({\n name,\n label = 'Text Field',\n placeholder = 'Enter text here',\n isShowErrorMsg = false,\n description,\n onValueChange,\n}: Props<TFieldValues>) => {\n return (\n <FormField\n name={name}\n render={({ field }) => (\n <FormItem className=\"w-full\">\n <FormLabel>{label}</FormLabel>\n <FormControl>\n <PasswordInput placeholder={placeholder} {...field} onValueChange={onValueChange} />\n </FormControl>\n {!!description && <FormDescription>{description}</FormDescription>}\n {isShowErrorMsg && <FormMessage />}\n </FormItem>\n )}\n />\n )\n}\n"],"mappings":"wXAQA,MAAaA,GAAkC,CAAE,YAAW,GAAG,KAAW,CACxE,IAAM,EAAK,MAAM,QACX,CAAC,EAAW,GAAgB,MAAM,SAAkB,IACpD,EAAmB,MAAM,gBAAkB,EAAc,GAAc,CAAC,GAAY,IAC1F,OACE,EAAC,MAAA,CAAI,UAAU,qBACb,EAAC,EAAA,CAAM,GAAI,EAAU,KAAI,YAAY,WAAW,KAAM,EAAY,OAAS,WAAY,UAAW,EAAG,OAAQ,KAC7G,EAAC,SAAA,CACC,UAAU,oVACV,KAAK,SACL,QAAS,EACT,aAAY,EAAY,gBAAkB,gBAC1C,eAAc,EACd,gBAAc,oBAED,EAAZ,EAAa,EAA8C,EAA9C,CAAW,KAAM,GAAI,cAAY,eCT1C,GAAiE,CAC5E,OACA,QAAQ,aACR,cAAc,kBACd,iBAAiB,GACjB,cACA,mBAGE,EAAC,EAAA,CACO,OACN,QAAS,CAAE,WACT,EAAC,EAAA,CAAS,UAAU,mBAClB,EAAC,EAAA,CAAA,SAAW,IACZ,EAAC,EAAA,CAAA,SACC,EAAC,EAAA,CAA2B,cAAa,GAAI,EAAsB,oBAEpE,CAAC,CAAC,GAAe,EAAC,EAAA,CAAA,SAAiB,IACnC,GAAkB,EAAC,EAAA"}
1
+ {"version":3,"file":"password-field.js","names":["PasswordInput: React.FC<Props>"],"sources":["../../packages/components/ui/inputs/password-input.tsx","../../packages/components/forms/password-field.tsx"],"sourcesContent":["'use client'\nimport { cn } from '@customafk/react-toolkit/utils'\nimport { EyeIcon, EyeOffIcon } from 'lucide-react'\nimport { useCallback, useId, useState } from 'react'\n\nimport { Input } from '../input'\n\ntype Props = React.ComponentPropsWithoutRef<typeof Input>\nexport const PasswordInput: React.FC<Props> = ({ className, ...rest }) => {\n const id = useId()\n const [isVisible, setIsVisible] = useState<boolean>(false)\n const toggleVisibility = useCallback(() => setIsVisible((prevState) => !prevState), [])\n return (\n <div className=\"relative\">\n <Input {...rest} id={id} placeholder=\"Password\" type={isVisible ? 'text' : 'password'} className={cn('pe-9', className)} />\n <button\n className=\"text-muted-foreground/80 hover:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 absolute inset-y-0 end-0 flex h-full w-9 items-center justify-center rounded-e-md transition-[color,box-shadow] outline-none focus:z-10 focus-visible:ring-[3px] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50\"\n type=\"button\"\n onClick={toggleVisibility}\n aria-label={isVisible ? 'Hide password' : 'Show password'}\n aria-pressed={isVisible}\n aria-controls=\"password\"\n >\n {isVisible ? <EyeOffIcon size={16} aria-hidden=\"true\" /> : <EyeIcon size={16} aria-hidden=\"true\" />}\n </button>\n </div>\n )\n}\n","'use client'\nimport type { FieldPath, FieldValues } from 'react-hook-form'\n\nimport { FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from '../ui/form'\nimport { PasswordInput } from '../ui/inputs/password-input'\n\ntype Props<TFieldValues extends FieldValues = FieldValues> = {\n name: FieldPath<TFieldValues>\n label?: string\n description?: string\n placeholder?: string\n isShowErrorMsg?: boolean\n onValueChange?: (value: string) => void\n}\nexport const PasswordField = <TFieldValues extends FieldValues = FieldValues>({\n name,\n label = 'Text Field',\n placeholder = 'Enter text here',\n isShowErrorMsg = false,\n description,\n onValueChange,\n}: Props<TFieldValues>) => {\n return (\n <FormField\n name={name}\n render={({ field }) => (\n <FormItem className=\"w-full\">\n <FormLabel>{label}</FormLabel>\n <FormControl>\n <PasswordInput placeholder={placeholder} {...field} onValueChange={onValueChange} />\n </FormControl>\n {!!description && <FormDescription>{description}</FormDescription>}\n {isShowErrorMsg && <FormMessage />}\n </FormItem>\n )}\n />\n )\n}\n"],"mappings":"qbAQA,MAAaA,GAAkC,CAAE,YAAW,GAAG,KAAW,CACxE,IAAM,EAAK,IACL,CAAC,EAAW,GAAgB,EAAkB,IAC9C,EAAmB,MAAkB,EAAc,GAAc,CAAC,GAAY,IACpF,OACE,EAAC,MAAA,CAAI,UAAU,qBACb,EAAC,EAAA,CAAM,GAAI,EAAU,KAAI,YAAY,WAAW,KAAM,EAAY,OAAS,WAAY,UAAW,EAAG,OAAQ,KAC7G,EAAC,SAAA,CACC,UAAU,oVACV,KAAK,SACL,QAAS,EACT,aAAY,EAAY,gBAAkB,gBAC1C,eAAc,EACd,gBAAc,oBAED,EAAZ,EAAa,EAA8C,EAA9C,CAAW,KAAM,GAAI,cAAY,eCT1C,GAAiE,CAC5E,OACA,QAAQ,aACR,cAAc,kBACd,iBAAiB,GACjB,cACA,mBAGE,EAAC,EAAA,CACO,OACN,QAAS,CAAE,WACT,EAAC,EAAA,CAAS,UAAU,mBAClB,EAAC,EAAA,CAAA,SAAW,IACZ,EAAC,EAAA,CAAA,SACC,EAAC,EAAA,CAA2B,cAAa,GAAI,EAAsB,oBAEpE,CAAC,CAAC,GAAe,EAAC,EAAA,CAAA,SAAiB,IACnC,GAAkB,EAAC,EAAA"}
@@ -1,2 +1,2 @@
1
- "use client";const e=require(`../chunk-CUT6urMc.cjs`);require(`../label-BBPPT0-L.cjs`);const t=require(`../form-CaxhlWxK.cjs`),n=require(`../select-oxr4KoHx.cjs`),r=e.__toESM(require(`@customafk/react-toolkit/utils`)),i=e.__toESM(require(`react/jsx-runtime`)),a=({name:e,label:a=`Select Field`,placeholder:o=`Select an option`,disabledValues:s=[],options:c=[],isShowLabel:l=!0,isShowErrorMsg:u=!1,description:d=``,className:f=``})=>(0,i.jsx)(t.FormField,{name:e,render:({field:e})=>(0,i.jsxs)(t.FormItem,{className:(0,r.cn)(`w-full`,f),children:[l&&(0,i.jsx)(t.FormLabel,{children:a}),(0,i.jsxs)(n.Select,{defaultValue:e.value,onValueChange:e.onChange,children:[(0,i.jsx)(t.FormControl,{children:(0,i.jsx)(n.SelectTrigger,{className:`w-full`,children:(0,i.jsx)(n.SelectValue,{placeholder:o})})}),(0,i.jsx)(n.SelectContent,{children:c.map(e=>(0,i.jsx)(n.SelectItem,{disabled:s.includes(e.value),value:e.value,children:e.label},e.value))})]}),!!d&&(0,i.jsx)(t.FormDescription,{children:d}),u&&(0,i.jsx)(t.FormMessage,{})]})});exports.SelectField=a;
1
+ "use client";const e=require(`../chunk-CUT6urMc.cjs`);require(`../label-BM6rVDz-.cjs`);const t=require(`../form-A2qAueDp.cjs`),n=require(`../select-DAE3Xg7g.cjs`),r=e.__toESM(require(`@customafk/react-toolkit/utils`)),i=e.__toESM(require(`react/jsx-runtime`)),a=({name:e,label:a=`Select Field`,placeholder:o=`Select an option`,disabledValues:s=[],options:c=[],isShowLabel:l=!0,isShowErrorMsg:u=!1,description:d=``,className:f=``})=>(0,i.jsx)(t.FormField,{name:e,render:({field:e})=>(0,i.jsxs)(t.FormItem,{className:(0,r.cn)(`w-full`,f),children:[l&&(0,i.jsx)(t.FormLabel,{children:a}),(0,i.jsxs)(n.Select,{defaultValue:e.value,onValueChange:e.onChange,children:[(0,i.jsx)(t.FormControl,{children:(0,i.jsx)(n.SelectTrigger,{className:`w-full`,children:(0,i.jsx)(n.SelectValue,{placeholder:o})})}),(0,i.jsx)(n.SelectContent,{children:c.map(e=>(0,i.jsx)(n.SelectItem,{disabled:s.includes(e.value),value:e.value,children:e.label},e.value))})]}),!!d&&(0,i.jsx)(t.FormDescription,{children:d}),u&&(0,i.jsx)(t.FormMessage,{})]})});exports.SelectField=a;
2
2
  //# sourceMappingURL=select-field.cjs.map
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime16 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime6 from "react/jsx-runtime";
2
2
  import { FieldPath, FieldValues } from "react-hook-form";
3
3
 
4
4
  //#region packages/components/forms/select-field.d.ts
@@ -27,7 +27,7 @@ declare const SelectField: <TFieldValues extends FieldValues = FieldValues>({
27
27
  isShowErrorMsg,
28
28
  description,
29
29
  className
30
- }: Props<TFieldValues>) => react_jsx_runtime16.JSX.Element;
30
+ }: Props<TFieldValues>) => react_jsx_runtime6.JSX.Element;
31
31
  //#endregion
32
32
  export { SelectField };
33
33
  //# sourceMappingURL=select-field.d.cts.map
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime1 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime9 from "react/jsx-runtime";
2
2
  import { FieldPath, FieldValues } from "react-hook-form";
3
3
 
4
4
  //#region packages/components/forms/select-field.d.ts
@@ -27,7 +27,7 @@ declare const SelectField: <TFieldValues extends FieldValues = FieldValues>({
27
27
  isShowErrorMsg,
28
28
  description,
29
29
  className
30
- }: Props<TFieldValues>) => react_jsx_runtime1.JSX.Element;
30
+ }: Props<TFieldValues>) => react_jsx_runtime9.JSX.Element;
31
31
  //#endregion
32
32
  export { SelectField };
33
33
  //# sourceMappingURL=select-field.d.ts.map
@@ -1,2 +1,2 @@
1
- "use client";import"../label-DdpIoRiG.js";import{FormControl as e,FormDescription as t,FormField as n,FormItem as r,FormLabel as i,FormMessage as a}from"../form-D-gDMD-J.js";import{Select as o,SelectContent as s,SelectItem as c,SelectTrigger as l,SelectValue as u}from"../select-CijI0HX0.js";import{cn as d}from"@customafk/react-toolkit/utils";import{jsx as f,jsxs as p}from"react/jsx-runtime";const m=({name:m,label:h=`Select Field`,placeholder:g=`Select an option`,disabledValues:_=[],options:v=[],isShowLabel:y=!0,isShowErrorMsg:b=!1,description:x=``,className:S=``})=>f(n,{name:m,render:({field:n})=>p(r,{className:d(`w-full`,S),children:[y&&f(i,{children:h}),p(o,{defaultValue:n.value,onValueChange:n.onChange,children:[f(e,{children:f(l,{className:`w-full`,children:f(u,{placeholder:g})})}),f(s,{children:v.map(e=>f(c,{disabled:_.includes(e.value),value:e.value,children:e.label},e.value))})]}),!!x&&f(t,{children:x}),b&&f(a,{})]})});export{m as SelectField};
1
+ "use client";import"../label-D4GUfxTB.js";import{FormControl as e,FormDescription as t,FormField as n,FormItem as r,FormLabel as i,FormMessage as a}from"../form-C4Zn5Meu.js";import{Select as o,SelectContent as s,SelectItem as c,SelectTrigger as l,SelectValue as u}from"../select-Cmq5a3Wg.js";import{cn as d}from"@customafk/react-toolkit/utils";import{jsx as f,jsxs as p}from"react/jsx-runtime";const m=({name:m,label:h=`Select Field`,placeholder:g=`Select an option`,disabledValues:_=[],options:v=[],isShowLabel:y=!0,isShowErrorMsg:b=!1,description:x=``,className:S=``})=>f(n,{name:m,render:({field:n})=>p(r,{className:d(`w-full`,S),children:[y&&f(i,{children:h}),p(o,{defaultValue:n.value,onValueChange:n.onChange,children:[f(e,{children:f(l,{className:`w-full`,children:f(u,{placeholder:g})})}),f(s,{children:v.map(e=>f(c,{disabled:_.includes(e.value),value:e.value,children:e.label},e.value))})]}),!!x&&f(t,{children:x}),b&&f(a,{})]})});export{m as SelectField};
2
2
  //# sourceMappingURL=select-field.js.map
@@ -1,2 +1,2 @@
1
- "use client";const e=require(`../chunk-CUT6urMc.cjs`);require(`../label-BBPPT0-L.cjs`);const t=require(`../form-CaxhlWxK.cjs`),n=require(`../switch-BPSKvrTw.cjs`),r=e.__toESM(require(`@customafk/react-toolkit/utils`)),i=e.__toESM(require(`react/jsx-runtime`)),a=({name:e,label:a=`Switch Field`,description:o,isShowErrorMsg:s=!1})=>(0,i.jsx)(t.FormField,{name:e,render:({field:e})=>(0,i.jsxs)(`div`,{className:`spage-y-1`,children:[(0,i.jsxs)(t.FormItem,{className:(0,r.cn)(`border-border-weak flex flex-row items-center justify-between rounded-lg border p-3 shadow-xs`),children:[(0,i.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,i.jsx)(t.FormLabel,{className:`cursor-pointer text-sm`,children:a}),o&&(0,i.jsx)(t.FormDescription,{className:`text-xs`,children:o})]}),(0,i.jsx)(t.FormControl,{children:(0,i.jsx)(n.Switch,{checked:e.value,onCheckedChange:e.onChange})})]}),s&&(0,i.jsx)(t.FormMessage,{})]})});exports.SwitchField=a;
1
+ "use client";const e=require(`../chunk-CUT6urMc.cjs`);require(`../label-BM6rVDz-.cjs`);const t=require(`../form-A2qAueDp.cjs`),n=require(`../switch-BnHSwQ5T.cjs`),r=e.__toESM(require(`@customafk/react-toolkit/utils`)),i=e.__toESM(require(`react/jsx-runtime`)),a=({name:e,label:a=`Switch Field`,description:o,isShowErrorMsg:s=!1})=>(0,i.jsx)(t.FormField,{name:e,render:({field:e})=>(0,i.jsxs)(`div`,{className:`spage-y-1`,children:[(0,i.jsxs)(t.FormItem,{className:(0,r.cn)(`border-border-weak flex flex-row items-center justify-between rounded-lg border p-3 shadow-xs`),children:[(0,i.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,i.jsx)(t.FormLabel,{className:`cursor-pointer text-sm`,children:a}),o&&(0,i.jsx)(t.FormDescription,{className:`text-xs`,children:o})]}),(0,i.jsx)(t.FormControl,{children:(0,i.jsx)(n.Switch,{checked:e.value,onCheckedChange:e.onChange})})]}),s&&(0,i.jsx)(t.FormMessage,{})]})});exports.SwitchField=a;
2
2
  //# sourceMappingURL=switch-field.cjs.map
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime10 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime8 from "react/jsx-runtime";
2
2
  import { FieldPath, FieldValues } from "react-hook-form";
3
3
 
4
4
  //#region packages/components/forms/switch-field.d.ts
@@ -13,7 +13,7 @@ declare const SwitchField: <TFieldValues extends FieldValues = FieldValues>({
13
13
  label,
14
14
  description,
15
15
  isShowErrorMsg
16
- }: Props<TFieldValues>) => react_jsx_runtime10.JSX.Element;
16
+ }: Props<TFieldValues>) => react_jsx_runtime8.JSX.Element;
17
17
  //#endregion
18
18
  export { SwitchField };
19
19
  //# sourceMappingURL=switch-field.d.cts.map
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime13 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime10 from "react/jsx-runtime";
2
2
  import { FieldPath, FieldValues } from "react-hook-form";
3
3
 
4
4
  //#region packages/components/forms/switch-field.d.ts
@@ -13,7 +13,7 @@ declare const SwitchField: <TFieldValues extends FieldValues = FieldValues>({
13
13
  label,
14
14
  description,
15
15
  isShowErrorMsg
16
- }: Props<TFieldValues>) => react_jsx_runtime13.JSX.Element;
16
+ }: Props<TFieldValues>) => react_jsx_runtime10.JSX.Element;
17
17
  //#endregion
18
18
  export { SwitchField };
19
19
  //# sourceMappingURL=switch-field.d.ts.map
@@ -1,2 +1,2 @@
1
- "use client";import"../label-DdpIoRiG.js";import{FormControl as e,FormDescription as t,FormField as n,FormItem as r,FormLabel as i,FormMessage as a}from"../form-D-gDMD-J.js";import{Switch as o}from"../switch-Crju8DJO.js";import{cn as s}from"@customafk/react-toolkit/utils";import{jsx as c,jsxs as l}from"react/jsx-runtime";const u=({name:u,label:d=`Switch Field`,description:f,isShowErrorMsg:p=!1})=>c(n,{name:u,render:({field:n})=>l(`div`,{className:`spage-y-1`,children:[l(r,{className:s(`border-border-weak flex flex-row items-center justify-between rounded-lg border p-3 shadow-xs`),children:[l(`div`,{className:`space-y-0.5`,children:[c(i,{className:`cursor-pointer text-sm`,children:d}),f&&c(t,{className:`text-xs`,children:f})]}),c(e,{children:c(o,{checked:n.value,onCheckedChange:n.onChange})})]}),p&&c(a,{})]})});export{u as SwitchField};
1
+ "use client";import"../label-D4GUfxTB.js";import{FormControl as e,FormDescription as t,FormField as n,FormItem as r,FormLabel as i,FormMessage as a}from"../form-C4Zn5Meu.js";import{Switch as o}from"../switch-iwm2-R_e.js";import{cn as s}from"@customafk/react-toolkit/utils";import{jsx as c,jsxs as l}from"react/jsx-runtime";const u=({name:u,label:d=`Switch Field`,description:f,isShowErrorMsg:p=!1})=>c(n,{name:u,render:({field:n})=>l(`div`,{className:`spage-y-1`,children:[l(r,{className:s(`border-border-weak flex flex-row items-center justify-between rounded-lg border p-3 shadow-xs`),children:[l(`div`,{className:`space-y-0.5`,children:[c(i,{className:`cursor-pointer text-sm`,children:d}),f&&c(t,{className:`text-xs`,children:f})]}),c(e,{children:c(o,{checked:n.value,onCheckedChange:n.onChange})})]}),p&&c(a,{})]})});export{u as SwitchField};
2
2
  //# sourceMappingURL=switch-field.js.map
@@ -1,2 +1,2 @@
1
- "use client";const e=require(`../chunk-CUT6urMc.cjs`),t=require(`../flex-DMgD86BT.cjs`);require(`../label-BBPPT0-L.cjs`);const n=require(`../form-CaxhlWxK.cjs`),r=require(`../input-ERPHY3v4.cjs`),i=e.__toESM(require(`lucide-react`)),a=e.__toESM(require(`@customafk/react-toolkit/utils`)),o=e.__toESM(require(`react/jsx-runtime`)),s=e.__toESM(require(`react`)),c=e.__toESM(require(`react-hook-form`)),l=({name:e,label:l=`Text Field`,placeholder:u=`Enter text here`,isShowLabel:d=!0,isShowClearButton:f=!1,isShowErrorMsg:p=!1,isShowCount:m=!1,description:h,className:g=``,onValueChange:_})=>{let{resetField:v}=n.useFormField(),y=(0,c.useWatch)({name:e}),b=(0,s.useCallback)(()=>{v(e)},[v,e]);return(0,o.jsx)(n.FormField,{name:e,render:({field:e})=>(0,o.jsxs)(n.FormItem,{className:(0,a.cn)(`w-full gap-0`,m||!!h&&`space-y-1`,g),children:[d&&(0,o.jsx)(n.FormLabel,{children:l}),(0,o.jsxs)(`div`,{className:`relative`,children:[(0,o.jsx)(n.FormControl,{children:(0,o.jsx)(r.Input,{...e,placeholder:u,className:(0,a.cn)(`w-full`,f&&`pr-9`),onValueChange:_})}),f&&y&&(0,o.jsx)(`button`,{type:`button`,className:`text-text-positive-weak hover:text-text-positive focus-visible:ring-border absolute inset-y-0 end-0 flex h-full w-8 cursor-pointer items-center justify-center rounded-e-md transition-[color,box-shadow] outline-none focus:z-10 focus-visible:ring-2`,"aria-label":`Clear input`,onClick:b,children:(0,o.jsx)(i.XIcon,{size:14,"aria-hidden":`true`})})]}),(0,o.jsxs)(t.Flex,{width:`full`,padding:`none`,justify:`end`,children:[p&&(0,o.jsx)(n.FormMessage,{className:`grow`}),m&&(0,o.jsxs)(`div`,{className:`text-text-positive-weak text-end text-xs`,children:[y?.length??0,` characters`]})]}),!!h&&(0,o.jsx)(n.FormDescription,{children:h})]})})};exports.TextField=l;
1
+ "use client";const e=require(`../chunk-CUT6urMc.cjs`);require(`../label-BM6rVDz-.cjs`);const t=require(`../form-A2qAueDp.cjs`),n=require(`../flex-e9OPvFYl.cjs`),r=require(`../input-DgtTVBtN.cjs`),i=e.__toESM(require(`lucide-react`)),a=e.__toESM(require(`@customafk/react-toolkit/utils`)),o=e.__toESM(require(`react/jsx-runtime`)),s=e.__toESM(require(`react`)),c=e.__toESM(require(`react-hook-form`)),l=({name:e,label:l=`Text Field`,placeholder:u=`Enter text here`,isShowLabel:d=!0,isShowClearButton:f=!1,isShowErrorMsg:p=!1,isShowCount:m=!1,description:h,className:g=``,onValueChange:_})=>{let{resetField:v}=t.useFormField(),y=(0,c.useWatch)({name:e}),b=(0,s.useCallback)(()=>{v(e)},[v,e]);return(0,o.jsx)(t.FormField,{name:e,render:({field:e})=>(0,o.jsxs)(t.FormItem,{className:(0,a.cn)(`w-full gap-0`,m||!!h&&`space-y-1`,g),children:[d&&(0,o.jsx)(t.FormLabel,{children:l}),(0,o.jsxs)(`div`,{className:`relative`,children:[(0,o.jsx)(t.FormControl,{children:(0,o.jsx)(r.Input,{...e,placeholder:u,className:(0,a.cn)(`w-full`,f&&`pr-9`),onValueChange:_})}),f&&y&&(0,o.jsx)(`button`,{type:`button`,className:`text-text-positive-weak hover:text-text-positive focus-visible:ring-border absolute inset-y-0 end-0 flex h-full w-8 cursor-pointer items-center justify-center rounded-e-md transition-[color,box-shadow] outline-none focus:z-10 focus-visible:ring-2`,"aria-label":`Clear input`,onClick:b,children:(0,o.jsx)(i.XIcon,{size:14,"aria-hidden":`true`})})]}),(0,o.jsxs)(n.Flex,{width:`full`,padding:`none`,justify:`end`,children:[p&&(0,o.jsx)(t.FormMessage,{className:`grow`}),m&&(0,o.jsxs)(`div`,{className:`text-text-positive-weak text-end text-xs`,children:[y?.length??0,` characters`]})]}),!!h&&(0,o.jsx)(t.FormDescription,{children:h})]})})};exports.TextField=l;
2
2
  //# sourceMappingURL=text-field.cjs.map
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime9 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime3 from "react/jsx-runtime";
2
2
  import { FieldPath, FieldValues } from "react-hook-form";
3
3
 
4
4
  //#region packages/components/forms/text-field.d.ts
@@ -25,7 +25,7 @@ declare const TextField: <TFieldValues extends FieldValues = FieldValues>({
25
25
  description,
26
26
  className,
27
27
  onValueChange
28
- }: Props<TFieldValues>) => react_jsx_runtime9.JSX.Element;
28
+ }: Props<TFieldValues>) => react_jsx_runtime3.JSX.Element;
29
29
  //#endregion
30
30
  export { TextField };
31
31
  //# sourceMappingURL=text-field.d.cts.map