@teamturing/react-kit 2.16.3 → 2.17.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.
@@ -0,0 +1,6 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { SxProp } from '../../utils/styled-system';
3
+ type Props = {} & SxProp;
4
+ declare const DatagridSubheader: ({ ...props }: PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element;
5
+ export default DatagridSubheader;
6
+ export type { Props as DatagridSubheaderProps };
@@ -7,6 +7,7 @@ import { DatagridRowProps } from './DatagridRow';
7
7
  type Props = {} & HTMLAttributes<HTMLDivElement> & SxProp;
8
8
  declare const _default: (({ children, sx, ...props }: PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element) & {
9
9
  Header: ({ leadingVisual: LeadingVisual, trailingAction, ...props }: DatagridHeaderProps) => import("react/jsx-runtime").JSX.Element;
10
+ Subheader: ({ ...props }: PropsWithChildren<SxProp>) => import("react/jsx-runtime").JSX.Element;
10
11
  Body: ({ ...props }: PropsWithChildren<SxProp>) => import("react/jsx-runtime").JSX.Element;
11
12
  Row: ({ gapX, alignItems, justifyContent, sx, children, ...props }: PropsWithChildren<DatagridRowProps>) => import("react/jsx-runtime").JSX.Element;
12
13
  Cell: ({ children, ...props }: PropsWithChildren<Pick<import("../Grid").GridUnitProps, "size" | "sx">>) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { HTMLAttributes, RefObject } from 'react';
2
2
  import { MaxHeightProps, ResponsiveValue } from 'styled-system';
3
3
  import { SxProp } from '../../utils/styled-system';
4
- type OverlaySizeType = 's' | 'm' | 'l';
4
+ type OverlaySizeType = 's' | 'm' | 'l' | 'auto';
5
5
  type Props = {
6
6
  isOpen?: boolean;
7
7
  onDismiss?: () => void;
@@ -1,55 +1,71 @@
1
- import { ComponentType, ElementType, ReactNode, SVGProps } from 'react';
1
+ import { ComponentType, ElementType, HTMLAttributes, ReactNode, SVGProps, MouseEvent as ReactMouseEvent, KeyboardEvent as ReactKeyboardEvent } from 'react';
2
2
  import { ResponsiveValue } from 'styled-system';
3
3
  import { SxProp } from '../../utils/styled-system';
4
4
  type Props = {
5
- text?: string;
6
5
  /**
7
6
  * 크기를 정의합니다.
8
7
  * 반응형 디자인이 적용됩니다.
9
8
  */
10
- size?: ResponsiveValue<'l' | 'm' | 's'>;
9
+ size?: ResponsiveValue<'m'>;
11
10
  /**
12
11
  * 색을 정의합니다.
13
12
  * hover, active, focused, disabled, loading 등의 모든 상황에 관여합니다.
14
13
  */
15
- variant?: ResponsiveValue<'secondary'>;
14
+ variant?: ResponsiveValue<'outlined'>;
15
+ /**
16
+ *
17
+ */
18
+ disabled?: boolean;
16
19
  /**
17
20
  * text 앞에 보여질 시각적 요소를 정의합니다. Icon, Image 등이 될 수 있습니다.
18
21
  */
19
22
  leadingVisual?: ElementType | ReactNode;
20
23
  /**
21
- * 없앨 있을 onRemove를 넘기면 삭제 버튼이 trailingVisual 자리에 생깁니다.
24
+ * text 뒤에 보여질 시각적 요소를 정의합니다. Icon, Image 등이 수 있습니다.
25
+ */
26
+ trailingVisual?: ElementType | ReactNode;
27
+ /**
28
+ * 없앨 수 있을 때 onRemove를 넘기면 삭제 버튼이 생깁니다.
22
29
  */
23
- onRemove?: () => void;
30
+ onRemove?: (event: ReactMouseEvent<HTMLDivElement> | ReactKeyboardEvent<HTMLDivElement>) => void;
24
31
  /**
25
32
  * onRemove가 undefined가 아닐 때 나오는 삭제 버튼의 아이콘을 정의합니다.
26
33
  */
27
34
  removeIcon?: ComponentType<SVGProps<SVGSVGElement>>;
28
- } & SxProp;
35
+ } & SxProp & Pick<HTMLAttributes<HTMLSpanElement>, 'onClick'>;
29
36
  declare const _default: import("react").ForwardRefExoticComponent<{
30
- text?: string | undefined;
31
37
  /**
32
38
  * 크기를 정의합니다.
33
39
  * 반응형 디자인이 적용됩니다.
34
40
  */
35
- size?: ResponsiveValue<"m" | "s" | "l"> | undefined;
41
+ size?: ResponsiveValue<"m"> | undefined;
36
42
  /**
37
43
  * 색을 정의합니다.
38
44
  * hover, active, focused, disabled, loading 등의 모든 상황에 관여합니다.
39
45
  */
40
- variant?: ResponsiveValue<"secondary"> | undefined;
46
+ variant?: ResponsiveValue<"outlined"> | undefined;
47
+ /**
48
+ *
49
+ */
50
+ disabled?: boolean | undefined;
41
51
  /**
42
52
  * text 앞에 보여질 시각적 요소를 정의합니다. Icon, Image 등이 될 수 있습니다.
43
53
  */
44
54
  leadingVisual?: string | number | boolean | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | import("react").ReactPortal | null | undefined;
45
55
  /**
46
- * 없앨 있을 onRemove를 넘기면 삭제 버튼이 trailingVisual 자리에 생깁니다.
56
+ * text 뒤에 보여질 시각적 요소를 정의합니다. Icon, Image 등이 수 있습니다.
57
+ */
58
+ trailingVisual?: string | number | boolean | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | import("react").ReactPortal | null | undefined;
59
+ /**
60
+ * 없앨 수 있을 때 onRemove를 넘기면 삭제 버튼이 생깁니다.
47
61
  */
48
- onRemove?: (() => void) | undefined;
62
+ onRemove?: ((event: ReactKeyboardEvent<HTMLDivElement> | ReactMouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
49
63
  /**
50
64
  * onRemove가 undefined가 아닐 때 나오는 삭제 버튼의 아이콘을 정의합니다.
51
65
  */
52
66
  removeIcon?: ComponentType<SVGProps<SVGSVGElement>> | undefined;
53
- } & SxProp & import("react").RefAttributes<HTMLSpanElement>>;
67
+ } & SxProp & Pick<HTMLAttributes<HTMLSpanElement>, "onClick"> & {
68
+ children?: ReactNode;
69
+ } & import("react").RefAttributes<HTMLButtonElement>>;
54
70
  export default _default;
55
71
  export type { Props as PillProps };
@@ -0,0 +1,11 @@
1
+ import { ComponentType, SVGProps } from 'react';
2
+ import { SxProp } from '../../utils/styled-system';
3
+ import { UnstyledButtonProps } from '../_UnstyledButton';
4
+ type Props = {
5
+ icon: ComponentType<SVGProps<SVGSVGElement>>;
6
+ } & UnstyledButtonProps;
7
+ declare const _default: import("react").ForwardRefExoticComponent<{
8
+ icon: ComponentType<SVGProps<SVGSVGElement>>;
9
+ } & import("react").ButtonHTMLAttributes<HTMLButtonElement> & SxProp & import("react").RefAttributes<HTMLButtonElement>>;
10
+ export default _default;
11
+ export type { Props as TextInputTrailingActionProps };
@@ -17,23 +17,27 @@ type Props = {
17
17
  */
18
18
  trailingAction?: React.ReactElement<HTMLProps<HTMLButtonElement>>;
19
19
  } & InputHTMLAttributes<HTMLInputElement>;
20
- declare const TextInput: import("react").ForwardRefExoticComponent<{
20
+ declare const _default: import("react").ForwardRefExoticComponent<{
21
21
  /**
22
22
  * TODO asdf
23
23
  */
24
- validationStatus?: 'error' | 'success' | undefined;
24
+ validationStatus?: "error" | "success" | undefined;
25
25
  /**
26
26
  * 입력 창 앞에 보여질 시각적 요소를 정의합니다. Icon, Text, Image 등이 될 수 있습니다.
27
27
  */
28
- leadingVisual?: ElementType | ReactNode;
28
+ leadingVisual?: string | number | boolean | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | import("react").ReactPortal | null | undefined;
29
29
  /**
30
30
  * 입력 창 뒤에 보여질 시각적 요소를 정의합니다. Icon, Text, Image 등이 될 수 있습니다.
31
31
  */
32
- trailingVisual?: ElementType | ReactNode;
32
+ trailingVisual?: string | number | boolean | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | import("react").ReactPortal | null | undefined;
33
33
  /**
34
34
  * 입력 창 뒤에 사용작용할 요소를 정의합니다.
35
35
  */
36
36
  trailingAction?: import("react").ReactElement<HTMLProps<HTMLButtonElement>, string | import("react").JSXElementConstructor<any>> | undefined;
37
- } & InputHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>>;
38
- export default TextInput;
37
+ } & InputHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>> & {
38
+ TrailingAction: import("react").ForwardRefExoticComponent<{
39
+ icon: import("react").ComponentType<import("react").SVGProps<SVGSVGElement>>;
40
+ } & import("react").ButtonHTMLAttributes<HTMLButtonElement> & import("../..").SxProp & import("react").RefAttributes<HTMLButtonElement>>;
41
+ };
42
+ export default _default;
39
43
  export type { Props as TextInputProps };
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$c = 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$b = /*#__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$a = 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$9 = /*#__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$8 = 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$7 = /*#__PURE__*/React.forwardRef(Dialog);
18722
18754
 
18723
18755
  const useDialogHandler = () => {
18724
18756
  const [isOpen, setIsOpen] = React.useState(false);
@@ -18949,13 +18981,16 @@ const BaseOverlay = styled__default.default.div`
18949
18981
  prop: 'size',
18950
18982
  variants: {
18951
18983
  s: {
18952
- width: forcePixelValue(256)
18984
+ width: forcePixelValue(180)
18953
18985
  },
18954
18986
  m: {
18955
- width: forcePixelValue(320)
18987
+ width: forcePixelValue(256)
18956
18988
  },
18957
18989
  l: {
18958
- width: forcePixelValue(480)
18990
+ width: forcePixelValue(320)
18991
+ },
18992
+ auto: {
18993
+ width: 'auto'
18959
18994
  }
18960
18995
  }
18961
18996
  })}
@@ -20277,7 +20312,7 @@ const computePosition = (reference, floating, options) => {
20277
20312
  });
20278
20313
  };
20279
20314
 
20280
- var index$5 = typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect;
20315
+ var index$6 = typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect;
20281
20316
 
20282
20317
  // Fork of `fast-deep-equal` that only does the comparisons we need and compares
20283
20318
  // functions
@@ -20342,7 +20377,7 @@ function roundByDPR(element, value) {
20342
20377
 
20343
20378
  function useLatestRef(value) {
20344
20379
  const ref = React__namespace.useRef(value);
20345
- index$5(() => {
20380
+ index$6(() => {
20346
20381
  ref.current = value;
20347
20382
  });
20348
20383
  return ref;
@@ -20427,7 +20462,7 @@ function useFloating(options) {
20427
20462
  }
20428
20463
  });
20429
20464
  }, [latestMiddleware, placement, strategy, platformRef]);
20430
- index$5(() => {
20465
+ index$6(() => {
20431
20466
  if (open === false && dataRef.current.isPositioned) {
20432
20467
  dataRef.current.isPositioned = false;
20433
20468
  setData(data => ({
@@ -20437,13 +20472,13 @@ function useFloating(options) {
20437
20472
  }
20438
20473
  }, [open]);
20439
20474
  const isMountedRef = React__namespace.useRef(false);
20440
- index$5(() => {
20475
+ index$6(() => {
20441
20476
  isMountedRef.current = true;
20442
20477
  return () => {
20443
20478
  isMountedRef.current = false;
20444
20479
  };
20445
20480
  }, []);
20446
- index$5(() => {
20481
+ index$6(() => {
20447
20482
  if (referenceEl) referenceRef.current = referenceEl;
20448
20483
  if (floatingEl) floatingRef.current = floatingEl;
20449
20484
  if (referenceEl && floatingEl) {
@@ -20866,43 +20901,80 @@ const PaginationTruncationIndicator = styled__default.default.div`
20866
20901
 
20867
20902
  ${sx}
20868
20903
  `;
20869
- var index$4 = Object.assign(Pagination, {
20904
+ var index$5 = Object.assign(Pagination, {
20870
20905
  Page: PaginationPage,
20871
20906
  PageDirection: PaginationPageDirection,
20872
20907
  TruncationIndicator: PaginationTruncationIndicator
20873
20908
  });
20874
20909
 
20875
20910
  const Pill = ({
20876
- text,
20911
+ children,
20877
20912
  size = 'm',
20878
- variant = 'secondary',
20913
+ variant = 'outlined',
20914
+ disabled = false,
20879
20915
  leadingVisual: LeadingVisual,
20880
- onRemove,
20916
+ trailingVisual: TrailingVisual,
20917
+ onRemove: propOnRemove,
20881
20918
  removeIcon: RemoveIcon = SvgClose,
20882
20919
  ...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`
20920
+ }, ref) => {
20921
+ const handleRemove = React.useCallback(event => {
20922
+ propOnRemove?.(event);
20923
+ }, [propOnRemove]);
20924
+ const handleRemoveClick = React.useCallback(event => {
20925
+ if (disabled) return;
20926
+ handleRemove(event);
20927
+ }, [handleRemove, disabled]);
20928
+ const handleRemoveKeydown = React.useCallback(event => {
20929
+ if (disabled) return;
20930
+ if ([' ', 'Enter'].includes(event.key)) {
20931
+ handleRemove(event);
20932
+ }
20933
+ }, [handleRemove, disabled]);
20934
+ return /*#__PURE__*/jsxRuntimeExports.jsxs(BasePill, {
20935
+ ref: ref,
20936
+ size: size,
20937
+ variant: variant,
20938
+ hasLeadingVisual: !isNullable(LeadingVisual),
20939
+ hasRemoveButton: !isNullable(propOnRemove),
20940
+ disabled: disabled,
20941
+ ...props,
20942
+ children: [typeof LeadingVisual !== 'string' && reactIsExports.isValidElementType(LeadingVisual) ? /*#__PURE__*/jsxRuntimeExports.jsx(LeadingVisual, {}) : LeadingVisual, /*#__PURE__*/jsxRuntimeExports.jsx("span", {
20943
+ title: children?.toString(),
20944
+ children: children
20945
+ }), typeof TrailingVisual !== 'string' && reactIsExports.isValidElementType(TrailingVisual) ? /*#__PURE__*/jsxRuntimeExports.jsx(TrailingVisual, {}) : TrailingVisual, propOnRemove ? /*#__PURE__*/jsxRuntimeExports.jsx("div", {
20946
+ onClick: e => {
20947
+ e.preventDefault();
20948
+ handleRemoveClick(e);
20949
+ e.stopPropagation();
20950
+ },
20951
+ onKeyDown: e => {
20952
+ if ([' ', 'Enter'].includes(e.key)) {
20953
+ e.preventDefault();
20954
+ e.stopPropagation();
20955
+ handleRemoveKeydown(e);
20956
+ return;
20957
+ }
20958
+ },
20959
+ "aria-label": 'Remove Pill',
20960
+ role: 'button',
20961
+ "aria-disabled": disabled,
20962
+ tabIndex: disabled ? -1 : 0,
20963
+ children: /*#__PURE__*/jsxRuntimeExports.jsx(RemoveIcon, {})
20964
+ }) : null]
20965
+ });
20966
+ };
20967
+ const BasePill = styled__default.default(UnstyledButton)`
20901
20968
  display: inline-flex;
20902
20969
  align-items: center;
20903
20970
  border-radius: ${({
20904
20971
  theme
20905
- }) => forcePixelValue(theme.radii.xxs)};
20972
+ }) => forcePixelValue(theme.radii.xs)};
20973
+ column-gap: ${({
20974
+ theme
20975
+ }) => forcePixelValue(theme.space[2])};
20976
+
20977
+ transition: background-color 100ms;
20906
20978
 
20907
20979
  & span {
20908
20980
  max-width: 240px;
@@ -20911,93 +20983,95 @@ const BasePill = styled__default.default.span`
20911
20983
  white-space: pre;
20912
20984
  word-break: break-all;
20913
20985
  }
20914
- & > button {
20986
+
20987
+ &:focus-visible {
20988
+ outline-color: ${({
20989
+ theme
20990
+ }) => theme.colors['border/focused']};
20991
+ outline-style: solid;
20992
+ outline-width: ${forcePixelValue(2)};
20993
+ outline-offset: ${({
20994
+ theme
20995
+ }) => forcePixelValue(theme.space[0.5])};
20996
+ }
20997
+
20998
+ & > div {
20915
20999
  display: flex;
20916
- transition: background-color 100ms;
20917
21000
  border-radius: ${({
20918
21001
  theme
20919
- }) => forcePixelValue(theme.radii.full)};
21002
+ }) => forcePixelValue(theme.radii.xxs)};
21003
+ }
21004
+ & > div:focus-visible {
21005
+ outline-color: ${({
21006
+ theme
21007
+ }) => theme.colors['border/focused']};
21008
+ outline-style: solid;
21009
+ outline-width: ${forcePixelValue(2)};
21010
+ outline-offset: ${({
21011
+ theme
21012
+ }) => forcePixelValue(theme.space[-0.5])};
20920
21013
  }
