@teamturing/react-kit 2.74.0 → 2.76.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.
Files changed (41) hide show
  1. package/dist/core/Datagrid/DatagridBody.d.ts +3 -3
  2. package/dist/core/Datagrid/DatagridCell.d.ts +8 -3
  3. package/dist/core/Datagrid/DatagridHeader.d.ts +2 -2
  4. package/dist/core/Datagrid/DatagridRow.d.ts +8 -3
  5. package/dist/core/Datagrid/DatagridRowList.d.ts +21 -0
  6. package/dist/core/Datagrid/index.d.ts +9 -5
  7. package/dist/core/Drawer/index.d.ts +3 -3
  8. package/dist/core/FormControl/index.d.ts +9 -2
  9. package/dist/core/Grid/index.d.ts +4 -4
  10. package/dist/core/Spinner/index.d.ts +12 -0
  11. package/dist/core/StyledIcon/index.d.ts +2 -2
  12. package/dist/core/Toast/index.d.ts +3 -3
  13. package/dist/index.d.ts +1 -1
  14. package/dist/index.js +251 -77
  15. package/dist/theme/index.d.ts +30 -0
  16. package/esm/core/ClickArea/index.js +20 -10
  17. package/esm/core/Datagrid/DatagridBody.js +2 -0
  18. package/esm/core/Datagrid/DatagridCell.js +3 -0
  19. package/esm/core/Datagrid/DatagridRow.js +13 -2
  20. package/esm/core/Datagrid/DatagridRowList.js +33 -0
  21. package/esm/core/Datagrid/index.js +26 -1
  22. package/esm/core/DescriptionList/index.js +5 -1
  23. package/esm/core/Dialog/index.js +1 -0
  24. package/esm/core/Drawer/index.js +7 -1
  25. package/esm/core/Flash/index.js +4 -1
  26. package/esm/core/FormControl/FormControlCaption.js +2 -2
  27. package/esm/core/FormControl/FormControlErrorMessage.js +3 -2
  28. package/esm/core/FormControl/FormControlSuccessMessage.js +3 -2
  29. package/esm/core/FormControl/index.js +29 -11
  30. package/esm/core/IconButton/index.js +8 -1
  31. package/esm/core/IconToggleButton/index.js +25 -15
  32. package/esm/core/Overlay/index.js +1 -1
  33. package/esm/core/SearchSelectInput/index.js +6 -1
  34. package/esm/core/Spinner/index.js +9 -0
  35. package/esm/core/StyledIcon/index.js +31 -15
  36. package/esm/core/Switch/index.js +1 -0
  37. package/esm/core/Tab/TabItem.js +1 -0
  38. package/esm/core/Tab/index.js +2 -0
  39. package/esm/core/Toast/index.js +7 -2
  40. package/esm/theme/index.js +10 -0
  41. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
- import { PropsWithChildren } from 'react';
1
+ import { AriaAttributes, HTMLAttributes, PropsWithChildren } from 'react';
2
2
  import { SxProp } from '../../utils/styled-system';
