@x-plat/design-system 0.3.0 → 0.3.3
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/Accordion/index.css +3 -0
- 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/Table/index.cjs +1 -1
- package/dist/components/Table/index.js +1 -1
- package/dist/components/index.cjs +356 -93
- package/dist/components/index.css +74 -0
- package/dist/components/index.d.cts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +356 -94
- package/dist/index.cjs +380 -117
- package/dist/index.css +74 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +380 -118
- 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,
|
|
@@ -32874,9 +32875,270 @@ var Steps = (props) => {
|
|
|
32874
32875
|
Steps.displayName = "Steps";
|
|
32875
32876
|
var Steps_default = Steps;
|
|
32876
32877
|
|
|
32877
|
-
// src/components/
|
|
32878
|
+
// src/components/Swiper/Swiper.tsx
|
|
32878
32879
|
var import_react29 = __toESM(require("react"), 1);
|
|
32879
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");
|
|
32880
33142
|
var KNOB_TRANSITION_MS = 250;
|
|
32881
33143
|
var Switch = (props) => {
|
|
32882
33144
|
const {
|
|
@@ -32887,9 +33149,9 @@ var Switch = (props) => {
|
|
|
32887
33149
|
color: color2 = "xplat-blue-500",
|
|
32888
33150
|
className
|
|
32889
33151
|
} = props;
|
|
32890
|
-
const [isAnimating, setIsAnimating] =
|
|
32891
|
-
const timeoutRef =
|
|
32892
|
-
|
|
33152
|
+
const [isAnimating, setIsAnimating] = import_react30.default.useState(false);
|
|
33153
|
+
const timeoutRef = import_react30.default.useRef(null);
|
|
33154
|
+
import_react30.default.useEffect(() => {
|
|
32893
33155
|
return () => {
|
|
32894
33156
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
32895
33157
|
};
|
|
@@ -32905,7 +33167,7 @@ var Switch = (props) => {
|
|
|
32905
33167
|
}, KNOB_TRANSITION_MS);
|
|
32906
33168
|
};
|
|
32907
33169
|
const colorClass = color2;
|
|
32908
|
-
return /* @__PURE__ */ (0,
|
|
33170
|
+
return /* @__PURE__ */ (0, import_jsx_runtime335.jsx)(
|
|
32909
33171
|
"div",
|
|
32910
33172
|
{
|
|
32911
33173
|
className: clsx_default(
|
|
@@ -32919,7 +33181,7 @@ var Switch = (props) => {
|
|
|
32919
33181
|
),
|
|
32920
33182
|
onClick: handleClick,
|
|
32921
33183
|
"aria-disabled": disabled || isAnimating,
|
|
32922
|
-
children: /* @__PURE__ */ (0,
|
|
33184
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime335.jsx)("div", { className: clsx_default("knob", value ? "checked" : void 0) })
|
|
32923
33185
|
}
|
|
32924
33186
|
);
|
|
32925
33187
|
};
|
|
@@ -32927,14 +33189,14 @@ Switch.displayName = "Switch";
|
|
|
32927
33189
|
var Switch_default = Switch;
|
|
32928
33190
|
|
|
32929
33191
|
// src/components/Tab/Tab.tsx
|
|
32930
|
-
var
|
|
33192
|
+
var import_react32 = __toESM(require("react"), 1);
|
|
32931
33193
|
|
|
32932
33194
|
// src/components/Tab/TabItem.tsx
|
|
32933
|
-
var
|
|
32934
|
-
var
|
|
32935
|
-
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) => {
|
|
32936
33198
|
const { isActive, title, onClick } = props;
|
|
32937
|
-
return /* @__PURE__ */ (0,
|
|
33199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(
|
|
32938
33200
|
"div",
|
|
32939
33201
|
{
|
|
32940
33202
|
ref,
|
|
@@ -32948,25 +33210,25 @@ TabItem.displayName = "TabItem";
|
|
|
32948
33210
|
var TabItem_default = TabItem;
|
|
32949
33211
|
|
|
32950
33212
|
// src/components/Tab/Tab.tsx
|
|
32951
|
-
var
|
|
33213
|
+
var import_jsx_runtime337 = require("react/jsx-runtime");
|
|
32952
33214
|
var Tab = (props) => {
|
|
32953
33215
|
const { activeIndex, onChange, tabs, type, size: size4 = "md" } = props;
|
|
32954
|
-
const [underlineStyle, setUnderlineStyle] =
|
|
33216
|
+
const [underlineStyle, setUnderlineStyle] = import_react32.default.useState({
|
|
32955
33217
|
left: 0,
|
|
32956
33218
|
width: 0
|
|
32957
33219
|
});
|
|
32958
|
-
const itemRefs =
|
|
33220
|
+
const itemRefs = import_react32.default.useRef([]);
|
|
32959
33221
|
const handleChangeActiveTab = (tabItem, tabIdx) => {
|
|
32960
33222
|
onChange(tabItem, tabIdx);
|
|
32961
33223
|
};
|
|
32962
|
-
|
|
33224
|
+
import_react32.default.useEffect(() => {
|
|
32963
33225
|
const el = itemRefs.current[activeIndex];
|
|
32964
33226
|
if (el) {
|
|
32965
33227
|
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
32966
33228
|
}
|
|
32967
33229
|
}, [activeIndex, tabs.length]);
|
|
32968
|
-
return /* @__PURE__ */ (0,
|
|
32969
|
-
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)(
|
|
32970
33232
|
TabItem_default,
|
|
32971
33233
|
{
|
|
32972
33234
|
onClick: () => handleChangeActiveTab(tab, idx),
|
|
@@ -32978,7 +33240,7 @@ var Tab = (props) => {
|
|
|
32978
33240
|
},
|
|
32979
33241
|
`${tab.value}_${idx}`
|
|
32980
33242
|
)),
|
|
32981
|
-
type === "toggle" && /* @__PURE__ */ (0,
|
|
33243
|
+
type === "toggle" && /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
32982
33244
|
"div",
|
|
32983
33245
|
{
|
|
32984
33246
|
className: "tab-toggle-underline",
|
|
@@ -32994,17 +33256,17 @@ Tab.displayName = "Tab";
|
|
|
32994
33256
|
var Tab_default = Tab;
|
|
32995
33257
|
|
|
32996
33258
|
// src/components/Table/TableContext.tsx
|
|
32997
|
-
var
|
|
32998
|
-
var TableContext =
|
|
33259
|
+
var import_react33 = __toESM(require("react"), 1);
|
|
33260
|
+
var TableContext = import_react33.default.createContext(null);
|
|
32999
33261
|
var useTableContext = () => {
|
|
33000
|
-
const ctx =
|
|
33262
|
+
const ctx = import_react33.default.useContext(TableContext);
|
|
33001
33263
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
33002
33264
|
return ctx;
|
|
33003
33265
|
};
|
|
33004
33266
|
var TableContext_default = TableContext;
|
|
33005
33267
|
|
|
33006
33268
|
// src/components/Table/Table.tsx
|
|
33007
|
-
var
|
|
33269
|
+
var import_jsx_runtime338 = require("react/jsx-runtime");
|
|
33008
33270
|
var Table = (props) => {
|
|
33009
33271
|
const {
|
|
33010
33272
|
className,
|
|
@@ -33014,7 +33276,7 @@ var Table = (props) => {
|
|
|
33014
33276
|
headerSticky = false,
|
|
33015
33277
|
stickyShadow = true
|
|
33016
33278
|
} = props;
|
|
33017
|
-
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)(
|
|
33018
33280
|
TableContext_default.Provider,
|
|
33019
33281
|
{
|
|
33020
33282
|
value: {
|
|
@@ -33023,7 +33285,7 @@ var Table = (props) => {
|
|
|
33023
33285
|
headerSticky,
|
|
33024
33286
|
stickyShadow
|
|
33025
33287
|
},
|
|
33026
|
-
children: /* @__PURE__ */ (0,
|
|
33288
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime338.jsx)("table", { className: "lib-xplat-table", children })
|
|
33027
33289
|
}
|
|
33028
33290
|
) });
|
|
33029
33291
|
};
|
|
@@ -33031,40 +33293,40 @@ Table.displayName = "Table";
|
|
|
33031
33293
|
var Table_default = Table;
|
|
33032
33294
|
|
|
33033
33295
|
// src/components/Table/TableBody.tsx
|
|
33034
|
-
var
|
|
33296
|
+
var import_jsx_runtime339 = require("react/jsx-runtime");
|
|
33035
33297
|
var TableBody = (props) => {
|
|
33036
33298
|
const { children, className } = props;
|
|
33037
|
-
return /* @__PURE__ */ (0,
|
|
33299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime339.jsx)("tbody", { className, children });
|
|
33038
33300
|
};
|
|
33039
33301
|
TableBody.displayName = "TableBody";
|
|
33040
33302
|
var TableBody_default = TableBody;
|
|
33041
33303
|
|
|
33042
33304
|
// src/components/Table/TableCell.tsx
|
|
33043
|
-
var
|
|
33305
|
+
var import_react36 = __toESM(require("react"), 1);
|
|
33044
33306
|
|
|
33045
33307
|
// src/components/Table/TableHeadContext.tsx
|
|
33046
|
-
var
|
|
33047
|
-
var TableHeadContext =
|
|
33308
|
+
var import_react34 = __toESM(require("react"), 1);
|
|
33309
|
+
var TableHeadContext = import_react34.default.createContext(
|
|
33048
33310
|
null
|
|
33049
33311
|
);
|
|
33050
33312
|
var useTableHeadContext = () => {
|
|
33051
|
-
const ctx =
|
|
33313
|
+
const ctx = import_react34.default.useContext(TableHeadContext);
|
|
33052
33314
|
return ctx;
|
|
33053
33315
|
};
|
|
33054
33316
|
var TableHeadContext_default = TableHeadContext;
|
|
33055
33317
|
|
|
33056
33318
|
// src/components/Table/TableRowContext.tsx
|
|
33057
|
-
var
|
|
33058
|
-
var TableRowContext =
|
|
33319
|
+
var import_react35 = __toESM(require("react"), 1);
|
|
33320
|
+
var TableRowContext = import_react35.default.createContext(null);
|
|
33059
33321
|
var useTableRowContext = () => {
|
|
33060
|
-
const ctx =
|
|
33322
|
+
const ctx = import_react35.default.useContext(TableRowContext);
|
|
33061
33323
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
33062
33324
|
return ctx;
|
|
33063
33325
|
};
|
|
33064
33326
|
var TableRowContext_default = TableRowContext;
|
|
33065
33327
|
|
|
33066
33328
|
// src/components/Table/TableCell.tsx
|
|
33067
|
-
var
|
|
33329
|
+
var import_jsx_runtime340 = require("react/jsx-runtime");
|
|
33068
33330
|
var TableCell = (props) => {
|
|
33069
33331
|
const {
|
|
33070
33332
|
children,
|
|
@@ -33076,9 +33338,9 @@ var TableCell = (props) => {
|
|
|
33076
33338
|
const { registerStickyCell, stickyCells } = useTableRowContext();
|
|
33077
33339
|
const { stickyShadow } = useTableContext();
|
|
33078
33340
|
const headContext = useTableHeadContext();
|
|
33079
|
-
const [left, setLeft] =
|
|
33080
|
-
const cellRef =
|
|
33081
|
-
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(() => {
|
|
33082
33344
|
if (!cellRef.current) return 0;
|
|
33083
33345
|
let totalLeft = 0;
|
|
33084
33346
|
for (const ref of stickyCells) {
|
|
@@ -33087,7 +33349,7 @@ var TableCell = (props) => {
|
|
|
33087
33349
|
}
|
|
33088
33350
|
return totalLeft;
|
|
33089
33351
|
}, [stickyCells]);
|
|
33090
|
-
|
|
33352
|
+
import_react36.default.useEffect(() => {
|
|
33091
33353
|
if (!isSticky || !cellRef.current) return;
|
|
33092
33354
|
registerStickyCell(cellRef);
|
|
33093
33355
|
setLeft(calculateLeft());
|
|
@@ -33105,7 +33367,7 @@ var TableCell = (props) => {
|
|
|
33105
33367
|
const CellTag = cellRef.current?.tagName === "TH" ? "th" : "td";
|
|
33106
33368
|
const isLastSticky = isSticky && stickyCells[stickyCells.length - 1] === cellRef;
|
|
33107
33369
|
const enableHover = headContext && headContext.cellHover;
|
|
33108
|
-
return /* @__PURE__ */ (0,
|
|
33370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime340.jsx)(
|
|
33109
33371
|
CellTag,
|
|
33110
33372
|
{
|
|
33111
33373
|
ref: cellRef,
|
|
@@ -33127,32 +33389,32 @@ TableCell.displayName = "TableCell";
|
|
|
33127
33389
|
var TableCell_default = TableCell;
|
|
33128
33390
|
|
|
33129
33391
|
// src/components/Table/TableHead.tsx
|
|
33130
|
-
var
|
|
33392
|
+
var import_jsx_runtime341 = require("react/jsx-runtime");
|
|
33131
33393
|
var TableHead = ({
|
|
33132
33394
|
children,
|
|
33133
33395
|
className = "",
|
|
33134
33396
|
cellHover = false
|
|
33135
33397
|
}) => {
|
|
33136
33398
|
const { headerSticky } = useTableContext();
|
|
33137
|
-
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 }) });
|
|
33138
33400
|
};
|
|
33139
33401
|
TableHead.displayName = "TableHead";
|
|
33140
33402
|
var TableHead_default = TableHead;
|
|
33141
33403
|
|
|
33142
33404
|
// src/components/Table/TableRow.tsx
|
|
33143
|
-
var
|
|
33144
|
-
var
|
|
33405
|
+
var import_react37 = __toESM(require("react"), 1);
|
|
33406
|
+
var import_jsx_runtime342 = require("react/jsx-runtime");
|
|
33145
33407
|
var TableRow = (props) => {
|
|
33146
33408
|
const {
|
|
33147
33409
|
children,
|
|
33148
33410
|
className,
|
|
33149
|
-
color: color2 = "xplat-
|
|
33411
|
+
color: color2 = "xplat-neutral-900",
|
|
33150
33412
|
type = "secondary",
|
|
33151
33413
|
isHover,
|
|
33152
33414
|
onClick
|
|
33153
33415
|
} = props;
|
|
33154
33416
|
const { rowBorderUse } = useTableContext();
|
|
33155
|
-
const [stickyCells, setStickyCells] =
|
|
33417
|
+
const [stickyCells, setStickyCells] = import_react37.default.useState([]);
|
|
33156
33418
|
const registerStickyCell = (ref) => {
|
|
33157
33419
|
setStickyCells((prev) => {
|
|
33158
33420
|
if (prev.includes(ref)) return prev;
|
|
@@ -33160,7 +33422,7 @@ var TableRow = (props) => {
|
|
|
33160
33422
|
});
|
|
33161
33423
|
};
|
|
33162
33424
|
const colorClass = color2;
|
|
33163
|
-
return /* @__PURE__ */ (0,
|
|
33425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime342.jsx)(TableRowContext_default.Provider, { value: { stickyCells, registerStickyCell }, children: /* @__PURE__ */ (0, import_jsx_runtime342.jsx)(
|
|
33164
33426
|
"tr",
|
|
33165
33427
|
{
|
|
33166
33428
|
className: clsx_default(
|
|
@@ -33180,7 +33442,7 @@ TableRow.displayName = "TableRow";
|
|
|
33180
33442
|
var TableRow_default = TableRow;
|
|
33181
33443
|
|
|
33182
33444
|
// src/components/Tag/Tag.tsx
|
|
33183
|
-
var
|
|
33445
|
+
var import_jsx_runtime343 = require("react/jsx-runtime");
|
|
33184
33446
|
var Tag = (props) => {
|
|
33185
33447
|
const {
|
|
33186
33448
|
children,
|
|
@@ -33190,21 +33452,21 @@ var Tag = (props) => {
|
|
|
33190
33452
|
className
|
|
33191
33453
|
} = props;
|
|
33192
33454
|
const colorClass = color2;
|
|
33193
|
-
return /* @__PURE__ */ (0,
|
|
33194
|
-
/* @__PURE__ */ (0,
|
|
33195
|
-
onClose && /* @__PURE__ */ (0,
|
|
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, {}) })
|
|
33196
33458
|
] });
|
|
33197
33459
|
};
|
|
33198
33460
|
Tag.displayName = "Tag";
|
|
33199
33461
|
var Tag_default = Tag;
|
|
33200
33462
|
|
|
33201
33463
|
// src/components/TextArea/TextArea.tsx
|
|
33202
|
-
var
|
|
33203
|
-
var
|
|
33204
|
-
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(
|
|
33205
33467
|
(props, ref) => {
|
|
33206
33468
|
const { value, onChange, className, disabled, ...textareaProps } = props;
|
|
33207
|
-
const localRef =
|
|
33469
|
+
const localRef = import_react38.default.useRef(null);
|
|
33208
33470
|
const setRefs = (el) => {
|
|
33209
33471
|
localRef.current = el;
|
|
33210
33472
|
if (!ref) return;
|
|
@@ -33224,21 +33486,21 @@ var TextArea = import_react37.default.forwardRef(
|
|
|
33224
33486
|
onChange(event);
|
|
33225
33487
|
}
|
|
33226
33488
|
};
|
|
33227
|
-
|
|
33489
|
+
import_react38.default.useEffect(() => {
|
|
33228
33490
|
const el = localRef.current;
|
|
33229
33491
|
if (!el) return;
|
|
33230
33492
|
el.style.height = "0px";
|
|
33231
33493
|
const nextHeight = Math.min(el.scrollHeight, 400);
|
|
33232
33494
|
el.style.height = `${nextHeight}px`;
|
|
33233
33495
|
}, [value]);
|
|
33234
|
-
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)(
|
|
33235
33497
|
"div",
|
|
33236
33498
|
{
|
|
33237
33499
|
className: clsx_default(
|
|
33238
33500
|
"lib-xplat-textarea",
|
|
33239
33501
|
disabled ? "disabled" : void 0
|
|
33240
33502
|
),
|
|
33241
|
-
children: /* @__PURE__ */ (0,
|
|
33503
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime344.jsx)(
|
|
33242
33504
|
"textarea",
|
|
33243
33505
|
{
|
|
33244
33506
|
...textareaProps,
|
|
@@ -33256,25 +33518,25 @@ TextArea.displayName = "TextArea";
|
|
|
33256
33518
|
var TextArea_default = TextArea;
|
|
33257
33519
|
|
|
33258
33520
|
// src/components/Toast/Toast.tsx
|
|
33259
|
-
var
|
|
33521
|
+
var import_react39 = __toESM(require("react"), 1);
|
|
33260
33522
|
var import_react_dom6 = require("react-dom");
|
|
33261
|
-
var
|
|
33262
|
-
var ToastContext =
|
|
33523
|
+
var import_jsx_runtime345 = require("react/jsx-runtime");
|
|
33524
|
+
var ToastContext = import_react39.default.createContext(null);
|
|
33263
33525
|
var useToast = () => {
|
|
33264
|
-
const ctx =
|
|
33526
|
+
const ctx = import_react39.default.useContext(ToastContext);
|
|
33265
33527
|
if (!ctx) throw new Error("useToast must be used within ToastProvider");
|
|
33266
33528
|
return ctx;
|
|
33267
33529
|
};
|
|
33268
33530
|
var EXIT_DURATION = 300;
|
|
33269
33531
|
var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
33270
|
-
const ref =
|
|
33271
|
-
const [height, setHeight] =
|
|
33272
|
-
|
|
33532
|
+
const ref = import_react39.default.useRef(null);
|
|
33533
|
+
const [height, setHeight] = import_react39.default.useState(void 0);
|
|
33534
|
+
import_react39.default.useEffect(() => {
|
|
33273
33535
|
if (ref.current && !isExiting) {
|
|
33274
33536
|
setHeight(ref.current.offsetHeight);
|
|
33275
33537
|
}
|
|
33276
33538
|
}, [isExiting]);
|
|
33277
|
-
return /* @__PURE__ */ (0,
|
|
33539
|
+
return /* @__PURE__ */ (0, import_jsx_runtime345.jsx)(
|
|
33278
33540
|
"div",
|
|
33279
33541
|
{
|
|
33280
33542
|
className: clsx_default("lib-xplat-toast-wrapper", { exit: isExiting }),
|
|
@@ -33282,15 +33544,15 @@ var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
|
33282
33544
|
maxHeight: isExiting ? 0 : height ?? "none",
|
|
33283
33545
|
marginBottom: isExiting ? 0 : void 0
|
|
33284
33546
|
},
|
|
33285
|
-
children: /* @__PURE__ */ (0,
|
|
33547
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime345.jsxs)(
|
|
33286
33548
|
"div",
|
|
33287
33549
|
{
|
|
33288
33550
|
ref,
|
|
33289
33551
|
className: clsx_default("lib-xplat-toast", item.type, { exit: isExiting }),
|
|
33290
33552
|
role: "alert",
|
|
33291
33553
|
children: [
|
|
33292
|
-
/* @__PURE__ */ (0,
|
|
33293
|
-
/* @__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" })
|
|
33294
33556
|
]
|
|
33295
33557
|
}
|
|
33296
33558
|
)
|
|
@@ -33301,13 +33563,13 @@ var ToastProvider = ({
|
|
|
33301
33563
|
children,
|
|
33302
33564
|
position = "top-right"
|
|
33303
33565
|
}) => {
|
|
33304
|
-
const [toasts, setToasts] =
|
|
33305
|
-
const [removing, setRemoving] =
|
|
33306
|
-
const [mounted, setMounted] =
|
|
33307
|
-
|
|
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(() => {
|
|
33308
33570
|
setMounted(true);
|
|
33309
33571
|
}, []);
|
|
33310
|
-
const remove =
|
|
33572
|
+
const remove = import_react39.default.useCallback((id) => {
|
|
33311
33573
|
setRemoving((prev) => new Set(prev).add(id));
|
|
33312
33574
|
setTimeout(() => {
|
|
33313
33575
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
@@ -33318,7 +33580,7 @@ var ToastProvider = ({
|
|
|
33318
33580
|
});
|
|
33319
33581
|
}, EXIT_DURATION);
|
|
33320
33582
|
}, []);
|
|
33321
|
-
const toast =
|
|
33583
|
+
const toast = import_react39.default.useCallback(
|
|
33322
33584
|
(type, message2, duration = 3e3) => {
|
|
33323
33585
|
const id = `${Date.now()}-${Math.random()}`;
|
|
33324
33586
|
setToasts((prev) => [...prev, { id, type, message: message2 }]);
|
|
@@ -33328,10 +33590,10 @@ var ToastProvider = ({
|
|
|
33328
33590
|
},
|
|
33329
33591
|
[remove]
|
|
33330
33592
|
);
|
|
33331
|
-
return /* @__PURE__ */ (0,
|
|
33593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime345.jsxs)(ToastContext.Provider, { value: { toast }, children: [
|
|
33332
33594
|
children,
|
|
33333
33595
|
mounted && (0, import_react_dom6.createPortal)(
|
|
33334
|
-
/* @__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)(
|
|
33335
33597
|
ToastItemComponent,
|
|
33336
33598
|
{
|
|
33337
33599
|
item: t,
|
|
@@ -33347,8 +33609,8 @@ var ToastProvider = ({
|
|
|
33347
33609
|
ToastProvider.displayName = "ToastProvider";
|
|
33348
33610
|
|
|
33349
33611
|
// src/components/Tooltip/Tooltip.tsx
|
|
33350
|
-
var
|
|
33351
|
-
var
|
|
33612
|
+
var import_react40 = __toESM(require("react"), 1);
|
|
33613
|
+
var import_jsx_runtime346 = require("react/jsx-runtime");
|
|
33352
33614
|
var Tooltip2 = (props) => {
|
|
33353
33615
|
const {
|
|
33354
33616
|
type = "primary",
|
|
@@ -33356,20 +33618,20 @@ var Tooltip2 = (props) => {
|
|
|
33356
33618
|
description,
|
|
33357
33619
|
children
|
|
33358
33620
|
} = props;
|
|
33359
|
-
const iconRef =
|
|
33621
|
+
const iconRef = import_react40.default.useRef(null);
|
|
33360
33622
|
const colorClass = color2;
|
|
33361
|
-
return /* @__PURE__ */ (0,
|
|
33362
|
-
/* @__PURE__ */ (0,
|
|
33363
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
33364
33626
|
] });
|
|
33365
33627
|
};
|
|
33366
33628
|
Tooltip2.displayName = "Tooltip";
|
|
33367
33629
|
var Tooltip_default = Tooltip2;
|
|
33368
33630
|
|
|
33369
33631
|
// src/components/Video/Video.tsx
|
|
33370
|
-
var
|
|
33371
|
-
var
|
|
33372
|
-
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) => {
|
|
33373
33635
|
const {
|
|
33374
33636
|
src,
|
|
33375
33637
|
poster,
|
|
@@ -33383,10 +33645,10 @@ var Video = import_react40.default.forwardRef((props, ref) => {
|
|
|
33383
33645
|
onPause,
|
|
33384
33646
|
...rest
|
|
33385
33647
|
} = props;
|
|
33386
|
-
const videoRef =
|
|
33387
|
-
const [isPlaying, setIsPlaying] =
|
|
33388
|
-
const [isLoaded, setIsLoaded] =
|
|
33389
|
-
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(
|
|
33390
33652
|
(el) => {
|
|
33391
33653
|
videoRef.current = el;
|
|
33392
33654
|
if (typeof ref === "function") ref(el);
|
|
@@ -33414,7 +33676,7 @@ var Video = import_react40.default.forwardRef((props, ref) => {
|
|
|
33414
33676
|
}
|
|
33415
33677
|
};
|
|
33416
33678
|
const showCustomOverlay = !controls;
|
|
33417
|
-
return /* @__PURE__ */ (0,
|
|
33679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime347.jsxs)(
|
|
33418
33680
|
"div",
|
|
33419
33681
|
{
|
|
33420
33682
|
className: clsx_default(
|
|
@@ -33423,7 +33685,7 @@ var Video = import_react40.default.forwardRef((props, ref) => {
|
|
|
33423
33685
|
className
|
|
33424
33686
|
),
|
|
33425
33687
|
children: [
|
|
33426
|
-
/* @__PURE__ */ (0,
|
|
33688
|
+
/* @__PURE__ */ (0, import_jsx_runtime347.jsx)(
|
|
33427
33689
|
"video",
|
|
33428
33690
|
{
|
|
33429
33691
|
ref: setRefs,
|
|
@@ -33440,7 +33702,7 @@ var Video = import_react40.default.forwardRef((props, ref) => {
|
|
|
33440
33702
|
...rest
|
|
33441
33703
|
}
|
|
33442
33704
|
),
|
|
33443
|
-
showCustomOverlay && /* @__PURE__ */ (0,
|
|
33705
|
+
showCustomOverlay && /* @__PURE__ */ (0, import_jsx_runtime347.jsx)(
|
|
33444
33706
|
"button",
|
|
33445
33707
|
{
|
|
33446
33708
|
type: "button",
|
|
@@ -33451,7 +33713,7 @@ var Video = import_react40.default.forwardRef((props, ref) => {
|
|
|
33451
33713
|
),
|
|
33452
33714
|
onClick: togglePlay,
|
|
33453
33715
|
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
33454
|
-
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, {}) })
|
|
33455
33717
|
}
|
|
33456
33718
|
)
|
|
33457
33719
|
]
|
|
@@ -33462,25 +33724,25 @@ Video.displayName = "Video";
|
|
|
33462
33724
|
var Video_default = Video;
|
|
33463
33725
|
|
|
33464
33726
|
// src/layout/Grid/FullGrid/FullGrid.tsx
|
|
33465
|
-
var
|
|
33727
|
+
var import_jsx_runtime348 = require("react/jsx-runtime");
|
|
33466
33728
|
var FullGrid = (props) => {
|
|
33467
33729
|
const { children, className } = props;
|
|
33468
|
-
return /* @__PURE__ */ (0,
|
|
33730
|
+
return /* @__PURE__ */ (0, import_jsx_runtime348.jsx)("div", { className: clsx_default("lib-xplat-full-grid", className), children });
|
|
33469
33731
|
};
|
|
33470
33732
|
FullGrid.displayName = "FullGrid";
|
|
33471
33733
|
var FullGrid_default = FullGrid;
|
|
33472
33734
|
|
|
33473
33735
|
// src/layout/Grid/FullScreen/FullScreen.tsx
|
|
33474
|
-
var
|
|
33736
|
+
var import_jsx_runtime349 = require("react/jsx-runtime");
|
|
33475
33737
|
var FullScreen = (props) => {
|
|
33476
33738
|
const { children, className } = props;
|
|
33477
|
-
return /* @__PURE__ */ (0,
|
|
33739
|
+
return /* @__PURE__ */ (0, import_jsx_runtime349.jsx)("div", { className: clsx_default("lib-xplat-full-screen", className), children });
|
|
33478
33740
|
};
|
|
33479
33741
|
FullScreen.displayName = "FullScreen";
|
|
33480
33742
|
var FullScreen_default = FullScreen;
|
|
33481
33743
|
|
|
33482
33744
|
// src/layout/Grid/Item/Item.tsx
|
|
33483
|
-
var
|
|
33745
|
+
var import_jsx_runtime350 = require("react/jsx-runtime");
|
|
33484
33746
|
var calculateSpans = (column) => {
|
|
33485
33747
|
const spans = {};
|
|
33486
33748
|
let inherited = column.default;
|
|
@@ -33497,35 +33759,35 @@ var GridItem = ({ column, children, className }) => {
|
|
|
33497
33759
|
Object.entries(spans).forEach(([key, value]) => {
|
|
33498
33760
|
style[`--column-${key}`] = value;
|
|
33499
33761
|
});
|
|
33500
|
-
return /* @__PURE__ */ (0,
|
|
33762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime350.jsx)("div", { className: clsx_default("lib-xplat-grid-item", className), style, children });
|
|
33501
33763
|
};
|
|
33502
33764
|
GridItem.displayName = "GridItem";
|
|
33503
33765
|
var Item_default = GridItem;
|
|
33504
33766
|
|
|
33505
33767
|
// src/layout/Header/Header.tsx
|
|
33506
|
-
var
|
|
33768
|
+
var import_jsx_runtime351 = require("react/jsx-runtime");
|
|
33507
33769
|
var Header = ({
|
|
33508
33770
|
logo,
|
|
33509
33771
|
centerContent,
|
|
33510
33772
|
rightContent
|
|
33511
33773
|
}) => {
|
|
33512
|
-
return /* @__PURE__ */ (0,
|
|
33513
|
-
/* @__PURE__ */ (0,
|
|
33514
|
-
/* @__PURE__ */ (0,
|
|
33515
|
-
/* @__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 })
|
|
33516
33778
|
] });
|
|
33517
33779
|
};
|
|
33518
33780
|
Header.displayName = "Header";
|
|
33519
33781
|
var Header_default = Header;
|
|
33520
33782
|
|
|
33521
33783
|
// src/layout/Layout/Layout.tsx
|
|
33522
|
-
var
|
|
33784
|
+
var import_jsx_runtime352 = require("react/jsx-runtime");
|
|
33523
33785
|
var Layout = (props) => {
|
|
33524
33786
|
const { header, sideBar, children } = props;
|
|
33525
|
-
return /* @__PURE__ */ (0,
|
|
33526
|
-
sideBar && /* @__PURE__ */ (0,
|
|
33527
|
-
/* @__PURE__ */ (0,
|
|
33528
|
-
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 }),
|
|
33529
33791
|
children
|
|
33530
33792
|
] })
|
|
33531
33793
|
] }) });
|
|
@@ -33534,31 +33796,31 @@ Layout.displayName = "Layout";
|
|
|
33534
33796
|
var Layout_default = Layout;
|
|
33535
33797
|
|
|
33536
33798
|
// src/layout/SideBar/SideBar.tsx
|
|
33537
|
-
var
|
|
33799
|
+
var import_react43 = __toESM(require("react"), 1);
|
|
33538
33800
|
|
|
33539
33801
|
// src/layout/SideBar/SideBarContext.tsx
|
|
33540
|
-
var
|
|
33541
|
-
var SideBarContext =
|
|
33802
|
+
var import_react42 = __toESM(require("react"), 1);
|
|
33803
|
+
var SideBarContext = import_react42.default.createContext(null);
|
|
33542
33804
|
var useSideBarContext = () => {
|
|
33543
|
-
const ctx =
|
|
33805
|
+
const ctx = import_react42.default.useContext(SideBarContext);
|
|
33544
33806
|
if (!ctx) throw new Error("Error");
|
|
33545
33807
|
return ctx;
|
|
33546
33808
|
};
|
|
33547
33809
|
var SideBarContext_default = SideBarContext;
|
|
33548
33810
|
|
|
33549
33811
|
// src/layout/SideBar/SideBar.tsx
|
|
33550
|
-
var
|
|
33812
|
+
var import_jsx_runtime353 = require("react/jsx-runtime");
|
|
33551
33813
|
var SideBar = (props) => {
|
|
33552
33814
|
const { children, className } = props;
|
|
33553
|
-
const [isOpen, setIsOpen] =
|
|
33815
|
+
const [isOpen, setIsOpen] = import_react43.default.useState(true);
|
|
33554
33816
|
const handleSwitchSideBar = () => {
|
|
33555
33817
|
setIsOpen((prev) => !prev);
|
|
33556
33818
|
};
|
|
33557
|
-
return /* @__PURE__ */ (0,
|
|
33819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime353.jsx)(
|
|
33558
33820
|
SideBarContext_default.Provider,
|
|
33559
33821
|
{
|
|
33560
33822
|
value: { isSidebarOpen: isOpen, handleSwitchSideBar },
|
|
33561
|
-
children: /* @__PURE__ */ (0,
|
|
33823
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime353.jsx)(
|
|
33562
33824
|
"div",
|
|
33563
33825
|
{
|
|
33564
33826
|
className: clsx_default(
|
|
@@ -33861,6 +34123,7 @@ var SideBar_default = SideBar;
|
|
|
33861
34123
|
SunIcon,
|
|
33862
34124
|
SunriseIcon,
|
|
33863
34125
|
SunsetIcon,
|
|
34126
|
+
Swiper,
|
|
33864
34127
|
Switch,
|
|
33865
34128
|
Tab,
|
|
33866
34129
|
Table,
|