@customafk/lunas-ui 0.0.86 → 0.0.88

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 (414) hide show
  1. package/dist/{add-new-D-WSaAM3.cjs → add-new-CQefL6PU.cjs} +2 -2
  2. package/dist/{add-new-D-WSaAM3.cjs.map → add-new-CQefL6PU.cjs.map} +1 -1
  3. package/dist/{add-new-CDApqBax.js → add-new-ChBwRRMT.js} +2 -2
  4. package/dist/{add-new-CDApqBax.js.map → add-new-ChBwRRMT.js.map} +1 -1
  5. package/dist/{alert-dialog-Di6rTULI.js → alert-dialog-BfKVH-9l.js} +1 -1
  6. package/dist/{alert-dialog-Di6rTULI.js.map → alert-dialog-BfKVH-9l.js.map} +1 -1
  7. package/dist/{alert-dialog-DmsZNeeJ.cjs → alert-dialog-mR3avgRt.cjs} +1 -1
  8. package/dist/{alert-dialog-DmsZNeeJ.cjs.map → alert-dialog-mR3avgRt.cjs.map} +1 -1
  9. package/dist/{avatar-96dXWrWU.cjs → avatar-DmMCBvb6.cjs} +1 -1
  10. package/dist/{avatar-96dXWrWU.cjs.map → avatar-DmMCBvb6.cjs.map} +1 -1
  11. package/dist/{avatar-CcbiQ1mq.js → avatar-iX5Jhj8E.js} +1 -1
  12. package/dist/{avatar-CcbiQ1mq.js.map → avatar-iX5Jhj8E.js.map} +1 -1
  13. package/dist/{badge-B1y6KFfh.cjs → badge-AM9m3CFI.cjs} +1 -1
  14. package/dist/{badge-B1y6KFfh.cjs.map → badge-AM9m3CFI.cjs.map} +1 -1
  15. package/dist/{badge-DWc4Idn2.js → badge-tjlLdDGl.js} +1 -1
  16. package/dist/{badge-DWc4Idn2.js.map → badge-tjlLdDGl.js.map} +1 -1
  17. package/dist/{button-CIP-EkY5.d.ts → button-1P415ChS.d.ts} +5 -5
  18. package/dist/{button-BR2WmoAo.d.cts → button-C2X9i66F.d.cts} +3 -3
  19. package/dist/{calendar-D_C_Qeu7.cjs → calendar-Brdd41FH.cjs} +1 -1
  20. package/dist/{calendar-D_C_Qeu7.cjs.map → calendar-Brdd41FH.cjs.map} +1 -1
  21. package/dist/{calendar-et-igmiY.js → calendar-Diid0R3S.js} +1 -1
  22. package/dist/{calendar-et-igmiY.js.map → calendar-Diid0R3S.js.map} +1 -1
  23. package/dist/cards/simple-card.d.cts +2 -2
  24. package/dist/cards/simple-card.d.ts +2 -2
  25. package/dist/{command-DKXFheVV.d.ts → command-BjHx5Inl.d.ts} +12 -12
  26. package/dist/{command-CevqI1YQ.cjs → command-C13pL2M3.cjs} +2 -2
  27. package/dist/{command-CevqI1YQ.cjs.map → command-C13pL2M3.cjs.map} +1 -1
  28. package/dist/{command-BvHe__3s.js → command-UXLmHGja.js} +2 -2
  29. package/dist/{command-BvHe__3s.js.map → command-UXLmHGja.js.map} +1 -1
  30. package/dist/{command-GmjW1L4_.d.cts → command-uT35RV8K.d.cts} +12 -12
  31. package/dist/data-display/country.cjs +1 -1
  32. package/dist/data-display/country.js +1 -1
  33. package/dist/data-display/data-list.cjs +1 -1
  34. package/dist/data-display/data-list.js +1 -1
  35. package/dist/data-display/date-tooltip.cjs +1 -1
  36. package/dist/data-display/date-tooltip.js +1 -1
  37. package/dist/data-display/date.cjs +1 -1
  38. package/dist/data-display/date.js +1 -1
  39. package/dist/data-display/empty.cjs +1 -1
  40. package/dist/data-display/empty.d.cts +2 -2
  41. package/dist/data-display/empty.d.ts +2 -2
  42. package/dist/data-display/empty.js +1 -1
  43. package/dist/data-display/name.cjs +1 -1
  44. package/dist/data-display/name.js +1 -1
  45. package/dist/data-display/phone-number.cjs +1 -1
  46. package/dist/data-display/phone-number.js +1 -1
  47. package/dist/data-display/role-badge.cjs +1 -1
  48. package/dist/data-display/role-badge.js +1 -1
  49. package/dist/data-display/statistic.cjs +1 -1
  50. package/dist/data-display/statistic.d.cts +2 -2
  51. package/dist/data-display/statistic.d.ts +2 -2
  52. package/dist/data-display/statistic.js +1 -1
  53. package/dist/data-display/user.cjs +1 -1
  54. package/dist/data-display/user.js +1 -1
  55. package/dist/{date-vWvu4M91.cjs → date-BEyT-xKi.cjs} +1 -1
  56. package/dist/{date-vWvu4M91.cjs.map → date-BEyT-xKi.cjs.map} +1 -1
  57. package/dist/{date-4JlD-xYj.js → date-CgzMwDPN.js} +1 -1
  58. package/dist/{date-4JlD-xYj.js.map → date-CgzMwDPN.js.map} +1 -1
  59. package/dist/{dialog-OTHc6G5i.js → dialog-BAlJ18xi.js} +1 -1
  60. package/dist/{dialog-OTHc6G5i.js.map → dialog-BAlJ18xi.js.map} +1 -1
  61. package/dist/{dialog-Bd723gV6.cjs → dialog-BBODhbxh.cjs} +1 -1
  62. package/dist/{dialog-Bd723gV6.cjs.map → dialog-BBODhbxh.cjs.map} +1 -1
  63. package/dist/{dialog-BHDL777e.d.ts → dialog-BFte9fya.d.ts} +12 -12
  64. package/dist/{dialog-Dbdaspqo.d.cts → dialog-BZm3y2ej.d.cts} +12 -12
  65. package/dist/dialogs/confirm-dialog.cjs +1 -1
  66. package/dist/dialogs/confirm-dialog.js +1 -1
  67. package/dist/dialogs/detail-dialog/component/sidebar.cjs +1 -1
  68. package/dist/dialogs/detail-dialog/component/sidebar.d.cts +28 -28
  69. package/dist/dialogs/detail-dialog/component/sidebar.d.ts +28 -28
  70. package/dist/dialogs/detail-dialog/component/sidebar.js +1 -1
  71. package/dist/dialogs/detail-dialog/index.cjs +1 -1
  72. package/dist/dialogs/detail-dialog/index.js +1 -1
  73. package/dist/dialogs/error-dialog.cjs +1 -1
  74. package/dist/dialogs/error-dialog.js +1 -1
  75. package/dist/dialogs/form-dialog.cjs +1 -1
  76. package/dist/dialogs/form-dialog.d.cts +2 -2
  77. package/dist/dialogs/form-dialog.d.ts +2 -2
  78. package/dist/dialogs/form-dialog.js +1 -1
  79. package/dist/dialogs/loading-dialog.cjs +1 -1
  80. package/dist/dialogs/loading-dialog.js +1 -1
  81. package/dist/{drawer-C6IT7ONM.js → drawer-BT0osH1O.js} +1 -1
  82. package/dist/{drawer-C6IT7ONM.js.map → drawer-BT0osH1O.js.map} +1 -1
  83. package/dist/{drawer-Dc432Nt9.cjs → drawer-C3vvvU_D.cjs} +1 -1
  84. package/dist/{drawer-Dc432Nt9.cjs.map → drawer-C3vvvU_D.cjs.map} +1 -1
  85. package/dist/{error-dialog-pTwyWIE5.cjs → error-dialog-BVTB1EEF.cjs} +2 -2
  86. package/dist/{error-dialog-pTwyWIE5.cjs.map → error-dialog-BVTB1EEF.cjs.map} +1 -1
  87. package/dist/{error-dialog-_FqKuIY6.js → error-dialog-DMGVy3dG.js} +2 -2
  88. package/dist/{error-dialog-_FqKuIY6.js.map → error-dialog-DMGVy3dG.js.map} +1 -1
  89. package/dist/{field-B_qC62YD.cjs → field-A43YZ5Wj.cjs} +2 -2
  90. package/dist/{field-B_qC62YD.cjs.map → field-A43YZ5Wj.cjs.map} +1 -1
  91. package/dist/{field-DSScKMdZ.js → field-CGacT8J3.js} +2 -2
  92. package/dist/{field-DSScKMdZ.js.map → field-CGacT8J3.js.map} +1 -1
  93. package/dist/{flex-DgmCJ9Bz.cjs → flex-B4klVEz9.cjs} +1 -1
  94. package/dist/{flex-DgmCJ9Bz.cjs.map → flex-B4klVEz9.cjs.map} +1 -1
  95. package/dist/{flex-BJgsQWLI.js → flex-D6XrXRQW.js} +1 -1
  96. package/dist/{flex-BJgsQWLI.js.map → flex-D6XrXRQW.js.map} +1 -1
  97. package/dist/{form-DbknMHac.js → form-B_tL9lO4.js} +2 -2
  98. package/dist/{form-DbknMHac.js.map → form-B_tL9lO4.js.map} +1 -1
  99. package/dist/{form-t4WaMbFV.cjs → form-DV9tQbiO.cjs} +2 -2
  100. package/dist/{form-t4WaMbFV.cjs.map → form-DV9tQbiO.cjs.map} +1 -1
  101. package/dist/{form-wrapper-BbZebVv0.js → form-wrapper-BYwaFsJd.js} +2 -2
  102. package/dist/{form-wrapper-BbZebVv0.js.map → form-wrapper-BYwaFsJd.js.map} +1 -1
  103. package/dist/{form-wrapper-DImTyC_E.cjs → form-wrapper-CODuD3w6.cjs} +2 -2
  104. package/dist/{form-wrapper-DImTyC_E.cjs.map → form-wrapper-CODuD3w6.cjs.map} +1 -1
  105. package/dist/forms/combobox-field.cjs +1 -1
  106. package/dist/forms/combobox-field.d.ts +2 -2
  107. package/dist/forms/combobox-field.js +1 -1
  108. package/dist/forms/date-field.cjs +1 -1
  109. package/dist/forms/date-field.d.cts +2 -2
  110. package/dist/forms/date-field.d.ts +2 -2
  111. package/dist/forms/date-field.js +1 -1
  112. package/dist/forms/form-wrapper.cjs +1 -1
  113. package/dist/forms/form-wrapper.d.cts +2 -2
  114. package/dist/forms/form-wrapper.d.ts +2 -2
  115. package/dist/forms/form-wrapper.js +1 -1
  116. package/dist/forms/multi-select-field.cjs +1 -1
  117. package/dist/forms/multi-select-field.cjs.map +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.d.cts +2 -2
  127. package/dist/forms/password-field.d.ts +2 -2
  128. package/dist/forms/password-field.js +1 -1
  129. package/dist/forms/select-field.cjs +1 -1
  130. package/dist/forms/select-field.d.cts +2 -2
  131. package/dist/forms/select-field.d.ts +2 -2
  132. package/dist/forms/select-field.js +1 -1
  133. package/dist/forms/switch-field.cjs +1 -1
  134. package/dist/forms/switch-field.d.cts +2 -2
  135. package/dist/forms/switch-field.d.ts +2 -2
  136. package/dist/forms/switch-field.js +1 -1
  137. package/dist/forms/text-field.cjs +1 -1
  138. package/dist/forms/text-field.d.cts +2 -2
  139. package/dist/forms/text-field.d.ts +2 -2
  140. package/dist/forms/text-field.js +1 -1
  141. package/dist/forms/textarea-field.cjs +1 -1
  142. package/dist/forms/textarea-field.d.cts +2 -2
  143. package/dist/forms/textarea-field.d.ts +2 -2
  144. package/dist/forms/textarea-field.js +1 -1
  145. package/dist/{input-B-l6tT_9.js → input-BStypTnq.js} +1 -1
  146. package/dist/{input-B-l6tT_9.js.map → input-BStypTnq.js.map} +1 -1
  147. package/dist/{input-C-dBPJHZ.d.ts → input-CmgoBSAW.d.ts} +3 -3
  148. package/dist/{input-C29DSPln.d.cts → input-CuIZ0UZi.d.cts} +3 -3
  149. package/dist/{input-D7aXVX7j.cjs → input-D_tClptL.cjs} +1 -1
  150. package/dist/{input-D7aXVX7j.cjs.map → input-D_tClptL.cjs.map} +1 -1
  151. package/dist/label--G642FfM.d.cts +11 -0
  152. package/dist/{label-CRhvNQY4.js → label-CdrxlBJ8.js} +1 -1
  153. package/dist/{label-CRhvNQY4.js.map → label-CdrxlBJ8.js.map} +1 -1
  154. package/dist/{label-BMBHBFRY.cjs → label-D6mAvVmw.cjs} +1 -1
  155. package/dist/{label-BMBHBFRY.cjs.map → label-D6mAvVmw.cjs.map} +1 -1
  156. package/dist/{label-2SrK79Ib.d.ts → label-DRUB18K3.d.ts} +3 -3
  157. package/dist/layouts/app-layout/index.cjs +1 -1
  158. package/dist/layouts/app-layout/index.d.cts +26 -26
  159. package/dist/layouts/app-layout/index.d.ts +26 -26
  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 +13 -13
  168. package/dist/layouts/service-layout/index.d.ts +15 -15
  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-CQdR0wzH.js → multi-select-Bqqk4Tiu.js} +2 -2
  172. package/dist/{multi-select-CQdR0wzH.js.map → multi-select-Bqqk4Tiu.js.map} +1 -1
  173. package/dist/{multi-select-Dl54UfMM.cjs → multi-select-DFaIxSYQ.cjs} +2 -2
  174. package/dist/{multi-select-Dl54UfMM.cjs.map → multi-select-DFaIxSYQ.cjs.map} +1 -1
  175. package/dist/pages/FeatureDeveloping.cjs +2 -0
  176. package/dist/pages/FeatureDeveloping.cjs.map +1 -0
  177. package/dist/pages/FeatureDeveloping.d.cts +25 -0
  178. package/dist/pages/FeatureDeveloping.d.ts +25 -0
  179. package/dist/pages/FeatureDeveloping.js +2 -0
  180. package/dist/pages/FeatureDeveloping.js.map +1 -0
  181. package/dist/pages/FeatureFixing.cjs +2 -0
  182. package/dist/pages/FeatureFixing.cjs.map +1 -0
  183. package/dist/pages/FeatureFixing.d.cts +25 -0
  184. package/dist/pages/FeatureFixing.d.ts +25 -0
  185. package/dist/pages/FeatureFixing.js +2 -0
  186. package/dist/pages/FeatureFixing.js.map +1 -0
  187. package/dist/pages/NotAuthorized.cjs +2 -0
  188. package/dist/pages/NotAuthorized.cjs.map +1 -0
  189. package/dist/pages/NotAuthorized.d.cts +25 -0
  190. package/dist/pages/NotAuthorized.d.ts +25 -0
  191. package/dist/pages/NotAuthorized.js +2 -0
  192. package/dist/pages/NotAuthorized.js.map +1 -0
  193. package/dist/pages/NotFound.cjs +2 -0
  194. package/dist/pages/NotFound.cjs.map +1 -0
  195. package/dist/pages/NotFound.d.cts +25 -0
  196. package/dist/pages/NotFound.d.ts +25 -0
  197. package/dist/pages/NotFound.js +2 -0
  198. package/dist/pages/NotFound.js.map +1 -0
  199. package/dist/{paragraph-BuE9WF5p.js → paragraph-B9fp9JaI.js} +1 -1
  200. package/dist/{paragraph-BuE9WF5p.js.map → paragraph-B9fp9JaI.js.map} +1 -1
  201. package/dist/{paragraph-GYX6NlXZ.cjs → paragraph-Q7vk3BSp.cjs} +1 -1
  202. package/dist/{paragraph-GYX6NlXZ.cjs.map → paragraph-Q7vk3BSp.cjs.map} +1 -1
  203. package/dist/{popover-l3a5exlI.js → popover-BnzoeyDG.js} +1 -1
  204. package/dist/{popover-l3a5exlI.js.map → popover-BnzoeyDG.js.map} +1 -1
  205. package/dist/{popover-DODAZTiX.cjs → popover-D6vyPDKA.cjs} +1 -1
  206. package/dist/{popover-DODAZTiX.cjs.map → popover-D6vyPDKA.cjs.map} +1 -1
  207. package/dist/products/product-loading-page.cjs +1 -1
  208. package/dist/products/product-loading-page.js +1 -1
  209. package/dist/products/product-quantity-control.cjs +1 -1
  210. package/dist/products/product-quantity-control.d.cts +2 -2
  211. package/dist/products/product-quantity-control.d.ts +2 -2
  212. package/dist/products/product-quantity-control.js +1 -1
  213. package/dist/{refresh-CfPFo89K.cjs → refresh-DGM3XAqT.cjs} +2 -2
  214. package/dist/{refresh-CfPFo89K.cjs.map → refresh-DGM3XAqT.cjs.map} +1 -1
  215. package/dist/{refresh-CNiYCRLZ.js → refresh-MkZTkXVm.js} +2 -2
  216. package/dist/{refresh-CNiYCRLZ.js.map → refresh-MkZTkXVm.js.map} +1 -1
  217. package/dist/{search-input-CMNLrUk0.js → search-input-B_rAonEV.js} +2 -2
  218. package/dist/{search-input-CMNLrUk0.js.map → search-input-B_rAonEV.js.map} +1 -1
  219. package/dist/{search-input-p1W5kb6R.cjs → search-input-DsQEWS7b.cjs} +2 -2
  220. package/dist/{search-input-p1W5kb6R.cjs.map → search-input-DsQEWS7b.cjs.map} +1 -1
  221. package/dist/{select-czrPwYWJ.js → select-B8sXsuUI.js} +1 -1
  222. package/dist/{select-czrPwYWJ.js.map → select-B8sXsuUI.js.map} +1 -1
  223. package/dist/{select-DfJYL2rL.cjs → select-BD7dul2u.cjs} +1 -1
  224. package/dist/{select-DfJYL2rL.cjs.map → select-BD7dul2u.cjs.map} +1 -1
  225. package/dist/{separator-BvLD0phP.d.cts → separator-CJ5l6PAp.d.cts} +3 -3
  226. package/dist/{separator-BC_ytI76.d.ts → separator-CTpzoczB.d.ts} +3 -3
  227. package/dist/{separator-C5dPRhYx.js → separator-D17HxS2f.js} +1 -1
  228. package/dist/{separator-C5dPRhYx.js.map → separator-D17HxS2f.js.map} +1 -1
  229. package/dist/{separator-BAyL2IIW.cjs → separator-DMMoR-d2.cjs} +1 -1
  230. package/dist/{separator-BAyL2IIW.cjs.map → separator-DMMoR-d2.cjs.map} +1 -1
  231. package/dist/{sidebar-9ODHuW8Q.js → sidebar-CSbPdy7R.js} +2 -2
  232. package/dist/{sidebar-9ODHuW8Q.js.map → sidebar-CSbPdy7R.js.map} +1 -1
  233. package/dist/{sidebar-ChCtr6kn.cjs → sidebar-GgMyovhB.cjs} +2 -2
  234. package/dist/{sidebar-ChCtr6kn.cjs.map → sidebar-GgMyovhB.cjs.map} +1 -1
  235. package/dist/{switch-B5eIeKX7.js → switch-DwBg-iL4.js} +1 -1
  236. package/dist/{switch-B5eIeKX7.js.map → switch-DwBg-iL4.js.map} +1 -1
  237. package/dist/{switch-C6peIJVm.cjs → switch-o_YbWKw4.cjs} +1 -1
  238. package/dist/{switch-C6peIJVm.cjs.map → switch-o_YbWKw4.cjs.map} +1 -1
  239. package/dist/table/index.cjs +1 -1
  240. package/dist/table/index.cjs.map +1 -1
  241. package/dist/table/index.d.cts +2 -2
  242. package/dist/table/index.d.ts +2 -2
  243. package/dist/table/index.js +1 -1
  244. package/dist/{textarea-C3ZQALlB.cjs → textarea-BHME8i5L.cjs} +1 -1
  245. package/dist/{textarea-C3ZQALlB.cjs.map → textarea-BHME8i5L.cjs.map} +1 -1
  246. package/dist/{textarea-BVj6PCYB.js → textarea-TGDtYde1.js} +1 -1
  247. package/dist/{textarea-BVj6PCYB.js.map → textarea-TGDtYde1.js.map} +1 -1
  248. package/dist/{toggle-CMYTXtd1.d.cts → toggle-BemciJ_z.d.ts} +4 -4
  249. package/dist/{toggle-Mb-P3MuO.d.ts → toggle-Dr5qQygc.d.cts} +5 -5
  250. package/dist/{tooltip-DHD6S-vH.js → tooltip-BTrjCwd8.js} +1 -1
  251. package/dist/{tooltip-DHD6S-vH.js.map → tooltip-BTrjCwd8.js.map} +1 -1
  252. package/dist/{tooltip-Clkt7Knc.d.ts → tooltip-BX0WfPh7.d.ts} +6 -6
  253. package/dist/{tooltip-CX0O7o4v.d.cts → tooltip-BkMgwr-w.d.cts} +6 -6
  254. package/dist/{tooltip-v0ikl3om.cjs → tooltip-uaF-pxx8.cjs} +1 -1
  255. package/dist/{tooltip-v0ikl3om.cjs.map → tooltip-uaF-pxx8.cjs.map} +1 -1
  256. package/dist/{types-BfVUsI26.js → types-BiiGENwa.js} +1 -1
  257. package/dist/{types-BfVUsI26.js.map → types-BiiGENwa.js.map} +1 -1
  258. package/dist/{types-_t74BXO1.cjs → types-D32qXHff.cjs} +1 -1
  259. package/dist/{types-_t74BXO1.cjs.map → types-D32qXHff.cjs.map} +1 -1
  260. package/dist/typography/paragraph.cjs +1 -1
  261. package/dist/typography/paragraph.d.cts +2 -2
  262. package/dist/typography/paragraph.js +1 -1
  263. package/dist/typography/title.d.cts +2 -2
  264. package/dist/typography/title.d.ts +2 -2
  265. package/dist/ui/alert-dialog.cjs +1 -1
  266. package/dist/ui/alert-dialog.d.cts +12 -12
  267. package/dist/ui/alert-dialog.d.ts +12 -12
  268. package/dist/ui/alert-dialog.js +1 -1
  269. package/dist/ui/alert.d.cts +4 -4
  270. package/dist/ui/alert.d.ts +4 -4
  271. package/dist/ui/aspect-ratio.d.cts +2 -2
  272. package/dist/ui/aspect-ratio.d.ts +2 -2
  273. package/dist/ui/avatar.cjs +1 -1
  274. package/dist/ui/avatar.d.cts +4 -4
  275. package/dist/ui/avatar.d.ts +4 -4
  276. package/dist/ui/avatar.js +1 -1
  277. package/dist/ui/badge.cjs +1 -1
  278. package/dist/ui/badge.d.cts +2 -2
  279. package/dist/ui/badge.d.ts +2 -2
  280. package/dist/ui/badge.js +1 -1
  281. package/dist/ui/breadcrumb.d.cts +8 -8
  282. package/dist/ui/breadcrumb.d.ts +8 -8
  283. package/dist/ui/button-group.cjs +1 -1
  284. package/dist/ui/button-group.d.cts +5 -5
  285. package/dist/ui/button-group.d.ts +5 -5
  286. package/dist/ui/button-group.js +1 -1
  287. package/dist/ui/button.d.cts +1 -1
  288. package/dist/ui/button.d.ts +1 -1
  289. package/dist/ui/buttons/add-new.cjs +1 -1
  290. package/dist/ui/buttons/add-new.js +1 -1
  291. package/dist/ui/buttons/refresh.cjs +1 -1
  292. package/dist/ui/buttons/refresh.js +1 -1
  293. package/dist/ui/calendar.cjs +1 -1
  294. package/dist/ui/calendar.d.cts +4 -4
  295. package/dist/ui/calendar.d.ts +4 -4
  296. package/dist/ui/calendar.js +1 -1
  297. package/dist/ui/card.d.cts +8 -8
  298. package/dist/ui/card.d.ts +8 -8
  299. package/dist/ui/carousel.d.cts +7 -7
  300. package/dist/ui/carousel.d.ts +7 -7
  301. package/dist/ui/collapsible.d.cts +4 -4
  302. package/dist/ui/collapsible.d.ts +4 -4
  303. package/dist/ui/command.cjs +1 -1
  304. package/dist/ui/command.d.cts +2 -2
  305. package/dist/ui/command.d.ts +2 -2
  306. package/dist/ui/command.js +1 -1
  307. package/dist/ui/context-menu.d.cts +16 -16
  308. package/dist/ui/context-menu.d.ts +16 -16
  309. package/dist/ui/dialog.cjs +1 -1
  310. package/dist/ui/dialog.d.cts +1 -1
  311. package/dist/ui/dialog.d.ts +1 -1
  312. package/dist/ui/dialog.js +1 -1
  313. package/dist/ui/drawer.cjs +1 -1
  314. package/dist/ui/drawer.d.cts +11 -11
  315. package/dist/ui/drawer.d.ts +11 -11
  316. package/dist/ui/drawer.js +1 -1
  317. package/dist/ui/dropdown-menu.d.cts +16 -16
  318. package/dist/ui/dropdown-menu.d.ts +16 -16
  319. package/dist/ui/empty.d.cts +7 -7
  320. package/dist/ui/empty.d.ts +7 -7
  321. package/dist/ui/field.cjs +1 -1
  322. package/dist/ui/field.d.cts +12 -12
  323. package/dist/ui/field.d.ts +12 -12
  324. package/dist/ui/field.js +1 -1
  325. package/dist/ui/file-uploader.d.cts +2 -2
  326. package/dist/ui/file-uploader.d.ts +2 -2
  327. package/dist/ui/form.cjs +1 -1
  328. package/dist/ui/form.d.cts +7 -7
  329. package/dist/ui/form.d.ts +7 -7
  330. package/dist/ui/form.js +1 -1
  331. package/dist/ui/hover-card.d.cts +4 -4
  332. package/dist/ui/hover-card.d.ts +4 -4
  333. package/dist/ui/input-otp.d.cts +5 -5
  334. package/dist/ui/input-otp.d.ts +5 -5
  335. package/dist/ui/input.cjs +1 -1
  336. package/dist/ui/input.d.cts +1 -1
  337. package/dist/ui/input.d.ts +1 -1
  338. package/dist/ui/input.js +1 -1
  339. package/dist/ui/inputs/search-input.cjs +1 -1
  340. package/dist/ui/inputs/search-input.d.cts +3 -3
  341. package/dist/ui/inputs/search-input.d.ts +3 -3
  342. package/dist/ui/inputs/search-input.js +1 -1
  343. package/dist/ui/item.cjs +1 -1
  344. package/dist/ui/item.d.cts +12 -12
  345. package/dist/ui/item.d.ts +12 -12
  346. package/dist/ui/item.js +1 -1
  347. package/dist/ui/label.cjs +1 -1
  348. package/dist/ui/label.d.cts +1 -1
  349. package/dist/ui/label.d.ts +1 -1
  350. package/dist/ui/label.js +1 -1
  351. package/dist/ui/menubar.d.cts +17 -17
  352. package/dist/ui/menubar.d.ts +17 -17
  353. package/dist/ui/multi-select.cjs +1 -1
  354. package/dist/ui/multi-select.d.cts +2 -2
  355. package/dist/ui/multi-select.d.ts +2 -2
  356. package/dist/ui/multi-select.js +1 -1
  357. package/dist/ui/navigation-menu.d.cts +9 -9
  358. package/dist/ui/navigation-menu.d.ts +9 -9
  359. package/dist/ui/pagination.d.cts +9 -9
  360. package/dist/ui/pagination.d.ts +9 -9
  361. package/dist/ui/popover.cjs +1 -1
  362. package/dist/ui/popover.d.cts +5 -5
  363. package/dist/ui/popover.d.ts +5 -5
  364. package/dist/ui/popover.js +1 -1
  365. package/dist/ui/progress.d.cts +2 -2
  366. package/dist/ui/progress.d.ts +2 -2
  367. package/dist/ui/radio-group.d.cts +3 -3
  368. package/dist/ui/radio-group.d.ts +3 -3
  369. package/dist/ui/resizable.d.cts +4 -4
  370. package/dist/ui/resizable.d.ts +4 -4
  371. package/dist/ui/scroll-area.d.cts +3 -3
  372. package/dist/ui/select.cjs +1 -1
  373. package/dist/ui/select.d.cts +11 -11
  374. package/dist/ui/select.d.ts +11 -11
  375. package/dist/ui/select.js +1 -1
  376. package/dist/ui/separator.cjs +1 -1
  377. package/dist/ui/separator.d.cts +1 -1
  378. package/dist/ui/separator.d.ts +1 -1
  379. package/dist/ui/separator.js +1 -1
  380. package/dist/ui/sheet.d.cts +9 -9
  381. package/dist/ui/sidebar.cjs +1 -1
  382. package/dist/ui/sidebar.d.cts +28 -28
  383. package/dist/ui/sidebar.d.ts +6 -6
  384. package/dist/ui/sidebar.js +1 -1
  385. package/dist/ui/skeleton.d.cts +2 -2
  386. package/dist/ui/skeleton.d.ts +2 -2
  387. package/dist/ui/slider.d.cts +2 -2
  388. package/dist/ui/slider.d.ts +2 -2
  389. package/dist/ui/sonner.d.cts +2 -2
  390. package/dist/ui/sonner.d.ts +2 -2
  391. package/dist/ui/spinner.d.cts +2 -2
  392. package/dist/ui/spinner.d.ts +2 -2
  393. package/dist/ui/switch.cjs +1 -1
  394. package/dist/ui/switch.d.cts +2 -2
  395. package/dist/ui/switch.d.ts +2 -2
  396. package/dist/ui/switch.js +1 -1
  397. package/dist/ui/table.d.cts +9 -9
  398. package/dist/ui/table.d.ts +9 -9
  399. package/dist/ui/tabs.d.cts +5 -5
  400. package/dist/ui/tabs.d.ts +5 -5
  401. package/dist/ui/textarea.cjs +1 -1
  402. package/dist/ui/textarea.d.cts +2 -2
  403. package/dist/ui/textarea.d.ts +2 -2
  404. package/dist/ui/textarea.js +1 -1
  405. package/dist/ui/toggle-group.d.cts +4 -4
  406. package/dist/ui/toggle-group.d.ts +4 -4
  407. package/dist/ui/toggle.d.cts +1 -1
  408. package/dist/ui/toggle.d.ts +1 -1
  409. package/dist/ui/tooltip.cjs +1 -1
  410. package/dist/ui/tooltip.d.cts +1 -1
  411. package/dist/ui/tooltip.d.ts +1 -1
  412. package/dist/ui/tooltip.js +1 -1
  413. package/package.json +17 -1
  414. package/dist/label-y7zRrP2w.d.cts +0 -11
