@xqmsg/ui-core 0.9.2 → 0.10.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.
Files changed (47) hide show
  1. package/dist/components/input/InputTypes.d.ts +5 -3
  2. package/dist/components/input/StackedInput/StackedInput.d.ts +0 -3
  3. package/dist/components/input/StackedMultiSelect/index.d.ts +1 -1
  4. package/dist/components/input/StackedSelect/StackedSelect.d.ts +7 -3
  5. package/dist/components/input/components/dropdown/index.d.ts +10 -0
  6. package/dist/components/input/components/label/index.d.ts +9 -0
  7. package/dist/components/input/components/token/Token.stories.d.ts +5 -0
  8. package/dist/components/input/components/token/index.d.ts +7 -0
  9. package/dist/components/input/index.d.ts +1 -3
  10. package/dist/theme/components/form-error.d.ts +3 -3
  11. package/dist/theme/components/form-label.d.ts +4 -6
  12. package/dist/theme/components/form.d.ts +3 -3
  13. package/dist/theme/components/input.d.ts +32 -161
  14. package/dist/theme/components/select.d.ts +27 -153
  15. package/dist/theme/components/textarea.d.ts +10 -117
  16. package/dist/theme/foundations/colors.d.ts +30 -0
  17. package/dist/ui-core.cjs.development.js +455 -490
  18. package/dist/ui-core.cjs.development.js.map +1 -1
  19. package/dist/ui-core.cjs.production.min.js +1 -1
  20. package/dist/ui-core.cjs.production.min.js.map +1 -1
  21. package/dist/ui-core.esm.js +459 -494
  22. package/dist/ui-core.esm.js.map +1 -1
  23. package/package.json +5 -3
  24. package/src/components/input/Input.stories.tsx +28 -12
  25. package/src/components/input/InputTypes.ts +7 -1
  26. package/src/components/input/StackedInput/StackedInput.tsx +3 -15
  27. package/src/components/input/StackedMultiSelect/components/MultiValue/index.tsx +2 -2
  28. package/src/components/input/StackedMultiSelect/index.tsx +89 -93
  29. package/src/components/input/StackedPilledInput/index.tsx +145 -56
  30. package/src/components/input/StackedSelect/StackedSelect.tsx +63 -20
  31. package/src/components/input/StackedSelect/assets/svg/subtract.svg +3 -0
  32. package/src/components/input/components/dropdown/index.tsx +79 -0
  33. package/src/components/input/components/label/index.tsx +24 -0
  34. package/src/components/input/components/token/Token.stories.tsx +22 -0
  35. package/src/components/input/components/token/assets/svg/close.svg +3 -0
  36. package/src/components/input/components/token/index.tsx +37 -0
  37. package/src/components/input/index.tsx +8 -20
  38. package/src/theme/components/alert.ts +4 -4
  39. package/src/theme/components/form-error.ts +11 -14
  40. package/src/theme/components/form-label.ts +8 -8
  41. package/src/theme/components/form.ts +10 -13
  42. package/src/theme/components/input.ts +17 -191
  43. package/src/theme/components/select.ts +5 -10
  44. package/src/theme/components/textarea.ts +2 -38
  45. package/src/theme/foundations/colors.ts +17 -1
  46. package/dist/components/input/components/InputTag/index.d.ts +0 -7
  47. package/src/components/input/components/InputTag/index.tsx +0 -24
@@ -1,8 +1,8 @@
1
- import React, { useMemo, useCallback, useState, useEffect, useRef } from 'react';
2
- import { Image, Alert as Alert$1, AlertDescription, Box, Flex, Button as Button$2, Text as Text$2, Icon as Icon$1, Spinner, InputGroup, Checkbox, Input as Input$2, RadioGroup, Radio, Select as Select$1, Textarea as Textarea$1, Tag, TagLabel, TagCloseButton, Switch as Switch$1, FormControl, FormLabel as FormLabel$1, FormErrorMessage, FormHelperText, SimpleGrid, useMediaQuery, Grid, GridItem, IconButton, Collapse, TableContainer, Table as Table$1, Thead, Tr, Th, Tbody, Td, TableCaption, Tabs as Tabs$1, TabList, Tab, extendTheme, ChakraProvider } from '@chakra-ui/react';
1
+ import React, { useMemo, useCallback, useRef, useState, useEffect } from 'react';
2
+ import { Image, Alert as Alert$1, AlertDescription, Box, Flex, Button as Button$2, Text as Text$2, Icon as Icon$1, Spinner, InputGroup, Checkbox, Input as Input$2, 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$1, Thead, Tr, Th, Tbody, Td, TableCaption, Tabs as Tabs$1, TabList, Tab, extendTheme, ChakraProvider } from '@chakra-ui/react';
3
3
  import { FormProvider, useWatch, Controller } from 'react-hook-form';
4
- import ReactSelect from 'react-select';
5
- import { CloseIcon, HamburgerIcon } from '@chakra-ui/icons';
4
+ import colors$1 from 'src/theme/foundations/colors';
5
+ import { CloseIcon as CloseIcon$1, HamburgerIcon } from '@chakra-ui/icons';
6
6
  import { HiOutlineRefresh } from 'react-icons/hi';
7
7
  import { createBreakpoints, transparentize, mode, getColor } from '@chakra-ui/theme-tools';
8
8
 
@@ -162,7 +162,22 @@ var label = {
162
162
  primary: {
163
163
  light: '#000000',
164
164
  dark: '#FFFFFF'
165
- }
165
+ },
166
+ secondary: {
167
+ light: '#3C3C4399'
168
+ },
169
+ error: '#FF0000'
170
+ };
171
+ var border = {
172
+ focus: '#3A6CD980',
173
+ "default": '#9999991A'
174
+ };
175
+ var fill = {
176
+ light: '#7474800D',
177
+ positive: '#d8f1b8',
178
+ error: '#ffbdb9',
179
+ warning: '#ffefb4',
180
+ blue: '#0082ff'
166
181
  };
167
182
 
168
183
  var colors = /*#__PURE__*/_extends({
@@ -176,6 +191,8 @@ var colors = /*#__PURE__*/_extends({
176
191
  backdrop: '#fbfcff'
177
192
  }, aliases, {
178
193
  label: label,
194
+ border: border,
195
+ fill: fill,
179
196
  whiteAlpha: {
180
197
  50: 'rgba(255, 255, 255, 0.04)',
181
198
  100: 'rgba(255, 255, 255, 0.06)',
@@ -441,7 +458,7 @@ var StackedCheckboxGroup = /*#__PURE__*/React.forwardRef(function (_ref2, _ref)
441
458
  }));
442
459
  });
443
460
 
444
- var _excluded$1 = ["type", "isRequired", "leftElement", "rightElement"];
461
+ var _excluded$1 = ["type", "isRequired"];
445
462
  /**
446
463
  * A functional React component utilized to render the `StackedInput` component.
447
464
  */
@@ -450,15 +467,13 @@ var StackedInput = /*#__PURE__*/React.forwardRef(function (_ref2, _ref) {
450
467
  var _ref2$type = _ref2.type,
451
468
  type = _ref2$type === void 0 ? 'text' : _ref2$type,
452
469
  isRequired = _ref2.isRequired,
453
- leftElement = _ref2.leftElement,
454
- rightElement = _ref2.rightElement,
455
470
  props = _objectWithoutPropertiesLoose(_ref2, _excluded$1);
456
471
 
457
- return /*#__PURE__*/React.createElement(InputGroup, null, leftElement && leftElement, /*#__PURE__*/React.createElement(Input$2, Object.assign({
472
+ return /*#__PURE__*/React.createElement(Input$2, Object.assign({
458
473
  ref: _ref,
459
474
  type: type,
460
475
  isRequired: isRequired
461
- }, props)), rightElement && rightElement);
476
+ }, props));
462
477
  });
463
478
 
464
479
  /**
@@ -485,7 +500,60 @@ var StackedRadioGroup = /*#__PURE__*/React.forwardRef(function (_ref2, _ref) {
485
500
  })));