20921
21014
 
20922
21015
  ${({
20923
21016
  theme,
20924
- hasLeadingVisual,
20925
21017
  hasRemoveButton
20926
21018
  }) => variant({
20927
21019
  prop: 'size',
20928
21020
  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
21021
  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,
21022
+ 'pl': 3,
21023
+ 'pr': !hasRemoveButton ? 3 : 1,
21024
+ 'height': forcePixelValue(32),
20967
21025
  'fontSize': theme.fontSizes.xxs,
20968
21026
  'fontWeight': theme.fontWeights.medium,
20969
21027
  'lineHeight': theme.lineHeights[2],
20970
- 'columnGap': 0.5,
21028
+ 'columnGap': 1,
20971
21029
  '& svg': {
20972
21030
  minWidth: 12,
20973
- height: 12,
20974
- color: theme.colors['icon/primary']
21031
+ height: 12
20975
21032
  },
20976
- '& button': {
20977
- p: 0.5
21033
+ '& > div': {
21034
+ p: 1
20978
21035
  }
20979
21036
  }
20980
21037
  }
20981
21038
  })}
20982
21039
  ${({
20983
- theme
21040
+ theme,
21041
+ disabled
20984
21042
  }) => variant({
20985
21043
  prop: 'variant',
20986
21044
  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']
21045
+ outlined: {
21046
+ 'backgroundColor': theme.colors['bg/neutral/subtler'],
21047
+ 'borderWidth': 1,
21048
+ 'borderStyle': 'solid',
21049
+ 'borderColor': theme.colors['border/neutral'],
21050
+ 'color': 'text/neutral/subtle',
21051
+ '& svg': {
21052
+ color: theme.colors['icon/neutral/bolder']
21053
+ },
21054
+ '&:hover': {
21055
+ backgroundColor: theme.colors['bg/neutral/subtler/hovered']
21056
+ },
21057
+ '&:active': {
21058
+ backgroundColor: theme.colors['bg/neutral/subtler/pressed']
21059
+ },
21060
+ ...(disabled ? {
21061
+ 'cursor': 'not-allowed',
21062
+ 'backgroundColor': theme.colors['bg/disabled'],
21063
+ 'color': theme.colors['text/disabled'],
21064
+ '& svg': {
21065
+ color: theme.colors['icon/disabled']
20993
21066
  }
20994
- }
21067
+ } : {})
20995
21068
  }
20996
21069
  }
20997
21070
  })}
