@widergy/energy-ui 3.170.0 → 3.171.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,10 @@
1
+ # [3.171.0](https://github.com/widergy/energy-ui/compare/v3.170.0...v3.171.0) (2026-06-22)
2
+
3
+
4
+ ### Features
5
+
6
+ * disabled prop in sidebar utpanel ([#826](https://github.com/widergy/energy-ui/issues/826)) ([f7ce127](https://github.com/widergy/energy-ui/commit/f7ce127d78e5c49d0a8b9a80eae8d2dae02c381d))
7
+
1
8
  # [3.170.0](https://github.com/widergy/energy-ui/compare/v3.169.0...v3.170.0) (2026-06-22)
2
9
 
3
10
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = exports.V1Workflow = exports.V1WithStatus = exports.V1WithPretitle = exports.V1WithPagination = exports.V1WithHeaderItems = exports.V1WithAdditionalContentBadge = exports.V1WithAdditionalContent = exports.V1WithActions = exports.V1LargeSize = exports.V1Inline = exports.V1Default = exports.V1Collapsible = exports.V0WithCustomTitle = exports.V0LeftSide = exports.V0Default = exports.Playground = void 0;
6
+ exports.default = exports.V1Workflow = exports.V1WithStatus = exports.V1WithPretitle = exports.V1WithPagination = exports.V1WithHeaderItems = exports.V1WithAdditionalContentDisabled = exports.V1WithAdditionalContentBadge = exports.V1WithAdditionalContent = exports.V1WithActions = exports.V1LargeSize = exports.V1Inline = exports.V1Default = exports.V1Collapsible = exports.V0WithCustomTitle = exports.V0LeftSide = exports.V0Default = exports.Playground = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _utils = require("stories/utils");
9
9
  var _UTLabel = _interopRequireDefault(require("../UTLabel"));
@@ -945,6 +945,54 @@ const V1WithAdditionalContentBadge = exports.V1WithAdditionalContentBadge = {
945
945
  }
946
946
  }
947
947
  };
