rharuow-ds 1.1.3 → 1.3.0
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 +46 -11
- package/dist/rharuow-ds.cjs.js +1 -1
- package/dist/rharuow-ds.es.js +620 -467
- package/dist/styles.css +1 -1
- package/dist/types/src/components/Card.d.ts +1 -0
- package/dist/types/src/components/Table.d.ts +51 -0
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/stories/Card.stories.d.ts +1 -0
- package/dist/types/src/stories/Table.stories.d.ts +46 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# rharuow-ds
|
|
2
2
|
|
|
3
|
-
-
|
|
4
|
-
- 🧩 **9 componentes** prontos para uso (Input, Textarea, Select, AsyncSelect, MultiSelect, MultiAsyncSelect, RadioGroup, Button, Card)
|
|
5
|
-
- 🔗 **Integração nativa** com React Hook Form
|
|
6
|
-
- 🎨 **Customização via CSS Variables** - Mude o tema facilmente
|
|
7
|
-
- 🎯 **Componentes acessíveis** (ARIA)
|
|
8
|
-
- 📱 **Responsivo** por padrão
|
|
9
|
-
- 🎭 **Animações suaves** e modernas
|
|
10
|
-
- 📚 **Documentação interativa** com StorybookNPM Version](https://img.shields.io/npm/v/rharuow-ds)](https://www.npmjs.com/package/rharuow-ds)
|
|
3
|
+
[](https://www.npmjs.com/package/rharuow-ds)
|
|
11
4
|
[](https://opensource.org/licenses/MIT)
|
|
12
5
|
[](https://github.com/Rharuow/rharuow-ds-docs/actions)
|
|
13
6
|
|
|
@@ -16,7 +9,8 @@ Um Design System moderno em React com integração completa ao React Hook Form,
|
|
|
16
9
|
## 🌟 Características
|
|
17
10
|
|
|
18
11
|
- ⚛️ **React 18+** com TypeScript
|
|
19
|
-
-
|
|
12
|
+
- 🧩 **10 componentes** prontos para uso (Input, Textarea, Select, AsyncSelect, MultiSelect, MultiAsyncSelect, RadioGroup, Button, Card, Table)
|
|
13
|
+
- 🔗 **Integração nativa** com React Hook Form
|
|
20
14
|
- 🎨 **Customização via CSS Variables** - Mude o tema facilmente
|
|
21
15
|
- 🎯 **Componentes acessíveis** (ARIA)
|
|
22
16
|
- 📱 **Responsivo** por padrão
|
|
@@ -71,6 +65,7 @@ npm install react-hook-form
|
|
|
71
65
|
```tsx
|
|
72
66
|
import {
|
|
73
67
|
Card,
|
|
68
|
+
Table,
|
|
74
69
|
Button,
|
|
75
70
|
Input,
|
|
76
71
|
Textarea,
|
|
@@ -97,6 +92,26 @@ npm install react-hook-form
|
|
|
97
92
|
</Card.Footer>
|
|
98
93
|
</Card>
|
|
99
94
|
|
|
95
|
+
{/* Exemplo da Table */}
|
|
96
|
+
<Table variant="striped" size="md">
|
|
97
|
+
<Table.Header>
|
|
98
|
+
<Table.Row>
|
|
99
|
+
<Table.Cell as="th">Nome</Table.Cell>
|
|
100
|
+
<Table.Cell as="th">Email</Table.Cell>
|
|
101
|
+
<Table.Cell as="th">Ações</Table.Cell>
|
|
102
|
+
</Table.Row>
|
|
103
|
+
</Table.Header>
|
|
104
|
+
<Table.Body>
|
|
105
|
+
<Table.Row>
|
|
106
|
+
<Table.Cell>João Silva</Table.Cell>
|
|
107
|
+
<Table.Cell>joao@email.com</Table.Cell>
|
|
108
|
+
<Table.Cell>
|
|
109
|
+
<Button variant="outline">Editar</Button>
|
|
110
|
+
</Table.Cell>
|
|
111
|
+
</Table.Row>
|
|
112
|
+
</Table.Body>
|
|
113
|
+
</Table>
|
|
114
|
+
|
|
100
115
|
{/* Outros componentes */}
|
|
101
116
|
<Input label="E-mail" name="email" type="email" />
|
|
102
117
|
<Input label="Senha" name="password" type="password" />
|
|
@@ -130,6 +145,7 @@ npm install react-hook-form
|
|
|
130
145
|
import { useForm, FormProvider } from "react-hook-form";
|
|
131
146
|
import {
|
|
132
147
|
Card,
|
|
148
|
+
Table,
|
|
133
149
|
Input,
|
|
134
150
|
Textarea,
|
|
135
151
|
Select,
|
|
@@ -224,12 +240,31 @@ Componente flexível para exibir conteúdo organizado em seções:
|
|
|
224
240
|
|
|
225
241
|
- ✅ **Estrutura modular**: Header, Body e Footer independentes
|
|
226
242
|
- ✅ **Múltiplas variantes**: default, outlined, elevated, flat
|
|
227
|
-
- ✅ **
|
|
243
|
+
- ✅ **Largura flexível**: Por padrão, cresce para ocupar largura disponível
|
|
244
|
+
- ✅ **Controle de largura**: Use `constrainWidth=true` para aplicar limitações por tamanho
|
|
245
|
+
- ✅ **Tamanhos configuráveis**: sm, md, lg (aplicados apenas com `constrainWidth`)
|
|
228
246
|
- ✅ **Suporte ao tema dark**: Variáveis CSS para light/dark mode
|
|
229
247
|
- ✅ **Elementos semânticos**: Props `as` para acessibilidade (header, main, footer)
|
|
230
248
|
- ✅ **Flexibilidade total**: Use apenas as seções necessárias
|
|
231
249
|
- ✅ **Customização completa**: Padding, bordas arredondadas e estilos
|
|
232
250
|
|
|
251
|
+
### 📊 **Table**
|
|
252
|
+
|
|
253
|
+
Componente completo para exibição de dados tabulares:
|
|
254
|
+
|
|
255
|
+
- ✅ **Estrutura modular**: Table, Header, Body, Footer, Row, Cell
|
|
256
|
+
- ✅ **Múltiplas variantes**: default, striped, bordered
|
|
257
|
+
- ✅ **Tamanhos configuráveis**: sm, md, lg
|
|
258
|
+
- ✅ **Responsividade**: Scroll horizontal automático
|
|
259
|
+
- ✅ **Header fixo**: Para tabelas com muitos dados
|
|
260
|
+
- ✅ **Suporte ao tema dark**: Variáveis CSS para light/dark mode
|
|
261
|
+
- ✅ **Alinhamento de células**: left, center, right
|
|
262
|
+
- ✅ **Colspan e rowspan**: Células que ocupam múltiplas colunas/linhas
|
|
263
|
+
- ✅ **Elementos semânticos**: Props `as` para acessibilidade (th/td, thead/tbody/tfoot)
|
|
264
|
+
- ✅ **Linhas interativas**: Hover e estados de seleção
|
|
265
|
+
|
|
266
|
+
### �
|
|
267
|
+
|
|
233
268
|
### �🎯 **Button**
|
|
234
269
|
|
|
235
270
|
Botão customizável com diferentes variantes e tamanhos.
|
package/dist/rharuow-ds.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react"),V=require("react-hook-form");function xe(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const l=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,l.get?l:{enumerable:!0,get:()=>t[n]})}}return r.default=t,Object.freeze(r)}const e=xe(j);function oe(t){var r,n,l="";if(typeof t=="string"||typeof t=="number")l+=t;else if(typeof t=="object")if(Array.isArray(t)){var x=t.length;for(r=0;r<x;r++)t[r]&&(n=oe(t[r]))&&(l&&(l+=" "),l+=n)}else for(n in t)t[n]&&(l&&(l+=" "),l+=n);return l}function ve(){for(var t,r,n=0,l="",x=arguments.length;n<x;n++)(t=arguments[n])&&(r=oe(t))&&(l&&(l+=" "),l+=r);return l}function o(...t){return ve(...t)}const ge=({children:t,variant:r="default",className:n="",...l})=>{const x="px-4 py-2 rounded font-medium transition",F={default:"bg-[var(--primary,#2563eb)] text-[var(--primary-text,#fff)] hover:bg-[var(--primary-hover,#1d4ed8)]",outline:"border border-[var(--primary,#2563eb)] text-[var(--primary,#2563eb)] bg-white hover:bg-[var(--primary-hover,#e0e7ff)]",secondary:"bg-[var(--secondary,#fbbf24)] text-[var(--secondary-text,#222)] hover:bg-[var(--secondary-hover,#f59e42)]"};return j.createElement("button",{className:o(x,F[r],n),...l},t)},se=e.forwardRef(({name:t,className:r,type:n="text",label:l,onFocus:x,onBlur:F,Icon:E,iconClassName:M,iconAction:m,containerClassName:y,...C},f)=>{var I,b,a;const[w,p]=e.useState(!1),[c,u]=e.useState(!1),h=V.useFormContext(),N=h==null?void 0:h.control,s=h==null?void 0:h.register,S=N&&t?V.useWatch({control:N,name:t}):void 0,R=C.value??S??"",v=(a=(b=(I=h==null?void 0:h.formState)==null?void 0:I.errors)==null?void 0:b[t])==null?void 0:a.message,_=w||!!R,O=n==="password"?c?"text":"password":n,k=()=>e.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z",fill:"currentColor"})),W=()=>e.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z",fill:"currentColor"})),z=()=>{u(!c)};return e.createElement("div",{className:o("relative",y)},e.createElement("input",{id:C.id||t,type:O,className:o("peer flex h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 pt-6 pb-2 text-sm placeholder-transparent transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50",n==="password"||E?"pr-12":"",r),onFocus:d=>{p(!0),x&&x(d)},...h&&t?(()=>{const d=s(t),A=d.onBlur;return{...d,ref:L=>{typeof f=="function"?f(L):f&&(f.current=L),d.ref&&d.ref(L)},onBlur:L=>{p(!1),F&&F(L),A&&A(L)}}})():{ref:f,onBlur:d=>{p(!1),F&&F(d)}},...C}),l&&e.createElement("label",{htmlFor:C.id||t,className:o("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",_?"top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white":"top-3 scale-100 translate-y-0.5")},l),n==="password"&&e.createElement("button",{type:"button",className:"absolute top-1/2 right-3 -translate-y-1/2 text-gray-400 hover:text-[var(--primary,#2563eb)] transition-colors duration-200 focus:outline-none focus:text-[var(--primary,#2563eb)]",onClick:z,"aria-label":c?"Esconder senha":"Mostrar senha",tabIndex:-1},c?e.createElement(W,null):e.createElement(k,null)),E&&n!=="password"&&e.createElement("div",{className:o("absolute top-1/2 right-3 -translate-y-1/2 text-gray-400 cursor-pointer hover:text-[var(--primary,#2563eb)] transition-colors duration-200",M),onClick:m},e.createElement(E,null)),v&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},v))});se.displayName="Input";const ce=e.forwardRef(({name:t,label:r,options:n,className:l,containerClassName:x,isClearable:F,onFocus:E,onBlur:M,...m},y)=>{var k,W,z,I;const[C,f]=e.useState(!1),[w,p]=e.useState(!1),c=e.useRef(null),u=V.useFormContext(),h=u==null?void 0:u.control,N=h&&t?V.useWatch({control:h,name:t}):void 0,s=m.value??N??"",S=(z=(W=(k=u==null?void 0:u.formState)==null?void 0:k.errors)==null?void 0:W[t])==null?void 0:z.message,R=C||!!s;e.useEffect(()=>{const b=a=>{c.current&&!c.current.contains(a.target)&&(p(!1),f(!1))};return document.addEventListener("mousedown",b),()=>{document.removeEventListener("mousedown",b)}},[]);const v=()=>{p(b=>!b),f(!0)},_=b=>{f(!0),E&&E(b)},O=b=>{M&&M(b)};return e.createElement("div",{className:o("relative",x),ref:c},e.createElement("div",{id:m.id||t,tabIndex:0,role:"button","aria-haspopup":"listbox","aria-expanded":w,className:o("peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",l),onClick:v,onFocus:_,onBlur:O,ref:y},e.createElement("span",{className:o("block truncate",!s&&"text-gray-400")},((I=n.find(b=>b.value===s))==null?void 0:I.label)||!r&&"Selecione..."),F&&s&&e.createElement("button",{type:"button",tabIndex:-1,"aria-label":"Limpar seleção",className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",onClick:b=>{if(b.stopPropagation(),u&&t&&u.setValue(t,""),m.onChange){const a={target:{value:""}};m.onChange(a)}p(!1),f(!1)}},"✕")),r&&e.createElement("label",{htmlFor:m.id||t,className:o("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",R?"top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white":"top-3 scale-100 translate-y-0.5")},r),e.createElement("div",{className:o("absolute left-0 w-full mt-1 rounded-md shadow-lg bg-white z-20 transition-all duration-200 overflow-hidden",w?"border border-[var(--primary,#2563eb)] max-h-36 opacity-100 scale-100":"max-h-0 opacity-0 scale-95 pointer-events-none"),style:{maxHeight:w?"9.5rem":"0",overflowY:n.length>3?"auto":"hidden"}},n.map(b=>e.createElement("div",{key:b.value,className:o("px-3 py-2 cursor-pointer hover:bg-blue-50 text-sm",s===b.value&&"bg-blue-100"),onMouseDown:()=>{if(u&&t&&u.setValue(t,b.value),m.onChange){const a={target:{value:b.value}};m.onChange(a)}f(!0)}},b.label))),S&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},S))});ce.displayName="Select";const ie=e.forwardRef(({name:t,className:r,label:n,onFocus:l,onBlur:x,Icon:F,iconClassName:E,iconAction:M,containerClassName:m,rows:y=4,...C},f)=>{var v,_,O;const[w,p]=e.useState(!1),c=V.useFormContext(),u=c==null?void 0:c.control,h=c==null?void 0:c.register,N=u&&t?V.useWatch({control:u,name:t}):void 0,s=C.value??N??"",S=(O=(_=(v=c==null?void 0:c.formState)==null?void 0:v.errors)==null?void 0:_[t])==null?void 0:O.message,R=w||!!s;return e.createElement("div",{className:o("relative",m)},e.createElement("textarea",{id:C.id||t,rows:y,className:o("peer flex min-h-[80px] w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 pt-6 pb-2 text-sm placeholder-transparent transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 resize-vertical",F?"pr-12":"",r),onFocus:k=>{p(!0),l&&l(k)},...c&&t?(()=>{const k=h(t),W=k.onBlur;return{...k,ref:z=>{typeof f=="function"?f(z):f&&(f.current=z),k.ref&&k.ref(z)},onBlur:z=>{p(!1),x&&x(z),W&&W(z)}}})():{ref:f,onBlur:k=>{p(!1),x&&x(k)}},...C}),n&&e.createElement("label",{htmlFor:C.id||t,className:o("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",R?"top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white":"top-3 scale-100 translate-y-0.5")},n),F&&e.createElement("div",{className:o("absolute top-3 right-3 text-gray-400 cursor-pointer hover:text-[var(--primary,#2563eb)] transition-colors duration-200",E),onClick:M},e.createElement(F,null)),S&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},S))});ie.displayName="Textarea";const ue=e.forwardRef(({name:t,label:r,loadOptions:n,className:l,containerClassName:x,isClearable:F,defaultOptions:E=!1,loadingMessage:M="Carregando...",noOptionsMessage:m="Nenhuma opção encontrada",searchable:y=!1,debounceMs:C=300,onFocus:f,onBlur:w,...p},c)=>{var Y,U,G;const[u,h]=e.useState(!1),[N,s]=e.useState(!1),[S,R]=e.useState([]),[v,_]=e.useState(!1),[O,k]=e.useState(""),[W,z]=e.useState(""),I=e.useRef(null),b=e.useRef(null),a=V.useFormContext(),d=a==null?void 0:a.control,A=d&&t?V.useWatch({control:d,name:t}):void 0,L=p.value??A??"",B=(G=(U=(Y=a==null?void 0:a.formState)==null?void 0:Y.errors)==null?void 0:U[t])==null?void 0:G.message,q=u||!!L;e.useEffect(()=>{const g=setTimeout(()=>{z(O)},C);return()=>clearTimeout(g)},[O,C]),e.useEffect(()=>{(N||E&&S.length===0)&&$(y?W:void 0)},[W,N]),e.useEffect(()=>{E===!0?$():Array.isArray(E)&&R(E)},[]);const $=async g=>{try{_(!0);const P=await n(g);R(P)}catch(P){console.error("Error loading options:",P),R([])}finally{_(!1)}};e.useEffect(()=>{const g=P=>{I.current&&!I.current.contains(P.target)&&(s(!1),h(!1),k(""))};return document.addEventListener("mousedown",g),()=>{document.removeEventListener("mousedown",g)}},[]);const K=()=>{N||(s(!0),h(!0),y&&b.current&&setTimeout(()=>{var g;return(g=b.current)==null?void 0:g.focus()},0))},J=g=>{h(!0),f&&f(g)},D=g=>{w&&w(g)},Q=g=>{k(g.target.value)},Z=g=>{if(a&&t&&a.setValue(t,g),p.onChange){const P={target:{value:g}};p.onChange(P)}s(!1),h(!1),k("")},ee=g=>{if(g.stopPropagation(),a&&t&&a.setValue(t,""),p.onChange){const P={target:{value:""}};p.onChange(P)}s(!1),h(!1),k("")},H=S.find(g=>g.value===L),te=y&&N?O:(H==null?void 0:H.label)||"";return e.createElement("div",{className:o("relative",x),ref:I},e.createElement("div",{id:p.id||t,tabIndex:y?-1:0,role:"button","aria-haspopup":"listbox","aria-expanded":N,className:o("peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",l),onClick:K,onFocus:y?void 0:J,onBlur:y?void 0:D,ref:c},y?e.createElement("input",{ref:b,type:"text",value:te,onChange:Q,onFocus:J,onBlur:D,placeholder:r?"":"Selecione...",className:o("w-full bg-transparent border-none outline-none text-sm",!L&&!O&&"text-gray-400")}):e.createElement("span",{className:o("block truncate",!L&&"text-gray-400")},(H==null?void 0:H.label)||!r&&"Selecione..."),v&&e.createElement("div",{className:"absolute right-8 top-1/2 -translate-y-1/2"},e.createElement("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-[var(--primary,#2563eb)]"})),F&&L&&!v&&e.createElement("button",{type:"button",tabIndex:-1,"aria-label":"Limpar seleção",className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",onClick:ee},"✕")),r&&e.createElement("label",{htmlFor:p.id||t,className:o("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",q?"top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white":"top-3 scale-100 translate-y-0.5")},r),e.createElement("div",{className:o("absolute left-0 w-full mt-1 rounded-md shadow-lg bg-white z-20 transition-all duration-200 overflow-hidden",N?"border border-[var(--primary,#2563eb)] max-h-36 opacity-100 scale-100":"max-h-0 opacity-0 scale-95 pointer-events-none"),style:{maxHeight:N?"9.5rem":"0",overflowY:S.length>3?"auto":"hidden"}},v?e.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},M):S.length===0?e.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},m):S.map(g=>e.createElement("div",{key:g.value,className:o("px-3 py-2 cursor-pointer hover:bg-blue-50 text-sm",L===g.value&&"bg-blue-100"),onMouseDown:()=>Z(g.value)},g.label))),B&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},B))});ue.displayName="AsyncSelect";const de=e.forwardRef(({name:t,label:r,options:n,className:l,containerClassName:x,isClearable:F,onFocus:E,onBlur:M,...m},y)=>{var z,I,b;const[C,f]=e.useState(!1),[w,p]=e.useState(!1),c=e.useRef(null),u=V.useFormContext(),h=u==null?void 0:u.control,N=h&&t?V.useWatch({control:h,name:t}):void 0,s=m.value??N??[],S=(b=(I=(z=u==null?void 0:u.formState)==null?void 0:z.errors)==null?void 0:I[t])==null?void 0:b.message,R=C||s&&s.length>0;e.useEffect(()=>{const a=d=>{c.current&&!c.current.contains(d.target)&&(p(!1),f(!1))};return document.addEventListener("mousedown",a),()=>{document.removeEventListener("mousedown",a)}},[]);const v=()=>{p(a=>!a),f(!0)},_=a=>{f(!0),E&&E(a)},O=a=>{M&&M(a)},k=a=>{var A;let d;s.includes(a)?d=s.filter(L=>L!==a):d=[...s,a],u&&t&&u.setValue(t,d),m.onChange&&((A=m.onChange)==null||A.call(m,{target:{value:d}})),f(!0)},W=a=>{var d;a.stopPropagation(),u&&t&&u.setValue(t,[]),m.onChange&&((d=m.onChange)==null||d.call(m,{target:{value:[]}})),p(!1),f(!1)};return e.createElement("div",{className:o("relative",x),ref:c},e.createElement("div",{id:m.id||t,tabIndex:0,role:"button","aria-haspopup":"listbox","aria-expanded":w,className:o("peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",l),onClick:v,onFocus:_,onBlur:O,ref:y},e.createElement("div",{className:"flex flex-nowrap gap-1 items-center min-h-[1.5rem] w-full overflow-x-auto",style:{scrollbarWidth:"none"}},s&&s.length>0?n.filter(a=>s.includes(a.value)).map(a=>e.createElement("span",{key:a.value,className:"flex items-center border border-blue-200 bg-blue-50 text-blue-700 rounded-2xl px-3 py-1 text-xs shadow-sm mr-1 gap-2",style:{maxWidth:"140px"}},e.createElement("span",{className:"truncate",title:a.label},a.label),e.createElement("button",{type:"button",className:"ml-1 text-[var(--primary,#2563eb)] hover:text-red-500 focus:outline-none w-4 h-4 flex items-center justify-center rounded-full transition-colors duration-150","aria-label":`Remover ${a.label}`,tabIndex:-1,onClick:d=>{d.stopPropagation();const A=s.filter(L=>L!==a.value);u&&t&&u.setValue(t,A),m.onChange&&m.onChange({target:{value:A}})}},e.createElement("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M3 3L9 9M9 3L3 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}))))):!r&&e.createElement("span",{className:"text-gray-400 text-sm"},"Selecione...")),F&&s&&s.length>0&&e.createElement("button",{type:"button",tabIndex:-1,"aria-label":"Limpar seleção",className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",onClick:W},"✕")),r&&e.createElement("label",{htmlFor:m.id||t,className:o("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",R?"top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white":"top-3 scale-100 translate-y-0.5")},r),e.createElement("div",{className:o("absolute left-0 w-full mt-1 rounded-md shadow-lg bg-white z-20 transition-all duration-200 overflow-hidden",w?"border border-[var(--primary,#2563eb)] max-h-36 opacity-100 scale-100":"max-h-0 opacity-0 scale-95 pointer-events-none"),style:{maxHeight:w?"9.5rem":"0",overflowY:n.length>3?"auto":"hidden"}},n.map(a=>e.createElement("div",{key:a.value,className:o("px-3 py-2 cursor-pointer hover:bg-blue-50 text-sm flex items-center gap-2",s.includes(a.value)&&"bg-blue-100 font-semibold"),onMouseDown:()=>k(a.value)},e.createElement("input",{type:"checkbox",checked:s.includes(a.value),readOnly:!0,className:"accent-blue-500"}),a.label))),S&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},S))});de.displayName="MultiSelect";const me=e.forwardRef(({name:t,label:r,loadOptions:n,className:l,containerClassName:x,isClearable:F,defaultOptions:E=!1,loadingMessage:M="Carregando...",noOptionsMessage:m="Nenhuma opção encontrada",searchable:y=!1,debounceMs:C=300,maxSelectedDisplay:f=3,onFocus:w,onBlur:p,...c},u)=>{var g,P,le;const[h,N]=e.useState(!1),[s,S]=e.useState(!1),[R,v]=e.useState([]),[_,O]=e.useState(!1),[k,W]=e.useState(""),[z,I]=e.useState(""),b=e.useRef(null),a=e.useRef(null),d=V.useFormContext(),A=d==null?void 0:d.control,L=A&&t?V.useWatch({control:A,name:t}):void 0,B=c.value??L??[],q=(le=(P=(g=d==null?void 0:d.formState)==null?void 0:g.errors)==null?void 0:P[t])==null?void 0:le.message,$=h||B&&B.length>0;e.useEffect(()=>{const i=setTimeout(()=>{I(k)},C);return()=>clearTimeout(i)},[k,C]),e.useEffect(()=>{(s||E&&R.length===0)&&K(y?z:void 0)},[z,s]),e.useEffect(()=>{E===!0?K():Array.isArray(E)&&v(E)},[]);const K=async i=>{try{O(!0);const T=await n(i);v(T)}catch(T){console.error("Error loading options:",T),v([])}finally{O(!1)}};e.useEffect(()=>{const i=T=>{b.current&&!b.current.contains(T.target)&&(S(!1),N(!1),W(""))};return document.addEventListener("mousedown",i),()=>{document.removeEventListener("mousedown",i)}},[]);const J=()=>{s||(S(!0),N(!0),y&&a.current&&setTimeout(()=>{var i;return(i=a.current)==null?void 0:i.focus()},0))},D=i=>{N(!0),w&&w(i)},Q=i=>{p&&p(i)},Z=i=>{W(i.target.value)},ee=i=>{let T;B.includes(i)?T=B.filter(X=>X!==i):T=[...B,i],d&&t&&d.setValue(t,T),c.onChange&&c.onChange({target:{value:T}}),N(!0)},H=(i,T)=>{T.stopPropagation();const X=B.filter(be=>be!==i);d&&t&&d.setValue(t,X),c.onChange&&c.onChange({target:{value:X}})},te=i=>{i.stopPropagation(),d&&t&&d.setValue(t,[]),c.onChange&&c.onChange({target:{value:[]}}),S(!1),N(!1),W("")},Y=R.filter(i=>B.includes(i.value)),U=Y.slice(0,f),G=Y.length-f;return e.createElement("div",{className:o("relative",x),ref:b},e.createElement("div",{id:c.id||t,tabIndex:y?-1:0,role:"button","aria-haspopup":"listbox","aria-expanded":s,className:o("peer flex items-center min-h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-2 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",l),onClick:J,onFocus:y?void 0:D,onBlur:y?void 0:Q,ref:u},e.createElement("div",{className:"flex flex-wrap gap-1 items-center min-h-[1.5rem] w-full"},U.map(i=>e.createElement("span",{key:i.value,className:"flex items-center border border-blue-200 bg-blue-50 text-blue-700 rounded-2xl px-3 py-1 text-xs shadow-sm gap-2",style:{maxWidth:"140px"}},e.createElement("span",{className:"truncate",title:i.label},i.label),e.createElement("button",{type:"button",className:"ml-1 text-[var(--primary,#2563eb)] hover:text-red-500 focus:outline-none w-4 h-4 flex items-center justify-center rounded-full transition-colors duration-150","aria-label":`Remover ${i.label}`,tabIndex:-1,onClick:T=>H(i.value,T)},e.createElement("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M3 3L9 9M9 3L3 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}))))),G>0&&e.createElement("span",{className:"flex items-center border border-gray-200 bg-gray-100 text-gray-600 rounded-2xl px-3 py-1 text-xs"},"+",G," mais"),y?e.createElement("input",{ref:a,type:"text",value:k,onChange:Z,onFocus:D,onBlur:Q,placeholder:B.length===0&&!r?"Selecione...":"",className:"flex-1 min-w-[120px] bg-transparent border-none outline-none text-sm"}):B.length===0&&!r&&e.createElement("span",{className:"text-gray-400 text-sm"},"Selecione...")),_&&e.createElement("div",{className:"absolute right-8 top-1/2 -translate-y-1/2"},e.createElement("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-[var(--primary,#2563eb)]"})),F&&B&&B.length>0&&!_&&e.createElement("button",{type:"button",tabIndex:-1,"aria-label":"Limpar seleção",className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",onClick:te},"✕")),r&&e.createElement("label",{htmlFor:c.id||t,className:o("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",$?"top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white":"top-3 scale-100 translate-y-0.5")},r),e.createElement("div",{className:o("absolute left-0 w-full mt-1 rounded-md shadow-lg bg-white z-20 transition-all duration-200 overflow-hidden",s?"border border-[var(--primary,#2563eb)] max-h-36 opacity-100 scale-100":"max-h-0 opacity-0 scale-95 pointer-events-none"),style:{maxHeight:s?"9.5rem":"0",overflowY:R.length>3?"auto":"hidden"}},_?e.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},M):R.length===0?e.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},m):R.map(i=>e.createElement("div",{key:i.value,className:o("px-3 py-2 cursor-pointer hover:bg-blue-50 text-sm flex items-center gap-2",B.includes(i.value)&&"bg-blue-100 font-semibold"),onMouseDown:()=>ee(i.value)},e.createElement("input",{type:"checkbox",checked:B.includes(i.value),readOnly:!0,className:"accent-blue-500"}),i.label))),q&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},q))});me.displayName="MultiAsyncSelect";const pe={sm:"h-10 text-sm px-3",md:"h-12 text-base px-4",lg:"h-16 text-lg px-6"},fe=e.forwardRef(({name:t,label:r,options:n,className:l,containerClassName:x,optionClassName:F,direction:E="row",size:M="md",onFocus:m,onBlur:y,...C},f)=>{var s,S,R;const w=V.useFormContext(),p=w==null?void 0:w.control,c=p&&t?V.useWatch({control:p,name:t}):void 0,u=C.value??c??"",h=(R=(S=(s=w==null?void 0:w.formState)==null?void 0:s.errors)==null?void 0:S[t])==null?void 0:R.message,N=v=>{w&&t&&w.setValue(t,v),C.onChange&&C.onChange({target:{value:v}})};return e.createElement("div",{className:o("relative",x),ref:f},r&&e.createElement("label",{htmlFor:t,className:o("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm transition-all duration-200","top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white")},r),e.createElement("div",{className:o("flex gap-2 w-full pt-6",E==="row"?"flex-row":"flex-col",l),"aria-label":r,tabIndex:-1,onFocus:m,onBlur:y},n.map(v=>e.createElement("button",{key:v.value,type:"button",className:o("relative flex items-center justify-center border rounded-lg transition-all duration-200 shadow-sm px-4 focus:outline-none focus:ring-2 focus:ring-[var(--primary-hover,#dbeafe)]",pe[M],u===v.value?"border-[var(--primary,#2563eb)] bg-[var(--primary-hover,#dbeafe)] text-[var(--primary,#2563eb)] ring-2 ring-[var(--primary-hover,#dbeafe)] shadow-md transform scale-[1.02]":"border-gray-200 bg-white text-gray-600 hover:border-[var(--primary,#2563eb)] hover:bg-[var(--primary-hover,#dbeafe)] hover:text-[var(--primary,#2563eb)] hover:shadow-md",F),"aria-pressed":u===v.value,"data-selected":u===v.value,tabIndex:0,onClick:()=>N(v.value),onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),N(v.value))}},v.icon&&e.createElement("span",{className:"mr-2 text-lg flex items-center"},v.icon),e.createElement("span",{className:"truncate font-medium"},v.label)))),h&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},h))});fe.displayName="RadioGroup";const ae=j.forwardRef(({children:t,className:r,as:n="div",...l},x)=>j.createElement(n,{ref:x,className:o("px-6 py-4 border-b","bg-[var(--card-header-bg,rgba(249,250,251,0.5))]","border-[var(--card-header-border,#e5e7eb)]","text-[var(--card-text,#111827)]",r),...l},t));ae.displayName="CardHeader";const re=j.forwardRef(({children:t,className:r,as:n="div",...l},x)=>j.createElement(n,{ref:x,className:o("px-6 py-4","flex-1","bg-[var(--card-bg,#ffffff)]","text-[var(--card-text,#111827)]",r),...l},t));re.displayName="CardBody";const ne=j.forwardRef(({children:t,className:r,as:n="div",...l},x)=>j.createElement(n,{ref:x,className:o("px-6 py-4 border-t","bg-[var(--card-footer-bg,rgba(249,250,251,0.5))]","border-[var(--card-footer-border,#e5e7eb)]","text-[var(--card-text,#111827)]",r),...l},t));ne.displayName="CardFooter";const he=j.forwardRef(({children:t,className:r,variant:n="default",size:l="md",padding:x="none",rounded:F="lg",...E},M)=>{const m={default:"bg-[var(--card-bg,#ffffff)] border border-[var(--card-border,#e5e7eb)] shadow-[var(--card-shadow-sm,0_1px_2px_0_rgb(0_0_0_/_0.05))]",outlined:"bg-[var(--card-bg,#ffffff)] border-2 border-[var(--primary,#2563eb)]",elevated:"bg-[var(--card-bg,#ffffff)] border border-[var(--card-border,#e5e7eb)] shadow-[var(--card-shadow-lg,0_10px_15px_-3px_rgb(0_0_0_/_0.1),_0_4px_6px_-4px_rgb(0_0_0_/_0.1))]",flat:"bg-[var(--card-bg,#ffffff)] border-0"},y={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"},C={none:"",sm:"p-3",md:"p-4",lg:"p-6"},f={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl"};return j.createElement("div",{ref:M,className:o("flex flex-col","overflow-hidden",m[n],y[l],C[x],f[F],r),...E},t)}),ye=Object.assign(he,{Header:ae,Body:re,Footer:ne});exports.AsyncSelect=ue;exports.Button=ge;exports.Card=ye;exports.CardBody=re;exports.CardFooter=ne;exports.CardHeader=ae;exports.Input=se;exports.MultiAsyncSelect=me;exports.MultiSelect=de;exports.RadioGroup=fe;exports.Select=ce;exports.Textarea=ie;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react"),A=require("react-hook-form");function we(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(r,a,n.get?n:{enumerable:!0,get:()=>t[a]})}}return r.default=t,Object.freeze(r)}const e=we(R);function ue(t){var r,a,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(r=0;r<s;r++)t[r]&&(a=ue(t[r]))&&(n&&(n+=" "),n+=a)}else for(a in t)t[a]&&(n&&(n+=" "),n+=a);return n}function Ee(){for(var t,r,a=0,n="",s=arguments.length;a<s;a++)(t=arguments[a])&&(r=ue(t))&&(n&&(n+=" "),n+=r);return n}function o(...t){return Ee(...t)}const Ne=({children:t,variant:r="default",className:a="",...n})=>{const s="px-4 py-2 rounded font-medium transition",C={default:"bg-[var(--primary,#2563eb)] text-[var(--primary-text,#fff)] hover:bg-[var(--primary-hover,#1d4ed8)]",outline:"border border-[var(--primary,#2563eb)] text-[var(--primary,#2563eb)] bg-white hover:bg-[var(--primary-hover,#e0e7ff)]",secondary:"bg-[var(--secondary,#fbbf24)] text-[var(--secondary-text,#222)] hover:bg-[var(--secondary-hover,#f59e42)]"};return R.createElement("button",{className:o(s,C[r],a),...n},t)},me=e.forwardRef(({name:t,className:r,type:a="text",label:n,onFocus:s,onBlur:C,Icon:p,iconClassName:T,iconAction:i,containerClassName:w,...E},b)=>{var I,v,l;const[N,h]=e.useState(!1),[d,m]=e.useState(!1),y=A.useFormContext(),k=y==null?void 0:y.control,c=y==null?void 0:y.register,F=k&&t?A.useWatch({control:k,name:t}):void 0,_=E.value??F??"",x=(l=(v=(I=y==null?void 0:y.formState)==null?void 0:I.errors)==null?void 0:v[t])==null?void 0:l.message,B=N||!!_,L=a==="password"?d?"text":"password":a,S=()=>e.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z",fill:"currentColor"})),M=()=>e.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z",fill:"currentColor"})),O=()=>{m(!d)};return e.createElement("div",{className:o("relative",w)},e.createElement("input",{id:E.id||t,type:L,className:o("peer flex h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 pt-6 pb-2 text-sm placeholder-transparent transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50",a==="password"||p?"pr-12":"",r),onFocus:f=>{h(!0),s&&s(f)},...y&&t?(()=>{const f=c(t),H=f.onBlur;return{...f,ref:z=>{typeof b=="function"?b(z):b&&(b.current=z),f.ref&&f.ref(z)},onBlur:z=>{h(!1),C&&C(z),H&&H(z)}}})():{ref:b,onBlur:f=>{h(!1),C&&C(f)}},...E}),n&&e.createElement("label",{htmlFor:E.id||t,className:o("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",B?"top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white":"top-3 scale-100 translate-y-0.5")},n),a==="password"&&e.createElement("button",{type:"button",className:"absolute top-1/2 right-3 -translate-y-1/2 text-gray-400 hover:text-[var(--primary,#2563eb)] transition-colors duration-200 focus:outline-none focus:text-[var(--primary,#2563eb)]",onClick:O,"aria-label":d?"Esconder senha":"Mostrar senha",tabIndex:-1},d?e.createElement(M,null):e.createElement(S,null)),p&&a!=="password"&&e.createElement("div",{className:o("absolute top-1/2 right-3 -translate-y-1/2 text-gray-400 cursor-pointer hover:text-[var(--primary,#2563eb)] transition-colors duration-200",T),onClick:i},e.createElement(p,null)),x&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},x))});me.displayName="Input";const fe=e.forwardRef(({name:t,label:r,options:a,className:n,containerClassName:s,isClearable:C,onFocus:p,onBlur:T,...i},w)=>{var S,M,O,I;const[E,b]=e.useState(!1),[N,h]=e.useState(!1),d=e.useRef(null),m=A.useFormContext(),y=m==null?void 0:m.control,k=y&&t?A.useWatch({control:y,name:t}):void 0,c=i.value??k??"",F=(O=(M=(S=m==null?void 0:m.formState)==null?void 0:S.errors)==null?void 0:M[t])==null?void 0:O.message,_=E||!!c;e.useEffect(()=>{const v=l=>{d.current&&!d.current.contains(l.target)&&(h(!1),b(!1))};return document.addEventListener("mousedown",v),()=>{document.removeEventListener("mousedown",v)}},[]);const x=()=>{h(v=>!v),b(!0)},B=v=>{b(!0),p&&p(v)},L=v=>{T&&T(v)};return e.createElement("div",{className:o("relative",s),ref:d},e.createElement("div",{id:i.id||t,tabIndex:0,role:"button","aria-haspopup":"listbox","aria-expanded":N,className:o("peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",n),onClick:x,onFocus:B,onBlur:L,ref:w},e.createElement("span",{className:o("block truncate",!c&&"text-gray-400")},((I=a.find(v=>v.value===c))==null?void 0:I.label)||!r&&"Selecione..."),C&&c&&e.createElement("button",{type:"button",tabIndex:-1,"aria-label":"Limpar seleção",className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",onClick:v=>{if(v.stopPropagation(),m&&t&&m.setValue(t,""),i.onChange){const l={target:{value:""}};i.onChange(l)}h(!1),b(!1)}},"✕")),r&&e.createElement("label",{htmlFor:i.id||t,className:o("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",_?"top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white":"top-3 scale-100 translate-y-0.5")},r),e.createElement("div",{className:o("absolute left-0 w-full mt-1 rounded-md shadow-lg bg-white z-20 transition-all duration-200 overflow-hidden",N?"border border-[var(--primary,#2563eb)] max-h-36 opacity-100 scale-100":"max-h-0 opacity-0 scale-95 pointer-events-none"),style:{maxHeight:N?"9.5rem":"0",overflowY:a.length>3?"auto":"hidden"}},a.map(v=>e.createElement("div",{key:v.value,className:o("px-3 py-2 cursor-pointer hover:bg-blue-50 text-sm",c===v.value&&"bg-blue-100"),onMouseDown:()=>{if(m&&t&&m.setValue(t,v.value),i.onChange){const l={target:{value:v.value}};i.onChange(l)}b(!0)}},v.label))),F&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},F))});fe.displayName="Select";const be=e.forwardRef(({name:t,className:r,label:a,onFocus:n,onBlur:s,Icon:C,iconClassName:p,iconAction:T,containerClassName:i,rows:w=4,...E},b)=>{var x,B,L;const[N,h]=e.useState(!1),d=A.useFormContext(),m=d==null?void 0:d.control,y=d==null?void 0:d.register,k=m&&t?A.useWatch({control:m,name:t}):void 0,c=E.value??k??"",F=(L=(B=(x=d==null?void 0:d.formState)==null?void 0:x.errors)==null?void 0:B[t])==null?void 0:L.message,_=N||!!c;return e.createElement("div",{className:o("relative",i)},e.createElement("textarea",{id:E.id||t,rows:w,className:o("peer flex min-h-[80px] w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 pt-6 pb-2 text-sm placeholder-transparent transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 resize-vertical",C?"pr-12":"",r),onFocus:S=>{h(!0),n&&n(S)},...d&&t?(()=>{const S=y(t),M=S.onBlur;return{...S,ref:O=>{typeof b=="function"?b(O):b&&(b.current=O),S.ref&&S.ref(O)},onBlur:O=>{h(!1),s&&s(O),M&&M(O)}}})():{ref:b,onBlur:S=>{h(!1),s&&s(S)}},...E}),a&&e.createElement("label",{htmlFor:E.id||t,className:o("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",_?"top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white":"top-3 scale-100 translate-y-0.5")},a),C&&e.createElement("div",{className:o("absolute top-3 right-3 text-gray-400 cursor-pointer hover:text-[var(--primary,#2563eb)] transition-colors duration-200",p),onClick:T},e.createElement(C,null)),F&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},F))});be.displayName="Textarea";const ve=e.forwardRef(({name:t,label:r,loadOptions:a,className:n,containerClassName:s,isClearable:C,defaultOptions:p=!1,loadingMessage:T="Carregando...",noOptionsMessage:i="Nenhuma opção encontrada",searchable:w=!1,debounceMs:E=300,onFocus:b,onBlur:N,...h},d)=>{var Y,U,G;const[m,y]=e.useState(!1),[k,c]=e.useState(!1),[F,_]=e.useState([]),[x,B]=e.useState(!1),[L,S]=e.useState(""),[M,O]=e.useState(""),I=e.useRef(null),v=e.useRef(null),l=A.useFormContext(),f=l==null?void 0:l.control,H=f&&t?A.useWatch({control:f,name:t}):void 0,z=h.value??H??"",W=(G=(U=(Y=l==null?void 0:l.formState)==null?void 0:Y.errors)==null?void 0:U[t])==null?void 0:G.message,q=m||!!z;e.useEffect(()=>{const g=setTimeout(()=>{O(L)},E);return()=>clearTimeout(g)},[L,E]),e.useEffect(()=>{(k||p&&F.length===0)&&$(w?M:void 0)},[M,k]),e.useEffect(()=>{p===!0?$():Array.isArray(p)&&_(p)},[]);const $=async g=>{try{B(!0);const P=await a(g);_(P)}catch(P){console.error("Error loading options:",P),_([])}finally{B(!1)}};e.useEffect(()=>{const g=P=>{I.current&&!I.current.contains(P.target)&&(c(!1),y(!1),S(""))};return document.addEventListener("mousedown",g),()=>{document.removeEventListener("mousedown",g)}},[]);const K=()=>{k||(c(!0),y(!0),w&&v.current&&setTimeout(()=>{var g;return(g=v.current)==null?void 0:g.focus()},0))},J=g=>{y(!0),b&&b(g)},D=g=>{N&&N(g)},Q=g=>{S(g.target.value)},Z=g=>{if(l&&t&&l.setValue(t,g),h.onChange){const P={target:{value:g}};h.onChange(P)}c(!1),y(!1),S("")},ee=g=>{if(g.stopPropagation(),l&&t&&l.setValue(t,""),h.onChange){const P={target:{value:""}};h.onChange(P)}c(!1),y(!1),S("")},j=F.find(g=>g.value===z),te=w&&k?L:(j==null?void 0:j.label)||"";return e.createElement("div",{className:o("relative",s),ref:I},e.createElement("div",{id:h.id||t,tabIndex:w?-1:0,role:"button","aria-haspopup":"listbox","aria-expanded":k,className:o("peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",n),onClick:K,onFocus:w?void 0:J,onBlur:w?void 0:D,ref:d},w?e.createElement("input",{ref:v,type:"text",value:te,onChange:Q,onFocus:J,onBlur:D,placeholder:r?"":"Selecione...",className:o("w-full bg-transparent border-none outline-none text-sm",!z&&!L&&"text-gray-400")}):e.createElement("span",{className:o("block truncate",!z&&"text-gray-400")},(j==null?void 0:j.label)||!r&&"Selecione..."),x&&e.createElement("div",{className:"absolute right-8 top-1/2 -translate-y-1/2"},e.createElement("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-[var(--primary,#2563eb)]"})),C&&z&&!x&&e.createElement("button",{type:"button",tabIndex:-1,"aria-label":"Limpar seleção",className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",onClick:ee},"✕")),r&&e.createElement("label",{htmlFor:h.id||t,className:o("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",q?"top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white":"top-3 scale-100 translate-y-0.5")},r),e.createElement("div",{className:o("absolute left-0 w-full mt-1 rounded-md shadow-lg bg-white z-20 transition-all duration-200 overflow-hidden",k?"border border-[var(--primary,#2563eb)] max-h-36 opacity-100 scale-100":"max-h-0 opacity-0 scale-95 pointer-events-none"),style:{maxHeight:k?"9.5rem":"0",overflowY:F.length>3?"auto":"hidden"}},x?e.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},T):F.length===0?e.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},i):F.map(g=>e.createElement("div",{key:g.value,className:o("px-3 py-2 cursor-pointer hover:bg-blue-50 text-sm",z===g.value&&"bg-blue-100"),onMouseDown:()=>Z(g.value)},g.label))),W&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},W))});ve.displayName="AsyncSelect";const xe=e.forwardRef(({name:t,label:r,options:a,className:n,containerClassName:s,isClearable:C,onFocus:p,onBlur:T,...i},w)=>{var O,I,v;const[E,b]=e.useState(!1),[N,h]=e.useState(!1),d=e.useRef(null),m=A.useFormContext(),y=m==null?void 0:m.control,k=y&&t?A.useWatch({control:y,name:t}):void 0,c=i.value??k??[],F=(v=(I=(O=m==null?void 0:m.formState)==null?void 0:O.errors)==null?void 0:I[t])==null?void 0:v.message,_=E||c&&c.length>0;e.useEffect(()=>{const l=f=>{d.current&&!d.current.contains(f.target)&&(h(!1),b(!1))};return document.addEventListener("mousedown",l),()=>{document.removeEventListener("mousedown",l)}},[]);const x=()=>{h(l=>!l),b(!0)},B=l=>{b(!0),p&&p(l)},L=l=>{T&&T(l)},S=l=>{var H;let f;c.includes(l)?f=c.filter(z=>z!==l):f=[...c,l],m&&t&&m.setValue(t,f),i.onChange&&((H=i.onChange)==null||H.call(i,{target:{value:f}})),b(!0)},M=l=>{var f;l.stopPropagation(),m&&t&&m.setValue(t,[]),i.onChange&&((f=i.onChange)==null||f.call(i,{target:{value:[]}})),h(!1),b(!1)};return e.createElement("div",{className:o("relative",s),ref:d},e.createElement("div",{id:i.id||t,tabIndex:0,role:"button","aria-haspopup":"listbox","aria-expanded":N,className:o("peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",n),onClick:x,onFocus:B,onBlur:L,ref:w},e.createElement("div",{className:"flex flex-nowrap gap-1 items-center min-h-[1.5rem] w-full overflow-x-auto",style:{scrollbarWidth:"none"}},c&&c.length>0?a.filter(l=>c.includes(l.value)).map(l=>e.createElement("span",{key:l.value,className:"flex items-center border border-blue-200 bg-blue-50 text-blue-700 rounded-2xl px-3 py-1 text-xs shadow-sm mr-1 gap-2",style:{maxWidth:"140px"}},e.createElement("span",{className:"truncate",title:l.label},l.label),e.createElement("button",{type:"button",className:"ml-1 text-[var(--primary,#2563eb)] hover:text-red-500 focus:outline-none w-4 h-4 flex items-center justify-center rounded-full transition-colors duration-150","aria-label":`Remover ${l.label}`,tabIndex:-1,onClick:f=>{f.stopPropagation();const H=c.filter(z=>z!==l.value);m&&t&&m.setValue(t,H),i.onChange&&i.onChange({target:{value:H}})}},e.createElement("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M3 3L9 9M9 3L3 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}))))):!r&&e.createElement("span",{className:"text-gray-400 text-sm"},"Selecione...")),C&&c&&c.length>0&&e.createElement("button",{type:"button",tabIndex:-1,"aria-label":"Limpar seleção",className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",onClick:M},"✕")),r&&e.createElement("label",{htmlFor:i.id||t,className:o("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",_?"top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white":"top-3 scale-100 translate-y-0.5")},r),e.createElement("div",{className:o("absolute left-0 w-full mt-1 rounded-md shadow-lg bg-white z-20 transition-all duration-200 overflow-hidden",N?"border border-[var(--primary,#2563eb)] max-h-36 opacity-100 scale-100":"max-h-0 opacity-0 scale-95 pointer-events-none"),style:{maxHeight:N?"9.5rem":"0",overflowY:a.length>3?"auto":"hidden"}},a.map(l=>e.createElement("div",{key:l.value,className:o("px-3 py-2 cursor-pointer hover:bg-blue-50 text-sm flex items-center gap-2",c.includes(l.value)&&"bg-blue-100 font-semibold"),onMouseDown:()=>S(l.value)},e.createElement("input",{type:"checkbox",checked:c.includes(l.value),readOnly:!0,className:"accent-blue-500"}),l.label))),F&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},F))});xe.displayName="MultiSelect";const ge=e.forwardRef(({name:t,label:r,loadOptions:a,className:n,containerClassName:s,isClearable:C,defaultOptions:p=!1,loadingMessage:T="Carregando...",noOptionsMessage:i="Nenhuma opção encontrada",searchable:w=!1,debounceMs:E=300,maxSelectedDisplay:b=3,onFocus:N,onBlur:h,...d},m)=>{var g,P,de;const[y,k]=e.useState(!1),[c,F]=e.useState(!1),[_,x]=e.useState([]),[B,L]=e.useState(!1),[S,M]=e.useState(""),[O,I]=e.useState(""),v=e.useRef(null),l=e.useRef(null),f=A.useFormContext(),H=f==null?void 0:f.control,z=H&&t?A.useWatch({control:H,name:t}):void 0,W=d.value??z??[],q=(de=(P=(g=f==null?void 0:f.formState)==null?void 0:g.errors)==null?void 0:P[t])==null?void 0:de.message,$=y||W&&W.length>0;e.useEffect(()=>{const u=setTimeout(()=>{I(S)},E);return()=>clearTimeout(u)},[S,E]),e.useEffect(()=>{(c||p&&_.length===0)&&K(w?O:void 0)},[O,c]),e.useEffect(()=>{p===!0?K():Array.isArray(p)&&x(p)},[]);const K=async u=>{try{L(!0);const V=await a(u);x(V)}catch(V){console.error("Error loading options:",V),x([])}finally{L(!1)}};e.useEffect(()=>{const u=V=>{v.current&&!v.current.contains(V.target)&&(F(!1),k(!1),M(""))};return document.addEventListener("mousedown",u),()=>{document.removeEventListener("mousedown",u)}},[]);const J=()=>{c||(F(!0),k(!0),w&&l.current&&setTimeout(()=>{var u;return(u=l.current)==null?void 0:u.focus()},0))},D=u=>{k(!0),N&&N(u)},Q=u=>{h&&h(u)},Z=u=>{M(u.target.value)},ee=u=>{let V;W.includes(u)?V=W.filter(X=>X!==u):V=[...W,u],f&&t&&f.setValue(t,V),d.onChange&&d.onChange({target:{value:V}}),k(!0)},j=(u,V)=>{V.stopPropagation();const X=W.filter(ye=>ye!==u);f&&t&&f.setValue(t,X),d.onChange&&d.onChange({target:{value:X}})},te=u=>{u.stopPropagation(),f&&t&&f.setValue(t,[]),d.onChange&&d.onChange({target:{value:[]}}),F(!1),k(!1),M("")},Y=_.filter(u=>W.includes(u.value)),U=Y.slice(0,b),G=Y.length-b;return e.createElement("div",{className:o("relative",s),ref:v},e.createElement("div",{id:d.id||t,tabIndex:w?-1:0,role:"button","aria-haspopup":"listbox","aria-expanded":c,className:o("peer flex items-center min-h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-2 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",n),onClick:J,onFocus:w?void 0:D,onBlur:w?void 0:Q,ref:m},e.createElement("div",{className:"flex flex-wrap gap-1 items-center min-h-[1.5rem] w-full"},U.map(u=>e.createElement("span",{key:u.value,className:"flex items-center border border-blue-200 bg-blue-50 text-blue-700 rounded-2xl px-3 py-1 text-xs shadow-sm gap-2",style:{maxWidth:"140px"}},e.createElement("span",{className:"truncate",title:u.label},u.label),e.createElement("button",{type:"button",className:"ml-1 text-[var(--primary,#2563eb)] hover:text-red-500 focus:outline-none w-4 h-4 flex items-center justify-center rounded-full transition-colors duration-150","aria-label":`Remover ${u.label}`,tabIndex:-1,onClick:V=>j(u.value,V)},e.createElement("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M3 3L9 9M9 3L3 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}))))),G>0&&e.createElement("span",{className:"flex items-center border border-gray-200 bg-gray-100 text-gray-600 rounded-2xl px-3 py-1 text-xs"},"+",G," mais"),w?e.createElement("input",{ref:l,type:"text",value:S,onChange:Z,onFocus:D,onBlur:Q,placeholder:W.length===0&&!r?"Selecione...":"",className:"flex-1 min-w-[120px] bg-transparent border-none outline-none text-sm"}):W.length===0&&!r&&e.createElement("span",{className:"text-gray-400 text-sm"},"Selecione...")),B&&e.createElement("div",{className:"absolute right-8 top-1/2 -translate-y-1/2"},e.createElement("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-[var(--primary,#2563eb)]"})),C&&W&&W.length>0&&!B&&e.createElement("button",{type:"button",tabIndex:-1,"aria-label":"Limpar seleção",className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",onClick:te},"✕")),r&&e.createElement("label",{htmlFor:d.id||t,className:o("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",$?"top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white":"top-3 scale-100 translate-y-0.5")},r),e.createElement("div",{className:o("absolute left-0 w-full mt-1 rounded-md shadow-lg bg-white z-20 transition-all duration-200 overflow-hidden",c?"border border-[var(--primary,#2563eb)] max-h-36 opacity-100 scale-100":"max-h-0 opacity-0 scale-95 pointer-events-none"),style:{maxHeight:c?"9.5rem":"0",overflowY:_.length>3?"auto":"hidden"}},B?e.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},T):_.length===0?e.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},i):_.map(u=>e.createElement("div",{key:u.value,className:o("px-3 py-2 cursor-pointer hover:bg-blue-50 text-sm flex items-center gap-2",W.includes(u.value)&&"bg-blue-100 font-semibold"),onMouseDown:()=>ee(u.value)},e.createElement("input",{type:"checkbox",checked:W.includes(u.value),readOnly:!0,className:"accent-blue-500"}),u.label))),q&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},q))});ge.displayName="MultiAsyncSelect";const Ce={sm:"h-10 text-sm px-3",md:"h-12 text-base px-4",lg:"h-16 text-lg px-6"},pe=e.forwardRef(({name:t,label:r,options:a,className:n,containerClassName:s,optionClassName:C,direction:p="row",size:T="md",onFocus:i,onBlur:w,...E},b)=>{var c,F,_;const N=A.useFormContext(),h=N==null?void 0:N.control,d=h&&t?A.useWatch({control:h,name:t}):void 0,m=E.value??d??"",y=(_=(F=(c=N==null?void 0:N.formState)==null?void 0:c.errors)==null?void 0:F[t])==null?void 0:_.message,k=x=>{N&&t&&N.setValue(t,x),E.onChange&&E.onChange({target:{value:x}})};return e.createElement("div",{className:o("relative",s),ref:b},r&&e.createElement("label",{htmlFor:t,className:o("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm transition-all duration-200","top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white")},r),e.createElement("div",{className:o("flex gap-2 w-full pt-6",p==="row"?"flex-row":"flex-col",n),"aria-label":r,tabIndex:-1,onFocus:i,onBlur:w},a.map(x=>e.createElement("button",{key:x.value,type:"button",className:o("relative flex items-center justify-center border rounded-lg transition-all duration-200 shadow-sm px-4 focus:outline-none focus:ring-2 focus:ring-[var(--primary-hover,#dbeafe)]",Ce[T],m===x.value?"border-[var(--primary,#2563eb)] bg-[var(--primary-hover,#dbeafe)] text-[var(--primary,#2563eb)] ring-2 ring-[var(--primary-hover,#dbeafe)] shadow-md transform scale-[1.02]":"border-gray-200 bg-white text-gray-600 hover:border-[var(--primary,#2563eb)] hover:bg-[var(--primary-hover,#dbeafe)] hover:text-[var(--primary,#2563eb)] hover:shadow-md",C),"aria-pressed":m===x.value,"data-selected":m===x.value,tabIndex:0,onClick:()=>k(x.value),onKeyDown:B=>{(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),k(x.value))}},x.icon&&e.createElement("span",{className:"mr-2 text-lg flex items-center"},x.icon),e.createElement("span",{className:"truncate font-medium"},x.label)))),y&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},y))});pe.displayName="RadioGroup";const ae=R.forwardRef(({children:t,className:r,as:a="div",...n},s)=>R.createElement(a,{ref:s,className:o("px-6 py-4 border-b","bg-[var(--card-header-bg,rgba(249,250,251,0.5))]","border-[var(--card-header-border,#e5e7eb)]","text-[var(--card-text,#111827)]",r),...n},t));ae.displayName="CardHeader";const re=R.forwardRef(({children:t,className:r,as:a="div",...n},s)=>R.createElement(a,{ref:s,className:o("px-6 py-4","flex-1","bg-[var(--card-bg,#ffffff)]","text-[var(--card-text,#111827)]",r),...n},t));re.displayName="CardBody";const ne=R.forwardRef(({children:t,className:r,as:a="div",...n},s)=>R.createElement(a,{ref:s,className:o("px-6 py-4 border-t","bg-[var(--card-footer-bg,rgba(249,250,251,0.5))]","border-[var(--card-footer-border,#e5e7eb)]","text-[var(--card-text,#111827)]",r),...n},t));ne.displayName="CardFooter";const ke=R.forwardRef(({children:t,className:r,variant:a="default",size:n="md",padding:s="none",rounded:C="lg",constrainWidth:p=!1,...T},i)=>{const w={default:"bg-[var(--card-bg,#ffffff)] border border-[var(--card-border,#e5e7eb)] shadow-[var(--card-shadow-sm,0_1px_2px_0_rgb(0_0_0_/_0.05))]",outlined:"bg-[var(--card-bg,#ffffff)] border-2 border-[var(--primary,#2563eb)]",elevated:"bg-[var(--card-bg,#ffffff)] border border-[var(--card-border,#e5e7eb)] shadow-[var(--card-shadow-lg,0_10px_15px_-3px_rgb(0_0_0_/_0.1),_0_4px_6px_-4px_rgb(0_0_0_/_0.1))]",flat:"bg-[var(--card-bg,#ffffff)] border-0"},E={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"},b={none:"",sm:"p-3",md:"p-4",lg:"p-6"},N={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl"};return R.createElement("div",{ref:i,className:o("flex flex-col","overflow-hidden",w[a],p&&E[n],b[s],N[C],r),...T},t)}),Se=Object.assign(ke,{Header:ae,Body:re,Footer:ne}),he=R.forwardRef(({children:t,className:r,variant:a="default",size:n="md",responsive:s=!1,stickyHeader:C=!1,...p},T)=>{const i=o("w-full border-collapse bg-[var(--table-bg)] text-[var(--table-text)]",{"border border-[var(--table-border)]":a==="bordered"},{"text-sm":n==="sm","text-base":n==="md","text-lg":n==="lg"},r),w=o({"overflow-x-auto":s,"max-h-96 overflow-y-auto":C}),E=R.createElement("table",{ref:T,className:i,...p},t);return s||C?R.createElement("div",{className:w},E):E}),le=R.forwardRef(({children:t,className:r,as:a="thead",...n},s)=>R.createElement(a,{ref:s,className:o("border-b border-[var(--table-border)] bg-[var(--table-header-bg)]",{"sticky top-0 z-10":a==="thead"},r),...n},t)),oe=R.forwardRef(({children:t,className:r,as:a="tbody",...n},s)=>R.createElement(a,{ref:s,className:o("[&_tr:nth-child(odd)]:bg-[var(--table-row-odd)]","[&_tr:nth-child(even)]:bg-[var(--table-row-even)]",r),...n},t)),se=R.forwardRef(({children:t,className:r,as:a="tfoot",...n},s)=>R.createElement(a,{ref:s,className:o("border-t border-[var(--table-border)] bg-[var(--table-header-bg)] font-medium",r),...n},t)),ce=R.forwardRef(({children:t,className:r,variant:a="default",...n},s)=>R.createElement("tr",{ref:s,className:o("border-b border-[var(--table-border)] transition-colors",{"hover:bg-[var(--table-row-hover)]":a==="hover","bg-[var(--table-row-selected)]":a==="selected"},r),...n},t)),ie=R.forwardRef(({children:t,className:r,as:a="td",align:n="left",scope:s,colSpan:C,rowSpan:p,...T},i)=>R.createElement(a,{ref:i,scope:a==="th"?s:void 0,colSpan:C,rowSpan:p,className:o("px-4 py-3 text-left",{"font-semibold":a==="th","text-sm":a==="td","text-center":n==="center","text-right":n==="right"},r),...T},t));he.displayName="Table";le.displayName="TableHeader";oe.displayName="TableBody";se.displayName="TableFooter";ce.displayName="TableRow";ie.displayName="TableCell";const Fe=Object.assign(he,{Header:le,Body:oe,Footer:se,Row:ce,Cell:ie});exports.AsyncSelect=ve;exports.Button=Ne;exports.Card=Se;exports.CardBody=re;exports.CardFooter=ne;exports.CardHeader=ae;exports.Input=me;exports.MultiAsyncSelect=ge;exports.MultiSelect=xe;exports.RadioGroup=pe;exports.Select=fe;exports.Table=Fe;exports.TableBody=oe;exports.TableCell=ie;exports.TableFooter=se;exports.TableHeader=le;exports.TableRow=ce;exports.Textarea=be;
|