@@ -1,2 +1,2 @@
1
1
  import{cn as e}from"@customafk/react-toolkit/utils";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{Drawer as r}from"vaul";function i({...e}){return t(r.Root,{"data-slot":`drawer`,...e})}function a({...e}){return t(r.Trigger,{"data-slot":`drawer-trigger`,...e})}function o({...e}){return t(r.Portal,{"data-slot":`drawer-portal`,...e})}function s({...e}){return t(r.Close,{"data-slot":`drawer-close`,...e})}function c({className:n,...i}){return t(r.Overlay,{"data-slot":`drawer-overlay`,className:e(`fixed inset-0 z-50 bg-black/50`,`data-[state=open]:animate-in`,`data-[state=closed]:animate-out`,`data-[state=open]:fade-in-0`,`data-[state=closed]:fade-out-0`,n),...i})}function l({className:i,children:a,...s}){return n(o,{"data-slot":`drawer-portal`,children:[t(c,{}),n(r.Content,{"data-slot":`drawer-content`,className:e(`group/drawer-content bg-background shadow-card fixed z-50 flex h-auto flex-col`,`data-[vaul-drawer-direction=top]:inset-x-0`,`data-[vaul-drawer-direction=top]:top-0`,`data-[vaul-drawer-direction=top]:mb-24`,`data-[vaul-drawer-direction=top]:max-h-[80vh]`,`data-[vaul-drawer-direction=top]:rounded-b-lg`,`data-[vaul-drawer-direction=bottom]:inset-x-0`,`data-[vaul-drawer-direction=bottom]:bottom-0`,`data-[vaul-drawer-direction=bottom]:mt-24`,`data-[vaul-drawer-direction=bottom]:max-h-[80vh]`,`data-[vaul-drawer-direction=bottom]:rounded-t-lg`,`data-[vaul-drawer-direction=right]:inset-y-0`,`data-[vaul-drawer-direction=right]:right-0`,`data-[vaul-drawer-direction=right]:w-3/4`,`data-[vaul-drawer-direction=right]:sm:max-w-sm`,`data-[vaul-drawer-direction=left]:inset-y-0`,`data-[vaul-drawer-direction=left]:left-0`,`data-[vaul-drawer-direction=left]:w-3/4`,`data-[vaul-drawer-direction=left]:sm:max-w-sm`,i),...s,children:[t(`div`,{className:`bg-border-weak mx-auto mt-4 hidden h-2 w-25 shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block`}),a]})]})}function u({className:n,...r}){return t(`div`,{"data-slot":`drawer-header`,className:e(`flex flex-col gap-0.5 p-4`,`md:gap-1.5 md:text-left`,`group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center`,`group-data-[vaul-drawer-direction=top]/drawer-content:text-center`,n),...r})}function d({className:n,...r}){return t(`div`,{"data-slot":`drawer-footer`,className:e(`mt-auto flex flex-col gap-2 p-4`,n),...r})}function f({className:n,...i}){return t(r.Title,{"data-slot":`drawer-title`,className:e(`text-text-positive font-semibold`,n),...i})}function p({className:n,...i}){return t(r.Description,{"data-slot":`drawer-description`,className:e(`text-text-positive-weak text-sm`,n),...i})}export{i as Drawer,s as DrawerClose,l as DrawerContent,p as DrawerDescription,d as DrawerFooter,u as DrawerHeader,c as DrawerOverlay,o as DrawerPortal,f as DrawerTitle,a as DrawerTrigger};
2
- //# sourceMappingURL=drawer-C6IT7ONM.js.map
2
+ //# sourceMappingURL=drawer-BT0osH1O.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"drawer-C6IT7ONM.js","names":["Drawer","DrawerPrimitive"],"sources":["../packages/components/ui/drawer.tsx"],"sourcesContent":["'use client';\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Drawer as DrawerPrimitive } from 'vaul';\n\nfunction Drawer({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) {\n return <DrawerPrimitive.Root data-slot=\"drawer\" {...props} />;\n}\n\nfunction DrawerTrigger({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />;\n}\n\nfunction DrawerPortal({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Portal>) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />;\n}\n\nfunction DrawerClose({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Close>) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />;\n}\n\nfunction DrawerOverlay({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n 'fixed inset-0 z-50 bg-black/50',\n 'data-[state=open]:animate-in',\n 'data-[state=closed]:animate-out',\n 'data-[state=open]:fade-in-0',\n 'data-[state=closed]:fade-out-0',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction DrawerContent({ className, children, ...props }: React.ComponentProps<typeof DrawerPrimitive.Content>) {\n return (\n <DrawerPortal data-slot=\"drawer-portal\">\n <DrawerOverlay />\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(\n 'group/drawer-content bg-background shadow-card fixed z-50 flex h-auto flex-col',\n\n 'data-[vaul-drawer-direction=top]:inset-x-0',\n 'data-[vaul-drawer-direction=top]:top-0',\n 'data-[vaul-drawer-direction=top]:mb-24',\n 'data-[vaul-drawer-direction=top]:max-h-[80vh]',\n 'data-[vaul-drawer-direction=top]:rounded-b-lg',\n\n 'data-[vaul-drawer-direction=bottom]:inset-x-0',\n 'data-[vaul-drawer-direction=bottom]:bottom-0',\n 'data-[vaul-drawer-direction=bottom]:mt-24',\n 'data-[vaul-drawer-direction=bottom]:max-h-[80vh]',\n 'data-[vaul-drawer-direction=bottom]:rounded-t-lg',\n\n 'data-[vaul-drawer-direction=right]:inset-y-0',\n 'data-[vaul-drawer-direction=right]:right-0',\n 'data-[vaul-drawer-direction=right]:w-3/4',\n 'data-[vaul-drawer-direction=right]:sm:max-w-sm',\n\n 'data-[vaul-drawer-direction=left]:inset-y-0',\n 'data-[vaul-drawer-direction=left]:left-0',\n 'data-[vaul-drawer-direction=left]:w-3/4',\n 'data-[vaul-drawer-direction=left]:sm:max-w-sm',\n className\n )}\n {...props}\n >\n <div className=\"bg-border-weak mx-auto mt-4 hidden h-2 w-25 shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n );\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn(\n 'flex flex-col gap-0.5 p-4',\n 'md:gap-1.5 md:text-left',\n 'group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center',\n 'group-data-[vaul-drawer-direction=top]/drawer-content:text-center',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"drawer-footer\" className={cn('mt-auto flex flex-col gap-2 p-4', className)} {...props} />;\n}\n\nfunction DrawerTitle({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Title>) {\n return <DrawerPrimitive.Title data-slot=\"drawer-title\" className={cn('text-text-positive font-semibold', className)} {...props} />;\n}\n\nfunction DrawerDescription({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Description>) {\n return <DrawerPrimitive.Description data-slot=\"drawer-description\" className={cn('text-text-positive-weak text-sm', className)} {...props} />;\n}\n\nexport { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger };\n"],"mappings":"oIAKA,SAASA,EAAO,CAAE,GAAG,GAA4D,CAC/E,OAAO,EAACC,EAAgB,KAAA,CAAK,YAAU,SAAS,GAAI,GAAS,CAG/D,SAAS,EAAc,CAAE,GAAG,GAA+D,CACzF,OAAO,EAACA,EAAgB,QAAA,CAAQ,YAAU,iBAAiB,GAAI,GAAS,CAG1E,SAAS,EAAa,CAAE,GAAG,GAA8D,CACvF,OAAO,EAACA,EAAgB,OAAA,CAAO,YAAU,gBAAgB,GAAI,GAAS,CAGxE,SAAS,EAAY,CAAE,GAAG,GAA6D,CACrF,OAAO,EAACA,EAAgB,MAAA,CAAM,YAAU,eAAe,GAAI,GAAS,CAGtE,SAAS,EAAc,CAAE,YAAW,GAAG,GAA+D,CACpG,OACE,EAACA,EAAgB,QAAA,CACf,YAAU,iBACV,UAAW,EACT,iCACA,+BACA,kCACA,8BACA,iCACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,EAAc,CAAE,YAAW,WAAU,GAAG,GAA+D,CAC9G,OACE,EAAC,EAAA,CAAa,YAAU,0BACtB,EAAC,EAAA,EAAA,CAAgB,CACjB,EAACA,EAAgB,QAAA,CACf,YAAU,iBACV,UAAW,EACT,iFAEA,6CACA,yCACA,yCACA,gDACA,gDAEA,gDACA,+CACA,4CACA,mDACA,mDAEA,+CACA,6CACA,2CACA,iDAEA,8CACA,2CACA,0CACA,gDACA,EACD,CACD,GAAI,YAEJ,EAAC,MAAA,CAAI,UAAU,mIAAA,CAAqI,CACnJ,EAAA,EACuB,CAAA,EACb,CAInB,SAAS,EAAa,CAAE,YAAW,GAAG,GAAsC,CAC1E,OACE,EAAC,MAAA,CACC,YAAU,gBACV,UAAW,EACT,4BACA,0BACA,uEACA,oEACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,EAAa,CAAE,YAAW,GAAG,GAAsC,CAC1E,OAAO,EAAC,MAAA,CAAI,YAAU,gBAAgB,UAAW,EAAG,kCAAmC,EAAU,CAAE,GAAI,GAAS,CAGlH,SAAS,EAAY,CAAE,YAAW,GAAG,GAA6D,CAChG,OAAO,EAACA,EAAgB,MAAA,CAAM,YAAU,eAAe,UAAW,EAAG,mCAAoC,EAAU,CAAE,GAAI,GAAS,CAGpI,SAAS,EAAkB,CAAE,YAAW,GAAG,GAAmE,CAC5G,OAAO,EAACA,EAAgB,YAAA,CAAY,YAAU,qBAAqB,UAAW,EAAG,kCAAmC,EAAU,CAAE,GAAI,GAAS"}
1
+ {"version":3,"file":"drawer-BT0osH1O.js","names":["Drawer","DrawerPrimitive"],"sources":["../packages/components/ui/drawer.tsx"],"sourcesContent":["'use client';\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Drawer as DrawerPrimitive } from 'vaul';\n\nfunction Drawer({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) {\n return <DrawerPrimitive.Root data-slot=\"drawer\" {...props} />;\n}\n\nfunction DrawerTrigger({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />;\n}\n\nfunction DrawerPortal({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Portal>) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />;\n}\n\nfunction DrawerClose({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Close>) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />;\n}\n\nfunction DrawerOverlay({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n 'fixed inset-0 z-50 bg-black/50',\n 'data-[state=open]:animate-in',\n 'data-[state=closed]:animate-out',\n 'data-[state=open]:fade-in-0',\n 'data-[state=closed]:fade-out-0',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction DrawerContent({ className, children, ...props }: React.ComponentProps<typeof DrawerPrimitive.Content>) {\n return (\n <DrawerPortal data-slot=\"drawer-portal\">\n <DrawerOverlay />\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(\n 'group/drawer-content bg-background shadow-card fixed z-50 flex h-auto flex-col',\n\n 'data-[vaul-drawer-direction=top]:inset-x-0',\n 'data-[vaul-drawer-direction=top]:top-0',\n 'data-[vaul-drawer-direction=top]:mb-24',\n 'data-[vaul-drawer-direction=top]:max-h-[80vh]',\n 'data-[vaul-drawer-direction=top]:rounded-b-lg',\n\n 'data-[vaul-drawer-direction=bottom]:inset-x-0',\n 'data-[vaul-drawer-direction=bottom]:bottom-0',\n 'data-[vaul-drawer-direction=bottom]:mt-24',\n 'data-[vaul-drawer-direction=bottom]:max-h-[80vh]',\n 'data-[vaul-drawer-direction=bottom]:rounded-t-lg',\n\n 'data-[vaul-drawer-direction=right]:inset-y-0',\n 'data-[vaul-drawer-direction=right]:right-0',\n 'data-[vaul-drawer-direction=right]:w-3/4',\n 'data-[vaul-drawer-direction=right]:sm:max-w-sm',\n\n 'data-[vaul-drawer-direction=left]:inset-y-0',\n 'data-[vaul-drawer-direction=left]:left-0',\n 'data-[vaul-drawer-direction=left]:w-3/4',\n 'data-[vaul-drawer-direction=left]:sm:max-w-sm',\n className\n )}\n {...props}\n >\n <div className=\"bg-border-weak mx-auto mt-4 hidden h-2 w-25 shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n );\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn(\n 'flex flex-col gap-0.5 p-4',\n 'md:gap-1.5 md:text-left',\n 'group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center',\n 'group-data-[vaul-drawer-direction=top]/drawer-content:text-center',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"drawer-footer\" className={cn('mt-auto flex flex-col gap-2 p-4', className)} {...props} />;\n}\n\nfunction DrawerTitle({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Title>) {\n return <DrawerPrimitive.Title data-slot=\"drawer-title\" className={cn('text-text-positive font-semibold', className)} {...props} />;\n}\n\nfunction DrawerDescription({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Description>) {\n return <DrawerPrimitive.Description data-slot=\"drawer-description\" className={cn('text-text-positive-weak text-sm', className)} {...props} />;\n}\n\nexport { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger };\n"],"mappings":"oIAKA,SAASA,EAAO,CAAE,GAAG,GAA4D,CAC/E,OAAO,EAACC,EAAgB,KAAA,CAAK,YAAU,SAAS,GAAI,GAAS,CAG/D,SAAS,EAAc,CAAE,GAAG,GAA+D,CACzF,OAAO,EAACA,EAAgB,QAAA,CAAQ,YAAU,iBAAiB,GAAI,GAAS,CAG1E,SAAS,EAAa,CAAE,GAAG,GAA8D,CACvF,OAAO,EAACA,EAAgB,OAAA,CAAO,YAAU,gBAAgB,GAAI,GAAS,CAGxE,SAAS,EAAY,CAAE,GAAG,GAA6D,CACrF,OAAO,EAACA,EAAgB,MAAA,CAAM,YAAU,eAAe,GAAI,GAAS,CAGtE,SAAS,EAAc,CAAE,YAAW,GAAG,GAA+D,CACpG,OACE,EAACA,EAAgB,QAAA,CACf,YAAU,iBACV,UAAW,EACT,iCACA,+BACA,kCACA,8BACA,iCACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,EAAc,CAAE,YAAW,WAAU,GAAG,GAA+D,CAC9G,OACE,EAAC,EAAA,CAAa,YAAU,0BACtB,EAAC,EAAA,EAAA,CAAgB,CACjB,EAACA,EAAgB,QAAA,CACf,YAAU,iBACV,UAAW,EACT,iFAEA,6CACA,yCACA,yCACA,gDACA,gDAEA,gDACA,+CACA,4CACA,mDACA,mDAEA,+CACA,6CACA,2CACA,iDAEA,8CACA,2CACA,0CACA,gDACA,EACD,CACD,GAAI,YAEJ,EAAC,MAAA,CAAI,UAAU,mIAAA,CAAqI,CACnJ,EAAA,EACuB,CAAA,EACb,CAInB,SAAS,EAAa,CAAE,YAAW,GAAG,GAAsC,CAC1E,OACE,EAAC,MAAA,CACC,YAAU,gBACV,UAAW,EACT,4BACA,0BACA,uEACA,oEACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,EAAa,CAAE,YAAW,GAAG,GAAsC,CAC1E,OAAO,EAAC,MAAA,CAAI,YAAU,gBAAgB,UAAW,EAAG,kCAAmC,EAAU,CAAE,GAAI,GAAS,CAGlH,SAAS,EAAY,CAAE,YAAW,GAAG,GAA6D,CAChG,OAAO,EAACA,EAAgB,MAAA,CAAM,YAAU,eAAe,UAAW,EAAG,mCAAoC,EAAU,CAAE,GAAI,GAAS,CAGpI,SAAS,EAAkB,CAAE,YAAW,GAAG,GAAmE,CAC5G,OAAO,EAACA,EAAgB,YAAA,CAAY,YAAU,qBAAqB,UAAW,EAAG,kCAAmC,EAAU,CAAE,GAAI,GAAS"}
@@ -1,2 +1,2 @@
1
1
  const e=require(`./chunk-CUT6urMc.cjs`);let t=require(`@customafk/react-toolkit/utils`);t=e.__toESM(t);let n=require(`react/jsx-runtime`);n=e.__toESM(n);let r=require(`vaul`);r=e.__toESM(r);function i({...e}){return(0,n.jsx)(r.Drawer.Root,{"data-slot":`drawer`,...e})}function a({...e}){return(0,n.jsx)(r.Drawer.Trigger,{"data-slot":`drawer-trigger`,...e})}function o({...e}){return(0,n.jsx)(r.Drawer.Portal,{"data-slot":`drawer-portal`,...e})}function s({...e}){return(0,n.jsx)(r.Drawer.Close,{"data-slot":`drawer-close`,...e})}function c({className:e,...i}){return(0,n.jsx)(r.Drawer.Overlay,{"data-slot":`drawer-overlay`,className:(0,t.cn)(`fixed inset-0 z-50 bg-black/50`,`data-[state=open]:animate-in`,`data-[state=closed]:animate-out`,`data-[state=open]:fade-in-0`,`data-[state=closed]:fade-out-0`,e),...i})}function l({className:e,children:i,...a}){return(0,n.jsxs)(o,{"data-slot":`drawer-portal`,children:[(0,n.jsx)(c,{}),(0,n.jsxs)(r.Drawer.Content,{"data-slot":`drawer-content`,className:(0,t.cn)(`group/drawer-content bg-background shadow-card fixed z-50 flex h-auto flex-col`,`data-[vaul-drawer-direction=top]:inset-x-0`,`data-[vaul-drawer-direction=top]:top-0`,`data-[vaul-drawer-direction=top]:mb-24`,`data-[vaul-drawer-direction=top]:max-h-[80vh]`,`data-[vaul-drawer-direction=top]:rounded-b-lg`,`data-[vaul-drawer-direction=bottom]:inset-x-0`,`data-[vaul-drawer-direction=bottom]:bottom-0`,`data-[vaul-drawer-direction=bottom]:mt-24`,`data-[vaul-drawer-direction=bottom]:max-h-[80vh]`,`data-[vaul-drawer-direction=bottom]:rounded-t-lg`,`data-[vaul-drawer-direction=right]:inset-y-0`,`data-[vaul-drawer-direction=right]:right-0`,`data-[vaul-drawer-direction=right]:w-3/4`,`data-[vaul-drawer-direction=right]:sm:max-w-sm`,`data-[vaul-drawer-direction=left]:inset-y-0`,`data-[vaul-drawer-direction=left]:left-0`,`data-[vaul-drawer-direction=left]:w-3/4`,`data-[vaul-drawer-direction=left]:sm:max-w-sm`,e),...a,children:[(0,n.jsx)(`div`,{className:`bg-border-weak mx-auto mt-4 hidden h-2 w-25 shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block`}),i]})]})}function u({className:e,...r}){return(0,n.jsx)(`div`,{"data-slot":`drawer-header`,className:(0,t.cn)(`flex flex-col gap-0.5 p-4`,`md:gap-1.5 md:text-left`,`group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center`,`group-data-[vaul-drawer-direction=top]/drawer-content:text-center`,e),...r})}function d({className:e,...r}){return(0,n.jsx)(`div`,{"data-slot":`drawer-footer`,className:(0,t.cn)(`mt-auto flex flex-col gap-2 p-4`,e),...r})}function f({className:e,...i}){return(0,n.jsx)(r.Drawer.Title,{"data-slot":`drawer-title`,className:(0,t.cn)(`text-text-positive font-semibold`,e),...i})}function p({className:e,...i}){return(0,n.jsx)(r.Drawer.Description,{"data-slot":`drawer-description`,className:(0,t.cn)(`text-text-positive-weak text-sm`,e),...i})}Object.defineProperty(exports,`Drawer`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`DrawerClose`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`DrawerContent`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`DrawerDescription`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`DrawerFooter`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`DrawerHeader`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`DrawerOverlay`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`DrawerPortal`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`DrawerTitle`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`DrawerTrigger`,{enumerable:!0,get:function(){return a}});
