@kydra/ui 0.1.0 → 0.2.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/dist/index.d.mts +148 -2
- package/dist/index.d.ts +148 -2
- package/dist/index.js +45 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +45 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +14 -12
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,151 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import react__default, { InputHTMLAttributes, CSSProperties, ButtonHTMLAttributes, ReactNode } from 'react';
|
|
4
|
+
import { LucideIcon } from 'lucide-react';
|
|
2
5
|
|
|
3
|
-
|
|
6
|
+
interface TableAction<T> {
|
|
7
|
+
label: string;
|
|
8
|
+
icon?: LucideIcon;
|
|
9
|
+
onClick: (row: T) => void;
|
|
10
|
+
color?: string;
|
|
11
|
+
}
|
|
12
|
+
interface TableColumn<T> {
|
|
13
|
+
header: string;
|
|
14
|
+
accessor: keyof T;
|
|
15
|
+
filter?: boolean;
|
|
16
|
+
hidden?: boolean;
|
|
17
|
+
align?: 'left' | 'center' | 'right';
|
|
18
|
+
format?: (value: any, row: T, highlightColor: string) => react__default.ReactNode;
|
|
19
|
+
actions?: TableAction<T>[];
|
|
20
|
+
}
|
|
21
|
+
interface TableProps<T> {
|
|
22
|
+
data: T[];
|
|
23
|
+
columns: TableColumn<T>[];
|
|
24
|
+
pagination?: boolean;
|
|
25
|
+
selectable?: boolean;
|
|
26
|
+
customArrayPagination?: number[];
|
|
27
|
+
defaultPageSize?: number;
|
|
28
|
+
filter?: boolean;
|
|
29
|
+
filterPlaceholder?: string;
|
|
30
|
+
color?: string;
|
|
31
|
+
add?: boolean;
|
|
32
|
+
textAdd?: string;
|
|
33
|
+
actionAdd?: () => void;
|
|
34
|
+
excelExport?: boolean;
|
|
35
|
+
onDeleteRows?: (ids: (string | number)[]) => void;
|
|
36
|
+
emptyState?: react__default.ComponentType;
|
|
37
|
+
darkMode?: boolean;
|
|
38
|
+
}
|
|
39
|
+
interface Identifiable {
|
|
40
|
+
id: string | number;
|
|
41
|
+
}
|
|
42
|
+
declare const Table: <T extends Identifiable>({ data, columns, pagination, selectable, customArrayPagination, defaultPageSize, filter, filterPlaceholder, color, add, textAdd, actionAdd, excelExport, onDeleteRows, emptyState: CustomEmptyState, darkMode }: TableProps<T>) => react_jsx_runtime.JSX.Element;
|
|
4
43
|
|
|
5
|
-
|
|
44
|
+
type InputVariant = 'standard' | 'underlined' | 'filled';
|
|
45
|
+
interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
|
|
46
|
+
/** Componente de icono opcional que aparecerá al inicio */
|
|
47
|
+
icon?: React.ComponentType<{
|
|
48
|
+
className?: string;
|
|
49
|
+
}>;
|
|
50
|
+
/** Color de énfasis para el borde de enfoque y el label activo */
|
|
51
|
+
color?: string;
|
|
52
|
+
/** Etiqueta flotante del input */
|
|
53
|
+
label?: string;
|
|
54
|
+
/** Mensaje de error que se muestra debajo del input */
|
|
55
|
+
error?: string;
|
|
56
|
+
/** Variante estética del campo de texto */
|
|
57
|
+
variant?: InputVariant;
|
|
58
|
+
/** Función que se ejecuta al cambiar el valor del texto */
|
|
59
|
+
onChange?: (value: string) => void;
|
|
60
|
+
/** Función opcional para limpiar el contenido del input */
|
|
61
|
+
onClear?: () => void;
|
|
62
|
+
/** Estilos personalizados directos para el contenedor del input */
|
|
63
|
+
kd?: CSSProperties;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
declare const Input: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @interface CheckBoxProps
|
|
70
|
+
* Propiedades para el componente CheckBox estilizado.
|
|
71
|
+
*/
|
|
72
|
+
interface CheckBoxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value'> {
|
|
73
|
+
/** @param color - Color del fondo cuando el checkbox está seleccionado. */
|
|
74
|
+
color?: string;
|
|
75
|
+
/** @param label - Texto que se muestra a la par del control. */
|
|
76
|
+
label?: string;
|
|
77
|
+
/** @param value - Estado booleano (checked/unchecked). */
|
|
78
|
+
value?: boolean;
|
|
79
|
+
/** @param onChange - Callback que retorna el nuevo valor booleano. */
|
|
80
|
+
onChange?: (checked: boolean) => void;
|
|
81
|
+
/** @param kd - Estilos CSS para el cuadro visual (ej: borderRadius para hacerlo circular). */
|
|
82
|
+
kd?: CSSProperties;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Componente CheckBox - Core librería @kydra/ui
|
|
87
|
+
*/
|
|
88
|
+
declare const CheckBox: react.ForwardRefExoticComponent<CheckBoxProps & react.RefAttributes<HTMLInputElement>>;
|
|
89
|
+
|
|
90
|
+
type ButtonVariant = 'filled' | 'dotted' | 'ghost-hover';
|
|
91
|
+
type IconPosition = 'left' | 'right';
|
|
92
|
+
type TextAlign = 'left' | 'center' | 'right';
|
|
93
|
+
/**
|
|
94
|
+
* @interface ButtonProps
|
|
95
|
+
* Propiedades para el componente Button.
|
|
96
|
+
* Extiende los atributos nativos de un botón HTML.
|
|
97
|
+
*/
|
|
98
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
99
|
+
/** @param label - Texto descriptivo que se muestra dentro del botón. */
|
|
100
|
+
label?: string;
|
|
101
|
+
/** @param color - Color principal del botón en formato Hex, RGB o HSL. */
|
|
102
|
+
color?: string;
|
|
103
|
+
/** @param variant - Estilo visual: 'filled' (sólido), 'dotted' (punteado) o 'ghost-hover' (relleno al hover). */
|
|
104
|
+
variant?: ButtonVariant;
|
|
105
|
+
/** @param icon - Elemento de icono (ReactNode) que acompaña al texto. */
|
|
106
|
+
icon?: ReactNode;
|
|
107
|
+
/** @param iconPosition - Ubicación del icono: 'left' (izquierda) o 'right' (derecha). */
|
|
108
|
+
iconPosition?: IconPosition;
|
|
109
|
+
/** @param textAlign - Alineación horizontal del contenido interno. */
|
|
110
|
+
textAlign?: TextAlign;
|
|
111
|
+
/** @param loading - Si es true, muestra un spinner y bloquea la interacción. */
|
|
112
|
+
loading?: boolean;
|
|
113
|
+
/** @param kd - Objeto de estilos CSS personalizados para modificaciones directas (Kydra Design). */
|
|
114
|
+
kd?: CSSProperties;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Componente Button - Core librería @kydra/ui
|
|
119
|
+
*/
|
|
120
|
+
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
121
|
+
|
|
122
|
+
type NavbarPosition = 'static' | 'sticky' | 'fixed-bottom-floating';
|
|
123
|
+
/**
|
|
124
|
+
* @interface NavbarProps
|
|
125
|
+
* Propiedades para el componente Navbar altamente configurable.
|
|
126
|
+
*/
|
|
127
|
+
interface NavbarProps {
|
|
128
|
+
/** @param title - Título o logo del Navbar. */
|
|
129
|
+
title?: ReactNode;
|
|
130
|
+
/** @param position - Posición del Nav: 'static' (arriba normal), 'sticky' (pegado arriba), 'fixed-bottom-floating' (abajo flotante). */
|
|
131
|
+
position?: NavbarPosition;
|
|
132
|
+
/** @param color - Color principal para detalles o fondo (si colorDominant es true). */
|
|
133
|
+
color?: string;
|
|
134
|
+
/** @param colorDominant - Si es true, el color de la prop 'color' se convierte en el fondo principal. */
|
|
135
|
+
colorDominant?: boolean;
|
|
136
|
+
/** @param isMenuOpen - Estado controlado para el menú hamburguesa móvil. */
|
|
137
|
+
isMenuOpen?: boolean;
|
|
138
|
+
/** @param onToggleMenu - Función para abrir/cerrar el menú. */
|
|
139
|
+
onToggleMenu?: () => void;
|
|
140
|
+
/** @param children - Elementos de navegación o acciones. */
|
|
141
|
+
children?: ReactNode;
|
|
142
|
+
/** @param kd - Estilos CSS personalizados para el contenedor del Navbar. */
|
|
143
|
+
kd?: CSSProperties;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Componente Navbar - Barra de navegación adaptable con soporte para múltiples posiciones y temas.
|
|
147
|
+
* Gestiona automáticamente el contraste del texto según el fondo.
|
|
148
|
+
*/
|
|
149
|
+
declare const Navbar: ({ title, position, color, colorDominant, isMenuOpen, onToggleMenu, children, kd }: NavbarProps) => react_jsx_runtime.JSX.Element;
|
|
150
|
+
|
|
151
|
+
export { Button, type ButtonProps, type ButtonVariant, CheckBox, type CheckBoxProps, type IconPosition, Input, type InputProps, type InputVariant, Navbar, type NavbarPosition, type NavbarProps, Table, type TableAction, type TableColumn, type TextAlign };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,151 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import react__default, { InputHTMLAttributes, CSSProperties, ButtonHTMLAttributes, ReactNode } from 'react';
|
|
4
|
+
import { LucideIcon } from 'lucide-react';
|
|
2
5
|
|
|
3
|
-
|
|
6
|
+
interface TableAction<T> {
|
|
7
|
+
label: string;
|
|
8
|
+
icon?: LucideIcon;
|
|
9
|
+
onClick: (row: T) => void;
|
|
10
|
+
color?: string;
|
|
11
|
+
}
|
|
12
|
+
interface TableColumn<T> {
|
|
13
|
+
header: string;
|
|
14
|
+
accessor: keyof T;
|
|
15
|
+
filter?: boolean;
|
|
16
|
+
hidden?: boolean;
|
|
17
|
+
align?: 'left' | 'center' | 'right';
|
|
18
|
+
format?: (value: any, row: T, highlightColor: string) => react__default.ReactNode;
|
|
19
|
+
actions?: TableAction<T>[];
|
|
20
|
+
}
|
|
21
|
+
interface TableProps<T> {
|
|
22
|
+
data: T[];
|
|
23
|
+
columns: TableColumn<T>[];
|
|
24
|
+
pagination?: boolean;
|
|
25
|
+
selectable?: boolean;
|
|
26
|
+
customArrayPagination?: number[];
|
|
27
|
+
defaultPageSize?: number;
|
|
28
|
+
filter?: boolean;
|
|
29
|
+
filterPlaceholder?: string;
|
|
30
|
+
color?: string;
|
|
31
|
+
add?: boolean;
|
|
32
|
+
textAdd?: string;
|
|
33
|
+
actionAdd?: () => void;
|
|
34
|
+
excelExport?: boolean;
|
|
35
|
+
onDeleteRows?: (ids: (string | number)[]) => void;
|
|
36
|
+
emptyState?: react__default.ComponentType;
|
|
37
|
+
darkMode?: boolean;
|
|
38
|
+
}
|
|
39
|
+
interface Identifiable {
|
|
40
|
+
id: string | number;
|
|
41
|
+
}
|
|
42
|
+
declare const Table: <T extends Identifiable>({ data, columns, pagination, selectable, customArrayPagination, defaultPageSize, filter, filterPlaceholder, color, add, textAdd, actionAdd, excelExport, onDeleteRows, emptyState: CustomEmptyState, darkMode }: TableProps<T>) => react_jsx_runtime.JSX.Element;
|
|
4
43
|
|
|
5
|
-
|
|
44
|
+
type InputVariant = 'standard' | 'underlined' | 'filled';
|
|
45
|
+
interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
|
|
46
|
+
/** Componente de icono opcional que aparecerá al inicio */
|
|
47
|
+
icon?: React.ComponentType<{
|
|
48
|
+
className?: string;
|
|
49
|
+
}>;
|
|
50
|
+
/** Color de énfasis para el borde de enfoque y el label activo */
|
|
51
|
+
color?: string;
|
|
52
|
+
/** Etiqueta flotante del input */
|
|
53
|
+
label?: string;
|
|
54
|
+
/** Mensaje de error que se muestra debajo del input */
|
|
55
|
+
error?: string;
|
|
56
|
+
/** Variante estética del campo de texto */
|
|
57
|
+
variant?: InputVariant;
|
|
58
|
+
/** Función que se ejecuta al cambiar el valor del texto */
|
|
59
|
+
onChange?: (value: string) => void;
|
|
60
|
+
/** Función opcional para limpiar el contenido del input */
|
|
61
|
+
onClear?: () => void;
|
|
62
|
+
/** Estilos personalizados directos para el contenedor del input */
|
|
63
|
+
kd?: CSSProperties;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
declare const Input: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @interface CheckBoxProps
|
|
70
|
+
* Propiedades para el componente CheckBox estilizado.
|
|
71
|
+
*/
|
|
72
|
+
interface CheckBoxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value'> {
|
|
73
|
+
/** @param color - Color del fondo cuando el checkbox está seleccionado. */
|
|
74
|
+
color?: string;
|
|
75
|
+
/** @param label - Texto que se muestra a la par del control. */
|
|
76
|
+
label?: string;
|
|
77
|
+
/** @param value - Estado booleano (checked/unchecked). */
|
|
78
|
+
value?: boolean;
|
|
79
|
+
/** @param onChange - Callback que retorna el nuevo valor booleano. */
|
|
80
|
+
onChange?: (checked: boolean) => void;
|
|
81
|
+
/** @param kd - Estilos CSS para el cuadro visual (ej: borderRadius para hacerlo circular). */
|
|
82
|
+
kd?: CSSProperties;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Componente CheckBox - Core librería @kydra/ui
|
|
87
|
+
*/
|
|
88
|
+
declare const CheckBox: react.ForwardRefExoticComponent<CheckBoxProps & react.RefAttributes<HTMLInputElement>>;
|
|
89
|
+
|
|
90
|
+
type ButtonVariant = 'filled' | 'dotted' | 'ghost-hover';
|
|
91
|
+
type IconPosition = 'left' | 'right';
|
|
92
|
+
type TextAlign = 'left' | 'center' | 'right';
|
|
93
|
+
/**
|
|
94
|
+
* @interface ButtonProps
|
|
95
|
+
* Propiedades para el componente Button.
|
|
96
|
+
* Extiende los atributos nativos de un botón HTML.
|
|
97
|
+
*/
|
|
98
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
99
|
+
/** @param label - Texto descriptivo que se muestra dentro del botón. */
|
|
100
|
+
label?: string;
|
|
101
|
+
/** @param color - Color principal del botón en formato Hex, RGB o HSL. */
|
|
102
|
+
color?: string;
|
|
103
|
+
/** @param variant - Estilo visual: 'filled' (sólido), 'dotted' (punteado) o 'ghost-hover' (relleno al hover). */
|
|
104
|
+
variant?: ButtonVariant;
|
|
105
|
+
/** @param icon - Elemento de icono (ReactNode) que acompaña al texto. */
|
|
106
|
+
icon?: ReactNode;
|
|
107
|
+
/** @param iconPosition - Ubicación del icono: 'left' (izquierda) o 'right' (derecha). */
|
|
108
|
+
iconPosition?: IconPosition;
|
|
109
|
+
/** @param textAlign - Alineación horizontal del contenido interno. */
|
|
110
|
+
textAlign?: TextAlign;
|
|
111
|
+
/** @param loading - Si es true, muestra un spinner y bloquea la interacción. */
|
|
112
|
+
loading?: boolean;
|
|
113
|
+
/** @param kd - Objeto de estilos CSS personalizados para modificaciones directas (Kydra Design). */
|
|
114
|
+
kd?: CSSProperties;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Componente Button - Core librería @kydra/ui
|
|
119
|
+
*/
|
|
120
|
+
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
121
|
+
|
|
122
|
+
type NavbarPosition = 'static' | 'sticky' | 'fixed-bottom-floating';
|
|
123
|
+
/**
|
|
124
|
+
* @interface NavbarProps
|
|
125
|
+
* Propiedades para el componente Navbar altamente configurable.
|
|
126
|
+
*/
|
|
127
|
+
interface NavbarProps {
|
|
128
|
+
/** @param title - Título o logo del Navbar. */
|
|
129
|
+
title?: ReactNode;
|
|
130
|
+
/** @param position - Posición del Nav: 'static' (arriba normal), 'sticky' (pegado arriba), 'fixed-bottom-floating' (abajo flotante). */
|
|
131
|
+
position?: NavbarPosition;
|
|
132
|
+
/** @param color - Color principal para detalles o fondo (si colorDominant es true). */
|
|
133
|
+
color?: string;
|
|
134
|
+
/** @param colorDominant - Si es true, el color de la prop 'color' se convierte en el fondo principal. */
|
|
135
|
+
colorDominant?: boolean;
|
|
136
|
+
/** @param isMenuOpen - Estado controlado para el menú hamburguesa móvil. */
|
|
137
|
+
isMenuOpen?: boolean;
|
|
138
|
+
/** @param onToggleMenu - Función para abrir/cerrar el menú. */
|
|
139
|
+
onToggleMenu?: () => void;
|
|
140
|
+
/** @param children - Elementos de navegación o acciones. */
|
|
141
|
+
children?: ReactNode;
|
|
142
|
+
/** @param kd - Estilos CSS personalizados para el contenedor del Navbar. */
|
|
143
|
+
kd?: CSSProperties;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Componente Navbar - Barra de navegación adaptable con soporte para múltiples posiciones y temas.
|
|
147
|
+
* Gestiona automáticamente el contraste del texto según el fondo.
|
|
148
|
+
*/
|
|
149
|
+
declare const Navbar: ({ title, position, color, colorDominant, isMenuOpen, onToggleMenu, children, kd }: NavbarProps) => react_jsx_runtime.JSX.Element;
|
|
150
|
+
|
|
151
|
+
export { Button, type ButtonProps, type ButtonVariant, CheckBox, type CheckBoxProps, type IconPosition, Input, type InputProps, type InputVariant, Navbar, type NavbarPosition, type NavbarProps, Table, type TableAction, type TableColumn, type TextAlign };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,46 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';var he=require('react'),reactDom=require('react-dom'),lucideReact=require('lucide-react'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var he__default=/*#__PURE__*/_interopDefault(he);var O=he.forwardRef(({icon:a,color:o="#6366f1",label:s,error:r,variant:i="standard",type:m="text",value:n="",onChange:l,onClear:d,placeholder:u,disabled:f,className:N="",kd:I={},...z},C)=>{let[h,x]=he.useState(false),R=v=>{l&&l(v.target.value);},p=h||n&&n.toString().length>0,k=()=>{let v="block w-full text-sm transition-all outline-none dark:text-white";switch(i){case "filled":return `${v} pt-6 pb-3 px-4 bg-slate-100 dark:bg-slate-800 border-b-2 border-transparent rounded-t-xl focus:bg-slate-50 dark:focus:bg-slate-900 focus:border-[var(--highlight)] ${r?"border-red-400 bg-red-50 dark:bg-red-950/20":""}`;case "underlined":return `${v} pt-6 pb-3 bg-transparent border-b-2 border-slate-200 dark:border-slate-800 rounded-none px-0 focus:border-[var(--highlight)] focus:ring-0 ${r?"border-red-400":""}`;default:return `${v} py-3.5 px-4 bg-white dark:bg-slate-900 border rounded-xl
|
|
2
|
+
${r?"border-red-400 focus:border-red-500 ring-0 focus:ring-2 focus:ring-red-500/10":"border-slate-200 dark:border-slate-800 focus:border-[var(--highlight)] ring-0 focus:ring-2 focus:ring-[var(--highlight)]/20"}`}};return jsxRuntime.jsxs("div",{className:`flex flex-col gap-1 w-full ${N}`,style:{"--highlight":o},children:[jsxRuntime.jsxs("div",{className:"relative flex items-center group",children:[s&&jsxRuntime.jsx("label",{className:`
|
|
3
|
+
absolute pointer-events-none transition-all duration-200 ease-in-out z-20
|
|
4
|
+
${p?`text-[10px] font-bold uppercase tracking-wider ${r?"text-red-500":"text-[var(--highlight)]"}`:"text-sm font-medium text-slate-400"}
|
|
5
|
+
|
|
6
|
+
/* Alineaci\xF3n Horizontal: Uniforme en standard y filled */
|
|
7
|
+
${i==="underlined"?"left-0":"left-4"}
|
|
8
|
+
|
|
9
|
+
/* Posicionamiento Vertical */
|
|
10
|
+
${i==="standard"?p?"-top-2 px-1.5 bg-white dark:bg-slate-900 translate-x-[-4px]":"top-1/2 -translate-y-1/2":p?"top-1.5":"top-[31px] -translate-y-1/2"}
|
|
11
|
+
|
|
12
|
+
/* Ajuste por Icono cuando NO flota */
|
|
13
|
+
${!p&&a?"pl-7":""}
|
|
14
|
+
`,children:s}),a&&jsxRuntime.jsx("div",{className:`absolute flex items-center pointer-events-none transition-colors duration-200 z-10
|
|
15
|
+
${i==="underlined"?"left-0":"left-4"}
|
|
16
|
+
${i==="standard"?"top-1/2 -translate-y-1/2":"top-[31px] -translate-y-1/2"}
|
|
17
|
+
${r?"text-red-400":h?"text-[var(--highlight)]":"text-slate-400"}`,children:jsxRuntime.jsx(a,{className:"w-4 h-4"})}),jsxRuntime.jsx("input",{ref:C,type:m,value:n,onFocus:()=>x(true),onBlur:()=>x(false),onChange:R,disabled:f,placeholder:h&&p?u:"",style:{...I},className:`
|
|
18
|
+
${k()}
|
|
19
|
+
${f?"opacity-50 cursor-not-allowed":""}
|
|
20
|
+
/* Padding Left: alineado con el icono */
|
|
21
|
+
${a?i==="underlined"?"pl-7":"pl-11":i==="underlined"?"pl-0":"pl-4"}
|
|
22
|
+
${d?"pr-10":"pr-4"}
|
|
23
|
+
relative z-0
|
|
24
|
+
`,...z}),n&&d&&!f&&jsxRuntime.jsx("button",{type:"button",onClick:d,className:`absolute right-0 flex items-center text-slate-400 hover:text-slate-600 dark:hover:text-slate-200 transition-colors z-20
|
|
25
|
+
${i==="underlined"?"pr-0 top-[31px] -translate-y-1/2":"pr-3 top-1/2 -translate-y-1/2"}`,children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]}),r&&jsxRuntime.jsx("span",{className:"text-[10px] font-bold text-red-500 ml-1 uppercase tracking-tight animate-in slide-in-from-top-1 duration-200",children:r})]})});O.displayName="Input";var L=he.forwardRef(({color:a="#6366f1",label:o,value:s=false,onChange:r,kd:i={},className:m="",disabled:n=false,...l},d)=>{let u=N=>{r&&r(N.target.checked);},f={"--tw-ring-color":a,borderColor:s?a:"#94a3b8",backgroundColor:s?a:"transparent",...i};return jsxRuntime.jsxs("label",{className:`inline-flex items-center gap-3 cursor-pointer select-none ${n?"opacity-50 cursor-not-allowed":""} ${m}`,children:[jsxRuntime.jsxs("div",{className:"relative flex items-center justify-center",children:[jsxRuntime.jsx("input",{ref:d,type:"checkbox",checked:s,onChange:u,disabled:n,className:"peer sr-only",...l}),jsxRuntime.jsx("div",{style:f,className:"w-5 h-5 border-2 rounded-md transition-all duration-200 ease-in-out peer-focus:ring-2 peer-focus:ring-offset-2 peer-focus:ring-offset-white dark:peer-focus:ring-offset-slate-900 flex items-center justify-center",children:s&&jsxRuntime.jsx(lucideReact.Check,{size:14,className:"text-white animate-in zoom-in-50 duration-200",strokeWidth:4})})]}),o&&jsxRuntime.jsx("span",{className:"text-sm font-medium leading-none",children:o})]})});L.displayName="CheckBox";var j=he.forwardRef(({label:a="Bot\xF3n",color:o="#6366f1",variant:s="filled",icon:r,iconPosition:i="left",textAlign:m="center",type:n="button",onClick:l,className:d="",disabled:u=false,loading:f=false,kd:N={},...I},z)=>{let[C,h]=he.useState(false),x={left:"justify-start",center:"justify-center",right:"justify-end"};return jsxRuntime.jsx("button",{ref:z,type:n,disabled:u||f,onMouseEnter:()=>h(true),onMouseLeave:()=>h(false),onClick:l,style:{...(()=>{let p=C&&!u&&!f,k={opacity:u||f?.6:1,cursor:u||f?"not-allowed":"pointer",transition:"all 300ms cubic-bezier(0.4, 0, 0.2, 1)"};switch(s){case "filled":return {...k,backgroundColor:o,color:"#ffffff",border:"1px solid transparent",filter:p?"brightness(0.9)":"none",boxShadow:p?"0 4px 12px rgba(0,0,0,0.15)":"none"};case "dotted":return {...k,backgroundColor:p?`${o}15`:"transparent",color:o,border:`2px dotted ${o}`,transform:p?"translateY(-1px)":"none"};case "ghost-hover":return {...k,backgroundColor:p?o:"transparent",color:p?"#ffffff":"currentColor",borderColor:p?"transparent":"currentColor",borderWidth:"1px",borderStyle:"solid"};default:return k}})(),...N},className:`
|
|
26
|
+
group relative px-6 py-3 rounded-lg font-medium
|
|
27
|
+
active:scale-[0.98] flex items-center min-w-[140px] overflow-hidden
|
|
28
|
+
${x[m]}
|
|
29
|
+
${d}
|
|
30
|
+
`,...I,children:jsxRuntime.jsxs("div",{className:`flex items-center gap-2 ${i==="right"?"flex-row-reverse":"flex-row"}`,children:[f?jsxRuntime.jsx(lucideReact.Loader2,{className:"animate-spin",size:18}):r&&jsxRuntime.jsx("span",{className:`flex items-center transition-transform duration-300 ${C&&!u?"scale-110":""}`,children:r}),jsxRuntime.jsx("span",{className:"leading-none",children:f?"Cargando...":a})]})})});j.displayName="Button";var _=he.createContext({darkMode:false,color:"#2563eb"}),q=()=>he.useContext(_),Me=he__default.default.memo(({row:a,columns:o,selectable:s,isSelected:r,onSelect:i})=>{let{color:m}=q(),n={left:"text-left",center:"text-center",right:"text-right"};return jsxRuntime.jsxs("tr",{className:"group transition-colors duration-150 hover:bg-[var(--highlight)]/5",children:[s&&jsxRuntime.jsx("td",{className:"px-6 py-4 border-b border-transparent",children:jsxRuntime.jsx(L,{color:m,value:r,onChange:()=>i(a.id)})}),o.filter(l=>!l.hidden).map(l=>jsxRuntime.jsx("td",{className:`
|
|
31
|
+
whitespace-nowrap px-6 py-4
|
|
32
|
+
text-slate-600 dark:text-slate-300
|
|
33
|
+
transition-colors group-hover:text-slate-900 dark:group-hover:text-white
|
|
34
|
+
${n[l.align||"left"]}
|
|
35
|
+
`,children:l.actions?jsxRuntime.jsx(Le,{actions:l.actions,row:a}):l.format?l.format(a[l.accessor],a,m):String(a[l.accessor]??"")},String(l.accessor)))]})}),Ee=({isOpen:a,onClose:o,anchorRect:s,actions:r,row:i})=>{let{darkMode:m,color:n}=q();if(!a||!s)return null;let l={position:"fixed",top:`${s.bottom+8}px`,left:`${s.right-192}px`,zIndex:9999};return reactDom.createPortal(jsxRuntime.jsxs("div",{className:m?"dark":"",style:{"--highlight":n},children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-[9998]",onClick:o}),jsxRuntime.jsx("div",{style:l,className:"w-48 overflow-hidden rounded-xl border border-slate-200 bg-white shadow-2xl ring-1 ring-black ring-opacity-5 dark:border-slate-700 dark:bg-slate-800 animate-in fade-in zoom-in duration-150",children:jsxRuntime.jsx("div",{className:"py-1",children:r.map((d,u)=>{let f=d.icon;return jsxRuntime.jsxs("button",{onClick:()=>{d.onClick(i),o();},className:`flex w-full items-center gap-3 px-4 py-2.5 text-sm transition-colors hover:bg-slate-50 dark:hover:bg-slate-700/50 ${d.color||"text-slate-700 dark:text-slate-200"}`,children:[f&&jsxRuntime.jsx(f,{className:"w-4 h-4 opacity-70"}),jsxRuntime.jsx("span",{className:"font-medium",children:d.label})]},u)})})})]}),document.body)},Le=({actions:a,row:o})=>{let[s,r]=he.useState(false),[i,m]=he.useState(null),n=he.useRef(null);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{ref:n,onClick:d=>{d.stopPropagation(),n.current&&m(n.current.getBoundingClientRect()),r(!s);},className:`p-2 rounded-full transition-all duration-200 ${s?"bg-[var(--highlight)]/10 text-[var(--highlight)]":"hover:bg-slate-100 dark:hover:bg-slate-800 text-slate-400"}`,children:jsxRuntime.jsx(lucideReact.MoreHorizontal,{className:"w-5 h-5"})}),jsxRuntime.jsx(Ee,{isOpen:s,onClose:()=>r(false),anchorRect:i,actions:a,row:o})]})},lt=({data:a=[],columns:o=[],pagination:s=true,selectable:r=false,customArrayPagination:i=[5,10,25,50,100],defaultPageSize:m=10,filter:n=false,filterPlaceholder:l="Buscar registros...",color:d="#2563eb",add:u=false,textAdd:f="Agregar",actionAdd:N=()=>{},excelExport:I=false,onDeleteRows:z=()=>{},emptyState:C,darkMode:h=false})=>{let[x,R]=he.useState(1),[p,k]=he.useState(m),[v,W]=he.useState(""),[b,Q]=he.useState({key:null,direction:"asc"}),[S,H]=he.useState(new Set),Z=he.useMemo(()=>({darkMode:h,color:d}),[h,d]),ee=t=>{let g="asc";b.key===t&&b.direction==="asc"&&(g="desc"),Q({key:t,direction:g});},M=he.useMemo(()=>{let t=[...a];if(n&&v){let g=o.filter(y=>y.filter).map(y=>y.accessor);t=t.filter(y=>g.some(B=>String(y[B]??"").toLowerCase().includes(v.toLowerCase())));}return b.key&&t.sort((g,y)=>{let B=g[b.key],D=y[b.key];return B<D?b.direction==="asc"?-1:1:B>D?b.direction==="asc"?1:-1:0}),t},[a,v,n,o,b]),U=Math.ceil(M.length/p)||1,T=s?M.slice((x-1)*p,x*p):M,te=()=>{T.length>0&&S.size===T.length?H(new Set):H(new Set(T.map(t=>t.id)));},re=t=>{let g=new Set(S);g.has(t)?g.delete(t):g.add(t),H(g);},ae=()=>{let t=o.filter(A=>!A.hidden&&!A.actions),g=t.map(A=>`"${A.header}"`).join(","),y=M.map(A=>t.map(ne=>{let le=A[ne.accessor];return `"${String(le??"").replace(/"/g,'""')}"`}).join(",")).join(`
|
|
36
|
+
`),B="\uFEFF"+g+`
|
|
37
|
+
`+y,D=new Blob([B],{type:"text/csv;charset=utf-8;"}),se=URL.createObjectURL(D),E=document.createElement("a");E.setAttribute("href",se),E.setAttribute("download",`Export_${new Date().getTime()}.csv`),document.body.appendChild(E),E.click(),document.body.removeChild(E);},oe={left:"text-left",center:"text-center",right:"text-right"};return jsxRuntime.jsx(_.Provider,{value:Z,children:jsxRuntime.jsxs("div",{className:`flex flex-col gap-4 w-full ${h?"dark":""}`,style:{"--highlight":d},children:[jsxRuntime.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4",children:[jsxRuntime.jsxs("div",{className:"flex flex-1 gap-4 w-full sm:w-auto",children:[n&&jsxRuntime.jsx("div",{className:"w-full sm:max-w-xs",children:jsxRuntime.jsx(O,{icon:lucideReact.Search,color:d,value:v,onChange:W,label:l,onClear:()=>W("")})}),r&&S.size>0&&jsxRuntime.jsxs("div",{className:"flex items-center gap-3 animate-in fade-in slide-in-from-left-4",children:[jsxRuntime.jsxs("span",{className:"text-sm font-bold text-slate-500 hidden md:inline",children:[S.size," seleccionados"]}),jsxRuntime.jsxs("button",{onClick:()=>{z(Array.from(S)),H(new Set);},className:"text-xs font-bold text-red-500 hover:text-red-600 bg-red-50 dark:bg-red-500/10 px-4 py-2.5 rounded-xl transition-all active:scale-95 flex items-center gap-2 border border-red-100 dark:border-red-500/20",children:[jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"}),jsxRuntime.jsx("span",{children:"Eliminar"})]})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 w-full sm:w-auto",children:[I&&jsxRuntime.jsx(j,{onClick:ae,color:"green",icon:jsxRuntime.jsx(lucideReact.Download,{className:"w-4 h-4"}),label:"Exportar"}),u&&jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(j,{onClick:N,kd:{backgroundColor:"var(--highlight)"},icon:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),label:f})})]})]}),jsxRuntime.jsx("div",{className:"w-full rounded-2xl border border-slate-200 bg-white shadow-sm dark:border-slate-800 dark:bg-slate-900 overflow-hidden",children:jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:"min-w-full border-separate border-spacing-0 text-sm",children:[jsxRuntime.jsx("thead",{className:"bg-slate-50/50 dark:bg-slate-950/40",children:jsxRuntime.jsxs("tr",{children:[r&&jsxRuntime.jsx("th",{className:"px-6 py-4 border-b border-slate-100 dark:border-slate-800 w-10 text-left",children:jsxRuntime.jsx(L,{color:d,value:T.length>0&&S.size===T.length,onChange:te})}),o.filter(t=>!t.hidden).map(t=>jsxRuntime.jsx("th",{onClick:()=>ee(t.accessor),className:`
|
|
38
|
+
px-6 py-4 font-bold uppercase tracking-tight text-slate-500 dark:text-slate-400
|
|
39
|
+
${oe[t.align||"left"]}
|
|
40
|
+
border-b border-slate-100 dark:border-slate-800 cursor-pointer select-none group/th
|
|
41
|
+
`,children:jsxRuntime.jsxs("div",{className:`flex items-center gap-2 ${t.align==="center"?"justify-center":t.align==="right"?"justify-end":""}`,children:[t.header,jsxRuntime.jsx("span",{className:`transition-colors ${b.key===t.accessor?"text-[var(--highlight)]":"text-slate-300 opacity-0 group-hover/th:opacity-100"}`,children:b.key===t.accessor?b.direction==="asc"?jsxRuntime.jsx(lucideReact.ArrowUp,{className:"w-3 h-3"}):jsxRuntime.jsx(lucideReact.ArrowDown,{className:"w-3 h-3"}):jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"w-3 h-3"})})]})},String(t.accessor)))]})}),jsxRuntime.jsx("tbody",{className:"divide-y divide-slate-100 dark:divide-slate-800",children:T.length>0?T.map(t=>jsxRuntime.jsx(Me,{row:t,columns:o,selectable:r,isSelected:S.has(t.id),onSelect:re},t.id)):jsxRuntime.jsx("tr",{children:jsxRuntime.jsx("td",{colSpan:o.length+(r?1:0),children:C?jsxRuntime.jsx(C,{}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-slate-400 gap-3",children:[jsxRuntime.jsx(lucideReact.Inbox,{className:"w-12 h-12 opacity-20"}),jsxRuntime.jsx("p",{className:"font-medium italic",children:"No se encontraron registros para mostrar"})]})})})})]})})}),s&&M.length>0&&jsxRuntime.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-2 py-2 text-sm text-slate-500 dark:text-slate-400 font-medium",children:[jsxRuntime.jsx("div",{className:"flex items-center gap-4",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{children:"Mostrar"}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("select",{value:p,onChange:t=>{k(Number(t.target.value)),R(1);},className:"appearance-none bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg px-3 py-1.5 pr-8 focus:outline-none focus:ring-2 focus:ring-[var(--highlight)]/20 cursor-pointer text-slate-700 dark:text-slate-300 font-bold",children:i.map(t=>jsxRuntime.jsx("option",{value:t,children:t},t))}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-4 h-4 absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none opacity-50"})]})]})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("button",{onClick:()=>R(t=>Math.max(t-1,1)),disabled:x===1,className:"p-2 rounded-lg border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 disabled:opacity-30 hover:bg-slate-50 dark:hover:bg-slate-800 transition-colors",children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-4 h-4"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1 min-w-[60px] justify-center",children:[jsxRuntime.jsx("span",{className:"font-bold text-[var(--highlight)]",children:x}),jsxRuntime.jsx("span",{className:"opacity-30",children:"/"}),jsxRuntime.jsx("span",{children:U})]}),jsxRuntime.jsx("button",{onClick:()=>R(t=>Math.min(t+1,U)),disabled:x===U,className:"p-2 rounded-lg border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 disabled:opacity-30 hover:bg-slate-50 dark:hover:bg-slate-800 transition-colors",children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-4 h-4"})})]})]})]})})};var ht=({title:a="Kydra Nav",position:o="static",color:s="#6366f1",colorDominant:r=false,isMenuOpen:i=false,onToggleMenu:m,children:n,kd:l={}})=>{let d=()=>{switch(o){case "sticky":return "sticky top-0 z-50";case "fixed-bottom-floating":return "fixed bottom-6 left-6 right-6 z-50 rounded-2xl shadow-2xl max-w-5xl mx-auto";default:return "relative"}},u={backgroundColor:r?s:void 0,borderColor:r?"transparent":`${s}40`,color:r?"#ffffff":void 0,...l};return jsxRuntime.jsxs("nav",{style:u,className:`
|
|
42
|
+
${d()}
|
|
43
|
+
px-6 py-4 border-b transition-all duration-300
|
|
44
|
+
${r?"border-none text-white":"bg-white/80 dark:bg-slate-900/80 backdrop-blur-md dark:border-slate-800 text-slate-900 dark:text-white"}
|
|
45
|
+
`,children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-4",children:[jsxRuntime.jsx("div",{className:"flex items-center gap-2 font-black text-lg tracking-tight",children:typeof a=="string"?jsxRuntime.jsx("span",{style:{color:r?"white":s},children:a}):a}),jsxRuntime.jsx("div",{className:"hidden md:flex items-center gap-6",children:n}),jsxRuntime.jsx("button",{onClick:m,className:`md:hidden p-2 rounded-lg transition-colors ${r?"hover:bg-white/10":"hover:bg-black/5 dark:hover:bg-white/5"}`,children:i?jsxRuntime.jsx(lucideReact.X,{size:24}):jsxRuntime.jsx(lucideReact.Menu,{size:24})})]}),i&&jsxRuntime.jsx("div",{className:`md:hidden mt-4 pb-4 animate-in slide-in-from-top-2 duration-200 border-t pt-4 ${r?"border-white/20":"border-black/5 dark:border-white/5"}`,children:jsxRuntime.jsx("div",{className:"flex flex-col gap-4",children:n})})]})};exports.Button=j;exports.CheckBox=L;exports.Input=O;exports.Navbar=ht;exports.Table=lt;//# sourceMappingURL=index.js.map
|
|
2
46
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/components/Table.tsx"],"sourcesContent":["export * from './components/Table'","export const Table = ({ data, columns }: any) => {\r\n return (\r\n <div className=\"mt-6 overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm transition-all dark:border-slate-800 dark:bg-slate-900 dark:shadow-2xl\">\r\n <table className=\"min-w-full divide-y divide-slate-200 text-left text-sm dark:divide-slate-800\">\r\n <thead className=\"bg-slate-50 dark:bg-slate-950/50\">\r\n <tr>\r\n {columns.map((col: any) => (\r\n <th \r\n key={col.accessor} \r\n className=\"px-6 py-4 font-semibold uppercase tracking-wider text-slate-700 dark:text-amber-400\"\r\n >\r\n {col.header}\r\n </th>\r\n ))}\r\n </tr>\r\n </thead>\r\n <tbody className=\"divide-y divide-slate-200 dark:divide-slate-800\">\r\n {data.map((row: any, i: number) => (\r\n <tr \r\n key={i} \r\n className=\"group hover:bg-slate-50 transition-all duration-200 dark:hover:bg-slate-800/50\"\r\n >\r\n {columns.map((col: any) => (\r\n <td \r\n key={col.accessor} \r\n className=\"whitespace-nowrap px-6 py-4 text-slate-600 transition-colors group-hover:text-slate-900 dark:text-slate-300 dark:group-hover:text-white\"\r\n >\r\n {row[col.accessor]}\r\n </td>\r\n ))}\r\n </tr>\r\n ))}\r\n </tbody>\r\n </table>\r\n </div>\r\n );\r\n};"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,IAAA,eAAAC,EAAAH,GCGM,IAAAI,EAAA,6BAHOC,EAAQ,CAAC,CAAE,KAAAC,EAAM,QAAAC,CAAQ,OAElC,OAAC,OAAI,UAAU,oJACb,oBAAC,SAAM,UAAU,+EACf,oBAAC,SAAM,UAAU,mCACf,mBAAC,MACE,SAAAA,EAAQ,IAAKC,MACZ,OAAC,MAEC,UAAU,sFAET,SAAAA,EAAI,QAHAA,EAAI,QAIX,CACD,EACH,EACF,KACA,OAAC,SAAM,UAAU,kDACd,SAAAF,EAAK,IAAI,CAACG,EAAUC,OACnB,OAAC,MAEC,UAAU,iFAET,SAAAH,EAAQ,IAAKC,MACZ,OAAC,MAEC,UAAU,0IAET,SAAAC,EAAID,EAAI,QAAQ,GAHZA,EAAI,QAIX,CACD,GAVIE,CAWP,CACD,EACH,GACF,EACF","names":["index_exports","__export","Table","__toCommonJS","import_jsx_runtime","Table","data","columns","col","row","i"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/Input/Input.tsx","../src/components/CheckBox/CheckBox.tsx","../src/components/Button/Button.tsx","../src/components/Table.tsx","../src/components/Nav.tsx"],"names":["Input","forwardRef","Icon","color","label","error","variant","type","value","onChange","onClear","placeholder","disabled","className","kd","props","ref","isFocused","setIsFocused","useState","handleChange","e","isFloating","getVariantClasses","base","jsxs","jsx","X","CheckBox","customBoxStyles","Check","Button","icon","iconPosition","textAlign","onClick","loading","isHovered","setIsHovered","alignmentStyles","activeHover","baseStyles","Loader2","TableContext","createContext","useTableTheme","useContext","TableRow","React","row","columns","selectable","isSelected","onSelect","alignmentClasses","c","col","ActionButton","DropdownPortal","isOpen","onClose","anchorRect","actions","darkMode","style","createPortal","action","index","setIsOpen","setAnchorRect","buttonRef","useRef","Fragment","MoreHorizontal","Table","data","pagination","customArrayPagination","defaultPageSize","filter","filterPlaceholder","add","textAdd","actionAdd","excelExport","onDeleteRows","CustomEmptyState","currentPage","setCurrentPage","pageSize","setPageSize","searchTerm","setSearchTerm","sortConfig","setSortConfig","selectedRows","setSelectedRows","themeValue","useMemo","handleSort","key","direction","processedData","result","searchableAccessors","acc","a","b","valA","valB","totalPages","currentData","toggleSelectAll","r","toggleSelectRow","id","newSelection","handleExportCSV","visibleColumns","headers","rows","val","csvContent","blob","url","link","Search","Trash2","Download","Plus","ArrowUp","ArrowDown","ArrowUpDown","Inbox","size","ChevronDown","p","ChevronLeft","ChevronRight","Navbar","title","position","colorDominant","isMenuOpen","onToggleMenu","children","getPosition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AI,SAAA,CAAW,CAAA,8EAAA,EAAiFoH,CAAAA,CAAgB,kBAAoB,oCAAoC,CAAA,CAAA,CACvK,QAAA,CAAApH,cAAAA,CAAC,OAAI,SAAA,CAAU,qBAAA,CACZ,SAAAuH,CAAAA,CACH,CAAA,CACF,GAEJ,CAEJ","file":"index.js","sourcesContent":["import { X } from \"lucide-react\";\r\nimport { CSSProperties, forwardRef, useState } from \"react\";\r\nimport { InputProps } from \"./Input.types\";\r\n\r\n\r\nexport const Input = forwardRef<HTMLInputElement, InputProps>(({\r\n icon: Icon,\r\n color = \"#6366f1\",\r\n label,\r\n error,\r\n variant = \"standard\",\r\n type = \"text\",\r\n value = \"\",\r\n onChange,\r\n onClear,\r\n placeholder,\r\n disabled,\r\n className = \"\",\r\n kd = {},\r\n ...props\r\n}, ref) => {\r\n const [isFocused, setIsFocused] = useState(false);\r\n \r\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n if (onChange) onChange(e.target.value);\r\n };\r\n\r\n const isFloating = isFocused || (value && value.toString().length > 0);\r\n\r\n const getVariantClasses = () => {\r\n const base = \"block w-full text-sm transition-all outline-none dark:text-white\";\r\n \r\n switch (variant) {\r\n case 'filled':\r\n return `${base} pt-6 pb-3 px-4 bg-slate-100 dark:bg-slate-800 border-b-2 border-transparent rounded-t-xl focus:bg-slate-50 dark:focus:bg-slate-900 focus:border-[var(--highlight)] ${error ? 'border-red-400 bg-red-50 dark:bg-red-950/20' : ''}`;\r\n case 'underlined':\r\n return `${base} pt-6 pb-3 bg-transparent border-b-2 border-slate-200 dark:border-slate-800 rounded-none px-0 focus:border-[var(--highlight)] focus:ring-0 ${error ? 'border-red-400' : ''}`;\r\n case 'standard':\r\n default:\r\n // Ajustado: Se eliminan las clases por defecto de Tailwind de ring para usar el color dinámico en el borde de focus\r\n return `${base} py-3.5 px-4 bg-white dark:bg-slate-900 border rounded-xl \r\n ${error \r\n ? 'border-red-400 focus:border-red-500 ring-0 focus:ring-2 focus:ring-red-500/10' \r\n : 'border-slate-200 dark:border-slate-800 focus:border-[var(--highlight)] ring-0 focus:ring-2 focus:ring-[var(--highlight)]/20'}`;\r\n }\r\n };\r\n\r\n return (\r\n <div className={`flex flex-col gap-1 w-full ${className}`} style={{ '--highlight': color } as CSSProperties}>\r\n <div className=\"relative flex items-center group\">\r\n \r\n {/* Label Flotante - Ajustado simétricamente */}\r\n {label && (\r\n <label \r\n className={`\r\n absolute pointer-events-none transition-all duration-200 ease-in-out z-20\r\n ${isFloating \r\n ? `text-[10px] font-bold uppercase tracking-wider ${error ? 'text-red-500' : 'text-[var(--highlight)]'}` \r\n : 'text-sm font-medium text-slate-400'}\r\n \r\n /* Alineación Horizontal: Uniforme en standard y filled */\r\n ${variant === 'underlined' ? 'left-0' : 'left-4'}\r\n\r\n /* Posicionamiento Vertical */\r\n ${variant === 'standard' \r\n ? (isFloating ? '-top-2 px-1.5 bg-white dark:bg-slate-900 translate-x-[-4px]' : 'top-1/2 -translate-y-1/2') \r\n : (isFloating ? 'top-1.5' : 'top-[31px] -translate-y-1/2')}\r\n\r\n /* Ajuste por Icono cuando NO flota */\r\n ${!isFloating && Icon ? 'pl-7' : ''}\r\n `}\r\n >\r\n {label}\r\n </label>\r\n )}\r\n\r\n {/* Icono */}\r\n {Icon && (\r\n <div className={`absolute flex items-center pointer-events-none transition-colors duration-200 z-10\r\n ${variant === 'underlined' ? 'left-0' : 'left-4'}\r\n ${variant === 'standard' ? 'top-1/2 -translate-y-1/2' : 'top-[31px] -translate-y-1/2'}\r\n ${error ? 'text-red-400' : isFocused ? 'text-[var(--highlight)]' : 'text-slate-400'}`}>\r\n <Icon className=\"w-4 h-4\" />\r\n </div>\r\n )}\r\n\r\n <input\r\n ref={ref}\r\n type={type}\r\n value={value}\r\n onFocus={() => setIsFocused(true)}\r\n onBlur={() => setIsFocused(false)}\r\n onChange={handleChange}\r\n disabled={disabled}\r\n placeholder={isFocused && isFloating ? placeholder : \"\"} \r\n style={{ ...kd } as CSSProperties}\r\n className={`\r\n ${getVariantClasses()}\r\n ${disabled ? 'opacity-50 cursor-not-allowed' : ''}\r\n /* Padding Left: alineado con el icono */\r\n ${Icon ? (variant === 'underlined' ? 'pl-7' : 'pl-11') : (variant === 'underlined' ? 'pl-0' : 'pl-4')}\r\n ${onClear ? 'pr-10' : 'pr-4'}\r\n relative z-0\r\n `}\r\n {...props}\r\n />\r\n\r\n {/* Botón de Limpiar */}\r\n {value && onClear && !disabled && (\r\n <button \r\n type=\"button\"\r\n onClick={onClear}\r\n className={`absolute right-0 flex items-center text-slate-400 hover:text-slate-600 dark:hover:text-slate-200 transition-colors z-20\r\n ${variant === 'underlined' ? 'pr-0 top-[31px] -translate-y-1/2' : 'pr-3 top-1/2 -translate-y-1/2'}`}\r\n >\r\n <X className=\"w-4 h-4\" />\r\n </button>\r\n )}\r\n </div>\r\n \r\n {error && <span className=\"text-[10px] font-bold text-red-500 ml-1 uppercase tracking-tight animate-in slide-in-from-top-1 duration-200\">{error}</span>}\r\n </div>\r\n );\r\n});\r\n\r\n\r\nInput.displayName = \"Input\";","import { Check } from \"lucide-react\";\r\nimport { CSSProperties, forwardRef } from \"react\";\r\nimport { CheckBoxProps } from \"./CheckBox.types\";\r\n\r\n\r\n/**\r\n * Componente CheckBox - Core librería @kydra/ui\r\n */\r\nexport const CheckBox = forwardRef<HTMLInputElement, CheckBoxProps>(({\r\n color = \"#6366f1\",\r\n label,\r\n value = false,\r\n onChange,\r\n kd = {},\r\n className = \"\",\r\n disabled = false,\r\n ...props\r\n}, ref) => {\r\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n if (onChange) onChange(e.target.checked);\r\n };\r\n\r\n const customBoxStyles: CSSProperties = {\r\n '--tw-ring-color': color,\r\n borderColor: value ? color : '#94a3b8',\r\n backgroundColor: value ? color : 'transparent',\r\n ...kd\r\n } as CSSProperties;\r\n\r\n return (\r\n <label className={`inline-flex items-center gap-3 cursor-pointer select-none ${disabled ? 'opacity-50 cursor-not-allowed' : ''} ${className}`}>\r\n <div className=\"relative flex items-center justify-center\">\r\n <input ref={ref} type=\"checkbox\" checked={value} onChange={handleChange} disabled={disabled} className=\"peer sr-only\" {...props} />\r\n <div style={customBoxStyles} className=\"w-5 h-5 border-2 rounded-md transition-all duration-200 ease-in-out peer-focus:ring-2 peer-focus:ring-offset-2 peer-focus:ring-offset-white dark:peer-focus:ring-offset-slate-900 flex items-center justify-center\">\r\n {value && <Check size={14} className=\"text-white animate-in zoom-in-50 duration-200\" strokeWidth={4} />}\r\n </div>\r\n </div>\r\n {label && <span className=\"text-sm font-medium leading-none\">{label}</span>}\r\n </label>\r\n );\r\n});\r\n\r\nCheckBox.displayName = \"CheckBox\";","import { useState, forwardRef, CSSProperties } from 'react';\r\nimport { Loader2 } from 'lucide-react';\r\nimport { ButtonProps, TextAlign } from './Button.types';\r\n\r\n\r\n/**\r\n * Componente Button - Core librería @kydra/ui\r\n */\r\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(({\r\n label = \"Botón\",\r\n color = \"#6366f1\",\r\n variant = \"filled\",\r\n icon,\r\n iconPosition = \"left\",\r\n textAlign = \"center\",\r\n type = \"button\",\r\n onClick,\r\n className = \"\",\r\n disabled = false,\r\n loading = false,\r\n kd = {},\r\n ...props\r\n}, ref) => {\r\n const [isHovered, setIsHovered] = useState(false);\r\n\r\n // Mapeo de estilos de alineación\r\n const alignmentStyles: Record<TextAlign, string> = {\r\n left: 'justify-start',\r\n center: 'justify-center',\r\n right: 'justify-end'\r\n };\r\n\r\n // Lógica de estilos dinámicos\r\n const getDynamicStyles = (): CSSProperties => {\r\n const activeHover = isHovered && !disabled && !loading;\r\n\r\n const baseStyles: CSSProperties = {\r\n opacity: disabled || loading ? 0.6 : 1,\r\n cursor: disabled || loading ? 'not-allowed' : 'pointer',\r\n transition: 'all 300ms cubic-bezier(0.4, 0, 0.2, 1)',\r\n };\r\n\r\n switch (variant) {\r\n case 'filled':\r\n return {\r\n ...baseStyles,\r\n backgroundColor: color,\r\n color: '#ffffff',\r\n border: '1px solid transparent',\r\n filter: activeHover ? 'brightness(0.9)' : 'none',\r\n boxShadow: activeHover ? '0 4px 12px rgba(0,0,0,0.15)' : 'none',\r\n };\r\n case 'dotted':\r\n return {\r\n ...baseStyles,\r\n backgroundColor: activeHover ? `${color}15` : 'transparent',\r\n color: color,\r\n border: `2px dotted ${color}`,\r\n transform: activeHover ? 'translateY(-1px)' : 'none',\r\n };\r\n case 'ghost-hover':\r\n return {\r\n ...baseStyles,\r\n backgroundColor: activeHover ? color : 'transparent',\r\n color: activeHover ? '#ffffff' : 'currentColor',\r\n borderColor: activeHover ? 'transparent' : 'currentColor',\r\n borderWidth: '1px',\r\n borderStyle: 'solid',\r\n };\r\n default:\r\n return baseStyles;\r\n }\r\n };\r\n\r\n return (\r\n <button\r\n ref={ref}\r\n type={type}\r\n disabled={disabled || loading}\r\n onMouseEnter={() => setIsHovered(true)}\r\n onMouseLeave={() => setIsHovered(false)}\r\n onClick={onClick}\r\n style={{ ...getDynamicStyles(), ...kd }}\r\n className={`\r\n group relative px-6 py-3 rounded-lg font-medium \r\n active:scale-[0.98] flex items-center min-w-[140px] overflow-hidden\r\n ${alignmentStyles[textAlign]}\r\n ${className}\r\n `}\r\n {...props}\r\n >\r\n <div className={`flex items-center gap-2 ${iconPosition === 'right' ? 'flex-row-reverse' : 'flex-row'}`}>\r\n {loading ? (\r\n <Loader2 className=\"animate-spin\" size={18} />\r\n ) : (\r\n icon && (\r\n <span className={`flex items-center transition-transform duration-300 ${isHovered && !disabled ? 'scale-110' : ''}`}>\r\n {icon}\r\n </span>\r\n )\r\n )}\r\n <span className=\"leading-none\">{loading ? 'Cargando...' : label}</span>\r\n </div>\r\n </button>\r\n );\r\n});\r\n\r\nButton.displayName = \"Button\";","import React, { \r\n useState, \r\n useMemo, \r\n useRef,\r\n useContext,\r\n createContext\r\n} from 'react';\r\nimport { createPortal } from 'react-dom';\r\nimport { \r\n MoreHorizontal,\r\n Trash2, \r\n ChevronLeft, \r\n ChevronRight, \r\n ChevronDown, \r\n Search, \r\n Plus,\r\n ArrowUp,\r\n ArrowDown,\r\n ArrowUpDown,\r\n Inbox,\r\n Download,\r\n LucideIcon,\r\n} from 'lucide-react';\r\nimport { Input } from './Input/Input';\r\nimport { CheckBox } from './CheckBox/CheckBox';\r\nimport { Button } from './Button/Button';\r\n\r\n// --- Contexto para el Tema ---\r\ninterface TableTheme {\r\n darkMode: boolean;\r\n color: string;\r\n}\r\n\r\nconst TableContext = createContext<TableTheme>({ darkMode: false, color: '#2563eb' });\r\nconst useTableTheme = () => useContext(TableContext);\r\n\r\n// --- Tipos e Interfaces ---\r\n\r\nexport interface TableAction<T> {\r\n label: string;\r\n icon?: LucideIcon;\r\n onClick: (row: T) => void;\r\n color?: string;\r\n}\r\n\r\nexport interface TableColumn<T> {\r\n header: string;\r\n accessor: keyof T;\r\n filter?: boolean;\r\n hidden?: boolean;\r\n align?: 'left' | 'center' | 'right';\r\n format?: (value: any, row: T, highlightColor: string) => React.ReactNode;\r\n actions?: TableAction<T>[];\r\n}\r\n\r\ninterface TableProps<T> {\r\n data: T[];\r\n columns: TableColumn<T>[];\r\n pagination?: boolean;\r\n selectable?: boolean;\r\n customArrayPagination?: number[];\r\n defaultPageSize?: number;\r\n filter?: boolean;\r\n filterPlaceholder?: string;\r\n color?: string;\r\n add?: boolean;\r\n textAdd?: string;\r\n actionAdd?: () => void;\r\n excelExport?: boolean;\r\n onDeleteRows?: (ids: (string | number)[]) => void;\r\n emptyState?: React.ComponentType;\r\n darkMode?: boolean;\r\n}\r\n\r\ninterface Identifiable {\r\n id: string | number;\r\n}\r\n\r\n// --- Componentes de Fila y Acción ---\r\n\r\nconst TableRow = React.memo(<T extends Identifiable>({ \r\n row, \r\n columns, \r\n selectable,\r\n isSelected, \r\n onSelect \r\n}: {\r\n row: T;\r\n columns: TableColumn<T>[];\r\n selectable: boolean;\r\n isSelected: boolean;\r\n onSelect: (id: string | number) => void;\r\n}) => {\r\n const { color } = useTableTheme();\r\n const alignmentClasses = { left: 'text-left', center: 'text-center', right: 'text-right' };\r\n\r\n return (\r\n <tr className=\"group transition-colors duration-150 hover:bg-[var(--highlight)]/5\">\r\n {selectable && (\r\n <td className=\"px-6 py-4 border-b border-transparent\">\r\n <CheckBox color={color} value={isSelected} onChange={() => onSelect(row.id)}/>\r\n </td>\r\n )}\r\n {columns.filter(c => !c.hidden).map((col) => (\r\n <td\r\n key={String(col.accessor)}\r\n className={`\r\n whitespace-nowrap px-6 py-4 \r\n text-slate-600 dark:text-slate-300\r\n transition-colors group-hover:text-slate-900 dark:group-hover:text-white\r\n ${alignmentClasses[col.align || 'left']}\r\n `}\r\n >\r\n {col.actions ? (\r\n <ActionButton actions={col.actions} row={row} />\r\n ) : col.format ? (\r\n col.format(row[col.accessor], row, color)\r\n ) : (\r\n String(row[col.accessor] ?? '')\r\n )}\r\n </td>\r\n ))}\r\n </tr>\r\n );\r\n});\r\n\r\nconst DropdownPortal = <T,>({ isOpen, onClose, anchorRect, actions, row }: {\r\n isOpen: boolean;\r\n onClose: () => void;\r\n anchorRect: DOMRect | null;\r\n actions: TableAction<T>[];\r\n row: T;\r\n}) => {\r\n const { darkMode, color } = useTableTheme();\r\n if (!isOpen || !anchorRect) return null;\r\n\r\n const style: React.CSSProperties = {\r\n position: 'fixed',\r\n top: `${anchorRect.bottom + 8}px`,\r\n left: `${anchorRect.right - 192}px`, \r\n zIndex: 9999,\r\n };\r\n\r\n return createPortal(\r\n <div className={darkMode ? 'dark' : ''} style={{ '--highlight': color } as React.CSSProperties}>\r\n <div className=\"fixed inset-0 z-[9998]\" onClick={onClose} />\r\n <div \r\n style={style}\r\n className=\"w-48 overflow-hidden rounded-xl border border-slate-200 bg-white shadow-2xl ring-1 ring-black ring-opacity-5 dark:border-slate-700 dark:bg-slate-800 animate-in fade-in zoom-in duration-150\"\r\n >\r\n <div className=\"py-1\">\r\n {actions.map((action, index) => {\r\n const Icon = action.icon;\r\n return (\r\n <button\r\n key={index}\r\n onClick={() => { action.onClick(row); onClose(); }}\r\n className={`flex w-full items-center gap-3 px-4 py-2.5 text-sm transition-colors hover:bg-slate-50 dark:hover:bg-slate-700/50 ${action.color || 'text-slate-700 dark:text-slate-200'}`}\r\n >\r\n {Icon && <Icon className=\"w-4 h-4 opacity-70\" />}\r\n <span className=\"font-medium\">{action.label}</span>\r\n </button>\r\n );\r\n })}\r\n </div>\r\n </div>\r\n </div>,\r\n document.body\r\n );\r\n};\r\n\r\nconst ActionButton = <T,>({ actions, row }: { actions: TableAction<T>[], row: T }) => {\r\n const [isOpen, setIsOpen] = useState(false);\r\n const [anchorRect, setAnchorRect] = useState<DOMRect | null>(null);\r\n const buttonRef = useRef<HTMLButtonElement>(null);\r\n\r\n const handleToggle = (e: React.MouseEvent) => {\r\n e.stopPropagation();\r\n if (buttonRef.current) {\r\n setAnchorRect(buttonRef.current.getBoundingClientRect());\r\n }\r\n setIsOpen(!isOpen);\r\n };\r\n\r\n return (\r\n <>\r\n <button \r\n ref={buttonRef}\r\n onClick={handleToggle}\r\n className={`p-2 rounded-full transition-all duration-200 ${isOpen ? 'bg-[var(--highlight)]/10 text-[var(--highlight)]' : 'hover:bg-slate-100 dark:hover:bg-slate-800 text-slate-400'}`}\r\n >\r\n <MoreHorizontal className=\"w-5 h-5\" />\r\n </button>\r\n <DropdownPortal \r\n isOpen={isOpen} \r\n onClose={() => setIsOpen(false)} \r\n anchorRect={anchorRect} \r\n actions={actions} \r\n row={row} \r\n />\r\n </>\r\n );\r\n};\r\n\r\n// --- Componente Principal ---\r\n\r\nexport const Table = <T extends Identifiable>({ \r\n data = [], \r\n columns = [], \r\n pagination = true, \r\n selectable = false, \r\n customArrayPagination = [5, 10, 25, 50, 100],\r\n defaultPageSize = 10,\r\n filter = false,\r\n filterPlaceholder = \"Buscar registros...\",\r\n color = \"#2563eb\",\r\n add = false,\r\n textAdd = \"Agregar\",\r\n actionAdd = () => {},\r\n excelExport = false, \r\n onDeleteRows = () => {},\r\n emptyState: CustomEmptyState,\r\n darkMode = false\r\n}: TableProps<T>) => {\r\n const [currentPage, setCurrentPage] = useState(1);\r\n const [pageSize, setPageSize] = useState(defaultPageSize);\r\n const [searchTerm, setSearchTerm] = useState(\"\");\r\n const [sortConfig, setSortConfig] = useState<{ key: keyof T | null, direction: 'asc' | 'desc' }>({ key: null, direction: 'asc' });\r\n const [selectedRows, setSelectedRows] = useState<Set<string | number>>(new Set());\r\n\r\n const themeValue = useMemo(() => ({ darkMode, color }), [darkMode, color]);\r\n\r\n const handleSort = (key: keyof T) => {\r\n let direction: 'asc' | 'desc' = 'asc';\r\n if (sortConfig.key === key && sortConfig.direction === 'asc') direction = 'desc';\r\n setSortConfig({ key, direction });\r\n };\r\n\r\n const processedData = useMemo(() => {\r\n let result = [...data];\r\n if (filter && searchTerm) {\r\n const searchableAccessors = columns.filter(c => c.filter).map(c => c.accessor);\r\n result = result.filter(row => \r\n searchableAccessors.some(acc => String(row[acc] ?? '').toLowerCase().includes(searchTerm.toLowerCase()))\r\n );\r\n }\r\n if (sortConfig.key) {\r\n result.sort((a, b) => {\r\n const valA = a[sortConfig.key!];\r\n const valB = b[sortConfig.key!];\r\n if (valA < valB) return sortConfig.direction === 'asc' ? -1 : 1;\r\n if (valA > valB) return sortConfig.direction === 'asc' ? 1 : -1;\r\n return 0;\r\n });\r\n }\r\n return result;\r\n }, [data, searchTerm, filter, columns, sortConfig]);\r\n\r\n const totalPages = Math.ceil(processedData.length / pageSize) || 1;\r\n const currentData = pagination \r\n ? processedData.slice((currentPage - 1) * pageSize, currentPage * pageSize) \r\n : processedData;\r\n\r\n const toggleSelectAll = () => {\r\n if (currentData.length > 0 && selectedRows.size === currentData.length) {\r\n setSelectedRows(new Set());\r\n } else {\r\n setSelectedRows(new Set(currentData.map(r => r.id)));\r\n }\r\n };\r\n\r\n const toggleSelectRow = (id: string | number) => {\r\n const newSelection = new Set(selectedRows);\r\n if (newSelection.has(id)) newSelection.delete(id);\r\n else newSelection.add(id);\r\n setSelectedRows(newSelection);\r\n };\r\n\r\n const handleExportCSV = () => {\r\n const visibleColumns = columns.filter(c => !c.hidden && !c.actions);\r\n const headers = visibleColumns.map(c => `\"${c.header}\"`).join(',');\r\n const rows = processedData.map(row => \r\n visibleColumns.map(c => {\r\n const val = row[c.accessor];\r\n return `\"${String(val ?? '').replace(/\"/g, '\"\"')}\"`;\r\n }).join(',')\r\n ).join('\\n');\r\n\r\n const csvContent = \"\\uFEFF\" + headers + '\\n' + rows;\r\n const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' });\r\n const url = URL.createObjectURL(blob);\r\n const link = document.createElement(\"a\");\r\n link.setAttribute(\"href\", url);\r\n link.setAttribute(\"download\", `Export_${new Date().getTime()}.csv`);\r\n document.body.appendChild(link);\r\n link.click();\r\n document.body.removeChild(link);\r\n };\r\n\r\n const alignmentClasses = { left: 'text-left', center: 'text-center', right: 'text-right' };\r\n\r\n return (\r\n <TableContext.Provider value={themeValue}>\r\n <div className={`flex flex-col gap-4 w-full ${darkMode ? 'dark' : ''}`} style={{ '--highlight': color } as React.CSSProperties}>\r\n <div className=\"flex flex-col sm:flex-row items-center justify-between gap-4\">\r\n <div className=\"flex flex-1 gap-4 w-full sm:w-auto\">\r\n {filter && (\r\n <div className=\"w-full sm:max-w-xs\">\r\n {/* Usamos el InternalInput para evitar errores de compilación por archivos inexistentes */}\r\n <Input \r\n icon={Search}\r\n color={color}\r\n value={searchTerm}\r\n onChange={setSearchTerm}\r\n label={filterPlaceholder}\r\n onClear={() => setSearchTerm(\"\")}\r\n />\r\n </div>\r\n )}\r\n \r\n {selectable && selectedRows.size > 0 && (\r\n <div className=\"flex items-center gap-3 animate-in fade-in slide-in-from-left-4\">\r\n <span className=\"text-sm font-bold text-slate-500 hidden md:inline\">{selectedRows.size} seleccionados</span>\r\n <button \r\n onClick={() => { onDeleteRows(Array.from(selectedRows)); setSelectedRows(new Set()); }}\r\n className=\"text-xs font-bold text-red-500 hover:text-red-600 bg-red-50 dark:bg-red-500/10 px-4 py-2.5 rounded-xl transition-all active:scale-95 flex items-center gap-2 border border-red-100 dark:border-red-500/20\"\r\n >\r\n <Trash2 className=\"w-4 h-4\" />\r\n <span>Eliminar</span>\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n\r\n <div className=\"flex items-center gap-3 w-full sm:w-auto\">\r\n {excelExport && (\r\n <Button\r\n onClick={handleExportCSV}\r\n color='green'\r\n icon={<Download className=\"w-4 h-4\" />}\r\n label='Exportar'\r\n >\r\n \r\n </Button>\r\n )}\r\n\r\n {add && (\r\n <>\r\n <Button\r\n onClick={actionAdd}\r\n kd={{ backgroundColor: 'var(--highlight)'}}\r\n icon={<Plus className=\"w-4 h-4\" />}\r\n label={textAdd}\r\n >\r\n </Button>\r\n </>\r\n )}\r\n </div>\r\n </div>\r\n\r\n <div className=\"w-full rounded-2xl border border-slate-200 bg-white shadow-sm dark:border-slate-800 dark:bg-slate-900 overflow-hidden\">\r\n <div className=\"overflow-x-auto\">\r\n <table className=\"min-w-full border-separate border-spacing-0 text-sm\">\r\n <thead className=\"bg-slate-50/50 dark:bg-slate-950/40\">\r\n <tr>\r\n {selectable && (\r\n <th className=\"px-6 py-4 border-b border-slate-100 dark:border-slate-800 w-10 text-left\">\r\n <CheckBox color={color} value={currentData.length > 0 && selectedRows.size === currentData.length} onChange={toggleSelectAll}/>\r\n </th>\r\n )} \r\n {columns.filter(c => !c.hidden).map((col) => (\r\n <th\r\n key={String(col.accessor)}\r\n onClick={() => handleSort(col.accessor)}\r\n className={`\r\n px-6 py-4 font-bold uppercase tracking-tight text-slate-500 dark:text-slate-400\r\n ${alignmentClasses[col.align || 'left']}\r\n border-b border-slate-100 dark:border-slate-800 cursor-pointer select-none group/th\r\n `}\r\n >\r\n <div className={`flex items-center gap-2 ${col.align === 'center' ? 'justify-center' : col.align === 'right' ? 'justify-end' : ''}`}>\r\n {col.header}\r\n <span className={`transition-colors ${sortConfig.key === col.accessor ? 'text-[var(--highlight)]' : 'text-slate-300 opacity-0 group-hover/th:opacity-100'}`}>\r\n {sortConfig.key === col.accessor \r\n ? (sortConfig.direction === 'asc' ? <ArrowUp className=\"w-3 h-3\" /> : <ArrowDown className=\"w-3 h-3\" />)\r\n : <ArrowUpDown className=\"w-3 h-3\" />\r\n }\r\n </span>\r\n </div>\r\n </th>\r\n ))}\r\n </tr>\r\n </thead>\r\n <tbody className=\"divide-y divide-slate-100 dark:divide-slate-800\">\r\n {currentData.length > 0 ? (\r\n currentData.map((row) => (\r\n <TableRow \r\n key={row.id} \r\n row={row} \r\n columns={columns as any} \r\n selectable={selectable}\r\n isSelected={selectedRows.has(row.id)}\r\n onSelect={toggleSelectRow}\r\n />\r\n ))\r\n ) : (\r\n <tr>\r\n <td colSpan={columns.length + (selectable ? 1 : 0)}>\r\n {CustomEmptyState ? <CustomEmptyState /> : (\r\n <div className=\"flex flex-col items-center justify-center py-20 text-slate-400 gap-3\">\r\n <Inbox className=\"w-12 h-12 opacity-20\" />\r\n <p className=\"font-medium italic\">No se encontraron registros para mostrar</p>\r\n </div>\r\n )}\r\n </td>\r\n </tr>\r\n )}\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n\r\n {pagination && processedData.length > 0 && (\r\n <div className=\"flex flex-col sm:flex-row items-center justify-between gap-4 px-2 py-2 text-sm text-slate-500 dark:text-slate-400 font-medium\">\r\n <div className=\"flex items-center gap-4\">\r\n <div className=\"flex items-center gap-2\">\r\n <span>Mostrar</span>\r\n <div className=\"relative\">\r\n <select \r\n value={pageSize}\r\n onChange={(e) => { setPageSize(Number(e.target.value)); setCurrentPage(1); }}\r\n className=\"appearance-none bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg px-3 py-1.5 pr-8 focus:outline-none focus:ring-2 focus:ring-[var(--highlight)]/20 cursor-pointer text-slate-700 dark:text-slate-300 font-bold\"\r\n >\r\n {customArrayPagination.map(size => <option key={size} value={size}>{size}</option>)}\r\n </select>\r\n <ChevronDown className=\"w-4 h-4 absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none opacity-50\" />\r\n </div>\r\n </div>\r\n </div>\r\n <div className=\"flex items-center gap-2\">\r\n <button onClick={() => setCurrentPage(p => Math.max(p - 1, 1))} disabled={currentPage === 1} className=\"p-2 rounded-lg border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 disabled:opacity-30 hover:bg-slate-50 dark:hover:bg-slate-800 transition-colors\"><ChevronLeft className=\"w-4 h-4\" /></button>\r\n <div className=\"flex items-center gap-1 min-w-[60px] justify-center\">\r\n <span className=\"font-bold text-[var(--highlight)]\">{currentPage}</span>\r\n <span className=\"opacity-30\">/</span>\r\n <span>{totalPages}</span>\r\n </div>\r\n <button onClick={() => setCurrentPage(p => Math.min(p + 1, totalPages))} disabled={currentPage === totalPages} className=\"p-2 rounded-lg border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 disabled:opacity-30 hover:bg-slate-50 dark:hover:bg-slate-800 transition-colors\"><ChevronRight className=\"w-4 h-4\" /></button>\r\n </div>\r\n </div>\r\n )}\r\n </div>\r\n </TableContext.Provider>\r\n );\r\n};\r\n\r\nexport default Table;","import { Menu, X } from \"lucide-react\";\r\nimport { CSSProperties, ReactNode } from \"react\";\r\n\r\n\r\n\r\nexport type NavbarPosition = 'static' | 'sticky' | 'fixed-bottom-floating';\r\n\r\n/**\r\n * @interface NavbarProps\r\n * Propiedades para el componente Navbar altamente configurable.\r\n */\r\nexport interface NavbarProps {\r\n /** @param title - Título o logo del Navbar. */\r\n title?: ReactNode;\r\n /** @param position - Posición del Nav: 'static' (arriba normal), 'sticky' (pegado arriba), 'fixed-bottom-floating' (abajo flotante). */\r\n position?: NavbarPosition;\r\n /** @param color - Color principal para detalles o fondo (si colorDominant es true). */\r\n color?: string;\r\n /** @param colorDominant - Si es true, el color de la prop 'color' se convierte en el fondo principal. */\r\n colorDominant?: boolean;\r\n /** @param isMenuOpen - Estado controlado para el menú hamburguesa móvil. */\r\n isMenuOpen?: boolean;\r\n /** @param onToggleMenu - Función para abrir/cerrar el menú. */\r\n onToggleMenu?: () => void;\r\n /** @param children - Elementos de navegación o acciones. */\r\n children?: ReactNode;\r\n /** @param kd - Estilos CSS personalizados para el contenedor del Navbar. */\r\n kd?: CSSProperties;\r\n}\r\n\r\n/**\r\n * Componente Navbar - Barra de navegación adaptable con soporte para múltiples posiciones y temas.\r\n * Gestiona automáticamente el contraste del texto según el fondo.\r\n */\r\nexport const Navbar = ({\r\n title = \"Kydra Nav\",\r\n position = \"static\",\r\n color = \"#6366f1\",\r\n colorDominant = false,\r\n isMenuOpen = false,\r\n onToggleMenu,\r\n children,\r\n kd = {}\r\n}: NavbarProps) => {\r\n const getPositionClasses = () => {\r\n switch (position) {\r\n case 'sticky': return 'sticky top-0 z-50';\r\n case 'fixed-bottom-floating': return 'fixed bottom-6 left-6 right-6 z-50 rounded-2xl shadow-2xl max-w-5xl mx-auto';\r\n default: return 'relative';\r\n }\r\n };\r\n\r\n const navStyles: CSSProperties = {\r\n backgroundColor: colorDominant ? color : undefined,\r\n borderColor: !colorDominant ? `${color}40` : 'transparent',\r\n // Si el color es dominante, forzamos blanco. Si no, dejamos que herede del tema oscuro/claro\r\n color: colorDominant ? '#ffffff' : undefined,\r\n ...kd\r\n };\r\n\r\n return (\r\n <nav \r\n style={navStyles}\r\n className={`\r\n ${getPositionClasses()}\r\n px-6 py-4 border-b transition-all duration-300\r\n ${!colorDominant \r\n ? 'bg-white/80 dark:bg-slate-900/80 backdrop-blur-md dark:border-slate-800 text-slate-900 dark:text-white' \r\n : 'border-none text-white'}\r\n `}\r\n >\r\n <div className=\"flex items-center justify-between gap-4\">\r\n {/* Logo / Título */}\r\n <div className=\"flex items-center gap-2 font-black text-lg tracking-tight\">\r\n {typeof title === 'string' ? (\r\n <span style={{ color: colorDominant ? 'white' : color }}>{title}</span>\r\n ) : title}\r\n </div>\r\n\r\n {/* Desktop Actions - Heredan el color del padre */}\r\n <div className=\"hidden md:flex items-center gap-6\">\r\n {children}\r\n </div>\r\n\r\n {/* Hamburguesa Mobile */}\r\n <button \r\n onClick={onToggleMenu}\r\n className={`md:hidden p-2 rounded-lg transition-colors ${colorDominant ? 'hover:bg-white/10' : 'hover:bg-black/5 dark:hover:bg-white/5'}`}\r\n >\r\n {isMenuOpen ? <X size={24} /> : <Menu size={24} />}\r\n </button>\r\n </div>\r\n\r\n {/* Mobile Menu Dropdown */}\r\n {isMenuOpen && (\r\n <div className={`md:hidden mt-4 pb-4 animate-in slide-in-from-top-2 duration-200 border-t pt-4 ${colorDominant ? 'border-white/20' : 'border-black/5 dark:border-white/5'}`}>\r\n <div className=\"flex flex-col gap-4\">\r\n {children}\r\n </div>\r\n </div>\r\n )}\r\n </nav>\r\n );\r\n};"]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,46 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import he,{forwardRef,useState,createContext,useRef,useContext,useMemo}from'react';import {createPortal}from'react-dom';import {X,Check,Loader2,MoreHorizontal,Search,Trash2,Download,Plus,ArrowUp,ArrowDown,ArrowUpDown,Inbox,ChevronDown,ChevronLeft,ChevronRight,Menu}from'lucide-react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var O=forwardRef(({icon:a,color:o="#6366f1",label:s,error:r,variant:i="standard",type:m="text",value:n="",onChange:l,onClear:d,placeholder:u,disabled:f,className:N="",kd:I={},...z},C)=>{let[h,x]=useState(false),R=v=>{l&&l(v.target.value);},p=h||n&&n.toString().length>0,k=()=>{let v="block w-full text-sm transition-all outline-none dark:text-white";switch(i){case "filled":return `${v} pt-6 pb-3 px-4 bg-slate-100 dark:bg-slate-800 border-b-2 border-transparent rounded-t-xl focus:bg-slate-50 dark:focus:bg-slate-900 focus:border-[var(--highlight)] ${r?"border-red-400 bg-red-50 dark:bg-red-950/20":""}`;case "underlined":return `${v} pt-6 pb-3 bg-transparent border-b-2 border-slate-200 dark:border-slate-800 rounded-none px-0 focus:border-[var(--highlight)] focus:ring-0 ${r?"border-red-400":""}`;default:return `${v} py-3.5 px-4 bg-white dark:bg-slate-900 border rounded-xl
|
|
2
|
+
${r?"border-red-400 focus:border-red-500 ring-0 focus:ring-2 focus:ring-red-500/10":"border-slate-200 dark:border-slate-800 focus:border-[var(--highlight)] ring-0 focus:ring-2 focus:ring-[var(--highlight)]/20"}`}};return jsxs("div",{className:`flex flex-col gap-1 w-full ${N}`,style:{"--highlight":o},children:[jsxs("div",{className:"relative flex items-center group",children:[s&&jsx("label",{className:`
|
|
3
|
+
absolute pointer-events-none transition-all duration-200 ease-in-out z-20
|
|
4
|
+
${p?`text-[10px] font-bold uppercase tracking-wider ${r?"text-red-500":"text-[var(--highlight)]"}`:"text-sm font-medium text-slate-400"}
|
|
5
|
+
|
|
6
|
+
/* Alineaci\xF3n Horizontal: Uniforme en standard y filled */
|
|
7
|
+
${i==="underlined"?"left-0":"left-4"}
|
|
8
|
+
|
|
9
|
+
/* Posicionamiento Vertical */
|
|
10
|
+
${i==="standard"?p?"-top-2 px-1.5 bg-white dark:bg-slate-900 translate-x-[-4px]":"top-1/2 -translate-y-1/2":p?"top-1.5":"top-[31px] -translate-y-1/2"}
|
|
11
|
+
|
|
12
|
+
/* Ajuste por Icono cuando NO flota */
|
|
13
|
+
${!p&&a?"pl-7":""}
|
|
14
|
+
`,children:s}),a&&jsx("div",{className:`absolute flex items-center pointer-events-none transition-colors duration-200 z-10
|
|
15
|
+
${i==="underlined"?"left-0":"left-4"}
|
|
16
|
+
${i==="standard"?"top-1/2 -translate-y-1/2":"top-[31px] -translate-y-1/2"}
|
|
17
|
+
${r?"text-red-400":h?"text-[var(--highlight)]":"text-slate-400"}`,children:jsx(a,{className:"w-4 h-4"})}),jsx("input",{ref:C,type:m,value:n,onFocus:()=>x(true),onBlur:()=>x(false),onChange:R,disabled:f,placeholder:h&&p?u:"",style:{...I},className:`
|
|
18
|
+
${k()}
|
|
19
|
+
${f?"opacity-50 cursor-not-allowed":""}
|
|
20
|
+
/* Padding Left: alineado con el icono */
|
|
21
|
+
${a?i==="underlined"?"pl-7":"pl-11":i==="underlined"?"pl-0":"pl-4"}
|
|
22
|
+
${d?"pr-10":"pr-4"}
|
|
23
|
+
relative z-0
|
|
24
|
+
`,...z}),n&&d&&!f&&jsx("button",{type:"button",onClick:d,className:`absolute right-0 flex items-center text-slate-400 hover:text-slate-600 dark:hover:text-slate-200 transition-colors z-20
|
|
25
|
+
${i==="underlined"?"pr-0 top-[31px] -translate-y-1/2":"pr-3 top-1/2 -translate-y-1/2"}`,children:jsx(X,{className:"w-4 h-4"})})]}),r&&jsx("span",{className:"text-[10px] font-bold text-red-500 ml-1 uppercase tracking-tight animate-in slide-in-from-top-1 duration-200",children:r})]})});O.displayName="Input";var L=forwardRef(({color:a="#6366f1",label:o,value:s=false,onChange:r,kd:i={},className:m="",disabled:n=false,...l},d)=>{let u=N=>{r&&r(N.target.checked);},f={"--tw-ring-color":a,borderColor:s?a:"#94a3b8",backgroundColor:s?a:"transparent",...i};return jsxs("label",{className:`inline-flex items-center gap-3 cursor-pointer select-none ${n?"opacity-50 cursor-not-allowed":""} ${m}`,children:[jsxs("div",{className:"relative flex items-center justify-center",children:[jsx("input",{ref:d,type:"checkbox",checked:s,onChange:u,disabled:n,className:"peer sr-only",...l}),jsx("div",{style:f,className:"w-5 h-5 border-2 rounded-md transition-all duration-200 ease-in-out peer-focus:ring-2 peer-focus:ring-offset-2 peer-focus:ring-offset-white dark:peer-focus:ring-offset-slate-900 flex items-center justify-center",children:s&&jsx(Check,{size:14,className:"text-white animate-in zoom-in-50 duration-200",strokeWidth:4})})]}),o&&jsx("span",{className:"text-sm font-medium leading-none",children:o})]})});L.displayName="CheckBox";var j=forwardRef(({label:a="Bot\xF3n",color:o="#6366f1",variant:s="filled",icon:r,iconPosition:i="left",textAlign:m="center",type:n="button",onClick:l,className:d="",disabled:u=false,loading:f=false,kd:N={},...I},z)=>{let[C,h]=useState(false),x={left:"justify-start",center:"justify-center",right:"justify-end"};return jsx("button",{ref:z,type:n,disabled:u||f,onMouseEnter:()=>h(true),onMouseLeave:()=>h(false),onClick:l,style:{...(()=>{let p=C&&!u&&!f,k={opacity:u||f?.6:1,cursor:u||f?"not-allowed":"pointer",transition:"all 300ms cubic-bezier(0.4, 0, 0.2, 1)"};switch(s){case "filled":return {...k,backgroundColor:o,color:"#ffffff",border:"1px solid transparent",filter:p?"brightness(0.9)":"none",boxShadow:p?"0 4px 12px rgba(0,0,0,0.15)":"none"};case "dotted":return {...k,backgroundColor:p?`${o}15`:"transparent",color:o,border:`2px dotted ${o}`,transform:p?"translateY(-1px)":"none"};case "ghost-hover":return {...k,backgroundColor:p?o:"transparent",color:p?"#ffffff":"currentColor",borderColor:p?"transparent":"currentColor",borderWidth:"1px",borderStyle:"solid"};default:return k}})(),...N},className:`
|
|
26
|
+
group relative px-6 py-3 rounded-lg font-medium
|
|
27
|
+
active:scale-[0.98] flex items-center min-w-[140px] overflow-hidden
|
|
28
|
+
${x[m]}
|
|
29
|
+
${d}
|
|
30
|
+
`,...I,children:jsxs("div",{className:`flex items-center gap-2 ${i==="right"?"flex-row-reverse":"flex-row"}`,children:[f?jsx(Loader2,{className:"animate-spin",size:18}):r&&jsx("span",{className:`flex items-center transition-transform duration-300 ${C&&!u?"scale-110":""}`,children:r}),jsx("span",{className:"leading-none",children:f?"Cargando...":a})]})})});j.displayName="Button";var _=createContext({darkMode:false,color:"#2563eb"}),q=()=>useContext(_),Me=he.memo(({row:a,columns:o,selectable:s,isSelected:r,onSelect:i})=>{let{color:m}=q(),n={left:"text-left",center:"text-center",right:"text-right"};return jsxs("tr",{className:"group transition-colors duration-150 hover:bg-[var(--highlight)]/5",children:[s&&jsx("td",{className:"px-6 py-4 border-b border-transparent",children:jsx(L,{color:m,value:r,onChange:()=>i(a.id)})}),o.filter(l=>!l.hidden).map(l=>jsx("td",{className:`
|
|
31
|
+
whitespace-nowrap px-6 py-4
|
|
32
|
+
text-slate-600 dark:text-slate-300
|
|
33
|
+
transition-colors group-hover:text-slate-900 dark:group-hover:text-white
|
|
34
|
+
${n[l.align||"left"]}
|
|
35
|
+
`,children:l.actions?jsx(Le,{actions:l.actions,row:a}):l.format?l.format(a[l.accessor],a,m):String(a[l.accessor]??"")},String(l.accessor)))]})}),Ee=({isOpen:a,onClose:o,anchorRect:s,actions:r,row:i})=>{let{darkMode:m,color:n}=q();if(!a||!s)return null;let l={position:"fixed",top:`${s.bottom+8}px`,left:`${s.right-192}px`,zIndex:9999};return createPortal(jsxs("div",{className:m?"dark":"",style:{"--highlight":n},children:[jsx("div",{className:"fixed inset-0 z-[9998]",onClick:o}),jsx("div",{style:l,className:"w-48 overflow-hidden rounded-xl border border-slate-200 bg-white shadow-2xl ring-1 ring-black ring-opacity-5 dark:border-slate-700 dark:bg-slate-800 animate-in fade-in zoom-in duration-150",children:jsx("div",{className:"py-1",children:r.map((d,u)=>{let f=d.icon;return jsxs("button",{onClick:()=>{d.onClick(i),o();},className:`flex w-full items-center gap-3 px-4 py-2.5 text-sm transition-colors hover:bg-slate-50 dark:hover:bg-slate-700/50 ${d.color||"text-slate-700 dark:text-slate-200"}`,children:[f&&jsx(f,{className:"w-4 h-4 opacity-70"}),jsx("span",{className:"font-medium",children:d.label})]},u)})})})]}),document.body)},Le=({actions:a,row:o})=>{let[s,r]=useState(false),[i,m]=useState(null),n=useRef(null);return jsxs(Fragment,{children:[jsx("button",{ref:n,onClick:d=>{d.stopPropagation(),n.current&&m(n.current.getBoundingClientRect()),r(!s);},className:`p-2 rounded-full transition-all duration-200 ${s?"bg-[var(--highlight)]/10 text-[var(--highlight)]":"hover:bg-slate-100 dark:hover:bg-slate-800 text-slate-400"}`,children:jsx(MoreHorizontal,{className:"w-5 h-5"})}),jsx(Ee,{isOpen:s,onClose:()=>r(false),anchorRect:i,actions:a,row:o})]})},lt=({data:a=[],columns:o=[],pagination:s=true,selectable:r=false,customArrayPagination:i=[5,10,25,50,100],defaultPageSize:m=10,filter:n=false,filterPlaceholder:l="Buscar registros...",color:d="#2563eb",add:u=false,textAdd:f="Agregar",actionAdd:N=()=>{},excelExport:I=false,onDeleteRows:z=()=>{},emptyState:C,darkMode:h=false})=>{let[x,R]=useState(1),[p,k]=useState(m),[v,W]=useState(""),[b,Q]=useState({key:null,direction:"asc"}),[S,H]=useState(new Set),Z=useMemo(()=>({darkMode:h,color:d}),[h,d]),ee=t=>{let g="asc";b.key===t&&b.direction==="asc"&&(g="desc"),Q({key:t,direction:g});},M=useMemo(()=>{let t=[...a];if(n&&v){let g=o.filter(y=>y.filter).map(y=>y.accessor);t=t.filter(y=>g.some(B=>String(y[B]??"").toLowerCase().includes(v.toLowerCase())));}return b.key&&t.sort((g,y)=>{let B=g[b.key],D=y[b.key];return B<D?b.direction==="asc"?-1:1:B>D?b.direction==="asc"?1:-1:0}),t},[a,v,n,o,b]),U=Math.ceil(M.length/p)||1,T=s?M.slice((x-1)*p,x*p):M,te=()=>{T.length>0&&S.size===T.length?H(new Set):H(new Set(T.map(t=>t.id)));},re=t=>{let g=new Set(S);g.has(t)?g.delete(t):g.add(t),H(g);},ae=()=>{let t=o.filter(A=>!A.hidden&&!A.actions),g=t.map(A=>`"${A.header}"`).join(","),y=M.map(A=>t.map(ne=>{let le=A[ne.accessor];return `"${String(le??"").replace(/"/g,'""')}"`}).join(",")).join(`
|
|
36
|
+
`),B="\uFEFF"+g+`
|
|
37
|
+
`+y,D=new Blob([B],{type:"text/csv;charset=utf-8;"}),se=URL.createObjectURL(D),E=document.createElement("a");E.setAttribute("href",se),E.setAttribute("download",`Export_${new Date().getTime()}.csv`),document.body.appendChild(E),E.click(),document.body.removeChild(E);},oe={left:"text-left",center:"text-center",right:"text-right"};return jsx(_.Provider,{value:Z,children:jsxs("div",{className:`flex flex-col gap-4 w-full ${h?"dark":""}`,style:{"--highlight":d},children:[jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4",children:[jsxs("div",{className:"flex flex-1 gap-4 w-full sm:w-auto",children:[n&&jsx("div",{className:"w-full sm:max-w-xs",children:jsx(O,{icon:Search,color:d,value:v,onChange:W,label:l,onClear:()=>W("")})}),r&&S.size>0&&jsxs("div",{className:"flex items-center gap-3 animate-in fade-in slide-in-from-left-4",children:[jsxs("span",{className:"text-sm font-bold text-slate-500 hidden md:inline",children:[S.size," seleccionados"]}),jsxs("button",{onClick:()=>{z(Array.from(S)),H(new Set);},className:"text-xs font-bold text-red-500 hover:text-red-600 bg-red-50 dark:bg-red-500/10 px-4 py-2.5 rounded-xl transition-all active:scale-95 flex items-center gap-2 border border-red-100 dark:border-red-500/20",children:[jsx(Trash2,{className:"w-4 h-4"}),jsx("span",{children:"Eliminar"})]})]})]}),jsxs("div",{className:"flex items-center gap-3 w-full sm:w-auto",children:[I&&jsx(j,{onClick:ae,color:"green",icon:jsx(Download,{className:"w-4 h-4"}),label:"Exportar"}),u&&jsx(Fragment,{children:jsx(j,{onClick:N,kd:{backgroundColor:"var(--highlight)"},icon:jsx(Plus,{className:"w-4 h-4"}),label:f})})]})]}),jsx("div",{className:"w-full rounded-2xl border border-slate-200 bg-white shadow-sm dark:border-slate-800 dark:bg-slate-900 overflow-hidden",children:jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"min-w-full border-separate border-spacing-0 text-sm",children:[jsx("thead",{className:"bg-slate-50/50 dark:bg-slate-950/40",children:jsxs("tr",{children:[r&&jsx("th",{className:"px-6 py-4 border-b border-slate-100 dark:border-slate-800 w-10 text-left",children:jsx(L,{color:d,value:T.length>0&&S.size===T.length,onChange:te})}),o.filter(t=>!t.hidden).map(t=>jsx("th",{onClick:()=>ee(t.accessor),className:`
|
|
38
|
+
px-6 py-4 font-bold uppercase tracking-tight text-slate-500 dark:text-slate-400
|
|
39
|
+
${oe[t.align||"left"]}
|
|
40
|
+
border-b border-slate-100 dark:border-slate-800 cursor-pointer select-none group/th
|
|
41
|
+
`,children:jsxs("div",{className:`flex items-center gap-2 ${t.align==="center"?"justify-center":t.align==="right"?"justify-end":""}`,children:[t.header,jsx("span",{className:`transition-colors ${b.key===t.accessor?"text-[var(--highlight)]":"text-slate-300 opacity-0 group-hover/th:opacity-100"}`,children:b.key===t.accessor?b.direction==="asc"?jsx(ArrowUp,{className:"w-3 h-3"}):jsx(ArrowDown,{className:"w-3 h-3"}):jsx(ArrowUpDown,{className:"w-3 h-3"})})]})},String(t.accessor)))]})}),jsx("tbody",{className:"divide-y divide-slate-100 dark:divide-slate-800",children:T.length>0?T.map(t=>jsx(Me,{row:t,columns:o,selectable:r,isSelected:S.has(t.id),onSelect:re},t.id)):jsx("tr",{children:jsx("td",{colSpan:o.length+(r?1:0),children:C?jsx(C,{}):jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-slate-400 gap-3",children:[jsx(Inbox,{className:"w-12 h-12 opacity-20"}),jsx("p",{className:"font-medium italic",children:"No se encontraron registros para mostrar"})]})})})})]})})}),s&&M.length>0&&jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-2 py-2 text-sm text-slate-500 dark:text-slate-400 font-medium",children:[jsx("div",{className:"flex items-center gap-4",children:jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{children:"Mostrar"}),jsxs("div",{className:"relative",children:[jsx("select",{value:p,onChange:t=>{k(Number(t.target.value)),R(1);},className:"appearance-none bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg px-3 py-1.5 pr-8 focus:outline-none focus:ring-2 focus:ring-[var(--highlight)]/20 cursor-pointer text-slate-700 dark:text-slate-300 font-bold",children:i.map(t=>jsx("option",{value:t,children:t},t))}),jsx(ChevronDown,{className:"w-4 h-4 absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none opacity-50"})]})]})}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("button",{onClick:()=>R(t=>Math.max(t-1,1)),disabled:x===1,className:"p-2 rounded-lg border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 disabled:opacity-30 hover:bg-slate-50 dark:hover:bg-slate-800 transition-colors",children:jsx(ChevronLeft,{className:"w-4 h-4"})}),jsxs("div",{className:"flex items-center gap-1 min-w-[60px] justify-center",children:[jsx("span",{className:"font-bold text-[var(--highlight)]",children:x}),jsx("span",{className:"opacity-30",children:"/"}),jsx("span",{children:U})]}),jsx("button",{onClick:()=>R(t=>Math.min(t+1,U)),disabled:x===U,className:"p-2 rounded-lg border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 disabled:opacity-30 hover:bg-slate-50 dark:hover:bg-slate-800 transition-colors",children:jsx(ChevronRight,{className:"w-4 h-4"})})]})]})]})})};var ht=({title:a="Kydra Nav",position:o="static",color:s="#6366f1",colorDominant:r=false,isMenuOpen:i=false,onToggleMenu:m,children:n,kd:l={}})=>{let d=()=>{switch(o){case "sticky":return "sticky top-0 z-50";case "fixed-bottom-floating":return "fixed bottom-6 left-6 right-6 z-50 rounded-2xl shadow-2xl max-w-5xl mx-auto";default:return "relative"}},u={backgroundColor:r?s:void 0,borderColor:r?"transparent":`${s}40`,color:r?"#ffffff":void 0,...l};return jsxs("nav",{style:u,className:`
|
|
42
|
+
${d()}
|
|
43
|
+
px-6 py-4 border-b transition-all duration-300
|
|
44
|
+
${r?"border-none text-white":"bg-white/80 dark:bg-slate-900/80 backdrop-blur-md dark:border-slate-800 text-slate-900 dark:text-white"}
|
|
45
|
+
`,children:[jsxs("div",{className:"flex items-center justify-between gap-4",children:[jsx("div",{className:"flex items-center gap-2 font-black text-lg tracking-tight",children:typeof a=="string"?jsx("span",{style:{color:r?"white":s},children:a}):a}),jsx("div",{className:"hidden md:flex items-center gap-6",children:n}),jsx("button",{onClick:m,className:`md:hidden p-2 rounded-lg transition-colors ${r?"hover:bg-white/10":"hover:bg-black/5 dark:hover:bg-white/5"}`,children:i?jsx(X,{size:24}):jsx(Menu,{size:24})})]}),i&&jsx("div",{className:`md:hidden mt-4 pb-4 animate-in slide-in-from-top-2 duration-200 border-t pt-4 ${r?"border-white/20":"border-black/5 dark:border-white/5"}`,children:jsx("div",{className:"flex flex-col gap-4",children:n})})]})};export{j as Button,L as CheckBox,O as Input,ht as Navbar,lt as Table};//# sourceMappingURL=index.mjs.map
|
|
2
46
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Table.tsx"],"sourcesContent":["export const Table = ({ data, columns }: any) => {\r\n return (\r\n <div className=\"mt-6 overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm transition-all dark:border-slate-800 dark:bg-slate-900 dark:shadow-2xl\">\r\n <table className=\"min-w-full divide-y divide-slate-200 text-left text-sm dark:divide-slate-800\">\r\n <thead className=\"bg-slate-50 dark:bg-slate-950/50\">\r\n <tr>\r\n {columns.map((col: any) => (\r\n <th \r\n key={col.accessor} \r\n className=\"px-6 py-4 font-semibold uppercase tracking-wider text-slate-700 dark:text-amber-400\"\r\n >\r\n {col.header}\r\n </th>\r\n ))}\r\n </tr>\r\n </thead>\r\n <tbody className=\"divide-y divide-slate-200 dark:divide-slate-800\">\r\n {data.map((row: any, i: number) => (\r\n <tr \r\n key={i} \r\n className=\"group hover:bg-slate-50 transition-all duration-200 dark:hover:bg-slate-800/50\"\r\n >\r\n {columns.map((col: any) => (\r\n <td \r\n key={col.accessor} \r\n className=\"whitespace-nowrap px-6 py-4 text-slate-600 transition-colors group-hover:text-slate-900 dark:text-slate-300 dark:group-hover:text-white\"\r\n >\r\n {row[col.accessor]}\r\n </td>\r\n ))}\r\n </tr>\r\n ))}\r\n </tbody>\r\n </table>\r\n </div>\r\n );\r\n};"],"mappings":"AAGM,OAIQ,OAAAA,EAJR,QAAAC,MAAA,oBAHC,IAAMC,EAAQ,CAAC,CAAE,KAAAC,EAAM,QAAAC,CAAQ,IAElCJ,EAAC,OAAI,UAAU,oJACb,SAAAC,EAAC,SAAM,UAAU,+EACf,UAAAD,EAAC,SAAM,UAAU,mCACf,SAAAA,EAAC,MACE,SAAAI,EAAQ,IAAKC,GACZL,EAAC,MAEC,UAAU,sFAET,SAAAK,EAAI,QAHAA,EAAI,QAIX,CACD,EACH,EACF,EACAL,EAAC,SAAM,UAAU,kDACd,SAAAG,EAAK,IAAI,CAACG,EAAUC,IACnBP,EAAC,MAEC,UAAU,iFAET,SAAAI,EAAQ,IAAKC,GACZL,EAAC,MAEC,UAAU,0IAET,SAAAM,EAAID,EAAI,QAAQ,GAHZA,EAAI,QAIX,CACD,GAVIE,CAWP,CACD,EACH,GACF,EACF","names":["jsx","jsxs","Table","data","columns","col","row","i"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/Input/Input.tsx","../src/components/CheckBox/CheckBox.tsx","../src/components/Button/Button.tsx","../src/components/Table.tsx","../src/components/Nav.tsx"],"names":["Input","forwardRef","Icon","color","label","error","variant","type","value","onChange","onClear","placeholder","disabled","className","kd","props","ref","isFocused","setIsFocused","useState","handleChange","e","isFloating","getVariantClasses","base","jsxs","jsx","X","CheckBox","customBoxStyles","Check","Button","icon","iconPosition","textAlign","onClick","loading","isHovered","setIsHovered","alignmentStyles","activeHover","baseStyles","Loader2","TableContext","createContext","useTableTheme","useContext","TableRow","React","row","columns","selectable","isSelected","onSelect","alignmentClasses","c","col","ActionButton","DropdownPortal","isOpen","onClose","anchorRect","actions","darkMode","style","createPortal","action","index","setIsOpen","setAnchorRect","buttonRef","useRef","Fragment","MoreHorizontal","Table","data","pagination","customArrayPagination","defaultPageSize","filter","filterPlaceholder","add","textAdd","actionAdd","excelExport","onDeleteRows","CustomEmptyState","currentPage","setCurrentPage","pageSize","setPageSize","searchTerm","setSearchTerm","sortConfig","setSortConfig","selectedRows","setSelectedRows","themeValue","useMemo","handleSort","key","direction","processedData","result","searchableAccessors","acc","a","b","valA","valB","totalPages","currentData","toggleSelectAll","r","toggleSelectRow","id","newSelection","handleExportCSV","visibleColumns","headers","rows","val","csvContent","blob","url","link","Search","Trash2","Download","Plus","ArrowUp","ArrowDown","ArrowUpDown","Inbox","size","ChevronDown","p","ChevronLeft","ChevronRight","Navbar","title","position","colorDominant","isMenuOpen","onToggleMenu","children","getPositionClasses","navStyles","Menu"],"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CAAgB,kBAAoB,oCAAoC,CAAA,CAAA,CACvK,QAAA,CAAApH,GAAAA,CAAC,OAAI,SAAA,CAAU,qBAAA,CACZ,SAAAuH,CAAAA,CACH,CAAA,CACF,GAEJ,CAEJ","file":"index.mjs","sourcesContent":["import { X } from \"lucide-react\";\r\nimport { CSSProperties, forwardRef, useState } from \"react\";\r\nimport { InputProps } from \"./Input.types\";\r\n\r\n\r\nexport const Input = forwardRef<HTMLInputElement, InputProps>(({\r\n icon: Icon,\r\n color = \"#6366f1\",\r\n label,\r\n error,\r\n variant = \"standard\",\r\n type = \"text\",\r\n value = \"\",\r\n onChange,\r\n onClear,\r\n placeholder,\r\n disabled,\r\n className = \"\",\r\n kd = {},\r\n ...props\r\n}, ref) => {\r\n const [isFocused, setIsFocused] = useState(false);\r\n \r\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n if (onChange) onChange(e.target.value);\r\n };\r\n\r\n const isFloating = isFocused || (value && value.toString().length > 0);\r\n\r\n const getVariantClasses = () => {\r\n const base = \"block w-full text-sm transition-all outline-none dark:text-white\";\r\n \r\n switch (variant) {\r\n case 'filled':\r\n return `${base} pt-6 pb-3 px-4 bg-slate-100 dark:bg-slate-800 border-b-2 border-transparent rounded-t-xl focus:bg-slate-50 dark:focus:bg-slate-900 focus:border-[var(--highlight)] ${error ? 'border-red-400 bg-red-50 dark:bg-red-950/20' : ''}`;\r\n case 'underlined':\r\n return `${base} pt-6 pb-3 bg-transparent border-b-2 border-slate-200 dark:border-slate-800 rounded-none px-0 focus:border-[var(--highlight)] focus:ring-0 ${error ? 'border-red-400' : ''}`;\r\n case 'standard':\r\n default:\r\n // Ajustado: Se eliminan las clases por defecto de Tailwind de ring para usar el color dinámico en el borde de focus\r\n return `${base} py-3.5 px-4 bg-white dark:bg-slate-900 border rounded-xl \r\n ${error \r\n ? 'border-red-400 focus:border-red-500 ring-0 focus:ring-2 focus:ring-red-500/10' \r\n : 'border-slate-200 dark:border-slate-800 focus:border-[var(--highlight)] ring-0 focus:ring-2 focus:ring-[var(--highlight)]/20'}`;\r\n }\r\n };\r\n\r\n return (\r\n <div className={`flex flex-col gap-1 w-full ${className}`} style={{ '--highlight': color } as CSSProperties}>\r\n <div className=\"relative flex items-center group\">\r\n \r\n {/* Label Flotante - Ajustado simétricamente */}\r\n {label && (\r\n <label \r\n className={`\r\n absolute pointer-events-none transition-all duration-200 ease-in-out z-20\r\n ${isFloating \r\n ? `text-[10px] font-bold uppercase tracking-wider ${error ? 'text-red-500' : 'text-[var(--highlight)]'}` \r\n : 'text-sm font-medium text-slate-400'}\r\n \r\n /* Alineación Horizontal: Uniforme en standard y filled */\r\n ${variant === 'underlined' ? 'left-0' : 'left-4'}\r\n\r\n /* Posicionamiento Vertical */\r\n ${variant === 'standard' \r\n ? (isFloating ? '-top-2 px-1.5 bg-white dark:bg-slate-900 translate-x-[-4px]' : 'top-1/2 -translate-y-1/2') \r\n : (isFloating ? 'top-1.5' : 'top-[31px] -translate-y-1/2')}\r\n\r\n /* Ajuste por Icono cuando NO flota */\r\n ${!isFloating && Icon ? 'pl-7' : ''}\r\n `}\r\n >\r\n {label}\r\n </label>\r\n )}\r\n\r\n {/* Icono */}\r\n {Icon && (\r\n <div className={`absolute flex items-center pointer-events-none transition-colors duration-200 z-10\r\n ${variant === 'underlined' ? 'left-0' : 'left-4'}\r\n ${variant === 'standard' ? 'top-1/2 -translate-y-1/2' : 'top-[31px] -translate-y-1/2'}\r\n ${error ? 'text-red-400' : isFocused ? 'text-[var(--highlight)]' : 'text-slate-400'}`}>\r\n <Icon className=\"w-4 h-4\" />\r\n </div>\r\n )}\r\n\r\n <input\r\n ref={ref}\r\n type={type}\r\n value={value}\r\n onFocus={() => setIsFocused(true)}\r\n onBlur={() => setIsFocused(false)}\r\n onChange={handleChange}\r\n disabled={disabled}\r\n placeholder={isFocused && isFloating ? placeholder : \"\"} \r\n style={{ ...kd } as CSSProperties}\r\n className={`\r\n ${getVariantClasses()}\r\n ${disabled ? 'opacity-50 cursor-not-allowed' : ''}\r\n /* Padding Left: alineado con el icono */\r\n ${Icon ? (variant === 'underlined' ? 'pl-7' : 'pl-11') : (variant === 'underlined' ? 'pl-0' : 'pl-4')}\r\n ${onClear ? 'pr-10' : 'pr-4'}\r\n relative z-0\r\n `}\r\n {...props}\r\n />\r\n\r\n {/* Botón de Limpiar */}\r\n {value && onClear && !disabled && (\r\n <button \r\n type=\"button\"\r\n onClick={onClear}\r\n className={`absolute right-0 flex items-center text-slate-400 hover:text-slate-600 dark:hover:text-slate-200 transition-colors z-20\r\n ${variant === 'underlined' ? 'pr-0 top-[31px] -translate-y-1/2' : 'pr-3 top-1/2 -translate-y-1/2'}`}\r\n >\r\n <X className=\"w-4 h-4\" />\r\n </button>\r\n )}\r\n </div>\r\n \r\n {error && <span className=\"text-[10px] font-bold text-red-500 ml-1 uppercase tracking-tight animate-in slide-in-from-top-1 duration-200\">{error}</span>}\r\n </div>\r\n );\r\n});\r\n\r\n\r\nInput.displayName = \"Input\";","import { Check } from \"lucide-react\";\r\nimport { CSSProperties, forwardRef } from \"react\";\r\nimport { CheckBoxProps } from \"./CheckBox.types\";\r\n\r\n\r\n/**\r\n * Componente CheckBox - Core librería @kydra/ui\r\n */\r\nexport const CheckBox = forwardRef<HTMLInputElement, CheckBoxProps>(({\r\n color = \"#6366f1\",\r\n label,\r\n value = false,\r\n onChange,\r\n kd = {},\r\n className = \"\",\r\n disabled = false,\r\n ...props\r\n}, ref) => {\r\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n if (onChange) onChange(e.target.checked);\r\n };\r\n\r\n const customBoxStyles: CSSProperties = {\r\n '--tw-ring-color': color,\r\n borderColor: value ? color : '#94a3b8',\r\n backgroundColor: value ? color : 'transparent',\r\n ...kd\r\n } as CSSProperties;\r\n\r\n return (\r\n <label className={`inline-flex items-center gap-3 cursor-pointer select-none ${disabled ? 'opacity-50 cursor-not-allowed' : ''} ${className}`}>\r\n <div className=\"relative flex items-center justify-center\">\r\n <input ref={ref} type=\"checkbox\" checked={value} onChange={handleChange} disabled={disabled} className=\"peer sr-only\" {...props} />\r\n <div style={customBoxStyles} className=\"w-5 h-5 border-2 rounded-md transition-all duration-200 ease-in-out peer-focus:ring-2 peer-focus:ring-offset-2 peer-focus:ring-offset-white dark:peer-focus:ring-offset-slate-900 flex items-center justify-center\">\r\n {value && <Check size={14} className=\"text-white animate-in zoom-in-50 duration-200\" strokeWidth={4} />}\r\n </div>\r\n </div>\r\n {label && <span className=\"text-sm font-medium leading-none\">{label}</span>}\r\n </label>\r\n );\r\n});\r\n\r\nCheckBox.displayName = \"CheckBox\";","import { useState, forwardRef, CSSProperties } from 'react';\r\nimport { Loader2 } from 'lucide-react';\r\nimport { ButtonProps, TextAlign } from './Button.types';\r\n\r\n\r\n/**\r\n * Componente Button - Core librería @kydra/ui\r\n */\r\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(({\r\n label = \"Botón\",\r\n color = \"#6366f1\",\r\n variant = \"filled\",\r\n icon,\r\n iconPosition = \"left\",\r\n textAlign = \"center\",\r\n type = \"button\",\r\n onClick,\r\n className = \"\",\r\n disabled = false,\r\n loading = false,\r\n kd = {},\r\n ...props\r\n}, ref) => {\r\n const [isHovered, setIsHovered] = useState(false);\r\n\r\n // Mapeo de estilos de alineación\r\n const alignmentStyles: Record<TextAlign, string> = {\r\n left: 'justify-start',\r\n center: 'justify-center',\r\n right: 'justify-end'\r\n };\r\n\r\n // Lógica de estilos dinámicos\r\n const getDynamicStyles = (): CSSProperties => {\r\n const activeHover = isHovered && !disabled && !loading;\r\n\r\n const baseStyles: CSSProperties = {\r\n opacity: disabled || loading ? 0.6 : 1,\r\n cursor: disabled || loading ? 'not-allowed' : 'pointer',\r\n transition: 'all 300ms cubic-bezier(0.4, 0, 0.2, 1)',\r\n };\r\n\r\n switch (variant) {\r\n case 'filled':\r\n return {\r\n ...baseStyles,\r\n backgroundColor: color,\r\n color: '#ffffff',\r\n border: '1px solid transparent',\r\n filter: activeHover ? 'brightness(0.9)' : 'none',\r\n boxShadow: activeHover ? '0 4px 12px rgba(0,0,0,0.15)' : 'none',\r\n };\r\n case 'dotted':\r\n return {\r\n ...baseStyles,\r\n backgroundColor: activeHover ? `${color}15` : 'transparent',\r\n color: color,\r\n border: `2px dotted ${color}`,\r\n transform: activeHover ? 'translateY(-1px)' : 'none',\r\n };\r\n case 'ghost-hover':\r\n return {\r\n ...baseStyles,\r\n backgroundColor: activeHover ? color : 'transparent',\r\n color: activeHover ? '#ffffff' : 'currentColor',\r\n borderColor: activeHover ? 'transparent' : 'currentColor',\r\n borderWidth: '1px',\r\n borderStyle: 'solid',\r\n };\r\n default:\r\n return baseStyles;\r\n }\r\n };\r\n\r\n return (\r\n <button\r\n ref={ref}\r\n type={type}\r\n disabled={disabled || loading}\r\n onMouseEnter={() => setIsHovered(true)}\r\n onMouseLeave={() => setIsHovered(false)}\r\n onClick={onClick}\r\n style={{ ...getDynamicStyles(), ...kd }}\r\n className={`\r\n group relative px-6 py-3 rounded-lg font-medium \r\n active:scale-[0.98] flex items-center min-w-[140px] overflow-hidden\r\n ${alignmentStyles[textAlign]}\r\n ${className}\r\n `}\r\n {...props}\r\n >\r\n <div className={`flex items-center gap-2 ${iconPosition === 'right' ? 'flex-row-reverse' : 'flex-row'}`}>\r\n {loading ? (\r\n <Loader2 className=\"animate-spin\" size={18} />\r\n ) : (\r\n icon && (\r\n <span className={`flex items-center transition-transform duration-300 ${isHovered && !disabled ? 'scale-110' : ''}`}>\r\n {icon}\r\n </span>\r\n )\r\n )}\r\n <span className=\"leading-none\">{loading ? 'Cargando...' : label}</span>\r\n </div>\r\n </button>\r\n );\r\n});\r\n\r\nButton.displayName = \"Button\";","import React, { \r\n useState, \r\n useMemo, \r\n useRef,\r\n useContext,\r\n createContext\r\n} from 'react';\r\nimport { createPortal } from 'react-dom';\r\nimport { \r\n MoreHorizontal,\r\n Trash2, \r\n ChevronLeft, \r\n ChevronRight, \r\n ChevronDown, \r\n Search, \r\n Plus,\r\n ArrowUp,\r\n ArrowDown,\r\n ArrowUpDown,\r\n Inbox,\r\n Download,\r\n LucideIcon,\r\n} from 'lucide-react';\r\nimport { Input } from './Input/Input';\r\nimport { CheckBox } from './CheckBox/CheckBox';\r\nimport { Button } from './Button/Button';\r\n\r\n// --- Contexto para el Tema ---\r\ninterface TableTheme {\r\n darkMode: boolean;\r\n color: string;\r\n}\r\n\r\nconst TableContext = createContext<TableTheme>({ darkMode: false, color: '#2563eb' });\r\nconst useTableTheme = () => useContext(TableContext);\r\n\r\n// --- Tipos e Interfaces ---\r\n\r\nexport interface TableAction<T> {\r\n label: string;\r\n icon?: LucideIcon;\r\n onClick: (row: T) => void;\r\n color?: string;\r\n}\r\n\r\nexport interface TableColumn<T> {\r\n header: string;\r\n accessor: keyof T;\r\n filter?: boolean;\r\n hidden?: boolean;\r\n align?: 'left' | 'center' | 'right';\r\n format?: (value: any, row: T, highlightColor: string) => React.ReactNode;\r\n actions?: TableAction<T>[];\r\n}\r\n\r\ninterface TableProps<T> {\r\n data: T[];\r\n columns: TableColumn<T>[];\r\n pagination?: boolean;\r\n selectable?: boolean;\r\n customArrayPagination?: number[];\r\n defaultPageSize?: number;\r\n filter?: boolean;\r\n filterPlaceholder?: string;\r\n color?: string;\r\n add?: boolean;\r\n textAdd?: string;\r\n actionAdd?: () => void;\r\n excelExport?: boolean;\r\n onDeleteRows?: (ids: (string | number)[]) => void;\r\n emptyState?: React.ComponentType;\r\n darkMode?: boolean;\r\n}\r\n\r\ninterface Identifiable {\r\n id: string | number;\r\n}\r\n\r\n// --- Componentes de Fila y Acción ---\r\n\r\nconst TableRow = React.memo(<T extends Identifiable>({ \r\n row, \r\n columns, \r\n selectable,\r\n isSelected, \r\n onSelect \r\n}: {\r\n row: T;\r\n columns: TableColumn<T>[];\r\n selectable: boolean;\r\n isSelected: boolean;\r\n onSelect: (id: string | number) => void;\r\n}) => {\r\n const { color } = useTableTheme();\r\n const alignmentClasses = { left: 'text-left', center: 'text-center', right: 'text-right' };\r\n\r\n return (\r\n <tr className=\"group transition-colors duration-150 hover:bg-[var(--highlight)]/5\">\r\n {selectable && (\r\n <td className=\"px-6 py-4 border-b border-transparent\">\r\n <CheckBox color={color} value={isSelected} onChange={() => onSelect(row.id)}/>\r\n </td>\r\n )}\r\n {columns.filter(c => !c.hidden).map((col) => (\r\n <td\r\n key={String(col.accessor)}\r\n className={`\r\n whitespace-nowrap px-6 py-4 \r\n text-slate-600 dark:text-slate-300\r\n transition-colors group-hover:text-slate-900 dark:group-hover:text-white\r\n ${alignmentClasses[col.align || 'left']}\r\n `}\r\n >\r\n {col.actions ? (\r\n <ActionButton actions={col.actions} row={row} />\r\n ) : col.format ? (\r\n col.format(row[col.accessor], row, color)\r\n ) : (\r\n String(row[col.accessor] ?? '')\r\n )}\r\n </td>\r\n ))}\r\n </tr>\r\n );\r\n});\r\n\r\nconst DropdownPortal = <T,>({ isOpen, onClose, anchorRect, actions, row }: {\r\n isOpen: boolean;\r\n onClose: () => void;\r\n anchorRect: DOMRect | null;\r\n actions: TableAction<T>[];\r\n row: T;\r\n}) => {\r\n const { darkMode, color } = useTableTheme();\r\n if (!isOpen || !anchorRect) return null;\r\n\r\n const style: React.CSSProperties = {\r\n position: 'fixed',\r\n top: `${anchorRect.bottom + 8}px`,\r\n left: `${anchorRect.right - 192}px`, \r\n zIndex: 9999,\r\n };\r\n\r\n return createPortal(\r\n <div className={darkMode ? 'dark' : ''} style={{ '--highlight': color } as React.CSSProperties}>\r\n <div className=\"fixed inset-0 z-[9998]\" onClick={onClose} />\r\n <div \r\n style={style}\r\n className=\"w-48 overflow-hidden rounded-xl border border-slate-200 bg-white shadow-2xl ring-1 ring-black ring-opacity-5 dark:border-slate-700 dark:bg-slate-800 animate-in fade-in zoom-in duration-150\"\r\n >\r\n <div className=\"py-1\">\r\n {actions.map((action, index) => {\r\n const Icon = action.icon;\r\n return (\r\n <button\r\n key={index}\r\n onClick={() => { action.onClick(row); onClose(); }}\r\n className={`flex w-full items-center gap-3 px-4 py-2.5 text-sm transition-colors hover:bg-slate-50 dark:hover:bg-slate-700/50 ${action.color || 'text-slate-700 dark:text-slate-200'}`}\r\n >\r\n {Icon && <Icon className=\"w-4 h-4 opacity-70\" />}\r\n <span className=\"font-medium\">{action.label}</span>\r\n </button>\r\n );\r\n })}\r\n </div>\r\n </div>\r\n </div>,\r\n document.body\r\n );\r\n};\r\n\r\nconst ActionButton = <T,>({ actions, row }: { actions: TableAction<T>[], row: T }) => {\r\n const [isOpen, setIsOpen] = useState(false);\r\n const [anchorRect, setAnchorRect] = useState<DOMRect | null>(null);\r\n const buttonRef = useRef<HTMLButtonElement>(null);\r\n\r\n const handleToggle = (e: React.MouseEvent) => {\r\n e.stopPropagation();\r\n if (buttonRef.current) {\r\n setAnchorRect(buttonRef.current.getBoundingClientRect());\r\n }\r\n setIsOpen(!isOpen);\r\n };\r\n\r\n return (\r\n <>\r\n <button \r\n ref={buttonRef}\r\n onClick={handleToggle}\r\n className={`p-2 rounded-full transition-all duration-200 ${isOpen ? 'bg-[var(--highlight)]/10 text-[var(--highlight)]' : 'hover:bg-slate-100 dark:hover:bg-slate-800 text-slate-400'}`}\r\n >\r\n <MoreHorizontal className=\"w-5 h-5\" />\r\n </button>\r\n <DropdownPortal \r\n isOpen={isOpen} \r\n onClose={() => setIsOpen(false)} \r\n anchorRect={anchorRect} \r\n actions={actions} \r\n row={row} \r\n />\r\n </>\r\n );\r\n};\r\n\r\n// --- Componente Principal ---\r\n\r\nexport const Table = <T extends Identifiable>({ \r\n data = [], \r\n columns = [], \r\n pagination = true, \r\n selectable = false, \r\n customArrayPagination = [5, 10, 25, 50, 100],\r\n defaultPageSize = 10,\r\n filter = false,\r\n filterPlaceholder = \"Buscar registros...\",\r\n color = \"#2563eb\",\r\n add = false,\r\n textAdd = \"Agregar\",\r\n actionAdd = () => {},\r\n excelExport = false, \r\n onDeleteRows = () => {},\r\n emptyState: CustomEmptyState,\r\n darkMode = false\r\n}: TableProps<T>) => {\r\n const [currentPage, setCurrentPage] = useState(1);\r\n const [pageSize, setPageSize] = useState(defaultPageSize);\r\n const [searchTerm, setSearchTerm] = useState(\"\");\r\n const [sortConfig, setSortConfig] = useState<{ key: keyof T | null, direction: 'asc' | 'desc' }>({ key: null, direction: 'asc' });\r\n const [selectedRows, setSelectedRows] = useState<Set<string | number>>(new Set());\r\n\r\n const themeValue = useMemo(() => ({ darkMode, color }), [darkMode, color]);\r\n\r\n const handleSort = (key: keyof T) => {\r\n let direction: 'asc' | 'desc' = 'asc';\r\n if (sortConfig.key === key && sortConfig.direction === 'asc') direction = 'desc';\r\n setSortConfig({ key, direction });\r\n };\r\n\r\n const processedData = useMemo(() => {\r\n let result = [...data];\r\n if (filter && searchTerm) {\r\n const searchableAccessors = columns.filter(c => c.filter).map(c => c.accessor);\r\n result = result.filter(row => \r\n searchableAccessors.some(acc => String(row[acc] ?? '').toLowerCase().includes(searchTerm.toLowerCase()))\r\n );\r\n }\r\n if (sortConfig.key) {\r\n result.sort((a, b) => {\r\n const valA = a[sortConfig.key!];\r\n const valB = b[sortConfig.key!];\r\n if (valA < valB) return sortConfig.direction === 'asc' ? -1 : 1;\r\n if (valA > valB) return sortConfig.direction === 'asc' ? 1 : -1;\r\n return 0;\r\n });\r\n }\r\n return result;\r\n }, [data, searchTerm, filter, columns, sortConfig]);\r\n\r\n const totalPages = Math.ceil(processedData.length / pageSize) || 1;\r\n const currentData = pagination \r\n ? processedData.slice((currentPage - 1) * pageSize, currentPage * pageSize) \r\n : processedData;\r\n\r\n const toggleSelectAll = () => {\r\n if (currentData.length > 0 && selectedRows.size === currentData.length) {\r\n setSelectedRows(new Set());\r\n } else {\r\n setSelectedRows(new Set(currentData.map(r => r.id)));\r\n }\r\n };\r\n\r\n const toggleSelectRow = (id: string | number) => {\r\n const newSelection = new Set(selectedRows);\r\n if (newSelection.has(id)) newSelection.delete(id);\r\n else newSelection.add(id);\r\n setSelectedRows(newSelection);\r\n };\r\n\r\n const handleExportCSV = () => {\r\n const visibleColumns = columns.filter(c => !c.hidden && !c.actions);\r\n const headers = visibleColumns.map(c => `\"${c.header}\"`).join(',');\r\n const rows = processedData.map(row => \r\n visibleColumns.map(c => {\r\n const val = row[c.accessor];\r\n return `\"${String(val ?? '').replace(/\"/g, '\"\"')}\"`;\r\n }).join(',')\r\n ).join('\\n');\r\n\r\n const csvContent = \"\\uFEFF\" + headers + '\\n' + rows;\r\n const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' });\r\n const url = URL.createObjectURL(blob);\r\n const link = document.createElement(\"a\");\r\n link.setAttribute(\"href\", url);\r\n link.setAttribute(\"download\", `Export_${new Date().getTime()}.csv`);\r\n document.body.appendChild(link);\r\n link.click();\r\n document.body.removeChild(link);\r\n };\r\n\r\n const alignmentClasses = { left: 'text-left', center: 'text-center', right: 'text-right' };\r\n\r\n return (\r\n <TableContext.Provider value={themeValue}>\r\n <div className={`flex flex-col gap-4 w-full ${darkMode ? 'dark' : ''}`} style={{ '--highlight': color } as React.CSSProperties}>\r\n <div className=\"flex flex-col sm:flex-row items-center justify-between gap-4\">\r\n <div className=\"flex flex-1 gap-4 w-full sm:w-auto\">\r\n {filter && (\r\n <div className=\"w-full sm:max-w-xs\">\r\n {/* Usamos el InternalInput para evitar errores de compilación por archivos inexistentes */}\r\n <Input \r\n icon={Search}\r\n color={color}\r\n value={searchTerm}\r\n onChange={setSearchTerm}\r\n label={filterPlaceholder}\r\n onClear={() => setSearchTerm(\"\")}\r\n />\r\n </div>\r\n )}\r\n \r\n {selectable && selectedRows.size > 0 && (\r\n <div className=\"flex items-center gap-3 animate-in fade-in slide-in-from-left-4\">\r\n <span className=\"text-sm font-bold text-slate-500 hidden md:inline\">{selectedRows.size} seleccionados</span>\r\n <button \r\n onClick={() => { onDeleteRows(Array.from(selectedRows)); setSelectedRows(new Set()); }}\r\n className=\"text-xs font-bold text-red-500 hover:text-red-600 bg-red-50 dark:bg-red-500/10 px-4 py-2.5 rounded-xl transition-all active:scale-95 flex items-center gap-2 border border-red-100 dark:border-red-500/20\"\r\n >\r\n <Trash2 className=\"w-4 h-4\" />\r\n <span>Eliminar</span>\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n\r\n <div className=\"flex items-center gap-3 w-full sm:w-auto\">\r\n {excelExport && (\r\n <Button\r\n onClick={handleExportCSV}\r\n color='green'\r\n icon={<Download className=\"w-4 h-4\" />}\r\n label='Exportar'\r\n >\r\n \r\n </Button>\r\n )}\r\n\r\n {add && (\r\n <>\r\n <Button\r\n onClick={actionAdd}\r\n kd={{ backgroundColor: 'var(--highlight)'}}\r\n icon={<Plus className=\"w-4 h-4\" />}\r\n label={textAdd}\r\n >\r\n </Button>\r\n </>\r\n )}\r\n </div>\r\n </div>\r\n\r\n <div className=\"w-full rounded-2xl border border-slate-200 bg-white shadow-sm dark:border-slate-800 dark:bg-slate-900 overflow-hidden\">\r\n <div className=\"overflow-x-auto\">\r\n <table className=\"min-w-full border-separate border-spacing-0 text-sm\">\r\n <thead className=\"bg-slate-50/50 dark:bg-slate-950/40\">\r\n <tr>\r\n {selectable && (\r\n <th className=\"px-6 py-4 border-b border-slate-100 dark:border-slate-800 w-10 text-left\">\r\n <CheckBox color={color} value={currentData.length > 0 && selectedRows.size === currentData.length} onChange={toggleSelectAll}/>\r\n </th>\r\n )} \r\n {columns.filter(c => !c.hidden).map((col) => (\r\n <th\r\n key={String(col.accessor)}\r\n onClick={() => handleSort(col.accessor)}\r\n className={`\r\n px-6 py-4 font-bold uppercase tracking-tight text-slate-500 dark:text-slate-400\r\n ${alignmentClasses[col.align || 'left']}\r\n border-b border-slate-100 dark:border-slate-800 cursor-pointer select-none group/th\r\n `}\r\n >\r\n <div className={`flex items-center gap-2 ${col.align === 'center' ? 'justify-center' : col.align === 'right' ? 'justify-end' : ''}`}>\r\n {col.header}\r\n <span className={`transition-colors ${sortConfig.key === col.accessor ? 'text-[var(--highlight)]' : 'text-slate-300 opacity-0 group-hover/th:opacity-100'}`}>\r\n {sortConfig.key === col.accessor \r\n ? (sortConfig.direction === 'asc' ? <ArrowUp className=\"w-3 h-3\" /> : <ArrowDown className=\"w-3 h-3\" />)\r\n : <ArrowUpDown className=\"w-3 h-3\" />\r\n }\r\n </span>\r\n </div>\r\n </th>\r\n ))}\r\n </tr>\r\n </thead>\r\n <tbody className=\"divide-y divide-slate-100 dark:divide-slate-800\">\r\n {currentData.length > 0 ? (\r\n currentData.map((row) => (\r\n <TableRow \r\n key={row.id} \r\n row={row} \r\n columns={columns as any} \r\n selectable={selectable}\r\n isSelected={selectedRows.has(row.id)}\r\n onSelect={toggleSelectRow}\r\n />\r\n ))\r\n ) : (\r\n <tr>\r\n <td colSpan={columns.length + (selectable ? 1 : 0)}>\r\n {CustomEmptyState ? <CustomEmptyState /> : (\r\n <div className=\"flex flex-col items-center justify-center py-20 text-slate-400 gap-3\">\r\n <Inbox className=\"w-12 h-12 opacity-20\" />\r\n <p className=\"font-medium italic\">No se encontraron registros para mostrar</p>\r\n </div>\r\n )}\r\n </td>\r\n </tr>\r\n )}\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n\r\n {pagination && processedData.length > 0 && (\r\n <div className=\"flex flex-col sm:flex-row items-center justify-between gap-4 px-2 py-2 text-sm text-slate-500 dark:text-slate-400 font-medium\">\r\n <div className=\"flex items-center gap-4\">\r\n <div className=\"flex items-center gap-2\">\r\n <span>Mostrar</span>\r\n <div className=\"relative\">\r\n <select \r\n value={pageSize}\r\n onChange={(e) => { setPageSize(Number(e.target.value)); setCurrentPage(1); }}\r\n className=\"appearance-none bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg px-3 py-1.5 pr-8 focus:outline-none focus:ring-2 focus:ring-[var(--highlight)]/20 cursor-pointer text-slate-700 dark:text-slate-300 font-bold\"\r\n >\r\n {customArrayPagination.map(size => <option key={size} value={size}>{size}</option>)}\r\n </select>\r\n <ChevronDown className=\"w-4 h-4 absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none opacity-50\" />\r\n </div>\r\n </div>\r\n </div>\r\n <div className=\"flex items-center gap-2\">\r\n <button onClick={() => setCurrentPage(p => Math.max(p - 1, 1))} disabled={currentPage === 1} className=\"p-2 rounded-lg border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 disabled:opacity-30 hover:bg-slate-50 dark:hover:bg-slate-800 transition-colors\"><ChevronLeft className=\"w-4 h-4\" /></button>\r\n <div className=\"flex items-center gap-1 min-w-[60px] justify-center\">\r\n <span className=\"font-bold text-[var(--highlight)]\">{currentPage}</span>\r\n <span className=\"opacity-30\">/</span>\r\n <span>{totalPages}</span>\r\n </div>\r\n <button onClick={() => setCurrentPage(p => Math.min(p + 1, totalPages))} disabled={currentPage === totalPages} className=\"p-2 rounded-lg border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 disabled:opacity-30 hover:bg-slate-50 dark:hover:bg-slate-800 transition-colors\"><ChevronRight className=\"w-4 h-4\" /></button>\r\n </div>\r\n </div>\r\n )}\r\n </div>\r\n </TableContext.Provider>\r\n );\r\n};\r\n\r\nexport default Table;","import { Menu, X } from \"lucide-react\";\r\nimport { CSSProperties, ReactNode } from \"react\";\r\n\r\n\r\n\r\nexport type NavbarPosition = 'static' | 'sticky' | 'fixed-bottom-floating';\r\n\r\n/**\r\n * @interface NavbarProps\r\n * Propiedades para el componente Navbar altamente configurable.\r\n */\r\nexport interface NavbarProps {\r\n /** @param title - Título o logo del Navbar. */\r\n title?: ReactNode;\r\n /** @param position - Posición del Nav: 'static' (arriba normal), 'sticky' (pegado arriba), 'fixed-bottom-floating' (abajo flotante). */\r\n position?: NavbarPosition;\r\n /** @param color - Color principal para detalles o fondo (si colorDominant es true). */\r\n color?: string;\r\n /** @param colorDominant - Si es true, el color de la prop 'color' se convierte en el fondo principal. */\r\n colorDominant?: boolean;\r\n /** @param isMenuOpen - Estado controlado para el menú hamburguesa móvil. */\r\n isMenuOpen?: boolean;\r\n /** @param onToggleMenu - Función para abrir/cerrar el menú. */\r\n onToggleMenu?: () => void;\r\n /** @param children - Elementos de navegación o acciones. */\r\n children?: ReactNode;\r\n /** @param kd - Estilos CSS personalizados para el contenedor del Navbar. */\r\n kd?: CSSProperties;\r\n}\r\n\r\n/**\r\n * Componente Navbar - Barra de navegación adaptable con soporte para múltiples posiciones y temas.\r\n * Gestiona automáticamente el contraste del texto según el fondo.\r\n */\r\nexport const Navbar = ({\r\n title = \"Kydra Nav\",\r\n position = \"static\",\r\n color = \"#6366f1\",\r\n colorDominant = false,\r\n isMenuOpen = false,\r\n onToggleMenu,\r\n children,\r\n kd = {}\r\n}: NavbarProps) => {\r\n const getPositionClasses = () => {\r\n switch (position) {\r\n case 'sticky': return 'sticky top-0 z-50';\r\n case 'fixed-bottom-floating': return 'fixed bottom-6 left-6 right-6 z-50 rounded-2xl shadow-2xl max-w-5xl mx-auto';\r\n default: return 'relative';\r\n }\r\n };\r\n\r\n const navStyles: CSSProperties = {\r\n backgroundColor: colorDominant ? color : undefined,\r\n borderColor: !colorDominant ? `${color}40` : 'transparent',\r\n // Si el color es dominante, forzamos blanco. Si no, dejamos que herede del tema oscuro/claro\r\n color: colorDominant ? '#ffffff' : undefined,\r\n ...kd\r\n };\r\n\r\n return (\r\n <nav \r\n style={navStyles}\r\n className={`\r\n ${getPositionClasses()}\r\n px-6 py-4 border-b transition-all duration-300\r\n ${!colorDominant \r\n ? 'bg-white/80 dark:bg-slate-900/80 backdrop-blur-md dark:border-slate-800 text-slate-900 dark:text-white' \r\n : 'border-none text-white'}\r\n `}\r\n >\r\n <div className=\"flex items-center justify-between gap-4\">\r\n {/* Logo / Título */}\r\n <div className=\"flex items-center gap-2 font-black text-lg tracking-tight\">\r\n {typeof title === 'string' ? (\r\n <span style={{ color: colorDominant ? 'white' : color }}>{title}</span>\r\n ) : title}\r\n </div>\r\n\r\n {/* Desktop Actions - Heredan el color del padre */}\r\n <div className=\"hidden md:flex items-center gap-6\">\r\n {children}\r\n </div>\r\n\r\n {/* Hamburguesa Mobile */}\r\n <button \r\n onClick={onToggleMenu}\r\n className={`md:hidden p-2 rounded-lg transition-colors ${colorDominant ? 'hover:bg-white/10' : 'hover:bg-black/5 dark:hover:bg-white/5'}`}\r\n >\r\n {isMenuOpen ? <X size={24} /> : <Menu size={24} />}\r\n </button>\r\n </div>\r\n\r\n {/* Mobile Menu Dropdown */}\r\n {isMenuOpen && (\r\n <div className={`md:hidden mt-4 pb-4 animate-in slide-in-from-top-2 duration-200 border-t pt-4 ${colorDominant ? 'border-white/20' : 'border-black/5 dark:border-white/5'}`}>\r\n <div className=\"flex flex-col gap-4\">\r\n {children}\r\n </div>\r\n </div>\r\n )}\r\n </nav>\r\n );\r\n};"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kydra/ui",
|
|
3
|
-
"version": "0.
|
|
4
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
5
4
|
"main": "./dist/index.js",
|
|
6
5
|
"module": "./dist/index.mjs",
|
|
7
6
|
"types": "./dist/index.d.ts",
|
|
@@ -17,17 +16,20 @@
|
|
|
17
16
|
"build": "tsup src/index.ts --format esm,cjs --clean --dts",
|
|
18
17
|
"lint": "eslint \"src/**/*.ts*\""
|
|
19
18
|
},
|
|
20
|
-
|
|
19
|
+
"peerDependencies": {
|
|
21
20
|
"react": "^18.0.0 || ^19.0.0",
|
|
22
21
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"tsup": "^8.0.0",
|
|
26
|
-
"typescript": "^5.0.0",
|
|
27
|
-
"react": "^18.3.1",
|
|
28
|
-
"react-dom": "^18.3.1",
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
29
24
|
"@types/react": "^18.3.1",
|
|
30
25
|
"@types/react-dom": "^18.3.1",
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
"react": "^18.3.1",
|
|
27
|
+
"react-dom": "^18.3.1",
|
|
28
|
+
"tailwindcss": "^3.4.0",
|
|
29
|
+
"tsup": "^8.0.0",
|
|
30
|
+
"typescript": "^5.0.0"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"lucide-react": "^0.563.0"
|
|
34
|
+
}
|
|
35
|
+
}
|