@mvr-ui/components 1.0.45 → 1.0.47

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 CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React$1 from 'react';
2
- import React__default, { JSX } from 'react';
2
+ import React__default from 'react';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
 
5
5
  declare const LicenseProvider: React__default.FC<{
@@ -16,7 +16,7 @@ interface ButtonProps extends React__default.ButtonHTMLAttributes<HTMLButtonElem
16
16
  loading?: boolean;
17
17
  loadingContent?: React__default.ReactNode;
18
18
  }
19
- declare const ButtonPrimitive: React__default.ForwardRefExoticComponent<ButtonProps & React__default.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
19
+ declare const ButtonPrimitive: (props: ButtonProps & React__default.RefAttributes<HTMLButtonElement | HTMLAnchorElement>) => react_jsx_runtime.JSX.Element;
20
20
 
21
21
  interface CardProps extends React__default.HTMLAttributes<HTMLDivElement> {
22
22
  children: React__default.ReactNode;
@@ -42,12 +42,12 @@ interface CardFooterProps extends React__default.HTMLAttributes<HTMLDivElement>
42
42
  children: React__default.ReactNode;
43
43
  overrideClassName?: boolean;
44
44
  }
45
- declare const CardPrimitive: React__default.ForwardRefExoticComponent<CardProps & React__default.RefAttributes<HTMLDivElement>>;
46
- declare const CardHeaderPrimitive: React__default.ForwardRefExoticComponent<CardHeaderProps & React__default.RefAttributes<HTMLDivElement>>;
47
- declare const CardTitlePrimitive: React__default.ForwardRefExoticComponent<CardTitleProps & React__default.RefAttributes<HTMLHeadingElement>>;
48
- declare const CardDescriptionPrimitive: React__default.ForwardRefExoticComponent<CardDescriptionProps & React__default.RefAttributes<HTMLParagraphElement>>;
49
- declare const CardContentPrimitive: React__default.ForwardRefExoticComponent<CardContentProps & React__default.RefAttributes<HTMLDivElement>>;
50
- declare const CardFooterPrimitive: React__default.ForwardRefExoticComponent<CardFooterProps & React__default.RefAttributes<HTMLDivElement>>;
45
+ declare const CardPrimitive: (props: CardProps & React__default.RefAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
46
+ declare const CardHeaderPrimitive: (props: CardHeaderProps & React__default.RefAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
47
+ declare const CardTitlePrimitive: (props: CardTitleProps & React__default.RefAttributes<HTMLHeadingElement>) => react_jsx_runtime.JSX.Element;
48
+ declare const CardDescriptionPrimitive: (props: CardDescriptionProps & React__default.RefAttributes<HTMLParagraphElement>) => react_jsx_runtime.JSX.Element;
49
+ declare const CardContentPrimitive: (props: CardContentProps & React__default.RefAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
50
+ declare const CardFooterPrimitive: (props: CardFooterProps & React__default.RefAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
51
51
 
52
52
  interface CheckBoxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type"> {
53
53
  label?: string;
@@ -59,7 +59,7 @@ interface CheckBoxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>
59
59
  helperText?: string;
60
60
  error?: string;
61
61
  }
62
- declare const CheckBoxPrimitive: React$1.ForwardRefExoticComponent<CheckBoxProps & React$1.RefAttributes<HTMLInputElement>>;
62
+ declare const CheckBoxPrimitive: (props: CheckBoxProps & React$1.RefAttributes<HTMLInputElement>) => react_jsx_runtime.JSX.Element;
63
63
 
64
64
  type InputFormatTypeAttribute = "money" | "cpf" | "cnpj" | "cpfCnpj" | "cep" | "mobile" | "phone" | "percentage" | "rg";
65
65
 
@@ -79,7 +79,7 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "
79
79
  error?: string;
80
80
  helperText?: string;
81
81
  }
82
- declare const InputPrimitive: React$1.ForwardRefExoticComponent<InputProps & React$1.RefAttributes<HTMLInputElement>>;
82
+ declare const InputPrimitive: (props: InputProps & React$1.RefAttributes<HTMLInputElement>) => react_jsx_runtime.JSX.Element;
83
83
 
84
84
  interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
85
85
  children?: React.ReactNode;
@@ -87,7 +87,7 @@ interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
87
87
  className?: string;
88
88
  overrideClassName?: boolean;
89
89
  }
90
- declare const LabelPrimitive: React$1.FunctionComponent<LabelProps>;
90
+ declare const LabelPrimitive: (props: LabelProps) => react_jsx_runtime.JSX.Element;
91
91
 
92
92
  interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type"> {
93
93
  label?: string;
@@ -98,9 +98,9 @@ interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "
98
98
  helperText?: string;
99
99
  error?: string;
100
100
  }
101
- declare const RadioPrimitive: React$1.ForwardRefExoticComponent<RadioProps & React$1.RefAttributes<HTMLInputElement>>;
101
+ declare const RadioPrimitive: (props: RadioProps & React$1.RefAttributes<HTMLInputElement>) => react_jsx_runtime.JSX.Element;
102
102
 
