@x-plat/design-system 0.8.0 → 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/DatePicker/index.cjs +388 -400
- package/dist/components/DatePicker/index.css +3 -0
- 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/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/Tooltip/index.cjs +27 -32
- package/dist/components/Tooltip/index.js +26 -31
- package/dist/components/index.cjs +467 -471
- package/dist/components/index.css +3 -0
- package/dist/components/index.js +418 -422
- package/dist/index.cjs +491 -495
- package/dist/index.css +3 -0
- package/dist/index.js +440 -444
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -7393,7 +7393,7 @@ Chip.displayName = "Chip";
|
|
|
7393
7393
|
var Chip_default = Chip;
|
|
7394
7394
|
|
|
7395
7395
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
7396
|
-
var
|
|
7396
|
+
var import_react13 = __toESM(require("react"), 1);
|
|
7397
7397
|
|
|
7398
7398
|
// src/components/Input/Input.tsx
|
|
7399
7399
|
var import_react8 = __toESM(require("react"), 1);
|
|
@@ -7584,38 +7584,26 @@ PasswordInput.displayName = "PasswordInput";
|
|
|
7584
7584
|
var PasswordInput_default = PasswordInput;
|
|
7585
7585
|
|
|
7586
7586
|
// src/components/Modal/Modal.tsx
|
|
7587
|
-
var import_react12 = __toESM(require("react"), 1);
|
|
7588
|
-
var import_react_dom2 = require("react-dom");
|
|
7589
|
-
|
|
7590
|
-
// src/tokens/hooks/Portal.tsx
|
|
7591
7587
|
var import_react11 = __toESM(require("react"), 1);
|
|
7592
|
-
var import_react_dom =
|
|
7588
|
+
var import_react_dom = require("react-dom");
|
|
7593
7589
|
var import_jsx_runtime313 = require("react/jsx-runtime");
|
|
7594
|
-
var PortalContainerContext = import_react11.default.createContext(null);
|
|
7595
|
-
var PortalProvider = ({ container, children }) => /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(PortalContainerContext.Provider, { value: container, children });
|
|
7596
|
-
var Portal = ({ children }) => {
|
|
7597
|
-
const contextContainer = import_react11.default.useContext(PortalContainerContext);
|
|
7598
|
-
if (typeof document === "undefined") return null;
|
|
7599
|
-
const container = contextContainer ?? document.body;
|
|
7600
|
-
return import_react_dom.default.createPortal(children, container);
|
|
7601
|
-
};
|
|
7602
|
-
Portal.displayName = "Portal";
|
|
7603
|
-
var Portal_default = Portal;
|
|
7604
|
-
|
|
7605
|
-
// src/components/Modal/Modal.tsx
|
|
7606
|
-
var import_jsx_runtime314 = require("react/jsx-runtime");
|
|
7607
7590
|
var ANIMATION_DURATION_MS = 200;
|
|
7608
7591
|
var Modal = (props) => {
|
|
7609
7592
|
const { isOpen, onClose, children } = props;
|
|
7610
|
-
const [mounted, setMounted] =
|
|
7611
|
-
const [visible, setVisible] =
|
|
7612
|
-
const
|
|
7613
|
-
|
|
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(() => {
|
|
7614
7597
|
if (isOpen) {
|
|
7615
7598
|
setMounted(true);
|
|
7616
|
-
const
|
|
7617
|
-
|
|
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
|
+
};
|
|
7618
7605
|
}
|
|
7606
|
+
setSettled(false);
|
|
7619
7607
|
setVisible(false);
|
|
7620
7608
|
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS);
|
|
7621
7609
|
return () => clearTimeout(t);
|
|
@@ -7623,21 +7611,20 @@ var Modal = (props) => {
|
|
|
7623
7611
|
if (typeof document === "undefined") return null;
|
|
7624
7612
|
if (!mounted) return null;
|
|
7625
7613
|
const stateClass = visible ? "enter" : "exit";
|
|
7626
|
-
return (0,
|
|
7627
|
-
/* @__PURE__ */ (0,
|
|
7614
|
+
return (0, import_react_dom.createPortal)(
|
|
7615
|
+
/* @__PURE__ */ (0, import_jsx_runtime313.jsx)(
|
|
7628
7616
|
"div",
|
|
7629
7617
|
{
|
|
7630
7618
|
className: clsx_default("lib-xplat-modal", "dim", stateClass),
|
|
7631
7619
|
onClick: onClose,
|
|
7632
|
-
children: /* @__PURE__ */ (0,
|
|
7620
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(
|
|
7633
7621
|
"div",
|
|
7634
7622
|
{
|
|
7635
|
-
|
|
7636
|
-
className: clsx_default("lib-xplat-modal", "modal-box", stateClass),
|
|
7623
|
+
className: clsx_default("lib-xplat-modal", "modal-box", stateClass, settled && "settled"),
|
|
7637
7624
|
role: "dialog",
|
|
7638
7625
|
"aria-modal": "true",
|
|
7639
7626
|
onClick: (e) => e.stopPropagation(),
|
|
7640
|
-
children
|
|
7627
|
+
children
|
|
7641
7628
|
}
|
|
7642
7629
|
)
|
|
7643
7630
|
}
|
|
@@ -7649,9 +7636,9 @@ Modal.displayName = "Modal";
|
|
|
7649
7636
|
var Modal_default = Modal;
|
|
7650
7637
|
|
|
7651
7638
|
// src/components/DatePicker/SingleDatePicker/index.tsx
|
|
7652
|
-
var
|
|
7653
|
-
var
|
|
7654
|
-
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(
|
|
7655
7642
|
({
|
|
7656
7643
|
day,
|
|
7657
7644
|
disabled,
|
|
@@ -7661,7 +7648,7 @@ var DayCell2 = import_react13.default.memo(
|
|
|
7661
7648
|
isEnd,
|
|
7662
7649
|
inRange,
|
|
7663
7650
|
onSelect
|
|
7664
|
-
}) => /* @__PURE__ */ (0,
|
|
7651
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
7665
7652
|
"button",
|
|
7666
7653
|
{
|
|
7667
7654
|
type: "button",
|
|
@@ -7703,26 +7690,26 @@ var SingleDatePicker = (props) => {
|
|
|
7703
7690
|
initialYear,
|
|
7704
7691
|
initialMonth
|
|
7705
7692
|
);
|
|
7706
|
-
const [pickerMode, setPickerMode] =
|
|
7707
|
-
const [yearRangeStart, setYearRangeStart] =
|
|
7693
|
+
const [pickerMode, setPickerMode] = import_react12.default.useState("days");
|
|
7694
|
+
const [yearRangeStart, setYearRangeStart] = import_react12.default.useState(
|
|
7708
7695
|
Math.floor((initialYear ?? (/* @__PURE__ */ new Date()).getFullYear()) / 12) * 12
|
|
7709
7696
|
);
|
|
7710
|
-
const minTime =
|
|
7697
|
+
const minTime = import_react12.default.useMemo(
|
|
7711
7698
|
() => minDate ? new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()).getTime() : -Infinity,
|
|
7712
7699
|
[minDate]
|
|
7713
7700
|
);
|
|
7714
|
-
const maxTime =
|
|
7701
|
+
const maxTime = import_react12.default.useMemo(
|
|
7715
7702
|
() => maxDate ? new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()).getTime() : Infinity,
|
|
7716
7703
|
[maxDate]
|
|
7717
7704
|
);
|
|
7718
|
-
const highlightSet =
|
|
7705
|
+
const highlightSet = import_react12.default.useMemo(() => {
|
|
7719
7706
|
const set = /* @__PURE__ */ new Set();
|
|
7720
7707
|
for (const h of highlightDates) {
|
|
7721
7708
|
set.add(`${h.getFullYear()}-${h.getMonth()}-${h.getDate()}`);
|
|
7722
7709
|
}
|
|
7723
7710
|
return set;
|
|
7724
7711
|
}, [highlightDates]);
|
|
7725
|
-
const handleSelect =
|
|
7712
|
+
const handleSelect = import_react12.default.useCallback(
|
|
7726
7713
|
(date) => {
|
|
7727
7714
|
onChange?.(date);
|
|
7728
7715
|
},
|
|
@@ -7759,20 +7746,20 @@ var SingleDatePicker = (props) => {
|
|
|
7759
7746
|
const monthLabels = MONTH_LABELS[locale];
|
|
7760
7747
|
const titleText = pickerMode === "days" ? locale === "ko" ? `${year}\uB144 ${monthLabels[month]}` : `${monthLabels[month]} ${year}` : pickerMode === "months" ? `${year}` : `${yearRangeStart} - ${yearRangeStart + 11}`;
|
|
7761
7748
|
const hasRange = rangeStart != null && rangeEnd != null;
|
|
7762
|
-
return /* @__PURE__ */ (0,
|
|
7749
|
+
return /* @__PURE__ */ (0, import_jsx_runtime314.jsxs)(
|
|
7763
7750
|
"div",
|
|
7764
7751
|
{
|
|
7765
7752
|
className: clsx_default("lib-xplat-datepicker", "single"),
|
|
7766
7753
|
children: [
|
|
7767
|
-
/* @__PURE__ */ (0,
|
|
7768
|
-
/* @__PURE__ */ (0,
|
|
7769
|
-
/* @__PURE__ */ (0,
|
|
7770
|
-
/* @__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, {}) })
|
|
7771
7758
|
] }),
|
|
7772
|
-
/* @__PURE__ */ (0,
|
|
7773
|
-
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) => {
|
|
7774
7761
|
const y = yearRangeStart + i;
|
|
7775
|
-
return /* @__PURE__ */ (0,
|
|
7762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
7776
7763
|
"button",
|
|
7777
7764
|
{
|
|
7778
7765
|
type: "button",
|
|
@@ -7783,7 +7770,7 @@ var SingleDatePicker = (props) => {
|
|
|
7783
7770
|
y
|
|
7784
7771
|
);
|
|
7785
7772
|
}) }),
|
|
7786
|
-
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)(
|
|
7787
7774
|
"button",
|
|
7788
7775
|
{
|
|
7789
7776
|
type: "button",
|
|
@@ -7793,8 +7780,8 @@ var SingleDatePicker = (props) => {
|
|
|
7793
7780
|
},
|
|
7794
7781
|
i
|
|
7795
7782
|
)) }),
|
|
7796
|
-
pickerMode === "days" && /* @__PURE__ */ (0,
|
|
7797
|
-
/* @__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)(
|
|
7798
7785
|
"div",
|
|
7799
7786
|
{
|
|
7800
7787
|
className: clsx_default(
|
|
@@ -7806,7 +7793,7 @@ var SingleDatePicker = (props) => {
|
|
|
7806
7793
|
},
|
|
7807
7794
|
label
|
|
7808
7795
|
)) }),
|
|
7809
|
-
/* @__PURE__ */ (0,
|
|
7796
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)("div", { className: "datepicker-grid", children: days.map((day, idx) => {
|
|
7810
7797
|
const t = day.date.getTime();
|
|
7811
7798
|
const disabled = t < minTime || t > maxTime;
|
|
7812
7799
|
const selected = value ? isSameDay(day.date, value) : false;
|
|
@@ -7816,7 +7803,7 @@ var SingleDatePicker = (props) => {
|
|
|
7816
7803
|
const isStart = hasRange ? isSameDay(day.date, rangeStart) : false;
|
|
7817
7804
|
const isEnd = hasRange ? isSameDay(day.date, rangeEnd) : false;
|
|
7818
7805
|
const inRangeVal = hasRange ? isInRange(day.date, rangeStart, rangeEnd) : false;
|
|
7819
|
-
return /* @__PURE__ */ (0,
|
|
7806
|
+
return /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
7820
7807
|
DayCell2,
|
|
7821
7808
|
{
|
|
7822
7809
|
day,
|
|
@@ -7841,7 +7828,7 @@ SingleDatePicker.displayName = "SingleDatePicker";
|
|
|
7841
7828
|
var SingleDatePicker_default = SingleDatePicker;
|
|
7842
7829
|
|
|
7843
7830
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
7844
|
-
var
|
|
7831
|
+
var import_jsx_runtime315 = require("react/jsx-runtime");
|
|
7845
7832
|
var formatDate = (date) => {
|
|
7846
7833
|
if (!date || !(date instanceof Date) || isNaN(date.getTime())) return "";
|
|
7847
7834
|
const y = date.getFullYear();
|
|
@@ -7851,8 +7838,8 @@ var formatDate = (date) => {
|
|
|
7851
7838
|
};
|
|
7852
7839
|
var InputDatePicker = (props) => {
|
|
7853
7840
|
const { value, onChange, minDate, maxDate, disabled, locale = "ko", placeholder } = props;
|
|
7854
|
-
const [isOpen, setIsOpen] =
|
|
7855
|
-
const [tempDate, setTempDate] =
|
|
7841
|
+
const [isOpen, setIsOpen] = import_react13.default.useState(false);
|
|
7842
|
+
const [tempDate, setTempDate] = import_react13.default.useState(value ?? /* @__PURE__ */ new Date());
|
|
7856
7843
|
const handleOpen = () => {
|
|
7857
7844
|
if (disabled) return;
|
|
7858
7845
|
setTempDate(value ?? /* @__PURE__ */ new Date());
|
|
@@ -7868,19 +7855,19 @@ var InputDatePicker = (props) => {
|
|
|
7868
7855
|
const handleClose = () => {
|
|
7869
7856
|
setIsOpen(false);
|
|
7870
7857
|
};
|
|
7871
|
-
return /* @__PURE__ */ (0,
|
|
7872
|
-
/* @__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)(
|
|
7873
7860
|
Input_default,
|
|
7874
7861
|
{
|
|
7875
7862
|
value: formatDate(value),
|
|
7876
7863
|
placeholder,
|
|
7877
|
-
suffix: /* @__PURE__ */ (0,
|
|
7864
|
+
suffix: /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(CalenderIcon_default, {}),
|
|
7878
7865
|
disabled,
|
|
7879
7866
|
readOnly: true
|
|
7880
7867
|
}
|
|
7881
7868
|
) }),
|
|
7882
|
-
/* @__PURE__ */ (0,
|
|
7883
|
-
/* @__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)(
|
|
7884
7871
|
SingleDatePicker_default,
|
|
7885
7872
|
{
|
|
7886
7873
|
value: tempDate,
|
|
@@ -7890,9 +7877,9 @@ var InputDatePicker = (props) => {
|
|
|
7890
7877
|
locale
|
|
7891
7878
|
}
|
|
7892
7879
|
) }),
|
|
7893
|
-
/* @__PURE__ */ (0,
|
|
7894
|
-
/* @__PURE__ */ (0,
|
|
7895
|
-
/* @__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" })
|
|
7896
7883
|
] })
|
|
7897
7884
|
] }) })
|
|
7898
7885
|
] });
|
|
@@ -7901,20 +7888,20 @@ InputDatePicker.displayName = "InputDatePicker";
|
|
|
7901
7888
|
var InputDatePicker_default = InputDatePicker;
|
|
7902
7889
|
|
|
7903
7890
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
7904
|
-
var
|
|
7891
|
+
var import_react17 = __toESM(require("react"), 1);
|
|
7905
7892
|
|
|
7906
7893
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
7907
|
-
var
|
|
7894
|
+
var import_react16 = __toESM(require("react"), 1);
|
|
7908
7895
|
|
|
7909
7896
|
// src/components/Tab/Tab.tsx
|
|
7910
|
-
var
|
|
7897
|
+
var import_react15 = __toESM(require("react"), 1);
|
|
7911
7898
|
|
|
7912
7899
|
// src/components/Tab/TabItem.tsx
|
|
7913
|
-
var
|
|
7914
|
-
var
|
|
7915
|
-
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) => {
|
|
7916
7903
|
const { isActive: isActive2, title, onClick } = props;
|
|
7917
|
-
return /* @__PURE__ */ (0,
|
|
7904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime316.jsx)(
|
|
7918
7905
|
"div",
|
|
7919
7906
|
{
|
|
7920
7907
|
ref,
|
|
@@ -7928,25 +7915,25 @@ TabItem.displayName = "TabItem";
|
|
|
7928
7915
|
var TabItem_default = TabItem;
|
|
7929
7916
|
|
|
7930
7917
|
// src/components/Tab/Tab.tsx
|
|
7931
|
-
var
|
|
7918
|
+
var import_jsx_runtime317 = require("react/jsx-runtime");
|
|
7932
7919
|
var Tab = (props) => {
|
|
7933
7920
|
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
7934
|
-
const [underlineStyle, setUnderlineStyle] =
|
|
7921
|
+
const [underlineStyle, setUnderlineStyle] = import_react15.default.useState({
|
|
7935
7922
|
left: 0,
|
|
7936
7923
|
width: 0
|
|
7937
7924
|
});
|
|
7938
|
-
const itemRefs =
|
|
7925
|
+
const itemRefs = import_react15.default.useRef([]);
|
|
7939
7926
|
const handleChangeActiveTab = (tabItem, tabIdx) => {
|
|
7940
7927
|
onChange(tabItem, tabIdx);
|
|
7941
7928
|
};
|
|
7942
|
-
|
|
7929
|
+
import_react15.default.useEffect(() => {
|
|
7943
7930
|
const el = itemRefs.current[activeIndex];
|
|
7944
7931
|
if (el) {
|
|
7945
7932
|
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
7946
7933
|
}
|
|
7947
7934
|
}, [activeIndex, tabs.length]);
|
|
7948
|
-
return /* @__PURE__ */ (0,
|
|
7949
|
-
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)(
|
|
7950
7937
|
TabItem_default,
|
|
7951
7938
|
{
|
|
7952
7939
|
onClick: () => handleChangeActiveTab(tab, idx),
|
|
@@ -7958,7 +7945,7 @@ var Tab = (props) => {
|
|
|
7958
7945
|
},
|
|
7959
7946
|
`${tab.value}_${idx}`
|
|
7960
7947
|
)),
|
|
7961
|
-
type === "toggle" && /* @__PURE__ */ (0,
|
|
7948
|
+
type === "toggle" && /* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
|
|
7962
7949
|
"div",
|
|
7963
7950
|
{
|
|
7964
7951
|
className: "tab-toggle-underline",
|
|
@@ -7974,7 +7961,7 @@ Tab.displayName = "Tab";
|
|
|
7974
7961
|
var Tab_default = Tab;
|
|
7975
7962
|
|
|
7976
7963
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
7977
|
-
var
|
|
7964
|
+
var import_jsx_runtime318 = require("react/jsx-runtime");
|
|
7978
7965
|
var RangePicker = (props) => {
|
|
7979
7966
|
const {
|
|
7980
7967
|
startDate,
|
|
@@ -7984,7 +7971,7 @@ var RangePicker = (props) => {
|
|
|
7984
7971
|
maxDate,
|
|
7985
7972
|
locale = "ko"
|
|
7986
7973
|
} = props;
|
|
7987
|
-
const [activeTab, setActiveTab] =
|
|
7974
|
+
const [activeTab, setActiveTab] = import_react16.default.useState("start");
|
|
7988
7975
|
const handleStartChange = (date) => {
|
|
7989
7976
|
if (!date) return;
|
|
7990
7977
|
const newStart = date > endDate ? endDate : date;
|
|
@@ -7997,8 +7984,8 @@ var RangePicker = (props) => {
|
|
|
7997
7984
|
};
|
|
7998
7985
|
const startMaxDate = maxDate && endDate < maxDate ? endDate : endDate;
|
|
7999
7986
|
const endMinDate = minDate && startDate > minDate ? startDate : startDate;
|
|
8000
|
-
return /* @__PURE__ */ (0,
|
|
8001
|
-
/* @__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)(
|
|
8002
7989
|
Tab_default,
|
|
8003
7990
|
{
|
|
8004
7991
|
activeIndex: activeTab === "start" ? 0 : 1,
|
|
@@ -8011,8 +7998,8 @@ var RangePicker = (props) => {
|
|
|
8011
7998
|
size: "sm"
|
|
8012
7999
|
}
|
|
8013
8000
|
) }),
|
|
8014
|
-
/* @__PURE__ */ (0,
|
|
8015
|
-
/* @__PURE__ */ (0,
|
|
8001
|
+
/* @__PURE__ */ (0, import_jsx_runtime318.jsxs)("div", { className: "datepicker-range-panels", children: [
|
|
8002
|
+
/* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
|
|
8016
8003
|
SingleDatePicker_default,
|
|
8017
8004
|
{
|
|
8018
8005
|
value: startDate,
|
|
@@ -8024,7 +8011,7 @@ var RangePicker = (props) => {
|
|
|
8024
8011
|
locale
|
|
8025
8012
|
}
|
|
8026
8013
|
),
|
|
8027
|
-
/* @__PURE__ */ (0,
|
|
8014
|
+
/* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
|
|
8028
8015
|
SingleDatePicker_default,
|
|
8029
8016
|
{
|
|
8030
8017
|
value: endDate,
|
|
@@ -8037,7 +8024,7 @@ var RangePicker = (props) => {
|
|
|
8037
8024
|
}
|
|
8038
8025
|
)
|
|
8039
8026
|
] }),
|
|
8040
|
-
/* @__PURE__ */ (0,
|
|
8027
|
+
/* @__PURE__ */ (0, import_jsx_runtime318.jsx)("div", { className: "datepicker-range-mobile", children: activeTab === "start" ? /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
|
|
8041
8028
|
SingleDatePicker_default,
|
|
8042
8029
|
{
|
|
8043
8030
|
value: startDate,
|
|
@@ -8048,7 +8035,7 @@ var RangePicker = (props) => {
|
|
|
8048
8035
|
rangeEnd: endDate,
|
|
8049
8036
|
locale
|
|
8050
8037
|
}
|
|
8051
|
-
) : /* @__PURE__ */ (0,
|
|
8038
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
|
|
8052
8039
|
SingleDatePicker_default,
|
|
8053
8040
|
{
|
|
8054
8041
|
value: endDate,
|
|
@@ -8066,10 +8053,10 @@ RangePicker.displayName = "RangePicker";
|
|
|
8066
8053
|
var RangePicker_default = RangePicker;
|
|
8067
8054
|
|
|
8068
8055
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
8069
|
-
var
|
|
8056
|
+
var import_jsx_runtime319 = require("react/jsx-runtime");
|
|
8070
8057
|
var PopupPicker = (props) => {
|
|
8071
8058
|
const { component, type, locale } = props;
|
|
8072
|
-
const [isOpen, setIsOpen] =
|
|
8059
|
+
const [isOpen, setIsOpen] = import_react17.default.useState(false);
|
|
8073
8060
|
const handleClick = () => setIsOpen(true);
|
|
8074
8061
|
const handleClose = () => setIsOpen(false);
|
|
8075
8062
|
const handleSingleChange = (date) => {
|
|
@@ -8077,11 +8064,11 @@ var PopupPicker = (props) => {
|
|
|
8077
8064
|
props.onChange?.(date);
|
|
8078
8065
|
handleClose();
|
|
8079
8066
|
};
|
|
8080
|
-
return /* @__PURE__ */ (0,
|
|
8081
|
-
|
|
8082
|
-
/* @__PURE__ */ (0,
|
|
8083
|
-
/* @__PURE__ */ (0,
|
|
8084
|
-
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)(
|
|
8085
8072
|
SingleDatePicker_default,
|
|
8086
8073
|
{
|
|
8087
8074
|
value: props.value,
|
|
@@ -8091,7 +8078,7 @@ var PopupPicker = (props) => {
|
|
|
8091
8078
|
locale
|
|
8092
8079
|
}
|
|
8093
8080
|
),
|
|
8094
|
-
type === "range" && /* @__PURE__ */ (0,
|
|
8081
|
+
type === "range" && /* @__PURE__ */ (0, import_jsx_runtime319.jsx)(
|
|
8095
8082
|
RangePicker_default,
|
|
8096
8083
|
{
|
|
8097
8084
|
startDate: props.startDate,
|
|
@@ -8103,8 +8090,8 @@ var PopupPicker = (props) => {
|
|
|
8103
8090
|
}
|
|
8104
8091
|
)
|
|
8105
8092
|
] }),
|
|
8106
|
-
/* @__PURE__ */ (0,
|
|
8107
|
-
/* @__PURE__ */ (0,
|
|
8093
|
+
/* @__PURE__ */ (0, import_jsx_runtime319.jsxs)("div", { className: "popup-datepicker-footer", children: [
|
|
8094
|
+
/* @__PURE__ */ (0, import_jsx_runtime319.jsx)(
|
|
8108
8095
|
Button_default,
|
|
8109
8096
|
{
|
|
8110
8097
|
type: "secondary",
|
|
@@ -8112,7 +8099,7 @@ var PopupPicker = (props) => {
|
|
|
8112
8099
|
children: locale === "ko" ? "\uCDE8\uC18C" : "Cancel"
|
|
8113
8100
|
}
|
|
8114
8101
|
),
|
|
8115
|
-
/* @__PURE__ */ (0,
|
|
8102
|
+
/* @__PURE__ */ (0, import_jsx_runtime319.jsx)(Button_default, { type: "primary", onClick: handleClose, children: locale === "ko" ? "\uC801\uC6A9" : "Apply" })
|
|
8116
8103
|
] })
|
|
8117
8104
|
] }) })
|
|
8118
8105
|
] });
|
|
@@ -8121,10 +8108,10 @@ PopupPicker.displayName = "PopupPicker";
|
|
|
8121
8108
|
var PopupPicker_default = PopupPicker;
|
|
8122
8109
|
|
|
8123
8110
|
// src/components/Divider/Divider.tsx
|
|
8124
|
-
var
|
|
8111
|
+
var import_jsx_runtime320 = require("react/jsx-runtime");
|
|
8125
8112
|
var Divider = (props) => {
|
|
8126
8113
|
const { orientation = "horizontal" } = props;
|
|
8127
|
-
return /* @__PURE__ */ (0,
|
|
8114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(
|
|
8128
8115
|
"div",
|
|
8129
8116
|
{
|
|
8130
8117
|
className: clsx_default("lib-xplat-divider", orientation),
|
|
@@ -8137,15 +8124,15 @@ Divider.displayName = "Divider";
|
|
|
8137
8124
|
var Divider_default = Divider;
|
|
8138
8125
|
|
|
8139
8126
|
// src/components/Drawer/Drawer.tsx
|
|
8140
|
-
var
|
|
8141
|
-
var
|
|
8142
|
-
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");
|
|
8143
8130
|
var ANIMATION_DURATION_MS2 = 250;
|
|
8144
8131
|
var Drawer = (props) => {
|
|
8145
8132
|
const { isOpen, onClose, placement = "right", size = "md", title, children } = props;
|
|
8146
|
-
const [mounted, setMounted] =
|
|
8147
|
-
const [visible, setVisible] =
|
|
8148
|
-
|
|
8133
|
+
const [mounted, setMounted] = import_react18.default.useState(false);
|
|
8134
|
+
const [visible, setVisible] = import_react18.default.useState(false);
|
|
8135
|
+
import_react18.default.useEffect(() => {
|
|
8149
8136
|
if (isOpen) {
|
|
8150
8137
|
setMounted(true);
|
|
8151
8138
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -8158,13 +8145,13 @@ var Drawer = (props) => {
|
|
|
8158
8145
|
if (typeof document === "undefined") return null;
|
|
8159
8146
|
if (!mounted) return null;
|
|
8160
8147
|
const stateClass = visible ? "enter" : "exit";
|
|
8161
|
-
return (0,
|
|
8162
|
-
/* @__PURE__ */ (0,
|
|
8148
|
+
return (0, import_react_dom2.createPortal)(
|
|
8149
|
+
/* @__PURE__ */ (0, import_jsx_runtime321.jsx)(
|
|
8163
8150
|
"div",
|
|
8164
8151
|
{
|
|
8165
8152
|
className: clsx_default("lib-xplat-drawer-overlay", stateClass),
|
|
8166
8153
|
onClick: onClose,
|
|
8167
|
-
children: /* @__PURE__ */ (0,
|
|
8154
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime321.jsxs)(
|
|
8168
8155
|
"div",
|
|
8169
8156
|
{
|
|
8170
8157
|
className: clsx_default("lib-xplat-drawer", placement, size, stateClass),
|
|
@@ -8172,11 +8159,11 @@ var Drawer = (props) => {
|
|
|
8172
8159
|
"aria-modal": "true",
|
|
8173
8160
|
onClick: (e) => e.stopPropagation(),
|
|
8174
8161
|
children: [
|
|
8175
|
-
title && /* @__PURE__ */ (0,
|
|
8176
|
-
/* @__PURE__ */ (0,
|
|
8177
|
-
/* @__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" })
|
|
8178
8165
|
] }),
|
|
8179
|
-
/* @__PURE__ */ (0,
|
|
8166
|
+
/* @__PURE__ */ (0, import_jsx_runtime321.jsx)("div", { className: "drawer-body", children })
|
|
8180
8167
|
]
|
|
8181
8168
|
}
|
|
8182
8169
|
)
|
|
@@ -8189,16 +8176,25 @@ Drawer.displayName = "Drawer";
|
|
|
8189
8176
|
var Drawer_default = Drawer;
|
|
8190
8177
|
|
|
8191
8178
|
// src/components/Dropdown/Dropdown.tsx
|
|
8192
|
-
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;
|
|
8193
8189
|
|
|
8194
8190
|
// src/tokens/hooks/useAutoPosition.ts
|
|
8195
|
-
var
|
|
8191
|
+
var import_react19 = __toESM(require("react"), 1);
|
|
8196
8192
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
8197
|
-
const [position, setPosition] =
|
|
8193
|
+
const [position, setPosition] = import_react19.default.useState({
|
|
8198
8194
|
position: {},
|
|
8199
8195
|
direction: "bottom"
|
|
8200
8196
|
});
|
|
8201
|
-
const calculatePosition =
|
|
8197
|
+
const calculatePosition = import_react19.default.useCallback(() => {
|
|
8202
8198
|
if (!triggerRef.current || !popRef.current) return;
|
|
8203
8199
|
const triggerRect = triggerRef.current.getBoundingClientRect();
|
|
8204
8200
|
const popW = popRef.current.offsetWidth;
|
|
@@ -8225,13 +8221,13 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
8225
8221
|
direction
|
|
8226
8222
|
});
|
|
8227
8223
|
}, [triggerRef, popRef]);
|
|
8228
|
-
|
|
8224
|
+
import_react19.default.useLayoutEffect(() => {
|
|
8229
8225
|
if (!enabled) return;
|
|
8230
8226
|
calculatePosition();
|
|
8231
8227
|
const raf = requestAnimationFrame(calculatePosition);
|
|
8232
8228
|
return () => cancelAnimationFrame(raf);
|
|
8233
8229
|
}, [calculatePosition, enabled]);
|
|
8234
|
-
|
|
8230
|
+
import_react19.default.useEffect(() => {
|
|
8235
8231
|
if (!enabled || !popRef.current) return;
|
|
8236
8232
|
const observer = new ResizeObserver(() => {
|
|
8237
8233
|
calculatePosition();
|
|
@@ -8239,7 +8235,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
8239
8235
|
observer.observe(popRef.current);
|
|
8240
8236
|
return () => observer.disconnect();
|
|
8241
8237
|
}, [calculatePosition, enabled, popRef]);
|
|
8242
|
-
|
|
8238
|
+
import_react19.default.useEffect(() => {
|
|
8243
8239
|
if (!enabled) return;
|
|
8244
8240
|
window.addEventListener("resize", calculatePosition);
|
|
8245
8241
|
window.addEventListener("scroll", calculatePosition, true);
|
|
@@ -8253,9 +8249,9 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
8253
8249
|
var useAutoPosition_default = useAutoPosition;
|
|
8254
8250
|
|
|
8255
8251
|
// src/tokens/hooks/useClickOutside.ts
|
|
8256
|
-
var
|
|
8252
|
+
var import_react20 = __toESM(require("react"), 1);
|
|
8257
8253
|
var useClickOutside = (refs, handler, enabled = true) => {
|
|
8258
|
-
|
|
8254
|
+
import_react20.default.useEffect(() => {
|
|
8259
8255
|
if (!enabled) return;
|
|
8260
8256
|
const refArray = Array.isArray(refs) ? refs : [refs];
|
|
8261
8257
|
const listener = (event) => {
|
|
@@ -8278,17 +8274,17 @@ var useClickOutside = (refs, handler, enabled = true) => {
|
|
|
8278
8274
|
var useClickOutside_default = useClickOutside;
|
|
8279
8275
|
|
|
8280
8276
|
// src/components/Dropdown/Dropdown.tsx
|
|
8281
|
-
var
|
|
8277
|
+
var import_jsx_runtime322 = require("react/jsx-runtime");
|
|
8282
8278
|
var Dropdown = (props) => {
|
|
8283
8279
|
const { items, children } = props;
|
|
8284
|
-
const [isOpen, setIsOpen] =
|
|
8285
|
-
const [mounted, setMounted] =
|
|
8286
|
-
const [visible, setVisible] =
|
|
8287
|
-
const triggerRef =
|
|
8288
|
-
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);
|
|
8289
8285
|
const { position, direction } = useAutoPosition_default(triggerRef, menuRef, mounted);
|
|
8290
8286
|
useClickOutside_default([triggerRef, menuRef], () => setIsOpen(false), isOpen);
|
|
8291
|
-
|
|
8287
|
+
import_react21.default.useEffect(() => {
|
|
8292
8288
|
if (isOpen) {
|
|
8293
8289
|
setMounted(true);
|
|
8294
8290
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -8303,8 +8299,8 @@ var Dropdown = (props) => {
|
|
|
8303
8299
|
item.onClick?.();
|
|
8304
8300
|
setIsOpen(false);
|
|
8305
8301
|
};
|
|
8306
|
-
return /* @__PURE__ */ (0,
|
|
8307
|
-
/* @__PURE__ */ (0,
|
|
8302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime322.jsxs)("div", { className: "lib-xplat-dropdown", children: [
|
|
8303
|
+
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)(
|
|
8308
8304
|
"div",
|
|
8309
8305
|
{
|
|
8310
8306
|
ref: triggerRef,
|
|
@@ -8313,14 +8309,14 @@ var Dropdown = (props) => {
|
|
|
8313
8309
|
children
|
|
8314
8310
|
}
|
|
8315
8311
|
),
|
|
8316
|
-
mounted && /* @__PURE__ */ (0,
|
|
8312
|
+
mounted && /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(
|
|
8317
8313
|
"div",
|
|
8318
8314
|
{
|
|
8319
8315
|
ref: menuRef,
|
|
8320
8316
|
className: clsx_default("lib-xplat-dropdown-menu", direction, { visible }),
|
|
8321
8317
|
style: { top: position.top, left: position.left },
|
|
8322
8318
|
role: "menu",
|
|
8323
|
-
children: items.map((item) => /* @__PURE__ */ (0,
|
|
8319
|
+
children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(
|
|
8324
8320
|
"button",
|
|
8325
8321
|
{
|
|
8326
8322
|
className: clsx_default("dropdown-item", {
|
|
@@ -8342,8 +8338,8 @@ Dropdown.displayName = "Dropdown";
|
|
|
8342
8338
|
var Dropdown_default = Dropdown;
|
|
8343
8339
|
|
|
8344
8340
|
// src/components/Editor/Editor.tsx
|
|
8345
|
-
var
|
|
8346
|
-
var
|
|
8341
|
+
var import_react22 = __toESM(require("react"), 1);
|
|
8342
|
+
var import_jsx_runtime323 = require("react/jsx-runtime");
|
|
8347
8343
|
var DEFAULT_TOOLBAR = [
|
|
8348
8344
|
"bold",
|
|
8349
8345
|
"italic",
|
|
@@ -8450,21 +8446,21 @@ var Editor = (props) => {
|
|
|
8450
8446
|
onImageUpload,
|
|
8451
8447
|
minHeight = 200
|
|
8452
8448
|
} = props;
|
|
8453
|
-
const editorRef =
|
|
8454
|
-
const lastRangeRef =
|
|
8455
|
-
const composingRef =
|
|
8456
|
-
const [isFocused, setIsFocused] =
|
|
8457
|
-
const [isEmpty, setIsEmpty] =
|
|
8458
|
-
const [activeFormats, setActiveFormats] =
|
|
8459
|
-
const [slashOpen, setSlashOpen] =
|
|
8460
|
-
const [slashFilter, setSlashFilter] =
|
|
8461
|
-
const [slashIdx, setSlashIdx] =
|
|
8462
|
-
const [slashPos, setSlashPos] =
|
|
8463
|
-
const slashStartRangeRef =
|
|
8464
|
-
const [linkOpen, setLinkOpen] =
|
|
8465
|
-
const [linkValue, setLinkValue] =
|
|
8466
|
-
const [linkPos, setLinkPos] =
|
|
8467
|
-
|
|
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(() => {
|
|
8468
8464
|
if (!editorRef.current) return;
|
|
8469
8465
|
if (editorRef.current.innerHTML !== value) {
|
|
8470
8466
|
editorRef.current.innerHTML = sanitizeHtml(value || "");
|
|
@@ -8578,7 +8574,7 @@ var Editor = (props) => {
|
|
|
8578
8574
|
setSlashIdx(0);
|
|
8579
8575
|
slashStartRangeRef.current = null;
|
|
8580
8576
|
};
|
|
8581
|
-
const filteredSlashItems =
|
|
8577
|
+
const filteredSlashItems = import_react22.default.useMemo(() => {
|
|
8582
8578
|
if (!slashFilter) return SLASH_ITEMS;
|
|
8583
8579
|
const f = slashFilter.toLowerCase();
|
|
8584
8580
|
return SLASH_ITEMS.filter((it) => it.label.toLowerCase().includes(f) || it.key.includes(f));
|
|
@@ -8863,8 +8859,8 @@ var Editor = (props) => {
|
|
|
8863
8859
|
break;
|
|
8864
8860
|
}
|
|
8865
8861
|
};
|
|
8866
|
-
return /* @__PURE__ */ (0,
|
|
8867
|
-
!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)(
|
|
8868
8864
|
EditorToolbar,
|
|
8869
8865
|
{
|
|
8870
8866
|
items: toolbar,
|
|
@@ -8872,9 +8868,9 @@ var Editor = (props) => {
|
|
|
8872
8868
|
onAction: onToolbarAction
|
|
8873
8869
|
}
|
|
8874
8870
|
),
|
|
8875
|
-
/* @__PURE__ */ (0,
|
|
8876
|
-
isEmpty && !isFocused && /* @__PURE__ */ (0,
|
|
8877
|
-
/* @__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)(
|
|
8878
8874
|
"div",
|
|
8879
8875
|
{
|
|
8880
8876
|
ref: editorRef,
|
|
@@ -8893,7 +8889,7 @@ var Editor = (props) => {
|
|
|
8893
8889
|
spellCheck: true
|
|
8894
8890
|
}
|
|
8895
8891
|
),
|
|
8896
|
-
slashOpen && filteredSlashItems.length > 0 && /* @__PURE__ */ (0,
|
|
8892
|
+
slashOpen && filteredSlashItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime323.jsx)(
|
|
8897
8893
|
SlashMenu,
|
|
8898
8894
|
{
|
|
8899
8895
|
position: slashPos,
|
|
@@ -8903,7 +8899,7 @@ var Editor = (props) => {
|
|
|
8903
8899
|
onClose: closeSlashMenu
|
|
8904
8900
|
}
|
|
8905
8901
|
),
|
|
8906
|
-
linkOpen && /* @__PURE__ */ (0,
|
|
8902
|
+
linkOpen && /* @__PURE__ */ (0, import_jsx_runtime323.jsx)(
|
|
8907
8903
|
LinkPopover,
|
|
8908
8904
|
{
|
|
8909
8905
|
position: linkPos,
|
|
@@ -8955,7 +8951,7 @@ var isActive = (item, active) => {
|
|
|
8955
8951
|
return active.has(item);
|
|
8956
8952
|
};
|
|
8957
8953
|
var EditorToolbar = ({ items, active, onAction }) => {
|
|
8958
|
-
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)(
|
|
8959
8955
|
"button",
|
|
8960
8956
|
{
|
|
8961
8957
|
type: "button",
|
|
@@ -8971,7 +8967,7 @@ var EditorToolbar = ({ items, active, onAction }) => {
|
|
|
8971
8967
|
)) });
|
|
8972
8968
|
};
|
|
8973
8969
|
var SlashMenu = ({ position, items, activeIndex, onSelect, onClose }) => {
|
|
8974
|
-
|
|
8970
|
+
import_react22.default.useEffect(() => {
|
|
8975
8971
|
const handleClickOutside = (e) => {
|
|
8976
8972
|
const target = e.target;
|
|
8977
8973
|
const menu = document.querySelector(".lib-xplat-editor__slash-menu");
|
|
@@ -8980,12 +8976,12 @@ var SlashMenu = ({ position, items, activeIndex, onSelect, onClose }) => {
|
|
|
8980
8976
|
window.addEventListener("mousedown", handleClickOutside);
|
|
8981
8977
|
return () => window.removeEventListener("mousedown", handleClickOutside);
|
|
8982
8978
|
}, [onClose]);
|
|
8983
|
-
return /* @__PURE__ */ (0,
|
|
8979
|
+
return /* @__PURE__ */ (0, import_jsx_runtime323.jsx)(
|
|
8984
8980
|
"div",
|
|
8985
8981
|
{
|
|
8986
8982
|
className: "lib-xplat-editor__slash-menu",
|
|
8987
8983
|
style: { top: position.top, left: position.left },
|
|
8988
|
-
children: items.map((item, i) => /* @__PURE__ */ (0,
|
|
8984
|
+
children: items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime323.jsxs)(
|
|
8989
8985
|
"button",
|
|
8990
8986
|
{
|
|
8991
8987
|
type: "button",
|
|
@@ -8995,8 +8991,8 @@ var SlashMenu = ({ position, items, activeIndex, onSelect, onClose }) => {
|
|
|
8995
8991
|
onSelect(item);
|
|
8996
8992
|
},
|
|
8997
8993
|
children: [
|
|
8998
|
-
/* @__PURE__ */ (0,
|
|
8999
|
-
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 })
|
|
9000
8996
|
]
|
|
9001
8997
|
},
|
|
9002
8998
|
item.key
|
|
@@ -9005,17 +9001,17 @@ var SlashMenu = ({ position, items, activeIndex, onSelect, onClose }) => {
|
|
|
9005
9001
|
);
|
|
9006
9002
|
};
|
|
9007
9003
|
var LinkPopover = ({ position, value, onChange, onConfirm, onClose }) => {
|
|
9008
|
-
const inputRef =
|
|
9009
|
-
|
|
9004
|
+
const inputRef = import_react22.default.useRef(null);
|
|
9005
|
+
import_react22.default.useEffect(() => {
|
|
9010
9006
|
inputRef.current?.focus();
|
|
9011
9007
|
}, []);
|
|
9012
|
-
return /* @__PURE__ */ (0,
|
|
9008
|
+
return /* @__PURE__ */ (0, import_jsx_runtime323.jsxs)(
|
|
9013
9009
|
"div",
|
|
9014
9010
|
{
|
|
9015
9011
|
className: "lib-xplat-editor__link-popover",
|
|
9016
9012
|
style: { top: position.top, left: position.left },
|
|
9017
9013
|
children: [
|
|
9018
|
-
/* @__PURE__ */ (0,
|
|
9014
|
+
/* @__PURE__ */ (0, import_jsx_runtime323.jsx)(
|
|
9019
9015
|
"input",
|
|
9020
9016
|
{
|
|
9021
9017
|
ref: inputRef,
|
|
@@ -9035,11 +9031,11 @@ var LinkPopover = ({ position, value, onChange, onConfirm, onClose }) => {
|
|
|
9035
9031
|
}
|
|
9036
9032
|
}
|
|
9037
9033
|
),
|
|
9038
|
-
/* @__PURE__ */ (0,
|
|
9034
|
+
/* @__PURE__ */ (0, import_jsx_runtime323.jsx)("button", { type: "button", onMouseDown: (e) => {
|
|
9039
9035
|
e.preventDefault();
|
|
9040
9036
|
onConfirm();
|
|
9041
9037
|
}, children: "\uC801\uC6A9" }),
|
|
9042
|
-
/* @__PURE__ */ (0,
|
|
9038
|
+
/* @__PURE__ */ (0, import_jsx_runtime323.jsx)("button", { type: "button", onMouseDown: (e) => {
|
|
9043
9039
|
e.preventDefault();
|
|
9044
9040
|
onClose();
|
|
9045
9041
|
}, children: "\uCDE8\uC18C" })
|
|
@@ -9049,23 +9045,23 @@ var LinkPopover = ({ position, value, onChange, onConfirm, onClose }) => {
|
|
|
9049
9045
|
};
|
|
9050
9046
|
|
|
9051
9047
|
// src/components/EmptyState/EmptyState.tsx
|
|
9052
|
-
var
|
|
9048
|
+
var import_jsx_runtime324 = require("react/jsx-runtime");
|
|
9053
9049
|
var EmptyState = (props) => {
|
|
9054
9050
|
const { icon, title = "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4", description, action } = props;
|
|
9055
|
-
return /* @__PURE__ */ (0,
|
|
9056
|
-
icon && /* @__PURE__ */ (0,
|
|
9057
|
-
!icon && /* @__PURE__ */ (0,
|
|
9058
|
-
/* @__PURE__ */ (0,
|
|
9059
|
-
description && /* @__PURE__ */ (0,
|
|
9060
|
-
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 })
|
|
9061
9057
|
] });
|
|
9062
9058
|
};
|
|
9063
9059
|
EmptyState.displayName = "EmptyState";
|
|
9064
9060
|
var EmptyState_default = EmptyState;
|
|
9065
9061
|
|
|
9066
9062
|
// src/components/FileUpload/FileUpload.tsx
|
|
9067
|
-
var
|
|
9068
|
-
var
|
|
9063
|
+
var import_react23 = __toESM(require("react"), 1);
|
|
9064
|
+
var import_jsx_runtime325 = require("react/jsx-runtime");
|
|
9069
9065
|
var FileUpload = (props) => {
|
|
9070
9066
|
const {
|
|
9071
9067
|
accept,
|
|
@@ -9075,8 +9071,8 @@ var FileUpload = (props) => {
|
|
|
9075
9071
|
label = "\uD30C\uC77C\uC744 \uB4DC\uB798\uADF8\uD558\uAC70\uB098 \uD074\uB9AD\uD558\uC5EC \uC5C5\uB85C\uB4DC",
|
|
9076
9072
|
description
|
|
9077
9073
|
} = props;
|
|
9078
|
-
const [isDragOver, setIsDragOver] =
|
|
9079
|
-
const inputRef =
|
|
9074
|
+
const [isDragOver, setIsDragOver] = import_react23.default.useState(false);
|
|
9075
|
+
const inputRef = import_react23.default.useRef(null);
|
|
9080
9076
|
const handleFiles = (fileList) => {
|
|
9081
9077
|
let files = Array.from(fileList);
|
|
9082
9078
|
if (maxSize) {
|
|
@@ -9106,7 +9102,7 @@ var FileUpload = (props) => {
|
|
|
9106
9102
|
handleFiles(e.target.files);
|
|
9107
9103
|
}
|
|
9108
9104
|
};
|
|
9109
|
-
return /* @__PURE__ */ (0,
|
|
9105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime325.jsxs)(
|
|
9110
9106
|
"div",
|
|
9111
9107
|
{
|
|
9112
9108
|
className: clsx_default("lib-xplat-file-upload", { "drag-over": isDragOver }),
|
|
@@ -9115,7 +9111,7 @@ var FileUpload = (props) => {
|
|
|
9115
9111
|
onDragLeave: handleDragLeave,
|
|
9116
9112
|
onClick: () => inputRef.current?.click(),
|
|
9117
9113
|
children: [
|
|
9118
|
-
/* @__PURE__ */ (0,
|
|
9114
|
+
/* @__PURE__ */ (0, import_jsx_runtime325.jsx)(
|
|
9119
9115
|
"input",
|
|
9120
9116
|
{
|
|
9121
9117
|
ref: inputRef,
|
|
@@ -9125,9 +9121,9 @@ var FileUpload = (props) => {
|
|
|
9125
9121
|
onChange: handleChange
|
|
9126
9122
|
}
|
|
9127
9123
|
),
|
|
9128
|
-
/* @__PURE__ */ (0,
|
|
9129
|
-
/* @__PURE__ */ (0,
|
|
9130
|
-
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 })
|
|
9131
9127
|
]
|
|
9132
9128
|
}
|
|
9133
9129
|
);
|
|
@@ -9136,10 +9132,10 @@ FileUpload.displayName = "FileUpload";
|
|
|
9136
9132
|
var FileUpload_default = FileUpload;
|
|
9137
9133
|
|
|
9138
9134
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
9139
|
-
var
|
|
9135
|
+
var import_react25 = __toESM(require("react"), 1);
|
|
9140
9136
|
|
|
9141
9137
|
// src/components/HtmlTypeWriter/utils.ts
|
|
9142
|
-
var
|
|
9138
|
+
var import_react24 = __toESM(require("react"), 1);
|
|
9143
9139
|
var voidTags = /* @__PURE__ */ new Set([
|
|
9144
9140
|
"br",
|
|
9145
9141
|
"img",
|
|
@@ -9207,41 +9203,41 @@ var convertNodeToReactWithRange = (node, typedLen, rangeMap) => {
|
|
|
9207
9203
|
props[attr.name] = attr.value;
|
|
9208
9204
|
});
|
|
9209
9205
|
if (voidTags.has(tag)) {
|
|
9210
|
-
return
|
|
9206
|
+
return import_react24.default.createElement(tag, props);
|
|
9211
9207
|
}
|
|
9212
9208
|
const children = Array.from(element.childNodes).map((child) => convertNodeToReactWithRange(child, typedLen, rangeMap)).filter((n) => n != null);
|
|
9213
|
-
return
|
|
9209
|
+
return import_react24.default.createElement(tag, props, ...children);
|
|
9214
9210
|
};
|
|
9215
9211
|
var htmlToReactProgressive = (root, typedLen, rangeMap) => {
|
|
9216
9212
|
const nodes = Array.from(root.childNodes).map((child, idx) => {
|
|
9217
9213
|
const node = convertNodeToReactWithRange(child, typedLen, rangeMap);
|
|
9218
|
-
return node == null ? null :
|
|
9214
|
+
return node == null ? null : import_react24.default.createElement(import_react24.default.Fragment, { key: idx }, node);
|
|
9219
9215
|
}).filter(Boolean);
|
|
9220
9216
|
return nodes.length === 0 ? null : nodes;
|
|
9221
9217
|
};
|
|
9222
9218
|
|
|
9223
9219
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
9224
|
-
var
|
|
9220
|
+
var import_jsx_runtime326 = require("react/jsx-runtime");
|
|
9225
9221
|
var HtmlTypeWriter = ({
|
|
9226
9222
|
html,
|
|
9227
9223
|
duration = 20,
|
|
9228
9224
|
onDone,
|
|
9229
9225
|
onChange
|
|
9230
9226
|
}) => {
|
|
9231
|
-
const [typedLen, setTypedLen] =
|
|
9232
|
-
const doneCalledRef =
|
|
9233
|
-
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(() => {
|
|
9234
9230
|
if (typeof window === "undefined") return { doc: null, rangeMap: /* @__PURE__ */ new Map(), totalLength: 0 };
|
|
9235
9231
|
const decoded = decodeHtmlEntities(html);
|
|
9236
9232
|
const doc2 = new DOMParser().parseFromString(decoded, "text/html");
|
|
9237
9233
|
const { rangeMap: rangeMap2, totalLength: totalLength2 } = buildRangeMap(doc2.body);
|
|
9238
9234
|
return { doc: doc2, rangeMap: rangeMap2, totalLength: totalLength2 };
|
|
9239
9235
|
}, [html]);
|
|
9240
|
-
|
|
9236
|
+
import_react25.default.useEffect(() => {
|
|
9241
9237
|
setTypedLen(0);
|
|
9242
9238
|
doneCalledRef.current = false;
|
|
9243
9239
|
}, [html]);
|
|
9244
|
-
|
|
9240
|
+
import_react25.default.useEffect(() => {
|
|
9245
9241
|
if (!totalLength) return;
|
|
9246
9242
|
if (typedLen >= totalLength) return;
|
|
9247
9243
|
const timer = window.setInterval(() => {
|
|
@@ -9249,33 +9245,33 @@ var HtmlTypeWriter = ({
|
|
|
9249
9245
|
}, duration);
|
|
9250
9246
|
return () => window.clearInterval(timer);
|
|
9251
9247
|
}, [typedLen, totalLength, duration]);
|
|
9252
|
-
|
|
9248
|
+
import_react25.default.useEffect(() => {
|
|
9253
9249
|
if (typedLen > 0 && typedLen < totalLength) {
|
|
9254
9250
|
onChange?.();
|
|
9255
9251
|
}
|
|
9256
9252
|
}, [typedLen, totalLength, onChange]);
|
|
9257
|
-
|
|
9253
|
+
import_react25.default.useEffect(() => {
|
|
9258
9254
|
if (typedLen === totalLength && totalLength > 0 && !doneCalledRef.current) {
|
|
9259
9255
|
doneCalledRef.current = true;
|
|
9260
9256
|
onDone?.();
|
|
9261
9257
|
}
|
|
9262
9258
|
}, [typedLen, totalLength, onDone]);
|
|
9263
|
-
const parsed =
|
|
9259
|
+
const parsed = import_react25.default.useMemo(
|
|
9264
9260
|
() => doc ? htmlToReactProgressive(doc.body, typedLen, rangeMap) : null,
|
|
9265
9261
|
[doc, typedLen, rangeMap]
|
|
9266
9262
|
);
|
|
9267
|
-
return /* @__PURE__ */ (0,
|
|
9263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime326.jsx)("div", { className: "lib-xplat-htmlTypewriter", children: parsed });
|
|
9268
9264
|
};
|
|
9269
9265
|
HtmlTypeWriter.displayName = "HtmlTypeWriter";
|
|
9270
9266
|
var HtmlTypeWriter_default = HtmlTypeWriter;
|
|
9271
9267
|
|
|
9272
9268
|
// src/components/ImageSelector/ImageSelector.tsx
|
|
9273
|
-
var
|
|
9274
|
-
var
|
|
9269
|
+
var import_react26 = __toESM(require("react"), 1);
|
|
9270
|
+
var import_jsx_runtime327 = require("react/jsx-runtime");
|
|
9275
9271
|
var ImageSelector = (props) => {
|
|
9276
9272
|
const { value, label, onChange } = props;
|
|
9277
|
-
const [previewUrl, setPreviewUrl] =
|
|
9278
|
-
|
|
9273
|
+
const [previewUrl, setPreviewUrl] = import_react26.default.useState();
|
|
9274
|
+
import_react26.default.useEffect(() => {
|
|
9279
9275
|
if (!value) {
|
|
9280
9276
|
setPreviewUrl(void 0);
|
|
9281
9277
|
return;
|
|
@@ -9284,7 +9280,7 @@ var ImageSelector = (props) => {
|
|
|
9284
9280
|
setPreviewUrl(url);
|
|
9285
9281
|
return () => URL.revokeObjectURL(url);
|
|
9286
9282
|
}, [value]);
|
|
9287
|
-
const inputRef =
|
|
9283
|
+
const inputRef = import_react26.default.useRef(null);
|
|
9288
9284
|
const handleFileChange = (e) => {
|
|
9289
9285
|
const selectedFile = e.target.files?.[0];
|
|
9290
9286
|
if (selectedFile) {
|
|
@@ -9297,8 +9293,8 @@ var ImageSelector = (props) => {
|
|
|
9297
9293
|
const handleOpenFileDialog = () => {
|
|
9298
9294
|
inputRef.current?.click();
|
|
9299
9295
|
};
|
|
9300
|
-
return /* @__PURE__ */ (0,
|
|
9301
|
-
/* @__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)(
|
|
9302
9298
|
"input",
|
|
9303
9299
|
{
|
|
9304
9300
|
type: "file",
|
|
@@ -9308,13 +9304,13 @@ var ImageSelector = (props) => {
|
|
|
9308
9304
|
ref: inputRef
|
|
9309
9305
|
}
|
|
9310
9306
|
),
|
|
9311
|
-
value && /* @__PURE__ */ (0,
|
|
9312
|
-
/* @__PURE__ */ (0,
|
|
9313
|
-
/* @__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, {}) })
|
|
9314
9310
|
] }),
|
|
9315
|
-
/* @__PURE__ */ (0,
|
|
9316
|
-
/* @__PURE__ */ (0,
|
|
9317
|
-
/* @__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" })
|
|
9318
9314
|
] }) })
|
|
9319
9315
|
] });
|
|
9320
9316
|
};
|
|
@@ -9322,10 +9318,10 @@ ImageSelector.displayName = "ImageSelector";
|
|
|
9322
9318
|
var ImageSelector_default = ImageSelector;
|
|
9323
9319
|
|
|
9324
9320
|
// src/components/Link/Link.tsx
|
|
9325
|
-
var
|
|
9321
|
+
var import_jsx_runtime328 = require("react/jsx-runtime");
|
|
9326
9322
|
var Link = (props) => {
|
|
9327
9323
|
const { children, href, underline = "always", target, rel, ...rest } = props;
|
|
9328
|
-
return /* @__PURE__ */ (0,
|
|
9324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime328.jsx)(
|
|
9329
9325
|
"a",
|
|
9330
9326
|
{
|
|
9331
9327
|
className: clsx_default("lib-xplat-link", `underline-${underline}`),
|
|
@@ -9341,10 +9337,10 @@ Link.displayName = "Link";
|
|
|
9341
9337
|
var Link_default = Link;
|
|
9342
9338
|
|
|
9343
9339
|
// src/components/LinkButton/LinkButton.tsx
|
|
9344
|
-
var
|
|
9340
|
+
var import_jsx_runtime329 = require("react/jsx-runtime");
|
|
9345
9341
|
var LinkButton = (props) => {
|
|
9346
9342
|
const { children, href, type = "primary", size = "md", target, rel, ...rest } = props;
|
|
9347
|
-
return /* @__PURE__ */ (0,
|
|
9343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime329.jsx)(
|
|
9348
9344
|
"a",
|
|
9349
9345
|
{
|
|
9350
9346
|
className: clsx_default("lib-xplat-button", type, size),
|
|
@@ -9360,7 +9356,7 @@ LinkButton.displayName = "LinkButton";
|
|
|
9360
9356
|
var LinkButton_default = LinkButton;
|
|
9361
9357
|
|
|
9362
9358
|
// src/components/NotificationBadge/NotificationBadge.tsx
|
|
9363
|
-
var
|
|
9359
|
+
var import_jsx_runtime330 = require("react/jsx-runtime");
|
|
9364
9360
|
var NotificationBadge = (props) => {
|
|
9365
9361
|
const {
|
|
9366
9362
|
children,
|
|
@@ -9372,16 +9368,16 @@ var NotificationBadge = (props) => {
|
|
|
9372
9368
|
} = props;
|
|
9373
9369
|
const showBadge = dot || count !== void 0 && count > 0;
|
|
9374
9370
|
const displayCount = count !== void 0 && count > maxCount ? `${maxCount}+` : count;
|
|
9375
|
-
return /* @__PURE__ */ (0,
|
|
9371
|
+
return /* @__PURE__ */ (0, import_jsx_runtime330.jsxs)("div", { className: clsx_default("lib-xplat-notification-badge", size), children: [
|
|
9376
9372
|
children,
|
|
9377
|
-
showBadge && /* @__PURE__ */ (0,
|
|
9373
|
+
showBadge && /* @__PURE__ */ (0, import_jsx_runtime330.jsx)("span", { className: clsx_default("badge-indicator", type, { dot }), children: !dot && displayCount })
|
|
9378
9374
|
] });
|
|
9379
9375
|
};
|
|
9380
9376
|
NotificationBadge.displayName = "NotificationBadge";
|
|
9381
9377
|
var NotificationBadge_default = NotificationBadge;
|
|
9382
9378
|
|
|
9383
9379
|
// src/components/Pagination/Pagination.tsx
|
|
9384
|
-
var
|
|
9380
|
+
var import_jsx_runtime331 = require("react/jsx-runtime");
|
|
9385
9381
|
var getPageRange = (current, totalPages, siblingCount) => {
|
|
9386
9382
|
const totalNumbers = siblingCount * 2 + 5;
|
|
9387
9383
|
if (totalPages <= totalNumbers) {
|
|
@@ -9424,19 +9420,19 @@ var Pagination = (props) => {
|
|
|
9424
9420
|
onChange?.(page);
|
|
9425
9421
|
}
|
|
9426
9422
|
};
|
|
9427
|
-
return /* @__PURE__ */ (0,
|
|
9428
|
-
/* @__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)(
|
|
9429
9425
|
"button",
|
|
9430
9426
|
{
|
|
9431
9427
|
className: "page-btn prev",
|
|
9432
9428
|
disabled: current <= 1,
|
|
9433
9429
|
onClick: () => handleClick(current - 1),
|
|
9434
9430
|
"aria-label": "\uC774\uC804 \uD398\uC774\uC9C0",
|
|
9435
|
-
children: /* @__PURE__ */ (0,
|
|
9431
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime331.jsx)(ChevronLeftIcon_default, {})
|
|
9436
9432
|
}
|
|
9437
9433
|
),
|
|
9438
9434
|
pages.map(
|
|
9439
|
-
(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)(
|
|
9440
9436
|
"button",
|
|
9441
9437
|
{
|
|
9442
9438
|
className: clsx_default("page-btn", { active: page === current }),
|
|
@@ -9447,14 +9443,14 @@ var Pagination = (props) => {
|
|
|
9447
9443
|
page
|
|
9448
9444
|
)
|
|
9449
9445
|
),
|
|
9450
|
-
/* @__PURE__ */ (0,
|
|
9446
|
+
/* @__PURE__ */ (0, import_jsx_runtime331.jsx)(
|
|
9451
9447
|
"button",
|
|
9452
9448
|
{
|
|
9453
9449
|
className: "page-btn next",
|
|
9454
9450
|
disabled: current >= totalPages,
|
|
9455
9451
|
onClick: () => handleClick(current + 1),
|
|
9456
9452
|
"aria-label": "\uB2E4\uC74C \uD398\uC774\uC9C0",
|
|
9457
|
-
children: /* @__PURE__ */ (0,
|
|
9453
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime331.jsx)(ChevronRightIcon_default, {})
|
|
9458
9454
|
}
|
|
9459
9455
|
)
|
|
9460
9456
|
] });
|
|
@@ -9463,17 +9459,17 @@ Pagination.displayName = "Pagination";
|
|
|
9463
9459
|
var Pagination_default = Pagination;
|
|
9464
9460
|
|
|
9465
9461
|
// src/components/PopOver/PopOver.tsx
|
|
9466
|
-
var
|
|
9467
|
-
var
|
|
9462
|
+
var import_react27 = __toESM(require("react"), 1);
|
|
9463
|
+
var import_jsx_runtime332 = require("react/jsx-runtime");
|
|
9468
9464
|
var PopOver = (props) => {
|
|
9469
9465
|
const { children, isOpen, onClose, PopOverEl } = props;
|
|
9470
|
-
const popRef =
|
|
9471
|
-
const triggerRef =
|
|
9472
|
-
const [localOpen, setLocalOpen] =
|
|
9473
|
-
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);
|
|
9474
9470
|
useClickOutside_default([popRef, triggerRef], onClose, isOpen);
|
|
9475
9471
|
const position = useAutoPosition_default(triggerRef, popRef, localOpen);
|
|
9476
|
-
|
|
9472
|
+
import_react27.default.useEffect(() => {
|
|
9477
9473
|
if (isOpen) {
|
|
9478
9474
|
setLocalOpen(isOpen);
|
|
9479
9475
|
setTimeout(() => {
|
|
@@ -9486,7 +9482,7 @@ var PopOver = (props) => {
|
|
|
9486
9482
|
}, 200);
|
|
9487
9483
|
}
|
|
9488
9484
|
}, [isOpen]);
|
|
9489
|
-
return /* @__PURE__ */ (0,
|
|
9485
|
+
return /* @__PURE__ */ (0, import_jsx_runtime332.jsxs)(
|
|
9490
9486
|
"div",
|
|
9491
9487
|
{
|
|
9492
9488
|
className: "lib-xplat-pop-over",
|
|
@@ -9496,7 +9492,7 @@ var PopOver = (props) => {
|
|
|
9496
9492
|
},
|
|
9497
9493
|
children: [
|
|
9498
9494
|
children,
|
|
9499
|
-
localOpen && /* @__PURE__ */ (0,
|
|
9495
|
+
localOpen && /* @__PURE__ */ (0, import_jsx_runtime332.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime332.jsx)(
|
|
9500
9496
|
"div",
|
|
9501
9497
|
{
|
|
9502
9498
|
className: clsx_default(
|
|
@@ -9519,7 +9515,7 @@ PopOver.displayName = "PopOver";
|
|
|
9519
9515
|
var PopOver_default = PopOver;
|
|
9520
9516
|
|
|
9521
9517
|
// src/components/Progress/Progress.tsx
|
|
9522
|
-
var
|
|
9518
|
+
var import_jsx_runtime333 = require("react/jsx-runtime");
|
|
9523
9519
|
var Progress = (props) => {
|
|
9524
9520
|
const {
|
|
9525
9521
|
value,
|
|
@@ -9529,8 +9525,8 @@ var Progress = (props) => {
|
|
|
9529
9525
|
showLabel = false
|
|
9530
9526
|
} = props;
|
|
9531
9527
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
9532
|
-
return /* @__PURE__ */ (0,
|
|
9533
|
-
/* @__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)(
|
|
9534
9530
|
"div",
|
|
9535
9531
|
{
|
|
9536
9532
|
className: "track",
|
|
@@ -9538,7 +9534,7 @@ var Progress = (props) => {
|
|
|
9538
9534
|
"aria-valuenow": value,
|
|
9539
9535
|
"aria-valuemin": 0,
|
|
9540
9536
|
"aria-valuemax": max,
|
|
9541
|
-
children: /* @__PURE__ */ (0,
|
|
9537
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime333.jsx)(
|
|
9542
9538
|
"div",
|
|
9543
9539
|
{
|
|
9544
9540
|
className: "bar",
|
|
@@ -9547,7 +9543,7 @@ var Progress = (props) => {
|
|
|
9547
9543
|
)
|
|
9548
9544
|
}
|
|
9549
9545
|
),
|
|
9550
|
-
showLabel && /* @__PURE__ */ (0,
|
|
9546
|
+
showLabel && /* @__PURE__ */ (0, import_jsx_runtime333.jsxs)("span", { className: "label", children: [
|
|
9551
9547
|
Math.round(percentage),
|
|
9552
9548
|
"%"
|
|
9553
9549
|
] })
|
|
@@ -9557,17 +9553,17 @@ Progress.displayName = "Progress";
|
|
|
9557
9553
|
var Progress_default = Progress;
|
|
9558
9554
|
|
|
9559
9555
|
// src/components/Radio/RadioGroupContext.tsx
|
|
9560
|
-
var
|
|
9561
|
-
var RadioGroupContext =
|
|
9556
|
+
var import_react28 = __toESM(require("react"), 1);
|
|
9557
|
+
var RadioGroupContext = import_react28.default.createContext(
|
|
9562
9558
|
null
|
|
9563
9559
|
);
|
|
9564
9560
|
var useRadioGroupContext = () => {
|
|
9565
|
-
return
|
|
9561
|
+
return import_react28.default.useContext(RadioGroupContext);
|
|
9566
9562
|
};
|
|
9567
9563
|
var RadioGroupContext_default = RadioGroupContext;
|
|
9568
9564
|
|
|
9569
9565
|
// src/components/Radio/Radio.tsx
|
|
9570
|
-
var
|
|
9566
|
+
var import_jsx_runtime334 = require("react/jsx-runtime");
|
|
9571
9567
|
var Radio = (props) => {
|
|
9572
9568
|
const {
|
|
9573
9569
|
label,
|
|
@@ -9586,7 +9582,7 @@ var Radio = (props) => {
|
|
|
9586
9582
|
value,
|
|
9587
9583
|
onChange: rest.onChange
|
|
9588
9584
|
};
|
|
9589
|
-
return /* @__PURE__ */ (0,
|
|
9585
|
+
return /* @__PURE__ */ (0, import_jsx_runtime334.jsxs)(
|
|
9590
9586
|
"label",
|
|
9591
9587
|
{
|
|
9592
9588
|
className: clsx_default(
|
|
@@ -9597,18 +9593,18 @@ var Radio = (props) => {
|
|
|
9597
9593
|
className
|
|
9598
9594
|
),
|
|
9599
9595
|
children: [
|
|
9600
|
-
/* @__PURE__ */ (0,
|
|
9601
|
-
/* @__PURE__ */ (0,
|
|
9596
|
+
/* @__PURE__ */ (0, import_jsx_runtime334.jsx)("input", { ...rest, ...inputProps, checked: localChecked, type: "radio" }),
|
|
9597
|
+
/* @__PURE__ */ (0, import_jsx_runtime334.jsx)(
|
|
9602
9598
|
"div",
|
|
9603
9599
|
{
|
|
9604
9600
|
className: clsx_default(
|
|
9605
9601
|
"circle",
|
|
9606
9602
|
localChecked ? "checked" : void 0
|
|
9607
9603
|
),
|
|
9608
|
-
children: localChecked && /* @__PURE__ */ (0,
|
|
9604
|
+
children: localChecked && /* @__PURE__ */ (0, import_jsx_runtime334.jsx)("div", { className: "inner-circle" })
|
|
9609
9605
|
}
|
|
9610
9606
|
),
|
|
9611
|
-
label && /* @__PURE__ */ (0,
|
|
9607
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime334.jsx)("span", { children: label })
|
|
9612
9608
|
]
|
|
9613
9609
|
}
|
|
9614
9610
|
);
|
|
@@ -9617,28 +9613,28 @@ Radio.displayName = "Radio";
|
|
|
9617
9613
|
var Radio_default = Radio;
|
|
9618
9614
|
|
|
9619
9615
|
// src/components/Radio/RadioGroup.tsx
|
|
9620
|
-
var
|
|
9616
|
+
var import_jsx_runtime335 = require("react/jsx-runtime");
|
|
9621
9617
|
var RadioGroup = (props) => {
|
|
9622
9618
|
const { children, ...rest } = props;
|
|
9623
|
-
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 }) });
|
|
9624
9620
|
};
|
|
9625
9621
|
RadioGroup.displayName = "RadioGroup";
|
|
9626
9622
|
var RadioGroup_default = RadioGroup;
|
|
9627
9623
|
|
|
9628
9624
|
// src/components/Select/Select.tsx
|
|
9629
|
-
var
|
|
9625
|
+
var import_react31 = __toESM(require("react"), 1);
|
|
9630
9626
|
|
|
9631
9627
|
// src/components/Select/context.ts
|
|
9632
|
-
var
|
|
9633
|
-
var SelectContext =
|
|
9628
|
+
var import_react29 = __toESM(require("react"), 1);
|
|
9629
|
+
var SelectContext = import_react29.default.createContext(null);
|
|
9634
9630
|
var context_default = SelectContext;
|
|
9635
9631
|
|
|
9636
9632
|
// src/components/Select/SelectItem.tsx
|
|
9637
|
-
var
|
|
9638
|
-
var
|
|
9633
|
+
var import_react30 = __toESM(require("react"), 1);
|
|
9634
|
+
var import_jsx_runtime336 = require("react/jsx-runtime");
|
|
9639
9635
|
var SelectItem = (props) => {
|
|
9640
9636
|
const { children, value, onClick, disabled = false } = props;
|
|
9641
|
-
const ctx =
|
|
9637
|
+
const ctx = import_react30.default.useContext(context_default);
|
|
9642
9638
|
const handleClick = (e) => {
|
|
9643
9639
|
e.preventDefault();
|
|
9644
9640
|
e.stopPropagation();
|
|
@@ -9648,7 +9644,7 @@ var SelectItem = (props) => {
|
|
|
9648
9644
|
onClick?.();
|
|
9649
9645
|
};
|
|
9650
9646
|
const isSelected = value !== void 0 ? ctx?.selectedValue === value : ctx?.selectedLabel === children;
|
|
9651
|
-
return /* @__PURE__ */ (0,
|
|
9647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(
|
|
9652
9648
|
"div",
|
|
9653
9649
|
{
|
|
9654
9650
|
className: clsx_default("select-item", disabled && "disabled", isSelected && "is-selected"),
|
|
@@ -9669,7 +9665,7 @@ SelectItem.displayName = "Select.Item";
|
|
|
9669
9665
|
var SelectItem_default = SelectItem;
|
|
9670
9666
|
|
|
9671
9667
|
// src/components/Select/Select.tsx
|
|
9672
|
-
var
|
|
9668
|
+
var import_jsx_runtime337 = require("react/jsx-runtime");
|
|
9673
9669
|
var ANIMATION_DURATION_MS3 = 200;
|
|
9674
9670
|
var SelectRoot = (props) => {
|
|
9675
9671
|
const {
|
|
@@ -9681,28 +9677,28 @@ var SelectRoot = (props) => {
|
|
|
9681
9677
|
error = false,
|
|
9682
9678
|
size = "md"
|
|
9683
9679
|
} = props;
|
|
9684
|
-
const itemChildren =
|
|
9685
|
-
(child) =>
|
|
9680
|
+
const itemChildren = import_react31.default.Children.toArray(children).filter(
|
|
9681
|
+
(child) => import_react31.default.isValidElement(child) && child.type === SelectItem_default
|
|
9686
9682
|
);
|
|
9687
9683
|
const isControlled = valueProp !== void 0;
|
|
9688
|
-
const [isOpen, setOpen] =
|
|
9689
|
-
const [uncontrolledLabel, setUncontrolledLabel] =
|
|
9690
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
9691
|
-
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(() => {
|
|
9692
9688
|
if (!isControlled) return null;
|
|
9693
9689
|
const match = itemChildren.find((child) => child.props.value === valueProp);
|
|
9694
9690
|
return match ? match.props.children : null;
|
|
9695
9691
|
}, [isControlled, valueProp, itemChildren]);
|
|
9696
9692
|
const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
|
|
9697
9693
|
const selectedValue = isControlled ? valueProp : uncontrolledValue;
|
|
9698
|
-
const triggerRef =
|
|
9699
|
-
const contentRef =
|
|
9700
|
-
const [mounted, setMounted] =
|
|
9701
|
-
const [visible, setVisible] =
|
|
9702
|
-
|
|
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(() => {
|
|
9703
9699
|
if (disabled && isOpen) setOpen(false);
|
|
9704
9700
|
}, [disabled, isOpen]);
|
|
9705
|
-
|
|
9701
|
+
import_react31.default.useEffect(() => {
|
|
9706
9702
|
if (isOpen) {
|
|
9707
9703
|
setMounted(true);
|
|
9708
9704
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -9712,12 +9708,12 @@ var SelectRoot = (props) => {
|
|
|
9712
9708
|
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS3);
|
|
9713
9709
|
return () => clearTimeout(t);
|
|
9714
9710
|
}, [isOpen]);
|
|
9715
|
-
const open =
|
|
9716
|
-
const close =
|
|
9717
|
-
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), []);
|
|
9718
9714
|
useClickOutside_default([contentRef, triggerRef], close, isOpen);
|
|
9719
9715
|
const position = useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
9720
|
-
const setSelected =
|
|
9716
|
+
const setSelected = import_react31.default.useCallback(
|
|
9721
9717
|
(label, itemValue) => {
|
|
9722
9718
|
if (!isControlled) {
|
|
9723
9719
|
setUncontrolledLabel(label);
|
|
@@ -9727,7 +9723,7 @@ var SelectRoot = (props) => {
|
|
|
9727
9723
|
},
|
|
9728
9724
|
[isControlled, onChange]
|
|
9729
9725
|
);
|
|
9730
|
-
const ctxValue =
|
|
9726
|
+
const ctxValue = import_react31.default.useMemo(
|
|
9731
9727
|
() => ({
|
|
9732
9728
|
isOpen,
|
|
9733
9729
|
mounted,
|
|
@@ -9749,7 +9745,7 @@ var SelectRoot = (props) => {
|
|
|
9749
9745
|
if (disabled) return;
|
|
9750
9746
|
toggle();
|
|
9751
9747
|
};
|
|
9752
|
-
return /* @__PURE__ */ (0,
|
|
9748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(context_default.Provider, { value: ctxValue, children: /* @__PURE__ */ (0, import_jsx_runtime337.jsxs)(
|
|
9753
9749
|
"div",
|
|
9754
9750
|
{
|
|
9755
9751
|
className: clsx_default(
|
|
@@ -9760,7 +9756,7 @@ var SelectRoot = (props) => {
|
|
|
9760
9756
|
mounted && "is-open"
|
|
9761
9757
|
),
|
|
9762
9758
|
children: [
|
|
9763
|
-
/* @__PURE__ */ (0,
|
|
9759
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsxs)(
|
|
9764
9760
|
"div",
|
|
9765
9761
|
{
|
|
9766
9762
|
ref: triggerRef,
|
|
@@ -9784,7 +9780,7 @@ var SelectRoot = (props) => {
|
|
|
9784
9780
|
}
|
|
9785
9781
|
},
|
|
9786
9782
|
children: [
|
|
9787
|
-
/* @__PURE__ */ (0,
|
|
9783
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
9788
9784
|
"span",
|
|
9789
9785
|
{
|
|
9790
9786
|
className: clsx_default(
|
|
@@ -9794,25 +9790,25 @@ var SelectRoot = (props) => {
|
|
|
9794
9790
|
children: selectedLabel ?? placeholder
|
|
9795
9791
|
}
|
|
9796
9792
|
),
|
|
9797
|
-
/* @__PURE__ */ (0,
|
|
9793
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
9798
9794
|
"span",
|
|
9799
9795
|
{
|
|
9800
9796
|
className: clsx_default("select-trigger-icon", isOpen && "open"),
|
|
9801
9797
|
"aria-hidden": true,
|
|
9802
|
-
children: /* @__PURE__ */ (0,
|
|
9798
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(ChevronDownIcon_default, {})
|
|
9803
9799
|
}
|
|
9804
9800
|
)
|
|
9805
9801
|
]
|
|
9806
9802
|
}
|
|
9807
9803
|
),
|
|
9808
|
-
mounted && /* @__PURE__ */ (0,
|
|
9804
|
+
mounted && /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
9809
9805
|
"div",
|
|
9810
9806
|
{
|
|
9811
9807
|
className: clsx_default("lib-xplat-select-content", size, position.direction, stateClass),
|
|
9812
9808
|
ref: contentRef,
|
|
9813
9809
|
style: { ...position.position, width: triggerRef.current?.offsetWidth },
|
|
9814
9810
|
role: "listbox",
|
|
9815
|
-
children: /* @__PURE__ */ (0,
|
|
9811
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(context_default.Provider, { value: ctxValue, children: itemChildren })
|
|
9816
9812
|
}
|
|
9817
9813
|
) })
|
|
9818
9814
|
]
|
|
@@ -9826,7 +9822,7 @@ var Select = Object.assign(SelectRoot, {
|
|
|
9826
9822
|
var Select_default = Select;
|
|
9827
9823
|
|
|
9828
9824
|
// src/components/Skeleton/Skeleton.tsx
|
|
9829
|
-
var
|
|
9825
|
+
var import_jsx_runtime338 = require("react/jsx-runtime");
|
|
9830
9826
|
var SIZE_MAP = {
|
|
9831
9827
|
xs: "var(--spacing-space-1)",
|
|
9832
9828
|
sm: "var(--spacing-space-2)",
|
|
@@ -9842,7 +9838,7 @@ var Skeleton = (props) => {
|
|
|
9842
9838
|
...width != null && { width: SIZE_MAP[width] },
|
|
9843
9839
|
...height != null && { height: SIZE_MAP[height] }
|
|
9844
9840
|
};
|
|
9845
|
-
return /* @__PURE__ */ (0,
|
|
9841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime338.jsx)(
|
|
9846
9842
|
"div",
|
|
9847
9843
|
{
|
|
9848
9844
|
className: clsx_default("lib-xplat-skeleton", variant),
|
|
@@ -9855,20 +9851,20 @@ Skeleton.displayName = "Skeleton";
|
|
|
9855
9851
|
var Skeleton_default = Skeleton;
|
|
9856
9852
|
|
|
9857
9853
|
// src/components/Spinner/Spinner.tsx
|
|
9858
|
-
var
|
|
9854
|
+
var import_jsx_runtime339 = require("react/jsx-runtime");
|
|
9859
9855
|
var Spinner = (props) => {
|
|
9860
9856
|
const {
|
|
9861
9857
|
size = "md",
|
|
9862
9858
|
type = "brand"
|
|
9863
9859
|
} = props;
|
|
9864
|
-
return /* @__PURE__ */ (0,
|
|
9860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
|
|
9865
9861
|
"div",
|
|
9866
9862
|
{
|
|
9867
9863
|
className: clsx_default("lib-xplat-spinner", size, type),
|
|
9868
9864
|
role: "status",
|
|
9869
9865
|
"aria-label": "\uB85C\uB529 \uC911",
|
|
9870
|
-
children: /* @__PURE__ */ (0,
|
|
9871
|
-
/* @__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)(
|
|
9872
9868
|
"circle",
|
|
9873
9869
|
{
|
|
9874
9870
|
className: "track",
|
|
@@ -9878,7 +9874,7 @@ var Spinner = (props) => {
|
|
|
9878
9874
|
strokeWidth: "3"
|
|
9879
9875
|
}
|
|
9880
9876
|
),
|
|
9881
|
-
/* @__PURE__ */ (0,
|
|
9877
|
+
/* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
|
|
9882
9878
|
"circle",
|
|
9883
9879
|
{
|
|
9884
9880
|
className: "indicator",
|
|
@@ -9897,20 +9893,20 @@ Spinner.displayName = "Spinner";
|
|
|
9897
9893
|
var Spinner_default = Spinner;
|
|
9898
9894
|
|
|
9899
9895
|
// src/components/Steps/Steps.tsx
|
|
9900
|
-
var
|
|
9896
|
+
var import_jsx_runtime340 = require("react/jsx-runtime");
|
|
9901
9897
|
var Steps = (props) => {
|
|
9902
9898
|
const {
|
|
9903
9899
|
items,
|
|
9904
9900
|
current,
|
|
9905
9901
|
type = "brand"
|
|
9906
9902
|
} = props;
|
|
9907
|
-
return /* @__PURE__ */ (0,
|
|
9903
|
+
return /* @__PURE__ */ (0, import_jsx_runtime340.jsx)("div", { className: clsx_default("lib-xplat-steps", type), children: items.map((item, index) => {
|
|
9908
9904
|
const status = index < current ? "completed" : index === current ? "active" : "pending";
|
|
9909
|
-
return /* @__PURE__ */ (0,
|
|
9910
|
-
/* @__PURE__ */ (0,
|
|
9911
|
-
/* @__PURE__ */ (0,
|
|
9912
|
-
/* @__PURE__ */ (0,
|
|
9913
|
-
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 })
|
|
9914
9910
|
] })
|
|
9915
9911
|
] }, index);
|
|
9916
9912
|
}) });
|
|
@@ -9919,8 +9915,8 @@ Steps.displayName = "Steps";
|
|
|
9919
9915
|
var Steps_default = Steps;
|
|
9920
9916
|
|
|
9921
9917
|
// src/components/Swiper/Swiper.tsx
|
|
9922
|
-
var
|
|
9923
|
-
var
|
|
9918
|
+
var import_react32 = __toESM(require("react"), 1);
|
|
9919
|
+
var import_jsx_runtime341 = require("react/jsx-runtime");
|
|
9924
9920
|
var Swiper = (props) => {
|
|
9925
9921
|
const {
|
|
9926
9922
|
auto = false,
|
|
@@ -9944,26 +9940,26 @@ var Swiper = (props) => {
|
|
|
9944
9940
|
const maxIndex = Math.max(0, totalSlides - viewItemCount);
|
|
9945
9941
|
const useLoop = loop && canSlide;
|
|
9946
9942
|
const cloneCount = useLoop ? totalSlides : 0;
|
|
9947
|
-
const extendedItems =
|
|
9943
|
+
const extendedItems = import_react32.default.useMemo(() => {
|
|
9948
9944
|
if (!useLoop) return items;
|
|
9949
9945
|
return [...items, ...items, ...items];
|
|
9950
9946
|
}, [items, useLoop]);
|
|
9951
9947
|
const initialIdx = Math.max(0, Math.min(indexProp ?? 0, maxIndex));
|
|
9952
|
-
const [innerIndex, setInnerIndex] =
|
|
9948
|
+
const [innerIndex, setInnerIndex] = import_react32.default.useState(
|
|
9953
9949
|
useLoop ? cloneCount + initialIdx : initialIdx
|
|
9954
9950
|
);
|
|
9955
|
-
const [isDragging, setIsDragging] =
|
|
9956
|
-
const [dragOffset, setDragOffset] =
|
|
9957
|
-
const [animated, setAnimated] =
|
|
9958
|
-
const [containerWidth, setContainerWidth] =
|
|
9959
|
-
const containerRef =
|
|
9960
|
-
const startXRef =
|
|
9961
|
-
const startTimeRef =
|
|
9962
|
-
const autoplayTimerRef =
|
|
9963
|
-
const resumeTimeoutRef =
|
|
9964
|
-
const [paused, setPaused] =
|
|
9965
|
-
const initializedRef =
|
|
9966
|
-
|
|
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(() => {
|
|
9967
9963
|
const el = containerRef.current;
|
|
9968
9964
|
if (!el) return;
|
|
9969
9965
|
const ro = new ResizeObserver((entries) => {
|
|
@@ -9986,7 +9982,7 @@ var Swiper = (props) => {
|
|
|
9986
9982
|
return ((inner - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
9987
9983
|
};
|
|
9988
9984
|
const realIndex = getRealIndex(innerIndex);
|
|
9989
|
-
const moveToInner =
|
|
9985
|
+
const moveToInner = import_react32.default.useCallback(
|
|
9990
9986
|
(idx, withAnim = true) => {
|
|
9991
9987
|
if (!useLoop) {
|
|
9992
9988
|
setAnimated(withAnim);
|
|
@@ -10014,7 +10010,7 @@ var Swiper = (props) => {
|
|
|
10014
10010
|
},
|
|
10015
10011
|
[useLoop, cloneCount, totalSlides]
|
|
10016
10012
|
);
|
|
10017
|
-
const handleTransitionEnd =
|
|
10013
|
+
const handleTransitionEnd = import_react32.default.useCallback(() => {
|
|
10018
10014
|
if (!useLoop) return;
|
|
10019
10015
|
const real = getRealIndex(innerIndex);
|
|
10020
10016
|
const canonical = cloneCount + real;
|
|
@@ -10024,7 +10020,7 @@ var Swiper = (props) => {
|
|
|
10024
10020
|
}
|
|
10025
10021
|
onChange?.(Math.min(real, maxIndex));
|
|
10026
10022
|
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange]);
|
|
10027
|
-
const slideTo =
|
|
10023
|
+
const slideTo = import_react32.default.useCallback(
|
|
10028
10024
|
(logicalIndex) => {
|
|
10029
10025
|
if (!canSlide) return;
|
|
10030
10026
|
const clamped = useLoop ? logicalIndex : Math.max(0, Math.min(logicalIndex, maxIndex));
|
|
@@ -10034,7 +10030,7 @@ var Swiper = (props) => {
|
|
|
10034
10030
|
},
|
|
10035
10031
|
[canSlide, useLoop, cloneCount, maxIndex, onChange, moveToInner]
|
|
10036
10032
|
);
|
|
10037
|
-
const slideNext =
|
|
10033
|
+
const slideNext = import_react32.default.useCallback(() => {
|
|
10038
10034
|
if (!canSlide) return;
|
|
10039
10035
|
const nextInner = innerIndex + slideBy;
|
|
10040
10036
|
if (useLoop) {
|
|
@@ -10043,7 +10039,7 @@ var Swiper = (props) => {
|
|
|
10043
10039
|
moveToInner(Math.min(nextInner, maxIndex), true);
|
|
10044
10040
|
}
|
|
10045
10041
|
}, [canSlide, useLoop, innerIndex, slideBy, maxIndex, moveToInner]);
|
|
10046
|
-
const slidePrev =
|
|
10042
|
+
const slidePrev = import_react32.default.useCallback(() => {
|
|
10047
10043
|
if (!canSlide) return;
|
|
10048
10044
|
const prevInner = innerIndex - slideBy;
|
|
10049
10045
|
if (useLoop) {
|
|
@@ -10052,7 +10048,7 @@ var Swiper = (props) => {
|
|
|
10052
10048
|
moveToInner(Math.max(prevInner, 0), true);
|
|
10053
10049
|
}
|
|
10054
10050
|
}, [canSlide, useLoop, innerIndex, slideBy, moveToInner]);
|
|
10055
|
-
|
|
10051
|
+
import_react32.default.useEffect(() => {
|
|
10056
10052
|
if (indexProp === void 0) return;
|
|
10057
10053
|
const clamped = Math.max(0, Math.min(indexProp, maxIndex));
|
|
10058
10054
|
const target = useLoop ? cloneCount + clamped : clamped;
|
|
@@ -10060,12 +10056,12 @@ var Swiper = (props) => {
|
|
|
10060
10056
|
moveToInner(target, true);
|
|
10061
10057
|
}
|
|
10062
10058
|
}, [indexProp]);
|
|
10063
|
-
|
|
10059
|
+
import_react32.default.useImperativeHandle(swiperRef, () => ({
|
|
10064
10060
|
slidePrev,
|
|
10065
10061
|
slideNext,
|
|
10066
10062
|
slideTo
|
|
10067
10063
|
}));
|
|
10068
|
-
|
|
10064
|
+
import_react32.default.useEffect(() => {
|
|
10069
10065
|
if (!auto || !canSlide || paused) return;
|
|
10070
10066
|
autoplayTimerRef.current = setInterval(slideNext, autoplayDelay);
|
|
10071
10067
|
return () => {
|
|
@@ -10091,7 +10087,7 @@ var Swiper = (props) => {
|
|
|
10091
10087
|
resumeTimeoutRef.current = null;
|
|
10092
10088
|
}, pauseOnInteraction);
|
|
10093
10089
|
};
|
|
10094
|
-
|
|
10090
|
+
import_react32.default.useEffect(() => {
|
|
10095
10091
|
return () => {
|
|
10096
10092
|
if (resumeTimeoutRef.current) clearTimeout(resumeTimeoutRef.current);
|
|
10097
10093
|
};
|
|
@@ -10109,7 +10105,7 @@ var Swiper = (props) => {
|
|
|
10109
10105
|
startXRef.current = getClientX(e);
|
|
10110
10106
|
startTimeRef.current = Date.now();
|
|
10111
10107
|
};
|
|
10112
|
-
|
|
10108
|
+
import_react32.default.useEffect(() => {
|
|
10113
10109
|
if (!isDragging) return;
|
|
10114
10110
|
const handleMove = (e) => {
|
|
10115
10111
|
setDragOffset(getClientX(e) - startXRef.current);
|
|
@@ -10148,8 +10144,8 @@ var Swiper = (props) => {
|
|
|
10148
10144
|
}, [isDragging, dragOffset, innerIndex, useLoop, maxIndex, slideStep, moveToInner]);
|
|
10149
10145
|
const slideWidthPercent = 100 / viewItemCount;
|
|
10150
10146
|
const gapAdjust = spaceBetween * (viewItemCount - 1) / viewItemCount;
|
|
10151
|
-
const slideElements =
|
|
10152
|
-
() => extendedItems.map((item, idx) => /* @__PURE__ */ (0,
|
|
10147
|
+
const slideElements = import_react32.default.useMemo(
|
|
10148
|
+
() => extendedItems.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime341.jsx)(
|
|
10153
10149
|
"div",
|
|
10154
10150
|
{
|
|
10155
10151
|
className: "lib-xplat-swiper__slide",
|
|
@@ -10168,15 +10164,15 @@ var Swiper = (props) => {
|
|
|
10168
10164
|
Math.floor(realIndex / slideBy),
|
|
10169
10165
|
totalSteps - 1
|
|
10170
10166
|
);
|
|
10171
|
-
return /* @__PURE__ */ (0,
|
|
10172
|
-
/* @__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)(
|
|
10173
10169
|
"div",
|
|
10174
10170
|
{
|
|
10175
10171
|
className: "lib-xplat-swiper__viewport",
|
|
10176
10172
|
onMouseDown: handleDragStart,
|
|
10177
10173
|
onTouchStart: handleDragStart,
|
|
10178
10174
|
onDragStart: (e) => e.preventDefault(),
|
|
10179
|
-
children: /* @__PURE__ */ (0,
|
|
10175
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime341.jsx)(
|
|
10180
10176
|
"div",
|
|
10181
10177
|
{
|
|
10182
10178
|
className: clsx_default(
|
|
@@ -10194,7 +10190,7 @@ var Swiper = (props) => {
|
|
|
10194
10190
|
)
|
|
10195
10191
|
}
|
|
10196
10192
|
),
|
|
10197
|
-
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)(
|
|
10198
10194
|
"span",
|
|
10199
10195
|
{
|
|
10200
10196
|
className: "lib-xplat-swiper__progress-fill",
|
|
@@ -10204,7 +10200,7 @@ var Swiper = (props) => {
|
|
|
10204
10200
|
}
|
|
10205
10201
|
}
|
|
10206
10202
|
) }) }),
|
|
10207
|
-
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)(
|
|
10208
10204
|
"button",
|
|
10209
10205
|
{
|
|
10210
10206
|
className: clsx_default(
|
|
@@ -10222,8 +10218,8 @@ Swiper.displayName = "Swiper";
|
|
|
10222
10218
|
var Swiper_default = Swiper;
|
|
10223
10219
|
|
|
10224
10220
|
// src/components/Switch/Switch.tsx
|
|
10225
|
-
var
|
|
10226
|
-
var
|
|
10221
|
+
var import_react33 = __toESM(require("react"), 1);
|
|
10222
|
+
var import_jsx_runtime342 = require("react/jsx-runtime");
|
|
10227
10223
|
var KNOB_TRANSITION_MS = 250;
|
|
10228
10224
|
var Switch = (props) => {
|
|
10229
10225
|
const {
|
|
@@ -10233,9 +10229,9 @@ var Switch = (props) => {
|
|
|
10233
10229
|
disabled,
|
|
10234
10230
|
onChange
|
|
10235
10231
|
} = props;
|
|
10236
|
-
const [isAnimating, setIsAnimating] =
|
|
10237
|
-
const timeoutRef =
|
|
10238
|
-
|
|
10232
|
+
const [isAnimating, setIsAnimating] = import_react33.default.useState(false);
|
|
10233
|
+
const timeoutRef = import_react33.default.useRef(null);
|
|
10234
|
+
import_react33.default.useEffect(() => {
|
|
10239
10235
|
return () => {
|
|
10240
10236
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
10241
10237
|
};
|
|
@@ -10250,7 +10246,7 @@ var Switch = (props) => {
|
|
|
10250
10246
|
timeoutRef.current = null;
|
|
10251
10247
|
}, KNOB_TRANSITION_MS);
|
|
10252
10248
|
};
|
|
10253
|
-
return /* @__PURE__ */ (0,
|
|
10249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime342.jsx)(
|
|
10254
10250
|
"div",
|
|
10255
10251
|
{
|
|
10256
10252
|
className: clsx_default(
|
|
@@ -10263,7 +10259,7 @@ var Switch = (props) => {
|
|
|
10263
10259
|
),
|
|
10264
10260
|
onClick: handleClick,
|
|
10265
10261
|
"aria-disabled": disabled || isAnimating,
|
|
10266
|
-
children: /* @__PURE__ */ (0,
|
|
10262
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime342.jsx)("div", { className: clsx_default("knob", value ? "checked" : void 0) })
|
|
10267
10263
|
}
|
|
10268
10264
|
);
|
|
10269
10265
|
};
|
|
@@ -10271,17 +10267,17 @@ Switch.displayName = "Switch";
|
|
|
10271
10267
|
var Switch_default = Switch;
|
|
10272
10268
|
|
|
10273
10269
|
// src/components/Table/TableContext.tsx
|
|
10274
|
-
var
|
|
10275
|
-
var TableContext =
|
|
10270
|
+
var import_react34 = __toESM(require("react"), 1);
|
|
10271
|
+
var TableContext = import_react34.default.createContext(null);
|
|
10276
10272
|
var useTableContext = () => {
|
|
10277
|
-
const ctx =
|
|
10273
|
+
const ctx = import_react34.default.useContext(TableContext);
|
|
10278
10274
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
10279
10275
|
return ctx;
|
|
10280
10276
|
};
|
|
10281
10277
|
var TableContext_default = TableContext;
|
|
10282
10278
|
|
|
10283
10279
|
// src/components/Table/Table.tsx
|
|
10284
|
-
var
|
|
10280
|
+
var import_jsx_runtime343 = require("react/jsx-runtime");
|
|
10285
10281
|
var Table = (props) => {
|
|
10286
10282
|
const {
|
|
10287
10283
|
children,
|
|
@@ -10291,7 +10287,7 @@ var Table = (props) => {
|
|
|
10291
10287
|
headerSticky = false,
|
|
10292
10288
|
stickyShadow = true
|
|
10293
10289
|
} = props;
|
|
10294
|
-
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)(
|
|
10295
10291
|
TableContext_default.Provider,
|
|
10296
10292
|
{
|
|
10297
10293
|
value: {
|
|
@@ -10300,7 +10296,7 @@ var Table = (props) => {
|
|
|
10300
10296
|
headerSticky,
|
|
10301
10297
|
stickyShadow
|
|
10302
10298
|
},
|
|
10303
|
-
children: /* @__PURE__ */ (0,
|
|
10299
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime343.jsx)("table", { className: "lib-xplat-table", children })
|
|
10304
10300
|
}
|
|
10305
10301
|
) });
|
|
10306
10302
|
};
|
|
@@ -10308,41 +10304,41 @@ Table.displayName = "Table";
|
|
|
10308
10304
|
var Table_default = Table;
|
|
10309
10305
|
|
|
10310
10306
|
// src/components/Table/TableBody.tsx
|
|
10311
|
-
var
|
|
10307
|
+
var import_jsx_runtime344 = require("react/jsx-runtime");
|
|
10312
10308
|
var TableBody = (props) => {
|
|
10313
10309
|
const { children } = props;
|
|
10314
|
-
return /* @__PURE__ */ (0,
|
|
10310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime344.jsx)("tbody", { children });
|
|
10315
10311
|
};
|
|
10316
10312
|
TableBody.displayName = "TableBody";
|
|
10317
10313
|
var TableBody_default = TableBody;
|
|
10318
10314
|
|
|
10319
10315
|
// src/components/Table/TableCell.tsx
|
|
10320
|
-
var
|
|
10316
|
+
var import_react37 = __toESM(require("react"), 1);
|
|
10321
10317
|
|
|
10322
10318
|
// src/components/Table/TableHeadContext.tsx
|
|
10323
|
-
var
|
|
10324
|
-
var TableHeadContext =
|
|
10319
|
+
var import_react35 = __toESM(require("react"), 1);
|
|
10320
|
+
var TableHeadContext = import_react35.default.createContext(
|
|
10325
10321
|
null
|
|
10326
10322
|
);
|
|
10327
10323
|
var useTableHeadContext = () => {
|
|
10328
|
-
const ctx =
|
|
10324
|
+
const ctx = import_react35.default.useContext(TableHeadContext);
|
|
10329
10325
|
return ctx;
|
|
10330
10326
|
};
|
|
10331
10327
|
var TableHeadContext_default = TableHeadContext;
|
|
10332
10328
|
|
|
10333
10329
|
// src/components/Table/TableRowContext.tsx
|
|
10334
|
-
var
|
|
10335
|
-
var TableRowContext =
|
|
10330
|
+
var import_react36 = __toESM(require("react"), 1);
|
|
10331
|
+
var TableRowContext = import_react36.default.createContext(null);
|
|
10336
10332
|
var useTableRowContext = () => {
|
|
10337
|
-
const ctx =
|
|
10333
|
+
const ctx = import_react36.default.useContext(TableRowContext);
|
|
10338
10334
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
10339
10335
|
return ctx;
|
|
10340
10336
|
};
|
|
10341
10337
|
var TableRowContext_default = TableRowContext;
|
|
10342
10338
|
|
|
10343
10339
|
// src/components/Table/TableCell.tsx
|
|
10344
|
-
var
|
|
10345
|
-
var TableCell =
|
|
10340
|
+
var import_jsx_runtime345 = require("react/jsx-runtime");
|
|
10341
|
+
var TableCell = import_react37.default.memo((props) => {
|
|
10346
10342
|
const {
|
|
10347
10343
|
children,
|
|
10348
10344
|
align = "center",
|
|
@@ -10356,9 +10352,9 @@ var TableCell = import_react38.default.memo((props) => {
|
|
|
10356
10352
|
const { registerStickyCell, stickyCells } = useTableRowContext();
|
|
10357
10353
|
const { stickyShadow } = useTableContext();
|
|
10358
10354
|
const headContext = useTableHeadContext();
|
|
10359
|
-
const [left, setLeft] =
|
|
10360
|
-
const cellRef =
|
|
10361
|
-
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(() => {
|
|
10362
10358
|
if (!cellRef.current) return 0;
|
|
10363
10359
|
let totalLeft = 0;
|
|
10364
10360
|
for (const ref of stickyCells) {
|
|
@@ -10367,7 +10363,7 @@ var TableCell = import_react38.default.memo((props) => {
|
|
|
10367
10363
|
}
|
|
10368
10364
|
return totalLeft;
|
|
10369
10365
|
}, [stickyCells]);
|
|
10370
|
-
|
|
10366
|
+
import_react37.default.useEffect(() => {
|
|
10371
10367
|
if (!isSticky || !cellRef.current) return;
|
|
10372
10368
|
registerStickyCell(cellRef);
|
|
10373
10369
|
setLeft(calculateLeft());
|
|
@@ -10386,7 +10382,7 @@ var TableCell = import_react38.default.memo((props) => {
|
|
|
10386
10382
|
const CellTag = isHeaderCell ? "th" : "td";
|
|
10387
10383
|
const isLastSticky = isSticky && stickyCells[stickyCells.length - 1] === cellRef;
|
|
10388
10384
|
const enableHover = headContext && headContext.cellHover;
|
|
10389
|
-
return /* @__PURE__ */ (0,
|
|
10385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime345.jsx)(
|
|
10390
10386
|
CellTag,
|
|
10391
10387
|
{
|
|
10392
10388
|
ref: cellRef,
|
|
@@ -10413,21 +10409,21 @@ TableCell.displayName = "TableCell";
|
|
|
10413
10409
|
var TableCell_default = TableCell;
|
|
10414
10410
|
|
|
10415
10411
|
// src/components/Table/TableHead.tsx
|
|
10416
|
-
var
|
|
10412
|
+
var import_jsx_runtime346 = require("react/jsx-runtime");
|
|
10417
10413
|
var TableHead = ({
|
|
10418
10414
|
children,
|
|
10419
10415
|
cellHover = false
|
|
10420
10416
|
}) => {
|
|
10421
10417
|
const { headerSticky } = useTableContext();
|
|
10422
|
-
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 }) });
|
|
10423
10419
|
};
|
|
10424
10420
|
TableHead.displayName = "TableHead";
|
|
10425
10421
|
var TableHead_default = TableHead;
|
|
10426
10422
|
|
|
10427
10423
|
// src/components/Table/TableRow.tsx
|
|
10428
|
-
var
|
|
10429
|
-
var
|
|
10430
|
-
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) => {
|
|
10431
10427
|
const {
|
|
10432
10428
|
children,
|
|
10433
10429
|
type = "secondary",
|
|
@@ -10436,14 +10432,14 @@ var TableRow = import_react39.default.memo((props) => {
|
|
|
10436
10432
|
onClick
|
|
10437
10433
|
} = props;
|
|
10438
10434
|
const { rowBorderUse } = useTableContext();
|
|
10439
|
-
const [stickyCells, setStickyCells] =
|
|
10435
|
+
const [stickyCells, setStickyCells] = import_react38.default.useState([]);
|
|
10440
10436
|
const registerStickyCell = (ref) => {
|
|
10441
10437
|
setStickyCells((prev) => {
|
|
10442
10438
|
if (prev.includes(ref)) return prev;
|
|
10443
10439
|
return [...prev, ref];
|
|
10444
10440
|
});
|
|
10445
10441
|
};
|
|
10446
|
-
return /* @__PURE__ */ (0,
|
|
10442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime347.jsx)(TableRowContext_default.Provider, { value: { stickyCells, registerStickyCell }, children: /* @__PURE__ */ (0, import_jsx_runtime347.jsx)(
|
|
10447
10443
|
"tr",
|
|
10448
10444
|
{
|
|
10449
10445
|
className: clsx_default(
|
|
@@ -10467,7 +10463,7 @@ TableRow.displayName = "TableRow";
|
|
|
10467
10463
|
var TableRow_default = TableRow;
|
|
10468
10464
|
|
|
10469
10465
|
// src/components/Tag/Tag.tsx
|
|
10470
|
-
var
|
|
10466
|
+
var import_jsx_runtime348 = require("react/jsx-runtime");
|
|
10471
10467
|
var Tag = (props) => {
|
|
10472
10468
|
const {
|
|
10473
10469
|
children,
|
|
@@ -10477,7 +10473,7 @@ var Tag = (props) => {
|
|
|
10477
10473
|
disabled = false,
|
|
10478
10474
|
colorIndex
|
|
10479
10475
|
} = props;
|
|
10480
|
-
return /* @__PURE__ */ (0,
|
|
10476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime348.jsxs)(
|
|
10481
10477
|
"span",
|
|
10482
10478
|
{
|
|
10483
10479
|
className: clsx_default(
|
|
@@ -10488,8 +10484,8 @@ var Tag = (props) => {
|
|
|
10488
10484
|
disabled && "disabled"
|
|
10489
10485
|
),
|
|
10490
10486
|
children: [
|
|
10491
|
-
/* @__PURE__ */ (0,
|
|
10492
|
-
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, {}) })
|
|
10493
10489
|
]
|
|
10494
10490
|
}
|
|
10495
10491
|
);
|
|
@@ -10498,9 +10494,9 @@ Tag.displayName = "Tag";
|
|
|
10498
10494
|
var Tag_default = Tag;
|
|
10499
10495
|
|
|
10500
10496
|
// src/components/TextArea/TextArea.tsx
|
|
10501
|
-
var
|
|
10502
|
-
var
|
|
10503
|
-
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(
|
|
10504
10500
|
(props, ref) => {
|
|
10505
10501
|
const {
|
|
10506
10502
|
className,
|
|
@@ -10510,7 +10506,7 @@ var TextArea = import_react40.default.forwardRef(
|
|
|
10510
10506
|
disabled,
|
|
10511
10507
|
...textareaProps
|
|
10512
10508
|
} = props;
|
|
10513
|
-
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)(
|
|
10514
10510
|
"textarea",
|
|
10515
10511
|
{
|
|
10516
10512
|
...textareaProps,
|
|
@@ -10527,25 +10523,25 @@ TextArea.displayName = "TextArea";
|
|
|
10527
10523
|
var TextArea_default = TextArea;
|
|
10528
10524
|
|
|
10529
10525
|
// src/components/Toast/Toast.tsx
|
|
10530
|
-
var
|
|
10526
|
+
var import_react40 = __toESM(require("react"), 1);
|
|
10531
10527
|
var import_react_dom4 = require("react-dom");
|
|
10532
|
-
var
|
|
10533
|
-
var ToastContext =
|
|
10528
|
+
var import_jsx_runtime350 = require("react/jsx-runtime");
|
|
10529
|
+
var ToastContext = import_react40.default.createContext(null);
|
|
10534
10530
|
var useToast = () => {
|
|
10535
|
-
const ctx =
|
|
10531
|
+
const ctx = import_react40.default.useContext(ToastContext);
|
|
10536
10532
|
if (!ctx) throw new Error("useToast must be used within ToastProvider");
|
|
10537
10533
|
return ctx;
|
|
10538
10534
|
};
|
|
10539
10535
|
var EXIT_DURATION = 300;
|
|
10540
10536
|
var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
10541
|
-
const ref =
|
|
10542
|
-
const [height, setHeight] =
|
|
10543
|
-
|
|
10537
|
+
const ref = import_react40.default.useRef(null);
|
|
10538
|
+
const [height, setHeight] = import_react40.default.useState(void 0);
|
|
10539
|
+
import_react40.default.useEffect(() => {
|
|
10544
10540
|
if (ref.current && !isExiting) {
|
|
10545
10541
|
setHeight(ref.current.offsetHeight);
|
|
10546
10542
|
}
|
|
10547
10543
|
}, [isExiting]);
|
|
10548
|
-
return /* @__PURE__ */ (0,
|
|
10544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime350.jsx)(
|
|
10549
10545
|
"div",
|
|
10550
10546
|
{
|
|
10551
10547
|
className: clsx_default("lib-xplat-toast-wrapper", { exit: isExiting }),
|
|
@@ -10553,15 +10549,15 @@ var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
|
10553
10549
|
maxHeight: isExiting ? 0 : height ?? "none",
|
|
10554
10550
|
marginBottom: isExiting ? 0 : void 0
|
|
10555
10551
|
},
|
|
10556
|
-
children: /* @__PURE__ */ (0,
|
|
10552
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime350.jsxs)(
|
|
10557
10553
|
"div",
|
|
10558
10554
|
{
|
|
10559
10555
|
ref,
|
|
10560
10556
|
className: clsx_default("lib-xplat-toast", item.type, { exit: isExiting }),
|
|
10561
10557
|
role: "alert",
|
|
10562
10558
|
children: [
|
|
10563
|
-
/* @__PURE__ */ (0,
|
|
10564
|
-
/* @__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" })
|
|
10565
10561
|
]
|
|
10566
10562
|
}
|
|
10567
10563
|
)
|
|
@@ -10572,13 +10568,13 @@ var ToastProvider = ({
|
|
|
10572
10568
|
children,
|
|
10573
10569
|
position = "top-right"
|
|
10574
10570
|
}) => {
|
|
10575
|
-
const [toasts, setToasts] =
|
|
10576
|
-
const [removing, setRemoving] =
|
|
10577
|
-
const [mounted, setMounted] =
|
|
10578
|
-
|
|
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(() => {
|
|
10579
10575
|
setMounted(true);
|
|
10580
10576
|
}, []);
|
|
10581
|
-
const remove =
|
|
10577
|
+
const remove = import_react40.default.useCallback((id) => {
|
|
10582
10578
|
setRemoving((prev) => new Set(prev).add(id));
|
|
10583
10579
|
setTimeout(() => {
|
|
10584
10580
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
@@ -10589,7 +10585,7 @@ var ToastProvider = ({
|
|
|
10589
10585
|
});
|
|
10590
10586
|
}, EXIT_DURATION);
|
|
10591
10587
|
}, []);
|
|
10592
|
-
const toast =
|
|
10588
|
+
const toast = import_react40.default.useCallback(
|
|
10593
10589
|
(type, message, duration = 3e3) => {
|
|
10594
10590
|
const id = `${Date.now()}-${Math.random()}`;
|
|
10595
10591
|
setToasts((prev) => [...prev, { id, type, message }]);
|
|
@@ -10599,10 +10595,10 @@ var ToastProvider = ({
|
|
|
10599
10595
|
},
|
|
10600
10596
|
[remove]
|
|
10601
10597
|
);
|
|
10602
|
-
return /* @__PURE__ */ (0,
|
|
10598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime350.jsxs)(ToastContext.Provider, { value: { toast }, children: [
|
|
10603
10599
|
children,
|
|
10604
10600
|
mounted && (0, import_react_dom4.createPortal)(
|
|
10605
|
-
/* @__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)(
|
|
10606
10602
|
ToastItemComponent,
|
|
10607
10603
|
{
|
|
10608
10604
|
item: t,
|
|
@@ -10618,8 +10614,8 @@ var ToastProvider = ({
|
|
|
10618
10614
|
ToastProvider.displayName = "ToastProvider";
|
|
10619
10615
|
|
|
10620
10616
|
// src/components/Tooltip/Tooltip.tsx
|
|
10621
|
-
var
|
|
10622
|
-
var
|
|
10617
|
+
var import_react41 = __toESM(require("react"), 1);
|
|
10618
|
+
var import_jsx_runtime351 = require("react/jsx-runtime");
|
|
10623
10619
|
var OFFSET = 12;
|
|
10624
10620
|
var GAP = 8;
|
|
10625
10621
|
var SHOW_DELAY = 300;
|
|
@@ -10632,14 +10628,14 @@ var Tooltip = (props) => {
|
|
|
10632
10628
|
follow = false,
|
|
10633
10629
|
disabled = false
|
|
10634
10630
|
} = props;
|
|
10635
|
-
const triggerRef =
|
|
10636
|
-
const tooltipRef =
|
|
10637
|
-
const [visible, setVisible] =
|
|
10638
|
-
const [pos, setPos] =
|
|
10639
|
-
const delayTimer =
|
|
10640
|
-
const rafRef =
|
|
10641
|
-
const cursor =
|
|
10642
|
-
const clamp =
|
|
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) => {
|
|
10643
10639
|
const vw = window.innerWidth;
|
|
10644
10640
|
const vh = window.innerHeight;
|
|
10645
10641
|
return {
|
|
@@ -10647,7 +10643,7 @@ var Tooltip = (props) => {
|
|
|
10647
10643
|
top: Math.min(Math.max(GAP, top), Math.max(GAP, vh - h - GAP))
|
|
10648
10644
|
};
|
|
10649
10645
|
}, []);
|
|
10650
|
-
const placeAtCursor =
|
|
10646
|
+
const placeAtCursor = import_react41.default.useCallback((x, y) => {
|
|
10651
10647
|
const el = tooltipRef.current;
|
|
10652
10648
|
if (!el) return;
|
|
10653
10649
|
const w = el.offsetWidth;
|
|
@@ -10658,7 +10654,7 @@ var Tooltip = (props) => {
|
|
|
10658
10654
|
if (top < GAP) top = y + OFFSET;
|
|
10659
10655
|
setPos(clamp(left, top, w, h));
|
|
10660
10656
|
}, [clamp]);
|
|
10661
|
-
const placeAtTrigger =
|
|
10657
|
+
const placeAtTrigger = import_react41.default.useCallback(() => {
|
|
10662
10658
|
const el = tooltipRef.current;
|
|
10663
10659
|
const trigger = triggerRef.current;
|
|
10664
10660
|
if (!el || !trigger) return;
|
|
@@ -10670,19 +10666,19 @@ var Tooltip = (props) => {
|
|
|
10670
10666
|
const left = rect.left + rect.width / 2 - w / 2;
|
|
10671
10667
|
setPos(clamp(left, top, w, h));
|
|
10672
10668
|
}, [clamp]);
|
|
10673
|
-
const reposition =
|
|
10669
|
+
const reposition = import_react41.default.useCallback(() => {
|
|
10674
10670
|
if (follow && cursor.current) {
|
|
10675
10671
|
placeAtCursor(cursor.current.x, cursor.current.y);
|
|
10676
10672
|
} else {
|
|
10677
10673
|
placeAtTrigger();
|
|
10678
10674
|
}
|
|
10679
10675
|
}, [follow, placeAtCursor, placeAtTrigger]);
|
|
10680
|
-
const handleMouseEnter =
|
|
10676
|
+
const handleMouseEnter = import_react41.default.useCallback((e) => {
|
|
10681
10677
|
if (disabled) return;
|
|
10682
10678
|
cursor.current = { x: e.clientX, y: e.clientY };
|
|
10683
10679
|
delayTimer.current = window.setTimeout(() => setVisible(true), SHOW_DELAY);
|
|
10684
10680
|
}, [disabled]);
|
|
10685
|
-
const handleMouseMove =
|
|
10681
|
+
const handleMouseMove = import_react41.default.useCallback((e) => {
|
|
10686
10682
|
cursor.current = { x: e.clientX, y: e.clientY };
|
|
10687
10683
|
if (!visible || !follow) return;
|
|
10688
10684
|
cancelAnimationFrame(rafRef.current);
|
|
@@ -10690,25 +10686,25 @@ var Tooltip = (props) => {
|
|
|
10690
10686
|
if (cursor.current) placeAtCursor(cursor.current.x, cursor.current.y);
|
|
10691
10687
|
});
|
|
10692
10688
|
}, [visible, follow, placeAtCursor]);
|
|
10693
|
-
const close =
|
|
10689
|
+
const close = import_react41.default.useCallback(() => {
|
|
10694
10690
|
window.clearTimeout(delayTimer.current);
|
|
10695
10691
|
cancelAnimationFrame(rafRef.current);
|
|
10696
10692
|
setVisible(false);
|
|
10697
10693
|
}, []);
|
|
10698
|
-
const handleMouseLeave =
|
|
10694
|
+
const handleMouseLeave = import_react41.default.useCallback(() => {
|
|
10699
10695
|
cursor.current = null;
|
|
10700
10696
|
close();
|
|
10701
10697
|
}, [close]);
|
|
10702
|
-
const handleFocus =
|
|
10698
|
+
const handleFocus = import_react41.default.useCallback(() => {
|
|
10703
10699
|
if (disabled) return;
|
|
10704
10700
|
cursor.current = null;
|
|
10705
10701
|
setVisible(true);
|
|
10706
10702
|
}, [disabled]);
|
|
10707
|
-
|
|
10703
|
+
import_react41.default.useLayoutEffect(() => {
|
|
10708
10704
|
if (!visible) return;
|
|
10709
10705
|
reposition();
|
|
10710
10706
|
}, [visible, reposition]);
|
|
10711
|
-
|
|
10707
|
+
import_react41.default.useEffect(() => {
|
|
10712
10708
|
if (!visible || follow) return;
|
|
10713
10709
|
const onChange = () => placeAtTrigger();
|
|
10714
10710
|
window.addEventListener("scroll", onChange, true);
|
|
@@ -10718,12 +10714,12 @@ var Tooltip = (props) => {
|
|
|
10718
10714
|
window.removeEventListener("resize", onChange);
|
|
10719
10715
|
};
|
|
10720
10716
|
}, [visible, follow, placeAtTrigger]);
|
|
10721
|
-
|
|
10717
|
+
import_react41.default.useEffect(() => () => {
|
|
10722
10718
|
window.clearTimeout(delayTimer.current);
|
|
10723
10719
|
cancelAnimationFrame(rafRef.current);
|
|
10724
10720
|
}, []);
|
|
10725
|
-
if (!title && !description) return /* @__PURE__ */ (0,
|
|
10726
|
-
return /* @__PURE__ */ (0,
|
|
10721
|
+
if (!title && !description) return /* @__PURE__ */ (0, import_jsx_runtime351.jsx)(import_jsx_runtime351.Fragment, { children });
|
|
10722
|
+
return /* @__PURE__ */ (0, import_jsx_runtime351.jsxs)(
|
|
10727
10723
|
"div",
|
|
10728
10724
|
{
|
|
10729
10725
|
ref: triggerRef,
|
|
@@ -10736,7 +10732,7 @@ var Tooltip = (props) => {
|
|
|
10736
10732
|
onBlur: close,
|
|
10737
10733
|
children: [
|
|
10738
10734
|
children,
|
|
10739
|
-
visible && /* @__PURE__ */ (0,
|
|
10735
|
+
visible && /* @__PURE__ */ (0, import_jsx_runtime351.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime351.jsxs)(
|
|
10740
10736
|
"div",
|
|
10741
10737
|
{
|
|
10742
10738
|
ref: tooltipRef,
|
|
@@ -10744,8 +10740,8 @@ var Tooltip = (props) => {
|
|
|
10744
10740
|
className: clsx_default("lib-xplat-tooltip", type),
|
|
10745
10741
|
style: { position: "fixed", left: pos.left, top: pos.top },
|
|
10746
10742
|
children: [
|
|
10747
|
-
title && /* @__PURE__ */ (0,
|
|
10748
|
-
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 })
|
|
10749
10745
|
]
|
|
10750
10746
|
}
|
|
10751
10747
|
) })
|
|
@@ -10757,11 +10753,11 @@ Tooltip.displayName = "Tooltip";
|
|
|
10757
10753
|
var Tooltip_default = Tooltip;
|
|
10758
10754
|
|
|
10759
10755
|
// src/components/Video/Video.tsx
|
|
10760
|
-
var
|
|
10761
|
-
var
|
|
10762
|
-
var PipIcon = () => /* @__PURE__ */ (0,
|
|
10763
|
-
/* @__PURE__ */ (0,
|
|
10764
|
-
/* @__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" })
|
|
10765
10761
|
] });
|
|
10766
10762
|
var formatTime = (sec) => {
|
|
10767
10763
|
if (!Number.isFinite(sec) || sec < 0) return "0:00";
|
|
@@ -10769,7 +10765,7 @@ var formatTime = (sec) => {
|
|
|
10769
10765
|
const s = Math.floor(sec % 60);
|
|
10770
10766
|
return `${m}:${s.toString().padStart(2, "0")}`;
|
|
10771
10767
|
};
|
|
10772
|
-
var Video =
|
|
10768
|
+
var Video = import_react42.default.forwardRef((props, ref) => {
|
|
10773
10769
|
const {
|
|
10774
10770
|
src,
|
|
10775
10771
|
poster,
|
|
@@ -10793,21 +10789,21 @@ var Video = import_react43.default.forwardRef((props, ref) => {
|
|
|
10793
10789
|
children,
|
|
10794
10790
|
...rest
|
|
10795
10791
|
} = props;
|
|
10796
|
-
const containerRef =
|
|
10797
|
-
const videoRef =
|
|
10798
|
-
const [isPlaying, setIsPlaying] =
|
|
10799
|
-
const [isLoaded, setIsLoaded] =
|
|
10800
|
-
const [currentTime, setCurrentTime] =
|
|
10801
|
-
const [duration, setDuration] =
|
|
10802
|
-
const [buffered, setBuffered] =
|
|
10803
|
-
const [volume, setVolume] =
|
|
10804
|
-
const [isMuted, setIsMuted] =
|
|
10805
|
-
const [isFullscreen, setIsFullscreen] =
|
|
10806
|
-
const [playbackRate, setPlaybackRate] =
|
|
10807
|
-
const [rateMenuOpen, setRateMenuOpen] =
|
|
10808
|
-
const [captionsOn, setCaptionsOn] =
|
|
10809
|
-
const [isPip, setIsPip] =
|
|
10810
|
-
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(
|
|
10811
10807
|
(el) => {
|
|
10812
10808
|
videoRef.current = el;
|
|
10813
10809
|
if (typeof ref === "function") ref(el);
|
|
@@ -10815,14 +10811,14 @@ var Video = import_react43.default.forwardRef((props, ref) => {
|
|
|
10815
10811
|
},
|
|
10816
10812
|
[ref]
|
|
10817
10813
|
);
|
|
10818
|
-
|
|
10814
|
+
import_react42.default.useEffect(() => {
|
|
10819
10815
|
const onFsChange = () => {
|
|
10820
10816
|
setIsFullscreen(document.fullscreenElement === containerRef.current);
|
|
10821
10817
|
};
|
|
10822
10818
|
document.addEventListener("fullscreenchange", onFsChange);
|
|
10823
10819
|
return () => document.removeEventListener("fullscreenchange", onFsChange);
|
|
10824
10820
|
}, []);
|
|
10825
|
-
|
|
10821
|
+
import_react42.default.useEffect(() => {
|
|
10826
10822
|
const v = videoRef.current;
|
|
10827
10823
|
if (!v) return;
|
|
10828
10824
|
const onEnter = () => setIsPip(true);
|
|
@@ -10936,13 +10932,13 @@ var Video = import_react43.default.forwardRef((props, ref) => {
|
|
|
10936
10932
|
const volumePct = (isMuted ? 0 : volume) * 100;
|
|
10937
10933
|
const VolumeGlyph = isMuted || volume === 0 ? VolumeXIcon_default : volume < 0.5 ? VolumeIcon_default : Volume2Icon_default;
|
|
10938
10934
|
const pipSupported = typeof document !== "undefined" && "pictureInPictureEnabled" in document && document.pictureInPictureEnabled;
|
|
10939
|
-
return /* @__PURE__ */ (0,
|
|
10935
|
+
return /* @__PURE__ */ (0, import_jsx_runtime352.jsxs)(
|
|
10940
10936
|
"div",
|
|
10941
10937
|
{
|
|
10942
10938
|
ref: containerRef,
|
|
10943
10939
|
className: clsx_default("lib-xplat-video", showControls && "has-controls"),
|
|
10944
10940
|
children: [
|
|
10945
|
-
/* @__PURE__ */ (0,
|
|
10941
|
+
/* @__PURE__ */ (0, import_jsx_runtime352.jsx)(
|
|
10946
10942
|
"video",
|
|
10947
10943
|
{
|
|
10948
10944
|
ref: setRefs,
|
|
@@ -10963,7 +10959,7 @@ var Video = import_react43.default.forwardRef((props, ref) => {
|
|
|
10963
10959
|
children
|
|
10964
10960
|
}
|
|
10965
10961
|
),
|
|
10966
|
-
showCenterPlay && /* @__PURE__ */ (0,
|
|
10962
|
+
showCenterPlay && /* @__PURE__ */ (0, import_jsx_runtime352.jsx)(
|
|
10967
10963
|
"button",
|
|
10968
10964
|
{
|
|
10969
10965
|
type: "button",
|
|
@@ -10975,11 +10971,11 @@ var Video = import_react43.default.forwardRef((props, ref) => {
|
|
|
10975
10971
|
onClick: togglePlay,
|
|
10976
10972
|
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
10977
10973
|
tabIndex: -1,
|
|
10978
|
-
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, {}) })
|
|
10979
10975
|
}
|
|
10980
10976
|
),
|
|
10981
|
-
showControls && /* @__PURE__ */ (0,
|
|
10982
|
-
/* @__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)(
|
|
10983
10979
|
"input",
|
|
10984
10980
|
{
|
|
10985
10981
|
type: "range",
|
|
@@ -10996,29 +10992,29 @@ var Video = import_react43.default.forwardRef((props, ref) => {
|
|
|
10996
10992
|
}
|
|
10997
10993
|
}
|
|
10998
10994
|
),
|
|
10999
|
-
/* @__PURE__ */ (0,
|
|
11000
|
-
/* @__PURE__ */ (0,
|
|
10995
|
+
/* @__PURE__ */ (0, import_jsx_runtime352.jsxs)("div", { className: "controls-row", children: [
|
|
10996
|
+
/* @__PURE__ */ (0, import_jsx_runtime352.jsx)(
|
|
11001
10997
|
"button",
|
|
11002
10998
|
{
|
|
11003
10999
|
type: "button",
|
|
11004
11000
|
className: "control-btn",
|
|
11005
11001
|
onClick: togglePlay,
|
|
11006
11002
|
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
11007
|
-
children: isPlaying ? /* @__PURE__ */ (0,
|
|
11003
|
+
children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime352.jsx)(PauseIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime352.jsx)(PlayIcon_default, {})
|
|
11008
11004
|
}
|
|
11009
11005
|
),
|
|
11010
|
-
/* @__PURE__ */ (0,
|
|
11011
|
-
/* @__PURE__ */ (0,
|
|
11006
|
+
/* @__PURE__ */ (0, import_jsx_runtime352.jsxs)("div", { className: "volume-group", children: [
|
|
11007
|
+
/* @__PURE__ */ (0, import_jsx_runtime352.jsx)(
|
|
11012
11008
|
"button",
|
|
11013
11009
|
{
|
|
11014
11010
|
type: "button",
|
|
11015
11011
|
className: "control-btn",
|
|
11016
11012
|
onClick: toggleMute,
|
|
11017
11013
|
"aria-label": isMuted ? "\uC74C\uC18C\uAC70 \uD574\uC81C" : "\uC74C\uC18C\uAC70",
|
|
11018
|
-
children: /* @__PURE__ */ (0,
|
|
11014
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime352.jsx)(VolumeGlyph, {})
|
|
11019
11015
|
}
|
|
11020
11016
|
),
|
|
11021
|
-
/* @__PURE__ */ (0,
|
|
11017
|
+
/* @__PURE__ */ (0, import_jsx_runtime352.jsx)(
|
|
11022
11018
|
"input",
|
|
11023
11019
|
{
|
|
11024
11020
|
type: "range",
|
|
@@ -11033,14 +11029,14 @@ var Video = import_react43.default.forwardRef((props, ref) => {
|
|
|
11033
11029
|
}
|
|
11034
11030
|
)
|
|
11035
11031
|
] }),
|
|
11036
|
-
/* @__PURE__ */ (0,
|
|
11032
|
+
/* @__PURE__ */ (0, import_jsx_runtime352.jsxs)("span", { className: "time", children: [
|
|
11037
11033
|
formatTime(currentTime),
|
|
11038
11034
|
" / ",
|
|
11039
11035
|
formatTime(duration)
|
|
11040
11036
|
] }),
|
|
11041
|
-
/* @__PURE__ */ (0,
|
|
11042
|
-
playbackRates && playbackRates.length > 0 && /* @__PURE__ */ (0,
|
|
11043
|
-
/* @__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)(
|
|
11044
11040
|
"button",
|
|
11045
11041
|
{
|
|
11046
11042
|
type: "button",
|
|
@@ -11054,7 +11050,7 @@ var Video = import_react43.default.forwardRef((props, ref) => {
|
|
|
11054
11050
|
]
|
|
11055
11051
|
}
|
|
11056
11052
|
),
|
|
11057
|
-
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)(
|
|
11058
11054
|
"button",
|
|
11059
11055
|
{
|
|
11060
11056
|
type: "button",
|
|
@@ -11068,7 +11064,7 @@ var Video = import_react43.default.forwardRef((props, ref) => {
|
|
|
11068
11064
|
}
|
|
11069
11065
|
) }, r2)) })
|
|
11070
11066
|
] }),
|
|
11071
|
-
showCaptions && /* @__PURE__ */ (0,
|
|
11067
|
+
showCaptions && /* @__PURE__ */ (0, import_jsx_runtime352.jsx)(
|
|
11072
11068
|
"button",
|
|
11073
11069
|
{
|
|
11074
11070
|
type: "button",
|
|
@@ -11076,37 +11072,37 @@ var Video = import_react43.default.forwardRef((props, ref) => {
|
|
|
11076
11072
|
onClick: toggleCaptions,
|
|
11077
11073
|
"aria-label": captionsOn ? "\uC790\uB9C9 \uB044\uAE30" : "\uC790\uB9C9 \uCF1C\uAE30",
|
|
11078
11074
|
"aria-pressed": captionsOn,
|
|
11079
|
-
children: /* @__PURE__ */ (0,
|
|
11075
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime352.jsx)(TypeIcon_default, {})
|
|
11080
11076
|
}
|
|
11081
11077
|
),
|
|
11082
|
-
showPip && pipSupported && /* @__PURE__ */ (0,
|
|
11078
|
+
showPip && pipSupported && /* @__PURE__ */ (0, import_jsx_runtime352.jsx)(
|
|
11083
11079
|
"button",
|
|
11084
11080
|
{
|
|
11085
11081
|
type: "button",
|
|
11086
11082
|
className: clsx_default("control-btn", isPip && "is-active"),
|
|
11087
11083
|
onClick: togglePip,
|
|
11088
11084
|
"aria-label": isPip ? "PIP \uC885\uB8CC" : "PIP",
|
|
11089
|
-
children: /* @__PURE__ */ (0,
|
|
11085
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime352.jsx)(PipIcon, {})
|
|
11090
11086
|
}
|
|
11091
11087
|
),
|
|
11092
|
-
showDownload && /* @__PURE__ */ (0,
|
|
11088
|
+
showDownload && /* @__PURE__ */ (0, import_jsx_runtime352.jsx)(
|
|
11093
11089
|
"a",
|
|
11094
11090
|
{
|
|
11095
11091
|
className: "control-btn",
|
|
11096
11092
|
href: src,
|
|
11097
11093
|
download: downloadFileName ?? true,
|
|
11098
11094
|
"aria-label": "\uB2E4\uC6B4\uB85C\uB4DC",
|
|
11099
|
-
children: /* @__PURE__ */ (0,
|
|
11095
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime352.jsx)(DownloadIcon_default, {})
|
|
11100
11096
|
}
|
|
11101
11097
|
),
|
|
11102
|
-
/* @__PURE__ */ (0,
|
|
11098
|
+
/* @__PURE__ */ (0, import_jsx_runtime352.jsx)(
|
|
11103
11099
|
"button",
|
|
11104
11100
|
{
|
|
11105
11101
|
type: "button",
|
|
11106
11102
|
className: "control-btn",
|
|
11107
11103
|
onClick: toggleFullscreen,
|
|
11108
11104
|
"aria-label": isFullscreen ? "\uC804\uCCB4\uD654\uBA74 \uC885\uB8CC" : "\uC804\uCCB4\uD654\uBA74",
|
|
11109
|
-
children: isFullscreen ? /* @__PURE__ */ (0,
|
|
11105
|
+
children: isFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime352.jsx)(MinimizeIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime352.jsx)(MaximizeIcon_default, {})
|
|
11110
11106
|
}
|
|
11111
11107
|
)
|
|
11112
11108
|
] })
|
|
@@ -11119,7 +11115,7 @@ Video.displayName = "Video";
|
|
|
11119
11115
|
var Video_default = Video;
|
|
11120
11116
|
|
|
11121
11117
|
// src/layout/Grid/FullGrid/FullGrid.tsx
|
|
11122
|
-
var
|
|
11118
|
+
var import_jsx_runtime353 = require("react/jsx-runtime");
|
|
11123
11119
|
var GAP_MAP = {
|
|
11124
11120
|
none: "var(--spacing-space-none)",
|
|
11125
11121
|
xs: "var(--spacing-space-1)",
|
|
@@ -11132,13 +11128,13 @@ var GAP_MAP = {
|
|
|
11132
11128
|
var FullGrid = (props) => {
|
|
11133
11129
|
const { children, gap } = props;
|
|
11134
11130
|
const style = gap != null ? { gap: GAP_MAP[gap] } : void 0;
|
|
11135
|
-
return /* @__PURE__ */ (0,
|
|
11131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime353.jsx)("div", { className: "lib-xplat-full-grid", style, children });
|
|
11136
11132
|
};
|
|
11137
11133
|
FullGrid.displayName = "FullGrid";
|
|
11138
11134
|
var FullGrid_default = FullGrid;
|
|
11139
11135
|
|
|
11140
11136
|
// src/layout/Grid/FullScreen/FullScreen.tsx
|
|
11141
|
-
var
|
|
11137
|
+
var import_jsx_runtime354 = require("react/jsx-runtime");
|
|
11142
11138
|
var GAP_MAP2 = {
|
|
11143
11139
|
none: "var(--spacing-space-none)",
|
|
11144
11140
|
xs: "var(--spacing-space-1)",
|
|
@@ -11151,13 +11147,13 @@ var GAP_MAP2 = {
|
|
|
11151
11147
|
var FullScreen = (props) => {
|
|
11152
11148
|
const { children, gap } = props;
|
|
11153
11149
|
const style = gap != null ? { gap: GAP_MAP2[gap] } : void 0;
|
|
11154
|
-
return /* @__PURE__ */ (0,
|
|
11150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime354.jsx)("div", { className: "lib-xplat-full-screen", style, children });
|
|
11155
11151
|
};
|
|
11156
11152
|
FullScreen.displayName = "FullScreen";
|
|
11157
11153
|
var FullScreen_default = FullScreen;
|
|
11158
11154
|
|
|
11159
11155
|
// src/layout/Grid/Item/Item.tsx
|
|
11160
|
-
var
|
|
11156
|
+
var import_jsx_runtime355 = require("react/jsx-runtime");
|
|
11161
11157
|
var calculateSpans = (column) => {
|
|
11162
11158
|
const spans = {};
|
|
11163
11159
|
let inherited = column.default;
|
|
@@ -11174,35 +11170,35 @@ var GridItem = ({ column, children, className }) => {
|
|
|
11174
11170
|
Object.entries(spans).forEach(([key, value]) => {
|
|
11175
11171
|
style[`--column-${key}`] = value;
|
|
11176
11172
|
});
|
|
11177
|
-
return /* @__PURE__ */ (0,
|
|
11173
|
+
return /* @__PURE__ */ (0, import_jsx_runtime355.jsx)("div", { className: clsx_default("lib-xplat-grid-item", className), style, children });
|
|
11178
11174
|
};
|
|
11179
11175
|
GridItem.displayName = "GridItem";
|
|
11180
11176
|
var Item_default = GridItem;
|
|
11181
11177
|
|
|
11182
11178
|
// src/layout/Header/Header.tsx
|
|
11183
|
-
var
|
|
11179
|
+
var import_jsx_runtime356 = require("react/jsx-runtime");
|
|
11184
11180
|
var Header = ({
|
|
11185
11181
|
logo,
|
|
11186
11182
|
centerContent,
|
|
11187
11183
|
rightContent
|
|
11188
11184
|
}) => {
|
|
11189
|
-
return /* @__PURE__ */ (0,
|
|
11190
|
-
/* @__PURE__ */ (0,
|
|
11191
|
-
/* @__PURE__ */ (0,
|
|
11192
|
-
/* @__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 })
|
|
11193
11189
|
] });
|
|
11194
11190
|
};
|
|
11195
11191
|
Header.displayName = "Header";
|
|
11196
11192
|
var Header_default = Header;
|
|
11197
11193
|
|
|
11198
11194
|
// src/layout/Layout/Layout.tsx
|
|
11199
|
-
var
|
|
11195
|
+
var import_jsx_runtime357 = require("react/jsx-runtime");
|
|
11200
11196
|
var Layout = (props) => {
|
|
11201
11197
|
const { header, sideBar, children } = props;
|
|
11202
|
-
return /* @__PURE__ */ (0,
|
|
11203
|
-
sideBar && /* @__PURE__ */ (0,
|
|
11204
|
-
/* @__PURE__ */ (0,
|
|
11205
|
-
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 }),
|
|
11206
11202
|
children
|
|
11207
11203
|
] })
|
|
11208
11204
|
] }) });
|
|
@@ -11211,31 +11207,31 @@ Layout.displayName = "Layout";
|
|
|
11211
11207
|
var Layout_default = Layout;
|
|
11212
11208
|
|
|
11213
11209
|
// src/layout/SideBar/SideBar.tsx
|
|
11214
|
-
var
|
|
11210
|
+
var import_react44 = __toESM(require("react"), 1);
|
|
11215
11211
|
|
|
11216
11212
|
// src/layout/SideBar/SideBarContext.tsx
|
|
11217
|
-
var
|
|
11218
|
-
var SideBarContext =
|
|
11213
|
+
var import_react43 = __toESM(require("react"), 1);
|
|
11214
|
+
var SideBarContext = import_react43.default.createContext(null);
|
|
11219
11215
|
var useSideBarContext = () => {
|
|
11220
|
-
const ctx =
|
|
11216
|
+
const ctx = import_react43.default.useContext(SideBarContext);
|
|
11221
11217
|
if (!ctx) throw new Error("Error");
|
|
11222
11218
|
return ctx;
|
|
11223
11219
|
};
|
|
11224
11220
|
var SideBarContext_default = SideBarContext;
|
|
11225
11221
|
|
|
11226
11222
|
// src/layout/SideBar/SideBar.tsx
|
|
11227
|
-
var
|
|
11223
|
+
var import_jsx_runtime358 = require("react/jsx-runtime");
|
|
11228
11224
|
var SideBar = (props) => {
|
|
11229
11225
|
const { children, className } = props;
|
|
11230
|
-
const [isOpen, setIsOpen] =
|
|
11226
|
+
const [isOpen, setIsOpen] = import_react44.default.useState(true);
|
|
11231
11227
|
const handleSwitchSideBar = () => {
|
|
11232
11228
|
setIsOpen((prev) => !prev);
|
|
11233
11229
|
};
|
|
11234
|
-
return /* @__PURE__ */ (0,
|
|
11230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime358.jsx)(
|
|
11235
11231
|
SideBarContext_default.Provider,
|
|
11236
11232
|
{
|
|
11237
11233
|
value: { isSidebarOpen: isOpen, handleSwitchSideBar },
|
|
11238
|
-
children: /* @__PURE__ */ (0,
|
|
11234
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime358.jsx)(
|
|
11239
11235
|
"div",
|
|
11240
11236
|
{
|
|
11241
11237
|
className: clsx_default(
|