@widergy/energy-ui 3.7.0 → 3.7.1

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 CHANGED
@@ -1,3 +1,10 @@
1
+ ## [3.7.1](https://github.com/widergy/energy-ui/compare/v3.7.0...v3.7.1) (2024-05-20)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * utbutton fixes ([#448](https://github.com/widergy/energy-ui/issues/448)) ([b691c07](https://github.com/widergy/energy-ui/commit/b691c071d5a180637e95d2634e76cb940612e68a))
7
+
1
8
  # [3.7.0](https://github.com/widergy/energy-ui/compare/v3.6.3...v3.7.0) (2024-04-26)
2
9
 
3
10
 
@@ -8,8 +8,8 @@ const VARIANTS = exports.VARIANTS = {
8
8
  filled: 'contained',
9
9
  outlined: 'outlined',
10
10
  semitransparent: 'contained',
11
- text: 'text',
12
- shadow: 'text'
11
+ shadow: 'text',
12
+ text: 'text'
13
13
  };
14
14
  const SIZES = exports.SIZES = {
15
15
  small: 'small',
@@ -30,14 +30,15 @@ const DEFAULT_PROPS = exports.DEFAULT_PROPS = {
30
30
  variant: 'filled'
31
31
  };
32
32
  const COLORS_MAPPER = exports.COLORS_MAPPER = {
33
+ error: 'error',
34
+ negative: 'negative',
33
35
  primary: 'accent',
34
36
  secondary: 'neutral',
35
- error: 'error',
36
- negative: 'negative'
37
+ success: 'success'
37
38
  };
38
39
  const SHADOW_MAPPER = exports.SHADOW_MAPPER = {
39
- [COLORS_MAPPER.primary]: 'accent',
40
- [COLORS_MAPPER.secondary]: 'grayscale',
41
40
  [COLORS_MAPPER.error]: 'accentError',
42
- [COLORS_MAPPER.negative]: 'accentNeutral'
41
+ [COLORS_MAPPER.negative]: 'accentNeutral',
42
+ [COLORS_MAPPER.primary]: 'accent',
43
+ [COLORS_MAPPER.secondary]: 'grayscale'
43
44
  };
@@ -21,6 +21,7 @@ const UTButton = _ref => {
21
21
  children,
22
22
  classes: theme,
23
23
  classNames,
24
+ dataTestId,
24
25
  disabled,
25
26
  hideTextOnResponsive,
26
27
  Icon,
@@ -31,7 +32,7 @@ const UTButton = _ref => {
31
32
  type,
32
33
  variant
33
34
  } = _ref;
34
- const classes = (0, _react.useMemo)(() => (0, _classesUtils.mergeClasses)(theme, classNames));
35
+ const classes = (0, _react.useMemo)(() => (0, _classesUtils.mergeClasses)(theme, classNames), [classNames, theme]);
35
36
  const {
36
37
  childrenContainer,
37
38
  circularProgress,
@@ -49,12 +50,13 @@ const UTButton = _ref => {
49
50
  className: iconClassname
50
51
  }));
51
52
  return /*#__PURE__*/_react.default.createElement(_Button.default, {
52
- disabled: disabled || loading,
53
53
  classes: materialButtonClasses,
54
+ "data-testid": dataTestId,
55
+ disabled: disabled || loading,
54
56
  onClick: onClick,
55
57
  size: size,
56
- variant: _constants.VARIANTS[variant],
57
- type: type
58
+ type: type,
59
+ variant: _constants.VARIANTS[variant]
58
60
  }, RenderedChildren, loading && /*#__PURE__*/_react.default.createElement(_CircularProgress.default, {
59
61
  size: 24,
60
62
  className: "".concat(_stylesModule.default.loading, " ").concat(circularProgress)
@@ -147,7 +147,7 @@ const baseButtonTheme = theme => {
147
147
  padding: '12px 16px'
148
148
  },
149
149
  sizeSmall: {
150
- fontSize: '1rem',
150
+ fontSize: '0.875rem',
151
151
  fontWeight: '500',
152
152
  padding: '4px 8px'
153
153
  },
@@ -34,7 +34,7 @@ const UTLabel = _ref => {
34
34
  const Component = _constants.VARIANTS[variant] || _constants.VARIANTS[_constants.DEFAULT_PROPS.variant];
35
35
  const classes = (0, _react.useMemo)(() => (0, _classesUtils.mergeClasses)(theme, {
36
36
  className
37
- }));
37
+ }), [theme, className]);
38
38
  return /*#__PURE__*/_react.default.createElement(_UTSkeleton.default, null, /*#__PURE__*/_react.default.createElement(Component, {
39
39
  className: "".concat(classes.root, " ").concat(classes.className).trim(),
40
40
  title: title,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widergy/energy-ui",
3
- "version": "3.7.0",
3
+ "version": "3.7.1",
4
4
  "description": "Widergy Web Components",
5
5
  "author": "widergy",
6
6
  "license": "MIT",