ywana-core8 0.1.78 → 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 +2127 -1063
  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 +1496 -432
  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,416 @@
1
+ import React, { useState } from 'react'
2
+ import { Button } from './button'
3
+ import { Icon } from './icon'
4
+ import { ExampleLayout, ExampleSection, ExampleSubsection, CodeSnippet } from './ExampleLayout'
5
+
6
+ /**
7
+ * Ejemplos del componente Button con menú lateral de navegación
8
+ */
9
+ export const ButtonExamples = () => {
10
+ const [loading, setLoading] = useState(false)
11
+ const [disabled, setDisabled] = useState(false)
12
+
13
+ // Definir secciones para el menú lateral
14
+ const sections = [
15
+ {
16
+ id: 'overview',
17
+ title: 'Introducción',
18
+ icon: 'info'
19
+ },
20
+ {
21
+ id: 'basic-buttons',
22
+ title: 'Botones Básicos',
23
+ icon: 'smart_button',
24
+ subsections: [
25
+ { id: 'primary-buttons', title: 'Botones Primarios' },
26
+ { id: 'secondary-buttons', title: 'Botones Secundarios' },
27
+ { id: 'text-buttons', title: 'Botones de Texto' }
28
+ ]
29
+ },
30
+ {
31
+ id: 'button-states',
32
+ title: 'Estados de Botones',
33
+ icon: 'toggle_on',
34
+ subsections: [
35
+ { id: 'loading-state', title: 'Estado de Carga' },
36
+ { id: 'disabled-state', title: 'Estado Deshabilitado' },
37
+ { id: 'active-state', title: 'Estado Activo' }
38
+ ]
39
+ },
40
+ {
41
+ id: 'button-sizes',
42
+ title: 'Tamaños',
43
+ icon: 'format_size'
44
+ },
45
+ {
46
+ id: 'button-icons',
47
+ title: 'Botones con Iconos',
48
+ icon: 'add_circle'
49
+ },
50
+ {
51
+ id: 'button-groups',
52
+ title: 'Grupos de Botones',
53
+ icon: 'view_module'
54
+ },
55
+ {
56
+ id: 'api-reference',
57
+ title: 'Referencia API',
58
+ icon: 'code'
59
+ }
60
+ ]
61
+
62
+ const handleClick = (label) => {
63
+ console.log(`Button clicked: ${label}`)
64
+ }
65
+
66
+ const simulateLoading = () => {
67
+ setLoading(true)
68
+ setTimeout(() => setLoading(false), 3000)
69
+ }
70
+
71
+ return (
72
+ <ExampleLayout title="Button Examples" sections={sections}>
73
+ <ExampleSection id="overview" title="Button - Componente de Botón" icon="smart_button">
74
+ <p>Componente versátil de botón con múltiples variantes, estados y opciones de personalización.</p>
75
+
76
+ <div style={{
77
+ background: '#f8f9fa',
78
+ padding: '1rem',
79
+ borderRadius: '8px',
80
+ marginBottom: '2rem',
81
+ border: '1px solid #e9ecef'
82
+ }}>
83
+ <h4>✨ Características principales:</h4>
84
+ <ul style={{ columns: 2, columnGap: '2rem', margin: '0.5rem 0' }}>
85
+ <li>🎨 Múltiples variantes (primary, secondary, text)</li>
86
+ <li>📏 Diferentes tamaños (small, medium, large)</li>
87
+ <li>🔄 Estados de carga y deshabilitado</li>
88
+ <li>🎯 Iconos integrados</li>
89
+ <li>⌨️ Accesibilidad completa</li>
90
+ <li>📱 Responsive design</li>
91
+ </ul>
92
+ </div>
93
+ </ExampleSection>
94
+
95
+ <ExampleSection id="basic-buttons" title="Botones Básicos" icon="smart_button">
96
+ <ExampleSubsection id="primary-buttons" title="Botones Primarios">
97
+ <div style={{
98
+ background: '#fff',
99
+ padding: '1.5rem',
100
+ borderRadius: '8px',
101
+ border: '1px solid #ddd',
102
+ marginBottom: '1rem'
103
+ }}>
104
+ <div style={{ display: 'flex', gap: '1rem', flexWrap: 'wrap', marginBottom: '1rem' }}>
105
+ <Button
106
+ label="Primary Button"
107
+ variant="primary"
108
+ action={() => handleClick('Primary')}
109
+ />
110
+ <Button
111
+ label="Primary with Icon"
112
+ variant="primary"
113
+ icon="add"
114
+ action={() => handleClick('Primary with Icon')}
115
+ />
116
+ <Button
117
+ label="Primary Loading"
118
+ variant="primary"
119
+ loading={loading}
120
+ action={simulateLoading}
121
+ />
122
+ </div>
123
+ </div>
124
+
125
+ <CodeSnippet
126
+ title="Código de Botones Primarios"
127
+ code={`<Button
128
+ label="Primary Button"
129
+ variant="primary"
130
+ action={() => handleClick('Primary')}
131
+ />
132
+
133
+ <Button
134
+ label="Primary with Icon"
135
+ variant="primary"
136
+ icon="add"
137
+ action={() => handleClick('Primary with Icon')}
138
+ />
139
+
140
+ <Button
141
+ label="Primary Loading"
142
+ variant="primary"
143
+ loading={loading}
144
+ action={simulateLoading}
145
+ />`}
146
+ />
147
+ </ExampleSubsection>
148
+
149
+ <ExampleSubsection id="secondary-buttons" title="Botones Secundarios">
150
+ <div style={{
151
+ background: '#fff',
152
+ padding: '1.5rem',
153
+ borderRadius: '8px',
154
+ border: '1px solid #ddd',
155
+ marginBottom: '1rem'
156
+ }}>
157
+ <div style={{ display: 'flex', gap: '1rem', flexWrap: 'wrap', marginBottom: '1rem' }}>
158
+ <Button
159
+ label="Secondary Button"
160
+ variant="secondary"
161
+ action={() => handleClick('Secondary')}
162
+ />
163
+ <Button
164
+ label="Secondary with Icon"
165
+ variant="secondary"
166
+ icon="edit"
167
+ action={() => handleClick('Secondary with Icon')}
168
+ />
169
+ <Button
170
+ label="Secondary Disabled"
171
+ variant="secondary"
172
+ disabled={true}
173
+ action={() => handleClick('Secondary Disabled')}
174
+ />
175
+ </div>
176
+ </div>
177
+
178
+ <CodeSnippet
179
+ title="Código de Botones Secundarios"
180
+ code={`<Button
181
+ label="Secondary Button"
182
+ variant="secondary"
183
+ action={() => handleClick('Secondary')}
184
+ />
185
+
186
+ <Button
187
+ label="Secondary with Icon"
188
+ variant="secondary"
189
+ icon="edit"
190
+ action={() => handleClick('Secondary with Icon')}
191
+ />
192
+
193
+ <Button
194
+ label="Secondary Disabled"
195
+ variant="secondary"
196
+ disabled={true}
197
+ action={() => handleClick('Secondary Disabled')}
198
+ />`}
199
+ />
200
+ </ExampleSubsection>
201
+
202
+ <ExampleSubsection id="text-buttons" title="Botones de Texto">
203
+ <div style={{
204
+ background: '#fff',
205
+ padding: '1.5rem',
206
+ borderRadius: '8px',
207
+ border: '1px solid #ddd',
208
+ marginBottom: '1rem'
209
+ }}>
210
+ <div style={{ display: 'flex', gap: '1rem', flexWrap: 'wrap', marginBottom: '1rem' }}>
211
+ <Button
212
+ label="Text Button"
213
+ variant="text"
214
+ action={() => handleClick('Text')}
215
+ />
216
+ <Button
217
+ label="Text with Icon"
218
+ variant="text"
219
+ icon="link"
220
+ action={() => handleClick('Text with Icon')}
221
+ />
222
+ <Button
223
+ label="Text Danger"
224
+ variant="text"
225
+ color="danger"
226
+ action={() => handleClick('Text Danger')}
227
+ />
228
+ </div>
229
+ </div>
230
+
231
+ <CodeSnippet
232
+ title="Código de Botones de Texto"
233
+ code={`<Button
234
+ label="Text Button"
235
+ variant="text"
236
+ action={() => handleClick('Text')}
237
+ />
238
+
239
+ <Button
240
+ label="Text with Icon"
241
+ variant="text"
242
+ icon="link"
243
+ action={() => handleClick('Text with Icon')}
244
+ />
245
+
246
+ <Button
247
+ label="Text Danger"
248
+ variant="text"
249
+ color="danger"
250
+ action={() => handleClick('Text Danger')}
251
+ />`}
252
+ />
253
+ </ExampleSubsection>
254
+ </ExampleSection>
255
+
256
+ <ExampleSection id="button-states" title="Estados de Botones" icon="toggle_on">
257
+ <ExampleSubsection id="loading-state" title="Estado de Carga">
258
+ <div style={{
259
+ background: '#fff',
260
+ padding: '1.5rem',
261
+ borderRadius: '8px',
262
+ border: '1px solid #ddd',
263
+ marginBottom: '1rem'
264
+ }}>
265
+ <div style={{ display: 'flex', gap: '1rem', flexWrap: 'wrap', marginBottom: '1rem' }}>
266
+ <Button
267
+ label="Simulate Loading"
268
+ variant="primary"
269
+ loading={loading}
270
+ action={simulateLoading}
271
+ />
272
+ <Button
273
+ label="Always Loading"
274
+ variant="secondary"
275
+ loading={true}
276
+ action={() => {}}
277
+ />
278
+ </div>
279
+ <p style={{ fontSize: '0.875rem', color: '#666', margin: '0' }}>
280
+ Los botones en estado de carga muestran un spinner y se deshabilitan automáticamente.
281
+ </p>
282
+ </div>
283
+
284
+ <CodeSnippet
285
+ title="Código de Estados de Carga"
286
+ code={`const [loading, setLoading] = useState(false)
287
+
288
+ const simulateLoading = () => {
289
+ setLoading(true)
290
+ setTimeout(() => setLoading(false), 3000)
291
+ }
292
+
293
+ <Button
294
+ label="Simulate Loading"
295
+ variant="primary"
296
+ loading={loading}
297
+ action={simulateLoading}
298
+ />`}
299
+ />
300
+ </ExampleSubsection>
301
+
302
+ <ExampleSubsection id="disabled-state" title="Estado Deshabilitado">
303
+ <div style={{
304
+ background: '#fff',
305
+ padding: '1.5rem',
306
+ borderRadius: '8px',
307
+ border: '1px solid #ddd',
308
+ marginBottom: '1rem'
309
+ }}>
310
+ <div style={{ display: 'flex', gap: '1rem', flexWrap: 'wrap', marginBottom: '1rem' }}>
311
+ <Button
312
+ label="Toggle Disabled"
313
+ variant="primary"
314
+ action={() => setDisabled(!disabled)}
315
+ />
316
+ <Button
317
+ label="Disabled Button"
318
+ variant="secondary"
319
+ disabled={disabled}
320
+ action={() => handleClick('Disabled')}
321
+ />
322
+ </div>
323
+ <p style={{ fontSize: '0.875rem', color: '#666', margin: '0' }}>
324
+ Estado actual: {disabled ? 'Deshabilitado' : 'Habilitado'}
325
+ </p>
326
+ </div>
327
+
328
+ <CodeSnippet
329
+ title="Código de Estados Deshabilitados"
330
+ code={`const [disabled, setDisabled] = useState(false)
331
+
332
+ <Button
333
+ label="Toggle Disabled"
334
+ variant="primary"
335
+ action={() => setDisabled(!disabled)}
336
+ />
337
+
338
+ <Button
339
+ label="Disabled Button"
340
+ variant="secondary"
341
+ disabled={disabled}
342
+ action={() => handleClick('Disabled')}
343
+ />`}
344
+ />
345
+ </ExampleSubsection>
346
+ </ExampleSection>
347
+
348
+ <ExampleSection id="api-reference" title="Referencia API" icon="code">
349
+ <div style={{
350
+ background: '#fff',
351
+ padding: '1.5rem',
352
+ borderRadius: '8px',
353
+ border: '1px solid #ddd'
354
+ }}>
355
+ <h4>Props del componente Button:</h4>
356
+ <table style={{ width: '100%', borderCollapse: 'collapse', fontSize: '0.875rem' }}>
357
+ <thead>
358
+ <tr style={{ background: '#f8f9fa' }}>
359
+ <th style={{ padding: '0.5rem', border: '1px solid #ddd', textAlign: 'left' }}>Prop</th>
360
+ <th style={{ padding: '0.5rem', border: '1px solid #ddd', textAlign: 'left' }}>Tipo</th>
361
+ <th style={{ padding: '0.5rem', border: '1px solid #ddd', textAlign: 'left' }}>Default</th>
362
+ <th style={{ padding: '0.5rem', border: '1px solid #ddd', textAlign: 'left' }}>Descripción</th>
363
+ </tr>
364
+ </thead>
365
+ <tbody>
366
+ <tr>
367
+ <td style={{ padding: '0.5rem', border: '1px solid #ddd' }}><code>label</code></td>
368
+ <td style={{ padding: '0.5rem', border: '1px solid #ddd' }}>string</td>
369
+ <td style={{ padding: '0.5rem', border: '1px solid #ddd' }}>-</td>
370
+ <td style={{ padding: '0.5rem', border: '1px solid #ddd' }}>Texto del botón</td>
371
+ </tr>
372
+ <tr>
373
+ <td style={{ padding: '0.5rem', border: '1px solid #ddd' }}><code>variant</code></td>
374
+ <td style={{ padding: '0.5rem', border: '1px solid #ddd' }}>string</td>
375
+ <td style={{ padding: '0.5rem', border: '1px solid #ddd' }}>primary</td>
376
+ <td style={{ padding: '0.5rem', border: '1px solid #ddd' }}>Variante: primary, secondary, text</td>
377
+ </tr>
378
+ <tr>
379
+ <td style={{ padding: '0.5rem', border: '1px solid #ddd' }}><code>size</code></td>
380
+ <td style={{ padding: '0.5rem', border: '1px solid #ddd' }}>string</td>
381
+ <td style={{ padding: '0.5rem', border: '1px solid #ddd' }}>medium</td>
382
+ <td style={{ padding: '0.5rem', border: '1px solid #ddd' }}>Tamaño: small, medium, large</td>
383
+ </tr>
384
+ <tr>
385
+ <td style={{ padding: '0.5rem', border: '1px solid #ddd' }}><code>icon</code></td>
386
+ <td style={{ padding: '0.5rem', border: '1px solid #ddd' }}>string</td>
387
+ <td style={{ padding: '0.5rem', border: '1px solid #ddd' }}>-</td>
388
+ <td style={{ padding: '0.5rem', border: '1px solid #ddd' }}>Icono Material Design</td>
389
+ </tr>
390
+ <tr>
391
+ <td style={{ padding: '0.5rem', border: '1px solid #ddd' }}><code>loading</code></td>
392
+ <td style={{ padding: '0.5rem', border: '1px solid #ddd' }}>boolean</td>
393
+ <td style={{ padding: '0.5rem', border: '1px solid #ddd' }}>false</td>
394
+ <td style={{ padding: '0.5rem', border: '1px solid #ddd' }}>Muestra spinner de carga</td>
395
+ </tr>
396
+ <tr>
397
+ <td style={{ padding: '0.5rem', border: '1px solid #ddd' }}><code>disabled</code></td>
398
+ <td style={{ padding: '0.5rem', border: '1px solid #ddd' }}>boolean</td>
399
+ <td style={{ padding: '0.5rem', border: '1px solid #ddd' }}>false</td>
400
+ <td style={{ padding: '0.5rem', border: '1px solid #ddd' }}>Deshabilita el botón</td>
401
+ </tr>
402
+ <tr>
403
+ <td style={{ padding: '0.5rem', border: '1px solid #ddd' }}><code>action</code></td>
404
+ <td style={{ padding: '0.5rem', border: '1px solid #ddd' }}>function</td>
405
+ <td style={{ padding: '0.5rem', border: '1px solid #ddd' }}>-</td>
406
+ <td style={{ padding: '0.5rem', border: '1px solid #ddd' }}>Función a ejecutar al hacer click</td>
407
+ </tr>
408
+ </tbody>
409
+ </table>
410
+ </div>
411
+ </ExampleSection>
412
+ </ExampleLayout>
413
+ )
414
+ }
415
+
416
+ export default ButtonExamples
@@ -1,5 +1,6 @@
1
1
  import React, { useState } from 'react'
