@axzydev/axzy_ui_system 1.1.1 → 1.2.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.
- package/README.md +100 -36
- package/dist/index.cjs +71 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +297 -4188
- package/dist/index.css.map +1 -1
- package/dist/index.js +71 -12
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/theme/theme.ts +25 -7
package/README.md
CHANGED
|
@@ -1,49 +1,59 @@
|
|
|
1
1
|
# AXZY UI System
|
|
2
2
|
|
|
3
|
-
A modern, enterprise-ready React component library powered by Tailwind CSS
|
|
3
|
+
A modern, enterprise-ready React component library powered by **Tailwind CSS v4**. Built specifically for high-density data applications, hospital management software, and complex dashboards.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Quick Start
|
|
8
|
+
|
|
9
|
+
### 1. Crear un proyecto nuevo con Vite + React + TypeScript
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm create vite@latest mi-app -- --template react-ts
|
|
13
|
+
cd mi-app
|
|
14
|
+
npm install
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### 2. Instalar Tailwind CSS v4 y AXZY UI System
|
|
6
18
|
|
|
7
19
|
```bash
|
|
8
20
|
npm install @axzydev/axzy_ui_system
|
|
21
|
+
npm install -D tailwindcss @tailwindcss/vite
|
|
9
22
|
```
|
|
10
23
|
|
|
11
|
-
|
|
24
|
+
### 3. Configurar Vite
|
|
12
25
|
|
|
13
|
-
|
|
26
|
+
Edita `vite.config.ts`:
|
|
14
27
|
|
|
15
28
|
```ts
|
|
16
|
-
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"./node_modules/@axzydev/axzy_ui_system/dist/**/*.{js,ts,jsx,tsx}" // <--- ADD THIS LINE
|
|
24
|
-
],
|
|
25
|
-
theme: {
|
|
26
|
-
extend: {},
|
|
27
|
-
},
|
|
28
|
-
plugins: [],
|
|
29
|
-
}
|
|
29
|
+
import { defineConfig } from "vite"
|
|
30
|
+
import react from "@vitejs/plugin-react-swc"
|
|
31
|
+
import tailwindcss from "@tailwindcss/vite"
|
|
32
|
+
|
|
33
|
+
export default defineConfig({
|
|
34
|
+
plugins: [tailwindcss(), react()],
|
|
35
|
+
})
|
|
30
36
|
```
|
|
31
37
|
|
|
32
|
-
|
|
38
|
+
### 4. Agregar directivas de Tailwind
|
|
33
39
|
|
|
34
|
-
|
|
40
|
+
En `src/index.css`:
|
|
35
41
|
|
|
36
|
-
|
|
42
|
+
```css
|
|
43
|
+
@import "tailwindcss";
|
|
44
|
+
```
|
|
37
45
|
|
|
38
|
-
|
|
46
|
+
### 5. Envolver la app con ITThemeProvider
|
|
39
47
|
|
|
40
48
|
```tsx
|
|
41
|
-
|
|
42
|
-
import
|
|
43
|
-
import
|
|
49
|
+
// src/main.tsx
|
|
50
|
+
import React from "react"
|
|
51
|
+
import ReactDOM from "react-dom/client"
|
|
52
|
+
import { ITThemeProvider } from "@axzydev/axzy_ui_system"
|
|
53
|
+
import App from "./App"
|
|
54
|
+
import "./index.css"
|
|
44
55
|
|
|
45
|
-
|
|
46
|
-
const myEnterpriseTheme = {
|
|
56
|
+
const myTheme = {
|
|
47
57
|
colors: {
|
|
48
58
|
primary: {
|
|
49
59
|
50: "#fef2f2",
|
|
@@ -51,24 +61,78 @@ const myEnterpriseTheme = {
|
|
|
51
61
|
200: "#fecaca",
|
|
52
62
|
300: "#fca5a5",
|
|
53
63
|
400: "#f87171",
|
|
54
|
-
500: "#ef4444",
|
|
64
|
+
500: "#ef4444",
|
|
55
65
|
600: "#dc2626",
|
|
56
66
|
700: "#b91c1c",
|
|
57
67
|
800: "#991b1b",
|
|
58
68
|
900: "#7f1d1d",
|
|
59
69
|
950: "#450a0a",
|
|
60
70
|
},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
};
|
|
71
|
+
},
|
|
72
|
+
}
|
|
64
73
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
<ITThemeProvider theme={
|
|
74
|
+
ReactDOM.createRoot(document.getElementById("root")!).render(
|
|
75
|
+
<React.StrictMode>
|
|
76
|
+
<ITThemeProvider theme={myTheme}>
|
|
68
77
|
<App />
|
|
69
78
|
</ITThemeProvider>
|
|
70
|
-
|
|
79
|
+
</React.StrictMode>
|
|
80
|
+
)
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### 6. ¡Usar componentes!
|
|
84
|
+
|
|
85
|
+
```tsx
|
|
86
|
+
// src/App.tsx
|
|
87
|
+
import { ITButton } from "@axzydev/axzy_ui_system"
|
|
88
|
+
|
|
89
|
+
export default function App() {
|
|
90
|
+
return (
|
|
91
|
+
<div className="p-8">
|
|
92
|
+
<ITButton variant="primary">Hola Mundo</ITButton>
|
|
93
|
+
</div>
|
|
94
|
+
)
|
|
71
95
|
}
|
|
72
96
|
```
|
|
73
97
|
|
|
74
|
-
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Theming
|
|
101
|
+
|
|
102
|
+
El `ITThemeProvider` permite sobrescribir toda la paleta de colores en tiempo de ejecución sin recompilar.
|
|
103
|
+
|
|
104
|
+
```tsx
|
|
105
|
+
const myTheme = {
|
|
106
|
+
colors: {
|
|
107
|
+
primary: { 50: "..." , 500: "#ef4444", ... },
|
|
108
|
+
secondary: { 50: "...", 500: "#3b82f6", ... },
|
|
109
|
+
success: { 50: "...", 500: "#22c55e", ... },
|
|
110
|
+
danger: { 50: "...", 500: "#ef4444", ... },
|
|
111
|
+
warning: { 50: "...", 500: "#f59e0b", ... },
|
|
112
|
+
purple: { 50: "...", 500: "#a855f7", ... },
|
|
113
|
+
info: { 50: "...", 500: "#06b6d4", ... },
|
|
114
|
+
},
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Solo debes proveer los colores que quieras cambiar — el resto usa los valores por defecto.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Scripts del proyecto
|
|
123
|
+
|
|
124
|
+
| Comando | Descripción |
|
|
125
|
+
|---------|-------------|
|
|
126
|
+
| `npm run dev` | Inicia servidor de desarrollo |
|
|
127
|
+
| `npm run build` | Compila para producción |
|
|
128
|
+
| `npm run preview` | Previsualiza el build |
|
|
129
|
+
| `npm run storybook` | Storybook para desarrollo |
|
|
130
|
+
| `npm run lint` | Ejecuta ESLint |
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Requisitos
|
|
135
|
+
|
|
136
|
+
- React 18+
|
|
137
|
+
- Tailwind CSS 4.x + `@tailwindcss/vite`
|
|
138
|
+
- Node.js 18+
|
package/dist/index.cjs
CHANGED
|
@@ -487,7 +487,6 @@ var badgeSizes = {
|
|
|
487
487
|
};
|
|
488
488
|
|
|
489
489
|
// src/theme/theme.ts
|
|
490
|
-
var import_colors = __toESM(require("tailwindcss/colors"), 1);
|
|
491
490
|
var palette = {
|
|
492
491
|
blue: {
|
|
493
492
|
50: "#eff6ff",
|
|
@@ -528,11 +527,71 @@ var palette = {
|
|
|
528
527
|
900: "#0f172a",
|
|
529
528
|
950: "#020617"
|
|
530
529
|
},
|
|
531
|
-
success:
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
530
|
+
success: {
|
|
531
|
+
50: "#ecfdf5",
|
|
532
|
+
100: "#d1fae5",
|
|
533
|
+
200: "#a7f3d0",
|
|
534
|
+
300: "#6ee7b7",
|
|
535
|
+
400: "#34d399",
|
|
536
|
+
500: "#10b981",
|
|
537
|
+
600: "#059669",
|
|
538
|
+
700: "#047857",
|
|
539
|
+
800: "#065f46",
|
|
540
|
+
900: "#064e3b",
|
|
541
|
+
950: "#022c22"
|
|
542
|
+
},
|
|
543
|
+
danger: {
|
|
544
|
+
50: "#fff1f2",
|
|
545
|
+
100: "#ffe4e6",
|
|
546
|
+
200: "#fecdd3",
|
|
547
|
+
300: "#fda4af",
|
|
548
|
+
400: "#fb7185",
|
|
549
|
+
500: "#f43f5e",
|
|
550
|
+
600: "#e11d48",
|
|
551
|
+
700: "#be123c",
|
|
552
|
+
800: "#9f1239",
|
|
553
|
+
900: "#881337",
|
|
554
|
+
950: "#4c0519"
|
|
555
|
+
},
|
|
556
|
+
warning: {
|
|
557
|
+
50: "#fffbeb",
|
|
558
|
+
100: "#fef3c7",
|
|
559
|
+
200: "#fde68a",
|
|
560
|
+
300: "#fcd34d",
|
|
561
|
+
400: "#fbbf24",
|
|
562
|
+
500: "#f59e0b",
|
|
563
|
+
600: "#d97706",
|
|
564
|
+
700: "#b45309",
|
|
565
|
+
800: "#92400e",
|
|
566
|
+
900: "#78350f",
|
|
567
|
+
950: "#451a03"
|
|
568
|
+
},
|
|
569
|
+
purple: {
|
|
570
|
+
50: "#f5f3ff",
|
|
571
|
+
100: "#ede9fe",
|
|
572
|
+
200: "#ddd6fe",
|
|
573
|
+
300: "#c4b5fd",
|
|
574
|
+
400: "#a78bfa",
|
|
575
|
+
500: "#8b5cf6",
|
|
576
|
+
600: "#7c3aed",
|
|
577
|
+
700: "#6d28d9",
|
|
578
|
+
800: "#5b21b6",
|
|
579
|
+
900: "#4c1d95",
|
|
580
|
+
950: "#2e1065"
|
|
581
|
+
},
|
|
582
|
+
info: {
|
|
583
|
+
50: "#f0f9ff",
|
|
584
|
+
100: "#e0f2fe",
|
|
585
|
+
200: "#bae6fd",
|
|
586
|
+
300: "#7dd3fc",
|
|
587
|
+
400: "#38bdf8",
|
|
588
|
+
500: "#0ea5e9",
|
|
589
|
+
600: "#0284c7",
|
|
590
|
+
700: "#0369a1",
|
|
591
|
+
800: "#075985",
|
|
592
|
+
900: "#0c4a6e",
|
|
593
|
+
950: "#082f49"
|
|
594
|
+
}
|
|
536
595
|
};
|
|
537
596
|
var createColorVar = (name) => ({
|
|
538
597
|
50: `var(--color-${name}-50)`,
|
|
@@ -972,7 +1031,7 @@ var buttonVariants = {
|
|
|
972
1031
|
outlined: "bg-transparent border-2",
|
|
973
1032
|
raised: "border-transparent shadow-md",
|
|
974
1033
|
rounded: "border-transparent shadow-sm rounded-full",
|
|
975
|
-
text: "bg-transparent border-transparent shadow-none hover:bg-
|
|
1034
|
+
text: "bg-transparent border-transparent shadow-none hover:bg-black/5 dark:hover:bg-white/10",
|
|
976
1035
|
"raised-text": "bg-white border border-gray-200 shadow-sm hover:shadow-md",
|
|
977
1036
|
"icon-only": "p-2 aspect-square flex items-center justify-center border-transparent shadow-sm",
|
|
978
1037
|
link: "bg-transparent border-transparent shadow-none hover:underline px-0"
|
|
@@ -4982,8 +5041,8 @@ function ITThemeProvider({
|
|
|
4982
5041
|
};
|
|
4983
5042
|
});
|
|
4984
5043
|
};
|
|
4985
|
-
const applyPreset = (
|
|
4986
|
-
setPaletteState(
|
|
5044
|
+
const applyPreset = (colors) => {
|
|
5045
|
+
setPaletteState(colors);
|
|
4987
5046
|
};
|
|
4988
5047
|
const resetTheme = () => {
|
|
4989
5048
|
const basePalette = {
|
|
@@ -5409,7 +5468,7 @@ function ITDialog({
|
|
|
5409
5468
|
const content = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
5410
5469
|
"div",
|
|
5411
5470
|
{
|
|
5412
|
-
className: `fixed inset-0 flex ${fullScreen ? "items-stretch" : "items-center justify-center"} bg-black
|
|
5471
|
+
className: `fixed inset-0 flex ${fullScreen ? "items-stretch" : "items-center justify-center"} bg-black/50 z-[9999]`,
|
|
5413
5472
|
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
5414
5473
|
"div",
|
|
5415
5474
|
{
|
|
@@ -6464,7 +6523,7 @@ function ITNavbar({
|
|
|
6464
6523
|
logo && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "h-8 w-auto object-contain transition-transform hover:scale-105", children: logo }),
|
|
6465
6524
|
logoText && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ITText, { as: "span", className: "text-lg font-bold tracking-wide", style: { color: "var(--sidebar-active-color, #ffffff)" }, children: logoText })
|
|
6466
6525
|
] }),
|
|
6467
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("nav", { className: "flex-1 px-4 py-6 overflow-y-auto custom-scrollbar", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("ul", { className: "
|
|
6526
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("nav", { className: "flex-1 px-4 py-6 overflow-y-auto custom-scrollbar", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("ul", { className: "flex flex-col gap-1.5", children: navigationItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("li", { children: [
|
|
6468
6527
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
6469
6528
|
"div",
|
|
6470
6529
|
{
|
|
@@ -7981,7 +8040,7 @@ function ITSidebar({
|
|
|
7981
8040
|
!isSidebarCollapsed && item.subitems && item.subitems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: `overflow-hidden transition-all duration-400 ease-[cubic-bezier(0.2,0,0,1)] ${expandedItems.has(item.id) ? "max-h-[500px] opacity-100 mt-1" : "max-h-0 opacity-0"}`, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
7982
8041
|
"ul",
|
|
7983
8042
|
{
|
|
7984
|
-
className: "ml-5
|
|
8043
|
+
className: "ml-5 flex flex-col gap-0.5 py-1",
|
|
7985
8044
|
style: {
|
|
7986
8045
|
borderLeft: subitemConnector === "|" ? "1px solid var(--sidebar-border, #e2e8f0)" : "none"
|
|
7987
8046
|
},
|