@widergy/energy-ui 3.171.1 → 3.171.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 (54) hide show
  1. package/CHANGELOG.md +12 -2
  2. package/dist/components/UTBanner/stories/UTBanner.stories.js +16 -1
  3. package/dist/components/UTBaseInputField/theme.js +6 -5
  4. package/dist/components/UTButton/styles.module.scss +11 -11
  5. package/dist/components/UTButton/theme.js +1 -1
  6. package/dist/components/UTButtonGroup/styles.module.scss +1 -1
  7. package/dist/components/UTCheckbox/versions/V1/theme.js +4 -1
  8. package/dist/components/UTDataCategory/styles.module.scss +1 -1
  9. package/dist/components/UTDataCategory/theme.js +1 -1
  10. package/dist/components/UTDataElement/index.js +1 -1
  11. package/dist/components/UTDataElement/styles.module.scss +9 -9
  12. package/dist/components/UTDatePicker/versions/V1/stories/UTDatePickerV1.stories.js +59 -1
  13. package/dist/components/UTLabel/UTLabel.stories.js +81 -1
  14. package/dist/components/UTLabel/constants.js +10 -10
  15. package/dist/components/UTLabel/theme.js +4 -4
  16. package/dist/components/UTSelect/UTSelect.stories.js +897 -0
  17. package/dist/components/UTSelect/versions/V1/components/InputComponent/index.js +13 -3
  18. package/dist/components/UTSelect/versions/V1/components/ListboxComponent/index.js +7 -6
  19. package/dist/components/UTSelect/versions/V1/constants.js +10 -0
  20. package/dist/components/UTSelect/versions/V1/index.js +41 -68
  21. package/dist/components/UTSelect/versions/V1/types.js +54 -0
  22. package/dist/components/UTSelect/versions/V1/utils.js +10 -9
  23. package/dist/components/UTShortcutPanel/styles.module.scss +10 -10
  24. package/dist/components/UTStatus/theme.js +26 -26
  25. package/dist/esm/components/UTBanner/stories/UTBanner.stories.js +16 -1
  26. package/dist/esm/components/UTBaseInputField/theme.js +6 -5
  27. package/dist/esm/components/UTButton/styles.module.scss +11 -11
  28. package/dist/esm/components/UTButton/theme.js +1 -1
  29. package/dist/esm/components/UTButtonGroup/styles.module.scss +1 -1
  30. package/dist/esm/components/UTCheckbox/versions/V1/theme.js +4 -1
  31. package/dist/esm/components/UTDataCategory/styles.module.scss +1 -1
  32. package/dist/esm/components/UTDataCategory/theme.js +1 -1
  33. package/dist/esm/components/UTDataElement/index.js +1 -1
  34. package/dist/esm/components/UTDataElement/styles.module.scss +9 -9
  35. package/dist/esm/components/UTDatePicker/versions/V1/stories/UTDatePickerV1.stories.js +58 -0
  36. package/dist/esm/components/UTLabel/UTLabel.stories.js +80 -0
  37. package/dist/esm/components/UTLabel/constants.js +10 -10
  38. package/dist/esm/components/UTLabel/theme.js +4 -4
  39. package/dist/esm/components/UTSelect/UTSelect.stories.js +889 -0
  40. package/dist/esm/components/UTSelect/versions/V1/components/InputComponent/index.js +14 -4
  41. package/dist/esm/components/UTSelect/versions/V1/components/ListboxComponent/index.js +4 -3
  42. package/dist/esm/components/UTSelect/versions/V1/constants.js +4 -0
  43. package/dist/esm/components/UTSelect/versions/V1/index.js +41 -68
  44. package/dist/esm/components/UTSelect/versions/V1/types.js +48 -0
  45. package/dist/esm/components/UTSelect/versions/V1/utils.js +7 -6
  46. package/dist/esm/components/UTShortcutPanel/styles.module.scss +10 -10
  47. package/dist/esm/components/UTStatus/theme.js +26 -26
  48. package/dist/esm/utils/hooks/useCSSVariables/constants.js +11 -9
  49. package/dist/utils/hooks/useCSSVariables/constants.js +11 -9
  50. package/package.json +10 -9
  51. package/dist/components/UTSelect/versions/V1/UTSelectV1.mdx +0 -13
  52. package/dist/components/UTSelect/versions/V1/UTSelectV1.stories.js +0 -741
  53. package/dist/esm/components/UTSelect/versions/V1/UTSelectV1.mdx +0 -13
  54. package/dist/esm/components/UTSelect/versions/V1/UTSelectV1.stories.js +0 -733
