@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.
Files changed (119) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/components/Loading/index.js +1 -2
  3. package/dist/components/Loading/styles.module.scss +1 -1
  4. package/dist/components/Loading/theme.js +2 -1
  5. package/dist/components/UTAlert/theme.js +3 -2
  6. package/dist/components/UTAttachment/layout.js +9 -7
  7. package/dist/components/UTAttachment/styles.module.scss +0 -1
  8. package/dist/components/UTAttachment/theme.js +2 -1
  9. package/dist/components/UTAutocomplete/theme.js +8 -6
  10. package/dist/components/UTAvatar/index.js +21 -8
  11. package/dist/components/UTBarChart/components/Legend/index.js +24 -20
  12. package/dist/components/UTBarChart/components/Pagination/index.js +26 -20
  13. package/dist/components/UTBarChart/components/YAxis/AxisElement/index.js +1 -1
  14. package/dist/components/UTBarChart/components/YAxis/index.js +1 -1
  15. package/dist/components/UTBarChart/index.js +7 -4
  16. package/dist/components/UTBarChart/theme.js +10 -7
  17. package/dist/components/UTBarChart/types.js +2 -2
  18. package/dist/components/UTBreadcrumbs/index.js +14 -8
  19. package/dist/components/UTBreadcrumbs/styles.module.scss +0 -6
  20. package/dist/components/UTBreadcrumbs/theme.js +2 -13
  21. package/dist/components/UTButton/README.md +35 -0
  22. package/dist/components/UTButton/constants.js +42 -0
  23. package/dist/components/UTButton/index.js +63 -83
  24. package/dist/components/UTButton/styles.module.scss +36 -0
  25. package/dist/components/UTButton/theme.js +143 -158
  26. package/dist/components/UTCBUInput/theme.js +2 -1
  27. package/dist/components/UTCard/components/UTCardFooter/index.js +5 -6
  28. package/dist/components/UTCard/index.js +23 -29
  29. package/dist/components/UTCard/theme.js +2 -1
  30. package/dist/components/UTCarousel/components/Button/index.js +1 -1
  31. package/dist/components/UTCarousel/components/Legend/index.js +1 -4
  32. package/dist/components/UTCarousel/components/Slider/component/Slide/index.js +2 -5
  33. package/dist/components/UTCarousel/components/Slider/index.js +45 -18
  34. package/dist/components/UTCarousel/components/Slider/layout.js +13 -12
  35. package/dist/components/UTCarousel/theme.js +2 -1
  36. package/dist/components/UTCheckList/index.js +11 -9
  37. package/dist/components/UTCheckList/theme.js +8 -3
  38. package/dist/components/UTCheckbox/index.js +34 -28
  39. package/dist/components/UTCheckbox/theme.js +11 -3
  40. package/dist/components/UTConsumptionBar/components/ConsumptionBarIndicator/index.js +7 -8
  41. package/dist/components/UTConsumptionBar/components/ConsumptionBarIndicator/styles.module.scss +1 -2
  42. package/dist/components/UTConsumptionBar/index.js +22 -13
  43. package/dist/components/UTConsumptionBar/styles.module.scss +0 -14
  44. package/dist/components/UTCuit/index.js +2 -2
  45. package/dist/components/UTCuit/theme.js +1 -1
  46. package/dist/components/UTDatePicker/index.js +29 -27
  47. package/dist/components/UTDatePicker/theme.js +22 -7
  48. package/dist/components/UTDialog/index.js +19 -23
  49. package/dist/components/UTDialog/theme.js +8 -23
  50. package/dist/components/UTDialog/types.js +5 -6
  51. package/dist/components/UTDotMenu/index.js +16 -8
  52. package/dist/components/UTEmojiPicker/theme.js +2 -1
  53. package/dist/components/UTFileInput/layout.js +5 -4
  54. package/dist/components/UTFileInput/styles.module.scss +0 -1
  55. package/dist/components/UTIconButton/theme.js +2 -1
  56. package/dist/components/UTImageRadio/components/ImageRadioCard/index.js +2 -2
  57. package/dist/components/UTImageRadio/index.js +2 -1
  58. package/dist/components/UTImageRadio/theme.js +15 -12
  59. package/dist/components/UTLabel/README.md +169 -0
  60. package/dist/components/UTLabel/constants.js +91 -0
  61. package/dist/components/UTLabel/index.js +41 -104
  62. package/dist/components/UTLabel/theme.js +29 -84
  63. package/dist/components/UTMap/index.js +7 -7
  64. package/dist/components/UTMap/styles.module.scss +0 -5
  65. package/dist/components/UTMenu/theme.js +3 -2
  66. package/dist/components/UTPanel/index.js +11 -10
  67. package/dist/components/UTPasswordField/components/PasswordValidations/components/Error/index.js +4 -3
  68. package/dist/components/UTPasswordField/components/PasswordValidations/components/Error/styles.module.scss +2 -2
  69. package/dist/components/UTPasswordField/components/PasswordValidations/components/Validation/index.js +16 -16
  70. package/dist/components/UTPasswordField/components/PasswordValidations/components/Validation/styles.module.scss +2 -2
  71. package/dist/components/UTPasswordField/components/PasswordValidations/index.js +11 -9
  72. package/dist/components/UTPasswordField/components/PasswordWarning/index.js +3 -3
  73. package/dist/components/UTPasswordField/components/PasswordWarning/styles.module.scss +1 -1
  74. package/dist/components/UTPasswordField/theme.js +13 -27
  75. package/dist/components/UTPhoneInput/index.js +4 -4
  76. package/dist/components/UTPhoneInput/theme.js +3 -6
  77. package/dist/components/UTPieChart/theme.js +2 -1
  78. package/dist/components/UTProgressBar/index.js +27 -20
  79. package/dist/components/UTProgressBar/theme.js +14 -13
  80. package/dist/components/UTRadioGroup/index.js +35 -22
  81. package/dist/components/UTRadioGroup/theme.js +10 -6
  82. package/dist/components/UTRating/components/Star/index.js +2 -1
  83. package/dist/components/UTRating/index.js +3 -1
  84. package/dist/components/UTRating/theme.js +3 -2
  85. package/dist/components/UTSelect/index.js +13 -3
  86. package/dist/components/UTSelect/styles.module.scss +5 -0
  87. package/dist/components/UTSelect/theme.js +7 -2
  88. package/dist/components/UTSidebar/theme.js +6 -5
  89. package/dist/components/UTSkeleton/index.js +3 -2
  90. package/dist/components/UTSwitch/index.js +2 -1
  91. package/dist/components/UTSwitch/theme.js +2 -1
  92. package/dist/components/UTTable/components/TableHeader/index.js +11 -7
  93. package/dist/components/UTTable/theme.js +31 -29
  94. package/dist/components/UTTabs/index.js +25 -20
  95. package/dist/components/UTTabs/theme.js +2 -1
  96. package/dist/components/UTTextArea/index.js +2 -1
  97. package/dist/components/UTTextArea/theme.js +2 -1
  98. package/dist/components/UTTextInput/index.js +16 -8
  99. package/dist/components/UTTextInput/styles.module.scss +3 -2
  100. package/dist/components/UTTextInput/theme.js +3 -2
  101. package/dist/components/UTToggle/components/ToggleOption/index.js +1 -0
  102. package/dist/components/UTToggle/theme.js +2 -1
  103. package/dist/components/UTTooltip/index.js +6 -4
  104. package/dist/components/UTTooltip/styles.module.scss +4 -2
  105. package/dist/components/UTTooltip/theme.js +2 -1
  106. package/dist/components/UTWorkflowContainer/components/ActionButton/index.js +12 -4
  107. package/dist/components/UTWorkflowContainer/index.js +19 -15
  108. package/dist/components/UTWorkflowContainer/styles.module.scss +0 -34
  109. package/dist/components/UTWorkflowContainer/theme.js +12 -58
  110. package/dist/components/UTWorkflowContainer/types.js +1 -1
  111. package/dist/components/WithTheme/layout.js +46 -42
  112. package/dist/scss/variables/_colors.scss +8 -0
  113. package/dist/theme.js +4 -1
  114. package/dist/types/formTypes.js +3 -3
  115. package/dist/utils/classesUtils.js +7 -3
  116. package/dist/utils/shadowUtils.js +40 -0
  117. package/package.json +5 -3
  118. package/dist/components/UTDialog/components/ActionButton/index.js +0 -35
  119. 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 retrieveStyle = function retrieveStyle(theme) {
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
- base: {
13
- color: (0, _seamlessImmutable.getIn)(theme, ['UTLabel', 'base', 'color'], _colors.default.black),
14
- fontSize: (0, _seamlessImmutable.getIn)(theme, ['UTLabel', 'base', 'fontSize']),
15
- fontWeight: 400,
16
- fontFamily: (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'fontFamily']),
17
- transform: 'translateZ(0)'
18
- },
19
- xxxsmall: {
20
- fontSize: (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'xxxsmall'])
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
- black: true
263
- }, this.props.errors.retrievingLocation) : this.state.invalidConfiguration ? /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
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
- error: true
265
+ colorTheme: "error",
266
+ variant: "small"
267
267
  }, this.props.errors.retrieveLocationError), !showOnlyMap && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
