@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
|
@@ -2857,7 +2857,8 @@ var ChartLegend = ({ data, labels, type }) => {
|
|
|
2857
2857
|
}) });
|
|
2858
2858
|
};
|
|
2859
2859
|
var Chart = import_react6.default.memo((props) => {
|
|
2860
|
-
const { type, data, labels, tooltip: showTooltip = true, tooltipType = "light" } = props;
|
|
2860
|
+
const { variant, type, data, labels, tooltip: showTooltip = true, tooltipType = "light" } = props;
|
|
2861
|
+
const shape = variant ?? type ?? "line";
|
|
2861
2862
|
const { tooltip, show, hide, move, containerRef } = useChartTooltip(showTooltip);
|
|
2862
2863
|
const { width, height } = useChartSize(containerRef);
|
|
2863
2864
|
const stableData = import_react6.default.useMemo(() => data, [JSON.stringify(data)]);
|
|
@@ -2866,11 +2867,11 @@ var Chart = import_react6.default.memo((props) => {
|
|
|
2866
2867
|
const animate = useChartAnimation(containerRef, dataKey);
|
|
2867
2868
|
const ready = width > 0 && height > 0;
|
|
2868
2869
|
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("div", { className: "lib-xplat-chart", ref: containerRef, children: [
|
|
2869
|
-
ready &&
|
|
2870
|
-
ready &&
|
|
2871
|
-
ready &&
|
|
2872
|
-
ready &&
|
|
2873
|
-
ready &&
|
|
2870
|
+
ready && shape === "line" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(LineChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2871
|
+
ready && shape === "curve" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(CurveChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2872
|
+
ready && shape === "bar" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(BarChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2873
|
+
ready && shape === "pie" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2874
|
+
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 }),
|
|
2874
2875
|
ready && (type === "pie" || type === "doughnut") && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(ChartLegend, { data: stableData, labels: stableLabels, type }),
|
|
2875
2876
|
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 })
|
|
2876
2877
|
] });
|
|
@@ -2977,6 +2978,9 @@ var import_tokens_core = require("@x-plat/tokens-core");
|
|
|
2977
2978
|
// src/tokens/index.ts
|
|
2978
2979
|
var import_tokens_core2 = require("@x-plat/tokens-core");
|
|
2979
2980
|
|
|
2981
|
+
// src/tokens/interface/status.ts
|
|
2982
|
+
var normalizeStatus = (value) => value === "brand" ? "primary" : value;
|
|
2983
|
+
|
|
2980
2984
|
// src/components/CheckBox/CheckBox.tsx
|
|
2981
2985
|
var import_jsx_runtime309 = require("react/jsx-runtime");
|
|
2982
2986
|
var CheckBox = (props) => {
|
|
@@ -2987,10 +2991,11 @@ var CheckBox = (props) => {
|
|
|
2987
2991
|
onChange,
|
|
2988
2992
|
disabled,
|
|
2989
2993
|
size = "md",
|
|
2990
|
-
type = "
|
|
2994
|
+
type = "primary",
|
|
2991
2995
|
validations,
|
|
2992
2996
|
...rest
|
|
2993
2997
|
} = props;
|
|
2998
|
+
const statusType = normalizeStatus(type);
|
|
2994
2999
|
const handleChange = (e) => {
|
|
2995
3000
|
if (onChange) onChange(e);
|
|
2996
3001
|
};
|
|
@@ -2998,7 +3003,7 @@ var CheckBox = (props) => {
|
|
|
2998
3003
|
const checkedClasses = `checked`;
|
|
2999
3004
|
const disabledClasses = "disabled";
|
|
3000
3005
|
const boxClasses = disabled ? disabledClasses : checked ? checkedClasses : uncheckedClasses;
|
|
3001
|
-
const control = /* @__PURE__ */ (0, import_jsx_runtime309.jsxs)("label", { className: clsx_default("lib-xplat-checkbox", size,
|
|
3006
|
+
const control = /* @__PURE__ */ (0, import_jsx_runtime309.jsxs)("label", { className: clsx_default("lib-xplat-checkbox", size, statusType, className), children: [
|
|
3002
3007
|
/* @__PURE__ */ (0, import_jsx_runtime309.jsx)(
|
|
3003
3008
|
"input",
|
|
3004
3009
|
{
|
|
@@ -3533,7 +3538,8 @@ var TabItem_default = TabItem;
|
|
|
3533
3538
|
// src/components/Tab/Tab.tsx
|
|
3534
3539
|
var import_jsx_runtime317 = require("react/jsx-runtime");
|
|
3535
3540
|
var Tab = (props) => {
|
|
3536
|
-
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
3541
|
+
const { activeIndex, onChange, tabs, variant, type, size = "md" } = props;
|
|
3542
|
+
const shape = variant ?? type ?? "default";
|
|
3537
3543
|
const [underlineStyle, setUnderlineStyle] = import_react14.default.useState({
|
|
3538
3544
|
left: 0,
|
|
3539
3545
|
width: 0
|
|
@@ -3548,7 +3554,7 @@ var Tab = (props) => {
|
|
|
3548
3554
|
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
3549
3555
|
}
|
|
3550
3556
|
}, [activeIndex, tabs.length]);
|
|
3551
|
-
return /* @__PURE__ */ (0, import_jsx_runtime317.jsxs)("div", { className: clsx_default("lib-xplat-tab", `type-${
|
|
3557
|
+
return /* @__PURE__ */ (0, import_jsx_runtime317.jsxs)("div", { className: clsx_default("lib-xplat-tab", `type-${shape}`, size), children: [
|
|
3552
3558
|
tabs.map((tab, idx) => /* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
|
|
3553
3559
|
TabItem_default,
|
|
3554
3560
|
{
|
|
@@ -3561,7 +3567,7 @@ var Tab = (props) => {
|
|
|
3561
3567
|
},
|
|
3562
3568
|
`${tab.value}_${idx}`
|
|
3563
3569
|
)),
|
|
3564
|
-
|
|
3570
|
+
shape === "toggle" && /* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
|
|
3565
3571
|
"div",
|
|
3566
3572
|
{
|
|
3567
3573
|
className: "tab-toggle-underline",
|
|
@@ -4987,11 +4993,12 @@ var NotificationBadge = (props) => {
|
|
|
4987
4993
|
dot = false,
|
|
4988
4994
|
size = "md"
|
|
4989
4995
|
} = props;
|
|
4996
|
+
const statusType = normalizeStatus(type);
|
|
4990
4997
|
const showBadge = dot || count !== void 0 && count > 0;
|
|
4991
4998
|
const displayCount = count !== void 0 && count > maxCount ? `${maxCount}+` : count;
|
|
4992
4999
|
return /* @__PURE__ */ (0, import_jsx_runtime330.jsxs)("div", { className: clsx_default("lib-xplat-notification-badge", size), children: [
|
|
4993
5000
|
children,
|
|
4994
|
-
showBadge && /* @__PURE__ */ (0, import_jsx_runtime330.jsx)("span", { className: clsx_default("badge-indicator",
|
|
5001
|
+
showBadge && /* @__PURE__ */ (0, import_jsx_runtime330.jsx)("span", { className: clsx_default("badge-indicator", statusType, { dot }), children: !dot && displayCount })
|
|
4995
5002
|
] });
|
|
4996
5003
|
};
|
|
4997
5004
|
NotificationBadge.displayName = "NotificationBadge";
|
|
@@ -5032,8 +5039,9 @@ var Pagination = (props) => {
|
|
|
5032
5039
|
siblingCount = 1,
|
|
5033
5040
|
onChange,
|
|
5034
5041
|
size = "md",
|
|
5035
|
-
type = "
|
|
5042
|
+
type = "primary"
|
|
5036
5043
|
} = props;
|
|
5044
|
+
const statusType = normalizeStatus(type);
|
|
5037
5045
|
const totalPages = Math.max(1, Math.ceil(total / pageSize));
|
|
5038
5046
|
const pages = getPageRange(current, totalPages, siblingCount);
|
|
5039
5047
|
const handleClick = (page) => {
|
|
@@ -5041,7 +5049,7 @@ var Pagination = (props) => {
|
|
|
5041
5049
|
onChange?.(page);
|
|
5042
5050
|
}
|
|
5043
5051
|
};
|
|
5044
|
-
return /* @__PURE__ */ (0, import_jsx_runtime331.jsxs)("nav", { className: clsx_default("lib-xplat-pagination", size,
|
|
5052
|
+
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: [
|
|
5045
5053
|
/* @__PURE__ */ (0, import_jsx_runtime331.jsx)(
|
|
5046
5054
|
"button",
|
|
5047
5055
|
{
|
|
@@ -5142,11 +5150,12 @@ var Progress = (props) => {
|
|
|
5142
5150
|
value,
|
|
5143
5151
|
max = 100,
|
|
5144
5152
|
size = "md",
|
|
5145
|
-
type = "
|
|
5153
|
+
type = "primary",
|
|
5146
5154
|
showLabel = false
|
|
5147
5155
|
} = props;
|
|
5156
|
+
const statusType = normalizeStatus(type);
|
|
5148
5157
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
5149
|
-
return /* @__PURE__ */ (0, import_jsx_runtime333.jsxs)("div", { className: clsx_default("lib-xplat-progress", size,
|
|
5158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime333.jsxs)("div", { className: clsx_default("lib-xplat-progress", size, statusType), children: [
|
|
5150
5159
|
/* @__PURE__ */ (0, import_jsx_runtime333.jsx)(
|
|
5151
5160
|
"div",
|
|
5152
5161
|
{
|
|
@@ -5191,10 +5200,11 @@ var Radio = (props) => {
|
|
|
5191
5200
|
className,
|
|
5192
5201
|
value,
|
|
5193
5202
|
size: sizeProp,
|
|
5194
|
-
type = "
|
|
5203
|
+
type = "primary",
|
|
5195
5204
|
validations,
|
|
5196
5205
|
...rest
|
|
5197
5206
|
} = props;
|
|
5207
|
+
const statusType = normalizeStatus(type);
|
|
5198
5208
|
const context = useRadioGroupContext();
|
|
5199
5209
|
const size = sizeProp ?? context?.size ?? "md";
|
|
5200
5210
|
const isGroup = !!context;
|
|
@@ -5210,7 +5220,7 @@ var Radio = (props) => {
|
|
|
5210
5220
|
className: clsx_default(
|
|
5211
5221
|
"lib-xplat-radio",
|
|
5212
5222
|
size,
|
|
5213
|
-
|
|
5223
|
+
statusType,
|
|
5214
5224
|
localChecked ? "checked" : void 0,
|
|
5215
5225
|
className
|
|
5216
5226
|
),
|
|
@@ -5489,12 +5499,13 @@ var import_jsx_runtime339 = require("react/jsx-runtime");
|
|
|
5489
5499
|
var Spinner = (props) => {
|
|
5490
5500
|
const {
|
|
5491
5501
|
size = "md",
|
|
5492
|
-
type = "
|
|
5502
|
+
type = "primary"
|
|
5493
5503
|
} = props;
|
|
5504
|
+
const statusType = normalizeStatus(type);
|
|
5494
5505
|
return /* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
|
|
5495
5506
|
"div",
|
|
5496
5507
|
{
|
|
5497
|
-
className: clsx_default("lib-xplat-spinner", size,
|
|
5508
|
+
className: clsx_default("lib-xplat-spinner", size, statusType),
|
|
5498
5509
|
role: "status",
|
|
5499
5510
|
"aria-label": "\uB85C\uB529 \uC911",
|
|
5500
5511
|
children: /* @__PURE__ */ (0, import_jsx_runtime339.jsxs)("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
@@ -5532,9 +5543,10 @@ var Steps = (props) => {
|
|
|
5532
5543
|
const {
|
|
5533
5544
|
items,
|
|
5534
5545
|
current,
|
|
5535
|
-
type = "
|
|
5546
|
+
type = "primary"
|
|
5536
5547
|
} = props;
|
|
5537
|
-
|
|
5548
|
+
const statusType = normalizeStatus(type);
|
|
5549
|
+
return /* @__PURE__ */ (0, import_jsx_runtime340.jsx)("div", { className: clsx_default("lib-xplat-steps", statusType), children: items.map((item, index) => {
|
|
5538
5550
|
const status = index < current ? "completed" : index === current ? "active" : "pending";
|
|
5539
5551
|
return /* @__PURE__ */ (0, import_jsx_runtime340.jsxs)("div", { className: clsx_default("step-item", status), children: [
|
|
5540
5552
|
/* @__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 }) }),
|
|
@@ -5859,11 +5871,12 @@ var Switch = (props) => {
|
|
|
5859
5871
|
const {
|
|
5860
5872
|
value,
|
|
5861
5873
|
size = "md",
|
|
5862
|
-
type = "
|
|
5874
|
+
type = "primary",
|
|
5863
5875
|
disabled,
|
|
5864
5876
|
onChange,
|
|
5865
5877
|
validations
|
|
5866
5878
|
} = props;
|
|
5879
|
+
const statusType = normalizeStatus(type);
|
|
5867
5880
|
const [isAnimating, setIsAnimating] = import_react32.default.useState(false);
|
|
5868
5881
|
const timeoutRef = import_react32.default.useRef(null);
|
|
5869
5882
|
import_react32.default.useEffect(() => {
|
|
@@ -5887,7 +5900,7 @@ var Switch = (props) => {
|
|
|
5887
5900
|
className: clsx_default(
|
|
5888
5901
|
"lib-xplat-switch",
|
|
5889
5902
|
size,
|
|
5890
|
-
|
|
5903
|
+
statusType,
|
|
5891
5904
|
value ? "checked" : void 0,
|
|
5892
5905
|
disabled && "disabled",
|
|
5893
5906
|
isAnimating && "animating"
|
|
@@ -6104,20 +6117,22 @@ var import_jsx_runtime348 = require("react/jsx-runtime");
|
|
|
6104
6117
|
var Tag = (props) => {
|
|
6105
6118
|
const {
|
|
6106
6119
|
children,
|
|
6107
|
-
|
|
6120
|
+
variant,
|
|
6121
|
+
type,
|
|
6108
6122
|
onClose,
|
|
6109
6123
|
size = "md",
|
|
6110
6124
|
disabled = false,
|
|
6111
6125
|
colorIndex
|
|
6112
6126
|
} = props;
|
|
6127
|
+
const shape = variant ?? type ?? "neutral";
|
|
6113
6128
|
return /* @__PURE__ */ (0, import_jsx_runtime348.jsxs)(
|
|
6114
6129
|
"span",
|
|
6115
6130
|
{
|
|
6116
6131
|
className: clsx_default(
|
|
6117
6132
|
"lib-xplat-tag",
|
|
6118
|
-
|
|
6133
|
+
shape,
|
|
6119
6134
|
size,
|
|
6120
|
-
|
|
6135
|
+
shape === "categorical" && colorIndex !== void 0 && `cat-${colorIndex}`,
|
|
6121
6136
|
disabled && "disabled"
|
|
6122
6137
|
),
|
|
6123
6138
|
children: [
|
|
@@ -6264,10 +6279,12 @@ var Tooltip = (props) => {
|
|
|
6264
6279
|
children,
|
|
6265
6280
|
title,
|
|
6266
6281
|
description,
|
|
6267
|
-
|
|
6282
|
+
variant,
|
|
6283
|
+
type,
|
|
6268
6284
|
follow = false,
|
|
6269
6285
|
disabled = false
|
|
6270
6286
|
} = props;
|
|
6287
|
+
const shape = variant ?? type ?? "dark";
|
|
6271
6288
|
const triggerRef = import_react40.default.useRef(null);
|
|
6272
6289
|
const tooltipRef = import_react40.default.useRef(null);
|
|
6273
6290
|
const [visible, setVisible] = import_react40.default.useState(false);
|
|
@@ -6377,7 +6394,7 @@ var Tooltip = (props) => {
|
|
|
6377
6394
|
{
|
|
6378
6395
|
ref: tooltipRef,
|
|
6379
6396
|
role: "tooltip",
|
|
6380
|
-
className: clsx_default("lib-xplat-tooltip",
|
|
6397
|
+
className: clsx_default("lib-xplat-tooltip", shape),
|
|
6381
6398
|
style: { position: "fixed", left: pos.left, top: pos.top },
|
|
6382
6399
|
children: [
|
|
6383
6400
|
title && /* @__PURE__ */ (0, import_jsx_runtime351.jsx)("div", { className: "tooltip-title", children: title }),
|
|
@@ -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/components/index.js
CHANGED
|
@@ -2758,7 +2758,8 @@ var ChartLegend = ({ data, labels, type }) => {
|
|
|
2758
2758
|
}) });
|
|
2759
2759
|
};
|
|
2760
2760
|
var Chart = React6.memo((props) => {
|
|
2761
|
-
const { type, data, labels, tooltip: showTooltip = true, tooltipType = "light" } = props;
|
|
2761
|
+
const { variant, type, data, labels, tooltip: showTooltip = true, tooltipType = "light" } = props;
|
|
2762
|
+
const shape = variant ?? type ?? "line";
|
|
2762
2763
|
const { tooltip, show, hide, move, containerRef } = useChartTooltip(showTooltip);
|
|
2763
2764
|
const { width, height } = useChartSize(containerRef);
|
|
2764
2765
|
const stableData = React6.useMemo(() => data, [JSON.stringify(data)]);
|
|
@@ -2767,11 +2768,11 @@ var Chart = React6.memo((props) => {
|
|
|
2767
2768
|
const animate = useChartAnimation(containerRef, dataKey);
|
|
2768
2769
|
const ready = width > 0 && height > 0;
|
|
2769
2770
|
return /* @__PURE__ */ jsxs196("div", { className: "lib-xplat-chart", ref: containerRef, children: [
|
|
2770
|
-
ready &&
|
|
2771
|
-
ready &&
|
|
2772
|
-
ready &&
|
|
2773
|
-
ready &&
|
|
2774
|
-
ready &&
|
|
2771
|
+
ready && shape === "line" && /* @__PURE__ */ jsx306(LineChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2772
|
+
ready && shape === "curve" && /* @__PURE__ */ jsx306(CurveChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2773
|
+
ready && shape === "bar" && /* @__PURE__ */ jsx306(BarChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2774
|
+
ready && shape === "pie" && /* @__PURE__ */ jsx306(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2775
|
+
ready && shape === "doughnut" && /* @__PURE__ */ jsx306(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, isDoughnut: true, onHover: show, onMove: move, onLeave: hide }),
|
|
2775
2776
|
ready && (type === "pie" || type === "doughnut") && /* @__PURE__ */ jsx306(ChartLegend, { data: stableData, labels: stableLabels, type }),
|
|
2776
2777
|
tooltip.visible && tooltip.content && /* @__PURE__ */ jsx306(ChartTooltip, { x: tooltip.x, y: tooltip.y, containerWidth: width, containerHeight: height, tooltipType, children: tooltip.content })
|
|
2777
2778
|
] });
|
|
@@ -2878,6 +2879,9 @@ import { semantic } from "@x-plat/tokens-core";
|
|
|
2878
2879
|
// src/tokens/index.ts
|
|
2879
2880
|
import { cssVar } from "@x-plat/tokens-core";
|
|
2880
2881
|
|
|
2882
|
+
// src/tokens/interface/status.ts
|
|
2883
|
+
var normalizeStatus = (value) => value === "brand" ? "primary" : value;
|
|
2884
|
+
|
|
2881
2885
|
// src/components/CheckBox/CheckBox.tsx
|
|
2882
2886
|
import { jsx as jsx309, jsxs as jsxs198 } from "react/jsx-runtime";
|
|
2883
2887
|
var CheckBox = (props) => {
|
|
@@ -2888,10 +2892,11 @@ var CheckBox = (props) => {
|
|
|
2888
2892
|
onChange,
|
|
2889
2893
|
disabled,
|
|
2890
2894
|
size = "md",
|
|
2891
|
-
type = "
|
|
2895
|
+
type = "primary",
|
|
2892
2896
|
validations,
|
|
2893
2897
|
...rest
|
|
2894
2898
|
} = props;
|
|
2899
|
+
const statusType = normalizeStatus(type);
|
|
2895
2900
|
const handleChange = (e) => {
|
|
2896
2901
|
if (onChange) onChange(e);
|
|
2897
2902
|
};
|
|
@@ -2899,7 +2904,7 @@ var CheckBox = (props) => {
|
|
|
2899
2904
|
const checkedClasses = `checked`;
|
|
2900
2905
|
const disabledClasses = "disabled";
|
|
2901
2906
|
const boxClasses = disabled ? disabledClasses : checked ? checkedClasses : uncheckedClasses;
|
|
2902
|
-
const control = /* @__PURE__ */ jsxs198("label", { className: clsx_default("lib-xplat-checkbox", size,
|
|
2907
|
+
const control = /* @__PURE__ */ jsxs198("label", { className: clsx_default("lib-xplat-checkbox", size, statusType, className), children: [
|
|
2903
2908
|
/* @__PURE__ */ jsx309(
|
|
2904
2909
|
"input",
|
|
2905
2910
|
{
|
|
@@ -3434,7 +3439,8 @@ var TabItem_default = TabItem;
|
|
|
3434
3439
|
// src/components/Tab/Tab.tsx
|
|
3435
3440
|
import { jsx as jsx317, jsxs as jsxs202 } from "react/jsx-runtime";
|
|
3436
3441
|
var Tab = (props) => {
|
|
3437
|
-
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
3442
|
+
const { activeIndex, onChange, tabs, variant, type, size = "md" } = props;
|
|
3443
|
+
const shape = variant ?? type ?? "default";
|
|
3438
3444
|
const [underlineStyle, setUnderlineStyle] = React14.useState({
|
|
3439
3445
|
left: 0,
|
|
3440
3446
|
width: 0
|
|
@@ -3449,7 +3455,7 @@ var Tab = (props) => {
|
|
|
3449
3455
|
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
3450
3456
|
}
|
|
3451
3457
|
}, [activeIndex, tabs.length]);
|
|
3452
|
-
return /* @__PURE__ */ jsxs202("div", { className: clsx_default("lib-xplat-tab", `type-${
|
|
3458
|
+
return /* @__PURE__ */ jsxs202("div", { className: clsx_default("lib-xplat-tab", `type-${shape}`, size), children: [
|
|
3453
3459
|
tabs.map((tab, idx) => /* @__PURE__ */ jsx317(
|
|
3454
3460
|
TabItem_default,
|
|
3455
3461
|
{
|
|
@@ -3462,7 +3468,7 @@ var Tab = (props) => {
|
|
|
3462
3468
|
},
|
|
3463
3469
|
`${tab.value}_${idx}`
|
|
3464
3470
|
)),
|
|
3465
|
-
|
|
3471
|
+
shape === "toggle" && /* @__PURE__ */ jsx317(
|
|
3466
3472
|
"div",
|
|
3467
3473
|
{
|
|
3468
3474
|
className: "tab-toggle-underline",
|
|
@@ -4888,11 +4894,12 @@ var NotificationBadge = (props) => {
|
|
|
4888
4894
|
dot = false,
|
|
4889
4895
|
size = "md"
|
|
4890
4896
|
} = props;
|
|
4897
|
+
const statusType = normalizeStatus(type);
|
|
4891
4898
|
const showBadge = dot || count !== void 0 && count > 0;
|
|
4892
4899
|
const displayCount = count !== void 0 && count > maxCount ? `${maxCount}+` : count;
|
|
4893
4900
|
return /* @__PURE__ */ jsxs211("div", { className: clsx_default("lib-xplat-notification-badge", size), children: [
|
|
4894
4901
|
children,
|
|
4895
|
-
showBadge && /* @__PURE__ */ jsx330("span", { className: clsx_default("badge-indicator",
|
|
4902
|
+
showBadge && /* @__PURE__ */ jsx330("span", { className: clsx_default("badge-indicator", statusType, { dot }), children: !dot && displayCount })
|
|
4896
4903
|
] });
|
|
4897
4904
|
};
|
|
4898
4905
|
NotificationBadge.displayName = "NotificationBadge";
|
|
@@ -4933,8 +4940,9 @@ var Pagination = (props) => {
|
|
|
4933
4940
|
siblingCount = 1,
|
|
4934
4941
|
onChange,
|
|
4935
4942
|
size = "md",
|
|
4936
|
-
type = "
|
|
4943
|
+
type = "primary"
|
|
4937
4944
|
} = props;
|
|
4945
|
+
const statusType = normalizeStatus(type);
|
|
4938
4946
|
const totalPages = Math.max(1, Math.ceil(total / pageSize));
|
|
4939
4947
|
const pages = getPageRange(current, totalPages, siblingCount);
|
|
4940
4948
|
const handleClick = (page) => {
|
|
@@ -4942,7 +4950,7 @@ var Pagination = (props) => {
|
|
|
4942
4950
|
onChange?.(page);
|
|
4943
4951
|
}
|
|
4944
4952
|
};
|
|
4945
|
-
return /* @__PURE__ */ jsxs212("nav", { className: clsx_default("lib-xplat-pagination", size,
|
|
4953
|
+
return /* @__PURE__ */ jsxs212("nav", { className: clsx_default("lib-xplat-pagination", size, statusType), "aria-label": "\uD398\uC774\uC9C0 \uB124\uBE44\uAC8C\uC774\uC158", children: [
|
|
4946
4954
|
/* @__PURE__ */ jsx331(
|
|
4947
4955
|
"button",
|
|
4948
4956
|
{
|
|
@@ -5043,11 +5051,12 @@ var Progress = (props) => {
|
|
|
5043
5051
|
value,
|
|
5044
5052
|
max = 100,
|
|
5045
5053
|
size = "md",
|
|
5046
|
-
type = "
|
|
5054
|
+
type = "primary",
|
|
5047
5055
|
showLabel = false
|
|
5048
5056
|
} = props;
|
|
5057
|
+
const statusType = normalizeStatus(type);
|
|
5049
5058
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
5050
|
-
return /* @__PURE__ */ jsxs214("div", { className: clsx_default("lib-xplat-progress", size,
|
|
5059
|
+
return /* @__PURE__ */ jsxs214("div", { className: clsx_default("lib-xplat-progress", size, statusType), children: [
|
|
5051
5060
|
/* @__PURE__ */ jsx333(
|
|
5052
5061
|
"div",
|
|
5053
5062
|
{
|
|
@@ -5092,10 +5101,11 @@ var Radio = (props) => {
|
|
|
5092
5101
|
className,
|
|
5093
5102
|
value,
|
|
5094
5103
|
size: sizeProp,
|
|
5095
|
-
type = "
|
|
5104
|
+
type = "primary",
|
|
5096
5105
|
validations,
|
|
5097
5106
|
...rest
|
|
5098
5107
|
} = props;
|
|
5108
|
+
const statusType = normalizeStatus(type);
|
|
5099
5109
|
const context = useRadioGroupContext();
|
|
5100
5110
|
const size = sizeProp ?? context?.size ?? "md";
|
|
5101
5111
|
const isGroup = !!context;
|
|
@@ -5111,7 +5121,7 @@ var Radio = (props) => {
|
|
|
5111
5121
|
className: clsx_default(
|
|
5112
5122
|
"lib-xplat-radio",
|
|
5113
5123
|
size,
|
|
5114
|
-
|
|
5124
|
+
statusType,
|
|
5115
5125
|
localChecked ? "checked" : void 0,
|
|
5116
5126
|
className
|
|
5117
5127
|
),
|
|
@@ -5390,12 +5400,13 @@ import { jsx as jsx339, jsxs as jsxs217 } from "react/jsx-runtime";
|
|
|
5390
5400
|
var Spinner = (props) => {
|
|
5391
5401
|
const {
|
|
5392
5402
|
size = "md",
|
|
5393
|
-
type = "
|
|
5403
|
+
type = "primary"
|
|
5394
5404
|
} = props;
|
|
5405
|
+
const statusType = normalizeStatus(type);
|
|
5395
5406
|
return /* @__PURE__ */ jsx339(
|
|
5396
5407
|
"div",
|
|
5397
5408
|
{
|
|
5398
|
-
className: clsx_default("lib-xplat-spinner", size,
|
|
5409
|
+
className: clsx_default("lib-xplat-spinner", size, statusType),
|
|
5399
5410
|
role: "status",
|
|
5400
5411
|
"aria-label": "\uB85C\uB529 \uC911",
|
|
5401
5412
|
children: /* @__PURE__ */ jsxs217("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
@@ -5433,9 +5444,10 @@ var Steps = (props) => {
|
|
|
5433
5444
|
const {
|
|
5434
5445
|
items,
|
|
5435
5446
|
current,
|
|
5436
|
-
type = "
|
|
5447
|
+
type = "primary"
|
|
5437
5448
|
} = props;
|
|
5438
|
-
|
|
5449
|
+
const statusType = normalizeStatus(type);
|
|
5450
|
+
return /* @__PURE__ */ jsx340("div", { className: clsx_default("lib-xplat-steps", statusType), children: items.map((item, index) => {
|
|
5439
5451
|
const status = index < current ? "completed" : index === current ? "active" : "pending";
|
|
5440
5452
|
return /* @__PURE__ */ jsxs218("div", { className: clsx_default("step-item", status), children: [
|
|
5441
5453
|
/* @__PURE__ */ jsx340("div", { className: "step-circle", children: status === "completed" ? /* @__PURE__ */ jsx340(CheckIcon_default, {}) : /* @__PURE__ */ jsx340("span", { children: index + 1 }) }),
|
|
@@ -5760,11 +5772,12 @@ var Switch = (props) => {
|
|
|
5760
5772
|
const {
|
|
5761
5773
|
value,
|
|
5762
5774
|
size = "md",
|
|
5763
|
-
type = "
|
|
5775
|
+
type = "primary",
|
|
5764
5776
|
disabled,
|
|
5765
5777
|
onChange,
|
|
5766
5778
|
validations
|
|
5767
5779
|
} = props;
|
|
5780
|
+
const statusType = normalizeStatus(type);
|
|
5768
5781
|
const [isAnimating, setIsAnimating] = React32.useState(false);
|
|
5769
5782
|
const timeoutRef = React32.useRef(null);
|
|
5770
5783
|
React32.useEffect(() => {
|
|
@@ -5788,7 +5801,7 @@ var Switch = (props) => {
|
|
|
5788
5801
|
className: clsx_default(
|
|
5789
5802
|
"lib-xplat-switch",
|
|
5790
5803
|
size,
|
|
5791
|
-
|
|
5804
|
+
statusType,
|
|
5792
5805
|
value ? "checked" : void 0,
|
|
5793
5806
|
disabled && "disabled",
|
|
5794
5807
|
isAnimating && "animating"
|
|
@@ -6005,20 +6018,22 @@ import { jsx as jsx348, jsxs as jsxs220 } from "react/jsx-runtime";
|
|
|
6005
6018
|
var Tag = (props) => {
|
|
6006
6019
|
const {
|
|
6007
6020
|
children,
|
|
6008
|
-
|
|
6021
|
+
variant,
|
|
6022
|
+
type,
|
|
6009
6023
|
onClose,
|
|
6010
6024
|
size = "md",
|
|
6011
6025
|
disabled = false,
|
|
6012
6026
|
colorIndex
|
|
6013
6027
|
} = props;
|
|
6028
|
+
const shape = variant ?? type ?? "neutral";
|
|
6014
6029
|
return /* @__PURE__ */ jsxs220(
|
|
6015
6030
|
"span",
|
|
6016
6031
|
{
|
|
6017
6032
|
className: clsx_default(
|
|
6018
6033
|
"lib-xplat-tag",
|
|
6019
|
-
|
|
6034
|
+
shape,
|
|
6020
6035
|
size,
|
|
6021
|
-
|
|
6036
|
+
shape === "categorical" && colorIndex !== void 0 && `cat-${colorIndex}`,
|
|
6022
6037
|
disabled && "disabled"
|
|
6023
6038
|
),
|
|
6024
6039
|
children: [
|
|
@@ -6165,10 +6180,12 @@ var Tooltip = (props) => {
|
|
|
6165
6180
|
children,
|
|
6166
6181
|
title,
|
|
6167
6182
|
description,
|
|
6168
|
-
|
|
6183
|
+
variant,
|
|
6184
|
+
type,
|
|
6169
6185
|
follow = false,
|
|
6170
6186
|
disabled = false
|
|
6171
6187
|
} = props;
|
|
6188
|
+
const shape = variant ?? type ?? "dark";
|
|
6172
6189
|
const triggerRef = React40.useRef(null);
|
|
6173
6190
|
const tooltipRef = React40.useRef(null);
|
|
6174
6191
|
const [visible, setVisible] = React40.useState(false);
|
|
@@ -6278,7 +6295,7 @@ var Tooltip = (props) => {
|
|
|
6278
6295
|
{
|
|
6279
6296
|
ref: tooltipRef,
|
|
6280
6297
|
role: "tooltip",
|
|
6281
|
-
className: clsx_default("lib-xplat-tooltip",
|
|
6298
|
+
className: clsx_default("lib-xplat-tooltip", shape),
|
|
6282
6299
|
style: { position: "fixed", left: pos.left, top: pos.top },
|
|
6283
6300
|
children: [
|
|
6284
6301
|
title && /* @__PURE__ */ jsx351("div", { className: "tooltip-title", children: title }),
|