@widergy/energy-ui 3.126.0 → 3.128.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 +14 -0
- package/dist/components/UTChip/styles.module.scss +1 -0
- package/dist/components/UTIcon/theme.js +11 -10
- package/dist/components/UTLabel/components/Markdown/components/BlockQuote/styles.module.scss +1 -0
- package/dist/components/UTLabel/components/Markdown/components/Citation/constants.js +17 -0
- package/dist/components/UTLabel/components/Markdown/components/Citation/index.js +12 -4
- package/dist/components/UTLabel/components/Markdown/components/Citation/utils.js +18 -0
- package/dist/components/UTLabel/components/Markdown/components/CitationGroup/index.js +5 -7
- package/dist/components/UTLabel/components/Markdown/components/CitationGroup/styles.module.scss +12 -5
- package/dist/components/UTLabel/components/Markdown/components/ListItem/index.js +3 -4
- package/dist/components/UTLabel/components/Markdown/components/ListItem/styles.module.scss +1 -2
- package/dist/components/UTLabel/components/Markdown/components/Section/index.js +2 -1
- package/dist/components/UTLabel/components/Markdown/customPlugins/remarkCitations.js +1 -2
- package/dist/components/UTLabel/components/Markdown/utils.js +11 -2
- package/dist/components/UTLabel/theme.js +1 -12
- package/dist/components/UTSelectableCard/constants.js +2 -0
- package/dist/components/UTSelectableCard/index.js +10 -2
- package/dist/components/UTTextInput/versions/V1/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [3.128.0](https://github.com/widergy/energy-ui/compare/v3.127.0...v3.128.0) (2026-01-07)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* [AXCH-842] uticon and utselectable card features ([#729](https://github.com/widergy/energy-ui/issues/729)) ([0874a52](https://github.com/widergy/energy-ui/commit/0874a52d6973e0e21245c9a1bc730ceb4232cef7))
|
|
7
|
+
|
|
8
|
+
# [3.127.0](https://github.com/widergy/energy-ui/compare/v3.126.0...v3.127.0) (2026-01-06)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* [PDI-564] citation chips ([#739](https://github.com/widergy/energy-ui/issues/739)) ([e8259c5](https://github.com/widergy/energy-ui/commit/e8259c56f2b378680bd893fb571984d7fedc2060))
|
|
14
|
+
|
|
1
15
|
# [3.126.0](https://github.com/widergy/energy-ui/compare/v3.125.1...v3.126.0) (2025-12-17)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -95,6 +95,7 @@ exports.getClassNames = getClassNames;
|
|
|
95
95
|
const retrieveStyle = _ref4 => {
|
|
96
96
|
var _theme$Palette$action2, _theme$Palette$action3, _theme$Palette$action4;
|
|
97
97
|
let {
|
|
98
|
+
areaColor,
|
|
98
99
|
color,
|
|
99
100
|
colorTheme,
|
|
100
101
|
shade,
|
|
@@ -107,16 +108,16 @@ const retrieveStyle = _ref4 => {
|
|
|
107
108
|
});
|
|
108
109
|
const border = "2px solid ".concat(borderColor);
|
|
109
110
|
const defaultBackgrounds = {
|
|
110
|
-
accent: ((_theme$Palette$action2 = theme.Palette.actions) === null || _theme$Palette$action2 === void 0 ? void 0 : _theme$Palette$action2.accent['01']) || theme.Palette.accent['01'],
|
|
111
|
-
dark: theme.Palette.light['03'],
|
|
112
|
-
error: theme.Palette.error['01'],
|
|
113
|
-
gray: theme.Palette.light['03'],
|
|
114
|
-
information: theme.Palette.information['01'],
|
|
115
|
-
light: theme.Palette.light['03'],
|
|
116
|
-
negative: ((_theme$Palette$action3 = theme.Palette.actions) === null || _theme$Palette$action3 === void 0 ? void 0 : _theme$Palette$action3.negative['01']) || theme.Palette.negative['01'],
|
|
117
|
-
neutral: ((_theme$Palette$action4 = theme.Palette.actions) === null || _theme$Palette$action4 === void 0 ? void 0 : _theme$Palette$action4.neutral['01']) || theme.Palette.neutral['01'],
|
|
118
|
-
success: theme.Palette.success['01'],
|
|
119
|
-
warning: theme.Palette.warning['01']
|
|
111
|
+
accent: areaColor || ((_theme$Palette$action2 = theme.Palette.actions) === null || _theme$Palette$action2 === void 0 ? void 0 : _theme$Palette$action2.accent['01']) || theme.Palette.accent['01'],
|
|
112
|
+
dark: areaColor || theme.Palette.light['03'],
|
|
113
|
+
error: areaColor || theme.Palette.error['01'],
|
|
114
|
+
gray: areaColor || theme.Palette.light['03'],
|
|
115
|
+
information: areaColor || theme.Palette.information['01'],
|
|
116
|
+
light: areaColor || theme.Palette.light['03'],
|
|
117
|
+
negative: areaColor || ((_theme$Palette$action3 = theme.Palette.actions) === null || _theme$Palette$action3 === void 0 ? void 0 : _theme$Palette$action3.negative['01']) || theme.Palette.negative['01'],
|
|
118
|
+
neutral: areaColor || ((_theme$Palette$action4 = theme.Palette.actions) === null || _theme$Palette$action4 === void 0 ? void 0 : _theme$Palette$action4.neutral['01']) || theme.Palette.neutral['01'],
|
|
119
|
+
success: areaColor || theme.Palette.success['01'],
|
|
120
|
+
warning: areaColor || theme.Palette.warning['01']
|
|
120
121
|
};
|
|
121
122
|
const variantStyles = Object.keys(defaultBackgrounds).reduce((acc, type) => {
|
|
122
123
|
acc["".concat(type, "Default")] = {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.EXTENSION_ICON = exports.DEFAULT_ICON = void 0;
|
|
7
|
+
const EXTENSION_ICON = exports.EXTENSION_ICON = {
|
|
8
|
+
doc: 'IconFileTypeDoc',
|
|
9
|
+
docx: 'IconFileTypeDocx',
|
|
10
|
+
jpg: 'IconFileTypeJpg',
|
|
11
|
+
pdf: 'IconFileTypePdf',
|
|
12
|
+
txt: 'IconFileTypeTxt',
|
|
13
|
+
xls: 'IconFileTypeXls',
|
|
14
|
+
xml: 'IconFileTypeXml',
|
|
15
|
+
zip: 'IconFileTypeZip'
|
|
16
|
+
};
|
|
17
|
+
const DEFAULT_ICON = exports.DEFAULT_ICON = 'IconFile';
|
|
@@ -6,8 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
|
-
var
|
|
9
|
+
var _UTChip = _interopRequireDefault(require("../../../../../UTChip"));
|
|
10
10
|
var _WithCustomHandler = _interopRequireDefault(require("../WithCustomHandler"));
|
|
11
|
+
var _utils = require("./utils");
|
|
11
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
13
|
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); }
|
|
13
14
|
const Citation = _ref => {
|
|
@@ -15,9 +16,16 @@ const Citation = _ref => {
|
|
|
15
16
|
label,
|
|
16
17
|
url
|
|
17
18
|
} = _ref;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
const onClick = () => window.open(url, '_blank', 'noopener,noreferrer');
|
|
20
|
+
const icon = (0, _utils.getIcon)(label, url);
|
|
21
|
+
return /*#__PURE__*/_react.default.createElement(_UTChip.default, {
|
|
22
|
+
adornment: {
|
|
23
|
+
props: {
|
|
24
|
+
name: icon
|
|
25
|
+
},
|
|
26
|
+
type: 'icon'
|
|
27
|
+
},
|
|
28
|
+
onClick: onClick,
|
|
21
29
|
size: "small"
|
|
22
30
|
}, label);
|
|
23
31
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getIcon = void 0;
|
|
7
|
+
var _constants = require("./constants");
|
|
8
|
+
const getFileExtension = str => {
|
|
9
|
+
if (!str) return null;
|
|
10
|
+
const match = str.match(/\.([a-zA-Z0-9]+)(?:\?|$)/);
|
|
11
|
+
return match ? match[1].toLowerCase() : null;
|
|
12
|
+
};
|
|
13
|
+
const getIcon = (label, url) => {
|
|
14
|
+
const extension = getFileExtension(label) || getFileExtension(url);
|
|
15
|
+
const icon = extension && _constants.EXTENSION_ICON[extension] || _constants.DEFAULT_ICON;
|
|
16
|
+
return icon;
|
|
17
|
+
};
|
|
18
|
+
exports.getIcon = getIcon;
|
|
@@ -5,21 +5,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _propTypes = require("prop-types");
|
|
9
8
|
var _WithCustomHandler = _interopRequireDefault(require("../WithCustomHandler"));
|
|
10
9
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
11
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
11
|
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); }
|
|
13
12
|
const CitationGroup = _ref => {
|
|
14
13
|
let {
|
|
15
|
-
children
|
|
16
|
-
classes
|
|
14
|
+
children
|
|
17
15
|
} = _ref;
|
|
16
|
+
const [isHovered, setIsHovered] = (0, _react.useState)(false);
|
|
18
17
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
19
|
-
className: "".concat(_stylesModule.default.citationGroup, " ").concat(
|
|
18
|
+
className: "".concat(_stylesModule.default.citationGroup, " ").concat(isHovered ? _stylesModule.default.isHovered : ''),
|
|
19
|
+
onMouseEnter: () => setIsHovered(true),
|
|
20
|
+
onMouseLeave: () => setIsHovered(false)
|
|
20
21
|
}, children);
|
|
21
22
|
};
|
|
22
|
-
CitationGroup.propTypes = {
|
|
23
|
-
classes: (0, _propTypes.objectOf)(_propTypes.string)
|
|
24
|
-
};
|
|
25
23
|
var _default = exports.default = /*#__PURE__*/(0, _react.memo)((0, _WithCustomHandler.default)(CitationGroup));
|
package/dist/components/UTLabel/components/Markdown/components/CitationGroup/styles.module.scss
CHANGED
|
@@ -8,15 +8,22 @@
|
|
|
8
8
|
scroll-behavior: smooth;
|
|
9
9
|
scroll-snap-type: x mandatory;
|
|
10
10
|
|
|
11
|
-
button {
|
|
12
|
-
flex: 0 0 auto;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
11
|
&::-webkit-scrollbar {
|
|
16
12
|
height: 8px;
|
|
17
13
|
}
|
|
18
14
|
|
|
19
|
-
&::-webkit-scrollbar
|
|
15
|
+
&::-webkit-scrollbar-track {
|
|
20
16
|
background-color: transparent;
|
|
21
17
|
}
|
|
18
|
+
|
|
19
|
+
&::-webkit-scrollbar-thumb {
|
|
20
|
+
background-color: transparent;
|
|
21
|
+
border-radius: 4px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&.isHovered {
|
|
25
|
+
&::-webkit-scrollbar-thumb {
|
|
26
|
+
background-color: var(--light05);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
22
29
|
}
|
|
@@ -8,6 +8,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
9
|
var _UTIcon = _interopRequireDefault(require("../../../../../UTIcon"));
|
|
10
10
|
var _WithCustomHandler = _interopRequireDefault(require("../WithCustomHandler"));
|
|
11
|
+
var _utils = require("../../utils");
|
|
11
12
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
12
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
14
|
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); }
|
|
@@ -15,7 +16,6 @@ const ListItem = _ref => {
|
|
|
15
16
|
var _node$properties;
|
|
16
17
|
let {
|
|
17
18
|
children,
|
|
18
|
-
classes,
|
|
19
19
|
node,
|
|
20
20
|
...props
|
|
21
21
|
} = _ref;
|
|
@@ -36,18 +36,17 @@ const ListItem = _ref => {
|
|
|
36
36
|
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
37
37
|
className: _stylesModule.default.itemContentChecked
|
|
38
38
|
}, contentNodes)) : /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
39
|
-
className:
|
|
39
|
+
className: _stylesModule.default.taskItemIconUnchecked
|
|
40
40
|
}), /*#__PURE__*/_react.default.createElement("span", null, contentNodes)));
|
|
41
41
|
}
|
|
42
42
|
const safeChildren = Array.isArray(children) ? children : children ? [children] : [];
|
|
43
43
|
const mergedProps = {
|
|
44
|
-
...props,
|
|
44
|
+
...(0, _utils.cleanElementProps)(props),
|
|
45
45
|
...((node === null || node === void 0 ? void 0 : node.properties) || {})
|
|
46
46
|
};
|
|
47
47
|
return /*#__PURE__*/_react.default.createElement('li', mergedProps, safeChildren);
|
|
48
48
|
};
|
|
49
49
|
ListItem.propTypes = {
|
|
50
|
-
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
51
50
|
node: _propTypes.object
|
|
52
51
|
};
|
|
53
52
|
var _default = exports.default = /*#__PURE__*/(0, _react.memo)((0, _WithCustomHandler.default)(ListItem));
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
|
+
var _utils = require("../../utils");
|
|
9
10
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
10
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
12
|
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); }
|
|
@@ -20,7 +21,7 @@ const Section = _ref => {
|
|
|
20
21
|
} = _ref;
|
|
21
22
|
const isFootnotesSection = (node === null || node === void 0 || (_node$properties = node.properties) === null || _node$properties === void 0 ? void 0 : _node$properties.dataFootnotes) !== undefined;
|
|
22
23
|
if (!isFootnotesSection) {
|
|
23
|
-
return /*#__PURE__*/_react.default.createElement('section', props, children);
|
|
24
|
+
return /*#__PURE__*/_react.default.createElement('section', (0, _utils.cleanElementProps)(props), children);
|
|
24
25
|
}
|
|
25
26
|
const reactChildren = _react.default.Children.toArray(children);
|
|
26
27
|
const ol = reactChildren.find(c => (c === null || c === void 0 ? void 0 : c.type) === 'ol');
|
|
@@ -27,8 +27,7 @@ var _default = () => {
|
|
|
27
27
|
const getText = n => {
|
|
28
28
|
if (n.type === _constants.NODE_TYPES.TEXT) return n.value || '';
|
|
29
29
|
if (n.type === _constants.NODE_TYPES.LINK) {
|
|
30
|
-
|
|
31
|
-
return inner + (n.url || '');
|
|
30
|
+
return Array.isArray(n.children) ? n.children.map(getText).join('') : '';
|
|
32
31
|
}
|
|
33
32
|
if (Array.isArray(n.children)) return n.children.map(getText).join('');
|
|
34
33
|
return '';
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getMarkdownPlugins = void 0;
|
|
6
|
+
exports.getMarkdownPlugins = exports.cleanElementProps = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
|
|
8
9
|
var _constants = require("./constants");
|
|
9
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
11
|
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); }
|
|
@@ -36,4 +37,12 @@ const getMarkdownPlugins = function (classes, markdownExtended) {
|
|
|
36
37
|
remarkPlugins
|
|
37
38
|
};
|
|
38
39
|
};
|
|
39
|
-
exports.getMarkdownPlugins = getMarkdownPlugins;
|
|
40
|
+
exports.getMarkdownPlugins = getMarkdownPlugins;
|
|
41
|
+
const cleanElementProps = function () {
|
|
42
|
+
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
43
|
+
if ((0, _isEmpty.default)(props)) return {};
|
|
44
|
+
if (props.markdownExtended) delete props.markdownExtended;
|
|
45
|
+
if (props.customHandler) delete props.customHandler;
|
|
46
|
+
return props;
|
|
47
|
+
};
|
|
48
|
+
exports.cleanElementProps = cleanElementProps;
|
|
@@ -197,23 +197,12 @@ const retrieveStyle = _ref2 => {
|
|
|
197
197
|
}
|
|
198
198
|
},
|
|
199
199
|
blockquote: {
|
|
200
|
-
color: grayTextColor
|
|
201
|
-
'&::before': {
|
|
202
|
-
background: theme.Palette[_Palette.COLOR_THEMES.gray][_Palette.COLOR_SHADES.shade01]
|
|
203
|
-
}
|
|
204
|
-
},
|
|
205
|
-
citationGroup: {
|
|
206
|
-
'&::-webkit-scrollbar-thumb': {
|
|
207
|
-
backgroundColor: theme.Palette[_Palette.COLOR_THEMES.gray][_Palette.COLOR_SHADES.shade04]
|
|
208
|
-
}
|
|
200
|
+
color: grayTextColor
|
|
209
201
|
},
|
|
210
202
|
customFootnotes: {
|
|
211
203
|
'& span': {
|
|
212
204
|
color: grayTextColor
|
|
213
205
|
}
|
|
214
|
-
},
|
|
215
|
-
taskItemIconUnchecked: {
|
|
216
|
-
borderColor: theme.Palette[_Palette.COLOR_THEMES.gray][_Palette.COLOR_SHADES.shade01]
|
|
217
206
|
}
|
|
218
207
|
};
|
|
219
208
|
};
|
|
@@ -12,6 +12,7 @@ var _UTTooltip = _interopRequireDefault(require("../UTTooltip"));
|
|
|
12
12
|
var _WithTheme = _interopRequireDefault(require("../WithTheme"));
|
|
13
13
|
var _componentUtils = require("../../utils/componentUtils");
|
|
14
14
|
var _UTIcon = _interopRequireDefault(require("../UTIcon"));
|
|
15
|
+
var _UTAvatar = _interopRequireDefault(require("../UTAvatar"));
|
|
15
16
|
var _constants = require("./constants");
|
|
16
17
|
var _theme = require("./theme");
|
|
17
18
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -56,6 +57,8 @@ const UTSelectableCard = _ref => {
|
|
|
56
57
|
dataTestId,
|
|
57
58
|
description,
|
|
58
59
|
disabled = false,
|
|
60
|
+
avatar,
|
|
61
|
+
avatarProps = {},
|
|
59
62
|
Icon,
|
|
60
63
|
iconProps = {},
|
|
61
64
|
onClick,
|
|
@@ -71,12 +74,15 @@ const UTSelectableCard = _ref => {
|
|
|
71
74
|
}, iconProps)) : /*#__PURE__*/_react.default.createElement(Icon, {
|
|
72
75
|
className: "".concat(classes.icon, " ").concat(classNames.icon)
|
|
73
76
|
});
|
|
77
|
+
const AvatarComponent = avatar ? /*#__PURE__*/_react.default.createElement(_UTAvatar.default, _extends({
|
|
78
|
+
size: _constants.SIZES.LARGE
|
|
79
|
+
}, avatarProps)) : null;
|
|
74
80
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
75
|
-
className: "\n
|
|
81
|
+
className: "\n ".concat(classes.item, "\n ").concat(disabled ? "".concat(classes["".concat(appearance, "DisabledContainer")], " ").concat(classNames["".concat(appearance, "DisabledContainer")] || '') : selected ? "".concat(classes["".concat(appearance, "SelectedContainer")], " ").concat(classNames["".concat(appearance, "SelectedContainer")] || '') : "".concat(classes["".concat(appearance, "Apareance")], " ").concat(classNames["".concat(appearance, "Apareance")] || ''), "\n ").concat(classes["".concat(size, "Size")], "\n"),
|
|
76
82
|
"data-testid": dataTestId,
|
|
77
83
|
onClick: () => !disabled && onClick(),
|
|
78
84
|
role: "button"
|
|
79
|
-
}, Icon && IconComponent, /*#__PURE__*/_react.default.createElement("div", {
|
|
85
|
+
}, Icon && !avatar && IconComponent, avatar && !Icon && AvatarComponent, /*#__PURE__*/_react.default.createElement("div", {
|
|
80
86
|
className: "".concat(classes.textContainer, " ").concat(checkIcon && classes.textContainerWithCheckedIcon)
|
|
81
87
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
82
88
|
className: classes.column
|
|
@@ -113,6 +119,8 @@ UTSelectableCard.propTypes = {
|
|
|
113
119
|
title: _propTypes.string
|
|
114
120
|
}),
|
|
115
121
|
appearance: (0, _propTypes.oneOf)([_constants.APPEARANCES.GRAY, _constants.APPEARANCES.WHITE]),
|
|
122
|
+
avatar: _propTypes.bool,
|
|
123
|
+
avatarProps: (0, _propTypes.objectOf)(_propTypes.string),
|
|
116
124
|
checkIcon: _propTypes.bool,
|
|
117
125
|
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
118
126
|
classNames: (0, _propTypes.objectOf)(_propTypes.string),
|
|
@@ -162,7 +162,7 @@ const propTypes = exports.propTypes = {
|
|
|
162
162
|
classNames: (0, _propTypes.objectOf)(_propTypes.string),
|
|
163
163
|
dataTestId: _propTypes.string,
|
|
164
164
|
disabled: _propTypes.bool,
|
|
165
|
-
error: _propTypes.bool,
|
|
165
|
+
error: (0, _propTypes.oneOfType)([_propTypes.bool, _propTypes.string]),
|
|
166
166
|
helpText: _propTypes.string,
|
|
167
167
|
helperTextDataTestId: _propTypes.string,
|
|
168
168
|
id: _propTypes.string,
|