@xqmsg/ui-core 0.14.4 → 0.15.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/dist/components/input/StackedCheckbox/StackedCheckbox.d.ts +10 -0
- package/dist/components/input/StackedMultiSelect/index.d.ts +0 -1
- package/dist/components/input/StackedPilledInput/index.d.ts +0 -1
- package/dist/components/input/components/dropdown/index.d.ts +3 -1
- package/dist/theme/components/button.d.ts +10 -8
- package/dist/theme/components/input.d.ts +2 -0
- package/dist/theme/components/select.d.ts +2 -0
- package/dist/theme/components/table.d.ts +1 -0
- package/dist/theme/components/textarea.d.ts +3 -1
- package/dist/ui-core.cjs.development.js +336 -186
- package/dist/ui-core.cjs.development.js.map +1 -1
- package/dist/ui-core.cjs.production.min.js +1 -1
- package/dist/ui-core.cjs.production.min.js.map +1 -1
- package/dist/ui-core.esm.js +337 -187
- package/dist/ui-core.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/banner/index.tsx +7 -15
- package/src/components/button/Button.stories.tsx +15 -5
- package/src/components/button/index.tsx +2 -2
- package/src/components/input/Input.stories.tsx +95 -47
- package/src/components/input/StackedCheckbox/StackedCheckbox.tsx +27 -0
- package/src/components/input/StackedMultiSelect/index.tsx +187 -144
- package/src/components/input/StackedPilledInput/index.tsx +217 -225
- package/src/components/input/StackedSelect/StackedSelect.tsx +34 -2
- package/src/components/input/StackedSwitch/index.tsx +9 -1
- package/src/components/input/StackedTextarea/StackedTextarea.tsx +1 -1
- package/src/components/input/components/dropdown/index.tsx +23 -6
- package/src/components/input/components/token/index.tsx +11 -6
- package/src/components/input/index.tsx +5 -4
- package/src/components/table/index.tsx +2 -7
- package/src/theme/components/button.ts +10 -10
- package/src/theme/components/input.ts +1 -0
- package/src/theme/components/table.ts +1 -0
- package/src/theme/components/textarea.ts +4 -1
- package/dist/components/input/StackedCheckbox/StackedCheckboxGroup.d.ts +0 -10
- package/dist/components/input/StackedMultiSelect/components/MultiValue/index.d.ts +0 -10
- package/src/components/input/StackedCheckbox/StackedCheckboxGroup.tsx +0 -29
- package/src/components/input/StackedMultiSelect/components/MultiValue/index.tsx +0 -21
package/dist/ui-core.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React__default, { useMemo, useCallback, useRef, useEffect, useState, memo, forwardRef, createElement } from 'react';
|
|
2
|
-
import { Image, Alert as Alert$1, AlertDescription, Box, Flex,
|
|
2
|
+
import { Button as Button$2, Image, Alert as Alert$1, AlertDescription, Box, Flex, Text as Text$2, Icon as Icon$1, Spinner, Checkbox, Input as Input$2, InputGroup, RadioGroup, Radio, useOutsideClick, InputRightElement, Textarea as Textarea$1, Switch as Switch$1, FormLabel as FormLabel$1, FormControl, FormErrorMessage, FormHelperText, SimpleGrid, useMediaQuery, Grid, GridItem, IconButton, Collapse, TableContainer, Table as Table$2, Thead, Tr, Th, Tbody, Td, TableCaption, Tabs as Tabs$1, TabList, Tab, extendTheme } from '@chakra-ui/react';
|
|
3
3
|
import { FormProvider, useWatch, Controller } from 'react-hook-form';
|
|
4
4
|
import { truncate } from 'lodash-es';
|
|
5
5
|
import { CloseIcon, HamburgerIcon } from '@chakra-ui/icons';
|
|
@@ -16,6 +16,91 @@ var NeutralIcon = "data:image/svg+xml,%3Csvg%20width%3D%2214%22%20height%3D%2214
|
|
|
16
16
|
|
|
17
17
|
var WarningIcon = "data:image/svg+xml,%3Csvg%20width%3D%2214%22%20height%3D%2214%22%20viewBox%3D%220%200%2014%2014%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M7%205V7.5M13%207C13%2010.3137%2010.3137%2013%207%2013C3.68629%2013%201%2010.3137%201%207C1%203.68629%203.68629%201%207%201C10.3137%201%2013%203.68629%2013%207ZM7%209.5H7.005V9.505H7V9.5Z%22%20stroke%3D%22%23F8CE52%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E";
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* A functional React component utilized to render the `Button` component
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
var Button = function Button(_ref) {
|
|
24
|
+
var onClick = _ref.onClick,
|
|
25
|
+
text = _ref.text,
|
|
26
|
+
_ref$type = _ref.type,
|
|
27
|
+
type = _ref$type === void 0 ? 'button' : _ref$type,
|
|
28
|
+
ariaLabel = _ref.ariaLabel,
|
|
29
|
+
_ref$variant = _ref.variant,
|
|
30
|
+
variant = _ref$variant === void 0 ? 'primary' : _ref$variant,
|
|
31
|
+
disabled = _ref.disabled,
|
|
32
|
+
className = _ref.className,
|
|
33
|
+
width = _ref.width;
|
|
34
|
+
return /*#__PURE__*/React__default.createElement(Button$2, {
|
|
35
|
+
onClick: onClick,
|
|
36
|
+
type: type,
|
|
37
|
+
variant: variant,
|
|
38
|
+
disabled: disabled,
|
|
39
|
+
"aria-label": ariaLabel,
|
|
40
|
+
className: className,
|
|
41
|
+
width: width === 'fixed' ? '100%' : 'fit-content'
|
|
42
|
+
}, text);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* A functional React component utilized to render the `Banner` component
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
var Banner = function Banner(_ref) {
|
|
50
|
+
var variant = _ref.variant,
|
|
51
|
+
message = _ref.message,
|
|
52
|
+
buttonText = _ref.buttonText,
|
|
53
|
+
onClick = _ref.onClick;
|
|
54
|
+
var Icon = useMemo(function () {
|
|
55
|
+
switch (variant) {
|
|
56
|
+
case 'error':
|
|
57
|
+
return /*#__PURE__*/React__default.createElement(Image, {
|
|
58
|
+
src: ErrorIcon,
|
|
59
|
+
alt: "error",
|
|
60
|
+
boxSize: "16px"
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
case 'neutral':
|
|
64
|
+
return /*#__PURE__*/React__default.createElement(Image, {
|
|
65
|
+
src: NeutralIcon,
|
|
66
|
+
alt: "neutral",
|
|
67
|
+
boxSize: "16px"
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
case 'positive':
|
|
71
|
+
return /*#__PURE__*/React__default.createElement(Image, {
|
|
72
|
+
src: PositiveIcon,
|
|
73
|
+
alt: "positive",
|
|
74
|
+
boxSize: "16px"
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
case 'warning':
|
|
78
|
+
return /*#__PURE__*/React__default.createElement(Image, {
|
|
79
|
+
src: WarningIcon,
|
|
80
|
+
alt: "warning",
|
|
81
|
+
boxSize: "16px"
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
default:
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
}, [variant]);
|
|
88
|
+
return /*#__PURE__*/React__default.createElement(Alert$1, {
|
|
89
|
+
variant: variant
|
|
90
|
+
}, /*#__PURE__*/React__default.createElement(AlertDescription, null, /*#__PURE__*/React__default.createElement(Box, {
|
|
91
|
+
pb: "8px"
|
|
92
|
+
}, Icon), message, onClick && buttonText && /*#__PURE__*/React__default.createElement(Flex, {
|
|
93
|
+
pt: "8px",
|
|
94
|
+
justifyContent: "flex-end"
|
|
95
|
+
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
96
|
+
variant: "secondary",
|
|
97
|
+
onClick: onClick,
|
|
98
|
+
text: buttonText,
|
|
99
|
+
width: "variable",
|
|
100
|
+
ariaLabel: "banner button"
|
|
101
|
+
}))));
|
|
102
|
+
};
|
|
103
|
+
|
|
19
104
|
var blue = {
|
|
20
105
|
50: 'hsl(209, 100%, 95%)',
|
|
21
106
|
100: 'hsl(209, 100%, 90%)',
|
|
@@ -151,64 +236,6 @@ var colors = {
|
|
|
151
236
|
blue: blue
|
|
152
237
|
};
|
|
153
238
|
|
|
154
|
-
/**
|
|
155
|
-
* A functional React component utilized to render the `Banner` component
|
|
156
|
-
*/
|
|
157
|
-
|
|
158
|
-
var Banner = function Banner(_ref) {
|
|
159
|
-
var variant = _ref.variant,
|
|
160
|
-
message = _ref.message,
|
|
161
|
-
buttonText = _ref.buttonText,
|
|
162
|
-
onClick = _ref.onClick;
|
|
163
|
-
var Icon = useMemo(function () {
|
|
164
|
-
switch (variant) {
|
|
165
|
-
case 'error':
|
|
166
|
-
return /*#__PURE__*/React__default.createElement(Image, {
|
|
167
|
-
src: ErrorIcon,
|
|
168
|
-
alt: "error",
|
|
169
|
-
boxSize: "16px"
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
case 'neutral':
|
|
173
|
-
return /*#__PURE__*/React__default.createElement(Image, {
|
|
174
|
-
src: NeutralIcon,
|
|
175
|
-
alt: "neutral",
|
|
176
|
-
boxSize: "16px"
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
case 'positive':
|
|
180
|
-
return /*#__PURE__*/React__default.createElement(Image, {
|
|
181
|
-
src: PositiveIcon,
|
|
182
|
-
alt: "positive",
|
|
183
|
-
boxSize: "16px"
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
case 'warning':
|
|
187
|
-
return /*#__PURE__*/React__default.createElement(Image, {
|
|
188
|
-
src: WarningIcon,
|
|
189
|
-
alt: "warning",
|
|
190
|
-
boxSize: "16px"
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
default:
|
|
194
|
-
return null;
|
|
195
|
-
}
|
|
196
|
-
}, [variant]);
|
|
197
|
-
return /*#__PURE__*/React__default.createElement(Alert$1, {
|
|
198
|
-
variant: variant
|
|
199
|
-
}, /*#__PURE__*/React__default.createElement(AlertDescription, null, /*#__PURE__*/React__default.createElement(Box, {
|
|
200
|
-
pb: "8px"
|
|
201
|
-
}, Icon), message, onClick && buttonText && /*#__PURE__*/React__default.createElement(Flex, {
|
|
202
|
-
pt: "8px",
|
|
203
|
-
justifyContent: "flex-end"
|
|
204
|
-
}, /*#__PURE__*/React__default.createElement(Button$2, {
|
|
205
|
-
size: "sm",
|
|
206
|
-
bg: "white",
|
|
207
|
-
color: colors.fill.action,
|
|
208
|
-
onClick: onClick
|
|
209
|
-
}, buttonText))));
|
|
210
|
-
};
|
|
211
|
-
|
|
212
239
|
/**
|
|
213
240
|
* A functional React component utilized to render the `Icon` for the `Breadcrumbs` component.
|
|
214
241
|
*/
|
|
@@ -296,32 +323,6 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
|
|
|
296
323
|
}));
|
|
297
324
|
};
|
|
298
325
|
|
|
299
|
-
/**
|
|
300
|
-
* A functional React component utilized to render the `Button` component
|
|
301
|
-
*/
|
|
302
|
-
|
|
303
|
-
var Button = function Button(_ref) {
|
|
304
|
-
var onClick = _ref.onClick,
|
|
305
|
-
text = _ref.text,
|
|
306
|
-
_ref$type = _ref.type,
|
|
307
|
-
type = _ref$type === void 0 ? 'button' : _ref$type,
|
|
308
|
-
ariaLabel = _ref.ariaLabel,
|
|
309
|
-
_ref$variant = _ref.variant,
|
|
310
|
-
variant = _ref$variant === void 0 ? 'solid' : _ref$variant,
|
|
311
|
-
disabled = _ref.disabled,
|
|
312
|
-
className = _ref.className,
|
|
313
|
-
width = _ref.width;
|
|
314
|
-
return /*#__PURE__*/React__default.createElement(Button$2, {
|
|
315
|
-
onClick: onClick,
|
|
316
|
-
type: type,
|
|
317
|
-
variant: variant,
|
|
318
|
-
disabled: disabled,
|
|
319
|
-
"aria-label": ariaLabel,
|
|
320
|
-
className: className,
|
|
321
|
-
width: width === 'variable' ? '100%' : 'fit-content'
|
|
322
|
-
}, text);
|
|
323
|
-
};
|
|
324
|
-
|
|
325
326
|
var GoogleLogo = "data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%20533.5%20544.3%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20%20%20%20d%3D%22M533.5%20278.4c0-18.5-1.5-37.1-4.7-55.3H272.1v104.8h147c-6.1%2033.8-25.7%2063.7-54.4%2082.7v68h87.7c51.5-47.4%2081.1-117.4%2081.1-200.2z%22%20%20%20%20fill%3D%22%234285f4%22%20%20%2F%3E%3Cpath%20%20%20%20d%3D%22M272.1%20544.3c73.4%200%20135.3-24.1%20180.4-65.7l-87.7-68c-24.4%2016.6-55.9%2026-92.6%2026-71%200-131.2-47.9-152.8-112.3H28.9v70.1c46.2%2091.9%20140.3%20149.9%20243.2%20149.9z%22%20%20%20%20fill%3D%22%2334a853%22%20%20%2F%3E%3Cpath%20%20%20%20d%3D%22M119.3%20324.3c-11.4-33.8-11.4-70.4%200-104.2V150H28.9c-38.6%2076.9-38.6%20167.5%200%20244.4l90.4-70.1z%22%20%20%20%20fill%3D%22%23fbbc04%22%20%20%2F%3E%3Cpath%20%20%20%20d%3D%22M272.1%20107.7c38.8-.6%2076.3%2014%20104.4%2040.8l77.7-77.7C405%2024.6%20339.7-.8%20272.1%200%20169.2%200%2075.1%2058%2028.9%20150l90.4%2070.1c21.5-64.5%2081.8-112.4%20152.8-112.4z%22%20%20%20%20fill%3D%22%23ea4335%22%20%20%2F%3E%3C%2Fsvg%3E";
|
|
326
327
|
|
|
327
328
|
/**
|
|
@@ -402,18 +403,15 @@ function Form(_ref) {
|
|
|
402
403
|
* A functional React component utilized to render the `StackedCheckbox` component.
|
|
403
404
|
*/
|
|
404
405
|
|
|
405
|
-
var
|
|
406
|
-
var
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
value: option.value
|
|
415
|
-
}, option.label));
|
|
416
|
-
}));
|
|
406
|
+
var StackedCheckbox = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref) {
|
|
407
|
+
var value = _ref2.value,
|
|
408
|
+
label = _ref2.label,
|
|
409
|
+
defaultValue = _ref2.defaultValue;
|
|
410
|
+
return /*#__PURE__*/React__default.createElement(Checkbox, {
|
|
411
|
+
ref: _ref,
|
|
412
|
+
value: String(value),
|
|
413
|
+
defaultChecked: Boolean(defaultValue)
|
|
414
|
+
}, label);
|
|
417
415
|
});
|
|
418
416
|
|
|
419
417
|
function _extends() {
|
|
@@ -498,16 +496,21 @@ var SubtractIcon = "data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%221
|
|
|
498
496
|
|
|
499
497
|
var Dropdown = function Dropdown(_ref) {
|
|
500
498
|
var onSelectItem = _ref.onSelectItem,
|
|
501
|
-
options = _ref.options
|
|
499
|
+
options = _ref.options,
|
|
500
|
+
dropdownRef = _ref.dropdownRef,
|
|
501
|
+
position = _ref.position;
|
|
502
502
|
var DropdownContent = useMemo(function () {
|
|
503
503
|
return options.map(function (option, idx) {
|
|
504
504
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, option.value === 'section_header' && options[idx + 1] && options[idx + 1].value !== 'section_header' && /*#__PURE__*/React__default.createElement(Box, {
|
|
505
505
|
color: colors.label.secondary.light,
|
|
506
506
|
fontSize: "13px",
|
|
507
|
+
width: "fit-content",
|
|
507
508
|
fontWeight: "bold",
|
|
508
509
|
px: "8px",
|
|
509
|
-
bg: "inherit"
|
|
510
|
+
bg: "inherit",
|
|
511
|
+
whiteSpace: "nowrap"
|
|
510
512
|
}, idx > 0 && /*#__PURE__*/React__default.createElement(Box, {
|
|
513
|
+
width: "100%",
|
|
511
514
|
my: "3px",
|
|
512
515
|
borderTop: "2px solid",
|
|
513
516
|
borderColor: colors.border["default"]
|
|
@@ -521,17 +524,23 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
521
524
|
fontSize: "13px",
|
|
522
525
|
px: "8px",
|
|
523
526
|
py: "4px",
|
|
527
|
+
width: "fit-content",
|
|
524
528
|
color: colors.label.primary.light,
|
|
525
529
|
_hover: {
|
|
526
530
|
color: colors.label.primary.dark,
|
|
527
531
|
bg: colors.fill.action,
|
|
528
|
-
borderRadius: '4px'
|
|
532
|
+
borderRadius: '4px',
|
|
533
|
+
width: '100%'
|
|
529
534
|
},
|
|
530
|
-
bg: "inherit"
|
|
535
|
+
bg: "inherit",
|
|
536
|
+
whiteSpace: "nowrap"
|
|
531
537
|
}, option.label));
|
|
532
538
|
});
|
|
533
539
|
}, [onSelectItem, options]);
|
|
534
|
-
return /*#__PURE__*/React__default.createElement(
|
|
540
|
+
return /*#__PURE__*/React__default.createElement(Flex, {
|
|
541
|
+
flexDirection: "column",
|
|
542
|
+
ref: dropdownRef,
|
|
543
|
+
scrollMargin: "15px",
|
|
535
544
|
bg: colors.fill.light.quaternary,
|
|
536
545
|
backdropFilter: "auto",
|
|
537
546
|
backdropBlur: "64px",
|
|
@@ -539,13 +548,17 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
539
548
|
border: "0.25px solid",
|
|
540
549
|
borderColor: colors.fill.light.tertiary,
|
|
541
550
|
mt: "3px",
|
|
542
|
-
maxH: "
|
|
551
|
+
maxH: "240px",
|
|
543
552
|
overflowY: "auto",
|
|
544
553
|
px: "8px",
|
|
545
554
|
py: "4px",
|
|
546
555
|
position: "absolute",
|
|
547
|
-
|
|
548
|
-
|
|
556
|
+
top: position === 'top' ? 26 : undefined,
|
|
557
|
+
bottom: position === 'bottom' ? 30 : undefined,
|
|
558
|
+
width: "fit-content",
|
|
559
|
+
minWidth: "100%",
|
|
560
|
+
zIndex: 100,
|
|
561
|
+
tabIndex: -2000
|
|
549
562
|
}, DropdownContent);
|
|
550
563
|
};
|
|
551
564
|
|
|
@@ -573,6 +586,7 @@ var StackedSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref
|
|
|
573
586
|
props = _objectWithoutPropertiesLoose(_ref2, _excluded$1);
|
|
574
587
|
|
|
575
588
|
var dropdownRef = useRef(null);
|
|
589
|
+
var dropdownMenuRef = useRef(null);
|
|
576
590
|
|
|
577
591
|
var _useState = useState(false),
|
|
578
592
|
isFocussed = _useState[0],
|
|
@@ -584,6 +598,21 @@ var StackedSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref
|
|
|
584
598
|
selectedOption = _useState2[0],
|
|
585
599
|
setSelectedOption = _useState2[1];
|
|
586
600
|
|
|
601
|
+
var _useState3 = useState('top'),
|
|
602
|
+
position = _useState3[0],
|
|
603
|
+
setPosition = _useState3[1];
|
|
604
|
+
|
|
605
|
+
useEffect(function () {
|
|
606
|
+
var _dropdownRef$current;
|
|
607
|
+
|
|
608
|
+
var boundingClientRect = (_dropdownRef$current = dropdownRef.current) == null ? void 0 : _dropdownRef$current.getBoundingClientRect();
|
|
609
|
+
|
|
610
|
+
if (document.body.clientHeight - ((boundingClientRect == null ? void 0 : boundingClientRect.y) + 240) >= 0) {
|
|
611
|
+
setPosition('top');
|
|
612
|
+
} else {
|
|
613
|
+
setPosition('bottom');
|
|
614
|
+
}
|
|
615
|
+
}, [dropdownRef]);
|
|
587
616
|
useDidMountEffect(function () {
|
|
588
617
|
var _options$find$label2, _options$find2;
|
|
589
618
|
|
|
@@ -623,7 +652,25 @@ var StackedSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref
|
|
|
623
652
|
fontSize: "13px",
|
|
624
653
|
textShadow: "0 0 0 " + colors.label.primary.light,
|
|
625
654
|
value: selectedOption,
|
|
626
|
-
autoComplete: "off"
|
|
655
|
+
autoComplete: "off",
|
|
656
|
+
onKeyDown: function onKeyDown(e) {
|
|
657
|
+
if (isFocussed) {
|
|
658
|
+
var _dropdownMenuRef$curr;
|
|
659
|
+
|
|
660
|
+
if (e.key === 'Tab') {
|
|
661
|
+
return setIsFocussed(false);
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
var idx = options.findIndex(function (option) {
|
|
665
|
+
return option.label[0].toLocaleLowerCase() === e.key;
|
|
666
|
+
});
|
|
667
|
+
console.log(idx);
|
|
668
|
+
(_dropdownMenuRef$curr = dropdownMenuRef.current) == null ? void 0 : _dropdownMenuRef$curr.scrollTo({
|
|
669
|
+
top: idx * 27,
|
|
670
|
+
behavior: 'smooth'
|
|
671
|
+
});
|
|
672
|
+
}
|
|
673
|
+
}
|
|
627
674
|
})), /*#__PURE__*/React__default.createElement(InputRightElement, {
|
|
628
675
|
cursor: "pointer",
|
|
629
676
|
onClick: function onClick() {
|
|
@@ -634,6 +681,8 @@ var StackedSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref
|
|
|
634
681
|
alt: "subtract",
|
|
635
682
|
boxSize: "16px"
|
|
636
683
|
}))), isFocussed && /*#__PURE__*/React__default.createElement(Dropdown, {
|
|
684
|
+
position: position,
|
|
685
|
+
dropdownRef: dropdownMenuRef,
|
|
637
686
|
onSelectItem: function onSelectItem(option) {
|
|
638
687
|
return handleOnSelectItem(option);
|
|
639
688
|
},
|
|
@@ -650,7 +699,9 @@ var StackedTextarea = /*#__PURE__*/React__default.forwardRef(function (_ref2, _r
|
|
|
650
699
|
|
|
651
700
|
return /*#__PURE__*/React__default.createElement(Textarea$1, Object.assign({
|
|
652
701
|
ref: _ref
|
|
653
|
-
}, props
|
|
702
|
+
}, props, {
|
|
703
|
+
fontSize: "13px"
|
|
704
|
+
}));
|
|
654
705
|
});
|
|
655
706
|
|
|
656
707
|
var _path;
|
|
@@ -682,12 +733,13 @@ var Token = function Token(_ref) {
|
|
|
682
733
|
alignItems: "center",
|
|
683
734
|
width: "fit-content",
|
|
684
735
|
w: "auto",
|
|
685
|
-
h: "
|
|
686
|
-
pl: "
|
|
687
|
-
pr: "
|
|
736
|
+
h: "16px",
|
|
737
|
+
pl: "6px",
|
|
738
|
+
pr: "2px",
|
|
688
739
|
py: "2px",
|
|
689
740
|
position: "relative"
|
|
690
741
|
}, /*#__PURE__*/React__default.createElement(Text$2, {
|
|
742
|
+
whiteSpace: "nowrap",
|
|
691
743
|
color: colors.label.primary.light,
|
|
692
744
|
fontSize: "13px",
|
|
693
745
|
pr: "4px"
|
|
@@ -695,8 +747,8 @@ var Token = function Token(_ref) {
|
|
|
695
747
|
length: 15,
|
|
696
748
|
omission: '...'
|
|
697
749
|
})), /*#__PURE__*/React__default.createElement(Memo, {
|
|
698
|
-
width: "
|
|
699
|
-
height: "
|
|
750
|
+
width: "11px",
|
|
751
|
+
height: "11px",
|
|
700
752
|
onClick: onDelete,
|
|
701
753
|
cursor: "pointer"
|
|
702
754
|
}));
|
|
@@ -712,14 +764,15 @@ var StackedMultiSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
712
764
|
control = _ref2.control,
|
|
713
765
|
name = _ref2.name,
|
|
714
766
|
placeholder = _ref2.placeholder,
|
|
715
|
-
disabled = _ref2.disabled
|
|
716
|
-
maxLength = _ref2.maxLength,
|
|
717
|
-
setError = _ref2.setError;
|
|
767
|
+
disabled = _ref2.disabled;
|
|
718
768
|
var watchedValue = useWatch({
|
|
719
769
|
control: control,
|
|
720
770
|
name: name
|
|
721
771
|
});
|
|
722
772
|
var dropdownRef = useRef(null);
|
|
773
|
+
var dropdownMenuRef = useRef(null);
|
|
774
|
+
var scrollRef = useRef(null);
|
|
775
|
+
var inputRef = useRef(null);
|
|
723
776
|
|
|
724
777
|
var _useState = useState([]),
|
|
725
778
|
localValues = _useState[0],
|
|
@@ -733,15 +786,28 @@ var StackedMultiSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
733
786
|
isFocussed = _useState3[0],
|
|
734
787
|
setIsFocussed = _useState3[1];
|
|
735
788
|
|
|
789
|
+
var _useState4 = useState(false),
|
|
790
|
+
shouldSideScroll = _useState4[0],
|
|
791
|
+
setShouldSideScroll = _useState4[1];
|
|
792
|
+
|
|
793
|
+
var _useState5 = useState('top'),
|
|
794
|
+
position = _useState5[0],
|
|
795
|
+
setPosition = _useState5[1];
|
|
796
|
+
|
|
797
|
+
useEffect(function () {
|
|
798
|
+
var _dropdownRef$current;
|
|
799
|
+
|
|
800
|
+
var boundingClientRect = (_dropdownRef$current = dropdownRef.current) == null ? void 0 : _dropdownRef$current.getBoundingClientRect();
|
|
801
|
+
|
|
802
|
+
if (document.body.clientHeight - ((boundingClientRect == null ? void 0 : boundingClientRect.y) + 240) >= 0) {
|
|
803
|
+
setPosition('top');
|
|
804
|
+
} else {
|
|
805
|
+
setPosition('bottom');
|
|
806
|
+
}
|
|
807
|
+
}, [dropdownRef]);
|
|
736
808
|
useOutsideClick({
|
|
737
809
|
ref: dropdownRef,
|
|
738
810
|
handler: function handler() {
|
|
739
|
-
if (maxLength && localValues.length > maxLength) {
|
|
740
|
-
setError(name, {
|
|
741
|
-
message: "Exceeded maximum of " + maxLength + " options"
|
|
742
|
-
});
|
|
743
|
-
}
|
|
744
|
-
|
|
745
811
|
return setIsFocussed(false);
|
|
746
812
|
}
|
|
747
813
|
}); // gets latest watched form value (common delimited) from RHF state and creates a list
|
|
@@ -751,24 +817,27 @@ var StackedMultiSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
751
817
|
setLocalValues([]);
|
|
752
818
|
}
|
|
753
819
|
|
|
754
|
-
if (
|
|
820
|
+
if (watchedValue !== undefined && watchedValue != null && watchedValue.length) {
|
|
821
|
+
if (shouldSideScroll) {
|
|
822
|
+
var _scrollRef$current;
|
|
823
|
+
|
|
824
|
+
scrollRef.current.scrollTo({
|
|
825
|
+
left: (_scrollRef$current = scrollRef.current) == null ? void 0 : _scrollRef$current.scrollWidth,
|
|
826
|
+
behavior: 'smooth'
|
|
827
|
+
});
|
|
828
|
+
setShouldSideScroll(false);
|
|
829
|
+
}
|
|
830
|
+
|
|
755
831
|
setLocalValues(watchedValue.split(',').filter(Boolean).map(function (value) {
|
|
756
832
|
return options.find(function (option) {
|
|
757
833
|
return option.value === value;
|
|
758
834
|
});
|
|
759
835
|
}));
|
|
760
836
|
}
|
|
761
|
-
}, [
|
|
837
|
+
}, [options, shouldSideScroll, watchedValue]);
|
|
762
838
|
|
|
763
839
|
var handleChange = function handleChange(option) {
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
if (maxLength && localValues.length > maxLength) {
|
|
767
|
-
return setError(name, {
|
|
768
|
-
message: "Exceeded maximum of " + maxLength + " options"
|
|
769
|
-
});
|
|
770
|
-
}
|
|
771
|
-
|
|
840
|
+
setShouldSideScroll(true);
|
|
772
841
|
var newValue = [].concat(localValues, [option]).map(function (_ref3) {
|
|
773
842
|
var value = _ref3.value;
|
|
774
843
|
return value;
|
|
@@ -812,9 +881,27 @@ var StackedMultiSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
812
881
|
|
|
813
882
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
814
883
|
ref: dropdownRef,
|
|
815
|
-
position: "relative"
|
|
884
|
+
position: "relative",
|
|
885
|
+
onKeyDown: function onKeyDown(e) {
|
|
886
|
+
if (isFocussed) {
|
|
887
|
+
var _dropdownMenuRef$curr;
|
|
888
|
+
|
|
889
|
+
if (e.key === 'Tab') {
|
|
890
|
+
return setIsFocussed(false);
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
var idx = options.findIndex(function (option) {
|
|
894
|
+
return option.label[0].toLocaleLowerCase() === e.key;
|
|
895
|
+
});
|
|
896
|
+
(_dropdownMenuRef$curr = dropdownMenuRef.current) == null ? void 0 : _dropdownMenuRef$curr.scrollTo({
|
|
897
|
+
top: idx * 27,
|
|
898
|
+
behavior: 'smooth'
|
|
899
|
+
});
|
|
900
|
+
}
|
|
901
|
+
}
|
|
816
902
|
}, /*#__PURE__*/React__default.createElement(Flex, {
|
|
817
903
|
fontSize: "13px",
|
|
904
|
+
h: "26px",
|
|
818
905
|
border: isFocussed ? '2px solid' : '1px solid',
|
|
819
906
|
borderColor: isFocussed ? colors.border.focus : colors.border["default"],
|
|
820
907
|
py: "5px",
|
|
@@ -823,23 +910,42 @@ var StackedMultiSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
823
910
|
alignItems: "center",
|
|
824
911
|
justifyContent: "space-between",
|
|
825
912
|
onClick: function onClick() {
|
|
826
|
-
|
|
913
|
+
if (!disabled) {
|
|
914
|
+
var _inputRef$current;
|
|
915
|
+
|
|
916
|
+
if (isFocussed) {
|
|
917
|
+
return setIsFocussed(false);
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
(_inputRef$current = inputRef.current) == null ? void 0 : _inputRef$current.focus();
|
|
921
|
+
setIsFocussed(true);
|
|
922
|
+
}
|
|
827
923
|
},
|
|
828
924
|
bg: disabled ? colors.fill.light.quaternary : '#ffffff',
|
|
829
925
|
cursor: disabled ? 'not-allowed' : 'pointer'
|
|
830
926
|
}, /*#__PURE__*/React__default.createElement(Flex, {
|
|
831
|
-
height: "28px",
|
|
832
927
|
alignItems: "center",
|
|
833
|
-
|
|
834
|
-
|
|
928
|
+
h: "inherit",
|
|
929
|
+
width: "90%",
|
|
930
|
+
overflowX: "scroll",
|
|
835
931
|
style: {
|
|
836
932
|
scrollbarWidth: 'none'
|
|
837
933
|
/* Firefox */
|
|
838
|
-
|
|
839
|
-
|
|
934
|
+
,
|
|
935
|
+
msOverflowStyle: 'none'
|
|
936
|
+
},
|
|
937
|
+
sx: {
|
|
938
|
+
'::-webkit-scrollbar': {
|
|
939
|
+
display: 'none'
|
|
940
|
+
}
|
|
941
|
+
},
|
|
942
|
+
ref: scrollRef
|
|
840
943
|
}, localValues.length ? localValues.map(function (option) {
|
|
841
944
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
842
|
-
mr: "4px"
|
|
945
|
+
mr: "4px",
|
|
946
|
+
width: "fit-content",
|
|
947
|
+
h: "16px",
|
|
948
|
+
borderRadius: "full"
|
|
843
949
|
}, /*#__PURE__*/React__default.createElement(Token, {
|
|
844
950
|
label: option.label,
|
|
845
951
|
onDelete: function onDelete() {
|
|
@@ -849,8 +955,20 @@ var StackedMultiSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
849
955
|
}) : /*#__PURE__*/React__default.createElement(Text$2, {
|
|
850
956
|
color: colors.label.secondary.light,
|
|
851
957
|
fontSize: "13px"
|
|
852
|
-
}, placeholder)), /*#__PURE__*/React__default.createElement(
|
|
853
|
-
|
|
958
|
+
}, placeholder)), /*#__PURE__*/React__default.createElement(Input$2, {
|
|
959
|
+
padding: 0,
|
|
960
|
+
border: "none",
|
|
961
|
+
height: "0",
|
|
962
|
+
width: "0",
|
|
963
|
+
autoComplete: "off",
|
|
964
|
+
type: "text",
|
|
965
|
+
ref: inputRef,
|
|
966
|
+
tabIndex: -1,
|
|
967
|
+
_focus: {
|
|
968
|
+
boxShadow: 'none !important'
|
|
969
|
+
}
|
|
970
|
+
}), /*#__PURE__*/React__default.createElement(Flex, {
|
|
971
|
+
mr: "4px",
|
|
854
972
|
justifyContent: "center",
|
|
855
973
|
alignItems: "center"
|
|
856
974
|
}, /*#__PURE__*/React__default.createElement(Image, {
|
|
@@ -858,10 +976,12 @@ var StackedMultiSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
858
976
|
alt: "subtract",
|
|
859
977
|
boxSize: "16px"
|
|
860
978
|
}))), isFocussed && /*#__PURE__*/React__default.createElement(Dropdown, {
|
|
979
|
+
dropdownRef: dropdownMenuRef,
|
|
861
980
|
onSelectItem: function onSelectItem(option) {
|
|
862
981
|
return handleChange(option);
|
|
863
982
|
},
|
|
864
|
-
options: localOptions
|
|
983
|
+
options: localOptions,
|
|
984
|
+
position: position
|
|
865
985
|
}));
|
|
866
986
|
});
|
|
867
987
|
|
|
@@ -875,8 +995,6 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
875
995
|
control = _ref2.control,
|
|
876
996
|
placeholder = _ref2.placeholder,
|
|
877
997
|
disabled = _ref2.disabled,
|
|
878
|
-
maxLength = _ref2.maxLength,
|
|
879
|
-
setError = _ref2.setError,
|
|
880
998
|
clearErrors = _ref2.clearErrors;
|
|
881
999
|
var watchedValue = useWatch({
|
|
882
1000
|
control: control,
|
|
@@ -889,6 +1007,7 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
889
1007
|
|
|
890
1008
|
var inputRef = useRef(null);
|
|
891
1009
|
var inputWrapperRef = useRef(null);
|
|
1010
|
+
var scrollRef = useRef(null);
|
|
892
1011
|
|
|
893
1012
|
var _useState2 = useState(null),
|
|
894
1013
|
tokenIndex = _useState2[0],
|
|
@@ -898,9 +1017,13 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
898
1017
|
isFocussed = _useState3[0],
|
|
899
1018
|
setIsFocussed = _useState3[1];
|
|
900
1019
|
|
|
901
|
-
var _useState4 = useState(
|
|
902
|
-
|
|
903
|
-
|
|
1020
|
+
var _useState4 = useState(false),
|
|
1021
|
+
shouldSideScroll = _useState4[0],
|
|
1022
|
+
setShouldSideScroll = _useState4[1];
|
|
1023
|
+
|
|
1024
|
+
var _useState5 = useState(''),
|
|
1025
|
+
localValue = _useState5[0],
|
|
1026
|
+
setLocalValue = _useState5[1]; // gets latest watched form value (common delimited) from RHF state and creates a list
|
|
904
1027
|
|
|
905
1028
|
|
|
906
1029
|
useEffect(function () {
|
|
@@ -909,19 +1032,24 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
909
1032
|
}
|
|
910
1033
|
|
|
911
1034
|
if (watchedValue !== undefined && watchedValue != null && watchedValue.length) {
|
|
1035
|
+
if (shouldSideScroll) {
|
|
1036
|
+
var _scrollRef$current;
|
|
1037
|
+
|
|
1038
|
+
scrollRef.current.scrollTo({
|
|
1039
|
+
left: (_scrollRef$current = scrollRef.current) == null ? void 0 : _scrollRef$current.scrollWidth,
|
|
1040
|
+
behavior: 'smooth'
|
|
1041
|
+
});
|
|
1042
|
+
setShouldSideScroll(false);
|
|
1043
|
+
}
|
|
1044
|
+
|
|
912
1045
|
setLatestFormValueToArray(watchedValue.split(',').filter(Boolean));
|
|
913
1046
|
}
|
|
914
|
-
}, [watchedValue]);
|
|
1047
|
+
}, [watchedValue, shouldSideScroll]);
|
|
915
1048
|
|
|
916
1049
|
var onHandleKeyDown = function onHandleKeyDown(e) {
|
|
917
|
-
|
|
918
|
-
if (maxLength && lastestFormValueToArray.length >= maxLength) {
|
|
919
|
-
return setError(name, {
|
|
920
|
-
type: 'maxLength',
|
|
921
|
-
message: "Exceeded maximum of " + maxLength + " options"
|
|
922
|
-
});
|
|
923
|
-
}
|
|
1050
|
+
setShouldSideScroll(true);
|
|
924
1051
|
|
|
1052
|
+
if (e.key === ' ' || e.key === 'Enter' || e.key === ',' || e.key === 'Tab') {
|
|
925
1053
|
if (e.key === 'Enter' && !localValue.trim().length && tokenIndex !== null) {
|
|
926
1054
|
setLocalValue(lastestFormValueToArray[tokenIndex]);
|
|
927
1055
|
|
|
@@ -938,10 +1066,11 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
938
1066
|
|
|
939
1067
|
var filteredUniqueValues = Array.from(new Set([].concat(lastestFormValueToArray, localValue.trim().split(','))));
|
|
940
1068
|
setLocalValue('');
|
|
941
|
-
|
|
1069
|
+
setValue(name, filteredUniqueValues.toString().replace(/\s/g, ''), {
|
|
942
1070
|
shouldValidate: true,
|
|
943
1071
|
shouldDirty: true
|
|
944
1072
|
});
|
|
1073
|
+
return setIsFocussed(false);
|
|
945
1074
|
}
|
|
946
1075
|
|
|
947
1076
|
if (!localValue.trim().length && lastestFormValueToArray.length) {
|
|
@@ -1000,7 +1129,6 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1000
1129
|
clearErrors(name);
|
|
1001
1130
|
|
|
1002
1131
|
if (localValue.trim()) {
|
|
1003
|
-
if (maxLength && watchedValue.length + localValue.trim().length > maxLength) return setLocalValue('');
|
|
1004
1132
|
var filteredUniqueValues = Array.from(new Set([].concat(lastestFormValueToArray, localValue.trim().split(','))));
|
|
1005
1133
|
setValue(name, filteredUniqueValues.toString().replace(/\s/g, ''), {
|
|
1006
1134
|
shouldValidate: true,
|
|
@@ -1036,22 +1164,30 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1036
1164
|
},
|
|
1037
1165
|
bg: disabled ? colors.fill.light.quaternary : '#ffffff',
|
|
1038
1166
|
cursor: disabled ? 'not-allowed' : 'pointer',
|
|
1039
|
-
ref: inputWrapperRef
|
|
1167
|
+
ref: inputWrapperRef,
|
|
1168
|
+
h: "26px"
|
|
1040
1169
|
}, /*#__PURE__*/React__default.createElement(Flex, {
|
|
1041
|
-
|
|
1170
|
+
h: "18px",
|
|
1042
1171
|
alignItems: "center",
|
|
1043
|
-
width
|
|
1044
|
-
maxW
|
|
1045
|
-
overflowX: "
|
|
1172
|
+
// width="fit-content"
|
|
1173
|
+
// maxW="80%"
|
|
1174
|
+
overflowX: "scroll",
|
|
1046
1175
|
style: {
|
|
1047
1176
|
scrollbarWidth: 'none'
|
|
1048
1177
|
/* Firefox */
|
|
1049
|
-
|
|
1050
|
-
|
|
1178
|
+
,
|
|
1179
|
+
msOverflowStyle: 'none'
|
|
1180
|
+
},
|
|
1181
|
+
sx: {
|
|
1182
|
+
'::-webkit-scrollbar': {
|
|
1183
|
+
display: 'none'
|
|
1184
|
+
}
|
|
1185
|
+
},
|
|
1186
|
+
ref: scrollRef
|
|
1051
1187
|
}, lastestFormValueToArray.length ? lastestFormValueToArray.map(function (label, index) {
|
|
1052
1188
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
1053
1189
|
mr: "4px",
|
|
1054
|
-
border: tokenIndex === index ? "
|
|
1190
|
+
border: tokenIndex === index ? "1px solid " + colors.border.focus : 'none',
|
|
1055
1191
|
borderRadius: "full",
|
|
1056
1192
|
onClick: function onClick() {
|
|
1057
1193
|
return setTokenIndex(index);
|
|
@@ -1076,7 +1212,7 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1076
1212
|
padding: 0,
|
|
1077
1213
|
width: "100%",
|
|
1078
1214
|
border: "none",
|
|
1079
|
-
height: "
|
|
1215
|
+
height: "auto",
|
|
1080
1216
|
color: tokenIndex !== null ? 'transparent' : colors.label.primary,
|
|
1081
1217
|
_focus: {
|
|
1082
1218
|
boxShadow: 'none !important'
|
|
@@ -1088,6 +1224,9 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1088
1224
|
ref: inputRef,
|
|
1089
1225
|
onFocus: function onFocus() {
|
|
1090
1226
|
return setIsFocussed(true);
|
|
1227
|
+
},
|
|
1228
|
+
onBlur: function onBlur() {
|
|
1229
|
+
return setIsFocussed(false);
|
|
1091
1230
|
}
|
|
1092
1231
|
}))));
|
|
1093
1232
|
});
|
|
@@ -1100,8 +1239,14 @@ var StackedSwitch = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref
|
|
|
1100
1239
|
var isRequired = _ref2.isRequired,
|
|
1101
1240
|
_onChange = _ref2.onChange,
|
|
1102
1241
|
value = _ref2.value;
|
|
1242
|
+
if (value === null) return null;
|
|
1103
1243
|
return /*#__PURE__*/React__default.createElement(Switch$1, {
|
|
1104
|
-
|
|
1244
|
+
h: "26px",
|
|
1245
|
+
mx: "4px",
|
|
1246
|
+
_focus: {
|
|
1247
|
+
border: '2px solid',
|
|
1248
|
+
borderColor: colors.border.focus
|
|
1249
|
+
},
|
|
1105
1250
|
ref: _ref,
|
|
1106
1251
|
isRequired: isRequired,
|
|
1107
1252
|
value: String(value),
|
|
@@ -1218,17 +1363,18 @@ function Input(_ref) {
|
|
|
1218
1363
|
});
|
|
1219
1364
|
|
|
1220
1365
|
case 'checkbox':
|
|
1221
|
-
return /*#__PURE__*/React__default.createElement(
|
|
1366
|
+
return /*#__PURE__*/React__default.createElement(StackedCheckbox, {
|
|
1222
1367
|
className: "input-" + inputType + " " + (className != null ? className : ''),
|
|
1223
1368
|
name: name,
|
|
1224
1369
|
id: name,
|
|
1225
1370
|
isInvalid: isInvalid,
|
|
1226
|
-
options: options,
|
|
1227
1371
|
onChange: onChange,
|
|
1228
1372
|
onBlur: onBlur,
|
|
1229
1373
|
ref: ref,
|
|
1230
1374
|
disabled: disabled,
|
|
1231
|
-
value: value
|
|
1375
|
+
value: value,
|
|
1376
|
+
defaultValue: defaultValue,
|
|
1377
|
+
label: label
|
|
1232
1378
|
});
|
|
1233
1379
|
|
|
1234
1380
|
case 'multi-select':
|
|
@@ -1247,8 +1393,7 @@ function Input(_ref) {
|
|
|
1247
1393
|
control: control,
|
|
1248
1394
|
setError: setError,
|
|
1249
1395
|
clearErrors: clearErrors,
|
|
1250
|
-
placeholder: placeholder
|
|
1251
|
-
maxLength: maxLength
|
|
1396
|
+
placeholder: placeholder
|
|
1252
1397
|
});
|
|
1253
1398
|
|
|
1254
1399
|
case 'pilled-text':
|
|
@@ -1279,7 +1424,8 @@ function Input(_ref) {
|
|
|
1279
1424
|
onChange: onChange,
|
|
1280
1425
|
onBlur: onBlur,
|
|
1281
1426
|
ref: ref,
|
|
1282
|
-
value: value
|
|
1427
|
+
value: value,
|
|
1428
|
+
defaultValue: defaultValue
|
|
1283
1429
|
});
|
|
1284
1430
|
|
|
1285
1431
|
default:
|
|
@@ -1602,10 +1748,10 @@ function Table(_ref) {
|
|
|
1602
1748
|
border: "none",
|
|
1603
1749
|
overflowX: "auto",
|
|
1604
1750
|
bg: "white",
|
|
1605
|
-
width: "
|
|
1751
|
+
width: "100%"
|
|
1606
1752
|
}, /*#__PURE__*/React__default.createElement(Table$2, {
|
|
1607
1753
|
variant: "unstyled",
|
|
1608
|
-
width: "
|
|
1754
|
+
width: "100%",
|
|
1609
1755
|
style: {
|
|
1610
1756
|
borderCollapse: 'separate',
|
|
1611
1757
|
borderSpacing: '0px'
|
|
@@ -1842,13 +1988,14 @@ var Badge = {
|
|
|
1842
1988
|
|
|
1843
1989
|
var baseStyle$2 = /*#__PURE__*/defineStyle({
|
|
1844
1990
|
borderRadius: '4px',
|
|
1845
|
-
fontSize: '
|
|
1991
|
+
fontSize: '13px',
|
|
1846
1992
|
bg: colors.fill.action,
|
|
1847
1993
|
color: colors.label.primary.dark,
|
|
1994
|
+
border: 'none',
|
|
1848
1995
|
px: '8px',
|
|
1849
1996
|
py: '4px',
|
|
1850
1997
|
bgGradient: 'linear-gradient(#FFFFFF29, #FFFFFF00)',
|
|
1851
|
-
shadow: '
|
|
1998
|
+
shadow: '0.5px 0.5px 1px 1px #0000001A',
|
|
1852
1999
|
_disabled: {
|
|
1853
2000
|
backgroundColor: 'gray.100',
|
|
1854
2001
|
borderColor: 'gray.100',
|
|
@@ -1864,20 +2011,19 @@ var baseStyle$2 = /*#__PURE__*/defineStyle({
|
|
|
1864
2011
|
bgGradient: colors.fill.light.quaternary
|
|
1865
2012
|
},
|
|
1866
2013
|
_focus: {
|
|
1867
|
-
|
|
1868
|
-
|
|
2014
|
+
outline: "2px solid " + colors.border.focus,
|
|
2015
|
+
outlineOffset: '0px'
|
|
1869
2016
|
}
|
|
1870
2017
|
});
|
|
1871
2018
|
|
|
1872
|
-
var
|
|
2019
|
+
var variantPrimary = function variantPrimary() {
|
|
1873
2020
|
return _extends({}, baseStyle$2);
|
|
1874
2021
|
};
|
|
1875
2022
|
|
|
1876
|
-
var
|
|
2023
|
+
var variantSecondary = function variantSecondary() {
|
|
1877
2024
|
return _extends({}, baseStyle$2, {
|
|
1878
2025
|
color: colors.fill.action,
|
|
1879
2026
|
bg: colors.label.primary.dark,
|
|
1880
|
-
border: 'none',
|
|
1881
2027
|
_hover: {
|
|
1882
2028
|
bg: colors.label.primary.dark
|
|
1883
2029
|
},
|
|
@@ -1893,11 +2039,11 @@ var variantOutline$1 = function variantOutline() {
|
|
|
1893
2039
|
};
|
|
1894
2040
|
|
|
1895
2041
|
var variants$2 = {
|
|
1896
|
-
|
|
1897
|
-
|
|
2042
|
+
primary: /*#__PURE__*/variantPrimary(),
|
|
2043
|
+
secondary: /*#__PURE__*/variantSecondary()
|
|
1898
2044
|
};
|
|
1899
2045
|
var defaultProps$2 = {
|
|
1900
|
-
|
|
2046
|
+
variant: 'primary'
|
|
1901
2047
|
};
|
|
1902
2048
|
var Button$1 = {
|
|
1903
2049
|
baseStyle: baseStyle$2,
|
|
@@ -2001,6 +2147,7 @@ var parts$3 = ['field'];
|
|
|
2001
2147
|
var baseStyle$7 = {
|
|
2002
2148
|
field: {
|
|
2003
2149
|
fontSize: '13px',
|
|
2150
|
+
h: '26px',
|
|
2004
2151
|
'::placeholder': {
|
|
2005
2152
|
color: colors.label.secondary.light
|
|
2006
2153
|
},
|
|
@@ -2482,7 +2629,8 @@ var baseStyle$c = {
|
|
|
2482
2629
|
},
|
|
2483
2630
|
th: {
|
|
2484
2631
|
bg: colors.label.primary.dark,
|
|
2485
|
-
padding: '5px 8px !important'
|
|
2632
|
+
padding: '5px 8px !important',
|
|
2633
|
+
fontSize: '13px'
|
|
2486
2634
|
},
|
|
2487
2635
|
tr: {
|
|
2488
2636
|
fontSize: '13px',
|
|
@@ -2751,9 +2899,11 @@ var Tabs = {
|
|
|
2751
2899
|
};
|
|
2752
2900
|
|
|
2753
2901
|
var baseStyle$e = /*#__PURE__*/_extends({}, Input$1.baseStyle.field, {
|
|
2902
|
+
fontSize: '13px',
|
|
2754
2903
|
display: 'block',
|
|
2755
2904
|
paddingY: '8px',
|
|
2756
|
-
|
|
2905
|
+
paddingX: '5px',
|
|
2906
|
+
height: '78px',
|
|
2757
2907
|
lineHeight: 'short'
|
|
2758
2908
|
});
|
|
2759
2909
|
|