vicdev-ui-lib 1.0.0 → 1.0.1

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
@@ -53,40 +53,100 @@ Este script:
53
53
 
54
54
  ## 🎨 Configuración del Tema
55
55
 
56
- ### 1. Configurar Tailwind CSS
56
+ **Los componentes leen automáticamente las variables CSS de tu proyecto.** Solo necesitas definir las variables CSS en tu archivo CSS global.
57
57
 
58
- #### Para Tailwind CSS v4
58
+ ### Opción 1: Usar tus propias variables CSS (Recomendado)
59
59
 
60
- En Tailwind CSS v4, la configuración se hace directamente en CSS:
60
+ Define las variables CSS en tu archivo CSS global y los componentes las usarán automáticamente:
61
61
 
62
62
  ```css
63
63
  /* src/index.css */
64
64
  @import "tailwindcss";
65
65
 
66
- @theme {
67
- --color-primary: #3b82f6;
68
- --color-primary-foreground: #f8fafc;
69
- /* ... más colores (en formato hexadecimal) ... */
66
+ :root {
67
+ --primary: #3b82f6;
68
+ --primary-foreground: #ffffff;
69
+ --secondary: #f1f5f9;
70
+ --secondary-foreground: #0f172a;
71
+ --background: #ffffff;
72
+ --foreground: #0f172a;
73
+ --card: #ffffff;
74
+ --card-foreground: #0f172a;
75
+ --border: #e2e8f0;
76
+ --input: #e2e8f0;
77
+ --ring: #3b82f6;
78
+ --muted: #f1f5f9;
79
+ --muted-foreground: #64748b;
80
+ --popover: #ffffff;
81
+ --popover-foreground: #0f172a;
82
+ --radio: #e2e8f0;
83
+ --radio-foreground: #0f172a;
84
+ /* ... más variables según necesites ... */
70
85
  }
86
+ ```
71
87
 
