@team-monolith/cds 0.1.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/README.md +46 -0
- package/dist/CodleDesignSystemProvider.d.ts +5 -0
- package/dist/CodleDesignSystemProvider.js +96 -0
- package/dist/components/AlertDialog/AlertDialog.d.ts +14 -0
- package/dist/components/AlertDialog/AlertDialog.js +45 -0
- package/dist/components/AlertDialog/AlertDialogActions.d.ts +8 -0
- package/dist/components/AlertDialog/AlertDialogActions.js +35 -0
- package/dist/components/AlertDialog/AlertDialogContent.d.ts +8 -0
- package/dist/components/AlertDialog/AlertDialogContent.js +36 -0
- package/dist/components/AlertDialog/AlertDialogTitle.d.ts +13 -0
- package/dist/components/AlertDialog/AlertDialogTitle.js +38 -0
- package/dist/components/AlertDialog/index.d.ts +4 -0
- package/dist/components/AlertDialog/index.js +4 -0
- package/dist/components/Banner.d.ts +29 -0
- package/dist/components/Banner.js +65 -0
- package/dist/components/Button.d.ts +26 -0
- package/dist/components/Button.js +72 -0
- package/dist/components/CheckboxInput.d.ts +27 -0
- package/dist/components/CheckboxInput.js +77 -0
- package/dist/components/Input.d.ts +17 -0
- package/dist/components/Input.js +72 -0
- package/dist/components/InputBase.d.ts +42 -0
- package/dist/components/InputBase.js +52 -0
- package/dist/components/Pagination.d.ts +27 -0
- package/dist/components/Pagination.js +32 -0
- package/dist/components/PinInput.d.ts +36 -0
- package/dist/components/PinInput.js +154 -0
- package/dist/components/RadioInput.d.ts +23 -0
- package/dist/components/RadioInput.js +78 -0
- package/dist/components/SquareButton.d.ts +26 -0
- package/dist/components/SquareButton.js +80 -0
- package/dist/components/Switch.d.ts +19 -0
- package/dist/components/Switch.js +59 -0
- package/dist/components/Tag.d.ts +21 -0
- package/dist/components/Tag.js +61 -0
- package/dist/components/Tooltip.d.ts +26 -0
- package/dist/components/Tooltip.js +50 -0
- package/dist/foundation/color.d.ts +75 -0
- package/dist/foundation/color.js +75 -0
- package/dist/foundation/shadows.d.ts +9 -0
- package/dist/foundation/shadows.js +10 -0
- package/dist/icons/arrows.d.ts +16 -0
- package/dist/icons/arrows.js +17 -0
- package/dist/icons/brand.d.ts +4 -0
- package/dist/icons/brand.js +13 -0
- package/dist/icons/map.d.ts +4 -0
- package/dist/icons/map.js +13 -0
- package/dist/icons/system.d.ts +25 -0
- package/dist/icons/system.js +20 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/patterns/Dropdown/Dropdown.d.ts +27 -0
- package/dist/patterns/Dropdown/Dropdown.js +41 -0
- package/dist/patterns/Dropdown/DropdownItem.d.ts +42 -0
- package/dist/patterns/Dropdown/DropdownItem.js +89 -0
- package/dist/patterns/Dropdown/DropdownMenu.d.ts +30 -0
- package/dist/patterns/Dropdown/DropdownMenu.js +85 -0
- package/dist/patterns/Dropdown/index.d.ts +2 -0
- package/dist/patterns/Dropdown/index.js +2 -0
- package/dist/patterns/EmptyState/EmptyState.d.ts +16 -0
- package/dist/patterns/EmptyState/EmptyState.js +36 -0
- package/dist/patterns/EmptyState/index.d.ts +2 -0
- package/dist/patterns/EmptyState/index.js +2 -0
- package/dist/patterns/Grid/EnhancedTableCell.d.ts +9 -0
- package/dist/patterns/Grid/EnhancedTableCell.js +122 -0
- package/dist/patterns/Grid/Grid.d.ts +51 -0
- package/dist/patterns/Grid/Grid.js +140 -0
- package/dist/patterns/Grid/index.d.ts +3 -0
- package/dist/patterns/Grid/index.js +2 -0
- package/dist/patterns/SegmentedControl/SegmentedControlButton.d.ts +8 -0
- package/dist/patterns/SegmentedControl/SegmentedControlButton.js +41 -0
- package/dist/patterns/SegmentedControl/SegmentedControlGroup.d.ts +26 -0
- package/dist/patterns/SegmentedControl/SegmentedControlGroup.js +50 -0
- package/dist/patterns/SegmentedControl/SegmentedControlGroupPropsContext.d.ts +5 -0
- package/dist/patterns/SegmentedControl/SegmentedControlGroupPropsContext.js +5 -0
- package/dist/patterns/SegmentedControl/SegmentedControlSquareButton.d.ts +8 -0
- package/dist/patterns/SegmentedControl/SegmentedControlSquareButton.js +45 -0
- package/dist/patterns/SegmentedControl/index.d.ts +3 -0
- package/dist/patterns/SegmentedControl/index.js +3 -0
- package/dist/patterns/Table/Table.d.ts +16 -0
- package/dist/patterns/Table/Table.js +33 -0
- package/dist/patterns/Table/TableBody.d.ts +8 -0
- package/dist/patterns/Table/TableBody.js +26 -0
- package/dist/patterns/Table/TableCell.d.ts +15 -0
- package/dist/patterns/Table/TableCell.js +78 -0
- package/dist/patterns/Table/TableHead.d.ts +8 -0
- package/dist/patterns/Table/TableHead.js +26 -0
- package/dist/patterns/Table/TableRow.d.ts +12 -0
- package/dist/patterns/Table/TableRow.js +29 -0
- package/dist/patterns/Table/TableSizeContext.d.ts +7 -0
- package/dist/patterns/Table/TableSizeContext.js +3 -0
- package/dist/patterns/Table/TableVariantContext.d.ts +6 -0
- package/dist/patterns/Table/TableVariantContext.js +3 -0
- package/dist/patterns/Table/index.d.ts +7 -0
- package/dist/patterns/Table/index.js +6 -0
- package/dist/utils/hover.d.ts +3 -0
- package/dist/utils/hover.js +14 -0
- package/dist/utils/reset.d.ts +2 -0
- package/dist/utils/reset.js +8 -0
- package/dist/utils/zIndex.d.ts +3 -0
- package/dist/utils/zIndex.js +3 -0
- package/package.json +52 -0
- package/public/favicon.ico +0 -0
- package/public/index.html +43 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +25 -0
- package/public/robots.txt +3 -0
- package/src/App.tsx +7 -0
- package/src/cds/CodleDesignSystemProvider.tsx +93 -0
- package/src/cds/README.md +23 -0
- package/src/cds/components/AlertDialog/AlertDialog.tsx +101 -0
- package/src/cds/components/AlertDialog/AlertDialogActions.tsx +34 -0
- package/src/cds/components/AlertDialog/AlertDialogContent.tsx +38 -0
- package/src/cds/components/AlertDialog/AlertDialogTitle.tsx +63 -0
- package/src/cds/components/AlertDialog/index.tsx +4 -0
- package/src/cds/components/Banner.tsx +176 -0
- package/src/cds/components/Button.tsx +239 -0
- package/src/cds/components/CheckboxInput.tsx +270 -0
- package/src/cds/components/Input.tsx +166 -0
- package/src/cds/components/InputBase.tsx +226 -0
- package/src/cds/components/Pagination.tsx +99 -0
- package/src/cds/components/PinInput.tsx +322 -0
- package/src/cds/components/RadioInput.tsx +226 -0
- package/src/cds/components/SquareButton.tsx +229 -0
- package/src/cds/components/Switch.tsx +129 -0
- package/src/cds/components/Tag.tsx +155 -0
- package/src/cds/components/Tooltip.tsx +104 -0
- package/src/cds/emotion.d.ts +70 -0
- package/src/cds/foundation/color.ts +83 -0
- package/src/cds/foundation/shadows.ts +17 -0
- package/src/cds/icons/arrows.tsx +61 -0
- package/src/cds/icons/brand.tsx +13 -0
- package/src/cds/icons/map.tsx +14 -0
- package/src/cds/icons/system.tsx +113 -0
- package/src/cds/index.ts +3 -0
- package/src/cds/patterns/Dropdown/Dropdown.tsx +111 -0
- package/src/cds/patterns/Dropdown/DropdownItem.tsx +203 -0
- package/src/cds/patterns/Dropdown/DropdownMenu.tsx +176 -0
- package/src/cds/patterns/Dropdown/index.tsx +2 -0
- package/src/cds/patterns/EmptyState/EmptyState.tsx +91 -0
- package/src/cds/patterns/EmptyState/empty-state-icon.svg +36 -0
- package/src/cds/patterns/EmptyState/index.tsx +2 -0
- package/src/cds/patterns/Grid/EnhancedTableCell.tsx +180 -0
- package/src/cds/patterns/Grid/Grid.tsx +360 -0
- package/src/cds/patterns/Grid/index.tsx +4 -0
- package/src/cds/patterns/SegmentedControl/SegmentedControlButton.tsx +41 -0
- package/src/cds/patterns/SegmentedControl/SegmentedControlGroup.tsx +81 -0
- package/src/cds/patterns/SegmentedControl/SegmentedControlGroupPropsContext.tsx +9 -0
- package/src/cds/patterns/SegmentedControl/SegmentedControlSquareButton.tsx +51 -0
- package/src/cds/patterns/SegmentedControl/index.ts +3 -0
- package/src/cds/patterns/Table/Table.tsx +56 -0
- package/src/cds/patterns/Table/TableBody.tsx +30 -0
- package/src/cds/patterns/Table/TableCell.tsx +242 -0
- package/src/cds/patterns/Table/TableHead.tsx +30 -0
- package/src/cds/patterns/Table/TableRow.tsx +54 -0
- package/src/cds/patterns/Table/TableSizeContext.tsx +10 -0
- package/src/cds/patterns/Table/TableVariantContext.tsx +9 -0
- package/src/cds/patterns/Table/index.tsx +15 -0
- package/src/cds/utils/hover.tsx +24 -0
- package/src/cds/utils/reset.tsx +19 -0
- package/src/cds/utils/zIndex.tsx +3 -0
- package/src/index.tsx +10 -0
- package/src/react-app-env.d.ts +1 -0
- package/tsconfig.json +22 -0
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/** @jsxImportSource @emotion/react */
|
|
2
|
+
import { css, useTheme } from "@emotion/react";
|
|
3
|
+
import React, { useContext } from "react";
|
|
4
|
+
import TableVariantContext from "./TableVariantContext";
|
|
5
|
+
import TableSizeContext from "./TableSizeContext";
|
|
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 } = useContext(TableSizeContext);
|
|
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 && <SortButton sort={sort} onSortClick={onSortClick} />}
|
|
142
|
+
{isFilterActive !== undefined && (
|
|
143
|
+
<FilterButton
|
|
144
|
+
isFilterActive={isFilterActive ?? false}
|
|
145
|
+
onFilterClick={onFilterClick}
|
|
146
|
+
ref={filterButttonRef}
|
|
147
|
+
/>
|
|
148
|
+
)}
|
|
149
|
+
</Buttons>
|
|
150
|
+
</Cell>
|
|
151
|
+
</Element>
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const Cell = styled.span`
|
|
156
|
+
display: flex;
|
|
157
|
+
justify-content: space-between;
|
|
158
|
+
align-items: center;
|
|
159
|
+
`;
|
|
160
|
+
|
|
161
|
+
const Buttons = styled.span`
|
|
162
|
+
display: flex;
|
|
163
|
+
gap: 4px;
|
|
164
|
+
`;
|
|
165
|
+
|
|
166
|
+
const SortButton = (props: {
|
|
167
|
+
sort?: "asc" | "desc" | "none";
|
|
168
|
+
onSortClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
169
|
+
}) => {
|
|
170
|
+
let sortIcon = <></>;
|
|
171
|
+
switch (props.sort) {
|
|
172
|
+
case "asc":
|
|
173
|
+
sortIcon = <ArrowDownFillIcon />;
|
|
174
|
+
break;
|
|
175
|
+
case "desc":
|
|
176
|
+
sortIcon = <ArrowUpFillIcon />;
|
|
177
|
+
break;
|
|
178
|
+
case "none":
|
|
179
|
+
sortIcon = <ExpandUpDownIcon />;
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
return (
|
|
184
|
+
<button
|
|
185
|
+
onClick={props.onSortClick}
|
|
186
|
+
css={css`
|
|
187
|
+
${RESET_BUTTON}
|
|
188
|
+
display: flex;
|
|
189
|
+
justify-content: center;
|
|
190
|
+
align-items: center;
|
|
191
|
+
padding: 6px;
|
|
192
|
+
|
|
193
|
+
cursor: pointer;
|
|
194
|
+
|
|
195
|
+
svg {
|
|
196
|
+
width: 12px;
|
|
197
|
+
height: 12px;
|
|
198
|
+
}
|
|
199
|
+
`}
|
|
200
|
+
>
|
|
201
|
+
{sortIcon}
|
|
202
|
+
</button>
|
|
203
|
+
);
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
const FilterButton = React.forwardRef<
|
|
207
|
+
HTMLButtonElement,
|
|
208
|
+
{
|
|
209
|
+
isFilterActive: boolean;
|
|
210
|
+
onFilterClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
211
|
+
}
|
|
212
|
+
>((props, ref) => {
|
|
213
|
+
const theme = useTheme();
|
|
214
|
+
return (
|
|
215
|
+
<button
|
|
216
|
+
ref={ref}
|
|
217
|
+
onClick={props.onFilterClick}
|
|
218
|
+
css={[
|
|
219
|
+
css`
|
|
220
|
+
${RESET_BUTTON}
|
|
221
|
+
display: flex;
|
|
222
|
+
justify-content: center;
|
|
223
|
+
align-items: center;
|
|
224
|
+
padding: 6px;
|
|
225
|
+
|
|
226
|
+
cursor: pointer;
|
|
227
|
+
|
|
228
|
+
svg {
|
|
229
|
+
width: 12px;
|
|
230
|
+
height: 12px;
|
|
231
|
+
}
|
|
232
|
+
`,
|
|
233
|
+
props.isFilterActive &&
|
|
234
|
+
css`
|
|
235
|
+
color: ${theme.color.foreground.primary};
|
|
236
|
+
`,
|
|
237
|
+
]}
|
|
238
|
+
>
|
|
239
|
+
<FilterFillIcon />
|
|
240
|
+
</button>
|
|
241
|
+
);
|
|
242
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** @jsxImportSource @emotion/react */
|
|
2
|
+
import { css, useTheme } from "@emotion/react";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { HOVER } from "../../utils/hover";
|
|
5
|
+
|
|
6
|
+
export interface TableRowProps {
|
|
7
|
+
className?: string;
|
|
8
|
+
component?: React.ElementType;
|
|
9
|
+
|
|
10
|
+
/** Table의 내용입니다. 일반적으로 TableCell로 구성됩니다. */
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
/** `true`일 때 기본적으로 적용되는 hover 배경색이 비활성화됩니다. */
|
|
13
|
+
disableHover?: boolean;
|
|
14
|
+
/** 이 행이 선택되었음을 결정하는 속성. `true`일때 배경색이 활성화됩니다. */
|
|
15
|
+
isSelected?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default function TableRow(props: TableRowProps) {
|
|
19
|
+
const {
|
|
20
|
+
className,
|
|
21
|
+
component: Component = "tr",
|
|
22
|
+
isSelected,
|
|
23
|
+
disableHover,
|
|
24
|
+
children,
|
|
25
|
+
} = props;
|
|
26
|
+
const theme = useTheme();
|
|
27
|
+
return (
|
|
28
|
+
<Component
|
|
29
|
+
className={className}
|
|
30
|
+
css={[
|
|
31
|
+
css`
|
|
32
|
+
display: table-row;
|
|
33
|
+
&:not(:first-of-type) {
|
|
34
|
+
td {
|
|
35
|
+
border-top: 1px solid ${theme.color.background.neutralAlt};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
`,
|
|
39
|
+
isSelected &&
|
|
40
|
+
css`
|
|
41
|
+
background: ${theme.color.container.primaryContainer};
|
|
42
|
+
`,
|
|
43
|
+
!disableHover &&
|
|
44
|
+
css`
|
|
45
|
+
${HOVER(css`
|
|
46
|
+
background: ${theme.color.container.primaryContainer};
|
|
47
|
+
`)}
|
|
48
|
+
`,
|
|
49
|
+
]}
|
|
50
|
+
>
|
|
51
|
+
{children}
|
|
52
|
+
</Component>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Table, { TableSize, TableProps } from "./Table";
|
|
2
|
+
import TableHead, { TableHeadProps } from "./TableHead";
|
|
3
|
+
import TableBody, { TableBodyProps } from "./TableBody";
|
|
4
|
+
import TableRow, { TableRowProps } from "./TableRow";
|
|
5
|
+
import TableCell, { TableCellProps } from "./TableCell";
|
|
6
|
+
|
|
7
|
+
export { Table, TableHead, TableBody, TableRow, TableCell };
|
|
8
|
+
export type {
|
|
9
|
+
TableSize,
|
|
10
|
+
TableProps,
|
|
11
|
+
TableHeadProps,
|
|
12
|
+
TableBodyProps,
|
|
13
|
+
TableRowProps,
|
|
14
|
+
TableCellProps,
|
|
15
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { css } from "@emotion/react";
|
|
2
|
+
import { CSSInterpolation } from "@emotion/serialize";
|
|
3
|
+
|
|
4
|
+
// https://choi-jinwoo.github.io/post/development/css-media-hover/
|
|
5
|
+
export function HOVER(style: CSSInterpolation) {
|
|
6
|
+
// -ms-high-contrast: none is for IE11 support.
|
|
7
|
+
return css`
|
|
8
|
+
@media (hover: hover), (-ms-high-contrast: none) {
|
|
9
|
+
&:hover {
|
|
10
|
+
${style}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function FOCUS(style: CSSInterpolation) {
|
|
17
|
+
return css`
|
|
18
|
+
@media (hover: hover), (-ms-high-contrast: none) {
|
|
19
|
+
&:focus {
|
|
20
|
+
${style}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { css } from "@emotion/react";
|
|
2
|
+
|
|
3
|
+
export const RESET_BUTTON = css`
|
|
4
|
+
display: inline-block;
|
|
5
|
+
margin: 0;
|
|
6
|
+
padding: 0;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
border: none;
|
|
9
|
+
background: none;
|
|
10
|
+
font: inherit;
|
|
11
|
+
text-align: inherit;
|
|
12
|
+
`;
|
|
13
|
+
|
|
14
|
+
export const RESET_TABLE = css`
|
|
15
|
+
padding: 0;
|
|
16
|
+
border: 0;
|
|
17
|
+
border-spacing: 0px;
|
|
18
|
+
border-collapse: collapse;
|
|
19
|
+
`;
|
package/src/index.tsx
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="react-scripts" />
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es5",
|
|
4
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
|
+
"outDir": "./dist",
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"allowJs": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"allowSyntheticDefaultImports": true,
|
|
11
|
+
"strict": true,
|
|
12
|
+
"forceConsistentCasingInFileNames": true,
|
|
13
|
+
"noFallthroughCasesInSwitch": true,
|
|
14
|
+
"module": "esnext",
|
|
15
|
+
"moduleResolution": "node",
|
|
16
|
+
"resolveJsonModule": true,
|
|
17
|
+
"isolatedModules": true,
|
|
18
|
+
"jsx": "react-jsx"
|
|
19
|
+
},
|
|
20
|
+
"include": ["src/cds", "src/react-app-env.d.ts"],
|
|
21
|
+
"exclude": ["node_modules", "dist"]
|
|
22
|
+
}
|