@x-plat/design-system 0.5.10 → 0.5.12
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/Chart/index.cjs +67 -48
- package/dist/components/Chart/index.js +68 -49
- package/dist/components/DatePicker/index.cjs +401 -379
- package/dist/components/DatePicker/index.js +388 -366
- package/dist/components/Dropdown/index.cjs +55 -27
- package/dist/components/Dropdown/index.css +10 -10
- package/dist/components/Dropdown/index.js +54 -26
- package/dist/components/Modal/index.cjs +29 -9
- package/dist/components/Modal/index.d.cts +0 -3
- package/dist/components/Modal/index.d.ts +0 -3
- package/dist/components/Modal/index.js +28 -8
- package/dist/components/PopOver/index.cjs +50 -22
- package/dist/components/PopOver/index.css +7 -10
- package/dist/components/PopOver/index.js +49 -21
- package/dist/components/Select/index.cjs +369 -341
- package/dist/components/Select/index.css +13 -23
- package/dist/components/Select/index.js +368 -340
- package/dist/components/index.cjs +503 -451
- package/dist/components/index.css +30 -43
- package/dist/components/index.js +459 -407
- package/dist/index.cjs +527 -475
- package/dist/index.css +30 -43
- package/dist/index.js +481 -429
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -6567,14 +6567,23 @@ var useChartSize = (ref) => {
|
|
|
6567
6567
|
import_react5.default.useEffect(() => {
|
|
6568
6568
|
const el = ref.current;
|
|
6569
6569
|
if (!el) return;
|
|
6570
|
+
let rafId = 0;
|
|
6570
6571
|
const observer = new ResizeObserver((entries) => {
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6572
|
+
cancelAnimationFrame(rafId);
|
|
6573
|
+
rafId = requestAnimationFrame(() => {
|
|
6574
|
+
const entry = entries[0];
|
|
6575
|
+
if (!entry) return;
|
|
6576
|
+
const { width, height } = entry.contentRect;
|
|
6577
|
+
const w = Math.floor(width);
|
|
6578
|
+
const h = Math.floor(height);
|
|
6579
|
+
setSize((prev) => prev.width === w && prev.height === h ? prev : { width: w, height: h });
|
|
6580
|
+
});
|
|
6575
6581
|
});
|
|
6576
6582
|
observer.observe(el);
|
|
6577
|
-
return () =>
|
|
6583
|
+
return () => {
|
|
6584
|
+
cancelAnimationFrame(rafId);
|
|
6585
|
+
observer.disconnect();
|
|
6586
|
+
};
|
|
6578
6587
|
}, [ref]);
|
|
6579
6588
|
return size;
|
|
6580
6589
|
};
|
|
@@ -6586,15 +6595,21 @@ var useChartTooltip = (enabled) => {
|
|
|
6586
6595
|
content: ""
|
|
6587
6596
|
});
|
|
6588
6597
|
const containerRef = import_react5.default.useRef(null);
|
|
6598
|
+
const rafRef = import_react5.default.useRef(0);
|
|
6589
6599
|
const move = import_react5.default.useCallback((e) => {
|
|
6590
6600
|
if (!enabled) return;
|
|
6591
|
-
const
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6601
|
+
const clientX = e.clientX;
|
|
6602
|
+
const clientY = e.clientY;
|
|
6603
|
+
cancelAnimationFrame(rafRef.current);
|
|
6604
|
+
rafRef.current = requestAnimationFrame(() => {
|
|
6605
|
+
const rect = containerRef.current?.getBoundingClientRect();
|
|
6606
|
+
if (!rect) return;
|
|
6607
|
+
setTooltip((prev) => ({
|
|
6608
|
+
...prev,
|
|
6609
|
+
x: clientX - rect.left,
|
|
6610
|
+
y: clientY - rect.top - 12
|
|
6611
|
+
}));
|
|
6612
|
+
});
|
|
6598
6613
|
}, [enabled]);
|
|
6599
6614
|
const show = import_react5.default.useCallback((e, content) => {
|
|
6600
6615
|
if (!enabled) return;
|
|
@@ -6608,10 +6623,35 @@ var useChartTooltip = (enabled) => {
|
|
|
6608
6623
|
});
|
|
6609
6624
|
}, [enabled]);
|
|
6610
6625
|
const hide = import_react5.default.useCallback(() => {
|
|
6626
|
+
cancelAnimationFrame(rafRef.current);
|
|
6611
6627
|
setTooltip((prev) => ({ ...prev, visible: false }));
|
|
6612
6628
|
}, []);
|
|
6613
6629
|
return { tooltip, show, hide, move, containerRef };
|
|
6614
6630
|
};
|
|
6631
|
+
var GridLines = import_react5.default.memo(({ width, height, chartH, maxVal }) => /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(import_jsx_runtime305.Fragment, { children: [0, 0.25, 0.5, 0.75, 1].map((ratio) => {
|
|
6632
|
+
const y = PADDING.top + (1 - ratio) * chartH;
|
|
6633
|
+
const val = Math.round(maxVal * ratio);
|
|
6634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { children: [
|
|
6635
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
|
|
6636
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
|
|
6637
|
+
] }, ratio);
|
|
6638
|
+
}) }));
|
|
6639
|
+
GridLines.displayName = "GridLines";
|
|
6640
|
+
var getLabelStep = (count, chartW) => {
|
|
6641
|
+
const minLabelWidth = 40;
|
|
6642
|
+
const maxLabels = Math.floor(chartW / minLabelWidth);
|
|
6643
|
+
if (count <= maxLabels) return 1;
|
|
6644
|
+
return Math.ceil(count / maxLabels);
|
|
6645
|
+
};
|
|
6646
|
+
var AxisLabels = import_react5.default.memo(({ labels, count, chartW, height }) => {
|
|
6647
|
+
const step = getLabelStep(count, chartW);
|
|
6648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(import_jsx_runtime305.Fragment, { children: labels.map((label, i) => {
|
|
6649
|
+
if (i % step !== 0) return null;
|
|
6650
|
+
const x = PADDING.left + i / (count - 1 || 1) * chartW;
|
|
6651
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("text", { x, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
6652
|
+
}) });
|
|
6653
|
+
});
|
|
6654
|
+
AxisLabels.displayName = "AxisLabels";
|
|
6615
6655
|
var LineChart = import_react5.default.memo(({ data, labels, width, height, onHover, onMove, onLeave }) => {
|
|
6616
6656
|
const entries = import_react5.default.useMemo(() => Object.entries(data), [data]);
|
|
6617
6657
|
const maxVal = import_react5.default.useMemo(() => {
|
|
@@ -6631,19 +6671,10 @@ var LineChart = import_react5.default.memo(({ data, labels, width, height, onHov
|
|
|
6631
6671
|
),
|
|
6632
6672
|
[entries, count, chartW, chartH, maxVal]
|
|
6633
6673
|
);
|
|
6674
|
+
const showPoints = count <= 100;
|
|
6634
6675
|
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
const val = Math.round(maxVal * ratio);
|
|
6638
|
-
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { children: [
|
|
6639
|
-
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
|
|
6640
|
-
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
|
|
6641
|
-
] }, ratio);
|
|
6642
|
-
}),
|
|
6643
|
-
labels.map((label, i) => {
|
|
6644
|
-
const x = PADDING.left + i / (count - 1 || 1) * chartW;
|
|
6645
|
-
return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("text", { x, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
6646
|
-
}),
|
|
6676
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)(GridLines, { width, height, chartH, maxVal }),
|
|
6677
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)(AxisLabels, { labels, count, chartW, height }),
|
|
6647
6678
|
entries.map(([key], di) => {
|
|
6648
6679
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
6649
6680
|
const color = palette[2];
|
|
@@ -6658,7 +6689,7 @@ var LineChart = import_react5.default.memo(({ data, labels, width, height, onHov
|
|
|
6658
6689
|
strokeWidth: "2"
|
|
6659
6690
|
}
|
|
6660
6691
|
),
|
|
6661
|
-
points.map((p, i) => /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
|
|
6692
|
+
showPoints && points.map((p, i) => /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
|
|
6662
6693
|
"circle",
|
|
6663
6694
|
{
|
|
6664
6695
|
cx: p.x,
|
|
@@ -6696,19 +6727,10 @@ var CurveChart = import_react5.default.memo(({ data, labels, width, height, onHo
|
|
|
6696
6727
|
),
|
|
6697
6728
|
[entries, count, chartW, chartH, maxVal]
|
|
6698
6729
|
);
|
|
6730
|
+
const showPoints = count <= 100;
|
|
6699
6731
|
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
6700
|
-
|
|
6701
|
-
|
|
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
|
-
}),
|
|
6732
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)(GridLines, { width, height, chartH, maxVal }),
|
|
6733
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)(AxisLabels, { labels, count, chartW, height }),
|
|
6712
6734
|
entries.map(([key], di) => {
|
|
6713
6735
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
6714
6736
|
const color = palette[2];
|
|
@@ -6724,7 +6746,7 @@ var CurveChart = import_react5.default.memo(({ data, labels, width, height, onHo
|
|
|
6724
6746
|
] }) }),
|
|
6725
6747
|
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("path", { d: areaPath, fill: `url(#${gradientId})` }),
|
|
6726
6748
|
/* @__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)(
|
|
6749
|
+
showPoints && points.map((p, i) => /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
|
|
6728
6750
|
"circle",
|
|
6729
6751
|
{
|
|
6730
6752
|
cx: p.x,
|
|
@@ -6754,11 +6776,11 @@ var BarChart = import_react5.default.memo(({ data, labels, width, height, onHove
|
|
|
6754
6776
|
const chartW = width - PADDING.left - PADDING.right;
|
|
6755
6777
|
const chartH = height - PADDING.top - PADDING.bottom;
|
|
6756
6778
|
const groupW = chartW / count;
|
|
6757
|
-
const barW = Math.min(32, groupW * 0.7 / groupCount);
|
|
6779
|
+
const barW = Math.max(1, Math.min(32, groupW * 0.7 / groupCount));
|
|
6758
6780
|
const bars = import_react5.default.useMemo(
|
|
6759
6781
|
() => entries.map(
|
|
6760
6782
|
([, values], di) => values.map((v, i) => {
|
|
6761
|
-
const h = v / maxVal * chartH;
|
|
6783
|
+
const h = Math.max(0, v / maxVal * chartH);
|
|
6762
6784
|
const x = PADDING.left + groupW * i + (groupW - barW * groupCount) / 2 + barW * di;
|
|
6763
6785
|
const y = PADDING.top + chartH - h;
|
|
6764
6786
|
return { x, y, w: barW, h, v };
|
|
@@ -6766,16 +6788,13 @@ var BarChart = import_react5.default.memo(({ data, labels, width, height, onHove
|
|
|
6766
6788
|
),
|
|
6767
6789
|
[entries, maxVal, chartH, groupW, barW, groupCount]
|
|
6768
6790
|
);
|
|
6791
|
+
const barLabelStep = getLabelStep(count, chartW);
|
|
6769
6792
|
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
return /* @__PURE__ */ (0, import_jsx_runtime305.
|
|
6774
|
-
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
|
|
6775
|
-
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
|
|
6776
|
-
] }, ratio);
|
|
6793
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)(GridLines, { width, height, chartH, maxVal }),
|
|
6794
|
+
labels.map((label, i) => {
|
|
6795
|
+
if (i % barLabelStep !== 0) return null;
|
|
6796
|
+
return /* @__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);
|
|
6777
6797
|
}),
|
|
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)),
|
|
6779
6798
|
entries.map(([key], di) => {
|
|
6780
6799
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
6781
6800
|
const color = palette[2];
|
|
@@ -6968,7 +6987,7 @@ Chip.displayName = "Chip";
|
|
|
6968
6987
|
var Chip_default = Chip;
|
|
6969
6988
|
|
|
6970
6989
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
6971
|
-
var
|
|
6990
|
+
var import_react12 = __toESM(require("react"), 1);
|
|
6972
6991
|
|
|
6973
6992
|
// src/components/Input/Input.tsx
|
|
6974
6993
|
var import_react6 = __toESM(require("react"), 1);
|
|
@@ -7158,15 +7177,37 @@ PasswordInput.displayName = "PasswordInput";
|
|
|
7158
7177
|
var PasswordInput_default = PasswordInput;
|
|
7159
7178
|
|
|
7160
7179
|
// src/components/Modal/Modal.tsx
|
|
7180
|
+
var import_react10 = __toESM(require("react"), 1);
|
|
7181
|
+
var import_react_dom2 = require("react-dom");
|
|
7182
|
+
|
|
7183
|
+
// src/tokens/hooks/Portal.tsx
|
|
7161
7184
|
var import_react9 = __toESM(require("react"), 1);
|
|
7162
|
-
var import_react_dom = require("react-dom");
|
|
7185
|
+
var import_react_dom = __toESM(require("react-dom"), 1);
|
|
7163
7186
|
var import_jsx_runtime311 = require("react/jsx-runtime");
|
|
7187
|
+
var PortalContainerContext = import_react9.default.createContext(null);
|
|
7188
|
+
var PortalProvider = ({ container, children }) => /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(PortalContainerContext.Provider, { value: container, children });
|
|
7189
|
+
var Portal = ({ children }) => {
|
|
7190
|
+
const contextContainer = import_react9.default.useContext(PortalContainerContext);
|
|
7191
|
+
const [fallback, setFallback] = import_react9.default.useState(null);
|
|
7192
|
+
import_react9.default.useEffect(() => {
|
|
7193
|
+
if (!contextContainer) setFallback(document.body);
|
|
7194
|
+
}, [contextContainer]);
|
|
7195
|
+
const container = contextContainer ?? fallback;
|
|
7196
|
+
if (!container) return null;
|
|
7197
|
+
return import_react_dom.default.createPortal(children, container);
|
|
7198
|
+
};
|
|
7199
|
+
Portal.displayName = "Portal";
|
|
7200
|
+
var Portal_default = Portal;
|
|
7201
|
+
|
|
7202
|
+
// src/components/Modal/Modal.tsx
|
|
7203
|
+
var import_jsx_runtime312 = require("react/jsx-runtime");
|
|
7164
7204
|
var ANIMATION_DURATION_MS = 200;
|
|
7165
7205
|
var Modal = (props) => {
|
|
7166
7206
|
const { isOpen, onClose, children } = props;
|
|
7167
|
-
const [mounted, setMounted] =
|
|
7168
|
-
const [visible, setVisible] =
|
|
7169
|
-
|
|
7207
|
+
const [mounted, setMounted] = import_react10.default.useState(false);
|
|
7208
|
+
const [visible, setVisible] = import_react10.default.useState(false);
|
|
7209
|
+
const boxRef = import_react10.default.useRef(null);
|
|
7210
|
+
import_react10.default.useEffect(() => {
|
|
7170
7211
|
if (isOpen) {
|
|
7171
7212
|
setMounted(true);
|
|
7172
7213
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -7179,20 +7220,21 @@ var Modal = (props) => {
|
|
|
7179
7220
|
if (typeof document === "undefined") return null;
|
|
7180
7221
|
if (!mounted) return null;
|
|
7181
7222
|
const stateClass = visible ? "enter" : "exit";
|
|
7182
|
-
return (0,
|
|
7183
|
-
/* @__PURE__ */ (0,
|
|
7223
|
+
return (0, import_react_dom2.createPortal)(
|
|
7224
|
+
/* @__PURE__ */ (0, import_jsx_runtime312.jsx)(
|
|
7184
7225
|
"div",
|
|
7185
7226
|
{
|
|
7186
7227
|
className: clsx_default("lib-xplat-modal", "dim", stateClass),
|
|
7187
7228
|
onClick: onClose,
|
|
7188
|
-
children: /* @__PURE__ */ (0,
|
|
7229
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(
|
|
7189
7230
|
"div",
|
|
7190
7231
|
{
|
|
7232
|
+
ref: boxRef,
|
|
7191
7233
|
className: clsx_default("lib-xplat-modal", "modal-box", stateClass),
|
|
7192
7234
|
role: "dialog",
|
|
7193
7235
|
"aria-modal": "true",
|
|
7194
7236
|
onClick: (e) => e.stopPropagation(),
|
|
7195
|
-
children
|
|
7237
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(PortalProvider, { container: boxRef.current, children })
|
|
7196
7238
|
}
|
|
7197
7239
|
)
|
|
7198
7240
|
}
|
|
@@ -7204,9 +7246,9 @@ Modal.displayName = "Modal";
|
|
|
7204
7246
|
var Modal_default = Modal;
|
|
7205
7247
|
|
|
7206
7248
|
// src/components/DatePicker/SingleDatePicker/index.tsx
|
|
7207
|
-
var
|
|
7208
|
-
var
|
|
7209
|
-
var DayCell2 =
|
|
7249
|
+
var import_react11 = __toESM(require("react"), 1);
|
|
7250
|
+
var import_jsx_runtime313 = require("react/jsx-runtime");
|
|
7251
|
+
var DayCell2 = import_react11.default.memo(
|
|
7210
7252
|
({
|
|
7211
7253
|
day,
|
|
7212
7254
|
disabled,
|
|
@@ -7216,7 +7258,7 @@ var DayCell2 = import_react10.default.memo(
|
|
|
7216
7258
|
isEnd,
|
|
7217
7259
|
inRange,
|
|
7218
7260
|
onSelect
|
|
7219
|
-
}) => /* @__PURE__ */ (0,
|
|
7261
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(
|
|
7220
7262
|
"button",
|
|
7221
7263
|
{
|
|
7222
7264
|
type: "button",
|
|
@@ -7258,26 +7300,26 @@ var SingleDatePicker = (props) => {
|
|
|
7258
7300
|
initialYear,
|
|
7259
7301
|
initialMonth
|
|
7260
7302
|
);
|
|
7261
|
-
const [pickerMode, setPickerMode] =
|
|
7262
|
-
const [yearRangeStart, setYearRangeStart] =
|
|
7303
|
+
const [pickerMode, setPickerMode] = import_react11.default.useState("days");
|
|
7304
|
+
const [yearRangeStart, setYearRangeStart] = import_react11.default.useState(
|
|
7263
7305
|
Math.floor((initialYear ?? (/* @__PURE__ */ new Date()).getFullYear()) / 12) * 12
|
|
7264
7306
|
);
|
|
7265
|
-
const minTime =
|
|
7307
|
+
const minTime = import_react11.default.useMemo(
|
|
7266
7308
|
() => minDate ? new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()).getTime() : -Infinity,
|
|
7267
7309
|
[minDate]
|
|
7268
7310
|
);
|
|
7269
|
-
const maxTime =
|
|
7311
|
+
const maxTime = import_react11.default.useMemo(
|
|
7270
7312
|
() => maxDate ? new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()).getTime() : Infinity,
|
|
7271
7313
|
[maxDate]
|
|
7272
7314
|
);
|
|
7273
|
-
const highlightSet =
|
|
7315
|
+
const highlightSet = import_react11.default.useMemo(() => {
|
|
7274
7316
|
const set = /* @__PURE__ */ new Set();
|
|
7275
7317
|
for (const h of highlightDates) {
|
|
7276
7318
|
set.add(`${h.getFullYear()}-${h.getMonth()}-${h.getDate()}`);
|
|
7277
7319
|
}
|
|
7278
7320
|
return set;
|
|
7279
7321
|
}, [highlightDates]);
|
|
7280
|
-
const handleSelect =
|
|
7322
|
+
const handleSelect = import_react11.default.useCallback(
|
|
7281
7323
|
(date) => {
|
|
7282
7324
|
onChange?.(date);
|
|
7283
7325
|
},
|
|
@@ -7314,20 +7356,20 @@ var SingleDatePicker = (props) => {
|
|
|
7314
7356
|
const monthLabels = MONTH_LABELS[locale];
|
|
7315
7357
|
const titleText = pickerMode === "days" ? locale === "ko" ? `${year}\uB144 ${monthLabels[month]}` : `${monthLabels[month]} ${year}` : pickerMode === "months" ? `${year}` : `${yearRangeStart} - ${yearRangeStart + 11}`;
|
|
7316
7358
|
const hasRange = rangeStart != null && rangeEnd != null;
|
|
7317
|
-
return /* @__PURE__ */ (0,
|
|
7359
|
+
return /* @__PURE__ */ (0, import_jsx_runtime313.jsxs)(
|
|
7318
7360
|
"div",
|
|
7319
7361
|
{
|
|
7320
7362
|
className: clsx_default("lib-xplat-datepicker", "single"),
|
|
7321
7363
|
children: [
|
|
7322
|
-
/* @__PURE__ */ (0,
|
|
7323
|
-
/* @__PURE__ */ (0,
|
|
7324
|
-
/* @__PURE__ */ (0,
|
|
7325
|
-
/* @__PURE__ */ (0,
|
|
7364
|
+
/* @__PURE__ */ (0, import_jsx_runtime313.jsxs)("div", { className: "datepicker-header", children: [
|
|
7365
|
+
/* @__PURE__ */ (0, import_jsx_runtime313.jsx)("button", { className: "datepicker-nav", onClick: handlePrev, type: "button", children: /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(ChevronLeftIcon_default, {}) }),
|
|
7366
|
+
/* @__PURE__ */ (0, import_jsx_runtime313.jsx)("button", { className: "datepicker-title", onClick: handleTitleClick, type: "button", children: titleText }),
|
|
7367
|
+
/* @__PURE__ */ (0, import_jsx_runtime313.jsx)("button", { className: "datepicker-nav", onClick: handleNext, type: "button", children: /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(ChevronRightIcon_default, {}) })
|
|
7326
7368
|
] }),
|
|
7327
|
-
/* @__PURE__ */ (0,
|
|
7328
|
-
pickerMode === "years" && /* @__PURE__ */ (0,
|
|
7369
|
+
/* @__PURE__ */ (0, import_jsx_runtime313.jsxs)("div", { className: "datepicker-body", children: [
|
|
7370
|
+
pickerMode === "years" && /* @__PURE__ */ (0, import_jsx_runtime313.jsx)("div", { className: "datepicker-picker-grid", children: Array.from({ length: 12 }, (_, i) => {
|
|
7329
7371
|
const y = yearRangeStart + i;
|
|
7330
|
-
return /* @__PURE__ */ (0,
|
|
7372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(
|
|
7331
7373
|
"button",
|
|
7332
7374
|
{
|
|
7333
7375
|
type: "button",
|
|
@@ -7338,7 +7380,7 @@ var SingleDatePicker = (props) => {
|
|
|
7338
7380
|
y
|
|
7339
7381
|
);
|
|
7340
7382
|
}) }),
|
|
7341
|
-
pickerMode === "months" && /* @__PURE__ */ (0,
|
|
7383
|
+
pickerMode === "months" && /* @__PURE__ */ (0, import_jsx_runtime313.jsx)("div", { className: "datepicker-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(
|
|
7342
7384
|
"button",
|
|
7343
7385
|
{
|
|
7344
7386
|
type: "button",
|
|
@@ -7348,8 +7390,8 @@ var SingleDatePicker = (props) => {
|
|
|
7348
7390
|
},
|
|
7349
7391
|
i
|
|
7350
7392
|
)) }),
|
|
7351
|
-
pickerMode === "days" && /* @__PURE__ */ (0,
|
|
7352
|
-
/* @__PURE__ */ (0,
|
|
7393
|
+
pickerMode === "days" && /* @__PURE__ */ (0, import_jsx_runtime313.jsxs)(import_jsx_runtime313.Fragment, { children: [
|
|
7394
|
+
/* @__PURE__ */ (0, import_jsx_runtime313.jsx)("div", { className: "datepicker-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(
|
|
7353
7395
|
"div",
|
|
7354
7396
|
{
|
|
7355
7397
|
className: clsx_default(
|
|
@@ -7361,7 +7403,7 @@ var SingleDatePicker = (props) => {
|
|
|
7361
7403
|
},
|
|
7362
7404
|
label
|
|
7363
7405
|
)) }),
|
|
7364
|
-
/* @__PURE__ */ (0,
|
|
7406
|
+
/* @__PURE__ */ (0, import_jsx_runtime313.jsx)("div", { className: "datepicker-grid", children: days.map((day, idx) => {
|
|
7365
7407
|
const t = day.date.getTime();
|
|
7366
7408
|
const disabled = t < minTime || t > maxTime;
|
|
7367
7409
|
const selected = value ? isSameDay(day.date, value) : false;
|
|
@@ -7371,7 +7413,7 @@ var SingleDatePicker = (props) => {
|
|
|
7371
7413
|
const isStart = hasRange ? isSameDay(day.date, rangeStart) : false;
|
|
7372
7414
|
const isEnd = hasRange ? isSameDay(day.date, rangeEnd) : false;
|
|
7373
7415
|
const inRangeVal = hasRange ? isInRange(day.date, rangeStart, rangeEnd) : false;
|
|
7374
|
-
return /* @__PURE__ */ (0,
|
|
7416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(
|
|
7375
7417
|
DayCell2,
|
|
7376
7418
|
{
|
|
7377
7419
|
day,
|
|
@@ -7396,7 +7438,7 @@ SingleDatePicker.displayName = "SingleDatePicker";
|
|
|
7396
7438
|
var SingleDatePicker_default = SingleDatePicker;
|
|
7397
7439
|
|
|
7398
7440
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
7399
|
-
var
|
|
7441
|
+
var import_jsx_runtime314 = require("react/jsx-runtime");
|
|
7400
7442
|
var formatDate = (date) => {
|
|
7401
7443
|
if (!date || !(date instanceof Date) || isNaN(date.getTime())) return "";
|
|
7402
7444
|
const y = date.getFullYear();
|
|
@@ -7406,8 +7448,8 @@ var formatDate = (date) => {
|
|
|
7406
7448
|
};
|
|
7407
7449
|
var InputDatePicker = (props) => {
|
|
7408
7450
|
const { value, onChange, minDate, maxDate, disabled, locale = "ko", placeholder } = props;
|
|
7409
|
-
const [isOpen, setIsOpen] =
|
|
7410
|
-
const [tempDate, setTempDate] =
|
|
7451
|
+
const [isOpen, setIsOpen] = import_react12.default.useState(false);
|
|
7452
|
+
const [tempDate, setTempDate] = import_react12.default.useState(value ?? /* @__PURE__ */ new Date());
|
|
7411
7453
|
const handleOpen = () => {
|
|
7412
7454
|
if (disabled) return;
|
|
7413
7455
|
setTempDate(value ?? /* @__PURE__ */ new Date());
|
|
@@ -7423,19 +7465,19 @@ var InputDatePicker = (props) => {
|
|
|
7423
7465
|
const handleClose = () => {
|
|
7424
7466
|
setIsOpen(false);
|
|
7425
7467
|
};
|
|
7426
|
-
return /* @__PURE__ */ (0,
|
|
7427
|
-
/* @__PURE__ */ (0,
|
|
7468
|
+
return /* @__PURE__ */ (0, import_jsx_runtime314.jsxs)("div", { className: clsx_default("lib-xplat-datepicker input-datepicker", disabled && "disabled"), children: [
|
|
7469
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)("div", { className: "input-datepicker-trigger", onClick: handleOpen, children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
7428
7470
|
Input_default,
|
|
7429
7471
|
{
|
|
7430
7472
|
value: formatDate(value),
|
|
7431
7473
|
placeholder,
|
|
7432
|
-
suffix: /* @__PURE__ */ (0,
|
|
7474
|
+
suffix: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(CalenderIcon_default, {}),
|
|
7433
7475
|
disabled,
|
|
7434
7476
|
readOnly: true
|
|
7435
7477
|
}
|
|
7436
7478
|
) }),
|
|
7437
|
-
/* @__PURE__ */ (0,
|
|
7438
|
-
/* @__PURE__ */ (0,
|
|
7479
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ (0, import_jsx_runtime314.jsxs)("div", { className: "lib-xplat-popup-datepicker-card", children: [
|
|
7480
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)("div", { className: "popup-datepicker-content", children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
7439
7481
|
SingleDatePicker_default,
|
|
7440
7482
|
{
|
|
7441
7483
|
value: tempDate,
|
|
@@ -7445,9 +7487,9 @@ var InputDatePicker = (props) => {
|
|
|
7445
7487
|
locale
|
|
7446
7488
|
}
|
|
7447
7489
|
) }),
|
|
7448
|
-
/* @__PURE__ */ (0,
|
|
7449
|
-
/* @__PURE__ */ (0,
|
|
7450
|
-
/* @__PURE__ */ (0,
|
|
7490
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsxs)("div", { className: "popup-datepicker-footer", children: [
|
|
7491
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)(Button_default, { type: "secondary", onClick: handleClose, children: locale === "ko" ? "\uCDE8\uC18C" : "Cancel" }),
|
|
7492
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)(Button_default, { type: "primary", onClick: handleApply, children: locale === "ko" ? "\uC801\uC6A9" : "Apply" })
|
|
7451
7493
|
] })
|
|
7452
7494
|
] }) })
|
|
7453
7495
|
] });
|
|
@@ -7456,20 +7498,20 @@ InputDatePicker.displayName = "InputDatePicker";
|
|
|
7456
7498
|
var InputDatePicker_default = InputDatePicker;
|
|
7457
7499
|
|
|
7458
7500
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
7459
|
-
var
|
|
7501
|
+
var import_react16 = __toESM(require("react"), 1);
|
|
7460
7502
|
|
|
7461
7503
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
7462
|
-
var
|
|
7504
|
+
var import_react15 = __toESM(require("react"), 1);
|
|
7463
7505
|
|
|
7464
7506
|
// src/components/Tab/Tab.tsx
|
|
7465
|
-
var
|
|
7507
|
+
var import_react14 = __toESM(require("react"), 1);
|
|
7466
7508
|
|
|
7467
7509
|
// src/components/Tab/TabItem.tsx
|
|
7468
|
-
var
|
|
7469
|
-
var
|
|
7470
|
-
var TabItem =
|
|
7510
|
+
var import_react13 = __toESM(require("react"), 1);
|
|
7511
|
+
var import_jsx_runtime315 = require("react/jsx-runtime");
|
|
7512
|
+
var TabItem = import_react13.default.forwardRef((props, ref) => {
|
|
7471
7513
|
const { isActive, title, onClick } = props;
|
|
7472
|
-
return /* @__PURE__ */ (0,
|
|
7514
|
+
return /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(
|
|
7473
7515
|
"div",
|
|
7474
7516
|
{
|
|
7475
7517
|
ref,
|
|
@@ -7483,25 +7525,25 @@ TabItem.displayName = "TabItem";
|
|
|
7483
7525
|
var TabItem_default = TabItem;
|
|
7484
7526
|
|
|
7485
7527
|
// src/components/Tab/Tab.tsx
|
|
7486
|
-
var
|
|
7528
|
+
var import_jsx_runtime316 = require("react/jsx-runtime");
|
|
7487
7529
|
var Tab = (props) => {
|
|
7488
7530
|
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
7489
|
-
const [underlineStyle, setUnderlineStyle] =
|
|
7531
|
+
const [underlineStyle, setUnderlineStyle] = import_react14.default.useState({
|
|
7490
7532
|
left: 0,
|
|
7491
7533
|
width: 0
|
|
7492
7534
|
});
|
|
7493
|
-
const itemRefs =
|
|
7535
|
+
const itemRefs = import_react14.default.useRef([]);
|
|
7494
7536
|
const handleChangeActiveTab = (tabItem, tabIdx) => {
|
|
7495
7537
|
onChange(tabItem, tabIdx);
|
|
7496
7538
|
};
|
|
7497
|
-
|
|
7539
|
+
import_react14.default.useEffect(() => {
|
|
7498
7540
|
const el = itemRefs.current[activeIndex];
|
|
7499
7541
|
if (el) {
|
|
7500
7542
|
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
7501
7543
|
}
|
|
7502
7544
|
}, [activeIndex, tabs.length]);
|
|
7503
|
-
return /* @__PURE__ */ (0,
|
|
7504
|
-
tabs.map((tab, idx) => /* @__PURE__ */ (0,
|
|
7545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime316.jsxs)("div", { className: clsx_default("lib-xplat-tab", `type-${type}`, size), children: [
|
|
7546
|
+
tabs.map((tab, idx) => /* @__PURE__ */ (0, import_jsx_runtime316.jsx)(
|
|
7505
7547
|
TabItem_default,
|
|
7506
7548
|
{
|
|
7507
7549
|
onClick: () => handleChangeActiveTab(tab, idx),
|
|
@@ -7513,7 +7555,7 @@ var Tab = (props) => {
|
|
|
7513
7555
|
},
|
|
7514
7556
|
`${tab.value}_${idx}`
|
|
7515
7557
|
)),
|
|
7516
|
-
type === "toggle" && /* @__PURE__ */ (0,
|
|
7558
|
+
type === "toggle" && /* @__PURE__ */ (0, import_jsx_runtime316.jsx)(
|
|
7517
7559
|
"div",
|
|
7518
7560
|
{
|
|
7519
7561
|
className: "tab-toggle-underline",
|
|
@@ -7529,7 +7571,7 @@ Tab.displayName = "Tab";
|
|
|
7529
7571
|
var Tab_default = Tab;
|
|
7530
7572
|
|
|
7531
7573
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
7532
|
-
var
|
|
7574
|
+
var import_jsx_runtime317 = require("react/jsx-runtime");
|
|
7533
7575
|
var RangePicker = (props) => {
|
|
7534
7576
|
const {
|
|
7535
7577
|
startDate,
|
|
@@ -7539,7 +7581,7 @@ var RangePicker = (props) => {
|
|
|
7539
7581
|
maxDate,
|
|
7540
7582
|
locale = "ko"
|
|
7541
7583
|
} = props;
|
|
7542
|
-
const [activeTab, setActiveTab] =
|
|
7584
|
+
const [activeTab, setActiveTab] = import_react15.default.useState("start");
|
|
7543
7585
|
const handleStartChange = (date) => {
|
|
7544
7586
|
if (!date) return;
|
|
7545
7587
|
const newStart = date > endDate ? endDate : date;
|
|
@@ -7552,8 +7594,8 @@ var RangePicker = (props) => {
|
|
|
7552
7594
|
};
|
|
7553
7595
|
const startMaxDate = maxDate && endDate < maxDate ? endDate : endDate;
|
|
7554
7596
|
const endMinDate = minDate && startDate > minDate ? startDate : startDate;
|
|
7555
|
-
return /* @__PURE__ */ (0,
|
|
7556
|
-
/* @__PURE__ */ (0,
|
|
7597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime317.jsxs)("div", { className: clsx_default("lib-xplat-datepicker", "range"), children: [
|
|
7598
|
+
/* @__PURE__ */ (0, import_jsx_runtime317.jsx)("div", { className: "datepicker-range-tabs", children: /* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
|
|
7557
7599
|
Tab_default,
|
|
7558
7600
|
{
|
|
7559
7601
|
activeIndex: activeTab === "start" ? 0 : 1,
|
|
@@ -7566,8 +7608,8 @@ var RangePicker = (props) => {
|
|
|
7566
7608
|
size: "sm"
|
|
7567
7609
|
}
|
|
7568
7610
|
) }),
|
|
7569
|
-
/* @__PURE__ */ (0,
|
|
7570
|
-
/* @__PURE__ */ (0,
|
|
7611
|
+
/* @__PURE__ */ (0, import_jsx_runtime317.jsxs)("div", { className: "datepicker-range-panels", children: [
|
|
7612
|
+
/* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
|
|
7571
7613
|
SingleDatePicker_default,
|
|
7572
7614
|
{
|
|
7573
7615
|
value: startDate,
|
|
@@ -7579,7 +7621,7 @@ var RangePicker = (props) => {
|
|
|
7579
7621
|
locale
|
|
7580
7622
|
}
|
|
7581
7623
|
),
|
|
7582
|
-
/* @__PURE__ */ (0,
|
|
7624
|
+
/* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
|
|
7583
7625
|
SingleDatePicker_default,
|
|
7584
7626
|
{
|
|
7585
7627
|
value: endDate,
|
|
@@ -7592,7 +7634,7 @@ var RangePicker = (props) => {
|
|
|
7592
7634
|
}
|
|
7593
7635
|
)
|
|
7594
7636
|
] }),
|
|
7595
|
-
/* @__PURE__ */ (0,
|
|
7637
|
+
/* @__PURE__ */ (0, import_jsx_runtime317.jsx)("div", { className: "datepicker-range-mobile", children: activeTab === "start" ? /* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
|
|
7596
7638
|
SingleDatePicker_default,
|
|
7597
7639
|
{
|
|
7598
7640
|
value: startDate,
|
|
@@ -7603,7 +7645,7 @@ var RangePicker = (props) => {
|
|
|
7603
7645
|
rangeEnd: endDate,
|
|
7604
7646
|
locale
|
|
7605
7647
|
}
|
|
7606
|
-
) : /* @__PURE__ */ (0,
|
|
7648
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
|
|
7607
7649
|
SingleDatePicker_default,
|
|
7608
7650
|
{
|
|
7609
7651
|
value: endDate,
|
|
@@ -7621,10 +7663,10 @@ RangePicker.displayName = "RangePicker";
|
|
|
7621
7663
|
var RangePicker_default = RangePicker;
|
|
7622
7664
|
|
|
7623
7665
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
7624
|
-
var
|
|
7666
|
+
var import_jsx_runtime318 = require("react/jsx-runtime");
|
|
7625
7667
|
var PopupPicker = (props) => {
|
|
7626
7668
|
const { component, type, locale } = props;
|
|
7627
|
-
const [isOpen, setIsOpen] =
|
|
7669
|
+
const [isOpen, setIsOpen] = import_react16.default.useState(false);
|
|
7628
7670
|
const handleClick = () => setIsOpen(true);
|
|
7629
7671
|
const handleClose = () => setIsOpen(false);
|
|
7630
7672
|
const handleSingleChange = (date) => {
|
|
@@ -7632,11 +7674,11 @@ var PopupPicker = (props) => {
|
|
|
7632
7674
|
props.onChange?.(date);
|
|
7633
7675
|
handleClose();
|
|
7634
7676
|
};
|
|
7635
|
-
return /* @__PURE__ */ (0,
|
|
7636
|
-
|
|
7637
|
-
/* @__PURE__ */ (0,
|
|
7638
|
-
/* @__PURE__ */ (0,
|
|
7639
|
-
type === "single" && /* @__PURE__ */ (0,
|
|
7677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime318.jsxs)("div", { className: "lib-xplat-popup-datepicker", children: [
|
|
7678
|
+
import_react16.default.cloneElement(component, { onClick: handleClick }),
|
|
7679
|
+
/* @__PURE__ */ (0, import_jsx_runtime318.jsx)(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ (0, import_jsx_runtime318.jsxs)("div", { className: clsx_default("lib-xplat-popup-datepicker-card", type === "range" && "range-mode"), children: [
|
|
7680
|
+
/* @__PURE__ */ (0, import_jsx_runtime318.jsxs)("div", { className: "popup-datepicker-content", children: [
|
|
7681
|
+
type === "single" && /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
|
|
7640
7682
|
SingleDatePicker_default,
|
|
7641
7683
|
{
|
|
7642
7684
|
value: props.value,
|
|
@@ -7646,7 +7688,7 @@ var PopupPicker = (props) => {
|
|
|
7646
7688
|
locale
|
|
7647
7689
|
}
|
|
7648
7690
|
),
|
|
7649
|
-
type === "range" && /* @__PURE__ */ (0,
|
|
7691
|
+
type === "range" && /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
|
|
7650
7692
|
RangePicker_default,
|
|
7651
7693
|
{
|
|
7652
7694
|
startDate: props.startDate,
|
|
@@ -7658,8 +7700,8 @@ var PopupPicker = (props) => {
|
|
|
7658
7700
|
}
|
|
7659
7701
|
)
|
|
7660
7702
|
] }),
|
|
7661
|
-
/* @__PURE__ */ (0,
|
|
7662
|
-
/* @__PURE__ */ (0,
|
|
7703
|
+
/* @__PURE__ */ (0, import_jsx_runtime318.jsxs)("div", { className: "popup-datepicker-footer", children: [
|
|
7704
|
+
/* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
|
|
7663
7705
|
Button_default,
|
|
7664
7706
|
{
|
|
7665
7707
|
type: "secondary",
|
|
@@ -7667,7 +7709,7 @@ var PopupPicker = (props) => {
|
|
|
7667
7709
|
children: locale === "ko" ? "\uCDE8\uC18C" : "Cancel"
|
|
7668
7710
|
}
|
|
7669
7711
|
),
|
|
7670
|
-
/* @__PURE__ */ (0,
|
|
7712
|
+
/* @__PURE__ */ (0, import_jsx_runtime318.jsx)(Button_default, { type: "primary", onClick: handleClose, children: locale === "ko" ? "\uC801\uC6A9" : "Apply" })
|
|
7671
7713
|
] })
|
|
7672
7714
|
] }) })
|
|
7673
7715
|
] });
|
|
@@ -7676,10 +7718,10 @@ PopupPicker.displayName = "PopupPicker";
|
|
|
7676
7718
|
var PopupPicker_default = PopupPicker;
|
|
7677
7719
|
|
|
7678
7720
|
// src/components/Divider/Divider.tsx
|
|
7679
|
-
var
|
|
7721
|
+
var import_jsx_runtime319 = require("react/jsx-runtime");
|
|
7680
7722
|
var Divider = (props) => {
|
|
7681
7723
|
const { orientation = "horizontal" } = props;
|
|
7682
|
-
return /* @__PURE__ */ (0,
|
|
7724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime319.jsx)(
|
|
7683
7725
|
"div",
|
|
7684
7726
|
{
|
|
7685
7727
|
className: clsx_default("lib-xplat-divider", orientation),
|
|
@@ -7692,15 +7734,15 @@ Divider.displayName = "Divider";
|
|
|
7692
7734
|
var Divider_default = Divider;
|
|
7693
7735
|
|
|
7694
7736
|
// src/components/Drawer/Drawer.tsx
|
|
7695
|
-
var
|
|
7696
|
-
var
|
|
7697
|
-
var
|
|
7737
|
+
var import_react17 = __toESM(require("react"), 1);
|
|
7738
|
+
var import_react_dom3 = require("react-dom");
|
|
7739
|
+
var import_jsx_runtime320 = require("react/jsx-runtime");
|
|
7698
7740
|
var ANIMATION_DURATION_MS2 = 250;
|
|
7699
7741
|
var Drawer = (props) => {
|
|
7700
7742
|
const { isOpen, onClose, placement = "right", width = 320, title, children } = props;
|
|
7701
|
-
const [mounted, setMounted] =
|
|
7702
|
-
const [visible, setVisible] =
|
|
7703
|
-
|
|
7743
|
+
const [mounted, setMounted] = import_react17.default.useState(false);
|
|
7744
|
+
const [visible, setVisible] = import_react17.default.useState(false);
|
|
7745
|
+
import_react17.default.useEffect(() => {
|
|
7704
7746
|
if (isOpen) {
|
|
7705
7747
|
setMounted(true);
|
|
7706
7748
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -7714,13 +7756,13 @@ var Drawer = (props) => {
|
|
|
7714
7756
|
if (!mounted) return null;
|
|
7715
7757
|
const stateClass = visible ? "enter" : "exit";
|
|
7716
7758
|
const widthValue = typeof width === "number" ? `${width}px` : width;
|
|
7717
|
-
return (0,
|
|
7718
|
-
/* @__PURE__ */ (0,
|
|
7759
|
+
return (0, import_react_dom3.createPortal)(
|
|
7760
|
+
/* @__PURE__ */ (0, import_jsx_runtime320.jsx)(
|
|
7719
7761
|
"div",
|
|
7720
7762
|
{
|
|
7721
7763
|
className: clsx_default("lib-xplat-drawer-overlay", stateClass),
|
|
7722
7764
|
onClick: onClose,
|
|
7723
|
-
children: /* @__PURE__ */ (0,
|
|
7765
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime320.jsxs)(
|
|
7724
7766
|
"div",
|
|
7725
7767
|
{
|
|
7726
7768
|
className: clsx_default("lib-xplat-drawer", placement, stateClass),
|
|
@@ -7729,11 +7771,11 @@ var Drawer = (props) => {
|
|
|
7729
7771
|
"aria-modal": "true",
|
|
7730
7772
|
onClick: (e) => e.stopPropagation(),
|
|
7731
7773
|
children: [
|
|
7732
|
-
title && /* @__PURE__ */ (0,
|
|
7733
|
-
/* @__PURE__ */ (0,
|
|
7734
|
-
/* @__PURE__ */ (0,
|
|
7774
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime320.jsxs)("div", { className: "drawer-header", children: [
|
|
7775
|
+
/* @__PURE__ */ (0, import_jsx_runtime320.jsx)("span", { className: "drawer-title", children: title }),
|
|
7776
|
+
/* @__PURE__ */ (0, import_jsx_runtime320.jsx)("button", { className: "close-btn", onClick: onClose, "aria-label": "\uB2EB\uAE30", children: "\xD7" })
|
|
7735
7777
|
] }),
|
|
7736
|
-
/* @__PURE__ */ (0,
|
|
7778
|
+
/* @__PURE__ */ (0, import_jsx_runtime320.jsx)("div", { className: "drawer-body", children })
|
|
7737
7779
|
]
|
|
7738
7780
|
}
|
|
7739
7781
|
)
|
|
@@ -7746,50 +7788,60 @@ Drawer.displayName = "Drawer";
|
|
|
7746
7788
|
var Drawer_default = Drawer;
|
|
7747
7789
|
|
|
7748
7790
|
// src/components/Dropdown/Dropdown.tsx
|
|
7749
|
-
var
|
|
7791
|
+
var import_react20 = __toESM(require("react"), 1);
|
|
7750
7792
|
|
|
7751
7793
|
// src/tokens/hooks/useAutoPosition.ts
|
|
7752
|
-
var
|
|
7794
|
+
var import_react18 = __toESM(require("react"), 1);
|
|
7753
7795
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
7754
|
-
const [position, setPosition] =
|
|
7796
|
+
const [position, setPosition] = import_react18.default.useState({
|
|
7755
7797
|
position: {},
|
|
7756
7798
|
direction: "bottom"
|
|
7757
7799
|
});
|
|
7758
|
-
const calculatePosition =
|
|
7800
|
+
const calculatePosition = import_react18.default.useCallback(() => {
|
|
7759
7801
|
if (!triggerRef.current || !popRef.current) return;
|
|
7760
7802
|
const triggerRect = triggerRef.current.getBoundingClientRect();
|
|
7761
7803
|
const popRect = popRef.current.getBoundingClientRect();
|
|
7762
|
-
const viewportWidth = window.innerWidth;
|
|
7763
7804
|
const viewportHeight = window.innerHeight;
|
|
7764
|
-
const
|
|
7805
|
+
const viewportWidth = window.innerWidth;
|
|
7765
7806
|
let direction = "bottom";
|
|
7766
|
-
|
|
7807
|
+
let top;
|
|
7808
|
+
let left = triggerRect.left;
|
|
7809
|
+
if (triggerRect.bottom + popRect.height > viewportHeight && triggerRect.top - popRect.height > 0) {
|
|
7767
7810
|
direction = "top";
|
|
7811
|
+
top = triggerRect.top - popRect.height;
|
|
7812
|
+
} else {
|
|
7813
|
+
top = triggerRect.bottom;
|
|
7768
7814
|
}
|
|
7769
|
-
if (
|
|
7770
|
-
|
|
7771
|
-
}
|
|
7772
|
-
if (triggerRect.left < 0) {
|
|
7773
|
-
position2["left"] = 10;
|
|
7815
|
+
if (left + popRect.width > viewportWidth) {
|
|
7816
|
+
left = viewportWidth - popRect.width - 8;
|
|
7774
7817
|
}
|
|
7818
|
+
if (left < 8) left = 8;
|
|
7775
7819
|
setPosition({
|
|
7776
|
-
position:
|
|
7820
|
+
position: { top, left, width: triggerRect.width },
|
|
7777
7821
|
direction
|
|
7778
7822
|
});
|
|
7779
7823
|
}, [triggerRef, popRef]);
|
|
7780
|
-
|
|
7781
|
-
|
|
7824
|
+
import_react18.default.useEffect(() => {
|
|
7825
|
+
if (!enabled) return;
|
|
7826
|
+
const raf = requestAnimationFrame(() => {
|
|
7827
|
+
calculatePosition();
|
|
7828
|
+
});
|
|
7782
7829
|
window.addEventListener("resize", calculatePosition);
|
|
7783
|
-
|
|
7830
|
+
window.addEventListener("scroll", calculatePosition, true);
|
|
7831
|
+
return () => {
|
|
7832
|
+
cancelAnimationFrame(raf);
|
|
7833
|
+
window.removeEventListener("resize", calculatePosition);
|
|
7834
|
+
window.removeEventListener("scroll", calculatePosition, true);
|
|
7835
|
+
};
|
|
7784
7836
|
}, [calculatePosition, enabled]);
|
|
7785
7837
|
return position;
|
|
7786
7838
|
};
|
|
7787
7839
|
var useAutoPosition_default = useAutoPosition;
|
|
7788
7840
|
|
|
7789
7841
|
// src/tokens/hooks/useClickOutside.ts
|
|
7790
|
-
var
|
|
7842
|
+
var import_react19 = __toESM(require("react"), 1);
|
|
7791
7843
|
var useClickOutside = (refs, handler, enabled = true) => {
|
|
7792
|
-
|
|
7844
|
+
import_react19.default.useEffect(() => {
|
|
7793
7845
|
if (!enabled) return;
|
|
7794
7846
|
const refArray = Array.isArray(refs) ? refs : [refs];
|
|
7795
7847
|
const listener = (event) => {
|
|
@@ -7812,17 +7864,17 @@ var useClickOutside = (refs, handler, enabled = true) => {
|
|
|
7812
7864
|
var useClickOutside_default = useClickOutside;
|
|
7813
7865
|
|
|
7814
7866
|
// src/components/Dropdown/Dropdown.tsx
|
|
7815
|
-
var
|
|
7867
|
+
var import_jsx_runtime321 = require("react/jsx-runtime");
|
|
7816
7868
|
var Dropdown = (props) => {
|
|
7817
7869
|
const { items, children } = props;
|
|
7818
|
-
const [isOpen, setIsOpen] =
|
|
7819
|
-
const [mounted, setMounted] =
|
|
7820
|
-
const [visible, setVisible] =
|
|
7821
|
-
const triggerRef =
|
|
7822
|
-
const menuRef =
|
|
7823
|
-
const { position, direction } = useAutoPosition_default(triggerRef, menuRef,
|
|
7824
|
-
useClickOutside_default([triggerRef, menuRef], () => setIsOpen(false));
|
|
7825
|
-
|
|
7870
|
+
const [isOpen, setIsOpen] = import_react20.default.useState(false);
|
|
7871
|
+
const [mounted, setMounted] = import_react20.default.useState(false);
|
|
7872
|
+
const [visible, setVisible] = import_react20.default.useState(false);
|
|
7873
|
+
const triggerRef = import_react20.default.useRef(null);
|
|
7874
|
+
const menuRef = import_react20.default.useRef(null);
|
|
7875
|
+
const { position, direction } = useAutoPosition_default(triggerRef, menuRef, mounted);
|
|
7876
|
+
useClickOutside_default([triggerRef, menuRef], () => setIsOpen(false), isOpen);
|
|
7877
|
+
import_react20.default.useEffect(() => {
|
|
7826
7878
|
if (isOpen) {
|
|
7827
7879
|
setMounted(true);
|
|
7828
7880
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -7837,8 +7889,8 @@ var Dropdown = (props) => {
|
|
|
7837
7889
|
item.onClick?.();
|
|
7838
7890
|
setIsOpen(false);
|
|
7839
7891
|
};
|
|
7840
|
-
return /* @__PURE__ */ (0,
|
|
7841
|
-
/* @__PURE__ */ (0,
|
|
7892
|
+
return /* @__PURE__ */ (0, import_jsx_runtime321.jsxs)("div", { className: "lib-xplat-dropdown", children: [
|
|
7893
|
+
/* @__PURE__ */ (0, import_jsx_runtime321.jsx)(
|
|
7842
7894
|
"div",
|
|
7843
7895
|
{
|
|
7844
7896
|
ref: triggerRef,
|
|
@@ -7847,14 +7899,14 @@ var Dropdown = (props) => {
|
|
|
7847
7899
|
children
|
|
7848
7900
|
}
|
|
7849
7901
|
),
|
|
7850
|
-
mounted && /* @__PURE__ */ (0,
|
|
7902
|
+
mounted && /* @__PURE__ */ (0, import_jsx_runtime321.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime321.jsx)(
|
|
7851
7903
|
"div",
|
|
7852
7904
|
{
|
|
7853
7905
|
ref: menuRef,
|
|
7854
|
-
className: clsx_default("dropdown-menu", direction, { visible }),
|
|
7906
|
+
className: clsx_default("lib-xplat-dropdown-menu", direction, { visible }),
|
|
7855
7907
|
style: { top: position.top, left: position.left },
|
|
7856
7908
|
role: "menu",
|
|
7857
|
-
children: items.map((item) => /* @__PURE__ */ (0,
|
|
7909
|
+
children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime321.jsx)(
|
|
7858
7910
|
"button",
|
|
7859
7911
|
{
|
|
7860
7912
|
className: clsx_default("dropdown-item", {
|
|
@@ -7869,30 +7921,30 @@ var Dropdown = (props) => {
|
|
|
7869
7921
|
item.key
|
|
7870
7922
|
))
|
|
7871
7923
|
}
|
|
7872
|
-
)
|
|
7924
|
+
) })
|
|
7873
7925
|
] });
|
|
7874
7926
|
};
|
|
7875
7927
|
Dropdown.displayName = "Dropdown";
|
|
7876
7928
|
var Dropdown_default = Dropdown;
|
|
7877
7929
|
|
|
7878
7930
|
// src/components/EmptyState/EmptyState.tsx
|
|
7879
|
-
var
|
|
7931
|
+
var import_jsx_runtime322 = require("react/jsx-runtime");
|
|
7880
7932
|
var EmptyState = (props) => {
|
|
7881
7933
|
const { icon, title = "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4", description, action } = props;
|
|
7882
|
-
return /* @__PURE__ */ (0,
|
|
7883
|
-
icon && /* @__PURE__ */ (0,
|
|
7884
|
-
!icon && /* @__PURE__ */ (0,
|
|
7885
|
-
/* @__PURE__ */ (0,
|
|
7886
|
-
description && /* @__PURE__ */ (0,
|
|
7887
|
-
action && /* @__PURE__ */ (0,
|
|
7934
|
+
return /* @__PURE__ */ (0, import_jsx_runtime322.jsxs)("div", { className: "lib-xplat-empty-state", children: [
|
|
7935
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime322.jsx)("div", { className: "empty-icon", children: icon }),
|
|
7936
|
+
!icon && /* @__PURE__ */ (0, import_jsx_runtime322.jsx)("div", { className: "empty-icon", children: /* @__PURE__ */ (0, import_jsx_runtime322.jsx)("svg", { viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime322.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" }) }) }),
|
|
7937
|
+
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)("p", { className: "empty-title", children: title }),
|
|
7938
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime322.jsx)("p", { className: "empty-description", children: description }),
|
|
7939
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime322.jsx)("div", { className: "empty-action", children: action })
|
|
7888
7940
|
] });
|
|
7889
7941
|
};
|
|
7890
7942
|
EmptyState.displayName = "EmptyState";
|
|
7891
7943
|
var EmptyState_default = EmptyState;
|
|
7892
7944
|
|
|
7893
7945
|
// src/components/FileUpload/FileUpload.tsx
|
|
7894
|
-
var
|
|
7895
|
-
var
|
|
7946
|
+
var import_react21 = __toESM(require("react"), 1);
|
|
7947
|
+
var import_jsx_runtime323 = require("react/jsx-runtime");
|
|
7896
7948
|
var FileUpload = (props) => {
|
|
7897
7949
|
const {
|
|
7898
7950
|
accept,
|
|
@@ -7902,8 +7954,8 @@ var FileUpload = (props) => {
|
|
|
7902
7954
|
label = "\uD30C\uC77C\uC744 \uB4DC\uB798\uADF8\uD558\uAC70\uB098 \uD074\uB9AD\uD558\uC5EC \uC5C5\uB85C\uB4DC",
|
|
7903
7955
|
description
|
|
7904
7956
|
} = props;
|
|
7905
|
-
const [isDragOver, setIsDragOver] =
|
|
7906
|
-
const inputRef =
|
|
7957
|
+
const [isDragOver, setIsDragOver] = import_react21.default.useState(false);
|
|
7958
|
+
const inputRef = import_react21.default.useRef(null);
|
|
7907
7959
|
const handleFiles = (fileList) => {
|
|
7908
7960
|
let files = Array.from(fileList);
|
|
7909
7961
|
if (maxSize) {
|
|
@@ -7933,7 +7985,7 @@ var FileUpload = (props) => {
|
|
|
7933
7985
|
handleFiles(e.target.files);
|
|
7934
7986
|
}
|
|
7935
7987
|
};
|
|
7936
|
-
return /* @__PURE__ */ (0,
|
|
7988
|
+
return /* @__PURE__ */ (0, import_jsx_runtime323.jsxs)(
|
|
7937
7989
|
"div",
|
|
7938
7990
|
{
|
|
7939
7991
|
className: clsx_default("lib-xplat-file-upload", { "drag-over": isDragOver }),
|
|
@@ -7942,7 +7994,7 @@ var FileUpload = (props) => {
|
|
|
7942
7994
|
onDragLeave: handleDragLeave,
|
|
7943
7995
|
onClick: () => inputRef.current?.click(),
|
|
7944
7996
|
children: [
|
|
7945
|
-
/* @__PURE__ */ (0,
|
|
7997
|
+
/* @__PURE__ */ (0, import_jsx_runtime323.jsx)(
|
|
7946
7998
|
"input",
|
|
7947
7999
|
{
|
|
7948
8000
|
ref: inputRef,
|
|
@@ -7952,9 +8004,9 @@ var FileUpload = (props) => {
|
|
|
7952
8004
|
onChange: handleChange
|
|
7953
8005
|
}
|
|
7954
8006
|
),
|
|
7955
|
-
/* @__PURE__ */ (0,
|
|
7956
|
-
/* @__PURE__ */ (0,
|
|
7957
|
-
description && /* @__PURE__ */ (0,
|
|
8007
|
+
/* @__PURE__ */ (0, import_jsx_runtime323.jsx)("div", { className: "upload-icon", children: /* @__PURE__ */ (0, import_jsx_runtime323.jsx)(UploadIcon_default, {}) }),
|
|
8008
|
+
/* @__PURE__ */ (0, import_jsx_runtime323.jsx)("p", { className: "upload-label", children: label }),
|
|
8009
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime323.jsx)("p", { className: "upload-description", children: description })
|
|
7958
8010
|
]
|
|
7959
8011
|
}
|
|
7960
8012
|
);
|
|
@@ -7963,10 +8015,10 @@ FileUpload.displayName = "FileUpload";
|
|
|
7963
8015
|
var FileUpload_default = FileUpload;
|
|
7964
8016
|
|
|
7965
8017
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
7966
|
-
var
|
|
8018
|
+
var import_react23 = __toESM(require("react"), 1);
|
|
7967
8019
|
|
|
7968
8020
|
// src/components/HtmlTypeWriter/utils.ts
|
|
7969
|
-
var
|
|
8021
|
+
var import_react22 = __toESM(require("react"), 1);
|
|
7970
8022
|
var voidTags = /* @__PURE__ */ new Set([
|
|
7971
8023
|
"br",
|
|
7972
8024
|
"img",
|
|
@@ -8034,41 +8086,41 @@ var convertNodeToReactWithRange = (node, typedLen, rangeMap) => {
|
|
|
8034
8086
|
props[attr.name] = attr.value;
|
|
8035
8087
|
});
|
|
8036
8088
|
if (voidTags.has(tag)) {
|
|
8037
|
-
return
|
|
8089
|
+
return import_react22.default.createElement(tag, props);
|
|
8038
8090
|
}
|
|
8039
8091
|
const children = Array.from(element.childNodes).map((child) => convertNodeToReactWithRange(child, typedLen, rangeMap)).filter((n) => n != null);
|
|
8040
|
-
return
|
|
8092
|
+
return import_react22.default.createElement(tag, props, ...children);
|
|
8041
8093
|
};
|
|
8042
8094
|
var htmlToReactProgressive = (root, typedLen, rangeMap) => {
|
|
8043
8095
|
const nodes = Array.from(root.childNodes).map((child, idx) => {
|
|
8044
8096
|
const node = convertNodeToReactWithRange(child, typedLen, rangeMap);
|
|
8045
|
-
return node == null ? null :
|
|
8097
|
+
return node == null ? null : import_react22.default.createElement(import_react22.default.Fragment, { key: idx }, node);
|
|
8046
8098
|
}).filter(Boolean);
|
|
8047
8099
|
return nodes.length === 0 ? null : nodes;
|
|
8048
8100
|
};
|
|
8049
8101
|
|
|
8050
8102
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
8051
|
-
var
|
|
8103
|
+
var import_jsx_runtime324 = require("react/jsx-runtime");
|
|
8052
8104
|
var HtmlTypeWriter = ({
|
|
8053
8105
|
html,
|
|
8054
8106
|
duration = 20,
|
|
8055
8107
|
onDone,
|
|
8056
8108
|
onChange
|
|
8057
8109
|
}) => {
|
|
8058
|
-
const [typedLen, setTypedLen] =
|
|
8059
|
-
const doneCalledRef =
|
|
8060
|
-
const { doc, rangeMap, totalLength } =
|
|
8110
|
+
const [typedLen, setTypedLen] = import_react23.default.useState(0);
|
|
8111
|
+
const doneCalledRef = import_react23.default.useRef(false);
|
|
8112
|
+
const { doc, rangeMap, totalLength } = import_react23.default.useMemo(() => {
|
|
8061
8113
|
if (typeof window === "undefined") return { doc: null, rangeMap: /* @__PURE__ */ new Map(), totalLength: 0 };
|
|
8062
8114
|
const decoded = decodeHtmlEntities(html);
|
|
8063
8115
|
const doc2 = new DOMParser().parseFromString(decoded, "text/html");
|
|
8064
8116
|
const { rangeMap: rangeMap2, totalLength: totalLength2 } = buildRangeMap(doc2.body);
|
|
8065
8117
|
return { doc: doc2, rangeMap: rangeMap2, totalLength: totalLength2 };
|
|
8066
8118
|
}, [html]);
|
|
8067
|
-
|
|
8119
|
+
import_react23.default.useEffect(() => {
|
|
8068
8120
|
setTypedLen(0);
|
|
8069
8121
|
doneCalledRef.current = false;
|
|
8070
8122
|
}, [html]);
|
|
8071
|
-
|
|
8123
|
+
import_react23.default.useEffect(() => {
|
|
8072
8124
|
if (!totalLength) return;
|
|
8073
8125
|
if (typedLen >= totalLength) return;
|
|
8074
8126
|
const timer = window.setInterval(() => {
|
|
@@ -8076,33 +8128,33 @@ var HtmlTypeWriter = ({
|
|
|
8076
8128
|
}, duration);
|
|
8077
8129
|
return () => window.clearInterval(timer);
|
|
8078
8130
|
}, [typedLen, totalLength, duration]);
|
|
8079
|
-
|
|
8131
|
+
import_react23.default.useEffect(() => {
|
|
8080
8132
|
if (typedLen > 0 && typedLen < totalLength) {
|
|
8081
8133
|
onChange?.();
|
|
8082
8134
|
}
|
|
8083
8135
|
}, [typedLen, totalLength, onChange]);
|
|
8084
|
-
|
|
8136
|
+
import_react23.default.useEffect(() => {
|
|
8085
8137
|
if (typedLen === totalLength && totalLength > 0 && !doneCalledRef.current) {
|
|
8086
8138
|
doneCalledRef.current = true;
|
|
8087
8139
|
onDone?.();
|
|
8088
8140
|
}
|
|
8089
8141
|
}, [typedLen, totalLength, onDone]);
|
|
8090
|
-
const parsed =
|
|
8142
|
+
const parsed = import_react23.default.useMemo(
|
|
8091
8143
|
() => doc ? htmlToReactProgressive(doc.body, typedLen, rangeMap) : null,
|
|
8092
8144
|
[doc, typedLen, rangeMap]
|
|
8093
8145
|
);
|
|
8094
|
-
return /* @__PURE__ */ (0,
|
|
8146
|
+
return /* @__PURE__ */ (0, import_jsx_runtime324.jsx)("div", { className: "lib-xplat-htmlTypewriter", children: parsed });
|
|
8095
8147
|
};
|
|
8096
8148
|
HtmlTypeWriter.displayName = "HtmlTypeWriter";
|
|
8097
8149
|
var HtmlTypeWriter_default = HtmlTypeWriter;
|
|
8098
8150
|
|
|
8099
8151
|
// src/components/ImageSelector/ImageSelector.tsx
|
|
8100
|
-
var
|
|
8101
|
-
var
|
|
8152
|
+
var import_react24 = __toESM(require("react"), 1);
|
|
8153
|
+
var import_jsx_runtime325 = require("react/jsx-runtime");
|
|
8102
8154
|
var ImageSelector = (props) => {
|
|
8103
8155
|
const { value, label, onChange } = props;
|
|
8104
|
-
const [previewUrl, setPreviewUrl] =
|
|
8105
|
-
|
|
8156
|
+
const [previewUrl, setPreviewUrl] = import_react24.default.useState();
|
|
8157
|
+
import_react24.default.useEffect(() => {
|
|
8106
8158
|
if (!value) {
|
|
8107
8159
|
setPreviewUrl(void 0);
|
|
8108
8160
|
return;
|
|
@@ -8111,7 +8163,7 @@ var ImageSelector = (props) => {
|
|
|
8111
8163
|
setPreviewUrl(url);
|
|
8112
8164
|
return () => URL.revokeObjectURL(url);
|
|
8113
8165
|
}, [value]);
|
|
8114
|
-
const inputRef =
|
|
8166
|
+
const inputRef = import_react24.default.useRef(null);
|
|
8115
8167
|
const handleFileChange = (e) => {
|
|
8116
8168
|
const selectedFile = e.target.files?.[0];
|
|
8117
8169
|
if (selectedFile) {
|
|
@@ -8124,8 +8176,8 @@ var ImageSelector = (props) => {
|
|
|
8124
8176
|
const handleOpenFileDialog = () => {
|
|
8125
8177
|
inputRef.current?.click();
|
|
8126
8178
|
};
|
|
8127
|
-
return /* @__PURE__ */ (0,
|
|
8128
|
-
/* @__PURE__ */ (0,
|
|
8179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime325.jsxs)("div", { className: `lib-xplat-imageselector${value ? "" : " none-value"}`, children: [
|
|
8180
|
+
/* @__PURE__ */ (0, import_jsx_runtime325.jsx)(
|
|
8129
8181
|
"input",
|
|
8130
8182
|
{
|
|
8131
8183
|
type: "file",
|
|
@@ -8135,13 +8187,13 @@ var ImageSelector = (props) => {
|
|
|
8135
8187
|
ref: inputRef
|
|
8136
8188
|
}
|
|
8137
8189
|
),
|
|
8138
|
-
value && /* @__PURE__ */ (0,
|
|
8139
|
-
/* @__PURE__ */ (0,
|
|
8140
|
-
/* @__PURE__ */ (0,
|
|
8190
|
+
value && /* @__PURE__ */ (0, import_jsx_runtime325.jsxs)("div", { className: "action-bar", children: [
|
|
8191
|
+
/* @__PURE__ */ (0, import_jsx_runtime325.jsx)("div", { className: "icon-wrapper", onClick: handleOpenFileDialog, children: /* @__PURE__ */ (0, import_jsx_runtime325.jsx)(UploadIcon_default, {}) }),
|
|
8192
|
+
/* @__PURE__ */ (0, import_jsx_runtime325.jsx)("div", { className: "icon-wrapper", onClick: handleDeleteFile, children: /* @__PURE__ */ (0, import_jsx_runtime325.jsx)(DeleteIcon_default, {}) })
|
|
8141
8193
|
] }),
|
|
8142
|
-
/* @__PURE__ */ (0,
|
|
8143
|
-
/* @__PURE__ */ (0,
|
|
8144
|
-
/* @__PURE__ */ (0,
|
|
8194
|
+
/* @__PURE__ */ (0, import_jsx_runtime325.jsx)("div", { className: "content", children: previewUrl ? /* @__PURE__ */ (0, import_jsx_runtime325.jsx)("img", { src: previewUrl, alt: "preview" }) : /* @__PURE__ */ (0, import_jsx_runtime325.jsxs)("div", { className: "skeleton", onClick: handleOpenFileDialog, children: [
|
|
8195
|
+
/* @__PURE__ */ (0, import_jsx_runtime325.jsx)("div", { className: "icon-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime325.jsx)(ImageIcon_default, {}) }),
|
|
8196
|
+
/* @__PURE__ */ (0, import_jsx_runtime325.jsx)("div", { className: "label", children: label || "\uC774\uBBF8\uC9C0 \uCD94\uAC00\uD558\uAE30" })
|
|
8145
8197
|
] }) })
|
|
8146
8198
|
] });
|
|
8147
8199
|
};
|
|
@@ -8149,7 +8201,7 @@ ImageSelector.displayName = "ImageSelector";
|
|
|
8149
8201
|
var ImageSelector_default = ImageSelector;
|
|
8150
8202
|
|
|
8151
8203
|
// src/components/Pagination/Pagination.tsx
|
|
8152
|
-
var
|
|
8204
|
+
var import_jsx_runtime326 = require("react/jsx-runtime");
|
|
8153
8205
|
var getPageRange = (current, totalPages, siblingCount) => {
|
|
8154
8206
|
const totalNumbers = siblingCount * 2 + 5;
|
|
8155
8207
|
if (totalPages <= totalNumbers) {
|
|
@@ -8192,19 +8244,19 @@ var Pagination = (props) => {
|
|
|
8192
8244
|
onChange?.(page);
|
|
8193
8245
|
}
|
|
8194
8246
|
};
|
|
8195
|
-
return /* @__PURE__ */ (0,
|
|
8196
|
-
/* @__PURE__ */ (0,
|
|
8247
|
+
return /* @__PURE__ */ (0, import_jsx_runtime326.jsxs)("nav", { className: clsx_default("lib-xplat-pagination", size, type), "aria-label": "\uD398\uC774\uC9C0 \uB124\uBE44\uAC8C\uC774\uC158", children: [
|
|
8248
|
+
/* @__PURE__ */ (0, import_jsx_runtime326.jsx)(
|
|
8197
8249
|
"button",
|
|
8198
8250
|
{
|
|
8199
8251
|
className: "page-btn prev",
|
|
8200
8252
|
disabled: current <= 1,
|
|
8201
8253
|
onClick: () => handleClick(current - 1),
|
|
8202
8254
|
"aria-label": "\uC774\uC804 \uD398\uC774\uC9C0",
|
|
8203
|
-
children: /* @__PURE__ */ (0,
|
|
8255
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime326.jsx)(ChevronLeftIcon_default, {})
|
|
8204
8256
|
}
|
|
8205
8257
|
),
|
|
8206
8258
|
pages.map(
|
|
8207
|
-
(page, i) => page === "..." ? /* @__PURE__ */ (0,
|
|
8259
|
+
(page, i) => page === "..." ? /* @__PURE__ */ (0, import_jsx_runtime326.jsx)("span", { className: "dots", children: "..." }, `dots-${i}`) : /* @__PURE__ */ (0, import_jsx_runtime326.jsx)(
|
|
8208
8260
|
"button",
|
|
8209
8261
|
{
|
|
8210
8262
|
className: clsx_default("page-btn", { active: page === current }),
|
|
@@ -8215,14 +8267,14 @@ var Pagination = (props) => {
|
|
|
8215
8267
|
page
|
|
8216
8268
|
)
|
|
8217
8269
|
),
|
|
8218
|
-
/* @__PURE__ */ (0,
|
|
8270
|
+
/* @__PURE__ */ (0, import_jsx_runtime326.jsx)(
|
|
8219
8271
|
"button",
|
|
8220
8272
|
{
|
|
8221
8273
|
className: "page-btn next",
|
|
8222
8274
|
disabled: current >= totalPages,
|
|
8223
8275
|
onClick: () => handleClick(current + 1),
|
|
8224
8276
|
"aria-label": "\uB2E4\uC74C \uD398\uC774\uC9C0",
|
|
8225
|
-
children: /* @__PURE__ */ (0,
|
|
8277
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime326.jsx)(ChevronRightIcon_default, {})
|
|
8226
8278
|
}
|
|
8227
8279
|
)
|
|
8228
8280
|
] });
|
|
@@ -8231,17 +8283,17 @@ Pagination.displayName = "Pagination";
|
|
|
8231
8283
|
var Pagination_default = Pagination;
|
|
8232
8284
|
|
|
8233
8285
|
// src/components/PopOver/PopOver.tsx
|
|
8234
|
-
var
|
|
8235
|
-
var
|
|
8286
|
+
var import_react25 = __toESM(require("react"), 1);
|
|
8287
|
+
var import_jsx_runtime327 = require("react/jsx-runtime");
|
|
8236
8288
|
var PopOver = (props) => {
|
|
8237
8289
|
const { children, isOpen, onClose, PopOverEl } = props;
|
|
8238
|
-
const popRef =
|
|
8239
|
-
const triggerRef =
|
|
8240
|
-
const [localOpen, setLocalOpen] =
|
|
8241
|
-
const [eventTrigger, setEventTrigger] =
|
|
8290
|
+
const popRef = import_react25.default.useRef(null);
|
|
8291
|
+
const triggerRef = import_react25.default.useRef(null);
|
|
8292
|
+
const [localOpen, setLocalOpen] = import_react25.default.useState(false);
|
|
8293
|
+
const [eventTrigger, setEventTrigger] = import_react25.default.useState(false);
|
|
8242
8294
|
useClickOutside_default([popRef, triggerRef], onClose, isOpen);
|
|
8243
8295
|
const position = useAutoPosition_default(triggerRef, popRef, localOpen);
|
|
8244
|
-
|
|
8296
|
+
import_react25.default.useEffect(() => {
|
|
8245
8297
|
if (isOpen) {
|
|
8246
8298
|
setLocalOpen(isOpen);
|
|
8247
8299
|
setTimeout(() => {
|
|
@@ -8254,7 +8306,7 @@ var PopOver = (props) => {
|
|
|
8254
8306
|
}, 200);
|
|
8255
8307
|
}
|
|
8256
8308
|
}, [isOpen]);
|
|
8257
|
-
return /* @__PURE__ */ (0,
|
|
8309
|
+
return /* @__PURE__ */ (0, import_jsx_runtime327.jsxs)(
|
|
8258
8310
|
"div",
|
|
8259
8311
|
{
|
|
8260
8312
|
className: "lib-xplat-pop-over",
|
|
@@ -8264,11 +8316,11 @@ var PopOver = (props) => {
|
|
|
8264
8316
|
},
|
|
8265
8317
|
children: [
|
|
8266
8318
|
children,
|
|
8267
|
-
localOpen && /* @__PURE__ */ (0,
|
|
8319
|
+
localOpen && /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
|
|
8268
8320
|
"div",
|
|
8269
8321
|
{
|
|
8270
8322
|
className: clsx_default(
|
|
8271
|
-
"content
|
|
8323
|
+
"lib-xplat-pop-over-content",
|
|
8272
8324
|
position.direction,
|
|
8273
8325
|
eventTrigger && "visible"
|
|
8274
8326
|
),
|
|
@@ -8278,7 +8330,7 @@ var PopOver = (props) => {
|
|
|
8278
8330
|
},
|
|
8279
8331
|
children: PopOverEl
|
|
8280
8332
|
}
|
|
8281
|
-
)
|
|
8333
|
+
) })
|
|
8282
8334
|
]
|
|
8283
8335
|
}
|
|
8284
8336
|
);
|
|
@@ -8287,7 +8339,7 @@ PopOver.displayName = "PopOver";
|
|
|
8287
8339
|
var PopOver_default = PopOver;
|
|
8288
8340
|
|
|
8289
8341
|
// src/components/Progress/Progress.tsx
|
|
8290
|
-
var
|
|
8342
|
+
var import_jsx_runtime328 = require("react/jsx-runtime");
|
|
8291
8343
|
var Progress = (props) => {
|
|
8292
8344
|
const {
|
|
8293
8345
|
value,
|
|
@@ -8297,8 +8349,8 @@ var Progress = (props) => {
|
|
|
8297
8349
|
showLabel = false
|
|
8298
8350
|
} = props;
|
|
8299
8351
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
8300
|
-
return /* @__PURE__ */ (0,
|
|
8301
|
-
/* @__PURE__ */ (0,
|
|
8352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime328.jsxs)("div", { className: clsx_default("lib-xplat-progress", size, type), children: [
|
|
8353
|
+
/* @__PURE__ */ (0, import_jsx_runtime328.jsx)(
|
|
8302
8354
|
"div",
|
|
8303
8355
|
{
|
|
8304
8356
|
className: "track",
|
|
@@ -8306,7 +8358,7 @@ var Progress = (props) => {
|
|
|
8306
8358
|
"aria-valuenow": value,
|
|
8307
8359
|
"aria-valuemin": 0,
|
|
8308
8360
|
"aria-valuemax": max,
|
|
8309
|
-
children: /* @__PURE__ */ (0,
|
|
8361
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime328.jsx)(
|
|
8310
8362
|
"div",
|
|
8311
8363
|
{
|
|
8312
8364
|
className: "bar",
|
|
@@ -8315,7 +8367,7 @@ var Progress = (props) => {
|
|
|
8315
8367
|
)
|
|
8316
8368
|
}
|
|
8317
8369
|
),
|
|
8318
|
-
showLabel && /* @__PURE__ */ (0,
|
|
8370
|
+
showLabel && /* @__PURE__ */ (0, import_jsx_runtime328.jsxs)("span", { className: "label", children: [
|
|
8319
8371
|
Math.round(percentage),
|
|
8320
8372
|
"%"
|
|
8321
8373
|
] })
|
|
@@ -8325,17 +8377,17 @@ Progress.displayName = "Progress";
|
|
|
8325
8377
|
var Progress_default = Progress;
|
|
8326
8378
|
|
|
8327
8379
|
// src/components/Radio/RadioGroupContext.tsx
|
|
8328
|
-
var
|
|
8329
|
-
var RadioGroupContext =
|
|
8380
|
+
var import_react26 = __toESM(require("react"), 1);
|
|
8381
|
+
var RadioGroupContext = import_react26.default.createContext(
|
|
8330
8382
|
null
|
|
8331
8383
|
);
|
|
8332
8384
|
var useRadioGroupContext = () => {
|
|
8333
|
-
return
|
|
8385
|
+
return import_react26.default.useContext(RadioGroupContext);
|
|
8334
8386
|
};
|
|
8335
8387
|
var RadioGroupContext_default = RadioGroupContext;
|
|
8336
8388
|
|
|
8337
8389
|
// src/components/Radio/Radio.tsx
|
|
8338
|
-
var
|
|
8390
|
+
var import_jsx_runtime329 = require("react/jsx-runtime");
|
|
8339
8391
|
var Radio = (props) => {
|
|
8340
8392
|
const {
|
|
8341
8393
|
label,
|
|
@@ -8353,7 +8405,7 @@ var Radio = (props) => {
|
|
|
8353
8405
|
value,
|
|
8354
8406
|
onChange: rest.onChange
|
|
8355
8407
|
};
|
|
8356
|
-
return /* @__PURE__ */ (0,
|
|
8408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime329.jsxs)(
|
|
8357
8409
|
"label",
|
|
8358
8410
|
{
|
|
8359
8411
|
className: clsx_default(
|
|
@@ -8363,18 +8415,18 @@ var Radio = (props) => {
|
|
|
8363
8415
|
localChecked ? "checked" : void 0
|
|
8364
8416
|
),
|
|
8365
8417
|
children: [
|
|
8366
|
-
/* @__PURE__ */ (0,
|
|
8367
|
-
/* @__PURE__ */ (0,
|
|
8418
|
+
/* @__PURE__ */ (0, import_jsx_runtime329.jsx)("input", { ...rest, ...inputProps, checked: localChecked, type: "radio" }),
|
|
8419
|
+
/* @__PURE__ */ (0, import_jsx_runtime329.jsx)(
|
|
8368
8420
|
"div",
|
|
8369
8421
|
{
|
|
8370
8422
|
className: clsx_default(
|
|
8371
8423
|
"circle",
|
|
8372
8424
|
localChecked ? "checked" : void 0
|
|
8373
8425
|
),
|
|
8374
|
-
children: localChecked && /* @__PURE__ */ (0,
|
|
8426
|
+
children: localChecked && /* @__PURE__ */ (0, import_jsx_runtime329.jsx)("div", { className: "inner-circle" })
|
|
8375
8427
|
}
|
|
8376
8428
|
),
|
|
8377
|
-
label && /* @__PURE__ */ (0,
|
|
8429
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime329.jsx)("span", { children: label })
|
|
8378
8430
|
]
|
|
8379
8431
|
}
|
|
8380
8432
|
);
|
|
@@ -8383,28 +8435,28 @@ Radio.displayName = "Radio";
|
|
|
8383
8435
|
var Radio_default = Radio;
|
|
8384
8436
|
|
|
8385
8437
|
// src/components/Radio/RadioGroup.tsx
|
|
8386
|
-
var
|
|
8438
|
+
var import_jsx_runtime330 = require("react/jsx-runtime");
|
|
8387
8439
|
var RadioGroup = (props) => {
|
|
8388
8440
|
const { children, ...rest } = props;
|
|
8389
|
-
return /* @__PURE__ */ (0,
|
|
8441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime330.jsx)(import_jsx_runtime330.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime330.jsx)(RadioGroupContext_default.Provider, { value: rest, children }) });
|
|
8390
8442
|
};
|
|
8391
8443
|
RadioGroup.displayName = "RadioGroup";
|
|
8392
8444
|
var RadioGroup_default = RadioGroup;
|
|
8393
8445
|
|
|
8394
8446
|
// src/components/Select/Select.tsx
|
|
8395
|
-
var
|
|
8447
|
+
var import_react29 = __toESM(require("react"), 1);
|
|
8396
8448
|
|
|
8397
8449
|
// src/components/Select/context.ts
|
|
8398
|
-
var
|
|
8399
|
-
var SelectContext =
|
|
8450
|
+
var import_react27 = __toESM(require("react"), 1);
|
|
8451
|
+
var SelectContext = import_react27.default.createContext(null);
|
|
8400
8452
|
var context_default = SelectContext;
|
|
8401
8453
|
|
|
8402
8454
|
// src/components/Select/SelectItem.tsx
|
|
8403
|
-
var
|
|
8404
|
-
var
|
|
8455
|
+
var import_react28 = __toESM(require("react"), 1);
|
|
8456
|
+
var import_jsx_runtime331 = require("react/jsx-runtime");
|
|
8405
8457
|
var SelectItem = (props) => {
|
|
8406
8458
|
const { children, value, onClick, disabled = false } = props;
|
|
8407
|
-
const ctx =
|
|
8459
|
+
const ctx = import_react28.default.useContext(context_default);
|
|
8408
8460
|
const handleClick = (e) => {
|
|
8409
8461
|
e.preventDefault();
|
|
8410
8462
|
e.stopPropagation();
|
|
@@ -8413,7 +8465,7 @@ var SelectItem = (props) => {
|
|
|
8413
8465
|
ctx?.close();
|
|
8414
8466
|
onClick?.();
|
|
8415
8467
|
};
|
|
8416
|
-
return /* @__PURE__ */ (0,
|
|
8468
|
+
return /* @__PURE__ */ (0, import_jsx_runtime331.jsx)(
|
|
8417
8469
|
"div",
|
|
8418
8470
|
{
|
|
8419
8471
|
className: clsx_default("select-item", disabled && "disabled"),
|
|
@@ -8434,7 +8486,7 @@ SelectItem.displayName = "Select.Item";
|
|
|
8434
8486
|
var SelectItem_default = SelectItem;
|
|
8435
8487
|
|
|
8436
8488
|
// src/components/Select/Select.tsx
|
|
8437
|
-
var
|
|
8489
|
+
var import_jsx_runtime332 = require("react/jsx-runtime");
|
|
8438
8490
|
var ANIMATION_DURATION_MS3 = 200;
|
|
8439
8491
|
var SelectRoot = (props) => {
|
|
8440
8492
|
const {
|
|
@@ -8446,26 +8498,26 @@ var SelectRoot = (props) => {
|
|
|
8446
8498
|
error = false,
|
|
8447
8499
|
size = "md"
|
|
8448
8500
|
} = props;
|
|
8449
|
-
const itemChildren =
|
|
8450
|
-
(child) =>
|
|
8501
|
+
const itemChildren = import_react29.default.Children.toArray(children).filter(
|
|
8502
|
+
(child) => import_react29.default.isValidElement(child) && child.type === SelectItem_default
|
|
8451
8503
|
);
|
|
8452
8504
|
const isControlled = valueProp !== void 0;
|
|
8453
|
-
const [isOpen, setOpen] =
|
|
8454
|
-
const [uncontrolledLabel, setUncontrolledLabel] =
|
|
8455
|
-
const controlledLabel =
|
|
8505
|
+
const [isOpen, setOpen] = import_react29.default.useState(false);
|
|
8506
|
+
const [uncontrolledLabel, setUncontrolledLabel] = import_react29.default.useState(null);
|
|
8507
|
+
const controlledLabel = import_react29.default.useMemo(() => {
|
|
8456
8508
|
if (!isControlled) return null;
|
|
8457
8509
|
const match = itemChildren.find((child) => child.props.value === valueProp);
|
|
8458
8510
|
return match ? match.props.children : null;
|
|
8459
8511
|
}, [isControlled, valueProp, itemChildren]);
|
|
8460
8512
|
const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
|
|
8461
|
-
const triggerRef =
|
|
8462
|
-
const contentRef =
|
|
8463
|
-
const [mounted, setMounted] =
|
|
8464
|
-
const [visible, setVisible] =
|
|
8465
|
-
|
|
8513
|
+
const triggerRef = import_react29.default.useRef(null);
|
|
8514
|
+
const contentRef = import_react29.default.useRef(null);
|
|
8515
|
+
const [mounted, setMounted] = import_react29.default.useState(false);
|
|
8516
|
+
const [visible, setVisible] = import_react29.default.useState(false);
|
|
8517
|
+
import_react29.default.useEffect(() => {
|
|
8466
8518
|
if (disabled && isOpen) setOpen(false);
|
|
8467
8519
|
}, [disabled, isOpen]);
|
|
8468
|
-
|
|
8520
|
+
import_react29.default.useEffect(() => {
|
|
8469
8521
|
if (isOpen) {
|
|
8470
8522
|
setMounted(true);
|
|
8471
8523
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -8475,12 +8527,12 @@ var SelectRoot = (props) => {
|
|
|
8475
8527
|
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS3);
|
|
8476
8528
|
return () => clearTimeout(t);
|
|
8477
8529
|
}, [isOpen]);
|
|
8478
|
-
const open =
|
|
8479
|
-
const close =
|
|
8480
|
-
const toggle =
|
|
8530
|
+
const open = import_react29.default.useCallback(() => setOpen(true), []);
|
|
8531
|
+
const close = import_react29.default.useCallback(() => setOpen(false), []);
|
|
8532
|
+
const toggle = import_react29.default.useCallback(() => setOpen((prev) => !prev), []);
|
|
8481
8533
|
useClickOutside_default([contentRef, triggerRef], close, isOpen);
|
|
8482
8534
|
const position = useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
8483
|
-
const setSelected =
|
|
8535
|
+
const setSelected = import_react29.default.useCallback(
|
|
8484
8536
|
(label, itemValue) => {
|
|
8485
8537
|
if (!isControlled) {
|
|
8486
8538
|
setUncontrolledLabel(label);
|
|
@@ -8489,7 +8541,7 @@ var SelectRoot = (props) => {
|
|
|
8489
8541
|
},
|
|
8490
8542
|
[isControlled, onChange]
|
|
8491
8543
|
);
|
|
8492
|
-
const ctxValue =
|
|
8544
|
+
const ctxValue = import_react29.default.useMemo(
|
|
8493
8545
|
() => ({
|
|
8494
8546
|
isOpen,
|
|
8495
8547
|
mounted,
|
|
@@ -8510,7 +8562,7 @@ var SelectRoot = (props) => {
|
|
|
8510
8562
|
if (disabled) return;
|
|
8511
8563
|
toggle();
|
|
8512
8564
|
};
|
|
8513
|
-
return /* @__PURE__ */ (0,
|
|
8565
|
+
return /* @__PURE__ */ (0, import_jsx_runtime332.jsx)(context_default.Provider, { value: ctxValue, children: /* @__PURE__ */ (0, import_jsx_runtime332.jsxs)(
|
|
8514
8566
|
"div",
|
|
8515
8567
|
{
|
|
8516
8568
|
className: clsx_default(
|
|
@@ -8521,7 +8573,7 @@ var SelectRoot = (props) => {
|
|
|
8521
8573
|
mounted && "is-open"
|
|
8522
8574
|
),
|
|
8523
8575
|
children: [
|
|
8524
|
-
/* @__PURE__ */ (0,
|
|
8576
|
+
/* @__PURE__ */ (0, import_jsx_runtime332.jsxs)(
|
|
8525
8577
|
"div",
|
|
8526
8578
|
{
|
|
8527
8579
|
ref: triggerRef,
|
|
@@ -8545,7 +8597,7 @@ var SelectRoot = (props) => {
|
|
|
8545
8597
|
}
|
|
8546
8598
|
},
|
|
8547
8599
|
children: [
|
|
8548
|
-
/* @__PURE__ */ (0,
|
|
8600
|
+
/* @__PURE__ */ (0, import_jsx_runtime332.jsx)(
|
|
8549
8601
|
"span",
|
|
8550
8602
|
{
|
|
8551
8603
|
className: clsx_default(
|
|
@@ -8555,27 +8607,27 @@ var SelectRoot = (props) => {
|
|
|
8555
8607
|
children: selectedLabel ?? placeholder
|
|
8556
8608
|
}
|
|
8557
8609
|
),
|
|
8558
|
-
/* @__PURE__ */ (0,
|
|
8610
|
+
/* @__PURE__ */ (0, import_jsx_runtime332.jsx)(
|
|
8559
8611
|
"span",
|
|
8560
8612
|
{
|
|
8561
8613
|
className: clsx_default("select-trigger-icon", isOpen && "open"),
|
|
8562
8614
|
"aria-hidden": true,
|
|
8563
|
-
children: /* @__PURE__ */ (0,
|
|
8615
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime332.jsx)(ChevronDownIcon_default, {})
|
|
8564
8616
|
}
|
|
8565
8617
|
)
|
|
8566
8618
|
]
|
|
8567
8619
|
}
|
|
8568
8620
|
),
|
|
8569
|
-
mounted && /* @__PURE__ */ (0,
|
|
8621
|
+
mounted && /* @__PURE__ */ (0, import_jsx_runtime332.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime332.jsx)(
|
|
8570
8622
|
"div",
|
|
8571
8623
|
{
|
|
8572
|
-
className: clsx_default("select-content", position.direction, stateClass),
|
|
8624
|
+
className: clsx_default("lib-xplat-select-content", position.direction, stateClass),
|
|
8573
8625
|
ref: contentRef,
|
|
8574
|
-
style: { ...position.position },
|
|
8626
|
+
style: { ...position.position, minWidth: position.position.width },
|
|
8575
8627
|
role: "listbox",
|
|
8576
|
-
children: itemChildren
|
|
8628
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime332.jsx)(context_default.Provider, { value: ctxValue, children: itemChildren })
|
|
8577
8629
|
}
|
|
8578
|
-
)
|
|
8630
|
+
) })
|
|
8579
8631
|
]
|
|
8580
8632
|
}
|
|
8581
8633
|
) });
|
|
@@ -8587,14 +8639,14 @@ var Select = Object.assign(SelectRoot, {
|
|
|
8587
8639
|
var Select_default = Select;
|
|
8588
8640
|
|
|
8589
8641
|
// src/components/Skeleton/Skeleton.tsx
|
|
8590
|
-
var
|
|
8642
|
+
var import_jsx_runtime333 = require("react/jsx-runtime");
|
|
8591
8643
|
var Skeleton = (props) => {
|
|
8592
8644
|
const { variant = "text", width, height } = props;
|
|
8593
8645
|
const style = {
|
|
8594
8646
|
width: typeof width === "number" ? `${width}px` : width,
|
|
8595
8647
|
height: typeof height === "number" ? `${height}px` : height
|
|
8596
8648
|
};
|
|
8597
|
-
return /* @__PURE__ */ (0,
|
|
8649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime333.jsx)(
|
|
8598
8650
|
"div",
|
|
8599
8651
|
{
|
|
8600
8652
|
className: clsx_default("lib-xplat-skeleton", variant),
|
|
@@ -8607,20 +8659,20 @@ Skeleton.displayName = "Skeleton";
|
|
|
8607
8659
|
var Skeleton_default = Skeleton;
|
|
8608
8660
|
|
|
8609
8661
|
// src/components/Spinner/Spinner.tsx
|
|
8610
|
-
var
|
|
8662
|
+
var import_jsx_runtime334 = require("react/jsx-runtime");
|
|
8611
8663
|
var Spinner = (props) => {
|
|
8612
8664
|
const {
|
|
8613
8665
|
size = "md",
|
|
8614
8666
|
type = "brand"
|
|
8615
8667
|
} = props;
|
|
8616
|
-
return /* @__PURE__ */ (0,
|
|
8668
|
+
return /* @__PURE__ */ (0, import_jsx_runtime334.jsx)(
|
|
8617
8669
|
"div",
|
|
8618
8670
|
{
|
|
8619
8671
|
className: clsx_default("lib-xplat-spinner", size, type),
|
|
8620
8672
|
role: "status",
|
|
8621
8673
|
"aria-label": "\uB85C\uB529 \uC911",
|
|
8622
|
-
children: /* @__PURE__ */ (0,
|
|
8623
|
-
/* @__PURE__ */ (0,
|
|
8674
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime334.jsxs)("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
8675
|
+
/* @__PURE__ */ (0, import_jsx_runtime334.jsx)(
|
|
8624
8676
|
"circle",
|
|
8625
8677
|
{
|
|
8626
8678
|
className: "track",
|
|
@@ -8630,7 +8682,7 @@ var Spinner = (props) => {
|
|
|
8630
8682
|
strokeWidth: "3"
|
|
8631
8683
|
}
|
|
8632
8684
|
),
|
|
8633
|
-
/* @__PURE__ */ (0,
|
|
8685
|
+
/* @__PURE__ */ (0, import_jsx_runtime334.jsx)(
|
|
8634
8686
|
"circle",
|
|
8635
8687
|
{
|
|
8636
8688
|
className: "indicator",
|
|
@@ -8649,20 +8701,20 @@ Spinner.displayName = "Spinner";
|
|
|
8649
8701
|
var Spinner_default = Spinner;
|
|
8650
8702
|
|
|
8651
8703
|
// src/components/Steps/Steps.tsx
|
|
8652
|
-
var
|
|
8704
|
+
var import_jsx_runtime335 = require("react/jsx-runtime");
|
|
8653
8705
|
var Steps = (props) => {
|
|
8654
8706
|
const {
|
|
8655
8707
|
items,
|
|
8656
8708
|
current,
|
|
8657
8709
|
type = "brand"
|
|
8658
8710
|
} = props;
|
|
8659
|
-
return /* @__PURE__ */ (0,
|
|
8711
|
+
return /* @__PURE__ */ (0, import_jsx_runtime335.jsx)("div", { className: clsx_default("lib-xplat-steps", type), children: items.map((item, index) => {
|
|
8660
8712
|
const status = index < current ? "completed" : index === current ? "active" : "pending";
|
|
8661
|
-
return /* @__PURE__ */ (0,
|
|
8662
|
-
/* @__PURE__ */ (0,
|
|
8663
|
-
/* @__PURE__ */ (0,
|
|
8664
|
-
/* @__PURE__ */ (0,
|
|
8665
|
-
item.description && /* @__PURE__ */ (0,
|
|
8713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime335.jsxs)("div", { className: clsx_default("step-item", status), children: [
|
|
8714
|
+
/* @__PURE__ */ (0, import_jsx_runtime335.jsx)("div", { className: "step-circle", children: status === "completed" ? /* @__PURE__ */ (0, import_jsx_runtime335.jsx)(CheckIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime335.jsx)("span", { children: index + 1 }) }),
|
|
8715
|
+
/* @__PURE__ */ (0, import_jsx_runtime335.jsxs)("div", { className: "step-content", children: [
|
|
8716
|
+
/* @__PURE__ */ (0, import_jsx_runtime335.jsx)("span", { className: "step-title", children: item.title }),
|
|
8717
|
+
item.description && /* @__PURE__ */ (0, import_jsx_runtime335.jsx)("span", { className: "step-description", children: item.description })
|
|
8666
8718
|
] })
|
|
8667
8719
|
] }, index);
|
|
8668
8720
|
}) });
|
|
@@ -8671,8 +8723,8 @@ Steps.displayName = "Steps";
|
|
|
8671
8723
|
var Steps_default = Steps;
|
|
8672
8724
|
|
|
8673
8725
|
// src/components/Swiper/Swiper.tsx
|
|
8674
|
-
var
|
|
8675
|
-
var
|
|
8726
|
+
var import_react30 = __toESM(require("react"), 1);
|
|
8727
|
+
var import_jsx_runtime336 = require("react/jsx-runtime");
|
|
8676
8728
|
var Swiper = (props) => {
|
|
8677
8729
|
const {
|
|
8678
8730
|
auto = false,
|
|
@@ -8695,23 +8747,23 @@ var Swiper = (props) => {
|
|
|
8695
8747
|
const maxIndex = Math.max(0, totalSlides - viewItemCount);
|
|
8696
8748
|
const useLoop = loop && canSlide;
|
|
8697
8749
|
const cloneCount = useLoop ? totalSlides : 0;
|
|
8698
|
-
const extendedItems =
|
|
8750
|
+
const extendedItems = import_react30.default.useMemo(() => {
|
|
8699
8751
|
if (!useLoop) return items;
|
|
8700
8752
|
return [...items, ...items, ...items];
|
|
8701
8753
|
}, [items, useLoop]);
|
|
8702
8754
|
const initialIdx = Math.max(0, Math.min(indexProp ?? 0, maxIndex));
|
|
8703
|
-
const [innerIndex, setInnerIndex] =
|
|
8755
|
+
const [innerIndex, setInnerIndex] = import_react30.default.useState(
|
|
8704
8756
|
useLoop ? cloneCount + initialIdx : initialIdx
|
|
8705
8757
|
);
|
|
8706
|
-
const [isDragging, setIsDragging] =
|
|
8707
|
-
const [dragOffset, setDragOffset] =
|
|
8708
|
-
const [animated, setAnimated] =
|
|
8709
|
-
const [containerWidth, setContainerWidth] =
|
|
8710
|
-
const containerRef =
|
|
8711
|
-
const startXRef =
|
|
8712
|
-
const startTimeRef =
|
|
8713
|
-
const autoplayTimerRef =
|
|
8714
|
-
|
|
8758
|
+
const [isDragging, setIsDragging] = import_react30.default.useState(false);
|
|
8759
|
+
const [dragOffset, setDragOffset] = import_react30.default.useState(0);
|
|
8760
|
+
const [animated, setAnimated] = import_react30.default.useState(true);
|
|
8761
|
+
const [containerWidth, setContainerWidth] = import_react30.default.useState(0);
|
|
8762
|
+
const containerRef = import_react30.default.useRef(null);
|
|
8763
|
+
const startXRef = import_react30.default.useRef(0);
|
|
8764
|
+
const startTimeRef = import_react30.default.useRef(0);
|
|
8765
|
+
const autoplayTimerRef = import_react30.default.useRef(null);
|
|
8766
|
+
import_react30.default.useEffect(() => {
|
|
8715
8767
|
const el = containerRef.current;
|
|
8716
8768
|
if (!el) return;
|
|
8717
8769
|
const ro = new ResizeObserver((entries) => {
|
|
@@ -8730,7 +8782,7 @@ var Swiper = (props) => {
|
|
|
8730
8782
|
return ((inner - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
8731
8783
|
};
|
|
8732
8784
|
const realIndex = getRealIndex(innerIndex);
|
|
8733
|
-
const moveToInner =
|
|
8785
|
+
const moveToInner = import_react30.default.useCallback(
|
|
8734
8786
|
(idx, withAnim = true) => {
|
|
8735
8787
|
if (!useLoop) {
|
|
8736
8788
|
setAnimated(withAnim);
|
|
@@ -8758,7 +8810,7 @@ var Swiper = (props) => {
|
|
|
8758
8810
|
},
|
|
8759
8811
|
[useLoop, cloneCount, totalSlides]
|
|
8760
8812
|
);
|
|
8761
|
-
const handleTransitionEnd =
|
|
8813
|
+
const handleTransitionEnd = import_react30.default.useCallback(() => {
|
|
8762
8814
|
if (!useLoop) return;
|
|
8763
8815
|
const real = getRealIndex(innerIndex);
|
|
8764
8816
|
const canonical = cloneCount + real;
|
|
@@ -8768,7 +8820,7 @@ var Swiper = (props) => {
|
|
|
8768
8820
|
}
|
|
8769
8821
|
onChange?.(Math.min(real, maxIndex));
|
|
8770
8822
|
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange]);
|
|
8771
|
-
const slideTo =
|
|
8823
|
+
const slideTo = import_react30.default.useCallback(
|
|
8772
8824
|
(logicalIndex) => {
|
|
8773
8825
|
if (!canSlide) return;
|
|
8774
8826
|
const clamped = useLoop ? logicalIndex : Math.max(0, Math.min(logicalIndex, maxIndex));
|
|
@@ -8778,7 +8830,7 @@ var Swiper = (props) => {
|
|
|
8778
8830
|
},
|
|
8779
8831
|
[canSlide, useLoop, cloneCount, maxIndex, onChange, moveToInner]
|
|
8780
8832
|
);
|
|
8781
|
-
const slideNext =
|
|
8833
|
+
const slideNext = import_react30.default.useCallback(() => {
|
|
8782
8834
|
if (!canSlide) return;
|
|
8783
8835
|
const nextInner = innerIndex + slideBy;
|
|
8784
8836
|
if (useLoop) {
|
|
@@ -8787,7 +8839,7 @@ var Swiper = (props) => {
|
|
|
8787
8839
|
moveToInner(Math.min(nextInner, maxIndex), true);
|
|
8788
8840
|
}
|
|
8789
8841
|
}, [canSlide, useLoop, innerIndex, slideBy, maxIndex, moveToInner]);
|
|
8790
|
-
const slidePrev =
|
|
8842
|
+
const slidePrev = import_react30.default.useCallback(() => {
|
|
8791
8843
|
if (!canSlide) return;
|
|
8792
8844
|
const prevInner = innerIndex - slideBy;
|
|
8793
8845
|
if (useLoop) {
|
|
@@ -8796,7 +8848,7 @@ var Swiper = (props) => {
|
|
|
8796
8848
|
moveToInner(Math.max(prevInner, 0), true);
|
|
8797
8849
|
}
|
|
8798
8850
|
}, [canSlide, useLoop, innerIndex, slideBy, moveToInner]);
|
|
8799
|
-
|
|
8851
|
+
import_react30.default.useEffect(() => {
|
|
8800
8852
|
if (indexProp === void 0) return;
|
|
8801
8853
|
const clamped = Math.max(0, Math.min(indexProp, maxIndex));
|
|
8802
8854
|
const target = useLoop ? cloneCount + clamped : clamped;
|
|
@@ -8804,12 +8856,12 @@ var Swiper = (props) => {
|
|
|
8804
8856
|
moveToInner(target, true);
|
|
8805
8857
|
}
|
|
8806
8858
|
}, [indexProp]);
|
|
8807
|
-
|
|
8859
|
+
import_react30.default.useImperativeHandle(swiperRef, () => ({
|
|
8808
8860
|
slidePrev,
|
|
8809
8861
|
slideNext,
|
|
8810
8862
|
slideTo
|
|
8811
8863
|
}));
|
|
8812
|
-
|
|
8864
|
+
import_react30.default.useEffect(() => {
|
|
8813
8865
|
if (!auto || !canSlide) return;
|
|
8814
8866
|
autoplayTimerRef.current = setInterval(slideNext, autoplayDelay);
|
|
8815
8867
|
return () => {
|
|
@@ -8832,7 +8884,7 @@ var Swiper = (props) => {
|
|
|
8832
8884
|
startXRef.current = getClientX(e);
|
|
8833
8885
|
startTimeRef.current = Date.now();
|
|
8834
8886
|
};
|
|
8835
|
-
|
|
8887
|
+
import_react30.default.useEffect(() => {
|
|
8836
8888
|
if (!isDragging) return;
|
|
8837
8889
|
const handleMove = (e) => {
|
|
8838
8890
|
setDragOffset(getClientX(e) - startXRef.current);
|
|
@@ -8870,8 +8922,8 @@ var Swiper = (props) => {
|
|
|
8870
8922
|
}, [isDragging, dragOffset, innerIndex, useLoop, maxIndex, slideStep, moveToInner]);
|
|
8871
8923
|
const slideWidthPercent = 100 / viewItemCount;
|
|
8872
8924
|
const gapAdjust = spaceBetween * (viewItemCount - 1) / viewItemCount;
|
|
8873
|
-
const slideElements =
|
|
8874
|
-
() => extendedItems.map((item, idx) => /* @__PURE__ */ (0,
|
|
8925
|
+
const slideElements = import_react30.default.useMemo(
|
|
8926
|
+
() => extendedItems.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(
|
|
8875
8927
|
"div",
|
|
8876
8928
|
{
|
|
8877
8929
|
className: "lib-xplat-swiper__slide",
|
|
@@ -8890,14 +8942,14 @@ var Swiper = (props) => {
|
|
|
8890
8942
|
Math.floor(realIndex / slideBy),
|
|
8891
8943
|
totalSteps - 1
|
|
8892
8944
|
);
|
|
8893
|
-
return /* @__PURE__ */ (0,
|
|
8894
|
-
/* @__PURE__ */ (0,
|
|
8945
|
+
return /* @__PURE__ */ (0, import_jsx_runtime336.jsxs)("div", { className: "lib-xplat-swiper", ref: containerRef, children: [
|
|
8946
|
+
/* @__PURE__ */ (0, import_jsx_runtime336.jsx)(
|
|
8895
8947
|
"div",
|
|
8896
8948
|
{
|
|
8897
8949
|
className: "lib-xplat-swiper__viewport",
|
|
8898
8950
|
onMouseDown: handleDragStart,
|
|
8899
8951
|
onTouchStart: handleDragStart,
|
|
8900
|
-
children: /* @__PURE__ */ (0,
|
|
8952
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(
|
|
8901
8953
|
"div",
|
|
8902
8954
|
{
|
|
8903
8955
|
className: clsx_default(
|
|
@@ -8915,7 +8967,7 @@ var Swiper = (props) => {
|
|
|
8915
8967
|
)
|
|
8916
8968
|
}
|
|
8917
8969
|
),
|
|
8918
|
-
showProgress && canSlide && /* @__PURE__ */ (0,
|
|
8970
|
+
showProgress && canSlide && /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("div", { className: "lib-xplat-swiper__progress", children: /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("div", { className: "lib-xplat-swiper__progress-track", children: /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(
|
|
8919
8971
|
"span",
|
|
8920
8972
|
{
|
|
8921
8973
|
className: "lib-xplat-swiper__progress-fill",
|
|
@@ -8925,7 +8977,7 @@ var Swiper = (props) => {
|
|
|
8925
8977
|
}
|
|
8926
8978
|
}
|
|
8927
8979
|
) }) }),
|
|
8928
|
-
canSlide && /* @__PURE__ */ (0,
|
|
8980
|
+
canSlide && /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("div", { className: "lib-xplat-swiper__dots", children: Array.from({ length: totalSteps }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(
|
|
8929
8981
|
"button",
|
|
8930
8982
|
{
|
|
8931
8983
|
className: clsx_default(
|
|
@@ -8943,8 +8995,8 @@ Swiper.displayName = "Swiper";
|
|
|
8943
8995
|
var Swiper_default = Swiper;
|
|
8944
8996
|
|
|
8945
8997
|
// src/components/Switch/Switch.tsx
|
|
8946
|
-
var
|
|
8947
|
-
var
|
|
8998
|
+
var import_react31 = __toESM(require("react"), 1);
|
|
8999
|
+
var import_jsx_runtime337 = require("react/jsx-runtime");
|
|
8948
9000
|
var KNOB_TRANSITION_MS = 250;
|
|
8949
9001
|
var Switch = (props) => {
|
|
8950
9002
|
const {
|
|
@@ -8954,9 +9006,9 @@ var Switch = (props) => {
|
|
|
8954
9006
|
disabled,
|
|
8955
9007
|
onChange
|
|
8956
9008
|
} = props;
|
|
8957
|
-
const [isAnimating, setIsAnimating] =
|
|
8958
|
-
const timeoutRef =
|
|
8959
|
-
|
|
9009
|
+
const [isAnimating, setIsAnimating] = import_react31.default.useState(false);
|
|
9010
|
+
const timeoutRef = import_react31.default.useRef(null);
|
|
9011
|
+
import_react31.default.useEffect(() => {
|
|
8960
9012
|
return () => {
|
|
8961
9013
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
8962
9014
|
};
|
|
@@ -8971,7 +9023,7 @@ var Switch = (props) => {
|
|
|
8971
9023
|
timeoutRef.current = null;
|
|
8972
9024
|
}, KNOB_TRANSITION_MS);
|
|
8973
9025
|
};
|
|
8974
|
-
return /* @__PURE__ */ (0,
|
|
9026
|
+
return /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
8975
9027
|
"div",
|
|
8976
9028
|
{
|
|
8977
9029
|
className: clsx_default(
|
|
@@ -8984,7 +9036,7 @@ var Switch = (props) => {
|
|
|
8984
9036
|
),
|
|
8985
9037
|
onClick: handleClick,
|
|
8986
9038
|
"aria-disabled": disabled || isAnimating,
|
|
8987
|
-
children: /* @__PURE__ */ (0,
|
|
9039
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime337.jsx)("div", { className: clsx_default("knob", value ? "checked" : void 0) })
|
|
8988
9040
|
}
|
|
8989
9041
|
);
|
|
8990
9042
|
};
|
|
@@ -8992,17 +9044,17 @@ Switch.displayName = "Switch";
|
|
|
8992
9044
|
var Switch_default = Switch;
|
|
8993
9045
|
|
|
8994
9046
|
// src/components/Table/TableContext.tsx
|
|
8995
|
-
var
|
|
8996
|
-
var TableContext =
|
|
9047
|
+
var import_react32 = __toESM(require("react"), 1);
|
|
9048
|
+
var TableContext = import_react32.default.createContext(null);
|
|
8997
9049
|
var useTableContext = () => {
|
|
8998
|
-
const ctx =
|
|
9050
|
+
const ctx = import_react32.default.useContext(TableContext);
|
|
8999
9051
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
9000
9052
|
return ctx;
|
|
9001
9053
|
};
|
|
9002
9054
|
var TableContext_default = TableContext;
|
|
9003
9055
|
|
|
9004
9056
|
// src/components/Table/Table.tsx
|
|
9005
|
-
var
|
|
9057
|
+
var import_jsx_runtime338 = require("react/jsx-runtime");
|
|
9006
9058
|
var Table = (props) => {
|
|
9007
9059
|
const {
|
|
9008
9060
|
children,
|
|
@@ -9011,7 +9063,7 @@ var Table = (props) => {
|
|
|
9011
9063
|
headerSticky = false,
|
|
9012
9064
|
stickyShadow = true
|
|
9013
9065
|
} = props;
|
|
9014
|
-
return /* @__PURE__ */ (0,
|
|
9066
|
+
return /* @__PURE__ */ (0, import_jsx_runtime338.jsx)("div", { className: "lib-xplat-table-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime338.jsx)(
|
|
9015
9067
|
TableContext_default.Provider,
|
|
9016
9068
|
{
|
|
9017
9069
|
value: {
|
|
@@ -9020,7 +9072,7 @@ var Table = (props) => {
|
|
|
9020
9072
|
headerSticky,
|
|
9021
9073
|
stickyShadow
|
|
9022
9074
|
},
|
|
9023
|
-
children: /* @__PURE__ */ (0,
|
|
9075
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime338.jsx)("table", { className: "lib-xplat-table", children })
|
|
9024
9076
|
}
|
|
9025
9077
|
) });
|
|
9026
9078
|
};
|
|
@@ -9028,41 +9080,41 @@ Table.displayName = "Table";
|
|
|
9028
9080
|
var Table_default = Table;
|
|
9029
9081
|
|
|
9030
9082
|
// src/components/Table/TableBody.tsx
|
|
9031
|
-
var
|
|
9083
|
+
var import_jsx_runtime339 = require("react/jsx-runtime");
|
|
9032
9084
|
var TableBody = (props) => {
|
|
9033
9085
|
const { children } = props;
|
|
9034
|
-
return /* @__PURE__ */ (0,
|
|
9086
|
+
return /* @__PURE__ */ (0, import_jsx_runtime339.jsx)("tbody", { children });
|
|
9035
9087
|
};
|
|
9036
9088
|
TableBody.displayName = "TableBody";
|
|
9037
9089
|
var TableBody_default = TableBody;
|
|
9038
9090
|
|
|
9039
9091
|
// src/components/Table/TableCell.tsx
|
|
9040
|
-
var
|
|
9092
|
+
var import_react35 = __toESM(require("react"), 1);
|
|
9041
9093
|
|
|
9042
9094
|
// src/components/Table/TableHeadContext.tsx
|
|
9043
|
-
var
|
|
9044
|
-
var TableHeadContext =
|
|
9095
|
+
var import_react33 = __toESM(require("react"), 1);
|
|
9096
|
+
var TableHeadContext = import_react33.default.createContext(
|
|
9045
9097
|
null
|
|
9046
9098
|
);
|
|
9047
9099
|
var useTableHeadContext = () => {
|
|
9048
|
-
const ctx =
|
|
9100
|
+
const ctx = import_react33.default.useContext(TableHeadContext);
|
|
9049
9101
|
return ctx;
|
|
9050
9102
|
};
|
|
9051
9103
|
var TableHeadContext_default = TableHeadContext;
|
|
9052
9104
|
|
|
9053
9105
|
// src/components/Table/TableRowContext.tsx
|
|
9054
|
-
var
|
|
9055
|
-
var TableRowContext =
|
|
9106
|
+
var import_react34 = __toESM(require("react"), 1);
|
|
9107
|
+
var TableRowContext = import_react34.default.createContext(null);
|
|
9056
9108
|
var useTableRowContext = () => {
|
|
9057
|
-
const ctx =
|
|
9109
|
+
const ctx = import_react34.default.useContext(TableRowContext);
|
|
9058
9110
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
9059
9111
|
return ctx;
|
|
9060
9112
|
};
|
|
9061
9113
|
var TableRowContext_default = TableRowContext;
|
|
9062
9114
|
|
|
9063
9115
|
// src/components/Table/TableCell.tsx
|
|
9064
|
-
var
|
|
9065
|
-
var TableCell =
|
|
9116
|
+
var import_jsx_runtime340 = require("react/jsx-runtime");
|
|
9117
|
+
var TableCell = import_react35.default.memo((props) => {
|
|
9066
9118
|
const {
|
|
9067
9119
|
children,
|
|
9068
9120
|
align = "center",
|
|
@@ -9074,9 +9126,9 @@ var TableCell = import_react34.default.memo((props) => {
|
|
|
9074
9126
|
const { registerStickyCell, stickyCells } = useTableRowContext();
|
|
9075
9127
|
const { stickyShadow } = useTableContext();
|
|
9076
9128
|
const headContext = useTableHeadContext();
|
|
9077
|
-
const [left, setLeft] =
|
|
9078
|
-
const cellRef =
|
|
9079
|
-
const calculateLeft =
|
|
9129
|
+
const [left, setLeft] = import_react35.default.useState(0);
|
|
9130
|
+
const cellRef = import_react35.default.useRef(null);
|
|
9131
|
+
const calculateLeft = import_react35.default.useCallback(() => {
|
|
9080
9132
|
if (!cellRef.current) return 0;
|
|
9081
9133
|
let totalLeft = 0;
|
|
9082
9134
|
for (const ref of stickyCells) {
|
|
@@ -9085,7 +9137,7 @@ var TableCell = import_react34.default.memo((props) => {
|
|
|
9085
9137
|
}
|
|
9086
9138
|
return totalLeft;
|
|
9087
9139
|
}, [stickyCells]);
|
|
9088
|
-
|
|
9140
|
+
import_react35.default.useEffect(() => {
|
|
9089
9141
|
if (!isSticky || !cellRef.current) return;
|
|
9090
9142
|
registerStickyCell(cellRef);
|
|
9091
9143
|
setLeft(calculateLeft());
|
|
@@ -9103,7 +9155,7 @@ var TableCell = import_react34.default.memo((props) => {
|
|
|
9103
9155
|
const CellTag = cellRef.current?.tagName === "TH" ? "th" : "td";
|
|
9104
9156
|
const isLastSticky = isSticky && stickyCells[stickyCells.length - 1] === cellRef;
|
|
9105
9157
|
const enableHover = headContext && headContext.cellHover;
|
|
9106
|
-
return /* @__PURE__ */ (0,
|
|
9158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime340.jsx)(
|
|
9107
9159
|
CellTag,
|
|
9108
9160
|
{
|
|
9109
9161
|
ref: cellRef,
|
|
@@ -9128,21 +9180,21 @@ TableCell.displayName = "TableCell";
|
|
|
9128
9180
|
var TableCell_default = TableCell;
|
|
9129
9181
|
|
|
9130
9182
|
// src/components/Table/TableHead.tsx
|
|
9131
|
-
var
|
|
9183
|
+
var import_jsx_runtime341 = require("react/jsx-runtime");
|
|
9132
9184
|
var TableHead = ({
|
|
9133
9185
|
children,
|
|
9134
9186
|
cellHover = false
|
|
9135
9187
|
}) => {
|
|
9136
9188
|
const { headerSticky } = useTableContext();
|
|
9137
|
-
return /* @__PURE__ */ (0,
|
|
9189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime341.jsx)(TableHeadContext_default.Provider, { value: { cellHover }, children: /* @__PURE__ */ (0, import_jsx_runtime341.jsx)("thead", { className: clsx_default(headerSticky ? "table-sticky" : null), children }) });
|
|
9138
9190
|
};
|
|
9139
9191
|
TableHead.displayName = "TableHead";
|
|
9140
9192
|
var TableHead_default = TableHead;
|
|
9141
9193
|
|
|
9142
9194
|
// src/components/Table/TableRow.tsx
|
|
9143
|
-
var
|
|
9144
|
-
var
|
|
9145
|
-
var TableRow =
|
|
9195
|
+
var import_react36 = __toESM(require("react"), 1);
|
|
9196
|
+
var import_jsx_runtime342 = require("react/jsx-runtime");
|
|
9197
|
+
var TableRow = import_react36.default.memo((props) => {
|
|
9146
9198
|
const {
|
|
9147
9199
|
children,
|
|
9148
9200
|
type = "secondary",
|
|
@@ -9150,14 +9202,14 @@ var TableRow = import_react35.default.memo((props) => {
|
|
|
9150
9202
|
onClick
|
|
9151
9203
|
} = props;
|
|
9152
9204
|
const { rowBorderUse } = useTableContext();
|
|
9153
|
-
const [stickyCells, setStickyCells] =
|
|
9205
|
+
const [stickyCells, setStickyCells] = import_react36.default.useState([]);
|
|
9154
9206
|
const registerStickyCell = (ref) => {
|
|
9155
9207
|
setStickyCells((prev) => {
|
|
9156
9208
|
if (prev.includes(ref)) return prev;
|
|
9157
9209
|
return [...prev, ref];
|
|
9158
9210
|
});
|
|
9159
9211
|
};
|
|
9160
|
-
return /* @__PURE__ */ (0,
|
|
9212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime342.jsx)(TableRowContext_default.Provider, { value: { stickyCells, registerStickyCell }, children: /* @__PURE__ */ (0, import_jsx_runtime342.jsx)(
|
|
9161
9213
|
"tr",
|
|
9162
9214
|
{
|
|
9163
9215
|
className: clsx_default(
|
|
@@ -9175,7 +9227,7 @@ TableRow.displayName = "TableRow";
|
|
|
9175
9227
|
var TableRow_default = TableRow;
|
|
9176
9228
|
|
|
9177
9229
|
// src/components/Tag/Tag.tsx
|
|
9178
|
-
var
|
|
9230
|
+
var import_jsx_runtime343 = require("react/jsx-runtime");
|
|
9179
9231
|
var Tag = (props) => {
|
|
9180
9232
|
const {
|
|
9181
9233
|
children,
|
|
@@ -9185,7 +9237,7 @@ var Tag = (props) => {
|
|
|
9185
9237
|
disabled = false,
|
|
9186
9238
|
colorIndex
|
|
9187
9239
|
} = props;
|
|
9188
|
-
return /* @__PURE__ */ (0,
|
|
9240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime343.jsxs)(
|
|
9189
9241
|
"span",
|
|
9190
9242
|
{
|
|
9191
9243
|
className: clsx_default(
|
|
@@ -9196,8 +9248,8 @@ var Tag = (props) => {
|
|
|
9196
9248
|
disabled && "disabled"
|
|
9197
9249
|
),
|
|
9198
9250
|
children: [
|
|
9199
|
-
/* @__PURE__ */ (0,
|
|
9200
|
-
onClose && /* @__PURE__ */ (0,
|
|
9251
|
+
/* @__PURE__ */ (0, import_jsx_runtime343.jsx)("span", { className: "tag-label", children }),
|
|
9252
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime343.jsx)("button", { className: "tag-close", onClick: onClose, "aria-label": "\uC0AD\uC81C", disabled, children: /* @__PURE__ */ (0, import_jsx_runtime343.jsx)(XIcon_default, {}) })
|
|
9201
9253
|
]
|
|
9202
9254
|
}
|
|
9203
9255
|
);
|
|
@@ -9206,12 +9258,12 @@ Tag.displayName = "Tag";
|
|
|
9206
9258
|
var Tag_default = Tag;
|
|
9207
9259
|
|
|
9208
9260
|
// src/components/TextArea/TextArea.tsx
|
|
9209
|
-
var
|
|
9210
|
-
var
|
|
9211
|
-
var TextArea =
|
|
9261
|
+
var import_react37 = __toESM(require("react"), 1);
|
|
9262
|
+
var import_jsx_runtime344 = require("react/jsx-runtime");
|
|
9263
|
+
var TextArea = import_react37.default.forwardRef(
|
|
9212
9264
|
(props, ref) => {
|
|
9213
9265
|
const { value, onChange, disabled, ...textareaProps } = props;
|
|
9214
|
-
const localRef =
|
|
9266
|
+
const localRef = import_react37.default.useRef(null);
|
|
9215
9267
|
const setRefs = (el) => {
|
|
9216
9268
|
localRef.current = el;
|
|
9217
9269
|
if (!ref) return;
|
|
@@ -9231,21 +9283,21 @@ var TextArea = import_react36.default.forwardRef(
|
|
|
9231
9283
|
onChange(event);
|
|
9232
9284
|
}
|
|
9233
9285
|
};
|
|
9234
|
-
|
|
9286
|
+
import_react37.default.useEffect(() => {
|
|
9235
9287
|
const el = localRef.current;
|
|
9236
9288
|
if (!el) return;
|
|
9237
9289
|
el.style.height = "0px";
|
|
9238
9290
|
const nextHeight = Math.min(el.scrollHeight, 400);
|
|
9239
9291
|
el.style.height = `${nextHeight}px`;
|
|
9240
9292
|
}, [value]);
|
|
9241
|
-
return /* @__PURE__ */ (0,
|
|
9293
|
+
return /* @__PURE__ */ (0, import_jsx_runtime344.jsx)("div", { className: "lib-xplat-textarea-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime344.jsx)(
|
|
9242
9294
|
"div",
|
|
9243
9295
|
{
|
|
9244
9296
|
className: clsx_default(
|
|
9245
9297
|
"lib-xplat-textarea",
|
|
9246
9298
|
disabled ? "disabled" : void 0
|
|
9247
9299
|
),
|
|
9248
|
-
children: /* @__PURE__ */ (0,
|
|
9300
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime344.jsx)(
|
|
9249
9301
|
"textarea",
|
|
9250
9302
|
{
|
|
9251
9303
|
...textareaProps,
|
|
@@ -9263,25 +9315,25 @@ TextArea.displayName = "TextArea";
|
|
|
9263
9315
|
var TextArea_default = TextArea;
|
|
9264
9316
|
|
|
9265
9317
|
// src/components/Toast/Toast.tsx
|
|
9266
|
-
var
|
|
9267
|
-
var
|
|
9268
|
-
var
|
|
9269
|
-
var ToastContext =
|
|
9318
|
+
var import_react38 = __toESM(require("react"), 1);
|
|
9319
|
+
var import_react_dom4 = require("react-dom");
|
|
9320
|
+
var import_jsx_runtime345 = require("react/jsx-runtime");
|
|
9321
|
+
var ToastContext = import_react38.default.createContext(null);
|
|
9270
9322
|
var useToast = () => {
|
|
9271
|
-
const ctx =
|
|
9323
|
+
const ctx = import_react38.default.useContext(ToastContext);
|
|
9272
9324
|
if (!ctx) throw new Error("useToast must be used within ToastProvider");
|
|
9273
9325
|
return ctx;
|
|
9274
9326
|
};
|
|
9275
9327
|
var EXIT_DURATION = 300;
|
|
9276
9328
|
var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
9277
|
-
const ref =
|
|
9278
|
-
const [height, setHeight] =
|
|
9279
|
-
|
|
9329
|
+
const ref = import_react38.default.useRef(null);
|
|
9330
|
+
const [height, setHeight] = import_react38.default.useState(void 0);
|
|
9331
|
+
import_react38.default.useEffect(() => {
|
|
9280
9332
|
if (ref.current && !isExiting) {
|
|
9281
9333
|
setHeight(ref.current.offsetHeight);
|
|
9282
9334
|
}
|
|
9283
9335
|
}, [isExiting]);
|
|
9284
|
-
return /* @__PURE__ */ (0,
|
|
9336
|
+
return /* @__PURE__ */ (0, import_jsx_runtime345.jsx)(
|
|
9285
9337
|
"div",
|
|
9286
9338
|
{
|
|
9287
9339
|
className: clsx_default("lib-xplat-toast-wrapper", { exit: isExiting }),
|
|
@@ -9289,15 +9341,15 @@ var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
|
9289
9341
|
maxHeight: isExiting ? 0 : height ?? "none",
|
|
9290
9342
|
marginBottom: isExiting ? 0 : void 0
|
|
9291
9343
|
},
|
|
9292
|
-
children: /* @__PURE__ */ (0,
|
|
9344
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime345.jsxs)(
|
|
9293
9345
|
"div",
|
|
9294
9346
|
{
|
|
9295
9347
|
ref,
|
|
9296
9348
|
className: clsx_default("lib-xplat-toast", item.type, { exit: isExiting }),
|
|
9297
9349
|
role: "alert",
|
|
9298
9350
|
children: [
|
|
9299
|
-
/* @__PURE__ */ (0,
|
|
9300
|
-
/* @__PURE__ */ (0,
|
|
9351
|
+
/* @__PURE__ */ (0, import_jsx_runtime345.jsx)("span", { className: "message", children: item.message }),
|
|
9352
|
+
/* @__PURE__ */ (0, import_jsx_runtime345.jsx)("button", { className: "close-btn", onClick: onClose, "aria-label": "\uB2EB\uAE30", children: "\xD7" })
|
|
9301
9353
|
]
|
|
9302
9354
|
}
|
|
9303
9355
|
)
|
|
@@ -9308,13 +9360,13 @@ var ToastProvider = ({
|
|
|
9308
9360
|
children,
|
|
9309
9361
|
position = "top-right"
|
|
9310
9362
|
}) => {
|
|
9311
|
-
const [toasts, setToasts] =
|
|
9312
|
-
const [removing, setRemoving] =
|
|
9313
|
-
const [mounted, setMounted] =
|
|
9314
|
-
|
|
9363
|
+
const [toasts, setToasts] = import_react38.default.useState([]);
|
|
9364
|
+
const [removing, setRemoving] = import_react38.default.useState(/* @__PURE__ */ new Set());
|
|
9365
|
+
const [mounted, setMounted] = import_react38.default.useState(false);
|
|
9366
|
+
import_react38.default.useEffect(() => {
|
|
9315
9367
|
setMounted(true);
|
|
9316
9368
|
}, []);
|
|
9317
|
-
const remove =
|
|
9369
|
+
const remove = import_react38.default.useCallback((id) => {
|
|
9318
9370
|
setRemoving((prev) => new Set(prev).add(id));
|
|
9319
9371
|
setTimeout(() => {
|
|
9320
9372
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
@@ -9325,7 +9377,7 @@ var ToastProvider = ({
|
|
|
9325
9377
|
});
|
|
9326
9378
|
}, EXIT_DURATION);
|
|
9327
9379
|
}, []);
|
|
9328
|
-
const toast =
|
|
9380
|
+
const toast = import_react38.default.useCallback(
|
|
9329
9381
|
(type, message, duration = 3e3) => {
|
|
9330
9382
|
const id = `${Date.now()}-${Math.random()}`;
|
|
9331
9383
|
setToasts((prev) => [...prev, { id, type, message }]);
|
|
@@ -9335,10 +9387,10 @@ var ToastProvider = ({
|
|
|
9335
9387
|
},
|
|
9336
9388
|
[remove]
|
|
9337
9389
|
);
|
|
9338
|
-
return /* @__PURE__ */ (0,
|
|
9390
|
+
return /* @__PURE__ */ (0, import_jsx_runtime345.jsxs)(ToastContext.Provider, { value: { toast }, children: [
|
|
9339
9391
|
children,
|
|
9340
|
-
mounted && (0,
|
|
9341
|
-
/* @__PURE__ */ (0,
|
|
9392
|
+
mounted && (0, import_react_dom4.createPortal)(
|
|
9393
|
+
/* @__PURE__ */ (0, import_jsx_runtime345.jsx)("div", { className: clsx_default("lib-xplat-toast-container", position), children: toasts.map((t) => /* @__PURE__ */ (0, import_jsx_runtime345.jsx)(
|
|
9342
9394
|
ToastItemComponent,
|
|
9343
9395
|
{
|
|
9344
9396
|
item: t,
|
|
@@ -9354,29 +9406,29 @@ var ToastProvider = ({
|
|
|
9354
9406
|
ToastProvider.displayName = "ToastProvider";
|
|
9355
9407
|
|
|
9356
9408
|
// src/components/Tooltip/Tooltip.tsx
|
|
9357
|
-
var
|
|
9358
|
-
var
|
|
9409
|
+
var import_react39 = __toESM(require("react"), 1);
|
|
9410
|
+
var import_jsx_runtime346 = require("react/jsx-runtime");
|
|
9359
9411
|
var Tooltip = (props) => {
|
|
9360
9412
|
const {
|
|
9361
9413
|
type = "primary",
|
|
9362
9414
|
description,
|
|
9363
9415
|
children
|
|
9364
9416
|
} = props;
|
|
9365
|
-
const iconRef =
|
|
9366
|
-
return /* @__PURE__ */ (0,
|
|
9367
|
-
/* @__PURE__ */ (0,
|
|
9368
|
-
/* @__PURE__ */ (0,
|
|
9417
|
+
const iconRef = import_react39.default.useRef(null);
|
|
9418
|
+
return /* @__PURE__ */ (0, import_jsx_runtime346.jsxs)("div", { className: "lib-xplat-tooltip", children: [
|
|
9419
|
+
/* @__PURE__ */ (0, import_jsx_runtime346.jsx)("div", { className: "tooltip-content", ref: iconRef, children: children || "Tooltip" }),
|
|
9420
|
+
/* @__PURE__ */ (0, import_jsx_runtime346.jsx)("div", { className: clsx_default("tooltip-wrapper", type), children: description })
|
|
9369
9421
|
] });
|
|
9370
9422
|
};
|
|
9371
9423
|
Tooltip.displayName = "Tooltip";
|
|
9372
9424
|
var Tooltip_default = Tooltip;
|
|
9373
9425
|
|
|
9374
9426
|
// src/components/Video/Video.tsx
|
|
9375
|
-
var
|
|
9376
|
-
var
|
|
9377
|
-
var PipIcon = () => /* @__PURE__ */ (0,
|
|
9378
|
-
/* @__PURE__ */ (0,
|
|
9379
|
-
/* @__PURE__ */ (0,
|
|
9427
|
+
var import_react40 = __toESM(require("react"), 1);
|
|
9428
|
+
var import_jsx_runtime347 = require("react/jsx-runtime");
|
|
9429
|
+
var PipIcon = () => /* @__PURE__ */ (0, import_jsx_runtime347.jsxs)("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
9430
|
+
/* @__PURE__ */ (0, import_jsx_runtime347.jsx)("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
|
|
9431
|
+
/* @__PURE__ */ (0, import_jsx_runtime347.jsx)("rect", { x: "12", y: "11", width: "7", height: "6", rx: "1", fill: "currentColor" })
|
|
9380
9432
|
] });
|
|
9381
9433
|
var formatTime = (sec) => {
|
|
9382
9434
|
if (!Number.isFinite(sec) || sec < 0) return "0:00";
|
|
@@ -9384,7 +9436,7 @@ var formatTime = (sec) => {
|
|
|
9384
9436
|
const s = Math.floor(sec % 60);
|
|
9385
9437
|
return `${m}:${s.toString().padStart(2, "0")}`;
|
|
9386
9438
|
};
|
|
9387
|
-
var Video =
|
|
9439
|
+
var Video = import_react40.default.forwardRef((props, ref) => {
|
|
9388
9440
|
const {
|
|
9389
9441
|
src,
|
|
9390
9442
|
poster,
|
|
@@ -9408,21 +9460,21 @@ var Video = import_react39.default.forwardRef((props, ref) => {
|
|
|
9408
9460
|
children,
|
|
9409
9461
|
...rest
|
|
9410
9462
|
} = props;
|
|
9411
|
-
const containerRef =
|
|
9412
|
-
const videoRef =
|
|
9413
|
-
const [isPlaying, setIsPlaying] =
|
|
9414
|
-
const [isLoaded, setIsLoaded] =
|
|
9415
|
-
const [currentTime, setCurrentTime] =
|
|
9416
|
-
const [duration, setDuration] =
|
|
9417
|
-
const [buffered, setBuffered] =
|
|
9418
|
-
const [volume, setVolume] =
|
|
9419
|
-
const [isMuted, setIsMuted] =
|
|
9420
|
-
const [isFullscreen, setIsFullscreen] =
|
|
9421
|
-
const [playbackRate, setPlaybackRate] =
|
|
9422
|
-
const [rateMenuOpen, setRateMenuOpen] =
|
|
9423
|
-
const [captionsOn, setCaptionsOn] =
|
|
9424
|
-
const [isPip, setIsPip] =
|
|
9425
|
-
const setRefs =
|
|
9463
|
+
const containerRef = import_react40.default.useRef(null);
|
|
9464
|
+
const videoRef = import_react40.default.useRef(null);
|
|
9465
|
+
const [isPlaying, setIsPlaying] = import_react40.default.useState(Boolean(autoPlay));
|
|
9466
|
+
const [isLoaded, setIsLoaded] = import_react40.default.useState(false);
|
|
9467
|
+
const [currentTime, setCurrentTime] = import_react40.default.useState(0);
|
|
9468
|
+
const [duration, setDuration] = import_react40.default.useState(0);
|
|
9469
|
+
const [buffered, setBuffered] = import_react40.default.useState(0);
|
|
9470
|
+
const [volume, setVolume] = import_react40.default.useState(1);
|
|
9471
|
+
const [isMuted, setIsMuted] = import_react40.default.useState(Boolean(muted));
|
|
9472
|
+
const [isFullscreen, setIsFullscreen] = import_react40.default.useState(false);
|
|
9473
|
+
const [playbackRate, setPlaybackRate] = import_react40.default.useState(1);
|
|
9474
|
+
const [rateMenuOpen, setRateMenuOpen] = import_react40.default.useState(false);
|
|
9475
|
+
const [captionsOn, setCaptionsOn] = import_react40.default.useState(false);
|
|
9476
|
+
const [isPip, setIsPip] = import_react40.default.useState(false);
|
|
9477
|
+
const setRefs = import_react40.default.useCallback(
|
|
9426
9478
|
(el) => {
|
|
9427
9479
|
videoRef.current = el;
|
|
9428
9480
|
if (typeof ref === "function") ref(el);
|
|
@@ -9430,14 +9482,14 @@ var Video = import_react39.default.forwardRef((props, ref) => {
|
|
|
9430
9482
|
},
|
|
9431
9483
|
[ref]
|
|
9432
9484
|
);
|
|
9433
|
-
|
|
9485
|
+
import_react40.default.useEffect(() => {
|
|
9434
9486
|
const onFsChange = () => {
|
|
9435
9487
|
setIsFullscreen(document.fullscreenElement === containerRef.current);
|
|
9436
9488
|
};
|
|
9437
9489
|
document.addEventListener("fullscreenchange", onFsChange);
|
|
9438
9490
|
return () => document.removeEventListener("fullscreenchange", onFsChange);
|
|
9439
9491
|
}, []);
|
|
9440
|
-
|
|
9492
|
+
import_react40.default.useEffect(() => {
|
|
9441
9493
|
const v = videoRef.current;
|
|
9442
9494
|
if (!v) return;
|
|
9443
9495
|
const onEnter = () => setIsPip(true);
|
|
@@ -9551,13 +9603,13 @@ var Video = import_react39.default.forwardRef((props, ref) => {
|
|
|
9551
9603
|
const volumePct = (isMuted ? 0 : volume) * 100;
|
|
9552
9604
|
const VolumeGlyph = isMuted || volume === 0 ? VolumeXIcon_default : volume < 0.5 ? VolumeIcon_default : Volume2Icon_default;
|
|
9553
9605
|
const pipSupported = typeof document !== "undefined" && "pictureInPictureEnabled" in document && document.pictureInPictureEnabled;
|
|
9554
|
-
return /* @__PURE__ */ (0,
|
|
9606
|
+
return /* @__PURE__ */ (0, import_jsx_runtime347.jsxs)(
|
|
9555
9607
|
"div",
|
|
9556
9608
|
{
|
|
9557
9609
|
ref: containerRef,
|
|
9558
9610
|
className: clsx_default("lib-xplat-video", showControls && "has-controls"),
|
|
9559
9611
|
children: [
|
|
9560
|
-
/* @__PURE__ */ (0,
|
|
9612
|
+
/* @__PURE__ */ (0, import_jsx_runtime347.jsx)(
|
|
9561
9613
|
"video",
|
|
9562
9614
|
{
|
|
9563
9615
|
ref: setRefs,
|
|
@@ -9578,7 +9630,7 @@ var Video = import_react39.default.forwardRef((props, ref) => {
|
|
|
9578
9630
|
children
|
|
9579
9631
|
}
|
|
9580
9632
|
),
|
|
9581
|
-
showCenterPlay && /* @__PURE__ */ (0,
|
|
9633
|
+
showCenterPlay && /* @__PURE__ */ (0, import_jsx_runtime347.jsx)(
|
|
9582
9634
|
"button",
|
|
9583
9635
|
{
|
|
9584
9636
|
type: "button",
|
|
@@ -9590,11 +9642,11 @@ var Video = import_react39.default.forwardRef((props, ref) => {
|
|
|
9590
9642
|
onClick: togglePlay,
|
|
9591
9643
|
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
9592
9644
|
tabIndex: -1,
|
|
9593
|
-
children: /* @__PURE__ */ (0,
|
|
9645
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime347.jsx)("span", { className: "center-play-icon", children: /* @__PURE__ */ (0, import_jsx_runtime347.jsx)(PlayCircleIcon_default, {}) })
|
|
9594
9646
|
}
|
|
9595
9647
|
),
|
|
9596
|
-
showControls && /* @__PURE__ */ (0,
|
|
9597
|
-
/* @__PURE__ */ (0,
|
|
9648
|
+
showControls && /* @__PURE__ */ (0, import_jsx_runtime347.jsxs)("div", { className: "controls", onClick: (e) => e.stopPropagation(), children: [
|
|
9649
|
+
/* @__PURE__ */ (0, import_jsx_runtime347.jsx)(
|
|
9598
9650
|
"input",
|
|
9599
9651
|
{
|
|
9600
9652
|
type: "range",
|
|
@@ -9611,29 +9663,29 @@ var Video = import_react39.default.forwardRef((props, ref) => {
|
|
|
9611
9663
|
}
|
|
9612
9664
|
}
|
|
9613
9665
|
),
|
|
9614
|
-
/* @__PURE__ */ (0,
|
|
9615
|
-
/* @__PURE__ */ (0,
|
|
9666
|
+
/* @__PURE__ */ (0, import_jsx_runtime347.jsxs)("div", { className: "controls-row", children: [
|
|
9667
|
+
/* @__PURE__ */ (0, import_jsx_runtime347.jsx)(
|
|
9616
9668
|
"button",
|
|
9617
9669
|
{
|
|
9618
9670
|
type: "button",
|
|
9619
9671
|
className: "control-btn",
|
|
9620
9672
|
onClick: togglePlay,
|
|
9621
9673
|
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
9622
|
-
children: isPlaying ? /* @__PURE__ */ (0,
|
|
9674
|
+
children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime347.jsx)(PauseIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime347.jsx)(PlayIcon_default, {})
|
|
9623
9675
|
}
|
|
9624
9676
|
),
|
|
9625
|
-
/* @__PURE__ */ (0,
|
|
9626
|
-
/* @__PURE__ */ (0,
|
|
9677
|
+
/* @__PURE__ */ (0, import_jsx_runtime347.jsxs)("div", { className: "volume-group", children: [
|
|
9678
|
+
/* @__PURE__ */ (0, import_jsx_runtime347.jsx)(
|
|
9627
9679
|
"button",
|
|
9628
9680
|
{
|
|
9629
9681
|
type: "button",
|
|
9630
9682
|
className: "control-btn",
|
|
9631
9683
|
onClick: toggleMute,
|
|
9632
9684
|
"aria-label": isMuted ? "\uC74C\uC18C\uAC70 \uD574\uC81C" : "\uC74C\uC18C\uAC70",
|
|
9633
|
-
children: /* @__PURE__ */ (0,
|
|
9685
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime347.jsx)(VolumeGlyph, {})
|
|
9634
9686
|
}
|
|
9635
9687
|
),
|
|
9636
|
-
/* @__PURE__ */ (0,
|
|
9688
|
+
/* @__PURE__ */ (0, import_jsx_runtime347.jsx)(
|
|
9637
9689
|
"input",
|
|
9638
9690
|
{
|
|
9639
9691
|
type: "range",
|
|
@@ -9648,14 +9700,14 @@ var Video = import_react39.default.forwardRef((props, ref) => {
|
|
|
9648
9700
|
}
|
|
9649
9701
|
)
|
|
9650
9702
|
] }),
|
|
9651
|
-
/* @__PURE__ */ (0,
|
|
9703
|
+
/* @__PURE__ */ (0, import_jsx_runtime347.jsxs)("span", { className: "time", children: [
|
|
9652
9704
|
formatTime(currentTime),
|
|
9653
9705
|
" / ",
|
|
9654
9706
|
formatTime(duration)
|
|
9655
9707
|
] }),
|
|
9656
|
-
/* @__PURE__ */ (0,
|
|
9657
|
-
playbackRates && playbackRates.length > 0 && /* @__PURE__ */ (0,
|
|
9658
|
-
/* @__PURE__ */ (0,
|
|
9708
|
+
/* @__PURE__ */ (0, import_jsx_runtime347.jsx)("div", { className: "controls-spacer" }),
|
|
9709
|
+
playbackRates && playbackRates.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime347.jsxs)("div", { className: clsx_default("rate-group", rateMenuOpen && "is-open"), children: [
|
|
9710
|
+
/* @__PURE__ */ (0, import_jsx_runtime347.jsxs)(
|
|
9659
9711
|
"button",
|
|
9660
9712
|
{
|
|
9661
9713
|
type: "button",
|
|
@@ -9669,7 +9721,7 @@ var Video = import_react39.default.forwardRef((props, ref) => {
|
|
|
9669
9721
|
]
|
|
9670
9722
|
}
|
|
9671
9723
|
),
|
|
9672
|
-
rateMenuOpen && /* @__PURE__ */ (0,
|
|
9724
|
+
rateMenuOpen && /* @__PURE__ */ (0, import_jsx_runtime347.jsx)("ul", { className: "rate-menu", role: "menu", children: playbackRates.map((r2) => /* @__PURE__ */ (0, import_jsx_runtime347.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime347.jsxs)(
|
|
9673
9725
|
"button",
|
|
9674
9726
|
{
|
|
9675
9727
|
type: "button",
|
|
@@ -9683,7 +9735,7 @@ var Video = import_react39.default.forwardRef((props, ref) => {
|
|
|
9683
9735
|
}
|
|
9684
9736
|
) }, r2)) })
|
|
9685
9737
|
] }),
|
|
9686
|
-
showCaptions && /* @__PURE__ */ (0,
|
|
9738
|
+
showCaptions && /* @__PURE__ */ (0, import_jsx_runtime347.jsx)(
|
|
9687
9739
|
"button",
|
|
9688
9740
|
{
|
|
9689
9741
|
type: "button",
|
|
@@ -9691,37 +9743,37 @@ var Video = import_react39.default.forwardRef((props, ref) => {
|
|
|
9691
9743
|
onClick: toggleCaptions,
|
|
9692
9744
|
"aria-label": captionsOn ? "\uC790\uB9C9 \uB044\uAE30" : "\uC790\uB9C9 \uCF1C\uAE30",
|
|
9693
9745
|
"aria-pressed": captionsOn,
|
|
9694
|
-
children: /* @__PURE__ */ (0,
|
|
9746
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime347.jsx)(TypeIcon_default, {})
|
|
9695
9747
|
}
|
|
9696
9748
|
),
|
|
9697
|
-
showPip && pipSupported && /* @__PURE__ */ (0,
|
|
9749
|
+
showPip && pipSupported && /* @__PURE__ */ (0, import_jsx_runtime347.jsx)(
|
|
9698
9750
|
"button",
|
|
9699
9751
|
{
|
|
9700
9752
|
type: "button",
|
|
9701
9753
|
className: clsx_default("control-btn", isPip && "is-active"),
|
|
9702
9754
|
onClick: togglePip,
|
|
9703
9755
|
"aria-label": isPip ? "PIP \uC885\uB8CC" : "PIP",
|
|
9704
|
-
children: /* @__PURE__ */ (0,
|
|
9756
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime347.jsx)(PipIcon, {})
|
|
9705
9757
|
}
|
|
9706
9758
|
),
|
|
9707
|
-
showDownload && /* @__PURE__ */ (0,
|
|
9759
|
+
showDownload && /* @__PURE__ */ (0, import_jsx_runtime347.jsx)(
|
|
9708
9760
|
"a",
|
|
9709
9761
|
{
|
|
9710
9762
|
className: "control-btn",
|
|
9711
9763
|
href: src,
|
|
9712
9764
|
download: downloadFileName ?? true,
|
|
9713
9765
|
"aria-label": "\uB2E4\uC6B4\uB85C\uB4DC",
|
|
9714
|
-
children: /* @__PURE__ */ (0,
|
|
9766
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime347.jsx)(DownloadIcon_default, {})
|
|
9715
9767
|
}
|
|
9716
9768
|
),
|
|
9717
|
-
/* @__PURE__ */ (0,
|
|
9769
|
+
/* @__PURE__ */ (0, import_jsx_runtime347.jsx)(
|
|
9718
9770
|
"button",
|
|
9719
9771
|
{
|
|
9720
9772
|
type: "button",
|
|
9721
9773
|
className: "control-btn",
|
|
9722
9774
|
onClick: toggleFullscreen,
|
|
9723
9775
|
"aria-label": isFullscreen ? "\uC804\uCCB4\uD654\uBA74 \uC885\uB8CC" : "\uC804\uCCB4\uD654\uBA74",
|
|
9724
|
-
children: isFullscreen ? /* @__PURE__ */ (0,
|
|
9776
|
+
children: isFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime347.jsx)(MinimizeIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime347.jsx)(MaximizeIcon_default, {})
|
|
9725
9777
|
}
|
|
9726
9778
|
)
|
|
9727
9779
|
] })
|
|
@@ -9734,10 +9786,10 @@ Video.displayName = "Video";
|
|
|
9734
9786
|
var Video_default = Video;
|
|
9735
9787
|
|
|
9736
9788
|
// src/layout/Grid/FullGrid/FullGrid.tsx
|
|
9737
|
-
var
|
|
9789
|
+
var import_jsx_runtime348 = require("react/jsx-runtime");
|
|
9738
9790
|
var FullGrid = (props) => {
|
|
9739
9791
|
const { children, gap } = props;
|
|
9740
|
-
return /* @__PURE__ */ (0,
|
|
9792
|
+
return /* @__PURE__ */ (0, import_jsx_runtime348.jsx)(
|
|
9741
9793
|
"div",
|
|
9742
9794
|
{
|
|
9743
9795
|
className: "lib-xplat-full-grid",
|
|
@@ -9750,10 +9802,10 @@ FullGrid.displayName = "FullGrid";
|
|
|
9750
9802
|
var FullGrid_default = FullGrid;
|
|
9751
9803
|
|
|
9752
9804
|
// src/layout/Grid/FullScreen/FullScreen.tsx
|
|
9753
|
-
var
|
|
9805
|
+
var import_jsx_runtime349 = require("react/jsx-runtime");
|
|
9754
9806
|
var FullScreen = (props) => {
|
|
9755
9807
|
const { children, gap } = props;
|
|
9756
|
-
return /* @__PURE__ */ (0,
|
|
9808
|
+
return /* @__PURE__ */ (0, import_jsx_runtime349.jsx)(
|
|
9757
9809
|
"div",
|
|
9758
9810
|
{
|
|
9759
9811
|
className: "lib-xplat-full-screen",
|
|
@@ -9766,7 +9818,7 @@ FullScreen.displayName = "FullScreen";
|
|
|
9766
9818
|
var FullScreen_default = FullScreen;
|
|
9767
9819
|
|
|
9768
9820
|
// src/layout/Grid/Item/Item.tsx
|
|
9769
|
-
var
|
|
9821
|
+
var import_jsx_runtime350 = require("react/jsx-runtime");
|
|
9770
9822
|
var calculateSpans = (column) => {
|
|
9771
9823
|
const spans = {};
|
|
9772
9824
|
let inherited = column.default;
|
|
@@ -9783,35 +9835,35 @@ var GridItem = ({ column, children, className }) => {
|
|
|
9783
9835
|
Object.entries(spans).forEach(([key, value]) => {
|
|
9784
9836
|
style[`--column-${key}`] = value;
|
|
9785
9837
|
});
|
|
9786
|
-
return /* @__PURE__ */ (0,
|
|
9838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime350.jsx)("div", { className: clsx_default("lib-xplat-grid-item", className), style, children });
|
|
9787
9839
|
};
|
|
9788
9840
|
GridItem.displayName = "GridItem";
|
|
9789
9841
|
var Item_default = GridItem;
|
|
9790
9842
|
|
|
9791
9843
|
// src/layout/Header/Header.tsx
|
|
9792
|
-
var
|
|
9844
|
+
var import_jsx_runtime351 = require("react/jsx-runtime");
|
|
9793
9845
|
var Header = ({
|
|
9794
9846
|
logo,
|
|
9795
9847
|
centerContent,
|
|
9796
9848
|
rightContent
|
|
9797
9849
|
}) => {
|
|
9798
|
-
return /* @__PURE__ */ (0,
|
|
9799
|
-
/* @__PURE__ */ (0,
|
|
9800
|
-
/* @__PURE__ */ (0,
|
|
9801
|
-
/* @__PURE__ */ (0,
|
|
9850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime351.jsxs)("div", { className: "lib-xplat-layout-header", children: [
|
|
9851
|
+
/* @__PURE__ */ (0, import_jsx_runtime351.jsx)("div", { children: logo }),
|
|
9852
|
+
/* @__PURE__ */ (0, import_jsx_runtime351.jsx)("div", { children: centerContent }),
|
|
9853
|
+
/* @__PURE__ */ (0, import_jsx_runtime351.jsx)("div", { children: rightContent })
|
|
9802
9854
|
] });
|
|
9803
9855
|
};
|
|
9804
9856
|
Header.displayName = "Header";
|
|
9805
9857
|
var Header_default = Header;
|
|
9806
9858
|
|
|
9807
9859
|
// src/layout/Layout/Layout.tsx
|
|
9808
|
-
var
|
|
9860
|
+
var import_jsx_runtime352 = require("react/jsx-runtime");
|
|
9809
9861
|
var Layout = (props) => {
|
|
9810
9862
|
const { header, sideBar, children } = props;
|
|
9811
|
-
return /* @__PURE__ */ (0,
|
|
9812
|
-
sideBar && /* @__PURE__ */ (0,
|
|
9813
|
-
/* @__PURE__ */ (0,
|
|
9814
|
-
header && /* @__PURE__ */ (0,
|
|
9863
|
+
return /* @__PURE__ */ (0, import_jsx_runtime352.jsx)("div", { className: "lib-xplat-layout", children: /* @__PURE__ */ (0, import_jsx_runtime352.jsxs)("div", { className: "lib-xplat-layout-content-wrapper", children: [
|
|
9864
|
+
sideBar && /* @__PURE__ */ (0, import_jsx_runtime352.jsx)(import_jsx_runtime352.Fragment, { children: sideBar }),
|
|
9865
|
+
/* @__PURE__ */ (0, import_jsx_runtime352.jsxs)("div", { className: "lib-xplat-layout-content", children: [
|
|
9866
|
+
header && /* @__PURE__ */ (0, import_jsx_runtime352.jsx)("div", { className: "lib-xplat-layout-conent-header", children: header }),
|
|
9815
9867
|
children
|
|
9816
9868
|
] })
|
|
9817
9869
|
] }) });
|
|
@@ -9820,31 +9872,31 @@ Layout.displayName = "Layout";
|
|
|
9820
9872
|
var Layout_default = Layout;
|
|
9821
9873
|
|
|
9822
9874
|
// src/layout/SideBar/SideBar.tsx
|
|
9823
|
-
var
|
|
9875
|
+
var import_react42 = __toESM(require("react"), 1);
|
|
9824
9876
|
|
|
9825
9877
|
// src/layout/SideBar/SideBarContext.tsx
|
|
9826
|
-
var
|
|
9827
|
-
var SideBarContext =
|
|
9878
|
+
var import_react41 = __toESM(require("react"), 1);
|
|
9879
|
+
var SideBarContext = import_react41.default.createContext(null);
|
|
9828
9880
|
var useSideBarContext = () => {
|
|
9829
|
-
const ctx =
|
|
9881
|
+
const ctx = import_react41.default.useContext(SideBarContext);
|
|
9830
9882
|
if (!ctx) throw new Error("Error");
|
|
9831
9883
|
return ctx;
|
|
9832
9884
|
};
|
|
9833
9885
|
var SideBarContext_default = SideBarContext;
|
|
9834
9886
|
|
|
9835
9887
|
// src/layout/SideBar/SideBar.tsx
|
|
9836
|
-
var
|
|
9888
|
+
var import_jsx_runtime353 = require("react/jsx-runtime");
|
|
9837
9889
|
var SideBar = (props) => {
|
|
9838
9890
|
const { children, className } = props;
|
|
9839
|
-
const [isOpen, setIsOpen] =
|
|
9891
|
+
const [isOpen, setIsOpen] = import_react42.default.useState(true);
|
|
9840
9892
|
const handleSwitchSideBar = () => {
|
|
9841
9893
|
setIsOpen((prev) => !prev);
|
|
9842
9894
|
};
|
|
9843
|
-
return /* @__PURE__ */ (0,
|
|
9895
|
+
return /* @__PURE__ */ (0, import_jsx_runtime353.jsx)(
|
|
9844
9896
|
SideBarContext_default.Provider,
|
|
9845
9897
|
{
|
|
9846
9898
|
value: { isSidebarOpen: isOpen, handleSwitchSideBar },
|
|
9847
|
-
children: /* @__PURE__ */ (0,
|
|
9899
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime353.jsx)(
|
|
9848
9900
|
"div",
|
|
9849
9901
|
{
|
|
9850
9902
|
className: clsx_default(
|