@onpe/ui 1.0.27 → 1.0.29

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.
Files changed (2) hide show
  1. package/README.md +20 -114
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -29,112 +29,11 @@ npx onpe-ui add <componente>
29
29
 
30
30
  ## ⚠️ Importante sobre Estilos
31
31
 
32
- ### Opción 1: Librería Completa (Recomendado)
33
- Esta librería **NO requiere** que instales TailwindCSS en tu proyecto. Los estilos ya están compilados y optimizados. Solo necesitas crear tu propio archivo CSS con las variables personalizadas:
34
-
35
- #### Crear archivo CSS personalizado
36
- Crea un archivo llamado `onpe-ui.css` en la raíz de tu proyecto:
37
-
38
- ```css
39
- /* Solo definimos nuestras variables y estilos personalizados */
40
-
41
-
42
-
43
- :root {
44
- --blue: #003770;
45
- --skyblue: #0073cf;
46
- --skyblue-light: #69b2e8;
47
- --yellow: #ffb81c;
48
- --light-skyblue: #aaeff6;
49
- --gray: #bcbcbc;
50
- --gray-light: #bdbdbd;
51
- --gray-extra-light: #f2f2f2;
52
- --red: #e3002b;
53
- --dark-gray: #4f4f4f;
54
- --green: #76bd43;
55
- --yellow-light: #FFF1D2;
56
- }
57
-
58
- @theme {
59
- --color-onpe-ui-blue: var(--blue);
60
- --color-onpe-ui-skyblue: var(--skyblue);
61
- --color-onpe-ui-skyblue-light: var(--skyblue-light);
62
- --color-onpe-ui-yellow: var(--yellow);
63
- --color-onpe-ui-light-skyblue: var(--light-skyblue);
64
- --color-onpe-ui-gray: var(--gray);
65
- --color-onpe-ui-gray-light: var(--gray-light);
66
- --color-onpe-ui-gray-extra-light: var(--gray-extra-light);
67
- --color-onpe-ui-red: var(--red);
68
- --color-onpe-ui-dark-gray: var(--dark-gray);
69
- --color-onpe-ui-green: var(--green);
70
- --color-onpe-ui-yellow-light: var(--yellow-light);
71
- }
72
-
73
-
74
- button{
75
- cursor: pointer;
76
- }
77
-
78
-
79
- @keyframes fastBlink {
80
- 0% {
81
- opacity: 1;
82
- }
83
- 25% {
84
- opacity: 0.8;
85
- }
86
- 50% {
87
- opacity: 0.4;
88
- }
89
- 75% {
90
- opacity: 0.8;
91
- }
92
- 100% {
93
- opacity: 1;
94
- }
95
- }
96
- .fast-blink {
97
- animation: fastBlink 0.8s ease-in-out infinite;
98
- }
99
- ```
100
-
101
- #### Importar el archivo CSS en tu proyecto
102
- ```tsx
103
- // En tu archivo principal (index.tsx, App.tsx, etc.)
104
- import './onpe-ui.css';
105
- import { Button } from '@onpe/ui/components';
106
- ```
107
-
108
- ### Opción 2: Componentes Individuales
109
- Si instalas componentes individualmente con la CLI, **SÍ necesitas** instalar y configurar TailwindCSS en tu proyecto.
32
+ **Esta librería requiere que instales y configures TailwindCSS en tu proyecto.** Los componentes usan clases de TailwindCSS que necesitan estar configuradas correctamente.
110
33
 
111
34
  ## 📖 Uso Básico
112
35
 
