pixelon 0.1.1 → 0.1.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.
Files changed (2) hide show
  1. package/README.md +388 -53
  2. package/package.json +12 -1
package/README.md CHANGED
@@ -1,54 +1,389 @@
1
- # React + TypeScript + Vite
2
-
3
- This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4
-
5
- Currently, two official plugins are available:
6
-
7
- - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
8
- - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9
-
10
- ## Expanding the ESLint configuration
11
-
12
- If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
13
-
14
- ```js
15
- export default tseslint.config({
16
- extends: [
17
- // Remove ...tseslint.configs.recommended and replace with this
18
- ...tseslint.configs.recommendedTypeChecked,
19
- // Alternatively, use this for stricter rules
20
- ...tseslint.configs.strictTypeChecked,
21
- // Optionally, add this for stylistic rules
22
- ...tseslint.configs.stylisticTypeChecked,
23
- ],
24
- languageOptions: {
25
- // other options...
26
- parserOptions: {
27
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
28
- tsconfigRootDir: import.meta.dirname,
29
- },
30
- },
31
- })
32
- ```
33
-
34
- You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
35
-
36
- ```js
37
- // eslint.config.js
38
- import reactX from 'eslint-plugin-react-x'
39
- import reactDom from 'eslint-plugin-react-dom'
40
-
41
- export default tseslint.config({
42
- plugins: {
43
- // Add the react-x and react-dom plugins
44
- 'react-x': reactX,
45
- 'react-dom': reactDom,
46
- },
47
- rules: {
48
- // other rules...
49
- // Enable its recommended typescript rules
50
- ...reactX.configs['recommended-typescript'].rules,
51
- ...reactDom.configs.recommended.rules,
52
- },
53
- })
1
+ # Pixelon - Design System
2
+
3
+ Design system de la marca Goluti construido con React, TypeScript y Atomic Design.
4
+
5
+ ## 🚀 Instalación
6
+
7
+ ```bash
8
+ npm install pixelon
9
+ ```
10
+
11
+ ## 🎨 Importación de Estilos
12
+
13
+ Tienes varias opciones para importar los estilos de Pixelon:
14
+
15
+ ### Opción 1: Ruta directa (tradicional)
16
+ ```tsx
17
+ import 'pixelon/styles';
18
+ ```
19
+
20
+ ### Opción 2: Con exports (recomendado)
21
+ ```tsx
22
+ import 'pixelon/styles';
23
+ ```
24
+
25
+ ### Opción 3: En tu archivo CSS principal
26
+ ```css
27
+ @import 'pixelon/styles';
28
+ ```
29
+
30
+ ### Opción 4: En tu archivo SCSS
31
+ ```scss
32
+ @import 'pixelon/styles';
33
+ ```
34
+
35
+ ## 📦 Uso Básico
36
+
37
+ ```tsx
38
+ import React from 'react';
39
+ import { Button, Text, Input } from 'pixelon';
40
+
41
+ // Importar estilos (elige una opción):
42
+ import 'pixelon/styles'; // Opción 1: Ruta directa
43
+ import 'pixelon/styles'; // Opción 2: Con exports (recomendado)
44
+
45
+ function App() {
46
+ return (
47
+ <div>
48
+ <Text variant="h1">Hola Pixelon</Text>
49
+ <Input label="Email" placeholder="tu@email.com" />
50
+ <Button variant="primary">Enviar</Button>
51
+ </div>
52
+ );
53
+ }
54
+ ```
55
+
56
+ ## 🎨 Ejemplos de Componentes
57
+
58
+ ### Botones
59
+
60
+ ```tsx
61
+ import { Button } from 'pixelon';
62
+
63
+ function ButtonExamples() {
64
+ return (
65
+ <div>
66
+ {/* Botón primario */}
67
+ <Button variant="primary">Botón Primario</Button>
68
+
69
+ {/* Botón secundario */}
70
+ <Button variant="secondary">Botón Secundario</Button>
71
+
72
+ {/* Botón fantasma */}
73
+ <Button variant="ghost">Botón Fantasma</Button>
74
+
75
+ {/* Botón con icono */}
76
+ <Button variant="icon" icon="📧">Enviar</Button>
77
+
78
+ {/* Botón circular */}
79
+ <Button variant="circle" icon="➕" />
80
+
81
+ {/* Botón de carga */}
82
+ <Button variant="primary" isLoading>Procesando...</Button>
83
+
84
+ {/* Botón de ancho completo */}
85
+ <Button variant="primary" fullWidth>Botón Completo</Button>
86
+ </div>
87
+ );
88
+ }
89
+ ```
90
+
91
+ ### Texto
92
+
93
+ ```tsx
94
+ import { Text } from 'pixelon';
95
+
96
+ function TextExamples() {
97
+ return (
98
+ <div>
99
+ {/* Títulos */}
100
+ <Text variant="h1">Título Principal</Text>
101
+ <Text variant="h2">Subtítulo</Text>
102
+ <Text variant="h3">Sección</Text>
103
+
104
+ {/* Texto de cuerpo */}
105
+ <Text variant="body">Texto normal del cuerpo</Text>
106
+ <Text variant="small">Texto pequeño</Text>
107
+ <Text variant="caption">Texto de caption</Text>
108
+
109
+ {/* Pesos de fuente */}
110
+ <Text variant="body" weight="normal">Normal</Text>
111
+ <Text variant="body" weight="medium">Medium</Text>
112
+ <Text variant="body" weight="semibold">Semibold</Text>
113
+ <Text variant="body" weight="bold">Bold</Text>
114
+
115
+ {/* Colores */}
116
+ <Text variant="body" color="primary">Texto primario</Text>
117
+ <Text variant="body" color="secondary">Texto secundario</Text>
118
+
119
+ {/* Alineación */}
120
+ <Text variant="body" align="left">Izquierda</Text>
121
+ <Text variant="body" align="center">Centro</Text>
122
+ <Text variant="body" align="right">Derecha</Text>
123
+ </div>
124
+ );
125
+ }
126
+ ```
127
+
128
+ ### Campos de Entrada
129
+
130
+ ```tsx
131
+ import { Input } from 'pixelon';
132
+
133
+ function InputExamples() {
134
+ return (
135
+ <div>
136
+ {/* Input básico */}
137
+ <Input label="Nombre" placeholder="Tu nombre" />
138
+
139
+ {/* Input con error */}
140
+ <Input
141
+ label="Email"
142
+ placeholder="tu@email.com"
143
+ error="Email inválido"
144
+ />
145
+
146
+ {/* Input con icono */}
147
+ <Input
148
+ label="Buscar"
149
+ placeholder="Buscar..."
150
+ icon="🔍"
151
+ />
152
+
153
+ {/* Input de ancho completo */}
154
+ <Input
155
+ label="Descripción"
156
+ placeholder="Describe tu proyecto"
157
+ fullWidth
158
+ />
159
+
160
+ {/* Input para chat */}
161
+ <Input
162
+ variant="chat"
163
+ placeholder="Escribe un mensaje..."
164
+ />
165
+ </div>
166
+ );
167
+ }
168
+ ```
169
+
170
+ ### Chat Completo
171
+
172
+ ```tsx
173
+ import { Chat } from 'pixelon';
174
+
175
+ function ChatExample() {
176
+ return (
177
+ <div style={{ height: '100vh' }}>
178
+ <Chat
179
+ onSendMessage={(message) => {
180
+ console.log('Mensaje enviado:', message);
181
+ }}
182
+ onFileUpload={(files) => {
183
+ console.log('Archivos subidos:', files);
184
+ }}
185
+ />
186
+ </div>
187
+ );
188
+ }
189
+ ```
190
+
191
+ ### Componentes de Chat Individuales
192
+
193
+ ```tsx
194
+ import {
195
+ AssistantMessage,
196
+ UserMessage,
197
+ ChatInput,
198
+ ChatHeader
199
+ } from 'pixelon';
200
+
201
+ function ChatComponentsExample() {
202
+ return (
203
+ <div>
204
+ {/* Header del chat */}
205
+ <ChatHeader title="Soporte Técnico" />
206
+
207
+ {/* Mensaje del asistente */}
208
+ <AssistantMessage
209
+ content="¡Hola! ¿En qué puedo ayudarte?"
210
+ timestamp="10:30 AM"
211
+ />
212
+
213
+ {/* Mensaje del usuario */}
214
+ <UserMessage
215
+ content="Necesito ayuda con mi cuenta"
216
+ timestamp="10:31 AM"
217
+ />
218
+
219
+ {/* Input del chat */}
220
+ <ChatInput
221
+ onSend={(message) => console.log(message)}
222
+ onFileUpload={(files) => console.log(files)}
223
+ />
224
+ </div>
225
+ );
226
+ }
227
+ ```
228
+
229
+ ### Avatares
230
+
231
+ ```tsx
232
+ import { Avatar } from 'pixelon';
233
+
234
+ function AvatarExamples() {
235
+ return (
236
+ <div>
237
+ {/* Avatar de usuario */}
238
+ <Avatar
239
+ variant="user"
240
+ size="medium"
241
+ src="/path/to/image.jpg"
242
+ fallback="AL"
243
+ />
244
+
245
+ {/* Avatar del asistente */}
246
+ <Avatar
247
+ variant="assistant"
248
+ size="large"
249
+ />
250
+
251
+ {/* Tamaños */}
252
+ <Avatar size="small" fallback="U" />
253
+ <Avatar size="medium" fallback="U" />
254
+ <Avatar size="large" fallback="U" />
255
+ </div>
256
+ );
257
+ }
258
+ ```
259
+
260
+ ### Enlaces
261
+
262
+ ```tsx
263
+ import { Link } from 'pixelon';
264
+
265
+ function LinkExamples() {
266
+ return (
267
+ <div>
268
+ {/* Enlace básico */}
269
+ <Link href="/documentacion">Documentación</Link>
270
+
271
+ {/* Enlace externo */}
272
+ <Link
273
+ href="https://github.com/dandres10/pixelon"
274
+ external
275
+ >
276
+ Ver en GitHub
277
+ </Link>
278
+
279
+ {/* Variantes */}
280
+ <Link variant="primary">Enlace Primario</Link>
281
+ <Link variant="secondary">Enlace Secundario</Link>
282
+
283
+ {/* Tamaños */}
284
+ <Link size="small">Enlace Pequeño</Link>
285
+ <Link size="medium">Enlace Mediano</Link>
286
+ <Link size="large">Enlace Grande</Link>
287
+
288
+ {/* Con subrayado */}
289
+ <Link underline>Enlace Subrayado</Link>
290
+ </div>
291
+ );
292
+ }
293
+ ```
294
+
295
+ ## 🎨 Personalización de Estilos
296
+
297
+ ### Variables CSS
298
+
299
+ ```css
300
+ :root {
301
+ /* Colores principales */
302
+ --color-primary: #000000;
303
+ --color-secondary: #343541;
304
+ --color-background: #FFFFFF;
305
+
306
+ /* Tipografía */
307
+ --font-family-base: 'Inter', sans-serif;
308
+ --font-size-base: 1rem;
309
+
310
+ /* Espaciado */
311
+ --spacing-md: 1rem;
312
+ --spacing-lg: 1.5rem;
313
+
314
+ /* Bordes */
315
+ --border-radius-md: 0.375rem;
316
+ }
317
+ ```
318
+
319
+ ### Tema Oscuro
320
+
321
+ ```tsx
322
+ // Activar tema oscuro
323
+ document.documentElement.setAttribute('data-theme', 'dark');
324
+
325
+ // Volver al tema claro
326
+ document.documentElement.setAttribute('data-theme', 'light');
327
+ ```
328
+
329
+ ## 📦 Componentes Disponibles
330
+
331
+ ### Atoms
332
+ - `Button` - Botones con múltiples variantes
333
+ - `Input` - Campos de entrada
334
+ - `Text` - Componentes de texto
335
+ - `Textarea` - Áreas de texto
336
+ - `Link` - Enlaces
337
+ - `Avatar` - Avatares de usuario
338
+ - `AttachmentPreview` - Vista previa de archivos
339
+ - `SelectMenu` - Menús de selección
340
+ - `DateDivider` - Divisores de fecha
341
+ - `Logo` - Logo de la marca
342
+
343
+ ### Molecules
344
+ - `AssistantMessage` - Mensajes del asistente
345
+ - `AssistantThinkingIndicator` - Indicador de pensamiento
346
+ - `ChatHeader` - Encabezado del chat
347
+ - `ChatInput` - Entrada del chat
348
+ - `FileViewer` - Visor de archivos
349
+ - `FullscreenViewer` - Visor pantalla completa
350
+ - `MessageStatus` - Estado de mensajes
351
+ - `Modal` - Ventanas modales
352
+ - `UserAttachments` - Adjuntos del usuario
353
+ - `UserMessage` - Mensajes del usuario
354
+
355
+ ### Organisms
356
+ - `Chat` - Componente de chat completo
357
+
358
+ ## 📋 Requisitos
359
+
360
+ - React 18+ o 19+
361
+ - TypeScript (recomendado)
362
+ - Node.js 16+
363
+
364
+ ## 🔧 Desarrollo
365
+
366
+ ```bash
367
+ # Instalar dependencias
368
+ npm install
369
+
370
+ # Ejecutar Storybook
371
+ npm run storybook
372
+
373
+ # Construir librería
374
+ npm run build:lib
375
+
376
+ # Ejecutar tests
377
+ npm test
54
378
  ```
379
+
380
+ ## 📞 Soporte
381
+
382
+ Para soporte técnico:
383
+
384
+ 📧 **Email:** dandresleon64@gmail.com
385
+ 🌐 **GitHub:** https://github.com/dandres10/pixelon
386
+
387
+ ## 📄 Licencia
388
+
389
+ Copyright © 2024 Marlon Andrés León León. Todos los derechos reservados.
package/package.json CHANGED
@@ -1,11 +1,22 @@
1
1
  {
2
2
  "name": "pixelon",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Design system de la marca goluti",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.esm.js",
8
8
  "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.esm.js",
12
+ "require": "./dist/index.js",
13
+ "types": "./dist/index.d.ts"
14
+ },
15
+ "./styles": {
16
+ "import": "./dist/styles.css",
17
+ "require": "./dist/styles.css"
18
+ }
19
+ },
9
20
  "files": [
10
21
  "dist",
11
22
  "src/styles"