@xqmsg/ui-core 0.16.0 → 0.16.2

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.
@@ -1,8 +1,8 @@
1
1
  import React__default, { useMemo, useCallback, useRef, useEffect, useState, memo, forwardRef, createElement } from 'react';
2
- import { Button as Button$2, Image, Alert as Alert$1, AlertDescription, Flex, Box, Text as Text$2, Icon as Icon$1, Spinner, Checkbox, Input as Input$2, InputGroup, RadioGroup, Radio, InputRightElement, Textarea as Textarea$1, useOutsideClick, Switch as Switch$1, FormLabel as FormLabel$1, FormControl, FormErrorMessage, FormHelperText, SimpleGrid, useMediaQuery, Grid, GridItem, IconButton, Collapse, Table as Table$2, Tbody, Tr, Td, TableContainer, Thead, Th, Tabs as Tabs$1, TabList, Tab, extendTheme } from '@chakra-ui/react';
2
+ import { Button as Button$2, Image, Alert as Alert$1, AlertDescription, Flex, Box, Text as Text$2, Icon as Icon$1, Spinner, Checkbox, InputGroup, Input as Input$2, RadioGroup, Radio, InputRightElement, Textarea as Textarea$1, useOutsideClick, Switch as Switch$1, FormLabel as FormLabel$1, Tooltip, FormControl, FormErrorMessage, FormHelperText, SimpleGrid, useMediaQuery, Grid, GridItem, IconButton, Collapse, Table as Table$2, Tbody, Tr, Td, TableContainer, Thead, Th, Tabs as Tabs$1, TabList, Tab, extendTheme } from '@chakra-ui/react';
3
3
  import { FormProvider, useWatch, Controller } from 'react-hook-form';
4
- import { truncate } from 'lodash-es';
5
- import { CloseIcon, HamburgerIcon } from '@chakra-ui/icons';
4
+ import { debounce, truncate } from 'lodash-es';
5
+ import { QuestionOutlineIcon, CloseIcon, HamburgerIcon } from '@chakra-ui/icons';
6
6
  import { HiOutlineRefresh } from 'react-icons/hi';
7
7
  import { ChakraProvider } from '@chakra-ui/provider';
8
8
  import { createBreakpoints, transparentize, mode, getColor } from '@chakra-ui/theme-tools';
@@ -454,7 +454,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
454
454
  return target;
455
455
  }
456
456
 
457
- var _excluded = ["type", "isRequired"];
457
+ var _excluded = ["type", "isRequired", "rightElement", "leftElement"];
458
458
  /**
459
459
  * A functional React component utilized to render the `StackedInput` component.
460
460
  */
@@ -463,13 +463,16 @@ var StackedInput = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref)
463
463
  var _ref2$type = _ref2.type,
464
464
  type = _ref2$type === void 0 ? 'text' : _ref2$type,
465
465
  isRequired = _ref2.isRequired,
466
+ rightElement = _ref2.rightElement,
467
+ leftElement = _ref2.leftElement,
466
468
  props = _objectWithoutPropertiesLoose(_ref2, _excluded);
467
469
 
468
- return /*#__PURE__*/React__default.createElement(Input$2, Object.assign({
469
- ref: _ref,
470
+ return /*#__PURE__*/React__default.createElement(InputGroup, null, leftElement && leftElement, /*#__PURE__*/React__default.createElement(Input$2, Object.assign({
470
471
  type: type,
471
472
  isRequired: isRequired
472
- }, props));
473
+ }, props, {
474
+ ref: _ref
475
+ })), rightElement && rightElement);
473
476
  });
474
477
 
