ywana-core8 0.1.103 → 0.2.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 (172) hide show
  1. package/dist/index.css +4941 -324
  2. package/dist/index.js +42339 -0
  3. package/dist/index.js.map +1 -0
  4. package/dist/index.modern.js +37459 -31678
  5. package/dist/index.modern.js.map +1 -1
  6. package/dist/index.umd.js +39635 -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 +255 -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,492 +0,0 @@
1
- import React, { useState } from 'react'
2
- import { Thumbnail } from './thumbnail'
3
- import { MultiSelector, ToggleButton } from './selector'
4
- import { Text, TEXTFORMATS } from './text'
5
- import { Button } from './button'
6
-
7
- /**
8
- * Ejemplos de los componentes Thumbnail, Selector y Text mejorados manteniendo 100% compatibilidad
9
- */
10
- export const ComponentsExamples = () => {
11
- const [selectedOptions, setSelectedOptions] = useState(['option1'])
12
- const [isLoading, setIsLoading] = useState(false)
13
- const [showEmpty, setShowEmpty] = useState(false)
14
-
15
- const sampleOptions = [
16
- { label: 'Option 1', value: 'option1', icon: 'star' },
17
- { label: 'Option 2', value: 'option2', icon: 'favorite' },
18
- { label: 'Option 3', value: 'option3', icon: 'bookmark' },
19
- { label: 'Option 4', value: 'option4', icon: 'thumb_up' },
20
- { label: 'Option 5', value: 'option5', icon: 'check_circle' }
21
- ]
22
-
23
- const handleSelectorChange = (selections) => {
24
- setSelectedOptions(selections)
25
- console.log('Selected options:', selections)
26
- }
27
-
28
- const simulateLoading = () => {
29
- setIsLoading(true)
30
- setTimeout(() => setIsLoading(false), 2000)
31
- }
32
-
33
- return (
34
- <div style={{ padding: '2rem', maxWidth: '1200px', maxHeight: '100vh', overflow: 'auto' }}>
35
- <h1>Componentes Mejorados: Thumbnail, Selector y Text</h1>
36
-
37
- <div style={{
38
- background: '#f8f9fa',
39
- padding: '1rem',
40
- borderRadius: '8px',
41
- marginBottom: '2rem',
42
- border: '1px solid #e9ecef'
43
- }}>
44
- <h3>✅ Mejoras Implementadas (100% Compatibilidad):</h3>
45
- <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: '1rem' }}>
46
- <div>
47
- <h4>🖼️ Thumbnail</h4>
48
- <ul>
49
- <li>PropTypes completos</li>
50
- <li>Múltiples tamaños y formas</li>
51
- <li>Estados loading/error</li>
52
- <li>Placeholder y fallback</li>
53
- <li>Clickable con overlay</li>
54
- <li>Badges y tooltips</li>
55
- <li>Lazy loading</li>
56
- </ul>
57
- </div>
58
- <div>
59
- <h4>🎛️ MultiSelector</h4>
60
- <ul>
61
- <li>Búsqueda integrada</li>
62
- <li>Min/max selecciones</li>
63
- <li>Variantes visuales</li>
64
- <li>Estados loading/empty</li>
65
- <li>Clear all button</li>
66
- <li>Navegación por teclado</li>
67
- <li>Accesibilidad completa</li>
68
- </ul>
69
- </div>
70
- <div>
71
- <h4>📝 Text</h4>
72
- <ul>
73
- <li>Nuevos formatos</li>
74
- <li>Internacionalización</li>
75
- <li>Copy to clipboard</li>
76
- <li>Estados loading/skeleton</li>
77
- <li>Truncate y styling</li>
78
- <li>Múltiples elementos</li>
79
- <li>Formateo avanzado</li>
80
- </ul>
81
- </div>
82
- </div>
83
- </div>
84
-
85
- {/* Controles de demostración */}
86
- <section style={{ marginBottom: '2rem' }}>
87
- <h3>Controles de Demostración</h3>
88
- <div style={{
89
- background: '#fff',
90
- padding: '1rem',
91
- borderRadius: '8px',
92
- border: '1px solid #ddd',
93
- display: 'flex',
94
- gap: '1rem',
95
- alignItems: 'center',
96
- flexWrap: 'wrap'
97
- }}>
98
- <Button
99
- label="Simulate Loading"
100
- icon="refresh"
101
- action={simulateLoading}
102
- disabled={isLoading}
103
- />
104
- <Button
105
- label={showEmpty ? "Show Content" : "Show Empty"}
106
- icon={showEmpty ? "visibility" : "visibility_off"}
107
- action={() => setShowEmpty(!showEmpty)}
108
- />
109
- <span style={{ marginLeft: 'auto', color: '#666' }}>
110
- Selected: [{selectedOptions.join(', ')}]
111
- </span>
112
- </div>
113
- </section>
114
-
115
- {/* Thumbnail Examples */}
116
- <section style={{ marginBottom: '2rem' }}>
117
- <h3>🖼️ Thumbnail Component</h3>
118
-
119
- {/* Basic Thumbnails (Compatible) */}
120
- <div style={{ marginBottom: '1.5rem' }}>
121
- <h4>Básico (100% Compatible)</h4>
122
- <div style={{ display: 'flex', gap: '1rem', alignItems: 'center', flexWrap: 'wrap' }}>
123
- <Thumbnail
124
- src="https://picsum.photos/200/200?random=1"
125
- empty="https://via.placeholder.com/200x200/cccccc/666666?text=Empty"
126
- />
127
- <Thumbnail
128
- src="https://picsum.photos/200/200?random=2"
129
- objectFit="contain"
130
- />
131
- <Thumbnail
132
- src=""
133
- empty="https://via.placeholder.com/200x200/ffcccc/cc0000?text=Fallback"
134
- />
135
- </div>
136
- </div>
137
-
138
- {/* Enhanced Thumbnails */}
139
- <div style={{ marginBottom: '1.5rem' }}>
140
- <h4>Mejorado con Nuevas Características</h4>
141
- <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(120px, 1fr))', gap: '1rem' }}>
142
- <Thumbnail
143
- src="https://picsum.photos/200/200?random=3"
144
- size="small"
145
- shape="circle"
146
- bordered={true}
147
- shadow={true}
148
- alt="Small circular thumbnail"
149
- />
150
- <Thumbnail
151
- src="https://picsum.photos/200/200?random=4"
152
- size="medium"
153
- shape="rounded"
154
- clickable={true}
155
- onClick={() => alert('Thumbnail clicked!')}
156
- overlay={<span>Click me!</span>}
157
- badge="NEW"
158
- />
159
- <Thumbnail
160
- src="https://picsum.photos/200/200?random=5"
161
- size="large"
162
- shape="square"
163
- loading="lazy"
164
- placeholder="image"
165
- title="Large square thumbnail"
166
- />
167
- <Thumbnail
168
- src="invalid-url"
169
- fallback="broken_image"
170
- size="medium"
171
- shape="circle"
172
- onError={() => console.log('Image failed to load')}
173
- />
174
- </div>
175
- </div>
176
-
177
- {/* Thumbnail States */}
178
- <div style={{ marginBottom: '1.5rem' }}>
179
- <h4>Estados Especiales</h4>
180
- <div style={{ display: 'flex', gap: '1rem', alignItems: 'center', flexWrap: 'wrap' }}>
181
- <Thumbnail
182
- src="https://picsum.photos/200/200?random=6"
183
- disabled={true}
184
- title="Disabled thumbnail"
185
- />
186
- <Thumbnail
187
- src="https://picsum.photos/200/200?random=7"
188
- loading={isLoading}
189
- placeholder="hourglass_empty"
190
- />
191
- <Thumbnail
192
- src="https://picsum.photos/200/200?random=8"
193
- badge={42}
194
- tooltip="Badge with number"
195
- />
196
- </div>
197
- </div>
198
- </section>
199
-
200
- {/* MultiSelector Examples */}
201
- <section style={{ marginBottom: '2rem' }}>
202
- <h3>🎛️ MultiSelector Component</h3>
203
-
204
- {/* Basic Selector (Compatible) */}
205
- <div style={{ marginBottom: '1.5rem' }}>
206
- <h4>Básico (100% Compatible)</h4>
207
- <div style={{
208
- background: '#fff',
209
- border: '1px solid #ddd',
210
- borderRadius: '8px',
211
- overflow: 'hidden'
212
- }}>
213
- <MultiSelector
214
- options={sampleOptions.slice(0, 3)}
215
- onChange={handleSelectorChange}
216
- className="basic-selector"
217
- />
218
- </div>
219
- </div>
220
-
221
- {/* Enhanced Selector */}
222
- <div style={{ marginBottom: '1.5rem' }}>
223
- <h4>Mejorado con Búsqueda y Controles</h4>
224
- <div style={{
225
- background: '#fff',
226
- border: '1px solid #ddd',
227
- borderRadius: '8px',
228
- overflow: 'hidden'
229
- }}>
230
- <MultiSelector
231
- options={sampleOptions}
232
- onChange={handleSelectorChange}
233
- searchable={true}
234
- searchPlaceholder="Buscar opciones..."
235
- allowClear={true}
236
- onClear={() => console.log('Cleared all selections')}
237
- maxSelections={3}
238
- minSelections={1}
239
- variant="outlined"
240
- size="medium"
241
- ariaLabel="Selector con búsqueda"
242
- />
243
- </div>
244
- </div>
245
-
246
- {/* Selector Variants */}
247
- <div style={{ marginBottom: '1.5rem' }}>
248
- <h4>Variantes Visuales</h4>
249
- <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '1rem' }}>
250
- <div style={{
251
- background: '#fff',
252
- border: '1px solid #ddd',
253
- borderRadius: '8px',
254
- overflow: 'hidden'
255
- }}>
256
- <h5 style={{ margin: '1rem', marginBottom: '0' }}>Filled Variant</h5>
257
- <MultiSelector
258
- options={sampleOptions.slice(0, 3)}
259
- variant="filled"
260
- size="small"
261
- />
262
- </div>
263
- <div style={{
264
- background: '#fff',
265
- border: '1px solid #ddd',
266
- borderRadius: '8px',
267
- overflow: 'hidden'
268
- }}>
269
- <h5 style={{ margin: '1rem', marginBottom: '0' }}>Large Size</h5>
270
- <MultiSelector
271
- options={sampleOptions.slice(0, 3)}
272
- variant="default"
273
- size="large"
274
- />
275
- </div>
276
- </div>
277
- </div>
278
-
279
- {/* Selector States */}
280
- <div style={{ marginBottom: '1.5rem' }}>
281
- <h4>Estados Especiales</h4>
282
- <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '1rem' }}>
283
- <div style={{
284
- background: '#fff',
285
- border: '1px solid #ddd',
286
- borderRadius: '8px',
287
- overflow: 'hidden'
288
- }}>
289
- <h5 style={{ margin: '1rem', marginBottom: '0' }}>Loading State</h5>
290
- <MultiSelector
291
- loading={isLoading}
292
- options={[]}
293
- />
294
- </div>
295
- <div style={{
296
- background: '#fff',
297
- border: '1px solid #ddd',
298
- borderRadius: '8px',
299
- overflow: 'hidden'
300
- }}>
301
- <h5 style={{ margin: '1rem', marginBottom: '0' }}>Empty State</h5>
302
- <MultiSelector
303
- empty={showEmpty}
304
- emptyMessage="No hay opciones disponibles"
305
- emptyIcon="inbox"
306
- options={showEmpty ? [] : sampleOptions.slice(0, 2)}
307
- />
308
- </div>
309
- </div>
310
- </div>
311
- </section>
312
-
313
- {/* Text Examples */}
314
- <section style={{ marginBottom: '2rem' }}>
315
- <h3>📝 Text Component</h3>
316
-
317
- {/* Basic Text (Compatible) */}
318
- <div style={{ marginBottom: '1.5rem' }}>
319
- <h4>Básico (100% Compatible)</h4>
320
- <div style={{
321
- background: '#fff',
322
- padding: '1rem',
323
- border: '1px solid #ddd',
324
- borderRadius: '8px'
325
- }}>
326
- <Text format={TEXTFORMATS.HTML}>Este es texto HTML básico</Text><br />
327
- <Text format={TEXTFORMATS.STRING}>Este es texto string</Text><br />
328
- <Text className="custom-class">Texto con clase CSS</Text>
329
- </div>
330
- </div>
331
-
332
- {/* Enhanced Text Formatting */}
333
- <div style={{ marginBottom: '1.5rem' }}>
334
- <h4>Formateo Mejorado</h4>
335
- <div style={{
336
- background: '#fff',
337
- padding: '1rem',
338
- border: '1px solid #ddd',
339
- borderRadius: '8px',
340
- display: 'grid',
341
- gridTemplateColumns: '1fr 1fr',
342
- gap: '1rem'
343
- }}>
344
- <div>
345
- <Text format={TEXTFORMATS.NUMERIC}>1234567.89</Text><br />
346
- <Text format={TEXTFORMATS.CURRENCY} currency="USD">1234.56</Text><br />
347
- <Text format={TEXTFORMATS.PERCENTAGE}>0.75</Text><br />
348
- <Text format={TEXTFORMATS.DATE}>2024-01-15</Text><br />
349
- <Text format={TEXTFORMATS.TIME}>2024-01-15T14:30:00</Text><br />
350
- </div>
351
- <div>
352
- <Text format={TEXTFORMATS.PHONE}>1234567890</Text><br />
353
- <Text format={TEXTFORMATS.CAPITALIZE}>hello world</Text><br />
354
- <Text format={TEXTFORMATS.UPPERCASE}>hello world</Text><br />
355
- <Text format={TEXTFORMATS.LOWERCASE}>HELLO WORLD</Text><br />
356
- <Text format={TEXTFORMATS.TRUNCATE} maxLength={20}>Este es un texto muy largo que será truncado</Text><br />
357
- </div>
358
- </div>
359
- </div>
360
-
361
- {/* Text Styling */}
362
- <div style={{ marginBottom: '1.5rem' }}>
363
- <h4>Estilos y Tamaños</h4>
364
- <div style={{
365
- background: '#fff',
366
- padding: '1rem',
367
- border: '1px solid #ddd',
368
- borderRadius: '8px'
369
- }}>
370
- <Text size="xs">Extra small text</Text><br />
371
- <Text size="sm">Small text</Text><br />
372
- <Text size="md" weight="bold">Medium bold text</Text><br />
373
- <Text size="lg" color="primary">Large primary text</Text><br />
374
- <Text size="xl" weight="semibold" color="success">Extra large success text</Text><br />
375
- <Text size="xxl" weight="bold" color="error" align="center">XXL error text centered</Text><br />
376
- </div>
377
- </div>
378
-
379
- {/* Text Features */}
380
- <div style={{ marginBottom: '1.5rem' }}>
381
- <h4>Características Especiales</h4>
382
- <div style={{
383
- background: '#fff',
384
- padding: '1rem',
385
- border: '1px solid #ddd',
386
- borderRadius: '8px'
387
- }}>
388
- <Text copyable={true}>Texto copiable - haz click para copiar</Text><br />
389
- <Text loading={isLoading}>Texto con estado de carga</Text><br />
390
- <Text skeleton={isLoading}>Texto con skeleton placeholder</Text><br />
391
- <Text fallback="Texto por defecto">{showEmpty ? '' : 'Texto con fallback'}</Text><br />
392
- <Text as="h3" size="lg" weight="bold">Texto renderizado como H3</Text><br />
393
- <Text decoration="underline" transform="capitalize">texto subrayado y capitalizado</Text><br />
394
- </div>
395
- </div>
396
-
397
- {/* Text States */}
398
- <div style={{ marginBottom: '1.5rem' }}>
399
- <h4>Estados y Casos Especiales</h4>
400
- <div style={{
401
- background: '#fff',
402
- padding: '1rem',
403
- border: '1px solid #ddd',
404
- borderRadius: '8px',
405
- display: 'grid',
406
- gridTemplateColumns: '1fr 1fr',
407
- gap: '1rem'
408
- }}>
409
- <div>
410
- <Text>Texto normal</Text><br />
411
- <Text selectable={false}>Texto no seleccionable</Text><br />
412
- <Text truncate={true}>Texto con truncate automático que se corta</Text><br />
413
- </div>
414
- <div>
415
- <Text format={TEXTFORMATS.EMAIL}>usuario@ejemplo.com</Text><br />
416
- <Text format={TEXTFORMATS.URL}>https://www.ejemplo.com</Text><br />
417
- <Text locale="es-ES" format={TEXTFORMATS.DATE}>2024-01-15</Text><br />
418
- </div>
419
- </div>
420
- </div>
421
- </section>
422
-
423
- {/* Comparación antes/después */}
424
- <section style={{ marginBottom: '2rem' }}>
425
- <h3>Comparación: Componentes Originales vs Mejorados</h3>
426
- <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '1rem' }}>
427
- <div style={{
428
- background: '#ffebee',
429
- padding: '1rem',
430
- borderRadius: '4px',
431
- border: '1px solid #ffcdd2'
432
- }}>
433
- <h4>❌ Componentes Originales</h4>
434
- <ul>
435
- <li><strong>Thumbnail:</strong> Básico, sin estados</li>
436
- <li><strong>Selector:</strong> Funcional pero limitado</li>
437
- <li><strong>Text:</strong> Pocos formatos, sin styling</li>
438
- <li>Sin PropTypes ni validación</li>
439
- <li>Sin accesibilidad</li>
440
- <li>Sin estados loading/error</li>
441
- <li>CSS básico sin responsive</li>
442
- </ul>
443
- </div>
444
- <div style={{
445
- background: '#e8f5e8',
446
- padding: '1rem',
447
- borderRadius: '4px',
448
- border: '1px solid #c8e6c9'
449
- }}>
450
- <h4>✅ Componentes Mejorados</h4>
451
- <ul>
452
- <li><strong>Thumbnail:</strong> Múltiples tamaños, formas, estados</li>
453
- <li><strong>Selector:</strong> Búsqueda, límites, variantes</li>
454
- <li><strong>Text:</strong> 15+ formatos, styling completo</li>
455
- <li>PropTypes completos y validación</li>
456
- <li>Accesibilidad total (WCAG 2.1 AA)</li>
457
- <li>Estados loading, error, empty</li>
458
- <li>CSS responsive con dark mode</li>
459
- </ul>
460
- </div>
461
- </div>
462
- </section>
463
-
464
- {/* Garantía de compatibilidad */}
465
- <section style={{ marginBottom: '2rem' }}>
466
- <h3>🔒 Garantía de Compatibilidad</h3>
467
- <div style={{
468
- background: '#fff3cd',
469
- padding: '1rem',
470
- borderRadius: '4px',
471
- border: '1px solid #ffeaa7'
472
- }}>
473
- <p><strong>100% Compatible con Código Existente:</strong></p>
474
- <ul>
475
- <li>✅ Todas las props originales funcionan exactamente igual</li>
476
- <li>✅ Comportamiento de renderizado idéntico</li>
477
- <li>✅ CSS original preservado y mejorado</li>
478
- <li>✅ Nuevas características son opcionales</li>
479
- <li>✅ No se rompe ningún código existente</li>
480
- <li>✅ Migración automática sin cambios</li>
481
- </ul>
482
- <p style={{ marginTop: '1rem', fontSize: '0.9rem', color: '#856404' }}>
483
- <strong>Migración:</strong> Simplemente reemplaza el import y todas las
484
- mejoras se aplican automáticamente sin cambiar una línea de código existente.
485
- </p>
486
- </div>
487
- </section>
488
- </div>
489
- )
490
- }
491
-
492
- export default ComponentsExamples