@widergy/energy-ui 3.148.0 → 3.150.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 CHANGED
@@ -1,3 +1,17 @@
1
+ # [3.150.0](https://github.com/widergy/energy-ui/compare/v3.149.0...v3.150.0) (2026-05-08)
2
+
3
+
4
+ ### Features
5
+
6
+ * [CX-2272] extend UTCarousel and UTLabel for custom slide content ([#790](https://github.com/widergy/energy-ui/issues/790)) ([244111f](https://github.com/widergy/energy-ui/commit/244111fc15e0186aa52794434b74982d2e145a97))
7
+
8
+ # [3.149.0](https://github.com/widergy/energy-ui/compare/v3.148.0...v3.149.0) (2026-05-08)
9
+
10
+
11
+ ### Features
12
+
13
+ * [BRILLA-374] utstatus truncate and xl size ([#791](https://github.com/widergy/energy-ui/issues/791)) ([d94861a](https://github.com/widergy/energy-ui/commit/d94861a54defacd18df28d96f3065c954dcf21ee))
14
+
1
15
  # [3.148.0](https://github.com/widergy/energy-ui/compare/v3.147.0...v3.148.0) (2026-05-05)
2
16
 
3
17
 
@@ -0,0 +1,65 @@
1
+ # UTCarousel
2
+
3
+ Carousel de imágenes con soporte para autoplay, swipe táctil, flechas de navegación y puntos indicadores. Cada slide puede renderizar una imagen de fondo o contenido React custom.
4
+
5
+ ## Props
6
+
7
+ | Prop | Tipo | Default | Descripción |
8
+ |---|---|---|---|
9
+ | `imgArray` | `array` | — | Array de slides. Ver estructura abajo. |
10
+ | `autoPlay` | `bool` | `false` | Activa el avance automático entre slides. |
11
+ | `autoPlayDelay` | `number` | `2000` | Milisegundos entre slides en autoplay. |
12
+ | `height` | `string` | valor SCSS | Altura del carousel (ej. `'200px'`, `'var(--carousel-banner-height)'`). |
13
+ | `legend` | `shape` | — | Configuración de puntos indicadores. `{ position: 'inside' \| 'outside' }`. Si no se pasa, no se muestran puntos. |
14
+ | `arrow` | `shape` | — | Configuración de flechas. `{ position: 'inside' \| 'outside', arrowCustomLeft, arrowCustomRight, callbackLeft, callbackRight }`. |
15
+ | `activeEvents` | `bool` | — | Habilita/deshabilita eventos de puntero. |
16
+ | `borderSize` | `number` | — | Tamaño del borde entre slides. |
17
+ | `className` | `string` | — | Clase CSS adicional para el contenedor. |
18
+ | `classes` | `object` | — | Override de clases CSS internas (ej. `{ image: 'miClase' }`). |
19
+
20
+ ### Estructura de `imgArray`
21
+
22
+ ```js
23
+ [
24
+ {
25
+ id: 1, // recomendado para keys estables
26
+ imgSrc: '...', // URL de imagen de fondo (cuando no se usa renderContent)
27
+ onClick: fn, // handler de click (cuando no se usa renderContent)
28
+ renderContent: <MiComponente /> // contenido React custom (reemplaza imgSrc)
29
+ }
30
+ ]
31
+ ```
32
+
33
+ Cuando se provee `renderContent`, el slide renderiza ese nodo directamente en lugar de la imagen de fondo. El componente pasado es responsable de manejar su propio click y dimensiones.
34
+
35
+ ## Uso básico — imágenes
36
+
37
+ ```jsx
38
+ <UTCarousel
39
+ imgArray={[
40
+ { imgSrc: '/banner1.jpg', onClick: () => navigate('/promo1') },
41
+ { imgSrc: '/banner2.jpg', onClick: () => navigate('/promo2') }
42
+ ]}
43
+ autoPlay
44
+ autoPlayDelay={5000}
45
+ height="200px"
46
+ />
47
+ ```
48
+
49
+ ## Uso con contenido custom
50
+
51
+ ```jsx
52
+ <UTCarousel
53
+ imgArray={[
54
+ { id: 1, renderContent: <BannerItem item={item1} onClick={fn1} /> },
55
+ { id: 2, renderContent: <BannerItem item={item2} onClick={fn2} /> }
56
+ ]}
57
+ autoPlay
58
+ autoPlayDelay={7000}
59
+ height="var(--carousel-banner-height)"
60
+ />
61
+ ```
62
+
63
+ ## Sin puntos indicadores
64
+
65
+ No pasar la prop `legend` para ocultar los dots.
@@ -20,6 +20,7 @@ const LegendContainer = _ref => {
20
20
  const handleOnClick = () => onClick(index + 1);
21
21
  const isActive = currentSlide === index;
22
22
  return LegendCustom ? /*#__PURE__*/_react.default.createElement(LegendCustom, {
23
+ isActive: isActive,
23
24
  onClick: handleOnClick
24
25
  }) : /*#__PURE__*/_react.default.createElement(_UTTouchableWithoutFeedback.default, {
25
26
  className: classes.legendStyleTouchable,
@@ -19,17 +19,26 @@ const Slide = _ref => {
19
19
  imgSrc,
20
20
  onClick,
21
21
  position,
22
+ renderContent,
22
23
  shouldAnimate,
23
24
  widthContainer
24
25
  } = _ref;
25
26
  const slide = currentSlide === position ? border / 2 : currentSlide === position - 1 ? -border / 4 : currentSlide === position + 1 && border + border / 4;
27
+ const containerStyle = {
28
+ left: position * (slide ? widthContainer + slide : widthContainer),
29
+ width: "".concat(border ? widthContainer - border : widthContainer, "px"),
30
+ transition: "".concat(shouldAnimate ? "left ".concat(animationTime, "s linear 0s") : 'none')
31
+ };
32
+ if (renderContent) {
33
+ return /*#__PURE__*/_react.default.createElement("div", {
34
+ className: _stylesModule.default.imageContainer,
35
+ style: containerStyle,
36
+ draggable: "false"
37
+ }, renderContent);
38
+ }
26
39
  return /*#__PURE__*/_react.default.createElement(_UTTouchableWithoutFeedback.default, {
27
40
  className: "".concat(_stylesModule.default.imageContainer),
28
- style: {
29
- left: position * (slide ? widthContainer + slide : widthContainer),
30
- width: "".concat(border ? widthContainer - border : widthContainer, "px"),
31
- transition: "".concat(shouldAnimate ? "left ".concat(animationTime, "s linear 0s") : 'none')
32
- },
41
+ style: containerStyle,
33
42
  draggable: "false",
34
43
  onClick: onClick
35
44
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -48,6 +57,7 @@ Slide.propTypes = {
48
57
  imgSrc: _propTypes.string,
49
58
  onClick: _propTypes.func,
50
59
  position: _propTypes.number,
60
+ renderContent: _propTypes.node,
51
61
  shouldAnimate: _propTypes.bool,
52
62
  widthContainer: _propTypes.number
53
63
  };
@@ -56,10 +56,16 @@ class Slider extends _react.PureComponent {
56
56
  key: "slide-".concat(slide.id || slide.imgSrc),
57
57
  onClick: slide.onClick,
58
58
  position: _index - 1,
59
+ renderContent: slide.renderContent,
59
60
  shouldAnimate: shouldAnimate,
60
61
  widthContainer: containerWidth
61
62
  }))), legend && legend.position === _constants.INSIDE && /*#__PURE__*/_react.default.createElement("div", {
62
- className: _stylesModule.default.legendContainer
63
+ className: _stylesModule.default.legendContainer,
64
+ style: {
65
+ justifyContent: legend.align || 'center',
66
+ paddingBottom: legend.paddingBottom,
67
+ paddingLeft: legend.paddingLeft
68
+ }
63
69
  }, /*#__PURE__*/_react.default.createElement("div", {
64
70
  className: _stylesModule.default.legend
65
71
  }, slides.map((slide, itemIndex) => /*#__PURE__*/_react.default.createElement(_Legend.default, {
@@ -46,11 +46,16 @@ UTCarousel.propTypes = {
46
46
  callbackRight: _propTypes.func
47
47
  }),
48
48
  legend: (0, _propTypes.shape)({
49
- position: _propTypes.string,
50
- legendCustom: _propTypes.node
49
+ align: _propTypes.string,
50
+ legendCustom: _propTypes.func,
51
+ paddingBottom: _propTypes.string,
52
+ paddingLeft: _propTypes.string,
53
+ position: _propTypes.string
51
54
  }),
52
55
  imgArray: (0, _propTypes.arrayOf)((0, _propTypes.shape)({
53
- imgSrc: _propTypes.string
56
+ id: (0, _propTypes.oneOfType)([_propTypes.number, _propTypes.string]),
57
+ imgSrc: _propTypes.string,
58
+ renderContent: _propTypes.node
54
59
  })),
55
60
  borderSize: _propTypes.number,
56
61
  autoPlay: _propTypes.bool,
@@ -25,6 +25,7 @@ const UTLabel = _ref => {
25
25
  dataTestId,
26
26
  markdownExtended,
27
27
  markdownRenderers,
28
+ style,
28
29
  title,
29
30
  variant,
30
31
  withMarkdown
@@ -38,6 +39,7 @@ const UTLabel = _ref => {
38
39
  return /*#__PURE__*/_react.default.createElement(_UTSkeleton.default, null, /*#__PURE__*/_react.default.createElement(Component, {
39
40
  className: componentClassname.trim(),
40
41
  "data-testid": dataTestId,
42
+ style: style,
41
43
  title: title
42
44
  }, withMarkdown && /*#__PURE__*/_react.default.createElement(_Markdown.default, {
43
45
  classes: classes,
@@ -53,6 +55,7 @@ UTLabel.propTypes = {
53
55
  dataTestId: _propTypes.string,
54
56
  markdownExtended: _propTypes.bool,
55
57
  markdownRenderers: (0, _propTypes.objectOf)(_propTypes.func),
58
+ style: _propTypes.object,
56
59
  title: _propTypes.string,
57
60
  variant: _propTypes.string,
58
61
  withMarkdown: _propTypes.bool
@@ -11,6 +11,7 @@ const SIZES = exports.SIZES = {
11
11
  large: 'large',
12
12
  medium: 'medium',
13
13
  small: 'small',
14
+ xlarge: 'xlarge',
14
15
  xsmall: 'xsmall'
15
16
  };
16
17
  const VARIANTS = exports.VARIANTS = {
@@ -14,6 +14,7 @@ var _UTTooltip = _interopRequireDefault(require("../UTTooltip"));
14
14
  var _theme = require("./theme");
15
15
  var _constants = require("./constants");
16
16
  var _utils = require("./utils");
17
+ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
17
18
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
19
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
19
20
  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); }
@@ -31,6 +32,7 @@ const UTStatus = _ref => {
31
32
  title,
32
33
  tooltip,
33
34
  tooltipProps = {},
35
+ truncate,
34
36
  type = _constants.DEFAULT_PROPS.type,
35
37
  variant = _constants.DEFAULT_PROPS.variant,
36
38
  weight = _constants.DEFAULT_PROPS.weight,
@@ -103,10 +105,10 @@ const UTStatus = _ref => {
103
105
  })) : null;
104
106
  }, [adornments, size, variant]);
105
107
  const StatusRender = /*#__PURE__*/_react.default.createElement("div", {
106
- className: "".concat(classes.root, " ").concat(className || '', " ").concat(area ? '' : classes.withoutArea, " ").concat(areaType === _constants.AREA_TYPES.SQUARE ? '' : classes.roundedArea),
108
+ className: "".concat(classes.root, " ").concat(truncate ? _stylesModule.default.truncated : '', " ").concat(className || '', " ").concat(area ? '' : classes.withoutArea, " ").concat(areaType === _constants.AREA_TYPES.SQUARE ? '' : classes.roundedArea),
107
109
  title: title
108
110
  }, useValidAdornments && leftAdornments.map(renderAdornment), withoutIcon || useValidAdornments ? null : /*#__PURE__*/_react.default.createElement(IconComponent, iconProps), /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
109
- className: classes.label,
111
+ className: "".concat(classes.label, " ").concat(truncate ? _stylesModule.default.truncatedLabel : ''),
110
112
  colorTheme: colorTheme,
111
113
  shade: type !== _constants.TYPES.negative ? '05' : undefined,
112
114
  dataTestId: labelDataTestId,
@@ -139,6 +141,7 @@ UTStatus.propTypes = {
139
141
  title: _propTypes.string,
140
142
  tooltip: (0, _propTypes.oneOfType)([_propTypes.string, _propTypes.element]),
141
143
  tooltipProps: _propTypes.object,
144
+ truncate: _propTypes.bool,
142
145
  type: _propTypes.string,
143
146
  variant: _propTypes.string,
144
147
  weight: _propTypes.string,
@@ -0,0 +1,13 @@
1
+ .truncated {
2
+ box-sizing: border-box;
3
+ overflow: hidden;
4
+ width: 100%;
5
+ }
6
+
7
+ .truncatedLabel {
8
+ flex: 1;
9
+ min-width: 0;
10
+ overflow: hidden;
11
+ text-overflow: ellipsis;
12
+ white-space: nowrap;
13
+ }
@@ -34,6 +34,7 @@ const getGridGap = _ref3 => {
34
34
  [_constants.SIZES.large]: 'var(--UT-status-gap-large, 8px)',
35
35
  [_constants.SIZES.medium]: 'var(--UT-status-gap-medium, 8px)',
36
36
  [_constants.SIZES.small]: 'var(--UT-status-gap-small, 4px)',
37
+ [_constants.SIZES.xlarge]: 'var(--UT-status-gap-xlarge, 8px)',
37
38
  [_constants.SIZES.xsmall]: 'var(--UT-status-gap-xsmall, 4px)'
38
39
  }[size];
39
40
  };
@@ -45,6 +46,7 @@ const getPadding = _ref4 => {
45
46
  [_constants.SIZES.large]: 'var(--UT-status-padding-y-large, 4px) var(--UT-status-padding-x-large, 8px)',
46
47
  [_constants.SIZES.medium]: 'var(--UT-status-padding-y-medium, 4px) var(--UT-status-padding-x-medium, 8px)',
47
48
  [_constants.SIZES.small]: 'var(--UT-status-padding-y-small, 4px) var(--UT-status-padding-x-small, 8px)',
49
+ [_constants.SIZES.xlarge]: 'var(--UT-status-padding-y-xlarge, 4px) var(--UT-status-padding-x-xlarge, 8px)',
48
50
  [_constants.SIZES.xsmall]: 'var(--UT-status-padding-y-xsmall, 2px) var(--UT-status-padding-x-xsmall, 4px)'
49
51
  }[size];
50
52
  };
@@ -56,6 +58,7 @@ const getLabelVariant = _ref5 => {
56
58
  [_constants.SIZES.large]: 'body',
57
59
  [_constants.SIZES.medium]: 'small',
58
60
  [_constants.SIZES.small]: 'xsmall',
61
+ [_constants.SIZES.xlarge]: 'body',
59
62
  [_constants.SIZES.xsmall]: 'xsmall'
60
63
  }[size];
61
64
  };
@@ -68,6 +71,7 @@ const getIconSize = _ref6 => {
68
71
  [_constants.SIZES.large]: 'var(--UT-status-icon-size-xs, 20px)',
69
72
  [_constants.SIZES.medium]: 'var(--UT-status-icon-size-2xs, 16px)',
70
73
  [_constants.SIZES.small]: 'var(--UT-status-icon-size-3xs, 12px)',
74
+ [_constants.SIZES.xlarge]: 'var(--UT-status-icon-size-xs, 20px)',
71
75
  [_constants.SIZES.xsmall]: 'var(--UT-status-icon-size-3xs, 12px)'
72
76
  }[size];
73
77
  };
@@ -180,6 +184,10 @@ const retrieveStyle = _ref8 => {
180
184
  height: '8px',
181
185
  width: '8px'
182
186
  },
187
+ iconXlarge: {
188
+ height: '20px',
189
+ width: '20px'
190
+ },
183
191
  badgeSmall: {
184
192
  height: '8px',
185
193
  width: '8px'
@@ -192,6 +200,10 @@ const retrieveStyle = _ref8 => {
192
200
  height: '10px',
193
201
  width: '10px'
194
202
  },
203
+ badgeXlarge: {
204
+ height: '10px',
205
+ width: '10px'
206
+ },
195
207
  withoutArea: {
196
208
  backgroundColor: 'transparent !important'
197
209
  },
@@ -47,23 +47,27 @@ const interpreterSize = (size, classes) => {
47
47
  iconSmall,
48
48
  iconMedium,
49
49
  iconLarge,
50
+ iconXlarge,
50
51
  badgeXsmall,
51
52
  badgeSmall,
52
53
  badgeMedium,
53
- badgeLarge
54
+ badgeLarge,
55
+ badgeXlarge
54
56
  } = classes || {};
55
57
  return {
56
58
  [_constants.COMPONENT_KEYS.BADGE]: {
57
59
  [_constants.SIZES.xsmall]: badgeXsmall,
58
60
  [_constants.SIZES.small]: badgeSmall,
59
61
  [_constants.SIZES.medium]: badgeMedium,
60
- [_constants.SIZES.large]: badgeLarge
62
+ [_constants.SIZES.large]: badgeLarge,
63
+ [_constants.SIZES.xlarge]: badgeXlarge
61
64
  }[size],
62
65
  [_constants.COMPONENT_KEYS.ICON]: {
63
66
  [_constants.SIZES.xsmall]: iconXsmall,
64
67
  [_constants.SIZES.small]: iconSmall,
65
68
  [_constants.SIZES.medium]: iconMedium,
66
- [_constants.SIZES.large]: iconLarge
69
+ [_constants.SIZES.large]: iconLarge,
70
+ [_constants.SIZES.xlarge]: iconXlarge
67
71
  }[size]
68
72
  };
69
73
  };
@@ -243,6 +243,7 @@ const baseTokens = exports.baseTokens = {
243
243
  'UT-status-gap-large': 'gap-sm',
244
244
  'UT-status-gap-medium': 'gap-sm',
245
245
  'UT-status-gap-small': 'gap-xs',
246
+ 'UT-status-gap-xlarge': 'gap-sm',
246
247
  'UT-status-gap-xsmall': 'gap-xs',
247
248
  'UT-status-padding-y-large': 'padding-2xs',
248
249
  'UT-status-padding-x-large': 'padding-xs',
@@ -250,6 +251,8 @@ const baseTokens = exports.baseTokens = {
250
251
  'UT-status-padding-x-medium': 'padding-xs',
251
252
  'UT-status-padding-y-small': 'padding-2xs',
252
253
  'UT-status-padding-x-small': 'padding-xs',
254
+ 'UT-status-padding-y-xlarge': 'padding-2xs',
255
+ 'UT-status-padding-x-xlarge': 'padding-xs',
253
256
  'UT-status-padding-y-xsmall': 'padding-3xs',
254
257
  'UT-status-padding-x-xsmall': 'padding-2xs',
255
258
  'UT-status-radius': 'radius-sm',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widergy/energy-ui",
3
- "version": "3.148.0",
3
+ "version": "3.150.0",
4
4
  "description": "Widergy Web Components",
5
5
  "author": "widergy",
6
6
  "license": "MIT",