@widergy/energy-ui 2.0.0 → 2.0.2
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 +16 -0
- package/dist/components/UTAutocomplete/theme.js +4 -0
- package/dist/components/UTButton/index.js +3 -3
- package/dist/components/UTButton/styles.module.scss +11 -7
- package/dist/components/UTCheckList/index.js +2 -2
- package/dist/components/UTCuit/theme.js +4 -0
- package/dist/components/UTDatePicker/theme.js +4 -0
- package/dist/components/UTExternalLink/constants.js +17 -0
- package/dist/components/UTExternalLink/index.js +11 -7
- package/dist/components/UTExternalLink/theme.js +24 -0
- package/dist/components/UTLabel/constants.js +9 -1
- package/dist/components/UTLabel/theme.js +9 -5
- package/dist/components/UTPhoneInput/theme.js +4 -0
- package/dist/components/UTSelect/theme.js +4 -0
- package/dist/components/UTTextInput/theme.js +4 -0
- package/dist/components/UTWorkflowContainer/index.js +1 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## [2.0.2](https://github.com/widergy/energy-ui/compare/v2.0.1...v2.0.2) (2023-02-03)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* fixed error color on inputs ([43396d2](https://github.com/widergy/energy-ui/commit/43396d283c265612851635ebf06a04b7392404cc))
|
|
7
|
+
* minor change ([d7d52df](https://github.com/widergy/energy-ui/commit/d7d52df9755ee90414d63093ab987594b074b9c2))
|
|
8
|
+
* standarization fixes ([e0699c0](https://github.com/widergy/energy-ui/commit/e0699c03f4a122f211a7d2039fdafd81f178100b))
|
|
9
|
+
|
|
10
|
+
## [2.0.1](https://github.com/widergy/energy-ui/compare/v2.0.0...v2.0.1) (2023-02-03)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* fix ([#339](https://github.com/widergy/energy-ui/issues/339)) ([f6a1205](https://github.com/widergy/energy-ui/commit/f6a1205269006e8cdb14d6a4e07dcc0721a1af7f))
|
|
16
|
+
|
|
1
17
|
# [2.0.0](https://github.com/widergy/energy-ui/compare/v1.134.2...v2.0.0) (2023-01-28)
|
|
2
18
|
|
|
3
19
|
|
|
@@ -61,6 +61,10 @@ var retrieveMuiTheme = function retrieveMuiTheme(theme, muiTheme) {
|
|
|
61
61
|
},
|
|
62
62
|
'&:after': {
|
|
63
63
|
borderBottom: ((_theme$UTTextInput14 = theme.UTTextInput) === null || _theme$UTTextInput14 === void 0 ? void 0 : (_theme$UTTextInput14$ = _theme$UTTextInput14.underline) === null || _theme$UTTextInput14$ === void 0 ? void 0 : (_theme$UTTextInput14$2 = _theme$UTTextInput14$.base) === null || _theme$UTTextInput14$2 === void 0 ? void 0 : _theme$UTTextInput14$2.borderBottom) || "2px solid ".concat(_colors.default.primary)
|
|
64
|
+
},
|
|
65
|
+
'&$error:after': {
|
|
66
|
+
borderBottom: "2px solid ".concat(theme.Palette.error['05']),
|
|
67
|
+
borderBottomColor: theme.Palette.error['05']
|
|
64
68
|
}
|
|
65
69
|
}
|
|
66
70
|
},
|
|
@@ -44,13 +44,13 @@ var UTButton = function UTButton(_ref) {
|
|
|
44
44
|
rightIcon = classes.rightIcon,
|
|
45
45
|
materialButtonClasses = _objectWithoutProperties(classes, _excluded);
|
|
46
46
|
var RenderedChildren = /*#__PURE__*/_react.default.createElement("div", {
|
|
47
|
-
className: "\n ".concat(childrenContainer, "\n ").concat(_stylesModule.default.childrenContainer, "\n ").concat(hideTextOnResponsive && _stylesModule.default.hideTextOnResponsive, "\n
|
|
47
|
+
className: "\n ".concat(childrenContainer, "\n ").concat(_stylesModule.default.childrenContainer, "\n ").concat(hideTextOnResponsive && _stylesModule.default.hideTextOnResponsive, "\n ")
|
|
48
48
|
}, iconPlacement === _constants.ICON_PLACEMENTS.left && Icon && /*#__PURE__*/_react.default.createElement(Icon, {
|
|
49
|
-
className: "".concat(icon, " ").concat(leftIcon, " ").concat(_stylesModule.default.icon)
|
|
49
|
+
className: "".concat(icon, " ").concat(leftIcon, " ").concat(children ? _stylesModule.default.icon : _stylesModule.default.iconOnly)
|
|
50
50
|
}), children && /*#__PURE__*/_react.default.createElement("div", {
|
|
51
51
|
className: "".concat(_stylesModule.default.text, " ").concat(classes.text)
|
|
52
52
|
}, children), iconPlacement !== _constants.ICON_PLACEMENTS.left && Icon && /*#__PURE__*/_react.default.createElement(Icon, {
|
|
53
|
-
className: "".concat(icon, " ").concat(rightIcon, " ").concat(_stylesModule.default.icon)
|
|
53
|
+
className: "".concat(icon, " ").concat(rightIcon, " ").concat(children ? _stylesModule.default.icon : _stylesModule.default.iconOnly)
|
|
54
54
|
}));
|
|
55
55
|
return /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
56
56
|
disabled: disabled || loading,
|
|
@@ -13,16 +13,20 @@
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.icon {
|
|
16
|
+
box-sizing: border-box;
|
|
16
17
|
flex-shrink: 0;
|
|
17
|
-
font-size:
|
|
18
|
-
height:
|
|
19
|
-
width:
|
|
18
|
+
font-size: 1.25rem;
|
|
19
|
+
height: 1.25rem;
|
|
20
|
+
width: 1.25rem;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
.iconOnly {
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
flex-shrink: 0;
|
|
26
|
+
font-size: 1.5rem;
|
|
27
|
+
height: 1.5rem;
|
|
28
|
+
margin: 0 -4px;
|
|
29
|
+
width: 1.5rem;
|
|
26
30
|
}
|
|
27
31
|
|
|
28
32
|
.childrenContainer {
|
|
@@ -107,7 +107,7 @@ var UTCheckList = function UTCheckList(_ref) {
|
|
|
107
107
|
onChange: handleCheckAll,
|
|
108
108
|
value: list.length === input.value.length,
|
|
109
109
|
label: header ? headerLabel : additionalInfo && additionalInfo.header || _constants.defaultAdditionalInfoHeader,
|
|
110
|
-
|
|
110
|
+
classNames: {
|
|
111
111
|
root: !header && classes.selectAllRowRoot,
|
|
112
112
|
checkedIcon: classes.checkedIcon,
|
|
113
113
|
uncheckedIcon: classes.uncheckedIcon
|
|
@@ -132,7 +132,7 @@ var UTCheckList = function UTCheckList(_ref) {
|
|
|
132
132
|
return handleChange(item[valueKey]);
|
|
133
133
|
},
|
|
134
134
|
customRowLabel: CustomRowLabel,
|
|
135
|
-
|
|
135
|
+
classNames: {
|
|
136
136
|
root: !withCheckRow && classes.customRowRoot,
|
|
137
137
|
checkedIcon: classes.checkedIcon,
|
|
138
138
|
uncheckedIcon: classes.uncheckedIcon,
|
|
@@ -34,6 +34,10 @@ var retrieveMuiTheme = function retrieveMuiTheme(theme) {
|
|
|
34
34
|
},
|
|
35
35
|
'&:after': {
|
|
36
36
|
borderBottom: (0, _seamlessImmutable.getIn)(theme, ['UTTextInput', 'underline', 'base', 'borderBottom'], "2px solid ".concat(_colors.default.primary))
|
|
37
|
+
},
|
|
38
|
+
'&$error:after': {
|
|
39
|
+
borderBottom: "2px solid ".concat(theme.Palette.error['05']),
|
|
40
|
+
borderBottomColor: theme.Palette.error['05']
|
|
37
41
|
}
|
|
38
42
|
}
|
|
39
43
|
},
|
|
@@ -171,6 +171,10 @@ var materialTheme = function materialTheme(theme) {
|
|
|
171
171
|
},
|
|
172
172
|
'&:after': {
|
|
173
173
|
borderBottom: (0, _seamlessImmutable.getIn)(theme, ['UTDatePicker', 'standardInput', 'underline', 'base', 'borderBottom'], "2px solid ".concat(_colors.default.primary))
|
|
174
|
+
},
|
|
175
|
+
'&$error:after': {
|
|
176
|
+
borderBottom: "2px solid ".concat(theme.Palette.error['05']),
|
|
177
|
+
borderBottomColor: theme.Palette.error['05']
|
|
174
178
|
}
|
|
175
179
|
}
|
|
176
180
|
},
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DEFAULT_PROPS = exports.COLORS_MAPPER = void 0;
|
|
7
|
+
var DEFAULT_PROPS = {
|
|
8
|
+
colorTheme: 'secondary'
|
|
9
|
+
};
|
|
10
|
+
exports.DEFAULT_PROPS = DEFAULT_PROPS;
|
|
11
|
+
var COLORS_MAPPER = {
|
|
12
|
+
primary: 'accent',
|
|
13
|
+
secondary: 'neutral',
|
|
14
|
+
error: 'error',
|
|
15
|
+
negative: 'negative'
|
|
16
|
+
};
|
|
17
|
+
exports.COLORS_MAPPER = COLORS_MAPPER;
|
|
@@ -6,17 +6,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
|
+
var _WithTheme = _interopRequireDefault(require("../WithTheme"));
|
|
10
|
+
var _theme = require("./theme");
|
|
9
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
12
|
var UTExternalLink = function UTExternalLink(_ref) {
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
+
var children = _ref.children,
|
|
14
|
+
classes = _ref.classes,
|
|
13
15
|
className = _ref.className,
|
|
14
|
-
openProps = _ref.openProps
|
|
16
|
+
openProps = _ref.openProps,
|
|
17
|
+
url = _ref.url;
|
|
15
18
|
return /*#__PURE__*/_react.default.createElement("a", {
|
|
16
19
|
href: url,
|
|
17
20
|
target: "_blank",
|
|
18
21
|
rel: "noopener noreferrer",
|
|
19
|
-
className: className,
|
|
22
|
+
className: "".concat(classes.root, " ").concat(className),
|
|
20
23
|
onClick: openProps && function (event) {
|
|
21
24
|
event.preventDefault();
|
|
22
25
|
var openUrl = openProps.openUrl,
|
|
@@ -30,14 +33,15 @@ var UTExternalLink = function UTExternalLink(_ref) {
|
|
|
30
33
|
}, children);
|
|
31
34
|
};
|
|
32
35
|
UTExternalLink.propTypes = {
|
|
36
|
+
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
33
37
|
className: _propTypes.string,
|
|
34
|
-
url: _propTypes.string.isRequired,
|
|
35
38
|
openProps: (0, _propTypes.shape)({
|
|
36
39
|
openUrl: _propTypes.string,
|
|
37
40
|
targetName: _propTypes.string,
|
|
38
41
|
options: _propTypes.string,
|
|
39
42
|
replace: _propTypes.string
|
|
40
|
-
})
|
|
43
|
+
}),
|
|
44
|
+
url: _propTypes.string.isRequired
|
|
41
45
|
};
|
|
42
|
-
var _default = UTExternalLink;
|
|
46
|
+
var _default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTExternalLink);
|
|
43
47
|
exports.default = _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.variantsColorTheme = exports.retrieveStyle = void 0;
|
|
7
|
+
var _classesUtils = require("../../utils/classesUtils");
|
|
8
|
+
var _constants = require("./constants");
|
|
9
|
+
var variantsColorTheme = function variantsColorTheme(colorTheme, theme) {
|
|
10
|
+
var actionColorName = _constants.COLORS_MAPPER[colorTheme] || _constants.COLORS_MAPPER[_constants.DEFAULT_PROPS.colorTheme];
|
|
11
|
+
var actionTheme = theme.Palette.actions[actionColorName];
|
|
12
|
+
return actionTheme['05'];
|
|
13
|
+
};
|
|
14
|
+
exports.variantsColorTheme = variantsColorTheme;
|
|
15
|
+
var retrieveStyle = function retrieveStyle(_ref) {
|
|
16
|
+
var colorTheme = _ref.colorTheme,
|
|
17
|
+
theme = _ref.theme;
|
|
18
|
+
return {
|
|
19
|
+
root: {
|
|
20
|
+
color: (0, _classesUtils.withImportant)(variantsColorTheme(colorTheme, theme))
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
exports.retrieveStyle = retrieveStyle;
|
|
@@ -3,11 +3,19 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.WEIGHTS = exports.VARIANTS_SIZES = exports.VARIANTS_LINE_HEIGHT = exports.VARIANTS = exports.MARKDOWN_RENDERERS = exports.DEFAULT_PROPS = exports.COLOR_THEMES = void 0;
|
|
6
|
+
exports.WEIGHTS = exports.VARIANTS_SIZES = exports.VARIANTS_LINE_HEIGHT = exports.VARIANTS = exports.SHADES = exports.MARKDOWN_RENDERERS = exports.DEFAULT_PROPS = exports.COLOR_THEMES = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
9
|
/* eslint-disable react/prop-types */
|
|
10
10
|
|
|
11
|
+
var SHADES = {
|
|
12
|
+
shade01: '01',
|
|
13
|
+
shade02: '02',
|
|
14
|
+
shade03: '03',
|
|
15
|
+
shade04: '04',
|
|
16
|
+
shade05: '05'
|
|
17
|
+
};
|
|
18
|
+
exports.SHADES = SHADES;
|
|
11
19
|
var VARIANTS = {
|
|
12
20
|
title1: 'h1',
|
|
13
21
|
title2: 'h2',
|
|
@@ -7,26 +7,30 @@ exports.variantsColorTheme = exports.retrieveStyle = exports.linkColor = void 0;
|
|
|
7
7
|
var _colors = _interopRequireDefault(require("../../scss/variables/_colors.scss"));
|
|
8
8
|
var _constants = require("./constants");
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
var
|
|
10
|
+
var getDefaultColorShade = function getDefaultColorShade(colorTheme) {
|
|
11
|
+
return colorTheme === _constants.COLOR_THEMES.gray ? _constants.SHADES.shade04 : colorTheme === _constants.COLOR_THEMES.light ? _constants.SHADES.shade01 : _constants.SHADES.shade05;
|
|
12
|
+
};
|
|
13
|
+
var variantsColorTheme = function variantsColorTheme(colorTheme, shade, theme) {
|
|
11
14
|
var colorThemeDefinition = theme.Palette[colorTheme] || theme.Palette[_constants.DEFAULT_PROPS.colorTheme];
|
|
12
|
-
var
|
|
13
|
-
return colorThemeDefinition[
|
|
15
|
+
var colorShade = Object.values(_constants.SHADES).includes(shade) ? shade : getDefaultColorShade(colorTheme);
|
|
16
|
+
return colorThemeDefinition[colorShade] || _colors.default.black;
|
|
14
17
|
};
|
|
15
18
|
exports.variantsColorTheme = variantsColorTheme;
|
|
16
19
|
var linkColor = function linkColor(theme, colorTheme) {
|
|
17
|
-
var color = colorTheme === _constants.COLOR_THEMES.light ? theme.Palette.actions.negative[
|
|
20
|
+
var color = colorTheme === _constants.COLOR_THEMES.light ? theme.Palette.actions.negative[_constants.SHADES.shade05] : colorTheme === _constants.COLOR_THEMES.error ? theme.Palette.actions.error[_constants.SHADES.shade05] : theme.Palette.actions.neutral[_constants.SHADES.shade05];
|
|
18
21
|
return color;
|
|
19
22
|
};
|
|
20
23
|
exports.linkColor = linkColor;
|
|
21
24
|
var retrieveStyle = function retrieveStyle(_ref) {
|
|
22
25
|
var _theme$Fonts;
|
|
23
26
|
var colorTheme = _ref.colorTheme,
|
|
27
|
+
shade = _ref.shade,
|
|
24
28
|
theme = _ref.theme,
|
|
25
29
|
variant = _ref.variant,
|
|
26
30
|
weight = _ref.weight;
|
|
27
31
|
return {
|
|
28
32
|
root: {
|
|
29
|
-
color: variantsColorTheme(
|
|
33
|
+
color: variantsColorTheme(colorTheme, shade, theme),
|
|
30
34
|
fontFamily: theme === null || theme === void 0 ? void 0 : (_theme$Fonts = theme.Fonts) === null || _theme$Fonts === void 0 ? void 0 : _theme$Fonts.fontFamily,
|
|
31
35
|
fontSize: _constants.VARIANTS_SIZES[variant] || _constants.VARIANTS_SIZES[_constants.DEFAULT_PROPS.variant],
|
|
32
36
|
fontWeight: _constants.WEIGHTS[weight] || _constants.WEIGHTS[_constants.DEFAULT_PROPS.weight],
|
|
@@ -103,6 +103,10 @@ var retrieveMuiTheme = function retrieveMuiTheme(theme) {
|
|
|
103
103
|
},
|
|
104
104
|
'&:after': {
|
|
105
105
|
borderBottom: (0, _seamlessImmutable.getIn)(theme, ['UTTextInput', 'underline', 'base', 'borderBottom'], "2px solid ".concat(_colors.default.primary))
|
|
106
|
+
},
|
|
107
|
+
'&$error:after': {
|
|
108
|
+
borderBottom: "2px solid ".concat(theme.Palette.error['05']),
|
|
109
|
+
borderBottomColor: theme.Palette.error['05']
|
|
106
110
|
}
|
|
107
111
|
}
|
|
108
112
|
},
|
|
@@ -122,6 +122,10 @@ var retrieveMuiTheme = function retrieveMuiTheme(theme, muiTheme) {
|
|
|
122
122
|
},
|
|
123
123
|
'&:after': {
|
|
124
124
|
borderBottom: (0, _seamlessImmutable.getIn)(theme, ['UTSelect', 'underline', 'base', 'borderBottom'], "2px solid ".concat(_colors.default.inputPrimary))
|
|
125
|
+
},
|
|
126
|
+
'&$error:after': {
|
|
127
|
+
borderBottom: "2px solid ".concat(theme.Palette.error['05']),
|
|
128
|
+
borderBottomColor: theme.Palette.error['05']
|
|
125
129
|
}
|
|
126
130
|
}
|
|
127
131
|
},
|
|
@@ -95,6 +95,10 @@ var retrieveMuiTheme = function retrieveMuiTheme(theme, muiTheme) {
|
|
|
95
95
|
},
|
|
96
96
|
'&:after': {
|
|
97
97
|
borderBottom: (0, _seamlessImmutable.getIn)(theme, ['UTTextInput', 'underline', 'base', 'borderBottom'], "2px solid ".concat(_colors.default.primary))
|
|
98
|
+
},
|
|
99
|
+
'&$error:after': {
|
|
100
|
+
borderBottom: "2px solid ".concat(theme.Palette.error['05']),
|
|
101
|
+
borderBottomColor: theme.Palette.error['05']
|
|
98
102
|
}
|
|
99
103
|
}
|
|
100
104
|
},
|
|
@@ -100,8 +100,7 @@ var UTWorkflowContainer = function UTWorkflowContainer(_ref) {
|
|
|
100
100
|
buttonProps: {
|
|
101
101
|
colorTheme: 'primary',
|
|
102
102
|
Icon: (withIcon || smallButtons) && NextIcon,
|
|
103
|
-
iconPlacement: 'right'
|
|
104
|
-
variant: 'outlined'
|
|
103
|
+
iconPlacement: 'right'
|
|
105
104
|
}
|
|
106
105
|
}, !smallButtons && (nextButton.label || _constants.NEXT))), /*#__PURE__*/_react.default.createElement("div", {
|
|
107
106
|
className: "".concat(_stylesModule.default.workflowContent, " ").concat(classes.content)
|