@customafk/lunas-ui 0.2.2 → 0.2.3

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 (208) hide show
  1. package/dist/{button-IfNjnUO-.d.mts → button-C6s_h0K3.d.mts} +4 -4
  2. package/dist/{button-BnFROtRM.d.cts → button-CcOrQc7g.d.cts} +4 -4
  3. package/dist/button-CpEejahy.cjs +2 -0
  4. package/dist/{button-CYw2AqT0.cjs.map → button-CpEejahy.cjs.map} +1 -1
  5. package/dist/{button-B2FJrOBP.mjs → button-D54KOmb7.mjs} +2 -2
  6. package/dist/{button-B2FJrOBP.mjs.map → button-D54KOmb7.mjs.map} +1 -1
  7. package/dist/button.variants-CS-Cmarr.cjs +2 -0
  8. package/dist/button.variants-CS-Cmarr.cjs.map +1 -0
  9. package/dist/button.variants-DRWf66hR.mjs +2 -0
  10. package/dist/button.variants-DRWf66hR.mjs.map +1 -0
  11. package/dist/{calendar-BwWfk_Zk.cjs → calendar-dhPqb3aZ.cjs} +2 -2
  12. package/dist/{calendar-BwWfk_Zk.cjs.map → calendar-dhPqb3aZ.cjs.map} +1 -1
  13. package/dist/{calendar-Bt6qXSZb.mjs → calendar-qHQsMOj9.mjs} +2 -2
  14. package/dist/{calendar-Bt6qXSZb.mjs.map → calendar-qHQsMOj9.mjs.map} +1 -1
  15. package/dist/cards/grid-product-card.cjs +1 -1
  16. package/dist/cards/grid-product-card.mjs +1 -1
  17. package/dist/cards/product-card.cjs +1 -1
  18. package/dist/cards/product-card.mjs +1 -1
  19. package/dist/data-display/empty.d.mts +2 -2
  20. package/dist/data-display/statistic.d.cts +2 -2
  21. package/dist/data-display/statistic.d.mts +2 -2
  22. package/dist/{dialog-CyLgmqny.d.cts → dialog-CsM9bEo6.d.cts} +12 -12
  23. package/dist/{dialog-lFDfcYPP.d.mts → dialog-NsKYcQwE.d.mts} +12 -12
  24. package/dist/dialogs/confirm-dialog.cjs +1 -1
  25. package/dist/dialogs/confirm-dialog.mjs +1 -1
  26. package/dist/dialogs/detail-dialog/components/sidebar.cjs +1 -1
  27. package/dist/dialogs/detail-dialog/components/sidebar.d.cts +25 -25
  28. package/dist/dialogs/detail-dialog/components/sidebar.d.mts +25 -25
  29. package/dist/dialogs/detail-dialog/components/sidebar.mjs +1 -1
  30. package/dist/dialogs/detail-dialog/index.cjs +1 -1
  31. package/dist/dialogs/detail-dialog/index.cjs.map +1 -1
  32. package/dist/dialogs/detail-dialog/index.mjs +1 -1
  33. package/dist/dialogs/detail-dialog/index.mjs.map +1 -1
  34. package/dist/dialogs/error-dialog.cjs +1 -1
  35. package/dist/dialogs/error-dialog.mjs +1 -1
  36. package/dist/features/search-modal/index.d.mts +2 -2
  37. package/dist/features/tables/index.cjs +1 -1
  38. package/dist/features/tables/index.d.cts +1 -1
  39. package/dist/features/tables/index.d.mts +23 -23
  40. package/dist/features/tables/index.mjs +1 -1
  41. package/dist/features/tanstack-form/index.cjs +1 -1
  42. package/dist/features/tanstack-form/index.d.cts +42 -42
  43. package/dist/features/tanstack-form/index.d.mts +266 -266
  44. package/dist/features/tanstack-form/index.mjs +1 -1
  45. package/dist/{input-CLlVXOR2.d.mts → input-B65h-l45.d.cts} +7 -7
  46. package/dist/{input-Bm0YXroi.d.cts → input-C6Q4vGNC.d.mts} +6 -6
  47. package/dist/layouts/cms-layout/index.cjs +1 -1
  48. package/dist/layouts/cms-layout/index.mjs +1 -1
  49. package/dist/layouts/flex.d.cts +5 -5
  50. package/dist/layouts/flex.d.mts +9 -9
  51. package/dist/layouts/payment-layout/index.cjs +1 -1
  52. package/dist/layouts/payment-layout/index.mjs +1 -1
  53. package/dist/pages/FeatureDeveloping.cjs +1 -1
  54. package/dist/pages/FeatureDeveloping.d.cts +2 -2
  55. package/dist/pages/FeatureDeveloping.d.mts +2 -2
  56. package/dist/pages/FeatureDeveloping.mjs +1 -1
  57. package/dist/pages/FeatureFixing.cjs +1 -1
  58. package/dist/pages/FeatureFixing.d.cts +2 -2
  59. package/dist/pages/FeatureFixing.d.mts +2 -2
  60. package/dist/pages/FeatureFixing.mjs +1 -1
  61. package/dist/pages/NotAuthorized.cjs +1 -1
  62. package/dist/pages/NotAuthorized.d.cts +2 -2
  63. package/dist/pages/NotAuthorized.d.mts +2 -2
  64. package/dist/pages/NotAuthorized.mjs +1 -1
  65. package/dist/pages/NotFound.cjs +1 -1
  66. package/dist/pages/NotFound.d.cts +2 -2
  67. package/dist/pages/NotFound.d.mts +2 -2
  68. package/dist/pages/NotFound.mjs +1 -1
  69. package/dist/typography/paragraph.d.cts +3 -3
  70. package/dist/typography/paragraph.d.mts +5 -5
  71. package/dist/typography/title.d.cts +2 -2
  72. package/dist/typography/title.d.mts +2 -2
  73. package/dist/ui/alert-dialog.cjs +1 -1
  74. package/dist/ui/alert-dialog.d.cts +12 -12
  75. package/dist/ui/alert-dialog.d.mts +12 -12
  76. package/dist/ui/alert-dialog.mjs +1 -1
  77. package/dist/ui/alert.d.cts +4 -4
  78. package/dist/ui/alert.d.mts +4 -4
  79. package/dist/ui/aspect-ratio.d.cts +2 -2
  80. package/dist/ui/aspect-ratio.d.mts +2 -2
  81. package/dist/ui/avatar.d.cts +4 -4
  82. package/dist/ui/avatar.d.mts +4 -4
  83. package/dist/ui/badge.d.cts +5 -5
  84. package/dist/ui/badge.d.mts +5 -5
  85. package/dist/ui/breadcrumb.d.cts +8 -8
  86. package/dist/ui/breadcrumb.d.mts +8 -8
  87. package/dist/ui/button-group.d.cts +6 -6
  88. package/dist/ui/button-group.d.mts +4 -4
  89. package/dist/ui/button.cjs +1 -1
  90. package/dist/ui/button.d.cts +1 -1
  91. package/dist/ui/button.d.mts +1 -1
  92. package/dist/ui/button.mjs +1 -1
  93. package/dist/ui/buttons/add-new.cjs +1 -1
  94. package/dist/ui/buttons/add-new.mjs +1 -1
  95. package/dist/ui/buttons/edit.cjs +1 -1
  96. package/dist/ui/buttons/edit.mjs +1 -1
  97. package/dist/ui/buttons/refresh.cjs +1 -1
  98. package/dist/ui/buttons/refresh.mjs +1 -1
  99. package/dist/ui/buttons/trash.cjs +1 -1
  100. package/dist/ui/buttons/trash.mjs +1 -1
  101. package/dist/ui/buttons/upload-image.cjs +1 -1
  102. package/dist/ui/buttons/upload-image.mjs +1 -1
  103. package/dist/ui/calendar.cjs +1 -1
  104. package/dist/ui/calendar.d.cts +4 -4
  105. package/dist/ui/calendar.d.mts +4 -4
  106. package/dist/ui/calendar.mjs +1 -1
  107. package/dist/ui/card.d.cts +8 -8
  108. package/dist/ui/card.d.mts +8 -8
  109. package/dist/ui/carousel.cjs +1 -1
  110. package/dist/ui/carousel.d.cts +7 -7
  111. package/dist/ui/carousel.d.mts +7 -7
  112. package/dist/ui/carousel.mjs +1 -1
  113. package/dist/ui/checkbox.d.cts +2 -2
  114. package/dist/ui/checkbox.d.mts +2 -2
  115. package/dist/ui/collapsible.d.cts +4 -4
  116. package/dist/ui/collapsible.d.mts +4 -4
  117. package/dist/ui/command.d.cts +11 -11
  118. package/dist/ui/command.d.mts +11 -11
  119. package/dist/ui/context-menu.d.cts +16 -16
  120. package/dist/ui/context-menu.d.mts +16 -16
  121. package/dist/ui/dialog.d.cts +1 -1
  122. package/dist/ui/dialog.d.mts +1 -1
  123. package/dist/ui/drawer.d.cts +11 -11
  124. package/dist/ui/drawer.d.mts +11 -11
  125. package/dist/ui/dropdown-menu.d.cts +16 -16
  126. package/dist/ui/dropdown-menu.d.mts +16 -16
  127. package/dist/ui/empty.d.cts +9 -9
  128. package/dist/ui/empty.d.mts +9 -9
  129. package/dist/ui/field.d.cts +13 -13
  130. package/dist/ui/field.d.mts +24 -24
  131. package/dist/ui/file-uploader.cjs +1 -1
  132. package/dist/ui/file-uploader.d.cts +2 -2
  133. package/dist/ui/file-uploader.d.mts +2 -2
  134. package/dist/ui/file-uploader.mjs +1 -1
  135. package/dist/ui/form.d.cts +11 -11
  136. package/dist/ui/form.d.mts +11 -11
  137. package/dist/ui/hover-card.d.cts +4 -4
  138. package/dist/ui/hover-card.d.mts +4 -4
  139. package/dist/ui/input-otp.d.cts +5 -5
  140. package/dist/ui/input-otp.d.mts +5 -5
  141. package/dist/ui/input.d.cts +1 -1
  142. package/dist/ui/input.d.mts +1 -1
  143. package/dist/ui/inputs/search-input.d.cts +3 -3
  144. package/dist/ui/inputs/search-input.d.mts +3 -3
  145. package/dist/ui/item.d.cts +13 -13
  146. package/dist/ui/item.d.mts +16 -16
  147. package/dist/ui/label.d.cts +2 -2
  148. package/dist/ui/label.d.mts +2 -2
  149. package/dist/ui/menubar.d.cts +17 -17
  150. package/dist/ui/menubar.d.mts +17 -17
  151. package/dist/ui/multi-select.cjs +1 -1
  152. package/dist/ui/multi-select.d.cts +2 -2
  153. package/dist/ui/multi-select.d.mts +3 -3
  154. package/dist/ui/multi-select.mjs +1 -1
  155. package/dist/ui/navigation-menu.d.cts +11 -11
  156. package/dist/ui/navigation-menu.d.mts +9 -9
  157. package/dist/ui/pagination.cjs +1 -1
  158. package/dist/ui/pagination.d.cts +9 -9
  159. package/dist/ui/pagination.d.mts +9 -9
  160. package/dist/ui/pagination.mjs +1 -1
  161. package/dist/ui/popover.d.cts +6 -6
  162. package/dist/ui/popover.d.mts +6 -6
  163. package/dist/ui/progress.d.cts +2 -2
  164. package/dist/ui/progress.d.mts +2 -2
  165. package/dist/ui/radio-group.d.cts +3 -3
  166. package/dist/ui/radio-group.d.mts +3 -3
  167. package/dist/ui/resizable.d.cts +9 -9
  168. package/dist/ui/resizable.d.mts +9 -9
  169. package/dist/ui/scroll-area.d.cts +6 -6
  170. package/dist/ui/scroll-area.d.mts +6 -6
  171. package/dist/ui/select.d.cts +9 -9
  172. package/dist/ui/select.d.mts +9 -9
  173. package/dist/ui/separator.d.cts +2 -2
  174. package/dist/ui/separator.d.mts +2 -2
  175. package/dist/ui/sheet.d.cts +9 -9
  176. package/dist/ui/sheet.d.mts +9 -9
  177. package/dist/ui/sidebar.cjs +1 -1
  178. package/dist/ui/sidebar.d.cts +3 -3
  179. package/dist/ui/sidebar.d.mts +29 -29
  180. package/dist/ui/sidebar.mjs +1 -1
  181. package/dist/ui/skeleton.d.cts +2 -2
  182. package/dist/ui/skeleton.d.mts +2 -2
  183. package/dist/ui/slider.d.cts +2 -2
  184. package/dist/ui/slider.d.mts +2 -2
  185. package/dist/ui/sonner.d.cts +2 -2
  186. package/dist/ui/sonner.d.mts +2 -2
  187. package/dist/ui/spinner.d.cts +2 -2
  188. package/dist/ui/spinner.d.mts +2 -2
  189. package/dist/ui/switch.d.cts +2 -2
  190. package/dist/ui/switch.d.mts +2 -2
  191. package/dist/ui/table.d.cts +18 -18
  192. package/dist/ui/table.d.mts +18 -18
  193. package/dist/ui/tabs.d.cts +5 -5
  194. package/dist/ui/tabs.d.mts +5 -5
  195. package/dist/ui/textarea.d.cts +2 -2
  196. package/dist/ui/textarea.d.mts +2 -2
  197. package/dist/ui/toggle-group.d.cts +3 -3
  198. package/dist/ui/toggle-group.d.mts +3 -3
  199. package/dist/ui/toggle.d.cts +5 -5
  200. package/dist/ui/toggle.d.mts +5 -5
  201. package/dist/ui/tooltip.d.cts +5 -5
  202. package/dist/ui/tooltip.d.mts +5 -5
  203. package/package.json +1 -1
  204. package/dist/button-CYw2AqT0.cjs +0 -2
  205. package/dist/button.variants-DuuH1O0_.mjs +0 -2
  206. package/dist/button.variants-DuuH1O0_.mjs.map +0 -1
  207. package/dist/button.variants-rdXrPUao.cjs +0 -2
  208. package/dist/button.variants-rdXrPUao.cjs.map +0 -1