21071
+
20998
21072
  ${sx}
20999
21073
  `;
21000
- var index$3 = /*#__PURE__*/React.forwardRef(Pill);
21074
+ var index$4 = /*#__PURE__*/React.forwardRef(Pill);
21001
21075
 
21002
21076
  const Select = ({
21003
21077
  children,
@@ -21027,8 +21101,8 @@ const Select = ({
21027
21101
  'color': 'text/neutral',
21028
21102
  '& > svg': {
21029
21103
  display: 'block',
21030
- width: 20,
21031
- height: 20,
21104
+ width: 16,
21105
+ height: 16,
21032
21106
  color: 'icon/neutral/bold'
21033
21107
  }
21034
21108
  },
@@ -21169,7 +21243,7 @@ const SelectWrapper = styled__default.default.div`
21169
21243
  ${props => props.hasLeadingVisual && styled.css`
21170
21244
  padding-left: ${forcePixelValue(props.theme.space[5])};
21171
21245
  select {
21172
- padding-left: ${forcePixelValue(props.theme.space[3])};
21246
+ padding-left: ${forcePixelValue(props.theme.space[2])};
21173
21247
  }
21174
21248
  `}
21175
21249
 
@@ -21216,7 +21290,7 @@ const BaseSelect = styled__default.default(UnstyledSelect)`
21216
21290
  text-overflow: ellipsis;
21217
21291
  `;
