@jonapin006/tiger 1.0.45 → 1.0.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -53,193 +53,862 @@ ReactDOM.createRoot(document.getElementById('root')!).render(
53
53
 
54
54
  ---
55
55
 
56
- ## 🏗️ Guía de Componentes Clave
56
+ ## 🌓 Dark Mode
57
57
 
58
- ### 🌓 Dark Mode y Persistencia
59
- Tiger incluye persistencia nativa en `localStorage`. Una vez que el usuario activa el modo oscuro, se mantendrá en futuras sesiones sin parpadeos.
58
+ Tiger incluye persistencia nativa en `localStorage`. El modo se mantiene entre sesiones sin parpadeos.
60
59
 
61
60
  ```tsx
62
61
  import { useTheme } from '@jonapin006/tiger';
63
62
 
64
- const ThemeSwitcher = () => {
65
- const { mode, toggleMode } = useTheme();
66
- return (
67
- <button onClick={toggleMode}>
68
- Activo: {mode} (Click para cambiar)
69
- </button>
70
- );
71
- };
63
+ function ThemeSwitcher() {
64
+ const { mode, toggleMode } = useTheme();
65
+ return <button onClick={toggleMode}>Modo actual: {mode}</button>;
66
+ }
72
67
  ```
73
68
 
74
- ### 📂 Sidebar Multinivel (Jerarquía 2 Nivel)
75
- El `TigerSidebar` soporta navegación recursiva. Si un ítem tiene hijos (`children`), se renderizará automáticamente como un grupo desplegable (acordeón).
69
+ ---
70
+
71
+ ## 📦 Componentes
72
+
73
+ ### TigerTypography
74
+
75
+ Componente base para texto. Controla tamaño, peso, y decoración.
76
76
 
77
77
  ```tsx
78
- import { TigerSidebar } from '@jonapin006/tiger';
79
- import { Layout, Star, CreditCard } from 'lucide-react';
80
-
81
- const menuItems = [
82
- {
83
- id: 'group1',
84
- label: 'Gestión',
85
- icon: Layout,
86
- children: [
87
- { id: 'sub1', label: 'Campañas', icon: Star },
88
- { id: 'sub2', label: 'Tarjetas', icon: CreditCard },
89
- ]
90
- },
91
- { id: 'direct1', label: 'Clientes', icon: Users }
92
- ];
78
+ import { TigerTypography, TypographySize } from '@jonapin006/tiger';
79
+
80
+ // Tamaños
81
+ <TigerTypography typographySize={TypographySize.Xsmall}>Extra pequeño</TigerTypography>
82
+ <TigerTypography typographySize={TypographySize.Small}>Pequeño</TigerTypography>
83
+ <TigerTypography typographySize={TypographySize.Medium}>Medio</TigerTypography>
84
+ <TigerTypography typographySize={TypographySize.Large}>Grande</TigerTypography>
85
+ <TigerTypography typographySize={TypographySize.Xlarge}>Extra grande</TigerTypography>
86
+
87
+ // Elemento HTML
88
+ <TigerTypography variant="h1" typographySize={TypographySize.Xlarge}>Título</TigerTypography>
89
+ <TigerTypography variant="span" typographySize={TypographySize.Small}>Inline</TigerTypography>
90
+
91
+ // Peso tipográfico
92
+ <TigerTypography weight="regular">Regular</TigerTypography>
93
+ <TigerTypography weight="semibold">Semibold</TigerTypography>
94
+ <TigerTypography weight="bold">Bold</TigerTypography>
95
+
96
+ // Decoración
97
+ <TigerTypography italic>Cursiva</TigerTypography>
98
+ <TigerTypography underline>Subrayado</TigerTypography>
99
+ <TigerTypography strikethrough>Tachado</TigerTypography>
100
+
101
+ // Combinaciones
102
+ <TigerTypography typographySize={TypographySize.Large} weight="semibold" italic underline>
103
+ Texto compuesto
104
+ </TigerTypography>
105
+ ```
106
+
107
+ | Prop | Tipo | Default | Descripción |
108
+ |------|------|---------|-------------|
109
+ | `typographySize` | `TypographySize` | `Medium` | Tamaño del texto |
110
+ | `variant` | `'h1' \| 'h2' \| 'h3' \| 'p' \| 'span'` | `'p'` | Elemento HTML |
111
+ | `weight` | `'regular' \| 'semibold' \| 'bold'` | — | Peso tipográfico |
112
+ | `bold` | `boolean` | `false` | Shorthand de `weight="bold"` |
113
+ | `italic` | `boolean` | `false` | Cursiva |
114
+ | `underline` | `boolean` | `false` | Subrayado |
115
+ | `strikethrough` | `boolean` | `false` | Tachado |
116
+ | `className` | `string` | — | Clases CSS adicionales |
117
+ | `id` | `string` | — | Atributo id |
118
+
119
+ ---
120
+
121
+ ### TigerButton
122
+
123
+ Botón principal con variantes, tamaños e íconos.
124
+
125
+ ```tsx
126
+ import { TigerButton, TigerButtonVariant, ComponentSize } from '@jonapin006/tiger';
127
+ import { Download, ArrowRight } from 'lucide-react';
128
+
129
+ // Variantes
130
+ <TigerButton variant={TigerButtonVariant.Primary}>Primario</TigerButton>
131
+ <TigerButton variant={TigerButtonVariant.Secondary}>Secundario</TigerButton>
132
+ <TigerButton variant={TigerButtonVariant.Ghost}>Ghost</TigerButton>
133
+
134
+ // Tamaños
135
+ <TigerButton size={ComponentSize.Small}>Pequeño</TigerButton>
136
+ <TigerButton size={ComponentSize.Medium}>Medio</TigerButton>
137
+ <TigerButton size={ComponentSize.Large}>Grande</TigerButton>
138
+ <TigerButton size={ComponentSize.Xlarge}>Extra grande</TigerButton>
139
+
140
+ // Con íconos
141
+ <TigerButton iconLeft={Download}>Descargar</TigerButton>
142
+ <TigerButton iconRight={ArrowRight}>Continuar</TigerButton>
143
+
144
+ // Ancho completo
145
+ <TigerButton fullWidth>Acción principal</TigerButton>
146
+
147
+ // Deshabilitado
148
+ <TigerButton disabled>No disponible</TigerButton>
149
+ ```
150
+
151
+ | Prop | Tipo | Default | Descripción |
152
+ |------|------|---------|-------------|
153
+ | `variant` | `TigerButtonVariant` | `Primary` | Estilo visual |
154
+ | `size` | `ComponentSize` | `Medium` | Tamaño (excluye `xsmall`) |
155
+ | `iconLeft` | `React.ElementType` | — | Ícono izquierdo |
156
+ | `iconRight` | `React.ElementType` | — | Ícono derecho |
157
+ | `fullWidth` | `boolean` | `false` | Ocupa el ancho del contenedor |
158
+ | `typographySize` | `TypographySize` | — | Sobreescribe tamaño tipográfico |
159
+
160
+ Acepta todos los atributos nativos de `<button>`.
161
+
162
+ ---
163
+
164
+ ### TigerIconButton
165
+
166
+ Botón exclusivamente de ícono.
167
+
168
+ ```tsx
169
+ import { TigerIconButton, TigerButtonVariant, ComponentSize } from '@jonapin006/tiger';
170
+ import { Settings } from 'lucide-react';
171
+
172
+ <TigerIconButton
173
+ icon={<Settings />}
174
+ variant={TigerButtonVariant.Ghost}
175
+ size={ComponentSize.Medium}
176
+ aria-label="Configuración"
177
+ onClick={() => {}}
178
+ />
179
+ ```
180
+
181
+ | Prop | Tipo | Default | Descripción |
182
+ |------|------|---------|-------------|
183
+ | `icon` | `ReactNode` | — | Ícono a renderizar |
184
+ | `variant` | `TigerButtonVariant` | `Primary` | Estilo visual |
185
+ | `size` | `ComponentSize` | `Medium` | Tamaño (excluye `xsmall`) |
186
+ | `disabled` | `boolean` | `false` | Deshabilita el botón |
187
+ | `aria-label` | `string` | — | Etiqueta accesible (recomendado) |
188
+
189
+ ---
190
+
191
+ ### TigerBadge
192
+
193
+ Etiqueta de estado o categoría.
194
+
195
+ ```tsx
196
+ import { TigerBadge, TigerBadgeVariant, ComponentSize } from '@jonapin006/tiger';
197
+
198
+ <TigerBadge variant={TigerBadgeVariant.Primary}>Nuevo</TigerBadge>
199
+ <TigerBadge variant={TigerBadgeVariant.Success}>Activo</TigerBadge>
200
+ <TigerBadge variant={TigerBadgeVariant.Warning}>Pendiente</TigerBadge>
201
+ <TigerBadge variant={TigerBadgeVariant.Error}>Error</TigerBadge>
202
+ <TigerBadge variant={TigerBadgeVariant.Accent} size={ComponentSize.Medium}>
203
+ Destacado
204
+ </TigerBadge>
205
+ ```
206
+
207
+ | Prop | Tipo | Default | Descripción |
208
+ |------|------|---------|-------------|
209
+ | `variant` | `TigerBadgeVariant` | `Primary` | Color del badge |
210
+ | `size` | `ComponentSize.Small \| .Medium` | `Small` | Tamaño |
211
+ | `typographySize` | `TypographySize` | — | Sobreescribe tamaño tipográfico |
212
+
213
+ ---
214
+
215
+ ### TigerCard
216
+
217
+ Contenedor tipo tarjeta con padding y bordes redondeados según el tema.
218
+
219
+ ```tsx
220
+ import { TigerCard, ComponentSize } from '@jonapin006/tiger';
221
+
222
+ // Estática
223
+ <TigerCard size={ComponentSize.Medium}>
224
+ <p>Contenido</p>
225
+ </TigerCard>
226
+
227
+ // Clickeable (aplica hover y cursor automáticamente)
228
+ <TigerCard size={ComponentSize.Large} onClick={() => navigate('/detail')}>
229
+ <h2>Título</h2>
230
+ <p>Descripción</p>
231
+ </TigerCard>
232
+ ```
233
+
234
+ | Prop | Tipo | Default | Descripción |
235
+ |------|------|---------|-------------|
236
+ | `size` | `ComponentSize` | `Medium` | Padding y borde redondeado (excluye `xsmall`) |
237
+ | `onClick` | `() => void` | — | Si se provee, habilita estilos interactivos |
238
+ | `typographySize` | `TypographySize` | — | Sobreescribe tamaño tipográfico |
239
+
240
+ ---
241
+
242
+ ### TigerStack
243
+
244
+ Layout flexbox para organizar elementos con gap y alineación uniformes.
245
+
246
+ ```tsx
247
+ import { TigerStack, ComponentSize } from '@jonapin006/tiger';
248
+
249
+ // Vertical (default)
250
+ <TigerStack gap={ComponentSize.Medium}>
251
+ <div>Elemento 1</div>
252
+ <div>Elemento 2</div>
253
+ </TigerStack>
254
+
255
+ // Horizontal centrado
256
+ <TigerStack direction="horizontal" gap={ComponentSize.Small} align="center">
257
+ <TigerBadge>Estado</TigerBadge>
258
+ <TigerTypography>Texto</TigerTypography>
259
+ </TigerStack>
260
+ ```
93
261
 
94
- <TigerSidebar
95
- items={menuItems}
96
- activeId={activeId}
97
- onItemSelect={setActiveId}
262
+ | Prop | Tipo | Default | Descripción |
263
+ |------|------|---------|-------------|
264
+ | `direction` | `'vertical' \| 'horizontal'` | `'vertical'` | Dirección del flex |
265
+ | `gap` | `ComponentSize` | `Medium` | Espacio entre hijos |
266
+ | `align` | `'start' \| 'center' \| 'end'` | `'start'` | Alineación |
267
+
268
+ ---
269
+
270
+ ### TigerInput
271
+
272
+ Campo de texto nativo con variantes de tamaño.
273
+
274
+ ```tsx
275
+ import { TigerInput, ComponentSize } from '@jonapin006/tiger';
276
+
277
+ <TigerInput placeholder="Buscar..." size={ComponentSize.Medium} />
278
+
279
+ <TigerInput
280
+ type="email"
281
+ placeholder="correo@ejemplo.com"
282
+ size={ComponentSize.Large}
283
+ onChange={(e) => setValue(e.target.value)}
98
284
  />
285
+
286
+ // Con ref
287
+ const ref = useRef<HTMLInputElement>(null);
288
+ <TigerInput ref={ref} placeholder="Focus me" />
99
289
  ```
100
290
 
101
- ### 📏 TopBar y Tipografía
102
- La `TigerTopBar` está diseñada para ser 100% agnóstica a estilos de layout. Úsala junto a `TigerTypography` para mantener la excelencia visual.
291
+ | Prop | Tipo | Default | Descripción |
292
+ |------|------|---------|-------------|
293
+ | `size` | `ComponentSize` | `Medium` | Tamaño (excluye `xsmall`) |
294
+
295
+ Acepta todos los atributos nativos de `<input>` (excepto `size`, `className` y `style`).
296
+
297
+ ---
298
+
299
+ ### TigerCheckbox
300
+
301
+ Casilla de verificación accesible.
103
302
 
104
303
  ```tsx
105
- <TigerTopBar
106
- title="Dashboard"
107
- description="Bienvenido al panel centralizado"
108
- actions={<MyActionsComponent />}
304
+ import { TigerCheckbox, ComponentSize } from '@jonapin006/tiger';
305
+
306
+ const [checked, setChecked] = useState(false);
307
+
308
+ <TigerCheckbox checked={checked} onChange={setChecked} size={ComponentSize.Medium} />
309
+
310
+ <TigerCheckbox checked={true} onChange={() => {}} disabled />
311
+ ```
312
+
313
+ | Prop | Tipo | Default | Descripción |
314
+ |------|------|---------|-------------|
315
+ | `checked` | `boolean` | `false` | Estado |
316
+ | `onChange` | `(checked: boolean) => void` | — | Callback |
317
+ | `size` | `ComponentSize.Small \| .Medium \| .Large` | `Medium` | Tamaño |
318
+ | `disabled` | `boolean` | `false` | Deshabilita |
319
+
320
+ ---
321
+
322
+ ### TigerSwitch
323
+
324
+ Toggle on/off con etiqueta y descripción opcionales.
325
+
326
+ ```tsx
327
+ import { TigerSwitch, TigerSwitchColor, ComponentSize } from '@jonapin006/tiger';
328
+
329
+ const [enabled, setEnabled] = useState(false);
330
+
331
+ <TigerSwitch
332
+ checked={enabled}
333
+ onChange={setEnabled}
334
+ label="Notificaciones"
335
+ description="Recibe alertas por email"
336
+ />
337
+
338
+ <TigerSwitch
339
+ checked={enabled}
340
+ onChange={setEnabled}
341
+ color={TigerSwitchColor.Primary}
342
+ size={ComponentSize.Large}
109
343
  />
344
+ ```
345
+
346
+ | Prop | Tipo | Default | Descripción |
347
+ |------|------|---------|-------------|
348
+ | `checked` | `boolean` | — | Estado (requerido) |
349
+ | `onChange` | `(checked: boolean) => void` | — | Callback (requerido) |
350
+ | `size` | `ComponentSize.Small \| .Medium \| .Large` | `Medium` | Tamaño |
351
+ | `color` | `TigerSwitchColor` | `Primary` | Color |
352
+ | `label` | `string` | — | Etiqueta visible |
353
+ | `description` | `string` | — | Descripción secundaria |
354
+ | `disabled` | `boolean` | `false` | Deshabilita |
110
355
 
111
356
  ---
112
357
 
113
- ## 🎨 Catálogo de Componentes (Ejemplos)
358
+ ### TigerTabs
114
359
 
115
- Tiger está diseñado para ser intuitivo. Aquí tienes cómo usar las piezas maestras de la librería.
360
+ Interfaz de pestañas con tres variantes visuales.
116
361
 
117
- ### 🏛️ Dashboard Layout (Orquestación)
118
- El `TigerDashboardLayout` es el contenedor estructural. Gestiona el scroll independiente del Sidebar y el Contenido, y aplica las sombras direccionales automáticamente.
362
+ ```tsx
363
+ import { TigerTabs, TigerTabsVariant, ComponentSize } from '@jonapin006/tiger';
364
+
365
+ const tabs = [
366
+ { id: 'general', label: 'General', content: <div>Contenido general</div> },
367
+ { id: 'security', label: 'Seguridad', content: <div>Seguridad</div> },
368
+ { id: 'billing', label: 'Facturación', content: <div>Pago</div>, disabled: true },
369
+ ];
370
+
371
+ // Segmento
372
+ <TigerTabs items={tabs} variant={TigerTabsVariant.Segment} />
373
+
374
+ // Subrayado — ancho completo
375
+ <TigerTabs items={tabs} variant={TigerTabsVariant.Underline} fullWidth />
376
+
377
+ // Pill — controlado externamente
378
+ <TigerTabs
379
+ items={tabs}
380
+ variant={TigerTabsVariant.Pill}
381
+ activeId={activeTab}
382
+ onChange={setActiveTab}
383
+ />
384
+ ```
385
+
386
+ | Prop | Tipo | Default | Descripción |
387
+ |------|------|---------|-------------|
388
+ | `items` | `TigerTabItem[]` | — | Pestañas (requerido) |
389
+ | `variant` | `TigerTabsVariant` | `Segment` | Estilo visual |
390
+ | `size` | `ComponentSize` | `Medium` | Tamaño |
391
+ | `activeId` | `string` | — | Control externo |
392
+ | `defaultActiveId` | `string` | — | Tab activo inicial |
393
+ | `onChange` | `(id: string) => void` | — | Callback |
394
+ | `fullWidth` | `boolean` | `false` | Ocupa el ancho completo |
395
+
396
+ **TigerTabItem:** `id`, `label`, `content`, `icon?`, `disabled?`
397
+
398
+ ---
399
+
400
+ ### TigerAccordion
401
+
402
+ Secciones expandibles.
119
403
 
120
404
  ```tsx
121
- import { TigerDashboardLayout, TigerSidebar, TigerTopBar } from '@jonapin006/tiger';
405
+ import { TigerAccordion } from '@jonapin006/tiger';
406
+
407
+ const items = [
408
+ { id: 'q1', title: '¿Cómo funciona?', content: <p>El sistema procesa automáticamente.</p> },
409
+ { id: 'q2', title: '¿Cuánto cuesta?', content: <p>El plan básico es gratuito.</p> },
410
+ ];
122
411
 
123
- // ... tu lógica de estado para el sidebar
412
+ // Una sección a la vez (default)
413
+ <TigerAccordion items={items} defaultExpandedId="q1" />
124
414
 
125
- <TigerDashboardLayout
126
- sidebar={<TigerSidebar items={menuItems} activeId={active} />}
127
- topbar={
128
- <TigerTopBar
129
- title="Dashboard"
130
- description="Estado de tus operaciones"
131
- actions={<UserMenu />}
132
- />
415
+ // Múltiples abiertas simultáneamente
416
+ <TigerAccordion items={items} allowMultiple />
417
+ ```
418
+
419
+ | Prop | Tipo | Default | Descripción |
420
+ |------|------|---------|-------------|
421
+ | `items` | `TigerAccordionItemConfig[]` | — | Secciones (requerido) |
422
+ | `allowMultiple` | `boolean` | `false` | Abre varias a la vez |
423
+ | `defaultExpandedId` | `string` | — | Sección abierta inicial |
424
+ | `onExpandedChange` | `(id: string) => void` | — | Callback |
425
+
426
+ **TigerAccordionItemConfig:** `id`, `title`, `content`, `icon?`, `disabled?`
427
+
428
+ ---
429
+
430
+ ### TigerList / TigerListItem
431
+
432
+ Lista estructurada con íconos y divisores opcionales.
433
+
434
+ ```tsx
435
+ import { TigerList, TigerListItem, ComponentSize } from '@jonapin006/tiger';
436
+ import { User, Settings, LogOut } from 'lucide-react';
437
+
438
+ <TigerList size={ComponentSize.Medium} divided>
439
+ <TigerListItem icon={<User size={16} />}>Perfil</TigerListItem>
440
+ <TigerListItem icon={<Settings size={16} />}>Configuración</TigerListItem>
441
+ <TigerListItem icon={<LogOut size={16} />}>Cerrar sesión</TigerListItem>
442
+ </TigerList>
443
+ ```
444
+
445
+ **TigerList**
446
+
447
+ | Prop | Tipo | Default | Descripción |
448
+ |------|------|---------|-------------|
449
+ | `size` | `ComponentSize` | `Medium` | Tamaño (excluye `xsmall`) |
450
+ | `divided` | `boolean` | `true` | Línea divisoria entre ítems |
451
+
452
+ **TigerListItem**
453
+
454
+ | Prop | Tipo | Descripción |
455
+ |------|------|-------------|
456
+ | `icon` | `ReactNode` | Ícono a la izquierda |
457
+ | `typographySize` | `TypographySize` | Sobreescribe tamaño tipográfico |
458
+
459
+ ---
460
+
461
+ ### TigerTable
462
+
463
+ Tabla de datos con sub-componentes semánticos.
464
+
465
+ ```tsx
466
+ import {
467
+ TigerTable, TigerThead, TigerTbody,
468
+ TigerTr, TigerTh, TigerTd,
469
+ ComponentSize
470
+ } from '@jonapin006/tiger';
471
+
472
+ <TigerTable size={ComponentSize.Medium}>
473
+ <TigerThead>
474
+ <TigerTr isHeader>
475
+ <TigerTh>Nombre</TigerTh>
476
+ <TigerTh>Email</TigerTh>
477
+ <TigerTh>Estado</TigerTh>
478
+ </TigerTr>
479
+ </TigerThead>
480
+ <TigerTbody>
481
+ {users.map((user) => (
482
+ <TigerTr key={user.id}>
483
+ <TigerTd>{user.name}</TigerTd>
484
+ <TigerTd>{user.email}</TigerTd>
485
+ <TigerTd>
486
+ <TigerBadge variant={TigerBadgeVariant.Success}>{user.status}</TigerBadge>
487
+ </TigerTd>
488
+ </TigerTr>
489
+ ))}
490
+ </TigerTbody>
491
+ </TigerTable>
492
+ ```
493
+
494
+ Todos los sub-componentes aceptan `size?: ComponentSize` y `className?: string`. `TigerTr` acepta `isHeader?: boolean`. `TigerTh` y `TigerTd` aceptan `typographySize?: TypographySize`.
495
+
496
+ ---
497
+
498
+ ### TigerModal
499
+
500
+ Diálogo modal con overlay y pie de página.
501
+
502
+ ```tsx
503
+ import { TigerModal, TigerButton, TigerButtonVariant, ComponentSize } from '@jonapin006/tiger';
504
+
505
+ const [open, setOpen] = useState(false);
506
+
507
+ <TigerModal
508
+ isOpen={open}
509
+ onClose={() => setOpen(false)}
510
+ title="Confirmar acción"
511
+ size={ComponentSize.Medium}
512
+ footer={
513
+ <>
514
+ <TigerButton variant={TigerButtonVariant.Ghost} onClick={() => setOpen(false)}>
515
+ Cancelar
516
+ </TigerButton>
517
+ <TigerButton variant={TigerButtonVariant.Primary} onClick={handleConfirm}>
518
+ Confirmar
519
+ </TigerButton>
520
+ </>
133
521
  }
134
522
  >
135
- {/* El contenido aquí tendrá scroll automático independiente */}
136
- <div className="p-6">
137
- <MyMainContent />
138
- </div>
139
- </TigerDashboardLayout>
523
+ <p>¿Estás seguro de que deseas continuar?</p>
524
+ </TigerModal>
140
525
  ```
141
526
 
142
- ### 🔘 Botones e Iconos
143
- Tiger soporta iconos integrados en ambos lados, respetando el sistema de tamaños y espaciado temático de forma nativa.
527
+ | Prop | Tipo | Default | Descripción |
528
+ |------|------|---------|-------------|
529
+ | `isOpen` | `boolean` | — | Visibilidad (requerido) |
530
+ | `onClose` | `() => void` | — | Callback al cerrar (requerido) |
531
+ | `title` | `string` | — | Título del header |
532
+ | `footer` | `ReactNode` | — | Contenido del footer |
533
+ | `size` | `ComponentSize` | `Medium` | Ancho máximo (excluye `xsmall`) |
534
+ | `showCloseButton` | `boolean` | `true` | Muestra botón × |
535
+
536
+ ---
537
+
538
+ ### TigerMessage
539
+
540
+ Alerta o mensaje con ícono, título y acciones.
144
541
 
145
542
  ```tsx
146
- import { TigerButton, ComponentSize } from '@jonapin006/tiger';
147
- import { Plus, ArrowRight, Download, Send } from 'lucide-react';
543
+ import { TigerMessage, TigerMessageVariant } from '@jonapin006/tiger';
544
+ import { AlertCircle } from 'lucide-react';
148
545
 
149
- /* Ejemplos por tamaño */
150
- <TigerButton size={ComponentSize.Small} iconLeft={Plus}>
151
- Nuevo
152
- </TigerButton>
546
+ // Simple
547
+ <TigerMessage
548
+ variant={TigerMessageVariant.Info}
549
+ title="Tu plan se renueva el 15 de enero."
550
+ />
153
551
 
154
- <TigerButton size={ComponentSize.Medium} iconRight={ArrowRight}>
155
- Continuar
156
- </TigerButton>
552
+ // Con descripción, ícono y cierre
553
+ <TigerMessage
554
+ variant={TigerMessageVariant.Error}
555
+ title="Error de conexión"
556
+ description="No se pudo conectar al servidor."
557
+ icon={<AlertCircle />}
558
+ onClose={() => setVisible(false)}
559
+ action={
560
+ <TigerButton size={ComponentSize.Small} onClick={retry}>
561
+ Reintentar
562
+ </TigerButton>
563
+ }
564
+ />
565
+ ```
157
566
 
158
- <TigerButton size={ComponentSize.Large} iconLeft={Download} iconRight={Send}>
159
- Doble Icono
160
- </TigerButton>
567
+ | Prop | Tipo | Default | Descripción |
568
+ |------|------|---------|-------------|
569
+ | `title` | `string` | — | Título (requerido) |
570
+ | `variant` | `TigerMessageVariant` | `Info` | Tipo/color |
571
+ | `description` | `ReactNode` | — | Detalle del mensaje |
572
+ | `icon` | `ReactNode` | — | Ícono personalizado |
573
+ | `action` | `ReactNode` | — | Botones o acciones |
574
+ | `onClose` | `() => void` | — | Si se provee, muestra botón de cierre |
161
575
 
162
- <TigerButton size={ComponentSize.Xlarge} iconLeft={Plus} iconRight={ArrowRight}>
163
- Boton Hero
164
- </TigerButton>
576
+ ---
577
+
578
+ ### TigerToast
579
+
580
+ Notificaciones temporales. Requiere `TigerToastContainer` en el layout raíz.
581
+
582
+ ```tsx
583
+ import { TigerToastContainer, useToast } from '@jonapin006/tiger';
584
+
585
+ // En el layout raíz (una sola vez):
586
+ <TigerToastContainer />
587
+
588
+ // En cualquier componente:
589
+ function SaveButton() {
590
+ const { addToast } = useToast();
591
+
592
+ return (
593
+ <TigerButton onClick={() =>
594
+ addToast({
595
+ title: 'Guardado',
596
+ description: 'Los cambios se guardaron correctamente.',
597
+ type: 'success',
598
+ })
599
+ }>
600
+ Guardar
601
+ </TigerButton>
602
+ );
603
+ }
165
604
  ```
166
605
 
167
- ### ✍️ Inputs y Switch
168
- Todos los inputs consumen el sistema de tamaños (Size System) de Tiger.
606
+ **Opciones de `addToast`**
607
+
608
+ | Campo | Tipo | Descripción |
609
+ |-------|------|-------------|
610
+ | `title` | `string` | Título del toast |
611
+ | `description` | `string` | Descripción (opcional) |
612
+ | `type` | `'info' \| 'success' \| 'warning' \| 'error' \| 'neutral'` | Tipo visual |
613
+
614
+ ---
615
+
616
+ ### TigerProgress
617
+
618
+ Barra de progreso o indicador de pasos.
169
619
 
170
620
  ```tsx
171
- import { TigerInput, TigerSwitch, TigerStack } from '@jonapin006/tiger';
172
-
173
- <TigerStack gap="medium">
174
- <TigerInput
175
- label="Correo Electrónico"
176
- placeholder="ejemplo@tiger.com"
177
- icon={Mail}
178
- />
179
-
180
- <TigerSwitch
181
- label="Notificaciones Push"
182
- checked={isEnabled}
183
- onChange={setIsEnabled}
184
- />
185
- </TigerStack>
621
+ import { TigerProgress, ComponentSize } from '@jonapin006/tiger';
622
+
623
+ // Barra de progreso (0–100)
624
+ <TigerProgress value={65} size={ComponentSize.Medium} />
625
+
626
+ // Sin porcentaje visible
627
+ <TigerProgress value={30} showValue={false} />
628
+
629
+ // Valor máximo personalizado
630
+ <TigerProgress value={750} max={1000} />
631
+
632
+ // Por pasos
633
+ <TigerProgress
634
+ variant="steps"
635
+ currentStep={3}
636
+ totalSteps={5}
637
+ size={ComponentSize.Large}
638
+ />
186
639
  ```
187
640
 
188
- ### 📊 Tablas de Datos
189
- La `TigerTable` es premium por defecto, con soporte para estados de carga, filas vacías y estilos de celdas temáticos.
641
+ | Prop | Tipo | Default | Descripción |
642
+ |------|------|---------|-------------|
643
+ | `variant` | `'bar' \| 'steps'` | `'bar'` | Tipo de indicador |
644
+ | `value` | `number` | `0` | Valor actual (para `bar`) |
645
+ | `max` | `number` | `100` | Valor máximo (para `bar`) |
646
+ | `currentStep` | `number` | `0` | Paso actual (para `steps`) |
647
+ | `totalSteps` | `number` | `5` | Total de pasos (para `steps`) |
648
+ | `size` | `ComponentSize` | `Medium` | Tamaño (excluye `xsmall`) |
649
+ | `showValue` | `boolean` | `true` | Muestra el porcentaje |
650
+
651
+ ---
652
+
653
+ ### TigerDropdown
654
+
655
+ Menú desplegable composable.
190
656
 
191
657
  ```tsx
192
- import { TigerTable } from '@jonapin006/tiger';
658
+ import {
659
+ TigerDropdown,
660
+ TigerDropdownTrigger,
661
+ TigerDropdownContent,
662
+ TigerDropdownItem,
663
+ ComponentSize,
664
+ } from '@jonapin006/tiger';
665
+
666
+ <TigerDropdown size={ComponentSize.Medium}>
667
+ <TigerDropdownTrigger label="Opciones" value="Selecciona una opción" />
668
+ <TigerDropdownContent>
669
+ <TigerDropdownItem value="edit" onClick={handleEdit}>Editar</TigerDropdownItem>
670
+ <TigerDropdownItem value="duplicate" onClick={handleDuplicate}>Duplicar</TigerDropdownItem>
671
+ <TigerDropdownItem value="delete" onClick={handleDelete} disabled>Eliminar</TigerDropdownItem>
672
+ </TigerDropdownContent>
673
+ </TigerDropdown>
674
+ ```
193
675
 
194
- const columns = [
195
- { key: 'name', header: 'Nombre' },
196
- { key: 'status', header: 'Estado', render: (val) => <TigerBadge status={val} /> },
197
- { key: 'amount', header: 'Monto', align: 'right' }
676
+ **TigerDropdown**
677
+
678
+ | Prop | Tipo | Default | Descripción |
679
+ |------|------|---------|-------------|
680
+ | `size` | `ComponentSize` | `Medium` | Ancho mínimo del contenido |
681
+ | `defaultOpen` | `boolean` | `false` | Estado abierto inicial |
682
+
683
+ **TigerDropdownTrigger:** `label?: string`, `value?: ReactNode`
684
+ **TigerDropdownItem:** `value?: string`, `onClick`, `disabled?: boolean`
685
+
686
+ ---
687
+
688
+ ### TigerSidebar
689
+
690
+ Barra de navegación lateral con soporte para subelementos.
691
+
692
+ ```tsx
693
+ import { TigerSidebar } from '@jonapin006/tiger';
694
+ import { Home, Users, Settings, BarChart } from 'lucide-react';
695
+
696
+ const items = [
697
+ { id: 'dashboard', label: 'Dashboard', icon: Home },
698
+ {
699
+ id: 'users',
700
+ label: 'Usuarios',
701
+ icon: Users,
702
+ children: [
703
+ { id: 'users-list', label: 'Lista', icon: Users },
704
+ { id: 'users-roles', label: 'Roles', icon: Users },
705
+ ],
706
+ },
707
+ { id: 'analytics', label: 'Analíticas', icon: BarChart },
708
+ { id: 'settings', label: 'Configuración', icon: Settings },
198
709
  ];
199
710
 
200
- <TigerTable
201
- columns={columns}
202
- data={myRecords}
203
- loading={isLoading}
711
+ <TigerSidebar
712
+ items={items}
713
+ activeId="dashboard"
714
+ onItemSelect={(id) => navigate(id)}
715
+ header={<Logo />}
716
+ footer={<UserProfile />}
204
717
  />
205
718
  ```
206
719
 
207
- ### 📦 Cards y Badges
208
- Úsalos para agrupar información con elevaciones temáticas.
720
+ | Prop | Tipo | Default | Descripción |
721
+ |------|------|---------|-------------|
722
+ | `items` | `SidebarItem[]` | — | Ítems de navegación (requerido) |
723
+ | `activeId` | `string` | — | ID del ítem activo (requerido) |
724
+ | `onItemSelect` | `(id: string) => void` | — | Callback de selección (requerido) |
725
+ | `header` | `ReactNode` | — | Encabezado (ej: logo) |
726
+ | `footer` | `ReactNode` | — | Pie (ej: perfil de usuario) |
727
+
728
+ **SidebarItem:** `id`, `label`, `icon: React.ElementType`, `children?: SidebarItem[]`
729
+
730
+ ---
731
+
732
+ ### TigerTopBar
733
+
734
+ Encabezado de página con título, descripción y acciones.
209
735
 
210
736
  ```tsx
211
- import { TigerCard, TigerBadge, TigerTypography } from '@jonapin006/tiger';
212
-
213
- <TigerCard hoverable padding="large">
214
- <div className="flex justify-between items-center">
215
- <TigerTypography variant="h3">Ventas Totales</TigerTypography>
216
- <TigerBadge variant="success" label="Activo" />
217
- </div>
218
- <TigerTypography variant="body1" className="mt-4">
219
- $4,250.00
220
- </TigerTypography>
221
- </TigerCard>
737
+ import { TigerTopBar, ComponentSize } from '@jonapin006/tiger';
738
+
739
+ <TigerTopBar
740
+ title="Panel de Control"
741
+ description="Resumen general del sistema"
742
+ size={ComponentSize.Large}
743
+ actions={
744
+ <TigerButton variant={TigerButtonVariant.Primary} iconLeft={Plus}>
745
+ Nueva entrada
746
+ </TigerButton>
747
+ }
748
+ />
222
749
  ```
223
750
 
224
- ### 🔔 Modales y Feedback
225
- Gestiona overlays con transiciones suaves y fondos desenfocados (glassmorphism).
751
+ | Prop | Tipo | Default | Descripción |
752
+ |------|------|---------|-------------|
753
+ | `title` | `ReactNode` | — | Título principal |
754
+ | `description` | `ReactNode` | — | Descripción secundaria |
755
+ | `actions` | `ReactNode` | — | Área derecha (botones, etc.) |
756
+ | `size` | `ComponentSize.Medium \| .Large \| .Xlarge` | `Large` | Tamaño tipográfico del título |
757
+ | `titleTypographySize` | `TypographySize` | — | Sobreescribe tamaño del título |
758
+ | `descriptionTypographySize` | `TypographySize` | — | Sobreescribe tamaño de la descripción |
759
+
760
+ ---
761
+
762
+ ### TigerThumbnail
763
+
764
+ Avatar o imagen miniatura con forma y estilo configurables.
226
765
 
227
766
  ```tsx
228
- import { TigerModal, TigerButton } from '@jonapin006/tiger';
767
+ import { TigerThumbnail, TigerThumbnailVariant, ThumbnailShape, ComponentSize } from '@jonapin006/tiger';
768
+
769
+ // Con imagen
770
+ <TigerThumbnail
771
+ src="/avatars/user.jpg"
772
+ alt="Avatar"
773
+ size={ComponentSize.Medium}
774
+ shape={ThumbnailShape.Circle}
775
+ />
229
776
 
230
- <TigerModal
231
- isOpen={show}
232
- onClose={() => setShow(false)}
233
- title="Confirmar Acción"
234
- footer={
235
- <div className="flex gap-2">
236
- <TigerButton variant="ghost" onClick={() => setShow(false)}>Cancelar</TigerButton>
237
- <TigerButton variant="primary">Confirmar</TigerButton>
238
- </div>
777
+ // Inicial sin imagen
778
+ <TigerThumbnail
779
+ size={ComponentSize.Large}
780
+ variant={TigerThumbnailVariant.Soft}
781
+ shape={ThumbnailShape.Squircle}
782
+ >
783
+ JD
784
+ </TigerThumbnail>
785
+ ```
786
+
787
+ | Prop | Tipo | Default | Descripción |
788
+ |------|------|---------|-------------|
789
+ | `src` | `string` | — | URL de la imagen |
790
+ | `alt` | `string` | — | Texto alternativo |
791
+ | `size` | `ComponentSize` | `Medium` | Tamaño |
792
+ | `shape` | `ThumbnailShape` | `Squircle` | Forma |
793
+ | `variant` | `TigerThumbnailVariant` | `Soft` | Estilo cuando no hay imagen |
794
+ | `bgColor` | `string` | — | Color de fondo personalizado |
795
+
796
+ ---
797
+
798
+ ### TigerGlassContainer
799
+
800
+ Contenedor con efecto glassmorphism del tema activo.
801
+
802
+ ```tsx
803
+ import { TigerGlassContainer } from '@jonapin006/tiger';
804
+
805
+ // Estático
806
+ <TigerGlassContainer>
807
+ <TigerTypography>Contenido en vidrio</TigerTypography>
808
+ </TigerGlassContainer>
809
+
810
+ // Interactivo (aplica hover automáticamente)
811
+ <TigerGlassContainer onClick={() => openDetail()}>
812
+ <TigerTypography weight="bold">Tarjeta</TigerTypography>
813
+ </TigerGlassContainer>
814
+ ```
815
+
816
+ | Prop | Tipo | Descripción |
817
+ |------|------|-------------|
818
+ | `onClick` | `() => void` | Si se provee, aplica estilos interactivos |
819
+ | `className` | `string` | Clases CSS adicionales |
820
+
821
+ Acepta todos los atributos nativos de `<div>`.
822
+
823
+ ---
824
+
825
+ ### TigerDashboardLayout
826
+
827
+ Layout principal de la aplicación: sidebar + topbar + contenido.
828
+
829
+ ```tsx
830
+ import { TigerDashboardLayout } from '@jonapin006/tiger';
831
+
832
+ <TigerDashboardLayout
833
+ sidebar={
834
+ <TigerSidebar
835
+ items={navItems}
836
+ activeId={activeRoute}
837
+ onItemSelect={navigate}
838
+ header={<Logo />}
839
+ />
840
+ }
841
+ topbar={
842
+ <TigerTopBar title={pageTitle} actions={<UserMenu />} />
239
843
  }
240
844
  >
241
- <p>¿Estás seguro de que deseas eliminar este registro?</p>
242
- </TigerModal>
845
+ <Outlet />
846
+ </TigerDashboardLayout>
847
+ ```
848
+
849
+ | Prop | Tipo | Descripción |
850
+ |------|------|-------------|
851
+ | `sidebar` | `ReactNode` | Navegación lateral (requerido) |
852
+ | `topbar` | `ReactNode` | Encabezado (requerido) |
853
+ | `children` | `ReactNode` | Contenido de la página (requerido) |
854
+ | `className` | `string` | Clases CSS adicionales |
855
+
856
+ ---
857
+
858
+ ## 🎨 Crear un tema personalizado
859
+
860
+ Cada tema implementa la interfaz `ThemeDefinition`. Los tamaños de cada componente definen sus propiedades de forma independiente para sobreescritura granular.
861
+
862
+ ```ts
863
+ import type { ThemeDefinition } from '@jonapin006/tiger';
864
+ import { TypographySize, ThemeMode } from '@jonapin006/tiger';
865
+
866
+ export const myTheme: ThemeDefinition = {
867
+ name: 'Mi Tema',
868
+ subName: '',
869
+ pageTitle: 'Mi App',
870
+ websiteUrl: 'https://miapp.com',
871
+ defaultMode: ThemeMode.Light,
872
+ geometry: {
873
+ typography: {
874
+ xsmall: 'text-[10px] font-medium',
875
+ small: 'text-[12px] font-medium',
876
+ medium: 'text-[14px] font-semibold',
877
+ large: 'text-[18px] font-bold',
878
+ xlarge: 'text-[32px] font-black',
879
+ weights: {
880
+ bold: 'font-black',
881
+ semibold: 'font-semibold',
882
+ normal: 'font-medium',
883
+ },
884
+ styles: {
885
+ italic: 'italic',
886
+ normal: '',
887
+ underline: 'underline',
888
+ strikethrough: 'line-through',
889
+ },
890
+ },
891
+ buttons: {
892
+ small: { height: 'h-8', padding: 'px-4', corner: 'rounded-md', typography: TypographySize.Small },
893
+ medium: { height: 'h-10', padding: 'px-5', corner: 'rounded-lg', typography: TypographySize.Medium },
894
+ large: { height: 'h-12', padding: 'px-6', corner: 'rounded-xl', typography: TypographySize.Large },
895
+ xlarge: { height: 'h-14', padding: 'px-8', corner: 'rounded-2xl', typography: TypographySize.Xlarge },
896
+ none: { height: 'h-0 overflow-hidden', padding: 'px-0', corner: 'rounded-none', typography: TypographySize.Small },
897
+ baseTypography: 'text-inherit leading-none font-bold whitespace-nowrap',
898
+ baseStyles: 'transition-all duration-300 active:scale-95 disabled:opacity-50 inline-flex items-center justify-center shrink-0',
899
+ layout: {
900
+ container: 'inline-flex items-center justify-center gap-2',
901
+ icon: 'w-[1.2em] h-[1.2em] shrink-0',
902
+ fullWidth: 'w-full',
903
+ },
904
+ },
905
+ // ... resto de la geometría
906
+ },
907
+ modes: {
908
+ light: { /* ThemeModeConfig */ },
909
+ dark: { /* ThemeModeConfig */ },
910
+ },
911
+ };
243
912
  ```
244
913
 
245
914
  ---