@x-plat/design-system 0.9.0 → 0.10.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/AutoResizeTextArea/index.d.cts +1 -0
- package/dist/components/AutoResizeTextArea/index.d.ts +1 -0
- package/dist/components/Badge/index.cjs +5 -1
- package/dist/components/Badge/index.css +1 -0
- package/dist/components/Badge/index.d.cts +1 -0
- package/dist/components/Badge/index.d.ts +1 -0
- package/dist/components/Badge/index.js +5 -1
- package/dist/components/Box/index.d.cts +3 -0
- package/dist/components/Box/index.d.ts +3 -0
- package/dist/components/Chart/index.cjs +7 -6
- package/dist/components/Chart/index.d.cts +12 -1
- package/dist/components/Chart/index.d.ts +12 -1
- package/dist/components/Chart/index.js +7 -6
- package/dist/components/ChatInput/index.d.cts +6 -0
- package/dist/components/ChatInput/index.d.ts +6 -0
- package/dist/components/CheckBox/index.cjs +6 -2
- package/dist/components/CheckBox/index.css +2 -0
- package/dist/components/CheckBox/index.d.cts +10 -2
- package/dist/components/CheckBox/index.d.ts +10 -2
- package/dist/components/CheckBox/index.js +6 -2
- package/dist/components/Chip/index.d.cts +2 -0
- package/dist/components/Chip/index.d.ts +2 -0
- package/dist/components/DatePicker/index.cjs +4 -3
- package/dist/components/DatePicker/index.js +4 -3
- package/dist/components/Drawer/index.d.cts +1 -0
- package/dist/components/Drawer/index.d.ts +1 -0
- package/dist/components/FileUpload/index.d.cts +6 -0
- package/dist/components/FileUpload/index.d.ts +6 -0
- package/dist/components/ImageSelector/index.d.cts +3 -0
- package/dist/components/ImageSelector/index.d.ts +3 -0
- package/dist/components/Input/index.d.cts +4 -0
- package/dist/components/Input/index.d.ts +4 -0
- package/dist/components/NotificationBadge/index.cjs +5 -1
- package/dist/components/NotificationBadge/index.css +1 -0
- package/dist/components/NotificationBadge/index.d.cts +6 -2
- package/dist/components/NotificationBadge/index.d.ts +6 -2
- package/dist/components/NotificationBadge/index.js +5 -1
- package/dist/components/Pagination/index.cjs +6 -2
- package/dist/components/Pagination/index.css +1 -0
- package/dist/components/Pagination/index.d.cts +13 -2
- package/dist/components/Pagination/index.d.ts +13 -2
- package/dist/components/Pagination/index.js +6 -2
- package/dist/components/Progress/index.cjs +6 -2
- package/dist/components/Progress/index.css +1 -0
- package/dist/components/Progress/index.d.cts +11 -2
- package/dist/components/Progress/index.d.ts +11 -2
- package/dist/components/Progress/index.js +6 -2
- package/dist/components/Radio/index.cjs +6 -2
- package/dist/components/Radio/index.css +2 -0
- package/dist/components/Radio/index.d.cts +11 -2
- package/dist/components/Radio/index.d.ts +11 -2
- package/dist/components/Radio/index.js +6 -2
- package/dist/components/Select/index.d.cts +5 -1
- package/dist/components/Select/index.d.ts +5 -1
- package/dist/components/Skeleton/index.d.cts +3 -0
- package/dist/components/Skeleton/index.d.ts +3 -0
- package/dist/components/Spinner/index.cjs +6 -2
- package/dist/components/Spinner/index.css +1 -0
- package/dist/components/Spinner/index.d.cts +8 -2
- package/dist/components/Spinner/index.d.ts +8 -2
- package/dist/components/Spinner/index.js +6 -2
- package/dist/components/Steps/index.cjs +6 -2
- package/dist/components/Steps/index.css +11 -0
- package/dist/components/Steps/index.d.cts +9 -2
- package/dist/components/Steps/index.d.ts +9 -2
- package/dist/components/Steps/index.js +6 -2
- package/dist/components/Switch/index.cjs +6 -2
- package/dist/components/Switch/index.css +2 -0
- package/dist/components/Switch/index.d.cts +10 -2
- package/dist/components/Switch/index.d.ts +10 -2
- package/dist/components/Switch/index.js +6 -2
- package/dist/components/Tab/index.cjs +4 -3
- package/dist/components/Tab/index.d.cts +12 -1
- package/dist/components/Tab/index.d.ts +12 -1
- package/dist/components/Tab/index.js +4 -3
- package/dist/components/Tag/index.cjs +5 -3
- package/dist/components/Tag/index.d.cts +12 -2
- package/dist/components/Tag/index.d.ts +12 -2
- package/dist/components/Tag/index.js +5 -3
- package/dist/components/TextArea/index.d.cts +3 -0
- package/dist/components/TextArea/index.d.ts +3 -0
- package/dist/components/Tooltip/index.cjs +4 -2
- package/dist/components/Tooltip/index.d.cts +11 -1
- package/dist/components/Tooltip/index.d.ts +11 -1
- package/dist/components/Tooltip/index.js +4 -2
- package/dist/components/index.cjs +46 -29
- package/dist/components/index.css +21 -0
- package/dist/components/index.d.cts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +46 -29
- package/dist/index.cjs +46 -29
- package/dist/index.css +21 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +46 -29
- package/dist/status-g_KP3qT6.d.cts +8 -0
- package/dist/status-g_KP3qT6.d.ts +8 -0
- package/guidelines/AGENT_PROMPT.md +15 -0
- package/guidelines/components/card.md +3 -3
- package/guidelines/components/feedback.md +1 -1
- package/guidelines/components/navigation.md +16 -15
- package/guidelines/components/overlay.md +43 -4
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@ interface AutoResizeTextAreaProps extends TextareaAttributes {
|
|
|
6
6
|
/** ChatInput 등 내부 임베딩 시 wrapper 없이 textarea만 렌더 */
|
|
7
7
|
/** 컨트롤 아래에 표시할 검증 메시지. DS 폼 컴포넌트 공통 */
|
|
8
8
|
validations?: Validation[];
|
|
9
|
+
/** 테두리와 배경을 없앤다. ChatInput 처럼 감싸는 쪽이 껍데기를 그릴 때 */
|
|
9
10
|
bare?: boolean;
|
|
10
11
|
}
|
|
11
12
|
declare const AutoResizeTextArea: React.ForwardRefExoticComponent<AutoResizeTextAreaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -6,6 +6,7 @@ interface AutoResizeTextAreaProps extends TextareaAttributes {
|
|
|
6
6
|
/** ChatInput 등 내부 임베딩 시 wrapper 없이 textarea만 렌더 */
|
|
7
7
|
/** 컨트롤 아래에 표시할 검증 메시지. DS 폼 컴포넌트 공통 */
|
|
8
8
|
validations?: Validation[];
|
|
9
|
+
/** 테두리와 배경을 없앤다. ChatInput 처럼 감싸는 쪽이 껍데기를 그릴 때 */
|
|
9
10
|
bare?: boolean;
|
|
10
11
|
}
|
|
11
12
|
declare const AutoResizeTextArea: React.ForwardRefExoticComponent<AutoResizeTextAreaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -26,6 +26,9 @@ __export(Badge_exports, {
|
|
|
26
26
|
});
|
|
27
27
|
module.exports = __toCommonJS(Badge_exports);
|
|
28
28
|
|
|
29
|
+
// src/tokens/interface/status.ts
|
|
30
|
+
var normalizeStatus = (value) => value === "brand" ? "primary" : value;
|
|
31
|
+
|
|
29
32
|
// ../../node_modules/clsx/dist/clsx.mjs
|
|
30
33
|
function r(e) {
|
|
31
34
|
var t, f, n = "";
|
|
@@ -53,11 +56,12 @@ var NotificationBadge = (props) => {
|
|
|
53
56
|
dot = false,
|
|
54
57
|
size = "md"
|
|
55
58
|
} = props;
|
|
59
|
+
const statusType = normalizeStatus(type);
|
|
56
60
|
const showBadge = dot || count !== void 0 && count > 0;
|
|
57
61
|
const displayCount = count !== void 0 && count > maxCount ? `${maxCount}+` : count;
|
|
58
62
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: clsx_default("lib-xplat-notification-badge", size), children: [
|
|
59
63
|
children,
|
|
60
|
-
showBadge && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: clsx_default("badge-indicator",
|
|
64
|
+
showBadge && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: clsx_default("badge-indicator", statusType, { dot }), children: !dot && displayCount })
|
|
61
65
|
] });
|
|
62
66
|
};
|
|
63
67
|
NotificationBadge.displayName = "NotificationBadge";
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
.lib-xplat-notification-badge .badge-indicator.info {
|
|
71
71
|
background-color: var(--semantic-surface-info-default);
|
|
72
72
|
}
|
|
73
|
+
.lib-xplat-notification-badge .badge-indicator.primary,
|
|
73
74
|
.lib-xplat-notification-badge .badge-indicator.brand {
|
|
74
75
|
background-color: var(--semantic-surface-brand-default);
|
|
75
76
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// src/tokens/interface/status.ts
|
|
2
|
+
var normalizeStatus = (value) => value === "brand" ? "primary" : value;
|
|
3
|
+
|
|
1
4
|
// ../../node_modules/clsx/dist/clsx.mjs
|
|
2
5
|
function r(e) {
|
|
3
6
|
var t, f, n = "";
|
|
@@ -25,11 +28,12 @@ var NotificationBadge = (props) => {
|
|
|
25
28
|
dot = false,
|
|
26
29
|
size = "md"
|
|
27
30
|
} = props;
|
|
31
|
+
const statusType = normalizeStatus(type);
|
|
28
32
|
const showBadge = dot || count !== void 0 && count > 0;
|
|
29
33
|
const displayCount = count !== void 0 && count > maxCount ? `${maxCount}+` : count;
|
|
30
34
|
return /* @__PURE__ */ jsxs("div", { className: clsx_default("lib-xplat-notification-badge", size), children: [
|
|
31
35
|
children,
|
|
32
|
-
showBadge && /* @__PURE__ */ jsx("span", { className: clsx_default("badge-indicator",
|
|
36
|
+
showBadge && /* @__PURE__ */ jsx("span", { className: clsx_default("badge-indicator", statusType, { dot }), children: !dot && displayCount })
|
|
33
37
|
] });
|
|
34
38
|
};
|
|
35
39
|
NotificationBadge.displayName = "NotificationBadge";
|
|
@@ -4,8 +4,11 @@ type BoxVariant = "outlined" | "elevated" | "flat";
|
|
|
4
4
|
type BoxPadding = "none" | "sm" | "md" | "lg";
|
|
5
5
|
interface BoxProps {
|
|
6
6
|
children: React.ReactNode;
|
|
7
|
+
/** 상자 위쪽 제목 */
|
|
7
8
|
title?: React.ReactNode;
|
|
9
|
+
/** 테두리·그림자 방식 */
|
|
8
10
|
variant?: BoxVariant;
|
|
11
|
+
/** 안쪽 여백 */
|
|
9
12
|
padding?: BoxPadding;
|
|
10
13
|
}
|
|
11
14
|
declare const Box: React.FC<BoxProps>;
|
|
@@ -4,8 +4,11 @@ type BoxVariant = "outlined" | "elevated" | "flat";
|
|
|
4
4
|
type BoxPadding = "none" | "sm" | "md" | "lg";
|
|
5
5
|
interface BoxProps {
|
|
6
6
|
children: React.ReactNode;
|
|
7
|
+
/** 상자 위쪽 제목 */
|
|
7
8
|
title?: React.ReactNode;
|
|
9
|
+
/** 테두리·그림자 방식 */
|
|
8
10
|
variant?: BoxVariant;
|
|
11
|
+
/** 안쪽 여백 */
|
|
9
12
|
padding?: BoxPadding;
|
|
10
13
|
}
|
|
11
14
|
declare const Box: React.FC<BoxProps>;
|
|
@@ -682,7 +682,8 @@ var ChartLegend = ({ data, labels, type }) => {
|
|
|
682
682
|
}) });
|
|
683
683
|
};
|
|
684
684
|
var Chart = import_react.default.memo((props) => {
|
|
685
|
-
const { type, data, labels, tooltip: showTooltip = true, tooltipType = "light" } = props;
|
|
685
|
+
const { variant, type, data, labels, tooltip: showTooltip = true, tooltipType = "light" } = props;
|
|
686
|
+
const shape = variant ?? type ?? "line";
|
|
686
687
|
const { tooltip, show, hide, move, containerRef } = useChartTooltip(showTooltip);
|
|
687
688
|
const { width, height } = useChartSize(containerRef);
|
|
688
689
|
const stableData = import_react.default.useMemo(() => data, [JSON.stringify(data)]);
|
|
@@ -691,11 +692,11 @@ var Chart = import_react.default.memo((props) => {
|
|
|
691
692
|
const animate = useChartAnimation(containerRef, dataKey);
|
|
692
693
|
const ready = width > 0 && height > 0;
|
|
693
694
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "lib-xplat-chart", ref: containerRef, children: [
|
|
694
|
-
ready &&
|
|
695
|
-
ready &&
|
|
696
|
-
ready &&
|
|
697
|
-
ready &&
|
|
698
|
-
ready &&
|
|
695
|
+
ready && shape === "line" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LineChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
696
|
+
ready && shape === "curve" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CurveChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
697
|
+
ready && shape === "bar" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BarChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
698
|
+
ready && shape === "pie" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
699
|
+
ready && shape === "doughnut" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, isDoughnut: true, onHover: show, onMove: move, onLeave: hide }),
|
|
699
700
|
ready && (type === "pie" || type === "doughnut") && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChartLegend, { data: stableData, labels: stableLabels, type }),
|
|
700
701
|
tooltip.visible && tooltip.content && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChartTooltip, { x: tooltip.x, y: tooltip.y, containerWidth: width, containerHeight: height, tooltipType, children: tooltip.content })
|
|
701
702
|
] });
|
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
+
type ChartVariant = "line" | "curve" | "bar" | "pie" | "doughnut";
|
|
3
4
|
interface ChartProps {
|
|
4
|
-
|
|
5
|
+
/** 차트 종류 */
|
|
6
|
+
variant?: ChartVariant;
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated 모양 변형은 `variant` 로 받는다. `type` 은 상태 색 전용이다.
|
|
9
|
+
* 기존 사용처가 깨지지 않도록 계속 받는다 — 둘 다 주면 `variant` 가 이긴다.
|
|
10
|
+
*/
|
|
11
|
+
type?: ChartVariant;
|
|
12
|
+
/** 계열 이름 → 값 배열. 키 하나가 선/막대 하나가 된다 */
|
|
5
13
|
data: Record<string, number[]>;
|
|
14
|
+
/** x축 라벨. data 의 값 배열과 길이가 같아야 한다 */
|
|
6
15
|
labels: string[];
|
|
16
|
+
/** 마우스를 올렸을 때 값 말풍선을 띄운다 */
|
|
7
17
|
tooltip?: boolean;
|
|
18
|
+
/** 말풍선 배색 */
|
|
8
19
|
tooltipType?: "dark" | "light";
|
|
9
20
|
}
|
|
10
21
|
declare const Chart: React.NamedExoticComponent<ChartProps>;
|
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
+
type ChartVariant = "line" | "curve" | "bar" | "pie" | "doughnut";
|
|
3
4
|
interface ChartProps {
|
|
4
|
-
|
|
5
|
+
/** 차트 종류 */
|
|
6
|
+
variant?: ChartVariant;
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated 모양 변형은 `variant` 로 받는다. `type` 은 상태 색 전용이다.
|
|
9
|
+
* 기존 사용처가 깨지지 않도록 계속 받는다 — 둘 다 주면 `variant` 가 이긴다.
|
|
10
|
+
*/
|
|
11
|
+
type?: ChartVariant;
|
|
12
|
+
/** 계열 이름 → 값 배열. 키 하나가 선/막대 하나가 된다 */
|
|
5
13
|
data: Record<string, number[]>;
|
|
14
|
+
/** x축 라벨. data 의 값 배열과 길이가 같아야 한다 */
|
|
6
15
|
labels: string[];
|
|
16
|
+
/** 마우스를 올렸을 때 값 말풍선을 띄운다 */
|
|
7
17
|
tooltip?: boolean;
|
|
18
|
+
/** 말풍선 배색 */
|
|
8
19
|
tooltipType?: "dark" | "light";
|
|
9
20
|
}
|
|
10
21
|
declare const Chart: React.NamedExoticComponent<ChartProps>;
|
|
@@ -646,7 +646,8 @@ var ChartLegend = ({ data, labels, type }) => {
|
|
|
646
646
|
}) });
|
|
647
647
|
};
|
|
648
648
|
var Chart = React.memo((props) => {
|
|
649
|
-
const { type, data, labels, tooltip: showTooltip = true, tooltipType = "light" } = props;
|
|
649
|
+
const { variant, type, data, labels, tooltip: showTooltip = true, tooltipType = "light" } = props;
|
|
650
|
+
const shape = variant ?? type ?? "line";
|
|
650
651
|
const { tooltip, show, hide, move, containerRef } = useChartTooltip(showTooltip);
|
|
651
652
|
const { width, height } = useChartSize(containerRef);
|
|
652
653
|
const stableData = React.useMemo(() => data, [JSON.stringify(data)]);
|
|
@@ -655,11 +656,11 @@ var Chart = React.memo((props) => {
|
|
|
655
656
|
const animate = useChartAnimation(containerRef, dataKey);
|
|
656
657
|
const ready = width > 0 && height > 0;
|
|
657
658
|
return /* @__PURE__ */ jsxs("div", { className: "lib-xplat-chart", ref: containerRef, children: [
|
|
658
|
-
ready &&
|
|
659
|
-
ready &&
|
|
660
|
-
ready &&
|
|
661
|
-
ready &&
|
|
662
|
-
ready &&
|
|
659
|
+
ready && shape === "line" && /* @__PURE__ */ jsx(LineChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
660
|
+
ready && shape === "curve" && /* @__PURE__ */ jsx(CurveChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
661
|
+
ready && shape === "bar" && /* @__PURE__ */ jsx(BarChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
662
|
+
ready && shape === "pie" && /* @__PURE__ */ jsx(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
663
|
+
ready && shape === "doughnut" && /* @__PURE__ */ jsx(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, isDoughnut: true, onHover: show, onMove: move, onLeave: hide }),
|
|
663
664
|
ready && (type === "pie" || type === "doughnut") && /* @__PURE__ */ jsx(ChartLegend, { data: stableData, labels: stableLabels, type }),
|
|
664
665
|
tooltip.visible && tooltip.content && /* @__PURE__ */ jsx(ChartTooltip, { x: tooltip.x, y: tooltip.y, containerWidth: width, containerHeight: height, tooltipType, children: tooltip.content })
|
|
665
666
|
] });
|
|
@@ -3,13 +3,19 @@ import { V as Validation } from '../../validation-Dqo1zqhT.cjs';
|
|
|
3
3
|
|
|
4
4
|
type ButtonType = "primary" | "secondary" | "ghost";
|
|
5
5
|
interface ChatInputProps {
|
|
6
|
+
/** 비어 있을 때 표시할 안내 글자 */
|
|
6
7
|
placeholder?: string;
|
|
8
|
+
/** 입력값. 주면 controlled 가 된다 */
|
|
7
9
|
value?: string;
|
|
10
|
+
/** 입력과 전송을 막는다 */
|
|
8
11
|
disabled?: boolean;
|
|
9
12
|
/** 컨트롤 아래에 표시할 검증 메시지. DS 폼 컴포넌트 공통 */
|
|
10
13
|
validations?: Validation[];
|
|
14
|
+
/** 전송 버튼 색 */
|
|
11
15
|
buttonType?: ButtonType;
|
|
16
|
+
/** Enter 또는 전송 버튼을 누르면 현재 값을 준다 */
|
|
12
17
|
onSubmit?: (value: string) => void;
|
|
18
|
+
/** 입력할 때마다 값을 준다 */
|
|
13
19
|
onChange?: (value: string) => void;
|
|
14
20
|
}
|
|
15
21
|
declare const ChatInput: React.ForwardRefExoticComponent<ChatInputProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -3,13 +3,19 @@ import { V as Validation } from '../../validation-Dqo1zqhT.js';
|
|
|
3
3
|
|
|
4
4
|
type ButtonType = "primary" | "secondary" | "ghost";
|
|
5
5
|
interface ChatInputProps {
|
|
6
|
+
/** 비어 있을 때 표시할 안내 글자 */
|
|
6
7
|
placeholder?: string;
|
|
8
|
+
/** 입력값. 주면 controlled 가 된다 */
|
|
7
9
|
value?: string;
|
|
10
|
+
/** 입력과 전송을 막는다 */
|
|
8
11
|
disabled?: boolean;
|
|
9
12
|
/** 컨트롤 아래에 표시할 검증 메시지. DS 폼 컴포넌트 공통 */
|
|
10
13
|
validations?: Validation[];
|
|
14
|
+
/** 전송 버튼 색 */
|
|
11
15
|
buttonType?: ButtonType;
|
|
16
|
+
/** Enter 또는 전송 버튼을 누르면 현재 값을 준다 */
|
|
12
17
|
onSubmit?: (value: string) => void;
|
|
18
|
+
/** 입력할 때마다 값을 준다 */
|
|
13
19
|
onChange?: (value: string) => void;
|
|
14
20
|
}
|
|
15
21
|
declare const ChatInput: React.ForwardRefExoticComponent<ChatInputProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -1019,6 +1019,9 @@ var import_jsx_runtime294 = require("react/jsx-runtime");
|
|
|
1019
1019
|
// src/tokens/index.ts
|
|
1020
1020
|
var import_tokens_core2 = require("@x-plat/tokens-core");
|
|
1021
1021
|
|
|
1022
|
+
// src/tokens/interface/status.ts
|
|
1023
|
+
var normalizeStatus = (value) => value === "brand" ? "primary" : value;
|
|
1024
|
+
|
|
1022
1025
|
// ../../node_modules/clsx/dist/clsx.mjs
|
|
1023
1026
|
function r(e) {
|
|
1024
1027
|
var t, f, n = "";
|
|
@@ -1080,10 +1083,11 @@ var CheckBox = (props) => {
|
|
|
1080
1083
|
onChange,
|
|
1081
1084
|
disabled,
|
|
1082
1085
|
size = "md",
|
|
1083
|
-
type = "
|
|
1086
|
+
type = "primary",
|
|
1084
1087
|
validations,
|
|
1085
1088
|
...rest
|
|
1086
1089
|
} = props;
|
|
1090
|
+
const statusType = normalizeStatus(type);
|
|
1087
1091
|
const handleChange = (e) => {
|
|
1088
1092
|
if (onChange) onChange(e);
|
|
1089
1093
|
};
|
|
@@ -1091,7 +1095,7 @@ var CheckBox = (props) => {
|
|
|
1091
1095
|
const checkedClasses = `checked`;
|
|
1092
1096
|
const disabledClasses = "disabled";
|
|
1093
1097
|
const boxClasses = disabled ? disabledClasses : checked ? checkedClasses : uncheckedClasses;
|
|
1094
|
-
const control = /* @__PURE__ */ (0, import_jsx_runtime296.jsxs)("label", { className: clsx_default("lib-xplat-checkbox", size,
|
|
1098
|
+
const control = /* @__PURE__ */ (0, import_jsx_runtime296.jsxs)("label", { className: clsx_default("lib-xplat-checkbox", size, statusType, className), children: [
|
|
1095
1099
|
/* @__PURE__ */ (0, import_jsx_runtime296.jsx)(
|
|
1096
1100
|
"input",
|
|
1097
1101
|
{
|
|
@@ -110,6 +110,7 @@
|
|
|
110
110
|
.lib-xplat-checkbox:hover > .checkbox.unchecked {
|
|
111
111
|
background-color: var(--semantic-surface-neutral-disabled);
|
|
112
112
|
}
|
|
113
|
+
.lib-xplat-checkbox.primary > .checkbox.checked,
|
|
113
114
|
.lib-xplat-checkbox.brand > .checkbox.checked {
|
|
114
115
|
background-color: var(--semantic-surface-brand-default);
|
|
115
116
|
}
|
|
@@ -125,6 +126,7 @@
|
|
|
125
126
|
.lib-xplat-checkbox.info > .checkbox.checked {
|
|
126
127
|
background-color: var(--semantic-surface-info-default);
|
|
127
128
|
}
|
|
129
|
+
.lib-xplat-checkbox:hover.primary > .checkbox.checked,
|
|
128
130
|
.lib-xplat-checkbox:hover.brand > .checkbox.checked {
|
|
129
131
|
background-color: var(--semantic-surface-brand-strong);
|
|
130
132
|
}
|
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { I as InputAttributes } from '../../attributes-DJIWir_0.cjs';
|
|
3
|
+
import { L as LegacyStatusType } from '../../status-g_KP3qT6.cjs';
|
|
3
4
|
import { V as Validation } from '../../validation-Dqo1zqhT.cjs';
|
|
4
5
|
import 'react';
|
|
5
6
|
|
|
6
7
|
type CheckBoxSize = "sm" | "md" | "lg";
|
|
7
|
-
|
|
8
|
+
/** CheckBox 의 상태 색 */
|
|
9
|
+
type CheckBoxType = "primary" | "success" | "error" | "warning" | "info";
|
|
10
|
+
/** 입력으로는 예전 이름 `brand` 도 받는다 (= `primary`) */
|
|
11
|
+
type CheckBoxTypeInput = CheckBoxType | LegacyStatusType;
|
|
8
12
|
interface CheckBoxProps extends Omit<InputAttributes, "size"> {
|
|
13
|
+
/** 체크박스 옆에 붙는 글자. 클릭하면 체크가 토글된다 */
|
|
9
14
|
label?: string;
|
|
15
|
+
/** 체크 여부. 주면 controlled 가 되므로 onChange 와 함께 쓴다 */
|
|
10
16
|
checked?: boolean;
|
|
11
17
|
/** 컨트롤 아래에 표시할 검증 메시지. DS 폼 컴포넌트 공통 */
|
|
12
18
|
validations?: Validation[];
|
|
19
|
+
/** 컨트롤 크기. 글자 크기도 함께 바뀐다 */
|
|
13
20
|
size?: CheckBoxSize;
|
|
14
|
-
|
|
21
|
+
/** 체크됐을 때의 색 */
|
|
22
|
+
type?: CheckBoxTypeInput;
|
|
15
23
|
}
|
|
16
24
|
declare const CheckBox: {
|
|
17
25
|
(props: CheckBoxProps): react_jsx_runtime.JSX.Element;
|
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { I as InputAttributes } from '../../attributes-DJIWir_0.js';
|
|
3
|
+
import { L as LegacyStatusType } from '../../status-g_KP3qT6.js';
|
|
3
4
|
import { V as Validation } from '../../validation-Dqo1zqhT.js';
|
|
4
5
|
import 'react';
|
|
5
6
|
|
|
6
7
|
type CheckBoxSize = "sm" | "md" | "lg";
|
|
7
|
-
|
|
8
|
+
/** CheckBox 의 상태 색 */
|
|
9
|
+
type CheckBoxType = "primary" | "success" | "error" | "warning" | "info";
|
|
10
|
+
/** 입력으로는 예전 이름 `brand` 도 받는다 (= `primary`) */
|
|
11
|
+
type CheckBoxTypeInput = CheckBoxType | LegacyStatusType;
|
|
8
12
|
interface CheckBoxProps extends Omit<InputAttributes, "size"> {
|
|
13
|
+
/** 체크박스 옆에 붙는 글자. 클릭하면 체크가 토글된다 */
|
|
9
14
|
label?: string;
|
|
15
|
+
/** 체크 여부. 주면 controlled 가 되므로 onChange 와 함께 쓴다 */
|
|
10
16
|
checked?: boolean;
|
|
11
17
|
/** 컨트롤 아래에 표시할 검증 메시지. DS 폼 컴포넌트 공통 */
|
|
12
18
|
validations?: Validation[];
|
|
19
|
+
/** 컨트롤 크기. 글자 크기도 함께 바뀐다 */
|
|
13
20
|
size?: CheckBoxSize;
|
|
14
|
-
|
|
21
|
+
/** 체크됐을 때의 색 */
|
|
22
|
+
type?: CheckBoxTypeInput;
|
|
15
23
|
}
|
|
16
24
|
declare const CheckBox: {
|
|
17
25
|
(props: CheckBoxProps): react_jsx_runtime.JSX.Element;
|
|
@@ -993,6 +993,9 @@ import { jsx as jsx294, jsxs as jsxs188 } from "react/jsx-runtime";
|
|
|
993
993
|
// src/tokens/index.ts
|
|
994
994
|
import { cssVar } from "@x-plat/tokens-core";
|
|
995
995
|
|
|
996
|
+
// src/tokens/interface/status.ts
|
|
997
|
+
var normalizeStatus = (value) => value === "brand" ? "primary" : value;
|
|
998
|
+
|
|
996
999
|
// ../../node_modules/clsx/dist/clsx.mjs
|
|
997
1000
|
function r(e) {
|
|
998
1001
|
var t, f, n = "";
|
|
@@ -1054,10 +1057,11 @@ var CheckBox = (props) => {
|
|
|
1054
1057
|
onChange,
|
|
1055
1058
|
disabled,
|
|
1056
1059
|
size = "md",
|
|
1057
|
-
type = "
|
|
1060
|
+
type = "primary",
|
|
1058
1061
|
validations,
|
|
1059
1062
|
...rest
|
|
1060
1063
|
} = props;
|
|
1064
|
+
const statusType = normalizeStatus(type);
|
|
1061
1065
|
const handleChange = (e) => {
|
|
1062
1066
|
if (onChange) onChange(e);
|
|
1063
1067
|
};
|
|
@@ -1065,7 +1069,7 @@ var CheckBox = (props) => {
|
|
|
1065
1069
|
const checkedClasses = `checked`;
|
|
1066
1070
|
const disabledClasses = "disabled";
|
|
1067
1071
|
const boxClasses = disabled ? disabledClasses : checked ? checkedClasses : uncheckedClasses;
|
|
1068
|
-
const control = /* @__PURE__ */ jsxs190("label", { className: clsx_default("lib-xplat-checkbox", size,
|
|
1072
|
+
const control = /* @__PURE__ */ jsxs190("label", { className: clsx_default("lib-xplat-checkbox", size, statusType, className), children: [
|
|
1069
1073
|
/* @__PURE__ */ jsx296(
|
|
1070
1074
|
"input",
|
|
1071
1075
|
{
|
|
@@ -5,7 +5,9 @@ type ChipType = "primary" | "secondary" | "neutral" | "success" | "error" | "war
|
|
|
5
5
|
type ChipSize = "sm" | "md" | "lg";
|
|
6
6
|
interface ChipProps {
|
|
7
7
|
children: React.ReactNode;
|
|
8
|
+
/** 칩 색. 상태를 나타낸다 */
|
|
8
9
|
type?: ChipType;
|
|
10
|
+
/** 칩 크기 */
|
|
9
11
|
size?: ChipSize;
|
|
10
12
|
}
|
|
11
13
|
declare const Chip: {
|
|
@@ -5,7 +5,9 @@ type ChipType = "primary" | "secondary" | "neutral" | "success" | "error" | "war
|
|
|
5
5
|
type ChipSize = "sm" | "md" | "lg";
|
|
6
6
|
interface ChipProps {
|
|
7
7
|
children: React.ReactNode;
|
|
8
|
+
/** 칩 색. 상태를 나타낸다 */
|
|
8
9
|
type?: ChipType;
|
|
10
|
+
/** 칩 크기 */
|
|
9
11
|
size?: ChipSize;
|
|
10
12
|
}
|
|
11
13
|
declare const Chip: {
|
|
@@ -1792,7 +1792,8 @@ var TabItem_default = TabItem;
|
|
|
1792
1792
|
// src/components/Tab/Tab.tsx
|
|
1793
1793
|
var import_jsx_runtime303 = require("react/jsx-runtime");
|
|
1794
1794
|
var Tab = (props) => {
|
|
1795
|
-
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
1795
|
+
const { activeIndex, onChange, tabs, variant, type, size = "md" } = props;
|
|
1796
|
+
const shape = variant ?? type ?? "default";
|
|
1796
1797
|
const [underlineStyle, setUnderlineStyle] = import_react8.default.useState({
|
|
1797
1798
|
left: 0,
|
|
1798
1799
|
width: 0
|
|
@@ -1807,7 +1808,7 @@ var Tab = (props) => {
|
|
|
1807
1808
|
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
1808
1809
|
}
|
|
1809
1810
|
}, [activeIndex, tabs.length]);
|
|
1810
|
-
return /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)("div", { className: clsx_default("lib-xplat-tab", `type-${
|
|
1811
|
+
return /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)("div", { className: clsx_default("lib-xplat-tab", `type-${shape}`, size), children: [
|
|
1811
1812
|
tabs.map((tab, idx) => /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
|
|
1812
1813
|
TabItem_default,
|
|
1813
1814
|
{
|
|
@@ -1820,7 +1821,7 @@ var Tab = (props) => {
|
|
|
1820
1821
|
},
|
|
1821
1822
|
`${tab.value}_${idx}`
|
|
1822
1823
|
)),
|
|
1823
|
-
|
|
1824
|
+
shape === "toggle" && /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
|
|
1824
1825
|
"div",
|
|
1825
1826
|
{
|
|
1826
1827
|
className: "tab-toggle-underline",
|
|
@@ -1753,7 +1753,8 @@ var TabItem_default = TabItem;
|
|
|
1753
1753
|
// src/components/Tab/Tab.tsx
|
|
1754
1754
|
import { jsx as jsx303, jsxs as jsxs193 } from "react/jsx-runtime";
|
|
1755
1755
|
var Tab = (props) => {
|
|
1756
|
-
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
1756
|
+
const { activeIndex, onChange, tabs, variant, type, size = "md" } = props;
|
|
1757
|
+
const shape = variant ?? type ?? "default";
|
|
1757
1758
|
const [underlineStyle, setUnderlineStyle] = React8.useState({
|
|
1758
1759
|
left: 0,
|
|
1759
1760
|
width: 0
|
|
@@ -1768,7 +1769,7 @@ var Tab = (props) => {
|
|
|
1768
1769
|
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
1769
1770
|
}
|
|
1770
1771
|
}, [activeIndex, tabs.length]);
|
|
1771
|
-
return /* @__PURE__ */ jsxs193("div", { className: clsx_default("lib-xplat-tab", `type-${
|
|
1772
|
+
return /* @__PURE__ */ jsxs193("div", { className: clsx_default("lib-xplat-tab", `type-${shape}`, size), children: [
|
|
1772
1773
|
tabs.map((tab, idx) => /* @__PURE__ */ jsx303(
|
|
1773
1774
|
TabItem_default,
|
|
1774
1775
|
{
|
|
@@ -1781,7 +1782,7 @@ var Tab = (props) => {
|
|
|
1781
1782
|
},
|
|
1782
1783
|
`${tab.value}_${idx}`
|
|
1783
1784
|
)),
|
|
1784
|
-
|
|
1785
|
+
shape === "toggle" && /* @__PURE__ */ jsx303(
|
|
1785
1786
|
"div",
|
|
1786
1787
|
{
|
|
1787
1788
|
className: "tab-toggle-underline",
|
|
@@ -2,13 +2,19 @@ import React from 'react';
|
|
|
2
2
|
import { V as Validation } from '../../validation-Dqo1zqhT.cjs';
|
|
3
3
|
|
|
4
4
|
interface FileUploadProps {
|
|
5
|
+
/** 고를 수 있는 파일 형식 (input 의 accept 와 같다) */
|
|
5
6
|
accept?: string;
|
|
7
|
+
/** 여러 개를 한 번에 고를 수 있게 한다 */
|
|
6
8
|
multiple?: boolean;
|
|
7
9
|
/** 컨트롤 아래에 표시할 검증 메시지. DS 폼 컴포넌트 공통 */
|
|
8
10
|
validations?: Validation[];
|
|
11
|
+
/** 바이트 단위 최대 크기. **초과분은 조용히 걸러진다** */
|
|
9
12
|
maxSize?: number;
|
|
13
|
+
/** 고른 파일 목록을 준다. maxSize 로 걸러진 것은 빠져 있다 */
|
|
10
14
|
onChange?: (files: File[]) => void;
|
|
15
|
+
/** 상자 안 큰 글자 */
|
|
11
16
|
label?: string;
|
|
17
|
+
/** 상자 안 작은 설명 */
|
|
12
18
|
description?: string;
|
|
13
19
|
}
|
|
14
20
|
declare const FileUpload: React.FC<FileUploadProps>;
|
|
@@ -2,13 +2,19 @@ import React from 'react';
|
|
|
2
2
|
import { V as Validation } from '../../validation-Dqo1zqhT.js';
|
|
3
3
|
|
|
4
4
|
interface FileUploadProps {
|
|
5
|
+
/** 고를 수 있는 파일 형식 (input 의 accept 와 같다) */
|
|
5
6
|
accept?: string;
|
|
7
|
+
/** 여러 개를 한 번에 고를 수 있게 한다 */
|
|
6
8
|
multiple?: boolean;
|
|
7
9
|
/** 컨트롤 아래에 표시할 검증 메시지. DS 폼 컴포넌트 공통 */
|
|
8
10
|
validations?: Validation[];
|
|
11
|
+
/** 바이트 단위 최대 크기. **초과분은 조용히 걸러진다** */
|
|
9
12
|
maxSize?: number;
|
|
13
|
+
/** 고른 파일 목록을 준다. maxSize 로 걸러진 것은 빠져 있다 */
|
|
10
14
|
onChange?: (files: File[]) => void;
|
|
15
|
+
/** 상자 안 큰 글자 */
|
|
11
16
|
label?: string;
|
|
17
|
+
/** 상자 안 작은 설명 */
|
|
12
18
|
description?: string;
|
|
13
19
|
}
|
|
14
20
|
declare const FileUpload: React.FC<FileUploadProps>;
|
|
@@ -2,10 +2,13 @@ import React from 'react';
|
|
|
2
2
|
import { V as Validation } from '../../validation-Dqo1zqhT.cjs';
|
|
3
3
|
|
|
4
4
|
interface ImageSelectorProps {
|
|
5
|
+
/** 선택된 이미지 파일. 주면 미리보기가 나온다 */
|
|
5
6
|
value?: File;
|
|
6
7
|
/** 컨트롤 아래에 표시할 검증 메시지. DS 폼 컴포넌트 공통 */
|
|
7
8
|
validations?: Validation[];
|
|
9
|
+
/** 비어 있을 때 표시할 안내 글자 */
|
|
8
10
|
label?: string;
|
|
11
|
+
/** 이미지를 고르거나 지우면 호출된다. 지우면 undefined 가 온다 */
|
|
9
12
|
onChange?: (value: File | undefined) => void;
|
|
10
13
|
}
|
|
11
14
|
declare const ImageSelector: React.FC<ImageSelectorProps>;
|
|
@@ -2,10 +2,13 @@ import React from 'react';
|
|
|
2
2
|
import { V as Validation } from '../../validation-Dqo1zqhT.js';
|
|
3
3
|
|
|
4
4
|
interface ImageSelectorProps {
|
|
5
|
+
/** 선택된 이미지 파일. 주면 미리보기가 나온다 */
|
|
5
6
|
value?: File;
|
|
6
7
|
/** 컨트롤 아래에 표시할 검증 메시지. DS 폼 컴포넌트 공통 */
|
|
7
8
|
validations?: Validation[];
|
|
9
|
+
/** 비어 있을 때 표시할 안내 글자 */
|
|
8
10
|
label?: string;
|
|
11
|
+
/** 이미지를 고르거나 지우면 호출된다. 지우면 undefined 가 온다 */
|
|
9
12
|
onChange?: (value: File | undefined) => void;
|
|
10
13
|
}
|
|
11
14
|
declare const ImageSelector: React.FC<ImageSelectorProps>;
|
|
@@ -4,9 +4,12 @@ import { V as Validation } from '../../validation-Dqo1zqhT.cjs';
|
|
|
4
4
|
|
|
5
5
|
type InputSize$1 = "sm" | "md" | "lg";
|
|
6
6
|
interface InputProps extends Omit<InputAttributes, "size"> {
|
|
7
|
+
/** 입력 종류. number 는 천 단위 구분, tel 은 하이픈을 자동으로 넣는다 */
|
|
7
8
|
type?: "text" | "number" | "email" | "password" | "tel";
|
|
9
|
+
/** 높이와 글자 크기 */
|
|
8
10
|
size?: InputSize$1;
|
|
9
11
|
validations?: Validation[];
|
|
12
|
+
/** 입력칸 오른쪽에 붙일 요소 (단위·아이콘 등) */
|
|
10
13
|
suffix?: React.ReactNode;
|
|
11
14
|
}
|
|
12
15
|
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -14,6 +17,7 @@ declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttri
|
|
|
14
17
|
type InputSize = "sm" | "md" | "lg";
|
|
15
18
|
interface PasswordInputProps extends Omit<InputAttributes, "size"> {
|
|
16
19
|
validations?: Validation[];
|
|
20
|
+
/** 높이와 글자 크기 */
|
|
17
21
|
size?: InputSize;
|
|
18
22
|
reg?: RegExp;
|
|
19
23
|
}
|
|
@@ -4,9 +4,12 @@ import { V as Validation } from '../../validation-Dqo1zqhT.js';
|
|
|
4
4
|
|
|
5
5
|
type InputSize$1 = "sm" | "md" | "lg";
|
|
6
6
|
interface InputProps extends Omit<InputAttributes, "size"> {
|
|
7
|
+
/** 입력 종류. number 는 천 단위 구분, tel 은 하이픈을 자동으로 넣는다 */
|
|
7
8
|
type?: "text" | "number" | "email" | "password" | "tel";
|
|
9
|
+
/** 높이와 글자 크기 */
|
|
8
10
|
size?: InputSize$1;
|
|
9
11
|
validations?: Validation[];
|
|
12
|
+
/** 입력칸 오른쪽에 붙일 요소 (단위·아이콘 등) */
|
|
10
13
|
suffix?: React.ReactNode;
|
|
11
14
|
}
|
|
12
15
|
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -14,6 +17,7 @@ declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttri
|
|
|
14
17
|
type InputSize = "sm" | "md" | "lg";
|
|
15
18
|
interface PasswordInputProps extends Omit<InputAttributes, "size"> {
|
|
16
19
|
validations?: Validation[];
|
|
20
|
+
/** 높이와 글자 크기 */
|
|
17
21
|
size?: InputSize;
|
|
18
22
|
reg?: RegExp;
|
|
19
23
|
}
|