@@ -0,0 +1,889 @@
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
+ import React, { useState } from 'react';
3
+ import { bool, shape, string } from 'prop-types';
4
+ import { TITLE_VARIANTS } from '../../constants/inputs';
5
+ import UTSelect from '.';
6
+ const OPTIONS = [{
7
+ name: 'Electricidad',
8
+ value: 'electricity'
9
+ }, {
10
+ name: 'Gas natural',
11
+ value: 'gas'
12
+ }, {
13
+ name: 'Agua potable',
14
+ value: 'water'
15
+ }, {
16
+ name: 'Energía solar',
17
+ value: 'solar'
18
+ }, {
19
+ name: 'Biomasa',
20
+ value: 'biomass'
21
+ }];
22
+ const OPTIONS_WITH_CATEGORIES = [{
23
+ name: 'Residencial bajo',
24
+ value: 'res-low',
25
+ category: 'Residencial'
26
+ }, {
27
+ name: 'Residencial medio',
28
+ value: 'res-mid',
29
+ category: 'Residencial'
30
+ }, {
31
+ name: 'Residencial alto',
32
+ value: 'res-high',
33
+ category: 'Residencial'
34
+ }, {
35
+ name: 'Comercial pequeño',
36
+ value: 'com-sm',
37
+ category: 'Comercial'
38
+ }, {
39
+ name: 'Comercial grande',
40
+ value: 'com-lg',
41
+ category: 'Comercial'
42
+ }, {
43
+ name: 'Industrial',
44
+ value: 'industrial',
45
+ category: 'Industrial'
46
+ }];
47
+ const PERSON_OPTIONS = [{
48
+ name: 'Alice García',
49
+ value: '1'
50
+ }, {
51
+ name: 'Bob Martínez',
52
+ value: '2'
53
+ }, {
54
+ name: 'Carol Rodríguez',
55
+ value: '3'
56
+ }, {
57
+ name: 'David López',
58
+ value: '4'
59
+ }, {
60
+ name: 'Elena Sánchez',
61
+ value: '5'
62
+ }];
63
+ const AvatarCustomRow = _ref => {
64
+ let {
65
+ isChecked,
66
+ item
67
+ } = _ref;
68
+ return /*#__PURE__*/React.createElement("div", {
69
+ style: {
70
+ alignItems: 'center',
71
+ display: 'flex',
72
+ gap: 8
73
+ }
74
+ }, /*#__PURE__*/React.createElement("div", {
75
+ style: {
76
+ alignItems: 'center',
77
+ background: isChecked ? '#285AFF' : '#E4E6EA',
78
+ borderRadius: '50%',
79
+ color: isChecked ? '#FFFFFF' : '#091E42',
80
+ display: 'flex',
81
+ fontSize: 12,
82
+ fontWeight: 700,
83
+ height: 28,
84
+ justifyContent: 'center',
85
+ width: 28
86
+ }
87
+ }, item.name[0]), /*#__PURE__*/React.createElement("span", {
88
+ style: {
89
+ fontWeight: isChecked ? 700 : 400
90
+ }
91
+ }, item.name));
92
+ };
93
+ AvatarCustomRow.propTypes = {
94
+ isChecked: bool,
95
+ item: shape({
96
+ name: string,
97
+ value: string
98
+ })
99
+ };
100
+ const wrapperStyle = {
101
+ maxWidth: '360px',
102
+ padding: '1rem'
103
+ };
104
+ export default {
105
+ args: {
106
+ variant: 'select',
107
+ placeholder: 'Seleccioná una opción',
108
+ options: OPTIONS,
109
+ clearable: true,
110
+ disabled: false,
111
+ readOnly: false,
112
+ multiple: false,
113
+ required: false,
114
+ withAutoReset: true,
115
+ disableFilterOptions: false,
116
+ freeWidth: false,
117
+ menuWidth: ''
118
+ },
119
+ argTypes: {
120
+ options: {
121
+ control: false,
122
+ description: 'Array de opciones. Cada opción debe tener `name` y `value`.',
123
+ table: {
124
+ defaultValue: {
125
+ summary: '[]'
126
+ },
127
+ type: {
128
+ summary: 'Array<{ name: string, value: string | number }>'
129
+ }
130
+ }
131
+ },
132
+ value: {
133
+ control: false,
134
+ description: 'Valor seleccionado actualmente.',
135
+ table: {
136
+ defaultValue: {
137
+ summary: 'null'
138
+ },
139
+ type: {
140
+ summary: 'string | Array<string | number>'
141
+ }
142
+ }
143
+ },
144
+ onChange: {
145
+ control: false,
146
+ description: 'Callback ejecutado al cambiar la selección.',
147
+ table: {
148
+ defaultValue: {
149
+ summary: 'undefined'
150
+ },
151
+ type: {
152
+ summary: 'function'
153
+ }
154
+ }
155
+ },
156
+ placeholder: {
157
+ control: 'text',
158
+ description: 'Texto de placeholder del input.',
159
+ table: {
160
+ defaultValue: {
161
+ summary: 'undefined'
162
+ },
163
+ type: {
164
+ summary: 'string'
165
+ }
166
+ }
167
+ },
168
+ title: {
169
+ control: 'text',
170
+ description: 'Etiqueta superior del campo.',
171
+ table: {
172
+ defaultValue: {
173
+ summary: 'undefined'
174
+ },
175
+ type: {
176
+ summary: 'string'
177
+ }
178
+ }
179
+ },
180
+ titleVariant: {
181
+ control: 'inline-radio',
182
+ description: 'Variante tipográfica del título.',
183
+ options: Object.values(TITLE_VARIANTS),
184
+ table: {
185
+ defaultValue: {
186
+ summary: TITLE_VARIANTS.large
187
+ },
188
+ type: {
189
+ summary: "'body' | 'small'"
190
+ }
191
+ }
192
+ },
193
+ helpText: {
194
+ control: 'text',
195
+ description: 'Texto de ayuda que se muestra debajo del input.',
196
+ table: {
197
+ defaultValue: {
198
+ summary: 'undefined'
199
+ },
200
+ type: {
201
+ summary: 'string'
202
+ }
203
+ }
204
+ },
205
+ error: {
206
+ control: 'text',
207
+ description: 'Mensaje de error a mostrar debajo del input.',
208
+ table: {
209
+ defaultValue: {
210
+ summary: 'undefined'
211
+ },
212
+ type: {
213
+ summary: 'string'
214
+ }
215
+ }
216
+ },
217
+ disabled: {
218
+ control: 'boolean',
219
+ description: 'Deshabilita el input.',
220
+ table: {
221
+ defaultValue: {
222
+ summary: false
223
+ },
224
+ type: {
225
+ summary: 'boolean'
226
+ }
227
+ }
228
+ },
229
+ readOnly: {
230
+ control: 'boolean',
231
+ description: 'Pone el input en modo solo lectura.',
232
+ table: {
233
+ defaultValue: {
234
+ summary: false
235
+ },
236
+ type: {
237
+ summary: 'boolean'
238
+ }
239
+ }
240
+ },
241
+ clearable: {
242
+ control: 'boolean',
243
+ description: 'Muestra el botón para limpiar la selección.',
244
+ table: {
245
+ defaultValue: {
246
+ summary: true
247
+ },
248
+ type: {
249
+ summary: 'boolean'
250
+ }
251
+ }
252
+ },
253
+ multiple: {
254
+ control: 'boolean',
255
+ description: 'Permite seleccionar múltiples opciones.',
256
+ table: {
257
+ defaultValue: {
258
+ summary: false
259
+ },
260
+ type: {
261
+ summary: 'boolean'
262
+ }
263
+ }
264
+ },
265
+ required: {
266
+ control: 'boolean',
267
+ description: 'Marca el campo como requerido en el título.',
268
+ table: {
269
+ defaultValue: {
270
+ summary: false
271
+ },
272
+ type: {
273
+ summary: 'boolean'
274
+ }
275
+ }
276
+ },
277
+ icon: {
278
+ control: 'text',
279
+ description: 'Nombre de icono Tabler a mostrar a la izquierda del input.',
280
+ table: {
281
+ defaultValue: {
282
+ summary: 'undefined'
283
+ },
284
+ type: {
285
+ summary: 'string'
286
+ }
287
+ }
288
+ },
289
+ prefix: {
290
+ control: 'text',
291
+ description: 'Texto prefijo a mostrar dentro del input.',
292
+ table: {
293
+ defaultValue: {
294
+ summary: 'undefined'
295
+ },
296
+ type: {
297
+ summary: 'string'
298
+ }
299
+ }
300
+ },
301
+ suffix: {
302
+ control: 'text',
303
+ description: 'Texto sufijo a mostrar dentro del input.',
304
+ table: {
305
+ defaultValue: {
306
+ summary: 'undefined'
307
+ },
308
+ type: {
309
+ summary: 'string'
310
+ }
311
+ }
312
+ },
313
+ variant: {
314
+ control: 'inline-radio',
315
+ description: 'Variante visual del input. `select` usa fondo blanco, `picker` usa fondo transparente (para usar sobre otros fondos).',
316
+ options: ['select', 'picker'],
317
+ table: {
318
+ defaultValue: {
319
+ summary: 'select'
320
+ },
321
+ type: {
322
+ summary: "'select' | 'picker'"
323
+ }
324
+ }
325
+ },
326
+ noOptionsText: {
327
+ control: 'text',
328
+ description: 'Texto cuando no hay opciones disponibles.',
329
+ table: {
330
+ defaultValue: {
331
+ summary: 'No hay opciones disponibles'
332
+ },
333
+ type: {
334
+ summary: 'string'
335
+ }
336
+ }
337
+ },
338
+ noMatchesText: {
339
+ control: 'text',
340
+ description: 'Texto cuando la búsqueda no encuentra resultados.',
341
+ table: {
342
+ defaultValue: {
343
+ summary: 'No hay coincidencias con tu búsqueda'
344
+ },
345
+ type: {
346
+ summary: 'string'
347
+ }
348
+ }
349
+ },
350
+ disableFilterOptions: {
351
+ control: 'boolean',
352
+ description: 'Deshabilita el filtrado interno de opciones por búsqueda.',
353
+ table: {
354
+ defaultValue: {
355
+ summary: false
356
+ },
357
+ type: {
358
+ summary: 'boolean'
359
+ }
360
+ }
361
+ },
362
+ withAutoReset: {
363
+ control: 'boolean',
364
+ description: 'Resetea el valor si la opción seleccionada deja de existir en `options`.',
365
+ table: {
366
+ defaultValue: {
367
+ summary: true
368
+ },
369
+ type: {
370
+ summary: 'boolean'
371
+ }
372
+ }
373
+ },
374
+ freeWidth: {
375
+ control: 'boolean',
376
+ description: 'Permite que el dropdown supere el ancho del input.',
377
+ table: {
378
+ defaultValue: {
379
+ summary: false
380
+ },
381
+ type: {
382
+ summary: 'boolean'
383
+ }
384
+ }
385
+ },
386
+ menuWidth: {
387
+ control: 'text',
388
+ description: 'Ancho fijo del dropdown. Acepta cualquier valor CSS válido (`"300px"`, `"20rem"`, `"50vw"`). Si no se pasa, el menú hereda el ancho del input.',
389
+ table: {
390
+ defaultValue: {
391
+ summary: 'undefined'
392
+ },
393
+ type: {
394
+ summary: 'string'
395
+ }
396
+ }
397
+ },
398
+ className: {
399
+ control: false,
400
+ description: 'Clase CSS adicional para el contenedor.',
401
+ table: {
402
+ defaultValue: {
403
+ summary: 'undefined'
404
+ },
405
+ type: {
406
+ summary: 'string'
407
+ }
408
+ }
409
+ },
410
+ CustomRow: {
411
+ control: false,
412
+ description: 'Componente React personalizado para renderizar cada opción del dropdown. Recibe `{ item, isChecked }` donde `item` es el objeto de la opción e `isChecked` indica si está seleccionada.',
413
+ table: {
414
+ defaultValue: {
415
+ summary: 'undefined'
416
+ },
417
+ type: {
418
+ summary: 'elementType'
419
+ }
420
+ }
421
+ },
422
+ dataTestId: {
423
+ control: 'text',
424
+ description: 'Test ID para el input.',
425
+ table: {
426
+ defaultValue: {
427
+ summary: 'undefined'
428
+ },
429
+ type: {
430
+ summary: 'string'
431
+ }
432
+ }
433
+ },
434
+ errorDataTestId: {
435
+ control: false,
436
+ description: 'Test ID para el componente de validación de error.',
437
+ table: {
438
+ defaultValue: {
439
+ summary: 'undefined'
440
+ },
441
+ type: {
442
+ summary: 'string'
443
+ }
444
+ }
445
+ },
446
+ inputSize: {
447
+ control: {
448
+ type: 'select'
449
+ },
450
+ description: 'Tamaño del input.',
451
+ options: ['small', 'large'],
452
+ table: {
453
+ defaultValue: {
454
+ summary: 'undefined'
455
+ },
456
+ type: {
457
+ summary: "'small' | 'large'"
458
+ }
459
+ }
460
+ },
461
+ itemDataTestId: {
462
+ control: false,
463
+ description: 'Test ID para cada ítem del dropdown.',
464
+ table: {
465
+ defaultValue: {
466
+ summary: 'undefined'
467
+ },
468
+ type: {
469
+ summary: 'string'
470
+ }
471
+ }
472
+ },
473
+ listDataTestId: {
474
+ control: false,
475
+ description: 'Test ID para el contenedor de la lista.',
476
+ table: {
477
+ defaultValue: {
478
+ summary: 'undefined'
479
+ },
480
+ type: {
481
+ summary: 'string'
482
+ }
483
+ }
484
+ },
485
+ action: {
486
+ control: 'object',
487
+ description: 'Botón de acción en el adornment derecho. Recibe `{ Icon, onClick, size }`.',
488
+ table: {
489
+ defaultValue: {
490
+ summary: 'undefined'
491
+ },
492
+ type: {
493
+ summary: 'object'
494
+ }
495
+ }
496
+ },
497
+ alwaysShowPlaceholder: {
498
+ control: 'boolean',
499
+ description: 'Muestra el placeholder incluso cuando hay un valor seleccionado.',
500
+ table: {
501
+ defaultValue: {
502
+ summary: true
503
+ },
504
+ type: {
505
+ summary: 'boolean'
506
+ }
507
+ }
508
+ },
509
+ actions: {
510
+ control: false,
511
+ description: 'Acciones adicionales que se muestran junto al título.',
512
+ table: {
513
+ defaultValue: {
514
+ summary: 'undefined'
515
+ },
516
+ type: {
517
+ summary: 'Array<buttonTypes>'
518
+ }
519
+ }
520
+ },
521
+ autocompleteProps: {
522
+ control: false,
523
+ description: 'Props adicionales pasadas directamente al componente Autocomplete de MUI.',
524
+ table: {
525
+ defaultValue: {
526
+ summary: '{}'
527
+ },
528
+ type: {
529
+ summary: 'object'
530
+ }
531
+ }
532
+ },
533
+ listProps: {
534
+ control: false,
535
+ description: 'Props adicionales para el componente ListboxComponent.',
536
+ table: {
537
+ defaultValue: {
538
+ summary: '{}'
539
+ },
540
+ type: {
541
+ summary: 'object'
542
+ }
543
+ }
544
+ },
545
+ onChangeSearchTerm: {
546
+ control: false,
547
+ description: 'Callback ejecutado al cambiar el texto de búsqueda.',
548
+ table: {
549
+ defaultValue: {
550
+ summary: 'undefined'
551
+ },
552
+ type: {
553
+ summary: 'function'
554
+ }
555
+ }
556
+ }
557
+ },
558
+ component: UTSelect,
559
+ parameters: {
560
+ controls: {
561
+ exclude: ['onChange', 'onChangeSearchTerm', 'actions', 'autocompleteProps', 'listProps', 'className', 'CustomRow', 'dataTestId', 'errorDataTestId', 'itemDataTestId', 'listDataTestId', 'version']
562
+ },
563
+ docs: {
564
+ description: {
565
+ component: 'Componente de selección con búsqueda integrada (V1) y versión legacy compatible con Redux Form (V0). V1 soporta selección simple y múltiple, categorías, adornments y búsqueda filtrada.'
566
+ }
567
+ }
568
+ },
569
+ title: 'Energy-UI/UTSelect'
570
+ };
571
+ const SelectWrapper = _ref2 => {
572
+ let {
573
+ menuWidth,
574
+ multiple,
575
+ ...props
576
+ } = _ref2;
577
+ const [value, setValue] = useState(multiple ? [] : null);
578
+ return /*#__PURE__*/React.createElement("div", {
579
+ style: wrapperStyle
580
+ }, /*#__PURE__*/React.createElement(UTSelect, _extends({}, props, {
581
+ menuWidth: menuWidth || undefined,
582
+ multiple: multiple,
583
+ onChange: setValue,
584
+ value: value,
585
+ version: "V1"
586
+ })));
587
+ };
588
+ SelectWrapper.propTypes = {
589
+ menuWidth: string,
590
+ multiple: bool
591
+ };
592
+ const PreselectedWrapper = _ref3 => {
593
+ let {
594
+ initialValue = 'gas',
595
+ ...props
596
+ } = _ref3;
597
+ const [value, setValue] = useState(initialValue);
598
+ return /*#__PURE__*/React.createElement(UTSelect, _extends({}, props, {
599
+ onChange: setValue,
600
+ value: value,
601
+ version: "V1"
602
+ }));
603
+ };
604
+ PreselectedWrapper.propTypes = {
605
+ initialValue: string
606
+ };
607
+ const rowStyle = {
608
+ display: 'flex',
609
+ flexDirection: 'column',
610
+ gap: '1.5rem',
611
+ maxWidth: '360px',
612
+ padding: '1rem'
613
+ };
614
+ const labelStyle = {
615
+ fontSize: '0.7rem',
616
+ color: '#94a3b8',
617
+ fontFamily: 'monospace'
618
+ };
619
+ export const Playground = {
620
+ name: 'Playground',
621
+ render: args => /*#__PURE__*/React.createElement(SelectWrapper, args)
622
+ };
623
+ export const Simple = {
624
+ name: 'Simple',
625
+ args: {
626
+ placeholder: 'Seleccioná un servicio'
627
+ },
628
+ render: args => /*#__PURE__*/React.createElement(SelectWrapper, args)
629
+ };
630
+ export const ConTitulo = {
631
+ name: 'Con título',
632
+ args: {
633
+ helpText: 'El tipo de servicio determina el método de facturación.',
634
+ placeholder: 'Seleccioná un servicio',
635
+ required: true,
636
+ title: 'Tipo de servicio'
637
+ },
638
+ render: args => /*#__PURE__*/React.createElement(SelectWrapper, args)
639
+ };
640
+ export const Multiple = {
641
+ name: 'Múltiple',
642
+ args: {
643
+ clearable: false,
644
+ multiple: true,
645
+ placeholder: 'Seleccioná uno o más servicios',
646
+ title: 'Servicios activos'
647
+ },
648
+ render: args => /*#__PURE__*/React.createElement(SelectWrapper, args)
649
+ };
650
+ export const ConCategorias = {
651
+ name: 'Con categorías',
652
+ args: {
653
+ options: OPTIONS_WITH_CATEGORIES,
654
+ placeholder: 'Seleccioná una tarifa',
655
+ title: 'Categoría tarifaria'
656
+ },
657
+ parameters: {
658
+ docs: {
659
+ description: {
660
+ story: 'Las opciones se agrupan automáticamente por la propiedad `category`. Las opciones seleccionadas se mueven al tope de su categoría al abrir el dropdown.'
661
+ }
662
+ }
663
+ },
664
+ render: args => /*#__PURE__*/React.createElement(SelectWrapper, args)
665
+ };
666
+ export const Disabled = {
667
+ name: 'Deshabilitado',
668
+ args: {
669
+ disabled: true,
670
+ placeholder: 'Seleccioná un servicio',
671
+ title: 'Tipo de servicio'
672
+ },
673
+ render: args => /*#__PURE__*/React.createElement(SelectWrapper, args)
674
+ };
675
+ export const SoloLectura = {
676
+ name: 'Solo lectura',
677
+ args: {
678
+ placeholder: 'Seleccioná un servicio',
679
+ readOnly: true,
680
+ title: 'Tipo de servicio'
681
+ },
682
+ render: args => /*#__PURE__*/React.createElement("div", {
683
+ style: wrapperStyle
684
+ }, /*#__PURE__*/React.createElement(PreselectedWrapper, args))
685
+ };
686
+ export const VariantSelect = {
687
+ name: 'Variant — Select',
688
+ args: {
689
+ placeholder: 'Seleccioná un servicio',
690
+ title: 'Tipo de servicio',
691
+ variant: 'select'
692
+ },
693
+ render: args => /*#__PURE__*/React.createElement(SelectWrapper, args)
694
+ };
695
+ export const VariantPicker = {
696
+ name: 'Variant — Picker',
697
+ args: {
698
+ placeholder: 'Seleccioná un servicio',
699
+ title: 'Tipo de servicio',
700
+ variant: 'picker'
701
+ },
702
+ parameters: {
703
+ docs: {
704
+ description: {
705
+ story: 'Variante con fondo transparente. Ideal para usar sobre cards o fondos con color.'
706
+ }
707
+ }
708
+ },
709
+ render: args => /*#__PURE__*/React.createElement("div", {
710
+ style: {
711
+ background: '#f1f5f9',
712
+ borderRadius: '0.5rem',
713
+ padding: '1.5rem',
714
+ maxWidth: '360px'
715
+ }
716
+ }, /*#__PURE__*/React.createElement(SelectWrapper, args))
717
+ };
718
+ export const ClearableSelect = {
719
+ name: 'Clearable — Select',
720
+ args: {
721
+ placeholder: 'Seleccioná un servicio',
722
+ title: 'Tipo de servicio',
723
+ variant: 'select'
724
+ },
725
+ parameters: {
726
+ docs: {
727
+ description: {
728
+ story: 'Comparación de `clearable={true}` (muestra la X al completar) vs `clearable={false}` (oculta la X) en variant select.'
729
+ }
730
+ }
731
+ },
732
+ render: args => /*#__PURE__*/React.createElement("div", {
733
+ style: rowStyle
734
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
735
+ style: labelStyle
736
+ }, "clearable=true (default)"), /*#__PURE__*/React.createElement(PreselectedWrapper, _extends({}, args, {
737
+ clearable: true
738
+ }))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
739
+ style: labelStyle
740
+ }, "clearable=false"), /*#__PURE__*/React.createElement(PreselectedWrapper, _extends({}, args, {
741
+ clearable: false
742
+ }))))
743
+ };
744
+ export const ClearablePicker = {
745
+ name: 'Clearable — Picker',
746
+ args: {
747
+ placeholder: 'Seleccioná un servicio',
748
+ title: 'Tipo de servicio',
749
+ variant: 'picker'
750
+ },
751
+ parameters: {
752
+ docs: {
753
+ description: {
754
+ story: 'Comparación de `clearable={true}` vs `clearable={false}` en variant picker. Útil para dropdowns embebidos donde el borrado puede no tener sentido.'
755
+ }
756
+ }
757
+ },
758
+ render: args => /*#__PURE__*/React.createElement("div", {
759
+ style: {
760
+ background: '#f1f5f9',
761
+ borderRadius: '0.5rem',
762
+ padding: '1.5rem',
763
+ maxWidth: '360px'
764
+ }
765
+ }, /*#__PURE__*/React.createElement("div", {
766
+ style: {
767
+ display: 'flex',
768
+ flexDirection: 'column',
769
+ gap: '1.5rem'
770
+ }
771
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
772
+ style: labelStyle
773
+ }, "clearable=true (default)"), /*#__PURE__*/React.createElement(PreselectedWrapper, _extends({}, args, {
774
+ clearable: true
775
+ }))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
776
+ style: labelStyle
777
+ }, "clearable=false"), /*#__PURE__*/React.createElement(PreselectedWrapper, _extends({}, args, {
778
+ clearable: false
779
+ })))))
780
+ };
781
+ export const ConError = {
782
+ name: 'Con error',
783
+ args: {
784
+ error: 'Este campo es requerido.',
785
+ placeholder: 'Seleccioná un servicio',
786
+ title: 'Tipo de servicio'
787
+ },
788
+ render: args => /*#__PURE__*/React.createElement(SelectWrapper, args)
789
+ };
790
+ export const PickerConSeleccion = {
791
+ name: 'Picker — con selección previa',
792
+ args: {
793
+ placeholder: 'Seleccioná un servicio',
794
+ title: 'Tipo de servicio',
795
+ variant: 'picker'
796
+ },
797
+ parameters: {
798
+ docs: {
799
+ description: {
800
+ story: 'En `variant="picker"` al hacer foco se muestran todas las opciones aunque haya una seleccionada. El filtrado solo aplica si el usuario empieza a escribir.'
801
+ }
802
+ }
803
+ },
804
+ render: args => /*#__PURE__*/React.createElement("div", {
805
+ style: {
806
+ background: '#f1f5f9',
807
+ borderRadius: '0.5rem',
808
+ padding: '1.5rem',
809
+ maxWidth: '360px'
810
+ }
811
+ }, /*#__PURE__*/React.createElement(PreselectedWrapper, args))
812
+ };
813
+ export const ConFilaPersonalizada = {
814
+ name: 'Con fila personalizada (CustomRow)',
815
+ args: {
816
+ multiple: true,
817
+ options: PERSON_OPTIONS,
818
+ placeholder: 'Seleccioná usuarios',
819
+ title: 'Con fila personalizada (CustomRow)'
820
+ },
821
+ parameters: {
822
+ docs: {
823
+ description: {
824
+ story: 'La prop `CustomRow` recibe un componente React con `{ item, isChecked }` y reemplaza el renderizado por defecto de cada opción del dropdown.'
825
+ }
826
+ }
827
+ },
828
+ render: args => /*#__PURE__*/React.createElement(SelectWrapper, _extends({}, args, {
829
+ CustomRow: AvatarCustomRow
830
+ }))
831
+ };
832
+ export const ConTextoDeAyuda = {
833
+ name: 'Con texto de ayuda',
834
+ args: {
835
+ helpText: 'Podés buscar escribiendo en el campo.',
836
+ placeholder: 'Seleccioná una opción',
837
+ title: 'Con texto de ayuda'
838
+ },
839
+ render: args => /*#__PURE__*/React.createElement(SelectWrapper, args)
840
+ };
841
+ export const SinOpciones = {
842
+ name: 'Sin opciones',
843
+ args: {
844
+ options: [],
845
+ placeholder: 'Sin opciones',
846
+ title: 'Sin opciones disponibles'
847
+ },
848
+ render: args => /*#__PURE__*/React.createElement(SelectWrapper, args)
849
+ };
850
+ export const TestSite = {
851
+ name: 'Test Site',
852
+ parameters: {
853
+ docs: {
854
+ description: {
855
+ story: 'Casos de prueba para el Storybook Test Runner: single, múltiple, CustomRow, disabled, error.'
856
+ }
857
+ }
858
+ },
859
+ render: args => /*#__PURE__*/React.createElement("div", {
860
+ style: {
861
+ display: 'flex',
862
+ flexDirection: 'column',
863
+ gap: 24,
864
+ maxWidth: 400
865
+ }
866
+ }, /*#__PURE__*/React.createElement(SelectWrapper, _extends({}, args, {
867
+ placeholder: "Selecci\xF3n simple",
868
+ title: "Single"
869
+ })), /*#__PURE__*/React.createElement(SelectWrapper, _extends({}, args, {
870
+ multiple: true,
871
+ placeholder: "Selecci\xF3n m\xFAltiple",
872
+ title: "Multiple"
873
+ })), /*#__PURE__*/React.createElement(SelectWrapper, _extends({}, args, {
874
+ CustomRow: AvatarCustomRow,
875
+ multiple: true,
876
+ options: PERSON_OPTIONS,
877
+ placeholder: "Custom row",
878
+ title: "Custom Row"
879
+ })), /*#__PURE__*/React.createElement(SelectWrapper, _extends({}, args, {
880
+ disabled: true,
881
+ placeholder: "Deshabilitado",
882
+ title: "Disabled"
883
+ })), /*#__PURE__*/React.createElement(SelectWrapper, _extends({}, args, {
884
+ error: "Campo requerido",
885
+ placeholder: "Con error",
886
+ required: true,
887
+ title: "Error"
888
+ })))
889
+ };