@team-monolith/cds 0.1.8 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AlertDialog/AlertDialogContent.js +2 -2
- package/dist/components/Button.d.ts +10 -3
- package/dist/components/Button.js +3 -3
- package/dist/icons/arrows.d.ts +12 -0
- package/dist/icons/arrows.js +4 -0
- package/dist/icons/system.d.ts +3 -0
- package/dist/icons/system.js +1 -0
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -2
- package/dist/patterns/Card/Card.d.ts +39 -0
- package/dist/patterns/Card/Card.js +68 -0
- package/dist/patterns/Card/index.d.ts +2 -0
- package/dist/patterns/Card/index.js +2 -0
- package/dist/patterns/Dialog/Dialog.d.ts +12 -0
- package/dist/patterns/Dialog/Dialog.js +26 -0
- package/dist/patterns/Dialog/DialogContent.d.ts +8 -0
- package/dist/patterns/Dialog/DialogContent.js +23 -0
- package/dist/patterns/Dialog/DialogNavigation.d.ts +12 -0
- package/dist/patterns/Dialog/DialogNavigation.js +25 -0
- package/dist/patterns/Dialog/DialogNavigationContext.d.ts +5 -0
- package/dist/patterns/Dialog/DialogNavigationContext.js +5 -0
- package/dist/patterns/Dialog/DialogNavigationItem.d.ts +10 -0
- package/dist/patterns/Dialog/DialogNavigationItem.js +25 -0
- package/dist/patterns/Dialog/DialogPanel.d.ts +10 -0
- package/dist/patterns/Dialog/DialogPanel.js +31 -0
- package/dist/patterns/Dialog/DialogPanels.d.ts +13 -0
- package/dist/patterns/Dialog/DialogPanels.js +17 -0
- package/dist/patterns/Dialog/DialogPanelsContext.d.ts +5 -0
- package/dist/patterns/Dialog/DialogPanelsContext.js +5 -0
- package/dist/patterns/Dialog/DialogTitle.d.ts +13 -0
- package/dist/patterns/Dialog/DialogTitle.js +26 -0
- package/dist/patterns/Dialog/index.d.ts +7 -0
- package/dist/patterns/Dialog/index.js +7 -0
- package/dist/patterns/Navigation/NavigationContext.d.ts +5 -0
- package/dist/patterns/Navigation/NavigationContext.js +5 -0
- package/dist/patterns/Navigation/NavigationHorizontal.d.ts +11 -0
- package/dist/patterns/Navigation/NavigationHorizontal.js +27 -0
- package/dist/patterns/Navigation/NavigationItem.d.ts +9 -0
- package/dist/patterns/Navigation/NavigationItem.js +33 -0
- package/dist/patterns/Navigation/NavigationVertical.d.ts +14 -0
- package/dist/patterns/Navigation/NavigationVertical.js +27 -0
- package/dist/patterns/Navigation/index.d.ts +3 -0
- package/dist/patterns/Navigation/index.js +3 -0
- package/dist/patterns/Table/Table.d.ts +2 -0
- package/dist/patterns/Table/Table.js +3 -3
- package/dist/patterns/Table/TableCell.js +5 -5
- package/dist/patterns/Table/TablePropsContext.d.ts +7 -0
- package/dist/patterns/Table/TablePropsContext.js +3 -0
- package/dist/patterns/Table/TableRow.d.ts +2 -0
- package/dist/patterns/Table/TableRow.js +9 -4
- package/package.json +1 -1
- package/src/cds/components/AlertDialog/AlertDialogContent.tsx +14 -16
- package/src/cds/components/Button.tsx +98 -77
- package/src/cds/icons/arrows.tsx +55 -0
- package/src/cds/icons/system.tsx +15 -0
- package/src/cds/patterns/Card/Card.tsx +294 -0
- package/src/cds/patterns/Card/class-icon.svg +28 -0
- package/src/cds/patterns/Card/index.tsx +2 -0
- package/src/cds/patterns/Card/material-icon.svg +25 -0
- package/src/cds/patterns/Card/problem-icon.svg +25 -0
- package/src/cds/patterns/Card/thumbnail/sample.png +0 -0
- package/src/cds/patterns/Dialog/Dialog.tsx +57 -0
- package/src/cds/patterns/Dialog/DialogContent.tsx +28 -0
- package/src/cds/patterns/Dialog/DialogNavigation.tsx +29 -0
- package/src/cds/patterns/Dialog/DialogNavigationContext.tsx +9 -0
- package/src/cds/patterns/Dialog/DialogNavigationItem.tsx +42 -0
- package/src/cds/patterns/Dialog/DialogPanel.tsx +40 -0
- package/src/cds/patterns/Dialog/DialogPanels.tsx +24 -0
- package/src/cds/patterns/Dialog/DialogPanelsContext.tsx +9 -0
- package/src/cds/patterns/Dialog/DialogTitle.tsx +55 -0
- package/src/cds/patterns/Dialog/index.tsx +7 -0
- package/src/cds/patterns/Navigation/NavigationContext.tsx +9 -0
- package/src/cds/patterns/Navigation/NavigationHorizontal.tsx +32 -0
- package/src/cds/patterns/Navigation/NavigationItem.tsx +36 -0
- package/src/cds/patterns/Navigation/NavigationVertical.tsx +39 -0
- package/src/cds/patterns/Navigation/index.tsx +3 -0
- package/src/cds/patterns/Table/Table.tsx +8 -2
- package/src/cds/patterns/Table/TableCell.tsx +14 -3
- package/src/cds/patterns/Table/TablePropsContext.tsx +9 -0
- package/src/cds/patterns/Table/TableRow.tsx +23 -7
- package/dist/patterns/EmptyState/empty-state-icon.svg +0 -36
- package/dist/patterns/Grid/EnhancedTableCell.d.ts +0 -9
- package/dist/patterns/Grid/EnhancedTableCell.js +0 -122
- package/dist/patterns/Grid/Grid.d.ts +0 -51
- package/dist/patterns/Grid/Grid.js +0 -140
- package/dist/patterns/Grid/index.d.ts +0 -3
- package/dist/patterns/Grid/index.js +0 -2
- package/dist/patterns/Table/TableSizeContext.d.ts +0 -7
- package/dist/patterns/Table/TableSizeContext.js +0 -3
- package/src/cds/patterns/Grid/EnhancedTableCell.tsx +0 -180
- package/src/cds/patterns/Grid/Grid.tsx +0 -360
- package/src/cds/patterns/Grid/index.tsx +0 -4
- package/src/cds/patterns/Table/TableSizeContext.tsx +0 -10
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface NavigationHorizontalProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
component?: React.ElementType;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
size: "small" | "medium";
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?node-id=181%3A92757)
|
|
10
|
+
*/
|
|
11
|
+
export declare function NavigationHorizontal(props: NavigationHorizontalProps): React.ReactElement;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
17
|
+
/** @jsxImportSource @emotion/react */
|
|
18
|
+
import { css } from "@emotion/react";
|
|
19
|
+
import { NavigationContext } from "./NavigationContext";
|
|
20
|
+
/**
|
|
21
|
+
* [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?node-id=181%3A92757)
|
|
22
|
+
*/
|
|
23
|
+
export function NavigationHorizontal(props) {
|
|
24
|
+
var className = props.className, _a = props.component, Component = _a === void 0 ? "nav" : _a, children = props.children;
|
|
25
|
+
return (_jsx(Component, __assign({ className: className, css: css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-flex;\n padding: 0px 24px;\n gap: 40px;\n "], ["\n display: inline-flex;\n padding: 0px 24px;\n gap: 40px;\n "]))) }, { children: _jsx(NavigationContext.Provider, __assign({ value: { size: props.size, type: "horizontal" } }, { children: children })) })));
|
|
26
|
+
}
|
|
27
|
+
var templateObject_1;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface NavigationItemProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
/** 주로 React Router의 NavLink 입니다. */
|
|
5
|
+
component: React.ElementType;
|
|
6
|
+
label: string;
|
|
7
|
+
to: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function NavigationItem(props: NavigationItemProps): React.ReactElement;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
import styled from "@emotion/styled";
|
|
18
|
+
import React from "react";
|
|
19
|
+
import Button from "../../components/Button";
|
|
20
|
+
import { NavigationContext } from "./NavigationContext";
|
|
21
|
+
export function NavigationItem(props) {
|
|
22
|
+
var className = props.className, Component = props.component, label = props.label, to = props.to;
|
|
23
|
+
var _a = React.useContext(NavigationContext), size = _a.size, type = _a.type;
|
|
24
|
+
return (_jsx(Component, __assign({ className: className, to: to }, { children: function (_a) {
|
|
25
|
+
var isActive = _a.isActive;
|
|
26
|
+
return (_jsx(StyledButton, { type: type, size: size, label: label, color: isActive ? "secondary" : "textNeutral" }));
|
|
27
|
+
} })));
|
|
28
|
+
}
|
|
29
|
+
var StyledButton = styled(Button)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
|
|
30
|
+
var type = _a.type;
|
|
31
|
+
return type === "vertical" && "width: 100%;";
|
|
32
|
+
});
|
|
33
|
+
var templateObject_1;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface NavigationVerticalProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
component?: React.ElementType;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
/** 컴포넌트 크기 */
|
|
7
|
+
size: "small" | "medium";
|
|
8
|
+
/** 전체 너비 유무. Vertical 에서만 동작합니다. */
|
|
9
|
+
fullWidth?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?node-id=181%3A92757)
|
|
13
|
+
*/
|
|
14
|
+
export declare function NavigationVertical(props: NavigationVerticalProps): React.ReactElement;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
17
|
+
/** @jsxImportSource @emotion/react */
|
|
18
|
+
import { css } from "@emotion/react";
|
|
19
|
+
import { NavigationContext } from "./NavigationContext";
|
|
20
|
+
/**
|
|
21
|
+
* [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?node-id=181%3A92757)
|
|
22
|
+
*/
|
|
23
|
+
export function NavigationVertical(props) {
|
|
24
|
+
var className = props.className, _a = props.component, Component = _a === void 0 ? "nav" : _a, fullWidth = props.fullWidth, children = props.children;
|
|
25
|
+
return (_jsx(Component, __assign({ className: className, css: css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n width: ", ";\n flex-direction: column;\n gap: 8px;\n "], ["\n display: flex;\n width: ", ";\n flex-direction: column;\n gap: 8px;\n "])), fullWidth ? "100%" : "240px") }, { children: _jsx(NavigationContext.Provider, __assign({ value: { size: props.size, type: "vertical" } }, { children: children })) })));
|
|
26
|
+
}
|
|
27
|
+
var templateObject_1;
|
|
@@ -9,6 +9,8 @@ export interface TableProps {
|
|
|
9
9
|
size: TableSize;
|
|
10
10
|
/** fullWidth 여부 */
|
|
11
11
|
fullWidth?: boolean;
|
|
12
|
+
/** `true`일 때 상호작용이 불가하며, 글자가 회색 처리됩니다. */
|
|
13
|
+
disabled?: boolean;
|
|
12
14
|
}
|
|
13
15
|
/**
|
|
14
16
|
* [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?type=design&node-id=181-91732&t=07ngLzGHuU3xxg4S-0)
|
|
@@ -17,17 +17,17 @@ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
|
17
17
|
/** @jsxImportSource @emotion/react */
|
|
18
18
|
import { css, useTheme } from "@emotion/react";
|
|
19
19
|
import { RESET_TABLE } from "../../utils/reset";
|
|
20
|
-
import
|
|
20
|
+
import TablePropsContext from "./TablePropsContext";
|
|
21
21
|
/**
|
|
22
22
|
* [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?type=design&node-id=181-91732&t=07ngLzGHuU3xxg4S-0)
|
|
23
23
|
*/
|
|
24
24
|
export default function Table(props) {
|
|
25
|
-
var className = props.className, _a = props.component, Component = _a === void 0 ? "table" : _a, children = props.children, size = props.size, fullWidth = props.fullWidth;
|
|
25
|
+
var className = props.className, _a = props.component, Component = _a === void 0 ? "table" : _a, children = props.children, size = props.size, disabled = props.disabled, fullWidth = props.fullWidth;
|
|
26
26
|
var theme = useTheme();
|
|
27
27
|
return (_jsx(Component, __assign({ className: className, css: [
|
|
28
28
|
RESET_TABLE,
|
|
29
29
|
css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-collapse: separate;\n\n background: ", ";\n border: 1px solid ", ";\n color: ", ";\n border-radius: 4px;\n "], ["\n border-collapse: separate;\n\n background: ", ";\n border: 1px solid ", ";\n color: ", ";\n border-radius: 4px;\n "])), theme.color.background.neutralBase, theme.color.background.neutralAlt, theme.color.foreground.neutralBase),
|
|
30
30
|
fullWidth && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 100%;\n "], ["\n width: 100%;\n "]))),
|
|
31
|
-
] }, { children: _jsx(
|
|
31
|
+
] }, { children: _jsx(TablePropsContext.Provider, __assign({ value: { size: size, disabled: disabled } }, { children: children })) })));
|
|
32
32
|
}
|
|
33
33
|
var templateObject_1, templateObject_2;
|
|
@@ -18,7 +18,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/reac
|
|
|
18
18
|
import { css, useTheme } from "@emotion/react";
|
|
19
19
|
import React, { useContext } from "react";
|
|
20
20
|
import TableVariantContext from "./TableVariantContext";
|
|
21
|
-
import
|
|
21
|
+
import TablePropsContext from "./TablePropsContext";
|
|
22
22
|
import { ArrowDownFillIcon, ArrowUpFillIcon, ExpandUpDownIcon, } from "../../icons/arrows";
|
|
23
23
|
import styled from "@emotion/styled";
|
|
24
24
|
import { RESET_BUTTON } from "../../utils/reset";
|
|
@@ -35,7 +35,7 @@ export default function TableCell(props) {
|
|
|
35
35
|
// variant 값에 따라 th 태그로 그릴지, td 태그로 그릴지를 결정합니다.
|
|
36
36
|
var variant = useContext(TableVariantContext).variant;
|
|
37
37
|
var Element = (Component !== null && Component !== void 0 ? Component : variant === "head") ? "th" : "td";
|
|
38
|
-
var
|
|
38
|
+
var _a = useContext(TablePropsContext), size = _a.size, disabled = _a.disabled;
|
|
39
39
|
var theme = useTheme();
|
|
40
40
|
if (variant === "body") {
|
|
41
41
|
return (_jsx(Element, __assign({ colSpan: colSpan, className: className, onClick: onClick, css: [
|
|
@@ -49,7 +49,7 @@ export default function TableCell(props) {
|
|
|
49
49
|
Element === "th"
|
|
50
50
|
? css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n background: ", ";\n font-style: normal;\n font-weight: 500;\n font-size: 14px;\n line-height: 16px;\n "], ["\n background: ", ";\n font-style: normal;\n font-weight: 500;\n font-size: 14px;\n line-height: 16px;\n "])), theme.color.background.neutralAlt) : css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n font-style: normal;\n font-weight: 400;\n font-size: 16px;\n line-height: 24px;\n "], ["\n font-style: normal;\n font-weight: 400;\n font-size: 16px;\n line-height: 24px;\n "]))),
|
|
51
51
|
css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n display: table-cell;\n text-align: initial;\n\n &:first-of-type {\n padding-left: 16px;\n }\n\n &:last-of-type {\n padding-right: 16px;\n }\n "], ["\n display: table-cell;\n text-align: initial;\n\n &:first-of-type {\n padding-left: 16px;\n }\n\n &:last-of-type {\n padding-right: 16px;\n }\n "]))),
|
|
52
|
-
] }, { children: _jsxs(Cell, { children: [children, _jsxs(Buttons, { children: [sort && _jsx(SortButton, { sort: sort, onSortClick: onSortClick }), isFilterActive !== undefined && (_jsx(FilterButton, { isFilterActive: isFilterActive !== null && isFilterActive !== void 0 ? isFilterActive : false, onFilterClick: onFilterClick, ref: filterButttonRef }))] })] }) })));
|
|
52
|
+
] }, { children: _jsxs(Cell, { children: [children, _jsxs(Buttons, { children: [sort && (_jsx(SortButton, { sort: sort, onSortClick: onSortClick, disabled: disabled })), isFilterActive !== undefined && (_jsx(FilterButton, { isFilterActive: isFilterActive !== null && isFilterActive !== void 0 ? isFilterActive : false, onFilterClick: onFilterClick, ref: filterButttonRef, disabled: disabled }))] })] }) })));
|
|
53
53
|
}
|
|
54
54
|
var Cell = styled.span(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"], ["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"])));
|
|
55
55
|
var Buttons = styled.span(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n display: flex;\n gap: 4px;\n"], ["\n display: flex;\n gap: 4px;\n"])));
|
|
@@ -66,11 +66,11 @@ var SortButton = function (props) {
|
|
|
66
66
|
sortIcon = _jsx(ExpandUpDownIcon, {});
|
|
67
67
|
break;
|
|
68
68
|
}
|
|
69
|
-
return (_jsx("button", __assign({ onClick: props.onSortClick, css: css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n ", "\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 6px;\n\n cursor: pointer;\n\n svg {\n width: 12px;\n height: 12px;\n }\n "], ["\n ", "\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 6px;\n\n cursor: pointer;\n\n svg {\n width: 12px;\n height: 12px;\n }\n "])), RESET_BUTTON) }, { children: sortIcon })));
|
|
69
|
+
return (_jsx("button", __assign({ disabled: props.disabled, onClick: props.onSortClick, css: css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n ", "\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 6px;\n\n cursor: pointer;\n\n svg {\n width: 12px;\n height: 12px;\n }\n "], ["\n ", "\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 6px;\n\n cursor: pointer;\n\n svg {\n width: 12px;\n height: 12px;\n }\n "])), RESET_BUTTON) }, { children: sortIcon })));
|
|
70
70
|
};
|
|
71
71
|
var FilterButton = React.forwardRef(function (props, ref) {
|
|
72
72
|
var theme = useTheme();
|
|
73
|
-
return (_jsx("button", __assign({ ref: ref, onClick: props.onFilterClick, css: [
|
|
73
|
+
return (_jsx("button", __assign({ ref: ref, disabled: props.disabled, onClick: props.onFilterClick, css: [
|
|
74
74
|
css(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n ", "\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 6px;\n\n cursor: pointer;\n\n svg {\n width: 12px;\n height: 12px;\n }\n "], ["\n ", "\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 6px;\n\n cursor: pointer;\n\n svg {\n width: 12px;\n height: 12px;\n }\n "])), RESET_BUTTON),
|
|
75
75
|
props.isFilterActive && css(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), theme.color.foreground.primary),
|
|
76
76
|
] }, { children: _jsx(FilterFillIcon, {}) })));
|
|
@@ -8,5 +8,7 @@ export interface TableRowProps {
|
|
|
8
8
|
disableHover?: boolean;
|
|
9
9
|
/** 이 행이 선택되었음을 결정하는 속성. `true`일때 배경색이 활성화됩니다. */
|
|
10
10
|
isSelected?: boolean;
|
|
11
|
+
/** 행을 클릭할 때 호출되는 함수 */
|
|
12
|
+
onClick?: (event: any) => void;
|
|
11
13
|
}
|
|
12
14
|
export default function TableRow(props: TableRowProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -16,14 +16,19 @@ var __assign = (this && this.__assign) || function () {
|
|
|
16
16
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
17
17
|
/** @jsxImportSource @emotion/react */
|
|
18
18
|
import { css, useTheme } from "@emotion/react";
|
|
19
|
+
import { useContext } from "react";
|
|
19
20
|
import { HOVER } from "../../utils/hover";
|
|
21
|
+
import TablePropsContext from "./TablePropsContext";
|
|
20
22
|
export default function TableRow(props) {
|
|
21
|
-
var className = props.className, _a = props.component, Component = _a === void 0 ? "tr" : _a, isSelected = props.isSelected, disableHover = props.disableHover, children = props.children;
|
|
23
|
+
var className = props.className, _a = props.component, Component = _a === void 0 ? "tr" : _a, isSelected = props.isSelected, disableHover = props.disableHover, children = props.children, onClick = props.onClick;
|
|
22
24
|
var theme = useTheme();
|
|
23
|
-
|
|
25
|
+
var disabled = useContext(TablePropsContext).disabled;
|
|
26
|
+
return (_jsx(Component, __assign({ className: className, onClick: disabled ? undefined : onClick, css: [
|
|
24
27
|
css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: table-row;\n &:not(:first-of-type) {\n td {\n border-top: 1px solid ", ";\n }\n }\n "], ["\n display: table-row;\n &:not(:first-of-type) {\n td {\n border-top: 1px solid ", ";\n }\n }\n "])), theme.color.background.neutralAlt),
|
|
25
28
|
isSelected && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background: ", ";\n "], ["\n background: ", ";\n "])), theme.color.container.primaryContainer),
|
|
26
|
-
|
|
29
|
+
disabled
|
|
30
|
+
? css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), theme.color.foreground.neutralBaseDisabled) : css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n ", "\n ", "\n "], ["\n ", "\n ", "\n "])), !disableHover &&
|
|
31
|
+
HOVER(css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n background: ", ";\n "], ["\n background: ", ";\n "])), theme.color.container.primaryContainer)), onClick && css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n cursor: pointer;\n "], ["\n cursor: pointer;\n "])))),
|
|
27
32
|
] }, { children: children })));
|
|
28
33
|
}
|
|
29
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
34
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
package/package.json
CHANGED
|
@@ -17,22 +17,20 @@ export const AlertDialogContent = React.forwardRef<
|
|
|
17
17
|
const { className, component: Component = "div", children, ...other } = props;
|
|
18
18
|
const theme = useTheme();
|
|
19
19
|
return (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
grid-area: content;
|
|
20
|
+
<Component
|
|
21
|
+
{...other}
|
|
22
|
+
ref={ref}
|
|
23
|
+
className={className}
|
|
24
|
+
css={css`
|
|
25
|
+
grid-area: content;
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
</>
|
|
27
|
+
font-style: normal;
|
|
28
|
+
font-size: 18px;
|
|
29
|
+
line-height: 28px;
|
|
30
|
+
color: ${theme.color.foreground.neutralBase};
|
|
31
|
+
`}
|
|
32
|
+
>
|
|
33
|
+
{children}
|
|
34
|
+
</Component>
|
|
37
35
|
);
|
|
38
36
|
});
|
|
@@ -3,6 +3,7 @@ import { css, SerializedStyles, Theme, useTheme } from "@emotion/react";
|
|
|
3
3
|
import styled from "@emotion/styled";
|
|
4
4
|
import React from "react";
|
|
5
5
|
import { HOVER } from "../utils/hover";
|
|
6
|
+
import { PolymorphicProps } from "@mui/base";
|
|
6
7
|
|
|
7
8
|
export type ButtonColor =
|
|
8
9
|
| "primary"
|
|
@@ -14,32 +15,6 @@ export type ButtonColor =
|
|
|
14
15
|
|
|
15
16
|
export type ButtonSize = "large" | "medium" | "small" | "xsmall";
|
|
16
17
|
|
|
17
|
-
export interface ButtonProps {
|
|
18
|
-
className?: string;
|
|
19
|
-
component?: React.ElementType;
|
|
20
|
-
|
|
21
|
-
/** 비활성화 여부 */
|
|
22
|
-
disabled?: boolean;
|
|
23
|
-
|
|
24
|
-
/** 컴포넌트 색상 */
|
|
25
|
-
color: ButtonColor;
|
|
26
|
-
|
|
27
|
-
/** 컴포넌트 크기 */
|
|
28
|
-
size: ButtonSize;
|
|
29
|
-
|
|
30
|
-
/** 컴포넌트 좌측에 표기될 아이콘 */
|
|
31
|
-
startIcon?: React.ReactNode;
|
|
32
|
-
|
|
33
|
-
/** 컴포넌트 우측에 표기될 아이콘 */
|
|
34
|
-
endIcon?: React.ReactNode;
|
|
35
|
-
|
|
36
|
-
/** 컴포넌트 내 표기될 문자열 */
|
|
37
|
-
label: string;
|
|
38
|
-
|
|
39
|
-
/** 버튼 클릭 시 호출될 콜백 함수 */
|
|
40
|
-
onClick?: () => void;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
18
|
const COLOR_TO_BUTTON_STYLE = (theme: Theme, color: ButtonColor) =>
|
|
44
19
|
({
|
|
45
20
|
primary: css`
|
|
@@ -176,63 +151,109 @@ const SIZE_TO_LABEL_STYLE: { [K in ButtonSize]: SerializedStyles } = {
|
|
|
176
151
|
`,
|
|
177
152
|
};
|
|
178
153
|
|
|
154
|
+
export interface ButtonOwnProps<RootComponentType extends React.ElementType> {
|
|
155
|
+
className?: string;
|
|
156
|
+
component?: RootComponentType;
|
|
157
|
+
|
|
158
|
+
/** 비활성화 여부 */
|
|
159
|
+
disabled?: boolean;
|
|
160
|
+
|
|
161
|
+
/** 컴포넌트 색상 */
|
|
162
|
+
color: ButtonColor;
|
|
163
|
+
|
|
164
|
+
/** 컴포넌트 크기 */
|
|
165
|
+
size: ButtonSize;
|
|
166
|
+
|
|
167
|
+
/** 컴포넌트 좌측에 표기될 아이콘 */
|
|
168
|
+
startIcon?: React.ReactNode;
|
|
169
|
+
|
|
170
|
+
/** 컴포넌트 우측에 표기될 아이콘 */
|
|
171
|
+
endIcon?: React.ReactNode;
|
|
172
|
+
|
|
173
|
+
/** 컴포넌트 내 표기될 문자열 */
|
|
174
|
+
label: string;
|
|
175
|
+
|
|
176
|
+
/** 버튼 클릭 시 호출될 콜백 함수 */
|
|
177
|
+
onClick?: () => void;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export type ButtonProps<
|
|
181
|
+
RootComponentType extends React.ElementType = ButtonTypeMap["defaultComponent"]
|
|
182
|
+
> = PolymorphicProps<ButtonTypeMap<RootComponentType>, RootComponentType>;
|
|
183
|
+
|
|
184
|
+
export interface ButtonTypeMap<
|
|
185
|
+
RootComponentType extends React.ElementType = "button"
|
|
186
|
+
> {
|
|
187
|
+
props: ButtonOwnProps<RootComponentType>;
|
|
188
|
+
defaultComponent: RootComponentType;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
type ButtonComponent = <RootComponentType extends React.ElementType = "button">(
|
|
192
|
+
props: ButtonProps<RootComponentType>
|
|
193
|
+
) => React.ReactElement | null;
|
|
194
|
+
|
|
179
195
|
/**
|
|
180
196
|
* [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=20-173&t=cXcCv3QijbX7MkoC-0)
|
|
181
197
|
*/
|
|
182
|
-
const Button = React.forwardRef<
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
198
|
+
const Button: ButtonComponent = React.forwardRef(function Button<
|
|
199
|
+
RootComponentType extends React.ElementType = "button"
|
|
200
|
+
>(
|
|
201
|
+
props: ButtonProps<RootComponentType>,
|
|
202
|
+
ref: React.ComponentPropsWithRef<RootComponentType>['ref']
|
|
203
|
+
): React.ReactElement {
|
|
204
|
+
const {
|
|
205
|
+
className,
|
|
206
|
+
component: Component = "button",
|
|
207
|
+
disabled,
|
|
208
|
+
color,
|
|
209
|
+
size,
|
|
210
|
+
startIcon,
|
|
211
|
+
endIcon,
|
|
212
|
+
label,
|
|
213
|
+
onClick,
|
|
214
|
+
...other
|
|
215
|
+
} = props;
|
|
216
|
+
const theme = useTheme();
|
|
217
|
+
|
|
218
|
+
return (
|
|
219
|
+
<Component
|
|
220
|
+
{...other}
|
|
221
|
+
className={className}
|
|
222
|
+
ref={ref}
|
|
223
|
+
css={[
|
|
224
|
+
css`
|
|
225
|
+
display: inline-flex;
|
|
226
|
+
align-items: center;
|
|
227
|
+
gap: 8px;
|
|
228
|
+
|
|
229
|
+
border: none;
|
|
230
|
+
border-radius: 8px;
|
|
231
|
+
|
|
232
|
+
cursor: pointer;
|
|
233
|
+
&:disabled {
|
|
234
|
+
cursor: default;
|
|
235
|
+
pointer-events: none;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
font: inherit;
|
|
239
|
+
text-decoration: none;
|
|
240
|
+
`,
|
|
241
|
+
COLOR_TO_BUTTON_STYLE(theme, color),
|
|
242
|
+
SIZE_TO_BUTTON_STYLE[size],
|
|
243
|
+
]}
|
|
244
|
+
disabled={disabled}
|
|
245
|
+
onClick={onClick}
|
|
246
|
+
>
|
|
247
|
+
{startIcon}
|
|
248
|
+
<Label size={size}>{label}</Label>
|
|
249
|
+
{endIcon}
|
|
250
|
+
</Component>
|
|
251
|
+
);
|
|
252
|
+
});
|
|
233
253
|
|
|
234
254
|
const Label = styled.span<{ size: ButtonSize }>`
|
|
235
255
|
font-weight: 400;
|
|
256
|
+
white-space: nowrap;
|
|
236
257
|
${({ size }) => SIZE_TO_LABEL_STYLE[size]}
|
|
237
258
|
`;
|
|
238
259
|
|
package/src/cds/icons/arrows.tsx
CHANGED
|
@@ -45,6 +45,31 @@ export const ArrowUpFillIcon = (props: { className?: string }) => (
|
|
|
45
45
|
<path d="M13 12V20H11V12H4L12 4L20 12H13Z" fill="currentColor" />
|
|
46
46
|
</svg>
|
|
47
47
|
);
|
|
48
|
+
export const ArrowRightFillIcon = (props: { className?: string }) => (
|
|
49
|
+
<svg
|
|
50
|
+
{...props}
|
|
51
|
+
width="24"
|
|
52
|
+
height="24"
|
|
53
|
+
viewBox="0 0 24 24"
|
|
54
|
+
fill="none"
|
|
55
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
56
|
+
>
|
|
57
|
+
<path d="M12 13H4V11H12V4L20 12L12 20V13Z" fill="currentColor" />
|
|
58
|
+
</svg>
|
|
59
|
+
);
|
|
60
|
+
export const ArrowLeftFillIcon = (props: { className?: string }) => (
|
|
61
|
+
<svg
|
|
62
|
+
{...props}
|
|
63
|
+
width="24"
|
|
64
|
+
height="24"
|
|
65
|
+
viewBox="0 0 24 24"
|
|
66
|
+
fill="none"
|
|
67
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
68
|
+
>
|
|
69
|
+
<path d="M12 13V20L4 12L12 4V11H20V13H12Z" fill="currentColor" />
|
|
70
|
+
</svg>
|
|
71
|
+
);
|
|
72
|
+
|
|
48
73
|
export const ArrowRightSLineIcon = (props: { className?: string }) => (
|
|
49
74
|
<svg
|
|
50
75
|
{...props}
|
|
@@ -59,3 +84,33 @@ export const ArrowRightSLineIcon = (props: { className?: string }) => (
|
|
|
59
84
|
/>
|
|
60
85
|
</svg>
|
|
61
86
|
);
|
|
87
|
+
|
|
88
|
+
export const ArrowLeftLineIcon = (props: { className?: string }) => (
|
|
89
|
+
<svg
|
|
90
|
+
{...props}
|
|
91
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
92
|
+
width="24"
|
|
93
|
+
height="24"
|
|
94
|
+
viewBox="0 0 24 24"
|
|
95
|
+
>
|
|
96
|
+
<path
|
|
97
|
+
fill="currentColor"
|
|
98
|
+
d="M7.828 11H20v2H7.828l5.364 5.364l-1.414 1.414L4 12l7.778-7.778l1.414 1.414L7.828 11Z"
|
|
99
|
+
/>
|
|
100
|
+
</svg>
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
export const ArrowRightLineIcon = (props: { className?: string }) => (
|
|
104
|
+
<svg
|
|
105
|
+
{...props}
|
|
106
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
107
|
+
width="24"
|
|
108
|
+
height="24"
|
|
109
|
+
viewBox="0 0 24 24"
|
|
110
|
+
>
|
|
111
|
+
<path
|
|
112
|
+
fill="currentColor"
|
|
113
|
+
d="m16.172 11l-5.364-5.364l1.414-1.414L20 12l-7.778 7.778l-1.414-1.414L16.172 13H4v-2h12.172Z"
|
|
114
|
+
/>
|
|
115
|
+
</svg>
|
|
116
|
+
);
|
package/src/cds/icons/system.tsx
CHANGED
|
@@ -111,3 +111,18 @@ export const FilterFillIcon = (props: { className?: string }) => (
|
|
|
111
111
|
<path d="M21 4V6H20L14 15V22H10V15L4 6H3V4H21Z" fill="currentColor" />
|
|
112
112
|
</svg>
|
|
113
113
|
);
|
|
114
|
+
|
|
115
|
+
export const CheckboxMultipleBlankLine = (props: { className?: string }) => (
|
|
116
|
+
<svg
|
|
117
|
+
{...props}
|
|
118
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
119
|
+
width="24"
|
|
120
|
+
height="24"
|
|
121
|
+
viewBox="0 0 24 24"
|
|
122
|
+
>
|
|
123
|
+
<path
|
|
124
|
+
fill="currentColor"
|
|
125
|
+
d="M7 7V3a1 1 0 0 1 1-1h13a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-4v3.992C17 21.55 16.551 22 15.992 22H3.008A1.006 1.006 0 0 1 2 20.992l.003-12.985C2.003 7.451 2.452 7 3.01 7H7Zm2 0h6.993C16.549 7 17 7.449 17 8.007V15h3V4H9v3ZM4.003 9L4 20h11V9H4.003Z"
|
|
126
|
+
/>
|
|
127
|
+
</svg>
|
|
128
|
+
);
|