@ntbjs/react-components 1.3.0-rc.4 → 1.3.0-rc.41
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-581e717e.js} +23 -18
- package/{Alert-13b75102.js → Alert-b79a8fcc.js} +30 -29
- package/{AssetGallery-7d05ac94.js → AssetAction-06d40708.js} +790 -655
- package/AssetPreviewTopBar-1b5dfde2.js +118 -0
- package/{Badge-757b0a39.js → Badge-a35c7018.js} +44 -54
- package/Button-70230131.js +284 -0
- package/Checkbox-92d07052.js +152 -0
- package/CompactAutocompleteSelect-c7a11d3d.js +478 -0
- package/CompactStarRating-86673c4f.js +343 -0
- package/CompactTextInput-f1824946.js +380 -0
- package/{ContextMenu-4ec3d9f3.js → ContextMenu-999756c8.js} +9 -7
- package/ContextMenuItem-ae4357ba.js +114 -0
- package/{InputGroup-49fbc423.js → InputGroup-0423e24c.js} +9 -7
- package/{Instructions-e5947be9.js → Instructions-9910f44d.js} +109 -82
- package/{MultiLevelCheckboxSelect-b897d605.js → MultiLevelCheckboxSelect-7a036b16.js} +158 -168
- package/MultiSelect-9d8c24e5.js +406 -0
- package/{Popover-569cd272.js → Popover-0d9a689b.js} +24 -24
- package/Radio-a0610a91.js +90 -0
- package/{SectionSeparator-259a22ed.js → SectionSeparator-5025c8f4.js} +9 -7
- package/Switch-b7193858.js +122 -0
- package/{Tab-f499ecbc.js → Tab-7c817d4d.js} +10 -8
- package/{Tabs-a8c77f71.js → Tabs-318feff9.js} +54 -44
- package/TextArea-ecfd3418.js +382 -0
- package/TextInput-91d6341d.js +252 -0
- package/{Tooltip-66daf6e3.js → Tooltip-478ec993.js} +16 -14
- package/{VerificationStatusIcon-d5bfb67a.js → VerificationStatusIcon-ecec5f07.js} +30 -32
- 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-573a9150.js} +205 -263
- 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 +12 -12
- 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 +6 -5
- package/{react-select-creatable.esm-2f23d6c6.js → react-select-creatable.esm-8bf8566a.js} +1500 -1074
- package/{shift-away-subtle-0bed9a3c.js → shift-away-subtle-a9da38b8.js} +1 -1
- package/ssr/index.js +1 -3
- 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 +9 -7
- 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/Button-49f82b31.js +0 -264
- package/Checkbox-68dc38a8.js +0 -140
- package/CompactAutocompleteSelect-755b1869.js +0 -451
- package/CompactStarRating-bcfb78ac.js +0 -339
- package/CompactTextInput-9e507306.js +0 -349
- package/ContextMenuItem-ba2b697e.js +0 -110
- package/MultiSelect-efd60232.js +0 -377
- package/Radio-32d0513a.js +0 -86
- package/Switch-4a41585f.js +0 -107
- package/TextArea-8f62da6e.js +0 -353
- package/TextInput-0d109708.js +0 -236
- package/edit-note-c47d292e.js +0 -41
- package/warning-circle-24522402.js +0 -41
|
@@ -1,97 +1,131 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var defaultTheme = require('./defaultTheme-
|
|
3
|
+
var defaultTheme = require('./defaultTheme-573a9150.js');
|
|
4
4
|
var lodash = require('lodash');
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var TextArea = require('./TextArea-8f62da6e.js');
|
|
6
|
+
var CompactAutocompleteSelect = require('./CompactAutocompleteSelect-c7a11d3d.js');
|
|
7
|
+
var TextArea = require('./TextArea-ecfd3418.js');
|
|
9
8
|
var styled = require('styled-components');
|
|
10
9
|
|
|
11
10
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
11
|
|
|
12
|
+
function _interopNamespace(e) {
|
|
13
|
+
if (e && e.__esModule) return e;
|
|
14
|
+
var n = Object.create(null);
|
|
15
|
+
if (e) {
|
|
16
|
+
Object.keys(e).forEach(function (k) {
|
|
17
|
+
if (k !== 'default') {
|
|
18
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
19
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () { return e[k]; }
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
n["default"] = e;
|
|
27
|
+
return Object.freeze(n);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
13
31
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
32
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
15
33
|
|
|
16
|
-
var
|
|
17
|
-
|
|
34
|
+
var _path;
|
|
35
|
+
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); }
|
|
36
|
+
function SvgWarningCircle(props) {
|
|
37
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
38
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
39
|
+
viewBox: "0 0 24 24"
|
|
40
|
+
}, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
41
|
+
fill: "currentColor",
|
|
42
|
+
d: "M10.8 15.6h2.4V18h-2.4zm0-9.6h2.4v7.2h-2.4zm1.188-6A12 12 0 1024 12 11.994 11.994 0 0011.988 0zM12 21.6a9.6 9.6 0 119.6-9.6 9.597 9.597 0 01-9.6 9.6z"
|
|
43
|
+
})));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
var Instructions$1 = styled__default["default"].div.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
47
|
+
displayName: "Instructionsstyled__Instructions",
|
|
48
|
+
componentId: "sc-1lgufne-0"
|
|
49
|
+
})(["display:flex;position:relative;flex-direction:column;", ";"], function (props) {
|
|
18
50
|
return props.theme.themeProp('background', '#634E01', props.theme.getColor('signal-yellow-400'));
|
|
19
51
|
});
|
|
20
|
-
var TopBarContainer = styled__default[
|
|
52
|
+
var TopBarContainer = styled__default["default"].div.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
53
|
+
displayName: "Instructionsstyled__TopBarContainer",
|
|
54
|
+
componentId: "sc-1lgufne-1"
|
|
55
|
+
})(["position:absolute;display:flex;width:100%;margin-top:0;transition:margin-top 120ms;&&.slide-in{margin-top:-24px;}", ";", ";"], function (props) {
|
|
21
56
|
return props.theme.themeProp('background', '#634E01', props.theme.getColor('signal-yellow-400'));
|
|
22
57
|
}, function (props) {
|
|
23
58
|
return props.initialHover && props.theme.themeProp('background', '#634E01', props.theme.getColor('signal-yellow-400'));
|
|
24
59
|
});
|
|
25
|
-
var SelectContainer = styled__default[
|
|
26
|
-
|
|
60
|
+
var SelectContainer = styled__default["default"].div.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
61
|
+
displayName: "Instructionsstyled__SelectContainer",
|
|
62
|
+
componentId: "sc-1lgufne-2"
|
|
63
|
+
})(["width:100%;margin:0 2px;"]);
|
|
64
|
+
var InstructionsArea = styled__default["default"].div.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
65
|
+
displayName: "Instructionsstyled__InstructionsArea",
|
|
66
|
+
componentId: "sc-1lgufne-3"
|
|
67
|
+
})(["margin:2px 2px -2px 2px;"]);
|
|
27
68
|
|
|
28
|
-
var
|
|
69
|
+
var _excluded = ["clickToAdd", "customAddMessage", "selectedOption", "loadOptions", "readOnly", "disabled", "hidden", "name", "lightBackground", "autoSelect", "subscribeCurrentValue", "onChange", "onFocus", "onBlur", "onUpdateCallback", "availableOptions", "loadingMessageFunc", "placeholder", "type", "selectType", "edit", "rows", "showMore", "showMoreText", "showLessText", "isExpanded", "loadingIcon", "successIcon", "padding"];
|
|
70
|
+
var Instructions = React__default["default"].forwardRef(function Instructions(_ref, forwardedRef) {
|
|
29
71
|
var clickToAdd = _ref.clickToAdd,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
72
|
+
customAddMessage = _ref.customAddMessage,
|
|
73
|
+
selectedOption = _ref.selectedOption,
|
|
74
|
+
loadOptions = _ref.loadOptions,
|
|
75
|
+
readOnly = _ref.readOnly,
|
|
76
|
+
disabled = _ref.disabled,
|
|
77
|
+
hidden = _ref.hidden,
|
|
78
|
+
name = _ref.name,
|
|
79
|
+
lightBackground = _ref.lightBackground,
|
|
80
|
+
autoSelect = _ref.autoSelect,
|
|
81
|
+
subscribeCurrentValueProp = _ref.subscribeCurrentValue,
|
|
82
|
+
onChangeProp = _ref.onChange,
|
|
83
|
+
onFocusProp = _ref.onFocus,
|
|
84
|
+
onBlurProp = _ref.onBlur,
|
|
85
|
+
onUpdateCallback = _ref.onUpdateCallback,
|
|
86
|
+
availableOptions = _ref.availableOptions,
|
|
87
|
+
loadingMessageFunc = _ref.loadingMessageFunc,
|
|
88
|
+
placeholder = _ref.placeholder,
|
|
89
|
+
type = _ref.type,
|
|
90
|
+
selectType = _ref.selectType,
|
|
91
|
+
edit = _ref.edit,
|
|
92
|
+
rows = _ref.rows,
|
|
93
|
+
showMore = _ref.showMore,
|
|
94
|
+
showMoreText = _ref.showMoreText,
|
|
95
|
+
showLessText = _ref.showLessText,
|
|
96
|
+
isExpanded = _ref.isExpanded,
|
|
97
|
+
loadingIcon = _ref.loadingIcon,
|
|
98
|
+
successIcon = _ref.successIcon,
|
|
99
|
+
padding = _ref.padding,
|
|
100
|
+
props = defaultTheme._objectWithoutProperties(_ref, _excluded);
|
|
60
101
|
var _useState = React.useState(false),
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
102
|
+
_useState2 = defaultTheme._slicedToArray(_useState, 2),
|
|
103
|
+
isHovered = _useState2[0],
|
|
104
|
+
setIsHovered = _useState2[1];
|
|
65
105
|
var _useState3 = React.useState({}),
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
106
|
+
_useState4 = defaultTheme._slicedToArray(_useState3, 2),
|
|
107
|
+
selected = _useState4[0],
|
|
108
|
+
setSelected = _useState4[1];
|
|
70
109
|
var _useState5 = React.useState(clickToAdd),
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
110
|
+
_useState6 = defaultTheme._slicedToArray(_useState5, 2),
|
|
111
|
+
addInstructions = _useState6[0],
|
|
112
|
+
setAddInstructions = _useState6[1];
|
|
75
113
|
var _useState7 = React.useState(customAddMessage),
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
114
|
+
_useState8 = defaultTheme._slicedToArray(_useState7, 2),
|
|
115
|
+
customMessage = _useState8[0],
|
|
116
|
+
setCustomMessage = _useState8[1];
|
|
80
117
|
var _useState9 = React.useState(lightBackground),
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
118
|
+
_useState10 = defaultTheme._slicedToArray(_useState9, 2),
|
|
119
|
+
background = _useState10[0],
|
|
120
|
+
setBackground = _useState10[1];
|
|
85
121
|
var _useState11 = React.useState(true),
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
122
|
+
_useState12 = defaultTheme._slicedToArray(_useState11, 2),
|
|
123
|
+
initialHover = _useState12[0],
|
|
124
|
+
setInitialHover = _useState12[1];
|
|
90
125
|
var _useState13 = React.useState(),
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
126
|
+
_useState14 = defaultTheme._slicedToArray(_useState13, 2),
|
|
127
|
+
currentValue = _useState14[0],
|
|
128
|
+
setCurrentValue = _useState14[1];
|
|
95
129
|
React.useEffect(function () {
|
|
96
130
|
if (lodash.isFunction(subscribeCurrentValueProp)) {
|
|
97
131
|
subscribeCurrentValueProp(currentValue);
|
|
@@ -113,7 +147,6 @@ var Instructions = React__default['default'].forwardRef(function Instructions(_r
|
|
|
113
147
|
}, [addInstructions, handleOnFocus]);
|
|
114
148
|
var onChange = React.useCallback(function (event) {
|
|
115
149
|
setCurrentValue(event.target.value);
|
|
116
|
-
|
|
117
150
|
if (lodash.isFunction(onChangeProp)) {
|
|
118
151
|
onChangeProp(event);
|
|
119
152
|
}
|
|
@@ -122,11 +155,9 @@ var Instructions = React__default['default'].forwardRef(function Instructions(_r
|
|
|
122
155
|
if (autoSelect) {
|
|
123
156
|
event.target.select();
|
|
124
157
|
}
|
|
125
|
-
|
|
126
158
|
if (lodash.isFunction(onFocusProp)) {
|
|
127
159
|
onFocusProp(event);
|
|
128
160
|
}
|
|
129
|
-
|
|
130
161
|
if (event.target.value === customMessage) {
|
|
131
162
|
setCurrentValue('');
|
|
132
163
|
}
|
|
@@ -136,21 +167,17 @@ var Instructions = React__default['default'].forwardRef(function Instructions(_r
|
|
|
136
167
|
onBlurProp(event);
|
|
137
168
|
}
|
|
138
169
|
}, [onBlurProp]);
|
|
139
|
-
|
|
140
170
|
var handleMouseOver = function handleMouseOver() {
|
|
141
171
|
setIsHovered(true);
|
|
142
172
|
};
|
|
143
|
-
|
|
144
173
|
var handleMouseLeave = function handleMouseLeave() {
|
|
145
174
|
setIsHovered(false);
|
|
146
175
|
};
|
|
147
|
-
|
|
148
176
|
var handleOnFocus = function handleOnFocus() {
|
|
149
177
|
if (customMessage === currentValue) {
|
|
150
178
|
setCurrentValue('');
|
|
151
179
|
}
|
|
152
180
|
};
|
|
153
|
-
|
|
154
181
|
var handleChange = function handleChange(selected) {
|
|
155
182
|
if (selected === null) {
|
|
156
183
|
setSelected({});
|
|
@@ -167,7 +194,6 @@ var Instructions = React__default['default'].forwardRef(function Instructions(_r
|
|
|
167
194
|
onUpdateCallback(selected);
|
|
168
195
|
}
|
|
169
196
|
};
|
|
170
|
-
|
|
171
197
|
var sharedSelectProps = {
|
|
172
198
|
options: loadOptions ? undefined : availableOptions,
|
|
173
199
|
loadOptions: loadOptions,
|
|
@@ -175,22 +201,22 @@ var Instructions = React__default['default'].forwardRef(function Instructions(_r
|
|
|
175
201
|
placeholder: placeholder
|
|
176
202
|
};
|
|
177
203
|
if (hidden) return null;
|
|
178
|
-
return React__default[
|
|
204
|
+
return React__default["default"].createElement(Instructions$1, defaultTheme._extends({
|
|
179
205
|
ref: forwardedRef,
|
|
180
206
|
initialHover: initialHover,
|
|
181
207
|
onMouseDown: handleMouseOver,
|
|
182
208
|
onMouseLeave: handleMouseLeave
|
|
183
|
-
}, props), !readOnly && !disabled && React__default[
|
|
209
|
+
}, props), !readOnly && !disabled && React__default["default"].createElement(TopBarContainer, {
|
|
184
210
|
initialHover: initialHover,
|
|
185
211
|
className: isHovered && !readOnly && !disabled && 'slide-in'
|
|
186
|
-
}, React__default[
|
|
212
|
+
}, React__default["default"].createElement(SelectContainer, null, React__default["default"].createElement(CompactAutocompleteSelect.CompactAutocompleteSelect, defaultTheme._extends({
|
|
187
213
|
type: selectType,
|
|
188
214
|
value: selectedOption,
|
|
189
215
|
creatable: false,
|
|
190
216
|
onChange: handleChange
|
|
191
|
-
}, sharedSelectProps)))), React__default[
|
|
217
|
+
}, sharedSelectProps)))), React__default["default"].createElement(InstructionsArea, {
|
|
192
218
|
type: type
|
|
193
|
-
}, React__default[
|
|
219
|
+
}, React__default["default"].createElement(TextArea.TextArea, {
|
|
194
220
|
noBorder: true,
|
|
195
221
|
instructionsTextArea: true,
|
|
196
222
|
type: type,
|
|
@@ -208,7 +234,7 @@ var Instructions = React__default['default'].forwardRef(function Instructions(_r
|
|
|
208
234
|
showMore: showMore,
|
|
209
235
|
showMoreText: showMoreText,
|
|
210
236
|
showLessText: showLessText,
|
|
211
|
-
icon: React__default[
|
|
237
|
+
icon: React__default["default"].createElement(SvgWarningCircle, null),
|
|
212
238
|
loadingIcon: loadingIcon,
|
|
213
239
|
successIcon: successIcon,
|
|
214
240
|
padding: padding
|
|
@@ -261,3 +287,4 @@ Instructions.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
261
287
|
} : {};
|
|
262
288
|
|
|
263
289
|
exports.Instructions = Instructions;
|
|
290
|
+
exports.SvgWarningCircle = SvgWarningCircle;
|