2
- //# sourceMappingURL=drawer-Dc432Nt9.cjs.map
2
+ //# sourceMappingURL=drawer-C3vvvU_D.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"drawer-Dc432Nt9.cjs","names":["DrawerPrimitive"],"sources":["../packages/components/ui/drawer.tsx"],"sourcesContent":["'use client';\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Drawer as DrawerPrimitive } from 'vaul';\n\nfunction Drawer({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) {\n return <DrawerPrimitive.Root data-slot=\"drawer\" {...props} />;\n}\n\nfunction DrawerTrigger({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />;\n}\n\nfunction DrawerPortal({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Portal>) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />;\n}\n\nfunction DrawerClose({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Close>) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />;\n}\n\nfunction DrawerOverlay({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n 'fixed inset-0 z-50 bg-black/50',\n 'data-[state=open]:animate-in',\n 'data-[state=closed]:animate-out',\n 'data-[state=open]:fade-in-0',\n 'data-[state=closed]:fade-out-0',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction DrawerContent({ className, children, ...props }: React.ComponentProps<typeof DrawerPrimitive.Content>) {\n return (\n <DrawerPortal data-slot=\"drawer-portal\">\n <DrawerOverlay />\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(\n 'group/drawer-content bg-background shadow-card fixed z-50 flex h-auto flex-col',\n\n 'data-[vaul-drawer-direction=top]:inset-x-0',\n 'data-[vaul-drawer-direction=top]:top-0',\n 'data-[vaul-drawer-direction=top]:mb-24',\n 'data-[vaul-drawer-direction=top]:max-h-[80vh]',\n 'data-[vaul-drawer-direction=top]:rounded-b-lg',\n\n 'data-[vaul-drawer-direction=bottom]:inset-x-0',\n 'data-[vaul-drawer-direction=bottom]:bottom-0',\n 'data-[vaul-drawer-direction=bottom]:mt-24',\n 'data-[vaul-drawer-direction=bottom]:max-h-[80vh]',\n 'data-[vaul-drawer-direction=bottom]:rounded-t-lg',\n\n 'data-[vaul-drawer-direction=right]:inset-y-0',\n 'data-[vaul-drawer-direction=right]:right-0',\n 'data-[vaul-drawer-direction=right]:w-3/4',\n 'data-[vaul-drawer-direction=right]:sm:max-w-sm',\n\n 'data-[vaul-drawer-direction=left]:inset-y-0',\n 'data-[vaul-drawer-direction=left]:left-0',\n 'data-[vaul-drawer-direction=left]:w-3/4',\n 'data-[vaul-drawer-direction=left]:sm:max-w-sm',\n className\n )}\n {...props}\n >\n <div className=\"bg-border-weak mx-auto mt-4 hidden h-2 w-25 shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n );\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn(\n 'flex flex-col gap-0.5 p-4',\n 'md:gap-1.5 md:text-left',\n 'group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center',\n 'group-data-[vaul-drawer-direction=top]/drawer-content:text-center',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"drawer-footer\" className={cn('mt-auto flex flex-col gap-2 p-4', className)} {...props} />;\n}\n\nfunction DrawerTitle({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Title>) {\n return <DrawerPrimitive.Title data-slot=\"drawer-title\" className={cn('text-text-positive font-semibold', className)} {...props} />;\n}\n\nfunction DrawerDescription({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Description>) {\n return <DrawerPrimitive.Description data-slot=\"drawer-description\" className={cn('text-text-positive-weak text-sm', className)} {...props} />;\n}\n\nexport { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger };\n"],"mappings":"8LAKA,SAAS,EAAO,CAAE,GAAG,GAA4D,CAC/E,OAAO,EAAA,EAAA,KAACA,EAAAA,OAAgB,KAAA,CAAK,YAAU,SAAS,GAAI,GAAS,CAG/D,SAAS,EAAc,CAAE,GAAG,GAA+D,CACzF,OAAO,EAAA,EAAA,KAACA,EAAAA,OAAgB,QAAA,CAAQ,YAAU,iBAAiB,GAAI,GAAS,CAG1E,SAAS,EAAa,CAAE,GAAG,GAA8D,CACvF,OAAO,EAAA,EAAA,KAACA,EAAAA,OAAgB,OAAA,CAAO,YAAU,gBAAgB,GAAI,GAAS,CAGxE,SAAS,EAAY,CAAE,GAAG,GAA6D,CACrF,OAAO,EAAA,EAAA,KAACA,EAAAA,OAAgB,MAAA,CAAM,YAAU,eAAe,GAAI,GAAS,CAGtE,SAAS,EAAc,CAAE,YAAW,GAAG,GAA+D,CACpG,OACE,EAAA,EAAA,KAACA,EAAAA,OAAgB,QAAA,CACf,YAAU,iBACV,WAAA,EAAA,EAAA,IACE,iCACA,+BACA,kCACA,8BACA,iCACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,EAAc,CAAE,YAAW,WAAU,GAAG,GAA+D,CAC9G,OACE,EAAA,EAAA,MAAC,EAAA,CAAa,YAAU,2BACtB,EAAA,EAAA,KAAC,EAAA,EAAA,CAAgB,EACjB,EAAA,EAAA,MAACA,EAAAA,OAAgB,QAAA,CACf,YAAU,iBACV,WAAA,EAAA,EAAA,IACE,iFAEA,6CACA,yCACA,yCACA,gDACA,gDAEA,gDACA,+CACA,4CACA,mDACA,mDAEA,+CACA,6CACA,2CACA,iDAEA,8CACA,2CACA,0CACA,gDACA,EACD,CACD,GAAI,aAEJ,EAAA,EAAA,KAAC,MAAA,CAAI,UAAU,mIAAA,CAAqI,CACnJ,EAAA,EACuB,CAAA,EACb,CAInB,SAAS,EAAa,CAAE,YAAW,GAAG,GAAsC,CAC1E,OACE,EAAA,EAAA,KAAC,MAAA,CACC,YAAU,gBACV,WAAA,EAAA,EAAA,IACE,4BACA,0BACA,uEACA,oEACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,EAAa,CAAE,YAAW,GAAG,GAAsC,CAC1E,OAAO,EAAA,EAAA,KAAC,MAAA,CAAI,YAAU,gBAAgB,WAAA,EAAA,EAAA,IAAc,kCAAmC,EAAU,CAAE,GAAI,GAAS,CAGlH,SAAS,EAAY,CAAE,YAAW,GAAG,GAA6D,CAChG,OAAO,EAAA,EAAA,KAACA,EAAAA,OAAgB,MAAA,CAAM,YAAU,eAAe,WAAA,EAAA,EAAA,IAAc,mCAAoC,EAAU,CAAE,GAAI,GAAS,CAGpI,SAAS,EAAkB,CAAE,YAAW,GAAG,GAAmE,CAC5G,OAAO,EAAA,EAAA,KAACA,EAAAA,OAAgB,YAAA,CAAY,YAAU,qBAAqB,WAAA,EAAA,EAAA,IAAc,kCAAmC,EAAU,CAAE,GAAI,GAAS"}
1
+ {"version":3,"file":"drawer-C3vvvU_D.cjs","names":["DrawerPrimitive"],"sources":["../packages/components/ui/drawer.tsx"],"sourcesContent":["'use client';\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Drawer as DrawerPrimitive } from 'vaul';\n\nfunction Drawer({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) {\n return <DrawerPrimitive.Root data-slot=\"drawer\" {...props} />;\n}\n\nfunction DrawerTrigger({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />;\n}\n\nfunction DrawerPortal({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Portal>) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />;\n}\n\nfunction DrawerClose({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Close>) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />;\n}\n\nfunction DrawerOverlay({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n 'fixed inset-0 z-50 bg-black/50',\n 'data-[state=open]:animate-in',\n 'data-[state=closed]:animate-out',\n 'data-[state=open]:fade-in-0',\n 'data-[state=closed]:fade-out-0',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction DrawerContent({ className, children, ...props }: React.ComponentProps<typeof DrawerPrimitive.Content>) {\n return (\n <DrawerPortal data-slot=\"drawer-portal\">\n <DrawerOverlay />\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(\n 'group/drawer-content bg-background shadow-card fixed z-50 flex h-auto flex-col',\n\n 'data-[vaul-drawer-direction=top]:inset-x-0',\n 'data-[vaul-drawer-direction=top]:top-0',\n 'data-[vaul-drawer-direction=top]:mb-24',\n 'data-[vaul-drawer-direction=top]:max-h-[80vh]',\n 'data-[vaul-drawer-direction=top]:rounded-b-lg',\n\n 'data-[vaul-drawer-direction=bottom]:inset-x-0',\n 'data-[vaul-drawer-direction=bottom]:bottom-0',\n 'data-[vaul-drawer-direction=bottom]:mt-24',\n 'data-[vaul-drawer-direction=bottom]:max-h-[80vh]',\n 'data-[vaul-drawer-direction=bottom]:rounded-t-lg',\n\n 'data-[vaul-drawer-direction=right]:inset-y-0',\n 'data-[vaul-drawer-direction=right]:right-0',\n 'data-[vaul-drawer-direction=right]:w-3/4',\n 'data-[vaul-drawer-direction=right]:sm:max-w-sm',\n\n 'data-[vaul-drawer-direction=left]:inset-y-0',\n 'data-[vaul-drawer-direction=left]:left-0',\n 'data-[vaul-drawer-direction=left]:w-3/4',\n 'data-[vaul-drawer-direction=left]:sm:max-w-sm',\n className\n )}\n {...props}\n >\n <div className=\"bg-border-weak mx-auto mt-4 hidden h-2 w-25 shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n );\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn(\n 'flex flex-col gap-0.5 p-4',\n 'md:gap-1.5 md:text-left',\n 'group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center',\n 'group-data-[vaul-drawer-direction=top]/drawer-content:text-center',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"drawer-footer\" className={cn('mt-auto flex flex-col gap-2 p-4', className)} {...props} />;\n}\n\nfunction DrawerTitle({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Title>) {\n return <DrawerPrimitive.Title data-slot=\"drawer-title\" className={cn('text-text-positive font-semibold', className)} {...props} />;\n}\n\nfunction DrawerDescription({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Description>) {\n return <DrawerPrimitive.Description data-slot=\"drawer-description\" className={cn('text-text-positive-weak text-sm', className)} {...props} />;\n}\n\nexport { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger };\n"],"mappings":"8LAKA,SAAS,EAAO,CAAE,GAAG,GAA4D,CAC/E,OAAO,EAAA,EAAA,KAACA,EAAAA,OAAgB,KAAA,CAAK,YAAU,SAAS,GAAI,GAAS,CAG/D,SAAS,EAAc,CAAE,GAAG,GAA+D,CACzF,OAAO,EAAA,EAAA,KAACA,EAAAA,OAAgB,QAAA,CAAQ,YAAU,iBAAiB,GAAI,GAAS,CAG1E,SAAS,EAAa,CAAE,GAAG,GAA8D,CACvF,OAAO,EAAA,EAAA,KAACA,EAAAA,OAAgB,OAAA,CAAO,YAAU,gBAAgB,GAAI,GAAS,CAGxE,SAAS,EAAY,CAAE,GAAG,GAA6D,CACrF,OAAO,EAAA,EAAA,KAACA,EAAAA,OAAgB,MAAA,CAAM,YAAU,eAAe,GAAI,GAAS,CAGtE,SAAS,EAAc,CAAE,YAAW,GAAG,GAA+D,CACpG,OACE,EAAA,EAAA,KAACA,EAAAA,OAAgB,QAAA,CACf,YAAU,iBACV,WAAA,EAAA,EAAA,IACE,iCACA,+BACA,kCACA,8BACA,iCACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,EAAc,CAAE,YAAW,WAAU,GAAG,GAA+D,CAC9G,OACE,EAAA,EAAA,MAAC,EAAA,CAAa,YAAU,2BACtB,EAAA,EAAA,KAAC,EAAA,EAAA,CAAgB,EACjB,EAAA,EAAA,MAACA,EAAAA,OAAgB,QAAA,CACf,YAAU,iBACV,WAAA,EAAA,EAAA,IACE,iFAEA,6CACA,yCACA,yCACA,gDACA,gDAEA,gDACA,+CACA,4CACA,mDACA,mDAEA,+CACA,6CACA,2CACA,iDAEA,8CACA,2CACA,0CACA,gDACA,EACD,CACD,GAAI,aAEJ,EAAA,EAAA,KAAC,MAAA,CAAI,UAAU,mIAAA,CAAqI,CACnJ,EAAA,EACuB,CAAA,EACb,CAInB,SAAS,EAAa,CAAE,YAAW,GAAG,GAAsC,CAC1E,OACE,EAAA,EAAA,KAAC,MAAA,CACC,YAAU,gBACV,WAAA,EAAA,EAAA,IACE,4BACA,0BACA,uEACA,oEACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,EAAa,CAAE,YAAW,GAAG,GAAsC,CAC1E,OAAO,EAAA,EAAA,KAAC,MAAA,CAAI,YAAU,gBAAgB,WAAA,EAAA,EAAA,IAAc,kCAAmC,EAAU,CAAE,GAAI,GAAS,CAGlH,SAAS,EAAY,CAAE,YAAW,GAAG,GAA6D,CAChG,OAAO,EAAA,EAAA,KAACA,EAAAA,OAAgB,MAAA,CAAM,YAAU,eAAe,WAAA,EAAA,EAAA,IAAc,mCAAoC,EAAU,CAAE,GAAI,GAAS,CAGpI,SAAS,EAAkB,CAAE,YAAW,GAAG,GAAmE,CAC5G,OAAO,EAAA,EAAA,KAACA,EAAAA,OAAgB,YAAA,CAAY,YAAU,qBAAqB,WAAA,EAAA,EAAA,IAAc,kCAAmC,EAAU,CAAE,GAAI,GAAS"}
@@ -1,2 +1,2 @@
1
- const e=require(`./chunk-CUT6urMc.cjs`),t=require(`./alert-dialog-DmsZNeeJ.cjs`);let n=require(`lucide-react`);n=e.__toESM(n);let r=require(`react`);r=e.__toESM(r);let i=require(`react/jsx-runtime`);i=e.__toESM(i);const a=({open:e,title:a,children:o,onOpenChange:s})=>{let c=(0,r.useCallback)(()=>{s?.(!1)},[s]);return(0,i.jsx)(t.AlertDialog,{open:e,onOpenChange:s,children:(0,i.jsxs)(t.AlertDialogContent,{className:`gap-8 p-4 sm:max-w-md`,children:[(0,i.jsx)(t.AlertDialogHeader,{children:(0,i.jsxs)(`div`,{className:`text-destructive flex flex-col items-center`,children:[(0,i.jsx)(n.AlertTriangleIcon,{size:42}),(0,i.jsx)(t.AlertDialogTitle,{className:`text-xl font-medium`,children:a||`An error occurred`})]})}),o,(0,i.jsx)(t.AlertDialogFooter,{children:(0,i.jsx)(t.AlertDialogAction,{className:`w-full sm:w-28`,onClick:c,children:`Close`})})]})})};Object.defineProperty(exports,`ErrorDialog`,{enumerable:!0,get:function(){return a}});
2
- //# sourceMappingURL=error-dialog-pTwyWIE5.cjs.map
1
+ const e=require(`./chunk-CUT6urMc.cjs`),t=require(`./alert-dialog-mR3avgRt.cjs`);let n=require(`lucide-react`);n=e.__toESM(n);let r=require(`react`);r=e.__toESM(r);let i=require(`react/jsx-runtime`);i=e.__toESM(i);const a=({open:e,title:a,children:o,onOpenChange:s})=>{let c=(0,r.useCallback)(()=>{s?.(!1)},[s]);return(0,i.jsx)(t.AlertDialog,{open:e,onOpenChange:s,children:(0,i.jsxs)(t.AlertDialogContent,{className:`gap-8 p-4 sm:max-w-md`,children:[(0,i.jsx)(t.AlertDialogHeader,{children:(0,i.jsxs)(`div`,{className:`text-destructive flex flex-col items-center`,children:[(0,i.jsx)(n.AlertTriangleIcon,{size:42}),(0,i.jsx)(t.AlertDialogTitle,{className:`text-xl font-medium`,children:a||`An error occurred`})]})}),o,(0,i.jsx)(t.AlertDialogFooter,{children:(0,i.jsx)(t.AlertDialogAction,{className:`w-full sm:w-28`,onClick:c,children:`Close`})})]})})};Object.defineProperty(exports,`ErrorDialog`,{enumerable:!0,get:function(){return a}});
2
+ //# sourceMappingURL=error-dialog-BVTB1EEF.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"error-dialog-pTwyWIE5.cjs","names":["ErrorDialog: React.FC<React.PropsWithChildren<Props>>","AlertDialog","AlertDialogContent","AlertDialogHeader","AlertTriangleIcon","AlertDialogTitle","AlertDialogFooter","AlertDialogAction"],"sources":["../packages/components/dialogs/error-dialog.tsx"],"sourcesContent":["import { useCallback } from 'react';\n\nimport { AlertTriangleIcon } from 'lucide-react';\n\nimport { AlertDialog, AlertDialogAction, AlertDialogContent, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from '../ui/alert-dialog';\n\ntype Props = {\n open?: boolean;\n title?: string;\n description?: string;\n onOpenChange?: (open: boolean) => void;\n};\nexport const ErrorDialog: React.FC<React.PropsWithChildren<Props>> = ({ open, title, children, onOpenChange }) => {\n const handleClose = useCallback(() => {\n onOpenChange?.(false);\n }, [onOpenChange]);\n return (\n <AlertDialog open={open} onOpenChange={onOpenChange}>\n <AlertDialogContent className=\"gap-8 p-4 sm:max-w-md\">\n <AlertDialogHeader>\n <div className=\"text-destructive flex flex-col items-center\">\n <AlertTriangleIcon size={42} />\n <AlertDialogTitle className=\"text-xl font-medium\">{title || 'An error occurred'}</AlertDialogTitle>\n </div>\n </AlertDialogHeader>\n {children}\n <AlertDialogFooter>\n <AlertDialogAction className=\"w-full sm:w-28\" onClick={handleClose}>\n Close\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n );\n};\n"],"mappings":"sNAYA,MAAaA,GAAyD,CAAE,OAAM,QAAO,WAAU,kBAAmB,CAChH,IAAM,GAAA,EAAA,EAAA,iBAAgC,CACpC,IAAe,GAAM,EACpB,CAAC,EAAa,CAAC,CAClB,OACE,EAAA,EAAA,KAACC,EAAAA,YAAAA,CAAkB,OAAoB,yBACrC,EAAA,EAAA,MAACC,EAAAA,mBAAAA,CAAmB,UAAU,mCAC5B,EAAA,EAAA,KAACC,EAAAA,kBAAAA,CAAAA,UACC,EAAA,EAAA,MAAC,MAAA,CAAI,UAAU,yDACb,EAAA,EAAA,KAACC,EAAAA,kBAAAA,CAAkB,KAAM,GAAA,CAAM,EAC/B,EAAA,EAAA,KAACC,EAAAA,iBAAAA,CAAiB,UAAU,+BAAuB,GAAS,qBAAuC,CAAA,EAC/F,CAAA,CACY,CACnB,GACD,EAAA,EAAA,KAACC,EAAAA,kBAAAA,CAAAA,UACC,EAAA,EAAA,KAACC,EAAAA,kBAAAA,CAAkB,UAAU,iBAAiB,QAAS,WAAa,SAEhD,CAAA,CACF,GACD,EACT"}
1
+ {"version":3,"file":"error-dialog-BVTB1EEF.cjs","names":["ErrorDialog: React.FC<React.PropsWithChildren<Props>>","AlertDialog","AlertDialogContent","AlertDialogHeader","AlertTriangleIcon","AlertDialogTitle","AlertDialogFooter","AlertDialogAction"],"sources":["../packages/components/dialogs/error-dialog.tsx"],"sourcesContent":["import { useCallback } from 'react';\n\nimport { AlertTriangleIcon } from 'lucide-react';\n\nimport { AlertDialog, AlertDialogAction, AlertDialogContent, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from '../ui/alert-dialog';\n\ntype Props = {\n open?: boolean;\n title?: string;\n description?: string;\n onOpenChange?: (open: boolean) => void;\n};\nexport const ErrorDialog: React.FC<React.PropsWithChildren<Props>> = ({ open, title, children, onOpenChange }) => {\n const handleClose = useCallback(() => {\n onOpenChange?.(false);\n }, [onOpenChange]);\n return (\n <AlertDialog open={open} onOpenChange={onOpenChange}>\n <AlertDialogContent className=\"gap-8 p-4 sm:max-w-md\">\n <AlertDialogHeader>\n <div className=\"text-destructive flex flex-col items-center\">\n <AlertTriangleIcon size={42} />\n <AlertDialogTitle className=\"text-xl font-medium\">{title || 'An error occurred'}</AlertDialogTitle>\n </div>\n </AlertDialogHeader>\n {children}\n <AlertDialogFooter>\n <AlertDialogAction className=\"w-full sm:w-28\" onClick={handleClose}>\n Close\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n );\n};\n"],"mappings":"sNAYA,MAAaA,GAAyD,CAAE,OAAM,QAAO,WAAU,kBAAmB,CAChH,IAAM,GAAA,EAAA,EAAA,iBAAgC,CACpC,IAAe,GAAM,EACpB,CAAC,EAAa,CAAC,CAClB,OACE,EAAA,EAAA,KAACC,EAAAA,YAAAA,CAAkB,OAAoB,yBACrC,EAAA,EAAA,MAACC,EAAAA,mBAAAA,CAAmB,UAAU,mCAC5B,EAAA,EAAA,KAACC,EAAAA,kBAAAA,CAAAA,UACC,EAAA,EAAA,MAAC,MAAA,CAAI,UAAU,yDACb,EAAA,EAAA,KAACC,EAAAA,kBAAAA,CAAkB,KAAM,GAAA,CAAM,EAC/B,EAAA,EAAA,KAACC,EAAAA,iBAAAA,CAAiB,UAAU,+BAAuB,GAAS,qBAAuC,CAAA,EAC/F,CAAA,CACY,CACnB,GACD,EAAA,EAAA,KAACC,EAAAA,kBAAAA,CAAAA,UACC,EAAA,EAAA,KAACC,EAAAA,kBAAAA,CAAkB,UAAU,iBAAiB,QAAS,WAAa,SAEhD,CAAA,CACF,GACD,EACT"}
@@ -1,2 +1,2 @@
1
- import{AlertDialog as e,AlertDialogAction as t,AlertDialogContent as n,AlertDialogFooter as r,AlertDialogHeader as i,AlertDialogTitle as a}from"./alert-dialog-Di6rTULI.js";import{AlertTriangleIcon as o}from"lucide-react";import{useCallback as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";const u=({open:u,title:d,children:f,onOpenChange:p})=>{let m=s(()=>{p?.(!1)},[p]);return c(e,{open:u,onOpenChange:p,children:l(n,{className:`gap-8 p-4 sm:max-w-md`,children:[c(i,{children:l(`div`,{className:`text-destructive flex flex-col items-center`,children:[c(o,{size:42}),c(a,{className:`text-xl font-medium`,children:d||`An error occurred`})]})}),f,c(r,{children:c(t,{className:`w-full sm:w-28`,onClick:m,children:`Close`})})]})})};export{u as ErrorDialog};
2
- //# sourceMappingURL=error-dialog-_FqKuIY6.js.map
1
+ import{AlertDialog as e,AlertDialogAction as t,AlertDialogContent as n,AlertDialogFooter as r,AlertDialogHeader as i,AlertDialogTitle as a}from"./alert-dialog-BfKVH-9l.js";import{AlertTriangleIcon as o}from"lucide-react";import{useCallback as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";const u=({open:u,title:d,children:f,onOpenChange:p})=>{let m=s(()=>{p?.(!1)},[p]);return c(e,{open:u,onOpenChange:p,children:l(n,{className:`gap-8 p-4 sm:max-w-md`,children:[c(i,{children:l(`div`,{className:`text-destructive flex flex-col items-center`,children:[c(o,{size:42}),c(a,{className:`text-xl font-medium`,children:d||`An error occurred`})]})}),f,c(r,{children:c(t,{className:`w-full sm:w-28`,onClick:m,children:`Close`})})]})})};export{u as ErrorDialog};
2
+ //# sourceMappingURL=error-dialog-DMGVy3dG.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"error-dialog-_FqKuIY6.js","names":["ErrorDialog: React.FC<React.PropsWithChildren<Props>>"],"sources":["../packages/components/dialogs/error-dialog.tsx"],"sourcesContent":["import { useCallback } from 'react';\n\nimport { AlertTriangleIcon } from 'lucide-react';\n\nimport { AlertDialog, AlertDialogAction, AlertDialogContent, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from '../ui/alert-dialog';\n\ntype Props = {\n open?: boolean;\n title?: string;\n description?: string;\n onOpenChange?: (open: boolean) => void;\n};\nexport const ErrorDialog: React.FC<React.PropsWithChildren<Props>> = ({ open, title, children, onOpenChange }) => {\n const handleClose = useCallback(() => {\n onOpenChange?.(false);\n }, [onOpenChange]);\n return (\n <AlertDialog open={open} onOpenChange={onOpenChange}>\n <AlertDialogContent className=\"gap-8 p-4 sm:max-w-md\">\n <AlertDialogHeader>\n <div className=\"text-destructive flex flex-col items-center\">\n <AlertTriangleIcon size={42} />\n <AlertDialogTitle className=\"text-xl font-medium\">{title || 'An error occurred'}</AlertDialogTitle>\n </div>\n </AlertDialogHeader>\n {children}\n <AlertDialogFooter>\n <AlertDialogAction className=\"w-full sm:w-28\" onClick={handleClose}>\n Close\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n );\n};\n"],"mappings":"mTAYA,MAAaA,GAAyD,CAAE,OAAM,QAAO,WAAU,kBAAmB,CAChH,IAAM,EAAc,MAAkB,CACpC,IAAe,GAAM,EACpB,CAAC,EAAa,CAAC,CAClB,OACE,EAAC,EAAA,CAAkB,OAAoB,wBACrC,EAAC,EAAA,CAAmB,UAAU,kCAC5B,EAAC,EAAA,CAAA,SACC,EAAC,MAAA,CAAI,UAAU,wDACb,EAAC,EAAA,CAAkB,KAAM,GAAA,CAAM,CAC/B,EAAC,EAAA,CAAiB,UAAU,+BAAuB,GAAS,qBAAuC,CAAA,EAC/F,CAAA,CACY,CACnB,EACD,EAAC,EAAA,CAAA,SACC,EAAC,EAAA,CAAkB,UAAU,iBAAiB,QAAS,WAAa,SAEhD,CAAA,CACF,GACD,EACT"}
1
+ {"version":3,"file":"error-dialog-DMGVy3dG.js","names":["ErrorDialog: React.FC<React.PropsWithChildren<Props>>"],"sources":["../packages/components/dialogs/error-dialog.tsx"],"sourcesContent":["import { useCallback } from 'react';\n\nimport { AlertTriangleIcon } from 'lucide-react';\n\nimport { AlertDialog, AlertDialogAction, AlertDialogContent, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from '../ui/alert-dialog';\n\ntype Props = {\n open?: boolean;\n title?: string;\n description?: string;\n onOpenChange?: (open: boolean) => void;\n};\nexport const ErrorDialog: React.FC<React.PropsWithChildren<Props>> = ({ open, title, children, onOpenChange }) => {\n const handleClose = useCallback(() => {\n onOpenChange?.(false);\n }, [onOpenChange]);\n return (\n <AlertDialog open={open} onOpenChange={onOpenChange}>\n <AlertDialogContent className=\"gap-8 p-4 sm:max-w-md\">\n <AlertDialogHeader>\n <div className=\"text-destructive flex flex-col items-center\">\n <AlertTriangleIcon size={42} />\n <AlertDialogTitle className=\"text-xl font-medium\">{title || 'An error occurred'}</AlertDialogTitle>\n </div>\n </AlertDialogHeader>\n {children}\n <AlertDialogFooter>\n <AlertDialogAction className=\"w-full sm:w-28\" onClick={handleClose}>\n Close\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n );\n};\n"],"mappings":"mTAYA,MAAaA,GAAyD,CAAE,OAAM,QAAO,WAAU,kBAAmB,CAChH,IAAM,EAAc,MAAkB,CACpC,IAAe,GAAM,EACpB,CAAC,EAAa,CAAC,CAClB,OACE,EAAC,EAAA,CAAkB,OAAoB,wBACrC,EAAC,EAAA,CAAmB,UAAU,kCAC5B,EAAC,EAAA,CAAA,SACC,EAAC,MAAA,CAAI,UAAU,wDACb,EAAC,EAAA,CAAkB,KAAM,GAAA,CAAM,CAC/B,EAAC,EAAA,CAAiB,UAAU,+BAAuB,GAAS,qBAAuC,CAAA,EAC/F,CAAA,CACY,CACnB,EACD,EAAC,EAAA,CAAA,SACC,EAAC,EAAA,CAAkB,UAAU,iBAAiB,QAAS,WAAa,SAEhD,CAAA,CACF,GACD,EACT"}
@@ -1,2 +1,2 @@
1
- const e=require(`./chunk-CUT6urMc.cjs`),t=require(`./label-BMBHBFRY.cjs`),n=require(`./separator-BAyL2IIW.cjs`);let r=require(`@customafk/react-toolkit/utils`);r=e.__toESM(r);let i=require(`react`);i=e.__toESM(i);let a=require(`react/jsx-runtime`);a=e.__toESM(a);let o=require(`class-variance-authority`);o=e.__toESM(o);function s({className:e,...t}){return(0,a.jsx)(`fieldset`,{"data-slot":`field-set`,className:(0,r.cn)(`flex flex-col gap-6`,`has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,e),...t})}function c({className:e,variant:t=`legend`,...n}){return(0,a.jsx)(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:(0,r.cn)(`mb-3 font-medium`,`data-[variant=legend]:text-base`,`data-[variant=label]:text-sm`,e),...n})}function l({className:e,...t}){return(0,a.jsx)(`div`,{"data-slot":`field-group`,className:(0,r.cn)(`group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4`,e),...t})}const u=(0,o.cva)(`group/field flex w-full gap-3 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:[`flex-col [&>*]:w-full [&>.sr-only]:w-auto`],horizontal:[`flex-row items-center`,`[&>[data-slot=field-label]]:flex-auto`,`has-[>[data-slot=field-content]]:items-start`,`has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`],responsive:[`flex-col [&>*]:w-full [&>.sr-only]:w-auto`,`@md/field-group:flex-row`,`@md/field-group:items-center`,`@md/field-group:[&>*]:w-auto`,`@md/field-group:[&>[data-slot=field-label]]:flex-auto`,`@md/field-group:has-[>[data-slot=field-content]]:items-start`,`@md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`]}},defaultVariants:{orientation:`vertical`}});function d({className:e,orientation:t=`vertical`,...n}){return(0,a.jsx)(`div`,{"data-slot":`field`,"data-orientation":t,className:(0,r.cn)(u({orientation:t}),e),...n})}function f({className:e,...t}){return(0,a.jsx)(`div`,{"data-slot":`field-content`,className:(0,r.cn)(`group/field-content flex flex-1 flex-col gap-1.5 leading-snug`,e),...t})}function p({className:e,...n}){return(0,a.jsx)(t.Label,{"data-slot":`field-label`,className:(0,r.cn)(`group/field-label peer/field-label flex w-fit gap-2 leading-snug`,`group-data-[disabled=true]/field:opacity-50`,`has-[>[data-slot=field]]:w-full`,`has-[>[data-slot=field]]:flex-col`,`has-[>[data-slot=field]]:rounded-md`,`has-[>[data-slot=field]]:border`,`[&>*]:data-[slot=field]:p-4`,`has-data-[state=checked]:bg-primary/5`,`has-data-[state=checked]:border-primary`,e),...n})}function m({className:e,...t}){return(0,a.jsx)(`div`,{"data-slot":`field-label`,className:(0,r.cn)(`flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50`,e),...t})}function h({className:e,...t}){return(0,a.jsx)(`p`,{"data-slot":`field-description`,className:(0,r.cn)(`text-text-positive-weak text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance`,`last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5`,`[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4`,e),...t})}function g({children:e,className:t,...i}){return(0,a.jsxs)(`div`,{"data-slot":`field-separator`,"data-content":!!e,className:(0,r.cn)(`relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2`,t),...i,children:[(0,a.jsx)(n.Separator,{className:`absolute inset-0 top-1/2`}),e&&(0,a.jsx)(`span`,{className:`bg-background text-text-positive-weak relative mx-auto block w-fit px-2`,"data-slot":`field-separator-content`,children:e})]})}function _({className:e,children:t,errors:n,...o}){let s=(0,i.useMemo)(()=>t||(n?n?.length===1&&n[0]?.message?n[0].message:(0,a.jsx)(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:n.map(e=>e?.message&&(0,a.jsx)(`li`,{children:e.message},e.message))}):null),[t,n]);return s?(0,a.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:(0,r.cn)(`text-danger text-sm font-normal`,e),...o,children:s}):null}Object.defineProperty(exports,`Field`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`FieldContent`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`FieldDescription`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`FieldError`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`FieldGroup`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`FieldLabel`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`FieldLegend`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`FieldSeparator`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`FieldSet`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`FieldTitle`,{enumerable:!0,get:function(){return m}});
2
- //# sourceMappingURL=field-B_qC62YD.cjs.map
1
+ const e=require(`./chunk-CUT6urMc.cjs`),t=require(`./label-D6mAvVmw.cjs`),n=require(`./separator-DMMoR-d2.cjs`);let r=require(`@customafk/react-toolkit/utils`);r=e.__toESM(r);let i=require(`react`);i=e.__toESM(i);let a=require(`react/jsx-runtime`);a=e.__toESM(a);let o=require(`class-variance-authority`);o=e.__toESM(o);function s({className:e,...t}){return(0,a.jsx)(`fieldset`,{"data-slot":`field-set`,className:(0,r.cn)(`flex flex-col gap-6`,`has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,e),...t})}function c({className:e,variant:t=`legend`,...n}){return(0,a.jsx)(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:(0,r.cn)(`mb-3 font-medium`,`data-[variant=legend]:text-base`,`data-[variant=label]:text-sm`,e),...n})}function l({className:e,...t}){return(0,a.jsx)(`div`,{"data-slot":`field-group`,className:(0,r.cn)(`group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4`,e),...t})}const u=(0,o.cva)(`group/field flex w-full gap-3 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:[`flex-col [&>*]:w-full [&>.sr-only]:w-auto`],horizontal:[`flex-row items-center`,`[&>[data-slot=field-label]]:flex-auto`,`has-[>[data-slot=field-content]]:items-start`,`has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`],responsive:[`flex-col [&>*]:w-full [&>.sr-only]:w-auto`,`@md/field-group:flex-row`,`@md/field-group:items-center`,`@md/field-group:[&>*]:w-auto`,`@md/field-group:[&>[data-slot=field-label]]:flex-auto`,`@md/field-group:has-[>[data-slot=field-content]]:items-start`,`@md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`]}},defaultVariants:{orientation:`vertical`}});function d({className:e,orientation:t=`vertical`,...n}){return(0,a.jsx)(`div`,{"data-slot":`field`,"data-orientation":t,className:(0,r.cn)(u({orientation:t}),e),...n})}function f({className:e,...t}){return(0,a.jsx)(`div`,{"data-slot":`field-content`,className:(0,r.cn)(`group/field-content flex flex-1 flex-col gap-1.5 leading-snug`,e),...t})}function p({className:e,...n}){return(0,a.jsx)(t.Label,{"data-slot":`field-label`,className:(0,r.cn)(`group/field-label peer/field-label flex w-fit gap-2 leading-snug`,`group-data-[disabled=true]/field:opacity-50`,`has-[>[data-slot=field]]:w-full`,`has-[>[data-slot=field]]:flex-col`,`has-[>[data-slot=field]]:rounded-md`,`has-[>[data-slot=field]]:border`,`[&>*]:data-[slot=field]:p-4`,`has-data-[state=checked]:bg-primary/5`,`has-data-[state=checked]:border-primary`,e),...n})}function m({className:e,...t}){return(0,a.jsx)(`div`,{"data-slot":`field-label`,className:(0,r.cn)(`flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50`,e),...t})}function h({className:e,...t}){return(0,a.jsx)(`p`,{"data-slot":`field-description`,className:(0,r.cn)(`text-text-positive-weak text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance`,`last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5`,`[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4`,e),...t})}function g({children:e,className:t,...i}){return(0,a.jsxs)(`div`,{"data-slot":`field-separator`,"data-content":!!e,className:(0,r.cn)(`relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2`,t),...i,children:[(0,a.jsx)(n.Separator,{className:`absolute inset-0 top-1/2`}),e&&(0,a.jsx)(`span`,{className:`bg-background text-text-positive-weak relative mx-auto block w-fit px-2`,"data-slot":`field-separator-content`,children:e})]})}function _({className:e,children:t,errors:n,...o}){let s=(0,i.useMemo)(()=>t||(n?n?.length===1&&n[0]?.message?n[0].message:(0,a.jsx)(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:n.map(e=>e?.message&&(0,a.jsx)(`li`,{children:e.message},e.message))}):null),[t,n]);return s?(0,a.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:(0,r.cn)(`text-danger text-sm font-normal`,e),...o,children:s}):null}Object.defineProperty(exports,`Field`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`FieldContent`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`FieldDescription`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`FieldError`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`FieldGroup`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`FieldLabel`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`FieldLegend`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`FieldSeparator`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`FieldSet`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`FieldTitle`,{enumerable:!0,get:function(){return m}});
2
+ //# sourceMappingURL=field-A43YZ5Wj.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"field-B_qC62YD.cjs","names":["Label","Separator"],"sources":["../packages/components/ui/field.tsx"],"sourcesContent":["'use client';\n\nimport { useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Label } from '@/components/ui/label';\nimport { Separator } from '@/components/ui/separator';\n\nfunction FieldSet({ className, ...props }: React.ComponentProps<'fieldset'>) {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn('flex flex-col gap-6', 'has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3', className)}\n {...props}\n />\n );\n}\n\nfunction FieldLegend({ className, variant = 'legend', ...props }: React.ComponentProps<'legend'> & { variant?: 'legend' | 'label' }) {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn('mb-3 font-medium', 'data-[variant=legend]:text-base', 'data-[variant=label]:text-sm', className)}\n {...props}\n />\n );\n}\n\nfunction FieldGroup({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\n 'group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4',\n className\n )}\n {...props}\n />\n );\n}\n\nconst fieldVariants = cva('group/field flex w-full gap-3 data-[invalid=true]:text-destructive', {\n variants: {\n orientation: {\n vertical: ['flex-col [&>*]:w-full [&>.sr-only]:w-auto'],\n horizontal: [\n 'flex-row items-center',\n '[&>[data-slot=field-label]]:flex-auto',\n 'has-[>[data-slot=field-content]]:items-start',\n 'has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n ],\n responsive: [\n 'flex-col [&>*]:w-full [&>.sr-only]:w-auto',\n '@md/field-group:flex-row',\n '@md/field-group:items-center',\n '@md/field-group:[&>*]:w-auto',\n '@md/field-group:[&>[data-slot=field-label]]:flex-auto',\n '@md/field-group:has-[>[data-slot=field-content]]:items-start',\n '@md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n ],\n },\n },\n defaultVariants: {\n orientation: 'vertical',\n },\n});\n\nfunction Field({ className, orientation = 'vertical', ...props }: React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>) {\n return <div data-slot=\"field\" data-orientation={orientation} className={cn(fieldVariants({ orientation }), className)} {...props} />;\n}\n\nfunction FieldContent({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"field-content\" className={cn('group/field-content flex flex-1 flex-col gap-1.5 leading-snug', className)} {...props} />;\n}\n\nfunction FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>) {\n return (\n <Label\n data-slot=\"field-label\"\n className={cn(\n 'group/field-label peer/field-label flex w-fit gap-2 leading-snug',\n 'group-data-[disabled=true]/field:opacity-50',\n 'has-[>[data-slot=field]]:w-full',\n 'has-[>[data-slot=field]]:flex-col',\n 'has-[>[data-slot=field]]:rounded-md',\n 'has-[>[data-slot=field]]:border',\n '[&>*]:data-[slot=field]:p-4',\n 'has-data-[state=checked]:bg-primary/5',\n 'has-data-[state=checked]:border-primary',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction FieldTitle({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"field-label\"\n className={cn('flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50', className)}\n {...props}\n />\n );\n}\n\nfunction FieldDescription({ className, ...props }: React.ComponentProps<'p'>) {\n return (\n <p\n data-slot=\"field-description\"\n className={cn(\n 'text-text-positive-weak text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance',\n 'last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5',\n '[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction FieldSeparator({\n children,\n className,\n ...props\n}: React.ComponentProps<'div'> & {\n children?: React.ReactNode;\n}) {\n return (\n <div\n data-slot=\"field-separator\"\n data-content={!!children}\n className={cn('relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2', className)}\n {...props}\n >\n <Separator className=\"absolute inset-0 top-1/2\" />\n {children && (\n <span className=\"bg-background text-text-positive-weak relative mx-auto block w-fit px-2\" data-slot=\"field-separator-content\">\n {children}\n </span>\n )}\n </div>\n );\n}\n\nfunction FieldError({\n className,\n children,\n errors,\n ...props\n}: React.ComponentProps<'div'> & {\n errors?: Array<{ message?: string } | undefined>;\n}) {\n const content = useMemo(() => {\n if (children) {\n return children;\n }\n\n if (!errors) {\n return null;\n }\n\n if (errors?.length === 1 && errors[0]?.message) {\n return errors[0].message;\n }\n\n return <ul className=\"ml-4 flex list-disc flex-col gap-1\">{errors.map(error => error?.message && <li key={error.message}>{error.message}</li>)}</ul>;\n }, [children, errors]);\n\n if (!content) {\n return null;\n }\n\n return (\n <div role=\"alert\" data-slot=\"field-error\" className={cn('text-danger text-sm font-normal', className)} {...props}>\n {content}\n </div>\n );\n}\n\nexport { Field, FieldLabel, FieldDescription, FieldError, FieldGroup, FieldLegend, FieldSeparator, FieldSet, FieldContent, FieldTitle };\n"],"mappings":"gUAUA,SAAS,EAAS,CAAE,YAAW,GAAG,GAA2C,CAC3E,OACE,EAAA,EAAA,KAAC,WAAA,CACC,YAAU,YACV,WAAA,EAAA,EAAA,IAAc,sBAAuB,+EAAgF,EAAU,CAC/H,GAAI,GACJ,CAIN,SAAS,EAAY,CAAE,YAAW,UAAU,SAAU,GAAG,GAA4E,CACnI,OACE,EAAA,EAAA,KAAC,SAAA,CACC,YAAU,eACV,eAAc,EACd,WAAA,EAAA,EAAA,IAAc,mBAAoB,kCAAmC,+BAAgC,EAAU,CAC/G,GAAI,GACJ,CAIN,SAAS,EAAW,CAAE,YAAW,GAAG,GAAsC,CACxE,OACE,EAAA,EAAA,KAAC,MAAA,CACC,YAAU,cACV,WAAA,EAAA,EAAA,IACE,yIACA,EACD,CACD,GAAI,GACJ,CAIN,MAAM,GAAA,EAAA,EAAA,KAAoB,qEAAsE,CAC9F,SAAU,CACR,YAAa,CACX,SAAU,CAAC,4CAA4C,CACvD,WAAY,CACV,wBACA,wCACA,+CACA,0EACD,CACD,WAAY,CACV,4CACA,2BACA,+BACA,+BACA,wDACA,+DACA,0FACD,CACF,CACF,CACD,gBAAiB,CACf,YAAa,WACd,CACF,CAAC,CAEF,SAAS,EAAM,CAAE,YAAW,cAAc,WAAY,GAAG,GAA2E,CAClI,OAAO,EAAA,EAAA,KAAC,MAAA,CAAI,YAAU,QAAQ,mBAAkB,EAAa,WAAA,EAAA,EAAA,IAAc,EAAc,CAAE,cAAa,CAAC,CAAE,EAAU,CAAE,GAAI,GAAS,CAGtI,SAAS,EAAa,CAAE,YAAW,GAAG,GAAsC,CAC1E,OAAO,EAAA,EAAA,KAAC,MAAA,CAAI,YAAU,gBAAgB,WAAA,EAAA,EAAA,IAAc,gEAAiE,EAAU,CAAE,GAAI,GAAS,CAGhJ,SAAS,EAAW,CAAE,YAAW,GAAG,GAA6C,CAC/E,OACE,EAAA,EAAA,KAACA,EAAAA,MAAAA,CACC,YAAU,cACV,WAAA,EAAA,EAAA,IACE,mEACA,8CACA,kCACA,oCACA,sCACA,kCACA,8BACA,wCACA,0CACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,EAAW,CAAE,YAAW,GAAG,GAAsC,CACxE,OACE,EAAA,EAAA,KAAC,MAAA,CACC,YAAU,cACV,WAAA,EAAA,EAAA,IAAc,6GAA8G,EAAU,CACtI,GAAI,GACJ,CAIN,SAAS,EAAiB,CAAE,YAAW,GAAG,GAAoC,CAC5E,OACE,EAAA,EAAA,KAAC,IAAA,CACC,YAAU,oBACV,WAAA,EAAA,EAAA,IACE,0HACA,+DACA,oEACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,EAAe,CACtB,WACA,YACA,GAAG,GAGF,CACD,OACE,EAAA,EAAA,MAAC,MAAA,CACC,YAAU,kBACV,eAAc,CAAC,CAAC,EAChB,WAAA,EAAA,EAAA,IAAc,4EAA6E,EAAU,CACrG,GAAI,aAEJ,EAAA,EAAA,KAACC,EAAAA,UAAAA,CAAU,UAAU,2BAAA,CAA6B,CACjD,IACC,EAAA,EAAA,KAAC,OAAA,CAAK,UAAU,0EAA0E,YAAU,0BACjG,YACI,CAAA,EAEL,CAIV,SAAS,EAAW,CAClB,YACA,WACA,SACA,GAAG,GAGF,CACD,IAAM,GAAA,EAAA,EAAA,aACA,IAIC,EAID,GAAQ,SAAW,GAAK,EAAO,IAAI,QAC9B,EAAO,GAAG,SAGZ,EAAA,EAAA,KAAC,KAAA,CAAG,UAAU,8CAAsC,EAAO,IAAI,GAAS,GAAO,UAAW,EAAA,EAAA,KAAC,KAAA,CAAA,SAAwB,EAAM,QAAA,CAAtB,EAAM,QAA6B,CAAC,EAAM,CAP3I,MAQR,CAAC,EAAU,EAAO,CAAC,CAMtB,OAJK,GAKH,EAAA,EAAA,KAAC,MAAA,CAAI,KAAK,QAAQ,YAAU,cAAc,WAAA,EAAA,EAAA,IAAc,kCAAmC,EAAU,CAAE,GAAI,WACxG,GACG,CANC"}
1
+ {"version":3,"file":"field-A43YZ5Wj.cjs","names":["Label","Separator"],"sources":["../packages/components/ui/field.tsx"],"sourcesContent":["'use client';\n\nimport { useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Label } from '@/components/ui/label';\nimport { Separator } from '@/components/ui/separator';\n\nfunction FieldSet({ className, ...props }: React.ComponentProps<'fieldset'>) {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn('flex flex-col gap-6', 'has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3', className)}\n {...props}\n />\n );\n}\n\nfunction FieldLegend({ className, variant = 'legend', ...props }: React.ComponentProps<'legend'> & { variant?: 'legend' | 'label' }) {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn('mb-3 font-medium', 'data-[variant=legend]:text-base', 'data-[variant=label]:text-sm', className)}\n {...props}\n />\n );\n}\n\nfunction FieldGroup({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\n 'group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4',\n className\n )}\n {...props}\n />\n );\n}\n\nconst fieldVariants = cva('group/field flex w-full gap-3 data-[invalid=true]:text-destructive', {\n variants: {\n orientation: {\n vertical: ['flex-col [&>*]:w-full [&>.sr-only]:w-auto'],\n horizontal: [\n 'flex-row items-center',\n '[&>[data-slot=field-label]]:flex-auto',\n 'has-[>[data-slot=field-content]]:items-start',\n 'has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n ],\n responsive: [\n 'flex-col [&>*]:w-full [&>.sr-only]:w-auto',\n '@md/field-group:flex-row',\n '@md/field-group:items-center',\n '@md/field-group:[&>*]:w-auto',\n '@md/field-group:[&>[data-slot=field-label]]:flex-auto',\n '@md/field-group:has-[>[data-slot=field-content]]:items-start',\n '@md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n ],\n },\n },\n defaultVariants: {\n orientation: 'vertical',\n },\n});\n\nfunction Field({ className, orientation = 'vertical', ...props }: React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>) {\n return <div data-slot=\"field\" data-orientation={orientation} className={cn(fieldVariants({ orientation }), className)} {...props} />;\n}\n\nfunction FieldContent({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"field-content\" className={cn('group/field-content flex flex-1 flex-col gap-1.5 leading-snug', className)} {...props} />;\n}\n\nfunction FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>) {\n return (\n <Label\n data-slot=\"field-label\"\n className={cn(\n 'group/field-label peer/field-label flex w-fit gap-2 leading-snug',\n 'group-data-[disabled=true]/field:opacity-50',\n 'has-[>[data-slot=field]]:w-full',\n 'has-[>[data-slot=field]]:flex-col',\n 'has-[>[data-slot=field]]:rounded-md',\n 'has-[>[data-slot=field]]:border',\n '[&>*]:data-[slot=field]:p-4',\n 'has-data-[state=checked]:bg-primary/5',\n 'has-data-[state=checked]:border-primary',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction FieldTitle({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"field-label\"\n className={cn('flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50', className)}\n {...props}\n />\n );\n}\n\nfunction FieldDescription({ className, ...props }: React.ComponentProps<'p'>) {\n return (\n <p\n data-slot=\"field-description\"\n className={cn(\n 'text-text-positive-weak text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance',\n 'last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5',\n '[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction FieldSeparator({\n children,\n className,\n ...props\n}: React.ComponentProps<'div'> & {\n children?: React.ReactNode;\n}) {\n return (\n <div\n data-slot=\"field-separator\"\n data-content={!!children}\n className={cn('relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2', className)}\n {...props}\n >\n <Separator className=\"absolute inset-0 top-1/2\" />\n {children && (\n <span className=\"bg-background text-text-positive-weak relative mx-auto block w-fit px-2\" data-slot=\"field-separator-content\">\n {children}\n </span>\n )}\n </div>\n );\n}\n\nfunction FieldError({\n className,\n children,\n errors,\n ...props\n}: React.ComponentProps<'div'> & {\n errors?: Array<{ message?: string } | undefined>;\n}) {\n const content = useMemo(() => {\n if (children) {\n return children;\n }\n\n if (!errors) {\n return null;\n }\n\n if (errors?.length === 1 && errors[0]?.message) {\n return errors[0].message;\n }\n\n return <ul className=\"ml-4 flex list-disc flex-col gap-1\">{errors.map(error => error?.message && <li key={error.message}>{error.message}</li>)}</ul>;\n }, [children, errors]);\n\n if (!content) {\n return null;\n }\n\n return (\n <div role=\"alert\" data-slot=\"field-error\" className={cn('text-danger text-sm font-normal', className)} {...props}>\n {content}\n </div>\n );\n}\n\nexport { Field, FieldLabel, FieldDescription, FieldError, FieldGroup, FieldLegend, FieldSeparator, FieldSet, FieldContent, FieldTitle };\n"],"mappings":"gUAUA,SAAS,EAAS,CAAE,YAAW,GAAG,GAA2C,CAC3E,OACE,EAAA,EAAA,KAAC,WAAA,CACC,YAAU,YACV,WAAA,EAAA,EAAA,IAAc,sBAAuB,+EAAgF,EAAU,CAC/H,GAAI,GACJ,CAIN,SAAS,EAAY,CAAE,YAAW,UAAU,SAAU,GAAG,GAA4E,CACnI,OACE,EAAA,EAAA,KAAC,SAAA,CACC,YAAU,eACV,eAAc,EACd,WAAA,EAAA,EAAA,IAAc,mBAAoB,kCAAmC,+BAAgC,EAAU,CAC/G,GAAI,GACJ,CAIN,SAAS,EAAW,CAAE,YAAW,GAAG,GAAsC,CACxE,OACE,EAAA,EAAA,KAAC,MAAA,CACC,YAAU,cACV,WAAA,EAAA,EAAA,IACE,yIACA,EACD,CACD,GAAI,GACJ,CAIN,MAAM,GAAA,EAAA,EAAA,KAAoB,qEAAsE,CAC9F,SAAU,CACR,YAAa,CACX,SAAU,CAAC,4CAA4C,CACvD,WAAY,CACV,wBACA,wCACA,+CACA,0EACD,CACD,WAAY,CACV,4CACA,2BACA,+BACA,+BACA,wDACA,+DACA,0FACD,CACF,CACF,CACD,gBAAiB,CACf,YAAa,WACd,CACF,CAAC,CAEF,SAAS,EAAM,CAAE,YAAW,cAAc,WAAY,GAAG,GAA2E,CAClI,OAAO,EAAA,EAAA,KAAC,MAAA,CAAI,YAAU,QAAQ,mBAAkB,EAAa,WAAA,EAAA,EAAA,IAAc,EAAc,CAAE,cAAa,CAAC,CAAE,EAAU,CAAE,GAAI,GAAS,CAGtI,SAAS,EAAa,CAAE,YAAW,GAAG,GAAsC,CAC1E,OAAO,EAAA,EAAA,KAAC,MAAA,CAAI,YAAU,gBAAgB,WAAA,EAAA,EAAA,IAAc,gEAAiE,EAAU,CAAE,GAAI,GAAS,CAGhJ,SAAS,EAAW,CAAE,YAAW,GAAG,GAA6C,CAC/E,OACE,EAAA,EAAA,KAACA,EAAAA,MAAAA,CACC,YAAU,cACV,WAAA,EAAA,EAAA,IACE,mEACA,8CACA,kCACA,oCACA,sCACA,kCACA,8BACA,wCACA,0CACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,EAAW,CAAE,YAAW,GAAG,GAAsC,CACxE,OACE,EAAA,EAAA,KAAC,MAAA,CACC,YAAU,cACV,WAAA,EAAA,EAAA,IAAc,6GAA8G,EAAU,CACtI,GAAI,GACJ,CAIN,SAAS,EAAiB,CAAE,YAAW,GAAG,GAAoC,CAC5E,OACE,EAAA,EAAA,KAAC,IAAA,CACC,YAAU,oBACV,WAAA,EAAA,EAAA,IACE,0HACA,+DACA,oEACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,EAAe,CACtB,WACA,YACA,GAAG,GAGF,CACD,OACE,EAAA,EAAA,MAAC,MAAA,CACC,YAAU,kBACV,eAAc,CAAC,CAAC,EAChB,WAAA,EAAA,EAAA,IAAc,4EAA6E,EAAU,CACrG,GAAI,aAEJ,EAAA,EAAA,KAACC,EAAAA,UAAAA,CAAU,UAAU,2BAAA,CAA6B,CACjD,IACC,EAAA,EAAA,KAAC,OAAA,CAAK,UAAU,0EAA0E,YAAU,0BACjG,YACI,CAAA,EAEL,CAIV,SAAS,EAAW,CAClB,YACA,WACA,SACA,GAAG,GAGF,CACD,IAAM,GAAA,EAAA,EAAA,aACA,IAIC,EAID,GAAQ,SAAW,GAAK,EAAO,IAAI,QAC9B,EAAO,GAAG,SAGZ,EAAA,EAAA,KAAC,KAAA,CAAG,UAAU,8CAAsC,EAAO,IAAI,GAAS,GAAO,UAAW,EAAA,EAAA,KAAC,KAAA,CAAA,SAAwB,EAAM,QAAA,CAAtB,EAAM,QAA6B,CAAC,EAAM,CAP3I,MAQR,CAAC,EAAU,EAAO,CAAC,CAMtB,OAJK,GAKH,EAAA,EAAA,KAAC,MAAA,CAAI,KAAK,QAAQ,YAAU,cAAc,WAAA,EAAA,EAAA,IAAc,kCAAmC,EAAU,CAAE,GAAI,WACxG,GACG,CANC"}
@@ -1,2 +1,2 @@
1
- import{Label as e}from"./label-CRhvNQY4.js";import{Separator as t}from"./separator-C5dPRhYx.js";import{cn as n}from"@customafk/react-toolkit/utils";import{useMemo as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{cva as o}from"class-variance-authority";function s({className:e,...t}){return i(`fieldset`,{"data-slot":`field-set`,className:n(`flex flex-col gap-6`,`has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,e),...t})}function c({className:e,variant:t=`legend`,...r}){return i(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:n(`mb-3 font-medium`,`data-[variant=legend]:text-base`,`data-[variant=label]:text-sm`,e),...r})}function l({className:e,...t}){return i(`div`,{"data-slot":`field-group`,className:n(`group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4`,e),...t})}const u=o(`group/field flex w-full gap-3 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:[`flex-col [&>*]:w-full [&>.sr-only]:w-auto`],horizontal:[`flex-row items-center`,`[&>[data-slot=field-label]]:flex-auto`,`has-[>[data-slot=field-content]]:items-start`,`has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`],responsive:[`flex-col [&>*]:w-full [&>.sr-only]:w-auto`,`@md/field-group:flex-row`,`@md/field-group:items-center`,`@md/field-group:[&>*]:w-auto`,`@md/field-group:[&>[data-slot=field-label]]:flex-auto`,`@md/field-group:has-[>[data-slot=field-content]]:items-start`,`@md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`]}},defaultVariants:{orientation:`vertical`}});function d({className:e,orientation:t=`vertical`,...r}){return i(`div`,{"data-slot":`field`,"data-orientation":t,className:n(u({orientation:t}),e),...r})}function f({className:e,...t}){return i(`div`,{"data-slot":`field-content`,className:n(`group/field-content flex flex-1 flex-col gap-1.5 leading-snug`,e),...t})}function p({className:t,...r}){return i(e,{"data-slot":`field-label`,className:n(`group/field-label peer/field-label flex w-fit gap-2 leading-snug`,`group-data-[disabled=true]/field:opacity-50`,`has-[>[data-slot=field]]:w-full`,`has-[>[data-slot=field]]:flex-col`,`has-[>[data-slot=field]]:rounded-md`,`has-[>[data-slot=field]]:border`,`[&>*]:data-[slot=field]:p-4`,`has-data-[state=checked]:bg-primary/5`,`has-data-[state=checked]:border-primary`,t),...r})}function m({className:e,...t}){return i(`div`,{"data-slot":`field-label`,className:n(`flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50`,e),...t})}function h({className:e,...t}){return i(`p`,{"data-slot":`field-description`,className:n(`text-text-positive-weak text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance`,`last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5`,`[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4`,e),...t})}function g({children:e,className:r,...o}){return a(`div`,{"data-slot":`field-separator`,"data-content":!!e,className:n(`relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2`,r),...o,children:[i(t,{className:`absolute inset-0 top-1/2`}),e&&i(`span`,{className:`bg-background text-text-positive-weak relative mx-auto block w-fit px-2`,"data-slot":`field-separator-content`,children:e})]})}function _({className:e,children:t,errors:a,...o}){let s=r(()=>t||(a?a?.length===1&&a[0]?.message?a[0].message:i(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:a.map(e=>e?.message&&i(`li`,{children:e.message},e.message))}):null),[t,a]);return s?i(`div`,{role:`alert`,"data-slot":`field-error`,className:n(`text-danger text-sm font-normal`,e),...o,children:s}):null}export{d as Field,f as FieldContent,h as FieldDescription,_ as FieldError,l as FieldGroup,p as FieldLabel,c as FieldLegend,g as FieldSeparator,s as FieldSet,m as FieldTitle};
2
- //# sourceMappingURL=field-DSScKMdZ.js.map
1
+ import{Label as e}from"./label-CdrxlBJ8.js";import{Separator as t}from"./separator-D17HxS2f.js";import{cn as n}from"@customafk/react-toolkit/utils";import{useMemo as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{cva as o}from"class-variance-authority";function s({className:e,...t}){return i(`fieldset`,{"data-slot":`field-set`,className:n(`flex flex-col gap-6`,`has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,e),...t})}function c({className:e,variant:t=`legend`,...r}){return i(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:n(`mb-3 font-medium`,`data-[variant=legend]:text-base`,`data-[variant=label]:text-sm`,e),...r})}function l({className:e,...t}){return i(`div`,{"data-slot":`field-group`,className:n(`group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4`,e),...t})}const u=o(`group/field flex w-full gap-3 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:[`flex-col [&>*]:w-full [&>.sr-only]:w-auto`],horizontal:[`flex-row items-center`,`[&>[data-slot=field-label]]:flex-auto`,`has-[>[data-slot=field-content]]:items-start`,`has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`],responsive:[`flex-col [&>*]:w-full [&>.sr-only]:w-auto`,`@md/field-group:flex-row`,`@md/field-group:items-center`,`@md/field-group:[&>*]:w-auto`,`@md/field-group:[&>[data-slot=field-label]]:flex-auto`,`@md/field-group:has-[>[data-slot=field-content]]:items-start`,`@md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`]}},defaultVariants:{orientation:`vertical`}});function d({className:e,orientation:t=`vertical`,...r}){return i(`div`,{"data-slot":`field`,"data-orientation":t,className:n(u({orientation:t}),e),...r})}function f({className:e,...t}){return i(`div`,{"data-slot":`field-content`,className:n(`group/field-content flex flex-1 flex-col gap-1.5 leading-snug`,e),...t})}function p({className:t,...r}){return i(e,{"data-slot":`field-label`,className:n(`group/field-label peer/field-label flex w-fit gap-2 leading-snug`,`group-data-[disabled=true]/field:opacity-50`,`has-[>[data-slot=field]]:w-full`,`has-[>[data-slot=field]]:flex-col`,`has-[>[data-slot=field]]:rounded-md`,`has-[>[data-slot=field]]:border`,`[&>*]:data-[slot=field]:p-4`,`has-data-[state=checked]:bg-primary/5`,`has-data-[state=checked]:border-primary`,t),...r})}function m({className:e,...t}){return i(`div`,{"data-slot":`field-label`,className:n(`flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50`,e),...t})}function h({className:e,...t}){return i(`p`,{"data-slot":`field-description`,className:n(`text-text-positive-weak text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance`,`last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5`,`[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4`,e),...t})}function g({children:e,className:r,...o}){return a(`div`,{"data-slot":`field-separator`,"data-content":!!e,className:n(`relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2`,r),...o,children:[i(t,{className:`absolute inset-0 top-1/2`}),e&&i(`span`,{className:`bg-background text-text-positive-weak relative mx-auto block w-fit px-2`,"data-slot":`field-separator-content`,children:e})]})}function _({className:e,children:t,errors:a,...o}){let s=r(()=>t||(a?a?.length===1&&a[0]?.message?a[0].message:i(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:a.map(e=>e?.message&&i(`li`,{children:e.message},e.message))}):null),[t,a]);return s?i(`div`,{role:`alert`,"data-slot":`field-error`,className:n(`text-danger text-sm font-normal`,e),...o,children:s}):null}export{d as Field,f as FieldContent,h as FieldDescription,_ as FieldError,l as FieldGroup,p as FieldLabel,c as FieldLegend,g as FieldSeparator,s as FieldSet,m as FieldTitle};
2
+ //# sourceMappingURL=field-CGacT8J3.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"field-DSScKMdZ.js","names":[],"sources":["../packages/components/ui/field.tsx"],"sourcesContent":["'use client';\n\nimport { useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Label } from '@/components/ui/label';\nimport { Separator } from '@/components/ui/separator';\n\nfunction FieldSet({ className, ...props }: React.ComponentProps<'fieldset'>) {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn('flex flex-col gap-6', 'has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3', className)}\n {...props}\n />\n );\n}\n\nfunction FieldLegend({ className, variant = 'legend', ...props }: React.ComponentProps<'legend'> & { variant?: 'legend' | 'label' }) {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn('mb-3 font-medium', 'data-[variant=legend]:text-base', 'data-[variant=label]:text-sm', className)}\n {...props}\n />\n );\n}\n\nfunction FieldGroup({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\n 'group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4',\n className\n )}\n {...props}\n />\n );\n}\n\nconst fieldVariants = cva('group/field flex w-full gap-3 data-[invalid=true]:text-destructive', {\n variants: {\n orientation: {\n vertical: ['flex-col [&>*]:w-full [&>.sr-only]:w-auto'],\n horizontal: [\n 'flex-row items-center',\n '[&>[data-slot=field-label]]:flex-auto',\n 'has-[>[data-slot=field-content]]:items-start',\n 'has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n ],\n responsive: [\n 'flex-col [&>*]:w-full [&>.sr-only]:w-auto',\n '@md/field-group:flex-row',\n '@md/field-group:items-center',\n '@md/field-group:[&>*]:w-auto',\n '@md/field-group:[&>[data-slot=field-label]]:flex-auto',\n '@md/field-group:has-[>[data-slot=field-content]]:items-start',\n '@md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n ],\n },\n },\n defaultVariants: {\n orientation: 'vertical',\n },\n});\n\nfunction Field({ className, orientation = 'vertical', ...props }: React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>) {\n return <div data-slot=\"field\" data-orientation={orientation} className={cn(fieldVariants({ orientation }), className)} {...props} />;\n}\n\nfunction FieldContent({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"field-content\" className={cn('group/field-content flex flex-1 flex-col gap-1.5 leading-snug', className)} {...props} />;\n}\n\nfunction FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>) {\n return (\n <Label\n data-slot=\"field-label\"\n className={cn(\n 'group/field-label peer/field-label flex w-fit gap-2 leading-snug',\n 'group-data-[disabled=true]/field:opacity-50',\n 'has-[>[data-slot=field]]:w-full',\n 'has-[>[data-slot=field]]:flex-col',\n 'has-[>[data-slot=field]]:rounded-md',\n 'has-[>[data-slot=field]]:border',\n '[&>*]:data-[slot=field]:p-4',\n 'has-data-[state=checked]:bg-primary/5',\n 'has-data-[state=checked]:border-primary',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction FieldTitle({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"field-label\"\n className={cn('flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50', className)}\n {...props}\n />\n );\n}\n\nfunction FieldDescription({ className, ...props }: React.ComponentProps<'p'>) {\n return (\n <p\n data-slot=\"field-description\"\n className={cn(\n 'text-text-positive-weak text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance',\n 'last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5',\n '[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction FieldSeparator({\n children,\n className,\n ...props\n}: React.ComponentProps<'div'> & {\n children?: React.ReactNode;\n}) {\n return (\n <div\n data-slot=\"field-separator\"\n data-content={!!children}\n className={cn('relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2', className)}\n {...props}\n >\n <Separator className=\"absolute inset-0 top-1/2\" />\n {children && (\n <span className=\"bg-background text-text-positive-weak relative mx-auto block w-fit px-2\" data-slot=\"field-separator-content\">\n {children}\n </span>\n )}\n </div>\n );\n}\n\nfunction FieldError({\n className,\n children,\n errors,\n ...props\n}: React.ComponentProps<'div'> & {\n errors?: Array<{ message?: string } | undefined>;\n}) {\n const content = useMemo(() => {\n if (children) {\n return children;\n }\n\n if (!errors) {\n return null;\n }\n\n if (errors?.length === 1 && errors[0]?.message) {\n return errors[0].message;\n }\n\n return <ul className=\"ml-4 flex list-disc flex-col gap-1\">{errors.map(error => error?.message && <li key={error.message}>{error.message}</li>)}</ul>;\n }, [children, errors]);\n\n if (!content) {\n return null;\n }\n\n return (\n <div role=\"alert\" data-slot=\"field-error\" className={cn('text-danger text-sm font-normal', className)} {...props}>\n {content}\n </div>\n );\n}\n\nexport { Field, FieldLabel, FieldDescription, FieldError, FieldGroup, FieldLegend, FieldSeparator, FieldSet, FieldContent, FieldTitle };\n"],"mappings":"qRAUA,SAAS,EAAS,CAAE,YAAW,GAAG,GAA2C,CAC3E,OACE,EAAC,WAAA,CACC,YAAU,YACV,UAAW,EAAG,sBAAuB,+EAAgF,EAAU,CAC/H,GAAI,GACJ,CAIN,SAAS,EAAY,CAAE,YAAW,UAAU,SAAU,GAAG,GAA4E,CACnI,OACE,EAAC,SAAA,CACC,YAAU,eACV,eAAc,EACd,UAAW,EAAG,mBAAoB,kCAAmC,+BAAgC,EAAU,CAC/G,GAAI,GACJ,CAIN,SAAS,EAAW,CAAE,YAAW,GAAG,GAAsC,CACxE,OACE,EAAC,MAAA,CACC,YAAU,cACV,UAAW,EACT,yIACA,EACD,CACD,GAAI,GACJ,CAIN,MAAM,EAAgB,EAAI,qEAAsE,CAC9F,SAAU,CACR,YAAa,CACX,SAAU,CAAC,4CAA4C,CACvD,WAAY,CACV,wBACA,wCACA,+CACA,0EACD,CACD,WAAY,CACV,4CACA,2BACA,+BACA,+BACA,wDACA,+DACA,0FACD,CACF,CACF,CACD,gBAAiB,CACf,YAAa,WACd,CACF,CAAC,CAEF,SAAS,EAAM,CAAE,YAAW,cAAc,WAAY,GAAG,GAA2E,CAClI,OAAO,EAAC,MAAA,CAAI,YAAU,QAAQ,mBAAkB,EAAa,UAAW,EAAG,EAAc,CAAE,cAAa,CAAC,CAAE,EAAU,CAAE,GAAI,GAAS,CAGtI,SAAS,EAAa,CAAE,YAAW,GAAG,GAAsC,CAC1E,OAAO,EAAC,MAAA,CAAI,YAAU,gBAAgB,UAAW,EAAG,gEAAiE,EAAU,CAAE,GAAI,GAAS,CAGhJ,SAAS,EAAW,CAAE,YAAW,GAAG,GAA6C,CAC/E,OACE,EAAC,EAAA,CACC,YAAU,cACV,UAAW,EACT,mEACA,8CACA,kCACA,oCACA,sCACA,kCACA,8BACA,wCACA,0CACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,EAAW,CAAE,YAAW,GAAG,GAAsC,CACxE,OACE,EAAC,MAAA,CACC,YAAU,cACV,UAAW,EAAG,6GAA8G,EAAU,CACtI,GAAI,GACJ,CAIN,SAAS,EAAiB,CAAE,YAAW,GAAG,GAAoC,CAC5E,OACE,EAAC,IAAA,CACC,YAAU,oBACV,UAAW,EACT,0HACA,+DACA,oEACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,EAAe,CACtB,WACA,YACA,GAAG,GAGF,CACD,OACE,EAAC,MAAA,CACC,YAAU,kBACV,eAAc,CAAC,CAAC,EAChB,UAAW,EAAG,4EAA6E,EAAU,CACrG,GAAI,YAEJ,EAAC,EAAA,CAAU,UAAU,2BAAA,CAA6B,CACjD,GACC,EAAC,OAAA,CAAK,UAAU,0EAA0E,YAAU,0BACjG,YACI,CAAA,EAEL,CAIV,SAAS,EAAW,CAClB,YACA,WACA,SACA,GAAG,GAGF,CACD,IAAM,EAAU,MACV,IAIC,EAID,GAAQ,SAAW,GAAK,EAAO,IAAI,QAC9B,EAAO,GAAG,QAGZ,EAAC,KAAA,CAAG,UAAU,8CAAsC,EAAO,IAAI,GAAS,GAAO,SAAW,EAAC,KAAA,CAAA,SAAwB,EAAM,QAAA,CAAtB,EAAM,QAA6B,CAAC,EAAM,CAP3I,MAQR,CAAC,EAAU,EAAO,CAAC,CAMtB,OAJK,EAKH,EAAC,MAAA,CAAI,KAAK,QAAQ,YAAU,cAAc,UAAW,EAAG,kCAAmC,EAAU,CAAE,GAAI,WACxG,GACG,CANC"}
1
+ {"version":3,"file":"field-CGacT8J3.js","names":[],"sources":["../packages/components/ui/field.tsx"],"sourcesContent":["'use client';\n\nimport { useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Label } from '@/components/ui/label';\nimport { Separator } from '@/components/ui/separator';\n\nfunction FieldSet({ className, ...props }: React.ComponentProps<'fieldset'>) {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn('flex flex-col gap-6', 'has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3', className)}\n {...props}\n />\n );\n}\n\nfunction FieldLegend({ className, variant = 'legend', ...props }: React.ComponentProps<'legend'> & { variant?: 'legend' | 'label' }) {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn('mb-3 font-medium', 'data-[variant=legend]:text-base', 'data-[variant=label]:text-sm', className)}\n {...props}\n />\n );\n}\n\nfunction FieldGroup({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\n 'group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4',\n className\n )}\n {...props}\n />\n );\n}\n\nconst fieldVariants = cva('group/field flex w-full gap-3 data-[invalid=true]:text-destructive', {\n variants: {\n orientation: {\n vertical: ['flex-col [&>*]:w-full [&>.sr-only]:w-auto'],\n horizontal: [\n 'flex-row items-center',\n '[&>[data-slot=field-label]]:flex-auto',\n 'has-[>[data-slot=field-content]]:items-start',\n 'has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n ],\n responsive: [\n 'flex-col [&>*]:w-full [&>.sr-only]:w-auto',\n '@md/field-group:flex-row',\n '@md/field-group:items-center',\n '@md/field-group:[&>*]:w-auto',\n '@md/field-group:[&>[data-slot=field-label]]:flex-auto',\n '@md/field-group:has-[>[data-slot=field-content]]:items-start',\n '@md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n ],\n },\n },\n defaultVariants: {\n orientation: 'vertical',\n },\n});\n\nfunction Field({ className, orientation = 'vertical', ...props }: React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>) {\n return <div data-slot=\"field\" data-orientation={orientation} className={cn(fieldVariants({ orientation }), className)} {...props} />;\n}\n\nfunction FieldContent({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"field-content\" className={cn('group/field-content flex flex-1 flex-col gap-1.5 leading-snug', className)} {...props} />;\n}\n\nfunction FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>) {\n return (\n <Label\n data-slot=\"field-label\"\n className={cn(\n 'group/field-label peer/field-label flex w-fit gap-2 leading-snug',\n 'group-data-[disabled=true]/field:opacity-50',\n 'has-[>[data-slot=field]]:w-full',\n 'has-[>[data-slot=field]]:flex-col',\n 'has-[>[data-slot=field]]:rounded-md',\n 'has-[>[data-slot=field]]:border',\n '[&>*]:data-[slot=field]:p-4',\n 'has-data-[state=checked]:bg-primary/5',\n 'has-data-[state=checked]:border-primary',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction FieldTitle({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"field-label\"\n className={cn('flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50', className)}\n {...props}\n />\n );\n}\n\nfunction FieldDescription({ className, ...props }: React.ComponentProps<'p'>) {\n return (\n <p\n data-slot=\"field-description\"\n className={cn(\n 'text-text-positive-weak text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance',\n 'last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5',\n '[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction FieldSeparator({\n children,\n className,\n ...props\n}: React.ComponentProps<'div'> & {\n children?: React.ReactNode;\n}) {\n return (\n <div\n data-slot=\"field-separator\"\n data-content={!!children}\n className={cn('relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2', className)}\n {...props}\n >\n <Separator className=\"absolute inset-0 top-1/2\" />\n {children && (\n <span className=\"bg-background text-text-positive-weak relative mx-auto block w-fit px-2\" data-slot=\"field-separator-content\">\n {children}\n </span>\n )}\n </div>\n );\n}\n\nfunction FieldError({\n className,\n children,\n errors,\n ...props\n}: React.ComponentProps<'div'> & {\n errors?: Array<{ message?: string } | undefined>;\n}) {\n const content = useMemo(() => {\n if (children) {\n return children;\n }\n\n if (!errors) {\n return null;\n }\n\n if (errors?.length === 1 && errors[0]?.message) {\n return errors[0].message;\n }\n\n return <ul className=\"ml-4 flex list-disc flex-col gap-1\">{errors.map(error => error?.message && <li key={error.message}>{error.message}</li>)}</ul>;\n }, [children, errors]);\n\n if (!content) {\n return null;\n }\n\n return (\n <div role=\"alert\" data-slot=\"field-error\" className={cn('text-danger text-sm font-normal', className)} {...props}>\n {content}\n </div>\n );\n}\n\nexport { Field, FieldLabel, FieldDescription, FieldError, FieldGroup, FieldLegend, FieldSeparator, FieldSet, FieldContent, FieldTitle };\n"],"mappings":"qRAUA,SAAS,EAAS,CAAE,YAAW,GAAG,GAA2C,CAC3E,OACE,EAAC,WAAA,CACC,YAAU,YACV,UAAW,EAAG,sBAAuB,+EAAgF,EAAU,CAC/H,GAAI,GACJ,CAIN,SAAS,EAAY,CAAE,YAAW,UAAU,SAAU,GAAG,GAA4E,CACnI,OACE,EAAC,SAAA,CACC,YAAU,eACV,eAAc,EACd,UAAW,EAAG,mBAAoB,kCAAmC,+BAAgC,EAAU,CAC/G,GAAI,GACJ,CAIN,SAAS,EAAW,CAAE,YAAW,GAAG,GAAsC,CACxE,OACE,EAAC,MAAA,CACC,YAAU,cACV,UAAW,EACT,yIACA,EACD,CACD,GAAI,GACJ,CAIN,MAAM,EAAgB,EAAI,qEAAsE,CAC9F,SAAU,CACR,YAAa,CACX,SAAU,CAAC,4CAA4C,CACvD,WAAY,CACV,wBACA,wCACA,+CACA,0EACD,CACD,WAAY,CACV,4CACA,2BACA,+BACA,+BACA,wDACA,+DACA,0FACD,CACF,CACF,CACD,gBAAiB,CACf,YAAa,WACd,CACF,CAAC,CAEF,SAAS,EAAM,CAAE,YAAW,cAAc,WAAY,GAAG,GAA2E,CAClI,OAAO,EAAC,MAAA,CAAI,YAAU,QAAQ,mBAAkB,EAAa,UAAW,EAAG,EAAc,CAAE,cAAa,CAAC,CAAE,EAAU,CAAE,GAAI,GAAS,CAGtI,SAAS,EAAa,CAAE,YAAW,GAAG,GAAsC,CAC1E,OAAO,EAAC,MAAA,CAAI,YAAU,gBAAgB,UAAW,EAAG,gEAAiE,EAAU,CAAE,GAAI,GAAS,CAGhJ,SAAS,EAAW,CAAE,YAAW,GAAG,GAA6C,CAC/E,OACE,EAAC,EAAA,CACC,YAAU,cACV,UAAW,EACT,mEACA,8CACA,kCACA,oCACA,sCACA,kCACA,8BACA,wCACA,0CACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,EAAW,CAAE,YAAW,GAAG,GAAsC,CACxE,OACE,EAAC,MAAA,CACC,YAAU,cACV,UAAW,EAAG,6GAA8G,EAAU,CACtI,GAAI,GACJ,CAIN,SAAS,EAAiB,CAAE,YAAW,GAAG,GAAoC,CAC5E,OACE,EAAC,IAAA,CACC,YAAU,oBACV,UAAW,EACT,0HACA,+DACA,oEACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,EAAe,CACtB,WACA,YACA,GAAG,GAGF,CACD,OACE,EAAC,MAAA,CACC,YAAU,kBACV,eAAc,CAAC,CAAC,EAChB,UAAW,EAAG,4EAA6E,EAAU,CACrG,GAAI,YAEJ,EAAC,EAAA,CAAU,UAAU,2BAAA,CAA6B,CACjD,GACC,EAAC,OAAA,CAAK,UAAU,0EAA0E,YAAU,0BACjG,YACI,CAAA,EAEL,CAIV,SAAS,EAAW,CAClB,YACA,WACA,SACA,GAAG,GAGF,CACD,IAAM,EAAU,MACV,IAIC,EAID,GAAQ,SAAW,GAAK,EAAO,IAAI,QAC9B,EAAO,GAAG,QAGZ,EAAC,KAAA,CAAG,UAAU,8CAAsC,EAAO,IAAI,GAAS,GAAO,SAAW,EAAC,KAAA,CAAA,SAAwB,EAAM,QAAA,CAAtB,EAAM,QAA6B,CAAC,EAAM,CAP3I,MAQR,CAAC,EAAU,EAAO,CAAC,CAMtB,OAJK,EAKH,EAAC,MAAA,CAAI,KAAK,QAAQ,YAAU,cAAc,UAAW,EAAG,kCAAmC,EAAU,CAAE,GAAI,WACxG,GACG,CANC"}
@@ -1,2 +1,2 @@
1
1
  const e=require(`./chunk-CUT6urMc.cjs`);let t=require(`@customafk/react-toolkit/utils`);t=e.__toESM(t);let n=require(`react/jsx-runtime`);n=e.__toESM(n);let r=require(`class-variance-authority`);r=e.__toESM(r);const i=(0,r.cva)([`relative flex`,`text-sm`],{variants:{vertical:{true:`flex-col`,false:`flex-row`},width:{full:`w-full`,auto:`w-auto`,fit:`w-fit`,screen:`w-screen`,min:`w-min`,max:`w-max`,null:``},wrap:{true:`flex-wrap`,false:`flex-nowrap`},margin:{sm:`m-2`,md:`m-4`,lg:`m-6`,xl:`m-8`,none:`m-0`},padding:{sm:`p-2`,md:`p-4`,lg:`p-6`,xl:`p-8`,none:`p-0`},gap:{xs:`gap-1`,sm:`gap-2`,md:`gap-4`,lg:`gap-6`,xl:`gap-8`,none:`gap-0`},justify:{start:`justify-start`,center:`justify-center`,end:`justify-end`,between:`justify-between`,around:`justify-around`,evenly:`justify-evenly`,stretch:`justify-stretch`},align:{start:`items-start`,center:`items-center`,end:`items-end`,baseline:`items-baseline`,stretch:`items-stretch`}},defaultVariants:{vertical:!1,wrap:!0,width:`fit`,margin:`none`,padding:`sm`,gap:`xs`,justify:`start`,align:`center`}}),a=({vertical:e,wrap:r,width:a,margin:o,padding:s,gap:c,justify:l,align:u,className:d,children:f})=>(0,n.jsx)(`div`,{className:(0,t.cn)(i({vertical:e,width:a,wrap:r,margin:o,padding:s,gap:c,justify:l,align:u,className:d})),children:f});Object.defineProperty(exports,`Flex`,{enumerable:!0,get:function(){return a}});