@@ -1,2 +1,2 @@
1
- const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../heading-BEm5CCSE.cjs`),require(`../../paragraph-B72bHMf7.cjs`),require(`../../button.variants-rdXrPUao.cjs`);const t=require(`../../button-CYw2AqT0.cjs`),n=require(`../../separator-C3ip6sbh.cjs`),r=require(`../../close-D_Ge7gnP.cjs`),i=require(`../../dialog-DjRiV5vR.cjs`),a=require(`../../checkbox-C0fSWwmD.cjs`),o=require(`../../input-BFWWaN-v.cjs`),s=require(`../../popover-DzDrgttC.cjs`),c=require(`../../calendar-BwWfk_Zk.cjs`),l=require(`../../radio-group-CBhRsUjN.cjs`),u=require(`../../select-2CgwiefV.cjs`),d=require(`../../textarea-COQoSVSc.cjs`);let f=require(`@customafk/react-toolkit/utils`),p=require(`class-variance-authority`),m=require(`react`),h=require(`react/jsx-runtime`),g=require(`lucide-react`),_=require(`@customafk/react-toolkit/date-fns`),v=require(`radix-ui`),y=require(`@tanstack/react-form`);const b=(0,p.cva)([`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`}}),x=({label:e,color:t,size:n,className:r,children:i})=>(0,h.jsx)(`div`,{"data-slot":`required-indicator`,className:b({color:t,size:n,className:r}),children:e||i});function S({className:e,children:t,...n}){return(0,h.jsxs)(v.Label.Root,{"data-slot":`label`,className:(0,f.cn)(`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:[t,(0,h.jsx)(x,{label:`Required`,color:`danger`,size:`sm`,className:`hidden`})]})}const C=(0,p.cva)(`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`}}),w=(0,m.memo)(({className:e,...t})=>(0,h.jsx)(`fieldset`,{"data-slot":`field-set`,className:(0,f.cn)(`flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,e),...t}));w.displayName=`FieldSet`;const T=(0,m.memo)(({className:e,variant:t=`legend`,...n})=>(0,h.jsx)(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:(0,f.cn)(`mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,e),...n}));T.displayName=`FieldLegend`;const E=(0,m.memo)(({className:e,...t})=>(0,h.jsx)(`div`,{"data-slot":`field-group`,className:(0,f.cn)(`group/field-group @container/field-group`,`flex flex-col gap-7`,`data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,e),...t}));E.displayName=`FieldGroup`;const D=(0,m.memo)(({className:e,orientation:t=`vertical`,...n})=>(0,h.jsx)(`div`,{"data-slot":`field`,"data-orientation":t,className:(0,f.cn)(C({orientation:t}),e),...n}));D.displayName=`Field`;const O=(0,m.memo)(({className:e,...t})=>(0,h.jsx)(`div`,{"data-slot":`field-content`,className:(0,f.cn)(`group/field-content flex flex-col gap-1.5 leading-snug`,e),...t}));O.displayName=`FieldContent`;const k=(0,m.memo)(({className:e,...t})=>(0,h.jsx)(`div`,{"data-slot":`field-content-main`,className:(0,f.cn)(`relative`,e),...t})),A=(0,m.memo)(({className:e,...t})=>(0,h.jsx)(S,{"data-slot":`field-label`,className:(0,f.cn)(`group/field-label peer/field-label flex 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}));A.displayName=`FieldLabel`;const j=(0,m.memo)(({className:e,...t})=>(0,h.jsx)(`div`,{"data-slot":`field-label`,className:(0,f.cn)(`flex w-fit items-center gap-2 font-medium text-sm leading-snug group-data-[disabled=true]/field:opacity-50`,e),...t}));j.displayName=`FieldTitle`;const M=(0,m.memo)(({className:e,...t})=>(0,h.jsx)(`p`,{"data-slot":`field-description`,className:(0,f.cn)(`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}));M.displayName=`FieldDescription`;const N=(0,m.memo)(({isShow:e=!0,className:t,...n})=>e===!1?null:(0,h.jsx)(`div`,{"data-slot":`field-note`,className:(0,f.cn)(`text-wrap rounded border border-primary-muted bg-primary-bg-subtle p-2 text-text-positive-weak text-xs`,t),...n}));N.displayName=`FieldNote`;const P=(0,m.memo)(({children:e,className:t,...r})=>(0,h.jsxs)(`div`,{"data-slot":`field-separator`,"data-content":!!e,className:(0,f.cn)(`relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2`,t),...r,children:[(0,h.jsx)(n.t,{className:`absolute inset-0 top-1/2`}),e&&(0,h.jsx)(`span`,{className:`relative mx-auto block w-fit bg-background px-2 text-text-positive-weak`,"data-slot":`field-separator-content`,children:e})]}));P.displayName=`FieldSeparator`;const F=(0,m.memo)(({className:e,children:t,errors:n,...r})=>{let i=(0,m.useMemo)(()=>t||(n?n?.length===1&&n[0]?.message?(0,h.jsx)(`div`,{className:`flex flex-row items-center justify-start gap-x-0.5`,children:(0,h.jsx)(`p`,{children:n[0]?.code===`invalid_type`?`Không đúng định dạng`:n[0].message})}):(0,h.jsx)(`ul`,{className:`flex list-none flex-col`,children:n.map(e=>typeof e==`string`?(0,h.jsx)(`li`,{children:e},e):e?.message?(0,h.jsx)(`li`,{children:e.message},e.message):null)}):null),[t,n]);return i?(0,h.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:(0,f.cn)(`w-full font-semibold text-danger-strong text-xs`,e),...r,children:i}):null});F.displayName=`FieldError`;const I=({label:e,description:t,options:n,helperText:r,orientation:i})=>{let o=Q(),s=(0,y.useStore)(o.form.store,({isSubmitting:e})=>e);return(0,h.jsxs)(E,{className:`gap-y-4 px-4`,children:[(0,h.jsxs)(D,{orientation:i,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(A,{children:e}),(0,h.jsx)(M,{children:t}),(0,h.jsx)(N,{isShow:!!r,children:r})]}),(0,h.jsx)(k,{children:(0,h.jsx)(E,{className:`flex flex-col gap-y-2`,children:n.map(e=>(0,h.jsxs)(D,{orientation:`horizontal`,children:[(0,h.jsx)(a.t,{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 !t&&o.state.value===null&&o.setValue(null)}}),(0,h.jsx)(A,{htmlFor:`${o.name}-${e.value}`,className:`text-text-positive`,children:e.label})]},e.value))})})]}),(0,h.jsx)(P,{})]})},L=({label:e,description:n,placeholder:r,orientation:i=`responsive`,helperText:a,minDate:o,maxDate:l,required:u})=>{let d=Q(),p=(0,m.useMemo)(()=>u?d.state.value===null:!1,[u,d.state.value]),v=(0,m.useMemo)(()=>d.state.meta.isTouched&&!d.state.meta.isValid,[d.state.meta.isTouched,d.state.meta.isValid]);return(0,h.jsxs)(E,{className:`px-4`,children:[(0,h.jsxs)(D,{orientation:i,"data-invalid":v,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(A,{htmlFor:d.name,"aria-required":p,children:e}),(0,h.jsx)(M,{children:n})]}),(0,h.jsxs)(k,{className:`flex flex-col space-y-1`,children:[(0,h.jsx)(`div`,{className:`flex w-full flex-col`,children:(0,h.jsxs)(s.t,{children:[(0,h.jsx)(s.a,{asChild:!0,children:(0,h.jsxs)(t.t,{variant:`outline`,color:`muted`,size:`lg`,className:(0,f.cn)(`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`,d.state.value===null&&`text-text-positive-muted`),children:[(0,h.jsx)(`p`,{children:d.state.value===null?r||`Select date`:(0,_.format)(d.state.value,`PPPP`)}),(0,h.jsx)(g.CalendarDaysIcon,{strokeWidth:1})]})}),(0,h.jsxs)(s.i,{align:`start`,side:`bottom`,className:`flex w-fit min-w-0 overflow-y-auto rounded p-0`,onBlur:d.handleBlur,children:[(0,h.jsxs)(`div`,{className:`flex h-full flex-col space-y-2 border-r border-r-border p-2 [&>button]:justify-start [&>button]:text-sm`,children:[(0,h.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,_.endOfToday)())},children:`Today`}),(0,h.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,_.endOfTomorrow)())},children:`Tomorrow`}),(0,h.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,_.endOfYesterday)())},children:`Yesterday`}),(0,h.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,_.subDays)((0,_.endOfToday)(),3))},children:`Last 3 Days`}),(0,h.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,_.subDays)((0,_.endOfToday)(),7))},children:`Last 7 Days`}),(0,h.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,_.subDays)((0,_.endOfToday)(),30))},children:`Last 30 Days`}),(0,h.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,_.startOfMonth)((0,_.endOfToday)()))},children:`This Month`}),(0,h.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,_.lastDayOfMonth)((0,_.endOfToday)()))},children:`Last Month`})]}),(0,h.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,h.jsx)(`div`,{className:`min-w-73 border-b border-b-border p-2`,children:(0,h.jsx)(c.t,{mode:`single`,selected:d.state.value??void 0,hidden:{before:o??new Date(1900,0,1),after:l??new Date(2100,11,31)},onSelect:e=>{e&&d.handleChange(e)}})})})]})]})}),(0,h.jsx)(N,{isShow:!!a,children:a})]})]}),(0,h.jsx)(P,{})]})},R=({label:e,description:t,placeholder:n,helperText:r,orientation:i=`responsive`,showErrorMessage:a=!0,maxLength:s})=>{let{form:c,name:l,state:u,handleBlur:d,handleChange:p}=Q(),_=(0,y.useStore)(c.store,({isSubmitting:e})=>e),v=(0,m.useMemo)(()=>u.meta.isDirty&&u.meta.isTouched&&!u.meta.isValid,[u.meta.isDirty,u.meta.isTouched,u.meta.isValid]),b=(0,m.useCallback)(({target:{value:e}})=>{_||s&&e.length>s||p(e||null)},[_,s,p]),x=(0,m.useCallback)(()=>{_||p(null)},[_,p]);return(0,h.jsxs)(E,{className:`gap-y-4 px-4`,children:[(0,h.jsxs)(D,{"data-invalid":v,orientation:i,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(A,{htmlFor:l,children:e}),(0,h.jsx)(M,{children:t})]}),(0,h.jsxs)(k,{children:[(0,h.jsx)(o.t,{id:l,name:l,value:u.value===null?``:u.value,"aria-invalid":v,autoComplete:`email`,placeholder:n,className:(0,f.cn)(`pl-9`,_&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:d,onChange:b}),(0,h.jsx)(`div`,{className:`absolute top-0 left-0 flex size-9 items-center justify-center text-muted`,children:(0,h.jsx)(g.AtSignIcon,{size:14})}),(0,h.jsx)(`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:x,children:(0,h.jsx)(g.XIcon,{size:14,"aria-hidden":`true`})}),(0,h.jsx)(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:a&&u.meta.isDirty&&(0,h.jsx)(F,{errors:u.meta.errors})}),(0,h.jsx)(N,{isShow:!!r,children:r})]})]}),(0,h.jsx)(P,{})]})},z=e=>e?/^-?\d*\.?\d*$/:/^\d*\.?\d*$/,B=e=>Number(e).toLocaleString(),V=(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}},H=({disabled:e=!1,readOnly:t=!1,allowNegative:n=!1,numberAfterDecimalPoint:r=2,roundingRule:i=`none`,value:a=null,unitText:s,decimal:c,placeholder:l,precision:u,wrapperClassName:d,className:p,onChange:g,onValueChange:_,onFocus:v,onBlur:y,...b})=>{let x=(0,m.useRef)(null),S=(0,m.useRef)(null),[C,w]=(0,m.useState)(a?.toString()??null),T=(0,m.useMemo)(()=>c?.[1]??r,[c,r]),E=(0,m.useMemo)(()=>c&&c[0]-c[1],[c]),D=(0,m.useMemo)(()=>z(n),[n]),O=(0,m.useCallback)(e=>{if(!T||e===`-`)return!0;let[t,n=``]=e.split(`.`),r=t.startsWith(`-`)?t.length-1:t.length;return n.length<=T&&r<=(E??1/0)},[T,E]),k=(0,m.useCallback)(e=>{if(e===`0`)return`0`;if(!Number(e))return null;let[t,n=``]=V(parseFloat(e),Math.min(T-1,u||0),i).toString().split(`.`),r=B(t);return n?`${r}.${n}`:r},[T,u,i]),A=(0,m.useCallback)(e=>{let t=e===`0`,n=e===`-`||/^-0+(\.0+)?$/.test(e)||/^-0*\.$/.test(e);if(t){_?.(0),w(e);return}if(n){w(()=>(_?.(0),e));return}},[_]),j=(0,m.useCallback)(e=>{g?.(e);let{value:t}=e.target;if(t===``||t===void 0){_?.(null),w(null);return}A(t),!(!D.test(t)||!O(t))&&(_?.(parseFloat(t)||0),w(t))},[O,g,_,A,D]),M=(0,m.useCallback)(e=>{t||(v?.(e),w(e=>typeof e==`string`?e.replace(/,/g,``):null))},[t,v]),N=(0,m.useCallback)(e=>{t||(y?.(e),w(e=>e===null?null:e===`0`||e===`-`||/^-0+(\.0+)?$/.test(e)||/^-0*\.$/.test(e)?`0`:typeof e==`string`?k(e):null))},[t,k,y]);return(0,m.useEffect)(()=>{let e=document.activeElement===S.current;if(a==null||!D.test(a.toString())||!O(a.toString())){w(null);return}w(t=>e?t:k(a.toString()))},[k,a,O,D]),(0,m.useEffect)(()=>{if(!x.current||!S.current||!s)return;let e=x.current.offsetWidth;S.current.style.setProperty(`padding-right`,`${(e+10)/16}rem`)},[s]),(0,h.jsxs)(`div`,{className:(0,f.cn)(`relative`,d),children:[(0,h.jsx)(o.t,{...b,ref:S,value:C||(t?`0`:``),placeholder:l,disabled:e,readOnly:t,className:(0,f.cn)(`text-end font-number text-sm slashed-zero lining-nums tabular-nums`,t&&`bg-muted text-muted-foreground`,p),onChange:j,onFocus:M,onBlur:N}),s&&(0,h.jsx)(`span`,{ref:x,className:`-translate-y-1/2 pointer-events-none absolute top-1/2 right-2 text-muted-foreground text-sm`,children:s})]})},U=({label:e,description:t,placeholder:n,helperText:r,orientation:i=`responsive`,showErrorMessage:a=!0,rounding:o,decimalPlaces:s,percision:c,unit:l,required:u,allowNegative:d})=>{let p=Q(),_=(0,y.useStore)(p.form.store,({isSubmitting:e})=>e),v=(0,m.useMemo)(()=>p.state.meta.errors,[p.state.meta.errors]),b=(0,m.useMemo)(()=>u?p.state.value===null:!1,[u,p.state.value]),x=(0,m.useCallback)(e=>{_||p.handleChange(e)},[_,p.handleChange]);return(0,h.jsxs)(E,{className:`gap-y-4 px-4`,children:[(0,h.jsxs)(D,{orientation:i,"data-invalid":p.state.meta.isTouched&&!p.state.meta.isValid,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(A,{htmlFor:p.name,"aria-required":b,children:e}),(0,h.jsx)(M,{children:t})]}),(0,h.jsxs)(k,{children:[(0,h.jsxs)(`div`,{className:`relative w-full`,children:[(0,h.jsx)(H,{id:p.name,value:p.state.value,"aria-invalid":p.state.meta.isTouched&&!p.state.meta.isValid&&p.state.meta.isDirty,placeholder:n,roundingRule:o,numberAfterDecimalPoint:s,precision:c,unitText:l,allowNegative:d,className:(0,f.cn)(_&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:p.handleBlur,onValueChange:x}),_&&(0,h.jsx)(`div`,{className:`absolute inset-s-2 inset-y-0 top-2.5 text-muted-weak [&>svg]:size-3.5`,children:(0,h.jsx)(g.Loader2Icon,{className:`animate-spin text-primary-strong`})}),p.state.meta.isDirty&&a&&!!v.length&&(0,h.jsx)(`div`,{className:`absolute inset-s-2 inset-y-0 top-2.75 text-danger-strong [&>svg]:size-3.5`,children:(0,h.jsx)(g.BanIcon,{})}),(0,h.jsx)(`div`,{className:`mt-1 flex w-full flex-col items-end justify-end`,children:p.state.meta.isDirty&&a&&(0,h.jsx)(F,{errors:v})})]}),(0,h.jsx)(N,{isShow:!!r,children:r})]})]}),(0,h.jsx)(P,{})]})},W=({label:e,description:t,placeholder:n,orientation:r=`responsive`,helperText:i,showErrorMessage:a=!0})=>{let{form:s,name:c,state:l,handleBlur:u,handleChange:d}=Q(),f=(0,y.useStore)(s.store,({isSubmitting:e})=>e),[p,_]=(0,m.useState)(!1),v=(0,m.useMemo)(()=>l.meta.isDirty&&l.meta.isTouched&&!l.meta.isValid,[l.meta.isDirty,l.meta.isTouched,l.meta.isValid]),b=(0,m.useCallback)(()=>_(e=>!e),[]),x=(0,m.useCallback)(({target:{value:e}})=>{f||d(e||null)},[f,d]);return(0,h.jsx)(E,{className:`gap-y-4 px-4`,children:(0,h.jsxs)(D,{"data-invalid":v,orientation:r,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(A,{htmlFor:c,children:e}),(0,h.jsx)(M,{children:t})]}),(0,h.jsxs)(k,{children:[(0,h.jsx)(o.t,{id:c,type:p?`text`:`password`,placeholder:n,value:l.value??``,"aria-invalid":v,autoComplete:`new-password`,onBlur:u,onChange:x}),(0,h.jsx)(`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:b,"aria-label":p?`Hide password`:`Show password`,"aria-pressed":p,"aria-controls":`password`,children:p?(0,h.jsx)(g.EyeOffIcon,{size:16,"aria-hidden":`true`}):(0,h.jsx)(g.EyeIcon,{size:16,"aria-hidden":`true`})}),(0,h.jsx)(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:a&&l.meta.isDirty&&(0,h.jsx)(F,{errors:l.meta.errors})}),(0,h.jsx)(N,{isShow:!!i,children:i})]})]})})},G=({label:e,description:t,orientation:n,options:r,helperText:i})=>{let a=Q(),o=(0,y.useStore)(a.form.store,({isSubmitting:e})=>e);return(0,h.jsxs)(E,{className:`px-4`,children:[(0,h.jsxs)(D,{orientation:n,className:`flex-col gap-2`,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(A,{children:e}),(0,h.jsx)(M,{children:t}),(0,h.jsx)(N,{isShow:!!i,children:i})]}),(0,h.jsx)(k,{children:(0,h.jsx)(l.t,{defaultValue:a.state.value??void 0,className:`w-full`,onValueChange:a.handleChange,children:r.map(e=>(0,h.jsx)(A,{className:(0,f.cn)(`h-fit`,a.state.value===e.value&&`border-primary-weak! bg-primary-bg-subtle`,o&&`pointer-events-none bg-muted-muted opacity-60`,a.state.value===e.value&&o&&`border-border-strong!`),children:(0,h.jsxs)(D,{orientation:`horizontal`,className:`justify-between rounded p-2!`,children:[(0,h.jsxs)(O,{className:`gap-1!`,children:[(0,h.jsx)(j,{children:e.label}),(0,h.jsx)(M,{className:`text-xs`,children:e.description})]}),(0,h.jsx)(l.n,{value:e.value})]})},e.value))})})]}),(0,h.jsx)(P,{})]})},K=({label:e,description:t,placeholder:n,orientation:r=`responsive`,options:i,helperText:a,required:o=!1})=>{let s=Q(),c=(0,m.useMemo)(()=>s.state.meta.isTouched&&!s.state.meta.isValid,[s.state.meta.isTouched,s.state.meta.isValid]),l=(0,m.useMemo)(()=>o?s.state.value===null:!1,[o,s.state.value]),d=(0,m.useMemo)(()=>s.state.meta.errors,[s.state.meta.errors]);return(0,h.jsxs)(E,{className:`gap-y-4 px-4`,children:[(0,h.jsxs)(D,{orientation:r,"data-invalid":s.state.meta.isTouched&&!s.state.meta.isValid,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(A,{htmlFor:s.name,"aria-required":l,children:e}),(0,h.jsx)(M,{children:t})]}),(0,h.jsxs)(k,{className:`flex flex-col`,children:[(0,h.jsxs)(u.t,{defaultValue:s.state.value||void 0,onValueChange:s.handleChange,children:[(0,h.jsx)(u.s,{"aria-invalid":c?`true`:void 0,onBlur:s.handleBlur,children:(0,h.jsx)(u.c,{placeholder:n})}),(0,h.jsxs)(u.n,{children:[!!i.length&&i.map(e=>(0,h.jsx)(u.i,{value:e.value,children:e.label},e.value)),!i.length&&(0,h.jsxs)(`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:[(0,h.jsx)(g.PackagePlusIcon,{strokeWidth:1}),`No options available`]})]})]}),(0,h.jsx)(`div`,{className:`mt-1 flex w-full flex-col items-end justify-end`,children:(0,h.jsx)(F,{errors:d})}),(0,h.jsx)(N,{isShow:!!a,children:a})]})]}),(0,h.jsx)(P,{})]})};function q({className:e,...t}){return(0,h.jsx)(v.Switch.Root,{"data-slot":`switch`,className:(0,f.cn)(`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:(0,h.jsx)(v.Switch.Thumb,{"data-slot":`switch-thumb`,className:(0,f.cn)(`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 J=({label:e,description:t,helperText:n})=>{let r=Q();return(0,h.jsxs)(E,{className:`gap-y-4 px-4`,children:[(0,h.jsxs)(D,{orientation:`vertical`,className:`relative justify-between gap-y-1`,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(j,{className:`cursor-pointer`,children:(0,h.jsx)(`label`,{htmlFor:r.name,children:e})}),(0,h.jsx)(M,{children:t}),(0,h.jsx)(q,{id:r.name,checked:r.state.value??!1,className:`absolute top-1 right-1`,onBlur:r.handleBlur,onCheckedChange:r.handleChange})]}),(0,h.jsx)(N,{isShow:!!n,children:n})]}),(0,h.jsx)(P,{})]})},ee=({label:e,description:t,placeholder:n,helperText:r,counter:i=!1,orientation:a=`responsive`,showClearButton:s=!1,showErrorMessage:c=!0,required:l=!1,maxLength:u})=>{let d=(0,m.useId)(),p=(0,m.useRef)(null),{form:_,name:v,state:b,handleBlur:x,handleChange:S}=Q(),C=(0,y.useStore)(_.store,({isSubmitting:e})=>e),w=s&&!C&&!!b.value&&!b.meta.errors.length,T=b.value?b.value.length:0,j=(0,m.useMemo)(()=>{if(!i)return``;let e=`character${[0,1].includes(T)?``:`s`}`;return i&&u?`${T} / ${u} character${T?`s`:``}`:`${T} ${e}`},[T,i,u]),I=b.meta.isDirty&&b.meta.isTouched&&!b.meta.isValid,L=l?b.value===null:!1,R=u&&T>=u*.8,z=u&&T>=u,B=(0,m.useCallback)(({target:{value:e}})=>{C||i&&u&&e.length>u||S(e||null)},[C,i,u,S]),V=(0,m.useCallback)(()=>{C||(S(null),p.current?.focus())},[C,S]);return(0,h.jsxs)(E,{className:`gap-y-4 px-4`,children:[(0,h.jsxs)(D,{orientation:a,"data-invalid":I,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(A,{"aria-required":L,htmlFor:d,children:(0,h.jsxs)(`p`,{children:[e,l&&(0,h.jsx)(`span`,{className:`text-danger-strong`,children:` *`})]})}),(0,h.jsx)(M,{children:t})]}),(0,h.jsxs)(k,{children:[(0,h.jsx)(o.t,{ref:p,id:d,name:v,value:b.value??``,"aria-invalid":I,autoComplete:`off`,placeholder:n,autoCapitalize:`none`,autoCorrect:`off`,className:(0,f.cn)(`pr-6`,C&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:x,onChange:B}),w&&(0,h.jsx)(`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:V,children:(0,h.jsx)(g.XIcon,{"aria-hidden":`true`})}),C&&(0,h.jsx)(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-muted-weak`,children:(0,h.jsx)(g.Loader2Icon,{size:14,className:`animate-spin text-primary-strong`})}),b.meta.isDirty&&c&&!!b.meta.errors.length&&(0,h.jsx)(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-danger-strong`,children:(0,h.jsx)(g.BanIcon,{"aria-hidden":`true`,size:14})}),(0,h.jsxs)(`div`,{className:`my-1 flex w-full items-start justify-between gap-x-2`,children:[b.meta.isDirty&&c?(0,h.jsx)(F,{className:`flex-1`,errors:b.meta.errors}):(0,h.jsx)(`div`,{}),!!i&&(0,h.jsx)(`p`,{className:(0,f.cn)(`h-4 flex-0 text-nowrap text-end text-xs tabular-nums transition-colors`,z?`font-medium text-danger-strong`:R?`text-warning-strong`:`text-text-positive-weak`),children:j})]}),(0,h.jsx)(N,{isShow:!!r,children:r})]})]}),(0,h.jsx)(P,{})]})},te=(0,m.memo)(({label:e,description:t,placeholder:n,helperText:r,counter:i=!1,orientation:a=`responsive`,showErrorMessage:o=!0,required:s=!1,maxLength:c})=>{let l=(0,m.useId)(),{form:u,state:p,name:_,handleBlur:v,handleChange:b}=Q(),x=(0,y.useStore)(u.store,({isSubmitting:e})=>e),S=p.value?p.value.length:0,C=(0,m.useMemo)(()=>{if(!i)return``;let e=`character${[0,1].includes(S)?``:`s`}`;return i&&c?`${S} / ${c} character${S?`s`:``}`:`${S} ${e}`},[S,i,c]),w=p.meta.isDirty&&p.meta.isTouched&&!p.meta.isValid,T=s?p.value===null:!1,j=p.meta.errors,I=c&&S>=c*.8,L=c&&S>=c,R=(0,m.useCallback)(({target:{value:e}})=>{x||i&&c&&e.length>c||b(e||null)},[x,i,c,b]);return(0,h.jsxs)(E,{className:`gap-y-4 px-4`,children:[(0,h.jsxs)(D,{orientation:a,"data-invalid":w,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(A,{"aria-required":T,htmlFor:l,children:(0,h.jsxs)(`p`,{children:[e,s&&(0,h.jsx)(`span`,{className:`text-danger-strong`,children:` *`})]})}),(0,h.jsx)(M,{children:t})]}),(0,h.jsxs)(k,{children:[(0,h.jsx)(d.t,{id:l,name:_,value:p.value===null?``:p.value,"aria-invalid":w,autoCapitalize:`none`,autoComplete:`off`,placeholder:n,className:(0,f.cn)(x&&`pointer-events-none bg-muted-muted opacity-60`),onChange:R,onBlur:v}),x&&(0,h.jsx)(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-muted-weak`,children:(0,h.jsx)(g.Loader2Icon,{size:14,className:`animate-spin text-primary-strong`})}),p.meta.isDirty&&o&&!!j.length&&(0,h.jsx)(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-danger-strong`,children:(0,h.jsx)(g.BanIcon,{size:14})}),(0,h.jsxs)(`div`,{className:`my-1 flex w-full items-start justify-between gap-x-2`,children:[p.meta.isDirty&&o?(0,h.jsx)(F,{className:`flex-1`,errors:p.meta.errors}):(0,h.jsx)(`div`,{}),!!i&&(0,h.jsx)(`p`,{className:(0,f.cn)(`h-4 flex-0 text-nowrap text-end text-xs tabular-nums transition-colors`,L?`font-medium text-danger-strong`:I?`text-warning-strong`:`text-text-positive-weak`),children:C})]}),(0,h.jsx)(N,{isShow:!!r,children:r})]})]}),(0,h.jsx)(P,{})]})}),ne=({label:e,className:n})=>{let r=$(),i=(0,m.useCallback)(async()=>{await r.handleSubmit({submitAction:`submit`}),r.state.isSubmitSuccessful&&r.reset()},[r]);return(0,h.jsx)(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})=>(0,h.jsx)(t.t,{type:`button`,size:`md`,disabled:r,isLoading:a,className:(0,f.cn)(`min-h-8 min-w-32`,n),onClick:i,children:e??`Submit`})})},re=({type:e=`create`})=>{let n=$();return(0,h.jsxs)(`div`,{className:`flex h-8 items-center justify-between`,children:[(0,h.jsx)(n.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:e})=>(0,h.jsx)(t.t,{color:`muted`,variant:`outline`,type:`button`,size:`md`,disabled:e,className:`h-full min-w-32`,onClick:()=>n.reset(),children:`Cancel`})}),e===`create`&&(0,h.jsx)(n.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:e,isSubmitting:r})=>(0,h.jsxs)(t.t,{type:`submit`,size:`md`,disabled:e,isLoading:r,className:`h-full min-w-32`,onClick:async()=>{await n.handleSubmit({submitAction:`create`}),n.state.isSubmitSuccessful&&n.reset()},children:[(0,h.jsx)(g.PlusIcon,{}),`Add New`]})}),e===`update`&&(0,h.jsx)(n.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:e,isSubmitting:r})=>(0,h.jsxs)(t.t,{type:`submit`,size:`md`,disabled:e,isLoading:r,className:`h-full min-w-32`,onClick:async()=>{await n.handleSubmit({submitAction:`update`}),n.state.isSubmitSuccessful&&n.reset()},children:[(0,h.jsx)(g.ArrowDownToLine,{}),`Update`]})})]})};function Y({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,h.jsx)(v.Separator.Root,{"data-slot":`separator`,decorative:n,orientation:t,className:(0,f.cn)(`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 ie=({title:e,description:n,onDelete:r,children:i})=>(0,h.jsxs)(`section`,{"data-slot":`card-form`,className:`relative flex flex-col rounded-md bg-card pb-4 shadow-card ring-4 ring-border-weak`,children:[(0,h.jsxs)(`div`,{"data-slot":`card-form-header`,className:`flex flex-col space-y-1 p-4`,children:[(0,h.jsx)(`p`,{className:`font-semibold text-lg`,children:e}),!!n&&(0,h.jsx)(`p`,{className:`text-muted text-sm`,children:n})]}),(0,h.jsx)(Y,{}),(0,h.jsx)(`div`,{"data-slot":`card-form-main`,className:`flex flex-col space-y-4 py-4`,children:i}),!!r&&(0,h.jsxs)(t.t,{color:`danger`,variant:`outline`,size:`sm`,className:`absolute top-2 right-2`,onClick:e=>{r?.(),e.preventDefault(),e.stopPropagation()},children:[(0,h.jsx)(g.Trash2Icon,{}),`Remove`]})]}),ae=({children:e})=>(0,h.jsx)(`div`,{"data-slot":`section-form`,className:`flex flex-col space-y-4`,children:e}),X=({...e})=>(0,h.jsx)(`button`,{...e,type:`button`,className:`min-w-40 cursor-pointer rounded-sm border border-border bg-card px-4 py-2 font-semibold text-sm text-text-positive shadow-xs outline-none transition-all hover:opacity-90 focus:border-border focus:ring-3 focus:ring-border/80 focus:ring-offset-2 focus:drop-shadow-none disabled:pointer-events-none disabled:opacity-60 disabled:drop-shadow-none`,children:`Hủy`}),Z=({isSubmitting:e,submitText:t=`Submit`,...n})=>(0,h.jsx)(`button`,{...n,type:`button`,"data-loading":e?`true`:void 0,className:`relative min-h-9.5 min-w-40 cursor-pointer rounded-sm border border-primary-strong bg-primary px-4 py-2 font-semibold text-sm text-text-negative shadow-card outline-none transition-all hover:opacity-90 focus:border-transparent focus:ring-3 focus:ring-primary/80 focus:ring-offset-2 focus:drop-shadow-none disabled:pointer-events-none disabled:opacity-60 disabled:drop-shadow-none data-[loading=true]:pointer-events-none data-[loading=true]:opacity-80`,children:e?(0,h.jsx)(g.Loader2,{size:16,strokeWidth:3,className:`absolute top-1/2 left-1/2 z-10 -translate-x-1/2 -translate-y-1/2 animate-spin`}):t}),oe=({title:e,submitText:t,open:r,onOpenChange:a,children:o})=>{let s=$(),c=(0,m.useCallback)(e=>{e||s.reset(),a?.(e)},[s.reset,a]);return(0,h.jsx)(i.t,{open:r,onOpenChange:c,children:(0,h.jsxs)(i.c,{"data-slot":`dialog-portal`,children:[(0,h.jsx)(i.s,{}),(0,h.jsxs)(i.r,{className:`flex size-full max-h-dvh max-w-dvw flex-col gap-0 overflow-y-auto p-0 shadow-dialog sm:h-auto sm:max-h-[85dvh] sm:max-w-2xl sm:rounded-sm`,children:[(0,h.jsx)(`div`,{"data-slot":`dialog-header`,className:`flex flex-col items-center justify-center gap-2 px-4 py-6 text-center shadow-sm sm:text-left`,children:(0,h.jsx)(i.l,{"data-slot":`dialog-title`,children:e})}),(0,h.jsx)(n.t,{}),(0,h.jsx)(`div`,{"data-slot":`dialog-content`,className:`relative flex flex-col space-y-4 overflow-y-auto p-0 pt-6 max-sm:flex-1 sm:p-4`,children:o}),(0,h.jsx)(n.t,{}),(0,h.jsxs)(`div`,{"data-slot":`dialog-footer`,className:`flex flex-col-reverse items-center justify-between gap-2 px-6 py-4 shadow-sm sm:flex-row sm:justify-end max-sm:[&>button]:w-full`,children:[(0,h.jsx)(s.Subscribe,{selector:e=>({disabled:e.isSubmitting}),children:({disabled:e})=>(0,h.jsx)(X,{disabled:e,onClick:()=>{s.reset(),c(!1)}})}),(0,h.jsx)(s.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:n})=>(0,h.jsx)(Z,{isSubmitting:e,disabled:n,submitText:t,onClick:()=>s.handleSubmit()})})]})]})]})})},se=({label:e,description:t,helperText:n,orientation:r=`responsive`,children:i})=>(0,h.jsxs)(E,{className:`gap-y-4 px-4`,children:[(0,h.jsxs)(D,{orientation:r,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(A,{children:e}),(0,h.jsx)(M,{children:t})]}),(0,h.jsxs)(k,{children:[i,(0,h.jsx)(N,{isShow:!!n,children:n})]})]}),(0,h.jsx)(P,{})]}),ce=({title:e,open:t,contentClassName:n,onOpenChange:i,children:a})=>{let o=$();return(0,h.jsx)(v.Dialog.Root,{"data-slot":`dialog`,open:t,onOpenChange:i,children:(0,h.jsxs)(v.Dialog.Portal,{"data-slot":`dialog-portal`,children:[(0,h.jsx)(v.Dialog.Overlay,{"data-slot":`dialog-overlay`,className:(0,f.cn)(`fixed inset-0 z-40 bg-black/50 backdrop-blur-sm`,`data-[state=open]:animate-in`,`data-[state=open]:fade-in`,`data-[state=closed]:animate-out`,`data-[state=closed]:fade-out`)}),(0,h.jsx)(v.Dialog.Content,{"data-slot":`dialog-content`,className:(0,f.cn)(`fixed top-4 right-4 z-50 h-[calc(100dvh-2rem)] min-w-sm max-w-xl rounded-md bg-background drop-shadow-lg`,`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:(0,h.jsxs)(`section`,{className:`relative flex size-full flex-col`,children:[(0,h.jsx)(`header`,{className:`flex h-14 items-center border-border border-b px-4`,children:(0,h.jsx)(`h2`,{className:`font-semibold text-lg text-primary-strong`,children:e})}),(0,h.jsx)(`div`,{className:(0,f.cn)(`flex flex-1 flex-col overflow-y-auto py-4`,n),children:a}),(0,h.jsxs)(`div`,{className:`flex flex-col space-y-4 border-border border-t px-4 py-2`,children:[(0,h.jsx)(o.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:t})=>(0,h.jsx)(Z,{isSubmitting:e,disabled:t,className:`w-full`,onClick:()=>o.handleSubmit()})}),(0,h.jsx)(o.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:e})=>(0,h.jsx)(X,{disabled:e,className:`w-full`,onClick:()=>{o.reset(),i?.(!1)}})})]}),(0,h.jsx)(v.Dialog.Close,{asChild:!0,children:(0,h.jsx)(r.t,{className:`absolute top-2 right-2`})})]})})]})})},le=({children:e})=>(0,h.jsx)(`header`,{"data-slot":`section-header`,className:`px-4 pt-2.5 pb-2 font-medium text-base text-text-positive`,children:e}),ue=({children:e})=>(0,h.jsx)(`main`,{"data-slot":`section-main`,className:`relative flex flex-col space-y-4 py-4`,children:e}),de=({title:e,children:t})=>(0,h.jsxs)(`section`,{"data-slot":`section-form`,className:`flex flex-col rounded-md bg-background shadow-card ring-4 ring-border-weak`,children:[(0,h.jsx)(le,{children:e}),(0,h.jsx)(Y,{}),(0,h.jsx)(ue,{children:t})]}),fe=({title:e,description:t,helperText:n})=>(0,h.jsxs)(E,{className:`gap-y-4 px-4`,children:[(0,h.jsxs)(D,{className:`gap-0`,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(T,{className:`mb-1`,children:e}),(0,h.jsx)(M,{children:t})]}),(0,h.jsx)(N,{isShow:!!n,children:n})]}),(0,h.jsx)(P,{})]}),{fieldContext:pe,formContext:me,useFieldContext:Q,useFormContext:$}=(0,y.createFormHookContexts)(),{useAppForm:he,withForm:ge,withFieldGroup:_e}=(0,y.createFormHook)({fieldContext:pe,formContext:me,fieldComponents:{TextField:ee,TextareaField:te,NumberField:U,EmailField:R,PasswordField:W,SelectField:K,DateField:L,SwitchField:J,RadioGroupField:G,CheckboxField:I,FieldGroup:E,Field:D,FieldContent:O,FieldLabel:A,FieldContentMain:k,FieldSeparator:P,FieldError:F},formComponents:{TanStackDialogForm:oe,TanStackPopoverForm:ce,TanStackContainerForm:ae,TanStackSectionForm:de,TanStackCardForm:ie,TanStackFieldGroup:se,TanStackTitleField:fe,TanStackActionsForm:re,TanStackActionSubmit:ne}});exports.Field=D,exports.FieldContent=O,exports.FieldContentMain=k,exports.FieldError=F,exports.FieldGroup=E,exports.FieldLabel=A,exports.FieldSeparator=P,exports.useTanStackFieldContext=Q,exports.useTanStackForm=he,exports.useTanStackFormContext=$,exports.withTanStackFieldGroup=_e,exports.withTanStackForm=ge;
1
+ const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../heading-BEm5CCSE.cjs`),require(`../../paragraph-B72bHMf7.cjs`),require(`../../button.variants-CS-Cmarr.cjs`);const t=require(`../../button-CpEejahy.cjs`),n=require(`../../separator-C3ip6sbh.cjs`),r=require(`../../close-D_Ge7gnP.cjs`),i=require(`../../dialog-DjRiV5vR.cjs`),a=require(`../../checkbox-C0fSWwmD.cjs`),o=require(`../../input-BFWWaN-v.cjs`),s=require(`../../popover-DzDrgttC.cjs`),c=require(`../../calendar-dhPqb3aZ.cjs`),l=require(`../../radio-group-CBhRsUjN.cjs`),u=require(`../../select-2CgwiefV.cjs`),d=require(`../../textarea-COQoSVSc.cjs`);let f=require(`@customafk/react-toolkit/utils`),p=require(`class-variance-authority`),m=require(`react`),h=require(`react/jsx-runtime`),g=require(`lucide-react`),_=require(`@customafk/react-toolkit/date-fns`),v=require(`radix-ui`),y=require(`@tanstack/react-form`);const b=(0,p.cva)([`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`}}),x=({label:e,color:t,size:n,className:r,children:i})=>(0,h.jsx)(`div`,{"data-slot":`required-indicator`,className:b({color:t,size:n,className:r}),children:e||i});function S({className:e,children:t,...n}){return(0,h.jsxs)(v.Label.Root,{"data-slot":`label`,className:(0,f.cn)(`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:[t,(0,h.jsx)(x,{label:`Required`,color:`danger`,size:`sm`,className:`hidden`})]})}const C=(0,p.cva)(`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`}}),w=(0,m.memo)(({className:e,...t})=>(0,h.jsx)(`fieldset`,{"data-slot":`field-set`,className:(0,f.cn)(`flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,e),...t}));w.displayName=`FieldSet`;const T=(0,m.memo)(({className:e,variant:t=`legend`,...n})=>(0,h.jsx)(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:(0,f.cn)(`mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,e),...n}));T.displayName=`FieldLegend`;const E=(0,m.memo)(({className:e,...t})=>(0,h.jsx)(`div`,{"data-slot":`field-group`,className:(0,f.cn)(`group/field-group @container/field-group`,`flex flex-col gap-7`,`data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,e),...t}));E.displayName=`FieldGroup`;const D=(0,m.memo)(({className:e,orientation:t=`vertical`,...n})=>(0,h.jsx)(`div`,{"data-slot":`field`,"data-orientation":t,className:(0,f.cn)(C({orientation:t}),e),...n}));D.displayName=`Field`;const O=(0,m.memo)(({className:e,...t})=>(0,h.jsx)(`div`,{"data-slot":`field-content`,className:(0,f.cn)(`group/field-content flex flex-col gap-1.5 leading-snug`,e),...t}));O.displayName=`FieldContent`;const k=(0,m.memo)(({className:e,...t})=>(0,h.jsx)(`div`,{"data-slot":`field-content-main`,className:(0,f.cn)(`relative`,e),...t})),A=(0,m.memo)(({className:e,...t})=>(0,h.jsx)(S,{"data-slot":`field-label`,className:(0,f.cn)(`group/field-label peer/field-label flex 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}));A.displayName=`FieldLabel`;const j=(0,m.memo)(({className:e,...t})=>(0,h.jsx)(`div`,{"data-slot":`field-label`,className:(0,f.cn)(`flex w-fit items-center gap-2 font-medium text-sm leading-snug group-data-[disabled=true]/field:opacity-50`,e),...t}));j.displayName=`FieldTitle`;const M=(0,m.memo)(({className:e,...t})=>(0,h.jsx)(`p`,{"data-slot":`field-description`,className:(0,f.cn)(`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}));M.displayName=`FieldDescription`;const N=(0,m.memo)(({isShow:e=!0,className:t,...n})=>e===!1?null:(0,h.jsx)(`div`,{"data-slot":`field-note`,className:(0,f.cn)(`text-wrap rounded border border-primary-muted bg-primary-bg-subtle p-2 text-text-positive-weak text-xs`,t),...n}));N.displayName=`FieldNote`;const P=(0,m.memo)(({children:e,className:t,...r})=>(0,h.jsxs)(`div`,{"data-slot":`field-separator`,"data-content":!!e,className:(0,f.cn)(`relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2`,t),...r,children:[(0,h.jsx)(n.t,{className:`absolute inset-0 top-1/2`}),e&&(0,h.jsx)(`span`,{className:`relative mx-auto block w-fit bg-background px-2 text-text-positive-weak`,"data-slot":`field-separator-content`,children:e})]}));P.displayName=`FieldSeparator`;const F=(0,m.memo)(({className:e,children:t,errors:n,...r})=>{let i=(0,m.useMemo)(()=>t||(n?n?.length===1&&n[0]?.message?(0,h.jsx)(`div`,{className:`flex flex-row items-center justify-start gap-x-0.5`,children:(0,h.jsx)(`p`,{children:n[0]?.code===`invalid_type`?`Không đúng định dạng`:n[0].message})}):(0,h.jsx)(`ul`,{className:`flex list-none flex-col`,children:n.map(e=>typeof e==`string`?(0,h.jsx)(`li`,{children:e},e):e?.message?(0,h.jsx)(`li`,{children:e.message},e.message):null)}):null),[t,n]);return i?(0,h.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:(0,f.cn)(`w-full font-semibold text-danger-strong text-xs`,e),...r,children:i}):null});F.displayName=`FieldError`;const I=({label:e,description:t,options:n,helperText:r,orientation:i})=>{let o=Q(),s=(0,y.useStore)(o.form.store,({isSubmitting:e})=>e);return(0,h.jsxs)(E,{className:`gap-y-4 px-4`,children:[(0,h.jsxs)(D,{orientation:i,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(A,{children:e}),(0,h.jsx)(M,{children:t}),(0,h.jsx)(N,{isShow:!!r,children:r})]}),(0,h.jsx)(k,{children:(0,h.jsx)(E,{className:`flex flex-col gap-y-2`,children:n.map(e=>(0,h.jsxs)(D,{orientation:`horizontal`,children:[(0,h.jsx)(a.t,{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 !t&&o.state.value===null&&o.setValue(null)}}),(0,h.jsx)(A,{htmlFor:`${o.name}-${e.value}`,className:`text-text-positive`,children:e.label})]},e.value))})})]}),(0,h.jsx)(P,{})]})},L=({label:e,description:n,placeholder:r,orientation:i=`responsive`,helperText:a,minDate:o,maxDate:l,required:u})=>{let d=Q(),p=(0,m.useMemo)(()=>u?d.state.value===null:!1,[u,d.state.value]),v=(0,m.useMemo)(()=>d.state.meta.isTouched&&!d.state.meta.isValid,[d.state.meta.isTouched,d.state.meta.isValid]);return(0,h.jsxs)(E,{className:`px-4`,children:[(0,h.jsxs)(D,{orientation:i,"data-invalid":v,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(A,{htmlFor:d.name,"aria-required":p,children:e}),(0,h.jsx)(M,{children:n})]}),(0,h.jsxs)(k,{className:`flex flex-col space-y-1`,children:[(0,h.jsx)(`div`,{className:`flex w-full flex-col`,children:(0,h.jsxs)(s.t,{children:[(0,h.jsx)(s.a,{asChild:!0,children:(0,h.jsxs)(t.t,{variant:`outline`,color:`muted`,size:`lg`,className:(0,f.cn)(`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`,d.state.value===null&&`text-text-positive-muted`),children:[(0,h.jsx)(`p`,{children:d.state.value===null?r||`Select date`:(0,_.format)(d.state.value,`PPPP`)}),(0,h.jsx)(g.CalendarDaysIcon,{strokeWidth:1})]})}),(0,h.jsxs)(s.i,{align:`start`,side:`bottom`,className:`flex w-fit min-w-0 overflow-y-auto rounded p-0`,onBlur:d.handleBlur,children:[(0,h.jsxs)(`div`,{className:`flex h-full flex-col space-y-2 border-r border-r-border p-2 [&>button]:justify-start [&>button]:text-sm`,children:[(0,h.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,_.endOfToday)())},children:`Today`}),(0,h.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,_.endOfTomorrow)())},children:`Tomorrow`}),(0,h.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,_.endOfYesterday)())},children:`Yesterday`}),(0,h.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,_.subDays)((0,_.endOfToday)(),3))},children:`Last 3 Days`}),(0,h.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,_.subDays)((0,_.endOfToday)(),7))},children:`Last 7 Days`}),(0,h.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,_.subDays)((0,_.endOfToday)(),30))},children:`Last 30 Days`}),(0,h.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,_.startOfMonth)((0,_.endOfToday)()))},children:`This Month`}),(0,h.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,_.lastDayOfMonth)((0,_.endOfToday)()))},children:`Last Month`})]}),(0,h.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,h.jsx)(`div`,{className:`min-w-73 border-b border-b-border p-2`,children:(0,h.jsx)(c.t,{mode:`single`,selected:d.state.value??void 0,hidden:{before:o??new Date(1900,0,1),after:l??new Date(2100,11,31)},onSelect:e=>{e&&d.handleChange(e)}})})})]})]})}),(0,h.jsx)(N,{isShow:!!a,children:a})]})]}),(0,h.jsx)(P,{})]})},R=({label:e,description:t,placeholder:n,helperText:r,orientation:i=`responsive`,showErrorMessage:a=!0,maxLength:s})=>{let{form:c,name:l,state:u,handleBlur:d,handleChange:p}=Q(),_=(0,y.useStore)(c.store,({isSubmitting:e})=>e),v=(0,m.useMemo)(()=>u.meta.isDirty&&u.meta.isTouched&&!u.meta.isValid,[u.meta.isDirty,u.meta.isTouched,u.meta.isValid]),b=(0,m.useCallback)(({target:{value:e}})=>{_||s&&e.length>s||p(e||null)},[_,s,p]),x=(0,m.useCallback)(()=>{_||p(null)},[_,p]);return(0,h.jsxs)(E,{className:`gap-y-4 px-4`,children:[(0,h.jsxs)(D,{"data-invalid":v,orientation:i,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(A,{htmlFor:l,children:e}),(0,h.jsx)(M,{children:t})]}),(0,h.jsxs)(k,{children:[(0,h.jsx)(o.t,{id:l,name:l,value:u.value===null?``:u.value,"aria-invalid":v,autoComplete:`email`,placeholder:n,className:(0,f.cn)(`pl-9`,_&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:d,onChange:b}),(0,h.jsx)(`div`,{className:`absolute top-0 left-0 flex size-9 items-center justify-center text-muted`,children:(0,h.jsx)(g.AtSignIcon,{size:14})}),(0,h.jsx)(`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:x,children:(0,h.jsx)(g.XIcon,{size:14,"aria-hidden":`true`})}),(0,h.jsx)(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:a&&u.meta.isDirty&&(0,h.jsx)(F,{errors:u.meta.errors})}),(0,h.jsx)(N,{isShow:!!r,children:r})]})]}),(0,h.jsx)(P,{})]})},z=e=>e?/^-?\d*\.?\d*$/:/^\d*\.?\d*$/,B=e=>Number(e).toLocaleString(),V=(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}},H=({disabled:e=!1,readOnly:t=!1,allowNegative:n=!1,numberAfterDecimalPoint:r=2,roundingRule:i=`none`,value:a=null,unitText:s,decimal:c,placeholder:l,precision:u,wrapperClassName:d,className:p,onChange:g,onValueChange:_,onFocus:v,onBlur:y,...b})=>{let x=(0,m.useRef)(null),S=(0,m.useRef)(null),[C,w]=(0,m.useState)(a?.toString()??null),T=(0,m.useMemo)(()=>c?.[1]??r,[c,r]),E=(0,m.useMemo)(()=>c&&c[0]-c[1],[c]),D=(0,m.useMemo)(()=>z(n),[n]),O=(0,m.useCallback)(e=>{if(!T||e===`-`)return!0;let[t,n=``]=e.split(`.`),r=t.startsWith(`-`)?t.length-1:t.length;return n.length<=T&&r<=(E??1/0)},[T,E]),k=(0,m.useCallback)(e=>{if(e===`0`)return`0`;if(!Number(e))return null;let[t,n=``]=V(parseFloat(e),Math.min(T-1,u||0),i).toString().split(`.`),r=B(t);return n?`${r}.${n}`:r},[T,u,i]),A=(0,m.useCallback)(e=>{let t=e===`0`,n=e===`-`||/^-0+(\.0+)?$/.test(e)||/^-0*\.$/.test(e);if(t){_?.(0),w(e);return}if(n){w(()=>(_?.(0),e));return}},[_]),j=(0,m.useCallback)(e=>{g?.(e);let{value:t}=e.target;if(t===``||t===void 0){_?.(null),w(null);return}A(t),!(!D.test(t)||!O(t))&&(_?.(parseFloat(t)||0),w(t))},[O,g,_,A,D]),M=(0,m.useCallback)(e=>{t||(v?.(e),w(e=>typeof e==`string`?e.replace(/,/g,``):null))},[t,v]),N=(0,m.useCallback)(e=>{t||(y?.(e),w(e=>e===null?null:e===`0`||e===`-`||/^-0+(\.0+)?$/.test(e)||/^-0*\.$/.test(e)?`0`:typeof e==`string`?k(e):null))},[t,k,y]);return(0,m.useEffect)(()=>{let e=document.activeElement===S.current;if(a==null||!D.test(a.toString())||!O(a.toString())){w(null);return}w(t=>e?t:k(a.toString()))},[k,a,O,D]),(0,m.useEffect)(()=>{if(!x.current||!S.current||!s)return;let e=x.current.offsetWidth;S.current.style.setProperty(`padding-right`,`${(e+10)/16}rem`)},[s]),(0,h.jsxs)(`div`,{className:(0,f.cn)(`relative`,d),children:[(0,h.jsx)(o.t,{...b,ref:S,value:C||(t?`0`:``),placeholder:l,disabled:e,readOnly:t,className:(0,f.cn)(`text-end font-number text-sm slashed-zero lining-nums tabular-nums`,t&&`bg-muted text-muted-foreground`,p),onChange:j,onFocus:M,onBlur:N}),s&&(0,h.jsx)(`span`,{ref:x,className:`-translate-y-1/2 pointer-events-none absolute top-1/2 right-2 text-muted-foreground text-sm`,children:s})]})},U=({label:e,description:t,placeholder:n,helperText:r,orientation:i=`responsive`,showErrorMessage:a=!0,rounding:o,decimalPlaces:s,percision:c,unit:l,required:u,allowNegative:d})=>{let p=Q(),_=(0,y.useStore)(p.form.store,({isSubmitting:e})=>e),v=(0,m.useMemo)(()=>p.state.meta.errors,[p.state.meta.errors]),b=(0,m.useMemo)(()=>u?p.state.value===null:!1,[u,p.state.value]),x=(0,m.useCallback)(e=>{_||p.handleChange(e)},[_,p.handleChange]);return(0,h.jsxs)(E,{className:`gap-y-4 px-4`,children:[(0,h.jsxs)(D,{orientation:i,"data-invalid":p.state.meta.isTouched&&!p.state.meta.isValid,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(A,{htmlFor:p.name,"aria-required":b,children:e}),(0,h.jsx)(M,{children:t})]}),(0,h.jsxs)(k,{children:[(0,h.jsxs)(`div`,{className:`relative w-full`,children:[(0,h.jsx)(H,{id:p.name,value:p.state.value,"aria-invalid":p.state.meta.isTouched&&!p.state.meta.isValid&&p.state.meta.isDirty,placeholder:n,roundingRule:o,numberAfterDecimalPoint:s,precision:c,unitText:l,allowNegative:d,className:(0,f.cn)(_&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:p.handleBlur,onValueChange:x}),_&&(0,h.jsx)(`div`,{className:`absolute inset-s-2 inset-y-0 top-2.5 text-muted-weak [&>svg]:size-3.5`,children:(0,h.jsx)(g.Loader2Icon,{className:`animate-spin text-primary-strong`})}),p.state.meta.isDirty&&a&&!!v.length&&(0,h.jsx)(`div`,{className:`absolute inset-s-2 inset-y-0 top-2.75 text-danger-strong [&>svg]:size-3.5`,children:(0,h.jsx)(g.BanIcon,{})}),(0,h.jsx)(`div`,{className:`mt-1 flex w-full flex-col items-end justify-end`,children:p.state.meta.isDirty&&a&&(0,h.jsx)(F,{errors:v})})]}),(0,h.jsx)(N,{isShow:!!r,children:r})]})]}),(0,h.jsx)(P,{})]})},W=({label:e,description:t,placeholder:n,orientation:r=`responsive`,helperText:i,showErrorMessage:a=!0})=>{let{form:s,name:c,state:l,handleBlur:u,handleChange:d}=Q(),f=(0,y.useStore)(s.store,({isSubmitting:e})=>e),[p,_]=(0,m.useState)(!1),v=(0,m.useMemo)(()=>l.meta.isDirty&&l.meta.isTouched&&!l.meta.isValid,[l.meta.isDirty,l.meta.isTouched,l.meta.isValid]),b=(0,m.useCallback)(()=>_(e=>!e),[]),x=(0,m.useCallback)(({target:{value:e}})=>{f||d(e||null)},[f,d]);return(0,h.jsx)(E,{className:`gap-y-4 px-4`,children:(0,h.jsxs)(D,{"data-invalid":v,orientation:r,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(A,{htmlFor:c,children:e}),(0,h.jsx)(M,{children:t})]}),(0,h.jsxs)(k,{children:[(0,h.jsx)(o.t,{id:c,type:p?`text`:`password`,placeholder:n,value:l.value??``,"aria-invalid":v,autoComplete:`new-password`,onBlur:u,onChange:x}),(0,h.jsx)(`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:b,"aria-label":p?`Hide password`:`Show password`,"aria-pressed":p,"aria-controls":`password`,children:p?(0,h.jsx)(g.EyeOffIcon,{size:16,"aria-hidden":`true`}):(0,h.jsx)(g.EyeIcon,{size:16,"aria-hidden":`true`})}),(0,h.jsx)(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:a&&l.meta.isDirty&&(0,h.jsx)(F,{errors:l.meta.errors})}),(0,h.jsx)(N,{isShow:!!i,children:i})]})]})})},G=({label:e,description:t,orientation:n,options:r,helperText:i})=>{let a=Q(),o=(0,y.useStore)(a.form.store,({isSubmitting:e})=>e);return(0,h.jsxs)(E,{className:`px-4`,children:[(0,h.jsxs)(D,{orientation:n,className:`flex-col gap-2`,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(A,{children:e}),(0,h.jsx)(M,{children:t}),(0,h.jsx)(N,{isShow:!!i,children:i})]}),(0,h.jsx)(k,{children:(0,h.jsx)(l.t,{defaultValue:a.state.value??void 0,className:`w-full`,onValueChange:a.handleChange,children:r.map(e=>(0,h.jsx)(A,{className:(0,f.cn)(`h-fit`,a.state.value===e.value&&`border-primary-weak! bg-primary-bg-subtle`,o&&`pointer-events-none bg-muted-muted opacity-60`,a.state.value===e.value&&o&&`border-border-strong!`),children:(0,h.jsxs)(D,{orientation:`horizontal`,className:`justify-between rounded p-2!`,children:[(0,h.jsxs)(O,{className:`gap-1!`,children:[(0,h.jsx)(j,{children:e.label}),(0,h.jsx)(M,{className:`text-xs`,children:e.description})]}),(0,h.jsx)(l.n,{value:e.value})]})},e.value))})})]}),(0,h.jsx)(P,{})]})},K=({label:e,description:t,placeholder:n,orientation:r=`responsive`,options:i,helperText:a,required:o=!1})=>{let s=Q(),c=(0,m.useMemo)(()=>s.state.meta.isTouched&&!s.state.meta.isValid,[s.state.meta.isTouched,s.state.meta.isValid]),l=(0,m.useMemo)(()=>o?s.state.value===null:!1,[o,s.state.value]),d=(0,m.useMemo)(()=>s.state.meta.errors,[s.state.meta.errors]);return(0,h.jsxs)(E,{className:`gap-y-4 px-4`,children:[(0,h.jsxs)(D,{orientation:r,"data-invalid":s.state.meta.isTouched&&!s.state.meta.isValid,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(A,{htmlFor:s.name,"aria-required":l,children:e}),(0,h.jsx)(M,{children:t})]}),(0,h.jsxs)(k,{className:`flex flex-col`,children:[(0,h.jsxs)(u.t,{defaultValue:s.state.value||void 0,onValueChange:s.handleChange,children:[(0,h.jsx)(u.s,{"aria-invalid":c?`true`:void 0,onBlur:s.handleBlur,children:(0,h.jsx)(u.c,{placeholder:n})}),(0,h.jsxs)(u.n,{children:[!!i.length&&i.map(e=>(0,h.jsx)(u.i,{value:e.value,children:e.label},e.value)),!i.length&&(0,h.jsxs)(`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:[(0,h.jsx)(g.PackagePlusIcon,{strokeWidth:1}),`No options available`]})]})]}),(0,h.jsx)(`div`,{className:`mt-1 flex w-full flex-col items-end justify-end`,children:(0,h.jsx)(F,{errors:d})}),(0,h.jsx)(N,{isShow:!!a,children:a})]})]}),(0,h.jsx)(P,{})]})};function q({className:e,...t}){return(0,h.jsx)(v.Switch.Root,{"data-slot":`switch`,className:(0,f.cn)(`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:(0,h.jsx)(v.Switch.Thumb,{"data-slot":`switch-thumb`,className:(0,f.cn)(`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 J=({label:e,description:t,helperText:n})=>{let r=Q();return(0,h.jsxs)(E,{className:`gap-y-4 px-4`,children:[(0,h.jsxs)(D,{orientation:`vertical`,className:`relative justify-between gap-y-1`,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(j,{className:`cursor-pointer`,children:(0,h.jsx)(`label`,{htmlFor:r.name,children:e})}),(0,h.jsx)(M,{children:t}),(0,h.jsx)(q,{id:r.name,checked:r.state.value??!1,className:`absolute top-1 right-1`,onBlur:r.handleBlur,onCheckedChange:r.handleChange})]}),(0,h.jsx)(N,{isShow:!!n,children:n})]}),(0,h.jsx)(P,{})]})},ee=({label:e,description:t,placeholder:n,helperText:r,counter:i=!1,orientation:a=`responsive`,showClearButton:s=!1,showErrorMessage:c=!0,required:l=!1,maxLength:u})=>{let d=(0,m.useId)(),p=(0,m.useRef)(null),{form:_,name:v,state:b,handleBlur:x,handleChange:S}=Q(),C=(0,y.useStore)(_.store,({isSubmitting:e})=>e),w=s&&!C&&!!b.value&&!b.meta.errors.length,T=b.value?b.value.length:0,j=(0,m.useMemo)(()=>{if(!i)return``;let e=`character${[0,1].includes(T)?``:`s`}`;return i&&u?`${T} / ${u} character${T?`s`:``}`:`${T} ${e}`},[T,i,u]),I=b.meta.isDirty&&b.meta.isTouched&&!b.meta.isValid,L=l?b.value===null:!1,R=u&&T>=u*.8,z=u&&T>=u,B=(0,m.useCallback)(({target:{value:e}})=>{C||i&&u&&e.length>u||S(e||null)},[C,i,u,S]),V=(0,m.useCallback)(()=>{C||(S(null),p.current?.focus())},[C,S]);return(0,h.jsxs)(E,{className:`gap-y-4 px-4`,children:[(0,h.jsxs)(D,{orientation:a,"data-invalid":I,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(A,{"aria-required":L,htmlFor:d,children:(0,h.jsxs)(`p`,{children:[e,l&&(0,h.jsx)(`span`,{className:`text-danger-strong`,children:` *`})]})}),(0,h.jsx)(M,{children:t})]}),(0,h.jsxs)(k,{children:[(0,h.jsx)(o.t,{ref:p,id:d,name:v,value:b.value??``,"aria-invalid":I,autoComplete:`off`,placeholder:n,autoCapitalize:`none`,autoCorrect:`off`,className:(0,f.cn)(`pr-6`,C&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:x,onChange:B}),w&&(0,h.jsx)(`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:V,children:(0,h.jsx)(g.XIcon,{"aria-hidden":`true`})}),C&&(0,h.jsx)(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-muted-weak`,children:(0,h.jsx)(g.Loader2Icon,{size:14,className:`animate-spin text-primary-strong`})}),b.meta.isDirty&&c&&!!b.meta.errors.length&&(0,h.jsx)(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-danger-strong`,children:(0,h.jsx)(g.BanIcon,{"aria-hidden":`true`,size:14})}),(0,h.jsxs)(`div`,{className:`my-1 flex w-full items-start justify-between gap-x-2`,children:[b.meta.isDirty&&c?(0,h.jsx)(F,{className:`flex-1`,errors:b.meta.errors}):(0,h.jsx)(`div`,{}),!!i&&(0,h.jsx)(`p`,{className:(0,f.cn)(`h-4 flex-0 text-nowrap text-end text-xs tabular-nums transition-colors`,z?`font-medium text-danger-strong`:R?`text-warning-strong`:`text-text-positive-weak`),children:j})]}),(0,h.jsx)(N,{isShow:!!r,children:r})]})]}),(0,h.jsx)(P,{})]})},te=(0,m.memo)(({label:e,description:t,placeholder:n,helperText:r,counter:i=!1,orientation:a=`responsive`,showErrorMessage:o=!0,required:s=!1,maxLength:c})=>{let l=(0,m.useId)(),{form:u,state:p,name:_,handleBlur:v,handleChange:b}=Q(),x=(0,y.useStore)(u.store,({isSubmitting:e})=>e),S=p.value?p.value.length:0,C=(0,m.useMemo)(()=>{if(!i)return``;let e=`character${[0,1].includes(S)?``:`s`}`;return i&&c?`${S} / ${c} character${S?`s`:``}`:`${S} ${e}`},[S,i,c]),w=p.meta.isDirty&&p.meta.isTouched&&!p.meta.isValid,T=s?p.value===null:!1,j=p.meta.errors,I=c&&S>=c*.8,L=c&&S>=c,R=(0,m.useCallback)(({target:{value:e}})=>{x||i&&c&&e.length>c||b(e||null)},[x,i,c,b]);return(0,h.jsxs)(E,{className:`gap-y-4 px-4`,children:[(0,h.jsxs)(D,{orientation:a,"data-invalid":w,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(A,{"aria-required":T,htmlFor:l,children:(0,h.jsxs)(`p`,{children:[e,s&&(0,h.jsx)(`span`,{className:`text-danger-strong`,children:` *`})]})}),(0,h.jsx)(M,{children:t})]}),(0,h.jsxs)(k,{children:[(0,h.jsx)(d.t,{id:l,name:_,value:p.value===null?``:p.value,"aria-invalid":w,autoCapitalize:`none`,autoComplete:`off`,placeholder:n,className:(0,f.cn)(x&&`pointer-events-none bg-muted-muted opacity-60`),onChange:R,onBlur:v}),x&&(0,h.jsx)(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-muted-weak`,children:(0,h.jsx)(g.Loader2Icon,{size:14,className:`animate-spin text-primary-strong`})}),p.meta.isDirty&&o&&!!j.length&&(0,h.jsx)(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-danger-strong`,children:(0,h.jsx)(g.BanIcon,{size:14})}),(0,h.jsxs)(`div`,{className:`my-1 flex w-full items-start justify-between gap-x-2`,children:[p.meta.isDirty&&o?(0,h.jsx)(F,{className:`flex-1`,errors:p.meta.errors}):(0,h.jsx)(`div`,{}),!!i&&(0,h.jsx)(`p`,{className:(0,f.cn)(`h-4 flex-0 text-nowrap text-end text-xs tabular-nums transition-colors`,L?`font-medium text-danger-strong`:I?`text-warning-strong`:`text-text-positive-weak`),children:C})]}),(0,h.jsx)(N,{isShow:!!r,children:r})]})]}),(0,h.jsx)(P,{})]})}),ne=({label:e,className:n})=>{let r=$(),i=(0,m.useCallback)(async()=>{await r.handleSubmit({submitAction:`submit`}),r.state.isSubmitSuccessful&&r.reset()},[r]);return(0,h.jsx)(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})=>(0,h.jsx)(t.t,{type:`button`,size:`md`,disabled:r,isLoading:a,className:(0,f.cn)(`min-h-8 min-w-32`,n),onClick:i,children:e??`Submit`})})},re=({type:e=`create`})=>{let n=$();return(0,h.jsxs)(`div`,{className:`flex h-8 items-center justify-between`,children:[(0,h.jsx)(n.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:e})=>(0,h.jsx)(t.t,{color:`muted`,variant:`outline`,type:`button`,size:`md`,disabled:e,className:`h-full min-w-32`,onClick:()=>n.reset(),children:`Cancel`})}),e===`create`&&(0,h.jsx)(n.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:e,isSubmitting:r})=>(0,h.jsxs)(t.t,{type:`submit`,size:`md`,disabled:e,isLoading:r,className:`h-full min-w-32`,onClick:async()=>{await n.handleSubmit({submitAction:`create`}),n.state.isSubmitSuccessful&&n.reset()},children:[(0,h.jsx)(g.PlusIcon,{}),`Add New`]})}),e===`update`&&(0,h.jsx)(n.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:e,isSubmitting:r})=>(0,h.jsxs)(t.t,{type:`submit`,size:`md`,disabled:e,isLoading:r,className:`h-full min-w-32`,onClick:async()=>{await n.handleSubmit({submitAction:`update`}),n.state.isSubmitSuccessful&&n.reset()},children:[(0,h.jsx)(g.ArrowDownToLine,{}),`Update`]})})]})};function Y({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,h.jsx)(v.Separator.Root,{"data-slot":`separator`,decorative:n,orientation:t,className:(0,f.cn)(`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 ie=({title:e,description:n,onDelete:r,children:i})=>(0,h.jsxs)(`section`,{"data-slot":`card-form`,className:`relative flex flex-col rounded-md bg-card pb-4 shadow-card ring-4 ring-border-weak`,children:[(0,h.jsxs)(`div`,{"data-slot":`card-form-header`,className:`flex flex-col space-y-1 p-4`,children:[(0,h.jsx)(`p`,{className:`font-semibold text-lg`,children:e}),!!n&&(0,h.jsx)(`p`,{className:`text-muted text-sm`,children:n})]}),(0,h.jsx)(Y,{}),(0,h.jsx)(`div`,{"data-slot":`card-form-main`,className:`flex flex-col space-y-4 py-4`,children:i}),!!r&&(0,h.jsxs)(t.t,{color:`danger`,variant:`outline`,size:`sm`,className:`absolute top-2 right-2`,onClick:e=>{r?.(),e.preventDefault(),e.stopPropagation()},children:[(0,h.jsx)(g.Trash2Icon,{}),`Remove`]})]}),ae=({children:e})=>(0,h.jsx)(`div`,{"data-slot":`section-form`,className:`flex flex-col space-y-4`,children:e}),X=({...e})=>(0,h.jsx)(`button`,{...e,type:`button`,className:`min-w-40 cursor-pointer rounded-sm border border-border bg-card px-4 py-2 font-semibold text-sm text-text-positive shadow-xs outline-none transition-all hover:opacity-90 focus:border-border focus:ring-3 focus:ring-border/80 focus:ring-offset-2 focus:drop-shadow-none disabled:pointer-events-none disabled:opacity-60 disabled:drop-shadow-none`,children:`Hủy`}),Z=({isSubmitting:e,submitText:t=`Submit`,...n})=>(0,h.jsx)(`button`,{...n,type:`button`,"data-loading":e?`true`:void 0,className:`relative min-h-9.5 min-w-40 cursor-pointer rounded-sm border border-primary-strong bg-primary px-4 py-2 font-semibold text-sm text-text-negative shadow-card outline-none transition-all hover:opacity-90 focus:border-transparent focus:ring-3 focus:ring-primary/80 focus:ring-offset-2 focus:drop-shadow-none disabled:pointer-events-none disabled:opacity-60 disabled:drop-shadow-none data-[loading=true]:pointer-events-none data-[loading=true]:opacity-80`,children:e?(0,h.jsx)(g.Loader2,{size:16,strokeWidth:3,className:`absolute top-1/2 left-1/2 z-10 -translate-x-1/2 -translate-y-1/2 animate-spin`}):t}),oe=({title:e,submitText:t,open:r,onOpenChange:a,children:o})=>{let s=$(),c=(0,m.useCallback)(e=>{e||s.reset(),a?.(e)},[s.reset,a]);return(0,h.jsx)(i.t,{open:r,onOpenChange:c,children:(0,h.jsxs)(i.c,{"data-slot":`dialog-portal`,children:[(0,h.jsx)(i.s,{}),(0,h.jsxs)(i.r,{className:`flex size-full max-h-dvh max-w-dvw flex-col gap-0 overflow-y-auto p-0 shadow-dialog sm:h-auto sm:max-h-[85dvh] sm:max-w-2xl sm:rounded-sm`,children:[(0,h.jsx)(`div`,{"data-slot":`dialog-header`,className:`flex flex-col items-center justify-center gap-2 px-4 py-6 text-center shadow-sm sm:text-left`,children:(0,h.jsx)(i.l,{"data-slot":`dialog-title`,children:e})}),(0,h.jsx)(n.t,{}),(0,h.jsx)(`div`,{"data-slot":`dialog-content`,className:`relative flex flex-col space-y-4 overflow-y-auto p-0 pt-6 max-sm:flex-1 sm:p-4`,children:o}),(0,h.jsx)(n.t,{}),(0,h.jsxs)(`div`,{"data-slot":`dialog-footer`,className:`flex flex-col-reverse items-center justify-between gap-2 px-6 py-4 shadow-sm sm:flex-row sm:justify-end max-sm:[&>button]:w-full`,children:[(0,h.jsx)(s.Subscribe,{selector:e=>({disabled:e.isSubmitting}),children:({disabled:e})=>(0,h.jsx)(X,{disabled:e,onClick:()=>{s.reset(),c(!1)}})}),(0,h.jsx)(s.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:n})=>(0,h.jsx)(Z,{isSubmitting:e,disabled:n,submitText:t,onClick:()=>s.handleSubmit()})})]})]})]})})},se=({label:e,description:t,helperText:n,orientation:r=`responsive`,children:i})=>(0,h.jsxs)(E,{className:`gap-y-4 px-4`,children:[(0,h.jsxs)(D,{orientation:r,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(A,{children:e}),(0,h.jsx)(M,{children:t})]}),(0,h.jsxs)(k,{children:[i,(0,h.jsx)(N,{isShow:!!n,children:n})]})]}),(0,h.jsx)(P,{})]}),ce=({title:e,open:t,contentClassName:n,onOpenChange:i,children:a})=>{let o=$();return(0,h.jsx)(v.Dialog.Root,{"data-slot":`dialog`,open:t,onOpenChange:i,children:(0,h.jsxs)(v.Dialog.Portal,{"data-slot":`dialog-portal`,children:[(0,h.jsx)(v.Dialog.Overlay,{"data-slot":`dialog-overlay`,className:(0,f.cn)(`fixed inset-0 z-40 bg-black/50 backdrop-blur-sm`,`data-[state=open]:animate-in`,`data-[state=open]:fade-in`,`data-[state=closed]:animate-out`,`data-[state=closed]:fade-out`)}),(0,h.jsx)(v.Dialog.Content,{"data-slot":`dialog-content`,className:(0,f.cn)(`fixed top-4 right-4 z-50 h-[calc(100dvh-2rem)] min-w-sm max-w-xl rounded-md bg-background drop-shadow-lg`,`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:(0,h.jsxs)(`section`,{className:`relative flex size-full flex-col`,children:[(0,h.jsx)(`header`,{className:`flex h-14 items-center border-border border-b px-4`,children:(0,h.jsx)(`h2`,{className:`font-semibold text-lg text-primary-strong`,children:e})}),(0,h.jsx)(`div`,{className:(0,f.cn)(`flex flex-1 flex-col overflow-y-auto py-4`,n),children:a}),(0,h.jsxs)(`div`,{className:`flex flex-col space-y-4 border-border border-t px-4 py-2`,children:[(0,h.jsx)(o.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:t})=>(0,h.jsx)(Z,{isSubmitting:e,disabled:t,className:`w-full`,onClick:()=>o.handleSubmit()})}),(0,h.jsx)(o.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:e})=>(0,h.jsx)(X,{disabled:e,className:`w-full`,onClick:()=>{o.reset(),i?.(!1)}})})]}),(0,h.jsx)(v.Dialog.Close,{asChild:!0,children:(0,h.jsx)(r.t,{className:`absolute top-2 right-2`})})]})})]})})},le=({children:e})=>(0,h.jsx)(`header`,{"data-slot":`section-header`,className:`px-4 pt-2.5 pb-2 font-medium text-base text-text-positive`,children:e}),ue=({children:e})=>(0,h.jsx)(`main`,{"data-slot":`section-main`,className:`relative flex flex-col space-y-4 py-4`,children:e}),de=({title:e,children:t})=>(0,h.jsxs)(`section`,{"data-slot":`section-form`,className:`flex flex-col rounded-md bg-background shadow-card ring-4 ring-border-weak`,children:[(0,h.jsx)(le,{children:e}),(0,h.jsx)(Y,{}),(0,h.jsx)(ue,{children:t})]}),fe=({title:e,description:t,helperText:n})=>(0,h.jsxs)(E,{className:`gap-y-4 px-4`,children:[(0,h.jsxs)(D,{className:`gap-0`,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(T,{className:`mb-1`,children:e}),(0,h.jsx)(M,{children:t})]}),(0,h.jsx)(N,{isShow:!!n,children:n})]}),(0,h.jsx)(P,{})]}),{fieldContext:pe,formContext:me,useFieldContext:Q,useFormContext:$}=(0,y.createFormHookContexts)(),{useAppForm:he,withForm:ge,withFieldGroup:_e}=(0,y.createFormHook)({fieldContext:pe,formContext:me,fieldComponents:{TextField:ee,TextareaField:te,NumberField:U,EmailField:R,PasswordField:W,SelectField:K,DateField:L,SwitchField:J,RadioGroupField:G,CheckboxField:I,FieldGroup:E,Field:D,FieldContent:O,FieldLabel:A,FieldContentMain:k,FieldSeparator:P,FieldError:F},formComponents:{TanStackDialogForm:oe,TanStackPopoverForm:ce,TanStackContainerForm:ae,TanStackSectionForm:de,TanStackCardForm:ie,TanStackFieldGroup:se,TanStackTitleField:fe,TanStackActionsForm:re,TanStackActionSubmit:ne}});exports.Field=D,exports.FieldContent=O,exports.FieldContentMain=k,exports.FieldError=F,exports.FieldGroup=E,exports.FieldLabel=A,exports.FieldSeparator=P,exports.useTanStackFieldContext=Q,exports.useTanStackForm=he,exports.useTanStackFormContext=$,exports.withTanStackFieldGroup=_e,exports.withTanStackForm=ge;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -85,7 +85,7 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
85
85
  showClearButton?: boolean | undefined;
