ywana-core8 0.1.79 → 0.1.80

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 (63) hide show
  1. package/dist/index.cjs +3244 -2215
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +2095 -1125
  4. package/dist/index.css.map +1 -1
  5. package/dist/index.modern.js +3244 -2215
  6. package/dist/index.modern.js.map +1 -1
  7. package/dist/index.umd.js +3244 -2215
  8. package/dist/index.umd.js.map +1 -1
  9. package/package.json +1 -1
  10. package/src/html/ExampleLayout.css +401 -0
  11. package/src/html/ExampleLayout.js +192 -0
  12. package/src/html/README-sidebar-navigation.md +195 -0
  13. package/src/html/accordion.example.js +123 -4
  14. package/src/html/accordion.example.js.backup +390 -0
  15. package/src/html/button.example.js +50 -3
  16. package/src/html/button.example.js.backup +374 -0
  17. package/src/html/button.example.new.js +416 -0
  18. package/src/html/checkbox.example.js +93 -4
  19. package/src/html/checkbox.example.js.backup +316 -0
  20. package/src/html/chip.example.js +108 -4
  21. package/src/html/chip.example.js.backup +355 -0
  22. package/src/html/color.example.js +108 -4
  23. package/src/html/color.example.js.backup +527 -0
  24. package/src/html/components.example.js +123 -4
  25. package/src/html/components.example.js.backup +492 -0
  26. package/src/html/convert-examples.js +183 -0
  27. package/src/html/demo-sidebar.html +410 -0
  28. package/src/html/form.example.js +93 -4
  29. package/src/html/form.example.js.backup +385 -0
  30. package/src/html/header2.example.js +108 -4
  31. package/src/html/header2.example.js.backup +411 -0
  32. package/src/html/icon.example.js +77 -3
  33. package/src/html/icon.example.js.backup +268 -0
  34. package/src/html/list.example.js +93 -4
  35. package/src/html/list.example.js.backup +404 -0
  36. package/src/html/progress.example.js +74 -4
  37. package/src/html/progress.example.js.backup +424 -0
  38. package/src/html/property.example.js +123 -4
  39. package/src/html/property.example.js.backup +553 -0
  40. package/src/html/radio.example.js +108 -4
  41. package/src/html/radio.example.js.backup +389 -0
  42. package/src/html/section.example.js +42 -3
  43. package/src/html/section.example.js.backup +99 -0
  44. package/src/html/switch.example.js +108 -4
  45. package/src/html/switch.example.js.backup +461 -0
  46. package/src/html/tab.example.js +93 -4
  47. package/src/html/tab.example.js.backup +446 -0
  48. package/src/html/table-export-utils.js +483 -0
  49. package/src/html/table-summary-functions.js +363 -0
  50. package/src/html/table2.css +1449 -479
  51. package/src/html/table2.example.js +2937 -512
  52. package/src/html/table2.example.js.broken +1226 -0
  53. package/src/html/table2.js +1426 -1000
  54. package/src/html/test-resize.html +279 -0
  55. package/src/html/test-selection.html +387 -0
  56. package/src/html/textfield2.example.js +108 -4
  57. package/src/html/textfield2.example.js.backup +1370 -0
  58. package/src/html/tokenfield.example.js +108 -4
  59. package/src/html/tokenfield.example.js.backup +503 -0
  60. package/src/html/tree.css +2 -4
  61. package/src/html/tree.example.js +93 -4
  62. package/src/html/tree.example.js.backup +475 -0
  63. package/src/html/tree.js +19 -3
