@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
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# [2.0.0](https://github.com/widergy/energy-ui/compare/v1.134.2...v2.0.0) (2023-01-28)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* utbutton revamp ([#248](https://github.com/widergy/energy-ui/issues/248)) ([8760930](https://github.com/widergy/energy-ui/commit/87609301bb873bcae4954c7091562451c5191ad3)), closes [#250](https://github.com/widergy/energy-ui/issues/250)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### BREAKING CHANGES
|
|
10
|
+
|
|
11
|
+
* New components
|
|
12
|
+
|
|
1
13
|
## [1.134.2](https://github.com/widergy/energy-ui/compare/v1.134.1...v1.134.2) (2023-01-27)
|
|
2
14
|
|
|
3
15
|
|
|
@@ -31,8 +31,7 @@ var Loading = function Loading(_ref) {
|
|
|
31
31
|
size: size || defaultSize,
|
|
32
32
|
thickness: thickness || defaultThickness
|
|
33
33
|
}), /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
34
|
-
className: "".concat(_stylesModule.default.text, " ").concat(classes.text, " ").concat(textClassName)
|
|
35
|
-
medium: true
|
|
34
|
+
className: "".concat(_stylesModule.default.text, " ").concat(classes.text, " ").concat(textClassName)
|
|
36
35
|
}, text || _constants.DEFAULT_LOADING_TEXT));
|
|
37
36
|
};
|
|
38
37
|
Loading.propTypes = {
|
|
@@ -7,7 +7,8 @@ exports.retrieveStyle = void 0;
|
|
|
7
7
|
var _seamlessImmutable = require("seamless-immutable");
|
|
8
8
|
var _colors = _interopRequireDefault(require("../../scss/variables/_colors.scss"));
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
var retrieveStyle = function retrieveStyle(
|
|
10
|
+
var retrieveStyle = function retrieveStyle(_ref) {
|
|
11
|
+
var theme = _ref.theme;
|
|
11
12
|
return {
|
|
12
13
|
base: {
|
|
13
14
|
color: (0, _seamlessImmutable.getIn)(theme, ['Loading', 'base', 'color'], _colors.default.loadingBase)
|
|
@@ -8,8 +8,9 @@ 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
12
|
var _theme$Palette, _theme$Palette2, _theme$Palette3, _theme$Palette4;
|
|
13
|
+
var theme = _ref.theme;
|
|
13
14
|
return {
|
|
14
15
|
error: {
|
|
15
16
|
backgroundColor: ((_theme$Palette = theme.Palette) === null || _theme$Palette === void 0 ? void 0 : _theme$Palette.error['04']) || _colors.default.notificationError
|
|
@@ -38,7 +39,7 @@ var retrieveStyle = function retrieveStyle(theme) {
|
|
|
38
39
|
};
|
|
39
40
|
exports.retrieveStyle = retrieveStyle;
|
|
40
41
|
var retrieveMuiTheme = function retrieveMuiTheme(theme) {
|
|
41
|
-
return (0, _styles.
|
|
42
|
+
return (0, _styles.createTheme)({
|
|
42
43
|
typography: {
|
|
43
44
|
fontFamily: (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'fontFamily'])
|
|
44
45
|
},
|
|
@@ -7,10 +7,10 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
9
|
var _DeleteForever = _interopRequireDefault(require("@material-ui/icons/DeleteForever"));
|
|
10
|
-
var _IconButton = _interopRequireDefault(require("@material-ui/core/IconButton"));
|
|
11
10
|
var _files = require("@widergy/web-utils/lib/constants/files");
|
|
12
11
|
var _UTFileInput = _interopRequireDefault(require("../UTFileInput"));
|
|
13
12
|
var _UTLabel = _interopRequireDefault(require("../UTLabel"));
|
|
13
|
+
var _UTButton = _interopRequireDefault(require("../UTButton"));
|
|
14
14
|
var _Preview = _interopRequireDefault(require("./components/Preview"));
|
|
15
15
|
var _constants = require("./constants");
|
|
16
16
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
@@ -47,14 +47,16 @@ var Attachment = function Attachment(_ref) {
|
|
|
47
47
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
48
48
|
className: _stylesModule.default.fileContainer
|
|
49
49
|
}, /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
colorTheme: "gray",
|
|
51
|
+
variant: "small",
|
|
52
52
|
className: _stylesModule.default.name
|
|
53
|
-
}, name), /*#__PURE__*/_react.default.createElement(
|
|
53
|
+
}, name), /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
54
54
|
className: "".concat(_stylesModule.default.removeIconContainer, " ").concat(removeFileClassname),
|
|
55
|
+
Icon: Icon,
|
|
55
56
|
onClick: onClick,
|
|
56
|
-
disabled: disabled
|
|
57
|
-
|
|
57
|
+
disabled: disabled,
|
|
58
|
+
variant: "text"
|
|
59
|
+
}))) : /*#__PURE__*/_react.default.createElement(_UTFileInput.default, {
|
|
58
60
|
onChange: onChange,
|
|
59
61
|
containerClassname: containerClassname,
|
|
60
62
|
fileType: fieldType,
|
|
@@ -70,7 +72,7 @@ var Attachment = function Attachment(_ref) {
|
|
|
70
72
|
});
|
|
71
73
|
};
|
|
72
74
|
Attachment.propTypes = {
|
|
73
|
-
name:
|
|
75
|
+
name: _propTypes.string,
|
|
74
76
|
preview: (0, _propTypes.shape)({
|
|
75
77
|
src: _propTypes.string,
|
|
76
78
|
type: _propTypes.string
|
|
@@ -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
|
container: {
|
|
11
12
|
border: (0, _seamlessImmutable.getIn)(theme, ['UTAttachment', 'container', 'border'])
|
|
@@ -4,12 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.retrieveStyle = exports.retrieveMuiTheme = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _styles = require("@material-ui/core/styles");
|
|
8
8
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
9
9
|
var _colors = _interopRequireDefault(require("../../scss/variables/_colors.scss"));
|
|
10
|
+
var _classesUtils = require("../../utils/classesUtils");
|
|
10
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
var retrieveStyle = function retrieveStyle(
|
|
12
|
+
var retrieveStyle = function retrieveStyle(_ref) {
|
|
12
13
|
var _theme$UTAutocomplete, _theme$UTAutocomplete2, _theme$UTTextInput, _theme$UTAutocomplete3, _theme$UTAutocomplete4, _theme$UTTextInput2, _theme$UTAutocomplete5, _theme$UTAutocomplete6, _theme$UTTextInput3, _theme$UTAutocomplete7, _theme$UTAutocomplete8, _theme$UTAutocomplete9, _theme$UTAutocomplete10, _theme$UTAutocomplete11, _theme$UTAutocomplete12;
|
|
14
|
+
var theme = _ref.theme;
|
|
13
15
|
return {
|
|
14
16
|
arrowIcon: {
|
|
15
17
|
color: ((_theme$UTAutocomplete = theme.UTAutocomplete) === null || _theme$UTAutocomplete === void 0 ? void 0 : (_theme$UTAutocomplete2 = _theme$UTAutocomplete.arrowIcon) === null || _theme$UTAutocomplete2 === void 0 ? void 0 : _theme$UTAutocomplete2.color) || ((_theme$UTTextInput = theme.UTTextInput) === null || _theme$UTTextInput === void 0 ? void 0 : _theme$UTTextInput.color)
|
|
@@ -19,9 +21,9 @@ var retrieveStyle = function retrieveStyle(theme) {
|
|
|
19
21
|
},
|
|
20
22
|
loadingIcon: {
|
|
21
23
|
color: ((_theme$UTAutocomplete5 = theme.UTAutocomplete) === null || _theme$UTAutocomplete5 === void 0 ? void 0 : (_theme$UTAutocomplete6 = _theme$UTAutocomplete5.loadingIcon) === null || _theme$UTAutocomplete6 === void 0 ? void 0 : _theme$UTAutocomplete6.color) || ((_theme$UTTextInput3 = theme.UTTextInput) === null || _theme$UTTextInput3 === void 0 ? void 0 : _theme$UTTextInput3.color),
|
|
22
|
-
height: ((_theme$UTAutocomplete7 = theme.UTAutocomplete) === null || _theme$UTAutocomplete7 === void 0 ? void 0 : (_theme$UTAutocomplete8 = _theme$UTAutocomplete7.loadingIcon) === null || _theme$UTAutocomplete8 === void 0 ? void 0 : _theme$UTAutocomplete8.
|
|
24
|
+
height: (0, _classesUtils.withImportant)(((_theme$UTAutocomplete7 = theme.UTAutocomplete) === null || _theme$UTAutocomplete7 === void 0 ? void 0 : (_theme$UTAutocomplete8 = _theme$UTAutocomplete7.loadingIcon) === null || _theme$UTAutocomplete8 === void 0 ? void 0 : _theme$UTAutocomplete8.height) || "20px"),
|
|
23
25
|
margin: ((_theme$UTAutocomplete9 = theme.UTAutocomplete) === null || _theme$UTAutocomplete9 === void 0 ? void 0 : (_theme$UTAutocomplete10 = _theme$UTAutocomplete9.loadingIcon) === null || _theme$UTAutocomplete10 === void 0 ? void 0 : _theme$UTAutocomplete10.margin) || '0 10px 0 0',
|
|
24
|
-
width: ((_theme$UTAutocomplete11 = theme.UTAutocomplete) === null || _theme$UTAutocomplete11 === void 0 ? void 0 : (_theme$UTAutocomplete12 = _theme$UTAutocomplete11.loadingIcon) === null || _theme$UTAutocomplete12 === void 0 ? void 0 : _theme$UTAutocomplete12.
|
|
26
|
+
width: (0, _classesUtils.withImportant)(((_theme$UTAutocomplete11 = theme.UTAutocomplete) === null || _theme$UTAutocomplete11 === void 0 ? void 0 : (_theme$UTAutocomplete12 = _theme$UTAutocomplete11.loadingIcon) === null || _theme$UTAutocomplete12 === void 0 ? void 0 : _theme$UTAutocomplete12.width) || "20px")
|
|
25
27
|
}
|
|
26
28
|
};
|
|
27
29
|
};
|
|
@@ -127,7 +129,7 @@ var retrieveMuiTheme = function retrieveMuiTheme(theme, muiTheme) {
|
|
|
127
129
|
display: ((_theme$UTAutocomplete22 = theme.UTAutocomplete) === null || _theme$UTAutocomplete22 === void 0 ? void 0 : _theme$UTAutocomplete22.display) || 'flex',
|
|
128
130
|
flexShrink: ((_theme$UTAutocomplete23 = theme.UTAutocomplete) === null || _theme$UTAutocomplete23 === void 0 ? void 0 : _theme$UTAutocomplete23.flexShrink) || '0',
|
|
129
131
|
margin: ((_theme$UTAutocomplete24 = theme.UTAutocomplete) === null || _theme$UTAutocomplete24 === void 0 ? void 0 : _theme$UTAutocomplete24.margin) || '16px 0 8px 0',
|
|
130
|
-
width: ((_theme$UTAutocomplete25 = theme.UTAutocomplete) === null || _theme$UTAutocomplete25 === void 0 ? void 0 : _theme$UTAutocomplete25.width) || '100%
|
|
132
|
+
width: (0, _classesUtils.withImportant)(((_theme$UTAutocomplete25 = theme.UTAutocomplete) === null || _theme$UTAutocomplete25 === void 0 ? void 0 : _theme$UTAutocomplete25.width) || '100%')
|
|
131
133
|
},
|
|
132
134
|
popper: {
|
|
133
135
|
overflowX: ((_theme$UTAutocomplete26 = theme.UTAutocomplete) === null || _theme$UTAutocomplete26 === void 0 ? void 0 : (_theme$UTAutocomplete27 = _theme$UTAutocomplete26.popper) === null || _theme$UTAutocomplete27 === void 0 ? void 0 : _theme$UTAutocomplete27.overflowX) || 'hidden'
|
|
@@ -147,6 +149,6 @@ var retrieveMuiTheme = function retrieveMuiTheme(theme, muiTheme) {
|
|
|
147
149
|
}
|
|
148
150
|
}
|
|
149
151
|
};
|
|
150
|
-
return (0,
|
|
152
|
+
return (0, _styles.createTheme)(_lodash.default.merge(muiTheme, mui));
|
|
151
153
|
};
|
|
152
154
|
exports.retrieveMuiTheme = retrieveMuiTheme;
|
|
@@ -10,31 +10,44 @@ var _propTypes = require("prop-types");
|
|
|
10
10
|
var _energyUi = require("@widergy/energy-ui");
|
|
11
11
|
var _componentUtils = _interopRequireDefault(require("../../utils/componentUtils"));
|
|
12
12
|
var _constants = require("./constants");
|
|
13
|
+
var _excluded = ["colorTheme"];
|
|
13
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
16
|
+
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; }
|
|
17
|
+
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; }
|
|
14
18
|
var UTAvatar = function UTAvatar(_ref) {
|
|
15
19
|
var className = _ref.className,
|
|
16
20
|
manualColors = _ref.manualColors,
|
|
21
|
+
labelProps = _ref.labelProps,
|
|
17
22
|
palette = _ref.palette,
|
|
18
23
|
userName = _ref.userName;
|
|
19
24
|
var getFirstLetter = _componentUtils.default.getFirstLetter,
|
|
20
25
|
getAvatarColors = _componentUtils.default.getAvatarColors;
|
|
21
26
|
var firstNameLetter = getFirstLetter(userName);
|
|
27
|
+
var _getAvatarColors = getAvatarColors(userName, palette || _constants.defaultPalette),
|
|
28
|
+
colorTheme = _getAvatarColors.colorTheme,
|
|
29
|
+
styles = _objectWithoutProperties(_getAvatarColors, _excluded);
|
|
22
30
|
return /*#__PURE__*/_react.default.createElement(_Avatar.default, {
|
|
23
31
|
className: className,
|
|
24
|
-
style: manualColors ? {} :
|
|
25
|
-
}, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}, firstNameLetter));
|
|
32
|
+
style: manualColors ? {} : styles
|
|
33
|
+
}, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, _extends({
|
|
34
|
+
colorTheme: colorTheme,
|
|
35
|
+
variant: "title2",
|
|
36
|
+
weight: "semibold"
|
|
37
|
+
}, labelProps), firstNameLetter));
|
|
30
38
|
};
|
|
31
39
|
UTAvatar.propTypes = {
|
|
32
40
|
className: _propTypes.string,
|
|
41
|
+
labelProps: (0, _propTypes.shape)({
|
|
42
|
+
className: _propTypes.string,
|
|
43
|
+
variant: _propTypes.string,
|
|
44
|
+
weight: _propTypes.string
|
|
45
|
+
}),
|
|
33
46
|
manualColors: _propTypes.bool,
|
|
34
|
-
palette: (0, _propTypes.shape)({
|
|
47
|
+
palette: (0, _propTypes.arrayOf)((0, _propTypes.shape)({
|
|
35
48
|
color: _propTypes.string,
|
|
36
49
|
backgroundColor: _propTypes.string
|
|
37
|
-
}),
|
|
50
|
+
})),
|
|
38
51
|
userName: _propTypes.string
|
|
39
52
|
};
|
|
40
53
|
var _default = UTAvatar;
|
|
@@ -93,7 +93,8 @@ var Legend = function Legend(_ref) {
|
|
|
93
93
|
className = reference.className,
|
|
94
94
|
CustomIcon = reference.CustomIcon;
|
|
95
95
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
96
|
-
className: _stylesModule.default["item".concat(displayAs)]
|
|
96
|
+
className: _stylesModule.default["item".concat(displayAs)],
|
|
97
|
+
key: label
|
|
97
98
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
98
99
|
className: className
|
|
99
100
|
}, CustomIcon && /*#__PURE__*/_react.default.createElement(CustomIcon, null)), /*#__PURE__*/_react.default.createElement(_.UTLabel, {
|
|
@@ -102,26 +103,12 @@ var Legend = function Legend(_ref) {
|
|
|
102
103
|
};
|
|
103
104
|
var referencesToShow = getReferencesToShow(flatData);
|
|
104
105
|
var hasReferences = !(0, _array.isEmpty)(referencesToShow);
|
|
105
|
-
|
|
106
|
-
style: style
|
|
107
|
-
}, title && /*#__PURE__*/_react.default.createElement(_.UTLabel, {
|
|
108
|
-
className: "".concat(_stylesModule.default.title, " ").concat(classes.title)
|
|
109
|
-
}, title), withButton && /*#__PURE__*/_react.default.createElement(_.UTButton, {
|
|
110
|
-
className: "".concat(_stylesModule.default.button, " ").concat(classes.showLegendButton),
|
|
111
|
-
disabled: !hasReferences,
|
|
112
|
-
onPress: function onPress() {
|
|
113
|
-
return setShowLegend(true);
|
|
114
|
-
}
|
|
115
|
-
}, /*#__PURE__*/_react.default.createElement(_InfoOutlined.default, {
|
|
116
|
-
className: classes.showLegendIcon
|
|
117
|
-
}), /*#__PURE__*/_react.default.createElement(_.UTLabel, {
|
|
118
|
-
className: classes.showLegendLabel
|
|
119
|
-
}, showReferencesLabel)), /*#__PURE__*/_react.default.createElement(Wrapper, {
|
|
106
|
+
var wrapperProps = displayAs === _constants.MODAL_KEY ? {
|
|
120
107
|
acceptButton: {
|
|
121
|
-
|
|
122
|
-
onPress: function onPress() {
|
|
108
|
+
onClick: function onClick() {
|
|
123
109
|
return setShowLegend(false);
|
|
124
|
-
}
|
|
110
|
+
},
|
|
111
|
+
text: referencesModalButton || ''
|
|
125
112
|
},
|
|
126
113
|
isOpen: showLegend,
|
|
127
114
|
onRequestClose: function onRequestClose() {
|
|
@@ -129,7 +116,24 @@ var Legend = function Legend(_ref) {
|
|
|
129
116
|
},
|
|
130
117
|
title: referencesModalTitle,
|
|
131
118
|
withCloseButton: true
|
|
132
|
-
}
|
|
119
|
+
} : {};
|
|
120
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
121
|
+
style: style
|
|
122
|
+
}, title && /*#__PURE__*/_react.default.createElement(_.UTLabel, {
|
|
123
|
+
className: "".concat(_stylesModule.default.title, " ").concat(classes.title)
|
|
124
|
+
}, title), withButton && /*#__PURE__*/_react.default.createElement(_.UTButton, {
|
|
125
|
+
classNames: {
|
|
126
|
+
icon: classes.showLegendIcon,
|
|
127
|
+
root: "".concat(_stylesModule.default.button, " ").concat(classes.showLegendButton)
|
|
128
|
+
},
|
|
129
|
+
disabled: !hasReferences,
|
|
130
|
+
Icon: _InfoOutlined.default,
|
|
131
|
+
onClick: function onClick() {
|
|
132
|
+
return setShowLegend(true);
|
|
133
|
+
}
|
|
134
|
+
}, /*#__PURE__*/_react.default.createElement(_.UTLabel, {
|
|
135
|
+
className: classes.showLegendLabel
|
|
136
|
+
}, showReferencesLabel)), /*#__PURE__*/_react.default.createElement(Wrapper, wrapperProps, referencesToShow.map(function (row) {
|
|
133
137
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
134
138
|
className: _stylesModule.default["row".concat(displayAs)]
|
|
135
139
|
}, row.map(function (item) {
|
|
@@ -9,20 +9,20 @@ var _ChevronLeft = _interopRequireDefault(require("@material-ui/icons/ChevronLef
|
|
|
9
9
|
var _ChevronRight = _interopRequireDefault(require("@material-ui/icons/ChevronRight"));
|
|
10
10
|
var _propTypes = require("prop-types");
|
|
11
11
|
var _commonTypes = require("../../../../types/commonTypes");
|
|
12
|
-
var
|
|
12
|
+
var _UTButton = _interopRequireDefault(require("../../../UTButton"));
|
|
13
13
|
var _constants = require("./constants");
|
|
14
14
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
16
|
var Pagination = function Pagination(_ref) {
|
|
17
17
|
var _anchor$current, _anchor$current$getBo;
|
|
18
|
-
var
|
|
18
|
+
var anchor = _ref.anchor,
|
|
19
|
+
classes = _ref.classes,
|
|
19
20
|
currentPage = _ref.currentPage,
|
|
20
|
-
totalPages = _ref.totalPages,
|
|
21
|
-
anchor = _ref.anchor,
|
|
22
|
-
graphXStart = _ref.graphXStart,
|
|
23
21
|
graphXEnd = _ref.graphXEnd,
|
|
22
|
+
graphXStart = _ref.graphXStart,
|
|
24
23
|
parentYPosition = _ref.parentYPosition,
|
|
25
|
-
|
|
24
|
+
setCurrentPage = _ref.setCurrentPage,
|
|
25
|
+
totalPages = _ref.totalPages;
|
|
26
26
|
var _ref2 = ((_anchor$current = anchor.current) === null || _anchor$current === void 0 ? void 0 : (_anchor$current$getBo = _anchor$current.getBoundingClientRect) === null || _anchor$current$getBo === void 0 ? void 0 : _anchor$current$getBo.call(_anchor$current)) || {},
|
|
27
27
|
_ref2$y = _ref2.y,
|
|
28
28
|
y = _ref2$y === void 0 ? 0 : _ref2$y,
|
|
@@ -37,37 +37,43 @@ var Pagination = function Pagination(_ref) {
|
|
|
37
37
|
height: _constants.BUTTONS_SIZE
|
|
38
38
|
},
|
|
39
39
|
className: _stylesModule.default.container
|
|
40
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
40
|
+
}, /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
41
|
+
classNames: {
|
|
42
|
+
icon: currentPage ? classes.paginationButton : classes.paginationButtonDisabled,
|
|
43
|
+
root: _stylesModule.default.button
|
|
44
|
+
},
|
|
41
45
|
disabled: !currentPage,
|
|
46
|
+
Icon: _ChevronLeft.default,
|
|
42
47
|
onClick: function onClick() {
|
|
43
48
|
return setCurrentPage(currentPage - 1);
|
|
44
49
|
},
|
|
45
|
-
|
|
46
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
47
|
-
className:
|
|
48
|
-
|
|
50
|
+
variant: "text"
|
|
51
|
+
}), /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
52
|
+
className: {
|
|
53
|
+
icon: currentPage + 1 === totalPages ? classes.paginationButtonDisabled : classes.paginationButton,
|
|
54
|
+
root: _stylesModule.default.button
|
|
55
|
+
},
|
|
49
56
|
disabled: currentPage + 1 === totalPages,
|
|
57
|
+
Icon: _ChevronRight.default,
|
|
50
58
|
onClick: function onClick() {
|
|
51
59
|
return setCurrentPage(currentPage + 1);
|
|
52
60
|
},
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
className: currentPage + 1 === totalPages ? classes.paginationButtonDisabled : classes.paginationButton
|
|
56
|
-
})));
|
|
61
|
+
variant: "text"
|
|
62
|
+
}));
|
|
57
63
|
};
|
|
58
64
|
Pagination.propTypes = {
|
|
59
|
-
setCurrentPage: _propTypes.func,
|
|
60
|
-
currentPage: _propTypes.number,
|
|
61
|
-
totalPages: _propTypes.number,
|
|
62
65
|
anchor: (0, _propTypes.shape)({
|
|
63
66
|
current: (0, _propTypes.shape)({
|
|
64
67
|
getBoundingClientRect: _propTypes.func
|
|
65
68
|
})
|
|
66
69
|
}),
|
|
67
|
-
|
|
70
|
+
classes: _commonTypes.classesType,
|
|
71
|
+
currentPage: _propTypes.number,
|
|
68
72
|
graphXEnd: _propTypes.number,
|
|
73
|
+
graphXStart: _propTypes.number,
|
|
69
74
|
parentYPosition: _propTypes.number,
|
|
70
|
-
|
|
75
|
+
setCurrentPage: _propTypes.func,
|
|
76
|
+
totalPages: _propTypes.number
|
|
71
77
|
};
|
|
72
78
|
var _default = Pagination;
|
|
73
79
|
exports.default = _default;
|
|
@@ -33,7 +33,7 @@ AxisElement.propTypes = {
|
|
|
33
33
|
yAxis: _propTypes.func,
|
|
34
34
|
className: _propTypes.string,
|
|
35
35
|
x: _propTypes.number,
|
|
36
|
-
value: _propTypes.
|
|
36
|
+
value: _propTypes.number,
|
|
37
37
|
textAnchor: _propTypes.string,
|
|
38
38
|
height: _propTypes.number,
|
|
39
39
|
setRef: _commonTypes.refType
|
|
@@ -66,7 +66,7 @@ YAxis.propTypes = {
|
|
|
66
66
|
graphYEnd: _propTypes.number,
|
|
67
67
|
graphYStart: _propTypes.number,
|
|
68
68
|
maxValue: _propTypes.number,
|
|
69
|
-
setRef:
|
|
69
|
+
setRef: _commonTypes.refType,
|
|
70
70
|
textAnchor: _propTypes.string,
|
|
71
71
|
unit: _propTypes.string,
|
|
72
72
|
valueDecorator: _propTypes.func,
|
|
@@ -30,6 +30,7 @@ var _excluded = ["data"];
|
|
|
30
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
31
|
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); }
|
|
32
32
|
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; }
|
|
33
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
33
34
|
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; }
|
|
34
35
|
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; }
|
|
35
36
|
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; }
|
|
@@ -157,16 +158,18 @@ var UTBarChart = function UTBarChart(_ref) {
|
|
|
157
158
|
var barUnit = units.bar,
|
|
158
159
|
linearUnit = units.linear;
|
|
159
160
|
var Wrapper = pagination ? 'div' : _reactPerfectScrollbar.default;
|
|
161
|
+
var wrapperProps = pagination ? {} : {
|
|
162
|
+
suppressScrollX: !!pagination,
|
|
163
|
+
suppressScrollY: true
|
|
164
|
+
};
|
|
160
165
|
return !withBarData ? NoDataComponent ? /*#__PURE__*/_react.default.createElement(NoDataComponent, null) : null : /*#__PURE__*/_react.default.createElement("div", {
|
|
161
166
|
className: _stylesModule.default.container
|
|
162
167
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
163
168
|
ref: containerRef,
|
|
164
169
|
className: className
|
|
165
|
-
}, /*#__PURE__*/_react.default.createElement(Wrapper, {
|
|
166
|
-
suppressScrollX: !!pagination,
|
|
167
|
-
suppressScrollY: true,
|
|
170
|
+
}, /*#__PURE__*/_react.default.createElement(Wrapper, _extends({}, wrapperProps, {
|
|
168
171
|
className: _stylesModule.default.scroll
|
|
169
|
-
}, /*#__PURE__*/_react.default.createElement("svg", {
|
|
172
|
+
}), /*#__PURE__*/_react.default.createElement("svg", {
|
|
170
173
|
height: TOTAL_HEIGHT,
|
|
171
174
|
width: TOTAL_WIDTH
|
|
172
175
|
}, gradientGenerator === null || gradientGenerator === void 0 ? void 0 : gradientGenerator(), showGrid && /*#__PURE__*/_react.default.createElement(_Levels.default, {
|
|
@@ -5,7 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.retrieveStyle = void 0;
|
|
7
7
|
var _seamlessImmutable = require("seamless-immutable");
|
|
8
|
-
var
|
|
8
|
+
var _classesUtils = require("../../utils/classesUtils");
|
|
9
|
+
var retrieveStyle = function retrieveStyle(_ref) {
|
|
10
|
+
var _theme$UTBarChart, _theme$UTBarChart$sho, _theme$UTBarChart2, _theme$UTBarChart2$sh, _theme$UTBarChart3, _theme$UTBarChart3$sh, _theme$UTBarChart4, _theme$UTBarChart4$Fo, _theme$UTBarChart5, _theme$UTBarChart5$sh, _theme$UTBarChart6, _theme$UTBarChart6$sh;
|
|
11
|
+
var theme = _ref.theme;
|
|
9
12
|
return {
|
|
10
13
|
solidLevel: {
|
|
11
14
|
strokeWidth: (0, _seamlessImmutable.getIn)(theme, ['UTBarChart', 'solidLevel', 'strokeWidth'], 1)
|
|
@@ -31,8 +34,8 @@ var retrieveStyle = function retrieveStyle(theme) {
|
|
|
31
34
|
userSelect: 'none'
|
|
32
35
|
},
|
|
33
36
|
showLegendButton: {
|
|
34
|
-
backgroundColor:
|
|
35
|
-
padding:
|
|
37
|
+
backgroundColor: (0, _classesUtils.withImportant)(theme === null || theme === void 0 ? void 0 : (_theme$UTBarChart = theme.UTBarChart) === null || _theme$UTBarChart === void 0 ? void 0 : (_theme$UTBarChart$sho = _theme$UTBarChart.showLegendButton) === null || _theme$UTBarChart$sho === void 0 ? void 0 : _theme$UTBarChart$sho.backgroundColor),
|
|
38
|
+
padding: (0, _classesUtils.withImportant)(theme === null || theme === void 0 ? void 0 : (_theme$UTBarChart2 = theme.UTBarChart) === null || _theme$UTBarChart2 === void 0 ? void 0 : (_theme$UTBarChart2$sh = _theme$UTBarChart2.showLegendButton) === null || _theme$UTBarChart2$sh === void 0 ? void 0 : _theme$UTBarChart2$sh.padding),
|
|
36
39
|
borderRadius: '0 !important'
|
|
37
40
|
},
|
|
38
41
|
showLegendIcon: {
|
|
@@ -40,10 +43,10 @@ var retrieveStyle = function retrieveStyle(theme) {
|
|
|
40
43
|
marginRight: (0, _seamlessImmutable.getIn)(theme, ['UTBarChart', 'showLegendIcon', 'marginRight'], 10)
|
|
41
44
|
},
|
|
42
45
|
showLegendLabel: {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
color: (0, _classesUtils.withImportant)(theme === null || theme === void 0 ? void 0 : (_theme$UTBarChart3 = theme.UTBarChart) === null || _theme$UTBarChart3 === void 0 ? void 0 : (_theme$UTBarChart3$sh = _theme$UTBarChart3.showLegendLabel) === null || _theme$UTBarChart3$sh === void 0 ? void 0 : _theme$UTBarChart3$sh.color),
|
|
47
|
+
fontFamily: theme === null || theme === void 0 ? void 0 : (_theme$UTBarChart4 = theme.UTBarChart) === null || _theme$UTBarChart4 === void 0 ? void 0 : (_theme$UTBarChart4$Fo = _theme$UTBarChart4.Fonts) === null || _theme$UTBarChart4$Fo === void 0 ? void 0 : _theme$UTBarChart4$Fo.fontFamily,
|
|
48
|
+
fontSize: (0, _classesUtils.withImportant)(theme === null || theme === void 0 ? void 0 : (_theme$UTBarChart5 = theme.UTBarChart) === null || _theme$UTBarChart5 === void 0 ? void 0 : (_theme$UTBarChart5$sh = _theme$UTBarChart5.showLegendLabel) === null || _theme$UTBarChart5$sh === void 0 ? void 0 : _theme$UTBarChart5$sh.fontSize),
|
|
49
|
+
fontWeight: (0, _classesUtils.withImportant)(theme === null || theme === void 0 ? void 0 : (_theme$UTBarChart6 = theme.UTBarChart) === null || _theme$UTBarChart6 === void 0 ? void 0 : (_theme$UTBarChart6$sh = _theme$UTBarChart6.showLegendLabel) === null || _theme$UTBarChart6$sh === void 0 ? void 0 : _theme$UTBarChart6$sh.fontWeight),
|
|
47
50
|
userSelect: 'none'
|
|
48
51
|
},
|
|
49
52
|
paginationButton: {
|
|
@@ -46,14 +46,14 @@ var levelsType = (0, _propTypes.arrayOf)((0, _propTypes.shape)({
|
|
|
46
46
|
id: _propTypes.string
|
|
47
47
|
}));
|
|
48
48
|
exports.levelsType = levelsType;
|
|
49
|
-
var referencesType = (0, _propTypes.
|
|
49
|
+
var referencesType = (0, _propTypes.shape)({
|
|
50
50
|
check: _propTypes.func,
|
|
51
51
|
className: _propTypes.string,
|
|
52
52
|
CustomIcon: _propTypes.elementType,
|
|
53
53
|
id: _propTypes.string,
|
|
54
54
|
label: _propTypes.string,
|
|
55
55
|
orderFunction: _propTypes.func
|
|
56
|
-
})
|
|
56
|
+
});
|
|
57
57
|
exports.referencesType = referencesType;
|
|
58
58
|
var xAxisDefinitionType = (0, _propTypes.arrayOf)((0, _propTypes.shape)({
|
|
59
59
|
labelBackgroundPadding: _propTypes.number,
|
|
@@ -9,7 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _propTypes = require("prop-types");
|
|
10
10
|
var _WithTheme = _interopRequireDefault(require("../WithTheme"));
|
|
11
11
|
var _UTMenu = _interopRequireDefault(require("../UTMenu"));
|
|
12
|
-
var
|
|
12
|
+
var _UTButton = _interopRequireDefault(require("../UTButton"));
|
|
13
13
|
var _UTLabel = _interopRequireDefault(require("../UTLabel"));
|
|
14
14
|
var _classesUtils = require("../../utils/classesUtils");
|
|
15
15
|
var _constants = require("./constants");
|
|
@@ -122,10 +122,11 @@ var UTBreadcrumbs = function UTBreadcrumbs(_ref) {
|
|
|
122
122
|
className: _stylesModule.default.breadcrumbs,
|
|
123
123
|
ref: containerRef
|
|
124
124
|
}, content.map(function (_ref3, index) {
|
|
125
|
-
var
|
|
125
|
+
var buttonColorTheme = _ref3.buttonColorTheme,
|
|
126
|
+
itemClassName = _ref3.itemClassName,
|
|
126
127
|
label = _ref3.label,
|
|
127
128
|
menuItems = _ref3.menuItems,
|
|
128
|
-
|
|
129
|
+
route = _ref3.route;
|
|
129
130
|
var handleClick = function handleClick(event) {
|
|
130
131
|
if (menuItems) setMenu({
|
|
131
132
|
anchor: event.currentTarget,
|
|
@@ -147,11 +148,16 @@ var UTBreadcrumbs = function UTBreadcrumbs(_ref) {
|
|
|
147
148
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
148
149
|
className: _stylesModule.default.section,
|
|
149
150
|
key: "".concat(route, "-").concat(label)
|
|
150
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
151
|
+
}, /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
152
|
+
classNames: {
|
|
153
|
+
root: "\n ".concat((!route && !menuItems || disableMenu) && _stylesModule.default.noPointer, "\n ").concat(itemClassName, "\n ")
|
|
154
|
+
},
|
|
155
|
+
colorTheme: buttonColorTheme,
|
|
156
|
+
onClick: handleClick,
|
|
157
|
+
size: "small",
|
|
158
|
+
variant: "text"
|
|
159
|
+
}, "".concat(label)), !isLast && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
160
|
+
className: "".concat(_stylesModule.default.noPointer, " ").concat(classes.separator)
|
|
155
161
|
}, separator));
|
|
156
162
|
}), !disableMenu && /*#__PURE__*/_react.default.createElement(_UTMenu.default, _extends({
|
|
157
163
|
anchor: menu.anchor,
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
@import '../../scss/variables/_mediaQueries.scss';
|
|
2
|
-
|
|
3
1
|
.breadcrumbs {
|
|
4
2
|
align-items: center;
|
|
5
3
|
display: flex;
|
|
@@ -13,10 +11,6 @@
|
|
|
13
11
|
display: flex;
|
|
14
12
|
}
|
|
15
13
|
|
|
16
|
-
.hideSeparator {
|
|
17
|
-
display: none;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
14
|
.noPointer {
|
|
21
15
|
pointer-events: none;
|
|
22
16
|
}
|
|
@@ -5,20 +5,9 @@ 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
|
-
item: {
|
|
11
|
-
borderRadius: (0, _seamlessImmutable.getIn)(theme, ['UTBreadcrumbs', 'item', 'borderRadius']),
|
|
12
|
-
color: (0, _seamlessImmutable.getIn)(theme, ['UTBreadcrumbs', 'item', 'color']),
|
|
13
|
-
fontFamily: (0, _seamlessImmutable.getIn)(theme, ['UTBreadcrumbs', 'item', 'fontFamily']),
|
|
14
|
-
fontSize: (0, _seamlessImmutable.getIn)(theme, ['UTBreadcrumbs', 'item', 'fontSize']),
|
|
15
|
-
fontWeight: (0, _seamlessImmutable.getIn)(theme, ['UTBreadcrumbs', 'item', 'fontWeight']),
|
|
16
|
-
lineHeight: (0, _seamlessImmutable.getIn)(theme, ['UTBreadcrumbs', 'item', 'lineHeight']),
|
|
17
|
-
padding: (0, _seamlessImmutable.getIn)(theme, ['UTBreadcrumbs', 'item', 'padding'], '4px 8px'),
|
|
18
|
-
'&:hover': {
|
|
19
|
-
backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTBreadcrumbs', 'item', 'hover', 'backgroundColor'])
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
11
|
separator: {
|
|
23
12
|
color: (0, _seamlessImmutable.getIn)(theme, ['UTBreadcrumbs', 'separator', 'color']),
|
|
24
13
|
fontFamily: (0, _seamlessImmutable.getIn)(theme, ['UTBreadcrumbs', 'separator', 'fontFamily']),
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# UTButton
|
|
2
|
+
|
|
3
|
+
### Description
|
|
4
|
+
Basic button component.
|
|
5
|
+
|
|
6
|
+
### Variants
|
|
7
|
+
These variants were defined by the UX team and are:
|
|
8
|
+
|
|
9
|
+
- `filled`
|
|
10
|
+
- `outlined`
|
|
11
|
+
- `text`
|
|
12
|
+
- `semitransparent`
|
|
13
|
+
|
|
14
|
+
All these variants are defined in the component theme.
|
|
15
|
+
|
|
16
|
+
### Color Themes
|
|
17
|
+
The color themes are defined by the component consumer and will vary accordingly.They define a set of variables (colors and opacities) that then combined with the variant will change how the buttons looks.
|
|
18
|
+
The components supports an infinite amount of color themes but requieres the consumer to pass at least a `primary` one that works as a default.
|
|
19
|
+
|
|
20
|
+
### Props
|
|
21
|
+
|
|
22
|
+
| Name | Type | Default | Description |
|
|
23
|
+
|----------------------|-------------------------------------------------------|-----------|--------------------------------------------------------------------------------|
|
|
24
|
+
| variant | 'filled' \| 'outlined' \| 'text' \| 'semitransparent' | 'filled' | The variant to use. |
|
|
25
|
+
| colorTheme | string | 'primary' | The color theme to use. |
|
|
26
|
+
| size | 'small' \| 'medium' \| 'large' | 'medium' | The size of the component. |
|
|
27
|
+
| onClick | func | | Callback fired when the user clicks the component. |
|
|
28
|
+
| loading | bool | false | If `true` a spinner is shown over the component. |
|
|
29
|
+
| disabled | bool | false | If `true` the button is unclickable. |
|
|
30
|
+
| Icon | node | | An Icon component that can be displayed within the button. |
|
|
31
|
+
| iconPlacement | 'left' \| 'right' | 'left' | Indicates where the icon is placed in relation with the contents of the button |
|
|
32
|
+
| showTextOnResponsive | bool | false | If `true` and Icon is not `null` the contents of the button are not displayed. |
|
|
33
|
+
| type | 'string' | | HTML type attribute. |
|
|
34
|
+
| classNames | object | | Overrides the default button theme. |
|
|
35
|
+
| children | node | | The component contents. |
|