@x-plat/design-system 0.5.7 → 0.5.9
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/{Card → Box}/index.cjs +34 -13
- package/dist/components/Box/index.css +55 -0
- package/dist/components/Box/index.d.cts +13 -0
- package/dist/components/Box/index.d.ts +13 -0
- package/dist/components/Box/index.js +34 -0
- package/dist/components/Button/index.css +5 -0
- package/dist/components/Chart/index.cjs +185 -56
- package/dist/components/Chart/index.css +25 -9
- package/dist/components/Chart/index.d.cts +1 -1
- package/dist/components/Chart/index.d.ts +1 -1
- package/dist/components/Chart/index.js +185 -56
- package/dist/components/DatePicker/index.cjs +667 -682
- package/dist/components/DatePicker/index.css +211 -128
- package/dist/components/DatePicker/index.d.cts +2 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/DatePicker/index.js +656 -671
- package/dist/components/index.cjs +720 -643
- package/dist/components/index.css +197 -156
- package/dist/components/index.d.cts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +714 -637
- package/dist/index.cjs +720 -643
- package/dist/index.css +197 -156
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +714 -637
- package/package.json +1 -1
- package/dist/components/Card/index.css +0 -28
- package/dist/components/Card/index.d.cts +0 -9
- package/dist/components/Card/index.d.ts +0 -9
- package/dist/components/Card/index.js +0 -13
package/dist/index.cjs
CHANGED
|
@@ -72,6 +72,7 @@ __export(index_exports, {
|
|
|
72
72
|
BookIcon: () => BookIcon_default,
|
|
73
73
|
BookOpenIcon: () => BookOpenIcon_default,
|
|
74
74
|
BookmarkIcon: () => BookmarkIcon_default,
|
|
75
|
+
Box: () => Box_default,
|
|
75
76
|
BoxIcon: () => BoxIcon_default,
|
|
76
77
|
Breadcrumb: () => Breadcrumb_default,
|
|
77
78
|
BriefcaseIcon: () => BriefcaseIcon_default,
|
|
@@ -88,7 +89,6 @@ __export(index_exports, {
|
|
|
88
89
|
CallOutgoingIcon: () => CallOutgoingIcon_default,
|
|
89
90
|
CameraIcon: () => CameraIcon_default,
|
|
90
91
|
CameraOffIcon: () => CameraOffIcon_default,
|
|
91
|
-
Card: () => Card_default,
|
|
92
92
|
CardTab: () => CardTab_default,
|
|
93
93
|
CastIcon: () => CastIcon_default,
|
|
94
94
|
Chart: () => Chart_default,
|
|
@@ -6432,16 +6432,21 @@ var Calendar = (props) => {
|
|
|
6432
6432
|
Calendar.displayName = "Calendar";
|
|
6433
6433
|
var Calendar_default = Calendar;
|
|
6434
6434
|
|
|
6435
|
-
// src/components/
|
|
6435
|
+
// src/components/Box/Box.tsx
|
|
6436
6436
|
var import_jsx_runtime302 = require("react/jsx-runtime");
|
|
6437
|
-
var
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6437
|
+
var Box = ({
|
|
6438
|
+
children,
|
|
6439
|
+
title,
|
|
6440
|
+
variant = "outlined",
|
|
6441
|
+
padding = "md"
|
|
6442
|
+
}) => {
|
|
6443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime302.jsxs)("div", { className: clsx_default("lib-xplat-box", variant, `pad-${padding}`), children: [
|
|
6444
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("div", { className: "box-title", children: title }),
|
|
6445
|
+
/* @__PURE__ */ (0, import_jsx_runtime302.jsx)("div", { className: "box-content", children })
|
|
6441
6446
|
] });
|
|
6442
6447
|
};
|
|
6443
|
-
|
|
6444
|
-
var
|
|
6448
|
+
Box.displayName = "Box";
|
|
6449
|
+
var Box_default = Box;
|
|
6445
6450
|
|
|
6446
6451
|
// src/components/CardTab/CardTab.tsx
|
|
6447
6452
|
var import_react4 = __toESM(require("react"), 1);
|
|
@@ -6514,25 +6519,65 @@ var CardTab_default = CardTab;
|
|
|
6514
6519
|
// src/components/Chart/Chart.tsx
|
|
6515
6520
|
var import_react5 = __toESM(require("react"), 1);
|
|
6516
6521
|
var import_jsx_runtime305 = require("react/jsx-runtime");
|
|
6517
|
-
var
|
|
6518
|
-
|
|
6519
|
-
|
|
6520
|
-
[
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
var
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6522
|
+
var CATEGORICAL_COUNT2 = 8;
|
|
6523
|
+
var LINE_BAR_PALETTES = Array.from({ length: CATEGORICAL_COUNT2 }, (_, i) => {
|
|
6524
|
+
const n = i + 1;
|
|
6525
|
+
return [
|
|
6526
|
+
`var(--semantic-categorical-${n}-bg)`,
|
|
6527
|
+
`var(--semantic-categorical-${n}-area)`,
|
|
6528
|
+
`var(--semantic-categorical-${n}-fill)`,
|
|
6529
|
+
`var(--semantic-categorical-${n}-text)`
|
|
6530
|
+
];
|
|
6531
|
+
});
|
|
6532
|
+
var PIE_COLORS = Array.from(
|
|
6533
|
+
{ length: CATEGORICAL_COUNT2 },
|
|
6534
|
+
(_, i) => `var(--semantic-categorical-${i + 1}-fill)`
|
|
6535
|
+
);
|
|
6536
|
+
var hashString = (str) => {
|
|
6537
|
+
let hash = 0;
|
|
6538
|
+
for (let i = 0; i < str.length; i++) {
|
|
6539
|
+
hash = (hash << 5) - hash + str.charCodeAt(i) | 0;
|
|
6540
|
+
}
|
|
6541
|
+
return Math.abs(hash);
|
|
6542
|
+
};
|
|
6543
|
+
var getPalette = (palettes, index, key) => {
|
|
6544
|
+
const offset = key ? hashString(key) : 0;
|
|
6545
|
+
return palettes[(index + offset) % palettes.length];
|
|
6534
6546
|
};
|
|
6535
6547
|
var PADDING = { top: 20, right: 20, bottom: 30, left: 40 };
|
|
6548
|
+
var toSmoothPath = (points) => {
|
|
6549
|
+
if (points.length < 2) return "";
|
|
6550
|
+
const p = points;
|
|
6551
|
+
let d = `M ${p[0].x} ${p[0].y}`;
|
|
6552
|
+
for (let i = 0; i < p.length - 1; i++) {
|
|
6553
|
+
const p0 = p[Math.max(0, i - 1)];
|
|
6554
|
+
const p1 = p[i];
|
|
6555
|
+
const p2 = p[i + 1];
|
|
6556
|
+
const p3 = p[Math.min(p.length - 1, i + 2)];
|
|
6557
|
+
const cp1x = p1.x + (p2.x - p0.x) / 6;
|
|
6558
|
+
const cp1y = p1.y + (p2.y - p0.y) / 6;
|
|
6559
|
+
const cp2x = p2.x - (p3.x - p1.x) / 6;
|
|
6560
|
+
const cp2y = p2.y - (p3.y - p1.y) / 6;
|
|
6561
|
+
d += ` C ${cp1x} ${cp1y}, ${cp2x} ${cp2y}, ${p2.x} ${p2.y}`;
|
|
6562
|
+
}
|
|
6563
|
+
return d;
|
|
6564
|
+
};
|
|
6565
|
+
var useChartSize = (ref) => {
|
|
6566
|
+
const [size, setSize] = import_react5.default.useState({ width: 0, height: 0 });
|
|
6567
|
+
import_react5.default.useEffect(() => {
|
|
6568
|
+
const el = ref.current;
|
|
6569
|
+
if (!el) return;
|
|
6570
|
+
const observer = new ResizeObserver((entries) => {
|
|
6571
|
+
const entry = entries[0];
|
|
6572
|
+
if (!entry) return;
|
|
6573
|
+
const { width, height } = entry.contentRect;
|
|
6574
|
+
setSize({ width: Math.floor(width), height: Math.floor(height) });
|
|
6575
|
+
});
|
|
6576
|
+
observer.observe(el);
|
|
6577
|
+
return () => observer.disconnect();
|
|
6578
|
+
}, [ref]);
|
|
6579
|
+
return size;
|
|
6580
|
+
};
|
|
6536
6581
|
var useChartTooltip = (enabled) => {
|
|
6537
6582
|
const [tooltip, setTooltip] = import_react5.default.useState({
|
|
6538
6583
|
visible: false,
|
|
@@ -6567,15 +6612,15 @@ var useChartTooltip = (enabled) => {
|
|
|
6567
6612
|
}, []);
|
|
6568
6613
|
return { tooltip, show, hide, move, containerRef };
|
|
6569
6614
|
};
|
|
6570
|
-
var LineChart = import_react5.default.memo(({ data, labels, onHover, onMove, onLeave }) => {
|
|
6615
|
+
var LineChart = import_react5.default.memo(({ data, labels, width, height, onHover, onMove, onLeave }) => {
|
|
6571
6616
|
const entries = import_react5.default.useMemo(() => Object.entries(data), [data]);
|
|
6572
6617
|
const maxVal = import_react5.default.useMemo(() => {
|
|
6573
6618
|
const allValues = entries.flatMap(([, v]) => v);
|
|
6574
6619
|
return Math.max(...allValues) * 1.2 || 1;
|
|
6575
6620
|
}, [entries]);
|
|
6576
6621
|
const count = labels.length;
|
|
6577
|
-
const chartW =
|
|
6578
|
-
const chartH =
|
|
6622
|
+
const chartW = width - PADDING.left - PADDING.right;
|
|
6623
|
+
const chartH = height - PADDING.top - PADDING.bottom;
|
|
6579
6624
|
const seriesPoints = import_react5.default.useMemo(
|
|
6580
6625
|
() => entries.map(
|
|
6581
6626
|
([, values]) => values.map((v, i) => ({
|
|
@@ -6586,22 +6631,22 @@ var LineChart = import_react5.default.memo(({ data, labels, onHover, onMove, onL
|
|
|
6586
6631
|
),
|
|
6587
6632
|
[entries, count, chartW, chartH, maxVal]
|
|
6588
6633
|
);
|
|
6589
|
-
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("svg", { viewBox:
|
|
6634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
6590
6635
|
[0, 0.25, 0.5, 0.75, 1].map((ratio) => {
|
|
6591
6636
|
const y = PADDING.top + (1 - ratio) * chartH;
|
|
6592
6637
|
const val = Math.round(maxVal * ratio);
|
|
6593
6638
|
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { children: [
|
|
6594
|
-
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("line", { x1: PADDING.left, y1: y, x2:
|
|
6639
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
|
|
6595
6640
|
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
|
|
6596
6641
|
] }, ratio);
|
|
6597
6642
|
}),
|
|
6598
6643
|
labels.map((label, i) => {
|
|
6599
6644
|
const x = PADDING.left + i / (count - 1 || 1) * chartW;
|
|
6600
|
-
return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("text", { x, y:
|
|
6645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("text", { x, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
6601
6646
|
}),
|
|
6602
6647
|
entries.map(([key], di) => {
|
|
6603
|
-
const palette = getPalette(LINE_BAR_PALETTES, di);
|
|
6604
|
-
const color = palette[
|
|
6648
|
+
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
6649
|
+
const color = palette[2];
|
|
6605
6650
|
const points = seriesPoints[di];
|
|
6606
6651
|
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { children: [
|
|
6607
6652
|
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
|
|
@@ -6632,7 +6677,73 @@ var LineChart = import_react5.default.memo(({ data, labels, onHover, onMove, onL
|
|
|
6632
6677
|
] });
|
|
6633
6678
|
});
|
|
6634
6679
|
LineChart.displayName = "LineChart";
|
|
6635
|
-
var
|
|
6680
|
+
var CurveChart = import_react5.default.memo(({ data, labels, width, height, onHover, onMove, onLeave }) => {
|
|
6681
|
+
const entries = import_react5.default.useMemo(() => Object.entries(data), [data]);
|
|
6682
|
+
const maxVal = import_react5.default.useMemo(() => {
|
|
6683
|
+
const allValues = entries.flatMap(([, v]) => v);
|
|
6684
|
+
return Math.max(...allValues) * 1.2 || 1;
|
|
6685
|
+
}, [entries]);
|
|
6686
|
+
const count = labels.length;
|
|
6687
|
+
const chartW = width - PADDING.left - PADDING.right;
|
|
6688
|
+
const chartH = height - PADDING.top - PADDING.bottom;
|
|
6689
|
+
const seriesPoints = import_react5.default.useMemo(
|
|
6690
|
+
() => entries.map(
|
|
6691
|
+
([, values]) => values.map((v, i) => ({
|
|
6692
|
+
x: PADDING.left + i / (count - 1 || 1) * chartW,
|
|
6693
|
+
y: PADDING.top + (1 - v / maxVal) * chartH,
|
|
6694
|
+
v
|
|
6695
|
+
}))
|
|
6696
|
+
),
|
|
6697
|
+
[entries, count, chartW, chartH, maxVal]
|
|
6698
|
+
);
|
|
6699
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
6700
|
+
[0, 0.25, 0.5, 0.75, 1].map((ratio) => {
|
|
6701
|
+
const y = PADDING.top + (1 - ratio) * chartH;
|
|
6702
|
+
const val = Math.round(maxVal * ratio);
|
|
6703
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { children: [
|
|
6704
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
|
|
6705
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
|
|
6706
|
+
] }, ratio);
|
|
6707
|
+
}),
|
|
6708
|
+
labels.map((label, i) => {
|
|
6709
|
+
const x = PADDING.left + i / (count - 1 || 1) * chartW;
|
|
6710
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("text", { x, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
6711
|
+
}),
|
|
6712
|
+
entries.map(([key], di) => {
|
|
6713
|
+
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
6714
|
+
const color = palette[2];
|
|
6715
|
+
const areaColor = palette[0];
|
|
6716
|
+
const points = seriesPoints[di];
|
|
6717
|
+
const gradientId = `curve-gradient-${di}`;
|
|
6718
|
+
const linePath = toSmoothPath(points);
|
|
6719
|
+
const areaPath = linePath + ` L ${points[points.length - 1].x} ${PADDING.top + chartH} L ${points[0].x} ${PADDING.top + chartH} Z`;
|
|
6720
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { children: [
|
|
6721
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
6722
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.4" }),
|
|
6723
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0.02" })
|
|
6724
|
+
] }) }),
|
|
6725
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("path", { d: areaPath, fill: `url(#${gradientId})` }),
|
|
6726
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("path", { d: linePath, fill: "none", stroke: color, strokeWidth: "2" }),
|
|
6727
|
+
points.map((p, i) => /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
|
|
6728
|
+
"circle",
|
|
6729
|
+
{
|
|
6730
|
+
cx: p.x,
|
|
6731
|
+
cy: p.y,
|
|
6732
|
+
r: "4",
|
|
6733
|
+
fill: color,
|
|
6734
|
+
className: "chart-point",
|
|
6735
|
+
onMouseEnter: (e) => onHover(e, `${key}: ${labels[i]} \u2014 ${p.v}`),
|
|
6736
|
+
onMouseMove: onMove,
|
|
6737
|
+
onMouseLeave: onLeave
|
|
6738
|
+
},
|
|
6739
|
+
i
|
|
6740
|
+
))
|
|
6741
|
+
] }, di);
|
|
6742
|
+
})
|
|
6743
|
+
] });
|
|
6744
|
+
});
|
|
6745
|
+
CurveChart.displayName = "CurveChart";
|
|
6746
|
+
var BarChart = import_react5.default.memo(({ data, labels, width, height, onHover, onMove, onLeave }) => {
|
|
6636
6747
|
const entries = import_react5.default.useMemo(() => Object.entries(data), [data]);
|
|
6637
6748
|
const maxVal = import_react5.default.useMemo(() => {
|
|
6638
6749
|
const allValues = entries.flatMap(([, v]) => v);
|
|
@@ -6640,8 +6751,8 @@ var BarChart = import_react5.default.memo(({ data, labels, onHover, onMove, onLe
|
|
|
6640
6751
|
}, [entries]);
|
|
6641
6752
|
const count = labels.length;
|
|
6642
6753
|
const groupCount = entries.length;
|
|
6643
|
-
const chartW =
|
|
6644
|
-
const chartH =
|
|
6754
|
+
const chartW = width - PADDING.left - PADDING.right;
|
|
6755
|
+
const chartH = height - PADDING.top - PADDING.bottom;
|
|
6645
6756
|
const groupW = chartW / count;
|
|
6646
6757
|
const barW = Math.min(32, groupW * 0.7 / groupCount);
|
|
6647
6758
|
const bars = import_react5.default.useMemo(
|
|
@@ -6655,19 +6766,19 @@ var BarChart = import_react5.default.memo(({ data, labels, onHover, onMove, onLe
|
|
|
6655
6766
|
),
|
|
6656
6767
|
[entries, maxVal, chartH, groupW, barW, groupCount]
|
|
6657
6768
|
);
|
|
6658
|
-
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("svg", { viewBox:
|
|
6769
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
6659
6770
|
[0, 0.25, 0.5, 0.75, 1].map((ratio) => {
|
|
6660
6771
|
const y = PADDING.top + (1 - ratio) * chartH;
|
|
6661
6772
|
const val = Math.round(maxVal * ratio);
|
|
6662
6773
|
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { children: [
|
|
6663
|
-
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("line", { x1: PADDING.left, y1: y, x2:
|
|
6774
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
|
|
6664
6775
|
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
|
|
6665
6776
|
] }, ratio);
|
|
6666
6777
|
}),
|
|
6667
|
-
labels.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("text", { x: PADDING.left + groupW * i + groupW / 2, y:
|
|
6778
|
+
labels.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("text", { x: PADDING.left + groupW * i + groupW / 2, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i)),
|
|
6668
6779
|
entries.map(([key], di) => {
|
|
6669
|
-
const palette = getPalette(LINE_BAR_PALETTES, di);
|
|
6670
|
-
const color = palette[
|
|
6780
|
+
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
6781
|
+
const color = palette[2];
|
|
6671
6782
|
return bars[di].map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
|
|
6672
6783
|
"rect",
|
|
6673
6784
|
{
|
|
@@ -6675,7 +6786,7 @@ var BarChart = import_react5.default.memo(({ data, labels, onHover, onMove, onLe
|
|
|
6675
6786
|
y: b.y,
|
|
6676
6787
|
width: b.w,
|
|
6677
6788
|
height: b.h,
|
|
6678
|
-
rx:
|
|
6789
|
+
rx: Math.min(4, b.w / 2),
|
|
6679
6790
|
fill: color,
|
|
6680
6791
|
className: "chart-bar",
|
|
6681
6792
|
onMouseEnter: (e) => onHover(e, `${key}: ${labels[i]} \u2014 ${b.v}`),
|
|
@@ -6689,14 +6800,17 @@ var BarChart = import_react5.default.memo(({ data, labels, onHover, onMove, onLe
|
|
|
6689
6800
|
});
|
|
6690
6801
|
BarChart.displayName = "BarChart";
|
|
6691
6802
|
var PieDonutChart = import_react5.default.memo(
|
|
6692
|
-
({ data, labels, isDoughnut, onHover, onMove, onLeave }) => {
|
|
6693
|
-
const
|
|
6803
|
+
({ data, labels, width, height, isDoughnut, onHover, onMove, onLeave }) => {
|
|
6804
|
+
const entries = import_react5.default.useMemo(() => Object.entries(data), [data]);
|
|
6805
|
+
const values = import_react5.default.useMemo(() => entries.flatMap(([, v]) => v), [entries]);
|
|
6694
6806
|
const total = import_react5.default.useMemo(() => values.reduce((a, b) => a + b, 0) || 1, [values]);
|
|
6695
|
-
const
|
|
6696
|
-
const
|
|
6697
|
-
const
|
|
6698
|
-
const
|
|
6699
|
-
const
|
|
6807
|
+
const size = Math.min(width, height);
|
|
6808
|
+
const cx = size / 2;
|
|
6809
|
+
const cy = size / 2;
|
|
6810
|
+
const r2 = size * 0.4;
|
|
6811
|
+
const innerR = isDoughnut ? r2 * 0.5 : 0;
|
|
6812
|
+
const firstKey = entries[0]?.[0] ?? "";
|
|
6813
|
+
const colorOffset = hashString(firstKey);
|
|
6700
6814
|
const sliceData = import_react5.default.useMemo(() => {
|
|
6701
6815
|
let angle0 = -Math.PI / 2;
|
|
6702
6816
|
return values.map((v, i) => {
|
|
@@ -6725,13 +6839,13 @@ var PieDonutChart = import_react5.default.memo(
|
|
|
6725
6839
|
angle0 = endAngle;
|
|
6726
6840
|
return { d, lx, ly, v, pct, angle, label: labels[i] || `${i + 1}` };
|
|
6727
6841
|
});
|
|
6728
|
-
}, [values, total, innerR, labels]);
|
|
6729
|
-
return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("svg", { viewBox:
|
|
6842
|
+
}, [values, total, cx, cy, r2, innerR, labels]);
|
|
6843
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("svg", { viewBox: `0 0 ${size} ${size}`, className: "chart-svg chart-pie", children: sliceData.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { children: [
|
|
6730
6844
|
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
|
|
6731
6845
|
"path",
|
|
6732
6846
|
{
|
|
6733
6847
|
d: s.d,
|
|
6734
|
-
fill:
|
|
6848
|
+
fill: PIE_COLORS[(i + colorOffset) % PIE_COLORS.length],
|
|
6735
6849
|
className: "chart-slice",
|
|
6736
6850
|
onMouseEnter: (e) => onHover(e, `${s.label}: ${s.v} (${s.pct}%)`),
|
|
6737
6851
|
onMouseMove: onMove,
|
|
@@ -6743,22 +6857,42 @@ var PieDonutChart = import_react5.default.memo(
|
|
|
6743
6857
|
}
|
|
6744
6858
|
);
|
|
6745
6859
|
PieDonutChart.displayName = "PieDonutChart";
|
|
6860
|
+
var TooltipBubble = ({ x, y, containerWidth, children }) => {
|
|
6861
|
+
const ref = import_react5.default.useRef(null);
|
|
6862
|
+
const [adjustedX, setAdjustedX] = import_react5.default.useState(x);
|
|
6863
|
+
import_react5.default.useEffect(() => {
|
|
6864
|
+
const el = ref.current;
|
|
6865
|
+
if (!el) return;
|
|
6866
|
+
const w = el.offsetWidth;
|
|
6867
|
+
const half = w / 2;
|
|
6868
|
+
const margin = 8;
|
|
6869
|
+
let nx = x;
|
|
6870
|
+
if (x - half < margin) nx = half + margin;
|
|
6871
|
+
else if (x + half > containerWidth - margin) nx = containerWidth - half - margin;
|
|
6872
|
+
setAdjustedX(nx);
|
|
6873
|
+
}, [x, containerWidth]);
|
|
6874
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
|
|
6875
|
+
"div",
|
|
6876
|
+
{
|
|
6877
|
+
ref,
|
|
6878
|
+
className: "chart-tooltip",
|
|
6879
|
+
style: { left: adjustedX, top: y },
|
|
6880
|
+
children
|
|
6881
|
+
}
|
|
6882
|
+
);
|
|
6883
|
+
};
|
|
6746
6884
|
var Chart = (props) => {
|
|
6747
6885
|
const { type, data, labels, tooltip: showTooltip = true } = props;
|
|
6748
6886
|
const { tooltip, show, hide, move, containerRef } = useChartTooltip(showTooltip);
|
|
6887
|
+
const { width, height } = useChartSize(containerRef);
|
|
6888
|
+
const ready = width > 0 && height > 0;
|
|
6749
6889
|
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("div", { className: "lib-xplat-chart", ref: containerRef, children: [
|
|
6750
|
-
type === "line" && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(LineChart, { data, labels, onHover: show, onMove: move, onLeave: hide }),
|
|
6751
|
-
type === "
|
|
6752
|
-
type === "
|
|
6753
|
-
type === "
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
{
|
|
6757
|
-
className: "chart-tooltip",
|
|
6758
|
-
style: { left: tooltip.x, top: tooltip.y },
|
|
6759
|
-
children: tooltip.content
|
|
6760
|
-
}
|
|
6761
|
-
)
|
|
6890
|
+
ready && type === "line" && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(LineChart, { data, labels, width, height, onHover: show, onMove: move, onLeave: hide }),
|
|
6891
|
+
ready && type === "curve" && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(CurveChart, { data, labels, width, height, onHover: show, onMove: move, onLeave: hide }),
|
|
6892
|
+
ready && type === "bar" && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(BarChart, { data, labels, width, height, onHover: show, onMove: move, onLeave: hide }),
|
|
6893
|
+
ready && type === "pie" && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(PieDonutChart, { data, labels, width, height, onHover: show, onMove: move, onLeave: hide }),
|
|
6894
|
+
ready && type === "doughnut" && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(PieDonutChart, { data, labels, width, height, isDoughnut: true, onHover: show, onMove: move, onLeave: hide }),
|
|
6895
|
+
tooltip.visible && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(TooltipBubble, { x: tooltip.x, y: tooltip.y, containerWidth: width, children: tooltip.content })
|
|
6762
6896
|
] });
|
|
6763
6897
|
};
|
|
6764
6898
|
Chart.displayName = "Chart";
|
|
@@ -7023,42 +7157,66 @@ var PasswordInput = import_react8.default.forwardRef(
|
|
|
7023
7157
|
PasswordInput.displayName = "PasswordInput";
|
|
7024
7158
|
var PasswordInput_default = PasswordInput;
|
|
7025
7159
|
|
|
7026
|
-
// src/
|
|
7160
|
+
// src/components/Modal/Modal.tsx
|
|
7027
7161
|
var import_react9 = __toESM(require("react"), 1);
|
|
7028
|
-
var
|
|
7162
|
+
var import_react_dom = require("react-dom");
|
|
7163
|
+
var import_jsx_runtime311 = require("react/jsx-runtime");
|
|
7164
|
+
var ANIMATION_DURATION_MS = 200;
|
|
7165
|
+
var Modal = (props) => {
|
|
7166
|
+
const { isOpen, onClose, children } = props;
|
|
7167
|
+
const [mounted, setMounted] = import_react9.default.useState(false);
|
|
7168
|
+
const [visible, setVisible] = import_react9.default.useState(false);
|
|
7029
7169
|
import_react9.default.useEffect(() => {
|
|
7030
|
-
if (
|
|
7031
|
-
|
|
7032
|
-
|
|
7033
|
-
|
|
7034
|
-
|
|
7035
|
-
|
|
7036
|
-
|
|
7037
|
-
|
|
7038
|
-
|
|
7170
|
+
if (isOpen) {
|
|
7171
|
+
setMounted(true);
|
|
7172
|
+
const t2 = setTimeout(() => setVisible(true), 1);
|
|
7173
|
+
return () => clearTimeout(t2);
|
|
7174
|
+
}
|
|
7175
|
+
setVisible(false);
|
|
7176
|
+
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS);
|
|
7177
|
+
return () => clearTimeout(t);
|
|
7178
|
+
}, [isOpen]);
|
|
7179
|
+
if (typeof document === "undefined") return null;
|
|
7180
|
+
if (!mounted) return null;
|
|
7181
|
+
const stateClass = visible ? "enter" : "exit";
|
|
7182
|
+
return (0, import_react_dom.createPortal)(
|
|
7183
|
+
/* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
|
|
7184
|
+
"div",
|
|
7185
|
+
{
|
|
7186
|
+
className: clsx_default("lib-xplat-modal", "dim", stateClass),
|
|
7187
|
+
onClick: onClose,
|
|
7188
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
|
|
7189
|
+
"div",
|
|
7190
|
+
{
|
|
7191
|
+
className: clsx_default("lib-xplat-modal", "modal-box", stateClass),
|
|
7192
|
+
role: "dialog",
|
|
7193
|
+
"aria-modal": "true",
|
|
7194
|
+
onClick: (e) => e.stopPropagation(),
|
|
7195
|
+
children
|
|
7196
|
+
}
|
|
7197
|
+
)
|
|
7039
7198
|
}
|
|
7040
|
-
|
|
7041
|
-
document.
|
|
7042
|
-
|
|
7043
|
-
return () => {
|
|
7044
|
-
document.removeEventListener("mousedown", listener);
|
|
7045
|
-
document.removeEventListener("touchstart", listener);
|
|
7046
|
-
};
|
|
7047
|
-
}, [refs, handler, enabled]);
|
|
7199
|
+
),
|
|
7200
|
+
document.body
|
|
7201
|
+
);
|
|
7048
7202
|
};
|
|
7049
|
-
|
|
7203
|
+
Modal.displayName = "Modal";
|
|
7204
|
+
var Modal_default = Modal;
|
|
7050
7205
|
|
|
7051
7206
|
// src/components/DatePicker/SingleDatePicker/index.tsx
|
|
7052
7207
|
var import_react10 = __toESM(require("react"), 1);
|
|
7053
|
-
var
|
|
7208
|
+
var import_jsx_runtime312 = require("react/jsx-runtime");
|
|
7054
7209
|
var DayCell2 = import_react10.default.memo(
|
|
7055
7210
|
({
|
|
7056
7211
|
day,
|
|
7057
7212
|
disabled,
|
|
7058
7213
|
selected,
|
|
7059
7214
|
highlighted,
|
|
7215
|
+
isStart,
|
|
7216
|
+
isEnd,
|
|
7217
|
+
inRange,
|
|
7060
7218
|
onSelect
|
|
7061
|
-
}) => /* @__PURE__ */ (0,
|
|
7219
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(
|
|
7062
7220
|
"button",
|
|
7063
7221
|
{
|
|
7064
7222
|
type: "button",
|
|
@@ -7066,8 +7224,9 @@ var DayCell2 = import_react10.default.memo(
|
|
|
7066
7224
|
"datepicker-day",
|
|
7067
7225
|
!day.isCurrentMonth && "outside",
|
|
7068
7226
|
disabled && "disabled",
|
|
7069
|
-
selected && "selected",
|
|
7227
|
+
(selected || isStart || isEnd) && "selected",
|
|
7070
7228
|
highlighted && !selected && "highlighted",
|
|
7229
|
+
inRange && !isStart && !isEnd && "in-range",
|
|
7071
7230
|
day.isToday && "today",
|
|
7072
7231
|
day.isSunday && "sunday",
|
|
7073
7232
|
day.isSaturday && "saturday"
|
|
@@ -7079,7 +7238,7 @@ var DayCell2 = import_react10.default.memo(
|
|
|
7079
7238
|
children: day.day
|
|
7080
7239
|
}
|
|
7081
7240
|
),
|
|
7082
|
-
(prev, next) => prev.selected === next.selected && prev.disabled === next.disabled && prev.highlighted === next.highlighted && prev.day === next.day
|
|
7241
|
+
(prev, next) => prev.selected === next.selected && prev.disabled === next.disabled && prev.highlighted === next.highlighted && prev.isStart === next.isStart && prev.isEnd === next.isEnd && prev.inRange === next.inRange && prev.day === next.day
|
|
7083
7242
|
);
|
|
7084
7243
|
DayCell2.displayName = "DayCell";
|
|
7085
7244
|
var SingleDatePicker = (props) => {
|
|
@@ -7089,7 +7248,9 @@ var SingleDatePicker = (props) => {
|
|
|
7089
7248
|
minDate,
|
|
7090
7249
|
maxDate,
|
|
7091
7250
|
highlightDates = [],
|
|
7092
|
-
locale = "ko"
|
|
7251
|
+
locale = "ko",
|
|
7252
|
+
rangeStart,
|
|
7253
|
+
rangeEnd
|
|
7093
7254
|
} = props;
|
|
7094
7255
|
const initialYear = value?.getFullYear();
|
|
7095
7256
|
const initialMonth = value?.getMonth();
|
|
@@ -7137,6 +7298,8 @@ var SingleDatePicker = (props) => {
|
|
|
7137
7298
|
else if (pickerMode === "months") {
|
|
7138
7299
|
setYearRangeStart(Math.floor(year / 12) * 12);
|
|
7139
7300
|
setPickerMode("years");
|
|
7301
|
+
} else {
|
|
7302
|
+
setPickerMode("days");
|
|
7140
7303
|
}
|
|
7141
7304
|
};
|
|
7142
7305
|
const handleMonthSelect = (m) => {
|
|
@@ -7150,71 +7313,80 @@ var SingleDatePicker = (props) => {
|
|
|
7150
7313
|
const weekdays = WEEKDAY_LABELS[locale];
|
|
7151
7314
|
const monthLabels = MONTH_LABELS[locale];
|
|
7152
7315
|
const titleText = pickerMode === "days" ? locale === "ko" ? `${year}\uB144 ${monthLabels[month]}` : `${monthLabels[month]} ${year}` : pickerMode === "months" ? `${year}` : `${yearRangeStart} - ${yearRangeStart + 11}`;
|
|
7153
|
-
|
|
7316
|
+
const hasRange = rangeStart != null && rangeEnd != null;
|
|
7317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime312.jsxs)(
|
|
7154
7318
|
"div",
|
|
7155
7319
|
{
|
|
7156
7320
|
className: clsx_default("lib-xplat-datepicker", "single"),
|
|
7157
7321
|
children: [
|
|
7158
|
-
/* @__PURE__ */ (0,
|
|
7159
|
-
/* @__PURE__ */ (0,
|
|
7160
|
-
/* @__PURE__ */ (0,
|
|
7161
|
-
/* @__PURE__ */ (0,
|
|
7322
|
+
/* @__PURE__ */ (0, import_jsx_runtime312.jsxs)("div", { className: "datepicker-header", children: [
|
|
7323
|
+
/* @__PURE__ */ (0, import_jsx_runtime312.jsx)("button", { className: "datepicker-nav", onClick: handlePrev, type: "button", children: /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(ChevronLeftIcon_default, {}) }),
|
|
7324
|
+
/* @__PURE__ */ (0, import_jsx_runtime312.jsx)("button", { className: "datepicker-title", onClick: handleTitleClick, type: "button", children: titleText }),
|
|
7325
|
+
/* @__PURE__ */ (0, import_jsx_runtime312.jsx)("button", { className: "datepicker-nav", onClick: handleNext, type: "button", children: /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(ChevronRightIcon_default, {}) })
|
|
7162
7326
|
] }),
|
|
7163
|
-
|
|
7164
|
-
|
|
7165
|
-
|
|
7327
|
+
/* @__PURE__ */ (0, import_jsx_runtime312.jsxs)("div", { className: "datepicker-body", children: [
|
|
7328
|
+
pickerMode === "years" && /* @__PURE__ */ (0, import_jsx_runtime312.jsx)("div", { className: "datepicker-picker-grid", children: Array.from({ length: 12 }, (_, i) => {
|
|
7329
|
+
const y = yearRangeStart + i;
|
|
7330
|
+
return /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(
|
|
7331
|
+
"button",
|
|
7332
|
+
{
|
|
7333
|
+
type: "button",
|
|
7334
|
+
className: clsx_default("datepicker-picker-cell", y === year && "active"),
|
|
7335
|
+
onClick: () => handleYearSelect(y),
|
|
7336
|
+
children: y
|
|
7337
|
+
},
|
|
7338
|
+
y
|
|
7339
|
+
);
|
|
7340
|
+
}) }),
|
|
7341
|
+
pickerMode === "months" && /* @__PURE__ */ (0, import_jsx_runtime312.jsx)("div", { className: "datepicker-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(
|
|
7166
7342
|
"button",
|
|
7167
7343
|
{
|
|
7168
7344
|
type: "button",
|
|
7169
|
-
className: clsx_default("datepicker-picker-cell",
|
|
7170
|
-
onClick: () =>
|
|
7171
|
-
children: y
|
|
7172
|
-
},
|
|
7173
|
-
y
|
|
7174
|
-
);
|
|
7175
|
-
}) }),
|
|
7176
|
-
pickerMode === "months" && /* @__PURE__ */ (0, import_jsx_runtime311.jsx)("div", { className: "datepicker-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
|
|
7177
|
-
"button",
|
|
7178
|
-
{
|
|
7179
|
-
type: "button",
|
|
7180
|
-
className: clsx_default("datepicker-picker-cell", i === month && "active"),
|
|
7181
|
-
onClick: () => handleMonthSelect(i),
|
|
7182
|
-
children: label
|
|
7183
|
-
},
|
|
7184
|
-
i
|
|
7185
|
-
)) }),
|
|
7186
|
-
pickerMode === "days" && /* @__PURE__ */ (0, import_jsx_runtime311.jsxs)(import_jsx_runtime311.Fragment, { children: [
|
|
7187
|
-
/* @__PURE__ */ (0, import_jsx_runtime311.jsx)("div", { className: "datepicker-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
|
|
7188
|
-
"div",
|
|
7189
|
-
{
|
|
7190
|
-
className: clsx_default(
|
|
7191
|
-
"datepicker-weekday",
|
|
7192
|
-
i === 0 && "sunday",
|
|
7193
|
-
i === 6 && "saturday"
|
|
7194
|
-
),
|
|
7345
|
+
className: clsx_default("datepicker-picker-cell", i === month && "active"),
|
|
7346
|
+
onClick: () => handleMonthSelect(i),
|
|
7195
7347
|
children: label
|
|
7196
7348
|
},
|
|
7197
|
-
|
|
7349
|
+
i
|
|
7198
7350
|
)) }),
|
|
7199
|
-
/* @__PURE__ */ (0,
|
|
7200
|
-
|
|
7201
|
-
|
|
7202
|
-
const selected = value ? isSameDay(day.date, value) : false;
|
|
7203
|
-
const highlighted = highlightSet.has(
|
|
7204
|
-
`${day.date.getFullYear()}-${day.date.getMonth()}-${day.date.getDate()}`
|
|
7205
|
-
);
|
|
7206
|
-
return /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
|
|
7207
|
-
DayCell2,
|
|
7351
|
+
pickerMode === "days" && /* @__PURE__ */ (0, import_jsx_runtime312.jsxs)(import_jsx_runtime312.Fragment, { children: [
|
|
7352
|
+
/* @__PURE__ */ (0, import_jsx_runtime312.jsx)("div", { className: "datepicker-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(
|
|
7353
|
+
"div",
|
|
7208
7354
|
{
|
|
7209
|
-
|
|
7210
|
-
|
|
7211
|
-
|
|
7212
|
-
|
|
7213
|
-
|
|
7355
|
+
className: clsx_default(
|
|
7356
|
+
"datepicker-weekday",
|
|
7357
|
+
i === 0 && "sunday",
|
|
7358
|
+
i === 6 && "saturday"
|
|
7359
|
+
),
|
|
7360
|
+
children: label
|
|
7214
7361
|
},
|
|
7215
|
-
|
|
7216
|
-
)
|
|
7217
|
-
|
|
7362
|
+
label
|
|
7363
|
+
)) }),
|
|
7364
|
+
/* @__PURE__ */ (0, import_jsx_runtime312.jsx)("div", { className: "datepicker-grid", children: days.map((day, idx) => {
|
|
7365
|
+
const t = day.date.getTime();
|
|
7366
|
+
const disabled = t < minTime || t > maxTime;
|
|
7367
|
+
const selected = value ? isSameDay(day.date, value) : false;
|
|
7368
|
+
const highlighted = highlightSet.has(
|
|
7369
|
+
`${day.date.getFullYear()}-${day.date.getMonth()}-${day.date.getDate()}`
|
|
7370
|
+
);
|
|
7371
|
+
const isStart = hasRange ? isSameDay(day.date, rangeStart) : false;
|
|
7372
|
+
const isEnd = hasRange ? isSameDay(day.date, rangeEnd) : false;
|
|
7373
|
+
const inRangeVal = hasRange ? isInRange(day.date, rangeStart, rangeEnd) : false;
|
|
7374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(
|
|
7375
|
+
DayCell2,
|
|
7376
|
+
{
|
|
7377
|
+
day,
|
|
7378
|
+
disabled,
|
|
7379
|
+
selected,
|
|
7380
|
+
highlighted,
|
|
7381
|
+
isStart,
|
|
7382
|
+
isEnd,
|
|
7383
|
+
inRange: inRangeVal,
|
|
7384
|
+
onSelect: handleSelect
|
|
7385
|
+
},
|
|
7386
|
+
idx
|
|
7387
|
+
);
|
|
7388
|
+
}) })
|
|
7389
|
+
] })
|
|
7218
7390
|
] })
|
|
7219
7391
|
]
|
|
7220
7392
|
}
|
|
@@ -7224,7 +7396,7 @@ SingleDatePicker.displayName = "SingleDatePicker";
|
|
|
7224
7396
|
var SingleDatePicker_default = SingleDatePicker;
|
|
7225
7397
|
|
|
7226
7398
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
7227
|
-
var
|
|
7399
|
+
var import_jsx_runtime313 = require("react/jsx-runtime");
|
|
7228
7400
|
var formatDate = (date) => {
|
|
7229
7401
|
if (!date || !(date instanceof Date) || isNaN(date.getTime())) return "";
|
|
7230
7402
|
const y = date.getFullYear();
|
|
@@ -7233,137 +7405,131 @@ var formatDate = (date) => {
|
|
|
7233
7405
|
return `${y}/${m}/${d}`;
|
|
7234
7406
|
};
|
|
7235
7407
|
var InputDatePicker = (props) => {
|
|
7236
|
-
const { value, onChange, minDate, maxDate, disabled, locale, placeholder } = props;
|
|
7408
|
+
const { value, onChange, minDate, maxDate, disabled, locale = "ko", placeholder } = props;
|
|
7237
7409
|
const [isOpen, setIsOpen] = import_react11.default.useState(false);
|
|
7238
|
-
const
|
|
7239
|
-
const
|
|
7240
|
-
|
|
7410
|
+
const [tempDate, setTempDate] = import_react11.default.useState(value ?? /* @__PURE__ */ new Date());
|
|
7411
|
+
const handleOpen = () => {
|
|
7412
|
+
if (disabled) return;
|
|
7413
|
+
setTempDate(value ?? /* @__PURE__ */ new Date());
|
|
7414
|
+
setIsOpen(true);
|
|
7415
|
+
};
|
|
7241
7416
|
const handleSelect = (date) => {
|
|
7242
|
-
if (
|
|
7243
|
-
|
|
7417
|
+
if (date) setTempDate(date);
|
|
7418
|
+
};
|
|
7419
|
+
const handleApply = () => {
|
|
7420
|
+
onChange?.(tempDate);
|
|
7244
7421
|
setIsOpen(false);
|
|
7245
7422
|
};
|
|
7246
|
-
|
|
7247
|
-
|
|
7248
|
-
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
|
|
7263
|
-
|
|
7264
|
-
|
|
7265
|
-
|
|
7266
|
-
|
|
7267
|
-
|
|
7268
|
-
|
|
7269
|
-
|
|
7270
|
-
|
|
7271
|
-
|
|
7272
|
-
|
|
7273
|
-
|
|
7274
|
-
|
|
7275
|
-
|
|
7276
|
-
|
|
7277
|
-
}
|
|
7278
|
-
) })
|
|
7279
|
-
]
|
|
7280
|
-
}
|
|
7281
|
-
);
|
|
7423
|
+
const handleClose = () => {
|
|
7424
|
+
setIsOpen(false);
|
|
7425
|
+
};
|
|
7426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime313.jsxs)("div", { className: clsx_default("lib-xplat-datepicker input-datepicker", disabled && "disabled"), children: [
|
|
7427
|
+
/* @__PURE__ */ (0, import_jsx_runtime313.jsx)("div", { className: "input-datepicker-trigger", onClick: handleOpen, children: /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(
|
|
7428
|
+
Input_default,
|
|
7429
|
+
{
|
|
7430
|
+
value: formatDate(value),
|
|
7431
|
+
placeholder,
|
|
7432
|
+
suffix: /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(CalenderIcon_default, {}),
|
|
7433
|
+
disabled,
|
|
7434
|
+
readOnly: true
|
|
7435
|
+
}
|
|
7436
|
+
) }),
|
|
7437
|
+
/* @__PURE__ */ (0, import_jsx_runtime313.jsx)(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ (0, import_jsx_runtime313.jsxs)("div", { className: "lib-xplat-popup-datepicker-card", children: [
|
|
7438
|
+
/* @__PURE__ */ (0, import_jsx_runtime313.jsx)("div", { className: "popup-datepicker-content", children: /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(
|
|
7439
|
+
SingleDatePicker_default,
|
|
7440
|
+
{
|
|
7441
|
+
value: tempDate,
|
|
7442
|
+
onChange: handleSelect,
|
|
7443
|
+
minDate,
|
|
7444
|
+
maxDate,
|
|
7445
|
+
locale
|
|
7446
|
+
}
|
|
7447
|
+
) }),
|
|
7448
|
+
/* @__PURE__ */ (0, import_jsx_runtime313.jsxs)("div", { className: "popup-datepicker-footer", children: [
|
|
7449
|
+
/* @__PURE__ */ (0, import_jsx_runtime313.jsx)(Button_default, { type: "secondary", onClick: handleClose, children: locale === "ko" ? "\uCDE8\uC18C" : "Cancel" }),
|
|
7450
|
+
/* @__PURE__ */ (0, import_jsx_runtime313.jsx)(Button_default, { type: "primary", onClick: handleApply, children: locale === "ko" ? "\uC801\uC6A9" : "Apply" })
|
|
7451
|
+
] })
|
|
7452
|
+
] }) })
|
|
7453
|
+
] });
|
|
7282
7454
|
};
|
|
7283
7455
|
InputDatePicker.displayName = "InputDatePicker";
|
|
7284
7456
|
var InputDatePicker_default = InputDatePicker;
|
|
7285
7457
|
|
|
7286
7458
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
7287
|
-
var
|
|
7288
|
-
|
|
7289
|
-
// src/components/Modal/Modal.tsx
|
|
7290
|
-
var import_react12 = __toESM(require("react"), 1);
|
|
7291
|
-
var import_react_dom = require("react-dom");
|
|
7292
|
-
var import_jsx_runtime313 = require("react/jsx-runtime");
|
|
7293
|
-
var ANIMATION_DURATION_MS = 200;
|
|
7294
|
-
var Modal = (props) => {
|
|
7295
|
-
const { isOpen, onClose, children } = props;
|
|
7296
|
-
const [mounted, setMounted] = import_react12.default.useState(false);
|
|
7297
|
-
const [visible, setVisible] = import_react12.default.useState(false);
|
|
7298
|
-
import_react12.default.useEffect(() => {
|
|
7299
|
-
if (isOpen) {
|
|
7300
|
-
setMounted(true);
|
|
7301
|
-
const t2 = setTimeout(() => setVisible(true), 1);
|
|
7302
|
-
return () => clearTimeout(t2);
|
|
7303
|
-
}
|
|
7304
|
-
setVisible(false);
|
|
7305
|
-
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS);
|
|
7306
|
-
return () => clearTimeout(t);
|
|
7307
|
-
}, [isOpen]);
|
|
7308
|
-
if (typeof document === "undefined") return null;
|
|
7309
|
-
if (!mounted) return null;
|
|
7310
|
-
const stateClass = visible ? "enter" : "exit";
|
|
7311
|
-
return (0, import_react_dom.createPortal)(
|
|
7312
|
-
/* @__PURE__ */ (0, import_jsx_runtime313.jsx)(
|
|
7313
|
-
"div",
|
|
7314
|
-
{
|
|
7315
|
-
className: clsx_default("lib-xplat-modal", "dim", stateClass),
|
|
7316
|
-
onClick: onClose,
|
|
7317
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(
|
|
7318
|
-
"div",
|
|
7319
|
-
{
|
|
7320
|
-
className: clsx_default("lib-xplat-modal", "modal-box", stateClass),
|
|
7321
|
-
role: "dialog",
|
|
7322
|
-
"aria-modal": "true",
|
|
7323
|
-
onClick: (e) => e.stopPropagation(),
|
|
7324
|
-
children
|
|
7325
|
-
}
|
|
7326
|
-
)
|
|
7327
|
-
}
|
|
7328
|
-
),
|
|
7329
|
-
document.body
|
|
7330
|
-
);
|
|
7331
|
-
};
|
|
7332
|
-
Modal.displayName = "Modal";
|
|
7333
|
-
var Modal_default = Modal;
|
|
7459
|
+
var import_react15 = __toESM(require("react"), 1);
|
|
7334
7460
|
|
|
7335
7461
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
7462
|
+
var import_react14 = __toESM(require("react"), 1);
|
|
7463
|
+
|
|
7464
|
+
// src/components/Tab/Tab.tsx
|
|
7336
7465
|
var import_react13 = __toESM(require("react"), 1);
|
|
7466
|
+
|
|
7467
|
+
// src/components/Tab/TabItem.tsx
|
|
7468
|
+
var import_react12 = __toESM(require("react"), 1);
|
|
7337
7469
|
var import_jsx_runtime314 = require("react/jsx-runtime");
|
|
7338
|
-
var
|
|
7339
|
-
|
|
7340
|
-
|
|
7341
|
-
|
|
7342
|
-
isStart,
|
|
7343
|
-
isEnd,
|
|
7344
|
-
inRange,
|
|
7345
|
-
onClick
|
|
7346
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
7347
|
-
"button",
|
|
7470
|
+
var TabItem = import_react12.default.forwardRef((props, ref) => {
|
|
7471
|
+
const { isActive, title, onClick } = props;
|
|
7472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
7473
|
+
"div",
|
|
7348
7474
|
{
|
|
7349
|
-
|
|
7350
|
-
className: clsx_default(
|
|
7351
|
-
"datepicker-day",
|
|
7352
|
-
!day.isCurrentMonth && "outside",
|
|
7353
|
-
disabled && "disabled",
|
|
7354
|
-
(isStart || isEnd) && "selected",
|
|
7355
|
-
inRange && !isStart && !isEnd && "in-range",
|
|
7356
|
-
day.isToday && "today",
|
|
7357
|
-
day.isSunday && "sunday",
|
|
7358
|
-
day.isSaturday && "saturday"
|
|
7359
|
-
),
|
|
7360
|
-
disabled: disabled || !day.isCurrentMonth,
|
|
7475
|
+
ref,
|
|
7476
|
+
className: clsx_default("tab-item", isActive ? "active" : null),
|
|
7361
7477
|
onClick,
|
|
7362
|
-
children:
|
|
7478
|
+
children: title
|
|
7363
7479
|
}
|
|
7364
|
-
)
|
|
7365
|
-
);
|
|
7366
|
-
|
|
7480
|
+
);
|
|
7481
|
+
});
|
|
7482
|
+
TabItem.displayName = "TabItem";
|
|
7483
|
+
var TabItem_default = TabItem;
|
|
7484
|
+
|
|
7485
|
+
// src/components/Tab/Tab.tsx
|
|
7486
|
+
var import_jsx_runtime315 = require("react/jsx-runtime");
|
|
7487
|
+
var Tab = (props) => {
|
|
7488
|
+
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
7489
|
+
const [underlineStyle, setUnderlineStyle] = import_react13.default.useState({
|
|
7490
|
+
left: 0,
|
|
7491
|
+
width: 0
|
|
7492
|
+
});
|
|
7493
|
+
const itemRefs = import_react13.default.useRef([]);
|
|
7494
|
+
const handleChangeActiveTab = (tabItem, tabIdx) => {
|
|
7495
|
+
onChange(tabItem, tabIdx);
|
|
7496
|
+
};
|
|
7497
|
+
import_react13.default.useEffect(() => {
|
|
7498
|
+
const el = itemRefs.current[activeIndex];
|
|
7499
|
+
if (el) {
|
|
7500
|
+
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
7501
|
+
}
|
|
7502
|
+
}, [activeIndex, tabs.length]);
|
|
7503
|
+
return /* @__PURE__ */ (0, import_jsx_runtime315.jsxs)("div", { className: clsx_default("lib-xplat-tab", `type-${type}`, size), children: [
|
|
7504
|
+
tabs.map((tab, idx) => /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(
|
|
7505
|
+
TabItem_default,
|
|
7506
|
+
{
|
|
7507
|
+
onClick: () => handleChangeActiveTab(tab, idx),
|
|
7508
|
+
isActive: activeIndex === idx,
|
|
7509
|
+
ref: (el) => {
|
|
7510
|
+
itemRefs.current[idx] = el;
|
|
7511
|
+
},
|
|
7512
|
+
title: tab.title
|
|
7513
|
+
},
|
|
7514
|
+
`${tab.value}_${idx}`
|
|
7515
|
+
)),
|
|
7516
|
+
type === "toggle" && /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(
|
|
7517
|
+
"div",
|
|
7518
|
+
{
|
|
7519
|
+
className: "tab-toggle-underline",
|
|
7520
|
+
style: {
|
|
7521
|
+
left: underlineStyle.left,
|
|
7522
|
+
width: underlineStyle.width
|
|
7523
|
+
}
|
|
7524
|
+
}
|
|
7525
|
+
)
|
|
7526
|
+
] });
|
|
7527
|
+
};
|
|
7528
|
+
Tab.displayName = "Tab";
|
|
7529
|
+
var Tab_default = Tab;
|
|
7530
|
+
|
|
7531
|
+
// src/components/DatePicker/RangePicker/index.tsx
|
|
7532
|
+
var import_jsx_runtime316 = require("react/jsx-runtime");
|
|
7367
7533
|
var RangePicker = (props) => {
|
|
7368
7534
|
const {
|
|
7369
7535
|
startDate,
|
|
@@ -7373,139 +7539,92 @@ var RangePicker = (props) => {
|
|
|
7373
7539
|
maxDate,
|
|
7374
7540
|
locale = "ko"
|
|
7375
7541
|
} = props;
|
|
7376
|
-
const [activeTab, setActiveTab] =
|
|
7377
|
-
const
|
|
7378
|
-
|
|
7379
|
-
|
|
7380
|
-
|
|
7381
|
-
if (minDate) {
|
|
7382
|
-
const min = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()).getTime();
|
|
7383
|
-
if (d < min) return true;
|
|
7384
|
-
}
|
|
7385
|
-
if (maxDate) {
|
|
7386
|
-
const max = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()).getTime();
|
|
7387
|
-
if (d > max) return true;
|
|
7388
|
-
}
|
|
7389
|
-
if (type === "end") {
|
|
7390
|
-
const start = new Date(startDate.getFullYear(), startDate.getMonth(), startDate.getDate()).getTime();
|
|
7391
|
-
if (d < start) return true;
|
|
7392
|
-
}
|
|
7393
|
-
if (type === "start") {
|
|
7394
|
-
const end = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate()).getTime();
|
|
7395
|
-
if (d > end) return true;
|
|
7396
|
-
}
|
|
7397
|
-
return false;
|
|
7542
|
+
const [activeTab, setActiveTab] = import_react14.default.useState("start");
|
|
7543
|
+
const handleStartChange = (date) => {
|
|
7544
|
+
if (!date) return;
|
|
7545
|
+
const newStart = date > endDate ? endDate : date;
|
|
7546
|
+
onChange?.({ startDate: newStart, endDate });
|
|
7398
7547
|
};
|
|
7399
|
-
const
|
|
7400
|
-
|
|
7401
|
-
const
|
|
7402
|
-
|
|
7403
|
-
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)("span", { className: "datepicker-range-label", children: label }),
|
|
7404
|
-
/* @__PURE__ */ (0, import_jsx_runtime314.jsxs)("div", { className: "datepicker-header", children: [
|
|
7405
|
-
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
7406
|
-
"button",
|
|
7407
|
-
{
|
|
7408
|
-
className: "datepicker-nav",
|
|
7409
|
-
onClick: cal.goToPrevMonth,
|
|
7410
|
-
type: "button",
|
|
7411
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(ChevronLeftIcon_default, {})
|
|
7412
|
-
}
|
|
7413
|
-
),
|
|
7414
|
-
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)("span", { className: "datepicker-title", children: locale === "ko" ? `${cal.year}\uB144 ${MONTH_LABELS.ko[cal.month]}` : `${MONTH_LABELS.en[cal.month]} ${cal.year}` }),
|
|
7415
|
-
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
7416
|
-
"button",
|
|
7417
|
-
{
|
|
7418
|
-
className: "datepicker-nav",
|
|
7419
|
-
onClick: cal.goToNextMonth,
|
|
7420
|
-
type: "button",
|
|
7421
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(ChevronRightIcon_default, {})
|
|
7422
|
-
}
|
|
7423
|
-
)
|
|
7424
|
-
] }),
|
|
7425
|
-
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)("div", { className: "datepicker-weekdays", children: weekdays.map((w, i) => /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
7426
|
-
"div",
|
|
7427
|
-
{
|
|
7428
|
-
className: clsx_default(
|
|
7429
|
-
"datepicker-weekday",
|
|
7430
|
-
i === 0 && "sunday",
|
|
7431
|
-
i === 6 && "saturday"
|
|
7432
|
-
),
|
|
7433
|
-
children: w
|
|
7434
|
-
},
|
|
7435
|
-
w
|
|
7436
|
-
)) }),
|
|
7437
|
-
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)("div", { className: "datepicker-grid", children: cal.days.map((day, idx) => {
|
|
7438
|
-
const disabled = isDisabled(day.date, type);
|
|
7439
|
-
const isStart = isSameDay(day.date, startDate);
|
|
7440
|
-
const isEnd = isSameDay(day.date, endDate);
|
|
7441
|
-
const inRange = isInRange(day.date, startDate, endDate);
|
|
7442
|
-
return /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
7443
|
-
RangeDayCell,
|
|
7444
|
-
{
|
|
7445
|
-
day,
|
|
7446
|
-
disabled,
|
|
7447
|
-
isStart,
|
|
7448
|
-
isEnd,
|
|
7449
|
-
inRange,
|
|
7450
|
-
onClick: () => {
|
|
7451
|
-
if (!disabled && day.isCurrentMonth) {
|
|
7452
|
-
if (type === "start") {
|
|
7453
|
-
const newStart = day.date > endDate ? endDate : day.date;
|
|
7454
|
-
onChange?.({ startDate: newStart, endDate });
|
|
7455
|
-
} else {
|
|
7456
|
-
const newEnd = day.date < startDate ? startDate : day.date;
|
|
7457
|
-
onChange?.({ startDate, endDate: newEnd });
|
|
7458
|
-
}
|
|
7459
|
-
}
|
|
7460
|
-
}
|
|
7461
|
-
},
|
|
7462
|
-
idx
|
|
7463
|
-
);
|
|
7464
|
-
}) })
|
|
7465
|
-
] });
|
|
7548
|
+
const handleEndChange = (date) => {
|
|
7549
|
+
if (!date) return;
|
|
7550
|
+
const newEnd = date < startDate ? startDate : date;
|
|
7551
|
+
onChange?.({ startDate, endDate: newEnd });
|
|
7466
7552
|
};
|
|
7467
|
-
|
|
7468
|
-
|
|
7469
|
-
|
|
7470
|
-
|
|
7471
|
-
|
|
7472
|
-
|
|
7473
|
-
|
|
7474
|
-
|
|
7475
|
-
|
|
7476
|
-
|
|
7477
|
-
|
|
7478
|
-
|
|
7479
|
-
|
|
7480
|
-
|
|
7481
|
-
|
|
7482
|
-
|
|
7483
|
-
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
|
|
7487
|
-
|
|
7488
|
-
|
|
7489
|
-
|
|
7490
|
-
|
|
7491
|
-
|
|
7492
|
-
|
|
7493
|
-
|
|
7494
|
-
|
|
7495
|
-
|
|
7496
|
-
|
|
7497
|
-
|
|
7498
|
-
|
|
7499
|
-
|
|
7553
|
+
const startMaxDate = maxDate && endDate < maxDate ? endDate : endDate;
|
|
7554
|
+
const endMinDate = minDate && startDate > minDate ? startDate : startDate;
|
|
7555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime316.jsxs)("div", { className: clsx_default("lib-xplat-datepicker", "range"), children: [
|
|
7556
|
+
/* @__PURE__ */ (0, import_jsx_runtime316.jsx)("div", { className: "datepicker-range-tabs", children: /* @__PURE__ */ (0, import_jsx_runtime316.jsx)(
|
|
7557
|
+
Tab_default,
|
|
7558
|
+
{
|
|
7559
|
+
activeIndex: activeTab === "start" ? 0 : 1,
|
|
7560
|
+
tabs: [
|
|
7561
|
+
{ value: "start", title: locale === "ko" ? "\uC2DC\uC791\uC77C" : "Start" },
|
|
7562
|
+
{ value: "end", title: locale === "ko" ? "\uC885\uB8CC\uC77C" : "End" }
|
|
7563
|
+
],
|
|
7564
|
+
onChange: (tab) => setActiveTab(tab.value),
|
|
7565
|
+
type: "toggle",
|
|
7566
|
+
size: "sm"
|
|
7567
|
+
}
|
|
7568
|
+
) }),
|
|
7569
|
+
/* @__PURE__ */ (0, import_jsx_runtime316.jsxs)("div", { className: "datepicker-range-panels", children: [
|
|
7570
|
+
/* @__PURE__ */ (0, import_jsx_runtime316.jsx)(
|
|
7571
|
+
SingleDatePicker_default,
|
|
7572
|
+
{
|
|
7573
|
+
value: startDate,
|
|
7574
|
+
onChange: handleStartChange,
|
|
7575
|
+
minDate,
|
|
7576
|
+
maxDate: startMaxDate,
|
|
7577
|
+
rangeStart: startDate,
|
|
7578
|
+
rangeEnd: endDate,
|
|
7579
|
+
locale
|
|
7580
|
+
}
|
|
7581
|
+
),
|
|
7582
|
+
/* @__PURE__ */ (0, import_jsx_runtime316.jsx)(
|
|
7583
|
+
SingleDatePicker_default,
|
|
7584
|
+
{
|
|
7585
|
+
value: endDate,
|
|
7586
|
+
onChange: handleEndChange,
|
|
7587
|
+
minDate: endMinDate,
|
|
7588
|
+
maxDate,
|
|
7589
|
+
rangeStart: startDate,
|
|
7590
|
+
rangeEnd: endDate,
|
|
7591
|
+
locale
|
|
7592
|
+
}
|
|
7593
|
+
)
|
|
7594
|
+
] }),
|
|
7595
|
+
/* @__PURE__ */ (0, import_jsx_runtime316.jsx)("div", { className: "datepicker-range-mobile", children: activeTab === "start" ? /* @__PURE__ */ (0, import_jsx_runtime316.jsx)(
|
|
7596
|
+
SingleDatePicker_default,
|
|
7597
|
+
{
|
|
7598
|
+
value: startDate,
|
|
7599
|
+
onChange: handleStartChange,
|
|
7600
|
+
minDate,
|
|
7601
|
+
maxDate: startMaxDate,
|
|
7602
|
+
rangeStart: startDate,
|
|
7603
|
+
rangeEnd: endDate,
|
|
7604
|
+
locale
|
|
7605
|
+
}
|
|
7606
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime316.jsx)(
|
|
7607
|
+
SingleDatePicker_default,
|
|
7608
|
+
{
|
|
7609
|
+
value: endDate,
|
|
7610
|
+
onChange: handleEndChange,
|
|
7611
|
+
minDate: endMinDate,
|
|
7612
|
+
maxDate,
|
|
7613
|
+
rangeStart: startDate,
|
|
7614
|
+
rangeEnd: endDate,
|
|
7615
|
+
locale
|
|
7616
|
+
}
|
|
7617
|
+
) })
|
|
7618
|
+
] });
|
|
7500
7619
|
};
|
|
7501
7620
|
RangePicker.displayName = "RangePicker";
|
|
7502
7621
|
var RangePicker_default = RangePicker;
|
|
7503
7622
|
|
|
7504
7623
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
7505
|
-
var
|
|
7624
|
+
var import_jsx_runtime317 = require("react/jsx-runtime");
|
|
7506
7625
|
var PopupPicker = (props) => {
|
|
7507
7626
|
const { component, type, locale } = props;
|
|
7508
|
-
const [isOpen, setIsOpen] =
|
|
7627
|
+
const [isOpen, setIsOpen] = import_react15.default.useState(false);
|
|
7509
7628
|
const handleClick = () => setIsOpen(true);
|
|
7510
7629
|
const handleClose = () => setIsOpen(false);
|
|
7511
7630
|
const handleSingleChange = (date) => {
|
|
@@ -7513,11 +7632,11 @@ var PopupPicker = (props) => {
|
|
|
7513
7632
|
props.onChange?.(date);
|
|
7514
7633
|
handleClose();
|
|
7515
7634
|
};
|
|
7516
|
-
return /* @__PURE__ */ (0,
|
|
7517
|
-
|
|
7518
|
-
/* @__PURE__ */ (0,
|
|
7519
|
-
/* @__PURE__ */ (0,
|
|
7520
|
-
type === "single" && /* @__PURE__ */ (0,
|
|
7635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime317.jsxs)("div", { className: "lib-xplat-popup-datepicker", children: [
|
|
7636
|
+
import_react15.default.cloneElement(component, { onClick: handleClick }),
|
|
7637
|
+
/* @__PURE__ */ (0, import_jsx_runtime317.jsx)(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ (0, import_jsx_runtime317.jsxs)("div", { className: clsx_default("lib-xplat-popup-datepicker-card", type === "range" && "range-mode"), children: [
|
|
7638
|
+
/* @__PURE__ */ (0, import_jsx_runtime317.jsxs)("div", { className: "popup-datepicker-content", children: [
|
|
7639
|
+
type === "single" && /* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
|
|
7521
7640
|
SingleDatePicker_default,
|
|
7522
7641
|
{
|
|
7523
7642
|
value: props.value,
|
|
@@ -7527,7 +7646,7 @@ var PopupPicker = (props) => {
|
|
|
7527
7646
|
locale
|
|
7528
7647
|
}
|
|
7529
7648
|
),
|
|
7530
|
-
type === "range" && /* @__PURE__ */ (0,
|
|
7649
|
+
type === "range" && /* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
|
|
7531
7650
|
RangePicker_default,
|
|
7532
7651
|
{
|
|
7533
7652
|
startDate: props.startDate,
|
|
@@ -7539,8 +7658,8 @@ var PopupPicker = (props) => {
|
|
|
7539
7658
|
}
|
|
7540
7659
|
)
|
|
7541
7660
|
] }),
|
|
7542
|
-
/* @__PURE__ */ (0,
|
|
7543
|
-
/* @__PURE__ */ (0,
|
|
7661
|
+
/* @__PURE__ */ (0, import_jsx_runtime317.jsxs)("div", { className: "popup-datepicker-footer", children: [
|
|
7662
|
+
/* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
|
|
7544
7663
|
Button_default,
|
|
7545
7664
|
{
|
|
7546
7665
|
type: "secondary",
|
|
@@ -7548,7 +7667,7 @@ var PopupPicker = (props) => {
|
|
|
7548
7667
|
children: locale === "ko" ? "\uCDE8\uC18C" : "Cancel"
|
|
7549
7668
|
}
|
|
7550
7669
|
),
|
|
7551
|
-
/* @__PURE__ */ (0,
|
|
7670
|
+
/* @__PURE__ */ (0, import_jsx_runtime317.jsx)(Button_default, { type: "primary", onClick: handleClose, children: locale === "ko" ? "\uC801\uC6A9" : "Apply" })
|
|
7552
7671
|
] })
|
|
7553
7672
|
] }) })
|
|
7554
7673
|
] });
|
|
@@ -7557,10 +7676,10 @@ PopupPicker.displayName = "PopupPicker";
|
|
|
7557
7676
|
var PopupPicker_default = PopupPicker;
|
|
7558
7677
|
|
|
7559
7678
|
// src/components/Divider/Divider.tsx
|
|
7560
|
-
var
|
|
7679
|
+
var import_jsx_runtime318 = require("react/jsx-runtime");
|
|
7561
7680
|
var Divider = (props) => {
|
|
7562
7681
|
const { orientation = "horizontal" } = props;
|
|
7563
|
-
return /* @__PURE__ */ (0,
|
|
7682
|
+
return /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
|
|
7564
7683
|
"div",
|
|
7565
7684
|
{
|
|
7566
7685
|
className: clsx_default("lib-xplat-divider", orientation),
|
|
@@ -7573,15 +7692,15 @@ Divider.displayName = "Divider";
|
|
|
7573
7692
|
var Divider_default = Divider;
|
|
7574
7693
|
|
|
7575
7694
|
// src/components/Drawer/Drawer.tsx
|
|
7576
|
-
var
|
|
7695
|
+
var import_react16 = __toESM(require("react"), 1);
|
|
7577
7696
|
var import_react_dom2 = require("react-dom");
|
|
7578
|
-
var
|
|
7697
|
+
var import_jsx_runtime319 = require("react/jsx-runtime");
|
|
7579
7698
|
var ANIMATION_DURATION_MS2 = 250;
|
|
7580
7699
|
var Drawer = (props) => {
|
|
7581
7700
|
const { isOpen, onClose, placement = "right", width = 320, title, children } = props;
|
|
7582
|
-
const [mounted, setMounted] =
|
|
7583
|
-
const [visible, setVisible] =
|
|
7584
|
-
|
|
7701
|
+
const [mounted, setMounted] = import_react16.default.useState(false);
|
|
7702
|
+
const [visible, setVisible] = import_react16.default.useState(false);
|
|
7703
|
+
import_react16.default.useEffect(() => {
|
|
7585
7704
|
if (isOpen) {
|
|
7586
7705
|
setMounted(true);
|
|
7587
7706
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -7596,12 +7715,12 @@ var Drawer = (props) => {
|
|
|
7596
7715
|
const stateClass = visible ? "enter" : "exit";
|
|
7597
7716
|
const widthValue = typeof width === "number" ? `${width}px` : width;
|
|
7598
7717
|
return (0, import_react_dom2.createPortal)(
|
|
7599
|
-
/* @__PURE__ */ (0,
|
|
7718
|
+
/* @__PURE__ */ (0, import_jsx_runtime319.jsx)(
|
|
7600
7719
|
"div",
|
|
7601
7720
|
{
|
|
7602
7721
|
className: clsx_default("lib-xplat-drawer-overlay", stateClass),
|
|
7603
7722
|
onClick: onClose,
|
|
7604
|
-
children: /* @__PURE__ */ (0,
|
|
7723
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime319.jsxs)(
|
|
7605
7724
|
"div",
|
|
7606
7725
|
{
|
|
7607
7726
|
className: clsx_default("lib-xplat-drawer", placement, stateClass),
|
|
@@ -7610,11 +7729,11 @@ var Drawer = (props) => {
|
|
|
7610
7729
|
"aria-modal": "true",
|
|
7611
7730
|
onClick: (e) => e.stopPropagation(),
|
|
7612
7731
|
children: [
|
|
7613
|
-
title && /* @__PURE__ */ (0,
|
|
7614
|
-
/* @__PURE__ */ (0,
|
|
7615
|
-
/* @__PURE__ */ (0,
|
|
7732
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime319.jsxs)("div", { className: "drawer-header", children: [
|
|
7733
|
+
/* @__PURE__ */ (0, import_jsx_runtime319.jsx)("span", { className: "drawer-title", children: title }),
|
|
7734
|
+
/* @__PURE__ */ (0, import_jsx_runtime319.jsx)("button", { className: "close-btn", onClick: onClose, "aria-label": "\uB2EB\uAE30", children: "\xD7" })
|
|
7616
7735
|
] }),
|
|
7617
|
-
/* @__PURE__ */ (0,
|
|
7736
|
+
/* @__PURE__ */ (0, import_jsx_runtime319.jsx)("div", { className: "drawer-body", children })
|
|
7618
7737
|
]
|
|
7619
7738
|
}
|
|
7620
7739
|
)
|
|
@@ -7627,16 +7746,16 @@ Drawer.displayName = "Drawer";
|
|
|
7627
7746
|
var Drawer_default = Drawer;
|
|
7628
7747
|
|
|
7629
7748
|
// src/components/Dropdown/Dropdown.tsx
|
|
7630
|
-
var
|
|
7749
|
+
var import_react19 = __toESM(require("react"), 1);
|
|
7631
7750
|
|
|
7632
7751
|
// src/tokens/hooks/useAutoPosition.ts
|
|
7633
|
-
var
|
|
7752
|
+
var import_react17 = __toESM(require("react"), 1);
|
|
7634
7753
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
7635
|
-
const [position, setPosition] =
|
|
7754
|
+
const [position, setPosition] = import_react17.default.useState({
|
|
7636
7755
|
position: {},
|
|
7637
7756
|
direction: "bottom"
|
|
7638
7757
|
});
|
|
7639
|
-
const calculatePosition =
|
|
7758
|
+
const calculatePosition = import_react17.default.useCallback(() => {
|
|
7640
7759
|
if (!triggerRef.current || !popRef.current) return;
|
|
7641
7760
|
const triggerRect = triggerRef.current.getBoundingClientRect();
|
|
7642
7761
|
const popRect = popRef.current.getBoundingClientRect();
|
|
@@ -7658,7 +7777,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
7658
7777
|
direction
|
|
7659
7778
|
});
|
|
7660
7779
|
}, [triggerRef, popRef]);
|
|
7661
|
-
|
|
7780
|
+
import_react17.default.useEffect(() => {
|
|
7662
7781
|
calculatePosition();
|
|
7663
7782
|
window.addEventListener("resize", calculatePosition);
|
|
7664
7783
|
return () => window.removeEventListener("resize", calculatePosition);
|
|
@@ -7667,18 +7786,43 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
7667
7786
|
};
|
|
7668
7787
|
var useAutoPosition_default = useAutoPosition;
|
|
7669
7788
|
|
|
7789
|
+
// src/tokens/hooks/useClickOutside.ts
|
|
7790
|
+
var import_react18 = __toESM(require("react"), 1);
|
|
7791
|
+
var useClickOutside = (refs, handler, enabled = true) => {
|
|
7792
|
+
import_react18.default.useEffect(() => {
|
|
7793
|
+
if (!enabled) return;
|
|
7794
|
+
const refArray = Array.isArray(refs) ? refs : [refs];
|
|
7795
|
+
const listener = (event) => {
|
|
7796
|
+
const target = event.target;
|
|
7797
|
+
const isInside = refArray.some(
|
|
7798
|
+
(ref) => ref.current && ref.current.contains(target)
|
|
7799
|
+
);
|
|
7800
|
+
if (!isInside) {
|
|
7801
|
+
handler();
|
|
7802
|
+
}
|
|
7803
|
+
};
|
|
7804
|
+
document.addEventListener("mousedown", listener);
|
|
7805
|
+
document.addEventListener("touchstart", listener);
|
|
7806
|
+
return () => {
|
|
7807
|
+
document.removeEventListener("mousedown", listener);
|
|
7808
|
+
document.removeEventListener("touchstart", listener);
|
|
7809
|
+
};
|
|
7810
|
+
}, [refs, handler, enabled]);
|
|
7811
|
+
};
|
|
7812
|
+
var useClickOutside_default = useClickOutside;
|
|
7813
|
+
|
|
7670
7814
|
// src/components/Dropdown/Dropdown.tsx
|
|
7671
|
-
var
|
|
7815
|
+
var import_jsx_runtime320 = require("react/jsx-runtime");
|
|
7672
7816
|
var Dropdown = (props) => {
|
|
7673
7817
|
const { items, children } = props;
|
|
7674
|
-
const [isOpen, setIsOpen] =
|
|
7675
|
-
const [mounted, setMounted] =
|
|
7676
|
-
const [visible, setVisible] =
|
|
7677
|
-
const triggerRef =
|
|
7678
|
-
const menuRef =
|
|
7818
|
+
const [isOpen, setIsOpen] = import_react19.default.useState(false);
|
|
7819
|
+
const [mounted, setMounted] = import_react19.default.useState(false);
|
|
7820
|
+
const [visible, setVisible] = import_react19.default.useState(false);
|
|
7821
|
+
const triggerRef = import_react19.default.useRef(null);
|
|
7822
|
+
const menuRef = import_react19.default.useRef(null);
|
|
7679
7823
|
const { position, direction } = useAutoPosition_default(triggerRef, menuRef, isOpen);
|
|
7680
7824
|
useClickOutside_default([triggerRef, menuRef], () => setIsOpen(false));
|
|
7681
|
-
|
|
7825
|
+
import_react19.default.useEffect(() => {
|
|
7682
7826
|
if (isOpen) {
|
|
7683
7827
|
setMounted(true);
|
|
7684
7828
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -7693,8 +7837,8 @@ var Dropdown = (props) => {
|
|
|
7693
7837
|
item.onClick?.();
|
|
7694
7838
|
setIsOpen(false);
|
|
7695
7839
|
};
|
|
7696
|
-
return /* @__PURE__ */ (0,
|
|
7697
|
-
/* @__PURE__ */ (0,
|
|
7840
|
+
return /* @__PURE__ */ (0, import_jsx_runtime320.jsxs)("div", { className: "lib-xplat-dropdown", children: [
|
|
7841
|
+
/* @__PURE__ */ (0, import_jsx_runtime320.jsx)(
|
|
7698
7842
|
"div",
|
|
7699
7843
|
{
|
|
7700
7844
|
ref: triggerRef,
|
|
@@ -7703,14 +7847,14 @@ var Dropdown = (props) => {
|
|
|
7703
7847
|
children
|
|
7704
7848
|
}
|
|
7705
7849
|
),
|
|
7706
|
-
mounted && /* @__PURE__ */ (0,
|
|
7850
|
+
mounted && /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(
|
|
7707
7851
|
"div",
|
|
7708
7852
|
{
|
|
7709
7853
|
ref: menuRef,
|
|
7710
7854
|
className: clsx_default("dropdown-menu", direction, { visible }),
|
|
7711
7855
|
style: { top: position.top, left: position.left },
|
|
7712
7856
|
role: "menu",
|
|
7713
|
-
children: items.map((item) => /* @__PURE__ */ (0,
|
|
7857
|
+
children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(
|
|
7714
7858
|
"button",
|
|
7715
7859
|
{
|
|
7716
7860
|
className: clsx_default("dropdown-item", {
|
|
@@ -7732,23 +7876,23 @@ Dropdown.displayName = "Dropdown";
|
|
|
7732
7876
|
var Dropdown_default = Dropdown;
|
|
7733
7877
|
|
|
7734
7878
|
// src/components/EmptyState/EmptyState.tsx
|
|
7735
|
-
var
|
|
7879
|
+
var import_jsx_runtime321 = require("react/jsx-runtime");
|
|
7736
7880
|
var EmptyState = (props) => {
|
|
7737
7881
|
const { icon, title = "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4", description, action } = props;
|
|
7738
|
-
return /* @__PURE__ */ (0,
|
|
7739
|
-
icon && /* @__PURE__ */ (0,
|
|
7740
|
-
!icon && /* @__PURE__ */ (0,
|
|
7741
|
-
/* @__PURE__ */ (0,
|
|
7742
|
-
description && /* @__PURE__ */ (0,
|
|
7743
|
-
action && /* @__PURE__ */ (0,
|
|
7882
|
+
return /* @__PURE__ */ (0, import_jsx_runtime321.jsxs)("div", { className: "lib-xplat-empty-state", children: [
|
|
7883
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime321.jsx)("div", { className: "empty-icon", children: icon }),
|
|
7884
|
+
!icon && /* @__PURE__ */ (0, import_jsx_runtime321.jsx)("div", { className: "empty-icon", children: /* @__PURE__ */ (0, import_jsx_runtime321.jsx)("svg", { viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime321.jsx)("path", { d: "M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z" }) }) }),
|
|
7885
|
+
/* @__PURE__ */ (0, import_jsx_runtime321.jsx)("p", { className: "empty-title", children: title }),
|
|
7886
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime321.jsx)("p", { className: "empty-description", children: description }),
|
|
7887
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime321.jsx)("div", { className: "empty-action", children: action })
|
|
7744
7888
|
] });
|
|
7745
7889
|
};
|
|
7746
7890
|
EmptyState.displayName = "EmptyState";
|
|
7747
7891
|
var EmptyState_default = EmptyState;
|
|
7748
7892
|
|
|
7749
7893
|
// src/components/FileUpload/FileUpload.tsx
|
|
7750
|
-
var
|
|
7751
|
-
var
|
|
7894
|
+
var import_react20 = __toESM(require("react"), 1);
|
|
7895
|
+
var import_jsx_runtime322 = require("react/jsx-runtime");
|
|
7752
7896
|
var FileUpload = (props) => {
|
|
7753
7897
|
const {
|
|
7754
7898
|
accept,
|
|
@@ -7758,8 +7902,8 @@ var FileUpload = (props) => {
|
|
|
7758
7902
|
label = "\uD30C\uC77C\uC744 \uB4DC\uB798\uADF8\uD558\uAC70\uB098 \uD074\uB9AD\uD558\uC5EC \uC5C5\uB85C\uB4DC",
|
|
7759
7903
|
description
|
|
7760
7904
|
} = props;
|
|
7761
|
-
const [isDragOver, setIsDragOver] =
|
|
7762
|
-
const inputRef =
|
|
7905
|
+
const [isDragOver, setIsDragOver] = import_react20.default.useState(false);
|
|
7906
|
+
const inputRef = import_react20.default.useRef(null);
|
|
7763
7907
|
const handleFiles = (fileList) => {
|
|
7764
7908
|
let files = Array.from(fileList);
|
|
7765
7909
|
if (maxSize) {
|
|
@@ -7789,7 +7933,7 @@ var FileUpload = (props) => {
|
|
|
7789
7933
|
handleFiles(e.target.files);
|
|
7790
7934
|
}
|
|
7791
7935
|
};
|
|
7792
|
-
return /* @__PURE__ */ (0,
|
|
7936
|
+
return /* @__PURE__ */ (0, import_jsx_runtime322.jsxs)(
|
|
7793
7937
|
"div",
|
|
7794
7938
|
{
|
|
7795
7939
|
className: clsx_default("lib-xplat-file-upload", { "drag-over": isDragOver }),
|
|
@@ -7798,7 +7942,7 @@ var FileUpload = (props) => {
|
|
|
7798
7942
|
onDragLeave: handleDragLeave,
|
|
7799
7943
|
onClick: () => inputRef.current?.click(),
|
|
7800
7944
|
children: [
|
|
7801
|
-
/* @__PURE__ */ (0,
|
|
7945
|
+
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)(
|
|
7802
7946
|
"input",
|
|
7803
7947
|
{
|
|
7804
7948
|
ref: inputRef,
|
|
@@ -7808,9 +7952,9 @@ var FileUpload = (props) => {
|
|
|
7808
7952
|
onChange: handleChange
|
|
7809
7953
|
}
|
|
7810
7954
|
),
|
|
7811
|
-
/* @__PURE__ */ (0,
|
|
7812
|
-
/* @__PURE__ */ (0,
|
|
7813
|
-
description && /* @__PURE__ */ (0,
|
|
7955
|
+
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)("div", { className: "upload-icon", children: /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(UploadIcon_default, {}) }),
|
|
7956
|
+
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)("p", { className: "upload-label", children: label }),
|
|
7957
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime322.jsx)("p", { className: "upload-description", children: description })
|
|
7814
7958
|
]
|
|
7815
7959
|
}
|
|
7816
7960
|
);
|
|
@@ -7819,10 +7963,10 @@ FileUpload.displayName = "FileUpload";
|
|
|
7819
7963
|
var FileUpload_default = FileUpload;
|
|
7820
7964
|
|
|
7821
7965
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
7822
|
-
var
|
|
7966
|
+
var import_react22 = __toESM(require("react"), 1);
|
|
7823
7967
|
|
|
7824
7968
|
// src/components/HtmlTypeWriter/utils.ts
|
|
7825
|
-
var
|
|
7969
|
+
var import_react21 = __toESM(require("react"), 1);
|
|
7826
7970
|
var voidTags = /* @__PURE__ */ new Set([
|
|
7827
7971
|
"br",
|
|
7828
7972
|
"img",
|
|
@@ -7890,41 +8034,41 @@ var convertNodeToReactWithRange = (node, typedLen, rangeMap) => {
|
|
|
7890
8034
|
props[attr.name] = attr.value;
|
|
7891
8035
|
});
|
|
7892
8036
|
if (voidTags.has(tag)) {
|
|
7893
|
-
return
|
|
8037
|
+
return import_react21.default.createElement(tag, props);
|
|
7894
8038
|
}
|
|
7895
8039
|
const children = Array.from(element.childNodes).map((child) => convertNodeToReactWithRange(child, typedLen, rangeMap)).filter((n) => n != null);
|
|
7896
|
-
return
|
|
8040
|
+
return import_react21.default.createElement(tag, props, ...children);
|
|
7897
8041
|
};
|
|
7898
8042
|
var htmlToReactProgressive = (root, typedLen, rangeMap) => {
|
|
7899
8043
|
const nodes = Array.from(root.childNodes).map((child, idx) => {
|
|
7900
8044
|
const node = convertNodeToReactWithRange(child, typedLen, rangeMap);
|
|
7901
|
-
return node == null ? null :
|
|
8045
|
+
return node == null ? null : import_react21.default.createElement(import_react21.default.Fragment, { key: idx }, node);
|
|
7902
8046
|
}).filter(Boolean);
|
|
7903
8047
|
return nodes.length === 0 ? null : nodes;
|
|
7904
8048
|
};
|
|
7905
8049
|
|
|
7906
8050
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
7907
|
-
var
|
|
8051
|
+
var import_jsx_runtime323 = require("react/jsx-runtime");
|
|
7908
8052
|
var HtmlTypeWriter = ({
|
|
7909
8053
|
html,
|
|
7910
8054
|
duration = 20,
|
|
7911
8055
|
onDone,
|
|
7912
8056
|
onChange
|
|
7913
8057
|
}) => {
|
|
7914
|
-
const [typedLen, setTypedLen] =
|
|
7915
|
-
const doneCalledRef =
|
|
7916
|
-
const { doc, rangeMap, totalLength } =
|
|
8058
|
+
const [typedLen, setTypedLen] = import_react22.default.useState(0);
|
|
8059
|
+
const doneCalledRef = import_react22.default.useRef(false);
|
|
8060
|
+
const { doc, rangeMap, totalLength } = import_react22.default.useMemo(() => {
|
|
7917
8061
|
if (typeof window === "undefined") return { doc: null, rangeMap: /* @__PURE__ */ new Map(), totalLength: 0 };
|
|
7918
8062
|
const decoded = decodeHtmlEntities(html);
|
|
7919
8063
|
const doc2 = new DOMParser().parseFromString(decoded, "text/html");
|
|
7920
8064
|
const { rangeMap: rangeMap2, totalLength: totalLength2 } = buildRangeMap(doc2.body);
|
|
7921
8065
|
return { doc: doc2, rangeMap: rangeMap2, totalLength: totalLength2 };
|
|
7922
8066
|
}, [html]);
|
|
7923
|
-
|
|
8067
|
+
import_react22.default.useEffect(() => {
|
|
7924
8068
|
setTypedLen(0);
|
|
7925
8069
|
doneCalledRef.current = false;
|
|
7926
8070
|
}, [html]);
|
|
7927
|
-
|
|
8071
|
+
import_react22.default.useEffect(() => {
|
|
7928
8072
|
if (!totalLength) return;
|
|
7929
8073
|
if (typedLen >= totalLength) return;
|
|
7930
8074
|
const timer = window.setInterval(() => {
|
|
@@ -7932,33 +8076,33 @@ var HtmlTypeWriter = ({
|
|
|
7932
8076
|
}, duration);
|
|
7933
8077
|
return () => window.clearInterval(timer);
|
|
7934
8078
|
}, [typedLen, totalLength, duration]);
|
|
7935
|
-
|
|
8079
|
+
import_react22.default.useEffect(() => {
|
|
7936
8080
|
if (typedLen > 0 && typedLen < totalLength) {
|
|
7937
8081
|
onChange?.();
|
|
7938
8082
|
}
|
|
7939
8083
|
}, [typedLen, totalLength, onChange]);
|
|
7940
|
-
|
|
8084
|
+
import_react22.default.useEffect(() => {
|
|
7941
8085
|
if (typedLen === totalLength && totalLength > 0 && !doneCalledRef.current) {
|
|
7942
8086
|
doneCalledRef.current = true;
|
|
7943
8087
|
onDone?.();
|
|
7944
8088
|
}
|
|
7945
8089
|
}, [typedLen, totalLength, onDone]);
|
|
7946
|
-
const parsed =
|
|
8090
|
+
const parsed = import_react22.default.useMemo(
|
|
7947
8091
|
() => doc ? htmlToReactProgressive(doc.body, typedLen, rangeMap) : null,
|
|
7948
8092
|
[doc, typedLen, rangeMap]
|
|
7949
8093
|
);
|
|
7950
|
-
return /* @__PURE__ */ (0,
|
|
8094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime323.jsx)("div", { className: "lib-xplat-htmlTypewriter", children: parsed });
|
|
7951
8095
|
};
|
|
7952
8096
|
HtmlTypeWriter.displayName = "HtmlTypeWriter";
|
|
7953
8097
|
var HtmlTypeWriter_default = HtmlTypeWriter;
|
|
7954
8098
|
|
|
7955
8099
|
// src/components/ImageSelector/ImageSelector.tsx
|
|
7956
|
-
var
|
|
7957
|
-
var
|
|
8100
|
+
var import_react23 = __toESM(require("react"), 1);
|
|
8101
|
+
var import_jsx_runtime324 = require("react/jsx-runtime");
|
|
7958
8102
|
var ImageSelector = (props) => {
|
|
7959
8103
|
const { value, label, onChange } = props;
|
|
7960
|
-
const [previewUrl, setPreviewUrl] =
|
|
7961
|
-
|
|
8104
|
+
const [previewUrl, setPreviewUrl] = import_react23.default.useState();
|
|
8105
|
+
import_react23.default.useEffect(() => {
|
|
7962
8106
|
if (!value) {
|
|
7963
8107
|
setPreviewUrl(void 0);
|
|
7964
8108
|
return;
|
|
@@ -7967,7 +8111,7 @@ var ImageSelector = (props) => {
|
|
|
7967
8111
|
setPreviewUrl(url);
|
|
7968
8112
|
return () => URL.revokeObjectURL(url);
|
|
7969
8113
|
}, [value]);
|
|
7970
|
-
const inputRef =
|
|
8114
|
+
const inputRef = import_react23.default.useRef(null);
|
|
7971
8115
|
const handleFileChange = (e) => {
|
|
7972
8116
|
const selectedFile = e.target.files?.[0];
|
|
7973
8117
|
if (selectedFile) {
|
|
@@ -7980,8 +8124,8 @@ var ImageSelector = (props) => {
|
|
|
7980
8124
|
const handleOpenFileDialog = () => {
|
|
7981
8125
|
inputRef.current?.click();
|
|
7982
8126
|
};
|
|
7983
|
-
return /* @__PURE__ */ (0,
|
|
7984
|
-
/* @__PURE__ */ (0,
|
|
8127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime324.jsxs)("div", { className: `lib-xplat-imageselector${value ? "" : " none-value"}`, children: [
|
|
8128
|
+
/* @__PURE__ */ (0, import_jsx_runtime324.jsx)(
|
|
7985
8129
|
"input",
|
|
7986
8130
|
{
|
|
7987
8131
|
type: "file",
|
|
@@ -7991,13 +8135,13 @@ var ImageSelector = (props) => {
|
|
|
7991
8135
|
ref: inputRef
|
|
7992
8136
|
}
|
|
7993
8137
|
),
|
|
7994
|
-
value && /* @__PURE__ */ (0,
|
|
7995
|
-
/* @__PURE__ */ (0,
|
|
7996
|
-
/* @__PURE__ */ (0,
|
|
8138
|
+
value && /* @__PURE__ */ (0, import_jsx_runtime324.jsxs)("div", { className: "action-bar", children: [
|
|
8139
|
+
/* @__PURE__ */ (0, import_jsx_runtime324.jsx)("div", { className: "icon-wrapper", onClick: handleOpenFileDialog, children: /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(UploadIcon_default, {}) }),
|
|
8140
|
+
/* @__PURE__ */ (0, import_jsx_runtime324.jsx)("div", { className: "icon-wrapper", onClick: handleDeleteFile, children: /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(DeleteIcon_default, {}) })
|
|
7997
8141
|
] }),
|
|
7998
|
-
/* @__PURE__ */ (0,
|
|
7999
|
-
/* @__PURE__ */ (0,
|
|
8000
|
-
/* @__PURE__ */ (0,
|
|
8142
|
+
/* @__PURE__ */ (0, import_jsx_runtime324.jsx)("div", { className: "content", children: previewUrl ? /* @__PURE__ */ (0, import_jsx_runtime324.jsx)("img", { src: previewUrl, alt: "preview" }) : /* @__PURE__ */ (0, import_jsx_runtime324.jsxs)("div", { className: "skeleton", onClick: handleOpenFileDialog, children: [
|
|
8143
|
+
/* @__PURE__ */ (0, import_jsx_runtime324.jsx)("div", { className: "icon-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(ImageIcon_default, {}) }),
|
|
8144
|
+
/* @__PURE__ */ (0, import_jsx_runtime324.jsx)("div", { className: "label", children: label || "\uC774\uBBF8\uC9C0 \uCD94\uAC00\uD558\uAE30" })
|
|
8001
8145
|
] }) })
|
|
8002
8146
|
] });
|
|
8003
8147
|
};
|
|
@@ -8005,7 +8149,7 @@ ImageSelector.displayName = "ImageSelector";
|
|
|
8005
8149
|
var ImageSelector_default = ImageSelector;
|
|
8006
8150
|
|
|
8007
8151
|
// src/components/Pagination/Pagination.tsx
|
|
8008
|
-
var
|
|
8152
|
+
var import_jsx_runtime325 = require("react/jsx-runtime");
|
|
8009
8153
|
var getPageRange = (current, totalPages, siblingCount) => {
|
|
8010
8154
|
const totalNumbers = siblingCount * 2 + 5;
|
|
8011
8155
|
if (totalPages <= totalNumbers) {
|
|
@@ -8048,19 +8192,19 @@ var Pagination = (props) => {
|
|
|
8048
8192
|
onChange?.(page);
|
|
8049
8193
|
}
|
|
8050
8194
|
};
|
|
8051
|
-
return /* @__PURE__ */ (0,
|
|
8052
|
-
/* @__PURE__ */ (0,
|
|
8195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime325.jsxs)("nav", { className: clsx_default("lib-xplat-pagination", size, type), "aria-label": "\uD398\uC774\uC9C0 \uB124\uBE44\uAC8C\uC774\uC158", children: [
|
|
8196
|
+
/* @__PURE__ */ (0, import_jsx_runtime325.jsx)(
|
|
8053
8197
|
"button",
|
|
8054
8198
|
{
|
|
8055
8199
|
className: "page-btn prev",
|
|
8056
8200
|
disabled: current <= 1,
|
|
8057
8201
|
onClick: () => handleClick(current - 1),
|
|
8058
8202
|
"aria-label": "\uC774\uC804 \uD398\uC774\uC9C0",
|
|
8059
|
-
children: /* @__PURE__ */ (0,
|
|
8203
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime325.jsx)(ChevronLeftIcon_default, {})
|
|
8060
8204
|
}
|
|
8061
8205
|
),
|
|
8062
8206
|
pages.map(
|
|
8063
|
-
(page, i) => page === "..." ? /* @__PURE__ */ (0,
|
|
8207
|
+
(page, i) => page === "..." ? /* @__PURE__ */ (0, import_jsx_runtime325.jsx)("span", { className: "dots", children: "..." }, `dots-${i}`) : /* @__PURE__ */ (0, import_jsx_runtime325.jsx)(
|
|
8064
8208
|
"button",
|
|
8065
8209
|
{
|
|
8066
8210
|
className: clsx_default("page-btn", { active: page === current }),
|
|
@@ -8071,14 +8215,14 @@ var Pagination = (props) => {
|
|
|
8071
8215
|
page
|
|
8072
8216
|
)
|
|
8073
8217
|
),
|
|
8074
|
-
/* @__PURE__ */ (0,
|
|
8218
|
+
/* @__PURE__ */ (0, import_jsx_runtime325.jsx)(
|
|
8075
8219
|
"button",
|
|
8076
8220
|
{
|
|
8077
8221
|
className: "page-btn next",
|
|
8078
8222
|
disabled: current >= totalPages,
|
|
8079
8223
|
onClick: () => handleClick(current + 1),
|
|
8080
8224
|
"aria-label": "\uB2E4\uC74C \uD398\uC774\uC9C0",
|
|
8081
|
-
children: /* @__PURE__ */ (0,
|
|
8225
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime325.jsx)(ChevronRightIcon_default, {})
|
|
8082
8226
|
}
|
|
8083
8227
|
)
|
|
8084
8228
|
] });
|
|
@@ -8087,17 +8231,17 @@ Pagination.displayName = "Pagination";
|
|
|
8087
8231
|
var Pagination_default = Pagination;
|
|
8088
8232
|
|
|
8089
8233
|
// src/components/PopOver/PopOver.tsx
|
|
8090
|
-
var
|
|
8091
|
-
var
|
|
8234
|
+
var import_react24 = __toESM(require("react"), 1);
|
|
8235
|
+
var import_jsx_runtime326 = require("react/jsx-runtime");
|
|
8092
8236
|
var PopOver = (props) => {
|
|
8093
8237
|
const { children, isOpen, onClose, PopOverEl } = props;
|
|
8094
|
-
const popRef =
|
|
8095
|
-
const triggerRef =
|
|
8096
|
-
const [localOpen, setLocalOpen] =
|
|
8097
|
-
const [eventTrigger, setEventTrigger] =
|
|
8238
|
+
const popRef = import_react24.default.useRef(null);
|
|
8239
|
+
const triggerRef = import_react24.default.useRef(null);
|
|
8240
|
+
const [localOpen, setLocalOpen] = import_react24.default.useState(false);
|
|
8241
|
+
const [eventTrigger, setEventTrigger] = import_react24.default.useState(false);
|
|
8098
8242
|
useClickOutside_default([popRef, triggerRef], onClose, isOpen);
|
|
8099
8243
|
const position = useAutoPosition_default(triggerRef, popRef, localOpen);
|
|
8100
|
-
|
|
8244
|
+
import_react24.default.useEffect(() => {
|
|
8101
8245
|
if (isOpen) {
|
|
8102
8246
|
setLocalOpen(isOpen);
|
|
8103
8247
|
setTimeout(() => {
|
|
@@ -8110,7 +8254,7 @@ var PopOver = (props) => {
|
|
|
8110
8254
|
}, 200);
|
|
8111
8255
|
}
|
|
8112
8256
|
}, [isOpen]);
|
|
8113
|
-
return /* @__PURE__ */ (0,
|
|
8257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime326.jsxs)(
|
|
8114
8258
|
"div",
|
|
8115
8259
|
{
|
|
8116
8260
|
className: "lib-xplat-pop-over",
|
|
@@ -8120,7 +8264,7 @@ var PopOver = (props) => {
|
|
|
8120
8264
|
},
|
|
8121
8265
|
children: [
|
|
8122
8266
|
children,
|
|
8123
|
-
localOpen && /* @__PURE__ */ (0,
|
|
8267
|
+
localOpen && /* @__PURE__ */ (0, import_jsx_runtime326.jsx)(
|
|
8124
8268
|
"div",
|
|
8125
8269
|
{
|
|
8126
8270
|
className: clsx_default(
|
|
@@ -8143,7 +8287,7 @@ PopOver.displayName = "PopOver";
|
|
|
8143
8287
|
var PopOver_default = PopOver;
|
|
8144
8288
|
|
|
8145
8289
|
// src/components/Progress/Progress.tsx
|
|
8146
|
-
var
|
|
8290
|
+
var import_jsx_runtime327 = require("react/jsx-runtime");
|
|
8147
8291
|
var Progress = (props) => {
|
|
8148
8292
|
const {
|
|
8149
8293
|
value,
|
|
@@ -8153,8 +8297,8 @@ var Progress = (props) => {
|
|
|
8153
8297
|
showLabel = false
|
|
8154
8298
|
} = props;
|
|
8155
8299
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
8156
|
-
return /* @__PURE__ */ (0,
|
|
8157
|
-
/* @__PURE__ */ (0,
|
|
8300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime327.jsxs)("div", { className: clsx_default("lib-xplat-progress", size, type), children: [
|
|
8301
|
+
/* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
|
|
8158
8302
|
"div",
|
|
8159
8303
|
{
|
|
8160
8304
|
className: "track",
|
|
@@ -8162,7 +8306,7 @@ var Progress = (props) => {
|
|
|
8162
8306
|
"aria-valuenow": value,
|
|
8163
8307
|
"aria-valuemin": 0,
|
|
8164
8308
|
"aria-valuemax": max,
|
|
8165
|
-
children: /* @__PURE__ */ (0,
|
|
8309
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
|
|
8166
8310
|
"div",
|
|
8167
8311
|
{
|
|
8168
8312
|
className: "bar",
|
|
@@ -8171,7 +8315,7 @@ var Progress = (props) => {
|
|
|
8171
8315
|
)
|
|
8172
8316
|
}
|
|
8173
8317
|
),
|
|
8174
|
-
showLabel && /* @__PURE__ */ (0,
|
|
8318
|
+
showLabel && /* @__PURE__ */ (0, import_jsx_runtime327.jsxs)("span", { className: "label", children: [
|
|
8175
8319
|
Math.round(percentage),
|
|
8176
8320
|
"%"
|
|
8177
8321
|
] })
|
|
@@ -8181,17 +8325,17 @@ Progress.displayName = "Progress";
|
|
|
8181
8325
|
var Progress_default = Progress;
|
|
8182
8326
|
|
|
8183
8327
|
// src/components/Radio/RadioGroupContext.tsx
|
|
8184
|
-
var
|
|
8185
|
-
var RadioGroupContext =
|
|
8328
|
+
var import_react25 = __toESM(require("react"), 1);
|
|
8329
|
+
var RadioGroupContext = import_react25.default.createContext(
|
|
8186
8330
|
null
|
|
8187
8331
|
);
|
|
8188
8332
|
var useRadioGroupContext = () => {
|
|
8189
|
-
return
|
|
8333
|
+
return import_react25.default.useContext(RadioGroupContext);
|
|
8190
8334
|
};
|
|
8191
8335
|
var RadioGroupContext_default = RadioGroupContext;
|
|
8192
8336
|
|
|
8193
8337
|
// src/components/Radio/Radio.tsx
|
|
8194
|
-
var
|
|
8338
|
+
var import_jsx_runtime328 = require("react/jsx-runtime");
|
|
8195
8339
|
var Radio = (props) => {
|
|
8196
8340
|
const {
|
|
8197
8341
|
label,
|
|
@@ -8209,7 +8353,7 @@ var Radio = (props) => {
|
|
|
8209
8353
|
value,
|
|
8210
8354
|
onChange: rest.onChange
|
|
8211
8355
|
};
|
|
8212
|
-
return /* @__PURE__ */ (0,
|
|
8356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime328.jsxs)(
|
|
8213
8357
|
"label",
|
|
8214
8358
|
{
|
|
8215
8359
|
className: clsx_default(
|
|
@@ -8219,18 +8363,18 @@ var Radio = (props) => {
|
|
|
8219
8363
|
localChecked ? "checked" : void 0
|
|
8220
8364
|
),
|
|
8221
8365
|
children: [
|
|
8222
|
-
/* @__PURE__ */ (0,
|
|
8223
|
-
/* @__PURE__ */ (0,
|
|
8366
|
+
/* @__PURE__ */ (0, import_jsx_runtime328.jsx)("input", { ...rest, ...inputProps, checked: localChecked, type: "radio" }),
|
|
8367
|
+
/* @__PURE__ */ (0, import_jsx_runtime328.jsx)(
|
|
8224
8368
|
"div",
|
|
8225
8369
|
{
|
|
8226
8370
|
className: clsx_default(
|
|
8227
8371
|
"circle",
|
|
8228
8372
|
localChecked ? "checked" : void 0
|
|
8229
8373
|
),
|
|
8230
|
-
children: localChecked && /* @__PURE__ */ (0,
|
|
8374
|
+
children: localChecked && /* @__PURE__ */ (0, import_jsx_runtime328.jsx)("div", { className: "inner-circle" })
|
|
8231
8375
|
}
|
|
8232
8376
|
),
|
|
8233
|
-
label && /* @__PURE__ */ (0,
|
|
8377
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime328.jsx)("span", { children: label })
|
|
8234
8378
|
]
|
|
8235
8379
|
}
|
|
8236
8380
|
);
|
|
@@ -8239,28 +8383,28 @@ Radio.displayName = "Radio";
|
|
|
8239
8383
|
var Radio_default = Radio;
|
|
8240
8384
|
|
|
8241
8385
|
// src/components/Radio/RadioGroup.tsx
|
|
8242
|
-
var
|
|
8386
|
+
var import_jsx_runtime329 = require("react/jsx-runtime");
|
|
8243
8387
|
var RadioGroup = (props) => {
|
|
8244
8388
|
const { children, ...rest } = props;
|
|
8245
|
-
return /* @__PURE__ */ (0,
|
|
8389
|
+
return /* @__PURE__ */ (0, import_jsx_runtime329.jsx)(import_jsx_runtime329.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime329.jsx)(RadioGroupContext_default.Provider, { value: rest, children }) });
|
|
8246
8390
|
};
|
|
8247
8391
|
RadioGroup.displayName = "RadioGroup";
|
|
8248
8392
|
var RadioGroup_default = RadioGroup;
|
|
8249
8393
|
|
|
8250
8394
|
// src/components/Select/Select.tsx
|
|
8251
|
-
var
|
|
8395
|
+
var import_react28 = __toESM(require("react"), 1);
|
|
8252
8396
|
|
|
8253
8397
|
// src/components/Select/context.ts
|
|
8254
|
-
var
|
|
8255
|
-
var SelectContext =
|
|
8398
|
+
var import_react26 = __toESM(require("react"), 1);
|
|
8399
|
+
var SelectContext = import_react26.default.createContext(null);
|
|
8256
8400
|
var context_default = SelectContext;
|
|
8257
8401
|
|
|
8258
8402
|
// src/components/Select/SelectItem.tsx
|
|
8259
|
-
var
|
|
8260
|
-
var
|
|
8403
|
+
var import_react27 = __toESM(require("react"), 1);
|
|
8404
|
+
var import_jsx_runtime330 = require("react/jsx-runtime");
|
|
8261
8405
|
var SelectItem = (props) => {
|
|
8262
8406
|
const { children, value, onClick, disabled = false } = props;
|
|
8263
|
-
const ctx =
|
|
8407
|
+
const ctx = import_react27.default.useContext(context_default);
|
|
8264
8408
|
const handleClick = (e) => {
|
|
8265
8409
|
e.preventDefault();
|
|
8266
8410
|
e.stopPropagation();
|
|
@@ -8269,7 +8413,7 @@ var SelectItem = (props) => {
|
|
|
8269
8413
|
ctx?.close();
|
|
8270
8414
|
onClick?.();
|
|
8271
8415
|
};
|
|
8272
|
-
return /* @__PURE__ */ (0,
|
|
8416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime330.jsx)(
|
|
8273
8417
|
"div",
|
|
8274
8418
|
{
|
|
8275
8419
|
className: clsx_default("select-item", disabled && "disabled"),
|
|
@@ -8290,7 +8434,7 @@ SelectItem.displayName = "Select.Item";
|
|
|
8290
8434
|
var SelectItem_default = SelectItem;
|
|
8291
8435
|
|
|
8292
8436
|
// src/components/Select/Select.tsx
|
|
8293
|
-
var
|
|
8437
|
+
var import_jsx_runtime331 = require("react/jsx-runtime");
|
|
8294
8438
|
var ANIMATION_DURATION_MS3 = 200;
|
|
8295
8439
|
var SelectRoot = (props) => {
|
|
8296
8440
|
const {
|
|
@@ -8302,26 +8446,26 @@ var SelectRoot = (props) => {
|
|
|
8302
8446
|
error = false,
|
|
8303
8447
|
size = "md"
|
|
8304
8448
|
} = props;
|
|
8305
|
-
const itemChildren =
|
|
8306
|
-
(child) =>
|
|
8449
|
+
const itemChildren = import_react28.default.Children.toArray(children).filter(
|
|
8450
|
+
(child) => import_react28.default.isValidElement(child) && child.type === SelectItem_default
|
|
8307
8451
|
);
|
|
8308
8452
|
const isControlled = valueProp !== void 0;
|
|
8309
|
-
const [isOpen, setOpen] =
|
|
8310
|
-
const [uncontrolledLabel, setUncontrolledLabel] =
|
|
8311
|
-
const controlledLabel =
|
|
8453
|
+
const [isOpen, setOpen] = import_react28.default.useState(false);
|
|
8454
|
+
const [uncontrolledLabel, setUncontrolledLabel] = import_react28.default.useState(null);
|
|
8455
|
+
const controlledLabel = import_react28.default.useMemo(() => {
|
|
8312
8456
|
if (!isControlled) return null;
|
|
8313
8457
|
const match = itemChildren.find((child) => child.props.value === valueProp);
|
|
8314
8458
|
return match ? match.props.children : null;
|
|
8315
8459
|
}, [isControlled, valueProp, itemChildren]);
|
|
8316
8460
|
const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
|
|
8317
|
-
const triggerRef =
|
|
8318
|
-
const contentRef =
|
|
8319
|
-
const [mounted, setMounted] =
|
|
8320
|
-
const [visible, setVisible] =
|
|
8321
|
-
|
|
8461
|
+
const triggerRef = import_react28.default.useRef(null);
|
|
8462
|
+
const contentRef = import_react28.default.useRef(null);
|
|
8463
|
+
const [mounted, setMounted] = import_react28.default.useState(false);
|
|
8464
|
+
const [visible, setVisible] = import_react28.default.useState(false);
|
|
8465
|
+
import_react28.default.useEffect(() => {
|
|
8322
8466
|
if (disabled && isOpen) setOpen(false);
|
|
8323
8467
|
}, [disabled, isOpen]);
|
|
8324
|
-
|
|
8468
|
+
import_react28.default.useEffect(() => {
|
|
8325
8469
|
if (isOpen) {
|
|
8326
8470
|
setMounted(true);
|
|
8327
8471
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -8331,12 +8475,12 @@ var SelectRoot = (props) => {
|
|
|
8331
8475
|
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS3);
|
|
8332
8476
|
return () => clearTimeout(t);
|
|
8333
8477
|
}, [isOpen]);
|
|
8334
|
-
const open =
|
|
8335
|
-
const close =
|
|
8336
|
-
const toggle =
|
|
8478
|
+
const open = import_react28.default.useCallback(() => setOpen(true), []);
|
|
8479
|
+
const close = import_react28.default.useCallback(() => setOpen(false), []);
|
|
8480
|
+
const toggle = import_react28.default.useCallback(() => setOpen((prev) => !prev), []);
|
|
8337
8481
|
useClickOutside_default([contentRef, triggerRef], close, isOpen);
|
|
8338
8482
|
const position = useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
8339
|
-
const setSelected =
|
|
8483
|
+
const setSelected = import_react28.default.useCallback(
|
|
8340
8484
|
(label, itemValue) => {
|
|
8341
8485
|
if (!isControlled) {
|
|
8342
8486
|
setUncontrolledLabel(label);
|
|
@@ -8345,7 +8489,7 @@ var SelectRoot = (props) => {
|
|
|
8345
8489
|
},
|
|
8346
8490
|
[isControlled, onChange]
|
|
8347
8491
|
);
|
|
8348
|
-
const ctxValue =
|
|
8492
|
+
const ctxValue = import_react28.default.useMemo(
|
|
8349
8493
|
() => ({
|
|
8350
8494
|
isOpen,
|
|
8351
8495
|
mounted,
|
|
@@ -8366,7 +8510,7 @@ var SelectRoot = (props) => {
|
|
|
8366
8510
|
if (disabled) return;
|
|
8367
8511
|
toggle();
|
|
8368
8512
|
};
|
|
8369
|
-
return /* @__PURE__ */ (0,
|
|
8513
|
+
return /* @__PURE__ */ (0, import_jsx_runtime331.jsx)(context_default.Provider, { value: ctxValue, children: /* @__PURE__ */ (0, import_jsx_runtime331.jsxs)(
|
|
8370
8514
|
"div",
|
|
8371
8515
|
{
|
|
8372
8516
|
className: clsx_default(
|
|
@@ -8377,7 +8521,7 @@ var SelectRoot = (props) => {
|
|
|
8377
8521
|
mounted && "is-open"
|
|
8378
8522
|
),
|
|
8379
8523
|
children: [
|
|
8380
|
-
/* @__PURE__ */ (0,
|
|
8524
|
+
/* @__PURE__ */ (0, import_jsx_runtime331.jsxs)(
|
|
8381
8525
|
"div",
|
|
8382
8526
|
{
|
|
8383
8527
|
ref: triggerRef,
|
|
@@ -8401,7 +8545,7 @@ var SelectRoot = (props) => {
|
|
|
8401
8545
|
}
|
|
8402
8546
|
},
|
|
8403
8547
|
children: [
|
|
8404
|
-
/* @__PURE__ */ (0,
|
|
8548
|
+
/* @__PURE__ */ (0, import_jsx_runtime331.jsx)(
|
|
8405
8549
|
"span",
|
|
8406
8550
|
{
|
|
8407
8551
|
className: clsx_default(
|
|
@@ -8411,18 +8555,18 @@ var SelectRoot = (props) => {
|
|
|
8411
8555
|
children: selectedLabel ?? placeholder
|
|
8412
8556
|
}
|
|
8413
8557
|
),
|
|
8414
|
-
/* @__PURE__ */ (0,
|
|
8558
|
+
/* @__PURE__ */ (0, import_jsx_runtime331.jsx)(
|
|
8415
8559
|
"span",
|
|
8416
8560
|
{
|
|
8417
8561
|
className: clsx_default("select-trigger-icon", isOpen && "open"),
|
|
8418
8562
|
"aria-hidden": true,
|
|
8419
|
-
children: /* @__PURE__ */ (0,
|
|
8563
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime331.jsx)(ChevronDownIcon_default, {})
|
|
8420
8564
|
}
|
|
8421
8565
|
)
|
|
8422
8566
|
]
|
|
8423
8567
|
}
|
|
8424
8568
|
),
|
|
8425
|
-
mounted && /* @__PURE__ */ (0,
|
|
8569
|
+
mounted && /* @__PURE__ */ (0, import_jsx_runtime331.jsx)(
|
|
8426
8570
|
"div",
|
|
8427
8571
|
{
|
|
8428
8572
|
className: clsx_default("select-content", position.direction, stateClass),
|
|
@@ -8443,14 +8587,14 @@ var Select = Object.assign(SelectRoot, {
|
|
|
8443
8587
|
var Select_default = Select;
|
|
8444
8588
|
|
|
8445
8589
|
// src/components/Skeleton/Skeleton.tsx
|
|
8446
|
-
var
|
|
8590
|
+
var import_jsx_runtime332 = require("react/jsx-runtime");
|
|
8447
8591
|
var Skeleton = (props) => {
|
|
8448
8592
|
const { variant = "text", width, height } = props;
|
|
8449
8593
|
const style = {
|
|
8450
8594
|
width: typeof width === "number" ? `${width}px` : width,
|
|
8451
8595
|
height: typeof height === "number" ? `${height}px` : height
|
|
8452
8596
|
};
|
|
8453
|
-
return /* @__PURE__ */ (0,
|
|
8597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime332.jsx)(
|
|
8454
8598
|
"div",
|
|
8455
8599
|
{
|
|
8456
8600
|
className: clsx_default("lib-xplat-skeleton", variant),
|
|
@@ -8463,20 +8607,20 @@ Skeleton.displayName = "Skeleton";
|
|
|
8463
8607
|
var Skeleton_default = Skeleton;
|
|
8464
8608
|
|
|
8465
8609
|
// src/components/Spinner/Spinner.tsx
|
|
8466
|
-
var
|
|
8610
|
+
var import_jsx_runtime333 = require("react/jsx-runtime");
|
|
8467
8611
|
var Spinner = (props) => {
|
|
8468
8612
|
const {
|
|
8469
8613
|
size = "md",
|
|
8470
8614
|
type = "brand"
|
|
8471
8615
|
} = props;
|
|
8472
|
-
return /* @__PURE__ */ (0,
|
|
8616
|
+
return /* @__PURE__ */ (0, import_jsx_runtime333.jsx)(
|
|
8473
8617
|
"div",
|
|
8474
8618
|
{
|
|
8475
8619
|
className: clsx_default("lib-xplat-spinner", size, type),
|
|
8476
8620
|
role: "status",
|
|
8477
8621
|
"aria-label": "\uB85C\uB529 \uC911",
|
|
8478
|
-
children: /* @__PURE__ */ (0,
|
|
8479
|
-
/* @__PURE__ */ (0,
|
|
8622
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime333.jsxs)("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
8623
|
+
/* @__PURE__ */ (0, import_jsx_runtime333.jsx)(
|
|
8480
8624
|
"circle",
|
|
8481
8625
|
{
|
|
8482
8626
|
className: "track",
|
|
@@ -8486,7 +8630,7 @@ var Spinner = (props) => {
|
|
|
8486
8630
|
strokeWidth: "3"
|
|
8487
8631
|
}
|
|
8488
8632
|
),
|
|
8489
|
-
/* @__PURE__ */ (0,
|
|
8633
|
+
/* @__PURE__ */ (0, import_jsx_runtime333.jsx)(
|
|
8490
8634
|
"circle",
|
|
8491
8635
|
{
|
|
8492
8636
|
className: "indicator",
|
|
@@ -8505,20 +8649,20 @@ Spinner.displayName = "Spinner";
|
|
|
8505
8649
|
var Spinner_default = Spinner;
|
|
8506
8650
|
|
|
8507
8651
|
// src/components/Steps/Steps.tsx
|
|
8508
|
-
var
|
|
8652
|
+
var import_jsx_runtime334 = require("react/jsx-runtime");
|
|
8509
8653
|
var Steps = (props) => {
|
|
8510
8654
|
const {
|
|
8511
8655
|
items,
|
|
8512
8656
|
current,
|
|
8513
8657
|
type = "brand"
|
|
8514
8658
|
} = props;
|
|
8515
|
-
return /* @__PURE__ */ (0,
|
|
8659
|
+
return /* @__PURE__ */ (0, import_jsx_runtime334.jsx)("div", { className: clsx_default("lib-xplat-steps", type), children: items.map((item, index) => {
|
|
8516
8660
|
const status = index < current ? "completed" : index === current ? "active" : "pending";
|
|
8517
|
-
return /* @__PURE__ */ (0,
|
|
8518
|
-
/* @__PURE__ */ (0,
|
|
8519
|
-
/* @__PURE__ */ (0,
|
|
8520
|
-
/* @__PURE__ */ (0,
|
|
8521
|
-
item.description && /* @__PURE__ */ (0,
|
|
8661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime334.jsxs)("div", { className: clsx_default("step-item", status), children: [
|
|
8662
|
+
/* @__PURE__ */ (0, import_jsx_runtime334.jsx)("div", { className: "step-circle", children: status === "completed" ? /* @__PURE__ */ (0, import_jsx_runtime334.jsx)(CheckIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime334.jsx)("span", { children: index + 1 }) }),
|
|
8663
|
+
/* @__PURE__ */ (0, import_jsx_runtime334.jsxs)("div", { className: "step-content", children: [
|
|
8664
|
+
/* @__PURE__ */ (0, import_jsx_runtime334.jsx)("span", { className: "step-title", children: item.title }),
|
|
8665
|
+
item.description && /* @__PURE__ */ (0, import_jsx_runtime334.jsx)("span", { className: "step-description", children: item.description })
|
|
8522
8666
|
] })
|
|
8523
8667
|
] }, index);
|
|
8524
8668
|
}) });
|
|
@@ -8527,8 +8671,8 @@ Steps.displayName = "Steps";
|
|
|
8527
8671
|
var Steps_default = Steps;
|
|
8528
8672
|
|
|
8529
8673
|
// src/components/Swiper/Swiper.tsx
|
|
8530
|
-
var
|
|
8531
|
-
var
|
|
8674
|
+
var import_react29 = __toESM(require("react"), 1);
|
|
8675
|
+
var import_jsx_runtime335 = require("react/jsx-runtime");
|
|
8532
8676
|
var Swiper = (props) => {
|
|
8533
8677
|
const {
|
|
8534
8678
|
auto = false,
|
|
@@ -8551,23 +8695,23 @@ var Swiper = (props) => {
|
|
|
8551
8695
|
const maxIndex = Math.max(0, totalSlides - viewItemCount);
|
|
8552
8696
|
const useLoop = loop && canSlide;
|
|
8553
8697
|
const cloneCount = useLoop ? totalSlides : 0;
|
|
8554
|
-
const extendedItems =
|
|
8698
|
+
const extendedItems = import_react29.default.useMemo(() => {
|
|
8555
8699
|
if (!useLoop) return items;
|
|
8556
8700
|
return [...items, ...items, ...items];
|
|
8557
8701
|
}, [items, useLoop]);
|
|
8558
8702
|
const initialIdx = Math.max(0, Math.min(indexProp ?? 0, maxIndex));
|
|
8559
|
-
const [innerIndex, setInnerIndex] =
|
|
8703
|
+
const [innerIndex, setInnerIndex] = import_react29.default.useState(
|
|
8560
8704
|
useLoop ? cloneCount + initialIdx : initialIdx
|
|
8561
8705
|
);
|
|
8562
|
-
const [isDragging, setIsDragging] =
|
|
8563
|
-
const [dragOffset, setDragOffset] =
|
|
8564
|
-
const [animated, setAnimated] =
|
|
8565
|
-
const [containerWidth, setContainerWidth] =
|
|
8566
|
-
const containerRef =
|
|
8567
|
-
const startXRef =
|
|
8568
|
-
const startTimeRef =
|
|
8569
|
-
const autoplayTimerRef =
|
|
8570
|
-
|
|
8706
|
+
const [isDragging, setIsDragging] = import_react29.default.useState(false);
|
|
8707
|
+
const [dragOffset, setDragOffset] = import_react29.default.useState(0);
|
|
8708
|
+
const [animated, setAnimated] = import_react29.default.useState(true);
|
|
8709
|
+
const [containerWidth, setContainerWidth] = import_react29.default.useState(0);
|
|
8710
|
+
const containerRef = import_react29.default.useRef(null);
|
|
8711
|
+
const startXRef = import_react29.default.useRef(0);
|
|
8712
|
+
const startTimeRef = import_react29.default.useRef(0);
|
|
8713
|
+
const autoplayTimerRef = import_react29.default.useRef(null);
|
|
8714
|
+
import_react29.default.useEffect(() => {
|
|
8571
8715
|
const el = containerRef.current;
|
|
8572
8716
|
if (!el) return;
|
|
8573
8717
|
const ro = new ResizeObserver((entries) => {
|
|
@@ -8586,7 +8730,7 @@ var Swiper = (props) => {
|
|
|
8586
8730
|
return ((inner - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
8587
8731
|
};
|
|
8588
8732
|
const realIndex = getRealIndex(innerIndex);
|
|
8589
|
-
const moveToInner =
|
|
8733
|
+
const moveToInner = import_react29.default.useCallback(
|
|
8590
8734
|
(idx, withAnim = true) => {
|
|
8591
8735
|
if (!useLoop) {
|
|
8592
8736
|
setAnimated(withAnim);
|
|
@@ -8614,7 +8758,7 @@ var Swiper = (props) => {
|
|
|
8614
8758
|
},
|
|
8615
8759
|
[useLoop, cloneCount, totalSlides]
|
|
8616
8760
|
);
|
|
8617
|
-
const handleTransitionEnd =
|
|
8761
|
+
const handleTransitionEnd = import_react29.default.useCallback(() => {
|
|
8618
8762
|
if (!useLoop) return;
|
|
8619
8763
|
const real = getRealIndex(innerIndex);
|
|
8620
8764
|
const canonical = cloneCount + real;
|
|
@@ -8624,7 +8768,7 @@ var Swiper = (props) => {
|
|
|
8624
8768
|
}
|
|
8625
8769
|
onChange?.(Math.min(real, maxIndex));
|
|
8626
8770
|
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange]);
|
|
8627
|
-
const slideTo =
|
|
8771
|
+
const slideTo = import_react29.default.useCallback(
|
|
8628
8772
|
(logicalIndex) => {
|
|
8629
8773
|
if (!canSlide) return;
|
|
8630
8774
|
const clamped = useLoop ? logicalIndex : Math.max(0, Math.min(logicalIndex, maxIndex));
|
|
@@ -8634,7 +8778,7 @@ var Swiper = (props) => {
|
|
|
8634
8778
|
},
|
|
8635
8779
|
[canSlide, useLoop, cloneCount, maxIndex, onChange, moveToInner]
|
|
8636
8780
|
);
|
|
8637
|
-
const slideNext =
|
|
8781
|
+
const slideNext = import_react29.default.useCallback(() => {
|
|
8638
8782
|
if (!canSlide) return;
|
|
8639
8783
|
const nextInner = innerIndex + slideBy;
|
|
8640
8784
|
if (useLoop) {
|
|
@@ -8643,7 +8787,7 @@ var Swiper = (props) => {
|
|
|
8643
8787
|
moveToInner(Math.min(nextInner, maxIndex), true);
|
|
8644
8788
|
}
|
|
8645
8789
|
}, [canSlide, useLoop, innerIndex, slideBy, maxIndex, moveToInner]);
|
|
8646
|
-
const slidePrev =
|
|
8790
|
+
const slidePrev = import_react29.default.useCallback(() => {
|
|
8647
8791
|
if (!canSlide) return;
|
|
8648
8792
|
const prevInner = innerIndex - slideBy;
|
|
8649
8793
|
if (useLoop) {
|
|
@@ -8652,7 +8796,7 @@ var Swiper = (props) => {
|
|
|
8652
8796
|
moveToInner(Math.max(prevInner, 0), true);
|
|
8653
8797
|
}
|
|
8654
8798
|
}, [canSlide, useLoop, innerIndex, slideBy, moveToInner]);
|
|
8655
|
-
|
|
8799
|
+
import_react29.default.useEffect(() => {
|
|
8656
8800
|
if (indexProp === void 0) return;
|
|
8657
8801
|
const clamped = Math.max(0, Math.min(indexProp, maxIndex));
|
|
8658
8802
|
const target = useLoop ? cloneCount + clamped : clamped;
|
|
@@ -8660,12 +8804,12 @@ var Swiper = (props) => {
|
|
|
8660
8804
|
moveToInner(target, true);
|
|
8661
8805
|
}
|
|
8662
8806
|
}, [indexProp]);
|
|
8663
|
-
|
|
8807
|
+
import_react29.default.useImperativeHandle(swiperRef, () => ({
|
|
8664
8808
|
slidePrev,
|
|
8665
8809
|
slideNext,
|
|
8666
8810
|
slideTo
|
|
8667
8811
|
}));
|
|
8668
|
-
|
|
8812
|
+
import_react29.default.useEffect(() => {
|
|
8669
8813
|
if (!auto || !canSlide) return;
|
|
8670
8814
|
autoplayTimerRef.current = setInterval(slideNext, autoplayDelay);
|
|
8671
8815
|
return () => {
|
|
@@ -8688,7 +8832,7 @@ var Swiper = (props) => {
|
|
|
8688
8832
|
startXRef.current = getClientX(e);
|
|
8689
8833
|
startTimeRef.current = Date.now();
|
|
8690
8834
|
};
|
|
8691
|
-
|
|
8835
|
+
import_react29.default.useEffect(() => {
|
|
8692
8836
|
if (!isDragging) return;
|
|
8693
8837
|
const handleMove = (e) => {
|
|
8694
8838
|
setDragOffset(getClientX(e) - startXRef.current);
|
|
@@ -8726,8 +8870,8 @@ var Swiper = (props) => {
|
|
|
8726
8870
|
}, [isDragging, dragOffset, innerIndex, useLoop, maxIndex, slideStep, moveToInner]);
|
|
8727
8871
|
const slideWidthPercent = 100 / viewItemCount;
|
|
8728
8872
|
const gapAdjust = spaceBetween * (viewItemCount - 1) / viewItemCount;
|
|
8729
|
-
const slideElements =
|
|
8730
|
-
() => extendedItems.map((item, idx) => /* @__PURE__ */ (0,
|
|
8873
|
+
const slideElements = import_react29.default.useMemo(
|
|
8874
|
+
() => extendedItems.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime335.jsx)(
|
|
8731
8875
|
"div",
|
|
8732
8876
|
{
|
|
8733
8877
|
className: "lib-xplat-swiper__slide",
|
|
@@ -8746,14 +8890,14 @@ var Swiper = (props) => {
|
|
|
8746
8890
|
Math.floor(realIndex / slideBy),
|
|
8747
8891
|
totalSteps - 1
|
|
8748
8892
|
);
|
|
8749
|
-
return /* @__PURE__ */ (0,
|
|
8750
|
-
/* @__PURE__ */ (0,
|
|
8893
|
+
return /* @__PURE__ */ (0, import_jsx_runtime335.jsxs)("div", { className: "lib-xplat-swiper", ref: containerRef, children: [
|
|
8894
|
+
/* @__PURE__ */ (0, import_jsx_runtime335.jsx)(
|
|
8751
8895
|
"div",
|
|
8752
8896
|
{
|
|
8753
8897
|
className: "lib-xplat-swiper__viewport",
|
|
8754
8898
|
onMouseDown: handleDragStart,
|
|
8755
8899
|
onTouchStart: handleDragStart,
|
|
8756
|
-
children: /* @__PURE__ */ (0,
|
|
8900
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime335.jsx)(
|
|
8757
8901
|
"div",
|
|
8758
8902
|
{
|
|
8759
8903
|
className: clsx_default(
|
|
@@ -8771,7 +8915,7 @@ var Swiper = (props) => {
|
|
|
8771
8915
|
)
|
|
8772
8916
|
}
|
|
8773
8917
|
),
|
|
8774
|
-
showProgress && canSlide && /* @__PURE__ */ (0,
|
|
8918
|
+
showProgress && canSlide && /* @__PURE__ */ (0, import_jsx_runtime335.jsx)("div", { className: "lib-xplat-swiper__progress", children: /* @__PURE__ */ (0, import_jsx_runtime335.jsx)("div", { className: "lib-xplat-swiper__progress-track", children: /* @__PURE__ */ (0, import_jsx_runtime335.jsx)(
|
|
8775
8919
|
"span",
|
|
8776
8920
|
{
|
|
8777
8921
|
className: "lib-xplat-swiper__progress-fill",
|
|
@@ -8781,7 +8925,7 @@ var Swiper = (props) => {
|
|
|
8781
8925
|
}
|
|
8782
8926
|
}
|
|
8783
8927
|
) }) }),
|
|
8784
|
-
canSlide && /* @__PURE__ */ (0,
|
|
8928
|
+
canSlide && /* @__PURE__ */ (0, import_jsx_runtime335.jsx)("div", { className: "lib-xplat-swiper__dots", children: Array.from({ length: totalSteps }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime335.jsx)(
|
|
8785
8929
|
"button",
|
|
8786
8930
|
{
|
|
8787
8931
|
className: clsx_default(
|
|
@@ -8799,8 +8943,8 @@ Swiper.displayName = "Swiper";
|
|
|
8799
8943
|
var Swiper_default = Swiper;
|
|
8800
8944
|
|
|
8801
8945
|
// src/components/Switch/Switch.tsx
|
|
8802
|
-
var
|
|
8803
|
-
var
|
|
8946
|
+
var import_react30 = __toESM(require("react"), 1);
|
|
8947
|
+
var import_jsx_runtime336 = require("react/jsx-runtime");
|
|
8804
8948
|
var KNOB_TRANSITION_MS = 250;
|
|
8805
8949
|
var Switch = (props) => {
|
|
8806
8950
|
const {
|
|
@@ -8810,9 +8954,9 @@ var Switch = (props) => {
|
|
|
8810
8954
|
disabled,
|
|
8811
8955
|
onChange
|
|
8812
8956
|
} = props;
|
|
8813
|
-
const [isAnimating, setIsAnimating] =
|
|
8814
|
-
const timeoutRef =
|
|
8815
|
-
|
|
8957
|
+
const [isAnimating, setIsAnimating] = import_react30.default.useState(false);
|
|
8958
|
+
const timeoutRef = import_react30.default.useRef(null);
|
|
8959
|
+
import_react30.default.useEffect(() => {
|
|
8816
8960
|
return () => {
|
|
8817
8961
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
8818
8962
|
};
|
|
@@ -8827,7 +8971,7 @@ var Switch = (props) => {
|
|
|
8827
8971
|
timeoutRef.current = null;
|
|
8828
8972
|
}, KNOB_TRANSITION_MS);
|
|
8829
8973
|
};
|
|
8830
|
-
return /* @__PURE__ */ (0,
|
|
8974
|
+
return /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(
|
|
8831
8975
|
"div",
|
|
8832
8976
|
{
|
|
8833
8977
|
className: clsx_default(
|
|
@@ -8840,80 +8984,13 @@ var Switch = (props) => {
|
|
|
8840
8984
|
),
|
|
8841
8985
|
onClick: handleClick,
|
|
8842
8986
|
"aria-disabled": disabled || isAnimating,
|
|
8843
|
-
children: /* @__PURE__ */ (0,
|
|
8987
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("div", { className: clsx_default("knob", value ? "checked" : void 0) })
|
|
8844
8988
|
}
|
|
8845
8989
|
);
|
|
8846
8990
|
};
|
|
8847
8991
|
Switch.displayName = "Switch";
|
|
8848
8992
|
var Switch_default = Switch;
|
|
8849
8993
|
|
|
8850
|
-
// src/components/Tab/Tab.tsx
|
|
8851
|
-
var import_react30 = __toESM(require("react"), 1);
|
|
8852
|
-
|
|
8853
|
-
// src/components/Tab/TabItem.tsx
|
|
8854
|
-
var import_react29 = __toESM(require("react"), 1);
|
|
8855
|
-
var import_jsx_runtime335 = require("react/jsx-runtime");
|
|
8856
|
-
var TabItem = import_react29.default.forwardRef((props, ref) => {
|
|
8857
|
-
const { isActive, title, onClick } = props;
|
|
8858
|
-
return /* @__PURE__ */ (0, import_jsx_runtime335.jsx)(
|
|
8859
|
-
"div",
|
|
8860
|
-
{
|
|
8861
|
-
ref,
|
|
8862
|
-
className: clsx_default("tab-item", isActive ? "active" : null),
|
|
8863
|
-
onClick,
|
|
8864
|
-
children: title
|
|
8865
|
-
}
|
|
8866
|
-
);
|
|
8867
|
-
});
|
|
8868
|
-
TabItem.displayName = "TabItem";
|
|
8869
|
-
var TabItem_default = TabItem;
|
|
8870
|
-
|
|
8871
|
-
// src/components/Tab/Tab.tsx
|
|
8872
|
-
var import_jsx_runtime336 = require("react/jsx-runtime");
|
|
8873
|
-
var Tab = (props) => {
|
|
8874
|
-
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
8875
|
-
const [underlineStyle, setUnderlineStyle] = import_react30.default.useState({
|
|
8876
|
-
left: 0,
|
|
8877
|
-
width: 0
|
|
8878
|
-
});
|
|
8879
|
-
const itemRefs = import_react30.default.useRef([]);
|
|
8880
|
-
const handleChangeActiveTab = (tabItem, tabIdx) => {
|
|
8881
|
-
onChange(tabItem, tabIdx);
|
|
8882
|
-
};
|
|
8883
|
-
import_react30.default.useEffect(() => {
|
|
8884
|
-
const el = itemRefs.current[activeIndex];
|
|
8885
|
-
if (el) {
|
|
8886
|
-
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
8887
|
-
}
|
|
8888
|
-
}, [activeIndex, tabs.length]);
|
|
8889
|
-
return /* @__PURE__ */ (0, import_jsx_runtime336.jsxs)("div", { className: clsx_default("lib-xplat-tab", `type-${type}`, size), children: [
|
|
8890
|
-
tabs.map((tab, idx) => /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(
|
|
8891
|
-
TabItem_default,
|
|
8892
|
-
{
|
|
8893
|
-
onClick: () => handleChangeActiveTab(tab, idx),
|
|
8894
|
-
isActive: activeIndex === idx,
|
|
8895
|
-
ref: (el) => {
|
|
8896
|
-
itemRefs.current[idx] = el;
|
|
8897
|
-
},
|
|
8898
|
-
title: tab.title
|
|
8899
|
-
},
|
|
8900
|
-
`${tab.value}_${idx}`
|
|
8901
|
-
)),
|
|
8902
|
-
type === "toggle" && /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(
|
|
8903
|
-
"div",
|
|
8904
|
-
{
|
|
8905
|
-
className: "tab-toggle-underline",
|
|
8906
|
-
style: {
|
|
8907
|
-
left: underlineStyle.left,
|
|
8908
|
-
width: underlineStyle.width
|
|
8909
|
-
}
|
|
8910
|
-
}
|
|
8911
|
-
)
|
|
8912
|
-
] });
|
|
8913
|
-
};
|
|
8914
|
-
Tab.displayName = "Tab";
|
|
8915
|
-
var Tab_default = Tab;
|
|
8916
|
-
|
|
8917
8994
|
// src/components/Table/TableContext.tsx
|
|
8918
8995
|
var import_react31 = __toESM(require("react"), 1);
|
|
8919
8996
|
var TableContext = import_react31.default.createContext(null);
|
|
@@ -9827,6 +9904,7 @@ var SideBar_default = SideBar;
|
|
|
9827
9904
|
BookIcon,
|
|
9828
9905
|
BookOpenIcon,
|
|
9829
9906
|
BookmarkIcon,
|
|
9907
|
+
Box,
|
|
9830
9908
|
BoxIcon,
|
|
9831
9909
|
Breadcrumb,
|
|
9832
9910
|
BriefcaseIcon,
|
|
@@ -9843,7 +9921,6 @@ var SideBar_default = SideBar;
|
|
|
9843
9921
|
CallOutgoingIcon,
|
|
9844
9922
|
CameraIcon,
|
|
9845
9923
|
CameraOffIcon,
|
|
9846
|
-
Card,
|
|
9847
9924
|
CardTab,
|
|
9848
9925
|
CastIcon,
|
|
9849
9926
|
Chart,
|