21218
21292
  const SelectOption = styled__default.default.option``;
21219
- var index$2 = Object.assign( /*#__PURE__*/React.forwardRef(Select), {
21293
+ var index$3 = Object.assign( /*#__PURE__*/React.forwardRef(Select), {
21220
21294
  Option: SelectOption
21221
21295
  });
21222
21296
 
@@ -22443,7 +22517,7 @@ const Tab = ({
22443
22517
  })
22444
22518
  });
22445
22519
  };
22446
- var index$1 = Object.assign(Tab, {
22520
+ var index$2 = Object.assign(Tab, {
22447
22521
  Item: TabItem
22448
22522
  });
22449
22523
 
@@ -22597,7 +22671,57 @@ const BaseTextarea = styled__default.default(UnstyledTextarea)`
22597
22671
  resize: none;
22598
22672
  `;
22599
22673
 
22600
- const TextInput = /*#__PURE__*/React.forwardRef(({
22674
+ const TextInputTrailingAction = ({
22675
+ icon: Icon,
22676
+ disabled,
22677
+ ...props
22678
+ }, ref) => /*#__PURE__*/jsxRuntimeExports.jsx(BaseTextInputTrailingAction, {
22679
+ ref: ref,
22680
+ ...props,
22681
+ disabled: disabled,
22682
+ "aria-disabled": disabled,
22683
+ children: /*#__PURE__*/jsxRuntimeExports.jsx(Icon, {})
22684
+ });
22685
+ const BaseTextInputTrailingAction = styled__default.default(UnstyledButton)`
22686
+ display: inline-flex;
22687
+ padding: ${({
22688
+ theme
22689
+ }) => forcePixelValue(theme.space[2])};
22690
+ background-color: ${({
22691
+ theme
22692
+ }) => theme.colors['bg/neutral/subtler']};
22693
+ border-radius: ${({
22694
+ theme
22695
+ }) => forcePixelValue(theme.radii.full)};
22696
+
22697
+ & svg {
22698
+ width: ${forcePixelValue(16)};
22699
+ height: ${forcePixelValue(16)};
22700
+ color: ${({
22701
+ theme
22702
+ }) => theme.colors['icon/neutral/bolder']};
22703
+ }
22704
+
22705
+ &:hover {
22706
+ background-color: ${({
22707
+ theme
22708
+ }) => theme.colors['bg/neutral/subtler/hovered']};
22709
+ }
22710
+
22711
+ &[aria-disabled='true'] {
22712
+ cursor: not-allowed;
22713
+ & svg {
22714
+ color: ${({
22715
+ theme
22716
+ }) => theme.colors['icon/disabled']};
22717
+ }
22718
+ }
22719
+
22720
+ ${sx}
22721
+ `;
22722
+ var TextInputTrailingAction$1 = /*#__PURE__*/React.forwardRef(TextInputTrailingAction);
22723
+
22724
+ const TextInput = ({
22601
22725
  type = 'text',
22602
22726
  disabled,
22603
22727
  validationStatus,
@@ -22625,8 +22749,8 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
22625
22749
  'color': color$1['text/neutral'],
22626
22750
  '& > svg': {
22627
22751
  display: 'block',
22628
- width: 20,
22629
- height: 20,
22752
+ width: 16,
22753
+ height: 16,
22630
22754
  color: color$1['icon/neutral/bold']
22631
22755
  }
22632
22756
  },
@@ -22650,8 +22774,8 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
22650
22774
  'color': color$1['text/neutral'],
22651
22775
  '& > svg': {
22652
22776
  display: 'block',
22653
- width: 24,
22654
- height: 24,
22777
+ width: 16,
22778
+ height: 16,
22655
22779
  color: color$1['icon/neutral/bold']
22656
22780
  }
22657
22781
  },
@@ -22660,7 +22784,7 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
22660
22784
  }) : null]
22661
22785
  })]
22662
22786
  });
22663
- });
22787
+ };
22664
22788
  const TextInputWrapper = styled__default.default.div`
22665
22789
  position: relative;
22666
22790
  width: ${forcePixelValue('100%')};
@@ -22757,17 +22881,25 @@ const TextInputWrapper = styled__default.default.div`
22757
22881
  ${props => props.hasLeadingVisual && styled.css`
22758
22882
  padding-left: ${forcePixelValue(props.theme.space[5])};
22759
22883
  input {
22760
- padding-left: ${forcePixelValue(props.theme.space[3])};
22884
+ padding-left: ${forcePixelValue(props.theme.space[2])};
22761
22885
  }
22762
22886
  `}
