@jonapin006/tiger 1.0.10 → 1.0.12
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 +119 -7
- package/dist/tiger.css +1 -1
- package/dist/tiger.es.js +730 -386
- 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,4 +1,8 @@
|
|
|
1
1
|
import { default as default_2 } from 'react';
|
|
2
|
+
import { ForwardRefExoticComponent } from 'react';
|
|
3
|
+
import { InputHTMLAttributes } from 'react';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
import { RefAttributes } from 'react';
|
|
2
6
|
|
|
3
7
|
export declare interface BaseComponentProps {
|
|
4
8
|
children?: default_2.ReactNode;
|
|
@@ -298,6 +302,22 @@ export declare interface ThemeGeometryConfig {
|
|
|
298
302
|
valueStyles: string;
|
|
299
303
|
typographyMappings: Record<'small' | 'medium' | 'large' | 'xlarge', ComponentSize>;
|
|
300
304
|
});
|
|
305
|
+
dropdown: (Record<Exclude<ComponentSize, ComponentSize.Xsmall>, {
|
|
306
|
+
size: string;
|
|
307
|
+
}> & {
|
|
308
|
+
trigger: string;
|
|
309
|
+
content: string;
|
|
310
|
+
contentPositioning: string;
|
|
311
|
+
item: string;
|
|
312
|
+
itemHover: string;
|
|
313
|
+
itemFocus: string;
|
|
314
|
+
typographyMappings: {
|
|
315
|
+
small: ComponentSize;
|
|
316
|
+
medium: ComponentSize;
|
|
317
|
+
large: ComponentSize;
|
|
318
|
+
xlarge: ComponentSize;
|
|
319
|
+
};
|
|
320
|
+
});
|
|
301
321
|
stack: (Record<Exclude<ComponentSize, ComponentSize.Xsmall>, {
|
|
302
322
|
gap: string;
|
|
303
323
|
}> & {
|
|
@@ -354,6 +374,15 @@ export declare interface ThemeGeometryConfig {
|
|
|
354
374
|
closeButton: string;
|
|
355
375
|
corner: string;
|
|
356
376
|
};
|
|
377
|
+
switch: (Record<ComponentSize.Small | ComponentSize.Medium | ComponentSize.Large, {
|
|
378
|
+
track: string;
|
|
379
|
+
thumb: string;
|
|
380
|
+
translateChecked: string;
|
|
381
|
+
translateUnchecked: string;
|
|
382
|
+
}> & {
|
|
383
|
+
baseStyles: string;
|
|
384
|
+
thumbStyles: string;
|
|
385
|
+
});
|
|
357
386
|
}
|
|
358
387
|
|
|
359
388
|
export declare enum ThemeMode {
|
|
@@ -511,6 +540,15 @@ export declare interface ThemeModeConfig {
|
|
|
511
540
|
fillEffectColor: string;
|
|
512
541
|
value: string;
|
|
513
542
|
};
|
|
543
|
+
dropdown: {
|
|
544
|
+
trigger: string;
|
|
545
|
+
item: string;
|
|
546
|
+
};
|
|
547
|
+
switch: {
|
|
548
|
+
primary: string;
|
|
549
|
+
secondary: string;
|
|
550
|
+
disabled: string;
|
|
551
|
+
};
|
|
514
552
|
}
|
|
515
553
|
|
|
516
554
|
export declare const ThemeProvider: default_2.FC<{
|
|
@@ -522,6 +560,33 @@ export declare enum ThumbnailShape {
|
|
|
522
560
|
Circle = "circle"
|
|
523
561
|
}
|
|
524
562
|
|
|
563
|
+
export declare const TigerAccordion: default_2.FC<TigerAccordionProps>;
|
|
564
|
+
|
|
565
|
+
export declare const TigerAccordionItem: ({ id, title, content, disabled, icon, }: TigerAccordionItemConfig) => {
|
|
566
|
+
id: string;
|
|
567
|
+
title: default_2.ReactNode;
|
|
568
|
+
content: default_2.ReactNode;
|
|
569
|
+
disabled: boolean;
|
|
570
|
+
icon: default_2.ReactNode;
|
|
571
|
+
};
|
|
572
|
+
|
|
573
|
+
export declare interface TigerAccordionItemConfig {
|
|
574
|
+
id: string;
|
|
575
|
+
title: ReactNode;
|
|
576
|
+
content: ReactNode;
|
|
577
|
+
disabled?: boolean;
|
|
578
|
+
icon?: default_2.ReactNode;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
export declare interface TigerAccordionProps {
|
|
582
|
+
items: TigerAccordionItemConfig[];
|
|
583
|
+
defaultExpandedId?: string;
|
|
584
|
+
onExpandedChange?: (id: string) => void;
|
|
585
|
+
allowMultiple?: boolean;
|
|
586
|
+
size?: ComponentSize;
|
|
587
|
+
className?: string;
|
|
588
|
+
}
|
|
589
|
+
|
|
525
590
|
export declare const TigerBadge: default_2.FC<TigerBadgeProps>;
|
|
526
591
|
|
|
527
592
|
declare interface TigerBadgeProps extends BaseComponentProps {
|
|
@@ -556,6 +621,31 @@ declare interface TigerCheckboxProps extends BaseComponentProps {
|
|
|
556
621
|
disabled?: boolean;
|
|
557
622
|
}
|
|
558
623
|
|
|
624
|
+
export declare const TigerDropdown: default_2.FC<TigerDropdownProps>;
|
|
625
|
+
|
|
626
|
+
export declare const TigerDropdownContent: default_2.FC<TigerDropdownContentProps>;
|
|
627
|
+
|
|
628
|
+
declare interface TigerDropdownContentProps extends default_2.HTMLAttributes<HTMLDivElement> {
|
|
629
|
+
size?: Exclude<ComponentSize, ComponentSize.Xsmall>;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
export declare const TigerDropdownItem: default_2.FC<TigerDropdownItemProps>;
|
|
633
|
+
|
|
634
|
+
declare interface TigerDropdownItemProps extends default_2.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
635
|
+
value?: string;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
declare interface TigerDropdownProps extends SizedComponentProps {
|
|
639
|
+
defaultOpen?: boolean;
|
|
640
|
+
size?: Exclude<ComponentSize, ComponentSize.Xsmall>;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
export declare const TigerDropdownTrigger: default_2.FC<TigerDropdownTriggerProps>;
|
|
644
|
+
|
|
645
|
+
declare interface TigerDropdownTriggerProps extends default_2.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
646
|
+
label?: string;
|
|
647
|
+
}
|
|
648
|
+
|
|
559
649
|
export declare const TigerGlassContainer: default_2.FC<TigerGlassContainerProps>;
|
|
560
650
|
|
|
561
651
|
declare interface TigerGlassContainerProps extends BaseComponentProps, default_2.HTMLAttributes<HTMLDivElement> {
|
|
@@ -564,15 +654,10 @@ declare interface TigerGlassContainerProps extends BaseComponentProps, default_2
|
|
|
564
654
|
|
|
565
655
|
export declare const TigerIconButton: default_2.FC<IconButtonProps>;
|
|
566
656
|
|
|
567
|
-
export declare const TigerInput:
|
|
657
|
+
export declare const TigerInput: ForwardRefExoticComponent<TigerInputProps & RefAttributes<HTMLInputElement>>;
|
|
568
658
|
|
|
569
|
-
declare interface TigerInputProps extends Omit<
|
|
659
|
+
export declare interface TigerInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'className' | 'style'>, BaseComponentProps {
|
|
570
660
|
size?: Exclude<ComponentSize, ComponentSize.Xsmall>;
|
|
571
|
-
type?: string;
|
|
572
|
-
placeholder?: string;
|
|
573
|
-
disabled?: boolean;
|
|
574
|
-
value?: string | number | readonly string[];
|
|
575
|
-
onChange?: (e: default_2.ChangeEvent<HTMLInputElement>) => void;
|
|
576
661
|
}
|
|
577
662
|
|
|
578
663
|
export declare const TigerList: default_2.FC<TigerListProps>;
|
|
@@ -642,6 +727,24 @@ declare interface TigerStackProps {
|
|
|
642
727
|
className?: string;
|
|
643
728
|
}
|
|
644
729
|
|
|
730
|
+
export declare const TigerSwitch: default_2.FC<TigerSwitchProps>;
|
|
731
|
+
|
|
732
|
+
export declare enum TigerSwitchColor {
|
|
733
|
+
Primary = "primary",
|
|
734
|
+
Secondary = "secondary",
|
|
735
|
+
Disabled = "disabled"
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
export declare interface TigerSwitchProps extends BaseComponentProps {
|
|
739
|
+
checked: boolean;
|
|
740
|
+
onChange: (checked: boolean) => void;
|
|
741
|
+
disabled?: boolean;
|
|
742
|
+
size?: ComponentSize.Small | ComponentSize.Medium | ComponentSize.Large;
|
|
743
|
+
color?: TigerSwitchColor;
|
|
744
|
+
label?: string;
|
|
745
|
+
description?: string;
|
|
746
|
+
}
|
|
747
|
+
|
|
645
748
|
export declare interface TigerTabItem {
|
|
646
749
|
id: string;
|
|
647
750
|
label: default_2.ReactNode;
|
|
@@ -735,6 +838,15 @@ declare interface TigerToastProps extends TigerToastItem {
|
|
|
735
838
|
|
|
736
839
|
declare type TigerToastType = 'success' | 'error' | 'info' | 'warning' | 'neutral';
|
|
737
840
|
|
|
841
|
+
export declare const TigerTopBar: default_2.FC<TigerTopBarProps>;
|
|
842
|
+
|
|
843
|
+
export declare interface TigerTopBarProps {
|
|
844
|
+
title?: string;
|
|
845
|
+
subtitle?: string;
|
|
846
|
+
actions?: default_2.ReactNode;
|
|
847
|
+
className?: string;
|
|
848
|
+
}
|
|
849
|
+
|
|
738
850
|
export declare const TigerTr: default_2.FC<TigerTrProps>;
|
|
739
851
|
|
|
740
852
|
declare interface TigerTrProps extends BaseComponentProps {
|