@axzydev/axzy_ui_system 1.0.157 → 1.0.160

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/package.json CHANGED
@@ -3,10 +3,20 @@
3
3
  "author": "axzydev <aamaro@axzy.dev>",
4
4
  "private": false,
5
5
  "license": "MIT",
6
- "version": "1.0.157",
6
+ "version": "1.0.160",
7
7
  "type": "module",
8
- "main": "dist/index.js",
8
+ "main": "dist/index.cjs",
9
+ "module": "dist/index.js",
9
10
  "types": "dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.js",
15
+ "require": "./dist/index.cjs"
16
+ },
17
+ "./dist/index.css": "./dist/index.css",
18
+ "./style": "./dist/index.css"
19
+ },
10
20
  "files": [
11
21
  "dist",
12
22
  "src/theme"
@@ -17,6 +27,7 @@
17
27
  "lint": "eslint .",
18
28
  "preview": "vite preview",
19
29
  "bundle": "tsup src/index.ts",
30
+ "watch": "tsup src/index.ts --watch",
20
31
  "storybook": "storybook dev -p 6006",
21
32
  "build-storybook": "storybook build"
22
33
  },
@@ -1,7 +1,7 @@
1
1
  import colors from "tailwindcss/colors";
2
2
 
3
3
  /**
4
- * 1. Paleta base (colores crudos) - Actualizada a tonos azules
4
+ * 1. Paleta base (Raw HEX values - Default Theme Fallback)
5
5
  */
