@onpe/ui 1.0.28 → 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 +29 -65
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -29,45 +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 importar los estilos:
34
-
35
- ```tsx
36
- // En tu archivo principal (index.tsx, App.tsx, etc.)
37
- import '@onpe/ui/styles';
38
- import { Button } from '@onpe/ui/components';
39
- ```
40
-
41
- ### Opción 2: Componentes Individuales (CLI)
42
- Si instalas componentes individualmente con la CLI, **SÍ necesitas** instalar y configurar TailwindCSS en tu proyecto, y crear un archivo CSS con las variables personalizadas.
32
+ **Esta librería requiere que instales y configures TailwindCSS en tu proyecto.** Los componentes usan clases de TailwindCSS que necesitan estar configuradas correctamente.
43
33
 
44
34
  ## 📖 Uso Básico
45
35
 
46
- ### Opción 1: Usar la Librería Completa
47
-
48
- #### Importar estilos
49
- ```tsx
50
- // Importar estilos de la librería
51
- import '@onpe/ui/styles';
52
- import { Button } from '@onpe/ui/components';
53
- ```
54
-
55
- #### Usar componentes
56
- ```tsx
57
- import '@onpe/ui/styles';
58
- import { Button } from '@onpe/ui/components';
59
-
60
- function App() {
61
- return (
62
- <div>
63
- <Button color="primary" title="Votar Ahora" size="normal" />
64
- <Button color="skyblue" title="Ver Resultados" size="large" />
65
- </div>
66
- );
67
- }
68
- ```
69
-
70
- ### Opción 2: Instalar Componentes Individualmente con CLI
36
+ ### Instalar Componentes con CLI
71
37
 
72
38
  #### Instalar un componente específico
73
39
  ```bash
@@ -1382,18 +1348,18 @@ npm install @onpe/ui
1382
1348
  **Estilos no se cargan**
1383
1349
  ```tsx
1384
1350
  /* Verificar que tengas la importación correcta */
1385
- import '@onpe/ui/styles';
1386
- import { Button } from '@onpe/ui/components';
1351
+ import './onpe-ui.css';
1352
+ import { Button } from './components/ui/Button';
1387
1353
  ```
1388
1354
 
1389
1355
  **Solución: Verificar rutas de importación**
1390
1356
  ```tsx
1391
- // ✅ CORRECTO: Importar estilos de la librería
1392
- import '@onpe/ui/styles';
1393
- import { Button } from '@onpe/ui/components';
1357
+ // ✅ CORRECTO: Importar archivo CSS personalizado
1358
+ import './onpe-ui.css';
1359
+ import { Button } from './components/ui/Button';
1394
1360
 
1395
- // ❌ INCORRECTO: No importar los estilos
1396
- import { Button } from '@onpe/ui/components';
1361
+ // ❌ INCORRECTO: No importar el archivo CSS
1362
+ import { Button } from './components/ui/Button';
1397
1363
  ```
1398
1364
 
1399
1365
  **Solución: Verificar configuración de bundler**
@@ -1550,34 +1516,14 @@ export default preview;
1550
1516
  npm list @onpe/ui
1551
1517
  ```
1552
1518
 
1553
- **Paso 2: Importar estilos (Librería Completa)**
1554
- ```tsx
1555
- // En tu archivo principal (index.tsx)
1556
- import '@onpe/ui/styles';
1557
- import { Button } from '@onpe/ui/components';
1558
- ```
1559
-
1560
- **Paso 3: Verificar orden de importación**
1561
- ```tsx
1562
- // ✅ CORRECTO
1563
- import '@onpe/ui/styles';
1564
- import { Button } from '@onpe/ui/components';
1565
-
1566
- // ❌ INCORRECTO
1567
- import { Button } from '@onpe/ui/components';
1568
- // Falta importar los estilos
1569
- ```
1570
-
1571
- ### ¿Usas CLI para componentes individuales?
1572
-
1573
- **Entonces SÍ necesitas configurar TailwindCSS:**
1519
+ **Paso 2: Configurar TailwindCSS**
1574
1520
  ```bash
1575
1521
  # Instalar TailwindCSS
1576
1522
  npm install -D tailwindcss postcss autoprefixer
1577
1523
  npx tailwindcss init -p
1578
1524
  ```
1579
1525
 
1580
- **Y crear archivo CSS personalizado:**
1526
+ **Paso 3: Crear archivo CSS personalizado**
1581
1527
  ```css
1582
1528
  /* Crear archivo onpe-ui.css */
1583
1529
  :root {
@@ -1592,6 +1538,24 @@ npx tailwindcss init -p
1592
1538
  }
1593
1539
  ```
1594
1540
 
1541
+ **Paso 4: Importar archivo CSS**
1542
+ ```tsx
1543
+ // En tu archivo principal (index.tsx)
1544
+ import './onpe-ui.css';
1545
+ import { Button } from './components/ui/Button';
1546
+ ```
1547
+
1548
+ **Paso 5: Verificar orden de importación**
1549
+ ```tsx
1550
+ // ✅ CORRECTO
1551
+ import './onpe-ui.css';
1552
+ import { Button } from './components/ui/Button';
1553
+
1554
+ // ❌ INCORRECTO
1555
+ import { Button } from './components/ui/Button';
1556
+ // Falta importar el archivo CSS
1557
+ ```
1558
+
1595
1559
  ### ¿Los colores no funcionan?
1596
1560
 
1597
1561
  **Solución: Usar clases correctas**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onpe/ui",
3
- "version": "1.0.28",
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",