@teamturing/react-kit 2.16.3 → 2.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -7094,7 +7094,7 @@ const BaseActionList = styled__default.default.ul`
7094
7094
 
7095
7095
  ${sx}
7096
7096
  `;
7097
- var index$b = 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$a = /*#__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$9 = 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$8 = /*#__PURE__*/React.forwardRef(Checkbox);
17293
+ var index$a = /*#__PURE__*/React.forwardRef(Checkbox);
17294
17294
 
17295
17295
  const Chip = ({
17296
17296
  children,
@@ -17502,6 +17502,14 @@ const DatagridBody = ({
17502
17502
  const BaseDatagridBody = styled__default.default.div`
17503
17503
  width: inherit;
17504
17504
 
17505
+ & > div:not(:last-child) {
17506
+ border-bottom-width: ${forcePixelValue(1)};
17507
+ border-bottom-style: solid;
17508
+ border-bottom-color: ${({
17509
+ theme
17510
+ }) => theme.colors['border/neutral']};
17511
+ }
17512
+
17505
17513
  ${sx}
17506
17514
  `;
17507
17515
 
@@ -17574,6 +17582,28 @@ const DatagridRow = ({
17574
17582
  const BaseDatagridRow = Grid$1;
17575
17583
  const DatagridRowWrapper = Space;
17576
17584
 
17585
+ const DatagridSubheader = ({
17586
+ ...props
17587
+ }) => /*#__PURE__*/jsxRuntimeExports.jsx(DataGridSubheaderWrapper, {
17588
+ ...props
17589
+ });
17590
+ const DataGridSubheaderWrapper = styled__default.default.div`
17591
+ padding: ${({
17592
+ theme
17593
+ }) => `${forcePixelValue(theme.space[2])} ${forcePixelValue(theme.space[4])}`};
17594
+ background-color: ${({
17595
+ theme
17596
+ }) => theme.colors.surface};
17597
+
17598
+ border-bottom-width: ${forcePixelValue(1)};
17599
+ border-bottom-style: solid;
17600
+ border-bottom-color: ${({
17601
+ theme
17602
+ }) => theme.colors['border/neutral']};
17603
+
17604
+ ${sx};
17605
+ `;
17606
+
17577
17607
  const Datagrid = ({
17578
17608
  children,
17579
17609
  sx,
@@ -17582,12 +17612,13 @@ const Datagrid = ({
17582
17612
  const [relocatableComponentsObject, restConmponents] = useRelocation({
17583
17613
  children,
17584
17614
  config: {
17585
- header: DatagridHeader
17615
+ header: DatagridHeader,
17616
+ subHeader: DatagridSubheader
17586
17617
  }
17587
17618
  });
17588
17619
  return /*#__PURE__*/jsxRuntimeExports.jsxs(DatagridWrapper, {
17589
17620
  sx: sx,
17590
- children: [relocatableComponentsObject.header, /*#__PURE__*/jsxRuntimeExports.jsx(BaseDatagrid, {
17621
+ children: [relocatableComponentsObject.header, relocatableComponentsObject.subHeader, /*#__PURE__*/jsxRuntimeExports.jsx(BaseDatagrid, {
17591
17622
  ...props,
17592
17623
  children: restConmponents
17593
17624
  })]
@@ -17612,8 +17643,9 @@ const DatagridWrapper = styled__default.default.div`
17612
17643
  const BaseDatagrid = styled__default.default.div`
17613
17644
  width: inherit;
17614
17645
  `;
17615
- var index$7 = Object.assign(Datagrid, {
17646
+ var index$9 = Object.assign(Datagrid, {
17616
17647
  Header: DatagridHeader,
17648
+ Subheader: DatagridSubheader,
17617
17649
  Body: DatagridBody,
17618
17650
  Row: DatagridRow,
17619
17651
  Cell: DatagridCell
@@ -18718,7 +18750,7 @@ const BaseDialog = styled__default.default.div(() => ({
18718
18750
  overflow: 'hidden',
18719
18751
  margin: 'auto'
18720
18752
  }), sx);
18721
- var index$6 = /*#__PURE__*/React.forwardRef(Dialog);
18753
+ var index$8 = /*#__PURE__*/React.forwardRef(Dialog);
18722
18754
 
18723
18755
  const useDialogHandler = () => {
18724
18756
  const [isOpen, setIsOpen] = React.useState(false);
@@ -18758,6 +18790,111 @@ const DialogHandler = ({
18758
18790
  });
18759
18791
  };
18760
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
+
18761
18898
  const GradientText = styled__default.default(Text)`
18762
18899
  background: ${({
18763
18900
  theme
@@ -18892,11 +19029,9 @@ const Overlay = ({
18892
19029
  }
18893
19030
  }, [handleDismiss, overlayRef]);
18894
19031
  const handleKeyDown = React.useCallback(event => {
18895
- switch (event.key) {
18896
- case 'Escape':
18897
- handleDismiss?.();
18898
- event.stopPropagation();
18899
- break;
19032
+ if (event.key === 'Escape') {
19033
+ handleDismiss?.();
19034
+ event.stopPropagation();
18900
19035
  }
18901
19036
  }, [handleDismiss]);
18902
19037
  React.useEffect(() => {
@@ -18949,13 +19084,16 @@ const BaseOverlay = styled__default.default.div`
18949
19084
  prop: 'size',
18950
19085
  variants: {
18951
19086
  s: {
18952
- width: forcePixelValue(256)
19087
+ width: forcePixelValue(180)
18953
19088
  },
18954
19089
  m: {
18955
- width: forcePixelValue(320)
19090
+ width: forcePixelValue(256)
18956
19091
  },
18957
19092
  l: {
18958
- width: forcePixelValue(480)
19093
+ width: forcePixelValue(320)
19094
+ },
19095
+ auto: {
19096
+ width: 'auto'
18959
19097
  }
18960
19098
  }
18961
19099
  })}
@@ -20277,7 +20415,7 @@ const computePosition = (reference, floating, options) => {
20277
20415
  });
20278
20416
  };
20279
20417
 
20280
- var index$5 = typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect;
20418
+ var index$7 = typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect;
20281
20419
 
20282
20420
  // Fork of `fast-deep-equal` that only does the comparisons we need and compares
20283
20421
  // functions
@@ -20342,7 +20480,7 @@ function roundByDPR(element, value) {
20342
20480
 
20343
20481
  function useLatestRef(value) {
20344
20482
  const ref = React__namespace.useRef(value);
20345
- index$5(() => {
20483
+ index$7(() => {
20346
20484
  ref.current = value;
20347
20485
  });
20348
20486
  return ref;
@@ -20427,7 +20565,7 @@ function useFloating(options) {
20427
20565
  }
20428
20566
  });
20429
20567
  }, [latestMiddleware, placement, strategy, platformRef]);
20430
- index$5(() => {
20568
+ index$7(() => {
20431
20569
  if (open === false && dataRef.current.isPositioned) {
20432
20570
  dataRef.current.isPositioned = false;
20433
20571
  setData(data => ({
@@ -20437,13 +20575,13 @@ function useFloating(options) {
20437
20575
  }
20438
20576
  }, [open]);
20439
20577
  const isMountedRef = React__namespace.useRef(false);
20440
- index$5(() => {
20578
+ index$7(() => {
20441
20579
  isMountedRef.current = true;
20442
20580
  return () => {
20443
20581
  isMountedRef.current = false;
20444
20582
  };
20445
20583
  }, []);
20446
- index$5(() => {
20584
+ index$7(() => {
20447
20585
  if (referenceEl) referenceRef.current = referenceEl;
20448
20586
  if (floatingEl) floatingRef.current = floatingEl;
20449
20587
  if (referenceEl && floatingEl) {
@@ -20552,13 +20690,13 @@ const useToggleHandler = ({
20552
20690
  const OverlayPopper = ({
20553
20691
  children: propChildren,
20554
20692
  renderOverlay,
20555
- overlayProps,
20556
20693
  placement = 'bottom-start',
20557
20694
  focusZoneSettings,
20558
20695
  focusTrapSettings
20559
20696
  }) => {
20560
20697
  const {
20561
20698
  refs,
20699
+ elements,
20562
20700
  floatingStyles,
20563
20701
  isPositioned
20564
20702
  } = useFloating({
@@ -20570,20 +20708,28 @@ const OverlayPopper = ({
20570
20708
  const {
20571
20709
  state: isOpen,
20572
20710
  toggle: toggleOverlay,
20711
+ on: openOverlay,
20573
20712
  off: closeOverlay
20574
20713
  } = useToggleHandler({
20575
20714
  initialState: false
20576
20715
  });
20577
20716
  const handleDismiss = () => {
20578
- overlayProps?.onDismiss?.();
20579
20717
  closeOverlay();
20580
20718
  };
20581
- const children = React.Children.map(propChildren, child => /*#__PURE__*/React.cloneElement(child, {
20719
+ const defaultPopperProps = {
20582
20720
  onClick: toggleOverlay,
20583
20721
  tabIndex: 0,
20584
20722
  ...{
20585
20723
  ref: refs.setReference
20586
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
20587
20733
  }));
20588
20734
  useFocusZone({
20589
20735
  containerRef: refs.floating,
@@ -20596,22 +20742,245 @@ const OverlayPopper = ({
20596
20742
  ...focusTrapSettings
20597
20743
  });
20598
20744
  return /*#__PURE__*/jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
20599
- children: [children, /*#__PURE__*/jsxRuntimeExports.jsx(Overlay$1, {
20745
+ children: [children, renderOverlay({
20600
20746
  ref: refs.setFloating,
20601
- isOpen: isOpen,
20747
+ isOpen,
20602
20748
  dismissFocusRef: refs.reference,
20603
20749
  ignoreOutsideClickRefs: [refs.reference],
20604
- ...overlayProps,
20605
- style: floatingStyles,
20606
- onDismiss: handleDismiss,
20607
- children: renderOverlay({
20608
- isOpen,
20609
- closeOverlay
20610
- })
20750
+ style: {
20751
+ ...floatingStyles
20752
+ },
20753
+ onDismiss: handleDismiss
20754
+ }, {
20755
+ isOpen,
20756
+ closeOverlay
20757
+ }, {
20758
+ elements
20611
20759
  })]
20612
20760
  });
20613
20761
  };
20614
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
+
20615
20984
  const Pagination = ({
20616
20985
  pages: propPages,
20617
20986
  currentPageIndex,
@@ -20866,43 +21235,80 @@ const PaginationTruncationIndicator = styled__default.default.div`
20866
21235
 
20867
21236
  ${sx}
20868
21237
  `;
20869
- var index$4 = Object.assign(Pagination, {
21238
+ var index$5 = Object.assign(Pagination, {
20870
21239
  Page: PaginationPage,
20871
21240
  PageDirection: PaginationPageDirection,
20872
21241
  TruncationIndicator: PaginationTruncationIndicator
20873
21242
  });
20874
21243
 
20875
21244
  const Pill = ({
20876
- text,
21245
+ children,
20877
21246
  size = 'm',
20878
- variant = 'secondary',
21247
+ variant = 'outlined',
21248
+ disabled = false,
20879
21249
  leadingVisual: LeadingVisual,
20880
- onRemove,
21250
+ trailingVisual: TrailingVisual,
21251
+ onRemove: propOnRemove,
20881
21252
  removeIcon: RemoveIcon = SvgClose,
20882
21253
  ...props
20883
- }, ref) => /*#__PURE__*/jsxRuntimeExports.jsxs(BasePill, {
20884
- ref: ref,
20885
- size: size,
20886
- variant: variant,
20887
- hasLeadingVisual: !isNullable(LeadingVisual),
20888
- hasRemoveButton: !isNullable(onRemove),
20889
- ...props,
20890
- children: [typeof LeadingVisual !== 'string' && reactIsExports.isValidElementType(LeadingVisual) ? /*#__PURE__*/jsxRuntimeExports.jsx(LeadingVisual, {}) : LeadingVisual, /*#__PURE__*/jsxRuntimeExports.jsx("span", {
20891
- title: text,
20892
- children: text
20893
- }), onRemove ? /*#__PURE__*/jsxRuntimeExports.jsx(UnstyledButton, {
20894
- type: 'button',
20895
- onClick: onRemove,
20896
- "aria-label": 'Remove Pill',
20897
- children: /*#__PURE__*/jsxRuntimeExports.jsx(RemoveIcon, {})
20898
- }) : null]
20899
- });
20900
- const BasePill = styled__default.default.span`
21254
+ }, ref) => {
21255
+ const handleRemove = React.useCallback(event => {
21256
+ propOnRemove?.(event);
21257
+ }, [propOnRemove]);
21258
+ const handleRemoveClick = React.useCallback(event => {
21259
+ if (disabled) return;
21260
+ handleRemove(event);
21261
+ }, [handleRemove, disabled]);
21262
+ const handleRemoveKeydown = React.useCallback(event => {
21263
+ if (disabled) return;
21264
+ if ([' ', 'Enter'].includes(event.key)) {
21265
+ handleRemove(event);
21266
+ }
21267
+ }, [handleRemove, disabled]);
21268
+ return /*#__PURE__*/jsxRuntimeExports.jsxs(BasePill, {
21269
+ ref: ref,
21270
+ size: size,
21271
+ variant: variant,
21272
+ hasLeadingVisual: !isNullable(LeadingVisual),
21273
+ hasRemoveButton: !isNullable(propOnRemove),
21274
+ disabled: disabled,
21275
+ ...props,
21276
+ children: [typeof LeadingVisual !== 'string' && reactIsExports.isValidElementType(LeadingVisual) ? /*#__PURE__*/jsxRuntimeExports.jsx(LeadingVisual, {}) : LeadingVisual, /*#__PURE__*/jsxRuntimeExports.jsx("span", {
21277
+ title: children?.toString(),
21278
+ children: children
21279
+ }), typeof TrailingVisual !== 'string' && reactIsExports.isValidElementType(TrailingVisual) ? /*#__PURE__*/jsxRuntimeExports.jsx(TrailingVisual, {}) : TrailingVisual, propOnRemove ? /*#__PURE__*/jsxRuntimeExports.jsx("div", {
21280
+ onClick: e => {
21281
+ e.preventDefault();
21282
+ handleRemoveClick(e);
21283
+ e.stopPropagation();
21284
+ },
21285
+ onKeyDown: e => {
21286
+ if ([' ', 'Enter'].includes(e.key)) {
21287
+ e.preventDefault();
21288
+ e.stopPropagation();
21289
+ handleRemoveKeydown(e);
21290
+ return;
21291
+ }
21292
+ },
21293
+ "aria-label": 'Remove Pill',
21294
+ role: 'button',
21295
+ "aria-disabled": disabled,
21296
+ tabIndex: disabled ? -1 : 0,
21297
+ children: /*#__PURE__*/jsxRuntimeExports.jsx(RemoveIcon, {})
21298
+ }) : null]
21299
+ });
21300
+ };
21301
+ const BasePill = styled__default.default(UnstyledButton)`
20901
21302
  display: inline-flex;
20902
21303
  align-items: center;
20903
21304
  border-radius: ${({
20904
21305
  theme
20905
- }) => forcePixelValue(theme.radii.xxs)};
21306
+ }) => forcePixelValue(theme.radii.xs)};
21307
+ column-gap: ${({
21308
+ theme
21309
+ }) => forcePixelValue(theme.space[2])};
21310
+
21311
+ transition: background-color 100ms;
20906
21312
 
20907
21313
  & span {
20908
21314
  max-width: 240px;
@@ -20911,93 +21317,107 @@ const BasePill = styled__default.default.span`
20911
21317
  white-space: pre;
20912
21318
  word-break: break-all;
20913
21319
  }
20914
- & > button {
21320
+
21321
+ &:focus-visible {
21322
+ outline-color: ${({
21323
+ theme
21324
+ }) => theme.colors['border/focused']};
21325
+ outline-style: solid;
21326
+ outline-width: ${forcePixelValue(2)};
21327
+ outline-offset: ${({
21328
+ theme
21329
+ }) => forcePixelValue(theme.space[0.5])};
21330
+ }
21331
+
21332
+ & > div {
20915
21333
  display: flex;
20916
- transition: background-color 100ms;
20917
21334
  border-radius: ${({
20918
21335
  theme
20919
- }) => forcePixelValue(theme.radii.full)};
21336
+ }) => forcePixelValue(theme.radii.xxs)};
21337
+ }
21338
+ & > div:focus-visible {
21339
+ outline-color: ${({
21340
+ theme
21341
+ }) => theme.colors['border/focused']};
21342
+ outline-style: solid;
21343
+ outline-width: ${forcePixelValue(2)};
21344
+ outline-offset: ${({
21345
+ theme
21346
+ }) => forcePixelValue(theme.space[-0.5])};
20920
21347
  }
20921
21348
 
20922
21349
  ${({
20923
21350
  theme,
20924
- hasLeadingVisual,
20925
21351
  hasRemoveButton
20926
21352
  }) => variant({
20927
21353
  prop: 'size',
20928
21354
  variants: {
20929
- l: {
20930
- 'pl': hasLeadingVisual || hasRemoveButton ? 2 : 3,
20931
- 'pr': hasRemoveButton ? 0.5 : hasLeadingVisual ? 2 : 3,
20932
- 'py': 1,
20933
- 'fontSize': theme.fontSizes.s,
20934
- 'fontWeight': theme.fontWeights.medium,
20935
- 'lineHeight': theme.lineHeights[2],
20936
- 'columnGap': 1,
20937
- '& svg': {
20938
- minWidth: 16,
20939
- height: 16,
20940
- color: theme.colors['icon/primary']
20941
- },
20942
- '& button': {
20943
- p: 1
20944
- }
20945
- },
20946
21355
  m: {
20947
- 'pl': hasLeadingVisual || hasRemoveButton ? 2 : 3,
20948
- 'pr': hasRemoveButton ? 1 : hasLeadingVisual ? 2 : 3,
20949
- 'py': 1,
20950
- 'fontSize': theme.fontSizes.xs,
20951
- 'fontWeight': theme.fontWeights.medium,
20952
- 'lineHeight': theme.lineHeights[2],
20953
- 'columnGap': 0.5,
20954
- '& svg': {
20955
- minWidth: 16,
20956
- height: 16,
20957
- color: theme.colors['icon/primary']
20958
- },
20959
- '& button': {
20960
- p: 0.5
20961
- }
20962
- },
20963
- s: {
20964
- 'pl': 2,
20965
- 'pr': hasRemoveButton ? 1 : 2,
20966
- 'py': 0.5,
21356
+ 'pl': 3,
21357
+ 'pr': !hasRemoveButton ? 3 : 1,
21358
+ 'height': forcePixelValue(32),
20967
21359
  'fontSize': theme.fontSizes.xxs,
20968
21360
  'fontWeight': theme.fontWeights.medium,
20969
21361
  'lineHeight': theme.lineHeights[2],
20970
- 'columnGap': 0.5,
21362
+ 'columnGap': 1,
20971
21363
  '& svg': {
20972
21364
  minWidth: 12,
20973
- height: 12,
20974
- color: theme.colors['icon/primary']
21365
+ height: 12
20975
21366
  },
20976
- '& button': {
20977
- p: 0.5
21367
+ '& > div': {
21368
+ p: 1
20978
21369
  }
20979
21370
  }
20980
21371
  }
20981
21372
  })}
20982
21373
  ${({
20983
- theme
21374
+ theme,
21375
+ disabled
20984
21376
  }) => variant({
20985
21377
  prop: 'variant',
20986
21378
  variants: {
20987
- secondary: {
20988
- 'color': theme.colors['text/primary'],
20989
- 'backgroundColor': theme.colors['bg/secondary'],
20990
- '& button': {
20991
- '&:hover': {
20992
- backgroundColor: theme.colors['bg/secondary/hovered']
21379
+ outlined: {
21380
+ 'backgroundColor': theme.colors['bg/neutral/subtler'],
21381
+ 'borderWidth': 1,
21382
+ 'borderStyle': 'solid',
21383
+ 'borderColor': theme.colors['border/neutral'],
21384
+ 'color': 'text/neutral/subtle',
21385
+ '& svg': {
21386
+ color: theme.colors['icon/neutral/bolder']
21387
+ },
21388
+ '&:hover': {
21389
+ backgroundColor: theme.colors['bg/neutral/subtler/hovered']
21390
+ },
21391
+ '&:active': {
21392
+ backgroundColor: theme.colors['bg/neutral/subtler/pressed']
21393
+ },
21394
+ ...(disabled ? {
21395
+ 'cursor': 'not-allowed',
21396
+ 'backgroundColor': theme.colors['bg/disabled'],
21397
+ 'color': theme.colors['text/disabled'],
21398
+ '& svg': {
21399
+ color: theme.colors['icon/disabled']
20993
21400
  }
20994
- }
21401
+ } : {})
20995
21402
  }
20996
21403
  }
20997
21404
  })}
21405
+
20998
21406
  ${sx}
20999
21407
  `;
21000
- var index$3 = /*#__PURE__*/React.forwardRef(Pill);
21408
+ var index$4 = /*#__PURE__*/React.forwardRef(Pill);
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``;
21001
21421
 
21002
21422
  const Select = ({
21003
21423
  children,
@@ -21027,8 +21447,8 @@ const Select = ({
21027
21447
  'color': 'text/neutral',
21028
21448
  '& > svg': {
21029
21449
  display: 'block',
21030
- width: 20,
21031
- height: 20,
21450
+ width: 16,
21451
+ height: 16,
21032
21452
  color: 'icon/neutral/bold'
21033
21453
  }
21034
21454
  },
@@ -21169,7 +21589,7 @@ const SelectWrapper = styled__default.default.div`
21169
21589
  ${props => props.hasLeadingVisual && styled.css`
21170
21590
  padding-left: ${forcePixelValue(props.theme.space[5])};
21171
21591
  select {
21172
- padding-left: ${forcePixelValue(props.theme.space[3])};
21592
+ padding-left: ${forcePixelValue(props.theme.space[2])};
21173
21593
  }
21174
21594
  `}
21175
21595
 
@@ -21215,8 +21635,7 @@ const BaseSelect = styled__default.default(UnstyledSelect)`
21215
21635
  white-space: pre;
21216
21636
  text-overflow: ellipsis;
21217
21637
  `;
21218
- const SelectOption = styled__default.default.option``;
21219
- var index$2 = Object.assign( /*#__PURE__*/React.forwardRef(Select), {
21638
+ var index$3 = Object.assign( /*#__PURE__*/React.forwardRef(Select), {
21220
21639
  Option: SelectOption
21221
21640
  });
21222
21641
 
@@ -22443,7 +22862,7 @@ const Tab = ({
22443
22862
  })
22444
22863
  });
22445
22864
  };
22446
- var index$1 = Object.assign(Tab, {
22865
+ var index$2 = Object.assign(Tab, {
22447
22866
  Item: TabItem
22448
22867
  });
22449
22868
 
@@ -22597,7 +23016,57 @@ const BaseTextarea = styled__default.default(UnstyledTextarea)`
22597
23016
  resize: none;
22598
23017
  `;
22599
23018
 
22600
- const TextInput = /*#__PURE__*/React.forwardRef(({
23019
+ const TextInputTrailingAction = ({
23020
+ icon: Icon,
23021
+ disabled,
23022
+ ...props
23023
+ }, ref) => /*#__PURE__*/jsxRuntimeExports.jsx(BaseTextInputTrailingAction, {
23024
+ ref: ref,
23025
+ ...props,
23026
+ disabled: disabled,
23027
+ "aria-disabled": disabled,
23028
+ children: /*#__PURE__*/jsxRuntimeExports.jsx(Icon, {})
23029
+ });
23030
+ const BaseTextInputTrailingAction = styled__default.default(UnstyledButton)`
23031
+ display: inline-flex;
23032
+ padding: ${({
23033
+ theme
23034
+ }) => forcePixelValue(theme.space[2])};
23035
+ background-color: ${({
23036
+ theme
23037
+ }) => theme.colors['bg/neutral/subtler']};
23038
+ border-radius: ${({
23039
+ theme
23040
+ }) => forcePixelValue(theme.radii.full)};
23041
+
23042
+ & svg {
23043
+ width: ${forcePixelValue(16)};
23044
+ height: ${forcePixelValue(16)};
23045
+ color: ${({
23046
+ theme
23047
+ }) => theme.colors['icon/neutral/bolder']};
23048
+ }
23049
+
23050
+ &:hover {
23051
+ background-color: ${({
23052
+ theme
23053
+ }) => theme.colors['bg/neutral/subtler/hovered']};
23054
+ }
23055
+
23056
+ &[aria-disabled='true'] {
23057
+ cursor: not-allowed;
23058
+ & svg {
23059
+ color: ${({
23060
+ theme
23061
+ }) => theme.colors['icon/disabled']};
23062
+ }
23063
+ }
23064
+
23065
+ ${sx}
23066
+ `;
23067
+ var TextInputTrailingAction$1 = /*#__PURE__*/React.forwardRef(TextInputTrailingAction);
23068
+
23069
+ const TextInput = ({
22601
23070
  type = 'text',
22602
23071
  disabled,
22603
23072
  validationStatus,
@@ -22625,8 +23094,8 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
22625
23094
  'color': color$1['text/neutral'],
22626
23095
  '& > svg': {
22627
23096
  display: 'block',
22628
- width: 20,
22629
- height: 20,
23097
+ width: 16,
23098
+ height: 16,
22630
23099
  color: color$1['icon/neutral/bold']
22631
23100
  }
22632
23101
  },
@@ -22650,8 +23119,8 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
22650
23119
  'color': color$1['text/neutral'],
22651
23120
  '& > svg': {
22652
23121
  display: 'block',
22653
- width: 24,
22654
- height: 24,
23122
+ width: 16,
23123
+ height: 16,
22655
23124
  color: color$1['icon/neutral/bold']
22656
23125
  }
22657
23126
  },
@@ -22660,7 +23129,7 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
22660
23129
  }) : null]
22661
23130
  })]
22662
23131
  });
22663
- });
23132
+ };
22664
23133
  const TextInputWrapper = styled__default.default.div`
22665
23134
  position: relative;
22666
23135
  width: ${forcePixelValue('100%')};
@@ -22757,17 +23226,25 @@ const TextInputWrapper = styled__default.default.div`
22757
23226
  ${props => props.hasLeadingVisual && styled.css`
22758
23227
  padding-left: ${forcePixelValue(props.theme.space[5])};
22759
23228
  input {
22760
- padding-left: ${forcePixelValue(props.theme.space[3])};
23229
+ padding-left: ${forcePixelValue(props.theme.space[2])};
22761
23230
  }
22762
23231
  `}
22763
23232
 
22764
- ${props => (props.hasTrailingVisual || props.hasTrailingAction) && styled.css`
23233
+ ${props => props.hasTrailingVisual && styled.css`
23234
+ padding-right: ${forcePixelValue(props.theme.space[5])};
23235
+ `}
23236
+
23237
+ ${props => props.hasTrailingAction && styled.css`
22765
23238
  padding-right: ${forcePixelValue(props.theme.space[3])};
23239
+ `}
23240
+
23241
+ ${props => (props.hasTrailingVisual || props.hasTrailingAction) && styled.css`
22766
23242
  input {
22767
- padding-right: ${forcePixelValue(props.theme.space[3])};
23243
+ padding-right: ${forcePixelValue(props.theme.space[2])};
22768
23244
  }
22769
23245
  `}
22770
23246
 
23247
+
22771
23248
  transition: color 100ms, background-color 100ms;
22772
23249
  &:after {
22773
23250
  transition: border-color 100ms;
@@ -22795,7 +23272,7 @@ const BaseInput = styled__default.default(UnstyledInput)`
22795
23272
  }) => forcePixelValue(theme.space['4'])};
22796
23273
  padding-right: ${({
22797
23274
  theme
22798
- }) => forcePixelValue(theme.space['4'])};
23275
+ }) => forcePixelValue(theme.space['5'])};
22799
23276
  padding-bottom: ${({
22800
23277
  theme
22801
23278
  }) => forcePixelValue(theme.space['4'])};
@@ -22803,6 +23280,9 @@ const BaseInput = styled__default.default(UnstyledInput)`
22803
23280
  theme
22804
23281
  }) => forcePixelValue(theme.space['5'])};
22805
23282
  `;
23283
+ var index$1 = Object.assign( /*#__PURE__*/React.forwardRef(TextInput), {
23284
+ TrailingAction: TextInputTrailingAction$1
23285
+ });
22806
23286
 
22807
23287
  const theme = {
22808
23288
  breakpoints,
@@ -23233,17 +23713,18 @@ const useOutsideClick = ({
23233
23713
  });
23234
23714
  };
23235
23715
 
23236
- exports.ActionList = index$b;
23716
+ exports.ActionList = index$d;
23237
23717
  exports.AnimatePresence = AnimatePresence;
23238
- exports.Avatar = index$a;
23239
- exports.Breadcrumbs = index$9;
23718
+ exports.Avatar = index$c;
23719
+ exports.Breadcrumbs = index$b;
23240
23720
  exports.Button = Button;
23241
- exports.Checkbox = index$8;
23721
+ exports.Checkbox = index$a;
23242
23722
  exports.Chip = Chip;
23243
- exports.Datagrid = index$7;
23723
+ exports.Datagrid = index$9;
23244
23724
  exports.DescriptionList = DescriptionList;
23245
- exports.Dialog = index$6;
23725
+ exports.Dialog = index$8;
23246
23726
  exports.DialogHandler = DialogHandler;
23727
+ exports.EmptyState = EmptyState;
23247
23728
  exports.EnigmaUI = index;
23248
23729
  exports.GradientText = GradientText;
23249
23730
  exports.Grid = Grid$1;
@@ -23255,16 +23736,17 @@ exports.ItemList = ItemList;
23255
23736
  exports.MotionView = MotionView;
23256
23737
  exports.Overlay = Overlay$1;
23257
23738
  exports.OverlayPopper = OverlayPopper;
23258
- exports.Pagination = index$4;
23259
- exports.Pill = index$3;
23260
- exports.Select = index$2;
23739
+ exports.OverlaySelectInput = index$6;
23740
+ exports.Pagination = index$5;
23741
+ exports.Pill = index$4;
23742
+ exports.Select = index$3;
23261
23743
  exports.Space = Space;
23262
23744
  exports.Spinner = Spinner;
23263
23745
  exports.Stack = Stack$1;
23264
23746
  exports.StyledIcon = StyledIcon;
23265
- exports.Tab = index$1;
23747
+ exports.Tab = index$2;
23266
23748
  exports.Text = Text;
23267
- exports.TextInput = TextInput;
23749
+ exports.TextInput = index$1;
23268
23750
  exports.Textarea = Textarea;
23269
23751
  exports.ThemeProvider = ThemeProvider;
23270
23752
  exports.Toast = Toast;