@team-monolith/cds 0.3.0 → 0.3.2
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/CodleDesignSystemProvider.d.ts +69 -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 +31 -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 +73 -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/index.d.ts +2 -0
- package/dist/icons/Arrows/index.js +2 -0
- package/dist/icons/Media/index.d.ts +2 -0
- package/dist/icons/Media/index.js +2 -0
- package/dist/icons/System/index.d.ts +2 -0
- package/dist/icons/System/index.js +2 -0
- package/dist/icons/arrows.d.ts +28 -0
- package/dist/icons/arrows.js +21 -0
- package/dist/icons/brand.d.ts +4 -0
- package/dist/icons/brand.js +13 -0
- package/dist/icons/design.d.ts +4 -0
- package/dist/icons/design.js +13 -0
- package/dist/icons/map.d.ts +4 -0
- package/dist/icons/map.js +13 -0
- package/dist/icons/system.d.ts +31 -0
- package/dist/icons/system.js +22 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.js +44 -0
- package/dist/patterns/Card/Card.d.ts +39 -0
- package/dist/patterns/Card/Card.js +68 -0
- package/dist/patterns/Card/class-icon.svg +28 -0
- package/dist/patterns/Card/index.d.ts +2 -0
- package/dist/patterns/Card/index.js +2 -0
- package/dist/patterns/Card/material-icon.svg +25 -0
- package/dist/patterns/Card/problem-icon.svg +25 -0
- package/dist/patterns/Card/thumbnail/sample.png +0 -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/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/empty-state-icon.svg +36 -0
- package/dist/patterns/EmptyState/index.d.ts +2 -0
- package/dist/patterns/EmptyState/index.js +2 -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/SegmentedControl/SegmentedControlButton.d.ts +8 -0
- package/dist/patterns/SegmentedControl/SegmentedControlButton.js +57 -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 +18 -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/TablePropsContext.d.ts +7 -0
- package/dist/patterns/Table/TablePropsContext.js +3 -0
- package/dist/patterns/Table/TableRow.d.ts +14 -0
- package/dist/patterns/Table/TableRow.js +34 -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 +3 -2
- package/src/cds/index.ts +1 -1
- package/src/cds/patterns/SegmentedControl/SegmentedControlButton.tsx +22 -8
|
@@ -0,0 +1,78 @@
|
|
|
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, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
17
|
+
/** @jsxImportSource @emotion/react */
|
|
18
|
+
import { css, useTheme } from "@emotion/react";
|
|
19
|
+
import React, { useContext } from "react";
|
|
20
|
+
import TableVariantContext from "./TableVariantContext";
|
|
21
|
+
import TablePropsContext from "./TablePropsContext";
|
|
22
|
+
import { ArrowDownFillIcon, ArrowUpFillIcon, ExpandUpDownIcon, } from "../../icons/arrows";
|
|
23
|
+
import styled from "@emotion/styled";
|
|
24
|
+
import { RESET_BUTTON } from "../../utils/reset";
|
|
25
|
+
import { FilterFillIcon } from "../../icons/system";
|
|
26
|
+
var SIZE_TO_STYLES = function (size) {
|
|
27
|
+
return ({
|
|
28
|
+
small: css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 8px 8px;\n "], ["\n padding: 8px 8px;\n "]))),
|
|
29
|
+
medium: css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 12px 8px;\n "], ["\n padding: 12px 8px;\n "]))),
|
|
30
|
+
large: css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding: 16px 8px;\n "], ["\n padding: 16px 8px;\n "]))),
|
|
31
|
+
}[size]);
|
|
32
|
+
};
|
|
33
|
+
export default function TableCell(props) {
|
|
34
|
+
var className = props.className, Component = props.component, children = props.children, sort = props.sort, colSpan = props.colSpan, isFilterActive = props.isFilterActive, onFilterClick = props.onFilterClick, onClick = props.onClick, onSortClick = props.onSortClick, filterButttonRef = props.filterButttonRef;
|
|
35
|
+
// variant 값에 따라 th 태그로 그릴지, td 태그로 그릴지를 결정합니다.
|
|
36
|
+
var variant = useContext(TableVariantContext).variant;
|
|
37
|
+
var Element = (Component !== null && Component !== void 0 ? Component : variant === "head") ? "th" : "td";
|
|
38
|
+
var _a = useContext(TablePropsContext), size = _a.size, disabled = _a.disabled;
|
|
39
|
+
var theme = useTheme();
|
|
40
|
+
if (variant === "body") {
|
|
41
|
+
return (_jsx(Element, __assign({ colSpan: colSpan, className: className, onClick: onClick, css: [
|
|
42
|
+
SIZE_TO_STYLES(size !== null && size !== void 0 ? size : "medium"),
|
|
43
|
+
css(templateObject_4 || (templateObject_4 = __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 "]))),
|
|
44
|
+
css(templateObject_5 || (templateObject_5 = __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 "]))),
|
|
45
|
+
] }, { children: children })));
|
|
46
|
+
}
|
|
47
|
+
return (_jsx(Element, __assign({ colSpan: colSpan, className: className, onClick: onClick, css: [
|
|
48
|
+
SIZE_TO_STYLES(size !== null && size !== void 0 ? size : "medium"),
|
|
49
|
+
Element === "th"
|
|
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
|
+
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, disabled: disabled })), isFilterActive !== undefined && (_jsx(FilterButton, { isFilterActive: isFilterActive !== null && isFilterActive !== void 0 ? isFilterActive : false, onFilterClick: onFilterClick, ref: filterButttonRef, disabled: disabled }))] })] }) })));
|
|
53
|
+
}
|
|
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
|
+
var Buttons = styled.span(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n display: flex;\n gap: 4px;\n"], ["\n display: flex;\n gap: 4px;\n"])));
|
|
56
|
+
var SortButton = function (props) {
|
|
57
|
+
var sortIcon = _jsx(_Fragment, {});
|
|
58
|
+
switch (props.sort) {
|
|
59
|
+
case "asc":
|
|
60
|
+
sortIcon = _jsx(ArrowDownFillIcon, {});
|
|
61
|
+
break;
|
|
62
|
+
case "desc":
|
|
63
|
+
sortIcon = _jsx(ArrowUpFillIcon, {});
|
|
64
|
+
break;
|
|
65
|
+
case "none":
|
|
66
|
+
sortIcon = _jsx(ExpandUpDownIcon, {});
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
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
|
+
};
|
|
71
|
+
var FilterButton = React.forwardRef(function (props, ref) {
|
|
72
|
+
var theme = useTheme();
|
|
73
|
+
return (_jsx("button", __assign({ ref: ref, disabled: props.disabled, onClick: props.onFilterClick, css: [
|
|
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
|
+
props.isFilterActive && css(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), theme.color.foreground.primary),
|
|
76
|
+
] }, { children: _jsx(FilterFillIcon, {}) })));
|
|
77
|
+
});
|
|
78
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface TableHeadProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
component?: React.ElementType;
|
|
5
|
+
/** Table의 내용입니다. 일반적으로 TableRow로 구성됩니다. */
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export default function TableHead(props: TableHeadProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
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 TableVariantContext from "./TableVariantContext";
|
|
20
|
+
export default function TableHead(props) {
|
|
21
|
+
var className = props.className, _a = props.component, Component = _a === void 0 ? "thead" : _a, children = props.children;
|
|
22
|
+
return (_jsx(Component, __assign({ className: className, css: [
|
|
23
|
+
css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: table-header-group;\n "], ["\n display: table-header-group;\n "]))),
|
|
24
|
+
] }, { children: _jsx(TableVariantContext.Provider, __assign({ value: { variant: "head" } }, { children: children })) })));
|
|
25
|
+
}
|
|
26
|
+
var templateObject_1;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface TableRowProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
component?: React.ElementType;
|
|
5
|
+
/** Table의 내용입니다. 일반적으로 TableCell로 구성됩니다. */
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
/** `true`일 때 기본적으로 적용되는 hover 배경색이 비활성화됩니다. */
|
|
8
|
+
disableHover?: boolean;
|
|
9
|
+
/** 이 행이 선택되었음을 결정하는 속성. `true`일때 배경색이 활성화됩니다. */
|
|
10
|
+
isSelected?: boolean;
|
|
11
|
+
/** 행을 클릭할 때 호출되는 함수 */
|
|
12
|
+
onClick?: (event: any) => void;
|
|
13
|
+
}
|
|
14
|
+
export default function TableRow(props: TableRowProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
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, useTheme } from "@emotion/react";
|
|
19
|
+
import { useContext } from "react";
|
|
20
|
+
import { HOVER } from "../../utils/hover";
|
|
21
|
+
import TablePropsContext from "./TablePropsContext";
|
|
22
|
+
export default function TableRow(props) {
|
|
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;
|
|
24
|
+
var theme = useTheme();
|
|
25
|
+
var disabled = useContext(TablePropsContext).disabled;
|
|
26
|
+
return (_jsx(Component, __assign({ className: className, onClick: disabled ? undefined : onClick, css: [
|
|
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),
|
|
28
|
+
isSelected && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background: ", ";\n "], ["\n background: ", ";\n "])), theme.color.container.primaryContainer),
|
|
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 "])))),
|
|
32
|
+
] }, { children: children })));
|
|
33
|
+
}
|
|
34
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
export { Table, TableHead, TableBody, TableRow, TableCell };
|
|
7
|
+
export type { TableSize, TableProps, TableHeadProps, TableBodyProps, TableRowProps, TableCellProps, };
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
import { css } from "@emotion/react";
|
|
6
|
+
// https://choi-jinwoo.github.io/post/development/css-media-hover/
|
|
7
|
+
export function HOVER(style) {
|
|
8
|
+
// -ms-high-contrast: none is for IE11 support.
|
|
9
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n @media (hover: hover), (-ms-high-contrast: none) {\n &:hover {\n ", "\n }\n }\n "], ["\n @media (hover: hover), (-ms-high-contrast: none) {\n &:hover {\n ", "\n }\n }\n "])), style);
|
|
10
|
+
}
|
|
11
|
+
export function FOCUS(style) {
|
|
12
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n @media (hover: hover), (-ms-high-contrast: none) {\n &:focus {\n ", "\n }\n }\n "], ["\n @media (hover: hover), (-ms-high-contrast: none) {\n &:focus {\n ", "\n }\n }\n "])), style);
|
|
13
|
+
}
|
|
14
|
+
var templateObject_1, templateObject_2;
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
import { css } from "@emotion/react";
|
|
6
|
+
export var RESET_BUTTON = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-block;\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n border: none;\n background: none;\n font: inherit;\n text-align: inherit;\n"], ["\n display: inline-block;\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n border: none;\n background: none;\n font: inherit;\n text-align: inherit;\n"])));
|
|
7
|
+
export var RESET_TABLE = css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 0;\n border: 0;\n border-spacing: 0px;\n border-collapse: collapse;\n"], ["\n padding: 0;\n border: 0;\n border-spacing: 0px;\n border-collapse: collapse;\n"])));
|
|
8
|
+
var templateObject_1, templateObject_2;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@team-monolith/cds",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
]
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"copyfiles": "^2.4.1"
|
|
42
|
+
"copyfiles": "^2.4.1",
|
|
43
|
+
"rimraf": "^5.0.1"
|
|
43
44
|
}
|
|
44
45
|
}
|
package/src/cds/index.ts
CHANGED
|
@@ -34,7 +34,7 @@ export { default as Tooltip } from "./components/Tooltip";
|
|
|
34
34
|
export * from "./components/Tooltip";
|
|
35
35
|
|
|
36
36
|
export { default as color } from "./foundation/color";
|
|
37
|
-
export { default as
|
|
37
|
+
export { default as shadows } from "./foundation/shadows";
|
|
38
38
|
|
|
39
39
|
export * from "./icons/brand";
|
|
40
40
|
export * from "./icons/map";
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
|
2
|
-
import
|
|
2
|
+
import { css } from "@emotion/react";
|
|
3
3
|
import { useContext } from "react";
|
|
4
4
|
import Button, { ButtonProps } from "../../components/Button";
|
|
5
5
|
import shadows from "../../foundation/shadows";
|
|
6
6
|
import { SegmentedControlGroupPropsContext } from "./SegmentedControlGroupPropsContext";
|
|
7
|
+
import styled from "@emotion/styled";
|
|
7
8
|
|
|
8
|
-
export interface SegmentedControlButtonProps
|
|
9
|
+
export interface SegmentedControlButtonProps
|
|
10
|
+
extends Omit<ButtonProps, "color" | "size"> {
|
|
9
11
|
value: string;
|
|
10
12
|
}
|
|
11
13
|
|
|
@@ -13,20 +15,32 @@ export interface SegmentedControlButtonProps extends Omit<ButtonProps, "color" |
|
|
|
13
15
|
* [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?node-id=181%3A89883)
|
|
14
16
|
*/
|
|
15
17
|
export function SegmentedControlButton(props: SegmentedControlButtonProps) {
|
|
18
|
+
const { onClick, ...other } = props;
|
|
19
|
+
|
|
16
20
|
const context = useContext(SegmentedControlGroupPropsContext);
|
|
17
21
|
|
|
18
|
-
const
|
|
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;
|
|
19
30
|
|
|
20
31
|
return (
|
|
21
32
|
<StyledButton
|
|
33
|
+
css={css`
|
|
34
|
+
display: flex;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
flex-grow: 1;
|
|
37
|
+
${isActive && `box-shadow: ${shadows.shadow04};`}
|
|
38
|
+
`}
|
|
22
39
|
{...props}
|
|
23
40
|
isActive={isActive}
|
|
24
41
|
color={isActive ? "primary" : "textNeutral"}
|
|
25
42
|
size={context.size}
|
|
26
|
-
onClick={
|
|
27
|
-
context.onClick?.(props.value);
|
|
28
|
-
props.onClick?.();
|
|
29
|
-
}}
|
|
43
|
+
onClick={handleClick}
|
|
30
44
|
/>
|
|
31
45
|
);
|
|
32
46
|
}
|
|
@@ -38,4 +52,4 @@ const StyledButton = styled(Button, {
|
|
|
38
52
|
justify-content: center;
|
|
39
53
|
flex-grow: 1;
|
|
40
54
|
${({ isActive }) => isActive && `box-shadow: ${shadows.shadow04};`}
|
|
41
|
-
`;
|
|
55
|
+
`;
|