86
86
  description?: string | undefined;
87
87
  placeholder?: string | undefined;
88
- }, "description" | "label" | "placeholder" | "orientation" | "tooltip" | "counter" | "showClearButton" | "helperText" | "showErrorMessage"> & {
88
+ }, "description" | "label" | "orientation" | "tooltip" | "placeholder" | "counter" | "showClearButton" | "helperText" | "showErrorMessage"> & {
89
89
  required?: boolean;
90
90
  maxLength?: number;
91
91
  }>;
@@ -113,7 +113,7 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
113
113
  counter?: boolean | undefined;
114
114
  description?: string | undefined;
115
115
  placeholder?: string | undefined;
116
- }, "description" | "label" | "placeholder" | "orientation" | "tooltip" | "counter" | "helperText" | "showErrorMessage"> & {
116
+ }, "description" | "label" | "orientation" | "tooltip" | "placeholder" | "counter" | "helperText" | "showErrorMessage"> & {
117
117
  required?: boolean;
118
118
  maxLength?: number;
119
119
  }>;
@@ -153,7 +153,7 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
153
153
  unit?: string | undefined;
154
154
  description?: string | undefined;
155
155
  placeholder?: string | undefined;
156
- }, "description" | "label" | "placeholder" | "orientation" | "tooltip" | "helperText" | "showErrorMessage" | "rounding" | "decimalPlaces" | "percision" | "unit"> & {
156
+ }, "description" | "label" | "orientation" | "tooltip" | "placeholder" | "helperText" | "showErrorMessage" | "rounding" | "decimalPlaces" | "percision" | "unit"> & {
157
157
  required?: boolean;
158
158
  allowNegative?: boolean;
159
159
  }>;