475
478
  /**
@@ -506,7 +509,8 @@ var Dropdown = function Dropdown(_ref) {
506
509
  var onSelectItem = _ref.onSelectItem,
507
510
  options = _ref.options,
508
511
  dropdownRef = _ref.dropdownRef,
509
- position = _ref.position;
512
+ position = _ref.position,
513
+ optionIndex = _ref.optionIndex;
510
514
  var DropdownContent = useMemo(function () {
511
515
  return options.map(function (option, idx) {
512
516
  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, {
@@ -533,18 +537,19 @@ var Dropdown = function Dropdown(_ref) {
533
537
  px: "8px",
534
538
  py: "4px",
535
539
  width: "100%",
536
- color: colors.label.primary.light,
540
+ color: optionIndex === idx ? colors.label.primary.dark : colors.label.primary.light,
537
541
  _hover: {
538
542
  color: colors.label.primary.dark,
539
543
  bg: colors.fill.action,
540
544
  borderRadius: '4px',
541
545
  width: '100%'
542
546
  },
543
- bg: "inherit",
544
- whiteSpace: "nowrap"
547
+ bg: optionIndex === idx ? colors.fill.action : 'inherit',
548
+ whiteSpace: "nowrap",
549
+ id: option.value
545
550
  }, option.label));
546
551
  });
547
- }, [onSelectItem, options]);
552
+ }, [onSelectItem, optionIndex, options]);
548
553
  return /*#__PURE__*/React__default.createElement(Flex, {
549
554
  flexDirection: "column",
550
555
  ref: dropdownRef,
@@ -633,9 +638,21 @@ var StackedSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref
633
638
  selectedOption = _useState2[0],
634
639
  setSelectedOption = _useState2[1];
635
640
 
636
- var _useState3 = useState('top'),
637
- position = _useState3[0],
638
- setPosition = _useState3[1];
641
+ var _useState3 = useState(null),
642
+ optionIndex = _useState3[0],
643
+ setOptionIndex = _useState3[1];
644
+
645
+ var _useState4 = useState('top'),
646
+ position = _useState4[0],
647
+ setPosition = _useState4[1];
648
+
649
+ var _useState5 = useState(''),
650
+ searchValue = _useState5[0],
651
+ setSearchValue = _useState5[1];
652
+
653
+ var _useState6 = useState(''),
654
+ debouncedSearchValue = _useState6[0],
655
+ setDebouncedSearchValue = _useState6[1];
639
656
 
640
657
  var boundingClientRect = (_dropdownRef$current = dropdownRef.current) == null ? void 0 : _dropdownRef$current.getBoundingClientRect();
641
658
  useEffect(function () {
@@ -670,6 +687,92 @@ var StackedSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref
670
687
  setIsFocussed(false);
671
688
  };
672
689
 
690
+ var handleOnKeyDown = function handleOnKeyDown(e) {
691
+ var initialOptionIndex = options[0].value === 'section_header' ? 1 : 0;
692
+
693
+ if (!isFocussed && (e.key === 'Enter' || e.key === 'ArrowUp' || e.key === 'ArrowDown')) {
694
+ setIsFocussed(true);
695
+ return setOptionIndex(initialOptionIndex);
696
+ }
697
+
698
+ if (isFocussed) {
699
+ if (optionIndex === null && (e.key === 'Enter' || e.key === 'ArrowUp' || e.key === 'ArrowDown')) {
700
+ return setOptionIndex(initialOptionIndex);
701
+ }
702
+
703
+ if (e.key === 'ArrowUp' && optionIndex !== null && optionIndex > 0) {
704
+ var _dropdownMenuRef$curr;
705
+
706
+ var incrementValue = options[optionIndex - 1] && options[optionIndex - 1].value === 'section_header' ? 2 : 1;
707
+ setOptionIndex(optionIndex - incrementValue);
708
+ return (_dropdownMenuRef$curr = dropdownMenuRef.current) == null ? void 0 : _dropdownMenuRef$curr.scrollTo({
709
+ top: optionIndex * 24,
710
+ behavior: 'smooth'
711
+ });
712
+ }
713
+
714
+ if (e.key === 'ArrowDown' && optionIndex !== null && optionIndex < options.length) {
715
+ var _dropdownMenuRef$curr2;
716
+
717
+ var _incrementValue = options[optionIndex + 1] && options[optionIndex + 1].value === 'section_header' ? 2 : 1;
718
+
719
+ setOptionIndex(optionIndex + _incrementValue);
720
+ return (_dropdownMenuRef$curr2 = dropdownMenuRef.current) == null ? void 0 : _dropdownMenuRef$curr2.scrollTo({
721
+ top: optionIndex * 24,
722
+ behavior: 'smooth'
723
+ });
724
+ }
725
+
726
+ if (e.key === 'Enter' && optionIndex !== null) {
727
+ var option = options.find(function (_, idx) {
728
+ return optionIndex === idx;
729
+ });
730
+ if (!option) return;
731
+
732
+ if (handleOnChange) {
733
+ handleOnChange(option.value);
734
+ }
735
+
736
+ setSelectedOption(option == null ? void 0 : option.label);
737
+ setValue(name, option.value, {
738
+ shouldDirty: true,
739
+ shouldValidate: true
740
+ });
741
+ return setIsFocussed(false);
742
+ }
743
+
744
+ if (e.key === 'Tab') {
745
+ return setIsFocussed(false);
746
+ }
747
+ }
748
+ };
749
+
750
+ useEffect(function () {
751
+ if (searchValue.length) {
752
+ var _dropdownMenuRef$curr3;
753
+
754
+ var idx = options.findIndex(function (option) {
755
+ return option.label.substring(0, searchValue.length).toLowerCase() === searchValue.toLowerCase();
756
+ });
757
+ (_dropdownMenuRef$curr3 = dropdownMenuRef.current) == null ? void 0 : _dropdownMenuRef$curr3.scrollTo({
758
+ top: idx * 24,
759
+ behavior: 'smooth'
760
+ });
761
+ setSearchValue('');
762
+ setDebouncedSearchValue('');
763
+ }
764
+ }, [options, searchValue]);
765
+ var updateSearchValue = useMemo(function () {
766
+ return debounce(function (val) {
767
+ setSearchValue(val);
768
+ }, 1000);
769
+ }, []);
770
+
771
+ var update = function update(value) {
772
+ updateSearchValue(value);
773
+ setDebouncedSearchValue(value);
774
+ };
775
+
673
776
  return /*#__PURE__*/React__default.createElement(Box, {
674
777
  ref: dropdownRef,
675
778
  position: "relative"
@@ -687,24 +790,10 @@ var StackedSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref
687
790
  value: selectedOption,
688
791
  disabled: disabled,
689
792
  autoComplete: "off",
690
- onKeyDown: function onKeyDown(e) {
691
- if (isFocussed) {
692
- var _dropdownMenuRef$curr;
693
-
694
- if (e.key === 'Tab') {
695
- return setIsFocussed(false);
696
- }
697
-
698
- var idx = options.findIndex(function (option) {
699
- return option.label[0].toLocaleLowerCase() === e.key;
700
- });
701
- console.log(idx);
702
- (_dropdownMenuRef$curr = dropdownMenuRef.current) == null ? void 0 : _dropdownMenuRef$curr.scrollTo({
703
- top: idx * 27,
704
- behavior: 'smooth'
705
- });
706
- }
707
- }
793
+ onChange: function onChange(e) {
794
+ return update(debouncedSearchValue.concat(e.target.value));
795
+ },
796
+ onKeyDown: handleOnKeyDown
708
797
  })), /*#__PURE__*/React__default.createElement(InputRightElement, {
709
798
  cursor: disabled ? 'not-allowed' : 'pointer',
710
799
  onClick: function onClick() {
@@ -720,7 +809,8 @@ var StackedSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref
720
809
  onSelectItem: function onSelectItem(option) {
721
810
  return handleOnSelectItem(option);
722
811
  },
723
- options: options
812
+ options: options,
813
+ optionIndex: optionIndex
724
814
  }));
725
815
  });
