@widergy/energy-ui 3.7.1 → 3.7.2
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 +7 -0
- package/dist/components/UTButton/index.js +1 -0
- package/dist/components/UTIcon/README.md +36 -0
- package/dist/components/UTIcon/index.js +34 -0
- package/dist/components/UTLabel/index.js +2 -6
- package/dist/components/UTLabel/theme.js +1 -3
- package/dist/index.js +7 -0
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [3.7.2](https://github.com/widergy/energy-ui/compare/v3.7.1...v3.7.2) (2024-05-23)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* utIcon component ([#449](https://github.com/widergy/energy-ui/issues/449)) ([ab82968](https://github.com/widergy/energy-ui/commit/ab82968128d21dffe647d58874fb4c79892c044c))
|
|
7
|
+
|
|
1
8
|
## [3.7.1](https://github.com/widergy/energy-ui/compare/v3.7.0...v3.7.1) (2024-05-20)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -66,6 +66,7 @@ UTButton.defaultProps = _constants.DEFAULT_PROPS;
|
|
|
66
66
|
UTButton.propTypes = {
|
|
67
67
|
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
68
68
|
classNames: (0, _propTypes.objectOf)(_propTypes.string),
|
|
69
|
+
dataTestId: _propTypes.string,
|
|
69
70
|
disabled: _propTypes.bool,
|
|
70
71
|
hideTextOnResponsive: _propTypes.bool,
|
|
71
72
|
Icon: _propTypes.elementType,
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# UTIcon
|
|
2
|
+
|
|
3
|
+
### Description
|
|
4
|
+
|
|
5
|
+
Icon component using Tabler Icons library.
|
|
6
|
+
|
|
7
|
+
### Name
|
|
8
|
+
|
|
9
|
+
The icon name must be with the first letter of each word in uppercase.
|
|
10
|
+
|
|
11
|
+
### Props
|
|
12
|
+
|
|
13
|
+
| Name | Description |
|
|
14
|
+
| --------- | ----------------------------------- |
|
|
15
|
+
| name | The name of the icon in TablerIcons |
|
|
16
|
+
| classname | The classname to aplied to the Icon |
|
|
17
|
+
| color | The icon color |
|
|
18
|
+
| size | The icon size in px |
|
|
19
|
+
|
|
20
|
+
### Usage
|
|
21
|
+
|
|
22
|
+
```javascript
|
|
23
|
+
import React from 'react';
|
|
24
|
+
import { UTIcon } from '@widergy/energy-ui';
|
|
25
|
+
import styles from './styles.module.scss';
|
|
26
|
+
|
|
27
|
+
const MyComponent = () => {
|
|
28
|
+
return (
|
|
29
|
+
<div>
|
|
30
|
+
<UTIcon name="IconArrowLeft" color="red" size={48} className={styles.iconClassname} />
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default MyComponent;
|
|
36
|
+
```
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = require("prop-types");
|
|
9
|
+
var TablerIcons = _interopRequireWildcard(require("@tabler/icons-react"));
|
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
const UTIcon = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
className,
|
|
16
|
+
color,
|
|
17
|
+
name,
|
|
18
|
+
size
|
|
19
|
+
} = _ref;
|
|
20
|
+
const IconComponent = TablerIcons[name];
|
|
21
|
+
if (!IconComponent) return null;
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement(IconComponent, {
|
|
23
|
+
className: className,
|
|
24
|
+
color: color,
|
|
25
|
+
size: size
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
UTIcon.propTypes = {
|
|
29
|
+
className: _propTypes.string,
|
|
30
|
+
color: _propTypes.string,
|
|
31
|
+
name: _propTypes.string,
|
|
32
|
+
size: _propTypes.number
|
|
33
|
+
};
|
|
34
|
+
var _default = exports.default = UTIcon;
|
|
@@ -25,20 +25,18 @@ const UTLabel = _ref => {
|
|
|
25
25
|
classes: theme,
|
|
26
26
|
className,
|
|
27
27
|
markdownRenderers,
|
|
28
|
-
style,
|
|
29
28
|
title,
|
|
30
29
|
variant,
|
|
31
30
|
withMarkdown
|
|
32
31
|
} = _ref;
|
|
33
|
-
if (children
|
|
32
|
+
if (!children) return null;
|
|
34
33
|
const Component = _constants.VARIANTS[variant] || _constants.VARIANTS[_constants.DEFAULT_PROPS.variant];
|
|
35
34
|
const classes = (0, _react.useMemo)(() => (0, _classesUtils.mergeClasses)(theme, {
|
|
36
35
|
className
|
|
37
36
|
}), [theme, className]);
|
|
38
37
|
return /*#__PURE__*/_react.default.createElement(_UTSkeleton.default, null, /*#__PURE__*/_react.default.createElement(Component, {
|
|
39
38
|
className: "".concat(classes.root, " ").concat(classes.className).trim(),
|
|
40
|
-
title: title
|
|
41
|
-
style: style
|
|
39
|
+
title: title
|
|
42
40
|
}, withMarkdown && /*#__PURE__*/_react.default.createElement(_reactMarkdown.default, {
|
|
43
41
|
children: children,
|
|
44
42
|
components: markdownRenderers,
|
|
@@ -54,8 +52,6 @@ UTLabel.propTypes = {
|
|
|
54
52
|
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
55
53
|
className: _propTypes.string,
|
|
56
54
|
markdownRenderers: (0, _propTypes.objectOf)(_propTypes.func),
|
|
57
|
-
// TODO: this "style" prop is for compatibility with the -base project only. Delete it when no longer needed
|
|
58
|
-
style: _propTypes.object,
|
|
59
55
|
title: _propTypes.string,
|
|
60
56
|
variant: _propTypes.string,
|
|
61
57
|
withMarkdown: _propTypes.bool
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.retrieveStyle = void 0;
|
|
7
7
|
var _colorsModule = _interopRequireDefault(require("../../scss/variables/colors.module.scss"));
|
|
8
8
|
var _constants = require("./constants");
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -13,12 +13,10 @@ const variantsColorTheme = (colorTheme, shade, theme) => {
|
|
|
13
13
|
const colorShade = Object.values(_constants.SHADES).includes(shade) ? shade : getDefaultColorShade(colorTheme);
|
|
14
14
|
return colorThemeDefinition[colorShade] || _colorsModule.default.black;
|
|
15
15
|
};
|
|
16
|
-
exports.variantsColorTheme = variantsColorTheme;
|
|
17
16
|
const linkColor = (theme, colorTheme) => {
|
|
18
17
|
const color = colorTheme === _constants.COLOR_THEMES.light ? theme.Palette.actions.negative[_constants.SHADES.shade05] : colorTheme === _constants.COLOR_THEMES.error ? theme.Palette.actions.error[_constants.SHADES.shade05] : theme.Palette.actions.neutral[_constants.SHADES.shade05];
|
|
19
18
|
return color;
|
|
20
19
|
};
|
|
21
|
-
exports.linkColor = linkColor;
|
|
22
20
|
const retrieveStyle = _ref => {
|
|
23
21
|
var _field$configuration$, _field$configuration, _field$configuration$2, _field$configuration2, _theme$Fonts, _field$configuration$3, _field$configuration3, _field$configuration$4, _field$configuration4, _field$configuration$5, _field$configuration5;
|
|
24
22
|
let {
|
package/dist/index.js
CHANGED
|
@@ -147,6 +147,12 @@ Object.defineProperty(exports, "UTFileInput", {
|
|
|
147
147
|
return _UTFileInput.default;
|
|
148
148
|
}
|
|
149
149
|
});
|
|
150
|
+
Object.defineProperty(exports, "UTIcon", {
|
|
151
|
+
enumerable: true,
|
|
152
|
+
get: function () {
|
|
153
|
+
return _UTIcon.default;
|
|
154
|
+
}
|
|
155
|
+
});
|
|
150
156
|
Object.defineProperty(exports, "UTIconButton", {
|
|
151
157
|
enumerable: true,
|
|
152
158
|
get: function () {
|
|
@@ -394,6 +400,7 @@ var _UTDotMenu = _interopRequireDefault(require("./components/UTDotMenu"));
|
|
|
394
400
|
var _UTEmojiPicker = _interopRequireDefault(require("./components/UTEmojiPicker"));
|
|
395
401
|
var _UTExternalLink = _interopRequireDefault(require("./components/UTExternalLink"));
|
|
396
402
|
var _UTFileInput = _interopRequireDefault(require("./components/UTFileInput"));
|
|
403
|
+
var _UTIcon = _interopRequireDefault(require("./components/UTIcon"));
|
|
397
404
|
var _UTIconButton = _interopRequireDefault(require("./components/UTIconButton"));
|
|
398
405
|
var _UTImageRadio = _interopRequireDefault(require("./components/UTImageRadio"));
|
|
399
406
|
var _UTLabel = _interopRequireDefault(require("./components/UTLabel"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@widergy/energy-ui",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.2",
|
|
4
4
|
"description": "Widergy Web Components",
|
|
5
5
|
"author": "widergy",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"@material-ui/icons": "^3.0.1",
|
|
29
29
|
"@material-ui/lab": "^4.0.0-alpha.57",
|
|
30
30
|
"@material-ui/pickers": "^3.3.10",
|
|
31
|
+
"@tabler/icons-react": "^2.0.0",
|
|
31
32
|
"@tippy.js/react": "^3.0.0",
|
|
32
33
|
"@trainline/react-skeletor": "^1.0.2",
|
|
33
34
|
"@widergy/energy-hooks": "^2.0.0",
|
|
@@ -38,6 +39,7 @@
|
|
|
38
39
|
"d3": "^7.0.1",
|
|
39
40
|
"dayjs": "^1.10.7",
|
|
40
41
|
"emojilib": "^3.0.10",
|
|
42
|
+
"node-sass": "^8.0.0",
|
|
41
43
|
"numeral": "^2.0.6",
|
|
42
44
|
"object-hash": "^3.0.0",
|
|
43
45
|
"react-google-maps": ">=9.2.2",
|
|
@@ -49,7 +51,6 @@
|
|
|
49
51
|
"react-window": "^1.8.5",
|
|
50
52
|
"rehype-raw": "^6.1.0",
|
|
51
53
|
"remark-breaks": "^3.0.2",
|
|
52
|
-
"node-sass": "^8.0.0",
|
|
53
54
|
"sass-loader": "^10.0.5",
|
|
54
55
|
"seamless-immutable": "^7.1.4"
|
|
55
56
|
},
|