@clicoh/orion-library 0.2.28 → 1.0.0-b
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 +216 -36
- package/assets/css/base.css +1 -0
- package/package.json +15 -17
package/README.md
CHANGED
|
@@ -1,36 +1,216 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
1
|
+
# Orion Library
|
|
2
|
+
|
|
3
|
+
Librería de componentes React para proyectos Next.js, construida con TypeScript y TailwindCSS.
|
|
4
|
+
|
|
5
|
+
## Instalación
|
|
6
|
+
|
|
7
|
+
Instala la librería usando npm:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @clicoh/orion-library
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
O con yarn:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
yarn add @clicoh/orion-library
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
O con pnpm:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pnpm add @clicoh/orion-library
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Configuración
|
|
26
|
+
|
|
27
|
+
### 1. Configurar TailwindCSS
|
|
28
|
+
|
|
29
|
+
Agrega la ruta de la librería a tu archivo `tailwind.config.ts` para que los estilos sean detectados:
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
import type { Config } from 'tailwindcss';
|
|
33
|
+
|
|
34
|
+
const config: Config = {
|
|
35
|
+
content: [
|
|
36
|
+
'./src/**/*.{js,ts,jsx,tsx,mdx}',
|
|
37
|
+
'./node_modules/@clicoh/orion-library/**/*.{js,ts,jsx,tsx}',
|
|
38
|
+
],
|
|
39
|
+
// ... resto de tu configuración
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default config;
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 2. Importar estilos base (opcional)
|
|
46
|
+
|
|
47
|
+
Si necesitas los estilos base de la librería, importa el CSS en tu layout principal:
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
import '@clicoh/orion-library/assets/css/base.css';
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Uso
|
|
54
|
+
|
|
55
|
+
### Importar componentes
|
|
56
|
+
|
|
57
|
+
Puedes importar los componentes que necesites desde la librería:
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
import { Button, Input, Card, Modal } from '@clicoh/orion-library';
|
|
61
|
+
|
|
62
|
+
function MyComponent() {
|
|
63
|
+
return (
|
|
64
|
+
<div>
|
|
65
|
+
<Button variant="primary">Click me</Button>
|
|
66
|
+
<Input placeholder="Enter text..." />
|
|
67
|
+
</div>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Componentes disponibles
|
|
73
|
+
|
|
74
|
+
La librería incluye componentes organizados por categorías:
|
|
75
|
+
|
|
76
|
+
#### 00-base
|
|
77
|
+
|
|
78
|
+
- `Colors` - Sistema de colores
|
|
79
|
+
- `Each` - Renderizado de listas
|
|
80
|
+
- `RootLayout` - Layout base
|
|
81
|
+
- `Show` - Renderizado condicional
|
|
82
|
+
- Typography components
|
|
83
|
+
|
|
84
|
+
#### 01-atoms
|
|
85
|
+
|
|
86
|
+
- `Badge` - Insignias
|
|
87
|
+
- `Button` - Botones
|
|
88
|
+
- `Checkbox` - Casillas de verificación
|
|
89
|
+
- `FileUpload` - Carga de archivos
|
|
90
|
+
- `Heading` - Encabezados
|
|
91
|
+
- `Input` - Campos de entrada
|
|
92
|
+
- `List` - Listas
|
|
93
|
+
- `Logo` - Logo
|
|
94
|
+
- `MultiSelect` - Selección múltiple
|
|
95
|
+
- `OtpInput` - Input para códigos OTP
|
|
96
|
+
- `Paragraph` - Párrafos
|
|
97
|
+
- `RadialProgressBar` - Barra de progreso radial
|
|
98
|
+
- `Radio` - Botones de radio
|
|
99
|
+
- `Select` - Selectores
|
|
100
|
+
- `Spinner` - Indicadores de carga
|
|
101
|
+
- `Switch` - Interruptores
|
|
102
|
+
- `Toast` - Notificaciones
|
|
103
|
+
- `Tooltip` - Tooltips
|
|
104
|
+
|
|
105
|
+
#### 02-molecules
|
|
106
|
+
|
|
107
|
+
- `Accordion` - Acordeones
|
|
108
|
+
- `Avatar` - Avatares
|
|
109
|
+
- `Breadcrumb` - Migas de pan
|
|
110
|
+
- `ButtonGroup` - Grupos de botones
|
|
111
|
+
- `Container` - Contenedores
|
|
112
|
+
- `Dropdown` - Menús desplegables
|
|
113
|
+
- `Filter` - Filtros
|
|
114
|
+
- `Menu` - Menús
|
|
115
|
+
- `Modal` - Modales
|
|
116
|
+
- `Pagination` - Paginación
|
|
117
|
+
- `SlideOver` - Paneles deslizantes
|
|
118
|
+
- `Tab` - Pestañas
|
|
119
|
+
- `Table` - Tablas
|
|
120
|
+
|
|
121
|
+
#### 03-organisms
|
|
122
|
+
|
|
123
|
+
- `AsideFilters` - Filtros laterales
|
|
124
|
+
- `AsideMenu` - Menú lateral
|
|
125
|
+
- `DataTable` - Tablas de datos
|
|
126
|
+
- `Header` - Encabezado
|
|
127
|
+
- `ModalMultiple` - Modales múltiples
|
|
128
|
+
|
|
129
|
+
#### 04-templates
|
|
130
|
+
|
|
131
|
+
- `DashboardTemplate` - Plantilla de dashboard
|
|
132
|
+
- `LoginTemplate` - Plantilla de login
|
|
133
|
+
- `SideFilterTemplate` - Plantilla con filtros laterales
|
|
134
|
+
|
|
135
|
+
### Hooks
|
|
136
|
+
|
|
137
|
+
La librería también incluye hooks personalizados:
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
import { useFilterStore, useSegments } from '@clicoh/orion-library';
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Interfaces
|
|
144
|
+
|
|
145
|
+
Interfaces TypeScript disponibles:
|
|
146
|
+
|
|
147
|
+
```typescript
|
|
148
|
+
import type { AppResponse, LayoutProps } from '@clicoh/orion-library';
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Utilidades
|
|
152
|
+
|
|
153
|
+
Funciones de utilidad:
|
|
154
|
+
|
|
155
|
+
```typescript
|
|
156
|
+
import { generateUniqueId, calculateFileSize } from '@clicoh/orion-library';
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Ejemplo completo
|
|
160
|
+
|
|
161
|
+
```typescript
|
|
162
|
+
import { Button, Input, Modal } from '@clicoh/orion-library';
|
|
163
|
+
import { useState } from 'react';
|
|
164
|
+
|
|
165
|
+
function App() {
|
|
166
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
167
|
+
|
|
168
|
+
return (
|
|
169
|
+
<div className="p-4">
|
|
170
|
+
<Input
|
|
171
|
+
placeholder="Escribe algo..."
|
|
172
|
+
className="mb-4"
|
|
173
|
+
/>
|
|
174
|
+
|
|
175
|
+
<Button
|
|
176
|
+
variant="primary"
|
|
177
|
+
onClick={() => setIsOpen(true)}
|
|
178
|
+
>
|
|
179
|
+
Abrir Modal
|
|
180
|
+
</Button>
|
|
181
|
+
|
|
182
|
+
<Modal
|
|
183
|
+
isOpen={isOpen}
|
|
184
|
+
onClose={() => setIsOpen(false)}
|
|
185
|
+
>
|
|
186
|
+
<h2>Contenido del Modal</h2>
|
|
187
|
+
</Modal>
|
|
188
|
+
</div>
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Desarrollo
|
|
194
|
+
|
|
195
|
+
Para trabajar en la librería localmente:
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
# Instalar dependencias
|
|
199
|
+
npm install
|
|
200
|
+
|
|
201
|
+
# Ejecutar Storybook
|
|
202
|
+
npm run storybook
|
|
203
|
+
|
|
204
|
+
# Compilar la librería
|
|
205
|
+
npm run build
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Requisitos
|
|
209
|
+
|
|
210
|
+
- React 18.3.1 o superior
|
|
211
|
+
- Next.js 14.0.4 o superior
|
|
212
|
+
- TailwindCSS configurado en tu proyecto
|
|
213
|
+
|
|
214
|
+
## Licencia
|
|
215
|
+
|
|
216
|
+
Ver el archivo LICENSE en el repositorio.
|
package/assets/css/base.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clicoh/orion-library",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0b",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsc --project tsconfig.components.json",
|
|
@@ -15,24 +15,19 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@floating-ui/react": "0.26.19",
|
|
17
17
|
"clsx": "2.1.1",
|
|
18
|
-
"
|
|
19
|
-
"react": "
|
|
20
|
-
"react-dom": "18.3.1",
|
|
18
|
+
"react": "19.2.0",
|
|
19
|
+
"react-dom": "19.2.0",
|
|
21
20
|
"react-icons": "5.2.1",
|
|
22
21
|
"react-toastify": "10.0.5",
|
|
23
22
|
"swr": "2.2.5",
|
|
24
23
|
"zustand": "4.5.2"
|
|
25
24
|
},
|
|
26
25
|
"devDependencies": {
|
|
27
|
-
"@storybook
|
|
28
|
-
"@storybook/addon-
|
|
29
|
-
"@storybook/addon-
|
|
30
|
-
"@storybook/addon-
|
|
31
|
-
"@storybook/
|
|
32
|
-
"@storybook/blocks": "7.6.20",
|
|
33
|
-
"@storybook/nextjs": "7.6.20",
|
|
34
|
-
"@storybook/react": "7.6.20",
|
|
35
|
-
"@storybook/test": "7.6.20",
|
|
26
|
+
"@chromatic-com/storybook": "^4.1.2",
|
|
27
|
+
"@storybook/addon-a11y": "^10.0.7",
|
|
28
|
+
"@storybook/addon-docs": "^10.0.7",
|
|
29
|
+
"@storybook/addon-vitest": "^10.0.7",
|
|
30
|
+
"@storybook/react-vite": "^10.0.7",
|
|
36
31
|
"@types/copyfiles": "2",
|
|
37
32
|
"@types/node": "20",
|
|
38
33
|
"@types/react": "18.3.1",
|
|
@@ -40,18 +35,21 @@
|
|
|
40
35
|
"@types/tailwindcss": "3.1.0",
|
|
41
36
|
"autoprefixer": "10.4.19",
|
|
42
37
|
"eslint": "8",
|
|
43
|
-
"eslint-config-next": "14.0.4",
|
|
44
38
|
"eslint-config-prettier": "9.1.0",
|
|
45
39
|
"eslint-plugin-prettier": "5.1.3",
|
|
46
|
-
"eslint-plugin-storybook": "0.
|
|
40
|
+
"eslint-plugin-storybook": "10.0.7",
|
|
47
41
|
"husky": "8.0.3",
|
|
48
42
|
"lint-staged": "15.2.7",
|
|
49
43
|
"postcss": "8",
|
|
50
44
|
"prettier": "3.3.2",
|
|
51
45
|
"prettier-plugin-tailwindcss": "0.6.8",
|
|
52
|
-
"storybook": "
|
|
46
|
+
"storybook": "^10.0.7",
|
|
53
47
|
"tailwindcss": "3.4.4",
|
|
54
|
-
"typescript": "5.5.4"
|
|
48
|
+
"typescript": "5.5.4",
|
|
49
|
+
"vitest": "^4.0.9",
|
|
50
|
+
"playwright": "^1.56.1",
|
|
51
|
+
"@vitest/browser-playwright": "^4.0.9",
|
|
52
|
+
"@vitest/coverage-v8": "^4.0.9"
|
|
55
53
|
},
|
|
56
54
|
"engines": {
|
|
57
55
|
"node": ">=22.0.0"
|