@@ -173,15 +173,15 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
173
173
  showErrorMessage?: boolean | undefined;
174
174
  description?: string | undefined;
175
175
  placeholder?: string | undefined;
176
- }, "description" | "label" | "placeholder" | "orientation" | "tooltip" | "helperText" | "showErrorMessage"> & {
176
+ }, "description" | "label" | "orientation" | "tooltip" | "placeholder" | "helperText" | "showErrorMessage"> & {
177
177
  maxLength?: number;
178
178
  }>;
179
179
  readonly PasswordField: react255.FC<{
180
180
  description?: string | undefined;
181
181
  label: string;
182
- placeholder?: string | undefined;
183
182
  orientation?: "vertical" | "horizontal" | "responsive" | undefined;
184
183
  tooltip?: string | undefined;
184
+ placeholder?: string | undefined;
185
185
  helperText?: string | undefined;
186
186
  showErrorMessage?: boolean | undefined;
187
187
  }>;
@@ -210,7 +210,7 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
210
210
  defaultValue?: string | undefined;
211
211
  description?: string | undefined;
212
212
  placeholder?: string | undefined;
213
- }, "description" | "label" | "placeholder" | "defaultValue" | "orientation" | "tooltip" | "options" | "helperText" | "clearable"> & {
213
+ }, "description" | "defaultValue" | "label" | "orientation" | "tooltip" | "placeholder" | "options" | "helperText" | "clearable"> & {
214
214
  required?: boolean;
215
215
  }>;