113
- ### Opción 1: Usar la Librería Completa
114
-
115
- #### Importar estilos
116
- ```tsx
117
- // Importar tu archivo CSS personalizado
118
- import './onpe-ui.css';
119
- import { Button } from '@onpe/ui/components';
120
- ```
121
-
122
- #### Usar componentes
123
- ```tsx
124
- import './onpe-ui.css';
125
- import { Button } from '@onpe/ui/components';
126
-
127
- function App() {
128
- return (
129
- <div>
130
- <Button color="primary" title="Votar Ahora" size="normal" />
131
- <Button color="skyblue" title="Ver Resultados" size="large" />
132
- </div>
133
- );
134
- }
135
- ```
136
-
137
- ### Opción 2: Instalar Componentes Individualmente con CLI
36
+ ### Instalar Componentes con CLI
138
37
 
139
38
  #### Instalar un componente específico
140
39
  ```bash
@@ -1450,17 +1349,17 @@ npm install @onpe/ui
1450
1349
  ```tsx
1451
1350
  /* Verificar que tengas la importación correcta */
1452
1351
  import './onpe-ui.css';
1453
- import { Button } from '@onpe/ui/components';
1352
+ import { Button } from './components/ui/Button';
1454
1353
  ```
1455
1354
 
1456
1355
  **Solución: Verificar rutas de importación**
1457
1356
  ```tsx
1458
- // ✅ CORRECTO: Importar tu archivo CSS personalizado
1357
+ // ✅ CORRECTO: Importar archivo CSS personalizado
1459
1358
  import './onpe-ui.css';
1460
- import { Button } from '@onpe/ui/components';
1359
+ import { Button } from './components/ui/Button';
1461
1360
 
1462
1361
  // ❌ INCORRECTO: No importar el archivo CSS
1463
- import { Button } from '@onpe/ui/components';
1362
+ import { Button } from './components/ui/Button';
1464
1363
  ```
1465
1364
 
1466
1365
  **Solución: Verificar configuración de bundler**
@@ -1617,9 +1516,16 @@ export default preview;
1617
1516
  npm list @onpe/ui
1618
1517
  ```
1619
1518
 
1620
- **Paso 2: Crear archivo CSS personalizado**
1519
+ **Paso 2: Configurar TailwindCSS**
1520
+ ```bash
1521
+ # Instalar TailwindCSS
1522
+ npm install -D tailwindcss postcss autoprefixer
1523
+ npx tailwindcss init -p
1524
+ ```
1525
+
1526
+ **Paso 3: Crear archivo CSS personalizado**
1621
1527
  ```css
1622
- /* Crear archivo onpe-ui.css en la raíz del proyecto */
1528
+ /* Crear archivo onpe-ui.css */
1623
1529
  :root {
1624
1530
  --blue: #003770;
1625
1531
  --skyblue: #0073cf;
@@ -1632,21 +1538,21 @@ npm list @onpe/ui
1632
1538
  }
1633
1539
  ```
1634
1540
 
1635
- **Paso 3: Importar estilos**
1541
+ **Paso 4: Importar archivo CSS**
1636
1542
  ```tsx
1637
1543
  // En tu archivo principal (index.tsx)
1638
1544
  import './onpe-ui.css';
1639
- import { Button } from '@onpe/ui/components';
1545
+ import { Button } from './components/ui/Button';
1640
1546
  ```
1641
1547
 
1642
- **Paso 4: Verificar orden de importación**
1548
+ **Paso 5: Verificar orden de importación**
1643
1549
  ```tsx
1644
1550
  // ✅ CORRECTO
1645
1551
  import './onpe-ui.css';
1646
- import { Button } from '@onpe/ui/components';
1552
+ import { Button } from './components/ui/Button';
1647
1553
 
1648
1554
  // ❌ INCORRECTO
1649
- import { Button } from '@onpe/ui/components';
1555
+ import { Button } from './components/ui/Button';
1650
1556
  // Falta importar el archivo CSS
1651
1557
  ```
1652
1558
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onpe/ui",
3
- "version": "1.0.27",
3
+ "version": "1.0.29",
4
4
  "type": "module",
5
5
  "description": "Librería completa de UI para ONPE - Componentes, Hooks, Utils y Librerías",
6
6
  "main": "dist/index.js",