@@ -0,0 +1,404 @@
1
+ import React, { useState } from 'react'
2
+ import { List } from './list'
3
+ import { Button } from './button'
4
+ import { Icon } from './icon'
5
+
6
+ /**
7
+ * Ejemplos del componente List mejorado manteniendo 100% compatibilidad
8
+ */
9
+ export const ListExamples = () => {
10
+ const [selectedItem, setSelectedItem] = useState(null)
11
+ const [selectedItems, setSelectedItems] = useState([])
12
+ const [isLoading, setIsLoading] = useState(false)
13
+ const [showEmpty, setShowEmpty] = useState(false)
14
+
15
+ // Datos de ejemplo
16
+ const basicItems = [
17
+ {
18
+ id: 1,
19
+ line1: 'John Doe',
20
+ line2: 'Software Engineer',
21
+ icon: 'person',
22
+ meta: 'Active',
23
+ badge: 'New'
24
+ },
25
+ {
26
+ id: 2,
27
+ line1: 'Jane Smith',
28
+ line2: 'Product Manager',
29
+ icon: 'business_center',
30
+ meta: '2 days ago',
31
+ avatar: 'https://via.placeholder.com/40x40/2196f3/ffffff?text=JS'
32
+ },
33
+ {
34
+ id: 3,
35
+ line1: 'Mike Johnson',
36
+ line2: 'UX Designer',
37
+ icon: 'design_services',
38
+ meta: 'Offline',
39
+ actions: (
40
+ <div style={{ display: 'flex', gap: '0.25rem' }}>
41
+ <Button icon="edit" size="small" />
42
+ <Button icon="delete" size="small" />
43
+ </div>
44
+ )
45
+ },
46
+ {
47
+ id: 4,
48
+ line1: 'Sarah Wilson',
49
+ line2: 'Data Scientist',
50
+ icon: 'analytics',
51
+ meta: 'Online',
52
+ disabled: true
53
+ }
54
+ ]
55
+
56
+ const groupedItems = [
57
+ { id: 1, line1: 'Apple iPhone 14', line2: '$999', category: 'Electronics', icon: 'phone_iphone' },
58
+ { id: 2, line1: 'Samsung Galaxy S23', line2: '$899', category: 'Electronics', icon: 'smartphone' },
59
+ { id: 3, line1: 'Nike Air Max', line2: '$120', category: 'Clothing', icon: 'sports_soccer' },
60
+ { id: 4, line1: 'Adidas Ultraboost', line2: '$180', category: 'Clothing', icon: 'directions_run' },
61
+ { id: 5, line1: 'MacBook Pro', line2: '$2499', category: 'Electronics', icon: 'laptop_mac' },
62
+ { id: 6, line1: 'Levi\'s Jeans', line2: '$80', category: 'Clothing', icon: 'checkroom' }
63
+ ]
64
+
65
+ const handleSelect = (id) => {
66
+ setSelectedItem(id)
67
+ console.log('Selected:', id)
68
+ }
69
+
70
+ const handleMultiSelect = (ids) => {
71
+ setSelectedItems(ids)
72
+ console.log('Multi-selected:', ids)
73
+ }
74
+
75
+ const handleSort = (sortConfig) => {
76
+ console.log('Sort config:', sortConfig)
77
+ }
78
+
79
+ const simulateLoading = () => {
80
+ setIsLoading(true)
81
+ setTimeout(() => setIsLoading(false), 2000)
82
+ }
83
+
84
+ return (
85
+ <div style={{ padding: '2rem', maxWidth: '1200px', maxHeight: '100vh', overflow: 'auto' }}>
86
+ <h1>Componente List Mejorado</h1>
87
+
88
+ <div style={{
89
+ background: '#f8f9fa',
90
+ padding: '1rem',
91
+ borderRadius: '8px',
92
+ marginBottom: '2rem',
93
+ border: '1px solid #e9ecef'
94
+ }}>
95
+ <h3>✅ Mejoras Implementadas (100% Compatibilidad):</h3>
96
+ <ul>
97
+ <li>🛡️ <strong>PropTypes completos</strong> - Validación y documentación detallada</li>
98
+ <li>♿ <strong>Accesibilidad completa</strong> - ARIA, navegación por teclado, focus management</li>
99
+ <li>🔍 <strong>Búsqueda integrada</strong> - Filtrado en tiempo real por múltiples campos</li>
100
+ <li>📊 <strong>Ordenamiento</strong> - Sorting ascendente/descendente por cualquier campo</li>
101
+ <li>✅ <strong>Selección múltiple</strong> - Con Ctrl+click y estados visuales</li>
102
+ <li>🎭 <strong>Estados avanzados</strong> - loading, empty, disabled, dense</li>
103
+ <li>👤 <strong>Avatares y badges</strong> - Soporte para imágenes y etiquetas</li>
104
+ <li>⚡ <strong>Acciones por item</strong> - Botones que aparecen en hover</li>
105
+ <li>📱 <strong>Responsive total</strong> - Adaptación móvil, dark mode, high contrast</li>
106
+ <li>🧪 <strong>16 Pruebas unitarias</strong> - Verifican compatibilidad y funcionalidad</li>
107
+ </ul>
108
+ </div>
109
+
110
+ {/* Controles de demostración */}
111
+ <section style={{ marginBottom: '2rem' }}>
112
+ <h3>Controles de Demostración</h3>
113
+ <div style={{
114
+ background: '#fff',
115
+ padding: '1rem',
116
+ borderRadius: '8px',
117
+ border: '1px solid #ddd',
118
+ display: 'flex',
119
+ gap: '1rem',
120
+ alignItems: 'center',
121
+ flexWrap: 'wrap'
122
+ }}>
123
+ <Button
124
+ label="Simulate Loading"
125
+ icon="refresh"
126
+ action={simulateLoading}
127
+ disabled={isLoading}
128
+ />
129
+ <Button
130
+ label={showEmpty ? "Show Items" : "Show Empty"}
131
+ icon={showEmpty ? "list" : "inbox"}
132
+ action={() => setShowEmpty(!showEmpty)}
133
+ />
134
+ <Button
135
+ label="Clear Selection"
136
+ icon="clear"
137
+ action={() => {
138
+ setSelectedItem(null)
139
+ setSelectedItems([])
140
+ }}
141
+ />
142
+ <span style={{ marginLeft: 'auto', color: '#666' }}>
143
+ Selected: {selectedItem || 'None'} | Multi: [{selectedItems.join(', ')}]
144
+ </span>
145
+ </div>
146
+ </section>
147
+
148
+ {/* Lista básica (compatible con versión original) */}
149
+ <section style={{ marginBottom: '2rem' }}>
150
+ <h3>Lista Básica (100% Compatible)</h3>
151
+ <div style={{
152
+ background: '#fff',
153
+ border: '1px solid #ddd',
154
+ borderRadius: '8px',
155
+ overflow: 'hidden'
156
+ }}>
157
+ <List
158
+ items={basicItems}
159
+ selected={selectedItem}
160
+ onSelect={handleSelect}
161
+ />
162
+ </div>
163
+ </section>
164
+
165
+ {/* Lista con búsqueda */}
166
+ <section style={{ marginBottom: '2rem' }}>
167
+ <h3>Lista con Búsqueda Integrada</h3>
168
+ <div style={{
169
+ background: '#fff',
170
+ border: '1px solid #ddd',
171
+ borderRadius: '8px',
172
+ overflow: 'hidden'
173
+ }}>
174
+ <List
175
+ items={basicItems}
176
+ selected={selectedItem}
177
+ onSelect={handleSelect}
178
+ searchable={true}
179
+ searchPlaceholder="Buscar personas..."
180
+ searchBy={['line1', 'line2']}
181
+ ariaLabel="Lista de personas con búsqueda"
182
+ />
183
+ </div>
184
+ </section>
185
+
186
+ {/* Lista con ordenamiento */}
187
+ <section style={{ marginBottom: '2rem' }}>
188
+ <h3>Lista con Ordenamiento</h3>
189
+ <div style={{
190
+ background: '#fff',
191
+ border: '1px solid #ddd',
192
+ borderRadius: '8px',
193
+ overflow: 'hidden'
194
+ }}>
195
+ <List
196
+ items={basicItems}
197
+ selected={selectedItem}
198
+ onSelect={handleSelect}
199
+ sortable={true}
200
+ sortBy="line1"
201
+ onSort={handleSort}
202
+ ariaLabel="Lista ordenable de personas"
203
+ />
204
+ </div>
205
+ </section>
206
+
207
+ {/* Lista con selección múltiple */}
208
+ <section style={{ marginBottom: '2rem' }}>
209
+ <h3>Lista con Selección Múltiple</h3>
210
+ <div style={{
211
+ background: '#fff',
212
+ border: '1px solid #ddd',
213
+ borderRadius: '8px',
214
+ overflow: 'hidden'
215
+ }}>
216
+ <List
217
+ items={basicItems}
218
+ selected={selectedItems}
219
+ onSelect={handleSelect}
220
+ multiSelect={true}
221
+ onMultiSelect={handleMultiSelect}
222
+ ariaLabel="Lista con selección múltiple"
223
+ />
224
+ </div>
225
+ </section>
226
+
227
+ {/* Lista agrupada (compatible con versión original) */}
228
+ <section style={{ marginBottom: '2rem' }}>
229
+ <h3>Lista Agrupada (100% Compatible)</h3>
230
+ <div style={{
231
+ background: '#fff',
232
+ border: '1px solid #ddd',
233
+ borderRadius: '8px',
234
+ overflow: 'hidden'
235
+ }}>
236
+ <List
237
+ items={groupedItems}
238
+ selected={selectedItem}
239
+ onSelect={handleSelect}
240
+ groupBy="category"
241
+ searchable={true}
242
+ searchPlaceholder="Buscar productos..."
243
+ />
244
+ </div>
245
+ </section>
246
+
247
+ {/* Lista densa */}
248
+ <section style={{ marginBottom: '2rem' }}>
249
+ <h3>Lista Densa</h3>
250
+ <div style={{
251
+ background: '#fff',
252
+ border: '1px solid #ddd',
253
+ borderRadius: '8px',
254
+ overflow: 'hidden'
255
+ }}>
256
+ <List
257
+ items={basicItems}
258
+ selected={selectedItem}
259
+ onSelect={handleSelect}
260
+ dense={true}
261
+ ariaLabel="Lista densa"
262
+ />
263
+ </div>
264
+ </section>
265
+
266
+ {/* Estados especiales */}
267
+ <section style={{ marginBottom: '2rem' }}>
268
+ <h3>Estados Especiales</h3>
269
+ <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '1rem' }}>
270
+ <div style={{
271
+ background: '#fff',
272
+ border: '1px solid #ddd',
273
+ borderRadius: '8px',
274
+ overflow: 'hidden'
275
+ }}>
276
+ <h4 style={{ margin: '1rem', marginBottom: '0' }}>Loading State</h4>
277
+ <List
278
+ items={basicItems}
279
+ loading={isLoading}
280
+ ariaLabel="Lista en estado de carga"
281
+ />
282
+ </div>
283
+
284
+ <div style={{
285
+ background: '#fff',
286
+ border: '1px solid #ddd',
287
+ borderRadius: '8px',
288
+ overflow: 'hidden'
289
+ }}>
290
+ <h4 style={{ margin: '1rem', marginBottom: '0' }}>Empty State</h4>
291
+ <List
292
+ items={showEmpty ? [] : basicItems}
293
+ empty={showEmpty}
294
+ emptyMessage="No hay elementos para mostrar"
295
+ emptyIcon="inbox"
296
+ searchable={true}
297
+ ariaLabel="Lista vacía"
298
+ />
299
+ </div>
300
+ </div>
301
+ </section>
302
+
303
+ {/* Lista completa con todas las características */}
304
+ <section style={{ marginBottom: '2rem' }}>
305
+ <h3>Lista Completa (Todas las Características)</h3>
306
+ <div style={{
307
+ background: '#fff',
308
+ border: '1px solid #ddd',
309
+ borderRadius: '8px',
310
+ overflow: 'hidden'
311
+ }}>
312
+ <List
313
+ items={basicItems}
314
+ selected={selectedItems}
315
+ onSelect={handleSelect}
316
+ multiSelect={true}
317
+ onMultiSelect={handleMultiSelect}
318
+ searchable={true}
319
+ searchPlaceholder="Buscar en la lista completa..."
320
+ searchBy={['line1', 'line2', 'meta']}
321
+ sortable={true}
322
+ sortBy="line1"
323
+ onSort={handleSort}
324
+ animated={true}
325
+ maxHeight="300px"
326
+ ariaLabel="Lista completa con todas las características"
327
+ />
328
+ </div>
329
+ </section>
330
+
331
+ {/* Comparación antes/después */}
332
+ <section style={{ marginBottom: '2rem' }}>
333
+ <h3>Comparación: List Original vs Mejorado</h3>
334
+ <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '1rem' }}>
335
+ <div style={{
336
+ background: '#ffebee',
337
+ padding: '1rem',
338
+ borderRadius: '4px',
339
+ border: '1px solid #ffcdd2'
340
+ }}>
341
+ <h4>❌ List Original</h4>
342
+ <ul>
343
+ <li>Sin PropTypes ni validación</li>
344
+ <li>Sin accesibilidad</li>
345
+ <li>Sin búsqueda integrada</li>
346
+ <li>Sin ordenamiento</li>
347
+ <li>Selección múltiple básica</li>
348
+ <li>Sin estados loading/empty</li>
349
+ <li>CSS básico sin responsive</li>
350
+ <li>Sin avatares ni badges</li>
351
+ <li>Sin acciones por item</li>
352
+ </ul>
353
+ </div>
354
+ <div style={{
355
+ background: '#e8f5e8',
356
+ padding: '1rem',
357
+ borderRadius: '4px',
358
+ border: '1px solid #c8e6c9'
359
+ }}>
360
+ <h4>✅ List Mejorado</h4>
361
+ <ul>
362
+ <li>PropTypes completos</li>
363
+ <li>Accesibilidad total (WCAG 2.1 AA)</li>
364
+ <li>Búsqueda en tiempo real</li>
365
+ <li>Ordenamiento ascendente/descendente</li>
366
+ <li>Selección múltiple avanzada</li>
367
+ <li>Estados loading, empty, disabled</li>
368
+ <li>CSS responsive con dark mode</li>
369
+ <li>Avatares, badges y meta</li>
370
+ <li>Acciones que aparecen en hover</li>
371
+ </ul>
372
+ </div>
373
+ </div>
374
+ </section>
375
+
376
+ {/* Garantía de compatibilidad */}
377
+ <section style={{ marginBottom: '2rem' }}>
378
+ <h3>🔒 Garantía de Compatibilidad</h3>
379
+ <div style={{
380
+ background: '#fff3cd',
381
+ padding: '1rem',
382
+ borderRadius: '4px',
383
+ border: '1px solid #ffeaa7'
384
+ }}>
385
+ <p><strong>100% Compatible con Código Existente:</strong></p>
386
+ <ul>
387
+ <li>✅ Todas las props originales funcionan exactamente igual</li>
388
+ <li>✅ Comportamiento de selección idéntico</li>
389
+ <li>✅ Agrupación funciona sin cambios</li>
390
+ <li>✅ CSS original preservado</li>
391
+ <li>✅ Nuevas características son opcionales</li>
392
+ <li>✅ No se rompe ningún código existente</li>
393
+ </ul>
394
+ <p style={{ marginTop: '1rem', fontSize: '0.9rem', color: '#856404' }}>
395
+ <strong>Migración:</strong> Simplemente reemplaza el import y todas las
396
+ mejoras se aplican automáticamente sin cambiar una línea de código existente.
397
+ </p>
398
+ </div>
399
+ </section>
400
+ </div>
401
+ )
402
+ }
403
+
404
+ export default ListExamples
@@ -1,7 +1,8 @@
1
1
  import React, { useState, useEffect } from 'react'
