ywana-core8 0.1.75 → 0.1.76

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 (122) hide show
  1. package/ACCORDION_EVALUATION.md +583 -0
  2. package/CHECKBOX_EVALUATION.md +273 -0
  3. package/CHIP_EVALUATION.md +542 -0
  4. package/COLOR_EVALUATION.md +524 -0
  5. package/COMPONENTS_EVALUATION.md +477 -0
  6. package/FORM_EVALUATION.md +459 -0
  7. package/HEADER_EVALUATION.md +436 -0
  8. package/ICON_EVALUATION.md +254 -0
  9. package/LIST_EVALUATION.md +574 -0
  10. package/PROGRESS_EVALUATION.md +450 -0
  11. package/RADIO_EVALUATION.md +439 -0
  12. package/RADIO_VISUAL_FIX.md +183 -0
  13. package/SECTION_IMPROVEMENTS.md +153 -0
  14. package/SWITCH_EVALUATION.md +335 -0
  15. package/SWITCH_VISUAL_FIX.md +232 -0
  16. package/TAB_EVALUATION.md +626 -0
  17. package/TEXTFIELD_EVALUATION.md +747 -0
  18. package/TOOLTIP_FIX.md +157 -0
  19. package/TREE_EVALUATION.md +708 -0
  20. package/dist/index.cjs +7900 -1615
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.css +6094 -1122
  23. package/dist/index.css.map +1 -1
  24. package/dist/index.modern.js +7929 -1645
  25. package/dist/index.modern.js.map +1 -1
  26. package/dist/index.umd.js +7900 -1615
  27. package/dist/index.umd.js.map +1 -1
  28. package/jest.config.js +24 -0
  29. package/package.json +10 -1
  30. package/src/html/accordion.css +208 -4
  31. package/src/html/accordion.example.js +390 -0
  32. package/src/html/accordion.js +284 -28
  33. package/src/html/accordion.unit.test.js +334 -0
  34. package/src/html/button.css +157 -16
  35. package/src/html/button.example.js +374 -0
  36. package/src/html/button.js +240 -60
  37. package/src/html/button.test.js +422 -0
  38. package/src/html/checkbox.css +74 -2
  39. package/src/html/checkbox.example.js +316 -0
  40. package/src/html/checkbox.js +113 -26
  41. package/src/html/checkbox.test.js +285 -0
  42. package/src/html/chip.css +230 -19
  43. package/src/html/chip.example.js +355 -0
  44. package/src/html/chip.js +321 -25
  45. package/src/html/chip.test.js +425 -0
  46. package/src/html/color.css +435 -6
  47. package/src/html/color.example.js +527 -0
  48. package/src/html/color.js +458 -9
  49. package/src/html/color.test.js +362 -4
  50. package/src/html/components.example.js +492 -0
  51. package/src/html/components_enhanced.test.js +581 -0
  52. package/src/html/form.css +70 -3
  53. package/src/html/form.example.js +385 -0
  54. package/src/html/form.js +232 -34
  55. package/src/html/form.test.js +369 -0
  56. package/src/html/header2.css +264 -0
  57. package/src/html/header2.example.js +411 -0
  58. package/src/html/header2.js +203 -0
  59. package/src/html/header2.test.js +377 -0
  60. package/src/html/icon.css +20 -2
  61. package/src/html/icon.example.js +268 -0
  62. package/src/html/icon.js +86 -16
  63. package/src/html/icon.test.js +231 -0
  64. package/src/html/index.js +1 -1
  65. package/src/html/list.css +393 -1
  66. package/src/html/list.example.js +404 -0
  67. package/src/html/list.js +583 -40
  68. package/src/html/list.test.js +383 -0
  69. package/src/html/progress.css +707 -17
  70. package/src/html/progress.example.js +424 -0
  71. package/src/html/progress.js +906 -9
  72. package/src/html/progress.test.js +313 -0
  73. package/src/html/property.css +399 -0
  74. package/src/html/property.example.js +553 -0
  75. package/src/html/property.js +393 -15
  76. package/src/html/property.test.js +351 -2
  77. package/src/html/radio-visual-test.js +289 -0
  78. package/src/html/radio.css +137 -11
  79. package/src/html/radio.example.js +389 -0
  80. package/src/html/radio.js +234 -10
  81. package/src/html/radio.test.js +318 -0
  82. package/src/html/section.example.js +99 -0
  83. package/src/html/section.js +40 -3
  84. package/src/html/section.test.js +131 -0
  85. package/src/html/selector.css +329 -3
  86. package/src/html/selector.js +369 -23
  87. package/src/html/switch-debug.js +197 -0
  88. package/src/html/switch-test-visual.js +294 -0
  89. package/src/html/switch.css +200 -0
  90. package/src/html/switch.example.js +461 -0
  91. package/src/html/switch.js +283 -23
  92. package/src/html/switch.test.js +355 -0
  93. package/src/html/tab.css +288 -0
  94. package/src/html/tab.example.js +446 -0
  95. package/src/html/tab.js +387 -22
  96. package/src/html/tab_enhanced.js +378 -0
  97. package/src/html/tab_enhanced.test.js +504 -0
  98. package/src/html/table2.css +576 -0
  99. package/src/html/table2.example.js +703 -0
  100. package/src/html/table2.js +1252 -0
  101. package/src/html/table2.migration.md +328 -0
  102. package/src/html/table2.test.js +582 -0
  103. package/src/html/text.css +375 -0
  104. package/src/html/text.js +311 -20
  105. package/src/html/textfield2.css +842 -0
  106. package/src/html/textfield2.example.js +499 -0
  107. package/src/html/textfield2.js +1130 -0
  108. package/src/html/textfield2.test.js +950 -0
  109. package/src/html/thumbnail.css +289 -2
  110. package/src/html/thumbnail.js +214 -9
  111. package/src/html/tokenfield.css +449 -1
  112. package/src/html/tokenfield.example.js +503 -0
  113. package/src/html/tokenfield.js +561 -56
  114. package/src/html/tokenfield.test.js +423 -0
  115. package/src/html/tooltip-positioning-demo.js +187 -0
  116. package/src/html/tooltip.css +25 -2
  117. package/src/html/tree.css +228 -0
  118. package/src/html/tree.example.js +475 -0
  119. package/src/html/tree.js +712 -28
  120. package/src/html/tree_enhanced.test.js +495 -0
  121. package/table2.test.js +454 -0
  122. package/src/html/button.tsx +0 -38