2
- //# sourceMappingURL=flex-DgmCJ9Bz.cjs.map
2
+ //# sourceMappingURL=flex-B4klVEz9.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"flex-DgmCJ9Bz.cjs","names":[],"sources":["../packages/components/layouts/flex.tsx"],"sourcesContent":["'use client';\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nconst flexVariants = cva(['relative flex', 'text-sm'], {\n variants: {\n vertical: {\n true: 'flex-col',\n false: 'flex-row',\n },\n width: {\n full: 'w-full',\n auto: 'w-auto',\n fit: 'w-fit',\n screen: 'w-screen',\n min: 'w-min',\n max: 'w-max',\n null: '',\n },\n wrap: {\n true: 'flex-wrap',\n false: 'flex-nowrap',\n },\n margin: {\n sm: 'm-2',\n md: 'm-4',\n lg: 'm-6',\n xl: 'm-8',\n none: 'm-0',\n },\n padding: {\n sm: 'p-2',\n md: 'p-4',\n lg: 'p-6',\n xl: 'p-8',\n none: 'p-0',\n },\n gap: {\n xs: 'gap-1',\n sm: 'gap-2',\n md: 'gap-4',\n lg: 'gap-6',\n xl: 'gap-8',\n none: 'gap-0',\n },\n justify: {\n start: 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n between: 'justify-between',\n around: 'justify-around',\n evenly: 'justify-evenly',\n stretch: 'justify-stretch',\n },\n align: {\n start: 'items-start',\n center: 'items-center',\n end: 'items-end',\n baseline: 'items-baseline',\n stretch: 'items-stretch',\n },\n },\n defaultVariants: {\n vertical: false,\n wrap: true,\n width: 'fit',\n margin: 'none',\n padding: 'sm',\n gap: 'xs',\n justify: 'start',\n align: 'center',\n },\n});\n\ntype Props = {\n className?: string;\n} & VariantProps<typeof flexVariants>;\nexport const Flex = ({ vertical, wrap, width, margin, padding, gap, justify, align, className, children }: React.PropsWithChildren<Props>) => {\n return (\n <div\n className={cn(\n flexVariants({\n vertical,\n width,\n wrap,\n margin,\n padding,\n gap,\n justify,\n align,\n className,\n })\n )}\n >\n {children}\n </div>\n );\n};\n"],"mappings":"kNAKA,MAAM,GAAA,EAAA,EAAA,KAAmB,CAAC,gBAAiB,UAAU,CAAE,CACrD,SAAU,CACR,SAAU,CACR,KAAM,WACN,MAAO,WACR,CACD,MAAO,CACL,KAAM,SACN,KAAM,SACN,IAAK,QACL,OAAQ,WACR,IAAK,QACL,IAAK,QACL,KAAM,GACP,CACD,KAAM,CACJ,KAAM,YACN,MAAO,cACR,CACD,OAAQ,CACN,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,KAAM,MACP,CACD,QAAS,CACP,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,KAAM,MACP,CACD,IAAK,CACH,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,KAAM,QACP,CACD,QAAS,CACP,MAAO,gBACP,OAAQ,iBACR,IAAK,cACL,QAAS,kBACT,OAAQ,iBACR,OAAQ,iBACR,QAAS,kBACV,CACD,MAAO,CACL,MAAO,cACP,OAAQ,eACR,IAAK,YACL,SAAU,iBACV,QAAS,gBACV,CACF,CACD,gBAAiB,CACf,SAAU,GACV,KAAM,GACN,MAAO,MACP,OAAQ,OACR,QAAS,KACT,IAAK,KACL,QAAS,QACT,MAAO,SACR,CACF,CAAC,CAKW,GAAQ,CAAE,WAAU,OAAM,QAAO,SAAQ,UAAS,MAAK,UAAS,QAAO,YAAW,eAE3F,EAAA,EAAA,KAAC,MAAA,CACC,WAAA,EAAA,EAAA,IACE,EAAa,CACX,WACA,QACA,OACA,SACA,UACA,MACA,UACA,QACA,YACD,CAAC,CACH,CAEA,YACG"}
1
+ {"version":3,"file":"flex-B4klVEz9.cjs","names":[],"sources":["../packages/components/layouts/flex.tsx"],"sourcesContent":["'use client';\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nconst flexVariants = cva(['relative flex', 'text-sm'], {\n variants: {\n vertical: {\n true: 'flex-col',\n false: 'flex-row',\n },\n width: {\n full: 'w-full',\n auto: 'w-auto',\n fit: 'w-fit',\n screen: 'w-screen',\n min: 'w-min',\n max: 'w-max',\n null: '',\n },\n wrap: {\n true: 'flex-wrap',\n false: 'flex-nowrap',\n },\n margin: {\n sm: 'm-2',\n md: 'm-4',\n lg: 'm-6',\n xl: 'm-8',\n none: 'm-0',\n },\n padding: {\n sm: 'p-2',\n md: 'p-4',\n lg: 'p-6',\n xl: 'p-8',\n none: 'p-0',\n },\n gap: {\n xs: 'gap-1',\n sm: 'gap-2',\n md: 'gap-4',\n lg: 'gap-6',\n xl: 'gap-8',\n none: 'gap-0',\n },\n justify: {\n start: 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n between: 'justify-between',\n around: 'justify-around',\n evenly: 'justify-evenly',\n stretch: 'justify-stretch',\n },\n align: {\n start: 'items-start',\n center: 'items-center',\n end: 'items-end',\n baseline: 'items-baseline',\n stretch: 'items-stretch',\n },\n },\n defaultVariants: {\n vertical: false,\n wrap: true,\n width: 'fit',\n margin: 'none',\n padding: 'sm',\n gap: 'xs',\n justify: 'start',\n align: 'center',\n },\n});\n\ntype Props = {\n className?: string;\n} & VariantProps<typeof flexVariants>;\nexport const Flex = ({ vertical, wrap, width, margin, padding, gap, justify, align, className, children }: React.PropsWithChildren<Props>) => {\n return (\n <div\n className={cn(\n flexVariants({\n vertical,\n width,\n wrap,\n margin,\n padding,\n gap,\n justify,\n align,\n className,\n })\n )}\n >\n {children}\n </div>\n );\n};\n"],"mappings":"kNAKA,MAAM,GAAA,EAAA,EAAA,KAAmB,CAAC,gBAAiB,UAAU,CAAE,CACrD,SAAU,CACR,SAAU,CACR,KAAM,WACN,MAAO,WACR,CACD,MAAO,CACL,KAAM,SACN,KAAM,SACN,IAAK,QACL,OAAQ,WACR,IAAK,QACL,IAAK,QACL,KAAM,GACP,CACD,KAAM,CACJ,KAAM,YACN,MAAO,cACR,CACD,OAAQ,CACN,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,KAAM,MACP,CACD,QAAS,CACP,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,KAAM,MACP,CACD,IAAK,CACH,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,KAAM,QACP,CACD,QAAS,CACP,MAAO,gBACP,OAAQ,iBACR,IAAK,cACL,QAAS,kBACT,OAAQ,iBACR,OAAQ,iBACR,QAAS,kBACV,CACD,MAAO,CACL,MAAO,cACP,OAAQ,eACR,IAAK,YACL,SAAU,iBACV,QAAS,gBACV,CACF,CACD,gBAAiB,CACf,SAAU,GACV,KAAM,GACN,MAAO,MACP,OAAQ,OACR,QAAS,KACT,IAAK,KACL,QAAS,QACT,MAAO,SACR,CACF,CAAC,CAKW,GAAQ,CAAE,WAAU,OAAM,QAAO,SAAQ,UAAS,MAAK,UAAS,QAAO,YAAW,eAE3F,EAAA,EAAA,KAAC,MAAA,CACC,WAAA,EAAA,EAAA,IACE,EAAa,CACX,WACA,QACA,OACA,SACA,UACA,MACA,UACA,QACA,YACD,CAAC,CACH,CAEA,YACG"}
@@ -1,2 +1,2 @@
1
1
  import{cn as e}from"@customafk/react-toolkit/utils";import{jsx as t}from"react/jsx-runtime";import{cva as n}from"class-variance-authority";const r=n([`relative flex`,`text-sm`],{variants:{vertical:{true:`flex-col`,false:`flex-row`},width:{full:`w-full`,auto:`w-auto`,fit:`w-fit`,screen:`w-screen`,min:`w-min`,max:`w-max`,null:``},wrap:{true:`flex-wrap`,false:`flex-nowrap`},margin:{sm:`m-2`,md:`m-4`,lg:`m-6`,xl:`m-8`,none:`m-0`},padding:{sm:`p-2`,md:`p-4`,lg:`p-6`,xl:`p-8`,none:`p-0`},gap:{xs:`gap-1`,sm:`gap-2`,md:`gap-4`,lg:`gap-6`,xl:`gap-8`,none:`gap-0`},justify:{start:`justify-start`,center:`justify-center`,end:`justify-end`,between:`justify-between`,around:`justify-around`,evenly:`justify-evenly`,stretch:`justify-stretch`},align:{start:`items-start`,center:`items-center`,end:`items-end`,baseline:`items-baseline`,stretch:`items-stretch`}},defaultVariants:{vertical:!1,wrap:!0,width:`fit`,margin:`none`,padding:`sm`,gap:`xs`,justify:`start`,align:`center`}}),i=({vertical:n,wrap:i,width:a,margin:o,padding:s,gap:c,justify:l,align:u,className:d,children:f})=>t(`div`,{className:e(r({vertical:n,width:a,wrap:i,margin:o,padding:s,gap:c,justify:l,align:u,className:d})),children:f});export{i as Flex};