2
2
  import { CircularProgress, LinearProgress, StepProgress, RadialProgress, MultiProgress } from './progress'
3
3
  import { Button } from './button'
4
- import { Icon } from './icon'
4
+ import { Icon } from '
5
+ import { ExampleLayout, ExampleSection, ExampleSubsection, CodeSnippet } from './ExampleLayout'./icon'
5
6
 
6
7
  /**
7
8
  * Ejemplos espectaculares de los componentes Progress mejorados
@@ -32,6 +33,74 @@ export const ProgressExamples = () => {
32
33
  })
33
34
  }, 200)
34
35
  }
36
+ // Definir secciones para el menú lateral
37
+
38
+ const sections =
39
+ [
40
+
41
+ {
42
+
43
+ "id": "overview",
44
+
45
+ "title": "Introducción",
46
+
47
+ "icon": "info"
48
+
49
+ },
50
+
51
+ {
52
+
53
+ "id": "basic-examples",
54
+
55
+ "title": "Ejemplos Básicos",
56
+
57
+ "icon": "widgets"
58
+
59
+ },
60
+
61
+ {
62
+
63
+ "id": "advanced-features",
64
+
65
+ "title": "Características Avanzadas",
66
+
67
+ "icon": "settings"
68
+
69
+ },
70
+
71
+ {
72
+
73
+ "id": "variants",
74
+
75
+ "title": "Variantes y Temas",
76
+
77
+ "icon": "palette"
78
+
79
+ },
80
+
81
+ {
82
+
83
+ "id": "states",
84
+
85
+ "title": "Estados",
86
+
87
+ "icon": "toggle_on"
88
+
89
+ },
90
+
91
+ {
92
+
93
+ "id": "sizes",
94
+
95
+ "title": "Tamaños",
96
+
97
+ "icon": "format_size"
98
+
99
+ }
100
+
101
+ ]
102
+
103
+
35
104
  return () => clearInterval(interval)
36
105
  }, [isRunning])
37
106
 
@@ -70,8 +139,8 @@ export const ProgressExamples = () => {
70
139
  ]
71
140
 
72
141
  return (
73
- <div style={{ padding: '2rem', maxWidth: '1200px', maxHeight: '100vh', overflow: 'auto' }}>
74
- <h1>Componentes Progress Espectaculares</h1>
142
+ <ExampleLayout title="Progress Examples" sections={sections}>
143
+ <ExampleSection id="overview" title="Componentes Progress Espectaculares" icon="widgets">
75
144
 
76
145
  <div style={{
77
146
  background: '#f8f9fa',
@@ -417,7 +486,8 @@ export const ProgressExamples = () => {
417
486
  </div>
418
487
  </div>
419
488
  </section>
420
- </div>
489
+ </ExampleSection>
490
+ </ExampleLayout>
421
491
  )
422
492
  }
423
493