@x-plat/design-system 0.5.22 → 0.5.23
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/ChatInput/index.cjs +57 -94
- package/dist/components/ChatInput/index.css +2 -48
- package/dist/components/ChatInput/index.js +55 -92
- package/dist/components/index.cjs +529 -509
- package/dist/components/index.css +48 -48
- package/dist/components/index.js +483 -463
- package/dist/index.cjs +529 -509
- package/dist/index.css +48 -48
- package/dist/index.js +483 -463
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -6434,68 +6434,10 @@ Calendar.displayName = "Calendar";
|
|
|
6434
6434
|
var Calendar_default = Calendar;
|
|
6435
6435
|
|
|
6436
6436
|
// src/components/ChatInput/ChatInput.tsx
|
|
6437
|
-
var import_react5 = __toESM(require("react"), 1);
|
|
6438
|
-
|
|
6439
|
-
// src/components/TextArea/TextArea.tsx
|
|
6440
6437
|
var import_react4 = __toESM(require("react"), 1);
|
|
6441
6438
|
var import_jsx_runtime302 = require("react/jsx-runtime");
|
|
6442
|
-
var
|
|
6443
|
-
|
|
6444
|
-
const { value, onChange, disabled, ...textareaProps } = props;
|
|
6445
|
-
const localRef = import_react4.default.useRef(null);
|
|
6446
|
-
const setRefs = (el) => {
|
|
6447
|
-
localRef.current = el;
|
|
6448
|
-
if (!ref) return;
|
|
6449
|
-
if (typeof ref === "function") {
|
|
6450
|
-
ref(el);
|
|
6451
|
-
} else if (ref && typeof ref === "object" && "current" in ref) {
|
|
6452
|
-
ref.current = el;
|
|
6453
|
-
}
|
|
6454
|
-
};
|
|
6455
|
-
const handleOnChange = (e) => {
|
|
6456
|
-
const val = e.target.value;
|
|
6457
|
-
if (onChange) {
|
|
6458
|
-
const event = {
|
|
6459
|
-
...e,
|
|
6460
|
-
target: { value: val }
|
|
6461
|
-
};
|
|
6462
|
-
onChange(event);
|
|
6463
|
-
}
|
|
6464
|
-
};
|
|
6465
|
-
import_react4.default.useEffect(() => {
|
|
6466
|
-
const el = localRef.current;
|
|
6467
|
-
if (!el) return;
|
|
6468
|
-
el.style.height = "0px";
|
|
6469
|
-
const nextHeight = Math.min(el.scrollHeight, 400);
|
|
6470
|
-
el.style.height = `${nextHeight}px`;
|
|
6471
|
-
}, [value]);
|
|
6472
|
-
return /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("div", { className: "lib-xplat-textarea-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
|
|
6473
|
-
"div",
|
|
6474
|
-
{
|
|
6475
|
-
className: clsx_default(
|
|
6476
|
-
"lib-xplat-textarea",
|
|
6477
|
-
disabled ? "disabled" : void 0
|
|
6478
|
-
),
|
|
6479
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
|
|
6480
|
-
"textarea",
|
|
6481
|
-
{
|
|
6482
|
-
...textareaProps,
|
|
6483
|
-
ref: setRefs,
|
|
6484
|
-
disabled,
|
|
6485
|
-
value,
|
|
6486
|
-
onChange: handleOnChange
|
|
6487
|
-
}
|
|
6488
|
-
)
|
|
6489
|
-
}
|
|
6490
|
-
) });
|
|
6491
|
-
}
|
|
6492
|
-
);
|
|
6493
|
-
TextArea.displayName = "TextArea";
|
|
6494
|
-
var TextArea_default = TextArea;
|
|
6495
|
-
|
|
6496
|
-
// src/components/ChatInput/ChatInput.tsx
|
|
6497
|
-
var import_jsx_runtime303 = require("react/jsx-runtime");
|
|
6498
|
-
var ChatInput = import_react5.default.forwardRef(
|
|
6439
|
+
var MAX_HEIGHT = 200;
|
|
6440
|
+
var ChatInput = import_react4.default.forwardRef(
|
|
6499
6441
|
(props, ref) => {
|
|
6500
6442
|
const {
|
|
6501
6443
|
placeholder,
|
|
@@ -6506,9 +6448,24 @@ var ChatInput = import_react5.default.forwardRef(
|
|
|
6506
6448
|
onChange
|
|
6507
6449
|
} = props;
|
|
6508
6450
|
const isControlled = valueProp !== void 0;
|
|
6509
|
-
const [internalValue, setInternalValue] =
|
|
6451
|
+
const [internalValue, setInternalValue] = import_react4.default.useState("");
|
|
6510
6452
|
const value = isControlled ? valueProp : internalValue;
|
|
6511
6453
|
const hasText = value.trim().length > 0;
|
|
6454
|
+
const textareaRef = import_react4.default.useRef(null);
|
|
6455
|
+
const setRefs = import_react4.default.useCallback(
|
|
6456
|
+
(el) => {
|
|
6457
|
+
textareaRef.current = el;
|
|
6458
|
+
if (typeof ref === "function") ref(el);
|
|
6459
|
+
else if (ref) ref.current = el;
|
|
6460
|
+
},
|
|
6461
|
+
[ref]
|
|
6462
|
+
);
|
|
6463
|
+
const updateHeight = import_react4.default.useCallback(() => {
|
|
6464
|
+
const el = textareaRef.current;
|
|
6465
|
+
if (!el) return;
|
|
6466
|
+
el.style.height = "0px";
|
|
6467
|
+
el.style.height = `${Math.min(el.scrollHeight, MAX_HEIGHT)}px`;
|
|
6468
|
+
}, []);
|
|
6512
6469
|
const handleChange = (e) => {
|
|
6513
6470
|
const val = e.target.value;
|
|
6514
6471
|
if (!isControlled) setInternalValue(val);
|
|
@@ -6518,6 +6475,7 @@ var ChatInput = import_react5.default.forwardRef(
|
|
|
6518
6475
|
if (!hasText || disabled) return;
|
|
6519
6476
|
onSubmit?.(value);
|
|
6520
6477
|
if (!isControlled) setInternalValue("");
|
|
6478
|
+
requestAnimationFrame(updateHeight);
|
|
6521
6479
|
};
|
|
6522
6480
|
const handleKeyDown = (e) => {
|
|
6523
6481
|
if (e.key === "Enter" && !e.shiftKey) {
|
|
@@ -6525,19 +6483,24 @@ var ChatInput = import_react5.default.forwardRef(
|
|
|
6525
6483
|
handleSubmit();
|
|
6526
6484
|
}
|
|
6527
6485
|
};
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6486
|
+
import_react4.default.useEffect(() => {
|
|
6487
|
+
updateHeight();
|
|
6488
|
+
}, [value, updateHeight]);
|
|
6489
|
+
return /* @__PURE__ */ (0, import_jsx_runtime302.jsxs)("div", { className: clsx_default("lib-xplat-chat-input", disabled && "disabled"), children: [
|
|
6490
|
+
/* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
|
|
6491
|
+
"textarea",
|
|
6531
6492
|
{
|
|
6532
|
-
ref,
|
|
6493
|
+
ref: setRefs,
|
|
6494
|
+
className: "chat-input-textarea",
|
|
6533
6495
|
placeholder,
|
|
6534
6496
|
value,
|
|
6535
6497
|
disabled,
|
|
6498
|
+
rows: 1,
|
|
6536
6499
|
onChange: handleChange,
|
|
6537
6500
|
onKeyDown: handleKeyDown
|
|
6538
6501
|
}
|
|
6539
6502
|
),
|
|
6540
|
-
/* @__PURE__ */ (0,
|
|
6503
|
+
/* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
|
|
6541
6504
|
"button",
|
|
6542
6505
|
{
|
|
6543
6506
|
type: "button",
|
|
@@ -6545,7 +6508,7 @@ var ChatInput = import_react5.default.forwardRef(
|
|
|
6545
6508
|
disabled: !hasText || disabled,
|
|
6546
6509
|
onClick: handleSubmit,
|
|
6547
6510
|
"aria-label": "\uC804\uC1A1",
|
|
6548
|
-
children: /* @__PURE__ */ (0,
|
|
6511
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(SendIcon_default, {})
|
|
6549
6512
|
}
|
|
6550
6513
|
)
|
|
6551
6514
|
] });
|
|
@@ -6555,29 +6518,29 @@ ChatInput.displayName = "ChatInput";
|
|
|
6555
6518
|
var ChatInput_default = ChatInput;
|
|
6556
6519
|
|
|
6557
6520
|
// src/components/Box/Box.tsx
|
|
6558
|
-
var
|
|
6521
|
+
var import_jsx_runtime303 = require("react/jsx-runtime");
|
|
6559
6522
|
var Box = ({
|
|
6560
6523
|
children,
|
|
6561
6524
|
title,
|
|
6562
6525
|
variant = "outlined",
|
|
6563
6526
|
padding = "md"
|
|
6564
6527
|
}) => {
|
|
6565
|
-
return /* @__PURE__ */ (0,
|
|
6566
|
-
title && /* @__PURE__ */ (0,
|
|
6567
|
-
/* @__PURE__ */ (0,
|
|
6528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)("div", { className: clsx_default("lib-xplat-box", variant, `pad-${padding}`), children: [
|
|
6529
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("div", { className: "box-title", children: title }),
|
|
6530
|
+
/* @__PURE__ */ (0, import_jsx_runtime303.jsx)("div", { className: "box-content", children })
|
|
6568
6531
|
] });
|
|
6569
6532
|
};
|
|
6570
6533
|
Box.displayName = "Box";
|
|
6571
6534
|
var Box_default = Box;
|
|
6572
6535
|
|
|
6573
6536
|
// src/components/CardTab/CardTab.tsx
|
|
6574
|
-
var
|
|
6537
|
+
var import_react5 = __toESM(require("react"), 1);
|
|
6575
6538
|
|
|
6576
6539
|
// src/components/CardTab/CardTabPanel.tsx
|
|
6577
|
-
var
|
|
6540
|
+
var import_jsx_runtime304 = require("react/jsx-runtime");
|
|
6578
6541
|
var CardTabPanel = (props) => {
|
|
6579
6542
|
const { children, columns = 3 } = props;
|
|
6580
|
-
return /* @__PURE__ */ (0,
|
|
6543
|
+
return /* @__PURE__ */ (0, import_jsx_runtime304.jsx)(
|
|
6581
6544
|
"div",
|
|
6582
6545
|
{
|
|
6583
6546
|
className: "card-tab-panel",
|
|
@@ -6590,7 +6553,7 @@ CardTabPanel.displayName = "CardTab.Panel";
|
|
|
6590
6553
|
var CardTabPanel_default = CardTabPanel;
|
|
6591
6554
|
|
|
6592
6555
|
// src/components/CardTab/CardTab.tsx
|
|
6593
|
-
var
|
|
6556
|
+
var import_jsx_runtime305 = require("react/jsx-runtime");
|
|
6594
6557
|
var CardTabRoot = (props) => {
|
|
6595
6558
|
const {
|
|
6596
6559
|
tabs,
|
|
@@ -6600,7 +6563,7 @@ var CardTabRoot = (props) => {
|
|
|
6600
6563
|
children
|
|
6601
6564
|
} = props;
|
|
6602
6565
|
const isControlled = activeValueProp !== void 0;
|
|
6603
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
6566
|
+
const [uncontrolledValue, setUncontrolledValue] = import_react5.default.useState(tabs[0]?.value ?? "");
|
|
6604
6567
|
const activeValue = isControlled ? activeValueProp : uncontrolledValue;
|
|
6605
6568
|
const handleTabClick = (tab) => {
|
|
6606
6569
|
if (!isControlled) {
|
|
@@ -6608,16 +6571,16 @@ var CardTabRoot = (props) => {
|
|
|
6608
6571
|
}
|
|
6609
6572
|
onChange?.(tab);
|
|
6610
6573
|
};
|
|
6611
|
-
const panels =
|
|
6612
|
-
(child) =>
|
|
6574
|
+
const panels = import_react5.default.Children.toArray(children).filter(
|
|
6575
|
+
(child) => import_react5.default.isValidElement(child) && child.type === CardTabPanel_default
|
|
6613
6576
|
);
|
|
6614
6577
|
const activePanel = panels.find(
|
|
6615
6578
|
(panel) => panel.props.value === activeValue
|
|
6616
6579
|
);
|
|
6617
|
-
return /* @__PURE__ */ (0,
|
|
6618
|
-
/* @__PURE__ */ (0,
|
|
6580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("div", { className: clsx_default("lib-xplat-card-tab", size), children: [
|
|
6581
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("div", { className: "card-tab-bar", children: tabs.map((tab) => {
|
|
6619
6582
|
const isActive = tab.value === activeValue;
|
|
6620
|
-
return /* @__PURE__ */ (0,
|
|
6583
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
|
|
6621
6584
|
"button",
|
|
6622
6585
|
{
|
|
6623
6586
|
className: clsx_default("card-tab-trigger", isActive && "active"),
|
|
@@ -6629,7 +6592,7 @@ var CardTabRoot = (props) => {
|
|
|
6629
6592
|
tab.value
|
|
6630
6593
|
);
|
|
6631
6594
|
}) }),
|
|
6632
|
-
/* @__PURE__ */ (0,
|
|
6595
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("div", { className: "card-tab-body", children: activePanel })
|
|
6633
6596
|
] });
|
|
6634
6597
|
};
|
|
6635
6598
|
CardTabRoot.displayName = "CardTab";
|
|
@@ -6639,8 +6602,8 @@ var CardTab = Object.assign(CardTabRoot, {
|
|
|
6639
6602
|
var CardTab_default = CardTab;
|
|
6640
6603
|
|
|
6641
6604
|
// src/components/Chart/Chart.tsx
|
|
6642
|
-
var
|
|
6643
|
-
var
|
|
6605
|
+
var import_react6 = __toESM(require("react"), 1);
|
|
6606
|
+
var import_jsx_runtime306 = require("react/jsx-runtime");
|
|
6644
6607
|
var CATEGORICAL_COUNT2 = 8;
|
|
6645
6608
|
var LINE_BAR_PALETTES = Array.from({ length: CATEGORICAL_COUNT2 }, (_, i) => {
|
|
6646
6609
|
const n = i + 1;
|
|
@@ -6686,11 +6649,11 @@ var toSmoothPath = (points) => {
|
|
|
6686
6649
|
};
|
|
6687
6650
|
var RESIZE_SETTLE_MS = 150;
|
|
6688
6651
|
var useChartSize = (ref) => {
|
|
6689
|
-
const [size, setSize] =
|
|
6690
|
-
const settleTimer =
|
|
6691
|
-
const committedSize =
|
|
6692
|
-
const initialRef =
|
|
6693
|
-
|
|
6652
|
+
const [size, setSize] = import_react6.default.useState({ width: 0, height: 0 });
|
|
6653
|
+
const settleTimer = import_react6.default.useRef(0);
|
|
6654
|
+
const committedSize = import_react6.default.useRef({ width: 0, height: 0 });
|
|
6655
|
+
const initialRef = import_react6.default.useRef(true);
|
|
6656
|
+
import_react6.default.useEffect(() => {
|
|
6694
6657
|
const el = ref.current;
|
|
6695
6658
|
if (!el) return;
|
|
6696
6659
|
const observer = new ResizeObserver((entries) => {
|
|
@@ -6732,10 +6695,10 @@ var useChartSize = (ref) => {
|
|
|
6732
6695
|
};
|
|
6733
6696
|
var prefersReducedMotion = () => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
6734
6697
|
var useChartAnimation = (containerRef, dataKey) => {
|
|
6735
|
-
const [animate, setAnimate] =
|
|
6736
|
-
const prevDataKey =
|
|
6737
|
-
const hasAnimated =
|
|
6738
|
-
|
|
6698
|
+
const [animate, setAnimate] = import_react6.default.useState(false);
|
|
6699
|
+
const prevDataKey = import_react6.default.useRef(dataKey);
|
|
6700
|
+
const hasAnimated = import_react6.default.useRef(false);
|
|
6701
|
+
import_react6.default.useEffect(() => {
|
|
6739
6702
|
if (prefersReducedMotion()) return;
|
|
6740
6703
|
const el = containerRef.current;
|
|
6741
6704
|
if (!el) return;
|
|
@@ -6751,7 +6714,7 @@ var useChartAnimation = (containerRef, dataKey) => {
|
|
|
6751
6714
|
observer.observe(el);
|
|
6752
6715
|
return () => observer.disconnect();
|
|
6753
6716
|
}, [containerRef]);
|
|
6754
|
-
|
|
6717
|
+
import_react6.default.useEffect(() => {
|
|
6755
6718
|
if (dataKey !== prevDataKey.current) {
|
|
6756
6719
|
prevDataKey.current = dataKey;
|
|
6757
6720
|
if (prefersReducedMotion()) return;
|
|
@@ -6762,15 +6725,15 @@ var useChartAnimation = (containerRef, dataKey) => {
|
|
|
6762
6725
|
return animate || prefersReducedMotion();
|
|
6763
6726
|
};
|
|
6764
6727
|
var useChartTooltip = (enabled) => {
|
|
6765
|
-
const [tooltip, setTooltip] =
|
|
6728
|
+
const [tooltip, setTooltip] = import_react6.default.useState({
|
|
6766
6729
|
visible: false,
|
|
6767
6730
|
x: 0,
|
|
6768
6731
|
y: 0,
|
|
6769
6732
|
content: ""
|
|
6770
6733
|
});
|
|
6771
|
-
const containerRef =
|
|
6772
|
-
const rafRef =
|
|
6773
|
-
const move =
|
|
6734
|
+
const containerRef = import_react6.default.useRef(null);
|
|
6735
|
+
const rafRef = import_react6.default.useRef(0);
|
|
6736
|
+
const move = import_react6.default.useCallback((e) => {
|
|
6774
6737
|
if (!enabled) return;
|
|
6775
6738
|
const clientX = e.clientX;
|
|
6776
6739
|
const clientY = e.clientY;
|
|
@@ -6785,7 +6748,7 @@ var useChartTooltip = (enabled) => {
|
|
|
6785
6748
|
}));
|
|
6786
6749
|
});
|
|
6787
6750
|
}, [enabled]);
|
|
6788
|
-
const show =
|
|
6751
|
+
const show = import_react6.default.useCallback((e, content) => {
|
|
6789
6752
|
if (!enabled) return;
|
|
6790
6753
|
const rect = containerRef.current?.getBoundingClientRect();
|
|
6791
6754
|
if (!rect) return;
|
|
@@ -6796,18 +6759,18 @@ var useChartTooltip = (enabled) => {
|
|
|
6796
6759
|
content
|
|
6797
6760
|
});
|
|
6798
6761
|
}, [enabled]);
|
|
6799
|
-
const hide =
|
|
6762
|
+
const hide = import_react6.default.useCallback(() => {
|
|
6800
6763
|
cancelAnimationFrame(rafRef.current);
|
|
6801
6764
|
setTooltip((prev) => ({ ...prev, visible: false }));
|
|
6802
6765
|
}, []);
|
|
6803
6766
|
return { tooltip, show, hide, move, containerRef };
|
|
6804
6767
|
};
|
|
6805
|
-
var GridLines =
|
|
6768
|
+
var GridLines = import_react6.default.memo(({ width, height, chartH, maxVal }) => /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(import_jsx_runtime306.Fragment, { children: [0, 0.25, 0.5, 0.75, 1].map((ratio) => {
|
|
6806
6769
|
const y = PADDING.top + (1 - ratio) * chartH;
|
|
6807
6770
|
const val = Math.round(maxVal * ratio);
|
|
6808
|
-
return /* @__PURE__ */ (0,
|
|
6809
|
-
/* @__PURE__ */ (0,
|
|
6810
|
-
/* @__PURE__ */ (0,
|
|
6771
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("g", { children: [
|
|
6772
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
|
|
6773
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
|
|
6811
6774
|
] }, ratio);
|
|
6812
6775
|
}) }));
|
|
6813
6776
|
GridLines.displayName = "GridLines";
|
|
@@ -6817,25 +6780,25 @@ var getLabelStep = (count, chartW) => {
|
|
|
6817
6780
|
if (count <= maxLabels) return 1;
|
|
6818
6781
|
return Math.ceil(count / maxLabels);
|
|
6819
6782
|
};
|
|
6820
|
-
var AxisLabels =
|
|
6783
|
+
var AxisLabels = import_react6.default.memo(({ labels, count, chartW, height }) => {
|
|
6821
6784
|
const step = getLabelStep(count, chartW);
|
|
6822
|
-
return /* @__PURE__ */ (0,
|
|
6785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(import_jsx_runtime306.Fragment, { children: labels.map((label, i) => {
|
|
6823
6786
|
if (i % step !== 0) return null;
|
|
6824
6787
|
const x = PADDING.left + i / (count - 1 || 1) * chartW;
|
|
6825
|
-
return /* @__PURE__ */ (0,
|
|
6788
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("text", { x, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
6826
6789
|
}) });
|
|
6827
6790
|
});
|
|
6828
6791
|
AxisLabels.displayName = "AxisLabels";
|
|
6829
|
-
var LineChart =
|
|
6830
|
-
const entries =
|
|
6831
|
-
const maxVal =
|
|
6792
|
+
var LineChart = import_react6.default.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
|
|
6793
|
+
const entries = import_react6.default.useMemo(() => Object.entries(data), [data]);
|
|
6794
|
+
const maxVal = import_react6.default.useMemo(() => {
|
|
6832
6795
|
const allValues = entries.flatMap(([, v]) => v);
|
|
6833
6796
|
return Math.max(...allValues) * 1.2 || 1;
|
|
6834
6797
|
}, [entries]);
|
|
6835
6798
|
const count = labels.length;
|
|
6836
6799
|
const chartW = width - PADDING.left - PADDING.right;
|
|
6837
6800
|
const chartH = height - PADDING.top - PADDING.bottom;
|
|
6838
|
-
const seriesPoints =
|
|
6801
|
+
const seriesPoints = import_react6.default.useMemo(
|
|
6839
6802
|
() => entries.map(
|
|
6840
6803
|
([, values]) => values.map((v, i) => ({
|
|
6841
6804
|
x: PADDING.left + i / (count - 1 || 1) * chartW,
|
|
@@ -6846,8 +6809,8 @@ var LineChart = import_react7.default.memo(({ data, labels, width, height, anima
|
|
|
6846
6809
|
[entries, count, chartW, chartH, maxVal]
|
|
6847
6810
|
);
|
|
6848
6811
|
const showPoints = count <= 100;
|
|
6849
|
-
const lineRefs =
|
|
6850
|
-
|
|
6812
|
+
const lineRefs = import_react6.default.useRef([]);
|
|
6813
|
+
import_react6.default.useEffect(() => {
|
|
6851
6814
|
if (!animate) return;
|
|
6852
6815
|
lineRefs.current.forEach((el) => {
|
|
6853
6816
|
if (!el) return;
|
|
@@ -6860,9 +6823,9 @@ var LineChart = import_react7.default.memo(({ data, labels, width, height, anima
|
|
|
6860
6823
|
});
|
|
6861
6824
|
});
|
|
6862
6825
|
}, [animate, seriesPoints]);
|
|
6863
|
-
return /* @__PURE__ */ (0,
|
|
6864
|
-
/* @__PURE__ */ (0,
|
|
6865
|
-
/* @__PURE__ */ (0,
|
|
6826
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
6827
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)(GridLines, { width, height, chartH, maxVal }),
|
|
6828
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)(AxisLabels, { labels, count, chartW, height }),
|
|
6866
6829
|
entries.map(([key], di) => {
|
|
6867
6830
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
6868
6831
|
const color = palette[2];
|
|
@@ -6871,12 +6834,12 @@ var LineChart = import_react7.default.memo(({ data, labels, width, height, anima
|
|
|
6871
6834
|
const gradientId = `line-gradient-${di}`;
|
|
6872
6835
|
const polyPoints = points.map((p) => `${p.x},${p.y}`).join(" ");
|
|
6873
6836
|
const areaD = `M ${points[0].x},${points[0].y} ${points.map((p) => `L ${p.x},${p.y}`).join(" ")} L ${points[points.length - 1].x},${PADDING.top + chartH} L ${points[0].x},${PADDING.top + chartH} Z`;
|
|
6874
|
-
return /* @__PURE__ */ (0,
|
|
6875
|
-
/* @__PURE__ */ (0,
|
|
6876
|
-
/* @__PURE__ */ (0,
|
|
6877
|
-
/* @__PURE__ */ (0,
|
|
6837
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("g", { children: [
|
|
6838
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
6839
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.2" }),
|
|
6840
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0" })
|
|
6878
6841
|
] }) }),
|
|
6879
|
-
/* @__PURE__ */ (0,
|
|
6842
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
6880
6843
|
"path",
|
|
6881
6844
|
{
|
|
6882
6845
|
d: areaD,
|
|
@@ -6885,7 +6848,7 @@ var LineChart = import_react7.default.memo(({ data, labels, width, height, anima
|
|
|
6885
6848
|
style: animate ? { animationDelay: "600ms" } : { opacity: 1 }
|
|
6886
6849
|
}
|
|
6887
6850
|
),
|
|
6888
|
-
/* @__PURE__ */ (0,
|
|
6851
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
6889
6852
|
"polyline",
|
|
6890
6853
|
{
|
|
6891
6854
|
ref: (el) => {
|
|
@@ -6897,7 +6860,7 @@ var LineChart = import_react7.default.memo(({ data, labels, width, height, anima
|
|
|
6897
6860
|
strokeWidth: "2"
|
|
6898
6861
|
}
|
|
6899
6862
|
),
|
|
6900
|
-
showPoints && points.map((p, i) => /* @__PURE__ */ (0,
|
|
6863
|
+
showPoints && points.map((p, i) => /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
6901
6864
|
"circle",
|
|
6902
6865
|
{
|
|
6903
6866
|
cx: p.x,
|
|
@@ -6916,16 +6879,16 @@ var LineChart = import_react7.default.memo(({ data, labels, width, height, anima
|
|
|
6916
6879
|
] });
|
|
6917
6880
|
});
|
|
6918
6881
|
LineChart.displayName = "LineChart";
|
|
6919
|
-
var CurveChart =
|
|
6920
|
-
const entries =
|
|
6921
|
-
const maxVal =
|
|
6882
|
+
var CurveChart = import_react6.default.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
|
|
6883
|
+
const entries = import_react6.default.useMemo(() => Object.entries(data), [data]);
|
|
6884
|
+
const maxVal = import_react6.default.useMemo(() => {
|
|
6922
6885
|
const allValues = entries.flatMap(([, v]) => v);
|
|
6923
6886
|
return Math.max(...allValues) * 1.2 || 1;
|
|
6924
6887
|
}, [entries]);
|
|
6925
6888
|
const count = labels.length;
|
|
6926
6889
|
const chartW = width - PADDING.left - PADDING.right;
|
|
6927
6890
|
const chartH = height - PADDING.top - PADDING.bottom;
|
|
6928
|
-
const seriesPoints =
|
|
6891
|
+
const seriesPoints = import_react6.default.useMemo(
|
|
6929
6892
|
() => entries.map(
|
|
6930
6893
|
([, values]) => values.map((v, i) => ({
|
|
6931
6894
|
x: PADDING.left + i / (count - 1 || 1) * chartW,
|
|
@@ -6936,8 +6899,8 @@ var CurveChart = import_react7.default.memo(({ data, labels, width, height, anim
|
|
|
6936
6899
|
[entries, count, chartW, chartH, maxVal]
|
|
6937
6900
|
);
|
|
6938
6901
|
const showPoints = count <= 100;
|
|
6939
|
-
const lineRefs =
|
|
6940
|
-
|
|
6902
|
+
const lineRefs = import_react6.default.useRef([]);
|
|
6903
|
+
import_react6.default.useEffect(() => {
|
|
6941
6904
|
if (!animate) return;
|
|
6942
6905
|
lineRefs.current.forEach((el) => {
|
|
6943
6906
|
if (!el) return;
|
|
@@ -6950,9 +6913,9 @@ var CurveChart = import_react7.default.memo(({ data, labels, width, height, anim
|
|
|
6950
6913
|
});
|
|
6951
6914
|
});
|
|
6952
6915
|
}, [animate, seriesPoints]);
|
|
6953
|
-
return /* @__PURE__ */ (0,
|
|
6954
|
-
/* @__PURE__ */ (0,
|
|
6955
|
-
/* @__PURE__ */ (0,
|
|
6916
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
6917
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)(GridLines, { width, height, chartH, maxVal }),
|
|
6918
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)(AxisLabels, { labels, count, chartW, height }),
|
|
6956
6919
|
entries.map(([key], di) => {
|
|
6957
6920
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
6958
6921
|
const color = palette[2];
|
|
@@ -6961,12 +6924,12 @@ var CurveChart = import_react7.default.memo(({ data, labels, width, height, anim
|
|
|
6961
6924
|
const gradientId = `curve-gradient-${di}`;
|
|
6962
6925
|
const linePath = toSmoothPath(points);
|
|
6963
6926
|
const areaPath = linePath + ` L ${points[points.length - 1].x} ${PADDING.top + chartH} L ${points[0].x} ${PADDING.top + chartH} Z`;
|
|
6964
|
-
return /* @__PURE__ */ (0,
|
|
6965
|
-
/* @__PURE__ */ (0,
|
|
6966
|
-
/* @__PURE__ */ (0,
|
|
6967
|
-
/* @__PURE__ */ (0,
|
|
6927
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("g", { children: [
|
|
6928
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
6929
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.4" }),
|
|
6930
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0.02" })
|
|
6968
6931
|
] }) }),
|
|
6969
|
-
/* @__PURE__ */ (0,
|
|
6932
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
6970
6933
|
"path",
|
|
6971
6934
|
{
|
|
6972
6935
|
d: areaPath,
|
|
@@ -6975,7 +6938,7 @@ var CurveChart = import_react7.default.memo(({ data, labels, width, height, anim
|
|
|
6975
6938
|
style: animate ? { animationDelay: "600ms" } : { opacity: 1 }
|
|
6976
6939
|
}
|
|
6977
6940
|
),
|
|
6978
|
-
/* @__PURE__ */ (0,
|
|
6941
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
6979
6942
|
"path",
|
|
6980
6943
|
{
|
|
6981
6944
|
ref: (el) => {
|
|
@@ -6987,7 +6950,7 @@ var CurveChart = import_react7.default.memo(({ data, labels, width, height, anim
|
|
|
6987
6950
|
strokeWidth: "2"
|
|
6988
6951
|
}
|
|
6989
6952
|
),
|
|
6990
|
-
showPoints && points.map((p, i) => /* @__PURE__ */ (0,
|
|
6953
|
+
showPoints && points.map((p, i) => /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
6991
6954
|
"circle",
|
|
6992
6955
|
{
|
|
6993
6956
|
cx: p.x,
|
|
@@ -7006,9 +6969,9 @@ var CurveChart = import_react7.default.memo(({ data, labels, width, height, anim
|
|
|
7006
6969
|
] });
|
|
7007
6970
|
});
|
|
7008
6971
|
CurveChart.displayName = "CurveChart";
|
|
7009
|
-
var BarChart =
|
|
7010
|
-
const entries =
|
|
7011
|
-
const maxVal =
|
|
6972
|
+
var BarChart = import_react6.default.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
|
|
6973
|
+
const entries = import_react6.default.useMemo(() => Object.entries(data), [data]);
|
|
6974
|
+
const maxVal = import_react6.default.useMemo(() => {
|
|
7012
6975
|
const allValues = entries.flatMap(([, v]) => v);
|
|
7013
6976
|
return Math.max(...allValues) * 1.2 || 1;
|
|
7014
6977
|
}, [entries]);
|
|
@@ -7020,7 +6983,7 @@ var BarChart = import_react7.default.memo(({ data, labels, width, height, animat
|
|
|
7020
6983
|
const barGap = groupCount > 1 ? 2 : 0;
|
|
7021
6984
|
const barW = Math.max(1, Math.min(32, (groupW * 0.7 - barGap * (groupCount - 1)) / groupCount));
|
|
7022
6985
|
const baseline = PADDING.top + chartH;
|
|
7023
|
-
const bars =
|
|
6986
|
+
const bars = import_react6.default.useMemo(
|
|
7024
6987
|
() => entries.map(
|
|
7025
6988
|
([, values], di) => values.map((v, i) => {
|
|
7026
6989
|
const totalBarsW = barW * groupCount + barGap * (groupCount - 1);
|
|
@@ -7033,11 +6996,11 @@ var BarChart = import_react7.default.memo(({ data, labels, width, height, animat
|
|
|
7033
6996
|
[entries, maxVal, chartH, groupW, barW, barGap, groupCount]
|
|
7034
6997
|
);
|
|
7035
6998
|
const barLabelStep = getLabelStep(count, chartW);
|
|
7036
|
-
return /* @__PURE__ */ (0,
|
|
7037
|
-
/* @__PURE__ */ (0,
|
|
6999
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
7000
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)(GridLines, { width, height, chartH, maxVal }),
|
|
7038
7001
|
labels.map((label, i) => {
|
|
7039
7002
|
if (i % barLabelStep !== 0) return null;
|
|
7040
|
-
return /* @__PURE__ */ (0,
|
|
7003
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("text", { x: PADDING.left + groupW * i + groupW / 2, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
7041
7004
|
}),
|
|
7042
7005
|
entries.map(([key], di) => {
|
|
7043
7006
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
@@ -7046,7 +7009,7 @@ var BarChart = import_react7.default.memo(({ data, labels, width, height, animat
|
|
|
7046
7009
|
const r2 = Math.min(4, b.w / 2);
|
|
7047
7010
|
const d = b.h <= r2 ? `M ${b.x} ${b.y + b.h} V ${b.y} H ${b.x + b.w} V ${b.y + b.h} Z` : `M ${b.x} ${b.y + b.h} V ${b.y + r2} Q ${b.x} ${b.y} ${b.x + r2} ${b.y} H ${b.x + b.w - r2} Q ${b.x + b.w} ${b.y} ${b.x + b.w} ${b.y + r2} V ${b.y + b.h} Z`;
|
|
7048
7011
|
const delay = 100 + i * 80;
|
|
7049
|
-
return /* @__PURE__ */ (0,
|
|
7012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
7050
7013
|
"path",
|
|
7051
7014
|
{
|
|
7052
7015
|
d,
|
|
@@ -7067,11 +7030,11 @@ var BarChart = import_react7.default.memo(({ data, labels, width, height, animat
|
|
|
7067
7030
|
] });
|
|
7068
7031
|
});
|
|
7069
7032
|
BarChart.displayName = "BarChart";
|
|
7070
|
-
var PieDonutChart =
|
|
7033
|
+
var PieDonutChart = import_react6.default.memo(
|
|
7071
7034
|
({ data, labels, width, height, animate, isDoughnut, onHover, onMove, onLeave }) => {
|
|
7072
|
-
const entries =
|
|
7073
|
-
const values =
|
|
7074
|
-
const total =
|
|
7035
|
+
const entries = import_react6.default.useMemo(() => Object.entries(data), [data]);
|
|
7036
|
+
const values = import_react6.default.useMemo(() => entries.flatMap(([, v]) => v), [entries]);
|
|
7037
|
+
const total = import_react6.default.useMemo(() => values.reduce((a, b) => a + b, 0) || 1, [values]);
|
|
7075
7038
|
const size = Math.min(width, height);
|
|
7076
7039
|
const cx = size / 2;
|
|
7077
7040
|
const cy = size / 2;
|
|
@@ -7079,10 +7042,10 @@ var PieDonutChart = import_react7.default.memo(
|
|
|
7079
7042
|
const innerR = isDoughnut ? r2 * 0.5 : 0;
|
|
7080
7043
|
const firstKey = entries[0]?.[0] ?? "";
|
|
7081
7044
|
const colorOffset = hashString(firstKey);
|
|
7082
|
-
const maskRef =
|
|
7045
|
+
const maskRef = import_react6.default.useRef(null);
|
|
7083
7046
|
const maskR = r2 + 10;
|
|
7084
7047
|
const maskCircumference = 2 * Math.PI * maskR;
|
|
7085
|
-
|
|
7048
|
+
import_react6.default.useEffect(() => {
|
|
7086
7049
|
if (!animate || !maskRef.current) return;
|
|
7087
7050
|
const el = maskRef.current;
|
|
7088
7051
|
el.style.strokeDasharray = `${maskCircumference}`;
|
|
@@ -7092,7 +7055,7 @@ var PieDonutChart = import_react7.default.memo(
|
|
|
7092
7055
|
el.style.strokeDashoffset = "0";
|
|
7093
7056
|
});
|
|
7094
7057
|
}, [animate, maskCircumference]);
|
|
7095
|
-
const sliceData =
|
|
7058
|
+
const sliceData = import_react6.default.useMemo(() => {
|
|
7096
7059
|
let angle0 = -Math.PI / 2;
|
|
7097
7060
|
let cumulativeAngle = 0;
|
|
7098
7061
|
return values.map((v, i) => {
|
|
@@ -7126,8 +7089,8 @@ var PieDonutChart = import_react7.default.memo(
|
|
|
7126
7089
|
});
|
|
7127
7090
|
}, [values, total, cx, cy, r2, innerR, labels]);
|
|
7128
7091
|
const maskId = `pie-mask-${isDoughnut ? "d" : "p"}`;
|
|
7129
|
-
return /* @__PURE__ */ (0,
|
|
7130
|
-
animate && /* @__PURE__ */ (0,
|
|
7092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("svg", { viewBox: `0 0 ${size} ${size}`, className: "chart-svg chart-pie", children: [
|
|
7093
|
+
animate && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("mask", { id: maskId, children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
7131
7094
|
"circle",
|
|
7132
7095
|
{
|
|
7133
7096
|
ref: maskRef,
|
|
@@ -7140,7 +7103,7 @@ var PieDonutChart = import_react7.default.memo(
|
|
|
7140
7103
|
transform: `rotate(-90 ${cx} ${cy})`
|
|
7141
7104
|
}
|
|
7142
7105
|
) }) }),
|
|
7143
|
-
/* @__PURE__ */ (0,
|
|
7106
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("g", { mask: animate ? `url(#${maskId})` : void 0, children: sliceData.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
7144
7107
|
"path",
|
|
7145
7108
|
{
|
|
7146
7109
|
d: s.d,
|
|
@@ -7151,7 +7114,7 @@ var PieDonutChart = import_react7.default.memo(
|
|
|
7151
7114
|
onMouseLeave: onLeave
|
|
7152
7115
|
}
|
|
7153
7116
|
) }, i)) }),
|
|
7154
|
-
sliceData.map((s, i) => s.angle > 0.2 && /* @__PURE__ */ (0,
|
|
7117
|
+
sliceData.map((s, i) => s.angle > 0.2 && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
7155
7118
|
"text",
|
|
7156
7119
|
{
|
|
7157
7120
|
x: s.lx,
|
|
@@ -7169,9 +7132,9 @@ var PieDonutChart = import_react7.default.memo(
|
|
|
7169
7132
|
);
|
|
7170
7133
|
PieDonutChart.displayName = "PieDonutChart";
|
|
7171
7134
|
var TooltipBubble = ({ x, y, containerWidth, children }) => {
|
|
7172
|
-
const ref =
|
|
7173
|
-
const [adjustedX, setAdjustedX] =
|
|
7174
|
-
|
|
7135
|
+
const ref = import_react6.default.useRef(null);
|
|
7136
|
+
const [adjustedX, setAdjustedX] = import_react6.default.useState(x);
|
|
7137
|
+
import_react6.default.useEffect(() => {
|
|
7175
7138
|
const el = ref.current;
|
|
7176
7139
|
if (!el) return;
|
|
7177
7140
|
const w = el.offsetWidth;
|
|
@@ -7182,7 +7145,7 @@ var TooltipBubble = ({ x, y, containerWidth, children }) => {
|
|
|
7182
7145
|
else if (x + half > containerWidth - margin) nx = containerWidth - half - margin;
|
|
7183
7146
|
setAdjustedX(nx);
|
|
7184
7147
|
}, [x, containerWidth]);
|
|
7185
|
-
return /* @__PURE__ */ (0,
|
|
7148
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
7186
7149
|
"div",
|
|
7187
7150
|
{
|
|
7188
7151
|
ref,
|
|
@@ -7192,22 +7155,22 @@ var TooltipBubble = ({ x, y, containerWidth, children }) => {
|
|
|
7192
7155
|
}
|
|
7193
7156
|
);
|
|
7194
7157
|
};
|
|
7195
|
-
var Chart =
|
|
7158
|
+
var Chart = import_react6.default.memo((props) => {
|
|
7196
7159
|
const { type, data, labels, tooltip: showTooltip = true } = props;
|
|
7197
7160
|
const { tooltip, show, hide, move, containerRef } = useChartTooltip(showTooltip);
|
|
7198
7161
|
const { width, height } = useChartSize(containerRef);
|
|
7199
|
-
const stableData =
|
|
7200
|
-
const stableLabels =
|
|
7201
|
-
const dataKey =
|
|
7162
|
+
const stableData = import_react6.default.useMemo(() => data, [JSON.stringify(data)]);
|
|
7163
|
+
const stableLabels = import_react6.default.useMemo(() => labels, [JSON.stringify(labels)]);
|
|
7164
|
+
const dataKey = import_react6.default.useMemo(() => JSON.stringify(labels), [labels]);
|
|
7202
7165
|
const animate = useChartAnimation(containerRef, dataKey);
|
|
7203
7166
|
const ready = width > 0 && height > 0;
|
|
7204
|
-
return /* @__PURE__ */ (0,
|
|
7205
|
-
ready && type === "line" && /* @__PURE__ */ (0,
|
|
7206
|
-
ready && type === "curve" && /* @__PURE__ */ (0,
|
|
7207
|
-
ready && type === "bar" && /* @__PURE__ */ (0,
|
|
7208
|
-
ready && type === "pie" && /* @__PURE__ */ (0,
|
|
7209
|
-
ready && type === "doughnut" && /* @__PURE__ */ (0,
|
|
7210
|
-
tooltip.visible && /* @__PURE__ */ (0,
|
|
7167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("div", { className: "lib-xplat-chart", ref: containerRef, children: [
|
|
7168
|
+
ready && type === "line" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(LineChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
7169
|
+
ready && type === "curve" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(CurveChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
7170
|
+
ready && type === "bar" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(BarChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
7171
|
+
ready && type === "pie" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
7172
|
+
ready && type === "doughnut" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, isDoughnut: true, onHover: show, onMove: move, onLeave: hide }),
|
|
7173
|
+
tooltip.visible && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(TooltipBubble, { x: tooltip.x, y: tooltip.y, containerWidth: width, children: tooltip.content })
|
|
7211
7174
|
] });
|
|
7212
7175
|
});
|
|
7213
7176
|
Chart.displayName = "Chart";
|
|
@@ -7233,7 +7196,7 @@ var import_tokens_core = require("@x-plat/tokens-core");
|
|
|
7233
7196
|
var import_tokens_core2 = require("@x-plat/tokens-core");
|
|
7234
7197
|
|
|
7235
7198
|
// src/components/CheckBox/CheckBox.tsx
|
|
7236
|
-
var
|
|
7199
|
+
var import_jsx_runtime307 = require("react/jsx-runtime");
|
|
7237
7200
|
var CheckBox = (props) => {
|
|
7238
7201
|
const {
|
|
7239
7202
|
checked,
|
|
@@ -7251,8 +7214,8 @@ var CheckBox = (props) => {
|
|
|
7251
7214
|
const checkedClasses = `checked`;
|
|
7252
7215
|
const disabledClasses = "disabled";
|
|
7253
7216
|
const boxClasses = disabled ? disabledClasses : checked ? checkedClasses : uncheckedClasses;
|
|
7254
|
-
return /* @__PURE__ */ (0,
|
|
7255
|
-
/* @__PURE__ */ (0,
|
|
7217
|
+
return /* @__PURE__ */ (0, import_jsx_runtime307.jsxs)("label", { className: clsx_default("lib-xplat-checkbox", size, type), children: [
|
|
7218
|
+
/* @__PURE__ */ (0, import_jsx_runtime307.jsx)(
|
|
7256
7219
|
"input",
|
|
7257
7220
|
{
|
|
7258
7221
|
type: "checkbox",
|
|
@@ -7262,44 +7225,44 @@ var CheckBox = (props) => {
|
|
|
7262
7225
|
...rest
|
|
7263
7226
|
}
|
|
7264
7227
|
),
|
|
7265
|
-
/* @__PURE__ */ (0,
|
|
7266
|
-
label && /* @__PURE__ */ (0,
|
|
7228
|
+
/* @__PURE__ */ (0, import_jsx_runtime307.jsx)("span", { className: clsx_default("checkbox", boxClasses), children: /* @__PURE__ */ (0, import_jsx_runtime307.jsx)("span", { className: clsx_default("check-icon", { visible: checked }), children: /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(CheckIcon_default, {}) }) }),
|
|
7229
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime307.jsx)("span", { className: "label", children: label })
|
|
7267
7230
|
] });
|
|
7268
7231
|
};
|
|
7269
7232
|
CheckBox.displayName = "CheckBox";
|
|
7270
7233
|
var CheckBox_default = CheckBox;
|
|
7271
7234
|
|
|
7272
7235
|
// src/components/Chip/Chip.tsx
|
|
7273
|
-
var
|
|
7236
|
+
var import_jsx_runtime308 = require("react/jsx-runtime");
|
|
7274
7237
|
var Chip = (props) => {
|
|
7275
7238
|
const {
|
|
7276
7239
|
children,
|
|
7277
7240
|
type = "primary",
|
|
7278
7241
|
size = "md"
|
|
7279
7242
|
} = props;
|
|
7280
|
-
return /* @__PURE__ */ (0,
|
|
7243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime308.jsx)("div", { className: clsx_default("lib-xplat-chip", type, size), children });
|
|
7281
7244
|
};
|
|
7282
7245
|
Chip.displayName = "Chip";
|
|
7283
7246
|
var Chip_default = Chip;
|
|
7284
7247
|
|
|
7285
7248
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
7286
|
-
var
|
|
7249
|
+
var import_react13 = __toESM(require("react"), 1);
|
|
7287
7250
|
|
|
7288
7251
|
// src/components/Input/Input.tsx
|
|
7289
|
-
var
|
|
7252
|
+
var import_react7 = __toESM(require("react"), 1);
|
|
7290
7253
|
|
|
7291
7254
|
// src/components/Input/InputValidations.tsx
|
|
7292
|
-
var
|
|
7255
|
+
var import_jsx_runtime309 = require("react/jsx-runtime");
|
|
7293
7256
|
var InputValidations = (props) => {
|
|
7294
7257
|
const { message, status = "default" } = props;
|
|
7295
|
-
return /* @__PURE__ */ (0,
|
|
7296
|
-
/* @__PURE__ */ (0,
|
|
7297
|
-
status === "default" && /* @__PURE__ */ (0,
|
|
7298
|
-
status === "success" && /* @__PURE__ */ (0,
|
|
7299
|
-
status === "warning" && /* @__PURE__ */ (0,
|
|
7300
|
-
status === "error" && /* @__PURE__ */ (0,
|
|
7258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime309.jsxs)("div", { className: clsx_default("lib-xplat-input-validation", status), children: [
|
|
7259
|
+
/* @__PURE__ */ (0, import_jsx_runtime309.jsxs)("div", { className: "icon", children: [
|
|
7260
|
+
status === "default" && /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(InfoIcon_default, {}),
|
|
7261
|
+
status === "success" && /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(SuccessIcon_default, {}),
|
|
7262
|
+
status === "warning" && /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(InfoIcon_default, {}),
|
|
7263
|
+
status === "error" && /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(ErrorIcon_default, {})
|
|
7301
7264
|
] }),
|
|
7302
|
-
/* @__PURE__ */ (0,
|
|
7265
|
+
/* @__PURE__ */ (0, import_jsx_runtime309.jsx)("div", { className: "message", children: message })
|
|
7303
7266
|
] });
|
|
7304
7267
|
};
|
|
7305
7268
|
InputValidations.displayName = "InputValidations";
|
|
@@ -7340,8 +7303,8 @@ var handleTelBackspace = (prevValue, currValue) => {
|
|
|
7340
7303
|
};
|
|
7341
7304
|
|
|
7342
7305
|
// src/components/Input/Input.tsx
|
|
7343
|
-
var
|
|
7344
|
-
var
|
|
7306
|
+
var import_jsx_runtime310 = require("react/jsx-runtime");
|
|
7307
|
+
var import_react8 = require("react");
|
|
7345
7308
|
var formatValue = (type, value) => {
|
|
7346
7309
|
if (value === null || value === void 0) return "";
|
|
7347
7310
|
const strValue = Array.isArray(value) ? String(value[0] ?? "") : String(value);
|
|
@@ -7389,7 +7352,7 @@ var parseValue = (type, value) => {
|
|
|
7389
7352
|
return value;
|
|
7390
7353
|
}
|
|
7391
7354
|
};
|
|
7392
|
-
var Input =
|
|
7355
|
+
var Input = import_react7.default.forwardRef((props, ref) => {
|
|
7393
7356
|
const {
|
|
7394
7357
|
value,
|
|
7395
7358
|
onChange,
|
|
@@ -7415,13 +7378,13 @@ var Input = import_react8.default.forwardRef((props, ref) => {
|
|
|
7415
7378
|
onChange(event);
|
|
7416
7379
|
}
|
|
7417
7380
|
};
|
|
7418
|
-
return /* @__PURE__ */ (0,
|
|
7419
|
-
/* @__PURE__ */ (0,
|
|
7381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime310.jsxs)("div", { className: "lib-xplat-input-wrap", children: [
|
|
7382
|
+
/* @__PURE__ */ (0, import_jsx_runtime310.jsxs)(
|
|
7420
7383
|
"div",
|
|
7421
7384
|
{
|
|
7422
7385
|
className: clsx_default("lib-xplat-input", size, disabled ? "disabled" : void 0),
|
|
7423
7386
|
children: [
|
|
7424
|
-
/* @__PURE__ */ (0,
|
|
7387
|
+
/* @__PURE__ */ (0, import_jsx_runtime310.jsx)(
|
|
7425
7388
|
"input",
|
|
7426
7389
|
{
|
|
7427
7390
|
...inputProps,
|
|
@@ -7432,11 +7395,11 @@ var Input = import_react8.default.forwardRef((props, ref) => {
|
|
|
7432
7395
|
onChange: handleChange
|
|
7433
7396
|
}
|
|
7434
7397
|
),
|
|
7435
|
-
suffix && /* @__PURE__ */ (0,
|
|
7398
|
+
suffix && /* @__PURE__ */ (0, import_jsx_runtime310.jsx)("div", { className: "suffix", children: suffix })
|
|
7436
7399
|
]
|
|
7437
7400
|
}
|
|
7438
7401
|
),
|
|
7439
|
-
validations && /* @__PURE__ */ (0,
|
|
7402
|
+
validations && /* @__PURE__ */ (0, import_jsx_runtime310.jsx)("div", { className: "lib-xplat-input-validation-wrap", children: validations?.map((validation, idx) => /* @__PURE__ */ (0, import_react8.createElement)(
|
|
7440
7403
|
InputValidations_default,
|
|
7441
7404
|
{
|
|
7442
7405
|
...validation,
|
|
@@ -7449,20 +7412,20 @@ Input.displayName = "Input";
|
|
|
7449
7412
|
var Input_default = Input;
|
|
7450
7413
|
|
|
7451
7414
|
// src/components/Input/PasswordInput/PasswordInput.tsx
|
|
7452
|
-
var
|
|
7453
|
-
var
|
|
7454
|
-
var PasswordInput =
|
|
7415
|
+
var import_react9 = __toESM(require("react"), 1);
|
|
7416
|
+
var import_jsx_runtime311 = require("react/jsx-runtime");
|
|
7417
|
+
var PasswordInput = import_react9.default.forwardRef(
|
|
7455
7418
|
(props, ref) => {
|
|
7456
7419
|
const { reg: _reg, ...inputProps } = props;
|
|
7457
|
-
const [isView, setIsView] =
|
|
7420
|
+
const [isView, setIsView] = import_react9.default.useState(false);
|
|
7458
7421
|
const handleChangeView = () => {
|
|
7459
7422
|
setIsView((prev) => !prev);
|
|
7460
7423
|
};
|
|
7461
|
-
return /* @__PURE__ */ (0,
|
|
7424
|
+
return /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
|
|
7462
7425
|
Input_default,
|
|
7463
7426
|
{
|
|
7464
7427
|
...inputProps,
|
|
7465
|
-
suffix: /* @__PURE__ */ (0,
|
|
7428
|
+
suffix: /* @__PURE__ */ (0, import_jsx_runtime311.jsx)("div", { className: "wrapper pointer", onClick: handleChangeView, children: isView ? /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(OpenEyeIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(CloseEyeIcon_default, {}) }),
|
|
7466
7429
|
type: isView ? "text" : "password",
|
|
7467
7430
|
ref
|
|
7468
7431
|
}
|
|
@@ -7473,17 +7436,17 @@ PasswordInput.displayName = "PasswordInput";
|
|
|
7473
7436
|
var PasswordInput_default = PasswordInput;
|
|
7474
7437
|
|
|
7475
7438
|
// src/components/Modal/Modal.tsx
|
|
7476
|
-
var
|
|
7439
|
+
var import_react11 = __toESM(require("react"), 1);
|
|
7477
7440
|
var import_react_dom2 = require("react-dom");
|
|
7478
7441
|
|
|
7479
7442
|
// src/tokens/hooks/Portal.tsx
|
|
7480
|
-
var
|
|
7443
|
+
var import_react10 = __toESM(require("react"), 1);
|
|
7481
7444
|
var import_react_dom = __toESM(require("react-dom"), 1);
|
|
7482
|
-
var
|
|
7483
|
-
var PortalContainerContext =
|
|
7484
|
-
var PortalProvider = ({ container, children }) => /* @__PURE__ */ (0,
|
|
7445
|
+
var import_jsx_runtime312 = require("react/jsx-runtime");
|
|
7446
|
+
var PortalContainerContext = import_react10.default.createContext(null);
|
|
7447
|
+
var PortalProvider = ({ container, children }) => /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(PortalContainerContext.Provider, { value: container, children });
|
|
7485
7448
|
var Portal = ({ children }) => {
|
|
7486
|
-
const contextContainer =
|
|
7449
|
+
const contextContainer = import_react10.default.useContext(PortalContainerContext);
|
|
7487
7450
|
if (typeof document === "undefined") return null;
|
|
7488
7451
|
const container = contextContainer ?? document.body;
|
|
7489
7452
|
return import_react_dom.default.createPortal(children, container);
|
|
@@ -7492,14 +7455,14 @@ Portal.displayName = "Portal";
|
|
|
7492
7455
|
var Portal_default = Portal;
|
|
7493
7456
|
|
|
7494
7457
|
// src/components/Modal/Modal.tsx
|
|
7495
|
-
var
|
|
7458
|
+
var import_jsx_runtime313 = require("react/jsx-runtime");
|
|
7496
7459
|
var ANIMATION_DURATION_MS = 200;
|
|
7497
7460
|
var Modal = (props) => {
|
|
7498
7461
|
const { isOpen, onClose, children } = props;
|
|
7499
|
-
const [mounted, setMounted] =
|
|
7500
|
-
const [visible, setVisible] =
|
|
7501
|
-
const boxRef =
|
|
7502
|
-
|
|
7462
|
+
const [mounted, setMounted] = import_react11.default.useState(false);
|
|
7463
|
+
const [visible, setVisible] = import_react11.default.useState(false);
|
|
7464
|
+
const boxRef = import_react11.default.useRef(null);
|
|
7465
|
+
import_react11.default.useEffect(() => {
|
|
7503
7466
|
if (isOpen) {
|
|
7504
7467
|
setMounted(true);
|
|
7505
7468
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -7513,12 +7476,12 @@ var Modal = (props) => {
|
|
|
7513
7476
|
if (!mounted) return null;
|
|
7514
7477
|
const stateClass = visible ? "enter" : "exit";
|
|
7515
7478
|
return (0, import_react_dom2.createPortal)(
|
|
7516
|
-
/* @__PURE__ */ (0,
|
|
7479
|
+
/* @__PURE__ */ (0, import_jsx_runtime313.jsx)(
|
|
7517
7480
|
"div",
|
|
7518
7481
|
{
|
|
7519
7482
|
className: clsx_default("lib-xplat-modal", "dim", stateClass),
|
|
7520
7483
|
onClick: onClose,
|
|
7521
|
-
children: /* @__PURE__ */ (0,
|
|
7484
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(
|
|
7522
7485
|
"div",
|
|
7523
7486
|
{
|
|
7524
7487
|
ref: boxRef,
|
|
@@ -7526,7 +7489,7 @@ var Modal = (props) => {
|
|
|
7526
7489
|
role: "dialog",
|
|
7527
7490
|
"aria-modal": "true",
|
|
7528
7491
|
onClick: (e) => e.stopPropagation(),
|
|
7529
|
-
children: /* @__PURE__ */ (0,
|
|
7492
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(PortalProvider, { container: boxRef.current, children })
|
|
7530
7493
|
}
|
|
7531
7494
|
)
|
|
7532
7495
|
}
|
|
@@ -7538,9 +7501,9 @@ Modal.displayName = "Modal";
|
|
|
7538
7501
|
var Modal_default = Modal;
|
|
7539
7502
|
|
|
7540
7503
|
// src/components/DatePicker/SingleDatePicker/index.tsx
|
|
7541
|
-
var
|
|
7542
|
-
var
|
|
7543
|
-
var DayCell2 =
|
|
7504
|
+
var import_react12 = __toESM(require("react"), 1);
|
|
7505
|
+
var import_jsx_runtime314 = require("react/jsx-runtime");
|
|
7506
|
+
var DayCell2 = import_react12.default.memo(
|
|
7544
7507
|
({
|
|
7545
7508
|
day,
|
|
7546
7509
|
disabled,
|
|
@@ -7550,7 +7513,7 @@ var DayCell2 = import_react13.default.memo(
|
|
|
7550
7513
|
isEnd,
|
|
7551
7514
|
inRange,
|
|
7552
7515
|
onSelect
|
|
7553
|
-
}) => /* @__PURE__ */ (0,
|
|
7516
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
7554
7517
|
"button",
|
|
7555
7518
|
{
|
|
7556
7519
|
type: "button",
|
|
@@ -7592,26 +7555,26 @@ var SingleDatePicker = (props) => {
|
|
|
7592
7555
|
initialYear,
|
|
7593
7556
|
initialMonth
|
|
7594
7557
|
);
|
|
7595
|
-
const [pickerMode, setPickerMode] =
|
|
7596
|
-
const [yearRangeStart, setYearRangeStart] =
|
|
7558
|
+
const [pickerMode, setPickerMode] = import_react12.default.useState("days");
|
|
7559
|
+
const [yearRangeStart, setYearRangeStart] = import_react12.default.useState(
|
|
7597
7560
|
Math.floor((initialYear ?? (/* @__PURE__ */ new Date()).getFullYear()) / 12) * 12
|
|
7598
7561
|
);
|
|
7599
|
-
const minTime =
|
|
7562
|
+
const minTime = import_react12.default.useMemo(
|
|
7600
7563
|
() => minDate ? new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()).getTime() : -Infinity,
|
|
7601
7564
|
[minDate]
|
|
7602
7565
|
);
|
|
7603
|
-
const maxTime =
|
|
7566
|
+
const maxTime = import_react12.default.useMemo(
|
|
7604
7567
|
() => maxDate ? new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()).getTime() : Infinity,
|
|
7605
7568
|
[maxDate]
|
|
7606
7569
|
);
|
|
7607
|
-
const highlightSet =
|
|
7570
|
+
const highlightSet = import_react12.default.useMemo(() => {
|
|
7608
7571
|
const set = /* @__PURE__ */ new Set();
|
|
7609
7572
|
for (const h of highlightDates) {
|
|
7610
7573
|
set.add(`${h.getFullYear()}-${h.getMonth()}-${h.getDate()}`);
|
|
7611
7574
|
}
|
|
7612
7575
|
return set;
|
|
7613
7576
|
}, [highlightDates]);
|
|
7614
|
-
const handleSelect =
|
|
7577
|
+
const handleSelect = import_react12.default.useCallback(
|
|
7615
7578
|
(date) => {
|
|
7616
7579
|
onChange?.(date);
|
|
7617
7580
|
},
|
|
@@ -7648,20 +7611,20 @@ var SingleDatePicker = (props) => {
|
|
|
7648
7611
|
const monthLabels = MONTH_LABELS[locale];
|
|
7649
7612
|
const titleText = pickerMode === "days" ? locale === "ko" ? `${year}\uB144 ${monthLabels[month]}` : `${monthLabels[month]} ${year}` : pickerMode === "months" ? `${year}` : `${yearRangeStart} - ${yearRangeStart + 11}`;
|
|
7650
7613
|
const hasRange = rangeStart != null && rangeEnd != null;
|
|
7651
|
-
return /* @__PURE__ */ (0,
|
|
7614
|
+
return /* @__PURE__ */ (0, import_jsx_runtime314.jsxs)(
|
|
7652
7615
|
"div",
|
|
7653
7616
|
{
|
|
7654
7617
|
className: clsx_default("lib-xplat-datepicker", "single"),
|
|
7655
7618
|
children: [
|
|
7656
|
-
/* @__PURE__ */ (0,
|
|
7657
|
-
/* @__PURE__ */ (0,
|
|
7658
|
-
/* @__PURE__ */ (0,
|
|
7659
|
-
/* @__PURE__ */ (0,
|
|
7619
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsxs)("div", { className: "datepicker-header", children: [
|
|
7620
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)("button", { className: "datepicker-nav", onClick: handlePrev, type: "button", children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(ChevronLeftIcon_default, {}) }),
|
|
7621
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)("button", { className: "datepicker-title", onClick: handleTitleClick, type: "button", children: titleText }),
|
|
7622
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)("button", { className: "datepicker-nav", onClick: handleNext, type: "button", children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(ChevronRightIcon_default, {}) })
|
|
7660
7623
|
] }),
|
|
7661
|
-
/* @__PURE__ */ (0,
|
|
7662
|
-
pickerMode === "years" && /* @__PURE__ */ (0,
|
|
7624
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsxs)("div", { className: "datepicker-body", children: [
|
|
7625
|
+
pickerMode === "years" && /* @__PURE__ */ (0, import_jsx_runtime314.jsx)("div", { className: "datepicker-picker-grid", children: Array.from({ length: 12 }, (_, i) => {
|
|
7663
7626
|
const y = yearRangeStart + i;
|
|
7664
|
-
return /* @__PURE__ */ (0,
|
|
7627
|
+
return /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
7665
7628
|
"button",
|
|
7666
7629
|
{
|
|
7667
7630
|
type: "button",
|
|
@@ -7672,7 +7635,7 @@ var SingleDatePicker = (props) => {
|
|
|
7672
7635
|
y
|
|
7673
7636
|
);
|
|
7674
7637
|
}) }),
|
|
7675
|
-
pickerMode === "months" && /* @__PURE__ */ (0,
|
|
7638
|
+
pickerMode === "months" && /* @__PURE__ */ (0, import_jsx_runtime314.jsx)("div", { className: "datepicker-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
7676
7639
|
"button",
|
|
7677
7640
|
{
|
|
7678
7641
|
type: "button",
|
|
@@ -7682,8 +7645,8 @@ var SingleDatePicker = (props) => {
|
|
|
7682
7645
|
},
|
|
7683
7646
|
i
|
|
7684
7647
|
)) }),
|
|
7685
|
-
pickerMode === "days" && /* @__PURE__ */ (0,
|
|
7686
|
-
/* @__PURE__ */ (0,
|
|
7648
|
+
pickerMode === "days" && /* @__PURE__ */ (0, import_jsx_runtime314.jsxs)(import_jsx_runtime314.Fragment, { children: [
|
|
7649
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)("div", { className: "datepicker-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
7687
7650
|
"div",
|
|
7688
7651
|
{
|
|
7689
7652
|
className: clsx_default(
|
|
@@ -7695,7 +7658,7 @@ var SingleDatePicker = (props) => {
|
|
|
7695
7658
|
},
|
|
7696
7659
|
label
|
|
7697
7660
|
)) }),
|
|
7698
|
-
/* @__PURE__ */ (0,
|
|
7661
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)("div", { className: "datepicker-grid", children: days.map((day, idx) => {
|
|
7699
7662
|
const t = day.date.getTime();
|
|
7700
7663
|
const disabled = t < minTime || t > maxTime;
|
|
7701
7664
|
const selected = value ? isSameDay(day.date, value) : false;
|
|
@@ -7705,7 +7668,7 @@ var SingleDatePicker = (props) => {
|
|
|
7705
7668
|
const isStart = hasRange ? isSameDay(day.date, rangeStart) : false;
|
|
7706
7669
|
const isEnd = hasRange ? isSameDay(day.date, rangeEnd) : false;
|
|
7707
7670
|
const inRangeVal = hasRange ? isInRange(day.date, rangeStart, rangeEnd) : false;
|
|
7708
|
-
return /* @__PURE__ */ (0,
|
|
7671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
7709
7672
|
DayCell2,
|
|
7710
7673
|
{
|
|
7711
7674
|
day,
|
|
@@ -7730,7 +7693,7 @@ SingleDatePicker.displayName = "SingleDatePicker";
|
|
|
7730
7693
|
var SingleDatePicker_default = SingleDatePicker;
|
|
7731
7694
|
|
|
7732
7695
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
7733
|
-
var
|
|
7696
|
+
var import_jsx_runtime315 = require("react/jsx-runtime");
|
|
7734
7697
|
var formatDate = (date) => {
|
|
7735
7698
|
if (!date || !(date instanceof Date) || isNaN(date.getTime())) return "";
|
|
7736
7699
|
const y = date.getFullYear();
|
|
@@ -7740,8 +7703,8 @@ var formatDate = (date) => {
|
|
|
7740
7703
|
};
|
|
7741
7704
|
var InputDatePicker = (props) => {
|
|
7742
7705
|
const { value, onChange, minDate, maxDate, disabled, locale = "ko", placeholder } = props;
|
|
7743
|
-
const [isOpen, setIsOpen] =
|
|
7744
|
-
const [tempDate, setTempDate] =
|
|
7706
|
+
const [isOpen, setIsOpen] = import_react13.default.useState(false);
|
|
7707
|
+
const [tempDate, setTempDate] = import_react13.default.useState(value ?? /* @__PURE__ */ new Date());
|
|
7745
7708
|
const handleOpen = () => {
|
|
7746
7709
|
if (disabled) return;
|
|
7747
7710
|
setTempDate(value ?? /* @__PURE__ */ new Date());
|
|
@@ -7757,19 +7720,19 @@ var InputDatePicker = (props) => {
|
|
|
7757
7720
|
const handleClose = () => {
|
|
7758
7721
|
setIsOpen(false);
|
|
7759
7722
|
};
|
|
7760
|
-
return /* @__PURE__ */ (0,
|
|
7761
|
-
/* @__PURE__ */ (0,
|
|
7723
|
+
return /* @__PURE__ */ (0, import_jsx_runtime315.jsxs)("div", { className: clsx_default("lib-xplat-datepicker input-datepicker", disabled && "disabled"), children: [
|
|
7724
|
+
/* @__PURE__ */ (0, import_jsx_runtime315.jsx)("div", { className: "input-datepicker-trigger", onClick: handleOpen, children: /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(
|
|
7762
7725
|
Input_default,
|
|
7763
7726
|
{
|
|
7764
7727
|
value: formatDate(value),
|
|
7765
7728
|
placeholder,
|
|
7766
|
-
suffix: /* @__PURE__ */ (0,
|
|
7729
|
+
suffix: /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(CalenderIcon_default, {}),
|
|
7767
7730
|
disabled,
|
|
7768
7731
|
readOnly: true
|
|
7769
7732
|
}
|
|
7770
7733
|
) }),
|
|
7771
|
-
/* @__PURE__ */ (0,
|
|
7772
|
-
/* @__PURE__ */ (0,
|
|
7734
|
+
/* @__PURE__ */ (0, import_jsx_runtime315.jsx)(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ (0, import_jsx_runtime315.jsxs)("div", { className: "lib-xplat-popup-datepicker-card", children: [
|
|
7735
|
+
/* @__PURE__ */ (0, import_jsx_runtime315.jsx)("div", { className: "popup-datepicker-content", children: /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(
|
|
7773
7736
|
SingleDatePicker_default,
|
|
7774
7737
|
{
|
|
7775
7738
|
value: tempDate,
|
|
@@ -7779,9 +7742,9 @@ var InputDatePicker = (props) => {
|
|
|
7779
7742
|
locale
|
|
7780
7743
|
}
|
|
7781
7744
|
) }),
|
|
7782
|
-
/* @__PURE__ */ (0,
|
|
7783
|
-
/* @__PURE__ */ (0,
|
|
7784
|
-
/* @__PURE__ */ (0,
|
|
7745
|
+
/* @__PURE__ */ (0, import_jsx_runtime315.jsxs)("div", { className: "popup-datepicker-footer", children: [
|
|
7746
|
+
/* @__PURE__ */ (0, import_jsx_runtime315.jsx)(Button_default, { type: "secondary", onClick: handleClose, children: locale === "ko" ? "\uCDE8\uC18C" : "Cancel" }),
|
|
7747
|
+
/* @__PURE__ */ (0, import_jsx_runtime315.jsx)(Button_default, { type: "primary", onClick: handleApply, children: locale === "ko" ? "\uC801\uC6A9" : "Apply" })
|
|
7785
7748
|
] })
|
|
7786
7749
|
] }) })
|
|
7787
7750
|
] });
|
|
@@ -7790,20 +7753,20 @@ InputDatePicker.displayName = "InputDatePicker";
|
|
|
7790
7753
|
var InputDatePicker_default = InputDatePicker;
|
|
7791
7754
|
|
|
7792
7755
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
7793
|
-
var
|
|
7756
|
+
var import_react17 = __toESM(require("react"), 1);
|
|
7794
7757
|
|
|
7795
7758
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
7796
|
-
var
|
|
7759
|
+
var import_react16 = __toESM(require("react"), 1);
|
|
7797
7760
|
|
|
7798
7761
|
// src/components/Tab/Tab.tsx
|
|
7799
|
-
var
|
|
7762
|
+
var import_react15 = __toESM(require("react"), 1);
|
|
7800
7763
|
|
|
7801
7764
|
// src/components/Tab/TabItem.tsx
|
|
7802
|
-
var
|
|
7803
|
-
var
|
|
7804
|
-
var TabItem =
|
|
7765
|
+
var import_react14 = __toESM(require("react"), 1);
|
|
7766
|
+
var import_jsx_runtime316 = require("react/jsx-runtime");
|
|
7767
|
+
var TabItem = import_react14.default.forwardRef((props, ref) => {
|
|
7805
7768
|
const { isActive, title, onClick } = props;
|
|
7806
|
-
return /* @__PURE__ */ (0,
|
|
7769
|
+
return /* @__PURE__ */ (0, import_jsx_runtime316.jsx)(
|
|
7807
7770
|
"div",
|
|
7808
7771
|
{
|
|
7809
7772
|
ref,
|
|
@@ -7817,25 +7780,25 @@ TabItem.displayName = "TabItem";
|
|
|
7817
7780
|
var TabItem_default = TabItem;
|
|
7818
7781
|
|
|
7819
7782
|
// src/components/Tab/Tab.tsx
|
|
7820
|
-
var
|
|
7783
|
+
var import_jsx_runtime317 = require("react/jsx-runtime");
|
|
7821
7784
|
var Tab = (props) => {
|
|
7822
7785
|
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
7823
|
-
const [underlineStyle, setUnderlineStyle] =
|
|
7786
|
+
const [underlineStyle, setUnderlineStyle] = import_react15.default.useState({
|
|
7824
7787
|
left: 0,
|
|
7825
7788
|
width: 0
|
|
7826
7789
|
});
|
|
7827
|
-
const itemRefs =
|
|
7790
|
+
const itemRefs = import_react15.default.useRef([]);
|
|
7828
7791
|
const handleChangeActiveTab = (tabItem, tabIdx) => {
|
|
7829
7792
|
onChange(tabItem, tabIdx);
|
|
7830
7793
|
};
|
|
7831
|
-
|
|
7794
|
+
import_react15.default.useEffect(() => {
|
|
7832
7795
|
const el = itemRefs.current[activeIndex];
|
|
7833
7796
|
if (el) {
|
|
7834
7797
|
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
7835
7798
|
}
|
|
7836
7799
|
}, [activeIndex, tabs.length]);
|
|
7837
|
-
return /* @__PURE__ */ (0,
|
|
7838
|
-
tabs.map((tab, idx) => /* @__PURE__ */ (0,
|
|
7800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime317.jsxs)("div", { className: clsx_default("lib-xplat-tab", `type-${type}`, size), children: [
|
|
7801
|
+
tabs.map((tab, idx) => /* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
|
|
7839
7802
|
TabItem_default,
|
|
7840
7803
|
{
|
|
7841
7804
|
onClick: () => handleChangeActiveTab(tab, idx),
|
|
@@ -7847,7 +7810,7 @@ var Tab = (props) => {
|
|
|
7847
7810
|
},
|
|
7848
7811
|
`${tab.value}_${idx}`
|
|
7849
7812
|
)),
|
|
7850
|
-
type === "toggle" && /* @__PURE__ */ (0,
|
|
7813
|
+
type === "toggle" && /* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
|
|
7851
7814
|
"div",
|
|
7852
7815
|
{
|
|
7853
7816
|
className: "tab-toggle-underline",
|
|
@@ -7863,7 +7826,7 @@ Tab.displayName = "Tab";
|
|
|
7863
7826
|
var Tab_default = Tab;
|
|
7864
7827
|
|
|
7865
7828
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
7866
|
-
var
|
|
7829
|
+
var import_jsx_runtime318 = require("react/jsx-runtime");
|
|
7867
7830
|
var RangePicker = (props) => {
|
|
7868
7831
|
const {
|
|
7869
7832
|
startDate,
|
|
@@ -7873,7 +7836,7 @@ var RangePicker = (props) => {
|
|
|
7873
7836
|
maxDate,
|
|
7874
7837
|
locale = "ko"
|
|
7875
7838
|
} = props;
|
|
7876
|
-
const [activeTab, setActiveTab] =
|
|
7839
|
+
const [activeTab, setActiveTab] = import_react16.default.useState("start");
|
|
7877
7840
|
const handleStartChange = (date) => {
|
|
7878
7841
|
if (!date) return;
|
|
7879
7842
|
const newStart = date > endDate ? endDate : date;
|
|
@@ -7886,8 +7849,8 @@ var RangePicker = (props) => {
|
|
|
7886
7849
|
};
|
|
7887
7850
|
const startMaxDate = maxDate && endDate < maxDate ? endDate : endDate;
|
|
7888
7851
|
const endMinDate = minDate && startDate > minDate ? startDate : startDate;
|
|
7889
|
-
return /* @__PURE__ */ (0,
|
|
7890
|
-
/* @__PURE__ */ (0,
|
|
7852
|
+
return /* @__PURE__ */ (0, import_jsx_runtime318.jsxs)("div", { className: clsx_default("lib-xplat-datepicker", "range"), children: [
|
|
7853
|
+
/* @__PURE__ */ (0, import_jsx_runtime318.jsx)("div", { className: "datepicker-range-tabs", children: /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
|
|
7891
7854
|
Tab_default,
|
|
7892
7855
|
{
|
|
7893
7856
|
activeIndex: activeTab === "start" ? 0 : 1,
|
|
@@ -7900,8 +7863,8 @@ var RangePicker = (props) => {
|
|
|
7900
7863
|
size: "sm"
|
|
7901
7864
|
}
|
|
7902
7865
|
) }),
|
|
7903
|
-
/* @__PURE__ */ (0,
|
|
7904
|
-
/* @__PURE__ */ (0,
|
|
7866
|
+
/* @__PURE__ */ (0, import_jsx_runtime318.jsxs)("div", { className: "datepicker-range-panels", children: [
|
|
7867
|
+
/* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
|
|
7905
7868
|
SingleDatePicker_default,
|
|
7906
7869
|
{
|
|
7907
7870
|
value: startDate,
|
|
@@ -7913,7 +7876,7 @@ var RangePicker = (props) => {
|
|
|
7913
7876
|
locale
|
|
7914
7877
|
}
|
|
7915
7878
|
),
|
|
7916
|
-
/* @__PURE__ */ (0,
|
|
7879
|
+
/* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
|
|
7917
7880
|
SingleDatePicker_default,
|
|
7918
7881
|
{
|
|
7919
7882
|
value: endDate,
|
|
@@ -7926,7 +7889,7 @@ var RangePicker = (props) => {
|
|
|
7926
7889
|
}
|
|
7927
7890
|
)
|
|
7928
7891
|
] }),
|
|
7929
|
-
/* @__PURE__ */ (0,
|
|
7892
|
+
/* @__PURE__ */ (0, import_jsx_runtime318.jsx)("div", { className: "datepicker-range-mobile", children: activeTab === "start" ? /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
|
|
7930
7893
|
SingleDatePicker_default,
|
|
7931
7894
|
{
|
|
7932
7895
|
value: startDate,
|
|
@@ -7937,7 +7900,7 @@ var RangePicker = (props) => {
|
|
|
7937
7900
|
rangeEnd: endDate,
|
|
7938
7901
|
locale
|
|
7939
7902
|
}
|
|
7940
|
-
) : /* @__PURE__ */ (0,
|
|
7903
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
|
|
7941
7904
|
SingleDatePicker_default,
|
|
7942
7905
|
{
|
|
7943
7906
|
value: endDate,
|
|
@@ -7955,10 +7918,10 @@ RangePicker.displayName = "RangePicker";
|
|
|
7955
7918
|
var RangePicker_default = RangePicker;
|
|
7956
7919
|
|
|
7957
7920
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
7958
|
-
var
|
|
7921
|
+
var import_jsx_runtime319 = require("react/jsx-runtime");
|
|
7959
7922
|
var PopupPicker = (props) => {
|
|
7960
7923
|
const { component, type, locale } = props;
|
|
7961
|
-
const [isOpen, setIsOpen] =
|
|
7924
|
+
const [isOpen, setIsOpen] = import_react17.default.useState(false);
|
|
7962
7925
|
const handleClick = () => setIsOpen(true);
|
|
7963
7926
|
const handleClose = () => setIsOpen(false);
|
|
7964
7927
|
const handleSingleChange = (date) => {
|
|
@@ -7966,11 +7929,11 @@ var PopupPicker = (props) => {
|
|
|
7966
7929
|
props.onChange?.(date);
|
|
7967
7930
|
handleClose();
|
|
7968
7931
|
};
|
|
7969
|
-
return /* @__PURE__ */ (0,
|
|
7970
|
-
|
|
7971
|
-
/* @__PURE__ */ (0,
|
|
7972
|
-
/* @__PURE__ */ (0,
|
|
7973
|
-
type === "single" && /* @__PURE__ */ (0,
|
|
7932
|
+
return /* @__PURE__ */ (0, import_jsx_runtime319.jsxs)("div", { className: "lib-xplat-popup-datepicker", children: [
|
|
7933
|
+
import_react17.default.cloneElement(component, { onClick: handleClick }),
|
|
7934
|
+
/* @__PURE__ */ (0, import_jsx_runtime319.jsx)(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ (0, import_jsx_runtime319.jsxs)("div", { className: clsx_default("lib-xplat-popup-datepicker-card", type === "range" && "range-mode"), children: [
|
|
7935
|
+
/* @__PURE__ */ (0, import_jsx_runtime319.jsxs)("div", { className: "popup-datepicker-content", children: [
|
|
7936
|
+
type === "single" && /* @__PURE__ */ (0, import_jsx_runtime319.jsx)(
|
|
7974
7937
|
SingleDatePicker_default,
|
|
7975
7938
|
{
|
|
7976
7939
|
value: props.value,
|
|
@@ -7980,7 +7943,7 @@ var PopupPicker = (props) => {
|
|
|
7980
7943
|
locale
|
|
7981
7944
|
}
|
|
7982
7945
|
),
|
|
7983
|
-
type === "range" && /* @__PURE__ */ (0,
|
|
7946
|
+
type === "range" && /* @__PURE__ */ (0, import_jsx_runtime319.jsx)(
|
|
7984
7947
|
RangePicker_default,
|
|
7985
7948
|
{
|
|
7986
7949
|
startDate: props.startDate,
|
|
@@ -7992,8 +7955,8 @@ var PopupPicker = (props) => {
|
|
|
7992
7955
|
}
|
|
7993
7956
|
)
|
|
7994
7957
|
] }),
|
|
7995
|
-
/* @__PURE__ */ (0,
|
|
7996
|
-
/* @__PURE__ */ (0,
|
|
7958
|
+
/* @__PURE__ */ (0, import_jsx_runtime319.jsxs)("div", { className: "popup-datepicker-footer", children: [
|
|
7959
|
+
/* @__PURE__ */ (0, import_jsx_runtime319.jsx)(
|
|
7997
7960
|
Button_default,
|
|
7998
7961
|
{
|
|
7999
7962
|
type: "secondary",
|
|
@@ -8001,7 +7964,7 @@ var PopupPicker = (props) => {
|
|
|
8001
7964
|
children: locale === "ko" ? "\uCDE8\uC18C" : "Cancel"
|
|
8002
7965
|
}
|
|
8003
7966
|
),
|
|
8004
|
-
/* @__PURE__ */ (0,
|
|
7967
|
+
/* @__PURE__ */ (0, import_jsx_runtime319.jsx)(Button_default, { type: "primary", onClick: handleClose, children: locale === "ko" ? "\uC801\uC6A9" : "Apply" })
|
|
8005
7968
|
] })
|
|
8006
7969
|
] }) })
|
|
8007
7970
|
] });
|
|
@@ -8010,10 +7973,10 @@ PopupPicker.displayName = "PopupPicker";
|
|
|
8010
7973
|
var PopupPicker_default = PopupPicker;
|
|
8011
7974
|
|
|
8012
7975
|
// src/components/Divider/Divider.tsx
|
|
8013
|
-
var
|
|
7976
|
+
var import_jsx_runtime320 = require("react/jsx-runtime");
|
|
8014
7977
|
var Divider = (props) => {
|
|
8015
7978
|
const { orientation = "horizontal" } = props;
|
|
8016
|
-
return /* @__PURE__ */ (0,
|
|
7979
|
+
return /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(
|
|
8017
7980
|
"div",
|
|
8018
7981
|
{
|
|
8019
7982
|
className: clsx_default("lib-xplat-divider", orientation),
|
|
@@ -8026,15 +7989,15 @@ Divider.displayName = "Divider";
|
|
|
8026
7989
|
var Divider_default = Divider;
|
|
8027
7990
|
|
|
8028
7991
|
// src/components/Drawer/Drawer.tsx
|
|
8029
|
-
var
|
|
7992
|
+
var import_react18 = __toESM(require("react"), 1);
|
|
8030
7993
|
var import_react_dom3 = require("react-dom");
|
|
8031
|
-
var
|
|
7994
|
+
var import_jsx_runtime321 = require("react/jsx-runtime");
|
|
8032
7995
|
var ANIMATION_DURATION_MS2 = 250;
|
|
8033
7996
|
var Drawer = (props) => {
|
|
8034
7997
|
const { isOpen, onClose, placement = "right", size = "md", title, children } = props;
|
|
8035
|
-
const [mounted, setMounted] =
|
|
8036
|
-
const [visible, setVisible] =
|
|
8037
|
-
|
|
7998
|
+
const [mounted, setMounted] = import_react18.default.useState(false);
|
|
7999
|
+
const [visible, setVisible] = import_react18.default.useState(false);
|
|
8000
|
+
import_react18.default.useEffect(() => {
|
|
8038
8001
|
if (isOpen) {
|
|
8039
8002
|
setMounted(true);
|
|
8040
8003
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -8048,12 +8011,12 @@ var Drawer = (props) => {
|
|
|
8048
8011
|
if (!mounted) return null;
|
|
8049
8012
|
const stateClass = visible ? "enter" : "exit";
|
|
8050
8013
|
return (0, import_react_dom3.createPortal)(
|
|
8051
|
-
/* @__PURE__ */ (0,
|
|
8014
|
+
/* @__PURE__ */ (0, import_jsx_runtime321.jsx)(
|
|
8052
8015
|
"div",
|
|
8053
8016
|
{
|
|
8054
8017
|
className: clsx_default("lib-xplat-drawer-overlay", stateClass),
|
|
8055
8018
|
onClick: onClose,
|
|
8056
|
-
children: /* @__PURE__ */ (0,
|
|
8019
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime321.jsxs)(
|
|
8057
8020
|
"div",
|
|
8058
8021
|
{
|
|
8059
8022
|
className: clsx_default("lib-xplat-drawer", placement, size, stateClass),
|
|
@@ -8061,11 +8024,11 @@ var Drawer = (props) => {
|
|
|
8061
8024
|
"aria-modal": "true",
|
|
8062
8025
|
onClick: (e) => e.stopPropagation(),
|
|
8063
8026
|
children: [
|
|
8064
|
-
title && /* @__PURE__ */ (0,
|
|
8065
|
-
/* @__PURE__ */ (0,
|
|
8066
|
-
/* @__PURE__ */ (0,
|
|
8027
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime321.jsxs)("div", { className: "drawer-header", children: [
|
|
8028
|
+
/* @__PURE__ */ (0, import_jsx_runtime321.jsx)("span", { className: "drawer-title", children: title }),
|
|
8029
|
+
/* @__PURE__ */ (0, import_jsx_runtime321.jsx)("button", { className: "close-btn", onClick: onClose, "aria-label": "\uB2EB\uAE30", children: "\xD7" })
|
|
8067
8030
|
] }),
|
|
8068
|
-
/* @__PURE__ */ (0,
|
|
8031
|
+
/* @__PURE__ */ (0, import_jsx_runtime321.jsx)("div", { className: "drawer-body", children })
|
|
8069
8032
|
]
|
|
8070
8033
|
}
|
|
8071
8034
|
)
|
|
@@ -8078,16 +8041,16 @@ Drawer.displayName = "Drawer";
|
|
|
8078
8041
|
var Drawer_default = Drawer;
|
|
8079
8042
|
|
|
8080
8043
|
// src/components/Dropdown/Dropdown.tsx
|
|
8081
|
-
var
|
|
8044
|
+
var import_react21 = __toESM(require("react"), 1);
|
|
8082
8045
|
|
|
8083
8046
|
// src/tokens/hooks/useAutoPosition.ts
|
|
8084
|
-
var
|
|
8047
|
+
var import_react19 = __toESM(require("react"), 1);
|
|
8085
8048
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
8086
|
-
const [position, setPosition] =
|
|
8049
|
+
const [position, setPosition] = import_react19.default.useState({
|
|
8087
8050
|
position: {},
|
|
8088
8051
|
direction: "bottom"
|
|
8089
8052
|
});
|
|
8090
|
-
const calculatePosition =
|
|
8053
|
+
const calculatePosition = import_react19.default.useCallback(() => {
|
|
8091
8054
|
if (!triggerRef.current || !popRef.current) return;
|
|
8092
8055
|
const triggerRect = triggerRef.current.getBoundingClientRect();
|
|
8093
8056
|
const popW = popRef.current.offsetWidth;
|
|
@@ -8114,13 +8077,13 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
8114
8077
|
direction
|
|
8115
8078
|
});
|
|
8116
8079
|
}, [triggerRef, popRef]);
|
|
8117
|
-
|
|
8080
|
+
import_react19.default.useLayoutEffect(() => {
|
|
8118
8081
|
if (!enabled) return;
|
|
8119
8082
|
calculatePosition();
|
|
8120
8083
|
const raf = requestAnimationFrame(calculatePosition);
|
|
8121
8084
|
return () => cancelAnimationFrame(raf);
|
|
8122
8085
|
}, [calculatePosition, enabled]);
|
|
8123
|
-
|
|
8086
|
+
import_react19.default.useEffect(() => {
|
|
8124
8087
|
if (!enabled || !popRef.current) return;
|
|
8125
8088
|
const observer = new ResizeObserver(() => {
|
|
8126
8089
|
calculatePosition();
|
|
@@ -8128,7 +8091,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
8128
8091
|
observer.observe(popRef.current);
|
|
8129
8092
|
return () => observer.disconnect();
|
|
8130
8093
|
}, [calculatePosition, enabled, popRef]);
|
|
8131
|
-
|
|
8094
|
+
import_react19.default.useEffect(() => {
|
|
8132
8095
|
if (!enabled) return;
|
|
8133
8096
|
window.addEventListener("resize", calculatePosition);
|
|
8134
8097
|
window.addEventListener("scroll", calculatePosition, true);
|
|
@@ -8142,9 +8105,9 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
8142
8105
|
var useAutoPosition_default = useAutoPosition;
|
|
8143
8106
|
|
|
8144
8107
|
// src/tokens/hooks/useClickOutside.ts
|
|
8145
|
-
var
|
|
8108
|
+
var import_react20 = __toESM(require("react"), 1);
|
|
8146
8109
|
var useClickOutside = (refs, handler, enabled = true) => {
|
|
8147
|
-
|
|
8110
|
+
import_react20.default.useEffect(() => {
|
|
8148
8111
|
if (!enabled) return;
|
|
8149
8112
|
const refArray = Array.isArray(refs) ? refs : [refs];
|
|
8150
8113
|
const listener = (event) => {
|
|
@@ -8167,17 +8130,17 @@ var useClickOutside = (refs, handler, enabled = true) => {
|
|
|
8167
8130
|
var useClickOutside_default = useClickOutside;
|
|
8168
8131
|
|
|
8169
8132
|
// src/components/Dropdown/Dropdown.tsx
|
|
8170
|
-
var
|
|
8133
|
+
var import_jsx_runtime322 = require("react/jsx-runtime");
|
|
8171
8134
|
var Dropdown = (props) => {
|
|
8172
8135
|
const { items, children } = props;
|
|
8173
|
-
const [isOpen, setIsOpen] =
|
|
8174
|
-
const [mounted, setMounted] =
|
|
8175
|
-
const [visible, setVisible] =
|
|
8176
|
-
const triggerRef =
|
|
8177
|
-
const menuRef =
|
|
8136
|
+
const [isOpen, setIsOpen] = import_react21.default.useState(false);
|
|
8137
|
+
const [mounted, setMounted] = import_react21.default.useState(false);
|
|
8138
|
+
const [visible, setVisible] = import_react21.default.useState(false);
|
|
8139
|
+
const triggerRef = import_react21.default.useRef(null);
|
|
8140
|
+
const menuRef = import_react21.default.useRef(null);
|
|
8178
8141
|
const { position, direction } = useAutoPosition_default(triggerRef, menuRef, mounted);
|
|
8179
8142
|
useClickOutside_default([triggerRef, menuRef], () => setIsOpen(false), isOpen);
|
|
8180
|
-
|
|
8143
|
+
import_react21.default.useEffect(() => {
|
|
8181
8144
|
if (isOpen) {
|
|
8182
8145
|
setMounted(true);
|
|
8183
8146
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -8192,8 +8155,8 @@ var Dropdown = (props) => {
|
|
|
8192
8155
|
item.onClick?.();
|
|
8193
8156
|
setIsOpen(false);
|
|
8194
8157
|
};
|
|
8195
|
-
return /* @__PURE__ */ (0,
|
|
8196
|
-
/* @__PURE__ */ (0,
|
|
8158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime322.jsxs)("div", { className: "lib-xplat-dropdown", children: [
|
|
8159
|
+
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)(
|
|
8197
8160
|
"div",
|
|
8198
8161
|
{
|
|
8199
8162
|
ref: triggerRef,
|
|
@@ -8202,14 +8165,14 @@ var Dropdown = (props) => {
|
|
|
8202
8165
|
children
|
|
8203
8166
|
}
|
|
8204
8167
|
),
|
|
8205
|
-
mounted && /* @__PURE__ */ (0,
|
|
8168
|
+
mounted && /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(
|
|
8206
8169
|
"div",
|
|
8207
8170
|
{
|
|
8208
8171
|
ref: menuRef,
|
|
8209
8172
|
className: clsx_default("lib-xplat-dropdown-menu", direction, { visible }),
|
|
8210
8173
|
style: { top: position.top, left: position.left },
|
|
8211
8174
|
role: "menu",
|
|
8212
|
-
children: items.map((item) => /* @__PURE__ */ (0,
|
|
8175
|
+
children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(
|
|
8213
8176
|
"button",
|
|
8214
8177
|
{
|
|
8215
8178
|
className: clsx_default("dropdown-item", {
|
|
@@ -8231,23 +8194,23 @@ Dropdown.displayName = "Dropdown";
|
|
|
8231
8194
|
var Dropdown_default = Dropdown;
|
|
8232
8195
|
|
|
8233
8196
|
// src/components/EmptyState/EmptyState.tsx
|
|
8234
|
-
var
|
|
8197
|
+
var import_jsx_runtime323 = require("react/jsx-runtime");
|
|
8235
8198
|
var EmptyState = (props) => {
|
|
8236
8199
|
const { icon, title = "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4", description, action } = props;
|
|
8237
|
-
return /* @__PURE__ */ (0,
|
|
8238
|
-
icon && /* @__PURE__ */ (0,
|
|
8239
|
-
!icon && /* @__PURE__ */ (0,
|
|
8240
|
-
/* @__PURE__ */ (0,
|
|
8241
|
-
description && /* @__PURE__ */ (0,
|
|
8242
|
-
action && /* @__PURE__ */ (0,
|
|
8200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime323.jsxs)("div", { className: "lib-xplat-empty-state", children: [
|
|
8201
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime323.jsx)("div", { className: "empty-icon", children: icon }),
|
|
8202
|
+
!icon && /* @__PURE__ */ (0, import_jsx_runtime323.jsx)("div", { className: "empty-icon", children: /* @__PURE__ */ (0, import_jsx_runtime323.jsx)("svg", { viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime323.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" }) }) }),
|
|
8203
|
+
/* @__PURE__ */ (0, import_jsx_runtime323.jsx)("p", { className: "empty-title", children: title }),
|
|
8204
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime323.jsx)("p", { className: "empty-description", children: description }),
|
|
8205
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime323.jsx)("div", { className: "empty-action", children: action })
|
|
8243
8206
|
] });
|
|
8244
8207
|
};
|
|
8245
8208
|
EmptyState.displayName = "EmptyState";
|
|
8246
8209
|
var EmptyState_default = EmptyState;
|
|
8247
8210
|
|
|
8248
8211
|
// src/components/FileUpload/FileUpload.tsx
|
|
8249
|
-
var
|
|
8250
|
-
var
|
|
8212
|
+
var import_react22 = __toESM(require("react"), 1);
|
|
8213
|
+
var import_jsx_runtime324 = require("react/jsx-runtime");
|
|
8251
8214
|
var FileUpload = (props) => {
|
|
8252
8215
|
const {
|
|
8253
8216
|
accept,
|
|
@@ -8257,8 +8220,8 @@ var FileUpload = (props) => {
|
|
|
8257
8220
|
label = "\uD30C\uC77C\uC744 \uB4DC\uB798\uADF8\uD558\uAC70\uB098 \uD074\uB9AD\uD558\uC5EC \uC5C5\uB85C\uB4DC",
|
|
8258
8221
|
description
|
|
8259
8222
|
} = props;
|
|
8260
|
-
const [isDragOver, setIsDragOver] =
|
|
8261
|
-
const inputRef =
|
|
8223
|
+
const [isDragOver, setIsDragOver] = import_react22.default.useState(false);
|
|
8224
|
+
const inputRef = import_react22.default.useRef(null);
|
|
8262
8225
|
const handleFiles = (fileList) => {
|
|
8263
8226
|
let files = Array.from(fileList);
|
|
8264
8227
|
if (maxSize) {
|
|
@@ -8288,7 +8251,7 @@ var FileUpload = (props) => {
|
|
|
8288
8251
|
handleFiles(e.target.files);
|
|
8289
8252
|
}
|
|
8290
8253
|
};
|
|
8291
|
-
return /* @__PURE__ */ (0,
|
|
8254
|
+
return /* @__PURE__ */ (0, import_jsx_runtime324.jsxs)(
|
|
8292
8255
|
"div",
|
|
8293
8256
|
{
|
|
8294
8257
|
className: clsx_default("lib-xplat-file-upload", { "drag-over": isDragOver }),
|
|
@@ -8297,7 +8260,7 @@ var FileUpload = (props) => {
|
|
|
8297
8260
|
onDragLeave: handleDragLeave,
|
|
8298
8261
|
onClick: () => inputRef.current?.click(),
|
|
8299
8262
|
children: [
|
|
8300
|
-
/* @__PURE__ */ (0,
|
|
8263
|
+
/* @__PURE__ */ (0, import_jsx_runtime324.jsx)(
|
|
8301
8264
|
"input",
|
|
8302
8265
|
{
|
|
8303
8266
|
ref: inputRef,
|
|
@@ -8307,9 +8270,9 @@ var FileUpload = (props) => {
|
|
|
8307
8270
|
onChange: handleChange
|
|
8308
8271
|
}
|
|
8309
8272
|
),
|
|
8310
|
-
/* @__PURE__ */ (0,
|
|
8311
|
-
/* @__PURE__ */ (0,
|
|
8312
|
-
description && /* @__PURE__ */ (0,
|
|
8273
|
+
/* @__PURE__ */ (0, import_jsx_runtime324.jsx)("div", { className: "upload-icon", children: /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(UploadIcon_default, {}) }),
|
|
8274
|
+
/* @__PURE__ */ (0, import_jsx_runtime324.jsx)("p", { className: "upload-label", children: label }),
|
|
8275
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime324.jsx)("p", { className: "upload-description", children: description })
|
|
8313
8276
|
]
|
|
8314
8277
|
}
|
|
8315
8278
|
);
|
|
@@ -8318,10 +8281,10 @@ FileUpload.displayName = "FileUpload";
|
|
|
8318
8281
|
var FileUpload_default = FileUpload;
|
|
8319
8282
|
|
|
8320
8283
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
8321
|
-
var
|
|
8284
|
+
var import_react24 = __toESM(require("react"), 1);
|
|
8322
8285
|
|
|
8323
8286
|
// src/components/HtmlTypeWriter/utils.ts
|
|
8324
|
-
var
|
|
8287
|
+
var import_react23 = __toESM(require("react"), 1);
|
|
8325
8288
|
var voidTags = /* @__PURE__ */ new Set([
|
|
8326
8289
|
"br",
|
|
8327
8290
|
"img",
|
|
@@ -8389,41 +8352,41 @@ var convertNodeToReactWithRange = (node, typedLen, rangeMap) => {
|
|
|
8389
8352
|
props[attr.name] = attr.value;
|
|
8390
8353
|
});
|
|
8391
8354
|
if (voidTags.has(tag)) {
|
|
8392
|
-
return
|
|
8355
|
+
return import_react23.default.createElement(tag, props);
|
|
8393
8356
|
}
|
|
8394
8357
|
const children = Array.from(element.childNodes).map((child) => convertNodeToReactWithRange(child, typedLen, rangeMap)).filter((n) => n != null);
|
|
8395
|
-
return
|
|
8358
|
+
return import_react23.default.createElement(tag, props, ...children);
|
|
8396
8359
|
};
|
|
8397
8360
|
var htmlToReactProgressive = (root, typedLen, rangeMap) => {
|
|
8398
8361
|
const nodes = Array.from(root.childNodes).map((child, idx) => {
|
|
8399
8362
|
const node = convertNodeToReactWithRange(child, typedLen, rangeMap);
|
|
8400
|
-
return node == null ? null :
|
|
8363
|
+
return node == null ? null : import_react23.default.createElement(import_react23.default.Fragment, { key: idx }, node);
|
|
8401
8364
|
}).filter(Boolean);
|
|
8402
8365
|
return nodes.length === 0 ? null : nodes;
|
|
8403
8366
|
};
|
|
8404
8367
|
|
|
8405
8368
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
8406
|
-
var
|
|
8369
|
+
var import_jsx_runtime325 = require("react/jsx-runtime");
|
|
8407
8370
|
var HtmlTypeWriter = ({
|
|
8408
8371
|
html,
|
|
8409
8372
|
duration = 20,
|
|
8410
8373
|
onDone,
|
|
8411
8374
|
onChange
|
|
8412
8375
|
}) => {
|
|
8413
|
-
const [typedLen, setTypedLen] =
|
|
8414
|
-
const doneCalledRef =
|
|
8415
|
-
const { doc, rangeMap, totalLength } =
|
|
8376
|
+
const [typedLen, setTypedLen] = import_react24.default.useState(0);
|
|
8377
|
+
const doneCalledRef = import_react24.default.useRef(false);
|
|
8378
|
+
const { doc, rangeMap, totalLength } = import_react24.default.useMemo(() => {
|
|
8416
8379
|
if (typeof window === "undefined") return { doc: null, rangeMap: /* @__PURE__ */ new Map(), totalLength: 0 };
|
|
8417
8380
|
const decoded = decodeHtmlEntities(html);
|
|
8418
8381
|
const doc2 = new DOMParser().parseFromString(decoded, "text/html");
|
|
8419
8382
|
const { rangeMap: rangeMap2, totalLength: totalLength2 } = buildRangeMap(doc2.body);
|
|
8420
8383
|
return { doc: doc2, rangeMap: rangeMap2, totalLength: totalLength2 };
|
|
8421
8384
|
}, [html]);
|
|
8422
|
-
|
|
8385
|
+
import_react24.default.useEffect(() => {
|
|
8423
8386
|
setTypedLen(0);
|
|
8424
8387
|
doneCalledRef.current = false;
|
|
8425
8388
|
}, [html]);
|
|
8426
|
-
|
|
8389
|
+
import_react24.default.useEffect(() => {
|
|
8427
8390
|
if (!totalLength) return;
|
|
8428
8391
|
if (typedLen >= totalLength) return;
|
|
8429
8392
|
const timer = window.setInterval(() => {
|
|
@@ -8431,33 +8394,33 @@ var HtmlTypeWriter = ({
|
|
|
8431
8394
|
}, duration);
|
|
8432
8395
|
return () => window.clearInterval(timer);
|
|
8433
8396
|
}, [typedLen, totalLength, duration]);
|
|
8434
|
-
|
|
8397
|
+
import_react24.default.useEffect(() => {
|
|
8435
8398
|
if (typedLen > 0 && typedLen < totalLength) {
|
|
8436
8399
|
onChange?.();
|
|
8437
8400
|
}
|
|
8438
8401
|
}, [typedLen, totalLength, onChange]);
|
|
8439
|
-
|
|
8402
|
+
import_react24.default.useEffect(() => {
|
|
8440
8403
|
if (typedLen === totalLength && totalLength > 0 && !doneCalledRef.current) {
|
|
8441
8404
|
doneCalledRef.current = true;
|
|
8442
8405
|
onDone?.();
|
|
8443
8406
|
}
|
|
8444
8407
|
}, [typedLen, totalLength, onDone]);
|
|
8445
|
-
const parsed =
|
|
8408
|
+
const parsed = import_react24.default.useMemo(
|
|
8446
8409
|
() => doc ? htmlToReactProgressive(doc.body, typedLen, rangeMap) : null,
|
|
8447
8410
|
[doc, typedLen, rangeMap]
|
|
8448
8411
|
);
|
|
8449
|
-
return /* @__PURE__ */ (0,
|
|
8412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime325.jsx)("div", { className: "lib-xplat-htmlTypewriter", children: parsed });
|
|
8450
8413
|
};
|
|
8451
8414
|
HtmlTypeWriter.displayName = "HtmlTypeWriter";
|
|
8452
8415
|
var HtmlTypeWriter_default = HtmlTypeWriter;
|
|
8453
8416
|
|
|
8454
8417
|
// src/components/ImageSelector/ImageSelector.tsx
|
|
8455
|
-
var
|
|
8456
|
-
var
|
|
8418
|
+
var import_react25 = __toESM(require("react"), 1);
|
|
8419
|
+
var import_jsx_runtime326 = require("react/jsx-runtime");
|
|
8457
8420
|
var ImageSelector = (props) => {
|
|
8458
8421
|
const { value, label, onChange } = props;
|
|
8459
|
-
const [previewUrl, setPreviewUrl] =
|
|
8460
|
-
|
|
8422
|
+
const [previewUrl, setPreviewUrl] = import_react25.default.useState();
|
|
8423
|
+
import_react25.default.useEffect(() => {
|
|
8461
8424
|
if (!value) {
|
|
8462
8425
|
setPreviewUrl(void 0);
|
|
8463
8426
|
return;
|
|
@@ -8466,7 +8429,7 @@ var ImageSelector = (props) => {
|
|
|
8466
8429
|
setPreviewUrl(url);
|
|
8467
8430
|
return () => URL.revokeObjectURL(url);
|
|
8468
8431
|
}, [value]);
|
|
8469
|
-
const inputRef =
|
|
8432
|
+
const inputRef = import_react25.default.useRef(null);
|
|
8470
8433
|
const handleFileChange = (e) => {
|
|
8471
8434
|
const selectedFile = e.target.files?.[0];
|
|
8472
8435
|
if (selectedFile) {
|
|
@@ -8479,8 +8442,8 @@ var ImageSelector = (props) => {
|
|
|
8479
8442
|
const handleOpenFileDialog = () => {
|
|
8480
8443
|
inputRef.current?.click();
|
|
8481
8444
|
};
|
|
8482
|
-
return /* @__PURE__ */ (0,
|
|
8483
|
-
/* @__PURE__ */ (0,
|
|
8445
|
+
return /* @__PURE__ */ (0, import_jsx_runtime326.jsxs)("div", { className: `lib-xplat-imageselector${value ? "" : " none-value"}`, children: [
|
|
8446
|
+
/* @__PURE__ */ (0, import_jsx_runtime326.jsx)(
|
|
8484
8447
|
"input",
|
|
8485
8448
|
{
|
|
8486
8449
|
type: "file",
|
|
@@ -8490,13 +8453,13 @@ var ImageSelector = (props) => {
|
|
|
8490
8453
|
ref: inputRef
|
|
8491
8454
|
}
|
|
8492
8455
|
),
|
|
8493
|
-
value && /* @__PURE__ */ (0,
|
|
8494
|
-
/* @__PURE__ */ (0,
|
|
8495
|
-
/* @__PURE__ */ (0,
|
|
8456
|
+
value && /* @__PURE__ */ (0, import_jsx_runtime326.jsxs)("div", { className: "action-bar", children: [
|
|
8457
|
+
/* @__PURE__ */ (0, import_jsx_runtime326.jsx)("div", { className: "icon-wrapper", onClick: handleOpenFileDialog, children: /* @__PURE__ */ (0, import_jsx_runtime326.jsx)(UploadIcon_default, {}) }),
|
|
8458
|
+
/* @__PURE__ */ (0, import_jsx_runtime326.jsx)("div", { className: "icon-wrapper", onClick: handleDeleteFile, children: /* @__PURE__ */ (0, import_jsx_runtime326.jsx)(DeleteIcon_default, {}) })
|
|
8496
8459
|
] }),
|
|
8497
|
-
/* @__PURE__ */ (0,
|
|
8498
|
-
/* @__PURE__ */ (0,
|
|
8499
|
-
/* @__PURE__ */ (0,
|
|
8460
|
+
/* @__PURE__ */ (0, import_jsx_runtime326.jsx)("div", { className: "content", children: previewUrl ? /* @__PURE__ */ (0, import_jsx_runtime326.jsx)("img", { src: previewUrl, alt: "preview" }) : /* @__PURE__ */ (0, import_jsx_runtime326.jsxs)("div", { className: "skeleton", onClick: handleOpenFileDialog, children: [
|
|
8461
|
+
/* @__PURE__ */ (0, import_jsx_runtime326.jsx)("div", { className: "icon-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime326.jsx)(ImageIcon_default, {}) }),
|
|
8462
|
+
/* @__PURE__ */ (0, import_jsx_runtime326.jsx)("div", { className: "label", children: label || "\uC774\uBBF8\uC9C0 \uCD94\uAC00\uD558\uAE30" })
|
|
8500
8463
|
] }) })
|
|
8501
8464
|
] });
|
|
8502
8465
|
};
|
|
@@ -8504,7 +8467,7 @@ ImageSelector.displayName = "ImageSelector";
|
|
|
8504
8467
|
var ImageSelector_default = ImageSelector;
|
|
8505
8468
|
|
|
8506
8469
|
// src/components/Pagination/Pagination.tsx
|
|
8507
|
-
var
|
|
8470
|
+
var import_jsx_runtime327 = require("react/jsx-runtime");
|
|
8508
8471
|
var getPageRange = (current, totalPages, siblingCount) => {
|
|
8509
8472
|
const totalNumbers = siblingCount * 2 + 5;
|
|
8510
8473
|
if (totalPages <= totalNumbers) {
|
|
@@ -8547,19 +8510,19 @@ var Pagination = (props) => {
|
|
|
8547
8510
|
onChange?.(page);
|
|
8548
8511
|
}
|
|
8549
8512
|
};
|
|
8550
|
-
return /* @__PURE__ */ (0,
|
|
8551
|
-
/* @__PURE__ */ (0,
|
|
8513
|
+
return /* @__PURE__ */ (0, import_jsx_runtime327.jsxs)("nav", { className: clsx_default("lib-xplat-pagination", size, type), "aria-label": "\uD398\uC774\uC9C0 \uB124\uBE44\uAC8C\uC774\uC158", children: [
|
|
8514
|
+
/* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
|
|
8552
8515
|
"button",
|
|
8553
8516
|
{
|
|
8554
8517
|
className: "page-btn prev",
|
|
8555
8518
|
disabled: current <= 1,
|
|
8556
8519
|
onClick: () => handleClick(current - 1),
|
|
8557
8520
|
"aria-label": "\uC774\uC804 \uD398\uC774\uC9C0",
|
|
8558
|
-
children: /* @__PURE__ */ (0,
|
|
8521
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(ChevronLeftIcon_default, {})
|
|
8559
8522
|
}
|
|
8560
8523
|
),
|
|
8561
8524
|
pages.map(
|
|
8562
|
-
(page, i) => page === "..." ? /* @__PURE__ */ (0,
|
|
8525
|
+
(page, i) => page === "..." ? /* @__PURE__ */ (0, import_jsx_runtime327.jsx)("span", { className: "dots", children: "..." }, `dots-${i}`) : /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
|
|
8563
8526
|
"button",
|
|
8564
8527
|
{
|
|
8565
8528
|
className: clsx_default("page-btn", { active: page === current }),
|
|
@@ -8570,14 +8533,14 @@ var Pagination = (props) => {
|
|
|
8570
8533
|
page
|
|
8571
8534
|
)
|
|
8572
8535
|
),
|
|
8573
|
-
/* @__PURE__ */ (0,
|
|
8536
|
+
/* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
|
|
8574
8537
|
"button",
|
|
8575
8538
|
{
|
|
8576
8539
|
className: "page-btn next",
|
|
8577
8540
|
disabled: current >= totalPages,
|
|
8578
8541
|
onClick: () => handleClick(current + 1),
|
|
8579
8542
|
"aria-label": "\uB2E4\uC74C \uD398\uC774\uC9C0",
|
|
8580
|
-
children: /* @__PURE__ */ (0,
|
|
8543
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(ChevronRightIcon_default, {})
|
|
8581
8544
|
}
|
|
8582
8545
|
)
|
|
8583
8546
|
] });
|
|
@@ -8586,17 +8549,17 @@ Pagination.displayName = "Pagination";
|
|
|
8586
8549
|
var Pagination_default = Pagination;
|
|
8587
8550
|
|
|
8588
8551
|
// src/components/PopOver/PopOver.tsx
|
|
8589
|
-
var
|
|
8590
|
-
var
|
|
8552
|
+
var import_react26 = __toESM(require("react"), 1);
|
|
8553
|
+
var import_jsx_runtime328 = require("react/jsx-runtime");
|
|
8591
8554
|
var PopOver = (props) => {
|
|
8592
8555
|
const { children, isOpen, onClose, PopOverEl } = props;
|
|
8593
|
-
const popRef =
|
|
8594
|
-
const triggerRef =
|
|
8595
|
-
const [localOpen, setLocalOpen] =
|
|
8596
|
-
const [eventTrigger, setEventTrigger] =
|
|
8556
|
+
const popRef = import_react26.default.useRef(null);
|
|
8557
|
+
const triggerRef = import_react26.default.useRef(null);
|
|
8558
|
+
const [localOpen, setLocalOpen] = import_react26.default.useState(false);
|
|
8559
|
+
const [eventTrigger, setEventTrigger] = import_react26.default.useState(false);
|
|
8597
8560
|
useClickOutside_default([popRef, triggerRef], onClose, isOpen);
|
|
8598
8561
|
const position = useAutoPosition_default(triggerRef, popRef, localOpen);
|
|
8599
|
-
|
|
8562
|
+
import_react26.default.useEffect(() => {
|
|
8600
8563
|
if (isOpen) {
|
|
8601
8564
|
setLocalOpen(isOpen);
|
|
8602
8565
|
setTimeout(() => {
|
|
@@ -8609,7 +8572,7 @@ var PopOver = (props) => {
|
|
|
8609
8572
|
}, 200);
|
|
8610
8573
|
}
|
|
8611
8574
|
}, [isOpen]);
|
|
8612
|
-
return /* @__PURE__ */ (0,
|
|
8575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime328.jsxs)(
|
|
8613
8576
|
"div",
|
|
8614
8577
|
{
|
|
8615
8578
|
className: "lib-xplat-pop-over",
|
|
@@ -8619,7 +8582,7 @@ var PopOver = (props) => {
|
|
|
8619
8582
|
},
|
|
8620
8583
|
children: [
|
|
8621
8584
|
children,
|
|
8622
|
-
localOpen && /* @__PURE__ */ (0,
|
|
8585
|
+
localOpen && /* @__PURE__ */ (0, import_jsx_runtime328.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime328.jsx)(
|
|
8623
8586
|
"div",
|
|
8624
8587
|
{
|
|
8625
8588
|
className: clsx_default(
|
|
@@ -8642,7 +8605,7 @@ PopOver.displayName = "PopOver";
|
|
|
8642
8605
|
var PopOver_default = PopOver;
|
|
8643
8606
|
|
|
8644
8607
|
// src/components/Progress/Progress.tsx
|
|
8645
|
-
var
|
|
8608
|
+
var import_jsx_runtime329 = require("react/jsx-runtime");
|
|
8646
8609
|
var Progress = (props) => {
|
|
8647
8610
|
const {
|
|
8648
8611
|
value,
|
|
@@ -8652,8 +8615,8 @@ var Progress = (props) => {
|
|
|
8652
8615
|
showLabel = false
|
|
8653
8616
|
} = props;
|
|
8654
8617
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
8655
|
-
return /* @__PURE__ */ (0,
|
|
8656
|
-
/* @__PURE__ */ (0,
|
|
8618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime329.jsxs)("div", { className: clsx_default("lib-xplat-progress", size, type), children: [
|
|
8619
|
+
/* @__PURE__ */ (0, import_jsx_runtime329.jsx)(
|
|
8657
8620
|
"div",
|
|
8658
8621
|
{
|
|
8659
8622
|
className: "track",
|
|
@@ -8661,7 +8624,7 @@ var Progress = (props) => {
|
|
|
8661
8624
|
"aria-valuenow": value,
|
|
8662
8625
|
"aria-valuemin": 0,
|
|
8663
8626
|
"aria-valuemax": max,
|
|
8664
|
-
children: /* @__PURE__ */ (0,
|
|
8627
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime329.jsx)(
|
|
8665
8628
|
"div",
|
|
8666
8629
|
{
|
|
8667
8630
|
className: "bar",
|
|
@@ -8670,7 +8633,7 @@ var Progress = (props) => {
|
|
|
8670
8633
|
)
|
|
8671
8634
|
}
|
|
8672
8635
|
),
|
|
8673
|
-
showLabel && /* @__PURE__ */ (0,
|
|
8636
|
+
showLabel && /* @__PURE__ */ (0, import_jsx_runtime329.jsxs)("span", { className: "label", children: [
|
|
8674
8637
|
Math.round(percentage),
|
|
8675
8638
|
"%"
|
|
8676
8639
|
] })
|
|
@@ -8680,17 +8643,17 @@ Progress.displayName = "Progress";
|
|
|
8680
8643
|
var Progress_default = Progress;
|
|
8681
8644
|
|
|
8682
8645
|
// src/components/Radio/RadioGroupContext.tsx
|
|
8683
|
-
var
|
|
8684
|
-
var RadioGroupContext =
|
|
8646
|
+
var import_react27 = __toESM(require("react"), 1);
|
|
8647
|
+
var RadioGroupContext = import_react27.default.createContext(
|
|
8685
8648
|
null
|
|
8686
8649
|
);
|
|
8687
8650
|
var useRadioGroupContext = () => {
|
|
8688
|
-
return
|
|
8651
|
+
return import_react27.default.useContext(RadioGroupContext);
|
|
8689
8652
|
};
|
|
8690
8653
|
var RadioGroupContext_default = RadioGroupContext;
|
|
8691
8654
|
|
|
8692
8655
|
// src/components/Radio/Radio.tsx
|
|
8693
|
-
var
|
|
8656
|
+
var import_jsx_runtime330 = require("react/jsx-runtime");
|
|
8694
8657
|
var Radio = (props) => {
|
|
8695
8658
|
const {
|
|
8696
8659
|
label,
|
|
@@ -8708,7 +8671,7 @@ var Radio = (props) => {
|
|
|
8708
8671
|
value,
|
|
8709
8672
|
onChange: rest.onChange
|
|
8710
8673
|
};
|
|
8711
|
-
return /* @__PURE__ */ (0,
|
|
8674
|
+
return /* @__PURE__ */ (0, import_jsx_runtime330.jsxs)(
|
|
8712
8675
|
"label",
|
|
8713
8676
|
{
|
|
8714
8677
|
className: clsx_default(
|
|
@@ -8718,18 +8681,18 @@ var Radio = (props) => {
|
|
|
8718
8681
|
localChecked ? "checked" : void 0
|
|
8719
8682
|
),
|
|
8720
8683
|
children: [
|
|
8721
|
-
/* @__PURE__ */ (0,
|
|
8722
|
-
/* @__PURE__ */ (0,
|
|
8684
|
+
/* @__PURE__ */ (0, import_jsx_runtime330.jsx)("input", { ...rest, ...inputProps, checked: localChecked, type: "radio" }),
|
|
8685
|
+
/* @__PURE__ */ (0, import_jsx_runtime330.jsx)(
|
|
8723
8686
|
"div",
|
|
8724
8687
|
{
|
|
8725
8688
|
className: clsx_default(
|
|
8726
8689
|
"circle",
|
|
8727
8690
|
localChecked ? "checked" : void 0
|
|
8728
8691
|
),
|
|
8729
|
-
children: localChecked && /* @__PURE__ */ (0,
|
|
8692
|
+
children: localChecked && /* @__PURE__ */ (0, import_jsx_runtime330.jsx)("div", { className: "inner-circle" })
|
|
8730
8693
|
}
|
|
8731
8694
|
),
|
|
8732
|
-
label && /* @__PURE__ */ (0,
|
|
8695
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime330.jsx)("span", { children: label })
|
|
8733
8696
|
]
|
|
8734
8697
|
}
|
|
8735
8698
|
);
|
|
@@ -8738,28 +8701,28 @@ Radio.displayName = "Radio";
|
|
|
8738
8701
|
var Radio_default = Radio;
|
|
8739
8702
|
|
|
8740
8703
|
// src/components/Radio/RadioGroup.tsx
|
|
8741
|
-
var
|
|
8704
|
+
var import_jsx_runtime331 = require("react/jsx-runtime");
|
|
8742
8705
|
var RadioGroup = (props) => {
|
|
8743
8706
|
const { children, ...rest } = props;
|
|
8744
|
-
return /* @__PURE__ */ (0,
|
|
8707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime331.jsx)(import_jsx_runtime331.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime331.jsx)(RadioGroupContext_default.Provider, { value: rest, children }) });
|
|
8745
8708
|
};
|
|
8746
8709
|
RadioGroup.displayName = "RadioGroup";
|
|
8747
8710
|
var RadioGroup_default = RadioGroup;
|
|
8748
8711
|
|
|
8749
8712
|
// src/components/Select/Select.tsx
|
|
8750
|
-
var
|
|
8713
|
+
var import_react30 = __toESM(require("react"), 1);
|
|
8751
8714
|
|
|
8752
8715
|
// src/components/Select/context.ts
|
|
8753
|
-
var
|
|
8754
|
-
var SelectContext =
|
|
8716
|
+
var import_react28 = __toESM(require("react"), 1);
|
|
8717
|
+
var SelectContext = import_react28.default.createContext(null);
|
|
8755
8718
|
var context_default = SelectContext;
|
|
8756
8719
|
|
|
8757
8720
|
// src/components/Select/SelectItem.tsx
|
|
8758
|
-
var
|
|
8759
|
-
var
|
|
8721
|
+
var import_react29 = __toESM(require("react"), 1);
|
|
8722
|
+
var import_jsx_runtime332 = require("react/jsx-runtime");
|
|
8760
8723
|
var SelectItem = (props) => {
|
|
8761
8724
|
const { children, value, onClick, disabled = false } = props;
|
|
8762
|
-
const ctx =
|
|
8725
|
+
const ctx = import_react29.default.useContext(context_default);
|
|
8763
8726
|
const handleClick = (e) => {
|
|
8764
8727
|
e.preventDefault();
|
|
8765
8728
|
e.stopPropagation();
|
|
@@ -8768,7 +8731,7 @@ var SelectItem = (props) => {
|
|
|
8768
8731
|
ctx?.close();
|
|
8769
8732
|
onClick?.();
|
|
8770
8733
|
};
|
|
8771
|
-
return /* @__PURE__ */ (0,
|
|
8734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime332.jsx)(
|
|
8772
8735
|
"div",
|
|
8773
8736
|
{
|
|
8774
8737
|
className: clsx_default("select-item", disabled && "disabled"),
|
|
@@ -8789,7 +8752,7 @@ SelectItem.displayName = "Select.Item";
|
|
|
8789
8752
|
var SelectItem_default = SelectItem;
|
|
8790
8753
|
|
|
8791
8754
|
// src/components/Select/Select.tsx
|
|
8792
|
-
var
|
|
8755
|
+
var import_jsx_runtime333 = require("react/jsx-runtime");
|
|
8793
8756
|
var ANIMATION_DURATION_MS3 = 200;
|
|
8794
8757
|
var SelectRoot = (props) => {
|
|
8795
8758
|
const {
|
|
@@ -8801,26 +8764,26 @@ var SelectRoot = (props) => {
|
|
|
8801
8764
|
error = false,
|
|
8802
8765
|
size = "md"
|
|
8803
8766
|
} = props;
|
|
8804
|
-
const itemChildren =
|
|
8805
|
-
(child) =>
|
|
8767
|
+
const itemChildren = import_react30.default.Children.toArray(children).filter(
|
|
8768
|
+
(child) => import_react30.default.isValidElement(child) && child.type === SelectItem_default
|
|
8806
8769
|
);
|
|
8807
8770
|
const isControlled = valueProp !== void 0;
|
|
8808
|
-
const [isOpen, setOpen] =
|
|
8809
|
-
const [uncontrolledLabel, setUncontrolledLabel] =
|
|
8810
|
-
const controlledLabel =
|
|
8771
|
+
const [isOpen, setOpen] = import_react30.default.useState(false);
|
|
8772
|
+
const [uncontrolledLabel, setUncontrolledLabel] = import_react30.default.useState(null);
|
|
8773
|
+
const controlledLabel = import_react30.default.useMemo(() => {
|
|
8811
8774
|
if (!isControlled) return null;
|
|
8812
8775
|
const match = itemChildren.find((child) => child.props.value === valueProp);
|
|
8813
8776
|
return match ? match.props.children : null;
|
|
8814
8777
|
}, [isControlled, valueProp, itemChildren]);
|
|
8815
8778
|
const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
|
|
8816
|
-
const triggerRef =
|
|
8817
|
-
const contentRef =
|
|
8818
|
-
const [mounted, setMounted] =
|
|
8819
|
-
const [visible, setVisible] =
|
|
8820
|
-
|
|
8779
|
+
const triggerRef = import_react30.default.useRef(null);
|
|
8780
|
+
const contentRef = import_react30.default.useRef(null);
|
|
8781
|
+
const [mounted, setMounted] = import_react30.default.useState(false);
|
|
8782
|
+
const [visible, setVisible] = import_react30.default.useState(false);
|
|
8783
|
+
import_react30.default.useEffect(() => {
|
|
8821
8784
|
if (disabled && isOpen) setOpen(false);
|
|
8822
8785
|
}, [disabled, isOpen]);
|
|
8823
|
-
|
|
8786
|
+
import_react30.default.useEffect(() => {
|
|
8824
8787
|
if (isOpen) {
|
|
8825
8788
|
setMounted(true);
|
|
8826
8789
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -8830,12 +8793,12 @@ var SelectRoot = (props) => {
|
|
|
8830
8793
|
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS3);
|
|
8831
8794
|
return () => clearTimeout(t);
|
|
8832
8795
|
}, [isOpen]);
|
|
8833
|
-
const open =
|
|
8834
|
-
const close =
|
|
8835
|
-
const toggle =
|
|
8796
|
+
const open = import_react30.default.useCallback(() => setOpen(true), []);
|
|
8797
|
+
const close = import_react30.default.useCallback(() => setOpen(false), []);
|
|
8798
|
+
const toggle = import_react30.default.useCallback(() => setOpen((prev) => !prev), []);
|
|
8836
8799
|
useClickOutside_default([contentRef, triggerRef], close, isOpen);
|
|
8837
8800
|
const position = useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
8838
|
-
const setSelected =
|
|
8801
|
+
const setSelected = import_react30.default.useCallback(
|
|
8839
8802
|
(label, itemValue) => {
|
|
8840
8803
|
if (!isControlled) {
|
|
8841
8804
|
setUncontrolledLabel(label);
|
|
@@ -8844,7 +8807,7 @@ var SelectRoot = (props) => {
|
|
|
8844
8807
|
},
|
|
8845
8808
|
[isControlled, onChange]
|
|
8846
8809
|
);
|
|
8847
|
-
const ctxValue =
|
|
8810
|
+
const ctxValue = import_react30.default.useMemo(
|
|
8848
8811
|
() => ({
|
|
8849
8812
|
isOpen,
|
|
8850
8813
|
mounted,
|
|
@@ -8865,7 +8828,7 @@ var SelectRoot = (props) => {
|
|
|
8865
8828
|
if (disabled) return;
|
|
8866
8829
|
toggle();
|
|
8867
8830
|
};
|
|
8868
|
-
return /* @__PURE__ */ (0,
|
|
8831
|
+
return /* @__PURE__ */ (0, import_jsx_runtime333.jsx)(context_default.Provider, { value: ctxValue, children: /* @__PURE__ */ (0, import_jsx_runtime333.jsxs)(
|
|
8869
8832
|
"div",
|
|
8870
8833
|
{
|
|
8871
8834
|
className: clsx_default(
|
|
@@ -8876,7 +8839,7 @@ var SelectRoot = (props) => {
|
|
|
8876
8839
|
mounted && "is-open"
|
|
8877
8840
|
),
|
|
8878
8841
|
children: [
|
|
8879
|
-
/* @__PURE__ */ (0,
|
|
8842
|
+
/* @__PURE__ */ (0, import_jsx_runtime333.jsxs)(
|
|
8880
8843
|
"div",
|
|
8881
8844
|
{
|
|
8882
8845
|
ref: triggerRef,
|
|
@@ -8900,7 +8863,7 @@ var SelectRoot = (props) => {
|
|
|
8900
8863
|
}
|
|
8901
8864
|
},
|
|
8902
8865
|
children: [
|
|
8903
|
-
/* @__PURE__ */ (0,
|
|
8866
|
+
/* @__PURE__ */ (0, import_jsx_runtime333.jsx)(
|
|
8904
8867
|
"span",
|
|
8905
8868
|
{
|
|
8906
8869
|
className: clsx_default(
|
|
@@ -8910,25 +8873,25 @@ var SelectRoot = (props) => {
|
|
|
8910
8873
|
children: selectedLabel ?? placeholder
|
|
8911
8874
|
}
|
|
8912
8875
|
),
|
|
8913
|
-
/* @__PURE__ */ (0,
|
|
8876
|
+
/* @__PURE__ */ (0, import_jsx_runtime333.jsx)(
|
|
8914
8877
|
"span",
|
|
8915
8878
|
{
|
|
8916
8879
|
className: clsx_default("select-trigger-icon", isOpen && "open"),
|
|
8917
8880
|
"aria-hidden": true,
|
|
8918
|
-
children: /* @__PURE__ */ (0,
|
|
8881
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime333.jsx)(ChevronDownIcon_default, {})
|
|
8919
8882
|
}
|
|
8920
8883
|
)
|
|
8921
8884
|
]
|
|
8922
8885
|
}
|
|
8923
8886
|
),
|
|
8924
|
-
mounted && /* @__PURE__ */ (0,
|
|
8887
|
+
mounted && /* @__PURE__ */ (0, import_jsx_runtime333.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime333.jsx)(
|
|
8925
8888
|
"div",
|
|
8926
8889
|
{
|
|
8927
8890
|
className: clsx_default("lib-xplat-select-content", position.direction, stateClass),
|
|
8928
8891
|
ref: contentRef,
|
|
8929
8892
|
style: { ...position.position, width: triggerRef.current?.offsetWidth },
|
|
8930
8893
|
role: "listbox",
|
|
8931
|
-
children: /* @__PURE__ */ (0,
|
|
8894
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime333.jsx)(context_default.Provider, { value: ctxValue, children: itemChildren })
|
|
8932
8895
|
}
|
|
8933
8896
|
) })
|
|
8934
8897
|
]
|
|
@@ -8942,7 +8905,7 @@ var Select = Object.assign(SelectRoot, {
|
|
|
8942
8905
|
var Select_default = Select;
|
|
8943
8906
|
|
|
8944
8907
|
// src/components/Skeleton/Skeleton.tsx
|
|
8945
|
-
var
|
|
8908
|
+
var import_jsx_runtime334 = require("react/jsx-runtime");
|
|
8946
8909
|
var SIZE_MAP = {
|
|
8947
8910
|
xs: "var(--spacing-size-1)",
|
|
8948
8911
|
sm: "var(--spacing-size-2)",
|
|
@@ -8958,7 +8921,7 @@ var Skeleton = (props) => {
|
|
|
8958
8921
|
...width != null && { width: SIZE_MAP[width] },
|
|
8959
8922
|
...height != null && { height: SIZE_MAP[height] }
|
|
8960
8923
|
};
|
|
8961
|
-
return /* @__PURE__ */ (0,
|
|
8924
|
+
return /* @__PURE__ */ (0, import_jsx_runtime334.jsx)(
|
|
8962
8925
|
"div",
|
|
8963
8926
|
{
|
|
8964
8927
|
className: clsx_default("lib-xplat-skeleton", variant),
|
|
@@ -8971,20 +8934,20 @@ Skeleton.displayName = "Skeleton";
|
|
|
8971
8934
|
var Skeleton_default = Skeleton;
|
|
8972
8935
|
|
|
8973
8936
|
// src/components/Spinner/Spinner.tsx
|
|
8974
|
-
var
|
|
8937
|
+
var import_jsx_runtime335 = require("react/jsx-runtime");
|
|
8975
8938
|
var Spinner = (props) => {
|
|
8976
8939
|
const {
|
|
8977
8940
|
size = "md",
|
|
8978
8941
|
type = "brand"
|
|
8979
8942
|
} = props;
|
|
8980
|
-
return /* @__PURE__ */ (0,
|
|
8943
|
+
return /* @__PURE__ */ (0, import_jsx_runtime335.jsx)(
|
|
8981
8944
|
"div",
|
|
8982
8945
|
{
|
|
8983
8946
|
className: clsx_default("lib-xplat-spinner", size, type),
|
|
8984
8947
|
role: "status",
|
|
8985
8948
|
"aria-label": "\uB85C\uB529 \uC911",
|
|
8986
|
-
children: /* @__PURE__ */ (0,
|
|
8987
|
-
/* @__PURE__ */ (0,
|
|
8949
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime335.jsxs)("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
8950
|
+
/* @__PURE__ */ (0, import_jsx_runtime335.jsx)(
|
|
8988
8951
|
"circle",
|
|
8989
8952
|
{
|
|
8990
8953
|
className: "track",
|
|
@@ -8994,7 +8957,7 @@ var Spinner = (props) => {
|
|
|
8994
8957
|
strokeWidth: "3"
|
|
8995
8958
|
}
|
|
8996
8959
|
),
|
|
8997
|
-
/* @__PURE__ */ (0,
|
|
8960
|
+
/* @__PURE__ */ (0, import_jsx_runtime335.jsx)(
|
|
8998
8961
|
"circle",
|
|
8999
8962
|
{
|
|
9000
8963
|
className: "indicator",
|
|
@@ -9013,20 +8976,20 @@ Spinner.displayName = "Spinner";
|
|
|
9013
8976
|
var Spinner_default = Spinner;
|
|
9014
8977
|
|
|
9015
8978
|
// src/components/Steps/Steps.tsx
|
|
9016
|
-
var
|
|
8979
|
+
var import_jsx_runtime336 = require("react/jsx-runtime");
|
|
9017
8980
|
var Steps = (props) => {
|
|
9018
8981
|
const {
|
|
9019
8982
|
items,
|
|
9020
8983
|
current,
|
|
9021
8984
|
type = "brand"
|
|
9022
8985
|
} = props;
|
|
9023
|
-
return /* @__PURE__ */ (0,
|
|
8986
|
+
return /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("div", { className: clsx_default("lib-xplat-steps", type), children: items.map((item, index) => {
|
|
9024
8987
|
const status = index < current ? "completed" : index === current ? "active" : "pending";
|
|
9025
|
-
return /* @__PURE__ */ (0,
|
|
9026
|
-
/* @__PURE__ */ (0,
|
|
9027
|
-
/* @__PURE__ */ (0,
|
|
9028
|
-
/* @__PURE__ */ (0,
|
|
9029
|
-
item.description && /* @__PURE__ */ (0,
|
|
8988
|
+
return /* @__PURE__ */ (0, import_jsx_runtime336.jsxs)("div", { className: clsx_default("step-item", status), children: [
|
|
8989
|
+
/* @__PURE__ */ (0, import_jsx_runtime336.jsx)("div", { className: "step-circle", children: status === "completed" ? /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(CheckIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("span", { children: index + 1 }) }),
|
|
8990
|
+
/* @__PURE__ */ (0, import_jsx_runtime336.jsxs)("div", { className: "step-content", children: [
|
|
8991
|
+
/* @__PURE__ */ (0, import_jsx_runtime336.jsx)("span", { className: "step-title", children: item.title }),
|
|
8992
|
+
item.description && /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("span", { className: "step-description", children: item.description })
|
|
9030
8993
|
] })
|
|
9031
8994
|
] }, index);
|
|
9032
8995
|
}) });
|
|
@@ -9035,8 +8998,8 @@ Steps.displayName = "Steps";
|
|
|
9035
8998
|
var Steps_default = Steps;
|
|
9036
8999
|
|
|
9037
9000
|
// src/components/Swiper/Swiper.tsx
|
|
9038
|
-
var
|
|
9039
|
-
var
|
|
9001
|
+
var import_react31 = __toESM(require("react"), 1);
|
|
9002
|
+
var import_jsx_runtime337 = require("react/jsx-runtime");
|
|
9040
9003
|
var Swiper = (props) => {
|
|
9041
9004
|
const {
|
|
9042
9005
|
auto = false,
|
|
@@ -9059,23 +9022,23 @@ var Swiper = (props) => {
|
|
|
9059
9022
|
const maxIndex = Math.max(0, totalSlides - viewItemCount);
|
|
9060
9023
|
const useLoop = loop && canSlide;
|
|
9061
9024
|
const cloneCount = useLoop ? totalSlides : 0;
|
|
9062
|
-
const extendedItems =
|
|
9025
|
+
const extendedItems = import_react31.default.useMemo(() => {
|
|
9063
9026
|
if (!useLoop) return items;
|
|
9064
9027
|
return [...items, ...items, ...items];
|
|
9065
9028
|
}, [items, useLoop]);
|
|
9066
9029
|
const initialIdx = Math.max(0, Math.min(indexProp ?? 0, maxIndex));
|
|
9067
|
-
const [innerIndex, setInnerIndex] =
|
|
9030
|
+
const [innerIndex, setInnerIndex] = import_react31.default.useState(
|
|
9068
9031
|
useLoop ? cloneCount + initialIdx : initialIdx
|
|
9069
9032
|
);
|
|
9070
|
-
const [isDragging, setIsDragging] =
|
|
9071
|
-
const [dragOffset, setDragOffset] =
|
|
9072
|
-
const [animated, setAnimated] =
|
|
9073
|
-
const [containerWidth, setContainerWidth] =
|
|
9074
|
-
const containerRef =
|
|
9075
|
-
const startXRef =
|
|
9076
|
-
const startTimeRef =
|
|
9077
|
-
const autoplayTimerRef =
|
|
9078
|
-
|
|
9033
|
+
const [isDragging, setIsDragging] = import_react31.default.useState(false);
|
|
9034
|
+
const [dragOffset, setDragOffset] = import_react31.default.useState(0);
|
|
9035
|
+
const [animated, setAnimated] = import_react31.default.useState(true);
|
|
9036
|
+
const [containerWidth, setContainerWidth] = import_react31.default.useState(0);
|
|
9037
|
+
const containerRef = import_react31.default.useRef(null);
|
|
9038
|
+
const startXRef = import_react31.default.useRef(0);
|
|
9039
|
+
const startTimeRef = import_react31.default.useRef(0);
|
|
9040
|
+
const autoplayTimerRef = import_react31.default.useRef(null);
|
|
9041
|
+
import_react31.default.useEffect(() => {
|
|
9079
9042
|
const el = containerRef.current;
|
|
9080
9043
|
if (!el) return;
|
|
9081
9044
|
const ro = new ResizeObserver((entries) => {
|
|
@@ -9094,7 +9057,7 @@ var Swiper = (props) => {
|
|
|
9094
9057
|
return ((inner - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
9095
9058
|
};
|
|
9096
9059
|
const realIndex = getRealIndex(innerIndex);
|
|
9097
|
-
const moveToInner =
|
|
9060
|
+
const moveToInner = import_react31.default.useCallback(
|
|
9098
9061
|
(idx, withAnim = true) => {
|
|
9099
9062
|
if (!useLoop) {
|
|
9100
9063
|
setAnimated(withAnim);
|
|
@@ -9122,7 +9085,7 @@ var Swiper = (props) => {
|
|
|
9122
9085
|
},
|
|
9123
9086
|
[useLoop, cloneCount, totalSlides]
|
|
9124
9087
|
);
|
|
9125
|
-
const handleTransitionEnd =
|
|
9088
|
+
const handleTransitionEnd = import_react31.default.useCallback(() => {
|
|
9126
9089
|
if (!useLoop) return;
|
|
9127
9090
|
const real = getRealIndex(innerIndex);
|
|
9128
9091
|
const canonical = cloneCount + real;
|
|
@@ -9132,7 +9095,7 @@ var Swiper = (props) => {
|
|
|
9132
9095
|
}
|
|
9133
9096
|
onChange?.(Math.min(real, maxIndex));
|
|
9134
9097
|
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange]);
|
|
9135
|
-
const slideTo =
|
|
9098
|
+
const slideTo = import_react31.default.useCallback(
|
|
9136
9099
|
(logicalIndex) => {
|
|
9137
9100
|
if (!canSlide) return;
|
|
9138
9101
|
const clamped = useLoop ? logicalIndex : Math.max(0, Math.min(logicalIndex, maxIndex));
|
|
@@ -9142,7 +9105,7 @@ var Swiper = (props) => {
|
|
|
9142
9105
|
},
|
|
9143
9106
|
[canSlide, useLoop, cloneCount, maxIndex, onChange, moveToInner]
|
|
9144
9107
|
);
|
|
9145
|
-
const slideNext =
|
|
9108
|
+
const slideNext = import_react31.default.useCallback(() => {
|
|
9146
9109
|
if (!canSlide) return;
|
|
9147
9110
|
const nextInner = innerIndex + slideBy;
|
|
9148
9111
|
if (useLoop) {
|
|
@@ -9151,7 +9114,7 @@ var Swiper = (props) => {
|
|
|
9151
9114
|
moveToInner(Math.min(nextInner, maxIndex), true);
|
|
9152
9115
|
}
|
|
9153
9116
|
}, [canSlide, useLoop, innerIndex, slideBy, maxIndex, moveToInner]);
|
|
9154
|
-
const slidePrev =
|
|
9117
|
+
const slidePrev = import_react31.default.useCallback(() => {
|
|
9155
9118
|
if (!canSlide) return;
|
|
9156
9119
|
const prevInner = innerIndex - slideBy;
|
|
9157
9120
|
if (useLoop) {
|
|
@@ -9160,7 +9123,7 @@ var Swiper = (props) => {
|
|
|
9160
9123
|
moveToInner(Math.max(prevInner, 0), true);
|
|
9161
9124
|
}
|
|
9162
9125
|
}, [canSlide, useLoop, innerIndex, slideBy, moveToInner]);
|
|
9163
|
-
|
|
9126
|
+
import_react31.default.useEffect(() => {
|
|
9164
9127
|
if (indexProp === void 0) return;
|
|
9165
9128
|
const clamped = Math.max(0, Math.min(indexProp, maxIndex));
|
|
9166
9129
|
const target = useLoop ? cloneCount + clamped : clamped;
|
|
@@ -9168,12 +9131,12 @@ var Swiper = (props) => {
|
|
|
9168
9131
|
moveToInner(target, true);
|
|
9169
9132
|
}
|
|
9170
9133
|
}, [indexProp]);
|
|
9171
|
-
|
|
9134
|
+
import_react31.default.useImperativeHandle(swiperRef, () => ({
|
|
9172
9135
|
slidePrev,
|
|
9173
9136
|
slideNext,
|
|
9174
9137
|
slideTo
|
|
9175
9138
|
}));
|
|
9176
|
-
|
|
9139
|
+
import_react31.default.useEffect(() => {
|
|
9177
9140
|
if (!auto || !canSlide) return;
|
|
9178
9141
|
autoplayTimerRef.current = setInterval(slideNext, autoplayDelay);
|
|
9179
9142
|
return () => {
|
|
@@ -9196,7 +9159,7 @@ var Swiper = (props) => {
|
|
|
9196
9159
|
startXRef.current = getClientX(e);
|
|
9197
9160
|
startTimeRef.current = Date.now();
|
|
9198
9161
|
};
|
|
9199
|
-
|
|
9162
|
+
import_react31.default.useEffect(() => {
|
|
9200
9163
|
if (!isDragging) return;
|
|
9201
9164
|
const handleMove = (e) => {
|
|
9202
9165
|
setDragOffset(getClientX(e) - startXRef.current);
|
|
@@ -9234,8 +9197,8 @@ var Swiper = (props) => {
|
|
|
9234
9197
|
}, [isDragging, dragOffset, innerIndex, useLoop, maxIndex, slideStep, moveToInner]);
|
|
9235
9198
|
const slideWidthPercent = 100 / viewItemCount;
|
|
9236
9199
|
const gapAdjust = spaceBetween * (viewItemCount - 1) / viewItemCount;
|
|
9237
|
-
const slideElements =
|
|
9238
|
-
() => extendedItems.map((item, idx) => /* @__PURE__ */ (0,
|
|
9200
|
+
const slideElements = import_react31.default.useMemo(
|
|
9201
|
+
() => extendedItems.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
9239
9202
|
"div",
|
|
9240
9203
|
{
|
|
9241
9204
|
className: "lib-xplat-swiper__slide",
|
|
@@ -9254,14 +9217,14 @@ var Swiper = (props) => {
|
|
|
9254
9217
|
Math.floor(realIndex / slideBy),
|
|
9255
9218
|
totalSteps - 1
|
|
9256
9219
|
);
|
|
9257
|
-
return /* @__PURE__ */ (0,
|
|
9258
|
-
/* @__PURE__ */ (0,
|
|
9220
|
+
return /* @__PURE__ */ (0, import_jsx_runtime337.jsxs)("div", { className: "lib-xplat-swiper", ref: containerRef, children: [
|
|
9221
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
9259
9222
|
"div",
|
|
9260
9223
|
{
|
|
9261
9224
|
className: "lib-xplat-swiper__viewport",
|
|
9262
9225
|
onMouseDown: handleDragStart,
|
|
9263
9226
|
onTouchStart: handleDragStart,
|
|
9264
|
-
children: /* @__PURE__ */ (0,
|
|
9227
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
9265
9228
|
"div",
|
|
9266
9229
|
{
|
|
9267
9230
|
className: clsx_default(
|
|
@@ -9279,7 +9242,7 @@ var Swiper = (props) => {
|
|
|
9279
9242
|
)
|
|
9280
9243
|
}
|
|
9281
9244
|
),
|
|
9282
|
-
showProgress && canSlide && /* @__PURE__ */ (0,
|
|
9245
|
+
showProgress && canSlide && /* @__PURE__ */ (0, import_jsx_runtime337.jsx)("div", { className: "lib-xplat-swiper__progress", children: /* @__PURE__ */ (0, import_jsx_runtime337.jsx)("div", { className: "lib-xplat-swiper__progress-track", children: /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
9283
9246
|
"span",
|
|
9284
9247
|
{
|
|
9285
9248
|
className: "lib-xplat-swiper__progress-fill",
|
|
@@ -9289,7 +9252,7 @@ var Swiper = (props) => {
|
|
|
9289
9252
|
}
|
|
9290
9253
|
}
|
|
9291
9254
|
) }) }),
|
|
9292
|
-
canSlide && /* @__PURE__ */ (0,
|
|
9255
|
+
canSlide && /* @__PURE__ */ (0, import_jsx_runtime337.jsx)("div", { className: "lib-xplat-swiper__dots", children: Array.from({ length: totalSteps }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
9293
9256
|
"button",
|
|
9294
9257
|
{
|
|
9295
9258
|
className: clsx_default(
|
|
@@ -9307,8 +9270,8 @@ Swiper.displayName = "Swiper";
|
|
|
9307
9270
|
var Swiper_default = Swiper;
|
|
9308
9271
|
|
|
9309
9272
|
// src/components/Switch/Switch.tsx
|
|
9310
|
-
var
|
|
9311
|
-
var
|
|
9273
|
+
var import_react32 = __toESM(require("react"), 1);
|
|
9274
|
+
var import_jsx_runtime338 = require("react/jsx-runtime");
|
|
9312
9275
|
var KNOB_TRANSITION_MS = 250;
|
|
9313
9276
|
var Switch = (props) => {
|
|
9314
9277
|
const {
|
|
@@ -9318,9 +9281,9 @@ var Switch = (props) => {
|
|
|
9318
9281
|
disabled,
|
|
9319
9282
|
onChange
|
|
9320
9283
|
} = props;
|
|
9321
|
-
const [isAnimating, setIsAnimating] =
|
|
9322
|
-
const timeoutRef =
|
|
9323
|
-
|
|
9284
|
+
const [isAnimating, setIsAnimating] = import_react32.default.useState(false);
|
|
9285
|
+
const timeoutRef = import_react32.default.useRef(null);
|
|
9286
|
+
import_react32.default.useEffect(() => {
|
|
9324
9287
|
return () => {
|
|
9325
9288
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
9326
9289
|
};
|
|
@@ -9335,7 +9298,7 @@ var Switch = (props) => {
|
|
|
9335
9298
|
timeoutRef.current = null;
|
|
9336
9299
|
}, KNOB_TRANSITION_MS);
|
|
9337
9300
|
};
|
|
9338
|
-
return /* @__PURE__ */ (0,
|
|
9301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime338.jsx)(
|
|
9339
9302
|
"div",
|
|
9340
9303
|
{
|
|
9341
9304
|
className: clsx_default(
|
|
@@ -9348,7 +9311,7 @@ var Switch = (props) => {
|
|
|
9348
9311
|
),
|
|
9349
9312
|
onClick: handleClick,
|
|
9350
9313
|
"aria-disabled": disabled || isAnimating,
|
|
9351
|
-
children: /* @__PURE__ */ (0,
|
|
9314
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime338.jsx)("div", { className: clsx_default("knob", value ? "checked" : void 0) })
|
|
9352
9315
|
}
|
|
9353
9316
|
);
|
|
9354
9317
|
};
|
|
@@ -9356,17 +9319,17 @@ Switch.displayName = "Switch";
|
|
|
9356
9319
|
var Switch_default = Switch;
|
|
9357
9320
|
|
|
9358
9321
|
// src/components/Table/TableContext.tsx
|
|
9359
|
-
var
|
|
9360
|
-
var TableContext =
|
|
9322
|
+
var import_react33 = __toESM(require("react"), 1);
|
|
9323
|
+
var TableContext = import_react33.default.createContext(null);
|
|
9361
9324
|
var useTableContext = () => {
|
|
9362
|
-
const ctx =
|
|
9325
|
+
const ctx = import_react33.default.useContext(TableContext);
|
|
9363
9326
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
9364
9327
|
return ctx;
|
|
9365
9328
|
};
|
|
9366
9329
|
var TableContext_default = TableContext;
|
|
9367
9330
|
|
|
9368
9331
|
// src/components/Table/Table.tsx
|
|
9369
|
-
var
|
|
9332
|
+
var import_jsx_runtime339 = require("react/jsx-runtime");
|
|
9370
9333
|
var Table = (props) => {
|
|
9371
9334
|
const {
|
|
9372
9335
|
children,
|
|
@@ -9376,7 +9339,7 @@ var Table = (props) => {
|
|
|
9376
9339
|
headerSticky = false,
|
|
9377
9340
|
stickyShadow = true
|
|
9378
9341
|
} = props;
|
|
9379
|
-
return /* @__PURE__ */ (0,
|
|
9342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime339.jsx)("div", { className: `lib-xplat-table-wrapper ${size}`, children: /* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
|
|
9380
9343
|
TableContext_default.Provider,
|
|
9381
9344
|
{
|
|
9382
9345
|
value: {
|
|
@@ -9385,7 +9348,7 @@ var Table = (props) => {
|
|
|
9385
9348
|
headerSticky,
|
|
9386
9349
|
stickyShadow
|
|
9387
9350
|
},
|
|
9388
|
-
children: /* @__PURE__ */ (0,
|
|
9351
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime339.jsx)("table", { className: "lib-xplat-table", children })
|
|
9389
9352
|
}
|
|
9390
9353
|
) });
|
|
9391
9354
|
};
|
|
@@ -9393,41 +9356,41 @@ Table.displayName = "Table";
|
|
|
9393
9356
|
var Table_default = Table;
|
|
9394
9357
|
|
|
9395
9358
|
// src/components/Table/TableBody.tsx
|
|
9396
|
-
var
|
|
9359
|
+
var import_jsx_runtime340 = require("react/jsx-runtime");
|
|
9397
9360
|
var TableBody = (props) => {
|
|
9398
9361
|
const { children } = props;
|
|
9399
|
-
return /* @__PURE__ */ (0,
|
|
9362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime340.jsx)("tbody", { children });
|
|
9400
9363
|
};
|
|
9401
9364
|
TableBody.displayName = "TableBody";
|
|
9402
9365
|
var TableBody_default = TableBody;
|
|
9403
9366
|
|
|
9404
9367
|
// src/components/Table/TableCell.tsx
|
|
9405
|
-
var
|
|
9368
|
+
var import_react36 = __toESM(require("react"), 1);
|
|
9406
9369
|
|
|
9407
9370
|
// src/components/Table/TableHeadContext.tsx
|
|
9408
|
-
var
|
|
9409
|
-
var TableHeadContext =
|
|
9371
|
+
var import_react34 = __toESM(require("react"), 1);
|
|
9372
|
+
var TableHeadContext = import_react34.default.createContext(
|
|
9410
9373
|
null
|
|
9411
9374
|
);
|
|
9412
9375
|
var useTableHeadContext = () => {
|
|
9413
|
-
const ctx =
|
|
9376
|
+
const ctx = import_react34.default.useContext(TableHeadContext);
|
|
9414
9377
|
return ctx;
|
|
9415
9378
|
};
|
|
9416
9379
|
var TableHeadContext_default = TableHeadContext;
|
|
9417
9380
|
|
|
9418
9381
|
// src/components/Table/TableRowContext.tsx
|
|
9419
|
-
var
|
|
9420
|
-
var TableRowContext =
|
|
9382
|
+
var import_react35 = __toESM(require("react"), 1);
|
|
9383
|
+
var TableRowContext = import_react35.default.createContext(null);
|
|
9421
9384
|
var useTableRowContext = () => {
|
|
9422
|
-
const ctx =
|
|
9385
|
+
const ctx = import_react35.default.useContext(TableRowContext);
|
|
9423
9386
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
9424
9387
|
return ctx;
|
|
9425
9388
|
};
|
|
9426
9389
|
var TableRowContext_default = TableRowContext;
|
|
9427
9390
|
|
|
9428
9391
|
// src/components/Table/TableCell.tsx
|
|
9429
|
-
var
|
|
9430
|
-
var TableCell =
|
|
9392
|
+
var import_jsx_runtime341 = require("react/jsx-runtime");
|
|
9393
|
+
var TableCell = import_react36.default.memo((props) => {
|
|
9431
9394
|
const {
|
|
9432
9395
|
children,
|
|
9433
9396
|
align = "center",
|
|
@@ -9439,9 +9402,9 @@ var TableCell = import_react37.default.memo((props) => {
|
|
|
9439
9402
|
const { registerStickyCell, stickyCells } = useTableRowContext();
|
|
9440
9403
|
const { stickyShadow } = useTableContext();
|
|
9441
9404
|
const headContext = useTableHeadContext();
|
|
9442
|
-
const [left, setLeft] =
|
|
9443
|
-
const cellRef =
|
|
9444
|
-
const calculateLeft =
|
|
9405
|
+
const [left, setLeft] = import_react36.default.useState(0);
|
|
9406
|
+
const cellRef = import_react36.default.useRef(null);
|
|
9407
|
+
const calculateLeft = import_react36.default.useCallback(() => {
|
|
9445
9408
|
if (!cellRef.current) return 0;
|
|
9446
9409
|
let totalLeft = 0;
|
|
9447
9410
|
for (const ref of stickyCells) {
|
|
@@ -9450,7 +9413,7 @@ var TableCell = import_react37.default.memo((props) => {
|
|
|
9450
9413
|
}
|
|
9451
9414
|
return totalLeft;
|
|
9452
9415
|
}, [stickyCells]);
|
|
9453
|
-
|
|
9416
|
+
import_react36.default.useEffect(() => {
|
|
9454
9417
|
if (!isSticky || !cellRef.current) return;
|
|
9455
9418
|
registerStickyCell(cellRef);
|
|
9456
9419
|
setLeft(calculateLeft());
|
|
@@ -9468,7 +9431,7 @@ var TableCell = import_react37.default.memo((props) => {
|
|
|
9468
9431
|
const CellTag = cellRef.current?.tagName === "TH" ? "th" : "td";
|
|
9469
9432
|
const isLastSticky = isSticky && stickyCells[stickyCells.length - 1] === cellRef;
|
|
9470
9433
|
const enableHover = headContext && headContext.cellHover;
|
|
9471
|
-
return /* @__PURE__ */ (0,
|
|
9434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime341.jsx)(
|
|
9472
9435
|
CellTag,
|
|
9473
9436
|
{
|
|
9474
9437
|
ref: cellRef,
|
|
@@ -9493,21 +9456,21 @@ TableCell.displayName = "TableCell";
|
|
|
9493
9456
|
var TableCell_default = TableCell;
|
|
9494
9457
|
|
|
9495
9458
|
// src/components/Table/TableHead.tsx
|
|
9496
|
-
var
|
|
9459
|
+
var import_jsx_runtime342 = require("react/jsx-runtime");
|
|
9497
9460
|
var TableHead = ({
|
|
9498
9461
|
children,
|
|
9499
9462
|
cellHover = false
|
|
9500
9463
|
}) => {
|
|
9501
9464
|
const { headerSticky } = useTableContext();
|
|
9502
|
-
return /* @__PURE__ */ (0,
|
|
9465
|
+
return /* @__PURE__ */ (0, import_jsx_runtime342.jsx)(TableHeadContext_default.Provider, { value: { cellHover }, children: /* @__PURE__ */ (0, import_jsx_runtime342.jsx)("thead", { className: clsx_default(headerSticky ? "table-sticky" : null), children }) });
|
|
9503
9466
|
};
|
|
9504
9467
|
TableHead.displayName = "TableHead";
|
|
9505
9468
|
var TableHead_default = TableHead;
|
|
9506
9469
|
|
|
9507
9470
|
// src/components/Table/TableRow.tsx
|
|
9508
|
-
var
|
|
9509
|
-
var
|
|
9510
|
-
var TableRow =
|
|
9471
|
+
var import_react37 = __toESM(require("react"), 1);
|
|
9472
|
+
var import_jsx_runtime343 = require("react/jsx-runtime");
|
|
9473
|
+
var TableRow = import_react37.default.memo((props) => {
|
|
9511
9474
|
const {
|
|
9512
9475
|
children,
|
|
9513
9476
|
type = "secondary",
|
|
@@ -9515,14 +9478,14 @@ var TableRow = import_react38.default.memo((props) => {
|
|
|
9515
9478
|
onClick
|
|
9516
9479
|
} = props;
|
|
9517
9480
|
const { rowBorderUse } = useTableContext();
|
|
9518
|
-
const [stickyCells, setStickyCells] =
|
|
9481
|
+
const [stickyCells, setStickyCells] = import_react37.default.useState([]);
|
|
9519
9482
|
const registerStickyCell = (ref) => {
|
|
9520
9483
|
setStickyCells((prev) => {
|
|
9521
9484
|
if (prev.includes(ref)) return prev;
|
|
9522
9485
|
return [...prev, ref];
|
|
9523
9486
|
});
|
|
9524
9487
|
};
|
|
9525
|
-
return /* @__PURE__ */ (0,
|
|
9488
|
+
return /* @__PURE__ */ (0, import_jsx_runtime343.jsx)(TableRowContext_default.Provider, { value: { stickyCells, registerStickyCell }, children: /* @__PURE__ */ (0, import_jsx_runtime343.jsx)(
|
|
9526
9489
|
"tr",
|
|
9527
9490
|
{
|
|
9528
9491
|
className: clsx_default(
|
|
@@ -9540,7 +9503,7 @@ TableRow.displayName = "TableRow";
|
|
|
9540
9503
|
var TableRow_default = TableRow;
|
|
9541
9504
|
|
|
9542
9505
|
// src/components/Tag/Tag.tsx
|
|
9543
|
-
var
|
|
9506
|
+
var import_jsx_runtime344 = require("react/jsx-runtime");
|
|
9544
9507
|
var Tag = (props) => {
|
|
9545
9508
|
const {
|
|
9546
9509
|
children,
|
|
@@ -9550,7 +9513,7 @@ var Tag = (props) => {
|
|
|
9550
9513
|
disabled = false,
|
|
9551
9514
|
colorIndex
|
|
9552
9515
|
} = props;
|
|
9553
|
-
return /* @__PURE__ */ (0,
|
|
9516
|
+
return /* @__PURE__ */ (0, import_jsx_runtime344.jsxs)(
|
|
9554
9517
|
"span",
|
|
9555
9518
|
{
|
|
9556
9519
|
className: clsx_default(
|
|
@@ -9561,8 +9524,8 @@ var Tag = (props) => {
|
|
|
9561
9524
|
disabled && "disabled"
|
|
9562
9525
|
),
|
|
9563
9526
|
children: [
|
|
9564
|
-
/* @__PURE__ */ (0,
|
|
9565
|
-
onClose && /* @__PURE__ */ (0,
|
|
9527
|
+
/* @__PURE__ */ (0, import_jsx_runtime344.jsx)("span", { className: "tag-label", children }),
|
|
9528
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime344.jsx)("button", { className: "tag-close", onClick: onClose, "aria-label": "\uC0AD\uC81C", disabled, children: /* @__PURE__ */ (0, import_jsx_runtime344.jsx)(XIcon_default, {}) })
|
|
9566
9529
|
]
|
|
9567
9530
|
}
|
|
9568
9531
|
);
|
|
@@ -9570,6 +9533,63 @@ var Tag = (props) => {
|
|
|
9570
9533
|
Tag.displayName = "Tag";
|
|
9571
9534
|
var Tag_default = Tag;
|
|
9572
9535
|
|
|
9536
|
+
// src/components/TextArea/TextArea.tsx
|
|
9537
|
+
var import_react38 = __toESM(require("react"), 1);
|
|
9538
|
+
var import_jsx_runtime345 = require("react/jsx-runtime");
|
|
9539
|
+
var TextArea = import_react38.default.forwardRef(
|
|
9540
|
+
(props, ref) => {
|
|
9541
|
+
const { value, onChange, disabled, ...textareaProps } = props;
|
|
9542
|
+
const localRef = import_react38.default.useRef(null);
|
|
9543
|
+
const setRefs = (el) => {
|
|
9544
|
+
localRef.current = el;
|
|
9545
|
+
if (!ref) return;
|
|
9546
|
+
if (typeof ref === "function") {
|
|
9547
|
+
ref(el);
|
|
9548
|
+
} else if (ref && typeof ref === "object" && "current" in ref) {
|
|
9549
|
+
ref.current = el;
|
|
9550
|
+
}
|
|
9551
|
+
};
|
|
9552
|
+
const handleOnChange = (e) => {
|
|
9553
|
+
const val = e.target.value;
|
|
9554
|
+
if (onChange) {
|
|
9555
|
+
const event = {
|
|
9556
|
+
...e,
|
|
9557
|
+
target: { value: val }
|
|
9558
|
+
};
|
|
9559
|
+
onChange(event);
|
|
9560
|
+
}
|
|
9561
|
+
};
|
|
9562
|
+
import_react38.default.useEffect(() => {
|
|
9563
|
+
const el = localRef.current;
|
|
9564
|
+
if (!el) return;
|
|
9565
|
+
el.style.height = "0px";
|
|
9566
|
+
const nextHeight = Math.min(el.scrollHeight, 400);
|
|
9567
|
+
el.style.height = `${nextHeight}px`;
|
|
9568
|
+
}, [value]);
|
|
9569
|
+
return /* @__PURE__ */ (0, import_jsx_runtime345.jsx)("div", { className: "lib-xplat-textarea-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime345.jsx)(
|
|
9570
|
+
"div",
|
|
9571
|
+
{
|
|
9572
|
+
className: clsx_default(
|
|
9573
|
+
"lib-xplat-textarea",
|
|
9574
|
+
disabled ? "disabled" : void 0
|
|
9575
|
+
),
|
|
9576
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime345.jsx)(
|
|
9577
|
+
"textarea",
|
|
9578
|
+
{
|
|
9579
|
+
...textareaProps,
|
|
9580
|
+
ref: setRefs,
|
|
9581
|
+
disabled,
|
|
9582
|
+
value,
|
|
9583
|
+
onChange: handleOnChange
|
|
9584
|
+
}
|
|
9585
|
+
)
|
|
9586
|
+
}
|
|
9587
|
+
) });
|
|
9588
|
+
}
|
|
9589
|
+
);
|
|
9590
|
+
TextArea.displayName = "TextArea";
|
|
9591
|
+
var TextArea_default = TextArea;
|
|
9592
|
+
|
|
9573
9593
|
// src/components/Toast/Toast.tsx
|
|
9574
9594
|
var import_react39 = __toESM(require("react"), 1);
|
|
9575
9595
|
var import_react_dom4 = require("react-dom");
|