@jonapin006/tiger 1.0.11 → 1.0.13
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 +58 -50
- package/dist/index.d.ts +172 -1
- package/dist/tiger.css +1 -1
- package/dist/tiger.es.js +910 -402
- package/dist/tiger.umd.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,76 +2,84 @@
|
|
|
2
2
|
|
|
3
3
|
Welcome to **Tiger Design System**, a high-fidelity, professional-grade UI library and framework built on **Clean Architecture** principles and **SOLID** engineering.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Tiger handles complex multi-theme token architectures and a sophisticated "Geometry-by-Size" system, optimized for the **Wallet** ecosystem.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## 🚀 Integración (Quick Start)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Sigue estos pasos para integrar Tiger en tu proyecto externo de React.
|
|
12
12
|
|
|
13
|
-
### 1.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
### 2. 🎡 Mandala (Organic/Soft)
|
|
19
|
-
Inspired by balance and nature. This theme focuses on softer corner radii, nature-derived color palettes, and smooth, organic transitions.
|
|
20
|
-
* **Key Features**: Earthy tones, pastel accents, and "squircle" geometry that avoids hard edges.
|
|
21
|
-
* **Ideal for**: Wellness apps, lifestyle projects, and content-heavy interfaces.
|
|
22
|
-
|
|
23
|
-
### 3. 🎯 Mispuntos (Dynamic/Precision)
|
|
24
|
-
Designed for density and readability. This theme prioritizes pixel-perfect alignment, higher contrast ratios, and a more structured, grid-based layout.
|
|
25
|
-
* **Key Features**: Sharp focus on data presentation, compact components, and high-contrast tables.
|
|
26
|
-
* **Ideal for**: E-commerce, loyalty platforms (Puntos), and data-intensive systems.
|
|
13
|
+
### 1. Instalación
|
|
14
|
+
```bash
|
|
15
|
+
npm install @jonapin006/tiger@1.0.11
|
|
16
|
+
```
|
|
27
17
|
|
|
28
|
-
|
|
18
|
+
### 2. Configuración Raíz (`src/main.tsx`)
|
|
19
|
+
Importa los estilos globales y envuelve tu aplicación con el `ThemeProvider`.
|
|
29
20
|
|
|
30
|
-
|
|
21
|
+
```tsx
|
|
22
|
+
import { ThemeProvider } from '@jonapin006/tiger';
|
|
23
|
+
import '@jonapin006/tiger/styles'; // Estilos base de Tiger
|
|
24
|
+
import './index.css'; // Tu Tailwind local
|
|
31
25
|
|
|
32
|
-
|
|
26
|
+
ReactDOM.createRoot(document.getElementById('root')!).render(
|
|
27
|
+
<ThemeProvider>
|
|
28
|
+
<App />
|
|
29
|
+
</ThemeProvider>
|
|
30
|
+
);
|
|
31
|
+
```
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
### 3. Layout Responsivo (Sidebar vs Desktop)
|
|
34
|
+
Usa los breakpoints de Tailwind (`md:`) para asegurar que el Sidebar se vea solo en Desktop y el menú hamburguesa solo en móvil:
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
// Ejemplo de Layout
|
|
38
|
+
<div className="flex flex-col md:flex-row min-h-screen">
|
|
39
|
+
|
|
40
|
+
{/* SIDEBAR PARA DESKTOP: Oculto en móvil, visible en md y superior */}
|
|
41
|
+
<aside className="hidden md:flex w-80 h-screen sticky top-0 bg-white/5 border-r border-white/5">
|
|
42
|
+
{/* Contenido de navegación */}
|
|
43
|
+
<nav> ... </nav>
|
|
44
|
+
</aside>
|
|
45
|
+
|
|
46
|
+
{/* CONTENIDO PRINCIPAL */}
|
|
47
|
+
<main className="flex-1 p-6 md:p-16">
|
|
48
|
+
{children}
|
|
49
|
+
</main>
|
|
50
|
+
</div>
|
|
51
|
+
```
|
|
38
52
|
|
|
39
53
|
---
|
|
40
54
|
|
|
41
|
-
##
|
|
55
|
+
## 🛠️ Uso del Hook de Temas (`useTheme`)
|
|
42
56
|
|
|
43
|
-
|
|
44
|
-
- Node.js (Latest stable)
|
|
45
|
-
- npm or yarn
|
|
57
|
+
Para evitar errores de tipo `ReferenceError: mode is not defined`, asegúrate siempre de extraer las variables del contexto:
|
|
46
58
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
# Clone the repository
|
|
50
|
-
git clone https://github.com/jonapin006/tiger.git
|
|
59
|
+
```tsx
|
|
60
|
+
import { useTheme } from '@jonapin006/tiger';
|
|
51
61
|
|
|
52
|
-
|
|
53
|
-
|
|
62
|
+
const MyComponent = () => {
|
|
63
|
+
const { mode, themeConfig, toggleMode } = useTheme();
|
|
54
64
|
|
|
55
|
-
|
|
56
|
-
|
|
65
|
+
return (
|
|
66
|
+
<button onClick={toggleMode} className={themeConfig.buttonText}>
|
|
67
|
+
Modo: {mode}
|
|
68
|
+
</button>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
57
71
|
```
|
|
58
72
|
|
|
59
|
-
### Extending the Design System
|
|
60
|
-
To add new components or modify styles, focus on these files:
|
|
61
|
-
- `src/domain/theme/Theme.ts`: Define the interfaces and token structure.
|
|
62
|
-
- `src/infrastructure/theme/glassmorphism.ts`: Implement specific theme tokens and geometry.
|
|
63
|
-
- `src/presentation/components/`: Build your components consuming the `useTheme` hook.
|
|
64
|
-
|
|
65
73
|
---
|
|
66
74
|
|
|
67
|
-
##
|
|
68
|
-
|
|
69
|
-
- **
|
|
70
|
-
- **
|
|
71
|
-
- **
|
|
72
|
-
- **
|
|
75
|
+
## 🏗️ Excelencia Arquitectónica
|
|
76
|
+
|
|
77
|
+
- **Clean Architecture**: Separación estricta entre `Domain` (Tipos), `Application` (Hooks), `Infrastructure` (Temas) y `Presentation` (Componentes).
|
|
78
|
+
- **SOLID Principles**: Componentes desacoplados y con una única responsabilidad (SRP).
|
|
79
|
+
- **Scale System**: Sistema de 4 niveles de tamaño (**S, M, L, XL**) consistente en toda la librería.
|
|
80
|
+
- **Native Support**: Soporte nativo para atributos HTML y `forwardRef` para compatibilidad total con `react-hook-form`.
|
|
73
81
|
|
|
74
82
|
---
|
|
75
83
|
|
|
76
|
-
## 📄
|
|
77
|
-
Tiger Design System
|
|
84
|
+
## 📄 Licencia
|
|
85
|
+
Tiger Design System es propiedad intelectual privada de **jonapin006**.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { default as default_2 } from 'react';
|
|
2
2
|
import { ForwardRefExoticComponent } from 'react';
|
|
3
3
|
import { InputHTMLAttributes } from 'react';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
4
5
|
import { RefAttributes } from 'react';
|
|
5
6
|
|
|
6
7
|
export declare interface BaseComponentProps {
|
|
@@ -43,6 +44,12 @@ export declare const mispuntosTheme: ThemeDefinition;
|
|
|
43
44
|
|
|
44
45
|
declare type ProgressVariant = 'bar' | 'steps';
|
|
45
46
|
|
|
47
|
+
export declare interface SidebarItem {
|
|
48
|
+
id: string;
|
|
49
|
+
label: string;
|
|
50
|
+
icon: default_2.ElementType;
|
|
51
|
+
}
|
|
52
|
+
|
|
46
53
|
export declare interface SizedComponentProps extends BaseComponentProps {
|
|
47
54
|
size?: ComponentSize;
|
|
48
55
|
}
|
|
@@ -301,6 +308,17 @@ export declare interface ThemeGeometryConfig {
|
|
|
301
308
|
valueStyles: string;
|
|
302
309
|
typographyMappings: Record<'small' | 'medium' | 'large' | 'xlarge', ComponentSize>;
|
|
303
310
|
});
|
|
311
|
+
dropdown: (Record<Exclude<ComponentSize, ComponentSize.Xsmall>, {
|
|
312
|
+
size: string;
|
|
313
|
+
}> & {
|
|
314
|
+
contentPositioning: string;
|
|
315
|
+
typographyMappings: {
|
|
316
|
+
small: ComponentSize;
|
|
317
|
+
medium: ComponentSize;
|
|
318
|
+
large: ComponentSize;
|
|
319
|
+
xlarge: ComponentSize;
|
|
320
|
+
};
|
|
321
|
+
});
|
|
304
322
|
stack: (Record<Exclude<ComponentSize, ComponentSize.Xsmall>, {
|
|
305
323
|
gap: string;
|
|
306
324
|
}> & {
|
|
@@ -357,6 +375,48 @@ export declare interface ThemeGeometryConfig {
|
|
|
357
375
|
closeButton: string;
|
|
358
376
|
corner: string;
|
|
359
377
|
};
|
|
378
|
+
switch: (Record<ComponentSize.Small | ComponentSize.Medium | ComponentSize.Large, {
|
|
379
|
+
track: string;
|
|
380
|
+
thumb: string;
|
|
381
|
+
translateChecked: string;
|
|
382
|
+
translateUnchecked: string;
|
|
383
|
+
}> & {
|
|
384
|
+
baseStyles: string;
|
|
385
|
+
thumbStyles: string;
|
|
386
|
+
label: string;
|
|
387
|
+
description: string;
|
|
388
|
+
});
|
|
389
|
+
sidebar: {
|
|
390
|
+
wrapper: string;
|
|
391
|
+
container: string;
|
|
392
|
+
nav: string;
|
|
393
|
+
item: string;
|
|
394
|
+
iconSize: number;
|
|
395
|
+
padding: string;
|
|
396
|
+
margin: string;
|
|
397
|
+
corner: string;
|
|
398
|
+
logoContainer: string;
|
|
399
|
+
logo: string;
|
|
400
|
+
};
|
|
401
|
+
topbar: {
|
|
402
|
+
wrapper: string;
|
|
403
|
+
container: string;
|
|
404
|
+
padding: string;
|
|
405
|
+
margin: string;
|
|
406
|
+
corner: string;
|
|
407
|
+
height: string;
|
|
408
|
+
width: string;
|
|
409
|
+
logoContainer: string;
|
|
410
|
+
logo: string;
|
|
411
|
+
};
|
|
412
|
+
layout: {
|
|
413
|
+
bodyWrapper: string;
|
|
414
|
+
bodyContent: string;
|
|
415
|
+
bodyCorner: string;
|
|
416
|
+
bodyPadding: string;
|
|
417
|
+
bodyMargin: string;
|
|
418
|
+
bodyBlobs: string[];
|
|
419
|
+
};
|
|
360
420
|
}
|
|
361
421
|
|
|
362
422
|
export declare enum ThemeMode {
|
|
@@ -410,8 +470,15 @@ export declare interface ThemeModeConfig {
|
|
|
410
470
|
xlarge: string;
|
|
411
471
|
};
|
|
412
472
|
layout: {
|
|
413
|
-
sidebar:
|
|
473
|
+
sidebar: {
|
|
474
|
+
container: string;
|
|
475
|
+
};
|
|
476
|
+
topbar: {
|
|
477
|
+
container: string;
|
|
478
|
+
};
|
|
414
479
|
main: string;
|
|
480
|
+
bodyBlobs: string[];
|
|
481
|
+
useGlassBody?: boolean;
|
|
415
482
|
};
|
|
416
483
|
statusColors: {
|
|
417
484
|
success: {
|
|
@@ -514,6 +581,20 @@ export declare interface ThemeModeConfig {
|
|
|
514
581
|
fillEffectColor: string;
|
|
515
582
|
value: string;
|
|
516
583
|
};
|
|
584
|
+
dropdown: {
|
|
585
|
+
trigger: string;
|
|
586
|
+
triggerSize: string;
|
|
587
|
+
content: string;
|
|
588
|
+
contentSize: string;
|
|
589
|
+
item: string;
|
|
590
|
+
itemHover: string;
|
|
591
|
+
itemFocus: string;
|
|
592
|
+
};
|
|
593
|
+
switch: {
|
|
594
|
+
primary: string;
|
|
595
|
+
secondary: string;
|
|
596
|
+
disabled: string;
|
|
597
|
+
};
|
|
517
598
|
}
|
|
518
599
|
|
|
519
600
|
export declare const ThemeProvider: default_2.FC<{
|
|
@@ -525,6 +606,33 @@ export declare enum ThumbnailShape {
|
|
|
525
606
|
Circle = "circle"
|
|
526
607
|
}
|
|
527
608
|
|
|
609
|
+
export declare const TigerAccordion: default_2.FC<TigerAccordionProps>;
|
|
610
|
+
|
|
611
|
+
export declare const TigerAccordionItem: ({ id, title, content, disabled, icon, }: TigerAccordionItemConfig) => {
|
|
612
|
+
id: string;
|
|
613
|
+
title: default_2.ReactNode;
|
|
614
|
+
content: default_2.ReactNode;
|
|
615
|
+
disabled: boolean;
|
|
616
|
+
icon: default_2.ReactNode;
|
|
617
|
+
};
|
|
618
|
+
|
|
619
|
+
export declare interface TigerAccordionItemConfig {
|
|
620
|
+
id: string;
|
|
621
|
+
title: ReactNode;
|
|
622
|
+
content: ReactNode;
|
|
623
|
+
disabled?: boolean;
|
|
624
|
+
icon?: default_2.ReactNode;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
export declare interface TigerAccordionProps {
|
|
628
|
+
items: TigerAccordionItemConfig[];
|
|
629
|
+
defaultExpandedId?: string;
|
|
630
|
+
onExpandedChange?: (id: string) => void;
|
|
631
|
+
allowMultiple?: boolean;
|
|
632
|
+
size?: ComponentSize;
|
|
633
|
+
className?: string;
|
|
634
|
+
}
|
|
635
|
+
|
|
528
636
|
export declare const TigerBadge: default_2.FC<TigerBadgeProps>;
|
|
529
637
|
|
|
530
638
|
declare interface TigerBadgeProps extends BaseComponentProps {
|
|
@@ -559,6 +667,32 @@ declare interface TigerCheckboxProps extends BaseComponentProps {
|
|
|
559
667
|
disabled?: boolean;
|
|
560
668
|
}
|
|
561
669
|
|
|
670
|
+
export declare const TigerDropdown: default_2.FC<TigerDropdownProps>;
|
|
671
|
+
|
|
672
|
+
export declare const TigerDropdownContent: default_2.FC<TigerDropdownContentProps>;
|
|
673
|
+
|
|
674
|
+
declare interface TigerDropdownContentProps extends default_2.HTMLAttributes<HTMLDivElement> {
|
|
675
|
+
size?: Exclude<ComponentSize, ComponentSize.Xsmall>;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
export declare const TigerDropdownItem: default_2.FC<TigerDropdownItemProps>;
|
|
679
|
+
|
|
680
|
+
declare interface TigerDropdownItemProps extends default_2.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
681
|
+
value?: string;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
declare interface TigerDropdownProps extends SizedComponentProps {
|
|
685
|
+
defaultOpen?: boolean;
|
|
686
|
+
size?: Exclude<ComponentSize, ComponentSize.Xsmall>;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
export declare const TigerDropdownTrigger: default_2.FC<TigerDropdownTriggerProps>;
|
|
690
|
+
|
|
691
|
+
declare interface TigerDropdownTriggerProps extends Omit<default_2.ButtonHTMLAttributes<HTMLButtonElement>, 'value'> {
|
|
692
|
+
label?: string;
|
|
693
|
+
value?: default_2.ReactNode;
|
|
694
|
+
}
|
|
695
|
+
|
|
562
696
|
export declare const TigerGlassContainer: default_2.FC<TigerGlassContainerProps>;
|
|
563
697
|
|
|
564
698
|
declare interface TigerGlassContainerProps extends BaseComponentProps, default_2.HTMLAttributes<HTMLDivElement> {
|
|
@@ -630,6 +764,17 @@ declare interface TigerProgressProps {
|
|
|
630
764
|
className?: string;
|
|
631
765
|
}
|
|
632
766
|
|
|
767
|
+
export declare const TigerSidebar: default_2.FC<TigerSidebarProps>;
|
|
768
|
+
|
|
769
|
+
export declare interface TigerSidebarProps {
|
|
770
|
+
items: SidebarItem[];
|
|
771
|
+
activeId: string;
|
|
772
|
+
onItemSelect: (id: string) => void;
|
|
773
|
+
header?: default_2.ReactNode;
|
|
774
|
+
footer?: default_2.ReactNode;
|
|
775
|
+
className?: string;
|
|
776
|
+
}
|
|
777
|
+
|
|
633
778
|
export declare const TigerStack: default_2.FC<TigerStackProps>;
|
|
634
779
|
|
|
635
780
|
declare interface TigerStackProps {
|
|
@@ -640,6 +785,24 @@ declare interface TigerStackProps {
|
|
|
640
785
|
className?: string;
|
|
641
786
|
}
|
|
642
787
|
|
|
788
|
+
export declare const TigerSwitch: default_2.FC<TigerSwitchProps>;
|
|
789
|
+
|
|
790
|
+
export declare enum TigerSwitchColor {
|
|
791
|
+
Primary = "primary",
|
|
792
|
+
Secondary = "secondary",
|
|
793
|
+
Disabled = "disabled"
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
export declare interface TigerSwitchProps extends BaseComponentProps {
|
|
797
|
+
checked: boolean;
|
|
798
|
+
onChange: (checked: boolean) => void;
|
|
799
|
+
disabled?: boolean;
|
|
800
|
+
size?: ComponentSize.Small | ComponentSize.Medium | ComponentSize.Large;
|
|
801
|
+
color?: TigerSwitchColor;
|
|
802
|
+
label?: string;
|
|
803
|
+
description?: string;
|
|
804
|
+
}
|
|
805
|
+
|
|
643
806
|
export declare interface TigerTabItem {
|
|
644
807
|
id: string;
|
|
645
808
|
label: default_2.ReactNode;
|
|
@@ -733,6 +896,14 @@ declare interface TigerToastProps extends TigerToastItem {
|
|
|
733
896
|
|
|
734
897
|
declare type TigerToastType = 'success' | 'error' | 'info' | 'warning' | 'neutral';
|
|
735
898
|
|
|
899
|
+
export declare const TigerTopBar: default_2.FC<TigerTopBarProps>;
|
|
900
|
+
|
|
901
|
+
export declare interface TigerTopBarProps {
|
|
902
|
+
title?: default_2.ReactNode;
|
|
903
|
+
actions?: default_2.ReactNode;
|
|
904
|
+
className?: string;
|
|
905
|
+
}
|
|
906
|
+
|
|
736
907
|
export declare const TigerTr: default_2.FC<TigerTrProps>;
|
|
737
908
|
|
|
738
909
|
declare interface TigerTrProps extends BaseComponentProps {
|