@widergy/energy-ui 3.28.0 → 3.30.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 +14 -0
- package/dist/components/UTBaseInputField/constants.js +26 -0
- package/dist/components/UTBaseInputField/index.js +39 -47
- package/dist/components/UTBaseInputField/theme.js +15 -4
- package/dist/components/UTBaseInputField/utils.js +9 -0
- package/dist/components/UTCheckList/index.js +12 -160
- package/dist/components/UTCheckList/versions/V0/index.js +174 -0
- package/dist/components/UTCheckList/{theme.js → versions/V0/theme.js} +2 -2
- package/dist/components/UTCheckList/versions/V1/README.MD +134 -0
- package/dist/components/UTCheckList/versions/V1/constants.js +10 -0
- package/dist/components/UTCheckList/versions/V1/index.js +151 -0
- package/dist/components/UTCheckList/versions/V1/styles.module.scss +40 -0
- package/dist/components/UTCheckList/versions/V1/utils.js +14 -0
- package/dist/components/UTCheckbox/index.js +12 -128
- package/dist/components/UTCheckbox/versions/V0/index.js +142 -0
- package/dist/components/UTCheckbox/{theme.js → versions/V0/theme.js} +1 -1
- package/dist/components/UTCheckbox/versions/V1/README.md +37 -0
- package/dist/components/UTCheckbox/versions/V1/constants.js +13 -0
- package/dist/components/UTCheckbox/versions/V1/index.js +93 -0
- package/dist/components/UTCheckbox/versions/V1/styles.module.scss +3 -0
- package/dist/components/UTCheckbox/versions/V1/theme.js +126 -0
- package/dist/components/UTFieldLabel/index.js +3 -2
- package/dist/components/UTLabel/constants.js +0 -2
- package/dist/components/UTPhoneInput/versions/V1/index.js +24 -10
- package/dist/components/UTSearchField/README.md +35 -0
- package/dist/components/UTSearchField/index.js +89 -0
- package/dist/components/UTSearchField/theme.js +19 -0
- package/dist/components/UTTextInput/versions/V1/README.md +0 -1
- package/dist/components/UTTextInput/versions/V1/index.js +48 -6
- package/dist/components/UTTouchableWithoutFeedback/index.js +19 -10
- package/dist/components/UTTouchableWithoutFeedback/styles.module.scss +5 -0
- package/dist/index.js +7 -0
- package/package.json +1 -1
- package/dist/components/UTTextInput/versions/V1/components/ActionAdornment/index.js +0 -31
- package/dist/components/UTTextInput/versions/V1/components/IconAdornment/constants.js +0 -8
- package/dist/components/UTTextInput/versions/V1/components/IconAdornment/index.js +0 -48
- package/dist/components/UTTextInput/versions/V1/components/IconAdornment/utils.js +0 -17
- package/dist/components/UTTextInput/versions/V1/components/PrefixAdornment/index.js +0 -24
- package/dist/components/UTTextInput/versions/V1/components/SuffixAdornment/index.js +0 -22
- package/dist/components/UTTextInput/versions/V1/components/TooltipAdornment/index.js +0 -26
- package/dist/components/UTTextInput/versions/V1/theme.js +0 -94
- /package/dist/components/UTCheckList/{constants.js → versions/V0/constants.js} +0 -0
- /package/dist/components/UTCheckList/{styles.module.scss → versions/V0/styles.module.scss} +0 -0
- /package/dist/components/UTCheckbox/{assets → versions/V0/assets}/checked.svg +0 -0
- /package/dist/components/UTCheckbox/{constants.js → versions/V0/constants.js} +0 -0
- /package/dist/components/UTCheckbox/{styles.module.scss → versions/V0/styles.module.scss} +0 -0
|
@@ -16,10 +16,11 @@ const UTTouchableWithoutFeedback = _ref => {
|
|
|
16
16
|
let {
|
|
17
17
|
children,
|
|
18
18
|
className,
|
|
19
|
-
onClick,
|
|
20
19
|
containerSetter,
|
|
21
|
-
|
|
20
|
+
disabled = false,
|
|
22
21
|
keyName,
|
|
22
|
+
onClick,
|
|
23
|
+
withRipple = false,
|
|
23
24
|
...props
|
|
24
25
|
} = _ref;
|
|
25
26
|
const [buttonRef, setButtonRef] = (0, _react.useState)(null);
|
|
@@ -27,22 +28,30 @@ const UTTouchableWithoutFeedback = _ref => {
|
|
|
27
28
|
setButtonRef(ref);
|
|
28
29
|
if (containerSetter) containerSetter(ref);
|
|
29
30
|
};
|
|
31
|
+
const handleClick = event => {
|
|
32
|
+
if (!disabled && onClick) {
|
|
33
|
+
onClick(event);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
30
36
|
return /*#__PURE__*/_react.default.createElement("div", _extends({}, props, {
|
|
31
37
|
role: "button",
|
|
32
|
-
onClick:
|
|
33
|
-
className: "".concat(_stylesModule.default.container, " ").concat(className),
|
|
38
|
+
onClick: handleClick,
|
|
39
|
+
className: "".concat(_stylesModule.default.container, " ").concat(className, " ").concat(disabled && _stylesModule.default.disabled),
|
|
34
40
|
key: keyName,
|
|
35
|
-
ref: setRef
|
|
41
|
+
ref: setRef,
|
|
42
|
+
"aria-disabled": disabled,
|
|
43
|
+
tabIndex: disabled ? -1 : 0
|
|
36
44
|
}), children, /*#__PURE__*/_react.default.createElement(_UTRipple.default, {
|
|
37
45
|
elem: buttonRef,
|
|
38
|
-
withRipple: withRipple
|
|
46
|
+
withRipple: withRipple && !disabled
|
|
39
47
|
}));
|
|
40
48
|
};
|
|
41
49
|
UTTouchableWithoutFeedback.propTypes = {
|
|
42
|
-
onClick: _propTypes.func,
|
|
43
|
-
containerSetter: _propTypes.func,
|
|
44
50
|
className: _propTypes.string,
|
|
45
|
-
|
|
46
|
-
|
|
51
|
+
containerSetter: _propTypes.func,
|
|
52
|
+
disabled: _propTypes.bool,
|
|
53
|
+
keyName: _propTypes.string,
|
|
54
|
+
onClick: _propTypes.func,
|
|
55
|
+
withRipple: _propTypes.bool
|
|
47
56
|
};
|
|
48
57
|
var _default = exports.default = UTTouchableWithoutFeedback;
|
package/dist/index.js
CHANGED
|
@@ -285,6 +285,12 @@ Object.defineProperty(exports, "UTRating", {
|
|
|
285
285
|
return _UTRating.default;
|
|
286
286
|
}
|
|
287
287
|
});
|
|
288
|
+
Object.defineProperty(exports, "UTSearchField", {
|
|
289
|
+
enumerable: true,
|
|
290
|
+
get: function () {
|
|
291
|
+
return _UTSearchField.default;
|
|
292
|
+
}
|
|
293
|
+
});
|
|
288
294
|
Object.defineProperty(exports, "UTSelect", {
|
|
289
295
|
enumerable: true,
|
|
290
296
|
get: function () {
|
|
@@ -465,6 +471,7 @@ var _UTProductItem = _interopRequireDefault(require("./components/UTProductItem"
|
|
|
465
471
|
var _UTProgressBar = _interopRequireDefault(require("./components/UTProgressBar"));
|
|
466
472
|
var _UTRadioGroup = _interopRequireDefault(require("./components/UTRadioGroup"));
|
|
467
473
|
var _UTRating = _interopRequireDefault(require("./components/UTRating"));
|
|
474
|
+
var _UTSearchField = _interopRequireDefault(require("./components/UTSearchField"));
|
|
468
475
|
var _UTSelect = _interopRequireDefault(require("./components/UTSelect"));
|
|
469
476
|
var _UTSelectableCard = _interopRequireDefault(require("./components/UTSelectableCard"));
|
|
470
477
|
var _UTSidebar = _interopRequireDefault(require("./components/UTSidebar"));
|
package/package.json
CHANGED
|
@@ -1,31 +0,0 @@
|
|
|
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 _UTButton = _interopRequireDefault(require("../../../../../UTButton"));
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
12
|
-
const ActionAdornment = _ref => {
|
|
13
|
-
let {
|
|
14
|
-
action = {},
|
|
15
|
-
disabled,
|
|
16
|
-
classNames
|
|
17
|
-
} = _ref;
|
|
18
|
-
if (!action) return null;
|
|
19
|
-
return /*#__PURE__*/_react.default.createElement(_UTButton.default, _extends({
|
|
20
|
-
disabled: disabled,
|
|
21
|
-
classNames: classNames,
|
|
22
|
-
variant: "text",
|
|
23
|
-
size: "small"
|
|
24
|
-
}, action), action.text);
|
|
25
|
-
};
|
|
26
|
-
ActionAdornment.propTypes = {
|
|
27
|
-
action: _propTypes.object,
|
|
28
|
-
classNames: (0, _propTypes.objectOf)(_propTypes.string),
|
|
29
|
-
disabled: _propTypes.bool
|
|
30
|
-
};
|
|
31
|
-
var _default = exports.default = ActionAdornment;
|
|
@@ -1,48 +0,0 @@
|
|
|
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 _UTIcon = _interopRequireDefault(require("../../../../../UTIcon"));
|
|
10
|
-
var _componentUtils = require("../../../../../../utils/componentUtils");
|
|
11
|
-
var _constants = require("./constants");
|
|
12
|
-
var _utils = require("./utils");
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
15
|
-
const IconAdornment = _ref => {
|
|
16
|
-
let {
|
|
17
|
-
changeOnError = false,
|
|
18
|
-
changeOnFocus = false,
|
|
19
|
-
colorTheme,
|
|
20
|
-
error,
|
|
21
|
-
focused,
|
|
22
|
-
Icon,
|
|
23
|
-
inputStyle,
|
|
24
|
-
shade
|
|
25
|
-
} = _ref;
|
|
26
|
-
const IconToRender = error && changeOnError ? _constants.ERROR_ICON : Icon;
|
|
27
|
-
if (!IconToRender) return null;
|
|
28
|
-
return (0, _componentUtils.isUTIcon)(IconToRender) ? /*#__PURE__*/_react.default.createElement(_UTIcon.default, _extends({
|
|
29
|
-
name: IconToRender,
|
|
30
|
-
size: _constants.ICON_SIZE
|
|
31
|
-
}, (0, _utils.getIconColorProps)(changeOnError, changeOnFocus, colorTheme, error, focused, shade))) : /*#__PURE__*/_react.default.createElement(Icon, {
|
|
32
|
-
size: _constants.ICON_SIZE,
|
|
33
|
-
fill: inputStyle.root.color
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
IconAdornment.propTypes = {
|
|
37
|
-
changeOnError: _propTypes.bool,
|
|
38
|
-
changeOnFocus: _propTypes.bool,
|
|
39
|
-
colorTheme: _propTypes.string,
|
|
40
|
-
error: (0, _propTypes.oneOfType)([_propTypes.bool, _propTypes.string]),
|
|
41
|
-
focused: _propTypes.bool,
|
|
42
|
-
Icon: _propTypes.elementType,
|
|
43
|
-
inputStyle: (0, _propTypes.shape)({
|
|
44
|
-
root: _propTypes.object
|
|
45
|
-
}),
|
|
46
|
-
shade: _propTypes.string
|
|
47
|
-
};
|
|
48
|
-
var _default = exports.default = IconAdornment;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getIconColorProps = void 0;
|
|
7
|
-
const getIconColorProps = (changeOnError, changeOnFocus, colorTheme, error, focused, shade) => changeOnError && error ? {
|
|
8
|
-
colorTheme: 'error',
|
|
9
|
-
shade: '04'
|
|
10
|
-
} : changeOnFocus && focused ? {
|
|
11
|
-
colorTheme: 'accent',
|
|
12
|
-
shade: '04'
|
|
13
|
-
} : {
|
|
14
|
-
colorTheme: colorTheme || 'gray',
|
|
15
|
-
shade
|
|
16
|
-
};
|
|
17
|
-
exports.getIconColorProps = getIconColorProps;
|
|
@@ -1,24 +0,0 @@
|
|
|
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 _UTLabel = _interopRequireDefault(require("../../../../../UTLabel"));
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
const PrefixAdornment = _ref => {
|
|
12
|
-
let {
|
|
13
|
-
text
|
|
14
|
-
} = _ref;
|
|
15
|
-
return /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
16
|
-
colorTheme: "gray",
|
|
17
|
-
variant: "small",
|
|
18
|
-
weight: "medium"
|
|
19
|
-
}, text);
|
|
20
|
-
};
|
|
21
|
-
PrefixAdornment.propTypes = {
|
|
22
|
-
text: _propTypes.string
|
|
23
|
-
};
|
|
24
|
-
var _default = exports.default = PrefixAdornment;
|
|
@@ -1,22 +0,0 @@
|
|
|
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 _UTLabel = _interopRequireDefault(require("../../../../../UTLabel"));
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
const SuffixAdornment = _ref => {
|
|
12
|
-
let {
|
|
13
|
-
text
|
|
14
|
-
} = _ref;
|
|
15
|
-
return /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
16
|
-
colorTheme: "gray"
|
|
17
|
-
}, text);
|
|
18
|
-
};
|
|
19
|
-
SuffixAdornment.propTypes = {
|
|
20
|
-
text: _propTypes.string
|
|
21
|
-
};
|
|
22
|
-
var _default = exports.default = SuffixAdornment;
|
|
@@ -1,26 +0,0 @@
|
|
|
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 _UTTooltip = _interopRequireDefault(require("../../../../../UTTooltip"));
|
|
10
|
-
var _UTIcon = _interopRequireDefault(require("../../../../../UTIcon"));
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
const TooltipAdornment = _ref => {
|
|
13
|
-
let {
|
|
14
|
-
tooltip
|
|
15
|
-
} = _ref;
|
|
16
|
-
return /*#__PURE__*/_react.default.createElement(_UTTooltip.default, {
|
|
17
|
-
content: tooltip
|
|
18
|
-
}, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_UTIcon.default, {
|
|
19
|
-
name: "IconInfoCircle",
|
|
20
|
-
colorTheme: "gray"
|
|
21
|
-
})));
|
|
22
|
-
};
|
|
23
|
-
TooltipAdornment.propTypes = {
|
|
24
|
-
tooltip: _propTypes.string
|
|
25
|
-
};
|
|
26
|
-
var _default = exports.default = TooltipAdornment;
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.retrieveStyle = void 0;
|
|
7
|
-
var _theme = require("../../../UTLabel/theme");
|
|
8
|
-
const charactersCountRowHeight = 20;
|
|
9
|
-
const PADDING = {
|
|
10
|
-
HORIZONTAL: 16,
|
|
11
|
-
VERTICAL: 12
|
|
12
|
-
};
|
|
13
|
-
const SMALL_PADDING = {
|
|
14
|
-
HORIZONTAL: 12,
|
|
15
|
-
VERTICAL: 8
|
|
16
|
-
};
|
|
17
|
-
const GRID_GAP = 16;
|
|
18
|
-
const retrieveStyle = _ref => {
|
|
19
|
-
let {
|
|
20
|
-
theme,
|
|
21
|
-
inputSize,
|
|
22
|
-
error,
|
|
23
|
-
disabled: receivedDisabled,
|
|
24
|
-
readOnly,
|
|
25
|
-
showCharacterCount,
|
|
26
|
-
maxLength
|
|
27
|
-
} = _ref;
|
|
28
|
-
const disabled = receivedDisabled && !readOnly;
|
|
29
|
-
const verticalPadding = "".concat(inputSize === 'small' ? SMALL_PADDING.VERTICAL : PADDING.VERTICAL, "px");
|
|
30
|
-
const multilineVerticalPadding = "".concat((inputSize === 'small' ? SMALL_PADDING.VERTICAL : PADDING.VERTICAL) + GRID_GAP + charactersCountRowHeight, "px");
|
|
31
|
-
const horizontalPadding = "".concat(inputSize === 'small' ? SMALL_PADDING.HORIZONTAL : PADDING.HORIZONTAL, "px");
|
|
32
|
-
const hasCharactersCount = showCharacterCount && maxLength && !disabled && !readOnly;
|
|
33
|
-
return {
|
|
34
|
-
charactersCount: {
|
|
35
|
-
position: 'absolute',
|
|
36
|
-
bottom: verticalPadding
|
|
37
|
-
},
|
|
38
|
-
root: {
|
|
39
|
-
backgroundColor: theme.Palette.light['01'],
|
|
40
|
-
paddingBottom: hasCharactersCount ? multilineVerticalPadding : verticalPadding,
|
|
41
|
-
paddingLeft: horizontalPadding,
|
|
42
|
-
paddingRight: horizontalPadding,
|
|
43
|
-
paddingTop: verticalPadding,
|
|
44
|
-
...(readOnly && {
|
|
45
|
-
backgroundColor: 'transparent',
|
|
46
|
-
paddingLeft: 0,
|
|
47
|
-
paddingRight: 0
|
|
48
|
-
}),
|
|
49
|
-
...(disabled && {
|
|
50
|
-
backgroundColor: theme.Palette.light['03']
|
|
51
|
-
})
|
|
52
|
-
},
|
|
53
|
-
inputContainer: {
|
|
54
|
-
borderColor: "".concat(theme.Palette.light['05'], " !important"),
|
|
55
|
-
borderRadius: '4px',
|
|
56
|
-
borderWidth: '1px',
|
|
57
|
-
...(error && {
|
|
58
|
-
borderColor: "".concat(theme.Palette.error['04'], " !important")
|
|
59
|
-
}),
|
|
60
|
-
...(readOnly && {
|
|
61
|
-
borderColor: 'transparent !important'
|
|
62
|
-
}),
|
|
63
|
-
...(disabled && {
|
|
64
|
-
borderColor: 'transparent !important'
|
|
65
|
-
})
|
|
66
|
-
},
|
|
67
|
-
focusedInputContainer: {
|
|
68
|
-
...(!error && {
|
|
69
|
-
borderColor: "".concat(theme.Palette.accent['04'], " !important"),
|
|
70
|
-
borderWidth: '2px'
|
|
71
|
-
})
|
|
72
|
-
},
|
|
73
|
-
input: {
|
|
74
|
-
...(0, _theme.getFontStyles)({
|
|
75
|
-
theme,
|
|
76
|
-
variant: 'body',
|
|
77
|
-
weight: 'regular'
|
|
78
|
-
}),
|
|
79
|
-
caretColor: theme.Palette.accent['04'],
|
|
80
|
-
color: theme.Palette.dark['05'],
|
|
81
|
-
minHeight: '22px',
|
|
82
|
-
overflow: 'hidden',
|
|
83
|
-
padding: 0,
|
|
84
|
-
textOverflow: 'ellipsis',
|
|
85
|
-
'&::placeholder': {
|
|
86
|
-
color: theme.Palette.gray['02']
|
|
87
|
-
},
|
|
88
|
-
'&::selection': {
|
|
89
|
-
backgroundColor: theme.Palette.accent['02']
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
|
-
exports.retrieveStyle = retrieveStyle;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|