22763
22887
 
22764
- ${props => (props.hasTrailingVisual || props.hasTrailingAction) && styled.css`
22888
+ ${props => props.hasTrailingVisual && styled.css`
22889
+ padding-right: ${forcePixelValue(props.theme.space[5])};
22890
+ `}
22891
+
22892
+ ${props => props.hasTrailingAction && styled.css`
22765
22893
  padding-right: ${forcePixelValue(props.theme.space[3])};
22894
+ `}
22895
+
22896
+ ${props => (props.hasTrailingVisual || props.hasTrailingAction) && styled.css`
22766
22897
  input {
22767
- padding-right: ${forcePixelValue(props.theme.space[3])};
22898
+ padding-right: ${forcePixelValue(props.theme.space[2])};
22768
22899
  }
22769
22900
  `}
22770
22901
 
22902
+
22771
22903
  transition: color 100ms, background-color 100ms;
22772
22904
  &:after {
22773
22905
  transition: border-color 100ms;
@@ -22795,7 +22927,7 @@ const BaseInput = styled__default.default(UnstyledInput)`
22795
22927
  }) => forcePixelValue(theme.space['4'])};
22796
22928
  padding-right: ${({
22797
22929
  theme
22798
- }) => forcePixelValue(theme.space['4'])};
22930
+ }) => forcePixelValue(theme.space['5'])};
22799
22931
  padding-bottom: ${({
22800
22932
  theme
22801
22933
  }) => forcePixelValue(theme.space['4'])};
@@ -22803,6 +22935,9 @@ const BaseInput = styled__default.default(UnstyledInput)`
22803
22935
  theme
22804
22936
  }) => forcePixelValue(theme.space['5'])};
22805
22937
  `;
22938
+ var index$1 = Object.assign( /*#__PURE__*/React.forwardRef(TextInput), {
22939
+ TrailingAction: TextInputTrailingAction$1
22940
+ });
22806
22941
 
22807
22942
  const theme = {
22808
22943
  breakpoints,
@@ -23233,16 +23368,16 @@ const useOutsideClick = ({
23233
23368
  });
23234
23369
  };
23235
23370
 
23236
- exports.ActionList = index$b;
23371
+ exports.ActionList = index$c;
23237
23372
  exports.AnimatePresence = AnimatePresence;
23238
- exports.Avatar = index$a;
23239
- exports.Breadcrumbs = index$9;
23373
+ exports.Avatar = index$b;
23374
+ exports.Breadcrumbs = index$a;
23240
23375
  exports.Button = Button;
23241
- exports.Checkbox = index$8;
23376
+ exports.Checkbox = index$9;
23242
23377
  exports.Chip = Chip;
23243
- exports.Datagrid = index$7;
23378
+ exports.Datagrid = index$8;
23244
23379
  exports.DescriptionList = DescriptionList;
23245
- exports.Dialog = index$6;
23380
+ exports.Dialog = index$7;
23246
23381
  exports.DialogHandler = DialogHandler;
23247
23382
  exports.EnigmaUI = index;
23248
23383
  exports.GradientText = GradientText;
@@ -23255,16 +23390,16 @@ exports.ItemList = ItemList;
23255
23390
  exports.MotionView = MotionView;
23256
23391
  exports.Overlay = Overlay$1;
23257
23392
  exports.OverlayPopper = OverlayPopper;
23258
- exports.Pagination = index$4;
23259
- exports.Pill = index$3;
23260
- exports.Select = index$2;
23393
+ exports.Pagination = index$5;
23394
+ exports.Pill = index$4;
23395
+ exports.Select = index$3;
23261
23396
  exports.Space = Space;
23262
23397
  exports.Spinner = Spinner;
23263
23398
  exports.Stack = Stack$1;
23264
23399
  exports.StyledIcon = StyledIcon;
23265
- exports.Tab = index$1;
23400
+ exports.Tab = index$2;
23266
23401
  exports.Text = Text;
23267
- exports.TextInput = TextInput;
23402
+ exports.TextInput = index$1;
23268
23403
  exports.Textarea = Textarea;
23269
23404
  exports.ThemeProvider = ThemeProvider;
23270
23405
  exports.Toast = Toast;
@@ -1,4 +1,5 @@
1
1
  import styled from 'styled-components';
2
+ import { forcePixelValue } from '../../utils/forcePixelValue.js';
2
3
  import { sx } from '../../utils/styled-system/index.js';
3
4
  import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js';
4
5
 