2
- //# sourceMappingURL=flex-BJgsQWLI.js.map
2
+ //# sourceMappingURL=flex-D6XrXRQW.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"flex-BJgsQWLI.js","names":[],"sources":["../packages/components/layouts/flex.tsx"],"sourcesContent":["'use client';\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nconst flexVariants = cva(['relative flex', 'text-sm'], {\n variants: {\n vertical: {\n true: 'flex-col',\n false: 'flex-row',\n },\n width: {\n full: 'w-full',\n auto: 'w-auto',\n fit: 'w-fit',\n screen: 'w-screen',\n min: 'w-min',\n max: 'w-max',\n null: '',\n },\n wrap: {\n true: 'flex-wrap',\n false: 'flex-nowrap',\n },\n margin: {\n sm: 'm-2',\n md: 'm-4',\n lg: 'm-6',\n xl: 'm-8',\n none: 'm-0',\n },\n padding: {\n sm: 'p-2',\n md: 'p-4',\n lg: 'p-6',\n xl: 'p-8',\n none: 'p-0',\n },\n gap: {\n xs: 'gap-1',\n sm: 'gap-2',\n md: 'gap-4',\n lg: 'gap-6',\n xl: 'gap-8',\n none: 'gap-0',\n },\n justify: {\n start: 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n between: 'justify-between',\n around: 'justify-around',\n evenly: 'justify-evenly',\n stretch: 'justify-stretch',\n },\n align: {\n start: 'items-start',\n center: 'items-center',\n end: 'items-end',\n baseline: 'items-baseline',\n stretch: 'items-stretch',\n },\n },\n defaultVariants: {\n vertical: false,\n wrap: true,\n width: 'fit',\n margin: 'none',\n padding: 'sm',\n gap: 'xs',\n justify: 'start',\n align: 'center',\n },\n});\n\ntype Props = {\n className?: string;\n} & VariantProps<typeof flexVariants>;\nexport const Flex = ({ vertical, wrap, width, margin, padding, gap, justify, align, className, children }: React.PropsWithChildren<Props>) => {\n return (\n <div\n className={cn(\n flexVariants({\n vertical,\n width,\n wrap,\n margin,\n padding,\n gap,\n justify,\n align,\n className,\n })\n )}\n >\n {children}\n </div>\n );\n};\n"],"mappings":"2IAKA,MAAM,EAAe,EAAI,CAAC,gBAAiB,UAAU,CAAE,CACrD,SAAU,CACR,SAAU,CACR,KAAM,WACN,MAAO,WACR,CACD,MAAO,CACL,KAAM,SACN,KAAM,SACN,IAAK,QACL,OAAQ,WACR,IAAK,QACL,IAAK,QACL,KAAM,GACP,CACD,KAAM,CACJ,KAAM,YACN,MAAO,cACR,CACD,OAAQ,CACN,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,KAAM,MACP,CACD,QAAS,CACP,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,KAAM,MACP,CACD,IAAK,CACH,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,KAAM,QACP,CACD,QAAS,CACP,MAAO,gBACP,OAAQ,iBACR,IAAK,cACL,QAAS,kBACT,OAAQ,iBACR,OAAQ,iBACR,QAAS,kBACV,CACD,MAAO,CACL,MAAO,cACP,OAAQ,eACR,IAAK,YACL,SAAU,iBACV,QAAS,gBACV,CACF,CACD,gBAAiB,CACf,SAAU,GACV,KAAM,GACN,MAAO,MACP,OAAQ,OACR,QAAS,KACT,IAAK,KACL,QAAS,QACT,MAAO,SACR,CACF,CAAC,CAKW,GAAQ,CAAE,WAAU,OAAM,QAAO,SAAQ,UAAS,MAAK,UAAS,QAAO,YAAW,cAE3F,EAAC,MAAA,CACC,UAAW,EACT,EAAa,CACX,WACA,QACA,OACA,SACA,UACA,MACA,UACA,QACA,YACD,CAAC,CACH,CAEA,YACG"}
1
+ {"version":3,"file":"flex-D6XrXRQW.js","names":[],"sources":["../packages/components/layouts/flex.tsx"],"sourcesContent":["'use client';\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nconst flexVariants = cva(['relative flex', 'text-sm'], {\n variants: {\n vertical: {\n true: 'flex-col',\n false: 'flex-row',\n },\n width: {\n full: 'w-full',\n auto: 'w-auto',\n fit: 'w-fit',\n screen: 'w-screen',\n min: 'w-min',\n max: 'w-max',\n null: '',\n },\n wrap: {\n true: 'flex-wrap',\n false: 'flex-nowrap',\n },\n margin: {\n sm: 'm-2',\n md: 'm-4',\n lg: 'm-6',\n xl: 'm-8',\n none: 'm-0',\n },\n padding: {\n sm: 'p-2',\n md: 'p-4',\n lg: 'p-6',\n xl: 'p-8',\n none: 'p-0',\n },\n gap: {\n xs: 'gap-1',\n sm: 'gap-2',\n md: 'gap-4',\n lg: 'gap-6',\n xl: 'gap-8',\n none: 'gap-0',\n },\n justify: {\n start: 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n between: 'justify-between',\n around: 'justify-around',\n evenly: 'justify-evenly',\n stretch: 'justify-stretch',\n },\n align: {\n start: 'items-start',\n center: 'items-center',\n end: 'items-end',\n baseline: 'items-baseline',\n stretch: 'items-stretch',\n },\n },\n defaultVariants: {\n vertical: false,\n wrap: true,\n width: 'fit',\n margin: 'none',\n padding: 'sm',\n gap: 'xs',\n justify: 'start',\n align: 'center',\n },\n});\n\ntype Props = {\n className?: string;\n} & VariantProps<typeof flexVariants>;\nexport const Flex = ({ vertical, wrap, width, margin, padding, gap, justify, align, className, children }: React.PropsWithChildren<Props>) => {\n return (\n <div\n className={cn(\n flexVariants({\n vertical,\n width,\n wrap,\n margin,\n padding,\n gap,\n justify,\n align,\n className,\n })\n )}\n >\n {children}\n </div>\n );\n};\n"],"mappings":"2IAKA,MAAM,EAAe,EAAI,CAAC,gBAAiB,UAAU,CAAE,CACrD,SAAU,CACR,SAAU,CACR,KAAM,WACN,MAAO,WACR,CACD,MAAO,CACL,KAAM,SACN,KAAM,SACN,IAAK,QACL,OAAQ,WACR,IAAK,QACL,IAAK,QACL,KAAM,GACP,CACD,KAAM,CACJ,KAAM,YACN,MAAO,cACR,CACD,OAAQ,CACN,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,KAAM,MACP,CACD,QAAS,CACP,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,KAAM,MACP,CACD,IAAK,CACH,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,KAAM,QACP,CACD,QAAS,CACP,MAAO,gBACP,OAAQ,iBACR,IAAK,cACL,QAAS,kBACT,OAAQ,iBACR,OAAQ,iBACR,QAAS,kBACV,CACD,MAAO,CACL,MAAO,cACP,OAAQ,eACR,IAAK,YACL,SAAU,iBACV,QAAS,gBACV,CACF,CACD,gBAAiB,CACf,SAAU,GACV,KAAM,GACN,MAAO,MACP,OAAQ,OACR,QAAS,KACT,IAAK,KACL,QAAS,QACT,MAAO,SACR,CACF,CAAC,CAKW,GAAQ,CAAE,WAAU,OAAM,QAAO,SAAQ,UAAS,MAAK,UAAS,QAAO,YAAW,cAE3F,EAAC,MAAA,CACC,UAAW,EACT,EAAa,CACX,WACA,QACA,OACA,SACA,UACA,MACA,UACA,QACA,YACD,CAAC,CACH,CAEA,YACG"}
@@ -1,2 +1,2 @@
1
- import{Field as e,FieldDescription as t,FieldLabel as n}from"./field-DSScKMdZ.js";import{cn as r}from"@customafk/react-toolkit/utils";import{createContext as i,useContext as a,useId as o}from"react";import{jsx as s}from"react/jsx-runtime";import{Slot as c}from"radix-ui";import{Controller as l,FormProvider as u,useFormContext as d,useFormState as f}from"react-hook-form";const p=u,m=i({}),h=({...e})=>s(m.Provider,{value:{name:e.name},children:s(l,{...e})}),g=()=>{let e=a(m),t=a(_),{getFieldState:n,control:r,resetField:i}=d(),o=f({name:e.name}),s=n(e.name,o);if(!e)throw Error(`useFormField should be used within <FormField>`);let{id:c}=t;return{id:c,control:r,resetField:i,name:e.name,formItemId:`${c}-form-item`,formDescriptionId:`${c}-form-item-description`,formMessageId:`${c}-form-item-message`,...s}},_=i({});function v({className:t,...n}){let r=o();return s(_.Provider,{value:{id:r},children:s(e,{orientation:`responsive`,...n})})}function y({...e}){let{formItemId:t}=g();return s(n,{htmlFor:t,...e})}function b({...e}){let{error:t,formItemId:n,formDescriptionId:r,formMessageId:i}=g();return s(c.Slot,{"data-slot":`form-control`,id:n,"aria-describedby":t?`${r} ${i}`:`${r}`,"aria-invalid":!!t,...e})}function x({className:e,...n}){let{formDescriptionId:i}=g();return s(t,{id:i,className:r(`text-text-positive-weak text-sm leading-normal font-normal`,`group-has-[[data-orientation=horizontal]]/field:text-balance`,`last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5`,`[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4`,e),...n})}function S({className:e,children:t,...n}){let{error:i,formMessageId:a}=g();return s(`span`,{"data-slot":`form-message`,id:a,className:r(`text-danger text-xs`,e),...n,children:i?String(i?.message??``):t})}export{p as Form,b as FormControl,x as FormDescription,h as FormField,v as FormItem,y as FormLabel,S as FormMessage,g as useFormField};
2
- //# sourceMappingURL=form-DbknMHac.js.map
1
+ import{Field as e,FieldDescription as t,FieldLabel as n}from"./field-CGacT8J3.js";import{cn as r}from"@customafk/react-toolkit/utils";import{createContext as i,useContext as a,useId as o}from"react";import{jsx as s}from"react/jsx-runtime";import{Slot as c}from"radix-ui";import{Controller as l,FormProvider as u,useFormContext as d,useFormState as f}from"react-hook-form";const p=u,m=i({}),h=({...e})=>s(m.Provider,{value:{name:e.name},children:s(l,{...e})}),g=()=>{let e=a(m),t=a(_),{getFieldState:n,control:r,resetField:i}=d(),o=f({name:e.name}),s=n(e.name,o);if(!e)throw Error(`useFormField should be used within <FormField>`);let{id:c}=t;return{id:c,control:r,resetField:i,name:e.name,formItemId:`${c}-form-item`,formDescriptionId:`${c}-form-item-description`,formMessageId:`${c}-form-item-message`,...s}},_=i({});function v({className:t,...n}){let r=o();return s(_.Provider,{value:{id:r},children:s(e,{orientation:`responsive`,...n})})}function y({...e}){let{formItemId:t}=g();return s(n,{htmlFor:t,...e})}function b({...e}){let{error:t,formItemId:n,formDescriptionId:r,formMessageId:i}=g();return s(c.Slot,{"data-slot":`form-control`,id:n,"aria-describedby":t?`${r} ${i}`:`${r}`,"aria-invalid":!!t,...e})}function x({className:e,...n}){let{formDescriptionId:i}=g();return s(t,{id:i,className:r(`text-text-positive-weak text-sm leading-normal font-normal`,`group-has-[[data-orientation=horizontal]]/field:text-balance`,`last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5`,`[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4`,e),...n})}function S({className:e,children:t,...n}){let{error:i,formMessageId:a}=g();return s(`span`,{"data-slot":`form-message`,id:a,className:r(`text-danger text-xs`,e),...n,children:i?String(i?.message??``):t})}export{p as Form,b as FormControl,x as FormDescription,h as FormField,v as FormItem,y as FormLabel,S as FormMessage,g as useFormField};
2
+ //# sourceMappingURL=form-B_tL9lO4.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-DbknMHac.js","names":["SlotPrimitive"],"sources":["../packages/components/ui/form.tsx"],"sourcesContent":["'use client';\nimport { createContext, useContext, useId } from 'react';\nimport type { ControllerProps, FieldPath, FieldValues } from 'react-hook-form';\nimport { Controller, FormProvider, useFormContext, useFormState } from 'react-hook-form';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { type Label as LabelPrimitive, Slot as SlotPrimitive } from 'radix-ui';\nimport { Field, FieldDescription, FieldLabel } from './field';\n\nconst Form = FormProvider;\n\ntype FormFieldContextValue<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {\n name: TName;\n};\n\nconst FormFieldContext = createContext<FormFieldContextValue>({} as FormFieldContextValue);\n\nconst FormField = <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n};\n\nconst useFormField = () => {\n const fieldContext = useContext(FormFieldContext);\n const itemContext = useContext(FormItemContext);\n const { getFieldState, control, resetField } = useFormContext();\n const formState = useFormState({ name: fieldContext.name });\n const fieldState = getFieldState(fieldContext.name, formState);\n\n if (!fieldContext) {\n throw new Error('useFormField should be used within <FormField>');\n }\n\n const { id } = itemContext;\n\n return {\n id,\n control,\n resetField,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n\ntype FormItemContextValue = {\n id: string;\n};\n\nconst FormItemContext = createContext<FormItemContextValue>({} as FormItemContextValue);\n\nfunction FormItem({ className, ...props }: React.ComponentProps<'div'>) {\n const id = useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <Field orientation=\"responsive\" {...props} />\n </FormItemContext.Provider>\n );\n}\n\nfunction FormLabel({ ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {\n const { formItemId } = useFormField();\n return <FieldLabel htmlFor={formItemId} {...props} />;\n}\n\nfunction FormControl({ ...props }: React.ComponentProps<typeof SlotPrimitive.Slot>) {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n return (\n <SlotPrimitive.Slot\n data-slot=\"form-control\"\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n );\n}\n\nfunction FormDescription({ className, ...props }: React.ComponentProps<'p'>) {\n const { formDescriptionId } = useFormField();\n\n return (\n <FieldDescription\n id={formDescriptionId}\n className={cn(\n 'text-text-positive-weak text-sm leading-normal font-normal',\n 'group-has-[[data-orientation=horizontal]]/field:text-balance',\n 'last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5',\n '[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction FormMessage({ className, children, ...props }: React.ComponentProps<'p'>) {\n const { error, formMessageId } = useFormField();\n\n return (\n <span data-slot=\"form-message\" id={formMessageId} className={cn('text-danger text-xs', className)} {...props}>\n {error ? String(error?.message ?? '') : children}\n </span>\n );\n}\n\n// eslint-disable-next-line react-refresh/only-export-components\nexport { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField };\n"],"mappings":"oXAUA,MAAM,EAAO,EAMP,EAAmB,EAAqC,EAAE,CAA0B,CAEpF,GAA8H,CAClI,GAAG,KAGD,EAAC,EAAiB,SAAA,CAAS,MAAO,CAAE,KAAM,EAAM,KAAM,UACpD,EAAC,EAAA,CAAW,GAAI,EAAA,CAAS,EACC,CAI1B,MAAqB,CACzB,IAAM,EAAe,EAAW,EAAiB,CAC3C,EAAc,EAAW,EAAgB,CACzC,CAAE,gBAAe,UAAS,cAAe,GAAgB,CACzD,EAAY,EAAa,CAAE,KAAM,EAAa,KAAM,CAAC,CACrD,EAAa,EAAc,EAAa,KAAM,EAAU,CAE9D,GAAI,CAAC,EACH,MAAU,MAAM,iDAAiD,CAGnE,GAAM,CAAE,MAAO,EAEf,MAAO,CACL,KACA,UACA,aACA,KAAM,EAAa,KACnB,WAAY,GAAG,EAAG,YAClB,kBAAmB,GAAG,EAAG,wBACzB,cAAe,GAAG,EAAG,oBACrB,GAAG,EACJ,EAOG,EAAkB,EAAoC,EAAE,CAAyB,CAEvF,SAAS,EAAS,CAAE,YAAW,GAAG,GAAsC,CACtE,IAAM,EAAK,GAAO,CAElB,OACE,EAAC,EAAgB,SAAA,CAAS,MAAO,CAAE,KAAI,UACrC,EAAC,EAAA,CAAM,YAAY,aAAa,GAAI,GAAS,EACpB,CAI/B,SAAS,EAAU,CAAE,GAAG,GAA2D,CACjF,GAAM,CAAE,cAAe,GAAc,CACrC,OAAO,EAAC,EAAA,CAAW,QAAS,EAAY,GAAI,GAAS,CAGvD,SAAS,EAAY,CAAE,GAAG,GAA0D,CAClF,GAAM,CAAE,QAAO,aAAY,oBAAmB,iBAAkB,GAAc,CAE9E,OACE,EAACA,EAAc,KAAA,CACb,YAAU,eACV,GAAI,EACJ,mBAAmB,EAAiC,GAAG,EAAkB,GAAG,IAAjD,GAAG,IAC9B,eAAc,CAAC,CAAC,EAChB,GAAI,GACJ,CAIN,SAAS,EAAgB,CAAE,YAAW,GAAG,GAAoC,CAC3E,GAAM,CAAE,qBAAsB,GAAc,CAE5C,OACE,EAAC,EAAA,CACC,GAAI,EACJ,UAAW,EACT,6DACA,+DACA,+DACA,oEACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,EAAY,CAAE,YAAW,WAAU,GAAG,GAAoC,CACjF,GAAM,CAAE,QAAO,iBAAkB,GAAc,CAE/C,OACE,EAAC,OAAA,CAAK,YAAU,eAAe,GAAI,EAAe,UAAW,EAAG,sBAAuB,EAAU,CAAE,GAAI,WACpG,EAAQ,OAAO,GAAO,SAAW,GAAG,CAAG,GACnC"}
1
+ {"version":3,"file":"form-B_tL9lO4.js","names":["SlotPrimitive"],"sources":["../packages/components/ui/form.tsx"],"sourcesContent":["'use client';\nimport { createContext, useContext, useId } from 'react';\nimport type { ControllerProps, FieldPath, FieldValues } from 'react-hook-form';\nimport { Controller, FormProvider, useFormContext, useFormState } from 'react-hook-form';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { type Label as LabelPrimitive, Slot as SlotPrimitive } from 'radix-ui';\nimport { Field, FieldDescription, FieldLabel } from './field';\n\nconst Form = FormProvider;\n\ntype FormFieldContextValue<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {\n name: TName;\n};\n\nconst FormFieldContext = createContext<FormFieldContextValue>({} as FormFieldContextValue);\n\nconst FormField = <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n};\n\nconst useFormField = () => {\n const fieldContext = useContext(FormFieldContext);\n const itemContext = useContext(FormItemContext);\n const { getFieldState, control, resetField } = useFormContext();\n const formState = useFormState({ name: fieldContext.name });\n const fieldState = getFieldState(fieldContext.name, formState);\n\n if (!fieldContext) {\n throw new Error('useFormField should be used within <FormField>');\n }\n\n const { id } = itemContext;\n\n return {\n id,\n control,\n resetField,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n\ntype FormItemContextValue = {\n id: string;\n};\n\nconst FormItemContext = createContext<FormItemContextValue>({} as FormItemContextValue);\n\nfunction FormItem({ className, ...props }: React.ComponentProps<'div'>) {\n const id = useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <Field orientation=\"responsive\" {...props} />\n </FormItemContext.Provider>\n );\n}\n\nfunction FormLabel({ ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {\n const { formItemId } = useFormField();\n return <FieldLabel htmlFor={formItemId} {...props} />;\n}\n\nfunction FormControl({ ...props }: React.ComponentProps<typeof SlotPrimitive.Slot>) {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n return (\n <SlotPrimitive.Slot\n data-slot=\"form-control\"\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n );\n}\n\nfunction FormDescription({ className, ...props }: React.ComponentProps<'p'>) {\n const { formDescriptionId } = useFormField();\n\n return (\n <FieldDescription\n id={formDescriptionId}\n className={cn(\n 'text-text-positive-weak text-sm leading-normal font-normal',\n 'group-has-[[data-orientation=horizontal]]/field:text-balance',\n 'last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5',\n '[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction FormMessage({ className, children, ...props }: React.ComponentProps<'p'>) {\n const { error, formMessageId } = useFormField();\n\n return (\n <span data-slot=\"form-message\" id={formMessageId} className={cn('text-danger text-xs', className)} {...props}>\n {error ? String(error?.message ?? '') : children}\n </span>\n );\n}\n\n// eslint-disable-next-line react-refresh/only-export-components\nexport { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField };\n"],"mappings":"oXAUA,MAAM,EAAO,EAMP,EAAmB,EAAqC,EAAE,CAA0B,CAEpF,GAA8H,CAClI,GAAG,KAGD,EAAC,EAAiB,SAAA,CAAS,MAAO,CAAE,KAAM,EAAM,KAAM,UACpD,EAAC,EAAA,CAAW,GAAI,EAAA,CAAS,EACC,CAI1B,MAAqB,CACzB,IAAM,EAAe,EAAW,EAAiB,CAC3C,EAAc,EAAW,EAAgB,CACzC,CAAE,gBAAe,UAAS,cAAe,GAAgB,CACzD,EAAY,EAAa,CAAE,KAAM,EAAa,KAAM,CAAC,CACrD,EAAa,EAAc,EAAa,KAAM,EAAU,CAE9D,GAAI,CAAC,EACH,MAAU,MAAM,iDAAiD,CAGnE,GAAM,CAAE,MAAO,EAEf,MAAO,CACL,KACA,UACA,aACA,KAAM,EAAa,KACnB,WAAY,GAAG,EAAG,YAClB,kBAAmB,GAAG,EAAG,wBACzB,cAAe,GAAG,EAAG,oBACrB,GAAG,EACJ,EAOG,EAAkB,EAAoC,EAAE,CAAyB,CAEvF,SAAS,EAAS,CAAE,YAAW,GAAG,GAAsC,CACtE,IAAM,EAAK,GAAO,CAElB,OACE,EAAC,EAAgB,SAAA,CAAS,MAAO,CAAE,KAAI,UACrC,EAAC,EAAA,CAAM,YAAY,aAAa,GAAI,GAAS,EACpB,CAI/B,SAAS,EAAU,CAAE,GAAG,GAA2D,CACjF,GAAM,CAAE,cAAe,GAAc,CACrC,OAAO,EAAC,EAAA,CAAW,QAAS,EAAY,GAAI,GAAS,CAGvD,SAAS,EAAY,CAAE,GAAG,GAA0D,CAClF,GAAM,CAAE,QAAO,aAAY,oBAAmB,iBAAkB,GAAc,CAE9E,OACE,EAACA,EAAc,KAAA,CACb,YAAU,eACV,GAAI,EACJ,mBAAmB,EAAiC,GAAG,EAAkB,GAAG,IAAjD,GAAG,IAC9B,eAAc,CAAC,CAAC,EAChB,GAAI,GACJ,CAIN,SAAS,EAAgB,CAAE,YAAW,GAAG,GAAoC,CAC3E,GAAM,CAAE,qBAAsB,GAAc,CAE5C,OACE,EAAC,EAAA,CACC,GAAI,EACJ,UAAW,EACT,6DACA,+DACA,+DACA,oEACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,EAAY,CAAE,YAAW,WAAU,GAAG,GAAoC,CACjF,GAAM,CAAE,QAAO,iBAAkB,GAAc,CAE/C,OACE,EAAC,OAAA,CAAK,YAAU,eAAe,GAAI,EAAe,UAAW,EAAG,sBAAuB,EAAU,CAAE,GAAI,WACpG,EAAQ,OAAO,GAAO,SAAW,GAAG,CAAG,GACnC"}
@@ -1,2 +1,2 @@
1
- const e=require(`./chunk-CUT6urMc.cjs`),t=require(`./field-B_qC62YD.cjs`);let n=require(`@customafk/react-toolkit/utils`);n=e.__toESM(n);let r=require(`react`);r=e.__toESM(r);let i=require(`react/jsx-runtime`);i=e.__toESM(i);let a=require(`radix-ui`);a=e.__toESM(a);let o=require(`react-hook-form`);o=e.__toESM(o);const s=o.FormProvider,c=(0,r.createContext)({}),l=({...e})=>(0,i.jsx)(c.Provider,{value:{name:e.name},children:(0,i.jsx)(o.Controller,{...e})}),u=()=>{let e=(0,r.useContext)(c),t=(0,r.useContext)(d),{getFieldState:n,control:i,resetField:a}=(0,o.useFormContext)(),s=(0,o.useFormState)({name:e.name}),l=n(e.name,s);if(!e)throw Error(`useFormField should be used within <FormField>`);let{id:u}=t;return{id:u,control:i,resetField:a,name:e.name,formItemId:`${u}-form-item`,formDescriptionId:`${u}-form-item-description`,formMessageId:`${u}-form-item-message`,...l}},d=(0,r.createContext)({});function f({className:e,...n}){let a=(0,r.useId)();return(0,i.jsx)(d.Provider,{value:{id:a},children:(0,i.jsx)(t.Field,{orientation:`responsive`,...n})})}function p({...e}){let{formItemId:n}=u();return(0,i.jsx)(t.FieldLabel,{htmlFor:n,...e})}function m({...e}){let{error:t,formItemId:n,formDescriptionId:r,formMessageId:o}=u();return(0,i.jsx)(a.Slot.Slot,{"data-slot":`form-control`,id:n,"aria-describedby":t?`${r} ${o}`:`${r}`,"aria-invalid":!!t,...e})}function h({className:e,...r}){let{formDescriptionId:a}=u();return(0,i.jsx)(t.FieldDescription,{id:a,className:(0,n.cn)(`text-text-positive-weak text-sm leading-normal font-normal`,`group-has-[[data-orientation=horizontal]]/field:text-balance`,`last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5`,`[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4`,e),...r})}function g({className:e,children:t,...r}){let{error:a,formMessageId:o}=u();return(0,i.jsx)(`span`,{"data-slot":`form-message`,id:o,className:(0,n.cn)(`text-danger text-xs`,e),...r,children:a?String(a?.message??``):t})}Object.defineProperty(exports,`Form`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`FormControl`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`FormDescription`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`FormField`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`FormItem`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`FormLabel`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`FormMessage`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`useFormField`,{enumerable:!0,get:function(){return u}});
2
- //# sourceMappingURL=form-t4WaMbFV.cjs.map
1
+ const e=require(`./chunk-CUT6urMc.cjs`),t=require(`./field-A43YZ5Wj.cjs`);let n=require(`@customafk/react-toolkit/utils`);n=e.__toESM(n);let r=require(`react`);r=e.__toESM(r);let i=require(`react/jsx-runtime`);i=e.__toESM(i);let a=require(`radix-ui`);a=e.__toESM(a);let o=require(`react-hook-form`);o=e.__toESM(o);const s=o.FormProvider,c=(0,r.createContext)({}),l=({...e})=>(0,i.jsx)(c.Provider,{value:{name:e.name},children:(0,i.jsx)(o.Controller,{...e})}),u=()=>{let e=(0,r.useContext)(c),t=(0,r.useContext)(d),{getFieldState:n,control:i,resetField:a}=(0,o.useFormContext)(),s=(0,o.useFormState)({name:e.name}),l=n(e.name,s);if(!e)throw Error(`useFormField should be used within <FormField>`);let{id:u}=t;return{id:u,control:i,resetField:a,name:e.name,formItemId:`${u}-form-item`,formDescriptionId:`${u}-form-item-description`,formMessageId:`${u}-form-item-message`,...l}},d=(0,r.createContext)({});function f({className:e,...n}){let a=(0,r.useId)();return(0,i.jsx)(d.Provider,{value:{id:a},children:(0,i.jsx)(t.Field,{orientation:`responsive`,...n})})}function p({...e}){let{formItemId:n}=u();return(0,i.jsx)(t.FieldLabel,{htmlFor:n,...e})}function m({...e}){let{error:t,formItemId:n,formDescriptionId:r,formMessageId:o}=u();return(0,i.jsx)(a.Slot.Slot,{"data-slot":`form-control`,id:n,"aria-describedby":t?`${r} ${o}`:`${r}`,"aria-invalid":!!t,...e})}function h({className:e,...r}){let{formDescriptionId:a}=u();return(0,i.jsx)(t.FieldDescription,{id:a,className:(0,n.cn)(`text-text-positive-weak text-sm leading-normal font-normal`,`group-has-[[data-orientation=horizontal]]/field:text-balance`,`last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5`,`[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4`,e),...r})}function g({className:e,children:t,...r}){let{error:a,formMessageId:o}=u();return(0,i.jsx)(`span`,{"data-slot":`form-message`,id:o,className:(0,n.cn)(`text-danger text-xs`,e),...r,children:a?String(a?.message??``):t})}Object.defineProperty(exports,`Form`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`FormControl`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`FormDescription`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`FormField`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`FormItem`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`FormLabel`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`FormMessage`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`useFormField`,{enumerable:!0,get:function(){return u}});
2
+ //# sourceMappingURL=form-DV9tQbiO.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-t4WaMbFV.cjs","names":["FormProvider","Controller","Field","FieldLabel","SlotPrimitive","FieldDescription"],"sources":["../packages/components/ui/form.tsx"],"sourcesContent":["'use client';\nimport { createContext, useContext, useId } from 'react';\nimport type { ControllerProps, FieldPath, FieldValues } from 'react-hook-form';\nimport { Controller, FormProvider, useFormContext, useFormState } from 'react-hook-form';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { type Label as LabelPrimitive, Slot as SlotPrimitive } from 'radix-ui';\nimport { Field, FieldDescription, FieldLabel } from './field';\n\nconst Form = FormProvider;\n\ntype FormFieldContextValue<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {\n name: TName;\n};\n\nconst FormFieldContext = createContext<FormFieldContextValue>({} as FormFieldContextValue);\n\nconst FormField = <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n};\n\nconst useFormField = () => {\n const fieldContext = useContext(FormFieldContext);\n const itemContext = useContext(FormItemContext);\n const { getFieldState, control, resetField } = useFormContext();\n const formState = useFormState({ name: fieldContext.name });\n const fieldState = getFieldState(fieldContext.name, formState);\n\n if (!fieldContext) {\n throw new Error('useFormField should be used within <FormField>');\n }\n\n const { id } = itemContext;\n\n return {\n id,\n control,\n resetField,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n\ntype FormItemContextValue = {\n id: string;\n};\n\nconst FormItemContext = createContext<FormItemContextValue>({} as FormItemContextValue);\n\nfunction FormItem({ className, ...props }: React.ComponentProps<'div'>) {\n const id = useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <Field orientation=\"responsive\" {...props} />\n </FormItemContext.Provider>\n );\n}\n\nfunction FormLabel({ ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {\n const { formItemId } = useFormField();\n return <FieldLabel htmlFor={formItemId} {...props} />;\n}\n\nfunction FormControl({ ...props }: React.ComponentProps<typeof SlotPrimitive.Slot>) {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n return (\n <SlotPrimitive.Slot\n data-slot=\"form-control\"\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n );\n}\n\nfunction FormDescription({ className, ...props }: React.ComponentProps<'p'>) {\n const { formDescriptionId } = useFormField();\n\n return (\n <FieldDescription\n id={formDescriptionId}\n className={cn(\n 'text-text-positive-weak text-sm leading-normal font-normal',\n 'group-has-[[data-orientation=horizontal]]/field:text-balance',\n 'last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5',\n '[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction FormMessage({ className, children, ...props }: React.ComponentProps<'p'>) {\n const { error, formMessageId } = useFormField();\n\n return (\n <span data-slot=\"form-message\" id={formMessageId} className={cn('text-danger text-xs', className)} {...props}>\n {error ? String(error?.message ?? '') : children}\n </span>\n );\n}\n\n// eslint-disable-next-line react-refresh/only-export-components\nexport { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField };\n"],"mappings":"0TAUA,MAAM,EAAOA,EAAAA,aAMP,GAAA,EAAA,EAAA,eAAwD,EAAE,CAA0B,CAEpF,GAA8H,CAClI,GAAG,MAGD,EAAA,EAAA,KAAC,EAAiB,SAAA,CAAS,MAAO,CAAE,KAAM,EAAM,KAAM,WACpD,EAAA,EAAA,KAACC,EAAAA,WAAAA,CAAW,GAAI,EAAA,CAAS,EACC,CAI1B,MAAqB,CACzB,IAAM,GAAA,EAAA,EAAA,YAA0B,EAAiB,CAC3C,GAAA,EAAA,EAAA,YAAyB,EAAgB,CACzC,CAAE,gBAAe,UAAS,eAAA,EAAA,EAAA,iBAA+B,CACzD,GAAA,EAAA,EAAA,cAAyB,CAAE,KAAM,EAAa,KAAM,CAAC,CACrD,EAAa,EAAc,EAAa,KAAM,EAAU,CAE9D,GAAI,CAAC,EACH,MAAU,MAAM,iDAAiD,CAGnE,GAAM,CAAE,MAAO,EAEf,MAAO,CACL,KACA,UACA,aACA,KAAM,EAAa,KACnB,WAAY,GAAG,EAAG,YAClB,kBAAmB,GAAG,EAAG,wBACzB,cAAe,GAAG,EAAG,oBACrB,GAAG,EACJ,EAOG,GAAA,EAAA,EAAA,eAAsD,EAAE,CAAyB,CAEvF,SAAS,EAAS,CAAE,YAAW,GAAG,GAAsC,CACtE,IAAM,GAAA,EAAA,EAAA,QAAY,CAElB,OACE,EAAA,EAAA,KAAC,EAAgB,SAAA,CAAS,MAAO,CAAE,KAAI,WACrC,EAAA,EAAA,KAACC,EAAAA,MAAAA,CAAM,YAAY,aAAa,GAAI,GAAS,EACpB,CAI/B,SAAS,EAAU,CAAE,GAAG,GAA2D,CACjF,GAAM,CAAE,cAAe,GAAc,CACrC,OAAO,EAAA,EAAA,KAACC,EAAAA,WAAAA,CAAW,QAAS,EAAY,GAAI,GAAS,CAGvD,SAAS,EAAY,CAAE,GAAG,GAA0D,CAClF,GAAM,CAAE,QAAO,aAAY,oBAAmB,iBAAkB,GAAc,CAE9E,OACE,EAAA,EAAA,KAACC,EAAAA,KAAc,KAAA,CACb,YAAU,eACV,GAAI,EACJ,mBAAmB,EAAiC,GAAG,EAAkB,GAAG,IAAjD,GAAG,IAC9B,eAAc,CAAC,CAAC,EAChB,GAAI,GACJ,CAIN,SAAS,EAAgB,CAAE,YAAW,GAAG,GAAoC,CAC3E,GAAM,CAAE,qBAAsB,GAAc,CAE5C,OACE,EAAA,EAAA,KAACC,EAAAA,iBAAAA,CACC,GAAI,EACJ,WAAA,EAAA,EAAA,IACE,6DACA,+DACA,+DACA,oEACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,EAAY,CAAE,YAAW,WAAU,GAAG,GAAoC,CACjF,GAAM,CAAE,QAAO,iBAAkB,GAAc,CAE/C,OACE,EAAA,EAAA,KAAC,OAAA,CAAK,YAAU,eAAe,GAAI,EAAe,WAAA,EAAA,EAAA,IAAc,sBAAuB,EAAU,CAAE,GAAI,WACpG,EAAQ,OAAO,GAAO,SAAW,GAAG,CAAG,GACnC"}
1
+ {"version":3,"file":"form-DV9tQbiO.cjs","names":["FormProvider","Controller","Field","FieldLabel","SlotPrimitive","FieldDescription"],"sources":["../packages/components/ui/form.tsx"],"sourcesContent":["'use client';\nimport { createContext, useContext, useId } from 'react';\nimport type { ControllerProps, FieldPath, FieldValues } from 'react-hook-form';\nimport { Controller, FormProvider, useFormContext, useFormState } from 'react-hook-form';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { type Label as LabelPrimitive, Slot as SlotPrimitive } from 'radix-ui';\nimport { Field, FieldDescription, FieldLabel } from './field';\n\nconst Form = FormProvider;\n\ntype FormFieldContextValue<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {\n name: TName;\n};\n\nconst FormFieldContext = createContext<FormFieldContextValue>({} as FormFieldContextValue);\n\nconst FormField = <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n};\n\nconst useFormField = () => {\n const fieldContext = useContext(FormFieldContext);\n const itemContext = useContext(FormItemContext);\n const { getFieldState, control, resetField } = useFormContext();\n const formState = useFormState({ name: fieldContext.name });\n const fieldState = getFieldState(fieldContext.name, formState);\n\n if (!fieldContext) {\n throw new Error('useFormField should be used within <FormField>');\n }\n\n const { id } = itemContext;\n\n return {\n id,\n control,\n resetField,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n\ntype FormItemContextValue = {\n id: string;\n};\n\nconst FormItemContext = createContext<FormItemContextValue>({} as FormItemContextValue);\n\nfunction FormItem({ className, ...props }: React.ComponentProps<'div'>) {\n const id = useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <Field orientation=\"responsive\" {...props} />\n </FormItemContext.Provider>\n );\n}\n\nfunction FormLabel({ ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {\n const { formItemId } = useFormField();\n return <FieldLabel htmlFor={formItemId} {...props} />;\n}\n\nfunction FormControl({ ...props }: React.ComponentProps<typeof SlotPrimitive.Slot>) {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n return (\n <SlotPrimitive.Slot\n data-slot=\"form-control\"\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n );\n}\n\nfunction FormDescription({ className, ...props }: React.ComponentProps<'p'>) {\n const { formDescriptionId } = useFormField();\n\n return (\n <FieldDescription\n id={formDescriptionId}\n className={cn(\n 'text-text-positive-weak text-sm leading-normal font-normal',\n 'group-has-[[data-orientation=horizontal]]/field:text-balance',\n 'last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5',\n '[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction FormMessage({ className, children, ...props }: React.ComponentProps<'p'>) {\n const { error, formMessageId } = useFormField();\n\n return (\n <span data-slot=\"form-message\" id={formMessageId} className={cn('text-danger text-xs', className)} {...props}>\n {error ? String(error?.message ?? '') : children}\n </span>\n );\n}\n\n// eslint-disable-next-line react-refresh/only-export-components\nexport { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField };\n"],"mappings":"0TAUA,MAAM,EAAOA,EAAAA,aAMP,GAAA,EAAA,EAAA,eAAwD,EAAE,CAA0B,CAEpF,GAA8H,CAClI,GAAG,MAGD,EAAA,EAAA,KAAC,EAAiB,SAAA,CAAS,MAAO,CAAE,KAAM,EAAM,KAAM,WACpD,EAAA,EAAA,KAACC,EAAAA,WAAAA,CAAW,GAAI,EAAA,CAAS,EACC,CAI1B,MAAqB,CACzB,IAAM,GAAA,EAAA,EAAA,YAA0B,EAAiB,CAC3C,GAAA,EAAA,EAAA,YAAyB,EAAgB,CACzC,CAAE,gBAAe,UAAS,eAAA,EAAA,EAAA,iBAA+B,CACzD,GAAA,EAAA,EAAA,cAAyB,CAAE,KAAM,EAAa,KAAM,CAAC,CACrD,EAAa,EAAc,EAAa,KAAM,EAAU,CAE9D,GAAI,CAAC,EACH,MAAU,MAAM,iDAAiD,CAGnE,GAAM,CAAE,MAAO,EAEf,MAAO,CACL,KACA,UACA,aACA,KAAM,EAAa,KACnB,WAAY,GAAG,EAAG,YAClB,kBAAmB,GAAG,EAAG,wBACzB,cAAe,GAAG,EAAG,oBACrB,GAAG,EACJ,EAOG,GAAA,EAAA,EAAA,eAAsD,EAAE,CAAyB,CAEvF,SAAS,EAAS,CAAE,YAAW,GAAG,GAAsC,CACtE,IAAM,GAAA,EAAA,EAAA,QAAY,CAElB,OACE,EAAA,EAAA,KAAC,EAAgB,SAAA,CAAS,MAAO,CAAE,KAAI,WACrC,EAAA,EAAA,KAACC,EAAAA,MAAAA,CAAM,YAAY,aAAa,GAAI,GAAS,EACpB,CAI/B,SAAS,EAAU,CAAE,GAAG,GAA2D,CACjF,GAAM,CAAE,cAAe,GAAc,CACrC,OAAO,EAAA,EAAA,KAACC,EAAAA,WAAAA,CAAW,QAAS,EAAY,GAAI,GAAS,CAGvD,SAAS,EAAY,CAAE,GAAG,GAA0D,CAClF,GAAM,CAAE,QAAO,aAAY,oBAAmB,iBAAkB,GAAc,CAE9E,OACE,EAAA,EAAA,KAACC,EAAAA,KAAc,KAAA,CACb,YAAU,eACV,GAAI,EACJ,mBAAmB,EAAiC,GAAG,EAAkB,GAAG,IAAjD,GAAG,IAC9B,eAAc,CAAC,CAAC,EAChB,GAAI,GACJ,CAIN,SAAS,EAAgB,CAAE,YAAW,GAAG,GAAoC,CAC3E,GAAM,CAAE,qBAAsB,GAAc,CAE5C,OACE,EAAA,EAAA,KAACC,EAAAA,iBAAAA,CACC,GAAI,EACJ,WAAA,EAAA,EAAA,IACE,6DACA,+DACA,+DACA,oEACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,EAAY,CAAE,YAAW,WAAU,GAAG,GAAoC,CACjF,GAAM,CAAE,QAAO,iBAAkB,GAAc,CAE/C,OACE,EAAA,EAAA,KAAC,OAAA,CAAK,YAAU,eAAe,GAAI,EAAe,WAAA,EAAA,EAAA,IAAc,sBAAuB,EAAU,CAAE,GAAI,WACpG,EAAQ,OAAO,GAAO,SAAW,GAAG,CAAG,GACnC"}
@@ -1,2 +1,2 @@
1
- import{FieldDescription as e,FieldGroup as t,FieldLegend as n,FieldSeparator as r,FieldSet as i}from"./field-DSScKMdZ.js";import{Form as a}from"./form-DbknMHac.js";import{ErrorDialog as o}from"./error-dialog-_FqKuIY6.js";import{AlertCircleIcon as s}from"lucide-react";import{Activity as c,useCallback as l,useEffect as u,useState as d}from"react";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";import{useForm as h}from"react-hook-form";import{ErrorMessage as g}from"@hookform/error-message";const _=({form:_,isResetAfterSubmit:v=!0,title:y,description:b,className:x,onSubmit:S,onError:C,onSubcribe:w,children:T})=>{let E=h({..._,criteriaMode:`all`}),{formState:D,reset:O,handleSubmit:k,subscribe:A}=E,{dirtyFields:j}=D,[M,N]=d(!1),P=l(e=>{S(e,D,j),v&&O()},[j,D,v,S,O]),F=l(e=>{Object.keys(e).length!==0&&(C?.(e),N(!0))},[C]);return u(()=>{if(!w)return;let e=A({formState:{values:!0},callback:({values:e})=>{w(e)}});return()=>e()},[w,A]),m(a,{...E,children:[p(`form`,{className:x,onSubmit:k(P,F),children:m(i,{children:[m(c,{mode:y||b?`visible`:`hidden`,children:[p(n,{children:y}),p(e,{children:b}),p(r,{})]}),p(t,{children:T})]})}),p(o,{open:M,title:`Lỗi nhập dữ liệu`,description:`An unexpected error has occurred. Please check the errors below and try again.`,onOpenChange:N,children:M&&m(f,{children:[p(c,{mode:Object.keys(D.errors).length>0?`visible`:`hidden`,children:m(`div`,{className:`flex max-w-100 flex-col gap-2 px-4`,children:[p(`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:`}),p(`div`,{className:`flex flex-col space-y-1`,children:Object.entries(D.errors).map(([e])=>p(g,{errors:D.errors,name:e,render:({messages:e})=>e?p(f,{children:Object.entries(e).map(([e,t])=>m(`div`,{className:`text-accent-foreground flex items-start gap-x-1 truncate text-sm font-normal`,children:[p(s,{size:16,className:`text-destructive mt-0.5 min-w-4 flex-0`}),p(`p`,{className:`line-clamp-2 flex-1 text-wrap`,children:t})]},e))}):null},e))})]})}),p(c,{mode:Object.keys(D.errors).length===0?`visible`:`hidden`,children:p(`p`,{className:`text-muted-foreground text-sm`,children:`No errors found.`})})]})})]})};export{_ as FormWrapper};
2
- //# sourceMappingURL=form-wrapper-BbZebVv0.js.map
1
+ import{ErrorDialog as e}from"./error-dialog-DMGVy3dG.js";import{FieldDescription as t,FieldGroup as n,FieldLegend as r,FieldSeparator as i,FieldSet as a}from"./field-CGacT8J3.js";import{Form as o}from"./form-B_tL9lO4.js";import{AlertCircleIcon as s}from"lucide-react";import{Activity as c,useCallback as l,useEffect as u,useState as d}from"react";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";import{useForm as h}from"react-hook-form";import{ErrorMessage as g}from"@hookform/error-message";const _=({form:_,isResetAfterSubmit:v=!0,title:y,description:b,className:x,onSubmit:S,onError:C,onSubcribe:w,children:T})=>{let E=h({..._,criteriaMode:`all`}),{formState:D,reset:O,handleSubmit:k,subscribe:A}=E,{dirtyFields:j}=D,[M,N]=d(!1),P=l(e=>{S(e,D,j),v&&O()},[j,D,v,S,O]),F=l(e=>{Object.keys(e).length!==0&&(C?.(e),N(!0))},[C]);return u(()=>{if(!w)return;let e=A({formState:{values:!0},callback:({values:e})=>{w(e)}});return()=>e()},[w,A]),m(o,{...E,children:[p(`form`,{className:x,onSubmit:k(P,F),children:m(a,{children:[m(c,{mode:y||b?`visible`:`hidden`,children:[p(r,{children:y}),p(t,{children:b}),p(i,{})]}),p(n,{children:T})]})}),p(e,{open:M,title:`Lỗi nhập dữ liệu`,description:`An unexpected error has occurred. Please check the errors below and try again.`,onOpenChange:N,children:M&&m(f,{children:[p(c,{mode:Object.keys(D.errors).length>0?`visible`:`hidden`,children:m(`div`,{className:`flex max-w-100 flex-col gap-2 px-4`,children:[p(`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:`}),p(`div`,{className:`flex flex-col space-y-1`,children:Object.entries(D.errors).map(([e])=>p(g,{errors:D.errors,name:e,render:({messages:e})=>e?p(f,{children:Object.entries(e).map(([e,t])=>m(`div`,{className:`text-accent-foreground flex items-start gap-x-1 truncate text-sm font-normal`,children:[p(s,{size:16,className:`text-destructive mt-0.5 min-w-4 flex-0`}),p(`p`,{className:`line-clamp-2 flex-1 text-wrap`,children:t})]},e))}):null},e))})]})}),p(c,{mode:Object.keys(D.errors).length===0?`visible`:`hidden`,children:p(`p`,{className:`text-muted-foreground text-sm`,children:`No errors found.`})})]})})]})};export{_ as FormWrapper};
2
+ //# sourceMappingURL=form-wrapper-BYwaFsJd.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-wrapper-BbZebVv0.js","names":[],"sources":["../packages/components/forms/form-wrapper.tsx"],"sourcesContent":["import { Activity, useCallback, useEffect, useState } from 'react';\nimport { type FieldValues, type FormState, type SubmitErrorHandler, type SubmitHandler, type UseFormProps, useForm } from 'react-hook-form';\n\nimport { AlertCircleIcon } from 'lucide-react';\n\nimport { ErrorMessage } from '@hookform/error-message';\nimport type { AnyEntity } from '@/types';\nimport { ErrorDialog } from '../dialogs/error-dialog';\nimport { FieldDescription, FieldGroup, FieldLegend, FieldSeparator, FieldSet } from '../ui/field';\nimport { Form } from '../ui/form';\n\ntype Props<TFieldValues extends FieldValues = FieldValues> = {\n form: UseFormProps<TFieldValues>;\n isResetAfterSubmit?: boolean;\n title?: string;\n description?: string;\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 title,\n description,\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 <FieldSet>\n <Activity mode={title || description ? 'visible' : 'hidden'}>\n <FieldLegend>{title}</FieldLegend>\n <FieldDescription>{description}</FieldDescription>\n <FieldSeparator />\n </Activity>\n <FieldGroup>{children}</FieldGroup>\n </FieldSet>\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 <Activity mode={Object.keys(formState.errors).length > 0 ? 'visible' : 'hidden'}>\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 if (!messages) return null;\n return (\n <>\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 </>\n );\n }}\n />\n ))}\n </div>\n </div>\n </Activity>\n <Activity mode={Object.keys(formState.errors).length === 0 ? 'visible' : 'hidden'}>\n <p className=\"text-muted-foreground text-sm\">No errors found.</p>\n </Activity>\n </>\n )}\n </ErrorDialog>\n </Form>\n );\n};\n"],"mappings":"4fAsBA,MAAa,GAA+D,CAC1E,KAAM,EACN,qBAAqB,GACrB,QACA,cACA,YACA,WACA,UACA,aACA,cACkD,CAClD,IAAM,EAAO,EAAQ,CACnB,GAAG,EACH,aAAc,MACf,CAAC,CAEI,CAAE,YAAW,QAAO,eAAc,aAAc,EAChD,CAAE,eAAgB,EAElB,CAAC,EAAW,GAAgB,EAAkB,GAAM,CAEpD,EAAmB,EACvB,GAAQ,CACN,EAAS,EAAM,EAAW,EAAY,CAClC,GACF,GAAO,EAGX,CAAC,EAAa,EAAW,EAAoB,EAAU,EAAM,CAC9D,CAEK,EAAkB,EACtB,GAAU,CACU,OAAO,KAAK,EAAO,CACvB,SAAW,IACzB,IAAU,EAAO,CACjB,EAAa,GAAK,GAEpB,CAAC,EAAQ,CACV,CAaD,OAXA,MAAgB,CACd,GAAI,CAAC,EAAY,OACjB,IAAM,EAAW,EAAU,CACzB,UAAW,CAAE,OAAQ,GAAM,CAC3B,UAAW,CAAE,YAAa,CACxB,EAAW,EAAO,EAErB,CAAC,CACF,UAAa,GAAU,EACtB,CAAC,EAAY,EAAU,CAAC,CAGzB,EAAC,EAAA,CAAK,GAAI,YACR,EAAC,OAAA,CAAgB,YAAW,SAAU,EAAa,EAAkB,EAAgB,UACnF,EAAC,EAAA,CAAA,SAAA,CACC,EAAC,EAAA,CAAS,KAAM,GAAS,EAAc,UAAY,mBACjD,EAAC,EAAA,CAAA,SAAa,EAAA,CAAoB,CAClC,EAAC,EAAA,CAAA,SAAkB,EAAA,CAA+B,CAClD,EAAC,EAAA,EAAA,CAAiB,GACT,CACX,EAAC,EAAA,CAAY,WAAA,CAAsB,CAAA,CAAA,CAC1B,EACN,CACP,EAAC,EAAA,CACC,KAAM,EACN,MAAM,mBACN,YAAY,iFACZ,aAAc,WAEb,GACC,EAAA,EAAA,CAAA,SAAA,CACE,EAAC,EAAA,CAAS,KAAM,OAAO,KAAK,EAAU,OAAO,CAAC,OAAS,EAAI,UAAY,kBACrE,EAAC,MAAA,CAAI,UAAU,+CACb,EAAC,IAAA,CAAE,UAAU,uDAA8C,4CAA4C,CACvG,EAAC,MAAA,CAAI,UAAU,mCACZ,OAAO,QAAQ,EAAU,OAAO,CAAC,KAAK,CAAC,KACtC,EAAC,EAAA,CAEC,OAAQ,EAAU,OAClB,KAAM,EACN,QAAS,CAAE,cACJ,EAEH,EAAA,EAAA,CAAA,SACG,OAAO,QAAQ,EAAS,CAAC,KAAK,CAAC,EAAM,KAElC,EAAC,MAAA,CAAe,UAAU,yFACxB,EAAC,EAAA,CAAgB,KAAM,GAAI,UAAU,0CAA2C,CAChF,EAAC,IAAA,CAAE,UAAU,yCAAiC,GAAY,CAAA,EAFlD,EAGJ,CAER,CAAA,CACD,CAXiB,MAJnB,EAkBL,CACF,EACE,CAAA,EACF,EACG,CACX,EAAC,EAAA,CAAS,KAAM,OAAO,KAAK,EAAU,OAAO,CAAC,SAAW,EAAI,UAAY,kBACvE,EAAC,IAAA,CAAE,UAAU,yCAAgC,oBAAoB,EACxD,CAAA,CAAA,CACV,EAEO,CAAA,EACT"}
1
+ {"version":3,"file":"form-wrapper-BYwaFsJd.js","names":[],"sources":["../packages/components/forms/form-wrapper.tsx"],"sourcesContent":["import { Activity, useCallback, useEffect, useState } from 'react';\nimport { type FieldValues, type FormState, type SubmitErrorHandler, type SubmitHandler, type UseFormProps, useForm } from 'react-hook-form';\n\nimport { AlertCircleIcon } from 'lucide-react';\n\nimport { ErrorMessage } from '@hookform/error-message';\nimport type { AnyEntity } from '@/types';\nimport { ErrorDialog } from '../dialogs/error-dialog';\nimport { FieldDescription, FieldGroup, FieldLegend, FieldSeparator, FieldSet } from '../ui/field';\nimport { Form } from '../ui/form';\n\ntype Props<TFieldValues extends FieldValues = FieldValues> = {\n form: UseFormProps<TFieldValues>;\n isResetAfterSubmit?: boolean;\n title?: string;\n description?: string;\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 title,\n description,\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 <FieldSet>\n <Activity mode={title || description ? 'visible' : 'hidden'}>\n <FieldLegend>{title}</FieldLegend>\n <FieldDescription>{description}</FieldDescription>\n <FieldSeparator />\n </Activity>\n <FieldGroup>{children}</FieldGroup>\n </FieldSet>\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 <Activity mode={Object.keys(formState.errors).length > 0 ? 'visible' : 'hidden'}>\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 if (!messages) return null;\n return (\n <>\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 </>\n );\n }}\n />\n ))}\n </div>\n </div>\n </Activity>\n <Activity mode={Object.keys(formState.errors).length === 0 ? 'visible' : 'hidden'}>\n <p className=\"text-muted-foreground text-sm\">No errors found.</p>\n </Activity>\n </>\n )}\n </ErrorDialog>\n </Form>\n );\n};\n"],"mappings":"4fAsBA,MAAa,GAA+D,CAC1E,KAAM,EACN,qBAAqB,GACrB,QACA,cACA,YACA,WACA,UACA,aACA,cACkD,CAClD,IAAM,EAAO,EAAQ,CACnB,GAAG,EACH,aAAc,MACf,CAAC,CAEI,CAAE,YAAW,QAAO,eAAc,aAAc,EAChD,CAAE,eAAgB,EAElB,CAAC,EAAW,GAAgB,EAAkB,GAAM,CAEpD,EAAmB,EACvB,GAAQ,CACN,EAAS,EAAM,EAAW,EAAY,CAClC,GACF,GAAO,EAGX,CAAC,EAAa,EAAW,EAAoB,EAAU,EAAM,CAC9D,CAEK,EAAkB,EACtB,GAAU,CACU,OAAO,KAAK,EAAO,CACvB,SAAW,IACzB,IAAU,EAAO,CACjB,EAAa,GAAK,GAEpB,CAAC,EAAQ,CACV,CAaD,OAXA,MAAgB,CACd,GAAI,CAAC,EAAY,OACjB,IAAM,EAAW,EAAU,CACzB,UAAW,CAAE,OAAQ,GAAM,CAC3B,UAAW,CAAE,YAAa,CACxB,EAAW,EAAO,EAErB,CAAC,CACF,UAAa,GAAU,EACtB,CAAC,EAAY,EAAU,CAAC,CAGzB,EAAC,EAAA,CAAK,GAAI,YACR,EAAC,OAAA,CAAgB,YAAW,SAAU,EAAa,EAAkB,EAAgB,UACnF,EAAC,EAAA,CAAA,SAAA,CACC,EAAC,EAAA,CAAS,KAAM,GAAS,EAAc,UAAY,mBACjD,EAAC,EAAA,CAAA,SAAa,EAAA,CAAoB,CAClC,EAAC,EAAA,CAAA,SAAkB,EAAA,CAA+B,CAClD,EAAC,EAAA,EAAA,CAAiB,GACT,CACX,EAAC,EAAA,CAAY,WAAA,CAAsB,CAAA,CAAA,CAC1B,EACN,CACP,EAAC,EAAA,CACC,KAAM,EACN,MAAM,mBACN,YAAY,iFACZ,aAAc,WAEb,GACC,EAAA,EAAA,CAAA,SAAA,CACE,EAAC,EAAA,CAAS,KAAM,OAAO,KAAK,EAAU,OAAO,CAAC,OAAS,EAAI,UAAY,kBACrE,EAAC,MAAA,CAAI,UAAU,+CACb,EAAC,IAAA,CAAE,UAAU,uDAA8C,4CAA4C,CACvG,EAAC,MAAA,CAAI,UAAU,mCACZ,OAAO,QAAQ,EAAU,OAAO,CAAC,KAAK,CAAC,KACtC,EAAC,EAAA,CAEC,OAAQ,EAAU,OAClB,KAAM,EACN,QAAS,CAAE,cACJ,EAEH,EAAA,EAAA,CAAA,SACG,OAAO,QAAQ,EAAS,CAAC,KAAK,CAAC,EAAM,KAElC,EAAC,MAAA,CAAe,UAAU,yFACxB,EAAC,EAAA,CAAgB,KAAM,GAAI,UAAU,0CAA2C,CAChF,EAAC,IAAA,CAAE,UAAU,yCAAiC,GAAY,CAAA,EAFlD,EAGJ,CAER,CAAA,CACD,CAXiB,MAJnB,EAkBL,CACF,EACE,CAAA,EACF,EACG,CACX,EAAC,EAAA,CAAS,KAAM,OAAO,KAAK,EAAU,OAAO,CAAC,SAAW,EAAI,UAAY,kBACvE,EAAC,IAAA,CAAE,UAAU,yCAAgC,oBAAoB,EACxD,CAAA,CAAA,CACV,EAEO,CAAA,EACT"}
@@ -1,2 +1,2 @@
1
- const e=require(`./chunk-CUT6urMc.cjs`),t=require(`./field-B_qC62YD.cjs`),n=require(`./form-t4WaMbFV.cjs`),r=require(`./error-dialog-pTwyWIE5.cjs`);let i=require(`lucide-react`);i=e.__toESM(i);let a=require(`react`);a=e.__toESM(a);let o=require(`react/jsx-runtime`);o=e.__toESM(o);let s=require(`react-hook-form`);s=e.__toESM(s);let c=require(`@hookform/error-message`);c=e.__toESM(c);const l=({form:e,isResetAfterSubmit:l=!0,title:u,description:d,className:f,onSubmit:p,onError:m,onSubcribe:h,children:g})=>{let _=(0,s.useForm)({...e,criteriaMode:`all`}),{formState:v,reset:y,handleSubmit:b,subscribe:x}=_,{dirtyFields:S}=v,[C,w]=(0,a.useState)(!1),T=(0,a.useCallback)(e=>{p(e,v,S),l&&y()},[S,v,l,p,y]),E=(0,a.useCallback)(e=>{Object.keys(e).length!==0&&(m?.(e),w(!0))},[m]);return(0,a.useEffect)(()=>{if(!h)return;let e=x({formState:{values:!0},callback:({values:e})=>{h(e)}});return()=>e()},[h,x]),(0,o.jsxs)(n.Form,{..._,children:[(0,o.jsx)(`form`,{className:f,onSubmit:b(T,E),children:(0,o.jsxs)(t.FieldSet,{children:[(0,o.jsxs)(a.Activity,{mode:u||d?`visible`:`hidden`,children:[(0,o.jsx)(t.FieldLegend,{children:u}),(0,o.jsx)(t.FieldDescription,{children:d}),(0,o.jsx)(t.FieldSeparator,{})]}),(0,o.jsx)(t.FieldGroup,{children:g})]})}),(0,o.jsx)(r.ErrorDialog,{open:C,title:`Lỗi nhập dữ liệu`,description:`An unexpected error has occurred. Please check the errors below and try again.`,onOpenChange:w,children:C&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(a.Activity,{mode:Object.keys(v.errors).length>0?`visible`:`hidden`,children:(0,o.jsxs)(`div`,{className:`flex max-w-100 flex-col gap-2 px-4`,children:[(0,o.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,o.jsx)(`div`,{className:`flex flex-col space-y-1`,children:Object.entries(v.errors).map(([e])=>(0,o.jsx)(c.ErrorMessage,{errors:v.errors,name:e,render:({messages:e})=>e?(0,o.jsx)(o.Fragment,{children:Object.entries(e).map(([e,t])=>(0,o.jsxs)(`div`,{className:`text-accent-foreground flex items-start gap-x-1 truncate text-sm font-normal`,children:[(0,o.jsx)(i.AlertCircleIcon,{size:16,className:`text-destructive mt-0.5 min-w-4 flex-0`}),(0,o.jsx)(`p`,{className:`line-clamp-2 flex-1 text-wrap`,children:t})]},e))}):null},e))})]})}),(0,o.jsx)(a.Activity,{mode:Object.keys(v.errors).length===0?`visible`:`hidden`,children:(0,o.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`No errors found.`})})]})})]})};Object.defineProperty(exports,`FormWrapper`,{enumerable:!0,get:function(){return l}});
2
- //# sourceMappingURL=form-wrapper-DImTyC_E.cjs.map
1
+ const e=require(`./chunk-CUT6urMc.cjs`),t=require(`./error-dialog-BVTB1EEF.cjs`),n=require(`./field-A43YZ5Wj.cjs`),r=require(`./form-DV9tQbiO.cjs`);let i=require(`lucide-react`);i=e.__toESM(i);let a=require(`react`);a=e.__toESM(a);let o=require(`react/jsx-runtime`);o=e.__toESM(o);let s=require(`react-hook-form`);s=e.__toESM(s);let c=require(`@hookform/error-message`);c=e.__toESM(c);const l=({form:e,isResetAfterSubmit:l=!0,title:u,description:d,className:f,onSubmit:p,onError:m,onSubcribe:h,children:g})=>{let _=(0,s.useForm)({...e,criteriaMode:`all`}),{formState:v,reset:y,handleSubmit:b,subscribe:x}=_,{dirtyFields:S}=v,[C,w]=(0,a.useState)(!1),T=(0,a.useCallback)(e=>{p(e,v,S),l&&y()},[S,v,l,p,y]),E=(0,a.useCallback)(e=>{Object.keys(e).length!==0&&(m?.(e),w(!0))},[m]);return(0,a.useEffect)(()=>{if(!h)return;let e=x({formState:{values:!0},callback:({values:e})=>{h(e)}});return()=>e()},[h,x]),(0,o.jsxs)(r.Form,{..._,children:[(0,o.jsx)(`form`,{className:f,onSubmit:b(T,E),children:(0,o.jsxs)(n.FieldSet,{children:[(0,o.jsxs)(a.Activity,{mode:u||d?`visible`:`hidden`,children:[(0,o.jsx)(n.FieldLegend,{children:u}),(0,o.jsx)(n.FieldDescription,{children:d}),(0,o.jsx)(n.FieldSeparator,{})]}),(0,o.jsx)(n.FieldGroup,{children:g})]})}),(0,o.jsx)(t.ErrorDialog,{open:C,title:`Lỗi nhập dữ liệu`,description:`An unexpected error has occurred. Please check the errors below and try again.`,onOpenChange:w,children:C&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(a.Activity,{mode:Object.keys(v.errors).length>0?`visible`:`hidden`,children:(0,o.jsxs)(`div`,{className:`flex max-w-100 flex-col gap-2 px-4`,children:[(0,o.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,o.jsx)(`div`,{className:`flex flex-col space-y-1`,children:Object.entries(v.errors).map(([e])=>(0,o.jsx)(c.ErrorMessage,{errors:v.errors,name:e,render:({messages:e})=>e?(0,o.jsx)(o.Fragment,{children:Object.entries(e).map(([e,t])=>(0,o.jsxs)(`div`,{className:`text-accent-foreground flex items-start gap-x-1 truncate text-sm font-normal`,children:[(0,o.jsx)(i.AlertCircleIcon,{size:16,className:`text-destructive mt-0.5 min-w-4 flex-0`}),(0,o.jsx)(`p`,{className:`line-clamp-2 flex-1 text-wrap`,children:t})]},e))}):null},e))})]})}),(0,o.jsx)(a.Activity,{mode:Object.keys(v.errors).length===0?`visible`:`hidden`,children:(0,o.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`No errors found.`})})]})})]})};Object.defineProperty(exports,`FormWrapper`,{enumerable:!0,get:function(){return l}});
2
+ //# sourceMappingURL=form-wrapper-CODuD3w6.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-wrapper-DImTyC_E.cjs","names":["Form","FieldSet","Activity","FieldLegend","FieldDescription","FieldSeparator","FieldGroup","ErrorDialog","ErrorMessage","AlertCircleIcon"],"sources":["../packages/components/forms/form-wrapper.tsx"],"sourcesContent":["import { Activity, useCallback, useEffect, useState } from 'react';\nimport { type FieldValues, type FormState, type SubmitErrorHandler, type SubmitHandler, type UseFormProps, useForm } from 'react-hook-form';\n\nimport { AlertCircleIcon } from 'lucide-react';\n\nimport { ErrorMessage } from '@hookform/error-message';\nimport type { AnyEntity } from '@/types';\nimport { ErrorDialog } from '../dialogs/error-dialog';\nimport { FieldDescription, FieldGroup, FieldLegend, FieldSeparator, FieldSet } from '../ui/field';\nimport { Form } from '../ui/form';\n\ntype Props<TFieldValues extends FieldValues = FieldValues> = {\n form: UseFormProps<TFieldValues>;\n isResetAfterSubmit?: boolean;\n title?: string;\n description?: string;\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 title,\n description,\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 <FieldSet>\n <Activity mode={title || description ? 'visible' : 'hidden'}>\n <FieldLegend>{title}</FieldLegend>\n <FieldDescription>{description}</FieldDescription>\n <FieldSeparator />\n </Activity>\n <FieldGroup>{children}</FieldGroup>\n </FieldSet>\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 <Activity mode={Object.keys(formState.errors).length > 0 ? 'visible' : 'hidden'}>\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 if (!messages) return null;\n return (\n <>\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 </>\n );\n }}\n />\n ))}\n </div>\n </div>\n </Activity>\n <Activity mode={Object.keys(formState.errors).length === 0 ? 'visible' : 'hidden'}>\n <p className=\"text-muted-foreground text-sm\">No errors found.</p>\n </Activity>\n </>\n )}\n </ErrorDialog>\n </Form>\n );\n};\n"],"mappings":"iYAsBA,MAAa,GAA+D,CAC1E,KAAM,EACN,qBAAqB,GACrB,QACA,cACA,YACA,WACA,UACA,aACA,cACkD,CAClD,IAAM,GAAA,EAAA,EAAA,SAAe,CACnB,GAAG,EACH,aAAc,MACf,CAAC,CAEI,CAAE,YAAW,QAAO,eAAc,aAAc,EAChD,CAAE,eAAgB,EAElB,CAAC,EAAW,IAAA,EAAA,EAAA,UAAkC,GAAM,CAEpD,GAAA,EAAA,EAAA,aACJ,GAAQ,CACN,EAAS,EAAM,EAAW,EAAY,CAClC,GACF,GAAO,EAGX,CAAC,EAAa,EAAW,EAAoB,EAAU,EAAM,CAC9D,CAEK,GAAA,EAAA,EAAA,aACJ,GAAU,CACU,OAAO,KAAK,EAAO,CACvB,SAAW,IACzB,IAAU,EAAO,CACjB,EAAa,GAAK,GAEpB,CAAC,EAAQ,CACV,CAaD,OAXA,EAAA,EAAA,eAAgB,CACd,GAAI,CAAC,EAAY,OACjB,IAAM,EAAW,EAAU,CACzB,UAAW,CAAE,OAAQ,GAAM,CAC3B,UAAW,CAAE,YAAa,CACxB,EAAW,EAAO,EAErB,CAAC,CACF,UAAa,GAAU,EACtB,CAAC,EAAY,EAAU,CAAC,EAGzB,EAAA,EAAA,MAACA,EAAAA,KAAAA,CAAK,GAAI,aACR,EAAA,EAAA,KAAC,OAAA,CAAgB,YAAW,SAAU,EAAa,EAAkB,EAAgB,WACnF,EAAA,EAAA,MAACC,EAAAA,SAAAA,CAAAA,SAAAA,EACC,EAAA,EAAA,MAACC,EAAAA,SAAAA,CAAS,KAAM,GAAS,EAAc,UAAY,oBACjD,EAAA,EAAA,KAACC,EAAAA,YAAAA,CAAAA,SAAa,EAAA,CAAoB,EAClC,EAAA,EAAA,KAACC,EAAAA,iBAAAA,CAAAA,SAAkB,EAAA,CAA+B,EAClD,EAAA,EAAA,KAACC,EAAAA,eAAAA,EAAAA,CAAiB,GACT,EACX,EAAA,EAAA,KAACC,EAAAA,WAAAA,CAAY,WAAA,CAAsB,CAAA,CAAA,CAC1B,EACN,EACP,EAAA,EAAA,KAACC,EAAAA,YAAAA,CACC,KAAM,EACN,MAAM,mBACN,YAAY,iFACZ,aAAc,WAEb,IACC,EAAA,EAAA,MAAA,EAAA,SAAA,CAAA,SAAA,EACE,EAAA,EAAA,KAACL,EAAAA,SAAAA,CAAS,KAAM,OAAO,KAAK,EAAU,OAAO,CAAC,OAAS,EAAI,UAAY,mBACrE,EAAA,EAAA,MAAC,MAAA,CAAI,UAAU,gDACb,EAAA,EAAA,KAAC,IAAA,CAAE,UAAU,uDAA8C,4CAA4C,EACvG,EAAA,EAAA,KAAC,MAAA,CAAI,UAAU,mCACZ,OAAO,QAAQ,EAAU,OAAO,CAAC,KAAK,CAAC,MACtC,EAAA,EAAA,KAACM,EAAAA,aAAAA,CAEC,OAAQ,EAAU,OAClB,KAAM,EACN,QAAS,CAAE,cACJ,GAEH,EAAA,EAAA,KAAA,EAAA,SAAA,CAAA,SACG,OAAO,QAAQ,EAAS,CAAC,KAAK,CAAC,EAAM,MAElC,EAAA,EAAA,MAAC,MAAA,CAAe,UAAU,0FACxB,EAAA,EAAA,KAACC,EAAAA,gBAAAA,CAAgB,KAAM,GAAI,UAAU,0CAA2C,EAChF,EAAA,EAAA,KAAC,IAAA,CAAE,UAAU,yCAAiC,GAAY,CAAA,EAFlD,EAGJ,CAER,CAAA,CACD,CAXiB,MAJnB,EAkBL,CACF,EACE,CAAA,EACF,EACG,EACX,EAAA,EAAA,KAACP,EAAAA,SAAAA,CAAS,KAAM,OAAO,KAAK,EAAU,OAAO,CAAC,SAAW,EAAI,UAAY,mBACvE,EAAA,EAAA,KAAC,IAAA,CAAE,UAAU,yCAAgC,oBAAoB,EACxD,CAAA,CAAA,CACV,EAEO,CAAA,EACT"}
1
+ {"version":3,"file":"form-wrapper-CODuD3w6.cjs","names":["Form","FieldSet","Activity","FieldLegend","FieldDescription","FieldSeparator","FieldGroup","ErrorDialog","ErrorMessage","AlertCircleIcon"],"sources":["../packages/components/forms/form-wrapper.tsx"],"sourcesContent":["import { Activity, useCallback, useEffect, useState } from 'react';\nimport { type FieldValues, type FormState, type SubmitErrorHandler, type SubmitHandler, type UseFormProps, useForm } from 'react-hook-form';\n\nimport { AlertCircleIcon } from 'lucide-react';\n\nimport { ErrorMessage } from '@hookform/error-message';\nimport type { AnyEntity } from '@/types';\nimport { ErrorDialog } from '../dialogs/error-dialog';\nimport { FieldDescription, FieldGroup, FieldLegend, FieldSeparator, FieldSet } from '../ui/field';\nimport { Form } from '../ui/form';\n\ntype Props<TFieldValues extends FieldValues = FieldValues> = {\n form: UseFormProps<TFieldValues>;\n isResetAfterSubmit?: boolean;\n title?: string;\n description?: string;\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 title,\n description,\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 <FieldSet>\n <Activity mode={title || description ? 'visible' : 'hidden'}>\n <FieldLegend>{title}</FieldLegend>\n <FieldDescription>{description}</FieldDescription>\n <FieldSeparator />\n </Activity>\n <FieldGroup>{children}</FieldGroup>\n </FieldSet>\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 <Activity mode={Object.keys(formState.errors).length > 0 ? 'visible' : 'hidden'}>\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 if (!messages) return null;\n return (\n <>\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 </>\n );\n }}\n />\n ))}\n </div>\n </div>\n </Activity>\n <Activity mode={Object.keys(formState.errors).length === 0 ? 'visible' : 'hidden'}>\n <p className=\"text-muted-foreground text-sm\">No errors found.</p>\n </Activity>\n </>\n )}\n </ErrorDialog>\n </Form>\n );\n};\n"],"mappings":"iYAsBA,MAAa,GAA+D,CAC1E,KAAM,EACN,qBAAqB,GACrB,QACA,cACA,YACA,WACA,UACA,aACA,cACkD,CAClD,IAAM,GAAA,EAAA,EAAA,SAAe,CACnB,GAAG,EACH,aAAc,MACf,CAAC,CAEI,CAAE,YAAW,QAAO,eAAc,aAAc,EAChD,CAAE,eAAgB,EAElB,CAAC,EAAW,IAAA,EAAA,EAAA,UAAkC,GAAM,CAEpD,GAAA,EAAA,EAAA,aACJ,GAAQ,CACN,EAAS,EAAM,EAAW,EAAY,CAClC,GACF,GAAO,EAGX,CAAC,EAAa,EAAW,EAAoB,EAAU,EAAM,CAC9D,CAEK,GAAA,EAAA,EAAA,aACJ,GAAU,CACU,OAAO,KAAK,EAAO,CACvB,SAAW,IACzB,IAAU,EAAO,CACjB,EAAa,GAAK,GAEpB,CAAC,EAAQ,CACV,CAaD,OAXA,EAAA,EAAA,eAAgB,CACd,GAAI,CAAC,EAAY,OACjB,IAAM,EAAW,EAAU,CACzB,UAAW,CAAE,OAAQ,GAAM,CAC3B,UAAW,CAAE,YAAa,CACxB,EAAW,EAAO,EAErB,CAAC,CACF,UAAa,GAAU,EACtB,CAAC,EAAY,EAAU,CAAC,EAGzB,EAAA,EAAA,MAACA,EAAAA,KAAAA,CAAK,GAAI,aACR,EAAA,EAAA,KAAC,OAAA,CAAgB,YAAW,SAAU,EAAa,EAAkB,EAAgB,WACnF,EAAA,EAAA,MAACC,EAAAA,SAAAA,CAAAA,SAAAA,EACC,EAAA,EAAA,MAACC,EAAAA,SAAAA,CAAS,KAAM,GAAS,EAAc,UAAY,oBACjD,EAAA,EAAA,KAACC,EAAAA,YAAAA,CAAAA,SAAa,EAAA,CAAoB,EAClC,EAAA,EAAA,KAACC,EAAAA,iBAAAA,CAAAA,SAAkB,EAAA,CAA+B,EAClD,EAAA,EAAA,KAACC,EAAAA,eAAAA,EAAAA,CAAiB,GACT,EACX,EAAA,EAAA,KAACC,EAAAA,WAAAA,CAAY,WAAA,CAAsB,CAAA,CAAA,CAC1B,EACN,EACP,EAAA,EAAA,KAACC,EAAAA,YAAAA,CACC,KAAM,EACN,MAAM,mBACN,YAAY,iFACZ,aAAc,WAEb,IACC,EAAA,EAAA,MAAA,EAAA,SAAA,CAAA,SAAA,EACE,EAAA,EAAA,KAACL,EAAAA,SAAAA,CAAS,KAAM,OAAO,KAAK,EAAU,OAAO,CAAC,OAAS,EAAI,UAAY,mBACrE,EAAA,EAAA,MAAC,MAAA,CAAI,UAAU,gDACb,EAAA,EAAA,KAAC,IAAA,CAAE,UAAU,uDAA8C,4CAA4C,EACvG,EAAA,EAAA,KAAC,MAAA,CAAI,UAAU,mCACZ,OAAO,QAAQ,EAAU,OAAO,CAAC,KAAK,CAAC,MACtC,EAAA,EAAA,KAACM,EAAAA,aAAAA,CAEC,OAAQ,EAAU,OAClB,KAAM,EACN,QAAS,CAAE,cACJ,GAEH,EAAA,EAAA,KAAA,EAAA,SAAA,CAAA,SACG,OAAO,QAAQ,EAAS,CAAC,KAAK,CAAC,EAAM,MAElC,EAAA,EAAA,MAAC,MAAA,CAAe,UAAU,0FACxB,EAAA,EAAA,KAACC,EAAAA,gBAAAA,CAAgB,KAAM,GAAI,UAAU,0CAA2C,EAChF,EAAA,EAAA,KAAC,IAAA,CAAE,UAAU,yCAAiC,GAAY,CAAA,EAFlD,EAGJ,CAER,CAAA,CACD,CAXiB,MAJnB,EAkBL,CACF,EACE,CAAA,EACF,EACG,EACX,EAAA,EAAA,KAACP,EAAAA,SAAAA,CAAS,KAAM,OAAO,KAAK,EAAU,OAAO,CAAC,SAAW,EAAI,UAAY,mBACvE,EAAA,EAAA,KAAC,IAAA,CAAE,UAAU,yCAAgC,oBAAoB,EACxD,CAAA,CAAA,CACV,EAEO,CAAA,EACT"}