@x-plat/design-system 0.2.4 → 0.3.2
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/{colors-cxE7RsuF.d.cts → colors-BgzpjYfN.d.cts} +3 -6
- package/dist/{colors-cxE7RsuF.d.ts → colors-BgzpjYfN.d.ts} +3 -6
- package/dist/components/Avatar/index.cjs +2 -14
- package/dist/components/Avatar/index.d.cts +3 -235
- package/dist/components/Avatar/index.d.ts +3 -235
- package/dist/components/Avatar/index.js +2 -14
- package/dist/components/Badge/index.cjs +2 -14
- package/dist/components/Badge/index.d.cts +3 -235
- package/dist/components/Badge/index.d.ts +3 -235
- package/dist/components/Badge/index.js +2 -14
- package/dist/components/Button/index.cjs +2 -14
- package/dist/components/Button/index.d.cts +3 -235
- package/dist/components/Button/index.d.ts +3 -235
- package/dist/components/Button/index.js +2 -14
- package/dist/components/CheckBox/index.cjs +2 -14
- package/dist/components/CheckBox/index.d.cts +3 -235
- package/dist/components/CheckBox/index.d.ts +3 -235
- package/dist/components/CheckBox/index.js +2 -14
- package/dist/components/Chip/index.cjs +2 -14
- package/dist/components/Chip/index.d.cts +3 -235
- package/dist/components/Chip/index.d.ts +3 -235
- package/dist/components/Chip/index.js +2 -14
- package/dist/components/DatePicker/index.cjs +9 -161
- package/dist/components/DatePicker/index.d.cts +5 -469
- package/dist/components/DatePicker/index.d.ts +5 -469
- package/dist/components/DatePicker/index.js +9 -161
- package/dist/components/Pagination/index.cjs +2 -14
- package/dist/components/Pagination/index.d.cts +3 -235
- package/dist/components/Pagination/index.d.ts +3 -235
- package/dist/components/Pagination/index.js +2 -14
- package/dist/components/Progress/index.cjs +2 -14
- package/dist/components/Progress/index.d.cts +3 -235
- package/dist/components/Progress/index.d.ts +3 -235
- package/dist/components/Progress/index.js +2 -14
- package/dist/components/Radio/index.cjs +2 -14
- package/dist/components/Radio/index.d.cts +3 -235
- package/dist/components/Radio/index.d.ts +3 -235
- package/dist/components/Radio/index.js +2 -14
- package/dist/components/Spinner/index.cjs +2 -14
- package/dist/components/Spinner/index.d.cts +3 -235
- package/dist/components/Spinner/index.d.ts +3 -235
- package/dist/components/Spinner/index.js +2 -14
- package/dist/components/Steps/index.cjs +2 -14
- package/dist/components/Steps/index.d.cts +3 -235
- package/dist/components/Steps/index.d.ts +3 -235
- package/dist/components/Steps/index.js +2 -14
- package/dist/components/Swiper/index.cjs +257 -5939
- package/dist/components/Swiper/index.css +52 -211
- package/dist/components/Swiper/index.d.cts +35 -16
- package/dist/components/Swiper/index.d.ts +35 -16
- package/dist/components/Swiper/index.js +251 -5944
- package/dist/components/Switch/index.cjs +2 -14
- package/dist/components/Switch/index.d.cts +3 -235
- package/dist/components/Switch/index.d.ts +3 -235
- package/dist/components/Switch/index.js +2 -14
- package/dist/components/Table/index.cjs +2 -16
- package/dist/components/Table/index.d.cts +3 -235
- package/dist/components/Table/index.d.ts +3 -235
- package/dist/components/Table/index.js +2 -16
- package/dist/components/Tag/index.cjs +2 -14
- package/dist/components/Tag/index.d.cts +3 -235
- package/dist/components/Tag/index.d.ts +3 -235
- package/dist/components/Tag/index.js +2 -14
- package/dist/components/Tooltip/index.cjs +2 -14
- package/dist/components/Tooltip/index.d.cts +3 -238
- package/dist/components/Tooltip/index.d.ts +3 -238
- package/dist/components/Tooltip/index.js +2 -14
- package/dist/components/index.cjs +390 -251
- package/dist/components/index.css +71 -0
- package/dist/components/index.d.cts +2 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +390 -252
- package/dist/index.cjs +414 -275
- package/dist/index.css +71 -0
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +414 -276
- package/dist/tokens/index.d.cts +1 -1
- package/dist/tokens/index.d.ts +1 -1
- package/package.json +3 -9
package/dist/index.cjs
CHANGED
|
@@ -317,6 +317,7 @@ __export(index_exports, {
|
|
|
317
317
|
SunIcon: () => SunIcon_default,
|
|
318
318
|
SunriseIcon: () => SunriseIcon_default,
|
|
319
319
|
SunsetIcon: () => SunsetIcon_default,
|
|
320
|
+
Swiper: () => Swiper_default,
|
|
320
321
|
Switch: () => Switch_default,
|
|
321
322
|
Tab: () => Tab_default,
|
|
322
323
|
Table: () => Table_default,
|
|
@@ -5978,11 +5979,6 @@ var Alert = (props) => {
|
|
|
5978
5979
|
Alert.displayName = "Alert";
|
|
5979
5980
|
var Alert_default = Alert;
|
|
5980
5981
|
|
|
5981
|
-
// src/util/getColor.ts
|
|
5982
|
-
var getColorClass = (namespace, palette, shade) => {
|
|
5983
|
-
return `${String(namespace)}-${String(palette)}${shade !== void 0 ? `-${String(shade)}` : ""}`;
|
|
5984
|
-
};
|
|
5985
|
-
|
|
5986
5982
|
// src/components/Avatar/Avatar.tsx
|
|
5987
5983
|
var import_jsx_runtime297 = require("react/jsx-runtime");
|
|
5988
5984
|
var Avatar = (props) => {
|
|
@@ -5991,17 +5987,10 @@ var Avatar = (props) => {
|
|
|
5991
5987
|
alt,
|
|
5992
5988
|
name,
|
|
5993
5989
|
size: size4 = "md",
|
|
5994
|
-
|
|
5995
|
-
color: color2 = "blue",
|
|
5996
|
-
colorDepth,
|
|
5997
|
-
colorToken,
|
|
5990
|
+
color: color2 = "xplat-blue-500",
|
|
5998
5991
|
className
|
|
5999
5992
|
} = props;
|
|
6000
|
-
const colorClass =
|
|
6001
|
-
colorNamespace,
|
|
6002
|
-
color2,
|
|
6003
|
-
colorDepth ?? 500
|
|
6004
|
-
);
|
|
5993
|
+
const colorClass = color2;
|
|
6005
5994
|
const initials = name ? name.split(" ").map((s) => s[0]).join("").slice(0, 2).toUpperCase() : "";
|
|
6006
5995
|
return /* @__PURE__ */ (0, import_jsx_runtime297.jsx)("div", { className: clsx_default("lib-xplat-avatar", size4, className), children: src ? /* @__PURE__ */ (0, import_jsx_runtime297.jsx)("img", { src, alt: alt || name || "avatar" }) : /* @__PURE__ */ (0, import_jsx_runtime297.jsx)("div", { className: clsx_default("fallback", colorClass), children: initials || /* @__PURE__ */ (0, import_jsx_runtime297.jsx)("svg", { viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime297.jsx)("path", { d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" }) }) }) });
|
|
6007
5996
|
};
|
|
@@ -6017,17 +6006,10 @@ var Badge = (props) => {
|
|
|
6017
6006
|
maxCount = 99,
|
|
6018
6007
|
dot = false,
|
|
6019
6008
|
size: size4 = "md",
|
|
6020
|
-
|
|
6021
|
-
color: color2 = "red",
|
|
6022
|
-
colorDepth,
|
|
6023
|
-
colorToken,
|
|
6009
|
+
color: color2 = "xplat-red-500",
|
|
6024
6010
|
className
|
|
6025
6011
|
} = props;
|
|
6026
|
-
const colorClass =
|
|
6027
|
-
colorNamespace,
|
|
6028
|
-
color2,
|
|
6029
|
-
colorDepth ?? 500
|
|
6030
|
-
);
|
|
6012
|
+
const colorClass = color2;
|
|
6031
6013
|
const showBadge = dot || count2 !== void 0 && count2 > 0;
|
|
6032
6014
|
const displayCount = count2 !== void 0 && count2 > maxCount ? `${maxCount}+` : count2;
|
|
6033
6015
|
return /* @__PURE__ */ (0, import_jsx_runtime298.jsxs)("div", { className: clsx_default("lib-xplat-badge", size4, className), children: [
|
|
@@ -6060,19 +6042,12 @@ var Button = (props) => {
|
|
|
6060
6042
|
children,
|
|
6061
6043
|
type = "primary",
|
|
6062
6044
|
size: size4 = "md",
|
|
6063
|
-
|
|
6064
|
-
color: color2 = "black",
|
|
6065
|
-
colorDepth,
|
|
6066
|
-
colorToken,
|
|
6045
|
+
color: color2 = "xplat-black",
|
|
6067
6046
|
disabled,
|
|
6068
6047
|
className,
|
|
6069
6048
|
...rest
|
|
6070
6049
|
} = props;
|
|
6071
|
-
const colorClass =
|
|
6072
|
-
colorNamespace,
|
|
6073
|
-
color2,
|
|
6074
|
-
colorDepth ?? 500
|
|
6075
|
-
);
|
|
6050
|
+
const colorClass = color2;
|
|
6076
6051
|
return /* @__PURE__ */ (0, import_jsx_runtime300.jsx)(
|
|
6077
6052
|
"button",
|
|
6078
6053
|
{
|
|
@@ -20703,10 +20678,7 @@ var gridColumns = {
|
|
|
20703
20678
|
var import_jsx_runtime306 = require("react/jsx-runtime");
|
|
20704
20679
|
var CheckBox = (props) => {
|
|
20705
20680
|
const {
|
|
20706
|
-
|
|
20707
|
-
color: color2 = "blue",
|
|
20708
|
-
colorDepth,
|
|
20709
|
-
colorToken,
|
|
20681
|
+
color: color2 = "xplat-blue-500",
|
|
20710
20682
|
checked,
|
|
20711
20683
|
label,
|
|
20712
20684
|
onChange,
|
|
@@ -20718,11 +20690,7 @@ var CheckBox = (props) => {
|
|
|
20718
20690
|
const handleChange = (e) => {
|
|
20719
20691
|
if (onChange) onChange(e);
|
|
20720
20692
|
};
|
|
20721
|
-
const mainColor =
|
|
20722
|
-
colorNamespace,
|
|
20723
|
-
color2,
|
|
20724
|
-
colorDepth ?? 500
|
|
20725
|
-
);
|
|
20693
|
+
const mainColor = color2;
|
|
20726
20694
|
const uncheckedClasses = `unchecked`;
|
|
20727
20695
|
const checkedClasses = `checked ${mainColor}`;
|
|
20728
20696
|
const disabledClasses = "disabled";
|
|
@@ -20750,19 +20718,12 @@ var import_jsx_runtime307 = require("react/jsx-runtime");
|
|
|
20750
20718
|
var Chip = (props) => {
|
|
20751
20719
|
const {
|
|
20752
20720
|
children,
|
|
20753
|
-
|
|
20754
|
-
color: color2 = "black",
|
|
20755
|
-
colorDepth,
|
|
20756
|
-
colorToken,
|
|
20721
|
+
color: color2 = "xplat-black",
|
|
20757
20722
|
type = "primary",
|
|
20758
20723
|
size: size4 = "md",
|
|
20759
20724
|
className
|
|
20760
20725
|
} = props;
|
|
20761
|
-
const colorClass =
|
|
20762
|
-
colorNamespace,
|
|
20763
|
-
color2,
|
|
20764
|
-
colorDepth ?? 500
|
|
20765
|
-
);
|
|
20726
|
+
const colorClass = color2;
|
|
20766
20727
|
return /* @__PURE__ */ (0, import_jsx_runtime307.jsx)("div", { className: clsx_default("lib-xplat-chip", type, size4, colorClass, className), children });
|
|
20767
20728
|
};
|
|
20768
20729
|
Chip.displayName = "Chip";
|
|
@@ -31756,19 +31717,11 @@ var Modal_default = Modal;
|
|
|
31756
31717
|
|
|
31757
31718
|
// src/components/DatePicker/SingleDatePicker/index.tsx
|
|
31758
31719
|
var import_jsx_runtime314 = require("react/jsx-runtime");
|
|
31759
|
-
function getColorValue(ns, color2, depth) {
|
|
31760
|
-
const nsColors = colors[ns];
|
|
31761
|
-
const colorEntry = nsColors[color2];
|
|
31762
|
-
if (typeof colorEntry === "string") return colorEntry;
|
|
31763
|
-
return colorEntry[String(depth)] ?? "";
|
|
31764
|
-
}
|
|
31765
31720
|
var SingleDatePicker = (props) => {
|
|
31766
31721
|
const {
|
|
31767
31722
|
value,
|
|
31768
31723
|
onChange,
|
|
31769
|
-
|
|
31770
|
-
color: color2 = "blue",
|
|
31771
|
-
colorDepth,
|
|
31724
|
+
color: color2 = "xplat-blue-500",
|
|
31772
31725
|
highlightDates,
|
|
31773
31726
|
...rest
|
|
31774
31727
|
} = props;
|
|
@@ -31776,16 +31729,11 @@ var SingleDatePicker = (props) => {
|
|
|
31776
31729
|
if (Array.isArray(date)) return;
|
|
31777
31730
|
onChange?.(date);
|
|
31778
31731
|
};
|
|
31779
|
-
const activeColor = getColorValue(
|
|
31780
|
-
colorNamespace,
|
|
31781
|
-
color2,
|
|
31782
|
-
colorDepth ?? 500
|
|
31783
|
-
);
|
|
31784
31732
|
return /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
31785
31733
|
"div",
|
|
31786
31734
|
{
|
|
31787
31735
|
className: "lib-xplat-datepicker",
|
|
31788
|
-
style: { "--datepicker-active-color":
|
|
31736
|
+
style: { "--datepicker-active-color": `var(--${color2})` },
|
|
31789
31737
|
children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
31790
31738
|
DatePicker,
|
|
31791
31739
|
{
|
|
@@ -31843,13 +31791,12 @@ var PopupPicker = (props) => {
|
|
|
31843
31791
|
Button_default,
|
|
31844
31792
|
{
|
|
31845
31793
|
type: "secondary",
|
|
31846
|
-
color: "neutral",
|
|
31847
|
-
colorDepth: 400,
|
|
31794
|
+
color: "xplat-neutral-400",
|
|
31848
31795
|
onClick: handleClose,
|
|
31849
31796
|
children: "\uCDE8\uC18C"
|
|
31850
31797
|
}
|
|
31851
31798
|
),
|
|
31852
|
-
/* @__PURE__ */ (0, import_jsx_runtime315.jsx)(Button_default, { type: "primary", color: "blue", onClick: handleClose, children: "\uC801\uC6A9" })
|
|
31799
|
+
/* @__PURE__ */ (0, import_jsx_runtime315.jsx)(Button_default, { type: "primary", color: "xplat-blue-500", onClick: handleClose, children: "\uC801\uC6A9" })
|
|
31853
31800
|
] })
|
|
31854
31801
|
] }) })
|
|
31855
31802
|
] });
|
|
@@ -31879,19 +31826,12 @@ var RangePicker = (props) => {
|
|
|
31879
31826
|
onChange,
|
|
31880
31827
|
minDate,
|
|
31881
31828
|
maxDate,
|
|
31882
|
-
|
|
31883
|
-
color: color2,
|
|
31884
|
-
colorDepth
|
|
31829
|
+
color: color2
|
|
31885
31830
|
} = props;
|
|
31886
31831
|
const rangeDates = import_react15.default.useMemo(
|
|
31887
31832
|
() => getDatesBetween(startDate, endDate),
|
|
31888
31833
|
[startDate, endDate]
|
|
31889
31834
|
);
|
|
31890
|
-
const colorProps = {
|
|
31891
|
-
...colorNamespace !== void 0 && { colorNamespace },
|
|
31892
|
-
...color2 !== void 0 && { color: color2 },
|
|
31893
|
-
...colorDepth !== void 0 && { colorDepth }
|
|
31894
|
-
};
|
|
31895
31835
|
return /* @__PURE__ */ (0, import_jsx_runtime316.jsxs)("div", { className: "lib-xplat-range-datepicker", children: [
|
|
31896
31836
|
/* @__PURE__ */ (0, import_jsx_runtime316.jsxs)("div", { className: "lib-xplat-range-datepicker-from", children: [
|
|
31897
31837
|
/* @__PURE__ */ (0, import_jsx_runtime316.jsx)("span", { className: "lib-xplat-range-datepicker-label", children: "\uC2DC\uC791" }),
|
|
@@ -31903,7 +31843,7 @@ var RangePicker = (props) => {
|
|
|
31903
31843
|
minDate,
|
|
31904
31844
|
maxDate: endDate,
|
|
31905
31845
|
highlightDates: rangeDates,
|
|
31906
|
-
|
|
31846
|
+
color: color2
|
|
31907
31847
|
}
|
|
31908
31848
|
)
|
|
31909
31849
|
] }),
|
|
@@ -31917,7 +31857,7 @@ var RangePicker = (props) => {
|
|
|
31917
31857
|
minDate: startDate,
|
|
31918
31858
|
maxDate,
|
|
31919
31859
|
highlightDates: rangeDates,
|
|
31920
|
-
|
|
31860
|
+
color: color2
|
|
31921
31861
|
}
|
|
31922
31862
|
)
|
|
31923
31863
|
] })
|
|
@@ -32629,17 +32569,10 @@ var Pagination = (props) => {
|
|
|
32629
32569
|
siblingCount = 1,
|
|
32630
32570
|
onChange,
|
|
32631
32571
|
size: size4 = "md",
|
|
32632
|
-
|
|
32633
|
-
color: color2 = "blue",
|
|
32634
|
-
colorDepth,
|
|
32635
|
-
colorToken,
|
|
32572
|
+
color: color2 = "xplat-blue-500",
|
|
32636
32573
|
className
|
|
32637
32574
|
} = props;
|
|
32638
|
-
const colorClass =
|
|
32639
|
-
colorNamespace,
|
|
32640
|
-
color2,
|
|
32641
|
-
colorDepth ?? 500
|
|
32642
|
-
);
|
|
32575
|
+
const colorClass = color2;
|
|
32643
32576
|
const totalPages = Math.max(1, Math.ceil(total / pageSize));
|
|
32644
32577
|
const pages = getPageRange(current, totalPages, siblingCount);
|
|
32645
32578
|
const handleClick = (page) => {
|
|
@@ -32749,17 +32682,10 @@ var Progress = (props) => {
|
|
|
32749
32682
|
max: max3 = 100,
|
|
32750
32683
|
size: size4 = "md",
|
|
32751
32684
|
showLabel = false,
|
|
32752
|
-
|
|
32753
|
-
color: color2 = "blue",
|
|
32754
|
-
colorDepth,
|
|
32755
|
-
colorToken,
|
|
32685
|
+
color: color2 = "xplat-blue-500",
|
|
32756
32686
|
className
|
|
32757
32687
|
} = props;
|
|
32758
|
-
const colorClass =
|
|
32759
|
-
colorNamespace,
|
|
32760
|
-
color2,
|
|
32761
|
-
colorDepth ?? 500
|
|
32762
|
-
);
|
|
32688
|
+
const colorClass = color2;
|
|
32763
32689
|
const percentage = Math.min(100, Math.max(0, value / max3 * 100));
|
|
32764
32690
|
return /* @__PURE__ */ (0, import_jsx_runtime328.jsxs)("div", { className: clsx_default("lib-xplat-progress", size4, className), children: [
|
|
32765
32691
|
/* @__PURE__ */ (0, import_jsx_runtime328.jsx)(
|
|
@@ -32805,10 +32731,7 @@ var Radio = (props) => {
|
|
|
32805
32731
|
label,
|
|
32806
32732
|
value,
|
|
32807
32733
|
className,
|
|
32808
|
-
|
|
32809
|
-
color: color2 = "blue",
|
|
32810
|
-
colorDepth,
|
|
32811
|
-
colorToken,
|
|
32734
|
+
color: color2 = "xplat-blue-500",
|
|
32812
32735
|
size: sizeProp,
|
|
32813
32736
|
...rest
|
|
32814
32737
|
} = props;
|
|
@@ -32821,11 +32744,7 @@ var Radio = (props) => {
|
|
|
32821
32744
|
value,
|
|
32822
32745
|
onChange: rest.onChange
|
|
32823
32746
|
};
|
|
32824
|
-
const colorClass =
|
|
32825
|
-
colorNamespace,
|
|
32826
|
-
color2,
|
|
32827
|
-
colorDepth ?? 500
|
|
32828
|
-
);
|
|
32747
|
+
const colorClass = color2;
|
|
32829
32748
|
return /* @__PURE__ */ (0, import_jsx_runtime329.jsxs)(
|
|
32830
32749
|
"label",
|
|
32831
32750
|
{
|
|
@@ -32890,17 +32809,10 @@ var import_jsx_runtime332 = require("react/jsx-runtime");
|
|
|
32890
32809
|
var Spinner = (props) => {
|
|
32891
32810
|
const {
|
|
32892
32811
|
size: size4 = "md",
|
|
32893
|
-
|
|
32894
|
-
color: color2 = "blue",
|
|
32895
|
-
colorDepth,
|
|
32896
|
-
colorToken,
|
|
32812
|
+
color: color2 = "xplat-blue-500",
|
|
32897
32813
|
className
|
|
32898
32814
|
} = props;
|
|
32899
|
-
const colorClass =
|
|
32900
|
-
colorNamespace,
|
|
32901
|
-
color2,
|
|
32902
|
-
colorDepth ?? 500
|
|
32903
|
-
);
|
|
32815
|
+
const colorClass = color2;
|
|
32904
32816
|
return /* @__PURE__ */ (0, import_jsx_runtime332.jsx)(
|
|
32905
32817
|
"div",
|
|
32906
32818
|
{
|
|
@@ -32942,17 +32854,10 @@ var Steps = (props) => {
|
|
|
32942
32854
|
const {
|
|
32943
32855
|
items,
|
|
32944
32856
|
current,
|
|
32945
|
-
|
|
32946
|
-
color: color2 = "blue",
|
|
32947
|
-
colorDepth,
|
|
32948
|
-
colorToken,
|
|
32857
|
+
color: color2 = "xplat-blue-500",
|
|
32949
32858
|
className
|
|
32950
32859
|
} = props;
|
|
32951
|
-
const colorClass =
|
|
32952
|
-
colorNamespace,
|
|
32953
|
-
color2,
|
|
32954
|
-
colorDepth ?? 500
|
|
32955
|
-
);
|
|
32860
|
+
const colorClass = color2;
|
|
32956
32861
|
return /* @__PURE__ */ (0, import_jsx_runtime333.jsx)("div", { className: clsx_default("lib-xplat-steps", className), children: items.map((item, index3) => {
|
|
32957
32862
|
const status = index3 < current ? "completed" : index3 === current ? "active" : "pending";
|
|
32958
32863
|
return /* @__PURE__ */ (0, import_jsx_runtime333.jsxs)("div", { className: clsx_default("step-item", status), children: [
|
|
@@ -32970,9 +32875,270 @@ var Steps = (props) => {
|
|
|
32970
32875
|
Steps.displayName = "Steps";
|
|
32971
32876
|
var Steps_default = Steps;
|
|
32972
32877
|
|
|
32973
|
-
// src/components/
|
|
32878
|
+
// src/components/Swiper/Swiper.tsx
|
|
32974
32879
|
var import_react29 = __toESM(require("react"), 1);
|
|
32975
32880
|
var import_jsx_runtime334 = require("react/jsx-runtime");
|
|
32881
|
+
var Swiper = (props) => {
|
|
32882
|
+
const {
|
|
32883
|
+
auto = false,
|
|
32884
|
+
swiperRef,
|
|
32885
|
+
renderItems = [],
|
|
32886
|
+
viewItemCount = 1,
|
|
32887
|
+
maxItems,
|
|
32888
|
+
loop = false,
|
|
32889
|
+
spaceBetween = 16,
|
|
32890
|
+
showProgress = false,
|
|
32891
|
+
autoplayDelay = 3e3,
|
|
32892
|
+
speed = 300,
|
|
32893
|
+
slideBy = 1,
|
|
32894
|
+
index: indexProp,
|
|
32895
|
+
onChange,
|
|
32896
|
+
className
|
|
32897
|
+
} = props;
|
|
32898
|
+
const items = maxItems ? renderItems.slice(0, maxItems) : renderItems;
|
|
32899
|
+
const totalSlides = items.length;
|
|
32900
|
+
const canSlide = totalSlides > viewItemCount;
|
|
32901
|
+
const maxIndex = Math.max(0, totalSlides - viewItemCount);
|
|
32902
|
+
const useLoop = loop && canSlide;
|
|
32903
|
+
const cloneCount = useLoop ? totalSlides : 0;
|
|
32904
|
+
const extendedItems = import_react29.default.useMemo(() => {
|
|
32905
|
+
if (!useLoop) return items;
|
|
32906
|
+
return [...items, ...items, ...items];
|
|
32907
|
+
}, [items, useLoop]);
|
|
32908
|
+
const initialIdx = Math.max(0, Math.min(indexProp ?? 0, maxIndex));
|
|
32909
|
+
const [innerIndex, setInnerIndex] = import_react29.default.useState(
|
|
32910
|
+
useLoop ? cloneCount + initialIdx : initialIdx
|
|
32911
|
+
);
|
|
32912
|
+
const [isDragging, setIsDragging] = import_react29.default.useState(false);
|
|
32913
|
+
const [dragOffset, setDragOffset] = import_react29.default.useState(0);
|
|
32914
|
+
const [animated, setAnimated] = import_react29.default.useState(true);
|
|
32915
|
+
const [containerWidth, setContainerWidth] = import_react29.default.useState(0);
|
|
32916
|
+
const containerRef = import_react29.default.useRef(null);
|
|
32917
|
+
const startXRef = import_react29.default.useRef(0);
|
|
32918
|
+
const startTimeRef = import_react29.default.useRef(0);
|
|
32919
|
+
const autoplayTimerRef = import_react29.default.useRef(null);
|
|
32920
|
+
import_react29.default.useEffect(() => {
|
|
32921
|
+
const el = containerRef.current;
|
|
32922
|
+
if (!el) return;
|
|
32923
|
+
const ro = new ResizeObserver((entries) => {
|
|
32924
|
+
for (const entry of entries) {
|
|
32925
|
+
setContainerWidth(entry.contentRect.width);
|
|
32926
|
+
}
|
|
32927
|
+
});
|
|
32928
|
+
ro.observe(el);
|
|
32929
|
+
setContainerWidth(el.offsetWidth);
|
|
32930
|
+
return () => ro.disconnect();
|
|
32931
|
+
}, []);
|
|
32932
|
+
const slideStep = containerWidth > 0 ? (containerWidth - (viewItemCount - 1) * spaceBetween) / viewItemCount + spaceBetween : 0;
|
|
32933
|
+
const transformPx = -(innerIndex * slideStep) + dragOffset;
|
|
32934
|
+
const getRealIndex = (inner) => {
|
|
32935
|
+
if (!useLoop) return inner;
|
|
32936
|
+
return ((inner - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
32937
|
+
};
|
|
32938
|
+
const realIndex = getRealIndex(innerIndex);
|
|
32939
|
+
const moveToInner = import_react29.default.useCallback(
|
|
32940
|
+
(idx, withAnim = true) => {
|
|
32941
|
+
if (useLoop) {
|
|
32942
|
+
setInnerIndex((prev) => {
|
|
32943
|
+
const real = ((prev - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
32944
|
+
const canonical = cloneCount + real;
|
|
32945
|
+
if (prev !== canonical) {
|
|
32946
|
+
const delta = idx - prev;
|
|
32947
|
+
setAnimated(withAnim);
|
|
32948
|
+
return canonical + delta;
|
|
32949
|
+
}
|
|
32950
|
+
setAnimated(withAnim);
|
|
32951
|
+
return idx;
|
|
32952
|
+
});
|
|
32953
|
+
} else {
|
|
32954
|
+
setAnimated(withAnim);
|
|
32955
|
+
setInnerIndex(idx);
|
|
32956
|
+
}
|
|
32957
|
+
},
|
|
32958
|
+
[useLoop, cloneCount, totalSlides]
|
|
32959
|
+
);
|
|
32960
|
+
const handleTransitionEnd = import_react29.default.useCallback(() => {
|
|
32961
|
+
if (!useLoop) return;
|
|
32962
|
+
const real = getRealIndex(innerIndex);
|
|
32963
|
+
const canonical = cloneCount + real;
|
|
32964
|
+
if (innerIndex !== canonical) {
|
|
32965
|
+
moveToInner(canonical, false);
|
|
32966
|
+
}
|
|
32967
|
+
onChange?.(Math.min(real, maxIndex));
|
|
32968
|
+
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange, moveToInner]);
|
|
32969
|
+
const slideTo = import_react29.default.useCallback(
|
|
32970
|
+
(logicalIndex) => {
|
|
32971
|
+
if (!canSlide) return;
|
|
32972
|
+
const clamped = useLoop ? logicalIndex : Math.max(0, Math.min(logicalIndex, maxIndex));
|
|
32973
|
+
const target = useLoop ? cloneCount + clamped : clamped;
|
|
32974
|
+
moveToInner(target, true);
|
|
32975
|
+
if (!useLoop) onChange?.(clamped);
|
|
32976
|
+
},
|
|
32977
|
+
[canSlide, useLoop, cloneCount, maxIndex, onChange, moveToInner]
|
|
32978
|
+
);
|
|
32979
|
+
const slideNext = import_react29.default.useCallback(() => {
|
|
32980
|
+
if (!canSlide) return;
|
|
32981
|
+
const nextInner = innerIndex + slideBy;
|
|
32982
|
+
if (useLoop) {
|
|
32983
|
+
moveToInner(nextInner, true);
|
|
32984
|
+
} else {
|
|
32985
|
+
moveToInner(Math.min(nextInner, maxIndex), true);
|
|
32986
|
+
}
|
|
32987
|
+
}, [canSlide, useLoop, innerIndex, slideBy, maxIndex, moveToInner]);
|
|
32988
|
+
const slidePrev = import_react29.default.useCallback(() => {
|
|
32989
|
+
if (!canSlide) return;
|
|
32990
|
+
const prevInner = innerIndex - slideBy;
|
|
32991
|
+
if (useLoop) {
|
|
32992
|
+
moveToInner(prevInner, true);
|
|
32993
|
+
} else {
|
|
32994
|
+
moveToInner(Math.max(prevInner, 0), true);
|
|
32995
|
+
}
|
|
32996
|
+
}, [canSlide, useLoop, innerIndex, slideBy, moveToInner]);
|
|
32997
|
+
import_react29.default.useEffect(() => {
|
|
32998
|
+
if (indexProp === void 0) return;
|
|
32999
|
+
const clamped = Math.max(0, Math.min(indexProp, maxIndex));
|
|
33000
|
+
const target = useLoop ? cloneCount + clamped : clamped;
|
|
33001
|
+
if (target !== innerIndex) {
|
|
33002
|
+
moveToInner(target, true);
|
|
33003
|
+
}
|
|
33004
|
+
}, [indexProp]);
|
|
33005
|
+
import_react29.default.useImperativeHandle(swiperRef, () => ({
|
|
33006
|
+
slidePrev,
|
|
33007
|
+
slideNext,
|
|
33008
|
+
slideTo
|
|
33009
|
+
}));
|
|
33010
|
+
import_react29.default.useEffect(() => {
|
|
33011
|
+
if (!auto || !canSlide) return;
|
|
33012
|
+
autoplayTimerRef.current = setInterval(slideNext, autoplayDelay);
|
|
33013
|
+
return () => {
|
|
33014
|
+
if (autoplayTimerRef.current) clearInterval(autoplayTimerRef.current);
|
|
33015
|
+
};
|
|
33016
|
+
}, [auto, autoplayDelay, slideNext, canSlide]);
|
|
33017
|
+
const pauseAutoplay = () => {
|
|
33018
|
+
if (autoplayTimerRef.current) clearInterval(autoplayTimerRef.current);
|
|
33019
|
+
};
|
|
33020
|
+
const getClientX = (e) => {
|
|
33021
|
+
if ("touches" in e) return e.touches[0]?.clientX ?? 0;
|
|
33022
|
+
return e.clientX;
|
|
33023
|
+
};
|
|
33024
|
+
const handleDragStart = (e) => {
|
|
33025
|
+
if (!canSlide) return;
|
|
33026
|
+
if ("button" in e && e.button !== 0) return;
|
|
33027
|
+
pauseAutoplay();
|
|
33028
|
+
setIsDragging(true);
|
|
33029
|
+
setAnimated(false);
|
|
33030
|
+
startXRef.current = getClientX(e);
|
|
33031
|
+
startTimeRef.current = Date.now();
|
|
33032
|
+
};
|
|
33033
|
+
import_react29.default.useEffect(() => {
|
|
33034
|
+
if (!isDragging) return;
|
|
33035
|
+
const handleMove = (e) => {
|
|
33036
|
+
setDragOffset(getClientX(e) - startXRef.current);
|
|
33037
|
+
};
|
|
33038
|
+
const handleEnd = () => {
|
|
33039
|
+
setIsDragging(false);
|
|
33040
|
+
const absDrag = Math.abs(dragOffset);
|
|
33041
|
+
const elapsed = Date.now() - startTimeRef.current;
|
|
33042
|
+
const velocity = absDrag / elapsed;
|
|
33043
|
+
if ((absDrag > 30 || velocity > 0.3) && slideStep > 0) {
|
|
33044
|
+
const rawCount = Math.max(1, Math.round(absDrag / slideStep));
|
|
33045
|
+
const count2 = Math.max(slideBy, Math.round(rawCount / slideBy) * slideBy);
|
|
33046
|
+
const direction = dragOffset < 0 ? 1 : -1;
|
|
33047
|
+
const nextInner = innerIndex + direction * count2;
|
|
33048
|
+
if (useLoop) {
|
|
33049
|
+
moveToInner(nextInner, true);
|
|
33050
|
+
} else {
|
|
33051
|
+
moveToInner(Math.max(0, Math.min(nextInner, maxIndex)), true);
|
|
33052
|
+
}
|
|
33053
|
+
} else {
|
|
33054
|
+
setAnimated(true);
|
|
33055
|
+
}
|
|
33056
|
+
setDragOffset(0);
|
|
33057
|
+
};
|
|
33058
|
+
window.addEventListener("mousemove", handleMove);
|
|
33059
|
+
window.addEventListener("mouseup", handleEnd);
|
|
33060
|
+
window.addEventListener("touchmove", handleMove, { passive: true });
|
|
33061
|
+
window.addEventListener("touchend", handleEnd);
|
|
33062
|
+
return () => {
|
|
33063
|
+
window.removeEventListener("mousemove", handleMove);
|
|
33064
|
+
window.removeEventListener("mouseup", handleEnd);
|
|
33065
|
+
window.removeEventListener("touchmove", handleMove);
|
|
33066
|
+
window.removeEventListener("touchend", handleEnd);
|
|
33067
|
+
};
|
|
33068
|
+
}, [isDragging, dragOffset, innerIndex, useLoop, maxIndex, slideStep, moveToInner]);
|
|
33069
|
+
const slideWidthPercent = 100 / viewItemCount;
|
|
33070
|
+
const gapAdjust = spaceBetween * (viewItemCount - 1) / viewItemCount;
|
|
33071
|
+
const totalSteps = Math.ceil((maxIndex + 1) / slideBy);
|
|
33072
|
+
const currentStep = Math.min(
|
|
33073
|
+
Math.floor(realIndex / slideBy),
|
|
33074
|
+
totalSteps - 1
|
|
33075
|
+
);
|
|
33076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime334.jsxs)("div", { className: clsx_default("lib-xplat-swiper", className), ref: containerRef, children: [
|
|
33077
|
+
/* @__PURE__ */ (0, import_jsx_runtime334.jsx)(
|
|
33078
|
+
"div",
|
|
33079
|
+
{
|
|
33080
|
+
className: "lib-xplat-swiper__viewport",
|
|
33081
|
+
onMouseDown: handleDragStart,
|
|
33082
|
+
onTouchStart: handleDragStart,
|
|
33083
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime334.jsx)(
|
|
33084
|
+
"div",
|
|
33085
|
+
{
|
|
33086
|
+
className: clsx_default(
|
|
33087
|
+
"lib-xplat-swiper__track",
|
|
33088
|
+
animated && !isDragging && "transitioning"
|
|
33089
|
+
),
|
|
33090
|
+
style: {
|
|
33091
|
+
transform: `translateX(${transformPx}px)`,
|
|
33092
|
+
transitionDuration: isDragging || !animated ? "0ms" : `${speed}ms`,
|
|
33093
|
+
gap: `${spaceBetween}px`
|
|
33094
|
+
},
|
|
33095
|
+
onTransitionEnd: handleTransitionEnd,
|
|
33096
|
+
children: extendedItems.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime334.jsx)(
|
|
33097
|
+
"div",
|
|
33098
|
+
{
|
|
33099
|
+
className: "lib-xplat-swiper__slide",
|
|
33100
|
+
style: {
|
|
33101
|
+
minWidth: `calc(${slideWidthPercent}% - ${gapAdjust}px)`,
|
|
33102
|
+
maxWidth: `calc(${slideWidthPercent}% - ${gapAdjust}px)`
|
|
33103
|
+
},
|
|
33104
|
+
children: item
|
|
33105
|
+
},
|
|
33106
|
+
idx
|
|
33107
|
+
))
|
|
33108
|
+
}
|
|
33109
|
+
)
|
|
33110
|
+
}
|
|
33111
|
+
),
|
|
33112
|
+
showProgress && canSlide && /* @__PURE__ */ (0, import_jsx_runtime334.jsx)("div", { className: "lib-xplat-swiper__progress", children: /* @__PURE__ */ (0, import_jsx_runtime334.jsx)("div", { className: "lib-xplat-swiper__progress-track", children: /* @__PURE__ */ (0, import_jsx_runtime334.jsx)(
|
|
33113
|
+
"span",
|
|
33114
|
+
{
|
|
33115
|
+
className: "lib-xplat-swiper__progress-fill",
|
|
33116
|
+
style: {
|
|
33117
|
+
width: `${(currentStep + 1) / totalSteps * 100}%`,
|
|
33118
|
+
transitionDuration: `${speed}ms`
|
|
33119
|
+
}
|
|
33120
|
+
}
|
|
33121
|
+
) }) }),
|
|
33122
|
+
canSlide && /* @__PURE__ */ (0, import_jsx_runtime334.jsx)("div", { className: "lib-xplat-swiper__dots", children: Array.from({ length: totalSteps }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime334.jsx)(
|
|
33123
|
+
"button",
|
|
33124
|
+
{
|
|
33125
|
+
className: clsx_default(
|
|
33126
|
+
"lib-xplat-swiper__dot",
|
|
33127
|
+
i === currentStep && "active"
|
|
33128
|
+
),
|
|
33129
|
+
onClick: () => slideTo(i * slideBy),
|
|
33130
|
+
"aria-label": `\uC2AC\uB77C\uC774\uB4DC ${i + 1}`
|
|
33131
|
+
},
|
|
33132
|
+
i
|
|
33133
|
+
)) })
|
|
33134
|
+
] });
|
|
33135
|
+
};
|
|
33136
|
+
Swiper.displayName = "Swiper";
|
|
33137
|
+
var Swiper_default = Swiper;
|
|
33138
|
+
|
|
33139
|
+
// src/components/Switch/Switch.tsx
|
|
33140
|
+
var import_react30 = __toESM(require("react"), 1);
|
|
33141
|
+
var import_jsx_runtime335 = require("react/jsx-runtime");
|
|
32976
33142
|
var KNOB_TRANSITION_MS = 250;
|
|
32977
33143
|
var Switch = (props) => {
|
|
32978
33144
|
const {
|
|
@@ -32980,15 +33146,12 @@ var Switch = (props) => {
|
|
|
32980
33146
|
size: size4 = "md",
|
|
32981
33147
|
disabled,
|
|
32982
33148
|
onChange,
|
|
32983
|
-
|
|
32984
|
-
color: color2 = "blue",
|
|
32985
|
-
colorDepth,
|
|
32986
|
-
colorToken,
|
|
33149
|
+
color: color2 = "xplat-blue-500",
|
|
32987
33150
|
className
|
|
32988
33151
|
} = props;
|
|
32989
|
-
const [isAnimating, setIsAnimating] =
|
|
32990
|
-
const timeoutRef =
|
|
32991
|
-
|
|
33152
|
+
const [isAnimating, setIsAnimating] = import_react30.default.useState(false);
|
|
33153
|
+
const timeoutRef = import_react30.default.useRef(null);
|
|
33154
|
+
import_react30.default.useEffect(() => {
|
|
32992
33155
|
return () => {
|
|
32993
33156
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
32994
33157
|
};
|
|
@@ -33003,12 +33166,8 @@ var Switch = (props) => {
|
|
|
33003
33166
|
timeoutRef.current = null;
|
|
33004
33167
|
}, KNOB_TRANSITION_MS);
|
|
33005
33168
|
};
|
|
33006
|
-
const colorClass =
|
|
33007
|
-
|
|
33008
|
-
color2,
|
|
33009
|
-
colorDepth ?? 500
|
|
33010
|
-
);
|
|
33011
|
-
return /* @__PURE__ */ (0, import_jsx_runtime334.jsx)(
|
|
33169
|
+
const colorClass = color2;
|
|
33170
|
+
return /* @__PURE__ */ (0, import_jsx_runtime335.jsx)(
|
|
33012
33171
|
"div",
|
|
33013
33172
|
{
|
|
33014
33173
|
className: clsx_default(
|
|
@@ -33022,7 +33181,7 @@ var Switch = (props) => {
|
|
|
33022
33181
|
),
|
|
33023
33182
|
onClick: handleClick,
|
|
33024
33183
|
"aria-disabled": disabled || isAnimating,
|
|
33025
|
-
children: /* @__PURE__ */ (0,
|
|
33184
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime335.jsx)("div", { className: clsx_default("knob", value ? "checked" : void 0) })
|
|
33026
33185
|
}
|
|
33027
33186
|
);
|
|
33028
33187
|
};
|
|
@@ -33030,14 +33189,14 @@ Switch.displayName = "Switch";
|
|
|
33030
33189
|
var Switch_default = Switch;
|
|
33031
33190
|
|
|
33032
33191
|
// src/components/Tab/Tab.tsx
|
|
33033
|
-
var
|
|
33192
|
+
var import_react32 = __toESM(require("react"), 1);
|
|
33034
33193
|
|
|
33035
33194
|
// src/components/Tab/TabItem.tsx
|
|
33036
|
-
var
|
|
33037
|
-
var
|
|
33038
|
-
var TabItem =
|
|
33195
|
+
var import_react31 = __toESM(require("react"), 1);
|
|
33196
|
+
var import_jsx_runtime336 = require("react/jsx-runtime");
|
|
33197
|
+
var TabItem = import_react31.default.forwardRef((props, ref) => {
|
|
33039
33198
|
const { isActive, title, onClick } = props;
|
|
33040
|
-
return /* @__PURE__ */ (0,
|
|
33199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(
|
|
33041
33200
|
"div",
|
|
33042
33201
|
{
|
|
33043
33202
|
ref,
|
|
@@ -33051,25 +33210,25 @@ TabItem.displayName = "TabItem";
|
|
|
33051
33210
|
var TabItem_default = TabItem;
|
|
33052
33211
|
|
|
33053
33212
|
// src/components/Tab/Tab.tsx
|
|
33054
|
-
var
|
|
33213
|
+
var import_jsx_runtime337 = require("react/jsx-runtime");
|
|
33055
33214
|
var Tab = (props) => {
|
|
33056
33215
|
const { activeIndex, onChange, tabs, type, size: size4 = "md" } = props;
|
|
33057
|
-
const [underlineStyle, setUnderlineStyle] =
|
|
33216
|
+
const [underlineStyle, setUnderlineStyle] = import_react32.default.useState({
|
|
33058
33217
|
left: 0,
|
|
33059
33218
|
width: 0
|
|
33060
33219
|
});
|
|
33061
|
-
const itemRefs =
|
|
33220
|
+
const itemRefs = import_react32.default.useRef([]);
|
|
33062
33221
|
const handleChangeActiveTab = (tabItem, tabIdx) => {
|
|
33063
33222
|
onChange(tabItem, tabIdx);
|
|
33064
33223
|
};
|
|
33065
|
-
|
|
33224
|
+
import_react32.default.useEffect(() => {
|
|
33066
33225
|
const el = itemRefs.current[activeIndex];
|
|
33067
33226
|
if (el) {
|
|
33068
33227
|
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
33069
33228
|
}
|
|
33070
33229
|
}, [activeIndex, tabs.length]);
|
|
33071
|
-
return /* @__PURE__ */ (0,
|
|
33072
|
-
tabs.map((tab, idx) => /* @__PURE__ */ (0,
|
|
33230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime337.jsxs)("div", { className: clsx_default("lib-xplat-tab", `type-${type}`, size4), children: [
|
|
33231
|
+
tabs.map((tab, idx) => /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
33073
33232
|
TabItem_default,
|
|
33074
33233
|
{
|
|
33075
33234
|
onClick: () => handleChangeActiveTab(tab, idx),
|
|
@@ -33081,7 +33240,7 @@ var Tab = (props) => {
|
|
|
33081
33240
|
},
|
|
33082
33241
|
`${tab.value}_${idx}`
|
|
33083
33242
|
)),
|
|
33084
|
-
type === "toggle" && /* @__PURE__ */ (0,
|
|
33243
|
+
type === "toggle" && /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
33085
33244
|
"div",
|
|
33086
33245
|
{
|
|
33087
33246
|
className: "tab-toggle-underline",
|
|
@@ -33097,17 +33256,17 @@ Tab.displayName = "Tab";
|
|
|
33097
33256
|
var Tab_default = Tab;
|
|
33098
33257
|
|
|
33099
33258
|
// src/components/Table/TableContext.tsx
|
|
33100
|
-
var
|
|
33101
|
-
var TableContext =
|
|
33259
|
+
var import_react33 = __toESM(require("react"), 1);
|
|
33260
|
+
var TableContext = import_react33.default.createContext(null);
|
|
33102
33261
|
var useTableContext = () => {
|
|
33103
|
-
const ctx =
|
|
33262
|
+
const ctx = import_react33.default.useContext(TableContext);
|
|
33104
33263
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
33105
33264
|
return ctx;
|
|
33106
33265
|
};
|
|
33107
33266
|
var TableContext_default = TableContext;
|
|
33108
33267
|
|
|
33109
33268
|
// src/components/Table/Table.tsx
|
|
33110
|
-
var
|
|
33269
|
+
var import_jsx_runtime338 = require("react/jsx-runtime");
|
|
33111
33270
|
var Table = (props) => {
|
|
33112
33271
|
const {
|
|
33113
33272
|
className,
|
|
@@ -33117,7 +33276,7 @@ var Table = (props) => {
|
|
|
33117
33276
|
headerSticky = false,
|
|
33118
33277
|
stickyShadow = true
|
|
33119
33278
|
} = props;
|
|
33120
|
-
return /* @__PURE__ */ (0,
|
|
33279
|
+
return /* @__PURE__ */ (0, import_jsx_runtime338.jsx)("div", { className: clsx_default("lib-xplat-table-wrapper", className), children: /* @__PURE__ */ (0, import_jsx_runtime338.jsx)(
|
|
33121
33280
|
TableContext_default.Provider,
|
|
33122
33281
|
{
|
|
33123
33282
|
value: {
|
|
@@ -33126,7 +33285,7 @@ var Table = (props) => {
|
|
|
33126
33285
|
headerSticky,
|
|
33127
33286
|
stickyShadow
|
|
33128
33287
|
},
|
|
33129
|
-
children: /* @__PURE__ */ (0,
|
|
33288
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime338.jsx)("table", { className: "lib-xplat-table", children })
|
|
33130
33289
|
}
|
|
33131
33290
|
) });
|
|
33132
33291
|
};
|
|
@@ -33134,40 +33293,40 @@ Table.displayName = "Table";
|
|
|
33134
33293
|
var Table_default = Table;
|
|
33135
33294
|
|
|
33136
33295
|
// src/components/Table/TableBody.tsx
|
|
33137
|
-
var
|
|
33296
|
+
var import_jsx_runtime339 = require("react/jsx-runtime");
|
|
33138
33297
|
var TableBody = (props) => {
|
|
33139
33298
|
const { children, className } = props;
|
|
33140
|
-
return /* @__PURE__ */ (0,
|
|
33299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime339.jsx)("tbody", { className, children });
|
|
33141
33300
|
};
|
|
33142
33301
|
TableBody.displayName = "TableBody";
|
|
33143
33302
|
var TableBody_default = TableBody;
|
|
33144
33303
|
|
|
33145
33304
|
// src/components/Table/TableCell.tsx
|
|
33146
|
-
var
|
|
33305
|
+
var import_react36 = __toESM(require("react"), 1);
|
|
33147
33306
|
|
|
33148
33307
|
// src/components/Table/TableHeadContext.tsx
|
|
33149
|
-
var
|
|
33150
|
-
var TableHeadContext =
|
|
33308
|
+
var import_react34 = __toESM(require("react"), 1);
|
|
33309
|
+
var TableHeadContext = import_react34.default.createContext(
|
|
33151
33310
|
null
|
|
33152
33311
|
);
|
|
33153
33312
|
var useTableHeadContext = () => {
|
|
33154
|
-
const ctx =
|
|
33313
|
+
const ctx = import_react34.default.useContext(TableHeadContext);
|
|
33155
33314
|
return ctx;
|
|
33156
33315
|
};
|
|
33157
33316
|
var TableHeadContext_default = TableHeadContext;
|
|
33158
33317
|
|
|
33159
33318
|
// src/components/Table/TableRowContext.tsx
|
|
33160
|
-
var
|
|
33161
|
-
var TableRowContext =
|
|
33319
|
+
var import_react35 = __toESM(require("react"), 1);
|
|
33320
|
+
var TableRowContext = import_react35.default.createContext(null);
|
|
33162
33321
|
var useTableRowContext = () => {
|
|
33163
|
-
const ctx =
|
|
33322
|
+
const ctx = import_react35.default.useContext(TableRowContext);
|
|
33164
33323
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
33165
33324
|
return ctx;
|
|
33166
33325
|
};
|
|
33167
33326
|
var TableRowContext_default = TableRowContext;
|
|
33168
33327
|
|
|
33169
33328
|
// src/components/Table/TableCell.tsx
|
|
33170
|
-
var
|
|
33329
|
+
var import_jsx_runtime340 = require("react/jsx-runtime");
|
|
33171
33330
|
var TableCell = (props) => {
|
|
33172
33331
|
const {
|
|
33173
33332
|
children,
|
|
@@ -33179,9 +33338,9 @@ var TableCell = (props) => {
|
|
|
33179
33338
|
const { registerStickyCell, stickyCells } = useTableRowContext();
|
|
33180
33339
|
const { stickyShadow } = useTableContext();
|
|
33181
33340
|
const headContext = useTableHeadContext();
|
|
33182
|
-
const [left, setLeft] =
|
|
33183
|
-
const cellRef =
|
|
33184
|
-
const calculateLeft =
|
|
33341
|
+
const [left, setLeft] = import_react36.default.useState(0);
|
|
33342
|
+
const cellRef = import_react36.default.useRef(null);
|
|
33343
|
+
const calculateLeft = import_react36.default.useCallback(() => {
|
|
33185
33344
|
if (!cellRef.current) return 0;
|
|
33186
33345
|
let totalLeft = 0;
|
|
33187
33346
|
for (const ref of stickyCells) {
|
|
@@ -33190,7 +33349,7 @@ var TableCell = (props) => {
|
|
|
33190
33349
|
}
|
|
33191
33350
|
return totalLeft;
|
|
33192
33351
|
}, [stickyCells]);
|
|
33193
|
-
|
|
33352
|
+
import_react36.default.useEffect(() => {
|
|
33194
33353
|
if (!isSticky || !cellRef.current) return;
|
|
33195
33354
|
registerStickyCell(cellRef);
|
|
33196
33355
|
setLeft(calculateLeft());
|
|
@@ -33208,7 +33367,7 @@ var TableCell = (props) => {
|
|
|
33208
33367
|
const CellTag = cellRef.current?.tagName === "TH" ? "th" : "td";
|
|
33209
33368
|
const isLastSticky = isSticky && stickyCells[stickyCells.length - 1] === cellRef;
|
|
33210
33369
|
const enableHover = headContext && headContext.cellHover;
|
|
33211
|
-
return /* @__PURE__ */ (0,
|
|
33370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime340.jsx)(
|
|
33212
33371
|
CellTag,
|
|
33213
33372
|
{
|
|
33214
33373
|
ref: cellRef,
|
|
@@ -33230,47 +33389,40 @@ TableCell.displayName = "TableCell";
|
|
|
33230
33389
|
var TableCell_default = TableCell;
|
|
33231
33390
|
|
|
33232
33391
|
// src/components/Table/TableHead.tsx
|
|
33233
|
-
var
|
|
33392
|
+
var import_jsx_runtime341 = require("react/jsx-runtime");
|
|
33234
33393
|
var TableHead = ({
|
|
33235
33394
|
children,
|
|
33236
33395
|
className = "",
|
|
33237
33396
|
cellHover = false
|
|
33238
33397
|
}) => {
|
|
33239
33398
|
const { headerSticky } = useTableContext();
|
|
33240
|
-
return /* @__PURE__ */ (0,
|
|
33399
|
+
return /* @__PURE__ */ (0, import_jsx_runtime341.jsx)(TableHeadContext_default.Provider, { value: { cellHover }, children: /* @__PURE__ */ (0, import_jsx_runtime341.jsx)("thead", { className: clsx_default(headerSticky ? "table-sticky" : null, className), children }) });
|
|
33241
33400
|
};
|
|
33242
33401
|
TableHead.displayName = "TableHead";
|
|
33243
33402
|
var TableHead_default = TableHead;
|
|
33244
33403
|
|
|
33245
33404
|
// src/components/Table/TableRow.tsx
|
|
33246
|
-
var
|
|
33247
|
-
var
|
|
33405
|
+
var import_react37 = __toESM(require("react"), 1);
|
|
33406
|
+
var import_jsx_runtime342 = require("react/jsx-runtime");
|
|
33248
33407
|
var TableRow = (props) => {
|
|
33249
33408
|
const {
|
|
33250
33409
|
children,
|
|
33251
33410
|
className,
|
|
33252
|
-
|
|
33253
|
-
color: color2 = "black",
|
|
33254
|
-
colorDepth,
|
|
33255
|
-
colorToken,
|
|
33411
|
+
color: color2 = "xplat-neutral-900",
|
|
33256
33412
|
type = "secondary",
|
|
33257
33413
|
isHover,
|
|
33258
33414
|
onClick
|
|
33259
33415
|
} = props;
|
|
33260
33416
|
const { rowBorderUse } = useTableContext();
|
|
33261
|
-
const [stickyCells, setStickyCells] =
|
|
33417
|
+
const [stickyCells, setStickyCells] = import_react37.default.useState([]);
|
|
33262
33418
|
const registerStickyCell = (ref) => {
|
|
33263
33419
|
setStickyCells((prev) => {
|
|
33264
33420
|
if (prev.includes(ref)) return prev;
|
|
33265
33421
|
return [...prev, ref];
|
|
33266
33422
|
});
|
|
33267
33423
|
};
|
|
33268
|
-
const colorClass =
|
|
33269
|
-
|
|
33270
|
-
color2,
|
|
33271
|
-
colorDepth ?? 500
|
|
33272
|
-
);
|
|
33273
|
-
return /* @__PURE__ */ (0, import_jsx_runtime341.jsx)(TableRowContext_default.Provider, { value: { stickyCells, registerStickyCell }, children: /* @__PURE__ */ (0, import_jsx_runtime341.jsx)(
|
|
33424
|
+
const colorClass = color2;
|
|
33425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime342.jsx)(TableRowContext_default.Provider, { value: { stickyCells, registerStickyCell }, children: /* @__PURE__ */ (0, import_jsx_runtime342.jsx)(
|
|
33274
33426
|
"tr",
|
|
33275
33427
|
{
|
|
33276
33428
|
className: clsx_default(
|
|
@@ -33290,38 +33442,31 @@ TableRow.displayName = "TableRow";
|
|
|
33290
33442
|
var TableRow_default = TableRow;
|
|
33291
33443
|
|
|
33292
33444
|
// src/components/Tag/Tag.tsx
|
|
33293
|
-
var
|
|
33445
|
+
var import_jsx_runtime343 = require("react/jsx-runtime");
|
|
33294
33446
|
var Tag = (props) => {
|
|
33295
33447
|
const {
|
|
33296
33448
|
children,
|
|
33297
33449
|
onClose,
|
|
33298
33450
|
size: size4 = "md",
|
|
33299
|
-
|
|
33300
|
-
color: color2 = "neutral",
|
|
33301
|
-
colorDepth,
|
|
33302
|
-
colorToken,
|
|
33451
|
+
color: color2 = "xplat-neutral-500",
|
|
33303
33452
|
className
|
|
33304
33453
|
} = props;
|
|
33305
|
-
const colorClass =
|
|
33306
|
-
|
|
33307
|
-
|
|
33308
|
-
|
|
33309
|
-
);
|
|
33310
|
-
return /* @__PURE__ */ (0, import_jsx_runtime342.jsxs)("span", { className: clsx_default("lib-xplat-tag", size4, colorClass, className), children: [
|
|
33311
|
-
/* @__PURE__ */ (0, import_jsx_runtime342.jsx)("span", { className: "tag-label", children }),
|
|
33312
|
-
onClose && /* @__PURE__ */ (0, import_jsx_runtime342.jsx)("button", { className: "tag-close", onClick: onClose, "aria-label": "\uC0AD\uC81C", children: /* @__PURE__ */ (0, import_jsx_runtime342.jsx)(XIcon_default, {}) })
|
|
33454
|
+
const colorClass = color2;
|
|
33455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime343.jsxs)("span", { className: clsx_default("lib-xplat-tag", size4, colorClass, className), children: [
|
|
33456
|
+
/* @__PURE__ */ (0, import_jsx_runtime343.jsx)("span", { className: "tag-label", children }),
|
|
33457
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime343.jsx)("button", { className: "tag-close", onClick: onClose, "aria-label": "\uC0AD\uC81C", children: /* @__PURE__ */ (0, import_jsx_runtime343.jsx)(XIcon_default, {}) })
|
|
33313
33458
|
] });
|
|
33314
33459
|
};
|
|
33315
33460
|
Tag.displayName = "Tag";
|
|
33316
33461
|
var Tag_default = Tag;
|
|
33317
33462
|
|
|
33318
33463
|
// src/components/TextArea/TextArea.tsx
|
|
33319
|
-
var
|
|
33320
|
-
var
|
|
33321
|
-
var TextArea =
|
|
33464
|
+
var import_react38 = __toESM(require("react"), 1);
|
|
33465
|
+
var import_jsx_runtime344 = require("react/jsx-runtime");
|
|
33466
|
+
var TextArea = import_react38.default.forwardRef(
|
|
33322
33467
|
(props, ref) => {
|
|
33323
33468
|
const { value, onChange, className, disabled, ...textareaProps } = props;
|
|
33324
|
-
const localRef =
|
|
33469
|
+
const localRef = import_react38.default.useRef(null);
|
|
33325
33470
|
const setRefs = (el) => {
|
|
33326
33471
|
localRef.current = el;
|
|
33327
33472
|
if (!ref) return;
|
|
@@ -33341,21 +33486,21 @@ var TextArea = import_react37.default.forwardRef(
|
|
|
33341
33486
|
onChange(event);
|
|
33342
33487
|
}
|
|
33343
33488
|
};
|
|
33344
|
-
|
|
33489
|
+
import_react38.default.useEffect(() => {
|
|
33345
33490
|
const el = localRef.current;
|
|
33346
33491
|
if (!el) return;
|
|
33347
33492
|
el.style.height = "0px";
|
|
33348
33493
|
const nextHeight = Math.min(el.scrollHeight, 400);
|
|
33349
33494
|
el.style.height = `${nextHeight}px`;
|
|
33350
33495
|
}, [value]);
|
|
33351
|
-
return /* @__PURE__ */ (0,
|
|
33496
|
+
return /* @__PURE__ */ (0, import_jsx_runtime344.jsx)("div", { className: clsx_default("lib-xplat-textarea-wrapper", className), children: /* @__PURE__ */ (0, import_jsx_runtime344.jsx)(
|
|
33352
33497
|
"div",
|
|
33353
33498
|
{
|
|
33354
33499
|
className: clsx_default(
|
|
33355
33500
|
"lib-xplat-textarea",
|
|
33356
33501
|
disabled ? "disabled" : void 0
|
|
33357
33502
|
),
|
|
33358
|
-
children: /* @__PURE__ */ (0,
|
|
33503
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime344.jsx)(
|
|
33359
33504
|
"textarea",
|
|
33360
33505
|
{
|
|
33361
33506
|
...textareaProps,
|
|
@@ -33373,25 +33518,25 @@ TextArea.displayName = "TextArea";
|
|
|
33373
33518
|
var TextArea_default = TextArea;
|
|
33374
33519
|
|
|
33375
33520
|
// src/components/Toast/Toast.tsx
|
|
33376
|
-
var
|
|
33521
|
+
var import_react39 = __toESM(require("react"), 1);
|
|
33377
33522
|
var import_react_dom6 = require("react-dom");
|
|
33378
|
-
var
|
|
33379
|
-
var ToastContext =
|
|
33523
|
+
var import_jsx_runtime345 = require("react/jsx-runtime");
|
|
33524
|
+
var ToastContext = import_react39.default.createContext(null);
|
|
33380
33525
|
var useToast = () => {
|
|
33381
|
-
const ctx =
|
|
33526
|
+
const ctx = import_react39.default.useContext(ToastContext);
|
|
33382
33527
|
if (!ctx) throw new Error("useToast must be used within ToastProvider");
|
|
33383
33528
|
return ctx;
|
|
33384
33529
|
};
|
|
33385
33530
|
var EXIT_DURATION = 300;
|
|
33386
33531
|
var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
33387
|
-
const ref =
|
|
33388
|
-
const [height, setHeight] =
|
|
33389
|
-
|
|
33532
|
+
const ref = import_react39.default.useRef(null);
|
|
33533
|
+
const [height, setHeight] = import_react39.default.useState(void 0);
|
|
33534
|
+
import_react39.default.useEffect(() => {
|
|
33390
33535
|
if (ref.current && !isExiting) {
|
|
33391
33536
|
setHeight(ref.current.offsetHeight);
|
|
33392
33537
|
}
|
|
33393
33538
|
}, [isExiting]);
|
|
33394
|
-
return /* @__PURE__ */ (0,
|
|
33539
|
+
return /* @__PURE__ */ (0, import_jsx_runtime345.jsx)(
|
|
33395
33540
|
"div",
|
|
33396
33541
|
{
|
|
33397
33542
|
className: clsx_default("lib-xplat-toast-wrapper", { exit: isExiting }),
|
|
@@ -33399,15 +33544,15 @@ var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
|
33399
33544
|
maxHeight: isExiting ? 0 : height ?? "none",
|
|
33400
33545
|
marginBottom: isExiting ? 0 : void 0
|
|
33401
33546
|
},
|
|
33402
|
-
children: /* @__PURE__ */ (0,
|
|
33547
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime345.jsxs)(
|
|
33403
33548
|
"div",
|
|
33404
33549
|
{
|
|
33405
33550
|
ref,
|
|
33406
33551
|
className: clsx_default("lib-xplat-toast", item.type, { exit: isExiting }),
|
|
33407
33552
|
role: "alert",
|
|
33408
33553
|
children: [
|
|
33409
|
-
/* @__PURE__ */ (0,
|
|
33410
|
-
/* @__PURE__ */ (0,
|
|
33554
|
+
/* @__PURE__ */ (0, import_jsx_runtime345.jsx)("span", { className: "message", children: item.message }),
|
|
33555
|
+
/* @__PURE__ */ (0, import_jsx_runtime345.jsx)("button", { className: "close-btn", onClick: onClose, "aria-label": "\uB2EB\uAE30", children: "\xD7" })
|
|
33411
33556
|
]
|
|
33412
33557
|
}
|
|
33413
33558
|
)
|
|
@@ -33418,13 +33563,13 @@ var ToastProvider = ({
|
|
|
33418
33563
|
children,
|
|
33419
33564
|
position = "top-right"
|
|
33420
33565
|
}) => {
|
|
33421
|
-
const [toasts, setToasts] =
|
|
33422
|
-
const [removing, setRemoving] =
|
|
33423
|
-
const [mounted, setMounted] =
|
|
33424
|
-
|
|
33566
|
+
const [toasts, setToasts] = import_react39.default.useState([]);
|
|
33567
|
+
const [removing, setRemoving] = import_react39.default.useState(/* @__PURE__ */ new Set());
|
|
33568
|
+
const [mounted, setMounted] = import_react39.default.useState(false);
|
|
33569
|
+
import_react39.default.useEffect(() => {
|
|
33425
33570
|
setMounted(true);
|
|
33426
33571
|
}, []);
|
|
33427
|
-
const remove =
|
|
33572
|
+
const remove = import_react39.default.useCallback((id) => {
|
|
33428
33573
|
setRemoving((prev) => new Set(prev).add(id));
|
|
33429
33574
|
setTimeout(() => {
|
|
33430
33575
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
@@ -33435,7 +33580,7 @@ var ToastProvider = ({
|
|
|
33435
33580
|
});
|
|
33436
33581
|
}, EXIT_DURATION);
|
|
33437
33582
|
}, []);
|
|
33438
|
-
const toast =
|
|
33583
|
+
const toast = import_react39.default.useCallback(
|
|
33439
33584
|
(type, message2, duration = 3e3) => {
|
|
33440
33585
|
const id = `${Date.now()}-${Math.random()}`;
|
|
33441
33586
|
setToasts((prev) => [...prev, { id, type, message: message2 }]);
|
|
@@ -33445,10 +33590,10 @@ var ToastProvider = ({
|
|
|
33445
33590
|
},
|
|
33446
33591
|
[remove]
|
|
33447
33592
|
);
|
|
33448
|
-
return /* @__PURE__ */ (0,
|
|
33593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime345.jsxs)(ToastContext.Provider, { value: { toast }, children: [
|
|
33449
33594
|
children,
|
|
33450
33595
|
mounted && (0, import_react_dom6.createPortal)(
|
|
33451
|
-
/* @__PURE__ */ (0,
|
|
33596
|
+
/* @__PURE__ */ (0, import_jsx_runtime345.jsx)("div", { className: clsx_default("lib-xplat-toast-container", position), children: toasts.map((t) => /* @__PURE__ */ (0, import_jsx_runtime345.jsx)(
|
|
33452
33597
|
ToastItemComponent,
|
|
33453
33598
|
{
|
|
33454
33599
|
item: t,
|
|
@@ -33464,36 +33609,29 @@ var ToastProvider = ({
|
|
|
33464
33609
|
ToastProvider.displayName = "ToastProvider";
|
|
33465
33610
|
|
|
33466
33611
|
// src/components/Tooltip/Tooltip.tsx
|
|
33467
|
-
var
|
|
33468
|
-
var
|
|
33612
|
+
var import_react40 = __toESM(require("react"), 1);
|
|
33613
|
+
var import_jsx_runtime346 = require("react/jsx-runtime");
|
|
33469
33614
|
var Tooltip2 = (props) => {
|
|
33470
33615
|
const {
|
|
33471
33616
|
type = "primary",
|
|
33472
|
-
|
|
33473
|
-
color: color2 = "blue",
|
|
33474
|
-
colorDepth,
|
|
33475
|
-
colorToken,
|
|
33617
|
+
color: color2 = "xplat-neutral-900",
|
|
33476
33618
|
description,
|
|
33477
33619
|
children
|
|
33478
33620
|
} = props;
|
|
33479
|
-
const iconRef =
|
|
33480
|
-
const colorClass =
|
|
33481
|
-
|
|
33482
|
-
|
|
33483
|
-
|
|
33484
|
-
);
|
|
33485
|
-
return /* @__PURE__ */ (0, import_jsx_runtime345.jsxs)("div", { className: "lib-xplat-tooltip", children: [
|
|
33486
|
-
/* @__PURE__ */ (0, import_jsx_runtime345.jsx)("div", { className: "tooltip-content", ref: iconRef, children: children || "Tooltip" }),
|
|
33487
|
-
/* @__PURE__ */ (0, import_jsx_runtime345.jsx)("div", { className: clsx_default("tooltip-wrapper", colorClass, type), children: description })
|
|
33621
|
+
const iconRef = import_react40.default.useRef(null);
|
|
33622
|
+
const colorClass = color2;
|
|
33623
|
+
return /* @__PURE__ */ (0, import_jsx_runtime346.jsxs)("div", { className: "lib-xplat-tooltip", children: [
|
|
33624
|
+
/* @__PURE__ */ (0, import_jsx_runtime346.jsx)("div", { className: "tooltip-content", ref: iconRef, children: children || "Tooltip" }),
|
|
33625
|
+
/* @__PURE__ */ (0, import_jsx_runtime346.jsx)("div", { className: clsx_default("tooltip-wrapper", colorClass, type), children: description })
|
|
33488
33626
|
] });
|
|
33489
33627
|
};
|
|
33490
33628
|
Tooltip2.displayName = "Tooltip";
|
|
33491
33629
|
var Tooltip_default = Tooltip2;
|
|
33492
33630
|
|
|
33493
33631
|
// src/components/Video/Video.tsx
|
|
33494
|
-
var
|
|
33495
|
-
var
|
|
33496
|
-
var Video =
|
|
33632
|
+
var import_react41 = __toESM(require("react"), 1);
|
|
33633
|
+
var import_jsx_runtime347 = require("react/jsx-runtime");
|
|
33634
|
+
var Video = import_react41.default.forwardRef((props, ref) => {
|
|
33497
33635
|
const {
|
|
33498
33636
|
src,
|
|
33499
33637
|
poster,
|
|
@@ -33507,10 +33645,10 @@ var Video = import_react40.default.forwardRef((props, ref) => {
|
|
|
33507
33645
|
onPause,
|
|
33508
33646
|
...rest
|
|
33509
33647
|
} = props;
|
|
33510
|
-
const videoRef =
|
|
33511
|
-
const [isPlaying, setIsPlaying] =
|
|
33512
|
-
const [isLoaded, setIsLoaded] =
|
|
33513
|
-
const setRefs =
|
|
33648
|
+
const videoRef = import_react41.default.useRef(null);
|
|
33649
|
+
const [isPlaying, setIsPlaying] = import_react41.default.useState(Boolean(autoPlay));
|
|
33650
|
+
const [isLoaded, setIsLoaded] = import_react41.default.useState(false);
|
|
33651
|
+
const setRefs = import_react41.default.useCallback(
|
|
33514
33652
|
(el) => {
|
|
33515
33653
|
videoRef.current = el;
|
|
33516
33654
|
if (typeof ref === "function") ref(el);
|
|
@@ -33538,7 +33676,7 @@ var Video = import_react40.default.forwardRef((props, ref) => {
|
|
|
33538
33676
|
}
|
|
33539
33677
|
};
|
|
33540
33678
|
const showCustomOverlay = !controls;
|
|
33541
|
-
return /* @__PURE__ */ (0,
|
|
33679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime347.jsxs)(
|
|
33542
33680
|
"div",
|
|
33543
33681
|
{
|
|
33544
33682
|
className: clsx_default(
|
|
@@ -33547,7 +33685,7 @@ var Video = import_react40.default.forwardRef((props, ref) => {
|
|
|
33547
33685
|
className
|
|
33548
33686
|
),
|
|
33549
33687
|
children: [
|
|
33550
|
-
/* @__PURE__ */ (0,
|
|
33688
|
+
/* @__PURE__ */ (0, import_jsx_runtime347.jsx)(
|
|
33551
33689
|
"video",
|
|
33552
33690
|
{
|
|
33553
33691
|
ref: setRefs,
|
|
@@ -33564,7 +33702,7 @@ var Video = import_react40.default.forwardRef((props, ref) => {
|
|
|
33564
33702
|
...rest
|
|
33565
33703
|
}
|
|
33566
33704
|
),
|
|
33567
|
-
showCustomOverlay && /* @__PURE__ */ (0,
|
|
33705
|
+
showCustomOverlay && /* @__PURE__ */ (0, import_jsx_runtime347.jsx)(
|
|
33568
33706
|
"button",
|
|
33569
33707
|
{
|
|
33570
33708
|
type: "button",
|
|
@@ -33575,7 +33713,7 @@ var Video = import_react40.default.forwardRef((props, ref) => {
|
|
|
33575
33713
|
),
|
|
33576
33714
|
onClick: togglePlay,
|
|
33577
33715
|
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
33578
|
-
children: isPlaying ? /* @__PURE__ */ (0,
|
|
33716
|
+
children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime347.jsx)(PauseIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime347.jsx)("span", { className: "play-icon", children: /* @__PURE__ */ (0, import_jsx_runtime347.jsx)(PlayCircleIcon_default, {}) })
|
|
33579
33717
|
}
|
|
33580
33718
|
)
|
|
33581
33719
|
]
|
|
@@ -33586,25 +33724,25 @@ Video.displayName = "Video";
|
|
|
33586
33724
|
var Video_default = Video;
|
|
33587
33725
|
|
|
33588
33726
|
// src/layout/Grid/FullGrid/FullGrid.tsx
|
|
33589
|
-
var
|
|
33727
|
+
var import_jsx_runtime348 = require("react/jsx-runtime");
|
|
33590
33728
|
var FullGrid = (props) => {
|
|
33591
33729
|
const { children, className } = props;
|
|
33592
|
-
return /* @__PURE__ */ (0,
|
|
33730
|
+
return /* @__PURE__ */ (0, import_jsx_runtime348.jsx)("div", { className: clsx_default("lib-xplat-full-grid", className), children });
|
|
33593
33731
|
};
|
|
33594
33732
|
FullGrid.displayName = "FullGrid";
|
|
33595
33733
|
var FullGrid_default = FullGrid;
|
|
33596
33734
|
|
|
33597
33735
|
// src/layout/Grid/FullScreen/FullScreen.tsx
|
|
33598
|
-
var
|
|
33736
|
+
var import_jsx_runtime349 = require("react/jsx-runtime");
|
|
33599
33737
|
var FullScreen = (props) => {
|
|
33600
33738
|
const { children, className } = props;
|
|
33601
|
-
return /* @__PURE__ */ (0,
|
|
33739
|
+
return /* @__PURE__ */ (0, import_jsx_runtime349.jsx)("div", { className: clsx_default("lib-xplat-full-screen", className), children });
|
|
33602
33740
|
};
|
|
33603
33741
|
FullScreen.displayName = "FullScreen";
|
|
33604
33742
|
var FullScreen_default = FullScreen;
|
|
33605
33743
|
|
|
33606
33744
|
// src/layout/Grid/Item/Item.tsx
|
|
33607
|
-
var
|
|
33745
|
+
var import_jsx_runtime350 = require("react/jsx-runtime");
|
|
33608
33746
|
var calculateSpans = (column) => {
|
|
33609
33747
|
const spans = {};
|
|
33610
33748
|
let inherited = column.default;
|
|
@@ -33621,35 +33759,35 @@ var GridItem = ({ column, children, className }) => {
|
|
|
33621
33759
|
Object.entries(spans).forEach(([key, value]) => {
|
|
33622
33760
|
style[`--column-${key}`] = value;
|
|
33623
33761
|
});
|
|
33624
|
-
return /* @__PURE__ */ (0,
|
|
33762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime350.jsx)("div", { className: clsx_default("lib-xplat-grid-item", className), style, children });
|
|
33625
33763
|
};
|
|
33626
33764
|
GridItem.displayName = "GridItem";
|
|
33627
33765
|
var Item_default = GridItem;
|
|
33628
33766
|
|
|
33629
33767
|
// src/layout/Header/Header.tsx
|
|
33630
|
-
var
|
|
33768
|
+
var import_jsx_runtime351 = require("react/jsx-runtime");
|
|
33631
33769
|
var Header = ({
|
|
33632
33770
|
logo,
|
|
33633
33771
|
centerContent,
|
|
33634
33772
|
rightContent
|
|
33635
33773
|
}) => {
|
|
33636
|
-
return /* @__PURE__ */ (0,
|
|
33637
|
-
/* @__PURE__ */ (0,
|
|
33638
|
-
/* @__PURE__ */ (0,
|
|
33639
|
-
/* @__PURE__ */ (0,
|
|
33774
|
+
return /* @__PURE__ */ (0, import_jsx_runtime351.jsxs)("div", { className: "lib-xplat-layout-header", children: [
|
|
33775
|
+
/* @__PURE__ */ (0, import_jsx_runtime351.jsx)("div", { children: logo }),
|
|
33776
|
+
/* @__PURE__ */ (0, import_jsx_runtime351.jsx)("div", { children: centerContent }),
|
|
33777
|
+
/* @__PURE__ */ (0, import_jsx_runtime351.jsx)("div", { children: rightContent })
|
|
33640
33778
|
] });
|
|
33641
33779
|
};
|
|
33642
33780
|
Header.displayName = "Header";
|
|
33643
33781
|
var Header_default = Header;
|
|
33644
33782
|
|
|
33645
33783
|
// src/layout/Layout/Layout.tsx
|
|
33646
|
-
var
|
|
33784
|
+
var import_jsx_runtime352 = require("react/jsx-runtime");
|
|
33647
33785
|
var Layout = (props) => {
|
|
33648
33786
|
const { header, sideBar, children } = props;
|
|
33649
|
-
return /* @__PURE__ */ (0,
|
|
33650
|
-
sideBar && /* @__PURE__ */ (0,
|
|
33651
|
-
/* @__PURE__ */ (0,
|
|
33652
|
-
header && /* @__PURE__ */ (0,
|
|
33787
|
+
return /* @__PURE__ */ (0, import_jsx_runtime352.jsx)("div", { className: "lib-xplat-layout", children: /* @__PURE__ */ (0, import_jsx_runtime352.jsxs)("div", { className: "lib-xplat-layout-content-wrapper", children: [
|
|
33788
|
+
sideBar && /* @__PURE__ */ (0, import_jsx_runtime352.jsx)(import_jsx_runtime352.Fragment, { children: sideBar }),
|
|
33789
|
+
/* @__PURE__ */ (0, import_jsx_runtime352.jsxs)("div", { className: "lib-xplat-layout-content", children: [
|
|
33790
|
+
header && /* @__PURE__ */ (0, import_jsx_runtime352.jsx)("div", { className: "lib-xplat-layout-conent-header", children: header }),
|
|
33653
33791
|
children
|
|
33654
33792
|
] })
|
|
33655
33793
|
] }) });
|
|
@@ -33658,31 +33796,31 @@ Layout.displayName = "Layout";
|
|
|
33658
33796
|
var Layout_default = Layout;
|
|
33659
33797
|
|
|
33660
33798
|
// src/layout/SideBar/SideBar.tsx
|
|
33661
|
-
var
|
|
33799
|
+
var import_react43 = __toESM(require("react"), 1);
|
|
33662
33800
|
|
|
33663
33801
|
// src/layout/SideBar/SideBarContext.tsx
|
|
33664
|
-
var
|
|
33665
|
-
var SideBarContext =
|
|
33802
|
+
var import_react42 = __toESM(require("react"), 1);
|
|
33803
|
+
var SideBarContext = import_react42.default.createContext(null);
|
|
33666
33804
|
var useSideBarContext = () => {
|
|
33667
|
-
const ctx =
|
|
33805
|
+
const ctx = import_react42.default.useContext(SideBarContext);
|
|
33668
33806
|
if (!ctx) throw new Error("Error");
|
|
33669
33807
|
return ctx;
|
|
33670
33808
|
};
|
|
33671
33809
|
var SideBarContext_default = SideBarContext;
|
|
33672
33810
|
|
|
33673
33811
|
// src/layout/SideBar/SideBar.tsx
|
|
33674
|
-
var
|
|
33812
|
+
var import_jsx_runtime353 = require("react/jsx-runtime");
|
|
33675
33813
|
var SideBar = (props) => {
|
|
33676
33814
|
const { children, className } = props;
|
|
33677
|
-
const [isOpen, setIsOpen] =
|
|
33815
|
+
const [isOpen, setIsOpen] = import_react43.default.useState(true);
|
|
33678
33816
|
const handleSwitchSideBar = () => {
|
|
33679
33817
|
setIsOpen((prev) => !prev);
|
|
33680
33818
|
};
|
|
33681
|
-
return /* @__PURE__ */ (0,
|
|
33819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime353.jsx)(
|
|
33682
33820
|
SideBarContext_default.Provider,
|
|
33683
33821
|
{
|
|
33684
33822
|
value: { isSidebarOpen: isOpen, handleSwitchSideBar },
|
|
33685
|
-
children: /* @__PURE__ */ (0,
|
|
33823
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime353.jsx)(
|
|
33686
33824
|
"div",
|
|
33687
33825
|
{
|
|
33688
33826
|
className: clsx_default(
|
|
@@ -33985,6 +34123,7 @@ var SideBar_default = SideBar;
|
|
|
33985
34123
|
SunIcon,
|
|
33986
34124
|
SunriseIcon,
|
|
33987
34125
|
SunsetIcon,
|
|
34126
|
+
Swiper,
|
|
33988
34127
|
Switch,
|
|
33989
34128
|
Tab,
|
|
33990
34129
|
Table,
|