@axzydev/axzy_ui_system 1.2.8 → 1.2.11
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 +109 -51
- package/dist/index.cjs +141 -73
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +141 -5
- package/dist/index.d.ts +141 -5
- package/dist/index.js +141 -73
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
- package/snippets/axzy-ui-system.code-snippets +547 -0
- package/src/App.tsx +43 -33
- package/src/components/avatar/avatar.props.ts +12 -1
- package/src/components/avatar/avatar.stories.tsx +19 -0
- package/src/components/avatar/avatar.tsx +26 -3
- package/src/components/confirm-dialog/confirm-dialog.tsx +1 -1
- package/src/components/data-table/dataTable.props.ts +10 -0
- package/src/components/data-table/dataTable.tsx +24 -13
- package/src/components/date-picker/datePicker.tsx +1 -1
- package/src/components/dialog/dialog.tsx +2 -1
- package/src/components/drawer/drawer.tsx +1 -1
- package/src/components/dropfile/dropfile.props.ts +6 -0
- package/src/components/dropfile/dropfile.tsx +51 -16
- package/src/components/layout/layout.tsx +1 -1
- package/src/components/navbar/navbar.tsx +2 -2
- package/src/components/popover/popover.tsx +1 -1
- package/src/components/search-select/search-select.tsx +4 -4
- package/src/components/select/select.tsx +6 -8
- package/src/components/sidebar/sidebar.tsx +15 -15
- package/src/components/stepper/stepper.props.ts +4 -0
- package/src/components/table/table.props.ts +21 -3
- package/src/components/table/table.tsx +24 -13
- package/src/components/theme-provider/themeProvider.props.ts +21 -3
- package/src/components/time-picker/timePicker.tsx +1 -1
- package/src/components/toast/toast.tsx +1 -1
- package/src/components/tooltip/tooltip.tsx +1 -1
- package/src/components/topbar/topbar.tsx +1 -1
- package/src/dev.css +1 -1
- package/src/hooks/useClickOutside.ts +8 -0
- package/src/hooks/useTableState.ts +5 -2
- package/src/index.css +1 -1
- package/src/showcases/GettingStartedShowcase.tsx +207 -0
- package/src/showcases/HomeShowcase.tsx +95 -3
- package/src/theme/theme.ts +21 -0
- package/src/types/field.types.ts +70 -7
package/README.md
CHANGED
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
# AXZY UI System
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Librería de componentes React enterprise-ready con **Tailwind CSS v4**. Diseñada para aplicaciones de datos densos, dashboards y sistemas de gestión.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Instalación en un proyecto nuevo
|
|
8
8
|
|
|
9
|
-
### 1. Crear
|
|
9
|
+
### 1. Crear proyecto Vite + React + TypeScript
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
npm create vite@latest mi-app -- --template react-ts
|
|
13
13
|
cd mi-app
|
|
14
|
-
npm install
|
|
15
14
|
```
|
|
16
15
|
|
|
17
|
-
### 2. Instalar
|
|
16
|
+
### 2. Instalar dependencias
|
|
18
17
|
|
|
19
18
|
```bash
|
|
20
19
|
npm install @axzydev/axzy_ui_system
|
|
21
|
-
npm install -D tailwindcss @tailwindcss/vite
|
|
20
|
+
npm install -D tailwindcss @tailwindcss/vite @vitejs/plugin-react-swc
|
|
22
21
|
```
|
|
23
22
|
|
|
24
|
-
### 3. Configurar Vite
|
|
23
|
+
### 3. Configurar Vite con Tailwind v4
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
`vite.config.ts`:
|
|
27
26
|
|
|
28
27
|
```ts
|
|
29
28
|
import { defineConfig } from "vite"
|
|
@@ -35,61 +34,51 @@ export default defineConfig({
|
|
|
35
34
|
})
|
|
36
35
|
```
|
|
37
36
|
|
|
38
|
-
### 4.
|
|
37
|
+
### 4. Importar Tailwind CSS
|
|
39
38
|
|
|
40
|
-
|
|
39
|
+
`src/index.css`:
|
|
41
40
|
|
|
42
41
|
```css
|
|
43
42
|
@import "tailwindcss";
|
|
44
43
|
```
|
|
45
44
|
|
|
46
|
-
### 5.
|
|
45
|
+
### 5. Importar el CSS de la librería
|
|
46
|
+
|
|
47
|
+
`src/main.tsx`:
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
import "@axzydev/axzy_ui_system/dist/index.css"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 6. Envolver con ITThemeProvider
|
|
54
|
+
|
|
55
|
+
`src/main.tsx`:
|
|
47
56
|
|
|
48
57
|
```tsx
|
|
49
|
-
// src/main.tsx
|
|
50
58
|
import React from "react"
|
|
51
59
|
import ReactDOM from "react-dom/client"
|
|
52
60
|
import { ITThemeProvider } from "@axzydev/axzy_ui_system"
|
|
53
61
|
import App from "./App"
|
|
54
62
|
import "./index.css"
|
|
55
63
|
|
|
56
|
-
const myTheme = {
|
|
57
|
-
colors: {
|
|
58
|
-
primary: {
|
|
59
|
-
50: "#fef2f2",
|
|
60
|
-
100: "#fee2e2",
|
|
61
|
-
200: "#fecaca",
|
|
62
|
-
300: "#fca5a5",
|
|
63
|
-
400: "#f87171",
|
|
64
|
-
500: "#ef4444",
|
|
65
|
-
600: "#dc2626",
|
|
66
|
-
700: "#b91c1c",
|
|
67
|
-
800: "#991b1b",
|
|
68
|
-
900: "#7f1d1d",
|
|
69
|
-
950: "#450a0a",
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
}
|
|
73
|
-
|
|
74
64
|
ReactDOM.createRoot(document.getElementById("root")!).render(
|
|
75
65
|
<React.StrictMode>
|
|
76
|
-
<ITThemeProvider
|
|
66
|
+
<ITThemeProvider>
|
|
77
67
|
<App />
|
|
78
68
|
</ITThemeProvider>
|
|
79
69
|
</React.StrictMode>
|
|
80
70
|
)
|
|
81
71
|
```
|
|
82
72
|
|
|
83
|
-
### 6.
|
|
73
|
+
### 6. Usar componentes
|
|
84
74
|
|
|
85
75
|
```tsx
|
|
86
|
-
// src/App.tsx
|
|
87
76
|
import { ITButton } from "@axzydev/axzy_ui_system"
|
|
88
77
|
|
|
89
78
|
export default function App() {
|
|
90
79
|
return (
|
|
91
80
|
<div className="p-8">
|
|
92
|
-
<ITButton
|
|
81
|
+
<ITButton>Hola Mundo</ITButton>
|
|
93
82
|
</div>
|
|
94
83
|
)
|
|
95
84
|
}
|
|
@@ -97,37 +86,105 @@ export default function App() {
|
|
|
97
86
|
|
|
98
87
|
---
|
|
99
88
|
|
|
89
|
+
## Desarrollo local (contribuir)
|
|
90
|
+
|
|
91
|
+
### 1. Clonar e instalar
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
git clone https://github.com/axzydev/axzy_ui_system.git
|
|
95
|
+
cd axzy_ui_system
|
|
96
|
+
pnpm install
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### 2. Iniciar servidor de desarrollo (sandbox interactivo)
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
pnpm dev
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Abre `http://localhost:5173` para ver el Interactive Sandbox con todos los componentes.
|
|
106
|
+
|
|
107
|
+
### 3. Storybook (documentación visual)
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
pnpm storybook
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### 4. Build de producción
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
pnpm build # TypeScript + Vite
|
|
117
|
+
pnpm bundle # tsup + CSS
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Scripts
|
|
123
|
+
|
|
124
|
+
| Comando | Descripción |
|
|
125
|
+
|---------|-------------|
|
|
126
|
+
| `pnpm dev` | Sandbox interactivo (Vite) |
|
|
127
|
+
| `pnpm build` | TypeScript + Vite build |
|
|
128
|
+
| `pnpm build:app` | Build de la app sandbox |
|
|
129
|
+
| `pnpm bundle` | Bundle del paquete (tsup + CSS) |
|
|
130
|
+
| `pnpm watch` | Watch mode para desarrollo del paquete |
|
|
131
|
+
| `pnpm storybook` | Storybook local |
|
|
132
|
+
| `pnpm build-storybook` | Build estático de Storybook |
|
|
133
|
+
| `pnpm lint` | ESLint |
|
|
134
|
+
| `pnpm preview` | Preview del build |
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
100
138
|
## Theming
|
|
101
139
|
|
|
102
|
-
|
|
140
|
+
Personaliza la paleta de colores en runtime sin recompilar:
|
|
103
141
|
|
|
104
142
|
```tsx
|
|
105
143
|
const myTheme = {
|
|
106
144
|
colors: {
|
|
107
|
-
primary: { 50: "
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
danger: { 50: "...", 500: "#ef4444", ... },
|
|
111
|
-
warning: { 50: "...", 500: "#f59e0b", ... },
|
|
112
|
-
purple: { 50: "...", 500: "#a855f7", ... },
|
|
113
|
-
info: { 50: "...", 500: "#06b6d4", ... },
|
|
145
|
+
primary: { 50: "#fef2f2", 500: "#ef4444", 900: "#7f1d1d" },
|
|
146
|
+
success: { 50: "#f0fdf4", 500: "#22c55e" },
|
|
147
|
+
// solo necesitas los colores que quieras sobreescribir
|
|
114
148
|
},
|
|
115
149
|
}
|
|
150
|
+
|
|
151
|
+
<ITThemeProvider theme={myTheme}>
|
|
152
|
+
<App />
|
|
153
|
+
</ITThemeProvider>
|
|
116
154
|
```
|
|
117
155
|
|
|
118
|
-
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Componentes disponibles
|
|
159
|
+
|
|
160
|
+
- **ITButton** – Botón con variants (filled, outlined, raised, rounded, text, link, icon-only)
|
|
161
|
+
- **ITInput** – Input con soporte para texto, password, número, textarea, iconos
|
|
162
|
+
- **ITSelect** – Dropdown nativo estilizado
|
|
163
|
+
- **ITSearchSelect** – Select con búsqueda y opciones async
|
|
164
|
+
- **ITDatePicker** / **ITTimePicker** – Selectores de fecha y hora
|
|
165
|
+
- **ITCalendar** – Calendario con eventos y modos month/week/day
|
|
166
|
+
- **ITSlideToggle** – Switch toggle
|
|
167
|
+
- **ITDropfile** – Área de arrastrar y soltar archivos
|
|
168
|
+
- **ITFormBuilder** – Generador dinámico de formularios desde JSON
|
|
169
|
+
- **ITTable** / **ITDataTable** – Tablas con filtros, ordenamiento y paginación
|
|
170
|
+
- **ITCard** / **ITStatCard** – Tarjetas de contenido y métricas
|
|
171
|
+
- **ITLayout** / **ITNavbar** – Sistema de layout con sidebar colapsable
|
|
172
|
+
- **ITFlex** / **ITStack** / **ITGrid** – Layout helpers
|
|
173
|
+
- **ITText** – Tipografía con variants
|
|
174
|
+
- **ITAvatar** – Avatares con iniciales
|
|
175
|
+
- **ITBadget** – Badges de estado
|
|
176
|
+
- **ITDivider** – Divisores
|
|
177
|
+
- **ITProgress** – Barras de progreso
|
|
178
|
+
- **ITPagination** – Paginación
|
|
179
|
+
- **ITPageHeader** – Encabezados de página
|
|
180
|
+
- **ITPage** – Página completa con layout
|
|
181
|
+
- **ITThemeProvider** – Proveedor de tema
|
|
119
182
|
|
|
120
183
|
---
|
|
121
184
|
|
|
122
|
-
##
|
|
185
|
+
## Autocomplete / IntelliSense
|
|
123
186
|
|
|
124
|
-
|
|
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 |
|
|
187
|
+
Al instalar el paquete obtienes autocomplete de props en JSX automáticamente (TypeScript + JSDoc). También incluye snippets de VS Code para insertar cada componente con un par de teclas. Ver [`AUTOCOMPLETE_SETUP.md`](./AUTOCOMPLETE_SETUP.md) para el setup completo (snippets, Tailwind IntelliSense).
|
|
131
188
|
|
|
132
189
|
---
|
|
133
190
|
|
|
@@ -136,3 +193,4 @@ Solo debes proveer los colores que quieras cambiar — el resto usa los valores
|
|
|
136
193
|
- React 18+
|
|
137
194
|
- Tailwind CSS 4.x + `@tailwindcss/vite`
|
|
138
195
|
- Node.js 18+
|
|
196
|
+
- pnpm (para desarrollo local)
|