268
- error: true,
269
- small: true,
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
  }
@@ -1,9 +1,4 @@
1
- @import '../../scss/variables/_colors.scss';
2
- @import '../../scss/variables/_fontSizes.scss';
3
-
4
1
  .error {
5
- color: $error;
6
2
  display: flex;
7
- font-size: $medium;
8
3
  margin-top: 20px;
9
4
  }
@@ -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(theme) {
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.createMuiTheme)({
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 _UTIconButton = _interopRequireDefault(require("../UTIconButton"));
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
- medium: true,
75
- semibold: true,
76
- className: titleClass
77
- }, title)), /*#__PURE__*/_react.default.createElement(_UTIconButton.default, {
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
- small: true,
80
- className: closeButtonClass
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({
@@ -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 failureLabel = classes.failureLabel,
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: "".concat(_stylesModule.default.label, " ").concat(failureLabel)
26
+ className: _stylesModule.default.label,
27
+ colorTheme: "error",
28
+ variant: "small"
28
29
  }, error));
29
30
  };
30
31
  ErrorMessage.propTypes = {
@@ -1,8 +1,8 @@
1
1
  .container {
2
2
  display: flex;
3
- margin-top: 5px;
3
+ margin-top: 8px;
4
4
  }
5
5
 
6
6
  .label {
7
- margin-left: 5px;
7
+ margin-left: 8px;
8
8
  }
@@ -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 requirement = _ref.requirement,
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
- assertion = _ref.assertion,
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: "".concat(_stylesModule.default.label, " ").concat(labelStyle, " ").concat((value || shouldShowError) && (assertion ? successLabel : failureLabel))
41
+ className: _stylesModule.default.label,
42
+ colorTheme: labelColor,
43
+ variant: "small"
44
44
  }, requirement));
