@customafk/lunas-ui 0.2.34 → 0.2.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (376) hide show
  1. package/dist/{alert-DmaYqfy7.d.mts → alert-ArM88PNb.d.cts} +7 -7
  2. package/dist/{alert-BbInRLt4.mjs → alert-BbvPwf2x.mjs} +1 -1
  3. package/dist/{alert-BbInRLt4.mjs.map → alert-BbvPwf2x.mjs.map} +1 -1
  4. package/dist/{alert-4rfsFtN6.cjs → alert-DubR6Szk.cjs} +1 -1
  5. package/dist/{alert-4rfsFtN6.cjs.map → alert-DubR6Szk.cjs.map} +1 -1
  6. package/dist/{alert-BFLT5Jqg.d.cts → alert-oiaUJxqr.d.mts} +7 -7
  7. package/dist/{avatar-aVxo69zP.cjs → avatar-CqRl9dge.cjs} +1 -1
  8. package/dist/{avatar-aVxo69zP.cjs.map → avatar-CqRl9dge.cjs.map} +1 -1
  9. package/dist/{avatar-1SuFoI5h.mjs → avatar-m1LjDIil.mjs} +1 -1
  10. package/dist/{avatar-1SuFoI5h.mjs.map → avatar-m1LjDIil.mjs.map} +1 -1
  11. package/dist/{badge-Dxewfuj8.d.mts → badge-C9JgOJ5_.d.mts} +6 -6
  12. package/dist/{badge-CSMgaMwT.d.cts → badge-D5Wq3XJq.d.cts} +6 -6
  13. package/dist/{button-DeBpvNFE.d.mts → button-CdROwJlN.d.cts} +7 -7
  14. package/dist/{button-soF3CKai.d.cts → button-CoySHVye.d.mts} +7 -7
  15. package/dist/{calendar-CqeVe3HO.mjs → calendar-BDhIfwPP.mjs} +1 -1
  16. package/dist/{calendar-CqeVe3HO.mjs.map → calendar-BDhIfwPP.mjs.map} +1 -1
  17. package/dist/{calendar-Bt0rlJ89.cjs → calendar-CMd11yg9.cjs} +1 -1
  18. package/dist/{calendar-Bt0rlJ89.cjs.map → calendar-CMd11yg9.cjs.map} +1 -1
  19. package/dist/cards/simple-card.d.mts +2 -2
  20. package/dist/{checkbox-BQ_TclX9.cjs → checkbox-BwDvS4De.cjs} +1 -1
  21. package/dist/{checkbox-BQ_TclX9.cjs.map → checkbox-BwDvS4De.cjs.map} +1 -1
  22. package/dist/{checkbox-CrZ80dV_.mjs → checkbox-CgHaRkuU.mjs} +1 -1
  23. package/dist/{checkbox-CrZ80dV_.mjs.map → checkbox-CgHaRkuU.mjs.map} +1 -1
  24. package/dist/{close-DTBepcqW.mjs → close-B7OOMSZl.mjs} +1 -1
  25. package/dist/{close-DTBepcqW.mjs.map → close-B7OOMSZl.mjs.map} +1 -1
  26. package/dist/{close-DUBEKxhw.cjs → close-DrCUWZt0.cjs} +1 -1
  27. package/dist/{close-DUBEKxhw.cjs.map → close-DrCUWZt0.cjs.map} +1 -1
  28. package/dist/{cms-layout-DDs0pHWh.cjs → cms-layout-BrubV8D8.cjs} +2 -2
  29. package/dist/{cms-layout-DDs0pHWh.cjs.map → cms-layout-BrubV8D8.cjs.map} +1 -1
  30. package/dist/{cms-layout-BvaYr6rb.mjs → cms-layout-C2-yysO2.mjs} +2 -2
  31. package/dist/{cms-layout-BvaYr6rb.mjs.map → cms-layout-C2-yysO2.mjs.map} +1 -1
  32. package/dist/{command-B7DO73K0.cjs → command-DiXzSGc8.cjs} +2 -2
  33. package/dist/{command-B7DO73K0.cjs.map → command-DiXzSGc8.cjs.map} +1 -1
  34. package/dist/{command-YngzaaGP.mjs → command-FnbrPZ7_.mjs} +2 -2
  35. package/dist/{command-YngzaaGP.mjs.map → command-FnbrPZ7_.mjs.map} +1 -1
  36. package/dist/data-display/country.d.mts +1 -1
  37. package/dist/data-display/role-badge.d.mts +1 -1
  38. package/dist/data-display/statistic.cjs +1 -2
  39. package/dist/data-display/statistic.d.cts +1 -1
  40. package/dist/data-display/statistic.d.mts +6 -6
  41. package/dist/data-display/statistic.mjs +1 -2
  42. package/dist/data-display/user.cjs +1 -1
  43. package/dist/data-display/user.mjs +1 -1
  44. package/dist/{dialog-BQTnKhUH.d.cts → dialog-BYzcewOe.d.cts} +12 -12
  45. package/dist/{dialog-DhO0dkO3.cjs → dialog-D1sWnn6n.cjs} +2 -2
  46. package/dist/{dialog-DhO0dkO3.cjs.map → dialog-D1sWnn6n.cjs.map} +1 -1
  47. package/dist/{dialog-DDiSHKlc.d.mts → dialog-DYhbRnya.d.mts} +12 -12
  48. package/dist/{dialog-Bly2YImt.mjs → dialog-EGFZeITu.mjs} +2 -2
  49. package/dist/{dialog-Bly2YImt.mjs.map → dialog-EGFZeITu.mjs.map} +1 -1
  50. package/dist/dialogs/detail-dialog/components/sidebar.cjs +1 -1
  51. package/dist/dialogs/detail-dialog/components/sidebar.d.cts +26 -26
  52. package/dist/dialogs/detail-dialog/components/sidebar.d.mts +28 -28
  53. package/dist/dialogs/detail-dialog/components/sidebar.mjs +1 -1
  54. package/dist/dialogs/detail-dialog/index.cjs +1 -1
  55. package/dist/dialogs/detail-dialog/index.mjs +1 -1
  56. package/dist/dialogs/loading-dialog.cjs +1 -1
  57. package/dist/dialogs/loading-dialog.mjs +1 -1
  58. package/dist/{drawer-C3o6IEeq.cjs → drawer-B6C8-Ndu.cjs} +1 -1
  59. package/dist/{drawer-C3o6IEeq.cjs.map → drawer-B6C8-Ndu.cjs.map} +1 -1
  60. package/dist/{drawer-B3GpKBZs.mjs → drawer-CMD7JWH8.mjs} +1 -1
  61. package/dist/{drawer-B3GpKBZs.mjs.map → drawer-CMD7JWH8.mjs.map} +1 -1
  62. package/dist/{dropdown-menu-DMwvWoxe.cjs → dropdown-menu-Bz7oMQ36.cjs} +1 -1
  63. package/dist/{dropdown-menu-DMwvWoxe.cjs.map → dropdown-menu-Bz7oMQ36.cjs.map} +1 -1
  64. package/dist/{dropdown-menu-BjckWIZH.mjs → dropdown-menu-C6tRSumY.mjs} +1 -1
  65. package/dist/{dropdown-menu-BjckWIZH.mjs.map → dropdown-menu-C6tRSumY.mjs.map} +1 -1
  66. package/dist/features/descriptions/index.cjs +1 -1
  67. package/dist/features/descriptions/index.d.cts +7 -7
  68. package/dist/features/descriptions/index.d.mts +7 -7
  69. package/dist/features/descriptions/index.mjs +1 -1
  70. package/dist/features/search-modal/index.cjs +1 -1
  71. package/dist/features/search-modal/index.d.cts +2 -2
  72. package/dist/features/search-modal/index.d.mts +2 -2
  73. package/dist/features/search-modal/index.mjs +1 -1
  74. package/dist/features/tables/index.cjs +1 -1
  75. package/dist/features/tables/index.d.cts +2 -2
  76. package/dist/features/tables/index.d.mts +3 -3
  77. package/dist/features/tables/index.mjs +1 -1
  78. package/dist/features/tanstack-form/index.cjs +1 -1
  79. package/dist/features/tanstack-form/index.d.cts +1 -1
  80. package/dist/features/tanstack-form/index.d.mts +1 -1
  81. package/dist/features/tanstack-form/index.mjs +1 -1
  82. package/dist/features/text-editor/index.cjs +1 -1
  83. package/dist/features/text-editor/index.d.cts +2 -2
  84. package/dist/features/text-editor/index.d.mts +2 -2
  85. package/dist/features/text-editor/index.mjs +1 -1
  86. package/dist/{field-0SZIwI1Q.mjs → field-DhgAIueI.mjs} +2 -2
  87. package/dist/{field-0SZIwI1Q.mjs.map → field-DhgAIueI.mjs.map} +1 -1
  88. package/dist/{field-ThrHQOAI.cjs → field-pfL7RWcN.cjs} +2 -2
  89. package/dist/{field-ThrHQOAI.cjs.map → field-pfL7RWcN.cjs.map} +1 -1
  90. package/dist/{index-BUi04v_-.d.mts → index-ByhKmerO.d.mts} +44 -7
  91. package/dist/{index-DWJlXfCi.d.mts → index-CEUx5VIo.d.mts} +91 -42
  92. package/dist/{index-BFFBdGdv.d.mts → index-CL3z9hOc.d.cts} +320 -320
  93. package/dist/{index-Cvjgsouk.d.cts → index-CuvfEKgg.d.mts} +320 -320
  94. package/dist/index-DMSKIqbL.d.cts +85 -0
  95. package/dist/{index-Btd0a1HO.d.cts → index-DuRmheOp.d.cts} +90 -41
  96. package/dist/index.cjs +1 -1
  97. package/dist/index.d.cts +9 -9
  98. package/dist/index.d.mts +9 -9
  99. package/dist/index.mjs +1 -1
  100. package/dist/{input-ESg91VId.mjs → input-5gk-Jv1y.mjs} +1 -1
  101. package/dist/{input-ESg91VId.mjs.map → input-5gk-Jv1y.mjs.map} +1 -1
  102. package/dist/{input-1ceJxxFI.cjs → input-BvzsfAUc.cjs} +1 -1
  103. package/dist/{input-1ceJxxFI.cjs.map → input-BvzsfAUc.cjs.map} +1 -1
  104. package/dist/{input-wQP8YLOp.d.mts → input-DHt0MAKf.d.cts} +7 -7
  105. package/dist/{input-DHBWjFPA.d.cts → input-DLqmDeEo.d.mts} +7 -7
  106. package/dist/{label-Cig7a9ON.mjs → label-D9uNQ9b_.mjs} +1 -1
  107. package/dist/{label-Cig7a9ON.mjs.map → label-D9uNQ9b_.mjs.map} +1 -1
  108. package/dist/{label-BzfsTrVt.cjs → label-eIyGIRyw.cjs} +1 -1
  109. package/dist/{label-BzfsTrVt.cjs.map → label-eIyGIRyw.cjs.map} +1 -1
  110. package/dist/layouts/cms-layout/index.cjs +1 -1
  111. package/dist/layouts/cms-layout/index.mjs +1 -1
  112. package/dist/layouts/flex.d.cts +8 -8
  113. package/dist/layouts/flex.d.mts +10 -10
  114. package/dist/layouts/payment-layout/index.cjs +1 -1
  115. package/dist/layouts/payment-layout/index.mjs +1 -1
  116. package/dist/pages/FeatureDeveloping.d.mts +2 -2
  117. package/dist/pages/FeatureFixing.d.cts +2 -2
  118. package/dist/pages/FeatureFixing.d.mts +2 -2
  119. package/dist/pages/LoginPage.cjs +1 -1
  120. package/dist/pages/LoginPage.d.cts +2 -2
  121. package/dist/pages/LoginPage.d.mts +2 -2
  122. package/dist/pages/LoginPage.mjs +1 -1
  123. package/dist/pages/NotAuthorized.d.cts +2 -2
  124. package/dist/pages/NotAuthorized.d.mts +2 -2
  125. package/dist/pages/NotFound.d.mts +2 -2
  126. package/dist/pages/RegisterPage.cjs +1 -1
  127. package/dist/pages/RegisterPage.d.cts +2 -2
  128. package/dist/pages/RegisterPage.d.mts +2 -2
  129. package/dist/pages/RegisterPage.mjs +1 -1
  130. package/dist/pages/VerifyEmailPage.cjs +1 -1
  131. package/dist/pages/VerifyEmailPage.d.cts +2 -2
  132. package/dist/pages/VerifyEmailPage.d.mts +2 -2
  133. package/dist/pages/VerifyEmailPage.mjs +1 -1
  134. package/dist/{payment-layout-Bd4B4jhp.mjs → payment-layout-_ZM4uBy_.mjs} +2 -2
  135. package/dist/{payment-layout-Bd4B4jhp.mjs.map → payment-layout-_ZM4uBy_.mjs.map} +1 -1
  136. package/dist/{payment-layout-kh0lLq71.cjs → payment-layout-fsYTkw3r.cjs} +2 -2
  137. package/dist/{payment-layout-kh0lLq71.cjs.map → payment-layout-fsYTkw3r.cjs.map} +1 -1
  138. package/dist/{popover-BXktOcLz.mjs → popover-DwgdOX8a.mjs} +2 -2
  139. package/dist/{popover-BXktOcLz.mjs.map → popover-DwgdOX8a.mjs.map} +1 -1
  140. package/dist/{popover-DACS7x0e.cjs → popover-fsTCOb6a.cjs} +2 -2
  141. package/dist/{popover-DACS7x0e.cjs.map → popover-fsTCOb6a.cjs.map} +1 -1
  142. package/dist/{progress-BXWPPNt5.cjs → progress-CDYA2V-W.cjs} +1 -1
  143. package/dist/{progress-BXWPPNt5.cjs.map → progress-CDYA2V-W.cjs.map} +1 -1
  144. package/dist/{progress-bJYAFoHE.mjs → progress-DCBKnTx0.mjs} +1 -1
  145. package/dist/{progress-bJYAFoHE.mjs.map → progress-DCBKnTx0.mjs.map} +1 -1
  146. package/dist/{radio-group-Bv6w2woK.cjs → radio-group-B-M599Ys.cjs} +1 -1
  147. package/dist/{radio-group-Bv6w2woK.cjs.map → radio-group-B-M599Ys.cjs.map} +1 -1
  148. package/dist/{radio-group-CTILro-C.mjs → radio-group-Y9bhdr55.mjs} +1 -1
  149. package/dist/{radio-group-CTILro-C.mjs.map → radio-group-Y9bhdr55.mjs.map} +1 -1
  150. package/dist/{resizable-C7uLlTGB.cjs → resizable-DATSh0Du.cjs} +1 -1
  151. package/dist/{resizable-C7uLlTGB.cjs.map → resizable-DATSh0Du.cjs.map} +1 -1
  152. package/dist/{resizable-BNYc7hFd.mjs → resizable-DP1BQAF_.mjs} +1 -1
  153. package/dist/{resizable-BNYc7hFd.mjs.map → resizable-DP1BQAF_.mjs.map} +1 -1
  154. package/dist/{search-modal-CsYUvnWi.cjs → search-modal-CYRJEDE-.cjs} +2 -2
  155. package/dist/{search-modal-CsYUvnWi.cjs.map → search-modal-CYRJEDE-.cjs.map} +1 -1
  156. package/dist/{search-modal-D4ESSOU-.mjs → search-modal-DWu08xkE.mjs} +2 -2
  157. package/dist/{search-modal-D4ESSOU-.mjs.map → search-modal-DWu08xkE.mjs.map} +1 -1
  158. package/dist/{select-DMGFb8TB.mjs → select-BAlA65tZ.mjs} +1 -1
  159. package/dist/{select-DMGFb8TB.mjs.map → select-BAlA65tZ.mjs.map} +1 -1
  160. package/dist/{select-D0m78xbd.cjs → select-Cib2aiw5.cjs} +1 -1
  161. package/dist/{select-D0m78xbd.cjs.map → select-Cib2aiw5.cjs.map} +1 -1
  162. package/dist/{separator-DVaVWuNc.mjs → separator-C6s-YvlT.mjs} +1 -1
  163. package/dist/{separator-DVaVWuNc.mjs.map → separator-C6s-YvlT.mjs.map} +1 -1
  164. package/dist/{separator-jytY1CPq.cjs → separator-CBup_ah1.cjs} +1 -1
  165. package/dist/{separator-jytY1CPq.cjs.map → separator-CBup_ah1.cjs.map} +1 -1
  166. package/dist/{sheet-BoulTUHV.mjs → sheet-Cj8hoftE.mjs} +1 -1
  167. package/dist/{sheet-BoulTUHV.mjs.map → sheet-Cj8hoftE.mjs.map} +1 -1
  168. package/dist/{sheet-DuMrjidC.cjs → sheet-DAjZ-Q6Q.cjs} +1 -1
  169. package/dist/{sheet-DuMrjidC.cjs.map → sheet-DAjZ-Q6Q.cjs.map} +1 -1
  170. package/dist/{sidebar-BXrGXVxx.cjs → sidebar-Drasn0Bx.cjs} +2 -2
  171. package/dist/{sidebar-BXrGXVxx.cjs.map → sidebar-Drasn0Bx.cjs.map} +1 -1
  172. package/dist/{sidebar-xWo_Rfi-.mjs → sidebar-RcmDh50_.mjs} +2 -2
  173. package/dist/{sidebar-xWo_Rfi-.mjs.map → sidebar-RcmDh50_.mjs.map} +1 -1
  174. package/dist/{spinner-C2tF8jQt.mjs → spinner-BCnPYF1H.mjs} +1 -1
  175. package/dist/{spinner-C2tF8jQt.mjs.map → spinner-BCnPYF1H.mjs.map} +1 -1
  176. package/dist/{spinner-DgusnQMw.cjs → spinner-Bdta7BMp.cjs} +1 -1
  177. package/dist/{spinner-DgusnQMw.cjs.map → spinner-Bdta7BMp.cjs.map} +1 -1
  178. package/dist/statistic-Cm4nbkjQ.mjs +2 -0
  179. package/dist/statistic-Cm4nbkjQ.mjs.map +1 -0
  180. package/dist/statistic-DDDm5Om1.cjs +2 -0
  181. package/dist/statistic-DDDm5Om1.cjs.map +1 -0
  182. package/dist/{switch-CY25L6l0.mjs → switch-BP7EPatj.mjs} +1 -1
  183. package/dist/{switch-CY25L6l0.mjs.map → switch-BP7EPatj.mjs.map} +1 -1
  184. package/dist/{switch-0-9Zt33o.cjs → switch-Dbc77c_D.cjs} +1 -1
  185. package/dist/{switch-0-9Zt33o.cjs.map → switch-Dbc77c_D.cjs.map} +1 -1
  186. package/dist/tables-B3Ald6An.cjs +4 -0
  187. package/dist/tables-B3Ald6An.cjs.map +1 -0
  188. package/dist/tables-C3asiSD4.mjs +4 -0
  189. package/dist/tables-C3asiSD4.mjs.map +1 -0
  190. package/dist/{tanstack-form-BulYI2bY.cjs → tanstack-form-CYcb_gLQ.cjs} +2 -2
  191. package/dist/{tanstack-form-BulYI2bY.cjs.map → tanstack-form-CYcb_gLQ.cjs.map} +1 -1
  192. package/dist/{tanstack-form-Bof1jeRB.mjs → tanstack-form-DQFyDxOg.mjs} +2 -2
  193. package/dist/{tanstack-form-Bof1jeRB.mjs.map → tanstack-form-DQFyDxOg.mjs.map} +1 -1
  194. package/dist/text-editor-DqyiYNen.cjs +2 -0
  195. package/dist/text-editor-DqyiYNen.cjs.map +1 -0
  196. package/dist/text-editor-HGUUElOS.mjs +2 -0
  197. package/dist/text-editor-HGUUElOS.mjs.map +1 -0
  198. package/dist/{textarea-B8eQoQaZ.mjs → textarea-7HDXcaK9.mjs} +1 -1
  199. package/dist/{textarea-B8eQoQaZ.mjs.map → textarea-7HDXcaK9.mjs.map} +1 -1
  200. package/dist/{textarea-BB2WynyM.cjs → textarea-Byo8E8oi.cjs} +1 -1
  201. package/dist/{textarea-BB2WynyM.cjs.map → textarea-Byo8E8oi.cjs.map} +1 -1
  202. package/dist/{types-DmTyKdm7.d.mts → types-YLu40dXY.d.mts} +1 -1
  203. package/dist/typography/paragraph.d.cts +5 -5
  204. package/dist/typography/paragraph.d.mts +5 -5
  205. package/dist/ui/alert-dialog.d.cts +12 -12
  206. package/dist/ui/alert-dialog.d.mts +12 -12
  207. package/dist/ui/alert.cjs +1 -1
  208. package/dist/ui/alert.d.cts +1 -1
  209. package/dist/ui/alert.d.mts +1 -1
  210. package/dist/ui/alert.mjs +1 -1
  211. package/dist/ui/aspect-ratio.d.cts +2 -2
  212. package/dist/ui/aspect-ratio.d.mts +2 -2
  213. package/dist/ui/avatar.cjs +1 -1
  214. package/dist/ui/avatar.d.cts +4 -4
  215. package/dist/ui/avatar.d.mts +4 -4
  216. package/dist/ui/avatar.mjs +1 -1
  217. package/dist/ui/badge.d.cts +1 -1
  218. package/dist/ui/badge.d.mts +1 -1
  219. package/dist/ui/breadcrumb.d.cts +8 -8
  220. package/dist/ui/breadcrumb.d.mts +8 -8
  221. package/dist/ui/button-group.cjs +1 -1
  222. package/dist/ui/button-group.d.cts +6 -6
  223. package/dist/ui/button-group.d.mts +6 -6
  224. package/dist/ui/button-group.mjs +1 -1
  225. package/dist/ui/button.d.cts +1 -1
  226. package/dist/ui/button.d.mts +1 -1
  227. package/dist/ui/calendar.cjs +1 -1
  228. package/dist/ui/calendar.d.cts +4 -4
  229. package/dist/ui/calendar.d.mts +4 -4
  230. package/dist/ui/calendar.mjs +1 -1
  231. package/dist/ui/card.d.cts +8 -8
  232. package/dist/ui/card.d.mts +8 -8
  233. package/dist/ui/carousel.d.cts +7 -7
  234. package/dist/ui/carousel.d.mts +7 -7
  235. package/dist/ui/checkbox.cjs +1 -1
  236. package/dist/ui/checkbox.d.cts +2 -2
  237. package/dist/ui/checkbox.d.mts +2 -2
  238. package/dist/ui/checkbox.mjs +1 -1
  239. package/dist/ui/collapsible.d.cts +4 -4
  240. package/dist/ui/collapsible.d.mts +4 -4
  241. package/dist/ui/command.cjs +1 -1
  242. package/dist/ui/command.d.cts +11 -11
  243. package/dist/ui/command.d.mts +11 -11
  244. package/dist/ui/command.mjs +1 -1
  245. package/dist/ui/context-menu.d.cts +16 -16
  246. package/dist/ui/context-menu.d.mts +16 -16
  247. package/dist/ui/dialog.cjs +1 -1
  248. package/dist/ui/dialog.d.cts +1 -1
  249. package/dist/ui/dialog.d.mts +1 -1
  250. package/dist/ui/dialog.mjs +1 -1
  251. package/dist/ui/drawer.cjs +1 -1
  252. package/dist/ui/drawer.d.cts +11 -11
  253. package/dist/ui/drawer.d.mts +11 -11
  254. package/dist/ui/drawer.mjs +1 -1
  255. package/dist/ui/dropdown-menu.cjs +1 -1
  256. package/dist/ui/dropdown-menu.d.cts +16 -16
  257. package/dist/ui/dropdown-menu.d.mts +16 -16
  258. package/dist/ui/dropdown-menu.mjs +1 -1
  259. package/dist/ui/empty.d.cts +9 -9
  260. package/dist/ui/empty.d.mts +7 -7
  261. package/dist/ui/field.cjs +1 -1
  262. package/dist/ui/field.d.cts +23 -23
  263. package/dist/ui/field.d.mts +23 -23
  264. package/dist/ui/field.mjs +1 -1
  265. package/dist/ui/file-uploader.cjs +1 -1
  266. package/dist/ui/file-uploader.d.cts +2 -2
  267. package/dist/ui/file-uploader.d.mts +2 -2
  268. package/dist/ui/file-uploader.mjs +1 -1
  269. package/dist/ui/form.cjs +1 -1
  270. package/dist/ui/form.d.cts +10 -10
  271. package/dist/ui/form.d.mts +10 -10
  272. package/dist/ui/form.mjs +1 -1
  273. package/dist/ui/hover-card.d.cts +4 -4
  274. package/dist/ui/hover-card.d.mts +4 -4
  275. package/dist/ui/input-otp.d.cts +5 -5
  276. package/dist/ui/input-otp.d.mts +5 -5
  277. package/dist/ui/input.cjs +1 -1
  278. package/dist/ui/input.d.cts +1 -1
  279. package/dist/ui/input.d.mts +1 -1
  280. package/dist/ui/input.mjs +1 -1
  281. package/dist/ui/inputs/search-input.cjs +1 -1
  282. package/dist/ui/inputs/search-input.d.cts +3 -3
  283. package/dist/ui/inputs/search-input.d.mts +3 -3
  284. package/dist/ui/inputs/search-input.mjs +1 -1
  285. package/dist/ui/item.cjs +1 -1
  286. package/dist/ui/item.d.cts +17 -17
  287. package/dist/ui/item.d.mts +17 -17
  288. package/dist/ui/item.mjs +1 -1
  289. package/dist/ui/label.cjs +1 -1
  290. package/dist/ui/label.d.cts +2 -2
  291. package/dist/ui/label.d.mts +2 -2
  292. package/dist/ui/label.mjs +1 -1
  293. package/dist/ui/menubar.d.cts +17 -17
  294. package/dist/ui/menubar.d.mts +17 -17
  295. package/dist/ui/multi-select.cjs +1 -1
  296. package/dist/ui/multi-select.d.cts +2 -2
  297. package/dist/ui/multi-select.d.mts +3 -3
  298. package/dist/ui/multi-select.mjs +1 -1
  299. package/dist/ui/navigation-menu.d.cts +11 -11
  300. package/dist/ui/navigation-menu.d.mts +11 -11
  301. package/dist/ui/pagination.d.cts +9 -9
  302. package/dist/ui/pagination.d.mts +9 -9
  303. package/dist/ui/popover.cjs +1 -1
  304. package/dist/ui/popover.d.cts +6 -6
  305. package/dist/ui/popover.d.mts +6 -6
  306. package/dist/ui/popover.mjs +1 -1
  307. package/dist/ui/progress.cjs +1 -1
  308. package/dist/ui/progress.d.cts +2 -2
  309. package/dist/ui/progress.d.mts +2 -2
  310. package/dist/ui/progress.mjs +1 -1
  311. package/dist/ui/radio-group.cjs +1 -1
  312. package/dist/ui/radio-group.d.cts +3 -3
  313. package/dist/ui/radio-group.d.mts +3 -3
  314. package/dist/ui/radio-group.mjs +1 -1
  315. package/dist/ui/resizable.cjs +1 -1
  316. package/dist/ui/resizable.d.cts +9 -9
  317. package/dist/ui/resizable.d.mts +9 -9
  318. package/dist/ui/resizable.mjs +1 -1
  319. package/dist/ui/scroll-area.d.cts +5 -5
  320. package/dist/ui/scroll-area.d.mts +5 -5
  321. package/dist/ui/select.cjs +1 -1
  322. package/dist/ui/select.d.cts +9 -9
  323. package/dist/ui/select.d.mts +9 -9
  324. package/dist/ui/select.mjs +1 -1
  325. package/dist/ui/separator.cjs +1 -1
  326. package/dist/ui/separator.d.cts +2 -2
  327. package/dist/ui/separator.d.mts +2 -2
  328. package/dist/ui/separator.mjs +1 -1
  329. package/dist/ui/sheet.cjs +1 -1
  330. package/dist/ui/sheet.d.cts +9 -9
  331. package/dist/ui/sheet.d.mts +9 -9
  332. package/dist/ui/sheet.mjs +1 -1
  333. package/dist/ui/skeleton.d.cts +2 -2
  334. package/dist/ui/skeleton.d.mts +2 -2
  335. package/dist/ui/slider.d.cts +2 -2
  336. package/dist/ui/slider.d.mts +2 -2
  337. package/dist/ui/sonner.d.cts +2 -2
  338. package/dist/ui/sonner.d.mts +2 -2
  339. package/dist/ui/spinner.cjs +1 -1
  340. package/dist/ui/spinner.d.cts +2 -2
  341. package/dist/ui/spinner.d.mts +2 -2
  342. package/dist/ui/spinner.mjs +1 -1
  343. package/dist/ui/switch.cjs +1 -1
  344. package/dist/ui/switch.d.cts +2 -2
  345. package/dist/ui/switch.mjs +1 -1
  346. package/dist/ui/table.d.cts +17 -17
  347. package/dist/ui/table.d.mts +17 -17
  348. package/dist/ui/tabs.d.cts +5 -5
  349. package/dist/ui/tabs.d.mts +5 -5
  350. package/dist/ui/textarea.cjs +1 -1
  351. package/dist/ui/textarea.d.cts +2 -2
  352. package/dist/ui/textarea.d.mts +2 -2
  353. package/dist/ui/textarea.mjs +1 -1
  354. package/dist/ui/toggle-group.d.cts +3 -3
  355. package/dist/ui/toggle-group.d.mts +3 -3
  356. package/dist/ui/toggle.d.cts +6 -6
  357. package/dist/ui/toggle.d.mts +6 -6
  358. package/dist/ui/tooltip.d.cts +5 -5
  359. package/dist/ui/tooltip.d.mts +5 -5
  360. package/dist/{user-Cif7yb1w.mjs → user-D8Skw8dI.mjs} +2 -2
  361. package/dist/{user-Cif7yb1w.mjs.map → user-D8Skw8dI.mjs.map} +1 -1
  362. package/dist/{user-CQY0YnAc.cjs → user-Dns1BKaT.cjs} +2 -2
  363. package/dist/{user-CQY0YnAc.cjs.map → user-Dns1BKaT.cjs.map} +1 -1
  364. package/package.json +16 -6
  365. package/styles/text-editor.css +56 -0
  366. package/dist/data-display/statistic.cjs.map +0 -1
  367. package/dist/data-display/statistic.mjs.map +0 -1
  368. package/dist/index-B4tGZDYR.d.cts +0 -48
  369. package/dist/tables-BvdD0_el.mjs +0 -4
  370. package/dist/tables-BvdD0_el.mjs.map +0 -1
  371. package/dist/tables-D1SMzDFu.cjs +0 -4
  372. package/dist/tables-D1SMzDFu.cjs.map +0 -1
  373. package/dist/text-editor-CE_GkI7o.cjs +0 -2
  374. package/dist/text-editor-CE_GkI7o.cjs.map +0 -1
  375. package/dist/text-editor-D61C1dng.mjs +0 -2
  376. package/dist/text-editor-D61C1dng.mjs.map +0 -1
