@team-monolith/cds 0.4.1 → 0.4.4

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 (91) hide show
  1. package/dist/components/InputBase.js +1 -1
  2. package/dist/index.d.ts +0 -2
  3. package/dist/index.js +0 -2
  4. package/package.json +4 -1
  5. package/dist/emotion.d.ts +0 -70
  6. package/dist/svg.d.ts +0 -10
  7. package/public/favicon.ico +0 -0
  8. package/public/index.html +0 -43
  9. package/public/logo192.png +0 -0
  10. package/public/logo512.png +0 -0
  11. package/public/manifest.json +0 -25
  12. package/public/robots.txt +0 -3
  13. package/src/App.tsx +0 -7
  14. package/src/cds/CodleDesignSystemProvider.tsx +0 -93
  15. package/src/cds/README.md +0 -23
  16. package/src/cds/components/AlertDialog/AlertDialog.tsx +0 -101
  17. package/src/cds/components/AlertDialog/AlertDialogActions.tsx +0 -34
  18. package/src/cds/components/AlertDialog/AlertDialogContent.tsx +0 -36
  19. package/src/cds/components/AlertDialog/AlertDialogTitle.tsx +0 -63
  20. package/src/cds/components/AlertDialog/index.tsx +0 -4
  21. package/src/cds/components/Banner.tsx +0 -176
  22. package/src/cds/components/Button.tsx +0 -256
  23. package/src/cds/components/CheckboxInput.tsx +0 -270
  24. package/src/cds/components/Input.tsx +0 -171
  25. package/src/cds/components/InputBase.tsx +0 -226
  26. package/src/cds/components/Pagination.tsx +0 -99
  27. package/src/cds/components/PinInput.tsx +0 -322
  28. package/src/cds/components/RadioInput.tsx +0 -226
  29. package/src/cds/components/SquareButton.tsx +0 -229
  30. package/src/cds/components/Switch.tsx +0 -129
  31. package/src/cds/components/Tag.tsx +0 -155
  32. package/src/cds/components/Tooltip.tsx +0 -104
  33. package/src/cds/emotion.d.ts +0 -70
  34. package/src/cds/foundation/color.ts +0 -83
  35. package/src/cds/foundation/shadows.ts +0 -17
  36. package/src/cds/icons/Arrows/index.ts +0 -2
  37. package/src/cds/icons/Media/index.ts +0 -2
  38. package/src/cds/icons/System/index.ts +0 -2
  39. package/src/cds/icons/arrows.tsx +0 -116
  40. package/src/cds/icons/brand.tsx +0 -13
  41. package/src/cds/icons/design.tsx +0 -15
  42. package/src/cds/icons/map.tsx +0 -14
  43. package/src/cds/icons/system.tsx +0 -143
  44. package/src/cds/index.ts +0 -68
  45. package/src/cds/patterns/Card/Card.tsx +0 -294
  46. package/src/cds/patterns/Card/class-icon.svg +0 -28
  47. package/src/cds/patterns/Card/index.tsx +0 -2
  48. package/src/cds/patterns/Card/material-icon.svg +0 -25
  49. package/src/cds/patterns/Card/problem-icon.svg +0 -25
  50. package/src/cds/patterns/Card/thumbnail/sample.png +0 -0
  51. package/src/cds/patterns/Dialog/Dialog.tsx +0 -57
  52. package/src/cds/patterns/Dialog/DialogContent.tsx +0 -28
  53. package/src/cds/patterns/Dialog/DialogNavigation.tsx +0 -29
  54. package/src/cds/patterns/Dialog/DialogNavigationContext.tsx +0 -9
  55. package/src/cds/patterns/Dialog/DialogNavigationItem.tsx +0 -42
  56. package/src/cds/patterns/Dialog/DialogPanel.tsx +0 -40
  57. package/src/cds/patterns/Dialog/DialogPanels.tsx +0 -24
  58. package/src/cds/patterns/Dialog/DialogPanelsContext.tsx +0 -9
  59. package/src/cds/patterns/Dialog/DialogTitle.tsx +0 -55
  60. package/src/cds/patterns/Dialog/index.tsx +0 -7
  61. package/src/cds/patterns/Dropdown/Dropdown.tsx +0 -111
  62. package/src/cds/patterns/Dropdown/DropdownItem.tsx +0 -203
  63. package/src/cds/patterns/Dropdown/DropdownMenu.tsx +0 -176
  64. package/src/cds/patterns/Dropdown/index.tsx +0 -2
  65. package/src/cds/patterns/EmptyState/EmptyState.tsx +0 -91
  66. package/src/cds/patterns/EmptyState/empty-state-icon.svg +0 -36
  67. package/src/cds/patterns/EmptyState/index.tsx +0 -2
  68. package/src/cds/patterns/Navigation/NavigationContext.tsx +0 -9
  69. package/src/cds/patterns/Navigation/NavigationHorizontal.tsx +0 -32
  70. package/src/cds/patterns/Navigation/NavigationItem.tsx +0 -36
  71. package/src/cds/patterns/Navigation/NavigationVertical.tsx +0 -39
  72. package/src/cds/patterns/Navigation/index.tsx +0 -3
  73. package/src/cds/patterns/SegmentedControl/SegmentedControlButton.tsx +0 -55
  74. package/src/cds/patterns/SegmentedControl/SegmentedControlGroup.tsx +0 -81
  75. package/src/cds/patterns/SegmentedControl/SegmentedControlGroupPropsContext.tsx +0 -9
  76. package/src/cds/patterns/SegmentedControl/SegmentedControlSquareButton.tsx +0 -51
  77. package/src/cds/patterns/SegmentedControl/index.ts +0 -3
  78. package/src/cds/patterns/Table/Table.tsx +0 -62
  79. package/src/cds/patterns/Table/TableBody.tsx +0 -30
  80. package/src/cds/patterns/Table/TableCell.tsx +0 -253
  81. package/src/cds/patterns/Table/TableHead.tsx +0 -30
  82. package/src/cds/patterns/Table/TablePropsContext.tsx +0 -9
  83. package/src/cds/patterns/Table/TableRow.tsx +0 -70
  84. package/src/cds/patterns/Table/TableVariantContext.tsx +0 -9
  85. package/src/cds/patterns/Table/index.tsx +0 -15
  86. package/src/cds/svg.d.ts +0 -10
  87. package/src/cds/utils/hover.tsx +0 -24
  88. package/src/cds/utils/reset.tsx +0 -19
  89. package/src/cds/utils/zIndex.tsx +0 -3
  90. package/src/index.tsx +0 -10
  91. package/tsconfig.json +0 -23
