@customafk/lunas-ui 0.2.64 → 0.2.65
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/action-submit-3kZ7JOop.cjs +2 -0
- package/dist/action-submit-3kZ7JOop.cjs.map +1 -0
- package/dist/action-submit-Dg5GvYz5.mjs +2 -0
- package/dist/action-submit-Dg5GvYz5.mjs.map +1 -0
- package/dist/actions-form-BL_B81Vg.mjs +2 -0
- package/dist/actions-form-BL_B81Vg.mjs.map +1 -0
- package/dist/actions-form-CE_enCgE.cjs +2 -0
- package/dist/actions-form-CE_enCgE.cjs.map +1 -0
- package/dist/card-form-BR5kDTzB.cjs +2 -0
- package/dist/card-form-BR5kDTzB.cjs.map +1 -0
- package/dist/card-form-D9fNO-6F.mjs +2 -0
- package/dist/card-form-D9fNO-6F.mjs.map +1 -0
- package/dist/checkbox-field-CRcfuDu1.mjs +2 -0
- package/dist/checkbox-field-CRcfuDu1.mjs.map +1 -0
- package/dist/checkbox-field-DdeohRmi.cjs +2 -0
- package/dist/checkbox-field-DdeohRmi.cjs.map +1 -0
- package/dist/combobox-field-BGChwajc.mjs +2 -0
- package/dist/combobox-field-BGChwajc.mjs.map +1 -0
- package/dist/combobox-field-D9NdSih1.cjs +2 -0
- package/dist/combobox-field-D9NdSih1.cjs.map +1 -0
- package/dist/container-form-BdsEX0NH.mjs +2 -0
- package/dist/container-form-BdsEX0NH.mjs.map +1 -0
- package/dist/container-form-CxxUYctk.cjs +2 -0
- package/dist/container-form-CxxUYctk.cjs.map +1 -0
- package/dist/date-field-BqAX4M_h.cjs +2 -0
- package/dist/date-field-BqAX4M_h.cjs.map +1 -0
- package/dist/date-field-Dm4ki1HS.mjs +2 -0
- package/dist/date-field-Dm4ki1HS.mjs.map +1 -0
- package/dist/dialog-form-ClWBZbUN.mjs +2 -0
- package/dist/dialog-form-ClWBZbUN.mjs.map +1 -0
- package/dist/dialog-form-DN-NlQFO.cjs +2 -0
- package/dist/dialog-form-DN-NlQFO.cjs.map +1 -0
- package/dist/dialogs/confirm-dialog.cjs +1 -1
- package/dist/dialogs/confirm-dialog.cjs.map +1 -1
- package/dist/dialogs/confirm-dialog.mjs +1 -1
- package/dist/dialogs/confirm-dialog.mjs.map +1 -1
- package/dist/email-field-DZNR_JbT.mjs +2 -0
- package/dist/email-field-DZNR_JbT.mjs.map +1 -0
- package/dist/email-field-lDd9ouFN.cjs +2 -0
- package/dist/email-field-lDd9ouFN.cjs.map +1 -0
- package/dist/features/tables/index.d.cts +1 -1
- package/dist/features/tables/index.d.mts +1 -1
- 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/field-BKyUqvzh.mjs +2 -0
- package/dist/field-BKyUqvzh.mjs.map +1 -0
- package/dist/field-BV5twmKA.cjs +2 -0
- package/dist/field-BV5twmKA.cjs.map +1 -0
- package/dist/group-field-0kStiX8n.cjs +2 -0
- package/dist/group-field-0kStiX8n.cjs.map +1 -0
- package/dist/group-field-bviEXmo4.mjs +2 -0
- package/dist/group-field-bviEXmo4.mjs.map +1 -0
- package/dist/{index-CGpGIM1H.d.cts → index-C4isgHWG.d.cts} +2 -2
- package/dist/{index-DueBB0rP.d.mts → index-C8W56XKm.d.mts} +2 -2
- package/dist/{index-C2KjuFXQ.d.cts → index-DDROD2y9.d.cts} +596 -1117
- package/dist/{index-C2KjuFXQ.d.mts → index-DDROD2y9.d.mts} +596 -1117
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +1 -1
- package/dist/{input-BJMvABEL.d.cts → input-go3H4EQz.d.cts} +2 -2
- package/dist/{input-BJMvABEL.d.mts → input-go3H4EQz.d.mts} +2 -2
- package/dist/number-field-Baj9Yhiv.mjs +2 -0
- package/dist/number-field-Baj9Yhiv.mjs.map +1 -0
- package/dist/number-field-BqeSbMvE.cjs +2 -0
- package/dist/number-field-BqeSbMvE.cjs.map +1 -0
- package/dist/number-input-CqkegUWs.mjs +2 -0
- package/dist/number-input-CqkegUWs.mjs.map +1 -0
- package/dist/number-input-kTh9zzr7.cjs +2 -0
- package/dist/number-input-kTh9zzr7.cjs.map +1 -0
- package/dist/password-field-Cq0S949S.cjs +2 -0
- package/dist/password-field-Cq0S949S.cjs.map +1 -0
- package/dist/password-field-fzpU42sV.mjs +2 -0
- package/dist/password-field-fzpU42sV.mjs.map +1 -0
- package/dist/popover-form-DNbBGWVF.mjs +2 -0
- package/dist/popover-form-DNbBGWVF.mjs.map +1 -0
- package/dist/popover-form-KLmew1Vd.cjs +2 -0
- package/dist/popover-form-KLmew1Vd.cjs.map +1 -0
- package/dist/radio-group-field-DjzD3i-f.cjs +2 -0
- package/dist/radio-group-field-DjzD3i-f.cjs.map +1 -0
- package/dist/radio-group-field-Ps8yHpnH.mjs +2 -0
- package/dist/radio-group-field-Ps8yHpnH.mjs.map +1 -0
- package/dist/section-form-B9iTs2we.cjs +2 -0
- package/dist/section-form-B9iTs2we.cjs.map +1 -0
- package/dist/section-form-B_AZr7jZ.mjs +2 -0
- package/dist/section-form-B_AZr7jZ.mjs.map +1 -0
- package/dist/select-field-B4eU65OI.cjs +2 -0
- package/dist/select-field-B4eU65OI.cjs.map +1 -0
- package/dist/select-field-D6Dw-Jwg.mjs +2 -0
- package/dist/select-field-D6Dw-Jwg.mjs.map +1 -0
- package/dist/separator-BlNAFSJv.mjs +2 -0
- package/dist/separator-BlNAFSJv.mjs.map +1 -0
- package/dist/separator-sBz__BXC.cjs +2 -0
- package/dist/separator-sBz__BXC.cjs.map +1 -0
- package/dist/simple-array-field-9oZ-Smzp.mjs +2 -0
- package/dist/simple-array-field-9oZ-Smzp.mjs.map +1 -0
- package/dist/simple-array-field-Bcs2pHdp.cjs +2 -0
- package/dist/simple-array-field-Bcs2pHdp.cjs.map +1 -0
- package/dist/simple-boolean-field-C-qq6Vlt.cjs +2 -0
- package/dist/simple-boolean-field-C-qq6Vlt.cjs.map +1 -0
- package/dist/simple-boolean-field-CkJUMxNU.mjs +2 -0
- package/dist/simple-boolean-field-CkJUMxNU.mjs.map +1 -0
- package/dist/simple-combobox-field-5dfMd49B.mjs +2 -0
- package/dist/simple-combobox-field-5dfMd49B.mjs.map +1 -0
- package/dist/simple-combobox-field-BtmQGEo5.cjs +2 -0
- package/dist/simple-combobox-field-BtmQGEo5.cjs.map +1 -0
- package/dist/simple-date-field-BXoLb496.mjs +2 -0
- package/dist/simple-date-field-BXoLb496.mjs.map +1 -0
- package/dist/simple-date-field-LVfNhVJi.cjs +2 -0
- package/dist/simple-date-field-LVfNhVJi.cjs.map +1 -0
- package/dist/simple-email-field-QVUrm8f7.cjs +2 -0
- package/dist/simple-email-field-QVUrm8f7.cjs.map +1 -0
- package/dist/simple-email-field-rZZIXu7S.mjs +2 -0
- package/dist/simple-email-field-rZZIXu7S.mjs.map +1 -0
- package/dist/simple-number-field-P9PTwcs4.cjs +2 -0
- package/dist/simple-number-field-P9PTwcs4.cjs.map +1 -0
- package/dist/simple-number-field-PJAyAOMO.mjs +2 -0
- package/dist/simple-number-field-PJAyAOMO.mjs.map +1 -0
- package/dist/simple-password-field-BEuFXAsk.mjs +2 -0
- package/dist/simple-password-field-BEuFXAsk.mjs.map +1 -0
- package/dist/simple-password-field-BW6YkfSP.cjs +2 -0
- package/dist/simple-password-field-BW6YkfSP.cjs.map +1 -0
- package/dist/simple-radio-group-field-BtQHJpOz.cjs +2 -0
- package/dist/simple-radio-group-field-BtQHJpOz.cjs.map +1 -0
- package/dist/simple-radio-group-field-DiYQfgts.mjs +2 -0
- package/dist/simple-radio-group-field-DiYQfgts.mjs.map +1 -0
- package/dist/simple-select-field--zJMLBUY.cjs +2 -0
- package/dist/simple-select-field--zJMLBUY.cjs.map +1 -0
- package/dist/simple-select-field-Df4DLsbi.mjs +2 -0
- package/dist/simple-select-field-Df4DLsbi.mjs.map +1 -0
- package/dist/simple-text-field-DVkuHrhF.cjs +2 -0
- package/dist/simple-text-field-DVkuHrhF.cjs.map +1 -0
- package/dist/simple-text-field-zAfkmlhc.mjs +2 -0
- package/dist/simple-text-field-zAfkmlhc.mjs.map +1 -0
- package/dist/simple-textarea-field-BaMK0feA.cjs +2 -0
- package/dist/simple-textarea-field-BaMK0feA.cjs.map +1 -0
- package/dist/simple-textarea-field-q9DeFByl.mjs +2 -0
- package/dist/simple-textarea-field-q9DeFByl.mjs.map +1 -0
- package/dist/submit-button-CGBaPzE9.mjs +2 -0
- package/dist/submit-button-CGBaPzE9.mjs.map +1 -0
- package/dist/submit-button-CvINfld5.cjs +2 -0
- package/dist/submit-button-CvINfld5.cjs.map +1 -0
- package/dist/switch-field-B8HVvc2f.mjs +2 -0
- package/dist/switch-field-B8HVvc2f.mjs.map +1 -0
- package/dist/switch-field-C1uNuuku.cjs +2 -0
- package/dist/switch-field-C1uNuuku.cjs.map +1 -0
- package/dist/tanstack-form-CM_Hb3JT.mjs +2 -0
- package/dist/tanstack-form-CM_Hb3JT.mjs.map +1 -0
- package/dist/tanstack-form-DS_ZvRl8.cjs +2 -0
- package/dist/tanstack-form-DS_ZvRl8.cjs.map +1 -0
- package/dist/text-editor-field-BBDgCPuc.cjs +2 -0
- package/dist/text-editor-field-BBDgCPuc.cjs.map +1 -0
- package/dist/text-editor-field-CcsR48Jw.mjs +2 -0
- package/dist/text-editor-field-CcsR48Jw.mjs.map +1 -0
- package/dist/text-field-BhC_ik5w.cjs +2 -0
- package/dist/text-field-BhC_ik5w.cjs.map +1 -0
- package/dist/text-field-qhiYvQKt.mjs +2 -0
- package/dist/text-field-qhiYvQKt.mjs.map +1 -0
- package/dist/textarea-field-C-7ZoUMz.cjs +2 -0
- package/dist/textarea-field-C-7ZoUMz.cjs.map +1 -0
- package/dist/textarea-field-DqDciVSB.mjs +2 -0
- package/dist/textarea-field-DqDciVSB.mjs.map +1 -0
- package/dist/title-field-84EnHPvl.mjs +2 -0
- package/dist/title-field-84EnHPvl.mjs.map +1 -0
- package/dist/title-field-CKxwzMOM.cjs +2 -0
- package/dist/title-field-CKxwzMOM.cjs.map +1 -0
- package/dist/ui/badge.cjs +1 -1
- package/dist/ui/badge.cjs.map +1 -1
- package/dist/ui/badge.mjs +1 -1
- package/dist/ui/badge.mjs.map +1 -1
- package/dist/ui/input.d.cts +1 -1
- package/dist/ui/input.d.mts +1 -1
- package/dist/ui/inputs/search-input.d.cts +1 -1
- package/dist/ui/inputs/search-input.d.mts +1 -1
- package/package.json +1 -5
- package/dist/tanstack-form-BMVn8ai_.cjs +0 -2
- package/dist/tanstack-form-BMVn8ai_.cjs.map +0 -1
- package/dist/tanstack-form-DTCgWGCA.mjs +0 -2
- package/dist/tanstack-form-DTCgWGCA.mjs.map +0 -1
package/dist/ui/badge.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@customafk/react-toolkit/utils"),t=require("class-variance-authority"),n=require("react/jsx-runtime");const r=(0,t.cva)(`inline-flex items-center justify-center font-medium transition-colors duration-150 focus:ring-2 focus:ring-offset-2 focus:outline-hidden focus:ring-ring forced-colors:outline`,{variants:{variant:{solid:`shadow-btn`,soft:``,outline:`bg-transparent border`},color:{primary:``,secondary:``,muted:``,accent:``,info:``,success:``,warning:``,danger:``},size:{xs:`text-[10px]/3 px-1.5 py-0.5 gap-1`,sm:`text-xs px-2 py-0.5 gap-1`,md:`text-sm px-2.5 py-0.5 gap-1.5`,lg:`text-base px-3 py-1 gap-1.5`,xl:`text-lg px-3.5 py-1 gap-1.5`},pill:{true:`rounded-full`,false:`rounded-sm`}},defaultVariants:{variant:`solid`,color:`primary`,size:`md`,pill:!0},compoundVariants:[{variant:`solid`,color:`primary`,className:`bg-primary text-primary-foreground`},{variant:`solid`,color:`secondary`,className:`bg-secondary text-secondary-foreground`},{variant:`solid`,color:`muted`,className:`bg-muted text-text-negative`},{variant:`solid`,color:`accent`,className:`bg-accent text-text-negative`},{variant:`solid`,color:`info`,className:`bg-info text-info-foreground`},{variant:`solid`,color:`success`,className:`bg-success text-success-foreground`},{variant:`solid`,color:`warning`,className:`bg-warning text-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@customafk/react-toolkit/utils"),t=require("class-variance-authority"),n=require("react/jsx-runtime");const r=(0,t.cva)(`inline-flex items-center justify-center font-medium transition-colors duration-150 focus:ring-2 focus:ring-offset-2 focus:outline-hidden focus:ring-ring forced-colors:outline`,{variants:{variant:{solid:`shadow-btn`,soft:``,outline:`bg-transparent border`},color:{primary:``,secondary:``,muted:``,accent:``,info:``,success:``,warning:``,danger:``},size:{xs:`text-[10px]/3 px-1.5 py-0.5 gap-1`,sm:`text-xs px-2 py-0.5 gap-1`,md:`text-sm px-2.5 py-0.5 gap-1.5`,lg:`text-base px-3 py-1 gap-1.5`,xl:`text-lg px-3.5 py-1 gap-1.5`},pill:{true:`rounded-full`,false:`rounded-sm`}},defaultVariants:{variant:`solid`,color:`primary`,size:`md`,pill:!0},compoundVariants:[{variant:`solid`,color:`primary`,className:`bg-primary text-primary-foreground`},{variant:`solid`,color:`secondary`,className:`bg-secondary text-secondary-foreground`},{variant:`solid`,color:`muted`,className:`bg-muted text-text-negative`},{variant:`solid`,color:`accent`,className:`bg-accent text-text-negative`},{variant:`solid`,color:`info`,className:`bg-info text-info-foreground`},{variant:`solid`,color:`success`,className:`bg-success text-success-foreground`},{variant:`solid`,color:`warning`,className:`bg-warning text-text-negative`},{variant:`solid`,color:`danger`,className:`bg-danger text-danger-foreground`},{variant:`soft`,color:`primary`,className:`bg-primary-bg-subtle text-primary-intense`},{variant:`soft`,color:`secondary`,className:`bg-secondary-bg-subtle text-secondary-intense`},{variant:`soft`,color:`muted`,className:`bg-muted-bg-subtle text-muted-intense`},{variant:`soft`,color:`accent`,className:`bg-accent-bg-subtle text-accent-intense`},{variant:`soft`,color:`info`,className:`bg-info-bg-subtle text-info-intense`},{variant:`soft`,color:`success`,className:`bg-success-bg-subtle text-success-intense`},{variant:`soft`,color:`warning`,className:`bg-warning-bg-subtle text-warning-intense`},{variant:`soft`,color:`danger`,className:`bg-danger-bg-subtle text-danger-intense`},{variant:`outline`,color:`primary`,className:`border-primary text-primary`},{variant:`outline`,color:`secondary`,className:`border-secondary text-secondary`},{variant:`outline`,color:`muted`,className:`border-muted text-muted`},{variant:`outline`,color:`accent`,className:`border-accent text-accent`},{variant:`outline`,color:`info`,className:`border-info text-info`},{variant:`outline`,color:`success`,className:`border-success text-success`},{variant:`outline`,color:`warning`,className:`border-warning text-warning`},{variant:`outline`,color:`danger`,className:`border-danger text-danger`}]});function i({className:t,variant:i,color:a,size:o,pill:s,...c}){return(0,n.jsx)(`span`,{className:(0,e.cn)(r({variant:i,color:a,pill:s,size:o}),t),...c})}exports.Badge=i,exports.badgeVariants=r;
|
|
2
2
|
//# sourceMappingURL=badge.cjs.map
|
package/dist/ui/badge.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.cjs","names":[],"sources":["../../packages/components/ui/badge.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nconst badgeVariants = cva(\n 'inline-flex items-center justify-center font-medium transition-colors duration-150 focus:ring-2 focus:ring-offset-2 focus:outline-hidden focus:ring-ring forced-colors:outline',\n {\n variants: {\n variant: {\n solid: 'shadow-btn',\n soft: '',\n outline: 'bg-transparent border',\n },\n color: {\n primary: '',\n secondary: '',\n muted: '',\n accent: '',\n info: '',\n success: '',\n warning: '',\n danger: '',\n },\n size: {\n xs: 'text-[10px]/3 px-1.5 py-0.5 gap-1',\n sm: 'text-xs px-2 py-0.5 gap-1',\n md: 'text-sm px-2.5 py-0.5 gap-1.5',\n lg: 'text-base px-3 py-1 gap-1.5',\n xl: 'text-lg px-3.5 py-1 gap-1.5',\n },\n pill: {\n true: 'rounded-full',\n false: 'rounded-sm',\n },\n },\n defaultVariants: {\n variant: 'solid',\n color: 'primary',\n size: 'md',\n pill: true,\n },\n compoundVariants: [\n // solid\n { variant: 'solid', color: 'primary', className: 'bg-primary text-primary-foreground' },\n { variant: 'solid', color: 'secondary', className: 'bg-secondary text-secondary-foreground' },\n { variant: 'solid', color: 'muted', className: 'bg-muted text-text-negative' },\n { variant: 'solid', color: 'accent', className: 'bg-accent text-text-negative' },\n { variant: 'solid', color: 'info', className: 'bg-info text-info-foreground' },\n { variant: 'solid', color: 'success', className: 'bg-success text-success-foreground' },\n { variant: 'solid', color: 'warning', className: 'bg-warning text-
|
|
1
|
+
{"version":3,"file":"badge.cjs","names":[],"sources":["../../packages/components/ui/badge.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nconst badgeVariants = cva(\n 'inline-flex items-center justify-center font-medium transition-colors duration-150 focus:ring-2 focus:ring-offset-2 focus:outline-hidden focus:ring-ring forced-colors:outline',\n {\n variants: {\n variant: {\n solid: 'shadow-btn',\n soft: '',\n outline: 'bg-transparent border',\n },\n color: {\n primary: '',\n secondary: '',\n muted: '',\n accent: '',\n info: '',\n success: '',\n warning: '',\n danger: '',\n },\n size: {\n xs: 'text-[10px]/3 px-1.5 py-0.5 gap-1',\n sm: 'text-xs px-2 py-0.5 gap-1',\n md: 'text-sm px-2.5 py-0.5 gap-1.5',\n lg: 'text-base px-3 py-1 gap-1.5',\n xl: 'text-lg px-3.5 py-1 gap-1.5',\n },\n pill: {\n true: 'rounded-full',\n false: 'rounded-sm',\n },\n },\n defaultVariants: {\n variant: 'solid',\n color: 'primary',\n size: 'md',\n pill: true,\n },\n compoundVariants: [\n // solid\n { variant: 'solid', color: 'primary', className: 'bg-primary text-primary-foreground' },\n { variant: 'solid', color: 'secondary', className: 'bg-secondary text-secondary-foreground' },\n { variant: 'solid', color: 'muted', className: 'bg-muted text-text-negative' },\n { variant: 'solid', color: 'accent', className: 'bg-accent text-text-negative' },\n { variant: 'solid', color: 'info', className: 'bg-info text-info-foreground' },\n { variant: 'solid', color: 'success', className: 'bg-success text-success-foreground' },\n { variant: 'solid', color: 'warning', className: 'bg-warning text-text-negative' },\n { variant: 'solid', color: 'danger', className: 'bg-danger text-danger-foreground' },\n // soft\n { variant: 'soft', color: 'primary', className: 'bg-primary-bg-subtle text-primary-intense' },\n { variant: 'soft', color: 'secondary', className: 'bg-secondary-bg-subtle text-secondary-intense' },\n { variant: 'soft', color: 'muted', className: 'bg-muted-bg-subtle text-muted-intense' },\n { variant: 'soft', color: 'accent', className: 'bg-accent-bg-subtle text-accent-intense' },\n { variant: 'soft', color: 'info', className: 'bg-info-bg-subtle text-info-intense' },\n { variant: 'soft', color: 'success', className: 'bg-success-bg-subtle text-success-intense' },\n { variant: 'soft', color: 'warning', className: 'bg-warning-bg-subtle text-warning-intense' },\n { variant: 'soft', color: 'danger', className: 'bg-danger-bg-subtle text-danger-intense' },\n // outline\n { variant: 'outline', color: 'primary', className: 'border-primary text-primary' },\n { variant: 'outline', color: 'secondary', className: 'border-secondary text-secondary' },\n { variant: 'outline', color: 'muted', className: 'border-muted text-muted' },\n { variant: 'outline', color: 'accent', className: 'border-accent text-accent' },\n { variant: 'outline', color: 'info', className: 'border-info text-info' },\n { variant: 'outline', color: 'success', className: 'border-success text-success' },\n { variant: 'outline', color: 'warning', className: 'border-warning text-warning' },\n { variant: 'outline', color: 'danger', className: 'border-danger text-danger' },\n ],\n }\n);\n\n/**\n * Props for the `Badge` component.\n *\n * @property variant - Visual fill style — `'solid'` (filled, default), `'soft'` (tinted background), or `'outline'` (border only).\n * @property color - Semantic color token — `'primary'` | `'secondary'` | `'muted'` | `'accent'` | `'info'` | `'success'` | `'warning'` | `'danger'`. Defaults to `'primary'`.\n * @property size - Badge size — `'xs'` | `'sm'` | `'md'` (default) | `'lg'` | `'xl'`.\n * @property pill - When `true` (default), renders with fully rounded corners (`rounded-full`); when `false`, uses `rounded-sm`.\n */\nexport type BadgeProps = VariantProps<typeof badgeVariants> & React.ComponentPropsWithoutRef<'span'>;\n\n/**\n * Inline status label rendered as a `<span>` with CVA-driven variant, color, size, and shape options.\n *\n * @example\n * ```tsx\n * import { Badge } from '@customafk/lunas-ui/ui/badge';\n *\n * <Badge variant=\"soft\" color=\"success\" size=\"sm\">Active</Badge>\n * <Badge variant=\"outline\" color=\"danger\">Overdue</Badge>\n * ```\n */\nfunction Badge({ className, variant, color, size, pill, ...props }: BadgeProps) {\n return <span className={cn(badgeVariants({ variant, color, pill, size }), className)} {...props} />;\n}\n\n// eslint-disable-next-line react-refresh/only-export-components\nexport { Badge, badgeVariants };\n"],"mappings":"qMAMA,MAAM,GAAA,EAAA,EAAA,IAAA,CACJ,iLACA,CACE,SAAU,CACR,QAAS,CACP,MAAO,aACP,KAAM,GACN,QAAS,uBACX,EACA,MAAO,CACL,QAAS,GACT,UAAW,GACX,MAAO,GACP,OAAQ,GACR,KAAM,GACN,QAAS,GACT,QAAS,GACT,OAAQ,EACV,EACA,KAAM,CACJ,GAAI,oCACJ,GAAI,4BACJ,GAAI,gCACJ,GAAI,8BACJ,GAAI,6BACN,EACA,KAAM,CACJ,KAAM,eACN,MAAO,YACT,CACF,EACA,gBAAiB,CACf,QAAS,QACT,MAAO,UACP,KAAM,KACN,KAAM,EACR,EACA,iBAAkB,CAEhB,CAAE,QAAS,QAAS,MAAO,UAAW,UAAW,oCAAqC,EACtF,CAAE,QAAS,QAAS,MAAO,YAAa,UAAW,wCAAyC,EAC5F,CAAE,QAAS,QAAS,MAAO,QAAS,UAAW,6BAA8B,EAC7E,CAAE,QAAS,QAAS,MAAO,SAAU,UAAW,8BAA+B,EAC/E,CAAE,QAAS,QAAS,MAAO,OAAQ,UAAW,8BAA+B,EAC7E,CAAE,QAAS,QAAS,MAAO,UAAW,UAAW,oCAAqC,EACtF,CAAE,QAAS,QAAS,MAAO,UAAW,UAAW,+BAAgC,EACjF,CAAE,QAAS,QAAS,MAAO,SAAU,UAAW,kCAAmC,EAEnF,CAAE,QAAS,OAAQ,MAAO,UAAW,UAAW,2CAA4C,EAC5F,CAAE,QAAS,OAAQ,MAAO,YAAa,UAAW,+CAAgD,EAClG,CAAE,QAAS,OAAQ,MAAO,QAAS,UAAW,uCAAwC,EACtF,CAAE,QAAS,OAAQ,MAAO,SAAU,UAAW,yCAA0C,EACzF,CAAE,QAAS,OAAQ,MAAO,OAAQ,UAAW,qCAAsC,EACnF,CAAE,QAAS,OAAQ,MAAO,UAAW,UAAW,2CAA4C,EAC5F,CAAE,QAAS,OAAQ,MAAO,UAAW,UAAW,2CAA4C,EAC5F,CAAE,QAAS,OAAQ,MAAO,SAAU,UAAW,yCAA0C,EAEzF,CAAE,QAAS,UAAW,MAAO,UAAW,UAAW,6BAA8B,EACjF,CAAE,QAAS,UAAW,MAAO,YAAa,UAAW,iCAAkC,EACvF,CAAE,QAAS,UAAW,MAAO,QAAS,UAAW,yBAA0B,EAC3E,CAAE,QAAS,UAAW,MAAO,SAAU,UAAW,2BAA4B,EAC9E,CAAE,QAAS,UAAW,MAAO,OAAQ,UAAW,uBAAwB,EACxE,CAAE,QAAS,UAAW,MAAO,UAAW,UAAW,6BAA8B,EACjF,CAAE,QAAS,UAAW,MAAO,UAAW,UAAW,6BAA8B,EACjF,CAAE,QAAS,UAAW,MAAO,SAAU,UAAW,2BAA4B,CAChF,CACF,CACF,EAuBA,SAAS,EAAM,CAAE,YAAW,UAAS,QAAO,OAAM,OAAM,GAAG,GAAqB,CAC9E,OAAO,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,WAAA,EAAA,EAAA,GAAA,CAAc,EAAc,CAAE,UAAS,QAAO,OAAM,MAAK,CAAC,EAAG,CAAS,EAAG,GAAI,CAAQ,CAAA,CACpG"}
|
package/dist/ui/badge.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{cn as e}from"@customafk/react-toolkit/utils";import{cva as t}from"class-variance-authority";import{jsx as n}from"react/jsx-runtime";const r=t(`inline-flex items-center justify-center font-medium transition-colors duration-150 focus:ring-2 focus:ring-offset-2 focus:outline-hidden focus:ring-ring forced-colors:outline`,{variants:{variant:{solid:`shadow-btn`,soft:``,outline:`bg-transparent border`},color:{primary:``,secondary:``,muted:``,accent:``,info:``,success:``,warning:``,danger:``},size:{xs:`text-[10px]/3 px-1.5 py-0.5 gap-1`,sm:`text-xs px-2 py-0.5 gap-1`,md:`text-sm px-2.5 py-0.5 gap-1.5`,lg:`text-base px-3 py-1 gap-1.5`,xl:`text-lg px-3.5 py-1 gap-1.5`},pill:{true:`rounded-full`,false:`rounded-sm`}},defaultVariants:{variant:`solid`,color:`primary`,size:`md`,pill:!0},compoundVariants:[{variant:`solid`,color:`primary`,className:`bg-primary text-primary-foreground`},{variant:`solid`,color:`secondary`,className:`bg-secondary text-secondary-foreground`},{variant:`solid`,color:`muted`,className:`bg-muted text-text-negative`},{variant:`solid`,color:`accent`,className:`bg-accent text-text-negative`},{variant:`solid`,color:`info`,className:`bg-info text-info-foreground`},{variant:`solid`,color:`success`,className:`bg-success text-success-foreground`},{variant:`solid`,color:`warning`,className:`bg-warning text-
|
|
1
|
+
"use client";import{cn as e}from"@customafk/react-toolkit/utils";import{cva as t}from"class-variance-authority";import{jsx as n}from"react/jsx-runtime";const r=t(`inline-flex items-center justify-center font-medium transition-colors duration-150 focus:ring-2 focus:ring-offset-2 focus:outline-hidden focus:ring-ring forced-colors:outline`,{variants:{variant:{solid:`shadow-btn`,soft:``,outline:`bg-transparent border`},color:{primary:``,secondary:``,muted:``,accent:``,info:``,success:``,warning:``,danger:``},size:{xs:`text-[10px]/3 px-1.5 py-0.5 gap-1`,sm:`text-xs px-2 py-0.5 gap-1`,md:`text-sm px-2.5 py-0.5 gap-1.5`,lg:`text-base px-3 py-1 gap-1.5`,xl:`text-lg px-3.5 py-1 gap-1.5`},pill:{true:`rounded-full`,false:`rounded-sm`}},defaultVariants:{variant:`solid`,color:`primary`,size:`md`,pill:!0},compoundVariants:[{variant:`solid`,color:`primary`,className:`bg-primary text-primary-foreground`},{variant:`solid`,color:`secondary`,className:`bg-secondary text-secondary-foreground`},{variant:`solid`,color:`muted`,className:`bg-muted text-text-negative`},{variant:`solid`,color:`accent`,className:`bg-accent text-text-negative`},{variant:`solid`,color:`info`,className:`bg-info text-info-foreground`},{variant:`solid`,color:`success`,className:`bg-success text-success-foreground`},{variant:`solid`,color:`warning`,className:`bg-warning text-text-negative`},{variant:`solid`,color:`danger`,className:`bg-danger text-danger-foreground`},{variant:`soft`,color:`primary`,className:`bg-primary-bg-subtle text-primary-intense`},{variant:`soft`,color:`secondary`,className:`bg-secondary-bg-subtle text-secondary-intense`},{variant:`soft`,color:`muted`,className:`bg-muted-bg-subtle text-muted-intense`},{variant:`soft`,color:`accent`,className:`bg-accent-bg-subtle text-accent-intense`},{variant:`soft`,color:`info`,className:`bg-info-bg-subtle text-info-intense`},{variant:`soft`,color:`success`,className:`bg-success-bg-subtle text-success-intense`},{variant:`soft`,color:`warning`,className:`bg-warning-bg-subtle text-warning-intense`},{variant:`soft`,color:`danger`,className:`bg-danger-bg-subtle text-danger-intense`},{variant:`outline`,color:`primary`,className:`border-primary text-primary`},{variant:`outline`,color:`secondary`,className:`border-secondary text-secondary`},{variant:`outline`,color:`muted`,className:`border-muted text-muted`},{variant:`outline`,color:`accent`,className:`border-accent text-accent`},{variant:`outline`,color:`info`,className:`border-info text-info`},{variant:`outline`,color:`success`,className:`border-success text-success`},{variant:`outline`,color:`warning`,className:`border-warning text-warning`},{variant:`outline`,color:`danger`,className:`border-danger text-danger`}]});function i({className:t,variant:i,color:a,size:o,pill:s,...c}){return n(`span`,{className:e(r({variant:i,color:a,pill:s,size:o}),t),...c})}export{i as Badge,r as badgeVariants};
|
|
2
2
|
//# sourceMappingURL=badge.mjs.map
|
package/dist/ui/badge.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.mjs","names":[],"sources":["../../packages/components/ui/badge.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nconst badgeVariants = cva(\n 'inline-flex items-center justify-center font-medium transition-colors duration-150 focus:ring-2 focus:ring-offset-2 focus:outline-hidden focus:ring-ring forced-colors:outline',\n {\n variants: {\n variant: {\n solid: 'shadow-btn',\n soft: '',\n outline: 'bg-transparent border',\n },\n color: {\n primary: '',\n secondary: '',\n muted: '',\n accent: '',\n info: '',\n success: '',\n warning: '',\n danger: '',\n },\n size: {\n xs: 'text-[10px]/3 px-1.5 py-0.5 gap-1',\n sm: 'text-xs px-2 py-0.5 gap-1',\n md: 'text-sm px-2.5 py-0.5 gap-1.5',\n lg: 'text-base px-3 py-1 gap-1.5',\n xl: 'text-lg px-3.5 py-1 gap-1.5',\n },\n pill: {\n true: 'rounded-full',\n false: 'rounded-sm',\n },\n },\n defaultVariants: {\n variant: 'solid',\n color: 'primary',\n size: 'md',\n pill: true,\n },\n compoundVariants: [\n // solid\n { variant: 'solid', color: 'primary', className: 'bg-primary text-primary-foreground' },\n { variant: 'solid', color: 'secondary', className: 'bg-secondary text-secondary-foreground' },\n { variant: 'solid', color: 'muted', className: 'bg-muted text-text-negative' },\n { variant: 'solid', color: 'accent', className: 'bg-accent text-text-negative' },\n { variant: 'solid', color: 'info', className: 'bg-info text-info-foreground' },\n { variant: 'solid', color: 'success', className: 'bg-success text-success-foreground' },\n { variant: 'solid', color: 'warning', className: 'bg-warning text-
|
|
1
|
+
{"version":3,"file":"badge.mjs","names":[],"sources":["../../packages/components/ui/badge.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nconst badgeVariants = cva(\n 'inline-flex items-center justify-center font-medium transition-colors duration-150 focus:ring-2 focus:ring-offset-2 focus:outline-hidden focus:ring-ring forced-colors:outline',\n {\n variants: {\n variant: {\n solid: 'shadow-btn',\n soft: '',\n outline: 'bg-transparent border',\n },\n color: {\n primary: '',\n secondary: '',\n muted: '',\n accent: '',\n info: '',\n success: '',\n warning: '',\n danger: '',\n },\n size: {\n xs: 'text-[10px]/3 px-1.5 py-0.5 gap-1',\n sm: 'text-xs px-2 py-0.5 gap-1',\n md: 'text-sm px-2.5 py-0.5 gap-1.5',\n lg: 'text-base px-3 py-1 gap-1.5',\n xl: 'text-lg px-3.5 py-1 gap-1.5',\n },\n pill: {\n true: 'rounded-full',\n false: 'rounded-sm',\n },\n },\n defaultVariants: {\n variant: 'solid',\n color: 'primary',\n size: 'md',\n pill: true,\n },\n compoundVariants: [\n // solid\n { variant: 'solid', color: 'primary', className: 'bg-primary text-primary-foreground' },\n { variant: 'solid', color: 'secondary', className: 'bg-secondary text-secondary-foreground' },\n { variant: 'solid', color: 'muted', className: 'bg-muted text-text-negative' },\n { variant: 'solid', color: 'accent', className: 'bg-accent text-text-negative' },\n { variant: 'solid', color: 'info', className: 'bg-info text-info-foreground' },\n { variant: 'solid', color: 'success', className: 'bg-success text-success-foreground' },\n { variant: 'solid', color: 'warning', className: 'bg-warning text-text-negative' },\n { variant: 'solid', color: 'danger', className: 'bg-danger text-danger-foreground' },\n // soft\n { variant: 'soft', color: 'primary', className: 'bg-primary-bg-subtle text-primary-intense' },\n { variant: 'soft', color: 'secondary', className: 'bg-secondary-bg-subtle text-secondary-intense' },\n { variant: 'soft', color: 'muted', className: 'bg-muted-bg-subtle text-muted-intense' },\n { variant: 'soft', color: 'accent', className: 'bg-accent-bg-subtle text-accent-intense' },\n { variant: 'soft', color: 'info', className: 'bg-info-bg-subtle text-info-intense' },\n { variant: 'soft', color: 'success', className: 'bg-success-bg-subtle text-success-intense' },\n { variant: 'soft', color: 'warning', className: 'bg-warning-bg-subtle text-warning-intense' },\n { variant: 'soft', color: 'danger', className: 'bg-danger-bg-subtle text-danger-intense' },\n // outline\n { variant: 'outline', color: 'primary', className: 'border-primary text-primary' },\n { variant: 'outline', color: 'secondary', className: 'border-secondary text-secondary' },\n { variant: 'outline', color: 'muted', className: 'border-muted text-muted' },\n { variant: 'outline', color: 'accent', className: 'border-accent text-accent' },\n { variant: 'outline', color: 'info', className: 'border-info text-info' },\n { variant: 'outline', color: 'success', className: 'border-success text-success' },\n { variant: 'outline', color: 'warning', className: 'border-warning text-warning' },\n { variant: 'outline', color: 'danger', className: 'border-danger text-danger' },\n ],\n }\n);\n\n/**\n * Props for the `Badge` component.\n *\n * @property variant - Visual fill style — `'solid'` (filled, default), `'soft'` (tinted background), or `'outline'` (border only).\n * @property color - Semantic color token — `'primary'` | `'secondary'` | `'muted'` | `'accent'` | `'info'` | `'success'` | `'warning'` | `'danger'`. Defaults to `'primary'`.\n * @property size - Badge size — `'xs'` | `'sm'` | `'md'` (default) | `'lg'` | `'xl'`.\n * @property pill - When `true` (default), renders with fully rounded corners (`rounded-full`); when `false`, uses `rounded-sm`.\n */\nexport type BadgeProps = VariantProps<typeof badgeVariants> & React.ComponentPropsWithoutRef<'span'>;\n\n/**\n * Inline status label rendered as a `<span>` with CVA-driven variant, color, size, and shape options.\n *\n * @example\n * ```tsx\n * import { Badge } from '@customafk/lunas-ui/ui/badge';\n *\n * <Badge variant=\"soft\" color=\"success\" size=\"sm\">Active</Badge>\n * <Badge variant=\"outline\" color=\"danger\">Overdue</Badge>\n * ```\n */\nfunction Badge({ className, variant, color, size, pill, ...props }: BadgeProps) {\n return <span className={cn(badgeVariants({ variant, color, pill, size }), className)} {...props} />;\n}\n\n// eslint-disable-next-line react-refresh/only-export-components\nexport { Badge, badgeVariants };\n"],"mappings":"wJAMA,MAAM,EAAgB,EACpB,iLACA,CACE,SAAU,CACR,QAAS,CACP,MAAO,aACP,KAAM,GACN,QAAS,uBACX,EACA,MAAO,CACL,QAAS,GACT,UAAW,GACX,MAAO,GACP,OAAQ,GACR,KAAM,GACN,QAAS,GACT,QAAS,GACT,OAAQ,EACV,EACA,KAAM,CACJ,GAAI,oCACJ,GAAI,4BACJ,GAAI,gCACJ,GAAI,8BACJ,GAAI,6BACN,EACA,KAAM,CACJ,KAAM,eACN,MAAO,YACT,CACF,EACA,gBAAiB,CACf,QAAS,QACT,MAAO,UACP,KAAM,KACN,KAAM,EACR,EACA,iBAAkB,CAEhB,CAAE,QAAS,QAAS,MAAO,UAAW,UAAW,oCAAqC,EACtF,CAAE,QAAS,QAAS,MAAO,YAAa,UAAW,wCAAyC,EAC5F,CAAE,QAAS,QAAS,MAAO,QAAS,UAAW,6BAA8B,EAC7E,CAAE,QAAS,QAAS,MAAO,SAAU,UAAW,8BAA+B,EAC/E,CAAE,QAAS,QAAS,MAAO,OAAQ,UAAW,8BAA+B,EAC7E,CAAE,QAAS,QAAS,MAAO,UAAW,UAAW,oCAAqC,EACtF,CAAE,QAAS,QAAS,MAAO,UAAW,UAAW,+BAAgC,EACjF,CAAE,QAAS,QAAS,MAAO,SAAU,UAAW,kCAAmC,EAEnF,CAAE,QAAS,OAAQ,MAAO,UAAW,UAAW,2CAA4C,EAC5F,CAAE,QAAS,OAAQ,MAAO,YAAa,UAAW,+CAAgD,EAClG,CAAE,QAAS,OAAQ,MAAO,QAAS,UAAW,uCAAwC,EACtF,CAAE,QAAS,OAAQ,MAAO,SAAU,UAAW,yCAA0C,EACzF,CAAE,QAAS,OAAQ,MAAO,OAAQ,UAAW,qCAAsC,EACnF,CAAE,QAAS,OAAQ,MAAO,UAAW,UAAW,2CAA4C,EAC5F,CAAE,QAAS,OAAQ,MAAO,UAAW,UAAW,2CAA4C,EAC5F,CAAE,QAAS,OAAQ,MAAO,SAAU,UAAW,yCAA0C,EAEzF,CAAE,QAAS,UAAW,MAAO,UAAW,UAAW,6BAA8B,EACjF,CAAE,QAAS,UAAW,MAAO,YAAa,UAAW,iCAAkC,EACvF,CAAE,QAAS,UAAW,MAAO,QAAS,UAAW,yBAA0B,EAC3E,CAAE,QAAS,UAAW,MAAO,SAAU,UAAW,2BAA4B,EAC9E,CAAE,QAAS,UAAW,MAAO,OAAQ,UAAW,uBAAwB,EACxE,CAAE,QAAS,UAAW,MAAO,UAAW,UAAW,6BAA8B,EACjF,CAAE,QAAS,UAAW,MAAO,UAAW,UAAW,6BAA8B,EACjF,CAAE,QAAS,UAAW,MAAO,SAAU,UAAW,2BAA4B,CAChF,CACF,CACF,EAuBA,SAAS,EAAM,CAAE,YAAW,UAAS,QAAO,OAAM,OAAM,GAAG,GAAqB,CAC9E,OAAO,EAAC,OAAD,CAAM,UAAW,EAAG,EAAc,CAAE,UAAS,QAAO,OAAM,MAAK,CAAC,EAAG,CAAS,EAAG,GAAI,CAAQ,CAAA,CACpG"}
|
package/dist/ui/input.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as InputVariantProps, r as inputVariants, t as Input } from "../input-
|
|
1
|
+
import { n as InputVariantProps, r as inputVariants, t as Input } from "../input-go3H4EQz.cjs";
|
|
2
2
|
export { Input, InputVariantProps, inputVariants };
|
package/dist/ui/input.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as InputVariantProps, r as inputVariants, t as Input } from "../input-
|
|
1
|
+
import { n as InputVariantProps, r as inputVariants, t as Input } from "../input-go3H4EQz.mjs";
|
|
2
2
|
export { Input, InputVariantProps, inputVariants };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@customafk/lunas-ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.65",
|
|
4
4
|
"description": "UI library for Lunas Enterprise",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -443,10 +443,6 @@
|
|
|
443
443
|
},
|
|
444
444
|
"peerDependencies": {
|
|
445
445
|
"@customafk/react-toolkit": "0.0.19",
|
|
446
|
-
"@dnd-kit/core": "^6.3.1",
|
|
447
|
-
"@dnd-kit/modifiers": "^9.0.0",
|
|
448
|
-
"@dnd-kit/sortable": "^10.0.0",
|
|
449
|
-
"@dnd-kit/utilities": "^3.2.2",
|
|
450
446
|
"@hookform/error-message": "^2.0.0",
|
|
451
447
|
"@react-oauth/google": "^0.12.0",
|
|
452
448
|
"@tailwindcss/vite": "^4.1.0",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require("./ui/button.cjs"),t=require("./ui/tooltip.cjs"),n=require("./ui/separator.cjs"),r=require("./close-BYHgEZvZ.cjs"),i=require("./ui/dialog.cjs"),a=require("./ui/command.cjs"),o=require("./ui/switch.cjs"),s=require("./ui/checkbox.cjs"),c=require("./ui/input.cjs"),l=require("./ui/label.cjs"),u=require("./ui/popover.cjs"),d=require("./ui/select.cjs"),f=require("./ui/drawer.cjs"),p=require("./ui/calendar.cjs"),m=require("./ui/radio-group.cjs"),h=require("./ui/textarea.cjs"),g=require("./text-editor-DJYQXXtP.cjs");let _=require("lucide-react"),v=require("react"),y=require("@customafk/react-toolkit/utils"),b=require("class-variance-authority"),x=require("react/jsx-runtime"),S=require("@customafk/react-toolkit/date-fns"),C=require("radix-ui"),w=require("@customafk/react-toolkit/hooks/useMobile"),T=require("@tanstack/react-form");function E({width:e,className:t,children:n}){return(0,x.jsx)(`div`,{"data-slot":`array-col`,style:e?{width:typeof e==`number`?`${e}px`:e,flexShrink:0}:{flex:1,minWidth:0},className:t,children:n})}function D({className:e,children:t}){return(0,x.jsxs)(`div`,{"data-slot":`array-header-row`,className:(0,y.cn)(`mb-1 flex items-center gap-2 px-1 text-xs font-medium text-text-positive-weak`,e),children:[t,(0,x.jsx)(`div`,{className:`min-w-8 w-8 shrink-0`})]})}function O({defaultRow:t,children:n,addLabel:r=`Thêm hàng`,className:i}){let a=Q(),o=a.state.value??[],s=(0,v.useCallback)(()=>{a.pushValue({...t})},[a,t]),c=(0,v.useCallback)(e=>{a.removeValue(e)},[a]);return(0,x.jsxs)(`div`,{"data-slot":`simple-array-field`,className:(0,y.cn)(`flex flex-col gap-2`,i),children:[o.map((t,r)=>(0,x.jsxs)(`div`,{className:`flex items-start gap-2`,children:[n(r),(0,x.jsx)(e.Button,{type:`button`,size:`icon`,variant:`ghost`,color:`danger`,className:`min-w-8`,onClick:()=>c(r),children:(0,x.jsx)(_.Trash2Icon,{size:14})})]},r)),(0,x.jsx)(`div`,{children:(0,x.jsxs)(e.Button,{type:`button`,variant:`outline`,color:`muted`,size:`xs`,onClick:s,children:[(0,x.jsx)(_.PlusIcon,{size:13}),r]})})]})}function k({className:e,children:t,...n}){return(0,x.jsxs)(C.Label.Root,{"data-slot":`label`,className:(0,y.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,x.jsx)(`span`,{className:`flex items-center gap-1`,children:t}),(0,x.jsx)(`span`,{"data-slot":`required-indicator`,className:`hidden shrink-0 rounded-lg bg-danger-strong px-1.5 py-1 font-semibold text-[11px] leading-none text-white`,children:`Bắt buộc`})]})}const A=(0,b.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 gap-4`,`*:data-[slot=field-content]:basis-1/2`,`*:data-[slot=field-content-main]:flex-1`,`*: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`}}),j=(0,v.memo)(({className:e,...t})=>(0,x.jsx)(`fieldset`,{"data-slot":`field-set`,className:(0,y.cn)(`flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,e),...t}));j.displayName=`FieldSet`;const M=(0,v.memo)(({className:e,variant:t=`legend`,...n})=>(0,x.jsx)(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:(0,y.cn)(`mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,e),...n}));M.displayName=`FieldLegend`;const N=(0,v.memo)(({className:e,...t})=>(0,x.jsx)(`div`,{"data-slot":`field-group`,className:(0,y.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}));N.displayName=`FieldGroup`;const P=(0,v.memo)(({className:e,orientation:t=`vertical`,...n})=>(0,x.jsx)(`div`,{"data-slot":`field`,"data-orientation":t,className:(0,y.cn)(A({orientation:t}),e),...n}));P.displayName=`Field`;const F=(0,v.memo)(({className:e,...t})=>(0,x.jsx)(`div`,{"data-slot":`field-content`,className:(0,y.cn)(`group/field-content flex flex-col gap-1.5 leading-snug`,e),...t}));F.displayName=`FieldContent`;const I=(0,v.memo)(({className:e,...t})=>(0,x.jsx)(`div`,{"data-slot":`field-content-main`,className:(0,y.cn)(`relative`,e),...t}));I.displayName=`FieldContentMain`;const L=(0,v.memo)(({className:e,...t})=>(0,x.jsx)(k,{"data-slot":`field-label`,className:(0,y.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}));L.displayName=`FieldLabel`;const R=(0,v.memo)(({className:e,...t})=>(0,x.jsx)(`div`,{"data-slot":`field-label`,className:(0,y.cn)(`flex w-fit items-center gap-2 font-medium text-sm leading-snug group-data-[disabled=true]/field:opacity-50`,e),...t}));R.displayName=`FieldTitle`;const z=(0,v.memo)(({className:e,...t})=>(0,x.jsx)(`p`,{"data-slot":`field-description`,className:(0,y.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}));z.displayName=`FieldDescription`;const B=(0,v.memo)(({isShow:e=!0,className:t,children:n,...r})=>e===!1?null:(0,x.jsxs)(`div`,{"data-slot":`field-note`,className:(0,y.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,x.jsx)(_.InfoIcon,{size:12,className:`mt-0.5 shrink-0 text-primary/70`}),(0,x.jsx)(`span`,{children:n})]}));B.displayName=`FieldNote`;const V=(0,v.memo)(({tooltip:e})=>(0,x.jsxs)(t.Tooltip,{children:[(0,x.jsx)(t.TooltipTrigger,{asChild:!0,children:(0,x.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,x.jsx)(_.HelpCircleIcon,{size:13,"aria-hidden":`true`}),(0,x.jsx)(`span`,{className:`sr-only`,children:`Thêm thông tin`})]})}),(0,x.jsx)(t.TooltipContent,{side:`top`,className:`max-w-xs text-balance`,children:e})]}));V.displayName=`FieldTooltip`;const H=(0,v.memo)(({children:e,className:t,...r})=>(0,x.jsxs)(`div`,{"data-slot":`field-separator`,"data-content":!!e,className:(0,y.cn)(`relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2`,t),...r,children:[(0,x.jsx)(n.Separator,{className:`absolute inset-0 top-1/2`}),e&&(0,x.jsx)(`span`,{className:`relative mx-auto block w-fit bg-background px-2 text-text-positive-weak`,"data-slot":`field-separator-content`,children:e})]}));H.displayName=`FieldSeparator`;const U=(0,v.memo)(({className:e,children:t,errors:n,requiredMessage:r=`Trường này là bắt buộc`,...i})=>{let a=(0,v.useMemo)(()=>{let e=e=>e.code===`invalid_type`?r:e.message;return t||(n?n?.length===1&&n[0]?.message?(0,x.jsx)(`div`,{className:`flex flex-row items-center justify-start gap-x-0.5`,children:(0,x.jsx)(`p`,{children:e(n[0])})}):(0,x.jsx)(`ul`,{className:`flex list-none flex-col`,children:n.map(t=>typeof t==`string`?(0,x.jsx)(`li`,{children:t},t):t?.message?(0,x.jsx)(`li`,{children:e(t)},t.code??t.message):null)}):null)},[t,n,r]);return a?(0,x.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:(0,y.cn)(`w-full font-medium text-danger-strong text-xs`,e),...i,children:a}):null});U.displayName=`FieldError`;const W=({label:e,required:t,disabled:n,variant:r=`checkbox`})=>{let i=(0,v.useId)(),{form:a,name:c,state:u,handleBlur:d,handleChange:f}=Q(),p=(0,T.useStore)(a.store,({isSubmitting:e})=>e),m=u.meta.isTouched&&!u.meta.isValid,h=u.value??!1,g=n||p,_=(0,v.useCallback)(e=>{p||f(e)},[p,f]);return(0,x.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2 h-9`,children:[r===`switch`?(0,x.jsx)(o.Switch,{id:i,name:c,checked:h,disabled:g,"aria-invalid":m,onBlur:d,onCheckedChange:_}):(0,x.jsx)(s.Checkbox,{id:i,name:c,checked:h,disabled:g,"aria-invalid":m,onBlur:d,onCheckedChange:_}),e&&(0,x.jsxs)(l.Label,{htmlFor:i,className:`cursor-pointer`,children:[e,t&&(0,x.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]})]}),m&&(0,x.jsx)(U,{errors:u.meta.errors})]})},G=({label:t,placeholder:n,required:r,disabled:i,options:o})=>{let s=(0,v.useId)(),{form:c,state:d,handleBlur:p,handleChange:m}=Q(),h=(0,T.useStore)(c.store,({isSubmitting:e})=>e),g=(0,w.useIsMobile)(),[_,b]=(0,v.useState)(!1),S=d.meta.isTouched&&!d.meta.isValid,C=i||h,E=o.find(({value:e})=>e===d.value)?.label,D=(0,x.jsxs)(a.Command,{children:[(0,x.jsx)(a.CommandInput,{placeholder:n??`Tìm kiếm…`}),(0,x.jsxs)(a.CommandList,{children:[(0,x.jsx)(a.CommandEmpty,{children:`Không tìm thấy kết quả.`}),(0,x.jsx)(a.CommandGroup,{children:o.map(e=>(0,x.jsx)(a.CommandItem,{value:e.label,onSelect:()=>{m(e.value===d.value?null:e.value),b(!1)},children:e.label},e.value))})]})]});return g?(0,x.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[t&&(0,x.jsxs)(l.Label,{htmlFor:s,children:[t,r&&(0,x.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,x.jsx)(e.Button,{id:s,type:`button`,variant:`outline`,color:`muted`,disabled:C,"aria-invalid":S,className:(0,y.cn)(`w-full justify-start font-normal outline-1 outline-border -outline-offset-1`,!d.value&&`text-text-positive-muted`,S&&`outline-danger bg-danger-bg-subtle`),onBlur:p,onClick:()=>b(!0),children:E??(0,x.jsx)(`span`,{className:`text-text-positive-muted`,children:n})}),(0,x.jsx)(f.Drawer,{open:_,onOpenChange:b,direction:`bottom`,children:(0,x.jsxs)(f.DrawerContent,{children:[(0,x.jsx)(f.DrawerHeader,{children:(0,x.jsx)(f.DrawerTitle,{children:t??n??`Tìm kiếm…`})}),(0,x.jsx)(`div`,{className:`overflow-y-auto pb-safe-bottom`,children:D})]})}),S&&(0,x.jsx)(U,{errors:d.meta.errors})]}):(0,x.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[t&&(0,x.jsxs)(l.Label,{htmlFor:s,children:[t,r&&(0,x.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,x.jsxs)(u.Popover,{children:[(0,x.jsx)(u.PopoverTrigger,{asChild:!0,children:(0,x.jsx)(e.Button,{id:s,variant:`outline`,color:`muted`,size:`lg`,disabled:C,"aria-invalid":S,className:(0,y.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`,!d.value&&`text-text-positive-muted`),children:E??(0,x.jsx)(`span`,{className:`text-text-positive-muted`,children:n})})}),(0,x.jsx)(u.PopoverContent,{align:`start`,side:`bottom`,className:`w-[--radix-popover-trigger-width] p-0 rounded`,onBlur:p,children:D})]}),S&&(0,x.jsx)(U,{errors:d.meta.errors})]})},K=({label:t,placeholder:n,required:r,disabled:i,minDate:a,maxDate:o})=>{let s=(0,v.useId)(),{form:c,state:d,handleBlur:f,handleChange:m}=Q(),h=(0,T.useStore)(c.store,({isSubmitting:e})=>e),g=d.meta.isTouched&&!d.meta.isValid;return(0,x.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[t&&(0,x.jsxs)(l.Label,{htmlFor:s,children:[t,r&&(0,x.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,x.jsxs)(u.Popover,{children:[(0,x.jsx)(u.PopoverTrigger,{asChild:!0,children:(0,x.jsxs)(e.Button,{id:s,variant:`outline`,color:`muted`,size:`lg`,disabled:i||h,"aria-invalid":g,className:(0,y.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`,d.value===null&&`text-text-positive-muted`),children:[(0,x.jsx)(`span`,{children:d.value?(0,S.format)(d.value,`PPP`):n??`Select date`}),(0,x.jsx)(_.CalendarDaysIcon,{strokeWidth:1})]})}),(0,x.jsx)(u.PopoverContent,{align:`start`,side:`bottom`,className:`w-fit p-0 rounded`,onBlur:f,children:(0,x.jsx)(p.Calendar,{mode:`single`,selected:d.value??void 0,hidden:{before:a??new Date(1900,0,1),after:o??new Date(2100,11,31)},onSelect:e=>{e&&m(e)}})})]}),g&&(0,x.jsx)(U,{errors:d.meta.errors})]})},q=({label:e,required:t,disabled:n,options:r,orientation:i=`vertical`})=>{let{form:a,name:o,state:s,handleBlur:c,handleChange:u}=Q(),d=(0,T.useStore)(a.store,({isSubmitting:e})=>e),f=s.meta.isTouched&&!s.meta.isValid,p=n||d;return(0,x.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e&&(0,x.jsxs)(l.Label,{children:[e,t&&(0,x.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,x.jsx)(m.RadioGroup,{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:u,onBlur:c,children:r.map(e=>(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsx)(m.RadioGroupItem,{id:`${o}-${e.value}`,value:e.value}),(0,x.jsx)(l.Label,{htmlFor:`${o}-${e.value}`,className:`cursor-pointer font-normal`,children:e.label})]},e.value))}),f&&(0,x.jsx)(U,{errors:s.meta.errors})]})},J=({label:e,placeholder:t,required:n,maxLength:r,disabled:i})=>{let a=(0,v.useId)(),{form:o,name:s,state:u,handleBlur:d,handleChange:f}=Q(),p=(0,T.useStore)(o.store,({isSubmitting:e})=>e),m=u.meta.isTouched&&!u.meta.isValid,h=(0,v.useCallback)(({target:{value:e}})=>{p||r&&e.length>r||f(e||null)},[p,r,f]);return(0,x.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e&&(0,x.jsxs)(l.Label,{htmlFor:a,children:[e,n&&(0,x.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,x.jsxs)(`div`,{className:`relative`,children:[(0,x.jsx)(c.Input,{id:a,name:s,type:`email`,value:u.value??``,"aria-invalid":m,autoComplete:`email`,placeholder:t,disabled:i||p,className:(0,y.cn)(`pl-9`),onBlur:d,onChange:h}),(0,x.jsx)(`div`,{className:`pointer-events-none absolute inset-y-0 left-0 flex size-9 items-center justify-center text-muted`,children:(0,x.jsx)(_.AtSignIcon,{size:14})})]}),m&&(0,x.jsx)(U,{errors:u.meta.errors})]})},ee=e=>e?/^-?\d*\.?\d*$/:/^\d*\.?\d*$/,te=e=>Number(e).toLocaleString(),ne=(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}},re=({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 b=(0,v.useRef)(null),S=(0,v.useRef)(null),[C,w]=(0,v.useState)(a?.toString()??null),T=(0,v.useMemo)(()=>s?.[1]??r,[s,r]),E=(0,v.useMemo)(()=>s&&s[0]-s[1],[s]),D=(0,v.useMemo)(()=>ee(n),[n]),O=(0,v.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,v.useCallback)(e=>{if(e===`0`)return`0`;if(!Number(e))return null;let[t,n=``]=ne(parseFloat(e),Math.min(T-1,u||0),i).toString().split(`.`),r=te(t);return n?`${r}.${n}`:r},[T,u,i]),A=(0,v.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,v.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,v.useCallback)(e=>{t||(h?.(e),w(e=>typeof e==`string`?e.replace(/,/g,``):null))},[t,h]),N=(0,v.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,v.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,v.useEffect)(()=>{if(!b.current||!S.current||!o)return;let e=b.current.offsetWidth;S.current.style.setProperty(`padding-right`,`${(e+10)/16}rem`)},[o]),(0,x.jsxs)(`div`,{className:(0,y.cn)(`relative`,d),children:[(0,x.jsx)(c.Input,{..._,ref:S,value:C||(t?`0`:``),placeholder:l,disabled:e,readOnly:t,className:(0,y.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,x.jsx)(`span`,{ref:b,className:`-translate-y-1/2 pointer-events-none absolute top-1/2 right-2 text-muted-foreground text-sm`,children:o})]})},ie=({label:e,placeholder:t,required:n,unit:r,allowNegative:i,disabled:a})=>{let o=(0,v.useId)(),{form:s,state:c,handleBlur:u,handleChange:d}=Q(),f=(0,T.useStore)(s.store,({isSubmitting:e})=>e),p=c.meta.isTouched&&!c.meta.isValid,m=(0,v.useCallback)(e=>{f||d(e)},[f,d]);return(0,x.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e&&(0,x.jsxs)(l.Label,{htmlFor:o,children:[e,n&&(0,x.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,x.jsx)(re,{id:o,value:c.value,placeholder:t,unitText:r,allowNegative:i,disabled:a||f,onBlur:u,onValueChange:m}),p&&(0,x.jsx)(U,{errors:c.meta.errors})]})},ae=({label:e,placeholder:t,required:n,disabled:r})=>{let i=(0,v.useId)(),{form:a,name:o,state:s,handleBlur:u,handleChange:d}=Q(),f=(0,T.useStore)(a.store,({isSubmitting:e})=>e),[p,m]=(0,v.useState)(!1),h=s.meta.isTouched&&!s.meta.isValid,g=(0,v.useCallback)(()=>m(e=>!e),[]),y=(0,v.useCallback)(({target:{value:e}})=>{f||d(e||null)},[f,d]);return(0,x.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e&&(0,x.jsxs)(l.Label,{htmlFor:i,children:[e,n&&(0,x.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,x.jsxs)(`div`,{className:`relative`,children:[(0,x.jsx)(c.Input,{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:u,onChange:y}),(0,x.jsx)(`button`,{type:`button`,tabIndex:-1,"aria-label":p?`Ẩn mật khẩu`:`Hiện mật khẩu`,"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,x.jsx)(_.EyeOffIcon,{size:16,"aria-hidden":`true`}):(0,x.jsx)(_.EyeIcon,{size:16,"aria-hidden":`true`})})]}),h&&(0,x.jsx)(U,{errors:s.meta.errors})]})},oe=({label:t,placeholder:n,required:r,options:i})=>{let a=(0,v.useId)(),{state:o,handleBlur:s,handleChange:c}=Q(),u=(0,w.useIsMobile)(),[p,m]=(0,v.useState)(!1),h=o.meta.isTouched&&!o.meta.isValid,g=i.find(e=>e.value===o.value)?.label;return u?(0,x.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[t&&(0,x.jsxs)(l.Label,{htmlFor:a,children:[t,r&&(0,x.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,x.jsx)(e.Button,{id:a,type:`button`,variant:`outline`,color:`muted`,className:(0,y.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,x.jsx)(`span`,{className:`text-text-positive-muted`,children:n})}),(0,x.jsx)(f.Drawer,{open:p,onOpenChange:m,direction:`bottom`,children:(0,x.jsxs)(f.DrawerContent,{children:[(0,x.jsx)(f.DrawerHeader,{children:(0,x.jsx)(f.DrawerTitle,{children:t??n??`Select an option`})}),(0,x.jsx)(`div`,{className:`flex flex-col overflow-y-auto pb-safe-bottom`,children:i.length>0?i.map(e=>(0,x.jsx)(f.DrawerClose,{asChild:!0,children:(0,x.jsx)(`button`,{type:`button`,className:(0,y.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,x.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,x.jsx)(_.PackagePlusIcon,{strokeWidth:1}),`No options available`]})})]})}),h&&(0,x.jsx)(U,{errors:o.meta.errors})]}):(0,x.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[t&&(0,x.jsxs)(l.Label,{htmlFor:a,children:[t,r&&(0,x.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,x.jsxs)(d.Select,{value:o.value??``,onValueChange:c,children:[(0,x.jsx)(d.SelectTrigger,{id:a,"aria-invalid":h?`true`:void 0,onBlur:s,children:(0,x.jsx)(d.SelectValue,{placeholder:n})}),(0,x.jsx)(d.SelectContent,{children:i.length>0?i.map(e=>(0,x.jsx)(d.SelectItem,{value:e.value,children:e.label},e.value)):(0,x.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,x.jsx)(_.PackagePlusIcon,{strokeWidth:1}),`No options available`]})})]}),h&&(0,x.jsx)(U,{errors:o.meta.errors})]})},se=({label:e,placeholder:t,required:n,maxLength:r,rows:i,disabled:a})=>{let o=(0,v.useId)(),{form:s,name:c,state:u,handleBlur:d,handleChange:f}=Q(),p=(0,T.useStore)(s.store,({isSubmitting:e})=>e),m=u.meta.isTouched&&!u.meta.isValid,g=(0,v.useCallback)(({target:{value:e}})=>{p||r&&e.length>r||f(e||null)},[p,r,f]);return(0,x.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e&&(0,x.jsxs)(l.Label,{htmlFor:o,children:[e,n&&(0,x.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,x.jsx)(h.Textarea,{id:o,name:c,value:u.value??``,"aria-invalid":m,placeholder:t,rows:i,disabled:a||p,onBlur:d,onChange:g}),m&&(0,x.jsx)(U,{errors:u.meta.errors})]})},ce=({label:e,placeholder:t,required:n,maxLength:r,disabled:i})=>{let a=(0,v.useId)(),{form:o,name:s,state:u,handleBlur:d,handleChange:f}=Q(),p=(0,T.useStore)(o.store,({isSubmitting:e})=>e),m=u.meta.isTouched&&!u.meta.isValid,h=(0,v.useCallback)(({target:{value:e}})=>{p||r&&e.length>r||f(e||null)},[p,r,f]);return(0,x.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e&&(0,x.jsxs)(l.Label,{htmlFor:a,children:[e,n&&(0,x.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,x.jsx)(c.Input,{id:a,name:s,value:u.value??``,"aria-invalid":m,placeholder:t,autoComplete:`off`,disabled:i||p,onBlur:d,onChange:h}),m&&(0,x.jsx)(U,{errors:u.meta.errors})]})},le=({label:e,description:t,options:n,tooltip:r,helperText:i,orientation:a})=>{let o=Q(),c=(0,T.useStore)(o.form.store,({isSubmitting:e})=>e);return(0,x.jsxs)(N,{className:`gap-y-4 px-4`,children:[(0,x.jsxs)(P,{orientation:a,children:[(0,x.jsxs)(F,{children:[(0,x.jsxs)(L,{children:[e,r&&(0,x.jsx)(V,{tooltip:r})]}),(0,x.jsx)(z,{children:t}),(0,x.jsx)(B,{isShow:!!i,children:i})]}),(0,x.jsx)(I,{children:(0,x.jsx)(N,{className:`flex flex-col gap-y-2`,children:n.map(e=>(0,x.jsxs)(P,{orientation:`horizontal`,children:[(0,x.jsx)(s.Checkbox,{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,x.jsx)(L,{htmlFor:`${o.name}-${e.value}`,className:`text-text-positive`,children:e.label})]},e.value))})})]}),(0,x.jsx)(H,{})]})},Y=(0,v.memo)(({label:t,description:n,placeholder:r,tooltip:o,helperText:s,orientation:c=`responsive`,options:l,required:d=!1,disabled:f=!1,clearable:p=!1,showErrorMessage:m=!0})=>{let h=(0,v.useId)(),g=Q(),b=(0,w.useIsMobile)(),[S,E]=(0,v.useState)(!1),[D,O]=(0,v.useState)(!1),k=(0,T.useStore)(g.form.store,({isSubmitting:e})=>e),A=f||k,j=g.state.meta.isDirty||g.state.meta.isTouched,M=j&&!g.state.meta.isValid,R=d&&g.state.value===null,W=p&&!!g.state.value&&!A,G=l.find(({value:e})=>e===g.state.value)?.label,K=()=>{g.handleChange(null),g.handleBlur()},q=t=>(0,x.jsx)(e.Button,{variant:`outline`,color:`muted`,size:`lg`,disabled:A,"aria-invalid":M?!0:void 0,"aria-describedby":h,className:(0,y.cn)(`flex w-full items-center justify-start rounded outline-border`,`hover:bg-transparent`,`focus-visible:outline-1 focus-visible:outline-primary-strong focus-visible:ring-4 focus-visible: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`,W&&`pr-8`,!g.state.value&&`text-text-positive-muted`,M&&`outline-danger bg-danger-bg-subtle ring-4 ring-danger-weak`),onClick:t,children:G?(0,x.jsx)(`p`,{className:`flex min-w-0 flex-1 items-center gap-2 truncate text-start`,children:G}):(0,x.jsx)(`p`,{className:`flex-1 text-start text-text-positive-muted`,children:r})}),J=e=>(0,x.jsxs)(a.Command,{className:`border-none`,children:[(0,x.jsx)(a.CommandInput,{placeholder:r??`Tìm kiếm…`}),(0,x.jsxs)(a.CommandList,{children:[(0,x.jsx)(a.CommandEmpty,{className:`flex min-h-30 items-center justify-center text-sm text-text-positive-weak`,children:`Không tìm thấy kết quả nào phù hợp.`}),(0,x.jsx)(a.CommandGroup,{className:`max-h-60 overflow-y-auto`,children:l.map(({value:t,label:n})=>(0,x.jsx)(a.CommandItem,{value:n,onSelect:()=>e(t),children:n},t))})]})]});return(0,x.jsxs)(N,{className:`gap-y-4 px-4`,children:[(0,x.jsxs)(P,{orientation:c,"data-invalid":M,children:[(0,x.jsxs)(F,{children:[(0,x.jsxs)(L,{"aria-required":R,htmlFor:g.name,children:[t,o&&(0,x.jsx)(V,{tooltip:o})]}),(0,x.jsx)(z,{children:n})]}),(0,x.jsx)(I,{className:`flex justify-end`,children:(0,x.jsxs)(`div`,{className:`flex w-full flex-col`,children:[(0,x.jsxs)(`div`,{className:`relative`,children:[b?(0,x.jsxs)(x.Fragment,{children:[q(()=>E(!0)),(0,x.jsx)(i.Dialog,{open:S,onOpenChange:e=>{E(e),e||g.handleBlur()},children:(0,x.jsxs)(i.DialogPortal,{children:[(0,x.jsx)(i.DialogOverlay,{}),(0,x.jsxs)(C.Dialog.Content,{onOpenAutoFocus:e=>e.preventDefault(),className:(0,y.cn)(`fixed inset-x-0 bottom-0 z-50`,`flex flex-col bg-background rounded-t-2xl outline-none`,`max-h-[80dvh] shadow-[0_-4px_24px_rgba(0,0,0,0.08)]`,`data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom data-[state=open]:fade-in-0`,`data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=closed]:fade-out-0`,`duration-300`),children:[(0,x.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-border shrink-0`,children:[(0,x.jsx)(`span`,{className:`font-semibold text-sm text-text-positive`,children:t}),(0,x.jsx)(i.DialogClose,{asChild:!0,children:(0,x.jsx)(`button`,{type:`button`,"aria-label":`Đóng`,className:`flex size-7 items-center justify-center rounded-md text-text-positive-weak transition-colors hover:bg-muted-muted hover:text-text-positive`,children:(0,x.jsx)(_.XIcon,{size:16})})})]}),(0,x.jsxs)(`div`,{className:`flex flex-col overflow-y-auto`,children:[W&&(0,x.jsx)(i.DialogClose,{asChild:!0,children:(0,x.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-x-2 px-4 py-3 text-left text-sm text-danger-strong transition-colors hover:bg-danger-bg-subtle`,onClick:K,children:[(0,x.jsx)(_.XIcon,{size:14}),`Xóa lựa chọn`]})}),J(e=>{g.handleChange(e),E(!1),g.handleBlur()})]}),(0,x.jsx)(`div`,{className:`shrink-0 h-safe-bottom`})]})]})})]}):(0,x.jsxs)(u.Popover,{open:D,onOpenChange:e=>{O(e),e||g.handleBlur()},children:[(0,x.jsx)(u.PopoverTrigger,{asChild:!0,children:q()}),(0,x.jsx)(u.PopoverContent,{align:`end`,side:`bottom`,className:`flex w-fit rounded p-0`,children:J(e=>{g.handleChange(e),O(!1),g.handleBlur()})})]}),W&&(0,x.jsx)(`button`,{type:`button`,"aria-label":`Xóa lựa chọn`,className:`absolute right-2 top-1/2 -translate-y-1/2 flex size-4 cursor-pointer items-center justify-center rounded-md text-text-positive-weak outline-none transition-[color,transform] hover:text-text-positive focus-visible:text-primary-strong focus-visible:[&>svg]:scale-125 [&>svg]:size-3.5 [&>svg]:transition-transform`,onClick:K,children:(0,x.jsx)(_.XIcon,{"aria-hidden":`true`})})]}),j&&m&&(0,x.jsx)(U,{id:h,className:`mt-1`,errors:g.state.meta.errors}),(0,x.jsx)(B,{isShow:!!s,children:s})]})})]}),(0,x.jsx)(H,{})]})});Y.displayName=`ComboboxField`;const X=(0,v.memo)(({label:t,description:n,placeholder:r,orientation:i=`responsive`,tooltip:a,helperText:o,showErrorMessage:s=!0,required:c=!1,disabled:l=!1,minDate:d,maxDate:f})=>{let m=(0,v.useId)(),h=Q(),[g,b]=(0,v.useState)(!1),C=(0,T.useStore)(h.form.store,({isSubmitting:e})=>e),w=l||C,E=h.state.meta.isDirty||h.state.meta.isTouched,D=E&&!h.state.meta.isValid,O=c&&h.state.value===null,k=e=>{h.handleChange(e),b(!1)};return(0,x.jsxs)(N,{className:`px-4`,children:[(0,x.jsxs)(P,{orientation:i,"data-invalid":D,children:[(0,x.jsxs)(F,{children:[(0,x.jsxs)(L,{htmlFor:h.name,"aria-required":O,children:[t,a&&(0,x.jsx)(V,{tooltip:a})]}),(0,x.jsx)(z,{children:n})]}),(0,x.jsx)(I,{className:`flex flex-col space-y-1`,children:(0,x.jsxs)(`div`,{className:`flex w-full flex-col`,children:[(0,x.jsxs)(u.Popover,{open:g,onOpenChange:e=>{b(e),e||h.handleBlur()},children:[(0,x.jsx)(u.PopoverTrigger,{asChild:!0,children:(0,x.jsxs)(e.Button,{variant:`outline`,color:`muted`,size:`lg`,disabled:w,"aria-invalid":D?!0:void 0,"aria-describedby":m,className:(0,y.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]:outline-1 data-[state=open]:outline-primary-strong data-[state=open]:ring-4 data-[state=open]:ring-primary-weak`,h.state.value===null&&`text-text-positive-muted`,D&&`outline-danger bg-danger-bg-subtle ring-4 ring-danger-weak`),children:[(0,x.jsx)(`p`,{children:h.state.value===null?r??`Select date`:(0,S.format)(h.state.value,`PPPP`)}),(0,x.jsx)(_.CalendarDaysIcon,{strokeWidth:1})]})}),(0,x.jsxs)(u.PopoverContent,{align:`start`,side:`bottom`,className:`flex w-fit min-w-0 overflow-y-auto rounded p-0`,children:[(0,x.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,x.jsx)(e.Button,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>k((0,S.endOfToday)()),children:`Hôm nay`}),(0,x.jsx)(e.Button,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>k((0,S.endOfTomorrow)()),children:`Ngày mai`}),(0,x.jsx)(e.Button,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>k((0,S.endOfYesterday)()),children:`Hôm qua`}),(0,x.jsx)(e.Button,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>k((0,S.subDays)((0,S.endOfToday)(),3)),children:`3 ngày qua`}),(0,x.jsx)(e.Button,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>k((0,S.subDays)((0,S.endOfToday)(),7)),children:`7 ngày qua`}),(0,x.jsx)(e.Button,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>k((0,S.subDays)((0,S.endOfToday)(),30)),children:`30 ngày qua`}),(0,x.jsx)(e.Button,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>k((0,S.startOfMonth)((0,S.endOfToday)())),children:`Tháng này`}),(0,x.jsx)(e.Button,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>k((0,S.lastDayOfMonth)((0,S.endOfToday)())),children:`Tháng trước`})]}),(0,x.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,x.jsx)(`div`,{className:`min-w-73 border-b border-b-border p-2`,children:(0,x.jsx)(p.Calendar,{mode:`single`,selected:h.state.value??void 0,hidden:{before:d??new Date(1900,0,1),after:f??new Date(2100,11,31)},onSelect:e=>{e&&k(e)}})})})]})]}),E&&s&&(0,x.jsx)(U,{id:m,className:`mt-1`,errors:h.state.meta.errors}),(0,x.jsx)(B,{isShow:!!o,children:o})]})})]}),(0,x.jsx)(H,{})]})});X.displayName=`DateField`;const ue=({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,T.useStore)(u.store,({isSubmitting:e})=>e),g=f.meta.isDirty&&f.meta.isTouched&&!f.meta.isValid,b=s&&f.value===null,S=!h&&!!f.value,C=(0,v.useCallback)(({target:{value:e}})=>{h||l&&e.length>l||m(e||null)},[h,l,m]),w=(0,v.useCallback)(()=>{h||m(null)},[h,m]);return(0,x.jsxs)(N,{className:`gap-y-4 px-4`,children:[(0,x.jsxs)(P,{"data-invalid":g,orientation:a,children:[(0,x.jsxs)(F,{children:[(0,x.jsxs)(L,{htmlFor:d,"aria-required":b,children:[e,r&&(0,x.jsx)(V,{tooltip:r})]}),(0,x.jsx)(z,{children:t})]}),(0,x.jsxs)(I,{children:[(0,x.jsx)(c.Input,{id:d,name:d,value:f.value===null?``:f.value,"aria-invalid":g,autoComplete:`email`,placeholder:n,className:(0,y.cn)(`pl-9`,S&&`pr-9`,h&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:p,onChange:C}),(0,x.jsx)(`div`,{className:`absolute top-0 left-0 flex size-9 items-center justify-center text-muted`,children:(0,x.jsx)(_.AtSignIcon,{size:14})}),S&&(0,x.jsx)(`button`,{type:`button`,"aria-label":`Xóa`,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,x.jsx)(_.XIcon,{size:14,"aria-hidden":`true`})}),(0,x.jsx)(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:o&&f.meta.isDirty&&(0,x.jsx)(U,{errors:f.meta.errors})}),(0,x.jsx)(B,{isShow:!!i,children:i})]})]}),(0,x.jsx)(H,{})]})},Z=(0,v.memo)(({label:e,description:t,placeholder:n,tooltip:r,helperText:i,orientation:a=`responsive`,showErrorMessage:o=!0,rounding:s,decimalPlaces:c,precision:l,unit:u,required:d=!1,disabled:f=!1,allowNegative:p})=>{let m=(0,v.useId)(),h=(0,v.useId)(),g=Q(),b=(0,T.useStore)(g.form.store,({isSubmitting:e})=>e),S=f||b,C=g.state.meta.isDirty||g.state.meta.isTouched,w=C&&!g.state.meta.isValid,E=d&&g.state.value===null,D=!!g.state.meta.errors.length,O=(0,v.useCallback)(e=>{S||g.handleChange(e)},[S,g.handleChange]);return(0,x.jsxs)(N,{className:`gap-y-4 px-4`,children:[(0,x.jsxs)(P,{orientation:a,"data-invalid":w,children:[(0,x.jsxs)(F,{children:[(0,x.jsxs)(L,{htmlFor:m,"aria-required":E,children:[e,r&&(0,x.jsx)(V,{tooltip:r})]}),(0,x.jsx)(z,{children:t})]}),(0,x.jsxs)(I,{children:[(0,x.jsxs)(`div`,{className:`relative w-full`,children:[(0,x.jsx)(re,{id:m,value:g.state.value,"aria-invalid":w,"aria-describedby":h,placeholder:n,disabled:S,roundingRule:s,numberAfterDecimalPoint:c,precision:l,unitText:u,allowNegative:p,className:(0,y.cn)(S&&`pointer-events-none opacity-60`),onBlur:g.handleBlur,onValueChange:O}),b&&(0,x.jsx)(`div`,{className:`pointer-events-none absolute inset-s-2 inset-y-0 top-2.5 [&>svg]:size-3.5`,children:(0,x.jsx)(_.Loader2Icon,{className:`animate-spin text-primary-strong`})}),!b&&C&&o&&D&&(0,x.jsx)(`div`,{className:`pointer-events-none absolute inset-s-2 inset-y-0 top-2.75 text-danger-strong [&>svg]:size-3.5`,children:(0,x.jsx)(_.BanIcon,{})}),(0,x.jsx)(`div`,{className:`mt-1 flex w-full items-start justify-between gap-x-2`,children:C&&o?(0,x.jsx)(U,{id:h,className:`flex-1`,errors:g.state.meta.errors}):(0,x.jsx)(`div`,{})})]}),(0,x.jsx)(B,{isShow:!!i,children:i})]})]}),(0,x.jsx)(H,{})]})});Z.displayName=`NumberField`;const de=({label:e,description:t,placeholder:n,orientation:r=`responsive`,tooltip:i,helperText:a,showErrorMessage:o=!0})=>{let s=(0,v.useId)(),{form:l,name:u,state:d,handleBlur:f,handleChange:p}=Q(),m=(0,T.useStore)(l.store,({isSubmitting:e})=>e),[h,g]=(0,v.useState)(!1),y=d.meta.isDirty&&d.meta.isTouched&&!d.meta.isValid,b=(0,v.useCallback)(()=>g(e=>!e),[]),S=(0,v.useCallback)(({target:{value:e}})=>{m||p(e||null)},[m,p]);return(0,x.jsxs)(N,{className:`gap-y-4 px-4`,children:[(0,x.jsxs)(P,{"data-invalid":y,orientation:r,children:[(0,x.jsxs)(F,{children:[(0,x.jsxs)(L,{htmlFor:s,children:[e,i&&(0,x.jsx)(V,{tooltip:i})]}),(0,x.jsx)(z,{children:t})]}),(0,x.jsxs)(I,{children:[(0,x.jsx)(c.Input,{id:s,name:u,type:h?`text`:`password`,placeholder:n,value:d.value??``,"aria-invalid":y,autoComplete:`new-password`,onBlur:f,onChange:S}),(0,x.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?`Ẩn mật khẩu`:`Hiện mật khẩu`,"aria-pressed":h,"aria-controls":s,children:h?(0,x.jsx)(_.EyeOffIcon,{size:16,"aria-hidden":`true`}):(0,x.jsx)(_.EyeIcon,{size:16,"aria-hidden":`true`})}),(0,x.jsx)(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:o&&d.meta.isDirty&&(0,x.jsx)(U,{errors:d.meta.errors})}),(0,x.jsx)(B,{isShow:!!a,children:a})]})]}),(0,x.jsx)(H,{})]})},fe=({label:e,description:t,orientation:n,options:r,tooltip:i,helperText:a})=>{let o=Q(),s=(0,T.useStore)(o.form.store,({isSubmitting:e})=>e);return(0,x.jsxs)(N,{className:`px-4`,children:[(0,x.jsxs)(P,{orientation:n,className:`flex-col gap-2`,children:[(0,x.jsxs)(F,{children:[(0,x.jsxs)(L,{children:[e,i&&(0,x.jsx)(V,{tooltip:i})]}),(0,x.jsx)(z,{children:t}),(0,x.jsx)(B,{isShow:!!a,children:a})]}),(0,x.jsx)(I,{children:(0,x.jsx)(m.RadioGroup,{value:o.state.value??``,className:`w-full`,onValueChange:o.handleChange,children:r.map(e=>(0,x.jsx)(L,{className:(0,y.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,x.jsxs)(P,{orientation:`horizontal`,className:`items-start gap-3 rounded p-2!`,children:[(0,x.jsx)(m.RadioGroupItem,{value:e.value,className:`mt-0.5 shrink-0`}),(0,x.jsxs)(F,{className:`gap-0.5!`,children:[(0,x.jsx)(R,{children:e.label}),(0,x.jsx)(z,{className:`text-xs`,children:e.description})]})]})},e.value))})})]}),(0,x.jsx)(H,{})]})},pe=(0,v.memo)(({label:e,description:t,placeholder:n,orientation:r=`responsive`,tooltip:a,options:o,helperText:s,clearable:c=!1,required:l=!1,disabled:u=!1,showErrorMessage:f=!0})=>{let p=(0,v.useId)(),m=Q(),h=(0,w.useIsMobile)(),[g,b]=(0,v.useState)(!1),S=(0,T.useStore)(m.form.store,({isSubmitting:e})=>e),E=u||S,D=m.state.meta.isDirty||m.state.meta.isTouched,O=D&&!m.state.meta.isValid,k=l&&m.state.value===null,A=c&&!!m.state.value&&!E,j=o.find(e=>e.value===m.state.value)?.label,M=()=>{m.handleChange(null),m.handleBlur()};return(0,x.jsxs)(N,{className:`gap-y-4 px-4`,children:[(0,x.jsxs)(P,{orientation:r,"data-invalid":O,children:[(0,x.jsxs)(F,{children:[(0,x.jsxs)(L,{htmlFor:m.name,"aria-required":k,children:[e,a&&(0,x.jsx)(V,{tooltip:a})]}),(0,x.jsx)(z,{children:t})]}),(0,x.jsxs)(I,{className:`flex flex-col`,children:[h?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`button`,{id:m.name,type:`button`,disabled:E,"aria-invalid":O?`true`:void 0,"aria-describedby":p,onBlur:m.handleBlur,onClick:()=>b(!0),className:(0,y.cn)(`flex w-full items-center justify-between`,`outline-1 outline-border -outline-offset-1`,`gap-2 rounded bg-transparent px-3 py-2`,`shadow-input transition-all cursor-pointer whitespace-nowrap text-sm`,`focus-visible:outline-primary-strong focus-visible:ring-4 focus-visible:ring-primary-weak`,`disabled:cursor-not-allowed disabled:opacity-50`,O&&`outline-danger bg-danger-bg-subtle ring-danger-weak`,!m.state.value&&`text-text-positive-muted`),children:[(0,x.jsx)(`span`,{className:`line-clamp-1`,children:j??n}),(0,x.jsx)(_.ChevronDownIcon,{size:16,className:`shrink-0 opacity-50`})]}),(0,x.jsx)(i.Dialog,{open:g,onOpenChange:e=>{b(e),e||m.handleBlur()},children:(0,x.jsxs)(i.DialogPortal,{children:[(0,x.jsx)(i.DialogOverlay,{}),(0,x.jsxs)(C.Dialog.Content,{onOpenAutoFocus:e=>e.preventDefault(),className:(0,y.cn)(`fixed inset-x-0 bottom-0 z-50`,`flex flex-col bg-background rounded-t-2xl outline-none`,`max-h-[80dvh] shadow-[0_-4px_24px_rgba(0,0,0,0.08)]`,`data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom data-[state=open]:fade-in-0`,`data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=closed]:fade-out-0`,`duration-300`),children:[(0,x.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-border shrink-0`,children:[(0,x.jsx)(`span`,{className:`font-semibold text-sm text-text-positive`,children:e??n??`Chọn một tùy chọn`}),(0,x.jsx)(i.DialogClose,{asChild:!0,children:(0,x.jsx)(`button`,{type:`button`,"aria-label":`Đóng`,className:`flex size-7 items-center justify-center rounded-md text-text-positive-weak transition-colors hover:bg-muted-muted hover:text-text-positive`,children:(0,x.jsx)(_.XIcon,{size:16})})})]}),(0,x.jsxs)(`div`,{className:`flex flex-col overflow-y-auto`,children:[A&&(0,x.jsx)(i.DialogClose,{asChild:!0,children:(0,x.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-x-2 px-4 py-3 text-left text-sm text-danger-strong transition-colors hover:bg-danger-bg-subtle`,onClick:M,children:[(0,x.jsx)(_.XIcon,{size:14}),`Xóa lựa chọn`]})}),o.length>0?o.map(e=>(0,x.jsx)(i.DialogClose,{asChild:!0,children:(0,x.jsx)(`button`,{type:`button`,className:(0,y.cn)(`flex w-full items-center px-4 py-3 text-left text-sm transition-colors`,`hover:bg-muted-muted active:bg-muted-muted`,m.state.value===e.value&&`bg-primary-bg-subtle font-medium text-primary`),onClick:()=>{m.handleChange(e.value),m.handleBlur()},children:e.label})},e.value)):(0,x.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,x.jsx)(_.PackagePlusIcon,{strokeWidth:1}),`Không có tùy chọn`]})]}),(0,x.jsx)(`div`,{className:`shrink-0 h-safe-bottom`})]})]})})]}):(0,x.jsxs)(`div`,{className:`relative`,children:[(0,x.jsxs)(d.Select,{value:m.state.value??``,disabled:E,onValueChange:m.handleChange,children:[(0,x.jsx)(d.SelectTrigger,{"aria-invalid":O?`true`:void 0,"aria-describedby":p,onBlur:m.handleBlur,children:(0,x.jsx)(d.SelectValue,{placeholder:n})}),(0,x.jsx)(d.SelectContent,{children:o.length>0?o.map(e=>(0,x.jsx)(d.SelectItem,{value:e.value,children:e.label},e.value)):(0,x.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,x.jsx)(_.PackagePlusIcon,{strokeWidth:1}),`No options available`]})})]}),A&&(0,x.jsx)(`button`,{type:`button`,"aria-label":`Xóa lựa chọn`,className:`absolute right-7 top-1/2 -translate-y-1/2 flex size-4 cursor-pointer items-center justify-center rounded-md text-text-positive-weak outline-none transition-[color,transform] hover:text-text-positive focus-visible:text-primary-strong focus-visible:[&>svg]:scale-125 [&>svg]:size-3.5 [&>svg]:transition-transform`,onClick:M,children:(0,x.jsx)(_.XIcon,{"aria-hidden":`true`})})]}),D&&f&&(0,x.jsx)(U,{id:p,className:`mt-1`,errors:m.state.meta.errors}),(0,x.jsx)(B,{isShow:!!s,children:s})]})]}),(0,x.jsx)(H,{})]})});pe.displayName=`SelectField`;function me({className:e,...t}){return(0,x.jsx)(C.Switch.Root,{"data-slot":`switch`,className:(0,y.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,x.jsx)(C.Switch.Thumb,{"data-slot":`switch-thumb`,className:(0,y.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 he=({label:e,description:t,helperText:n})=>{let r=Q();return(0,x.jsxs)(N,{className:`gap-y-4 px-4`,children:[(0,x.jsxs)(P,{orientation:`vertical`,className:`relative justify-between gap-y-1`,children:[(0,x.jsxs)(F,{children:[(0,x.jsx)(R,{className:`cursor-pointer`,children:(0,x.jsx)(`label`,{htmlFor:r.name,children:e})}),(0,x.jsx)(z,{children:t}),(0,x.jsx)(me,{id:r.name,checked:r.state.value??!1,className:`absolute top-1 right-1`,onBlur:r.handleBlur,onCheckedChange:r.handleChange})]}),(0,x.jsx)(B,{isShow:!!n,children:n})]}),(0,x.jsx)(H,{})]})},ge=e=>{e.key===`Enter`&&e.preventDefault()},_e=(0,v.memo)(({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,disabled:d=!1,maxLength:f})=>{let p=(0,v.useId)(),m=(0,v.useId)(),h=(0,v.useRef)(null),{form:g,name:b,state:S,handleBlur:C,handleChange:w}=Q(),E=(0,T.useStore)(g.store,({isSubmitting:e})=>e),D=d||E,O=S.meta.isDirty||S.meta.isTouched,k=O&&!S.meta.isValid,A=u&&S.value===null,j=S.meta.errors.length>0,M=s&&!D&&!!S.value,R=a?S.value?.length??0:0,W=a&&!!f&&R>=f*.8,G=a&&!!f&&R>=f,K=a?f?`${R} / ${f} ký tự`:`${R} ký tự`:null,q=a||O&&l,J=(0,v.useCallback)(({target:{value:e}})=>{a&&f&&e.length>f||w(e||null)},[a,f,w]),ee=(0,v.useCallback)(()=>{w(null),h.current?.focus()},[w]);return(0,x.jsxs)(N,{className:`gap-y-4 px-4`,children:[(0,x.jsxs)(P,{orientation:o,"data-invalid":k,children:[(0,x.jsxs)(F,{children:[(0,x.jsxs)(L,{"aria-required":A,htmlFor:p,children:[e,r&&(0,x.jsx)(V,{tooltip:r})]}),t&&(0,x.jsx)(z,{children:t})]}),(0,x.jsxs)(I,{children:[(0,x.jsx)(c.Input,{ref:h,id:p,name:b,value:S.value??``,"aria-invalid":k,"aria-describedby":m,autoComplete:`off`,placeholder:n,autoCapitalize:`none`,autoCorrect:`off`,disabled:D,className:(0,y.cn)(`pr-6`,D&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:C,onChange:J,onKeyDown:ge}),M&&(0,x.jsx)(`button`,{type:`button`,"aria-label":`Xóa`,className:`absolute inset-e-1 top-2.5 flex size-4 cursor-pointer items-center justify-center rounded-md text-text-positive-weak outline-none transition-[color,transform] hover:text-text-positive focus-visible:text-primary-strong focus-visible:[&>svg]:scale-125 [&>svg]:size-3.5 [&>svg]:transition-transform`,onClick:ee,children:(0,x.jsx)(_.XIcon,{"aria-hidden":`true`})}),E&&(0,x.jsx)(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-muted-weak`,children:(0,x.jsx)(_.Loader2Icon,{size:14,className:`animate-spin text-primary-strong`})}),!M&&O&&l&&j&&(0,x.jsx)(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-danger-strong`,children:(0,x.jsx)(_.BanIcon,{"aria-hidden":`true`,size:14})}),q&&(0,x.jsxs)(`div`,{className:`my-1 flex w-full items-start justify-between gap-x-2`,children:[O&&l?(0,x.jsx)(U,{id:m,className:`flex-1`,errors:S.meta.errors}):(0,x.jsx)(`div`,{}),a&&(0,x.jsx)(`p`,{className:(0,y.cn)(`h-4 flex-0 text-nowrap text-end text-xs tabular-nums transition-colors`,G?`font-medium text-danger-strong`:W?`text-warning-strong`:`text-text-positive-weak`),children:K})]}),(0,x.jsx)(B,{isShow:!!i,children:i})]})]}),(0,x.jsx)(H,{})]})});_e.displayName=`TextField`;const ve=(0,v.memo)(({label:e,description:t,placeholder:n,tooltip:r,helperText:i,counter:a=!1,orientation:o=`responsive`,showErrorMessage:s=!0,required:c=!1,disabled:l=!1,maxLength:u})=>{let d=(0,v.useId)(),f=(0,v.useId)(),[p,m]=(0,v.useState)(!1),g=(0,v.useRef)(null),{form:b,state:S,name:C,handleBlur:w,handleChange:E}=Q(),D=(0,T.useStore)(b.store,({isSubmitting:e})=>e),O=l||D,k=S.value?.length??0,A=(0,v.useMemo)(()=>a?u?`${k} / ${u} ký tự`:`${k} ký tự`:``,[k,a,u]),j=!!u&&k>=u*.8,M=!!u&&k>=u,R=S.meta.isDirty||S.meta.isTouched,W=R&&!S.meta.isValid,G=c&&S.value===null,K=!!S.meta.errors.length,q=!!S.value&&!O,J=(0,v.useMemo)(()=>(0,y.cn)(`h-4 flex-0 text-nowrap text-end text-xs tabular-nums transition-colors`,M?`font-medium text-danger-strong`:j?`text-warning-strong`:`text-text-positive-weak`),[M,j]),ee=(0,v.useCallback)(({target:{value:e}})=>{O||a&&u&&e.length>u||E(e||null)},[O,a,u,E]),te=(0,v.useCallback)(async()=>{S.value&&(await navigator.clipboard.writeText(S.value),g.current!==null&&window.clearTimeout(g.current),m(!0),g.current=window.setTimeout(()=>m(!1),1500))},[S.value]);return(0,v.useEffect)(()=>()=>{g.current!==null&&window.clearTimeout(g.current)},[]),(0,x.jsxs)(N,{className:`gap-y-4 px-4`,children:[(0,x.jsxs)(P,{orientation:o,"data-invalid":W,children:[(0,x.jsxs)(F,{children:[(0,x.jsxs)(L,{"aria-required":G,htmlFor:d,children:[e,r&&(0,x.jsx)(V,{tooltip:r})]}),(0,x.jsx)(z,{children:t})]}),(0,x.jsxs)(I,{children:[(0,x.jsx)(h.Textarea,{id:d,name:C,value:S.value??``,"aria-invalid":W,"aria-describedby":f,autoCapitalize:`none`,autoComplete:`off`,autoCorrect:`off`,placeholder:n,disabled:O,className:(0,y.cn)(O&&`pointer-events-none bg-muted-muted opacity-60`),onChange:ee,onBlur:w}),q&&(0,x.jsx)(`button`,{type:`button`,"aria-label":`Sao chép`,className:`absolute inset-e-1 top-2 flex size-4 cursor-pointer items-center justify-center rounded-md outline-none transition-[color,transform] focus-visible:[&>svg]:scale-125 [&>svg]:size-3.5 [&>svg]:transition-transform`,onClick:te,children:p?(0,x.jsx)(_.CheckIcon,{"aria-hidden":`true`,className:`text-success-strong`}):(0,x.jsx)(_.CopyIcon,{"aria-hidden":`true`,className:`text-text-positive-weak transition-colors hover:text-text-positive focus-visible:text-primary-strong`})}),D&&(0,x.jsx)(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-muted-weak`,children:(0,x.jsx)(_.Loader2Icon,{size:14,className:`animate-spin text-primary-strong`})}),!q&&R&&s&&K&&(0,x.jsx)(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-danger-strong`,children:(0,x.jsx)(_.BanIcon,{size:14})}),(0,x.jsxs)(`div`,{className:`my-1 flex w-full items-start justify-between gap-x-2`,children:[R&&s?(0,x.jsx)(U,{id:f,className:`flex-1`,errors:S.meta.errors}):(0,x.jsx)(`div`,{}),!!a&&(0,x.jsx)(`p`,{className:J,children:A})]}),(0,x.jsx)(B,{isShow:!!i,children:i})]})]}),(0,x.jsx)(H,{})]})});ve.displayName=`TextareaField`;const ye=(0,v.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,T.useStore)(s.store,({isSubmitting:e})=>e),d=c.meta.isDirty&&c.meta.isTouched&&!c.meta.isValid,f=o&&c.value===null,p=(0,v.useCallback)(e=>{u||l(e||null)},[u,l]);return(0,x.jsxs)(N,{className:`gap-y-4 px-4`,children:[(0,x.jsxs)(P,{orientation:`vertical`,"data-invalid":d,children:[(0,x.jsxs)(F,{children:[(0,x.jsxs)(L,{"aria-required":f,children:[e,r&&(0,x.jsx)(V,{tooltip:r})]}),(0,x.jsx)(z,{children:t})]}),(0,x.jsx)(g.t,{value:c.value??``,placeholder:n,readOnly:u,onChange:p}),c.meta.isDirty&&a&&!!c.meta.errors.length&&(0,x.jsx)(U,{errors:c.meta.errors}),(0,x.jsx)(B,{isShow:!!i,children:i})]}),(0,x.jsx)(H,{})]})});ye.displayName=`TextEditorField`;const be=({label:t,className:n})=>{let r=$(),i=(0,v.useCallback)(async()=>{await r.handleSubmit({submitAction:`submit`}),r.state.isSubmitSuccessful&&r.reset()},[r]);return(0,x.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,x.jsx)(e.Button,{type:`button`,size:`md`,disabled:r,isLoading:a,className:(0,y.cn)(`min-h-8 min-w-32`,n),onClick:i,children:t??`Xác nhận`})})},xe=({type:t=`create`})=>{let n=$();return(0,x.jsxs)(`div`,{className:`flex h-8 items-center justify-between`,children:[(0,x.jsx)(n.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:t})=>(0,x.jsx)(e.Button,{color:`muted`,variant:`outline`,type:`button`,size:`md`,disabled:t,className:`h-full min-w-32`,onClick:()=>n.reset(),children:`Hủy bỏ`})}),t===`create`&&(0,x.jsx)(n.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:t,isSubmitting:r})=>(0,x.jsxs)(e.Button,{type:`submit`,size:`md`,disabled:t,isLoading:r,className:`h-full min-w-32`,onClick:async()=>{await n.handleSubmit({submitAction:`create`}),n.state.isSubmitSuccessful&&n.reset()},children:[(0,x.jsx)(_.PlusIcon,{}),`Thêm mới`]})}),t===`update`&&(0,x.jsx)(n.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:t,isSubmitting:r})=>(0,x.jsxs)(e.Button,{type:`submit`,size:`md`,disabled:t,isLoading:r,className:`h-full min-w-32`,onClick:async()=>{await n.handleSubmit({submitAction:`update`}),n.state.isSubmitSuccessful&&n.reset()},children:[(0,x.jsx)(_.ArrowDownToLine,{}),`Cập nhật`]})})]})};function Se({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,x.jsx)(C.Separator.Root,{"data-slot":`separator`,decorative:n,orientation:t,className:(0,y.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 Ce=({title:t,description:n,onDelete:r,children:i})=>(0,x.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,x.jsxs)(`div`,{"data-slot":`card-form-header`,className:`flex flex-col space-y-0.5 px-4 py-3`,children:[(0,x.jsx)(`p`,{className:`font-semibold text-base tracking-tight`,children:t}),!!n&&(0,x.jsx)(`p`,{className:`text-text-positive-weak text-sm`,children:n})]}),(0,x.jsx)(Se,{}),(0,x.jsx)(`div`,{"data-slot":`card-form-main`,className:`flex flex-col py-4`,children:i}),!!r&&(0,x.jsxs)(e.Button,{color:`danger`,variant:`ghost`,size:`sm`,className:`absolute top-2.5 right-3`,onClick:e=>{r?.(),e.preventDefault(),e.stopPropagation()},children:[(0,x.jsx)(_.Trash2Icon,{}),`Remove`]})]}),we=({children:e})=>(0,x.jsx)(`div`,{"data-slot":`section-form`,className:`flex flex-col space-y-4`,children:e}),Te=({disabled:t,className:n,onClick:r,children:i})=>(0,x.jsx)(e.Button,{type:`button`,variant:`outline`,color:`muted`,disabled:t,className:(0,y.cn)(`min-w-40`,n),onClick:r,children:i??`Huỷ`}),Ee=({isSubmitting:t,submitText:n=`Xác nhận`,disabled:r,className:i,onClick:a})=>(0,x.jsx)(e.Button,{type:`button`,isLoading:t,disabled:r||t,className:(0,y.cn)(`min-w-40`,i),onClick:a,children:n}),De=({title:e,submitText:t,width:r,maxWidth:a,className:o,open:s,onOpenChange:c,children:l})=>{let u=$(),d=(0,v.useCallback)(e=>{e||u.reset(),c?.(e)},[u.reset,c]);return(0,x.jsx)(i.Dialog,{open:s,onOpenChange:d,children:(0,x.jsxs)(i.DialogPortal,{"data-slot":`dialog-portal`,children:[(0,x.jsx)(i.DialogOverlay,{}),(0,x.jsxs)(i.DialogContent,{style:{"--width":r,"--max-width":a},className:(0,y.cn)(`flex size-full max-h-dvh max-w-dvw flex-col gap-0 overflow-y-auto rounded-none p-0 shadow-dialog sm:h-auto sm:max-h-[85dvh] sm:max-w-5xl sm:rounded-md`,r&&`sm:w-(--width)`,a&&`sm:max-w-(--max-width)`,o),onOpenAutoFocus:e=>{e.preventDefault()},children:[(0,x.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,x.jsx)(i.DialogTitle,{"data-slot":`dialog-title`,className:`font-semibold text-lg tracking-tight`,children:e})}),(0,x.jsx)(n.Separator,{}),(0,x.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,x.jsx)(n.Separator,{}),(0,x.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,x.jsx)(u.Subscribe,{selector:e=>({disabled:e.isSubmitting}),children:({disabled:e})=>(0,x.jsx)(Te,{disabled:e,onClick:()=>{u.reset(),d(!1)}})}),(0,x.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,x.jsx)(Ee,{isSubmitting:e,disabled:n,submitText:t,onClick:()=>u.handleSubmit()})})]})]})]})})},Oe=({label:e,description:t,helperText:n,orientation:r=`responsive`,children:i})=>(0,x.jsxs)(N,{className:`gap-y-4 px-4`,children:[(0,x.jsxs)(P,{orientation:r,children:[(0,x.jsxs)(F,{children:[(0,x.jsx)(L,{children:e}),(0,x.jsx)(z,{children:t})]}),(0,x.jsxs)(I,{children:[i,(0,x.jsx)(B,{isShow:!!n,children:n})]})]}),(0,x.jsx)(H,{})]}),ke=({title:e,open:t,contentClassName:n,onOpenChange:i,children:a})=>{let o=$();return(0,x.jsx)(C.Dialog.Root,{"data-slot":`dialog`,open:t,onOpenChange:i,children:(0,x.jsxs)(C.Dialog.Portal,{"data-slot":`dialog-portal`,children:[(0,x.jsx)(C.Dialog.Overlay,{"data-slot":`dialog-overlay`,className:(0,y.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,x.jsx)(C.Dialog.Content,{"data-slot":`dialog-content`,className:(0,y.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,x.jsxs)(`section`,{className:`relative flex size-full flex-col`,children:[(0,x.jsx)(`header`,{className:`flex h-14 shrink-0 items-center border-b border-border px-5`,children:(0,x.jsx)(`h2`,{className:`font-semibold text-base tracking-tight text-text-positive`,children:e})}),(0,x.jsx)(`div`,{className:(0,y.cn)(`flex flex-1 flex-col overflow-y-auto py-4`,n),children:a}),(0,x.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 border-t border-border px-4 py-3`,children:[(0,x.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,x.jsx)(Ee,{isSubmitting:e,disabled:t,className:`w-full`,onClick:()=>o.handleSubmit()})}),(0,x.jsx)(o.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:e})=>(0,x.jsx)(Te,{disabled:e,className:`w-full`,onClick:()=>{o.reset(),i?.(!1)}})})]}),(0,x.jsx)(C.Dialog.Close,{asChild:!0,children:(0,x.jsx)(r.t,{className:`absolute top-2.5 right-3`})})]})})]})})},Ae=({children:e})=>(0,x.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}),je=({children:e})=>(0,x.jsx)(`main`,{"data-slot":`section-main`,className:`relative flex flex-col py-4`,children:e}),Me=({title:e,children:t})=>(0,x.jsxs)(`section`,{"data-slot":`section-form`,className:`flex flex-col rounded-md bg-background shadow-card ring-1 ring-border`,children:[(0,x.jsx)(Ae,{children:e}),(0,x.jsx)(Se,{}),(0,x.jsx)(je,{children:t})]}),Ne=({title:e,description:t,helperText:n})=>(0,x.jsxs)(N,{className:`gap-y-4 px-4`,children:[(0,x.jsxs)(P,{className:`gap-0`,children:[(0,x.jsxs)(F,{children:[(0,x.jsx)(M,{className:`mb-1`,children:e}),(0,x.jsx)(z,{children:t})]}),(0,x.jsx)(B,{isShow:!!n,children:n})]}),(0,x.jsx)(H,{})]}),{fieldContext:Pe,formContext:Fe,useFieldContext:Q,useFormContext:$}=(0,T.createFormHookContexts)(),{useAppForm:Ie,withForm:Le,withFieldGroup:Re}=(0,T.createFormHook)({fieldContext:Pe,formContext:Fe,fieldComponents:{TextField:_e,TextareaField:ve,TextEditorField:ye,NumberField:Z,EmailField:ue,PasswordField:de,SelectField:pe,ComboboxField:Y,DateField:X,SwitchField:he,RadioGroupField:fe,CheckboxField:le,SimpleTextField:ce,SimpleEmailField:J,SimplePasswordField:ae,SimpleTextareaField:se,SimpleNumberField:ie,SimpleSelectField:oe,SimpleArrayField:O,SimpleBooleanField:W,SimpleComboboxField:G,SimpleDateField:K,SimpleRadioGroupField:q,FieldGroup:N,Field:P,FieldContent:F,FieldLabel:L,FieldContentMain:I,FieldSeparator:H,FieldError:U},formComponents:{TanStackDialogForm:De,TanStackPopoverForm:ke,TanStackContainerForm:we,TanStackSectionForm:Me,TanStackCardForm:Ce,TanStackFieldGroup:Oe,TanStackTitleField:Ne,TanStackActionsForm:xe,TanStackActionSubmit:be,ArrayCol:E,ArrayHeaderRow:D}});Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(exports,"B",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return le}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,"G",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"H",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"K",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return se}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"U",{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,"V",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"W",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return _e}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return we}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return be}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return Me}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return he}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return de}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return I}});
|
|
2
|
-
//# sourceMappingURL=tanstack-form-BMVn8ai_.cjs.map
|