@xqmsg/ui-core 0.15.4 → 0.16.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.
@@ -1,5 +1,5 @@
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, Box, Flex, 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, 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';
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';
@@ -50,7 +50,9 @@ var Banner = function Banner(_ref) {
50
50
  var variant = _ref.variant,
51
51
  message = _ref.message,
52
52
  buttonText = _ref.buttonText,
53
- onClick = _ref.onClick;
53
+ onClick = _ref.onClick,
54
+ _ref$type = _ref.type,
55
+ type = _ref$type === void 0 ? 'expanded' : _ref$type;
54
56
  var Icon = useMemo(function () {
55
57
  switch (variant) {
56
58
  case 'error':
@@ -87,18 +89,24 @@ var Banner = function Banner(_ref) {
87
89
  }, [variant]);
88
90
  return /*#__PURE__*/React__default.createElement(Alert$1, {
89
91
  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"
92
+ }, /*#__PURE__*/React__default.createElement(AlertDescription, null, /*#__PURE__*/React__default.createElement(Flex, {
93
+ flexDirection: type === 'condensed' ? 'row' : 'column',
94
+ alignItems: type === 'condensed' ? 'center' : ''
95
+ }, /*#__PURE__*/React__default.createElement(Box, {
96
+ pr: "8px"
97
+ }, Icon), /*#__PURE__*/React__default.createElement(Box, {
98
+ pt: type === 'condensed' ? 0 : '8px'
99
+ }, " ", message), onClick && buttonText && /*#__PURE__*/React__default.createElement(Flex, {
100
+ ml: type === 'condensed' ? 'auto' : '',
101
+ pt: type === 'condensed' ? 0 : '8px',
102
+ justifyContent: type === 'condensed' ? 'flex-end' : 'flex-end'
95
103
  }, /*#__PURE__*/React__default.createElement(Button, {
96
104
  variant: "secondary",
97
105
  onClick: onClick,
98
106
  text: buttonText,
99
107
  width: "variable",
100
108
  ariaLabel: "banner button"
101
- }))));
109
+ })))));
102
110
  };
103
111
 
104
112
  var blue = {
@@ -366,12 +374,12 @@ var SpinnerButton = function SpinnerButton(_ref) {
366
374
  type = _ref.type,
367
375
  ariaLabel = _ref.ariaLabel,
368
376
  _ref$variant = _ref.variant,
369
- variant = _ref$variant === void 0 ? 'solid' : _ref$variant,
377
+ variant = _ref$variant === void 0 ? 'primary' : _ref$variant,
370
378
  disabled = _ref.disabled,
371
379
  className = _ref.className;
372
380
  return /*#__PURE__*/React__default.createElement(Button$2, {
373
381
  spinner: /*#__PURE__*/React__default.createElement(Spinner, {
374
- size: 'md'
382
+ size: 'sm'
375
383
  }),
376
384
  isLoading: isLoading,
377
385
  onClick: onClick,
@@ -595,7 +603,7 @@ function useOnClickOutside(ref, handler) {
595
603
  [ref, handler]);
596
604
  }
597
605
 
598
- var _excluded$1 = ["isRequired", "options", "name", "setValue", "handleOnChange", "value"];
606
+ var _excluded$1 = ["isRequired", "options", "name", "setValue", "handleOnChange", "disabled", "value"];
599
607
  /**
600
608
  * A functional React component utilized to render the `StackedSelect` component.
601
609
  */
@@ -608,6 +616,7 @@ var StackedSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref
608
616
  name = _ref2.name,
609
617
  setValue = _ref2.setValue,
610
618
  handleOnChange = _ref2.handleOnChange,
619
+ disabled = _ref2.disabled,
611
620
  value = _ref2.value,
612
621
  props = _objectWithoutPropertiesLoose(_ref2, _excluded$1);
613
622
 
@@ -676,6 +685,7 @@ var StackedSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref
676
685
  fontSize: "13px",
677
686
  textShadow: "0 0 0 " + colors.label.primary.light,
678
687
  value: selectedOption,
688
+ disabled: disabled,
679
689
  autoComplete: "off",
680
690
  onKeyDown: function onKeyDown(e) {
681
691
  if (isFocussed) {
@@ -696,9 +706,9 @@ var StackedSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref
696
706
  }
697
707
  }
698
708
  })), /*#__PURE__*/React__default.createElement(InputRightElement, {
699
- cursor: "pointer",
709
+ cursor: disabled ? 'not-allowed' : 'pointer',
700
710
  onClick: function onClick() {
701
- return setIsFocussed(!isFocussed);
711
+ return !disabled && setIsFocussed(!isFocussed);
702
712
  }
703
713
  }, /*#__PURE__*/React__default.createElement(Image, {
704
714
  src: SubtractIcon,
@@ -1805,7 +1815,7 @@ var EmptyTable = function EmptyTable() {
1805
1815
  return i + 1;
1806
1816
  }).map(function (i) {
1807
1817
  return /*#__PURE__*/React__default.createElement(Tr, null, /*#__PURE__*/React__default.createElement(Td, {
1808
- height: "23px",
1818
+ height: "26px",
1809
1819
  opacity: getOpacity(i)
1810
1820
  }));
1811
1821
  })));
@@ -2067,6 +2077,7 @@ var baseStyle$2 = /*#__PURE__*/defineStyle({
2067
2077
  fontSize: '13px',
2068
2078
  bg: colors.fill.action,
2069
2079
  color: colors.label.primary.dark,
2080
+ h: '26px',
2070
2081
  border: 'none',
2071
2082
  px: '8px',
2072
2083
  py: '4px',
@@ -2710,8 +2721,12 @@ var baseStyle$c = {
2710
2721
  },
2711
2722
  tr: {
2712
2723
  fontSize: '13px',
2724
+ h: '26px',
2725
+ lineHeight: 'normal',
2713
2726
  _odd: {
2714
2727
  td: {
2728
+ h: '26px ',
2729
+ lineHeight: 'normal',
2715
2730
  bg: colors.fill.light.tertiary,
2716
2731
  _first: {
2717
2732
  borderTopLeftRadius: 'md',
@@ -2725,7 +2740,9 @@ var baseStyle$c = {
2725
2740
  }
2726
2741
  },
2727
2742
  td: {
2728
- padding: '5px 8px !important'
2743
+ padding: '5px 8px !important',
2744
+ lineHeight: 'normal',
2745
+ h: '26px'
2729
2746
  }
2730
2747
  };
2731
2748
  var Table$1 = {
@@ -2996,7 +3013,7 @@ var baseStyle$f = {
2996
3013
  fontWeight: typography.fontWeights.normal,
2997
3014
  fontFamily: typography.fonts.base,
2998
3015
  fontSize: typography.fontSizes.sm,
2999
- lineHeight: typography.lineHeights.base,
3016
+ lineHeight: typography.lineHeights.normal,
3000
3017
  letterSpacing: typography.letterSpacings.wide
3001
3018
  };
3002
3019
 
@@ -3044,7 +3061,8 @@ var styles = {
3044
3061
  overflow: {
3045
3062
  base: 'visible',
3046
3063
  lg: 'hidden'
3047
- }
3064
+ },
3065
+ lineHeight: 'normal'
3048
3066
  },
3049
3067
  '*, *::before, *::after': {
3050
3068
  borderColor: 'gray.200'