@klu_dev/ui-klu-green 1.0.1 → 1.0.2
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 +23 -42
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,43 +1,28 @@
|
|
|
1
1
|
# 🟢 UI KLU Green
|
|
2
2
|
|
|
3
|
-
Librería de componentes UI desarrollada con
|
|
4
|
-
|
|
5
|
-
---
|
|
3
|
+
Librería de componentes UI desarrollada con React + TypeScript + TailwindCSS.
|
|
6
4
|
|
|
7
5
|
## 📦 Instalación
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
6
|
npm install @klu_dev/ui-klu-green
|
|
11
7
|
|
|
12
|
-
⚙️ Requisitos
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
React 18+
|
|
17
|
-
TailwindCSS
|
|
18
|
-
PostCSS
|
|
19
|
-
|
|
20
|
-
Componentes disponibles
|
|
21
|
-
✅ Input
|
|
22
|
-
✅ Button
|
|
23
|
-
✅ BackButton
|
|
24
|
-
|
|
25
|
-
Input
|
|
8
|
+
## ⚙️ Requisitos
|
|
9
|
+
- React 18+
|
|
10
|
+
- TailwindCSS
|
|
11
|
+
- PostCSS
|
|
26
12
|
|
|
13
|
+
## 📐 Componentes disponibles
|
|
14
|
+
- Input
|
|
15
|
+
- Button
|
|
16
|
+
- BackButton
|
|
27
17
|
|
|
18
|
+
## 🚀 Uso Input
|
|
28
19
|
import { Input } from "@klu_dev/ui-klu-green"
|
|
29
20
|
|
|
30
21
|
export default function Example() {
|
|
31
|
-
return
|
|
32
|
-
<Input
|
|
33
|
-
placeholder="Escribe algo..."
|
|
34
|
-
size="lg"
|
|
35
|
-
/>
|
|
36
|
-
)
|
|
22
|
+
return <Input placeholder="Escribe algo..." size="lg" />
|
|
37
23
|
}
|
|
38
24
|
|
|
39
|
-
|
|
40
|
-
Input con validación
|
|
25
|
+
- **Input con validación:**
|
|
41
26
|
|
|
42
27
|
import { Input } from "@klu_dev/ui-klu-green"
|
|
43
28
|
import { useState } from "react"
|
|
@@ -50,8 +35,9 @@ export default function Example() {
|
|
|
50
35
|
const val = e.target.value
|
|
51
36
|
setValue(val)
|
|
52
37
|
|
|
38
|
+
// Solo números
|
|
53
39
|
if (!/^[0-9]*$/.test(val)) {
|
|
54
|
-
setError("Solo números
|
|
40
|
+
setError("Solo se permiten números")
|
|
55
41
|
} else {
|
|
56
42
|
setError("")
|
|
57
43
|
}
|
|
@@ -62,30 +48,25 @@ export default function Example() {
|
|
|
62
48
|
value={value}
|
|
63
49
|
onChange={handleChange}
|
|
64
50
|
error={error}
|
|
65
|
-
placeholder="
|
|
51
|
+
placeholder="Ingresa solo números"
|
|
66
52
|
/>
|
|
67
53
|
)
|
|
68
54
|
}
|
|
69
55
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
import { BackButton } from "@klu_dev/ui-klu-green"
|
|
56
|
+
## 🚀 Uso Button
|
|
57
|
+
import { Button } from "@klu_dev/ui-klu-green"
|
|
74
58
|
|
|
75
59
|
export default function Example() {
|
|
76
|
-
return
|
|
77
|
-
<BackButton onClick={() => console.log("Regresar")} />
|
|
78
|
-
)
|
|
60
|
+
return <Button variant="primary">Continuar</Button>
|
|
79
61
|
}
|
|
80
62
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
import { Button } from "@klu_dev/ui-klu-green"
|
|
63
|
+
## 🚀 Uso BackButton
|
|
64
|
+
import { BackButton } from "@klu_dev/ui-klu-green"
|
|
84
65
|
|
|
85
66
|
export default function Example() {
|
|
86
67
|
return (
|
|
87
|
-
<
|
|
88
|
-
|
|
89
|
-
|
|
68
|
+
<BackButton
|
|
69
|
+
onClick={() => console.log("Regresar")}
|
|
70
|
+
/>
|
|
90
71
|
)
|
|
91
72
|
}
|