@customafk/lunas-ui 0.2.31 → 0.2.32
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.
- package/dist/{alert-BKRyykI5.d.mts → alert-CqRM6LFa.d.cts} +7 -7
- package/dist/{alert-CfoYnzYT.d.cts → alert-hSQjkSHn.d.mts} +6 -6
- package/dist/{badge-C-TqojsV.d.cts → badge-BNlMwt54.d.mts} +6 -6
- package/dist/{badge-Fh-imaPO.d.mts → badge-BXCkfLW0.d.cts} +6 -6
- package/dist/{button-CTv_kWgp.d.mts → button-DhUjRe5e.d.mts} +7 -7
- package/dist/{button-pXrQPrMJ.d.cts → button-xc_1ixgJ.d.cts} +5 -5
- package/dist/data-display/statistic.d.cts +3 -3
- package/dist/{dialog-s-gvSnQT.d.cts → dialog-KxgG7gFA.d.mts} +12 -12
- package/dist/{dialog-Cq-YQhmY.d.mts → dialog-gZTogunf.d.cts} +12 -12
- package/dist/dialogs/detail-dialog/components/sidebar.d.cts +26 -26
- package/dist/dialogs/detail-dialog/components/sidebar.d.mts +26 -26
- package/dist/features/descriptions/index.d.cts +1 -1
- package/dist/features/descriptions/index.d.mts +6 -6
- package/dist/features/search-modal/index.d.cts +2 -2
- package/dist/features/tables/index.d.cts +1 -1
- package/dist/features/tables/index.d.mts +2 -2
- package/dist/features/tanstack-form/index.cjs +1 -1
- package/dist/features/tanstack-form/index.d.cts +1 -1
- package/dist/features/tanstack-form/index.d.mts +1 -1
- package/dist/features/tanstack-form/index.mjs +1 -1
- package/dist/features/text-editor/index.d.mts +1 -1
- package/dist/{index-utmg5trk.d.cts → index-22flsTNt.d.cts} +2 -2
- package/dist/{index-D3hB1UbV.d.cts → index-DDPBbVVt.d.cts} +365 -365
- package/dist/{index-D9FfDlcA.d.mts → index-DdqgMofm.d.mts} +2 -2
- package/dist/{index-U8LjVt0l.d.mts → index-WCk8mTXV.d.mts} +367 -367
- package/dist/{index-DMV3Z1bC.d.mts → index-cSJtvD9W.d.mts} +4 -4
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.mts +8 -8
- package/dist/index.mjs +1 -1
- package/dist/{input-CafwzEO-.d.mts → input-BILuHVfC.d.mts} +3 -3
- package/dist/{input-CbP10SLj.d.cts → input-CEYWz7lS.d.cts} +5 -5
- package/dist/layouts/flex.d.cts +5 -5
- package/dist/layouts/flex.d.mts +5 -5
- package/dist/pages/FeatureDeveloping.d.cts +2 -2
- package/dist/pages/FeatureDeveloping.d.mts +2 -2
- package/dist/pages/FeatureFixing.d.cts +2 -2
- package/dist/pages/FeatureFixing.d.mts +2 -2
- package/dist/pages/LoginPage.cjs +1 -1
- package/dist/pages/LoginPage.cjs.map +1 -1
- package/dist/pages/LoginPage.d.cts +2 -2
- package/dist/pages/LoginPage.d.mts +2 -2
- package/dist/pages/LoginPage.mjs +1 -1
- package/dist/pages/LoginPage.mjs.map +1 -1
- package/dist/pages/NotAuthorized.d.cts +2 -2
- package/dist/pages/NotAuthorized.d.mts +2 -2
- package/dist/pages/NotFound.d.cts +2 -2
- package/dist/pages/NotFound.d.mts +2 -2
- package/dist/pages/RegisterPage.cjs +1 -1
- package/dist/pages/RegisterPage.cjs.map +1 -1
- package/dist/pages/RegisterPage.d.cts +2 -2
- package/dist/pages/RegisterPage.d.mts +2 -2
- package/dist/pages/RegisterPage.mjs +1 -1
- package/dist/pages/RegisterPage.mjs.map +1 -1
- package/dist/pages/VerifyEmailPage.cjs +1 -1
- package/dist/pages/VerifyEmailPage.cjs.map +1 -1
- package/dist/pages/VerifyEmailPage.d.cts +2 -2
- package/dist/pages/VerifyEmailPage.d.mts +2 -2
- package/dist/pages/VerifyEmailPage.mjs +1 -1
- package/dist/pages/VerifyEmailPage.mjs.map +1 -1
- package/dist/tanstack-form-Be6aIYAW.mjs +2 -0
- package/dist/tanstack-form-Be6aIYAW.mjs.map +1 -0
- package/dist/tanstack-form-CDgTokmf.cjs +2 -0
- package/dist/tanstack-form-CDgTokmf.cjs.map +1 -0
- package/dist/typography/paragraph.d.cts +5 -5
- package/dist/typography/paragraph.d.mts +5 -5
- package/dist/ui/alert-dialog.d.cts +12 -12
- package/dist/ui/alert-dialog.d.mts +12 -12
- package/dist/ui/alert.d.cts +1 -1
- package/dist/ui/alert.d.mts +1 -1
- package/dist/ui/aspect-ratio.d.cts +2 -2
- package/dist/ui/aspect-ratio.d.mts +2 -2
- package/dist/ui/avatar.d.cts +4 -4
- package/dist/ui/avatar.d.mts +4 -4
- package/dist/ui/badge.d.cts +1 -1
- package/dist/ui/badge.d.mts +1 -1
- package/dist/ui/breadcrumb.d.cts +8 -8
- package/dist/ui/breadcrumb.d.mts +8 -8
- package/dist/ui/button-group.d.cts +4 -4
- package/dist/ui/button-group.d.mts +6 -6
- package/dist/ui/button.d.cts +1 -1
- package/dist/ui/button.d.mts +1 -1
- package/dist/ui/calendar.d.cts +4 -4
- package/dist/ui/calendar.d.mts +4 -4
- package/dist/ui/card.d.cts +8 -8
- package/dist/ui/card.d.mts +8 -8
- package/dist/ui/carousel.d.cts +7 -7
- package/dist/ui/carousel.d.mts +7 -7
- package/dist/ui/checkbox.d.cts +2 -2
- package/dist/ui/checkbox.d.mts +2 -2
- package/dist/ui/collapsible.d.cts +4 -4
- package/dist/ui/collapsible.d.mts +4 -4
- package/dist/ui/command.d.cts +11 -11
- package/dist/ui/command.d.mts +11 -11
- package/dist/ui/context-menu.d.cts +16 -16
- package/dist/ui/context-menu.d.mts +16 -16
- package/dist/ui/dialog.d.cts +1 -1
- package/dist/ui/dialog.d.mts +1 -1
- package/dist/ui/drawer.d.cts +11 -11
- package/dist/ui/drawer.d.mts +11 -11
- package/dist/ui/dropdown-menu.d.cts +16 -16
- package/dist/ui/dropdown-menu.d.mts +16 -16
- package/dist/ui/empty.d.cts +9 -9
- package/dist/ui/empty.d.mts +9 -9
- package/dist/ui/field.d.cts +21 -21
- package/dist/ui/field.d.mts +23 -23
- package/dist/ui/file-uploader.d.cts +2 -2
- package/dist/ui/file-uploader.d.mts +2 -2
- package/dist/ui/form.d.cts +10 -10
- package/dist/ui/form.d.mts +10 -10
- package/dist/ui/hover-card.d.cts +4 -4
- package/dist/ui/hover-card.d.mts +4 -4
- package/dist/ui/input-otp.d.cts +5 -5
- package/dist/ui/input-otp.d.mts +5 -5
- package/dist/ui/input.d.cts +1 -1
- package/dist/ui/input.d.mts +1 -1
- package/dist/ui/inputs/search-input.d.cts +3 -3
- package/dist/ui/inputs/search-input.d.mts +3 -3
- package/dist/ui/item.d.cts +11 -11
- package/dist/ui/item.d.mts +14 -14
- package/dist/ui/label.d.cts +2 -2
- package/dist/ui/label.d.mts +2 -2
- package/dist/ui/menubar.d.cts +17 -17
- package/dist/ui/menubar.d.mts +17 -17
- package/dist/ui/multi-select.d.cts +2 -2
- package/dist/ui/multi-select.d.mts +3 -3
- package/dist/ui/navigation-menu.d.cts +11 -11
- package/dist/ui/navigation-menu.d.mts +11 -11
- package/dist/ui/pagination.d.cts +9 -9
- package/dist/ui/pagination.d.mts +9 -9
- package/dist/ui/popover.d.cts +6 -6
- package/dist/ui/popover.d.mts +6 -6
- package/dist/ui/progress.d.cts +2 -2
- package/dist/ui/progress.d.mts +2 -2
- package/dist/ui/radio-group.d.cts +3 -3
- package/dist/ui/radio-group.d.mts +3 -3
- package/dist/ui/resizable.d.cts +9 -9
- package/dist/ui/resizable.d.mts +9 -9
- package/dist/ui/scroll-area.d.cts +5 -5
- package/dist/ui/scroll-area.d.mts +5 -5
- package/dist/ui/select.d.cts +9 -9
- package/dist/ui/select.d.mts +9 -9
- package/dist/ui/separator.d.cts +2 -2
- package/dist/ui/separator.d.mts +2 -2
- package/dist/ui/sheet.d.cts +9 -9
- package/dist/ui/sheet.d.mts +9 -9
- package/dist/ui/sidebar.d.cts +26 -26
- package/dist/ui/sidebar.d.mts +2 -2
- package/dist/ui/skeleton.d.cts +2 -2
- package/dist/ui/skeleton.d.mts +2 -2
- package/dist/ui/slider.d.cts +2 -2
- package/dist/ui/slider.d.mts +2 -2
- package/dist/ui/sonner.d.cts +2 -2
- package/dist/ui/sonner.d.mts +2 -2
- package/dist/ui/spinner.d.cts +2 -2
- package/dist/ui/spinner.d.mts +2 -2
- package/dist/ui/switch.d.cts +2 -2
- package/dist/ui/switch.d.mts +2 -2
- package/dist/ui/table.d.cts +17 -17
- package/dist/ui/table.d.mts +17 -17
- package/dist/ui/tabs.d.cts +5 -5
- package/dist/ui/textarea.d.cts +2 -2
- package/dist/ui/textarea.d.mts +2 -2
- package/dist/ui/toggle-group.d.cts +3 -3
- package/dist/ui/toggle-group.d.mts +3 -3
- package/dist/ui/toggle.d.cts +2 -2
- package/dist/ui/toggle.d.mts +2 -2
- package/dist/ui/tooltip.d.cts +5 -5
- package/dist/ui/tooltip.d.mts +5 -5
- package/package.json +1 -1
- package/dist/tanstack-form-BZAJHNCZ.mjs +0 -2
- package/dist/tanstack-form-BZAJHNCZ.mjs.map +0 -1
- package/dist/tanstack-form-BgRAJ1Zn.cjs +0 -2
- package/dist/tanstack-form-BgRAJ1Zn.cjs.map +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require(`./chunk-Bmb41Sf3.cjs`),t=require(`./button-Bu4ejNOW.cjs`),n=require(`./tooltip-DC6i1A25.cjs`),r=require(`./separator-jytY1CPq.cjs`),i=require(`./close-DUBEKxhw.cjs`),a=require(`./dialog-DEnyBH2X.cjs`),o=require(`./command-CTdjZi1F.cjs`),s=require(`./checkbox-BQ_TclX9.cjs`),c=require(`./input-1ceJxxFI.cjs`),l=require(`./popover-Bnrgg4do.cjs`),u=require(`./select-DHiTqZeX.cjs`),d=require(`./label-BHbqbBtO.cjs`),f=require(`./switch-0-9Zt33o.cjs`),p=require(`./drawer-C3o6IEeq.cjs`),m=require(`./calendar-Bt0rlJ89.cjs`),h=require(`./radio-group-Bv6w2woK.cjs`),g=require(`./textarea-BB2WynyM.cjs`),_=require(`./text-editor-CE_GkI7o.cjs`);let v=require(`lucide-react`),y=require(`react`),b=require(`@customafk/react-toolkit/utils`),x=require(`class-variance-authority`),S=require(`react/jsx-runtime`),C=require(`@customafk/react-toolkit/date-fns`),w=require(`radix-ui`),T=require(`@customafk/react-toolkit/hooks/useMobile`),E=require(`@tanstack/react-form`);function D({width:e,className:t,children:n}){let r=e?{width:typeof e==`number`?`${e}px`:e,flexShrink:0}:{flex:1,minWidth:0};return(0,S.jsx)(`div`,{"data-slot":`array-col`,style:r,className:t,children:n})}function O({className:e,children:t}){return(0,S.jsxs)(`div`,{"data-slot":`array-header-row`,className:(0,b.cn)(`mb-1 flex items-center gap-2 px-1 text-xs font-medium text-text-positive-weak`,e),children:[t,(0,S.jsx)(`div`,{className:`min-w-8 w-8 shrink-0`})]})}function k({defaultRow:e,children:n,addLabel:r=`Add row`,className:i}){let a=Q(),o=a.state.value??[],s=(0,y.useCallback)(()=>{a.pushValue({...e})},[a,e]),c=(0,y.useCallback)(e=>{a.removeValue(e)},[a]);return(0,S.jsxs)(`div`,{"data-slot":`simple-array-field`,className:(0,b.cn)(`flex flex-col gap-2`,i),children:[o.map((e,r)=>(0,S.jsxs)(`div`,{className:`flex items-start gap-2`,children:[n(r),(0,S.jsx)(t.t,{type:`button`,size:`icon`,variant:`ghost`,color:`danger`,className:`min-w-8`,onClick:()=>c(r),children:(0,S.jsx)(v.Trash2Icon,{size:14})})]},r)),(0,S.jsx)(`div`,{children:(0,S.jsxs)(t.t,{type:`button`,variant:`outline`,color:`muted`,size:`xs`,onClick:s,children:[(0,S.jsx)(v.PlusIcon,{size:13}),r]})})]})}const A=(0,x.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`}}),j=({label:e,color:t,size:n,className:r,children:i})=>(0,S.jsx)(`div`,{"data-slot":`required-indicator`,className:A({color:t,size:n,className:r}),children:e||i});function M({className:e,children:t,...n}){return(0,S.jsxs)(w.Label.Root,{"data-slot":`label`,className:(0,b.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:[(0,S.jsx)(`span`,{className:`flex items-center gap-1`,children:t}),(0,S.jsx)(j,{label:`Required`,color:`danger`,size:`xs`,className:`hidden shrink-0`})]})}const N=(0,x.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`}}),ee=(0,y.memo)(({className:e,...t})=>(0,S.jsx)(`fieldset`,{"data-slot":`field-set`,className:(0,b.cn)(`flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,e),...t}));ee.displayName=`FieldSet`;const P=(0,y.memo)(({className:e,variant:t=`legend`,...n})=>(0,S.jsx)(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:(0,b.cn)(`mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,e),...n}));P.displayName=`FieldLegend`;const F=(0,y.memo)(({className:e,...t})=>(0,S.jsx)(`div`,{"data-slot":`field-group`,className:(0,b.cn)(`group/field-group @container/field-group`,`flex flex-col gap-7 pt-4`,`data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,e),...t}));F.displayName=`FieldGroup`;const I=(0,y.memo)(({className:e,orientation:t=`vertical`,...n})=>(0,S.jsx)(`div`,{"data-slot":`field`,"data-orientation":t,className:(0,b.cn)(N({orientation:t}),e),...n}));I.displayName=`Field`;const L=(0,y.memo)(({className:e,...t})=>(0,S.jsx)(`div`,{"data-slot":`field-content`,className:(0,b.cn)(`group/field-content flex flex-col gap-1.5 leading-snug`,e),...t}));L.displayName=`FieldContent`;const R=(0,y.memo)(({className:e,...t})=>(0,S.jsx)(`div`,{"data-slot":`field-content-main`,className:(0,b.cn)(`relative`,e),...t}));R.displayName=`FieldContentMain`;const z=(0,y.memo)(({className:e,...t})=>(0,S.jsx)(M,{"data-slot":`field-label`,className:(0,b.cn)(`group/field-label peer/field-label min-h-6 gap-1 font-medium leading-snug`,`has-[>[data-slot=field]]:w-full`,`has-[>[data-slot=field]]:flex-col`,`has-[>[data-slot=field]]:rounded-md`,`has-[>[data-slot=field]]:border`,`has-[>[data-slot=field]]:border-border`,`has-data-[state=checked]:border-primary`,`*:data-[slot=field]:p-4 group-data-[disabled=true]/field:opacity-50`,e),...t}));z.displayName=`FieldLabel`;const B=(0,y.memo)(({className:e,...t})=>(0,S.jsx)(`div`,{"data-slot":`field-label`,className:(0,b.cn)(`flex w-fit items-center gap-2 font-medium text-sm leading-snug group-data-[disabled=true]/field:opacity-50`,e),...t}));B.displayName=`FieldTitle`;const V=(0,y.memo)(({className:e,...t})=>(0,S.jsx)(`p`,{"data-slot":`field-description`,className:(0,b.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}));V.displayName=`FieldDescription`;const H=(0,y.memo)(({isShow:e=!0,className:t,children:n,...r})=>e===!1?null:(0,S.jsxs)(`div`,{"data-slot":`field-note`,className:(0,b.cn)(`flex items-start gap-1.5 rounded border border-primary-muted/60 bg-primary-bg-subtle/80 px-2.5 py-2 text-text-positive-weak text-xs`,t),...r,children:[(0,S.jsx)(v.InfoIcon,{size:12,className:`mt-0.5 shrink-0 text-primary/70`}),(0,S.jsx)(`span`,{children:n})]}));H.displayName=`FieldNote`;const U=(0,y.memo)(({tooltip:e})=>(0,S.jsxs)(n.t,{children:[(0,S.jsx)(n.i,{asChild:!0,children:(0,S.jsxs)(`button`,{type:`button`,tabIndex:-1,className:`inline-flex cursor-default items-center text-text-positive-weak/70 hover:text-text-positive focus:outline-none`,children:[(0,S.jsx)(v.HelpCircleIcon,{size:13,"aria-hidden":`true`}),(0,S.jsx)(`span`,{className:`sr-only`,children:`More information`})]})}),(0,S.jsx)(n.n,{side:`top`,className:`max-w-xs text-balance`,children:e})]}));U.displayName=`FieldTooltip`;const W=(0,y.memo)(({children:e,className:t,...n})=>(0,S.jsxs)(`div`,{"data-slot":`field-separator`,"data-content":!!e,className:(0,b.cn)(`relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2`,t),...n,children:[(0,S.jsx)(r.t,{className:`absolute inset-0 top-1/2`}),e&&(0,S.jsx)(`span`,{className:`relative mx-auto block w-fit bg-background px-2 text-text-positive-weak`,"data-slot":`field-separator-content`,children:e})]}));W.displayName=`FieldSeparator`;const G=(0,y.memo)(({className:e,children:t,errors:n,...r})=>{let i=(0,y.useMemo)(()=>t||(n?n?.length===1&&n[0]?.message?(0,S.jsx)(`div`,{className:`flex flex-row items-center justify-start gap-x-0.5`,children:(0,S.jsx)(`p`,{children:n[0]?.code===`invalid_type`?`Invalid format`:n[0].message})}):(0,S.jsx)(`ul`,{className:`flex list-none flex-col`,children:n.map(e=>typeof e==`string`?(0,S.jsx)(`li`,{children:e},e):e?.message?(0,S.jsx)(`li`,{children:e.message},e.message):null)}):null),[t,n]);return i?(0,S.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:(0,b.cn)(`w-full font-medium text-danger-strong text-xs`,e),...r,children:i}):null});G.displayName=`FieldError`;const te=({label:e,required:t,disabled:n,variant:r=`checkbox`})=>{let i=(0,y.useId)(),{form:a,name:o,state:c,handleBlur:l,handleChange:u}=Q(),p=(0,E.useStore)(a.store,({isSubmitting:e})=>e),m=c.meta.isTouched&&!c.meta.isValid,h=c.value??!1,g=n||p,_=(0,y.useCallback)(e=>{p||u(e)},[p,u]);return(0,S.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2 h-9`,children:[r===`switch`?(0,S.jsx)(f.t,{id:i,name:o,checked:h,disabled:g,"aria-invalid":m,onBlur:l,onCheckedChange:_}):(0,S.jsx)(s.t,{id:i,name:o,checked:h,disabled:g,"aria-invalid":m,onBlur:l,onCheckedChange:_}),e&&(0,S.jsxs)(d.t,{htmlFor:i,className:`cursor-pointer`,children:[e,t&&(0,S.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]})]}),m&&(0,S.jsx)(G,{errors:c.meta.errors})]})},ne=({label:e,placeholder:n,required:r,disabled:i,options:a})=>{let s=(0,y.useId)(),{form:c,name:u,state:f,handleBlur:m,handleChange:h}=Q(),g=(0,E.useStore)(c.store,({isSubmitting:e})=>e),_=(0,T.useIsMobile)(),[v,x]=(0,y.useState)(!1),C=f.meta.isTouched&&!f.meta.isValid,w=i||g,D=a.find(({value:e})=>e===f.value)?.label,O=(0,S.jsxs)(o.t,{children:[(0,S.jsx)(o.a,{placeholder:n??`Search…`}),(0,S.jsxs)(o.s,{children:[(0,S.jsx)(o.r,{children:`No results found.`}),(0,S.jsx)(o.i,{children:a.map(e=>(0,S.jsx)(o.o,{value:e.label,onSelect:()=>{h(e.value===f.value?null:e.value),x(!1)},children:e.label},e.value))})]})]});return _?(0,S.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e&&(0,S.jsxs)(d.t,{htmlFor:s,children:[e,r&&(0,S.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,S.jsx)(t.t,{id:s,type:`button`,variant:`outline`,color:`muted`,disabled:w,"aria-invalid":C,className:(0,b.cn)(`w-full justify-start font-normal outline-1 outline-border -outline-offset-1`,!f.value&&`text-text-positive-muted`,C&&`outline-danger bg-danger-bg-subtle`),onBlur:m,onClick:()=>x(!0),children:D??(0,S.jsx)(`span`,{className:`text-text-positive-muted`,children:n})}),(0,S.jsx)(p.t,{open:v,onOpenChange:x,direction:`bottom`,children:(0,S.jsxs)(p.r,{children:[(0,S.jsx)(p.o,{children:(0,S.jsx)(p.l,{children:e??n??`Search…`})}),(0,S.jsx)(`div`,{className:`overflow-y-auto pb-safe-bottom`,children:O})]})}),C&&(0,S.jsx)(G,{errors:f.meta.errors})]}):(0,S.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e&&(0,S.jsxs)(d.t,{htmlFor:s,children:[e,r&&(0,S.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,S.jsxs)(l.t,{children:[(0,S.jsx)(l.a,{asChild:!0,children:(0,S.jsx)(t.t,{id:s,variant:`outline`,color:`muted`,size:`lg`,disabled:w,"aria-invalid":C,className:(0,b.cn)(`flex w-full items-center justify-start rounded outline-border font-normal`,`hover:bg-transparent`,`focus:outline-1 focus:outline-primary-strong focus:ring-4 focus:ring-primary-weak`,`data-[state=open]:outline-1 data-[state=open]:outline-primary-strong data-[state=open]:ring-4 data-[state=open]:ring-primary-weak`,!f.value&&`text-text-positive-muted`),children:D??(0,S.jsx)(`span`,{className:`text-text-positive-muted`,children:n})})}),(0,S.jsx)(l.i,{align:`start`,side:`bottom`,className:`w-[--radix-popover-trigger-width] p-0 rounded`,onBlur:m,children:O})]}),C&&(0,S.jsx)(G,{errors:f.meta.errors})]})},re=({label:e,placeholder:n,required:r,disabled:i,minDate:a,maxDate:o})=>{let s=(0,y.useId)(),{form:c,name:u,state:f,handleBlur:p,handleChange:h}=Q(),g=(0,E.useStore)(c.store,({isSubmitting:e})=>e),_=f.meta.isTouched&&!f.meta.isValid;return(0,S.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e&&(0,S.jsxs)(d.t,{htmlFor:s,children:[e,r&&(0,S.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,S.jsxs)(l.t,{children:[(0,S.jsx)(l.a,{asChild:!0,children:(0,S.jsxs)(t.t,{id:s,variant:`outline`,color:`muted`,size:`lg`,disabled:i||g,"aria-invalid":_,className:(0,b.cn)(`flex w-full items-center justify-between rounded outline-border font-normal`,`hover:bg-transparent`,`focus:outline-1 focus:outline-primary-strong focus:ring-4 focus:ring-primary-weak`,`data-[state=open]:outline-1 data-[state=open]:outline-primary-strong data-[state=open]:ring-4 data-[state=open]:ring-primary-weak`,f.value===null&&`text-text-positive-muted`),children:[(0,S.jsx)(`span`,{children:f.value?(0,C.format)(f.value,`PPP`):n??`Select date`}),(0,S.jsx)(v.CalendarDaysIcon,{strokeWidth:1})]})}),(0,S.jsx)(l.i,{align:`start`,side:`bottom`,className:`w-fit p-0 rounded`,onBlur:p,children:(0,S.jsx)(m.t,{mode:`single`,selected:f.value??void 0,hidden:{before:a??new Date(1900,0,1),after:o??new Date(2100,11,31)},onSelect:e=>{e&&h(e)}})})]}),_&&(0,S.jsx)(G,{errors:f.meta.errors})]})},ie=({label:e,required:t,disabled:n,options:r,orientation:i=`vertical`})=>{let{form:a,name:o,state:s,handleBlur:c,handleChange:l}=Q(),u=(0,E.useStore)(a.store,({isSubmitting:e})=>e),f=s.meta.isTouched&&!s.meta.isValid,p=n||u;return(0,S.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e&&(0,S.jsxs)(d.t,{children:[e,t&&(0,S.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,S.jsx)(h.t,{name:o,value:s.value??``,disabled:p,"aria-invalid":f,className:i===`horizontal`?`flex flex-row flex-wrap gap-x-4 gap-y-2`:`flex flex-col gap-2`,onValueChange:l,onBlur:c,children:r.map(e=>(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(h.n,{id:`${o}-${e.value}`,value:e.value}),(0,S.jsx)(d.t,{htmlFor:`${o}-${e.value}`,className:`cursor-pointer font-normal`,children:e.label})]},e.value))}),f&&(0,S.jsx)(G,{errors:s.meta.errors})]})},ae=({label:e,placeholder:t,required:n,maxLength:r,disabled:i})=>{let a=(0,y.useId)(),{form:o,name:s,state:l,handleBlur:u,handleChange:f}=Q(),p=(0,E.useStore)(o.store,({isSubmitting:e})=>e),m=l.meta.isTouched&&!l.meta.isValid,h=(0,y.useCallback)(({target:{value:e}})=>{p||r&&e.length>r||f(e||null)},[p,r,f]);return(0,S.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e&&(0,S.jsxs)(d.t,{htmlFor:a,children:[e,n&&(0,S.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,S.jsxs)(`div`,{className:`relative`,children:[(0,S.jsx)(c.t,{id:a,name:s,type:`email`,value:l.value??``,"aria-invalid":m,autoComplete:`email`,placeholder:t,disabled:i||p,className:(0,b.cn)(`pl-9`),onBlur:u,onChange:h}),(0,S.jsx)(`div`,{className:`pointer-events-none absolute inset-y-0 left-0 flex size-9 items-center justify-center text-muted`,children:(0,S.jsx)(v.AtSignIcon,{size:14})})]}),m&&(0,S.jsx)(G,{errors:l.meta.errors})]})},oe=e=>e?/^-?\d*\.?\d*$/:/^\d*\.?\d*$/,se=e=>Number(e).toLocaleString(),ce=(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}},K=({disabled:e=!1,readOnly:t=!1,allowNegative:n=!1,numberAfterDecimalPoint:r=2,roundingRule:i=`none`,value:a=null,unitText:o,decimal:s,placeholder:l,precision:u,wrapperClassName:d,className:f,onChange:p,onValueChange:m,onFocus:h,onBlur:g,..._})=>{let v=(0,y.useRef)(null),x=(0,y.useRef)(null),[C,w]=(0,y.useState)(a?.toString()??null),T=(0,y.useMemo)(()=>s?.[1]??r,[s,r]),E=(0,y.useMemo)(()=>s&&s[0]-s[1],[s]),D=(0,y.useMemo)(()=>oe(n),[n]),O=(0,y.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,y.useCallback)(e=>{if(e===`0`)return`0`;if(!Number(e))return null;let[t,n=``]=ce(parseFloat(e),Math.min(T-1,u||0),i).toString().split(`.`),r=se(t);return n?`${r}.${n}`:r},[T,u,i]),A=(0,y.useCallback)(e=>{let t=e===`0`,n=e===`-`||/^-0+(\.0+)?$/.test(e)||/^-0*\.$/.test(e);if(t){m?.(0),w(e);return}if(n){w(()=>(m?.(0),e));return}},[m]),j=(0,y.useCallback)(e=>{p?.(e);let{value:t}=e.target;if(t===``||t===void 0){m?.(null),w(null);return}A(t),!(!D.test(t)||!O(t))&&(m?.(parseFloat(t)||0),w(t))},[O,p,m,A,D]),M=(0,y.useCallback)(e=>{t||(h?.(e),w(e=>typeof e==`string`?e.replace(/,/g,``):null))},[t,h]),N=(0,y.useCallback)(e=>{t||(g?.(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,g]);return(0,y.useEffect)(()=>{let e=document.activeElement===x.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,y.useEffect)(()=>{if(!v.current||!x.current||!o)return;let e=v.current.offsetWidth;x.current.style.setProperty(`padding-right`,`${(e+10)/16}rem`)},[o]),(0,S.jsxs)(`div`,{className:(0,b.cn)(`relative`,d),children:[(0,S.jsx)(c.t,{..._,ref:x,value:C||(t?`0`:``),placeholder:l,disabled:e,readOnly:t,className:(0,b.cn)(`text-end font-number text-sm slashed-zero lining-nums tabular-nums`,t&&`bg-muted text-muted-foreground`,f),onChange:j,onFocus:M,onBlur:N}),o&&(0,S.jsx)(`span`,{ref:v,className:`-translate-y-1/2 pointer-events-none absolute top-1/2 right-2 text-muted-foreground text-sm`,children:o})]})},le=({label:e,placeholder:t,required:n,unit:r,allowNegative:i,disabled:a})=>{let o=(0,y.useId)(),{form:s,state:c,handleBlur:l,handleChange:u}=Q(),f=(0,E.useStore)(s.store,({isSubmitting:e})=>e),p=c.meta.isTouched&&!c.meta.isValid,m=(0,y.useCallback)(e=>{f||u(e)},[f,u]);return(0,S.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e&&(0,S.jsxs)(d.t,{htmlFor:o,children:[e,n&&(0,S.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,S.jsx)(K,{id:o,value:c.value,placeholder:t,unitText:r,allowNegative:i,disabled:a||f,onBlur:l,onValueChange:m}),p&&(0,S.jsx)(G,{errors:c.meta.errors})]})},ue=({label:e,placeholder:t,required:n,disabled:r})=>{let i=(0,y.useId)(),{form:a,name:o,state:s,handleBlur:l,handleChange:u}=Q(),f=(0,E.useStore)(a.store,({isSubmitting:e})=>e),[p,m]=(0,y.useState)(!1),h=s.meta.isTouched&&!s.meta.isValid,g=(0,y.useCallback)(()=>m(e=>!e),[]),_=(0,y.useCallback)(({target:{value:e}})=>{f||u(e||null)},[f,u]);return(0,S.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e&&(0,S.jsxs)(d.t,{htmlFor:i,children:[e,n&&(0,S.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,S.jsxs)(`div`,{className:`relative`,children:[(0,S.jsx)(c.t,{id:i,name:o,type:p?`text`:`password`,value:s.value??``,"aria-invalid":h,autoComplete:`current-password`,placeholder:t,disabled:r||f,className:`pr-9`,onBlur:l,onChange:_}),(0,S.jsx)(`button`,{type:`button`,tabIndex:-1,"aria-label":p?`Hide password`:`Show password`,"aria-pressed":p,"aria-controls":i,className:`absolute inset-y-0 right-0 flex size-9 items-center justify-center text-muted outline-none transition-colors hover:text-text-positive focus-visible:text-text-positive disabled:pointer-events-none disabled:opacity-50`,disabled:r||f,onClick:g,children:p?(0,S.jsx)(v.EyeOffIcon,{size:16,"aria-hidden":`true`}):(0,S.jsx)(v.EyeIcon,{size:16,"aria-hidden":`true`})})]}),h&&(0,S.jsx)(G,{errors:s.meta.errors})]})},de=({label:e,placeholder:n,required:r,options:i})=>{let a=(0,y.useId)(),{state:o,handleBlur:s,handleChange:c}=Q(),l=(0,T.useIsMobile)(),[f,m]=(0,y.useState)(!1),h=o.meta.isTouched&&!o.meta.isValid,g=i.find(e=>e.value===o.value)?.label;return l?(0,S.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e&&(0,S.jsxs)(d.t,{htmlFor:a,children:[e,r&&(0,S.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,S.jsx)(t.t,{id:a,type:`button`,variant:`outline`,color:`muted`,className:(0,b.cn)(`w-full justify-start font-normal outline-1 outline-border -outline-offset-1`,!o.value&&`text-text-positive-muted`,h&&`outline-danger bg-danger-bg-subtle`),"aria-invalid":h,onBlur:s,onClick:()=>m(!0),children:g??(0,S.jsx)(`span`,{className:`text-text-positive-muted`,children:n})}),(0,S.jsx)(p.t,{open:f,onOpenChange:m,direction:`bottom`,children:(0,S.jsxs)(p.r,{children:[(0,S.jsx)(p.o,{children:(0,S.jsx)(p.l,{children:e??n??`Select an option`})}),(0,S.jsx)(`div`,{className:`flex flex-col overflow-y-auto pb-safe-bottom`,children:i.length>0?i.map(e=>(0,S.jsx)(p.n,{asChild:!0,children:(0,S.jsx)(`button`,{type:`button`,className:(0,b.cn)(`flex w-full items-center px-4 py-3 text-left text-sm transition-colors`,`hover:bg-muted-muted active:bg-muted-muted`,o.value===e.value&&`bg-primary-bg-subtle font-medium text-primary`),onClick:()=>{c(e.value),m(!1)},children:e.label})},e.value)):(0,S.jsxs)(`div`,{className:`flex items-center justify-center gap-x-2 px-4 py-8 text-center text-sm text-text-positive-weak`,children:[(0,S.jsx)(v.PackagePlusIcon,{strokeWidth:1}),`No options available`]})})]})}),h&&(0,S.jsx)(G,{errors:o.meta.errors})]}):(0,S.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e&&(0,S.jsxs)(d.t,{htmlFor:a,children:[e,r&&(0,S.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,S.jsxs)(u.t,{value:o.value??``,onValueChange:c,children:[(0,S.jsx)(u.s,{id:a,"aria-invalid":h?`true`:void 0,onBlur:s,children:(0,S.jsx)(u.c,{placeholder:n})}),(0,S.jsx)(u.n,{children:i.length>0?i.map(e=>(0,S.jsx)(u.i,{value:e.value,children:e.label},e.value)):(0,S.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,S.jsx)(v.PackagePlusIcon,{strokeWidth:1}),`No options available`]})})]}),h&&(0,S.jsx)(G,{errors:o.meta.errors})]})},fe=({label:e,placeholder:t,required:n,maxLength:r,rows:i,disabled:a})=>{let o=(0,y.useId)(),{form:s,name:c,state:l,handleBlur:u,handleChange:f}=Q(),p=(0,E.useStore)(s.store,({isSubmitting:e})=>e),m=l.meta.isTouched&&!l.meta.isValid,h=(0,y.useCallback)(({target:{value:e}})=>{p||r&&e.length>r||f(e||null)},[p,r,f]);return(0,S.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e&&(0,S.jsxs)(d.t,{htmlFor:o,children:[e,n&&(0,S.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,S.jsx)(g.t,{id:o,name:c,value:l.value??``,"aria-invalid":m,placeholder:t,rows:i,disabled:a||p,onBlur:u,onChange:h}),m&&(0,S.jsx)(G,{errors:l.meta.errors})]})},pe=({label:e,placeholder:t,required:n,maxLength:r,disabled:i})=>{let a=(0,y.useId)(),{form:o,name:s,state:l,handleBlur:u,handleChange:f}=Q(),p=(0,E.useStore)(o.store,({isSubmitting:e})=>e),m=l.meta.isTouched&&!l.meta.isValid,h=(0,y.useCallback)(({target:{value:e}})=>{p||r&&e.length>r||f(e||null)},[p,r,f]);return(0,S.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e&&(0,S.jsxs)(d.t,{htmlFor:a,children:[e,n&&(0,S.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,S.jsx)(c.t,{id:a,name:s,value:l.value??``,"aria-invalid":m,placeholder:t,autoComplete:`off`,disabled:i||p,onBlur:u,onChange:h}),m&&(0,S.jsx)(G,{errors:l.meta.errors})]})},me=({label:e,description:t,options:n,tooltip:r,helperText:i,orientation:a})=>{let o=Q(),c=(0,E.useStore)(o.form.store,({isSubmitting:e})=>e);return(0,S.jsxs)(F,{className:`gap-y-4 px-4`,children:[(0,S.jsxs)(I,{orientation:a,children:[(0,S.jsxs)(L,{children:[(0,S.jsxs)(z,{children:[e,r&&(0,S.jsx)(U,{tooltip:r})]}),(0,S.jsx)(V,{children:t}),(0,S.jsx)(H,{isShow:!!i,children:i})]}),(0,S.jsx)(R,{children:(0,S.jsx)(F,{className:`flex flex-col gap-y-2`,children:n.map(e=>(0,S.jsxs)(I,{orientation:`horizontal`,children:[(0,S.jsx)(s.t,{id:`${o.name}-${e.value}`,name:o.name,checked:o.state.value?.includes(e.value)??!1,disabled:c,onCheckedChange:t=>{if(t&&o.state.value!==null)o.pushValue(e.value);else if(t&&o.state.value===null)o.setValue([e.value]);else if(!t&&o.state.value!==null){let t=o.state.value.indexOf(e.value);t>-1&&o.removeValue(t)}else o.setValue(null)}}),(0,S.jsx)(z,{htmlFor:`${o.name}-${e.value}`,className:`text-text-positive`,children:e.label})]},e.value))})})]}),(0,S.jsx)(W,{})]})},he=({label:e,description:n,placeholder:r,tooltip:i,orientation:a=`responsive`,options:s})=>{let c=Q(),u=(0,T.useIsMobile)(),[d,f]=(0,y.useState)(!1),m=(0,y.useMemo)(()=>c.state.meta.isTouched&&!c.state.meta.isValid,[c.state.meta.isTouched,c.state.meta.isValid]),h=(0,y.useMemo)(()=>c.state.meta.errors,[c.state.meta.errors]),g=s.find(({value:e})=>e===c.state.value)?.label,_=e=>(0,S.jsx)(t.t,{variant:`outline`,color:`muted`,size:`lg`,className:(0,b.cn)(`flex items-center justify-start rounded outline-border`,`hover:bg-transparent`,`focus:outline-1 focus:outline-primary-strong focus:ring-4 focus:ring-primary-weak`,`data-[state=open]:text-text-positive-muted data-[state=open]:outline-1 data-[state=open]:outline-primary-strong data-[state=open]:ring-4 data-[state=open]:ring-primary-weak`,!c.state.value&&`text-text-positive-muted`),onClick:e,children:g?(0,S.jsx)(`p`,{className:`flex min-w-0 flex-1 items-center gap-2 text-start`,children:g}):(0,S.jsx)(`p`,{className:`flex-1 text-start text-text-positive-muted`,children:r})}),v=(0,S.jsxs)(o.t,{className:`border-none`,children:[(0,S.jsx)(o.a,{placeholder:r??`Search…`}),(0,S.jsx)(o.s,{children:(0,S.jsx)(o.i,{className:`max-h-40 overflow-y-auto`,children:s.map(({value:e,label:t})=>(0,S.jsx)(o.o,{value:t,onSelect:()=>{c.handleChange(e),f(!1)},children:t},e))})}),(0,S.jsx)(o.r,{children:`No results found.`})]});return(0,S.jsxs)(F,{className:`px-4`,children:[(0,S.jsxs)(I,{orientation:a,"data-invalid":m,children:[(0,S.jsxs)(L,{children:[(0,S.jsxs)(z,{htmlFor:c.name,children:[e,i&&(0,S.jsx)(U,{tooltip:i})]}),(0,S.jsx)(V,{children:n})]}),(0,S.jsx)(R,{className:`flex justify-end`,children:(0,S.jsxs)(`div`,{className:`flex w-full max-w-60 flex-col`,children:[u?(0,S.jsxs)(S.Fragment,{children:[_(()=>f(!0)),(0,S.jsx)(p.t,{open:d,onOpenChange:f,direction:`bottom`,children:(0,S.jsxs)(p.r,{children:[(0,S.jsx)(p.o,{children:(0,S.jsx)(p.l,{children:e})}),(0,S.jsx)(`div`,{className:`overflow-y-auto pb-safe-bottom`,children:v})]})})]}):(0,S.jsxs)(l.t,{children:[(0,S.jsx)(l.a,{asChild:!0,children:_()}),(0,S.jsx)(l.i,{align:`end`,side:`bottom`,className:`flex w-fit rounded p-0`,onBlur:c.handleBlur,children:v})]}),(0,S.jsx)(`div`,{className:`mt-1 flex w-full flex-col items-end justify-end`,children:(0,S.jsx)(G,{errors:h})})]})})]}),(0,S.jsx)(W,{})]})},ge=({label:e,description:n,placeholder:r,orientation:i=`responsive`,tooltip:a,helperText:o,minDate:s,maxDate:c,required:u})=>{let d=Q(),f=(0,y.useMemo)(()=>u?d.state.value===null:!1,[u,d.state.value]),p=(0,y.useMemo)(()=>d.state.meta.isTouched&&!d.state.meta.isValid,[d.state.meta.isTouched,d.state.meta.isValid]);return(0,S.jsxs)(F,{className:`px-4`,children:[(0,S.jsxs)(I,{orientation:i,"data-invalid":p,children:[(0,S.jsxs)(L,{children:[(0,S.jsxs)(z,{htmlFor:d.name,"aria-required":f,children:[e,a&&(0,S.jsx)(U,{tooltip:a})]}),(0,S.jsx)(V,{children:n})]}),(0,S.jsxs)(R,{className:`flex flex-col space-y-1`,children:[(0,S.jsx)(`div`,{className:`flex w-full flex-col`,children:(0,S.jsxs)(l.t,{children:[(0,S.jsx)(l.a,{asChild:!0,children:(0,S.jsxs)(t.t,{variant:`outline`,color:`muted`,size:`lg`,className:(0,b.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,S.jsx)(`p`,{children:d.state.value===null?r||`Select date`:(0,C.format)(d.state.value,`PPPP`)}),(0,S.jsx)(v.CalendarDaysIcon,{strokeWidth:1})]})}),(0,S.jsxs)(l.i,{align:`start`,side:`bottom`,className:`flex w-fit min-w-0 overflow-y-auto rounded p-0`,onBlur:d.handleBlur,children:[(0,S.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,S.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,C.endOfToday)())},children:`Today`}),(0,S.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,C.endOfTomorrow)())},children:`Tomorrow`}),(0,S.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,C.endOfYesterday)())},children:`Yesterday`}),(0,S.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,C.subDays)((0,C.endOfToday)(),3))},children:`Last 3 Days`}),(0,S.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,C.subDays)((0,C.endOfToday)(),7))},children:`Last 7 Days`}),(0,S.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,C.subDays)((0,C.endOfToday)(),30))},children:`Last 30 Days`}),(0,S.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,C.startOfMonth)((0,C.endOfToday)()))},children:`This Month`}),(0,S.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,C.lastDayOfMonth)((0,C.endOfToday)()))},children:`Last Month`})]}),(0,S.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,S.jsx)(`div`,{className:`min-w-73 border-b border-b-border p-2`,children:(0,S.jsx)(m.t,{mode:`single`,selected:d.state.value??void 0,hidden:{before:s??new Date(1900,0,1),after:c??new Date(2100,11,31)},onSelect:e=>{e&&d.handleChange(e)}})})})]})]})}),(0,S.jsx)(H,{isShow:!!o,children:o})]})]}),(0,S.jsx)(W,{})]})},_e=({label:e,description:t,placeholder:n,tooltip:r,helperText:i,orientation:a=`responsive`,showErrorMessage:o=!0,required:s=!1,maxLength:l})=>{let{form:u,name:d,state:f,handleBlur:p,handleChange:m}=Q(),h=(0,E.useStore)(u.store,({isSubmitting:e})=>e),g=f.meta.isDirty&&f.meta.isTouched&&!f.meta.isValid,_=s&&f.value===null,x=!h&&!!f.value,C=(0,y.useCallback)(({target:{value:e}})=>{h||l&&e.length>l||m(e||null)},[h,l,m]),w=(0,y.useCallback)(()=>{h||m(null)},[h,m]);return(0,S.jsxs)(F,{className:`gap-y-4 px-4`,children:[(0,S.jsxs)(I,{"data-invalid":g,orientation:a,children:[(0,S.jsxs)(L,{children:[(0,S.jsxs)(z,{htmlFor:d,"aria-required":_,children:[e,r&&(0,S.jsx)(U,{tooltip:r})]}),(0,S.jsx)(V,{children:t})]}),(0,S.jsxs)(R,{children:[(0,S.jsx)(c.t,{id:d,name:d,value:f.value===null?``:f.value,"aria-invalid":g,autoComplete:`email`,placeholder:n,className:(0,b.cn)(`pl-9`,x&&`pr-9`,h&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:p,onChange:C}),(0,S.jsx)(`div`,{className:`absolute top-0 left-0 flex size-9 items-center justify-center text-muted`,children:(0,S.jsx)(v.AtSignIcon,{size:14})}),x&&(0,S.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:w,children:(0,S.jsx)(v.XIcon,{size:14,"aria-hidden":`true`})}),(0,S.jsx)(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:o&&f.meta.isDirty&&(0,S.jsx)(G,{errors:f.meta.errors})}),(0,S.jsx)(H,{isShow:!!i,children:i})]})]}),(0,S.jsx)(W,{})]})},ve=({label:e,description:t,placeholder:n,tooltip:r,helperText:i,orientation:a=`responsive`,showErrorMessage:o=!0,rounding:s,decimalPlaces:c,percision:l,unit:u,required:d,allowNegative:f})=>{let p=Q(),m=(0,E.useStore)(p.form.store,({isSubmitting:e})=>e),h=p.state.meta.errors,g=d?p.state.value===null:!1,_=(0,y.useCallback)(e=>{m||p.handleChange(e)},[m,p.handleChange]);return(0,S.jsxs)(F,{className:`gap-y-4 px-4`,children:[(0,S.jsxs)(I,{orientation:a,"data-invalid":p.state.meta.isTouched&&!p.state.meta.isValid,children:[(0,S.jsxs)(L,{children:[(0,S.jsxs)(z,{htmlFor:p.name,"aria-required":g,children:[e,r&&(0,S.jsx)(U,{tooltip:r})]}),(0,S.jsx)(V,{children:t})]}),(0,S.jsxs)(R,{children:[(0,S.jsxs)(`div`,{className:`relative w-full`,children:[(0,S.jsx)(K,{id:p.name,value:p.state.value,"aria-invalid":p.state.meta.isTouched&&!p.state.meta.isValid&&p.state.meta.isDirty,placeholder:n,roundingRule:s,numberAfterDecimalPoint:c,precision:l,unitText:u,allowNegative:f,className:(0,b.cn)(m&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:p.handleBlur,onValueChange:_}),m&&(0,S.jsx)(`div`,{className:`absolute inset-s-2 inset-y-0 top-2.5 text-muted-weak [&>svg]:size-3.5`,children:(0,S.jsx)(v.Loader2Icon,{className:`animate-spin text-primary-strong`})}),p.state.meta.isDirty&&o&&!!h.length&&(0,S.jsx)(`div`,{className:`absolute inset-s-2 inset-y-0 top-2.75 text-danger-strong [&>svg]:size-3.5`,children:(0,S.jsx)(v.BanIcon,{})}),(0,S.jsx)(`div`,{className:`mt-1 flex w-full flex-col items-end justify-end`,children:p.state.meta.isDirty&&o&&(0,S.jsx)(G,{errors:h})})]}),(0,S.jsx)(H,{isShow:!!i,children:i})]})]}),(0,S.jsx)(W,{})]})},ye=({label:e,description:t,placeholder:n,orientation:r=`responsive`,tooltip:i,helperText:a,showErrorMessage:o=!0})=>{let s=(0,y.useId)(),{form:l,name:u,state:d,handleBlur:f,handleChange:p}=Q(),m=(0,E.useStore)(l.store,({isSubmitting:e})=>e),[h,g]=(0,y.useState)(!1),_=d.meta.isDirty&&d.meta.isTouched&&!d.meta.isValid,b=(0,y.useCallback)(()=>g(e=>!e),[]),x=(0,y.useCallback)(({target:{value:e}})=>{m||p(e||null)},[m,p]);return(0,S.jsxs)(F,{className:`gap-y-4 px-4`,children:[(0,S.jsxs)(I,{"data-invalid":_,orientation:r,children:[(0,S.jsxs)(L,{children:[(0,S.jsxs)(z,{htmlFor:s,children:[e,i&&(0,S.jsx)(U,{tooltip:i})]}),(0,S.jsx)(V,{children:t})]}),(0,S.jsxs)(R,{children:[(0,S.jsx)(c.t,{id:s,name:u,type:h?`text`:`password`,placeholder:n,value:d.value??``,"aria-invalid":_,autoComplete:`new-password`,onBlur:f,onChange:x}),(0,S.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":h?`Hide password`:`Show password`,"aria-pressed":h,"aria-controls":s,children:h?(0,S.jsx)(v.EyeOffIcon,{size:16,"aria-hidden":`true`}):(0,S.jsx)(v.EyeIcon,{size:16,"aria-hidden":`true`})}),(0,S.jsx)(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:o&&d.meta.isDirty&&(0,S.jsx)(G,{errors:d.meta.errors})}),(0,S.jsx)(H,{isShow:!!a,children:a})]})]}),(0,S.jsx)(W,{})]})},be=({label:e,description:t,orientation:n,options:r,tooltip:i,helperText:a})=>{let o=Q(),s=(0,E.useStore)(o.form.store,({isSubmitting:e})=>e);return(0,S.jsxs)(F,{className:`px-4`,children:[(0,S.jsxs)(I,{orientation:n,className:`flex-col gap-2`,children:[(0,S.jsxs)(L,{children:[(0,S.jsxs)(z,{children:[e,i&&(0,S.jsx)(U,{tooltip:i})]}),(0,S.jsx)(V,{children:t}),(0,S.jsx)(H,{isShow:!!a,children:a})]}),(0,S.jsx)(R,{children:(0,S.jsx)(h.t,{value:o.state.value??``,className:`w-full`,onValueChange:o.handleChange,children:r.map(e=>(0,S.jsx)(z,{className:(0,b.cn)(`h-fit`,o.state.value===e.value&&`border-primary-weak! bg-primary-bg-subtle`,s&&`pointer-events-none bg-muted-muted opacity-60`,o.state.value===e.value&&s&&`border-border-strong!`),children:(0,S.jsxs)(I,{orientation:`horizontal`,className:`items-start gap-3 rounded p-2!`,children:[(0,S.jsx)(h.n,{value:e.value,className:`mt-0.5 shrink-0`}),(0,S.jsxs)(L,{className:`gap-0.5!`,children:[(0,S.jsx)(B,{children:e.label}),(0,S.jsx)(V,{className:`text-xs`,children:e.description})]})]})},e.value))})})]}),(0,S.jsx)(W,{})]})},xe=({label:e,description:t,placeholder:n,orientation:r=`responsive`,tooltip:i,options:a,helperText:o,required:s=!1})=>{let c=Q(),l=(0,T.useIsMobile)(),[d,f]=(0,y.useState)(!1),m=c.state.meta.isTouched&&!c.state.meta.isValid,h=s&&c.state.value===null,g=c.state.meta.errors,_=a.find(e=>e.value===c.state.value)?.label;return(0,S.jsxs)(F,{className:`gap-y-4 px-4`,children:[(0,S.jsxs)(I,{orientation:r,"data-invalid":m,children:[(0,S.jsxs)(L,{children:[(0,S.jsxs)(z,{htmlFor:c.name,"aria-required":h,children:[e,i&&(0,S.jsx)(U,{tooltip:i})]}),(0,S.jsx)(V,{children:t})]}),(0,S.jsxs)(R,{className:`flex flex-col`,children:[l?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`button`,{id:c.name,type:`button`,"aria-invalid":m?`true`:void 0,onBlur:c.handleBlur,onClick:()=>f(!0),className:(0,b.cn)(`flex w-full items-center justify-between`,`outline-1 outline-border -outline-offset-1`,`gap-2 rounded bg-transparent px-3 py-2`,`rounded shadow-input transition-all cursor-pointer whitespace-nowrap text-sm`,`focus-visible:outline-primary-strong focus-visible:ring-4 focus-visible:ring-primary-weak`,m&&`outline-danger bg-danger-bg-subtle ring-danger-weak`,!c.state.value&&`text-text-positive-muted`),children:[(0,S.jsx)(`span`,{className:`line-clamp-1`,children:_??n}),(0,S.jsx)(v.ChevronDownIcon,{size:16,className:`shrink-0 opacity-50`})]}),(0,S.jsx)(p.t,{open:d,onOpenChange:f,direction:`bottom`,children:(0,S.jsxs)(p.r,{children:[(0,S.jsx)(p.o,{children:(0,S.jsx)(p.l,{children:e??n??`Select an option`})}),(0,S.jsx)(`div`,{className:`flex flex-col overflow-y-auto pb-safe-bottom`,children:a.length>0?a.map(e=>(0,S.jsx)(p.n,{asChild:!0,children:(0,S.jsx)(`button`,{type:`button`,className:(0,b.cn)(`flex w-full items-center px-4 py-3 text-left text-sm transition-colors`,`hover:bg-muted-muted active:bg-muted-muted`,c.state.value===e.value&&`bg-primary-bg-subtle font-medium text-primary`),onClick:()=>{c.handleChange(e.value),f(!1)},children:e.label})},e.value)):(0,S.jsxs)(`div`,{className:`flex items-center justify-center gap-x-2 px-4 py-8 text-center text-sm text-text-positive-weak`,children:[(0,S.jsx)(v.PackagePlusIcon,{strokeWidth:1}),`No options available`]})})]})})]}):(0,S.jsxs)(u.t,{value:c.state.value??``,onValueChange:c.handleChange,children:[(0,S.jsx)(u.s,{"aria-invalid":m?`true`:void 0,onBlur:c.handleBlur,children:(0,S.jsx)(u.c,{placeholder:n})}),(0,S.jsxs)(u.n,{children:[!!a.length&&a.map(e=>(0,S.jsx)(u.i,{value:e.value,children:e.label},e.value)),!a.length&&(0,S.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,S.jsx)(v.PackagePlusIcon,{strokeWidth:1}),`No options available`]})]})]}),(0,S.jsx)(`div`,{className:`mt-1 flex w-full flex-col items-end justify-end`,children:(0,S.jsx)(G,{errors:g})}),(0,S.jsx)(H,{isShow:!!o,children:o})]})]}),(0,S.jsx)(W,{})]})};function Se({className:e,...t}){return(0,S.jsx)(w.Switch.Root,{"data-slot":`switch`,className:(0,b.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,S.jsx)(w.Switch.Thumb,{"data-slot":`switch-thumb`,className:(0,b.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 Ce=({label:e,description:t,helperText:n})=>{let r=Q();return(0,S.jsxs)(F,{className:`gap-y-4 px-4`,children:[(0,S.jsxs)(I,{orientation:`vertical`,className:`relative justify-between gap-y-1`,children:[(0,S.jsxs)(L,{children:[(0,S.jsx)(B,{className:`cursor-pointer`,children:(0,S.jsx)(`label`,{htmlFor:r.name,children:e})}),(0,S.jsx)(V,{children:t}),(0,S.jsx)(Se,{id:r.name,checked:r.state.value??!1,className:`absolute top-1 right-1`,onBlur:r.handleBlur,onCheckedChange:r.handleChange})]}),(0,S.jsx)(H,{isShow:!!n,children:n})]}),(0,S.jsx)(W,{})]})},we=({label:e,description:t,placeholder:n,tooltip:r,helperText:i,counter:a=!1,orientation:o=`responsive`,showClearButton:s=!1,showErrorMessage:l=!0,required:u=!1,maxLength:d})=>{let f=(0,y.useId)(),p=(0,y.useRef)(null),{form:m,name:h,state:g,handleBlur:_,handleChange:x}=Q(),C=(0,E.useStore)(m.store,({isSubmitting:e})=>e),w=s&&!C&&!!g.value,T=g.value?g.value.length:0,D=(0,y.useMemo)(()=>{if(!a)return``;let e=`character${[0,1].includes(T)?``:`s`}`;return a&&d?`${T} / ${d} character${T?`s`:``}`:`${T} ${e}`},[T,a,d]),O=g.meta.isDirty&&g.meta.isTouched&&!g.meta.isValid,k=u&&g.value===null,A=d&&T>=d*.8,j=d&&T>=d,M=(0,y.useCallback)(({target:{value:e}})=>{C||a&&d&&e.length>d||x(e||null)},[C,a,d,x]),N=(0,y.useCallback)(()=>{C||(x(null),p.current?.focus())},[C,x]);return(0,S.jsxs)(F,{className:`gap-y-4 px-4`,children:[(0,S.jsxs)(I,{orientation:o,"data-invalid":O,children:[(0,S.jsxs)(L,{children:[(0,S.jsxs)(z,{"aria-required":k,htmlFor:f,children:[e,r&&(0,S.jsx)(U,{tooltip:r})]}),(0,S.jsx)(V,{children:t})]}),(0,S.jsxs)(R,{children:[(0,S.jsx)(c.t,{ref:p,id:f,name:h,value:g.value??``,"aria-invalid":O,autoComplete:`off`,placeholder:n,autoCapitalize:`none`,autoCorrect:`off`,className:(0,b.cn)(`pr-6`,C&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:_,onChange:M}),w&&(0,S.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:N,children:(0,S.jsx)(v.XIcon,{"aria-hidden":`true`})}),C&&(0,S.jsx)(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-muted-weak`,children:(0,S.jsx)(v.Loader2Icon,{size:14,className:`animate-spin text-primary-strong`})}),!w&&g.meta.isDirty&&l&&!!g.meta.errors.length&&(0,S.jsx)(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-danger-strong`,children:(0,S.jsx)(v.BanIcon,{"aria-hidden":`true`,size:14})}),(0,S.jsxs)(`div`,{className:`my-1 flex w-full items-start justify-between gap-x-2`,children:[g.meta.isDirty&&l?(0,S.jsx)(G,{className:`flex-1`,errors:g.meta.errors}):(0,S.jsx)(`div`,{}),!!a&&(0,S.jsx)(`p`,{className:(0,b.cn)(`h-4 flex-0 text-nowrap text-end text-xs tabular-nums transition-colors`,j?`font-medium text-danger-strong`:A?`text-warning-strong`:`text-text-positive-weak`),children:D})]}),(0,S.jsx)(H,{isShow:!!i,children:i})]})]}),(0,S.jsx)(W,{})]})},q=(0,y.memo)(({label:e,description:t,placeholder:n,tooltip:r,helperText:i,counter:a=!1,orientation:o=`responsive`,showErrorMessage:s=!0,required:c=!1,maxLength:l})=>{let u=(0,y.useId)(),{form:d,state:f,name:p,handleBlur:m,handleChange:h}=Q(),_=(0,E.useStore)(d.store,({isSubmitting:e})=>e),x=f.value?f.value.length:0,C=(0,y.useMemo)(()=>{if(!a)return``;let e=`character${[0,1].includes(x)?``:`s`}`;return a&&l?`${x} / ${l} character${x?`s`:``}`:`${x} ${e}`},[x,a,l]),w=f.meta.isDirty&&f.meta.isTouched&&!f.meta.isValid,T=c&&f.value===null,D=f.meta.errors,O=l&&x>=l*.8,k=l&&x>=l,A=(0,y.useCallback)(({target:{value:e}})=>{_||a&&l&&e.length>l||h(e||null)},[_,a,l,h]);return(0,S.jsxs)(F,{className:`gap-y-4 px-4`,children:[(0,S.jsxs)(I,{orientation:o,"data-invalid":w,children:[(0,S.jsxs)(L,{children:[(0,S.jsxs)(z,{"aria-required":T,htmlFor:u,children:[e,r&&(0,S.jsx)(U,{tooltip:r})]}),(0,S.jsx)(V,{children:t})]}),(0,S.jsxs)(R,{children:[(0,S.jsx)(g.t,{id:u,name:p,value:f.value===null?``:f.value,"aria-invalid":w,autoCapitalize:`none`,autoComplete:`off`,placeholder:n,className:(0,b.cn)(_&&`pointer-events-none bg-muted-muted opacity-60`),onChange:A,onBlur:m}),_&&(0,S.jsx)(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-muted-weak`,children:(0,S.jsx)(v.Loader2Icon,{size:14,className:`animate-spin text-primary-strong`})}),f.meta.isDirty&&s&&!!D.length&&(0,S.jsx)(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-danger-strong`,children:(0,S.jsx)(v.BanIcon,{size:14})}),(0,S.jsxs)(`div`,{className:`my-1 flex w-full items-start justify-between gap-x-2`,children:[f.meta.isDirty&&s?(0,S.jsx)(G,{className:`flex-1`,errors:f.meta.errors}):(0,S.jsx)(`div`,{}),!!a&&(0,S.jsx)(`p`,{className:(0,b.cn)(`h-4 flex-0 text-nowrap text-end text-xs tabular-nums transition-colors`,k?`font-medium text-danger-strong`:O?`text-warning-strong`:`text-text-positive-weak`),children:C})]}),(0,S.jsx)(H,{isShow:!!i,children:i})]})]}),(0,S.jsx)(W,{})]})});q.displayName=`TextareaField`;const J=(0,y.memo)(({label:e,description:t,placeholder:n,tooltip:r,helperText:i,showErrorMessage:a=!0,required:o=!1})=>{let{form:s,state:c,handleChange:l}=Q(),u=(0,E.useStore)(s.store,({isSubmitting:e})=>e),d=c.meta.isDirty&&c.meta.isTouched&&!c.meta.isValid,f=o&&c.value===null,p=(0,y.useCallback)(e=>{u||l(e||null)},[u,l]);return(0,S.jsxs)(F,{className:`gap-y-4 px-4`,children:[(0,S.jsxs)(I,{orientation:`vertical`,"data-invalid":d,children:[(0,S.jsxs)(L,{children:[(0,S.jsxs)(z,{"aria-required":f,children:[e,r&&(0,S.jsx)(U,{tooltip:r})]}),(0,S.jsx)(V,{children:t})]}),(0,S.jsx)(_.t,{value:c.value??``,placeholder:n,readOnly:u,onChange:p}),c.meta.isDirty&&a&&!!c.meta.errors.length&&(0,S.jsx)(G,{errors:c.meta.errors}),(0,S.jsx)(H,{isShow:!!i,children:i})]}),(0,S.jsx)(W,{})]})});J.displayName=`TextEditorField`;const Te=({label:e,className:n})=>{let r=$(),i=(0,y.useCallback)(async()=>{await r.handleSubmit({submitAction:`submit`}),r.state.isSubmitSuccessful&&r.reset()},[r]);return(0,S.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,S.jsx)(t.t,{type:`button`,size:`md`,disabled:r,isLoading:a,className:(0,b.cn)(`min-h-8 min-w-32`,n),onClick:i,children:e??`Submit`})})},Ee=({type:e=`create`})=>{let n=$();return(0,S.jsxs)(`div`,{className:`flex h-8 items-center justify-between`,children:[(0,S.jsx)(n.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:e})=>(0,S.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,S.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,S.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,S.jsx)(v.PlusIcon,{}),`Add New`]})}),e===`update`&&(0,S.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,S.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,S.jsx)(v.ArrowDownToLine,{}),`Update`]})})]})};function Y({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,S.jsx)(w.Separator.Root,{"data-slot":`separator`,decorative:n,orientation:t,className:(0,b.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 De=({title:e,description:n,onDelete:r,children:i})=>(0,S.jsxs)(`section`,{"data-slot":`card-form`,className:`relative flex flex-col rounded-md bg-card pb-4 shadow-card ring-1 ring-border`,children:[(0,S.jsxs)(`div`,{"data-slot":`card-form-header`,className:`flex flex-col space-y-0.5 px-4 py-3`,children:[(0,S.jsx)(`p`,{className:`font-semibold text-base tracking-tight`,children:e}),!!n&&(0,S.jsx)(`p`,{className:`text-text-positive-weak text-sm`,children:n})]}),(0,S.jsx)(Y,{}),(0,S.jsx)(`div`,{"data-slot":`card-form-main`,className:`flex flex-col py-4`,children:i}),!!r&&(0,S.jsxs)(t.t,{color:`danger`,variant:`ghost`,size:`sm`,className:`absolute top-2.5 right-3`,onClick:e=>{r?.(),e.preventDefault(),e.stopPropagation()},children:[(0,S.jsx)(v.Trash2Icon,{}),`Remove`]})]}),Oe=({children:e})=>(0,S.jsx)(`div`,{"data-slot":`section-form`,className:`flex flex-col space-y-4`,children:e}),X=({disabled:e,className:n,onClick:r,children:i})=>(0,S.jsx)(t.t,{type:`button`,variant:`outline`,color:`muted`,disabled:e,className:(0,b.cn)(`min-w-40`,n),onClick:r,children:i??`Cancel`}),Z=({isSubmitting:e,submitText:n=`Submit`,disabled:r,className:i,onClick:a})=>(0,S.jsx)(t.t,{type:`button`,isLoading:e,disabled:r||e,className:(0,b.cn)(`min-w-40`,i),onClick:a,children:n}),ke=({title:e,submitText:t,width:n,maxWidth:i,className:o,open:s,onOpenChange:c,children:l})=>{let u=$(),d=(0,y.useCallback)(e=>{e||u.reset(),c?.(e)},[u.reset,c]);return(0,S.jsx)(a.t,{open:s,onOpenChange:d,children:(0,S.jsxs)(a.c,{"data-slot":`dialog-portal`,children:[(0,S.jsx)(a.s,{}),(0,S.jsxs)(a.r,{style:{"--width":n,"--max-width":i},className:(0,b.cn)(`flex rounded-none 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-5xl sm:rounded-md`,n&&`sm:w-(--width)`,i&&`sm:max-w-(--max-width)`,o),children:[(0,S.jsx)(`div`,{"data-slot":`dialog-header`,className:`flex items-center justify-center gap-2 px-6 py-5 text-center sm:text-left`,children:(0,S.jsx)(a.l,{"data-slot":`dialog-title`,className:`text-lg font-semibold tracking-tight`,children:e})}),(0,S.jsx)(r.t,{}),(0,S.jsx)(`div`,{"data-slot":`dialog-content`,className:`relative flex flex-col overflow-y-auto p-0 pt-4 max-sm:flex-1 sm:p-4`,children:l}),(0,S.jsx)(r.t,{}),(0,S.jsxs)(`div`,{"data-slot":`dialog-footer`,className:`flex flex-col-reverse items-center justify-end gap-2 px-6 py-4 sm:flex-row max-sm:[&>button]:w-full`,children:[(0,S.jsx)(u.Subscribe,{selector:e=>({disabled:e.isSubmitting}),children:({disabled:e})=>(0,S.jsx)(X,{disabled:e,onClick:()=>{u.reset(),d(!1)}})}),(0,S.jsx)(u.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:n})=>(0,S.jsx)(Z,{isSubmitting:e,disabled:n,submitText:t,onClick:()=>u.handleSubmit()})})]})]})]})})},Ae=({label:e,description:t,helperText:n,orientation:r=`responsive`,children:i})=>(0,S.jsxs)(F,{className:`gap-y-4 px-4`,children:[(0,S.jsxs)(I,{orientation:r,children:[(0,S.jsxs)(L,{children:[(0,S.jsx)(z,{children:e}),(0,S.jsx)(V,{children:t})]}),(0,S.jsxs)(R,{children:[i,(0,S.jsx)(H,{isShow:!!n,children:n})]})]}),(0,S.jsx)(W,{})]}),je=({title:e,open:t,contentClassName:n,onOpenChange:r,children:a})=>{let o=$();return(0,S.jsx)(w.Dialog.Root,{"data-slot":`dialog`,open:t,onOpenChange:r,children:(0,S.jsxs)(w.Dialog.Portal,{"data-slot":`dialog-portal`,children:[(0,S.jsx)(w.Dialog.Overlay,{"data-slot":`dialog-overlay`,className:(0,b.cn)(`fixed inset-0 z-40 bg-black/40 backdrop-blur-sm`,`data-[state=open]:animate-in data-[state=open]:fade-in`,`data-[state=closed]:animate-out data-[state=closed]:fade-out`)}),(0,S.jsx)(w.Dialog.Content,{"data-slot":`dialog-content`,className:(0,b.cn)(`fixed top-4 right-4 z-50 h-[calc(100dvh-2rem)] min-w-sm max-w-xl rounded-md bg-background shadow-lg ring-1 ring-border`,`duration-300`,`data-[state=open]:animate-in data-[state=open]:slide-in-from-right data-[state=open]:fade-in`,`data-[state=closed]:animate-out data-[state=closed]:slide-out-to-right data-[state=closed]:fade-out`),children:(0,S.jsxs)(`section`,{className:`relative flex size-full flex-col`,children:[(0,S.jsx)(`header`,{className:`flex h-14 shrink-0 items-center border-b border-border px-5`,children:(0,S.jsx)(`h2`,{className:`font-semibold text-base tracking-tight text-text-positive`,children:e})}),(0,S.jsx)(`div`,{className:(0,b.cn)(`flex flex-1 flex-col overflow-y-auto py-4`,n),children:a}),(0,S.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 border-t border-border px-4 py-3`,children:[(0,S.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,S.jsx)(Z,{isSubmitting:e,disabled:t,className:`w-full`,onClick:()=>o.handleSubmit()})}),(0,S.jsx)(o.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:e})=>(0,S.jsx)(X,{disabled:e,className:`w-full`,onClick:()=>{o.reset(),r?.(!1)}})})]}),(0,S.jsx)(w.Dialog.Close,{asChild:!0,children:(0,S.jsx)(i.t,{className:`absolute top-2.5 right-3`})})]})})]})})},Me=({children:e})=>(0,S.jsx)(`header`,{"data-slot":`section-header`,className:`flex items-center px-4 py-3 font-semibold text-base text-text-positive tracking-tight`,children:e}),Ne=({children:e})=>(0,S.jsx)(`main`,{"data-slot":`section-main`,className:`relative flex flex-col py-4`,children:e}),Pe=({title:e,children:t})=>(0,S.jsxs)(`section`,{"data-slot":`section-form`,className:`flex flex-col rounded-md bg-background shadow-card ring-1 ring-border`,children:[(0,S.jsx)(Me,{children:e}),(0,S.jsx)(Y,{}),(0,S.jsx)(Ne,{children:t})]}),Fe=({title:e,description:t,helperText:n})=>(0,S.jsxs)(F,{className:`gap-y-4 px-4`,children:[(0,S.jsxs)(I,{className:`gap-0`,children:[(0,S.jsxs)(L,{children:[(0,S.jsx)(P,{className:`mb-1`,children:e}),(0,S.jsx)(V,{children:t})]}),(0,S.jsx)(H,{isShow:!!n,children:n})]}),(0,S.jsx)(W,{})]}),{fieldContext:Ie,formContext:Le,useFieldContext:Q,useFormContext:$}=(0,E.createFormHookContexts)(),{useAppForm:Re,withForm:ze,withFieldGroup:Be}=(0,E.createFormHook)({fieldContext:Ie,formContext:Le,fieldComponents:{TextField:we,TextareaField:q,TextEditorField:J,NumberField:ve,EmailField:_e,PasswordField:ye,SelectField:xe,ComboboxField:he,DateField:ge,SwitchField:Ce,RadioGroupField:be,CheckboxField:me,SimpleTextField:pe,SimpleEmailField:ae,SimplePasswordField:ue,SimpleTextareaField:fe,SimpleNumberField:le,SimpleSelectField:de,SimpleArrayField:k,SimpleBooleanField:te,SimpleComboboxField:ne,SimpleDateField:re,SimpleRadioGroupField:ie,FieldGroup:F,Field:I,FieldContent:L,FieldLabel:z,FieldContentMain:R,FieldSeparator:W,FieldError:G},formComponents:{TanStackDialogForm:ke,TanStackPopoverForm:je,TanStackContainerForm:Oe,TanStackSectionForm:Pe,TanStackCardForm:De,TanStackFieldGroup:Ae,TanStackTitleField:Fe,TanStackActionsForm:Ee,TanStackActionSubmit:Te,ArrayCol:D,ArrayHeaderRow:O}});Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return F}});
|
|
2
|
-
//# sourceMappingURL=tanstack-form-BgRAJ1Zn.cjs.map
|