ywana-core8 0.1.103 → 0.2.1

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 (172) hide show
  1. package/dist/index.css +4941 -324
  2. package/dist/index.js +42338 -0
  3. package/dist/index.js.map +1 -0
  4. package/dist/index.modern.js +37458 -31678
  5. package/dist/index.modern.js.map +1 -1
  6. package/dist/index.umd.js +39634 -34010
  7. package/dist/index.umd.js.map +1 -1
  8. package/package.json +26 -29
  9. package/src/Test.stories.jsx +28 -0
  10. package/src/desktop/Desktop.stories.jsx +110 -0
  11. package/src/desktop/WindowContext.js +135 -0
  12. package/src/desktop/WindowManager.js +355 -0
  13. package/src/desktop/desktop.css +55 -4
  14. package/src/desktop/desktop.js +312 -6
  15. package/src/desktop/index.js +7 -0
  16. package/src/desktop/window.css +229 -36
  17. package/src/desktop/window.js +254 -20
  18. package/src/desktop.backup/desktop.css +6 -0
  19. package/src/desktop.backup/desktop.js +13 -0
  20. package/src/desktop.backup/window.css +58 -0
  21. package/src/desktop.backup/window.js +27 -0
  22. package/src/html/Accordion.stories.jsx +178 -0
  23. package/src/html/Button.stories.jsx +175 -0
  24. package/src/html/Checkbox.stories.jsx +131 -0
  25. package/src/html/Chip.stories.jsx +189 -0
  26. package/src/html/Color.stories.jsx +234 -0
  27. package/src/html/Form.stories.jsx +271 -0
  28. package/src/html/Icon.stories.jsx +233 -0
  29. package/src/html/Progress.stories.jsx +247 -0
  30. package/src/html/Radio.stories.jsx +289 -0
  31. package/src/html/StyleTest.stories.jsx +81 -0
  32. package/src/html/Switch.stories.jsx +329 -0
  33. package/src/html/Tab.stories.jsx +239 -0
  34. package/src/html/Table.stories.jsx +188 -0
  35. package/src/html/Table2.stories.jsx +238 -0
  36. package/src/html/TextField2.stories.jsx +337 -0
  37. package/src/html/Tree.stories.jsx +285 -0
  38. package/src/html/accordion.example.js +0 -74
  39. package/src/html/accordion.js +1 -6
  40. package/src/html/button.js +2 -13
  41. package/src/html/checkbox.js +1 -9
  42. package/src/html/chip.js +2 -19
  43. package/src/html/color.js +1 -14
  44. package/src/html/form.js +4 -15
  45. package/src/html/header2.js +1 -12
  46. package/src/html/icon.js +1 -7
  47. package/src/html/index.js +1 -1
  48. package/src/html/list.js +1 -19
  49. package/src/html/menu.js +9 -5
  50. package/src/html/progress.js +5 -53
  51. package/src/html/property.js +9 -25
  52. package/src/html/radio.js +2 -16
  53. package/src/html/section.js +1 -6
  54. package/src/html/selector.js +2 -19
  55. package/src/html/switch.css +134 -100
  56. package/src/html/switch.example.js +46 -36
  57. package/src/html/switch.js +43 -192
  58. package/src/html/tab.js +3 -24
  59. package/src/html/text.js +1 -12
  60. package/src/html/textfield2.js +5 -42
  61. package/src/html/thumbnail.js +1 -12
  62. package/src/html/tokenfield.js +2 -21
  63. package/src/html/tree.js +3 -35
  64. package/src/index.js +1 -0
  65. package/__previewjs__/Wrapper.tsx +0 -14
  66. package/build-doc.sh +0 -10
  67. package/db/db.json +0 -89
  68. package/db/routes.json +0 -0
  69. package/dist/index.cjs +0 -36722
  70. package/dist/index.cjs.map +0 -1
  71. package/dist/index.css.map +0 -1
  72. package/doc/README.md +0 -196
  73. package/doc/evalulations/ACCORDION_EVALUATION.md +0 -583
  74. package/doc/evalulations/CHECKBOX_EVALUATION.md +0 -273
  75. package/doc/evalulations/CHIP_EVALUATION.md +0 -542
  76. package/doc/evalulations/COLOR_EVALUATION.md +0 -524
  77. package/doc/evalulations/COMPONENTS_EVALUATION.md +0 -477
  78. package/doc/evalulations/FORM_EVALUATION.md +0 -459
  79. package/doc/evalulations/HEADER_EVALUATION.md +0 -436
  80. package/doc/evalulations/ICON_EVALUATION.md +0 -254
  81. package/doc/evalulations/LIST_EVALUATION.md +0 -574
  82. package/doc/evalulations/PROGRESS_EVALUATION.md +0 -450
  83. package/doc/evalulations/RADIO_EVALUATION.md +0 -439
  84. package/doc/evalulations/RADIO_VISUAL_FIX.md +0 -183
  85. package/doc/evalulations/SECTION_IMPROVEMENTS.md +0 -153
  86. package/doc/evalulations/SWITCH_EVALUATION.md +0 -335
  87. package/doc/evalulations/SWITCH_VISUAL_FIX.md +0 -232
  88. package/doc/evalulations/TAB_EVALUATION.md +0 -626
  89. package/doc/evalulations/TEXTFIELD_EVALUATION.md +0 -747
  90. package/doc/evalulations/TOOLTIP_FIX.md +0 -157
  91. package/doc/evalulations/TREE_EVALUATION.md +0 -708
  92. package/doc/index.html +0 -0
  93. package/doc/package-lock.json +0 -17298
  94. package/doc/package.json +0 -34
  95. package/doc/public/index.html +0 -24
  96. package/doc/scripts/generate-examples.js +0 -129
  97. package/doc/src/App.css +0 -171
  98. package/doc/src/App.js +0 -114
  99. package/doc/src/components/ExamplePage.js +0 -129
  100. package/doc/src/components/WelcomePage.js +0 -84
  101. package/doc/src/index.css +0 -246
  102. package/doc/src/index.js +0 -17
  103. package/doc/src/theme.css +0 -256
  104. package/jest.config.js +0 -24
  105. package/preview.config.js +0 -38
  106. package/publish.sh +0 -6
  107. package/src/desktop/dektop.test.js +0 -11
  108. package/src/domain/CollectionAPI.test.js +0 -19
  109. package/src/domain/ContentEditor.test.js +0 -52
  110. package/src/domain2/CollectionAPI.test.js +0 -19
  111. package/src/domain2/CollectionContext.test.js +0 -71
  112. package/src/domain2/CollectionPage.test.js +0 -112
  113. package/src/domain2/DynamicForm.test.js +0 -47
  114. package/src/html/accordion.test.js +0 -37
  115. package/src/html/accordion.unit.test.js +0 -334
  116. package/src/html/button.example.new.js +0 -416
  117. package/src/html/button.test.js +0 -422
  118. package/src/html/checkbox.test.js +0 -285
  119. package/src/html/chip.test.js +0 -425
  120. package/src/html/color.example.js.backup +0 -527
  121. package/src/html/color.test.js +0 -377
  122. package/src/html/components.example.js.backup +0 -492
  123. package/src/html/components_enhanced.test.js +0 -581
  124. package/src/html/form.example.js.backup +0 -385
  125. package/src/html/form.test.js +0 -369
  126. package/src/html/header2.example.js.backup +0 -411
  127. package/src/html/header2.test.js +0 -377
  128. package/src/html/icon.example.js.backup +0 -268
  129. package/src/html/icon.test.js +0 -231
  130. package/src/html/label.test.js +0 -0
  131. package/src/html/list.example.js.backup +0 -404
  132. package/src/html/list.test.js +0 -383
  133. package/src/html/progress.example.js.backup +0 -424
  134. package/src/html/progress.test.js +0 -313
  135. package/src/html/property.example.js.backup +0 -553
  136. package/src/html/property.test.js +0 -371
  137. package/src/html/radio.example.js.backup +0 -389
  138. package/src/html/radio.test.js +0 -318
  139. package/src/html/section.example.js.backup +0 -99
  140. package/src/html/section.test.js +0 -131
  141. package/src/html/selector.test.js +0 -20
  142. package/src/html/switch.example.js.backup +0 -461
  143. package/src/html/switch.test.js +0 -355
  144. package/src/html/tab.example.js.backup +0 -446
  145. package/src/html/tab.test.js +0 -25
  146. package/src/html/tab_enhanced.test.js +0 -504
  147. package/src/html/table.test.js +0 -70
  148. package/src/html/table2.test.js +0 -582
  149. package/src/html/text.test.js +0 -15
  150. package/src/html/textfield.test.js +0 -51
  151. package/src/html/textfield2.example.js.backup +0 -1370
  152. package/src/html/textfield2.test.js +0 -950
  153. package/src/html/tokenfield.example.js.backup +0 -503
  154. package/src/html/tokenfield.test.js +0 -423
  155. package/src/html/tree.example.js.backup +0 -475
  156. package/src/html/tree.test.js +0 -43
  157. package/src/html/tree_enhanced.test.js +0 -495
  158. package/src/http/token.test.js +0 -50
  159. package/src/incubator/pdfViewer.js +0 -33
  160. package/src/incubator/wizard.test.js +0 -127
  161. package/src/site/site.test.js +0 -230
  162. package/src/site/view.test.js +0 -41
  163. package/src/widgets/calendar/Calendar.test.js +0 -28
  164. package/src/widgets/explorer/Explorer.test.js +0 -121
  165. package/src/widgets/ide/editor.test.js +0 -33
  166. package/src/widgets/kanban/Kanban.test.js +0 -78
  167. package/src/widgets/login/LoginBox.test.js +0 -12
  168. package/src/widgets/login/ResetPasswordBox.test.js +0 -34
  169. package/src/widgets/login/validations.test.js +0 -51
  170. package/src/widgets/planner/Planner.test.js +0 -60
  171. package/src/widgets/upload/Upload.test.js +0 -32
  172. package/table2.test.js +0 -454
