@mvr-ui/components 1.0.79 → 1.0.80
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/page.d.mts +4 -3
- package/dist/page.d.ts +4 -3
- package/dist/page.js +2 -2
- package/dist/page.mjs +2 -2
- package/package.json +1 -1
package/dist/page.d.mts
CHANGED
|
@@ -302,13 +302,14 @@ declare const SelectPrimitive: typeof Select;
|
|
|
302
302
|
interface SwitchProps extends Omit<React__default.InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
303
303
|
label?: string;
|
|
304
304
|
description?: string;
|
|
305
|
+
checked?: boolean;
|
|
305
306
|
className?: string;
|
|
306
307
|
overrideClassName?: boolean;
|
|
307
308
|
error?: string;
|
|
308
309
|
}
|
|
309
310
|
declare const SwitchPrimitive: (props: SwitchProps & React__default.RefAttributes<HTMLInputElement>) => react_jsx_runtime.JSX.Element;
|
|
310
311
|
|
|
311
|
-
interface
|
|
312
|
+
interface TextAreaProps extends React__default.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
312
313
|
label?: string;
|
|
313
314
|
required?: boolean;
|
|
314
315
|
showCount?: boolean;
|
|
@@ -318,7 +319,7 @@ interface TextareaProps extends React__default.TextareaHTMLAttributes<HTMLTextAr
|
|
|
318
319
|
error?: string;
|
|
319
320
|
helperText?: string;
|
|
320
321
|
}
|
|
321
|
-
declare const
|
|
322
|
+
declare const TextAreaPrimitive: (props: TextAreaProps & React__default.RefAttributes<HTMLTextAreaElement>) => react_jsx_runtime.JSX.Element;
|
|
322
323
|
|
|
323
324
|
interface ValidateFieldProps {
|
|
324
325
|
children: React.ReactNode;
|
|
@@ -327,4 +328,4 @@ interface ValidateFieldProps {
|
|
|
327
328
|
}
|
|
328
329
|
declare const ValidateFieldPrimitive: (props: ValidateFieldProps) => react_jsx_runtime.JSX.Element;
|
|
329
330
|
|
|
330
|
-
export { AccordionItemData, AccordionPrimitive, AccordionProps, ButtonPrimitive, ButtonProps, CardContentPrimitive, CardContentProps, CardDescriptionPrimitive, CardDescriptionProps, CardFooterPrimitive, CardFooterProps, CardHeaderPrimitive, CardHeaderProps, CardPrimitive, CardProps, CardTitlePrimitive, CardTitleProps, CheckBoxGroupPrimitive, CheckBoxPrimitive, CheckBoxProps, ComboBoxPrimitive, DropdownMenuContentPrimitive, DropdownMenuContentProps, DropdownMenuItemPrimitive, DropdownMenuItemProps, DropdownMenuLabelPrimitive, DropdownMenuLabelProps, DropdownMenuPrimitive, DropdownMenuProps, DropdownMenuSeparatorPrimitive, DropdownMenuSeparatorProps, DropdownMenuTriggerPrimitive, DropdownMenuTriggerProps, HelperFieldPrimitive, HelperFieldProps, InputPrimitive, InputProps, LabelPrimitive, LabelProps, LicenseProvider, OtpInputPrimitive, OtpInputProps, RadioGroupPrimitive, RadioPrimitive, RadioProps, SelectPrimitive, SelectProps, SwitchPrimitive, SwitchProps,
|
|
331
|
+
export { AccordionItemData, AccordionPrimitive, AccordionProps, ButtonPrimitive, ButtonProps, CardContentPrimitive, CardContentProps, CardDescriptionPrimitive, CardDescriptionProps, CardFooterPrimitive, CardFooterProps, CardHeaderPrimitive, CardHeaderProps, CardPrimitive, CardProps, CardTitlePrimitive, CardTitleProps, CheckBoxGroupPrimitive, CheckBoxPrimitive, CheckBoxProps, ComboBoxPrimitive, DropdownMenuContentPrimitive, DropdownMenuContentProps, DropdownMenuItemPrimitive, DropdownMenuItemProps, DropdownMenuLabelPrimitive, DropdownMenuLabelProps, DropdownMenuPrimitive, DropdownMenuProps, DropdownMenuSeparatorPrimitive, DropdownMenuSeparatorProps, DropdownMenuTriggerPrimitive, DropdownMenuTriggerProps, HelperFieldPrimitive, HelperFieldProps, InputPrimitive, InputProps, LabelPrimitive, LabelProps, LicenseProvider, OtpInputPrimitive, OtpInputProps, RadioGroupPrimitive, RadioPrimitive, RadioProps, SelectPrimitive, SelectProps, SwitchPrimitive, SwitchProps, TextAreaPrimitive, TextAreaProps, ValidateFieldPrimitive, ValidateFieldProps };
|
package/dist/page.d.ts
CHANGED
|
@@ -302,13 +302,14 @@ declare const SelectPrimitive: typeof Select;
|
|
|
302
302
|
interface SwitchProps extends Omit<React__default.InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
303
303
|
label?: string;
|
|
304
304
|
description?: string;
|
|
305
|
+
checked?: boolean;
|
|
305
306
|
className?: string;
|
|
306
307
|
overrideClassName?: boolean;
|
|
307
308
|
error?: string;
|
|
308
309
|
}
|
|
309
310
|
declare const SwitchPrimitive: (props: SwitchProps & React__default.RefAttributes<HTMLInputElement>) => react_jsx_runtime.JSX.Element;
|
|
310
311
|
|
|
311
|
-
interface
|
|
312
|
+
interface TextAreaProps extends React__default.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
312
313
|
label?: string;
|
|
313
314
|
required?: boolean;
|
|
314
315
|
showCount?: boolean;
|
|
@@ -318,7 +319,7 @@ interface TextareaProps extends React__default.TextareaHTMLAttributes<HTMLTextAr
|
|
|
318
319
|
error?: string;
|
|
319
320
|
helperText?: string;
|
|
320
321
|
}
|
|
321
|
-
declare const
|
|
322
|
+
declare const TextAreaPrimitive: (props: TextAreaProps & React__default.RefAttributes<HTMLTextAreaElement>) => react_jsx_runtime.JSX.Element;
|
|
322
323
|
|
|
323
324
|
interface ValidateFieldProps {
|
|
324
325
|
children: React.ReactNode;
|
|
@@ -327,4 +328,4 @@ interface ValidateFieldProps {
|
|
|
327
328
|
}
|
|
328
329
|
declare const ValidateFieldPrimitive: (props: ValidateFieldProps) => react_jsx_runtime.JSX.Element;
|
|
329
330
|
|
|
330
|
-
export { AccordionItemData, AccordionPrimitive, AccordionProps, ButtonPrimitive, ButtonProps, CardContentPrimitive, CardContentProps, CardDescriptionPrimitive, CardDescriptionProps, CardFooterPrimitive, CardFooterProps, CardHeaderPrimitive, CardHeaderProps, CardPrimitive, CardProps, CardTitlePrimitive, CardTitleProps, CheckBoxGroupPrimitive, CheckBoxPrimitive, CheckBoxProps, ComboBoxPrimitive, DropdownMenuContentPrimitive, DropdownMenuContentProps, DropdownMenuItemPrimitive, DropdownMenuItemProps, DropdownMenuLabelPrimitive, DropdownMenuLabelProps, DropdownMenuPrimitive, DropdownMenuProps, DropdownMenuSeparatorPrimitive, DropdownMenuSeparatorProps, DropdownMenuTriggerPrimitive, DropdownMenuTriggerProps, HelperFieldPrimitive, HelperFieldProps, InputPrimitive, InputProps, LabelPrimitive, LabelProps, LicenseProvider, OtpInputPrimitive, OtpInputProps, RadioGroupPrimitive, RadioPrimitive, RadioProps, SelectPrimitive, SelectProps, SwitchPrimitive, SwitchProps,
|
|
331
|
+
export { AccordionItemData, AccordionPrimitive, AccordionProps, ButtonPrimitive, ButtonProps, CardContentPrimitive, CardContentProps, CardDescriptionPrimitive, CardDescriptionProps, CardFooterPrimitive, CardFooterProps, CardHeaderPrimitive, CardHeaderProps, CardPrimitive, CardProps, CardTitlePrimitive, CardTitleProps, CheckBoxGroupPrimitive, CheckBoxPrimitive, CheckBoxProps, ComboBoxPrimitive, DropdownMenuContentPrimitive, DropdownMenuContentProps, DropdownMenuItemPrimitive, DropdownMenuItemProps, DropdownMenuLabelPrimitive, DropdownMenuLabelProps, DropdownMenuPrimitive, DropdownMenuProps, DropdownMenuSeparatorPrimitive, DropdownMenuSeparatorProps, DropdownMenuTriggerPrimitive, DropdownMenuTriggerProps, HelperFieldPrimitive, HelperFieldProps, InputPrimitive, InputProps, LabelPrimitive, LabelProps, LicenseProvider, OtpInputPrimitive, OtpInputProps, RadioGroupPrimitive, RadioPrimitive, RadioProps, SelectPrimitive, SelectProps, SwitchPrimitive, SwitchProps, TextAreaPrimitive, TextAreaProps, ValidateFieldPrimitive, ValidateFieldProps };
|
package/dist/page.js
CHANGED
|
@@ -13,7 +13,7 @@ var Tr__default = /*#__PURE__*/_interopDefault(Tr);
|
|
|
13
13
|
var Te=Ut.createContext(void 0),Ft=({message:e})=>jsxRuntime.jsx("div",{className:"flex justify-center items-center h-screen min-w-full bg-red-50 dark:bg-red-900/10 text-red-800 dark:text-red-200 text-xl text-center p-8 transition-colors duration-300",children:jsxRuntime.jsxs("div",{className:"max-w-md animate-[fadeIn_0.5s_ease-in-out]",children:[jsxRuntime.jsxs("h1",{className:"text-3xl font-bold mb-4 flex items-center justify-center gap-2",children:[jsxRuntime.jsx("span",{className:"animate-[bounce_1s_infinite]",children:"\u26A0\uFE0F"}),"Erro de Licen\xE7a"]}),jsxRuntime.jsx("p",{className:"mb-4 text-red-600 dark:text-red-300",children:e}),jsxRuntime.jsx("p",{className:"text-lg text-red-600 dark:text-red-400",children:"Por favor, entre em contato com o suporte."}),jsxRuntime.jsx("button",{onClick:()=>window.location.reload(),className:"mt-6 px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700 transition-colors",children:"Tentar novamente"})]})}),St=({children:e,licenseKey:t})=>{let[r,n]=Ut.useState(!1),[o,i]=Ut.useState(null),[a,s]=Ut.useState(!0),l=f=>{if(i(null),!f)throw new Error("\u{1F512} Chave de licen\xE7a \xE9 obrigat\xF3ria");let c="chave-secreta-123";if(f!==c)throw new Error("\u274C Chave de licen\xE7a inv\xE1lida");n(!0);};return Ut.useEffect(()=>{if(t){s(!0);try{l(t);}catch(f){i(f instanceof Error?f.message:"Erro desconhecido na valida\xE7\xE3o da licen\xE7a");}finally{s(!1);}}else i("\u{1F512} Licen\xE7a n\xE3o informada"),s(!1);},[t]),a?null:jsxRuntime.jsx(Te.Provider,{value:{isLicenseValid:r,validateLicense:l,licenseError:o},children:r?e:jsxRuntime.jsx(Ft,{message:o||"Licen\xE7a inv\xE1lida"})})},ye=()=>{let e=Ut.useContext(Te);if(!e)throw new Error("useLicense deve ser usado dentro de um LicenseProvider");return e};var Pe=({message:e="Component locked - Please validate your license"})=>jsxRuntime.jsxs("div",{className:"flex items-start p-4 bg-red-50 border border-red-500 text-red-700 rounded-md gap-2",children:[jsxRuntime.jsx("span",{children:" \u274C Component locked - Please validate your license"}),jsxRuntime.jsx("span",{children:e})]});var g=e=>t=>{let{isLicenseValid:r}=ye();return r?jsxRuntime.jsx(e,{...t}):jsxRuntime.jsx(Pe,{})};var Ee=({items:e,type:t="single",defaultValue:r,value:n,onValueChange:o,className:i=""})=>{let a=c=>c===void 0?[]:Array.isArray(c)?c:[c],[s,l]=Ut.useState(a(n??r));Ut.useEffect(()=>{n!==void 0&&l(a(n));},[n]);let f=Ut.useCallback(c=>{l(x=>{let h;return t==="single"?h=x.includes(c)?[]:[c]:h=x.includes(c)?x.filter(d=>d!==c):[...x,c],o?.(t==="single"?h[0]??"":h),h});},[t,o]);return jsxRuntime.jsx("div",{className:`space-y-2 ${i}`,children:e.map(c=>jsxRuntime.jsx(Ot,{...c,isOpen:s.includes(c.id),onToggle:()=>f(c.id)},c.id))})},Ot=({title:e,content:t,disabled:r=!1,isOpen:n,onToggle:o})=>jsxRuntime.jsxs("div",{className:"border border-border rounded-md overflow-hidden",children:[jsxRuntime.jsx("button",{onClick:o,disabled:r,className:`w-full px-4 py-3 text-left font-medium transition-colors
|
|
14
14
|
${r?"opacity-50 cursor-not-allowed":"hover:bg-accent hover:text-accent-foreground"}
|
|
15
15
|
${n?"bg-accent text-accent-foreground":"bg-background text-foreground"}
|
|
16
|
-
`,children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{children:e}),jsxRuntime.jsx("svg",{className:`w-5 h-5 transition-transform ${n?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})}),n&&jsxRuntime.jsx("div",{className:"px-4 py-3 bg-background border-t border-border",children:t})]});Ee.displayName="Accordion";var pn=g(Ee);function u(...e){return tailwindMerge.twMerge(Tr.clsx(e))}var Ne=Ut__default.default.forwardRef(({className:e,overrideClassName:t,variant:r="primary",size:n="md",href:o,children:i,loading:a=!1,loadingContent:s,...l},f)=>{let c="inline-flex items-center justify-center rounded-lg font-medium cursor-pointer active:translate-y-1 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",x={primary:"bg-blue-600 text-white hover:bg-blue-700 shadow-md focus-visible:ring-blue-500",secondary:"bg-gray-600 text-white hover:bg-gray-700 shadow-sm focus-visible:ring-gray-500",tertiary:"bg-purple-600 text-white hover:bg-purple-700 shadow-sm focus-visible:ring-purple-500",destructive:"bg-red-600 text-white hover:bg-red-700 shadow-sm focus-visible:ring-red-500",success:"bg-green-600 text-white hover:bg-green-700 shadow-sm focus-visible:ring-green-500",warning:"bg-amber-500 text-white hover:bg-amber-600 shadow-sm focus-visible:ring-amber-500",info:"bg-cyan-600 text-white hover:bg-cyan-700 shadow-sm focus-visible:ring-cyan-500",accent:"bg-violet-600 text-white hover:bg-violet-700 shadow-sm focus-visible:ring-violet-500",outline:"border border-gray-300 bg-transparent text-gray-700 hover:bg-gray-50 shadow-sm focus-visible:ring-gray-500",ghost:"bg-transparent text-gray-700 hover:bg-gray-100 focus-visible:ring-gray-500",link:"text-blue-600 underline-offset-4 hover:underline bg-transparent p-0 h-auto shadow-none",gradient:"bg-gradient-to-r from-blue-600 to-purple-600 text-white hover:from-blue-700 hover:to-purple-700 shadow-md focus-visible:ring-blue-500",glass:"bg-white/10 backdrop-blur-md border border-white/20 text-black hover:bg-white/20 shadow-sm focus-visible:ring-white/50",soft:"bg-blue-100 text-blue-700 hover:bg-blue-200 shadow-sm focus-visible:ring-blue-500",dark:"bg-gray-900 text-white hover:bg-gray-800 shadow-md focus-visible:ring-gray-500",light:"bg-gray-100 text-gray-900 hover:bg-gray-200 shadow-sm focus-visible:ring-gray-500",obsidian:"bg-black text-white hover:bg-gray-900 shadow-md border border-gray-800 focus-visible:ring-gray-700",polar:"bg-white text-gray-900 hover:bg-gray-50 shadow-md border border-gray-300 focus-visible:ring-gray-400"},h={xs:"h-7 px-2 text-xs min-w-16",sm:"h-9 px-3 text-sm min-w-20",md:"h-10 px-4 py-2 text-base min-w-24",lg:"h-11 px-6 text-lg min-w-28",xl:"h-12 px-8 text-xl min-w-32"},d=t?e:u(c,x[r],h[n],e);return o?jsxRuntime.jsx("a",{href:o,className:d,ref:f,children:a&&s?s:i}):jsxRuntime.jsx("button",{className:d,ref:f,...l,children:a&&s?s:i})});Ne.displayName="Button";var Tn=g(Ne);var Me=Ut.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx("div",{ref:o,className:t?e:u("rounded-lg border bg-card text-card-foreground shadow-sm",e),...n,children:r}));Me.displayName="Card";var Ie=Ut.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx("div",{ref:o,className:t?e:u("flex flex-col space-y-1.5 p-6",e),...n,children:r}));Ie.displayName="CardHeader";var He=Ut.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx("h3",{ref:o,className:t?e:u("text-2xl font-semibold leading-none tracking-tight",e),...n,children:r}));He.displayName="CardTitle";var Ve=Ut.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx("p",{ref:o,className:t?e:u("text-sm text-muted-foreground",e),...n,children:r}));Ve.displayName="CardDescription";var Fe=Ut.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx("div",{ref:o,className:t?e:u("p-6 pt-0",e),...n,children:r}));Fe.displayName="CardContent";var Se=Ut.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx("div",{ref:o,className:t?e:u("flex items-center p-6 pt-0",e),...n,children:r}));Se.displayName="CardFooter";var kn=g(Me),Nn=g(Ie),Mn=g(He),In=g(Ve),Hn=g(Fe),Vn=g(Se);var ne=Ut.createContext(void 0),Ae=Ut.forwardRef(({children:e,className:t,...r},n)=>{let[o,i]=Ut.useState(!1);return jsxRuntime.jsx(ne.Provider,{value:{isOpen:o,setIsOpen:i},children:jsxRuntime.jsx("div",{ref:n,className:u("relative inline-block",t),...r,children:e})})});Ae.displayName="DropdownMenu";var $e=({children:e,asChild:t})=>{let r=Ut.useContext(ne);if(!r)throw new Error("DropdownMenuTrigger must be used within DropdownMenu");let n=()=>r.setIsOpen(!r.isOpen);if(t){let o=e;return Ut.cloneElement(o,{onClick:i=>{o.props.onClick?.(i),n();}})}return jsxRuntime.jsx("button",{onClick:n,children:e})};$e.displayName="DropdownMenuTrigger";var Be=Ut.forwardRef(({children:e,align:t="end",className:r,...n},o)=>{let i=Ut.useContext(ne),a=Ut.useRef(null);return Ut.useEffect(()=>{o&&(typeof o=="function"?o(a.current):o.current=a.current);},[o]),Ut.useEffect(()=>{let l=f=>{a.current&&!a.current.contains(f.target)&&i?.setIsOpen(!1);};return i?.isOpen&&document.addEventListener("mousedown",l),()=>{document.removeEventListener("mousedown",l);}},[i?.isOpen]),i?.isOpen?jsxRuntime.jsx("div",{ref:a,className:u("absolute z-50 mt-2 min-w-32 overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md",{start:"left-0",center:"left-1/2 -translate-x-1/2",end:"right-0"}[t],r),...n,children:e}):null});Be.displayName="DropdownMenuContent";var Oe=Ut.forwardRef(({children:e,onClick:t,destructive:r,className:n,...o},i)=>{let a=Ut.useContext(ne);return jsxRuntime.jsx("button",{ref:i,onClick:l=>{t?.(l),a?.setIsOpen(!1);},className:u("w-full text-left px-4 py-2 text-sm hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none",r&&"text-red-600 hover:bg-red-50 hover:text-red-700 focus:bg-red-50 focus:text-red-700",n),...o,children:e})});Oe.displayName="DropdownMenuItem";var Ge=Ut.forwardRef(({className:e,...t},r)=>jsxRuntime.jsx("div",{ref:r,className:u("-mx-1 my-1 h-px bg-border",e),...t}));Ge.displayName="DropdownMenuSeparator";var Ke=Ut.forwardRef(({children:e,className:t,...r},n)=>jsxRuntime.jsx("div",{ref:n,className:u("px-2 py-1.5 text-sm font-semibold",t),...r,children:e}));Ke.displayName="DropdownMenuLabel";var On=g(Ae),Gn=g($e),Kn=g(Be),Un=g(Oe),qn=g(Ge),_n=g(Ke);var zt=({children:e,className:t,overrideClassName:r})=>{if(e)return jsxRuntime.jsx("p",{className:r?t:u("text-sm text-muted-foreground",t),children:e})},I=g(zt);var Zt=({children:e,required:t,className:r,overrideClassName:n=!1,...o})=>jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("label",{...o,className:n?r:u("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),children:e}),t&&jsxRuntime.jsx("span",{className:"text-red-600",children:"*"})]}),L=g(Zt);var Yt=({children:e,className:t,overrideClassName:r})=>{if(e)return jsxRuntime.jsx("p",{className:r?t:u("text-sm text-red-600 dark:text-red-400",t),children:e})},H=g(Yt);var _e=Ut.forwardRef(({label:e,required:t,option:r,orientation:n="left",className:o,overrideClassName:i=!1,helperText:a,error:s,...l},f)=>{let c=Ut.useId(),x=u("h-4 w-4 rounded border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s&&"border-destructive",o);return jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(L,{required:t,children:e}),jsxRuntime.jsxs("div",{className:`flex ${n=="left"?"flex-row":"flex-row-reverse"} w-fit gap-2`,children:[jsxRuntime.jsx("input",{id:c,type:"checkbox",className:i?o:x,ref:f,...l}),r&&jsxRuntime.jsx(L,{htmlFor:c,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r})]}),s&&jsxRuntime.jsx(H,{children:s}),!s&&a&&jsxRuntime.jsx(I,{children:a})]})});_e.displayName="CheckBox";var uo=g(_e);function or(e,t){let{typeSet:r="field",multiCheck:n=!1,value:o,onChange:i,labelKey:a,valueKey:s,options:l,alignment:f="vertical",className:c,overrideClassName:x=!1,helperText:h,error:d,label:P,name:R,required:v,...T}=e,k=Ut.useId(),y=Ut.useMemo(()=>new Map(l.map(b=>[String(b[s]),b])),[l,s]),M=Ut.useMemo(()=>o==null?[]:r==="field"?n?o.map(b=>String(b)):[String(o)]:n?o.map(b=>String(b[s])):[String(o[s])],[o,r,n,s]),S=(b,w)=>{if(!i)return;let m;if(r==="field")if(n)m=b.map(C=>{let E=y.get(C);return E?E[s]:C});else {let p=b[0];if(!p)m=void 0;else {let C=y.get(p);m=C?C[s]:p;}}else n?m=b.map(C=>y.get(C)).filter(C=>C!==void 0):m=y.get(b[0]??"")??void 0;i({target:{name:R,value:m,type:"checkboxgroup",checked:w}});},V=b=>{let w;n?w=M.includes(b)?M.filter(m=>m!==b):[...M,b]:w=M[0]===b?[]:[b],S(w,w.includes(b));},N=f==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",F=u("h-4 w-4 rounded border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",d&&"border-destructive");return jsxRuntime.jsxs("div",{className:u("flex flex-col gap-3",c),children:[P&&jsxRuntime.jsx(L,{required:v,children:P}),jsxRuntime.jsx("div",{className:N,children:l.map((b,w)=>{let m=String(b[s]),p=M.includes(m),C=`${k}-${m}-${w}`;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{...T,id:C,ref:t,type:"checkbox",name:R,checked:p,onChange:()=>V(m),className:x?c:F}),jsxRuntime.jsx(L,{htmlFor:C,children:String(b[a])})]},C)})}),!!d&&jsxRuntime.jsx(H,{children:String(d)}),!d&&h&&jsxRuntime.jsx(I,{children:h})]})}function ar(){let e=Ut.forwardRef(or);return e.displayName="CheckBoxGroup",e}var ir=ar(),Po=g(ir);var sr=({...e})=>jsxRuntime.jsx("svg",{...e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),oe=sr;var cr=(e,t)=>{Ut.useEffect(()=>{let r=n=>{e.current&&!e.current.contains(n.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},Xe=cr;function de({options:e,labelKey:t,valueKey:r,multiple:n,onChange:o,setSearchTerm:i,typeSet:a,name:s}){let[l,f]=Ut.useState([]),c=Ut.useMemo(()=>new Map(e.map(v=>[String(v[r]),v])),[e,r]),x=Ut.useCallback(()=>l.map(v=>c.get(v)).filter(v=>!!v),[l,c]),h=Ut.useCallback(v=>{if(!o)return;let T;if(a==="field"?n?T=v:T=v[0]??void 0:n?T=v.map(y=>c.get(y)).filter(y=>y!==void 0):T=c.get(v[0]??"")??void 0,i&&!n){let k=c.get(v[0]??"");k&&i(String(k[t]));}o({target:{name:s,value:T,type:"combobox"}});},[n,o,c,s,a,i,t]),d=Ut.useCallback(v=>{let T=String(v[r]),k=n?l.includes(T)?l.filter(y=>y!==T):[...l,T]:[T];f(k),h(k);},[n,l,h,r]),P=Ut.useCallback(v=>{let T=l.filter(k=>k!==v);f(T),h(T);},[l,h]),R=Ut.useCallback(()=>{f([]),i?.("");let v;a==="field"?v=n?[]:"":v=n?[]:void 0,o?.({target:{name:s,value:v,type:"combobox"}});},[n,o,s,i,a]);return {selectedValues:l,handleSelect:d,handleRemove:P,handleClear:R,getSelectedOptions:x}}function me(e,t,r){return Ut.useMemo(()=>r?e.filter(o=>String(o[t]).toLowerCase().includes(r.toLowerCase())):e,[e,r,t])}var je=({isOpen:e,setIsOpen:t,multiple:r,searchTerm:n,setSearchTerm:o,selectedValues:i,filteredOptions:a,highlightedIndex:s,setHighlightedIndex:l,handleSelect:f,handleRemove:c})=>{let x=Ut.useCallback(d=>{if(a.length===0){l(-1);return}l(P=>P<0?d>0?0:a.length-1:(P+d+a.length)%a.length);},[a,l]);return Ut.useCallback(d=>{if(!e){if(d.key==="Enter"||d.key==="ArrowDown"){t(!0),l(0),d.preventDefault();return}r&&d.key==="Backspace"&&n===""&&i.length>0&&(d.preventDefault(),c(i[i.length-1]));return}switch(d.key){case"ArrowDown":d.preventDefault(),x(1);break;case"ArrowUp":d.preventDefault(),x(-1);break;case"Enter":d.preventDefault();let P=s>=0?s:0,R=a[P];R&&f(R),r&&o&&o(""),r||(t(!1),l(-1));break;case"Escape":d.preventDefault(),t(!1),l(-1),r||o("");break;case"Tab":t(!1),l(-1);break;case"Home":d.preventDefault(),a.length>0&&l(0);break;case"End":d.preventDefault(),a.length>0&&l(a.length-1);break;case"Backspace":r&&n===""&&i.length>0&&(d.preventDefault(),c(i[i.length-1]));break}},[e,r,n,i,a,s,t,o,l,f,c,x])};function Ye({option:e,labelKey:t,valueKey:r,onRemove:n}){let o=String(e[t]),i=String(e[r]);return jsxRuntime.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded",children:[o,jsxRuntime.jsx("button",{type:"button",onMouseDown:a=>a.preventDefault(),onClick:()=>n(i),className:"hover:bg-blue-200 dark:hover:bg-blue-800 rounded-full p-0.5 transition-colors","aria-label":`Remover ${o}`,children:"\u2715"})]},i)}function xr(e,t){let{label:r,required:n=!1,name:o,placeholder:i="Buscar...",labelKey:a,valueKey:s,options:l,value:f,onChange:c,mode:x="single",typeSet:h="field",disabled:d=!1,ClearEnabled:P=!0,helperText:R,error:v=!1,className:T="",...k}=e,y=x==="multiple",[M,S]=Ut.useState(!1),[V,N]=Ut.useState(""),F=Ut.useRef(null),b=Ut.useRef(null),w=Ut.useRef(null);Ut.useImperativeHandle(t,()=>w.current),Xe(b,()=>S(!1));let m=me(l,a,V),[p,C]=Ut.useState(-1),{selectedValues:E,handleSelect:z,handleRemove:xe,handleClear:Rt,getSelectedOptions:he}=de({options:l,labelKey:a,valueKey:s,value:f,multiple:y,onChange:c,typeSet:h,name:o,setSearchTerm:N}),Et=je({isOpen:M,setIsOpen:S,multiple:y,searchTerm:V,setSearchTerm:N,selectedValues:E,filteredOptions:m,highlightedIndex:p,setHighlightedIndex:C,handleSelect:z,handleRemove:xe}),X=Ut.useId(),kt="w-full bg-transparent outline-none placeholder:text-gray-500 dark:placeholder:text-gray-400 text-gray-900 dark:text-gray-100",Nt=u("relative w-full min-h-[40px] px-3 py-2 border rounded-md bg-white dark:bg-gray-800",v?"border-red-500":"border-gray-300 dark:border-gray-600",d?"opacity-50 cursor-not-allowed":"cursor-text","focus-within:ring-2 focus-within:ring-blue-500 focus-within:border-blue-500");return jsxRuntime.jsxs("div",{className:`space-y-2 ${T}`,children:[r&&jsxRuntime.jsx(L,{htmlFor:X,required:n,children:r}),jsxRuntime.jsxs("div",{ref:F,className:"relative",children:[jsxRuntime.jsxs("div",{className:Nt,children:[y&&he().length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:he().map((D,$)=>jsxRuntime.jsx(Ye,{option:D,labelKey:a,valueKey:s,onRemove:xe},String(D[s]??$)))}),jsxRuntime.jsx("input",{ref:w,...k,name:o,type:"text",placeholder:i,value:V,onChange:D=>{let $=D.target.value;N($),!M&&$.trim()!==""&&S(!0);},onKeyDown:Et,onMouseDown:D=>{document.activeElement===w.current&&(D.preventDefault(),S($=>{let Z=!$;return Z&&C(0),Z}));},onFocus:()=>{S(!0),C(0);},disabled:d,className:kt,role:"combobox","aria-expanded":M,"aria-controls":X,"aria-activedescendant":p>=0?`${X}-opt-${p}`:void 0}),P&&!!E.length&&jsxRuntime.jsx("button",{type:"button",onMouseDown:D=>D.preventDefault(),onClick:Rt,className:"absolute right-2 top-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700",title:"Limpar sele\xE7\xE3o",children:jsxRuntime.jsx(oe,{width:12,height:12})})]}),M&&jsxRuntime.jsx("div",{ref:b,id:X,className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto",role:"listbox","aria-multiselectable":y||void 0,children:m.length===0?jsxRuntime.jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"Nenhum resultado encontrado"}):m.map((D,$)=>{let Z=String(D[s]),ie=E.includes(Z),se=$===p;return jsxRuntime.jsx("button",{id:`${X}-opt-${$}`,"data-index":$,role:"option","aria-selected":ie,type:"button",onMouseDown:Mt=>Mt.preventDefault(),onClick:()=>z(D),className:u("w-full px-3 py-2 text-left text-sm transition-colors",se&&"bg-blue-100 dark:bg-blue-800 text-blue-900 dark:text-white",!se&&ie&&"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300",!ie&&!se&&"text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),children:jsxRuntime.jsx("span",{children:String(D[a])})},Z)})})]}),v&&jsxRuntime.jsx(H,{children:v}),!v&&R&&jsxRuntime.jsx(I,{children:R})]})}function hr(){let e=Ut.forwardRef(xr);return e.displayName="ComboBox",e}var Cr=hr(),Qo=g(Cr);var yr=({children:e,before:t,after:r,className:n})=>{let i=Tr__default.default("flex justify-center items-center",{"rounded-l-lg":t,"rounded-r-lg":r},n);return jsxRuntime.jsx("div",{className:i,children:jsxRuntime.jsx("span",{children:e})})},ge=yr;var wr=({children:e})=>jsxRuntime.jsx("div",{className:"absolute px-2",children:jsxRuntime.jsx("span",{children:e})}),tt=wr;var Pr=({children:e})=>jsxRuntime.jsx("div",{className:"absolute right-0 px-2",children:jsxRuntime.jsx("span",{children:e})}),nt=Pr;function ot(e){e.currentTarget.maxLength=9;let t=e.currentTarget.value;return t=t.replace(/\D/g,""),t=t.replace(/^(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function at(e){let t=e.currentTarget.value;t=t.replace(/\D/g,""),t=t.padStart(3,"0");let r=t.slice(0,-2),n=t.slice(-2),a=`${(r.replace(/^0+/,"")||"0").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1.")},${n}`;return e.currentTarget.value=a,e}function it(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value;return t.match(/^(\d{3}).(\d{3}).(\d{3})-(\d{2})$/)||(t=t.replace(/\D/g,""),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2"),e.currentTarget.value=t),e}function st(e){e.currentTarget.maxLength=15;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function lt(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{4})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function ct(e){let t=e.currentTarget.value.replace(/\D/g,"");return t.length<=11?(e.currentTarget.maxLength=14,t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2")):(e.currentTarget.maxLength=18,t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2")),e.currentTarget.value=t,e}function dt(e){e.currentTarget.maxLength=12;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{1})$/,"$1-$2"),e.currentTarget.value=t,e}function mt(e){e.currentTarget.maxLength=18;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2"),e.currentTarget.value=t,e}var Lr=({e,mask:t})=>{switch(t){case"money":return at(e);case"mobile":return st(e);case"phone":return lt(e);case"cpfCnpj":return ct(e);case"cpf":return it(e);case"rg":return dt(e);case"cnpj":return mt(e);case"cep":return ot(e);default:return e}},pt=Lr;var kr=({mask:e,initialValue:t=""})=>{let[r,n]=Ut.useState(t);Ut.useEffect(()=>{t!==r&&n(t);},[t]);let o=Ut.useCallback(a=>{let l=pt({e:a,mask:e})?.currentTarget?.value??a.currentTarget.value;n(l);},[e]),i=Ut.useCallback(()=>n(""),[]);return {value:r,setValue:n,handleChange:o,handleClear:i}},ft=kr;var gt=Ut.forwardRef(({label:e,required:t=!1,mask:r,name:n,prefix:o,suffix:i,addonBefore:a,addonBeforeClassName:s,addonAfter:l,addonAfterClassName:f,ClearEnabled:c=!0,className:x,overrideClassName:h=!1,error:d,helperText:P,value:R=void 0,onChange:v,...T},k)=>{let y=Ut.useId(),{handleChange:M,handleClear:S,setValue:V}=ft({mask:r,initialValue:R}),N=u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",d&&"border-destructive focus-visible:ring-destructive",!o&&!i&&"px-3",o&&!i&&"pl-10 pr-3",i&&!o&&"pl-3 pr-10",o&&i&&"pl-10 pr-10",a&&"rounded-l-none border-l-0",l&&"rounded-r-none border-r-0",x),F=w=>{M(w),v?.(w);},b=()=>{S(),V(""),v?.({target:{name:n||"",value:""}});};return jsxRuntime.jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsxRuntime.jsx(L,{htmlFor:y,required:t,children:e}),jsxRuntime.jsxs("div",{className:"relative flex",children:[a&&jsxRuntime.jsx(ge,{before:!0,className:s,children:a}),jsxRuntime.jsxs("div",{className:"relative flex items-center w-full",children:[o&&jsxRuntime.jsx(tt,{children:o}),jsxRuntime.jsx("input",{id:y,ref:k,name:n,onChange:F,className:h?x:N,...T}),c&&R&&jsxRuntime.jsx(oe,{onClick:b,width:12,height:12,className:u("absolute right-2 cursor-pointer",i&&"right-8")}),i&&jsxRuntime.jsx(nt,{children:i})]}),l&&jsxRuntime.jsx(ge,{after:!0,className:f,children:l})]}),d&&jsxRuntime.jsx(H,{children:d}),!d&&P&&jsxRuntime.jsx(I,{children:P})]})});gt.displayName="Input";var Ra=g(gt);var vt=Ut.forwardRef(({length:e=6,groupBy:t,value:r,name:n,label:o,required:i=!1,helperText:a,error:s,onChange:l,onBlur:f,className:c,charType:x="numeric",customPattern:h,caseMode:d="none",...P},R)=>{let v=Ut.useId(),T=Ut.useRef([]),k=m=>{switch(d){case"upper":return m.toUpperCase();case"lower":case"visual-upper":return m.toLowerCase();case"visual-lower":return m.toUpperCase();default:return m}},y=m=>{if(!m)return "";let p=m.slice(0,1);switch(p=k(p),x){case"numeric":return /\d/.test(p)?p:"";case"alpha":return /[A-Za-z]/.test(p)?p:"";case"alphanumeric":return /[A-Za-z0-9]/.test(p)?p:"";case"custom":return h?.test(p)?p:"";default:return p}},M=()=>(r!=null?String(r):"").split("").map(y).slice(0,e),S=M().concat(Array(e).fill(" ")).slice(0,e),V=m=>{let p=m.split("").map(y).join("").slice(0,e),C=p===""?void 0:typeof r=="number"?Number(p):p;l?.({target:{name:n,value:C}});},N=(m,p)=>{let C=y(p),E=M();if(C===""){E[m]="",V(E.join(""));return}if(p.length>1){let z=p.split("").map(y).join("").slice(0,e);V(z),T.current[Math.min(z.length-1,e-1)]?.focus();return}C&&(E[m]=C,V(E.join("")),m<e-1&&T.current[m+1]?.focus());},F=m=>{let p=M();!p[m]&&m>0?p[m-1]="":p[m]="",V(p.join("")),m>0&&T.current[m-1]?.focus();},b=m=>{m.preventDefault();let C=m.clipboardData.getData("text").split("").map(y).join("").slice(0,e);C&&(V(C),T.current[Math.min(C.length-1,e-1)]?.focus());},w=m=>{switch(d){case"upper":case"visual-upper":return m.toUpperCase();case"lower":case"visual-lower":return m.toLowerCase();default:return m}};return jsxRuntime.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[o&&jsxRuntime.jsx(L,{htmlFor:v,required:i,children:o}),jsxRuntime.jsx("div",{className:u("flex gap-3 items-center",s&&"text-red-500",c),...P,children:S.map((m,p)=>{let C=t&&p>0&&p%t===0;return jsxRuntime.jsxs(Ut__default.default.Fragment,{children:[C&&jsxRuntime.jsx("span",{className:"flex items-center justify-center text-xl font-bold select-none",children:"-"}),jsxRuntime.jsx("input",{id:v,type:"text",maxLength:1,inputMode:x==="numeric"?"numeric":"text",value:w(m).trim(),ref:E=>{T.current[p]=E,p===0&&R&&(typeof R=="function"?R(E):typeof R=="object"&&(R.current=E));},onPaste:b,onChange:E=>N(p,E.target.value),onKeyDown:E=>E.key==="Backspace"&&F(p),onBlur:f,className:u("h-14 w-12 text-center text-2xl rounded-md border border-input bg-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s&&"border-red-500")})]},p)})}),s&&jsxRuntime.jsx(H,{children:s}),!s&&a&&jsxRuntime.jsx(I,{children:a})]})});vt.displayName="OtpInput";var Sa=g(vt);var ht=Ut.forwardRef(({label:e,required:t,option:r,className:n,overrideClassName:o,helperText:i,error:a,...s},l)=>{let f=Ut.useId(),c=u("h-4 w-4 border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a&&"border-destructive",n);return jsxRuntime.jsxs("div",{className:"space-y-3",children:[e&&jsxRuntime.jsx(L,{required:t,children:e}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{id:f,type:"radio",className:o?n:c,ref:l,...s}),r&&jsxRuntime.jsx(L,{htmlFor:f,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r})]}),a&&jsxRuntime.jsx(H,{children:a}),!a&&i&&jsxRuntime.jsx(I,{children:i})]})});ht.displayName="Radio";var qa=g(ht);function Br(e,t){let{label:r,required:n,name:o,labelKey:i,valueKey:a,options:s,alignment:l="vertical",className:f,overrideClassName:c=!1,helperText:x,error:h,typeSet:d="field",value:P,onChange:R,...v}=e,T=Ut.useId(),k=Ut.useMemo(()=>new Map(s.map(N=>[String(N[a]),N])),[s,a]),y=Ut.useMemo(()=>P==null?"":String(d==="field"?P:P[a]),[P,d,a]),M=N=>{if(!R)return;let F;if(d==="field"){let b=k.get(N);if(b)F=b[a];else {let w=Number(N);F=Number.isNaN(w)?N:w;}}else F=k.get(N)??void 0;R({target:{name:o,value:F,type:"radiogroup",checked:!0}});},S=l==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",V=u("h-4 w-4 rounded-full border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",h&&"border-destructive");return jsxRuntime.jsxs("div",{className:u("flex flex-col gap-3",f),children:[r&&jsxRuntime.jsx(L,{required:n,children:r}),jsxRuntime.jsx("div",{className:S,children:s.map((N,F)=>{let b=String(N[a]),w=`${T}-${b}-${F}`;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{...v,id:w,ref:t,name:o,type:"radio",checked:y===b,onChange:()=>M(b),className:c?f:V}),jsxRuntime.jsx(L,{htmlFor:w,children:String(N[i])})]},w)})}),h&&jsxRuntime.jsx(H,{children:String(h)}),!h&&x&&jsxRuntime.jsx(I,{children:x})]})}function Or(){let e=Ut.forwardRef(Br);return e.displayName="RadioGroup",e}var Gr=Or(),ti=g(Gr);function qr({label:e,required:t=!1,options:r,labelKey:n,valueKey:o,placeholder:i,error:a,helperText:s,className:l,...f},c){let x=Ut.useId(),h=u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",l);return jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(L,{htmlFor:x,required:t,children:e}),jsxRuntime.jsxs("select",{id:x,ref:c,className:h,...f,children:[i&&jsxRuntime.jsx("option",{value:"",disabled:!0,children:i}),r.map((d,P)=>jsxRuntime.jsx("option",{value:String(d[o]),children:String(d[n])},P))]}),a&&jsxRuntime.jsx(H,{children:a}),!a&&s&&jsxRuntime.jsx(I,{children:s})]})}function _r(){let e=Ut.forwardRef(qr);return e.displayName="Select",e}var Wr=_r(),pi=g(Wr);var Pt=Ut.forwardRef(({label:e,description:t,checked:r=!1,className:n,overrideClassName:o,error:i,name:a,...s},l)=>{let f=Ut.useId();return jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:f,name:a,checked:r,className:"peer sr-only",ref:l,...s}),jsxRuntime.jsx("label",{htmlFor:f,className:u("relative flex items-center h-6 w-11 cursor-pointer rounded-full bg-input transition-colors duration-200","peer-checked:bg-primary peer-focus:ring-2 peer-focus:ring-ring peer-focus:ring-offset-2 peer-focus:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50",n),children:jsxRuntime.jsx("span",{className:u("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",r?"translate-x-5":"translate-x-1")})}),(e||t)&&jsxRuntime.jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[e&&jsxRuntime.jsx(L,{id:`${f}-label`,htmlFor:f,className:"text-sm font-medium leading-none",children:e}),t&&jsxRuntime.jsx(L,{id:`${f}-description`,htmlFor:f,className:"text-xs text-muted-foreground",children:t})]})]})});Pt.displayName="Switch";var Ci=g(Pt);var Lt=Ut__default.default.forwardRef(({label:e,required:t,showCount:r,maxLength:n,className:o,overrideClassName:i=!1,error:a,helperText:s,...l},f)=>{let c=Ut.useId(),[x,h]=Ut.useState(0),d=u("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",o);return jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(L,{htmlFor:c,required:t,children:e}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("textarea",{id:c,className:i?o:d,maxLength:n,onInput:P=>h(P.currentTarget.textLength),ref:f,...l}),r&&jsxRuntime.jsxs("span",{className:"absolute bottom-2 right-3 text-xs text-muted-foreground",children:[x,n?` / ${n}`:""]})]}),a&&jsxRuntime.jsx(H,{children:a}),!a&&s&&jsxRuntime.jsx(I,{children:s})]})});Lt.displayName="Textarea";var Ni=g(Lt);
|
|
16
|
+
`,children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{children:e}),jsxRuntime.jsx("svg",{className:`w-5 h-5 transition-transform ${n?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})}),n&&jsxRuntime.jsx("div",{className:"px-4 py-3 bg-background border-t border-border",children:t})]});Ee.displayName="Accordion";var pn=g(Ee);function u(...e){return tailwindMerge.twMerge(Tr.clsx(e))}var Ne=Ut__default.default.forwardRef(({className:e,overrideClassName:t,variant:r="primary",size:n="md",href:o,children:i,loading:a=!1,loadingContent:s,...l},f)=>{let c="inline-flex items-center justify-center rounded-lg font-medium cursor-pointer active:translate-y-1 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",x={primary:"bg-blue-600 text-white hover:bg-blue-700 shadow-md focus-visible:ring-blue-500",secondary:"bg-gray-600 text-white hover:bg-gray-700 shadow-sm focus-visible:ring-gray-500",tertiary:"bg-purple-600 text-white hover:bg-purple-700 shadow-sm focus-visible:ring-purple-500",destructive:"bg-red-600 text-white hover:bg-red-700 shadow-sm focus-visible:ring-red-500",success:"bg-green-600 text-white hover:bg-green-700 shadow-sm focus-visible:ring-green-500",warning:"bg-amber-500 text-white hover:bg-amber-600 shadow-sm focus-visible:ring-amber-500",info:"bg-cyan-600 text-white hover:bg-cyan-700 shadow-sm focus-visible:ring-cyan-500",accent:"bg-violet-600 text-white hover:bg-violet-700 shadow-sm focus-visible:ring-violet-500",outline:"border border-gray-300 bg-transparent text-gray-700 hover:bg-gray-50 shadow-sm focus-visible:ring-gray-500",ghost:"bg-transparent text-gray-700 hover:bg-gray-100 focus-visible:ring-gray-500",link:"text-blue-600 underline-offset-4 hover:underline bg-transparent p-0 h-auto shadow-none",gradient:"bg-gradient-to-r from-blue-600 to-purple-600 text-white hover:from-blue-700 hover:to-purple-700 shadow-md focus-visible:ring-blue-500",glass:"bg-white/10 backdrop-blur-md border border-white/20 text-black hover:bg-white/20 shadow-sm focus-visible:ring-white/50",soft:"bg-blue-100 text-blue-700 hover:bg-blue-200 shadow-sm focus-visible:ring-blue-500",dark:"bg-gray-900 text-white hover:bg-gray-800 shadow-md focus-visible:ring-gray-500",light:"bg-gray-100 text-gray-900 hover:bg-gray-200 shadow-sm focus-visible:ring-gray-500",obsidian:"bg-black text-white hover:bg-gray-900 shadow-md border border-gray-800 focus-visible:ring-gray-700",polar:"bg-white text-gray-900 hover:bg-gray-50 shadow-md border border-gray-300 focus-visible:ring-gray-400"},h={xs:"h-7 px-2 text-xs min-w-16",sm:"h-9 px-3 text-sm min-w-20",md:"h-10 px-4 py-2 text-base min-w-24",lg:"h-11 px-6 text-lg min-w-28",xl:"h-12 px-8 text-xl min-w-32"},d=t?e:u(c,x[r],h[n],e);return o?jsxRuntime.jsx("a",{href:o,className:d,ref:f,children:a&&s?s:i}):jsxRuntime.jsx("button",{className:d,ref:f,...l,children:a&&s?s:i})});Ne.displayName="Button";var Tn=g(Ne);var Me=Ut.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx("div",{ref:o,className:t?e:u("rounded-lg border bg-card text-card-foreground shadow-sm",e),...n,children:r}));Me.displayName="Card";var Ie=Ut.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx("div",{ref:o,className:t?e:u("flex flex-col space-y-1.5 p-6",e),...n,children:r}));Ie.displayName="CardHeader";var He=Ut.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx("h3",{ref:o,className:t?e:u("text-2xl font-semibold leading-none tracking-tight",e),...n,children:r}));He.displayName="CardTitle";var Ve=Ut.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx("p",{ref:o,className:t?e:u("text-sm text-muted-foreground",e),...n,children:r}));Ve.displayName="CardDescription";var Fe=Ut.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx("div",{ref:o,className:t?e:u("p-6 pt-0",e),...n,children:r}));Fe.displayName="CardContent";var Se=Ut.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx("div",{ref:o,className:t?e:u("flex items-center p-6 pt-0",e),...n,children:r}));Se.displayName="CardFooter";var kn=g(Me),Nn=g(Ie),Mn=g(He),In=g(Ve),Hn=g(Fe),Vn=g(Se);var ne=Ut.createContext(void 0),Ae=Ut.forwardRef(({children:e,className:t,...r},n)=>{let[o,i]=Ut.useState(!1);return jsxRuntime.jsx(ne.Provider,{value:{isOpen:o,setIsOpen:i},children:jsxRuntime.jsx("div",{ref:n,className:u("relative inline-block",t),...r,children:e})})});Ae.displayName="DropdownMenu";var $e=({children:e,asChild:t})=>{let r=Ut.useContext(ne);if(!r)throw new Error("DropdownMenuTrigger must be used within DropdownMenu");let n=()=>r.setIsOpen(!r.isOpen);if(t){let o=e;return Ut.cloneElement(o,{onClick:i=>{o.props.onClick?.(i),n();}})}return jsxRuntime.jsx("button",{onClick:n,children:e})};$e.displayName="DropdownMenuTrigger";var Be=Ut.forwardRef(({children:e,align:t="end",className:r,...n},o)=>{let i=Ut.useContext(ne),a=Ut.useRef(null);return Ut.useEffect(()=>{o&&(typeof o=="function"?o(a.current):o.current=a.current);},[o]),Ut.useEffect(()=>{let l=f=>{a.current&&!a.current.contains(f.target)&&i?.setIsOpen(!1);};return i?.isOpen&&document.addEventListener("mousedown",l),()=>{document.removeEventListener("mousedown",l);}},[i?.isOpen]),i?.isOpen?jsxRuntime.jsx("div",{ref:a,className:u("absolute z-50 mt-2 min-w-32 overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md",{start:"left-0",center:"left-1/2 -translate-x-1/2",end:"right-0"}[t],r),...n,children:e}):null});Be.displayName="DropdownMenuContent";var Oe=Ut.forwardRef(({children:e,onClick:t,destructive:r,className:n,...o},i)=>{let a=Ut.useContext(ne);return jsxRuntime.jsx("button",{ref:i,onClick:l=>{t?.(l),a?.setIsOpen(!1);},className:u("w-full text-left px-4 py-2 text-sm hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none",r&&"text-red-600 hover:bg-red-50 hover:text-red-700 focus:bg-red-50 focus:text-red-700",n),...o,children:e})});Oe.displayName="DropdownMenuItem";var Ge=Ut.forwardRef(({className:e,...t},r)=>jsxRuntime.jsx("div",{ref:r,className:u("-mx-1 my-1 h-px bg-border",e),...t}));Ge.displayName="DropdownMenuSeparator";var Ke=Ut.forwardRef(({children:e,className:t,...r},n)=>jsxRuntime.jsx("div",{ref:n,className:u("px-2 py-1.5 text-sm font-semibold",t),...r,children:e}));Ke.displayName="DropdownMenuLabel";var On=g(Ae),Gn=g($e),Kn=g(Be),Un=g(Oe),qn=g(Ge),_n=g(Ke);var zt=({children:e,className:t,overrideClassName:r})=>{if(e)return jsxRuntime.jsx("p",{className:r?t:u("text-sm text-muted-foreground",t),children:e})},I=g(zt);var Zt=({children:e,required:t,className:r,overrideClassName:n=!1,...o})=>jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("label",{...o,className:n?r:u("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),children:e}),t&&jsxRuntime.jsx("span",{className:"text-red-600",children:"*"})]}),L=g(Zt);var Yt=({children:e,className:t,overrideClassName:r})=>{if(e)return jsxRuntime.jsx("p",{className:r?t:u("text-sm text-red-600 dark:text-red-400",t),children:e})},H=g(Yt);var _e=Ut.forwardRef(({label:e,required:t,option:r,orientation:n="left",className:o,overrideClassName:i=!1,helperText:a,error:s,...l},f)=>{let c=Ut.useId(),x=u("h-4 w-4 rounded border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s&&"border-destructive",o);return jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(L,{required:t,children:e}),jsxRuntime.jsxs("div",{className:`flex ${n=="left"?"flex-row":"flex-row-reverse"} w-fit gap-2`,children:[jsxRuntime.jsx("input",{id:c,type:"checkbox",className:i?o:x,ref:f,...l}),r&&jsxRuntime.jsx(L,{htmlFor:c,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r})]}),s&&jsxRuntime.jsx(H,{children:s}),!s&&a&&jsxRuntime.jsx(I,{children:a})]})});_e.displayName="CheckBox";var uo=g(_e);function or(e,t){let{typeSet:r="field",multiCheck:n=!1,value:o,onChange:i,labelKey:a,valueKey:s,options:l,alignment:f="vertical",className:c,overrideClassName:x=!1,helperText:h,error:d,label:P,name:R,required:v,...T}=e,k=Ut.useId(),y=Ut.useMemo(()=>new Map(l.map(b=>[String(b[s]),b])),[l,s]),M=Ut.useMemo(()=>o==null?[]:r==="field"?n?o.map(b=>String(b)):[String(o)]:n?o.map(b=>String(b[s])):[String(o[s])],[o,r,n,s]),S=(b,w)=>{if(!i)return;let m;if(r==="field")if(n)m=b.map(C=>{let E=y.get(C);return E?E[s]:C});else {let p=b[0];if(!p)m=void 0;else {let C=y.get(p);m=C?C[s]:p;}}else n?m=b.map(C=>y.get(C)).filter(C=>C!==void 0):m=y.get(b[0]??"")??void 0;i({target:{name:R,value:m,type:"checkboxgroup",checked:w}});},V=b=>{let w;n?w=M.includes(b)?M.filter(m=>m!==b):[...M,b]:w=M[0]===b?[]:[b],S(w,w.includes(b));},N=f==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",F=u("h-4 w-4 rounded border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",d&&"border-destructive");return jsxRuntime.jsxs("div",{className:u("flex flex-col gap-3",c),children:[P&&jsxRuntime.jsx(L,{required:v,children:P}),jsxRuntime.jsx("div",{className:N,children:l.map((b,w)=>{let m=String(b[s]),p=M.includes(m),C=`${k}-${m}-${w}`;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{...T,id:C,ref:t,type:"checkbox",name:R,checked:p,onChange:()=>V(m),className:x?c:F}),jsxRuntime.jsx(L,{htmlFor:C,children:String(b[a])})]},C)})}),!!d&&jsxRuntime.jsx(H,{children:String(d)}),!d&&h&&jsxRuntime.jsx(I,{children:h})]})}function ar(){let e=Ut.forwardRef(or);return e.displayName="CheckBoxGroup",e}var ir=ar(),Po=g(ir);var sr=({...e})=>jsxRuntime.jsx("svg",{...e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),oe=sr;var cr=(e,t)=>{Ut.useEffect(()=>{let r=n=>{e.current&&!e.current.contains(n.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},Xe=cr;function de({options:e,labelKey:t,valueKey:r,multiple:n,onChange:o,setSearchTerm:i,typeSet:a,name:s}){let[l,f]=Ut.useState([]),c=Ut.useMemo(()=>new Map(e.map(v=>[String(v[r]),v])),[e,r]),x=Ut.useCallback(()=>l.map(v=>c.get(v)).filter(v=>!!v),[l,c]),h=Ut.useCallback(v=>{if(!o)return;let T;if(a==="field"?n?T=v:T=v[0]??void 0:n?T=v.map(y=>c.get(y)).filter(y=>y!==void 0):T=c.get(v[0]??"")??void 0,i&&!n){let k=c.get(v[0]??"");k&&i(String(k[t]));}o({target:{name:s,value:T,type:"combobox"}});},[n,o,c,s,a,i,t]),d=Ut.useCallback(v=>{let T=String(v[r]),k=n?l.includes(T)?l.filter(y=>y!==T):[...l,T]:[T];f(k),h(k);},[n,l,h,r]),P=Ut.useCallback(v=>{let T=l.filter(k=>k!==v);f(T),h(T);},[l,h]),R=Ut.useCallback(()=>{f([]),i?.("");let v;a==="field"?v=n?[]:"":v=n?[]:void 0,o?.({target:{name:s,value:v,type:"combobox"}});},[n,o,s,i,a]);return {selectedValues:l,handleSelect:d,handleRemove:P,handleClear:R,getSelectedOptions:x}}function me(e,t,r){return Ut.useMemo(()=>r?e.filter(o=>String(o[t]).toLowerCase().includes(r.toLowerCase())):e,[e,r,t])}var je=({isOpen:e,setIsOpen:t,multiple:r,searchTerm:n,setSearchTerm:o,selectedValues:i,filteredOptions:a,highlightedIndex:s,setHighlightedIndex:l,handleSelect:f,handleRemove:c})=>{let x=Ut.useCallback(d=>{if(a.length===0){l(-1);return}l(P=>P<0?d>0?0:a.length-1:(P+d+a.length)%a.length);},[a,l]);return Ut.useCallback(d=>{if(!e){if(d.key==="Enter"||d.key==="ArrowDown"){t(!0),l(0),d.preventDefault();return}r&&d.key==="Backspace"&&n===""&&i.length>0&&(d.preventDefault(),c(i[i.length-1]));return}switch(d.key){case"ArrowDown":d.preventDefault(),x(1);break;case"ArrowUp":d.preventDefault(),x(-1);break;case"Enter":d.preventDefault();let P=s>=0?s:0,R=a[P];R&&f(R),r&&o&&o(""),r||(t(!1),l(-1));break;case"Escape":d.preventDefault(),t(!1),l(-1),r||o("");break;case"Tab":t(!1),l(-1);break;case"Home":d.preventDefault(),a.length>0&&l(0);break;case"End":d.preventDefault(),a.length>0&&l(a.length-1);break;case"Backspace":r&&n===""&&i.length>0&&(d.preventDefault(),c(i[i.length-1]));break}},[e,r,n,i,a,s,t,o,l,f,c,x])};function Ye({option:e,labelKey:t,valueKey:r,onRemove:n}){let o=String(e[t]),i=String(e[r]);return jsxRuntime.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded",children:[o,jsxRuntime.jsx("button",{type:"button",onMouseDown:a=>a.preventDefault(),onClick:()=>n(i),className:"hover:bg-blue-200 dark:hover:bg-blue-800 rounded-full p-0.5 transition-colors","aria-label":`Remover ${o}`,children:"\u2715"})]},i)}function xr(e,t){let{label:r,required:n=!1,name:o,placeholder:i="Buscar...",labelKey:a,valueKey:s,options:l,value:f,onChange:c,mode:x="single",typeSet:h="field",disabled:d=!1,ClearEnabled:P=!0,helperText:R,error:v=!1,className:T="",...k}=e,y=x==="multiple",[M,S]=Ut.useState(!1),[V,N]=Ut.useState(""),F=Ut.useRef(null),b=Ut.useRef(null),w=Ut.useRef(null);Ut.useImperativeHandle(t,()=>w.current),Xe(b,()=>S(!1));let m=me(l,a,V),[p,C]=Ut.useState(-1),{selectedValues:E,handleSelect:z,handleRemove:xe,handleClear:Rt,getSelectedOptions:he}=de({options:l,labelKey:a,valueKey:s,value:f,multiple:y,onChange:c,typeSet:h,name:o,setSearchTerm:N}),Et=je({isOpen:M,setIsOpen:S,multiple:y,searchTerm:V,setSearchTerm:N,selectedValues:E,filteredOptions:m,highlightedIndex:p,setHighlightedIndex:C,handleSelect:z,handleRemove:xe}),X=Ut.useId(),kt="w-full bg-transparent outline-none placeholder:text-gray-500 dark:placeholder:text-gray-400 text-gray-900 dark:text-gray-100",Nt=u("relative w-full min-h-[40px] px-3 py-2 border rounded-md bg-white dark:bg-gray-800",v?"border-red-500":"border-gray-300 dark:border-gray-600",d?"opacity-50 cursor-not-allowed":"cursor-text","focus-within:ring-2 focus-within:ring-blue-500 focus-within:border-blue-500");return jsxRuntime.jsxs("div",{className:`space-y-2 ${T}`,children:[r&&jsxRuntime.jsx(L,{htmlFor:X,required:n,children:r}),jsxRuntime.jsxs("div",{ref:F,className:"relative",children:[jsxRuntime.jsxs("div",{className:Nt,children:[y&&he().length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:he().map((D,$)=>jsxRuntime.jsx(Ye,{option:D,labelKey:a,valueKey:s,onRemove:xe},String(D[s]??$)))}),jsxRuntime.jsx("input",{ref:w,...k,name:o,type:"text",placeholder:i,value:V,onChange:D=>{let $=D.target.value;N($),!M&&$.trim()!==""&&S(!0);},onKeyDown:Et,onMouseDown:D=>{document.activeElement===w.current&&(D.preventDefault(),S($=>{let Z=!$;return Z&&C(0),Z}));},onFocus:()=>{S(!0),C(0);},disabled:d,className:kt,role:"combobox","aria-expanded":M,"aria-controls":X,"aria-activedescendant":p>=0?`${X}-opt-${p}`:void 0}),P&&!!E.length&&jsxRuntime.jsx("button",{type:"button",onMouseDown:D=>D.preventDefault(),onClick:Rt,className:"absolute right-2 top-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700",title:"Limpar sele\xE7\xE3o",children:jsxRuntime.jsx(oe,{width:12,height:12})})]}),M&&jsxRuntime.jsx("div",{ref:b,id:X,className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto",role:"listbox","aria-multiselectable":y||void 0,children:m.length===0?jsxRuntime.jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"Nenhum resultado encontrado"}):m.map((D,$)=>{let Z=String(D[s]),ie=E.includes(Z),se=$===p;return jsxRuntime.jsx("button",{id:`${X}-opt-${$}`,"data-index":$,role:"option","aria-selected":ie,type:"button",onMouseDown:Mt=>Mt.preventDefault(),onClick:()=>z(D),className:u("w-full px-3 py-2 text-left text-sm transition-colors",se&&"bg-blue-100 dark:bg-blue-800 text-blue-900 dark:text-white",!se&&ie&&"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300",!ie&&!se&&"text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),children:jsxRuntime.jsx("span",{children:String(D[a])})},Z)})})]}),v&&jsxRuntime.jsx(H,{children:v}),!v&&R&&jsxRuntime.jsx(I,{children:R})]})}function hr(){let e=Ut.forwardRef(xr);return e.displayName="ComboBox",e}var Cr=hr(),Qo=g(Cr);var yr=({children:e,before:t,after:r,className:n})=>{let i=Tr__default.default("flex justify-center items-center",{"rounded-l-lg":t,"rounded-r-lg":r},n);return jsxRuntime.jsx("div",{className:i,children:jsxRuntime.jsx("span",{children:e})})},ge=yr;var wr=({children:e})=>jsxRuntime.jsx("div",{className:"absolute px-2",children:jsxRuntime.jsx("span",{children:e})}),tt=wr;var Pr=({children:e})=>jsxRuntime.jsx("div",{className:"absolute right-0 px-2",children:jsxRuntime.jsx("span",{children:e})}),nt=Pr;function ot(e){e.currentTarget.maxLength=9;let t=e.currentTarget.value;return t=t.replace(/\D/g,""),t=t.replace(/^(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function at(e){let t=e.currentTarget.value;t=t.replace(/\D/g,""),t=t.padStart(3,"0");let r=t.slice(0,-2),n=t.slice(-2),a=`${(r.replace(/^0+/,"")||"0").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1.")},${n}`;return e.currentTarget.value=a,e}function it(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value;return t.match(/^(\d{3}).(\d{3}).(\d{3})-(\d{2})$/)||(t=t.replace(/\D/g,""),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2"),e.currentTarget.value=t),e}function st(e){e.currentTarget.maxLength=15;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function lt(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{4})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function ct(e){let t=e.currentTarget.value.replace(/\D/g,"");return t.length<=11?(e.currentTarget.maxLength=14,t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2")):(e.currentTarget.maxLength=18,t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2")),e.currentTarget.value=t,e}function dt(e){e.currentTarget.maxLength=12;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{1})$/,"$1-$2"),e.currentTarget.value=t,e}function mt(e){e.currentTarget.maxLength=18;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2"),e.currentTarget.value=t,e}var Lr=({e,mask:t})=>{switch(t){case"money":return at(e);case"mobile":return st(e);case"phone":return lt(e);case"cpfCnpj":return ct(e);case"cpf":return it(e);case"rg":return dt(e);case"cnpj":return mt(e);case"cep":return ot(e);default:return e}},pt=Lr;var kr=({mask:e,initialValue:t=""})=>{let[r,n]=Ut.useState(t);Ut.useEffect(()=>{t!==r&&n(t);},[t]);let o=Ut.useCallback(a=>{let l=pt({e:a,mask:e})?.currentTarget?.value??a.currentTarget.value;n(l);},[e]),i=Ut.useCallback(()=>n(""),[]);return {value:r,setValue:n,handleChange:o,handleClear:i}},ft=kr;var gt=Ut.forwardRef(({label:e,required:t=!1,mask:r,name:n,prefix:o,suffix:i,addonBefore:a,addonBeforeClassName:s,addonAfter:l,addonAfterClassName:f,ClearEnabled:c=!0,className:x,overrideClassName:h=!1,error:d,helperText:P,value:R=void 0,onChange:v,...T},k)=>{let y=Ut.useId(),{handleChange:M,handleClear:S,setValue:V}=ft({mask:r,initialValue:R}),N=u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",d&&"border-destructive focus-visible:ring-destructive",!o&&!i&&"px-3",o&&!i&&"pl-10 pr-3",i&&!o&&"pl-3 pr-10",o&&i&&"pl-10 pr-10",a&&"rounded-l-none border-l-0",l&&"rounded-r-none border-r-0",x),F=w=>{M(w),v?.(w);},b=()=>{S(),V(""),v?.({target:{name:n||"",value:""}});};return jsxRuntime.jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsxRuntime.jsx(L,{htmlFor:y,required:t,children:e}),jsxRuntime.jsxs("div",{className:"relative flex",children:[a&&jsxRuntime.jsx(ge,{before:!0,className:s,children:a}),jsxRuntime.jsxs("div",{className:"relative flex items-center w-full",children:[o&&jsxRuntime.jsx(tt,{children:o}),jsxRuntime.jsx("input",{id:y,ref:k,name:n,onChange:F,className:h?x:N,...T}),c&&R&&jsxRuntime.jsx(oe,{onClick:b,width:12,height:12,className:u("absolute right-2 cursor-pointer",i&&"right-8")}),i&&jsxRuntime.jsx(nt,{children:i})]}),l&&jsxRuntime.jsx(ge,{after:!0,className:f,children:l})]}),d&&jsxRuntime.jsx(H,{children:d}),!d&&P&&jsxRuntime.jsx(I,{children:P})]})});gt.displayName="Input";var Ra=g(gt);var vt=Ut.forwardRef(({length:e=6,groupBy:t,value:r,name:n,label:o,required:i=!1,helperText:a,error:s,onChange:l,onBlur:f,className:c,charType:x="numeric",customPattern:h,caseMode:d="none",...P},R)=>{let v=Ut.useId(),T=Ut.useRef([]),k=m=>{switch(d){case"upper":return m.toUpperCase();case"lower":case"visual-upper":return m.toLowerCase();case"visual-lower":return m.toUpperCase();default:return m}},y=m=>{if(!m)return "";let p=m.slice(0,1);switch(p=k(p),x){case"numeric":return /\d/.test(p)?p:"";case"alpha":return /[A-Za-z]/.test(p)?p:"";case"alphanumeric":return /[A-Za-z0-9]/.test(p)?p:"";case"custom":return h?.test(p)?p:"";default:return p}},M=()=>(r!=null?String(r):"").split("").map(y).slice(0,e),S=M().concat(Array(e).fill(" ")).slice(0,e),V=m=>{let p=m.split("").map(y).join("").slice(0,e),C=p===""?void 0:typeof r=="number"?Number(p):p;l?.({target:{name:n,value:C}});},N=(m,p)=>{let C=y(p),E=M();if(C===""){E[m]="",V(E.join(""));return}if(p.length>1){let z=p.split("").map(y).join("").slice(0,e);V(z),T.current[Math.min(z.length-1,e-1)]?.focus();return}C&&(E[m]=C,V(E.join("")),m<e-1&&T.current[m+1]?.focus());},F=m=>{let p=M();!p[m]&&m>0?p[m-1]="":p[m]="",V(p.join("")),m>0&&T.current[m-1]?.focus();},b=m=>{m.preventDefault();let C=m.clipboardData.getData("text").split("").map(y).join("").slice(0,e);C&&(V(C),T.current[Math.min(C.length-1,e-1)]?.focus());},w=m=>{switch(d){case"upper":case"visual-upper":return m.toUpperCase();case"lower":case"visual-lower":return m.toLowerCase();default:return m}};return jsxRuntime.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[o&&jsxRuntime.jsx(L,{htmlFor:v,required:i,children:o}),jsxRuntime.jsx("div",{className:u("flex gap-3 items-center",s&&"text-red-500",c),...P,children:S.map((m,p)=>{let C=t&&p>0&&p%t===0;return jsxRuntime.jsxs(Ut__default.default.Fragment,{children:[C&&jsxRuntime.jsx("span",{className:"flex items-center justify-center text-xl font-bold select-none",children:"-"}),jsxRuntime.jsx("input",{id:v,type:"text",maxLength:1,inputMode:x==="numeric"?"numeric":"text",value:w(m).trim(),ref:E=>{T.current[p]=E,p===0&&R&&(typeof R=="function"?R(E):typeof R=="object"&&(R.current=E));},onPaste:b,onChange:E=>N(p,E.target.value),onKeyDown:E=>E.key==="Backspace"&&F(p),onBlur:f,className:u("h-14 w-12 text-center text-2xl rounded-md border border-input bg-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s&&"border-red-500")})]},p)})}),s&&jsxRuntime.jsx(H,{children:s}),!s&&a&&jsxRuntime.jsx(I,{children:a})]})});vt.displayName="OtpInput";var Sa=g(vt);var ht=Ut.forwardRef(({label:e,required:t,option:r,className:n,overrideClassName:o,helperText:i,error:a,...s},l)=>{let f=Ut.useId(),c=u("h-4 w-4 border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a&&"border-destructive",n);return jsxRuntime.jsxs("div",{className:"space-y-3",children:[e&&jsxRuntime.jsx(L,{required:t,children:e}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{id:f,type:"radio",className:o?n:c,ref:l,...s}),r&&jsxRuntime.jsx(L,{htmlFor:f,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r})]}),a&&jsxRuntime.jsx(H,{children:a}),!a&&i&&jsxRuntime.jsx(I,{children:i})]})});ht.displayName="Radio";var qa=g(ht);function Br(e,t){let{label:r,required:n,name:o,labelKey:i,valueKey:a,options:s,alignment:l="vertical",className:f,overrideClassName:c=!1,helperText:x,error:h,typeSet:d="field",value:P,onChange:R,...v}=e,T=Ut.useId(),k=Ut.useMemo(()=>new Map(s.map(N=>[String(N[a]),N])),[s,a]),y=Ut.useMemo(()=>P==null?"":String(d==="field"?P:P[a]),[P,d,a]),M=N=>{if(!R)return;let F;if(d==="field"){let b=k.get(N);if(b)F=b[a];else {let w=Number(N);F=Number.isNaN(w)?N:w;}}else F=k.get(N)??void 0;R({target:{name:o,value:F,type:"radiogroup",checked:!0}});},S=l==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",V=u("h-4 w-4 rounded-full border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",h&&"border-destructive");return jsxRuntime.jsxs("div",{className:u("flex flex-col gap-3",f),children:[r&&jsxRuntime.jsx(L,{required:n,children:r}),jsxRuntime.jsx("div",{className:S,children:s.map((N,F)=>{let b=String(N[a]),w=`${T}-${b}-${F}`;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{...v,id:w,ref:t,name:o,type:"radio",checked:y===b,onChange:()=>M(b),className:c?f:V}),jsxRuntime.jsx(L,{htmlFor:w,children:String(N[i])})]},w)})}),h&&jsxRuntime.jsx(H,{children:String(h)}),!h&&x&&jsxRuntime.jsx(I,{children:x})]})}function Or(){let e=Ut.forwardRef(Br);return e.displayName="RadioGroup",e}var Gr=Or(),ti=g(Gr);function qr({label:e,required:t=!1,options:r,labelKey:n,valueKey:o,placeholder:i,error:a,helperText:s,className:l,...f},c){let x=Ut.useId(),h=u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",l);return jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(L,{htmlFor:x,required:t,children:e}),jsxRuntime.jsxs("select",{id:x,ref:c,className:h,...f,children:[i&&jsxRuntime.jsx("option",{value:"",disabled:!0,children:i}),r.map((d,P)=>jsxRuntime.jsx("option",{value:String(d[o]),children:String(d[n])},P))]}),a&&jsxRuntime.jsx(H,{children:a}),!a&&s&&jsxRuntime.jsx(I,{children:s})]})}function _r(){let e=Ut.forwardRef(qr);return e.displayName="Select",e}var Wr=_r(),pi=g(Wr);var Pt=Ut.forwardRef(({label:e,description:t,checked:r=!1,className:n,overrideClassName:o,error:i,name:a,...s},l)=>{let f=Ut.useId();return jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:f,name:a,checked:r,className:"peer sr-only",ref:l,...s}),jsxRuntime.jsx("label",{htmlFor:f,className:u("relative flex items-center h-6 w-11 cursor-pointer rounded-full bg-input transition-colors duration-200","peer-checked:bg-primary peer-focus:ring-2 peer-focus:ring-ring peer-focus:ring-offset-2 peer-focus:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50",n),children:jsxRuntime.jsx("span",{className:u("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",r?"translate-x-5":"translate-x-1")})}),(e||t)&&jsxRuntime.jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[e&&jsxRuntime.jsx(L,{id:`${f}-label`,htmlFor:f,className:"text-sm font-medium leading-none",children:e}),t&&jsxRuntime.jsx(L,{id:`${f}-description`,htmlFor:f,className:"text-xs text-muted-foreground",children:t})]})]})});Pt.displayName="Switch";var Ci=g(Pt);var Lt=Ut__default.default.forwardRef(({label:e,required:t,showCount:r,maxLength:n,className:o,overrideClassName:i=!1,error:a,helperText:s,...l},f)=>{let c=Ut.useId(),[x,h]=Ut.useState(0),d=u("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",o);return jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(L,{htmlFor:c,required:t,children:e}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("textarea",{id:c,className:i?o:d,maxLength:n,onInput:P=>h(P.currentTarget.textLength),ref:f,...l}),r&&jsxRuntime.jsxs("span",{className:"absolute bottom-2 right-3 text-xs text-muted-foreground",children:[x,n?` / ${n}`:""]})]}),a&&jsxRuntime.jsx(H,{children:a}),!a&&s&&jsxRuntime.jsx(I,{children:s})]})});Lt.displayName="TextArea";var Ni=g(Lt);
|
|
17
17
|
|
|
18
18
|
exports.AccordionPrimitive = pn;
|
|
19
19
|
exports.ButtonPrimitive = Tn;
|
|
@@ -41,5 +41,5 @@ exports.RadioGroupPrimitive = ti;
|
|
|
41
41
|
exports.RadioPrimitive = qa;
|
|
42
42
|
exports.SelectPrimitive = pi;
|
|
43
43
|
exports.SwitchPrimitive = Ci;
|
|
44
|
-
exports.
|
|
44
|
+
exports.TextAreaPrimitive = Ni;
|
|
45
45
|
exports.ValidateFieldPrimitive = H;
|
package/dist/page.mjs
CHANGED
|
@@ -6,6 +6,6 @@ import { twMerge } from 'tailwind-merge';
|
|
|
6
6
|
var Te=createContext(void 0),Ft=({message:e})=>jsx("div",{className:"flex justify-center items-center h-screen min-w-full bg-red-50 dark:bg-red-900/10 text-red-800 dark:text-red-200 text-xl text-center p-8 transition-colors duration-300",children:jsxs("div",{className:"max-w-md animate-[fadeIn_0.5s_ease-in-out]",children:[jsxs("h1",{className:"text-3xl font-bold mb-4 flex items-center justify-center gap-2",children:[jsx("span",{className:"animate-[bounce_1s_infinite]",children:"\u26A0\uFE0F"}),"Erro de Licen\xE7a"]}),jsx("p",{className:"mb-4 text-red-600 dark:text-red-300",children:e}),jsx("p",{className:"text-lg text-red-600 dark:text-red-400",children:"Por favor, entre em contato com o suporte."}),jsx("button",{onClick:()=>window.location.reload(),className:"mt-6 px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700 transition-colors",children:"Tentar novamente"})]})}),St=({children:e,licenseKey:t})=>{let[r,n]=useState(!1),[o,i]=useState(null),[a,s]=useState(!0),l=f=>{if(i(null),!f)throw new Error("\u{1F512} Chave de licen\xE7a \xE9 obrigat\xF3ria");let c="chave-secreta-123";if(f!==c)throw new Error("\u274C Chave de licen\xE7a inv\xE1lida");n(!0);};return useEffect(()=>{if(t){s(!0);try{l(t);}catch(f){i(f instanceof Error?f.message:"Erro desconhecido na valida\xE7\xE3o da licen\xE7a");}finally{s(!1);}}else i("\u{1F512} Licen\xE7a n\xE3o informada"),s(!1);},[t]),a?null:jsx(Te.Provider,{value:{isLicenseValid:r,validateLicense:l,licenseError:o},children:r?e:jsx(Ft,{message:o||"Licen\xE7a inv\xE1lida"})})},ye=()=>{let e=useContext(Te);if(!e)throw new Error("useLicense deve ser usado dentro de um LicenseProvider");return e};var Pe=({message:e="Component locked - Please validate your license"})=>jsxs("div",{className:"flex items-start p-4 bg-red-50 border border-red-500 text-red-700 rounded-md gap-2",children:[jsx("span",{children:" \u274C Component locked - Please validate your license"}),jsx("span",{children:e})]});var g=e=>t=>{let{isLicenseValid:r}=ye();return r?jsx(e,{...t}):jsx(Pe,{})};var Ee=({items:e,type:t="single",defaultValue:r,value:n,onValueChange:o,className:i=""})=>{let a=c=>c===void 0?[]:Array.isArray(c)?c:[c],[s,l]=useState(a(n??r));useEffect(()=>{n!==void 0&&l(a(n));},[n]);let f=useCallback(c=>{l(x=>{let h;return t==="single"?h=x.includes(c)?[]:[c]:h=x.includes(c)?x.filter(d=>d!==c):[...x,c],o?.(t==="single"?h[0]??"":h),h});},[t,o]);return jsx("div",{className:`space-y-2 ${i}`,children:e.map(c=>jsx(Ot,{...c,isOpen:s.includes(c.id),onToggle:()=>f(c.id)},c.id))})},Ot=({title:e,content:t,disabled:r=!1,isOpen:n,onToggle:o})=>jsxs("div",{className:"border border-border rounded-md overflow-hidden",children:[jsx("button",{onClick:o,disabled:r,className:`w-full px-4 py-3 text-left font-medium transition-colors
|
|
7
7
|
${r?"opacity-50 cursor-not-allowed":"hover:bg-accent hover:text-accent-foreground"}
|
|
8
8
|
${n?"bg-accent text-accent-foreground":"bg-background text-foreground"}
|
|
9
|
-
`,children:jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{children:e}),jsx("svg",{className:`w-5 h-5 transition-transform ${n?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})}),n&&jsx("div",{className:"px-4 py-3 bg-background border-t border-border",children:t})]});Ee.displayName="Accordion";var pn=g(Ee);function u(...e){return twMerge(clsx(e))}var Ne=Ut.forwardRef(({className:e,overrideClassName:t,variant:r="primary",size:n="md",href:o,children:i,loading:a=!1,loadingContent:s,...l},f)=>{let c="inline-flex items-center justify-center rounded-lg font-medium cursor-pointer active:translate-y-1 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",x={primary:"bg-blue-600 text-white hover:bg-blue-700 shadow-md focus-visible:ring-blue-500",secondary:"bg-gray-600 text-white hover:bg-gray-700 shadow-sm focus-visible:ring-gray-500",tertiary:"bg-purple-600 text-white hover:bg-purple-700 shadow-sm focus-visible:ring-purple-500",destructive:"bg-red-600 text-white hover:bg-red-700 shadow-sm focus-visible:ring-red-500",success:"bg-green-600 text-white hover:bg-green-700 shadow-sm focus-visible:ring-green-500",warning:"bg-amber-500 text-white hover:bg-amber-600 shadow-sm focus-visible:ring-amber-500",info:"bg-cyan-600 text-white hover:bg-cyan-700 shadow-sm focus-visible:ring-cyan-500",accent:"bg-violet-600 text-white hover:bg-violet-700 shadow-sm focus-visible:ring-violet-500",outline:"border border-gray-300 bg-transparent text-gray-700 hover:bg-gray-50 shadow-sm focus-visible:ring-gray-500",ghost:"bg-transparent text-gray-700 hover:bg-gray-100 focus-visible:ring-gray-500",link:"text-blue-600 underline-offset-4 hover:underline bg-transparent p-0 h-auto shadow-none",gradient:"bg-gradient-to-r from-blue-600 to-purple-600 text-white hover:from-blue-700 hover:to-purple-700 shadow-md focus-visible:ring-blue-500",glass:"bg-white/10 backdrop-blur-md border border-white/20 text-black hover:bg-white/20 shadow-sm focus-visible:ring-white/50",soft:"bg-blue-100 text-blue-700 hover:bg-blue-200 shadow-sm focus-visible:ring-blue-500",dark:"bg-gray-900 text-white hover:bg-gray-800 shadow-md focus-visible:ring-gray-500",light:"bg-gray-100 text-gray-900 hover:bg-gray-200 shadow-sm focus-visible:ring-gray-500",obsidian:"bg-black text-white hover:bg-gray-900 shadow-md border border-gray-800 focus-visible:ring-gray-700",polar:"bg-white text-gray-900 hover:bg-gray-50 shadow-md border border-gray-300 focus-visible:ring-gray-400"},h={xs:"h-7 px-2 text-xs min-w-16",sm:"h-9 px-3 text-sm min-w-20",md:"h-10 px-4 py-2 text-base min-w-24",lg:"h-11 px-6 text-lg min-w-28",xl:"h-12 px-8 text-xl min-w-32"},d=t?e:u(c,x[r],h[n],e);return o?jsx("a",{href:o,className:d,ref:f,children:a&&s?s:i}):jsx("button",{className:d,ref:f,...l,children:a&&s?s:i})});Ne.displayName="Button";var Tn=g(Ne);var Me=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx("div",{ref:o,className:t?e:u("rounded-lg border bg-card text-card-foreground shadow-sm",e),...n,children:r}));Me.displayName="Card";var Ie=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx("div",{ref:o,className:t?e:u("flex flex-col space-y-1.5 p-6",e),...n,children:r}));Ie.displayName="CardHeader";var He=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx("h3",{ref:o,className:t?e:u("text-2xl font-semibold leading-none tracking-tight",e),...n,children:r}));He.displayName="CardTitle";var Ve=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx("p",{ref:o,className:t?e:u("text-sm text-muted-foreground",e),...n,children:r}));Ve.displayName="CardDescription";var Fe=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx("div",{ref:o,className:t?e:u("p-6 pt-0",e),...n,children:r}));Fe.displayName="CardContent";var Se=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx("div",{ref:o,className:t?e:u("flex items-center p-6 pt-0",e),...n,children:r}));Se.displayName="CardFooter";var kn=g(Me),Nn=g(Ie),Mn=g(He),In=g(Ve),Hn=g(Fe),Vn=g(Se);var ne=createContext(void 0),Ae=forwardRef(({children:e,className:t,...r},n)=>{let[o,i]=useState(!1);return jsx(ne.Provider,{value:{isOpen:o,setIsOpen:i},children:jsx("div",{ref:n,className:u("relative inline-block",t),...r,children:e})})});Ae.displayName="DropdownMenu";var $e=({children:e,asChild:t})=>{let r=useContext(ne);if(!r)throw new Error("DropdownMenuTrigger must be used within DropdownMenu");let n=()=>r.setIsOpen(!r.isOpen);if(t){let o=e;return cloneElement(o,{onClick:i=>{o.props.onClick?.(i),n();}})}return jsx("button",{onClick:n,children:e})};$e.displayName="DropdownMenuTrigger";var Be=forwardRef(({children:e,align:t="end",className:r,...n},o)=>{let i=useContext(ne),a=useRef(null);return useEffect(()=>{o&&(typeof o=="function"?o(a.current):o.current=a.current);},[o]),useEffect(()=>{let l=f=>{a.current&&!a.current.contains(f.target)&&i?.setIsOpen(!1);};return i?.isOpen&&document.addEventListener("mousedown",l),()=>{document.removeEventListener("mousedown",l);}},[i?.isOpen]),i?.isOpen?jsx("div",{ref:a,className:u("absolute z-50 mt-2 min-w-32 overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md",{start:"left-0",center:"left-1/2 -translate-x-1/2",end:"right-0"}[t],r),...n,children:e}):null});Be.displayName="DropdownMenuContent";var Oe=forwardRef(({children:e,onClick:t,destructive:r,className:n,...o},i)=>{let a=useContext(ne);return jsx("button",{ref:i,onClick:l=>{t?.(l),a?.setIsOpen(!1);},className:u("w-full text-left px-4 py-2 text-sm hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none",r&&"text-red-600 hover:bg-red-50 hover:text-red-700 focus:bg-red-50 focus:text-red-700",n),...o,children:e})});Oe.displayName="DropdownMenuItem";var Ge=forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,className:u("-mx-1 my-1 h-px bg-border",e),...t}));Ge.displayName="DropdownMenuSeparator";var Ke=forwardRef(({children:e,className:t,...r},n)=>jsx("div",{ref:n,className:u("px-2 py-1.5 text-sm font-semibold",t),...r,children:e}));Ke.displayName="DropdownMenuLabel";var On=g(Ae),Gn=g($e),Kn=g(Be),Un=g(Oe),qn=g(Ge),_n=g(Ke);var zt=({children:e,className:t,overrideClassName:r})=>{if(e)return jsx("p",{className:r?t:u("text-sm text-muted-foreground",t),children:e})},I=g(zt);var Zt=({children:e,required:t,className:r,overrideClassName:n=!1,...o})=>jsxs("div",{className:"flex items-center gap-1",children:[jsx("label",{...o,className:n?r:u("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),children:e}),t&&jsx("span",{className:"text-red-600",children:"*"})]}),L=g(Zt);var Yt=({children:e,className:t,overrideClassName:r})=>{if(e)return jsx("p",{className:r?t:u("text-sm text-red-600 dark:text-red-400",t),children:e})},H=g(Yt);var _e=forwardRef(({label:e,required:t,option:r,orientation:n="left",className:o,overrideClassName:i=!1,helperText:a,error:s,...l},f)=>{let c=useId(),x=u("h-4 w-4 rounded border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s&&"border-destructive",o);return jsxs("div",{className:"space-y-2",children:[e&&jsx(L,{required:t,children:e}),jsxs("div",{className:`flex ${n=="left"?"flex-row":"flex-row-reverse"} w-fit gap-2`,children:[jsx("input",{id:c,type:"checkbox",className:i?o:x,ref:f,...l}),r&&jsx(L,{htmlFor:c,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r})]}),s&&jsx(H,{children:s}),!s&&a&&jsx(I,{children:a})]})});_e.displayName="CheckBox";var uo=g(_e);function or(e,t){let{typeSet:r="field",multiCheck:n=!1,value:o,onChange:i,labelKey:a,valueKey:s,options:l,alignment:f="vertical",className:c,overrideClassName:x=!1,helperText:h,error:d,label:P,name:R,required:v,...T}=e,k=useId(),y=useMemo(()=>new Map(l.map(b=>[String(b[s]),b])),[l,s]),M=useMemo(()=>o==null?[]:r==="field"?n?o.map(b=>String(b)):[String(o)]:n?o.map(b=>String(b[s])):[String(o[s])],[o,r,n,s]),S=(b,w)=>{if(!i)return;let m;if(r==="field")if(n)m=b.map(C=>{let E=y.get(C);return E?E[s]:C});else {let p=b[0];if(!p)m=void 0;else {let C=y.get(p);m=C?C[s]:p;}}else n?m=b.map(C=>y.get(C)).filter(C=>C!==void 0):m=y.get(b[0]??"")??void 0;i({target:{name:R,value:m,type:"checkboxgroup",checked:w}});},V=b=>{let w;n?w=M.includes(b)?M.filter(m=>m!==b):[...M,b]:w=M[0]===b?[]:[b],S(w,w.includes(b));},N=f==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",F=u("h-4 w-4 rounded border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",d&&"border-destructive");return jsxs("div",{className:u("flex flex-col gap-3",c),children:[P&&jsx(L,{required:v,children:P}),jsx("div",{className:N,children:l.map((b,w)=>{let m=String(b[s]),p=M.includes(m),C=`${k}-${m}-${w}`;return jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{...T,id:C,ref:t,type:"checkbox",name:R,checked:p,onChange:()=>V(m),className:x?c:F}),jsx(L,{htmlFor:C,children:String(b[a])})]},C)})}),!!d&&jsx(H,{children:String(d)}),!d&&h&&jsx(I,{children:h})]})}function ar(){let e=forwardRef(or);return e.displayName="CheckBoxGroup",e}var ir=ar(),Po=g(ir);var sr=({...e})=>jsx("svg",{...e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),oe=sr;var cr=(e,t)=>{useEffect(()=>{let r=n=>{e.current&&!e.current.contains(n.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},Xe=cr;function de({options:e,labelKey:t,valueKey:r,multiple:n,onChange:o,setSearchTerm:i,typeSet:a,name:s}){let[l,f]=useState([]),c=useMemo(()=>new Map(e.map(v=>[String(v[r]),v])),[e,r]),x=useCallback(()=>l.map(v=>c.get(v)).filter(v=>!!v),[l,c]),h=useCallback(v=>{if(!o)return;let T;if(a==="field"?n?T=v:T=v[0]??void 0:n?T=v.map(y=>c.get(y)).filter(y=>y!==void 0):T=c.get(v[0]??"")??void 0,i&&!n){let k=c.get(v[0]??"");k&&i(String(k[t]));}o({target:{name:s,value:T,type:"combobox"}});},[n,o,c,s,a,i,t]),d=useCallback(v=>{let T=String(v[r]),k=n?l.includes(T)?l.filter(y=>y!==T):[...l,T]:[T];f(k),h(k);},[n,l,h,r]),P=useCallback(v=>{let T=l.filter(k=>k!==v);f(T),h(T);},[l,h]),R=useCallback(()=>{f([]),i?.("");let v;a==="field"?v=n?[]:"":v=n?[]:void 0,o?.({target:{name:s,value:v,type:"combobox"}});},[n,o,s,i,a]);return {selectedValues:l,handleSelect:d,handleRemove:P,handleClear:R,getSelectedOptions:x}}function me(e,t,r){return useMemo(()=>r?e.filter(o=>String(o[t]).toLowerCase().includes(r.toLowerCase())):e,[e,r,t])}var je=({isOpen:e,setIsOpen:t,multiple:r,searchTerm:n,setSearchTerm:o,selectedValues:i,filteredOptions:a,highlightedIndex:s,setHighlightedIndex:l,handleSelect:f,handleRemove:c})=>{let x=useCallback(d=>{if(a.length===0){l(-1);return}l(P=>P<0?d>0?0:a.length-1:(P+d+a.length)%a.length);},[a,l]);return useCallback(d=>{if(!e){if(d.key==="Enter"||d.key==="ArrowDown"){t(!0),l(0),d.preventDefault();return}r&&d.key==="Backspace"&&n===""&&i.length>0&&(d.preventDefault(),c(i[i.length-1]));return}switch(d.key){case"ArrowDown":d.preventDefault(),x(1);break;case"ArrowUp":d.preventDefault(),x(-1);break;case"Enter":d.preventDefault();let P=s>=0?s:0,R=a[P];R&&f(R),r&&o&&o(""),r||(t(!1),l(-1));break;case"Escape":d.preventDefault(),t(!1),l(-1),r||o("");break;case"Tab":t(!1),l(-1);break;case"Home":d.preventDefault(),a.length>0&&l(0);break;case"End":d.preventDefault(),a.length>0&&l(a.length-1);break;case"Backspace":r&&n===""&&i.length>0&&(d.preventDefault(),c(i[i.length-1]));break}},[e,r,n,i,a,s,t,o,l,f,c,x])};function Ye({option:e,labelKey:t,valueKey:r,onRemove:n}){let o=String(e[t]),i=String(e[r]);return jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded",children:[o,jsx("button",{type:"button",onMouseDown:a=>a.preventDefault(),onClick:()=>n(i),className:"hover:bg-blue-200 dark:hover:bg-blue-800 rounded-full p-0.5 transition-colors","aria-label":`Remover ${o}`,children:"\u2715"})]},i)}function xr(e,t){let{label:r,required:n=!1,name:o,placeholder:i="Buscar...",labelKey:a,valueKey:s,options:l,value:f,onChange:c,mode:x="single",typeSet:h="field",disabled:d=!1,ClearEnabled:P=!0,helperText:R,error:v=!1,className:T="",...k}=e,y=x==="multiple",[M,S]=useState(!1),[V,N]=useState(""),F=useRef(null),b=useRef(null),w=useRef(null);useImperativeHandle(t,()=>w.current),Xe(b,()=>S(!1));let m=me(l,a,V),[p,C]=useState(-1),{selectedValues:E,handleSelect:z,handleRemove:xe,handleClear:Rt,getSelectedOptions:he}=de({options:l,labelKey:a,valueKey:s,value:f,multiple:y,onChange:c,typeSet:h,name:o,setSearchTerm:N}),Et=je({isOpen:M,setIsOpen:S,multiple:y,searchTerm:V,setSearchTerm:N,selectedValues:E,filteredOptions:m,highlightedIndex:p,setHighlightedIndex:C,handleSelect:z,handleRemove:xe}),X=useId(),kt="w-full bg-transparent outline-none placeholder:text-gray-500 dark:placeholder:text-gray-400 text-gray-900 dark:text-gray-100",Nt=u("relative w-full min-h-[40px] px-3 py-2 border rounded-md bg-white dark:bg-gray-800",v?"border-red-500":"border-gray-300 dark:border-gray-600",d?"opacity-50 cursor-not-allowed":"cursor-text","focus-within:ring-2 focus-within:ring-blue-500 focus-within:border-blue-500");return jsxs("div",{className:`space-y-2 ${T}`,children:[r&&jsx(L,{htmlFor:X,required:n,children:r}),jsxs("div",{ref:F,className:"relative",children:[jsxs("div",{className:Nt,children:[y&&he().length>0&&jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:he().map((D,$)=>jsx(Ye,{option:D,labelKey:a,valueKey:s,onRemove:xe},String(D[s]??$)))}),jsx("input",{ref:w,...k,name:o,type:"text",placeholder:i,value:V,onChange:D=>{let $=D.target.value;N($),!M&&$.trim()!==""&&S(!0);},onKeyDown:Et,onMouseDown:D=>{document.activeElement===w.current&&(D.preventDefault(),S($=>{let Z=!$;return Z&&C(0),Z}));},onFocus:()=>{S(!0),C(0);},disabled:d,className:kt,role:"combobox","aria-expanded":M,"aria-controls":X,"aria-activedescendant":p>=0?`${X}-opt-${p}`:void 0}),P&&!!E.length&&jsx("button",{type:"button",onMouseDown:D=>D.preventDefault(),onClick:Rt,className:"absolute right-2 top-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700",title:"Limpar sele\xE7\xE3o",children:jsx(oe,{width:12,height:12})})]}),M&&jsx("div",{ref:b,id:X,className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto",role:"listbox","aria-multiselectable":y||void 0,children:m.length===0?jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"Nenhum resultado encontrado"}):m.map((D,$)=>{let Z=String(D[s]),ie=E.includes(Z),se=$===p;return jsx("button",{id:`${X}-opt-${$}`,"data-index":$,role:"option","aria-selected":ie,type:"button",onMouseDown:Mt=>Mt.preventDefault(),onClick:()=>z(D),className:u("w-full px-3 py-2 text-left text-sm transition-colors",se&&"bg-blue-100 dark:bg-blue-800 text-blue-900 dark:text-white",!se&&ie&&"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300",!ie&&!se&&"text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),children:jsx("span",{children:String(D[a])})},Z)})})]}),v&&jsx(H,{children:v}),!v&&R&&jsx(I,{children:R})]})}function hr(){let e=forwardRef(xr);return e.displayName="ComboBox",e}var Cr=hr(),Qo=g(Cr);var yr=({children:e,before:t,after:r,className:n})=>{let i=Tr("flex justify-center items-center",{"rounded-l-lg":t,"rounded-r-lg":r},n);return jsx("div",{className:i,children:jsx("span",{children:e})})},ge=yr;var wr=({children:e})=>jsx("div",{className:"absolute px-2",children:jsx("span",{children:e})}),tt=wr;var Pr=({children:e})=>jsx("div",{className:"absolute right-0 px-2",children:jsx("span",{children:e})}),nt=Pr;function ot(e){e.currentTarget.maxLength=9;let t=e.currentTarget.value;return t=t.replace(/\D/g,""),t=t.replace(/^(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function at(e){let t=e.currentTarget.value;t=t.replace(/\D/g,""),t=t.padStart(3,"0");let r=t.slice(0,-2),n=t.slice(-2),a=`${(r.replace(/^0+/,"")||"0").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1.")},${n}`;return e.currentTarget.value=a,e}function it(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value;return t.match(/^(\d{3}).(\d{3}).(\d{3})-(\d{2})$/)||(t=t.replace(/\D/g,""),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2"),e.currentTarget.value=t),e}function st(e){e.currentTarget.maxLength=15;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function lt(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{4})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function ct(e){let t=e.currentTarget.value.replace(/\D/g,"");return t.length<=11?(e.currentTarget.maxLength=14,t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2")):(e.currentTarget.maxLength=18,t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2")),e.currentTarget.value=t,e}function dt(e){e.currentTarget.maxLength=12;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{1})$/,"$1-$2"),e.currentTarget.value=t,e}function mt(e){e.currentTarget.maxLength=18;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2"),e.currentTarget.value=t,e}var Lr=({e,mask:t})=>{switch(t){case"money":return at(e);case"mobile":return st(e);case"phone":return lt(e);case"cpfCnpj":return ct(e);case"cpf":return it(e);case"rg":return dt(e);case"cnpj":return mt(e);case"cep":return ot(e);default:return e}},pt=Lr;var kr=({mask:e,initialValue:t=""})=>{let[r,n]=useState(t);useEffect(()=>{t!==r&&n(t);},[t]);let o=useCallback(a=>{let l=pt({e:a,mask:e})?.currentTarget?.value??a.currentTarget.value;n(l);},[e]),i=useCallback(()=>n(""),[]);return {value:r,setValue:n,handleChange:o,handleClear:i}},ft=kr;var gt=forwardRef(({label:e,required:t=!1,mask:r,name:n,prefix:o,suffix:i,addonBefore:a,addonBeforeClassName:s,addonAfter:l,addonAfterClassName:f,ClearEnabled:c=!0,className:x,overrideClassName:h=!1,error:d,helperText:P,value:R=void 0,onChange:v,...T},k)=>{let y=useId(),{handleChange:M,handleClear:S,setValue:V}=ft({mask:r,initialValue:R}),N=u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",d&&"border-destructive focus-visible:ring-destructive",!o&&!i&&"px-3",o&&!i&&"pl-10 pr-3",i&&!o&&"pl-3 pr-10",o&&i&&"pl-10 pr-10",a&&"rounded-l-none border-l-0",l&&"rounded-r-none border-r-0",x),F=w=>{M(w),v?.(w);},b=()=>{S(),V(""),v?.({target:{name:n||"",value:""}});};return jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsx(L,{htmlFor:y,required:t,children:e}),jsxs("div",{className:"relative flex",children:[a&&jsx(ge,{before:!0,className:s,children:a}),jsxs("div",{className:"relative flex items-center w-full",children:[o&&jsx(tt,{children:o}),jsx("input",{id:y,ref:k,name:n,onChange:F,className:h?x:N,...T}),c&&R&&jsx(oe,{onClick:b,width:12,height:12,className:u("absolute right-2 cursor-pointer",i&&"right-8")}),i&&jsx(nt,{children:i})]}),l&&jsx(ge,{after:!0,className:f,children:l})]}),d&&jsx(H,{children:d}),!d&&P&&jsx(I,{children:P})]})});gt.displayName="Input";var Ra=g(gt);var vt=forwardRef(({length:e=6,groupBy:t,value:r,name:n,label:o,required:i=!1,helperText:a,error:s,onChange:l,onBlur:f,className:c,charType:x="numeric",customPattern:h,caseMode:d="none",...P},R)=>{let v=useId(),T=useRef([]),k=m=>{switch(d){case"upper":return m.toUpperCase();case"lower":case"visual-upper":return m.toLowerCase();case"visual-lower":return m.toUpperCase();default:return m}},y=m=>{if(!m)return "";let p=m.slice(0,1);switch(p=k(p),x){case"numeric":return /\d/.test(p)?p:"";case"alpha":return /[A-Za-z]/.test(p)?p:"";case"alphanumeric":return /[A-Za-z0-9]/.test(p)?p:"";case"custom":return h?.test(p)?p:"";default:return p}},M=()=>(r!=null?String(r):"").split("").map(y).slice(0,e),S=M().concat(Array(e).fill(" ")).slice(0,e),V=m=>{let p=m.split("").map(y).join("").slice(0,e),C=p===""?void 0:typeof r=="number"?Number(p):p;l?.({target:{name:n,value:C}});},N=(m,p)=>{let C=y(p),E=M();if(C===""){E[m]="",V(E.join(""));return}if(p.length>1){let z=p.split("").map(y).join("").slice(0,e);V(z),T.current[Math.min(z.length-1,e-1)]?.focus();return}C&&(E[m]=C,V(E.join("")),m<e-1&&T.current[m+1]?.focus());},F=m=>{let p=M();!p[m]&&m>0?p[m-1]="":p[m]="",V(p.join("")),m>0&&T.current[m-1]?.focus();},b=m=>{m.preventDefault();let C=m.clipboardData.getData("text").split("").map(y).join("").slice(0,e);C&&(V(C),T.current[Math.min(C.length-1,e-1)]?.focus());},w=m=>{switch(d){case"upper":case"visual-upper":return m.toUpperCase();case"lower":case"visual-lower":return m.toLowerCase();default:return m}};return jsxs("div",{className:"flex flex-col gap-2 w-full",children:[o&&jsx(L,{htmlFor:v,required:i,children:o}),jsx("div",{className:u("flex gap-3 items-center",s&&"text-red-500",c),...P,children:S.map((m,p)=>{let C=t&&p>0&&p%t===0;return jsxs(Ut.Fragment,{children:[C&&jsx("span",{className:"flex items-center justify-center text-xl font-bold select-none",children:"-"}),jsx("input",{id:v,type:"text",maxLength:1,inputMode:x==="numeric"?"numeric":"text",value:w(m).trim(),ref:E=>{T.current[p]=E,p===0&&R&&(typeof R=="function"?R(E):typeof R=="object"&&(R.current=E));},onPaste:b,onChange:E=>N(p,E.target.value),onKeyDown:E=>E.key==="Backspace"&&F(p),onBlur:f,className:u("h-14 w-12 text-center text-2xl rounded-md border border-input bg-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s&&"border-red-500")})]},p)})}),s&&jsx(H,{children:s}),!s&&a&&jsx(I,{children:a})]})});vt.displayName="OtpInput";var Sa=g(vt);var ht=forwardRef(({label:e,required:t,option:r,className:n,overrideClassName:o,helperText:i,error:a,...s},l)=>{let f=useId(),c=u("h-4 w-4 border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a&&"border-destructive",n);return jsxs("div",{className:"space-y-3",children:[e&&jsx(L,{required:t,children:e}),jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{id:f,type:"radio",className:o?n:c,ref:l,...s}),r&&jsx(L,{htmlFor:f,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r})]}),a&&jsx(H,{children:a}),!a&&i&&jsx(I,{children:i})]})});ht.displayName="Radio";var qa=g(ht);function Br(e,t){let{label:r,required:n,name:o,labelKey:i,valueKey:a,options:s,alignment:l="vertical",className:f,overrideClassName:c=!1,helperText:x,error:h,typeSet:d="field",value:P,onChange:R,...v}=e,T=useId(),k=useMemo(()=>new Map(s.map(N=>[String(N[a]),N])),[s,a]),y=useMemo(()=>P==null?"":String(d==="field"?P:P[a]),[P,d,a]),M=N=>{if(!R)return;let F;if(d==="field"){let b=k.get(N);if(b)F=b[a];else {let w=Number(N);F=Number.isNaN(w)?N:w;}}else F=k.get(N)??void 0;R({target:{name:o,value:F,type:"radiogroup",checked:!0}});},S=l==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",V=u("h-4 w-4 rounded-full border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",h&&"border-destructive");return jsxs("div",{className:u("flex flex-col gap-3",f),children:[r&&jsx(L,{required:n,children:r}),jsx("div",{className:S,children:s.map((N,F)=>{let b=String(N[a]),w=`${T}-${b}-${F}`;return jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{...v,id:w,ref:t,name:o,type:"radio",checked:y===b,onChange:()=>M(b),className:c?f:V}),jsx(L,{htmlFor:w,children:String(N[i])})]},w)})}),h&&jsx(H,{children:String(h)}),!h&&x&&jsx(I,{children:x})]})}function Or(){let e=forwardRef(Br);return e.displayName="RadioGroup",e}var Gr=Or(),ti=g(Gr);function qr({label:e,required:t=!1,options:r,labelKey:n,valueKey:o,placeholder:i,error:a,helperText:s,className:l,...f},c){let x=useId(),h=u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",l);return jsxs("div",{className:"space-y-2",children:[e&&jsx(L,{htmlFor:x,required:t,children:e}),jsxs("select",{id:x,ref:c,className:h,...f,children:[i&&jsx("option",{value:"",disabled:!0,children:i}),r.map((d,P)=>jsx("option",{value:String(d[o]),children:String(d[n])},P))]}),a&&jsx(H,{children:a}),!a&&s&&jsx(I,{children:s})]})}function _r(){let e=forwardRef(qr);return e.displayName="Select",e}var Wr=_r(),pi=g(Wr);var Pt=forwardRef(({label:e,description:t,checked:r=!1,className:n,overrideClassName:o,error:i,name:a,...s},l)=>{let f=useId();return jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",id:f,name:a,checked:r,className:"peer sr-only",ref:l,...s}),jsx("label",{htmlFor:f,className:u("relative flex items-center h-6 w-11 cursor-pointer rounded-full bg-input transition-colors duration-200","peer-checked:bg-primary peer-focus:ring-2 peer-focus:ring-ring peer-focus:ring-offset-2 peer-focus:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50",n),children:jsx("span",{className:u("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",r?"translate-x-5":"translate-x-1")})}),(e||t)&&jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[e&&jsx(L,{id:`${f}-label`,htmlFor:f,className:"text-sm font-medium leading-none",children:e}),t&&jsx(L,{id:`${f}-description`,htmlFor:f,className:"text-xs text-muted-foreground",children:t})]})]})});Pt.displayName="Switch";var Ci=g(Pt);var Lt=Ut.forwardRef(({label:e,required:t,showCount:r,maxLength:n,className:o,overrideClassName:i=!1,error:a,helperText:s,...l},f)=>{let c=useId(),[x,h]=useState(0),d=u("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",o);return jsxs("div",{className:"space-y-2",children:[e&&jsx(L,{htmlFor:c,required:t,children:e}),jsxs("div",{className:"relative",children:[jsx("textarea",{id:c,className:i?o:d,maxLength:n,onInput:P=>h(P.currentTarget.textLength),ref:f,...l}),r&&jsxs("span",{className:"absolute bottom-2 right-3 text-xs text-muted-foreground",children:[x,n?` / ${n}`:""]})]}),a&&jsx(H,{children:a}),!a&&s&&jsx(I,{children:s})]})});Lt.displayName="Textarea";var Ni=g(Lt);
|
|
9
|
+
`,children:jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{children:e}),jsx("svg",{className:`w-5 h-5 transition-transform ${n?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})}),n&&jsx("div",{className:"px-4 py-3 bg-background border-t border-border",children:t})]});Ee.displayName="Accordion";var pn=g(Ee);function u(...e){return twMerge(clsx(e))}var Ne=Ut.forwardRef(({className:e,overrideClassName:t,variant:r="primary",size:n="md",href:o,children:i,loading:a=!1,loadingContent:s,...l},f)=>{let c="inline-flex items-center justify-center rounded-lg font-medium cursor-pointer active:translate-y-1 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",x={primary:"bg-blue-600 text-white hover:bg-blue-700 shadow-md focus-visible:ring-blue-500",secondary:"bg-gray-600 text-white hover:bg-gray-700 shadow-sm focus-visible:ring-gray-500",tertiary:"bg-purple-600 text-white hover:bg-purple-700 shadow-sm focus-visible:ring-purple-500",destructive:"bg-red-600 text-white hover:bg-red-700 shadow-sm focus-visible:ring-red-500",success:"bg-green-600 text-white hover:bg-green-700 shadow-sm focus-visible:ring-green-500",warning:"bg-amber-500 text-white hover:bg-amber-600 shadow-sm focus-visible:ring-amber-500",info:"bg-cyan-600 text-white hover:bg-cyan-700 shadow-sm focus-visible:ring-cyan-500",accent:"bg-violet-600 text-white hover:bg-violet-700 shadow-sm focus-visible:ring-violet-500",outline:"border border-gray-300 bg-transparent text-gray-700 hover:bg-gray-50 shadow-sm focus-visible:ring-gray-500",ghost:"bg-transparent text-gray-700 hover:bg-gray-100 focus-visible:ring-gray-500",link:"text-blue-600 underline-offset-4 hover:underline bg-transparent p-0 h-auto shadow-none",gradient:"bg-gradient-to-r from-blue-600 to-purple-600 text-white hover:from-blue-700 hover:to-purple-700 shadow-md focus-visible:ring-blue-500",glass:"bg-white/10 backdrop-blur-md border border-white/20 text-black hover:bg-white/20 shadow-sm focus-visible:ring-white/50",soft:"bg-blue-100 text-blue-700 hover:bg-blue-200 shadow-sm focus-visible:ring-blue-500",dark:"bg-gray-900 text-white hover:bg-gray-800 shadow-md focus-visible:ring-gray-500",light:"bg-gray-100 text-gray-900 hover:bg-gray-200 shadow-sm focus-visible:ring-gray-500",obsidian:"bg-black text-white hover:bg-gray-900 shadow-md border border-gray-800 focus-visible:ring-gray-700",polar:"bg-white text-gray-900 hover:bg-gray-50 shadow-md border border-gray-300 focus-visible:ring-gray-400"},h={xs:"h-7 px-2 text-xs min-w-16",sm:"h-9 px-3 text-sm min-w-20",md:"h-10 px-4 py-2 text-base min-w-24",lg:"h-11 px-6 text-lg min-w-28",xl:"h-12 px-8 text-xl min-w-32"},d=t?e:u(c,x[r],h[n],e);return o?jsx("a",{href:o,className:d,ref:f,children:a&&s?s:i}):jsx("button",{className:d,ref:f,...l,children:a&&s?s:i})});Ne.displayName="Button";var Tn=g(Ne);var Me=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx("div",{ref:o,className:t?e:u("rounded-lg border bg-card text-card-foreground shadow-sm",e),...n,children:r}));Me.displayName="Card";var Ie=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx("div",{ref:o,className:t?e:u("flex flex-col space-y-1.5 p-6",e),...n,children:r}));Ie.displayName="CardHeader";var He=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx("h3",{ref:o,className:t?e:u("text-2xl font-semibold leading-none tracking-tight",e),...n,children:r}));He.displayName="CardTitle";var Ve=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx("p",{ref:o,className:t?e:u("text-sm text-muted-foreground",e),...n,children:r}));Ve.displayName="CardDescription";var Fe=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx("div",{ref:o,className:t?e:u("p-6 pt-0",e),...n,children:r}));Fe.displayName="CardContent";var Se=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx("div",{ref:o,className:t?e:u("flex items-center p-6 pt-0",e),...n,children:r}));Se.displayName="CardFooter";var kn=g(Me),Nn=g(Ie),Mn=g(He),In=g(Ve),Hn=g(Fe),Vn=g(Se);var ne=createContext(void 0),Ae=forwardRef(({children:e,className:t,...r},n)=>{let[o,i]=useState(!1);return jsx(ne.Provider,{value:{isOpen:o,setIsOpen:i},children:jsx("div",{ref:n,className:u("relative inline-block",t),...r,children:e})})});Ae.displayName="DropdownMenu";var $e=({children:e,asChild:t})=>{let r=useContext(ne);if(!r)throw new Error("DropdownMenuTrigger must be used within DropdownMenu");let n=()=>r.setIsOpen(!r.isOpen);if(t){let o=e;return cloneElement(o,{onClick:i=>{o.props.onClick?.(i),n();}})}return jsx("button",{onClick:n,children:e})};$e.displayName="DropdownMenuTrigger";var Be=forwardRef(({children:e,align:t="end",className:r,...n},o)=>{let i=useContext(ne),a=useRef(null);return useEffect(()=>{o&&(typeof o=="function"?o(a.current):o.current=a.current);},[o]),useEffect(()=>{let l=f=>{a.current&&!a.current.contains(f.target)&&i?.setIsOpen(!1);};return i?.isOpen&&document.addEventListener("mousedown",l),()=>{document.removeEventListener("mousedown",l);}},[i?.isOpen]),i?.isOpen?jsx("div",{ref:a,className:u("absolute z-50 mt-2 min-w-32 overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md",{start:"left-0",center:"left-1/2 -translate-x-1/2",end:"right-0"}[t],r),...n,children:e}):null});Be.displayName="DropdownMenuContent";var Oe=forwardRef(({children:e,onClick:t,destructive:r,className:n,...o},i)=>{let a=useContext(ne);return jsx("button",{ref:i,onClick:l=>{t?.(l),a?.setIsOpen(!1);},className:u("w-full text-left px-4 py-2 text-sm hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none",r&&"text-red-600 hover:bg-red-50 hover:text-red-700 focus:bg-red-50 focus:text-red-700",n),...o,children:e})});Oe.displayName="DropdownMenuItem";var Ge=forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,className:u("-mx-1 my-1 h-px bg-border",e),...t}));Ge.displayName="DropdownMenuSeparator";var Ke=forwardRef(({children:e,className:t,...r},n)=>jsx("div",{ref:n,className:u("px-2 py-1.5 text-sm font-semibold",t),...r,children:e}));Ke.displayName="DropdownMenuLabel";var On=g(Ae),Gn=g($e),Kn=g(Be),Un=g(Oe),qn=g(Ge),_n=g(Ke);var zt=({children:e,className:t,overrideClassName:r})=>{if(e)return jsx("p",{className:r?t:u("text-sm text-muted-foreground",t),children:e})},I=g(zt);var Zt=({children:e,required:t,className:r,overrideClassName:n=!1,...o})=>jsxs("div",{className:"flex items-center gap-1",children:[jsx("label",{...o,className:n?r:u("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),children:e}),t&&jsx("span",{className:"text-red-600",children:"*"})]}),L=g(Zt);var Yt=({children:e,className:t,overrideClassName:r})=>{if(e)return jsx("p",{className:r?t:u("text-sm text-red-600 dark:text-red-400",t),children:e})},H=g(Yt);var _e=forwardRef(({label:e,required:t,option:r,orientation:n="left",className:o,overrideClassName:i=!1,helperText:a,error:s,...l},f)=>{let c=useId(),x=u("h-4 w-4 rounded border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s&&"border-destructive",o);return jsxs("div",{className:"space-y-2",children:[e&&jsx(L,{required:t,children:e}),jsxs("div",{className:`flex ${n=="left"?"flex-row":"flex-row-reverse"} w-fit gap-2`,children:[jsx("input",{id:c,type:"checkbox",className:i?o:x,ref:f,...l}),r&&jsx(L,{htmlFor:c,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r})]}),s&&jsx(H,{children:s}),!s&&a&&jsx(I,{children:a})]})});_e.displayName="CheckBox";var uo=g(_e);function or(e,t){let{typeSet:r="field",multiCheck:n=!1,value:o,onChange:i,labelKey:a,valueKey:s,options:l,alignment:f="vertical",className:c,overrideClassName:x=!1,helperText:h,error:d,label:P,name:R,required:v,...T}=e,k=useId(),y=useMemo(()=>new Map(l.map(b=>[String(b[s]),b])),[l,s]),M=useMemo(()=>o==null?[]:r==="field"?n?o.map(b=>String(b)):[String(o)]:n?o.map(b=>String(b[s])):[String(o[s])],[o,r,n,s]),S=(b,w)=>{if(!i)return;let m;if(r==="field")if(n)m=b.map(C=>{let E=y.get(C);return E?E[s]:C});else {let p=b[0];if(!p)m=void 0;else {let C=y.get(p);m=C?C[s]:p;}}else n?m=b.map(C=>y.get(C)).filter(C=>C!==void 0):m=y.get(b[0]??"")??void 0;i({target:{name:R,value:m,type:"checkboxgroup",checked:w}});},V=b=>{let w;n?w=M.includes(b)?M.filter(m=>m!==b):[...M,b]:w=M[0]===b?[]:[b],S(w,w.includes(b));},N=f==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",F=u("h-4 w-4 rounded border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",d&&"border-destructive");return jsxs("div",{className:u("flex flex-col gap-3",c),children:[P&&jsx(L,{required:v,children:P}),jsx("div",{className:N,children:l.map((b,w)=>{let m=String(b[s]),p=M.includes(m),C=`${k}-${m}-${w}`;return jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{...T,id:C,ref:t,type:"checkbox",name:R,checked:p,onChange:()=>V(m),className:x?c:F}),jsx(L,{htmlFor:C,children:String(b[a])})]},C)})}),!!d&&jsx(H,{children:String(d)}),!d&&h&&jsx(I,{children:h})]})}function ar(){let e=forwardRef(or);return e.displayName="CheckBoxGroup",e}var ir=ar(),Po=g(ir);var sr=({...e})=>jsx("svg",{...e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),oe=sr;var cr=(e,t)=>{useEffect(()=>{let r=n=>{e.current&&!e.current.contains(n.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},Xe=cr;function de({options:e,labelKey:t,valueKey:r,multiple:n,onChange:o,setSearchTerm:i,typeSet:a,name:s}){let[l,f]=useState([]),c=useMemo(()=>new Map(e.map(v=>[String(v[r]),v])),[e,r]),x=useCallback(()=>l.map(v=>c.get(v)).filter(v=>!!v),[l,c]),h=useCallback(v=>{if(!o)return;let T;if(a==="field"?n?T=v:T=v[0]??void 0:n?T=v.map(y=>c.get(y)).filter(y=>y!==void 0):T=c.get(v[0]??"")??void 0,i&&!n){let k=c.get(v[0]??"");k&&i(String(k[t]));}o({target:{name:s,value:T,type:"combobox"}});},[n,o,c,s,a,i,t]),d=useCallback(v=>{let T=String(v[r]),k=n?l.includes(T)?l.filter(y=>y!==T):[...l,T]:[T];f(k),h(k);},[n,l,h,r]),P=useCallback(v=>{let T=l.filter(k=>k!==v);f(T),h(T);},[l,h]),R=useCallback(()=>{f([]),i?.("");let v;a==="field"?v=n?[]:"":v=n?[]:void 0,o?.({target:{name:s,value:v,type:"combobox"}});},[n,o,s,i,a]);return {selectedValues:l,handleSelect:d,handleRemove:P,handleClear:R,getSelectedOptions:x}}function me(e,t,r){return useMemo(()=>r?e.filter(o=>String(o[t]).toLowerCase().includes(r.toLowerCase())):e,[e,r,t])}var je=({isOpen:e,setIsOpen:t,multiple:r,searchTerm:n,setSearchTerm:o,selectedValues:i,filteredOptions:a,highlightedIndex:s,setHighlightedIndex:l,handleSelect:f,handleRemove:c})=>{let x=useCallback(d=>{if(a.length===0){l(-1);return}l(P=>P<0?d>0?0:a.length-1:(P+d+a.length)%a.length);},[a,l]);return useCallback(d=>{if(!e){if(d.key==="Enter"||d.key==="ArrowDown"){t(!0),l(0),d.preventDefault();return}r&&d.key==="Backspace"&&n===""&&i.length>0&&(d.preventDefault(),c(i[i.length-1]));return}switch(d.key){case"ArrowDown":d.preventDefault(),x(1);break;case"ArrowUp":d.preventDefault(),x(-1);break;case"Enter":d.preventDefault();let P=s>=0?s:0,R=a[P];R&&f(R),r&&o&&o(""),r||(t(!1),l(-1));break;case"Escape":d.preventDefault(),t(!1),l(-1),r||o("");break;case"Tab":t(!1),l(-1);break;case"Home":d.preventDefault(),a.length>0&&l(0);break;case"End":d.preventDefault(),a.length>0&&l(a.length-1);break;case"Backspace":r&&n===""&&i.length>0&&(d.preventDefault(),c(i[i.length-1]));break}},[e,r,n,i,a,s,t,o,l,f,c,x])};function Ye({option:e,labelKey:t,valueKey:r,onRemove:n}){let o=String(e[t]),i=String(e[r]);return jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded",children:[o,jsx("button",{type:"button",onMouseDown:a=>a.preventDefault(),onClick:()=>n(i),className:"hover:bg-blue-200 dark:hover:bg-blue-800 rounded-full p-0.5 transition-colors","aria-label":`Remover ${o}`,children:"\u2715"})]},i)}function xr(e,t){let{label:r,required:n=!1,name:o,placeholder:i="Buscar...",labelKey:a,valueKey:s,options:l,value:f,onChange:c,mode:x="single",typeSet:h="field",disabled:d=!1,ClearEnabled:P=!0,helperText:R,error:v=!1,className:T="",...k}=e,y=x==="multiple",[M,S]=useState(!1),[V,N]=useState(""),F=useRef(null),b=useRef(null),w=useRef(null);useImperativeHandle(t,()=>w.current),Xe(b,()=>S(!1));let m=me(l,a,V),[p,C]=useState(-1),{selectedValues:E,handleSelect:z,handleRemove:xe,handleClear:Rt,getSelectedOptions:he}=de({options:l,labelKey:a,valueKey:s,value:f,multiple:y,onChange:c,typeSet:h,name:o,setSearchTerm:N}),Et=je({isOpen:M,setIsOpen:S,multiple:y,searchTerm:V,setSearchTerm:N,selectedValues:E,filteredOptions:m,highlightedIndex:p,setHighlightedIndex:C,handleSelect:z,handleRemove:xe}),X=useId(),kt="w-full bg-transparent outline-none placeholder:text-gray-500 dark:placeholder:text-gray-400 text-gray-900 dark:text-gray-100",Nt=u("relative w-full min-h-[40px] px-3 py-2 border rounded-md bg-white dark:bg-gray-800",v?"border-red-500":"border-gray-300 dark:border-gray-600",d?"opacity-50 cursor-not-allowed":"cursor-text","focus-within:ring-2 focus-within:ring-blue-500 focus-within:border-blue-500");return jsxs("div",{className:`space-y-2 ${T}`,children:[r&&jsx(L,{htmlFor:X,required:n,children:r}),jsxs("div",{ref:F,className:"relative",children:[jsxs("div",{className:Nt,children:[y&&he().length>0&&jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:he().map((D,$)=>jsx(Ye,{option:D,labelKey:a,valueKey:s,onRemove:xe},String(D[s]??$)))}),jsx("input",{ref:w,...k,name:o,type:"text",placeholder:i,value:V,onChange:D=>{let $=D.target.value;N($),!M&&$.trim()!==""&&S(!0);},onKeyDown:Et,onMouseDown:D=>{document.activeElement===w.current&&(D.preventDefault(),S($=>{let Z=!$;return Z&&C(0),Z}));},onFocus:()=>{S(!0),C(0);},disabled:d,className:kt,role:"combobox","aria-expanded":M,"aria-controls":X,"aria-activedescendant":p>=0?`${X}-opt-${p}`:void 0}),P&&!!E.length&&jsx("button",{type:"button",onMouseDown:D=>D.preventDefault(),onClick:Rt,className:"absolute right-2 top-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700",title:"Limpar sele\xE7\xE3o",children:jsx(oe,{width:12,height:12})})]}),M&&jsx("div",{ref:b,id:X,className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto",role:"listbox","aria-multiselectable":y||void 0,children:m.length===0?jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"Nenhum resultado encontrado"}):m.map((D,$)=>{let Z=String(D[s]),ie=E.includes(Z),se=$===p;return jsx("button",{id:`${X}-opt-${$}`,"data-index":$,role:"option","aria-selected":ie,type:"button",onMouseDown:Mt=>Mt.preventDefault(),onClick:()=>z(D),className:u("w-full px-3 py-2 text-left text-sm transition-colors",se&&"bg-blue-100 dark:bg-blue-800 text-blue-900 dark:text-white",!se&&ie&&"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300",!ie&&!se&&"text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),children:jsx("span",{children:String(D[a])})},Z)})})]}),v&&jsx(H,{children:v}),!v&&R&&jsx(I,{children:R})]})}function hr(){let e=forwardRef(xr);return e.displayName="ComboBox",e}var Cr=hr(),Qo=g(Cr);var yr=({children:e,before:t,after:r,className:n})=>{let i=Tr("flex justify-center items-center",{"rounded-l-lg":t,"rounded-r-lg":r},n);return jsx("div",{className:i,children:jsx("span",{children:e})})},ge=yr;var wr=({children:e})=>jsx("div",{className:"absolute px-2",children:jsx("span",{children:e})}),tt=wr;var Pr=({children:e})=>jsx("div",{className:"absolute right-0 px-2",children:jsx("span",{children:e})}),nt=Pr;function ot(e){e.currentTarget.maxLength=9;let t=e.currentTarget.value;return t=t.replace(/\D/g,""),t=t.replace(/^(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function at(e){let t=e.currentTarget.value;t=t.replace(/\D/g,""),t=t.padStart(3,"0");let r=t.slice(0,-2),n=t.slice(-2),a=`${(r.replace(/^0+/,"")||"0").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1.")},${n}`;return e.currentTarget.value=a,e}function it(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value;return t.match(/^(\d{3}).(\d{3}).(\d{3})-(\d{2})$/)||(t=t.replace(/\D/g,""),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2"),e.currentTarget.value=t),e}function st(e){e.currentTarget.maxLength=15;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function lt(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{4})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function ct(e){let t=e.currentTarget.value.replace(/\D/g,"");return t.length<=11?(e.currentTarget.maxLength=14,t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2")):(e.currentTarget.maxLength=18,t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2")),e.currentTarget.value=t,e}function dt(e){e.currentTarget.maxLength=12;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{1})$/,"$1-$2"),e.currentTarget.value=t,e}function mt(e){e.currentTarget.maxLength=18;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2"),e.currentTarget.value=t,e}var Lr=({e,mask:t})=>{switch(t){case"money":return at(e);case"mobile":return st(e);case"phone":return lt(e);case"cpfCnpj":return ct(e);case"cpf":return it(e);case"rg":return dt(e);case"cnpj":return mt(e);case"cep":return ot(e);default:return e}},pt=Lr;var kr=({mask:e,initialValue:t=""})=>{let[r,n]=useState(t);useEffect(()=>{t!==r&&n(t);},[t]);let o=useCallback(a=>{let l=pt({e:a,mask:e})?.currentTarget?.value??a.currentTarget.value;n(l);},[e]),i=useCallback(()=>n(""),[]);return {value:r,setValue:n,handleChange:o,handleClear:i}},ft=kr;var gt=forwardRef(({label:e,required:t=!1,mask:r,name:n,prefix:o,suffix:i,addonBefore:a,addonBeforeClassName:s,addonAfter:l,addonAfterClassName:f,ClearEnabled:c=!0,className:x,overrideClassName:h=!1,error:d,helperText:P,value:R=void 0,onChange:v,...T},k)=>{let y=useId(),{handleChange:M,handleClear:S,setValue:V}=ft({mask:r,initialValue:R}),N=u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",d&&"border-destructive focus-visible:ring-destructive",!o&&!i&&"px-3",o&&!i&&"pl-10 pr-3",i&&!o&&"pl-3 pr-10",o&&i&&"pl-10 pr-10",a&&"rounded-l-none border-l-0",l&&"rounded-r-none border-r-0",x),F=w=>{M(w),v?.(w);},b=()=>{S(),V(""),v?.({target:{name:n||"",value:""}});};return jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsx(L,{htmlFor:y,required:t,children:e}),jsxs("div",{className:"relative flex",children:[a&&jsx(ge,{before:!0,className:s,children:a}),jsxs("div",{className:"relative flex items-center w-full",children:[o&&jsx(tt,{children:o}),jsx("input",{id:y,ref:k,name:n,onChange:F,className:h?x:N,...T}),c&&R&&jsx(oe,{onClick:b,width:12,height:12,className:u("absolute right-2 cursor-pointer",i&&"right-8")}),i&&jsx(nt,{children:i})]}),l&&jsx(ge,{after:!0,className:f,children:l})]}),d&&jsx(H,{children:d}),!d&&P&&jsx(I,{children:P})]})});gt.displayName="Input";var Ra=g(gt);var vt=forwardRef(({length:e=6,groupBy:t,value:r,name:n,label:o,required:i=!1,helperText:a,error:s,onChange:l,onBlur:f,className:c,charType:x="numeric",customPattern:h,caseMode:d="none",...P},R)=>{let v=useId(),T=useRef([]),k=m=>{switch(d){case"upper":return m.toUpperCase();case"lower":case"visual-upper":return m.toLowerCase();case"visual-lower":return m.toUpperCase();default:return m}},y=m=>{if(!m)return "";let p=m.slice(0,1);switch(p=k(p),x){case"numeric":return /\d/.test(p)?p:"";case"alpha":return /[A-Za-z]/.test(p)?p:"";case"alphanumeric":return /[A-Za-z0-9]/.test(p)?p:"";case"custom":return h?.test(p)?p:"";default:return p}},M=()=>(r!=null?String(r):"").split("").map(y).slice(0,e),S=M().concat(Array(e).fill(" ")).slice(0,e),V=m=>{let p=m.split("").map(y).join("").slice(0,e),C=p===""?void 0:typeof r=="number"?Number(p):p;l?.({target:{name:n,value:C}});},N=(m,p)=>{let C=y(p),E=M();if(C===""){E[m]="",V(E.join(""));return}if(p.length>1){let z=p.split("").map(y).join("").slice(0,e);V(z),T.current[Math.min(z.length-1,e-1)]?.focus();return}C&&(E[m]=C,V(E.join("")),m<e-1&&T.current[m+1]?.focus());},F=m=>{let p=M();!p[m]&&m>0?p[m-1]="":p[m]="",V(p.join("")),m>0&&T.current[m-1]?.focus();},b=m=>{m.preventDefault();let C=m.clipboardData.getData("text").split("").map(y).join("").slice(0,e);C&&(V(C),T.current[Math.min(C.length-1,e-1)]?.focus());},w=m=>{switch(d){case"upper":case"visual-upper":return m.toUpperCase();case"lower":case"visual-lower":return m.toLowerCase();default:return m}};return jsxs("div",{className:"flex flex-col gap-2 w-full",children:[o&&jsx(L,{htmlFor:v,required:i,children:o}),jsx("div",{className:u("flex gap-3 items-center",s&&"text-red-500",c),...P,children:S.map((m,p)=>{let C=t&&p>0&&p%t===0;return jsxs(Ut.Fragment,{children:[C&&jsx("span",{className:"flex items-center justify-center text-xl font-bold select-none",children:"-"}),jsx("input",{id:v,type:"text",maxLength:1,inputMode:x==="numeric"?"numeric":"text",value:w(m).trim(),ref:E=>{T.current[p]=E,p===0&&R&&(typeof R=="function"?R(E):typeof R=="object"&&(R.current=E));},onPaste:b,onChange:E=>N(p,E.target.value),onKeyDown:E=>E.key==="Backspace"&&F(p),onBlur:f,className:u("h-14 w-12 text-center text-2xl rounded-md border border-input bg-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s&&"border-red-500")})]},p)})}),s&&jsx(H,{children:s}),!s&&a&&jsx(I,{children:a})]})});vt.displayName="OtpInput";var Sa=g(vt);var ht=forwardRef(({label:e,required:t,option:r,className:n,overrideClassName:o,helperText:i,error:a,...s},l)=>{let f=useId(),c=u("h-4 w-4 border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a&&"border-destructive",n);return jsxs("div",{className:"space-y-3",children:[e&&jsx(L,{required:t,children:e}),jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{id:f,type:"radio",className:o?n:c,ref:l,...s}),r&&jsx(L,{htmlFor:f,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r})]}),a&&jsx(H,{children:a}),!a&&i&&jsx(I,{children:i})]})});ht.displayName="Radio";var qa=g(ht);function Br(e,t){let{label:r,required:n,name:o,labelKey:i,valueKey:a,options:s,alignment:l="vertical",className:f,overrideClassName:c=!1,helperText:x,error:h,typeSet:d="field",value:P,onChange:R,...v}=e,T=useId(),k=useMemo(()=>new Map(s.map(N=>[String(N[a]),N])),[s,a]),y=useMemo(()=>P==null?"":String(d==="field"?P:P[a]),[P,d,a]),M=N=>{if(!R)return;let F;if(d==="field"){let b=k.get(N);if(b)F=b[a];else {let w=Number(N);F=Number.isNaN(w)?N:w;}}else F=k.get(N)??void 0;R({target:{name:o,value:F,type:"radiogroup",checked:!0}});},S=l==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",V=u("h-4 w-4 rounded-full border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",h&&"border-destructive");return jsxs("div",{className:u("flex flex-col gap-3",f),children:[r&&jsx(L,{required:n,children:r}),jsx("div",{className:S,children:s.map((N,F)=>{let b=String(N[a]),w=`${T}-${b}-${F}`;return jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{...v,id:w,ref:t,name:o,type:"radio",checked:y===b,onChange:()=>M(b),className:c?f:V}),jsx(L,{htmlFor:w,children:String(N[i])})]},w)})}),h&&jsx(H,{children:String(h)}),!h&&x&&jsx(I,{children:x})]})}function Or(){let e=forwardRef(Br);return e.displayName="RadioGroup",e}var Gr=Or(),ti=g(Gr);function qr({label:e,required:t=!1,options:r,labelKey:n,valueKey:o,placeholder:i,error:a,helperText:s,className:l,...f},c){let x=useId(),h=u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",l);return jsxs("div",{className:"space-y-2",children:[e&&jsx(L,{htmlFor:x,required:t,children:e}),jsxs("select",{id:x,ref:c,className:h,...f,children:[i&&jsx("option",{value:"",disabled:!0,children:i}),r.map((d,P)=>jsx("option",{value:String(d[o]),children:String(d[n])},P))]}),a&&jsx(H,{children:a}),!a&&s&&jsx(I,{children:s})]})}function _r(){let e=forwardRef(qr);return e.displayName="Select",e}var Wr=_r(),pi=g(Wr);var Pt=forwardRef(({label:e,description:t,checked:r=!1,className:n,overrideClassName:o,error:i,name:a,...s},l)=>{let f=useId();return jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",id:f,name:a,checked:r,className:"peer sr-only",ref:l,...s}),jsx("label",{htmlFor:f,className:u("relative flex items-center h-6 w-11 cursor-pointer rounded-full bg-input transition-colors duration-200","peer-checked:bg-primary peer-focus:ring-2 peer-focus:ring-ring peer-focus:ring-offset-2 peer-focus:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50",n),children:jsx("span",{className:u("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",r?"translate-x-5":"translate-x-1")})}),(e||t)&&jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[e&&jsx(L,{id:`${f}-label`,htmlFor:f,className:"text-sm font-medium leading-none",children:e}),t&&jsx(L,{id:`${f}-description`,htmlFor:f,className:"text-xs text-muted-foreground",children:t})]})]})});Pt.displayName="Switch";var Ci=g(Pt);var Lt=Ut.forwardRef(({label:e,required:t,showCount:r,maxLength:n,className:o,overrideClassName:i=!1,error:a,helperText:s,...l},f)=>{let c=useId(),[x,h]=useState(0),d=u("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",o);return jsxs("div",{className:"space-y-2",children:[e&&jsx(L,{htmlFor:c,required:t,children:e}),jsxs("div",{className:"relative",children:[jsx("textarea",{id:c,className:i?o:d,maxLength:n,onInput:P=>h(P.currentTarget.textLength),ref:f,...l}),r&&jsxs("span",{className:"absolute bottom-2 right-3 text-xs text-muted-foreground",children:[x,n?` / ${n}`:""]})]}),a&&jsx(H,{children:a}),!a&&s&&jsx(I,{children:s})]})});Lt.displayName="TextArea";var Ni=g(Lt);
|
|
10
10
|
|
|
11
|
-
export { pn as AccordionPrimitive, Tn as ButtonPrimitive, Hn as CardContentPrimitive, In as CardDescriptionPrimitive, Vn as CardFooterPrimitive, Nn as CardHeaderPrimitive, kn as CardPrimitive, Mn as CardTitlePrimitive, Po as CheckBoxGroupPrimitive, uo as CheckBoxPrimitive, Qo as ComboBoxPrimitive, Kn as DropdownMenuContentPrimitive, Un as DropdownMenuItemPrimitive, _n as DropdownMenuLabelPrimitive, On as DropdownMenuPrimitive, qn as DropdownMenuSeparatorPrimitive, Gn as DropdownMenuTriggerPrimitive, I as HelperFieldPrimitive, Ra as InputPrimitive, L as LabelPrimitive, St as LicenseProvider, Sa as OtpInputPrimitive, ti as RadioGroupPrimitive, qa as RadioPrimitive, pi as SelectPrimitive, Ci as SwitchPrimitive, Ni as
|
|
11
|
+
export { pn as AccordionPrimitive, Tn as ButtonPrimitive, Hn as CardContentPrimitive, In as CardDescriptionPrimitive, Vn as CardFooterPrimitive, Nn as CardHeaderPrimitive, kn as CardPrimitive, Mn as CardTitlePrimitive, Po as CheckBoxGroupPrimitive, uo as CheckBoxPrimitive, Qo as ComboBoxPrimitive, Kn as DropdownMenuContentPrimitive, Un as DropdownMenuItemPrimitive, _n as DropdownMenuLabelPrimitive, On as DropdownMenuPrimitive, qn as DropdownMenuSeparatorPrimitive, Gn as DropdownMenuTriggerPrimitive, I as HelperFieldPrimitive, Ra as InputPrimitive, L as LabelPrimitive, St as LicenseProvider, Sa as OtpInputPrimitive, ti as RadioGroupPrimitive, qa as RadioPrimitive, pi as SelectPrimitive, Ci as SwitchPrimitive, Ni as TextAreaPrimitive, H as ValidateFieldPrimitive };
|