2
- import { CheckBox } from './checkbox'
2
+ import { CheckBox } from '
3
+ import { ExampleLayout, ExampleSection, ExampleSubsection, CodeSnippet } from './ExampleLayout'./checkbox'
3
4
 
4
5
  /**
5
6
  * Ejemplos de uso del componente CheckBox mejorado
@@ -46,9 +47,96 @@ export const CheckBoxExamples = () => {
46
47
  }
47
48
  }
48
49
 
50
+ // Definir secciones para el menú lateral
51
+
52
+
53
+ const sections =
54
+
55
+ [
56
+
57
+
58
+ {
59
+
60
+
61
+ "id": "overview",
62
+
63
+
64
+ "title": "Introducción",
65
+
66
+
67
+ "icon": "info"
68
+
69
+
70
+ },
71
+
72
+
73
+ {
74
+
75
+
76
+ "id": "basic-examples",
77
+
78
+
79
+ "title": "Ejemplos Básicos",
80
+
81
+
82
+ "icon": "widgets"
83
+
84
+
85
+ },
86
+
87
+
88
+ {
89
+
90
+
91
+ "id": "advanced-features",
92
+
93
+
94
+ "title": "Características Avanzadas",
95
+
96
+
97
+ "icon": "settings"
98
+
99
+
100
+ },
101
+
102
+
103
+ {
104
+
105
+
106
+ "id": "states",
107
+
108
+
109
+ "title": "Estados",
110
+
111
+
112
+ "icon": "toggle_on"
113
+
114
+
115
+ },
116
+
117
+
118
+ {
119
+
120
+
121
+ "id": "sizes",
122
+
123
+
124
+ "title": "Tamaños",
125
+
126
+
127
+ "icon": "format_size"
128
+
129
+
130
+ }
131
+
132
+
133
+ ]
134
+
135
+
136
+
49
137
  return (
50
- <div style={{ padding: '2rem', maxWidth: '800px' }}>
51
- <h1>Ejemplos del Componente CheckBox Mejorado</h1>
138
+ <ExampleLayout title="Checkbox Examples" sections={sections}>
139
+ <ExampleSection id="overview" title="Ejemplos del Componente CheckBox Mejorado" icon="widgets">
52
140
 
53
141
  <div style={{
54
142
  background: '#f8f9fa',
@@ -309,7 +397,8 @@ export const CheckBoxExamples = () => {
309
397
  {JSON.stringify(formData, null, 2)}
310
398
  </pre>
311
399
  </section>
312
- </div>
400
+ </ExampleSection>
401
+ </ExampleLayout>
313
402
  )
314
403
  }
315
404