flysoft-react-ui 1.3.3 → 1.4.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 +4 -4
- package/claude/install-skill.mjs +86 -0
- package/claude/skills/flysoft-ui/SKILL.md +78 -0
- package/claude/skills/flysoft-ui/patterns.md +352 -0
- package/claude/skills/flysoft-ui/references/display.md +163 -0
- package/claude/skills/flysoft-ui/references/forms.md +203 -0
- package/claude/skills/flysoft-ui/references/hooks.md +374 -0
- package/claude/skills/flysoft-ui/references/layout.md +260 -0
- package/claude/skills/flysoft-ui/references/services.md +194 -0
- package/claude/skills/flysoft-ui/references/templates.md +155 -0
- package/claude/skills/flysoft-ui/references/theming.md +256 -0
- package/dist/components/layout/Collection.d.ts +2 -0
- package/dist/components/layout/Collection.d.ts.map +1 -1
- package/dist/contexts/AppLayoutContext.d.ts +13 -0
- package/dist/contexts/AppLayoutContext.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
<!-- Generado desde los tipos de flysoft-react-ui@1.4.1. No editar a mano. -->
|
|
2
|
+
<!-- Regenerar con: npm run docs:skill -->
|
|
3
|
+
|
|
4
|
+
# Componentes de display
|
|
5
|
+
|
|
6
|
+
Componentes de presentación de datos, estado y avatares.
|
|
7
|
+
|
|
8
|
+
## DataTable\<T\>
|
|
9
|
+
|
|
10
|
+
| Prop | Tipo | Req. | Default | Descripción |
|
|
11
|
+
|---|---|---|---|---|
|
|
12
|
+
| `columns` | `DataTableColumn<T>[]` | **sí** | — | |
|
|
13
|
+
| `fixedColumn` | `DataTableColumn<T>` | | — | |
|
|
14
|
+
| `rows` | `T[]` | **sí** | — | |
|
|
15
|
+
| `className` | `string` | | `""` | |
|
|
16
|
+
| `maxRows` | `number` | | — | |
|
|
17
|
+
| `locale` | `string` | | `"es-AR"` | |
|
|
18
|
+
| `isLoading` | `boolean` | | `false` | |
|
|
19
|
+
| `loadingRows` | `number` | | `5` | |
|
|
20
|
+
| `rowClassName` | `(row: T) => string` | | — | Función opcional para aplicar clases CSS a una fila específica basada en sus datos. |
|
|
21
|
+
| `headerClassName` | `string` | | `""` | |
|
|
22
|
+
| `footerClassName` | `string` | | `""` | |
|
|
23
|
+
| `headerCellClassName` | `string` | | `""` | |
|
|
24
|
+
| `footerCellClassName` | `string` | | `""` | |
|
|
25
|
+
| `cellClassName` | `string \| ((row: T, column: DataTableColumn<T>) => string)` | | `""` | |
|
|
26
|
+
| `compact` | `boolean` | | `false` | |
|
|
27
|
+
|
|
28
|
+
## DataField
|
|
29
|
+
|
|
30
|
+
| Prop | Tipo | Req. | Default | Descripción |
|
|
31
|
+
|---|---|---|---|---|
|
|
32
|
+
| `label` | `string` | | — | |
|
|
33
|
+
| `value` | `string \| number \| React.ReactNode` | | — | |
|
|
34
|
+
| `inline` | `boolean` | | `false` | |
|
|
35
|
+
| `align` | `"left" \| "right" \| "center"` | | `"left"` | |
|
|
36
|
+
| `title` | `string` | | — | |
|
|
37
|
+
| `link` | `string` | | — | |
|
|
38
|
+
| `className` | `string` | | `""` | |
|
|
39
|
+
| `labelClassName` | `string` | | `""` | |
|
|
40
|
+
| `size` | `"sm" \| "md"` | | `"md"` | Tamaño relativo a la densidad activa. - "md" (default): label = font-sm, value = font-base. - "sm": override local que baja un nivel — label = font-xs, value = font-sm. Útil para listas densas dentro de cards no-densas. |
|
|
41
|
+
| `gap` | `"tight" \| "sm" \| "md"` | | `"md"` | Gap entre label y value en modo stack (no inline). - "tight": pegado, 0px (label sobre value sin separación). - "sm": gap chico — usa --flysoft-density-gap-sm. - "md" (default): usa --flysoft-density-gap-sm también pero respeta densidad. |
|
|
42
|
+
| `hideColon` | `boolean` | | `false` | Si es true, oculta el ":" después del label en modo inline. Útil para campos donde el label ya es lo suficientemente claro por contexto. |
|
|
43
|
+
|
|
44
|
+
## Badge
|
|
45
|
+
|
|
46
|
+
| Prop | Tipo | Req. | Default | Descripción |
|
|
47
|
+
|---|---|---|---|---|
|
|
48
|
+
| `children` | `React.ReactNode` | **sí** | — | |
|
|
49
|
+
| `variant` | `"primary" \| "secondary" \| "success" \| "warning" \| "danger" \| "info"` | | `"primary"` | |
|
|
50
|
+
| `size` | `"sm" \| "md" \| "lg"` | | `"md"` | |
|
|
51
|
+
| `rounded` | `boolean` | | `false` | |
|
|
52
|
+
| `className` | `string` | | `""` | |
|
|
53
|
+
| `icon` | `string` | | — | |
|
|
54
|
+
| `iconPosition` | `"left" \| "right"` | | `"left"` | |
|
|
55
|
+
| `iconLabel` | `string` | | — | |
|
|
56
|
+
| `bg` | `string` | | — | |
|
|
57
|
+
| `textColor` | `string` | | — | |
|
|
58
|
+
| `onClick` | `(event: React.MouseEvent<HTMLElement>) => void` | | — | |
|
|
59
|
+
|
|
60
|
+
## Avatar
|
|
61
|
+
|
|
62
|
+
Avatar component displays a circular avatar with initials or an image
|
|
63
|
+
|
|
64
|
+
| Prop | Tipo | Req. | Default | Descripción |
|
|
65
|
+
|---|---|---|---|---|
|
|
66
|
+
| `text` | `string` | **sí** | — | Text to extract initials from The component will show the first letter of the first word and the first letter of the last word if there are multiple words |
|
|
67
|
+
| `image` | `string` | | — | Optional image URL to display instead of initials |
|
|
68
|
+
| `bgColor` | `string` | | `"gray-600"` | Optional background color (hexadecimal, rgb, or color name) Default: gray-600 (#4b5563) |
|
|
69
|
+
| `textColor` | `string` | | `"white"` | Optional text color (hexadecimal, rgb, or color name) Default: white (#ffffff) |
|
|
70
|
+
| `size` | `"sm" \| "md" \| "lg"` | | `"md"` | Optional size variant Default: md |
|
|
71
|
+
| `className` | `string` | | `""` | Optional additional CSS classes |
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
// Basic usage with text
|
|
75
|
+
<Avatar text="John Doe" />
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
```tsx
|
|
79
|
+
// With image
|
|
80
|
+
<Avatar text="John Doe" image="https://example.com/avatar.jpg" />
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
// Custom colors
|
|
85
|
+
<Avatar text="Jane Smith" bgColor="#3b82f6" textColor="#ffffff" />
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## RoadMap
|
|
89
|
+
|
|
90
|
+
RoadMap component displays a series of stages like metro stations
|
|
91
|
+
|
|
92
|
+
| Prop | Tipo | Req. | Default | Descripción |
|
|
93
|
+
|---|---|---|---|---|
|
|
94
|
+
| `stages` | `RoadMapStage[]` | **sí** | — | Array of stages to display |
|
|
95
|
+
| `className` | `string` | | `""` | Optional additional CSS classes |
|
|
96
|
+
|
|
97
|
+
```tsx
|
|
98
|
+
// Basic usage
|
|
99
|
+
<RoadMap stages={[
|
|
100
|
+
{ name: "Start", variant: "primary" },
|
|
101
|
+
{ name: "Middle", variant: "success" },
|
|
102
|
+
{ name: "End", variant: "info" }
|
|
103
|
+
]} />
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
```tsx
|
|
107
|
+
// With icons and descriptions
|
|
108
|
+
<RoadMap stages={[
|
|
109
|
+
{ name: "Planning", description: "Define requirements", icon: "fa-clipboard", variant: "primary" },
|
|
110
|
+
{ name: "Development", description: "Build the feature", icon: "fa-code", variant: "success" },
|
|
111
|
+
{ name: "Testing", description: "Test thoroughly", icon: "fa-check-circle", variant: "warning" }
|
|
112
|
+
]} />
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Loader
|
|
116
|
+
|
|
117
|
+
| Prop | Tipo | Req. | Default | Descripción |
|
|
118
|
+
|---|---|---|---|---|
|
|
119
|
+
| `isLoading` | `boolean` | | `false` | |
|
|
120
|
+
| `text` | `string` | | — | |
|
|
121
|
+
| `children` | `React.ReactNode` | | — | |
|
|
122
|
+
| `keepContentWhileLoading` | `boolean` | | — | |
|
|
123
|
+
| `contentLoadingNode` | `React.ReactNode` | | — | |
|
|
124
|
+
| `overlayClassName` | `string` | | — | |
|
|
125
|
+
|
|
126
|
+
## Skeleton
|
|
127
|
+
|
|
128
|
+
Componente Skeleton para mostrar estados de carga. Consiste en un div con una animación de pulso y un fondo grisáceo por defecto.
|
|
129
|
+
|
|
130
|
+
| Prop | Tipo | Req. | Default | Descripción |
|
|
131
|
+
|---|---|---|---|---|
|
|
132
|
+
| `className` | `string` | | — | Clases adicionales de Tailwind para personalizar el skeleton (medidas, bordes, etc.) La animación y el fondo base se mantendrán a menos que se sobreescriban explícitamente. |
|
|
133
|
+
|
|
134
|
+
## ThemeSwitcher
|
|
135
|
+
|
|
136
|
+
Sin props.
|
|
137
|
+
|
|
138
|
+
## Tipos auxiliares
|
|
139
|
+
|
|
140
|
+
### `DataTableColumn`
|
|
141
|
+
|
|
142
|
+
| Prop | Tipo | Req. | Default | Descripción |
|
|
143
|
+
|---|---|---|---|---|
|
|
144
|
+
| `align` | `"left" \| "right" \| "center"` | | — | |
|
|
145
|
+
| `width` | `string` | | — | |
|
|
146
|
+
| `header` | `string \| React.ReactNode` | | — | |
|
|
147
|
+
| `footer` | `string \| React.ReactNode` | | — | |
|
|
148
|
+
| `value` | `string \| number \| ((row: T) => string \| React.ReactNode)` | | — | |
|
|
149
|
+
| `tooltip` | `(row: T) => string \| React.ReactNode` | | — | |
|
|
150
|
+
| `type` | `"text" \| "numeric" \| "currency" \| "date"` | | — | |
|
|
151
|
+
| `actions` | `(row: T) => Array<React.ReactNode>` | | — | Acciones para cada fila. Retorna un array de ReactNode que se mostrarán en un DropdownMenu. |
|
|
152
|
+
| `headerActions` | `() => Array<React.ReactNode>` | | — | Acciones para el header de la columna. Retorna un array de ReactNode que se mostrarán en un DropdownMenu. |
|
|
153
|
+
|
|
154
|
+
### `RoadMapStage`
|
|
155
|
+
|
|
156
|
+
| Prop | Tipo | Req. | Default | Descripción |
|
|
157
|
+
|---|---|---|---|---|
|
|
158
|
+
| `name` | `string` | **sí** | — | Name of the stage |
|
|
159
|
+
| `description` | `string` | | — | Optional description shown below the name |
|
|
160
|
+
| `icon` | `string` | | — | Optional FontAwesome 5 icon class (e.g., "fa-check", "fa-user") |
|
|
161
|
+
| `disabled` | `boolean` | | — | Whether the stage is disabled (shown with 0.5 opacity) |
|
|
162
|
+
| `variant` | `"primary" \| "secondary" \| "success" \| "warning" \| "danger" \| "info"` | | — | Color variant for the stage circle |
|
|
163
|
+
| `bg` | `string` | | — | Custom background color (hexadecimal, rgb, or color name) Takes precedence over variant if provided |
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
<!-- Generado desde los tipos de flysoft-react-ui@1.4.1. No editar a mano. -->
|
|
2
|
+
<!-- Regenerar con: npm run docs:skill -->
|
|
3
|
+
|
|
4
|
+
# Componentes de formulario
|
|
5
|
+
|
|
6
|
+
Controles de entrada. Todos se importan desde `'flysoft-react-ui'`.
|
|
7
|
+
|
|
8
|
+
Los que declaran `extends` heredan además todos los atributos nativos del elemento HTML correspondiente (`onFocus`, `placeholder`, `name`, `required`, etc.); acá sólo se listan las props propias de la librería.
|
|
9
|
+
|
|
10
|
+
## Button
|
|
11
|
+
|
|
12
|
+
Extiende `React.ButtonHTMLAttributes<HTMLButtonElement>` — hereda además sus atributos nativos.
|
|
13
|
+
|
|
14
|
+
| Prop | Tipo | Req. | Default | Descripción |
|
|
15
|
+
|---|---|---|---|---|
|
|
16
|
+
| `variant` | `"primary" \| "outline" \| "ghost"` | | `"primary"` | |
|
|
17
|
+
| `size` | `"sm" \| "md" \| "lg"` | | `"md"` | |
|
|
18
|
+
| `color` | `"primary" \| "secondary" \| "success" \| "warning" \| "danger" \| "info"` | | `"primary"` | |
|
|
19
|
+
| `bg` | `string` | | — | |
|
|
20
|
+
| `textColor` | `string` | | — | |
|
|
21
|
+
| `icon` | `string` | | — | |
|
|
22
|
+
| `iconPosition` | `"left" \| "right"` | | `"left"` | |
|
|
23
|
+
| `loading` | `boolean` | | `false` | |
|
|
24
|
+
| `children` | `React.ReactNode` | | — | |
|
|
25
|
+
|
|
26
|
+
## LinkButton
|
|
27
|
+
|
|
28
|
+
Extiende `Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "href">` — hereda además sus atributos nativos.
|
|
29
|
+
|
|
30
|
+
| Prop | Tipo | Req. | Default | Descripción |
|
|
31
|
+
|---|---|---|---|---|
|
|
32
|
+
| `to` | `string` | **sí** | — | |
|
|
33
|
+
| `target` | `string` | | — | |
|
|
34
|
+
| `variant` | `"primary" \| "outline" \| "ghost"` | | `"primary"` | |
|
|
35
|
+
| `size` | `"sm" \| "md" \| "lg"` | | `"md"` | |
|
|
36
|
+
| `color` | `"primary" \| "secondary" \| "success" \| "warning" \| "danger" \| "info"` | | `"primary"` | |
|
|
37
|
+
| `bg` | `string` | | — | |
|
|
38
|
+
| `textColor` | `string` | | — | |
|
|
39
|
+
| `icon` | `string` | | — | |
|
|
40
|
+
| `iconPosition` | `"left" \| "right"` | | `"left"` | |
|
|
41
|
+
| `children` | `React.ReactNode` | | — | |
|
|
42
|
+
|
|
43
|
+
## Input
|
|
44
|
+
|
|
45
|
+
Extiende `Omit< React.InputHTMLAttributes<HTMLInputElement>, "size" >` — hereda además sus atributos nativos.
|
|
46
|
+
|
|
47
|
+
| Prop | Tipo | Req. | Default | Descripción |
|
|
48
|
+
|---|---|---|---|---|
|
|
49
|
+
| `label` | `string` | | — | |
|
|
50
|
+
| `error` | `string` | | — | |
|
|
51
|
+
| `icon` | `string` | | — | |
|
|
52
|
+
| `iconPosition` | `"left" \| "right"` | | `"left"` | |
|
|
53
|
+
| `size` | `"sm" \| "md" \| "lg"` | | `"md"` | |
|
|
54
|
+
| `children` | `React.ReactNode` | | — | |
|
|
55
|
+
| `onIconClick` | `(event: React.MouseEvent<HTMLElement>) => void` | | — | Callback cuando se hace click en el ícono. Si está definido, el ícono será clickeable. |
|
|
56
|
+
| `readOnly` | `boolean` | | `false` | Si es true, el input será de solo lectura. No se podrá modificar pero no se verá como disabled. Por defecto es false. |
|
|
57
|
+
|
|
58
|
+
## AutocompleteInput\<T, K\>
|
|
59
|
+
|
|
60
|
+
Extiende `Omit<InputProps, "onChange" \| "value" \| "ref">` — hereda además sus atributos nativos.
|
|
61
|
+
|
|
62
|
+
| Prop | Tipo | Req. | Default | Descripción |
|
|
63
|
+
|---|---|---|---|---|
|
|
64
|
+
| `options` | `T[]` | **sí** | — | |
|
|
65
|
+
| `value` | `string \| string[]` | | — | |
|
|
66
|
+
| `onChange` | `\| React.ChangeEventHandler<HTMLInputElement> \| ((value: string \| string[]) => void)` | | — | Valor de texto del input (controlado) Puede ser un ChangeEventHandler (de register) o una función que recibe string (API personalizada) |
|
|
67
|
+
| `onSelectOption` | `(option: T, value: K) => void` | | — | Callback al seleccionar una opción. Devuelve el item completo (T) y el valor mapeado (K) |
|
|
68
|
+
| `noResultsText` | `string` | | `"Sin resultados"` | |
|
|
69
|
+
| `getOptionLabel` | `(item: T) => string` | | — | Obtiene el label que se muestra para cada opción. Por defecto usa la propiedad "label". |
|
|
70
|
+
| `getOptionValue` | `(item: T) => K` | | — | Obtiene el valor que se devuelve al seleccionar una opción. Por defecto usa la propiedad "value". |
|
|
71
|
+
| `getOptionDescription` | `(item: T) => string \| number \| undefined` | | — | Obtiene la descripción opcional para cada opción. Por defecto usa la propiedad "description". |
|
|
72
|
+
| `renderOption` | `(item: T) => React.ReactNode` | | — | Renderizado personalizado de cada opción. Si se define, se ignora el render por defecto. |
|
|
73
|
+
| `readOnly` | `boolean` | | `false` | Si es true, el input será de solo lectura. No se podrá modificar ni desplegar las opciones. Por defecto es false. |
|
|
74
|
+
| `multiple` | `boolean` | | `false` | Si es true, permite seleccionar múltiples opciones usando Checkboxes. El valor será un array con los valores (K) de las opciones seleccionadas. |
|
|
75
|
+
|
|
76
|
+
## SearchSelectInput\<T, K\>
|
|
77
|
+
|
|
78
|
+
Extiende `Omit<InputProps, "onChange" \| "value" \| "ref">` — hereda además sus atributos nativos.
|
|
79
|
+
|
|
80
|
+
| Prop | Tipo | Req. | Default | Descripción |
|
|
81
|
+
|---|---|---|---|---|
|
|
82
|
+
| `value` | `T \| K \| string` | | — | |
|
|
83
|
+
| `onChange` | `\| ((value: T \| K) => void) \| React.ChangeEventHandler<HTMLInputElement>` | | — | Callback cuando cambia el valor del input. Recibe la opción completa (T) si no hay getOptionValue, o el valor extraído (K) si hay getOptionValue. También es compatible con react-hook-form: acepta el onChange estándar de HTML. |
|
|
84
|
+
| `onSearchPromiseFn` | `(text: string) => Promise<Array<T> \| PaginationInterface<T>>` | **sí** | — | Función que realiza la búsqueda y devuelve un Promise con los resultados |
|
|
85
|
+
| `onSingleSearchPromiseFn` | `(value: K) => Promise<T \| undefined>` | **sí** | — | Función que busca un elemento individual usando su valor (K). Se usa cuando hay un valor por defecto que no está presente en las opciones cargadas. Recibe el valor (K) y devuelve una Promise con el objeto completo (T) o undefined si no se encuentra. |
|
|
86
|
+
| `onSelectOption` | `(option: T, value: K) => void` | | — | Callback al seleccionar una opción. Devuelve el item completo (T) y el valor mapeado (K) |
|
|
87
|
+
| `dialogTitle` | `string` | | `"Seleccione una opción"` | Título del dialog de selección. Por defecto "Seleccione una opción" |
|
|
88
|
+
| `icon` | `string` | | `"fa-search"` | Posición del botón de búsqueda. Por defecto "right" |
|
|
89
|
+
| `iconPosition` | `"left" \| "right"` | | `"right"` | |
|
|
90
|
+
| `noResultsText` | `string` | | `"Sin resultados"` | Texto a mostrar cuando no hay resultados |
|
|
91
|
+
| `getOptionLabel` | `(item: T) => string` | | — | Obtiene el label que se muestra para cada opción. Por defecto usa la propiedad "label". |
|
|
92
|
+
| `getOptionValue` | `(item: T) => K` | | — | Obtiene el valor que se devuelve al seleccionar una opción. Por defecto usa la propiedad "value". |
|
|
93
|
+
| `getOptionDescription` | `(item: T) => string \| number \| undefined` | | — | Obtiene la descripción opcional para cada opción. Por defecto usa la propiedad "description". |
|
|
94
|
+
| `renderOption` | `(item: T) => React.ReactNode` | | — | Renderizado personalizado de cada opción. Si se define, se ignora el render por defecto. |
|
|
95
|
+
| `readOnly` | `boolean` | | `false` | Si es true, el input será de solo lectura. No se podrá modificar ni abrir el diálogo de selección. Por defecto es false. |
|
|
96
|
+
|
|
97
|
+
## DateInput
|
|
98
|
+
|
|
99
|
+
Extiende `Omit<InputProps, "type" \| "value" \| "onChange" \| "ref">` — hereda además sus atributos nativos.
|
|
100
|
+
|
|
101
|
+
| Prop | Tipo | Req. | Default | Descripción |
|
|
102
|
+
|---|---|---|---|---|
|
|
103
|
+
| `value` | `Dayjs \| null \| string` | | — | Valor de la fecha. En modo register con FormProvider: Dayjs \| null (se guarda como Dayjs en el formulario) En modo register sin FormProvider: string ISO (se guarda como ISO string, se puede parsear a Dayjs) En modo Controller: Dayjs \| null |
|
|
104
|
+
| `onChange` | `\| ((date: Dayjs \| null) => void) \| React.ChangeEventHandler<HTMLInputElement>` | | — | Callback cuando cambia la fecha. En modo register: ChangeEventHandler (de register) En modo Controller: (date: Dayjs \| null) => void NOTA: Para usar Dayjs directamente con register, el formulario debe estar envuelto en FormProvider. Sin FormProvider, el valor se guarda como ISO string y se puede parsear de vuelta a Dayjs usando normalizeToDayjs. |
|
|
105
|
+
| `format` | `"dd/mm/yyyy" \| "mm/dd/yyyy" (DateInputFormat)` | | `"dd/mm/yyyy"` | |
|
|
106
|
+
| `datePickerProps` | `Omit<DatePickerProps, "value" \| "onChange">` | | — | |
|
|
107
|
+
| `readOnly` | `boolean` | | `false` | Si es true, el input será de solo lectura. No se podrá modificar ni desplegar el DatePicker. Por defecto es false. |
|
|
108
|
+
|
|
109
|
+
## DatePicker
|
|
110
|
+
|
|
111
|
+
| Prop | Tipo | Req. | Default | Descripción |
|
|
112
|
+
|---|---|---|---|---|
|
|
113
|
+
| `value` | `Dayjs \| null` | | — | |
|
|
114
|
+
| `onChange` | `(date: Dayjs) => void` | | — | |
|
|
115
|
+
| `initialViewDate` | `Dayjs` | | — | |
|
|
116
|
+
| `startWeekOn` | `"monday" \| "sunday"` | | `"sunday"` | |
|
|
117
|
+
| `className` | `string` | | `""` | |
|
|
118
|
+
|
|
119
|
+
## Checkbox
|
|
120
|
+
|
|
121
|
+
Extiende `Omit< React.InputHTMLAttributes<HTMLInputElement>, "type" \| "size" >` — hereda además sus atributos nativos.
|
|
122
|
+
|
|
123
|
+
| Prop | Tipo | Req. | Default | Descripción |
|
|
124
|
+
|---|---|---|---|---|
|
|
125
|
+
| `label` | `string` | | — | |
|
|
126
|
+
| `labelPosition` | `"left" \| "right"` | | `"right"` | |
|
|
127
|
+
| `error` | `string` | | — | |
|
|
128
|
+
| `size` | `"sm" \| "md" \| "lg"` | | `"md"` | |
|
|
129
|
+
| `readOnly` | `boolean` | | `false` | Si es true, el checkbox será de solo lectura. No se podrá modificar pero se verá igual visualmente. Por defecto es false. |
|
|
130
|
+
|
|
131
|
+
## RadioButtonGroup
|
|
132
|
+
|
|
133
|
+
Extiende `Omit<React.HTMLAttributes<HTMLDivElement>, "onChange" \| "children">` — hereda además sus atributos nativos.
|
|
134
|
+
|
|
135
|
+
| Prop | Tipo | Req. | Default | Descripción |
|
|
136
|
+
|---|---|---|---|---|
|
|
137
|
+
| `options` | `RadioOption[]` | **sí** | — | Array de opciones para renderizar radios automáticamente |
|
|
138
|
+
| `value` | `string \| number` | | — | Valor seleccionado (controlado) |
|
|
139
|
+
| `onChange` | `\| ((value: string \| number) => void) \| React.ChangeEventHandler<HTMLInputElement>` | | — | Callback cuando cambia la selección Puede recibir un valor directo o un evento (para compatibilidad con react-hook-form) |
|
|
140
|
+
| `labelPosition` | `"left" \| "right"` | | `"right"` | Posición del label para todas las opciones |
|
|
141
|
+
| `size` | `"sm" \| "md" \| "lg"` | | `"md"` | Tamaño de los radio buttons |
|
|
142
|
+
| `error` | `string` | | — | Mensaje de error a mostrar |
|
|
143
|
+
| `direction` | `"vertical" \| "horizontal"` | | `"vertical"` | Dirección del layout: vertical (columna) o horizontal (fila) |
|
|
144
|
+
| `gap` | `"sm" \| "md" \| "lg"` | | `"md"` | Espaciado entre opciones |
|
|
145
|
+
| `name` | `string` | | — | Nombre del campo (para react-hook-form) |
|
|
146
|
+
| `disabled` | `boolean` | | — | Estado deshabilitado |
|
|
147
|
+
| `onBlur` | `(() => void) \| React.FocusEventHandler<HTMLInputElement>` | | — | Callback cuando pierde el foco Puede recibir un evento (para compatibilidad con react-hook-form) o ser una función sin parámetros |
|
|
148
|
+
| `readOnly` | `boolean` | | `false` | Si es true, el radio group será de solo lectura. Las opciones no seleccionadas se verán deshabilitadas y la seleccionada se verá igual, pero no se podrá cambiar el valor. Por defecto es false. |
|
|
149
|
+
|
|
150
|
+
## CurrencyInput
|
|
151
|
+
|
|
152
|
+
Componente de entrada para valores monetarios. Muestra el valor formateado con separadores de miles (puntos) y decimales (comas). Al recibir el foco, quita los puntos para facilitar la edición.
|
|
153
|
+
|
|
154
|
+
Extiende `Omit< InputProps, "value" \| "onChange" \| "type" >` — hereda además sus atributos nativos.
|
|
155
|
+
|
|
156
|
+
| Prop | Tipo | Req. | Default | Descripción |
|
|
157
|
+
|---|---|---|---|---|
|
|
158
|
+
| `value` | `number \| null` | | — | Valor numérico del input. |
|
|
159
|
+
| `onChange` | `(value: any) => void` | | — | Callback que se ejecuta al perder el foco, devolviendo el valor numérico actualizado. Si se usa con react-hook-form (register), este callback será el de register. |
|
|
160
|
+
|
|
161
|
+
## Pagination
|
|
162
|
+
|
|
163
|
+
| Prop | Tipo | Req. | Default | Descripción |
|
|
164
|
+
|---|---|---|---|---|
|
|
165
|
+
| `fieldName` | `string` | | `"pagina"` | |
|
|
166
|
+
| `page` | `number` | | `1` | |
|
|
167
|
+
| `pages` | `number` | | `1` | |
|
|
168
|
+
| `total` | `number` | | `0` | |
|
|
169
|
+
| `isLoading` | `boolean` | | `false` | |
|
|
170
|
+
|
|
171
|
+
## Tipos auxiliares
|
|
172
|
+
|
|
173
|
+
### `AutocompleteOption`
|
|
174
|
+
|
|
175
|
+
| Prop | Tipo | Req. | Default | Descripción |
|
|
176
|
+
|---|---|---|---|---|
|
|
177
|
+
| `label` | `string` | **sí** | — | |
|
|
178
|
+
| `value` | `string` | **sí** | — | |
|
|
179
|
+
| `description` | `string \| number` | | — | |
|
|
180
|
+
| `icon` | `string` | | — | |
|
|
181
|
+
|
|
182
|
+
### `DateInputFormat`
|
|
183
|
+
|
|
184
|
+
```ts
|
|
185
|
+
type DateInputFormat = "dd/mm/yyyy" | "mm/dd/yyyy"
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### `RadioOption`
|
|
189
|
+
|
|
190
|
+
| Prop | Tipo | Req. | Default | Descripción |
|
|
191
|
+
|---|---|---|---|---|
|
|
192
|
+
| `label` | `string` | **sí** | — | |
|
|
193
|
+
| `value` | `string \| number` | **sí** | — | |
|
|
194
|
+
| `disabled` | `boolean` | | — | |
|
|
195
|
+
|
|
196
|
+
### `SearchSelectOption`
|
|
197
|
+
|
|
198
|
+
| Prop | Tipo | Req. | Default | Descripción |
|
|
199
|
+
|---|---|---|---|---|
|
|
200
|
+
| `label` | `string` | **sí** | — | |
|
|
201
|
+
| `value` | `string` | | — | |
|
|
202
|
+
| `description` | `string \| number` | | — | |
|
|
203
|
+
| `icon` | `string` | | — | |
|