anima-ds-nucleus 1.0.103 → 1.0.104
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 +35 -0
- package/dist/anima-ds.cjs.js +161 -121
- package/dist/anima-ds.esm.js +9827 -9499
- package/package.json +1 -1
- package/src/components/Layout/AppliedFilters/AppliedFilters.jsx +183 -0
- package/src/components/Layout/Header/HeaderCore.jsx +181 -10
- package/src/components/Layout/Header/HeaderCore.stories.jsx +40 -130
- package/src/components/Layout/ListaPersonas/ListaPersonas.jsx +12 -0
- package/src/components/Layout/ListaPersonas/ListaPersonas.stories.jsx +47 -143
- package/src/components/Layout/Tabla/Tabla.jsx +24 -3
- package/src/components/Layout/Tabla/Tabla.stories.jsx +51 -143
- package/src/index.js +1 -0
package/README.md
CHANGED
|
@@ -86,6 +86,41 @@ También puedes usar el API más típico:
|
|
|
86
86
|
<Button variant="Primary">Enviar</Button>
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
+
### HeaderCore: resultados de búsqueda tipo persona
|
|
90
|
+
|
|
91
|
+
`HeaderCore` soporta la prop `searchResultVariant`. Por defecto usa `"default"` y mantiene compatibilidad con el renderer textual anterior. Para búsquedas de personas, usar `searchResultVariant="persona"` evita definir `renderSearchResultItem` en el proyecto consumidor.
|
|
92
|
+
|
|
93
|
+
```jsx
|
|
94
|
+
<HeaderCore
|
|
95
|
+
searchValue={query}
|
|
96
|
+
onSearch={setQuery}
|
|
97
|
+
searchResults={people}
|
|
98
|
+
isSearchResultsOpen={query.trim().length > 0}
|
|
99
|
+
searchResultVariant="persona"
|
|
100
|
+
onSearchResultClick={(person) => setQuery(person.nombre ?? person.name)}
|
|
101
|
+
/>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
La variante `persona` acepta datos con keys tolerantes: `id | personId`, `nombre | name | fullName | label`, `email`, `documento | document`, `estado | statusLabel | status` y `foto | avatar | image | userAvatar`. Si se pasa `renderSearchResultItem`, ese renderer custom sigue teniendo prioridad.
|
|
105
|
+
|
|
106
|
+
### Tabla y ListaPersonas: filtros aplicados
|
|
107
|
+
|
|
108
|
+
`Tabla` y `ListaPersonas` soportan filtros aplicados nativos con chips responsive. El consumidor solo pasa datos y callbacks; el DS resuelve estilos, scroll mobile y contador del botón `Filtros` cuando no se controla explícitamente con `activeFiltersCount`.
|
|
109
|
+
|
|
110
|
+
```jsx
|
|
111
|
+
<Tabla
|
|
112
|
+
showFiltersButton
|
|
113
|
+
appliedFilters={[
|
|
114
|
+
{ id: 'documento', label: 'Documento contiene 345' },
|
|
115
|
+
{ id: 'persona', label: 'Persona contiene Lau' },
|
|
116
|
+
]}
|
|
117
|
+
onAppliedFilterRemove={(filter) => removeFilter(filter.id)}
|
|
118
|
+
onAppliedFiltersClear={clearFilters}
|
|
119
|
+
/>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
`appliedFilters` acepta strings u objetos `{ id, label }`. Si se informa `filtersArea`, ese contenido custom tiene prioridad y reemplaza el render nativo.
|
|
123
|
+
|
|
89
124
|
### Ejemplo de uso en un proyecto demo (Button)
|
|
90
125
|
|
|
91
126
|
Supongamos un proyecto React creado con Vite o Create React App.
|