anima-ds-nucleus 1.0.0

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.
Files changed (116) hide show
  1. package/LICENSE.md +20 -0
  2. package/README.md +109 -0
  3. package/dist/anima-ds.cjs.js +1332 -0
  4. package/dist/anima-ds.esm.js +88297 -0
  5. package/dist/vite.svg +1 -0
  6. package/package.json +76 -0
  7. package/src/assets/charly.png +0 -0
  8. package/src/components/Atoms/Alert/Alert.jsx +52 -0
  9. package/src/components/Atoms/Alert/Alert.stories.jsx +62 -0
  10. package/src/components/Atoms/Avatar/Avatar.jsx +60 -0
  11. package/src/components/Atoms/Avatar/Avatar.stories.jsx +61 -0
  12. package/src/components/Atoms/Badge/Badge.jsx +34 -0
  13. package/src/components/Atoms/Badge/Badge.stories.jsx +55 -0
  14. package/src/components/Atoms/Button/Button.jsx +281 -0
  15. package/src/components/Atoms/Button/Button.stories.jsx +365 -0
  16. package/src/components/Atoms/Divider/Divider.jsx +49 -0
  17. package/src/components/Atoms/Divider/Divider.stories.jsx +62 -0
  18. package/src/components/Atoms/Icon/Icon.jsx +361 -0
  19. package/src/components/Atoms/Icon/Icon.stories.jsx +115 -0
  20. package/src/components/Atoms/Label/Label.jsx +22 -0
  21. package/src/components/Atoms/Progress/Progress.jsx +49 -0
  22. package/src/components/Atoms/Progress/Progress.stories.jsx +88 -0
  23. package/src/components/Atoms/Radios/Radios.jsx +39 -0
  24. package/src/components/Atoms/Radios/Radios.stories.jsx +119 -0
  25. package/src/components/Atoms/Shadow/Shadow.stories.jsx +25 -0
  26. package/src/components/Atoms/Skeleton/Skeleton.jsx +50 -0
  27. package/src/components/Atoms/Skeleton/Skeleton.stories.jsx +55 -0
  28. package/src/components/Atoms/Spacing/Spacing.jsx +56 -0
  29. package/src/components/Atoms/Spacing/Spacing.stories.jsx +78 -0
  30. package/src/components/Atoms/Spinner/Spinner.jsx +47 -0
  31. package/src/components/Atoms/Spinner/Spinner.stories.jsx +56 -0
  32. package/src/components/Atoms/Toast/Toast.jsx +74 -0
  33. package/src/components/Atoms/Toast/Toast.stories.jsx +101 -0
  34. package/src/components/Atoms/Tooltip/Tooltip.jsx +49 -0
  35. package/src/components/Atoms/Tooltip/Tooltip.stories.jsx +58 -0
  36. package/src/components/Atoms/Typography/Typography.jsx +52 -0
  37. package/src/components/Atoms/Typography/Typography.stories.jsx +267 -0
  38. package/src/components/DataDisplay/AreaChart/AreaChart.jsx +95 -0
  39. package/src/components/DataDisplay/AreaChart/AreaChart.stories.jsx +51 -0
  40. package/src/components/DataDisplay/BarChart/BarChart.jsx +90 -0
  41. package/src/components/DataDisplay/BarChart/BarChart.stories.jsx +60 -0
  42. package/src/components/DataDisplay/Card/Card.jsx +31 -0
  43. package/src/components/DataDisplay/Card/Card.stories.jsx +50 -0
  44. package/src/components/DataDisplay/ColumnChart/ColumnChart.jsx +92 -0
  45. package/src/components/DataDisplay/ColumnChart/ColumnChart.stories.jsx +65 -0
  46. package/src/components/DataDisplay/DBGrid/DBGrid.jsx +138 -0
  47. package/src/components/DataDisplay/DBGrid/DBGrid.stories.jsx +126 -0
  48. package/src/components/DataDisplay/DonutChart/DonutChart.jsx +83 -0
  49. package/src/components/DataDisplay/DonutChart/DonutChart.stories.jsx +48 -0
  50. package/src/components/DataDisplay/EmptyState/EmptyState.jsx +30 -0
  51. package/src/components/DataDisplay/EmptyState/EmptyState.stories.jsx +42 -0
  52. package/src/components/DataDisplay/LineChart/LineChart.jsx +86 -0
  53. package/src/components/DataDisplay/LineChart/LineChart.stories.jsx +67 -0
  54. package/src/components/DataDisplay/List/List.jsx +30 -0
  55. package/src/components/DataDisplay/List/List.stories.jsx +59 -0
  56. package/src/components/DataDisplay/PieChart/PieChart.jsx +64 -0
  57. package/src/components/DataDisplay/PieChart/PieChart.stories.jsx +47 -0
  58. package/src/components/DataDisplay/StatCard/StatCard.jsx +55 -0
  59. package/src/components/DataDisplay/StatCard/StatCard.stories.jsx +59 -0
  60. package/src/components/DataDisplay/TagList/TagList.jsx +37 -0
  61. package/src/components/DataDisplay/TagList/TagList.stories.jsx +48 -0
  62. package/src/components/DataDisplay/Timeline/Timeline.jsx +41 -0
  63. package/src/components/DataDisplay/Timeline/Timeline.stories.jsx +64 -0
  64. package/src/components/Inputs/Checkbox/Checkbox.jsx +27 -0
  65. package/src/components/Inputs/Checkbox/Checkbox.stories.jsx +51 -0
  66. package/src/components/Inputs/DatePicker/DatePicker.jsx +55 -0
  67. package/src/components/Inputs/DatePicker/DatePicker.stories.jsx +52 -0
  68. package/src/components/Inputs/FileUpload/FileUpload.jsx +108 -0
  69. package/src/components/Inputs/FileUpload/FileUpload.stories.jsx +52 -0
  70. package/src/components/Inputs/Input/Input.jsx +50 -0
  71. package/src/components/Inputs/Input/Input.stories.jsx +63 -0
  72. package/src/components/Inputs/RadioButton/RadioButton.jsx +31 -0
  73. package/src/components/Inputs/RadioButton/RadioButton.stories.jsx +59 -0
  74. package/src/components/Inputs/Select/Select.jsx +59 -0
  75. package/src/components/Inputs/Select/Select.stories.jsx +66 -0
  76. package/src/components/Inputs/Switch/Switch.jsx +44 -0
  77. package/src/components/Inputs/Switch/Switch.stories.jsx +51 -0
  78. package/src/components/Inputs/Textarea/Textarea.jsx +51 -0
  79. package/src/components/Inputs/Textarea/Textarea.stories.jsx +65 -0
  80. package/src/components/Layout/Accordion/Accordion.jsx +58 -0
  81. package/src/components/Layout/Accordion/Accordion.stories.jsx +55 -0
  82. package/src/components/Layout/Breadcrumbs/Breadcrumbs.jsx +49 -0
  83. package/src/components/Layout/Breadcrumbs/Breadcrumbs.stories.jsx +44 -0
  84. package/src/components/Layout/Breakpoint/Breakpoint.jsx +35 -0
  85. package/src/components/Layout/Breakpoint/Breakpoint.stories.jsx +348 -0
  86. package/src/components/Layout/Drawer/Drawer.jsx +75 -0
  87. package/src/components/Layout/Drawer/Drawer.stories.jsx +77 -0
  88. package/src/components/Layout/Dropdown/Dropdown.jsx +83 -0
  89. package/src/components/Layout/Dropdown/Dropdown.stories.jsx +53 -0
  90. package/src/components/Layout/Grid/Grid.jsx +39 -0
  91. package/src/components/Layout/Grid/Grid.stories.jsx +546 -0
  92. package/src/components/Layout/Header/Header.jsx +50 -0
  93. package/src/components/Layout/Header/Header.stories.jsx +36 -0
  94. package/src/components/Layout/Layout/Layout.jsx +14 -0
  95. package/src/components/Layout/Layout/Layout.stories.jsx +34 -0
  96. package/src/components/Layout/Modal/Modal.jsx +78 -0
  97. package/src/components/Layout/Modal/Modal.stories.jsx +98 -0
  98. package/src/components/Layout/Pagination/Pagination.jsx +109 -0
  99. package/src/components/Layout/Pagination/Pagination.stories.jsx +62 -0
  100. package/src/components/Layout/Sidebar/Sidebar.jsx +57 -0
  101. package/src/components/Layout/Sidebar/Sidebar.stories.jsx +51 -0
  102. package/src/components/Layout/Stepper/Stepper.jsx +132 -0
  103. package/src/components/Layout/Stepper/Stepper.stories.jsx +78 -0
  104. package/src/components/Layout/Tabs/Tabs.jsx +63 -0
  105. package/src/components/Layout/Tabs/Tabs.stories.jsx +62 -0
  106. package/src/components/Views/ChangePasswordForm/ChangePasswordForm.jsx +125 -0
  107. package/src/components/Views/ChangePasswordForm/ChangePasswordForm.stories.jsx +55 -0
  108. package/src/components/Views/Chat/Chat.jsx +134 -0
  109. package/src/components/Views/Chat/Chat.stories.jsx +143 -0
  110. package/src/components/Views/LoginForm/LoginForm.jsx +98 -0
  111. package/src/components/Views/LoginForm/LoginForm.stories.jsx +55 -0
  112. package/src/i18n/config.js +209 -0
  113. package/src/index.js +60 -0
  114. package/src/main.jsx +510 -0
  115. package/src/providers/I18nProvider.jsx +13 -0
  116. package/src/style.css +721 -0
