@x-plat/design-system 0.8.3 → 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.cjs +140 -4
- package/dist/components/AutoResizeTextArea/index.css +38 -0
- package/dist/components/AutoResizeTextArea/index.d.cts +4 -0
- package/dist/components/AutoResizeTextArea/index.d.ts +4 -0
- package/dist/components/AutoResizeTextArea/index.js +140 -4
- 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.cjs +150 -9
- package/dist/components/ChatInput/index.css +38 -0
- package/dist/components/ChatInput/index.d.cts +9 -0
- package/dist/components/ChatInput/index.d.ts +9 -0
- package/dist/components/ChatInput/index.js +151 -10
- package/dist/components/CheckBox/index.cjs +137 -6
- package/dist/components/CheckBox/index.css +40 -0
- package/dist/components/CheckBox/index.d.cts +13 -2
- package/dist/components/CheckBox/index.d.ts +13 -2
- package/dist/components/CheckBox/index.js +137 -6
- package/dist/components/Chip/index.d.cts +2 -0
- package/dist/components/Chip/index.d.ts +2 -0
- package/dist/components/DatePicker/index.cjs +76 -62
- package/dist/components/DatePicker/index.css +38 -31
- package/dist/components/DatePicker/index.js +42 -28
- package/dist/components/Drawer/index.d.cts +1 -0
- package/dist/components/Drawer/index.d.ts +1 -0
- package/dist/components/FieldMessage/index.cjs +183 -0
- package/dist/components/FieldMessage/index.css +37 -0
- package/dist/components/FieldMessage/index.d.cts +37 -0
- package/dist/components/FieldMessage/index.d.ts +37 -0
- package/dist/components/FieldMessage/index.js +154 -0
- package/dist/components/FileUpload/index.cjs +135 -8
- package/dist/components/FileUpload/index.css +38 -0
- package/dist/components/FileUpload/index.d.cts +9 -0
- package/dist/components/FileUpload/index.d.ts +9 -0
- package/dist/components/FileUpload/index.js +135 -8
- package/dist/components/ImageSelector/index.cjs +153 -11
- package/dist/components/ImageSelector/index.css +38 -0
- package/dist/components/ImageSelector/index.d.cts +6 -0
- package/dist/components/ImageSelector/index.d.ts +6 -0
- package/dist/components/ImageSelector/index.js +153 -11
- package/dist/components/Input/index.cjs +38 -25
- package/dist/components/Input/index.css +38 -31
- package/dist/components/Input/index.d.cts +7 -8
- package/dist/components/Input/index.d.ts +7 -8
- package/dist/components/Input/index.js +36 -23
- 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 +158 -10
- package/dist/components/Radio/index.css +40 -0
- package/dist/components/Radio/index.d.cts +14 -2
- package/dist/components/Radio/index.d.ts +14 -2
- package/dist/components/Radio/index.js +158 -10
- package/dist/components/Select/index.cjs +139 -13
- package/dist/components/Select/index.css +38 -0
- package/dist/components/Select/index.d.cts +8 -1
- package/dist/components/Select/index.d.ts +8 -1
- package/dist/components/Select/index.js +139 -13
- 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 +146 -6
- package/dist/components/Switch/index.css +40 -0
- package/dist/components/Switch/index.d.cts +13 -2
- package/dist/components/Switch/index.d.ts +13 -2
- package/dist/components/Switch/index.js +146 -6
- 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.cjs +138 -2
- package/dist/components/TextArea/index.css +38 -0
- package/dist/components/TextArea/index.d.cts +6 -0
- package/dist/components/TextArea/index.d.ts +6 -0
- package/dist/components/TextArea/index.js +138 -2
- 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 +479 -408
- package/dist/components/index.css +59 -31
- package/dist/components/index.d.cts +3 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +262 -194
- package/dist/index.cjs +484 -413
- package/dist/index.css +59 -31
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +264 -196
- package/dist/status-g_KP3qT6.d.cts +8 -0
- package/dist/status-g_KP3qT6.d.ts +8 -0
- package/dist/validation-Dqo1zqhT.d.cts +13 -0
- package/dist/validation-Dqo1zqhT.d.ts +13 -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/form.md +26 -0
- package/guidelines/components/navigation.md +16 -15
- package/guidelines/components/overlay.md +43 -4
- package/package.json +1 -1
|
@@ -24,6 +24,9 @@ __export(Pagination_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(Pagination_exports);
|
|
26
26
|
|
|
27
|
+
// src/tokens/interface/status.ts
|
|
28
|
+
var normalizeStatus = (value) => value === "brand" ? "primary" : value;
|
|
29
|
+
|
|
27
30
|
// src/tokens/svg/action/CopyIcon.tsx
|
|
28
31
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
29
32
|
|
|
@@ -981,8 +984,9 @@ var Pagination = (props) => {
|
|
|
981
984
|
siblingCount = 1,
|
|
982
985
|
onChange,
|
|
983
986
|
size = "md",
|
|
984
|
-
type = "
|
|
987
|
+
type = "primary"
|
|
985
988
|
} = props;
|
|
989
|
+
const statusType = normalizeStatus(type);
|
|
986
990
|
const totalPages = Math.max(1, Math.ceil(total / pageSize));
|
|
987
991
|
const pages = getPageRange(current, totalPages, siblingCount);
|
|
988
992
|
const handleClick = (page) => {
|
|
@@ -990,7 +994,7 @@ var Pagination = (props) => {
|
|
|
990
994
|
onChange?.(page);
|
|
991
995
|
}
|
|
992
996
|
};
|
|
993
|
-
return /* @__PURE__ */ (0, import_jsx_runtime295.jsxs)("nav", { className: clsx_default("lib-xplat-pagination", size,
|
|
997
|
+
return /* @__PURE__ */ (0, import_jsx_runtime295.jsxs)("nav", { className: clsx_default("lib-xplat-pagination", size, statusType), "aria-label": "\uD398\uC774\uC9C0 \uB124\uBE44\uAC8C\uC774\uC158", children: [
|
|
994
998
|
/* @__PURE__ */ (0, import_jsx_runtime295.jsx)(
|
|
995
999
|
"button",
|
|
996
1000
|
{
|
|
@@ -93,6 +93,7 @@
|
|
|
93
93
|
.lib-xplat-pagination .page-btn svg {
|
|
94
94
|
font-size: var(--semantic-typo-label-2-m-size);
|
|
95
95
|
}
|
|
96
|
+
.lib-xplat-pagination.primary .page-btn.active,
|
|
96
97
|
.lib-xplat-pagination.brand .page-btn.active {
|
|
97
98
|
background-color: var(--semantic-surface-brand-default);
|
|
98
99
|
}
|
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { L as LegacyStatusType } from '../../status-g_KP3qT6.cjs';
|
|
2
3
|
|
|
3
4
|
type PaginationSize = "sm" | "md" | "lg";
|
|
4
|
-
|
|
5
|
+
/** Pagination 의 상태 색 */
|
|
6
|
+
type PaginationType = "primary" | "success" | "error" | "warning" | "info";
|
|
7
|
+
/** 입력으로는 예전 이름 `brand` 도 받는다 (= `primary`) */
|
|
8
|
+
type PaginationTypeInput = PaginationType | LegacyStatusType;
|
|
5
9
|
interface PaginationProps {
|
|
10
|
+
/** 현재 페이지 (1부터 시작) */
|
|
6
11
|
current: number;
|
|
12
|
+
/** **전체 아이템 수**. 페이지 수가 아니다 */
|
|
7
13
|
total: number;
|
|
14
|
+
/** 한 페이지에 담기는 아이템 수. total 과 함께 페이지 수를 계산한다 */
|
|
8
15
|
pageSize?: number;
|
|
16
|
+
/** 현재 페이지 좌우로 보여줄 번호 개수 */
|
|
9
17
|
siblingCount?: number;
|
|
18
|
+
/** 페이지를 누르면 새 페이지 번호를 준다 */
|
|
10
19
|
onChange?: (page: number) => void;
|
|
20
|
+
/** 버튼 크기 */
|
|
11
21
|
size?: PaginationSize;
|
|
12
|
-
|
|
22
|
+
/** 활성 페이지 색 */
|
|
23
|
+
type?: PaginationTypeInput;
|
|
13
24
|
}
|
|
14
25
|
declare const Pagination: {
|
|
15
26
|
(props: PaginationProps): react_jsx_runtime.JSX.Element;
|
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { L as LegacyStatusType } from '../../status-g_KP3qT6.js';
|
|
2
3
|
|
|
3
4
|
type PaginationSize = "sm" | "md" | "lg";
|
|
4
|
-
|
|
5
|
+
/** Pagination 의 상태 색 */
|
|
6
|
+
type PaginationType = "primary" | "success" | "error" | "warning" | "info";
|
|
7
|
+
/** 입력으로는 예전 이름 `brand` 도 받는다 (= `primary`) */
|
|
8
|
+
type PaginationTypeInput = PaginationType | LegacyStatusType;
|
|
5
9
|
interface PaginationProps {
|
|
10
|
+
/** 현재 페이지 (1부터 시작) */
|
|
6
11
|
current: number;
|
|
12
|
+
/** **전체 아이템 수**. 페이지 수가 아니다 */
|
|
7
13
|
total: number;
|
|
14
|
+
/** 한 페이지에 담기는 아이템 수. total 과 함께 페이지 수를 계산한다 */
|
|
8
15
|
pageSize?: number;
|
|
16
|
+
/** 현재 페이지 좌우로 보여줄 번호 개수 */
|
|
9
17
|
siblingCount?: number;
|
|
18
|
+
/** 페이지를 누르면 새 페이지 번호를 준다 */
|
|
10
19
|
onChange?: (page: number) => void;
|
|
20
|
+
/** 버튼 크기 */
|
|
11
21
|
size?: PaginationSize;
|
|
12
|
-
|
|
22
|
+
/** 활성 페이지 색 */
|
|
23
|
+
type?: PaginationTypeInput;
|
|
13
24
|
}
|
|
14
25
|
declare const Pagination: {
|
|
15
26
|
(props: PaginationProps): react_jsx_runtime.JSX.Element;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// src/tokens/interface/status.ts
|
|
2
|
+
var normalizeStatus = (value) => value === "brand" ? "primary" : value;
|
|
3
|
+
|
|
1
4
|
// src/tokens/svg/action/CopyIcon.tsx
|
|
2
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
6
|
|
|
@@ -955,8 +958,9 @@ var Pagination = (props) => {
|
|
|
955
958
|
siblingCount = 1,
|
|
956
959
|
onChange,
|
|
957
960
|
size = "md",
|
|
958
|
-
type = "
|
|
961
|
+
type = "primary"
|
|
959
962
|
} = props;
|
|
963
|
+
const statusType = normalizeStatus(type);
|
|
960
964
|
const totalPages = Math.max(1, Math.ceil(total / pageSize));
|
|
961
965
|
const pages = getPageRange(current, totalPages, siblingCount);
|
|
962
966
|
const handleClick = (page) => {
|
|
@@ -964,7 +968,7 @@ var Pagination = (props) => {
|
|
|
964
968
|
onChange?.(page);
|
|
965
969
|
}
|
|
966
970
|
};
|
|
967
|
-
return /* @__PURE__ */ jsxs189("nav", { className: clsx_default("lib-xplat-pagination", size,
|
|
971
|
+
return /* @__PURE__ */ jsxs189("nav", { className: clsx_default("lib-xplat-pagination", size, statusType), "aria-label": "\uD398\uC774\uC9C0 \uB124\uBE44\uAC8C\uC774\uC158", children: [
|
|
968
972
|
/* @__PURE__ */ jsx295(
|
|
969
973
|
"button",
|
|
970
974
|
{
|
|
@@ -24,6 +24,9 @@ __export(Progress_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(Progress_exports);
|
|
26
26
|
|
|
27
|
+
// src/tokens/interface/status.ts
|
|
28
|
+
var normalizeStatus = (value) => value === "brand" ? "primary" : value;
|
|
29
|
+
|
|
27
30
|
// ../../node_modules/clsx/dist/clsx.mjs
|
|
28
31
|
function r(e) {
|
|
29
32
|
var t, f, n = "";
|
|
@@ -47,11 +50,12 @@ var Progress = (props) => {
|
|
|
47
50
|
value,
|
|
48
51
|
max = 100,
|
|
49
52
|
size = "md",
|
|
50
|
-
type = "
|
|
53
|
+
type = "primary",
|
|
51
54
|
showLabel = false
|
|
52
55
|
} = props;
|
|
56
|
+
const statusType = normalizeStatus(type);
|
|
53
57
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
54
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: clsx_default("lib-xplat-progress", size,
|
|
58
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: clsx_default("lib-xplat-progress", size, statusType), children: [
|
|
55
59
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
56
60
|
"div",
|
|
57
61
|
{
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { L as LegacyStatusType } from '../../status-g_KP3qT6.cjs';
|
|
2
3
|
|
|
3
4
|
type ProgressSize = "sm" | "md" | "lg";
|
|
4
|
-
|
|
5
|
+
/** Progress 의 상태 색 */
|
|
6
|
+
type ProgressType = "primary" | "success" | "error" | "warning" | "info";
|
|
7
|
+
/** 입력으로는 예전 이름 `brand` 도 받는다 (= `primary`) */
|
|
8
|
+
type ProgressTypeInput = ProgressType | LegacyStatusType;
|
|
5
9
|
interface ProgressProps {
|
|
10
|
+
/** 현재 값. max 에 대한 비율로 채워진다 */
|
|
6
11
|
value: number;
|
|
12
|
+
/** 최대값. 기본 100 */
|
|
7
13
|
max?: number;
|
|
14
|
+
/** 막대 두께 */
|
|
8
15
|
size?: ProgressSize;
|
|
9
|
-
|
|
16
|
+
/** 막대 색 */
|
|
17
|
+
type?: ProgressTypeInput;
|
|
18
|
+
/** 오른쪽에 퍼센트 글자를 표시한다 */
|
|
10
19
|
showLabel?: boolean;
|
|
11
20
|
}
|
|
12
21
|
declare const Progress: {
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { L as LegacyStatusType } from '../../status-g_KP3qT6.js';
|
|
2
3
|
|
|
3
4
|
type ProgressSize = "sm" | "md" | "lg";
|
|
4
|
-
|
|
5
|
+
/** Progress 의 상태 색 */
|
|
6
|
+
type ProgressType = "primary" | "success" | "error" | "warning" | "info";
|
|
7
|
+
/** 입력으로는 예전 이름 `brand` 도 받는다 (= `primary`) */
|
|
8
|
+
type ProgressTypeInput = ProgressType | LegacyStatusType;
|
|
5
9
|
interface ProgressProps {
|
|
10
|
+
/** 현재 값. max 에 대한 비율로 채워진다 */
|
|
6
11
|
value: number;
|
|
12
|
+
/** 최대값. 기본 100 */
|
|
7
13
|
max?: number;
|
|
14
|
+
/** 막대 두께 */
|
|
8
15
|
size?: ProgressSize;
|
|
9
|
-
|
|
16
|
+
/** 막대 색 */
|
|
17
|
+
type?: ProgressTypeInput;
|
|
18
|
+
/** 오른쪽에 퍼센트 글자를 표시한다 */
|
|
10
19
|
showLabel?: boolean;
|
|
11
20
|
}
|
|
12
21
|
declare const Progress: {
|
|
@@ -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 = "";
|
|
@@ -21,11 +24,12 @@ var Progress = (props) => {
|
|
|
21
24
|
value,
|
|
22
25
|
max = 100,
|
|
23
26
|
size = "md",
|
|
24
|
-
type = "
|
|
27
|
+
type = "primary",
|
|
25
28
|
showLabel = false
|
|
26
29
|
} = props;
|
|
30
|
+
const statusType = normalizeStatus(type);
|
|
27
31
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
28
|
-
return /* @__PURE__ */ jsxs("div", { className: clsx_default("lib-xplat-progress", size,
|
|
32
|
+
return /* @__PURE__ */ jsxs("div", { className: clsx_default("lib-xplat-progress", size, statusType), children: [
|
|
29
33
|
/* @__PURE__ */ jsx(
|
|
30
34
|
"div",
|
|
31
35
|
{
|
|
@@ -35,6 +35,9 @@ __export(Radio_exports, {
|
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(Radio_exports);
|
|
37
37
|
|
|
38
|
+
// src/tokens/interface/status.ts
|
|
39
|
+
var normalizeStatus = (value) => value === "brand" ? "primary" : value;
|
|
40
|
+
|
|
38
41
|
// ../../node_modules/clsx/dist/clsx.mjs
|
|
39
42
|
function r(e) {
|
|
40
43
|
var t, f, n = "";
|
|
@@ -51,6 +54,139 @@ function clsx() {
|
|
|
51
54
|
}
|
|
52
55
|
var clsx_default = clsx;
|
|
53
56
|
|
|
57
|
+
// src/tokens/svg/status/ErrorIcon.tsx
|
|
58
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
59
|
+
var ErrorIcon = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
60
|
+
"svg",
|
|
61
|
+
{
|
|
62
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
63
|
+
width: "1em",
|
|
64
|
+
height: "1em",
|
|
65
|
+
viewBox: "0 0 16 16",
|
|
66
|
+
fill: "none",
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { clipPath: "url(#clip0_1196_9603)", children: [
|
|
69
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
70
|
+
"path",
|
|
71
|
+
{
|
|
72
|
+
d: "M9.57588 5.57559C9.81019 5.34127 10.19 5.34127 10.4243 5.57559C10.6586 5.8099 10.6586 6.18971 10.4243 6.42402L8.84854 7.9998L10.4243 9.57559C10.6586 9.8099 10.6586 10.1897 10.4243 10.424C10.19 10.6583 9.81019 10.6583 9.57588 10.424L8.0001 8.84824L6.42432 10.424C6.19 10.6583 5.81019 10.6583 5.57588 10.424C5.34156 10.1897 5.34156 9.8099 5.57588 9.57559L7.15166 7.9998L5.57588 6.42402C5.34156 6.18971 5.34156 5.8099 5.57588 5.57559C5.81019 5.34127 6.19 5.34127 6.42432 5.57559L8.0001 7.15137L9.57588 5.57559Z",
|
|
73
|
+
fill: "currentColor"
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
77
|
+
"path",
|
|
78
|
+
{
|
|
79
|
+
fillRule: "evenodd",
|
|
80
|
+
clipRule: "evenodd",
|
|
81
|
+
d: "M8.0001 0.733398C12.0131 0.73361 15.2671 3.98679 15.2673 7.9998C15.2672 12.0129 12.0131 15.2668 8.0001 15.267C3.98701 15.2669 0.733016 12.0129 0.73291 7.9998C0.733051 3.98674 3.98704 0.733539 8.0001 0.733398ZM8.0001 1.9334C4.64978 1.93354 1.93383 4.64948 1.93369 7.9998C1.9338 11.3502 4.64975 14.0669 8.0001 14.067C11.3504 14.0668 14.0672 11.3501 14.0673 7.9998C14.0671 4.64953 11.3504 1.93361 8.0001 1.9334Z",
|
|
82
|
+
fill: "currentColor"
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
] }),
|
|
86
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("clipPath", { id: "clip0_1196_9603", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { width: "16", height: "16", fill: "white" }) }) })
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
var ErrorIcon_default = ErrorIcon;
|
|
91
|
+
|
|
92
|
+
// src/tokens/svg/status/InfoIcon.tsx
|
|
93
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
94
|
+
var InfoIcon = () => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
95
|
+
"svg",
|
|
96
|
+
{
|
|
97
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
98
|
+
width: "1em",
|
|
99
|
+
height: "1em",
|
|
100
|
+
viewBox: "0 0 16 16",
|
|
101
|
+
fill: "none",
|
|
102
|
+
children: [
|
|
103
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("g", { clipPath: "url(#clip0_1188_11261)", children: [
|
|
104
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
105
|
+
"path",
|
|
106
|
+
{
|
|
107
|
+
d: "M8.00156 7.39999C8.33293 7.39999 8.60156 7.66862 8.60156 7.99999V10.6664C8.60156 10.9978 8.33293 11.2664 8.00156 11.2664C7.67019 11.2664 7.40156 10.9978 7.40156 10.6664V7.99999C7.40156 7.66862 7.67019 7.39999 8.00156 7.39999Z",
|
|
108
|
+
fill: "currentColor"
|
|
109
|
+
}
|
|
110
|
+
),
|
|
111
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
112
|
+
"path",
|
|
113
|
+
{
|
|
114
|
+
d: "M8.00859 4.73358C8.3398 4.73378 8.60859 5.00233 8.60859 5.33358C8.60849 5.66474 8.33973 5.93338 8.00859 5.93358H8.00156C7.67026 5.93358 7.40167 5.66486 7.40156 5.33358C7.40156 5.00221 7.67019 4.73358 8.00156 4.73358H8.00859Z",
|
|
115
|
+
fill: "currentColor"
|
|
116
|
+
}
|
|
117
|
+
),
|
|
118
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
119
|
+
"path",
|
|
120
|
+
{
|
|
121
|
+
fillRule: "evenodd",
|
|
122
|
+
clipRule: "evenodd",
|
|
123
|
+
d: "M8.00156 0.733582C12.0146 0.733793 15.2686 3.98697 15.2688 7.99999C15.2686 12.013 12.0146 15.267 8.00156 15.2672C3.98848 15.267 0.734481 12.0131 0.734375 7.99999C0.734516 3.98693 3.9885 0.733722 8.00156 0.733582ZM8.00156 1.93358C4.65124 1.93372 1.9353 4.64967 1.93516 7.99999C1.93526 11.3503 4.65122 14.067 8.00156 14.0672C11.3518 14.067 14.0686 11.3503 14.0688 7.99999C14.0686 4.64971 11.3518 1.93379 8.00156 1.93358Z",
|
|
124
|
+
fill: "currentColor"
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
] }),
|
|
128
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("clipPath", { id: "clip0_1188_11261", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("rect", { width: "16", height: "16", fill: "white" }) }) })
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
var InfoIcon_default = InfoIcon;
|
|
133
|
+
|
|
134
|
+
// src/tokens/svg/status/SuccessIcon.tsx
|
|
135
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
136
|
+
var SuccessIcon = () => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
137
|
+
"svg",
|
|
138
|
+
{
|
|
139
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
140
|
+
width: "1em",
|
|
141
|
+
height: "1em",
|
|
142
|
+
viewBox: "0 0 16 16",
|
|
143
|
+
fill: "none",
|
|
144
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
145
|
+
"path",
|
|
146
|
+
{
|
|
147
|
+
d: "M12.9084 3.57597C13.1426 3.34172 13.5225 3.34185 13.7568 3.57597C13.9911 3.81028 13.9911 4.19009 13.7568 4.4244L6.424 11.758C6.31157 11.8703 6.15869 11.9337 5.99978 11.9338C5.8409 11.9337 5.68798 11.8703 5.57556 11.758L2.24197 8.4244C2.00782 8.19018 2.00795 7.81028 2.24197 7.57597C2.47626 7.34167 2.85609 7.34172 3.09041 7.57597L5.999 10.4846L12.9084 3.57597Z",
|
|
148
|
+
fill: "currentColor"
|
|
149
|
+
}
|
|
150
|
+
)
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
var SuccessIcon_default = SuccessIcon;
|
|
154
|
+
|
|
155
|
+
// src/components/FieldMessage/FieldMessage.tsx
|
|
156
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
157
|
+
var ICON = {
|
|
158
|
+
default: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(InfoIcon_default, {}),
|
|
159
|
+
success: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SuccessIcon_default, {}),
|
|
160
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(InfoIcon_default, {}),
|
|
161
|
+
error: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ErrorIcon_default, {})
|
|
162
|
+
};
|
|
163
|
+
var FieldMessage = (props) => {
|
|
164
|
+
const { validations } = props;
|
|
165
|
+
if (!validations || validations.length === 0) return null;
|
|
166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "lib-xplat-field-message-wrap", children: validations.map((v, idx) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
167
|
+
"div",
|
|
168
|
+
{
|
|
169
|
+
className: clsx_default("lib-xplat-field-message", v.status),
|
|
170
|
+
children: [
|
|
171
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "icon", children: ICON[v.status] }),
|
|
172
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: v.message })
|
|
173
|
+
]
|
|
174
|
+
},
|
|
175
|
+
`${v.message}_${idx}`
|
|
176
|
+
)) });
|
|
177
|
+
};
|
|
178
|
+
FieldMessage.displayName = "FieldMessage";
|
|
179
|
+
var Field = (props) => {
|
|
180
|
+
const { validations, children } = props;
|
|
181
|
+
if (!validations || validations.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children });
|
|
182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "lib-xplat-field", children: [
|
|
183
|
+
children,
|
|
184
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(FieldMessage, { validations })
|
|
185
|
+
] });
|
|
186
|
+
};
|
|
187
|
+
Field.displayName = "Field";
|
|
188
|
+
var hasError = (validations) => !!validations?.some((v) => v.status === "error");
|
|
189
|
+
|
|
54
190
|
// src/components/Radio/RadioGroupContext.tsx
|
|
55
191
|
var import_react = __toESM(require("react"), 1);
|
|
56
192
|
var RadioGroupContext = import_react.default.createContext(
|
|
@@ -62,16 +198,18 @@ var useRadioGroupContext = () => {
|
|
|
62
198
|
var RadioGroupContext_default = RadioGroupContext;
|
|
63
199
|
|
|
64
200
|
// src/components/Radio/Radio.tsx
|
|
65
|
-
var
|
|
201
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
66
202
|
var Radio = (props) => {
|
|
67
203
|
const {
|
|
68
204
|
label,
|
|
69
205
|
className,
|
|
70
206
|
value,
|
|
71
207
|
size: sizeProp,
|
|
72
|
-
type = "
|
|
208
|
+
type = "primary",
|
|
209
|
+
validations,
|
|
73
210
|
...rest
|
|
74
211
|
} = props;
|
|
212
|
+
const statusType = normalizeStatus(type);
|
|
75
213
|
const context = useRadioGroupContext();
|
|
76
214
|
const size = sizeProp ?? context?.size ?? "md";
|
|
77
215
|
const isGroup = !!context;
|
|
@@ -81,41 +219,51 @@ var Radio = (props) => {
|
|
|
81
219
|
value,
|
|
82
220
|
onChange: rest.onChange
|
|
83
221
|
};
|
|
84
|
-
|
|
222
|
+
const control = /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
85
223
|
"label",
|
|
86
224
|
{
|
|
87
225
|
className: clsx_default(
|
|
88
226
|
"lib-xplat-radio",
|
|
89
227
|
size,
|
|
90
|
-
|
|
228
|
+
statusType,
|
|
91
229
|
localChecked ? "checked" : void 0,
|
|
92
230
|
className
|
|
93
231
|
),
|
|
94
232
|
children: [
|
|
95
|
-
/* @__PURE__ */ (0,
|
|
96
|
-
|
|
233
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
234
|
+
"input",
|
|
235
|
+
{
|
|
236
|
+
...rest,
|
|
237
|
+
...inputProps,
|
|
238
|
+
checked: localChecked,
|
|
239
|
+
type: "radio",
|
|
240
|
+
"aria-invalid": hasError(validations) || void 0
|
|
241
|
+
}
|
|
242
|
+
),
|
|
243
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
97
244
|
"div",
|
|
98
245
|
{
|
|
99
246
|
className: clsx_default(
|
|
100
247
|
"circle",
|
|
101
248
|
localChecked ? "checked" : void 0
|
|
102
249
|
),
|
|
103
|
-
children: localChecked && /* @__PURE__ */ (0,
|
|
250
|
+
children: localChecked && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "inner-circle" })
|
|
104
251
|
}
|
|
105
252
|
),
|
|
106
|
-
label && /* @__PURE__ */ (0,
|
|
253
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: label })
|
|
107
254
|
]
|
|
108
255
|
}
|
|
109
256
|
);
|
|
257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Field, { validations, children: control });
|
|
110
258
|
};
|
|
111
259
|
Radio.displayName = "Radio";
|
|
112
260
|
var Radio_default = Radio;
|
|
113
261
|
|
|
114
262
|
// src/components/Radio/RadioGroup.tsx
|
|
115
|
-
var
|
|
263
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
116
264
|
var RadioGroup = (props) => {
|
|
117
265
|
const { children, ...rest } = props;
|
|
118
|
-
return /* @__PURE__ */ (0,
|
|
266
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(RadioGroupContext_default.Provider, { value: rest, children }) });
|
|
119
267
|
};
|
|
120
268
|
RadioGroup.displayName = "RadioGroup";
|
|
121
269
|
var RadioGroup_default = RadioGroup;
|
|
@@ -1,3 +1,41 @@
|
|
|
1
|
+
/* src/components/FieldMessage/fieldMessage.scss */
|
|
2
|
+
.lib-xplat-field {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
gap: var(--spacing-space-2);
|
|
6
|
+
}
|
|
7
|
+
.lib-xplat-field-message-wrap {
|
|
8
|
+
display: flex;
|
|
9
|
+
gap: var(--spacing-space-2);
|
|
10
|
+
margin-left: var(--spacing-space-1);
|
|
11
|
+
}
|
|
12
|
+
.lib-xplat-field-message-wrap > .lib-xplat-field-message {
|
|
13
|
+
display: flex;
|
|
14
|
+
gap: var(--spacing-space-1);
|
|
15
|
+
font-family: var(--semantic-typo-caption-2-r-font);
|
|
16
|
+
font-size: var(--semantic-typo-caption-2-r-size);
|
|
17
|
+
line-height: var(--semantic-typo-caption-2-r-lh);
|
|
18
|
+
font-weight: var(--semantic-typo-caption-2-r-weight);
|
|
19
|
+
letter-spacing: var(--semantic-typo-caption-2-r-ls);
|
|
20
|
+
align-items: center;
|
|
21
|
+
user-select: none;
|
|
22
|
+
}
|
|
23
|
+
.lib-xplat-field-message-wrap > .lib-xplat-field-message.default {
|
|
24
|
+
color: var(--semantic-icon-secondary);
|
|
25
|
+
}
|
|
26
|
+
.lib-xplat-field-message-wrap > .lib-xplat-field-message.success {
|
|
27
|
+
color: var(--semantic-text-success);
|
|
28
|
+
}
|
|
29
|
+
.lib-xplat-field-message-wrap > .lib-xplat-field-message.warning {
|
|
30
|
+
color: var(--semantic-text-warning);
|
|
31
|
+
}
|
|
32
|
+
.lib-xplat-field-message-wrap > .lib-xplat-field-message.error {
|
|
33
|
+
color: var(--semantic-text-error);
|
|
34
|
+
}
|
|
35
|
+
.lib-xplat-field-message-wrap > .lib-xplat-field-message > .icon {
|
|
36
|
+
font-size: var(--semantic-typo-label-2-m-size);
|
|
37
|
+
}
|
|
38
|
+
|
|
1
39
|
/* src/components/Radio/radio.scss */
|
|
2
40
|
.lib-xplat-radio {
|
|
3
41
|
display: flex;
|
|
@@ -74,6 +112,7 @@
|
|
|
74
112
|
border-color: var(--semantic-icon-primary);
|
|
75
113
|
background-color: var(--semantic-surface-neutral-secondary);
|
|
76
114
|
}
|
|
115
|
+
.lib-xplat-radio.primary > .circle.checked,
|
|
77
116
|
.lib-xplat-radio.brand > .circle.checked {
|
|
78
117
|
background-color: var(--semantic-surface-brand-default);
|
|
79
118
|
border-color: var(--semantic-surface-brand-default);
|
|
@@ -94,6 +133,7 @@
|
|
|
94
133
|
background-color: var(--semantic-surface-info-default);
|
|
95
134
|
border-color: var(--semantic-surface-info-default);
|
|
96
135
|
}
|
|
136
|
+
.lib-xplat-radio:hover.primary > .circle.checked,
|
|
97
137
|
.lib-xplat-radio:hover.brand > .circle.checked {
|
|
98
138
|
background-color: var(--semantic-surface-brand-strong);
|
|
99
139
|
border-color: var(--semantic-surface-brand-strong);
|
|
@@ -1,9 +1,14 @@
|
|
|
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';
|
|
4
|
+
import { V as Validation } from '../../validation-Dqo1zqhT.cjs';
|
|
3
5
|
import React from 'react';
|
|
4
6
|
|
|
5
7
|
type RadioSize = "sm" | "md" | "lg";
|
|
6
|
-
|
|
8
|
+
/** Radio 의 상태 색 */
|
|
9
|
+
type RadioType = "primary" | "success" | "error" | "warning" | "info";
|
|
10
|
+
/** 입력으로는 예전 이름 `brand` 도 받는다 (= `primary`) */
|
|
11
|
+
type RadioTypeInput = RadioType | LegacyStatusType;
|
|
7
12
|
interface RadioProps extends Omit<InputAttributes, "size"> {
|
|
8
13
|
label?: string;
|
|
9
14
|
/**
|
|
@@ -11,8 +16,12 @@ interface RadioProps extends Omit<InputAttributes, "size"> {
|
|
|
11
16
|
*/
|
|
12
17
|
name?: string;
|
|
13
18
|
value: string | number;
|
|
19
|
+
/** 컨트롤 아래에 표시할 검증 메시지. DS 폼 컴포넌트 공통 */
|
|
20
|
+
validations?: Validation[];
|
|
21
|
+
/** 컨트롤 크기 */
|
|
14
22
|
size?: RadioSize;
|
|
15
|
-
|
|
23
|
+
/** 선택됐을 때의 색 */
|
|
24
|
+
type?: RadioTypeInput;
|
|
16
25
|
}
|
|
17
26
|
/**
|
|
18
27
|
* 그룹모드 check 조건 : RadioGroup value === radio value
|
|
@@ -24,9 +33,12 @@ declare const Radio: {
|
|
|
24
33
|
};
|
|
25
34
|
|
|
26
35
|
interface RadioGroupContextProps {
|
|
36
|
+
/** 이 항목의 값. 그룹의 선택값과 비교된다 */
|
|
27
37
|
value?: string | number;
|
|
38
|
+
/** 같은 name 끼리 한 그룹이 된다. RadioGroup 안에서는 자동으로 채워진다 */
|
|
28
39
|
name: string;
|
|
29
40
|
onChange: React.ChangeEventHandler<HTMLInputElement>;
|
|
41
|
+
/** 컨트롤 크기 */
|
|
30
42
|
size?: "sm" | "md" | "lg";
|
|
31
43
|
}
|
|
32
44
|
|
|
@@ -1,9 +1,14 @@
|
|
|
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';
|
|
4
|
+
import { V as Validation } from '../../validation-Dqo1zqhT.js';
|
|
3
5
|
import React from 'react';
|
|
4
6
|
|
|
5
7
|
type RadioSize = "sm" | "md" | "lg";
|
|
6
|
-
|
|
8
|
+
/** Radio 의 상태 색 */
|
|
9
|
+
type RadioType = "primary" | "success" | "error" | "warning" | "info";
|
|
10
|
+
/** 입력으로는 예전 이름 `brand` 도 받는다 (= `primary`) */
|
|
11
|
+
type RadioTypeInput = RadioType | LegacyStatusType;
|
|
7
12
|
interface RadioProps extends Omit<InputAttributes, "size"> {
|
|
8
13
|
label?: string;
|
|
9
14
|
/**
|
|
@@ -11,8 +16,12 @@ interface RadioProps extends Omit<InputAttributes, "size"> {
|
|
|
11
16
|
*/
|
|
12
17
|
name?: string;
|
|
13
18
|
value: string | number;
|
|
19
|
+
/** 컨트롤 아래에 표시할 검증 메시지. DS 폼 컴포넌트 공통 */
|
|
20
|
+
validations?: Validation[];
|
|
21
|
+
/** 컨트롤 크기 */
|
|
14
22
|
size?: RadioSize;
|
|
15
|
-
|
|
23
|
+
/** 선택됐을 때의 색 */
|
|
24
|
+
type?: RadioTypeInput;
|
|
16
25
|
}
|
|
17
26
|
/**
|
|
18
27
|
* 그룹모드 check 조건 : RadioGroup value === radio value
|
|
@@ -24,9 +33,12 @@ declare const Radio: {
|
|
|
24
33
|
};
|
|
25
34
|
|
|
26
35
|
interface RadioGroupContextProps {
|
|
36
|
+
/** 이 항목의 값. 그룹의 선택값과 비교된다 */
|
|
27
37
|
value?: string | number;
|
|
38
|
+
/** 같은 name 끼리 한 그룹이 된다. RadioGroup 안에서는 자동으로 채워진다 */
|
|
28
39
|
name: string;
|
|
29
40
|
onChange: React.ChangeEventHandler<HTMLInputElement>;
|
|
41
|
+
/** 컨트롤 크기 */
|
|
30
42
|
size?: "sm" | "md" | "lg";
|
|
31
43
|
}
|
|
32
44
|
|