@x-plat/design-system 0.7.2 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AutoResizeTextArea/index.css +2 -0
- package/dist/components/Button/index.css +2 -1
- package/dist/components/Button/index.d.cts +6 -0
- package/dist/components/Button/index.d.ts +6 -0
- package/dist/components/Chart/index.cjs +8 -1
- package/dist/components/Chart/index.js +8 -1
- package/dist/components/ChatInput/index.css +4 -0
- package/dist/components/DatePicker/index.cjs +388 -400
- package/dist/components/DatePicker/index.css +7 -1
- package/dist/components/DatePicker/index.js +375 -387
- package/dist/components/Dropdown/index.cjs +21 -26
- package/dist/components/Dropdown/index.js +20 -25
- package/dist/components/Input/index.css +2 -0
- package/dist/components/Link/index.cjs +64 -0
- package/dist/components/Link/index.css +25 -0
- package/dist/components/Link/index.d.cts +27 -0
- package/dist/components/Link/index.d.ts +27 -0
- package/dist/components/Link/index.js +37 -0
- package/dist/components/LinkButton/index.cjs +64 -0
- package/dist/components/LinkButton/index.css +106 -0
- package/dist/components/LinkButton/index.d.cts +28 -0
- package/dist/components/LinkButton/index.d.ts +28 -0
- package/dist/components/LinkButton/index.js +37 -0
- package/dist/components/Modal/index.cjs +18 -28
- package/dist/components/Modal/index.css +3 -0
- package/dist/components/Modal/index.js +17 -27
- package/dist/components/PopOver/index.cjs +18 -23
- package/dist/components/PopOver/index.js +17 -22
- package/dist/components/Select/index.cjs +337 -342
- package/dist/components/Select/index.js +336 -341
- package/dist/components/TextArea/index.css +2 -0
- package/dist/components/Tooltip/index.cjs +92 -52
- package/dist/components/Tooltip/index.d.cts +10 -2
- package/dist/components/Tooltip/index.d.ts +10 -2
- package/dist/components/Tooltip/index.js +91 -51
- package/dist/components/index.cjs +578 -488
- package/dist/components/index.css +39 -1
- package/dist/components/index.d.cts +2 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +527 -439
- package/dist/index.cjs +602 -512
- package/dist/index.css +39 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +549 -461
- package/guidelines/AGENT_PROMPT.md +2 -2
- package/guidelines/Guidelines.md +2 -1
- package/guidelines/components/button.md +54 -0
- package/guidelines/components/card.md +15 -19
- package/guidelines/components/link.md +35 -0
- package/guidelines/components/overlay.md +30 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -216,7 +216,9 @@ __export(index_exports, {
|
|
|
216
216
|
Layout: () => Layout_default,
|
|
217
217
|
LayoutIcon: () => LayoutIcon_default,
|
|
218
218
|
LifeBuoyIcon: () => LifeBuoyIcon_default,
|
|
219
|
+
Link: () => Link_default,
|
|
219
220
|
Link2Icon: () => Link2Icon_default,
|
|
221
|
+
LinkButton: () => LinkButton_default,
|
|
220
222
|
LinkIcon: () => LinkIcon_default,
|
|
221
223
|
LinkedinIcon: () => LinkedinIcon_default,
|
|
222
224
|
ListIcon: () => ListIcon_default,
|
|
@@ -6699,9 +6701,16 @@ var useChartTooltip = (enabled) => {
|
|
|
6699
6701
|
}, []);
|
|
6700
6702
|
return { tooltip, show, hide, move, containerRef };
|
|
6701
6703
|
};
|
|
6704
|
+
var formatTick = (value, maxVal) => {
|
|
6705
|
+
const step = maxVal / 4;
|
|
6706
|
+
if (!Number.isFinite(step) || step <= 0) return "0";
|
|
6707
|
+
const decimals = step >= 1 ? 0 : Math.min(4, Math.ceil(-Math.log10(step)));
|
|
6708
|
+
const fixed = value.toFixed(decimals);
|
|
6709
|
+
return decimals === 0 ? Number(fixed).toLocaleString("en-US") : fixed;
|
|
6710
|
+
};
|
|
6702
6711
|
var GridLines = import_react6.default.memo(({ width, height, chartH, maxVal }) => /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(import_jsx_runtime305.Fragment, { children: [0, 0.25, 0.5, 0.75, 1].map((ratio) => {
|
|
6703
6712
|
const y = PADDING.top + (1 - ratio) * chartH;
|
|
6704
|
-
const val =
|
|
6713
|
+
const val = formatTick(maxVal * ratio, maxVal);
|
|
6705
6714
|
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { children: [
|
|
6706
6715
|
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
|
|
6707
6716
|
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
|
|
@@ -7384,7 +7393,7 @@ Chip.displayName = "Chip";
|
|
|
7384
7393
|
var Chip_default = Chip;
|
|
7385
7394
|
|
|
7386
7395
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
7387
|
-
var
|
|
7396
|
+
var import_react13 = __toESM(require("react"), 1);
|
|
7388
7397
|
|
|
7389
7398
|
// src/components/Input/Input.tsx
|
|
7390
7399
|
var import_react8 = __toESM(require("react"), 1);
|
|
@@ -7575,38 +7584,26 @@ PasswordInput.displayName = "PasswordInput";
|
|
|
7575
7584
|
var PasswordInput_default = PasswordInput;
|
|
7576
7585
|
|
|
7577
7586
|
// src/components/Modal/Modal.tsx
|
|
7578
|
-
var import_react12 = __toESM(require("react"), 1);
|
|
7579
|
-
var import_react_dom2 = require("react-dom");
|
|
7580
|
-
|
|
7581
|
-
// src/tokens/hooks/Portal.tsx
|
|
7582
7587
|
var import_react11 = __toESM(require("react"), 1);
|
|
7583
|
-
var import_react_dom =
|
|
7588
|
+
var import_react_dom = require("react-dom");
|
|
7584
7589
|
var import_jsx_runtime313 = require("react/jsx-runtime");
|
|
7585
|
-
var PortalContainerContext = import_react11.default.createContext(null);
|
|
7586
|
-
var PortalProvider = ({ container, children }) => /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(PortalContainerContext.Provider, { value: container, children });
|
|
7587
|
-
var Portal = ({ children }) => {
|
|
7588
|
-
const contextContainer = import_react11.default.useContext(PortalContainerContext);
|
|
7589
|
-
if (typeof document === "undefined") return null;
|
|
7590
|
-
const container = contextContainer ?? document.body;
|
|
7591
|
-
return import_react_dom.default.createPortal(children, container);
|
|
7592
|
-
};
|
|
7593
|
-
Portal.displayName = "Portal";
|
|
7594
|
-
var Portal_default = Portal;
|
|
7595
|
-
|
|
7596
|
-
// src/components/Modal/Modal.tsx
|
|
7597
|
-
var import_jsx_runtime314 = require("react/jsx-runtime");
|
|
7598
7590
|
var ANIMATION_DURATION_MS = 200;
|
|
7599
7591
|
var Modal = (props) => {
|
|
7600
7592
|
const { isOpen, onClose, children } = props;
|
|
7601
|
-
const [mounted, setMounted] =
|
|
7602
|
-
const [visible, setVisible] =
|
|
7603
|
-
const
|
|
7604
|
-
|
|
7593
|
+
const [mounted, setMounted] = import_react11.default.useState(false);
|
|
7594
|
+
const [visible, setVisible] = import_react11.default.useState(false);
|
|
7595
|
+
const [settled, setSettled] = import_react11.default.useState(false);
|
|
7596
|
+
import_react11.default.useEffect(() => {
|
|
7605
7597
|
if (isOpen) {
|
|
7606
7598
|
setMounted(true);
|
|
7607
|
-
const
|
|
7608
|
-
|
|
7599
|
+
const show = setTimeout(() => setVisible(true), 1);
|
|
7600
|
+
const settle = setTimeout(() => setSettled(true), ANIMATION_DURATION_MS + 50);
|
|
7601
|
+
return () => {
|
|
7602
|
+
clearTimeout(show);
|
|
7603
|
+
clearTimeout(settle);
|
|
7604
|
+
};
|
|
7609
7605
|
}
|
|
7606
|
+
setSettled(false);
|
|
7610
7607
|
setVisible(false);
|
|
7611
7608
|
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS);
|
|
7612
7609
|
return () => clearTimeout(t);
|
|
@@ -7614,21 +7611,20 @@ var Modal = (props) => {
|
|
|
7614
7611
|
if (typeof document === "undefined") return null;
|
|
7615
7612
|
if (!mounted) return null;
|
|
7616
7613
|
const stateClass = visible ? "enter" : "exit";
|
|
7617
|
-
return (0,
|
|
7618
|
-
/* @__PURE__ */ (0,
|
|
7614
|
+
return (0, import_react_dom.createPortal)(
|
|
7615
|
+
/* @__PURE__ */ (0, import_jsx_runtime313.jsx)(
|
|
7619
7616
|
"div",
|
|
7620
7617
|
{
|
|
7621
7618
|
className: clsx_default("lib-xplat-modal", "dim", stateClass),
|
|
7622
7619
|
onClick: onClose,
|
|
7623
|
-
children: /* @__PURE__ */ (0,
|
|
7620
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(
|
|
7624
7621
|
"div",
|
|
7625
7622
|
{
|
|
7626
|
-
|
|
7627
|
-
className: clsx_default("lib-xplat-modal", "modal-box", stateClass),
|
|
7623
|
+
className: clsx_default("lib-xplat-modal", "modal-box", stateClass, settled && "settled"),
|
|
7628
7624
|
role: "dialog",
|
|
7629
7625
|
"aria-modal": "true",
|
|
7630
7626
|
onClick: (e) => e.stopPropagation(),
|
|
7631
|
-
children
|
|
7627
|
+
children
|
|
7632
7628
|
}
|
|
7633
7629
|
)
|
|
7634
7630
|
}
|
|
@@ -7640,9 +7636,9 @@ Modal.displayName = "Modal";
|
|
|
7640
7636
|
var Modal_default = Modal;
|
|
7641
7637
|
|
|
7642
7638
|
// src/components/DatePicker/SingleDatePicker/index.tsx
|
|
7643
|
-
var
|
|
7644
|
-
var
|
|
7645
|
-
var DayCell2 =
|
|
7639
|
+
var import_react12 = __toESM(require("react"), 1);
|
|
7640
|
+
var import_jsx_runtime314 = require("react/jsx-runtime");
|
|
7641
|
+
var DayCell2 = import_react12.default.memo(
|
|
7646
7642
|
({
|
|
7647
7643
|
day,
|
|
7648
7644
|
disabled,
|
|
@@ -7652,7 +7648,7 @@ var DayCell2 = import_react13.default.memo(
|
|
|
7652
7648
|
isEnd,
|
|
7653
7649
|
inRange,
|
|
7654
7650
|
onSelect
|
|
7655
|
-
}) => /* @__PURE__ */ (0,
|
|
7651
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
7656
7652
|
"button",
|
|
7657
7653
|
{
|
|
7658
7654
|
type: "button",
|
|
@@ -7694,26 +7690,26 @@ var SingleDatePicker = (props) => {
|
|
|
7694
7690
|
initialYear,
|
|
7695
7691
|
initialMonth
|
|
7696
7692
|
);
|
|
7697
|
-
const [pickerMode, setPickerMode] =
|
|
7698
|
-
const [yearRangeStart, setYearRangeStart] =
|
|
7693
|
+
const [pickerMode, setPickerMode] = import_react12.default.useState("days");
|
|
7694
|
+
const [yearRangeStart, setYearRangeStart] = import_react12.default.useState(
|
|
7699
7695
|
Math.floor((initialYear ?? (/* @__PURE__ */ new Date()).getFullYear()) / 12) * 12
|
|
7700
7696
|
);
|
|
7701
|
-
const minTime =
|
|
7697
|
+
const minTime = import_react12.default.useMemo(
|
|
7702
7698
|
() => minDate ? new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()).getTime() : -Infinity,
|
|
7703
7699
|
[minDate]
|
|
7704
7700
|
);
|
|
7705
|
-
const maxTime =
|
|
7701
|
+
const maxTime = import_react12.default.useMemo(
|
|
7706
7702
|
() => maxDate ? new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()).getTime() : Infinity,
|
|
7707
7703
|
[maxDate]
|
|
7708
7704
|
);
|
|
7709
|
-
const highlightSet =
|
|
7705
|
+
const highlightSet = import_react12.default.useMemo(() => {
|
|
7710
7706
|
const set = /* @__PURE__ */ new Set();
|
|
7711
7707
|
for (const h of highlightDates) {
|
|
7712
7708
|
set.add(`${h.getFullYear()}-${h.getMonth()}-${h.getDate()}`);
|
|
7713
7709
|
}
|
|
7714
7710
|
return set;
|
|
7715
7711
|
}, [highlightDates]);
|
|
7716
|
-
const handleSelect =
|
|
7712
|
+
const handleSelect = import_react12.default.useCallback(
|
|
7717
7713
|
(date) => {
|
|
7718
7714
|
onChange?.(date);
|
|
7719
7715
|
},
|
|
@@ -7750,20 +7746,20 @@ var SingleDatePicker = (props) => {
|
|
|
7750
7746
|
const monthLabels = MONTH_LABELS[locale];
|
|
7751
7747
|
const titleText = pickerMode === "days" ? locale === "ko" ? `${year}\uB144 ${monthLabels[month]}` : `${monthLabels[month]} ${year}` : pickerMode === "months" ? `${year}` : `${yearRangeStart} - ${yearRangeStart + 11}`;
|
|
7752
7748
|
const hasRange = rangeStart != null && rangeEnd != null;
|
|
7753
|
-
return /* @__PURE__ */ (0,
|
|
7749
|
+
return /* @__PURE__ */ (0, import_jsx_runtime314.jsxs)(
|
|
7754
7750
|
"div",
|
|
7755
7751
|
{
|
|
7756
7752
|
className: clsx_default("lib-xplat-datepicker", "single"),
|
|
7757
7753
|
children: [
|
|
7758
|
-
/* @__PURE__ */ (0,
|
|
7759
|
-
/* @__PURE__ */ (0,
|
|
7760
|
-
/* @__PURE__ */ (0,
|
|
7761
|
-
/* @__PURE__ */ (0,
|
|
7754
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsxs)("div", { className: "datepicker-header", children: [
|
|
7755
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)("button", { className: "datepicker-nav", onClick: handlePrev, type: "button", children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(ChevronLeftIcon_default, {}) }),
|
|
7756
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)("button", { className: "datepicker-title", onClick: handleTitleClick, type: "button", children: titleText }),
|
|
7757
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)("button", { className: "datepicker-nav", onClick: handleNext, type: "button", children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(ChevronRightIcon_default, {}) })
|
|
7762
7758
|
] }),
|
|
7763
|
-
/* @__PURE__ */ (0,
|
|
7764
|
-
pickerMode === "years" && /* @__PURE__ */ (0,
|
|
7759
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsxs)("div", { className: "datepicker-body", children: [
|
|
7760
|
+
pickerMode === "years" && /* @__PURE__ */ (0, import_jsx_runtime314.jsx)("div", { className: "datepicker-picker-grid", children: Array.from({ length: 12 }, (_, i) => {
|
|
7765
7761
|
const y = yearRangeStart + i;
|
|
7766
|
-
return /* @__PURE__ */ (0,
|
|
7762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
7767
7763
|
"button",
|
|
7768
7764
|
{
|
|
7769
7765
|
type: "button",
|
|
@@ -7774,7 +7770,7 @@ var SingleDatePicker = (props) => {
|
|
|
7774
7770
|
y
|
|
7775
7771
|
);
|
|
7776
7772
|
}) }),
|
|
7777
|
-
pickerMode === "months" && /* @__PURE__ */ (0,
|
|
7773
|
+
pickerMode === "months" && /* @__PURE__ */ (0, import_jsx_runtime314.jsx)("div", { className: "datepicker-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
7778
7774
|
"button",
|
|
7779
7775
|
{
|
|
7780
7776
|
type: "button",
|
|
@@ -7784,8 +7780,8 @@ var SingleDatePicker = (props) => {
|
|
|
7784
7780
|
},
|
|
7785
7781
|
i
|
|
7786
7782
|
)) }),
|
|
7787
|
-
pickerMode === "days" && /* @__PURE__ */ (0,
|
|
7788
|
-
/* @__PURE__ */ (0,
|
|
7783
|
+
pickerMode === "days" && /* @__PURE__ */ (0, import_jsx_runtime314.jsxs)(import_jsx_runtime314.Fragment, { children: [
|
|
7784
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)("div", { className: "datepicker-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
7789
7785
|
"div",
|
|
7790
7786
|
{
|
|
7791
7787
|
className: clsx_default(
|
|
@@ -7797,7 +7793,7 @@ var SingleDatePicker = (props) => {
|
|
|
7797
7793
|
},
|
|
7798
7794
|
label
|
|
7799
7795
|
)) }),
|
|
7800
|
-
/* @__PURE__ */ (0,
|
|
7796
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)("div", { className: "datepicker-grid", children: days.map((day, idx) => {
|
|
7801
7797
|
const t = day.date.getTime();
|
|
7802
7798
|
const disabled = t < minTime || t > maxTime;
|
|
7803
7799
|
const selected = value ? isSameDay(day.date, value) : false;
|
|
@@ -7807,7 +7803,7 @@ var SingleDatePicker = (props) => {
|
|
|
7807
7803
|
const isStart = hasRange ? isSameDay(day.date, rangeStart) : false;
|
|
7808
7804
|
const isEnd = hasRange ? isSameDay(day.date, rangeEnd) : false;
|
|
7809
7805
|
const inRangeVal = hasRange ? isInRange(day.date, rangeStart, rangeEnd) : false;
|
|
7810
|
-
return /* @__PURE__ */ (0,
|
|
7806
|
+
return /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
7811
7807
|
DayCell2,
|
|
7812
7808
|
{
|
|
7813
7809
|
day,
|
|
@@ -7832,7 +7828,7 @@ SingleDatePicker.displayName = "SingleDatePicker";
|
|
|
7832
7828
|
var SingleDatePicker_default = SingleDatePicker;
|
|
7833
7829
|
|
|
7834
7830
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
7835
|
-
var
|
|
7831
|
+
var import_jsx_runtime315 = require("react/jsx-runtime");
|
|
7836
7832
|
var formatDate = (date) => {
|
|
7837
7833
|
if (!date || !(date instanceof Date) || isNaN(date.getTime())) return "";
|
|
7838
7834
|
const y = date.getFullYear();
|
|
@@ -7842,8 +7838,8 @@ var formatDate = (date) => {
|
|
|
7842
7838
|
};
|
|
7843
7839
|
var InputDatePicker = (props) => {
|
|
7844
7840
|
const { value, onChange, minDate, maxDate, disabled, locale = "ko", placeholder } = props;
|
|
7845
|
-
const [isOpen, setIsOpen] =
|
|
7846
|
-
const [tempDate, setTempDate] =
|
|
7841
|
+
const [isOpen, setIsOpen] = import_react13.default.useState(false);
|
|
7842
|
+
const [tempDate, setTempDate] = import_react13.default.useState(value ?? /* @__PURE__ */ new Date());
|
|
7847
7843
|
const handleOpen = () => {
|
|
7848
7844
|
if (disabled) return;
|
|
7849
7845
|
setTempDate(value ?? /* @__PURE__ */ new Date());
|
|
@@ -7859,19 +7855,19 @@ var InputDatePicker = (props) => {
|
|
|
7859
7855
|
const handleClose = () => {
|
|
7860
7856
|
setIsOpen(false);
|
|
7861
7857
|
};
|
|
7862
|
-
return /* @__PURE__ */ (0,
|
|
7863
|
-
/* @__PURE__ */ (0,
|
|
7858
|
+
return /* @__PURE__ */ (0, import_jsx_runtime315.jsxs)("div", { className: clsx_default("lib-xplat-datepicker input-datepicker", disabled && "disabled"), children: [
|
|
7859
|
+
/* @__PURE__ */ (0, import_jsx_runtime315.jsx)("div", { className: "input-datepicker-trigger", onClick: handleOpen, children: /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(
|
|
7864
7860
|
Input_default,
|
|
7865
7861
|
{
|
|
7866
7862
|
value: formatDate(value),
|
|
7867
7863
|
placeholder,
|
|
7868
|
-
suffix: /* @__PURE__ */ (0,
|
|
7864
|
+
suffix: /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(CalenderIcon_default, {}),
|
|
7869
7865
|
disabled,
|
|
7870
7866
|
readOnly: true
|
|
7871
7867
|
}
|
|
7872
7868
|
) }),
|
|
7873
|
-
/* @__PURE__ */ (0,
|
|
7874
|
-
/* @__PURE__ */ (0,
|
|
7869
|
+
/* @__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: [
|
|
7870
|
+
/* @__PURE__ */ (0, import_jsx_runtime315.jsx)("div", { className: "popup-datepicker-content", children: /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(
|
|
7875
7871
|
SingleDatePicker_default,
|
|
7876
7872
|
{
|
|
7877
7873
|
value: tempDate,
|
|
@@ -7881,9 +7877,9 @@ var InputDatePicker = (props) => {
|
|
|
7881
7877
|
locale
|
|
7882
7878
|
}
|
|
7883
7879
|
) }),
|
|
7884
|
-
/* @__PURE__ */ (0,
|
|
7885
|
-
/* @__PURE__ */ (0,
|
|
7886
|
-
/* @__PURE__ */ (0,
|
|
7880
|
+
/* @__PURE__ */ (0, import_jsx_runtime315.jsxs)("div", { className: "popup-datepicker-footer", children: [
|
|
7881
|
+
/* @__PURE__ */ (0, import_jsx_runtime315.jsx)(Button_default, { type: "secondary", onClick: handleClose, children: locale === "ko" ? "\uCDE8\uC18C" : "Cancel" }),
|
|
7882
|
+
/* @__PURE__ */ (0, import_jsx_runtime315.jsx)(Button_default, { type: "primary", onClick: handleApply, children: locale === "ko" ? "\uC801\uC6A9" : "Apply" })
|
|
7887
7883
|
] })
|
|
7888
7884
|
] }) })
|
|
7889
7885
|
] });
|
|
@@ -7892,20 +7888,20 @@ InputDatePicker.displayName = "InputDatePicker";
|
|
|
7892
7888
|
var InputDatePicker_default = InputDatePicker;
|
|
7893
7889
|
|
|
7894
7890
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
7895
|
-
var
|
|
7891
|
+
var import_react17 = __toESM(require("react"), 1);
|
|
7896
7892
|
|
|
7897
7893
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
7898
|
-
var
|
|
7894
|
+
var import_react16 = __toESM(require("react"), 1);
|
|
7899
7895
|
|
|
7900
7896
|
// src/components/Tab/Tab.tsx
|
|
7901
|
-
var
|
|
7897
|
+
var import_react15 = __toESM(require("react"), 1);
|
|
7902
7898
|
|
|
7903
7899
|
// src/components/Tab/TabItem.tsx
|
|
7904
|
-
var
|
|
7905
|
-
var
|
|
7906
|
-
var TabItem =
|
|
7900
|
+
var import_react14 = __toESM(require("react"), 1);
|
|
7901
|
+
var import_jsx_runtime316 = require("react/jsx-runtime");
|
|
7902
|
+
var TabItem = import_react14.default.forwardRef((props, ref) => {
|
|
7907
7903
|
const { isActive: isActive2, title, onClick } = props;
|
|
7908
|
-
return /* @__PURE__ */ (0,
|
|
7904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime316.jsx)(
|
|
7909
7905
|
"div",
|
|
7910
7906
|
{
|
|
7911
7907
|
ref,
|
|
@@ -7919,25 +7915,25 @@ TabItem.displayName = "TabItem";
|
|
|
7919
7915
|
var TabItem_default = TabItem;
|
|
7920
7916
|
|
|
7921
7917
|
// src/components/Tab/Tab.tsx
|
|
7922
|
-
var
|
|
7918
|
+
var import_jsx_runtime317 = require("react/jsx-runtime");
|
|
7923
7919
|
var Tab = (props) => {
|
|
7924
7920
|
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
7925
|
-
const [underlineStyle, setUnderlineStyle] =
|
|
7921
|
+
const [underlineStyle, setUnderlineStyle] = import_react15.default.useState({
|
|
7926
7922
|
left: 0,
|
|
7927
7923
|
width: 0
|
|
7928
7924
|
});
|
|
7929
|
-
const itemRefs =
|
|
7925
|
+
const itemRefs = import_react15.default.useRef([]);
|
|
7930
7926
|
const handleChangeActiveTab = (tabItem, tabIdx) => {
|
|
7931
7927
|
onChange(tabItem, tabIdx);
|
|
7932
7928
|
};
|
|
7933
|
-
|
|
7929
|
+
import_react15.default.useEffect(() => {
|
|
7934
7930
|
const el = itemRefs.current[activeIndex];
|
|
7935
7931
|
if (el) {
|
|
7936
7932
|
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
7937
7933
|
}
|
|
7938
7934
|
}, [activeIndex, tabs.length]);
|
|
7939
|
-
return /* @__PURE__ */ (0,
|
|
7940
|
-
tabs.map((tab, idx) => /* @__PURE__ */ (0,
|
|
7935
|
+
return /* @__PURE__ */ (0, import_jsx_runtime317.jsxs)("div", { className: clsx_default("lib-xplat-tab", `type-${type}`, size), children: [
|
|
7936
|
+
tabs.map((tab, idx) => /* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
|
|
7941
7937
|
TabItem_default,
|
|
7942
7938
|
{
|
|
7943
7939
|
onClick: () => handleChangeActiveTab(tab, idx),
|
|
@@ -7949,7 +7945,7 @@ var Tab = (props) => {
|
|
|
7949
7945
|
},
|
|
7950
7946
|
`${tab.value}_${idx}`
|
|
7951
7947
|
)),
|
|
7952
|
-
type === "toggle" && /* @__PURE__ */ (0,
|
|
7948
|
+
type === "toggle" && /* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
|
|
7953
7949
|
"div",
|
|
7954
7950
|
{
|
|
7955
7951
|
className: "tab-toggle-underline",
|
|
@@ -7965,7 +7961,7 @@ Tab.displayName = "Tab";
|
|
|
7965
7961
|
var Tab_default = Tab;
|
|
7966
7962
|
|
|
7967
7963
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
7968
|
-
var
|
|
7964
|
+
var import_jsx_runtime318 = require("react/jsx-runtime");
|
|
7969
7965
|
var RangePicker = (props) => {
|
|
7970
7966
|
const {
|
|
7971
7967
|
startDate,
|
|
@@ -7975,7 +7971,7 @@ var RangePicker = (props) => {
|
|
|
7975
7971
|
maxDate,
|
|
7976
7972
|
locale = "ko"
|
|
7977
7973
|
} = props;
|
|
7978
|
-
const [activeTab, setActiveTab] =
|
|
7974
|
+
const [activeTab, setActiveTab] = import_react16.default.useState("start");
|
|
7979
7975
|
const handleStartChange = (date) => {
|
|
7980
7976
|
if (!date) return;
|
|
7981
7977
|
const newStart = date > endDate ? endDate : date;
|
|
@@ -7988,8 +7984,8 @@ var RangePicker = (props) => {
|
|
|
7988
7984
|
};
|
|
7989
7985
|
const startMaxDate = maxDate && endDate < maxDate ? endDate : endDate;
|
|
7990
7986
|
const endMinDate = minDate && startDate > minDate ? startDate : startDate;
|
|
7991
|
-
return /* @__PURE__ */ (0,
|
|
7992
|
-
/* @__PURE__ */ (0,
|
|
7987
|
+
return /* @__PURE__ */ (0, import_jsx_runtime318.jsxs)("div", { className: clsx_default("lib-xplat-datepicker", "range"), children: [
|
|
7988
|
+
/* @__PURE__ */ (0, import_jsx_runtime318.jsx)("div", { className: "datepicker-range-tabs", children: /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
|
|
7993
7989
|
Tab_default,
|
|
7994
7990
|
{
|
|
7995
7991
|
activeIndex: activeTab === "start" ? 0 : 1,
|
|
@@ -8002,8 +7998,8 @@ var RangePicker = (props) => {
|
|
|
8002
7998
|
size: "sm"
|
|
8003
7999
|
}
|
|
8004
8000
|
) }),
|
|
8005
|
-
/* @__PURE__ */ (0,
|
|
8006
|
-
/* @__PURE__ */ (0,
|
|
8001
|
+
/* @__PURE__ */ (0, import_jsx_runtime318.jsxs)("div", { className: "datepicker-range-panels", children: [
|
|
8002
|
+
/* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
|
|
8007
8003
|
SingleDatePicker_default,
|
|
8008
8004
|
{
|
|
8009
8005
|
value: startDate,
|
|
@@ -8015,7 +8011,7 @@ var RangePicker = (props) => {
|
|
|
8015
8011
|
locale
|
|
8016
8012
|
}
|
|
8017
8013
|
),
|
|
8018
|
-
/* @__PURE__ */ (0,
|
|
8014
|
+
/* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
|
|
8019
8015
|
SingleDatePicker_default,
|
|
8020
8016
|
{
|
|
8021
8017
|
value: endDate,
|
|
@@ -8028,7 +8024,7 @@ var RangePicker = (props) => {
|
|
|
8028
8024
|
}
|
|
8029
8025
|
)
|
|
8030
8026
|
] }),
|
|
8031
|
-
/* @__PURE__ */ (0,
|
|
8027
|
+
/* @__PURE__ */ (0, import_jsx_runtime318.jsx)("div", { className: "datepicker-range-mobile", children: activeTab === "start" ? /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
|
|
8032
8028
|
SingleDatePicker_default,
|
|
8033
8029
|
{
|
|
8034
8030
|
value: startDate,
|
|
@@ -8039,7 +8035,7 @@ var RangePicker = (props) => {
|
|
|
8039
8035
|
rangeEnd: endDate,
|
|
8040
8036
|
locale
|
|
8041
8037
|
}
|
|
8042
|
-
) : /* @__PURE__ */ (0,
|
|
8038
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
|
|
8043
8039
|
SingleDatePicker_default,
|
|
8044
8040
|
{
|
|
8045
8041
|
value: endDate,
|
|
@@ -8057,10 +8053,10 @@ RangePicker.displayName = "RangePicker";
|
|
|
8057
8053
|
var RangePicker_default = RangePicker;
|
|
8058
8054
|
|
|
8059
8055
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
8060
|
-
var
|
|
8056
|
+
var import_jsx_runtime319 = require("react/jsx-runtime");
|
|
8061
8057
|
var PopupPicker = (props) => {
|
|
8062
8058
|
const { component, type, locale } = props;
|
|
8063
|
-
const [isOpen, setIsOpen] =
|
|
8059
|
+
const [isOpen, setIsOpen] = import_react17.default.useState(false);
|
|
8064
8060
|
const handleClick = () => setIsOpen(true);
|
|
8065
8061
|
const handleClose = () => setIsOpen(false);
|
|
8066
8062
|
const handleSingleChange = (date) => {
|
|
@@ -8068,11 +8064,11 @@ var PopupPicker = (props) => {
|
|
|
8068
8064
|
props.onChange?.(date);
|
|
8069
8065
|
handleClose();
|
|
8070
8066
|
};
|
|
8071
|
-
return /* @__PURE__ */ (0,
|
|
8072
|
-
|
|
8073
|
-
/* @__PURE__ */ (0,
|
|
8074
|
-
/* @__PURE__ */ (0,
|
|
8075
|
-
type === "single" && /* @__PURE__ */ (0,
|
|
8067
|
+
return /* @__PURE__ */ (0, import_jsx_runtime319.jsxs)("div", { className: "lib-xplat-popup-datepicker", children: [
|
|
8068
|
+
import_react17.default.cloneElement(component, { onClick: handleClick }),
|
|
8069
|
+
/* @__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: [
|
|
8070
|
+
/* @__PURE__ */ (0, import_jsx_runtime319.jsxs)("div", { className: "popup-datepicker-content", children: [
|
|
8071
|
+
type === "single" && /* @__PURE__ */ (0, import_jsx_runtime319.jsx)(
|
|
8076
8072
|
SingleDatePicker_default,
|
|
8077
8073
|
{
|
|
8078
8074
|
value: props.value,
|
|
@@ -8082,7 +8078,7 @@ var PopupPicker = (props) => {
|
|
|
8082
8078
|
locale
|
|
8083
8079
|
}
|
|
8084
8080
|
),
|
|
8085
|
-
type === "range" && /* @__PURE__ */ (0,
|
|
8081
|
+
type === "range" && /* @__PURE__ */ (0, import_jsx_runtime319.jsx)(
|
|
8086
8082
|
RangePicker_default,
|
|
8087
8083
|
{
|
|
8088
8084
|
startDate: props.startDate,
|
|
@@ -8094,8 +8090,8 @@ var PopupPicker = (props) => {
|
|
|
8094
8090
|
}
|
|
8095
8091
|
)
|
|
8096
8092
|
] }),
|
|
8097
|
-
/* @__PURE__ */ (0,
|
|
8098
|
-
/* @__PURE__ */ (0,
|
|
8093
|
+
/* @__PURE__ */ (0, import_jsx_runtime319.jsxs)("div", { className: "popup-datepicker-footer", children: [
|
|
8094
|
+
/* @__PURE__ */ (0, import_jsx_runtime319.jsx)(
|
|
8099
8095
|
Button_default,
|
|
8100
8096
|
{
|
|
8101
8097
|
type: "secondary",
|
|
@@ -8103,7 +8099,7 @@ var PopupPicker = (props) => {
|
|
|
8103
8099
|
children: locale === "ko" ? "\uCDE8\uC18C" : "Cancel"
|
|
8104
8100
|
}
|
|
8105
8101
|
),
|
|
8106
|
-
/* @__PURE__ */ (0,
|
|
8102
|
+
/* @__PURE__ */ (0, import_jsx_runtime319.jsx)(Button_default, { type: "primary", onClick: handleClose, children: locale === "ko" ? "\uC801\uC6A9" : "Apply" })
|
|
8107
8103
|
] })
|
|
8108
8104
|
] }) })
|
|
8109
8105
|
] });
|
|
@@ -8112,10 +8108,10 @@ PopupPicker.displayName = "PopupPicker";
|
|
|
8112
8108
|
var PopupPicker_default = PopupPicker;
|
|
8113
8109
|
|
|
8114
8110
|
// src/components/Divider/Divider.tsx
|
|
8115
|
-
var
|
|
8111
|
+
var import_jsx_runtime320 = require("react/jsx-runtime");
|
|
8116
8112
|
var Divider = (props) => {
|
|
8117
8113
|
const { orientation = "horizontal" } = props;
|
|
8118
|
-
return /* @__PURE__ */ (0,
|
|
8114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(
|
|
8119
8115
|
"div",
|
|
8120
8116
|
{
|
|
8121
8117
|
className: clsx_default("lib-xplat-divider", orientation),
|
|
@@ -8128,15 +8124,15 @@ Divider.displayName = "Divider";
|
|
|
8128
8124
|
var Divider_default = Divider;
|
|
8129
8125
|
|
|
8130
8126
|
// src/components/Drawer/Drawer.tsx
|
|
8131
|
-
var
|
|
8132
|
-
var
|
|
8133
|
-
var
|
|
8127
|
+
var import_react18 = __toESM(require("react"), 1);
|
|
8128
|
+
var import_react_dom2 = require("react-dom");
|
|
8129
|
+
var import_jsx_runtime321 = require("react/jsx-runtime");
|
|
8134
8130
|
var ANIMATION_DURATION_MS2 = 250;
|
|
8135
8131
|
var Drawer = (props) => {
|
|
8136
8132
|
const { isOpen, onClose, placement = "right", size = "md", title, children } = props;
|
|
8137
|
-
const [mounted, setMounted] =
|
|
8138
|
-
const [visible, setVisible] =
|
|
8139
|
-
|
|
8133
|
+
const [mounted, setMounted] = import_react18.default.useState(false);
|
|
8134
|
+
const [visible, setVisible] = import_react18.default.useState(false);
|
|
8135
|
+
import_react18.default.useEffect(() => {
|
|
8140
8136
|
if (isOpen) {
|
|
8141
8137
|
setMounted(true);
|
|
8142
8138
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -8149,13 +8145,13 @@ var Drawer = (props) => {
|
|
|
8149
8145
|
if (typeof document === "undefined") return null;
|
|
8150
8146
|
if (!mounted) return null;
|
|
8151
8147
|
const stateClass = visible ? "enter" : "exit";
|
|
8152
|
-
return (0,
|
|
8153
|
-
/* @__PURE__ */ (0,
|
|
8148
|
+
return (0, import_react_dom2.createPortal)(
|
|
8149
|
+
/* @__PURE__ */ (0, import_jsx_runtime321.jsx)(
|
|
8154
8150
|
"div",
|
|
8155
8151
|
{
|
|
8156
8152
|
className: clsx_default("lib-xplat-drawer-overlay", stateClass),
|
|
8157
8153
|
onClick: onClose,
|
|
8158
|
-
children: /* @__PURE__ */ (0,
|
|
8154
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime321.jsxs)(
|
|
8159
8155
|
"div",
|
|
8160
8156
|
{
|
|
8161
8157
|
className: clsx_default("lib-xplat-drawer", placement, size, stateClass),
|
|
@@ -8163,11 +8159,11 @@ var Drawer = (props) => {
|
|
|
8163
8159
|
"aria-modal": "true",
|
|
8164
8160
|
onClick: (e) => e.stopPropagation(),
|
|
8165
8161
|
children: [
|
|
8166
|
-
title && /* @__PURE__ */ (0,
|
|
8167
|
-
/* @__PURE__ */ (0,
|
|
8168
|
-
/* @__PURE__ */ (0,
|
|
8162
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime321.jsxs)("div", { className: "drawer-header", children: [
|
|
8163
|
+
/* @__PURE__ */ (0, import_jsx_runtime321.jsx)("span", { className: "drawer-title", children: title }),
|
|
8164
|
+
/* @__PURE__ */ (0, import_jsx_runtime321.jsx)("button", { className: "close-btn", onClick: onClose, "aria-label": "\uB2EB\uAE30", children: "\xD7" })
|
|
8169
8165
|
] }),
|
|
8170
|
-
/* @__PURE__ */ (0,
|
|
8166
|
+
/* @__PURE__ */ (0, import_jsx_runtime321.jsx)("div", { className: "drawer-body", children })
|
|
8171
8167
|
]
|
|
8172
8168
|
}
|
|
8173
8169
|
)
|
|
@@ -8180,16 +8176,25 @@ Drawer.displayName = "Drawer";
|
|
|
8180
8176
|
var Drawer_default = Drawer;
|
|
8181
8177
|
|
|
8182
8178
|
// src/components/Dropdown/Dropdown.tsx
|
|
8183
|
-
var
|
|
8179
|
+
var import_react21 = __toESM(require("react"), 1);
|
|
8180
|
+
|
|
8181
|
+
// src/tokens/hooks/Portal.tsx
|
|
8182
|
+
var import_react_dom3 = __toESM(require("react-dom"), 1);
|
|
8183
|
+
var Portal = ({ children }) => {
|
|
8184
|
+
if (typeof document === "undefined") return null;
|
|
8185
|
+
return import_react_dom3.default.createPortal(children, document.body);
|
|
8186
|
+
};
|
|
8187
|
+
Portal.displayName = "Portal";
|
|
8188
|
+
var Portal_default = Portal;
|
|
8184
8189
|
|
|
8185
8190
|
// src/tokens/hooks/useAutoPosition.ts
|
|
8186
|
-
var
|
|
8191
|
+
var import_react19 = __toESM(require("react"), 1);
|
|
8187
8192
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
8188
|
-
const [position, setPosition] =
|
|
8193
|
+
const [position, setPosition] = import_react19.default.useState({
|
|
8189
8194
|
position: {},
|
|
8190
8195
|
direction: "bottom"
|
|
8191
8196
|
});
|
|
8192
|
-
const calculatePosition =
|
|
8197
|
+
const calculatePosition = import_react19.default.useCallback(() => {
|
|
8193
8198
|
if (!triggerRef.current || !popRef.current) return;
|
|
8194
8199
|
const triggerRect = triggerRef.current.getBoundingClientRect();
|
|
8195
8200
|
const popW = popRef.current.offsetWidth;
|
|
@@ -8216,13 +8221,13 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
8216
8221
|
direction
|
|
8217
8222
|
});
|
|
8218
8223
|
}, [triggerRef, popRef]);
|
|
8219
|
-
|
|
8224
|
+
import_react19.default.useLayoutEffect(() => {
|
|
8220
8225
|
if (!enabled) return;
|
|
8221
8226
|
calculatePosition();
|
|
8222
8227
|
const raf = requestAnimationFrame(calculatePosition);
|
|
8223
8228
|
return () => cancelAnimationFrame(raf);
|
|
8224
8229
|
}, [calculatePosition, enabled]);
|
|
8225
|
-
|
|
8230
|
+
import_react19.default.useEffect(() => {
|
|
8226
8231
|
if (!enabled || !popRef.current) return;
|
|
8227
8232
|
const observer = new ResizeObserver(() => {
|
|
8228
8233
|
calculatePosition();
|
|
@@ -8230,7 +8235,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
8230
8235
|
observer.observe(popRef.current);
|
|
8231
8236
|
return () => observer.disconnect();
|
|
8232
8237
|
}, [calculatePosition, enabled, popRef]);
|
|
8233
|
-
|
|
8238
|
+
import_react19.default.useEffect(() => {
|
|
8234
8239
|
if (!enabled) return;
|
|
8235
8240
|
window.addEventListener("resize", calculatePosition);
|
|
8236
8241
|
window.addEventListener("scroll", calculatePosition, true);
|
|
@@ -8244,9 +8249,9 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
8244
8249
|
var useAutoPosition_default = useAutoPosition;
|
|
8245
8250
|
|
|
8246
8251
|
// src/tokens/hooks/useClickOutside.ts
|
|
8247
|
-
var
|
|
8252
|
+
var import_react20 = __toESM(require("react"), 1);
|
|
8248
8253
|
var useClickOutside = (refs, handler, enabled = true) => {
|
|
8249
|
-
|
|
8254
|
+
import_react20.default.useEffect(() => {
|
|
8250
8255
|
if (!enabled) return;
|
|
8251
8256
|
const refArray = Array.isArray(refs) ? refs : [refs];
|
|
8252
8257
|
const listener = (event) => {
|
|
@@ -8269,17 +8274,17 @@ var useClickOutside = (refs, handler, enabled = true) => {
|
|
|
8269
8274
|
var useClickOutside_default = useClickOutside;
|
|
8270
8275
|
|
|
8271
8276
|
// src/components/Dropdown/Dropdown.tsx
|
|
8272
|
-
var
|
|
8277
|
+
var import_jsx_runtime322 = require("react/jsx-runtime");
|
|
8273
8278
|
var Dropdown = (props) => {
|
|
8274
8279
|
const { items, children } = props;
|
|
8275
|
-
const [isOpen, setIsOpen] =
|
|
8276
|
-
const [mounted, setMounted] =
|
|
8277
|
-
const [visible, setVisible] =
|
|
8278
|
-
const triggerRef =
|
|
8279
|
-
const menuRef =
|
|
8280
|
+
const [isOpen, setIsOpen] = import_react21.default.useState(false);
|
|
8281
|
+
const [mounted, setMounted] = import_react21.default.useState(false);
|
|
8282
|
+
const [visible, setVisible] = import_react21.default.useState(false);
|
|
8283
|
+
const triggerRef = import_react21.default.useRef(null);
|
|
8284
|
+
const menuRef = import_react21.default.useRef(null);
|
|
8280
8285
|
const { position, direction } = useAutoPosition_default(triggerRef, menuRef, mounted);
|
|
8281
8286
|
useClickOutside_default([triggerRef, menuRef], () => setIsOpen(false), isOpen);
|
|
8282
|
-
|
|
8287
|
+
import_react21.default.useEffect(() => {
|
|
8283
8288
|
if (isOpen) {
|
|
8284
8289
|
setMounted(true);
|
|
8285
8290
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -8294,8 +8299,8 @@ var Dropdown = (props) => {
|
|
|
8294
8299
|
item.onClick?.();
|
|
8295
8300
|
setIsOpen(false);
|
|
8296
8301
|
};
|
|
8297
|
-
return /* @__PURE__ */ (0,
|
|
8298
|
-
/* @__PURE__ */ (0,
|
|
8302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime322.jsxs)("div", { className: "lib-xplat-dropdown", children: [
|
|
8303
|
+
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)(
|
|
8299
8304
|
"div",
|
|
8300
8305
|
{
|
|
8301
8306
|
ref: triggerRef,
|
|
@@ -8304,14 +8309,14 @@ var Dropdown = (props) => {
|
|
|
8304
8309
|
children
|
|
8305
8310
|
}
|
|
8306
8311
|
),
|
|
8307
|
-
mounted && /* @__PURE__ */ (0,
|
|
8312
|
+
mounted && /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(
|
|
8308
8313
|
"div",
|
|
8309
8314
|
{
|
|
8310
8315
|
ref: menuRef,
|
|
8311
8316
|
className: clsx_default("lib-xplat-dropdown-menu", direction, { visible }),
|
|
8312
8317
|
style: { top: position.top, left: position.left },
|
|
8313
8318
|
role: "menu",
|
|
8314
|
-
children: items.map((item) => /* @__PURE__ */ (0,
|
|
8319
|
+
children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(
|
|
8315
8320
|
"button",
|
|
8316
8321
|
{
|
|
8317
8322
|
className: clsx_default("dropdown-item", {
|
|
@@ -8333,8 +8338,8 @@ Dropdown.displayName = "Dropdown";
|
|
|
8333
8338
|
var Dropdown_default = Dropdown;
|
|
8334
8339
|
|
|
8335
8340
|
// src/components/Editor/Editor.tsx
|
|
8336
|
-
var
|
|
8337
|
-
var
|
|
8341
|
+
var import_react22 = __toESM(require("react"), 1);
|
|
8342
|
+
var import_jsx_runtime323 = require("react/jsx-runtime");
|
|
8338
8343
|
var DEFAULT_TOOLBAR = [
|
|
8339
8344
|
"bold",
|
|
8340
8345
|
"italic",
|
|
@@ -8441,21 +8446,21 @@ var Editor = (props) => {
|
|
|
8441
8446
|
onImageUpload,
|
|
8442
8447
|
minHeight = 200
|
|
8443
8448
|
} = props;
|
|
8444
|
-
const editorRef =
|
|
8445
|
-
const lastRangeRef =
|
|
8446
|
-
const composingRef =
|
|
8447
|
-
const [isFocused, setIsFocused] =
|
|
8448
|
-
const [isEmpty, setIsEmpty] =
|
|
8449
|
-
const [activeFormats, setActiveFormats] =
|
|
8450
|
-
const [slashOpen, setSlashOpen] =
|
|
8451
|
-
const [slashFilter, setSlashFilter] =
|
|
8452
|
-
const [slashIdx, setSlashIdx] =
|
|
8453
|
-
const [slashPos, setSlashPos] =
|
|
8454
|
-
const slashStartRangeRef =
|
|
8455
|
-
const [linkOpen, setLinkOpen] =
|
|
8456
|
-
const [linkValue, setLinkValue] =
|
|
8457
|
-
const [linkPos, setLinkPos] =
|
|
8458
|
-
|
|
8449
|
+
const editorRef = import_react22.default.useRef(null);
|
|
8450
|
+
const lastRangeRef = import_react22.default.useRef(null);
|
|
8451
|
+
const composingRef = import_react22.default.useRef(false);
|
|
8452
|
+
const [isFocused, setIsFocused] = import_react22.default.useState(false);
|
|
8453
|
+
const [isEmpty, setIsEmpty] = import_react22.default.useState(!value);
|
|
8454
|
+
const [activeFormats, setActiveFormats] = import_react22.default.useState(/* @__PURE__ */ new Set());
|
|
8455
|
+
const [slashOpen, setSlashOpen] = import_react22.default.useState(false);
|
|
8456
|
+
const [slashFilter, setSlashFilter] = import_react22.default.useState("");
|
|
8457
|
+
const [slashIdx, setSlashIdx] = import_react22.default.useState(0);
|
|
8458
|
+
const [slashPos, setSlashPos] = import_react22.default.useState({ top: 0, left: 0 });
|
|
8459
|
+
const slashStartRangeRef = import_react22.default.useRef(null);
|
|
8460
|
+
const [linkOpen, setLinkOpen] = import_react22.default.useState(false);
|
|
8461
|
+
const [linkValue, setLinkValue] = import_react22.default.useState("");
|
|
8462
|
+
const [linkPos, setLinkPos] = import_react22.default.useState({ top: 0, left: 0 });
|
|
8463
|
+
import_react22.default.useEffect(() => {
|
|
8459
8464
|
if (!editorRef.current) return;
|
|
8460
8465
|
if (editorRef.current.innerHTML !== value) {
|
|
8461
8466
|
editorRef.current.innerHTML = sanitizeHtml(value || "");
|
|
@@ -8569,7 +8574,7 @@ var Editor = (props) => {
|
|
|
8569
8574
|
setSlashIdx(0);
|
|
8570
8575
|
slashStartRangeRef.current = null;
|
|
8571
8576
|
};
|
|
8572
|
-
const filteredSlashItems =
|
|
8577
|
+
const filteredSlashItems = import_react22.default.useMemo(() => {
|
|
8573
8578
|
if (!slashFilter) return SLASH_ITEMS;
|
|
8574
8579
|
const f = slashFilter.toLowerCase();
|
|
8575
8580
|
return SLASH_ITEMS.filter((it) => it.label.toLowerCase().includes(f) || it.key.includes(f));
|
|
@@ -8854,8 +8859,8 @@ var Editor = (props) => {
|
|
|
8854
8859
|
break;
|
|
8855
8860
|
}
|
|
8856
8861
|
};
|
|
8857
|
-
return /* @__PURE__ */ (0,
|
|
8858
|
-
!readOnly && /* @__PURE__ */ (0,
|
|
8862
|
+
return /* @__PURE__ */ (0, import_jsx_runtime323.jsxs)("div", { className: clsx_default("lib-xplat-editor", isFocused && "focused", readOnly && "readonly"), children: [
|
|
8863
|
+
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime323.jsx)(
|
|
8859
8864
|
EditorToolbar,
|
|
8860
8865
|
{
|
|
8861
8866
|
items: toolbar,
|
|
@@ -8863,9 +8868,9 @@ var Editor = (props) => {
|
|
|
8863
8868
|
onAction: onToolbarAction
|
|
8864
8869
|
}
|
|
8865
8870
|
),
|
|
8866
|
-
/* @__PURE__ */ (0,
|
|
8867
|
-
isEmpty && !isFocused && /* @__PURE__ */ (0,
|
|
8868
|
-
/* @__PURE__ */ (0,
|
|
8871
|
+
/* @__PURE__ */ (0, import_jsx_runtime323.jsxs)("div", { className: "lib-xplat-editor__content", style: { minHeight }, children: [
|
|
8872
|
+
isEmpty && !isFocused && /* @__PURE__ */ (0, import_jsx_runtime323.jsx)("div", { className: "lib-xplat-editor__placeholder", children: placeholder }),
|
|
8873
|
+
/* @__PURE__ */ (0, import_jsx_runtime323.jsx)(
|
|
8869
8874
|
"div",
|
|
8870
8875
|
{
|
|
8871
8876
|
ref: editorRef,
|
|
@@ -8884,7 +8889,7 @@ var Editor = (props) => {
|
|
|
8884
8889
|
spellCheck: true
|
|
8885
8890
|
}
|
|
8886
8891
|
),
|
|
8887
|
-
slashOpen && filteredSlashItems.length > 0 && /* @__PURE__ */ (0,
|
|
8892
|
+
slashOpen && filteredSlashItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime323.jsx)(
|
|
8888
8893
|
SlashMenu,
|
|
8889
8894
|
{
|
|
8890
8895
|
position: slashPos,
|
|
@@ -8894,7 +8899,7 @@ var Editor = (props) => {
|
|
|
8894
8899
|
onClose: closeSlashMenu
|
|
8895
8900
|
}
|
|
8896
8901
|
),
|
|
8897
|
-
linkOpen && /* @__PURE__ */ (0,
|
|
8902
|
+
linkOpen && /* @__PURE__ */ (0, import_jsx_runtime323.jsx)(
|
|
8898
8903
|
LinkPopover,
|
|
8899
8904
|
{
|
|
8900
8905
|
position: linkPos,
|
|
@@ -8946,7 +8951,7 @@ var isActive = (item, active) => {
|
|
|
8946
8951
|
return active.has(item);
|
|
8947
8952
|
};
|
|
8948
8953
|
var EditorToolbar = ({ items, active, onAction }) => {
|
|
8949
|
-
return /* @__PURE__ */ (0,
|
|
8954
|
+
return /* @__PURE__ */ (0, import_jsx_runtime323.jsx)("div", { className: "lib-xplat-editor__toolbar", children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime323.jsx)(
|
|
8950
8955
|
"button",
|
|
8951
8956
|
{
|
|
8952
8957
|
type: "button",
|
|
@@ -8962,7 +8967,7 @@ var EditorToolbar = ({ items, active, onAction }) => {
|
|
|
8962
8967
|
)) });
|
|
8963
8968
|
};
|
|
8964
8969
|
var SlashMenu = ({ position, items, activeIndex, onSelect, onClose }) => {
|
|
8965
|
-
|
|
8970
|
+
import_react22.default.useEffect(() => {
|
|
8966
8971
|
const handleClickOutside = (e) => {
|
|
8967
8972
|
const target = e.target;
|
|
8968
8973
|
const menu = document.querySelector(".lib-xplat-editor__slash-menu");
|
|
@@ -8971,12 +8976,12 @@ var SlashMenu = ({ position, items, activeIndex, onSelect, onClose }) => {
|
|
|
8971
8976
|
window.addEventListener("mousedown", handleClickOutside);
|
|
8972
8977
|
return () => window.removeEventListener("mousedown", handleClickOutside);
|
|
8973
8978
|
}, [onClose]);
|
|
8974
|
-
return /* @__PURE__ */ (0,
|
|
8979
|
+
return /* @__PURE__ */ (0, import_jsx_runtime323.jsx)(
|
|
8975
8980
|
"div",
|
|
8976
8981
|
{
|
|
8977
8982
|
className: "lib-xplat-editor__slash-menu",
|
|
8978
8983
|
style: { top: position.top, left: position.left },
|
|
8979
|
-
children: items.map((item, i) => /* @__PURE__ */ (0,
|
|
8984
|
+
children: items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime323.jsxs)(
|
|
8980
8985
|
"button",
|
|
8981
8986
|
{
|
|
8982
8987
|
type: "button",
|
|
@@ -8986,8 +8991,8 @@ var SlashMenu = ({ position, items, activeIndex, onSelect, onClose }) => {
|
|
|
8986
8991
|
onSelect(item);
|
|
8987
8992
|
},
|
|
8988
8993
|
children: [
|
|
8989
|
-
/* @__PURE__ */ (0,
|
|
8990
|
-
item.hint && /* @__PURE__ */ (0,
|
|
8994
|
+
/* @__PURE__ */ (0, import_jsx_runtime323.jsx)("span", { className: "label", children: item.label }),
|
|
8995
|
+
item.hint && /* @__PURE__ */ (0, import_jsx_runtime323.jsx)("span", { className: "hint", children: item.hint })
|
|
8991
8996
|
]
|
|
8992
8997
|
},
|
|
8993
8998
|
item.key
|
|
@@ -8996,17 +9001,17 @@ var SlashMenu = ({ position, items, activeIndex, onSelect, onClose }) => {
|
|
|
8996
9001
|
);
|
|
8997
9002
|
};
|
|
8998
9003
|
var LinkPopover = ({ position, value, onChange, onConfirm, onClose }) => {
|
|
8999
|
-
const inputRef =
|
|
9000
|
-
|
|
9004
|
+
const inputRef = import_react22.default.useRef(null);
|
|
9005
|
+
import_react22.default.useEffect(() => {
|
|
9001
9006
|
inputRef.current?.focus();
|
|
9002
9007
|
}, []);
|
|
9003
|
-
return /* @__PURE__ */ (0,
|
|
9008
|
+
return /* @__PURE__ */ (0, import_jsx_runtime323.jsxs)(
|
|
9004
9009
|
"div",
|
|
9005
9010
|
{
|
|
9006
9011
|
className: "lib-xplat-editor__link-popover",
|
|
9007
9012
|
style: { top: position.top, left: position.left },
|
|
9008
9013
|
children: [
|
|
9009
|
-
/* @__PURE__ */ (0,
|
|
9014
|
+
/* @__PURE__ */ (0, import_jsx_runtime323.jsx)(
|
|
9010
9015
|
"input",
|
|
9011
9016
|
{
|
|
9012
9017
|
ref: inputRef,
|
|
@@ -9026,11 +9031,11 @@ var LinkPopover = ({ position, value, onChange, onConfirm, onClose }) => {
|
|
|
9026
9031
|
}
|
|
9027
9032
|
}
|
|
9028
9033
|
),
|
|
9029
|
-
/* @__PURE__ */ (0,
|
|
9034
|
+
/* @__PURE__ */ (0, import_jsx_runtime323.jsx)("button", { type: "button", onMouseDown: (e) => {
|
|
9030
9035
|
e.preventDefault();
|
|
9031
9036
|
onConfirm();
|
|
9032
9037
|
}, children: "\uC801\uC6A9" }),
|
|
9033
|
-
/* @__PURE__ */ (0,
|
|
9038
|
+
/* @__PURE__ */ (0, import_jsx_runtime323.jsx)("button", { type: "button", onMouseDown: (e) => {
|
|
9034
9039
|
e.preventDefault();
|
|
9035
9040
|
onClose();
|
|
9036
9041
|
}, children: "\uCDE8\uC18C" })
|
|
@@ -9040,23 +9045,23 @@ var LinkPopover = ({ position, value, onChange, onConfirm, onClose }) => {
|
|
|
9040
9045
|
};
|
|
9041
9046
|
|
|
9042
9047
|
// src/components/EmptyState/EmptyState.tsx
|
|
9043
|
-
var
|
|
9048
|
+
var import_jsx_runtime324 = require("react/jsx-runtime");
|
|
9044
9049
|
var EmptyState = (props) => {
|
|
9045
9050
|
const { icon, title = "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4", description, action } = props;
|
|
9046
|
-
return /* @__PURE__ */ (0,
|
|
9047
|
-
icon && /* @__PURE__ */ (0,
|
|
9048
|
-
!icon && /* @__PURE__ */ (0,
|
|
9049
|
-
/* @__PURE__ */ (0,
|
|
9050
|
-
description && /* @__PURE__ */ (0,
|
|
9051
|
-
action && /* @__PURE__ */ (0,
|
|
9051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime324.jsxs)("div", { className: "lib-xplat-empty-state", children: [
|
|
9052
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime324.jsx)("div", { className: "empty-icon", children: icon }),
|
|
9053
|
+
!icon && /* @__PURE__ */ (0, import_jsx_runtime324.jsx)("div", { className: "empty-icon", children: /* @__PURE__ */ (0, import_jsx_runtime324.jsx)("svg", { viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime324.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" }) }) }),
|
|
9054
|
+
/* @__PURE__ */ (0, import_jsx_runtime324.jsx)("p", { className: "empty-title", children: title }),
|
|
9055
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime324.jsx)("p", { className: "empty-description", children: description }),
|
|
9056
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime324.jsx)("div", { className: "empty-action", children: action })
|
|
9052
9057
|
] });
|
|
9053
9058
|
};
|
|
9054
9059
|
EmptyState.displayName = "EmptyState";
|
|
9055
9060
|
var EmptyState_default = EmptyState;
|
|
9056
9061
|
|
|
9057
9062
|
// src/components/FileUpload/FileUpload.tsx
|
|
9058
|
-
var
|
|
9059
|
-
var
|
|
9063
|
+
var import_react23 = __toESM(require("react"), 1);
|
|
9064
|
+
var import_jsx_runtime325 = require("react/jsx-runtime");
|
|
9060
9065
|
var FileUpload = (props) => {
|
|
9061
9066
|
const {
|
|
9062
9067
|
accept,
|
|
@@ -9066,8 +9071,8 @@ var FileUpload = (props) => {
|
|
|
9066
9071
|
label = "\uD30C\uC77C\uC744 \uB4DC\uB798\uADF8\uD558\uAC70\uB098 \uD074\uB9AD\uD558\uC5EC \uC5C5\uB85C\uB4DC",
|
|
9067
9072
|
description
|
|
9068
9073
|
} = props;
|
|
9069
|
-
const [isDragOver, setIsDragOver] =
|
|
9070
|
-
const inputRef =
|
|
9074
|
+
const [isDragOver, setIsDragOver] = import_react23.default.useState(false);
|
|
9075
|
+
const inputRef = import_react23.default.useRef(null);
|
|
9071
9076
|
const handleFiles = (fileList) => {
|
|
9072
9077
|
let files = Array.from(fileList);
|
|
9073
9078
|
if (maxSize) {
|
|
@@ -9097,7 +9102,7 @@ var FileUpload = (props) => {
|
|
|
9097
9102
|
handleFiles(e.target.files);
|
|
9098
9103
|
}
|
|
9099
9104
|
};
|
|
9100
|
-
return /* @__PURE__ */ (0,
|
|
9105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime325.jsxs)(
|
|
9101
9106
|
"div",
|
|
9102
9107
|
{
|
|
9103
9108
|
className: clsx_default("lib-xplat-file-upload", { "drag-over": isDragOver }),
|
|
@@ -9106,7 +9111,7 @@ var FileUpload = (props) => {
|
|
|
9106
9111
|
onDragLeave: handleDragLeave,
|
|
9107
9112
|
onClick: () => inputRef.current?.click(),
|
|
9108
9113
|
children: [
|
|
9109
|
-
/* @__PURE__ */ (0,
|
|
9114
|
+
/* @__PURE__ */ (0, import_jsx_runtime325.jsx)(
|
|
9110
9115
|
"input",
|
|
9111
9116
|
{
|
|
9112
9117
|
ref: inputRef,
|
|
@@ -9116,9 +9121,9 @@ var FileUpload = (props) => {
|
|
|
9116
9121
|
onChange: handleChange
|
|
9117
9122
|
}
|
|
9118
9123
|
),
|
|
9119
|
-
/* @__PURE__ */ (0,
|
|
9120
|
-
/* @__PURE__ */ (0,
|
|
9121
|
-
description && /* @__PURE__ */ (0,
|
|
9124
|
+
/* @__PURE__ */ (0, import_jsx_runtime325.jsx)("div", { className: "upload-icon", children: /* @__PURE__ */ (0, import_jsx_runtime325.jsx)(UploadIcon_default, {}) }),
|
|
9125
|
+
/* @__PURE__ */ (0, import_jsx_runtime325.jsx)("p", { className: "upload-label", children: label }),
|
|
9126
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime325.jsx)("p", { className: "upload-description", children: description })
|
|
9122
9127
|
]
|
|
9123
9128
|
}
|
|
9124
9129
|
);
|
|
@@ -9127,10 +9132,10 @@ FileUpload.displayName = "FileUpload";
|
|
|
9127
9132
|
var FileUpload_default = FileUpload;
|
|
9128
9133
|
|
|
9129
9134
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
9130
|
-
var
|
|
9135
|
+
var import_react25 = __toESM(require("react"), 1);
|
|
9131
9136
|
|
|
9132
9137
|
// src/components/HtmlTypeWriter/utils.ts
|
|
9133
|
-
var
|
|
9138
|
+
var import_react24 = __toESM(require("react"), 1);
|
|
9134
9139
|
var voidTags = /* @__PURE__ */ new Set([
|
|
9135
9140
|
"br",
|
|
9136
9141
|
"img",
|
|
@@ -9198,41 +9203,41 @@ var convertNodeToReactWithRange = (node, typedLen, rangeMap) => {
|
|
|
9198
9203
|
props[attr.name] = attr.value;
|
|
9199
9204
|
});
|
|
9200
9205
|
if (voidTags.has(tag)) {
|
|
9201
|
-
return
|
|
9206
|
+
return import_react24.default.createElement(tag, props);
|
|
9202
9207
|
}
|
|
9203
9208
|
const children = Array.from(element.childNodes).map((child) => convertNodeToReactWithRange(child, typedLen, rangeMap)).filter((n) => n != null);
|
|
9204
|
-
return
|
|
9209
|
+
return import_react24.default.createElement(tag, props, ...children);
|
|
9205
9210
|
};
|
|
9206
9211
|
var htmlToReactProgressive = (root, typedLen, rangeMap) => {
|
|
9207
9212
|
const nodes = Array.from(root.childNodes).map((child, idx) => {
|
|
9208
9213
|
const node = convertNodeToReactWithRange(child, typedLen, rangeMap);
|
|
9209
|
-
return node == null ? null :
|
|
9214
|
+
return node == null ? null : import_react24.default.createElement(import_react24.default.Fragment, { key: idx }, node);
|
|
9210
9215
|
}).filter(Boolean);
|
|
9211
9216
|
return nodes.length === 0 ? null : nodes;
|
|
9212
9217
|
};
|
|
9213
9218
|
|
|
9214
9219
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
9215
|
-
var
|
|
9220
|
+
var import_jsx_runtime326 = require("react/jsx-runtime");
|
|
9216
9221
|
var HtmlTypeWriter = ({
|
|
9217
9222
|
html,
|
|
9218
9223
|
duration = 20,
|
|
9219
9224
|
onDone,
|
|
9220
9225
|
onChange
|
|
9221
9226
|
}) => {
|
|
9222
|
-
const [typedLen, setTypedLen] =
|
|
9223
|
-
const doneCalledRef =
|
|
9224
|
-
const { doc, rangeMap, totalLength } =
|
|
9227
|
+
const [typedLen, setTypedLen] = import_react25.default.useState(0);
|
|
9228
|
+
const doneCalledRef = import_react25.default.useRef(false);
|
|
9229
|
+
const { doc, rangeMap, totalLength } = import_react25.default.useMemo(() => {
|
|
9225
9230
|
if (typeof window === "undefined") return { doc: null, rangeMap: /* @__PURE__ */ new Map(), totalLength: 0 };
|
|
9226
9231
|
const decoded = decodeHtmlEntities(html);
|
|
9227
9232
|
const doc2 = new DOMParser().parseFromString(decoded, "text/html");
|
|
9228
9233
|
const { rangeMap: rangeMap2, totalLength: totalLength2 } = buildRangeMap(doc2.body);
|
|
9229
9234
|
return { doc: doc2, rangeMap: rangeMap2, totalLength: totalLength2 };
|
|
9230
9235
|
}, [html]);
|
|
9231
|
-
|
|
9236
|
+
import_react25.default.useEffect(() => {
|
|
9232
9237
|
setTypedLen(0);
|
|
9233
9238
|
doneCalledRef.current = false;
|
|
9234
9239
|
}, [html]);
|
|
9235
|
-
|
|
9240
|
+
import_react25.default.useEffect(() => {
|
|
9236
9241
|
if (!totalLength) return;
|
|
9237
9242
|
if (typedLen >= totalLength) return;
|
|
9238
9243
|
const timer = window.setInterval(() => {
|
|
@@ -9240,33 +9245,33 @@ var HtmlTypeWriter = ({
|
|
|
9240
9245
|
}, duration);
|
|
9241
9246
|
return () => window.clearInterval(timer);
|
|
9242
9247
|
}, [typedLen, totalLength, duration]);
|
|
9243
|
-
|
|
9248
|
+
import_react25.default.useEffect(() => {
|
|
9244
9249
|
if (typedLen > 0 && typedLen < totalLength) {
|
|
9245
9250
|
onChange?.();
|
|
9246
9251
|
}
|
|
9247
9252
|
}, [typedLen, totalLength, onChange]);
|
|
9248
|
-
|
|
9253
|
+
import_react25.default.useEffect(() => {
|
|
9249
9254
|
if (typedLen === totalLength && totalLength > 0 && !doneCalledRef.current) {
|
|
9250
9255
|
doneCalledRef.current = true;
|
|
9251
9256
|
onDone?.();
|
|
9252
9257
|
}
|
|
9253
9258
|
}, [typedLen, totalLength, onDone]);
|
|
9254
|
-
const parsed =
|
|
9259
|
+
const parsed = import_react25.default.useMemo(
|
|
9255
9260
|
() => doc ? htmlToReactProgressive(doc.body, typedLen, rangeMap) : null,
|
|
9256
9261
|
[doc, typedLen, rangeMap]
|
|
9257
9262
|
);
|
|
9258
|
-
return /* @__PURE__ */ (0,
|
|
9263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime326.jsx)("div", { className: "lib-xplat-htmlTypewriter", children: parsed });
|
|
9259
9264
|
};
|
|
9260
9265
|
HtmlTypeWriter.displayName = "HtmlTypeWriter";
|
|
9261
9266
|
var HtmlTypeWriter_default = HtmlTypeWriter;
|
|
9262
9267
|
|
|
9263
9268
|
// src/components/ImageSelector/ImageSelector.tsx
|
|
9264
|
-
var
|
|
9265
|
-
var
|
|
9269
|
+
var import_react26 = __toESM(require("react"), 1);
|
|
9270
|
+
var import_jsx_runtime327 = require("react/jsx-runtime");
|
|
9266
9271
|
var ImageSelector = (props) => {
|
|
9267
9272
|
const { value, label, onChange } = props;
|
|
9268
|
-
const [previewUrl, setPreviewUrl] =
|
|
9269
|
-
|
|
9273
|
+
const [previewUrl, setPreviewUrl] = import_react26.default.useState();
|
|
9274
|
+
import_react26.default.useEffect(() => {
|
|
9270
9275
|
if (!value) {
|
|
9271
9276
|
setPreviewUrl(void 0);
|
|
9272
9277
|
return;
|
|
@@ -9275,7 +9280,7 @@ var ImageSelector = (props) => {
|
|
|
9275
9280
|
setPreviewUrl(url);
|
|
9276
9281
|
return () => URL.revokeObjectURL(url);
|
|
9277
9282
|
}, [value]);
|
|
9278
|
-
const inputRef =
|
|
9283
|
+
const inputRef = import_react26.default.useRef(null);
|
|
9279
9284
|
const handleFileChange = (e) => {
|
|
9280
9285
|
const selectedFile = e.target.files?.[0];
|
|
9281
9286
|
if (selectedFile) {
|
|
@@ -9288,8 +9293,8 @@ var ImageSelector = (props) => {
|
|
|
9288
9293
|
const handleOpenFileDialog = () => {
|
|
9289
9294
|
inputRef.current?.click();
|
|
9290
9295
|
};
|
|
9291
|
-
return /* @__PURE__ */ (0,
|
|
9292
|
-
/* @__PURE__ */ (0,
|
|
9296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime327.jsxs)("div", { className: `lib-xplat-imageselector${value ? "" : " none-value"}`, children: [
|
|
9297
|
+
/* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
|
|
9293
9298
|
"input",
|
|
9294
9299
|
{
|
|
9295
9300
|
type: "file",
|
|
@@ -9299,21 +9304,59 @@ var ImageSelector = (props) => {
|
|
|
9299
9304
|
ref: inputRef
|
|
9300
9305
|
}
|
|
9301
9306
|
),
|
|
9302
|
-
value && /* @__PURE__ */ (0,
|
|
9303
|
-
/* @__PURE__ */ (0,
|
|
9304
|
-
/* @__PURE__ */ (0,
|
|
9307
|
+
value && /* @__PURE__ */ (0, import_jsx_runtime327.jsxs)("div", { className: "action-bar", children: [
|
|
9308
|
+
/* @__PURE__ */ (0, import_jsx_runtime327.jsx)("div", { className: "icon-wrapper", onClick: handleOpenFileDialog, children: /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(UploadIcon_default, {}) }),
|
|
9309
|
+
/* @__PURE__ */ (0, import_jsx_runtime327.jsx)("div", { className: "icon-wrapper", onClick: handleDeleteFile, children: /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(DeleteIcon_default, {}) })
|
|
9305
9310
|
] }),
|
|
9306
|
-
/* @__PURE__ */ (0,
|
|
9307
|
-
/* @__PURE__ */ (0,
|
|
9308
|
-
/* @__PURE__ */ (0,
|
|
9311
|
+
/* @__PURE__ */ (0, import_jsx_runtime327.jsx)("div", { className: "content", children: previewUrl ? /* @__PURE__ */ (0, import_jsx_runtime327.jsx)("img", { src: previewUrl, alt: "preview" }) : /* @__PURE__ */ (0, import_jsx_runtime327.jsxs)("div", { className: "skeleton", onClick: handleOpenFileDialog, children: [
|
|
9312
|
+
/* @__PURE__ */ (0, import_jsx_runtime327.jsx)("div", { className: "icon-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(ImageIcon_default, {}) }),
|
|
9313
|
+
/* @__PURE__ */ (0, import_jsx_runtime327.jsx)("div", { className: "label", children: label || "\uC774\uBBF8\uC9C0 \uCD94\uAC00\uD558\uAE30" })
|
|
9309
9314
|
] }) })
|
|
9310
9315
|
] });
|
|
9311
9316
|
};
|
|
9312
9317
|
ImageSelector.displayName = "ImageSelector";
|
|
9313
9318
|
var ImageSelector_default = ImageSelector;
|
|
9314
9319
|
|
|
9315
|
-
// src/components/
|
|
9320
|
+
// src/components/Link/Link.tsx
|
|
9321
|
+
var import_jsx_runtime328 = require("react/jsx-runtime");
|
|
9322
|
+
var Link = (props) => {
|
|
9323
|
+
const { children, href, underline = "always", target, rel, ...rest } = props;
|
|
9324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime328.jsx)(
|
|
9325
|
+
"a",
|
|
9326
|
+
{
|
|
9327
|
+
className: clsx_default("lib-xplat-link", `underline-${underline}`),
|
|
9328
|
+
href,
|
|
9329
|
+
target,
|
|
9330
|
+
rel: target === "_blank" ? rel ?? "noopener noreferrer" : rel,
|
|
9331
|
+
...rest,
|
|
9332
|
+
children
|
|
9333
|
+
}
|
|
9334
|
+
);
|
|
9335
|
+
};
|
|
9336
|
+
Link.displayName = "Link";
|
|
9337
|
+
var Link_default = Link;
|
|
9338
|
+
|
|
9339
|
+
// src/components/LinkButton/LinkButton.tsx
|
|
9316
9340
|
var import_jsx_runtime329 = require("react/jsx-runtime");
|
|
9341
|
+
var LinkButton = (props) => {
|
|
9342
|
+
const { children, href, type = "primary", size = "md", target, rel, ...rest } = props;
|
|
9343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime329.jsx)(
|
|
9344
|
+
"a",
|
|
9345
|
+
{
|
|
9346
|
+
className: clsx_default("lib-xplat-button", type, size),
|
|
9347
|
+
href,
|
|
9348
|
+
target,
|
|
9349
|
+
rel: target === "_blank" ? rel ?? "noopener noreferrer" : rel,
|
|
9350
|
+
...rest,
|
|
9351
|
+
children
|
|
9352
|
+
}
|
|
9353
|
+
);
|
|
9354
|
+
};
|
|
9355
|
+
LinkButton.displayName = "LinkButton";
|
|
9356
|
+
var LinkButton_default = LinkButton;
|
|
9357
|
+
|
|
9358
|
+
// src/components/NotificationBadge/NotificationBadge.tsx
|
|
9359
|
+
var import_jsx_runtime330 = require("react/jsx-runtime");
|
|
9317
9360
|
var NotificationBadge = (props) => {
|
|
9318
9361
|
const {
|
|
9319
9362
|
children,
|
|
@@ -9325,16 +9368,16 @@ var NotificationBadge = (props) => {
|
|
|
9325
9368
|
} = props;
|
|
9326
9369
|
const showBadge = dot || count !== void 0 && count > 0;
|
|
9327
9370
|
const displayCount = count !== void 0 && count > maxCount ? `${maxCount}+` : count;
|
|
9328
|
-
return /* @__PURE__ */ (0,
|
|
9371
|
+
return /* @__PURE__ */ (0, import_jsx_runtime330.jsxs)("div", { className: clsx_default("lib-xplat-notification-badge", size), children: [
|
|
9329
9372
|
children,
|
|
9330
|
-
showBadge && /* @__PURE__ */ (0,
|
|
9373
|
+
showBadge && /* @__PURE__ */ (0, import_jsx_runtime330.jsx)("span", { className: clsx_default("badge-indicator", type, { dot }), children: !dot && displayCount })
|
|
9331
9374
|
] });
|
|
9332
9375
|
};
|
|
9333
9376
|
NotificationBadge.displayName = "NotificationBadge";
|
|
9334
9377
|
var NotificationBadge_default = NotificationBadge;
|
|
9335
9378
|
|
|
9336
9379
|
// src/components/Pagination/Pagination.tsx
|
|
9337
|
-
var
|
|
9380
|
+
var import_jsx_runtime331 = require("react/jsx-runtime");
|
|
9338
9381
|
var getPageRange = (current, totalPages, siblingCount) => {
|
|
9339
9382
|
const totalNumbers = siblingCount * 2 + 5;
|
|
9340
9383
|
if (totalPages <= totalNumbers) {
|
|
@@ -9377,19 +9420,19 @@ var Pagination = (props) => {
|
|
|
9377
9420
|
onChange?.(page);
|
|
9378
9421
|
}
|
|
9379
9422
|
};
|
|
9380
|
-
return /* @__PURE__ */ (0,
|
|
9381
|
-
/* @__PURE__ */ (0,
|
|
9423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime331.jsxs)("nav", { className: clsx_default("lib-xplat-pagination", size, type), "aria-label": "\uD398\uC774\uC9C0 \uB124\uBE44\uAC8C\uC774\uC158", children: [
|
|
9424
|
+
/* @__PURE__ */ (0, import_jsx_runtime331.jsx)(
|
|
9382
9425
|
"button",
|
|
9383
9426
|
{
|
|
9384
9427
|
className: "page-btn prev",
|
|
9385
9428
|
disabled: current <= 1,
|
|
9386
9429
|
onClick: () => handleClick(current - 1),
|
|
9387
9430
|
"aria-label": "\uC774\uC804 \uD398\uC774\uC9C0",
|
|
9388
|
-
children: /* @__PURE__ */ (0,
|
|
9431
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime331.jsx)(ChevronLeftIcon_default, {})
|
|
9389
9432
|
}
|
|
9390
9433
|
),
|
|
9391
9434
|
pages.map(
|
|
9392
|
-
(page, i) => page === "..." ? /* @__PURE__ */ (0,
|
|
9435
|
+
(page, i) => page === "..." ? /* @__PURE__ */ (0, import_jsx_runtime331.jsx)("span", { className: "dots", children: "..." }, `dots-${i}`) : /* @__PURE__ */ (0, import_jsx_runtime331.jsx)(
|
|
9393
9436
|
"button",
|
|
9394
9437
|
{
|
|
9395
9438
|
className: clsx_default("page-btn", { active: page === current }),
|
|
@@ -9400,14 +9443,14 @@ var Pagination = (props) => {
|
|
|
9400
9443
|
page
|
|
9401
9444
|
)
|
|
9402
9445
|
),
|
|
9403
|
-
/* @__PURE__ */ (0,
|
|
9446
|
+
/* @__PURE__ */ (0, import_jsx_runtime331.jsx)(
|
|
9404
9447
|
"button",
|
|
9405
9448
|
{
|
|
9406
9449
|
className: "page-btn next",
|
|
9407
9450
|
disabled: current >= totalPages,
|
|
9408
9451
|
onClick: () => handleClick(current + 1),
|
|
9409
9452
|
"aria-label": "\uB2E4\uC74C \uD398\uC774\uC9C0",
|
|
9410
|
-
children: /* @__PURE__ */ (0,
|
|
9453
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime331.jsx)(ChevronRightIcon_default, {})
|
|
9411
9454
|
}
|
|
9412
9455
|
)
|
|
9413
9456
|
] });
|
|
@@ -9416,17 +9459,17 @@ Pagination.displayName = "Pagination";
|
|
|
9416
9459
|
var Pagination_default = Pagination;
|
|
9417
9460
|
|
|
9418
9461
|
// src/components/PopOver/PopOver.tsx
|
|
9419
|
-
var
|
|
9420
|
-
var
|
|
9462
|
+
var import_react27 = __toESM(require("react"), 1);
|
|
9463
|
+
var import_jsx_runtime332 = require("react/jsx-runtime");
|
|
9421
9464
|
var PopOver = (props) => {
|
|
9422
9465
|
const { children, isOpen, onClose, PopOverEl } = props;
|
|
9423
|
-
const popRef =
|
|
9424
|
-
const triggerRef =
|
|
9425
|
-
const [localOpen, setLocalOpen] =
|
|
9426
|
-
const [eventTrigger, setEventTrigger] =
|
|
9466
|
+
const popRef = import_react27.default.useRef(null);
|
|
9467
|
+
const triggerRef = import_react27.default.useRef(null);
|
|
9468
|
+
const [localOpen, setLocalOpen] = import_react27.default.useState(false);
|
|
9469
|
+
const [eventTrigger, setEventTrigger] = import_react27.default.useState(false);
|
|
9427
9470
|
useClickOutside_default([popRef, triggerRef], onClose, isOpen);
|
|
9428
9471
|
const position = useAutoPosition_default(triggerRef, popRef, localOpen);
|
|
9429
|
-
|
|
9472
|
+
import_react27.default.useEffect(() => {
|
|
9430
9473
|
if (isOpen) {
|
|
9431
9474
|
setLocalOpen(isOpen);
|
|
9432
9475
|
setTimeout(() => {
|
|
@@ -9439,7 +9482,7 @@ var PopOver = (props) => {
|
|
|
9439
9482
|
}, 200);
|
|
9440
9483
|
}
|
|
9441
9484
|
}, [isOpen]);
|
|
9442
|
-
return /* @__PURE__ */ (0,
|
|
9485
|
+
return /* @__PURE__ */ (0, import_jsx_runtime332.jsxs)(
|
|
9443
9486
|
"div",
|
|
9444
9487
|
{
|
|
9445
9488
|
className: "lib-xplat-pop-over",
|
|
@@ -9449,7 +9492,7 @@ var PopOver = (props) => {
|
|
|
9449
9492
|
},
|
|
9450
9493
|
children: [
|
|
9451
9494
|
children,
|
|
9452
|
-
localOpen && /* @__PURE__ */ (0,
|
|
9495
|
+
localOpen && /* @__PURE__ */ (0, import_jsx_runtime332.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime332.jsx)(
|
|
9453
9496
|
"div",
|
|
9454
9497
|
{
|
|
9455
9498
|
className: clsx_default(
|
|
@@ -9472,7 +9515,7 @@ PopOver.displayName = "PopOver";
|
|
|
9472
9515
|
var PopOver_default = PopOver;
|
|
9473
9516
|
|
|
9474
9517
|
// src/components/Progress/Progress.tsx
|
|
9475
|
-
var
|
|
9518
|
+
var import_jsx_runtime333 = require("react/jsx-runtime");
|
|
9476
9519
|
var Progress = (props) => {
|
|
9477
9520
|
const {
|
|
9478
9521
|
value,
|
|
@@ -9482,8 +9525,8 @@ var Progress = (props) => {
|
|
|
9482
9525
|
showLabel = false
|
|
9483
9526
|
} = props;
|
|
9484
9527
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
9485
|
-
return /* @__PURE__ */ (0,
|
|
9486
|
-
/* @__PURE__ */ (0,
|
|
9528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime333.jsxs)("div", { className: clsx_default("lib-xplat-progress", size, type), children: [
|
|
9529
|
+
/* @__PURE__ */ (0, import_jsx_runtime333.jsx)(
|
|
9487
9530
|
"div",
|
|
9488
9531
|
{
|
|
9489
9532
|
className: "track",
|
|
@@ -9491,7 +9534,7 @@ var Progress = (props) => {
|
|
|
9491
9534
|
"aria-valuenow": value,
|
|
9492
9535
|
"aria-valuemin": 0,
|
|
9493
9536
|
"aria-valuemax": max,
|
|
9494
|
-
children: /* @__PURE__ */ (0,
|
|
9537
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime333.jsx)(
|
|
9495
9538
|
"div",
|
|
9496
9539
|
{
|
|
9497
9540
|
className: "bar",
|
|
@@ -9500,7 +9543,7 @@ var Progress = (props) => {
|
|
|
9500
9543
|
)
|
|
9501
9544
|
}
|
|
9502
9545
|
),
|
|
9503
|
-
showLabel && /* @__PURE__ */ (0,
|
|
9546
|
+
showLabel && /* @__PURE__ */ (0, import_jsx_runtime333.jsxs)("span", { className: "label", children: [
|
|
9504
9547
|
Math.round(percentage),
|
|
9505
9548
|
"%"
|
|
9506
9549
|
] })
|
|
@@ -9510,17 +9553,17 @@ Progress.displayName = "Progress";
|
|
|
9510
9553
|
var Progress_default = Progress;
|
|
9511
9554
|
|
|
9512
9555
|
// src/components/Radio/RadioGroupContext.tsx
|
|
9513
|
-
var
|
|
9514
|
-
var RadioGroupContext =
|
|
9556
|
+
var import_react28 = __toESM(require("react"), 1);
|
|
9557
|
+
var RadioGroupContext = import_react28.default.createContext(
|
|
9515
9558
|
null
|
|
9516
9559
|
);
|
|
9517
9560
|
var useRadioGroupContext = () => {
|
|
9518
|
-
return
|
|
9561
|
+
return import_react28.default.useContext(RadioGroupContext);
|
|
9519
9562
|
};
|
|
9520
9563
|
var RadioGroupContext_default = RadioGroupContext;
|
|
9521
9564
|
|
|
9522
9565
|
// src/components/Radio/Radio.tsx
|
|
9523
|
-
var
|
|
9566
|
+
var import_jsx_runtime334 = require("react/jsx-runtime");
|
|
9524
9567
|
var Radio = (props) => {
|
|
9525
9568
|
const {
|
|
9526
9569
|
label,
|
|
@@ -9539,7 +9582,7 @@ var Radio = (props) => {
|
|
|
9539
9582
|
value,
|
|
9540
9583
|
onChange: rest.onChange
|
|
9541
9584
|
};
|
|
9542
|
-
return /* @__PURE__ */ (0,
|
|
9585
|
+
return /* @__PURE__ */ (0, import_jsx_runtime334.jsxs)(
|
|
9543
9586
|
"label",
|
|
9544
9587
|
{
|
|
9545
9588
|
className: clsx_default(
|
|
@@ -9550,18 +9593,18 @@ var Radio = (props) => {
|
|
|
9550
9593
|
className
|
|
9551
9594
|
),
|
|
9552
9595
|
children: [
|
|
9553
|
-
/* @__PURE__ */ (0,
|
|
9554
|
-
/* @__PURE__ */ (0,
|
|
9596
|
+
/* @__PURE__ */ (0, import_jsx_runtime334.jsx)("input", { ...rest, ...inputProps, checked: localChecked, type: "radio" }),
|
|
9597
|
+
/* @__PURE__ */ (0, import_jsx_runtime334.jsx)(
|
|
9555
9598
|
"div",
|
|
9556
9599
|
{
|
|
9557
9600
|
className: clsx_default(
|
|
9558
9601
|
"circle",
|
|
9559
9602
|
localChecked ? "checked" : void 0
|
|
9560
9603
|
),
|
|
9561
|
-
children: localChecked && /* @__PURE__ */ (0,
|
|
9604
|
+
children: localChecked && /* @__PURE__ */ (0, import_jsx_runtime334.jsx)("div", { className: "inner-circle" })
|
|
9562
9605
|
}
|
|
9563
9606
|
),
|
|
9564
|
-
label && /* @__PURE__ */ (0,
|
|
9607
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime334.jsx)("span", { children: label })
|
|
9565
9608
|
]
|
|
9566
9609
|
}
|
|
9567
9610
|
);
|
|
@@ -9570,28 +9613,28 @@ Radio.displayName = "Radio";
|
|
|
9570
9613
|
var Radio_default = Radio;
|
|
9571
9614
|
|
|
9572
9615
|
// src/components/Radio/RadioGroup.tsx
|
|
9573
|
-
var
|
|
9616
|
+
var import_jsx_runtime335 = require("react/jsx-runtime");
|
|
9574
9617
|
var RadioGroup = (props) => {
|
|
9575
9618
|
const { children, ...rest } = props;
|
|
9576
|
-
return /* @__PURE__ */ (0,
|
|
9619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime335.jsx)(import_jsx_runtime335.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime335.jsx)(RadioGroupContext_default.Provider, { value: rest, children }) });
|
|
9577
9620
|
};
|
|
9578
9621
|
RadioGroup.displayName = "RadioGroup";
|
|
9579
9622
|
var RadioGroup_default = RadioGroup;
|
|
9580
9623
|
|
|
9581
9624
|
// src/components/Select/Select.tsx
|
|
9582
|
-
var
|
|
9625
|
+
var import_react31 = __toESM(require("react"), 1);
|
|
9583
9626
|
|
|
9584
9627
|
// src/components/Select/context.ts
|
|
9585
|
-
var
|
|
9586
|
-
var SelectContext =
|
|
9628
|
+
var import_react29 = __toESM(require("react"), 1);
|
|
9629
|
+
var SelectContext = import_react29.default.createContext(null);
|
|
9587
9630
|
var context_default = SelectContext;
|
|
9588
9631
|
|
|
9589
9632
|
// src/components/Select/SelectItem.tsx
|
|
9590
|
-
var
|
|
9591
|
-
var
|
|
9633
|
+
var import_react30 = __toESM(require("react"), 1);
|
|
9634
|
+
var import_jsx_runtime336 = require("react/jsx-runtime");
|
|
9592
9635
|
var SelectItem = (props) => {
|
|
9593
9636
|
const { children, value, onClick, disabled = false } = props;
|
|
9594
|
-
const ctx =
|
|
9637
|
+
const ctx = import_react30.default.useContext(context_default);
|
|
9595
9638
|
const handleClick = (e) => {
|
|
9596
9639
|
e.preventDefault();
|
|
9597
9640
|
e.stopPropagation();
|
|
@@ -9601,7 +9644,7 @@ var SelectItem = (props) => {
|
|
|
9601
9644
|
onClick?.();
|
|
9602
9645
|
};
|
|
9603
9646
|
const isSelected = value !== void 0 ? ctx?.selectedValue === value : ctx?.selectedLabel === children;
|
|
9604
|
-
return /* @__PURE__ */ (0,
|
|
9647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(
|
|
9605
9648
|
"div",
|
|
9606
9649
|
{
|
|
9607
9650
|
className: clsx_default("select-item", disabled && "disabled", isSelected && "is-selected"),
|
|
@@ -9622,7 +9665,7 @@ SelectItem.displayName = "Select.Item";
|
|
|
9622
9665
|
var SelectItem_default = SelectItem;
|
|
9623
9666
|
|
|
9624
9667
|
// src/components/Select/Select.tsx
|
|
9625
|
-
var
|
|
9668
|
+
var import_jsx_runtime337 = require("react/jsx-runtime");
|
|
9626
9669
|
var ANIMATION_DURATION_MS3 = 200;
|
|
9627
9670
|
var SelectRoot = (props) => {
|
|
9628
9671
|
const {
|
|
@@ -9634,28 +9677,28 @@ var SelectRoot = (props) => {
|
|
|
9634
9677
|
error = false,
|
|
9635
9678
|
size = "md"
|
|
9636
9679
|
} = props;
|
|
9637
|
-
const itemChildren =
|
|
9638
|
-
(child) =>
|
|
9680
|
+
const itemChildren = import_react31.default.Children.toArray(children).filter(
|
|
9681
|
+
(child) => import_react31.default.isValidElement(child) && child.type === SelectItem_default
|
|
9639
9682
|
);
|
|
9640
9683
|
const isControlled = valueProp !== void 0;
|
|
9641
|
-
const [isOpen, setOpen] =
|
|
9642
|
-
const [uncontrolledLabel, setUncontrolledLabel] =
|
|
9643
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
9644
|
-
const controlledLabel =
|
|
9684
|
+
const [isOpen, setOpen] = import_react31.default.useState(false);
|
|
9685
|
+
const [uncontrolledLabel, setUncontrolledLabel] = import_react31.default.useState(null);
|
|
9686
|
+
const [uncontrolledValue, setUncontrolledValue] = import_react31.default.useState(void 0);
|
|
9687
|
+
const controlledLabel = import_react31.default.useMemo(() => {
|
|
9645
9688
|
if (!isControlled) return null;
|
|
9646
9689
|
const match = itemChildren.find((child) => child.props.value === valueProp);
|
|
9647
9690
|
return match ? match.props.children : null;
|
|
9648
9691
|
}, [isControlled, valueProp, itemChildren]);
|
|
9649
9692
|
const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
|
|
9650
9693
|
const selectedValue = isControlled ? valueProp : uncontrolledValue;
|
|
9651
|
-
const triggerRef =
|
|
9652
|
-
const contentRef =
|
|
9653
|
-
const [mounted, setMounted] =
|
|
9654
|
-
const [visible, setVisible] =
|
|
9655
|
-
|
|
9694
|
+
const triggerRef = import_react31.default.useRef(null);
|
|
9695
|
+
const contentRef = import_react31.default.useRef(null);
|
|
9696
|
+
const [mounted, setMounted] = import_react31.default.useState(false);
|
|
9697
|
+
const [visible, setVisible] = import_react31.default.useState(false);
|
|
9698
|
+
import_react31.default.useEffect(() => {
|
|
9656
9699
|
if (disabled && isOpen) setOpen(false);
|
|
9657
9700
|
}, [disabled, isOpen]);
|
|
9658
|
-
|
|
9701
|
+
import_react31.default.useEffect(() => {
|
|
9659
9702
|
if (isOpen) {
|
|
9660
9703
|
setMounted(true);
|
|
9661
9704
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -9665,12 +9708,12 @@ var SelectRoot = (props) => {
|
|
|
9665
9708
|
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS3);
|
|
9666
9709
|
return () => clearTimeout(t);
|
|
9667
9710
|
}, [isOpen]);
|
|
9668
|
-
const open =
|
|
9669
|
-
const close =
|
|
9670
|
-
const toggle =
|
|
9711
|
+
const open = import_react31.default.useCallback(() => setOpen(true), []);
|
|
9712
|
+
const close = import_react31.default.useCallback(() => setOpen(false), []);
|
|
9713
|
+
const toggle = import_react31.default.useCallback(() => setOpen((prev) => !prev), []);
|
|
9671
9714
|
useClickOutside_default([contentRef, triggerRef], close, isOpen);
|
|
9672
9715
|
const position = useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
9673
|
-
const setSelected =
|
|
9716
|
+
const setSelected = import_react31.default.useCallback(
|
|
9674
9717
|
(label, itemValue) => {
|
|
9675
9718
|
if (!isControlled) {
|
|
9676
9719
|
setUncontrolledLabel(label);
|
|
@@ -9680,7 +9723,7 @@ var SelectRoot = (props) => {
|
|
|
9680
9723
|
},
|
|
9681
9724
|
[isControlled, onChange]
|
|
9682
9725
|
);
|
|
9683
|
-
const ctxValue =
|
|
9726
|
+
const ctxValue = import_react31.default.useMemo(
|
|
9684
9727
|
() => ({
|
|
9685
9728
|
isOpen,
|
|
9686
9729
|
mounted,
|
|
@@ -9702,7 +9745,7 @@ var SelectRoot = (props) => {
|
|
|
9702
9745
|
if (disabled) return;
|
|
9703
9746
|
toggle();
|
|
9704
9747
|
};
|
|
9705
|
-
return /* @__PURE__ */ (0,
|
|
9748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(context_default.Provider, { value: ctxValue, children: /* @__PURE__ */ (0, import_jsx_runtime337.jsxs)(
|
|
9706
9749
|
"div",
|
|
9707
9750
|
{
|
|
9708
9751
|
className: clsx_default(
|
|
@@ -9713,7 +9756,7 @@ var SelectRoot = (props) => {
|
|
|
9713
9756
|
mounted && "is-open"
|
|
9714
9757
|
),
|
|
9715
9758
|
children: [
|
|
9716
|
-
/* @__PURE__ */ (0,
|
|
9759
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsxs)(
|
|
9717
9760
|
"div",
|
|
9718
9761
|
{
|
|
9719
9762
|
ref: triggerRef,
|
|
@@ -9737,7 +9780,7 @@ var SelectRoot = (props) => {
|
|
|
9737
9780
|
}
|
|
9738
9781
|
},
|
|
9739
9782
|
children: [
|
|
9740
|
-
/* @__PURE__ */ (0,
|
|
9783
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
9741
9784
|
"span",
|
|
9742
9785
|
{
|
|
9743
9786
|
className: clsx_default(
|
|
@@ -9747,25 +9790,25 @@ var SelectRoot = (props) => {
|
|
|
9747
9790
|
children: selectedLabel ?? placeholder
|
|
9748
9791
|
}
|
|
9749
9792
|
),
|
|
9750
|
-
/* @__PURE__ */ (0,
|
|
9793
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
9751
9794
|
"span",
|
|
9752
9795
|
{
|
|
9753
9796
|
className: clsx_default("select-trigger-icon", isOpen && "open"),
|
|
9754
9797
|
"aria-hidden": true,
|
|
9755
|
-
children: /* @__PURE__ */ (0,
|
|
9798
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(ChevronDownIcon_default, {})
|
|
9756
9799
|
}
|
|
9757
9800
|
)
|
|
9758
9801
|
]
|
|
9759
9802
|
}
|
|
9760
9803
|
),
|
|
9761
|
-
mounted && /* @__PURE__ */ (0,
|
|
9804
|
+
mounted && /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
9762
9805
|
"div",
|
|
9763
9806
|
{
|
|
9764
9807
|
className: clsx_default("lib-xplat-select-content", size, position.direction, stateClass),
|
|
9765
9808
|
ref: contentRef,
|
|
9766
9809
|
style: { ...position.position, width: triggerRef.current?.offsetWidth },
|
|
9767
9810
|
role: "listbox",
|
|
9768
|
-
children: /* @__PURE__ */ (0,
|
|
9811
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(context_default.Provider, { value: ctxValue, children: itemChildren })
|
|
9769
9812
|
}
|
|
9770
9813
|
) })
|
|
9771
9814
|
]
|
|
@@ -9779,7 +9822,7 @@ var Select = Object.assign(SelectRoot, {
|
|
|
9779
9822
|
var Select_default = Select;
|
|
9780
9823
|
|
|
9781
9824
|
// src/components/Skeleton/Skeleton.tsx
|
|
9782
|
-
var
|
|
9825
|
+
var import_jsx_runtime338 = require("react/jsx-runtime");
|
|
9783
9826
|
var SIZE_MAP = {
|
|
9784
9827
|
xs: "var(--spacing-space-1)",
|
|
9785
9828
|
sm: "var(--spacing-space-2)",
|
|
@@ -9795,7 +9838,7 @@ var Skeleton = (props) => {
|
|
|
9795
9838
|
...width != null && { width: SIZE_MAP[width] },
|
|
9796
9839
|
...height != null && { height: SIZE_MAP[height] }
|
|
9797
9840
|
};
|
|
9798
|
-
return /* @__PURE__ */ (0,
|
|
9841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime338.jsx)(
|
|
9799
9842
|
"div",
|
|
9800
9843
|
{
|
|
9801
9844
|
className: clsx_default("lib-xplat-skeleton", variant),
|
|
@@ -9808,20 +9851,20 @@ Skeleton.displayName = "Skeleton";
|
|
|
9808
9851
|
var Skeleton_default = Skeleton;
|
|
9809
9852
|
|
|
9810
9853
|
// src/components/Spinner/Spinner.tsx
|
|
9811
|
-
var
|
|
9854
|
+
var import_jsx_runtime339 = require("react/jsx-runtime");
|
|
9812
9855
|
var Spinner = (props) => {
|
|
9813
9856
|
const {
|
|
9814
9857
|
size = "md",
|
|
9815
9858
|
type = "brand"
|
|
9816
9859
|
} = props;
|
|
9817
|
-
return /* @__PURE__ */ (0,
|
|
9860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
|
|
9818
9861
|
"div",
|
|
9819
9862
|
{
|
|
9820
9863
|
className: clsx_default("lib-xplat-spinner", size, type),
|
|
9821
9864
|
role: "status",
|
|
9822
9865
|
"aria-label": "\uB85C\uB529 \uC911",
|
|
9823
|
-
children: /* @__PURE__ */ (0,
|
|
9824
|
-
/* @__PURE__ */ (0,
|
|
9866
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime339.jsxs)("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
9867
|
+
/* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
|
|
9825
9868
|
"circle",
|
|
9826
9869
|
{
|
|
9827
9870
|
className: "track",
|
|
@@ -9831,7 +9874,7 @@ var Spinner = (props) => {
|
|
|
9831
9874
|
strokeWidth: "3"
|
|
9832
9875
|
}
|
|
9833
9876
|
),
|
|
9834
|
-
/* @__PURE__ */ (0,
|
|
9877
|
+
/* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
|
|
9835
9878
|
"circle",
|
|
9836
9879
|
{
|
|
9837
9880
|
className: "indicator",
|
|
@@ -9850,20 +9893,20 @@ Spinner.displayName = "Spinner";
|
|
|
9850
9893
|
var Spinner_default = Spinner;
|
|
9851
9894
|
|
|
9852
9895
|
// src/components/Steps/Steps.tsx
|
|
9853
|
-
var
|
|
9896
|
+
var import_jsx_runtime340 = require("react/jsx-runtime");
|
|
9854
9897
|
var Steps = (props) => {
|
|
9855
9898
|
const {
|
|
9856
9899
|
items,
|
|
9857
9900
|
current,
|
|
9858
9901
|
type = "brand"
|
|
9859
9902
|
} = props;
|
|
9860
|
-
return /* @__PURE__ */ (0,
|
|
9903
|
+
return /* @__PURE__ */ (0, import_jsx_runtime340.jsx)("div", { className: clsx_default("lib-xplat-steps", type), children: items.map((item, index) => {
|
|
9861
9904
|
const status = index < current ? "completed" : index === current ? "active" : "pending";
|
|
9862
|
-
return /* @__PURE__ */ (0,
|
|
9863
|
-
/* @__PURE__ */ (0,
|
|
9864
|
-
/* @__PURE__ */ (0,
|
|
9865
|
-
/* @__PURE__ */ (0,
|
|
9866
|
-
item.description && /* @__PURE__ */ (0,
|
|
9905
|
+
return /* @__PURE__ */ (0, import_jsx_runtime340.jsxs)("div", { className: clsx_default("step-item", status), children: [
|
|
9906
|
+
/* @__PURE__ */ (0, import_jsx_runtime340.jsx)("div", { className: "step-circle", children: status === "completed" ? /* @__PURE__ */ (0, import_jsx_runtime340.jsx)(CheckIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime340.jsx)("span", { children: index + 1 }) }),
|
|
9907
|
+
/* @__PURE__ */ (0, import_jsx_runtime340.jsxs)("div", { className: "step-content", children: [
|
|
9908
|
+
/* @__PURE__ */ (0, import_jsx_runtime340.jsx)("span", { className: "step-title", children: item.title }),
|
|
9909
|
+
item.description && /* @__PURE__ */ (0, import_jsx_runtime340.jsx)("span", { className: "step-description", children: item.description })
|
|
9867
9910
|
] })
|
|
9868
9911
|
] }, index);
|
|
9869
9912
|
}) });
|
|
@@ -9872,8 +9915,8 @@ Steps.displayName = "Steps";
|
|
|
9872
9915
|
var Steps_default = Steps;
|
|
9873
9916
|
|
|
9874
9917
|
// src/components/Swiper/Swiper.tsx
|
|
9875
|
-
var
|
|
9876
|
-
var
|
|
9918
|
+
var import_react32 = __toESM(require("react"), 1);
|
|
9919
|
+
var import_jsx_runtime341 = require("react/jsx-runtime");
|
|
9877
9920
|
var Swiper = (props) => {
|
|
9878
9921
|
const {
|
|
9879
9922
|
auto = false,
|
|
@@ -9897,26 +9940,26 @@ var Swiper = (props) => {
|
|
|
9897
9940
|
const maxIndex = Math.max(0, totalSlides - viewItemCount);
|
|
9898
9941
|
const useLoop = loop && canSlide;
|
|
9899
9942
|
const cloneCount = useLoop ? totalSlides : 0;
|
|
9900
|
-
const extendedItems =
|
|
9943
|
+
const extendedItems = import_react32.default.useMemo(() => {
|
|
9901
9944
|
if (!useLoop) return items;
|
|
9902
9945
|
return [...items, ...items, ...items];
|
|
9903
9946
|
}, [items, useLoop]);
|
|
9904
9947
|
const initialIdx = Math.max(0, Math.min(indexProp ?? 0, maxIndex));
|
|
9905
|
-
const [innerIndex, setInnerIndex] =
|
|
9948
|
+
const [innerIndex, setInnerIndex] = import_react32.default.useState(
|
|
9906
9949
|
useLoop ? cloneCount + initialIdx : initialIdx
|
|
9907
9950
|
);
|
|
9908
|
-
const [isDragging, setIsDragging] =
|
|
9909
|
-
const [dragOffset, setDragOffset] =
|
|
9910
|
-
const [animated, setAnimated] =
|
|
9911
|
-
const [containerWidth, setContainerWidth] =
|
|
9912
|
-
const containerRef =
|
|
9913
|
-
const startXRef =
|
|
9914
|
-
const startTimeRef =
|
|
9915
|
-
const autoplayTimerRef =
|
|
9916
|
-
const resumeTimeoutRef =
|
|
9917
|
-
const [paused, setPaused] =
|
|
9918
|
-
const initializedRef =
|
|
9919
|
-
|
|
9951
|
+
const [isDragging, setIsDragging] = import_react32.default.useState(false);
|
|
9952
|
+
const [dragOffset, setDragOffset] = import_react32.default.useState(0);
|
|
9953
|
+
const [animated, setAnimated] = import_react32.default.useState(false);
|
|
9954
|
+
const [containerWidth, setContainerWidth] = import_react32.default.useState(0);
|
|
9955
|
+
const containerRef = import_react32.default.useRef(null);
|
|
9956
|
+
const startXRef = import_react32.default.useRef(0);
|
|
9957
|
+
const startTimeRef = import_react32.default.useRef(0);
|
|
9958
|
+
const autoplayTimerRef = import_react32.default.useRef(null);
|
|
9959
|
+
const resumeTimeoutRef = import_react32.default.useRef(null);
|
|
9960
|
+
const [paused, setPaused] = import_react32.default.useState(false);
|
|
9961
|
+
const initializedRef = import_react32.default.useRef(false);
|
|
9962
|
+
import_react32.default.useEffect(() => {
|
|
9920
9963
|
const el = containerRef.current;
|
|
9921
9964
|
if (!el) return;
|
|
9922
9965
|
const ro = new ResizeObserver((entries) => {
|
|
@@ -9939,7 +9982,7 @@ var Swiper = (props) => {
|
|
|
9939
9982
|
return ((inner - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
9940
9983
|
};
|
|
9941
9984
|
const realIndex = getRealIndex(innerIndex);
|
|
9942
|
-
const moveToInner =
|
|
9985
|
+
const moveToInner = import_react32.default.useCallback(
|
|
9943
9986
|
(idx, withAnim = true) => {
|
|
9944
9987
|
if (!useLoop) {
|
|
9945
9988
|
setAnimated(withAnim);
|
|
@@ -9967,7 +10010,7 @@ var Swiper = (props) => {
|
|
|
9967
10010
|
},
|
|
9968
10011
|
[useLoop, cloneCount, totalSlides]
|
|
9969
10012
|
);
|
|
9970
|
-
const handleTransitionEnd =
|
|
10013
|
+
const handleTransitionEnd = import_react32.default.useCallback(() => {
|
|
9971
10014
|
if (!useLoop) return;
|
|
9972
10015
|
const real = getRealIndex(innerIndex);
|
|
9973
10016
|
const canonical = cloneCount + real;
|
|
@@ -9977,7 +10020,7 @@ var Swiper = (props) => {
|
|
|
9977
10020
|
}
|
|
9978
10021
|
onChange?.(Math.min(real, maxIndex));
|
|
9979
10022
|
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange]);
|
|
9980
|
-
const slideTo =
|
|
10023
|
+
const slideTo = import_react32.default.useCallback(
|
|
9981
10024
|
(logicalIndex) => {
|
|
9982
10025
|
if (!canSlide) return;
|
|
9983
10026
|
const clamped = useLoop ? logicalIndex : Math.max(0, Math.min(logicalIndex, maxIndex));
|
|
@@ -9987,7 +10030,7 @@ var Swiper = (props) => {
|
|
|
9987
10030
|
},
|
|
9988
10031
|
[canSlide, useLoop, cloneCount, maxIndex, onChange, moveToInner]
|
|
9989
10032
|
);
|
|
9990
|
-
const slideNext =
|
|
10033
|
+
const slideNext = import_react32.default.useCallback(() => {
|
|
9991
10034
|
if (!canSlide) return;
|
|
9992
10035
|
const nextInner = innerIndex + slideBy;
|
|
9993
10036
|
if (useLoop) {
|
|
@@ -9996,7 +10039,7 @@ var Swiper = (props) => {
|
|
|
9996
10039
|
moveToInner(Math.min(nextInner, maxIndex), true);
|
|
9997
10040
|
}
|
|
9998
10041
|
}, [canSlide, useLoop, innerIndex, slideBy, maxIndex, moveToInner]);
|
|
9999
|
-
const slidePrev =
|
|
10042
|
+
const slidePrev = import_react32.default.useCallback(() => {
|
|
10000
10043
|
if (!canSlide) return;
|
|
10001
10044
|
const prevInner = innerIndex - slideBy;
|
|
10002
10045
|
if (useLoop) {
|
|
@@ -10005,7 +10048,7 @@ var Swiper = (props) => {
|
|
|
10005
10048
|
moveToInner(Math.max(prevInner, 0), true);
|
|
10006
10049
|
}
|
|
10007
10050
|
}, [canSlide, useLoop, innerIndex, slideBy, moveToInner]);
|
|
10008
|
-
|
|
10051
|
+
import_react32.default.useEffect(() => {
|
|
10009
10052
|
if (indexProp === void 0) return;
|
|
10010
10053
|
const clamped = Math.max(0, Math.min(indexProp, maxIndex));
|
|
10011
10054
|
const target = useLoop ? cloneCount + clamped : clamped;
|
|
@@ -10013,12 +10056,12 @@ var Swiper = (props) => {
|
|
|
10013
10056
|
moveToInner(target, true);
|
|
10014
10057
|
}
|
|
10015
10058
|
}, [indexProp]);
|
|
10016
|
-
|
|
10059
|
+
import_react32.default.useImperativeHandle(swiperRef, () => ({
|
|
10017
10060
|
slidePrev,
|
|
10018
10061
|
slideNext,
|
|
10019
10062
|
slideTo
|
|
10020
10063
|
}));
|
|
10021
|
-
|
|
10064
|
+
import_react32.default.useEffect(() => {
|
|
10022
10065
|
if (!auto || !canSlide || paused) return;
|
|
10023
10066
|
autoplayTimerRef.current = setInterval(slideNext, autoplayDelay);
|
|
10024
10067
|
return () => {
|
|
@@ -10044,7 +10087,7 @@ var Swiper = (props) => {
|
|
|
10044
10087
|
resumeTimeoutRef.current = null;
|
|
10045
10088
|
}, pauseOnInteraction);
|
|
10046
10089
|
};
|
|
10047
|
-
|
|
10090
|
+
import_react32.default.useEffect(() => {
|
|
10048
10091
|
return () => {
|
|
10049
10092
|
if (resumeTimeoutRef.current) clearTimeout(resumeTimeoutRef.current);
|
|
10050
10093
|
};
|
|
@@ -10062,7 +10105,7 @@ var Swiper = (props) => {
|
|
|
10062
10105
|
startXRef.current = getClientX(e);
|
|
10063
10106
|
startTimeRef.current = Date.now();
|
|
10064
10107
|
};
|
|
10065
|
-
|
|
10108
|
+
import_react32.default.useEffect(() => {
|
|
10066
10109
|
if (!isDragging) return;
|
|
10067
10110
|
const handleMove = (e) => {
|
|
10068
10111
|
setDragOffset(getClientX(e) - startXRef.current);
|
|
@@ -10101,8 +10144,8 @@ var Swiper = (props) => {
|
|
|
10101
10144
|
}, [isDragging, dragOffset, innerIndex, useLoop, maxIndex, slideStep, moveToInner]);
|
|
10102
10145
|
const slideWidthPercent = 100 / viewItemCount;
|
|
10103
10146
|
const gapAdjust = spaceBetween * (viewItemCount - 1) / viewItemCount;
|
|
10104
|
-
const slideElements =
|
|
10105
|
-
() => extendedItems.map((item, idx) => /* @__PURE__ */ (0,
|
|
10147
|
+
const slideElements = import_react32.default.useMemo(
|
|
10148
|
+
() => extendedItems.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime341.jsx)(
|
|
10106
10149
|
"div",
|
|
10107
10150
|
{
|
|
10108
10151
|
className: "lib-xplat-swiper__slide",
|
|
@@ -10121,15 +10164,15 @@ var Swiper = (props) => {
|
|
|
10121
10164
|
Math.floor(realIndex / slideBy),
|
|
10122
10165
|
totalSteps - 1
|
|
10123
10166
|
);
|
|
10124
|
-
return /* @__PURE__ */ (0,
|
|
10125
|
-
/* @__PURE__ */ (0,
|
|
10167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime341.jsxs)("div", { className: "lib-xplat-swiper", ref: containerRef, children: [
|
|
10168
|
+
/* @__PURE__ */ (0, import_jsx_runtime341.jsx)(
|
|
10126
10169
|
"div",
|
|
10127
10170
|
{
|
|
10128
10171
|
className: "lib-xplat-swiper__viewport",
|
|
10129
10172
|
onMouseDown: handleDragStart,
|
|
10130
10173
|
onTouchStart: handleDragStart,
|
|
10131
10174
|
onDragStart: (e) => e.preventDefault(),
|
|
10132
|
-
children: /* @__PURE__ */ (0,
|
|
10175
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime341.jsx)(
|
|
10133
10176
|
"div",
|
|
10134
10177
|
{
|
|
10135
10178
|
className: clsx_default(
|
|
@@ -10147,7 +10190,7 @@ var Swiper = (props) => {
|
|
|
10147
10190
|
)
|
|
10148
10191
|
}
|
|
10149
10192
|
),
|
|
10150
|
-
showProgress && canSlide && /* @__PURE__ */ (0,
|
|
10193
|
+
showProgress && canSlide && /* @__PURE__ */ (0, import_jsx_runtime341.jsx)("div", { className: "lib-xplat-swiper__progress", children: /* @__PURE__ */ (0, import_jsx_runtime341.jsx)("div", { className: "lib-xplat-swiper__progress-track", children: /* @__PURE__ */ (0, import_jsx_runtime341.jsx)(
|
|
10151
10194
|
"span",
|
|
10152
10195
|
{
|
|
10153
10196
|
className: "lib-xplat-swiper__progress-fill",
|
|
@@ -10157,7 +10200,7 @@ var Swiper = (props) => {
|
|
|
10157
10200
|
}
|
|
10158
10201
|
}
|
|
10159
10202
|
) }) }),
|
|
10160
|
-
canSlide && /* @__PURE__ */ (0,
|
|
10203
|
+
canSlide && /* @__PURE__ */ (0, import_jsx_runtime341.jsx)("div", { className: "lib-xplat-swiper__dots", children: Array.from({ length: totalSteps }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime341.jsx)(
|
|
10161
10204
|
"button",
|
|
10162
10205
|
{
|
|
10163
10206
|
className: clsx_default(
|
|
@@ -10175,8 +10218,8 @@ Swiper.displayName = "Swiper";
|
|
|
10175
10218
|
var Swiper_default = Swiper;
|
|
10176
10219
|
|
|
10177
10220
|
// src/components/Switch/Switch.tsx
|
|
10178
|
-
var
|
|
10179
|
-
var
|
|
10221
|
+
var import_react33 = __toESM(require("react"), 1);
|
|
10222
|
+
var import_jsx_runtime342 = require("react/jsx-runtime");
|
|
10180
10223
|
var KNOB_TRANSITION_MS = 250;
|
|
10181
10224
|
var Switch = (props) => {
|
|
10182
10225
|
const {
|
|
@@ -10186,9 +10229,9 @@ var Switch = (props) => {
|
|
|
10186
10229
|
disabled,
|
|
10187
10230
|
onChange
|
|
10188
10231
|
} = props;
|
|
10189
|
-
const [isAnimating, setIsAnimating] =
|
|
10190
|
-
const timeoutRef =
|
|
10191
|
-
|
|
10232
|
+
const [isAnimating, setIsAnimating] = import_react33.default.useState(false);
|
|
10233
|
+
const timeoutRef = import_react33.default.useRef(null);
|
|
10234
|
+
import_react33.default.useEffect(() => {
|
|
10192
10235
|
return () => {
|
|
10193
10236
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
10194
10237
|
};
|
|
@@ -10203,7 +10246,7 @@ var Switch = (props) => {
|
|
|
10203
10246
|
timeoutRef.current = null;
|
|
10204
10247
|
}, KNOB_TRANSITION_MS);
|
|
10205
10248
|
};
|
|
10206
|
-
return /* @__PURE__ */ (0,
|
|
10249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime342.jsx)(
|
|
10207
10250
|
"div",
|
|
10208
10251
|
{
|
|
10209
10252
|
className: clsx_default(
|
|
@@ -10216,7 +10259,7 @@ var Switch = (props) => {
|
|
|
10216
10259
|
),
|
|
10217
10260
|
onClick: handleClick,
|
|
10218
10261
|
"aria-disabled": disabled || isAnimating,
|
|
10219
|
-
children: /* @__PURE__ */ (0,
|
|
10262
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime342.jsx)("div", { className: clsx_default("knob", value ? "checked" : void 0) })
|
|
10220
10263
|
}
|
|
10221
10264
|
);
|
|
10222
10265
|
};
|
|
@@ -10224,17 +10267,17 @@ Switch.displayName = "Switch";
|
|
|
10224
10267
|
var Switch_default = Switch;
|
|
10225
10268
|
|
|
10226
10269
|
// src/components/Table/TableContext.tsx
|
|
10227
|
-
var
|
|
10228
|
-
var TableContext =
|
|
10270
|
+
var import_react34 = __toESM(require("react"), 1);
|
|
10271
|
+
var TableContext = import_react34.default.createContext(null);
|
|
10229
10272
|
var useTableContext = () => {
|
|
10230
|
-
const ctx =
|
|
10273
|
+
const ctx = import_react34.default.useContext(TableContext);
|
|
10231
10274
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
10232
10275
|
return ctx;
|
|
10233
10276
|
};
|
|
10234
10277
|
var TableContext_default = TableContext;
|
|
10235
10278
|
|
|
10236
10279
|
// src/components/Table/Table.tsx
|
|
10237
|
-
var
|
|
10280
|
+
var import_jsx_runtime343 = require("react/jsx-runtime");
|
|
10238
10281
|
var Table = (props) => {
|
|
10239
10282
|
const {
|
|
10240
10283
|
children,
|
|
@@ -10244,7 +10287,7 @@ var Table = (props) => {
|
|
|
10244
10287
|
headerSticky = false,
|
|
10245
10288
|
stickyShadow = true
|
|
10246
10289
|
} = props;
|
|
10247
|
-
return /* @__PURE__ */ (0,
|
|
10290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime343.jsx)("div", { className: `lib-xplat-table-wrapper ${size}`, children: /* @__PURE__ */ (0, import_jsx_runtime343.jsx)(
|
|
10248
10291
|
TableContext_default.Provider,
|
|
10249
10292
|
{
|
|
10250
10293
|
value: {
|
|
@@ -10253,7 +10296,7 @@ var Table = (props) => {
|
|
|
10253
10296
|
headerSticky,
|
|
10254
10297
|
stickyShadow
|
|
10255
10298
|
},
|
|
10256
|
-
children: /* @__PURE__ */ (0,
|
|
10299
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime343.jsx)("table", { className: "lib-xplat-table", children })
|
|
10257
10300
|
}
|
|
10258
10301
|
) });
|
|
10259
10302
|
};
|
|
@@ -10261,41 +10304,41 @@ Table.displayName = "Table";
|
|
|
10261
10304
|
var Table_default = Table;
|
|
10262
10305
|
|
|
10263
10306
|
// src/components/Table/TableBody.tsx
|
|
10264
|
-
var
|
|
10307
|
+
var import_jsx_runtime344 = require("react/jsx-runtime");
|
|
10265
10308
|
var TableBody = (props) => {
|
|
10266
10309
|
const { children } = props;
|
|
10267
|
-
return /* @__PURE__ */ (0,
|
|
10310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime344.jsx)("tbody", { children });
|
|
10268
10311
|
};
|
|
10269
10312
|
TableBody.displayName = "TableBody";
|
|
10270
10313
|
var TableBody_default = TableBody;
|
|
10271
10314
|
|
|
10272
10315
|
// src/components/Table/TableCell.tsx
|
|
10273
|
-
var
|
|
10316
|
+
var import_react37 = __toESM(require("react"), 1);
|
|
10274
10317
|
|
|
10275
10318
|
// src/components/Table/TableHeadContext.tsx
|
|
10276
|
-
var
|
|
10277
|
-
var TableHeadContext =
|
|
10319
|
+
var import_react35 = __toESM(require("react"), 1);
|
|
10320
|
+
var TableHeadContext = import_react35.default.createContext(
|
|
10278
10321
|
null
|
|
10279
10322
|
);
|
|
10280
10323
|
var useTableHeadContext = () => {
|
|
10281
|
-
const ctx =
|
|
10324
|
+
const ctx = import_react35.default.useContext(TableHeadContext);
|
|
10282
10325
|
return ctx;
|
|
10283
10326
|
};
|
|
10284
10327
|
var TableHeadContext_default = TableHeadContext;
|
|
10285
10328
|
|
|
10286
10329
|
// src/components/Table/TableRowContext.tsx
|
|
10287
|
-
var
|
|
10288
|
-
var TableRowContext =
|
|
10330
|
+
var import_react36 = __toESM(require("react"), 1);
|
|
10331
|
+
var TableRowContext = import_react36.default.createContext(null);
|
|
10289
10332
|
var useTableRowContext = () => {
|
|
10290
|
-
const ctx =
|
|
10333
|
+
const ctx = import_react36.default.useContext(TableRowContext);
|
|
10291
10334
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
10292
10335
|
return ctx;
|
|
10293
10336
|
};
|
|
10294
10337
|
var TableRowContext_default = TableRowContext;
|
|
10295
10338
|
|
|
10296
10339
|
// src/components/Table/TableCell.tsx
|
|
10297
|
-
var
|
|
10298
|
-
var TableCell =
|
|
10340
|
+
var import_jsx_runtime345 = require("react/jsx-runtime");
|
|
10341
|
+
var TableCell = import_react37.default.memo((props) => {
|
|
10299
10342
|
const {
|
|
10300
10343
|
children,
|
|
10301
10344
|
align = "center",
|
|
@@ -10309,9 +10352,9 @@ var TableCell = import_react38.default.memo((props) => {
|
|
|
10309
10352
|
const { registerStickyCell, stickyCells } = useTableRowContext();
|
|
10310
10353
|
const { stickyShadow } = useTableContext();
|
|
10311
10354
|
const headContext = useTableHeadContext();
|
|
10312
|
-
const [left, setLeft] =
|
|
10313
|
-
const cellRef =
|
|
10314
|
-
const calculateLeft =
|
|
10355
|
+
const [left, setLeft] = import_react37.default.useState(0);
|
|
10356
|
+
const cellRef = import_react37.default.useRef(null);
|
|
10357
|
+
const calculateLeft = import_react37.default.useCallback(() => {
|
|
10315
10358
|
if (!cellRef.current) return 0;
|
|
10316
10359
|
let totalLeft = 0;
|
|
10317
10360
|
for (const ref of stickyCells) {
|
|
@@ -10320,7 +10363,7 @@ var TableCell = import_react38.default.memo((props) => {
|
|
|
10320
10363
|
}
|
|
10321
10364
|
return totalLeft;
|
|
10322
10365
|
}, [stickyCells]);
|
|
10323
|
-
|
|
10366
|
+
import_react37.default.useEffect(() => {
|
|
10324
10367
|
if (!isSticky || !cellRef.current) return;
|
|
10325
10368
|
registerStickyCell(cellRef);
|
|
10326
10369
|
setLeft(calculateLeft());
|
|
@@ -10339,7 +10382,7 @@ var TableCell = import_react38.default.memo((props) => {
|
|
|
10339
10382
|
const CellTag = isHeaderCell ? "th" : "td";
|
|
10340
10383
|
const isLastSticky = isSticky && stickyCells[stickyCells.length - 1] === cellRef;
|
|
10341
10384
|
const enableHover = headContext && headContext.cellHover;
|
|
10342
|
-
return /* @__PURE__ */ (0,
|
|
10385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime345.jsx)(
|
|
10343
10386
|
CellTag,
|
|
10344
10387
|
{
|
|
10345
10388
|
ref: cellRef,
|
|
@@ -10366,21 +10409,21 @@ TableCell.displayName = "TableCell";
|
|
|
10366
10409
|
var TableCell_default = TableCell;
|
|
10367
10410
|
|
|
10368
10411
|
// src/components/Table/TableHead.tsx
|
|
10369
|
-
var
|
|
10412
|
+
var import_jsx_runtime346 = require("react/jsx-runtime");
|
|
10370
10413
|
var TableHead = ({
|
|
10371
10414
|
children,
|
|
10372
10415
|
cellHover = false
|
|
10373
10416
|
}) => {
|
|
10374
10417
|
const { headerSticky } = useTableContext();
|
|
10375
|
-
return /* @__PURE__ */ (0,
|
|
10418
|
+
return /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(TableHeadContext_default.Provider, { value: { cellHover }, children: /* @__PURE__ */ (0, import_jsx_runtime346.jsx)("thead", { className: clsx_default(headerSticky ? "table-sticky" : null), children }) });
|
|
10376
10419
|
};
|
|
10377
10420
|
TableHead.displayName = "TableHead";
|
|
10378
10421
|
var TableHead_default = TableHead;
|
|
10379
10422
|
|
|
10380
10423
|
// src/components/Table/TableRow.tsx
|
|
10381
|
-
var
|
|
10382
|
-
var
|
|
10383
|
-
var TableRow =
|
|
10424
|
+
var import_react38 = __toESM(require("react"), 1);
|
|
10425
|
+
var import_jsx_runtime347 = require("react/jsx-runtime");
|
|
10426
|
+
var TableRow = import_react38.default.memo((props) => {
|
|
10384
10427
|
const {
|
|
10385
10428
|
children,
|
|
10386
10429
|
type = "secondary",
|
|
@@ -10389,14 +10432,14 @@ var TableRow = import_react39.default.memo((props) => {
|
|
|
10389
10432
|
onClick
|
|
10390
10433
|
} = props;
|
|
10391
10434
|
const { rowBorderUse } = useTableContext();
|
|
10392
|
-
const [stickyCells, setStickyCells] =
|
|
10435
|
+
const [stickyCells, setStickyCells] = import_react38.default.useState([]);
|
|
10393
10436
|
const registerStickyCell = (ref) => {
|
|
10394
10437
|
setStickyCells((prev) => {
|
|
10395
10438
|
if (prev.includes(ref)) return prev;
|
|
10396
10439
|
return [...prev, ref];
|
|
10397
10440
|
});
|
|
10398
10441
|
};
|
|
10399
|
-
return /* @__PURE__ */ (0,
|
|
10442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime347.jsx)(TableRowContext_default.Provider, { value: { stickyCells, registerStickyCell }, children: /* @__PURE__ */ (0, import_jsx_runtime347.jsx)(
|
|
10400
10443
|
"tr",
|
|
10401
10444
|
{
|
|
10402
10445
|
className: clsx_default(
|
|
@@ -10420,7 +10463,7 @@ TableRow.displayName = "TableRow";
|
|
|
10420
10463
|
var TableRow_default = TableRow;
|
|
10421
10464
|
|
|
10422
10465
|
// src/components/Tag/Tag.tsx
|
|
10423
|
-
var
|
|
10466
|
+
var import_jsx_runtime348 = require("react/jsx-runtime");
|
|
10424
10467
|
var Tag = (props) => {
|
|
10425
10468
|
const {
|
|
10426
10469
|
children,
|
|
@@ -10430,7 +10473,7 @@ var Tag = (props) => {
|
|
|
10430
10473
|
disabled = false,
|
|
10431
10474
|
colorIndex
|
|
10432
10475
|
} = props;
|
|
10433
|
-
return /* @__PURE__ */ (0,
|
|
10476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime348.jsxs)(
|
|
10434
10477
|
"span",
|
|
10435
10478
|
{
|
|
10436
10479
|
className: clsx_default(
|
|
@@ -10441,8 +10484,8 @@ var Tag = (props) => {
|
|
|
10441
10484
|
disabled && "disabled"
|
|
10442
10485
|
),
|
|
10443
10486
|
children: [
|
|
10444
|
-
/* @__PURE__ */ (0,
|
|
10445
|
-
onClose && /* @__PURE__ */ (0,
|
|
10487
|
+
/* @__PURE__ */ (0, import_jsx_runtime348.jsx)("span", { className: "tag-label", children }),
|
|
10488
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime348.jsx)("button", { className: "tag-close", onClick: onClose, "aria-label": "\uC0AD\uC81C", disabled, children: /* @__PURE__ */ (0, import_jsx_runtime348.jsx)(XIcon_default, {}) })
|
|
10446
10489
|
]
|
|
10447
10490
|
}
|
|
10448
10491
|
);
|
|
@@ -10451,9 +10494,9 @@ Tag.displayName = "Tag";
|
|
|
10451
10494
|
var Tag_default = Tag;
|
|
10452
10495
|
|
|
10453
10496
|
// src/components/TextArea/TextArea.tsx
|
|
10454
|
-
var
|
|
10455
|
-
var
|
|
10456
|
-
var TextArea =
|
|
10497
|
+
var import_react39 = __toESM(require("react"), 1);
|
|
10498
|
+
var import_jsx_runtime349 = require("react/jsx-runtime");
|
|
10499
|
+
var TextArea = import_react39.default.forwardRef(
|
|
10457
10500
|
(props, ref) => {
|
|
10458
10501
|
const {
|
|
10459
10502
|
className,
|
|
@@ -10463,7 +10506,7 @@ var TextArea = import_react40.default.forwardRef(
|
|
|
10463
10506
|
disabled,
|
|
10464
10507
|
...textareaProps
|
|
10465
10508
|
} = props;
|
|
10466
|
-
return /* @__PURE__ */ (0,
|
|
10509
|
+
return /* @__PURE__ */ (0, import_jsx_runtime349.jsx)("div", { className: clsx_default("lib-xplat-textarea-wrap", className), children: /* @__PURE__ */ (0, import_jsx_runtime349.jsx)(
|
|
10467
10510
|
"textarea",
|
|
10468
10511
|
{
|
|
10469
10512
|
...textareaProps,
|
|
@@ -10480,25 +10523,25 @@ TextArea.displayName = "TextArea";
|
|
|
10480
10523
|
var TextArea_default = TextArea;
|
|
10481
10524
|
|
|
10482
10525
|
// src/components/Toast/Toast.tsx
|
|
10483
|
-
var
|
|
10526
|
+
var import_react40 = __toESM(require("react"), 1);
|
|
10484
10527
|
var import_react_dom4 = require("react-dom");
|
|
10485
|
-
var
|
|
10486
|
-
var ToastContext =
|
|
10528
|
+
var import_jsx_runtime350 = require("react/jsx-runtime");
|
|
10529
|
+
var ToastContext = import_react40.default.createContext(null);
|
|
10487
10530
|
var useToast = () => {
|
|
10488
|
-
const ctx =
|
|
10531
|
+
const ctx = import_react40.default.useContext(ToastContext);
|
|
10489
10532
|
if (!ctx) throw new Error("useToast must be used within ToastProvider");
|
|
10490
10533
|
return ctx;
|
|
10491
10534
|
};
|
|
10492
10535
|
var EXIT_DURATION = 300;
|
|
10493
10536
|
var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
10494
|
-
const ref =
|
|
10495
|
-
const [height, setHeight] =
|
|
10496
|
-
|
|
10537
|
+
const ref = import_react40.default.useRef(null);
|
|
10538
|
+
const [height, setHeight] = import_react40.default.useState(void 0);
|
|
10539
|
+
import_react40.default.useEffect(() => {
|
|
10497
10540
|
if (ref.current && !isExiting) {
|
|
10498
10541
|
setHeight(ref.current.offsetHeight);
|
|
10499
10542
|
}
|
|
10500
10543
|
}, [isExiting]);
|
|
10501
|
-
return /* @__PURE__ */ (0,
|
|
10544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime350.jsx)(
|
|
10502
10545
|
"div",
|
|
10503
10546
|
{
|
|
10504
10547
|
className: clsx_default("lib-xplat-toast-wrapper", { exit: isExiting }),
|
|
@@ -10506,15 +10549,15 @@ var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
|
10506
10549
|
maxHeight: isExiting ? 0 : height ?? "none",
|
|
10507
10550
|
marginBottom: isExiting ? 0 : void 0
|
|
10508
10551
|
},
|
|
10509
|
-
children: /* @__PURE__ */ (0,
|
|
10552
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime350.jsxs)(
|
|
10510
10553
|
"div",
|
|
10511
10554
|
{
|
|
10512
10555
|
ref,
|
|
10513
10556
|
className: clsx_default("lib-xplat-toast", item.type, { exit: isExiting }),
|
|
10514
10557
|
role: "alert",
|
|
10515
10558
|
children: [
|
|
10516
|
-
/* @__PURE__ */ (0,
|
|
10517
|
-
/* @__PURE__ */ (0,
|
|
10559
|
+
/* @__PURE__ */ (0, import_jsx_runtime350.jsx)("span", { className: "message", children: item.message }),
|
|
10560
|
+
/* @__PURE__ */ (0, import_jsx_runtime350.jsx)("button", { className: "close-btn", onClick: onClose, "aria-label": "\uB2EB\uAE30", children: "\xD7" })
|
|
10518
10561
|
]
|
|
10519
10562
|
}
|
|
10520
10563
|
)
|
|
@@ -10525,13 +10568,13 @@ var ToastProvider = ({
|
|
|
10525
10568
|
children,
|
|
10526
10569
|
position = "top-right"
|
|
10527
10570
|
}) => {
|
|
10528
|
-
const [toasts, setToasts] =
|
|
10529
|
-
const [removing, setRemoving] =
|
|
10530
|
-
const [mounted, setMounted] =
|
|
10531
|
-
|
|
10571
|
+
const [toasts, setToasts] = import_react40.default.useState([]);
|
|
10572
|
+
const [removing, setRemoving] = import_react40.default.useState(/* @__PURE__ */ new Set());
|
|
10573
|
+
const [mounted, setMounted] = import_react40.default.useState(false);
|
|
10574
|
+
import_react40.default.useEffect(() => {
|
|
10532
10575
|
setMounted(true);
|
|
10533
10576
|
}, []);
|
|
10534
|
-
const remove =
|
|
10577
|
+
const remove = import_react40.default.useCallback((id) => {
|
|
10535
10578
|
setRemoving((prev) => new Set(prev).add(id));
|
|
10536
10579
|
setTimeout(() => {
|
|
10537
10580
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
@@ -10542,7 +10585,7 @@ var ToastProvider = ({
|
|
|
10542
10585
|
});
|
|
10543
10586
|
}, EXIT_DURATION);
|
|
10544
10587
|
}, []);
|
|
10545
|
-
const toast =
|
|
10588
|
+
const toast = import_react40.default.useCallback(
|
|
10546
10589
|
(type, message, duration = 3e3) => {
|
|
10547
10590
|
const id = `${Date.now()}-${Math.random()}`;
|
|
10548
10591
|
setToasts((prev) => [...prev, { id, type, message }]);
|
|
@@ -10552,10 +10595,10 @@ var ToastProvider = ({
|
|
|
10552
10595
|
},
|
|
10553
10596
|
[remove]
|
|
10554
10597
|
);
|
|
10555
|
-
return /* @__PURE__ */ (0,
|
|
10598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime350.jsxs)(ToastContext.Provider, { value: { toast }, children: [
|
|
10556
10599
|
children,
|
|
10557
10600
|
mounted && (0, import_react_dom4.createPortal)(
|
|
10558
|
-
/* @__PURE__ */ (0,
|
|
10601
|
+
/* @__PURE__ */ (0, import_jsx_runtime350.jsx)("div", { className: clsx_default("lib-xplat-toast-container", position), children: toasts.map((t) => /* @__PURE__ */ (0, import_jsx_runtime350.jsx)(
|
|
10559
10602
|
ToastItemComponent,
|
|
10560
10603
|
{
|
|
10561
10604
|
item: t,
|
|
@@ -10571,68 +10614,112 @@ var ToastProvider = ({
|
|
|
10571
10614
|
ToastProvider.displayName = "ToastProvider";
|
|
10572
10615
|
|
|
10573
10616
|
// src/components/Tooltip/Tooltip.tsx
|
|
10574
|
-
var
|
|
10575
|
-
var
|
|
10617
|
+
var import_react41 = __toESM(require("react"), 1);
|
|
10618
|
+
var import_jsx_runtime351 = require("react/jsx-runtime");
|
|
10576
10619
|
var OFFSET = 12;
|
|
10620
|
+
var GAP = 8;
|
|
10577
10621
|
var SHOW_DELAY = 300;
|
|
10578
10622
|
var Tooltip = (props) => {
|
|
10579
10623
|
const {
|
|
10580
|
-
|
|
10624
|
+
children,
|
|
10581
10625
|
title,
|
|
10582
10626
|
description,
|
|
10583
|
-
|
|
10627
|
+
type = "dark",
|
|
10628
|
+
follow = false,
|
|
10584
10629
|
disabled = false
|
|
10585
10630
|
} = props;
|
|
10586
|
-
const triggerRef =
|
|
10587
|
-
const tooltipRef =
|
|
10588
|
-
const [visible, setVisible] =
|
|
10589
|
-
const [pos, setPos] =
|
|
10590
|
-
const delayTimer =
|
|
10591
|
-
const
|
|
10631
|
+
const triggerRef = import_react41.default.useRef(null);
|
|
10632
|
+
const tooltipRef = import_react41.default.useRef(null);
|
|
10633
|
+
const [visible, setVisible] = import_react41.default.useState(false);
|
|
10634
|
+
const [pos, setPos] = import_react41.default.useState({ left: 0, top: 0 });
|
|
10635
|
+
const delayTimer = import_react41.default.useRef(0);
|
|
10636
|
+
const rafRef = import_react41.default.useRef(0);
|
|
10637
|
+
const cursor = import_react41.default.useRef(null);
|
|
10638
|
+
const clamp = import_react41.default.useCallback((left, top, w, h) => {
|
|
10639
|
+
const vw = window.innerWidth;
|
|
10640
|
+
const vh = window.innerHeight;
|
|
10641
|
+
return {
|
|
10642
|
+
left: Math.min(Math.max(GAP, left), Math.max(GAP, vw - w - GAP)),
|
|
10643
|
+
top: Math.min(Math.max(GAP, top), Math.max(GAP, vh - h - GAP))
|
|
10644
|
+
};
|
|
10645
|
+
}, []);
|
|
10646
|
+
const placeAtCursor = import_react41.default.useCallback((x, y) => {
|
|
10592
10647
|
const el = tooltipRef.current;
|
|
10593
10648
|
if (!el) return;
|
|
10594
10649
|
const w = el.offsetWidth;
|
|
10595
10650
|
const h = el.offsetHeight;
|
|
10596
|
-
|
|
10597
|
-
let
|
|
10598
|
-
|
|
10599
|
-
if (
|
|
10600
|
-
|
|
10601
|
-
|
|
10602
|
-
|
|
10603
|
-
|
|
10604
|
-
|
|
10651
|
+
let left = x + OFFSET;
|
|
10652
|
+
let top = y - h - OFFSET;
|
|
10653
|
+
if (left + w > window.innerWidth - GAP) left = x - w - OFFSET;
|
|
10654
|
+
if (top < GAP) top = y + OFFSET;
|
|
10655
|
+
setPos(clamp(left, top, w, h));
|
|
10656
|
+
}, [clamp]);
|
|
10657
|
+
const placeAtTrigger = import_react41.default.useCallback(() => {
|
|
10658
|
+
const el = tooltipRef.current;
|
|
10659
|
+
const trigger = triggerRef.current;
|
|
10660
|
+
if (!el || !trigger) return;
|
|
10661
|
+
const w = el.offsetWidth;
|
|
10662
|
+
const h = el.offsetHeight;
|
|
10663
|
+
const rect = trigger.getBoundingClientRect();
|
|
10664
|
+
let top = rect.top - h - GAP;
|
|
10665
|
+
if (top < GAP) top = rect.bottom + GAP;
|
|
10666
|
+
const left = rect.left + rect.width / 2 - w / 2;
|
|
10667
|
+
setPos(clamp(left, top, w, h));
|
|
10668
|
+
}, [clamp]);
|
|
10669
|
+
const reposition = import_react41.default.useCallback(() => {
|
|
10670
|
+
if (follow && cursor.current) {
|
|
10671
|
+
placeAtCursor(cursor.current.x, cursor.current.y);
|
|
10672
|
+
} else {
|
|
10673
|
+
placeAtTrigger();
|
|
10674
|
+
}
|
|
10675
|
+
}, [follow, placeAtCursor, placeAtTrigger]);
|
|
10676
|
+
const handleMouseEnter = import_react41.default.useCallback((e) => {
|
|
10605
10677
|
if (disabled) return;
|
|
10606
|
-
|
|
10607
|
-
|
|
10608
|
-
}, SHOW_DELAY);
|
|
10678
|
+
cursor.current = { x: e.clientX, y: e.clientY };
|
|
10679
|
+
delayTimer.current = window.setTimeout(() => setVisible(true), SHOW_DELAY);
|
|
10609
10680
|
}, [disabled]);
|
|
10610
|
-
const handleMouseMove =
|
|
10611
|
-
|
|
10612
|
-
|
|
10613
|
-
|
|
10614
|
-
|
|
10615
|
-
|
|
10616
|
-
|
|
10617
|
-
}, []);
|
|
10618
|
-
const
|
|
10681
|
+
const handleMouseMove = import_react41.default.useCallback((e) => {
|
|
10682
|
+
cursor.current = { x: e.clientX, y: e.clientY };
|
|
10683
|
+
if (!visible || !follow) return;
|
|
10684
|
+
cancelAnimationFrame(rafRef.current);
|
|
10685
|
+
rafRef.current = requestAnimationFrame(() => {
|
|
10686
|
+
if (cursor.current) placeAtCursor(cursor.current.x, cursor.current.y);
|
|
10687
|
+
});
|
|
10688
|
+
}, [visible, follow, placeAtCursor]);
|
|
10689
|
+
const close = import_react41.default.useCallback(() => {
|
|
10619
10690
|
window.clearTimeout(delayTimer.current);
|
|
10691
|
+
cancelAnimationFrame(rafRef.current);
|
|
10620
10692
|
setVisible(false);
|
|
10621
10693
|
}, []);
|
|
10622
|
-
const
|
|
10694
|
+
const handleMouseLeave = import_react41.default.useCallback(() => {
|
|
10695
|
+
cursor.current = null;
|
|
10696
|
+
close();
|
|
10697
|
+
}, [close]);
|
|
10698
|
+
const handleFocus = import_react41.default.useCallback(() => {
|
|
10623
10699
|
if (disabled) return;
|
|
10700
|
+
cursor.current = null;
|
|
10624
10701
|
setVisible(true);
|
|
10625
10702
|
}, [disabled]);
|
|
10626
|
-
|
|
10627
|
-
|
|
10703
|
+
import_react41.default.useLayoutEffect(() => {
|
|
10704
|
+
if (!visible) return;
|
|
10705
|
+
reposition();
|
|
10706
|
+
}, [visible, reposition]);
|
|
10707
|
+
import_react41.default.useEffect(() => {
|
|
10708
|
+
if (!visible || follow) return;
|
|
10709
|
+
const onChange = () => placeAtTrigger();
|
|
10710
|
+
window.addEventListener("scroll", onChange, true);
|
|
10711
|
+
window.addEventListener("resize", onChange);
|
|
10712
|
+
return () => {
|
|
10713
|
+
window.removeEventListener("scroll", onChange, true);
|
|
10714
|
+
window.removeEventListener("resize", onChange);
|
|
10715
|
+
};
|
|
10716
|
+
}, [visible, follow, placeAtTrigger]);
|
|
10717
|
+
import_react41.default.useEffect(() => () => {
|
|
10718
|
+
window.clearTimeout(delayTimer.current);
|
|
10719
|
+
cancelAnimationFrame(rafRef.current);
|
|
10628
10720
|
}, []);
|
|
10629
|
-
|
|
10630
|
-
|
|
10631
|
-
const rect = triggerRef.current.getBoundingClientRect();
|
|
10632
|
-
calculatePos(rect.right, rect.top);
|
|
10633
|
-
}, [visible, calculatePos]);
|
|
10634
|
-
if (!title && !description) return /* @__PURE__ */ (0, import_jsx_runtime350.jsx)(import_jsx_runtime350.Fragment, { children });
|
|
10635
|
-
return /* @__PURE__ */ (0, import_jsx_runtime350.jsxs)(
|
|
10721
|
+
if (!title && !description) return /* @__PURE__ */ (0, import_jsx_runtime351.jsx)(import_jsx_runtime351.Fragment, { children });
|
|
10722
|
+
return /* @__PURE__ */ (0, import_jsx_runtime351.jsxs)(
|
|
10636
10723
|
"div",
|
|
10637
10724
|
{
|
|
10638
10725
|
ref: triggerRef,
|
|
@@ -10640,20 +10727,21 @@ var Tooltip = (props) => {
|
|
|
10640
10727
|
onMouseEnter: handleMouseEnter,
|
|
10641
10728
|
onMouseMove: handleMouseMove,
|
|
10642
10729
|
onMouseLeave: handleMouseLeave,
|
|
10643
|
-
onClick:
|
|
10730
|
+
onClick: close,
|
|
10644
10731
|
onFocus: handleFocus,
|
|
10645
|
-
onBlur:
|
|
10732
|
+
onBlur: close,
|
|
10646
10733
|
children: [
|
|
10647
10734
|
children,
|
|
10648
|
-
visible && /* @__PURE__ */ (0,
|
|
10735
|
+
visible && /* @__PURE__ */ (0, import_jsx_runtime351.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime351.jsxs)(
|
|
10649
10736
|
"div",
|
|
10650
10737
|
{
|
|
10651
10738
|
ref: tooltipRef,
|
|
10739
|
+
role: "tooltip",
|
|
10652
10740
|
className: clsx_default("lib-xplat-tooltip", type),
|
|
10653
10741
|
style: { position: "fixed", left: pos.left, top: pos.top },
|
|
10654
10742
|
children: [
|
|
10655
|
-
title && /* @__PURE__ */ (0,
|
|
10656
|
-
description && /* @__PURE__ */ (0,
|
|
10743
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime351.jsx)("div", { className: "tooltip-title", children: title }),
|
|
10744
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime351.jsx)("div", { className: "tooltip-desc", children: description })
|
|
10657
10745
|
]
|
|
10658
10746
|
}
|
|
10659
10747
|
) })
|
|
@@ -10665,11 +10753,11 @@ Tooltip.displayName = "Tooltip";
|
|
|
10665
10753
|
var Tooltip_default = Tooltip;
|
|
10666
10754
|
|
|
10667
10755
|
// src/components/Video/Video.tsx
|
|
10668
|
-
var
|
|
10669
|
-
var
|
|
10670
|
-
var PipIcon = () => /* @__PURE__ */ (0,
|
|
10671
|
-
/* @__PURE__ */ (0,
|
|
10672
|
-
/* @__PURE__ */ (0,
|
|
10756
|
+
var import_react42 = __toESM(require("react"), 1);
|
|
10757
|
+
var import_jsx_runtime352 = require("react/jsx-runtime");
|
|
10758
|
+
var PipIcon = () => /* @__PURE__ */ (0, import_jsx_runtime352.jsxs)("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
10759
|
+
/* @__PURE__ */ (0, import_jsx_runtime352.jsx)("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
|
|
10760
|
+
/* @__PURE__ */ (0, import_jsx_runtime352.jsx)("rect", { x: "12", y: "11", width: "7", height: "6", rx: "1", fill: "currentColor" })
|
|
10673
10761
|
] });
|
|
10674
10762
|
var formatTime = (sec) => {
|
|
10675
10763
|
if (!Number.isFinite(sec) || sec < 0) return "0:00";
|
|
@@ -10677,7 +10765,7 @@ var formatTime = (sec) => {
|
|
|
10677
10765
|
const s = Math.floor(sec % 60);
|
|
10678
10766
|
return `${m}:${s.toString().padStart(2, "0")}`;
|
|
10679
10767
|
};
|
|
10680
|
-
var Video =
|
|
10768
|
+
var Video = import_react42.default.forwardRef((props, ref) => {
|
|
10681
10769
|
const {
|
|
10682
10770
|
src,
|
|
10683
10771
|
poster,
|
|
@@ -10701,21 +10789,21 @@ var Video = import_react43.default.forwardRef((props, ref) => {
|
|
|
10701
10789
|
children,
|
|
10702
10790
|
...rest
|
|
10703
10791
|
} = props;
|
|
10704
|
-
const containerRef =
|
|
10705
|
-
const videoRef =
|
|
10706
|
-
const [isPlaying, setIsPlaying] =
|
|
10707
|
-
const [isLoaded, setIsLoaded] =
|
|
10708
|
-
const [currentTime, setCurrentTime] =
|
|
10709
|
-
const [duration, setDuration] =
|
|
10710
|
-
const [buffered, setBuffered] =
|
|
10711
|
-
const [volume, setVolume] =
|
|
10712
|
-
const [isMuted, setIsMuted] =
|
|
10713
|
-
const [isFullscreen, setIsFullscreen] =
|
|
10714
|
-
const [playbackRate, setPlaybackRate] =
|
|
10715
|
-
const [rateMenuOpen, setRateMenuOpen] =
|
|
10716
|
-
const [captionsOn, setCaptionsOn] =
|
|
10717
|
-
const [isPip, setIsPip] =
|
|
10718
|
-
const setRefs =
|
|
10792
|
+
const containerRef = import_react42.default.useRef(null);
|
|
10793
|
+
const videoRef = import_react42.default.useRef(null);
|
|
10794
|
+
const [isPlaying, setIsPlaying] = import_react42.default.useState(Boolean(autoPlay));
|
|
10795
|
+
const [isLoaded, setIsLoaded] = import_react42.default.useState(false);
|
|
10796
|
+
const [currentTime, setCurrentTime] = import_react42.default.useState(0);
|
|
10797
|
+
const [duration, setDuration] = import_react42.default.useState(0);
|
|
10798
|
+
const [buffered, setBuffered] = import_react42.default.useState(0);
|
|
10799
|
+
const [volume, setVolume] = import_react42.default.useState(1);
|
|
10800
|
+
const [isMuted, setIsMuted] = import_react42.default.useState(Boolean(muted));
|
|
10801
|
+
const [isFullscreen, setIsFullscreen] = import_react42.default.useState(false);
|
|
10802
|
+
const [playbackRate, setPlaybackRate] = import_react42.default.useState(1);
|
|
10803
|
+
const [rateMenuOpen, setRateMenuOpen] = import_react42.default.useState(false);
|
|
10804
|
+
const [captionsOn, setCaptionsOn] = import_react42.default.useState(false);
|
|
10805
|
+
const [isPip, setIsPip] = import_react42.default.useState(false);
|
|
10806
|
+
const setRefs = import_react42.default.useCallback(
|
|
10719
10807
|
(el) => {
|
|
10720
10808
|
videoRef.current = el;
|
|
10721
10809
|
if (typeof ref === "function") ref(el);
|
|
@@ -10723,14 +10811,14 @@ var Video = import_react43.default.forwardRef((props, ref) => {
|
|
|
10723
10811
|
},
|
|
10724
10812
|
[ref]
|
|
10725
10813
|
);
|
|
10726
|
-
|
|
10814
|
+
import_react42.default.useEffect(() => {
|
|
10727
10815
|
const onFsChange = () => {
|
|
10728
10816
|
setIsFullscreen(document.fullscreenElement === containerRef.current);
|
|
10729
10817
|
};
|
|
10730
10818
|
document.addEventListener("fullscreenchange", onFsChange);
|
|
10731
10819
|
return () => document.removeEventListener("fullscreenchange", onFsChange);
|
|
10732
10820
|
}, []);
|
|
10733
|
-
|
|
10821
|
+
import_react42.default.useEffect(() => {
|
|
10734
10822
|
const v = videoRef.current;
|
|
10735
10823
|
if (!v) return;
|
|
10736
10824
|
const onEnter = () => setIsPip(true);
|
|
@@ -10844,13 +10932,13 @@ var Video = import_react43.default.forwardRef((props, ref) => {
|
|
|
10844
10932
|
const volumePct = (isMuted ? 0 : volume) * 100;
|
|
10845
10933
|
const VolumeGlyph = isMuted || volume === 0 ? VolumeXIcon_default : volume < 0.5 ? VolumeIcon_default : Volume2Icon_default;
|
|
10846
10934
|
const pipSupported = typeof document !== "undefined" && "pictureInPictureEnabled" in document && document.pictureInPictureEnabled;
|
|
10847
|
-
return /* @__PURE__ */ (0,
|
|
10935
|
+
return /* @__PURE__ */ (0, import_jsx_runtime352.jsxs)(
|
|
10848
10936
|
"div",
|
|
10849
10937
|
{
|
|
10850
10938
|
ref: containerRef,
|
|
10851
10939
|
className: clsx_default("lib-xplat-video", showControls && "has-controls"),
|
|
10852
10940
|
children: [
|
|
10853
|
-
/* @__PURE__ */ (0,
|
|
10941
|
+
/* @__PURE__ */ (0, import_jsx_runtime352.jsx)(
|
|
10854
10942
|
"video",
|
|
10855
10943
|
{
|
|
10856
10944
|
ref: setRefs,
|
|
@@ -10871,7 +10959,7 @@ var Video = import_react43.default.forwardRef((props, ref) => {
|
|
|
10871
10959
|
children
|
|
10872
10960
|
}
|
|
10873
10961
|
),
|
|
10874
|
-
showCenterPlay && /* @__PURE__ */ (0,
|
|
10962
|
+
showCenterPlay && /* @__PURE__ */ (0, import_jsx_runtime352.jsx)(
|
|
10875
10963
|
"button",
|
|
10876
10964
|
{
|
|
10877
10965
|
type: "button",
|
|
@@ -10883,11 +10971,11 @@ var Video = import_react43.default.forwardRef((props, ref) => {
|
|
|
10883
10971
|
onClick: togglePlay,
|
|
10884
10972
|
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
10885
10973
|
tabIndex: -1,
|
|
10886
|
-
children: /* @__PURE__ */ (0,
|
|
10974
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime352.jsx)("span", { className: "center-play-icon", children: /* @__PURE__ */ (0, import_jsx_runtime352.jsx)(PlayCircleIcon_default, {}) })
|
|
10887
10975
|
}
|
|
10888
10976
|
),
|
|
10889
|
-
showControls && /* @__PURE__ */ (0,
|
|
10890
|
-
/* @__PURE__ */ (0,
|
|
10977
|
+
showControls && /* @__PURE__ */ (0, import_jsx_runtime352.jsxs)("div", { className: "controls", onClick: (e) => e.stopPropagation(), children: [
|
|
10978
|
+
/* @__PURE__ */ (0, import_jsx_runtime352.jsx)(
|
|
10891
10979
|
"input",
|
|
10892
10980
|
{
|
|
10893
10981
|
type: "range",
|
|
@@ -10904,29 +10992,29 @@ var Video = import_react43.default.forwardRef((props, ref) => {
|
|
|
10904
10992
|
}
|
|
10905
10993
|
}
|
|
10906
10994
|
),
|
|
10907
|
-
/* @__PURE__ */ (0,
|
|
10908
|
-
/* @__PURE__ */ (0,
|
|
10995
|
+
/* @__PURE__ */ (0, import_jsx_runtime352.jsxs)("div", { className: "controls-row", children: [
|
|
10996
|
+
/* @__PURE__ */ (0, import_jsx_runtime352.jsx)(
|
|
10909
10997
|
"button",
|
|
10910
10998
|
{
|
|
10911
10999
|
type: "button",
|
|
10912
11000
|
className: "control-btn",
|
|
10913
11001
|
onClick: togglePlay,
|
|
10914
11002
|
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
10915
|
-
children: isPlaying ? /* @__PURE__ */ (0,
|
|
11003
|
+
children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime352.jsx)(PauseIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime352.jsx)(PlayIcon_default, {})
|
|
10916
11004
|
}
|
|
10917
11005
|
),
|
|
10918
|
-
/* @__PURE__ */ (0,
|
|
10919
|
-
/* @__PURE__ */ (0,
|
|
11006
|
+
/* @__PURE__ */ (0, import_jsx_runtime352.jsxs)("div", { className: "volume-group", children: [
|
|
11007
|
+
/* @__PURE__ */ (0, import_jsx_runtime352.jsx)(
|
|
10920
11008
|
"button",
|
|
10921
11009
|
{
|
|
10922
11010
|
type: "button",
|
|
10923
11011
|
className: "control-btn",
|
|
10924
11012
|
onClick: toggleMute,
|
|
10925
11013
|
"aria-label": isMuted ? "\uC74C\uC18C\uAC70 \uD574\uC81C" : "\uC74C\uC18C\uAC70",
|
|
10926
|
-
children: /* @__PURE__ */ (0,
|
|
11014
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime352.jsx)(VolumeGlyph, {})
|
|
10927
11015
|
}
|
|
10928
11016
|
),
|
|
10929
|
-
/* @__PURE__ */ (0,
|
|
11017
|
+
/* @__PURE__ */ (0, import_jsx_runtime352.jsx)(
|
|
10930
11018
|
"input",
|
|
10931
11019
|
{
|
|
10932
11020
|
type: "range",
|
|
@@ -10941,14 +11029,14 @@ var Video = import_react43.default.forwardRef((props, ref) => {
|
|
|
10941
11029
|
}
|
|
10942
11030
|
)
|
|
10943
11031
|
] }),
|
|
10944
|
-
/* @__PURE__ */ (0,
|
|
11032
|
+
/* @__PURE__ */ (0, import_jsx_runtime352.jsxs)("span", { className: "time", children: [
|
|
10945
11033
|
formatTime(currentTime),
|
|
10946
11034
|
" / ",
|
|
10947
11035
|
formatTime(duration)
|
|
10948
11036
|
] }),
|
|
10949
|
-
/* @__PURE__ */ (0,
|
|
10950
|
-
playbackRates && playbackRates.length > 0 && /* @__PURE__ */ (0,
|
|
10951
|
-
/* @__PURE__ */ (0,
|
|
11037
|
+
/* @__PURE__ */ (0, import_jsx_runtime352.jsx)("div", { className: "controls-spacer" }),
|
|
11038
|
+
playbackRates && playbackRates.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime352.jsxs)("div", { className: clsx_default("rate-group", rateMenuOpen && "is-open"), children: [
|
|
11039
|
+
/* @__PURE__ */ (0, import_jsx_runtime352.jsxs)(
|
|
10952
11040
|
"button",
|
|
10953
11041
|
{
|
|
10954
11042
|
type: "button",
|
|
@@ -10962,7 +11050,7 @@ var Video = import_react43.default.forwardRef((props, ref) => {
|
|
|
10962
11050
|
]
|
|
10963
11051
|
}
|
|
10964
11052
|
),
|
|
10965
|
-
rateMenuOpen && /* @__PURE__ */ (0,
|
|
11053
|
+
rateMenuOpen && /* @__PURE__ */ (0, import_jsx_runtime352.jsx)("ul", { className: "rate-menu", role: "menu", children: playbackRates.map((r2) => /* @__PURE__ */ (0, import_jsx_runtime352.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime352.jsxs)(
|
|
10966
11054
|
"button",
|
|
10967
11055
|
{
|
|
10968
11056
|
type: "button",
|
|
@@ -10976,7 +11064,7 @@ var Video = import_react43.default.forwardRef((props, ref) => {
|
|
|
10976
11064
|
}
|
|
10977
11065
|
) }, r2)) })
|
|
10978
11066
|
] }),
|
|
10979
|
-
showCaptions && /* @__PURE__ */ (0,
|
|
11067
|
+
showCaptions && /* @__PURE__ */ (0, import_jsx_runtime352.jsx)(
|
|
10980
11068
|
"button",
|
|
10981
11069
|
{
|
|
10982
11070
|
type: "button",
|
|
@@ -10984,37 +11072,37 @@ var Video = import_react43.default.forwardRef((props, ref) => {
|
|
|
10984
11072
|
onClick: toggleCaptions,
|
|
10985
11073
|
"aria-label": captionsOn ? "\uC790\uB9C9 \uB044\uAE30" : "\uC790\uB9C9 \uCF1C\uAE30",
|
|
10986
11074
|
"aria-pressed": captionsOn,
|
|
10987
|
-
children: /* @__PURE__ */ (0,
|
|
11075
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime352.jsx)(TypeIcon_default, {})
|
|
10988
11076
|
}
|
|
10989
11077
|
),
|
|
10990
|
-
showPip && pipSupported && /* @__PURE__ */ (0,
|
|
11078
|
+
showPip && pipSupported && /* @__PURE__ */ (0, import_jsx_runtime352.jsx)(
|
|
10991
11079
|
"button",
|
|
10992
11080
|
{
|
|
10993
11081
|
type: "button",
|
|
10994
11082
|
className: clsx_default("control-btn", isPip && "is-active"),
|
|
10995
11083
|
onClick: togglePip,
|
|
10996
11084
|
"aria-label": isPip ? "PIP \uC885\uB8CC" : "PIP",
|
|
10997
|
-
children: /* @__PURE__ */ (0,
|
|
11085
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime352.jsx)(PipIcon, {})
|
|
10998
11086
|
}
|
|
10999
11087
|
),
|
|
11000
|
-
showDownload && /* @__PURE__ */ (0,
|
|
11088
|
+
showDownload && /* @__PURE__ */ (0, import_jsx_runtime352.jsx)(
|
|
11001
11089
|
"a",
|
|
11002
11090
|
{
|
|
11003
11091
|
className: "control-btn",
|
|
11004
11092
|
href: src,
|
|
11005
11093
|
download: downloadFileName ?? true,
|
|
11006
11094
|
"aria-label": "\uB2E4\uC6B4\uB85C\uB4DC",
|
|
11007
|
-
children: /* @__PURE__ */ (0,
|
|
11095
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime352.jsx)(DownloadIcon_default, {})
|
|
11008
11096
|
}
|
|
11009
11097
|
),
|
|
11010
|
-
/* @__PURE__ */ (0,
|
|
11098
|
+
/* @__PURE__ */ (0, import_jsx_runtime352.jsx)(
|
|
11011
11099
|
"button",
|
|
11012
11100
|
{
|
|
11013
11101
|
type: "button",
|
|
11014
11102
|
className: "control-btn",
|
|
11015
11103
|
onClick: toggleFullscreen,
|
|
11016
11104
|
"aria-label": isFullscreen ? "\uC804\uCCB4\uD654\uBA74 \uC885\uB8CC" : "\uC804\uCCB4\uD654\uBA74",
|
|
11017
|
-
children: isFullscreen ? /* @__PURE__ */ (0,
|
|
11105
|
+
children: isFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime352.jsx)(MinimizeIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime352.jsx)(MaximizeIcon_default, {})
|
|
11018
11106
|
}
|
|
11019
11107
|
)
|
|
11020
11108
|
] })
|
|
@@ -11027,7 +11115,7 @@ Video.displayName = "Video";
|
|
|
11027
11115
|
var Video_default = Video;
|
|
11028
11116
|
|
|
11029
11117
|
// src/layout/Grid/FullGrid/FullGrid.tsx
|
|
11030
|
-
var
|
|
11118
|
+
var import_jsx_runtime353 = require("react/jsx-runtime");
|
|
11031
11119
|
var GAP_MAP = {
|
|
11032
11120
|
none: "var(--spacing-space-none)",
|
|
11033
11121
|
xs: "var(--spacing-space-1)",
|
|
@@ -11040,13 +11128,13 @@ var GAP_MAP = {
|
|
|
11040
11128
|
var FullGrid = (props) => {
|
|
11041
11129
|
const { children, gap } = props;
|
|
11042
11130
|
const style = gap != null ? { gap: GAP_MAP[gap] } : void 0;
|
|
11043
|
-
return /* @__PURE__ */ (0,
|
|
11131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime353.jsx)("div", { className: "lib-xplat-full-grid", style, children });
|
|
11044
11132
|
};
|
|
11045
11133
|
FullGrid.displayName = "FullGrid";
|
|
11046
11134
|
var FullGrid_default = FullGrid;
|
|
11047
11135
|
|
|
11048
11136
|
// src/layout/Grid/FullScreen/FullScreen.tsx
|
|
11049
|
-
var
|
|
11137
|
+
var import_jsx_runtime354 = require("react/jsx-runtime");
|
|
11050
11138
|
var GAP_MAP2 = {
|
|
11051
11139
|
none: "var(--spacing-space-none)",
|
|
11052
11140
|
xs: "var(--spacing-space-1)",
|
|
@@ -11059,13 +11147,13 @@ var GAP_MAP2 = {
|
|
|
11059
11147
|
var FullScreen = (props) => {
|
|
11060
11148
|
const { children, gap } = props;
|
|
11061
11149
|
const style = gap != null ? { gap: GAP_MAP2[gap] } : void 0;
|
|
11062
|
-
return /* @__PURE__ */ (0,
|
|
11150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime354.jsx)("div", { className: "lib-xplat-full-screen", style, children });
|
|
11063
11151
|
};
|
|
11064
11152
|
FullScreen.displayName = "FullScreen";
|
|
11065
11153
|
var FullScreen_default = FullScreen;
|
|
11066
11154
|
|
|
11067
11155
|
// src/layout/Grid/Item/Item.tsx
|
|
11068
|
-
var
|
|
11156
|
+
var import_jsx_runtime355 = require("react/jsx-runtime");
|
|
11069
11157
|
var calculateSpans = (column) => {
|
|
11070
11158
|
const spans = {};
|
|
11071
11159
|
let inherited = column.default;
|
|
@@ -11082,35 +11170,35 @@ var GridItem = ({ column, children, className }) => {
|
|
|
11082
11170
|
Object.entries(spans).forEach(([key, value]) => {
|
|
11083
11171
|
style[`--column-${key}`] = value;
|
|
11084
11172
|
});
|
|
11085
|
-
return /* @__PURE__ */ (0,
|
|
11173
|
+
return /* @__PURE__ */ (0, import_jsx_runtime355.jsx)("div", { className: clsx_default("lib-xplat-grid-item", className), style, children });
|
|
11086
11174
|
};
|
|
11087
11175
|
GridItem.displayName = "GridItem";
|
|
11088
11176
|
var Item_default = GridItem;
|
|
11089
11177
|
|
|
11090
11178
|
// src/layout/Header/Header.tsx
|
|
11091
|
-
var
|
|
11179
|
+
var import_jsx_runtime356 = require("react/jsx-runtime");
|
|
11092
11180
|
var Header = ({
|
|
11093
11181
|
logo,
|
|
11094
11182
|
centerContent,
|
|
11095
11183
|
rightContent
|
|
11096
11184
|
}) => {
|
|
11097
|
-
return /* @__PURE__ */ (0,
|
|
11098
|
-
/* @__PURE__ */ (0,
|
|
11099
|
-
/* @__PURE__ */ (0,
|
|
11100
|
-
/* @__PURE__ */ (0,
|
|
11185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime356.jsxs)("div", { className: "lib-xplat-layout-header", children: [
|
|
11186
|
+
/* @__PURE__ */ (0, import_jsx_runtime356.jsx)("div", { children: logo }),
|
|
11187
|
+
/* @__PURE__ */ (0, import_jsx_runtime356.jsx)("div", { children: centerContent }),
|
|
11188
|
+
/* @__PURE__ */ (0, import_jsx_runtime356.jsx)("div", { children: rightContent })
|
|
11101
11189
|
] });
|
|
11102
11190
|
};
|
|
11103
11191
|
Header.displayName = "Header";
|
|
11104
11192
|
var Header_default = Header;
|
|
11105
11193
|
|
|
11106
11194
|
// src/layout/Layout/Layout.tsx
|
|
11107
|
-
var
|
|
11195
|
+
var import_jsx_runtime357 = require("react/jsx-runtime");
|
|
11108
11196
|
var Layout = (props) => {
|
|
11109
11197
|
const { header, sideBar, children } = props;
|
|
11110
|
-
return /* @__PURE__ */ (0,
|
|
11111
|
-
sideBar && /* @__PURE__ */ (0,
|
|
11112
|
-
/* @__PURE__ */ (0,
|
|
11113
|
-
header && /* @__PURE__ */ (0,
|
|
11198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime357.jsx)("div", { className: "lib-xplat-layout", children: /* @__PURE__ */ (0, import_jsx_runtime357.jsxs)("div", { className: "lib-xplat-layout-content-wrapper", children: [
|
|
11199
|
+
sideBar && /* @__PURE__ */ (0, import_jsx_runtime357.jsx)(import_jsx_runtime357.Fragment, { children: sideBar }),
|
|
11200
|
+
/* @__PURE__ */ (0, import_jsx_runtime357.jsxs)("div", { className: "lib-xplat-layout-content", children: [
|
|
11201
|
+
header && /* @__PURE__ */ (0, import_jsx_runtime357.jsx)("div", { className: "lib-xplat-layout-conent-header", children: header }),
|
|
11114
11202
|
children
|
|
11115
11203
|
] })
|
|
11116
11204
|
] }) });
|
|
@@ -11119,31 +11207,31 @@ Layout.displayName = "Layout";
|
|
|
11119
11207
|
var Layout_default = Layout;
|
|
11120
11208
|
|
|
11121
11209
|
// src/layout/SideBar/SideBar.tsx
|
|
11122
|
-
var
|
|
11210
|
+
var import_react44 = __toESM(require("react"), 1);
|
|
11123
11211
|
|
|
11124
11212
|
// src/layout/SideBar/SideBarContext.tsx
|
|
11125
|
-
var
|
|
11126
|
-
var SideBarContext =
|
|
11213
|
+
var import_react43 = __toESM(require("react"), 1);
|
|
11214
|
+
var SideBarContext = import_react43.default.createContext(null);
|
|
11127
11215
|
var useSideBarContext = () => {
|
|
11128
|
-
const ctx =
|
|
11216
|
+
const ctx = import_react43.default.useContext(SideBarContext);
|
|
11129
11217
|
if (!ctx) throw new Error("Error");
|
|
11130
11218
|
return ctx;
|
|
11131
11219
|
};
|
|
11132
11220
|
var SideBarContext_default = SideBarContext;
|
|
11133
11221
|
|
|
11134
11222
|
// src/layout/SideBar/SideBar.tsx
|
|
11135
|
-
var
|
|
11223
|
+
var import_jsx_runtime358 = require("react/jsx-runtime");
|
|
11136
11224
|
var SideBar = (props) => {
|
|
11137
11225
|
const { children, className } = props;
|
|
11138
|
-
const [isOpen, setIsOpen] =
|
|
11226
|
+
const [isOpen, setIsOpen] = import_react44.default.useState(true);
|
|
11139
11227
|
const handleSwitchSideBar = () => {
|
|
11140
11228
|
setIsOpen((prev) => !prev);
|
|
11141
11229
|
};
|
|
11142
|
-
return /* @__PURE__ */ (0,
|
|
11230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime358.jsx)(
|
|
11143
11231
|
SideBarContext_default.Provider,
|
|
11144
11232
|
{
|
|
11145
11233
|
value: { isSidebarOpen: isOpen, handleSwitchSideBar },
|
|
11146
|
-
children: /* @__PURE__ */ (0,
|
|
11234
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime358.jsx)(
|
|
11147
11235
|
"div",
|
|
11148
11236
|
{
|
|
11149
11237
|
className: clsx_default(
|
|
@@ -11347,7 +11435,9 @@ var SideBar_default = SideBar;
|
|
|
11347
11435
|
Layout,
|
|
11348
11436
|
LayoutIcon,
|
|
11349
11437
|
LifeBuoyIcon,
|
|
11438
|
+
Link,
|
|
11350
11439
|
Link2Icon,
|
|
11440
|
+
LinkButton,
|
|
11351
11441
|
LinkIcon,
|
|
11352
11442
|
LinkedinIcon,
|
|
11353
11443
|
ListIcon,
|