486
501
  });
487
502
 
488
- var _excluded$2 = ["isRequired", "options", "onChange"];
503
+ var SubtractIcon = "<svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M2 12C0.89543 12 -3.91405e-08 11.1046 -8.74228e-08 10L-4.37114e-07 2C-4.85396e-07 0.895431 0.89543 -3.91405e-08 2 -8.74228e-08L10 -4.37114e-07C11.1046 -4.85396e-07 12 0.89543 12 2L12 10C12 11.1046 11.1046 12 10 12L2 12ZM6 2.5C6.13261 2.5 6.25979 2.55268 6.35355 2.64645L7.85355 4.14645C8.04881 4.34171 8.04881 4.65829 7.85355 4.85355C7.65829 5.04882 7.34171 5.04882 7.14645 4.85355L6 3.70711L4.85355 4.85355C4.65829 5.04882 4.34171 5.04882 4.14645 4.85355C3.95118 4.65829 3.95118 4.34171 4.14645 4.14645L5.64645 2.64645C5.74021 2.55268 5.86739 2.5 6 2.5ZM5.64645 9.35355C5.74021 9.44732 5.86739 9.5 6 9.5C6.13261 9.5 6.25978 9.44732 6.35355 9.35355L7.85355 7.85355C8.04882 7.65829 8.04882 7.34171 7.85355 7.14645C7.65829 6.95118 7.34171 6.95118 7.14645 7.14645L6 8.29289L4.85355 7.14645C4.65829 6.95118 4.34171 6.95118 4.14645 7.14645C3.95118 7.34171 3.95118 7.65829 4.14645 7.85355L5.64645 9.35355Z\" fill=\"#0082FF\"/>\n</svg>";
504
+
505
+ /**
506
+ * A functional React component utilized to render the `Dropdown` component
507
+ */
508
+
509
+ var Dropdown = function Dropdown(_ref) {
510
+ var onSelectItem = _ref.onSelectItem,
511
+ options = _ref.options;
512
+ var DropdownContent = useMemo(function () {
513
+ return options.map(function (option, idx) {
514
+ return /*#__PURE__*/React.createElement(React.Fragment, null, option.value === 'section_header' && options[idx + 1] && options[idx + 1].value !== 'section_header' && /*#__PURE__*/React.createElement(Box, {
515
+ color: colors$1.label.secondary.light,
516
+ fontSize: "13px",
517
+ fontWeight: "bold",
518
+ px: "8px"
519
+ }, idx > 0 && /*#__PURE__*/React.createElement(Box, {
520
+ my: "3px",
521
+ borderTop: "2px solid",
522
+ borderColor: colors$1.border["default"]
523
+ }), option.label), option.value !== 'section_header' && /*#__PURE__*/React.createElement(Box, {
524
+ cursor: "pointer",
525
+ borderRadius: "inherit",
526
+ onClick: function onClick() {
527
+ return onSelectItem(option);
528
+ },
529
+ key: option.value,
530
+ fontSize: "13px",
531
+ px: "8px",
532
+ py: "4px",
533
+ color: colors$1.label.primary.light,
534
+ _hover: {
535
+ color: colors$1.label.primary.dark,
536
+ bg: colors$1.fill.blue,
537
+ borderRadius: '4px'
538
+ }
539
+ }, option.label));
540
+ });
541
+ }, [onSelectItem, options]);
542
+ return /*#__PURE__*/React.createElement(Box, {
543
+ bg: colors$1.fill.light,
544
+ backdropFilter: "blur(64px)",
545
+ borderRadius: "4px",
546
+ mt: "3px",
547
+ maxH: "320px",
548
+ overflowY: "auto",
549
+ px: "8px",
550
+ py: "4px",
551
+ position: "absolute",
552
+ width: "100%"
553
+ }, DropdownContent);
554
+ };
555
+
556
+ var _excluded$2 = ["isRequired", "options", "name", "setValue", "onChange"];
489
557
  /**
490
558
  * A functional React component utilized to render the `StackedSelect` component.
491
559
  */
@@ -493,19 +561,63 @@ var _excluded$2 = ["isRequired", "options", "onChange"];
493
561
  var StackedSelect = /*#__PURE__*/React.forwardRef(function (_ref2, _ref) {
494
562
  var isRequired = _ref2.isRequired,
495
563
  options = _ref2.options,
496
- onChange = _ref2.onChange,
564
+ name = _ref2.name,
565
+ setValue = _ref2.setValue,
497
566
  props = _objectWithoutPropertiesLoose(_ref2, _excluded$2);
498
567
 
499
- return /*#__PURE__*/React.createElement(InputGroup, null, /*#__PURE__*/React.createElement(Select$1, Object.assign({
568
+ var dropdownRef = useRef(null);
569
+
570
+ var _useState = useState(false),
571
+ isFocussed = _useState[0],
572
+ setIsFocussed = _useState[1];
573
+
574
+ var _useState2 = useState(''),
575
+ selectedOption = _useState2[0],
576
+ setSelectedOption = _useState2[1];
577
+
578
+ useOutsideClick({
579
+ ref: dropdownRef,
580
+ handler: function handler() {
581
+ return setIsFocussed(false);
582
+ }
583
+ });
584
+
585
+ var handleOnSelectItem = function handleOnSelectItem(option) {
586
+ setValue(name, option.value);
587
+ setSelectedOption(option.label);
588
+ setIsFocussed(false);
589
+ };
590
+
591
+ return /*#__PURE__*/React.createElement(Box, {
592
+ ref: dropdownRef,
593
+ position: "relative"
594
+ }, /*#__PURE__*/React.createElement(InputGroup, null, /*#__PURE__*/React.createElement(Input$2, Object.assign({
595
+ isRequired: isRequired
596
+ }, props, {
500
597
  ref: _ref,
501
- isRequired: isRequired,
502
- onChange: onChange
503
- }, props), options.map(function (option) {
504
- return /*#__PURE__*/React.createElement("option", {
505
- value: option.value,
506
- key: option.value
507
- }, option.label);
508
- })));
598
+ onClick: function onClick() {
599
+ return setIsFocussed(!isFocussed);
600
+ },
601
+ cursor: "pointer",
602
+ color: "transparent",
603
+ fontSize: "13px",
604
+ textShadow: "0 0 0 " + colors$1.label.primary.light,
605
+ value: selectedOption
606
+ })), /*#__PURE__*/React.createElement(InputRightElement, {
607
+ cursor: "pointer",
608
+ onClick: function onClick() {
609
+ return setIsFocussed(!isFocussed);
610
+ }
611
+ }, /*#__PURE__*/React.createElement(Image, {
612
+ src: SubtractIcon,
613
+ alt: "subtract",
614
+ boxSize: "16px"
615
+ }))), isFocussed && /*#__PURE__*/React.createElement(Dropdown, {
616
+ onSelectItem: function onSelectItem(option) {
617
+ return handleOnSelectItem(option);
618
+ },
619
+ options: options
620
+ }));
509
621
  });
510
622
 
511
623
  /**
@@ -520,36 +632,29 @@ var StackedTextarea = /*#__PURE__*/React.forwardRef(function (_ref2, _ref) {
520
632
  }, props));
521
633
  });
522
634
 
