cuenti-dna 0.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +133 -0
- package/dist/index.cjs +1346 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +491 -0
- package/dist/index.d.ts +491 -0
- package/dist/index.js +1295 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +2035 -0
- package/package.json +76 -0
- package/scripts/postinstall.cjs +569 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,491 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React$1 from 'react';
|
|
3
|
+
import { ChangeEventHandler, FocusEventHandler } from 'react';
|
|
4
|
+
import { ClassValue } from 'clsx';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Propiedades publicas del componente `Button`.
|
|
8
|
+
*/
|
|
9
|
+
type ButtonProps = {
|
|
10
|
+
/**
|
|
11
|
+
* Variante visual del boton.
|
|
12
|
+
* @default 'primary'
|
|
13
|
+
* @variation 'primary' | 'alt' | 'secondary' | 'ghost' | 'primary-ghost' | 'link' | 'destructive' | 'success' | 'accent' | 'outline' | 'secondary-outline'
|
|
14
|
+
* @see {@link ButtonVariants}
|
|
15
|
+
*/
|
|
16
|
+
variant?: ButtonVariants;
|
|
17
|
+
/**
|
|
18
|
+
* Tamano del boton.
|
|
19
|
+
* @default 'md'
|
|
20
|
+
* @variation 'sm' | 'md' | 'lg' | 'icon' | 'icon-sm' | 'icon-lg'
|
|
21
|
+
* @see {@link ButtonSizes}
|
|
22
|
+
*/
|
|
23
|
+
size?: ButtonSizes;
|
|
24
|
+
} & React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
25
|
+
/** Variantes visuales disponibles para el boton. */
|
|
26
|
+
type ButtonVariants = 'primary' | 'alt' | 'secondary' | 'ghost' | 'link' | 'destructive' | 'success' | 'accent' | 'outline' | 'primary-ghost' | 'secondary-outline';
|
|
27
|
+
/** Tamanos disponibles para el boton. */
|
|
28
|
+
type ButtonSizes = 'sm' | 'md' | 'lg' | 'icon' | 'icon-sm' | 'icon-lg';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Componente Button.
|
|
32
|
+
*
|
|
33
|
+
* Renderiza un boton reutilizable con variantes y tamanos predefinidos.
|
|
34
|
+
* El tipo por defecto es `button` para evitar submits accidentales en formularios.
|
|
35
|
+
*
|
|
36
|
+
* @see {@link ButtonProps}
|
|
37
|
+
*/
|
|
38
|
+
declare function Button({ variant, size, className, children, type, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Propiedades publicas del componente `Checkbox`.
|
|
42
|
+
*/
|
|
43
|
+
type CheckboxProps = {
|
|
44
|
+
/**
|
|
45
|
+
* Variante visual del checkbox.
|
|
46
|
+
* @default 'default'
|
|
47
|
+
* @variation 'default' | 'success'
|
|
48
|
+
*/
|
|
49
|
+
variant?: CheckboxVariants;
|
|
50
|
+
/**
|
|
51
|
+
* Estilo de esquinas para el control.
|
|
52
|
+
* @default 'square'
|
|
53
|
+
* @variation 'square' | 'rounded'
|
|
54
|
+
*/
|
|
55
|
+
size?: CheckboxSizes;
|
|
56
|
+
/**
|
|
57
|
+
* Muestra el estado indeterminado.
|
|
58
|
+
* Es un tercer estado visual y debe controlarse desde el componente padre.
|
|
59
|
+
* @default false
|
|
60
|
+
*/
|
|
61
|
+
indeterminate?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Clases opcionales para personalizar elementos internos.
|
|
64
|
+
*/
|
|
65
|
+
classNames?: {
|
|
66
|
+
/**
|
|
67
|
+
* Clase para el contenedor raiz.
|
|
68
|
+
*/
|
|
69
|
+
root?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Clase para el input nativo.
|
|
72
|
+
*/
|
|
73
|
+
input?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Clase para el contenido de la etiqueta.
|
|
76
|
+
*/
|
|
77
|
+
label?: string;
|
|
78
|
+
};
|
|
79
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'>;
|
|
80
|
+
/** Variantes visuales disponibles para el checkbox. */
|
|
81
|
+
type CheckboxVariants = 'default' | 'success';
|
|
82
|
+
/** Estilos de esquina disponibles para el checkbox. */
|
|
83
|
+
type CheckboxSizes = 'square' | 'rounded';
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Componente Checkbox.
|
|
87
|
+
*
|
|
88
|
+
* Renderiza un control de seleccion con soporte para estados
|
|
89
|
+
* marcado, desmarcado e indeterminado.
|
|
90
|
+
* Incluye protecciones de interaccion para readOnly y disabled, ademas de variantes y tamanos visuales.
|
|
91
|
+
*
|
|
92
|
+
* @see {@link CheckboxProps}
|
|
93
|
+
*/
|
|
94
|
+
declare function Checkbox({ variant, size, indeterminate, children, className, classNames, readOnly, onClick, onChange, disabled, ...props }: CheckboxProps): react_jsx_runtime.JSX.Element;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Propiedades publicas del componente `Input`.
|
|
98
|
+
*/
|
|
99
|
+
type InputProps = {
|
|
100
|
+
/**
|
|
101
|
+
* Tipo de campo a renderizar.
|
|
102
|
+
*/
|
|
103
|
+
type?: InputTypes;
|
|
104
|
+
/**
|
|
105
|
+
* Variante visual del campo.
|
|
106
|
+
*/
|
|
107
|
+
variant?: InputVariants;
|
|
108
|
+
/**
|
|
109
|
+
* Tamano visual del campo.
|
|
110
|
+
*/
|
|
111
|
+
size?: InputSizes;
|
|
112
|
+
/**
|
|
113
|
+
* Prefijo de moneda cuando el tipo es `money`.
|
|
114
|
+
*/
|
|
115
|
+
moneySymbol?: string;
|
|
116
|
+
/**
|
|
117
|
+
* Clases opcionales para contenedor e input interno.
|
|
118
|
+
*/
|
|
119
|
+
classNames?: {
|
|
120
|
+
/**
|
|
121
|
+
* Clase para el contenedor raiz.
|
|
122
|
+
*/
|
|
123
|
+
root?: string;
|
|
124
|
+
/**
|
|
125
|
+
* Clase para el elemento input.
|
|
126
|
+
*/
|
|
127
|
+
input?: string;
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Elimina validaciones y formatos especiales, renderizando un input basico, sin los comportamientos por defecto de cada tipo especializado.
|
|
131
|
+
*
|
|
132
|
+
* Útil para los tipos 'number' y 'money' cuando se desea un campo con formato libre, sin restricciones de caracteres ni formato visual, pero manteniendo la consistencia visual con los campos especializados.
|
|
133
|
+
*/
|
|
134
|
+
reset?: boolean;
|
|
135
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'>;
|
|
136
|
+
/** Tipos de input soportados por el componente base. */
|
|
137
|
+
type InputTypes = 'text' | 'password' | 'email' | 'number' | 'money';
|
|
138
|
+
/** Variantes visuales disponibles para Input. */
|
|
139
|
+
type InputVariants = 'default' | 'error' | 'success';
|
|
140
|
+
/** Tamanos visuales disponibles para Input. */
|
|
141
|
+
type InputSizes = 'sm' | 'md' | 'lg';
|
|
142
|
+
/** Lista utilitaria de tipos permitidos para controles de UI y validacion. */
|
|
143
|
+
declare const inputTypes: InputTypes[];
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Componente Input.
|
|
147
|
+
*
|
|
148
|
+
* Punto de entrada para todos los campos de texto del sistema.
|
|
149
|
+
* Segun el `type`, delega en implementaciones especializadas para password,
|
|
150
|
+
* number y money, o renderiza un input nativo para tipos simples.
|
|
151
|
+
*
|
|
152
|
+
* @see {@link InputProps}
|
|
153
|
+
*/
|
|
154
|
+
declare function Input({ variant, size, classNames, moneySymbol, type, ...props }: InputProps): react_jsx_runtime.JSX.Element | undefined;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Propiedades comunes para inputs especializados que no necesitan redefinir
|
|
158
|
+
* el tipo visual ni simbolo monetario.
|
|
159
|
+
*/
|
|
160
|
+
type SpecializedInputProps = Omit<InputProps, 'type' | 'variant' | 'moneySymbol'>;
|
|
161
|
+
/**
|
|
162
|
+
* Propiedades para el input monetario especializado.
|
|
163
|
+
* Conserva `moneySymbol` para definir prefijo de visualizacion.
|
|
164
|
+
*/
|
|
165
|
+
type SpecializedMoneyInputProps = Omit<InputProps, 'type' | 'variant'>;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Propiedades internas para `MoneyInput`.
|
|
169
|
+
*/
|
|
170
|
+
type MoneyInputProps = SpecializedMoneyInputProps & {
|
|
171
|
+
reset?: boolean;
|
|
172
|
+
};
|
|
173
|
+
/**
|
|
174
|
+
* Campo especializado para montos monetarios.
|
|
175
|
+
*
|
|
176
|
+
* Mantiene un valor editable mientras el input esta en foco y un valor
|
|
177
|
+
* formateado al perder foco, emitiendo siempre el valor crudo al exterior.
|
|
178
|
+
* En formularios, envia el valor crudo (sin simbolos ni separadores visuales).
|
|
179
|
+
*/
|
|
180
|
+
declare function MoneyInput({ size: _size, classNames, moneySymbol, reset, ...props }: MoneyInputProps): react_jsx_runtime.JSX.Element;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Propiedades internas para `NumberInput`.
|
|
184
|
+
*/
|
|
185
|
+
type NumberInputProps = SpecializedInputProps & {
|
|
186
|
+
reset?: boolean;
|
|
187
|
+
};
|
|
188
|
+
/**
|
|
189
|
+
* Campo especializado para valores numericos.
|
|
190
|
+
*
|
|
191
|
+
* Filtra teclas y pegado para garantizar que el valor ingresado
|
|
192
|
+
* respete el patron definido para numeros del sistema.
|
|
193
|
+
* En formularios, envia el valor crudo (sin formato visual) mediante un campo oculto.
|
|
194
|
+
*/
|
|
195
|
+
declare function NumberInput({ size: _size, classNames, reset, ...props }: NumberInputProps): react_jsx_runtime.JSX.Element;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Propiedades internas para `PasswordInput`.
|
|
199
|
+
*/
|
|
200
|
+
type PasswordInputProps = SpecializedInputProps;
|
|
201
|
+
/**
|
|
202
|
+
* Campo especializado para contrasenas.
|
|
203
|
+
*
|
|
204
|
+
* Permite alternar visibilidad entre texto plano y password,
|
|
205
|
+
* manteniendo nombre accesible para el boton de alternancia.
|
|
206
|
+
*/
|
|
207
|
+
declare function PasswordInput({ size, classNames, ...props }: PasswordInputProps): react_jsx_runtime.JSX.Element;
|
|
208
|
+
|
|
209
|
+
/** Variantes visuales disponibles para los radios. */
|
|
210
|
+
type RadioVariants = 'default' | 'success';
|
|
211
|
+
/** Clases opcionales para personalizar subpartes del item de radio. */
|
|
212
|
+
type RadioGroupItemClassNames = {
|
|
213
|
+
/** Clase para el contenedor raiz del item. */
|
|
214
|
+
root?: string;
|
|
215
|
+
/** Clase para el input nativo. */
|
|
216
|
+
input?: string;
|
|
217
|
+
/** Clase para el indicador de estado seleccionado. */
|
|
218
|
+
indicator?: string;
|
|
219
|
+
/** Clase para la etiqueta de texto. */
|
|
220
|
+
label?: string;
|
|
221
|
+
};
|
|
222
|
+
/**
|
|
223
|
+
* Propiedades publicas del contenedor `RadioGroup`.
|
|
224
|
+
*/
|
|
225
|
+
type RadioGroupProps = {
|
|
226
|
+
/** Valor seleccionado en modo controlado. */
|
|
227
|
+
value?: string;
|
|
228
|
+
/** Valor inicial en modo no controlado. */
|
|
229
|
+
defaultValue?: string;
|
|
230
|
+
/** Se ejecuta cuando cambia el valor seleccionado. */
|
|
231
|
+
onValueChange?: (value: string) => void;
|
|
232
|
+
/** Nombre compartido para todos los radios del grupo. */
|
|
233
|
+
name?: string;
|
|
234
|
+
/**
|
|
235
|
+
* Variante visual aplicada por defecto a los items del grupo.
|
|
236
|
+
* @default 'default'
|
|
237
|
+
* @variation 'default' | 'success'
|
|
238
|
+
*/
|
|
239
|
+
variant?: RadioVariants;
|
|
240
|
+
/** Deshabilita todos los items del grupo. */
|
|
241
|
+
disabled?: boolean;
|
|
242
|
+
/** Evita cambios manteniendo foco y semantica accesible. */
|
|
243
|
+
readOnly?: boolean;
|
|
244
|
+
} & Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'>;
|
|
245
|
+
/**
|
|
246
|
+
* Propiedades publicas de cada item de radio dentro del grupo.
|
|
247
|
+
*/
|
|
248
|
+
type RadioGroupItemProps = {
|
|
249
|
+
/** Valor emitido cuando este item queda seleccionado. */
|
|
250
|
+
value: string;
|
|
251
|
+
/** Variante visual opcional para sobrescribir la del grupo. */
|
|
252
|
+
variant?: RadioVariants;
|
|
253
|
+
/** Clases opcionales para personalizar subpartes del item. */
|
|
254
|
+
classNames?: RadioGroupItemClassNames;
|
|
255
|
+
/** Contenido opcional de etiqueta renderizado junto al control. */
|
|
256
|
+
children?: React.ReactNode;
|
|
257
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'size' | 'value' | 'name' | 'checked' | 'defaultChecked'>;
|
|
258
|
+
/** Contrato interno de contexto compartido entre RadioGroup y RadioItem. */
|
|
259
|
+
type RadioGroupContextValue = {
|
|
260
|
+
name: string;
|
|
261
|
+
value?: string;
|
|
262
|
+
variant: RadioVariants;
|
|
263
|
+
disabled: boolean;
|
|
264
|
+
readOnly: boolean;
|
|
265
|
+
onValueChange: (value: string) => void;
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Componente RadioGroup.
|
|
270
|
+
*
|
|
271
|
+
* Contenedor de radios con contexto interno compartido.
|
|
272
|
+
* Permite uso controlado y no controlado del valor seleccionado.
|
|
273
|
+
*
|
|
274
|
+
* @see {@link RadioGroupProps}
|
|
275
|
+
*/
|
|
276
|
+
declare function RadioGroup({ value, defaultValue, onValueChange, name, variant, disabled, readOnly, className, children, ...props }: RadioGroupProps): react_jsx_runtime.JSX.Element;
|
|
277
|
+
/**
|
|
278
|
+
* Componente RadioItem.
|
|
279
|
+
*
|
|
280
|
+
* Item de radio integrado con etiqueta interna, preparado para trabajar con RadioGroup.
|
|
281
|
+
*
|
|
282
|
+
* @see {@link RadioGroupItemProps}
|
|
283
|
+
*/
|
|
284
|
+
declare function RadioItem({ variant, children, className, classNames, readOnly, onClick, onChange, disabled, value, id: propId, ...props }: RadioGroupItemProps): react_jsx_runtime.JSX.Element;
|
|
285
|
+
|
|
286
|
+
/** Variantes visuales disponibles para el switch. */
|
|
287
|
+
type SwitchVariants = 'default' | 'alt';
|
|
288
|
+
/**
|
|
289
|
+
* Clases opcionales para personalizar cada parte visual del switch.
|
|
290
|
+
*/
|
|
291
|
+
type SwitchClassNames = {
|
|
292
|
+
/**
|
|
293
|
+
* Clase para la etiqueta raiz que envuelve todo el switch.
|
|
294
|
+
*/
|
|
295
|
+
root?: string;
|
|
296
|
+
/**
|
|
297
|
+
* Clase para el contenedor de la pista.
|
|
298
|
+
*/
|
|
299
|
+
input?: string;
|
|
300
|
+
/**
|
|
301
|
+
* Clase para el indicador deslizante.
|
|
302
|
+
*/
|
|
303
|
+
indicator?: string;
|
|
304
|
+
};
|
|
305
|
+
type SwitchProps = {
|
|
306
|
+
/**
|
|
307
|
+
* Variante visual del switch.
|
|
308
|
+
* @default 'default'
|
|
309
|
+
* @variation 'default' | 'alt'
|
|
310
|
+
*/
|
|
311
|
+
variant?: SwitchVariants;
|
|
312
|
+
/**
|
|
313
|
+
* Clases opcionales para personalizar cada parte visual.
|
|
314
|
+
*/
|
|
315
|
+
classNames?: SwitchClassNames;
|
|
316
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'>;
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Componente Switch.
|
|
320
|
+
*
|
|
321
|
+
* Renderiza un interruptor accesible basado en un input de tipo checkbox.
|
|
322
|
+
* Soporta variantes visuales, estado deshabilitado y personalizacion por classNames.
|
|
323
|
+
*
|
|
324
|
+
* @see {@link SwitchProps}
|
|
325
|
+
*/
|
|
326
|
+
declare function Switch({ variant, classNames, id: propsId, children, className, ...props }: SwitchProps): react_jsx_runtime.JSX.Element;
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Propiedades del contenedor principal `Card`.
|
|
330
|
+
*/
|
|
331
|
+
type CardProps = {
|
|
332
|
+
/**
|
|
333
|
+
* Etiqueta HTML a utilizar para el contenedor.
|
|
334
|
+
*/
|
|
335
|
+
as?: 'div' | 'article' | 'section';
|
|
336
|
+
/**
|
|
337
|
+
* Habilita estilos de interaccion para estados de sobrevuelo y foco.
|
|
338
|
+
*/
|
|
339
|
+
interactive?: boolean;
|
|
340
|
+
/**
|
|
341
|
+
* Clases adicionales para personalizacion visual.
|
|
342
|
+
*/
|
|
343
|
+
className?: string;
|
|
344
|
+
} & React$1.ComponentPropsWithoutRef<'div'>;
|
|
345
|
+
/** Propiedades del encabezado de `Card`. */
|
|
346
|
+
type CardHeaderProps = React$1.ComponentPropsWithoutRef<'header'>;
|
|
347
|
+
/** Propiedades del titulo de `Card`. */
|
|
348
|
+
type CardTitleProps = React$1.ComponentPropsWithoutRef<'h3'>;
|
|
349
|
+
/** Propiedades de la descripcion de `Card`. */
|
|
350
|
+
type CardDescriptionProps = React$1.ComponentPropsWithoutRef<'p'>;
|
|
351
|
+
/** Propiedades de la region de acciones de `Card`. */
|
|
352
|
+
type CardActionProps = React$1.ComponentPropsWithoutRef<'div'>;
|
|
353
|
+
/** Propiedades de la region de contenido principal de `Card`. */
|
|
354
|
+
type CardContentProps = React$1.ComponentPropsWithoutRef<'section'>;
|
|
355
|
+
/** Propiedades del pie de `Card`. */
|
|
356
|
+
type CardFooterProps = React$1.ComponentPropsWithoutRef<'footer'>;
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Componente contenedor principal para superficies Card.
|
|
360
|
+
*
|
|
361
|
+
* Permite cambiar la etiqueta semantica mediante `as` y habilitar
|
|
362
|
+
* un estado visual interactivo.
|
|
363
|
+
*/
|
|
364
|
+
declare function Card({ as, className, interactive, ...props }: CardProps): react_jsx_runtime.JSX.Element;
|
|
365
|
+
/**
|
|
366
|
+
* Cabecera composable de Card.
|
|
367
|
+
*/
|
|
368
|
+
declare function CardHeader({ className, ...props }: CardHeaderProps): react_jsx_runtime.JSX.Element;
|
|
369
|
+
/**
|
|
370
|
+
* Titulo principal de Card.
|
|
371
|
+
*/
|
|
372
|
+
declare function CardTitle({ className, ...props }: CardTitleProps): react_jsx_runtime.JSX.Element;
|
|
373
|
+
/**
|
|
374
|
+
* Texto descriptivo secundario de Card.
|
|
375
|
+
*/
|
|
376
|
+
declare function CardDescription({ className, ...props }: CardDescriptionProps): react_jsx_runtime.JSX.Element;
|
|
377
|
+
/**
|
|
378
|
+
* Region auxiliar para acciones de Card (ej. botones en cabecera).
|
|
379
|
+
*/
|
|
380
|
+
declare function CardAction({ className, ...props }: CardActionProps): react_jsx_runtime.JSX.Element;
|
|
381
|
+
/**
|
|
382
|
+
* Region de contenido principal de Card.
|
|
383
|
+
*/
|
|
384
|
+
declare function CardContent({ className, ...props }: CardContentProps): react_jsx_runtime.JSX.Element;
|
|
385
|
+
/**
|
|
386
|
+
* Pie de Card para acciones o informacion complementaria.
|
|
387
|
+
*/
|
|
388
|
+
declare function CardFooter({ className, ...props }: CardFooterProps): react_jsx_runtime.JSX.Element;
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Tipo de valor compatible con controles HTML para normalizacion numerica.
|
|
392
|
+
*/
|
|
393
|
+
type NormalizableValue = string | number | readonly string[] | undefined;
|
|
394
|
+
/**
|
|
395
|
+
* Parametros requeridos por `useFormattedNumericInput`.
|
|
396
|
+
*
|
|
397
|
+
* Define funciones de conversion entre los tres estados de valor:
|
|
398
|
+
* - Crudo: usado para formularios/eventos.
|
|
399
|
+
* - Editable: usado durante foco.
|
|
400
|
+
* - Presentacion: usado fuera de foco.
|
|
401
|
+
*/
|
|
402
|
+
type UseFormattedNumericInputParams = {
|
|
403
|
+
value: NormalizableValue;
|
|
404
|
+
defaultValue: NormalizableValue;
|
|
405
|
+
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
406
|
+
onBlur?: FocusEventHandler<HTMLInputElement>;
|
|
407
|
+
onFocus?: FocusEventHandler<HTMLInputElement>;
|
|
408
|
+
normalizeRawValue: (value: NormalizableValue) => string;
|
|
409
|
+
rawToEditableValue: (rawValue: string) => string;
|
|
410
|
+
rawToDisplayValue: (rawValue: string) => string;
|
|
411
|
+
editableToRawValue: (editableValue: string) => string;
|
|
412
|
+
sanitizeEditableValue?: (editableValue: string) => string;
|
|
413
|
+
};
|
|
414
|
+
/**
|
|
415
|
+
* Contrato de retorno de `useFormattedNumericInput`.
|
|
416
|
+
*/
|
|
417
|
+
type UseFormattedNumericInputReturn = {
|
|
418
|
+
rawValue: string;
|
|
419
|
+
displayValue: string;
|
|
420
|
+
isFocused: boolean;
|
|
421
|
+
handleFocus: FocusEventHandler<HTMLInputElement>;
|
|
422
|
+
handleChange: ChangeEventHandler<HTMLInputElement>;
|
|
423
|
+
handleBlur: FocusEventHandler<HTMLInputElement>;
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* Hook compartido para inputs numericos con valor crudo y valor de presentacion.
|
|
428
|
+
*
|
|
429
|
+
* Mantiene:
|
|
430
|
+
* - Valor crudo: usado para formularios y eventos.
|
|
431
|
+
* - Valor visible: usado para mostrar formato amigable al usuario.
|
|
432
|
+
*/
|
|
433
|
+
declare function useFormattedNumericInput({ value, defaultValue, onChange, onBlur, onFocus, normalizeRawValue, rawToEditableValue, rawToDisplayValue, editableToRawValue, sanitizeEditableValue }: UseFormattedNumericInputParams): UseFormattedNumericInputReturn;
|
|
434
|
+
|
|
435
|
+
type UseRadioProps = Pick<RadioGroupItemProps, 'variant' | 'readOnly' | 'disabled' | 'value' | 'onClick' | 'onChange' | 'id'>;
|
|
436
|
+
/**
|
|
437
|
+
* Resuelve estado y manejadores de un `RadioItem` conectado al contexto.
|
|
438
|
+
*
|
|
439
|
+
* Fusiona configuracion local con la heredada desde `RadioGroup` y entrega
|
|
440
|
+
* un contrato listo para renderizar el input nativo sin duplicar logica.
|
|
441
|
+
*/
|
|
442
|
+
declare function useRadio({ variant, readOnly, disabled, value, onClick, onChange, id }: UseRadioProps): {
|
|
443
|
+
id: string;
|
|
444
|
+
name: string;
|
|
445
|
+
resolvedVariant: RadioVariants;
|
|
446
|
+
isReadOnly: boolean;
|
|
447
|
+
isDisabled: boolean;
|
|
448
|
+
isChecked: boolean;
|
|
449
|
+
handleClick: React$1.MouseEventHandler<HTMLInputElement>;
|
|
450
|
+
handleChange: React$1.ChangeEventHandler<HTMLInputElement, Element>;
|
|
451
|
+
};
|
|
452
|
+
|
|
453
|
+
type UseRadioGroupParams = Pick<RadioGroupProps, 'value' | 'defaultValue' | 'onValueChange' | 'name' | 'variant' | 'disabled' | 'readOnly'>;
|
|
454
|
+
type UseRadioGroupReturn = {
|
|
455
|
+
contextValue: RadioGroupContextValue;
|
|
456
|
+
};
|
|
457
|
+
/**
|
|
458
|
+
* Encapsula la logica de estado y eventos de `RadioGroup`.
|
|
459
|
+
*
|
|
460
|
+
* Resuelve:
|
|
461
|
+
* - Modo controlado (`value`) y no controlado (`defaultValue`).
|
|
462
|
+
* - Nombre final del grupo para atributos `name`.
|
|
463
|
+
* - Bloqueo de cambios cuando el grupo esta en `disabled` o `readOnly`.
|
|
464
|
+
* - Objeto de contexto memoizado para evitar renders innecesarios.
|
|
465
|
+
*/
|
|
466
|
+
declare function useRadioGroup({ value, defaultValue, onValueChange, name, variant, disabled, readOnly }: UseRadioGroupParams): UseRadioGroupReturn;
|
|
467
|
+
|
|
468
|
+
/**
|
|
469
|
+
* Icono de check para estados seleccionados o exitosos.
|
|
470
|
+
*/
|
|
471
|
+
declare function Check({ className, ...props }: React.SVGProps<SVGSVGElement>): react_jsx_runtime.JSX.Element;
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* Icono de menos para estados indeterminados o acciones de resta.
|
|
475
|
+
*/
|
|
476
|
+
declare function Minus({ ...props }: React.SVGProps<SVGSVGElement>): react_jsx_runtime.JSX.Element;
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* Icono de cierre con forma de X.
|
|
480
|
+
*/
|
|
481
|
+
declare function CloseX({ className, ...props }: React.SVGProps<SVGSVGElement>): react_jsx_runtime.JSX.Element;
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* Combina clases condicionales y resuelve conflictos de Tailwind.
|
|
485
|
+
*
|
|
486
|
+
* Usa `clsx` para componer entradas heterogeneas y `tailwind-merge`
|
|
487
|
+
* para priorizar la ultima clase utilitaria en conflicto.
|
|
488
|
+
*/
|
|
489
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
490
|
+
|
|
491
|
+
export { Button, type ButtonProps, type ButtonSizes, type ButtonVariants, Card, CardAction, type CardActionProps, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, Check, Checkbox, type CheckboxProps, type CheckboxSizes, type CheckboxVariants, CloseX, Input, type InputProps, type InputSizes, type InputTypes, type InputVariants, Minus, MoneyInput, type NormalizableValue, NumberInput, PasswordInput, RadioItem as Radio, RadioGroup, type RadioGroupContextValue, type RadioGroupItemClassNames, type RadioGroupItemProps, type RadioGroupProps, RadioItem, type RadioVariants, Switch, type SwitchClassNames, type SwitchProps, type SwitchVariants, type UseFormattedNumericInputParams, type UseFormattedNumericInputReturn, cn, inputTypes, useFormattedNumericInput, useRadio, useRadioGroup };
|