@@ -0,0 +1,503 @@
1
+ import React, { useState } from 'react'
2
+ import { TokenField } from './tokenfield'
3
+ import { Button } from './button'
4
+ import { Text } from './text'
5
+
6
+ /**
7
+ * Ejemplos del componente TokenField mejorado manteniendo 100% compatibilidad
8
+ */
9
+ export const TokenFieldExamples = () => {
10
+ const [basicTokens, setBasicTokens] = useState(['React', 'JavaScript'])
11
+ const [tagTokens, setTagTokens] = useState(['frontend', 'ui', 'components'])
12
+ const [emailTokens, setEmailTokens] = useState(['user@example.com'])
13
+ const [skillTokens, setSkillTokens] = useState(['JavaScript'])
14
+ const [isLoading, setIsLoading] = useState(false)
15
+ const [showAdvanced, setShowAdvanced] = useState(false)
16
+
17
+ const skillOptions = [
18
+ { label: 'JavaScript', value: 'javascript' },
19
+ { label: 'TypeScript', value: 'typescript' },
20
+ { label: 'React', value: 'react' },
21
+ { label: 'Vue.js', value: 'vue' },
22
+ { label: 'Angular', value: 'angular' },
23
+ { label: 'Node.js', value: 'nodejs' },
24
+ { label: 'Python', value: 'python' },
25
+ { label: 'Java', value: 'java' },
26
+ { label: 'C++', value: 'cpp' },
27
+ { label: 'Go', value: 'go' }
28
+ ]
29
+
30
+ const categoryOptions = [
31
+ { label: 'Frontend', value: 'frontend' },
32
+ { label: 'Backend', value: 'backend' },
33
+ { label: 'Database', value: 'database' },
34
+ { label: 'DevOps', value: 'devops' },
35
+ { label: 'Mobile', value: 'mobile' },
36
+ { label: 'Testing', value: 'testing' }
37
+ ]
38
+
39
+ const handleBasicChange = (id, tokens) => {
40
+ setBasicTokens(tokens)
41
+ console.log('Basic tokens changed:', tokens)
42
+ }
43
+
44
+ const handleTagChange = (id, tokens) => {
45
+ setTagTokens(tokens)
46
+ console.log('Tag tokens changed:', tokens)
47
+ }
48
+
49
+ const handleEmailChange = (id, tokens) => {
50
+ setEmailTokens(tokens)
51
+ console.log('Email tokens changed:', tokens)
52
+ }
53
+
54
+ const handleSkillChange = (id, tokens) => {
55
+ setSkillTokens(tokens)
56
+ console.log('Skill tokens changed:', tokens)
57
+ }
58
+
59
+ const validateEmail = (token) => {
60
+ const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/
61
+ if (!emailRegex.test(token)) {
62
+ return { isValid: false, error: 'Invalid email format' }
63
+ }
64
+ return { isValid: true }
65
+ }
66
+
67
+ const validateTag = (token) => {
68
+ if (token.length < 2) {
69
+ return { isValid: false, error: 'Tag must be at least 2 characters' }
70
+ }
71
+ if (token.includes(' ')) {
72
+ return { isValid: false, error: 'Tags cannot contain spaces' }
73
+ }
74
+ return { isValid: true }
75
+ }
76
+
77
+ const simulateLoading = () => {
78
+ setIsLoading(true)
79
+ setTimeout(() => setIsLoading(false), 2000)
80
+ }
81
+
82
+ return (
83
+ <div style={{ padding: '2rem', maxWidth: '1200px', maxHeight: '100vh', overflow: 'auto' }}>
84
+ <h1>Componente TokenField Mejorado</h1>
85
+
86
+ <div style={{
87
+ background: '#f8f9fa',
88
+ padding: '1rem',
89
+ borderRadius: '8px',
90
+ marginBottom: '2rem',
91
+ border: '1px solid #e9ecef'
92
+ }}>
93
+ <h3>✅ Mejoras Implementadas (100% Compatibilidad):</h3>
94
+ <ul>
95
+ <li>🛡️ <strong>PropTypes completos</strong> - Validación y documentación detallada</li>
96
+ <li>🔢 <strong>Límites de tokens</strong> - minTokens, maxTokens con validación</li>
97
+ <li>🚫 <strong>Control de duplicados</strong> - allowDuplicates configurable</li>
98
+ <li>✅ <strong>Validación personalizada</strong> - validateToken function</li>
99
+ <li>⌨️ <strong>Separadores múltiples</strong> - comma, semicolon, enter</li>
100
+ <li>📏 <strong>Múltiples tamaños</strong> - small, medium, large</li>
101
+ <li>🎭 <strong>Variantes visuales</strong> - default, outlined, filled</li>
102
+ <li>⚠️ <strong>Estados avanzados</strong> - disabled, error, required, loading</li>
103
+ <li>🧹 <strong>Clear functionality</strong> - Botón para limpiar todos los tokens</li>
104
+ <li>🔍 <strong>Búsqueda en opciones</strong> - Filtrado en tiempo real</li>
105
+ <li>📊 <strong>Ordenamiento</strong> - Opciones ordenadas alfabéticamente</li>
106
+ <li>♿ <strong>Accesibilidad completa</strong> - ARIA, navegación por teclado</li>
107
+ <li>📱 <strong>Responsive total</strong> - Adaptación móvil y dark mode</li>
108
+ </ul>
109
+ </div>
110
+
111
+ {/* Controles de demostración */}
112
+ <section style={{ marginBottom: '2rem' }}>
113
+ <h3>Controles de Demostración</h3>
114
+ <div style={{
115
+ background: '#fff',
116
+ padding: '1rem',
117
+ borderRadius: '8px',
118
+ border: '1px solid #ddd',
119
+ display: 'flex',
120
+ gap: '1rem',
121
+ alignItems: 'center',
122
+ flexWrap: 'wrap'
123
+ }}>
124
+ <Button
125
+ label="Simulate Loading"
126
+ icon="refresh"
127
+ action={simulateLoading}
128
+ disabled={isLoading}
129
+ />
130
+ <Button
131
+ label={showAdvanced ? "Hide Advanced" : "Show Advanced"}
132
+ icon={showAdvanced ? "visibility_off" : "visibility"}
133
+ action={() => setShowAdvanced(!showAdvanced)}
134
+ />
135
+ <span style={{ marginLeft: 'auto', color: '#666' }}>
136
+ Total tokens: {basicTokens.length + tagTokens.length + emailTokens.length + skillTokens.length}
137
+ </span>
138
+ </div>
139
+ </section>
140
+
141
+ {/* TokenField básico (Compatible) */}
142
+ <section style={{ marginBottom: '2rem' }}>
143
+ <h3>🏷️ TokenField Básico (100% Compatible)</h3>
144
+ <div style={{
145
+ background: '#fff',
146
+ padding: '1rem',
147
+ border: '1px solid #ddd',
148
+ borderRadius: '8px'
149
+ }}>
150
+ <TokenField
151
+ id="basic"
152
+ label="Basic Tokens"
153
+ tokens={basicTokens}
154
+ onChange={handleBasicChange}
155
+ />
156
+ <Text size="sm" color="muted" style={{ marginTop: '0.5rem' }}>
157
+ Funcionalidad original: agregar tokens con Enter, eliminar con click
158
+ </Text>
159
+ </div>
160
+ </section>
161
+
162
+ {/* TokenField con opciones */}
163
+ <section style={{ marginBottom: '2rem' }}>
164
+ <h3>🎯 TokenField con Opciones (Compatible)</h3>
165
+ <div style={{
166
+ background: '#fff',
167
+ padding: '1rem',
168
+ border: '1px solid #ddd',
169
+ borderRadius: '8px'
170
+ }}>
171
+ <TokenField
172
+ id="skills"
173
+ label="Skills"
174
+ tokens={skillTokens}
175
+ options={skillOptions}
176
+ predictive={true}
177
+ onChange={handleSkillChange}
178
+ />
179
+ <Text size="sm" color="muted" style={{ marginTop: '0.5rem' }}>
180
+ Dropdown con opciones predefinidas y búsqueda predictiva
181
+ </Text>
182
+ </div>
183
+ </section>
184
+
185
+ {/* TokenField mejorado */}
186
+ <section style={{ marginBottom: '2rem' }}>
187
+ <h3>🚀 TokenField Mejorado con Nuevas Características</h3>
188
+ <div style={{
189
+ background: '#fff',
190
+ padding: '1rem',
191
+ border: '1px solid #ddd',
192
+ borderRadius: '8px',
193
+ display: 'grid',
194
+ gridTemplateColumns: '1fr 1fr',
195
+ gap: '1rem'
196
+ }}>
197
+ <TokenField
198
+ id="tags"
199
+ label="Tags"
200
+ tokens={tagTokens}
201
+ onChange={handleTagChange}
202
+ placeholder="Add tag..."
203
+ maxTokens={5}
204
+ minTokens={1}
205
+ allowDuplicates={false}
206
+ validateToken={validateTag}
207
+ tokenSeparators={[',', ';', ' ']}
208
+ size="medium"
209
+ variant="outlined"
210
+ clearable={true}
211
+ helperText="Max 5 tags, no duplicates, no spaces"
212
+ onTokenAdd={(token) => console.log('Tag added:', token)}
213
+ onTokenRemove={(token) => console.log('Tag removed:', token)}
214
+ onValidationError={(error, token) => console.log('Validation error:', error, token)}
215
+ />
216
+ <TokenField
217
+ id="emails"
218
+ label="Email Addresses"
219
+ tokens={emailTokens}
220
+ onChange={handleEmailChange}
221
+ placeholder="Add email..."
222
+ validateToken={validateEmail}
223
+ size="large"
224
+ variant="filled"
225
+ required={true}
226
+ helperText="Enter valid email addresses"
227
+ disabled={isLoading}
228
+ />
229
+ </div>
230
+ </section>
231
+
232
+ {/* Tamaños y variantes */}
233
+ <section style={{ marginBottom: '2rem' }}>
234
+ <h3>📏 Tamaños y Variantes</h3>
235
+ <div style={{
236
+ background: '#fff',
237
+ padding: '1rem',
238
+ border: '1px solid #ddd',
239
+ borderRadius: '8px',
240
+ display: 'grid',
241
+ gridTemplateColumns: '1fr 1fr 1fr',
242
+ gap: '1rem'
243
+ }}>
244
+ <TokenField
245
+ id="small"
246
+ label="Small Size"
247
+ tokens={['small', 'tokens']}
248
+ onChange={() => {}}
249
+ size="small"
250
+ variant="default"
251
+ placeholder="Small..."
252
+ />
253
+ <TokenField
254
+ id="medium"
255
+ label="Medium Size"
256
+ tokens={['medium', 'tokens']}
257
+ onChange={() => {}}
258
+ size="medium"
259
+ variant="outlined"
260
+ placeholder="Medium..."
261
+ />
262
+ <TokenField
263
+ id="large"
264
+ label="Large Size"
265
+ tokens={['large', 'tokens']}
266
+ onChange={() => {}}
267
+ size="large"
268
+ variant="filled"
269
+ placeholder="Large..."
270
+ />
271
+ </div>
272
+ </section>
273
+
274
+ {/* Estados especiales */}
275
+ <section style={{ marginBottom: '2rem' }}>
276
+ <h3>⚠️ Estados Especiales</h3>
277
+ <div style={{
278
+ background: '#fff',
279
+ padding: '1rem',
280
+ border: '1px solid #ddd',
281
+ borderRadius: '8px',
282
+ display: 'grid',
283
+ gridTemplateColumns: '1fr 1fr',
284
+ gap: '1rem'
285
+ }}>
286
+ <TokenField
287
+ id="required"
288
+ label="Required Field"
289
+ tokens={['required']}
290
+ onChange={() => {}}
291
+ required={true}
292
+ minTokens={1}
293
+ helperText="This field is required"
294
+ />
295
+ <TokenField
296
+ id="error"
297
+ label="Field with Error"
298
+ tokens={['invalid-token']}
299
+ onChange={() => {}}
300
+ error="Invalid token detected"
301
+ />
302
+ <TokenField
303
+ id="disabled"
304
+ label="Disabled Field"
305
+ tokens={['disabled', 'tokens']}
306
+ onChange={() => {}}
307
+ disabled={isLoading}
308
+ helperText="Field is disabled"
309
+ />
310
+ <TokenField
311
+ id="readonly"
312
+ label="Read-only Field"
313
+ tokens={['readonly', 'tokens']}
314
+ onChange={() => {}}
315
+ readOnly={true}
316
+ helperText="Field is read-only"
317
+ />
318
+ </div>
319
+ </section>
320
+
321
+ {/* Características avanzadas */}
322
+ {showAdvanced && (
323
+ <section style={{ marginBottom: '2rem' }}>
324
+ <h3>🔬 Características Avanzadas</h3>
325
+ <div style={{
326
+ background: '#fff',
327
+ padding: '1rem',
328
+ border: '1px solid #ddd',
329
+ borderRadius: '8px',
330
+ display: 'grid',
331
+ gridTemplateColumns: '1fr 1fr',
332
+ gap: '1rem'
333
+ }}>
334
+ <TokenField
335
+ id="searchable"
336
+ label="Searchable Options"
337
+ tokens={[]}
338
+ options={categoryOptions}
339
+ onChange={() => {}}
340
+ searchable={true}
341
+ sortable={true}
342
+ placeholder="Search categories..."
343
+ helperText="Type to search and filter options"
344
+ />
345
+ <TokenField
346
+ id="limits"
347
+ label="With Limits"
348
+ tokens={['token1', 'token2']}
349
+ onChange={() => {}}
350
+ maxTokens={3}
351
+ minTokens={2}
352
+ allowDuplicates={false}
353
+ clearable={false}
354
+ helperText="2-3 tokens, no duplicates"
355
+ />
356
+ </div>
357
+ </section>
358
+ )}
359
+
360
+ {/* Separadores y validación */}
361
+ {showAdvanced && (
362
+ <section style={{ marginBottom: '2rem' }}>
363
+ <h3>⌨️ Separadores y Validación</h3>
364
+ <div style={{
365
+ background: '#fff',
366
+ padding: '1rem',
367
+ border: '1px solid #ddd',
368
+ borderRadius: '8px'
369
+ }}>
370
+ <TokenField
371
+ id="separators"
372
+ label="Multiple Separators"
373
+ tokens={[]}
374
+ onChange={() => {}}
375
+ tokenSeparators={[',', ';', '|', '\n']}
376
+ placeholder="Use comma, semicolon, pipe, or enter..."
377
+ helperText="Try typing: token1,token2;token3|token4 and press enter"
378
+ />
379
+ <div style={{ marginTop: '1rem' }}>
380
+ <Text size="sm" color="muted">
381
+ <strong>Separadores soportados:</strong> Comma (,), Semicolon (;), Pipe (|), Enter
382
+ </Text>
383
+ </div>
384
+ </div>
385
+ </section>
386
+ )}
387
+
388
+ {/* Comparación antes/después */}
389
+ <section style={{ marginBottom: '2rem' }}>
390
+ <h3>Comparación: TokenField Original vs Mejorado</h3>
391
+ <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '1rem' }}>
392
+ <div style={{
393
+ background: '#ffebee',
394
+ padding: '1rem',
395
+ borderRadius: '4px',
396
+ border: '1px solid #ffcdd2'
397
+ }}>
398
+ <h4>❌ TokenField Original</h4>
399
+ <ul>
400
+ <li>Funcionalidad básica de tokens</li>
401
+ <li>Soporte para opciones dropdown</li>
402
+ <li>Búsqueda predictiva</li>
403
+ <li>Sin PropTypes ni validación</li>
404
+ <li>Sin límites de tokens</li>
405
+ <li>Sin validación personalizada</li>
406
+ <li>Sin estados avanzados</li>
407
+ <li>Sin accesibilidad</li>
408
+ <li>CSS básico sin responsive</li>
409
+ </ul>
410
+ </div>
411
+ <div style={{
412
+ background: '#e8f5e8',
413
+ padding: '1rem',
414
+ borderRadius: '4px',
415
+ border: '1px solid #c8e6c9'
416
+ }}>
417
+ <h4>✅ TokenField Mejorado</h4>
418
+ <ul>
419
+ <li>Mantiene funcionalidad original</li>
420
+ <li>PropTypes completos y validación</li>
421
+ <li>Límites min/max con advertencias</li>
422
+ <li>Validación personalizada de tokens</li>
423
+ <li>Múltiples separadores configurables</li>
424
+ <li>Estados disabled, error, required</li>
425
+ <li>Accesibilidad total (WCAG 2.1 AA)</li>
426
+ <li>Búsqueda y ordenamiento en opciones</li>
427
+ <li>CSS responsive con dark mode</li>
428
+ </ul>
429
+ </div>
430
+ </div>
431
+ </section>
432
+
433
+ {/* Garantía de compatibilidad */}
434
+ <section style={{ marginBottom: '2rem' }}>
435
+ <h3>🔒 Garantía de Compatibilidad</h3>
436
+ <div style={{
437
+ background: '#fff3cd',
438
+ padding: '1rem',
439
+ borderRadius: '4px',
440
+ border: '1px solid #ffeaa7'
441
+ }}>
442
+ <p><strong>100% Compatible con Código Existente:</strong></p>
443
+ <ul>
444
+ <li>✅ Props originales (id, label, tokens, readOnly, options, predictive, onChange) funcionan idéntico</li>
445
+ <li>✅ Comportamiento de onChange sin cambios</li>
446
+ <li>✅ Estructura de tokens y opciones preservada</li>
447
+ <li>✅ CSS original preservado y mejorado</li>
448
+ <li>✅ Nuevas características son opcionales</li>
449
+ <li>✅ No se rompe ningún código existente</li>
450
+ <li>✅ Migración automática sin cambios</li>
451
+ </ul>
452
+ <p style={{ marginTop: '1rem', fontSize: '0.9rem', color: '#856404' }}>
453
+ <strong>Migración:</strong> Simplemente reemplaza el import y todas las
454
+ mejoras se aplican automáticamente sin cambiar una línea de código existente.
455
+ </p>
456
+ </div>
457
+ </section>
458
+
459
+ {/* Casos de uso */}
460
+ <section style={{ marginBottom: '2rem' }}>
461
+ <h3>🎯 Casos de Uso Comunes</h3>
462
+ <div style={{
463
+ background: '#fff',
464
+ padding: '1rem',
465
+ border: '1px solid #ddd',
466
+ borderRadius: '8px',
467
+ display: 'grid',
468
+ gridTemplateColumns: '1fr 1fr',
469
+ gap: '1rem'
470
+ }}>
471
+ <div>
472
+ <h4>🏷️ Sistema de Tags</h4>
473
+ <TokenField
474
+ id="blog-tags"
475
+ label="Blog Tags"
476
+ tokens={['react', 'javascript']}
477
+ onChange={() => {}}
478
+ maxTokens={10}
479
+ allowDuplicates={false}
480
+ validateToken={(token) => token.length >= 2 ? { isValid: true } : { isValid: false, error: 'Too short' }}
481
+ placeholder="Add tags..."
482
+ helperText="Tags for blog post categorization"
483
+ />
484
+ </div>
485
+ <div>
486
+ <h4>👥 Gestión de Usuarios</h4>
487
+ <TokenField
488
+ id="user-emails"
489
+ label="Invite Users"
490
+ tokens={[]}
491
+ onChange={() => {}}
492
+ validateToken={validateEmail}
493
+ placeholder="Enter email addresses..."
494
+ helperText="Add users to invite to the project"
495
+ />
496
+ </div>
497
+ </div>
498
+ </section>
499
+ </div>
500
+ )
501
+ }
502
+
503
+ export default TokenFieldExamples