45
45
  };
46
46
  Validation.propTypes = {
47
- requirement: _propTypes.string,
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
- assertion: _propTypes.bool,
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;
@@ -1,9 +1,9 @@
1
1
  .container {
2
2
  align-items: center;
3
3
  display: flex;
4
- margin-top: 7px;
4
+ margin-top: 8px;
5
5
  }
6
6
 
7
7
  .label {
8
- margin-left: 5px;
8
+ margin-left: 8px;
9
9
  }
@@ -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
- value: value,
73
+ disabled: disabled,
74
+ key: requirement,
75
+ NoValueIcon: NoValueIcon,
76
+ requirement: requirement,
78
77
  shouldShowError: submitFailed,
79
- NoValueIcon: NoValueIcon
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 warningLabel = classes.warningLabel,
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: "".concat(_stylesModule.default.warning, " ").concat(warningLabel)
45
+ className: _stylesModule.default.warning,
46
+ colorTheme: "warning"
47
47
  }, error)));
48
48
  });
49
49
  };
@@ -12,5 +12,5 @@
12
12
  }
13
13
 
14
14
  .warning {
15
- margin-left: 5px;
15
+ margin-left: 8px;
16
16
  }
@@ -4,45 +4,31 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.retrieveStyle = void 0;
7
- var _seamlessImmutable = require("seamless-immutable");
8
- var _colors = _interopRequireDefault(require("../../scss/variables/_colors.scss"));
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
- var retrieveStyle = function retrieveStyle(theme) {
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, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'icon', 'size'], '17px'),
25
- width: (0, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'icon', 'size'], '17px'),
26
- borderRadius: (0, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'icon', 'borderRadius'], '50%')
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: (0, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'success', 'color'], _colors.default.green)
18
+ fill: theme.Palette.success['05']
30
19
  },
31
20
  failedIconStyle: {
32
- fill: (0, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'failure', 'color'], _colors.default.red)
21
+ fill: theme.Palette.error['05']
33
22
  },
34
23
  errorsContainerStyle: {
35
- borderTop: "1px solid ".concat((0, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'failure', 'color'], _colors.default.red)),
36
- marginTop: '7px'
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: "".concat((0, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'warningLabel', 'color']), " !important")
28
+ backgroundColor: (0, _classesUtils.withImportant)(theme.Palette.warning['05'])
43
29
  },
44
30
  validationContainer: {
45
- margin: "".concat((0, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'validationContainer', 'margin']), " !important")
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
- error: true,
278
- className: classes.labelError
279
- }, error || ((0, _form.shouldShowErrors)(meta) ? meta.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(theme) {
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.createMuiTheme)({
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(theme) {
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 = _interopRequireDefault(require("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 classNames = _ref.classNames,
19
- classes = _ref.classes,
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: "".concat(classes.container, " ").concat(classNames.container)
33
+ className: classes.container
28
34
  }, /*#__PURE__*/_react.default.createElement(_core.LinearProgress, {
29
- variant: variant,
30
- value: clampedValue,
31
35
  classes: {
32
- root: "".concat(classes.root, " ").concat(classNames.root),
33
- colorPrimary: "".concat(classes.colorPrimary, " ").concat(classNames.colorPrimary),
34
- barColorPrimary: "".concat(classes.barColorPrimary, " ").concat(classNames.barColorPrimary)
35
- }
36
- }), withLabel && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
37
- className: "".concat(classes.label, " ").concat(classNames.label),
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;