@onpe/ui 1.0.29 → 1.0.31
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 +65 -45
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ npm install @onpe/ui
|
|
|
24
24
|
npm install -g @onpe/ui
|
|
25
25
|
|
|
26
26
|
# O usar directamente con npx
|
|
27
|
-
npx onpe
|
|
27
|
+
npx @onpe/ui add <componente>
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
## ⚠️ Importante sobre Estilos
|
|
@@ -35,29 +35,34 @@ npx onpe-ui add <componente>
|
|
|
35
35
|
|
|
36
36
|
### Instalar Componentes con CLI
|
|
37
37
|
|
|
38
|
-
#### Instalar
|
|
38
|
+
#### Instalar componentes específicos
|
|
39
39
|
```bash
|
|
40
|
-
#
|
|
41
|
-
npx onpe
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
npx onpe
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
npx onpe
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
npx onpe
|
|
40
|
+
# Componentes
|
|
41
|
+
npx @onpe/ui add button
|
|
42
|
+
npx @onpe/ui add modal
|
|
43
|
+
npx @onpe/ui add portal
|
|
44
|
+
npx @onpe/ui add overlay
|
|
45
|
+
npx @onpe/ui add show
|
|
46
|
+
|
|
47
|
+
# Iconos
|
|
48
|
+
npx @onpe/ui add icon-close
|
|
49
|
+
npx @onpe/ui add icon-check
|
|
50
|
+
npx @onpe/ui add icon-warning
|
|
51
|
+
npx @onpe/ui add icon-chrome
|
|
52
|
+
npx @onpe/ui add icon-firefox
|
|
53
|
+
npx @onpe/ui add icon-safari
|
|
54
|
+
npx @onpe/ui add icon-edge
|
|
55
|
+
npx @onpe/ui add icon-windows
|
|
56
|
+
npx @onpe/ui add icon-apple
|
|
57
|
+
npx @onpe/ui add icon-android
|
|
54
58
|
```
|
|
55
59
|
|
|
56
60
|
#### Usar componentes instalados individualmente
|
|
57
61
|
```tsx
|
|
58
62
|
// Después de instalar con CLI
|
|
59
|
-
import { Button } from './components/ui/Button';
|
|
60
|
-
import { Modal } from './components/ui/Modal';
|
|
63
|
+
import { Button } from './components/onpe-ui/Button';
|
|
64
|
+
import { Modal } from './components/onpe-ui/Modal';
|
|
65
|
+
import { IconClose } from './components/onpe-icons/IconClose';
|
|
61
66
|
import { useState } from 'react';
|
|
62
67
|
|
|
63
68
|
function App() {
|
|
@@ -80,11 +85,14 @@ function App() {
|
|
|
80
85
|
<div className="p-6">
|
|
81
86
|
<h2 className="text-xl font-bold mb-4">Contenido del Modal</h2>
|
|
82
87
|
<p className="mb-4">Este es un ejemplo de modal con contenido.</p>
|
|
83
|
-
<
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
+
<div className="flex items-center gap-2">
|
|
89
|
+
<IconClose className="w-4 h-4" />
|
|
90
|
+
<Button
|
|
91
|
+
color="green"
|
|
92
|
+
title="Cerrar"
|
|
93
|
+
onClick={() => setIsOpen(false)}
|
|
94
|
+
/>
|
|
95
|
+
</div>
|
|
88
96
|
</div>
|
|
89
97
|
</Modal>
|
|
90
98
|
</div>
|
|
@@ -194,7 +202,7 @@ Show
|
|
|
194
202
|
|
|
195
203
|
**Modal** - Instala automáticamente sus dependencias:
|
|
196
204
|
```bash
|
|
197
|
-
npx onpe
|
|
205
|
+
npx @onpe/ui add modal
|
|
198
206
|
# Esto instalará automáticamente:
|
|
199
207
|
# - Portal.tsx
|
|
200
208
|
# - Overlay.tsx
|
|
@@ -203,10 +211,10 @@ npx onpe-ui add modal
|
|
|
203
211
|
|
|
204
212
|
**Otros componentes** - Instalación independiente:
|
|
205
213
|
```bash
|
|
206
|
-
npx onpe
|
|
207
|
-
npx onpe
|
|
208
|
-
npx onpe
|
|
209
|
-
npx onpe
|
|
214
|
+
npx @onpe/ui add button # Sin dependencias
|
|
215
|
+
npx @onpe/ui add portal # Sin dependencias
|
|
216
|
+
npx @onpe/ui add overlay # Sin dependencias
|
|
217
|
+
npx @onpe/ui add show # Sin dependencias
|
|
210
218
|
```
|
|
211
219
|
|
|
212
220
|
### Estructura de Archivos Después de la Instalación
|
|
@@ -214,12 +222,21 @@ npx onpe-ui add show # Sin dependencias
|
|
|
214
222
|
```
|
|
215
223
|
src/
|
|
216
224
|
└── components/
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
225
|
+
├── ui/ # shadcn/ui (si está instalado)
|
|
226
|
+
│ ├── button.tsx
|
|
227
|
+
│ └── input.tsx
|
|
228
|
+
├── onpe-ui/ # ONPE UI - Componentes
|
|
229
|
+
│ ├── Button.tsx
|
|
230
|
+
│ ├── Modal.tsx
|
|
231
|
+
│ ├── Overlay.tsx
|
|
232
|
+
│ ├── Portal.tsx
|
|
233
|
+
│ └── Show.tsx
|
|
234
|
+
└── onpe-icons/ # ONPE UI - Iconos
|
|
235
|
+
├── IconClose.tsx
|
|
236
|
+
├── IconCheck.tsx
|
|
237
|
+
├── IconChrome.tsx
|
|
238
|
+
├── IconFirefox.tsx
|
|
239
|
+
└── IconWindows.tsx
|
|
223
240
|
```
|
|
224
241
|
|
|
225
242
|
## 🧩 Componentes Disponibles
|
|
@@ -1303,7 +1320,7 @@ export default AdminDashboard;
|
|
|
1303
1320
|
**Error: "Componente no encontrado"**
|
|
1304
1321
|
```bash
|
|
1305
1322
|
# Verificar componentes disponibles
|
|
1306
|
-
npx onpe
|
|
1323
|
+
npx @onpe/ui add --help
|
|
1307
1324
|
|
|
1308
1325
|
# Componentes válidos:
|
|
1309
1326
|
# button, modal, overlay, portal, show
|
|
@@ -1349,17 +1366,18 @@ npm install @onpe/ui
|
|
|
1349
1366
|
```tsx
|
|
1350
1367
|
/* Verificar que tengas la importación correcta */
|
|
1351
1368
|
import './onpe-ui.css';
|
|
1352
|
-
import { Button } from './components/ui/Button';
|
|
1369
|
+
import { Button } from './components/onpe-ui/Button';
|
|
1353
1370
|
```
|
|
1354
1371
|
|
|
1355
1372
|
**Solución: Verificar rutas de importación**
|
|
1356
1373
|
```tsx
|
|
1357
1374
|
// ✅ CORRECTO: Importar archivo CSS personalizado
|
|
1358
1375
|
import './onpe-ui.css';
|
|
1359
|
-
import { Button } from './components/ui/Button';
|
|
1376
|
+
import { Button } from './components/onpe-ui/Button';
|
|
1377
|
+
import { IconClose } from './components/onpe-icons/IconClose';
|
|
1360
1378
|
|
|
1361
1379
|
// ❌ INCORRECTO: No importar el archivo CSS
|
|
1362
|
-
import { Button } from './components/ui/Button';
|
|
1380
|
+
import { Button } from './components/onpe-ui/Button';
|
|
1363
1381
|
```
|
|
1364
1382
|
|
|
1365
1383
|
**Solución: Verificar configuración de bundler**
|
|
@@ -1542,17 +1560,19 @@ npx tailwindcss init -p
|
|
|
1542
1560
|
```tsx
|
|
1543
1561
|
// En tu archivo principal (index.tsx)
|
|
1544
1562
|
import './onpe-ui.css';
|
|
1545
|
-
import { Button } from './components/ui/Button';
|
|
1563
|
+
import { Button } from './components/onpe-ui/Button';
|
|
1564
|
+
import { IconClose } from './components/onpe-icons/IconClose';
|
|
1546
1565
|
```
|
|
1547
1566
|
|
|
1548
1567
|
**Paso 5: Verificar orden de importación**
|
|
1549
1568
|
```tsx
|
|
1550
1569
|
// ✅ CORRECTO
|
|
1551
1570
|
import './onpe-ui.css';
|
|
1552
|
-
import { Button } from './components/ui/Button';
|
|
1571
|
+
import { Button } from './components/onpe-ui/Button';
|
|
1572
|
+
import { IconClose } from './components/onpe-icons/IconClose';
|
|
1553
1573
|
|
|
1554
1574
|
// ❌ INCORRECTO
|
|
1555
|
-
import { Button } from './components/ui/Button';
|
|
1575
|
+
import { Button } from './components/onpe-ui/Button';
|
|
1556
1576
|
// Falta importar el archivo CSS
|
|
1557
1577
|
```
|
|
1558
1578
|
|
|
@@ -1595,12 +1615,12 @@ viteFinal: async (config) => {
|
|
|
1595
1615
|
**Solución: Verificar comandos**
|
|
1596
1616
|
```bash
|
|
1597
1617
|
# ✅ CORRECTO
|
|
1598
|
-
npx onpe
|
|
1599
|
-
npx onpe
|
|
1618
|
+
npx @onpe/ui add button
|
|
1619
|
+
npx @onpe/ui add modal
|
|
1600
1620
|
|
|
1601
1621
|
# ❌ INCORRECTO
|
|
1602
|
-
npx onpe
|
|
1603
|
-
npx onpe
|
|
1622
|
+
npx @onpe/ui add Button
|
|
1623
|
+
npx @onpe/ui add Modal
|
|
1604
1624
|
```
|
|
1605
1625
|
|
|
1606
1626
|
### ¿Portal no funciona?
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onpe/ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.31",
|
|
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",
|
|
7
7
|
"module": "dist/index.esm.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
9
9
|
"bin": {
|
|
10
|
-
"onpe
|
|
10
|
+
"@onpe/ui": "dist/cli.js"
|
|
11
11
|
},
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|