216
216
  readonly DateField: react255.FC<Pick<{
@@ -231,7 +231,7 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
231
231
  defaultValue?: string | undefined;
232
232
  description?: string | undefined;
233
233
  placeholder?: string | undefined;
234
- }, "description" | "label" | "placeholder" | "orientation" | "tooltip" | "helperText" | "showErrorMessage"> & {
234
+ }, "description" | "label" | "orientation" | "tooltip" | "placeholder" | "helperText" | "showErrorMessage"> & {
235
235
  required?: boolean;
236
236
  minDate?: Date;
237
237
  maxDate?: Date;
@@ -373,7 +373,7 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
373
373
  showClearButton?: boolean | undefined;
374
374
  description?: string | undefined;
375
375
  placeholder?: string | undefined;
376
- }, "description" | "label" | "placeholder" | "orientation" | "tooltip" | "counter" | "showClearButton" | "helperText" | "showErrorMessage"> & {
376
+ }, "description" | "label" | "orientation" | "tooltip" | "placeholder" | "counter" | "showClearButton" | "helperText" | "showErrorMessage"> & {
377
377
  required?: boolean;
378
378
  maxLength?: number;
379
379
  }>;
@@ -401,7 +401,7 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
401
401
  counter?: boolean | undefined;
402
402
  description?: string | undefined;
