@ntbjs/react-components 1.3.0-rc.6 → 1.3.0-rc.60
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/.eslintrc +7 -8
- package/{ActionButton-46735b89.js → ActionButton-607bc22f.js} +19 -16
- package/{Alert-13b75102.js → Alert-7bbe87f3.js} +20 -24
- package/{AssetGallery-c8b24eb3.js → AssetAction-3c1dbe16.js} +606 -651
- package/AssetPreviewTopBar-14bd42d0.js +104 -0
- package/{Badge-757b0a39.js → Badge-dc50d116.js} +28 -49
- package/{Button-49f82b31.js → Button-86626421.js} +96 -87
- package/{Checkbox-68dc38a8.js → Checkbox-876f71f0.js} +30 -35
- package/{CompactAutocompleteSelect-755b1869.js → CompactAutocompleteSelect-32a19c92.js} +82 -114
- package/{CompactStarRating-bcfb78ac.js → CompactStarRating-7f680abd.js} +83 -94
- package/{CompactTextInput-9e507306.js → CompactTextInput-337b6320.js} +110 -106
- package/{ContextMenu-4ec3d9f3.js → ContextMenu-b6ba7a22.js} +6 -6
- package/{ContextMenuItem-ba2b697e.js → ContextMenuItem-30f7d64d.js} +22 -26
- package/{InputGroup-49fbc423.js → InputGroup-d25c66ad.js} +6 -6
- package/{Instructions-ab2eb3c7.js → Instructions-702b7c0b.js} +97 -81
- package/{MultiLevelCheckboxSelect-b897d605.js → MultiLevelCheckboxSelect-d95f448b.js} +102 -164
- package/{MultiSelect-efd60232.js → MultiSelect-0cfc8d6c.js} +71 -101
- package/{Popover-569cd272.js → Popover-5e9ab515.js} +41 -40
- package/{Radio-32d0513a.js → Radio-8282d0d6.js} +21 -22
- package/{SectionSeparator-259a22ed.js → SectionSeparator-c9ec6fac.js} +6 -6
- package/{Switch-4a41585f.js → Switch-57f729bb.js} +25 -27
- package/{Tab-f499ecbc.js → Tab-572141e4.js} +7 -7
- package/{Tabs-a8c77f71.js → Tabs-9dbd5b85.js} +39 -43
- package/{TextArea-d17c9516.js → TextArea-41b4f022.js} +93 -125
- package/{TextInput-0d109708.js → TextInput-ad10ba15.js} +48 -50
- package/{Tooltip-66daf6e3.js → Tooltip-5bbe5971.js} +13 -13
- package/{VerificationStatusIcon-d5bfb67a.js → VerificationStatusIcon-10460fe7.js} +20 -30
- package/{close-ebf2f3cf.js → close-1751121a.js} +8 -12
- package/data/Alert/index.js +2 -2
- package/data/Badge/index.js +2 -2
- package/data/Popover/index.js +3 -3
- package/data/Tab/index.js +2 -2
- package/data/Tabs/index.js +3 -3
- package/data/Tooltip/index.js +3 -3
- package/data/index.js +9 -9
- package/{defaultTheme-ea44e34a.js → defaultTheme-06b819a9.js} +213 -261
- package/edit-note-cefe2215.js +37 -0
- package/{expand-more-94585605.js → expand-more-d74e2bd2.js} +8 -12
- package/inputs/ActionButton/index.js +2 -2
- package/inputs/Button/index.js +6 -6
- package/inputs/Checkbox/index.js +2 -2
- package/inputs/CompactAutocompleteSelect/index.js +13 -13
- package/inputs/CompactStarRating/index.js +10 -10
- package/inputs/CompactTextInput/index.js +11 -11
- package/inputs/MultiSelect/index.js +4 -4
- package/inputs/Radio/index.js +2 -2
- package/inputs/Switch/index.js +2 -2
- package/inputs/TextArea/index.js +11 -11
- package/inputs/TextInput/index.js +3 -3
- package/inputs/index.js +28 -28
- package/layout/InputGroup/index.js +2 -2
- package/layout/SectionSeparator/index.js +2 -2
- package/layout/index.js +3 -3
- package/package.json +4 -3
- package/{react-select-creatable.esm-2f23d6c6.js → react-select-creatable.esm-3c7b7450.js} +1414 -1285
- package/{shift-away-subtle-0bed9a3c.js → shift-away-subtle-16a9f31b.js} +1 -1
- package/ssr/index.js +1 -3
- package/styles/config.scss +1 -0
- package/widgets/AssetGallery/index.js +34 -32
- package/widgets/AssetPreview/AssetPreviewTopBar/index.js +3 -3
- package/widgets/ContextMenu/ContextMenuItem/index.js +2 -2
- package/widgets/ContextMenu/ContextMenuItemsGroup/index.js +6 -6
- package/widgets/ContextMenu/index.js +2 -2
- package/widgets/Instructions/index.js +16 -17
- package/widgets/index.js +37 -35
- package/AssetPreviewTopBar-912c3469.js +0 -99
- package/edit-note-c47d292e.js +0 -41
- package/warning-circle-24522402.js +0 -41
package/.eslintrc
CHANGED
|
@@ -8,13 +8,12 @@
|
|
|
8
8
|
"parserOptions": {
|
|
9
9
|
"sourceType": "module"
|
|
10
10
|
},
|
|
11
|
-
"ignorePatterns": [
|
|
12
|
-
"build",
|
|
13
|
-
"storybook-static"
|
|
14
|
-
],
|
|
11
|
+
"ignorePatterns": ["build", "storybook-static"],
|
|
15
12
|
"parser": "@babel/eslint-parser",
|
|
16
|
-
"extends": [
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
13
|
+
"extends": ["eslint:recommended", "plugin:react/recommended"],
|
|
14
|
+
"settings": {
|
|
15
|
+
"react": {
|
|
16
|
+
"version": "detect"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
20
19
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var defaultTheme = require('./defaultTheme-
|
|
3
|
+
var defaultTheme = require('./defaultTheme-06b819a9.js');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var styled = require('styled-components');
|
|
6
6
|
var polished = require('polished');
|
|
@@ -11,13 +11,12 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
11
11
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
12
12
|
|
|
13
13
|
var _templateObject, _templateObject2;
|
|
14
|
-
var ActionButton$1 = styled__default[
|
|
15
|
-
return "".concat(props.
|
|
14
|
+
var ActionButton$1 = styled__default["default"].button.attrs(defaultTheme.applyDefaultTheme)(_templateObject || (_templateObject = defaultTheme._taggedTemplateLiteral(["\n display: inline-flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n width: ", ";\n height: ", ";\n border: 0;\n color: inherit;\n background-color: transparent;\n ", "\n background-position: center;\n background-repeat: no-repeat;\n background-size: 0 0;\n transition: background-size 250ms ease;\n cursor: pointer;\n\n ", "\n\n ", "\n\n &:disabled {\n opacity: 0.5;\n color: inherit;\n cursor: not-allowed;\n }\n\n svg {\n width: 100%;\n max-width: ", ";\n max-height: ", ";\n\n pointer-events: none;\n transition: color 250ms;\n }\n"])), function (props) {
|
|
15
|
+
return "".concat(props.actionWidthHeight[0], "px");
|
|
16
16
|
}, function (props) {
|
|
17
|
-
return "".concat(props.
|
|
17
|
+
return "".concat(props.actionWidthHeight[1], "px");
|
|
18
18
|
}, function (props) {
|
|
19
19
|
var _props$backgroundColo, _props$backgroundColo2, _props$backgroundColo3, _props$backgroundColo4;
|
|
20
|
-
|
|
21
20
|
var darkThemeBgColor = (_props$backgroundColo = props === null || props === void 0 ? void 0 : (_props$backgroundColo2 = props.backgroundColors) === null || _props$backgroundColo2 === void 0 ? void 0 : _props$backgroundColo2[0]) !== null && _props$backgroundColo !== void 0 ? _props$backgroundColo : props.theme.getColor('gray-600');
|
|
22
21
|
var lightThemeBgColor = (_props$backgroundColo3 = props === null || props === void 0 ? void 0 : (_props$backgroundColo4 = props.backgroundColors) === null || _props$backgroundColo4 === void 0 ? void 0 : _props$backgroundColo4[1]) !== null && _props$backgroundColo3 !== void 0 ? _props$backgroundColo3 : props.theme.getColor('gray-200');
|
|
23
22
|
return props.theme.themeProp('background-image', "radial-gradient(circle at center, ".concat(darkThemeBgColor, " 50%, transparent 50%)"), "radial-gradient(circle at center, ".concat(lightThemeBgColor, " 50%, transparent 50%)"));
|
|
@@ -27,22 +26,26 @@ var ActionButton$1 = styled__default['default'].button.attrs(defaultTheme.applyD
|
|
|
27
26
|
});
|
|
28
27
|
}, function (props) {
|
|
29
28
|
return props.useShadow ? props.theme.themeProp('box-shadow', "0px 3px 6px ".concat(polished.rgba(props.theme.getColor('black'), 0.7)), "0px 3px 6px ".concat(props.theme.getColor('black'))) : null;
|
|
29
|
+
}, function (props) {
|
|
30
|
+
return "".concat(props.actionWidthHeight[0] - 15, "px");
|
|
31
|
+
}, function (props) {
|
|
32
|
+
return "".concat(props.actionWidthHeight[1] - 15, "px");
|
|
30
33
|
});
|
|
31
34
|
|
|
32
|
-
var
|
|
35
|
+
var _excluded = ["icon", "disabled", "active", "onClick", "actionWidthHeight"];
|
|
36
|
+
var ActionButton = React__default["default"].forwardRef(function ActionButton(_ref, forwardedRef) {
|
|
33
37
|
var icon = _ref.icon,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return React__default['default'].createElement(ActionButton$1, defaultTheme._extends({
|
|
38
|
+
disabled = _ref.disabled,
|
|
39
|
+
active = _ref.active,
|
|
40
|
+
onClick = _ref.onClick,
|
|
41
|
+
actionWidthHeight = _ref.actionWidthHeight,
|
|
42
|
+
props = defaultTheme._objectWithoutProperties(_ref, _excluded);
|
|
43
|
+
return React__default["default"].createElement(ActionButton$1, defaultTheme._extends({
|
|
41
44
|
ref: forwardedRef,
|
|
42
45
|
disabled: disabled,
|
|
43
46
|
active: active,
|
|
44
47
|
onClick: onClick,
|
|
45
|
-
|
|
48
|
+
actionWidthHeight: actionWidthHeight
|
|
46
49
|
}, props), icon);
|
|
47
50
|
});
|
|
48
51
|
ActionButton.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -51,11 +54,11 @@ ActionButton.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
51
54
|
active: defaultTheme.PropTypes.bool,
|
|
52
55
|
onClick: defaultTheme.PropTypes.func,
|
|
53
56
|
backgroundColors: defaultTheme.PropTypes.arrayOf(defaultTheme.PropTypes.string),
|
|
54
|
-
|
|
57
|
+
actionWidthHeight: defaultTheme.PropTypes.array
|
|
55
58
|
} : {};
|
|
56
59
|
ActionButton.defaultProps = {
|
|
57
60
|
onClick: function onClick() {},
|
|
58
|
-
|
|
61
|
+
actionWidthHeight: [40, 40]
|
|
59
62
|
};
|
|
60
63
|
|
|
61
64
|
exports.ActionButton = ActionButton;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var defaultTheme = require('./defaultTheme-
|
|
3
|
+
var defaultTheme = require('./defaultTheme-06b819a9.js');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var styled = require('styled-components');
|
|
6
6
|
var lodash = require('lodash');
|
|
@@ -11,9 +11,8 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
11
11
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
12
12
|
|
|
13
13
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
14
|
-
var Alert$1 = styled__default[
|
|
14
|
+
var Alert$1 = styled__default["default"].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject || (_templateObject = defaultTheme._taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n padding: ", ";\n width: ", ";\n box-sizing: border-box;\n\n ", "\n\n ", "\n \n ", "\n \n text-align: ", ";\n"])), function (props) {
|
|
15
15
|
var _props$verticalPaddin, _props$horizontalPadd;
|
|
16
|
-
|
|
17
16
|
var verticalPadding = (_props$verticalPaddin = props.verticalPadding) !== null && _props$verticalPaddin !== void 0 ? _props$verticalPaddin : 17;
|
|
18
17
|
var horizontalPadding = (_props$horizontalPadd = props.horizontalPadding) !== null && _props$horizontalPadd !== void 0 ? _props$horizontalPadd : 30;
|
|
19
18
|
return "".concat(verticalPadding, "px ").concat(horizontalPadding, "px");
|
|
@@ -28,7 +27,7 @@ var Alert$1 = styled__default['default'].div.attrs(defaultTheme.applyDefaultThem
|
|
|
28
27
|
}, function (props) {
|
|
29
28
|
return props.align === 'center' ? 'center' : 'left';
|
|
30
29
|
});
|
|
31
|
-
var AlertRender = styled__default[
|
|
30
|
+
var AlertRender = styled__default["default"].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject5 || (_templateObject5 = defaultTheme._taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n word-break: break-word;\n ", "\n ", "\n ", ";\n\n svg {\n width: 12px;\n height: 12px;\n }\n\n span {\n flex: 1;\n padding-left: 5px;\n ", ";\n }\n"])), function (props) {
|
|
32
31
|
return props.lineHeight ? "line-height: ".concat(props.lineHeight, "px;") : null;
|
|
33
32
|
}, function (props) {
|
|
34
33
|
return props.fontSize ? "font-size: ".concat(props.fontSize, "px;") : null;
|
|
@@ -38,25 +37,24 @@ var AlertRender = styled__default['default'].div.attrs(defaultTheme.applyDefault
|
|
|
38
37
|
return props.lineClamp ? styled.css(_templateObject6 || (_templateObject6 = defaultTheme._taggedTemplateLiteral(["\n display: -webkit-box;\n -webkit-line-clamp: ", ";\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n "])), props.lineClamp) : null;
|
|
39
38
|
});
|
|
40
39
|
|
|
41
|
-
var
|
|
40
|
+
var _excluded = ["warning", "error", "type", "alertMessage", "align", "icon", "fontSize", "lineHeight", "lineClamp", "verticalPadding", "horizontalPadding", "width"];
|
|
41
|
+
var Alert = React__default["default"].forwardRef(function Alert(_ref, forwardedRef) {
|
|
42
42
|
var warning = _ref.warning,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
43
|
+
error = _ref.error,
|
|
44
|
+
type = _ref.type,
|
|
45
|
+
alertMessage = _ref.alertMessage,
|
|
46
|
+
align = _ref.align,
|
|
47
|
+
icon = _ref.icon,
|
|
48
|
+
fontSize = _ref.fontSize,
|
|
49
|
+
lineHeight = _ref.lineHeight,
|
|
50
|
+
lineClamp = _ref.lineClamp,
|
|
51
|
+
verticalPadding = _ref.verticalPadding,
|
|
52
|
+
horizontalPadding = _ref.horizontalPadding,
|
|
53
|
+
width = _ref.width,
|
|
54
|
+
props = defaultTheme._objectWithoutProperties(_ref, _excluded);
|
|
56
55
|
var isWarning = false;
|
|
57
56
|
var isError = false;
|
|
58
57
|
var isInfo = true;
|
|
59
|
-
|
|
60
58
|
if (!lodash.isEmpty(type)) {
|
|
61
59
|
if (type === 'warning') {
|
|
62
60
|
isWarning = true;
|
|
@@ -68,13 +66,11 @@ var Alert = React__default['default'].forwardRef(function Alert(_ref, forwardedR
|
|
|
68
66
|
} else {
|
|
69
67
|
isWarning = warning;
|
|
70
68
|
isError = error;
|
|
71
|
-
|
|
72
69
|
if (isWarning || isError) {
|
|
73
70
|
isInfo = false;
|
|
74
71
|
}
|
|
75
72
|
}
|
|
76
|
-
|
|
77
|
-
return React__default['default'].createElement(Alert$1, defaultTheme._extends({
|
|
73
|
+
return React__default["default"].createElement(Alert$1, defaultTheme._extends({
|
|
78
74
|
ref: forwardedRef,
|
|
79
75
|
alertMessage: alertMessage,
|
|
80
76
|
warning: isWarning,
|
|
@@ -84,11 +80,11 @@ var Alert = React__default['default'].forwardRef(function Alert(_ref, forwardedR
|
|
|
84
80
|
verticalPadding: verticalPadding,
|
|
85
81
|
horizontalPadding: horizontalPadding,
|
|
86
82
|
width: width
|
|
87
|
-
}, props), React__default[
|
|
83
|
+
}, props), React__default["default"].createElement(AlertRender, {
|
|
88
84
|
fontSize: fontSize,
|
|
89
85
|
lineHeight: lineHeight,
|
|
90
86
|
lineClamp: lineClamp
|
|
91
|
-
}, icon, " ", React__default[
|
|
87
|
+
}, icon, " ", React__default["default"].createElement("span", null, alertMessage)));
|
|
92
88
|
});
|
|
93
89
|
Alert.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
94
90
|
warning: defaultTheme.PropTypes.bool,
|