103
- interface SelectProps<T extends object = any> extends Omit<React__default.SelectHTMLAttributes<HTMLSelectElement>, "children"> {
103
+ interface SelectProps<T extends object> extends Omit<React__default.SelectHTMLAttributes<HTMLSelectElement>, "children"> {
104
104
  label?: string;
105
105
  required?: boolean;
106
106
  options: T[];
@@ -110,9 +110,9 @@ interface SelectProps<T extends object = any> extends Omit<React__default.Select
110
110
  error?: string;
111
111
  helperText?: string;
112
112
  }
113
- declare const SelectPrimitive: <T extends object = any>(p: SelectProps<T> & {
113
+ declare const SelectPrimitive: (props: SelectProps<object> & {
114
114
  ref?: React__default.ForwardedRef<HTMLSelectElement>;
115
- }) => JSX.Element;
115
+ }) => react_jsx_runtime.JSX.Element;
116
116
 
117
117
  type Mode = 'multiple' | 'single';
118
118
 
@@ -146,13 +146,27 @@ type ComboBoxProps<T, V extends AllowedComboValue<T>> = CommonProps<T> & {
146
146
  value?: V;
147
147
  onChange?: (e: ChangeEvent<V>) => void;
148
148
  };
149
- type ComboBoxComponent = {
150
- <T, V extends AllowedComboValue<T>>(props: ComboBoxProps<T, V> & {
151
- ref?: React__default.Ref<HTMLInputElement>;
152
- }): JSX.Element;
153
- displayName?: string;
154
- };
155
- declare const ComboBoxPrimitive: ComboBoxComponent;
149
+ declare const ComboBoxPrimitive: (props: Omit<React__default.InputHTMLAttributes<HTMLInputElement>, "value" | "type" | "onChange"> & {
150
+ label?: string;
151
+ required?: boolean;
152
+ name: string;
153
+ placeholder?: string;
154
+ labelKey: never;
155
+ valueKey: never;
156
+ options: unknown[];
157
+ typeSet?: TypeSet;
158
+ mode?: Mode;
159
+ disabled?: boolean;
160
+ ClearEnabled?: boolean;
161
+ helperText?: string;
162
+ error?: boolean;
163
+ className?: string;
164
+ } & {
165
+ value?: unknown;
166
+ onChange?: ((e: ChangeEvent<unknown>) => void) | undefined;
167
+ } & {
168
+ ref?: React__default.Ref<HTMLInputElement>;
169
+ }) => react_jsx_runtime.JSX.Element;
156
170
 
157
171
  interface SwitchHTMLCustomAttributes {
158
172
  label?: string;
@@ -163,7 +177,7 @@ interface SwitchHTMLCustomAttributes {
163
177
  }
164
178
  interface SwitchProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'>, SwitchHTMLCustomAttributes {
165
179
  }
166
- declare const SwitchPrimitive: ({ name, label, required, errors, className, option, ...props }: SwitchProps) => react_jsx_runtime.JSX.Element;
180
+ declare const SwitchPrimitive: (props: SwitchProps) => react_jsx_runtime.JSX.Element;
167
181
 
168
182
  interface TextAreaHTMLCustomAttributes {
169
183
  label?: string;
@@ -172,20 +186,20 @@ interface TextAreaHTMLCustomAttributes {
172
186
  }
173
187
  interface TextAreaProps extends React__default.TextareaHTMLAttributes<HTMLTextAreaElement>, TextAreaHTMLCustomAttributes {
174
188
  }
175
- declare const TextAreaPrimitive: ({ label, required, errors, name, maxLength, className, ...props }: TextAreaProps) => react_jsx_runtime.JSX.Element;
189
+ declare const TextAreaPrimitive: (props: TextAreaProps) => react_jsx_runtime.JSX.Element;
176
190
 
177
191
  interface ValidateFieldProps {
178
192
  children: React.ReactNode;
179
193
  className?: string;
180
194
  overrideClassName?: boolean;
181
195
  }
182
- declare const ValidateFieldPrimitive: React$1.FunctionComponent<ValidateFieldProps>;
196
+ declare const ValidateFieldPrimitive: (props: ValidateFieldProps) => react_jsx_runtime.JSX.Element;
183
197
 
184
198
  interface HelperFieldProps {
185
199
  children: string;
186
200
  className?: string;
187
201
  overrideClassName?: boolean;
188
202
  }
189
- declare const HelperFieldPrimitive: React$1.FunctionComponent<HelperFieldProps>;
203
+ declare const HelperFieldPrimitive: (props: HelperFieldProps) => react_jsx_runtime.JSX.Element;
190
204
 
191
205
  export { AllowedComboValue, ButtonPrimitive, ButtonProps, CardContentPrimitive, CardContentProps, CardDescriptionPrimitive, CardDescriptionProps, CardFooterPrimitive, CardFooterProps, CardHeaderPrimitive, CardHeaderProps, CardPrimitive, CardProps, CardTitlePrimitive, CardTitleProps, ChangeEvent, CheckBoxPrimitive, CheckBoxProps, ComboBoxPrimitive, ComboBoxProps, HelperFieldPrimitive, HelperFieldProps, InputPrimitive, InputProps, LabelPrimitive, LabelProps, LicenseProvider, RadioPrimitive, RadioProps, SelectPrimitive, SelectProps, SwitchPrimitive, SwitchProps, TextAreaPrimitive, TextAreaProps, ValidateFieldPrimitive, ValidateFieldProps };
package/dist/page.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React$1 from 'react';
2
- import React__default, { JSX } from 'react';
2
+ import React__default from 'react';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
 
5
5
  declare const LicenseProvider: React__default.FC<{
@@ -16,7 +16,7 @@ interface ButtonProps extends React__default.ButtonHTMLAttributes<HTMLButtonElem
16
16
  loading?: boolean;
17
17
  loadingContent?: React__default.ReactNode;
18
18
  }
19
- declare const ButtonPrimitive: React__default.ForwardRefExoticComponent<ButtonProps & React__default.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
19
+ declare const ButtonPrimitive: (props: ButtonProps & React__default.RefAttributes<HTMLButtonElement | HTMLAnchorElement>) => react_jsx_runtime.JSX.Element;
20
20
 
21
21
  interface CardProps extends React__default.HTMLAttributes<HTMLDivElement> {
22
22
  children: React__default.ReactNode;
@@ -42,12 +42,12 @@ interface CardFooterProps extends React__default.HTMLAttributes<HTMLDivElement>
42
42
  children: React__default.ReactNode;
43
43
  overrideClassName?: boolean;
44
44
  }
45
- declare const CardPrimitive: React__default.ForwardRefExoticComponent<CardProps & React__default.RefAttributes<HTMLDivElement>>;
46
- declare const CardHeaderPrimitive: React__default.ForwardRefExoticComponent<CardHeaderProps & React__default.RefAttributes<HTMLDivElement>>;
47
- declare const CardTitlePrimitive: React__default.ForwardRefExoticComponent<CardTitleProps & React__default.RefAttributes<HTMLHeadingElement>>;
48
- declare const CardDescriptionPrimitive: React__default.ForwardRefExoticComponent<CardDescriptionProps & React__default.RefAttributes<HTMLParagraphElement>>;
49
- declare const CardContentPrimitive: React__default.ForwardRefExoticComponent<CardContentProps & React__default.RefAttributes<HTMLDivElement>>;
50
- declare const CardFooterPrimitive: React__default.ForwardRefExoticComponent<CardFooterProps & React__default.RefAttributes<HTMLDivElement>>;
45
+ declare const CardPrimitive: (props: CardProps & React__default.RefAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
46
+ declare const CardHeaderPrimitive: (props: CardHeaderProps & React__default.RefAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
47
+ declare const CardTitlePrimitive: (props: CardTitleProps & React__default.RefAttributes<HTMLHeadingElement>) => react_jsx_runtime.JSX.Element;
48
+ declare const CardDescriptionPrimitive: (props: CardDescriptionProps & React__default.RefAttributes<HTMLParagraphElement>) => react_jsx_runtime.JSX.Element;
49
+ declare const CardContentPrimitive: (props: CardContentProps & React__default.RefAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
50
+ declare const CardFooterPrimitive: (props: CardFooterProps & React__default.RefAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
51
51
 
52
52
  interface CheckBoxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type"> {
53
53
  label?: string;
@@ -59,7 +59,7 @@ interface CheckBoxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>
59
59
  helperText?: string;
60
60
  error?: string;
61
61
  }
62
- declare const CheckBoxPrimitive: React$1.ForwardRefExoticComponent<CheckBoxProps & React$1.RefAttributes<HTMLInputElement>>;
62
+ declare const CheckBoxPrimitive: (props: CheckBoxProps & React$1.RefAttributes<HTMLInputElement>) => react_jsx_runtime.JSX.Element;
63
63
 
64
64
  type InputFormatTypeAttribute = "money" | "cpf" | "cnpj" | "cpfCnpj" | "cep" | "mobile" | "phone" | "percentage" | "rg";
65
65
 
@@ -79,7 +79,7 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "
79
79
  error?: string;
80
80
  helperText?: string;
81
81
  }
82
- declare const InputPrimitive: React$1.ForwardRefExoticComponent<InputProps & React$1.RefAttributes<HTMLInputElement>>;
82
+ declare const InputPrimitive: (props: InputProps & React$1.RefAttributes<HTMLInputElement>) => react_jsx_runtime.JSX.Element;
83
83
 
84
84
  interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
85
85
  children?: React.ReactNode;
@@ -87,7 +87,7 @@ interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
87
87
  className?: string;
88
88
  overrideClassName?: boolean;
89
89
  }
90
- declare const LabelPrimitive: React$1.FunctionComponent<LabelProps>;
90
+ declare const LabelPrimitive: (props: LabelProps) => react_jsx_runtime.JSX.Element;
91
91
 
92
92
  interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type"> {
93
93
  label?: string;
@@ -98,9 +98,9 @@ interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "
98
98
  helperText?: string;
99
99
  error?: string;
100
100
  }
101
- declare const RadioPrimitive: React$1.ForwardRefExoticComponent<RadioProps & React$1.RefAttributes<HTMLInputElement>>;
101
+ declare const RadioPrimitive: (props: RadioProps & React$1.RefAttributes<HTMLInputElement>) => react_jsx_runtime.JSX.Element;
102
102
 
103
- interface SelectProps<T extends object = any> extends Omit<React__default.SelectHTMLAttributes<HTMLSelectElement>, "children"> {
103
+ interface SelectProps<T extends object> extends Omit<React__default.SelectHTMLAttributes<HTMLSelectElement>, "children"> {
104
104
  label?: string;
105
105
  required?: boolean;
106
106
  options: T[];
@@ -110,9 +110,9 @@ interface SelectProps<T extends object = any> extends Omit<React__default.Select
110
110
  error?: string;
111
111
  helperText?: string;
112
112
  }
113
- declare const SelectPrimitive: <T extends object = any>(p: SelectProps<T> & {
113
+ declare const SelectPrimitive: (props: SelectProps<object> & {
114
114
  ref?: React__default.ForwardedRef<HTMLSelectElement>;
115
- }) => JSX.Element;
115
+ }) => react_jsx_runtime.JSX.Element;
116
116
 
117
117
  type Mode = 'multiple' | 'single';
118
118
 
@@ -146,13 +146,27 @@ type ComboBoxProps<T, V extends AllowedComboValue<T>> = CommonProps<T> & {
146
146
  value?: V;
147
147
  onChange?: (e: ChangeEvent<V>) => void;
148
148
  };
149
- type ComboBoxComponent = {
150
- <T, V extends AllowedComboValue<T>>(props: ComboBoxProps<T, V> & {
151
- ref?: React__default.Ref<HTMLInputElement>;
152
- }): JSX.Element;
153
- displayName?: string;
154
- };
155
- declare const ComboBoxPrimitive: ComboBoxComponent;
149
+ declare const ComboBoxPrimitive: (props: Omit<React__default.InputHTMLAttributes<HTMLInputElement>, "value" | "type" | "onChange"> & {
150
+ label?: string;
151
+ required?: boolean;
152
+ name: string;
153
+ placeholder?: string;
154
+ labelKey: never;
155
+ valueKey: never;
156
+ options: unknown[];
157
+ typeSet?: TypeSet;
158
+ mode?: Mode;
159
+ disabled?: boolean;
160
+ ClearEnabled?: boolean;
161
+ helperText?: string;
162
+ error?: boolean;
163
+ className?: string;
164
+ } & {
165
+ value?: unknown;
166
+ onChange?: ((e: ChangeEvent<unknown>) => void) | undefined;
167
+ } & {
168
+ ref?: React__default.Ref<HTMLInputElement>;
169
+ }) => react_jsx_runtime.JSX.Element;
156
170
 
157
171
  interface SwitchHTMLCustomAttributes {
158
172
  label?: string;
@@ -163,7 +177,7 @@ interface SwitchHTMLCustomAttributes {
163
177
  }
164
178
  interface SwitchProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'>, SwitchHTMLCustomAttributes {
165
179
  }
166
- declare const SwitchPrimitive: ({ name, label, required, errors, className, option, ...props }: SwitchProps) => react_jsx_runtime.JSX.Element;
180
+ declare const SwitchPrimitive: (props: SwitchProps) => react_jsx_runtime.JSX.Element;
167
181
 
168
182
  interface TextAreaHTMLCustomAttributes {
169
183
  label?: string;
@@ -172,20 +186,20 @@ interface TextAreaHTMLCustomAttributes {
172
186
  }
173
187
  interface TextAreaProps extends React__default.TextareaHTMLAttributes<HTMLTextAreaElement>, TextAreaHTMLCustomAttributes {
174
188
  }
175
- declare const TextAreaPrimitive: ({ label, required, errors, name, maxLength, className, ...props }: TextAreaProps) => react_jsx_runtime.JSX.Element;
189
+ declare const TextAreaPrimitive: (props: TextAreaProps) => react_jsx_runtime.JSX.Element;
176
190
 
177
191
  interface ValidateFieldProps {
178
192
  children: React.ReactNode;
179
193
  className?: string;
180
194
  overrideClassName?: boolean;
181
195
  }
182
- declare const ValidateFieldPrimitive: React$1.FunctionComponent<ValidateFieldProps>;
196
+ declare const ValidateFieldPrimitive: (props: ValidateFieldProps) => react_jsx_runtime.JSX.Element;
183
197
 
184
198
  interface HelperFieldProps {
185
199
  children: string;
186
200
  className?: string;
187
201
  overrideClassName?: boolean;
188
202
  }
189
- declare const HelperFieldPrimitive: React$1.FunctionComponent<HelperFieldProps>;
203
+ declare const HelperFieldPrimitive: (props: HelperFieldProps) => react_jsx_runtime.JSX.Element;
190
204
 
191
205
  export { AllowedComboValue, ButtonPrimitive, ButtonProps, CardContentPrimitive, CardContentProps, CardDescriptionPrimitive, CardDescriptionProps, CardFooterPrimitive, CardFooterProps, CardHeaderPrimitive, CardHeaderProps, CardPrimitive, CardProps, CardTitlePrimitive, CardTitleProps, ChangeEvent, CheckBoxPrimitive, CheckBoxProps, ComboBoxPrimitive, ComboBoxProps, HelperFieldPrimitive, HelperFieldProps, InputPrimitive, InputProps, LabelPrimitive, LabelProps, LicenseProvider, RadioPrimitive, RadioProps, SelectPrimitive, SelectProps, SwitchPrimitive, SwitchProps, TextAreaPrimitive, TextAreaProps, ValidateFieldPrimitive, ValidateFieldProps };
package/dist/page.js CHANGED
@@ -1,32 +1,32 @@
1
1
  'use strict';
2
2
 
3
- var vt = require('react');
3
+ var gt = require('react');
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
- var Et = require('clsx');
5
+ var Rt = require('clsx');
6
6
  var tailwindMerge = require('tailwind-merge');
7
7
 
8
8
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
9
9
 
10
- var vt__default = /*#__PURE__*/_interopDefault(vt);
11
- var Et__default = /*#__PURE__*/_interopDefault(Et);
10
+ var gt__default = /*#__PURE__*/_interopDefault(gt);
11
+ var Rt__default = /*#__PURE__*/_interopDefault(Rt);
12
12
 
13
- var fe=vt.createContext(void 0),pt=({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"})]})}),ut=({children:e,licenseKey:t})=>{let[r,o]=vt.useState(!1),[a,i]=vt.useState(null),[n,l]=vt.useState(!0),s=c=>{if(i(null),!c)throw new Error("\u{1F512} Chave de licen\xE7a \xE9 obrigat\xF3ria");let p="chave-secreta-123";if(c!==p)throw new Error("\u274C Chave de licen\xE7a inv\xE1lida");o(!0);};return vt.useEffect(()=>{if(t){l(!0);try{s(t);}catch(c){i(c instanceof Error?c.message:"Erro desconhecido na valida\xE7\xE3o da licen\xE7a");}finally{l(!1);}}else i("\u{1F512} Licen\xE7a n\xE3o informada"),l(!1);},[t]),n?null:jsxRuntime.jsx(fe.Provider,{value:{isLicenseValid:r,validateLicense:s,licenseError:a},children:r?e:jsxRuntime.jsx(pt,{message:a||"Licen\xE7a inv\xE1lida"})})},be=()=>{let e=vt.useContext(fe);if(!e)throw new Error("useLicense deve ser usado dentro de um LicenseProvider");return e};var ve=({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})]});function m(e){let t=r=>{let{isLicenseValid:o}=be();return o?jsxRuntime.jsx(e,{...r}):jsxRuntime.jsx(ve,{})};return t.displayName=e.displayName??e.name,t}function f(...e){return tailwindMerge.twMerge(Et.clsx(e))}var Te=vt__default.default.forwardRef(({className:e,overrideClassName:t,variant:r="primary",size:o="md",href:a,children:i,loading:n=!1,loadingContent:l,...s},c)=>{let p="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",b={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",sm:"h-9 px-3 text-sm",md:"h-10 px-4 py-2",lg:"h-11 px-6 text-lg",xl:"h-12 px-8 text-xl"},d=t?e:f(p,b[r],h[o],e);return a?jsxRuntime.jsx("a",{href:a,className:d,ref:c,children:n&&l?l:i}):jsxRuntime.jsx("button",{className:d,ref:c,...s,children:n&&l?l:i})});Te.displayName="Button";var Cr=m(Te);var ye=vt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...o},a)=>jsxRuntime.jsx("div",{ref:a,className:t?e:f("rounded-lg border bg-card text-card-foreground shadow-sm",e),...o,children:r}));ye.displayName="Card";var Ce=vt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...o},a)=>jsxRuntime.jsx("div",{ref:a,className:t?e:f("flex flex-col space-y-1.5 p-6",e),...o,children:r}));Ce.displayName="CardHeader";var Pe=vt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...o},a)=>jsxRuntime.jsx("h3",{ref:a,className:t?e:f("text-2xl font-semibold leading-none tracking-tight",e),...o,children:r}));Pe.displayName="CardTitle";var we=vt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...o},a)=>jsxRuntime.jsx("p",{ref:a,className:t?e:f("text-sm text-muted-foreground",e),...o,children:r}));we.displayName="CardDescription";var Le=vt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...o},a)=>jsxRuntime.jsx("div",{ref:a,className:t?e:f("p-6 pt-0",e),...o,children:r}));Le.displayName="CardContent";var Re=vt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...o},a)=>jsxRuntime.jsx("div",{ref:a,className:t?e:f("flex items-center p-6 pt-0",e),...o,children:r}));Re.displayName="CardFooter";var Nr=m(ye),Hr=m(Ce),Mr=m(Pe),Fr=m(we),Vr=m(Le),Sr=m(Re);var xt=({children:e,className:t,overrideClassName:r})=>{if(e)return jsxRuntime.jsx("p",{className:r?t:f("text-sm text-muted-foreground",t),children:e})},E=m(xt);var Tt=({children:e,required:t,className:r,overrideClassName:o=!1,...a})=>jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("label",{...a,className:o?r:f("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:"*"})]}),v=m(Tt);var Ct=({children:e,className:t,overrideClassName:r})=>{if(e)return jsxRuntime.jsx("p",{className:r?t:f("text-sm text-red-600 dark:text-red-400",t),children:e})},x=m(Ct);var Ne=vt.forwardRef(({label:e,required:t,option:r,orientation:o="left",className:a,overrideClassName:i=!1,helperText:n,error:l,...s},c)=>{let p=vt.useId(),b=f("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",l&&"border-destructive",a);return jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(v,{required:t,children:e}),jsxRuntime.jsxs("div",{className:`flex ${o=="left"?"flex-row":"flex-row-reverse"} w-fit gap-2`,children:[jsxRuntime.jsx("input",{id:p,type:"checkbox",className:i?a:b,ref:c,...s}),r&&jsxRuntime.jsx(v,{htmlFor:p,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r})]}),l&&jsxRuntime.jsx(x,{children:l}),!l&&n&&jsxRuntime.jsx(E,{children:n})]})});Ne.displayName="CheckBox";var to=m(Ne);var Rt=({...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"})}),U=Rt;var kt=({children:e,before:t,after:r,className:o})=>{let i=Et__default.default("flex justify-center items-center",{"rounded-l-lg":t,"rounded-r-lg":r},o);return jsxRuntime.jsx("div",{className:i,children:jsxRuntime.jsx("span",{children:e})})},te=kt;var Nt=({children:e})=>jsxRuntime.jsx("div",{className:"absolute px-2",children:jsxRuntime.jsx("span",{children:e})}),Ve=Nt;var Ht=({children:e})=>jsxRuntime.jsx("div",{className:"absolute right-0 px-2",children:jsxRuntime.jsx("span",{children:e})}),Ie=Ht;function Ae(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 $e(e){let t=e.currentTarget.value;t=t.replace(/\D/g,""),t=t.padStart(3,"0");let r=t.slice(0,-2),o=t.slice(-2),n=`${(r.replace(/^0+/,"")||"0").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1.")},${o}`;return e.currentTarget.value=n,e}function De(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 Be(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 Ke(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 qe(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 Oe(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 _e(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 Mt=({e,mask:t})=>{switch(t){case"money":return $e(e);case"mobile":return Be(e);case"phone":return Ke(e);case"cpfCnpj":return qe(e);case"cpf":return De(e);case"rg":return Oe(e);case"cnpj":return _e(e);case"cep":return Ae(e);default:return e}},We=Mt;var St=({mask:e,initialValue:t=""})=>{let[r,o]=vt.useState(t);vt.useEffect(()=>{t!==r&&o(t);},[t]);let a=vt.useCallback(n=>{let s=We({e:n,mask:e})?.currentTarget?.value??n.currentTarget.value;o(s);},[e]),i=vt.useCallback(()=>o(""),[]);return {value:r,setValue:o,handleChange:a,handleClear:i}},Ue=St;var Je=vt.forwardRef(({label:e,required:t=!1,mask:r,name:o,prefix:a,suffix:i,addonBefore:n,addonBeforeClassName:l,addonAfter:s,addonAfterClassName:c,ClearEnabled:p=!0,className:b,overrideClassName:h=!1,error:d,helperText:T,value:L=void 0,onChange:u,...g},y)=>{let C=vt.useId(),{handleChange:M,handleClear:N,setValue:I}=Ue({mask:r,initialValue:L}),A=f("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",!a&&!i&&"px-3",a&&!i&&"pl-10 pr-3",i&&!a&&"pl-3 pr-10",a&&i&&"pl-10 pr-10",n&&"rounded-l-none border-l-0",s&&"rounded-r-none border-r-0",b),X=F=>{M(F),u?.(F);},W=()=>{N(),I(""),u?.({target:{name:o||"",value:""}});};return jsxRuntime.jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsxRuntime.jsx(v,{htmlFor:C,required:t,children:e}),jsxRuntime.jsxs("div",{className:"relative flex",children:[n&&jsxRuntime.jsx(te,{before:!0,className:l,children:n}),jsxRuntime.jsxs("div",{className:"relative flex items-center w-full",children:[a&&jsxRuntime.jsx(Ve,{children:a}),jsxRuntime.jsx("input",{id:C,ref:y,name:o,onChange:X,className:h?b:A,...g}),p&&L&&jsxRuntime.jsx(U,{onClick:W,width:12,height:12,className:f("absolute right-2 cursor-pointer",i&&"right-8")}),i&&jsxRuntime.jsx(Ie,{children:i})]}),s&&jsxRuntime.jsx(te,{after:!0,className:c,children:s})]}),d&&jsxRuntime.jsx(x,{children:d}),!d&&T&&jsxRuntime.jsx(E,{children:T})]})});Je.displayName="Input";var Mo=m(Je);var ze=vt.forwardRef(({label:e,required:t,option:r,className:o,overrideClassName:a,helperText:i,error:n,...l},s)=>{let c=vt.useId(),p=f("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",n&&"border-destructive",o);return jsxRuntime.jsxs("div",{className:"space-y-3",children:[e&&jsxRuntime.jsx(v,{required:t,children:e}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{id:c,type:"radio",className:a?o:p,ref:s,...l}),r&&jsxRuntime.jsx(v,{htmlFor:c,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r})]}),n&&jsxRuntime.jsx(x,{children:n}),!n&&i&&jsxRuntime.jsx(E,{children:i})]})});ze.displayName="Radio";var Ko=m(ze);function qt({label:e,required:t=!1,options:r,labelKey:o,valueKey:a,placeholder:i,error:n,helperText:l,className:s,...c},p){let b=vt.useId(),h=f("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",n&&"border-red-500 focus-visible:ring-red-500",s);return jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(v,{htmlFor:b,required:t,children:e}),jsxRuntime.jsxs("select",{id:b,className:h,ref:p,...c,children:[i&&jsxRuntime.jsx("option",{value:"",disabled:!0,children:i}),r.map((d,T)=>jsxRuntime.jsx("option",{value:String(d[a]),children:String(d[o])},T))]}),n&&jsxRuntime.jsx(x,{children:n}),!n&&l&&jsxRuntime.jsx(E,{children:l})]})}var Qe=vt.forwardRef(qt);Qe.displayName="Select";var Ot=Qe,Qo=m(Ot);var Wt=(e,t)=>{vt.useEffect(()=>{let r=o=>{e.current&&!e.current.contains(o.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},Ze=Wt;function oe({options:e,labelKey:t,valueKey:r,multiple:o,onChange:a,setSearchTerm:i,typeSet:n,name:l}){let[s,c]=vt.useState([]),p=vt.useMemo(()=>new Map(e.map(u=>[String(u[r]),u])),[e,r]),b=vt.useCallback(()=>s.map(u=>p.get(u)).filter(u=>!!u),[s,p]),h=vt.useCallback(u=>{if(!a)return;let g;if(n==="field"?o?g=u:g=u[0]??void 0:o?g=u.map(C=>p.get(C)).filter(C=>C!==void 0):g=p.get(u[0]??"")??void 0,i&&!o){let y=p.get(u[0]??"");y&&i(String(y[t]));}a({target:{name:l,value:g,type:"combobox"}});},[o,a,p,l,n,i,t]),d=vt.useCallback(u=>{let g=String(u[r]),y=o?s.includes(g)?s.filter(C=>C!==g):[...s,g]:[g];c(y),h(y);},[o,s,h,r]),T=vt.useCallback(u=>{let g=s.filter(y=>y!==u);c(g),h(g);},[s,h]),L=vt.useCallback(()=>{c([]),i?.("");let u;n==="field"?u=o?[]:"":u=o?[]:void 0,a?.({target:{name:l,value:u,type:"combobox"}});},[o,a,l,i,n]);return {selectedValues:s,handleSelect:d,handleRemove:T,handleClear:L,getSelectedOptions:b}}function ae(e,t,r){return vt.useMemo(()=>r?e.filter(a=>String(a[t]).toLowerCase().includes(r.toLowerCase())):e,[e,r,t])}var et=({isOpen:e,setIsOpen:t,multiple:r,searchTerm:o,setSearchTerm:a,selectedValues:i,filteredOptions:n,highlightedIndex:l,setHighlightedIndex:s,handleSelect:c,handleRemove:p})=>{let b=vt.useCallback(d=>{if(n.length===0){s(-1);return}s(T=>T<0?d>0?0:n.length-1:(T+d+n.length)%n.length);},[n,s]);return vt.useCallback(d=>{if(!e){if(d.key==="Enter"||d.key==="ArrowDown"){t(!0),s(0),d.preventDefault();return}r&&d.key==="Backspace"&&o===""&&i.length>0&&(d.preventDefault(),p(i[i.length-1]));return}switch(d.key){case"ArrowDown":d.preventDefault(),b(1);break;case"ArrowUp":d.preventDefault(),b(-1);break;case"Enter":d.preventDefault();let T=l>=0?l:0,L=n[T];L&&c(L),r&&a&&a(""),r||(t(!1),s(-1));break;case"Escape":d.preventDefault(),t(!1),s(-1),r||a("");break;case"Tab":t(!1),s(-1);break;case"Home":d.preventDefault(),n.length>0&&s(0);break;case"End":d.preventDefault(),n.length>0&&s(n.length-1);break;case"Backspace":r&&o===""&&i.length>0&&(d.preventDefault(),p(i[i.length-1]));break}},[e,r,o,i,n,l,t,a,s,c,p,b])};function tt({option:e,labelKey:t,valueKey:r,onRemove:o}){let a=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:[a,jsxRuntime.jsx("button",{type:"button",onMouseDown:n=>n.preventDefault(),onClick:()=>o(i),className:"hover:bg-blue-200 dark:hover:bg-blue-800 rounded-full p-0.5 transition-colors","aria-label":`Remover ${a}`,children:"\u2715"})]},i)}function jt(e,t){let{label:r,required:o=!1,name:a,placeholder:i="Buscar...",labelKey:n,valueKey:l,options:s,value:c,onChange:p,mode:b="single",typeSet:h="field",disabled:d=!1,ClearEnabled:T=!0,helperText:L,error:u=!1,className:g="",...y}=e,C=b==="multiple",[M,N]=vt.useState(!1),[I,A]=vt.useState(""),X=vt.useRef(null),W=vt.useRef(null),F=vt.useRef(null);vt.useImperativeHandle(t,()=>F.current),Ze(W,()=>N(!1));let z=ae(s,n,I),[G,Y]=vt.useState(-1),{selectedValues:Q,handleSelect:ce,handleRemove:me,handleClear:at,getSelectedOptions:pe}=oe({options:s,labelKey:n,valueKey:l,value:c,multiple:C,onChange:p,typeSet:h,name:a,setSearchTerm:A}),nt=et({isOpen:M,setIsOpen:N,multiple:C,searchTerm:I,setSearchTerm:A,selectedValues:Q,filteredOptions:z,highlightedIndex:G,setHighlightedIndex:Y,handleSelect:ce,handleRemove:me}),$=vt.useId(),it="w-full bg-transparent outline-none placeholder:text-gray-500 dark:placeholder:text-gray-400 text-gray-900 dark:text-gray-100",st=f("relative w-full min-h-[40px] px-3 py-2 border rounded-md bg-white dark:bg-gray-800",u?"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 ${g}`,children:[r&&jsxRuntime.jsx(v,{htmlFor:$,required:o,children:r}),jsxRuntime.jsxs("div",{ref:X,className:"relative",children:[jsxRuntime.jsxs("div",{className:st,children:[C&&pe().length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:pe().map((P,R)=>jsxRuntime.jsx(tt,{option:P,labelKey:n,valueKey:l,onRemove:me},String(P[l]??R)))}),jsxRuntime.jsx("input",{ref:F,...y,name:a,type:"text",placeholder:i,value:I,onChange:P=>{let R=P.target.value;A(R),!M&&R.trim()!==""&&N(!0);},onKeyDown:nt,onMouseDown:P=>{document.activeElement===F.current&&(P.preventDefault(),N(R=>{let D=!R;return D&&Y(0),D}));},onFocus:()=>{N(!0),Y(0);},disabled:d,className:it,role:"combobox","aria-expanded":M,"aria-controls":$,"aria-activedescendant":G>=0?`${$}-opt-${G}`:void 0}),T&&!!Q.length&&jsxRuntime.jsx("button",{type:"button",onMouseDown:P=>P.preventDefault(),onClick:at,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(U,{width:12,height:12})})]}),M&&jsxRuntime.jsx("div",{ref:W,id:$,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":C||void 0,children:z.length===0?jsxRuntime.jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"Nenhum resultado encontrado"}):z.map((P,R)=>{let D=String(P[l]),Z=Q.includes(D),j=R===G;return jsxRuntime.jsx("button",{id:`${$}-opt-${R}`,"data-index":R,role:"option","aria-selected":Z,type:"button",onMouseDown:lt=>lt.preventDefault(),onClick:()=>ce(P),className:f("w-full px-3 py-2 text-left text-sm transition-colors",j&&"bg-blue-100 dark:bg-blue-800 text-blue-900 dark:text-white",!j&&Z&&"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300",!Z&&!j&&"text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),children:jsxRuntime.jsx("span",{children:String(P[n])})},D)})})]}),u&&jsxRuntime.jsx(x,{children:u}),!u&&L&&jsxRuntime.jsx(E,{children:L})]})}var rt=vt.forwardRef(jt);rt.displayName="ComboBox";var wa=m(rt);var tr=(e,t)=>vt.useMemo(()=>{let r=e?`${e}-group`:void 0,o=e&&t?`${e}-error`:void 0;return {groupId:r,errorId:o,ariaProps:{"aria-labelledby":r,"aria-invalid":t?"true":void 0,"aria-errormessage":t?o:void 0}}},[e,t]),ot=tr;var rr=({name:e,label:t,required:r,errors:o,className:a,option:i,...n})=>{let{groupId:l,errorId:s,ariaProps:c}=ot(e,o);return jsxRuntime.jsxs("div",{className:`switch-group ${a}`,children:[t&&jsxRuntime.jsx(v,{htmlFor:e,id:l,className:"font-poppins text-[14px] font-medium leading-[21px] text-colorLight dark:text-colorDark",required:r,children:t}),jsxRuntime.jsx("div",{...c,children:jsxRuntime.jsxs(v,{htmlFor:e,className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsxs("div",{className:"relative inline-block w-12 h-6",children:[jsxRuntime.jsx("input",{id:e,name:e,type:"checkbox",className:"opacity-0 w-0 h-0 peer","data-testid":"INPUT_SWITCH"+e,"aria-describedby":s,...n}),jsxRuntime.jsx("span",{className:"absolute cursor-pointer top-0 left-0 right-0 bottom-0 bg-gray-300 rounded-full transition duration-300 before:absolute before:content-[''] before:h-5 before:w-5 before:left-0.5 before:bottom-0.5 before:bg-white before:rounded-full before:transition before:duration-300 peer-checked:bg-blue-600 peer-checked:before:translate-x-6"})]}),i]})}),o&&jsxRuntime.jsx(x,{children:o})]})},Va=m(rr);var nr=({label:e,required:t=!1,errors:r,name:o,maxLength:a,className:i,...n})=>{let[l,s]=vt.useState(0),c=Et__default.default("px-2 py-3 w-full text-stone-400 text-sm font-normal leading-tight border-2 border-opacity-0 shadow-input rounded-lg focus:outline-none focus:border-blue-500 border-neutral-400",{"border-[#DD052B] border-opacity-80 shadow-inputError":!!r},i??"");return jsxRuntime.jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsxRuntime.jsx(v,{htmlFor:o,className:"font-poppins text-[14px] font-medium leading-[21px] text-colorLight dark:text-colorDark",required:t,children:e}),jsxRuntime.jsxs("div",{className:"flex flex-col justify-center items-end w-full gap-1",children:[jsxRuntime.jsx("textarea",{...n,"data-testid":"TEXT_AREA"+o,name:o,maxLength:a,className:c,onInput:p=>s(p.currentTarget.textLength)}),a&&jsxRuntime.jsx("div",{children:jsxRuntime.jsxs("p",{children:[l," / ",a]})})]}),r&&jsxRuntime.jsx(x,{children:r})]})},Oa=m(nr);
13
+ var fe=gt.createContext(void 0),mt=({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"})]})}),pt=({children:e,licenseKey:t})=>{let[r,o]=gt.useState(!1),[a,i]=gt.useState(null),[n,l]=gt.useState(!0),s=d=>{if(i(null),!d)throw new Error("\u{1F512} Chave de licen\xE7a \xE9 obrigat\xF3ria");let p="chave-secreta-123";if(d!==p)throw new Error("\u274C Chave de licen\xE7a inv\xE1lida");o(!0);};return gt.useEffect(()=>{if(t){l(!0);try{s(t);}catch(d){i(d instanceof Error?d.message:"Erro desconhecido na valida\xE7\xE3o da licen\xE7a");}finally{l(!1);}}else i("\u{1F512} Licen\xE7a n\xE3o informada"),l(!1);},[t]),n?null:jsxRuntime.jsx(fe.Provider,{value:{isLicenseValid:r,validateLicense:s,licenseError:a},children:r?e:jsxRuntime.jsx(mt,{message:a||"Licen\xE7a inv\xE1lida"})})},be=()=>{let e=gt.useContext(fe);if(!e)throw new Error("useLicense deve ser usado dentro de um LicenseProvider");return e};var ve=({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 m=e=>t=>{let{isLicenseValid:r}=be();return r?jsxRuntime.jsx(e,{...t}):jsxRuntime.jsx(ve,{})};function f(...e){return tailwindMerge.twMerge(Rt.clsx(e))}var Te=gt__default.default.forwardRef(({className:e,overrideClassName:t,variant:r="primary",size:o="md",href:a,children:i,loading:n=!1,loadingContent:l,...s},d)=>{let p="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",v={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"},x={xs:"h-7 px-2 text-xs",sm:"h-9 px-3 text-sm",md:"h-10 px-4 py-2",lg:"h-11 px-6 text-lg",xl:"h-12 px-8 text-xl"},c=t?e:f(p,v[r],x[o],e);return a?jsxRuntime.jsx("a",{href:a,className:c,ref:d,children:n&&l?l:i}):jsxRuntime.jsx("button",{className:c,ref:d,...s,children:n&&l?l:i})});Te.displayName="Button";var yr=m(Te);var ye=gt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...o},a)=>jsxRuntime.jsx("div",{ref:a,className:t?e:f("rounded-lg border bg-card text-card-foreground shadow-sm",e),...o,children:r}));ye.displayName="Card";var Ce=gt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...o},a)=>jsxRuntime.jsx("div",{ref:a,className:t?e:f("flex flex-col space-y-1.5 p-6",e),...o,children:r}));Ce.displayName="CardHeader";var Pe=gt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...o},a)=>jsxRuntime.jsx("h3",{ref:a,className:t?e:f("text-2xl font-semibold leading-none tracking-tight",e),...o,children:r}));Pe.displayName="CardTitle";var we=gt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...o},a)=>jsxRuntime.jsx("p",{ref:a,className:t?e:f("text-sm text-muted-foreground",e),...o,children:r}));we.displayName="CardDescription";var Le=gt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...o},a)=>jsxRuntime.jsx("div",{ref:a,className:t?e:f("p-6 pt-0",e),...o,children:r}));Le.displayName="CardContent";var Re=gt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...o},a)=>jsxRuntime.jsx("div",{ref:a,className:t?e:f("flex items-center p-6 pt-0",e),...o,children:r}));Re.displayName="CardFooter";var kr=m(ye),Nr=m(Ce),Hr=m(Pe),Mr=m(we),Fr=m(Le),Vr=m(Re);var vt=({children:e,className:t,overrideClassName:r})=>{if(e)return jsxRuntime.jsx("p",{className:r?t:f("text-sm text-muted-foreground",t),children:e})},E=m(vt);var ht=({children:e,required:t,className:r,overrideClassName:o=!1,...a})=>jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("label",{...a,className:o?r:f("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:"*"})]}),g=m(ht);var yt=({children:e,className:t,overrideClassName:r})=>{if(e)return jsxRuntime.jsx("p",{className:r?t:f("text-sm text-red-600 dark:text-red-400",t),children:e})},T=m(yt);var Ne=gt.forwardRef(({label:e,required:t,option:r,orientation:o="left",className:a,overrideClassName:i=!1,helperText:n,error:l,...s},d)=>{let p=gt.useId(),v=f("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",l&&"border-destructive",a);return jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(g,{required:t,children:e}),jsxRuntime.jsxs("div",{className:`flex ${o=="left"?"flex-row":"flex-row-reverse"} w-fit gap-2`,children:[jsxRuntime.jsx("input",{id:p,type:"checkbox",className:i?a:v,ref:d,...s}),r&&jsxRuntime.jsx(g,{htmlFor:p,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r})]}),l&&jsxRuntime.jsx(T,{children:l}),!l&&n&&jsxRuntime.jsx(E,{children:n})]})});Ne.displayName="CheckBox";var eo=m(Ne);var Lt=({...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"})}),U=Lt;var Et=({children:e,before:t,after:r,className:o})=>{let i=Rt__default.default("flex justify-center items-center",{"rounded-l-lg":t,"rounded-r-lg":r},o);return jsxRuntime.jsx("div",{className:i,children:jsxRuntime.jsx("span",{children:e})})},te=Et;var kt=({children:e})=>jsxRuntime.jsx("div",{className:"absolute px-2",children:jsxRuntime.jsx("span",{children:e})}),Ve=kt;var Nt=({children:e})=>jsxRuntime.jsx("div",{className:"absolute right-0 px-2",children:jsxRuntime.jsx("span",{children:e})}),Ie=Nt;function Ae(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 $e(e){let t=e.currentTarget.value;t=t.replace(/\D/g,""),t=t.padStart(3,"0");let r=t.slice(0,-2),o=t.slice(-2),n=`${(r.replace(/^0+/,"")||"0").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1.")},${o}`;return e.currentTarget.value=n,e}function De(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 Be(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 Ke(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 qe(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 Oe(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 _e(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 Ht=({e,mask:t})=>{switch(t){case"money":return $e(e);case"mobile":return Be(e);case"phone":return Ke(e);case"cpfCnpj":return qe(e);case"cpf":return De(e);case"rg":return Oe(e);case"cnpj":return _e(e);case"cep":return Ae(e);default:return e}},We=Ht;var Vt=({mask:e,initialValue:t=""})=>{let[r,o]=gt.useState(t);gt.useEffect(()=>{t!==r&&o(t);},[t]);let a=gt.useCallback(n=>{let s=We({e:n,mask:e})?.currentTarget?.value??n.currentTarget.value;o(s);},[e]),i=gt.useCallback(()=>o(""),[]);return {value:r,setValue:o,handleChange:a,handleClear:i}},Ue=Vt;var Je=gt.forwardRef(({label:e,required:t=!1,mask:r,name:o,prefix:a,suffix:i,addonBefore:n,addonBeforeClassName:l,addonAfter:s,addonAfterClassName:d,ClearEnabled:p=!0,className:v,overrideClassName:x=!1,error:c,helperText:h,value:y=void 0,onChange:u,...b},C)=>{let P=gt.useId(),{handleChange:M,handleClear:N,setValue:I}=Ue({mask:r,initialValue:y}),A=f("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",c&&"border-destructive focus-visible:ring-destructive",!a&&!i&&"px-3",a&&!i&&"pl-10 pr-3",i&&!a&&"pl-3 pr-10",a&&i&&"pl-10 pr-10",n&&"rounded-l-none border-l-0",s&&"rounded-r-none border-r-0",v),X=F=>{M(F),u?.(F);},W=()=>{N(),I(""),u?.({target:{name:o||"",value:""}});};return jsxRuntime.jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsxRuntime.jsx(g,{htmlFor:P,required:t,children:e}),jsxRuntime.jsxs("div",{className:"relative flex",children:[n&&jsxRuntime.jsx(te,{before:!0,className:l,children:n}),jsxRuntime.jsxs("div",{className:"relative flex items-center w-full",children:[a&&jsxRuntime.jsx(Ve,{children:a}),jsxRuntime.jsx("input",{id:P,ref:C,name:o,onChange:X,className:x?v:A,...b}),p&&y&&jsxRuntime.jsx(U,{onClick:W,width:12,height:12,className:f("absolute right-2 cursor-pointer",i&&"right-8")}),i&&jsxRuntime.jsx(Ie,{children:i})]}),s&&jsxRuntime.jsx(te,{after:!0,className:d,children:s})]}),c&&jsxRuntime.jsx(T,{children:c}),!c&&h&&jsxRuntime.jsx(E,{children:h})]})});Je.displayName="Input";var Ho=m(Je);var ze=gt.forwardRef(({label:e,required:t,option:r,className:o,overrideClassName:a,helperText:i,error:n,...l},s)=>{let d=gt.useId(),p=f("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",n&&"border-destructive",o);return jsxRuntime.jsxs("div",{className:"space-y-3",children:[e&&jsxRuntime.jsx(g,{required:t,children:e}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{id:d,type:"radio",className:a?o:p,ref:s,...l}),r&&jsxRuntime.jsx(g,{htmlFor:d,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r})]}),n&&jsxRuntime.jsx(T,{children:n}),!n&&i&&jsxRuntime.jsx(E,{children:i})]})});ze.displayName="Radio";var Bo=m(ze);function Kt(e,t){let{label:r,required:o=!1,options:a,labelKey:i,valueKey:n,placeholder:l,error:s,helperText:d,className:p,...v}=e,x=gt.useId(),c=f("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",s&&"border-red-500 focus-visible:ring-red-500",p);return jsxRuntime.jsxs("div",{className:"space-y-2",children:[r&&jsxRuntime.jsx(g,{htmlFor:x,required:o,children:r}),jsxRuntime.jsxs("select",{id:x,className:c,ref:t,...v,children:[l&&jsxRuntime.jsx("option",{value:"",disabled:!0,children:l}),a.map((h,y)=>jsxRuntime.jsx("option",{value:String(h[n]),children:String(h[i])},y))]}),s&&jsxRuntime.jsx(T,{children:s}),!s&&d&&jsxRuntime.jsx(E,{children:d})]})}var qt=gt.forwardRef(Kt),Yo=m(qt);var _t=(e,t)=>{gt.useEffect(()=>{let r=o=>{e.current&&!e.current.contains(o.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},Qe=_t;function oe({options:e,labelKey:t,valueKey:r,multiple:o,onChange:a,setSearchTerm:i,typeSet:n,name:l}){let[s,d]=gt.useState([]),p=gt.useMemo(()=>new Map(e.map(u=>[String(u[r]),u])),[e,r]),v=gt.useCallback(()=>s.map(u=>p.get(u)).filter(u=>!!u),[s,p]),x=gt.useCallback(u=>{if(!a)return;let b;if(n==="field"?o?b=u:b=u[0]??void 0:o?b=u.map(P=>p.get(P)).filter(P=>P!==void 0):b=p.get(u[0]??"")??void 0,i&&!o){let C=p.get(u[0]??"");C&&i(String(C[t]));}a({target:{name:l,value:b,type:"combobox"}});},[o,a,p,l,n,i,t]),c=gt.useCallback(u=>{let b=String(u[r]),C=o?s.includes(b)?s.filter(P=>P!==b):[...s,b]:[b];d(C),x(C);},[o,s,x,r]),h=gt.useCallback(u=>{let b=s.filter(C=>C!==u);d(b),x(b);},[s,x]),y=gt.useCallback(()=>{d([]),i?.("");let u;n==="field"?u=o?[]:"":u=o?[]:void 0,a?.({target:{name:l,value:u,type:"combobox"}});},[o,a,l,i,n]);return {selectedValues:s,handleSelect:c,handleRemove:h,handleClear:y,getSelectedOptions:v}}function ae(e,t,r){return gt.useMemo(()=>r?e.filter(a=>String(a[t]).toLowerCase().includes(r.toLowerCase())):e,[e,r,t])}var je=({isOpen:e,setIsOpen:t,multiple:r,searchTerm:o,setSearchTerm:a,selectedValues:i,filteredOptions:n,highlightedIndex:l,setHighlightedIndex:s,handleSelect:d,handleRemove:p})=>{let v=gt.useCallback(c=>{if(n.length===0){s(-1);return}s(h=>h<0?c>0?0:n.length-1:(h+c+n.length)%n.length);},[n,s]);return gt.useCallback(c=>{if(!e){if(c.key==="Enter"||c.key==="ArrowDown"){t(!0),s(0),c.preventDefault();return}r&&c.key==="Backspace"&&o===""&&i.length>0&&(c.preventDefault(),p(i[i.length-1]));return}switch(c.key){case"ArrowDown":c.preventDefault(),v(1);break;case"ArrowUp":c.preventDefault(),v(-1);break;case"Enter":c.preventDefault();let h=l>=0?l:0,y=n[h];y&&d(y),r&&a&&a(""),r||(t(!1),s(-1));break;case"Escape":c.preventDefault(),t(!1),s(-1),r||a("");break;case"Tab":t(!1),s(-1);break;case"Home":c.preventDefault(),n.length>0&&s(0);break;case"End":c.preventDefault(),n.length>0&&s(n.length-1);break;case"Backspace":r&&o===""&&i.length>0&&(c.preventDefault(),p(i[i.length-1]));break}},[e,r,o,i,n,l,t,a,s,d,p,v])};function et({option:e,labelKey:t,valueKey:r,onRemove:o}){let a=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:[a,jsxRuntime.jsx("button",{type:"button",onMouseDown:n=>n.preventDefault(),onClick:()=>o(i),className:"hover:bg-blue-200 dark:hover:bg-blue-800 rounded-full p-0.5 transition-colors","aria-label":`Remover ${a}`,children:"\u2715"})]},i)}function Zt(e,t){let{label:r,required:o=!1,name:a,placeholder:i="Buscar...",labelKey:n,valueKey:l,options:s,value:d,onChange:p,mode:v="single",typeSet:x="field",disabled:c=!1,ClearEnabled:h=!0,helperText:y,error:u=!1,className:b="",...C}=e,P=v==="multiple",[M,N]=gt.useState(!1),[I,A]=gt.useState(""),X=gt.useRef(null),W=gt.useRef(null),F=gt.useRef(null);gt.useImperativeHandle(t,()=>F.current),Qe(W,()=>N(!1));let z=ae(s,n,I),[G,Y]=gt.useState(-1),{selectedValues:Q,handleSelect:ce,handleRemove:me,handleClear:ot,getSelectedOptions:pe}=oe({options:s,labelKey:n,valueKey:l,value:d,multiple:P,onChange:p,typeSet:x,name:a,setSearchTerm:A}),at=je({isOpen:M,setIsOpen:N,multiple:P,searchTerm:I,setSearchTerm:A,selectedValues:Q,filteredOptions:z,highlightedIndex:G,setHighlightedIndex:Y,handleSelect:ce,handleRemove:me}),$=gt.useId(),nt="w-full bg-transparent outline-none placeholder:text-gray-500 dark:placeholder:text-gray-400 text-gray-900 dark:text-gray-100",it=f("relative w-full min-h-[40px] px-3 py-2 border rounded-md bg-white dark:bg-gray-800",u?"border-red-500":"border-gray-300 dark:border-gray-600",c?"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 ${b}`,children:[r&&jsxRuntime.jsx(g,{htmlFor:$,required:o,children:r}),jsxRuntime.jsxs("div",{ref:X,className:"relative",children:[jsxRuntime.jsxs("div",{className:it,children:[P&&pe().length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:pe().map((w,R)=>jsxRuntime.jsx(et,{option:w,labelKey:n,valueKey:l,onRemove:me},String(w[l]??R)))}),jsxRuntime.jsx("input",{ref:F,...C,name:a,type:"text",placeholder:i,value:I,onChange:w=>{let R=w.target.value;A(R),!M&&R.trim()!==""&&N(!0);},onKeyDown:at,onMouseDown:w=>{document.activeElement===F.current&&(w.preventDefault(),N(R=>{let D=!R;return D&&Y(0),D}));},onFocus:()=>{N(!0),Y(0);},disabled:c,className:nt,role:"combobox","aria-expanded":M,"aria-controls":$,"aria-activedescendant":G>=0?`${$}-opt-${G}`:void 0}),h&&!!Q.length&&jsxRuntime.jsx("button",{type:"button",onMouseDown:w=>w.preventDefault(),onClick:ot,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(U,{width:12,height:12})})]}),M&&jsxRuntime.jsx("div",{ref:W,id:$,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":P||void 0,children:z.length===0?jsxRuntime.jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"Nenhum resultado encontrado"}):z.map((w,R)=>{let D=String(w[l]),Z=Q.includes(D),j=R===G;return jsxRuntime.jsx("button",{id:`${$}-opt-${R}`,"data-index":R,role:"option","aria-selected":Z,type:"button",onMouseDown:st=>st.preventDefault(),onClick:()=>ce(w),className:f("w-full px-3 py-2 text-left text-sm transition-colors",j&&"bg-blue-100 dark:bg-blue-800 text-blue-900 dark:text-white",!j&&Z&&"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300",!Z&&!j&&"text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),children:jsxRuntime.jsx("span",{children:String(w[n])})},D)})})]}),u&&jsxRuntime.jsx(T,{children:u}),!u&&y&&jsxRuntime.jsx(E,{children:y})]})}var tt=gt.forwardRef(Zt);tt.displayName="ComboBox";var Pa=m(tt);var er=(e,t)=>gt.useMemo(()=>{let r=e?`${e}-group`:void 0,o=e&&t?`${e}-error`:void 0;return {groupId:r,errorId:o,ariaProps:{"aria-labelledby":r,"aria-invalid":t?"true":void 0,"aria-errormessage":t?o:void 0}}},[e,t]),rt=er;var tr=({name:e,label:t,required:r,errors:o,className:a,option:i,...n})=>{let{groupId:l,errorId:s,ariaProps:d}=rt(e,o);return jsxRuntime.jsxs("div",{className:`switch-group ${a}`,children:[t&&jsxRuntime.jsx(g,{htmlFor:e,id:l,className:"font-poppins text-[14px] font-medium leading-[21px] text-colorLight dark:text-colorDark",required:r,children:t}),jsxRuntime.jsx("div",{...d,children:jsxRuntime.jsxs(g,{htmlFor:e,className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsxs("div",{className:"relative inline-block w-12 h-6",children:[jsxRuntime.jsx("input",{id:e,name:e,type:"checkbox",className:"opacity-0 w-0 h-0 peer","data-testid":"INPUT_SWITCH"+e,"aria-describedby":s,...n}),jsxRuntime.jsx("span",{className:"absolute cursor-pointer top-0 left-0 right-0 bottom-0 bg-gray-300 rounded-full transition duration-300 before:absolute before:content-[''] before:h-5 before:w-5 before:left-0.5 before:bottom-0.5 before:bg-white before:rounded-full before:transition before:duration-300 peer-checked:bg-blue-600 peer-checked:before:translate-x-6"})]}),i]})}),o&&jsxRuntime.jsx(T,{children:o})]})},Fa=m(tr);var ar=({label:e,required:t=!1,errors:r,name:o,maxLength:a,className:i,...n})=>{let[l,s]=gt.useState(0),d=Rt__default.default("px-2 py-3 w-full text-stone-400 text-sm font-normal leading-tight border-2 border-opacity-0 shadow-input rounded-lg focus:outline-none focus:border-blue-500 border-neutral-400",{"border-[#DD052B] border-opacity-80 shadow-inputError":!!r},i??"");return jsxRuntime.jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsxRuntime.jsx(g,{htmlFor:o,className:"font-poppins text-[14px] font-medium leading-[21px] text-colorLight dark:text-colorDark",required:t,children:e}),jsxRuntime.jsxs("div",{className:"flex flex-col justify-center items-end w-full gap-1",children:[jsxRuntime.jsx("textarea",{...n,"data-testid":"TEXT_AREA"+o,name:o,maxLength:a,className:d,onInput:p=>s(p.currentTarget.textLength)}),a&&jsxRuntime.jsx("div",{children:jsxRuntime.jsxs("p",{children:[l," / ",a]})})]}),r&&jsxRuntime.jsx(T,{children:r})]})},qa=m(ar);
14
14
 
15
- exports.ButtonPrimitive = Cr;
16
- exports.CardContentPrimitive = Vr;
17
- exports.CardDescriptionPrimitive = Fr;
18
- exports.CardFooterPrimitive = Sr;
19
- exports.CardHeaderPrimitive = Hr;
20
- exports.CardPrimitive = Nr;
21
- exports.CardTitlePrimitive = Mr;
22
- exports.CheckBoxPrimitive = to;
23
- exports.ComboBoxPrimitive = wa;
15
+ exports.ButtonPrimitive = yr;
16
+ exports.CardContentPrimitive = Fr;
17
+ exports.CardDescriptionPrimitive = Mr;
18
+ exports.CardFooterPrimitive = Vr;
19
+ exports.CardHeaderPrimitive = Nr;
20
+ exports.CardPrimitive = kr;
21
+ exports.CardTitlePrimitive = Hr;
22
+ exports.CheckBoxPrimitive = eo;
23
+ exports.ComboBoxPrimitive = Pa;
24
24
  exports.HelperFieldPrimitive = E;
25
- exports.InputPrimitive = Mo;
26
- exports.LabelPrimitive = v;
27
- exports.LicenseProvider = ut;
28
- exports.RadioPrimitive = Ko;
29
- exports.SelectPrimitive = Qo;
30
- exports.SwitchPrimitive = Va;
31
- exports.TextAreaPrimitive = Oa;
32
- exports.ValidateFieldPrimitive = x;
25
+ exports.InputPrimitive = Ho;
26
+ exports.LabelPrimitive = g;
27
+ exports.LicenseProvider = pt;
28
+ exports.RadioPrimitive = Bo;
29
+ exports.SelectPrimitive = Yo;
30
+ exports.SwitchPrimitive = Fa;
31
+ exports.TextAreaPrimitive = qa;
32
+ exports.ValidateFieldPrimitive = T;
package/dist/page.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import vt, { createContext, forwardRef, useId, useState, useEffect, useRef, useImperativeHandle, useCallback, useMemo, useContext } from 'react';
1
+ import gt, { createContext, forwardRef, useId, useState, useEffect, useRef, useImperativeHandle, useCallback, useMemo, useContext } from 'react';
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
- import Et, { clsx } from 'clsx';
3
+ import Rt, { clsx } from 'clsx';
4
4
  import { twMerge } from 'tailwind-merge';
5
5
 
6
- var fe=createContext(void 0),pt=({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"})]})}),ut=({children:e,licenseKey:t})=>{let[r,o]=useState(!1),[a,i]=useState(null),[n,l]=useState(!0),s=c=>{if(i(null),!c)throw new Error("\u{1F512} Chave de licen\xE7a \xE9 obrigat\xF3ria");let p="chave-secreta-123";if(c!==p)throw new Error("\u274C Chave de licen\xE7a inv\xE1lida");o(!0);};return useEffect(()=>{if(t){l(!0);try{s(t);}catch(c){i(c instanceof Error?c.message:"Erro desconhecido na valida\xE7\xE3o da licen\xE7a");}finally{l(!1);}}else i("\u{1F512} Licen\xE7a n\xE3o informada"),l(!1);},[t]),n?null:jsx(fe.Provider,{value:{isLicenseValid:r,validateLicense:s,licenseError:a},children:r?e:jsx(pt,{message:a||"Licen\xE7a inv\xE1lida"})})},be=()=>{let e=useContext(fe);if(!e)throw new Error("useLicense deve ser usado dentro de um LicenseProvider");return e};var ve=({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})]});function m(e){let t=r=>{let{isLicenseValid:o}=be();return o?jsx(e,{...r}):jsx(ve,{})};return t.displayName=e.displayName??e.name,t}function f(...e){return twMerge(clsx(e))}var Te=vt.forwardRef(({className:e,overrideClassName:t,variant:r="primary",size:o="md",href:a,children:i,loading:n=!1,loadingContent:l,...s},c)=>{let p="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",b={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",sm:"h-9 px-3 text-sm",md:"h-10 px-4 py-2",lg:"h-11 px-6 text-lg",xl:"h-12 px-8 text-xl"},d=t?e:f(p,b[r],h[o],e);return a?jsx("a",{href:a,className:d,ref:c,children:n&&l?l:i}):jsx("button",{className:d,ref:c,...s,children:n&&l?l:i})});Te.displayName="Button";var Cr=m(Te);var ye=forwardRef(({className:e,overrideClassName:t=!1,children:r,...o},a)=>jsx("div",{ref:a,className:t?e:f("rounded-lg border bg-card text-card-foreground shadow-sm",e),...o,children:r}));ye.displayName="Card";var Ce=forwardRef(({className:e,overrideClassName:t=!1,children:r,...o},a)=>jsx("div",{ref:a,className:t?e:f("flex flex-col space-y-1.5 p-6",e),...o,children:r}));Ce.displayName="CardHeader";var Pe=forwardRef(({className:e,overrideClassName:t=!1,children:r,...o},a)=>jsx("h3",{ref:a,className:t?e:f("text-2xl font-semibold leading-none tracking-tight",e),...o,children:r}));Pe.displayName="CardTitle";var we=forwardRef(({className:e,overrideClassName:t=!1,children:r,...o},a)=>jsx("p",{ref:a,className:t?e:f("text-sm text-muted-foreground",e),...o,children:r}));we.displayName="CardDescription";var Le=forwardRef(({className:e,overrideClassName:t=!1,children:r,...o},a)=>jsx("div",{ref:a,className:t?e:f("p-6 pt-0",e),...o,children:r}));Le.displayName="CardContent";var Re=forwardRef(({className:e,overrideClassName:t=!1,children:r,...o},a)=>jsx("div",{ref:a,className:t?e:f("flex items-center p-6 pt-0",e),...o,children:r}));Re.displayName="CardFooter";var Nr=m(ye),Hr=m(Ce),Mr=m(Pe),Fr=m(we),Vr=m(Le),Sr=m(Re);var xt=({children:e,className:t,overrideClassName:r})=>{if(e)return jsx("p",{className:r?t:f("text-sm text-muted-foreground",t),children:e})},E=m(xt);var Tt=({children:e,required:t,className:r,overrideClassName:o=!1,...a})=>jsxs("div",{className:"flex items-center gap-1",children:[jsx("label",{...a,className:o?r:f("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:"*"})]}),v=m(Tt);var Ct=({children:e,className:t,overrideClassName:r})=>{if(e)return jsx("p",{className:r?t:f("text-sm text-red-600 dark:text-red-400",t),children:e})},x=m(Ct);var Ne=forwardRef(({label:e,required:t,option:r,orientation:o="left",className:a,overrideClassName:i=!1,helperText:n,error:l,...s},c)=>{let p=useId(),b=f("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",l&&"border-destructive",a);return jsxs("div",{className:"space-y-2",children:[e&&jsx(v,{required:t,children:e}),jsxs("div",{className:`flex ${o=="left"?"flex-row":"flex-row-reverse"} w-fit gap-2`,children:[jsx("input",{id:p,type:"checkbox",className:i?a:b,ref:c,...s}),r&&jsx(v,{htmlFor:p,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r})]}),l&&jsx(x,{children:l}),!l&&n&&jsx(E,{children:n})]})});Ne.displayName="CheckBox";var to=m(Ne);var Rt=({...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"})}),U=Rt;var kt=({children:e,before:t,after:r,className:o})=>{let i=Et("flex justify-center items-center",{"rounded-l-lg":t,"rounded-r-lg":r},o);return jsx("div",{className:i,children:jsx("span",{children:e})})},te=kt;var Nt=({children:e})=>jsx("div",{className:"absolute px-2",children:jsx("span",{children:e})}),Ve=Nt;var Ht=({children:e})=>jsx("div",{className:"absolute right-0 px-2",children:jsx("span",{children:e})}),Ie=Ht;function Ae(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 $e(e){let t=e.currentTarget.value;t=t.replace(/\D/g,""),t=t.padStart(3,"0");let r=t.slice(0,-2),o=t.slice(-2),n=`${(r.replace(/^0+/,"")||"0").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1.")},${o}`;return e.currentTarget.value=n,e}function De(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 Be(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 Ke(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 qe(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 Oe(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 _e(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 Mt=({e,mask:t})=>{switch(t){case"money":return $e(e);case"mobile":return Be(e);case"phone":return Ke(e);case"cpfCnpj":return qe(e);case"cpf":return De(e);case"rg":return Oe(e);case"cnpj":return _e(e);case"cep":return Ae(e);default:return e}},We=Mt;var St=({mask:e,initialValue:t=""})=>{let[r,o]=useState(t);useEffect(()=>{t!==r&&o(t);},[t]);let a=useCallback(n=>{let s=We({e:n,mask:e})?.currentTarget?.value??n.currentTarget.value;o(s);},[e]),i=useCallback(()=>o(""),[]);return {value:r,setValue:o,handleChange:a,handleClear:i}},Ue=St;var Je=forwardRef(({label:e,required:t=!1,mask:r,name:o,prefix:a,suffix:i,addonBefore:n,addonBeforeClassName:l,addonAfter:s,addonAfterClassName:c,ClearEnabled:p=!0,className:b,overrideClassName:h=!1,error:d,helperText:T,value:L=void 0,onChange:u,...g},y)=>{let C=useId(),{handleChange:M,handleClear:N,setValue:I}=Ue({mask:r,initialValue:L}),A=f("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",!a&&!i&&"px-3",a&&!i&&"pl-10 pr-3",i&&!a&&"pl-3 pr-10",a&&i&&"pl-10 pr-10",n&&"rounded-l-none border-l-0",s&&"rounded-r-none border-r-0",b),X=F=>{M(F),u?.(F);},W=()=>{N(),I(""),u?.({target:{name:o||"",value:""}});};return jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsx(v,{htmlFor:C,required:t,children:e}),jsxs("div",{className:"relative flex",children:[n&&jsx(te,{before:!0,className:l,children:n}),jsxs("div",{className:"relative flex items-center w-full",children:[a&&jsx(Ve,{children:a}),jsx("input",{id:C,ref:y,name:o,onChange:X,className:h?b:A,...g}),p&&L&&jsx(U,{onClick:W,width:12,height:12,className:f("absolute right-2 cursor-pointer",i&&"right-8")}),i&&jsx(Ie,{children:i})]}),s&&jsx(te,{after:!0,className:c,children:s})]}),d&&jsx(x,{children:d}),!d&&T&&jsx(E,{children:T})]})});Je.displayName="Input";var Mo=m(Je);var ze=forwardRef(({label:e,required:t,option:r,className:o,overrideClassName:a,helperText:i,error:n,...l},s)=>{let c=useId(),p=f("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",n&&"border-destructive",o);return jsxs("div",{className:"space-y-3",children:[e&&jsx(v,{required:t,children:e}),jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{id:c,type:"radio",className:a?o:p,ref:s,...l}),r&&jsx(v,{htmlFor:c,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r})]}),n&&jsx(x,{children:n}),!n&&i&&jsx(E,{children:i})]})});ze.displayName="Radio";var Ko=m(ze);function qt({label:e,required:t=!1,options:r,labelKey:o,valueKey:a,placeholder:i,error:n,helperText:l,className:s,...c},p){let b=useId(),h=f("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",n&&"border-red-500 focus-visible:ring-red-500",s);return jsxs("div",{className:"space-y-2",children:[e&&jsx(v,{htmlFor:b,required:t,children:e}),jsxs("select",{id:b,className:h,ref:p,...c,children:[i&&jsx("option",{value:"",disabled:!0,children:i}),r.map((d,T)=>jsx("option",{value:String(d[a]),children:String(d[o])},T))]}),n&&jsx(x,{children:n}),!n&&l&&jsx(E,{children:l})]})}var Qe=forwardRef(qt);Qe.displayName="Select";var Ot=Qe,Qo=m(Ot);var Wt=(e,t)=>{useEffect(()=>{let r=o=>{e.current&&!e.current.contains(o.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},Ze=Wt;function oe({options:e,labelKey:t,valueKey:r,multiple:o,onChange:a,setSearchTerm:i,typeSet:n,name:l}){let[s,c]=useState([]),p=useMemo(()=>new Map(e.map(u=>[String(u[r]),u])),[e,r]),b=useCallback(()=>s.map(u=>p.get(u)).filter(u=>!!u),[s,p]),h=useCallback(u=>{if(!a)return;let g;if(n==="field"?o?g=u:g=u[0]??void 0:o?g=u.map(C=>p.get(C)).filter(C=>C!==void 0):g=p.get(u[0]??"")??void 0,i&&!o){let y=p.get(u[0]??"");y&&i(String(y[t]));}a({target:{name:l,value:g,type:"combobox"}});},[o,a,p,l,n,i,t]),d=useCallback(u=>{let g=String(u[r]),y=o?s.includes(g)?s.filter(C=>C!==g):[...s,g]:[g];c(y),h(y);},[o,s,h,r]),T=useCallback(u=>{let g=s.filter(y=>y!==u);c(g),h(g);},[s,h]),L=useCallback(()=>{c([]),i?.("");let u;n==="field"?u=o?[]:"":u=o?[]:void 0,a?.({target:{name:l,value:u,type:"combobox"}});},[o,a,l,i,n]);return {selectedValues:s,handleSelect:d,handleRemove:T,handleClear:L,getSelectedOptions:b}}function ae(e,t,r){return useMemo(()=>r?e.filter(a=>String(a[t]).toLowerCase().includes(r.toLowerCase())):e,[e,r,t])}var et=({isOpen:e,setIsOpen:t,multiple:r,searchTerm:o,setSearchTerm:a,selectedValues:i,filteredOptions:n,highlightedIndex:l,setHighlightedIndex:s,handleSelect:c,handleRemove:p})=>{let b=useCallback(d=>{if(n.length===0){s(-1);return}s(T=>T<0?d>0?0:n.length-1:(T+d+n.length)%n.length);},[n,s]);return useCallback(d=>{if(!e){if(d.key==="Enter"||d.key==="ArrowDown"){t(!0),s(0),d.preventDefault();return}r&&d.key==="Backspace"&&o===""&&i.length>0&&(d.preventDefault(),p(i[i.length-1]));return}switch(d.key){case"ArrowDown":d.preventDefault(),b(1);break;case"ArrowUp":d.preventDefault(),b(-1);break;case"Enter":d.preventDefault();let T=l>=0?l:0,L=n[T];L&&c(L),r&&a&&a(""),r||(t(!1),s(-1));break;case"Escape":d.preventDefault(),t(!1),s(-1),r||a("");break;case"Tab":t(!1),s(-1);break;case"Home":d.preventDefault(),n.length>0&&s(0);break;case"End":d.preventDefault(),n.length>0&&s(n.length-1);break;case"Backspace":r&&o===""&&i.length>0&&(d.preventDefault(),p(i[i.length-1]));break}},[e,r,o,i,n,l,t,a,s,c,p,b])};function tt({option:e,labelKey:t,valueKey:r,onRemove:o}){let a=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:[a,jsx("button",{type:"button",onMouseDown:n=>n.preventDefault(),onClick:()=>o(i),className:"hover:bg-blue-200 dark:hover:bg-blue-800 rounded-full p-0.5 transition-colors","aria-label":`Remover ${a}`,children:"\u2715"})]},i)}function jt(e,t){let{label:r,required:o=!1,name:a,placeholder:i="Buscar...",labelKey:n,valueKey:l,options:s,value:c,onChange:p,mode:b="single",typeSet:h="field",disabled:d=!1,ClearEnabled:T=!0,helperText:L,error:u=!1,className:g="",...y}=e,C=b==="multiple",[M,N]=useState(!1),[I,A]=useState(""),X=useRef(null),W=useRef(null),F=useRef(null);useImperativeHandle(t,()=>F.current),Ze(W,()=>N(!1));let z=ae(s,n,I),[G,Y]=useState(-1),{selectedValues:Q,handleSelect:ce,handleRemove:me,handleClear:at,getSelectedOptions:pe}=oe({options:s,labelKey:n,valueKey:l,value:c,multiple:C,onChange:p,typeSet:h,name:a,setSearchTerm:A}),nt=et({isOpen:M,setIsOpen:N,multiple:C,searchTerm:I,setSearchTerm:A,selectedValues:Q,filteredOptions:z,highlightedIndex:G,setHighlightedIndex:Y,handleSelect:ce,handleRemove:me}),$=useId(),it="w-full bg-transparent outline-none placeholder:text-gray-500 dark:placeholder:text-gray-400 text-gray-900 dark:text-gray-100",st=f("relative w-full min-h-[40px] px-3 py-2 border rounded-md bg-white dark:bg-gray-800",u?"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 ${g}`,children:[r&&jsx(v,{htmlFor:$,required:o,children:r}),jsxs("div",{ref:X,className:"relative",children:[jsxs("div",{className:st,children:[C&&pe().length>0&&jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:pe().map((P,R)=>jsx(tt,{option:P,labelKey:n,valueKey:l,onRemove:me},String(P[l]??R)))}),jsx("input",{ref:F,...y,name:a,type:"text",placeholder:i,value:I,onChange:P=>{let R=P.target.value;A(R),!M&&R.trim()!==""&&N(!0);},onKeyDown:nt,onMouseDown:P=>{document.activeElement===F.current&&(P.preventDefault(),N(R=>{let D=!R;return D&&Y(0),D}));},onFocus:()=>{N(!0),Y(0);},disabled:d,className:it,role:"combobox","aria-expanded":M,"aria-controls":$,"aria-activedescendant":G>=0?`${$}-opt-${G}`:void 0}),T&&!!Q.length&&jsx("button",{type:"button",onMouseDown:P=>P.preventDefault(),onClick:at,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(U,{width:12,height:12})})]}),M&&jsx("div",{ref:W,id:$,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":C||void 0,children:z.length===0?jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"Nenhum resultado encontrado"}):z.map((P,R)=>{let D=String(P[l]),Z=Q.includes(D),j=R===G;return jsx("button",{id:`${$}-opt-${R}`,"data-index":R,role:"option","aria-selected":Z,type:"button",onMouseDown:lt=>lt.preventDefault(),onClick:()=>ce(P),className:f("w-full px-3 py-2 text-left text-sm transition-colors",j&&"bg-blue-100 dark:bg-blue-800 text-blue-900 dark:text-white",!j&&Z&&"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300",!Z&&!j&&"text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),children:jsx("span",{children:String(P[n])})},D)})})]}),u&&jsx(x,{children:u}),!u&&L&&jsx(E,{children:L})]})}var rt=forwardRef(jt);rt.displayName="ComboBox";var wa=m(rt);var tr=(e,t)=>useMemo(()=>{let r=e?`${e}-group`:void 0,o=e&&t?`${e}-error`:void 0;return {groupId:r,errorId:o,ariaProps:{"aria-labelledby":r,"aria-invalid":t?"true":void 0,"aria-errormessage":t?o:void 0}}},[e,t]),ot=tr;var rr=({name:e,label:t,required:r,errors:o,className:a,option:i,...n})=>{let{groupId:l,errorId:s,ariaProps:c}=ot(e,o);return jsxs("div",{className:`switch-group ${a}`,children:[t&&jsx(v,{htmlFor:e,id:l,className:"font-poppins text-[14px] font-medium leading-[21px] text-colorLight dark:text-colorDark",required:r,children:t}),jsx("div",{...c,children:jsxs(v,{htmlFor:e,className:"flex items-center gap-2 cursor-pointer",children:[jsxs("div",{className:"relative inline-block w-12 h-6",children:[jsx("input",{id:e,name:e,type:"checkbox",className:"opacity-0 w-0 h-0 peer","data-testid":"INPUT_SWITCH"+e,"aria-describedby":s,...n}),jsx("span",{className:"absolute cursor-pointer top-0 left-0 right-0 bottom-0 bg-gray-300 rounded-full transition duration-300 before:absolute before:content-[''] before:h-5 before:w-5 before:left-0.5 before:bottom-0.5 before:bg-white before:rounded-full before:transition before:duration-300 peer-checked:bg-blue-600 peer-checked:before:translate-x-6"})]}),i]})}),o&&jsx(x,{children:o})]})},Va=m(rr);var nr=({label:e,required:t=!1,errors:r,name:o,maxLength:a,className:i,...n})=>{let[l,s]=useState(0),c=Et("px-2 py-3 w-full text-stone-400 text-sm font-normal leading-tight border-2 border-opacity-0 shadow-input rounded-lg focus:outline-none focus:border-blue-500 border-neutral-400",{"border-[#DD052B] border-opacity-80 shadow-inputError":!!r},i??"");return jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsx(v,{htmlFor:o,className:"font-poppins text-[14px] font-medium leading-[21px] text-colorLight dark:text-colorDark",required:t,children:e}),jsxs("div",{className:"flex flex-col justify-center items-end w-full gap-1",children:[jsx("textarea",{...n,"data-testid":"TEXT_AREA"+o,name:o,maxLength:a,className:c,onInput:p=>s(p.currentTarget.textLength)}),a&&jsx("div",{children:jsxs("p",{children:[l," / ",a]})})]}),r&&jsx(x,{children:r})]})},Oa=m(nr);
6
+ var fe=createContext(void 0),mt=({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"})]})}),pt=({children:e,licenseKey:t})=>{let[r,o]=useState(!1),[a,i]=useState(null),[n,l]=useState(!0),s=d=>{if(i(null),!d)throw new Error("\u{1F512} Chave de licen\xE7a \xE9 obrigat\xF3ria");let p="chave-secreta-123";if(d!==p)throw new Error("\u274C Chave de licen\xE7a inv\xE1lida");o(!0);};return useEffect(()=>{if(t){l(!0);try{s(t);}catch(d){i(d instanceof Error?d.message:"Erro desconhecido na valida\xE7\xE3o da licen\xE7a");}finally{l(!1);}}else i("\u{1F512} Licen\xE7a n\xE3o informada"),l(!1);},[t]),n?null:jsx(fe.Provider,{value:{isLicenseValid:r,validateLicense:s,licenseError:a},children:r?e:jsx(mt,{message:a||"Licen\xE7a inv\xE1lida"})})},be=()=>{let e=useContext(fe);if(!e)throw new Error("useLicense deve ser usado dentro de um LicenseProvider");return e};var ve=({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 m=e=>t=>{let{isLicenseValid:r}=be();return r?jsx(e,{...t}):jsx(ve,{})};function f(...e){return twMerge(clsx(e))}var Te=gt.forwardRef(({className:e,overrideClassName:t,variant:r="primary",size:o="md",href:a,children:i,loading:n=!1,loadingContent:l,...s},d)=>{let p="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",v={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"},x={xs:"h-7 px-2 text-xs",sm:"h-9 px-3 text-sm",md:"h-10 px-4 py-2",lg:"h-11 px-6 text-lg",xl:"h-12 px-8 text-xl"},c=t?e:f(p,v[r],x[o],e);return a?jsx("a",{href:a,className:c,ref:d,children:n&&l?l:i}):jsx("button",{className:c,ref:d,...s,children:n&&l?l:i})});Te.displayName="Button";var yr=m(Te);var ye=forwardRef(({className:e,overrideClassName:t=!1,children:r,...o},a)=>jsx("div",{ref:a,className:t?e:f("rounded-lg border bg-card text-card-foreground shadow-sm",e),...o,children:r}));ye.displayName="Card";var Ce=forwardRef(({className:e,overrideClassName:t=!1,children:r,...o},a)=>jsx("div",{ref:a,className:t?e:f("flex flex-col space-y-1.5 p-6",e),...o,children:r}));Ce.displayName="CardHeader";var Pe=forwardRef(({className:e,overrideClassName:t=!1,children:r,...o},a)=>jsx("h3",{ref:a,className:t?e:f("text-2xl font-semibold leading-none tracking-tight",e),...o,children:r}));Pe.displayName="CardTitle";var we=forwardRef(({className:e,overrideClassName:t=!1,children:r,...o},a)=>jsx("p",{ref:a,className:t?e:f("text-sm text-muted-foreground",e),...o,children:r}));we.displayName="CardDescription";var Le=forwardRef(({className:e,overrideClassName:t=!1,children:r,...o},a)=>jsx("div",{ref:a,className:t?e:f("p-6 pt-0",e),...o,children:r}));Le.displayName="CardContent";var Re=forwardRef(({className:e,overrideClassName:t=!1,children:r,...o},a)=>jsx("div",{ref:a,className:t?e:f("flex items-center p-6 pt-0",e),...o,children:r}));Re.displayName="CardFooter";var kr=m(ye),Nr=m(Ce),Hr=m(Pe),Mr=m(we),Fr=m(Le),Vr=m(Re);var vt=({children:e,className:t,overrideClassName:r})=>{if(e)return jsx("p",{className:r?t:f("text-sm text-muted-foreground",t),children:e})},E=m(vt);var ht=({children:e,required:t,className:r,overrideClassName:o=!1,...a})=>jsxs("div",{className:"flex items-center gap-1",children:[jsx("label",{...a,className:o?r:f("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:"*"})]}),g=m(ht);var yt=({children:e,className:t,overrideClassName:r})=>{if(e)return jsx("p",{className:r?t:f("text-sm text-red-600 dark:text-red-400",t),children:e})},T=m(yt);var Ne=forwardRef(({label:e,required:t,option:r,orientation:o="left",className:a,overrideClassName:i=!1,helperText:n,error:l,...s},d)=>{let p=useId(),v=f("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",l&&"border-destructive",a);return jsxs("div",{className:"space-y-2",children:[e&&jsx(g,{required:t,children:e}),jsxs("div",{className:`flex ${o=="left"?"flex-row":"flex-row-reverse"} w-fit gap-2`,children:[jsx("input",{id:p,type:"checkbox",className:i?a:v,ref:d,...s}),r&&jsx(g,{htmlFor:p,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r})]}),l&&jsx(T,{children:l}),!l&&n&&jsx(E,{children:n})]})});Ne.displayName="CheckBox";var eo=m(Ne);var Lt=({...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"})}),U=Lt;var Et=({children:e,before:t,after:r,className:o})=>{let i=Rt("flex justify-center items-center",{"rounded-l-lg":t,"rounded-r-lg":r},o);return jsx("div",{className:i,children:jsx("span",{children:e})})},te=Et;var kt=({children:e})=>jsx("div",{className:"absolute px-2",children:jsx("span",{children:e})}),Ve=kt;var Nt=({children:e})=>jsx("div",{className:"absolute right-0 px-2",children:jsx("span",{children:e})}),Ie=Nt;function Ae(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 $e(e){let t=e.currentTarget.value;t=t.replace(/\D/g,""),t=t.padStart(3,"0");let r=t.slice(0,-2),o=t.slice(-2),n=`${(r.replace(/^0+/,"")||"0").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1.")},${o}`;return e.currentTarget.value=n,e}function De(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 Be(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 Ke(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 qe(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 Oe(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 _e(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 Ht=({e,mask:t})=>{switch(t){case"money":return $e(e);case"mobile":return Be(e);case"phone":return Ke(e);case"cpfCnpj":return qe(e);case"cpf":return De(e);case"rg":return Oe(e);case"cnpj":return _e(e);case"cep":return Ae(e);default:return e}},We=Ht;var Vt=({mask:e,initialValue:t=""})=>{let[r,o]=useState(t);useEffect(()=>{t!==r&&o(t);},[t]);let a=useCallback(n=>{let s=We({e:n,mask:e})?.currentTarget?.value??n.currentTarget.value;o(s);},[e]),i=useCallback(()=>o(""),[]);return {value:r,setValue:o,handleChange:a,handleClear:i}},Ue=Vt;var Je=forwardRef(({label:e,required:t=!1,mask:r,name:o,prefix:a,suffix:i,addonBefore:n,addonBeforeClassName:l,addonAfter:s,addonAfterClassName:d,ClearEnabled:p=!0,className:v,overrideClassName:x=!1,error:c,helperText:h,value:y=void 0,onChange:u,...b},C)=>{let P=useId(),{handleChange:M,handleClear:N,setValue:I}=Ue({mask:r,initialValue:y}),A=f("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",c&&"border-destructive focus-visible:ring-destructive",!a&&!i&&"px-3",a&&!i&&"pl-10 pr-3",i&&!a&&"pl-3 pr-10",a&&i&&"pl-10 pr-10",n&&"rounded-l-none border-l-0",s&&"rounded-r-none border-r-0",v),X=F=>{M(F),u?.(F);},W=()=>{N(),I(""),u?.({target:{name:o||"",value:""}});};return jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsx(g,{htmlFor:P,required:t,children:e}),jsxs("div",{className:"relative flex",children:[n&&jsx(te,{before:!0,className:l,children:n}),jsxs("div",{className:"relative flex items-center w-full",children:[a&&jsx(Ve,{children:a}),jsx("input",{id:P,ref:C,name:o,onChange:X,className:x?v:A,...b}),p&&y&&jsx(U,{onClick:W,width:12,height:12,className:f("absolute right-2 cursor-pointer",i&&"right-8")}),i&&jsx(Ie,{children:i})]}),s&&jsx(te,{after:!0,className:d,children:s})]}),c&&jsx(T,{children:c}),!c&&h&&jsx(E,{children:h})]})});Je.displayName="Input";var Ho=m(Je);var ze=forwardRef(({label:e,required:t,option:r,className:o,overrideClassName:a,helperText:i,error:n,...l},s)=>{let d=useId(),p=f("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",n&&"border-destructive",o);return jsxs("div",{className:"space-y-3",children:[e&&jsx(g,{required:t,children:e}),jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{id:d,type:"radio",className:a?o:p,ref:s,...l}),r&&jsx(g,{htmlFor:d,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r})]}),n&&jsx(T,{children:n}),!n&&i&&jsx(E,{children:i})]})});ze.displayName="Radio";var Bo=m(ze);function Kt(e,t){let{label:r,required:o=!1,options:a,labelKey:i,valueKey:n,placeholder:l,error:s,helperText:d,className:p,...v}=e,x=useId(),c=f("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",s&&"border-red-500 focus-visible:ring-red-500",p);return jsxs("div",{className:"space-y-2",children:[r&&jsx(g,{htmlFor:x,required:o,children:r}),jsxs("select",{id:x,className:c,ref:t,...v,children:[l&&jsx("option",{value:"",disabled:!0,children:l}),a.map((h,y)=>jsx("option",{value:String(h[n]),children:String(h[i])},y))]}),s&&jsx(T,{children:s}),!s&&d&&jsx(E,{children:d})]})}var qt=forwardRef(Kt),Yo=m(qt);var _t=(e,t)=>{useEffect(()=>{let r=o=>{e.current&&!e.current.contains(o.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},Qe=_t;function oe({options:e,labelKey:t,valueKey:r,multiple:o,onChange:a,setSearchTerm:i,typeSet:n,name:l}){let[s,d]=useState([]),p=useMemo(()=>new Map(e.map(u=>[String(u[r]),u])),[e,r]),v=useCallback(()=>s.map(u=>p.get(u)).filter(u=>!!u),[s,p]),x=useCallback(u=>{if(!a)return;let b;if(n==="field"?o?b=u:b=u[0]??void 0:o?b=u.map(P=>p.get(P)).filter(P=>P!==void 0):b=p.get(u[0]??"")??void 0,i&&!o){let C=p.get(u[0]??"");C&&i(String(C[t]));}a({target:{name:l,value:b,type:"combobox"}});},[o,a,p,l,n,i,t]),c=useCallback(u=>{let b=String(u[r]),C=o?s.includes(b)?s.filter(P=>P!==b):[...s,b]:[b];d(C),x(C);},[o,s,x,r]),h=useCallback(u=>{let b=s.filter(C=>C!==u);d(b),x(b);},[s,x]),y=useCallback(()=>{d([]),i?.("");let u;n==="field"?u=o?[]:"":u=o?[]:void 0,a?.({target:{name:l,value:u,type:"combobox"}});},[o,a,l,i,n]);return {selectedValues:s,handleSelect:c,handleRemove:h,handleClear:y,getSelectedOptions:v}}function ae(e,t,r){return useMemo(()=>r?e.filter(a=>String(a[t]).toLowerCase().includes(r.toLowerCase())):e,[e,r,t])}var je=({isOpen:e,setIsOpen:t,multiple:r,searchTerm:o,setSearchTerm:a,selectedValues:i,filteredOptions:n,highlightedIndex:l,setHighlightedIndex:s,handleSelect:d,handleRemove:p})=>{let v=useCallback(c=>{if(n.length===0){s(-1);return}s(h=>h<0?c>0?0:n.length-1:(h+c+n.length)%n.length);},[n,s]);return useCallback(c=>{if(!e){if(c.key==="Enter"||c.key==="ArrowDown"){t(!0),s(0),c.preventDefault();return}r&&c.key==="Backspace"&&o===""&&i.length>0&&(c.preventDefault(),p(i[i.length-1]));return}switch(c.key){case"ArrowDown":c.preventDefault(),v(1);break;case"ArrowUp":c.preventDefault(),v(-1);break;case"Enter":c.preventDefault();let h=l>=0?l:0,y=n[h];y&&d(y),r&&a&&a(""),r||(t(!1),s(-1));break;case"Escape":c.preventDefault(),t(!1),s(-1),r||a("");break;case"Tab":t(!1),s(-1);break;case"Home":c.preventDefault(),n.length>0&&s(0);break;case"End":c.preventDefault(),n.length>0&&s(n.length-1);break;case"Backspace":r&&o===""&&i.length>0&&(c.preventDefault(),p(i[i.length-1]));break}},[e,r,o,i,n,l,t,a,s,d,p,v])};function et({option:e,labelKey:t,valueKey:r,onRemove:o}){let a=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:[a,jsx("button",{type:"button",onMouseDown:n=>n.preventDefault(),onClick:()=>o(i),className:"hover:bg-blue-200 dark:hover:bg-blue-800 rounded-full p-0.5 transition-colors","aria-label":`Remover ${a}`,children:"\u2715"})]},i)}function Zt(e,t){let{label:r,required:o=!1,name:a,placeholder:i="Buscar...",labelKey:n,valueKey:l,options:s,value:d,onChange:p,mode:v="single",typeSet:x="field",disabled:c=!1,ClearEnabled:h=!0,helperText:y,error:u=!1,className:b="",...C}=e,P=v==="multiple",[M,N]=useState(!1),[I,A]=useState(""),X=useRef(null),W=useRef(null),F=useRef(null);useImperativeHandle(t,()=>F.current),Qe(W,()=>N(!1));let z=ae(s,n,I),[G,Y]=useState(-1),{selectedValues:Q,handleSelect:ce,handleRemove:me,handleClear:ot,getSelectedOptions:pe}=oe({options:s,labelKey:n,valueKey:l,value:d,multiple:P,onChange:p,typeSet:x,name:a,setSearchTerm:A}),at=je({isOpen:M,setIsOpen:N,multiple:P,searchTerm:I,setSearchTerm:A,selectedValues:Q,filteredOptions:z,highlightedIndex:G,setHighlightedIndex:Y,handleSelect:ce,handleRemove:me}),$=useId(),nt="w-full bg-transparent outline-none placeholder:text-gray-500 dark:placeholder:text-gray-400 text-gray-900 dark:text-gray-100",it=f("relative w-full min-h-[40px] px-3 py-2 border rounded-md bg-white dark:bg-gray-800",u?"border-red-500":"border-gray-300 dark:border-gray-600",c?"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 ${b}`,children:[r&&jsx(g,{htmlFor:$,required:o,children:r}),jsxs("div",{ref:X,className:"relative",children:[jsxs("div",{className:it,children:[P&&pe().length>0&&jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:pe().map((w,R)=>jsx(et,{option:w,labelKey:n,valueKey:l,onRemove:me},String(w[l]??R)))}),jsx("input",{ref:F,...C,name:a,type:"text",placeholder:i,value:I,onChange:w=>{let R=w.target.value;A(R),!M&&R.trim()!==""&&N(!0);},onKeyDown:at,onMouseDown:w=>{document.activeElement===F.current&&(w.preventDefault(),N(R=>{let D=!R;return D&&Y(0),D}));},onFocus:()=>{N(!0),Y(0);},disabled:c,className:nt,role:"combobox","aria-expanded":M,"aria-controls":$,"aria-activedescendant":G>=0?`${$}-opt-${G}`:void 0}),h&&!!Q.length&&jsx("button",{type:"button",onMouseDown:w=>w.preventDefault(),onClick:ot,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(U,{width:12,height:12})})]}),M&&jsx("div",{ref:W,id:$,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":P||void 0,children:z.length===0?jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"Nenhum resultado encontrado"}):z.map((w,R)=>{let D=String(w[l]),Z=Q.includes(D),j=R===G;return jsx("button",{id:`${$}-opt-${R}`,"data-index":R,role:"option","aria-selected":Z,type:"button",onMouseDown:st=>st.preventDefault(),onClick:()=>ce(w),className:f("w-full px-3 py-2 text-left text-sm transition-colors",j&&"bg-blue-100 dark:bg-blue-800 text-blue-900 dark:text-white",!j&&Z&&"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300",!Z&&!j&&"text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),children:jsx("span",{children:String(w[n])})},D)})})]}),u&&jsx(T,{children:u}),!u&&y&&jsx(E,{children:y})]})}var tt=forwardRef(Zt);tt.displayName="ComboBox";var Pa=m(tt);var er=(e,t)=>useMemo(()=>{let r=e?`${e}-group`:void 0,o=e&&t?`${e}-error`:void 0;return {groupId:r,errorId:o,ariaProps:{"aria-labelledby":r,"aria-invalid":t?"true":void 0,"aria-errormessage":t?o:void 0}}},[e,t]),rt=er;var tr=({name:e,label:t,required:r,errors:o,className:a,option:i,...n})=>{let{groupId:l,errorId:s,ariaProps:d}=rt(e,o);return jsxs("div",{className:`switch-group ${a}`,children:[t&&jsx(g,{htmlFor:e,id:l,className:"font-poppins text-[14px] font-medium leading-[21px] text-colorLight dark:text-colorDark",required:r,children:t}),jsx("div",{...d,children:jsxs(g,{htmlFor:e,className:"flex items-center gap-2 cursor-pointer",children:[jsxs("div",{className:"relative inline-block w-12 h-6",children:[jsx("input",{id:e,name:e,type:"checkbox",className:"opacity-0 w-0 h-0 peer","data-testid":"INPUT_SWITCH"+e,"aria-describedby":s,...n}),jsx("span",{className:"absolute cursor-pointer top-0 left-0 right-0 bottom-0 bg-gray-300 rounded-full transition duration-300 before:absolute before:content-[''] before:h-5 before:w-5 before:left-0.5 before:bottom-0.5 before:bg-white before:rounded-full before:transition before:duration-300 peer-checked:bg-blue-600 peer-checked:before:translate-x-6"})]}),i]})}),o&&jsx(T,{children:o})]})},Fa=m(tr);var ar=({label:e,required:t=!1,errors:r,name:o,maxLength:a,className:i,...n})=>{let[l,s]=useState(0),d=Rt("px-2 py-3 w-full text-stone-400 text-sm font-normal leading-tight border-2 border-opacity-0 shadow-input rounded-lg focus:outline-none focus:border-blue-500 border-neutral-400",{"border-[#DD052B] border-opacity-80 shadow-inputError":!!r},i??"");return jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsx(g,{htmlFor:o,className:"font-poppins text-[14px] font-medium leading-[21px] text-colorLight dark:text-colorDark",required:t,children:e}),jsxs("div",{className:"flex flex-col justify-center items-end w-full gap-1",children:[jsx("textarea",{...n,"data-testid":"TEXT_AREA"+o,name:o,maxLength:a,className:d,onInput:p=>s(p.currentTarget.textLength)}),a&&jsx("div",{children:jsxs("p",{children:[l," / ",a]})})]}),r&&jsx(T,{children:r})]})},qa=m(ar);
7
7
 
8
- export { Cr as ButtonPrimitive, Vr as CardContentPrimitive, Fr as CardDescriptionPrimitive, Sr as CardFooterPrimitive, Hr as CardHeaderPrimitive, Nr as CardPrimitive, Mr as CardTitlePrimitive, to as CheckBoxPrimitive, wa as ComboBoxPrimitive, E as HelperFieldPrimitive, Mo as InputPrimitive, v as LabelPrimitive, ut as LicenseProvider, Ko as RadioPrimitive, Qo as SelectPrimitive, Va as SwitchPrimitive, Oa as TextAreaPrimitive, x as ValidateFieldPrimitive };
8
+ export { yr as ButtonPrimitive, Fr as CardContentPrimitive, Mr as CardDescriptionPrimitive, Vr as CardFooterPrimitive, Nr as CardHeaderPrimitive, kr as CardPrimitive, Hr as CardTitlePrimitive, eo as CheckBoxPrimitive, Pa as ComboBoxPrimitive, E as HelperFieldPrimitive, Ho as InputPrimitive, g as LabelPrimitive, pt as LicenseProvider, Bo as RadioPrimitive, Yo as SelectPrimitive, Fa as SwitchPrimitive, qa as TextAreaPrimitive, T as ValidateFieldPrimitive };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mvr-ui/components",
3
- "version": "1.0.45",
3
+ "version": "1.0.47",
4
4
  "sideEffects": false,
5
5
  "main": "dist/page.cjs",
6
6
  "module": "dist/page.js",