403
403
  placeholder?: string | undefined;
404
- }, "description" | "label" | "placeholder" | "orientation" | "tooltip" | "counter" | "helperText" | "showErrorMessage"> & {
404
+ }, "description" | "label" | "orientation" | "tooltip" | "placeholder" | "counter" | "helperText" | "showErrorMessage"> & {
405
405
  required?: boolean;
406
406
  maxLength?: number;
407
407
  }>;
@@ -441,7 +441,7 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
441
441
  unit?: string | undefined;
442
442
  description?: string | undefined;
443
443
  placeholder?: string | undefined;
444
- }, "description" | "label" | "placeholder" | "orientation" | "tooltip" | "helperText" | "showErrorMessage" | "rounding" | "decimalPlaces" | "percision" | "unit"> & {
444
+ }, "description" | "label" | "orientation" | "tooltip" | "placeholder" | "helperText" | "showErrorMessage" | "rounding" | "decimalPlaces" | "percision" | "unit"> & {
445
445
  required?: boolean;
446
446
  allowNegative?: boolean;
447
447
  }>;
@@ -461,15 +461,15 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
461
461
  showErrorMessage?: boolean | undefined;
462
462
  description?: string | undefined;
463
463
  placeholder?: string | undefined;
464
- }, "description" | "label" | "placeholder" | "orientation" | "tooltip" | "helperText" | "showErrorMessage"> & {
464
+ }, "description" | "label" | "orientation" | "tooltip" | "placeholder" | "helperText" | "showErrorMessage"> & {
465
465
  maxLength?: number;
466
466
  }>;
