@widergy/energy-ui 3.30.2 → 3.31.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.31.0](https://github.com/widergy/energy-ui/compare/v3.30.2...v3.31.0) (2024-10-18)
2
+
3
+
4
+ ### Features
5
+
6
+ * [UG-2131] spacing and bottom actions updates ([#515](https://github.com/widergy/energy-ui/issues/515)) ([8b38e37](https://github.com/widergy/energy-ui/commit/8b38e37ec30837b2838fa1d64de57e0e73275520))
7
+
1
8
  ## [3.30.2](https://github.com/widergy/energy-ui/compare/v3.30.1...v3.30.2) (2024-10-17)
2
9
 
3
10
 
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.DEFAULT_REDIRECTION_ICON = void 0;
7
+ const DEFAULT_REDIRECTION_ICON = exports.DEFAULT_REDIRECTION_ICON = 'IconChevronRight';
@@ -8,6 +8,7 @@ var _react = _interopRequireWildcard(require("react"));
8
8
  var _propTypes = require("prop-types");
9
9
  var _UTButton = _interopRequireDefault(require("../../../UTButton"));
10
10
  var _constants = require("../../constants");
11
+ var _constants2 = require("./constants");
11
12
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
12
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
14
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
@@ -40,7 +41,7 @@ const BottomActions = _ref => {
40
41
  colorTheme: colorTheme,
41
42
  dataTestId: dataTestId,
42
43
  disabled: disabled,
43
- Icon: type === _constants.ACTION_TYPES.REDIRECTION ? 'IconChevronRight' : Icon,
44
+ Icon: type === _constants.ACTION_TYPES.REDIRECTION ? Icon || _constants2.DEFAULT_REDIRECTION_ICON : Icon,
44
45
  iconPlacement: type === _constants.ACTION_TYPES.REDIRECTION ? 'right' : 'left',
45
46
  key: label,
46
47
  loading: loading,
@@ -35,14 +35,16 @@ const Header = _ref => {
35
35
  } = _ref;
36
36
  return /*#__PURE__*/_react.default.createElement("div", {
37
37
  className: "".concat(_stylesModule.default.header, " ").concat(_stylesModule.default[size], " ").concat(classNames.header)
38
- }, (0, _utils.renderAdornment)(adornment, 'left', size), /*#__PURE__*/_react.default.createElement("div", {
38
+ }, (0, _utils.renderAdornment)(adornment, 'left'), /*#__PURE__*/_react.default.createElement("div", {
39
39
  className: _stylesModule.default.headerTitles
40
- }, (0, _utils.renderAdornment)(adornment, 'top', size), /*#__PURE__*/_react.default.createElement(_UTLabel.default, _extends({
40
+ }, (0, _utils.renderAdornment)(adornment, 'top'), /*#__PURE__*/_react.default.createElement("div", {
41
+ className: _stylesModule.default.titleAndDescription
42
+ }, /*#__PURE__*/_react.default.createElement(_UTLabel.default, _extends({
41
43
  variant: "title3",
42
44
  weight: "medium"
43
45
  }, titleProps), title), description && /*#__PURE__*/_react.default.createElement(_UTLabel.default, _extends({
44
46
  colorTheme: "gray"
45
- }, descriptionProps), description)), status ? /*#__PURE__*/_react.default.createElement(_UTStatus.default, _extends({
47
+ }, descriptionProps), description))), status ? /*#__PURE__*/_react.default.createElement(_UTStatus.default, _extends({
46
48
  className: "".concat(_stylesModule.default["placeSelf-".concat(statusAlignment)]),
47
49
  type: "light"
48
50
  }, (0, _utils.statusPropsMapper)(status)), statusLabel || status) : null, !(0, _array.isEmpty)(headerActions) && /*#__PURE__*/_react.default.createElement(_HeaderActions.default, {
@@ -84,7 +86,7 @@ Header.propTypes = {
84
86
  status: _propTypes.string,
85
87
  statusAlignment: (0, _propTypes.oneOf)([_constants.PLACE_SELF_TYPES.CENTER, _constants.PLACE_SELF_TYPES.END, _constants.PLACE_SELF_TYPES.START]),
86
88
  statusLabel: _propTypes.string,
87
- title: _propTypes.string.isRequired,
89
+ title: _propTypes.string,
88
90
  titleProps: (0, _propTypes.shape)({
89
91
  variant: _propTypes.string,
90
92
  weight: _propTypes.string
@@ -7,8 +7,14 @@
7
7
  .headerTitles {
8
8
  display: flex;
9
9
  flex-direction: column;
10
- grid-gap: 8px;
10
+ grid-gap: 16px;
11
11
  margin-right: auto;
12
+ }
13
+
14
+ .titleAndDescription {
15
+ display: flex;
16
+ flex-direction: column;
17
+ grid-gap: 8px;
12
18
  overflow-wrap: anywhere;
13
19
  }
14
20
 
@@ -35,4 +41,8 @@
35
41
  .defaultAvatar {
36
42
  height: 64px;
37
43
  width: 64px;
38
- }
44
+ }
45
+
46
+ .adornment {
47
+ max-width: 100%;
48
+ }
@@ -143,12 +143,13 @@ const statusPropsMapper = status => ({
143
143
  withoutIcon: true
144
144
  };
145
145
  exports.statusPropsMapper = statusPropsMapper;
146
- const renderAdornment = (adornment, position, size) => {
146
+ const renderAdornment = (adornment, position) => {
147
+ var _adornment$props;
147
148
  if ((0, _object.objectIsEmpty)(adornment) || adornment.position !== position) return null;
148
149
  const AdornmentComponent = _constants2.ADORNMENT_COMPONENT_MAPPER[adornment.type];
149
150
  const defaultPlaceSelf = adornment.position === 'left' ? _constants.PLACE_SELF_TYPES.CENTER : _constants.PLACE_SELF_TYPES.START;
150
- return /*#__PURE__*/_react.default.createElement(AdornmentComponent, _extends({
151
- className: "".concat(_stylesModule.default["placeSelf-".concat(adornment.alignment || defaultPlaceSelf)], " ").concat(position === 'top' ? _stylesModule.default["gap-".concat(size)] : '')
152
- }, adornment.props || {}));
151
+ return /*#__PURE__*/_react.default.createElement(AdornmentComponent, _extends({}, adornment.props || {}, {
152
+ className: "".concat(_stylesModule.default.adornment, " ").concat(_stylesModule.default["placeSelf-".concat(adornment.alignment || defaultPlaceSelf)], " ").concat(((_adornment$props = adornment.props) === null || _adornment$props === void 0 ? void 0 : _adornment$props.className) || '')
153
+ }));
153
154
  };
154
155
  exports.renderAdornment = renderAdornment;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widergy/energy-ui",
3
- "version": "3.30.2",
3
+ "version": "3.31.0",
4
4
  "description": "Widergy Web Components",
5
5
  "author": "widergy",
6
6
  "license": "MIT",