@teamturing/react-kit 2.17.0 → 2.18.1

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/index.js CHANGED
@@ -7094,7 +7094,7 @@ const BaseActionList = styled__default.default.ul`
7094
7094
 
7095
7095
  ${sx}
7096
7096
  `;
7097
- var index$c = Object.assign(ActionList, {
7097
+ var index$d = Object.assign(ActionList, {
7098
7098
  Item: ActionListItem,
7099
7099
  SectionDivider: ActionListSectionDivider,
7100
7100
  SectionHeader: ActionListSectionHeader
@@ -16365,7 +16365,7 @@ const BaseAvatar = styled__default.default(Image)`
16365
16365
  })}
16366
16366
  ${sx}
16367
16367
  `;
16368
- var index$b = /*#__PURE__*/React.forwardRef(Avatar);
16368
+ var index$c = /*#__PURE__*/React.forwardRef(Avatar);
16369
16369
 
16370
16370
  const Tooltip = ({
16371
16371
  children,
@@ -16753,7 +16753,7 @@ const BreadcrumbsItemWrapper = styled__default.default.span`
16753
16753
  }
16754
16754
  }
16755
16755
  `;
16756
- var index$a = Object.assign(Breadcrumbs, {
16756
+ var index$b = Object.assign(Breadcrumbs, {
16757
16757
  Item: BreadcrumbsItem
16758
16758
  });
16759
16759
 
@@ -17290,7 +17290,7 @@ const BaseCheckbox = styled__default.default(UnstyledCheckbox)`
17290
17290
 
17291
17291
  ${sx}
17292
17292
  `;
17293
- var index$9 = /*#__PURE__*/React.forwardRef(Checkbox);
17293
+ var index$a = /*#__PURE__*/React.forwardRef(Checkbox);
17294
17294
 
17295
17295
  const Chip = ({
17296
17296
  children,
@@ -17643,7 +17643,7 @@ const DatagridWrapper = styled__default.default.div`
17643
17643
  const BaseDatagrid = styled__default.default.div`
17644
17644
  width: inherit;
17645
17645
  `;
17646
- var index$8 = Object.assign(Datagrid, {
17646
+ var index$9 = Object.assign(Datagrid, {
17647
17647
  Header: DatagridHeader,
17648
17648
  Subheader: DatagridSubheader,
17649
17649
  Body: DatagridBody,
@@ -18750,7 +18750,7 @@ const BaseDialog = styled__default.default.div(() => ({
18750
18750
  overflow: 'hidden',
18751
18751
  margin: 'auto'
18752
18752
  }), sx);
18753
- var index$7 = /*#__PURE__*/React.forwardRef(Dialog);
18753
+ var index$8 = /*#__PURE__*/React.forwardRef(Dialog);
18754
18754
 
18755
18755
  const useDialogHandler = () => {
18756
18756
  const [isOpen, setIsOpen] = React.useState(false);
@@ -18790,6 +18790,111 @@ const DialogHandler = ({
18790
18790
  });
18791
18791
  };
18792
18792
 
18793
+ const EmptyState = ({
18794
+ title,
18795
+ icon: Icon = SvgDocument,
18796
+ description,
18797
+ action,
18798
+ renderAction = ({
18799
+ ...buttonProps
18800
+ }, emptyStateProps) => /*#__PURE__*/jsxRuntimeExports.jsx(Button, {
18801
+ size: emptyStateProps.size,
18802
+ ...buttonProps
18803
+ }),
18804
+ size = 'm',
18805
+ sx
18806
+ }) => {
18807
+ return /*#__PURE__*/jsxRuntimeExports.jsxs(BaseEmptyState, {
18808
+ size: size,
18809
+ sx: sx,
18810
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(Icon, {}), /*#__PURE__*/jsxRuntimeExports.jsx(Text, {
18811
+ as: 'p',
18812
+ children: title
18813
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(Text, {
18814
+ children: description
18815
+ }), action ? /*#__PURE__*/jsxRuntimeExports.jsx(View, {
18816
+ children: renderAction(action, {
18817
+ size
18818
+ })
18819
+ }) : null]
18820
+ });
18821
+ };
18822
+ const BaseEmptyState = styled__default.default.div`
18823
+ display: flex;
18824
+ flex-direction: column;
18825
+ align-items: center;
18826
+
18827
+ & > svg {
18828
+ color: ${({
18829
+ theme
18830
+ }) => theme.colors['icon/neutral']};
18831
+ }
18832
+ & > p {
18833
+ color: ${({
18834
+ theme
18835
+ }) => theme.colors['text/neutral']};
18836
+ font-weight: ${({
18837
+ theme
18838
+ }) => theme.fontWeights.bold};
18839
+ line-height: ${({
18840
+ theme
18841
+ }) => theme.lineHeights[2]};
18842
+ }
18843
+ & > span {
18844
+ color: ${({
18845
+ theme
18846
+ }) => theme.colors['text/neutral/subtler']};
18847
+ font-weight: ${({
18848
+ theme
18849
+ }) => theme.fontWeights.medium};
18850
+ line-height: ${({
18851
+ theme
18852
+ }) => theme.lineHeights[2]};
18853
+ }
18854
+
18855
+ ${variant({
18856
+ prop: 'size',
18857
+ variants: {
18858
+ m: {
18859
+ '& > svg': {
18860
+ width: 64,
18861
+ height: 64
18862
+ },
18863
+ '& > p': {
18864
+ fontSize: 'm',
18865
+ mt: 2
18866
+ },
18867
+ '& > span': {
18868
+ fontSize: 's',
18869
+ mt: 1
18870
+ },
18871
+ '& > div': {
18872
+ mt: 6
18873
+ }
18874
+ },
18875
+ s: {
18876
+ '& > svg': {
18877
+ width: 32,
18878
+ height: 32
18879
+ },
18880
+ '& > p': {
18881
+ fontSize: 's',
18882
+ mt: 3
18883
+ },
18884
+ '& > span': {
18885
+ fontSize: 'xs',
18886
+ mt: 0.5
18887
+ },
18888
+ '& > div': {
18889
+ mt: 3
18890
+ }
18891
+ }
18892
+ }
18893
+ })}
18894
+
18895
+ ${sx}
18896
+ `;
18897
+
18793
18898
  const GradientText = styled__default.default(Text)`
18794
18899
  background: ${({
18795
18900
  theme
@@ -18924,11 +19029,9 @@ const Overlay = ({
18924
19029
  }
18925
19030
  }, [handleDismiss, overlayRef]);
18926
19031
  const handleKeyDown = React.useCallback(event => {
18927
- switch (event.key) {
18928
- case 'Escape':
18929
- handleDismiss?.();
18930
- event.stopPropagation();
18931
- break;
19032
+ if (event.key === 'Escape') {
19033
+ handleDismiss?.();
19034
+ event.stopPropagation();
18932
19035
  }
18933
19036
  }, [handleDismiss]);
18934
19037
  React.useEffect(() => {
@@ -20312,7 +20415,7 @@ const computePosition = (reference, floating, options) => {
20312
20415
  });
20313
20416
  };
20314
20417
 
20315
- var index$6 = typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect;
20418
+ var index$7 = typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect;
20316
20419
 
20317
20420
  // Fork of `fast-deep-equal` that only does the comparisons we need and compares
20318
20421
  // functions
@@ -20377,7 +20480,7 @@ function roundByDPR(element, value) {
20377
20480
 
20378
20481
  function useLatestRef(value) {
20379
20482
  const ref = React__namespace.useRef(value);
20380
- index$6(() => {
20483
+ index$7(() => {
20381
20484
  ref.current = value;
20382
20485
  });
20383
20486
  return ref;
@@ -20462,7 +20565,7 @@ function useFloating(options) {
20462
20565
  }
20463
20566
  });
20464
20567
  }, [latestMiddleware, placement, strategy, platformRef]);
20465
- index$6(() => {
20568
+ index$7(() => {
20466
20569
  if (open === false && dataRef.current.isPositioned) {
20467
20570
  dataRef.current.isPositioned = false;
20468
20571
  setData(data => ({
@@ -20472,13 +20575,13 @@ function useFloating(options) {
20472
20575
  }
20473
20576
  }, [open]);
20474
20577
  const isMountedRef = React__namespace.useRef(false);
20475
- index$6(() => {
20578
+ index$7(() => {
20476
20579
  isMountedRef.current = true;
20477
20580
  return () => {
20478
20581
  isMountedRef.current = false;
20479
20582
  };
20480
20583
  }, []);
20481
- index$6(() => {
20584
+ index$7(() => {
20482
20585
  if (referenceEl) referenceRef.current = referenceEl;
20483
20586
  if (floatingEl) floatingRef.current = floatingEl;
20484
20587
  if (referenceEl && floatingEl) {
@@ -20587,13 +20690,13 @@ const useToggleHandler = ({
20587
20690
  const OverlayPopper = ({
20588
20691
  children: propChildren,
20589
20692
  renderOverlay,
20590
- overlayProps,
20591
20693
  placement = 'bottom-start',
20592
20694
  focusZoneSettings,
20593
20695
  focusTrapSettings
20594
20696
  }) => {
20595
20697
  const {
20596
20698
  refs,
20699
+ elements,
20597
20700
  floatingStyles,
20598
20701
  isPositioned
20599
20702
  } = useFloating({
@@ -20605,20 +20708,28 @@ const OverlayPopper = ({
20605
20708
  const {
20606
20709
  state: isOpen,
20607
20710
  toggle: toggleOverlay,
20711
+ on: openOverlay,
20608
20712
  off: closeOverlay
20609
20713
  } = useToggleHandler({
20610
20714
  initialState: false
20611
20715
  });
20612
20716
  const handleDismiss = () => {
20613
- overlayProps?.onDismiss?.();
20614
20717
  closeOverlay();
20615
20718
  };
20616
- const children = React.Children.map(propChildren, child => /*#__PURE__*/React.cloneElement(child, {
20719
+ const defaultPopperProps = {
20617
20720
  onClick: toggleOverlay,
20618
20721
  tabIndex: 0,
20619
20722
  ...{
20620
20723
  ref: refs.setReference
20621
20724
  }
20725
+ };
20726
+ const children = isFunction(propChildren) ? propChildren({
20727
+ ...defaultPopperProps
20728
+ }, {
20729
+ isOpen,
20730
+ openOverlay
20731
+ }) : React.Children.map(propChildren, child => /*#__PURE__*/React.cloneElement(child, {
20732
+ ...defaultPopperProps
20622
20733
  }));
20623
20734
  useFocusZone({
20624
20735
  containerRef: refs.floating,
@@ -20631,22 +20742,245 @@ const OverlayPopper = ({
20631
20742
  ...focusTrapSettings
20632
20743
  });
20633
20744
  return /*#__PURE__*/jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
20634
- children: [children, /*#__PURE__*/jsxRuntimeExports.jsx(Overlay$1, {
20745
+ children: [children, renderOverlay({
20635
20746
  ref: refs.setFloating,
20636
- isOpen: isOpen,
20747
+ isOpen,
20637
20748
  dismissFocusRef: refs.reference,
20638
20749
  ignoreOutsideClickRefs: [refs.reference],
20639
- ...overlayProps,
20640
- style: floatingStyles,
20641
- onDismiss: handleDismiss,
20642
- children: renderOverlay({
20643
- isOpen,
20644
- closeOverlay
20645
- })
20750
+ style: {
20751
+ ...floatingStyles
20752
+ },
20753
+ onDismiss: handleDismiss
20754
+ }, {
20755
+ isOpen,
20756
+ closeOverlay
20757
+ }, {
20758
+ elements
20646
20759
  })]
20647
20760
  });
20648
20761
  };
20649
20762
 
20763
+ const OverlaySelectInput = ({
20764
+ validationStatus,
20765
+ leadingVisual: LeadingVisual,
20766
+ children,
20767
+ ...props
20768
+ }, ref) => {
20769
+ const inputRef = useProvidedOrCreatedRef(ref);
20770
+ const focusInput = () => {
20771
+ inputRef.current?.focus();
20772
+ };
20773
+ const {
20774
+ disabled
20775
+ } = props;
20776
+ return /*#__PURE__*/jsxRuntimeExports.jsx(OverlayPopper, {
20777
+ renderOverlay: (overlayProps, _, {
20778
+ elements
20779
+ }) => /*#__PURE__*/jsxRuntimeExports.jsx(Overlay$1, {
20780
+ ...overlayProps,
20781
+ style: {
20782
+ ...overlayProps.style,
20783
+ width: elements?.reference?.getBoundingClientRect().width
20784
+ },
20785
+ children: children
20786
+ }),
20787
+ children: (popperProps, {
20788
+ openOverlay
20789
+ }) => /*#__PURE__*/jsxRuntimeExports.jsxs(TextInputWrapper$1, {
20790
+ ...popperProps,
20791
+ tabIndex: disabled ? -1 : 0,
20792
+ disabled: disabled,
20793
+ onClick: focusInput,
20794
+ hasLeadingVisual: !isNullable(LeadingVisual),
20795
+ validationStatus: validationStatus,
20796
+ onKeyDown: e => {
20797
+ if (['ArrowUp', 'ArrowDown'].includes(e.key)) {
20798
+ e.preventDefault();
20799
+ openOverlay();
20800
+ }
20801
+ },
20802
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(View, {
20803
+ sx: {
20804
+ 'flexShrink': 0,
20805
+ 'fontSize': 'xxs',
20806
+ 'fontWeight': 'medium',
20807
+ 'color': 'text/neutral',
20808
+ '& > svg': {
20809
+ display: 'block',
20810
+ width: 16,
20811
+ height: 16,
20812
+ color: 'icon/neutral/bold'
20813
+ }
20814
+ },
20815
+ children: typeof LeadingVisual !== 'string' && reactIsExports.isValidElementType(LeadingVisual) ? /*#__PURE__*/jsxRuntimeExports.jsx(LeadingVisual, {}) : LeadingVisual
20816
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(BaseInput$1, {
20817
+ ref: e => {
20818
+ isFunction(ref) ? ref(e) : null;
20819
+ inputRef.current = e;
20820
+ },
20821
+ value: '',
20822
+ onChange: noop$2,
20823
+ ...props,
20824
+ tabIndex: -1,
20825
+ onClick: e => {
20826
+ popperProps.onClick?.(e);
20827
+ props.onClick?.(e);
20828
+ }
20829
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(StyledIcon, {
20830
+ sx: {
20831
+ position: 'absolute',
20832
+ top: '50%',
20833
+ transform: 'translateY(-50%)',
20834
+ right: 5,
20835
+ pointerEvents: 'none'
20836
+ },
20837
+ icon: SvgChevronDown,
20838
+ color: disabled ? 'icon/disabled' : 'icon/neutral/bolder',
20839
+ size: 16
20840
+ })]
20841
+ })
20842
+ });
20843
+ };
20844
+ const TextInputWrapper$1 = styled__default.default.div`
20845
+ position: relative;
20846
+ width: ${forcePixelValue('100%')};
20847
+ border-width: ${forcePixelValue(1)};
20848
+ border-style: solid;
20849
+ border-radius: ${({
20850
+ theme
20851
+ }) => forcePixelValue(theme.radii.xs)};
20852
+ border-color: ${({
20853
+ theme
20854
+ }) => theme.colors['border/input']};
20855
+ background-color: ${({
20856
+ theme
20857
+ }) => theme.colors['bg/input']};
20858
+ cursor: default;
20859
+ input {
20860
+ cursor: default;
20861
+ }
20862
+ display: inline-flex;
20863
+ align-items: center;
20864
+
20865
+ font-size: ${({
20866
+ theme
20867
+ }) => forcePixelValue(theme.fontSizes.xs)};
20868
+ font-weight: ${({
20869
+ theme
20870
+ }) => theme.fontWeights.medium};
20871
+ line-height: ${({
20872
+ theme
20873
+ }) => theme.lineHeights[2]};
20874
+ color: ${({
20875
+ theme
20876
+ }) => theme.colors['text/neutral']};
20877
+ input::placeholder {
20878
+ color: ${({
20879
+ theme
20880
+ }) => theme.colors['text/neutral/subtlest']};
20881
+ }
20882
+
20883
+ &:after {
20884
+ content: '';
20885
+ position: absolute;
20886
+ top: ${forcePixelValue(-1)};
20887
+ right: ${forcePixelValue(-1)};
20888
+ bottom: ${forcePixelValue(-1)};
20889
+ left: ${forcePixelValue(-1)};
20890
+
20891
+ border: ${forcePixelValue(2)} solid transparent;
20892
+ border-radius: ${({
20893
+ theme
20894
+ }) => forcePixelValue(theme.radii.xs)};
20895
+ pointer-events: none;
20896
+ }
20897
+
20898
+ ${props => props.validationStatus !== 'error' && !props.disabled && styled.css`
20899
+ &:hover:not(:focus-within) {
20900
+ &:after {
20901
+ border-color: ${({
20902
+ theme
20903
+ }) => theme.colors['border/hovered']};
20904
+ }
20905
+ }
20906
+ `}
20907
+
20908
+ ${props => props.validationStatus === 'error' && styled.css`
20909
+ &:after {
20910
+ border-color: ${({
20911
+ theme
20912
+ }) => theme.colors['border/danger']};
20913
+ }
20914
+ `}
20915
+
20916
+ ${props => props.validationStatus !== 'error' && !props.disabled && styled.css`
20917
+ &:focus-within {
20918
+ &:after {
20919
+ border-color: ${({
20920
+ theme
20921
+ }) => theme.colors['border/focused']};
20922
+ }
20923
+ }
20924
+ `}
20925
+
20926
+ ${props => props.disabled && styled.css`
20927
+ border-color: ${props.theme.colors['border/input']};
20928
+ background-color: ${props.theme.colors['bg/disabled']};
20929
+ color: ${props.theme.colors['text/disabled']};
20930
+
20931
+ input::placeholder {
20932
+ color: ${props.theme.colors['text/disabled']};
20933
+ }
20934
+
20935
+ input {
20936
+ cursor: not-allowed;
20937
+ }
20938
+ `};
20939
+
20940
+ ${props => props.hasLeadingVisual && styled.css`
20941
+ padding-left: ${forcePixelValue(props.theme.space[5])};
20942
+ input {
20943
+ padding-left: ${forcePixelValue(props.theme.space[2])};
20944
+ }
20945
+ `}
20946
+
20947
+ transition: color 100ms, background-color 100ms;
20948
+ &:after {
20949
+ transition: border-color 100ms;
20950
+ }
20951
+ `;
20952
+ const UnstyledInput$1 = styled__default.default.input`
20953
+ font-size: inherit;
20954
+ font-weight: inherit;
20955
+ line-height: inherit;
20956
+ font-family: inherit;
20957
+ border-radius: inherit;
20958
+ color: inherit;
20959
+ transition: inherit;
20960
+
20961
+ border: 0;
20962
+ background-color: transparent;
20963
+ width: 100%;
20964
+ &:focus {
20965
+ outline: 0;
20966
+ }
20967
+ `;
20968
+ const BaseInput$1 = styled__default.default(UnstyledInput$1)`
20969
+ padding-top: ${({
20970
+ theme
20971
+ }) => forcePixelValue(theme.space['4'])};
20972
+ padding-right: ${({
20973
+ theme
20974
+ }) => forcePixelValue(theme.space['5'])};
20975
+ padding-bottom: ${({
20976
+ theme
20977
+ }) => forcePixelValue(theme.space['4'])};
20978
+ padding-left: ${({
20979
+ theme
20980
+ }) => forcePixelValue(theme.space['5'])};
20981
+ `;
20982
+ var index$6 = /*#__PURE__*/React.forwardRef(OverlaySelectInput);
20983
+
20650
20984
  const Pagination = ({
20651
20985
  pages: propPages,
20652
20986
  currentPageIndex,
@@ -21073,6 +21407,18 @@ const BasePill = styled__default.default(UnstyledButton)`
21073
21407
  `;
21074
21408
  var index$4 = /*#__PURE__*/React.forwardRef(Pill);
21075
21409
 
21410
+ const SelectOption = ({
21411
+ children: propChildren,
21412
+ ...props
21413
+ }) => {
21414
+ const children = isNullable(propChildren) ? props.label : propChildren;
21415
+ return /*#__PURE__*/jsxRuntimeExports.jsx(BaseSelectOption, {
21416
+ ...props,
21417
+ children: children
21418
+ });
21419
+ };
21420
+ const BaseSelectOption = styled__default.default.option``;
21421
+
21076
21422
  const Select = ({
21077
21423
  children,
21078
21424
  disabled,
@@ -21125,7 +21471,7 @@ const Select = ({
21125
21471
  }
21126
21472
  }
21127
21473
  },
21128
- children: [/*#__PURE__*/jsxRuntimeExports.jsx("option", {
21474
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(SelectOption, {
21129
21475
  label: placeholder,
21130
21476
  value: PLACEHOLDER_VALUE
21131
21477
  }), children]
@@ -21289,7 +21635,6 @@ const BaseSelect = styled__default.default(UnstyledSelect)`
21289
21635
  white-space: pre;
21290
21636
  text-overflow: ellipsis;
21291
21637
  `;
21292
- const SelectOption = styled__default.default.option``;
21293
21638
  var index$3 = Object.assign( /*#__PURE__*/React.forwardRef(Select), {
21294
21639
  Option: SelectOption
21295
21640
  });
@@ -23368,17 +23713,18 @@ const useOutsideClick = ({
23368
23713
  });
23369
23714
  };
23370
23715
 
23371
- exports.ActionList = index$c;
23716
+ exports.ActionList = index$d;
23372
23717
  exports.AnimatePresence = AnimatePresence;
23373
- exports.Avatar = index$b;
23374
- exports.Breadcrumbs = index$a;
23718
+ exports.Avatar = index$c;
23719
+ exports.Breadcrumbs = index$b;
23375
23720
  exports.Button = Button;
23376
- exports.Checkbox = index$9;
23721
+ exports.Checkbox = index$a;
23377
23722
  exports.Chip = Chip;
23378
- exports.Datagrid = index$8;
23723
+ exports.Datagrid = index$9;
23379
23724
  exports.DescriptionList = DescriptionList;
23380
- exports.Dialog = index$7;
23725
+ exports.Dialog = index$8;
23381
23726
  exports.DialogHandler = DialogHandler;
23727
+ exports.EmptyState = EmptyState;
23382
23728
  exports.EnigmaUI = index;
23383
23729
  exports.GradientText = GradientText;
23384
23730
  exports.Grid = Grid$1;
@@ -23390,6 +23736,7 @@ exports.ItemList = ItemList;
23390
23736
  exports.MotionView = MotionView;
23391
23737
  exports.Overlay = Overlay$1;
23392
23738
  exports.OverlayPopper = OverlayPopper;
23739
+ exports.OverlaySelectInput = index$6;
23393
23740
  exports.Pagination = index$5;
23394
23741
  exports.Pill = index$4;
23395
23742
  exports.Select = index$3;
@@ -0,0 +1,117 @@
1
+ import 'react';
2
+ import SvgDocument from '../../packages/icons/esm/Document.js';
3
+ import styled from 'styled-components';
4
+ import '../../node_modules/styled-system/dist/index.esm.js';
5
+ import { sx } from '../../utils/styled-system/index.js';
6
+ import Button from '../Button/index.js';
7
+ import Text from '../Text/index.js';
8
+ import View from '../View/index.js';
9
+ import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js';
10
+ import { variant } from '../../node_modules/@styled-system/variant/dist/index.esm.js';
11
+
12
+ const EmptyState = ({
13
+ title,
14
+ icon: Icon = SvgDocument,
15
+ description,
16
+ action,
17
+ renderAction = ({
18
+ ...buttonProps
19
+ }, emptyStateProps) => /*#__PURE__*/jsxRuntimeExports.jsx(Button, {
20
+ size: emptyStateProps.size,
21
+ ...buttonProps
22
+ }),
23
+ size = 'm',
24
+ sx
25
+ }) => {
26
+ return /*#__PURE__*/jsxRuntimeExports.jsxs(BaseEmptyState, {
27
+ size: size,
28
+ sx: sx,
29
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(Icon, {}), /*#__PURE__*/jsxRuntimeExports.jsx(Text, {
30
+ as: 'p',
31
+ children: title
32
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(Text, {
33
+ children: description
34
+ }), action ? /*#__PURE__*/jsxRuntimeExports.jsx(View, {
35
+ children: renderAction(action, {
36
+ size
37
+ })
38
+ }) : null]
39
+ });
40
+ };
41
+ const BaseEmptyState = styled.div`
42
+ display: flex;
43
+ flex-direction: column;
44
+ align-items: center;
45
+
46
+ & > svg {
47
+ color: ${({
48
+ theme
49
+ }) => theme.colors['icon/neutral']};
50
+ }
51
+ & > p {
52
+ color: ${({
53
+ theme
54
+ }) => theme.colors['text/neutral']};
55
+ font-weight: ${({
56
+ theme
57
+ }) => theme.fontWeights.bold};
58
+ line-height: ${({
59
+ theme
60
+ }) => theme.lineHeights[2]};
61
+ }
62
+ & > span {
63
+ color: ${({
64
+ theme
65
+ }) => theme.colors['text/neutral/subtler']};
66
+ font-weight: ${({
67
+ theme
68
+ }) => theme.fontWeights.medium};
69
+ line-height: ${({
70
+ theme
71
+ }) => theme.lineHeights[2]};
72
+ }
73
+
74
+ ${variant({
75
+ prop: 'size',
76
+ variants: {
77
+ m: {
78
+ '& > svg': {
79
+ width: 64,
80
+ height: 64
81
+ },
82
+ '& > p': {
83
+ fontSize: 'm',
84
+ mt: 2
85
+ },
86
+ '& > span': {
87
+ fontSize: 's',
88
+ mt: 1
89
+ },
90
+ '& > div': {
91
+ mt: 6
92
+ }
93
+ },
94
+ s: {
95
+ '& > svg': {
96
+ width: 32,
97
+ height: 32
98
+ },
99
+ '& > p': {
100
+ fontSize: 's',
101
+ mt: 3
102
+ },
103
+ '& > span': {
104
+ fontSize: 'xs',
105
+ mt: 0.5
106
+ },
107
+ '& > div': {
108
+ mt: 3
109
+ }
110
+ }
111
+ }
112
+ })}
113
+
114
+ ${sx}
115
+ `;
116
+
117
+ export { EmptyState as default };
@@ -35,11 +35,9 @@ const Overlay = ({
35
35
  }
36
36
  }, [handleDismiss, overlayRef]);
37
37
  const handleKeyDown = useCallback(event => {
38
- switch (event.key) {
39
- case 'Escape':
40
- handleDismiss?.();
41
- event.stopPropagation();
42
- break;
38
+ if (event.key === 'Escape') {
39
+ handleDismiss?.();
40
+ event.stopPropagation();
43
41
  }
44
42
  }, [handleDismiss]);
45
43
  useEffect(() => {