467
467
  readonly PasswordField: react255.FC<{
468
468
  description?: string | undefined;
469
469
  label: string;
470
- placeholder?: string | undefined;
471
470
  orientation?: "vertical" | "horizontal" | "responsive" | undefined;
472
471
  tooltip?: string | undefined;
472
+ placeholder?: string | undefined;
473
473
  helperText?: string | undefined;
474
474
  showErrorMessage?: boolean | undefined;
475
475
  }>;
@@ -498,7 +498,7 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
498
498
  defaultValue?: string | undefined;
499
499
  description?: string | undefined;
500
500
  placeholder?: string | undefined;
501
- }, "description" | "label" | "placeholder" | "defaultValue" | "orientation" | "tooltip" | "options" | "helperText" | "clearable"> & {
501
+ }, "description" | "defaultValue" | "label" | "orientation" | "tooltip" | "placeholder" | "options" | "helperText" | "clearable"> & {
502
502
  required?: boolean;
503
503
  }>;
504
504
  readonly DateField: react255.FC<Pick<{
@@ -519,7 +519,7 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
519
519
  defaultValue?: string | undefined;
520
520
  description?: string | undefined;
521
521
  placeholder?: string | undefined;
522
- }, "description" | "label" | "placeholder" | "orientation" | "tooltip" | "helperText" | "showErrorMessage"> & {
522
+ }, "description" | "label" | "orientation" | "tooltip" | "placeholder" | "helperText" | "showErrorMessage"> & {
523
523
  required?: boolean;
524
524
  minDate?: Date;
525
525
  maxDate?: Date;
@@ -659,7 +659,7 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
659
659
  showClearButton?: boolean | undefined;
660
660
  description?: string | undefined;
661
661
  placeholder?: string | undefined;
662
- }, "description" | "label" | "placeholder" | "orientation" | "tooltip" | "counter" | "showClearButton" | "helperText" | "showErrorMessage"> & {
662
+ }, "description" | "label" | "orientation" | "tooltip" | "placeholder" | "counter" | "showClearButton" | "helperText" | "showErrorMessage"> & {
663
663
  required?: boolean;
664
664
  maxLength?: number;
665
665
  }>;
@@ -687,7 +687,7 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
687
687
  counter?: boolean | undefined;
688
688
  description?: string | undefined;
689
689
  placeholder?: string | undefined;
690
- }, "description" | "label" | "placeholder" | "orientation" | "tooltip" | "counter" | "helperText" | "showErrorMessage"> & {
690
+ }, "description" | "label" | "orientation" | "tooltip" | "placeholder" | "counter" | "helperText" | "showErrorMessage"> & {
691
691
  required?: boolean;
692
692
  maxLength?: number;
693
693
  }>;
@@ -727,7 +727,7 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
727
727
  unit?: string | undefined;
728
728
  description?: string | undefined;
729
729
  placeholder?: string | undefined;