3
- type Props = {} & SxProp;
4
- declare const DatagridBody: ({ ...props }: PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element;
3
+ type Props = {} & SxProp & Pick<HTMLAttributes<HTMLDivElement>, 'id' | 'role'> & AriaAttributes;
4
+ declare const DatagridBody: ({ role, ...props }: PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element;
5
5
  export default DatagridBody;
6
6
  export type { Props as DatagridBodyProps };
@@ -1,6 +1,11 @@
1
- import { PropsWithChildren } from 'react';
1
+ import { AriaAttributes, HTMLAttributes, PropsWithChildren } from 'react';
2
2
  import { GridUnitProps } from '../Grid';
3
- type Props = {} & Pick<GridUnitProps, 'size' | 'sx'>;
4
- declare const DatagridCell: ({ children, ...props }: PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element;
3
+ type Props = {
4
+ /**
5
+ * 셀을 열 헤더(`columnheader`)로 표시합니다. 기본값(`false`)은 데이터 셀(`cell`)입니다.
6
+ */
7
+ columnHeader?: boolean;
8
+ } & Pick<GridUnitProps, 'size' | 'sx'> & Pick<HTMLAttributes<HTMLDivElement>, 'id' | 'role' | 'tabIndex'> & AriaAttributes;
9
+ declare const DatagridCell: ({ children, columnHeader, role, ...props }: PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element;
5
10
  export default DatagridCell;
6
11
  export type { Props as DatagridCellProps };
@@ -1,9 +1,9 @@
1
- import { ElementType, HTMLAttributes, ReactElement, ReactNode } from 'react';
1
+ import { AriaAttributes, ElementType, HTMLAttributes, ReactElement, ReactNode } from 'react';
2
2
  import { SxProp } from '../../utils/styled-system';
3
3
  type Props = {
4
4
  leadingVisual?: ElementType | ReactNode;
5
5
  trailingAction?: ReactElement<HTMLAttributes<HTMLElement>>;
6
- } & SxProp;
6
+ } & SxProp & Pick<HTMLAttributes<HTMLDivElement>, 'id'> & AriaAttributes;
7
7
  declare const DatagridHeader: ({ leadingVisual: LeadingVisual, trailingAction, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
8
8
  export default DatagridHeader;
9
9
  export type { Props as DatagridHeaderProps };
@@ -1,7 +1,12 @@
1
- import { PropsWithChildren } from 'react';
1
+ import { AriaAttributes, HTMLAttributes, PropsWithChildren } from 'react';
2
2
  import { GridProps } from '../Grid';
3
3
  import { SpaceProps } from '../Space';
4
- type Props = {} & Pick<GridProps, 'gapX' | 'alignItems' | 'justifyContent'> & Pick<SpaceProps, 'p' | 'px' | 'py' | 'pt' | 'pr' | 'pb' | 'pl' | 'padding' | 'paddingX' | 'paddingY' | 'paddingTop' | 'paddingRight' | 'paddingBottom' | 'paddingLeft' | 'sx'>;
5
- declare const DatagridRow: ({ gapX, alignItems, justifyContent, children, ...props }: PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element;
4
+ type Props = {
5
+ /**
6
+ * 행을 열 제목 행으로 표시합니다. `true`이면 하위 `Datagrid.Cell`들이 열 헤더(`columnheader`)로 처리됩니다.
7
+ */
8
+ columnHeader?: boolean;
9
+ } & Pick<GridProps, 'gapX' | 'alignItems' | 'justifyContent'> & Pick<SpaceProps, 'p' | 'px' | 'py' | 'pt' | 'pr' | 'pb' | 'pl' | 'padding' | 'paddingX' | 'paddingY' | 'paddingTop' | 'paddingRight' | 'paddingBottom' | 'paddingLeft' | 'sx'> & Pick<HTMLAttributes<HTMLDivElement>, 'id' | 'role' | 'tabIndex'> & AriaAttributes;
10
+ declare const DatagridRow: ({ gapX, alignItems, justifyContent, columnHeader, role, children, ...props }: PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element;
6
11
  export default DatagridRow;
7
12
  export type { Props as DatagridRowProps };
@@ -0,0 +1,21 @@
1
+ import { ReactNode } from 'react';
2
+ import { ItemListProps } from '../ItemList';
3
+ import { DatagridCellProps } from './DatagridCell';
4
+ import { DatagridRowProps } from './DatagridRow';
5
+ type Props<T extends {
6
+ id: string;
7
+ }> = {
8
+ rows: readonly T[];
9
+ columns: readonly {
10
+ field: string;
11
+ size: DatagridCellProps['size'];
12
+ renderValue: (row: T, index: number) => ReactNode;
13
+ }[];
14
+ rowProps?: DatagridRowProps;
15
+ columnsTransformer?: (columns: Props<T>['columns']) => typeof columns;
16
+ } & Pick<ItemListProps<T>, 'renderItemWrapper' | 'emptyState'>;
17
+ declare const DatagridRowList: <T extends {
18
+ id: string;
19
+ }>({ rows, columns, rowProps, renderItemWrapper, emptyState, columnsTransformer, }: Props<T>) => import("react/jsx-runtime").JSX.Element;
20
+ export default DatagridRowList;
21
+ export type { Props as DatagridRowListProps };
@@ -4,13 +4,17 @@ import { DatagridBodyProps } from './DatagridBody';
4
4
  import { DatagridCellProps } from './DatagridCell';
5
5
  import { DatagridHeaderProps } from './DatagridHeader';
6
6
  import { DatagridRowProps } from './DatagridRow';
7
+ import { DatagridRowListProps } from './DatagridRowList';
7
8
  type Props = {} & HTMLAttributes<HTMLDivElement> & SxProp;
8
- declare const _default: (({ children, sx, ...props }: PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element) & {
9
+ declare const _default: (({ children, sx, role, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, ...props }: PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element) & {
9
10
  Header: ({ leadingVisual: LeadingVisual, trailingAction, ...props }: DatagridHeaderProps) => import("react/jsx-runtime").JSX.Element;
10
11
  Subheader: ({ ...props }: PropsWithChildren<SxProp>) => import("react/jsx-runtime").JSX.Element;
11
- Body: ({ ...props }: PropsWithChildren<SxProp>) => import("react/jsx-runtime").JSX.Element;
12
- Row: ({ gapX, alignItems, justifyContent, children, ...props }: PropsWithChildren<DatagridRowProps>) => import("react/jsx-runtime").JSX.Element;
13
- Cell: ({ children, ...props }: PropsWithChildren<Pick<import("../Grid").GridUnitProps, "size" | "sx">>) => import("react/jsx-runtime").JSX.Element;
12
+ Body: ({ role, ...props }: PropsWithChildren<DatagridBodyProps>) => import("react/jsx-runtime").JSX.Element;
13
+ Row: ({ gapX, alignItems, justifyContent, columnHeader, role, children, ...props }: PropsWithChildren<DatagridRowProps>) => import("react/jsx-runtime").JSX.Element;
14
+ RowList: <T extends {
15
+ id: string;
16
+ }>({ rows, columns, rowProps, renderItemWrapper, emptyState, columnsTransformer, }: DatagridRowListProps<T>) => import("react/jsx-runtime").JSX.Element;
17
+ Cell: ({ children, columnHeader, role, ...props }: PropsWithChildren<DatagridCellProps>) => import("react/jsx-runtime").JSX.Element;
14
18
  };
15
19
  export default _default;
16
- export type { Props as DatagridProps, DatagridBodyProps, DatagridCellProps, DatagridHeaderProps, DatagridRowProps };
20
+ export type { Props as DatagridProps, DatagridBodyProps, DatagridCellProps, DatagridHeaderProps, DatagridRowProps, DatagridRowListProps, };
@@ -1,4 +1,4 @@
1
- import { PropsWithChildren, RefObject } from 'react';
1
+ import { HTMLAttributes, PropsWithChildren, RefObject } from 'react';
2
2
  import { SxProp } from '../../utils/styled-system';
3
3
  import { DrawerBodyProps } from './DrawerBody';
4
4
  import { DrawerFooterProps } from './DrawerFooter';
@@ -16,7 +16,7 @@ type Props = {
16
16
  size?: DrawerSizeType;
17
17
  direction?: DrawerDirectionType;
18
18
  initialFocusRef?: RefObject<HTMLElement>;
19
- } & SxProp;
19
+ } & Pick<HTMLAttributes<HTMLDivElement>, 'aria-label' | 'aria-labelledby'> & SxProp;
20
20
  declare const _default: import("react").ForwardRefExoticComponent<{
21
21
  isOpen?: boolean | undefined;
22
22
  onDismiss?: (() => void) | undefined;
@@ -24,7 +24,7 @@ declare const _default: import("react").ForwardRefExoticComponent<{
24
24
  size?: DrawerSizeType | undefined;
25
25
  direction?: DrawerDirectionType | undefined;
26
26
  initialFocusRef?: RefObject<HTMLElement> | undefined;
27
- } & SxProp & {
27
+ } & Pick<HTMLAttributes<HTMLDivElement>, "aria-label" | "aria-labelledby"> & SxProp & {
28
28
  children?: import("react").ReactNode;
29
29
  } & import("react").RefAttributes<HTMLDivElement>> & {
30
30
  UnstyledHeader: import("styled-components").IStyledComponent<"web", {
@@ -30,8 +30,15 @@ type FormControlFieldProps = {
30
30
  label: string;
31
31
  caption?: string;
32
32
  };
33
- type FormControlContextValue = {} & Omit<Props, 'additionalInputComponentCandidates'>;
34
- declare const FormControlContext: import("react").Context<Omit<Props, "additionalInputComponentCandidates">>;
33
+ type FormControlContextValue = {
34
+ /**
35
+ * `Caption`, `ErrorMessage`, `SuccessMessage`가 Input과 `aria-describedby`로 연결되기 위한 고유 ID입니다.
36
+ */
37
+ captionId?: string;
38
+ errorId?: string;
39
+ successId?: string;
40
+ } & Omit<Props, 'additionalInputComponentCandidates'>;
41
+ declare const FormControlContext: import("react").Context<FormControlContextValue>;
35
42
  declare const _default: import("react").ForwardRefExoticComponent<{
36
43
  /**
37
44
  * `FormControl`의 Input 요소를 컨트롤하기 위한 ID입니다. `Label`, `Caption`과 연결짓기 위해 사용합니다.
@@ -1,5 +1,5 @@
1
1
  import { SpaceKey } from '@teamturing/token-studio';
2
- import { HTMLAttributes, PropsWithChildren } from 'react';
2
+ import { AriaAttributes, HTMLAttributes, PropsWithChildren } from 'react';
3
3
  import { ResponsiveValue } from 'styled-system';
4
4
  import { AsProp } from '../../utils/styled-system';
5
5
  import { ViewProps } from '../View';
@@ -11,11 +11,11 @@ type Props = {
11
11
  * 화면의 레이아웃을 위해 사용하는 경우 document size를 넘어가는 경우를 방지하기 위해 사용합니다.
12
12
  */
13
13
  layout?: boolean;
14
- } & Pick<ViewProps, 'alignItems' | 'justifyContent' | 'sx'> & Pick<HTMLAttributes<HTMLDivElement>, 'className'> & AsProp;
14
+ } & Pick<ViewProps, 'alignItems' | 'justifyContent' | 'sx'> & Pick<HTMLAttributes<HTMLDivElement>, 'className' | 'id' | 'role' | 'tabIndex'> & AriaAttributes & AsProp;
15
15
  type UnitSizeType = 'min' | 'max' | number;
16
16
  type GridUnitProps = {
17
17
  size: ResponsiveValue<UnitSizeType>;
18
- } & Pick<ViewProps, 'order' | 'sx'> & Pick<HTMLAttributes<HTMLDivElement>, 'className'> & AsProp;
18
+ } & Pick<ViewProps, 'order' | 'sx'> & Pick<HTMLAttributes<HTMLDivElement>, 'className' | 'id' | 'role' | 'tabIndex'> & AriaAttributes & AsProp;
19
19
  declare const _default: import("react").ForwardRefExoticComponent<{
20
20
  gapX?: ResponsiveValue<0 | 1 | 20 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | 12 | 14 | 16 | 18 | "-80" | "-50" | "-48" | "-40" | "-32" | "-30" | "-28" | "-24" | "-20" | "-18" | "-16" | "-14" | "-12" | "-10" | "-8" | "-7" | "-6" | "-5" | "-4" | "-3" | "-2" | "-1" | "-0.5" | "-0.25" | 0.25 | 0.5 | 24 | 28 | 30 | 32 | 40 | 48 | 50 | 80> | undefined;
21
21
  gapY?: ResponsiveValue<0 | 1 | 20 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | 12 | 14 | 16 | 18 | "-80" | "-50" | "-48" | "-40" | "-32" | "-30" | "-28" | "-24" | "-20" | "-18" | "-16" | "-14" | "-12" | "-10" | "-8" | "-7" | "-6" | "-5" | "-4" | "-3" | "-2" | "-1" | "-0.5" | "-0.25" | 0.25 | 0.5 | 24 | 28 | 30 | 32 | 40 | 48 | 50 | 80> | undefined;
@@ -24,7 +24,7 @@ declare const _default: import("react").ForwardRefExoticComponent<{
24
24
  * 화면의 레이아웃을 위해 사용하는 경우 document size를 넘어가는 경우를 방지하기 위해 사용합니다.
25
25
  */
26
26
  layout?: boolean | undefined;
27
- } & Pick<ViewProps, "alignItems" | "justifyContent" | "sx"> & Pick<HTMLAttributes<HTMLDivElement>, "className"> & AsProp & {
27
+ } & Pick<ViewProps, "alignItems" | "justifyContent" | "sx"> & Pick<HTMLAttributes<HTMLDivElement>, "className" | "id" | "tabIndex" | "role"> & AriaAttributes & AsProp & {
28
28
  children?: import("react").ReactNode;
29
29
  } & import("react").RefAttributes<HTMLDivElement>> & {
30
30
  Unit: ({ size, as, children, ...props }: PropsWithChildren<GridUnitProps>) => import("react/jsx-runtime").JSX.Element;
@@ -2,9 +2,21 @@ import { SVGProps } from 'react';
2
2
  type SpinnerVariantType = 'progress-gradient' | 'progress-line';
3
3
  type Props = {
4
4
  variant?: SpinnerVariantType;
5
+ /**
6
+ * 스크린 리더에 읽힐 로딩 상태 텍스트를 정의합니다.
7
+ * 빈 문자열(`''`)을 전달하면 장식용으로 간주되어 보조 기술에서 숨겨집니다.
8
+ * @default '로딩 중'
9
+ */
10
+ label?: string;
5
11
  } & Omit<SVGProps<SVGSVGElement>, 'ref'>;
6
12
  declare const Spinner: import("react").ForwardRefExoticComponent<{
7
13
  variant?: SpinnerVariantType | undefined;
14
+ /**
15
+ * 스크린 리더에 읽힐 로딩 상태 텍스트를 정의합니다.
16
+ * 빈 문자열(`''`)을 전달하면 장식용으로 간주되어 보조 기술에서 숨겨집니다.
17
+ * @default '로딩 중'
18
+ */
19
+ label?: string | undefined;
8
20
  } & Omit<SVGProps<SVGSVGElement>, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
9
21
  export default Spinner;
10
22
  export type { Props as SpinnerProps };
@@ -5,12 +5,12 @@ type Props = {
5
5
  * @teamturing/icons와 함께 사용
6
6
  */
7
7
  icon: ComponentType<SVGProps<SVGSVGElement>>;
8
- } & Pick<ViewProps, 'size' | 'color' | 'sx'> & Pick<HTMLAttributes<HTMLDivElement>, 'className'>;
8
+ } & Pick<ViewProps, 'size' | 'color' | 'sx'> & Pick<HTMLAttributes<HTMLDivElement>, 'className' | 'aria-label' | 'aria-hidden'>;
9
9
  declare const StyledIcon: import("react").ForwardRefExoticComponent<{
10
10
  /**
11
11
  * @teamturing/icons와 함께 사용
12
12
  */
13
13
  icon: ComponentType<SVGProps<SVGSVGElement>>;
14
- } & Pick<ViewProps, "color" | "size" | "sx"> & Pick<HTMLAttributes<HTMLDivElement>, "className"> & import("react").RefAttributes<HTMLDivElement>>;
14
+ } & Pick<ViewProps, "color" | "size" | "sx"> & Pick<HTMLAttributes<HTMLDivElement>, "className" | "aria-hidden" | "aria-label"> & import("react").RefAttributes<HTMLDivElement>>;
15
15
  export default StyledIcon;
16
16
  export type { Props as StyledIconProps };
@@ -1,4 +1,4 @@
1
- import { ComponentType, PropsWithChildren, SVGProps } from 'react';
1
+ import { ComponentType, HTMLAttributes, PropsWithChildren, SVGProps } from 'react';
2
2
  import { ResponsiveValue } from 'styled-system';
3
3
  type ToastVariantType = 'success' | 'warning';
4
4
  type Props = {
@@ -16,7 +16,7 @@ type Props = {
16
16
  * 반응형 디자인이 적용됩니다.
17
17
  */
18
18
  resizing?: ResponsiveValue<'hug' | 'fill'>;
19
- };
20
- declare const Toast: ({ variant, icon: Icon, resizing, children, }: PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element;
19
+ } & HTMLAttributes<HTMLDivElement>;
20
+ declare const Toast: ({ variant, icon: Icon, resizing, children, ...props }: PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element;
21
21
  export default Toast;
22
22
  export type { Props as ToastProps };
package/dist/index.d.ts CHANGED
@@ -32,7 +32,7 @@ export type { ClickAreaProps } from './core/ClickArea';
32
32
  export { default as CounterBadge } from './core/CounterBadge';
33
33
  export type { CounterBadgeProps } from './core/CounterBadge';
34
34
  export { default as Datagrid } from './core/Datagrid';
35
- export type { DatagridProps, DatagridBodyProps, DatagridCellProps, DatagridHeaderProps, DatagridRowProps, } from './core/Datagrid';
35
+ export type { DatagridProps, DatagridBodyProps, DatagridCellProps, DatagridHeaderProps, DatagridRowProps, DatagridRowListProps, } from './core/Datagrid';
36
36
  export { default as DescriptionList } from './core/DescriptionList';
37
37
  export type { DescriptionListProps } from './core/DescriptionList';
38
38
  export { default as Dialog } from './core/Dialog';