@widergy/energy-ui 3.171.3 → 3.172.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.
- package/CHANGELOG.md +19 -2
- package/dist/components/UTButton/constants.js +2 -0
- package/dist/components/UTButton/index.js +6 -3
- package/dist/components/UTButton/stories/UTButtonSizes.stories.js +16 -1
- package/dist/components/UTButton/stories/storiesConstants.js +26 -0
- package/dist/components/UTButton/styles.module.scss +10 -0
- package/dist/components/UTButton/theme.js +1 -1
- package/dist/components/UTButton/utils.js +1 -4
- package/dist/components/UTDataCategory/theme.js +1 -1
- package/dist/components/UTDataElement/README.md +1 -1
- package/dist/components/UTPaper/index.js +3 -1
- package/dist/components/UTSelect/UTSelectFixedBottomOption.stories.js +171 -0
- package/dist/components/UTSelect/versions/V1/README.md +19 -0
- package/dist/components/UTSelect/versions/V1/components/ListboxComponent/index.js +48 -16
- package/dist/components/UTSelect/versions/V1/components/ListboxComponent/styles.module.scss +11 -0
- package/dist/components/UTSelect/versions/V1/index.js +39 -15
- package/dist/components/UTSelect/versions/V1/types.js +6 -0
- package/dist/components/UTTracker/UTTracker.stories.js +332 -0
- package/dist/esm/components/UTButton/constants.js +2 -0
- package/dist/esm/components/UTButton/index.js +6 -3
- package/dist/esm/components/UTButton/stories/UTButtonSizes.stories.js +15 -0
- package/dist/esm/components/UTButton/stories/storiesConstants.js +26 -0
- package/dist/esm/components/UTButton/styles.module.scss +10 -0
- package/dist/esm/components/UTButton/theme.js +1 -1
- package/dist/esm/components/UTButton/utils.js +1 -4
- package/dist/esm/components/UTDataCategory/theme.js +2 -2
- package/dist/esm/components/UTDataElement/README.md +1 -1
- package/dist/esm/components/UTPaper/index.js +3 -1
- package/dist/esm/components/UTSelect/UTSelectFixedBottomOption.stories.js +163 -0
- package/dist/esm/components/UTSelect/versions/V1/README.md +19 -0
- package/dist/esm/components/UTSelect/versions/V1/components/ListboxComponent/index.js +49 -17
- package/dist/esm/components/UTSelect/versions/V1/components/ListboxComponent/styles.module.scss +11 -0
- package/dist/esm/components/UTSelect/versions/V1/index.js +39 -15
- package/dist/esm/components/UTSelect/versions/V1/types.js +6 -0
- package/dist/esm/components/UTTracker/UTTracker.stories.js +325 -0
- package/package.json +1 -1
|
@@ -0,0 +1,325 @@
|
|
|
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 from 'react';
|
|
3
|
+
import { joinArgTypes } from 'stories/utils';
|
|
4
|
+
import { CARD, ERROR, FLAT, STANDARD } from './constants';
|
|
5
|
+
import UTTracker from '.';
|
|
6
|
+
const subSteps = [{
|
|
7
|
+
id: 1,
|
|
8
|
+
subtitle: '02 noviembre 2023, 4:38 PM',
|
|
9
|
+
title: 'Description Step'
|
|
10
|
+
}, {
|
|
11
|
+
id: 2,
|
|
12
|
+
subtitle: '02 noviembre 2023, 4:38 PM',
|
|
13
|
+
title: 'Description Step'
|
|
14
|
+
}, {
|
|
15
|
+
id: 3,
|
|
16
|
+
subtitle: '02 noviembre 2023, 4:38 PM',
|
|
17
|
+
title: 'Description Step'
|
|
18
|
+
}];
|
|
19
|
+
const defaultSteps = [{
|
|
20
|
+
id: 1,
|
|
21
|
+
subSteps,
|
|
22
|
+
title: 'Solicitud confirmada'
|
|
23
|
+
}, {
|
|
24
|
+
id: 2,
|
|
25
|
+
subSteps,
|
|
26
|
+
title: 'En preparación'
|
|
27
|
+
}, {
|
|
28
|
+
id: 3,
|
|
29
|
+
title: 'En camino'
|
|
30
|
+
}, {
|
|
31
|
+
description: 'Fecha estimada 07 de agosto',
|
|
32
|
+
id: 4,
|
|
33
|
+
title: 'Entregado'
|
|
34
|
+
}];
|
|
35
|
+
export default {
|
|
36
|
+
args: {
|
|
37
|
+
currentStep: 2,
|
|
38
|
+
description: 'Hora estimada de entrega 7:00 PM',
|
|
39
|
+
detailsTab: {
|
|
40
|
+
enabled: true,
|
|
41
|
+
title: 'Ver Detalle'
|
|
42
|
+
},
|
|
43
|
+
mode: CARD,
|
|
44
|
+
steps: defaultSteps,
|
|
45
|
+
subtitle: '',
|
|
46
|
+
title: 'Pedido en curso',
|
|
47
|
+
variant: STANDARD
|
|
48
|
+
},
|
|
49
|
+
argTypes: {
|
|
50
|
+
classes: {
|
|
51
|
+
control: false,
|
|
52
|
+
description: 'Objeto de clases CSS para personalizar estilos internos vía theming.',
|
|
53
|
+
table: {
|
|
54
|
+
defaultValue: {
|
|
55
|
+
summary: '{}'
|
|
56
|
+
},
|
|
57
|
+
type: {
|
|
58
|
+
summary: 'objectOf(string)'
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
classNames: {
|
|
63
|
+
control: false,
|
|
64
|
+
description: 'Objeto de clases CSS para override de estilos internos.',
|
|
65
|
+
table: {
|
|
66
|
+
defaultValue: {
|
|
67
|
+
summary: 'undefined'
|
|
68
|
+
},
|
|
69
|
+
type: {
|
|
70
|
+
summary: 'objectOf(string)'
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
currentStep: {
|
|
75
|
+
control: 'number',
|
|
76
|
+
description: 'Número del paso activo actualmente.',
|
|
77
|
+
table: {
|
|
78
|
+
defaultValue: {
|
|
79
|
+
summary: 'undefined'
|
|
80
|
+
},
|
|
81
|
+
type: {
|
|
82
|
+
summary: 'number'
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
description: {
|
|
87
|
+
control: 'text',
|
|
88
|
+
description: 'Texto descriptivo que aparece debajo del subtítulo.',
|
|
89
|
+
table: {
|
|
90
|
+
defaultValue: {
|
|
91
|
+
summary: 'undefined'
|
|
92
|
+
},
|
|
93
|
+
type: {
|
|
94
|
+
summary: 'string'
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
detailsTab: {
|
|
99
|
+
control: 'object',
|
|
100
|
+
description: 'Configuración de la pestaña de detalle. `enabled` habilita el botón de colapsar; `title` es el texto del botón.',
|
|
101
|
+
table: {
|
|
102
|
+
defaultValue: {
|
|
103
|
+
summary: 'undefined'
|
|
104
|
+
},
|
|
105
|
+
type: {
|
|
106
|
+
summary: '{ enabled: boolean, title: string }'
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
mode: {
|
|
111
|
+
control: 'inline-radio',
|
|
112
|
+
description: 'Determina el modo visual del componente.',
|
|
113
|
+
options: [CARD, FLAT],
|
|
114
|
+
table: {
|
|
115
|
+
defaultValue: {
|
|
116
|
+
summary: CARD
|
|
117
|
+
},
|
|
118
|
+
type: {
|
|
119
|
+
summary: joinArgTypes([CARD, FLAT])
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
steps: {
|
|
124
|
+
control: 'object',
|
|
125
|
+
description: 'Array de pasos a mostrar. Cada paso puede tener `id`, `title`, `subtitle`, `description` y `subSteps`.',
|
|
126
|
+
table: {
|
|
127
|
+
defaultValue: {
|
|
128
|
+
summary: 'undefined'
|
|
129
|
+
},
|
|
130
|
+
type: {
|
|
131
|
+
summary: 'arrayOf({ id, title, subtitle, description, subSteps })'
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
subtitle: {
|
|
136
|
+
control: 'text',
|
|
137
|
+
description: 'Subtítulo que aparece junto al banner de error cuando `variant` es `error`.',
|
|
138
|
+
table: {
|
|
139
|
+
defaultValue: {
|
|
140
|
+
summary: 'undefined'
|
|
141
|
+
},
|
|
142
|
+
type: {
|
|
143
|
+
summary: 'string'
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
title: {
|
|
148
|
+
control: 'text',
|
|
149
|
+
description: 'Título del componente. En modo `flat` con `detailsTab` habilitado actúa como botón de colapsar.',
|
|
150
|
+
table: {
|
|
151
|
+
defaultValue: {
|
|
152
|
+
summary: 'undefined'
|
|
153
|
+
},
|
|
154
|
+
type: {
|
|
155
|
+
summary: 'string'
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
variant: {
|
|
160
|
+
control: 'inline-radio',
|
|
161
|
+
description: 'Determina la variante visual del componente.',
|
|
162
|
+
options: [STANDARD, ERROR],
|
|
163
|
+
table: {
|
|
164
|
+
defaultValue: {
|
|
165
|
+
summary: STANDARD
|
|
166
|
+
},
|
|
167
|
+
type: {
|
|
168
|
+
summary: joinArgTypes([STANDARD, ERROR])
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
component: UTTracker,
|
|
174
|
+
parameters: {
|
|
175
|
+
controls: {
|
|
176
|
+
exclude: ['classes']
|
|
177
|
+
},
|
|
178
|
+
docs: {
|
|
179
|
+
description: {
|
|
180
|
+
component: 'Componente para mostrar el seguimiento de un proceso paso a paso. Soporta dos modos visuales (`card` y `flat`), variantes de estado (`standard` y `error`), pasos con sub-pasos, y una pestaña de detalle colapsable.'
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
title: 'Energy-UI/UTTracker'
|
|
185
|
+
};
|
|
186
|
+
export const Default = {
|
|
187
|
+
name: 'Playground'
|
|
188
|
+
};
|
|
189
|
+
export const CardMode = {
|
|
190
|
+
args: {
|
|
191
|
+
mode: CARD,
|
|
192
|
+
variant: STANDARD
|
|
193
|
+
},
|
|
194
|
+
name: 'Modo Card',
|
|
195
|
+
parameters: {
|
|
196
|
+
docs: {
|
|
197
|
+
description: {
|
|
198
|
+
story: 'UTTracker en modo `card`, con sombra y fondo blanco. Incluye la pestaña de detalle al pie.'
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
export const FlatMode = {
|
|
204
|
+
args: {
|
|
205
|
+
mode: FLAT,
|
|
206
|
+
variant: STANDARD
|
|
207
|
+
},
|
|
208
|
+
name: 'Modo Flat',
|
|
209
|
+
parameters: {
|
|
210
|
+
docs: {
|
|
211
|
+
description: {
|
|
212
|
+
story: 'UTTracker en modo `flat`, con fondo transparente. El título actúa como botón de colapsar cuando `detailsTab` está habilitado.'
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
export const ErrorVariant = {
|
|
218
|
+
args: {
|
|
219
|
+
description: 'Quería recargas catalíticas y pedí normales',
|
|
220
|
+
mode: CARD,
|
|
221
|
+
subtitle: 'Me equivoqué en el pedido',
|
|
222
|
+
variant: ERROR
|
|
223
|
+
},
|
|
224
|
+
name: 'Variante Error',
|
|
225
|
+
parameters: {
|
|
226
|
+
docs: {
|
|
227
|
+
description: {
|
|
228
|
+
story: 'UTTracker con `variant="error"`. Muestra el banner de error con `subtitle` y `description`.'
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
export const WithoutDetailsTab = {
|
|
234
|
+
args: {
|
|
235
|
+
detailsTab: undefined,
|
|
236
|
+
mode: CARD,
|
|
237
|
+
variant: STANDARD
|
|
238
|
+
},
|
|
239
|
+
name: 'Sin Pestaña de Detalle',
|
|
240
|
+
parameters: {
|
|
241
|
+
docs: {
|
|
242
|
+
description: {
|
|
243
|
+
story: 'UTTracker sin la pestaña de detalle colapsable. Las esquinas inferiores quedan redondeadas.'
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
export const WithoutTitle = {
|
|
249
|
+
args: {
|
|
250
|
+
mode: CARD,
|
|
251
|
+
title: undefined,
|
|
252
|
+
variant: STANDARD
|
|
253
|
+
},
|
|
254
|
+
name: 'Sin Título',
|
|
255
|
+
parameters: {
|
|
256
|
+
docs: {
|
|
257
|
+
description: {
|
|
258
|
+
story: 'UTTracker sin título.'
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
export const AllModes = {
|
|
264
|
+
render: args => /*#__PURE__*/React.createElement("div", {
|
|
265
|
+
style: {
|
|
266
|
+
display: 'flex',
|
|
267
|
+
gap: '24px',
|
|
268
|
+
flexWrap: 'wrap'
|
|
269
|
+
}
|
|
270
|
+
}, [CARD, FLAT].map(mode => /*#__PURE__*/React.createElement("div", {
|
|
271
|
+
key: mode,
|
|
272
|
+
style: {
|
|
273
|
+
flex: 1,
|
|
274
|
+
minWidth: '300px'
|
|
275
|
+
}
|
|
276
|
+
}, /*#__PURE__*/React.createElement(UTTracker, _extends({}, args, {
|
|
277
|
+
mode: mode,
|
|
278
|
+
title: "Modo: ".concat(mode)
|
|
279
|
+
}))))),
|
|
280
|
+
name: 'Todos los Modos',
|
|
281
|
+
parameters: {
|
|
282
|
+
docs: {
|
|
283
|
+
description: {
|
|
284
|
+
story: 'Comparativa de los dos modos disponibles: `card` y `flat`.'
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
export const AllVariants = {
|
|
290
|
+
render: args => /*#__PURE__*/React.createElement("div", {
|
|
291
|
+
style: {
|
|
292
|
+
display: 'flex',
|
|
293
|
+
gap: '24px',
|
|
294
|
+
flexWrap: 'wrap'
|
|
295
|
+
}
|
|
296
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
297
|
+
style: {
|
|
298
|
+
flex: 1,
|
|
299
|
+
minWidth: '300px'
|
|
300
|
+
}
|
|
301
|
+
}, /*#__PURE__*/React.createElement(UTTracker, _extends({}, args, {
|
|
302
|
+
description: "Hora estimada de entrega 7:00 PM",
|
|
303
|
+
subtitle: "",
|
|
304
|
+
title: "Variante: standard",
|
|
305
|
+
variant: STANDARD
|
|
306
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
307
|
+
style: {
|
|
308
|
+
flex: 1,
|
|
309
|
+
minWidth: '300px'
|
|
310
|
+
}
|
|
311
|
+
}, /*#__PURE__*/React.createElement(UTTracker, _extends({}, args, {
|
|
312
|
+
description: "Quer\xEDa recargas catal\xEDticas y ped\xED normales",
|
|
313
|
+
subtitle: "Me equivoqu\xE9 en el pedido",
|
|
314
|
+
title: "Variante: error",
|
|
315
|
+
variant: ERROR
|
|
316
|
+
})))),
|
|
317
|
+
name: 'Todas las Variantes',
|
|
318
|
+
parameters: {
|
|
319
|
+
docs: {
|
|
320
|
+
description: {
|
|
321
|
+
story: 'Comparativa de las dos variantes disponibles: `standard` y `error`.'
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
};
|