730
- }, "description" | "label" | "placeholder" | "orientation" | "tooltip" | "helperText" | "showErrorMessage" | "rounding" | "decimalPlaces" | "percision" | "unit"> & {
730
+ }, "description" | "label" | "orientation" | "tooltip" | "placeholder" | "helperText" | "showErrorMessage" | "rounding" | "decimalPlaces" | "percision" | "unit"> & {
731
731
  required?: boolean;
732
732
  allowNegative?: boolean;
733
733
  }>;
@@ -747,15 +747,15 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
747
747
  showErrorMessage?: boolean | undefined;
748
748
  description?: string | undefined;
749
749
  placeholder?: string | undefined;
750
- }, "description" | "label" | "placeholder" | "orientation" | "tooltip" | "helperText" | "showErrorMessage"> & {
750
+ }, "description" | "label" | "orientation" | "tooltip" | "placeholder" | "helperText" | "showErrorMessage"> & {
751
751
  maxLength?: number;
752
752
  }>;
753
753
  readonly PasswordField: react255.FC<{
754
754
  description?: string | undefined;
755
755
  label: string;
756
- placeholder?: string | undefined;
757
756
  orientation?: "vertical" | "horizontal" | "responsive" | undefined;
758
757
  tooltip?: string | undefined;
758
+ placeholder?: string | undefined;
759
759
  helperText?: string | undefined;
760
760
  showErrorMessage?: boolean | undefined;
761
761
  }>;
@@ -784,7 +784,7 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
784
784
  defaultValue?: string | undefined;
785
785
  description?: string | undefined;
786
786
  placeholder?: string | undefined;
787
- }, "description" | "label" | "placeholder" | "defaultValue" | "orientation" | "tooltip" | "options" | "helperText" | "clearable"> & {
787
+ }, "description" | "defaultValue" | "label" | "orientation" | "tooltip" | "placeholder" | "options" | "helperText" | "clearable"> & {
788
788
  required?: boolean;
789
789
  }>;
790
790
  readonly DateField: react255.FC<Pick<{
@@ -805,7 +805,7 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
805
805
  defaultValue?: string | undefined;
806
806
  description?: string | undefined;
807
807
  placeholder?: string | undefined;
808
- }, "description" | "label" | "placeholder" | "orientation" | "tooltip" | "helperText" | "showErrorMessage"> & {
808
+ }, "description" | "label" | "orientation" | "tooltip" | "placeholder" | "helperText" | "showErrorMessage"> & {
809
809
  required?: boolean;
810
810
  minDate?: Date;
811
811
  maxDate?: Date;
@@ -949,7 +949,7 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
949
949
  showClearButton?: boolean | undefined;
950
950
  description?: string | undefined;
951
951
  placeholder?: string | undefined;
952
- }, "description" | "label" | "placeholder" | "orientation" | "tooltip" | "counter" | "showClearButton" | "helperText" | "showErrorMessage"> & {
952
+ }, "description" | "label" | "orientation" | "tooltip" | "placeholder" | "counter" | "showClearButton" | "helperText" | "showErrorMessage"> & {
953
953
  required?: boolean;
954
954
  maxLength?: number;
955
955
  }>;
@@ -977,7 +977,7 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
977
977
  counter?: boolean | undefined;
978
978
  description?: string | undefined;
979
979
  placeholder?: string | undefined;
980
- }, "description" | "label" | "placeholder" | "orientation" | "tooltip" | "counter" | "helperText" | "showErrorMessage"> & {
980
+ }, "description" | "label" | "orientation" | "tooltip" | "placeholder" | "counter" | "helperText" | "showErrorMessage"> & {
981
981
  required?: boolean;
982
982
  maxLength?: number;
983
983
  }>;
@@ -1017,7 +1017,7 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
1017
1017
  unit?: string | undefined;
1018
1018
  description?: string | undefined;
1019
1019
  placeholder?: string | undefined;
1020
- }, "description" | "label" | "placeholder" | "orientation" | "tooltip" | "helperText" | "showErrorMessage" | "rounding" | "decimalPlaces" | "percision" | "unit"> & {
1020
+ }, "description" | "label" | "orientation" | "tooltip" | "placeholder" | "helperText" | "showErrorMessage" | "rounding" | "decimalPlaces" | "percision" | "unit"> & {
1021
1021
  required?: boolean;
1022
1022
  allowNegative?: boolean;
1023
1023
  }>;
@@ -1037,15 +1037,15 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
1037
1037
  showErrorMessage?: boolean | undefined;
1038
1038
  description?: string | undefined;
1039
1039
  placeholder?: string | undefined;
1040
- }, "description" | "label" | "placeholder" | "orientation" | "tooltip" | "helperText" | "showErrorMessage"> & {
1040
+ }, "description" | "label" | "orientation" | "tooltip" | "placeholder" | "helperText" | "showErrorMessage"> & {
1041
1041
  maxLength?: number;
1042
1042
  }>;
1043
1043
  readonly PasswordField: react255.FC<{
1044
1044
  description?: string | undefined;
1045
1045
  label: string;
1046
- placeholder?: string | undefined;
1047
1046
  orientation?: "vertical" | "horizontal" | "responsive" | undefined;
1048
1047
  tooltip?: string | undefined;
1048
+ placeholder?: string | undefined;
1049
1049
  helperText?: string | undefined;
1050
1050
  showErrorMessage?: boolean | undefined;
1051
1051
  }>;
@@ -1074,7 +1074,7 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
1074
1074
  defaultValue?: string | undefined;
1075
1075
  description?: string | undefined;
1076
1076
  placeholder?: string | undefined;
1077
- }, "description" | "label" | "placeholder" | "defaultValue" | "orientation" | "tooltip" | "options" | "helperText" | "clearable"> & {
1077
+ }, "description" | "defaultValue" | "label" | "orientation" | "tooltip" | "placeholder" | "options" | "helperText" | "clearable"> & {
1078
1078
  required?: boolean;
1079
1079
  }>;
1080
1080
  readonly DateField: react255.FC<Pick<{
@@ -1095,7 +1095,7 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
1095
1095
  defaultValue?: string | undefined;
1096
1096
  description?: string | undefined;
1097
1097
  placeholder?: string | undefined;
1098
- }, "description" | "label" | "placeholder" | "orientation" | "tooltip" | "helperText" | "showErrorMessage"> & {
1098
+ }, "description" | "label" | "orientation" | "tooltip" | "placeholder" | "helperText" | "showErrorMessage"> & {
1099
1099
  required?: boolean;
1100
1100
  minDate?: Date;
1101
1101
  maxDate?: Date;
@@ -1235,7 +1235,7 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
1235
1235
  showClearButton?: boolean | undefined;
1236
1236
  description?: string | undefined;
1237
1237
  placeholder?: string | undefined;
1238
- }, "description" | "label" | "placeholder" | "orientation" | "tooltip" | "counter" | "showClearButton" | "helperText" | "showErrorMessage"> & {
1238
+ }, "description" | "label" | "orientation" | "tooltip" | "placeholder" | "counter" | "showClearButton" | "helperText" | "showErrorMessage"> & {
1239
1239
  required?: boolean;
1240
1240
  maxLength?: number;
1241
1241
  }>;
@@ -1263,7 +1263,7 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
1263
1263
  counter?: boolean | undefined;
1264
1264
  description?: string | undefined;
1265
1265
  placeholder?: string | undefined;
1266
- }, "description" | "label" | "placeholder" | "orientation" | "tooltip" | "counter" | "helperText" | "showErrorMessage"> & {
1266
+ }, "description" | "label" | "orientation" | "tooltip" | "placeholder" | "counter" | "helperText" | "showErrorMessage"> & {
1267
1267
  required?: boolean;
1268
1268
  maxLength?: number;
1269
1269
  }>;
@@ -1303,7 +1303,7 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
1303
1303
  unit?: string | undefined;
1304
1304
  description?: string | undefined;
1305
1305
  placeholder?: string | undefined;
1306
- }, "description" | "label" | "placeholder" | "orientation" | "tooltip" | "helperText" | "showErrorMessage" | "rounding" | "decimalPlaces" | "percision" | "unit"> & {
1306
+ }, "description" | "label" | "orientation" | "tooltip" | "placeholder" | "helperText" | "showErrorMessage" | "rounding" | "decimalPlaces" | "percision" | "unit"> & {
1307
1307
  required?: boolean;
1308
1308
  allowNegative?: boolean;
1309
1309
  }>;
@@ -1323,15 +1323,15 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
1323
1323
  showErrorMessage?: boolean | undefined;
1324
1324
  description?: string | undefined;
1325
1325
  placeholder?: string | undefined;
1326
- }, "description" | "label" | "placeholder" | "orientation" | "tooltip" | "helperText" | "showErrorMessage"> & {
1326
+ }, "description" | "label" | "orientation" | "tooltip" | "placeholder" | "helperText" | "showErrorMessage"> & {
1327
1327
  maxLength?: number;
1328
1328
  }>;
1329
1329
  readonly PasswordField: react255.FC<{
1330
1330
  description?: string | undefined;
1331
1331
  label: string;
1332
- placeholder?: string | undefined;
1333
1332
  orientation?: "vertical" | "horizontal" | "responsive" | undefined;
1334
1333
  tooltip?: string | undefined;
1334
+ placeholder?: string | undefined;
1335
1335
  helperText?: string | undefined;
1336
1336
  showErrorMessage?: boolean | undefined;
1337
1337
  }>;
@@ -1360,7 +1360,7 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
1360
1360
  defaultValue?: string | undefined;
1361
1361
  description?: string | undefined;
1362
1362
  placeholder?: string | undefined;
1363
- }, "description" | "label" | "placeholder" | "defaultValue" | "orientation" | "tooltip" | "options" | "helperText" | "clearable"> & {
1363
+ }, "description" | "defaultValue" | "label" | "orientation" | "tooltip" | "placeholder" | "options" | "helperText" | "clearable"> & {
1364
1364
  required?: boolean;
1365
1365
  }>;
1366
1366
  readonly DateField: react255.FC<Pick<{
@@ -1381,7 +1381,7 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
1381
1381
  defaultValue?: string | undefined;
1382
1382
  description?: string | undefined;
1383
1383
  placeholder?: string | undefined;
1384
- }, "description" | "label" | "placeholder" | "orientation" | "tooltip" | "helperText" | "showErrorMessage"> & {
1384
+ }, "description" | "label" | "orientation" | "tooltip" | "placeholder" | "helperText" | "showErrorMessage"> & {
1385
1385
  required?: boolean;
1386
1386
  minDate?: Date;
1387
1387
  maxDate?: Date;
@@ -1520,7 +1520,7 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
1520
1520
  showClearButton?: boolean | undefined;
1521
1521
  description?: string | undefined;
1522
1522
  placeholder?: string | undefined;
1523
- }, "description" | "label" | "placeholder" | "orientation" | "tooltip" | "counter" | "showClearButton" | "helperText" | "showErrorMessage"> & {
1523
+ }, "description" | "label" | "orientation" | "tooltip" | "placeholder" | "counter" | "showClearButton" | "helperText" | "showErrorMessage"> & {
1524
1524
  required?: boolean;
1525
1525
  maxLength?: number;
1526
1526
  }>;
@@ -1548,7 +1548,7 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
1548
1548
  counter?: boolean | undefined;
1549
1549
  description?: string | undefined;
1550
1550
  placeholder?: string | undefined;
1551
- }, "description" | "label" | "placeholder" | "orientation" | "tooltip" | "counter" | "helperText" | "showErrorMessage"> & {
1551
+ }, "description" | "label" | "orientation" | "tooltip" | "placeholder" | "counter" | "helperText" | "showErrorMessage"> & {
1552
1552
  required?: boolean;
1553
1553
  maxLength?: number;
1554
1554
  }>;
@@ -1588,7 +1588,7 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
1588
1588
  unit?: string | undefined;
1589
1589
  description?: string | undefined;
1590
1590
  placeholder?: string | undefined;
1591
- }, "description" | "label" | "placeholder" | "orientation" | "tooltip" | "helperText" | "showErrorMessage" | "rounding" | "decimalPlaces" | "percision" | "unit"> & {
1591
+ }, "description" | "label" | "orientation" | "tooltip" | "placeholder" | "helperText" | "showErrorMessage" | "rounding" | "decimalPlaces" | "percision" | "unit"> & {
1592
1592
  required?: boolean;
1593
1593
  allowNegative?: boolean;
1594
1594
  }>;
@@ -1608,15 +1608,15 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
1608
1608
  showErrorMessage?: boolean | undefined;
1609
1609
  description?: string | undefined;
1610
1610
  placeholder?: string | undefined;
1611
- }, "description" | "label" | "placeholder" | "orientation" | "tooltip" | "helperText" | "showErrorMessage"> & {
1611
+ }, "description" | "label" | "orientation" | "tooltip" | "placeholder" | "helperText" | "showErrorMessage"> & {
1612
1612
  maxLength?: number;
1613
1613
  }>;
1614
1614
  readonly PasswordField: react255.FC<{
1615
1615
  description?: string | undefined;
1616
1616
  label: string;
1617
- placeholder?: string | undefined;
1618
1617
  orientation?: "vertical" | "horizontal" | "responsive" | undefined;
1619
1618
  tooltip?: string | undefined;
1619
+ placeholder?: string | undefined;
1620
1620
  helperText?: string | undefined;
1621
1621
  showErrorMessage?: boolean | undefined;
1622
1622
  }>;
@@ -1645,7 +1645,7 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
1645
1645
  defaultValue?: string | undefined;
1646
1646
  description?: string | undefined;
1647
1647
  placeholder?: string | undefined;
1648
- }, "description" | "label" | "placeholder" | "defaultValue" | "orientation" | "tooltip" | "options" | "helperText" | "clearable"> & {
1648
+ }, "description" | "defaultValue" | "label" | "orientation" | "tooltip" | "placeholder" | "options" | "helperText" | "clearable"> & {
1649
1649
  required?: boolean;
1650
1650
  }>;
1651
1651
  readonly DateField: react255.FC<Pick<{
@@ -1666,7 +1666,7 @@ declare const useTanStackForm: <TFormData, TOnMount extends _tanstack_form_core0
1666
1666
  defaultValue?: string | undefined;
1667
1667
  description?: string | undefined;
1668
1668
  placeholder?: string | undefined;
1669
- }, "description" | "label" | "placeholder" | "orientation" | "tooltip" | "helperText" | "showErrorMessage"> & {
1669
+ }, "description" | "label" | "orientation" | "tooltip" | "placeholder" | "helperText" | "showErrorMessage"> & {
1670
1670
  required?: boolean;
1671
1671
  minDate?: Date;
1672
1672
  maxDate?: Date;