@@ -1,36 +0,0 @@
1
- import styled from "@emotion/styled";
2
- import React from "react";
3
- import Button from "../../components/Button";
4
- import { NavigationContext } from "./NavigationContext";
5
-
6
- export interface NavigationItemProps {
7
- className?: string;
8
-
9
- /** 주로 React Router의 NavLink 입니다. */
10
- component: React.ElementType;
11
- label: string;
12
- to: string;
13
- }
14
-
15
- export function NavigationItem(props: NavigationItemProps): React.ReactElement {
16
- const { className, component: Component, label, to } = props;
17
-
18
- const { size, type } = React.useContext(NavigationContext);
19
-
20
- return (
21
- <Component className={className} to={to}>
22
- {({ isActive }: { isActive: boolean }) => (
23
- <StyledButton
24
- type={type}
25
- size={size}
26
- label={label}
27
- color={isActive ? "secondary" : "textNeutral"}
28
- />
29
- )}
30
- </Component>
31
- );
32
- }
33
-
34
- const StyledButton = styled(Button)<{ type: string }>`
35
- ${({ type }) => type === "vertical" && `width: 100%;`}
36
- `;
@@ -1,39 +0,0 @@
1
- /** @jsxImportSource @emotion/react */
2
- import { css } from "@emotion/react";
3
- import { NavigationContext } from "./NavigationContext";
4
-
5
- export interface NavigationVerticalProps {
6
- className?: string;
7
- component?: React.ElementType;
8
- children?: React.ReactNode;
9
-
10
- /** 컴포넌트 크기 */
11
- size: "small" | "medium";
12
-
13
- /** 전체 너비 유무. Vertical 에서만 동작합니다. */
14
- fullWidth?: boolean;
15
- }
16
-
17
- /**
18
- * [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?node-id=181%3A92757)
19
- */
20
- export function NavigationVertical(
21
- props: NavigationVerticalProps
22
- ): React.ReactElement {
23
- const { className, component: Component = "nav", fullWidth, children } = props;
24
- return (
25
- <Component
26
- className={className}
27
- css={css`
28
- display: flex;
29
- width: ${fullWidth ? "100%" : "240px"};
30
- flex-direction: column;
31
- gap: 8px;
32
- `}
33
- >
34
- <NavigationContext.Provider value={{ size: props.size, type: "vertical" }}>
35
- {children}
36
- </NavigationContext.Provider>
37
- </Component>
38
- );
39
- }
@@ -1,3 +0,0 @@
1
- export * from "./NavigationHorizontal";
2
- export * from "./NavigationVertical";
3
- export * from "./NavigationItem";
@@ -1,55 +0,0 @@
1
- /** @jsxImportSource @emotion/react */
2
- import { css } from "@emotion/react";
3
- import { useContext } from "react";
4
- import Button, { ButtonProps } from "../../components/Button";
5
- import shadows from "../../foundation/shadows";
6
- import { SegmentedControlGroupPropsContext } from "./SegmentedControlGroupPropsContext";
7
- import styled from "@emotion/styled";
8
-
9
- export interface SegmentedControlButtonProps
10
- extends Omit<ButtonProps, "color" | "size"> {
11
- value: string;
12
- }
13
-
14
- /**
15
- * [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?node-id=181%3A89883)
16
- */
17
- export function SegmentedControlButton(props: SegmentedControlButtonProps) {
18
- const { onClick, ...other } = props;
19
-
20
- const context = useContext(SegmentedControlGroupPropsContext);
21
-
22
- const handleClick: React.MouseEventHandler<HTMLButtonElement> = (e) => {
23
- context.onClick?.(props.value);
24
- onClick?.(e);
25
- };
26
-
27
- const isActive = context.multiSelect
28
- ? context.value.includes(props.value)
29
- : context.value === props.value;
30
-
31
- return (
32
- <StyledButton
33
- css={css`
34
- display: flex;
35
- justify-content: center;
36
- flex-grow: 1;
37
- ${isActive && `box-shadow: ${shadows.shadow04};`}
38
- `}
39
- {...props}
40
- isActive={isActive}
41
- color={isActive ? "primary" : "textNeutral"}
42
- size={context.size}
43
- onClick={handleClick}
44
- />
45
- );
46
- }
47
-
48
- const StyledButton = styled(Button, {
49
- shouldForwardProp: (prop) => prop !== "isActive",
50
- })<{ isActive: boolean }>`
51
- display: flex;
52
- justify-content: center;
53
- flex-grow: 1;
54
- ${({ isActive }) => isActive && `box-shadow: ${shadows.shadow04};`}
55
- `;
@@ -1,81 +0,0 @@
1
- /** @jsxImportSource @emotion/react */
2
- import { css, useTheme } from "@emotion/react";
3
- import { ButtonSize } from "../../components/Button";
4
- import { SquareButtonSize } from "../../components/SquareButton";
5
- import { SegmentedControlGroupPropsContext } from "./SegmentedControlGroupPropsContext";
6
-
7
- export type SegmentedControlGroupProps = {
8
- className?: string;
9
- component?: React.ElementType;
10
- children?: React.ReactNode;
11
-
12
- /** 컴포넌트 크기 */
13
- size: ButtonSize | SquareButtonSize;
14
-
15
- /** 전체 너비 유무 */
16
- fullWidth?: boolean;
17
- } & (
18
- | {
19
- /** 중복 선택 가능 유무 */
20
- multiSelect?: false;
21
- /** 선택된 값 */
22
- value: string | undefined;
23
- onChange?: (newValue: string) => void;
24
- }
25
- | {
26
- multiSelect: true;
27
- value: string[];
28
- onChange?: (newValue: string[]) => void;
29
- }
30
- );
31
-
32
- /**
33
- * [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?node-id=181%3A89883)
34
- */
35
- export function SegmentedControlGroup(props: SegmentedControlGroupProps) {
36
- const {
37
- component: Component = "div",
38
- className,
39
- children,
40
- fullWidth,
41
- multiSelect,
42
- } = props;
43
-
44
- const theme = useTheme();
45
-
46
- return (
47
- <Component
48
- className={className}
49
- css={css`
50
- display: flex;
51
- gap: 4px;
52
-
53
- width: ${fullWidth ? "100%" : "fit-content"};
54
- background-color: ${theme.color.background.neutralAlt};
55
- border-radius: 8px;
56
- border: 1px solid ${theme.color.background.neutralAltActive};
57
- `}
58
- >
59
- <SegmentedControlGroupPropsContext.Provider
60
- value={{
61
- ...props,
62
- onClick: (newValue: string) => {
63
- if (multiSelect) {
64
- if (props.value.includes(newValue)) {
65
- props.onChange?.(
66
- props.value.filter((value) => value !== newValue)
67
- );
68
- } else {
69
- props.onChange?.([...props.value, newValue]);
70
- }
71
- } else {
72
- props.onChange?.(newValue);
73
- }
74
- },
75
- }}
76
- >
77
- {children}
78
- </SegmentedControlGroupPropsContext.Provider>
79
- </Component>
80
- );
81
- }
@@ -1,9 +0,0 @@
1
- import { createContext } from "react";
2
- import { SegmentedControlGroupProps } from "./SegmentedControlGroup";
3
-
4
- export const SegmentedControlGroupPropsContext = createContext<SegmentedControlGroupProps & {
5
- onClick?: (newValue: string) => void;
6
- }>({
7
- value: undefined,
8
- size: "medium",
9
- });
@@ -1,51 +0,0 @@
1
- /** @jsxImportSource @emotion/react */
2
- import styled from "@emotion/styled";
3
- import { useContext } from "react";
4
- import SquareButton, { SquareButtonProps } from "../../components/SquareButton";
5
- import shadows from "../../foundation/shadows";
6
- import { SegmentedControlGroupPropsContext } from "./SegmentedControlGroupPropsContext";
7
-
8
- export interface SegmentedControlSquareButtonProps
9
- extends Omit<SquareButtonProps, "color" | "size"> {
10
- value: string;
11
- }
12
-
13
- /**
14
- * [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?node-id=181%3A89883)
15
- */
16
- export function SegmentedControlSquareButton(
17
- props: SegmentedControlSquareButtonProps
18
- ) {
19
- const context = useContext(SegmentedControlGroupPropsContext);
20
-
21
- const isActive = context.multiSelect
22
- ? context.value.includes(props.value)
23
- : context.value === props.value;
24
-
25
- return (
26
- <StyledSquareButton
27
- {...props}
28
- isActive={isActive}
29
- color={isActive ? "primary" : "icon"}
30
- size={context.size}
31
- fullWidth={context.fullWidth}
32
- onClick={() => {
33
- if (context.onClick) {
34
- context.onClick(props.value);
35
- props.onClick?.();
36
- }
37
- }}
38
- />
39
- );
40
- }
41
-
42
- const StyledSquareButton = styled(SquareButton, {
43
- shouldForwardProp: (prop) => prop !== "isActive",
44
- })<{ isActive: boolean }>`
45
- display: flex;
46
- justify-content: center;
47
- flex-grow: 1;
48
- button {
49
- ${({ isActive }) => isActive && `box-shadow: ${shadows.shadow04};`}
50
- }
51
- `;
@@ -1,3 +0,0 @@
1
- export * from './SegmentedControlGroup';
2
- export * from './SegmentedControlButton';
3
- export * from './SegmentedControlSquareButton';
@@ -1,62 +0,0 @@
1
- /** @jsxImportSource @emotion/react */
2
- import { css, useTheme } from "@emotion/react";
3
- import React from "react";
4
- import { RESET_TABLE } from "../../utils/reset";
5
- import TablePropsContext from "./TablePropsContext";
6
-
7
- export type TableSize = "large" | "medium" | "small";
8
- export interface TableProps {
9
- className?: string;
10
- component?: React.ElementType;
11
-
12
- /** Table의 내용입니다. 일반적으로 `TableHead`와 `TableBody`로 구성됩니다. */
13
- children?: React.ReactNode;
14
-
15
- /** Table Row 사이즈 */
16
- size: TableSize;
17
-
18
- /** fullWidth 여부 */
19
- fullWidth?: boolean;
20
-
21
- /** `true`일 때 상호작용이 불가하며, 글자가 회색 처리됩니다. */
22
- disabled?: boolean;
23
- }
24
-
25
- /**
26
- * [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?type=design&node-id=181-91732&t=07ngLzGHuU3xxg4S-0)
27
- */
28
- export default function Table(props: TableProps) {
29
- const {
30
- className,
31
- component: Component = "table",
32
- children,
33
- size,
34
- disabled,
35
- fullWidth,
36
- } = props;
37
- const theme = useTheme();
38
- return (
39
- <Component
40
- className={className}
41
- css={[
42
- RESET_TABLE,
43
- css`
44
- border-collapse: separate;
45
-
46
- background: ${theme.color.background.neutralBase};
47
- border: 1px solid ${theme.color.background.neutralAlt};
48
- color: ${theme.color.foreground.neutralBase};
49
- border-radius: 4px;
50
- `,
51
- fullWidth &&
52
- css`
53
- width: 100%;
54
- `,
55
- ]}
56
- >
57
- <TablePropsContext.Provider value={{ size, disabled }}>
58
- {children}
59
- </TablePropsContext.Provider>
60
- </Component>
61
- );
62
- }
@@ -1,30 +0,0 @@
1
- /** @jsxImportSource @emotion/react */
2
- import { css } from "@emotion/react";
3
- import React from "react";
4
- import TableVariantContext from "./TableVariantContext";
5
-
6
- export interface TableBodyProps {
7
- className?: string;
8
- component?: React.ElementType;
9
-
10
- /** Table의 내용입니다. 일반적으로 TableRow로 구성됩니다. */
11
- children?: React.ReactNode;
12
- }
13
-
14
- export default function TableBody(props: TableBodyProps) {
15
- const { className, component: Component = "tbody", children } = props;
16
- return (
17
- <Component
18
- className={className}
19
- css={[
20
- css`
21
- display: table-row-group;
22
- `,
23
- ]}
24
- >
25
- <TableVariantContext.Provider value={{ variant: "body" }}>
26
- {children}
27
- </TableVariantContext.Provider>
28
- </Component>
29
- );
30
- }
@@ -1,253 +0,0 @@
1
- /** @jsxImportSource @emotion/react */
2
- import { css, useTheme } from "@emotion/react";
3
- import React, { useContext } from "react";
4
- import TableVariantContext from "./TableVariantContext";
5
- import TablePropsContext from "./TablePropsContext";
6
- import { TableSize } from "./Table";
7
- import {
8
- ArrowDownFillIcon,
9
- ArrowUpFillIcon,
10
- ExpandUpDownIcon,
11
- } from "../../icons/arrows";
12
- import styled from "@emotion/styled";
13
- import { RESET_BUTTON } from "../../utils/reset";
14
- import { FilterFillIcon } from "../../icons/system";
15
-
16
- export interface TableCellProps {
17
- className?: string;
18
- component?: React.ElementType;
19
-
20
- /* Cell의 col span 값 */
21
- colSpan?: number;
22
- /* sort 아이콘을 위한 인자입니다. undefined일때는 아이콘을 그리지 않습니다. */
23
- sort?: "asc" | "desc" | "none";
24
- /* filter 아이콘을 위한 인자입니다. undefined일때는 아이콘을 그리지 않습니다. */
25
- isFilterActive?: boolean;
26
- /* Cell을 클릭할 때 호출되는 함수 */
27
- onClick?: () => void;
28
- /* 정렬 버튼을 클릭할 때 호출되는 함수 */
29
- onSortClick?: React.MouseEventHandler<HTMLButtonElement>;
30
- /* 필터 버튼을 클릭할 때 호출되는 함수 */
31
- onFilterClick?: React.MouseEventHandler<HTMLButtonElement>;
32
- /* 필터 버튼의 ref */
33
- filterButttonRef?: React.MutableRefObject<HTMLButtonElement | null>;
34
- /** Cell의 내용입니다. */
35
- children?: React.ReactNode;
36
- }
37
-
38
- const SIZE_TO_STYLES = (size: TableSize) =>
39
- ({
40
- small: css`
41
- padding: 8px 8px;
42
- `,
43
- medium: css`
44
- padding: 12px 8px;
45
- `,
46
- large: css`
47
- padding: 16px 8px;
48
- `,
49
- }[size]);
50
-
51
- export default function TableCell(props: TableCellProps) {
52
- const {
53
- className,
54
- component: Component,
55
- children,
56
- sort,
57
- colSpan,
58
- isFilterActive,
59
- onFilterClick,
60
- onClick,
61
- onSortClick,
62
- filterButttonRef,
63
- } = props;
64
- // variant 값에 따라 th 태그로 그릴지, td 태그로 그릴지를 결정합니다.
65
- const { variant } = useContext(TableVariantContext);
66
- const Element = Component ?? variant === "head" ? "th" : "td";
67
- const { size, disabled } = useContext(TablePropsContext);
68
- const theme = useTheme();
69
-
70
- if (variant === "body") {
71
- return (
72
- <Element
73
- colSpan={colSpan}
74
- className={className}
75
- onClick={onClick}
76
- css={[
77
- SIZE_TO_STYLES(size ?? "medium"),
78
- css`
79
- font-style: normal;
80
- font-weight: 400;
81
- font-size: 16px;
82
- line-height: 24px;
83
- `,
84
- css`
85
- display: table-cell;
86
- text-align: initial;
87
-
88
- &:first-of-type {
89
- padding-left: 16px;
90
- }
91
-
92
- &:last-of-type {
93
- padding-right: 16px;
94
- }
95
- `,
96
- ]}
97
- >
98
- {children}
99
- </Element>
100
- );
101
- }
102
-
103
- return (
104
- <Element
105
- colSpan={colSpan}
106
- className={className}
107
- onClick={onClick}
108
- css={[
109
- SIZE_TO_STYLES(size ?? "medium"),
110
- Element === "th"
111
- ? css`
112
- background: ${theme.color.background.neutralAlt};
113
- font-style: normal;
114
- font-weight: 500;
115
- font-size: 14px;
116
- line-height: 16px;
117
- `
118
- : css`
119
- font-style: normal;
120
- font-weight: 400;
121
- font-size: 16px;
122
- line-height: 24px;
123
- `,
124
- css`
125
- display: table-cell;
126
- text-align: initial;
127
-
128
- &:first-of-type {
129
- padding-left: 16px;
130
- }
131
-
132
- &:last-of-type {
133
- padding-right: 16px;
134
- }
135
- `,
136
- ]}
137
- >
138
- <Cell>
139
- {children}
140
- <Buttons>
141
- {sort && (
142
- <SortButton
143
- sort={sort}
144
- onSortClick={onSortClick}
145
- disabled={disabled}
146
- />
147
- )}
148
- {isFilterActive !== undefined && (
149
- <FilterButton
150
- isFilterActive={isFilterActive ?? false}
151
- onFilterClick={onFilterClick}
152
- ref={filterButttonRef}
153
- disabled={disabled}
154
- />
155
- )}
156
- </Buttons>
157
- </Cell>
158
- </Element>
159
- );
160
- }
161
-
162
- const Cell = styled.span`
163
- display: flex;
164
- justify-content: space-between;
165
- align-items: center;
166
- `;
167
-
168
- const Buttons = styled.span`
169
- display: flex;
170
- gap: 4px;
171
- `;
172
-
173
- const SortButton = (props: {
174
- sort?: "asc" | "desc" | "none";
175
- onSortClick?: React.MouseEventHandler<HTMLButtonElement>;
176
- disabled?: boolean;
177
- }) => {
178
- let sortIcon = <></>;
179
- switch (props.sort) {
180
- case "asc":
181
- sortIcon = <ArrowDownFillIcon />;
182
- break;
183
- case "desc":
184
- sortIcon = <ArrowUpFillIcon />;
185
- break;
186
- case "none":
187
- sortIcon = <ExpandUpDownIcon />;
188
- break;
189
- }
190
-
191
- return (
192
- <button
193
- disabled={props.disabled}
194
- onClick={props.onSortClick}
195
- css={css`
196
- ${RESET_BUTTON}
197
- display: flex;
198
- justify-content: center;
199
- align-items: center;
200
- padding: 6px;
201
-
202
- cursor: pointer;
203
-
204
- svg {
205
- width: 12px;
206
- height: 12px;
207
- }
208
- `}
209
- >
210
- {sortIcon}
211
- </button>
212
- );
213
- };
214
-
215
- const FilterButton = React.forwardRef<
216
- HTMLButtonElement,
217
- {
218
- isFilterActive: boolean;
219
- onFilterClick?: React.MouseEventHandler<HTMLButtonElement>;
220
- disabled?: boolean;
221
- }
222
- >((props, ref) => {
223
- const theme = useTheme();
224
- return (
225
- <button
226
- ref={ref}
227
- disabled={props.disabled}
228
- onClick={props.onFilterClick}
229
- css={[
230
- css`
231
- ${RESET_BUTTON}
232
- display: flex;
233
- justify-content: center;
234
- align-items: center;
235
- padding: 6px;
236
-
237
- cursor: pointer;
238
-
239
- svg {
240
- width: 12px;
241
- height: 12px;
242
- }
243
- `,
244
- props.isFilterActive &&
245
- css`
246
- color: ${theme.color.foreground.primary};
247
- `,
248
- ]}
249
- >
250
- <FilterFillIcon />
251
- </button>
252
- );
253
- });
@@ -1,30 +0,0 @@
1
- /** @jsxImportSource @emotion/react */
2
- import { css } from "@emotion/react";
3
- import React from "react";
4
- import TableVariantContext from "./TableVariantContext";
5
-
6
- export interface TableHeadProps {
7
- className?: string;
8
- component?: React.ElementType;
9
-
10
- /** Table의 내용입니다. 일반적으로 TableRow로 구성됩니다. */
11
- children?: React.ReactNode;
12
- }
13
-
14
- export default function TableHead(props: TableHeadProps) {
15
- const { className, component: Component = "thead", children } = props;
16
- return (
17
- <Component
18
- className={className}
19
- css={[
20
- css`
21
- display: table-header-group;
22
- `,
23
- ]}
24
- >
25
- <TableVariantContext.Provider value={{ variant: "head" }}>
26
- {children}
27
- </TableVariantContext.Provider>
28
- </Component>
29
- );
30
- }
@@ -1,9 +0,0 @@
1
- import * as React from "react";
2
- import { TableSize } from "./Table";
3
-
4
- const TablePropsContext = React.createContext<{
5
- size?: TableSize;
6
- disabled?: boolean;
7
- }>({});
8
-
9
- export default TablePropsContext;