@mvr-ui/components 1.0.74 → 1.0.76

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/README.md CHANGED
@@ -1,212 +1,212 @@
1
- # @marcos-vinicius-rodrigues/components
2
-
3
-
4
-
5
- Esta é uma biblioteca de **componentes reutilizáveis** feita para aplicações em **React** e **Next.js**, com foco em produtividade, padronização visual e integração com formulários modernos.
6
-
7
-
8
-
9
- > ⚠️ Para utilizar esta biblioteca, é necessário ativar a licença via `LicenseProvider` com uma senha de acesso.
10
-
11
- > Entre em contato com **@marcos-vinicius-rodrigues** para solicitar a sua chave de uso.
12
-
13
-
14
-
15
- ---
16
-
17
-
18
-
19
- ## 📦 Instalação
20
-
21
-
22
-
23
- Você pode instalar via **npm** ou **yarn**:
24
-
25
-
26
-
27
- ```bash
28
-
29
- npm install @marcos-vinicius-rodrigues/components
30
-
31
- # ou
32
-
33
- yarn add @marcos-vinicius-rodrigues/components
34
-
35
- ```
36
-
37
-
38
-
39
- ---
40
-
41
-
42
-
43
- ## 🔐 Ativação com LicenseProvider
44
-
45
-
46
-
47
- Para que os componentes funcionem corretamente, é necessário envolver sua aplicação com o `LicenseProvider` e fornecer a senha de ativação:
48
-
49
-
50
-
51
- ```tsx
52
-
53
- import { LicenseProvider } from '@marcos-vinicius-rodrigues/components'
54
-
55
-
56
-
57
- function App() {
58
-
59
- return (
60
-
61
- <LicenseProvider licenseKey="SUA_SENHA_AQUI">
62
-
63
- {/* seus componentes aqui */}
64
-
65
- </LicenseProvider>
66
-
67
- )
68
-
69
- }
70
-
71
- ```
72
-
73
-
74
-
75
- ---
76
-
77
-
78
-
79
- ## 🧩 Componentes Disponíveis
80
-
81
-
82
-
83
- A biblioteca disponibiliza os seguintes componentes:
84
-
85
-
86
-
87
- ### Campos de Formulário
88
-
89
-
90
-
91
- - `CheckBox`
92
-
93
- - `Input`
94
-
95
- - `Label`
96
-
97
- - `Radio`
98
-
99
- - `Select`
100
-
101
- - `Switch`
102
-
103
- - `TextArea`
104
-
105
- - `ValidateField` (validação de campos)
106
-
107
-
108
-
109
- Todos os componentes são escritos em **TypeScript**, com suporte completo ao **React Hook Form**, mas funcionam de forma independente também.
110
-
111
-
112
-
113
- ---
114
-
115
-
116
-
117
- ## 🛠️ Exemplo de Uso
118
-
119
-
120
-
121
- ```tsx
122
-
123
- import { Input, Label, ValidateField } from '@marcos-vinicius-rodrigues/components'
124
-
125
-
126
-
127
- function MyForm() {
128
-
129
- return (
130
-
131
- <form>
132
-
133
- <Label htmlFor="name">Nome</Label>
134
-
135
- <Input id="name" placeholder="Digite seu nome" />
136
-
137
- <ValidateField name="name" message="Campo obrigatório" />
138
-
139
- </form>
140
-
141
- )
142
-
143
- }
144
-
145
- ```
146
-
147
-
148
-
149
- ---
150
-
151
-
152
-
153
- ## 💡 Requisitos
154
-
155
-
156
-
157
- - React 18+
158
-
159
- - TypeScript
160
-
161
- - Tailwind CSS (opcional, mas recomendado para estilos nativos)
162
-
163
-
164
-
165
- ---
166
-
167
-
168
-
169
- ## 📞 Suporte
170
-
171
-
172
-
173
- Entre em contato com [Marcos Vinicius Rodrigues](mailto:marcos.vinicius.engsof@gmail.com) para:
174
-
175
-
176
-
177
- - Solicitar a senha de ativação
178
-
179
- - Reportar bugs ou solicitar novos componentes
180
-
181
- - Contribuir com melhorias
182
-
183
-
184
-
185
- ---
186
-
187
-
188
-
189
- ## 🚀 Futuras melhorias
190
-
191
-
192
-
193
- - 📌 Mais componentes visuais (modais, toasts, tooltips, etc.)
194
-
195
- - 🌙 Suporte nativo a temas (light/dark)
196
-
197
- - 🧪 Testes automatizados
198
-
199
- - 📚 Documentação completa com Storybook
200
-
201
-
202
- ---
203
-
204
-
205
-
206
- ## 📝 Licença
207
-
208
-
209
-
210
- Uso restrito mediante autorização.
211
-
1
+ # @marcos-vinicius-rodrigues/components
2
+
3
+
4
+
5
+ Esta é uma biblioteca de **componentes reutilizáveis** feita para aplicações em **React** e **Next.js**, com foco em produtividade, padronização visual e integração com formulários modernos.
6
+
7
+
8
+
9
+ > ⚠️ Para utilizar esta biblioteca, é necessário ativar a licença via `LicenseProvider` com uma senha de acesso.
10
+
11
+ > Entre em contato com **@marcos-vinicius-rodrigues** para solicitar a sua chave de uso.
12
+
13
+
14
+
15
+ ---
16
+
17
+
18
+
19
+ ## 📦 Instalação
20
+
21
+
22
+
23
+ Você pode instalar via **npm** ou **yarn**:
24
+
25
+
26
+
27
+ ```bash
28
+
29
+ npm install @marcos-vinicius-rodrigues/components
30
+
31
+ # ou
32
+
33
+ yarn add @marcos-vinicius-rodrigues/components
34
+
35
+ ```
36
+
37
+
38
+
39
+ ---
40
+
41
+
42
+
43
+ ## 🔐 Ativação com LicenseProvider
44
+
45
+
46
+
47
+ Para que os componentes funcionem corretamente, é necessário envolver sua aplicação com o `LicenseProvider` e fornecer a senha de ativação:
48
+
49
+
50
+
51
+ ```tsx
52
+
53
+ import { LicenseProvider } from '@marcos-vinicius-rodrigues/components'
54
+
55
+
56
+
57
+ function App() {
58
+
59
+ return (
60
+
61
+ <LicenseProvider licenseKey="SUA_SENHA_AQUI">
62
+
63
+ {/* seus componentes aqui */}
64
+
65
+ </LicenseProvider>
66
+
67
+ )
68
+
69
+ }
70
+
71
+ ```
72
+
73
+
74
+
75
+ ---
76
+
77
+
78
+
79
+ ## 🧩 Componentes Disponíveis
80
+
81
+
82
+
83
+ A biblioteca disponibiliza os seguintes componentes:
84
+
85
+
86
+
87
+ ### Campos de Formulário
88
+
89
+
90
+
91
+ - `CheckBox`
92
+
93
+ - `Input`
94
+
95
+ - `Label`
96
+
97
+ - `Radio`
98
+
99
+ - `Select`
100
+
101
+ - `Switch`
102
+
103
+ - `TextArea`
104
+
105
+ - `ValidateField` (validação de campos)
106
+
107
+
108
+
109
+ Todos os componentes são escritos em **TypeScript**, com suporte completo ao **React Hook Form**, mas funcionam de forma independente também.
110
+
111
+
112
+
113
+ ---
114
+
115
+
116
+
117
+ ## 🛠️ Exemplo de Uso
118
+
119
+
120
+
121
+ ```tsx
122
+
123
+ import { Input, Label, ValidateField } from '@marcos-vinicius-rodrigues/components'
124
+
125
+
126
+
127
+ function MyForm() {
128
+
129
+ return (
130
+
131
+ <form>
132
+
133
+ <Label htmlFor="name">Nome</Label>
134
+
135
+ <Input id="name" placeholder="Digite seu nome" />
136
+
137
+ <ValidateField name="name" message="Campo obrigatório" />
138
+
139
+ </form>
140
+
141
+ )
142
+
143
+ }
144
+
145
+ ```
146
+
147
+
148
+
149
+ ---
150
+
151
+
152
+
153
+ ## 💡 Requisitos
154
+
155
+
156
+
157
+ - React 18+
158
+
159
+ - TypeScript
160
+
161
+ - Tailwind CSS (opcional, mas recomendado para estilos nativos)
162
+
163
+
164
+
165
+ ---
166
+
167
+
168
+
169
+ ## 📞 Suporte
170
+
171
+
172
+
173
+ Entre em contato com [Marcos Vinicius Rodrigues](mailto:marcos.vinicius.engsof@gmail.com) para:
174
+
175
+
176
+
177
+ - Solicitar a senha de ativação
178
+
179
+ - Reportar bugs ou solicitar novos componentes
180
+
181
+ - Contribuir com melhorias
182
+
183
+
184
+
185
+ ---
186
+
187
+
188
+
189
+ ## 🚀 Futuras melhorias
190
+
191
+
192
+
193
+ - 📌 Mais componentes visuais (modais, toasts, tooltips, etc.)
194
+
195
+ - 🌙 Suporte nativo a temas (light/dark)
196
+
197
+ - 🧪 Testes automatizados
198
+
199
+ - 📚 Documentação completa com Storybook
200
+
201
+
202
+ ---
203
+
204
+
205
+
206
+ ## 📝 Licença
207
+
208
+
209
+
210
+ Uso restrito mediante autorização.
211
+
212
212
  Todos os direitos reservados © [Marcos Vinicius Rodrigues](mailto:marcos.vinicius.engsof@gmail.com)
