@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
package/dist/index.cjs
CHANGED
|
@@ -7255,7 +7255,8 @@ var ChartLegend = ({ data, labels, type }) => {
|
|
|
7255
7255
|
}) });
|
|
7256
7256
|
};
|
|
7257
7257
|
var Chart = import_react6.default.memo((props) => {
|
|
7258
|
-
const { type, data, labels, tooltip: showTooltip = true, tooltipType = "light" } = props;
|
|
7258
|
+
const { variant, type, data, labels, tooltip: showTooltip = true, tooltipType = "light" } = props;
|
|
7259
|
+
const shape = variant ?? type ?? "line";
|
|
7259
7260
|
const { tooltip, show, hide, move, containerRef } = useChartTooltip(showTooltip);
|
|
7260
7261
|
const { width, height } = useChartSize(containerRef);
|
|
7261
7262
|
const stableData = import_react6.default.useMemo(() => data, [JSON.stringify(data)]);
|
|
@@ -7264,11 +7265,11 @@ var Chart = import_react6.default.memo((props) => {
|
|
|
7264
7265
|
const animate = useChartAnimation(containerRef, dataKey);
|
|
7265
7266
|
const ready = width > 0 && height > 0;
|
|
7266
7267
|
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("div", { className: "lib-xplat-chart", ref: containerRef, children: [
|
|
7267
|
-
ready &&
|
|
7268
|
-
ready &&
|
|
7269
|
-
ready &&
|
|
7270
|
-
ready &&
|
|
7271
|
-
ready &&
|
|
7268
|
+
ready && shape === "line" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(LineChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
7269
|
+
ready && shape === "curve" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(CurveChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
7270
|
+
ready && shape === "bar" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(BarChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
7271
|
+
ready && shape === "pie" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
7272
|
+
ready && shape === "doughnut" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, isDoughnut: true, onHover: show, onMove: move, onLeave: hide }),
|
|
7272
7273
|
ready && (type === "pie" || type === "doughnut") && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(ChartLegend, { data: stableData, labels: stableLabels, type }),
|
|
7273
7274
|
tooltip.visible && tooltip.content && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(ChartTooltip, { x: tooltip.x, y: tooltip.y, containerWidth: width, containerHeight: height, tooltipType, children: tooltip.content })
|
|
7274
7275
|
] });
|
|
@@ -7388,6 +7389,9 @@ var import_tokens_core = require("@x-plat/tokens-core");
|
|
|
7388
7389
|
// src/tokens/index.ts
|
|
7389
7390
|
var import_tokens_core2 = require("@x-plat/tokens-core");
|
|
7390
7391
|
|
|
7392
|
+
// src/tokens/interface/status.ts
|
|
7393
|
+
var normalizeStatus = (value) => value === "brand" ? "primary" : value;
|
|
7394
|
+
|
|
7391
7395
|
// src/components/CheckBox/CheckBox.tsx
|
|
7392
7396
|
var import_jsx_runtime309 = require("react/jsx-runtime");
|
|
7393
7397
|
var CheckBox = (props) => {
|
|
@@ -7398,10 +7402,11 @@ var CheckBox = (props) => {
|
|
|
7398
7402
|
onChange,
|
|
7399
7403
|
disabled,
|
|
7400
7404
|
size = "md",
|
|
7401
|
-
type = "
|
|
7405
|
+
type = "primary",
|
|
7402
7406
|
validations,
|
|
7403
7407
|
...rest
|
|
7404
7408
|
} = props;
|
|
7409
|
+
const statusType = normalizeStatus(type);
|
|
7405
7410
|
const handleChange = (e) => {
|
|
7406
7411
|
if (onChange) onChange(e);
|
|
7407
7412
|
};
|
|
@@ -7409,7 +7414,7 @@ var CheckBox = (props) => {
|
|
|
7409
7414
|
const checkedClasses = `checked`;
|
|
7410
7415
|
const disabledClasses = "disabled";
|
|
7411
7416
|
const boxClasses = disabled ? disabledClasses : checked ? checkedClasses : uncheckedClasses;
|
|
7412
|
-
const control = /* @__PURE__ */ (0, import_jsx_runtime309.jsxs)("label", { className: clsx_default("lib-xplat-checkbox", size,
|
|
7417
|
+
const control = /* @__PURE__ */ (0, import_jsx_runtime309.jsxs)("label", { className: clsx_default("lib-xplat-checkbox", size, statusType, className), children: [
|
|
7413
7418
|
/* @__PURE__ */ (0, import_jsx_runtime309.jsx)(
|
|
7414
7419
|
"input",
|
|
7415
7420
|
{
|
|
@@ -7944,7 +7949,8 @@ var TabItem_default = TabItem;
|
|
|
7944
7949
|
// src/components/Tab/Tab.tsx
|
|
7945
7950
|
var import_jsx_runtime317 = require("react/jsx-runtime");
|
|
7946
7951
|
var Tab = (props) => {
|
|
7947
|
-
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
7952
|
+
const { activeIndex, onChange, tabs, variant, type, size = "md" } = props;
|
|
7953
|
+
const shape = variant ?? type ?? "default";
|
|
7948
7954
|
const [underlineStyle, setUnderlineStyle] = import_react14.default.useState({
|
|
7949
7955
|
left: 0,
|
|
7950
7956
|
width: 0
|
|
@@ -7959,7 +7965,7 @@ var Tab = (props) => {
|
|
|
7959
7965
|
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
7960
7966
|
}
|
|
7961
7967
|
}, [activeIndex, tabs.length]);
|
|
7962
|
-
return /* @__PURE__ */ (0, import_jsx_runtime317.jsxs)("div", { className: clsx_default("lib-xplat-tab", `type-${
|
|
7968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime317.jsxs)("div", { className: clsx_default("lib-xplat-tab", `type-${shape}`, size), children: [
|
|
7963
7969
|
tabs.map((tab, idx) => /* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
|
|
7964
7970
|
TabItem_default,
|
|
7965
7971
|
{
|
|
@@ -7972,7 +7978,7 @@ var Tab = (props) => {
|
|
|
7972
7978
|
},
|
|
7973
7979
|
`${tab.value}_${idx}`
|
|
7974
7980
|
)),
|
|
7975
|
-
|
|
7981
|
+
shape === "toggle" && /* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
|
|
7976
7982
|
"div",
|
|
7977
7983
|
{
|
|
7978
7984
|
className: "tab-toggle-underline",
|
|
@@ -9398,11 +9404,12 @@ var NotificationBadge = (props) => {
|
|
|
9398
9404
|
dot = false,
|
|
9399
9405
|
size = "md"
|
|
9400
9406
|
} = props;
|
|
9407
|
+
const statusType = normalizeStatus(type);
|
|
9401
9408
|
const showBadge = dot || count !== void 0 && count > 0;
|
|
9402
9409
|
const displayCount = count !== void 0 && count > maxCount ? `${maxCount}+` : count;
|
|
9403
9410
|
return /* @__PURE__ */ (0, import_jsx_runtime330.jsxs)("div", { className: clsx_default("lib-xplat-notification-badge", size), children: [
|
|
9404
9411
|
children,
|
|
9405
|
-
showBadge && /* @__PURE__ */ (0, import_jsx_runtime330.jsx)("span", { className: clsx_default("badge-indicator",
|
|
9412
|
+
showBadge && /* @__PURE__ */ (0, import_jsx_runtime330.jsx)("span", { className: clsx_default("badge-indicator", statusType, { dot }), children: !dot && displayCount })
|
|
9406
9413
|
] });
|
|
9407
9414
|
};
|
|
9408
9415
|
NotificationBadge.displayName = "NotificationBadge";
|
|
@@ -9443,8 +9450,9 @@ var Pagination = (props) => {
|
|
|
9443
9450
|
siblingCount = 1,
|
|
9444
9451
|
onChange,
|
|
9445
9452
|
size = "md",
|
|
9446
|
-
type = "
|
|
9453
|
+
type = "primary"
|
|
9447
9454
|
} = props;
|
|
9455
|
+
const statusType = normalizeStatus(type);
|
|
9448
9456
|
const totalPages = Math.max(1, Math.ceil(total / pageSize));
|
|
9449
9457
|
const pages = getPageRange(current, totalPages, siblingCount);
|
|
9450
9458
|
const handleClick = (page) => {
|
|
@@ -9452,7 +9460,7 @@ var Pagination = (props) => {
|
|
|
9452
9460
|
onChange?.(page);
|
|
9453
9461
|
}
|
|
9454
9462
|
};
|
|
9455
|
-
return /* @__PURE__ */ (0, import_jsx_runtime331.jsxs)("nav", { className: clsx_default("lib-xplat-pagination", size,
|
|
9463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime331.jsxs)("nav", { className: clsx_default("lib-xplat-pagination", size, statusType), "aria-label": "\uD398\uC774\uC9C0 \uB124\uBE44\uAC8C\uC774\uC158", children: [
|
|
9456
9464
|
/* @__PURE__ */ (0, import_jsx_runtime331.jsx)(
|
|
9457
9465
|
"button",
|
|
9458
9466
|
{
|
|
@@ -9553,11 +9561,12 @@ var Progress = (props) => {
|
|
|
9553
9561
|
value,
|
|
9554
9562
|
max = 100,
|
|
9555
9563
|
size = "md",
|
|
9556
|
-
type = "
|
|
9564
|
+
type = "primary",
|
|
9557
9565
|
showLabel = false
|
|
9558
9566
|
} = props;
|
|
9567
|
+
const statusType = normalizeStatus(type);
|
|
9559
9568
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
9560
|
-
return /* @__PURE__ */ (0, import_jsx_runtime333.jsxs)("div", { className: clsx_default("lib-xplat-progress", size,
|
|
9569
|
+
return /* @__PURE__ */ (0, import_jsx_runtime333.jsxs)("div", { className: clsx_default("lib-xplat-progress", size, statusType), children: [
|
|
9561
9570
|
/* @__PURE__ */ (0, import_jsx_runtime333.jsx)(
|
|
9562
9571
|
"div",
|
|
9563
9572
|
{
|
|
@@ -9602,10 +9611,11 @@ var Radio = (props) => {
|
|
|
9602
9611
|
className,
|
|
9603
9612
|
value,
|
|
9604
9613
|
size: sizeProp,
|
|
9605
|
-
type = "
|
|
9614
|
+
type = "primary",
|
|
9606
9615
|
validations,
|
|
9607
9616
|
...rest
|
|
9608
9617
|
} = props;
|
|
9618
|
+
const statusType = normalizeStatus(type);
|
|
9609
9619
|
const context = useRadioGroupContext();
|
|
9610
9620
|
const size = sizeProp ?? context?.size ?? "md";
|
|
9611
9621
|
const isGroup = !!context;
|
|
@@ -9621,7 +9631,7 @@ var Radio = (props) => {
|
|
|
9621
9631
|
className: clsx_default(
|
|
9622
9632
|
"lib-xplat-radio",
|
|
9623
9633
|
size,
|
|
9624
|
-
|
|
9634
|
+
statusType,
|
|
9625
9635
|
localChecked ? "checked" : void 0,
|
|
9626
9636
|
className
|
|
9627
9637
|
),
|
|
@@ -9900,12 +9910,13 @@ var import_jsx_runtime339 = require("react/jsx-runtime");
|
|
|
9900
9910
|
var Spinner = (props) => {
|
|
9901
9911
|
const {
|
|
9902
9912
|
size = "md",
|
|
9903
|
-
type = "
|
|
9913
|
+
type = "primary"
|
|
9904
9914
|
} = props;
|
|
9915
|
+
const statusType = normalizeStatus(type);
|
|
9905
9916
|
return /* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
|
|
9906
9917
|
"div",
|
|
9907
9918
|
{
|
|
9908
|
-
className: clsx_default("lib-xplat-spinner", size,
|
|
9919
|
+
className: clsx_default("lib-xplat-spinner", size, statusType),
|
|
9909
9920
|
role: "status",
|
|
9910
9921
|
"aria-label": "\uB85C\uB529 \uC911",
|
|
9911
9922
|
children: /* @__PURE__ */ (0, import_jsx_runtime339.jsxs)("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
@@ -9943,9 +9954,10 @@ var Steps = (props) => {
|
|
|
9943
9954
|
const {
|
|
9944
9955
|
items,
|
|
9945
9956
|
current,
|
|
9946
|
-
type = "
|
|
9957
|
+
type = "primary"
|
|
9947
9958
|
} = props;
|
|
9948
|
-
|
|
9959
|
+
const statusType = normalizeStatus(type);
|
|
9960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime340.jsx)("div", { className: clsx_default("lib-xplat-steps", statusType), children: items.map((item, index) => {
|
|
9949
9961
|
const status = index < current ? "completed" : index === current ? "active" : "pending";
|
|
9950
9962
|
return /* @__PURE__ */ (0, import_jsx_runtime340.jsxs)("div", { className: clsx_default("step-item", status), children: [
|
|
9951
9963
|
/* @__PURE__ */ (0, import_jsx_runtime340.jsx)("div", { className: "step-circle", children: status === "completed" ? /* @__PURE__ */ (0, import_jsx_runtime340.jsx)(CheckIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime340.jsx)("span", { children: index + 1 }) }),
|
|
@@ -10270,11 +10282,12 @@ var Switch = (props) => {
|
|
|
10270
10282
|
const {
|
|
10271
10283
|
value,
|
|
10272
10284
|
size = "md",
|
|
10273
|
-
type = "
|
|
10285
|
+
type = "primary",
|
|
10274
10286
|
disabled,
|
|
10275
10287
|
onChange,
|
|
10276
10288
|
validations
|
|
10277
10289
|
} = props;
|
|
10290
|
+
const statusType = normalizeStatus(type);
|
|
10278
10291
|
const [isAnimating, setIsAnimating] = import_react32.default.useState(false);
|
|
10279
10292
|
const timeoutRef = import_react32.default.useRef(null);
|
|
10280
10293
|
import_react32.default.useEffect(() => {
|
|
@@ -10298,7 +10311,7 @@ var Switch = (props) => {
|
|
|
10298
10311
|
className: clsx_default(
|
|
10299
10312
|
"lib-xplat-switch",
|
|
10300
10313
|
size,
|
|
10301
|
-
|
|
10314
|
+
statusType,
|
|
10302
10315
|
value ? "checked" : void 0,
|
|
10303
10316
|
disabled && "disabled",
|
|
10304
10317
|
isAnimating && "animating"
|
|
@@ -10515,20 +10528,22 @@ var import_jsx_runtime348 = require("react/jsx-runtime");
|
|
|
10515
10528
|
var Tag = (props) => {
|
|
10516
10529
|
const {
|
|
10517
10530
|
children,
|
|
10518
|
-
|
|
10531
|
+
variant,
|
|
10532
|
+
type,
|
|
10519
10533
|
onClose,
|
|
10520
10534
|
size = "md",
|
|
10521
10535
|
disabled = false,
|
|
10522
10536
|
colorIndex
|
|
10523
10537
|
} = props;
|
|
10538
|
+
const shape = variant ?? type ?? "neutral";
|
|
10524
10539
|
return /* @__PURE__ */ (0, import_jsx_runtime348.jsxs)(
|
|
10525
10540
|
"span",
|
|
10526
10541
|
{
|
|
10527
10542
|
className: clsx_default(
|
|
10528
10543
|
"lib-xplat-tag",
|
|
10529
|
-
|
|
10544
|
+
shape,
|
|
10530
10545
|
size,
|
|
10531
|
-
|
|
10546
|
+
shape === "categorical" && colorIndex !== void 0 && `cat-${colorIndex}`,
|
|
10532
10547
|
disabled && "disabled"
|
|
10533
10548
|
),
|
|
10534
10549
|
children: [
|
|
@@ -10675,10 +10690,12 @@ var Tooltip = (props) => {
|
|
|
10675
10690
|
children,
|
|
10676
10691
|
title,
|
|
10677
10692
|
description,
|
|
10678
|
-
|
|
10693
|
+
variant,
|
|
10694
|
+
type,
|
|
10679
10695
|
follow = false,
|
|
10680
10696
|
disabled = false
|
|
10681
10697
|
} = props;
|
|
10698
|
+
const shape = variant ?? type ?? "dark";
|
|
10682
10699
|
const triggerRef = import_react40.default.useRef(null);
|
|
10683
10700
|
const tooltipRef = import_react40.default.useRef(null);
|
|
10684
10701
|
const [visible, setVisible] = import_react40.default.useState(false);
|
|
@@ -10788,7 +10805,7 @@ var Tooltip = (props) => {
|
|
|
10788
10805
|
{
|
|
10789
10806
|
ref: tooltipRef,
|
|
10790
10807
|
role: "tooltip",
|
|
10791
|
-
className: clsx_default("lib-xplat-tooltip",
|
|
10808
|
+
className: clsx_default("lib-xplat-tooltip", shape),
|
|
10792
10809
|
style: { position: "fixed", left: pos.left, top: pos.top },
|
|
10793
10810
|
children: [
|
|
10794
10811
|
title && /* @__PURE__ */ (0, import_jsx_runtime351.jsx)("div", { className: "tooltip-title", children: title }),
|
package/dist/index.css
CHANGED
|
@@ -2545,6 +2545,7 @@
|
|
|
2545
2545
|
.lib-xplat-checkbox:hover > .checkbox.unchecked {
|
|
2546
2546
|
background-color: var(--semantic-surface-neutral-disabled);
|
|
2547
2547
|
}
|
|
2548
|
+
.lib-xplat-checkbox.primary > .checkbox.checked,
|
|
2548
2549
|
.lib-xplat-checkbox.brand > .checkbox.checked {
|
|
2549
2550
|
background-color: var(--semantic-surface-brand-default);
|
|
2550
2551
|
}
|
|
@@ -2560,6 +2561,7 @@
|
|
|
2560
2561
|
.lib-xplat-checkbox.info > .checkbox.checked {
|
|
2561
2562
|
background-color: var(--semantic-surface-info-default);
|
|
2562
2563
|
}
|
|
2564
|
+
.lib-xplat-checkbox:hover.primary > .checkbox.checked,
|
|
2563
2565
|
.lib-xplat-checkbox:hover.brand > .checkbox.checked {
|
|
2564
2566
|
background-color: var(--semantic-surface-brand-strong);
|
|
2565
2567
|
}
|
|
@@ -3912,6 +3914,7 @@
|
|
|
3912
3914
|
.lib-xplat-notification-badge .badge-indicator.info {
|
|
3913
3915
|
background-color: var(--semantic-surface-info-default);
|
|
3914
3916
|
}
|
|
3917
|
+
.lib-xplat-notification-badge .badge-indicator.primary,
|
|
3915
3918
|
.lib-xplat-notification-badge .badge-indicator.brand {
|
|
3916
3919
|
background-color: var(--semantic-surface-brand-default);
|
|
3917
3920
|
}
|
|
@@ -4011,6 +4014,7 @@
|
|
|
4011
4014
|
.lib-xplat-pagination .page-btn svg {
|
|
4012
4015
|
font-size: var(--semantic-typo-label-2-m-size);
|
|
4013
4016
|
}
|
|
4017
|
+
.lib-xplat-pagination.primary .page-btn.active,
|
|
4014
4018
|
.lib-xplat-pagination.brand .page-btn.active {
|
|
4015
4019
|
background-color: var(--semantic-surface-brand-default);
|
|
4016
4020
|
}
|
|
@@ -4084,6 +4088,7 @@
|
|
|
4084
4088
|
border-radius: var(--spacing-radius-full);
|
|
4085
4089
|
transition: width 0.3s ease;
|
|
4086
4090
|
}
|
|
4091
|
+
.lib-xplat-progress.primary .bar,
|
|
4087
4092
|
.lib-xplat-progress.brand .bar {
|
|
4088
4093
|
background-color: var(--semantic-surface-brand-default);
|
|
4089
4094
|
}
|
|
@@ -4186,6 +4191,7 @@
|
|
|
4186
4191
|
border-color: var(--semantic-icon-primary);
|
|
4187
4192
|
background-color: var(--semantic-surface-neutral-secondary);
|
|
4188
4193
|
}
|
|
4194
|
+
.lib-xplat-radio.primary > .circle.checked,
|
|
4189
4195
|
.lib-xplat-radio.brand > .circle.checked {
|
|
4190
4196
|
background-color: var(--semantic-surface-brand-default);
|
|
4191
4197
|
border-color: var(--semantic-surface-brand-default);
|
|
@@ -4206,6 +4212,7 @@
|
|
|
4206
4212
|
background-color: var(--semantic-surface-info-default);
|
|
4207
4213
|
border-color: var(--semantic-surface-info-default);
|
|
4208
4214
|
}
|
|
4215
|
+
.lib-xplat-radio:hover.primary > .circle.checked,
|
|
4209
4216
|
.lib-xplat-radio:hover.brand > .circle.checked {
|
|
4210
4217
|
background-color: var(--semantic-surface-brand-strong);
|
|
4211
4218
|
border-color: var(--semantic-surface-brand-strong);
|
|
@@ -4472,6 +4479,7 @@
|
|
|
4472
4479
|
stroke-dasharray: 42;
|
|
4473
4480
|
stroke-dashoffset: 28;
|
|
4474
4481
|
}
|
|
4482
|
+
.lib-xplat-spinner.primary .indicator,
|
|
4475
4483
|
.lib-xplat-spinner.brand .indicator {
|
|
4476
4484
|
stroke: var(--semantic-surface-brand-default);
|
|
4477
4485
|
}
|
|
@@ -4561,6 +4569,17 @@
|
|
|
4561
4569
|
color: var(--semantic-text-tertiary);
|
|
4562
4570
|
margin-top: 2px;
|
|
4563
4571
|
}
|
|
4572
|
+
.lib-xplat-steps.primary .step-item.completed .step-circle {
|
|
4573
|
+
color: var(--semantic-text-inverse);
|
|
4574
|
+
background-color: var(--semantic-surface-primary-default);
|
|
4575
|
+
}
|
|
4576
|
+
.lib-xplat-steps.primary .step-item.completed::after {
|
|
4577
|
+
background-color: var(--semantic-surface-primary-default);
|
|
4578
|
+
}
|
|
4579
|
+
.lib-xplat-steps.primary .step-item.active .step-circle {
|
|
4580
|
+
color: var(--semantic-text-inverse);
|
|
4581
|
+
background-color: var(--semantic-surface-primary-default);
|
|
4582
|
+
}
|
|
4564
4583
|
.lib-xplat-steps.brand .step-item.completed .step-circle {
|
|
4565
4584
|
color: var(--semantic-text-inverse);
|
|
4566
4585
|
background-color: var(--semantic-surface-brand-default);
|
|
@@ -4757,10 +4776,12 @@
|
|
|
4757
4776
|
pointer-events: none;
|
|
4758
4777
|
cursor: wait;
|
|
4759
4778
|
}
|
|
4779
|
+
.lib-xplat-switch.primary.checked,
|
|
4760
4780
|
.lib-xplat-switch.brand.checked {
|
|
4761
4781
|
background-color: var(--semantic-surface-brand-default);
|
|
4762
4782
|
border-color: var(--semantic-surface-brand-default);
|
|
4763
4783
|
}
|
|
4784
|
+
.lib-xplat-switch.primary.checked:hover:not(.disabled):not(.animating),
|
|
4764
4785
|
.lib-xplat-switch.brand.checked:hover:not(.disabled):not(.animating) {
|
|
4765
4786
|
background-color: var(--semantic-surface-brand-strong);
|
|
4766
4787
|
border-color: var(--semantic-surface-brand-strong);
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -6848,7 +6848,8 @@ var ChartLegend = ({ data, labels, type }) => {
|
|
|
6848
6848
|
}) });
|
|
6849
6849
|
};
|
|
6850
6850
|
var Chart = React6.memo((props) => {
|
|
6851
|
-
const { type, data, labels, tooltip: showTooltip = true, tooltipType = "light" } = props;
|
|
6851
|
+
const { variant, type, data, labels, tooltip: showTooltip = true, tooltipType = "light" } = props;
|
|
6852
|
+
const shape = variant ?? type ?? "line";
|
|
6852
6853
|
const { tooltip, show, hide, move, containerRef } = useChartTooltip(showTooltip);
|
|
6853
6854
|
const { width, height } = useChartSize(containerRef);
|
|
6854
6855
|
const stableData = React6.useMemo(() => data, [JSON.stringify(data)]);
|
|
@@ -6857,11 +6858,11 @@ var Chart = React6.memo((props) => {
|
|
|
6857
6858
|
const animate = useChartAnimation(containerRef, dataKey);
|
|
6858
6859
|
const ready = width > 0 && height > 0;
|
|
6859
6860
|
return /* @__PURE__ */ jsxs196("div", { className: "lib-xplat-chart", ref: containerRef, children: [
|
|
6860
|
-
ready &&
|
|
6861
|
-
ready &&
|
|
6862
|
-
ready &&
|
|
6863
|
-
ready &&
|
|
6864
|
-
ready &&
|
|
6861
|
+
ready && shape === "line" && /* @__PURE__ */ jsx306(LineChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
6862
|
+
ready && shape === "curve" && /* @__PURE__ */ jsx306(CurveChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
6863
|
+
ready && shape === "bar" && /* @__PURE__ */ jsx306(BarChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
6864
|
+
ready && shape === "pie" && /* @__PURE__ */ jsx306(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
6865
|
+
ready && shape === "doughnut" && /* @__PURE__ */ jsx306(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, isDoughnut: true, onHover: show, onMove: move, onLeave: hide }),
|
|
6865
6866
|
ready && (type === "pie" || type === "doughnut") && /* @__PURE__ */ jsx306(ChartLegend, { data: stableData, labels: stableLabels, type }),
|
|
6866
6867
|
tooltip.visible && tooltip.content && /* @__PURE__ */ jsx306(ChartTooltip, { x: tooltip.x, y: tooltip.y, containerWidth: width, containerHeight: height, tooltipType, children: tooltip.content })
|
|
6867
6868
|
] });
|
|
@@ -6981,6 +6982,9 @@ import { semantic } from "@x-plat/tokens-core";
|
|
|
6981
6982
|
// src/tokens/index.ts
|
|
6982
6983
|
import { cssVar } from "@x-plat/tokens-core";
|
|
6983
6984
|
|
|
6985
|
+
// src/tokens/interface/status.ts
|
|
6986
|
+
var normalizeStatus = (value) => value === "brand" ? "primary" : value;
|
|
6987
|
+
|
|
6984
6988
|
// src/components/CheckBox/CheckBox.tsx
|
|
6985
6989
|
import { jsx as jsx309, jsxs as jsxs198 } from "react/jsx-runtime";
|
|
6986
6990
|
var CheckBox = (props) => {
|
|
@@ -6991,10 +6995,11 @@ var CheckBox = (props) => {
|
|
|
6991
6995
|
onChange,
|
|
6992
6996
|
disabled,
|
|
6993
6997
|
size = "md",
|
|
6994
|
-
type = "
|
|
6998
|
+
type = "primary",
|
|
6995
6999
|
validations,
|
|
6996
7000
|
...rest
|
|
6997
7001
|
} = props;
|
|
7002
|
+
const statusType = normalizeStatus(type);
|
|
6998
7003
|
const handleChange = (e) => {
|
|
6999
7004
|
if (onChange) onChange(e);
|
|
7000
7005
|
};
|
|
@@ -7002,7 +7007,7 @@ var CheckBox = (props) => {
|
|
|
7002
7007
|
const checkedClasses = `checked`;
|
|
7003
7008
|
const disabledClasses = "disabled";
|
|
7004
7009
|
const boxClasses = disabled ? disabledClasses : checked ? checkedClasses : uncheckedClasses;
|
|
7005
|
-
const control = /* @__PURE__ */ jsxs198("label", { className: clsx_default("lib-xplat-checkbox", size,
|
|
7010
|
+
const control = /* @__PURE__ */ jsxs198("label", { className: clsx_default("lib-xplat-checkbox", size, statusType, className), children: [
|
|
7006
7011
|
/* @__PURE__ */ jsx309(
|
|
7007
7012
|
"input",
|
|
7008
7013
|
{
|
|
@@ -7537,7 +7542,8 @@ var TabItem_default = TabItem;
|
|
|
7537
7542
|
// src/components/Tab/Tab.tsx
|
|
7538
7543
|
import { jsx as jsx317, jsxs as jsxs202 } from "react/jsx-runtime";
|
|
7539
7544
|
var Tab = (props) => {
|
|
7540
|
-
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
7545
|
+
const { activeIndex, onChange, tabs, variant, type, size = "md" } = props;
|
|
7546
|
+
const shape = variant ?? type ?? "default";
|
|
7541
7547
|
const [underlineStyle, setUnderlineStyle] = React14.useState({
|
|
7542
7548
|
left: 0,
|
|
7543
7549
|
width: 0
|
|
@@ -7552,7 +7558,7 @@ var Tab = (props) => {
|
|
|
7552
7558
|
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
7553
7559
|
}
|
|
7554
7560
|
}, [activeIndex, tabs.length]);
|
|
7555
|
-
return /* @__PURE__ */ jsxs202("div", { className: clsx_default("lib-xplat-tab", `type-${
|
|
7561
|
+
return /* @__PURE__ */ jsxs202("div", { className: clsx_default("lib-xplat-tab", `type-${shape}`, size), children: [
|
|
7556
7562
|
tabs.map((tab, idx) => /* @__PURE__ */ jsx317(
|
|
7557
7563
|
TabItem_default,
|
|
7558
7564
|
{
|
|
@@ -7565,7 +7571,7 @@ var Tab = (props) => {
|
|
|
7565
7571
|
},
|
|
7566
7572
|
`${tab.value}_${idx}`
|
|
7567
7573
|
)),
|
|
7568
|
-
|
|
7574
|
+
shape === "toggle" && /* @__PURE__ */ jsx317(
|
|
7569
7575
|
"div",
|
|
7570
7576
|
{
|
|
7571
7577
|
className: "tab-toggle-underline",
|
|
@@ -8991,11 +8997,12 @@ var NotificationBadge = (props) => {
|
|
|
8991
8997
|
dot = false,
|
|
8992
8998
|
size = "md"
|
|
8993
8999
|
} = props;
|
|
9000
|
+
const statusType = normalizeStatus(type);
|
|
8994
9001
|
const showBadge = dot || count !== void 0 && count > 0;
|
|
8995
9002
|
const displayCount = count !== void 0 && count > maxCount ? `${maxCount}+` : count;
|
|
8996
9003
|
return /* @__PURE__ */ jsxs211("div", { className: clsx_default("lib-xplat-notification-badge", size), children: [
|
|
8997
9004
|
children,
|
|
8998
|
-
showBadge && /* @__PURE__ */ jsx330("span", { className: clsx_default("badge-indicator",
|
|
9005
|
+
showBadge && /* @__PURE__ */ jsx330("span", { className: clsx_default("badge-indicator", statusType, { dot }), children: !dot && displayCount })
|
|
8999
9006
|
] });
|
|
9000
9007
|
};
|
|
9001
9008
|
NotificationBadge.displayName = "NotificationBadge";
|
|
@@ -9036,8 +9043,9 @@ var Pagination = (props) => {
|
|
|
9036
9043
|
siblingCount = 1,
|
|
9037
9044
|
onChange,
|
|
9038
9045
|
size = "md",
|
|
9039
|
-
type = "
|
|
9046
|
+
type = "primary"
|
|
9040
9047
|
} = props;
|
|
9048
|
+
const statusType = normalizeStatus(type);
|
|
9041
9049
|
const totalPages = Math.max(1, Math.ceil(total / pageSize));
|
|
9042
9050
|
const pages = getPageRange(current, totalPages, siblingCount);
|
|
9043
9051
|
const handleClick = (page) => {
|
|
@@ -9045,7 +9053,7 @@ var Pagination = (props) => {
|
|
|
9045
9053
|
onChange?.(page);
|
|
9046
9054
|
}
|
|
9047
9055
|
};
|
|
9048
|
-
return /* @__PURE__ */ jsxs212("nav", { className: clsx_default("lib-xplat-pagination", size,
|
|
9056
|
+
return /* @__PURE__ */ jsxs212("nav", { className: clsx_default("lib-xplat-pagination", size, statusType), "aria-label": "\uD398\uC774\uC9C0 \uB124\uBE44\uAC8C\uC774\uC158", children: [
|
|
9049
9057
|
/* @__PURE__ */ jsx331(
|
|
9050
9058
|
"button",
|
|
9051
9059
|
{
|
|
@@ -9146,11 +9154,12 @@ var Progress = (props) => {
|
|
|
9146
9154
|
value,
|
|
9147
9155
|
max = 100,
|
|
9148
9156
|
size = "md",
|
|
9149
|
-
type = "
|
|
9157
|
+
type = "primary",
|
|
9150
9158
|
showLabel = false
|
|
9151
9159
|
} = props;
|
|
9160
|
+
const statusType = normalizeStatus(type);
|
|
9152
9161
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
9153
|
-
return /* @__PURE__ */ jsxs214("div", { className: clsx_default("lib-xplat-progress", size,
|
|
9162
|
+
return /* @__PURE__ */ jsxs214("div", { className: clsx_default("lib-xplat-progress", size, statusType), children: [
|
|
9154
9163
|
/* @__PURE__ */ jsx333(
|
|
9155
9164
|
"div",
|
|
9156
9165
|
{
|
|
@@ -9195,10 +9204,11 @@ var Radio = (props) => {
|
|
|
9195
9204
|
className,
|
|
9196
9205
|
value,
|
|
9197
9206
|
size: sizeProp,
|
|
9198
|
-
type = "
|
|
9207
|
+
type = "primary",
|
|
9199
9208
|
validations,
|
|
9200
9209
|
...rest
|
|
9201
9210
|
} = props;
|
|
9211
|
+
const statusType = normalizeStatus(type);
|
|
9202
9212
|
const context = useRadioGroupContext();
|
|
9203
9213
|
const size = sizeProp ?? context?.size ?? "md";
|
|
9204
9214
|
const isGroup = !!context;
|
|
@@ -9214,7 +9224,7 @@ var Radio = (props) => {
|
|
|
9214
9224
|
className: clsx_default(
|
|
9215
9225
|
"lib-xplat-radio",
|
|
9216
9226
|
size,
|
|
9217
|
-
|
|
9227
|
+
statusType,
|
|
9218
9228
|
localChecked ? "checked" : void 0,
|
|
9219
9229
|
className
|
|
9220
9230
|
),
|
|
@@ -9493,12 +9503,13 @@ import { jsx as jsx339, jsxs as jsxs217 } from "react/jsx-runtime";
|
|
|
9493
9503
|
var Spinner = (props) => {
|
|
9494
9504
|
const {
|
|
9495
9505
|
size = "md",
|
|
9496
|
-
type = "
|
|
9506
|
+
type = "primary"
|
|
9497
9507
|
} = props;
|
|
9508
|
+
const statusType = normalizeStatus(type);
|
|
9498
9509
|
return /* @__PURE__ */ jsx339(
|
|
9499
9510
|
"div",
|
|
9500
9511
|
{
|
|
9501
|
-
className: clsx_default("lib-xplat-spinner", size,
|
|
9512
|
+
className: clsx_default("lib-xplat-spinner", size, statusType),
|
|
9502
9513
|
role: "status",
|
|
9503
9514
|
"aria-label": "\uB85C\uB529 \uC911",
|
|
9504
9515
|
children: /* @__PURE__ */ jsxs217("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
@@ -9536,9 +9547,10 @@ var Steps = (props) => {
|
|
|
9536
9547
|
const {
|
|
9537
9548
|
items,
|
|
9538
9549
|
current,
|
|
9539
|
-
type = "
|
|
9550
|
+
type = "primary"
|
|
9540
9551
|
} = props;
|
|
9541
|
-
|
|
9552
|
+
const statusType = normalizeStatus(type);
|
|
9553
|
+
return /* @__PURE__ */ jsx340("div", { className: clsx_default("lib-xplat-steps", statusType), children: items.map((item, index) => {
|
|
9542
9554
|
const status = index < current ? "completed" : index === current ? "active" : "pending";
|
|
9543
9555
|
return /* @__PURE__ */ jsxs218("div", { className: clsx_default("step-item", status), children: [
|
|
9544
9556
|
/* @__PURE__ */ jsx340("div", { className: "step-circle", children: status === "completed" ? /* @__PURE__ */ jsx340(CheckIcon_default, {}) : /* @__PURE__ */ jsx340("span", { children: index + 1 }) }),
|
|
@@ -9863,11 +9875,12 @@ var Switch = (props) => {
|
|
|
9863
9875
|
const {
|
|
9864
9876
|
value,
|
|
9865
9877
|
size = "md",
|
|
9866
|
-
type = "
|
|
9878
|
+
type = "primary",
|
|
9867
9879
|
disabled,
|
|
9868
9880
|
onChange,
|
|
9869
9881
|
validations
|
|
9870
9882
|
} = props;
|
|
9883
|
+
const statusType = normalizeStatus(type);
|
|
9871
9884
|
const [isAnimating, setIsAnimating] = React32.useState(false);
|
|
9872
9885
|
const timeoutRef = React32.useRef(null);
|
|
9873
9886
|
React32.useEffect(() => {
|
|
@@ -9891,7 +9904,7 @@ var Switch = (props) => {
|
|
|
9891
9904
|
className: clsx_default(
|
|
9892
9905
|
"lib-xplat-switch",
|
|
9893
9906
|
size,
|
|
9894
|
-
|
|
9907
|
+
statusType,
|
|
9895
9908
|
value ? "checked" : void 0,
|
|
9896
9909
|
disabled && "disabled",
|
|
9897
9910
|
isAnimating && "animating"
|
|
@@ -10108,20 +10121,22 @@ import { jsx as jsx348, jsxs as jsxs220 } from "react/jsx-runtime";
|
|
|
10108
10121
|
var Tag = (props) => {
|
|
10109
10122
|
const {
|
|
10110
10123
|
children,
|
|
10111
|
-
|
|
10124
|
+
variant,
|
|
10125
|
+
type,
|
|
10112
10126
|
onClose,
|
|
10113
10127
|
size = "md",
|
|
10114
10128
|
disabled = false,
|
|
10115
10129
|
colorIndex
|
|
10116
10130
|
} = props;
|
|
10131
|
+
const shape = variant ?? type ?? "neutral";
|
|
10117
10132
|
return /* @__PURE__ */ jsxs220(
|
|
10118
10133
|
"span",
|
|
10119
10134
|
{
|
|
10120
10135
|
className: clsx_default(
|
|
10121
10136
|
"lib-xplat-tag",
|
|
10122
|
-
|
|
10137
|
+
shape,
|
|
10123
10138
|
size,
|
|
10124
|
-
|
|
10139
|
+
shape === "categorical" && colorIndex !== void 0 && `cat-${colorIndex}`,
|
|
10125
10140
|
disabled && "disabled"
|
|
10126
10141
|
),
|
|
10127
10142
|
children: [
|
|
@@ -10268,10 +10283,12 @@ var Tooltip = (props) => {
|
|
|
10268
10283
|
children,
|
|
10269
10284
|
title,
|
|
10270
10285
|
description,
|
|
10271
|
-
|
|
10286
|
+
variant,
|
|
10287
|
+
type,
|
|
10272
10288
|
follow = false,
|
|
10273
10289
|
disabled = false
|
|
10274
10290
|
} = props;
|
|
10291
|
+
const shape = variant ?? type ?? "dark";
|
|
10275
10292
|
const triggerRef = React40.useRef(null);
|
|
10276
10293
|
const tooltipRef = React40.useRef(null);
|
|
10277
10294
|
const [visible, setVisible] = React40.useState(false);
|
|
@@ -10381,7 +10398,7 @@ var Tooltip = (props) => {
|
|
|
10381
10398
|
{
|
|
10382
10399
|
ref: tooltipRef,
|
|
10383
10400
|
role: "tooltip",
|
|
10384
|
-
className: clsx_default("lib-xplat-tooltip",
|
|
10401
|
+
className: clsx_default("lib-xplat-tooltip", shape),
|
|
10385
10402
|
style: { position: "fixed", left: pos.left, top: pos.top },
|
|
10386
10403
|
children: [
|
|
10387
10404
|
title && /* @__PURE__ */ jsx351("div", { className: "tooltip-title", children: title }),
|
|
@@ -600,6 +600,21 @@ CSS 변수 `--semantic-{category}-{role}` 사용.
|
|
|
600
600
|
| 미디어 | `Video`, `FileUpload`, `ImageSelector`, `Swiper` |
|
|
601
601
|
| 기타 | `Accordion`, `Chart`, `HtmlTypeWriter` |
|
|
602
602
|
|
|
603
|
+
### prop 규약 — `type` 과 `variant` 는 다른 축이다
|
|
604
|
+
|
|
605
|
+
| prop | 뜻 | 값 |
|
|
606
|
+
|---|---|---|
|
|
607
|
+
| `type` | **상태 색** — 이 요소가 어떤 상태인가 | `primary` `success` `error` `warning` `info` |
|
|
608
|
+
| `variant` | **모양·동작 변형** — 어떻게 생겼는가 | 컴포넌트마다 다름 (`outlined`/`toggle`/`dark` 등) |
|
|
609
|
+
|
|
610
|
+
- 상태 색의 `primary` 는 예전에 `brand` 였다. **`brand` 도 계속 받지만 새 코드는 `primary`** 를 쓴다.
|
|
611
|
+
- `Chart`·`Tab`·`Tooltip`·`Tag` 는 모양 변형을 예전에 `type` 으로 받았다. **`variant` 로 쓸 것.**
|
|
612
|
+
`type` 도 아직 받지만 deprecated 이고, 둘 다 주면 `variant` 가 이긴다.
|
|
613
|
+
- 폼 컨트롤의 검증 메시지는 전부 `validations` 다. [form.md](./components/form.md) 참고.
|
|
614
|
+
- **`Modal` 을 조건부 렌더하지 말 것.** `{open && <MyModal/>}` 은 닫는 애니메이션을
|
|
615
|
+
없앤다. `<MyModal isOpen={open}/>` 로 계속 마운트한다 — 닫히면 스스로 `null` 을
|
|
616
|
+
돌려주므로 DOM 에 안 남는다. [overlay.md](./components/overlay.md) 참고.
|
|
617
|
+
|
|
603
618
|
---
|
|
604
619
|
|
|
605
620
|
## 추가 참조 (필요 시 fetch)
|