@axzydev/axzy_ui_system 1.1.0 → 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 CHANGED
@@ -1,49 +1,59 @@
1
1
  # AXZY UI System
2
2
 
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.
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
- ## Installation
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
- ## Basic Setup
24
+ ### 3. Configurar Vite
12
25
 
13
- Then, you must tell your own `tailwind.config.ts` to scan the library for its dynamic classes:
26
+ Edita `vite.config.ts`:
14
27
 
15
28
  ```ts
16
- // tailwind.config.ts
17
- import type { Config } from 'tailwindcss'
18
-
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: {},
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
- ## Dynamic Theming (ITThemeProvider)
40
+ En `src/index.css`:
35
41
 
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>`.
42
+ ```css
43
+ @import "tailwindcss";
44
+ ```
37
45
 
38
- Wrap your application root with the provider and pass your custom brand JSON object:
46
+ ### 5. Envolver la app con ITThemeProvider
39
47
 
40
48
  ```tsx
41
- import React from 'react';
42
- import { ITThemeProvider } from '@axzydev/axzy_ui_system';
43
- import App from './App';
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
- // Define your custom brand palette mapping
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", // Your Main Brand Color
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
- // You can optionally override secondary, success, danger, warning, purple, info
62
- }
63
- };
71
+ },
72
+ }
64
73
 
65
- export default function Main() {
66
- return (
67
- <ITThemeProvider theme={myEnterpriseTheme}>
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
- > **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.
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+