726
816
 
@@ -826,10 +916,26 @@ var StackedMultiSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2,
826
916
  shouldSideScroll = _useState4[0],
827
917
  setShouldSideScroll = _useState4[1];
828
918
 
829
- var _useState5 = useState('top'),
830
- position = _useState5[0],
831
- setPosition = _useState5[1];
919
+ var _useState5 = useState(null),
920
+ optionIndex = _useState5[0],
921
+ setOptionIndex = _useState5[1];
922
+
923
+ var _useState6 = useState('top'),
924
+ position = _useState6[0],
925
+ setPosition = _useState6[1];
926
+
927
+ var _useState7 = useState(''),
928
+ searchValue = _useState7[0],
929
+ setSearchValue = _useState7[1];
832
930
 
931
+ var _useState8 = useState(''),
932
+ debouncedSearchValue = _useState8[0],
933
+ setDebouncedSearchValue = _useState8[1];
934
+
935
+ console.log({
936
+ searchValue: searchValue,
937
+ debouncedSearchValue: debouncedSearchValue
938
+ });
833
939
  var boundingClientRect = (_dropdownRef$current = dropdownRef.current) == null ? void 0 : _dropdownRef$current.getBoundingClientRect();
834
940
  useEffect(function () {
835
941
  if (window.innerHeight - ((boundingClientRect == null ? void 0 : boundingClientRect.y) + 240) >= 0) {
@@ -909,26 +1015,89 @@ var StackedMultiSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2,
909
1015
  });
910
1016
  };
911
1017
 
