@ntbjs/react-components 2.0.0-rc.26 → 2.0.0-rc.27
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/build/{ActionButton-03dc5f67.js → ActionButton-4db754c3.js} +17 -24
- package/build/{Alert-8a511bdc.js → Alert-e6847a22.js} +29 -36
- package/build/{Badge-aa4cd9c1.js → Badge-d93586a9.js} +35 -42
- package/build/{Button-2e26f5da.js → Button-179a2fe4.js} +83 -90
- package/build/{Checkbox-0b8faf49.js → Checkbox-4a5fd716.js} +45 -52
- package/build/{CompactAutocompleteSelect-797778cb.js → CompactAutocompleteSelect-52c49513.js} +116 -125
- package/build/{CompactStarRating-da21b53f.js → CompactStarRating-9af2f427.js} +76 -101
- package/build/{CompactTextInput-d56aec71.js → CompactTextInput-42ca5d42.js} +104 -129
- package/build/InputGroup-1294d190.js +23 -0
- package/build/{MultiLevelCheckboxSelect-d229cf98.js → MultiLevelCheckboxSelect-d8044c88.js} +139 -167
- package/build/{MultiSelect-d7920eb1.js → MultiSelect-9f497e62.js} +81 -90
- package/build/{Popover-c4be47ea.js → Popover-20050b91.js} +35 -44
- package/build/{Radio-150fb2c9.js → Radio-73ca3ae2.js} +28 -35
- package/build/SectionSeparator-f47760a2.js +31 -0
- package/build/{Switch-d2d6e9ec.js → Switch-ecf3122b.js} +35 -42
- package/build/Tab-04d435c3.js +32 -0
- package/build/{Tabs-b06c0e24.js → Tabs-74d1ea8a.js} +37 -44
- package/build/{TextArea-26d3c8a1.js → TextArea-1e5b9201.js} +105 -113
- package/build/{TextInput-3a567daa.js → TextInput-fab35842.js} +78 -86
- package/build/Tooltip-c1d1199e.js +65 -0
- package/build/{VerificationStatusIcon-9876b68f.js → VerificationStatusIcon-49cb1c1b.js} +19 -44
- package/build/{_rollupPluginBabelHelpers-4b342fad.js → _rollupPluginBabelHelpers-c245b26a.js} +1 -3
- package/build/arrow-forward-ad12c5f3.js +15 -0
- package/build/close-a5d37608.js +15 -0
- package/build/data/Alert/index.js +6 -12
- package/build/data/Badge/index.js +5 -11
- package/build/data/Popover/index.js +10 -16
- package/build/data/Tab/index.js +5 -11
- package/build/data/Tabs/index.js +7 -13
- package/build/data/Tooltip/index.js +7 -13
- package/build/data/index.js +16 -30
- package/build/{defaultTheme-d9a7342e.js → defaultTheme-1bcc2541.js} +3 -7
- package/build/edit-note-283a0e15.js +15 -0
- package/build/expand-more-c5523c46.js +15 -0
- package/build/inputs/ActionButton/index.js +6 -12
- package/build/inputs/Button/index.js +13 -19
- package/build/inputs/Checkbox/index.js +6 -12
- package/build/inputs/CompactAutocompleteSelect/index.js +23 -29
- package/build/inputs/CompactStarRating/index.js +17 -23
- package/build/inputs/CompactTextInput/index.js +19 -25
- package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.js +26 -0
- package/build/inputs/MultiSelect/index.js +10 -16
- package/build/inputs/Radio/index.js +7 -13
- package/build/inputs/Switch/index.js +6 -12
- package/build/inputs/TextArea/index.js +20 -26
- package/build/inputs/TextInput/index.js +9 -15
- package/build/inputs/index.js +40 -60
- package/build/layout/InputGroup/index.js +5 -11
- package/build/layout/SectionSeparator/index.js +5 -11
- package/build/layout/index.js +6 -15
- package/build/{shift-away-subtle-158617af.js → shift-away-subtle-0dd94a03.js} +3 -5
- package/build/ssr/index.js +1 -12
- package/build/warning-circle-24f3efcd.js +15 -0
- package/build/{AssetAction-d081e4b7.js → widgets/AssetGallery/AssetGallery.js} +601 -622
- package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.js +127 -0
- package/build/widgets/ContextMenu/ContextMenu.js +26 -0
- package/build/{ContextMenuItem-3967010d.js → widgets/ContextMenu/ContextMenuItem/ContextMenuItem.js} +23 -48
- package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.js +37 -0
- package/build/{InfoCard-d0fdf377.js → widgets/InfoCard/InfoCard.js} +27 -34
- package/build/widgets/Instructions/Instructions.js +255 -0
- package/build/{ProgressBar-2d26c1fb.js → widgets/ProgressBar/ProgressBar.js} +39 -46
- package/package.json +1 -1
- package/build/AssetPreviewTopBar-623cfa18.js +0 -152
- package/build/ContextMenu-82f9d728.js +0 -33
- package/build/InputGroup-8d4a4644.js +0 -30
- package/build/Instructions-af191987.js +0 -274
- package/build/SectionSeparator-e06c7660.js +0 -38
- package/build/Tab-ccbca1f2.js +0 -39
- package/build/Tooltip-d5882b82.js +0 -73
- package/build/arrow-forward-d7c77ae3.js +0 -37
- package/build/close-1751121a.js +0 -37
- package/build/edit-note-cefe2215.js +0 -37
- package/build/expand-more-d74e2bd2.js +0 -37
- package/build/widgets/AssetGallery/index.js +0 -55
- package/build/widgets/AssetPreview/AssetPreviewTopBar/index.js +0 -12
- package/build/widgets/ContextMenu/ContextMenuItem/index.js +0 -11
- package/build/widgets/ContextMenu/ContextMenuItemsGroup/index.js +0 -44
- package/build/widgets/ContextMenu/index.js +0 -11
- package/build/widgets/InfoCard/index.js +0 -12
- package/build/widgets/Instructions/index.js +0 -33
- package/build/widgets/ProgressBar/index.js +0 -12
- package/build/widgets/index.js +0 -65
|
@@ -1,31 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
|
-
|
|
15
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
16
|
-
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
17
|
-
var Select__default = /*#__PURE__*/_interopDefaultLegacy(Select);
|
|
18
|
-
var CreatableSelect__default = /*#__PURE__*/_interopDefaultLegacy(CreatableSelect);
|
|
19
|
-
|
|
20
|
-
const AsyncCreatableSelectPaginate = reactSelectAsyncPaginate.withAsyncPaginate(CreatableSelect__default["default"]);
|
|
1
|
+
import { _ as _extends } from './_rollupPluginBabelHelpers-c245b26a.js';
|
|
2
|
+
import React__default, { useState, useEffect, useMemo } from 'react';
|
|
3
|
+
import { a as applyDefaultTheme, P as PropTypes } from './defaultTheme-1bcc2541.js';
|
|
4
|
+
import { nanoid } from 'nanoid';
|
|
5
|
+
import styled, { css } from 'styled-components';
|
|
6
|
+
import { S as SvgClose } from './close-a5d37608.js';
|
|
7
|
+
import Select, { components } from 'react-select';
|
|
8
|
+
import CreatableSelect from 'react-select/creatable';
|
|
9
|
+
import { withAsyncPaginate, AsyncPaginate } from 'react-select-async-paginate';
|
|
10
|
+
|
|
11
|
+
const AsyncCreatableSelectPaginate = withAsyncPaginate(CreatableSelect);
|
|
21
12
|
const showMoreHeight = 114;
|
|
22
|
-
const sharedStyle =
|
|
13
|
+
const sharedStyle = css`
|
|
23
14
|
font-family: ${props => props.theme.primaryFontFamily};
|
|
24
15
|
font-size: 12px;
|
|
25
16
|
font-weight: 400;
|
|
26
17
|
position: relative;
|
|
27
18
|
`;
|
|
28
|
-
const Label =
|
|
19
|
+
const Label = styled.label.attrs(applyDefaultTheme)`
|
|
29
20
|
${props => props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('gray-700'))};
|
|
30
21
|
flex-basis: 33.33%;
|
|
31
22
|
font-size: 0.875rem;
|
|
@@ -35,22 +26,22 @@ const Label = styled__default["default"].label.attrs(defaultTheme.applyDefaultTh
|
|
|
35
26
|
display: flex;
|
|
36
27
|
align-items: center;
|
|
37
28
|
`;
|
|
38
|
-
const MultiSelect$1 =
|
|
29
|
+
const MultiSelect$1 = styled(Select).attrs(applyDefaultTheme)`
|
|
39
30
|
${sharedStyle}
|
|
40
31
|
`;
|
|
41
|
-
const CreatableMultiSelect =
|
|
32
|
+
const CreatableMultiSelect = styled(CreatableSelect).attrs(applyDefaultTheme)`
|
|
42
33
|
${sharedStyle}
|
|
43
34
|
`;
|
|
44
|
-
const AsyncCreatableMultiSelect =
|
|
35
|
+
const AsyncCreatableMultiSelect = styled(AsyncCreatableSelectPaginate).attrs(applyDefaultTheme)`
|
|
45
36
|
${sharedStyle}
|
|
46
37
|
`;
|
|
47
|
-
const AsyncMultiSelect =
|
|
38
|
+
const AsyncMultiSelect = styled(AsyncPaginate).attrs(applyDefaultTheme)`
|
|
48
39
|
${sharedStyle}
|
|
49
40
|
`;
|
|
50
|
-
const MultiSelectWrapper =
|
|
41
|
+
const MultiSelectWrapper = styled.div.attrs(applyDefaultTheme)`
|
|
51
42
|
position: relative;
|
|
52
43
|
`;
|
|
53
|
-
const Control =
|
|
44
|
+
const Control = styled(components.Control).attrs(applyDefaultTheme)`
|
|
54
45
|
&& {
|
|
55
46
|
align-items: flex-start;
|
|
56
47
|
background: transparent;
|
|
@@ -62,7 +53,7 @@ const Control = styled__default["default"](Select.components.Control).attrs(defa
|
|
|
62
53
|
cursor: ${props => !props.isDisabled && props.focused || props.readOnly ? 'default' : 'pointer'};
|
|
63
54
|
}
|
|
64
55
|
`;
|
|
65
|
-
const ValueContainer =
|
|
56
|
+
const ValueContainer = styled(components.ValueContainer)`
|
|
66
57
|
&& {
|
|
67
58
|
align-items: flex-start;
|
|
68
59
|
gap: 8px;
|
|
@@ -72,7 +63,7 @@ const ValueContainer = styled__default["default"](Select.components.ValueContain
|
|
|
72
63
|
return props.showMore ? props.error || props.warning ? '100%' : showMoreHeight + 16 + 'px' : '100%';
|
|
73
64
|
}} !important;
|
|
74
65
|
|
|
75
|
-
${props => (props.error || props.warning) &&
|
|
66
|
+
${props => (props.error || props.warning) && css`
|
|
76
67
|
border: 1px solid;
|
|
77
68
|
border-radius: 3px;
|
|
78
69
|
padding: 4px;
|
|
@@ -81,13 +72,13 @@ const ValueContainer = styled__default["default"](Select.components.ValueContain
|
|
|
81
72
|
`}
|
|
82
73
|
}
|
|
83
74
|
`;
|
|
84
|
-
const MultiValueWrapper =
|
|
75
|
+
const MultiValueWrapper = styled.div.attrs(applyDefaultTheme)`
|
|
85
76
|
&& {
|
|
86
77
|
border-radius: 3px;
|
|
87
78
|
margin: 0;
|
|
88
79
|
}
|
|
89
80
|
`;
|
|
90
|
-
const MultiValue =
|
|
81
|
+
const MultiValue = styled(components.MultiValue).attrs(applyDefaultTheme)`
|
|
91
82
|
&& {
|
|
92
83
|
border-radius: 3px;
|
|
93
84
|
margin: 0;
|
|
@@ -130,15 +121,15 @@ const MultiValue = styled__default["default"](Select.components.MultiValue).attr
|
|
|
130
121
|
}
|
|
131
122
|
}
|
|
132
123
|
`;
|
|
133
|
-
const MultiValueRemove$1 =
|
|
134
|
-
const Input =
|
|
124
|
+
const MultiValueRemove$1 = styled(components.MultiValueRemove).attrs(applyDefaultTheme)``;
|
|
125
|
+
const Input = styled(components.Input).attrs(applyDefaultTheme)`
|
|
135
126
|
align-self: center;
|
|
136
127
|
font-size: ${props => props.$focused ? '14px' : '12px'};
|
|
137
128
|
min-width: 150px;
|
|
138
129
|
|
|
139
130
|
${props => props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-900'))}
|
|
140
131
|
|
|
141
|
-
${props => !props.$focused &&
|
|
132
|
+
${props => !props.$focused && css`
|
|
142
133
|
${props => props.theme.themeProp('color', props.theme.getColor('gray-400'), props.theme.getColor('gray-500'))}
|
|
143
134
|
|
|
144
135
|
:before {
|
|
@@ -150,25 +141,25 @@ const Input = styled__default["default"](Select.components.Input).attrs(defaultT
|
|
|
150
141
|
`}
|
|
151
142
|
}
|
|
152
143
|
`;
|
|
153
|
-
const DropdownMenu =
|
|
144
|
+
const DropdownMenu = styled(components.Menu).attrs(applyDefaultTheme)`
|
|
154
145
|
font-size: 14px;
|
|
155
146
|
|
|
156
147
|
${props => props.theme.themeProp('background-color', props.theme.getColor('gray-600'), props.theme.getColor('white'))}
|
|
157
148
|
|
|
158
149
|
${props => props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-900'))}
|
|
159
150
|
`;
|
|
160
|
-
const sharedOptionStyle =
|
|
161
|
-
${props => props.isFocused &&
|
|
151
|
+
const sharedOptionStyle = css`
|
|
152
|
+
${props => props.isFocused && css`
|
|
162
153
|
${props.theme.themeProp('background-color', props.theme.getColor('gray-500'), props.theme.getColor('gray-200'))}
|
|
163
154
|
`}
|
|
164
155
|
|
|
165
|
-
${props => props.isSelected &&
|
|
156
|
+
${props => props.isSelected && css`
|
|
166
157
|
${props.theme.themeProp('background-color', 'transparent', 'transparent')}
|
|
167
158
|
|
|
168
159
|
${props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-900'))}
|
|
169
160
|
`}
|
|
170
161
|
|
|
171
|
-
${props => props.isFocused && props.isSelected &&
|
|
162
|
+
${props => props.isFocused && props.isSelected && css`
|
|
172
163
|
${props.theme.themeProp('background-color', props.theme.getColor('gray-500'), props.theme.getColor('gray-200'))}
|
|
173
164
|
`}
|
|
174
165
|
|
|
@@ -176,22 +167,22 @@ const sharedOptionStyle = styled.css`
|
|
|
176
167
|
cursor: pointer;
|
|
177
168
|
}
|
|
178
169
|
`;
|
|
179
|
-
const Option$1 =
|
|
170
|
+
const Option$1 = styled(components.Option).attrs(applyDefaultTheme)`
|
|
180
171
|
${sharedOptionStyle}
|
|
181
172
|
`;
|
|
182
|
-
const SelectedOption$1 =
|
|
173
|
+
const SelectedOption$1 = styled(components.Option).attrs(applyDefaultTheme)`
|
|
183
174
|
${sharedOptionStyle}
|
|
184
175
|
|
|
185
176
|
display: flex !important;
|
|
186
177
|
justify-content: space-between;
|
|
187
178
|
`;
|
|
188
|
-
const DropdownOptionDeleteIcon =
|
|
179
|
+
const DropdownOptionDeleteIcon = styled(SvgClose).attrs(applyDefaultTheme)`
|
|
189
180
|
stroke-width: 1px;
|
|
190
181
|
width: 8px;
|
|
191
182
|
|
|
192
183
|
${props => props.theme.themeProp('stroke', props.theme.getColor('gray-100'), props.theme.getColor('gray-900'))}
|
|
193
184
|
`;
|
|
194
|
-
const ShowMoreWrapper =
|
|
185
|
+
const ShowMoreWrapper = styled.div.attrs(applyDefaultTheme)`
|
|
195
186
|
align-items: end;
|
|
196
187
|
display: flex;
|
|
197
188
|
flex-direction: column;
|
|
@@ -209,7 +200,7 @@ const ShowMoreWrapper = styled__default["default"].div.attrs(defaultTheme.applyD
|
|
|
209
200
|
text-decoration: underline;
|
|
210
201
|
}
|
|
211
202
|
`;
|
|
212
|
-
const ShowMoreOverlay =
|
|
203
|
+
const ShowMoreOverlay = styled.div.attrs(applyDefaultTheme)`
|
|
213
204
|
align-items: end;
|
|
214
205
|
display: block;
|
|
215
206
|
height: 100%;
|
|
@@ -220,19 +211,19 @@ const ShowMoreOverlay = styled__default["default"].div.attrs(defaultTheme.applyD
|
|
|
220
211
|
|
|
221
212
|
${props => props.theme.themeProp('background', 'transparent linear-gradient(180deg, #12121200 0%, #12121230 40%, #12121279 70%, #121212 95%, #121212 100%) 0% 0% no-repeat padding-box', 'transparent linear-gradient(180deg, #fefefe00 0%, #fefefe30 40%, #fefefe79 70%, #fefefe 95%, #fefefe 100%) 0% 0% no-repeat padding-box')}
|
|
222
213
|
`;
|
|
223
|
-
const ShowMoreText =
|
|
214
|
+
const ShowMoreText = styled.div.attrs(applyDefaultTheme)`
|
|
224
215
|
font-size: 0.875rem;
|
|
225
216
|
width: 100%;
|
|
226
217
|
${props => props.theme.themeProp('background-color', '#121212', '#fefefe')}
|
|
227
218
|
`;
|
|
228
|
-
const ErrorMessage =
|
|
219
|
+
const ErrorMessage = styled.div.attrs(applyDefaultTheme)`
|
|
229
220
|
color: ${props => props.error ? props.theme.getColor('red-500') : props.warning ? props.theme.getColor('orange-500') : 'inherit'};
|
|
230
221
|
font-size: 0.75rem;
|
|
231
222
|
margin-top: 8px;
|
|
232
223
|
padding: 0 12px;
|
|
233
224
|
`;
|
|
234
225
|
|
|
235
|
-
const MultiSelect = React__default
|
|
226
|
+
const MultiSelect = React__default.forwardRef(function MultiSelect({
|
|
236
227
|
label,
|
|
237
228
|
selectedOptions,
|
|
238
229
|
availableOptions,
|
|
@@ -254,20 +245,20 @@ const MultiSelect = React__default["default"].forwardRef(function MultiSelect({
|
|
|
254
245
|
warning,
|
|
255
246
|
...props
|
|
256
247
|
}, forwardedRef) {
|
|
257
|
-
const [uniqueId] =
|
|
258
|
-
const [selected, setSelected] =
|
|
259
|
-
const [focused, setFocused] =
|
|
260
|
-
const [displayShowMore, setDisplayShowMore] =
|
|
261
|
-
const [cacheUnique, setCacheUnique] =
|
|
262
|
-
|
|
248
|
+
const [uniqueId] = useState(nanoid());
|
|
249
|
+
const [selected, setSelected] = useState(selectedOptions);
|
|
250
|
+
const [focused, setFocused] = useState(false);
|
|
251
|
+
const [displayShowMore, setDisplayShowMore] = useState(error || warning ? false : showMore);
|
|
252
|
+
const [cacheUnique, setCacheUnique] = useState(0);
|
|
253
|
+
useEffect(() => {
|
|
263
254
|
setSelected(selectedOptions);
|
|
264
255
|
}, [selectedOptions]);
|
|
265
256
|
const handleShowMoreClick = () => {
|
|
266
257
|
setDisplayShowMore(false);
|
|
267
258
|
};
|
|
268
|
-
const Control$1 =
|
|
259
|
+
const Control$1 = useMemo(() => {
|
|
269
260
|
const ControlWrapper = innerProps => {
|
|
270
|
-
return React__default
|
|
261
|
+
return React__default.createElement(Control, _extends({
|
|
271
262
|
className: "multi-select-control",
|
|
272
263
|
readOnly: readOnly
|
|
273
264
|
}, innerProps));
|
|
@@ -275,11 +266,11 @@ const MultiSelect = React__default["default"].forwardRef(function MultiSelect({
|
|
|
275
266
|
ControlWrapper.displayName = 'ControlWrapper';
|
|
276
267
|
return ControlWrapper;
|
|
277
268
|
}, []);
|
|
278
|
-
const ValueContainer$1 =
|
|
269
|
+
const ValueContainer$1 = useMemo(() => {
|
|
279
270
|
const ValueContainerWrapper = innerProps => {
|
|
280
|
-
return React__default
|
|
271
|
+
return React__default.createElement(React__default.Fragment, null, label && React__default.createElement(Label, {
|
|
281
272
|
htmlFor: uniqueId
|
|
282
|
-
}, label), React__default
|
|
273
|
+
}, label), React__default.createElement(ValueContainer, _extends({
|
|
283
274
|
showMore: displayShowMore,
|
|
284
275
|
error: error,
|
|
285
276
|
warning: warning,
|
|
@@ -290,7 +281,7 @@ const MultiSelect = React__default["default"].forwardRef(function MultiSelect({
|
|
|
290
281
|
return ValueContainerWrapper;
|
|
291
282
|
}, [displayShowMore, error, warning]);
|
|
292
283
|
const MultiValue$1 = innerProps => {
|
|
293
|
-
return React__default
|
|
284
|
+
return React__default.createElement(MultiValueWrapper, {
|
|
294
285
|
className: "multi-value-wrapper",
|
|
295
286
|
onMouseDown: e => {
|
|
296
287
|
e.stopPropagation();
|
|
@@ -298,14 +289,14 @@ const MultiSelect = React__default["default"].forwardRef(function MultiSelect({
|
|
|
298
289
|
onMultiValueClick(innerProps.data);
|
|
299
290
|
}
|
|
300
291
|
}
|
|
301
|
-
}, React__default
|
|
292
|
+
}, React__default.createElement(MultiValue, _extends({
|
|
302
293
|
className: "multi-value",
|
|
303
294
|
readOnly: readOnly
|
|
304
295
|
}, innerProps)));
|
|
305
296
|
};
|
|
306
|
-
const Input$1 =
|
|
297
|
+
const Input$1 = useMemo(() => {
|
|
307
298
|
const InputWrapper = innerProps => {
|
|
308
|
-
return React__default
|
|
299
|
+
return React__default.createElement(Input, _extends({
|
|
309
300
|
className: "multi-select-input",
|
|
310
301
|
$focused: focused,
|
|
311
302
|
edittext: editText
|
|
@@ -401,36 +392,36 @@ const MultiSelect = React__default["default"].forwardRef(function MultiSelect({
|
|
|
401
392
|
}
|
|
402
393
|
};
|
|
403
394
|
if (hidden) return null;
|
|
404
|
-
return React__default
|
|
395
|
+
return React__default.createElement(MultiSelectWrapper, {
|
|
405
396
|
error: error,
|
|
406
397
|
warning: warning
|
|
407
|
-
}, loadOptions ? creatable ? React__default
|
|
398
|
+
}, loadOptions ? creatable ? React__default.createElement(AsyncCreatableMultiSelect, _extends({}, sharedSelectProps, props)) : React__default.createElement(AsyncMultiSelect, _extends({}, sharedSelectProps, props)) : creatable ? React__default.createElement(CreatableMultiSelect, _extends({}, sharedSelectProps, props)) : React__default.createElement(MultiSelect$1, _extends({}, sharedSelectProps, props)), displayShowMore && !(error || warning) && React__default.createElement(ShowMoreWrapper, {
|
|
408
399
|
onClick: handleShowMoreClick
|
|
409
|
-
}, React__default
|
|
400
|
+
}, React__default.createElement(ShowMoreOverlay, null), React__default.createElement(ShowMoreText, null, showMoreText, " ", displayTotalOnShowMore && '(' + selected.length + ')')), (typeof error === 'string' || typeof warning === 'string') && React__default.createElement(ErrorMessage, {
|
|
410
401
|
error: error,
|
|
411
402
|
warning: warning
|
|
412
403
|
}, error ? error : warning));
|
|
413
404
|
});
|
|
414
405
|
MultiSelect.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
415
|
-
label:
|
|
416
|
-
availableOptions:
|
|
417
|
-
selectedOptions:
|
|
418
|
-
loadOptions:
|
|
419
|
-
loadingMessageFunc:
|
|
420
|
-
onUpdateCallback:
|
|
421
|
-
editText:
|
|
422
|
-
creatable:
|
|
423
|
-
createNewOptionMessageFunc:
|
|
424
|
-
noOptionsMessageFunc:
|
|
425
|
-
onMultiValueClick:
|
|
426
|
-
showMore:
|
|
427
|
-
showMoreText:
|
|
428
|
-
displayTotalOnShowMore:
|
|
429
|
-
readOnly:
|
|
430
|
-
hidden:
|
|
431
|
-
disabled:
|
|
432
|
-
error:
|
|
433
|
-
warning:
|
|
406
|
+
label: PropTypes.string,
|
|
407
|
+
availableOptions: PropTypes.arrayOf(PropTypes.object),
|
|
408
|
+
selectedOptions: PropTypes.arrayOf(PropTypes.object),
|
|
409
|
+
loadOptions: PropTypes.func,
|
|
410
|
+
loadingMessageFunc: PropTypes.func,
|
|
411
|
+
onUpdateCallback: PropTypes.func,
|
|
412
|
+
editText: PropTypes.string.isRequired,
|
|
413
|
+
creatable: PropTypes.bool,
|
|
414
|
+
createNewOptionMessageFunc: PropTypes.func,
|
|
415
|
+
noOptionsMessageFunc: PropTypes.func,
|
|
416
|
+
onMultiValueClick: PropTypes.func,
|
|
417
|
+
showMore: PropTypes.bool,
|
|
418
|
+
showMoreText: PropTypes.string,
|
|
419
|
+
displayTotalOnShowMore: PropTypes.bool,
|
|
420
|
+
readOnly: PropTypes.bool,
|
|
421
|
+
hidden: PropTypes.bool,
|
|
422
|
+
disabled: PropTypes.bool,
|
|
423
|
+
error: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
424
|
+
warning: PropTypes.oneOfType([PropTypes.bool, PropTypes.string])
|
|
434
425
|
} : {};
|
|
435
426
|
MultiSelect.defaultProps = {
|
|
436
427
|
noOptionsMessageFunc: inputValue => {
|
|
@@ -451,20 +442,20 @@ MultiSelect.defaultProps = {
|
|
|
451
442
|
hidden: false
|
|
452
443
|
};
|
|
453
444
|
const MultiValueRemove = innerProps => {
|
|
454
|
-
return React__default
|
|
445
|
+
return React__default.createElement(MultiValueRemove$1, innerProps, React__default.createElement(SvgClose, {
|
|
455
446
|
className: "multi-value-remove-icon"
|
|
456
447
|
}));
|
|
457
448
|
};
|
|
458
449
|
const Menu = innerProps => {
|
|
459
|
-
return React__default
|
|
450
|
+
return React__default.createElement(DropdownMenu, innerProps);
|
|
460
451
|
};
|
|
461
452
|
const Option = innerProps => {
|
|
462
|
-
return React__default
|
|
453
|
+
return React__default.createElement(Option$1, _extends({
|
|
463
454
|
className: "multi-select-dropdown-item"
|
|
464
455
|
}, innerProps));
|
|
465
456
|
};
|
|
466
457
|
const SelectedOption = innerProps => {
|
|
467
|
-
return React__default
|
|
458
|
+
return React__default.createElement(SelectedOption$1, innerProps, innerProps.label, React__default.createElement(DropdownOptionDeleteIcon, null));
|
|
468
459
|
};
|
|
469
460
|
|
|
470
|
-
|
|
461
|
+
export { MultiSelect as M };
|
|
@@ -1,23 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
|
-
|
|
15
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
16
|
-
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
17
|
-
var TippyTooltip__default = /*#__PURE__*/_interopDefaultLegacy(TippyTooltip);
|
|
18
|
-
var maxSize__default = /*#__PURE__*/_interopDefaultLegacy(maxSize);
|
|
19
|
-
|
|
20
|
-
const Popover$1 = styled__default["default"](TippyTooltip__default["default"]).attrs(defaultTheme.applyDefaultTheme)`
|
|
1
|
+
import { _ as _extends } from './_rollupPluginBabelHelpers-c245b26a.js';
|
|
2
|
+
import { isBoolean } from 'lodash';
|
|
3
|
+
import { a as applyDefaultTheme, P as PropTypes } from './defaultTheme-1bcc2541.js';
|
|
4
|
+
import React__default, { useMemo } from 'react';
|
|
5
|
+
import styled, { css } from 'styled-components';
|
|
6
|
+
import { rgba } from 'polished';
|
|
7
|
+
import TippyTooltip from '@tippyjs/react';
|
|
8
|
+
import './shift-away-subtle-0dd94a03.js';
|
|
9
|
+
import maxSize from 'popper-max-size-modifier';
|
|
10
|
+
|
|
11
|
+
const Popover$1 = styled(TippyTooltip).attrs(applyDefaultTheme)`
|
|
21
12
|
font-family: ${props => props.theme.primaryFontFamily};
|
|
22
13
|
font-size: 1rem;
|
|
23
14
|
font-weight: 400;
|
|
@@ -26,25 +17,25 @@ const Popover$1 = styled__default["default"](TippyTooltip__default["default"]).a
|
|
|
26
17
|
line-height: inherit;
|
|
27
18
|
max-height: inherit;
|
|
28
19
|
|
|
29
|
-
${props => props.maxWidth &&
|
|
20
|
+
${props => props.maxWidth && css`
|
|
30
21
|
max-width: ${props.maxWidth};
|
|
31
22
|
`}
|
|
32
23
|
|
|
33
24
|
${props => props.theme.themeProp('background', props.theme.getColor('gray-700'), props.theme.getColor('white'))}
|
|
34
25
|
|
|
35
|
-
${props => props.theme.themeProp('box-shadow', `0px 1px 6px -3px ${
|
|
26
|
+
${props => props.theme.themeProp('box-shadow', `0px 1px 6px -3px ${rgba(props.theme.getColor('black'), 0.7)}`, `0 1px 6px -4px ${props.theme.getColor('black')}`)}
|
|
36
27
|
|
|
37
28
|
${props => props.theme.themeProp('border', `1px solid ${props.theme.getColor('gray-800')}`, `1px solid ${props.theme.getColor('gray-300')}`)}
|
|
38
29
|
|
|
39
|
-
${props => props.contextMenu &&
|
|
30
|
+
${props => props.contextMenu && css`
|
|
40
31
|
border-radius: 4px;
|
|
41
32
|
|
|
42
33
|
${props => props.theme.themeProp('border', 'none', 'none')}
|
|
43
34
|
|
|
44
|
-
${props => props.theme.themeProp('box-shadow', `none`, `0 1px 6px ${
|
|
35
|
+
${props => props.theme.themeProp('box-shadow', `none`, `0 1px 6px ${rgba(props.theme.getColor('gray-900'), 0.3)}`)}
|
|
45
36
|
`}
|
|
46
37
|
|
|
47
|
-
${props => props.contextMenuSublevel &&
|
|
38
|
+
${props => props.contextMenuSublevel && css`
|
|
48
39
|
&[data-placement^='right-start'],
|
|
49
40
|
&[data-placement^='left-start'] {
|
|
50
41
|
margin-top: -4px;
|
|
@@ -154,7 +145,7 @@ const Popover$1 = styled__default["default"](TippyTooltip__default["default"]).a
|
|
|
154
145
|
}
|
|
155
146
|
`;
|
|
156
147
|
|
|
157
|
-
const Popover = React__default
|
|
148
|
+
const Popover = React__default.forwardRef(function Popover({
|
|
158
149
|
content = 'Tooltip',
|
|
159
150
|
interactive = true,
|
|
160
151
|
placement = 'bottom-end',
|
|
@@ -170,8 +161,8 @@ const Popover = React__default["default"].forwardRef(function Popover({
|
|
|
170
161
|
maxWidth = 'none',
|
|
171
162
|
...props
|
|
172
163
|
}, ref) {
|
|
173
|
-
const errorOffset =
|
|
174
|
-
const isControlled =
|
|
164
|
+
const errorOffset = useMemo(() => arrow ? 15 : 0, [arrow]);
|
|
165
|
+
const isControlled = useMemo(() => isBoolean(visible), [visible]);
|
|
175
166
|
const handleContextMenuItemClick = () => {
|
|
176
167
|
document.querySelectorAll('.context-menu-item:not(.opens-sublevel)').forEach(item => item.addEventListener('click', () => {
|
|
177
168
|
document.querySelectorAll('[data-tippy-root]').forEach(node => {
|
|
@@ -181,7 +172,7 @@ const Popover = React__default["default"].forwardRef(function Popover({
|
|
|
181
172
|
});
|
|
182
173
|
}));
|
|
183
174
|
};
|
|
184
|
-
return React__default
|
|
175
|
+
return React__default.createElement("div", null, React__default.createElement(Popover$1, _extends({
|
|
185
176
|
ref: ref,
|
|
186
177
|
content: content,
|
|
187
178
|
interactive: interactive,
|
|
@@ -194,7 +185,7 @@ const Popover = React__default["default"].forwardRef(function Popover({
|
|
|
194
185
|
visible: visible,
|
|
195
186
|
popperOptions: {
|
|
196
187
|
modifiers: [{
|
|
197
|
-
...
|
|
188
|
+
...maxSize,
|
|
198
189
|
options: {
|
|
199
190
|
boundary: 'viewport',
|
|
200
191
|
rootBoundary: 'viewport',
|
|
@@ -223,19 +214,19 @@ const Popover = React__default["default"].forwardRef(function Popover({
|
|
|
223
214
|
}, props), children));
|
|
224
215
|
});
|
|
225
216
|
Popover.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
226
|
-
content:
|
|
227
|
-
interactive:
|
|
228
|
-
placement:
|
|
229
|
-
duration:
|
|
230
|
-
trigger:
|
|
231
|
-
offset:
|
|
232
|
-
arrow:
|
|
233
|
-
visible:
|
|
234
|
-
modifiers:
|
|
235
|
-
maxWidth:
|
|
236
|
-
contextMenu:
|
|
237
|
-
contextMenuSublevel:
|
|
238
|
-
children:
|
|
217
|
+
content: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired,
|
|
218
|
+
interactive: PropTypes.bool,
|
|
219
|
+
placement: PropTypes.oneOf(['top', 'top-start', 'top-end', 'right', 'right-start', 'right-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'auto', 'auto-start', 'auto-end']),
|
|
220
|
+
duration: PropTypes.number,
|
|
221
|
+
trigger: PropTypes.string,
|
|
222
|
+
offset: PropTypes.arrayOf(PropTypes.number),
|
|
223
|
+
arrow: PropTypes.bool,
|
|
224
|
+
visible: PropTypes.bool,
|
|
225
|
+
modifiers: PropTypes.array,
|
|
226
|
+
maxWidth: PropTypes.string,
|
|
227
|
+
contextMenu: PropTypes.bool,
|
|
228
|
+
contextMenuSublevel: PropTypes.bool,
|
|
229
|
+
children: PropTypes.node.isRequired
|
|
239
230
|
} : {};
|
|
240
231
|
|
|
241
|
-
|
|
232
|
+
export { Popover as P };
|
|
@@ -1,26 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var polished = require('polished');
|
|
8
|
-
var styled = require('styled-components');
|
|
9
|
-
|
|
10
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
-
|
|
12
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
13
|
-
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
1
|
+
import { _ as _extends } from './_rollupPluginBabelHelpers-c245b26a.js';
|
|
2
|
+
import React__default, { useState } from 'react';
|
|
3
|
+
import { nanoid } from 'nanoid';
|
|
4
|
+
import { a as applyDefaultTheme, P as PropTypes } from './defaultTheme-1bcc2541.js';
|
|
5
|
+
import { math } from 'polished';
|
|
6
|
+
import styled, { css } from 'styled-components';
|
|
14
7
|
|
|
15
8
|
const radioSize = '18px';
|
|
16
|
-
const RadioLabel =
|
|
17
|
-
padding-left: ${
|
|
9
|
+
const RadioLabel = styled.div.attrs(applyDefaultTheme)`
|
|
10
|
+
padding-left: ${math(`${radioSize} + 10px`)};
|
|
18
11
|
font-weight: 400;
|
|
19
12
|
font-size: 0.875rem;
|
|
20
13
|
|
|
21
14
|
${props => props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('gray-600'))};
|
|
22
15
|
`;
|
|
23
|
-
const Radio$1 =
|
|
16
|
+
const Radio$1 = styled.label.attrs(applyDefaultTheme)`
|
|
24
17
|
display: block;
|
|
25
18
|
position: relative;
|
|
26
19
|
cursor: pointer;
|
|
@@ -73,20 +66,20 @@ const Radio$1 = styled__default["default"].label.attrs(defaultTheme.applyDefault
|
|
|
73
66
|
}
|
|
74
67
|
}
|
|
75
68
|
|
|
76
|
-
${props => props.readOnly &&
|
|
69
|
+
${props => props.readOnly && css`
|
|
77
70
|
opacity: 0.5;
|
|
78
71
|
pointer-events: none;
|
|
79
72
|
user-select: text;
|
|
80
73
|
`}
|
|
81
74
|
|
|
82
|
-
${props => props.disabled &&
|
|
75
|
+
${props => props.disabled && css`
|
|
83
76
|
opacity: 0.5;
|
|
84
77
|
cursor: not-allowed;
|
|
85
78
|
user-select: text;
|
|
86
79
|
`}
|
|
87
80
|
`;
|
|
88
81
|
|
|
89
|
-
const Radio = React__default
|
|
82
|
+
const Radio = React__default.forwardRef(function Radio({
|
|
90
83
|
name,
|
|
91
84
|
value,
|
|
92
85
|
checked,
|
|
@@ -100,14 +93,14 @@ const Radio = React__default["default"].forwardRef(function Radio({
|
|
|
100
93
|
onBlur,
|
|
101
94
|
...rest
|
|
102
95
|
}, forwardedRef) {
|
|
103
|
-
const [uniqueId] =
|
|
104
|
-
return React__default
|
|
96
|
+
const [uniqueId] = useState(nanoid());
|
|
97
|
+
return React__default.createElement(Radio$1, {
|
|
105
98
|
htmlFor: uniqueId,
|
|
106
99
|
disabled: disabled,
|
|
107
100
|
readOnly: readOnly,
|
|
108
101
|
className: className,
|
|
109
102
|
style: style
|
|
110
|
-
}, React__default
|
|
103
|
+
}, React__default.createElement("input", _extends({
|
|
111
104
|
ref: forwardedRef,
|
|
112
105
|
type: "radio",
|
|
113
106
|
name: name,
|
|
@@ -119,23 +112,23 @@ const Radio = React__default["default"].forwardRef(function Radio({
|
|
|
119
112
|
id: uniqueId,
|
|
120
113
|
onChange: onChange,
|
|
121
114
|
onBlur: onBlur
|
|
122
|
-
}, rest)), React__default
|
|
115
|
+
}, rest)), React__default.createElement(RadioLabel, null, label));
|
|
123
116
|
});
|
|
124
117
|
Radio.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
125
|
-
label:
|
|
126
|
-
name:
|
|
127
|
-
value:
|
|
128
|
-
checked:
|
|
129
|
-
defaultChecked:
|
|
130
|
-
disabled:
|
|
131
|
-
readOnly:
|
|
132
|
-
className:
|
|
133
|
-
style:
|
|
134
|
-
onChange:
|
|
135
|
-
onBlur:
|
|
118
|
+
label: PropTypes.any,
|
|
119
|
+
name: PropTypes.string.isRequired,
|
|
120
|
+
value: PropTypes.any.isRequired,
|
|
121
|
+
checked: PropTypes.bool,
|
|
122
|
+
defaultChecked: PropTypes.bool,
|
|
123
|
+
disabled: PropTypes.bool,
|
|
124
|
+
readOnly: PropTypes.bool,
|
|
125
|
+
className: PropTypes.string,
|
|
126
|
+
style: PropTypes.object,
|
|
127
|
+
onChange: PropTypes.func,
|
|
128
|
+
onBlur: PropTypes.func
|
|
136
129
|
} : {};
|
|
137
130
|
Radio.defaultProps = {
|
|
138
131
|
disabled: false
|
|
139
132
|
};
|
|
140
133
|
|
|
141
|
-
|
|
134
|
+
export { Radio as R };
|