523
- var InputTag = function InputTag(_ref) {
524
- var value = _ref.value,
635
+ var CloseIcon = "<svg width=\"56\" height=\"56\" viewBox=\"0 0 56 56\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M27.9995 56C43.4635 56 55.9995 43.464 55.9995 28C55.9995 12.536 43.4635 0 27.9995 0C12.5355 0 -0.000488281 12.536 -0.000488281 28C-0.000488281 43.464 12.5355 56 27.9995 56ZM21.9807 18.2688C20.9555 17.2437 19.2935 17.2437 18.2684 18.2688C17.2432 19.294 17.2432 20.956 18.2684 21.9812L24.2872 28L18.2684 34.0188C17.2432 35.044 17.2432 36.706 18.2684 37.7312C19.2935 38.7563 20.9555 38.7563 21.9807 37.7312L27.9995 31.7123L34.0184 37.7312C35.0435 38.7563 36.7055 38.7563 37.7307 37.7312C38.7558 36.706 38.7558 35.044 37.7307 34.0188L31.7118 28L37.7307 21.9812C38.7558 20.956 38.7558 19.294 37.7307 18.2688C36.7055 17.2437 35.0435 17.2437 34.0184 18.2688L27.9995 24.2877L21.9807 18.2688Z\" fill=\"#3C3C43\" fill-opacity=\"0.6\"/>\n</svg>";
636
+
637
+ var Token = function Token(_ref) {
638
+ var label = _ref.label,
525
639
  onDelete = _ref.onDelete;
526
- return /*#__PURE__*/React.createElement(Tag, {
527
- size: 'md',
528
- key: value,
640
+ return /*#__PURE__*/React.createElement(Flex, {
641
+ key: label,
529
642
  borderRadius: "full",
530
- variant: "solid",
531
- backgroundColor: "#eeeeee"
532
- }, /*#__PURE__*/React.createElement(TagLabel, {
533
- color: 'gray.700'
534
- }, value), onDelete && /*#__PURE__*/React.createElement(TagCloseButton, {
535
- color: 'gray.700',
536
- onClick: onDelete
537
- }));
538
- };
539
-
540
- /**
541
- * A functional React Component utilized to render the custom `MultiValue` component for
542
- * the `StackedMultiSelect` custom component.
543
- */
544
-
545
- var MultiValue = function MultiValue(_ref) {
546
- var children = _ref.children,
547
- clearValue = _ref.clearValue;
548
- return /*#__PURE__*/React.createElement(Box, {
549
- marginRight: "5px"
550
- }, /*#__PURE__*/React.createElement(InputTag, {
551
- value: children,
552
- onDelete: clearValue
643
+ backgroundColor: "#7676801F",
644
+ alignItems: "center",
645
+ width: "fit-content",
646
+ pl: "8px",
647
+ pr: "4px",
648
+ py: "2px"
649
+ }, /*#__PURE__*/React.createElement(Text$2, {
650
+ color: colors$1.label.primary.light,
651
+ fontSize: "13px"
652
+ }, label), /*#__PURE__*/React.createElement(Image, {
653
+ pl: "4px",
654
+ boxSize: "16px",
655
+ src: CloseIcon,
656
+ onClick: onDelete,
657
+ cursor: "pointer"
553
658
  }));
554
659
  };
555
660
 
@@ -561,131 +666,136 @@ var StackedMultiSelect = /*#__PURE__*/React.forwardRef(function (_ref2, _ref) {
561
666
  var options = _ref2.options,
562
667
  setValue = _ref2.setValue,
563
668
  control = _ref2.control,
564
- name = _ref2.name;
669
+ name = _ref2.name,
670
+ placeholder = _ref2.placeholder,
671
+ disabled = _ref2.disabled;
565
672
  var watchedValue = useWatch({
566
673
  control: control,
567
674
  name: name
568
675
  });
676
+ var dropdownRef = useRef(null);
569
677
 
570
- var _useState = useState(''),
571
- inputValue = _useState[0],
572
- setInputValue = _useState[1];
678
+ var _useState = useState([]),
679
+ localValues = _useState[0],
680
+ setLocalValues = _useState[1];
681
+
682
+ var _useState2 = useState(options),
683
+ localOptions = _useState2[0],
684
+ setLocalOptions = _useState2[1];
573
685
 
574
- var _useState2 = useState([]),
575
- localValue = _useState2[0],
576
- setLocalValue = _useState2[1]; // gets latest watched form value (common delimited) from RHF state and creates a list
686
+ var _useState3 = useState(false),
687
+ isFocussed = _useState3[0],
688
+ setIsFocussed = _useState3[1];
577
689
 
690
+ useOutsideClick({
691
+ ref: dropdownRef,
692
+ handler: function handler() {
693
+ return setIsFocussed(false);
694
+ }
695
+ }); // gets latest watched form value (common delimited) from RHF state and creates a list
578
696
 
579
697
  useEffect(function () {
580
698
  if (watchedValue !== undefined && !watchedValue.length) {
581
- setLocalValue([]);
699
+ setLocalValues([]);
582
700
  }
583
701
 
584
702
  if (watchedValue !== undefined && watchedValue != null && watchedValue.length) {
585
- setLocalValue(watchedValue.split(',').filter(Boolean).map(function (value) {
703
+ setLocalValues(watchedValue.split(',').filter(Boolean).map(function (value) {
586
704
  return options.find(function (option) {
587
705
  return option.value === value;
588
706
  });
589
707
  }));
590
708
  }
591
709
  }, [options, watchedValue]);
592
- var component = {
593
- DropdownIndicator: null,
594
- MultiValue: function MultiValue$1(props) {
595
- return /*#__PURE__*/React.createElement(MultiValue, {
596
- clearValue: function clearValue() {
597
- var arrayValue = watchedValue.split(',').filter(function (_, index) {
598
- return index !== props.index;
599
- });
600
- setLocalValue(arrayValue.map(function (value) {
601
- return options.find(function (option) {
602
- return option.value === value;
603
- });
604
- }));
605
- setValue(name, arrayValue.join(','), {
606
- shouldValidate: true,
607
- shouldDirty: true
608
- });
609
- }
610
- }, props.children);
611
- }
612
- };
613
710
 
614
- var handleChange = function handleChange(values) {
615
- setValue(name, values.map(function (_ref3) {
711
+ var handleChange = function handleChange(option) {
712
+ var newValue = [].concat(localValues, [option]).map(function (_ref3) {
616
713
  var value = _ref3.value;
617
714
  return value;
618
- }).join(','), {
715
+ }).join(',');
716
+ setValue(name, newValue, {
619
717
  shouldValidate: true,
620
718
  shouldDirty: true
621
719
  });
720
+ setLocalOptions(function (prevLocalOptions) {
721
+ return prevLocalOptions.filter(function (prevLocalOption) {
722
+ return prevLocalOption !== option;
723
+ });
724
+ });
725
+ setLocalValues(function (prevLocalValues) {
726
+ return [].concat(prevLocalValues, [option]);
727
+ });
622
728
  };
623
729
 
624
- var handleInputChange = function handleInputChange(value, action) {
625
- if (action.action === 'input-change' && action !== 'set-value') {
626
- return setInputValue(value);
627
- } // reset on select of an option
628
-
629
-
630
- return setInputValue('');
631
- };
632
-
633
- var formatGroupLabel = function formatGroupLabel(data) {
634
- return /*#__PURE__*/React.createElement(Flex, {
635
- alignItems: "center",
636
- justifyContent: "space-between"
637
- }, /*#__PURE__*/React.createElement("span", null, data.label));
730
+ var handleDelete = function handleDelete(option) {
731
+ var newValue = localValues.filter(function (localValue) {
732
+ return localValue !== option;
733
+ }).map(function (_ref4) {
734
+ var value = _ref4.value;
735
+ return value;
736
+ }).join(',');
737
+ setValue(name, newValue, {
738
+ shouldValidate: true,
739
+ shouldDirty: true
740
+ });
741
+ setLocalOptions(function (prevLocalOptions) {
742
+ return [].concat(prevLocalOptions, [option]).sort(function (a, b) {
743
+ return a.sortValue - b.sortValue;
744
+ });
745
+ });
746
+ setLocalValues(function (prevLocalValues) {
747
+ return prevLocalValues.filter(function (prevLocalValue) {
748
+ return prevLocalValue !== option;
749
+ });
750
+ });
638
751
  };
639
752
 
640
- var customStyles = {
641
- control: function control() {
642
- return {
643
- borderRadius: '6px',
644
- fontSize: '16px',
645
- color: '#202020',
646
- backgroundColor: '#FFFFFF',
647
- border: '1px solid',
648
- borderColor: colors.gray[200],
649
- minHeight: '48px',
650
- display: 'flex',
651
- padding: '2px 6px'
652
- };
653
- },
654
- menu: function menu() {
655
- return {
656
- boxShadow: '0 5px 5px 0 rgba(16, 27, 79, 0.15)',
657
- borderRadius: '6px',
658
- backgroundColor: 'white'
659
- };
753
+ return /*#__PURE__*/React.createElement(Box, {
754
+ ref: dropdownRef,
755
+ position: "relative"
756
+ }, /*#__PURE__*/React.createElement(Flex, {
757
+ fontSize: "13px",
758
+ border: isFocussed ? '2px solid' : '1px solid',
759
+ borderColor: isFocussed ? colors.border.focus : colors.border["default"],
760
+ py: "5px",
761
+ pl: "8px",
762
+ borderRadius: "4px",
763
+ alignItems: "center",
764
+ justifyContent: "space-between",
765
+ onClick: function onClick() {
766
+ return !disabled && setIsFocussed(true);
660
767
  },
661
- indicatorsContainer: function indicatorsContainer() {
662
- return {
663
- display: 'none'
664
- };
768
+ bg: disabled ? colors.fill.light : '#ffffff',
769
+ cursor: disabled ? 'not-allowed' : 'pointer'
770
+ }, /*#__PURE__*/React.createElement(Flex, {
771
+ height: "28px",
772
+ alignItems: "center"
773
+ }, localValues.length ? localValues.map(function (option) {
774
+ return /*#__PURE__*/React.createElement(Box, {
775
+ mr: "4px"
776
+ }, /*#__PURE__*/React.createElement(Token, {
777
+ label: option.label,
778
+ onDelete: function onDelete() {
779
+ return handleDelete(option);
780
+ }
781
+ }));
782
+ }) : /*#__PURE__*/React.createElement(Text$2, {
783
+ color: colors.label.secondary.light,
784
+ fontSize: "13px"
785
+ }, placeholder)), /*#__PURE__*/React.createElement(Flex, {
786
+ width: "39px",
787
+ justifyContent: "center",
788
+ alignItems: "center"
789
+ }, /*#__PURE__*/React.createElement(Image, {
790
+ src: SubtractIcon,
791
+ alt: "subtract",
792
+ boxSize: "16px"
793
+ }))), isFocussed && /*#__PURE__*/React.createElement(Dropdown, {
794
+ onSelectItem: function onSelectItem(option) {
795
+ return handleChange(option);
665
796
  },
666
- placeholder: function placeholder() {
667
- return {
668
- color: '#CBCDCF',
669
- fontSize: '16px'
670
- };
671
- }
672
- };
673
- return /*#__PURE__*/React.createElement(ReactSelect, {
674
- components: component,
675
- inputValue: inputValue,
676
- value: localValue,
677
- isClearable: true,
678
- isSearchable: true,
679
- isMulti: true,
680
- menuPortalTarget: document.body,
681
- menuPosition: 'fixed',
682
- onChange: handleChange,
683
- onInputChange: handleInputChange,
684
- styles: customStyles,
685
- options: options,
686
- placeholder: false,
687
- formatGroupLabel: formatGroupLabel
688
- });
797
+ options: localOptions
798
+ }));
689
799
  });
690
800
 
691
801
  /**
@@ -695,7 +805,9 @@ var StackedMultiSelect = /*#__PURE__*/React.forwardRef(function (_ref2, _ref) {
695
805
  var StackedPilledInput = /*#__PURE__*/React.forwardRef(function (_ref2, _ref) {
696
806
  var name = _ref2.name,
697
807
  setValue = _ref2.setValue,
698
- control = _ref2.control;
808
+ control = _ref2.control,
809
+ placeholder = _ref2.placeholder,
810
+ disabled = _ref2.disabled;
699
811
  var watchedValue = useWatch({
700
812
  control: control,
701
813
  name: name
@@ -706,14 +818,19 @@ var StackedPilledInput = /*#__PURE__*/React.forwardRef(function (_ref2, _ref) {
706
818
  setLatestFormValueToArray = _useState[1];
707
819
 
708
820
  var inputRef = useRef(null);
821
+ var inputWrapperRef = useRef(null);
709
822
 
710
- var _useState2 = useState(false),
711
- isInputFocused = _useState2[0],
712
- setInputFocused = _useState2[1];
823
+ var _useState2 = useState(null),
824
+ tokenIndex = _useState2[0],
825
+ setTokenIndex = _useState2[1];
713
826
 
714
- var _useState3 = useState(''),
715
- localValue = _useState3[0],
716
- setLocalValue = _useState3[1]; // gets latest watched form value (common delimited) from RHF state and creates a list
827
+ var _useState3 = useState(false),
828
+ isFocussed = _useState3[0],
829
+ setIsFocussed = _useState3[1];
830
+
831
+ var _useState4 = useState(''),
832
+ localValue = _useState4[0],
833
+ setLocalValue = _useState4[1]; // gets latest watched form value (common delimited) from RHF state and creates a list
717
834
 
718
835
 
719
836
  useEffect(function () {
@@ -724,17 +841,24 @@ var StackedPilledInput = /*#__PURE__*/React.forwardRef(function (_ref2, _ref) {
724
841
  if (watchedValue !== undefined && watchedValue != null && watchedValue.length) {
725
842
  setLatestFormValueToArray(watchedValue.split(',').filter(Boolean));
726
843
  }
727
- }, [watchedValue]); // ensures after value addition that the input field is wiped
728
-
729
- useEffect(function () {
730
- if (localValue === ' ' || localValue.trim() === ',') {
731
- setLocalValue('');
732
- }
733
- }, [localValue]);
844
+ }, [watchedValue]);
734
845
 
735
846
  var onHandleKeyDown = function onHandleKeyDown(e) {
736
847
  if (e.key === ' ' || e.key === 'Enter' || e.key === ',') {
737
- if (!localValue.trim() || localValue.trim() === ',') return setLocalValue('');
848
+ if (e.key === 'Enter' && !localValue.trim().length && tokenIndex !== null) {
849
+ setLocalValue(lastestFormValueToArray[tokenIndex]);
850
+
851
+ var _filteredUniqueValues = Array.from(new Set(lastestFormValueToArray.filter(function (value) {
852
+ return value !== lastestFormValueToArray[tokenIndex];
853
+ })));
854
+
855
+ setValue(name, _filteredUniqueValues.toString().replace(/\s/g, ''), {
856
+ shouldValidate: true,
857
+ shouldDirty: true
858
+ });
859
+ return setTokenIndex(null);
860
+ }
861
+
738
862
  var filteredUniqueValues = Array.from(new Set([].concat(lastestFormValueToArray, localValue.trim().split(','))));
739
863
  setLocalValue('');
740
864
  return setValue(name, filteredUniqueValues.toString().replace(/\s/g, ''), {
@@ -742,6 +866,46 @@ var StackedPilledInput = /*#__PURE__*/React.forwardRef(function (_ref2, _ref) {
742
866
  shouldDirty: true
743
867
  });
744
868
  }
869
+
870
+ if (!localValue.trim().length && lastestFormValueToArray.length) {
871
+ if (e.key === 'Backspace' && tokenIndex !== null) {
872
+ setLocalValue(lastestFormValueToArray[tokenIndex].substring(0, lastestFormValueToArray[tokenIndex].length));
873
+
874
+ var _filteredUniqueValues2 = Array.from(new Set([].concat(lastestFormValueToArray).filter(function (value) {
875
+ return value !== lastestFormValueToArray[tokenIndex];
876
+ })));
877
+
878
+ setValue(name, _filteredUniqueValues2.toString().replace(/\s/g, ''), {
879
+ shouldValidate: true,
880
+ shouldDirty: true
881
+ });
882
+ return setTokenIndex(null);
883
+ }
884
+
885
+ if (e.key === 'ArrowLeft') {
886
+ if (tokenIndex === 0) return;
887
+
888
+ if (!tokenIndex) {
889
+ return setTokenIndex(lastestFormValueToArray.length - 1);
890
+ }
891
+
892
+ return setTokenIndex(function (prevTokenIndex) {
893
+ return prevTokenIndex - 1;
894
+ });
895
+ }
896
+
897
+ if (e.key === 'ArrowRight') {
898
+ if (tokenIndex === null) return;
899
+
900
+ if (tokenIndex === lastestFormValueToArray.length - 1) {
901
+ return setTokenIndex(null);
902
+ }
903
+
904
+ return setTokenIndex(function (prevTokenIndex) {
905
+ return prevTokenIndex + 1;
906
+ });
907
+ }
908
+ }
745
909
  };
746
910
 
747
911
  var onRemoveTag = function onRemoveTag(index) {
@@ -765,65 +929,77 @@ var StackedPilledInput = /*#__PURE__*/React.forwardRef(function (_ref2, _ref) {
765
929
  setLocalValue('');
766
930
  }
767
931
 
768
- setInputFocused(false);
932
+ setIsFocussed(false);
769
933
  };
770
934
 
771
- return /*#__PURE__*/React.createElement(Flex, {
772
- position: "relative",
773
- width: "100%"
774
- }, /*#__PURE__*/React.createElement(Box, {
775
- outline: isInputFocused ? '2px solid rgba(0, 122, 255, 255)' : '',
776
- borderRadius: isInputFocused ? 'md' : '',
777
- width: "100%"
935
+ useOutsideClick({
936
+ ref: inputWrapperRef,
937
+ handler: onBlur
938
+ });
939
+ return /*#__PURE__*/React.createElement(Box, {
940
+ position: "relative"
778
941
  }, /*#__PURE__*/React.createElement(Flex, {
779
- background: "rgba(255, 255, 255, 0.8)",
780
- border: "1px solid",
781
- borderColor: colors.gray[200],
782
- borderRadius: "6px",
783
- fontWeight: "400",
784
- fontSize: "12px",
785
- lineHeight: "12px",
786
- minHeight: "48px",
787
- letterSpacing: "0.02em",
788
- padding: "0 12px",
789
- pt: lastestFormValueToArray.length ? '12px' : '0px',
942
+ fontSize: "13px",
943
+ border: isFocussed ? '2px solid' : '1px solid',
944
+ borderColor: isFocussed ? colors.border.focus : colors.border["default"],
945
+ py: "5px",
946
+ pl: "8px",
947
+ borderRadius: "4px",
790
948
  alignItems: "center",
791
- flexWrap: "wrap",
792
- gap: "0.5em",
793
- width: "100%",
949
+ justifyContent: "space-between",
794
950
  onClick: function onClick() {
795
- var _inputRef$current;
951
+ if (!disabled) {
952
+ var _inputRef$current;
796
953
 
797
- return (_inputRef$current = inputRef.current) == null ? void 0 : _inputRef$current.focus();
798
- }
799
- }, lastestFormValueToArray.map(function (tag, index) {
800
- return /*#__PURE__*/React.createElement(InputTag, {
801
- value: tag,
802
- key: tag,
954
+ (_inputRef$current = inputRef.current) == null ? void 0 : _inputRef$current.focus();
955
+ }
956
+ },
957
+ bg: disabled ? colors.fill.light : '#ffffff',
958
+ cursor: disabled ? 'not-allowed' : 'pointer',
959
+ ref: inputWrapperRef
960
+ }, /*#__PURE__*/React.createElement(Flex, {
961
+ height: "28px",
962
+ alignItems: "center",
963
+ width: "fit-content"
964
+ }, lastestFormValueToArray.length ? lastestFormValueToArray.map(function (label, index) {
965
+ return /*#__PURE__*/React.createElement(Box, {
966
+ mr: "4px",
967
+ border: tokenIndex === index ? "2px solid " + colors.border.focus : 'none',
968
+ borderRadius: "full",
969
+ onClick: function onClick() {
970
+ return setTokenIndex(index);
971
+ }
972
+ }, /*#__PURE__*/React.createElement(Token, {
973
+ label: label,
803
974
  onDelete: function onDelete(e) {
804
975
  e.stopPropagation();
805
976
  e.preventDefault();
806
977
  onRemoveTag(index);
807
978
  }
808
- });
809
- }), /*#__PURE__*/React.createElement(Input$2, {
979
+ }));
980
+ }) : /*#__PURE__*/React.createElement(Text$2, {
981
+ color: colors.label.secondary.light,
982
+ fontSize: "13px"
983
+ }, placeholder)), /*#__PURE__*/React.createElement(Flex, {
984
+ flex: 1
985
+ }, /*#__PURE__*/React.createElement(Input$2, {
810
986
  onKeyDown: onHandleKeyDown,
811
987
  type: "text",
812
- padding: isInputFocused ? '0.5em 0' : '0px',
813
- height: isInputFocused ? '46px' : '0px',
988
+ padding: 0,
814
989
  width: "100%",
815
990
  border: "none",
991
+ height: "26px",
992
+ color: tokenIndex !== null ? 'transparent' : colors.label.primary,
816
993
  _focus: {
817
994
  boxShadow: 'none !important'
818
995
  },
819
996
  value: localValue,
820
- onBlur: onBlur,
821
997
  onChange: function onChange(e) {
822
- return setLocalValue(e.target.value);
998
+ return tokenIndex === null && setLocalValue(e.target.value);
823
999
  },
824
1000
  ref: inputRef,
825
1001
  onFocus: function onFocus() {
826
- return setInputFocused(true);
1002
+ return setIsFocussed(true);
827
1003
  }
828
1004
  }))));
829
1005
  });
@@ -849,6 +1025,19 @@ var StackedSwitch = /*#__PURE__*/React.forwardRef(function (_ref2, _ref) {
849
1025
  });
850
1026
  });
851
1027
 
1028
+ /**
1029
+ * A functional React component utilized to render the `Label` component
1030
+ */
1031
+
1032
+ var Label$1 = function Label(_ref) {
1033
+ var isRequired = _ref.isRequired,
1034
+ label = _ref.label;
1035
+ return /*#__PURE__*/React.createElement(FormLabel$1, null, label, isRequired && /*#__PURE__*/React.createElement(Box, {
1036
+ ml: 1,
1037
+ color: colors$1.label.error
1038
+ }, "*"));
1039
+ };
1040
+
852
1041
  /**
853
1042
  * A functional React component utilized to render the `Input` component. Utilizes a switch statement
854
1043
  * to render the correct input based on the `inputType`.
@@ -862,8 +1051,6 @@ function Input(_ref) {
862
1051
  placeholder = _ref.placeholder,
863
1052
  name = _ref.name,
864
1053
  helperText = _ref.helperText,
865
- leftElement = _ref.leftElement,
866
- rightElement = _ref.rightElement,
867
1054
  options = _ref.options,
868
1055
  isInvalid = _ref.isInvalid,
869
1056
  errorText = _ref.errorText,
@@ -885,8 +1072,6 @@ function Input(_ref) {
885
1072
  placeholder: placeholder,
886
1073
  maxLength: maxLength,
887
1074
  isRequired: isRequired,
888
- leftElement: leftElement,
889
- rightElement: rightElement,
890
1075
  isInvalid: isInvalid,
891
1076
  onChange: onChange,
892
1077
  onBlur: onBlur,
@@ -920,9 +1105,12 @@ function Input(_ref) {
920
1105
  options: options,
921
1106
  onChange: onChange,
922
1107
  onBlur: onBlur,
1108
+ setValue: setValue,
1109
+ control: control,
923
1110
  ref: ref,
924
1111
  disabled: disabled,
925
- value: value
1112
+ value: value,
1113
+ placeholder: placeholder
926
1114
  });
927
1115
 
928
1116
  case 'textarea':
@@ -968,7 +1156,8 @@ function Input(_ref) {
968
1156
  disabled: disabled,
969
1157
  value: value,
970
1158
  setValue: setValue,
971
- control: control
1159
+ control: control,
1160
+ placeholder: placeholder
972
1161
  });
973
1162
 
974
1163
  case 'pilled-text':
@@ -1002,7 +1191,7 @@ function Input(_ref) {
1002
1191
  default:
1003
1192
  return null;
1004
1193
  }
1005
- }, [ariaLabel, className, control, disabled, inputType, isInvalid, isRequired, leftElement, maxLength, name, options, placeholder, rightElement, setValue]);
1194
+ }, [ariaLabel, className, control, disabled, inputType, isInvalid, isRequired, maxLength, name, options, placeholder, setValue]);
1006
1195
  return /*#__PURE__*/React.createElement(Controller, {
1007
1196
  control: control,
1008
1197
  name: name,
@@ -1021,14 +1210,10 @@ function Input(_ref) {
1021
1210
  isInvalid: isInvalid,
1022
1211
  position: "relative",
1023
1212
  py: label ? 6 : 0
1024
- }, label && /*#__PURE__*/React.createElement(FormLabel$1, {
1025
- position: "absolute",
1026
- top: 0,
1027
- display: "flex"
1028
- }, label, isRequired && /*#__PURE__*/React.createElement(Box, {
1029
- ml: 1,
1030
- color: "red.500"
1031
- }, "*")), selectedInputField(onChange ? onChange : fieldOnChange, onBlur, ref, value), isInvalid ? /*#__PURE__*/React.createElement(FormErrorMessage, null, errorText) : helperText && /*#__PURE__*/React.createElement(FormHelperText, null, helperText));
1213
+ }, label && /*#__PURE__*/React.createElement(Label$1, {
1214
+ label: label,
1215
+ isRequired: isRequired
1216
+ }), selectedInputField(onChange ? onChange : fieldOnChange, onBlur, ref, value), isInvalid ? /*#__PURE__*/React.createElement(FormErrorMessage, null, errorText) : helperText && /*#__PURE__*/React.createElement(FormHelperText, null, helperText));
1032
1217
  }
1033
1218
  });
1034
1219
  }
@@ -1152,7 +1337,7 @@ var Layout = function Layout(_ref) {
1152
1337
  onClick: function onClick() {
1153
1338
  return setShow(!show);
1154
1339
  },
1155
- icon: show ? /*#__PURE__*/React.createElement(CloseIcon, null) : /*#__PURE__*/React.createElement(HamburgerIcon, null),
1340
+ icon: show ? /*#__PURE__*/React.createElement(CloseIcon$1, null) : /*#__PURE__*/React.createElement(HamburgerIcon, null),
1156
1341
  _focus: {
1157
1342
  boxShadow: 'none'
1158
1343
  }
@@ -1452,7 +1637,7 @@ var baseStyle = {
1452
1637
  function variantPositive() {
1453
1638
  return {
1454
1639
  container: {
1455
- bg: '#d8f1b8'
1640
+ bg: colors.fill.positive
1456
1641
  }
1457
1642
  };
1458
1643
  }
@@ -1460,7 +1645,7 @@ function variantPositive() {
1460
1645
  function variantWarning() {
1461
1646
  return {
1462
1647
  container: {
1463
- bg: '#ffefb4'
1648
+ bg: colors.fill.warning
1464
1649
  }
1465
1650
  };
1466
1651
  }
@@ -1468,7 +1653,7 @@ function variantWarning() {
1468
1653
  function variantError() {
1469
1654
  return {
1470
1655
  container: {
1471
- bg: '#ffbdb9'
1656
+ bg: colors.fill.error
1472
1657
  }
1473
1658
  };
1474
1659
  }
@@ -1476,7 +1661,7 @@ function variantError() {
1476
1661
  function variantNeutral() {
1477
1662
  return {
1478
1663
  container: {
1479
- bg: '#7474800D'
1664
+ bg: colors.fill.light
1480
1665
  }
1481
1666
  };
1482
1667
  }
@@ -1788,26 +1973,26 @@ var Code = {
1788
1973
 
1789
1974
  var parts$1 = ['requiredIndicator', 'helperText'];
1790
1975
 
1791
- function baseStyleRequiredIndicator(props) {
1976
+ function baseStyleRequiredIndicator() {
1792
1977
  return {
1793
1978
  ml: 1,
1794
- color: mode('red.500', 'red.300')(props)
1979
+ color: colors.label.error
1795
1980
  };
1796
1981
  }
1797
1982
 
1798
- function baseStyleHelperText(props) {
1983
+ function baseStyleHelperText() {
1799
1984
  return {
1985
+ color: colors.label.secondary.light,
1800
1986
  mt: 1,
1801
- color: mode('gray.400', 'whiteAlpha.600')(props),
1802
- lineHeight: 'normal',
1803
- fontSize: 'sm'
1987
+ ml: 1,
1988
+ fontSize: '13px'
1804
1989
  };
1805
1990
  }
1806
1991
 
1807
- var baseStyle$4 = function baseStyle(props) {
1992
+ var baseStyle$4 = function baseStyle() {
1808
1993
  return {
1809
- requiredIndicator: baseStyleRequiredIndicator(props),
1810
- helperText: baseStyleHelperText(props)
1994
+ requiredIndicator: baseStyleRequiredIndicator(),
1995
+ helperText: baseStyleHelperText()
1811
1996
  };
1812
1997
  };
1813
1998
 
@@ -1818,26 +2003,26 @@ var Form$1 = {
1818
2003
 
1819
2004
  var parts$2 = ['text', 'icon'];
1820
2005
 
1821
- function baseStyleText(props) {
2006
+ function baseStyleText() {
1822
2007
  return {
1823
- color: mode('red.500', 'red.300')(props),
2008
+ color: colors.label.error,
1824
2009
  mt: 1,
1825
- lineHeight: 'normal',
1826
- fontSize: 'sm'
2010
+ ml: 1,
2011
+ fontSize: '13px'
1827
2012
  };
1828
2013
  }
1829
2014
 
1830
- function baseStyleIcon(props) {
2015
+ function baseStyleIcon() {
1831
2016
  return {
1832
- mr: '0.5em',
1833
- color: mode('red.500', 'red.300')(props)
2017
+ ml: 1,
2018
+ color: colors.label.error
1834
2019
  };
1835
2020
  }
1836
2021
 
1837
- var baseStyle$5 = function baseStyle(props) {
2022
+ var baseStyle$5 = function baseStyle() {
1838
2023
  return {
1839
- text: baseStyleText(props),
1840
- icon: baseStyleIcon(props)
2024
+ text: baseStyleText(),
2025
+ icon: baseStyleIcon()
1841
2026
  };
1842
2027
  };
1843
2028
 
@@ -1847,228 +2032,51 @@ var FormError = {
1847
2032
  };
1848
2033
 
1849
2034
  var baseStyle$6 = {
1850
- fontSize: 'md',
1851
- mr: 3,
2035
+ fontSize: '13px',
2036
+ position: 'absolute',
2037
+ top: 0,
2038
+ display: 'flex',
2039
+ ml: 1,
1852
2040
  mb: 1,
1853
- fontWeight: 'bold',
1854
- color: 'gray.700',
1855
- transition: 'all 0.2s',
1856
- opacity: 1,
1857
- _disabled: {
1858
- opacity: 0.4
1859
- }
2041
+ color: colors.label.primary.light,
2042
+ opacity: 1
1860
2043
  };
1861
2044
  var FormLabel = {
1862
2045
  baseStyle: baseStyle$6
1863
2046
  };
1864
2047
 
1865
- var parts$3 = ['field', 'addon'];
2048
+ var parts$3 = ['field'];
1866
2049
  var baseStyle$7 = {
1867
2050
  field: {
1868
- width: '100%',
1869
- outline: 0,
1870
- position: 'relative',
1871
- appearance: 'none',
1872
- transition: 'all 0.2s',
2051
+ fontSize: '13px',
1873
2052
  '::placeholder': {
1874
- color: 'gray.300'
1875
- }
1876
- }
1877
- };
1878
- var size = {
1879
- lg: {
1880
- fontSize: 'md',
1881
- pl: 3,
1882
- pr: 3,
1883
- h: 12,
1884
- borderRadius: 'md'
1885
- },
1886
- md: {
1887
- fontSize: 'md',
1888
- pl: 3,
1889
- pr: 3,
1890
- h: 10,
1891
- borderRadius: 'md'
1892
- },
1893
- sm: {
1894
- fontSize: 'sm',
1895
- pl: 3,
1896
- pr: 3,
1897
- h: 8,
1898
- borderRadius: 'sm'
1899
- }
1900
- };
1901
- var sizes$1 = {
1902
- lg: {
1903
- field: size.lg,
1904
- addon: size.lg
1905
- },
1906
- md: {
1907
- field: size.md,
1908
- addon: size.md
1909
- },
1910
- sm: {
1911
- field: size.sm,
1912
- addon: size.sm
1913
- }
1914
- };
1915
-
1916
- function getDefaults(props) {
1917
- var fc = props.focusBorderColor,
1918
- ec = props.errorBorderColor;
1919
- return {
1920
- focusBorderColor: fc || mode('blue.500', 'blue.300')(props),
1921
- errorBorderColor: ec || mode('red.500', 'red.300')(props)
1922
- };
1923
- }
1924
-
1925
- function variantOutline$2(props) {
1926
- var theme = props.theme;
1927
-
1928
- var _getDefaults = getDefaults(props),
1929
- fc = _getDefaults.focusBorderColor,
1930
- ec = _getDefaults.errorBorderColor;
1931
-
1932
- return {
1933
- field: {
1934
- border: '1px solid',
1935
- borderColor: 'inherit',
1936
- bg: 'white',
1937
- _hover: {
1938
- borderColor: mode('gray.300', 'whiteAlpha.400')(props)
1939
- },
1940
- _readOnly: {
1941
- boxShadow: 'none !important',
1942
- userSelect: 'all'
1943
- },
1944
- _disabled: {
1945
- opacity: 0.4,
1946
- cursor: 'not-allowed'
1947
- },
1948
- _focus: {
1949
- zIndex: 1,
1950
- borderColor: getColor(theme, fc),
1951
- boxShadow: "0 0 0 2px " + transparentize(fc, 0.3)(theme)
1952
- },
1953
- _invalid: {
1954
- borderColor: getColor(theme, ec),
1955
- boxShadow: 'none',
1956
- _focus: {
1957
- boxShadow: "0 0 0 2px " + transparentize(ec, 0.3)(theme)
1958
- }
1959
- }
2053
+ color: colors.label.secondary.light
1960
2054
  },
1961
- addon: {
1962
- border: '1px solid',
1963
- borderColor: mode('inherit', 'whiteAlpha.50')(props),
1964
- bg: mode('gray.100', 'whiteAlpha.300')(props)
1965
- }
1966
- };
1967
- }
1968
-
1969
- function variantFilled(props) {
1970
- var theme = props.theme;
1971
-
1972
- var _getDefaults2 = getDefaults(props),
1973
- fc = _getDefaults2.focusBorderColor,
1974
- ec = _getDefaults2.errorBorderColor;
1975
-
1976
- return {
1977
- field: {
1978
- border: '2px solid',
1979
- borderColor: 'transparent',
1980
- bg: mode('gray.50', 'whiteAlpha.50')(props),
1981
- _hover: {
1982
- bg: mode('gray.100', 'whiteAlpha.100')(props)
1983
- },
1984
- _readOnly: {
1985
- boxShadow: 'none !important',
1986
- userSelect: 'all'
1987
- },
1988
- _disabled: {
1989
- opacity: 0.4,
1990
- cursor: 'not-allowed'
1991
- },
1992
- _focus: {
1993
- bg: 'transparent',
1994
- borderColor: getColor(theme, fc)
1995
- },
1996
- _invalid: {
1997
- borderColor: getColor(theme, ec)
1998
- }
2055
+ py: '5px',
2056
+ px: '8px',
2057
+ border: '1px solid',
2058
+ borderColor: colors.border["default"],
2059
+ _disabled: {
2060
+ cursor: 'not-allowed',
2061
+ bg: colors.fill.light,
2062
+ color: colors.label.secondary.light
1999
2063
  },
2000
- addon: {
2064
+ _focus: {
2065
+ bg: '#ffffff',
2001
2066
  border: '2px solid',
2002
- borderColor: 'transparent',
2003
- bg: mode('gray.100', 'whiteAlpha.50')(props)
2067
+ borderColor: colors.border.focus
2004
2068
  }
2005
- };
2006
- }
2007
-
2008
- function variantFlushed(props) {
2009
- var theme = props.theme;
2010
-
2011
- var _getDefaults3 = getDefaults(props),
2012
- fc = _getDefaults3.focusBorderColor,
2013
- ec = _getDefaults3.errorBorderColor;
2014
-
2015
- return {
2016
- field: {
2017
- borderBottom: '1px solid inherit',
2018
- borderRadius: 0,
2019
- pl: 0,
2020
- pr: 0,
2021
- bg: 'transparent',
2022
- _readOnly: {
2023
- boxShadow: 'none !important',
2024
- userSelect: 'all'
2025
- },
2026
- _focus: {
2027
- borderColor: getColor(theme, fc),
2028
- boxShadow: "0px 1px 0px 0px " + getColor(theme, fc)
2029
- },
2030
- _invalid: {
2031
- borderColor: getColor(theme, ec)
2032
- }
2033
- },
2034
- addon: {
2035
- borderBottom: '2px solid',
2036
- borderColor: 'inherit',
2037
- borderRadius: 0,
2038
- paddingX: 0,
2039
- bg: 'transparent'
2040
- }
2041
- };
2042
- }
2043
-
2044
- var variantUnstyled$1 = {
2045
- field: {
2046
- bg: 'transparent',
2047
- pl: 0,
2048
- pr: 0,
2049
- height: 'auto'
2050
- },
2051
- addon: {
2052
- bg: 'transparent',
2053
- pl: 0,
2054
- pr: 0,
2055
- height: 'auto'
2056
2069
  }
2057
2070
  };
2058
2071
  var variants$4 = {
2059
- outline: variantOutline$2,
2060
- filled: variantFilled,
2061
- flushed: variantFlushed,
2062
- unstyled: variantUnstyled$1
2072
+ "default": baseStyle$7
2063
2073
  };
2064
2074
  var defaultProps$4 = {
2065
- size: 'lg',
2066
- variant: 'outline'
2075
+ variant: 'default'
2067
2076
  };
2068
2077
  var Input$1 = {
2069
2078
  parts: parts$3,
2070
2079
  baseStyle: baseStyle$7,
2071
- sizes: sizes$1,
2072
2080
  variants: variants$4,
2073
2081
  defaultProps: defaultProps$4
2074
2082
  };
@@ -2413,7 +2421,7 @@ function getSize(value) {
2413
2421
  };
2414
2422
  }
2415
2423
 
2416
- var sizes$2 = {
2424
+ var sizes$1 = {
2417
2425
  xs: /*#__PURE__*/getSize('xs'),
2418
2426
  sm: /*#__PURE__*/getSize('sm'),
2419
2427
  md: /*#__PURE__*/getSize('md'),
@@ -2446,24 +2454,22 @@ var defaultProps$5 = {
2446
2454
  var Modal = {
2447
2455
  parts: parts$5,
2448
2456
  baseStyle: baseStyle$a,
2449
- sizes: sizes$2,
2457
+ sizes: sizes$1,
2450
2458
  variants: variants$6,
2451
2459
  defaultProps: defaultProps$5
2452
2460
  };
2453
2461
 
2454
- var sizes$3 = Input$1.sizes,
2455
- defaultProps$6 = Input$1.defaultProps,
2462
+ var defaultProps$6 = Input$1.defaultProps,
2456
2463
  variants$7 = Input$1.variants;
2457
2464
  var parts$6 = ['field', 'icon'];
2458
2465
 
2459
- function baseStyleField(props) {
2466
+ function baseStyleField() {
2460
2467
  return _extends({}, Input$1.baseStyle.field, {
2461
2468
  appearance: 'none',
2462
2469
  paddingBottom: '1px',
2463
2470
  lineHeight: 'normal',
2464
2471
  bg: 'white',
2465
- '> option': {
2466
- bg: mode('white', 'gray.700')(props)
2472
+ '> option': {// bg: mode('white', 'gray.700')(props),
2467
2473
  }
2468
2474
  });
2469
2475
  }
@@ -2476,9 +2482,9 @@ var baseStyleInput = {
2476
2482
  }
2477
2483
  };
2478
2484
 
2479
- var baseStyle$b = function baseStyle(props) {
2485
+ var baseStyle$b = function baseStyle() {
2480
2486
  return {
2481
- field: baseStyleField(props),
2487
+ field: baseStyleField(),
2482
2488
  icon: baseStyleInput
2483
2489
  };
2484
2490
  };
@@ -2486,7 +2492,6 @@ var baseStyle$b = function baseStyle(props) {
2486
2492
  var Select = {
2487
2493
  parts: parts$6,
2488
2494
  baseStyle: baseStyle$b,
2489
- sizes: sizes$3,
2490
2495
  variants: variants$7,
2491
2496
  defaultProps: defaultProps$6
2492
2497
  };
@@ -2531,7 +2536,7 @@ var baseStyle$c = function baseStyle(props) {
2531
2536
  };
2532
2537
  };
2533
2538
 
2534
- var sizes$4 = {
2539
+ var sizes$2 = {
2535
2540
  sm: {
2536
2541
  track: {
2537
2542
  w: '1.375rem',
@@ -2579,7 +2584,7 @@ var defaultProps$7 = {
2579
2584
  var Switch = {
2580
2585
  parts: parts$7,
2581
2586
  baseStyle: baseStyle$c,
2582
- sizes: sizes$4,
2587
+ sizes: sizes$2,
2583
2588
  defaultProps: defaultProps$7
2584
2589
  };
2585
2590
 
@@ -2632,7 +2637,7 @@ var baseStyle$d = function baseStyle(props) {
2632
2637
  };
2633
2638
  };
2634
2639
 
2635
- var sizes$5 = {
2640
+ var sizes$3 = {
2636
2641
  sm: {
2637
2642
  tab: {
2638
2643
  py: '0.25rem',
@@ -2773,7 +2778,7 @@ function variantSolidRounded(props) {
2773
2778
  };
2774
2779
  }
2775
2780
 
2776
- var variantUnstyled$2 = {};
2781
+ var variantUnstyled$1 = {};
2777
2782
  var variantSimple = {
2778
2783
  tab: {
2779
2784
  position: 'relative',
@@ -2808,7 +2813,7 @@ var variants$8 = {
2808
2813
  'enclosed-colored': variantEnclosedColored,
2809
2814
  'soft-rounded': variantSoftRounded,
2810
2815
  'solid-rounded': variantSolidRounded,
2811
- unstyled: variantUnstyled$2,
2816
+ unstyled: variantUnstyled$1,
2812
2817
  simple: variantSimple
2813
2818
  };
2814
2819
  var defaultProps$8 = {
@@ -2819,7 +2824,7 @@ var defaultProps$8 = {
2819
2824
  var Tabs = {
2820
2825
  parts: parts$8,
2821
2826
  baseStyle: baseStyle$d,
2822
- sizes: sizes$5,
2827
+ sizes: sizes$3,
2823
2828
  variants: variants$8,
2824
2829
  defaultProps: defaultProps$8
2825
2830
  };
@@ -2827,55 +2832,15 @@ var Tabs = {
2827
2832
  var baseStyle$e = /*#__PURE__*/_extends({}, Input$1.baseStyle.field, {
2828
2833
  display: 'block',
2829
2834
  paddingY: '8px',
2830
- minHeight: '80px',
2835
+ height: '80px',
2831
2836
  lineHeight: 'short'
2832
2837
  });
2833
2838
 
2834
- var codeVariant = function codeVariant(props) {
2835
- var _focus = Input$1.variants.outline(props).field._focus;
2836
-
2837
- return {
2838
- bg: 'blue.900',
2839
- color: 'white',
2840
- fontFamily: 'mono',
2841
- fontSize: 'sm',
2842
- border: '1px',
2843
- borderColor: 'blue.900',
2844
- borderRadius: 'lg',
2845
- p: 6,
2846
- wordBreak: 'break-all',
2847
- _focus: _focus
2848
- };
2849
- };
2850
-
2851
- var variants$9 = {
2852
- outline: function outline(props) {
2853
- return Input$1.variants.outline(props).field;
2854
- },
2855
- flushed: function flushed(props) {
2856
- return Input$1.variants.flushed(props).field;
2857
- },
2858
- filled: function filled(props) {
2859
- return Input$1.variants.filled(props).field;
2860
- },
2861
- code: function code(props) {
2862
- return codeVariant(props);
2863
- },
2864
- unstyled: Input$1.variants.unstyled.field
2865
- };
2866
- var sizes$6 = {
2867
- sm: Input$1.sizes.sm.field,
2868
- md: Input$1.sizes.md.field,
2869
- lg: Input$1.sizes.lg.field
2870
- };
2871
2839
  var defaultProps$9 = {
2872
- size: 'lg',
2873
- variant: 'outline'
2840
+ variant: 'default'
2874
2841
  };
2875
2842
  var Textarea = {
2876
2843
  baseStyle: baseStyle$e,
2877
- sizes: sizes$6,
2878
- variants: variants$9,
2879
2844
  defaultProps: defaultProps$9
2880
2845
  };
2881
2846
 
@@ -2910,16 +2875,16 @@ function variantParagraph() {
2910
2875
  return baseStyle$f;
2911
2876
  }
2912
2877
 
2913
- var variants$a = {
2878
+ var variants$9 = {
2914
2879
  header: variantHeader,
2915
2880
  subheader: variantSubheader,
2916
2881
  paragraph: variantParagraph
2917
2882
  };
2918
2883
  var Text$1 = {
2919
2884
  baseStyle: baseStyle$f,
2920
- variants: variants$a,
2885
+ variants: variants$9,
2921
2886
  defaultProps: /*#__PURE__*/_extends({}, defaultProps$a, {
2922
- variant: variants$a.paragraph
2887
+ variant: variants$9.paragraph
2923
2888
  })
2924
2889
  };
2925
2890