912
- return /*#__PURE__*/React__default.createElement(Box, {
913
- ref: dropdownRef,
914
- position: "relative",
915
- onKeyDown: function onKeyDown(e) {
916
- if (isFocussed) {
917
- var _dropdownMenuRef$curr;
1018
+ var handleOnKeyDown = function handleOnKeyDown(e) {
1019
+ var initialOptionIndex = options[0].value === 'section_header' ? 1 : 0;
918
1020
 
919
- if (e.key === 'Tab') {
920
- return setIsFocussed(false);
921
- }
1021
+ if (!isFocussed && (e.key === 'Enter' || e.key === 'ArrowUp' || e.key === 'ArrowDown')) {
1022
+ setIsFocussed(true);
1023
+ return setOptionIndex(initialOptionIndex);
1024
+ }
922
1025
 
923
- var idx = options.findIndex(function (option) {
924
- return option.label[0].toLocaleLowerCase() === e.key;
1026
+ if (isFocussed) {
1027
+ if (optionIndex === null && (e.key === 'Enter' || e.key === 'ArrowUp' || e.key === 'ArrowDown')) {
1028
+ return setOptionIndex(initialOptionIndex);
1029
+ }
1030
+
1031
+ if (e.key === 'ArrowUp' && optionIndex !== null && optionIndex > 0) {
1032
+ var _dropdownMenuRef$curr;
1033
+
1034
+ var incrementValue = localOptions[optionIndex - 1] && localOptions[optionIndex - 1].value === 'section_header' ? 2 : 1;
1035
+ setOptionIndex(optionIndex - incrementValue);
1036
+ return (_dropdownMenuRef$curr = dropdownMenuRef.current) == null ? void 0 : _dropdownMenuRef$curr.scrollTo({
1037
+ top: optionIndex * 24,
1038
+ behavior: 'smooth'
925
1039
  });
926
- (_dropdownMenuRef$curr = dropdownMenuRef.current) == null ? void 0 : _dropdownMenuRef$curr.scrollTo({
927
- top: idx * 27,
1040
+ }
1041
+
1042
+ if (e.key === 'ArrowDown' && optionIndex !== null && optionIndex < localOptions.length) {
1043
+ var _dropdownMenuRef$curr2;
1044
+
1045
+ var _incrementValue = localOptions[optionIndex + 1] && localOptions[optionIndex + 1].value === 'section_header' ? 2 : 1;
1046
+
1047
+ setOptionIndex(optionIndex + _incrementValue);
1048
+ return (_dropdownMenuRef$curr2 = dropdownMenuRef.current) == null ? void 0 : _dropdownMenuRef$curr2.scrollTo({
1049
+ top: optionIndex * 24,
928
1050
  behavior: 'smooth'
929
1051
  });
930
1052
  }
1053
+
1054
+ if (e.key === 'Enter' && optionIndex !== null) {
1055
+ var option = localOptions.find(function (_, idx) {
1056
+ return optionIndex === idx;
1057
+ });
1058
+ if (!option) return;
1059
+ handleChange(option);
1060
+ return setIsFocussed(false);
1061
+ }
1062
+
1063
+ if (e.key === 'Tab') {
1064
+ return setIsFocussed(false);
1065
+ }
1066
+
1067
+ return update(debouncedSearchValue.concat(e.key));
931
1068
  }
1069
+ };
1070
+
1071
+ useEffect(function () {
1072
+ if (searchValue.length) {
1073
+ var _dropdownMenuRef$curr3;
1074
+
1075
+ var idx = options.findIndex(function (option) {
1076
+ return option.label.substring(0, searchValue.length).toLowerCase() === searchValue.toLowerCase();
1077
+ });
1078
+ (_dropdownMenuRef$curr3 = dropdownMenuRef.current) == null ? void 0 : _dropdownMenuRef$curr3.scrollTo({
1079
+ top: idx * 24,
1080
+ behavior: 'smooth'
1081
+ });
1082
+ setSearchValue('');
1083
+ setDebouncedSearchValue('');
1084
+ }
1085
+ }, [options, searchValue]);
1086
+ var updateSearchValue = useMemo(function () {
1087
+ return debounce(function (val) {
1088
+ setSearchValue(val);
1089
+ }, 1000);
1090
+ }, []);
1091
+
1092
+ var update = function update(value) {
1093
+ updateSearchValue(value);
1094
+ setDebouncedSearchValue(value);
1095
+ };
1096
+
1097
+ return /*#__PURE__*/React__default.createElement(Box, {
1098
+ ref: dropdownRef,
1099
+ position: "relative",
1100
+ onKeyDown: handleOnKeyDown
932
1101
  }, /*#__PURE__*/React__default.createElement(Flex, {
933
1102
  fontSize: "13px",
934
1103
  h: "26px",
@@ -1011,7 +1180,8 @@ var StackedMultiSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2,
1011
1180
  return handleChange(option);
1012
1181
  },
1013
1182
  options: localOptions,
1014
- position: position
1183
+ position: position,
1184
+ optionIndex: optionIndex
1015
1185
  }));
1016
1186
  });
1017
1187
 
@@ -1237,10 +1407,10 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
1237
1407
  onRemoveTag(index);
1238
1408
  }
1239
1409
  }));
1240
- }) : /*#__PURE__*/React__default.createElement(Text$2, {
1410
+ }) : null, !lastestFormValueToArray.length && !isFocussed ? /*#__PURE__*/React__default.createElement(Text$2, {
1241
1411
  color: colors.label.secondary.light,
1242
1412
  fontSize: "13px"
1243
- }, placeholder)), /*#__PURE__*/React__default.createElement(Flex, {
1413
+ }, placeholder) : null), /*#__PURE__*/React__default.createElement(Flex, {
1244
1414
  flex: 1,
1245
1415
  minWidth: isFocussed ? '20%' : 0
1246
1416
  }, /*#__PURE__*/React__default.createElement(Input$2, {
@@ -1300,12 +1470,22 @@ var StackedSwitch = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref
1300
1470
  */
1301
1471
 
1302
1472
  var Label$1 = function Label(_ref) {
1303
- var isRequired = _ref.isRequired,
1473
+ var tooltipText = _ref.tooltipText,
1474
+ isRequired = _ref.isRequired,
1304
1475
  label = _ref.label;
1305
- return /*#__PURE__*/React__default.createElement(FormLabel$1, null, label, isRequired && /*#__PURE__*/React__default.createElement(Box, {
1476
+ return /*#__PURE__*/React__default.createElement(FormLabel$1, {
1477
+ display: "flex",
1478
+ alignItems: "center"
1479
+ }, label, isRequired && /*#__PURE__*/React__default.createElement(Box, {
1306
1480
  ml: 1,
1307
1481
  color: colors.label.error
1308
- }, "*"));
1482
+ }, "*"), !!tooltipText && /*#__PURE__*/React__default.createElement(Tooltip, {
1483
+ label: tooltipText,
1484
+ placement: "top"
1485
+ }, /*#__PURE__*/React__default.createElement(QuestionOutlineIcon, {
1486
+ boxSize: "13px",
1487
+ ml: "8px"
1488
+ })));
1309
1489
  };
1310
1490
 
1311
1491
  /**
@@ -1322,6 +1502,7 @@ function Input(_ref) {
1322
1502
  name = _ref.name,
1323
1503
  helperText = _ref.helperText,
1324
1504
  options = _ref.options,
1505
+ tooltipText = _ref.tooltipText,
1325
1506
  isInvalid = _ref.isInvalid,
1326
1507
  errorText = _ref.errorText,
1327
1508
  isRequired = _ref.isRequired,
@@ -1329,6 +1510,8 @@ function Input(_ref) {
1329
1510
  defaultValue = _ref.defaultValue,
1330
1511
  control = _ref.control,
1331
1512
  disabled = _ref.disabled,
1513
+ rightElement = _ref.rightElement,
1514
+ leftElement = _ref.leftElement,
1332
1515
  onChange = _ref.onChange,
1333
1516
  setValue = _ref.setValue,
1334
1517
  setError = _ref.setError,
@@ -1349,6 +1532,8 @@ function Input(_ref) {
1349
1532
  onChange: onChange,
1350
1533
  onBlur: onBlur,
1351
1534
  ref: ref,
1535
+ rightElement: rightElement,
1536
+ leftElement: leftElement,
1352
1537
  disabled: disabled,
1353
1538
  value: value
1354
1539
  });
@@ -1391,6 +1576,7 @@ function Input(_ref) {
1391
1576
  className: "input-" + inputType + " " + (className != null ? className : ''),
1392
1577
  name: name,
1393
1578
  id: name,
1579
+ placeholder: placeholder,
1394
1580
  maxLength: maxLength,
1395
1581
  isInvalid: isInvalid,
1396
1582
  onChange: onChange,
@@ -1446,6 +1632,7 @@ function Input(_ref) {
1446
1632
  ref: ref,
1447
1633
  disabled: disabled,
1448
1634
  value: value,
1635
+ placeholder: placeholder,
1449
1636
  setValue: setValue,
1450
1637
  setError: setError,
1451
1638
  clearErrors: clearErrors,
@@ -1492,6 +1679,7 @@ function Input(_ref) {
1492
1679
  position: "relative",
1493
1680
  py: label || helperText || isInvalid ? 6 : 0
1494
1681
  }, label && /*#__PURE__*/React__default.createElement(Label$1, {
1682
+ tooltipText: tooltipText,
1495
1683
  label: label,
1496
1684
  isRequired: isRequired
1497
1685
  }), selectedInputField(onChange ? onChange : fieldOnChange, onBlur, ref, value), isInvalid ? /*#__PURE__*/React__default.createElement(FormErrorMessage, null, errorText) : helperText && /*#__PURE__*/React__default.createElement(FormHelperText, null, helperText));
@@ -2375,214 +2563,9 @@ var Link = {
2375
2563
  variants: variants$5
2376
2564
  };
2377
2565
 
2378
- var parts$4 = ['overlay', 'dialogContainer', 'dialog', 'header', 'closeButton', 'body', 'footer'];
2379
- var baseStyleOverlay = {
2380
- bg: 'blackAlpha.600',
2381
- zIndex: 'modal'
2382
- };
2383
-
2384
- function baseStyleDialogContainer(props) {
2385
- var scrollBehavior = props.scrollBehavior;
2386
- return {
2387
- display: 'flex',
2388
- zIndex: 'modal',
2389
- justifyContent: 'center',
2390
- alignItems: 'flex-start',
2391
- overflow: scrollBehavior === 'inside' ? 'hidden' : 'auto',
2392
- WebkitOverflowScrolling: 'touch'
2393
- };
2394
- }
2395
-
2396
- function baseStyleDialog(props) {
2397
- var isCentered = props.isCentered,
2398
- scrollBehavior = props.scrollBehavior;
2399
- return {
2400
- borderRadius: 'lg',
2401
- bg: mode('white', 'gray.700')(props),
2402
- color: 'inherit',
2403
- mt: isCentered ? {
2404
- base: 8,
2405
- md: 'auto'
2406
- } : '3.75rem',
2407
- mb: isCentered ? {
2408
- base: 20,
2409
- md: 'auto'
2410
- } : '3.75rem',
2411
- mx: 4,
2412
- zIndex: 'modal',
2413
- maxH: scrollBehavior === 'inside' ? 'calc(100vh - 7.5rem)' : undefined,
2414
- boxShadow: mode('xl', 'dark-lg')(props)
2415
- };
2416
- }
2417
-
2418
- var baseStyleHeader = {
2419
- px: 6,
2420
- py: 4,
2421
- minHeight: 20,
2422
- fontSize: 'xl',
2423
- display: 'flex',
2424
- alignItems: 'center',
2425
- fontWeight: 'bold',
2426
- bg: 'primary.900',
2427
- color: 'white',
2428
- userSelect: 'none'
2429
- };
2430
- var baseStyleCloseButton = {
2431
- position: 'absolute',
2432
- top: 2,
2433
- right: 3
2434
- };
2435
-
2436
- function baseStyleBody(props) {
2437
- var scrollBehavior = props.scrollBehavior;
2438
- return {
2439
- px: [6, null, 20],
2440
- py: 10,
2441
- flex: 1,
2442
- overflow: scrollBehavior === 'inside' ? 'auto' : undefined
2443
- };
2444
- }
2445
-
2446
- var baseStyleFooter = {
2447
- px: [6, null, 20],
2448
- pt: 5,
2449
- pb: 16
2450
- };
2451
-
2452
- var baseStyle$9 = function baseStyle(props) {
2453
- return {
2454
- overlay: baseStyleOverlay,
2455
- dialogContainer: baseStyleDialogContainer(props),
2456
- dialog: baseStyleDialog(props),
2457
- header: baseStyleHeader,
2458
- closeButton: baseStyleCloseButton,
2459
- body: baseStyleBody(props),
2460
- footer: baseStyleFooter
2461
- };
2462
- };
2463
- /**
2464
- * Since the `maxWidth` prop references theme.sizes internally,
2465
- * we can leverage that to size our modals.
2466
- */
2467
-
2468
-
2469
- function getSize(value) {
2470
- var commonBodyFooterStyles = {
2471
- xs: {
2472
- px: 8,
2473
- pb: 8
2474
- },
2475
- sm: {
2476
- px: 8,
2477
- pb: 8
2478
- },
2479
- md: {
2480
- px: 8,
2481
- pb: 8
2482
- },
2483
- lg: {
2484
- px: 10,
2485
- pb: 10
2486
- },
2487
- xl: {
2488
- px: 12,
2489
- pb: 10
2490
- }
2491
- };
2492
- var bodyStyles = {
2493
- xs: {
2494
- py: 6
2495
- },
2496
- sm: {
2497
- py: 6
2498
- },
2499
- md: {
2500
- py: 6
2501
- },
2502
- lg: {
2503
- py: 8
2504
- },
2505
- xl: {
2506
- py: 8
2507
- }
2508
- };
2509
- var footerStyles = {
2510
- xs: {
2511
- pb: 8
2512
- },
2513
- sm: {
2514
- pb: 8
2515
- },
2516
- md: {
2517
- pb: 8
2518
- },
2519
- lg: {
2520
- pb: 10
2521
- },
2522
- xl: {
2523
- pb: 10
2524
- }
2525
- };
2526
-
2527
- if (value === 'full') {
2528
- return {
2529
- content: {
2530
- maxW: '100vw',
2531
- h: '100vh'
2532
- }
2533
- };
2534
- }
2535
-
2536
- return {
2537
- content: {
2538
- maxW: value
2539
- },
2540
- body: _extends({}, commonBodyFooterStyles[value], bodyStyles[value]),
2541
- footer: _extends({}, commonBodyFooterStyles[value], footerStyles[value])
2542
- };
2543
- }
2544
-
2545
- var sizes = {
2546
- xs: /*#__PURE__*/getSize('xs'),
2547
- sm: /*#__PURE__*/getSize('sm'),
2548
- md: /*#__PURE__*/getSize('md'),
2549
- lg: /*#__PURE__*/getSize('lg'),
2550
- xl: /*#__PURE__*/getSize('xl'),
2551
- '2xl': /*#__PURE__*/getSize('2xl'),
2552
- '3xl': /*#__PURE__*/getSize('3xl'),
2553
- '4xl': /*#__PURE__*/getSize('4xl'),
2554
- '5xl': /*#__PURE__*/getSize('5xl'),
2555
- '6xl': /*#__PURE__*/getSize('6xl'),
2556
- full: /*#__PURE__*/getSize('full')
2557
- };
2558
-
2559
- var warningVariant = function warningVariant() {
2560
- return {
2561
- header: {
2562
- bg: 'warning.300',
2563
- color: 'black'
2564
- }
2565
- };
2566
- };
2567
-
2568
- var variants$6 = {
2569
- warning: warningVariant
2570
- };
2571
- var defaultProps$5 = {
2572
- size: 'lg',
2573
- isCentered: true
2574
- };
2575
- var Modal = {
2576
- parts: parts$4,
2577
- baseStyle: baseStyle$9,
2578
- sizes: sizes,
2579
- variants: variants$6,
2580
- defaultProps: defaultProps$5
2581
- };
2582
-
2583
- var defaultProps$6 = Input$1.defaultProps,
2584
- variants$7 = Input$1.variants;
2585
- var parts$5 = ['field', 'icon'];
2566
+ var defaultProps$5 = Input$1.defaultProps,
2567
+ variants$6 = Input$1.variants;
2568
+ var parts$4 = ['field', 'icon'];
2586
2569
 
2587
2570
  function baseStyleField() {
2588
2571
  return _extends({}, Input$1.baseStyle.field, {
@@ -2603,7 +2586,7 @@ var baseStyleInput = {
2603
2586
  }
2604
2587
  };
2605
2588
 
2606
- var baseStyle$a = function baseStyle() {
2589
+ var baseStyle$9 = function baseStyle() {
2607
2590
  return {
2608
2591
  field: baseStyleField(),
2609
2592
  icon: baseStyleInput
@@ -2611,13 +2594,13 @@ var baseStyle$a = function baseStyle() {
2611
2594
  };
2612
2595
 
2613
2596
  var Select = {
2614
- parts: parts$5,
2615
- baseStyle: baseStyle$a,
2616
- variants: variants$7,
2617
- defaultProps: defaultProps$6
2597
+ parts: parts$4,
2598
+ baseStyle: baseStyle$9,
2599
+ variants: variants$6,
2600
+ defaultProps: defaultProps$5
2618
2601
  };
2619
2602
 
2620
- var parts$6 = ['track', 'thumb'];
2603
+ var parts$5 = ['track', 'thumb'];
2621
2604
 
2622
2605
  function baseStyleTrack(props) {
2623
2606
  var c = props.colorScheme,
@@ -2650,14 +2633,14 @@ var baseStyleThumb = {
2650
2633
  transform: 'translateX(0)'
2651
2634
  };
2652
2635
 
2653
- var baseStyle$b = function baseStyle(props) {
2636
+ var baseStyle$a = function baseStyle(props) {
2654
2637
  return {
2655
2638
  track: baseStyleTrack(props),
2656
2639
  thumb: baseStyleThumb
2657
2640
  };
2658
2641
  };
2659
2642
 
2660
- var sizes$1 = {
2643
+ var sizes = {
2661
2644
  sm: {
2662
2645
  track: {
2663
2646
  w: '1.375rem',
@@ -2698,19 +2681,19 @@ var sizes$1 = {
2698
2681
  }
2699
2682
  }
2700
2683
  };
2701
- var defaultProps$7 = {
2684
+ var defaultProps$6 = {
2702
2685
  size: 'md',
2703
2686
  colorScheme: 'blue'
2704
2687
  };
2705
2688
  var Switch = {
2706
- parts: parts$6,
2707
- baseStyle: baseStyle$b,
2708
- sizes: sizes$1,
2709
- defaultProps: defaultProps$7
2689
+ parts: parts$5,
2690
+ baseStyle: baseStyle$a,
2691
+ sizes: sizes,
2692
+ defaultProps: defaultProps$6
2710
2693
  };
2711
2694
 
2712
- var parts$7 = ['th', 'td', 'tr', 'body', 'thead'];
2713
- var baseStyle$c = {
2695
+ var parts$6 = ['th', 'td', 'tr', 'body', 'thead'];
2696
+ var baseStyle$b = {
2714
2697
  thead: {
2715
2698
  bg: colors.label.primary.dark
2716
2699
  },
@@ -2746,11 +2729,11 @@ var baseStyle$c = {
2746
2729
  }
2747
2730
  };
2748
2731
  var Table$1 = {
2749
- parts: parts$7,
2750
- baseStyle: baseStyle$c
2732
+ parts: parts$6,
2733
+ baseStyle: baseStyle$b
2751
2734
  };
2752
2735
 
2753
- var parts$8 = ['root', 'tablist', 'tab', 'tabpanel', 'indicator'];
2736
+ var parts$7 = ['root', 'tablist', 'tab', 'tabpanel', 'indicator'];
2754
2737
 
2755
2738
  function baseStyleRoot(props) {
2756
2739
  var orientation = props.orientation;
@@ -2790,7 +2773,7 @@ var baseStyleTabpanel = {
2790
2773
  p: 4
2791
2774
  };
2792
2775
 
2793
- var baseStyle$d = function baseStyle(props) {
2776
+ var baseStyle$c = function baseStyle(props) {
2794
2777
  return {
2795
2778
  root: baseStyleRoot(props),
2796
2779
  tab: baseStyleTab(props),
@@ -2799,7 +2782,7 @@ var baseStyle$d = function baseStyle(props) {
2799
2782
  };
2800
2783
  };
2801
2784
 
2802
- var sizes$2 = {
2785
+ var sizes$1 = {
2803
2786
  sm: {
2804
2787
  tab: {
2805
2788
  py: '0.25rem',
@@ -2969,7 +2952,7 @@ var variantSimple = {
2969
2952
  }
2970
2953
  }
2971
2954
  };
2972
- var variants$8 = {
2955
+ var variants$7 = {
2973
2956
  line: variantLine,
2974
2957
  enclosed: variantEnclosed,
2975
2958
  'enclosed-colored': variantEnclosedColored,
@@ -2978,20 +2961,20 @@ var variants$8 = {
2978
2961
  unstyled: variantUnstyled,
2979
2962
  simple: variantSimple
2980
2963
  };
2981
- var defaultProps$8 = {
2964
+ var defaultProps$7 = {
2982
2965
  size: 'md',
2983
2966
  variant: 'line',
2984
2967
  colorScheme: 'blue'
2985
2968
  };
2986
2969
  var Tabs = {
2987
- parts: parts$8,
2988
- baseStyle: baseStyle$d,
2989
- sizes: sizes$2,
2990
- variants: variants$8,
2991
- defaultProps: defaultProps$8
2970
+ parts: parts$7,
2971
+ baseStyle: baseStyle$c,
2972
+ sizes: sizes$1,
2973
+ variants: variants$7,
2974
+ defaultProps: defaultProps$7
2992
2975
  };
2993
2976
 
2994
- var baseStyle$e = /*#__PURE__*/_extends({}, Input$1.baseStyle.field, {
2977
+ var baseStyle$d = /*#__PURE__*/_extends({}, Input$1.baseStyle.field, {
2995
2978
  fontSize: '13px',
2996
2979
  display: 'block',
2997
2980
  paddingY: '8px',
@@ -3000,16 +2983,16 @@ var baseStyle$e = /*#__PURE__*/_extends({}, Input$1.baseStyle.field, {
3000
2983
  lineHeight: 'short'
3001
2984
  });
3002
2985
 
3003
- var defaultProps$9 = {
2986
+ var defaultProps$8 = {
3004
2987
  variant: 'default'
3005
2988
  };
3006
2989
  var Textarea = {
3007
- baseStyle: baseStyle$e,
3008
- defaultProps: defaultProps$9
2990
+ baseStyle: baseStyle$d,
2991
+ defaultProps: defaultProps$8
3009
2992
  };
3010
2993
 
3011
- var defaultProps$a = Text$2.defaultProps;
3012
- var baseStyle$f = {
2994
+ var defaultProps$9 = Text$2.defaultProps;
2995
+ var baseStyle$e = {
3013
2996
  fontWeight: typography.fontWeights.normal,
3014
2997
  fontFamily: typography.fonts.base,
3015
2998
  fontSize: typography.fontSizes.sm,
@@ -3018,7 +3001,7 @@ var baseStyle$f = {
3018
3001
  };
3019
3002
 
3020
3003
  function variantHeader() {
3021
- return _extends({}, baseStyle$f, {
3004
+ return _extends({}, baseStyle$e, {
3022
3005
  fontWeight: typography.fontWeights.bold,
3023
3006
  fontSize: typography.fontSizes['3xl'],
3024
3007
  lineHeight: typography.lineHeights[8],
@@ -3027,7 +3010,7 @@ function variantHeader() {
3027
3010
  }
3028
3011
 
3029
3012
  function variantSubheader() {
3030
- return _extends({}, baseStyle$f, {
3013
+ return _extends({}, baseStyle$e, {
3031
3014
  fontWeight: typography.fontWeights.semibold,
3032
3015
  fontSize: typography.fontSizes['lg'],
3033
3016
  lineHeight: typography.lineHeights[5],
@@ -3036,19 +3019,19 @@ function variantSubheader() {
3036
3019
  }
3037
3020
 
3038
3021
  function variantParagraph() {
3039
- return baseStyle$f;
3022
+ return baseStyle$e;
3040
3023
  }
3041
3024
 
3042
- var variants$9 = {
3025
+ var variants$8 = {
3043
3026
  header: variantHeader,
3044
3027
  subheader: variantSubheader,
3045
3028
  paragraph: variantParagraph
3046
3029
  };
3047
3030
  var Text$1 = {
3048
- baseStyle: baseStyle$f,
3049
- variants: variants$9,
3050
- defaultProps: /*#__PURE__*/_extends({}, defaultProps$a, {
3051
- variant: variants$9.paragraph
3031
+ baseStyle: baseStyle$e,
3032
+ variants: variants$8,
3033
+ defaultProps: /*#__PURE__*/_extends({}, defaultProps$9, {
3034
+ variant: variants$8.paragraph
3052
3035
  })
3053
3036
  };
3054
3037
 
@@ -3088,7 +3071,6 @@ var customXQChakraTheme = /*#__PURE__*/extendTheme( /*#__PURE__*/_extends({
3088
3071
  FormLabel: FormLabel,
3089
3072
  Input: Input$1,
3090
3073
  Link: Link,
3091
- Modal: Modal,
3092
3074
  Select: Select,
3093
3075
  Switch: Switch,
3094
3076
  Table: Table$1,