72
- :root {
73
- --primary: var(--color-primary);
74
- --primary-foreground: var(--color-primary-foreground);
75
- /* ... más variables ... */
88
+ ```tsx
89
+ // App.tsx - No necesitas ThemeProvider
90
+ import { ActionButton, Modal } from 'vicdev-ui-lib';
91
+ import './index.css'; // Importar tu CSS con las variables
92
+
93
+ function App() {
94
+ return (
95
+ <div>
96
+ <ActionButton variant="primary" label="Click me" />
97
+ {/* Los componentes usan automáticamente tus variables CSS */}
98
+ </div>
99
+ );
76
100
  }
77
101
  ```
78
102
 
79
- O usa el helper de la biblioteca:
103
+ ### Opción 2: Usar ThemeProvider (Opcional)
104
+
105
+ Si prefieres configurar el tema desde JavaScript o cambiar el tema dinámicamente:
80
106
 
81
107
  ```tsx
82
- import { generateTailwindV4CSS, createTheme } from 'vicdev-ui-lib';
108
+ import { ThemeProvider, createTheme } from 'vicdev-ui-lib';
109
+
110
+ const customTheme = createTheme({
111
+ primary: '#3b82f6',
112
+ primaryForeground: '#f8fafc',
113
+ destructive: '#ef4444',
114
+ // ... personaliza más colores según necesites (en formato hexadecimal)
115
+ });
83
116
 
84
- const theme = createTheme({ /* tus colores */ });
85
- const css = generateTailwindV4CSS(theme.colors);
86
- // Inyecta el CSS en tu aplicación
117
+ function App() {
118
+ return (
119
+ <ThemeProvider theme={customTheme} injectCSS={true}>
120
+ {/* injectCSS={true} inyecta las variables CSS automáticamente */}
121
+ {/* Tu aplicación */}
122
+ </ThemeProvider>
123
+ );
124
+ }
87
125
  ```
88
126
 
89
- Ver `tailwind.v4.css.example` para un ejemplo completo.
127
+ **Opciones del ThemeProvider:**
128
+ - `theme` (opcional): Configuración del tema
129
+ - `injectCSS` (opcional, por defecto: `true`): Si es `false`, solo mantiene el contexto sin inyectar CSS (útil si ya tienes las variables en tu CSS global)
130
+
131
+ ### Configurar Tailwind CSS
132
+
133
+ #### Para Tailwind CSS v4
134
+
135
+ ```css
136
+ /* src/index.css */
137
+ @import "tailwindcss";
138
+
139
+ :root {
140
+ --primary: #3b82f6;
141
+ /* ... más variables ... */
142
+ }
143
+
144
+ @theme inline {
145
+ --color-primary: var(--primary);
146
+ --color-primary-foreground: var(--primary-foreground);
147
+ /* ... mapear todas las variables a Tailwind ... */
148
+ }
149
+ ```
90
150
 
91
151
  #### Para Tailwind CSS v3
92
152
 
@@ -105,34 +165,7 @@ module.exports = {
105
165
  };
106
166
  ```
107
167
 
108
- Ver [THEME.md](./THEME.md) para más detalles.
109
-
110
- ### 2. Configurar el ThemeProvider
111
-
112
- Envuelve tu aplicación con el `ThemeProvider`:
113
-
114
- ```tsx
115
- import { ThemeProvider, createTheme } from 'vicdev-ui-lib';
116
- import { generateCSSVariables } from 'vicdev-ui-lib';
117
-
118
- const customTheme = createTheme({
119
- primary: '#3b82f6',
120
- primaryForeground: '#f8fafc',
121
- destructive: '#ef4444',
122
- // ... personaliza más colores según necesites (en formato hexadecimal)
123
- });
124
-
125
- function App() {
126
- return (
127
- <>
128
- <style>{generateCSSVariables(customTheme)}</style>
129
- <ThemeProvider theme={customTheme}>
130
- {/* Tu aplicación */}
131
- </ThemeProvider>
132
- </>
133
- );
134
- }
135
- ```
168
+ Ver [THEME.md](./THEME.md) para documentación completa del sistema de tema.
136
169
 
137
170
  ## 📚 Componentes Disponibles
138
171
 
@@ -1,34 +1,34 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),v=require("react"),F=require("framer-motion"),m=require("lucide-react"),K=require("react-dom"),X=require("primereact/datatable"),G=require("primereact/column"),T={primary:"#0f172a",primaryForeground:"#f8fafc",secondary:"#f1f5f9",secondaryForeground:"#0f172a",accent:"#f1f5f9",accentForeground:"#0f172a",destructive:"#ef4444",destructiveForeground:"#f8fafc",background:"#ffffff",foreground:"#0f172a",card:"#ffffff",cardForeground:"#0f172a",border:"#e2e8f0",input:"#e2e8f0",ring:"#0f172a",muted:"#f1f5f9",mutedForeground:"#64748b",popover:"#ffffff",popoverForeground:"#0f172a",radio:"#e2e8f0",radioForeground:"#0f172a"},R={colors:T,name:"default",description:"Tema por defecto de vicdev-ui-lib"};function H(r){return{colors:{...T,...r},name:"custom"}}function Z(r){const{colors:t}=r;return`:root {
2
- ${Object.entries(t).map(([s,n])=>` --${s.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${n};`).join(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),x=require("react"),$=require("framer-motion"),f=require("lucide-react"),G=require("react-dom"),Y=require("primereact/datatable"),J=require("primereact/column"),T={primary:"#0f172a",primaryForeground:"#f8fafc",secondary:"#f1f5f9",secondaryForeground:"#0f172a",accent:"#f1f5f9",accentForeground:"#0f172a",destructive:"#ef4444",destructiveForeground:"#f8fafc",background:"#ffffff",foreground:"#0f172a",card:"#ffffff",cardForeground:"#0f172a",border:"#e2e8f0",input:"#e2e8f0",ring:"#0f172a",muted:"#f1f5f9",mutedForeground:"#64748b",popover:"#ffffff",popoverForeground:"#0f172a",radio:"#e2e8f0",radioForeground:"#0f172a"},B={colors:T,name:"default",description:"Tema por defecto de vicdev-ui-lib"};function Q(t){return{colors:{...T,...t},name:"custom"}}function U(t){const{colors:r}=t;return`:root {
2
+ ${Object.entries(r).map(([s,o])=>` --${s.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${o};`).join(`
3
3
  `)}
4
- }`}const z=v.createContext(void 0);function Y({theme:r=R,children:t}){const[o,s]=v.useState(r),n={theme:o,setTheme:s};return e.jsx(z.Provider,{value:n,children:t})}function J(){const r=v.useContext(z);if(r===void 0)throw new Error("useTheme debe ser usado dentro de un ThemeProvider");return r}function V(r){const t={...T,...r};return{primary:{DEFAULT:t.primary,foreground:t.primaryForeground},secondary:{DEFAULT:t.secondary,foreground:t.secondaryForeground},accent:{DEFAULT:t.accent,foreground:t.accentForeground},destructive:{DEFAULT:t.destructive,foreground:t.destructiveForeground},background:t.background,foreground:t.foreground,card:{DEFAULT:t.card,foreground:t.cardForeground},border:t.border,input:t.input,ring:t.ring,muted:{DEFAULT:t.muted,foreground:t.mutedForeground},popover:{DEFAULT:t.popover,foreground:t.popoverForeground},radio:{DEFAULT:t.radio,foreground:t.radioForeground}}}function Q(r){return{extend:{colors:V(r),borderRadius:{lg:"var(--radius)",md:"calc(var(--radius) - 2px)",sm:"calc(var(--radius) - 4px)"}}}}function U(r){const t={...T,...r};return`@theme {
5
- ${Object.entries(t).map(([s,n])=>` --color-${s.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${n};`).join(`
4
+ }`}const R=x.createContext(void 0);function O({theme:t=B,children:r,injectCSS:n=!0}){const[s,o]=x.useState(t);x.useEffect(()=>{if(n&&typeof document<"u"){let l=document.getElementById("vicdev-ui-theme-variables");return l||(l=document.createElement("style"),l.id="vicdev-ui-theme-variables",document.head.appendChild(l)),l.textContent=U(s),()=>{}}},[s,n]),x.useEffect(()=>{o(t)},[t]);const a={theme:s,setTheme:o};return e.jsx(R.Provider,{value:a,children:r})}function ee(){return x.useContext(R)}const z=x.createContext(void 0);function te({config:t={},children:r}){const n=x.useMemo(()=>({theme:t.theme,injectCSS:t.injectCSS??!0,modalZIndex:t.modalZIndex??0,toastZIndex:t.toastZIndex??0,animationDuration:t.animationDuration??300,enableAnimations:t.enableAnimations??!0,components:{modal:{defaultSize:t.components?.modal?.defaultSize??"lg"},button:{defaultVariant:t.components?.button?.defaultVariant??"primary"},toast:{defaultDuration:t.components?.toast?.defaultDuration??3e3,position:t.components?.toast?.position??"top-right"}}}),[t]),s=x.useMemo(()=>({config:n,updateConfig:o=>{console.warn("updateConfig: Esta funcionalidad está en desarrollo")}}),[n]);return e.jsx(z.Provider,{value:s,children:e.jsx(O,{theme:t.theme,injectCSS:t.injectCSS,children:r})})}function _(){return x.useContext(z)}function W(t){const r={...T,...t};return{primary:{DEFAULT:r.primary,foreground:r.primaryForeground},secondary:{DEFAULT:r.secondary,foreground:r.secondaryForeground},accent:{DEFAULT:r.accent,foreground:r.accentForeground},destructive:{DEFAULT:r.destructive,foreground:r.destructiveForeground},background:r.background,foreground:r.foreground,card:{DEFAULT:r.card,foreground:r.cardForeground},border:r.border,input:r.input,ring:r.ring,muted:{DEFAULT:r.muted,foreground:r.mutedForeground},popover:{DEFAULT:r.popover,foreground:r.popoverForeground},radio:{DEFAULT:r.radio,foreground:r.radioForeground}}}function re(t){return{extend:{colors:W(t),borderRadius:{lg:"var(--radius)",md:"calc(var(--radius) - 2px)",sm:"calc(var(--radius) - 4px)"}}}}function Z(t){const r={...T,...t};return`@theme {
5
+ ${Object.entries(r).map(([s,o])=>` --color-${s.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${o};`).join(`
6
6
  `)}
7
7
 
8
8
  /* Border radius */
9
9
  --radius: 0.5rem;
10
- }`}function I(r){const t={...T,...r};return`:root {
11
- ${Object.entries(t).map(([s])=>{const n=s.replace(/([A-Z])/g,"-$1").toLowerCase(),a=`color-${n}`;return` --${n}: var(--${a});`}).join(`
10
+ }`}function q(t){const r={...T,...t};return`:root {
11
+ ${Object.entries(r).map(([s])=>{const o=s.replace(/([A-Z])/g,"-$1").toLowerCase(),a=`color-${o}`;return` --${o}: var(--${a});`}).join(`
12
12
  `)}
13
- }`}function ee(r){const t=U(r),o=I(r);return`${t}
13
+ }`}function se(t){const r=Z(t),n=q(t);return`${r}
14
14
 
15
- ${o}`}const B={primary:"bg-primary text-primary-foreground hover:bg-primary/90 font-bold shadow-lg",secondary:"bg-white border-2 border-border/20 text-foreground hover:border-border/40 hover:bg-card shadow-sm",accent:"bg-gradient-to-r from-accent to-accent/90 text-accent-foreground hover:shadow-lg",danger:"bg-destructive text-destructive-foreground hover:bg-destructive/90 border-0 shadow-lg hover:shadow-destructive/25",outline:"border-2 border-border/30 text-foreground hover:bg-card hover:border-border/50",ghost:"text-foreground hover:bg-card hover:text-primary",success:"bg-green-500 text-white hover:bg-green-600 hover:shadow-green-400/20"},P=({onClick:r,icon:t,label:o,variant:s="primary",type:n="button",className:a="",disabled:c=!1,children:l,...d})=>e.jsxs("button",{onClick:r,type:n,disabled:c,className:`
15
+ ${n}`}const M={primary:"bg-primary text-primary-foreground hover:bg-primary/90 font-bold shadow-lg",secondary:"bg-white border-2 border-border/20 text-foreground hover:border-border/40 hover:bg-card shadow-sm",accent:"bg-gradient-to-r from-accent to-accent/90 text-accent-foreground hover:shadow-lg",danger:"bg-destructive text-destructive-foreground hover:bg-destructive/90 border-0 shadow-lg hover:shadow-destructive/25",outline:"border-2 border-border/30 text-foreground hover:bg-card hover:border-border/50",ghost:"text-foreground hover:bg-card hover:text-primary",success:"bg-green-500 text-white hover:bg-green-600 hover:shadow-green-400/20"},P=({onClick:t,icon:r,label:n,variant:s="primary",type:o="button",className:a="",disabled:l=!1,children:c,...d})=>e.jsxs("button",{onClick:t,type:o,disabled:l,className:`
16
16
  flex items-center justify-center px-4 py-3 rounded-xl font-semibold text-sm
17
17
  transition-all duration-300 hover:scale-[1.02] active:scale-[0.98] group
18
- disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:scale-100
19
- ${B[s]??B.primary} ${a}
20
- `,...d,children:[t&&e.jsx(t,{size:20,className:`${o?"mr-2":""} ${c?"":"group-hover:rotate-12"} transition-transform duration-300`}),o,l]}),O={sm:"max-w-sm",md:"max-w-md",lg:"max-w-2xl",xl:"max-w-4xl",full:"max-w-[90vw]",fullscreen:"w-[95vw] h-[95vh]"};function _({isOpen:r,onClose:t,title:o="",tamaño:s="lg",children:n,canClose:a=!0}){const c=e.jsx(F.AnimatePresence,{children:r&&e.jsxs(e.Fragment,{children:[e.jsx(F.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[99998]"}),e.jsx(F.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:`fixed inset-0 z-[99999] bg-black/60 backdrop-blur-sm flex items-center justify-center ${s==="fullscreen"?"p-2":"p-4"} ${a?"":"cursor-not-allowed"}`,onClick:a?t:l=>l.stopPropagation(),children:e.jsxs(F.motion.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},transition:{type:"spring",damping:20,stiffness:300},className:`
21
- bg-background shadow-2xl w-full overflow-hidden relative border border-border/50
22
- ${s==="fullscreen"?"rounded-none h-[95vh]":"rounded-2xl max-h-[95vh]"}
23
- ${O[s]||O.md}
24
- `,onClick:l=>l.stopPropagation(),children:[e.jsxs("div",{className:"bg-gradient-to-r from-primary to-secondary p-4 flex justify-between items-center sticky top-0 z-10 border-b border-primary-foreground/20",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 bg-primary-foreground/20 rounded-lg flex items-center justify-center",children:e.jsx("div",{className:"w-4 h-4 bg-primary-foreground rounded-full"})}),e.jsx("h2",{className:"text-lg font-bold text-primary-foreground",children:o})]}),a?e.jsx("button",{onClick:t,className:"text-primary-foreground hover:text-primary-foreground/80 hover:bg-primary-foreground/10 p-2 rounded-lg transition-all duration-200",children:e.jsx(m.X,{size:24})}):e.jsx("div",{className:"w-10 h-10 flex items-center justify-center",children:e.jsx("div",{className:"w-5 h-5 border-2 border-primary-foreground/30 border-t-primary-foreground rounded-full animate-spin"})})]}),e.jsx("div",{className:`overflow-y-auto bg-gradient-to-b from-background to-card/30 ${s==="fullscreen"?"p-8 h-[calc(95vh-100px)]":"p-6 max-h-[calc(95vh-100px)]"}`,children:n})]})})]})});return typeof window<"u"?K.createPortal(c,document.body):c}const re=({isOpen:r,onClose:t,onConfirm:o,loading:s=!1,entidad:n})=>{if(!r)return null;const{tipo:a="elemento",nombre:c="",dependencias:l=0,nombreDependencia:d=""}=n||{};return e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-background rounded-2xl shadow-2xl max-w-md w-full p-6 transform transition-all",children:[e.jsx("div",{className:"flex items-center justify-center w-16 h-16 mx-auto mb-4 bg-destructive/10 rounded-full",children:e.jsx(m.AlertTriangle,{className:"w-8 h-8 text-destructive"})}),e.jsxs("h3",{className:"text-xl font-bold text-foreground text-center mb-2",children:["¿Eliminar ",a,"?"]}),e.jsxs("p",{className:"text-muted-foreground text-center mb-6",children:["Esta acción eliminará ",a==="producto"?"el":"la"," ",e.jsxs("strong",{children:[a,' "',c,'"']}),l>0&&d?e.jsxs(e.Fragment,{children:[" y afectará a ",e.jsxs("strong",{children:[l," ",d]}),"."]}):null,e.jsx("br",{}),"Esta acción no se puede deshacer."]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{onClick:()=>t(!1),className:"flex-1 px-4 py-3 border border-border text-foreground rounded-xl hover:bg-card transition-colors",children:"Cancelar"}),e.jsx("button",{onClick:o,disabled:s,className:`flex-1 px-4 py-3 ${s?"bg-destructive/70":"bg-destructive hover:bg-destructive/90"} text-destructive-foreground rounded-xl transition-colors`,children:s?"Cargando...":"Eliminar"})]})]})})},te={success:{container:"bg-primary/10 border-primary/30 text-primary",icon:m.CheckCircle},error:{container:"bg-destructive/10 border-destructive/30 text-destructive",icon:m.XCircle},info:{container:"bg-blue-500/10 border-blue-500/30 text-blue-600 dark:text-blue-400",icon:m.Info},warning:{container:"bg-amber-500/10 border-amber-500/30 text-amber-700 dark:text-amber-400",icon:m.AlertTriangle}};function se({message:r,variant:t="info",open:o,onClose:s,autoClose:n,className:a=""}){const{container:c,icon:l}=te[t];return v.useEffect(()=>{if(!o||!n)return;const d=setTimeout(s,n);return()=>clearTimeout(d)},[o,n,s]),o?e.jsxs("div",{role:"alert",className:`fixed top-20 right-4 z-[9999] max-w-md flex items-center gap-3 px-4 py-3 rounded-xl border shadow-xl shadow-black/10 dark:shadow-black/30 animate-in slide-in-from-top-5 fade-in duration-300 ${c} ${a}`,children:[e.jsx(l,{className:"w-5 h-5 shrink-0","aria-hidden":!0}),e.jsx("p",{className:"font-medium flex-1",children:r}),e.jsx("button",{type:"button",onClick:s,className:"shrink-0 p-1 rounded-lg hover:bg-black/5 dark:hover:bg-white/5 transition-colors focus:outline-none focus:ring-2 focus:ring-ring","aria-label":"Cerrar",children:e.jsx(m.X,{className:"w-4 h-4"})})]}):null}const ne="No hay registros para mostrar.",oe=10,ae=[10,25,50];function ie({value:r,columns:t,dataKey:o,emptyMessage:s=ne,loading:n=!1,paginator:a=!1,rows:c=oe,rowsPerPageOptions:l=ae,size:d="normal",stripedRows:f=!1,showGridlines:h=!1,className:x,style:g}){const b=t.filter(i=>!i.hidden);return e.jsx("div",{className:`data-table-viva overflow-hidden rounded-lg border border-border bg-card ${x??""}`.trim(),style:g,children:e.jsx(X.DataTable,{value:r,dataKey:o,loading:n,emptyMessage:s,paginator:a,rows:c,rowsPerPageOptions:l,size:d,stripedRows:f,showGridlines:h,paginatorTemplate:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown",currentPageReportTemplate:"Mostrando {first} a {last} de {totalRecords} registros",children:b.map(i=>e.jsx(G.Column,{field:i.field,header:i.header,sortable:i.sortable??!1,align:i.align,alignHeader:i.alignHeader,style:i.style,bodyClassName:i.bodyClassName,body:i.body?p=>i.body(p):void 0},String(i.field)))})})}function le(r){return e.jsx(ie,{...r})}const ce="w-full px-4 py-3 border text-base border-input rounded-xl focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-all bg-background shadow-sm",de="w-full pl-4 pr-12 py-3 border text-base border-input rounded-xl focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-all bg-background shadow-sm",ue="w-full px-4 pt-6 pb-2 border text-base border-input rounded-xl focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-all bg-background shadow-sm",me="w-full pl-4 pr-12 pt-6 pb-2 border text-base border-input rounded-xl focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-all bg-background shadow-sm";function fe({label:r,id:t,name:o,type:s="text",value:n="",onChange:a,onBlur:c,placeholder:l,required:d=!1,options:f=[],rows:h=4,className:x="",floatingLabel:g=!1,helperText:b,disabled:i=!1,inputMode:p}){const[S,k]=v.useState(!1),[y,C]=v.useState(!1),j=v.useRef(null),E=g&&(S||n!==""&&n!==void 0&&n!==null),u=s==="password",w=u&&y?"text":s,L=()=>{k(!0)},A=N=>{k(!1),c?.(N)},$=g?u?me:ue:u?de:ce,M=()=>{C(!y)};return e.jsxs("div",{className:x,children:[g?e.jsxs("div",{className:"relative",children:[r&&e.jsxs("label",{htmlFor:t,className:`absolute left-4 transition-all duration-200 pointer-events-none ${E?"top-2 text-xs text-muted-foreground font-medium":"top-1/2 -translate-y-1/2 text-base text-muted-foreground/70"}`,children:[r,d&&e.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),s==="textarea"?e.jsx("textarea",{ref:j,id:t,name:o,value:n,onChange:a,onFocus:L,onBlur:A,placeholder:E?l:"",rows:h,disabled:i,className:`${$} resize-none`}):s==="select"?e.jsxs("select",{ref:j,id:t,name:o,value:n,onChange:a,onFocus:L,onBlur:A,disabled:i,className:$,children:[e.jsx("option",{value:"",children:"Seleccionar opción"}),f.map(N=>e.jsx("option",{value:N.value,children:N.label},N.value))]}):e.jsxs("div",{className:"relative",children:[e.jsx("input",{ref:j,type:w,id:t,name:o,value:n,onChange:a,onFocus:L,onBlur:A,placeholder:E?l:"",disabled:i,inputMode:p,className:$}),u&&e.jsx("button",{type:"button",onClick:M,className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors focus:outline-none focus:ring-2 focus:ring-ring rounded p-1","aria-label":y?"Ocultar contraseña":"Mostrar contraseña",children:y?e.jsx(m.EyeOff,{className:"w-5 h-5"}):e.jsx(m.Eye,{className:"w-5 h-5"})})]})]}):e.jsxs(e.Fragment,{children:[r&&e.jsxs("label",{htmlFor:t,className:"block text-base font-semibold text-foreground mb-2",children:[r,d&&e.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),s==="textarea"?e.jsx("textarea",{id:t,name:o,value:n,onChange:a,placeholder:l,rows:h,disabled:i,className:`${$} resize-none`}):s==="select"?e.jsxs("select",{id:t,name:o,value:n,onChange:a,disabled:i,className:$,children:[e.jsx("option",{value:"",children:"Seleccionar opción"}),f.map(N=>e.jsx("option",{value:N.value,children:N.label},N.value))]}):e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:w,id:t,name:o,value:n,onChange:a,onFocus:L,onBlur:A,placeholder:l,disabled:i,inputMode:p,className:$}),u&&e.jsx("button",{type:"button",onClick:M,className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors focus:outline-none focus:ring-2 focus:ring-ring rounded p-1","aria-label":y?"Ocultar contraseña":"Mostrar contraseña",children:y?e.jsx(m.EyeOff,{className:"w-5 h-5"}):e.jsx(m.Eye,{className:"w-5 h-5"})})]})]}),b&&e.jsx("p",{className:`mt-2 text-sm ${x?.includes("border-red-500")?"text-destructive":"text-muted-foreground"}`,children:b})]})}function xe({value:r,onChange:t,placeholder:o="Buscar...",className:s=""}){return e.jsxs("div",{className:`relative ${s}`,children:[e.jsx(m.Search,{className:"absolute left-4 top-1/2 transform -translate-y-1/2 w-5 h-5 text-gray-400"}),e.jsx("input",{type:"text",value:r,onChange:n=>t(n.target.value),placeholder:o,className:"w-full pl-12 pr-4 py-3 bg-white border-2 border-gray-200 rounded-xl focus:ring-2 focus:ring-uno focus:border-uno transition-all text-sm font-medium text-divisiones placeholder-gray-400"}),r&&e.jsx("button",{onClick:()=>t(""),className:"absolute right-4 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-divisiones transition-colors",type:"button",children:e.jsx(m.X,{className:"w-4 h-4"})})]})}function ge({id:r,name:t,label:o,accept:s=".pdf,application/pdf",required:n=!1,helperText:a,onChange:c,error:l,disabled:d=!1,maxSizeMB:f=10,currentFileName:h}){const[x,g]=v.useState(null),[b,i]=v.useState(!1),p=v.useRef(null),S=u=>{if(s.includes("pdf")&&u.type!=="application/pdf")return"El archivo debe ser un PDF";const w=f*1024*1024;return u.size>w?`El archivo no debe superar ${f}MB`:null},k=u=>{if(!u){g(null),c(null);return}if(S(u)){c(null);return}g(u),c(u)},y=u=>{const w=u.target.files?.[0]||null;k(w)},C=u=>{u.preventDefault(),u.stopPropagation(),u.type==="dragenter"||u.type==="dragover"?i(!0):u.type==="dragleave"&&i(!1)},j=u=>{if(u.preventDefault(),u.stopPropagation(),i(!1),d)return;const w=u.dataTransfer.files?.[0];w&&k(w)},D=()=>{g(null),c(null),p.current&&(p.current.value="")},E=()=>{d||p.current?.click()};return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{htmlFor:r,className:"block text-sm font-medium text-foreground",children:[o,n&&e.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),e.jsxs("div",{className:`
18
+ disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:scale-100 cursor-pointer
19
+ ${M[s]??M.primary} ${a}
20
+ `,...d,children:[r&&e.jsx(r,{size:20,className:`${n?"mr-2":""} ${l?"":"group-hover:rotate-12"} transition-transform duration-300`}),n,c]}),V={sm:"max-w-sm",md:"max-w-md",lg:"max-w-2xl",xl:"max-w-4xl",full:"max-w-[90vw]",fullscreen:"w-[95vw] h-[95vh]"};function H({isOpen:t,onClose:r,title:n="",tamaño:s="lg",children:o,canClose:a=!0}){const l=_(),c=l?l.config.modalZIndex+99999:99999;x.useEffect(()=>{if(t){const u=window.scrollY;return document.body.style.position="fixed",document.body.style.top=`-${u}px`,document.body.style.width="100%",document.body.style.overflow="hidden",()=>{const p=document.body.style.top;document.body.style.position="",document.body.style.top="",document.body.style.width="",document.body.style.overflow="",p&&window.scrollTo(0,parseInt(p||"0")*-1)}}},[t]);const d=e.jsx($.AnimatePresence,{children:t&&e.jsx(e.Fragment,{children:e.jsx($.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",onClick:a?r:u=>u.stopPropagation(),style:{position:"fixed",top:0,left:0,right:0,bottom:0,margin:0,padding:s==="fullscreen"?"0.5rem":"1rem",zIndex:c},children:e.jsxs($.motion.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},transition:{type:"spring",damping:20,stiffness:300},className:`
21
+ bg-background shadow-2xl w-full overflow-hidden relative border border-border/50
22
+ ${s==="fullscreen"?"rounded-none h-[95vh]":"rounded-2xl max-h-[95vh]"}
23
+ ${V[s]||V.md}
24
+ `,onClick:u=>u.stopPropagation(),style:{maxHeight:"95vh",display:"flex",flexDirection:"column"},children:[e.jsxs("div",{className:"bg-linear-to-r from-primary to-secondary p-4 flex justify-between items-center sticky top-0 z-10 border-b border-primary-foreground/20",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 bg-primary-foreground/20 rounded-lg flex items-center justify-center",children:e.jsx("div",{className:"w-4 h-4 bg-primary-foreground rounded-full"})}),e.jsx("h2",{className:"text-lg font-bold text-primary-foreground",children:n})]}),a?e.jsx("button",{onClick:r,className:"text-primary-foreground hover:text-primary-foreground/80 hover:bg-primary-foreground/10 p-2 rounded-lg transition-all duration-200",children:e.jsx(f.X,{size:24})}):e.jsx("div",{className:"w-10 h-10 flex items-center justify-center",children:e.jsx("div",{className:"w-5 h-5 border-2 border-primary-foreground/30 border-t-primary-foreground rounded-full animate-spin"})})]}),e.jsx("div",{className:`overflow-y-auto bg-linear-to-b from-background to-card/30 ${s==="fullscreen"?"p-8 flex-1":"p-6 flex-1"}`,style:{maxHeight:"calc(95vh - 80px)",minHeight:0},children:o})]})})})});return typeof window<"u"?G.createPortal(d,document.body):d}const ne=({isOpen:t,onClose:r,onConfirm:n,loading:s=!1,entidad:o})=>{if(!t)return null;const{tipo:a="elemento",nombre:l="",dependencias:c=0,nombreDependencia:d=""}=o||{};return e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-background rounded-2xl shadow-2xl max-w-md w-full p-6 transform transition-all",children:[e.jsx("div",{className:"flex items-center justify-center w-16 h-16 mx-auto mb-4 bg-destructive/10 rounded-full",children:e.jsx(f.AlertTriangle,{className:"w-8 h-8 text-destructive"})}),e.jsxs("h3",{className:"text-xl font-bold text-foreground text-center mb-2",children:["¿Eliminar ",a,"?"]}),e.jsxs("p",{className:"text-muted-foreground text-center mb-6",children:["Esta acción eliminará ",a==="producto"?"el":"la"," ",e.jsxs("strong",{children:[a,' "',l,'"']}),c>0&&d?e.jsxs(e.Fragment,{children:[" y afectará a ",e.jsxs("strong",{children:[c," ",d]}),"."]}):null,e.jsx("br",{}),"Esta acción no se puede deshacer."]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{onClick:()=>r(!1),className:"flex-1 px-4 py-3 border border-border text-foreground rounded-xl hover:bg-card transition-colors",children:"Cancelar"}),e.jsx("button",{onClick:n,disabled:s,className:`flex-1 px-4 py-3 ${s?"bg-destructive/70":"bg-destructive hover:bg-destructive/90"} text-destructive-foreground rounded-xl transition-colors`,children:s?"Cargando...":"Eliminar"})]})]})})},oe={success:{container:"bg-primary/10 border-primary/30 text-primary",icon:f.CheckCircle},error:{container:"bg-destructive/10 border-destructive/30 text-destructive",icon:f.XCircle},info:{container:"bg-blue-500/10 border-blue-500/30 text-blue-600 dark:text-blue-400",icon:f.Info},warning:{container:"bg-amber-500/10 border-amber-500/30 text-amber-700 dark:text-amber-400",icon:f.AlertTriangle}};function ae({message:t,variant:r="info",open:n,onClose:s,autoClose:o,className:a=""}){const{container:l,icon:c}=oe[r];return x.useEffect(()=>{if(!n||!o)return;const d=setTimeout(s,o);return()=>clearTimeout(d)},[n,o,s]),n?e.jsxs("div",{role:"alert",className:`fixed top-20 right-4 z-[9999] max-w-md flex items-center gap-3 px-4 py-3 rounded-xl border shadow-xl shadow-black/10 dark:shadow-black/30 animate-in slide-in-from-top-5 fade-in duration-300 ${l} ${a}`,children:[e.jsx(c,{className:"w-5 h-5 shrink-0","aria-hidden":!0}),e.jsx("p",{className:"font-medium flex-1",children:t}),e.jsx("button",{type:"button",onClick:s,className:"shrink-0 p-1 rounded-lg hover:bg-black/5 dark:hover:bg-white/5 transition-colors focus:outline-none focus:ring-2 focus:ring-ring","aria-label":"Cerrar",children:e.jsx(f.X,{className:"w-4 h-4"})})]}):null}const ie="No hay registros para mostrar.",le=10,ce=[10,25,50];function de({value:t,columns:r,dataKey:n,emptyMessage:s=ie,loading:o=!1,paginator:a=!1,rows:l=le,rowsPerPageOptions:c=ce,size:d="normal",stripedRows:u=!1,showGridlines:p=!1,className:g,style:h}){const y=r.filter(i=>!i.hidden);return e.jsx("div",{className:`data-table-viva overflow-hidden rounded-lg border border-border bg-card ${g??""}`.trim(),style:h,children:e.jsx(Y.DataTable,{value:t,dataKey:n,loading:o,emptyMessage:s,paginator:a,rows:l,rowsPerPageOptions:c,size:d,stripedRows:u,showGridlines:p,paginatorTemplate:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown",currentPageReportTemplate:"Mostrando {first} a {last} de {totalRecords} registros",children:y.map(i=>e.jsx(J.Column,{field:i.field,header:i.header,sortable:i.sortable??!1,align:i.align,alignHeader:i.alignHeader,style:i.style,bodyClassName:i.bodyClassName,body:i.body?b=>i.body(b):void 0},String(i.field)))})})}function ue(t){return e.jsx(de,{...t})}const me="w-full px-4 py-3 border text-base border-input rounded-xl focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-all bg-background shadow-sm",fe="w-full pl-4 pr-12 py-3 border text-base border-input rounded-xl focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-all bg-background shadow-sm",xe="w-full px-4 pt-6 pb-2 border text-base border-input rounded-xl focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-all bg-background shadow-sm",pe="w-full pl-4 pr-12 pt-6 pb-2 border text-base border-input rounded-xl focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-all bg-background shadow-sm";function ge({label:t,id:r,name:n,type:s="text",value:o="",onChange:a,onBlur:l,placeholder:c,required:d=!1,options:u=[],rows:p=4,className:g="",floatingLabel:h=!1,helperText:y,disabled:i=!1,inputMode:b}){const[S,C]=x.useState(!1),[v,k]=x.useState(!1),j=x.useRef(null),E=h&&(S||o!==""&&o!==void 0&&o!==null),m=s==="password",w=m&&v?"text":s,L=()=>{C(!0)},I=N=>{C(!1),l?.(N)},F=h?m?pe:xe:m?fe:me,A=()=>{k(!v)};return e.jsxs("div",{className:g,children:[h?e.jsxs("div",{className:"relative",children:[t&&e.jsxs("label",{htmlFor:r,className:`absolute left-4 transition-all duration-200 pointer-events-none ${E?"top-2 text-xs text-muted-foreground font-medium":"top-1/2 -translate-y-1/2 text-base text-muted-foreground/70"}`,children:[t,d&&e.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),s==="textarea"?e.jsx("textarea",{ref:j,id:r,name:n,value:o,onChange:a,onFocus:L,onBlur:I,placeholder:E?c:"",rows:p,disabled:i,className:`${F} resize-none`}):s==="select"?e.jsxs("select",{ref:j,id:r,name:n,value:o,onChange:a,onFocus:L,onBlur:I,disabled:i,className:F,children:[e.jsx("option",{value:"",children:"Seleccionar opción"}),u.map(N=>e.jsx("option",{value:N.value,children:N.label},N.value))]}):e.jsxs("div",{className:"relative",children:[e.jsx("input",{ref:j,type:w,id:r,name:n,value:o,onChange:a,onFocus:L,onBlur:I,placeholder:E?c:"",disabled:i,inputMode:b,className:F}),m&&e.jsx("button",{type:"button",onClick:A,className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors focus:outline-none focus:ring-2 focus:ring-ring rounded p-1","aria-label":v?"Ocultar contraseña":"Mostrar contraseña",children:v?e.jsx(f.EyeOff,{className:"w-5 h-5"}):e.jsx(f.Eye,{className:"w-5 h-5"})})]})]}):e.jsxs(e.Fragment,{children:[t&&e.jsxs("label",{htmlFor:r,className:"block text-base font-semibold text-foreground mb-2",children:[t,d&&e.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),s==="textarea"?e.jsx("textarea",{id:r,name:n,value:o,onChange:a,placeholder:c,rows:p,disabled:i,className:`${F} resize-none`}):s==="select"?e.jsxs("select",{id:r,name:n,value:o,onChange:a,disabled:i,className:F,children:[e.jsx("option",{value:"",children:"Seleccionar opción"}),u.map(N=>e.jsx("option",{value:N.value,children:N.label},N.value))]}):e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:w,id:r,name:n,value:o,onChange:a,onFocus:L,onBlur:I,placeholder:c,disabled:i,inputMode:b,className:F}),m&&e.jsx("button",{type:"button",onClick:A,className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors focus:outline-none focus:ring-2 focus:ring-ring rounded p-1","aria-label":v?"Ocultar contraseña":"Mostrar contraseña",children:v?e.jsx(f.EyeOff,{className:"w-5 h-5"}):e.jsx(f.Eye,{className:"w-5 h-5"})})]})]}),y&&e.jsx("p",{className:`mt-2 text-sm ${g?.includes("border-red-500")?"text-destructive":"text-muted-foreground"}`,children:y})]})}function he({value:t,onChange:r,placeholder:n="Buscar...",className:s=""}){return e.jsxs("div",{className:`relative ${s}`,children:[e.jsx(f.Search,{className:"absolute left-4 top-1/2 transform -translate-y-1/2 w-5 h-5 text-gray-400"}),e.jsx("input",{type:"text",value:t,onChange:o=>r(o.target.value),placeholder:n,className:"w-full pl-12 pr-4 py-3 bg-white border-2 border-gray-200 rounded-xl focus:ring-2 focus:ring-uno focus:border-uno transition-all text-sm font-medium text-divisiones placeholder-gray-400"}),t&&e.jsx("button",{onClick:()=>r(""),className:"absolute right-4 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-divisiones transition-colors",type:"button",children:e.jsx(f.X,{className:"w-4 h-4"})})]})}function be({id:t,name:r,label:n,accept:s=".pdf,application/pdf",required:o=!1,helperText:a,onChange:l,error:c,disabled:d=!1,maxSizeMB:u=10,currentFileName:p}){const[g,h]=x.useState(null),[y,i]=x.useState(!1),b=x.useRef(null),S=m=>{if(s.includes("pdf")&&m.type!=="application/pdf")return"El archivo debe ser un PDF";const w=u*1024*1024;return m.size>w?`El archivo no debe superar ${u}MB`:null},C=m=>{if(!m){h(null),l(null);return}if(S(m)){l(null);return}h(m),l(m)},v=m=>{const w=m.target.files?.[0]||null;C(w)},k=m=>{m.preventDefault(),m.stopPropagation(),m.type==="dragenter"||m.type==="dragover"?i(!0):m.type==="dragleave"&&i(!1)},j=m=>{if(m.preventDefault(),m.stopPropagation(),i(!1),d)return;const w=m.dataTransfer.files?.[0];w&&C(w)},D=()=>{h(null),l(null),b.current&&(b.current.value="")},E=()=>{d||b.current?.click()};return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{htmlFor:t,className:"block text-sm font-medium text-foreground",children:[n,o&&e.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),e.jsxs("div",{className:`
25
25
  relative border-2 border-dashed rounded-lg p-6 transition-all
26
- ${b?"border-primary bg-primary/5":"border-border"}
26
+ ${y?"border-primary bg-primary/5":"border-border"}
27
27
  ${d?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-primary/50"}
28
- ${l?"border-destructive":""}
29
- `,onDragEnter:C,onDragLeave:C,onDragOver:C,onDrop:j,onClick:E,children:[e.jsx("input",{ref:p,id:r,name:t,type:"file",accept:s,onChange:y,disabled:d,className:"hidden"}),x||h?e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e.jsx("div",{className:"p-2 rounded-lg bg-primary/10 flex-shrink-0",children:e.jsx(m.FileText,{className:"w-5 h-5 text-primary"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:x?.name||h}),x&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[(x.size/1024/1024).toFixed(2)," MB"]})]})]}),!d&&e.jsx("button",{type:"button",onClick:u=>{u.stopPropagation(),D()},className:"p-2 rounded-lg hover:bg-destructive/10 transition-colors flex-shrink-0",children:e.jsx(m.X,{className:"w-4 h-4 text-destructive"})})]}):e.jsxs("div",{className:"text-center",children:[e.jsx(m.Upload,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e.jsxs("div",{className:"mt-4",children:[e.jsxs("p",{className:"text-sm text-foreground",children:["Arrastra y suelta tu archivo aquí, o"," ",e.jsx("span",{className:"text-primary font-medium",children:"haz clic para seleccionar"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:s.includes("pdf")?`Archivos PDF (máx. ${f}MB)`:`Máximo ${f}MB`})]})]})]}),a&&!l&&e.jsx("p",{className:"text-xs text-muted-foreground",children:a}),l&&e.jsx("p",{className:"text-xs text-destructive",children:l})]})}function pe({label:r,id:t,options:o,selectedIds:s,onChange:n,loading:a=!1,disabled:c=!1,loadingMessage:l="Cargando...",emptyMessage:d,renderLabel:f,helperText:h,itemName:x="item",itemNamePlural:g,maxHeight:b="max-h-60",headerAction:i,emptyAction:p,className:S=""}){const k=g||`${x}s`,y=s.length,C=y>0;return e.jsxs("div",{className:`space-y-2 ${S}`,children:[e.jsxs("div",{className:i?"flex items-center justify-between":"",children:[e.jsx("label",{htmlFor:t,className:"block text-sm font-medium text-foreground",children:r}),i&&e.jsx(P,{type:"button",variant:i.variant||"outline",icon:i.icon,label:i.label,onClick:i.onClick,disabled:c,className:"text-xs"})]}),e.jsx("div",{className:`${b} overflow-y-auto border border-border rounded-lg p-3 bg-background`,children:a?e.jsx("div",{className:"text-center py-4 text-muted-foreground",children:l}):o.length===0?e.jsxs("div",{className:"text-center py-4 space-y-3",children:[d&&e.jsx("p",{className:"text-sm text-muted-foreground",children:d}),p&&e.jsx(P,{type:"button",variant:p.variant||"primary",icon:p.icon,label:p.label,onClick:p.onClick,disabled:c})]}):e.jsx("div",{className:"space-y-2",children:o.map(j=>{const D=s.includes(j.id);return e.jsxs("label",{className:"flex items-center space-x-2 p-2 rounded hover:bg-card/50 cursor-pointer transition-colors",children:[e.jsx("input",{type:"checkbox",checked:D,onChange:()=>n(j.id),disabled:c,className:"w-4 h-4 text-primary border-border rounded focus:ring-primary focus:ring-2"}),e.jsx("span",{className:"text-sm text-foreground",children:f(j)})]},j.id)})})}),h&&e.jsx("p",{className:"text-xs text-muted-foreground",children:h}),C&&e.jsxs("p",{className:"text-xs text-primary",children:[y," ",y===1?x:k," seleccionado",y!==1?"s":""]})]})}function he({label:r,description:t,value:o,onChange:s,icon:n,disabled:a=!1,className:c=""}){const l=!!o;return e.jsxs("div",{className:`flex items-center justify-between p-4 bg-background rounded-xl border border-border hover:bg-card transition-colors duration-200 ${a?"opacity-50 cursor-not-allowed":""} ${c}`,children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[n&&e.jsx("div",{className:"flex-shrink-0 w-10 h-10 bg-gradient-to-br from-primary/80 to-primary-foreground/20 rounded-lg flex items-center justify-center text-primary-foreground",children:n}),e.jsxs("div",{className:"flex-1",children:[e.jsx("label",{className:"block text-sm font-semibold text-foreground mb-1",children:r}),t&&e.jsx("span",{className:"text-xs text-muted-foreground",children:t})]})]}),e.jsx(F.motion.button,{type:"button",onClick:()=>!a&&s(!l),disabled:a,className:`
28
+ ${c?"border-destructive":""}
29
+ `,onDragEnter:k,onDragLeave:k,onDragOver:k,onDrop:j,onClick:E,children:[e.jsx("input",{ref:b,id:t,name:r,type:"file",accept:s,onChange:v,disabled:d,className:"hidden"}),g||p?e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e.jsx("div",{className:"p-2 rounded-lg bg-primary/10 flex-shrink-0",children:e.jsx(f.FileText,{className:"w-5 h-5 text-primary"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:g?.name||p}),g&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[(g.size/1024/1024).toFixed(2)," MB"]})]})]}),!d&&e.jsx("button",{type:"button",onClick:m=>{m.stopPropagation(),D()},className:"p-2 rounded-lg hover:bg-destructive/10 transition-colors flex-shrink-0",children:e.jsx(f.X,{className:"w-4 h-4 text-destructive"})})]}):e.jsxs("div",{className:"text-center",children:[e.jsx(f.Upload,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e.jsxs("div",{className:"mt-4",children:[e.jsxs("p",{className:"text-sm text-foreground",children:["Arrastra y suelta tu archivo aquí, o"," ",e.jsx("span",{className:"text-primary font-medium",children:"haz clic para seleccionar"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:s.includes("pdf")?`Archivos PDF (máx. ${u}MB)`:`Máximo ${u}MB`})]})]})]}),a&&!c&&e.jsx("p",{className:"text-xs text-muted-foreground",children:a}),c&&e.jsx("p",{className:"text-xs text-destructive",children:c})]})}function ye({label:t,id:r,options:n,selectedIds:s,onChange:o,loading:a=!1,disabled:l=!1,loadingMessage:c="Cargando...",emptyMessage:d,renderLabel:u,helperText:p,itemName:g="item",itemNamePlural:h,maxHeight:y="max-h-60",headerAction:i,emptyAction:b,className:S=""}){const C=h||`${g}s`,v=s.length,k=v>0;return e.jsxs("div",{className:`space-y-2 ${S}`,children:[e.jsxs("div",{className:i?"flex items-center justify-between":"",children:[e.jsx("label",{htmlFor:r,className:"block text-sm font-medium text-foreground",children:t}),i&&e.jsx(P,{type:"button",variant:i.variant||"outline",icon:i.icon,label:i.label,onClick:i.onClick,disabled:l,className:"text-xs"})]}),e.jsx("div",{className:`${y} overflow-y-auto border border-border rounded-lg p-3 bg-background`,children:a?e.jsx("div",{className:"text-center py-4 text-muted-foreground",children:c}):n.length===0?e.jsxs("div",{className:"text-center py-4 space-y-3",children:[d&&e.jsx("p",{className:"text-sm text-muted-foreground",children:d}),b&&e.jsx(P,{type:"button",variant:b.variant||"primary",icon:b.icon,label:b.label,onClick:b.onClick,disabled:l})]}):e.jsx("div",{className:"space-y-2",children:n.map(j=>{const D=s.includes(j.id);return e.jsxs("label",{className:"flex items-center space-x-2 p-2 rounded hover:bg-card/50 cursor-pointer transition-colors",children:[e.jsx("input",{type:"checkbox",checked:D,onChange:()=>o(j.id),disabled:l,className:"w-4 h-4 text-primary border-border rounded focus:ring-primary focus:ring-2"}),e.jsx("span",{className:"text-sm text-foreground",children:u(j)})]},j.id)})})}),p&&e.jsx("p",{className:"text-xs text-muted-foreground",children:p}),k&&e.jsxs("p",{className:"text-xs text-primary",children:[v," ",v===1?g:C," seleccionado",v!==1?"s":""]})]})}function ve({label:t,description:r,value:n,onChange:s,icon:o,disabled:a=!1,className:l=""}){const c=!!n;return e.jsxs("div",{className:`flex items-center justify-between p-4 bg-background rounded-xl border border-border hover:bg-card transition-colors duration-200 ${a?"opacity-50 cursor-not-allowed":""} ${l}`,children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[o&&e.jsx("div",{className:"flex-shrink-0 w-10 h-10 bg-gradient-to-br from-primary/80 to-primary-foreground/20 rounded-lg flex items-center justify-center text-primary-foreground",children:o}),e.jsxs("div",{className:"flex-1",children:[e.jsx("label",{className:"block text-sm font-semibold text-foreground mb-1 cursor-pointer",onClick:()=>!a&&s(!c),children:t}),r&&e.jsx("span",{className:"text-xs text-muted-foreground",children:r})]})]}),e.jsx($.motion.button,{type:"button",onClick:()=>!a&&s(!c),disabled:a,className:`
30
30
  relative flex items-center w-14 h-8 rounded-full p-1 transition-colors duration-300
31
31
  focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary/50
32
32
  ${a?"cursor-not-allowed":"cursor-pointer"}
33
- ${l?"bg-gradient-to-r from-green-500 to-green-600":"bg-muted"}
34
- `,whileTap:a?{}:{scale:.95},children:e.jsx(F.motion.div,{className:"w-6 h-6 bg-white rounded-full shadow-lg flex items-center justify-center",animate:{x:l?24:0},transition:{type:"spring",stiffness:500,damping:30},children:l?e.jsx(m.Check,{className:"w-4 h-4 text-green-600"}):e.jsx(m.X,{className:"w-4 h-4 text-muted-foreground"})})})]})}const be=r=>{const t=typeof r=="string"?parseFloat(r):r;return new Intl.NumberFormat("es-CO",{style:"currency",currency:"COP",minimumFractionDigits:0,maximumFractionDigits:0}).format(t)};function ve({value:r,className:t="",bold:o=!1,primary:s=!1,secondary:n=!1,success:a=!1,error:c=!1,size:l="base",emptyText:d="-"}){if(r==null)return e.jsx("span",{className:`text-muted-foreground ${t}`,children:d});const f=typeof r=="string"?parseFloat(r):r;if(isNaN(f))return e.jsx("span",{className:`text-muted-foreground ${t}`,children:d});const h=be(f),x={sm:"text-sm",base:"text-base",lg:"text-lg",xl:"text-xl","2xl":"text-2xl"},g=s?"text-primary":n?"text-secondary":a?"text-green-600 dark:text-green-400":c?"text-destructive":"text-foreground",b=o?"font-bold":"font-normal";return e.jsx("span",{className:`${x[l]} ${g} ${b} ${t}`,children:h})}const ye={small:{width:60,height:45},default:{width:120,height:90},large:{width:180,height:135}},je={default:"/logo.png",logo2:"/logo2.png",white:"/logoW.png",whiteNoBg:"/logoW_sin_bg.png"},we=({size:r="default",variant:t="whiteNoBg",src:o,alt:s="Logo de Buenity",className:n="",fondoColor:a="transparent",animated:c=!1,animationType:l="fade",animationDuration:d=1})=>{const{width:f,height:h}=ye[r],x=o||je[t],b=(()=>{if(!c)return{};const p={initial:{opacity:0},animate:{opacity:1},transition:{duration:d}};switch(l){case"fade":return{...p,initial:{opacity:0},animate:{opacity:1}};case"scale":return{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{duration:d,ease:"easeOut"}};case"pulse":return{initial:{opacity:0,scale:1},animate:{opacity:1,scale:[1,1.05,1]},transition:{duration:d,repeat:1/0,repeatType:"reverse",ease:"easeInOut"}};case"bounce":return{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:d,type:"spring",stiffness:200,damping:10}};case"rotate":return{initial:{opacity:0,rotate:-180},animate:{opacity:1,rotate:0},transition:{duration:d,ease:"easeOut"}};default:return p}})(),i={className:"flex items-center rounded-xl justify-center",style:{backgroundColor:a},...c?b:{}};return c?e.jsx(F.motion.div,{...i,children:e.jsx("img",{src:x,width:f,height:h,alt:s,className:`object-contain ${n}`})}):e.jsx("div",{...i,children:e.jsx("img",{src:x,width:f,height:h,alt:s,className:`object-contain ${n}`})})};function W(r){const t=r.split("?")[0],o=t.match(/rp-(\d+)/i);if(o)return`rp-${o[1]}`;const s=t.split("/");return(s[s.length-1]||"").replace(/\.(pdf|jpg|jpeg|png|gif|webp)$/i,"")||"Soporte"}function Ne({url:r,isOpen:t,onClose:o,displayName:s}){const[n,a]=v.useState(!0),[c,l]=v.useState(null),[d,f]=v.useState("unknown");v.useEffect(()=>{if(!r){f("unknown"),a(!1);return}const i=r.toLowerCase();i.match(/\.(jpg|jpeg|png|gif|webp|svg|bmp)$/)?f("image"):i.match(/\.pdf$/)||i.includes("application/pdf")?f("pdf"):f("unknown"),a(!1),l(null)},[r]);const h=()=>{l("Error al cargar la imagen"),a(!1)},x=()=>{if(!r)return;const i=document.createElement("a");i.href=r,i.download=g,i.target="_blank",document.body.appendChild(i),i.click(),document.body.removeChild(i)},g=s??(r?W(r):"Archivo"),b=()=>{switch(d){case"image":return e.jsx(m.Image,{className:"w-6 h-6 text-primary"});case"pdf":return e.jsx(m.FileText,{className:"w-6 h-6 text-primary"});default:return e.jsx(m.File,{className:"w-6 h-6 text-primary"})}};return t?e.jsx(_,{isOpen:!0,onClose:o,title:g,tamaño:"fullscreen",canClose:!0,children:e.jsx("div",{className:"flex flex-col h-full min-h-[90dvh]",children:e.jsxs("div",{className:"flex-1 overflow-auto mt-4 bg-muted/30 rounded-xl p-4 min-h-[60vh]",children:[!r&&e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] text-muted-foreground",children:[e.jsx(m.File,{className:"w-12 h-12 mb-4 opacity-50"}),e.jsx("p",{children:"No hay archivo para visualizar."})]}),r&&n&&e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] text-muted-foreground",children:[e.jsx(m.Loader2,{className:"w-12 h-12 text-primary animate-spin mb-4"}),e.jsx("p",{children:"Cargando archivo..."})]}),r&&c&&e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] text-center",children:[e.jsx("div",{className:"w-16 h-16 bg-destructive/10 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(m.AlertCircle,{className:"w-8 h-8 text-destructive"})}),e.jsx("h3",{className:"text-lg font-semibold text-foreground mb-2",children:"Error al cargar el archivo"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:c}),e.jsx(P,{type:"button",variant:"primary",icon:m.Download,label:"Intentar descargar",onClick:x})]}),r&&!n&&!c&&e.jsxs(e.Fragment,{children:[d==="image"&&e.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:e.jsx("img",{src:r,alt:g,onError:h,onLoad:()=>a(!1),className:"max-w-full max-h-[75vh] object-contain rounded-lg shadow-lg border border-border"})}),d==="pdf"&&e.jsx("div",{className:"flex items-center justify-center min-h-[82dvh] w-full",children:e.jsx("iframe",{src:r,onLoad:()=>a(!1),className:"w-full h-[75vh] rounded-lg shadow-lg bg-background border border-border",title:g})}),d==="unknown"&&e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] text-center",children:[e.jsx("div",{className:"w-16 h-16 bg-muted rounded-full flex items-center justify-center mx-auto mb-4",children:b()}),e.jsx("h3",{className:"text-lg font-semibold text-foreground mb-2",children:"Tipo de archivo no soportado para vista previa"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:"Puede descargar el archivo para abrirlo en su dispositivo."}),e.jsx(P,{type:"button",variant:"primary",icon:m.Download,label:"Descargar archivo",onClick:x})]})]})]})})}):null}function ke({url:r,displayName:t,icon:o,className:s="inline-flex items-center gap-2 text-primary hover:text-primary/80 hover:underline font-medium"}){const n=r.startsWith("http")||r.startsWith("//")?r:`${typeof window<"u"?window.location.origin:""}${r.startsWith("/")?r:`/${r}`}`;return e.jsxs("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:s,children:[o??e.jsx(m.FileText,{className:"w-4 h-4 shrink-0"}),t]})}const Ce={sm:"h-4 w-4",md:"h-6 w-6",lg:"h-10 w-10",xl:"h-16 w-16"},Fe={primary:"text-primary",secondary:"text-secondary",muted:"text-muted-foreground",destructive:"text-destructive"};function q({size:r="md",variant:t="muted",className:o=""}){return e.jsxs("svg",{className:`${Ce[r]} ${Fe[t]} animate-spin ${o}`,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",role:"status","aria-label":"Cargando",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}function $e({text:r="Cargando datos...",size:t="lg",variant:o="muted",className:s="",textClassName:n=""}){return e.jsx("div",{className:`w-full h-screen flex items-center justify-center p-6 ${s}`,children:e.jsxs("div",{className:"flex flex-col items-center gap-4",children:[e.jsx(q,{size:t,variant:o}),r&&e.jsx("span",{className:`text-lg font-semibold text-muted-foreground ${n}`,children:r})]})})}exports.ActionButton=P;exports.CurrencyDisplay=ve;exports.DataTable=le;exports.DeleteConfirmModal=re;exports.FileLink=ke;exports.FileUpload=ge;exports.FileViewerModal=Ne;exports.FormField=fe;exports.Loader=q;exports.LoaderScreen=$e;exports.Logo=we;exports.Modal=_;exports.MultiSelectCheckbox=pe;exports.SearchBar=xe;exports.ThemeProvider=Y;exports.Toast=se;exports.ToggleSwitch=he;exports.createTheme=H;exports.defaultColors=T;exports.defaultTheme=R;exports.generateCSSVariables=Z;exports.generateCompatibilityVariables=I;exports.generateTailwindV4CSS=ee;exports.generateTailwindV4Theme=U;exports.getRpSoporteDisplayName=W;exports.getTailwindColors=V;exports.getTailwindConfig=Q;exports.useTheme=J;
33
+ ${c?"bg-gradient-to-r from-green-500 to-green-600":"bg-muted"}
34
+ `,whileTap:a?{}:{scale:.95},"aria-label":c?"Desactivar":"Activar","aria-checked":c,role:"switch",children:e.jsx($.motion.div,{className:"w-6 h-6 bg-white rounded-full shadow-lg flex items-center justify-center",animate:{x:c?26:0},transition:{type:"spring",stiffness:500,damping:30},children:c?e.jsx(f.Check,{className:"w-4 h-4 text-green-600"}):e.jsx(f.X,{className:"w-4 h-4 text-muted-foreground"})})})]})}const je=t=>{const r=typeof t=="string"?parseFloat(t):t;return new Intl.NumberFormat("es-CO",{style:"currency",currency:"COP",minimumFractionDigits:0,maximumFractionDigits:0}).format(r)};function we({value:t,className:r="",bold:n=!1,primary:s=!1,secondary:o=!1,success:a=!1,error:l=!1,size:c="base",emptyText:d="-"}){if(t==null)return e.jsx("span",{className:`text-muted-foreground ${r}`,children:d});const u=typeof t=="string"?parseFloat(t):t;if(isNaN(u))return e.jsx("span",{className:`text-muted-foreground ${r}`,children:d});const p=je(u),g={sm:"text-sm",base:"text-base",lg:"text-lg",xl:"text-xl","2xl":"text-2xl"},h=s?"text-primary":o?"text-secondary":a?"text-green-600 dark:text-green-400":l?"text-destructive":"text-foreground",y=n?"font-bold":"font-normal";return e.jsx("span",{className:`${g[c]} ${h} ${y} ${r}`,children:p})}const Ne={small:{width:60,height:45},default:{width:120,height:90},large:{width:180,height:135}},Ce={default:"/logo.png",logo2:"/logo2.png",white:"/logoW.png",whiteNoBg:"/logoW_sin_bg.png"},ke=({size:t="default",variant:r="whiteNoBg",src:n,alt:s="Logo de Buenity",className:o="",fondoColor:a="transparent",animated:l=!1,animationType:c="fade",animationDuration:d=1})=>{const{width:u,height:p}=Ne[t],g=n||Ce[r],y=(()=>{if(!l)return{};const b={initial:{opacity:0},animate:{opacity:1},transition:{duration:d}};switch(c){case"fade":return{...b,initial:{opacity:0},animate:{opacity:1}};case"scale":return{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{duration:d,ease:"easeOut"}};case"pulse":return{initial:{opacity:0,scale:1},animate:{opacity:1,scale:[1,1.05,1]},transition:{duration:d,repeat:1/0,repeatType:"reverse",ease:"easeInOut"}};case"bounce":return{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:d,type:"spring",stiffness:200,damping:10}};case"rotate":return{initial:{opacity:0,rotate:-180},animate:{opacity:1,rotate:0},transition:{duration:d,ease:"easeOut"}};default:return b}})(),i={className:"flex items-center rounded-xl justify-center",style:{backgroundColor:a},...l?y:{}};return l?e.jsx($.motion.div,{...i,children:e.jsx("img",{src:g,width:u,height:p,alt:s,className:`object-contain ${o}`})}):e.jsx("div",{...i,children:e.jsx("img",{src:g,width:u,height:p,alt:s,className:`object-contain ${o}`})})};function K(t){const r=t.split("?")[0],n=r.match(/rp-(\d+)/i);if(n)return`rp-${n[1]}`;const s=r.split("/");return(s[s.length-1]||"").replace(/\.(pdf|jpg|jpeg|png|gif|webp)$/i,"")||"Soporte"}function Fe({url:t,isOpen:r,onClose:n,displayName:s}){const[o,a]=x.useState(!0),[l,c]=x.useState(null),[d,u]=x.useState("unknown");x.useEffect(()=>{if(!t){u("unknown"),a(!1);return}const i=t.toLowerCase();i.match(/\.(jpg|jpeg|png|gif|webp|svg|bmp)$/)?u("image"):i.match(/\.pdf$/)||i.includes("application/pdf")?u("pdf"):u("unknown"),a(!1),c(null)},[t]);const p=()=>{c("Error al cargar la imagen"),a(!1)},g=()=>{if(!t)return;const i=document.createElement("a");i.href=t,i.download=h,i.target="_blank",document.body.appendChild(i),i.click(),document.body.removeChild(i)},h=s??(t?K(t):"Archivo"),y=()=>{switch(d){case"image":return e.jsx(f.Image,{className:"w-6 h-6 text-primary"});case"pdf":return e.jsx(f.FileText,{className:"w-6 h-6 text-primary"});default:return e.jsx(f.File,{className:"w-6 h-6 text-primary"})}};return r?e.jsx(H,{isOpen:!0,onClose:n,title:h,tamaño:"fullscreen",canClose:!0,children:e.jsx("div",{className:"flex flex-col h-full min-h-[90dvh]",children:e.jsxs("div",{className:"flex-1 overflow-auto mt-4 bg-muted/30 rounded-xl p-4 min-h-[60vh]",children:[!t&&e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] text-muted-foreground",children:[e.jsx(f.File,{className:"w-12 h-12 mb-4 opacity-50"}),e.jsx("p",{children:"No hay archivo para visualizar."})]}),t&&o&&e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] text-muted-foreground",children:[e.jsx(f.Loader2,{className:"w-12 h-12 text-primary animate-spin mb-4"}),e.jsx("p",{children:"Cargando archivo..."})]}),t&&l&&e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] text-center",children:[e.jsx("div",{className:"w-16 h-16 bg-destructive/10 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(f.AlertCircle,{className:"w-8 h-8 text-destructive"})}),e.jsx("h3",{className:"text-lg font-semibold text-foreground mb-2",children:"Error al cargar el archivo"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:l}),e.jsx(P,{type:"button",variant:"primary",icon:f.Download,label:"Intentar descargar",onClick:g})]}),t&&!o&&!l&&e.jsxs(e.Fragment,{children:[d==="image"&&e.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:e.jsx("img",{src:t,alt:h,onError:p,onLoad:()=>a(!1),className:"max-w-full max-h-[75vh] object-contain rounded-lg shadow-lg border border-border"})}),d==="pdf"&&e.jsx("div",{className:"flex items-center justify-center min-h-[82dvh] w-full",children:e.jsx("iframe",{src:t,onLoad:()=>a(!1),className:"w-full h-[75vh] rounded-lg shadow-lg bg-background border border-border",title:h})}),d==="unknown"&&e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] text-center",children:[e.jsx("div",{className:"w-16 h-16 bg-muted rounded-full flex items-center justify-center mx-auto mb-4",children:y()}),e.jsx("h3",{className:"text-lg font-semibold text-foreground mb-2",children:"Tipo de archivo no soportado para vista previa"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:"Puede descargar el archivo para abrirlo en su dispositivo."}),e.jsx(P,{type:"button",variant:"primary",icon:f.Download,label:"Descargar archivo",onClick:g})]})]})]})})}):null}function $e({url:t,displayName:r,icon:n,className:s="inline-flex items-center gap-2 text-primary hover:text-primary/80 hover:underline font-medium"}){const o=t.startsWith("http")||t.startsWith("//")?t:`${typeof window<"u"?window.location.origin:""}${t.startsWith("/")?t:`/${t}`}`;return e.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:s,children:[n??e.jsx(f.FileText,{className:"w-4 h-4 shrink-0"}),r]})}const Te={sm:"h-4 w-4",md:"h-6 w-6",lg:"h-10 w-10",xl:"h-16 w-16"},Se={primary:"text-primary",secondary:"text-secondary",muted:"text-muted-foreground",destructive:"text-destructive"};function X({size:t="md",variant:r="muted",className:n=""}){return e.jsxs("svg",{className:`${Te[t]} ${Se[r]} animate-spin ${n}`,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",role:"status","aria-label":"Cargando",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}function Ee({text:t="Cargando datos...",size:r="lg",variant:n="muted",className:s="",textClassName:o=""}){return e.jsx("div",{className:`w-full h-screen flex items-center justify-center p-6 ${s}`,children:e.jsxs("div",{className:"flex flex-col items-center gap-4",children:[e.jsx(X,{size:r,variant:n}),t&&e.jsx("span",{className:`text-lg font-semibold text-muted-foreground ${o}`,children:t})]})})}exports.ActionButton=P;exports.CurrencyDisplay=we;exports.DataTable=ue;exports.DeleteConfirmModal=ne;exports.FileLink=$e;exports.FileUpload=be;exports.FileViewerModal=Fe;exports.FormField=ge;exports.Loader=X;exports.LoaderScreen=Ee;exports.Logo=ke;exports.Modal=H;exports.MultiSelectCheckbox=ye;exports.SearchBar=he;exports.ThemeProvider=O;exports.Toast=ae;exports.ToggleSwitch=ve;exports.VicdevUIProvider=te;exports.createTheme=Q;exports.defaultColors=T;exports.defaultTheme=B;exports.generateCSSVariables=U;exports.generateCompatibilityVariables=q;exports.generateTailwindV4CSS=se;exports.generateTailwindV4Theme=Z;exports.getRpSoporteDisplayName=K;exports.getTailwindColors=W;exports.getTailwindConfig=re;exports.useTheme=ee;exports.useVicdevUIConfig=_;