@@ -10,6 +11,14 @@ const DatagridBody = ({
10
11
  const BaseDatagridBody = styled.div`
11
12
  width: inherit;
12
13
 
14
+ & > div:not(:last-child) {
15
+ border-bottom-width: ${forcePixelValue(1)};
16
+ border-bottom-style: solid;
17
+ border-bottom-color: ${({
18
+ theme
19
+ }) => theme.colors['border/neutral']};
20
+ }
21
+
13
22
  ${sx}
14
23
  `;
15
24
 
@@ -0,0 +1,28 @@
1
+ import styled from 'styled-components';
2
+ import { forcePixelValue } from '../../utils/forcePixelValue.js';
3
+ import { sx } from '../../utils/styled-system/index.js';
4
+ import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js';
5
+
6
+ const DatagridSubheader = ({
7
+ ...props
8
+ }) => /*#__PURE__*/jsxRuntimeExports.jsx(DataGridSubheaderWrapper, {
9
+ ...props
10
+ });
11
+ const DataGridSubheaderWrapper = styled.div`
12
+ padding: ${({
13
+ theme
14
+ }) => `${forcePixelValue(theme.space[2])} ${forcePixelValue(theme.space[4])}`};
15
+ background-color: ${({
16
+ theme
17
+ }) => theme.colors.surface};
18
+
19
+ border-bottom-width: ${forcePixelValue(1)};
20
+ border-bottom-style: solid;
21
+ border-bottom-color: ${({
22
+ theme
23
+ }) => theme.colors['border/neutral']};
24
+
25
+ ${sx};
26
+ `;
27
+
28
+ export { DatagridSubheader as default };
@@ -6,6 +6,7 @@ import DatagridBody from './DatagridBody.js';
6
6
  import DatagridCell from './DatagridCell.js';
7
7
  import DatagridHeader from './DatagridHeader.js';
8
8
  import DatagridRow from './DatagridRow.js';
9
+ import DatagridSubheader from './DatagridSubheader.js';
9
10
  import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js';
10
11
 
11
12
  const Datagrid = ({
@@ -16,12 +17,13 @@ const Datagrid = ({
16
17
  const [relocatableComponentsObject, restConmponents] = useRelocation({
17
18
  children,
18
19
  config: {
19
- header: DatagridHeader
20
+ header: DatagridHeader,
21
+ subHeader: DatagridSubheader
20
22
  }
21
23
  });
22
24
  return /*#__PURE__*/jsxRuntimeExports.jsxs(DatagridWrapper, {
23
25
  sx: sx,
24
- children: [relocatableComponentsObject.header, /*#__PURE__*/jsxRuntimeExports.jsx(BaseDatagrid, {
26
+ children: [relocatableComponentsObject.header, relocatableComponentsObject.subHeader, /*#__PURE__*/jsxRuntimeExports.jsx(BaseDatagrid, {
25
27
  ...props,
26
28
  children: restConmponents
27
29
  })]
@@ -48,6 +50,7 @@ const BaseDatagrid = styled.div`
48
50
  `;
49
51
  var index = Object.assign(Datagrid, {
50
52
  Header: DatagridHeader,
53
+ Subheader: DatagridSubheader,
51
54
  Body: DatagridBody,
52
55
  Row: DatagridRow,
53
56
  Cell: DatagridCell
@@ -92,13 +92,16 @@ const BaseOverlay = styled.div`
92
92
  prop: 'size',
93
93
  variants: {
94
94
  s: {
95
- width: forcePixelValue(256)
95
+ width: forcePixelValue(180)
96
96
  },
97
97
  m: {
98
- width: forcePixelValue(320)
98
+ width: forcePixelValue(256)
99
99
  },
100
100
  l: {
101
- width: forcePixelValue(480)
101
+ width: forcePixelValue(320)
102
+ },
103
+ auto: {
104
+ width: 'auto'
102
105
  }
103
106
  }
104
107
  })}
@@ -1,4 +1,4 @@
1
- import { forwardRef } from 'react';
1
+ import { forwardRef, useCallback } from 'react';
2
2
  import SvgClose from '../../packages/icons/esm/Close.js';
3
3
  import { r as reactIsExports } from '../../node_modules/react-is/index.js';
4
4
  import styled from 'styled-components';
@@ -11,36 +11,73 @@ import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js'
11
11
  import { variant } from '../../node_modules/@styled-system/variant/dist/index.esm.js';
12
12
 
13
13
  const Pill = ({
14
- text,
14
+ children,
15
15
  size = 'm',
16
- variant = 'secondary',
16
+ variant = 'outlined',
17
+ disabled = false,
17
18
  leadingVisual: LeadingVisual,
18
- onRemove,
19
+ trailingVisual: TrailingVisual,
20
+ onRemove: propOnRemove,
19
21
  removeIcon: RemoveIcon = SvgClose,
20
22
  ...props
21
- }, ref) => /*#__PURE__*/jsxRuntimeExports.jsxs(BasePill, {
22
- ref: ref,
23
- size: size,
24
- variant: variant,
25
- hasLeadingVisual: !isNullable(LeadingVisual),
26
- hasRemoveButton: !isNullable(onRemove),
27
- ...props,
28
- children: [typeof LeadingVisual !== 'string' && reactIsExports.isValidElementType(LeadingVisual) ? /*#__PURE__*/jsxRuntimeExports.jsx(LeadingVisual, {}) : LeadingVisual, /*#__PURE__*/jsxRuntimeExports.jsx("span", {
29
- title: text,
30
- children: text
31
- }), onRemove ? /*#__PURE__*/jsxRuntimeExports.jsx(UnstyledButton, {
32
- type: 'button',
33
- onClick: onRemove,
34
- "aria-label": 'Remove Pill',
35
- children: /*#__PURE__*/jsxRuntimeExports.jsx(RemoveIcon, {})
36
- }) : null]
37
- });
38
- const BasePill = styled.span`
23
+ }, ref) => {
24
+ const handleRemove = useCallback(event => {
25
+ propOnRemove?.(event);
26
+ }, [propOnRemove]);
27
+ const handleRemoveClick = useCallback(event => {
28
+ if (disabled) return;
29
+ handleRemove(event);
30
+ }, [handleRemove, disabled]);
31
+ const handleRemoveKeydown = useCallback(event => {
32
+ if (disabled) return;
33
+ if ([' ', 'Enter'].includes(event.key)) {
34
+ handleRemove(event);
35
+ }
36
+ }, [handleRemove, disabled]);
37
+ return /*#__PURE__*/jsxRuntimeExports.jsxs(BasePill, {
38
+ ref: ref,
39
+ size: size,
40
+ variant: variant,
41
+ hasLeadingVisual: !isNullable(LeadingVisual),
42
+ hasRemoveButton: !isNullable(propOnRemove),
43
+ disabled: disabled,
44
+ ...props,
45
+ children: [typeof LeadingVisual !== 'string' && reactIsExports.isValidElementType(LeadingVisual) ? /*#__PURE__*/jsxRuntimeExports.jsx(LeadingVisual, {}) : LeadingVisual, /*#__PURE__*/jsxRuntimeExports.jsx("span", {
46
+ title: children?.toString(),
47
+ children: children
48
+ }), typeof TrailingVisual !== 'string' && reactIsExports.isValidElementType(TrailingVisual) ? /*#__PURE__*/jsxRuntimeExports.jsx(TrailingVisual, {}) : TrailingVisual, propOnRemove ? /*#__PURE__*/jsxRuntimeExports.jsx("div", {
49
+ onClick: e => {
50
+ e.preventDefault();
51
+ handleRemoveClick(e);
52
+ e.stopPropagation();
53
+ },
54
+ onKeyDown: e => {
55
+ if ([' ', 'Enter'].includes(e.key)) {
56
+ e.preventDefault();
57
+ e.stopPropagation();
58
+ handleRemoveKeydown(e);
59
+ return;
60
+ }
61
+ },
62
+ "aria-label": 'Remove Pill',
63
+ role: 'button',
64
+ "aria-disabled": disabled,
65
+ tabIndex: disabled ? -1 : 0,
66
+ children: /*#__PURE__*/jsxRuntimeExports.jsx(RemoveIcon, {})
67
+ }) : null]
68
+ });
69
+ };
70
+ const BasePill = styled(UnstyledButton)`
39
71
  display: inline-flex;
40
72
  align-items: center;
41
73
  border-radius: ${({
42
74
  theme
43
- }) => forcePixelValue(theme.radii.xxs)};
75
+ }) => forcePixelValue(theme.radii.xs)};
76
+ column-gap: ${({
77
+ theme
78
+ }) => forcePixelValue(theme.space[2])};
79
+
80
+ transition: background-color 100ms;
44
81
 
45
82
  & span {
46
83
  max-width: 240px;
@@ -49,90 +86,92 @@ const BasePill = styled.span`
49
86
  white-space: pre;
50
87
  word-break: break-all;
51
88
  }
52
- & > button {
89
+
90
+ &:focus-visible {
91
+ outline-color: ${({
92
+ theme
93
+ }) => theme.colors['border/focused']};
94
+ outline-style: solid;
95
+ outline-width: ${forcePixelValue(2)};
96
+ outline-offset: ${({
97
+ theme
98
+ }) => forcePixelValue(theme.space[0.5])};
99
+ }
100
+
101
+ & > div {
53
102
  display: flex;
54
- transition: background-color 100ms;
55
103
  border-radius: ${({
56
104
  theme
57
- }) => forcePixelValue(theme.radii.full)};
105
+ }) => forcePixelValue(theme.radii.xxs)};
106
+ }
107
+ & > div:focus-visible {
108
+ outline-color: ${({
109
+ theme
110
+ }) => theme.colors['border/focused']};
111
+ outline-style: solid;
112
+ outline-width: ${forcePixelValue(2)};
113
+ outline-offset: ${({
114
+ theme
115
+ }) => forcePixelValue(theme.space[-0.5])};
58
116
  }
59
117
 
60
118
  ${({
61
119
  theme,
62
- hasLeadingVisual,
63
120
  hasRemoveButton
64
121
  }) => variant({
65
122
  prop: 'size',
66
123
  variants: {
67
- l: {
68
- 'pl': hasLeadingVisual || hasRemoveButton ? 2 : 3,
69
- 'pr': hasRemoveButton ? 0.5 : hasLeadingVisual ? 2 : 3,
70
- 'py': 1,
71
- 'fontSize': theme.fontSizes.s,
72
- 'fontWeight': theme.fontWeights.medium,
73
- 'lineHeight': theme.lineHeights[2],
74
- 'columnGap': 1,
75
- '& svg': {
76
- minWidth: 16,
77
- height: 16,
78
- color: theme.colors['icon/primary']
79
- },
80
- '& button': {
81
- p: 1
82
- }
83
- },
84
124
  m: {
85
- 'pl': hasLeadingVisual || hasRemoveButton ? 2 : 3,
86
- 'pr': hasRemoveButton ? 1 : hasLeadingVisual ? 2 : 3,
87
- 'py': 1,
88
- 'fontSize': theme.fontSizes.xs,
89
- 'fontWeight': theme.fontWeights.medium,
90
- 'lineHeight': theme.lineHeights[2],
91
- 'columnGap': 0.5,
92
- '& svg': {
93
- minWidth: 16,
94
- height: 16,
95
- color: theme.colors['icon/primary']
96
- },
97
- '& button': {
98
- p: 0.5
99
- }
100
- },
101
- s: {
102
- 'pl': 2,
103
- 'pr': hasRemoveButton ? 1 : 2,
104
- 'py': 0.5,
125
+ 'pl': 3,
126
+ 'pr': !hasRemoveButton ? 3 : 1,
127
+ 'height': forcePixelValue(32),
105
128
  'fontSize': theme.fontSizes.xxs,
106
129
  'fontWeight': theme.fontWeights.medium,
107
130
  'lineHeight': theme.lineHeights[2],
108
- 'columnGap': 0.5,
131
+ 'columnGap': 1,
109
132
  '& svg': {
110
133
  minWidth: 12,
111
- height: 12,
112
- color: theme.colors['icon/primary']
134
+ height: 12
113
135
  },
114
- '& button': {
115
- p: 0.5
136
+ '& > div': {
137
+ p: 1
116
138
  }
117
139
  }
118
140
  }
119
141
  })}
120
142
  ${({
121
- theme
143
+ theme,
144
+ disabled
122
145
  }) => variant({
123
146
  prop: 'variant',
124
147
  variants: {
125
- secondary: {
126
- 'color': theme.colors['text/primary'],
127
- 'backgroundColor': theme.colors['bg/secondary'],
128
- '& button': {
129
- '&:hover': {
130
- backgroundColor: theme.colors['bg/secondary/hovered']
148
+ outlined: {
149
+ 'backgroundColor': theme.colors['bg/neutral/subtler'],
150
+ 'borderWidth': 1,
151
+ 'borderStyle': 'solid',
152
+ 'borderColor': theme.colors['border/neutral'],
153
+ 'color': 'text/neutral/subtle',
154
+ '& svg': {
155
+ color: theme.colors['icon/neutral/bolder']
156
+ },
157
+ '&:hover': {
158
+ backgroundColor: theme.colors['bg/neutral/subtler/hovered']
159
+ },
160
+ '&:active': {
161
+ backgroundColor: theme.colors['bg/neutral/subtler/pressed']
162
+ },
163
+ ...(disabled ? {
164
+ 'cursor': 'not-allowed',
165
+ 'backgroundColor': theme.colors['bg/disabled'],
166
+ 'color': theme.colors['text/disabled'],
167
+ '& svg': {
168
+ color: theme.colors['icon/disabled']
131
169
  }
132
- }
170
+ } : {})
133
171
  }
134
172
  }
135
173
  })}
174
+
136
175
  ${sx}
137
176
  `;
138
177
  var index = /*#__PURE__*/forwardRef(Pill);
@@ -38,8 +38,8 @@ const Select = ({
38
38
  'color': 'text/neutral',
39
39
  '& > svg': {
40
40
  display: 'block',
41
- width: 20,
42
- height: 20,
41
+ width: 16,
42
+ height: 16,
43
43
  color: 'icon/neutral/bold'
44
44
  }
45
45
  },
@@ -180,7 +180,7 @@ const SelectWrapper = styled.div`
180
180
  ${props => props.hasLeadingVisual && css`
181
181
  padding-left: ${forcePixelValue(props.theme.space[5])};
182
182
  select {
183
- padding-left: ${forcePixelValue(props.theme.space[3])};
183
+ padding-left: ${forcePixelValue(props.theme.space[2])};
184
184
  }
185
185
  `}
186
186
 
@@ -0,0 +1,58 @@
1
+ import { forwardRef } from 'react';
2
+ import styled from 'styled-components';
3
+ import { forcePixelValue } from '../../utils/forcePixelValue.js';
4
+ import { sx } from '../../utils/styled-system/index.js';
5
+ import UnstyledButton from '../_UnstyledButton.js';
6
+ import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js';
7
+
8
+ const TextInputTrailingAction = ({
9
+ icon: Icon,
10
+ disabled,
11
+ ...props
12
+ }, ref) => /*#__PURE__*/jsxRuntimeExports.jsx(BaseTextInputTrailingAction, {
13
+ ref: ref,
14
+ ...props,
15
+ disabled: disabled,
16
+ "aria-disabled": disabled,
17
+ children: /*#__PURE__*/jsxRuntimeExports.jsx(Icon, {})
18
+ });
19
+ const BaseTextInputTrailingAction = styled(UnstyledButton)`
20
+ display: inline-flex;
21
+ padding: ${({
22
+ theme
23
+ }) => forcePixelValue(theme.space[2])};
24
+ background-color: ${({
25
+ theme
26
+ }) => theme.colors['bg/neutral/subtler']};
27
+ border-radius: ${({
28
+ theme
29
+ }) => forcePixelValue(theme.radii.full)};
30
+
31
+ & svg {
32
+ width: ${forcePixelValue(16)};
33
+ height: ${forcePixelValue(16)};
34
+ color: ${({
35
+ theme
36
+ }) => theme.colors['icon/neutral/bolder']};
37
+ }
38
+
39
+ &:hover {
40
+ background-color: ${({
41
+ theme
42
+ }) => theme.colors['bg/neutral/subtler/hovered']};
43
+ }
44
+
45
+ &[aria-disabled='true'] {
46
+ cursor: not-allowed;
47
+ & svg {
48
+ color: ${({
49
+ theme
50
+ }) => theme.colors['icon/disabled']};
51
+ }
52
+ }
53
+
54
+ ${sx}
55
+ `;
56
+ var TextInputTrailingAction$1 = /*#__PURE__*/forwardRef(TextInputTrailingAction);
57
+
58
+ export { TextInputTrailingAction$1 as default };
@@ -8,9 +8,10 @@ import { forcePixelValue } from '../../utils/forcePixelValue.js';
8
8
  import { isFunction } from '../../utils/isFunction.js';
9
9
  import { isNullable } from '../../utils/isNullable.js';
10
10
  import View from '../View/index.js';
11
+ import TextInputTrailingAction from './TextInputTrailingAction.js';
11
12
  import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js';
12
13
 
13
- const TextInput = /*#__PURE__*/forwardRef(({
14
+ const TextInput = ({
14
15
  type = 'text',
15
16
  disabled,
16
17
  validationStatus,
@@ -38,8 +39,8 @@ const TextInput = /*#__PURE__*/forwardRef(({
38
39
  'color': color['text/neutral'],
39
40
  '& > svg': {
40
41
  display: 'block',
41
- width: 20,
42
- height: 20,
42
+ width: 16,
43
+ height: 16,
43
44
  color: color['icon/neutral/bold']
44
45
  }
45
46
  },
@@ -63,8 +64,8 @@ const TextInput = /*#__PURE__*/forwardRef(({
63
64
  'color': color['text/neutral'],
64
65
  '& > svg': {
65
66
  display: 'block',
66
- width: 24,
67
- height: 24,
67
+ width: 16,
68
+ height: 16,
68
69
  color: color['icon/neutral/bold']
69
70
  }
70
71
  },
@@ -73,7 +74,7 @@ const TextInput = /*#__PURE__*/forwardRef(({
73
74
  }) : null]
74
75
  })]
75
76
  });
76
- });
77
+ };
77
78
  const TextInputWrapper = styled.div`
78
79
  position: relative;
79
80
  width: ${forcePixelValue('100%')};
@@ -170,17 +171,25 @@ const TextInputWrapper = styled.div`
170
171
  ${props => props.hasLeadingVisual && css`
171
172
  padding-left: ${forcePixelValue(props.theme.space[5])};
172
173
  input {
173
- padding-left: ${forcePixelValue(props.theme.space[3])};
174
+ padding-left: ${forcePixelValue(props.theme.space[2])};
174
175
  }
175
176
  `}
176
177
 
177
- ${props => (props.hasTrailingVisual || props.hasTrailingAction) && css`
178
+ ${props => props.hasTrailingVisual && css`
179
+ padding-right: ${forcePixelValue(props.theme.space[5])};
180
+ `}
181
+
182
+ ${props => props.hasTrailingAction && css`
178
183
  padding-right: ${forcePixelValue(props.theme.space[3])};
184
+ `}
185
+
186
+ ${props => (props.hasTrailingVisual || props.hasTrailingAction) && css`
179
187
  input {
180
- padding-right: ${forcePixelValue(props.theme.space[3])};
188
+ padding-right: ${forcePixelValue(props.theme.space[2])};
181
189
  }
182
190
  `}
183
191
 
192
+
184
193
  transition: color 100ms, background-color 100ms;
185
194
  &:after {
186
195
  transition: border-color 100ms;
@@ -208,7 +217,7 @@ const BaseInput = styled(UnstyledInput)`
208
217
  }) => forcePixelValue(theme.space['4'])};
209
218
  padding-right: ${({
210
219
  theme
211
- }) => forcePixelValue(theme.space['4'])};
220
+ }) => forcePixelValue(theme.space['5'])};
212
221
  padding-bottom: ${({
213
222
  theme
214
223
  }) => forcePixelValue(theme.space['4'])};
@@ -216,5 +225,8 @@ const BaseInput = styled(UnstyledInput)`
216
225
  theme
217
226
  }) => forcePixelValue(theme.space['5'])};
218
227
  `;
228
+ var index = Object.assign( /*#__PURE__*/forwardRef(TextInput), {
229
+ TrailingAction: TextInputTrailingAction
230
+ });
219
231
 
220
- export { TextInput as default };
232
+ export { index as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamturing/react-kit",
3
- "version": "2.16.3",
3
+ "version": "2.17.0",
4
4
  "description": "React components, hooks for create teamturing web application",
5
5
  "author": "Sungchang Park <psch300@gmail.com> (https://github.com/psch300)",
6
6
  "homepage": "https://github.com/weareteamturing/bombe#readme",
@@ -62,5 +62,5 @@
62
62
  "react-is": "^18.2.0",
63
63
  "styled-system": "^5.1.5"
64
64
  },
65
- "gitHead": "5d22785a97a7991ab894c44c6ea913202821cd01"
65
+ "gitHead": "ca31c7add2913812b086f4862e431a3656c3f4f9"
66
66
  }