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,553 +0,0 @@
1
- import React, { useState } from 'react'
2
- import { Property } from './property'
3
- import { Button } from './button'
4
- import { Text } from './text'
5
-
6
- /**
7
- * Ejemplos del componente Property mejorado manteniendo 100% compatibilidad
8
- */
9
- export const PropertyExamples = () => {
10
- const [userProfile, setUserProfile] = useState({
11
- name: 'John Doe',
12
- email: 'john@example.com',
13
- age: '30',
14
- bio: 'Software developer with 5+ years of experience',
15
- status: 'active',
16
- location: 'New York'
17
- })
18
- const [isLoading, setIsLoading] = useState(false)
19
- const [showAdvanced, setShowAdvanced] = useState(false)
20
-
21
- const statusOptions = [
22
- { label: 'Active', value: 'active' },
23
- { label: 'Inactive', value: 'inactive' },
24
- { label: 'Pending', value: 'pending' },
25
- { label: 'Suspended', value: 'suspended' }
26
- ]
27
-
28
- const handlePropertyChange = (id, value) => {
29
- setUserProfile(prev => ({ ...prev, [id]: value }))
30
- console.log(`Property changed: ${id} = ${value}`)
31
- }
32
-
33
- const validateEmail = (value) => {
34
- const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/
35
- if (!emailRegex.test(value)) {
36
- return { isValid: false, error: 'Invalid email format' }
37
- }
38
- return { isValid: true }
39
- }
40
-
41
- const validateAge = (value) => {
42
- const age = parseInt(value)
43
- if (isNaN(age) || age < 0 || age > 120) {
44
- return { isValid: false, error: 'Age must be between 0 and 120' }
45
- }
46
- return { isValid: true }
47
- }
48
-
49
- const simulateLoading = () => {
50
- setIsLoading(true)
51
- setTimeout(() => setIsLoading(false), 2000)
52
- }
53
-
54
- return (
55
- <div style={{ padding: '2rem', maxWidth: '1200px', maxHeight: '100vh', overflow: 'auto' }}>
56
- <h1>Componente Property Mejorado</h1>
57
-
58
- <div style={{
59
- background: '#f8f9fa',
60
- padding: '1rem',
61
- borderRadius: '8px',
62
- marginBottom: '2rem',
63
- border: '1px solid #e9ecef'
64
- }}>
65
- <h3>✅ Mejoras Implementadas (100% Compatibilidad):</h3>
66
- <ul>
67
- <li>🛡️ <strong>PropTypes completos</strong> - Validación y documentación detallada</li>
68
- <li>📝 <strong>Múltiples tipos de input</strong> - text, email, number, password, etc.</li>
69
- <li>📏 <strong>Validación avanzada</strong> - required, minLength, maxLength, pattern</li>
70
- <li>✅ <strong>Validación personalizada</strong> - validateValue function</li>
71
- <li>📄 <strong>Soporte multiline</strong> - textarea para textos largos</li>
72
- <li>📐 <strong>Múltiples tamaños</strong> - small, medium, large</li>
73
- <li>🎭 <strong>Variantes visuales</strong> - default, outlined, filled</li>
74
- <li>📱 <strong>Layouts flexibles</strong> - horizontal, vertical</li>
75
- <li>📋 <strong>Copy functionality</strong> - Copiar valores al clipboard</li>
76
- <li>⚠️ <strong>Estados avanzados</strong> - disabled, error, required, loading</li>
77
- <li>♿ <strong>Accesibilidad completa</strong> - ARIA, navegación por teclado</li>
78
- <li>📱 <strong>Responsive total</strong> - Adaptación móvil y dark mode</li>
79
- </ul>
80
- </div>
81
-
82
- {/* Controles de demostración */}
83
- <section style={{ marginBottom: '2rem' }}>
84
- <h3>Controles de Demostración</h3>
85
- <div style={{
86
- background: '#fff',
87
- padding: '1rem',
88
- borderRadius: '8px',
89
- border: '1px solid #ddd',
90
- display: 'flex',
91
- gap: '1rem',
92
- alignItems: 'center',
93
- flexWrap: 'wrap'
94
- }}>
95
- <Button
96
- label="Simulate Loading"
97
- icon="refresh"
98
- action={simulateLoading}
99
- disabled={isLoading}
100
- />
101
- <Button
102
- label={showAdvanced ? "Hide Advanced" : "Show Advanced"}
103
- icon={showAdvanced ? "visibility_off" : "visibility"}
104
- action={() => setShowAdvanced(!showAdvanced)}
105
- />
106
- <span style={{ marginLeft: 'auto', color: '#666' }}>
107
- Profile: {userProfile.name} ({userProfile.status})
108
- </span>
109
- </div>
110
- </section>
111
-
112
- {/* Property básico (Compatible) */}
113
- <section style={{ marginBottom: '2rem' }}>
114
- <h3>📋 Property Básico (100% Compatible)</h3>
115
- <div style={{
116
- background: '#fff',
117
- padding: '1rem',
118
- border: '1px solid #ddd',
119
- borderRadius: '8px',
120
- display: 'grid',
121
- gridTemplateColumns: '1fr 1fr',
122
- gap: '1rem'
123
- }}>
124
- <Property
125
- id="name"
126
- label="Name"
127
- initial="John Doe"
128
- value={userProfile.name}
129
- editable={true}
130
- onChange={handlePropertyChange}
131
- />
132
- <Property
133
- id="location"
134
- label="Location"
135
- initial="New York"
136
- value={userProfile.location}
137
- editable={true}
138
- onChange={handlePropertyChange}
139
- />
140
- </div>
141
- <Text size="sm" color="muted" style={{ marginTop: '0.5rem' }}>
142
- Funcionalidad original: editable con clear button
143
- </Text>
144
- </section>
145
-
146
- {/* Property con opciones */}
147
- <section style={{ marginBottom: '2rem' }}>
148
- <h3>🎯 Property con Opciones (Compatible)</h3>
149
- <div style={{
150
- background: '#fff',
151
- padding: '1rem',
152
- border: '1px solid #ddd',
153
- borderRadius: '8px'
154
- }}>
155
- <Property
156
- id="status"
157
- label="Status"
158
- value={userProfile.status}
159
- options={statusOptions}
160
- editable={false}
161
- copyable={true}
162
- />
163
- <Text size="sm" color="muted" style={{ marginTop: '0.5rem' }}>
164
- Valor mapeado desde opciones con funcionalidad de copia
165
- </Text>
166
- </div>
167
- </section>
168
-
169
- {/* Property mejorado */}
170
- <section style={{ marginBottom: '2rem' }}>
171
- <h3>🚀 Property Mejorado con Nuevas Características</h3>
172
- <div style={{
173
- background: '#fff',
174
- padding: '1rem',
175
- border: '1px solid #ddd',
176
- borderRadius: '8px',
177
- display: 'grid',
178
- gridTemplateColumns: '1fr 1fr',
179
- gap: '1rem'
180
- }}>
181
- <Property
182
- id="email"
183
- label="Email Address"
184
- value={userProfile.email}
185
- onChange={handlePropertyChange}
186
- editable={true}
187
- type="email"
188
- required={true}
189
- validateValue={validateEmail}
190
- placeholder="Enter email address"
191
- size="medium"
192
- variant="outlined"
193
- helperText="Valid email required"
194
- onValidationError={(error) => console.log('Email validation error:', error)}
195
- />
196
- <Property
197
- id="age"
198
- label="Age"
199
- value={userProfile.age}
200
- onChange={handlePropertyChange}
201
- editable={true}
202
- type="number"
203
- validateValue={validateAge}
204
- placeholder="Enter age"
205
- size="large"
206
- variant="filled"
207
- helperText="Age between 0-120"
208
- disabled={isLoading}
209
- />
210
- </div>
211
- </section>
212
-
213
- {/* Tamaños y variantes */}
214
- <section style={{ marginBottom: '2rem' }}>
215
- <h3>📏 Tamaños y Variantes</h3>
216
- <div style={{
217
- background: '#fff',
218
- padding: '1rem',
219
- border: '1px solid #ddd',
220
- borderRadius: '8px',
221
- display: 'grid',
222
- gridTemplateColumns: '1fr 1fr 1fr',
223
- gap: '1rem'
224
- }}>
225
- <Property
226
- id="small-prop"
227
- label="Small Size"
228
- value="Small property"
229
- editable={false}
230
- size="small"
231
- variant="default"
232
- copyable={true}
233
- />
234
- <Property
235
- id="medium-prop"
236
- label="Medium Size"
237
- value="Medium property"
238
- editable={false}
239
- size="medium"
240
- variant="outlined"
241
- copyable={true}
242
- />
243
- <Property
244
- id="large-prop"
245
- label="Large Size"
246
- value="Large property"
247
- editable={false}
248
- size="large"
249
- variant="filled"
250
- copyable={true}
251
- />
252
- </div>
253
- </section>
254
-
255
- {/* Layouts */}
256
- <section style={{ marginBottom: '2rem' }}>
257
- <h3>📐 Layouts y Configuraciones</h3>
258
- <div style={{
259
- background: '#fff',
260
- padding: '1rem',
261
- border: '1px solid #ddd',
262
- borderRadius: '8px',
263
- display: 'grid',
264
- gridTemplateColumns: '1fr 1fr',
265
- gap: '1rem'
266
- }}>
267
- <div>
268
- <h4>Horizontal Layout</h4>
269
- <Property
270
- id="horizontal"
271
- label="Property Name"
272
- value="Property Value"
273
- editable={false}
274
- layout="horizontal"
275
- nameWidth="40%"
276
- copyable={true}
277
- />
278
- </div>
279
- <div>
280
- <h4>Vertical Layout</h4>
281
- <Property
282
- id="vertical"
283
- label="Property Name"
284
- value="Property Value"
285
- editable={false}
286
- layout="vertical"
287
- copyable={true}
288
- />
289
- </div>
290
- </div>
291
- </section>
292
-
293
- {/* Multiline y tipos especiales */}
294
- <section style={{ marginBottom: '2rem' }}>
295
- <h3>📄 Multiline y Tipos Especiales</h3>
296
- <div style={{
297
- background: '#fff',
298
- padding: '1rem',
299
- border: '1px solid #ddd',
300
- borderRadius: '8px'
301
- }}>
302
- <Property
303
- id="bio"
304
- label="Biography"
305
- value={userProfile.bio}
306
- onChange={handlePropertyChange}
307
- editable={true}
308
- multiline={true}
309
- rows={4}
310
- placeholder="Enter biography..."
311
- maxLength={500}
312
- layout="vertical"
313
- variant="outlined"
314
- helperText="Maximum 500 characters"
315
- />
316
- </div>
317
- </section>
318
-
319
- {/* Estados especiales */}
320
- <section style={{ marginBottom: '2rem' }}>
321
- <h3>⚠️ Estados Especiales</h3>
322
- <div style={{
323
- background: '#fff',
324
- padding: '1rem',
325
- border: '1px solid #ddd',
326
- borderRadius: '8px',
327
- display: 'grid',
328
- gridTemplateColumns: '1fr 1fr',
329
- gap: '1rem'
330
- }}>
331
- <Property
332
- id="required-prop"
333
- label="Required Field"
334
- value=""
335
- onChange={() => {}}
336
- editable={true}
337
- required={true}
338
- placeholder="This field is required"
339
- helperText="This field is required"
340
- />
341
- <Property
342
- id="error-prop"
343
- label="Field with Error"
344
- value="invalid-value"
345
- onChange={() => {}}
346
- editable={true}
347
- error="This value is invalid"
348
- />
349
- <Property
350
- id="disabled-prop"
351
- label="Disabled Field"
352
- value="Disabled value"
353
- onChange={() => {}}
354
- editable={true}
355
- disabled={isLoading}
356
- helperText="Field is disabled"
357
- />
358
- <Property
359
- id="readonly-prop"
360
- label="Read-only Field"
361
- value="Read-only value"
362
- onChange={() => {}}
363
- editable={true}
364
- readOnly={true}
365
- helperText="Field is read-only"
366
- />
367
- </div>
368
- </section>
369
-
370
- {/* Características avanzadas */}
371
- {showAdvanced && (
372
- <section style={{ marginBottom: '2rem' }}>
373
- <h3>🔬 Características Avanzadas</h3>
374
- <div style={{
375
- background: '#fff',
376
- padding: '1rem',
377
- border: '1px solid #ddd',
378
- borderRadius: '8px',
379
- display: 'grid',
380
- gridTemplateColumns: '1fr 1fr',
381
- gap: '1rem'
382
- }}>
383
- <Property
384
- id="pattern-prop"
385
- label="Pattern Validation"
386
- value=""
387
- onChange={() => {}}
388
- editable={true}
389
- pattern="^[A-Z]{2,3}[0-9]{3,4}$"
390
- placeholder="ABC123"
391
- helperText="Format: 2-3 letters + 3-4 numbers"
392
- />
393
- <Property
394
- id="length-prop"
395
- label="Length Validation"
396
- value=""
397
- onChange={() => {}}
398
- editable={true}
399
- minLength={5}
400
- maxLength={20}
401
- placeholder="5-20 characters"
402
- helperText="Between 5 and 20 characters"
403
- />
404
- </div>
405
- </section>
406
- )}
407
-
408
- {/* Loading y skeleton */}
409
- {showAdvanced && (
410
- <section style={{ marginBottom: '2rem' }}>
411
- <h3>⏳ Loading y Skeleton States</h3>
412
- <div style={{
413
- background: '#fff',
414
- padding: '1rem',
415
- border: '1px solid #ddd',
416
- borderRadius: '8px',
417
- display: 'grid',
418
- gridTemplateColumns: '1fr 1fr',
419
- gap: '1rem'
420
- }}>
421
- <Property
422
- id="loading-prop"
423
- label="Loading Property"
424
- value="Loading content..."
425
- loading={isLoading}
426
- />
427
- <Property
428
- id="skeleton-prop"
429
- label="Skeleton Property"
430
- value="Skeleton content"
431
- skeleton={isLoading}
432
- />
433
- </div>
434
- </section>
435
- )}
436
-
437
- {/* Comparación antes/después */}
438
- <section style={{ marginBottom: '2rem' }}>
439
- <h3>Comparación: Property Original vs Mejorado</h3>
440
- <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '1rem' }}>
441
- <div style={{
442
- background: '#ffebee',
443
- padding: '1rem',
444
- borderRadius: '4px',
445
- border: '1px solid #ffcdd2'
446
- }}>
447
- <h4>❌ Property Original</h4>
448
- <ul>
449
- <li>Visualización clave-valor básica</li>
450
- <li>Modo editable con input text</li>
451
- <li>Soporte para opciones</li>
452
- <li>Clear button básico</li>
453
- <li>Sin PropTypes ni validación</li>
454
- <li>Sin tipos de input</li>
455
- <li>Sin validación de datos</li>
456
- <li>Sin estados avanzados</li>
457
- <li>Sin accesibilidad</li>
458
- <li>CSS básico sin responsive</li>
459
- </ul>
460
- </div>
461
- <div style={{
462
- background: '#e8f5e8',
463
- padding: '1rem',
464
- borderRadius: '4px',
465
- border: '1px solid #c8e6c9'
466
- }}>
467
- <h4>✅ Property Mejorado</h4>
468
- <ul>
469
- <li>Mantiene funcionalidad original</li>
470
- <li>PropTypes completos y validación</li>
471
- <li>Múltiples tipos de input</li>
472
- <li>Validación avanzada y personalizada</li>
473
- <li>Soporte multiline (textarea)</li>
474
- <li>Estados disabled, error, required</li>
475
- <li>Accesibilidad total (WCAG 2.1 AA)</li>
476
- <li>Copy functionality integrada</li>
477
- <li>Layouts flexibles (horizontal/vertical)</li>
478
- <li>CSS responsive con dark mode</li>
479
- </ul>
480
- </div>
481
- </div>
482
- </section>
483
-
484
- {/* Garantía de compatibilidad */}
485
- <section style={{ marginBottom: '2rem' }}>
486
- <h3>🔒 Garantía de Compatibilidad</h3>
487
- <div style={{
488
- background: '#fff3cd',
489
- padding: '1rem',
490
- borderRadius: '4px',
491
- border: '1px solid #ffeaa7'
492
- }}>
493
- <p><strong>100% Compatible con Código Existente:</strong></p>
494
- <ul>
495
- <li>✅ Props originales (id, className, label, name, initial, value, editable, onChange, options) funcionan idéntico</li>
496
- <li>✅ Comportamiento de onChange sin cambios</li>
497
- <li>✅ Lógica de opciones preservada</li>
498
- <li>✅ CSS original preservado y mejorado</li>
499
- <li>✅ Nuevas características son opcionales</li>
500
- <li>✅ No se rompe ningún código existente</li>
501
- <li>✅ Migración automática sin cambios</li>
502
- </ul>
503
- <p style={{ marginTop: '1rem', fontSize: '0.9rem', color: '#856404' }}>
504
- <strong>Migración:</strong> Simplemente reemplaza el import y todas las
505
- mejoras se aplican automáticamente sin cambiar una línea de código existente.
506
- </p>
507
- </div>
508
- </section>
509
-
510
- {/* Casos de uso */}
511
- <section style={{ marginBottom: '2rem' }}>
512
- <h3>🎯 Casos de Uso Comunes</h3>
513
- <div style={{
514
- background: '#fff',
515
- padding: '1rem',
516
- border: '1px solid #ddd',
517
- borderRadius: '8px',
518
- display: 'grid',
519
- gridTemplateColumns: '1fr 1fr',
520
- gap: '1rem'
521
- }}>
522
- <div>
523
- <h4>👤 Perfil de Usuario</h4>
524
- <Property
525
- id="user-name"
526
- label="Full Name"
527
- value="John Doe"
528
- editable={true}
529
- onChange={() => {}}
530
- required={true}
531
- placeholder="Enter full name"
532
- helperText="First and last name"
533
- />
534
- </div>
535
- <div>
536
- <h4>⚙️ Configuración</h4>
537
- <Property
538
- id="api-key"
539
- label="API Key"
540
- value="sk-1234567890abcdef"
541
- editable={false}
542
- copyable={true}
543
- type="password"
544
- helperText="Click to copy API key"
545
- />
546
- </div>
547
- </div>
548
- </section>
549
- </div>
550
- )
551
- }
552
-
553
- export default PropertyExamples