@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
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.VARIANTS = exports.SIZES = exports.ICON_PLACEMENTS = exports.DEFAULT_PROPS = exports.COLORS_MAPPER = void 0;
|
|
7
|
+
var VARIANTS = {
|
|
8
|
+
filled: 'contained',
|
|
9
|
+
outlined: 'outlined',
|
|
10
|
+
semitransparent: 'contained',
|
|
11
|
+
text: 'text',
|
|
12
|
+
shadow: 'text'
|
|
13
|
+
};
|
|
14
|
+
exports.VARIANTS = VARIANTS;
|
|
15
|
+
var SIZES = {
|
|
16
|
+
small: 'small',
|
|
17
|
+
medium: 'medium',
|
|
18
|
+
large: 'large'
|
|
19
|
+
};
|
|
20
|
+
exports.SIZES = SIZES;
|
|
21
|
+
var ICON_PLACEMENTS = {
|
|
22
|
+
left: 'left',
|
|
23
|
+
right: 'right'
|
|
24
|
+
};
|
|
25
|
+
exports.ICON_PLACEMENTS = ICON_PLACEMENTS;
|
|
26
|
+
var DEFAULT_PROPS = {
|
|
27
|
+
colorTheme: 'secondary',
|
|
28
|
+
disabled: false,
|
|
29
|
+
hideTextOnResponsive: false,
|
|
30
|
+
iconPlacement: ICON_PLACEMENTS.left,
|
|
31
|
+
loading: false,
|
|
32
|
+
size: SIZES.medium,
|
|
33
|
+
variant: 'filled'
|
|
34
|
+
};
|
|
35
|
+
exports.DEFAULT_PROPS = DEFAULT_PROPS;
|
|
36
|
+
var COLORS_MAPPER = {
|
|
37
|
+
primary: 'accent',
|
|
38
|
+
secondary: 'neutral',
|
|
39
|
+
error: 'error',
|
|
40
|
+
negative: 'negative'
|
|
41
|
+
};
|
|
42
|
+
exports.COLORS_MAPPER = COLORS_MAPPER;
|
|
@@ -6,100 +6,80 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _propTypes = require("prop-types");
|
|
10
9
|
var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
|
|
11
10
|
var _CircularProgress = _interopRequireDefault(require("@material-ui/core/CircularProgress"));
|
|
11
|
+
var _propTypes = require("prop-types");
|
|
12
12
|
var _WithTheme = _interopRequireDefault(require("../WithTheme"));
|
|
13
|
+
var _classesUtils = require("../../utils/classesUtils");
|
|
14
|
+
var _constants = require("./constants");
|
|
13
15
|
var _theme = require("./theme");
|
|
16
|
+
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
17
|
+
var _excluded = ["childrenContainer", "circularProgress", "icon", "leftIcon", "rightIcon"];
|
|
14
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
19
|
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); }
|
|
16
20
|
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
|
-
function
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
style: style,
|
|
66
|
-
variant: text ? 'text' : fab ? 'fab' : extendedFab ? 'extendedFab' : outlined ? 'outlined' : 'contained',
|
|
67
|
-
disabled: disabled || loading,
|
|
68
|
-
onClick: onPress,
|
|
69
|
-
classes: {
|
|
70
|
-
root: "".concat(small ? classes.small : large && classes.large, " ").concat(uppercase ? classes.uppercase : lowercase && classes.lowercase, " ").concat(className),
|
|
71
|
-
label: classes.labelFullWidth,
|
|
72
|
-
contained: "".concat(classes.base, " ").concat(secondary && classes.secondary, " ").concat(alternative && classes.alternative, " ").concat(gray && classes.gray),
|
|
73
|
-
text: "".concat(classes.baseText, " ").concat(secondary && classes.secondaryText, " ").concat(alternative && classes.alternativeText, " ").concat(gray && classes.grayText),
|
|
74
|
-
outlined: "".concat(classes.baseOutlined, " ").concat(secondary && classes.secondaryOutlined, " ").concat(alternative && classes.alternativeOutlined, " ").concat(gray && classes.grayOutlined)
|
|
75
|
-
}
|
|
76
|
-
}, children, loading && /*#__PURE__*/_react.default.createElement(_CircularProgress.default, {
|
|
77
|
-
size: 24,
|
|
78
|
-
className: classes["loading".concat(outlined ? 'Outlined' : text ? 'Text' : '')]
|
|
79
|
-
}));
|
|
80
|
-
}
|
|
81
|
-
}]);
|
|
82
|
-
return UTButton;
|
|
83
|
-
}(_react.PureComponent);
|
|
21
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
22
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
23
|
+
var UTButton = function UTButton(_ref) {
|
|
24
|
+
var children = _ref.children,
|
|
25
|
+
theme = _ref.classes,
|
|
26
|
+
classNames = _ref.classNames,
|
|
27
|
+
disabled = _ref.disabled,
|
|
28
|
+
hideTextOnResponsive = _ref.hideTextOnResponsive,
|
|
29
|
+
Icon = _ref.Icon,
|
|
30
|
+
iconPlacement = _ref.iconPlacement,
|
|
31
|
+
loading = _ref.loading,
|
|
32
|
+
onClick = _ref.onClick,
|
|
33
|
+
size = _ref.size,
|
|
34
|
+
style = _ref.style,
|
|
35
|
+
type = _ref.type,
|
|
36
|
+
variant = _ref.variant;
|
|
37
|
+
var classes = (0, _react.useMemo)(function () {
|
|
38
|
+
return (0, _classesUtils.mergeClasses)(theme, classNames);
|
|
39
|
+
});
|
|
40
|
+
var childrenContainer = classes.childrenContainer,
|
|
41
|
+
circularProgress = classes.circularProgress,
|
|
42
|
+
icon = classes.icon,
|
|
43
|
+
leftIcon = classes.leftIcon,
|
|
44
|
+
rightIcon = classes.rightIcon,
|
|
45
|
+
materialButtonClasses = _objectWithoutProperties(classes, _excluded);
|
|
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 ").concat(!children && _stylesModule.default.withoutText, "\n ")
|
|
48
|
+
}, iconPlacement === _constants.ICON_PLACEMENTS.left && Icon && /*#__PURE__*/_react.default.createElement(Icon, {
|
|
49
|
+
className: "".concat(icon, " ").concat(leftIcon, " ").concat(_stylesModule.default.icon)
|
|
50
|
+
}), children && /*#__PURE__*/_react.default.createElement("div", {
|
|
51
|
+
className: "".concat(_stylesModule.default.text, " ").concat(classes.text)
|
|
52
|
+
}, children), iconPlacement !== _constants.ICON_PLACEMENTS.left && Icon && /*#__PURE__*/_react.default.createElement(Icon, {
|
|
53
|
+
className: "".concat(icon, " ").concat(rightIcon, " ").concat(_stylesModule.default.icon)
|
|
54
|
+
}));
|
|
55
|
+
return /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
56
|
+
disabled: disabled || loading,
|
|
57
|
+
classes: materialButtonClasses,
|
|
58
|
+
onClick: onClick,
|
|
59
|
+
size: size,
|
|
60
|
+
variant: _constants.VARIANTS[variant],
|
|
61
|
+
type: type,
|
|
62
|
+
style: style
|
|
63
|
+
}, RenderedChildren, loading && /*#__PURE__*/_react.default.createElement(_CircularProgress.default, {
|
|
64
|
+
size: 24,
|
|
65
|
+
className: "".concat(_stylesModule.default.loading, " ").concat(circularProgress)
|
|
66
|
+
}));
|
|
67
|
+
};
|
|
68
|
+
UTButton.defaultProps = _constants.DEFAULT_PROPS;
|
|
84
69
|
UTButton.propTypes = {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
large: _propTypes.bool,
|
|
88
|
-
outlined: _propTypes.bool,
|
|
89
|
-
secondary: _propTypes.bool,
|
|
90
|
-
alternative: _propTypes.bool,
|
|
91
|
-
gray: _propTypes.bool,
|
|
92
|
-
fab: _propTypes.bool,
|
|
93
|
-
extendedFab: _propTypes.bool,
|
|
70
|
+
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
71
|
+
classNames: (0, _propTypes.objectOf)(_propTypes.string),
|
|
94
72
|
disabled: _propTypes.bool,
|
|
73
|
+
hideTextOnResponsive: _propTypes.bool,
|
|
74
|
+
Icon: _propTypes.elementType,
|
|
75
|
+
iconPlacement: _propTypes.string,
|
|
95
76
|
loading: _propTypes.bool,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
77
|
+
onClick: _propTypes.func,
|
|
78
|
+
size: _propTypes.string,
|
|
79
|
+
// TODO: this "style" prop is for compatibility with the -base project only. Delete it when no longer needed
|
|
80
|
+
style: _propTypes.object,
|
|
99
81
|
type: _propTypes.string,
|
|
100
|
-
|
|
101
|
-
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
102
|
-
className: _propTypes.string
|
|
82
|
+
variant: _propTypes.string
|
|
103
83
|
};
|
|
104
84
|
var _default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTButton);
|
|
105
85
|
exports.default = _default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
@import '../../scss/variables/mediaQueries';
|
|
2
|
+
|
|
3
|
+
.hideTextOnResponsive {
|
|
4
|
+
@media #{$mobile} {
|
|
5
|
+
.text {
|
|
6
|
+
display: none;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.icon {
|
|
10
|
+
margin: 0 -4px;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.icon {
|
|
16
|
+
flex-shrink: 0;
|
|
17
|
+
font-size: 24px;
|
|
18
|
+
height: 24px;
|
|
19
|
+
width: 24px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.withoutText {
|
|
23
|
+
.icon {
|
|
24
|
+
margin: 0 -4px;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.childrenContainer {
|
|
29
|
+
align-items: center;
|
|
30
|
+
display: flex;
|
|
31
|
+
justify-content: flex-start;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.loading {
|
|
35
|
+
position: absolute;
|
|
36
|
+
}
|
|
@@ -3,185 +3,170 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.retrieveStyle = void 0;
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
6
|
+
exports.variantsColorTheme = exports.retrieveStyle = void 0;
|
|
7
|
+
var _classesUtils = require("../../utils/classesUtils");
|
|
8
|
+
var _shadowUtils = require("../../utils/shadowUtils");
|
|
9
|
+
var _constants = require("./constants");
|
|
10
|
+
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); }
|
|
11
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
16
|
+
var variantsColorTheme = function variantsColorTheme(theme, colorTheme, variant) {
|
|
17
|
+
var actionColorName = _constants.COLORS_MAPPER[colorTheme] || _constants.COLORS_MAPPER[_constants.DEFAULT_PROPS.colorTheme];
|
|
18
|
+
var actionTheme = theme.Palette.actions[actionColorName];
|
|
19
|
+
var negativeTheme = theme.Palette.actions[_constants.COLORS_MAPPER.negative];
|
|
20
|
+
var neutralTheme = theme.Palette.actions[_constants.COLORS_MAPPER.secondary];
|
|
21
|
+
var definition = {
|
|
22
|
+
filled: {
|
|
23
|
+
backgroundColor: actionTheme['04'],
|
|
24
|
+
border: '1px solid transparent',
|
|
25
|
+
color: colorTheme === _constants.COLORS_MAPPER.negative ? neutralTheme['05'] : negativeTheme['05'],
|
|
26
|
+
fill: colorTheme === _constants.COLORS_MAPPER.negative ? neutralTheme['05'] : negativeTheme['05'],
|
|
22
27
|
'&:hover': {
|
|
23
|
-
backgroundColor:
|
|
24
|
-
boxShadow: (0,
|
|
28
|
+
backgroundColor: actionTheme['03'],
|
|
29
|
+
boxShadow: (0, _shadowUtils.getShadow)({
|
|
30
|
+
color: actionTheme['04'],
|
|
31
|
+
level: 2
|
|
32
|
+
})
|
|
25
33
|
},
|
|
26
|
-
'&:
|
|
27
|
-
backgroundColor:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
baseText: {
|
|
33
|
-
textTransform: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'baseText', 'textTransform'], 'none'),
|
|
34
|
-
backgroundColor: _colors.default.transparent,
|
|
35
|
-
borderRadius: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'baseText', 'borderRadius']),
|
|
36
|
-
boxShadow: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'baseText', 'boxShadow']),
|
|
37
|
-
color: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'baseText', 'color']),
|
|
38
|
-
fontFamily: (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'fontFamily']),
|
|
39
|
-
fontSize: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'baseText', 'fontSize'], (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'medium'])),
|
|
40
|
-
fontWeight: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'baseText', 'fontWeight']),
|
|
41
|
-
padding: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'baseText', 'padding']),
|
|
42
|
-
'&:hover': {
|
|
43
|
-
backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'baseText', 'hover', 'backgroundColor']),
|
|
44
|
-
color: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'baseText', 'hover', 'color'])
|
|
34
|
+
'&:active': {
|
|
35
|
+
backgroundColor: actionTheme['05'],
|
|
36
|
+
boxShadow: (0, _shadowUtils.getShadow)({
|
|
37
|
+
color: actionTheme['04'],
|
|
38
|
+
level: 2
|
|
39
|
+
})
|
|
45
40
|
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
padding: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'disabledText', 'padding'])
|
|
41
|
+
disabled: {
|
|
42
|
+
color: (0, _classesUtils.withImportant)(colorTheme === _constants.COLORS_MAPPER.negative ? neutralTheme['05'] : negativeTheme['05']),
|
|
43
|
+
backgroundColor: (0, _classesUtils.withImportant)(actionTheme['04']),
|
|
44
|
+
opacity: (0, _classesUtils.withImportant)(0.5)
|
|
51
45
|
}
|
|
52
46
|
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
borderRadius: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'baseOutlined', 'borderRadius']),
|
|
59
|
-
boxShadow: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'baseOutlined', 'boxShadow']),
|
|
60
|
-
color: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'baseOutlined', 'color']),
|
|
61
|
-
fontFamily: (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'fontFamily']),
|
|
62
|
-
fontSize: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'baseOutlined', 'fontSize'], (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'medium'])),
|
|
63
|
-
fontWeight: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'baseOutlined', 'fontWeight']),
|
|
64
|
-
padding: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'baseOutlined', 'padding']),
|
|
65
|
-
'&:hover': {
|
|
66
|
-
backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'baseOutlined', 'hover', 'backgroundColor']),
|
|
67
|
-
color: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'baseOutlined', 'hover', 'color'])
|
|
68
|
-
},
|
|
69
|
-
'&:disabled': {
|
|
70
|
-
backgroundColor: _colors.default.transparent,
|
|
71
|
-
border: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'disabledOutlined', 'border']),
|
|
72
|
-
borderColor: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'disabledOutlined', 'borderColor']),
|
|
73
|
-
color: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'disabledOutlined', 'color']),
|
|
74
|
-
padding: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'disabledOutlined', 'padding'])
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
secondary: {
|
|
78
|
-
backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'secondary', 'backgroundColor']),
|
|
79
|
-
color: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'secondary', 'color']),
|
|
80
|
-
'&:hover': {
|
|
81
|
-
backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'secondary', 'hover', 'backgroundColor'])
|
|
82
|
-
},
|
|
83
|
-
padding: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'secondary', 'padding'])
|
|
84
|
-
},
|
|
85
|
-
secondaryText: {
|
|
86
|
-
backgroundColor: _colors.default.transparent,
|
|
87
|
-
color: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'secondaryText', 'color']),
|
|
47
|
+
semitransparent: {
|
|
48
|
+
backgroundColor: actionTheme['01'],
|
|
49
|
+
border: '1px solid transparent',
|
|
50
|
+
color: actionTheme['05'],
|
|
51
|
+
fill: actionTheme['05'],
|
|
88
52
|
'&:hover': {
|
|
89
|
-
backgroundColor:
|
|
53
|
+
backgroundColor: actionTheme['02']
|
|
90
54
|
},
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
secondaryOutlined: {
|
|
94
|
-
backgroundColor: _colors.default.transparent,
|
|
95
|
-
border: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'secondaryOutlined', 'border']),
|
|
96
|
-
borderColor: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'secondaryOutlined', 'borderColor']),
|
|
97
|
-
color: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'secondaryOutlined', 'color']),
|
|
98
|
-
'&:hover': {
|
|
99
|
-
backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'secondaryOutlined', 'hover', 'backgroundColor'])
|
|
55
|
+
'&:active': {
|
|
56
|
+
backgroundColor: actionTheme['03']
|
|
100
57
|
},
|
|
101
|
-
|
|
58
|
+
disabled: {
|
|
59
|
+
color: (0, _classesUtils.withImportant)(actionTheme['05']),
|
|
60
|
+
opacity: (0, _classesUtils.withImportant)(0.5)
|
|
61
|
+
}
|
|
102
62
|
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
color:
|
|
63
|
+
outlined: {
|
|
64
|
+
border: "1px solid ".concat(actionTheme['05']),
|
|
65
|
+
color: actionTheme['05'],
|
|
66
|
+
fill: actionTheme['05'],
|
|
106
67
|
'&:hover': {
|
|
107
|
-
backgroundColor:
|
|
68
|
+
backgroundColor: actionTheme['01']
|
|
108
69
|
},
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
alternativeText: {
|
|
112
|
-
backgroundColor: _colors.default.transparent,
|
|
113
|
-
color: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'alternativeText', 'color']),
|
|
114
|
-
'&:hover': {
|
|
115
|
-
backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'alternativeText', 'hover', 'backgroundColor'])
|
|
70
|
+
'&:active': {
|
|
71
|
+
backgroundColor: actionTheme['02']
|
|
116
72
|
},
|
|
117
|
-
|
|
73
|
+
disabled: {
|
|
74
|
+
border: (0, _classesUtils.withImportant)("1px solid ".concat(actionTheme['05'])),
|
|
75
|
+
color: (0, _classesUtils.withImportant)(actionTheme['05']),
|
|
76
|
+
opacity: (0, _classesUtils.withImportant)(0.5)
|
|
77
|
+
}
|
|
118
78
|
},
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
color: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'alternativeOutlined', 'color']),
|
|
79
|
+
text: {
|
|
80
|
+
border: '1px solid transparent',
|
|
81
|
+
color: actionTheme['05'],
|
|
82
|
+
fill: actionTheme['05'],
|
|
124
83
|
'&:hover': {
|
|
125
|
-
backgroundColor:
|
|
84
|
+
backgroundColor: actionTheme['01']
|
|
126
85
|
},
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
gray: {
|
|
130
|
-
backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'gray', 'backgroundColor']),
|
|
131
|
-
color: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'gray', 'color']),
|
|
132
|
-
'&:hover': {
|
|
133
|
-
backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'gray', 'hover', 'backgroundColor'])
|
|
86
|
+
'&:active': {
|
|
87
|
+
backgroundColor: actionTheme['02']
|
|
134
88
|
},
|
|
135
|
-
|
|
89
|
+
disabled: {
|
|
90
|
+
color: (0, _classesUtils.withImportant)(actionTheme['05']),
|
|
91
|
+
opacity: (0, _classesUtils.withImportant)(0.5)
|
|
92
|
+
}
|
|
136
93
|
},
|
|
137
|
-
|
|
138
|
-
backgroundColor:
|
|
139
|
-
|
|
94
|
+
shadow: {
|
|
95
|
+
backgroundColor: colorTheme === _constants.COLORS_MAPPER.negative ? neutralTheme['05'] : negativeTheme['05'],
|
|
96
|
+
boxShadow: (0, _shadowUtils.getShadow)({
|
|
97
|
+
color: actionTheme['04'],
|
|
98
|
+
level: 1
|
|
99
|
+
}),
|
|
100
|
+
border: '1px solid transparent',
|
|
101
|
+
color: actionTheme['05'],
|
|
102
|
+
fill: actionTheme['05'],
|
|
140
103
|
'&:hover': {
|
|
141
|
-
backgroundColor:
|
|
104
|
+
backgroundColor: actionTheme['01'],
|
|
105
|
+
boxShadow: (0, _shadowUtils.getShadow)({
|
|
106
|
+
color: actionTheme['04'],
|
|
107
|
+
level: 2
|
|
108
|
+
})
|
|
142
109
|
},
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
color: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'grayOutlined', 'color']),
|
|
150
|
-
'&:hover': {
|
|
151
|
-
backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'grayOutlined', 'hover', 'backgroundColor'])
|
|
110
|
+
'&:active': {
|
|
111
|
+
backgroundColor: actionTheme['02'],
|
|
112
|
+
boxShadow: (0, _shadowUtils.getShadow)({
|
|
113
|
+
color: actionTheme['04'],
|
|
114
|
+
level: 2
|
|
115
|
+
})
|
|
152
116
|
},
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
},
|
|
158
|
-
large: {
|
|
159
|
-
fontSize: (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'large'])
|
|
160
|
-
},
|
|
161
|
-
lowercase: {
|
|
162
|
-
textTransform: 'lowercase'
|
|
163
|
-
},
|
|
164
|
-
uppercase: {
|
|
165
|
-
textTransform: 'uppercase'
|
|
166
|
-
},
|
|
167
|
-
labelFullWidth: {
|
|
168
|
-
width: '100%'
|
|
169
|
-
},
|
|
170
|
-
loading: {
|
|
171
|
-
color: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'loading', 'color']),
|
|
172
|
-
position: 'absolute',
|
|
173
|
-
left: 'calc(50% - 12px)'
|
|
174
|
-
},
|
|
175
|
-
loadingText: {
|
|
176
|
-
color: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'loadingText', 'color'], (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'loading', 'color'])),
|
|
177
|
-
position: 'absolute',
|
|
178
|
-
left: 'calc(50% - 12px)'
|
|
179
|
-
},
|
|
180
|
-
loadingOutlined: {
|
|
181
|
-
color: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'loadingOutlined', 'color'], (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'loading', 'color'])),
|
|
182
|
-
position: 'absolute',
|
|
183
|
-
left: 'calc(50% - 12px)'
|
|
117
|
+
disabled: {
|
|
118
|
+
color: (0, _classesUtils.withImportant)(actionTheme['05']),
|
|
119
|
+
opacity: (0, _classesUtils.withImportant)(0.5)
|
|
120
|
+
}
|
|
184
121
|
}
|
|
185
122
|
};
|
|
123
|
+
return definition[variant] || definition[_constants.DEFAULT_PROPS.variant];
|
|
124
|
+
};
|
|
125
|
+
exports.variantsColorTheme = variantsColorTheme;
|
|
126
|
+
var baseButtonTheme = function baseButtonTheme(theme) {
|
|
127
|
+
var _theme$UTButton, _theme$UTButton$circu;
|
|
128
|
+
return {
|
|
129
|
+
root: {
|
|
130
|
+
borderRadius: 4,
|
|
131
|
+
boxShadow: (0, _classesUtils.withImportant)('none'),
|
|
132
|
+
fontSize: '1rem',
|
|
133
|
+
fontWeight: '500',
|
|
134
|
+
lineHeight: '1.375rem',
|
|
135
|
+
minWidth: 'auto',
|
|
136
|
+
padding: '8px 12px',
|
|
137
|
+
textTransform: 'none',
|
|
138
|
+
transition: 'background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, border 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, opacity 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms'
|
|
139
|
+
},
|
|
140
|
+
sizeLarge: {
|
|
141
|
+
fontSize: '1rem',
|
|
142
|
+
fontWeight: '500',
|
|
143
|
+
padding: '12px 16px'
|
|
144
|
+
},
|
|
145
|
+
sizeSmall: {
|
|
146
|
+
fontSize: '1rem',
|
|
147
|
+
fontWeight: '500',
|
|
148
|
+
padding: '4px 8px'
|
|
149
|
+
},
|
|
150
|
+
leftIcon: {
|
|
151
|
+
marginRight: '8px'
|
|
152
|
+
},
|
|
153
|
+
rightIcon: {
|
|
154
|
+
marginLeft: '8px'
|
|
155
|
+
},
|
|
156
|
+
circularProgress: {
|
|
157
|
+
color: ((_theme$UTButton = theme.UTButton) === null || _theme$UTButton === void 0 ? void 0 : (_theme$UTButton$circu = _theme$UTButton.circularProgress) === null || _theme$UTButton$circu === void 0 ? void 0 : _theme$UTButton$circu.color) || '484848'
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
var retrieveStyle = function retrieveStyle(_ref) {
|
|
162
|
+
var colorTheme = _ref.colorTheme,
|
|
163
|
+
variant = _ref.variant,
|
|
164
|
+
theme = _ref.theme;
|
|
165
|
+
var baseTheme = baseButtonTheme(theme);
|
|
166
|
+
var variantTheme = variantsColorTheme(theme, colorTheme, variant);
|
|
167
|
+
return _objectSpread(_objectSpread({}, baseTheme), {}, {
|
|
168
|
+
disabled: variantTheme.disabled,
|
|
169
|
+
root: _objectSpread(_objectSpread({}, baseTheme.root), variantTheme)
|
|
170
|
+
});
|
|
186
171
|
};
|
|
187
172
|
exports.retrieveStyle = retrieveStyle;
|
|
@@ -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
|
helper: {
|
|
11
12
|
color: (0, _seamlessImmutable.getIn)(theme, ['UTCBUInput', 'helper', 'color'])
|
|
@@ -21,12 +21,11 @@ var UTCardFooter = function UTCardFooter(_ref) {
|
|
|
21
21
|
}, footer.map(function (button) {
|
|
22
22
|
return /*#__PURE__*/_react.default.createElement(Button, _extends({
|
|
23
23
|
key: button.name,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}), button.name);
|
|
24
|
+
classNames: {
|
|
25
|
+
root: "".concat(_stylesModule.default.button, " ").concat(button.className),
|
|
26
|
+
icon: button.iconClassName
|
|
27
|
+
}
|
|
28
|
+
}, button), button.name);
|
|
30
29
|
}));
|
|
31
30
|
};
|
|
32
31
|
UTCardFooter.propTypes = {
|