@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/README.md +61 -37
- package/dist/index.cjs +93 -63
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +206 -427
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +93 -59
- package/dist/index.d.ts +93 -59
- package/dist/index.js +92 -63
- package/dist/index.js.map +1 -1
- package/package.json +13 -2
- package/src/theme/theme.ts +64 -52
- package/src/theme/theme.types.ts +32 -0
package/README.md
CHANGED
|
@@ -1,50 +1,74 @@
|
|
|
1
|
-
#
|
|
1
|
+
# AXZY UI System
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A modern, enterprise-ready React component library powered by Tailwind CSS. Built specifically for high-density data applications, hospital management software, and complex dashboards.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
```bash
|
|
8
|
+
npm install @axzydev/axzy_ui_system
|
|
9
|
+
```
|
|
9
10
|
|
|
10
|
-
##
|
|
11
|
+
## Basic Setup
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
Then, you must tell your own `tailwind.config.ts` to scan the library for its dynamic classes:
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
```ts
|
|
16
|
+
// tailwind.config.ts
|
|
17
|
+
import type { Config } from 'tailwindcss'
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
19
|
+
export default {
|
|
20
|
+
content: [
|
|
21
|
+
"./index.html",
|
|
22
|
+
"./src/**/*.{js,ts,jsx,tsx}",
|
|
23
|
+
"./node_modules/@axzydev/axzy_ui_system/dist/**/*.{js,ts,jsx,tsx}" // <--- ADD THIS LINE
|
|
24
|
+
],
|
|
25
|
+
theme: {
|
|
26
|
+
extend: {},
|
|
24
27
|
},
|
|
25
|
-
|
|
28
|
+
plugins: [],
|
|
29
|
+
}
|
|
26
30
|
```
|
|
27
31
|
|
|
28
|
-
|
|
29
|
-
- Optionally add `...tseslint.configs.stylisticTypeChecked`
|
|
30
|
-
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:
|
|
32
|
+
---
|
|
31
33
|
|
|
32
|
-
|
|
33
|
-
// eslint.config.js
|
|
34
|
-
import react from 'eslint-plugin-react'
|
|
34
|
+
## Dynamic Theming (ITThemeProvider)
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
36
|
+
`AXZY_UI_SYSTEM` uses a powerful CSS Variables engine under the hood. You can override the entire color palette of all components instantly without recompiling the library by using the `<ITThemeProvider>`.
|
|
37
|
+
|
|
38
|
+
Wrap your application root with the provider and pass your custom brand JSON object:
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
import React from 'react';
|
|
42
|
+
import { ITThemeProvider } from '@axzydev/axzy_ui_system';
|
|
43
|
+
import App from './App';
|
|
44
|
+
|
|
45
|
+
// Define your custom brand palette mapping
|
|
46
|
+
const myEnterpriseTheme = {
|
|
47
|
+
colors: {
|
|
48
|
+
primary: {
|
|
49
|
+
50: "#fef2f2",
|
|
50
|
+
100: "#fee2e2",
|
|
51
|
+
200: "#fecaca",
|
|
52
|
+
300: "#fca5a5",
|
|
53
|
+
400: "#f87171",
|
|
54
|
+
500: "#ef4444", // Your Main Brand Color
|
|
55
|
+
600: "#dc2626",
|
|
56
|
+
700: "#b91c1c",
|
|
57
|
+
800: "#991b1b",
|
|
58
|
+
900: "#7f1d1d",
|
|
59
|
+
950: "#450a0a",
|
|
60
|
+
},
|
|
61
|
+
// You can optionally override secondary, success, danger, warning, purple, info
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export default function Main() {
|
|
66
|
+
return (
|
|
67
|
+
<ITThemeProvider theme={myEnterpriseTheme}>
|
|
68
|
+
<App />
|
|
69
|
+
</ITThemeProvider>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
50
72
|
```
|
|
73
|
+
|
|
74
|
+
> **Note:** You do not need to provide all colors. Only provide the scales (e.g., `primary`) that you wish to override. Unprovided scales will gracefully fallback to the default AXZY palette.
|
package/dist/index.cjs
CHANGED
|
@@ -48,6 +48,7 @@ __export(index_exports, {
|
|
|
48
48
|
ITStepper: () => ITStepper,
|
|
49
49
|
ITTable: () => ITTable,
|
|
50
50
|
ITText: () => ITText,
|
|
51
|
+
ITThemeProvider: () => ITThemeProvider,
|
|
51
52
|
ITTimePicker: () => ITTimePicker,
|
|
52
53
|
ITToast: () => ITToast,
|
|
53
54
|
createValidationSchema: () => createValidationSchema
|
|
@@ -117,35 +118,45 @@ var palette = {
|
|
|
117
118
|
900: "#0f172a",
|
|
118
119
|
950: "#020617"
|
|
119
120
|
},
|
|
120
|
-
// Mantenemos los colores de estado pero actualizamos a tonos más suaves
|
|
121
121
|
success: import_colors.default.emerald,
|
|
122
122
|
danger: import_colors.default.rose,
|
|
123
123
|
warning: import_colors.default.amber,
|
|
124
124
|
purple: import_colors.default.violet,
|
|
125
125
|
info: import_colors.default.sky
|
|
126
126
|
};
|
|
127
|
+
var createColorVar = (name) => ({
|
|
128
|
+
50: `var(--color-${name}-50)`,
|
|
129
|
+
100: `var(--color-${name}-100)`,
|
|
130
|
+
200: `var(--color-${name}-200)`,
|
|
131
|
+
300: `var(--color-${name}-300)`,
|
|
132
|
+
400: `var(--color-${name}-400)`,
|
|
133
|
+
500: `var(--color-${name}-500)`,
|
|
134
|
+
600: `var(--color-${name}-600)`,
|
|
135
|
+
700: `var(--color-${name}-700)`,
|
|
136
|
+
800: `var(--color-${name}-800)`,
|
|
137
|
+
900: `var(--color-${name}-900)`,
|
|
138
|
+
950: `var(--color-${name}-950)`
|
|
139
|
+
});
|
|
127
140
|
var semanticColors = {
|
|
128
|
-
primary:
|
|
129
|
-
secondary:
|
|
130
|
-
success:
|
|
131
|
-
danger:
|
|
132
|
-
warning:
|
|
133
|
-
info:
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
gray:
|
|
141
|
+
primary: createColorVar("primary"),
|
|
142
|
+
secondary: createColorVar("secondary"),
|
|
143
|
+
success: createColorVar("success"),
|
|
144
|
+
danger: createColorVar("danger"),
|
|
145
|
+
warning: createColorVar("warning"),
|
|
146
|
+
info: createColorVar("info"),
|
|
147
|
+
purple: createColorVar("purple"),
|
|
148
|
+
error: createColorVar("danger"),
|
|
149
|
+
// Alias
|
|
150
|
+
gray: createColorVar("secondary")
|
|
151
|
+
// Secondary as Gray
|
|
138
152
|
};
|
|
139
153
|
var components = {
|
|
140
154
|
layout: {
|
|
141
155
|
backgroundColor: semanticColors.gray[50],
|
|
142
|
-
// Very light gray background for the main content area
|
|
143
156
|
contentPadding: "1.5rem"
|
|
144
|
-
// p-6
|
|
145
157
|
},
|
|
146
158
|
topbar: {
|
|
147
159
|
backgroundColor: "rgba(255, 255, 255, 0.90)",
|
|
148
|
-
// Glassmorphism base
|
|
149
160
|
borderColor: semanticColors.gray[200],
|
|
150
161
|
iconColor: semanticColors.gray[500],
|
|
151
162
|
iconHoverColor: semanticColors.gray[700],
|
|
@@ -166,7 +177,6 @@ var components = {
|
|
|
166
177
|
},
|
|
167
178
|
sidebar: {
|
|
168
179
|
backgroundColor: "rgba(255, 255, 255, 0.90)",
|
|
169
|
-
// Glassmorphism base like topbar
|
|
170
180
|
borderColor: semanticColors.gray[200],
|
|
171
181
|
label: {
|
|
172
182
|
color: semanticColors.gray[700],
|
|
@@ -182,95 +192,75 @@ var components = {
|
|
|
182
192
|
},
|
|
183
193
|
active: {
|
|
184
194
|
backgroundColor: semanticColors.gray[50],
|
|
185
|
-
// Very subtle active bg in light mode
|
|
186
195
|
color: semanticColors.gray[900],
|
|
187
|
-
iconColor:
|
|
188
|
-
// Emerald green
|
|
196
|
+
iconColor: semanticColors.primary[500]
|
|
189
197
|
},
|
|
190
198
|
badge: {
|
|
191
|
-
backgroundColor:
|
|
199
|
+
backgroundColor: semanticColors.primary[500],
|
|
192
200
|
color: "#ffffff"
|
|
193
201
|
}
|
|
194
202
|
},
|
|
195
203
|
button: {
|
|
196
204
|
primary: {
|
|
197
|
-
backgroundColor:
|
|
198
|
-
// Cyan-500
|
|
205
|
+
backgroundColor: semanticColors.primary[500],
|
|
199
206
|
color: "#ffffff",
|
|
200
|
-
hover:
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
// Cyan-700
|
|
204
|
-
focus: "0 0 0 2px #a5f3fc",
|
|
205
|
-
// Cyan-200
|
|
207
|
+
hover: semanticColors.primary[600],
|
|
208
|
+
active: semanticColors.primary[700],
|
|
209
|
+
focus: `0 0 0 2px ${semanticColors.primary[200]}`,
|
|
206
210
|
borderRadius: "0.375rem",
|
|
207
|
-
// 6px - rounded-md
|
|
208
211
|
padding: "0.5rem 1rem",
|
|
209
212
|
fontSize: "0.875rem",
|
|
210
213
|
fontWeight: "600",
|
|
211
214
|
transition: "all 150ms ease-in-out"
|
|
212
215
|
},
|
|
213
216
|
secondary: {
|
|
214
|
-
backgroundColor:
|
|
215
|
-
// Slate-500
|
|
217
|
+
backgroundColor: semanticColors.secondary[500],
|
|
216
218
|
color: "#ffffff",
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
// Slate-600
|
|
220
|
-
focus: "0 0 0 2px #e2e8f0",
|
|
219
|
+
hover: semanticColors.secondary[600],
|
|
220
|
+
focus: `0 0 0 2px ${semanticColors.secondary[200]}`,
|
|
221
221
|
borderRadius: "0.375rem",
|
|
222
222
|
padding: "0.5rem 1rem",
|
|
223
223
|
fontSize: "0.875rem",
|
|
224
224
|
fontWeight: "600"
|
|
225
225
|
},
|
|
226
226
|
success: {
|
|
227
|
-
backgroundColor:
|
|
228
|
-
// Green-500
|
|
227
|
+
backgroundColor: semanticColors.success[500],
|
|
229
228
|
color: "#ffffff",
|
|
230
|
-
hover:
|
|
231
|
-
// Green-600
|
|
229
|
+
hover: semanticColors.success[600],
|
|
232
230
|
focus: `0 0 0 2px ${semanticColors.success[200]}`,
|
|
233
231
|
borderRadius: "0.375rem"
|
|
234
232
|
},
|
|
235
233
|
danger: {
|
|
236
|
-
backgroundColor:
|
|
237
|
-
// Red-500
|
|
234
|
+
backgroundColor: semanticColors.danger[500],
|
|
238
235
|
color: "#ffffff",
|
|
239
|
-
hover:
|
|
240
|
-
// Red-600
|
|
236
|
+
hover: semanticColors.danger[600],
|
|
241
237
|
focus: `0 0 0 2px ${semanticColors.danger[200]}`,
|
|
242
238
|
borderRadius: "0.375rem"
|
|
243
239
|
},
|
|
244
240
|
error: {
|
|
245
|
-
backgroundColor:
|
|
241
|
+
backgroundColor: semanticColors.danger[500],
|
|
246
242
|
color: "#ffffff",
|
|
247
|
-
hover:
|
|
243
|
+
hover: semanticColors.danger[600],
|
|
248
244
|
borderRadius: "0.375rem"
|
|
249
245
|
},
|
|
250
246
|
warning: {
|
|
251
|
-
backgroundColor:
|
|
252
|
-
// Orange-500
|
|
247
|
+
backgroundColor: semanticColors.warning[500],
|
|
253
248
|
color: "#ffffff",
|
|
254
|
-
hover:
|
|
255
|
-
// Orange-600
|
|
249
|
+
hover: semanticColors.warning[600],
|
|
256
250
|
focus: `0 0 0 2px ${semanticColors.warning[200]}`,
|
|
257
251
|
borderRadius: "0.375rem"
|
|
258
252
|
},
|
|
259
253
|
info: {
|
|
260
|
-
backgroundColor:
|
|
261
|
-
// Sky-500
|
|
254
|
+
backgroundColor: semanticColors.info[500],
|
|
262
255
|
color: "#ffffff",
|
|
263
|
-
hover:
|
|
264
|
-
// Sky-600
|
|
256
|
+
hover: semanticColors.info[600],
|
|
265
257
|
focus: `0 0 0 2px ${semanticColors.info[200]}`,
|
|
266
258
|
borderRadius: "0.375rem"
|
|
267
259
|
},
|
|
268
260
|
purple: {
|
|
269
|
-
backgroundColor:
|
|
270
|
-
// Violet-500
|
|
261
|
+
backgroundColor: semanticColors.purple[500],
|
|
271
262
|
color: "#ffffff",
|
|
272
|
-
hover:
|
|
273
|
-
// Violet-600
|
|
263
|
+
hover: semanticColors.purple[600],
|
|
274
264
|
focus: `0 0 0 2px ${semanticColors.purple[200]}`,
|
|
275
265
|
borderRadius: "0.375rem"
|
|
276
266
|
},
|
|
@@ -279,7 +269,6 @@ var components = {
|
|
|
279
269
|
color: semanticColors.primary[600],
|
|
280
270
|
borderColor: semanticColors.primary[600],
|
|
281
271
|
borderWidth: "2px",
|
|
282
|
-
// Slightly thicker for modern look
|
|
283
272
|
hover: semanticColors.primary[50],
|
|
284
273
|
borderRadius: "0.375rem"
|
|
285
274
|
}
|
|
@@ -340,7 +329,6 @@ var components = {
|
|
|
340
329
|
card: {
|
|
341
330
|
backgroundColor: "#ffffff",
|
|
342
331
|
borderRadius: "1rem",
|
|
343
|
-
// 16px - más moderno
|
|
344
332
|
borderColor: semanticColors.gray[200],
|
|
345
333
|
borderWidth: "1px",
|
|
346
334
|
shadow: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
|
|
@@ -349,7 +337,7 @@ var components = {
|
|
|
349
337
|
},
|
|
350
338
|
header: {
|
|
351
339
|
backgroundColor: semanticColors.gray[50],
|
|
352
|
-
borderBottom: `1px solid
|
|
340
|
+
borderBottom: `1px solid var(--color-secondary-200)`,
|
|
353
341
|
padding: "1rem 1.5rem",
|
|
354
342
|
borderTopLeftRadius: "1rem",
|
|
355
343
|
borderTopRightRadius: "1rem"
|
|
@@ -389,7 +377,7 @@ var components = {
|
|
|
389
377
|
},
|
|
390
378
|
row: {
|
|
391
379
|
hover: semanticColors.primary[50],
|
|
392
|
-
borderBottom: `1px solid
|
|
380
|
+
borderBottom: `1px solid var(--color-secondary-200)`
|
|
393
381
|
},
|
|
394
382
|
cell: {
|
|
395
383
|
padding: "1rem 1.5rem"
|
|
@@ -424,7 +412,6 @@ var components = {
|
|
|
424
412
|
modal: {
|
|
425
413
|
overlay: {
|
|
426
414
|
backgroundColor: "rgba(15, 23, 42, 0.75)"
|
|
427
|
-
// gray[900] con opacidad
|
|
428
415
|
},
|
|
429
416
|
content: {
|
|
430
417
|
backgroundColor: "#ffffff",
|
|
@@ -433,14 +420,14 @@ var components = {
|
|
|
433
420
|
},
|
|
434
421
|
header: {
|
|
435
422
|
padding: "1.5rem 1.5rem 0.5rem 1.5rem",
|
|
436
|
-
borderBottom: `1px solid
|
|
423
|
+
borderBottom: `1px solid var(--color-secondary-200)`
|
|
437
424
|
},
|
|
438
425
|
body: {
|
|
439
426
|
padding: "1.5rem"
|
|
440
427
|
},
|
|
441
428
|
footer: {
|
|
442
429
|
padding: "1rem 1.5rem",
|
|
443
|
-
borderTop: `1px solid
|
|
430
|
+
borderTop: `1px solid var(--color-secondary-200)`,
|
|
444
431
|
backgroundColor: semanticColors.gray[50]
|
|
445
432
|
}
|
|
446
433
|
}
|
|
@@ -4655,6 +4642,48 @@ function ITStepper({
|
|
|
4655
4642
|
] })
|
|
4656
4643
|
] });
|
|
4657
4644
|
}
|
|
4645
|
+
|
|
4646
|
+
// src/components/theme-provider/themeProvider.tsx
|
|
4647
|
+
var import_react25 = require("react");
|
|
4648
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
4649
|
+
function ITThemeProvider({ theme: theme2, children }) {
|
|
4650
|
+
const activeThemeContext = (0, import_react25.useMemo)(() => {
|
|
4651
|
+
const baseColors = {
|
|
4652
|
+
primary: palette.blue,
|
|
4653
|
+
secondary: palette.gray,
|
|
4654
|
+
success: palette.success,
|
|
4655
|
+
danger: palette.danger,
|
|
4656
|
+
warning: palette.warning,
|
|
4657
|
+
info: palette.cyan,
|
|
4658
|
+
purple: palette.purple
|
|
4659
|
+
};
|
|
4660
|
+
return {
|
|
4661
|
+
colors: {
|
|
4662
|
+
...baseColors,
|
|
4663
|
+
...theme2?.colors
|
|
4664
|
+
},
|
|
4665
|
+
layout: {
|
|
4666
|
+
...theme.layout,
|
|
4667
|
+
...theme2?.layout
|
|
4668
|
+
}
|
|
4669
|
+
};
|
|
4670
|
+
}, [theme2]);
|
|
4671
|
+
const cssVariables = (0, import_react25.useMemo)(() => {
|
|
4672
|
+
let variablesString = "";
|
|
4673
|
+
Object.entries(activeThemeContext.colors).forEach(([colorName, scale]) => {
|
|
4674
|
+
Object.entries(scale).forEach(([shade, hexValue]) => {
|
|
4675
|
+
variablesString += `--color-${colorName}-${shade}: ${hexValue};
|
|
4676
|
+
`;
|
|
4677
|
+
});
|
|
4678
|
+
});
|
|
4679
|
+
return `:root {
|
|
4680
|
+
${variablesString}}`;
|
|
4681
|
+
}, [activeThemeContext]);
|
|
4682
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
|
|
4683
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("style", { suppressHydrationWarning: true, children: cssVariables }),
|
|
4684
|
+
children
|
|
4685
|
+
] });
|
|
4686
|
+
}
|
|
4658
4687
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4659
4688
|
0 && (module.exports = {
|
|
4660
4689
|
ITBadget,
|
|
@@ -4676,6 +4705,7 @@ function ITStepper({
|
|
|
4676
4705
|
ITStepper,
|
|
4677
4706
|
ITTable,
|
|
4678
4707
|
ITText,
|
|
4708
|
+
ITThemeProvider,
|
|
4679
4709
|
ITTimePicker,
|
|
4680
4710
|
ITToast,
|
|
4681
4711
|
createValidationSchema
|