package/dist/page.d.mts CHANGED
@@ -16,7 +16,6 @@ interface ButtonProps extends React__default.ButtonHTMLAttributes<HTMLButtonElem
16
16
  loading?: boolean;
17
17
  loadingContent?: React__default.ReactNode;
18
18
  }
19
- declare const Button: React__default.ForwardRefExoticComponent<ButtonProps & React__default.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
20
19
  declare const ButtonPrimitive: (props: ButtonProps & React__default.RefAttributes<HTMLButtonElement | HTMLAnchorElement>) => react_jsx_runtime.JSX.Element;
21
20
 
22
21
  interface CardProps extends React__default.HTMLAttributes<HTMLDivElement> {
@@ -262,6 +261,7 @@ declare const SelectPrimitive: typeof Select;
262
261
  interface SwitchProps extends Omit<React__default.InputHTMLAttributes<HTMLInputElement>, "type"> {
263
262
  label?: string;
264
263
  description?: string;
264
+ checked?: boolean;
265
265
  className?: string;
266
266
  overrideClassName?: boolean;
267
267
  error?: string;
@@ -287,4 +287,4 @@ interface ValidateFieldProps {
287
287
  }
288
288
  declare const ValidateFieldPrimitive: (props: ValidateFieldProps) => react_jsx_runtime.JSX.Element;
289
289
 
290
- export { Button, ButtonPrimitive, CardContentPrimitive, CardContentProps, CardDescriptionPrimitive, CardDescriptionProps, CardFooterPrimitive, CardFooterProps, CardHeaderPrimitive, CardHeaderProps, CardPrimitive, CardProps, CardTitlePrimitive, CardTitleProps, CheckBoxGroupPrimitive, CheckBoxPrimitive, CheckBoxProps, ComboBoxPrimitive, HelperFieldPrimitive, HelperFieldProps, InputPrimitive, InputProps, LabelPrimitive, LabelProps, LicenseProvider, OtpInputPrimitive, OtpInputProps, RadioGroupPrimitive, RadioPrimitive, RadioProps, SelectPrimitive, SelectProps, SwitchPrimitive, SwitchProps, TextareaPrimitive, TextareaProps, ValidateFieldPrimitive, ValidateFieldProps };
290
+ export { ButtonPrimitive, ButtonProps, CardContentPrimitive, CardContentProps, CardDescriptionPrimitive, CardDescriptionProps, CardFooterPrimitive, CardFooterProps, CardHeaderPrimitive, CardHeaderProps, CardPrimitive, CardProps, CardTitlePrimitive, CardTitleProps, CheckBoxGroupPrimitive, CheckBoxPrimitive, CheckBoxProps, ComboBoxPrimitive, HelperFieldPrimitive, HelperFieldProps, InputPrimitive, InputProps, LabelPrimitive, LabelProps, LicenseProvider, OtpInputPrimitive, OtpInputProps, RadioGroupPrimitive, RadioPrimitive, RadioProps, SelectPrimitive, SelectProps, SwitchPrimitive, SwitchProps, TextareaPrimitive, TextareaProps, ValidateFieldPrimitive, ValidateFieldProps };
package/dist/page.d.ts CHANGED
@@ -16,7 +16,6 @@ interface ButtonProps extends React__default.ButtonHTMLAttributes<HTMLButtonElem
16
16
  loading?: boolean;
17
17
  loadingContent?: React__default.ReactNode;
18
18
  }
19
- declare const Button: React__default.ForwardRefExoticComponent<ButtonProps & React__default.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
20
19
  declare const ButtonPrimitive: (props: ButtonProps & React__default.RefAttributes<HTMLButtonElement | HTMLAnchorElement>) => react_jsx_runtime.JSX.Element;
21
20
 
22
21
  interface CardProps extends React__default.HTMLAttributes<HTMLDivElement> {
@@ -262,6 +261,7 @@ declare const SelectPrimitive: typeof Select;
262
261
  interface SwitchProps extends Omit<React__default.InputHTMLAttributes<HTMLInputElement>, "type"> {
263
262
  label?: string;
264
263
  description?: string;
264
+ checked?: boolean;
265
265
  className?: string;
266
266
  overrideClassName?: boolean;
267
267
  error?: string;
@@ -287,4 +287,4 @@ interface ValidateFieldProps {
287
287
  }
288
288
  declare const ValidateFieldPrimitive: (props: ValidateFieldProps) => react_jsx_runtime.JSX.Element;
289
289
 
290
- export { Button, ButtonPrimitive, CardContentPrimitive, CardContentProps, CardDescriptionPrimitive, CardDescriptionProps, CardFooterPrimitive, CardFooterProps, CardHeaderPrimitive, CardHeaderProps, CardPrimitive, CardProps, CardTitlePrimitive, CardTitleProps, CheckBoxGroupPrimitive, CheckBoxPrimitive, CheckBoxProps, ComboBoxPrimitive, HelperFieldPrimitive, HelperFieldProps, InputPrimitive, InputProps, LabelPrimitive, LabelProps, LicenseProvider, OtpInputPrimitive, OtpInputProps, RadioGroupPrimitive, RadioPrimitive, RadioProps, SelectPrimitive, SelectProps, SwitchPrimitive, SwitchProps, TextareaPrimitive, TextareaProps, ValidateFieldPrimitive, ValidateFieldProps };
290
+ export { ButtonPrimitive, ButtonProps, CardContentPrimitive, CardContentProps, CardDescriptionPrimitive, CardDescriptionProps, CardFooterPrimitive, CardFooterProps, CardHeaderPrimitive, CardHeaderProps, CardPrimitive, CardProps, CardTitlePrimitive, CardTitleProps, CheckBoxGroupPrimitive, CheckBoxPrimitive, CheckBoxProps, ComboBoxPrimitive, HelperFieldPrimitive, HelperFieldProps, InputPrimitive, InputProps, LabelPrimitive, LabelProps, LicenseProvider, OtpInputPrimitive, OtpInputProps, RadioGroupPrimitive, RadioPrimitive, RadioProps, SelectPrimitive, SelectProps, SwitchPrimitive, SwitchProps, TextareaPrimitive, TextareaProps, ValidateFieldPrimitive, ValidateFieldProps };
package/dist/page.js CHANGED
@@ -12,7 +12,6 @@ var Qt__default = /*#__PURE__*/_interopDefault(Qt);
12
12
 
13
13
  var be=Rt.createContext(void 0),Ct=({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"})]})}),yt=({children:e,licenseKey:t})=>{let[r,n]=Rt.useState(!1),[o,s]=Rt.useState(null),[a,i]=Rt.useState(!0),l=p=>{if(s(null),!p)throw new Error("\u{1F512} Chave de licen\xE7a \xE9 obrigat\xF3ria");let f="chave-secreta-123";if(p!==f)throw new Error("\u274C Chave de licen\xE7a inv\xE1lida");n(!0);};return Rt.useEffect(()=>{if(t){i(!0);try{l(t);}catch(p){s(p instanceof Error?p.message:"Erro desconhecido na valida\xE7\xE3o da licen\xE7a");}finally{i(!1);}}else s("\u{1F512} Licen\xE7a n\xE3o informada"),i(!1);},[t]),a?null:jsxRuntime.jsx(be.Provider,{value:{isLicenseValid:r,validateLicense:l,licenseError:o},children:r?e:jsxRuntime.jsx(Ct,{message:o||"Licen\xE7a inv\xE1lida"})})},ve=()=>{let e=Rt.useContext(be);if(!e)throw new Error("useLicense deve ser usado dentro de um LicenseProvider");return e};var he=({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 v=e=>t=>{let{isLicenseValid:r}=ve();return r?jsxRuntime.jsx(e,{...t}):jsxRuntime.jsx(he,{})};function u(...e){return tailwindMerge.twMerge(Qt.clsx(e))}var Te=Rt__default.default.forwardRef(({className:e,overrideClassName:t,variant:r="primary",size:n="md",href:o,children:s,loading:a=!1,loadingContent:i,...l},p)=>{let f="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",h={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"},P={xs:"h-7 px-2 text-xs min-w-16",sm:"h-9 px-3 text-sm min-w-20",md:"h-10 px-4 py-2 text-base min-w-24",lg:"h-11 px-6 text-lg min-w-28",xl:"h-12 px-8 text-xl min-w-32"},m=t?e:u(f,h[r],P[n],e);return o?jsxRuntime.jsx("a",{href:o,className:m,ref:p,children:a&&i?i:s}):jsxRuntime.jsx("button",{className:m,ref:p,...l,children:a&&i?i:s})});Te.displayName="Button";var Wr=v(Te);var Pe=Rt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx("div",{ref:o,className:t?e:u("rounded-lg border bg-card text-card-foreground shadow-sm",e),...n,children:r}));Pe.displayName="Card";var we=Rt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx("div",{ref:o,className:t?e:u("flex flex-col space-y-1.5 p-6",e),...n,children:r}));we.displayName="CardHeader";var Re=Rt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx("h3",{ref:o,className:t?e:u("text-2xl font-semibold leading-none tracking-tight",e),...n,children:r}));Re.displayName="CardTitle";var Le=Rt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx("p",{ref:o,className:t?e:u("text-sm text-muted-foreground",e),...n,children:r}));Le.displayName="CardDescription";var ke=Rt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx("div",{ref:o,className:t?e:u("p-6 pt-0",e),...n,children:r}));ke.displayName="CardContent";var Ee=Rt.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx("div",{ref:o,className:t?e:u("flex items-center p-6 pt-0",e),...n,children:r}));Ee.displayName="CardFooter";var Qr=v(Pe),en=v(we),tn=v(Re),rn=v(Le),nn=v(ke),on=v(Ee);var Lt=({children:e,className:t,overrideClassName:r})=>{if(e)return jsxRuntime.jsx("p",{className:r?t:u("text-sm text-muted-foreground",t),children:e})},V=v(Lt);var Et=({children:e,required:t,className:r,overrideClassName:n=!1,...o})=>jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("label",{...o,className:n?r:u("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),children:e}),t&&jsxRuntime.jsx("span",{className:"text-red-600",children:"*"})]}),R=v(Et);var It=({children:e,className:t,overrideClassName:r})=>{if(e)return jsxRuntime.jsx("p",{className:r?t:u("text-sm text-red-600 dark:text-red-400",t),children:e})},M=v(It);var Ve=Rt.forwardRef(({label:e,required:t,option:r,orientation:n="left",className:o,overrideClassName:s=!1,helperText:a,error:i,...l},p)=>{let f=Rt.useId(),h=u("h-4 w-4 rounded border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",i&&"border-destructive",o);return jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(R,{required:t,children:e}),jsxRuntime.jsxs("div",{className:`flex ${n=="left"?"flex-row":"flex-row-reverse"} w-fit gap-2`,children:[jsxRuntime.jsx("input",{id:f,type:"checkbox",className:s?o:h,ref:p,...l}),r&&jsxRuntime.jsx(R,{htmlFor:f,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r})]}),i&&jsxRuntime.jsx(M,{children:i}),!i&&a&&jsxRuntime.jsx(V,{children:a})]})});Ve.displayName="CheckBox";var Ln=v(Ve);function At(e,t){let{typeSet:r="field",multiCheck:n=!1,value:o,onChange:s,labelKey:a,valueKey:i,options:l,alignment:p="vertical",className:f,overrideClassName:h=!1,helperText:P,error:m,label:w,name:L,required:b,...C}=e,E=Rt.useId(),y=Rt.useMemo(()=>new Map(l.map(g=>[String(g[i]),g])),[l,i]),I=Rt.useMemo(()=>o==null?[]:r==="field"?n?o.map(g=>String(g)):[String(o)]:n?o.map(g=>String(g[i])):[String(o[i])],[o,r,n,i]),S=(g,T)=>{if(!s)return;let c;if(r==="field")if(n)c=g.map(x=>{let k=y.get(x);return k?k[i]:x});else {let d=g[0];if(!d)c=void 0;else {let x=y.get(d);c=x?x[i]:d;}}else n?c=g.map(x=>y.get(x)).filter(x=>x!==void 0):c=y.get(g[0]??"")??void 0;s({target:{name:L,value:c,type:"checkboxgroup",checked:T}});},F=g=>{let T;n?T=I.includes(g)?I.filter(c=>c!==g):[...I,g]:T=I[0]===g?[]:[g],S(T,T.includes(g));},N=p==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",H=u("h-4 w-4 rounded border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",m&&"border-destructive");return jsxRuntime.jsxs("div",{className:u("flex flex-col gap-3",f),children:[w&&jsxRuntime.jsx(R,{required:b,children:w}),jsxRuntime.jsx("div",{className:N,children:l.map((g,T)=>{let c=String(g[i]),d=I.includes(c),x=`${E}-${c}-${T}`;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{...C,id:x,ref:t,type:"checkbox",name:L,checked:d,onChange:()=>F(c),className:h?f:H}),jsxRuntime.jsx(R,{htmlFor:x,children:String(g[a])})]},x)})}),!!m&&jsxRuntime.jsx(M,{children:String(m)}),!m&&P&&jsxRuntime.jsx(V,{children:P})]})}function $t(){let e=Rt.forwardRef(At);return e.displayName="CheckBoxGroup",e}var Dt=$t(),$n=v(Dt);var Bt=({...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"})}),ee=Bt;var Ot=(e,t)=>{Rt.useEffect(()=>{let r=n=>{e.current&&!e.current.contains(n.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},Se=Ot;function ae({options:e,labelKey:t,valueKey:r,multiple:n,onChange:o,setSearchTerm:s,typeSet:a,name:i}){let[l,p]=Rt.useState([]),f=Rt.useMemo(()=>new Map(e.map(b=>[String(b[r]),b])),[e,r]),h=Rt.useCallback(()=>l.map(b=>f.get(b)).filter(b=>!!b),[l,f]),P=Rt.useCallback(b=>{if(!o)return;let C;if(a==="field"?n?C=b:C=b[0]??void 0:n?C=b.map(y=>f.get(y)).filter(y=>y!==void 0):C=f.get(b[0]??"")??void 0,s&&!n){let E=f.get(b[0]??"");E&&s(String(E[t]));}o({target:{name:i,value:C,type:"combobox"}});},[n,o,f,i,a,s,t]),m=Rt.useCallback(b=>{let C=String(b[r]),E=n?l.includes(C)?l.filter(y=>y!==C):[...l,C]:[C];p(E),P(E);},[n,l,P,r]),w=Rt.useCallback(b=>{let C=l.filter(E=>E!==b);p(C),P(C);},[l,P]),L=Rt.useCallback(()=>{p([]),s?.("");let b;a==="field"?b=n?[]:"":b=n?[]:void 0,o?.({target:{name:i,value:b,type:"combobox"}});},[n,o,i,s,a]);return {selectedValues:l,handleSelect:m,handleRemove:w,handleClear:L,getSelectedOptions:h}}function ie(e,t,r){return Rt.useMemo(()=>r?e.filter(o=>String(o[t]).toLowerCase().includes(r.toLowerCase())):e,[e,r,t])}var $e=({isOpen:e,setIsOpen:t,multiple:r,searchTerm:n,setSearchTerm:o,selectedValues:s,filteredOptions:a,highlightedIndex:i,setHighlightedIndex:l,handleSelect:p,handleRemove:f})=>{let h=Rt.useCallback(m=>{if(a.length===0){l(-1);return}l(w=>w<0?m>0?0:a.length-1:(w+m+a.length)%a.length);},[a,l]);return Rt.useCallback(m=>{if(!e){if(m.key==="Enter"||m.key==="ArrowDown"){t(!0),l(0),m.preventDefault();return}r&&m.key==="Backspace"&&n===""&&s.length>0&&(m.preventDefault(),f(s[s.length-1]));return}switch(m.key){case"ArrowDown":m.preventDefault(),h(1);break;case"ArrowUp":m.preventDefault(),h(-1);break;case"Enter":m.preventDefault();let w=i>=0?i:0,L=a[w];L&&p(L),r&&o&&o(""),r||(t(!1),l(-1));break;case"Escape":m.preventDefault(),t(!1),l(-1),r||o("");break;case"Tab":t(!1),l(-1);break;case"Home":m.preventDefault(),a.length>0&&l(0);break;case"End":m.preventDefault(),a.length>0&&l(a.length-1);break;case"Backspace":r&&n===""&&s.length>0&&(m.preventDefault(),f(s[s.length-1]));break}},[e,r,n,s,a,i,t,o,l,p,f,h])};function De({option:e,labelKey:t,valueKey:r,onRemove:n}){let o=String(e[t]),s=String(e[r]);return jsxRuntime.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded",children:[o,jsxRuntime.jsx("button",{type:"button",onMouseDown:a=>a.preventDefault(),onClick:()=>n(s),className:"hover:bg-blue-200 dark:hover:bg-blue-800 rounded-full p-0.5 transition-colors","aria-label":`Remover ${o}`,children:"\u2715"})]},s)}function Zt(e,t){let{label:r,required:n=!1,name:o,placeholder:s="Buscar...",labelKey:a,valueKey:i,options:l,value:p,onChange:f,mode:h="single",typeSet:P="field",disabled:m=!1,ClearEnabled:w=!0,helperText:L,error:b=!1,className:C="",...E}=e,y=h==="multiple",[I,S]=Rt.useState(!1),[F,N]=Rt.useState(""),H=Rt.useRef(null),g=Rt.useRef(null),T=Rt.useRef(null);Rt.useImperativeHandle(t,()=>T.current),Se(g,()=>S(!1));let c=ie(l,a,F),[d,x]=Rt.useState(-1),{selectedValues:k,handleSelect:W,handleRemove:ue,handleClear:pt,getSelectedOptions:fe}=ae({options:l,labelKey:a,valueKey:i,value:p,multiple:y,onChange:f,typeSet:P,name:o,setSearchTerm:N}),ut=$e({isOpen:I,setIsOpen:S,multiple:y,searchTerm:F,setSearchTerm:N,selectedValues:k,filteredOptions:c,highlightedIndex:d,setHighlightedIndex:x,handleSelect:W,handleRemove:ue}),J=Rt.useId(),ft="w-full bg-transparent outline-none placeholder:text-gray-500 dark:placeholder:text-gray-400 text-gray-900 dark:text-gray-100",gt=u("relative w-full min-h-[40px] px-3 py-2 border rounded-md bg-white dark:bg-gray-800",b?"border-red-500":"border-gray-300 dark:border-gray-600",m?"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 ${C}`,children:[r&&jsxRuntime.jsx(R,{htmlFor:J,required:n,children:r}),jsxRuntime.jsxs("div",{ref:H,className:"relative",children:[jsxRuntime.jsxs("div",{className:gt,children:[y&&fe().length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:fe().map((A,D)=>jsxRuntime.jsx(De,{option:A,labelKey:a,valueKey:i,onRemove:ue},String(A[i]??D)))}),jsxRuntime.jsx("input",{ref:T,...E,name:o,type:"text",placeholder:s,value:F,onChange:A=>{let D=A.target.value;N(D),!I&&D.trim()!==""&&S(!0);},onKeyDown:ut,onMouseDown:A=>{document.activeElement===T.current&&(A.preventDefault(),S(D=>{let X=!D;return X&&x(0),X}));},onFocus:()=>{S(!0),x(0);},disabled:m,className:ft,role:"combobox","aria-expanded":I,"aria-controls":J,"aria-activedescendant":d>=0?`${J}-opt-${d}`:void 0}),w&&!!k.length&&jsxRuntime.jsx("button",{type:"button",onMouseDown:A=>A.preventDefault(),onClick:pt,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(ee,{width:12,height:12})})]}),I&&jsxRuntime.jsx("div",{ref:g,id:J,className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto",role:"listbox","aria-multiselectable":y||void 0,children:c.length===0?jsxRuntime.jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"Nenhum resultado encontrado"}):c.map((A,D)=>{let X=String(A[i]),re=k.includes(X),ne=D===d;return jsxRuntime.jsx("button",{id:`${J}-opt-${D}`,"data-index":D,role:"option","aria-selected":re,type:"button",onMouseDown:bt=>bt.preventDefault(),onClick:()=>W(A),className:u("w-full px-3 py-2 text-left text-sm transition-colors",ne&&"bg-blue-100 dark:bg-blue-800 text-blue-900 dark:text-white",!ne&&re&&"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300",!re&&!ne&&"text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),children:jsxRuntime.jsx("span",{children:String(A[a])})},X)})})]}),b&&jsxRuntime.jsx(M,{children:b}),!b&&L&&jsxRuntime.jsx(V,{children:L})]})}function jt(){let e=Rt.forwardRef(Zt);return e.displayName="ComboBox",e}var Yt=jt(),uo=v(Yt);var er=({children:e,before:t,after:r,className:n})=>{let s=Qt__default.default("flex justify-center items-center",{"rounded-l-lg":t,"rounded-r-lg":r},n);return jsxRuntime.jsx("div",{className:s,children:jsxRuntime.jsx("span",{children:e})})},de=er;var tr=({children:e})=>jsxRuntime.jsx("div",{className:"absolute px-2",children:jsxRuntime.jsx("span",{children:e})}),Oe=tr;var rr=({children:e})=>jsxRuntime.jsx("div",{className:"absolute right-0 px-2",children:jsxRuntime.jsx("span",{children:e})}),Ue=rr;function qe(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),n=t.slice(-2),a=`${(r.replace(/^0+/,"")||"0").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1.")},${n}`;return e.currentTarget.value=a,e}function We(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 Je(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 Xe(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 ze(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 Ze(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 je(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 nr=({e,mask:t})=>{switch(t){case"money":return _e(e);case"mobile":return Je(e);case"phone":return Xe(e);case"cpfCnpj":return ze(e);case"cpf":return We(e);case"rg":return Ze(e);case"cnpj":return je(e);case"cep":return qe(e);default:return e}},Ye=nr;var ir=({mask:e,initialValue:t=""})=>{let[r,n]=Rt.useState(t);Rt.useEffect(()=>{t!==r&&n(t);},[t]);let o=Rt.useCallback(a=>{let l=Ye({e:a,mask:e})?.currentTarget?.value??a.currentTarget.value;n(l);},[e]),s=Rt.useCallback(()=>n(""),[]);return {value:r,setValue:n,handleChange:o,handleClear:s}},et=ir;var tt=Rt.forwardRef(({label:e,required:t=!1,mask:r,name:n,prefix:o,suffix:s,addonBefore:a,addonBeforeClassName:i,addonAfter:l,addonAfterClassName:p,ClearEnabled:f=!0,className:h,overrideClassName:P=!1,error:m,helperText:w,value:L=void 0,onChange:b,...C},E)=>{let y=Rt.useId(),{handleChange:I,handleClear:S,setValue:F}=et({mask:r,initialValue:L}),N=u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",m&&"border-destructive focus-visible:ring-destructive",!o&&!s&&"px-3",o&&!s&&"pl-10 pr-3",s&&!o&&"pl-3 pr-10",o&&s&&"pl-10 pr-10",a&&"rounded-l-none border-l-0",l&&"rounded-r-none border-r-0",h),H=T=>{I(T),b?.(T);},g=()=>{S(),F(""),b?.({target:{name:n||"",value:""}});};return jsxRuntime.jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsxRuntime.jsx(R,{htmlFor:y,required:t,children:e}),jsxRuntime.jsxs("div",{className:"relative flex",children:[a&&jsxRuntime.jsx(de,{before:!0,className:i,children:a}),jsxRuntime.jsxs("div",{className:"relative flex items-center w-full",children:[o&&jsxRuntime.jsx(Oe,{children:o}),jsxRuntime.jsx("input",{id:y,ref:E,name:n,onChange:H,className:P?h:N,...C}),f&&L&&jsxRuntime.jsx(ee,{onClick:g,width:12,height:12,className:u("absolute right-2 cursor-pointer",s&&"right-8")}),s&&jsxRuntime.jsx(Ue,{children:s})]}),l&&jsxRuntime.jsx(de,{after:!0,className:p,children:l})]}),m&&jsxRuntime.jsx(M,{children:m}),!m&&w&&jsxRuntime.jsx(V,{children:w})]})});tt.displayName="Input";var Go=v(tt);var nt=Rt.forwardRef(({length:e=6,groupBy:t,value:r,name:n,label:o,required:s=!1,helperText:a,error:i,onChange:l,onBlur:p,className:f,charType:h="numeric",customPattern:P,caseMode:m="none",...w},L)=>{let b=Rt.useId(),C=Rt.useRef([]),E=c=>{switch(m){case"upper":return c.toUpperCase();case"lower":case"visual-upper":return c.toLowerCase();case"visual-lower":return c.toUpperCase();default:return c}},y=c=>{if(!c)return "";let d=c.slice(0,1);switch(d=E(d),h){case"numeric":return /\d/.test(d)?d:"";case"alpha":return /[A-Za-z]/.test(d)?d:"";case"alphanumeric":return /[A-Za-z0-9]/.test(d)?d:"";case"custom":return P?.test(d)?d:"";default:return d}},I=()=>(r!=null?String(r):"").split("").map(y).slice(0,e),S=I().concat(Array(e).fill(" ")).slice(0,e),F=c=>{let d=c.split("").map(y).join("").slice(0,e),x=d===""?void 0:typeof r=="number"?Number(d):d;l?.({target:{name:n,value:x}});},N=(c,d)=>{let x=y(d),k=I();if(x===""){k[c]="",F(k.join(""));return}if(d.length>1){let W=d.split("").map(y).join("").slice(0,e);F(W),C.current[Math.min(W.length-1,e-1)]?.focus();return}x&&(k[c]=x,F(k.join("")),c<e-1&&C.current[c+1]?.focus());},H=c=>{let d=I();!d[c]&&c>0?d[c-1]="":d[c]="",F(d.join("")),c>0&&C.current[c-1]?.focus();},g=c=>{c.preventDefault();let x=c.clipboardData.getData("text").split("").map(y).join("").slice(0,e);x&&(F(x),C.current[Math.min(x.length-1,e-1)]?.focus());},T=c=>{switch(m){case"upper":case"visual-upper":return c.toUpperCase();case"lower":case"visual-lower":return c.toLowerCase();default:return c}};return jsxRuntime.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[o&&jsxRuntime.jsx(R,{htmlFor:b,required:s,children:o}),jsxRuntime.jsx("div",{className:u("flex gap-3 items-center",i&&"text-red-500",f),...w,children:S.map((c,d)=>{let x=t&&d>0&&d%t===0;return jsxRuntime.jsxs(Rt__default.default.Fragment,{children:[x&&jsxRuntime.jsx("span",{className:"flex items-center justify-center text-xl font-bold select-none",children:"-"}),jsxRuntime.jsx("input",{id:b,type:"text",maxLength:1,inputMode:h==="numeric"?"numeric":"text",value:T(c).trim(),ref:k=>{C.current[d]=k,d===0&&L&&(typeof L=="function"?L(k):typeof L=="object"&&(L.current=k));},onPaste:g,onChange:k=>N(d,k.target.value),onKeyDown:k=>k.key==="Backspace"&&H(d),onBlur:p,className:u("h-14 w-12 text-center text-2xl rounded-md border border-input bg-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",i&&"border-red-500")})]},d)})}),i&&jsxRuntime.jsx(M,{children:i}),!i&&a&&jsxRuntime.jsx(V,{children:a})]})});nt.displayName="OtpInput";var zo=v(nt);var at=Rt.forwardRef(({label:e,required:t,option:r,className:n,overrideClassName:o,helperText:s,error:a,...i},l)=>{let p=Rt.useId(),f=u("h-4 w-4 border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a&&"border-destructive",n);return jsxRuntime.jsxs("div",{className:"space-y-3",children:[e&&jsxRuntime.jsx(R,{required:t,children:e}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{id:p,type:"radio",className:o?n:f,ref:l,...i}),r&&jsxRuntime.jsx(R,{htmlFor:p,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r})]}),a&&jsxRuntime.jsx(M,{children:a}),!a&&s&&jsxRuntime.jsx(V,{children:s})]})});at.displayName="Radio";var oa=v(at);function vr(e,t){let{label:r,required:n,name:o,labelKey:s,valueKey:a,options:i,alignment:l="vertical",className:p,overrideClassName:f=!1,helperText:h,error:P,typeSet:m="field",value:w,onChange:L,...b}=e,C=Rt.useId(),E=Rt.useMemo(()=>new Map(i.map(N=>[String(N[a]),N])),[i,a]),y=Rt.useMemo(()=>w==null?"":String(m==="field"?w:w[a]),[w,m,a]),I=N=>{if(!L)return;let H;if(m==="field"){let g=E.get(N);if(g)H=g[a];else {let T=Number(N);H=Number.isNaN(T)?N:T;}}else H=E.get(N)??void 0;L({target:{name:o,value:H,type:"radiogroup",checked:!0}});},S=l==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",F=u("h-4 w-4 rounded-full border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",P&&"border-destructive");return jsxRuntime.jsxs("div",{className:u("flex flex-col gap-3",p),children:[r&&jsxRuntime.jsx(R,{required:n,children:r}),jsxRuntime.jsx("div",{className:S,children:i.map((N,H)=>{let g=String(N[a]),T=`${C}-${g}-${H}`;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{...b,id:T,ref:t,name:o,type:"radio",checked:y===g,onChange:()=>I(g),className:f?p:F}),jsxRuntime.jsx(R,{htmlFor:T,children:String(N[s])})]},T)})}),P&&jsxRuntime.jsx(M,{children:String(P)}),!P&&h&&jsxRuntime.jsx(V,{children:h})]})}function xr(){let e=Rt.forwardRef(vr);return e.displayName="RadioGroup",e}var hr=xr(),ga=v(hr);function Tr({label:e,required:t=!1,options:r,labelKey:n,valueKey:o,placeholder:s,error:a,helperText:i,className:l,...p},f){let h=Rt.useId(),P=u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",l);return jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(R,{htmlFor:h,required:t,children:e}),jsxRuntime.jsxs("select",{id:h,ref:f,className:P,...p,children:[s&&jsxRuntime.jsx("option",{value:"",disabled:!0,children:s}),r.map((m,w)=>jsxRuntime.jsx("option",{value:String(m[o]),children:String(m[n])},w))]}),a&&jsxRuntime.jsx(M,{children:a}),!a&&i&&jsxRuntime.jsx(V,{children:i})]})}function Pr(){let e=Rt.forwardRef(Tr);return e.displayName="Select",e}var wr=Pr(),La=v(wr);var dt=Rt.forwardRef(({label:e,description:t,checked:r=!1,className:n,overrideClassName:o,error:s,name:a,...i},l)=>{let p=Rt.useId();return jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:p,name:a,checked:r,className:"peer sr-only",ref:l,...i}),jsxRuntime.jsx("label",{htmlFor:p,className:u("relative flex items-center h-6 w-11 cursor-pointer rounded-full bg-input transition-colors duration-200","peer-checked:bg-primary peer-focus:ring-2 peer-focus:ring-ring peer-focus:ring-offset-2 peer-focus:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50",n),children:jsxRuntime.jsx("span",{className:u("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",r?"translate-x-5":"translate-x-1")})}),(e||t)&&jsxRuntime.jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[e&&jsxRuntime.jsx(R,{id:`${p}-label`,htmlFor:p,className:"text-sm font-medium leading-none",children:e}),t&&jsxRuntime.jsx(R,{id:`${p}-description`,htmlFor:p,className:"text-xs text-muted-foreground",children:t})]})]})});dt.displayName="Switch";var Ha=v(dt);var mt=Rt__default.default.forwardRef(({label:e,required:t,showCount:r,maxLength:n,className:o,overrideClassName:s=!1,error:a,helperText:i,...l},p)=>{let f=Rt.useId(),[h,P]=Rt.useState(0),m=u("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",o);return jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(R,{htmlFor:f,required:t,children:e}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("textarea",{id:f,className:s?o:m,maxLength:n,onInput:w=>P(w.currentTarget.textLength),ref:p,...l}),r&&jsxRuntime.jsxs("span",{className:"absolute bottom-2 right-3 text-xs text-muted-foreground",children:[h,n?` / ${n}`:""]})]}),a&&jsxRuntime.jsx(M,{children:a}),!a&&i&&jsxRuntime.jsx(V,{children:i})]})});mt.displayName="Textarea";var Ua=v(mt);
14
14
 
15
- exports.Button = Te;
16
15
  exports.ButtonPrimitive = Wr;
17
16
  exports.CardContentPrimitive = nn;
18
17
  exports.CardDescriptionPrimitive = rn;
package/dist/page.mjs CHANGED
@@ -5,4 +5,4 @@ import { twMerge } from 'tailwind-merge';
5
5
 
6
6
  var be=createContext(void 0),Ct=({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"})]})}),yt=({children:e,licenseKey:t})=>{let[r,n]=useState(!1),[o,s]=useState(null),[a,i]=useState(!0),l=p=>{if(s(null),!p)throw new Error("\u{1F512} Chave de licen\xE7a \xE9 obrigat\xF3ria");let f="chave-secreta-123";if(p!==f)throw new Error("\u274C Chave de licen\xE7a inv\xE1lida");n(!0);};return useEffect(()=>{if(t){i(!0);try{l(t);}catch(p){s(p instanceof Error?p.message:"Erro desconhecido na valida\xE7\xE3o da licen\xE7a");}finally{i(!1);}}else s("\u{1F512} Licen\xE7a n\xE3o informada"),i(!1);},[t]),a?null:jsx(be.Provider,{value:{isLicenseValid:r,validateLicense:l,licenseError:o},children:r?e:jsx(Ct,{message:o||"Licen\xE7a inv\xE1lida"})})},ve=()=>{let e=useContext(be);if(!e)throw new Error("useLicense deve ser usado dentro de um LicenseProvider");return e};var he=({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 v=e=>t=>{let{isLicenseValid:r}=ve();return r?jsx(e,{...t}):jsx(he,{})};function u(...e){return twMerge(clsx(e))}var Te=Rt.forwardRef(({className:e,overrideClassName:t,variant:r="primary",size:n="md",href:o,children:s,loading:a=!1,loadingContent:i,...l},p)=>{let f="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",h={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"},P={xs:"h-7 px-2 text-xs min-w-16",sm:"h-9 px-3 text-sm min-w-20",md:"h-10 px-4 py-2 text-base min-w-24",lg:"h-11 px-6 text-lg min-w-28",xl:"h-12 px-8 text-xl min-w-32"},m=t?e:u(f,h[r],P[n],e);return o?jsx("a",{href:o,className:m,ref:p,children:a&&i?i:s}):jsx("button",{className:m,ref:p,...l,children:a&&i?i:s})});Te.displayName="Button";var Wr=v(Te);var Pe=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx("div",{ref:o,className:t?e:u("rounded-lg border bg-card text-card-foreground shadow-sm",e),...n,children:r}));Pe.displayName="Card";var we=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx("div",{ref:o,className:t?e:u("flex flex-col space-y-1.5 p-6",e),...n,children:r}));we.displayName="CardHeader";var Re=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx("h3",{ref:o,className:t?e:u("text-2xl font-semibold leading-none tracking-tight",e),...n,children:r}));Re.displayName="CardTitle";var Le=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx("p",{ref:o,className:t?e:u("text-sm text-muted-foreground",e),...n,children:r}));Le.displayName="CardDescription";var ke=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx("div",{ref:o,className:t?e:u("p-6 pt-0",e),...n,children:r}));ke.displayName="CardContent";var Ee=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx("div",{ref:o,className:t?e:u("flex items-center p-6 pt-0",e),...n,children:r}));Ee.displayName="CardFooter";var Qr=v(Pe),en=v(we),tn=v(Re),rn=v(Le),nn=v(ke),on=v(Ee);var Lt=({children:e,className:t,overrideClassName:r})=>{if(e)return jsx("p",{className:r?t:u("text-sm text-muted-foreground",t),children:e})},V=v(Lt);var Et=({children:e,required:t,className:r,overrideClassName:n=!1,...o})=>jsxs("div",{className:"flex items-center gap-1",children:[jsx("label",{...o,className:n?r:u("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),children:e}),t&&jsx("span",{className:"text-red-600",children:"*"})]}),R=v(Et);var It=({children:e,className:t,overrideClassName:r})=>{if(e)return jsx("p",{className:r?t:u("text-sm text-red-600 dark:text-red-400",t),children:e})},M=v(It);var Ve=forwardRef(({label:e,required:t,option:r,orientation:n="left",className:o,overrideClassName:s=!1,helperText:a,error:i,...l},p)=>{let f=useId(),h=u("h-4 w-4 rounded border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",i&&"border-destructive",o);return jsxs("div",{className:"space-y-2",children:[e&&jsx(R,{required:t,children:e}),jsxs("div",{className:`flex ${n=="left"?"flex-row":"flex-row-reverse"} w-fit gap-2`,children:[jsx("input",{id:f,type:"checkbox",className:s?o:h,ref:p,...l}),r&&jsx(R,{htmlFor:f,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r})]}),i&&jsx(M,{children:i}),!i&&a&&jsx(V,{children:a})]})});Ve.displayName="CheckBox";var Ln=v(Ve);function At(e,t){let{typeSet:r="field",multiCheck:n=!1,value:o,onChange:s,labelKey:a,valueKey:i,options:l,alignment:p="vertical",className:f,overrideClassName:h=!1,helperText:P,error:m,label:w,name:L,required:b,...C}=e,E=useId(),y=useMemo(()=>new Map(l.map(g=>[String(g[i]),g])),[l,i]),I=useMemo(()=>o==null?[]:r==="field"?n?o.map(g=>String(g)):[String(o)]:n?o.map(g=>String(g[i])):[String(o[i])],[o,r,n,i]),S=(g,T)=>{if(!s)return;let c;if(r==="field")if(n)c=g.map(x=>{let k=y.get(x);return k?k[i]:x});else {let d=g[0];if(!d)c=void 0;else {let x=y.get(d);c=x?x[i]:d;}}else n?c=g.map(x=>y.get(x)).filter(x=>x!==void 0):c=y.get(g[0]??"")??void 0;s({target:{name:L,value:c,type:"checkboxgroup",checked:T}});},F=g=>{let T;n?T=I.includes(g)?I.filter(c=>c!==g):[...I,g]:T=I[0]===g?[]:[g],S(T,T.includes(g));},N=p==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",H=u("h-4 w-4 rounded border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",m&&"border-destructive");return jsxs("div",{className:u("flex flex-col gap-3",f),children:[w&&jsx(R,{required:b,children:w}),jsx("div",{className:N,children:l.map((g,T)=>{let c=String(g[i]),d=I.includes(c),x=`${E}-${c}-${T}`;return jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{...C,id:x,ref:t,type:"checkbox",name:L,checked:d,onChange:()=>F(c),className:h?f:H}),jsx(R,{htmlFor:x,children:String(g[a])})]},x)})}),!!m&&jsx(M,{children:String(m)}),!m&&P&&jsx(V,{children:P})]})}function $t(){let e=forwardRef(At);return e.displayName="CheckBoxGroup",e}var Dt=$t(),$n=v(Dt);var Bt=({...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"})}),ee=Bt;var Ot=(e,t)=>{useEffect(()=>{let r=n=>{e.current&&!e.current.contains(n.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},Se=Ot;function ae({options:e,labelKey:t,valueKey:r,multiple:n,onChange:o,setSearchTerm:s,typeSet:a,name:i}){let[l,p]=useState([]),f=useMemo(()=>new Map(e.map(b=>[String(b[r]),b])),[e,r]),h=useCallback(()=>l.map(b=>f.get(b)).filter(b=>!!b),[l,f]),P=useCallback(b=>{if(!o)return;let C;if(a==="field"?n?C=b:C=b[0]??void 0:n?C=b.map(y=>f.get(y)).filter(y=>y!==void 0):C=f.get(b[0]??"")??void 0,s&&!n){let E=f.get(b[0]??"");E&&s(String(E[t]));}o({target:{name:i,value:C,type:"combobox"}});},[n,o,f,i,a,s,t]),m=useCallback(b=>{let C=String(b[r]),E=n?l.includes(C)?l.filter(y=>y!==C):[...l,C]:[C];p(E),P(E);},[n,l,P,r]),w=useCallback(b=>{let C=l.filter(E=>E!==b);p(C),P(C);},[l,P]),L=useCallback(()=>{p([]),s?.("");let b;a==="field"?b=n?[]:"":b=n?[]:void 0,o?.({target:{name:i,value:b,type:"combobox"}});},[n,o,i,s,a]);return {selectedValues:l,handleSelect:m,handleRemove:w,handleClear:L,getSelectedOptions:h}}function ie(e,t,r){return useMemo(()=>r?e.filter(o=>String(o[t]).toLowerCase().includes(r.toLowerCase())):e,[e,r,t])}var $e=({isOpen:e,setIsOpen:t,multiple:r,searchTerm:n,setSearchTerm:o,selectedValues:s,filteredOptions:a,highlightedIndex:i,setHighlightedIndex:l,handleSelect:p,handleRemove:f})=>{let h=useCallback(m=>{if(a.length===0){l(-1);return}l(w=>w<0?m>0?0:a.length-1:(w+m+a.length)%a.length);},[a,l]);return useCallback(m=>{if(!e){if(m.key==="Enter"||m.key==="ArrowDown"){t(!0),l(0),m.preventDefault();return}r&&m.key==="Backspace"&&n===""&&s.length>0&&(m.preventDefault(),f(s[s.length-1]));return}switch(m.key){case"ArrowDown":m.preventDefault(),h(1);break;case"ArrowUp":m.preventDefault(),h(-1);break;case"Enter":m.preventDefault();let w=i>=0?i:0,L=a[w];L&&p(L),r&&o&&o(""),r||(t(!1),l(-1));break;case"Escape":m.preventDefault(),t(!1),l(-1),r||o("");break;case"Tab":t(!1),l(-1);break;case"Home":m.preventDefault(),a.length>0&&l(0);break;case"End":m.preventDefault(),a.length>0&&l(a.length-1);break;case"Backspace":r&&n===""&&s.length>0&&(m.preventDefault(),f(s[s.length-1]));break}},[e,r,n,s,a,i,t,o,l,p,f,h])};function De({option:e,labelKey:t,valueKey:r,onRemove:n}){let o=String(e[t]),s=String(e[r]);return jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded",children:[o,jsx("button",{type:"button",onMouseDown:a=>a.preventDefault(),onClick:()=>n(s),className:"hover:bg-blue-200 dark:hover:bg-blue-800 rounded-full p-0.5 transition-colors","aria-label":`Remover ${o}`,children:"\u2715"})]},s)}function Zt(e,t){let{label:r,required:n=!1,name:o,placeholder:s="Buscar...",labelKey:a,valueKey:i,options:l,value:p,onChange:f,mode:h="single",typeSet:P="field",disabled:m=!1,ClearEnabled:w=!0,helperText:L,error:b=!1,className:C="",...E}=e,y=h==="multiple",[I,S]=useState(!1),[F,N]=useState(""),H=useRef(null),g=useRef(null),T=useRef(null);useImperativeHandle(t,()=>T.current),Se(g,()=>S(!1));let c=ie(l,a,F),[d,x]=useState(-1),{selectedValues:k,handleSelect:W,handleRemove:ue,handleClear:pt,getSelectedOptions:fe}=ae({options:l,labelKey:a,valueKey:i,value:p,multiple:y,onChange:f,typeSet:P,name:o,setSearchTerm:N}),ut=$e({isOpen:I,setIsOpen:S,multiple:y,searchTerm:F,setSearchTerm:N,selectedValues:k,filteredOptions:c,highlightedIndex:d,setHighlightedIndex:x,handleSelect:W,handleRemove:ue}),J=useId(),ft="w-full bg-transparent outline-none placeholder:text-gray-500 dark:placeholder:text-gray-400 text-gray-900 dark:text-gray-100",gt=u("relative w-full min-h-[40px] px-3 py-2 border rounded-md bg-white dark:bg-gray-800",b?"border-red-500":"border-gray-300 dark:border-gray-600",m?"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 ${C}`,children:[r&&jsx(R,{htmlFor:J,required:n,children:r}),jsxs("div",{ref:H,className:"relative",children:[jsxs("div",{className:gt,children:[y&&fe().length>0&&jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:fe().map((A,D)=>jsx(De,{option:A,labelKey:a,valueKey:i,onRemove:ue},String(A[i]??D)))}),jsx("input",{ref:T,...E,name:o,type:"text",placeholder:s,value:F,onChange:A=>{let D=A.target.value;N(D),!I&&D.trim()!==""&&S(!0);},onKeyDown:ut,onMouseDown:A=>{document.activeElement===T.current&&(A.preventDefault(),S(D=>{let X=!D;return X&&x(0),X}));},onFocus:()=>{S(!0),x(0);},disabled:m,className:ft,role:"combobox","aria-expanded":I,"aria-controls":J,"aria-activedescendant":d>=0?`${J}-opt-${d}`:void 0}),w&&!!k.length&&jsx("button",{type:"button",onMouseDown:A=>A.preventDefault(),onClick:pt,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(ee,{width:12,height:12})})]}),I&&jsx("div",{ref:g,id:J,className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto",role:"listbox","aria-multiselectable":y||void 0,children:c.length===0?jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"Nenhum resultado encontrado"}):c.map((A,D)=>{let X=String(A[i]),re=k.includes(X),ne=D===d;return jsx("button",{id:`${J}-opt-${D}`,"data-index":D,role:"option","aria-selected":re,type:"button",onMouseDown:bt=>bt.preventDefault(),onClick:()=>W(A),className:u("w-full px-3 py-2 text-left text-sm transition-colors",ne&&"bg-blue-100 dark:bg-blue-800 text-blue-900 dark:text-white",!ne&&re&&"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300",!re&&!ne&&"text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),children:jsx("span",{children:String(A[a])})},X)})})]}),b&&jsx(M,{children:b}),!b&&L&&jsx(V,{children:L})]})}function jt(){let e=forwardRef(Zt);return e.displayName="ComboBox",e}var Yt=jt(),uo=v(Yt);var er=({children:e,before:t,after:r,className:n})=>{let s=Qt("flex justify-center items-center",{"rounded-l-lg":t,"rounded-r-lg":r},n);return jsx("div",{className:s,children:jsx("span",{children:e})})},de=er;var tr=({children:e})=>jsx("div",{className:"absolute px-2",children:jsx("span",{children:e})}),Oe=tr;var rr=({children:e})=>jsx("div",{className:"absolute right-0 px-2",children:jsx("span",{children:e})}),Ue=rr;function qe(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),n=t.slice(-2),a=`${(r.replace(/^0+/,"")||"0").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1.")},${n}`;return e.currentTarget.value=a,e}function We(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 Je(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 Xe(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 ze(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 Ze(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 je(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 nr=({e,mask:t})=>{switch(t){case"money":return _e(e);case"mobile":return Je(e);case"phone":return Xe(e);case"cpfCnpj":return ze(e);case"cpf":return We(e);case"rg":return Ze(e);case"cnpj":return je(e);case"cep":return qe(e);default:return e}},Ye=nr;var ir=({mask:e,initialValue:t=""})=>{let[r,n]=useState(t);useEffect(()=>{t!==r&&n(t);},[t]);let o=useCallback(a=>{let l=Ye({e:a,mask:e})?.currentTarget?.value??a.currentTarget.value;n(l);},[e]),s=useCallback(()=>n(""),[]);return {value:r,setValue:n,handleChange:o,handleClear:s}},et=ir;var tt=forwardRef(({label:e,required:t=!1,mask:r,name:n,prefix:o,suffix:s,addonBefore:a,addonBeforeClassName:i,addonAfter:l,addonAfterClassName:p,ClearEnabled:f=!0,className:h,overrideClassName:P=!1,error:m,helperText:w,value:L=void 0,onChange:b,...C},E)=>{let y=useId(),{handleChange:I,handleClear:S,setValue:F}=et({mask:r,initialValue:L}),N=u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",m&&"border-destructive focus-visible:ring-destructive",!o&&!s&&"px-3",o&&!s&&"pl-10 pr-3",s&&!o&&"pl-3 pr-10",o&&s&&"pl-10 pr-10",a&&"rounded-l-none border-l-0",l&&"rounded-r-none border-r-0",h),H=T=>{I(T),b?.(T);},g=()=>{S(),F(""),b?.({target:{name:n||"",value:""}});};return jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsx(R,{htmlFor:y,required:t,children:e}),jsxs("div",{className:"relative flex",children:[a&&jsx(de,{before:!0,className:i,children:a}),jsxs("div",{className:"relative flex items-center w-full",children:[o&&jsx(Oe,{children:o}),jsx("input",{id:y,ref:E,name:n,onChange:H,className:P?h:N,...C}),f&&L&&jsx(ee,{onClick:g,width:12,height:12,className:u("absolute right-2 cursor-pointer",s&&"right-8")}),s&&jsx(Ue,{children:s})]}),l&&jsx(de,{after:!0,className:p,children:l})]}),m&&jsx(M,{children:m}),!m&&w&&jsx(V,{children:w})]})});tt.displayName="Input";var Go=v(tt);var nt=forwardRef(({length:e=6,groupBy:t,value:r,name:n,label:o,required:s=!1,helperText:a,error:i,onChange:l,onBlur:p,className:f,charType:h="numeric",customPattern:P,caseMode:m="none",...w},L)=>{let b=useId(),C=useRef([]),E=c=>{switch(m){case"upper":return c.toUpperCase();case"lower":case"visual-upper":return c.toLowerCase();case"visual-lower":return c.toUpperCase();default:return c}},y=c=>{if(!c)return "";let d=c.slice(0,1);switch(d=E(d),h){case"numeric":return /\d/.test(d)?d:"";case"alpha":return /[A-Za-z]/.test(d)?d:"";case"alphanumeric":return /[A-Za-z0-9]/.test(d)?d:"";case"custom":return P?.test(d)?d:"";default:return d}},I=()=>(r!=null?String(r):"").split("").map(y).slice(0,e),S=I().concat(Array(e).fill(" ")).slice(0,e),F=c=>{let d=c.split("").map(y).join("").slice(0,e),x=d===""?void 0:typeof r=="number"?Number(d):d;l?.({target:{name:n,value:x}});},N=(c,d)=>{let x=y(d),k=I();if(x===""){k[c]="",F(k.join(""));return}if(d.length>1){let W=d.split("").map(y).join("").slice(0,e);F(W),C.current[Math.min(W.length-1,e-1)]?.focus();return}x&&(k[c]=x,F(k.join("")),c<e-1&&C.current[c+1]?.focus());},H=c=>{let d=I();!d[c]&&c>0?d[c-1]="":d[c]="",F(d.join("")),c>0&&C.current[c-1]?.focus();},g=c=>{c.preventDefault();let x=c.clipboardData.getData("text").split("").map(y).join("").slice(0,e);x&&(F(x),C.current[Math.min(x.length-1,e-1)]?.focus());},T=c=>{switch(m){case"upper":case"visual-upper":return c.toUpperCase();case"lower":case"visual-lower":return c.toLowerCase();default:return c}};return jsxs("div",{className:"flex flex-col gap-2 w-full",children:[o&&jsx(R,{htmlFor:b,required:s,children:o}),jsx("div",{className:u("flex gap-3 items-center",i&&"text-red-500",f),...w,children:S.map((c,d)=>{let x=t&&d>0&&d%t===0;return jsxs(Rt.Fragment,{children:[x&&jsx("span",{className:"flex items-center justify-center text-xl font-bold select-none",children:"-"}),jsx("input",{id:b,type:"text",maxLength:1,inputMode:h==="numeric"?"numeric":"text",value:T(c).trim(),ref:k=>{C.current[d]=k,d===0&&L&&(typeof L=="function"?L(k):typeof L=="object"&&(L.current=k));},onPaste:g,onChange:k=>N(d,k.target.value),onKeyDown:k=>k.key==="Backspace"&&H(d),onBlur:p,className:u("h-14 w-12 text-center text-2xl rounded-md border border-input bg-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",i&&"border-red-500")})]},d)})}),i&&jsx(M,{children:i}),!i&&a&&jsx(V,{children:a})]})});nt.displayName="OtpInput";var zo=v(nt);var at=forwardRef(({label:e,required:t,option:r,className:n,overrideClassName:o,helperText:s,error:a,...i},l)=>{let p=useId(),f=u("h-4 w-4 border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a&&"border-destructive",n);return jsxs("div",{className:"space-y-3",children:[e&&jsx(R,{required:t,children:e}),jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{id:p,type:"radio",className:o?n:f,ref:l,...i}),r&&jsx(R,{htmlFor:p,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r})]}),a&&jsx(M,{children:a}),!a&&s&&jsx(V,{children:s})]})});at.displayName="Radio";var oa=v(at);function vr(e,t){let{label:r,required:n,name:o,labelKey:s,valueKey:a,options:i,alignment:l="vertical",className:p,overrideClassName:f=!1,helperText:h,error:P,typeSet:m="field",value:w,onChange:L,...b}=e,C=useId(),E=useMemo(()=>new Map(i.map(N=>[String(N[a]),N])),[i,a]),y=useMemo(()=>w==null?"":String(m==="field"?w:w[a]),[w,m,a]),I=N=>{if(!L)return;let H;if(m==="field"){let g=E.get(N);if(g)H=g[a];else {let T=Number(N);H=Number.isNaN(T)?N:T;}}else H=E.get(N)??void 0;L({target:{name:o,value:H,type:"radiogroup",checked:!0}});},S=l==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",F=u("h-4 w-4 rounded-full border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",P&&"border-destructive");return jsxs("div",{className:u("flex flex-col gap-3",p),children:[r&&jsx(R,{required:n,children:r}),jsx("div",{className:S,children:i.map((N,H)=>{let g=String(N[a]),T=`${C}-${g}-${H}`;return jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{...b,id:T,ref:t,name:o,type:"radio",checked:y===g,onChange:()=>I(g),className:f?p:F}),jsx(R,{htmlFor:T,children:String(N[s])})]},T)})}),P&&jsx(M,{children:String(P)}),!P&&h&&jsx(V,{children:h})]})}function xr(){let e=forwardRef(vr);return e.displayName="RadioGroup",e}var hr=xr(),ga=v(hr);function Tr({label:e,required:t=!1,options:r,labelKey:n,valueKey:o,placeholder:s,error:a,helperText:i,className:l,...p},f){let h=useId(),P=u("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",l);return jsxs("div",{className:"space-y-2",children:[e&&jsx(R,{htmlFor:h,required:t,children:e}),jsxs("select",{id:h,ref:f,className:P,...p,children:[s&&jsx("option",{value:"",disabled:!0,children:s}),r.map((m,w)=>jsx("option",{value:String(m[o]),children:String(m[n])},w))]}),a&&jsx(M,{children:a}),!a&&i&&jsx(V,{children:i})]})}function Pr(){let e=forwardRef(Tr);return e.displayName="Select",e}var wr=Pr(),La=v(wr);var dt=forwardRef(({label:e,description:t,checked:r=!1,className:n,overrideClassName:o,error:s,name:a,...i},l)=>{let p=useId();return jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",id:p,name:a,checked:r,className:"peer sr-only",ref:l,...i}),jsx("label",{htmlFor:p,className:u("relative flex items-center h-6 w-11 cursor-pointer rounded-full bg-input transition-colors duration-200","peer-checked:bg-primary peer-focus:ring-2 peer-focus:ring-ring peer-focus:ring-offset-2 peer-focus:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50",n),children:jsx("span",{className:u("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",r?"translate-x-5":"translate-x-1")})}),(e||t)&&jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[e&&jsx(R,{id:`${p}-label`,htmlFor:p,className:"text-sm font-medium leading-none",children:e}),t&&jsx(R,{id:`${p}-description`,htmlFor:p,className:"text-xs text-muted-foreground",children:t})]})]})});dt.displayName="Switch";var Ha=v(dt);var mt=Rt.forwardRef(({label:e,required:t,showCount:r,maxLength:n,className:o,overrideClassName:s=!1,error:a,helperText:i,...l},p)=>{let f=useId(),[h,P]=useState(0),m=u("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",o);return jsxs("div",{className:"space-y-2",children:[e&&jsx(R,{htmlFor:f,required:t,children:e}),jsxs("div",{className:"relative",children:[jsx("textarea",{id:f,className:s?o:m,maxLength:n,onInput:w=>P(w.currentTarget.textLength),ref:p,...l}),r&&jsxs("span",{className:"absolute bottom-2 right-3 text-xs text-muted-foreground",children:[h,n?` / ${n}`:""]})]}),a&&jsx(M,{children:a}),!a&&i&&jsx(V,{children:i})]})});mt.displayName="Textarea";var Ua=v(mt);