@@ -1,2 +1,2 @@
1
- import{t as e}from"./button-CfPTDyoq.mjs";import{i as t,n,t as r}from"./tooltip-BfBJRYpc.mjs";import{t as i}from"./separator-DVaVWuNc.mjs";import{t as a}from"./close-DTBepcqW.mjs";import{c as o,l as s,r as c,s as l,t as u}from"./dialog-Bly2YImt.mjs";import{a as d,i as f,o as p,r as m,s as h,t as g}from"./command-YngzaaGP.mjs";import{t as _}from"./checkbox-CrZ80dV_.mjs";import{t as v}from"./input-ESg91VId.mjs";import{t as y}from"./label-Cig7a9ON.mjs";import{a as b,i as x,t as S}from"./popover-BXktOcLz.mjs";import{c as C,i as w,n as T,s as E,t as D}from"./select-DMGFb8TB.mjs";import{t as O}from"./switch-CY25L6l0.mjs";import{l as k,n as A,o as ee,r as te,t as ne}from"./drawer-B3GpKBZs.mjs";import{t as re}from"./calendar-CqeVe3HO.mjs";import{n as ie,t as ae}from"./radio-group-CTILro-C.mjs";import{t as oe}from"./textarea-B8eQoQaZ.mjs";import{t as se}from"./text-editor-D61C1dng.mjs";import{ArrowDownToLine as ce,AtSignIcon as le,BanIcon as ue,CalendarDaysIcon as de,ChevronDownIcon as fe,EyeIcon as pe,EyeOffIcon as me,HelpCircleIcon as he,InfoIcon as ge,Loader2Icon as _e,PackagePlusIcon as ve,PlusIcon as ye,Trash2Icon as be,XIcon as xe}from"lucide-react";import{memo as j,useCallback as M,useEffect as Se,useId as N,useMemo as P,useRef as Ce,useState as F}from"react";import{cn as I}from"@customafk/react-toolkit/utils";import{cva as we}from"class-variance-authority";import{Fragment as Te,jsx as L,jsxs as R}from"react/jsx-runtime";import{endOfToday as z,endOfTomorrow as Ee,endOfYesterday as De,format as Oe,lastDayOfMonth as ke,startOfMonth as Ae,subDays as je}from"@customafk/react-toolkit/date-fns";import{Dialog as B,Label as Me,Separator as Ne,Switch as Pe}from"radix-ui";import{useIsMobile as Fe}from"@customafk/react-toolkit/hooks/useMobile";import{createFormHook as Ie,createFormHookContexts as Le,useStore as V}from"@tanstack/react-form";function Re({width:e,className:t,children:n}){let r=e?{width:typeof e==`number`?`${e}px`:e,flexShrink:0}:{flex:1,minWidth:0};return L(`div`,{"data-slot":`array-col`,style:r,className:t,children:n})}function ze({className:e,children:t}){return R(`div`,{"data-slot":`array-header-row`,className:I(`mb-1 flex items-center gap-2 px-1 text-xs font-medium text-text-positive-weak`,e),children:[t,L(`div`,{className:`min-w-8 w-8 shrink-0`})]})}function Be({defaultRow:t,children:n,addLabel:r=`Add row`,className:i}){let a=Q(),o=a.state.value??[],s=M(()=>{a.pushValue({...t})},[a,t]),c=M(e=>{a.removeValue(e)},[a]);return R(`div`,{"data-slot":`simple-array-field`,className:I(`flex flex-col gap-2`,i),children:[o.map((t,r)=>R(`div`,{className:`flex items-start gap-2`,children:[n(r),L(e,{type:`button`,size:`icon`,variant:`ghost`,color:`danger`,className:`min-w-8`,onClick:()=>c(r),children:L(be,{size:14})})]},r)),L(`div`,{children:R(e,{type:`button`,variant:`outline`,color:`muted`,size:`xs`,onClick:s,children:[L(ye,{size:13}),r]})})]})}const Ve=we([`flex w-fit items-center justify-center rounded-full font-bold text-text-negative-strong`],{variants:{color:{default:`bg-primary-strong`,secondary:`bg-secondary-strong`,success:`bg-success-strong`,info:`bg-info-strong`,warning:`bg-warning-strong`,danger:`border border-danger-strong bg-linear-to-b from-danger-strong/90 via-danger-strong to-danger-strong/90`},size:{xs:`px-1.5 py-0.5 text-xs`,sm:`px-2 py-0.75 text-xs`,md:`px-2.5 py-0.75 text-sm`,lg:`px-3 py-1 text-sm`}},defaultVariants:{color:`default`,size:`sm`}}),He=({label:e,color:t,size:n,className:r,children:i})=>L(`div`,{"data-slot":`required-indicator`,className:Ve({color:t,size:n,className:r}),children:e||i});function Ue({className:e,children:t,...n}){return R(Me.Root,{"data-slot":`label`,className:I(`text-text-positive`,`flex w-full items-center justify-between`,`select-none font-medium text-sm/6 leading-none`,`group-data-[disabled=true]:pointer-events-none`,`group-data-[disabled=true]:opacity-50`,`peer-disabled:cursor-not-allowed`,`peer-disabled:opacity-50`,`aria-required:*:data-[slot=required-indicator]:inline-block`,e),...n,children:[L(`span`,{className:`flex items-center gap-1`,children:t}),L(He,{label:`Required`,color:`danger`,size:`xs`,className:`hidden shrink-0`})]})}const We=we(`group/field flex w-full gap-2 data-[invalid=true]:text-danger *:data-[slot=field-content]:gap-0`,{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:gap-4`,`@md/field-group:*:w-auto`,`@md/field-group:*:data-[slot=field-content]:basis-1/2`,`@md/field-group:*:data-[slot=field-content-main]:basis-1/2`,`@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`}}),Ge=j(({className:e,...t})=>L(`fieldset`,{"data-slot":`field-set`,className:I(`flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,e),...t}));Ge.displayName=`FieldSet`;const Ke=j(({className:e,variant:t=`legend`,...n})=>L(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:I(`mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,e),...n}));Ke.displayName=`FieldLegend`;const H=j(({className:e,...t})=>L(`div`,{"data-slot":`field-group`,className:I(`group/field-group @container/field-group`,`flex flex-col gap-7 pt-4`,`data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,e),...t}));H.displayName=`FieldGroup`;const U=j(({className:e,orientation:t=`vertical`,...n})=>L(`div`,{"data-slot":`field`,"data-orientation":t,className:I(We({orientation:t}),e),...n}));U.displayName=`Field`;const W=j(({className:e,...t})=>L(`div`,{"data-slot":`field-content`,className:I(`group/field-content flex flex-col gap-1.5 leading-snug`,e),...t}));W.displayName=`FieldContent`;const G=j(({className:e,...t})=>L(`div`,{"data-slot":`field-content-main`,className:I(`relative`,e),...t}));G.displayName=`FieldContentMain`;const K=j(({className:e,...t})=>L(Ue,{"data-slot":`field-label`,className:I(`group/field-label peer/field-label min-h-6 gap-1 font-medium leading-snug`,`has-[>[data-slot=field]]:w-full`,`has-[>[data-slot=field]]:flex-col`,`has-[>[data-slot=field]]:rounded-md`,`has-[>[data-slot=field]]:border`,`has-[>[data-slot=field]]:border-border`,`has-data-[state=checked]:border-primary`,`*:data-[slot=field]:p-4 group-data-[disabled=true]/field:opacity-50`,e),...t}));K.displayName=`FieldLabel`;const qe=j(({className:e,...t})=>L(`div`,{"data-slot":`field-label`,className:I(`flex w-fit items-center gap-2 font-medium text-sm leading-snug group-data-[disabled=true]/field:opacity-50`,e),...t}));qe.displayName=`FieldTitle`;const q=j(({className:e,...t})=>L(`p`,{"data-slot":`field-description`,className:I(`nth-last-2:-mt-1 font-normal text-text-positive-weak text-xs leading-normal last:mt-0 [&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4 [[data-variant=legend]+&]:-mt-1.5`,e),...t}));q.displayName=`FieldDescription`;const J=j(({isShow:e=!0,className:t,children:n,...r})=>e===!1?null:R(`div`,{"data-slot":`field-note`,className:I(`flex items-start gap-1.5 rounded border border-primary-muted/60 bg-primary-bg-subtle/80 px-2.5 py-2 text-text-positive-weak text-xs`,t),...r,children:[L(ge,{size:12,className:`mt-0.5 shrink-0 text-primary/70`}),L(`span`,{children:n})]}));J.displayName=`FieldNote`;const Y=j(({tooltip:e})=>R(r,{children:[L(t,{asChild:!0,children:R(`button`,{type:`button`,tabIndex:-1,className:`inline-flex cursor-default items-center text-text-positive-weak/70 hover:text-text-positive focus:outline-none`,children:[L(he,{size:13,"aria-hidden":`true`}),L(`span`,{className:`sr-only`,children:`More information`})]})}),L(n,{side:`top`,className:`max-w-xs text-balance`,children:e})]}));Y.displayName=`FieldTooltip`;const X=j(({children:e,className:t,...n})=>R(`div`,{"data-slot":`field-separator`,"data-content":!!e,className:I(`relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2`,t),...n,children:[L(i,{className:`absolute inset-0 top-1/2`}),e&&L(`span`,{className:`relative mx-auto block w-fit bg-background px-2 text-text-positive-weak`,"data-slot":`field-separator-content`,children:e})]}));X.displayName=`FieldSeparator`;const Z=j(({className:e,children:t,errors:n,...r})=>{let i=P(()=>t||(n?n?.length===1&&n[0]?.message?L(`div`,{className:`flex flex-row items-center justify-start gap-x-0.5`,children:L(`p`,{children:n[0]?.code===`invalid_type`?`Invalid format`:n[0].message})}):L(`ul`,{className:`flex list-none flex-col`,children:n.map(e=>typeof e==`string`?L(`li`,{children:e},e):e?.message?L(`li`,{children:e.message},e.message):null)}):null),[t,n]);return i?L(`div`,{role:`alert`,"data-slot":`field-error`,className:I(`w-full font-medium text-danger-strong text-xs`,e),...r,children:i}):null});Z.displayName=`FieldError`;const Je=({label:e,required:t,disabled:n,variant:r=`checkbox`})=>{let i=N(),{form:a,name:o,state:s,handleBlur:c,handleChange:l}=Q(),u=V(a.store,({isSubmitting:e})=>e),d=s.meta.isTouched&&!s.meta.isValid,f=s.value??!1,p=n||u,m=M(e=>{u||l(e)},[u,l]);return R(`div`,{className:`flex flex-col gap-1.5`,children:[R(`div`,{className:`flex items-center gap-2 h-9`,children:[L(r===`switch`?O:_,{id:i,name:o,checked:f,disabled:p,"aria-invalid":d,onBlur:c,onCheckedChange:m}),e&&R(y,{htmlFor:i,className:`cursor-pointer`,children:[e,t&&L(`span`,{className:`text-danger-strong`,children:`*`})]})]}),d&&L(Z,{errors:s.meta.errors})]})},Ye=({label:t,placeholder:n,required:r,disabled:i,options:a})=>{let o=N(),{form:s,name:c,state:l,handleBlur:u,handleChange:_}=Q(),v=V(s.store,({isSubmitting:e})=>e),C=Fe(),[w,T]=F(!1),E=l.meta.isTouched&&!l.meta.isValid,D=i||v,O=a.find(({value:e})=>e===l.value)?.label,A=R(g,{children:[L(d,{placeholder:n??`Search…`}),R(h,{children:[L(m,{children:`No results found.`}),L(f,{children:a.map(e=>L(p,{value:e.label,onSelect:()=>{_(e.value===l.value?null:e.value),T(!1)},children:e.label},e.value))})]})]});return C?R(`div`,{className:`flex flex-col gap-1.5`,children:[t&&R(y,{htmlFor:o,children:[t,r&&L(`span`,{className:`text-danger-strong`,children:`*`})]}),L(e,{id:o,type:`button`,variant:`outline`,color:`muted`,disabled:D,"aria-invalid":E,className:I(`w-full justify-start font-normal outline-1 outline-border -outline-offset-1`,!l.value&&`text-text-positive-muted`,E&&`outline-danger bg-danger-bg-subtle`),onBlur:u,onClick:()=>T(!0),children:O??L(`span`,{className:`text-text-positive-muted`,children:n})}),L(ne,{open:w,onOpenChange:T,direction:`bottom`,children:R(te,{children:[L(ee,{children:L(k,{children:t??n??`Search…`})}),L(`div`,{className:`overflow-y-auto pb-safe-bottom`,children:A})]})}),E&&L(Z,{errors:l.meta.errors})]}):R(`div`,{className:`flex flex-col gap-1.5`,children:[t&&R(y,{htmlFor:o,children:[t,r&&L(`span`,{className:`text-danger-strong`,children:`*`})]}),R(S,{children:[L(b,{asChild:!0,children:L(e,{id:o,variant:`outline`,color:`muted`,size:`lg`,disabled:D,"aria-invalid":E,className:I(`flex w-full items-center justify-start rounded outline-border font-normal`,`hover:bg-transparent`,`focus:outline-1 focus:outline-primary-strong focus:ring-4 focus:ring-primary-weak`,`data-[state=open]:outline-1 data-[state=open]:outline-primary-strong data-[state=open]:ring-4 data-[state=open]:ring-primary-weak`,!l.value&&`text-text-positive-muted`),children:O??L(`span`,{className:`text-text-positive-muted`,children:n})})}),L(x,{align:`start`,side:`bottom`,className:`w-[--radix-popover-trigger-width] p-0 rounded`,onBlur:u,children:A})]}),E&&L(Z,{errors:l.meta.errors})]})},Xe=({label:t,placeholder:n,required:r,disabled:i,minDate:a,maxDate:o})=>{let s=N(),{form:c,name:l,state:u,handleBlur:d,handleChange:f}=Q(),p=V(c.store,({isSubmitting:e})=>e),m=u.meta.isTouched&&!u.meta.isValid;return R(`div`,{className:`flex flex-col gap-1.5`,children:[t&&R(y,{htmlFor:s,children:[t,r&&L(`span`,{className:`text-danger-strong`,children:`*`})]}),R(S,{children:[L(b,{asChild:!0,children:R(e,{id:s,variant:`outline`,color:`muted`,size:`lg`,disabled:i||p,"aria-invalid":m,className:I(`flex w-full items-center justify-between rounded outline-border font-normal`,`hover:bg-transparent`,`focus:outline-1 focus:outline-primary-strong focus:ring-4 focus:ring-primary-weak`,`data-[state=open]:outline-1 data-[state=open]:outline-primary-strong data-[state=open]:ring-4 data-[state=open]:ring-primary-weak`,u.value===null&&`text-text-positive-muted`),children:[L(`span`,{children:u.value?Oe(u.value,`PPP`):n??`Select date`}),L(de,{strokeWidth:1})]})}),L(x,{align:`start`,side:`bottom`,className:`w-fit p-0 rounded`,onBlur:d,children:L(re,{mode:`single`,selected:u.value??void 0,hidden:{before:a??new Date(1900,0,1),after:o??new Date(2100,11,31)},onSelect:e=>{e&&f(e)}})})]}),m&&L(Z,{errors:u.meta.errors})]})},Ze=({label:e,required:t,disabled:n,options:r,orientation:i=`vertical`})=>{let{form:a,name:o,state:s,handleBlur:c,handleChange:l}=Q(),u=V(a.store,({isSubmitting:e})=>e),d=s.meta.isTouched&&!s.meta.isValid,f=n||u;return R(`div`,{className:`flex flex-col gap-1.5`,children:[e&&R(y,{children:[e,t&&L(`span`,{className:`text-danger-strong`,children:`*`})]}),L(ae,{name:o,value:s.value??``,disabled:f,"aria-invalid":d,className:i===`horizontal`?`flex flex-row flex-wrap gap-x-4 gap-y-2`:`flex flex-col gap-2`,onValueChange:l,onBlur:c,children:r.map(e=>R(`div`,{className:`flex items-center gap-2`,children:[L(ie,{id:`${o}-${e.value}`,value:e.value}),L(y,{htmlFor:`${o}-${e.value}`,className:`cursor-pointer font-normal`,children:e.label})]},e.value))}),d&&L(Z,{errors:s.meta.errors})]})},Qe=({label:e,placeholder:t,required:n,maxLength:r,disabled:i})=>{let a=N(),{form:o,name:s,state:c,handleBlur:l,handleChange:u}=Q(),d=V(o.store,({isSubmitting:e})=>e),f=c.meta.isTouched&&!c.meta.isValid,p=M(({target:{value:e}})=>{d||r&&e.length>r||u(e||null)},[d,r,u]);return R(`div`,{className:`flex flex-col gap-1.5`,children:[e&&R(y,{htmlFor:a,children:[e,n&&L(`span`,{className:`text-danger-strong`,children:`*`})]}),R(`div`,{className:`relative`,children:[L(v,{id:a,name:s,type:`email`,value:c.value??``,"aria-invalid":f,autoComplete:`email`,placeholder:t,disabled:i||d,className:I(`pl-9`),onBlur:l,onChange:p}),L(`div`,{className:`pointer-events-none absolute inset-y-0 left-0 flex size-9 items-center justify-center text-muted`,children:L(le,{size:14})})]}),f&&L(Z,{errors:c.meta.errors})]})},$e=e=>e?/^-?\d*\.?\d*$/:/^\d*\.?\d*$/,et=e=>Number(e).toLocaleString(),tt=(e,t,n)=>{if(n===`none`)return e;let r=10**t,i=e*r;switch(n){case`up`:return Math.ceil(i)/r;case`down`:return Math.floor(i)/r;case`nearest`:return i%1<.1?Math.floor(i)/r:i%1>=.59?Math.ceil(i)/r:(Math.floor(i)+.5)/r;default:return e}},nt=({disabled:e=!1,readOnly:t=!1,allowNegative:n=!1,numberAfterDecimalPoint:r=2,roundingRule:i=`none`,value:a=null,unitText:o,decimal:s,placeholder:c,precision:l,wrapperClassName:u,className:d,onChange:f,onValueChange:p,onFocus:m,onBlur:h,...g})=>{let _=Ce(null),y=Ce(null),[b,x]=F(a?.toString()??null),S=P(()=>s?.[1]??r,[s,r]),C=P(()=>s&&s[0]-s[1],[s]),w=P(()=>$e(n),[n]),T=M(e=>{if(!S||e===`-`)return!0;let[t,n=``]=e.split(`.`),r=t.startsWith(`-`)?t.length-1:t.length;return n.length<=S&&r<=(C??1/0)},[S,C]),E=M(e=>{if(e===`0`)return`0`;if(!Number(e))return null;let[t,n=``]=tt(parseFloat(e),Math.min(S-1,l||0),i).toString().split(`.`),r=et(t);return n?`${r}.${n}`:r},[S,l,i]),D=M(e=>{let t=e===`0`,n=e===`-`||/^-0+(\.0+)?$/.test(e)||/^-0*\.$/.test(e);if(t){p?.(0),x(e);return}if(n){x(()=>(p?.(0),e));return}},[p]),O=M(e=>{f?.(e);let{value:t}=e.target;if(t===``||t===void 0){p?.(null),x(null);return}D(t),!(!w.test(t)||!T(t))&&(p?.(parseFloat(t)||0),x(t))},[T,f,p,D,w]),k=M(e=>{t||(m?.(e),x(e=>typeof e==`string`?e.replace(/,/g,``):null))},[t,m]),A=M(e=>{t||(h?.(e),x(e=>e===null?null:e===`0`||e===`-`||/^-0+(\.0+)?$/.test(e)||/^-0*\.$/.test(e)?`0`:typeof e==`string`?E(e):null))},[t,E,h]);return Se(()=>{let e=document.activeElement===y.current;if(a==null||!w.test(a.toString())||!T(a.toString())){x(null);return}x(t=>e?t:E(a.toString()))},[E,a,T,w]),Se(()=>{if(!_.current||!y.current||!o)return;let e=_.current.offsetWidth;y.current.style.setProperty(`padding-right`,`${(e+10)/16}rem`)},[o]),R(`div`,{className:I(`relative`,u),children:[L(v,{...g,ref:y,value:b||(t?`0`:``),placeholder:c,disabled:e,readOnly:t,className:I(`text-end font-number text-sm slashed-zero lining-nums tabular-nums`,t&&`bg-muted text-muted-foreground`,d),onChange:O,onFocus:k,onBlur:A}),o&&L(`span`,{ref:_,className:`-translate-y-1/2 pointer-events-none absolute top-1/2 right-2 text-muted-foreground text-sm`,children:o})]})},rt=({label:e,placeholder:t,required:n,unit:r,allowNegative:i,disabled:a})=>{let o=N(),{form:s,state:c,handleBlur:l,handleChange:u}=Q(),d=V(s.store,({isSubmitting:e})=>e),f=c.meta.isTouched&&!c.meta.isValid,p=M(e=>{d||u(e)},[d,u]);return R(`div`,{className:`flex flex-col gap-1.5`,children:[e&&R(y,{htmlFor:o,children:[e,n&&L(`span`,{className:`text-danger-strong`,children:`*`})]}),L(nt,{id:o,value:c.value,placeholder:t,unitText:r,allowNegative:i,disabled:a||d,onBlur:l,onValueChange:p}),f&&L(Z,{errors:c.meta.errors})]})},it=({label:e,placeholder:t,required:n,disabled:r})=>{let i=N(),{form:a,name:o,state:s,handleBlur:c,handleChange:l}=Q(),u=V(a.store,({isSubmitting:e})=>e),[d,f]=F(!1),p=s.meta.isTouched&&!s.meta.isValid,m=M(()=>f(e=>!e),[]),h=M(({target:{value:e}})=>{u||l(e||null)},[u,l]);return R(`div`,{className:`flex flex-col gap-1.5`,children:[e&&R(y,{htmlFor:i,children:[e,n&&L(`span`,{className:`text-danger-strong`,children:`*`})]}),R(`div`,{className:`relative`,children:[L(v,{id:i,name:o,type:d?`text`:`password`,value:s.value??``,"aria-invalid":p,autoComplete:`current-password`,placeholder:t,disabled:r||u,className:`pr-9`,onBlur:c,onChange:h}),L(`button`,{type:`button`,tabIndex:-1,"aria-label":d?`Hide password`:`Show password`,"aria-pressed":d,"aria-controls":i,className:`absolute inset-y-0 right-0 flex size-9 items-center justify-center text-muted outline-none transition-colors hover:text-text-positive focus-visible:text-text-positive disabled:pointer-events-none disabled:opacity-50`,disabled:r||u,onClick:m,children:L(d?me:pe,{size:16,"aria-hidden":`true`})})]}),p&&L(Z,{errors:s.meta.errors})]})},at=({label:t,placeholder:n,required:r,options:i})=>{let a=N(),{state:o,handleBlur:s,handleChange:c}=Q(),l=Fe(),[u,d]=F(!1),f=o.meta.isTouched&&!o.meta.isValid,p=i.find(e=>e.value===o.value)?.label;return l?R(`div`,{className:`flex flex-col gap-1.5`,children:[t&&R(y,{htmlFor:a,children:[t,r&&L(`span`,{className:`text-danger-strong`,children:`*`})]}),L(e,{id:a,type:`button`,variant:`outline`,color:`muted`,className:I(`w-full justify-start font-normal outline-1 outline-border -outline-offset-1`,!o.value&&`text-text-positive-muted`,f&&`outline-danger bg-danger-bg-subtle`),"aria-invalid":f,onBlur:s,onClick:()=>d(!0),children:p??L(`span`,{className:`text-text-positive-muted`,children:n})}),L(ne,{open:u,onOpenChange:d,direction:`bottom`,children:R(te,{children:[L(ee,{children:L(k,{children:t??n??`Select an option`})}),L(`div`,{className:`flex flex-col overflow-y-auto pb-safe-bottom`,children:i.length>0?i.map(e=>L(A,{asChild:!0,children:L(`button`,{type:`button`,className:I(`flex w-full items-center px-4 py-3 text-left text-sm transition-colors`,`hover:bg-muted-muted active:bg-muted-muted`,o.value===e.value&&`bg-primary-bg-subtle font-medium text-primary`),onClick:()=>{c(e.value),d(!1)},children:e.label})},e.value)):R(`div`,{className:`flex items-center justify-center gap-x-2 px-4 py-8 text-center text-sm text-text-positive-weak`,children:[L(ve,{strokeWidth:1}),`No options available`]})})]})}),f&&L(Z,{errors:o.meta.errors})]}):R(`div`,{className:`flex flex-col gap-1.5`,children:[t&&R(y,{htmlFor:a,children:[t,r&&L(`span`,{className:`text-danger-strong`,children:`*`})]}),R(D,{value:o.value??``,onValueChange:c,children:[L(E,{id:a,"aria-invalid":f?`true`:void 0,onBlur:s,children:L(C,{placeholder:n})}),L(T,{children:i.length>0?i.map(e=>L(w,{value:e.value,children:e.label},e.value)):R(`div`,{className:`flex items-center justify-center gap-x-2 rounded border border-border bg-muted-muted px-4 py-6.5 text-center text-sm text-text-positive-weak`,children:[L(ve,{strokeWidth:1}),`No options available`]})})]}),f&&L(Z,{errors:o.meta.errors})]})},ot=({label:e,placeholder:t,required:n,maxLength:r,rows:i,disabled:a})=>{let o=N(),{form:s,name:c,state:l,handleBlur:u,handleChange:d}=Q(),f=V(s.store,({isSubmitting:e})=>e),p=l.meta.isTouched&&!l.meta.isValid,m=M(({target:{value:e}})=>{f||r&&e.length>r||d(e||null)},[f,r,d]);return R(`div`,{className:`flex flex-col gap-1.5`,children:[e&&R(y,{htmlFor:o,children:[e,n&&L(`span`,{className:`text-danger-strong`,children:`*`})]}),L(oe,{id:o,name:c,value:l.value??``,"aria-invalid":p,placeholder:t,rows:i,disabled:a||f,onBlur:u,onChange:m}),p&&L(Z,{errors:l.meta.errors})]})},st=({label:e,placeholder:t,required:n,maxLength:r,disabled:i})=>{let a=N(),{form:o,name:s,state:c,handleBlur:l,handleChange:u}=Q(),d=V(o.store,({isSubmitting:e})=>e),f=c.meta.isTouched&&!c.meta.isValid,p=M(({target:{value:e}})=>{d||r&&e.length>r||u(e||null)},[d,r,u]);return R(`div`,{className:`flex flex-col gap-1.5`,children:[e&&R(y,{htmlFor:a,children:[e,n&&L(`span`,{className:`text-danger-strong`,children:`*`})]}),L(v,{id:a,name:s,value:c.value??``,"aria-invalid":f,placeholder:t,autoComplete:`off`,disabled:i||d,onBlur:l,onChange:p}),f&&L(Z,{errors:c.meta.errors})]})},ct=({label:e,description:t,options:n,tooltip:r,helperText:i,orientation:a})=>{let o=Q(),s=V(o.form.store,({isSubmitting:e})=>e);return R(H,{className:`gap-y-4 px-4`,children:[R(U,{orientation:a,children:[R(W,{children:[R(K,{children:[e,r&&L(Y,{tooltip:r})]}),L(q,{children:t}),L(J,{isShow:!!i,children:i})]}),L(G,{children:L(H,{className:`flex flex-col gap-y-2`,children:n.map(e=>R(U,{orientation:`horizontal`,children:[L(_,{id:`${o.name}-${e.value}`,name:o.name,checked:o.state.value?.includes(e.value)??!1,disabled:s,onCheckedChange:t=>{if(t&&o.state.value!==null)o.pushValue(e.value);else if(t&&o.state.value===null)o.setValue([e.value]);else if(!t&&o.state.value!==null){let t=o.state.value.indexOf(e.value);t>-1&&o.removeValue(t)}else o.setValue(null)}}),L(K,{htmlFor:`${o.name}-${e.value}`,className:`text-text-positive`,children:e.label})]},e.value))})})]}),L(X,{})]})},lt=({label:t,description:n,placeholder:r,tooltip:i,orientation:a=`responsive`,options:o})=>{let s=Q(),c=Fe(),[l,u]=F(!1),_=P(()=>s.state.meta.isTouched&&!s.state.meta.isValid,[s.state.meta.isTouched,s.state.meta.isValid]),v=P(()=>s.state.meta.errors,[s.state.meta.errors]),y=o.find(({value:e})=>e===s.state.value)?.label,C=t=>L(e,{variant:`outline`,color:`muted`,size:`lg`,className:I(`flex items-center justify-start rounded outline-border`,`hover:bg-transparent`,`focus:outline-1 focus:outline-primary-strong focus:ring-4 focus:ring-primary-weak`,`data-[state=open]:text-text-positive-muted data-[state=open]:outline-1 data-[state=open]:outline-primary-strong data-[state=open]:ring-4 data-[state=open]:ring-primary-weak`,!s.state.value&&`text-text-positive-muted`),onClick:t,children:y?L(`p`,{className:`flex min-w-0 flex-1 items-center gap-2 text-start`,children:y}):L(`p`,{className:`flex-1 text-start text-text-positive-muted`,children:r})}),w=R(g,{className:`border-none`,children:[L(d,{placeholder:r??`Search…`}),L(h,{children:L(f,{className:`max-h-60 overflow-y-auto`,children:o.map(({value:e,label:t})=>L(p,{value:t,onSelect:()=>{s.handleChange(e),u(!1)},children:t},e))})}),L(m,{className:`flex min-h-30 items-center justify-center text-sm text-text-positive-weak`,children:`Không tìm thấy kết quả nào phù hợp.`})]});return R(H,{className:`px-4`,children:[R(U,{orientation:a,"data-invalid":_,children:[R(W,{children:[R(K,{htmlFor:s.name,children:[t,i&&L(Y,{tooltip:i})]}),L(q,{children:n})]}),L(G,{className:`flex justify-end`,children:R(`div`,{className:`flex w-full flex-col`,children:[c?R(Te,{children:[C(()=>u(!0)),L(ne,{open:l,onOpenChange:u,direction:`bottom`,children:R(te,{children:[L(ee,{children:L(k,{children:t})}),L(`div`,{className:`overflow-y-auto pb-safe-bottom`,children:w})]})})]}):R(S,{children:[L(b,{asChild:!0,children:C()}),L(x,{align:`end`,side:`bottom`,className:`flex w-fit rounded p-0`,onBlur:s.handleBlur,children:w})]}),L(`div`,{className:`mt-1 flex w-full flex-col items-end justify-end`,children:L(Z,{errors:v})})]})})]}),L(X,{})]})},ut=({label:t,description:n,placeholder:r,orientation:i=`responsive`,tooltip:a,helperText:o,minDate:s,maxDate:c,required:l})=>{let u=Q(),d=P(()=>l?u.state.value===null:!1,[l,u.state.value]),f=P(()=>u.state.meta.isTouched&&!u.state.meta.isValid,[u.state.meta.isTouched,u.state.meta.isValid]);return R(H,{className:`px-4`,children:[R(U,{orientation:i,"data-invalid":f,children:[R(W,{children:[R(K,{htmlFor:u.name,"aria-required":d,children:[t,a&&L(Y,{tooltip:a})]}),L(q,{children:n})]}),R(G,{className:`flex flex-col space-y-1`,children:[L(`div`,{className:`flex w-full flex-col`,children:R(S,{children:[L(b,{asChild:!0,children:R(e,{variant:`outline`,color:`muted`,size:`lg`,className:I(`flex items-center justify-between rounded font-normal outline-border`,`hover:bg-transparent`,`focus:outline-1 focus:outline-primary-strong focus:ring-4 focus:ring-primary-weak`,`data-[state=open]:text-text-positive-muted`,`data-[state=open]:outline-1`,`data-[state=open]:outline-primary-strong`,`data-[state=open]:ring-4`,`data-[state=open]:ring-primary-weak`,u.state.value===null&&`text-text-positive-muted`),children:[L(`p`,{children:u.state.value===null?r||`Select date`:Oe(u.state.value,`PPPP`)}),L(de,{strokeWidth:1})]})}),R(x,{align:`start`,side:`bottom`,className:`flex w-fit min-w-0 overflow-y-auto rounded p-0`,onBlur:u.handleBlur,children:[R(`div`,{className:`flex h-full flex-col space-y-2 border-r border-r-border p-2 [&>button]:justify-start [&>button]:text-sm`,children:[L(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{u.handleChange(z())},children:`Today`}),L(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{u.handleChange(Ee())},children:`Tomorrow`}),L(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{u.handleChange(De())},children:`Yesterday`}),L(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{u.handleChange(je(z(),3))},children:`Last 3 Days`}),L(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{u.handleChange(je(z(),7))},children:`Last 7 Days`}),L(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{u.handleChange(je(z(),30))},children:`Last 30 Days`}),L(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{u.handleChange(Ae(z()))},children:`This Month`}),L(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{u.handleChange(ke(z()))},children:`Last Month`})]}),L(`div`,{className:`flex flex-1 flex-col`,children:L(`div`,{className:`min-w-73 border-b border-b-border p-2`,children:L(re,{mode:`single`,selected:u.state.value??void 0,hidden:{before:s??new Date(1900,0,1),after:c??new Date(2100,11,31)},onSelect:e=>{e&&u.handleChange(e)}})})})]})]})}),L(J,{isShow:!!o,children:o})]})]}),L(X,{})]})},dt=({label:e,description:t,placeholder:n,tooltip:r,helperText:i,orientation:a=`responsive`,showErrorMessage:o=!0,required:s=!1,maxLength:c})=>{let{form:l,name:u,state:d,handleBlur:f,handleChange:p}=Q(),m=V(l.store,({isSubmitting:e})=>e),h=d.meta.isDirty&&d.meta.isTouched&&!d.meta.isValid,g=s&&d.value===null,_=!m&&!!d.value,y=M(({target:{value:e}})=>{m||c&&e.length>c||p(e||null)},[m,c,p]),b=M(()=>{m||p(null)},[m,p]);return R(H,{className:`gap-y-4 px-4`,children:[R(U,{"data-invalid":h,orientation:a,children:[R(W,{children:[R(K,{htmlFor:u,"aria-required":g,children:[e,r&&L(Y,{tooltip:r})]}),L(q,{children:t})]}),R(G,{children:[L(v,{id:u,name:u,value:d.value===null?``:d.value,"aria-invalid":h,autoComplete:`email`,placeholder:n,className:I(`pl-9`,_&&`pr-9`,m&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:f,onChange:y}),L(`div`,{className:`absolute top-0 left-0 flex size-9 items-center justify-center text-muted`,children:L(le,{size:14})}),_&&L(`button`,{type:`button`,"aria-label":`Clear`,className:`absolute inset-e-0 inset-y-0 top-3 flex h-fit w-8 cursor-pointer items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:text-text-positive-strong`,onClick:b,children:L(xe,{size:14,"aria-hidden":`true`})}),L(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:o&&d.meta.isDirty&&L(Z,{errors:d.meta.errors})}),L(J,{isShow:!!i,children:i})]})]}),L(X,{})]})},ft=({label:e,description:t,placeholder:n,tooltip:r,helperText:i,orientation:a=`responsive`,showErrorMessage:o=!0,rounding:s,decimalPlaces:c,percision:l,unit:u,required:d,allowNegative:f})=>{let p=Q(),m=V(p.form.store,({isSubmitting:e})=>e),h=p.state.meta.errors,g=d?p.state.value===null:!1,_=M(e=>{m||p.handleChange(e)},[m,p.handleChange]);return R(H,{className:`gap-y-4 px-4`,children:[R(U,{orientation:a,"data-invalid":p.state.meta.isTouched&&!p.state.meta.isValid,children:[R(W,{children:[R(K,{htmlFor:p.name,"aria-required":g,children:[e,r&&L(Y,{tooltip:r})]}),L(q,{children:t})]}),R(G,{children:[R(`div`,{className:`relative w-full`,children:[L(nt,{id:p.name,value:p.state.value,"aria-invalid":p.state.meta.isTouched&&!p.state.meta.isValid&&p.state.meta.isDirty,placeholder:n,roundingRule:s,numberAfterDecimalPoint:c,precision:l,unitText:u,allowNegative:f,className:I(m&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:p.handleBlur,onValueChange:_}),m&&L(`div`,{className:`absolute inset-s-2 inset-y-0 top-2.5 text-muted-weak [&>svg]:size-3.5`,children:L(_e,{className:`animate-spin text-primary-strong`})}),p.state.meta.isDirty&&o&&!!h.length&&L(`div`,{className:`absolute inset-s-2 inset-y-0 top-2.75 text-danger-strong [&>svg]:size-3.5`,children:L(ue,{})}),L(`div`,{className:`mt-1 flex w-full flex-col items-end justify-end`,children:p.state.meta.isDirty&&o&&L(Z,{errors:h})})]}),L(J,{isShow:!!i,children:i})]})]}),L(X,{})]})},pt=({label:e,description:t,placeholder:n,orientation:r=`responsive`,tooltip:i,helperText:a,showErrorMessage:o=!0})=>{let s=N(),{form:c,name:l,state:u,handleBlur:d,handleChange:f}=Q(),p=V(c.store,({isSubmitting:e})=>e),[m,h]=F(!1),g=u.meta.isDirty&&u.meta.isTouched&&!u.meta.isValid,_=M(()=>h(e=>!e),[]),y=M(({target:{value:e}})=>{p||f(e||null)},[p,f]);return R(H,{className:`gap-y-4 px-4`,children:[R(U,{"data-invalid":g,orientation:r,children:[R(W,{children:[R(K,{htmlFor:s,children:[e,i&&L(Y,{tooltip:i})]}),L(q,{children:t})]}),R(G,{children:[L(v,{id:s,name:l,type:m?`text`:`password`,placeholder:n,value:u.value??``,"aria-invalid":g,autoComplete:`new-password`,onBlur:d,onChange:y}),L(`button`,{className:`absolute inset-e-0 inset-y-0 flex size-9 items-center justify-center rounded-e-md text-muted outline-none transition-[color,box-shadow] focus:z-10 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,type:`button`,onClick:_,"aria-label":m?`Hide password`:`Show password`,"aria-pressed":m,"aria-controls":s,children:L(m?me:pe,{size:16,"aria-hidden":`true`})}),L(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:o&&u.meta.isDirty&&L(Z,{errors:u.meta.errors})}),L(J,{isShow:!!a,children:a})]})]}),L(X,{})]})},mt=({label:e,description:t,orientation:n,options:r,tooltip:i,helperText:a})=>{let o=Q(),s=V(o.form.store,({isSubmitting:e})=>e);return R(H,{className:`px-4`,children:[R(U,{orientation:n,className:`flex-col gap-2`,children:[R(W,{children:[R(K,{children:[e,i&&L(Y,{tooltip:i})]}),L(q,{children:t}),L(J,{isShow:!!a,children:a})]}),L(G,{children:L(ae,{value:o.state.value??``,className:`w-full`,onValueChange:o.handleChange,children:r.map(e=>L(K,{className:I(`h-fit`,o.state.value===e.value&&`border-primary-weak! bg-primary-bg-subtle`,s&&`pointer-events-none bg-muted-muted opacity-60`,o.state.value===e.value&&s&&`border-border-strong!`),children:R(U,{orientation:`horizontal`,className:`items-start gap-3 rounded p-2!`,children:[L(ie,{value:e.value,className:`mt-0.5 shrink-0`}),R(W,{className:`gap-0.5!`,children:[L(qe,{children:e.label}),L(q,{className:`text-xs`,children:e.description})]})]})},e.value))})})]}),L(X,{})]})},ht=({label:e,description:t,placeholder:n,orientation:r=`responsive`,tooltip:i,options:a,helperText:o,required:s=!1})=>{let c=Q(),l=Fe(),[u,d]=F(!1),f=c.state.meta.isTouched&&!c.state.meta.isValid,p=s&&c.state.value===null,m=c.state.meta.errors,h=a.find(e=>e.value===c.state.value)?.label;return R(H,{className:`gap-y-4 px-4`,children:[R(U,{orientation:r,"data-invalid":f,children:[R(W,{children:[R(K,{htmlFor:c.name,"aria-required":p,children:[e,i&&L(Y,{tooltip:i})]}),L(q,{children:t})]}),R(G,{className:`flex flex-col`,children:[l?R(Te,{children:[R(`button`,{id:c.name,type:`button`,"aria-invalid":f?`true`:void 0,onBlur:c.handleBlur,onClick:()=>d(!0),className:I(`flex w-full items-center justify-between`,`outline-1 outline-border -outline-offset-1`,`gap-2 rounded bg-transparent px-3 py-2`,`rounded shadow-input transition-all cursor-pointer whitespace-nowrap text-sm`,`focus-visible:outline-primary-strong focus-visible:ring-4 focus-visible:ring-primary-weak`,f&&`outline-danger bg-danger-bg-subtle ring-danger-weak`,!c.state.value&&`text-text-positive-muted`),children:[L(`span`,{className:`line-clamp-1`,children:h??n}),L(fe,{size:16,className:`shrink-0 opacity-50`})]}),L(ne,{open:u,onOpenChange:d,direction:`bottom`,children:R(te,{children:[L(ee,{children:L(k,{children:e??n??`Select an option`})}),L(`div`,{className:`flex flex-col overflow-y-auto pb-safe-bottom`,children:a.length>0?a.map(e=>L(A,{asChild:!0,children:L(`button`,{type:`button`,className:I(`flex w-full items-center px-4 py-3 text-left text-sm transition-colors`,`hover:bg-muted-muted active:bg-muted-muted`,c.state.value===e.value&&`bg-primary-bg-subtle font-medium text-primary`),onClick:()=>{c.handleChange(e.value),d(!1)},children:e.label})},e.value)):R(`div`,{className:`flex items-center justify-center gap-x-2 px-4 py-8 text-center text-sm text-text-positive-weak`,children:[L(ve,{strokeWidth:1}),`No options available`]})})]})})]}):R(D,{value:c.state.value??``,onValueChange:c.handleChange,children:[L(E,{"aria-invalid":f?`true`:void 0,onBlur:c.handleBlur,children:L(C,{placeholder:n})}),R(T,{children:[!!a.length&&a.map(e=>L(w,{value:e.value,children:e.label},e.value)),!a.length&&R(`div`,{className:`flex items-center justify-center gap-x-2 rounded border border-border bg-muted-muted px-4 py-6.5 text-center text-sm text-text-positive-weak`,children:[L(ve,{strokeWidth:1}),`No options available`]})]})]}),L(`div`,{className:`mt-1 flex w-full flex-col items-end justify-end`,children:L(Z,{errors:m})}),L(J,{isShow:!!o,children:o})]})]}),L(X,{})]})};function gt({className:e,...t}){return L(Pe.Root,{"data-slot":`switch`,className:I(`peer`,`w-8 shrink-0 cursor-pointer items-center rounded-full shadow-xs transition-all`,`inline-flex h-5`,`focus-visible:border-primary-strong`,`focus-visible:ring-primary-weak`,`focus-visible:ring-4`,`disabled:cursor-not-allowed`,`disabled:opacity-50`,`-outline-offset-1 inset-shadow-2xs outline-1`,`data-[state=checked]:bg-primary`,`data-[state=checked]:outline-primary-strong`,`data-[state=unchecked]:bg-muted-weak`,`data-[state=unchecked]:outline-border`,`data-[state=unchecked]:[&_span]:size-4`,`data-[state=unchecked]:[&_span]:translate-x-0.5`,`data-[state=unchecked]:[&_span]:rtl:-translate-x-0.5`,e),...t,children:L(Pe.Thumb,{"data-slot":`switch-thumb`,className:I(`block size-4 bg-card shadow-xs`,`pointer-events-none rounded-full ring-0 transition-transform`,`data-[state=checked]:translate-x-[calc(100%-3px)]`,`data-[state=unchecked]:translate-x-0`)})})}const _t=({label:e,description:t,helperText:n})=>{let r=Q();return R(H,{className:`gap-y-4 px-4`,children:[R(U,{orientation:`vertical`,className:`relative justify-between gap-y-1`,children:[R(W,{children:[L(qe,{className:`cursor-pointer`,children:L(`label`,{htmlFor:r.name,children:e})}),L(q,{children:t}),L(gt,{id:r.name,checked:r.state.value??!1,className:`absolute top-1 right-1`,onBlur:r.handleBlur,onCheckedChange:r.handleChange})]}),L(J,{isShow:!!n,children:n})]}),L(X,{})]})},vt=({label:e,description:t,placeholder:n,tooltip:r,helperText:i,counter:a=!1,orientation:o=`responsive`,showClearButton:s=!1,showErrorMessage:c=!0,required:l=!1,maxLength:u})=>{let d=N(),f=Ce(null),{form:p,name:m,state:h,handleBlur:g,handleChange:_}=Q(),y=V(p.store,({isSubmitting:e})=>e),b=s&&!y&&!!h.value,x=h.value?h.value.length:0,S=P(()=>{if(!a)return``;let e=`character${[0,1].includes(x)?``:`s`}`;return a&&u?`${x} / ${u} character${x?`s`:``}`:`${x} ${e}`},[x,a,u]),C=h.meta.isDirty&&h.meta.isTouched&&!h.meta.isValid,w=l&&h.value===null,T=u&&x>=u*.8,E=u&&x>=u,D=M(({target:{value:e}})=>{y||a&&u&&e.length>u||_(e||null)},[y,a,u,_]),O=M(()=>{y||(_(null),f.current?.focus())},[y,_]);return R(H,{className:`gap-y-4 px-4`,children:[R(U,{orientation:o,"data-invalid":C,children:[R(W,{children:[R(K,{"aria-required":w,htmlFor:d,children:[e,r&&L(Y,{tooltip:r})]}),L(q,{children:t})]}),R(G,{children:[L(v,{ref:f,id:d,name:m,value:h.value??``,"aria-invalid":C,autoComplete:`off`,placeholder:n,autoCapitalize:`none`,autoCorrect:`off`,className:I(`pr-6`,y&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:g,onChange:D}),b&&L(`button`,{type:`button`,"aria-label":`Clear`,className:`absolute inset-e-0 inset-y-0 top-3 flex h-fit w-8 cursor-pointer items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:text-text-positive-intense [&>svg]:size-3.5`,onClick:O,children:L(xe,{"aria-hidden":`true`})}),y&&L(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-muted-weak`,children:L(_e,{size:14,className:`animate-spin text-primary-strong`})}),!b&&h.meta.isDirty&&c&&!!h.meta.errors.length&&L(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-danger-strong`,children:L(ue,{"aria-hidden":`true`,size:14})}),R(`div`,{className:`my-1 flex w-full items-start justify-between gap-x-2`,children:[h.meta.isDirty&&c?L(Z,{className:`flex-1`,errors:h.meta.errors}):L(`div`,{}),!!a&&L(`p`,{className:I(`h-4 flex-0 text-nowrap text-end text-xs tabular-nums transition-colors`,E?`font-medium text-danger-strong`:T?`text-warning-strong`:`text-text-positive-weak`),children:S})]}),L(J,{isShow:!!i,children:i})]})]}),L(X,{})]})},yt=j(({label:e,description:t,placeholder:n,tooltip:r,helperText:i,counter:a=!1,orientation:o=`responsive`,showErrorMessage:s=!0,required:c=!1,maxLength:l})=>{let u=N(),{form:d,state:f,name:p,handleBlur:m,handleChange:h}=Q(),g=V(d.store,({isSubmitting:e})=>e),_=f.value?f.value.length:0,v=P(()=>{if(!a)return``;let e=`character${[0,1].includes(_)?``:`s`}`;return a&&l?`${_} / ${l} character${_?`s`:``}`:`${_} ${e}`},[_,a,l]),y=f.meta.isDirty&&f.meta.isTouched&&!f.meta.isValid,b=c&&f.value===null,x=f.meta.errors,S=l&&_>=l*.8,C=l&&_>=l,w=M(({target:{value:e}})=>{g||a&&l&&e.length>l||h(e||null)},[g,a,l,h]);return R(H,{className:`gap-y-4 px-4`,children:[R(U,{orientation:o,"data-invalid":y,children:[R(W,{children:[R(K,{"aria-required":b,htmlFor:u,children:[e,r&&L(Y,{tooltip:r})]}),L(q,{children:t})]}),R(G,{children:[L(oe,{id:u,name:p,value:f.value===null?``:f.value,"aria-invalid":y,autoCapitalize:`none`,autoComplete:`off`,placeholder:n,className:I(g&&`pointer-events-none bg-muted-muted opacity-60`),onChange:w,onBlur:m}),g&&L(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-muted-weak`,children:L(_e,{size:14,className:`animate-spin text-primary-strong`})}),f.meta.isDirty&&s&&!!x.length&&L(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-danger-strong`,children:L(ue,{size:14})}),R(`div`,{className:`my-1 flex w-full items-start justify-between gap-x-2`,children:[f.meta.isDirty&&s?L(Z,{className:`flex-1`,errors:f.meta.errors}):L(`div`,{}),!!a&&L(`p`,{className:I(`h-4 flex-0 text-nowrap text-end text-xs tabular-nums transition-colors`,C?`font-medium text-danger-strong`:S?`text-warning-strong`:`text-text-positive-weak`),children:v})]}),L(J,{isShow:!!i,children:i})]})]}),L(X,{})]})});yt.displayName=`TextareaField`;const bt=j(({label:e,description:t,placeholder:n,tooltip:r,helperText:i,showErrorMessage:a=!0,required:o=!1})=>{let{form:s,state:c,handleChange:l}=Q(),u=V(s.store,({isSubmitting:e})=>e),d=c.meta.isDirty&&c.meta.isTouched&&!c.meta.isValid,f=o&&c.value===null,p=M(e=>{u||l(e||null)},[u,l]);return R(H,{className:`gap-y-4 px-4`,children:[R(U,{orientation:`vertical`,"data-invalid":d,children:[R(W,{children:[R(K,{"aria-required":f,children:[e,r&&L(Y,{tooltip:r})]}),L(q,{children:t})]}),L(se,{value:c.value??``,placeholder:n,readOnly:u,onChange:p}),c.meta.isDirty&&a&&!!c.meta.errors.length&&L(Z,{errors:c.meta.errors}),L(J,{isShow:!!i,children:i})]}),L(X,{})]})});bt.displayName=`TextEditorField`;const xt=({label:t,className:n})=>{let r=$(),i=M(async()=>{await r.handleSubmit({submitAction:`submit`}),r.state.isSubmitSuccessful&&r.reset()},[r]);return L(r.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:r,isSubmitting:a})=>L(e,{type:`button`,size:`md`,disabled:r,isLoading:a,className:I(`min-h-8 min-w-32`,n),onClick:i,children:t??`Submit`})})},St=({type:t=`create`})=>{let n=$();return R(`div`,{className:`flex h-8 items-center justify-between`,children:[L(n.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:t})=>L(e,{color:`muted`,variant:`outline`,type:`button`,size:`md`,disabled:t,className:`h-full min-w-32`,onClick:()=>n.reset(),children:`Cancel`})}),t===`create`&&L(n.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:t,isSubmitting:r})=>R(e,{type:`submit`,size:`md`,disabled:t,isLoading:r,className:`h-full min-w-32`,onClick:async()=>{await n.handleSubmit({submitAction:`create`}),n.state.isSubmitSuccessful&&n.reset()},children:[L(ye,{}),`Add New`]})}),t===`update`&&L(n.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:t,isSubmitting:r})=>R(e,{type:`submit`,size:`md`,disabled:t,isLoading:r,className:`h-full min-w-32`,onClick:async()=>{await n.handleSubmit({submitAction:`update`}),n.state.isSubmitSuccessful&&n.reset()},children:[L(ce,{}),`Update`]})})]})};function Ct({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return L(Ne.Root,{"data-slot":`separator`,decorative:n,orientation:t,className:I(`shrink-0 bg-border-weak`,`data-[orientation=horizontal]:h-px`,`data-[orientation=horizontal]:w-full`,`data-[orientation=vertical]:h-full`,`data-[orientation=vertical]:w-px`,e),...r})}const wt=({title:t,description:n,onDelete:r,children:i})=>R(`section`,{"data-slot":`card-form`,className:`relative flex flex-col rounded-md bg-card pb-4 shadow-card ring-1 ring-border`,children:[R(`div`,{"data-slot":`card-form-header`,className:`flex flex-col space-y-0.5 px-4 py-3`,children:[L(`p`,{className:`font-semibold text-base tracking-tight`,children:t}),!!n&&L(`p`,{className:`text-text-positive-weak text-sm`,children:n})]}),L(Ct,{}),L(`div`,{"data-slot":`card-form-main`,className:`flex flex-col py-4`,children:i}),!!r&&R(e,{color:`danger`,variant:`ghost`,size:`sm`,className:`absolute top-2.5 right-3`,onClick:e=>{r?.(),e.preventDefault(),e.stopPropagation()},children:[L(be,{}),`Remove`]})]}),Tt=({children:e})=>L(`div`,{"data-slot":`section-form`,className:`flex flex-col space-y-4`,children:e}),Et=({disabled:t,className:n,onClick:r,children:i})=>L(e,{type:`button`,variant:`outline`,color:`muted`,disabled:t,className:I(`min-w-40`,n),onClick:r,children:i??`Cancel`}),Dt=({isSubmitting:t,submitText:n=`Submit`,disabled:r,className:i,onClick:a})=>L(e,{type:`button`,isLoading:t,disabled:r||t,className:I(`min-w-40`,i),onClick:a,children:n}),Ot=({title:e,submitText:t,width:n,maxWidth:r,className:a,open:d,onOpenChange:f,children:p})=>{let m=$(),h=M(e=>{e||m.reset(),f?.(e)},[m.reset,f]);return L(u,{open:d,onOpenChange:h,children:R(o,{"data-slot":`dialog-portal`,children:[L(l,{}),R(c,{style:{"--width":n,"--max-width":r},className:I(`flex size-full max-h-dvh max-w-dvw flex-col gap-0 overflow-y-auto rounded-none p-0 shadow-dialog sm:h-auto sm:max-h-[85dvh] sm:max-w-5xl sm:rounded-md`,n&&`sm:w-(--width)`,r&&`sm:max-w-(--max-width)`,a),onOpenAutoFocus:e=>{e.preventDefault()},children:[L(`div`,{"data-slot":`dialog-header`,className:`flex items-center justify-center gap-2 px-6 py-5 text-center sm:text-left`,children:L(s,{"data-slot":`dialog-title`,className:`font-semibold text-lg tracking-tight`,children:e})}),L(i,{}),L(`div`,{"data-slot":`dialog-content`,className:`relative flex flex-col overflow-y-auto p-0 pt-4 max-sm:flex-1 sm:p-4`,children:p}),L(i,{}),R(`div`,{"data-slot":`dialog-footer`,className:`flex flex-col-reverse items-center justify-end gap-2 px-6 py-4 sm:flex-row max-sm:[&>button]:w-full`,children:[L(m.Subscribe,{selector:e=>({disabled:e.isSubmitting}),children:({disabled:e})=>L(Et,{disabled:e,onClick:()=>{m.reset(),h(!1)}})}),L(m.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:n})=>L(Dt,{isSubmitting:e,disabled:n,submitText:t,onClick:()=>m.handleSubmit()})})]})]})]})})},kt=({label:e,description:t,helperText:n,orientation:r=`responsive`,children:i})=>R(H,{className:`gap-y-4 px-4`,children:[R(U,{orientation:r,children:[R(W,{children:[L(K,{children:e}),L(q,{children:t})]}),R(G,{children:[i,L(J,{isShow:!!n,children:n})]})]}),L(X,{})]}),At=({title:e,open:t,contentClassName:n,onOpenChange:r,children:i})=>{let o=$();return L(B.Root,{"data-slot":`dialog`,open:t,onOpenChange:r,children:R(B.Portal,{"data-slot":`dialog-portal`,children:[L(B.Overlay,{"data-slot":`dialog-overlay`,className:I(`fixed inset-0 z-40 bg-black/40 backdrop-blur-sm`,`data-[state=open]:animate-in data-[state=open]:fade-in`,`data-[state=closed]:animate-out data-[state=closed]:fade-out`)}),L(B.Content,{"data-slot":`dialog-content`,className:I(`fixed top-4 right-4 z-50 h-[calc(100dvh-2rem)] min-w-sm max-w-xl rounded-md bg-background shadow-lg ring-1 ring-border`,`duration-300`,`data-[state=open]:animate-in data-[state=open]:slide-in-from-right data-[state=open]:fade-in`,`data-[state=closed]:animate-out data-[state=closed]:slide-out-to-right data-[state=closed]:fade-out`),children:R(`section`,{className:`relative flex size-full flex-col`,children:[L(`header`,{className:`flex h-14 shrink-0 items-center border-b border-border px-5`,children:L(`h2`,{className:`font-semibold text-base tracking-tight text-text-positive`,children:e})}),L(`div`,{className:I(`flex flex-1 flex-col overflow-y-auto py-4`,n),children:i}),R(`div`,{className:`flex shrink-0 flex-col gap-2 border-t border-border px-4 py-3`,children:[L(o.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:t})=>L(Dt,{isSubmitting:e,disabled:t,className:`w-full`,onClick:()=>o.handleSubmit()})}),L(o.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:e})=>L(Et,{disabled:e,className:`w-full`,onClick:()=>{o.reset(),r?.(!1)}})})]}),L(B.Close,{asChild:!0,children:L(a,{className:`absolute top-2.5 right-3`})})]})})]})})},jt=({children:e})=>L(`header`,{"data-slot":`section-header`,className:`flex items-center px-4 py-3 font-semibold text-base text-text-positive tracking-tight`,children:e}),Mt=({children:e})=>L(`main`,{"data-slot":`section-main`,className:`relative flex flex-col py-4`,children:e}),Nt=({title:e,children:t})=>R(`section`,{"data-slot":`section-form`,className:`flex flex-col rounded-md bg-background shadow-card ring-1 ring-border`,children:[L(jt,{children:e}),L(Ct,{}),L(Mt,{children:t})]}),Pt=({title:e,description:t,helperText:n})=>R(H,{className:`gap-y-4 px-4`,children:[R(U,{className:`gap-0`,children:[R(W,{children:[L(Ke,{className:`mb-1`,children:e}),L(q,{children:t})]}),L(J,{isShow:!!n,children:n})]}),L(X,{})]}),{fieldContext:Ft,formContext:It,useFieldContext:Q,useFormContext:$}=Le(),{useAppForm:Lt,withForm:Rt,withFieldGroup:zt}=Ie({fieldContext:Ft,formContext:It,fieldComponents:{TextField:vt,TextareaField:yt,TextEditorField:bt,NumberField:ft,EmailField:dt,PasswordField:pt,SelectField:ht,ComboboxField:lt,DateField:ut,SwitchField:_t,RadioGroupField:mt,CheckboxField:ct,SimpleTextField:st,SimpleEmailField:Qe,SimplePasswordField:it,SimpleTextareaField:ot,SimpleNumberField:rt,SimpleSelectField:at,SimpleArrayField:Be,SimpleBooleanField:Je,SimpleComboboxField:Ye,SimpleDateField:Xe,SimpleRadioGroupField:Ze,FieldGroup:H,Field:U,FieldContent:W,FieldLabel:K,FieldContentMain:G,FieldSeparator:X,FieldError:Z},formComponents:{TanStackDialogForm:Ot,TanStackPopoverForm:At,TanStackContainerForm:Tt,TanStackSectionForm:Nt,TanStackCardForm:wt,TanStackFieldGroup:kt,TanStackTitleField:Pt,TanStackActionsForm:St,TanStackActionSubmit:xt,ArrayCol:Re,ArrayHeaderRow:ze}});export{Rt as a,G as c,K as d,X as f,zt as i,Z as l,Lt as n,U as o,$ as r,W as s,Q as t,H as u};
2
- //# sourceMappingURL=tanstack-form-Bof1jeRB.mjs.map
1
+ import{t as e}from"./button-CfPTDyoq.mjs";import{i as t,n,t as r}from"./tooltip-BfBJRYpc.mjs";import{t as i}from"./separator-C6s-YvlT.mjs";import{t as a}from"./close-B7OOMSZl.mjs";import{c as o,l as s,r as c,s as l,t as u}from"./dialog-EGFZeITu.mjs";import{a as d,i as f,o as p,r as m,s as h,t as g}from"./command-FnbrPZ7_.mjs";import{t as _}from"./checkbox-CgHaRkuU.mjs";import{t as v}from"./input-5gk-Jv1y.mjs";import{t as y}from"./label-D9uNQ9b_.mjs";import{a as b,i as x,t as S}from"./popover-DwgdOX8a.mjs";import{c as C,i as w,n as T,s as E,t as D}from"./select-BAlA65tZ.mjs";import{t as O}from"./switch-BP7EPatj.mjs";import{l as k,n as A,o as ee,r as te,t as ne}from"./drawer-CMD7JWH8.mjs";import{t as re}from"./calendar-BDhIfwPP.mjs";import{n as ie,t as ae}from"./radio-group-Y9bhdr55.mjs";import{t as oe}from"./textarea-7HDXcaK9.mjs";import{t as se}from"./text-editor-HGUUElOS.mjs";import{ArrowDownToLine as ce,AtSignIcon as le,BanIcon as ue,CalendarDaysIcon as de,ChevronDownIcon as fe,EyeIcon as pe,EyeOffIcon as me,HelpCircleIcon as he,InfoIcon as ge,Loader2Icon as _e,PackagePlusIcon as ve,PlusIcon as ye,Trash2Icon as be,XIcon as xe}from"lucide-react";import{memo as j,useCallback as M,useEffect as Se,useId as N,useMemo as P,useRef as Ce,useState as F}from"react";import{cn as I}from"@customafk/react-toolkit/utils";import{cva as we}from"class-variance-authority";import{Fragment as Te,jsx as L,jsxs as R}from"react/jsx-runtime";import{endOfToday as z,endOfTomorrow as Ee,endOfYesterday as De,format as Oe,lastDayOfMonth as ke,startOfMonth as Ae,subDays as je}from"@customafk/react-toolkit/date-fns";import{Dialog as B,Label as Me,Separator as Ne,Switch as Pe}from"radix-ui";import{useIsMobile as Fe}from"@customafk/react-toolkit/hooks/useMobile";import{createFormHook as Ie,createFormHookContexts as Le,useStore as V}from"@tanstack/react-form";function Re({width:e,className:t,children:n}){let r=e?{width:typeof e==`number`?`${e}px`:e,flexShrink:0}:{flex:1,minWidth:0};return L(`div`,{"data-slot":`array-col`,style:r,className:t,children:n})}function ze({className:e,children:t}){return R(`div`,{"data-slot":`array-header-row`,className:I(`mb-1 flex items-center gap-2 px-1 text-xs font-medium text-text-positive-weak`,e),children:[t,L(`div`,{className:`min-w-8 w-8 shrink-0`})]})}function Be({defaultRow:t,children:n,addLabel:r=`Add row`,className:i}){let a=Q(),o=a.state.value??[],s=M(()=>{a.pushValue({...t})},[a,t]),c=M(e=>{a.removeValue(e)},[a]);return R(`div`,{"data-slot":`simple-array-field`,className:I(`flex flex-col gap-2`,i),children:[o.map((t,r)=>R(`div`,{className:`flex items-start gap-2`,children:[n(r),L(e,{type:`button`,size:`icon`,variant:`ghost`,color:`danger`,className:`min-w-8`,onClick:()=>c(r),children:L(be,{size:14})})]},r)),L(`div`,{children:R(e,{type:`button`,variant:`outline`,color:`muted`,size:`xs`,onClick:s,children:[L(ye,{size:13}),r]})})]})}const Ve=we([`flex w-fit items-center justify-center rounded-full font-bold text-text-negative-strong`],{variants:{color:{default:`bg-primary-strong`,secondary:`bg-secondary-strong`,success:`bg-success-strong`,info:`bg-info-strong`,warning:`bg-warning-strong`,danger:`border border-danger-strong bg-linear-to-b from-danger-strong/90 via-danger-strong to-danger-strong/90`},size:{xs:`px-1.5 py-0.5 text-xs`,sm:`px-2 py-0.75 text-xs`,md:`px-2.5 py-0.75 text-sm`,lg:`px-3 py-1 text-sm`}},defaultVariants:{color:`default`,size:`sm`}}),He=({label:e,color:t,size:n,className:r,children:i})=>L(`div`,{"data-slot":`required-indicator`,className:Ve({color:t,size:n,className:r}),children:e||i});function Ue({className:e,children:t,...n}){return R(Me.Root,{"data-slot":`label`,className:I(`text-text-positive`,`flex w-full items-center justify-between`,`select-none font-medium text-sm/6 leading-none`,`group-data-[disabled=true]:pointer-events-none`,`group-data-[disabled=true]:opacity-50`,`peer-disabled:cursor-not-allowed`,`peer-disabled:opacity-50`,`aria-required:*:data-[slot=required-indicator]:inline-block`,e),...n,children:[L(`span`,{className:`flex items-center gap-1`,children:t}),L(He,{label:`Required`,color:`danger`,size:`xs`,className:`hidden shrink-0`})]})}const We=we(`group/field flex w-full gap-2 data-[invalid=true]:text-danger *:data-[slot=field-content]:gap-0`,{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:gap-4`,`@md/field-group:*:w-auto`,`@md/field-group:*:data-[slot=field-content]:basis-1/2`,`@md/field-group:*:data-[slot=field-content-main]:basis-1/2`,`@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`}}),Ge=j(({className:e,...t})=>L(`fieldset`,{"data-slot":`field-set`,className:I(`flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,e),...t}));Ge.displayName=`FieldSet`;const Ke=j(({className:e,variant:t=`legend`,...n})=>L(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:I(`mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,e),...n}));Ke.displayName=`FieldLegend`;const H=j(({className:e,...t})=>L(`div`,{"data-slot":`field-group`,className:I(`group/field-group @container/field-group`,`flex flex-col gap-7 pt-4`,`data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,e),...t}));H.displayName=`FieldGroup`;const U=j(({className:e,orientation:t=`vertical`,...n})=>L(`div`,{"data-slot":`field`,"data-orientation":t,className:I(We({orientation:t}),e),...n}));U.displayName=`Field`;const W=j(({className:e,...t})=>L(`div`,{"data-slot":`field-content`,className:I(`group/field-content flex flex-col gap-1.5 leading-snug`,e),...t}));W.displayName=`FieldContent`;const G=j(({className:e,...t})=>L(`div`,{"data-slot":`field-content-main`,className:I(`relative`,e),...t}));G.displayName=`FieldContentMain`;const K=j(({className:e,...t})=>L(Ue,{"data-slot":`field-label`,className:I(`group/field-label peer/field-label min-h-6 gap-1 font-medium leading-snug`,`has-[>[data-slot=field]]:w-full`,`has-[>[data-slot=field]]:flex-col`,`has-[>[data-slot=field]]:rounded-md`,`has-[>[data-slot=field]]:border`,`has-[>[data-slot=field]]:border-border`,`has-data-[state=checked]:border-primary`,`*:data-[slot=field]:p-4 group-data-[disabled=true]/field:opacity-50`,e),...t}));K.displayName=`FieldLabel`;const qe=j(({className:e,...t})=>L(`div`,{"data-slot":`field-label`,className:I(`flex w-fit items-center gap-2 font-medium text-sm leading-snug group-data-[disabled=true]/field:opacity-50`,e),...t}));qe.displayName=`FieldTitle`;const q=j(({className:e,...t})=>L(`p`,{"data-slot":`field-description`,className:I(`nth-last-2:-mt-1 font-normal text-text-positive-weak text-xs leading-normal last:mt-0 [&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4 [[data-variant=legend]+&]:-mt-1.5`,e),...t}));q.displayName=`FieldDescription`;const J=j(({isShow:e=!0,className:t,children:n,...r})=>e===!1?null:R(`div`,{"data-slot":`field-note`,className:I(`flex items-start gap-1.5 rounded border border-primary-muted/60 bg-primary-bg-subtle/80 px-2.5 py-2 text-text-positive-weak text-xs`,t),...r,children:[L(ge,{size:12,className:`mt-0.5 shrink-0 text-primary/70`}),L(`span`,{children:n})]}));J.displayName=`FieldNote`;const Y=j(({tooltip:e})=>R(r,{children:[L(t,{asChild:!0,children:R(`button`,{type:`button`,tabIndex:-1,className:`inline-flex cursor-default items-center text-text-positive-weak/70 hover:text-text-positive focus:outline-none`,children:[L(he,{size:13,"aria-hidden":`true`}),L(`span`,{className:`sr-only`,children:`More information`})]})}),L(n,{side:`top`,className:`max-w-xs text-balance`,children:e})]}));Y.displayName=`FieldTooltip`;const X=j(({children:e,className:t,...n})=>R(`div`,{"data-slot":`field-separator`,"data-content":!!e,className:I(`relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2`,t),...n,children:[L(i,{className:`absolute inset-0 top-1/2`}),e&&L(`span`,{className:`relative mx-auto block w-fit bg-background px-2 text-text-positive-weak`,"data-slot":`field-separator-content`,children:e})]}));X.displayName=`FieldSeparator`;const Z=j(({className:e,children:t,errors:n,...r})=>{let i=P(()=>t||(n?n?.length===1&&n[0]?.message?L(`div`,{className:`flex flex-row items-center justify-start gap-x-0.5`,children:L(`p`,{children:n[0]?.code===`invalid_type`?`Invalid format`:n[0].message})}):L(`ul`,{className:`flex list-none flex-col`,children:n.map(e=>typeof e==`string`?L(`li`,{children:e},e):e?.message?L(`li`,{children:e.message},e.message):null)}):null),[t,n]);return i?L(`div`,{role:`alert`,"data-slot":`field-error`,className:I(`w-full font-medium text-danger-strong text-xs`,e),...r,children:i}):null});Z.displayName=`FieldError`;const Je=({label:e,required:t,disabled:n,variant:r=`checkbox`})=>{let i=N(),{form:a,name:o,state:s,handleBlur:c,handleChange:l}=Q(),u=V(a.store,({isSubmitting:e})=>e),d=s.meta.isTouched&&!s.meta.isValid,f=s.value??!1,p=n||u,m=M(e=>{u||l(e)},[u,l]);return R(`div`,{className:`flex flex-col gap-1.5`,children:[R(`div`,{className:`flex items-center gap-2 h-9`,children:[L(r===`switch`?O:_,{id:i,name:o,checked:f,disabled:p,"aria-invalid":d,onBlur:c,onCheckedChange:m}),e&&R(y,{htmlFor:i,className:`cursor-pointer`,children:[e,t&&L(`span`,{className:`text-danger-strong`,children:`*`})]})]}),d&&L(Z,{errors:s.meta.errors})]})},Ye=({label:t,placeholder:n,required:r,disabled:i,options:a})=>{let o=N(),{form:s,name:c,state:l,handleBlur:u,handleChange:_}=Q(),v=V(s.store,({isSubmitting:e})=>e),C=Fe(),[w,T]=F(!1),E=l.meta.isTouched&&!l.meta.isValid,D=i||v,O=a.find(({value:e})=>e===l.value)?.label,A=R(g,{children:[L(d,{placeholder:n??`Search…`}),R(h,{children:[L(m,{children:`No results found.`}),L(f,{children:a.map(e=>L(p,{value:e.label,onSelect:()=>{_(e.value===l.value?null:e.value),T(!1)},children:e.label},e.value))})]})]});return C?R(`div`,{className:`flex flex-col gap-1.5`,children:[t&&R(y,{htmlFor:o,children:[t,r&&L(`span`,{className:`text-danger-strong`,children:`*`})]}),L(e,{id:o,type:`button`,variant:`outline`,color:`muted`,disabled:D,"aria-invalid":E,className:I(`w-full justify-start font-normal outline-1 outline-border -outline-offset-1`,!l.value&&`text-text-positive-muted`,E&&`outline-danger bg-danger-bg-subtle`),onBlur:u,onClick:()=>T(!0),children:O??L(`span`,{className:`text-text-positive-muted`,children:n})}),L(ne,{open:w,onOpenChange:T,direction:`bottom`,children:R(te,{children:[L(ee,{children:L(k,{children:t??n??`Search…`})}),L(`div`,{className:`overflow-y-auto pb-safe-bottom`,children:A})]})}),E&&L(Z,{errors:l.meta.errors})]}):R(`div`,{className:`flex flex-col gap-1.5`,children:[t&&R(y,{htmlFor:o,children:[t,r&&L(`span`,{className:`text-danger-strong`,children:`*`})]}),R(S,{children:[L(b,{asChild:!0,children:L(e,{id:o,variant:`outline`,color:`muted`,size:`lg`,disabled:D,"aria-invalid":E,className:I(`flex w-full items-center justify-start rounded outline-border font-normal`,`hover:bg-transparent`,`focus:outline-1 focus:outline-primary-strong focus:ring-4 focus:ring-primary-weak`,`data-[state=open]:outline-1 data-[state=open]:outline-primary-strong data-[state=open]:ring-4 data-[state=open]:ring-primary-weak`,!l.value&&`text-text-positive-muted`),children:O??L(`span`,{className:`text-text-positive-muted`,children:n})})}),L(x,{align:`start`,side:`bottom`,className:`w-[--radix-popover-trigger-width] p-0 rounded`,onBlur:u,children:A})]}),E&&L(Z,{errors:l.meta.errors})]})},Xe=({label:t,placeholder:n,required:r,disabled:i,minDate:a,maxDate:o})=>{let s=N(),{form:c,name:l,state:u,handleBlur:d,handleChange:f}=Q(),p=V(c.store,({isSubmitting:e})=>e),m=u.meta.isTouched&&!u.meta.isValid;return R(`div`,{className:`flex flex-col gap-1.5`,children:[t&&R(y,{htmlFor:s,children:[t,r&&L(`span`,{className:`text-danger-strong`,children:`*`})]}),R(S,{children:[L(b,{asChild:!0,children:R(e,{id:s,variant:`outline`,color:`muted`,size:`lg`,disabled:i||p,"aria-invalid":m,className:I(`flex w-full items-center justify-between rounded outline-border font-normal`,`hover:bg-transparent`,`focus:outline-1 focus:outline-primary-strong focus:ring-4 focus:ring-primary-weak`,`data-[state=open]:outline-1 data-[state=open]:outline-primary-strong data-[state=open]:ring-4 data-[state=open]:ring-primary-weak`,u.value===null&&`text-text-positive-muted`),children:[L(`span`,{children:u.value?Oe(u.value,`PPP`):n??`Select date`}),L(de,{strokeWidth:1})]})}),L(x,{align:`start`,side:`bottom`,className:`w-fit p-0 rounded`,onBlur:d,children:L(re,{mode:`single`,selected:u.value??void 0,hidden:{before:a??new Date(1900,0,1),after:o??new Date(2100,11,31)},onSelect:e=>{e&&f(e)}})})]}),m&&L(Z,{errors:u.meta.errors})]})},Ze=({label:e,required:t,disabled:n,options:r,orientation:i=`vertical`})=>{let{form:a,name:o,state:s,handleBlur:c,handleChange:l}=Q(),u=V(a.store,({isSubmitting:e})=>e),d=s.meta.isTouched&&!s.meta.isValid,f=n||u;return R(`div`,{className:`flex flex-col gap-1.5`,children:[e&&R(y,{children:[e,t&&L(`span`,{className:`text-danger-strong`,children:`*`})]}),L(ae,{name:o,value:s.value??``,disabled:f,"aria-invalid":d,className:i===`horizontal`?`flex flex-row flex-wrap gap-x-4 gap-y-2`:`flex flex-col gap-2`,onValueChange:l,onBlur:c,children:r.map(e=>R(`div`,{className:`flex items-center gap-2`,children:[L(ie,{id:`${o}-${e.value}`,value:e.value}),L(y,{htmlFor:`${o}-${e.value}`,className:`cursor-pointer font-normal`,children:e.label})]},e.value))}),d&&L(Z,{errors:s.meta.errors})]})},Qe=({label:e,placeholder:t,required:n,maxLength:r,disabled:i})=>{let a=N(),{form:o,name:s,state:c,handleBlur:l,handleChange:u}=Q(),d=V(o.store,({isSubmitting:e})=>e),f=c.meta.isTouched&&!c.meta.isValid,p=M(({target:{value:e}})=>{d||r&&e.length>r||u(e||null)},[d,r,u]);return R(`div`,{className:`flex flex-col gap-1.5`,children:[e&&R(y,{htmlFor:a,children:[e,n&&L(`span`,{className:`text-danger-strong`,children:`*`})]}),R(`div`,{className:`relative`,children:[L(v,{id:a,name:s,type:`email`,value:c.value??``,"aria-invalid":f,autoComplete:`email`,placeholder:t,disabled:i||d,className:I(`pl-9`),onBlur:l,onChange:p}),L(`div`,{className:`pointer-events-none absolute inset-y-0 left-0 flex size-9 items-center justify-center text-muted`,children:L(le,{size:14})})]}),f&&L(Z,{errors:c.meta.errors})]})},$e=e=>e?/^-?\d*\.?\d*$/:/^\d*\.?\d*$/,et=e=>Number(e).toLocaleString(),tt=(e,t,n)=>{if(n===`none`)return e;let r=10**t,i=e*r;switch(n){case`up`:return Math.ceil(i)/r;case`down`:return Math.floor(i)/r;case`nearest`:return i%1<.1?Math.floor(i)/r:i%1>=.59?Math.ceil(i)/r:(Math.floor(i)+.5)/r;default:return e}},nt=({disabled:e=!1,readOnly:t=!1,allowNegative:n=!1,numberAfterDecimalPoint:r=2,roundingRule:i=`none`,value:a=null,unitText:o,decimal:s,placeholder:c,precision:l,wrapperClassName:u,className:d,onChange:f,onValueChange:p,onFocus:m,onBlur:h,...g})=>{let _=Ce(null),y=Ce(null),[b,x]=F(a?.toString()??null),S=P(()=>s?.[1]??r,[s,r]),C=P(()=>s&&s[0]-s[1],[s]),w=P(()=>$e(n),[n]),T=M(e=>{if(!S||e===`-`)return!0;let[t,n=``]=e.split(`.`),r=t.startsWith(`-`)?t.length-1:t.length;return n.length<=S&&r<=(C??1/0)},[S,C]),E=M(e=>{if(e===`0`)return`0`;if(!Number(e))return null;let[t,n=``]=tt(parseFloat(e),Math.min(S-1,l||0),i).toString().split(`.`),r=et(t);return n?`${r}.${n}`:r},[S,l,i]),D=M(e=>{let t=e===`0`,n=e===`-`||/^-0+(\.0+)?$/.test(e)||/^-0*\.$/.test(e);if(t){p?.(0),x(e);return}if(n){x(()=>(p?.(0),e));return}},[p]),O=M(e=>{f?.(e);let{value:t}=e.target;if(t===``||t===void 0){p?.(null),x(null);return}D(t),!(!w.test(t)||!T(t))&&(p?.(parseFloat(t)||0),x(t))},[T,f,p,D,w]),k=M(e=>{t||(m?.(e),x(e=>typeof e==`string`?e.replace(/,/g,``):null))},[t,m]),A=M(e=>{t||(h?.(e),x(e=>e===null?null:e===`0`||e===`-`||/^-0+(\.0+)?$/.test(e)||/^-0*\.$/.test(e)?`0`:typeof e==`string`?E(e):null))},[t,E,h]);return Se(()=>{let e=document.activeElement===y.current;if(a==null||!w.test(a.toString())||!T(a.toString())){x(null);return}x(t=>e?t:E(a.toString()))},[E,a,T,w]),Se(()=>{if(!_.current||!y.current||!o)return;let e=_.current.offsetWidth;y.current.style.setProperty(`padding-right`,`${(e+10)/16}rem`)},[o]),R(`div`,{className:I(`relative`,u),children:[L(v,{...g,ref:y,value:b||(t?`0`:``),placeholder:c,disabled:e,readOnly:t,className:I(`text-end font-number text-sm slashed-zero lining-nums tabular-nums`,t&&`bg-muted text-muted-foreground`,d),onChange:O,onFocus:k,onBlur:A}),o&&L(`span`,{ref:_,className:`-translate-y-1/2 pointer-events-none absolute top-1/2 right-2 text-muted-foreground text-sm`,children:o})]})},rt=({label:e,placeholder:t,required:n,unit:r,allowNegative:i,disabled:a})=>{let o=N(),{form:s,state:c,handleBlur:l,handleChange:u}=Q(),d=V(s.store,({isSubmitting:e})=>e),f=c.meta.isTouched&&!c.meta.isValid,p=M(e=>{d||u(e)},[d,u]);return R(`div`,{className:`flex flex-col gap-1.5`,children:[e&&R(y,{htmlFor:o,children:[e,n&&L(`span`,{className:`text-danger-strong`,children:`*`})]}),L(nt,{id:o,value:c.value,placeholder:t,unitText:r,allowNegative:i,disabled:a||d,onBlur:l,onValueChange:p}),f&&L(Z,{errors:c.meta.errors})]})},it=({label:e,placeholder:t,required:n,disabled:r})=>{let i=N(),{form:a,name:o,state:s,handleBlur:c,handleChange:l}=Q(),u=V(a.store,({isSubmitting:e})=>e),[d,f]=F(!1),p=s.meta.isTouched&&!s.meta.isValid,m=M(()=>f(e=>!e),[]),h=M(({target:{value:e}})=>{u||l(e||null)},[u,l]);return R(`div`,{className:`flex flex-col gap-1.5`,children:[e&&R(y,{htmlFor:i,children:[e,n&&L(`span`,{className:`text-danger-strong`,children:`*`})]}),R(`div`,{className:`relative`,children:[L(v,{id:i,name:o,type:d?`text`:`password`,value:s.value??``,"aria-invalid":p,autoComplete:`current-password`,placeholder:t,disabled:r||u,className:`pr-9`,onBlur:c,onChange:h}),L(`button`,{type:`button`,tabIndex:-1,"aria-label":d?`Hide password`:`Show password`,"aria-pressed":d,"aria-controls":i,className:`absolute inset-y-0 right-0 flex size-9 items-center justify-center text-muted outline-none transition-colors hover:text-text-positive focus-visible:text-text-positive disabled:pointer-events-none disabled:opacity-50`,disabled:r||u,onClick:m,children:L(d?me:pe,{size:16,"aria-hidden":`true`})})]}),p&&L(Z,{errors:s.meta.errors})]})},at=({label:t,placeholder:n,required:r,options:i})=>{let a=N(),{state:o,handleBlur:s,handleChange:c}=Q(),l=Fe(),[u,d]=F(!1),f=o.meta.isTouched&&!o.meta.isValid,p=i.find(e=>e.value===o.value)?.label;return l?R(`div`,{className:`flex flex-col gap-1.5`,children:[t&&R(y,{htmlFor:a,children:[t,r&&L(`span`,{className:`text-danger-strong`,children:`*`})]}),L(e,{id:a,type:`button`,variant:`outline`,color:`muted`,className:I(`w-full justify-start font-normal outline-1 outline-border -outline-offset-1`,!o.value&&`text-text-positive-muted`,f&&`outline-danger bg-danger-bg-subtle`),"aria-invalid":f,onBlur:s,onClick:()=>d(!0),children:p??L(`span`,{className:`text-text-positive-muted`,children:n})}),L(ne,{open:u,onOpenChange:d,direction:`bottom`,children:R(te,{children:[L(ee,{children:L(k,{children:t??n??`Select an option`})}),L(`div`,{className:`flex flex-col overflow-y-auto pb-safe-bottom`,children:i.length>0?i.map(e=>L(A,{asChild:!0,children:L(`button`,{type:`button`,className:I(`flex w-full items-center px-4 py-3 text-left text-sm transition-colors`,`hover:bg-muted-muted active:bg-muted-muted`,o.value===e.value&&`bg-primary-bg-subtle font-medium text-primary`),onClick:()=>{c(e.value),d(!1)},children:e.label})},e.value)):R(`div`,{className:`flex items-center justify-center gap-x-2 px-4 py-8 text-center text-sm text-text-positive-weak`,children:[L(ve,{strokeWidth:1}),`No options available`]})})]})}),f&&L(Z,{errors:o.meta.errors})]}):R(`div`,{className:`flex flex-col gap-1.5`,children:[t&&R(y,{htmlFor:a,children:[t,r&&L(`span`,{className:`text-danger-strong`,children:`*`})]}),R(D,{value:o.value??``,onValueChange:c,children:[L(E,{id:a,"aria-invalid":f?`true`:void 0,onBlur:s,children:L(C,{placeholder:n})}),L(T,{children:i.length>0?i.map(e=>L(w,{value:e.value,children:e.label},e.value)):R(`div`,{className:`flex items-center justify-center gap-x-2 rounded border border-border bg-muted-muted px-4 py-6.5 text-center text-sm text-text-positive-weak`,children:[L(ve,{strokeWidth:1}),`No options available`]})})]}),f&&L(Z,{errors:o.meta.errors})]})},ot=({label:e,placeholder:t,required:n,maxLength:r,rows:i,disabled:a})=>{let o=N(),{form:s,name:c,state:l,handleBlur:u,handleChange:d}=Q(),f=V(s.store,({isSubmitting:e})=>e),p=l.meta.isTouched&&!l.meta.isValid,m=M(({target:{value:e}})=>{f||r&&e.length>r||d(e||null)},[f,r,d]);return R(`div`,{className:`flex flex-col gap-1.5`,children:[e&&R(y,{htmlFor:o,children:[e,n&&L(`span`,{className:`text-danger-strong`,children:`*`})]}),L(oe,{id:o,name:c,value:l.value??``,"aria-invalid":p,placeholder:t,rows:i,disabled:a||f,onBlur:u,onChange:m}),p&&L(Z,{errors:l.meta.errors})]})},st=({label:e,placeholder:t,required:n,maxLength:r,disabled:i})=>{let a=N(),{form:o,name:s,state:c,handleBlur:l,handleChange:u}=Q(),d=V(o.store,({isSubmitting:e})=>e),f=c.meta.isTouched&&!c.meta.isValid,p=M(({target:{value:e}})=>{d||r&&e.length>r||u(e||null)},[d,r,u]);return R(`div`,{className:`flex flex-col gap-1.5`,children:[e&&R(y,{htmlFor:a,children:[e,n&&L(`span`,{className:`text-danger-strong`,children:`*`})]}),L(v,{id:a,name:s,value:c.value??``,"aria-invalid":f,placeholder:t,autoComplete:`off`,disabled:i||d,onBlur:l,onChange:p}),f&&L(Z,{errors:c.meta.errors})]})},ct=({label:e,description:t,options:n,tooltip:r,helperText:i,orientation:a})=>{let o=Q(),s=V(o.form.store,({isSubmitting:e})=>e);return R(H,{className:`gap-y-4 px-4`,children:[R(U,{orientation:a,children:[R(W,{children:[R(K,{children:[e,r&&L(Y,{tooltip:r})]}),L(q,{children:t}),L(J,{isShow:!!i,children:i})]}),L(G,{children:L(H,{className:`flex flex-col gap-y-2`,children:n.map(e=>R(U,{orientation:`horizontal`,children:[L(_,{id:`${o.name}-${e.value}`,name:o.name,checked:o.state.value?.includes(e.value)??!1,disabled:s,onCheckedChange:t=>{if(t&&o.state.value!==null)o.pushValue(e.value);else if(t&&o.state.value===null)o.setValue([e.value]);else if(!t&&o.state.value!==null){let t=o.state.value.indexOf(e.value);t>-1&&o.removeValue(t)}else o.setValue(null)}}),L(K,{htmlFor:`${o.name}-${e.value}`,className:`text-text-positive`,children:e.label})]},e.value))})})]}),L(X,{})]})},lt=({label:t,description:n,placeholder:r,tooltip:i,orientation:a=`responsive`,options:o})=>{let s=Q(),c=Fe(),[l,u]=F(!1),_=P(()=>s.state.meta.isTouched&&!s.state.meta.isValid,[s.state.meta.isTouched,s.state.meta.isValid]),v=P(()=>s.state.meta.errors,[s.state.meta.errors]),y=o.find(({value:e})=>e===s.state.value)?.label,C=t=>L(e,{variant:`outline`,color:`muted`,size:`lg`,className:I(`flex items-center justify-start rounded outline-border`,`hover:bg-transparent`,`focus:outline-1 focus:outline-primary-strong focus:ring-4 focus:ring-primary-weak`,`data-[state=open]:text-text-positive-muted data-[state=open]:outline-1 data-[state=open]:outline-primary-strong data-[state=open]:ring-4 data-[state=open]:ring-primary-weak`,!s.state.value&&`text-text-positive-muted`),onClick:t,children:y?L(`p`,{className:`flex min-w-0 flex-1 items-center gap-2 text-start`,children:y}):L(`p`,{className:`flex-1 text-start text-text-positive-muted`,children:r})}),w=R(g,{className:`border-none`,children:[L(d,{placeholder:r??`Search…`}),L(h,{children:L(f,{className:`max-h-60 overflow-y-auto`,children:o.map(({value:e,label:t})=>L(p,{value:t,onSelect:()=>{s.handleChange(e),u(!1)},children:t},e))})}),L(m,{className:`flex min-h-30 items-center justify-center text-sm text-text-positive-weak`,children:`Không tìm thấy kết quả nào phù hợp.`})]});return R(H,{className:`px-4`,children:[R(U,{orientation:a,"data-invalid":_,children:[R(W,{children:[R(K,{htmlFor:s.name,children:[t,i&&L(Y,{tooltip:i})]}),L(q,{children:n})]}),L(G,{className:`flex justify-end`,children:R(`div`,{className:`flex w-full flex-col`,children:[c?R(Te,{children:[C(()=>u(!0)),L(ne,{open:l,onOpenChange:u,direction:`bottom`,children:R(te,{children:[L(ee,{children:L(k,{children:t})}),L(`div`,{className:`overflow-y-auto pb-safe-bottom`,children:w})]})})]}):R(S,{children:[L(b,{asChild:!0,children:C()}),L(x,{align:`end`,side:`bottom`,className:`flex w-fit rounded p-0`,onBlur:s.handleBlur,children:w})]}),L(`div`,{className:`mt-1 flex w-full flex-col items-end justify-end`,children:L(Z,{errors:v})})]})})]}),L(X,{})]})},ut=({label:t,description:n,placeholder:r,orientation:i=`responsive`,tooltip:a,helperText:o,minDate:s,maxDate:c,required:l})=>{let u=Q(),d=P(()=>l?u.state.value===null:!1,[l,u.state.value]),f=P(()=>u.state.meta.isTouched&&!u.state.meta.isValid,[u.state.meta.isTouched,u.state.meta.isValid]);return R(H,{className:`px-4`,children:[R(U,{orientation:i,"data-invalid":f,children:[R(W,{children:[R(K,{htmlFor:u.name,"aria-required":d,children:[t,a&&L(Y,{tooltip:a})]}),L(q,{children:n})]}),R(G,{className:`flex flex-col space-y-1`,children:[L(`div`,{className:`flex w-full flex-col`,children:R(S,{children:[L(b,{asChild:!0,children:R(e,{variant:`outline`,color:`muted`,size:`lg`,className:I(`flex items-center justify-between rounded font-normal outline-border`,`hover:bg-transparent`,`focus:outline-1 focus:outline-primary-strong focus:ring-4 focus:ring-primary-weak`,`data-[state=open]:text-text-positive-muted`,`data-[state=open]:outline-1`,`data-[state=open]:outline-primary-strong`,`data-[state=open]:ring-4`,`data-[state=open]:ring-primary-weak`,u.state.value===null&&`text-text-positive-muted`),children:[L(`p`,{children:u.state.value===null?r||`Select date`:Oe(u.state.value,`PPPP`)}),L(de,{strokeWidth:1})]})}),R(x,{align:`start`,side:`bottom`,className:`flex w-fit min-w-0 overflow-y-auto rounded p-0`,onBlur:u.handleBlur,children:[R(`div`,{className:`flex h-full flex-col space-y-2 border-r border-r-border p-2 [&>button]:justify-start [&>button]:text-sm`,children:[L(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{u.handleChange(z())},children:`Today`}),L(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{u.handleChange(Ee())},children:`Tomorrow`}),L(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{u.handleChange(De())},children:`Yesterday`}),L(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{u.handleChange(je(z(),3))},children:`Last 3 Days`}),L(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{u.handleChange(je(z(),7))},children:`Last 7 Days`}),L(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{u.handleChange(je(z(),30))},children:`Last 30 Days`}),L(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{u.handleChange(Ae(z()))},children:`This Month`}),L(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{u.handleChange(ke(z()))},children:`Last Month`})]}),L(`div`,{className:`flex flex-1 flex-col`,children:L(`div`,{className:`min-w-73 border-b border-b-border p-2`,children:L(re,{mode:`single`,selected:u.state.value??void 0,hidden:{before:s??new Date(1900,0,1),after:c??new Date(2100,11,31)},onSelect:e=>{e&&u.handleChange(e)}})})})]})]})}),L(J,{isShow:!!o,children:o})]})]}),L(X,{})]})},dt=({label:e,description:t,placeholder:n,tooltip:r,helperText:i,orientation:a=`responsive`,showErrorMessage:o=!0,required:s=!1,maxLength:c})=>{let{form:l,name:u,state:d,handleBlur:f,handleChange:p}=Q(),m=V(l.store,({isSubmitting:e})=>e),h=d.meta.isDirty&&d.meta.isTouched&&!d.meta.isValid,g=s&&d.value===null,_=!m&&!!d.value,y=M(({target:{value:e}})=>{m||c&&e.length>c||p(e||null)},[m,c,p]),b=M(()=>{m||p(null)},[m,p]);return R(H,{className:`gap-y-4 px-4`,children:[R(U,{"data-invalid":h,orientation:a,children:[R(W,{children:[R(K,{htmlFor:u,"aria-required":g,children:[e,r&&L(Y,{tooltip:r})]}),L(q,{children:t})]}),R(G,{children:[L(v,{id:u,name:u,value:d.value===null?``:d.value,"aria-invalid":h,autoComplete:`email`,placeholder:n,className:I(`pl-9`,_&&`pr-9`,m&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:f,onChange:y}),L(`div`,{className:`absolute top-0 left-0 flex size-9 items-center justify-center text-muted`,children:L(le,{size:14})}),_&&L(`button`,{type:`button`,"aria-label":`Clear`,className:`absolute inset-e-0 inset-y-0 top-3 flex h-fit w-8 cursor-pointer items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:text-text-positive-strong`,onClick:b,children:L(xe,{size:14,"aria-hidden":`true`})}),L(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:o&&d.meta.isDirty&&L(Z,{errors:d.meta.errors})}),L(J,{isShow:!!i,children:i})]})]}),L(X,{})]})},ft=({label:e,description:t,placeholder:n,tooltip:r,helperText:i,orientation:a=`responsive`,showErrorMessage:o=!0,rounding:s,decimalPlaces:c,percision:l,unit:u,required:d,allowNegative:f})=>{let p=Q(),m=V(p.form.store,({isSubmitting:e})=>e),h=p.state.meta.errors,g=d?p.state.value===null:!1,_=M(e=>{m||p.handleChange(e)},[m,p.handleChange]);return R(H,{className:`gap-y-4 px-4`,children:[R(U,{orientation:a,"data-invalid":p.state.meta.isTouched&&!p.state.meta.isValid,children:[R(W,{children:[R(K,{htmlFor:p.name,"aria-required":g,children:[e,r&&L(Y,{tooltip:r})]}),L(q,{children:t})]}),R(G,{children:[R(`div`,{className:`relative w-full`,children:[L(nt,{id:p.name,value:p.state.value,"aria-invalid":p.state.meta.isTouched&&!p.state.meta.isValid&&p.state.meta.isDirty,placeholder:n,roundingRule:s,numberAfterDecimalPoint:c,precision:l,unitText:u,allowNegative:f,className:I(m&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:p.handleBlur,onValueChange:_}),m&&L(`div`,{className:`absolute inset-s-2 inset-y-0 top-2.5 text-muted-weak [&>svg]:size-3.5`,children:L(_e,{className:`animate-spin text-primary-strong`})}),p.state.meta.isDirty&&o&&!!h.length&&L(`div`,{className:`absolute inset-s-2 inset-y-0 top-2.75 text-danger-strong [&>svg]:size-3.5`,children:L(ue,{})}),L(`div`,{className:`mt-1 flex w-full flex-col items-end justify-end`,children:p.state.meta.isDirty&&o&&L(Z,{errors:h})})]}),L(J,{isShow:!!i,children:i})]})]}),L(X,{})]})},pt=({label:e,description:t,placeholder:n,orientation:r=`responsive`,tooltip:i,helperText:a,showErrorMessage:o=!0})=>{let s=N(),{form:c,name:l,state:u,handleBlur:d,handleChange:f}=Q(),p=V(c.store,({isSubmitting:e})=>e),[m,h]=F(!1),g=u.meta.isDirty&&u.meta.isTouched&&!u.meta.isValid,_=M(()=>h(e=>!e),[]),y=M(({target:{value:e}})=>{p||f(e||null)},[p,f]);return R(H,{className:`gap-y-4 px-4`,children:[R(U,{"data-invalid":g,orientation:r,children:[R(W,{children:[R(K,{htmlFor:s,children:[e,i&&L(Y,{tooltip:i})]}),L(q,{children:t})]}),R(G,{children:[L(v,{id:s,name:l,type:m?`text`:`password`,placeholder:n,value:u.value??``,"aria-invalid":g,autoComplete:`new-password`,onBlur:d,onChange:y}),L(`button`,{className:`absolute inset-e-0 inset-y-0 flex size-9 items-center justify-center rounded-e-md text-muted outline-none transition-[color,box-shadow] focus:z-10 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,type:`button`,onClick:_,"aria-label":m?`Hide password`:`Show password`,"aria-pressed":m,"aria-controls":s,children:L(m?me:pe,{size:16,"aria-hidden":`true`})}),L(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:o&&u.meta.isDirty&&L(Z,{errors:u.meta.errors})}),L(J,{isShow:!!a,children:a})]})]}),L(X,{})]})},mt=({label:e,description:t,orientation:n,options:r,tooltip:i,helperText:a})=>{let o=Q(),s=V(o.form.store,({isSubmitting:e})=>e);return R(H,{className:`px-4`,children:[R(U,{orientation:n,className:`flex-col gap-2`,children:[R(W,{children:[R(K,{children:[e,i&&L(Y,{tooltip:i})]}),L(q,{children:t}),L(J,{isShow:!!a,children:a})]}),L(G,{children:L(ae,{value:o.state.value??``,className:`w-full`,onValueChange:o.handleChange,children:r.map(e=>L(K,{className:I(`h-fit`,o.state.value===e.value&&`border-primary-weak! bg-primary-bg-subtle`,s&&`pointer-events-none bg-muted-muted opacity-60`,o.state.value===e.value&&s&&`border-border-strong!`),children:R(U,{orientation:`horizontal`,className:`items-start gap-3 rounded p-2!`,children:[L(ie,{value:e.value,className:`mt-0.5 shrink-0`}),R(W,{className:`gap-0.5!`,children:[L(qe,{children:e.label}),L(q,{className:`text-xs`,children:e.description})]})]})},e.value))})})]}),L(X,{})]})},ht=({label:e,description:t,placeholder:n,orientation:r=`responsive`,tooltip:i,options:a,helperText:o,required:s=!1})=>{let c=Q(),l=Fe(),[u,d]=F(!1),f=c.state.meta.isTouched&&!c.state.meta.isValid,p=s&&c.state.value===null,m=c.state.meta.errors,h=a.find(e=>e.value===c.state.value)?.label;return R(H,{className:`gap-y-4 px-4`,children:[R(U,{orientation:r,"data-invalid":f,children:[R(W,{children:[R(K,{htmlFor:c.name,"aria-required":p,children:[e,i&&L(Y,{tooltip:i})]}),L(q,{children:t})]}),R(G,{className:`flex flex-col`,children:[l?R(Te,{children:[R(`button`,{id:c.name,type:`button`,"aria-invalid":f?`true`:void 0,onBlur:c.handleBlur,onClick:()=>d(!0),className:I(`flex w-full items-center justify-between`,`outline-1 outline-border -outline-offset-1`,`gap-2 rounded bg-transparent px-3 py-2`,`rounded shadow-input transition-all cursor-pointer whitespace-nowrap text-sm`,`focus-visible:outline-primary-strong focus-visible:ring-4 focus-visible:ring-primary-weak`,f&&`outline-danger bg-danger-bg-subtle ring-danger-weak`,!c.state.value&&`text-text-positive-muted`),children:[L(`span`,{className:`line-clamp-1`,children:h??n}),L(fe,{size:16,className:`shrink-0 opacity-50`})]}),L(ne,{open:u,onOpenChange:d,direction:`bottom`,children:R(te,{children:[L(ee,{children:L(k,{children:e??n??`Select an option`})}),L(`div`,{className:`flex flex-col overflow-y-auto pb-safe-bottom`,children:a.length>0?a.map(e=>L(A,{asChild:!0,children:L(`button`,{type:`button`,className:I(`flex w-full items-center px-4 py-3 text-left text-sm transition-colors`,`hover:bg-muted-muted active:bg-muted-muted`,c.state.value===e.value&&`bg-primary-bg-subtle font-medium text-primary`),onClick:()=>{c.handleChange(e.value),d(!1)},children:e.label})},e.value)):R(`div`,{className:`flex items-center justify-center gap-x-2 px-4 py-8 text-center text-sm text-text-positive-weak`,children:[L(ve,{strokeWidth:1}),`No options available`]})})]})})]}):R(D,{value:c.state.value??``,onValueChange:c.handleChange,children:[L(E,{"aria-invalid":f?`true`:void 0,onBlur:c.handleBlur,children:L(C,{placeholder:n})}),R(T,{children:[!!a.length&&a.map(e=>L(w,{value:e.value,children:e.label},e.value)),!a.length&&R(`div`,{className:`flex items-center justify-center gap-x-2 rounded border border-border bg-muted-muted px-4 py-6.5 text-center text-sm text-text-positive-weak`,children:[L(ve,{strokeWidth:1}),`No options available`]})]})]}),L(`div`,{className:`mt-1 flex w-full flex-col items-end justify-end`,children:L(Z,{errors:m})}),L(J,{isShow:!!o,children:o})]})]}),L(X,{})]})};function gt({className:e,...t}){return L(Pe.Root,{"data-slot":`switch`,className:I(`peer`,`w-8 shrink-0 cursor-pointer items-center rounded-full shadow-xs transition-all`,`inline-flex h-5`,`focus-visible:border-primary-strong`,`focus-visible:ring-primary-weak`,`focus-visible:ring-4`,`disabled:cursor-not-allowed`,`disabled:opacity-50`,`-outline-offset-1 inset-shadow-2xs outline-1`,`data-[state=checked]:bg-primary`,`data-[state=checked]:outline-primary-strong`,`data-[state=unchecked]:bg-muted-weak`,`data-[state=unchecked]:outline-border`,`data-[state=unchecked]:[&_span]:size-4`,`data-[state=unchecked]:[&_span]:translate-x-0.5`,`data-[state=unchecked]:[&_span]:rtl:-translate-x-0.5`,e),...t,children:L(Pe.Thumb,{"data-slot":`switch-thumb`,className:I(`block size-4 bg-card shadow-xs`,`pointer-events-none rounded-full ring-0 transition-transform`,`data-[state=checked]:translate-x-[calc(100%-3px)]`,`data-[state=unchecked]:translate-x-0`)})})}const _t=({label:e,description:t,helperText:n})=>{let r=Q();return R(H,{className:`gap-y-4 px-4`,children:[R(U,{orientation:`vertical`,className:`relative justify-between gap-y-1`,children:[R(W,{children:[L(qe,{className:`cursor-pointer`,children:L(`label`,{htmlFor:r.name,children:e})}),L(q,{children:t}),L(gt,{id:r.name,checked:r.state.value??!1,className:`absolute top-1 right-1`,onBlur:r.handleBlur,onCheckedChange:r.handleChange})]}),L(J,{isShow:!!n,children:n})]}),L(X,{})]})},vt=({label:e,description:t,placeholder:n,tooltip:r,helperText:i,counter:a=!1,orientation:o=`responsive`,showClearButton:s=!1,showErrorMessage:c=!0,required:l=!1,maxLength:u})=>{let d=N(),f=Ce(null),{form:p,name:m,state:h,handleBlur:g,handleChange:_}=Q(),y=V(p.store,({isSubmitting:e})=>e),b=s&&!y&&!!h.value,x=h.value?h.value.length:0,S=P(()=>{if(!a)return``;let e=`character${[0,1].includes(x)?``:`s`}`;return a&&u?`${x} / ${u} character${x?`s`:``}`:`${x} ${e}`},[x,a,u]),C=h.meta.isDirty&&h.meta.isTouched&&!h.meta.isValid,w=l&&h.value===null,T=u&&x>=u*.8,E=u&&x>=u,D=M(({target:{value:e}})=>{y||a&&u&&e.length>u||_(e||null)},[y,a,u,_]),O=M(()=>{y||(_(null),f.current?.focus())},[y,_]);return R(H,{className:`gap-y-4 px-4`,children:[R(U,{orientation:o,"data-invalid":C,children:[R(W,{children:[R(K,{"aria-required":w,htmlFor:d,children:[e,r&&L(Y,{tooltip:r})]}),L(q,{children:t})]}),R(G,{children:[L(v,{ref:f,id:d,name:m,value:h.value??``,"aria-invalid":C,autoComplete:`off`,placeholder:n,autoCapitalize:`none`,autoCorrect:`off`,className:I(`pr-6`,y&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:g,onChange:D}),b&&L(`button`,{type:`button`,"aria-label":`Clear`,className:`absolute inset-e-0 inset-y-0 top-3 flex h-fit w-8 cursor-pointer items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:text-text-positive-intense [&>svg]:size-3.5`,onClick:O,children:L(xe,{"aria-hidden":`true`})}),y&&L(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-muted-weak`,children:L(_e,{size:14,className:`animate-spin text-primary-strong`})}),!b&&h.meta.isDirty&&c&&!!h.meta.errors.length&&L(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-danger-strong`,children:L(ue,{"aria-hidden":`true`,size:14})}),R(`div`,{className:`my-1 flex w-full items-start justify-between gap-x-2`,children:[h.meta.isDirty&&c?L(Z,{className:`flex-1`,errors:h.meta.errors}):L(`div`,{}),!!a&&L(`p`,{className:I(`h-4 flex-0 text-nowrap text-end text-xs tabular-nums transition-colors`,E?`font-medium text-danger-strong`:T?`text-warning-strong`:`text-text-positive-weak`),children:S})]}),L(J,{isShow:!!i,children:i})]})]}),L(X,{})]})},yt=j(({label:e,description:t,placeholder:n,tooltip:r,helperText:i,counter:a=!1,orientation:o=`responsive`,showErrorMessage:s=!0,required:c=!1,maxLength:l})=>{let u=N(),{form:d,state:f,name:p,handleBlur:m,handleChange:h}=Q(),g=V(d.store,({isSubmitting:e})=>e),_=f.value?f.value.length:0,v=P(()=>{if(!a)return``;let e=`character${[0,1].includes(_)?``:`s`}`;return a&&l?`${_} / ${l} character${_?`s`:``}`:`${_} ${e}`},[_,a,l]),y=f.meta.isDirty&&f.meta.isTouched&&!f.meta.isValid,b=c&&f.value===null,x=f.meta.errors,S=l&&_>=l*.8,C=l&&_>=l,w=M(({target:{value:e}})=>{g||a&&l&&e.length>l||h(e||null)},[g,a,l,h]);return R(H,{className:`gap-y-4 px-4`,children:[R(U,{orientation:o,"data-invalid":y,children:[R(W,{children:[R(K,{"aria-required":b,htmlFor:u,children:[e,r&&L(Y,{tooltip:r})]}),L(q,{children:t})]}),R(G,{children:[L(oe,{id:u,name:p,value:f.value===null?``:f.value,"aria-invalid":y,autoCapitalize:`none`,autoComplete:`off`,placeholder:n,className:I(g&&`pointer-events-none bg-muted-muted opacity-60`),onChange:w,onBlur:m}),g&&L(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-muted-weak`,children:L(_e,{size:14,className:`animate-spin text-primary-strong`})}),f.meta.isDirty&&s&&!!x.length&&L(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-danger-strong`,children:L(ue,{size:14})}),R(`div`,{className:`my-1 flex w-full items-start justify-between gap-x-2`,children:[f.meta.isDirty&&s?L(Z,{className:`flex-1`,errors:f.meta.errors}):L(`div`,{}),!!a&&L(`p`,{className:I(`h-4 flex-0 text-nowrap text-end text-xs tabular-nums transition-colors`,C?`font-medium text-danger-strong`:S?`text-warning-strong`:`text-text-positive-weak`),children:v})]}),L(J,{isShow:!!i,children:i})]})]}),L(X,{})]})});yt.displayName=`TextareaField`;const bt=j(({label:e,description:t,placeholder:n,tooltip:r,helperText:i,showErrorMessage:a=!0,required:o=!1})=>{let{form:s,state:c,handleChange:l}=Q(),u=V(s.store,({isSubmitting:e})=>e),d=c.meta.isDirty&&c.meta.isTouched&&!c.meta.isValid,f=o&&c.value===null,p=M(e=>{u||l(e||null)},[u,l]);return R(H,{className:`gap-y-4 px-4`,children:[R(U,{orientation:`vertical`,"data-invalid":d,children:[R(W,{children:[R(K,{"aria-required":f,children:[e,r&&L(Y,{tooltip:r})]}),L(q,{children:t})]}),L(se,{value:c.value??``,placeholder:n,readOnly:u,onChange:p}),c.meta.isDirty&&a&&!!c.meta.errors.length&&L(Z,{errors:c.meta.errors}),L(J,{isShow:!!i,children:i})]}),L(X,{})]})});bt.displayName=`TextEditorField`;const xt=({label:t,className:n})=>{let r=$(),i=M(async()=>{await r.handleSubmit({submitAction:`submit`}),r.state.isSubmitSuccessful&&r.reset()},[r]);return L(r.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:r,isSubmitting:a})=>L(e,{type:`button`,size:`md`,disabled:r,isLoading:a,className:I(`min-h-8 min-w-32`,n),onClick:i,children:t??`Submit`})})},St=({type:t=`create`})=>{let n=$();return R(`div`,{className:`flex h-8 items-center justify-between`,children:[L(n.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:t})=>L(e,{color:`muted`,variant:`outline`,type:`button`,size:`md`,disabled:t,className:`h-full min-w-32`,onClick:()=>n.reset(),children:`Cancel`})}),t===`create`&&L(n.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:t,isSubmitting:r})=>R(e,{type:`submit`,size:`md`,disabled:t,isLoading:r,className:`h-full min-w-32`,onClick:async()=>{await n.handleSubmit({submitAction:`create`}),n.state.isSubmitSuccessful&&n.reset()},children:[L(ye,{}),`Add New`]})}),t===`update`&&L(n.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:t,isSubmitting:r})=>R(e,{type:`submit`,size:`md`,disabled:t,isLoading:r,className:`h-full min-w-32`,onClick:async()=>{await n.handleSubmit({submitAction:`update`}),n.state.isSubmitSuccessful&&n.reset()},children:[L(ce,{}),`Update`]})})]})};function Ct({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return L(Ne.Root,{"data-slot":`separator`,decorative:n,orientation:t,className:I(`shrink-0 bg-border-weak`,`data-[orientation=horizontal]:h-px`,`data-[orientation=horizontal]:w-full`,`data-[orientation=vertical]:h-full`,`data-[orientation=vertical]:w-px`,e),...r})}const wt=({title:t,description:n,onDelete:r,children:i})=>R(`section`,{"data-slot":`card-form`,className:`relative flex flex-col rounded-md bg-card pb-4 shadow-card ring-1 ring-border`,children:[R(`div`,{"data-slot":`card-form-header`,className:`flex flex-col space-y-0.5 px-4 py-3`,children:[L(`p`,{className:`font-semibold text-base tracking-tight`,children:t}),!!n&&L(`p`,{className:`text-text-positive-weak text-sm`,children:n})]}),L(Ct,{}),L(`div`,{"data-slot":`card-form-main`,className:`flex flex-col py-4`,children:i}),!!r&&R(e,{color:`danger`,variant:`ghost`,size:`sm`,className:`absolute top-2.5 right-3`,onClick:e=>{r?.(),e.preventDefault(),e.stopPropagation()},children:[L(be,{}),`Remove`]})]}),Tt=({children:e})=>L(`div`,{"data-slot":`section-form`,className:`flex flex-col space-y-4`,children:e}),Et=({disabled:t,className:n,onClick:r,children:i})=>L(e,{type:`button`,variant:`outline`,color:`muted`,disabled:t,className:I(`min-w-40`,n),onClick:r,children:i??`Cancel`}),Dt=({isSubmitting:t,submitText:n=`Submit`,disabled:r,className:i,onClick:a})=>L(e,{type:`button`,isLoading:t,disabled:r||t,className:I(`min-w-40`,i),onClick:a,children:n}),Ot=({title:e,submitText:t,width:n,maxWidth:r,className:a,open:d,onOpenChange:f,children:p})=>{let m=$(),h=M(e=>{e||m.reset(),f?.(e)},[m.reset,f]);return L(u,{open:d,onOpenChange:h,children:R(o,{"data-slot":`dialog-portal`,children:[L(l,{}),R(c,{style:{"--width":n,"--max-width":r},className:I(`flex size-full max-h-dvh max-w-dvw flex-col gap-0 overflow-y-auto rounded-none p-0 shadow-dialog sm:h-auto sm:max-h-[85dvh] sm:max-w-5xl sm:rounded-md`,n&&`sm:w-(--width)`,r&&`sm:max-w-(--max-width)`,a),onOpenAutoFocus:e=>{e.preventDefault()},children:[L(`div`,{"data-slot":`dialog-header`,className:`flex items-center justify-center gap-2 px-6 py-5 text-center sm:text-left`,children:L(s,{"data-slot":`dialog-title`,className:`font-semibold text-lg tracking-tight`,children:e})}),L(i,{}),L(`div`,{"data-slot":`dialog-content`,className:`relative flex flex-col overflow-y-auto p-0 pt-4 max-sm:flex-1 sm:p-4`,children:p}),L(i,{}),R(`div`,{"data-slot":`dialog-footer`,className:`flex flex-col-reverse items-center justify-end gap-2 px-6 py-4 sm:flex-row max-sm:[&>button]:w-full`,children:[L(m.Subscribe,{selector:e=>({disabled:e.isSubmitting}),children:({disabled:e})=>L(Et,{disabled:e,onClick:()=>{m.reset(),h(!1)}})}),L(m.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:n})=>L(Dt,{isSubmitting:e,disabled:n,submitText:t,onClick:()=>m.handleSubmit()})})]})]})]})})},kt=({label:e,description:t,helperText:n,orientation:r=`responsive`,children:i})=>R(H,{className:`gap-y-4 px-4`,children:[R(U,{orientation:r,children:[R(W,{children:[L(K,{children:e}),L(q,{children:t})]}),R(G,{children:[i,L(J,{isShow:!!n,children:n})]})]}),L(X,{})]}),At=({title:e,open:t,contentClassName:n,onOpenChange:r,children:i})=>{let o=$();return L(B.Root,{"data-slot":`dialog`,open:t,onOpenChange:r,children:R(B.Portal,{"data-slot":`dialog-portal`,children:[L(B.Overlay,{"data-slot":`dialog-overlay`,className:I(`fixed inset-0 z-40 bg-black/40 backdrop-blur-sm`,`data-[state=open]:animate-in data-[state=open]:fade-in`,`data-[state=closed]:animate-out data-[state=closed]:fade-out`)}),L(B.Content,{"data-slot":`dialog-content`,className:I(`fixed top-4 right-4 z-50 h-[calc(100dvh-2rem)] min-w-sm max-w-xl rounded-md bg-background shadow-lg ring-1 ring-border`,`duration-300`,`data-[state=open]:animate-in data-[state=open]:slide-in-from-right data-[state=open]:fade-in`,`data-[state=closed]:animate-out data-[state=closed]:slide-out-to-right data-[state=closed]:fade-out`),children:R(`section`,{className:`relative flex size-full flex-col`,children:[L(`header`,{className:`flex h-14 shrink-0 items-center border-b border-border px-5`,children:L(`h2`,{className:`font-semibold text-base tracking-tight text-text-positive`,children:e})}),L(`div`,{className:I(`flex flex-1 flex-col overflow-y-auto py-4`,n),children:i}),R(`div`,{className:`flex shrink-0 flex-col gap-2 border-t border-border px-4 py-3`,children:[L(o.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:t})=>L(Dt,{isSubmitting:e,disabled:t,className:`w-full`,onClick:()=>o.handleSubmit()})}),L(o.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:e})=>L(Et,{disabled:e,className:`w-full`,onClick:()=>{o.reset(),r?.(!1)}})})]}),L(B.Close,{asChild:!0,children:L(a,{className:`absolute top-2.5 right-3`})})]})})]})})},jt=({children:e})=>L(`header`,{"data-slot":`section-header`,className:`flex items-center px-4 py-3 font-semibold text-base text-text-positive tracking-tight`,children:e}),Mt=({children:e})=>L(`main`,{"data-slot":`section-main`,className:`relative flex flex-col py-4`,children:e}),Nt=({title:e,children:t})=>R(`section`,{"data-slot":`section-form`,className:`flex flex-col rounded-md bg-background shadow-card ring-1 ring-border`,children:[L(jt,{children:e}),L(Ct,{}),L(Mt,{children:t})]}),Pt=({title:e,description:t,helperText:n})=>R(H,{className:`gap-y-4 px-4`,children:[R(U,{className:`gap-0`,children:[R(W,{children:[L(Ke,{className:`mb-1`,children:e}),L(q,{children:t})]}),L(J,{isShow:!!n,children:n})]}),L(X,{})]}),{fieldContext:Ft,formContext:It,useFieldContext:Q,useFormContext:$}=Le(),{useAppForm:Lt,withForm:Rt,withFieldGroup:zt}=Ie({fieldContext:Ft,formContext:It,fieldComponents:{TextField:vt,TextareaField:yt,TextEditorField:bt,NumberField:ft,EmailField:dt,PasswordField:pt,SelectField:ht,ComboboxField:lt,DateField:ut,SwitchField:_t,RadioGroupField:mt,CheckboxField:ct,SimpleTextField:st,SimpleEmailField:Qe,SimplePasswordField:it,SimpleTextareaField:ot,SimpleNumberField:rt,SimpleSelectField:at,SimpleArrayField:Be,SimpleBooleanField:Je,SimpleComboboxField:Ye,SimpleDateField:Xe,SimpleRadioGroupField:Ze,FieldGroup:H,Field:U,FieldContent:W,FieldLabel:K,FieldContentMain:G,FieldSeparator:X,FieldError:Z},formComponents:{TanStackDialogForm:Ot,TanStackPopoverForm:At,TanStackContainerForm:Tt,TanStackSectionForm:Nt,TanStackCardForm:wt,TanStackFieldGroup:kt,TanStackTitleField:Pt,TanStackActionsForm:St,TanStackActionSubmit:xt,ArrayCol:Re,ArrayHeaderRow:ze}});export{Rt as a,G as c,K as d,X as f,zt as i,Z as l,Lt as n,U as o,$ as r,W as s,Q as t,H as u};
2
+ //# sourceMappingURL=tanstack-form-DQFyDxOg.mjs.map