@onpe/ui 1.0.27 → 1.0.28
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 +40 -98
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,83 +30,16 @@ npx onpe-ui add <componente>
|
|
|
30
30
|
## ⚠️ Importante sobre Estilos
|
|
31
31
|
|
|
32
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
|
|
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
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
35
|
```tsx
|
|
103
36
|
// En tu archivo principal (index.tsx, App.tsx, etc.)
|
|
104
|
-
import '
|
|
37
|
+
import '@onpe/ui/styles';
|
|
105
38
|
import { Button } from '@onpe/ui/components';
|
|
106
39
|
```
|
|
107
40
|
|
|
108
|
-
### Opción 2: Componentes Individuales
|
|
109
|
-
Si instalas componentes individualmente con la CLI, **SÍ necesitas** instalar y configurar TailwindCSS en tu proyecto.
|
|
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.
|
|
110
43
|
|
|
111
44
|
## 📖 Uso Básico
|
|
112
45
|
|
|
@@ -114,14 +47,14 @@ Si instalas componentes individualmente con la CLI, **SÍ necesitas** instalar y
|
|
|
114
47
|
|
|
115
48
|
#### Importar estilos
|
|
116
49
|
```tsx
|
|
117
|
-
// Importar
|
|
118
|
-
import '
|
|
50
|
+
// Importar estilos de la librería
|
|
51
|
+
import '@onpe/ui/styles';
|
|
119
52
|
import { Button } from '@onpe/ui/components';
|
|
120
53
|
```
|
|
121
54
|
|
|
122
55
|
#### Usar componentes
|
|
123
56
|
```tsx
|
|
124
|
-
import '
|
|
57
|
+
import '@onpe/ui/styles';
|
|
125
58
|
import { Button } from '@onpe/ui/components';
|
|
126
59
|
|
|
127
60
|
function App() {
|
|
@@ -1449,17 +1382,17 @@ npm install @onpe/ui
|
|
|
1449
1382
|
**Estilos no se cargan**
|
|
1450
1383
|
```tsx
|
|
1451
1384
|
/* Verificar que tengas la importación correcta */
|
|
1452
|
-
import '
|
|
1385
|
+
import '@onpe/ui/styles';
|
|
1453
1386
|
import { Button } from '@onpe/ui/components';
|
|
1454
1387
|
```
|
|
1455
1388
|
|
|
1456
1389
|
**Solución: Verificar rutas de importación**
|
|
1457
1390
|
```tsx
|
|
1458
|
-
// ✅ CORRECTO: Importar
|
|
1459
|
-
import '
|
|
1391
|
+
// ✅ CORRECTO: Importar estilos de la librería
|
|
1392
|
+
import '@onpe/ui/styles';
|
|
1460
1393
|
import { Button } from '@onpe/ui/components';
|
|
1461
1394
|
|
|
1462
|
-
// ❌ INCORRECTO: No importar
|
|
1395
|
+
// ❌ INCORRECTO: No importar los estilos
|
|
1463
1396
|
import { Button } from '@onpe/ui/components';
|
|
1464
1397
|
```
|
|
1465
1398
|
|
|
@@ -1617,37 +1550,46 @@ export default preview;
|
|
|
1617
1550
|
npm list @onpe/ui
|
|
1618
1551
|
```
|
|
1619
1552
|
|
|
1620
|
-
**Paso 2:
|
|
1621
|
-
```css
|
|
1622
|
-
/* Crear archivo onpe-ui.css en la raíz del proyecto */
|
|
1623
|
-
:root {
|
|
1624
|
-
--blue: #003770;
|
|
1625
|
-
--skyblue: #0073cf;
|
|
1626
|
-
/* ... resto de variables */
|
|
1627
|
-
}
|
|
1628
|
-
|
|
1629
|
-
@theme {
|
|
1630
|
-
--color-onpe-ui-blue: var(--blue);
|
|
1631
|
-
/* ... resto de colores */
|
|
1632
|
-
}
|
|
1633
|
-
```
|
|
1634
|
-
|
|
1635
|
-
**Paso 3: Importar estilos**
|
|
1553
|
+
**Paso 2: Importar estilos (Librería Completa)**
|
|
1636
1554
|
```tsx
|
|
1637
1555
|
// En tu archivo principal (index.tsx)
|
|
1638
|
-
import '
|
|
1556
|
+
import '@onpe/ui/styles';
|
|
1639
1557
|
import { Button } from '@onpe/ui/components';
|
|
1640
1558
|
```
|
|
1641
1559
|
|
|
1642
|
-
**Paso
|
|
1560
|
+
**Paso 3: Verificar orden de importación**
|
|
1643
1561
|
```tsx
|
|
1644
1562
|
// ✅ CORRECTO
|
|
1645
|
-
import '
|
|
1563
|
+
import '@onpe/ui/styles';
|
|
1646
1564
|
import { Button } from '@onpe/ui/components';
|
|
1647
1565
|
|
|
1648
1566
|
// ❌ INCORRECTO
|
|
1649
1567
|
import { Button } from '@onpe/ui/components';
|
|
1650
|
-
// Falta importar
|
|
1568
|
+
// Falta importar los estilos
|
|
1569
|
+
```
|
|
1570
|
+
|
|
1571
|
+
### ¿Usas CLI para componentes individuales?
|
|
1572
|
+
|
|
1573
|
+
**Entonces SÍ necesitas configurar TailwindCSS:**
|
|
1574
|
+
```bash
|
|
1575
|
+
# Instalar TailwindCSS
|
|
1576
|
+
npm install -D tailwindcss postcss autoprefixer
|
|
1577
|
+
npx tailwindcss init -p
|
|
1578
|
+
```
|
|
1579
|
+
|
|
1580
|
+
**Y crear archivo CSS personalizado:**
|
|
1581
|
+
```css
|
|
1582
|
+
/* Crear archivo onpe-ui.css */
|
|
1583
|
+
:root {
|
|
1584
|
+
--blue: #003770;
|
|
1585
|
+
--skyblue: #0073cf;
|
|
1586
|
+
/* ... resto de variables */
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
@theme {
|
|
1590
|
+
--color-onpe-ui-blue: var(--blue);
|
|
1591
|
+
/* ... resto de colores */
|
|
1592
|
+
}
|
|
1651
1593
|
```
|
|
1652
1594
|
|
|
1653
1595
|
### ¿Los colores no funcionan?
|