7
7
 
8
- export { Te as Button, Wr as ButtonPrimitive, nn as CardContentPrimitive, rn as CardDescriptionPrimitive, on as CardFooterPrimitive, en as CardHeaderPrimitive, Qr as CardPrimitive, tn as CardTitlePrimitive, $n as CheckBoxGroupPrimitive, Ln as CheckBoxPrimitive, uo as ComboBoxPrimitive, V as HelperFieldPrimitive, Go as InputPrimitive, R as LabelPrimitive, yt as LicenseProvider, zo as OtpInputPrimitive, ga as RadioGroupPrimitive, oa as RadioPrimitive, La as SelectPrimitive, Ha as SwitchPrimitive, Ua as TextareaPrimitive, M as ValidateFieldPrimitive };
8
+ export { Wr as ButtonPrimitive, nn as CardContentPrimitive, rn as CardDescriptionPrimitive, on as CardFooterPrimitive, en as CardHeaderPrimitive, Qr as CardPrimitive, tn as CardTitlePrimitive, $n as CheckBoxGroupPrimitive, Ln as CheckBoxPrimitive, uo as ComboBoxPrimitive, V as HelperFieldPrimitive, Go as InputPrimitive, R as LabelPrimitive, yt as LicenseProvider, zo as OtpInputPrimitive, ga as RadioGroupPrimitive, oa as RadioPrimitive, La as SelectPrimitive, Ha as SwitchPrimitive, Ua as TextareaPrimitive, M as ValidateFieldPrimitive };
package/package.json CHANGED
@@ -1,69 +1,69 @@
1
- {
2
- "name": "@mvr-ui/components",
3
- "version": "1.0.74",
4
- "sideEffects": false,
5
- "main": "dist/page.cjs",
6
- "module": "dist/page.js",
7
- "types": "dist/page.d.ts",
8
- "files": [
9
- "dist",
10
- "README.md"
11
- ],
12
- "exports": {
13
- ".": {
14
- "import": "./dist/page.mjs",
15
- "require": "./dist/page.js",
16
- "types": "./dist/page.d.ts"
17
- },
18
- "./dist/mvr-ui.css": "./dist/mvr-ui.css",
19
- "./styles.css": "./dist/mvr-ui.css"
20
- },
21
- "scripts": {
22
- "build": "npm run build:ts && npm run build:css",
23
- "build:css": "npx @tailwindcss/cli -i app/components/globals.css -o dist/mvr-ui.css --minify",
24
- "build:ts": "npx tsup",
25
- "patch": "npm version patch",
26
- "rise": "npm version patch && npm publish",
27
- "license": "bash ./scripts/license/license.sh",
28
- "reset": "npm cache clean --force && rm -rf node_modules package-lock.json && npm install"
29
- },
30
- "dependencies": {
31
- "tailwind-merge": "^3.3.1"
32
- },
33
- "devDependencies": {
34
- "@tailwindcss/postcss": "^4.1.16",
35
- "@types/node": "^24.0.10",
36
- "@types/react": "^19.1.8",
37
- "@types/react-dom": "^19.1.6",
38
- "autoprefixer": "^10.4.21",
39
- "clsx": "^2.1.1",
40
- "postcss": "^8.5.6",
41
- "postcss-cli": "^11.0.1",
42
- "tailwindcss": "^4.1.16",
43
- "tailwindcss-animate": "^1.0.7",
44
- "tsup": "^7.2.0",
45
- "tw-animate-css": "^1.4.0",
46
- "typescript": "^5.8.3"
47
- },
48
- "peerDependencies": {
49
- "autoprefixer": "^10.4.21",
50
- "clsx": "^2.1.1",
51
- "next": ">=14.0.0",
52
- "postcss": "^8.5.6",
53
- "react": ">=18.0.0",
54
- "react-dom": ">=18.0.0",
55
- "react-hook-form": "^7.43.0 || ^7.59.0",
56
- "tailwindcss": "^4.1.11"
57
- },
58
- "peerDependenciesMeta": {
59
- "tailwindcss": {
60
- "optional": true
61
- },
62
- "autoprefixer": {
63
- "optional": true
64
- },
65
- "postcss": {
66
- "optional": true
67
- }
68
- }
69
- }
1
+ {
2
+ "name": "@mvr-ui/components",
3
+ "version": "1.0.76",
4
+ "sideEffects": false,
5
+ "main": "dist/page.cjs",
6
+ "module": "dist/page.js",
7
+ "types": "dist/page.d.ts",
8
+ "files": [
9
+ "dist",
10
+ "README.md"
11
+ ],
12
+ "exports": {
13
+ ".": {
14
+ "import": "./dist/page.mjs",
15
+ "require": "./dist/page.js",
16
+ "types": "./dist/page.d.ts"
17
+ },
18
+ "./dist/mvr-ui.css": "./dist/mvr-ui.css",
19
+ "./styles.css": "./dist/mvr-ui.css"
20
+ },
21
+ "scripts": {
22
+ "build": "npm run build:ts && npm run build:css",
23
+ "build:css": "npx @tailwindcss/cli -i app/components/globals.css -o dist/mvr-ui.css --minify",
24
+ "build:ts": "npx tsup",
25
+ "patch": "npm version patch",
26
+ "rise": "npm version patch && npm publish",
27
+ "license": "bash ./scripts/license/license.sh",
28
+ "reset": "npm cache clean --force && rm -rf node_modules package-lock.json && npm install"
29
+ },
30
+ "dependencies": {
31
+ "tailwind-merge": "^3.3.1"
32
+ },
33
+ "devDependencies": {
34
+ "@tailwindcss/postcss": "^4.1.16",
35
+ "@types/node": "^24.0.10",
36
+ "@types/react": "^19.1.8",
37
+ "@types/react-dom": "^19.1.6",
38
+ "autoprefixer": "^10.4.21",
39
+ "clsx": "^2.1.1",
40
+ "postcss": "^8.5.6",
41
+ "postcss-cli": "^11.0.1",
42
+ "tailwindcss": "^4.1.16",
43
+ "tailwindcss-animate": "^1.0.7",
44
+ "tsup": "^7.2.0",
45
+ "tw-animate-css": "^1.4.0",
46
+ "typescript": "^5.8.3"
47
+ },
48
+ "peerDependencies": {
49
+ "autoprefixer": "^10.4.21",
50
+ "clsx": "^2.1.1",
51
+ "next": ">=14.0.0",
52
+ "postcss": "^8.5.6",
53
+ "react": ">=18.0.0",
54
+ "react-dom": ">=18.0.0",
55
+ "react-hook-form": "^7.43.0 || ^7.59.0",
56
+ "tailwindcss": "^4.1.11"
57
+ },
58
+ "peerDependenciesMeta": {
59
+ "tailwindcss": {
60
+ "optional": true
61
+ },
62
+ "autoprefixer": {
63
+ "optional": true
64
+ },
65
+ "postcss": {
66
+ "optional": true
67
+ }
68
+ }
69
+ }