@widergy/energy-ui 1.134.2 → 2.0.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 +12 -0
- package/dist/components/Loading/index.js +1 -2
- package/dist/components/Loading/styles.module.scss +1 -1
- package/dist/components/Loading/theme.js +2 -1
- package/dist/components/UTAlert/theme.js +3 -2
- package/dist/components/UTAttachment/layout.js +9 -7
- package/dist/components/UTAttachment/styles.module.scss +0 -1
- package/dist/components/UTAttachment/theme.js +2 -1
- package/dist/components/UTAutocomplete/theme.js +8 -6
- package/dist/components/UTAvatar/index.js +21 -8
- package/dist/components/UTBarChart/components/Legend/index.js +24 -20
- package/dist/components/UTBarChart/components/Pagination/index.js +26 -20
- package/dist/components/UTBarChart/components/YAxis/AxisElement/index.js +1 -1
- package/dist/components/UTBarChart/components/YAxis/index.js +1 -1
- package/dist/components/UTBarChart/index.js +7 -4
- package/dist/components/UTBarChart/theme.js +10 -7
- package/dist/components/UTBarChart/types.js +2 -2
- package/dist/components/UTBreadcrumbs/index.js +14 -8
- package/dist/components/UTBreadcrumbs/styles.module.scss +0 -6
- package/dist/components/UTBreadcrumbs/theme.js +2 -13
- package/dist/components/UTButton/README.md +35 -0
- package/dist/components/UTButton/constants.js +42 -0
- package/dist/components/UTButton/index.js +63 -83
- package/dist/components/UTButton/styles.module.scss +36 -0
- package/dist/components/UTButton/theme.js +143 -158
- package/dist/components/UTCBUInput/theme.js +2 -1
- package/dist/components/UTCard/components/UTCardFooter/index.js +5 -6
- package/dist/components/UTCard/index.js +23 -29
- package/dist/components/UTCard/theme.js +2 -1
- package/dist/components/UTCarousel/components/Button/index.js +1 -1
- package/dist/components/UTCarousel/components/Legend/index.js +1 -4
- package/dist/components/UTCarousel/components/Slider/component/Slide/index.js +2 -5
- package/dist/components/UTCarousel/components/Slider/index.js +45 -18
- package/dist/components/UTCarousel/components/Slider/layout.js +13 -12
- package/dist/components/UTCarousel/theme.js +2 -1
- package/dist/components/UTCheckList/index.js +11 -9
- package/dist/components/UTCheckList/theme.js +8 -3
- package/dist/components/UTCheckbox/index.js +34 -28
- package/dist/components/UTCheckbox/theme.js +11 -3
- package/dist/components/UTConsumptionBar/components/ConsumptionBarIndicator/index.js +7 -8
- package/dist/components/UTConsumptionBar/components/ConsumptionBarIndicator/styles.module.scss +1 -2
- package/dist/components/UTConsumptionBar/index.js +22 -13
- package/dist/components/UTConsumptionBar/styles.module.scss +0 -14
- package/dist/components/UTCuit/index.js +2 -2
- package/dist/components/UTCuit/theme.js +1 -1
- package/dist/components/UTDatePicker/index.js +29 -27
- package/dist/components/UTDatePicker/theme.js +22 -7
- package/dist/components/UTDialog/index.js +19 -23
- package/dist/components/UTDialog/theme.js +8 -23
- package/dist/components/UTDialog/types.js +5 -6
- package/dist/components/UTDotMenu/index.js +16 -8
- package/dist/components/UTEmojiPicker/theme.js +2 -1
- package/dist/components/UTFileInput/layout.js +5 -4
- package/dist/components/UTFileInput/styles.module.scss +0 -1
- package/dist/components/UTIconButton/theme.js +2 -1
- package/dist/components/UTImageRadio/components/ImageRadioCard/index.js +2 -2
- package/dist/components/UTImageRadio/index.js +2 -1
- package/dist/components/UTImageRadio/theme.js +15 -12
- package/dist/components/UTLabel/README.md +169 -0
- package/dist/components/UTLabel/constants.js +91 -0
- package/dist/components/UTLabel/index.js +41 -104
- package/dist/components/UTLabel/theme.js +29 -84
- package/dist/components/UTMap/index.js +7 -7
- package/dist/components/UTMap/styles.module.scss +0 -5
- package/dist/components/UTMenu/theme.js +3 -2
- package/dist/components/UTPanel/index.js +11 -10
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Error/index.js +4 -3
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Error/styles.module.scss +2 -2
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Validation/index.js +16 -16
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Validation/styles.module.scss +2 -2
- package/dist/components/UTPasswordField/components/PasswordValidations/index.js +11 -9
- package/dist/components/UTPasswordField/components/PasswordWarning/index.js +3 -3
- package/dist/components/UTPasswordField/components/PasswordWarning/styles.module.scss +1 -1
- package/dist/components/UTPasswordField/theme.js +13 -27
- package/dist/components/UTPhoneInput/index.js +4 -4
- package/dist/components/UTPhoneInput/theme.js +3 -6
- package/dist/components/UTPieChart/theme.js +2 -1
- package/dist/components/UTProgressBar/index.js +27 -20
- package/dist/components/UTProgressBar/theme.js +14 -13
- package/dist/components/UTRadioGroup/index.js +35 -22
- package/dist/components/UTRadioGroup/theme.js +10 -6
- package/dist/components/UTRating/components/Star/index.js +2 -1
- package/dist/components/UTRating/index.js +3 -1
- package/dist/components/UTRating/theme.js +3 -2
- package/dist/components/UTSelect/index.js +13 -3
- package/dist/components/UTSelect/styles.module.scss +5 -0
- package/dist/components/UTSelect/theme.js +7 -2
- package/dist/components/UTSidebar/theme.js +6 -5
- package/dist/components/UTSkeleton/index.js +3 -2
- package/dist/components/UTSwitch/index.js +2 -1
- package/dist/components/UTSwitch/theme.js +2 -1
- package/dist/components/UTTable/components/TableHeader/index.js +11 -7
- package/dist/components/UTTable/theme.js +31 -29
- package/dist/components/UTTabs/index.js +25 -20
- package/dist/components/UTTabs/theme.js +2 -1
- package/dist/components/UTTextArea/index.js +2 -1
- package/dist/components/UTTextArea/theme.js +2 -1
- package/dist/components/UTTextInput/index.js +16 -8
- package/dist/components/UTTextInput/styles.module.scss +3 -2
- package/dist/components/UTTextInput/theme.js +3 -2
- package/dist/components/UTToggle/components/ToggleOption/index.js +1 -0
- package/dist/components/UTToggle/theme.js +2 -1
- package/dist/components/UTTooltip/index.js +6 -4
- package/dist/components/UTTooltip/styles.module.scss +4 -2
- package/dist/components/UTTooltip/theme.js +2 -1
- package/dist/components/UTWorkflowContainer/components/ActionButton/index.js +12 -4
- package/dist/components/UTWorkflowContainer/index.js +19 -15
- package/dist/components/UTWorkflowContainer/styles.module.scss +0 -34
- package/dist/components/UTWorkflowContainer/theme.js +12 -58
- package/dist/components/UTWorkflowContainer/types.js +1 -1
- package/dist/components/WithTheme/layout.js +46 -42
- package/dist/scss/variables/_colors.scss +8 -0
- package/dist/theme.js +4 -1
- package/dist/types/formTypes.js +3 -3
- package/dist/utils/classesUtils.js +7 -3
- package/dist/utils/shadowUtils.js +40 -0
- package/package.json +5 -3
- package/dist/components/UTDialog/components/ActionButton/index.js +0 -35
- package/dist/components/UTLabel/styles.module.scss +0 -3
|
@@ -3,93 +3,38 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.retrieveStyle = void 0;
|
|
7
|
-
var _seamlessImmutable = require("seamless-immutable");
|
|
6
|
+
exports.variantsColorTheme = exports.retrieveStyle = exports.linkColor = void 0;
|
|
8
7
|
var _colors = _interopRequireDefault(require("../../scss/variables/_colors.scss"));
|
|
8
|
+
var _constants = require("./constants");
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
var
|
|
10
|
+
var variantsColorTheme = function variantsColorTheme(theme, colorTheme) {
|
|
11
|
+
var colorThemeDefinition = theme.Palette[colorTheme] || theme.Palette[_constants.DEFAULT_PROPS.colorTheme];
|
|
12
|
+
var colorNumber = colorTheme === _constants.COLOR_THEMES.gray ? '04' : colorTheme === _constants.COLOR_THEMES.light ? '01' : '05';
|
|
13
|
+
return colorThemeDefinition[colorNumber] || _colors.default.black;
|
|
14
|
+
};
|
|
15
|
+
exports.variantsColorTheme = variantsColorTheme;
|
|
16
|
+
var linkColor = function linkColor(theme, colorTheme) {
|
|
17
|
+
var color = colorTheme === _constants.COLOR_THEMES.light ? theme.Palette.actions.negative['05'] : colorTheme === _constants.COLOR_THEMES.error ? theme.Palette.actions.error['05'] : theme.Palette.actions.neutral['05'];
|
|
18
|
+
return color;
|
|
19
|
+
};
|
|
20
|
+
exports.linkColor = linkColor;
|
|
21
|
+
var retrieveStyle = function retrieveStyle(_ref) {
|
|
22
|
+
var _theme$Fonts;
|
|
23
|
+
var colorTheme = _ref.colorTheme,
|
|
24
|
+
theme = _ref.theme,
|
|
25
|
+
variant = _ref.variant,
|
|
26
|
+
weight = _ref.weight;
|
|
11
27
|
return {
|
|
12
|
-
|
|
13
|
-
color: (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
xxsmall: {
|
|
23
|
-
fontSize: (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'xxsmall'])
|
|
24
|
-
},
|
|
25
|
-
xsmall: {
|
|
26
|
-
fontSize: (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'xsmall'])
|
|
27
|
-
},
|
|
28
|
-
small: {
|
|
29
|
-
fontSize: (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'small'])
|
|
30
|
-
},
|
|
31
|
-
medium: {
|
|
32
|
-
fontSize: (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'medium'])
|
|
33
|
-
},
|
|
34
|
-
large: {
|
|
35
|
-
fontSize: (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'large'])
|
|
36
|
-
},
|
|
37
|
-
xlarge: {
|
|
38
|
-
fontSize: (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'xlarge'])
|
|
39
|
-
},
|
|
40
|
-
xxlarge: {
|
|
41
|
-
fontSize: (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'xxlarge'])
|
|
42
|
-
},
|
|
43
|
-
xxxlarge: {
|
|
44
|
-
fontSize: (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'xxxlarge'])
|
|
45
|
-
},
|
|
46
|
-
title: {
|
|
47
|
-
fontSize: (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'title'])
|
|
48
|
-
},
|
|
49
|
-
largeTitle: {
|
|
50
|
-
fontSize: (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'largeTitle'])
|
|
51
|
-
},
|
|
52
|
-
extraLight: {
|
|
53
|
-
fontWeight: (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'extraLight'], 200)
|
|
54
|
-
},
|
|
55
|
-
light: {
|
|
56
|
-
fontWeight: (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'light'], 300)
|
|
57
|
-
},
|
|
58
|
-
semibold: {
|
|
59
|
-
fontWeight: (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'semiBold'], 500)
|
|
60
|
-
},
|
|
61
|
-
bold: {
|
|
62
|
-
fontWeight: (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'bold'], 600)
|
|
63
|
-
},
|
|
64
|
-
extrabold: {
|
|
65
|
-
fontWeight: (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'extraBold'], 700)
|
|
66
|
-
},
|
|
67
|
-
primary: {
|
|
68
|
-
color: (0, _seamlessImmutable.getIn)(theme, ['UTLabel', 'primary', 'color'])
|
|
69
|
-
},
|
|
70
|
-
secondary: {
|
|
71
|
-
color: (0, _seamlessImmutable.getIn)(theme, ['UTLabel', 'secondary', 'color'])
|
|
72
|
-
},
|
|
73
|
-
alternative: {
|
|
74
|
-
color: (0, _seamlessImmutable.getIn)(theme, ['UTLabel', 'alternative', 'color'])
|
|
75
|
-
},
|
|
76
|
-
gray: {
|
|
77
|
-
color: (0, _seamlessImmutable.getIn)(theme, ['UTLabel', 'gray', 'color'])
|
|
78
|
-
},
|
|
79
|
-
darkGray: {
|
|
80
|
-
color: (0, _seamlessImmutable.getIn)(theme, ['UTLabel', 'darkGray', 'color'])
|
|
81
|
-
},
|
|
82
|
-
white: {
|
|
83
|
-
color: _colors.default.white
|
|
84
|
-
},
|
|
85
|
-
error: {
|
|
86
|
-
color: (0, _seamlessImmutable.getIn)(theme, ['UTLabel', 'error', 'color'])
|
|
87
|
-
},
|
|
88
|
-
uppercase: {
|
|
89
|
-
textTransform: 'uppercase'
|
|
90
|
-
},
|
|
91
|
-
lowercase: {
|
|
92
|
-
textTransform: 'lowercase'
|
|
28
|
+
root: {
|
|
29
|
+
color: variantsColorTheme(theme, colorTheme),
|
|
30
|
+
fontFamily: theme === null || theme === void 0 ? void 0 : (_theme$Fonts = theme.Fonts) === null || _theme$Fonts === void 0 ? void 0 : _theme$Fonts.fontFamily,
|
|
31
|
+
fontSize: _constants.VARIANTS_SIZES[variant] || _constants.VARIANTS_SIZES[_constants.DEFAULT_PROPS.variant],
|
|
32
|
+
fontWeight: _constants.WEIGHTS[weight] || _constants.WEIGHTS[_constants.DEFAULT_PROPS.weight],
|
|
33
|
+
lineHeight: _constants.VARIANTS_LINE_HEIGHT[variant] || _constants.VARIANTS_LINE_HEIGHT[_constants.DEFAULT_PROPS.variant],
|
|
34
|
+
margin: 0,
|
|
35
|
+
'& > a': {
|
|
36
|
+
color: linkColor(theme, colorTheme)
|
|
37
|
+
}
|
|
93
38
|
}
|
|
94
39
|
};
|
|
95
40
|
};
|
|
@@ -258,15 +258,15 @@ var UTMap = /*#__PURE__*/function (_PureComponent) {
|
|
|
258
258
|
showOnlyMap: showOnlyMap,
|
|
259
259
|
colorPolygon: this.props.colorPolygon,
|
|
260
260
|
colorBorderPolygon: this.props.colorBorderPolygon
|
|
261
|
-
})) : this.state.mapLoading ? /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
error: true
|
|
261
|
+
})) : this.state.mapLoading ? /*#__PURE__*/_react.default.createElement(_UTLabel.default, null, this.props.errors.retrievingLocation) : this.state.invalidConfiguration ? /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
262
|
+
colorTheme: "error",
|
|
263
|
+
variant: "small"
|
|
265
264
|
}, this.props.errors.invalidConfig) : /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
266
|
-
|
|
265
|
+
colorTheme: "error",
|
|
266
|
+
variant: "small"
|
|
267
267
|
}, this.props.errors.retrieveLocationError), !showOnlyMap && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
268
|
-
|
|
269
|
-
|
|
268
|
+
colorTheme: "error",
|
|
269
|
+
variant: "small",
|
|
270
270
|
className: _stylesModule.default.error
|
|
271
271
|
}, (0, _form.shouldShowErrors)(this.props.meta) ? this.props.meta.error : ''));
|
|
272
272
|
}
|
|
@@ -5,8 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.retrieveStyle = exports.retrieveMuiTheme = void 0;
|
|
7
7
|
var _styles = require("@material-ui/core/styles");
|
|
8
|
-
var retrieveStyle = function retrieveStyle(
|
|
8
|
+
var retrieveStyle = function retrieveStyle(_ref) {
|
|
9
9
|
var _theme$UTMenu, _theme$UTMenu$paper, _theme$UTMenu2, _theme$UTMenu2$paper, _theme$UTMenu3, _theme$UTMenu3$menuLi, _theme$UTMenu4, _theme$UTMenu4$menuLi, _theme$UTMenu5, _theme$UTMenu5$menuLi, _theme$UTMenu6, _theme$UTMenu6$menuLi, _theme$UTMenu7, _theme$UTMenu7$menuIt, _theme$UTMenu8, _theme$UTMenu8$menuIt, _theme$UTMenu9, _theme$UTMenu9$menuIt, _theme$UTMenu10, _theme$UTMenu10$poppe, _theme$UTMenu11, _theme$UTMenu11$menuI, _theme$UTMenu12, _theme$UTMenu12$menuI, _theme$UTMenu13, _theme$UTMenu13$menuI, _theme$UTMenu14, _theme$UTMenu14$menuI, _theme$UTMenu15, _theme$UTMenu15$menuI, _theme$UTMenu16, _theme$UTMenu16$menuI, _theme$UTMenu17, _theme$UTMenu17$menuI, _theme$UTMenu18, _theme$UTMenu18$scrol;
|
|
10
|
+
var theme = _ref.theme;
|
|
10
11
|
return {
|
|
11
12
|
paper: {
|
|
12
13
|
padding: theme === null || theme === void 0 ? void 0 : (_theme$UTMenu = theme.UTMenu) === null || _theme$UTMenu === void 0 ? void 0 : (_theme$UTMenu$paper = _theme$UTMenu.paper) === null || _theme$UTMenu$paper === void 0 ? void 0 : _theme$UTMenu$paper.padding,
|
|
@@ -46,7 +47,7 @@ var retrieveStyle = function retrieveStyle(theme) {
|
|
|
46
47
|
exports.retrieveStyle = retrieveStyle;
|
|
47
48
|
var retrieveMuiTheme = function retrieveMuiTheme(theme) {
|
|
48
49
|
var _theme$UTMenu19, _theme$UTMenu19$divid, _theme$UTMenu20, _theme$UTMenu20$divid;
|
|
49
|
-
return (0, _styles.
|
|
50
|
+
return (0, _styles.createTheme)({
|
|
50
51
|
overrides: {
|
|
51
52
|
MuiListItem: {
|
|
52
53
|
divider: {
|
|
@@ -11,7 +11,7 @@ require("react-perfect-scrollbar/dist/css/styles.css");
|
|
|
11
11
|
var _reactPerfectScrollbar = _interopRequireDefault(require("react-perfect-scrollbar"));
|
|
12
12
|
var _Close = _interopRequireDefault(require("@material-ui/icons/Close"));
|
|
13
13
|
var _propTypes = require("prop-types");
|
|
14
|
-
var
|
|
14
|
+
var _UTButton = _interopRequireDefault(require("../UTButton"));
|
|
15
15
|
var _UTLabel = _interopRequireDefault(require("../UTLabel"));
|
|
16
16
|
var _commonTypes = require("../../types/commonTypes");
|
|
17
17
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
@@ -71,16 +71,17 @@ var UTPanel = function UTPanel(_ref) {
|
|
|
71
71
|
}, TitleIcon && /*#__PURE__*/_react.default.createElement(TitleIcon, {
|
|
72
72
|
className: "".concat(_stylesModule.default.titleIcon, " ").concat(titleIconClass)
|
|
73
73
|
}), /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
weight: "semibold",
|
|
75
|
+
className: classes.title
|
|
76
|
+
}, title)), /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
77
|
+
classNames: {
|
|
78
|
+
icon: iconCloseClass,
|
|
79
|
+
root: closeButtonClass
|
|
80
|
+
},
|
|
81
|
+
Icon: _Close.default,
|
|
78
82
|
onClick: onClose,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}, /*#__PURE__*/_react.default.createElement(_Close.default, {
|
|
82
|
-
className: iconCloseClass
|
|
83
|
-
}))), disableScrollbar ? children : /*#__PURE__*/_react.default.createElement(_reactPerfectScrollbar.default, {
|
|
83
|
+
variant: "text"
|
|
84
|
+
})), disableScrollbar ? children : /*#__PURE__*/_react.default.createElement(_reactPerfectScrollbar.default, {
|
|
84
85
|
onYReachEnd: onEndReachedCallback,
|
|
85
86
|
className: "".concat(_stylesModule.default.perfectScrollbar, " ").concat(perfectScrollbarClass),
|
|
86
87
|
options: _objectSpread({
|
package/dist/components/UTPasswordField/components/PasswordValidations/components/Error/index.js
CHANGED
|
@@ -15,8 +15,7 @@ var ErrorMessage = function ErrorMessage(_ref) {
|
|
|
15
15
|
ErrorIcon = _ref.ErrorIcon,
|
|
16
16
|
classes = _ref.classes,
|
|
17
17
|
error = _ref.error;
|
|
18
|
-
var
|
|
19
|
-
failedIconStyle = classes.failedIconStyle,
|
|
18
|
+
var failedIconStyle = classes.failedIconStyle,
|
|
20
19
|
iconStyle = classes.iconStyle;
|
|
21
20
|
var Icon = ErrorIcon || _Info.default;
|
|
22
21
|
return !assertion && /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -24,7 +23,9 @@ var ErrorMessage = function ErrorMessage(_ref) {
|
|
|
24
23
|
}, /*#__PURE__*/_react.default.createElement(Icon, {
|
|
25
24
|
className: "".concat(iconStyle, " ").concat(failedIconStyle)
|
|
26
25
|
}), /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
27
|
-
className:
|
|
26
|
+
className: _stylesModule.default.label,
|
|
27
|
+
colorTheme: "error",
|
|
28
|
+
variant: "small"
|
|
28
29
|
}, error));
|
|
29
30
|
};
|
|
30
31
|
ErrorMessage.propTypes = {
|
|
@@ -13,24 +13,22 @@ var _UTLabel = _interopRequireDefault(require("../../../../../UTLabel"));
|
|
|
13
13
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
var Validation = function Validation(_ref) {
|
|
16
|
-
var
|
|
17
|
-
value = _ref.value,
|
|
16
|
+
var assertion = _ref.assertion,
|
|
18
17
|
classes = _ref.classes,
|
|
18
|
+
disabled = _ref.disabled,
|
|
19
|
+
NoValueIcon = _ref.NoValueIcon,
|
|
20
|
+
requirement = _ref.requirement,
|
|
21
|
+
shouldShowError = _ref.shouldShowError,
|
|
19
22
|
ValidationFailedIcon = _ref.ValidationFailedIcon,
|
|
20
23
|
ValidationPassedIcon = _ref.ValidationPassedIcon,
|
|
21
|
-
|
|
22
|
-
shouldShowError = _ref.shouldShowError,
|
|
23
|
-
NoValueIcon = _ref.NoValueIcon,
|
|
24
|
-
disabled = _ref.disabled;
|
|
24
|
+
value = _ref.value;
|
|
25
25
|
var passedIconStyle = classes.passedIconStyle,
|
|
26
26
|
failedIconStyle = classes.failedIconStyle,
|
|
27
|
-
successLabel = classes.successLabel,
|
|
28
|
-
failureLabel = classes.failureLabel,
|
|
29
|
-
labelStyle = classes.labelStyle,
|
|
30
27
|
iconStyle = classes.iconStyle;
|
|
31
28
|
var PassedIcon = ValidationPassedIcon || _CheckCircle.default;
|
|
32
29
|
var FailedIcon = ValidationFailedIcon || _Cancel.default;
|
|
33
30
|
var NoValue = NoValueIcon || _FiberManualRecord.default;
|
|
31
|
+
var labelColor = !value && !shouldShowError ? 'gray' : assertion ? 'success' : 'error';
|
|
34
32
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
35
33
|
className: _stylesModule.default.container
|
|
36
34
|
}, value || shouldShowError && !disabled ? assertion ? /*#__PURE__*/_react.default.createElement(PassedIcon, {
|
|
@@ -40,19 +38,21 @@ var Validation = function Validation(_ref) {
|
|
|
40
38
|
}) : /*#__PURE__*/_react.default.createElement(NoValue, {
|
|
41
39
|
className: iconStyle
|
|
42
40
|
}), /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
43
|
-
className:
|
|
41
|
+
className: _stylesModule.default.label,
|
|
42
|
+
colorTheme: labelColor,
|
|
43
|
+
variant: "small"
|
|
44
44
|
}, requirement));
|
|
45
45
|
};
|
|
46
46
|
Validation.propTypes = {
|
|
47
|
-
|
|
48
|
-
value: _propTypes.string,
|
|
47
|
+
assertion: _propTypes.bool,
|
|
49
48
|
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
49
|
+
disabled: _propTypes.bool,
|
|
50
|
+
NoValueIcon: _propTypes.elementType,
|
|
51
|
+
requirement: _propTypes.string,
|
|
52
|
+
shouldShowError: _propTypes.bool,
|
|
50
53
|
ValidationFailedIcon: _propTypes.elementType,
|
|
51
54
|
ValidationPassedIcon: _propTypes.elementType,
|
|
52
|
-
|
|
53
|
-
shouldShowError: _propTypes.bool,
|
|
54
|
-
NoValueIcon: _propTypes.elementType,
|
|
55
|
-
disabled: _propTypes.bool
|
|
55
|
+
value: _propTypes.string
|
|
56
56
|
};
|
|
57
57
|
var _default = Validation;
|
|
58
58
|
exports.default = _default;
|
|
@@ -68,15 +68,16 @@ var PasswordValidations = function PasswordValidations(_ref) {
|
|
|
68
68
|
var requirement = _ref8.requirement,
|
|
69
69
|
assertion = _ref8.assertion;
|
|
70
70
|
return /*#__PURE__*/_react.default.createElement(_Validation.default, {
|
|
71
|
-
disabled: disabled,
|
|
72
|
-
ValidationFailedIcon: ValidationFailedIcon,
|
|
73
|
-
ValidationPassedIcon: ValidationPassedIcon,
|
|
74
|
-
requirement: requirement,
|
|
75
71
|
assertion: assertion,
|
|
76
72
|
classes: classes,
|
|
77
|
-
|
|
73
|
+
disabled: disabled,
|
|
74
|
+
key: requirement,
|
|
75
|
+
NoValueIcon: NoValueIcon,
|
|
76
|
+
requirement: requirement,
|
|
78
77
|
shouldShowError: submitFailed,
|
|
79
|
-
|
|
78
|
+
ValidationFailedIcon: ValidationFailedIcon,
|
|
79
|
+
ValidationPassedIcon: ValidationPassedIcon,
|
|
80
|
+
value: value
|
|
80
81
|
});
|
|
81
82
|
}), submitFailed && showErrors && /*#__PURE__*/_react.default.createElement("div", {
|
|
82
83
|
className: errorsContainerStyle
|
|
@@ -87,18 +88,19 @@ var PasswordValidations = function PasswordValidations(_ref) {
|
|
|
87
88
|
ErrorIcon: ErrorIcon,
|
|
88
89
|
classes: classes,
|
|
89
90
|
assertion: assertion,
|
|
90
|
-
error: error
|
|
91
|
+
error: error,
|
|
92
|
+
key: error
|
|
91
93
|
});
|
|
92
94
|
})));
|
|
93
95
|
};
|
|
94
96
|
PasswordValidations.propTypes = {
|
|
95
97
|
passwordValidations: (0, _propTypes.arrayOf)((0, _propTypes.shape)({
|
|
96
|
-
expression: _propTypes.string,
|
|
98
|
+
expression: (0, _propTypes.oneOfType)([_propTypes.string, (0, _propTypes.instanceOf)(RegExp)]),
|
|
97
99
|
requirement: _propTypes.string,
|
|
98
100
|
error: _propTypes.string
|
|
99
101
|
})),
|
|
100
102
|
passwordValidationsWarning: (0, _propTypes.arrayOf)((0, _propTypes.shape)({
|
|
101
|
-
expression: _propTypes.string,
|
|
103
|
+
expression: (0, _propTypes.oneOfType)([_propTypes.string, (0, _propTypes.instanceOf)(RegExp)]),
|
|
102
104
|
requirement: _propTypes.string,
|
|
103
105
|
error: _propTypes.string
|
|
104
106
|
})),
|
|
@@ -24,8 +24,7 @@ var PasswordWarning = function PasswordWarning(_ref) {
|
|
|
24
24
|
passwordValidationsWarning = _ref.passwordValidationsWarning,
|
|
25
25
|
value = _ref.value,
|
|
26
26
|
WarningIcon = _ref.WarningIcon;
|
|
27
|
-
var
|
|
28
|
-
warningDivider = classes.warningDivider;
|
|
27
|
+
var warningDivider = classes.warningDivider;
|
|
29
28
|
var validatedRegExps = passwordValidationsWarning.map(function (_ref2) {
|
|
30
29
|
var expression = _ref2.expression,
|
|
31
30
|
regex = _objectWithoutProperties(_ref2, _excluded);
|
|
@@ -43,7 +42,8 @@ var PasswordWarning = function PasswordWarning(_ref) {
|
|
|
43
42
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
44
43
|
className: _stylesModule.default.iconAndLabelContainer
|
|
45
44
|
}, /*#__PURE__*/_react.default.createElement(WarningIcon, null), /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
46
|
-
className:
|
|
45
|
+
className: _stylesModule.default.warning,
|
|
46
|
+
colorTheme: "warning"
|
|
47
47
|
}, error)));
|
|
48
48
|
});
|
|
49
49
|
};
|
|
@@ -4,45 +4,31 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.retrieveStyle = void 0;
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
var
|
|
7
|
+
var _classesUtils = require("../../utils/classesUtils");
|
|
8
|
+
var retrieveStyle = function retrieveStyle(_ref) {
|
|
9
|
+
var _theme$UTPasswordFiel, _theme$UTPasswordFiel2, _theme$UTPasswordFiel3, _theme$UTPasswordFiel4, _theme$UTPasswordFiel5, _theme$UTPasswordFiel6, _theme$UTPasswordFiel7, _theme$UTPasswordFiel8;
|
|
10
|
+
var theme = _ref.theme;
|
|
11
11
|
return {
|
|
12
|
-
labelStyle: {
|
|
13
|
-
fontWeight: "".concat((0, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'label', 'fontWeight']), " !important"),
|
|
14
|
-
fontSize: "".concat((0, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'label', 'fontSize']), " !important"),
|
|
15
|
-
color: "".concat((0, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'label', 'color']), " !important")
|
|
16
|
-
},
|
|
17
|
-
successLabel: {
|
|
18
|
-
color: "".concat((0, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'success', 'color'], _colors.default.green), " !important")
|
|
19
|
-
},
|
|
20
|
-
failureLabel: {
|
|
21
|
-
color: "".concat((0, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'failure', 'color'], _colors.default.red), " !important")
|
|
22
|
-
},
|
|
23
12
|
iconStyle: {
|
|
24
|
-
height: (0
|
|
25
|
-
width: (0
|
|
26
|
-
borderRadius: (0
|
|
13
|
+
height: (theme === null || theme === void 0 ? void 0 : (_theme$UTPasswordFiel = theme.UTPasswordField) === null || _theme$UTPasswordFiel === void 0 ? void 0 : (_theme$UTPasswordFiel2 = _theme$UTPasswordFiel.icon) === null || _theme$UTPasswordFiel2 === void 0 ? void 0 : _theme$UTPasswordFiel2.size) || '1rem',
|
|
14
|
+
width: (theme === null || theme === void 0 ? void 0 : (_theme$UTPasswordFiel3 = theme.UTPasswordField) === null || _theme$UTPasswordFiel3 === void 0 ? void 0 : (_theme$UTPasswordFiel4 = _theme$UTPasswordFiel3.icon) === null || _theme$UTPasswordFiel4 === void 0 ? void 0 : _theme$UTPasswordFiel4.size) || '1rem',
|
|
15
|
+
borderRadius: (theme === null || theme === void 0 ? void 0 : (_theme$UTPasswordFiel5 = theme.UTPasswordField) === null || _theme$UTPasswordFiel5 === void 0 ? void 0 : (_theme$UTPasswordFiel6 = _theme$UTPasswordFiel5.icon) === null || _theme$UTPasswordFiel6 === void 0 ? void 0 : _theme$UTPasswordFiel6.borderRadius) || '50%'
|
|
27
16
|
},
|
|
28
17
|
passedIconStyle: {
|
|
29
|
-
fill:
|
|
18
|
+
fill: theme.Palette.success['05']
|
|
30
19
|
},
|
|
31
20
|
failedIconStyle: {
|
|
32
|
-
fill:
|
|
21
|
+
fill: theme.Palette.error['05']
|
|
33
22
|
},
|
|
34
23
|
errorsContainerStyle: {
|
|
35
|
-
borderTop: "1px solid ".concat(
|
|
36
|
-
marginTop:
|
|
37
|
-
},
|
|
38
|
-
warningLabel: {
|
|
39
|
-
color: "".concat((0, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'warningLabel', 'color']), " !important")
|
|
24
|
+
borderTop: "1px solid ".concat(theme.Palette.error['05']),
|
|
25
|
+
marginTop: 7
|
|
40
26
|
},
|
|
41
27
|
warningDivider: {
|
|
42
|
-
backgroundColor:
|
|
28
|
+
backgroundColor: (0, _classesUtils.withImportant)(theme.Palette.warning['05'])
|
|
43
29
|
},
|
|
44
30
|
validationContainer: {
|
|
45
|
-
margin:
|
|
31
|
+
margin: (0, _classesUtils.withImportant)(theme === null || theme === void 0 ? void 0 : (_theme$UTPasswordFiel7 = theme.UTPasswordField) === null || _theme$UTPasswordFiel7 === void 0 ? void 0 : (_theme$UTPasswordFiel8 = _theme$UTPasswordFiel7.validationContainer) === null || _theme$UTPasswordFiel8 === void 0 ? void 0 : _theme$UTPasswordFiel8.margin)
|
|
46
32
|
}
|
|
47
33
|
};
|
|
48
34
|
};
|
|
@@ -273,10 +273,10 @@ var UTPhoneInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
273
273
|
input: inputClassName
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
|
-
}, phoneNumberFieldProps)))), /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
}, error ||
|
|
276
|
+
}, phoneNumberFieldProps)))), (error || (0, _form.shouldShowErrors)(meta)) && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
277
|
+
colorTheme: "error",
|
|
278
|
+
variant: "small"
|
|
279
|
+
}, error || meta.error));
|
|
280
280
|
}
|
|
281
281
|
}]);
|
|
282
282
|
return UTPhoneInput;
|
|
@@ -8,7 +8,8 @@ var _seamlessImmutable = require("seamless-immutable");
|
|
|
8
8
|
var _styles = require("@material-ui/core/styles");
|
|
9
9
|
var _colors = _interopRequireDefault(require("../../scss/variables/_colors.scss"));
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
var retrieveStyle = function retrieveStyle(
|
|
11
|
+
var retrieveStyle = function retrieveStyle(_ref) {
|
|
12
|
+
var theme = _ref.theme;
|
|
12
13
|
return {
|
|
13
14
|
container: {
|
|
14
15
|
display: (0, _seamlessImmutable.getIn)(theme, ['UTTextInput', 'container', 'display'], 'flex'),
|
|
@@ -34,10 +35,6 @@ var retrieveStyle = function retrieveStyle(theme) {
|
|
|
34
35
|
width: '100%',
|
|
35
36
|
alignItems: 'center'
|
|
36
37
|
},
|
|
37
|
-
labelError: {
|
|
38
|
-
color: (0, _seamlessImmutable.getIn)(theme, ['UTTextInput', 'labelError', 'color'], _colors.default.error),
|
|
39
|
-
fontSize: (0, _seamlessImmutable.getIn)(theme, ['UTTextInput', 'labelError', 'fontSize'], (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'small'], 12))
|
|
40
|
-
},
|
|
41
38
|
tooltip: {
|
|
42
39
|
color: (0, _seamlessImmutable.getIn)(theme, ['UTPhoneInput', 'tooltip', 'color'], _colors.default.white)
|
|
43
40
|
},
|
|
@@ -52,7 +49,7 @@ var retrieveStyle = function retrieveStyle(theme) {
|
|
|
52
49
|
};
|
|
53
50
|
exports.retrieveStyle = retrieveStyle;
|
|
54
51
|
var retrieveMuiTheme = function retrieveMuiTheme(theme) {
|
|
55
|
-
return (0, _styles.
|
|
52
|
+
return (0, _styles.createTheme)({
|
|
56
53
|
typography: {
|
|
57
54
|
fontFamily: (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'fontFamily'])
|
|
58
55
|
},
|
|
@@ -5,7 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.retrieveStyle = void 0;
|
|
7
7
|
var _seamlessImmutable = require("seamless-immutable");
|
|
8
|
-
var retrieveStyle = function retrieveStyle(
|
|
8
|
+
var retrieveStyle = function retrieveStyle(_ref) {
|
|
9
|
+
var theme = _ref.theme;
|
|
9
10
|
return {
|
|
10
11
|
legendLabel: {
|
|
11
12
|
fontWeight: (0, _seamlessImmutable.getIn)(theme, ['UTPieChart', 'legendLabel', 'fontWeight']),
|
|
@@ -1,58 +1,65 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.default = void 0;
|
|
7
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
9
|
var _propTypes = require("prop-types");
|
|
9
10
|
var _core = require("@material-ui/core");
|
|
10
11
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
11
|
-
var _UTLabel = _interopRequireDefault(require("../UTLabel"));
|
|
12
12
|
var _WithTheme = _interopRequireDefault(require("../WithTheme"));
|
|
13
|
+
var _classesUtils = require("../../utils/classesUtils");
|
|
13
14
|
var _types = require("./types");
|
|
14
15
|
var _constants = require("./constants");
|
|
15
16
|
var _theme = require("./theme");
|
|
16
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
20
|
var UTProgressBar = function UTProgressBar(_ref) {
|
|
18
|
-
var
|
|
19
|
-
|
|
21
|
+
var themeClasses = _ref.classes,
|
|
22
|
+
classNames = _ref.classNames,
|
|
20
23
|
customLabel = _ref.customLabel,
|
|
24
|
+
customLabelStyle = _ref.customLabelStyle,
|
|
21
25
|
value = _ref.value,
|
|
22
26
|
variant = _ref.variant,
|
|
23
|
-
withLabel = _ref.withLabel
|
|
24
|
-
customLabelStyle = _ref.customLabelStyle;
|
|
27
|
+
withLabel = _ref.withLabel;
|
|
25
28
|
var clampedValue = _lodash.default.clamp(value, _constants.MIN_PERCENTAGE, _constants.MAX_PERCENTAGE);
|
|
29
|
+
var classes = (0, _react.useMemo)(function () {
|
|
30
|
+
return (0, _classesUtils.mergeClasses)(themeClasses, classNames);
|
|
31
|
+
}, [classNames]);
|
|
26
32
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
27
|
-
className:
|
|
33
|
+
className: classes.container
|
|
28
34
|
}, /*#__PURE__*/_react.default.createElement(_core.LinearProgress, {
|
|
29
|
-
variant: variant,
|
|
30
|
-
value: clampedValue,
|
|
31
35
|
classes: {
|
|
32
|
-
|
|
33
|
-
colorPrimary:
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
barColorPrimary: classes.barColorPrimary,
|
|
37
|
+
colorPrimary: classes.colorPrimary,
|
|
38
|
+
root: classes.root
|
|
39
|
+
},
|
|
40
|
+
variant: variant,
|
|
41
|
+
value: clampedValue
|
|
42
|
+
}), withLabel && /*#__PURE__*/_react.default.createElement("div", {
|
|
43
|
+
className: classes.label
|
|
44
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
38
45
|
style: customLabelStyle
|
|
39
|
-
}, customLabel || "".concat(clampedValue, "%")));
|
|
46
|
+
}, customLabel || "".concat(clampedValue, "%"))));
|
|
40
47
|
};
|
|
41
48
|
UTProgressBar.defaultProps = {
|
|
42
49
|
classes: {},
|
|
43
50
|
classNames: {},
|
|
51
|
+
customLabelStyle: {},
|
|
44
52
|
variant: 'determinate',
|
|
45
|
-
withLabel: false
|
|
46
|
-
customLabelStyle: {}
|
|
53
|
+
withLabel: false
|
|
47
54
|
};
|
|
48
55
|
UTProgressBar.propTypes = {
|
|
49
56
|
classes: _types.classesType,
|
|
50
57
|
classNames: _types.classesType,
|
|
51
58
|
customLabel: _propTypes.string,
|
|
59
|
+
customLabelStyle: _propTypes.object,
|
|
52
60
|
value: _propTypes.number.isRequired,
|
|
53
61
|
variant: _propTypes.string,
|
|
54
|
-
withLabel: _propTypes.bool
|
|
55
|
-
customLabelStyle: _propTypes.object
|
|
62
|
+
withLabel: _propTypes.bool
|
|
56
63
|
};
|
|
57
64
|
var _default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTProgressBar);
|
|
58
65
|
exports.default = _default;
|