@@ -1,389 +0,0 @@
1
- import React, { useState } from 'react'
2
- import { RadioButton, RadioGroup } from './radio'
3
-
4
- /**
5
- * Ejemplos de uso de los componentes Radio mejorados
6
- */
7
- export const RadioExamples = () => {
8
- const [settings, setSettings] = useState({
9
- theme: 'light',
10
- language: 'es',
11
- notifications: 'email',
12
- privacy: 'public',
13
- size: 'medium'
14
- })
15
-
16
- const [validationErrors, setValidationErrors] = useState({})
17
-
18
- const handleChange = (id, value) => {
19
- setSettings(prev => ({ ...prev, [id]: value }))
20
-
21
- // Limpiar errores cuando el usuario interactúa
22
- if (validationErrors[id]) {
23
- setValidationErrors(prev => ({ ...prev, [id]: null }))
24
- }
25
- }
26
-
27
- const validateSettings = () => {
28
- const errors = {}
29
-
30
- if (!settings.theme) {
31
- errors.theme = 'Debe seleccionar un tema'
32
- }
33
-
34
- if (!settings.notifications) {
35
- errors.notifications = 'Debe seleccionar un método de notificación'
36
- }
37
-
38
- setValidationErrors(errors)
39
- return Object.keys(errors).length === 0
40
- }
41
-
42
- const handleSave = () => {
43
- if (validateSettings()) {
44
- alert('Configuración guardada: ' + JSON.stringify(settings, null, 2))
45
- }
46
- }
47
-
48
- return (
49
- <div style={{ padding: '2rem', maxWidth: '800px' }}>
50
- <h1>Ejemplos de Componentes Radio Mejorados</h1>
51
-
52
- <div style={{
53
- background: '#f8f9fa',
54
- padding: '1rem',
55
- borderRadius: '8px',
56
- marginBottom: '2rem',
57
- border: '1px solid #e9ecef'
58
- }}>
59
- <h3>✅ Mejoras Implementadas:</h3>
60
- <ul>
61
- <li>🛡️ <strong>Validación de props</strong> - Advertencias para props incorrectas</li>
62
- <li>♿ <strong>Accesibilidad completa</strong> - ARIA, soporte de teclado, focus</li>
63
- <li>📝 <strong>PropTypes y documentación</strong> - Validación y documentación completa</li>
64
- <li>🎯 <strong>Estados avanzados</strong> - disabled, readOnly, error</li>
65
- <li>🎨 <strong>CSS mejorado</strong> - Estados visuales consistentes y responsivos</li>
66
- <li>⌨️ <strong>Soporte de teclado</strong> - Espacio para seleccionar</li>
67
- <li>🔧 <strong>Manejo de errores</strong> - Mensajes de error integrados</li>
68
- <li>👥 <strong>RadioGroup</strong> - Componente para manejar grupos</li>
69
- <li>🔄 <strong>Sincronización de estado</strong> - Control interno y externo</li>
70
- <li>🧪 <strong>Pruebas unitarias</strong> - 17 pruebas que cubren toda la funcionalidad</li>
71
- </ul>
72
- </div>
73
-
74
- {/* RadioButtons individuales */}
75
- <section style={{ marginBottom: '2rem' }}>
76
- <h3>RadioButtons Individuales</h3>
77
- <div style={{
78
- background: '#fff',
79
- padding: '1.5rem',
80
- borderRadius: '8px',
81
- border: '1px solid #ddd'
82
- }}>
83
- <p><strong>Tema de la aplicación:</strong></p>
84
- <div style={{ display: 'flex', flexDirection: 'column', gap: '1rem' }}>
85
- <RadioButton
86
- id="theme-light"
87
- name="theme"
88
- label="Tema claro"
89
- value="light"
90
- checked={settings.theme === 'light'}
91
- onChange={handleChange}
92
- />
93
- <RadioButton
94
- id="theme-dark"
95
- name="theme"
96
- label="Tema oscuro"
97
- value="dark"
98
- checked={settings.theme === 'dark'}
99
- onChange={handleChange}
100
- />
101
- <RadioButton
102
- id="theme-auto"
103
- name="theme"
104
- label="Automático (según sistema)"
105
- value="auto"
106
- checked={settings.theme === 'auto'}
107
- onChange={handleChange}
108
- />
109
- </div>
110
- </div>
111
- </section>
112
-
113
- {/* RadioGroup básico */}
114
- <section style={{ marginBottom: '2rem' }}>
115
- <h3>RadioGroup - Idioma</h3>
116
- <div style={{
117
- background: '#fff',
118
- padding: '1.5rem',
119
- borderRadius: '8px',
120
- border: '1px solid #ddd'
121
- }}>
122
- <RadioGroup
123
- id="language"
124
- label="Idioma de la interfaz"
125
- value={settings.language}
126
- onChange={handleChange}
127
- options={[
128
- { id: 'es', label: 'Español', value: 'es' },
129
- { id: 'en', label: 'English', value: 'en' },
130
- { id: 'fr', label: 'Français', value: 'fr' },
131
- { id: 'de', label: 'Deutsch', value: 'de' }
132
- ]}
133
- />
134
- </div>
135
- </section>
136
-
137
- {/* RadioGroup con validación */}
138
- <section style={{ marginBottom: '2rem' }}>
139
- <h3>RadioGroup con Validación</h3>
140
- <div style={{
141
- background: '#fff',
142
- padding: '1.5rem',
143
- borderRadius: '8px',
144
- border: '1px solid #ddd'
145
- }}>
146
- <RadioGroup
147
- id="notifications"
148
- label="Método de notificaciones"
149
- value={settings.notifications}
150
- onChange={handleChange}
151
- required={true}
152
- error={validationErrors.notifications}
153
- options={[
154
- { id: 'email', label: 'Correo electrónico', value: 'email' },
155
- { id: 'sms', label: 'SMS', value: 'sms' },
156
- { id: 'push', label: 'Notificaciones push', value: 'push' },
157
- { id: 'none', label: 'Sin notificaciones', value: 'none' }
158
- ]}
159
- />
160
- </div>
161
- </section>
162
-
163
- {/* Estados especiales */}
164
- <section style={{ marginBottom: '2rem' }}>
165
- <h3>Estados Especiales</h3>
166
- <div style={{
167
- background: '#fff',
168
- padding: '1.5rem',
169
- borderRadius: '8px',
170
- border: '1px solid #ddd'
171
- }}>
172
- <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))', gap: '2rem' }}>
173
- {/* Disabled */}
174
- <div>
175
- <h4>RadioGroup Deshabilitado</h4>
176
- <RadioGroup
177
- id="disabled-example"
178
- label="Configuración avanzada"
179
- value="option1"
180
- disabled={true}
181
- options={[
182
- { id: 'opt1', label: 'Opción 1', value: 'option1' },
183
- { id: 'opt2', label: 'Opción 2', value: 'option2' }
184
- ]}
185
- />
186
- </div>
187
-
188
- {/* ReadOnly */}
189
- <div>
190
- <h4>RadioGroup Solo Lectura</h4>
191
- <RadioGroup
192
- id="readonly-example"
193
- label="Configuración del sistema"
194
- value="option2"
195
- readOnly={true}
196
- options={[
197
- { id: 'opt1', label: 'Opción 1', value: 'option1' },
198
- { id: 'opt2', label: 'Opción 2', value: 'option2' }
199
- ]}
200
- />
201
- </div>
202
-
203
- {/* Con Error */}
204
- <div>
205
- <h4>RadioGroup con Error</h4>
206
- <RadioGroup
207
- id="error-example"
208
- label="Configuración requerida"
209
- value=""
210
- error="Debe seleccionar una opción"
211
- options={[
212
- { id: 'opt1', label: 'Opción 1', value: 'option1' },
213
- { id: 'opt2', label: 'Opción 2', value: 'option2' }
214
- ]}
215
- />
216
- </div>
217
- </div>
218
- </div>
219
- </section>
220
-
221
- {/* Formulario completo */}
222
- <section style={{ marginBottom: '2rem' }}>
223
- <h3>Formulario de Configuración</h3>
224
- <div style={{
225
- background: '#fff',
226
- padding: '1.5rem',
227
- borderRadius: '8px',
228
- border: '1px solid #ddd'
229
- }}>
230
- <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))', gap: '2rem' }}>
231
- <RadioGroup
232
- id="privacy"
233
- label="Configuración de privacidad"
234
- value={settings.privacy}
235
- onChange={handleChange}
236
- required={true}
237
- options={[
238
- { id: 'public', label: 'Público', value: 'public' },
239
- { id: 'friends', label: 'Solo amigos', value: 'friends' },
240
- { id: 'private', label: 'Privado', value: 'private' }
241
- ]}
242
- />
243
-
244
- <RadioGroup
245
- id="size"
246
- label="Tamaño de la interfaz"
247
- value={settings.size}
248
- onChange={handleChange}
249
- options={[
250
- { id: 'small', label: 'Pequeño', value: 'small' },
251
- { id: 'medium', label: 'Mediano', value: 'medium' },
252
- { id: 'large', label: 'Grande', value: 'large' }
253
- ]}
254
- />
255
- </div>
256
-
257
- <div style={{ display: 'flex', gap: '1rem', marginTop: '2rem' }}>
258
- <button
259
- onClick={handleSave}
260
- style={{
261
- padding: '0.5rem 1rem',
262
- backgroundColor: '#007bff',
263
- color: 'white',
264
- border: 'none',
265
- borderRadius: '4px',
266
- cursor: 'pointer'
267
- }}
268
- >
269
- Guardar Configuración
270
- </button>
271
- <button
272
- onClick={() => {
273
- setSettings({
274
- theme: 'light',
275
- language: 'es',
276
- notifications: 'email',
277
- privacy: 'public',
278
- size: 'medium'
279
- })
280
- setValidationErrors({})
281
- }}
282
- style={{
283
- padding: '0.5rem 1rem',
284
- backgroundColor: '#6c757d',
285
- color: 'white',
286
- border: 'none',
287
- borderRadius: '4px',
288
- cursor: 'pointer'
289
- }}
290
- >
291
- Resetear
292
- </button>
293
- </div>
294
- </div>
295
- </section>
296
-
297
- {/* Demostración de accesibilidad */}
298
- <section style={{ marginBottom: '2rem' }}>
299
- <h3>Demostración de Accesibilidad</h3>
300
- <div style={{
301
- background: '#e8f5e8',
302
- padding: '1rem',
303
- borderRadius: '4px',
304
- border: '1px solid #c8e6c9'
305
- }}>
306
- <p><strong>Prueba la accesibilidad:</strong></p>
307
- <ol>
308
- <li>Usa <kbd>Tab</kbd> para navegar entre grupos de radio buttons</li>
309
- <li>Usa <kbd>Espacio</kbd> para seleccionar un radio button</li>
310
- <li>Usa las flechas <kbd>↑</kbd> <kbd>↓</kbd> para navegar dentro de un grupo</li>
311
- <li>Observa los indicadores de focus</li>
312
- <li>Los lectores de pantalla anunciarán el estado y etiquetas</li>
313
- </ol>
314
-
315
- <RadioGroup
316
- id="accessibility-demo"
317
- label="Demostración de accesibilidad"
318
- value="option1"
319
- onChange={() => {}}
320
- options={[
321
- { id: 'acc1', label: 'Opción accesible 1', value: 'option1' },
322
- { id: 'acc2', label: 'Opción accesible 2', value: 'option2' },
323
- { id: 'acc3', label: 'Opción accesible 3', value: 'option3' }
324
- ]}
325
- />
326
- </div>
327
- </section>
328
-
329
- {/* Comparación antes/después */}
330
- <section style={{ marginBottom: '2rem' }}>
331
- <h3>Comparación: Antes vs Después</h3>
332
- <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '1rem' }}>
333
- <div style={{
334
- background: '#ffebee',
335
- padding: '1rem',
336
- borderRadius: '4px',
337
- border: '1px solid #ffcdd2'
338
- }}>
339
- <h4>❌ Antes</h4>
340
- <ul>
341
- <li>Error de sintaxis (class vs className)</li>
342
- <li>Sin validación de props</li>
343
- <li>Sin accesibilidad</li>
344
- <li>Evento incorrecto (onClick vs onChange)</li>
345
- <li>Props confusas (value para checked)</li>
346
- <li>Sin estados avanzados</li>
347
- <li>Sin componente de grupo</li>
348
- <li>Sin documentación</li>
349
- </ul>
350
- </div>
351
- <div style={{
352
- background: '#e8f5e8',
353
- padding: '1rem',
354
- borderRadius: '4px',
355
- border: '1px solid #c8e6c9'
356
- }}>
357
- <h4>✅ Después</h4>
358
- <ul>
359
- <li>Sintaxis corregida</li>
360
- <li>PropTypes completos</li>
361
- <li>Accesibilidad total</li>
362
- <li>Eventos correctos</li>
363
- <li>Props claras y consistentes</li>
364
- <li>Estados avanzados (disabled, error, readOnly)</li>
365
- <li>RadioGroup para manejo de grupos</li>
366
- <li>Documentación y ejemplos completos</li>
367
- </ul>
368
- </div>
369
- </div>
370
- </section>
371
-
372
- {/* Estado actual */}
373
- <section>
374
- <h3>Estado Actual de la Configuración</h3>
375
- <pre style={{
376
- background: '#f8f9fa',
377
- padding: '1rem',
378
- borderRadius: '4px',
379
- fontSize: '0.9rem',
380
- overflow: 'auto'
381
- }}>
382
- {JSON.stringify(settings, null, 2)}
383
- </pre>
384
- </section>
385
- </div>
386
- )
387
- }
388
-
389
- export default RadioExamples