@widergy/mobile-ui 2.15.0 → 2.17.0
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 +46 -30
- package/lib/components/UTBanner/README.md +124 -11
- package/lib/components/UTBanner/constants.js +5 -0
- package/lib/components/UTBanner/index.js +119 -52
- package/lib/components/UTBanner/proptypes.js +36 -13
- package/lib/components/UTBanner/theme.js +137 -11
- package/lib/components/UTIcon/components/EnergyIcons/EnergyIconCreditCardsFilled.svg +3 -0
- package/lib/components/UTIcon/constants.js +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,93 +1,109 @@
|
|
|
1
|
+
# [2.17.0](https://github.com/widergy/mobile-ui/compare/v2.16.0...v2.17.0) (2026-06-03)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* [DIS-1102] utbanner upgrade ([#505](https://github.com/widergy/mobile-ui/issues/505)) ([6f4a16f](https://github.com/widergy/mobile-ui/commit/6f4a16f927728b1f790d5793e34d8abe9a083a2a))
|
|
7
|
+
|
|
8
|
+
# [2.16.0](https://github.com/widergy/mobile-ui/compare/v2.15.0...v2.16.0) (2026-05-15)
|
|
9
|
+
|
|
10
|
+
### Novedades y Mejoras
|
|
11
|
+
|
|
12
|
+
* Se renovaron los íconos de tarjetas de crédito en la aplicación. [#504](https://github.com/widergy/Energy-UI-Mobile/pull/504) [CX-2232](https://widergy.atlassian.net/browse/CX-2232)
|
|
13
|
+
* Se actualizaron los estilos visuales de los botones y grupos de botones. [#503](https://github.com/widergy/Energy-UI-Mobile/pull/503)
|
|
14
|
+
* Se amplió la tarjeta de acciones rápidas para mostrar estados informativos, ajustar el tamaño de los botones y controlar la apariencia visual del pie de tarjeta. [#501](https://github.com/widergy/Energy-UI-Mobile/pull/501)
|
|
15
|
+
* Mejoras internas de la plataforma. [#500](https://github.com/widergy/Energy-UI-Mobile/pull/500) [#502](https://github.com/widergy/Energy-UI-Mobile/pull/502) [DEV-794](https://widergy.atlassian.net/browse/DEV-794)
|
|
16
|
+
|
|
1
17
|
# [2.15.0](https://github.com/widergy/mobile-ui/compare/v2.14.0...v2.15.0) (2026-05-11)
|
|
2
18
|
|
|
3
19
|
|
|
4
20
|
### Features
|
|
5
21
|
|
|
6
|
-
* [CX-2189] button group and button styles update ([#503](https://github.com/widergy/mobile-ui/issues/503)) ([e2ad63b](https://github.com/widergy/mobile-ui/commit/e2ad63b22682be18b6d5d9094bae2a003b4e1753))
|
|
22
|
+
* [CX-2189] button group and button styles update ([#503](https://github.com/widergy/mobile-ui/issues/503)) ([e2ad63b](https://github.com/widergy/mobile-ui/commit/e2ad63b22682be18b6d5d9094bae2a003b4e1753)) [CX-2189](https://widergy.atlassian.net/browse/CX-2189)
|
|
7
23
|
|
|
8
24
|
# [2.14.0](https://github.com/widergy/mobile-ui/compare/v2.13.1...v2.14.0) (2026-04-27)
|
|
9
25
|
|
|
10
26
|
### Novedades y Mejoras
|
|
11
27
|
|
|
12
|
-
* Se amplió la tarjeta de acciones rápidas para mostrar estados informativos (como la confirmación de adhesión a factura digital), ajustar el tamaño de los botones y controlar la apariencia visual del pie de tarjeta, sin afectar los usos existentes. [#501](https://github.com/widergy/Energy-UI-Mobile/pull/501)
|
|
28
|
+
* Se amplió la tarjeta de acciones rápidas para mostrar estados informativos (como la confirmación de adhesión a factura digital), ajustar el tamaño de los botones y controlar la apariencia visual del pie de tarjeta, sin afectar los usos existentes. [#501](https://github.com/widergy/Energy-UI-Mobile/pull/501) [CX-2203](https://widergy.atlassian.net/browse/CX-2203)
|
|
13
29
|
|
|
14
30
|
## [2.13.1](https://github.com/widergy/mobile-ui/compare/v2.13.0...v2.13.1) (2026-04-24)
|
|
15
31
|
|
|
16
32
|
### Novedades y Mejoras
|
|
17
33
|
|
|
18
|
-
* Mejoras internas de la plataforma. [#502](https://github.com/widergy/Energy-UI-Mobile/pull/502)
|
|
34
|
+
* Mejoras internas de la plataforma. [#502](https://github.com/widergy/Energy-UI-Mobile/pull/502) [DEV-999](https://widergy.atlassian.net/browse/DEV-999)
|
|
19
35
|
|
|
20
36
|
# [2.13.0](https://github.com/widergy/mobile-ui/compare/v2.12.2...v2.13.0) (2026-04-22)
|
|
21
37
|
|
|
22
38
|
### Novedades y Mejoras
|
|
23
39
|
|
|
24
|
-
* El componente de estado (UTStatus) ahora soporta un tamaño extra pequeño, ideal para contextos donde el espacio es reducido. [#499](https://github.com/widergy/Energy-UI-Mobile/pull/499)
|
|
25
|
-
* Mejoras internas de la plataforma. [#499](https://github.com/widergy/Energy-UI-Mobile/pull/499)
|
|
40
|
+
* El componente de estado (UTStatus) ahora soporta un tamaño extra pequeño, ideal para contextos donde el espacio es reducido. [#499](https://github.com/widergy/Energy-UI-Mobile/pull/499) [CX-2188](https://widergy.atlassian.net/browse/CX-2188)
|
|
41
|
+
* Mejoras internas de la plataforma. [#499](https://github.com/widergy/Energy-UI-Mobile/pull/499) [CX-2188](https://widergy.atlassian.net/browse/CX-2188)
|
|
26
42
|
|
|
27
43
|
### Correcciones
|
|
28
44
|
|
|
29
|
-
* Se corrigieron errores menores en los componentes de carga de archivos que impedían el funcionamiento correcto del flujo de subida. [#499](https://github.com/widergy/Energy-UI-Mobile/pull/499)
|
|
45
|
+
* Se corrigieron errores menores en los componentes de carga de archivos que impedían el funcionamiento correcto del flujo de subida. [#499](https://github.com/widergy/Energy-UI-Mobile/pull/499) [CX-2188](https://widergy.atlassian.net/browse/CX-2188)
|
|
30
46
|
|
|
31
47
|
## [2.12.2](https://github.com/widergy/mobile-ui/compare/v2.12.1...v2.12.2) (2026-04-17)
|
|
32
48
|
|
|
33
49
|
### Correcciones
|
|
34
50
|
|
|
35
|
-
* Se ajustó el tamaño de los textos en la pantalla de cupones para mejorar la visualización. [#498](https://github.com/widergy/Energy-UI-Mobile/pull/498)
|
|
51
|
+
* Se ajustó el tamaño de los textos en la pantalla de cupones para mejorar la visualización. [#498](https://github.com/widergy/Energy-UI-Mobile/pull/498) [UGGC-101](https://widergy.atlassian.net/browse/UGGC-101) [UGGC-999](https://widergy.atlassian.net/browse/UGGC-999)
|
|
36
52
|
* Mejoras internas de la plataforma. [`9d7f58e`](https://github.com/widergy/Energy-UI-Mobile/commit/9d7f58e)
|
|
37
53
|
|
|
38
54
|
## [2.12.1](https://github.com/widergy/mobile-ui/compare/v2.12.0...v2.12.1) (2026-04-14)
|
|
39
55
|
|
|
40
56
|
### Correcciones
|
|
41
57
|
|
|
42
|
-
* Mejoras internas de la plataforma [#497](https://github.com/widergy/Energy-UI-Mobile/pull/497)
|
|
58
|
+
* Mejoras internas de la plataforma [#497](https://github.com/widergy/Energy-UI-Mobile/pull/497) [DEV-766](https://widergy.atlassian.net/browse/DEV-766)
|
|
43
59
|
|
|
44
60
|
# [2.12.0](https://github.com/widergy/mobile-ui/compare/v2.11.0...v2.12.0) (2026-04-13)
|
|
45
61
|
|
|
46
62
|
### Novedades y Mejoras
|
|
47
63
|
|
|
48
|
-
* Se mejoró el soporte de automatización en formularios: los campos de carga de archivos, selección, interruptores y botones de opción ahora son identificables de forma consistente en pruebas automatizadas, lo que facilita la validación del flujo de usuario. [#492](https://github.com/widergy/Energy-UI-Mobile/pull/492)
|
|
64
|
+
* Se mejoró el soporte de automatización en formularios: los campos de carga de archivos, selección, interruptores y botones de opción ahora son identificables de forma consistente en pruebas automatizadas, lo que facilita la validación del flujo de usuario. [#492](https://github.com/widergy/Energy-UI-Mobile/pull/492) [AUTO-208](https://widergy.atlassian.net/browse/AUTO-208)
|
|
49
65
|
|
|
50
66
|
# [2.11.0](https://github.com/widergy/mobile-ui/compare/v2.10.0...v2.11.0) (2026-04-13)
|
|
51
67
|
|
|
52
68
|
### Novedades y Mejoras
|
|
53
69
|
|
|
54
|
-
* Se incorporó un nuevo componente de cupón seleccionable en el flujo de pedidos, con soporte para imagen, textos y estados visual activo y deshabilitado. [#493](https://github.com/widergy/Energy-UI-Mobile/pull/493)
|
|
70
|
+
* Se incorporó un nuevo componente de cupón seleccionable en el flujo de pedidos, con soporte para imagen, textos y estados visual activo y deshabilitado. [#493](https://github.com/widergy/Energy-UI-Mobile/pull/493) [UGGC-95](https://widergy.atlassian.net/browse/UGGC-95)
|
|
55
71
|
|
|
56
72
|
# [2.10.0](https://github.com/widergy/mobile-ui/compare/v2.9.7...v2.10.0) (2026-04-13)
|
|
57
73
|
|
|
58
74
|
### Novedades y Mejoras
|
|
59
75
|
|
|
60
|
-
* El campo de ingreso de número de teléfono ahora admite la selección de prefijo telefónico como parte del valor, mejorando la consistencia del dato ingresado en formularios. [#496](https://github.com/widergy/Energy-UI-Mobile/pull/496)
|
|
76
|
+
* El campo de ingreso de número de teléfono ahora admite la selección de prefijo telefónico como parte del valor, mejorando la consistencia del dato ingresado en formularios. [#496](https://github.com/widergy/Energy-UI-Mobile/pull/496) [PROMI-221](https://widergy.atlassian.net/browse/PROMI-221)
|
|
61
77
|
|
|
62
78
|
## [2.9.7](https://github.com/widergy/mobile-ui/compare/v2.9.6...v2.9.7) (2026-04-10)
|
|
63
79
|
|
|
64
80
|
### Correcciones
|
|
65
81
|
|
|
66
|
-
* Se corrigió un error que causaba el cierre inesperado de la aplicación al tocar fuera de ciertos modales o presionar el botón Atrás en Android, cuando el modal no tenía habilitada esa acción de cierre. [#495](https://github.com/widergy/Energy-UI-Mobile/pull/495)
|
|
82
|
+
* Se corrigió un error que causaba el cierre inesperado de la aplicación al tocar fuera de ciertos modales o presionar el botón Atrás en Android, cuando el modal no tenía habilitada esa acción de cierre. [#495](https://github.com/widergy/Energy-UI-Mobile/pull/495) [UGGC-99](https://widergy.atlassian.net/browse/UGGC-99)
|
|
67
83
|
|
|
68
84
|
## [2.9.6](https://github.com/widergy/mobile-ui/compare/v2.9.5...v2.9.6) (2026-04-09)
|
|
69
85
|
|
|
70
86
|
### Novedades y Mejoras
|
|
71
87
|
|
|
72
|
-
* Se amplió la flexibilidad del componente de panel inferior, permitiendo personalizar la acción del botón según cada caso de uso, sin afectar el comportamiento existente. [#494](https://github.com/widergy/Energy-UI-Mobile/pull/494)
|
|
88
|
+
* Se amplió la flexibilidad del componente de panel inferior, permitiendo personalizar la acción del botón según cada caso de uso, sin afectar el comportamiento existente. [#494](https://github.com/widergy/Energy-UI-Mobile/pull/494) [UGGC-99](https://widergy.atlassian.net/browse/UGGC-99)
|
|
73
89
|
|
|
74
90
|
## [2.9.5](https://github.com/widergy/mobile-ui/compare/v2.9.4...v2.9.5) (2026-04-08)
|
|
75
91
|
|
|
76
92
|
### Novedades y Mejoras
|
|
77
93
|
|
|
78
|
-
* Se mejoró la personalización de los botones de navegación en los flujos de gestión, permitiendo configurar la posición de los íconos según las necesidades de cada pantalla. [#490](https://github.com/widergy/Energy-UI-Mobile/pull/490)
|
|
94
|
+
* Se mejoró la personalización de los botones de navegación en los flujos de gestión, permitiendo configurar la posición de los íconos según las necesidades de cada pantalla. [#490](https://github.com/widergy/Energy-UI-Mobile/pull/490) [UGGC-91](https://widergy.atlassian.net/browse/UGGC-91)
|
|
79
95
|
|
|
80
96
|
## [2.9.4](https://github.com/widergy/mobile-ui/compare/v2.9.3...v2.9.4) (2026-04-06)
|
|
81
97
|
|
|
82
98
|
### Correcciones
|
|
83
99
|
|
|
84
|
-
* Se corrigieron los tamaños del título del banner en la versión móvil para que se visualicen correctamente en pantallas medianas y pequeñas. [#491](https://github.com/widergy/Energy-UI-Mobile/pull/491)
|
|
100
|
+
* Se corrigieron los tamaños del título del banner en la versión móvil para que se visualicen correctamente en pantallas medianas y pequeñas. [#491](https://github.com/widergy/Energy-UI-Mobile/pull/491) [UGGC-9999](https://widergy.atlassian.net/browse/UGGC-9999)
|
|
85
101
|
|
|
86
102
|
## [2.9.3](https://github.com/widergy/mobile-ui/compare/v2.9.2...v2.9.3) (2026-03-30)
|
|
87
103
|
|
|
88
104
|
### Correcciones
|
|
89
105
|
|
|
90
|
-
* Se corrigieron inconsistencias visuales en los banners de la aplicación, mejorando su apariencia en distintas variantes de color, estilo y acciones disponibles. [#489](https://github.com/widergy/Energy-UI-Mobile/pull/489)
|
|
106
|
+
* Se corrigieron inconsistencias visuales en los banners de la aplicación, mejorando su apariencia en distintas variantes de color, estilo y acciones disponibles. [#489](https://github.com/widergy/Energy-UI-Mobile/pull/489) [UGGC-84](https://widergy.atlassian.net/browse/UGGC-84)
|
|
91
107
|
|
|
92
108
|
## [2.9.2](https://github.com/widergy/mobile-ui/compare/v2.9.1...v2.9.2) (2026-03-26)
|
|
93
109
|
|
|
@@ -99,65 +115,65 @@
|
|
|
99
115
|
|
|
100
116
|
### Novedades y Mejoras
|
|
101
117
|
|
|
102
|
-
* Las acciones de navegación en los flujos de trabajo ahora pueden apilarse verticalmente, mejorando la experiencia en pantallas con espacio reducido. [#488](https://github.com/widergy/Energy-UI-Mobile/pull/488)
|
|
103
|
-
* Se actualizó la apariencia del componente de banners para alinearse con los estándares de diseño vigentes. [#488](https://github.com/widergy/Energy-UI-Mobile/pull/488)
|
|
118
|
+
* Las acciones de navegación en los flujos de trabajo ahora pueden apilarse verticalmente, mejorando la experiencia en pantallas con espacio reducido. [#488](https://github.com/widergy/Energy-UI-Mobile/pull/488) [UGGC-78](https://widergy.atlassian.net/browse/UGGC-78)
|
|
119
|
+
* Se actualizó la apariencia del componente de banners para alinearse con los estándares de diseño vigentes. [#488](https://github.com/widergy/Energy-UI-Mobile/pull/488) [UGGC-78](https://widergy.atlassian.net/browse/UGGC-78)
|
|
104
120
|
|
|
105
121
|
# [2.9.0](https://github.com/widergy/mobile-ui/compare/v2.8.1...v2.9.0) (2026-03-11)
|
|
106
122
|
|
|
107
123
|
### Novedades y Mejoras
|
|
108
124
|
|
|
109
|
-
* Se mejoró la accesibilidad del componente de casilla de verificación para facilitar la automatización de flujos como la adhesión a factura digital. [#487](https://github.com/widergy/Energy-UI-Mobile/pull/487)
|
|
125
|
+
* Se mejoró la accesibilidad del componente de casilla de verificación para facilitar la automatización de flujos como la adhesión a factura digital. [#487](https://github.com/widergy/Energy-UI-Mobile/pull/487) [AUTO-152](https://widergy.atlassian.net/browse/AUTO-152)
|
|
110
126
|
|
|
111
127
|
## [2.8.1](https://github.com/widergy/mobile-ui/compare/v2.8.0...v2.8.1) (2026-02-19)
|
|
112
128
|
|
|
113
129
|
### Correcciones
|
|
114
130
|
|
|
115
|
-
* Se corrigió un error que impedía iniciar sesión correctamente con correo electrónico. [#486](https://github.com/widergy/Energy-UI-Mobile/pull/486)
|
|
131
|
+
* Se corrigió un error que impedía iniciar sesión correctamente con correo electrónico. [#486](https://github.com/widergy/Energy-UI-Mobile/pull/486) [NTGE-205](https://widergy.atlassian.net/browse/NTGE-205)
|
|
116
132
|
|
|
117
133
|
# [2.8.0](https://github.com/widergy/mobile-ui/compare/v2.7.0...v2.8.0) (2026-02-18)
|
|
118
134
|
|
|
119
135
|
### Novedades y Mejoras
|
|
120
136
|
|
|
121
|
-
* Las etiquetas dentro de la aplicación ahora admiten formato enriquecido, permitiendo textos con negritas, listas y otros estilos visuales. [#485](https://github.com/widergy/Energy-UI-Mobile/pull/485)
|
|
137
|
+
* Las etiquetas dentro de la aplicación ahora admiten formato enriquecido, permitiendo textos con negritas, listas y otros estilos visuales. [#485](https://github.com/widergy/Energy-UI-Mobile/pull/485) [EGIT-29](https://widergy.atlassian.net/browse/EGIT-29)
|
|
122
138
|
|
|
123
139
|
# [2.7.0](https://github.com/widergy/mobile-ui/compare/v2.6.0...v2.7.0) (2026-02-18)
|
|
124
140
|
|
|
125
141
|
### Novedades y Mejoras
|
|
126
142
|
|
|
127
|
-
* Los tooltips de la app móvil ahora muestran imágenes correctamente, en lugar de texto plano, alineando el comportamiento con la versión web. [#476](https://github.com/widergy/Energy-UI-Mobile/pull/476)
|
|
128
|
-
* Se mejoró la presentación visual de etiquetas de texto en ciertos flujos, que ahora se muestran con el formato correcto. [#478](https://github.com/widergy/Energy-UI-Mobile/pull/478)
|
|
129
|
-
* Mejoras internas de la plataforma. [#465](https://github.com/widergy/Energy-UI-Mobile/pull/465) [#479](https://github.com/widergy/Energy-UI-Mobile/pull/479) [#480](https://github.com/widergy/Energy-UI-Mobile/pull/480) [#481](https://github.com/widergy/Energy-UI-Mobile/pull/481) [#482](https://github.com/widergy/Energy-UI-Mobile/pull/482) [#483](https://github.com/widergy/Energy-UI-Mobile/pull/483) [#484](https://github.com/widergy/Energy-UI-Mobile/pull/484)
|
|
143
|
+
* Los tooltips de la app móvil ahora muestran imágenes correctamente, en lugar de texto plano, alineando el comportamiento con la versión web. [#476](https://github.com/widergy/Energy-UI-Mobile/pull/476) [NTGE-184](https://widergy.atlassian.net/browse/NTGE-184)
|
|
144
|
+
* Se mejoró la presentación visual de etiquetas de texto en ciertos flujos, que ahora se muestran con el formato correcto. [#478](https://github.com/widergy/Energy-UI-Mobile/pull/478) [EGIT-29](https://widergy.atlassian.net/browse/EGIT-29)
|
|
145
|
+
* Mejoras internas de la plataforma. [#465](https://github.com/widergy/Energy-UI-Mobile/pull/465) [#479](https://github.com/widergy/Energy-UI-Mobile/pull/479) [#480](https://github.com/widergy/Energy-UI-Mobile/pull/480) [#481](https://github.com/widergy/Energy-UI-Mobile/pull/481) [#482](https://github.com/widergy/Energy-UI-Mobile/pull/482) [#483](https://github.com/widergy/Energy-UI-Mobile/pull/483) [#484](https://github.com/widergy/Energy-UI-Mobile/pull/484) [DEV-766](https://widergy.atlassian.net/browse/DEV-766) [EGIT-29](https://widergy.atlassian.net/browse/EGIT-29)
|
|
130
146
|
|
|
131
147
|
# [2.6.0](https://github.com/widergy/mobile-ui/compare/v2.5.2...v2.6.0) (2026-02-09)
|
|
132
148
|
|
|
133
149
|
### Novedades y Mejoras
|
|
134
150
|
|
|
135
|
-
* Se mejoró la consistencia visual en el formulario de asociación de cuentas: las etiquetas de los campos ahora tienen el mismo estilo que el resto de la tabla. [#477](https://github.com/widergy/Energy-UI-Mobile/pull/477)
|
|
151
|
+
* Se mejoró la consistencia visual en el formulario de asociación de cuentas: las etiquetas de los campos ahora tienen el mismo estilo que el resto de la tabla. [#477](https://github.com/widergy/Energy-UI-Mobile/pull/477) [EGIT-7](https://widergy.atlassian.net/browse/EGIT-7)
|
|
136
152
|
|
|
137
153
|
## [2.5.2](https://github.com/widergy/mobile-ui/compare/v2.5.1...v2.5.2) (2026-01-28)
|
|
138
154
|
|
|
139
155
|
### Correcciones
|
|
140
156
|
|
|
141
|
-
* Se corrigió el color de los ítems seleccionados y deshabilitados en las listas de selección múltiple. [#458](https://github.com/widergy/Energy-UI-Mobile/pull/458)
|
|
142
|
-
* Mejoras internas de la plataforma. [#475](https://github.com/widergy/Energy-UI-Mobile/pull/475)
|
|
157
|
+
* Se corrigió el color de los ítems seleccionados y deshabilitados en las listas de selección múltiple. [#458](https://github.com/widergy/Energy-UI-Mobile/pull/458) [OUG-8010](https://widergy.atlassian.net/browse/OUG-8010)
|
|
158
|
+
* Mejoras internas de la plataforma. [#475](https://github.com/widergy/Energy-UI-Mobile/pull/475) [DEV-999](https://widergy.atlassian.net/browse/DEV-999)
|
|
143
159
|
|
|
144
160
|
## [2.5.1](https://github.com/widergy/mobile-ui/compare/v2.5.0...v2.5.1) (2026-01-27)
|
|
145
161
|
|
|
146
162
|
### Correcciones
|
|
147
163
|
|
|
148
|
-
* Se corrigió el comportamiento de un acceso directo que fallaba al usarse más de una vez y no actualizaba correctamente la sección activa de la aplicación. [#474](https://github.com/widergy/Energy-UI-Mobile/pull/474)
|
|
164
|
+
* Se corrigió el comportamiento de un acceso directo que fallaba al usarse más de una vez y no actualizaba correctamente la sección activa de la aplicación. [#474](https://github.com/widergy/Energy-UI-Mobile/pull/474) [EVEP-362](https://widergy.atlassian.net/browse/EVEP-362)
|
|
149
165
|
|
|
150
166
|
# [2.5.0](https://github.com/widergy/mobile-ui/compare/v2.4.0...v2.5.0) (2026-01-22)
|
|
151
167
|
|
|
152
168
|
### Novedades y Mejoras
|
|
153
169
|
|
|
154
|
-
* Mejoras internas de la plataforma [#473](https://github.com/widergy/Energy-UI-Mobile/pull/473)
|
|
170
|
+
* Mejoras internas de la plataforma [#473](https://github.com/widergy/Energy-UI-Mobile/pull/473) [EVEP-362](https://widergy.atlassian.net/browse/EVEP-362)
|
|
155
171
|
|
|
156
172
|
# [2.4.0](https://github.com/widergy/mobile-ui/compare/v2.3.5...v2.4.0) (2026-01-19)
|
|
157
173
|
|
|
158
174
|
### Novedades y Mejoras
|
|
159
175
|
|
|
160
|
-
* Mejoras internas de la plataforma [#472](https://github.com/widergy/Energy-UI-Mobile/pull/472)
|
|
176
|
+
* Mejoras internas de la plataforma [#472](https://github.com/widergy/Energy-UI-Mobile/pull/472) [AUTO-166](https://widergy.atlassian.net/browse/AUTO-166) [AUTO-104](https://widergy.atlassian.net/browse/AUTO-104)
|
|
161
177
|
|
|
162
178
|
## [2.3.5](https://github.com/widergy/mobile-ui/compare/v2.3.4...v2.3.5) (2025-12-18)
|
|
163
179
|
|
|
@@ -1,19 +1,132 @@
|
|
|
1
1
|
# UTBanner
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Descripción
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Componente de notificación/alerta que muestra información contextual con soporte para ícono, textos estructurados, botones de acción y botón de cierre. Soporta múltiples combinaciones de layout mediante las props `iconPlacement` y `buttonPlacement`.
|
|
6
6
|
|
|
7
7
|
## Props
|
|
8
8
|
|
|
9
|
-
|
|
|
10
|
-
|
|
|
11
|
-
|
|
|
12
|
-
|
|
|
13
|
-
|
|
|
9
|
+
| Nombre | Tipo | Default | Descripción |
|
|
10
|
+
| ---------------- | ---------- | -------------- | ----------- |
|
|
11
|
+
| `button` | `ButtonShape` | | Configuración del botón de acción principal. Acepta todas las props de `UTButton` más `title` (string) como texto del botón. |
|
|
12
|
+
| `buttonPlacement`| `string` | `'horizontal'` | Dirección del eje entre el grupo de textos y el grupo de botones. `'horizontal'` los ubica lado a lado, `'vertical'` los apila. |
|
|
13
|
+
| `category` | `string` | | Etiqueta pequeña que se muestra sobre el título (ej: `"2 ALERTAS EN TOTAL"`). |
|
|
14
|
+
| `colorTheme` | `string` | `'white'` | Color de fondo del banner. Ver sección de variantes. |
|
|
15
|
+
| `dataTestId` | `string` | | ID base para pruebas. Se propaga con sufijos a los elementos internos. |
|
|
16
|
+
| `description` | `string` | | Texto descriptivo debajo del título. |
|
|
17
|
+
| `helpText` | `string` | | Texto de ayuda secundario, se muestra debajo de la descripción. |
|
|
18
|
+
| `icon` | `IconShape` | | Ícono a mostrar. Acepta `name` (string) y `colorTheme` (string). |
|
|
19
|
+
| `iconPlacement` | `string` | `'horizontal'` | Dirección del eje entre el ícono y el grupo de textos. `'horizontal'` los ubica lado a lado, `'vertical'` apila el ícono encima del texto. |
|
|
20
|
+
| `onClose` | `func` | | Si se pasa, muestra un botón de cierre (X) en la esquina superior derecha. |
|
|
21
|
+
| `secondaryButton`| `ButtonShape` | | Configuración del botón de acción secundario. Mismas props que `button`. |
|
|
22
|
+
| `size` | `string` | `'medium'` | Tamaño del banner: `'small'`, `'medium'`, `'large'`. |
|
|
23
|
+
| `style` | `StyleShape` | | Overrides de estilo por sección. Ver sección de estilos. |
|
|
24
|
+
| `title` | `string` | | Texto principal del banner. |
|
|
25
|
+
| `variant` | `string` | `'light'` | Variante de color: `'light'` (fondo claro) o `'dark'` (fondo oscuro). |
|
|
26
|
+
| `withMarkdown` | `bool` | | Si es `true`, renderiza `title` y `description` con soporte Markdown. |
|
|
27
|
+
| `text` | `string` | | **Deprecated.** Usar `title` en su lugar. |
|
|
14
28
|
|
|
15
|
-
|
|
29
|
+
## Tipos personalizados
|
|
16
30
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
31
|
+
### `ButtonShape`
|
|
32
|
+
|
|
33
|
+
```js
|
|
34
|
+
{
|
|
35
|
+
colorTheme: string,
|
|
36
|
+
count: number,
|
|
37
|
+
dataTestId: string,
|
|
38
|
+
disabled: bool,
|
|
39
|
+
Icon: elementType,
|
|
40
|
+
iconPlacement: string,
|
|
41
|
+
loading: bool,
|
|
42
|
+
onPress: func,
|
|
43
|
+
size: string,
|
|
44
|
+
style: object,
|
|
45
|
+
title: string, // Texto del botón (children de UTButton)
|
|
46
|
+
variant: string
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### `IconShape`
|
|
51
|
+
|
|
52
|
+
```js
|
|
53
|
+
{
|
|
54
|
+
colorTheme: string,
|
|
55
|
+
name: string
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### `StyleShape`
|
|
60
|
+
|
|
61
|
+
```js
|
|
62
|
+
{
|
|
63
|
+
banner: object, // Estilo del contenedor raíz
|
|
64
|
+
category: object, // Estilo del label de categoría
|
|
65
|
+
description: object, // Estilo del label de descripción
|
|
66
|
+
helpText: object, // Estilo del label de texto de ayuda
|
|
67
|
+
title: object // Estilo del label de título
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Variantes de `colorTheme`
|
|
72
|
+
|
|
73
|
+
| Valor | Fondo (light) | Fondo (dark) |
|
|
74
|
+
| --------------- | ------------------------------ | ------------------------- |
|
|
75
|
+
| `'white'` | `Palette.light.01` | `Palette.dark.04` |
|
|
76
|
+
| `'primary'` | `Palette.accent.01` | `Palette.accent.04` |
|
|
77
|
+
| `'gray'` | `Palette.light.02` | `Palette.gray.05` |
|
|
78
|
+
| `'negative'` | `Palette.negative.02` | `Palette.negative.04` |
|
|
79
|
+
| `'error'` | `Palette.error.01` | `Palette.error.04` |
|
|
80
|
+
| `'warning'` | `Palette.warning.01` | `Palette.warning.04` |
|
|
81
|
+
| `'success'` | `Palette.success.01` | `Palette.success.04` |
|
|
82
|
+
| `'information'` | `Palette.information.01` | `Palette.information.04` |
|
|
83
|
+
|
|
84
|
+
## Layouts disponibles (combinaciones de placement)
|
|
85
|
+
|
|
86
|
+
| `iconPlacement` | `buttonPlacement` | Descripción |
|
|
87
|
+
| --------------- | ----------------- | ----------- |
|
|
88
|
+
| `'horizontal'` | `'horizontal'` | Ícono a la izquierda, botones a la derecha del texto _(default)_ |
|
|
89
|
+
| `'horizontal'` | `'vertical'` | Ícono a la izquierda del texto, botones debajo |
|
|
90
|
+
| `'vertical'` | `'horizontal'` | Ícono arriba del texto, botones a la derecha |
|
|
91
|
+
| `'vertical'` | `'vertical'` | Ícono arriba del texto, botones debajo |
|
|
92
|
+
|
|
93
|
+
## Ejemplos de uso
|
|
94
|
+
|
|
95
|
+
### Banner básico
|
|
96
|
+
|
|
97
|
+
```jsx
|
|
98
|
+
<UTBanner
|
|
99
|
+
colorTheme="warning"
|
|
100
|
+
title="Alerta de corte programado"
|
|
101
|
+
description="Tu cuenta se encuentra afectada por un corte programado."
|
|
102
|
+
/>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Con categoría, helpText y botones
|
|
106
|
+
|
|
107
|
+
```jsx
|
|
108
|
+
<UTBanner
|
|
109
|
+
button={{ onPress: handleClaim, title: 'Generar reclamo', variant: 'filled' }}
|
|
110
|
+
category="2 alertas en total"
|
|
111
|
+
colorTheme="error"
|
|
112
|
+
description="Tu cuenta se encuentra afectada por un corte programado."
|
|
113
|
+
helpText="2 alertas en total"
|
|
114
|
+
icon={{ colorTheme: 'error', name: 'iconInfo' }}
|
|
115
|
+
onClose={handleClose}
|
|
116
|
+
secondaryButton={{ onPress: handleViewAlerts, title: 'Ver alertas', variant: 'text' }}
|
|
117
|
+
title="Alerta de corte programado"
|
|
118
|
+
/>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Ícono vertical con botones debajo
|
|
122
|
+
|
|
123
|
+
```jsx
|
|
124
|
+
<UTBanner
|
|
125
|
+
button={{ onPress: handleAction, title: 'Acción', variant: 'filled' }}
|
|
126
|
+
buttonPlacement="vertical"
|
|
127
|
+
colorTheme="information"
|
|
128
|
+
icon={{ colorTheme: 'information', name: 'iconInfo' }}
|
|
129
|
+
iconPlacement="vertical"
|
|
130
|
+
title="Información importante"
|
|
131
|
+
/>
|
|
132
|
+
```
|
|
@@ -9,16 +9,28 @@ import { TEST_ID_CONSTANTS } from '../../constants/testIds';
|
|
|
9
9
|
|
|
10
10
|
import { propTypes } from './proptypes';
|
|
11
11
|
import { retrieveStyle } from './theme';
|
|
12
|
-
import { COLOR_THEMES, SIZES, VARIANTS } from './constants';
|
|
12
|
+
import { COLOR_THEMES, PLACEMENTS, SIZES, VARIANTS } from './constants';
|
|
13
13
|
|
|
14
|
-
const {
|
|
14
|
+
const {
|
|
15
|
+
close: closeTestId,
|
|
16
|
+
icon: iconTestId,
|
|
17
|
+
label: labelTestId,
|
|
18
|
+
secondaryAction: buttonTestId,
|
|
19
|
+
tertiaryAction: secondaryButtonTestId
|
|
20
|
+
} = TEST_ID_CONSTANTS;
|
|
15
21
|
|
|
16
22
|
const UTBanner = ({
|
|
17
23
|
button,
|
|
24
|
+
buttonPlacement = PLACEMENTS.HORIZONTAL,
|
|
25
|
+
category,
|
|
18
26
|
colorTheme = COLOR_THEMES.WHITE,
|
|
19
27
|
dataTestId,
|
|
20
28
|
description,
|
|
29
|
+
helpText,
|
|
21
30
|
icon,
|
|
31
|
+
iconPlacement = PLACEMENTS.HORIZONTAL,
|
|
32
|
+
onClose,
|
|
33
|
+
secondaryButton,
|
|
22
34
|
size = SIZES.MEDIUM,
|
|
23
35
|
style,
|
|
24
36
|
text,
|
|
@@ -30,62 +42,117 @@ const UTBanner = ({
|
|
|
30
42
|
|
|
31
43
|
const displayTitle = title || text; // Backwards compatibility
|
|
32
44
|
|
|
33
|
-
const {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
const {
|
|
46
|
+
bannerStyles,
|
|
47
|
+
buttonColorTheme,
|
|
48
|
+
buttonsContainerStyles,
|
|
49
|
+
categoryStyles,
|
|
50
|
+
closeButtonStyles,
|
|
51
|
+
contentStyles,
|
|
52
|
+
descriptionStyles,
|
|
53
|
+
helpTextStyles,
|
|
54
|
+
iconStyles,
|
|
55
|
+
iconTextStyles,
|
|
56
|
+
textContainerStyles,
|
|
57
|
+
titleStyles
|
|
58
|
+
} = retrieveStyle({
|
|
59
|
+
buttonPlacement,
|
|
60
|
+
colorTheme,
|
|
61
|
+
iconPlacement,
|
|
62
|
+
size,
|
|
63
|
+
style,
|
|
64
|
+
theme,
|
|
65
|
+
variant
|
|
66
|
+
});
|
|
41
67
|
|
|
42
68
|
return (
|
|
43
69
|
<View style={bannerStyles} testID={dataTestId}>
|
|
44
|
-
{
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
<View style={contentStyles}>
|
|
71
|
+
<View style={iconTextStyles}>
|
|
72
|
+
{!!icon && (
|
|
73
|
+
<UTIcon
|
|
74
|
+
colorTheme={iconStyles.defaultColorTheme}
|
|
75
|
+
shade={iconStyles.defaultShade}
|
|
76
|
+
size={iconStyles.size}
|
|
77
|
+
{...icon}
|
|
78
|
+
dataTestId={dataTestId ? `${dataTestId}.${iconTestId}` : undefined}
|
|
79
|
+
/>
|
|
80
|
+
)}
|
|
81
|
+
<View style={textContainerStyles}>
|
|
82
|
+
{!!category && (
|
|
83
|
+
<UTLabel
|
|
84
|
+
{...categoryStyles}
|
|
85
|
+
dataTestId={dataTestId ? `${dataTestId}.category.${labelTestId}` : undefined}
|
|
86
|
+
>
|
|
87
|
+
{category}
|
|
88
|
+
</UTLabel>
|
|
89
|
+
)}
|
|
90
|
+
{!!displayTitle && (
|
|
91
|
+
<UTLabel
|
|
92
|
+
{...titleStyles}
|
|
93
|
+
dataTestId={dataTestId ? `${dataTestId}.title.${labelTestId}` : undefined}
|
|
94
|
+
withMarkdown={withMarkdown}
|
|
95
|
+
>
|
|
96
|
+
{displayTitle}
|
|
97
|
+
</UTLabel>
|
|
98
|
+
)}
|
|
99
|
+
{!!description && (
|
|
100
|
+
<UTLabel
|
|
101
|
+
{...descriptionStyles}
|
|
102
|
+
dataTestId={dataTestId ? `${dataTestId}.description.${labelTestId}` : undefined}
|
|
103
|
+
withMarkdown={withMarkdown}
|
|
104
|
+
>
|
|
105
|
+
{description}
|
|
106
|
+
</UTLabel>
|
|
107
|
+
)}
|
|
108
|
+
{!!helpText && (
|
|
109
|
+
<UTLabel
|
|
110
|
+
{...helpTextStyles}
|
|
111
|
+
dataTestId={dataTestId ? `${dataTestId}.helpText.${labelTestId}` : undefined}
|
|
112
|
+
>
|
|
113
|
+
{helpText}
|
|
114
|
+
</UTLabel>
|
|
115
|
+
)}
|
|
116
|
+
</View>
|
|
117
|
+
</View>
|
|
118
|
+
{!!(button || secondaryButton) && (
|
|
119
|
+
<View style={buttonsContainerStyles}>
|
|
120
|
+
{!!button && (
|
|
121
|
+
<UTButton
|
|
122
|
+
colorTheme={buttonColorTheme.button}
|
|
123
|
+
{...button}
|
|
124
|
+
dataTestId={dataTestId ? `${dataTestId}.button.${buttonTestId}` : button.dataTestId}
|
|
125
|
+
>
|
|
126
|
+
{button.title}
|
|
127
|
+
</UTButton>
|
|
128
|
+
)}
|
|
129
|
+
{!!secondaryButton && (
|
|
130
|
+
<UTButton
|
|
131
|
+
colorTheme={buttonColorTheme.secondaryButton}
|
|
132
|
+
variant="text"
|
|
133
|
+
{...secondaryButton}
|
|
134
|
+
dataTestId={
|
|
135
|
+
dataTestId
|
|
136
|
+
? `${dataTestId}.secondaryButton.${secondaryButtonTestId}`
|
|
137
|
+
: secondaryButton.dataTestId
|
|
138
|
+
}
|
|
139
|
+
>
|
|
140
|
+
{secondaryButton.title}
|
|
141
|
+
</UTButton>
|
|
142
|
+
)}
|
|
143
|
+
</View>
|
|
76
144
|
)}
|
|
77
145
|
</View>
|
|
78
|
-
{
|
|
146
|
+
{!!onClose && (
|
|
79
147
|
<UTButton
|
|
80
|
-
colorTheme={
|
|
81
|
-
dataTestId={dataTestId ? `${dataTestId}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
</UTButton>
|
|
148
|
+
colorTheme={buttonColorTheme.onClose}
|
|
149
|
+
dataTestId={dataTestId ? `${dataTestId}.${closeTestId}` : undefined}
|
|
150
|
+
Icon="IconX"
|
|
151
|
+
onPress={onClose}
|
|
152
|
+
size="small"
|
|
153
|
+
style={closeButtonStyles}
|
|
154
|
+
variant="text"
|
|
155
|
+
/>
|
|
89
156
|
)}
|
|
90
157
|
</View>
|
|
91
158
|
);
|
|
@@ -1,20 +1,43 @@
|
|
|
1
|
-
import { bool, object, shape, string } from 'prop-types';
|
|
1
|
+
import { bool, elementType, func, number, object, shape, string } from 'prop-types';
|
|
2
|
+
|
|
3
|
+
const buttonShape = shape({
|
|
4
|
+
colorTheme: string,
|
|
5
|
+
count: number,
|
|
6
|
+
dataTestId: string,
|
|
7
|
+
disabled: bool,
|
|
8
|
+
Icon: elementType,
|
|
9
|
+
iconPlacement: string,
|
|
10
|
+
loading: bool,
|
|
11
|
+
onPress: func,
|
|
12
|
+
size: string,
|
|
13
|
+
style: object,
|
|
14
|
+
title: string,
|
|
15
|
+
variant: string
|
|
16
|
+
});
|
|
2
17
|
|
|
3
18
|
export const propTypes = {
|
|
19
|
+
button: buttonShape,
|
|
20
|
+
buttonPlacement: string,
|
|
21
|
+
category: string,
|
|
22
|
+
colorTheme: string,
|
|
23
|
+
dataTestId: string,
|
|
24
|
+
description: string,
|
|
25
|
+
helpText: string,
|
|
26
|
+
icon: shape({ colorTheme: string, name: string, shade: string }),
|
|
27
|
+
iconPlacement: string,
|
|
28
|
+
onClose: func,
|
|
29
|
+
secondaryButton: buttonShape,
|
|
30
|
+
size: string,
|
|
31
|
+
style: shape({
|
|
32
|
+
banner: object,
|
|
33
|
+
category: object,
|
|
34
|
+
description: object,
|
|
35
|
+
helpText: object,
|
|
36
|
+
title: object
|
|
37
|
+
}),
|
|
4
38
|
/** @deprecated Use `title` instead. Will be removed in next major version. */
|
|
5
39
|
text: string,
|
|
6
40
|
title: string,
|
|
7
|
-
description: string,
|
|
8
|
-
icon: shape({ name: string, colorTheme: string }),
|
|
9
|
-
size: string,
|
|
10
|
-
colorTheme: string,
|
|
11
41
|
variant: string,
|
|
12
|
-
withMarkdown: bool
|
|
13
|
-
dataTestId: string,
|
|
14
|
-
style: shape({
|
|
15
|
-
root: object,
|
|
16
|
-
icon: object,
|
|
17
|
-
title: object,
|
|
18
|
-
description: object
|
|
19
|
-
})
|
|
42
|
+
withMarkdown: bool
|
|
20
43
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COLOR_THEMES, SIZES, VARIANTS } from './constants';
|
|
1
|
+
import { COLOR_THEMES, PLACEMENTS, SIZES, VARIANTS } from './constants';
|
|
2
2
|
|
|
3
3
|
const getBannerBackgroundColor = (colorTheme, variant, theme) =>
|
|
4
4
|
({
|
|
@@ -50,7 +50,7 @@ const baseBannerTheme = (theme, colorTheme, variant) => ({
|
|
|
50
50
|
gap: 16
|
|
51
51
|
},
|
|
52
52
|
textContainer: {
|
|
53
|
-
|
|
53
|
+
flexShrink: 1,
|
|
54
54
|
gap: 8
|
|
55
55
|
}
|
|
56
56
|
});
|
|
@@ -63,11 +63,18 @@ const sizeBannerTheme = size => {
|
|
|
63
63
|
gap: 24
|
|
64
64
|
},
|
|
65
65
|
icon: {
|
|
66
|
-
size:
|
|
66
|
+
size: 24
|
|
67
67
|
},
|
|
68
68
|
title: {
|
|
69
69
|
variant: 'title3',
|
|
70
70
|
weight: 'medium'
|
|
71
|
+
},
|
|
72
|
+
category: {
|
|
73
|
+
variant: 'xsmall',
|
|
74
|
+
weight: 'medium'
|
|
75
|
+
},
|
|
76
|
+
helpText: {
|
|
77
|
+
variant: 'small'
|
|
71
78
|
}
|
|
72
79
|
},
|
|
73
80
|
medium: {
|
|
@@ -76,7 +83,7 @@ const sizeBannerTheme = size => {
|
|
|
76
83
|
gap: 16
|
|
77
84
|
},
|
|
78
85
|
icon: {
|
|
79
|
-
size:
|
|
86
|
+
size: 20
|
|
80
87
|
},
|
|
81
88
|
title: {
|
|
82
89
|
variant: 'subtitle1',
|
|
@@ -84,6 +91,13 @@ const sizeBannerTheme = size => {
|
|
|
84
91
|
},
|
|
85
92
|
description: {
|
|
86
93
|
variant: 'small'
|
|
94
|
+
},
|
|
95
|
+
category: {
|
|
96
|
+
variant: 'xsmall',
|
|
97
|
+
weight: 'medium'
|
|
98
|
+
},
|
|
99
|
+
helpText: {
|
|
100
|
+
variant: 'small'
|
|
87
101
|
}
|
|
88
102
|
},
|
|
89
103
|
small: {
|
|
@@ -93,7 +107,7 @@ const sizeBannerTheme = size => {
|
|
|
93
107
|
gap: 8
|
|
94
108
|
},
|
|
95
109
|
icon: {
|
|
96
|
-
size:
|
|
110
|
+
size: 20
|
|
97
111
|
},
|
|
98
112
|
title: {
|
|
99
113
|
variant: 'small',
|
|
@@ -101,6 +115,13 @@ const sizeBannerTheme = size => {
|
|
|
101
115
|
},
|
|
102
116
|
description: {
|
|
103
117
|
variant: 'small'
|
|
118
|
+
},
|
|
119
|
+
category: {
|
|
120
|
+
variant: 'xsmall',
|
|
121
|
+
weight: 'medium'
|
|
122
|
+
},
|
|
123
|
+
helpText: {
|
|
124
|
+
variant: 'small'
|
|
104
125
|
}
|
|
105
126
|
}
|
|
106
127
|
};
|
|
@@ -108,10 +129,77 @@ const sizeBannerTheme = size => {
|
|
|
108
129
|
return definition[size] || definition[SIZES.MEDIUM];
|
|
109
130
|
};
|
|
110
131
|
|
|
111
|
-
export const
|
|
132
|
+
export const getDefaultIconTheme = (colorTheme, variant) => {
|
|
133
|
+
if (variant === VARIANTS.DARK) {
|
|
134
|
+
return colorTheme === COLOR_THEMES.NEGATIVE
|
|
135
|
+
? { colorTheme: 'dark', shade: '05' }
|
|
136
|
+
: { colorTheme: 'light', shade: '01' };
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return (
|
|
140
|
+
{
|
|
141
|
+
[COLOR_THEMES.NEGATIVE]: { colorTheme: 'light', shade: '01' },
|
|
142
|
+
[COLOR_THEMES.WHITE]: { colorTheme: 'accent', shade: '04' },
|
|
143
|
+
[COLOR_THEMES.PRIMARY]: { colorTheme: 'accent', shade: '04' },
|
|
144
|
+
[COLOR_THEMES.GRAY]: { colorTheme: 'accent', shade: '04' },
|
|
145
|
+
[COLOR_THEMES.WARNING]: { colorTheme: 'warning', shade: '04' },
|
|
146
|
+
[COLOR_THEMES.SUCCESS]: { colorTheme: 'success', shade: '04' },
|
|
147
|
+
[COLOR_THEMES.ERROR]: { colorTheme: 'error', shade: '04' },
|
|
148
|
+
[COLOR_THEMES.INFORMATION]: { colorTheme: 'information', shade: '04' }
|
|
149
|
+
}[colorTheme] ?? { colorTheme: 'accent', shade: '04' }
|
|
150
|
+
);
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export const getDefaultButtonColorTheme = variant => {
|
|
154
|
+
const isDark = variant === VARIANTS.DARK;
|
|
155
|
+
return {
|
|
156
|
+
button: isDark ? 'negative' : 'secondary',
|
|
157
|
+
onClose: isDark ? 'negative' : 'gray',
|
|
158
|
+
secondaryButton: isDark ? 'negative' : 'secondary'
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
export const getPlacementStyles = (iconPlacement, buttonPlacement, gap = 16) => {
|
|
163
|
+
const isVerticalButton = buttonPlacement === PLACEMENTS.VERTICAL;
|
|
164
|
+
const isVerticalIcon = iconPlacement === PLACEMENTS.VERTICAL;
|
|
165
|
+
|
|
166
|
+
return {
|
|
167
|
+
content: {
|
|
168
|
+
flex: 1,
|
|
169
|
+
flexDirection: isVerticalButton ? 'column' : 'row',
|
|
170
|
+
...(isVerticalButton ? {} : { alignItems: 'flex-start' }),
|
|
171
|
+
gap
|
|
172
|
+
},
|
|
173
|
+
iconText: {
|
|
174
|
+
...(!isVerticalButton && { flex: 1 }),
|
|
175
|
+
flexDirection: isVerticalIcon ? 'column' : 'row',
|
|
176
|
+
...(isVerticalIcon ? {} : { alignItems: 'flex-start' }),
|
|
177
|
+
flexShrink: 1,
|
|
178
|
+
gap: 12
|
|
179
|
+
},
|
|
180
|
+
buttonsContainer: {
|
|
181
|
+
flexDirection: 'row',
|
|
182
|
+
flexWrap: 'wrap',
|
|
183
|
+
gap: 8,
|
|
184
|
+
...(isVerticalButton && { alignSelf: 'flex-start' })
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
export const retrieveStyle = ({
|
|
190
|
+
buttonPlacement,
|
|
191
|
+
colorTheme,
|
|
192
|
+
iconPlacement,
|
|
193
|
+
size,
|
|
194
|
+
style = {},
|
|
195
|
+
theme,
|
|
196
|
+
variant
|
|
197
|
+
}) => {
|
|
112
198
|
const baseTheme = baseBannerTheme(theme, colorTheme, variant);
|
|
113
199
|
const sizeTheme = sizeBannerTheme(size);
|
|
114
200
|
const labelColorTheme = getLabelColorTheme(colorTheme, variant);
|
|
201
|
+
const sizeGap = sizeTheme.banner?.gap ?? 16;
|
|
202
|
+
const placementStyles = getPlacementStyles(iconPlacement, buttonPlacement, sizeGap);
|
|
115
203
|
|
|
116
204
|
const bannerStyles = {
|
|
117
205
|
...baseTheme.banner,
|
|
@@ -119,10 +207,32 @@ export const retrieveStyle = ({ style = {}, size, theme, colorTheme, variant })
|
|
|
119
207
|
...style.banner
|
|
120
208
|
};
|
|
121
209
|
|
|
210
|
+
const contentStyles = placementStyles.content;
|
|
211
|
+
|
|
212
|
+
const iconTextStyles = placementStyles.iconText;
|
|
213
|
+
|
|
214
|
+
const defaultIconTheme = getDefaultIconTheme(colorTheme, variant);
|
|
215
|
+
const buttonColorTheme = getDefaultButtonColorTheme(variant);
|
|
216
|
+
|
|
122
217
|
const iconStyles = {
|
|
218
|
+
defaultColorTheme: defaultIconTheme.colorTheme,
|
|
219
|
+
defaultShade: defaultIconTheme.shade,
|
|
123
220
|
size: sizeTheme.icon?.size
|
|
124
221
|
};
|
|
125
222
|
|
|
223
|
+
const textContainerStyles = {
|
|
224
|
+
...baseTheme.textContainer,
|
|
225
|
+
...sizeTheme.textContainer,
|
|
226
|
+
...(iconPlacement !== PLACEMENTS.VERTICAL && { flex: 1 })
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
const categoryStyles = {
|
|
230
|
+
colorTheme: labelColorTheme,
|
|
231
|
+
variant: sizeTheme.category?.variant,
|
|
232
|
+
weight: sizeTheme.category?.weight,
|
|
233
|
+
style: style.category
|
|
234
|
+
};
|
|
235
|
+
|
|
126
236
|
const titleStyles = {
|
|
127
237
|
colorTheme: labelColorTheme,
|
|
128
238
|
variant: sizeTheme.title?.variant,
|
|
@@ -137,16 +247,32 @@ export const retrieveStyle = ({ style = {}, size, theme, colorTheme, variant })
|
|
|
137
247
|
style: style.description
|
|
138
248
|
};
|
|
139
249
|
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
|
|
250
|
+
const helpTextStyles = {
|
|
251
|
+
colorTheme: labelColorTheme,
|
|
252
|
+
variant: sizeTheme.helpText?.variant,
|
|
253
|
+
style: style.helpText
|
|
143
254
|
};
|
|
144
255
|
|
|
145
|
-
const
|
|
256
|
+
const buttonsContainerStyles = placementStyles.buttonsContainer;
|
|
257
|
+
|
|
258
|
+
const closeButtonStyles = {
|
|
146
259
|
root: {
|
|
147
260
|
alignSelf: 'flex-start'
|
|
148
261
|
}
|
|
149
262
|
};
|
|
150
263
|
|
|
151
|
-
return {
|
|
264
|
+
return {
|
|
265
|
+
bannerStyles,
|
|
266
|
+
buttonColorTheme,
|
|
267
|
+
buttonsContainerStyles,
|
|
268
|
+
categoryStyles,
|
|
269
|
+
closeButtonStyles,
|
|
270
|
+
contentStyles,
|
|
271
|
+
descriptionStyles,
|
|
272
|
+
helpTextStyles,
|
|
273
|
+
iconStyles,
|
|
274
|
+
iconTextStyles,
|
|
275
|
+
textContainerStyles,
|
|
276
|
+
titleStyles
|
|
277
|
+
};
|
|
152
278
|
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="20" height="20" stroke="none" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.1717 4.39056L13.9953 5.81702C14.0011 5.82698 14.0066 5.83701 14.0119 5.84711H16.772C18.0948 5.84711 19.1671 6.91943 19.1671 8.24222V13.3546C19.1671 14.6774 18.0948 15.7497 16.772 15.7497H8.36524L8.34142 15.7496L7.09856 16.4671C5.90521 17.1561 4.33328 16.8323 3.6262 15.6076L1.15543 11.3282C0.448341 10.1035 0.953913 8.5802 2.14727 7.89124L9.69933 3.53105C10.8926 2.84209 12.4646 3.16583 13.1717 4.39056ZM11.7283 5.22388L12.0882 5.84711H9.02114L9.55456 5.53914L10.5327 4.97442C10.8494 4.79156 11.1852 4.80744 11.434 4.94235C11.5583 5.00978 11.6608 5.10694 11.7283 5.22388ZM2.9806 9.33461L6.07169 7.54997C6.00564 7.76912 5.97013 8.00152 5.97013 8.24222V13.3546C5.97013 13.9334 6.17545 14.4642 6.51721 14.8783L6.26524 15.0238C5.79023 15.298 5.2722 15.1252 5.06957 14.7743L2.5988 10.4948C2.39617 10.1439 2.5056 9.60884 2.9806 9.33461ZM8.36524 7.51377C7.96293 7.51377 7.6368 7.83991 7.6368 8.24222V8.62705H17.5004V8.24222C17.5004 7.83991 17.1743 7.51377 16.772 7.51377H8.36524ZM17.5004 10.2937H7.6368V13.3546C7.6368 13.7569 7.96293 14.083 8.36524 14.083H16.772C17.1743 14.083 17.5004 13.7569 17.5004 13.3546V10.2937Z"/>
|
|
3
|
+
</svg>
|
|
@@ -39,6 +39,7 @@ import EnergyIconTruck from './components/EnergyIcons/EnergyIconTruck.svg';
|
|
|
39
39
|
import EnergyIconMeterPlus from './components/EnergyIcons/EnergyIconMeterPlus.svg';
|
|
40
40
|
import EnergyIconMeterPlusFilled from './components/EnergyIcons/EnergyIconMeterPlusFilled.svg';
|
|
41
41
|
import EnergyIconChatSparkFilled from './components/EnergyIcons/EnergyIconChatSparkFilled.svg';
|
|
42
|
+
import EnergyIconCreditCardsFilled from './components/EnergyIcons/EnergyIconCreditCardsFilled.svg';
|
|
42
43
|
|
|
43
44
|
export const DEFAULT_PROPS = {
|
|
44
45
|
color: COLOR_THEMES.dark
|
|
@@ -69,6 +70,7 @@ export const ENERGY_ICONS = {
|
|
|
69
70
|
EnergyIconChatSparkFilled,
|
|
70
71
|
EnergyIconCheckCircle,
|
|
71
72
|
EnergyIconConsumption,
|
|
73
|
+
EnergyIconCreditCardsFilled,
|
|
72
74
|
EnergyIconDelete,
|
|
73
75
|
EnergyIconDeleteOutline,
|
|
74
76
|
EnergyIconDeleteVariant,
|
package/package.json
CHANGED