6
6
  export const palette = {
7
7
  blue: {
@@ -17,7 +17,6 @@ export const palette = {
17
17
  900: '#1e3a8a',
18
18
  950: '#172554',
19
19
  },
20
-
21
20
  cyan: {
22
21
  50: '#ecfeff',
23
22
  100: '#cffafe',
@@ -31,7 +30,6 @@ export const palette = {
31
30
  900: '#164e63',
32
31
  950: '#083344',
33
32
  },
34
-
35
33
  gray: {
36
34
  50: '#f8fafc',
37
35
  100: '#f1f5f9',
@@ -45,8 +43,6 @@ export const palette = {
45
43
  900: '#0f172a',
46
44
  950: '#020617',
47
45
  },
48
-
49
- // Mantenemos los colores de estado pero actualizamos a tonos más suaves
50
46
  success: colors.emerald,
51
47
  danger: colors.rose,
52
48
  warning: colors.amber,
@@ -55,30 +51,46 @@ export const palette = {
55
51
  };
56
52
 
57
53
  /**
58
- * 2. Colores semánticos (qué representa cada color)
54
+ * 2. Mapeo Dinámico a Variables CSS
55
+ * Esta es la magia estructural: en lugar de acoplar la UI a un Hex estático,
56
+ * todo apunta a var(--color-[name]-[shade])
59
57
  */
58
+ const createColorVar = (name: string) => ({
59
+ 50: `var(--color-${name}-50)`,
60
+ 100: `var(--color-${name}-100)`,
61
+ 200: `var(--color-${name}-200)`,
62
+ 300: `var(--color-${name}-300)`,
63
+ 400: `var(--color-${name}-400)`,
64
+ 500: `var(--color-${name}-500)`,
65
+ 600: `var(--color-${name}-600)`,
66
+ 700: `var(--color-${name}-700)`,
67
+ 800: `var(--color-${name}-800)`,
68
+ 900: `var(--color-${name}-900)`,
69
+ 950: `var(--color-${name}-950)`,
70
+ });
71
+
60
72
  export const semanticColors = {
61
- primary: palette.blue,
62
- secondary: palette.gray,
63
- success: palette.success,
64
- danger: palette.danger,
65
- warning: palette.warning,
66
- info: palette.cyan, // Usamos cyan para info en lugar de sky
67
- purple: palette.purple,
68
- error: palette.danger,
69
- gray: palette.gray,
73
+ primary: createColorVar('primary'),
74
+ secondary: createColorVar('secondary'),
75
+ success: createColorVar('success'),
76
+ danger: createColorVar('danger'),
77
+ warning: createColorVar('warning'),
78
+ info: createColorVar('info'),
79
+ purple: createColorVar('purple'),
80
+ error: createColorVar('danger'), // Alias
81
+ gray: createColorVar('secondary'), // Secondary as Gray
70
82
  };
71
83
 
72
84
  /**
73
- * 3. Tokens de componentes (heredan de semantic)
85
+ * 3. Tokens de componentes (heredan de las Vbles CSS semanticColors)
74
86
  */
75
87
  export const components = {
76
88
  layout: {
77
- backgroundColor: semanticColors.gray[50], // Very light gray background for the main content area
78
- contentPadding: '1.5rem', // p-6
89
+ backgroundColor: semanticColors.gray[50],
90
+ contentPadding: '1.5rem',
79
91
  },
80
92
  topbar: {
81
- backgroundColor: 'rgba(255, 255, 255, 0.90)', // Glassmorphism base
93
+ backgroundColor: 'rgba(255, 255, 255, 0.90)',
82
94
  borderColor: semanticColors.gray[200],
83
95
  iconColor: semanticColors.gray[500],
84
96
  iconHoverColor: semanticColors.gray[700],
@@ -98,7 +110,7 @@ export const components = {
98
110
  }
99
111
  },
100
112
  sidebar: {
101
- backgroundColor: 'rgba(255, 255, 255, 0.90)', // Glassmorphism base like topbar
113
+ backgroundColor: 'rgba(255, 255, 255, 0.90)',
102
114
  borderColor: semanticColors.gray[200],
103
115
  label: {
104
116
  color: semanticColors.gray[700],
@@ -113,24 +125,24 @@ export const components = {
113
125
  backgroundColor: semanticColors.gray[100],
114
126
  },
115
127
  active: {
116
- backgroundColor: semanticColors.gray[50], // Very subtle active bg in light mode
128
+ backgroundColor: semanticColors.gray[50],
117
129
  color: semanticColors.gray[900],
118
- iconColor: '#10b981', // Emerald green
130
+ iconColor: semanticColors.primary[500],
119
131
  },
120
132
  badge: {
121
- backgroundColor: '#10b981',
133
+ backgroundColor: semanticColors.primary[500],
122
134
  color: '#ffffff',
123
135
  },
124
136
  },
125
137
 
126
138
  button: {
127
139
  primary: {
128
- backgroundColor: '#06b6d4', // Cyan-500
140
+ backgroundColor: semanticColors.primary[500],
129
141
  color: '#ffffff',
130
- hover: '#0891b2', // Cyan-600
131
- active: '#0e7490', // Cyan-700
132
- focus: '0 0 0 2px #a5f3fc', // Cyan-200
133
- borderRadius: '0.375rem', // 6px - rounded-md
142
+ hover: semanticColors.primary[600],
143
+ active: semanticColors.primary[700],
144
+ focus: `0 0 0 2px ${semanticColors.primary[200]}`,
145
+ borderRadius: '0.375rem',
134
146
  padding: '0.5rem 1rem',
135
147
  fontSize: '0.875rem',
136
148
  fontWeight: '600',
@@ -138,10 +150,10 @@ export const components = {
138
150
  },
139
151
 
140
152
  secondary: {
141
- backgroundColor: '#64748b', // Slate-500
142
- color: '#ffffff', // Text white for filled secondary per screenshot
143
- hover: '#475569', // Slate-600
144
- focus: '0 0 0 2px #e2e8f0',
153
+ backgroundColor: semanticColors.secondary[500],
154
+ color: '#ffffff',
155
+ hover: semanticColors.secondary[600],
156
+ focus: `0 0 0 2px ${semanticColors.secondary[200]}`,
145
157
  borderRadius: '0.375rem',
146
158
  padding: '0.5rem 1rem',
147
159
  fontSize: '0.875rem',
@@ -149,48 +161,48 @@ export const components = {
149
161
  },
150
162
 
151
163
  success: {
152
- backgroundColor: '#22c55e', // Green-500
164
+ backgroundColor: semanticColors.success[500],
153
165
  color: '#ffffff',
154
- hover: '#16a34a', // Green-600
166
+ hover: semanticColors.success[600],
155
167
  focus: `0 0 0 2px ${semanticColors.success[200]}`,
156
168
  borderRadius: '0.375rem',
157
169
  },
158
170
 
159
171
  danger: {
160
- backgroundColor: '#ef4444', // Red-500
172
+ backgroundColor: semanticColors.danger[500],
161
173
  color: '#ffffff',
162
- hover: '#dc2626', // Red-600
174
+ hover: semanticColors.danger[600],
163
175
  focus: `0 0 0 2px ${semanticColors.danger[200]}`,
164
176
  borderRadius: '0.375rem',
165
177
  },
166
178
 
167
179
  error: {
168
- backgroundColor: '#ef4444',
180
+ backgroundColor: semanticColors.danger[500],
169
181
  color: '#ffffff',
170
- hover: '#dc2626',
182
+ hover: semanticColors.danger[600],
171
183
  borderRadius: '0.375rem',
172
184
  },
173
185
 
174
186
  warning: {
175
- backgroundColor: '#f97316', // Orange-500
187
+ backgroundColor: semanticColors.warning[500],
176
188
  color: '#ffffff',
177
- hover: '#ea580c', // Orange-600
189
+ hover: semanticColors.warning[600],
178
190
  focus: `0 0 0 2px ${semanticColors.warning[200]}`,
179
191
  borderRadius: '0.375rem',
180
192
  },
181
193
 
182
194
  info: {
183
- backgroundColor: '#0ea5e9', // Sky-500
195
+ backgroundColor: semanticColors.info[500],
184
196
  color: '#ffffff',
185
- hover: '#0284c7', // Sky-600
197
+ hover: semanticColors.info[600],
186
198
  focus: `0 0 0 2px ${semanticColors.info[200]}`,
187
199
  borderRadius: '0.375rem',
188
200
  },
189
201
 
190
202
  purple: {
191
- backgroundColor: '#8b5cf6', // Violet-500
203
+ backgroundColor: semanticColors.purple[500],
192
204
  color: '#ffffff',
193
- hover: '#7c3aed', // Violet-600
205
+ hover: semanticColors.purple[600],
194
206
  focus: `0 0 0 2px ${semanticColors.purple[200]}`,
195
207
  borderRadius: '0.375rem',
196
208
  },
@@ -199,7 +211,7 @@ export const components = {
199
211
  backgroundColor: 'transparent',
200
212
  color: semanticColors.primary[600],
201
213
  borderColor: semanticColors.primary[600],
202
- borderWidth: '2px', // Slightly thicker for modern look
214
+ borderWidth: '2px',
203
215
  hover: semanticColors.primary[50],
204
216
  borderRadius: '0.375rem',
205
217
  },
@@ -261,7 +273,7 @@ export const components = {
261
273
 
262
274
  card: {
263
275
  backgroundColor: '#ffffff',
264
- borderRadius: '1rem', // 16px - más moderno
276
+ borderRadius: '1rem',
265
277
  borderColor: semanticColors.gray[200],
266
278
  borderWidth: '1px',
267
279
  shadow: '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)',
@@ -270,7 +282,7 @@ export const components = {
270
282
  },
271
283
  header: {
272
284
  backgroundColor: semanticColors.gray[50],
273
- borderBottom: `1px solid ${semanticColors.gray[200]}`,
285
+ borderBottom: `1px solid var(--color-secondary-200)`,
274
286
  padding: '1rem 1.5rem',
275
287
  borderTopLeftRadius: '1rem',
276
288
  borderTopRightRadius: '1rem',
@@ -312,7 +324,7 @@ export const components = {
312
324
  },
313
325
  row: {
314
326
  hover: semanticColors.primary[50],
315
- borderBottom: `1px solid ${semanticColors.gray[200]}`,
327
+ borderBottom: `1px solid var(--color-secondary-200)`,
316
328
  },
317
329
  cell: {
318
330
  padding: '1rem 1.5rem',
@@ -348,7 +360,7 @@ export const components = {
348
360
 
349
361
  modal: {
350
362
  overlay: {
351
- backgroundColor: 'rgba(15, 23, 42, 0.75)', // gray[900] con opacidad
363
+ backgroundColor: 'rgba(15, 23, 42, 0.75)',
352
364
  },
353
365
  content: {
354
366
  backgroundColor: '#ffffff',
@@ -357,14 +369,14 @@ export const components = {
357
369
  },
358
370
  header: {
359
371
  padding: '1.5rem 1.5rem 0.5rem 1.5rem',
360
- borderBottom: `1px solid ${semanticColors.gray[200]}`,
372
+ borderBottom: `1px solid var(--color-secondary-200)`,
361
373
  },
362
374
  body: {
363
375
  padding: '1.5rem',
364
376
  },
365
377
  footer: {
366
378
  padding: '1rem 1.5rem',
367
- borderTop: `1px solid ${semanticColors.gray[200]}`,
379
+ borderTop: `1px solid var(--color-secondary-200)`,
368
380
  backgroundColor: semanticColors.gray[50],
369
381
  },
370
382
  },
@@ -405,7 +417,7 @@ export const typography = {
405
417
  * 5. Theme final exportado
406
418
  */
407
419
  export const theme = {
408
- palette,
420
+ palette,
409
421
  colors: semanticColors,
410
422
  typography,
411
423
  ...components,
@@ -0,0 +1,32 @@
1
+ export type ColorScale = {
2
+ 50: string;
3
+ 100: string;
4
+ 200: string;
5
+ 300: string;
6
+ 400: string;
7
+ 500: string;
8
+ 600: string;
9
+ 700: string;
10
+ 800: string;
11
+ 900: string;
12
+ 950?: string;
13
+ };
14
+
15
+ export type SemanticThemeColors = {
16
+ primary?: ColorScale;
17
+ secondary?: ColorScale;
18
+ success?: ColorScale;
19
+ danger?: ColorScale;
20
+ warning?: ColorScale;
21
+ info?: ColorScale;
22
+ purple?: ColorScale;
23
+ };
24
+
25
+ export interface ITThemeConfig {
26
+ colors: SemanticThemeColors;
27
+ // Future extension points
28
+ layout?: {
29
+ backgroundColor?: string;
30
+ contentPadding?: string;
31
+ };
32
+ }