@@ -0,0 +1,49 @@
1
+ import { useState } from 'react';
2
+
3
+ export const Tooltip = ({
4
+ content,
5
+ children,
6
+ position = 'top',
7
+ className = '',
8
+ ...props
9
+ }) => {
10
+ const [isVisible, setIsVisible] = useState(false);
11
+
12
+ const positionClasses = {
13
+ top: 'bottom-full left-1/2 transform -translate-x-1/2 mb-2',
14
+ bottom: 'top-full left-1/2 transform -translate-x-1/2 mt-2',
15
+ left: 'right-full top-1/2 transform -translate-y-1/2 mr-2',
16
+ right: 'left-full top-1/2 transform -translate-y-1/2 ml-2',
17
+ };
18
+
19
+ const arrowClasses = {
20
+ top: 'top-full left-1/2 transform -translate-x-1/2 border-t-gray-900',
21
+ bottom: 'bottom-full left-1/2 transform -translate-x-1/2 border-b-gray-900',
22
+ left: 'left-full top-1/2 transform -translate-y-1/2 border-l-gray-900',
23
+ right: 'right-full top-1/2 transform -translate-y-1/2 border-r-gray-900',
24
+ };
25
+
26
+ return (
27
+ <div
28
+ className={`relative inline-block ${className}`}
29
+ onMouseEnter={() => setIsVisible(true)}
30
+ onMouseLeave={() => setIsVisible(false)}
31
+ {...props}
32
+ >
33
+ {children}
34
+ {isVisible && (
35
+ <div
36
+ className={`absolute z-50 px-4 py-3 text-sm text-white bg-gray-900 rounded-lg shadow-lg whitespace-nowrap ${positionClasses[position]}`}
37
+ >
38
+ {content}
39
+ <div
40
+ className={`absolute w-0 h-0 border-4 ${arrowClasses[position]}`}
41
+ />
42
+ </div>
43
+ )}
44
+ </div>
45
+ );
46
+ };
47
+
48
+ export default Tooltip;
49
+
@@ -0,0 +1,58 @@
1
+ import { Tooltip } from './Tooltip';
2
+ import { Button } from '../Button/Button';
3
+ import { Icon } from '../Icon/Icon';
4
+
5
+ export default {
6
+ title: 'Atoms/Tooltip',
7
+ component: Tooltip,
8
+ tags: ['autodocs'],
9
+ argTypes: {
10
+ position: {
11
+ control: 'select',
12
+ options: ['top', 'bottom', 'left', 'right'],
13
+ },
14
+ },
15
+ };
16
+
17
+ export const Top = {
18
+ args: {
19
+ content: 'Este es un tooltip en la parte superior',
20
+ position: 'top',
21
+ children: <Button>Pasa el mouse aquí</Button>,
22
+ },
23
+ };
24
+
25
+ export const Bottom = {
26
+ args: {
27
+ content: 'Este es un tooltip en la parte inferior',
28
+ position: 'bottom',
29
+ children: <Button>Pasa el mouse aquí</Button>,
30
+ },
31
+ };
32
+
33
+ export const Left = {
34
+ args: {
35
+ content: 'Este es un tooltip a la izquierda',
36
+ position: 'left',
37
+ children: <Button>Pasa el mouse aquí</Button>,
38
+ },
39
+ };
40
+
41
+ export const Right = {
42
+ args: {
43
+ content: 'Este es un tooltip a la derecha',
44
+ position: 'right',
45
+ children: <Button>Pasa el mouse aquí</Button>,
46
+ },
47
+ };
48
+
49
+ export const WithIcon = {
50
+ render: () => (
51
+ <Tooltip content="Información adicional">
52
+ <button className="p-2 rounded-full hover:bg-gray-100">
53
+ <Icon name="InformationCircleIcon" className="h-5 w-5 text-gray-500" />
54
+ </button>
55
+ </Tooltip>
56
+ ),
57
+ };
58
+
@@ -0,0 +1,52 @@
1
+ export const Typography = ({
2
+ variant = 'body1',
3
+ component,
4
+ children,
5
+ className = '',
6
+ weight,
7
+ color,
8
+ ...props
9
+ }) => {
10
+ // Clases genéricas basadas en Figma - Usando las clases predefinidas
11
+ const variantClasses = {
12
+ pruebaColor: 'text-4xl font-bold text-brand-600',
13
+ h1: 'text-4xl font-bold',
14
+ h2: 'text-3xl font-bold',
15
+ h3: 'text-2xl font-semibold',
16
+ h4: 'text-xl font-semibold',
17
+ h5: 'text-lg font-medium',
18
+ h6: 'text-base font-medium',
19
+ body1: 'text-base',
20
+ body2: 'text-sm',
21
+ caption: 'text-xs text-gray-600',
22
+ overline: 'text-xs uppercase tracking-wide',
23
+ };
24
+
25
+ const Component = component || (variant.startsWith('h') ? variant : 'p');
26
+
27
+ // Construir clases base
28
+ let baseClasses = variantClasses[variant] || variantClasses.body1;
29
+
30
+ // Si se especifica un peso, agregarlo
31
+ if (weight && weightClasses[weight]) {
32
+ baseClasses = `${baseClasses} ${weightClasses[weight]}`;
33
+ }
34
+
35
+ // Si se especifica un color, agregarlo (remover color por defecto si existe, como en caption)
36
+ if (color && colorClasses[color]) {
37
+ // Remover cualquier color previo de las clases base
38
+ baseClasses = baseClasses.replace(/color-\w+(-\w+)?/g, '');
39
+ baseClasses = `${baseClasses} ${colorClasses[color]}`.trim();
40
+ }
41
+
42
+ const classes = `${baseClasses} ${className}`.trim();
43
+
44
+ return (
45
+ <Component className={classes} {...props}>
46
+ {children}
47
+ </Component>
48
+ );
49
+ };
50
+
51
+ export default Typography;
52
+
@@ -0,0 +1,267 @@
1
+ import { Typography } from './Typography';
2
+
3
+ export default {
4
+ title: 'Atoms/Typography',
5
+ component: Typography,
6
+ tags: ['autodocs'],
7
+ argTypes: {
8
+ variant: {
9
+ control: 'select',
10
+ options: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'body-lg', 'body-md', 'body-sm', 'body1', 'body2', 'caption', 'overline'],
11
+ },
12
+ weight: {
13
+ control: 'select',
14
+ options: ['light', 'regular', 'medium', 'semibold', 'bold'],
15
+ },
16
+ color: {
17
+ control: 'select',
18
+ options: ['black', 'white', 'gray-900', 'gray-700', 'gray-600', 'gray-500', 'gray-400', 'red-600', 'red-500', 'blue-600', 'green-600', 'green-100'],
19
+ description: 'Color del texto usando clases genéricas predefinidas',
20
+ },
21
+ },
22
+ };
23
+
24
+ // Ejemplos usando el componente Typography
25
+ export const Heading1 = {
26
+ args: {
27
+ variant: 'pruebaColor',
28
+ children: 'Heading 1',
29
+ },
30
+ };
31
+
32
+ export const Heading2 = {
33
+ args: {
34
+ variant: 'h2',
35
+ children: 'Heading 2 - IBM Plex Sans 36/54 Bold',
36
+ },
37
+ };
38
+
39
+ export const Heading3 = {
40
+ args: {
41
+ variant: 'h3',
42
+ children: 'Heading 3 - IBM Plex Sans 32/48 Semi Bold',
43
+ },
44
+ };
45
+
46
+ export const Heading4 = {
47
+ args: {
48
+ variant: 'h4',
49
+ children: 'Heading 4 - IBM Plex Sans 28/42 Semi Bold',
50
+ },
51
+ };
52
+
53
+ export const Heading5 = {
54
+ args: {
55
+ variant: 'h5',
56
+ children: 'Heading 5 - IBM Plex Sans 24/36 Medium',
57
+ },
58
+ };
59
+
60
+ export const Heading6 = {
61
+ args: {
62
+ variant: 'h6',
63
+ children: 'Heading 6 - IBM Plex Sans 20/30 Medium',
64
+ },
65
+ };
66
+
67
+ export const BodyLarge = {
68
+ args: {
69
+ variant: 'body-lg',
70
+ children: 'Body Large - IBM Plex Sans 16/24 Regular. Este es un texto de ejemplo que muestra el estilo body-lg.',
71
+ },
72
+ };
73
+
74
+ export const BodyMedium = {
75
+ args: {
76
+ variant: 'body-md',
77
+ children: 'Body Medium - IBM Plex Sans 14/21 Regular (-1%). Este es un texto de ejemplo que muestra el estilo body-md con letter-spacing ajustado.',
78
+ },
79
+ };
80
+
81
+ export const BodySmall = {
82
+ args: {
83
+ variant: 'body-sm',
84
+ children: 'Body Small - IBM Plex Sans 12/18 Regular (-2%). Este es un texto pequeño con letter-spacing ajustado.',
85
+ },
86
+ };
87
+
88
+ export const Body1 = {
89
+ args: {
90
+ variant: 'body1',
91
+ children: 'Body 1 (Alias de body-lg) - IBM Plex Sans 16/24 Regular',
92
+ },
93
+ };
94
+
95
+ export const Body2 = {
96
+ args: {
97
+ variant: 'body2',
98
+ children: 'Body 2 (Alias de body-md) - IBM Plex Sans 14/21 Regular',
99
+ },
100
+ };
101
+
102
+ export const Caption = {
103
+ args: {
104
+ variant: 'caption',
105
+ children: 'Caption - IBM Plex Sans 12/18 con color gris',
106
+ },
107
+ };
108
+
109
+ export const Overline = {
110
+ args: {
111
+ variant: 'overline',
112
+ children: 'OVERLINE TEXT',
113
+ },
114
+ };
115
+
116
+ // Ejemplos con clases genéricas directamente (sin componente)
117
+ export const ClasesGenericasHeadings = () => (
118
+ <div className="space-y-4">
119
+ <h1 className="text-h1">Clase text-h1 - 40px/60px Bold</h1>
120
+ <h2 className="text-h2">Clase text-h2 - 36px/54px Bold</h2>
121
+ <h3 className="text-h3">Clase text-h3 - 32px/48px Semi Bold</h3>
122
+ <h4 className="text-h4">Clase text-h4 - 28px/42px Semi Bold</h4>
123
+ <h5 className="text-h5">Clase text-h5 - 24px/36px Medium</h5>
124
+ <h6 className="text-h6">Clase text-h6 - 20px/30px Medium</h6>
125
+ </div>
126
+ );
127
+
128
+ export const ClasesGenericasBody = () => (
129
+ <div className="space-y-4">
130
+ <p className="text-body-lg">Clase text-body-lg - 16px/24px Regular</p>
131
+ <p className="text-body-md">Clase text-body-md - 14px/21px Regular (-1%)</p>
132
+ <p className="text-body-sm">Clase text-body-sm - 12px/18px Regular (-2%)</p>
133
+ </div>
134
+ );
135
+
136
+ export const ClasesDeColores = () => (
137
+ <div className="space-y-3 bg-gray-50 p-6 rounded-lg">
138
+ <p className="text-body-lg color-black">Color black - color-black</p>
139
+ <p className="text-body-lg color-gray-900">Color gray 900 - color-gray-900</p>
140
+ <p className="text-body-lg color-gray-700">Color gray 700 - color-gray-700</p>
141
+ <p className="text-body-lg color-gray-600">Color gray 600 - color-gray-600</p>
142
+ <p className="text-body-lg color-gray-500">Color gray 500 - color-gray-500</p>
143
+ <p className="text-body-lg color-red-600">Color red 600 - color-red-600</p>
144
+ <p className="text-body-lg color-blue-600">Color blue 600 - color-blue-600</p>
145
+ <p className="text-body-lg color-green-600">Color green 600 - color-green-600</p>
146
+ <p className="text-body-lg bg-gray-900 color-white p-2 rounded">Color white - color-white (con fondo oscuro)</p>
147
+ </div>
148
+ );
149
+
150
+ export const NumerosConPlexMono = () => (
151
+ <div className="space-y-4">
152
+ <p className="text-body-lg">Números con fuente IBM Plex Mono:</p>
153
+ <p className="text-body-lg font-numbers text-2xl">1234567890</p>
154
+ <p className="text-body-lg text-numbers text-2xl color-blue-600">9876543210</p>
155
+ <p className="text-body-lg">
156
+ Precio: <span className="font-numbers color-green-600 font-bold">$1,234.56</span>
157
+ </p>
158
+ <p className="text-body-lg">
159
+ Código: <span className="text-numbers color-gray-600">ABC-123-XYZ</span>
160
+ </p>
161
+ </div>
162
+ );
163
+
164
+ export const PesosPermitidos = () => (
165
+ <div className="space-y-3">
166
+ <p className="text-body-lg font-light">Font Light (300)</p>
167
+ <p className="text-body-lg font-regular">Font Regular (400)</p>
168
+ <p className="text-body-lg font-medium">Font Medium (500)</p>
169
+ <p className="text-body-lg font-semibold">Font Semi Bold (600)</p>
170
+ <p className="text-body-lg font-bold">Font Bold (700)</p>
171
+ </div>
172
+ );
173
+
174
+ export const EjemplosCombinados = () => (
175
+ <div className="space-y-6 p-6">
176
+ <div>
177
+ <h1 className="text-h1 color-black">Título Principal</h1>
178
+ <p className="text-body-lg color-gray-600 mt-2">Subtítulo o descripción con color gris</p>
179
+ </div>
180
+
181
+ <div className="border-t pt-4">
182
+ <h2 className="text-h3 color-gray-900 font-bold">Sección Importante</h2>
183
+ <p className="text-body-md color-gray-700 mt-2">
184
+ Este es un ejemplo de texto body-md combinado con colores.
185
+ Puedes usar múltiples clases genéricas juntas.
186
+ </p>
187
+ </div>
188
+
189
+ <div className="border-t pt-4">
190
+ <h3 className="text-h5 color-blue-600">Con Color Personalizado</h3>
191
+ <p className="text-body-sm color-gray-500 mt-1">
192
+ Texto pequeño con estilo personalizado.
193
+ </p>
194
+ </div>
195
+
196
+ <div className="border-t pt-4 bg-gray-50 p-4 rounded">
197
+ <p className="text-body-lg font-semibold color-black">Ejemplo con peso Semi Bold:</p>
198
+ <p className="text-body-md color-gray-600 mt-2">
199
+ Número de teléfono: <span className="text-numbers color-blue-600 font-medium">+54 11 1234-5678</span>
200
+ </p>
201
+ </div>
202
+ </div>
203
+ );
204
+
205
+ export const ConPropColor = () => (
206
+ <div className="space-y-4 p-6">
207
+ <Typography variant="h1" color="black">
208
+ H1 con color black (prop)
209
+ </Typography>
210
+ <Typography variant="h2" color="gray-700">
211
+ H2 con color gray-700 (prop)
212
+ </Typography>
213
+ <Typography variant="h3" color="blue-600">
214
+ H3 con color blue-600 (prop)
215
+ </Typography>
216
+ <Typography variant="body-lg" color="gray-600">
217
+ Body Large con color gray-600 usando el prop color
218
+ </Typography>
219
+ <Typography variant="body-md" color="red-600">
220
+ Body Medium con color red-600 usando el prop color
221
+ </Typography>
222
+ <div className="bg-gray-900 p-4 rounded mt-4">
223
+ <Typography variant="h4" color="white">
224
+ H4 con color white sobre fondo oscuro
225
+ </Typography>
226
+ </div>
227
+ </div>
228
+ );
229
+
230
+ export const ColorConClassName = () => (
231
+ <div className="space-y-4 p-6">
232
+ <Typography variant="h1" className="color-black">
233
+ H1 con color usando className
234
+ </Typography>
235
+ <Typography variant="body-lg" className="color-blue-600">
236
+ Body con color blue usando className
237
+ </Typography>
238
+ <Typography variant="body-md" className="color-red-600">
239
+ También puedes combinar: <span className="color-green-600">colores diferentes</span> dentro del mismo componente
240
+ </Typography>
241
+ </div>
242
+ );
243
+
244
+ export const ComparacionAntesDespues = () => (
245
+ <div className="space-y-8 p-6">
246
+ <div>
247
+ <h3 className="text-h4 color-gray-900 mb-4">Antes (con Tailwind directo):</h3>
248
+ <p className="text-2xl font-bold text-gray-900">Texto con clases Tailwind</p>
249
+ </div>
250
+
251
+ <div>
252
+ <h3 className="text-h4 color-gray-900 mb-4">Ahora (con clases genéricas):</h3>
253
+ <p className="text-h3 color-black">Texto con clases genéricas</p>
254
+ <p className="text-body-lg color-gray-600 mt-2">
255
+ Ahora puedes usar: <code className="bg-gray-100 px-2 py-1 rounded">text-h3 color-black</code>
256
+ </p>
257
+ </div>
258
+
259
+ <div>
260
+ <h3 className="text-h4 color-gray-900 mb-4">O usando el prop color:</h3>
261
+ <Typography variant="h3" color="black">
262
+ Typography con prop color="black"
263
+ </Typography>
264
+ </div>
265
+ </div>
266
+ );
267
+
@@ -0,0 +1,95 @@
1
+ import { useMemo } from 'react';
2
+ import Chart from 'react-apexcharts';
3
+
4
+ export const AreaChart = ({
5
+ series = [],
6
+ categories = [],
7
+ title = '',
8
+ height = 350,
9
+ colors = ['#3B82F6', '#10B981', '#F59E0B', '#EF4444', '#8B5CF6'],
10
+ showLegend = true,
11
+ showToolbar = true,
12
+ className = '',
13
+ ...props
14
+ }) => {
15
+ const chartOptions = useMemo(() => ({
16
+ chart: {
17
+ type: 'area',
18
+ height: height,
19
+ toolbar: {
20
+ show: showToolbar,
21
+ tools: {
22
+ download: true,
23
+ selection: true,
24
+ zoom: true,
25
+ zoomin: true,
26
+ zoomout: true,
27
+ pan: true,
28
+ reset: true,
29
+ },
30
+ },
31
+ },
32
+ colors: colors,
33
+ stroke: {
34
+ curve: 'smooth',
35
+ width: 2,
36
+ },
37
+ fill: {
38
+ type: 'gradient',
39
+ gradient: {
40
+ shadeIntensity: 1,
41
+ opacityFrom: 0.7,
42
+ opacityTo: 0.3,
43
+ stops: [0, 90, 100],
44
+ },
45
+ },
46
+ xaxis: {
47
+ categories: categories,
48
+ labels: {
49
+ style: {
50
+ colors: '#6B7280',
51
+ },
52
+ },
53
+ },
54
+ yaxis: {
55
+ labels: {
56
+ style: {
57
+ colors: '#6B7280',
58
+ },
59
+ },
60
+ },
61
+ legend: {
62
+ show: showLegend,
63
+ position: 'top',
64
+ horizontalAlign: 'center',
65
+ },
66
+ grid: {
67
+ borderColor: '#E5E7EB',
68
+ strokeDashArray: 4,
69
+ },
70
+ tooltip: {
71
+ theme: 'light',
72
+ },
73
+ dataLabels: {
74
+ enabled: false,
75
+ },
76
+ }), [categories, colors, height, showLegend, showToolbar]);
77
+
78
+ return (
79
+ <div className={className}>
80
+ {title && (
81
+ <h3 className="text-lg font-semibold text-gray-900 mb-4">{title}</h3>
82
+ )}
83
+ <Chart
84
+ options={chartOptions}
85
+ series={series}
86
+ type="area"
87
+ height={height}
88
+ {...props}
89
+ />
90
+ </div>
91
+ );
92
+ };
93
+
94
+ export default AreaChart;
95
+
@@ -0,0 +1,51 @@
1
+ import { AreaChart } from './AreaChart';
2
+
3
+ const sampleSeries = [
4
+ {
5
+ name: 'Ingresos',
6
+ data: [31, 40, 28, 51, 42, 109, 100],
7
+ },
8
+ {
9
+ name: 'Gastos',
10
+ data: [11, 32, 45, 32, 34, 52, 41],
11
+ },
12
+ ];
13
+
14
+ const sampleCategories = ['Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb', 'Dom'];
15
+
16
+ export default {
17
+ title: 'DataDisplay/AreaChart',
18
+ component: AreaChart,
19
+ tags: ['autodocs'],
20
+ };
21
+
22
+ export const Default = {
23
+ args: {
24
+ series: sampleSeries,
25
+ categories: sampleCategories,
26
+ title: 'Gráfico de Área',
27
+ },
28
+ };
29
+
30
+ export const SingleSeries = {
31
+ args: {
32
+ series: [
33
+ {
34
+ name: 'Ventas',
35
+ data: [30, 40, 35, 50, 49, 60, 70, 91, 125],
36
+ },
37
+ ],
38
+ categories: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep'],
39
+ title: 'Ventas Mensuales',
40
+ },
41
+ };
42
+
43
+ export const CustomColors = {
44
+ args: {
45
+ series: sampleSeries,
46
+ categories: sampleCategories,
47
+ title: 'Gráfico con Colores Personalizados',
48
+ colors: ['#8B5CF6', '#F59E0B'],
49
+ },
50
+ };
51
+
@@ -0,0 +1,90 @@
1
+ import { useMemo } from 'react';
2
+ import Chart from 'react-apexcharts';
3
+
4
+ export const BarChart = ({
5
+ series = [],
6
+ categories = [],
7
+ title = '',
8
+ height = 350,
9
+ colors = ['#3B82F6', '#10B981', '#F59E0B', '#EF4444', '#8B5CF6'],
10
+ showLegend = true,
11
+ showToolbar = true,
12
+ horizontal = false,
13
+ className = '',
14
+ ...props
15
+ }) => {
16
+ const chartOptions = useMemo(() => ({
17
+ chart: {
18
+ type: 'bar',
19
+ height: height,
20
+ toolbar: {
21
+ show: showToolbar,
22
+ tools: {
23
+ download: true,
24
+ selection: true,
25
+ zoom: true,
26
+ zoomin: true,
27
+ zoomout: true,
28
+ pan: true,
29
+ reset: true,
30
+ },
31
+ },
32
+ },
33
+ colors: colors,
34
+ plotOptions: {
35
+ bar: {
36
+ horizontal: horizontal,
37
+ borderRadius: 4,
38
+ columnWidth: '55%',
39
+ },
40
+ },
41
+ xaxis: {
42
+ categories: categories,
43
+ labels: {
44
+ style: {
45
+ colors: '#6B7280',
46
+ },
47
+ },
48
+ },
49
+ yaxis: {
50
+ labels: {
51
+ style: {
52
+ colors: '#6B7280',
53
+ },
54
+ },
55
+ },
56
+ legend: {
57
+ show: showLegend,
58
+ position: 'top',
59
+ horizontalAlign: 'center',
60
+ },
61
+ grid: {
62
+ borderColor: '#E5E7EB',
63
+ strokeDashArray: 4,
64
+ },
65
+ tooltip: {
66
+ theme: 'light',
67
+ },
68
+ dataLabels: {
69
+ enabled: false,
70
+ },
71
+ }), [categories, colors, height, showLegend, showToolbar, horizontal]);
72
+
73
+ return (
74
+ <div className={className}>
75
+ {title && (
76
+ <h3 className="text-lg font-semibold text-gray-900 mb-4">{title}</h3>
77
+ )}
78
+ <Chart
79
+ options={chartOptions}
80
+ series={series}
81
+ type="bar"
82
+ height={height}
83
+ {...props}
84
+ />
85
+ </div>
86
+ );
87
+ };
88
+
89
+ export default BarChart;
90
+