948
+ const V1WithAdditionalContentDisabled = exports.V1WithAdditionalContentDisabled = {
949
+ args: {
950
+ version: 'V1',
951
+ open: false,
952
+ title: 'Panel con Item Deshabilitado',
953
+ subtitle: 'Sidebar con un ítem inaccesible',
954
+ panelSide: 'right',
955
+ size: 'M',
956
+ additionalContent: [{
957
+ id: 'settings',
958
+ Icon: 'IconSettings',
959
+ BodyComponent: SettingsBodyComponent,
960
+ tooltipProps: {
961
+ content: 'Configuración'
962
+ }
963
+ }, {
964
+ id: 'notifications',
965
+ Icon: 'IconBell',
966
+ disabled: true,
967
+ BodyComponent: NotificationsBodyComponent,
968
+ tooltipProps: {
969
+ content: 'Notificaciones (no disponible)'
970
+ }
971
+ }, {
972
+ id: 'help',
973
+ Icon: 'IconHelpCircle',
974
+ BodyComponent: HelpBodyComponent,
975
+ tooltipProps: {
976
+ content: 'Ayuda'
977
+ }
978
+ }],
979
+ children: /*#__PURE__*/_react.default.createElement("div", {
980
+ style: {
981
+ padding: '16px'
982
+ }
983
+ }, /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
984
+ variant: "body1"
985
+ }, "El \xEDcono de Notificaciones tiene ", /*#__PURE__*/_react.default.createElement("code", null, "disabled: true"), " y no puede seleccionarse."))
986
+ },
987
+ name: 'V1 - Sidebar con Item Deshabilitado',
988
+ parameters: {
989
+ docs: {
990
+ description: {
991
+ story: 'Usa `disabled: true` en un item de `additionalContent` para deshabilitar el botón de ese item en la sidebar. Los demás items funcionan normalmente.'
992
+ }
993
+ }
994
+ }
995
+ };
948
996
  const Playground = exports.Playground = {
949
997
  args: {
950
998
  version: 'V1',
@@ -44,3 +44,17 @@ Component used for displaying a side panel.
44
44
  | showBackButton | boolean | false | Shows a go back arrow button |
45
45
  | showTag | bool | false | Shows a tag indicator in the header area. When true, the tagProps object is passed to the UTStatus component to render a tag. |
46
46
  | tagProps | object | {} | Object containing props for the UTStatus component used as a tag in the header. Supports all [UTStatus props](https://github.com/widergy/Energy-UI/tree/master/src/lib/components/UTStatus) |
47
+ | additionalContent | array | | Array of sidebar items rendered in a collapsible side panel. See structure below. |
48
+
49
+ ### `additionalContent` item structure
50
+
51
+ Each object in the array can contain:
52
+
53
+ | Field | Type | Required | Description |
54
+ | :-------------- | ------------- | -------- | ------------------------------------------------------------------------------------------------ |
55
+ | `id` | `string` | ✅ | Unique identifier for the item. Used as the active key and as part of the sidebar button testId. |
56
+ | `Icon` | `string` | ✅ | Tabler icon name for the sidebar button (e.g. `'IconSettings'`). |
57
+ | `BodyComponent` | `elementType` | ✅ | React component rendered in the expanded content area when this item is active. |
58
+ | `tooltipProps` | `object` | ✅ | Props passed to the `UTTooltip` wrapping the sidebar button. Must include `content`. |
59
+ | `count` | `number` | — | When greater than 0, shows a numeric badge over the sidebar icon. |
60
+ | `disabled` | `bool` | — | When `true`, the sidebar button is disabled and the item cannot be selected. |
@@ -78,6 +78,7 @@ const AdditionalContentModule = _ref => {
78
78
  colorTheme: activeId === item.id ? 'primary' : 'gray',
79
79
  className: _stylesModule.default.sidebarButton,
80
80
  dataTestId: "".concat(panel.additionalContent.sidebarButton).concat(item.id),
81
+ disabled: item.disabled,
81
82
  Icon: item.Icon,
82
83
  onClick: () => onSelectItem(activeId === item.id ? null : item.id),
83
84
  size: "medium",
@@ -95,6 +96,7 @@ const AdditionalContentModule = _ref => {
95
96
  };
96
97
  AdditionalContentModule.propTypes = {
97
98
  additionalContent: (0, _propTypes.arrayOf)((0, _propTypes.shape)({
99
+ disabled: _propTypes.bool,
98
100
  id: _propTypes.string.isRequired,
99
101
  Icon: _propTypes.string.isRequired,
100
102
  count: _propTypes.number,
@@ -939,6 +939,54 @@ export const V1WithAdditionalContentBadge = {
939
939
  }
940
940
  }
941
941
  };
942
+ export const V1WithAdditionalContentDisabled = {
943
+ args: {
944
+ version: 'V1',
945
+ open: false,
946
+ title: 'Panel con Item Deshabilitado',
947
+ subtitle: 'Sidebar con un ítem inaccesible',
948
+ panelSide: 'right',
949
+ size: 'M',
950
+ additionalContent: [{
951
+ id: 'settings',
952
+ Icon: 'IconSettings',
953
+ BodyComponent: SettingsBodyComponent,
954
+ tooltipProps: {
955
+ content: 'Configuración'
956
+ }
957
+ }, {
958
+ id: 'notifications',
959
+ Icon: 'IconBell',
960
+ disabled: true,
961
+ BodyComponent: NotificationsBodyComponent,
962
+ tooltipProps: {
963
+ content: 'Notificaciones (no disponible)'
964
+ }
965
+ }, {
966
+ id: 'help',
967
+ Icon: 'IconHelpCircle',
968
+ BodyComponent: HelpBodyComponent,
969
+ tooltipProps: {
970
+ content: 'Ayuda'
971
+ }
972
+ }],
973
+ children: /*#__PURE__*/React.createElement("div", {
974
+ style: {
975
+ padding: '16px'
976
+ }
977
+ }, /*#__PURE__*/React.createElement(UTLabel, {
978
+ variant: "body1"
979
+ }, "El \xEDcono de Notificaciones tiene ", /*#__PURE__*/React.createElement("code", null, "disabled: true"), " y no puede seleccionarse."))
980
+ },
981
+ name: 'V1 - Sidebar con Item Deshabilitado',
982
+ parameters: {
983
+ docs: {
984
+ description: {
985
+ story: 'Usa `disabled: true` en un item de `additionalContent` para deshabilitar el botón de ese item en la sidebar. Los demás items funcionan normalmente.'
986
+ }
987
+ }
988
+ }
989
+ };
942
990
  export const Playground = {
943
991
  args: {
944
992
  version: 'V1',
@@ -44,3 +44,17 @@ Component used for displaying a side panel.
44
44
  | showBackButton | boolean | false | Shows a go back arrow button |
45
45
  | showTag | bool | false | Shows a tag indicator in the header area. When true, the tagProps object is passed to the UTStatus component to render a tag. |
46
46
  | tagProps | object | {} | Object containing props for the UTStatus component used as a tag in the header. Supports all [UTStatus props](https://github.com/widergy/Energy-UI/tree/master/src/lib/components/UTStatus) |
47
+ | additionalContent | array | | Array of sidebar items rendered in a collapsible side panel. See structure below. |
48
+
49
+ ### `additionalContent` item structure
50
+
51
+ Each object in the array can contain:
52
+
53
+ | Field | Type | Required | Description |
54
+ | :-------------- | ------------- | -------- | ------------------------------------------------------------------------------------------------ |
55
+ | `id` | `string` | ✅ | Unique identifier for the item. Used as the active key and as part of the sidebar button testId. |
56
+ | `Icon` | `string` | ✅ | Tabler icon name for the sidebar button (e.g. `'IconSettings'`). |
57
+ | `BodyComponent` | `elementType` | ✅ | React component rendered in the expanded content area when this item is active. |
58
+ | `tooltipProps` | `object` | ✅ | Props passed to the `UTTooltip` wrapping the sidebar button. Must include `content`. |
59
+ | `count` | `number` | — | When greater than 0, shows a numeric badge over the sidebar icon. |
60
+ | `disabled` | `bool` | — | When `true`, the sidebar button is disabled and the item cannot be selected. |
@@ -1,6 +1,6 @@
1
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
2
  import React, { useMemo } from 'react';
3
- import { arrayOf, elementType, func, number, object, shape, string } from 'prop-types';
3
+ import { arrayOf, bool, elementType, func, number, object, shape, string } from 'prop-types';
4
4
  import 'react-perfect-scrollbar/dist/css/styles.css';
5
5
  import PerfectScrollbar from 'react-perfect-scrollbar';
6
6
  import UTButton from '../../../../../UTButton';
@@ -70,6 +70,7 @@ const AdditionalContentModule = _ref => {
70
70
  colorTheme: activeId === item.id ? 'primary' : 'gray',
71
71
  className: styles.sidebarButton,
72
72
  dataTestId: "".concat(panel.additionalContent.sidebarButton).concat(item.id),
73
+ disabled: item.disabled,
73
74
  Icon: item.Icon,
74
75
  onClick: () => onSelectItem(activeId === item.id ? null : item.id),
75
76
  size: "medium",
@@ -87,6 +88,7 @@ const AdditionalContentModule = _ref => {
87
88
  };
88
89
  AdditionalContentModule.propTypes = {
89
90
  additionalContent: arrayOf(shape({
91
+ disabled: bool,
90
92
  id: string.isRequired,
91
93
  Icon: string.isRequired,
92
94
  count: number,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widergy/energy-ui",
3
- "version": "3.170.0",
3
+ "version": "3.171.0",
4
4
  "description": "Widergy Web Components",
5
5
  "author": "widergy",
6
6
  "license": "MIT",