@x-plat/design-system 0.5.11 → 0.5.12
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/Chart/index.cjs +67 -48
- package/dist/components/Chart/index.js +68 -49
- package/dist/components/DatePicker/index.cjs +401 -379
- package/dist/components/DatePicker/index.js +388 -366
- package/dist/components/Dropdown/index.cjs +38 -17
- package/dist/components/Dropdown/index.css +9 -9
- package/dist/components/Dropdown/index.js +37 -16
- package/dist/components/Modal/index.cjs +29 -9
- package/dist/components/Modal/index.d.cts +0 -3
- package/dist/components/Modal/index.d.ts +0 -3
- package/dist/components/Modal/index.js +28 -8
- package/dist/components/PopOver/index.cjs +33 -12
- package/dist/components/PopOver/index.css +6 -9
- package/dist/components/PopOver/index.js +32 -11
- package/dist/components/Select/index.cjs +351 -330
- package/dist/components/Select/index.css +12 -19
- package/dist/components/Select/index.js +350 -329
- package/dist/components/index.cjs +485 -440
- package/dist/components/index.css +27 -37
- package/dist/components/index.js +441 -396
- package/dist/index.cjs +509 -464
- package/dist/index.css +27 -37
- package/dist/index.js +463 -418
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6121,7 +6121,7 @@ var CardTab_default = CardTab;
|
|
|
6121
6121
|
|
|
6122
6122
|
// src/components/Chart/Chart.tsx
|
|
6123
6123
|
import React5 from "react";
|
|
6124
|
-
import { jsx as jsx305, jsxs as jsxs196 } from "react/jsx-runtime";
|
|
6124
|
+
import { Fragment as Fragment2, jsx as jsx305, jsxs as jsxs196 } from "react/jsx-runtime";
|
|
6125
6125
|
var CATEGORICAL_COUNT2 = 8;
|
|
6126
6126
|
var LINE_BAR_PALETTES = Array.from({ length: CATEGORICAL_COUNT2 }, (_, i) => {
|
|
6127
6127
|
const n = i + 1;
|
|
@@ -6170,14 +6170,23 @@ var useChartSize = (ref) => {
|
|
|
6170
6170
|
React5.useEffect(() => {
|
|
6171
6171
|
const el = ref.current;
|
|
6172
6172
|
if (!el) return;
|
|
6173
|
+
let rafId = 0;
|
|
6173
6174
|
const observer = new ResizeObserver((entries) => {
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
|
|
6177
|
-
|
|
6175
|
+
cancelAnimationFrame(rafId);
|
|
6176
|
+
rafId = requestAnimationFrame(() => {
|
|
6177
|
+
const entry = entries[0];
|
|
6178
|
+
if (!entry) return;
|
|
6179
|
+
const { width, height } = entry.contentRect;
|
|
6180
|
+
const w = Math.floor(width);
|
|
6181
|
+
const h = Math.floor(height);
|
|
6182
|
+
setSize((prev) => prev.width === w && prev.height === h ? prev : { width: w, height: h });
|
|
6183
|
+
});
|
|
6178
6184
|
});
|
|
6179
6185
|
observer.observe(el);
|
|
6180
|
-
return () =>
|
|
6186
|
+
return () => {
|
|
6187
|
+
cancelAnimationFrame(rafId);
|
|
6188
|
+
observer.disconnect();
|
|
6189
|
+
};
|
|
6181
6190
|
}, [ref]);
|
|
6182
6191
|
return size;
|
|
6183
6192
|
};
|
|
@@ -6189,15 +6198,21 @@ var useChartTooltip = (enabled) => {
|
|
|
6189
6198
|
content: ""
|
|
6190
6199
|
});
|
|
6191
6200
|
const containerRef = React5.useRef(null);
|
|
6201
|
+
const rafRef = React5.useRef(0);
|
|
6192
6202
|
const move = React5.useCallback((e) => {
|
|
6193
6203
|
if (!enabled) return;
|
|
6194
|
-
const
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6204
|
+
const clientX = e.clientX;
|
|
6205
|
+
const clientY = e.clientY;
|
|
6206
|
+
cancelAnimationFrame(rafRef.current);
|
|
6207
|
+
rafRef.current = requestAnimationFrame(() => {
|
|
6208
|
+
const rect = containerRef.current?.getBoundingClientRect();
|
|
6209
|
+
if (!rect) return;
|
|
6210
|
+
setTooltip((prev) => ({
|
|
6211
|
+
...prev,
|
|
6212
|
+
x: clientX - rect.left,
|
|
6213
|
+
y: clientY - rect.top - 12
|
|
6214
|
+
}));
|
|
6215
|
+
});
|
|
6201
6216
|
}, [enabled]);
|
|
6202
6217
|
const show = React5.useCallback((e, content) => {
|
|
6203
6218
|
if (!enabled) return;
|
|
@@ -6211,10 +6226,35 @@ var useChartTooltip = (enabled) => {
|
|
|
6211
6226
|
});
|
|
6212
6227
|
}, [enabled]);
|
|
6213
6228
|
const hide = React5.useCallback(() => {
|
|
6229
|
+
cancelAnimationFrame(rafRef.current);
|
|
6214
6230
|
setTooltip((prev) => ({ ...prev, visible: false }));
|
|
6215
6231
|
}, []);
|
|
6216
6232
|
return { tooltip, show, hide, move, containerRef };
|
|
6217
6233
|
};
|
|
6234
|
+
var GridLines = React5.memo(({ width, height, chartH, maxVal }) => /* @__PURE__ */ jsx305(Fragment2, { children: [0, 0.25, 0.5, 0.75, 1].map((ratio) => {
|
|
6235
|
+
const y = PADDING.top + (1 - ratio) * chartH;
|
|
6236
|
+
const val = Math.round(maxVal * ratio);
|
|
6237
|
+
return /* @__PURE__ */ jsxs196("g", { children: [
|
|
6238
|
+
/* @__PURE__ */ jsx305("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
|
|
6239
|
+
/* @__PURE__ */ jsx305("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
|
|
6240
|
+
] }, ratio);
|
|
6241
|
+
}) }));
|
|
6242
|
+
GridLines.displayName = "GridLines";
|
|
6243
|
+
var getLabelStep = (count, chartW) => {
|
|
6244
|
+
const minLabelWidth = 40;
|
|
6245
|
+
const maxLabels = Math.floor(chartW / minLabelWidth);
|
|
6246
|
+
if (count <= maxLabels) return 1;
|
|
6247
|
+
return Math.ceil(count / maxLabels);
|
|
6248
|
+
};
|
|
6249
|
+
var AxisLabels = React5.memo(({ labels, count, chartW, height }) => {
|
|
6250
|
+
const step = getLabelStep(count, chartW);
|
|
6251
|
+
return /* @__PURE__ */ jsx305(Fragment2, { children: labels.map((label, i) => {
|
|
6252
|
+
if (i % step !== 0) return null;
|
|
6253
|
+
const x = PADDING.left + i / (count - 1 || 1) * chartW;
|
|
6254
|
+
return /* @__PURE__ */ jsx305("text", { x, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
6255
|
+
}) });
|
|
6256
|
+
});
|
|
6257
|
+
AxisLabels.displayName = "AxisLabels";
|
|
6218
6258
|
var LineChart = React5.memo(({ data, labels, width, height, onHover, onMove, onLeave }) => {
|
|
6219
6259
|
const entries = React5.useMemo(() => Object.entries(data), [data]);
|
|
6220
6260
|
const maxVal = React5.useMemo(() => {
|
|
@@ -6234,19 +6274,10 @@ var LineChart = React5.memo(({ data, labels, width, height, onHover, onMove, onL
|
|
|
6234
6274
|
),
|
|
6235
6275
|
[entries, count, chartW, chartH, maxVal]
|
|
6236
6276
|
);
|
|
6277
|
+
const showPoints = count <= 100;
|
|
6237
6278
|
return /* @__PURE__ */ jsxs196("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
const val = Math.round(maxVal * ratio);
|
|
6241
|
-
return /* @__PURE__ */ jsxs196("g", { children: [
|
|
6242
|
-
/* @__PURE__ */ jsx305("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
|
|
6243
|
-
/* @__PURE__ */ jsx305("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
|
|
6244
|
-
] }, ratio);
|
|
6245
|
-
}),
|
|
6246
|
-
labels.map((label, i) => {
|
|
6247
|
-
const x = PADDING.left + i / (count - 1 || 1) * chartW;
|
|
6248
|
-
return /* @__PURE__ */ jsx305("text", { x, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
6249
|
-
}),
|
|
6279
|
+
/* @__PURE__ */ jsx305(GridLines, { width, height, chartH, maxVal }),
|
|
6280
|
+
/* @__PURE__ */ jsx305(AxisLabels, { labels, count, chartW, height }),
|
|
6250
6281
|
entries.map(([key], di) => {
|
|
6251
6282
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
6252
6283
|
const color = palette[2];
|
|
@@ -6261,7 +6292,7 @@ var LineChart = React5.memo(({ data, labels, width, height, onHover, onMove, onL
|
|
|
6261
6292
|
strokeWidth: "2"
|
|
6262
6293
|
}
|
|
6263
6294
|
),
|
|
6264
|
-
points.map((p, i) => /* @__PURE__ */ jsx305(
|
|
6295
|
+
showPoints && points.map((p, i) => /* @__PURE__ */ jsx305(
|
|
6265
6296
|
"circle",
|
|
6266
6297
|
{
|
|
6267
6298
|
cx: p.x,
|
|
@@ -6299,19 +6330,10 @@ var CurveChart = React5.memo(({ data, labels, width, height, onHover, onMove, on
|
|
|
6299
6330
|
),
|
|
6300
6331
|
[entries, count, chartW, chartH, maxVal]
|
|
6301
6332
|
);
|
|
6333
|
+
const showPoints = count <= 100;
|
|
6302
6334
|
return /* @__PURE__ */ jsxs196("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
const val = Math.round(maxVal * ratio);
|
|
6306
|
-
return /* @__PURE__ */ jsxs196("g", { children: [
|
|
6307
|
-
/* @__PURE__ */ jsx305("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
|
|
6308
|
-
/* @__PURE__ */ jsx305("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
|
|
6309
|
-
] }, ratio);
|
|
6310
|
-
}),
|
|
6311
|
-
labels.map((label, i) => {
|
|
6312
|
-
const x = PADDING.left + i / (count - 1 || 1) * chartW;
|
|
6313
|
-
return /* @__PURE__ */ jsx305("text", { x, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
6314
|
-
}),
|
|
6335
|
+
/* @__PURE__ */ jsx305(GridLines, { width, height, chartH, maxVal }),
|
|
6336
|
+
/* @__PURE__ */ jsx305(AxisLabels, { labels, count, chartW, height }),
|
|
6315
6337
|
entries.map(([key], di) => {
|
|
6316
6338
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
6317
6339
|
const color = palette[2];
|
|
@@ -6327,7 +6349,7 @@ var CurveChart = React5.memo(({ data, labels, width, height, onHover, onMove, on
|
|
|
6327
6349
|
] }) }),
|
|
6328
6350
|
/* @__PURE__ */ jsx305("path", { d: areaPath, fill: `url(#${gradientId})` }),
|
|
6329
6351
|
/* @__PURE__ */ jsx305("path", { d: linePath, fill: "none", stroke: color, strokeWidth: "2" }),
|
|
6330
|
-
points.map((p, i) => /* @__PURE__ */ jsx305(
|
|
6352
|
+
showPoints && points.map((p, i) => /* @__PURE__ */ jsx305(
|
|
6331
6353
|
"circle",
|
|
6332
6354
|
{
|
|
6333
6355
|
cx: p.x,
|
|
@@ -6357,11 +6379,11 @@ var BarChart = React5.memo(({ data, labels, width, height, onHover, onMove, onLe
|
|
|
6357
6379
|
const chartW = width - PADDING.left - PADDING.right;
|
|
6358
6380
|
const chartH = height - PADDING.top - PADDING.bottom;
|
|
6359
6381
|
const groupW = chartW / count;
|
|
6360
|
-
const barW = Math.min(32, groupW * 0.7 / groupCount);
|
|
6382
|
+
const barW = Math.max(1, Math.min(32, groupW * 0.7 / groupCount));
|
|
6361
6383
|
const bars = React5.useMemo(
|
|
6362
6384
|
() => entries.map(
|
|
6363
6385
|
([, values], di) => values.map((v, i) => {
|
|
6364
|
-
const h = v / maxVal * chartH;
|
|
6386
|
+
const h = Math.max(0, v / maxVal * chartH);
|
|
6365
6387
|
const x = PADDING.left + groupW * i + (groupW - barW * groupCount) / 2 + barW * di;
|
|
6366
6388
|
const y = PADDING.top + chartH - h;
|
|
6367
6389
|
return { x, y, w: barW, h, v };
|
|
@@ -6369,16 +6391,13 @@ var BarChart = React5.memo(({ data, labels, width, height, onHover, onMove, onLe
|
|
|
6369
6391
|
),
|
|
6370
6392
|
[entries, maxVal, chartH, groupW, barW, groupCount]
|
|
6371
6393
|
);
|
|
6394
|
+
const barLabelStep = getLabelStep(count, chartW);
|
|
6372
6395
|
return /* @__PURE__ */ jsxs196("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
return /* @__PURE__ */
|
|
6377
|
-
/* @__PURE__ */ jsx305("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
|
|
6378
|
-
/* @__PURE__ */ jsx305("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
|
|
6379
|
-
] }, ratio);
|
|
6396
|
+
/* @__PURE__ */ jsx305(GridLines, { width, height, chartH, maxVal }),
|
|
6397
|
+
labels.map((label, i) => {
|
|
6398
|
+
if (i % barLabelStep !== 0) return null;
|
|
6399
|
+
return /* @__PURE__ */ jsx305("text", { x: PADDING.left + groupW * i + groupW / 2, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
6380
6400
|
}),
|
|
6381
|
-
labels.map((label, i) => /* @__PURE__ */ jsx305("text", { x: PADDING.left + groupW * i + groupW / 2, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i)),
|
|
6382
6401
|
entries.map(([key], di) => {
|
|
6383
6402
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
6384
6403
|
const color = palette[2];
|
|
@@ -6571,7 +6590,7 @@ Chip.displayName = "Chip";
|
|
|
6571
6590
|
var Chip_default = Chip;
|
|
6572
6591
|
|
|
6573
6592
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
6574
|
-
import
|
|
6593
|
+
import React11 from "react";
|
|
6575
6594
|
|
|
6576
6595
|
// src/components/Input/Input.tsx
|
|
6577
6596
|
import React6 from "react";
|
|
@@ -6761,15 +6780,37 @@ PasswordInput.displayName = "PasswordInput";
|
|
|
6761
6780
|
var PasswordInput_default = PasswordInput;
|
|
6762
6781
|
|
|
6763
6782
|
// src/components/Modal/Modal.tsx
|
|
6764
|
-
import
|
|
6783
|
+
import React9 from "react";
|
|
6765
6784
|
import { createPortal } from "react-dom";
|
|
6785
|
+
|
|
6786
|
+
// src/tokens/hooks/Portal.tsx
|
|
6787
|
+
import React8 from "react";
|
|
6788
|
+
import ReactDOM from "react-dom";
|
|
6766
6789
|
import { jsx as jsx311 } from "react/jsx-runtime";
|
|
6790
|
+
var PortalContainerContext = React8.createContext(null);
|
|
6791
|
+
var PortalProvider = ({ container, children }) => /* @__PURE__ */ jsx311(PortalContainerContext.Provider, { value: container, children });
|
|
6792
|
+
var Portal = ({ children }) => {
|
|
6793
|
+
const contextContainer = React8.useContext(PortalContainerContext);
|
|
6794
|
+
const [fallback, setFallback] = React8.useState(null);
|
|
6795
|
+
React8.useEffect(() => {
|
|
6796
|
+
if (!contextContainer) setFallback(document.body);
|
|
6797
|
+
}, [contextContainer]);
|
|
6798
|
+
const container = contextContainer ?? fallback;
|
|
6799
|
+
if (!container) return null;
|
|
6800
|
+
return ReactDOM.createPortal(children, container);
|
|
6801
|
+
};
|
|
6802
|
+
Portal.displayName = "Portal";
|
|
6803
|
+
var Portal_default = Portal;
|
|
6804
|
+
|
|
6805
|
+
// src/components/Modal/Modal.tsx
|
|
6806
|
+
import { jsx as jsx312 } from "react/jsx-runtime";
|
|
6767
6807
|
var ANIMATION_DURATION_MS = 200;
|
|
6768
6808
|
var Modal = (props) => {
|
|
6769
6809
|
const { isOpen, onClose, children } = props;
|
|
6770
|
-
const [mounted, setMounted] =
|
|
6771
|
-
const [visible, setVisible] =
|
|
6772
|
-
|
|
6810
|
+
const [mounted, setMounted] = React9.useState(false);
|
|
6811
|
+
const [visible, setVisible] = React9.useState(false);
|
|
6812
|
+
const boxRef = React9.useRef(null);
|
|
6813
|
+
React9.useEffect(() => {
|
|
6773
6814
|
if (isOpen) {
|
|
6774
6815
|
setMounted(true);
|
|
6775
6816
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -6783,19 +6824,20 @@ var Modal = (props) => {
|
|
|
6783
6824
|
if (!mounted) return null;
|
|
6784
6825
|
const stateClass = visible ? "enter" : "exit";
|
|
6785
6826
|
return createPortal(
|
|
6786
|
-
/* @__PURE__ */
|
|
6827
|
+
/* @__PURE__ */ jsx312(
|
|
6787
6828
|
"div",
|
|
6788
6829
|
{
|
|
6789
6830
|
className: clsx_default("lib-xplat-modal", "dim", stateClass),
|
|
6790
6831
|
onClick: onClose,
|
|
6791
|
-
children: /* @__PURE__ */
|
|
6832
|
+
children: /* @__PURE__ */ jsx312(
|
|
6792
6833
|
"div",
|
|
6793
6834
|
{
|
|
6835
|
+
ref: boxRef,
|
|
6794
6836
|
className: clsx_default("lib-xplat-modal", "modal-box", stateClass),
|
|
6795
6837
|
role: "dialog",
|
|
6796
6838
|
"aria-modal": "true",
|
|
6797
6839
|
onClick: (e) => e.stopPropagation(),
|
|
6798
|
-
children
|
|
6840
|
+
children: /* @__PURE__ */ jsx312(PortalProvider, { container: boxRef.current, children })
|
|
6799
6841
|
}
|
|
6800
6842
|
)
|
|
6801
6843
|
}
|
|
@@ -6807,9 +6849,9 @@ Modal.displayName = "Modal";
|
|
|
6807
6849
|
var Modal_default = Modal;
|
|
6808
6850
|
|
|
6809
6851
|
// src/components/DatePicker/SingleDatePicker/index.tsx
|
|
6810
|
-
import
|
|
6811
|
-
import { Fragment as
|
|
6812
|
-
var DayCell2 =
|
|
6852
|
+
import React10 from "react";
|
|
6853
|
+
import { Fragment as Fragment3, jsx as jsx313, jsxs as jsxs200 } from "react/jsx-runtime";
|
|
6854
|
+
var DayCell2 = React10.memo(
|
|
6813
6855
|
({
|
|
6814
6856
|
day,
|
|
6815
6857
|
disabled,
|
|
@@ -6819,7 +6861,7 @@ var DayCell2 = React9.memo(
|
|
|
6819
6861
|
isEnd,
|
|
6820
6862
|
inRange,
|
|
6821
6863
|
onSelect
|
|
6822
|
-
}) => /* @__PURE__ */
|
|
6864
|
+
}) => /* @__PURE__ */ jsx313(
|
|
6823
6865
|
"button",
|
|
6824
6866
|
{
|
|
6825
6867
|
type: "button",
|
|
@@ -6861,26 +6903,26 @@ var SingleDatePicker = (props) => {
|
|
|
6861
6903
|
initialYear,
|
|
6862
6904
|
initialMonth
|
|
6863
6905
|
);
|
|
6864
|
-
const [pickerMode, setPickerMode] =
|
|
6865
|
-
const [yearRangeStart, setYearRangeStart] =
|
|
6906
|
+
const [pickerMode, setPickerMode] = React10.useState("days");
|
|
6907
|
+
const [yearRangeStart, setYearRangeStart] = React10.useState(
|
|
6866
6908
|
Math.floor((initialYear ?? (/* @__PURE__ */ new Date()).getFullYear()) / 12) * 12
|
|
6867
6909
|
);
|
|
6868
|
-
const minTime =
|
|
6910
|
+
const minTime = React10.useMemo(
|
|
6869
6911
|
() => minDate ? new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()).getTime() : -Infinity,
|
|
6870
6912
|
[minDate]
|
|
6871
6913
|
);
|
|
6872
|
-
const maxTime =
|
|
6914
|
+
const maxTime = React10.useMemo(
|
|
6873
6915
|
() => maxDate ? new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()).getTime() : Infinity,
|
|
6874
6916
|
[maxDate]
|
|
6875
6917
|
);
|
|
6876
|
-
const highlightSet =
|
|
6918
|
+
const highlightSet = React10.useMemo(() => {
|
|
6877
6919
|
const set = /* @__PURE__ */ new Set();
|
|
6878
6920
|
for (const h of highlightDates) {
|
|
6879
6921
|
set.add(`${h.getFullYear()}-${h.getMonth()}-${h.getDate()}`);
|
|
6880
6922
|
}
|
|
6881
6923
|
return set;
|
|
6882
6924
|
}, [highlightDates]);
|
|
6883
|
-
const handleSelect =
|
|
6925
|
+
const handleSelect = React10.useCallback(
|
|
6884
6926
|
(date) => {
|
|
6885
6927
|
onChange?.(date);
|
|
6886
6928
|
},
|
|
@@ -6923,14 +6965,14 @@ var SingleDatePicker = (props) => {
|
|
|
6923
6965
|
className: clsx_default("lib-xplat-datepicker", "single"),
|
|
6924
6966
|
children: [
|
|
6925
6967
|
/* @__PURE__ */ jsxs200("div", { className: "datepicker-header", children: [
|
|
6926
|
-
/* @__PURE__ */
|
|
6927
|
-
/* @__PURE__ */
|
|
6928
|
-
/* @__PURE__ */
|
|
6968
|
+
/* @__PURE__ */ jsx313("button", { className: "datepicker-nav", onClick: handlePrev, type: "button", children: /* @__PURE__ */ jsx313(ChevronLeftIcon_default, {}) }),
|
|
6969
|
+
/* @__PURE__ */ jsx313("button", { className: "datepicker-title", onClick: handleTitleClick, type: "button", children: titleText }),
|
|
6970
|
+
/* @__PURE__ */ jsx313("button", { className: "datepicker-nav", onClick: handleNext, type: "button", children: /* @__PURE__ */ jsx313(ChevronRightIcon_default, {}) })
|
|
6929
6971
|
] }),
|
|
6930
6972
|
/* @__PURE__ */ jsxs200("div", { className: "datepicker-body", children: [
|
|
6931
|
-
pickerMode === "years" && /* @__PURE__ */
|
|
6973
|
+
pickerMode === "years" && /* @__PURE__ */ jsx313("div", { className: "datepicker-picker-grid", children: Array.from({ length: 12 }, (_, i) => {
|
|
6932
6974
|
const y = yearRangeStart + i;
|
|
6933
|
-
return /* @__PURE__ */
|
|
6975
|
+
return /* @__PURE__ */ jsx313(
|
|
6934
6976
|
"button",
|
|
6935
6977
|
{
|
|
6936
6978
|
type: "button",
|
|
@@ -6941,7 +6983,7 @@ var SingleDatePicker = (props) => {
|
|
|
6941
6983
|
y
|
|
6942
6984
|
);
|
|
6943
6985
|
}) }),
|
|
6944
|
-
pickerMode === "months" && /* @__PURE__ */
|
|
6986
|
+
pickerMode === "months" && /* @__PURE__ */ jsx313("div", { className: "datepicker-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ jsx313(
|
|
6945
6987
|
"button",
|
|
6946
6988
|
{
|
|
6947
6989
|
type: "button",
|
|
@@ -6951,8 +6993,8 @@ var SingleDatePicker = (props) => {
|
|
|
6951
6993
|
},
|
|
6952
6994
|
i
|
|
6953
6995
|
)) }),
|
|
6954
|
-
pickerMode === "days" && /* @__PURE__ */ jsxs200(
|
|
6955
|
-
/* @__PURE__ */
|
|
6996
|
+
pickerMode === "days" && /* @__PURE__ */ jsxs200(Fragment3, { children: [
|
|
6997
|
+
/* @__PURE__ */ jsx313("div", { className: "datepicker-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ jsx313(
|
|
6956
6998
|
"div",
|
|
6957
6999
|
{
|
|
6958
7000
|
className: clsx_default(
|
|
@@ -6964,7 +7006,7 @@ var SingleDatePicker = (props) => {
|
|
|
6964
7006
|
},
|
|
6965
7007
|
label
|
|
6966
7008
|
)) }),
|
|
6967
|
-
/* @__PURE__ */
|
|
7009
|
+
/* @__PURE__ */ jsx313("div", { className: "datepicker-grid", children: days.map((day, idx) => {
|
|
6968
7010
|
const t = day.date.getTime();
|
|
6969
7011
|
const disabled = t < minTime || t > maxTime;
|
|
6970
7012
|
const selected = value ? isSameDay(day.date, value) : false;
|
|
@@ -6974,7 +7016,7 @@ var SingleDatePicker = (props) => {
|
|
|
6974
7016
|
const isStart = hasRange ? isSameDay(day.date, rangeStart) : false;
|
|
6975
7017
|
const isEnd = hasRange ? isSameDay(day.date, rangeEnd) : false;
|
|
6976
7018
|
const inRangeVal = hasRange ? isInRange(day.date, rangeStart, rangeEnd) : false;
|
|
6977
|
-
return /* @__PURE__ */
|
|
7019
|
+
return /* @__PURE__ */ jsx313(
|
|
6978
7020
|
DayCell2,
|
|
6979
7021
|
{
|
|
6980
7022
|
day,
|
|
@@ -6999,7 +7041,7 @@ SingleDatePicker.displayName = "SingleDatePicker";
|
|
|
6999
7041
|
var SingleDatePicker_default = SingleDatePicker;
|
|
7000
7042
|
|
|
7001
7043
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
7002
|
-
import { jsx as
|
|
7044
|
+
import { jsx as jsx314, jsxs as jsxs201 } from "react/jsx-runtime";
|
|
7003
7045
|
var formatDate = (date) => {
|
|
7004
7046
|
if (!date || !(date instanceof Date) || isNaN(date.getTime())) return "";
|
|
7005
7047
|
const y = date.getFullYear();
|
|
@@ -7009,8 +7051,8 @@ var formatDate = (date) => {
|
|
|
7009
7051
|
};
|
|
7010
7052
|
var InputDatePicker = (props) => {
|
|
7011
7053
|
const { value, onChange, minDate, maxDate, disabled, locale = "ko", placeholder } = props;
|
|
7012
|
-
const [isOpen, setIsOpen] =
|
|
7013
|
-
const [tempDate, setTempDate] =
|
|
7054
|
+
const [isOpen, setIsOpen] = React11.useState(false);
|
|
7055
|
+
const [tempDate, setTempDate] = React11.useState(value ?? /* @__PURE__ */ new Date());
|
|
7014
7056
|
const handleOpen = () => {
|
|
7015
7057
|
if (disabled) return;
|
|
7016
7058
|
setTempDate(value ?? /* @__PURE__ */ new Date());
|
|
@@ -7027,18 +7069,18 @@ var InputDatePicker = (props) => {
|
|
|
7027
7069
|
setIsOpen(false);
|
|
7028
7070
|
};
|
|
7029
7071
|
return /* @__PURE__ */ jsxs201("div", { className: clsx_default("lib-xplat-datepicker input-datepicker", disabled && "disabled"), children: [
|
|
7030
|
-
/* @__PURE__ */
|
|
7072
|
+
/* @__PURE__ */ jsx314("div", { className: "input-datepicker-trigger", onClick: handleOpen, children: /* @__PURE__ */ jsx314(
|
|
7031
7073
|
Input_default,
|
|
7032
7074
|
{
|
|
7033
7075
|
value: formatDate(value),
|
|
7034
7076
|
placeholder,
|
|
7035
|
-
suffix: /* @__PURE__ */
|
|
7077
|
+
suffix: /* @__PURE__ */ jsx314(CalenderIcon_default, {}),
|
|
7036
7078
|
disabled,
|
|
7037
7079
|
readOnly: true
|
|
7038
7080
|
}
|
|
7039
7081
|
) }),
|
|
7040
|
-
/* @__PURE__ */
|
|
7041
|
-
/* @__PURE__ */
|
|
7082
|
+
/* @__PURE__ */ jsx314(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ jsxs201("div", { className: "lib-xplat-popup-datepicker-card", children: [
|
|
7083
|
+
/* @__PURE__ */ jsx314("div", { className: "popup-datepicker-content", children: /* @__PURE__ */ jsx314(
|
|
7042
7084
|
SingleDatePicker_default,
|
|
7043
7085
|
{
|
|
7044
7086
|
value: tempDate,
|
|
@@ -7049,8 +7091,8 @@ var InputDatePicker = (props) => {
|
|
|
7049
7091
|
}
|
|
7050
7092
|
) }),
|
|
7051
7093
|
/* @__PURE__ */ jsxs201("div", { className: "popup-datepicker-footer", children: [
|
|
7052
|
-
/* @__PURE__ */
|
|
7053
|
-
/* @__PURE__ */
|
|
7094
|
+
/* @__PURE__ */ jsx314(Button_default, { type: "secondary", onClick: handleClose, children: locale === "ko" ? "\uCDE8\uC18C" : "Cancel" }),
|
|
7095
|
+
/* @__PURE__ */ jsx314(Button_default, { type: "primary", onClick: handleApply, children: locale === "ko" ? "\uC801\uC6A9" : "Apply" })
|
|
7054
7096
|
] })
|
|
7055
7097
|
] }) })
|
|
7056
7098
|
] });
|
|
@@ -7059,20 +7101,20 @@ InputDatePicker.displayName = "InputDatePicker";
|
|
|
7059
7101
|
var InputDatePicker_default = InputDatePicker;
|
|
7060
7102
|
|
|
7061
7103
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
7062
|
-
import
|
|
7104
|
+
import React15 from "react";
|
|
7063
7105
|
|
|
7064
7106
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
7065
|
-
import
|
|
7107
|
+
import React14 from "react";
|
|
7066
7108
|
|
|
7067
7109
|
// src/components/Tab/Tab.tsx
|
|
7068
|
-
import
|
|
7110
|
+
import React13 from "react";
|
|
7069
7111
|
|
|
7070
7112
|
// src/components/Tab/TabItem.tsx
|
|
7071
|
-
import
|
|
7072
|
-
import { jsx as
|
|
7073
|
-
var TabItem =
|
|
7113
|
+
import React12 from "react";
|
|
7114
|
+
import { jsx as jsx315 } from "react/jsx-runtime";
|
|
7115
|
+
var TabItem = React12.forwardRef((props, ref) => {
|
|
7074
7116
|
const { isActive, title, onClick } = props;
|
|
7075
|
-
return /* @__PURE__ */
|
|
7117
|
+
return /* @__PURE__ */ jsx315(
|
|
7076
7118
|
"div",
|
|
7077
7119
|
{
|
|
7078
7120
|
ref,
|
|
@@ -7086,25 +7128,25 @@ TabItem.displayName = "TabItem";
|
|
|
7086
7128
|
var TabItem_default = TabItem;
|
|
7087
7129
|
|
|
7088
7130
|
// src/components/Tab/Tab.tsx
|
|
7089
|
-
import { jsx as
|
|
7131
|
+
import { jsx as jsx316, jsxs as jsxs202 } from "react/jsx-runtime";
|
|
7090
7132
|
var Tab = (props) => {
|
|
7091
7133
|
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
7092
|
-
const [underlineStyle, setUnderlineStyle] =
|
|
7134
|
+
const [underlineStyle, setUnderlineStyle] = React13.useState({
|
|
7093
7135
|
left: 0,
|
|
7094
7136
|
width: 0
|
|
7095
7137
|
});
|
|
7096
|
-
const itemRefs =
|
|
7138
|
+
const itemRefs = React13.useRef([]);
|
|
7097
7139
|
const handleChangeActiveTab = (tabItem, tabIdx) => {
|
|
7098
7140
|
onChange(tabItem, tabIdx);
|
|
7099
7141
|
};
|
|
7100
|
-
|
|
7142
|
+
React13.useEffect(() => {
|
|
7101
7143
|
const el = itemRefs.current[activeIndex];
|
|
7102
7144
|
if (el) {
|
|
7103
7145
|
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
7104
7146
|
}
|
|
7105
7147
|
}, [activeIndex, tabs.length]);
|
|
7106
7148
|
return /* @__PURE__ */ jsxs202("div", { className: clsx_default("lib-xplat-tab", `type-${type}`, size), children: [
|
|
7107
|
-
tabs.map((tab, idx) => /* @__PURE__ */
|
|
7149
|
+
tabs.map((tab, idx) => /* @__PURE__ */ jsx316(
|
|
7108
7150
|
TabItem_default,
|
|
7109
7151
|
{
|
|
7110
7152
|
onClick: () => handleChangeActiveTab(tab, idx),
|
|
@@ -7116,7 +7158,7 @@ var Tab = (props) => {
|
|
|
7116
7158
|
},
|
|
7117
7159
|
`${tab.value}_${idx}`
|
|
7118
7160
|
)),
|
|
7119
|
-
type === "toggle" && /* @__PURE__ */
|
|
7161
|
+
type === "toggle" && /* @__PURE__ */ jsx316(
|
|
7120
7162
|
"div",
|
|
7121
7163
|
{
|
|
7122
7164
|
className: "tab-toggle-underline",
|
|
@@ -7132,7 +7174,7 @@ Tab.displayName = "Tab";
|
|
|
7132
7174
|
var Tab_default = Tab;
|
|
7133
7175
|
|
|
7134
7176
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
7135
|
-
import { jsx as
|
|
7177
|
+
import { jsx as jsx317, jsxs as jsxs203 } from "react/jsx-runtime";
|
|
7136
7178
|
var RangePicker = (props) => {
|
|
7137
7179
|
const {
|
|
7138
7180
|
startDate,
|
|
@@ -7142,7 +7184,7 @@ var RangePicker = (props) => {
|
|
|
7142
7184
|
maxDate,
|
|
7143
7185
|
locale = "ko"
|
|
7144
7186
|
} = props;
|
|
7145
|
-
const [activeTab, setActiveTab] =
|
|
7187
|
+
const [activeTab, setActiveTab] = React14.useState("start");
|
|
7146
7188
|
const handleStartChange = (date) => {
|
|
7147
7189
|
if (!date) return;
|
|
7148
7190
|
const newStart = date > endDate ? endDate : date;
|
|
@@ -7156,7 +7198,7 @@ var RangePicker = (props) => {
|
|
|
7156
7198
|
const startMaxDate = maxDate && endDate < maxDate ? endDate : endDate;
|
|
7157
7199
|
const endMinDate = minDate && startDate > minDate ? startDate : startDate;
|
|
7158
7200
|
return /* @__PURE__ */ jsxs203("div", { className: clsx_default("lib-xplat-datepicker", "range"), children: [
|
|
7159
|
-
/* @__PURE__ */
|
|
7201
|
+
/* @__PURE__ */ jsx317("div", { className: "datepicker-range-tabs", children: /* @__PURE__ */ jsx317(
|
|
7160
7202
|
Tab_default,
|
|
7161
7203
|
{
|
|
7162
7204
|
activeIndex: activeTab === "start" ? 0 : 1,
|
|
@@ -7170,7 +7212,7 @@ var RangePicker = (props) => {
|
|
|
7170
7212
|
}
|
|
7171
7213
|
) }),
|
|
7172
7214
|
/* @__PURE__ */ jsxs203("div", { className: "datepicker-range-panels", children: [
|
|
7173
|
-
/* @__PURE__ */
|
|
7215
|
+
/* @__PURE__ */ jsx317(
|
|
7174
7216
|
SingleDatePicker_default,
|
|
7175
7217
|
{
|
|
7176
7218
|
value: startDate,
|
|
@@ -7182,7 +7224,7 @@ var RangePicker = (props) => {
|
|
|
7182
7224
|
locale
|
|
7183
7225
|
}
|
|
7184
7226
|
),
|
|
7185
|
-
/* @__PURE__ */
|
|
7227
|
+
/* @__PURE__ */ jsx317(
|
|
7186
7228
|
SingleDatePicker_default,
|
|
7187
7229
|
{
|
|
7188
7230
|
value: endDate,
|
|
@@ -7195,7 +7237,7 @@ var RangePicker = (props) => {
|
|
|
7195
7237
|
}
|
|
7196
7238
|
)
|
|
7197
7239
|
] }),
|
|
7198
|
-
/* @__PURE__ */
|
|
7240
|
+
/* @__PURE__ */ jsx317("div", { className: "datepicker-range-mobile", children: activeTab === "start" ? /* @__PURE__ */ jsx317(
|
|
7199
7241
|
SingleDatePicker_default,
|
|
7200
7242
|
{
|
|
7201
7243
|
value: startDate,
|
|
@@ -7206,7 +7248,7 @@ var RangePicker = (props) => {
|
|
|
7206
7248
|
rangeEnd: endDate,
|
|
7207
7249
|
locale
|
|
7208
7250
|
}
|
|
7209
|
-
) : /* @__PURE__ */
|
|
7251
|
+
) : /* @__PURE__ */ jsx317(
|
|
7210
7252
|
SingleDatePicker_default,
|
|
7211
7253
|
{
|
|
7212
7254
|
value: endDate,
|
|
@@ -7224,10 +7266,10 @@ RangePicker.displayName = "RangePicker";
|
|
|
7224
7266
|
var RangePicker_default = RangePicker;
|
|
7225
7267
|
|
|
7226
7268
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
7227
|
-
import { jsx as
|
|
7269
|
+
import { jsx as jsx318, jsxs as jsxs204 } from "react/jsx-runtime";
|
|
7228
7270
|
var PopupPicker = (props) => {
|
|
7229
7271
|
const { component, type, locale } = props;
|
|
7230
|
-
const [isOpen, setIsOpen] =
|
|
7272
|
+
const [isOpen, setIsOpen] = React15.useState(false);
|
|
7231
7273
|
const handleClick = () => setIsOpen(true);
|
|
7232
7274
|
const handleClose = () => setIsOpen(false);
|
|
7233
7275
|
const handleSingleChange = (date) => {
|
|
@@ -7236,10 +7278,10 @@ var PopupPicker = (props) => {
|
|
|
7236
7278
|
handleClose();
|
|
7237
7279
|
};
|
|
7238
7280
|
return /* @__PURE__ */ jsxs204("div", { className: "lib-xplat-popup-datepicker", children: [
|
|
7239
|
-
|
|
7240
|
-
/* @__PURE__ */
|
|
7281
|
+
React15.cloneElement(component, { onClick: handleClick }),
|
|
7282
|
+
/* @__PURE__ */ jsx318(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ jsxs204("div", { className: clsx_default("lib-xplat-popup-datepicker-card", type === "range" && "range-mode"), children: [
|
|
7241
7283
|
/* @__PURE__ */ jsxs204("div", { className: "popup-datepicker-content", children: [
|
|
7242
|
-
type === "single" && /* @__PURE__ */
|
|
7284
|
+
type === "single" && /* @__PURE__ */ jsx318(
|
|
7243
7285
|
SingleDatePicker_default,
|
|
7244
7286
|
{
|
|
7245
7287
|
value: props.value,
|
|
@@ -7249,7 +7291,7 @@ var PopupPicker = (props) => {
|
|
|
7249
7291
|
locale
|
|
7250
7292
|
}
|
|
7251
7293
|
),
|
|
7252
|
-
type === "range" && /* @__PURE__ */
|
|
7294
|
+
type === "range" && /* @__PURE__ */ jsx318(
|
|
7253
7295
|
RangePicker_default,
|
|
7254
7296
|
{
|
|
7255
7297
|
startDate: props.startDate,
|
|
@@ -7262,7 +7304,7 @@ var PopupPicker = (props) => {
|
|
|
7262
7304
|
)
|
|
7263
7305
|
] }),
|
|
7264
7306
|
/* @__PURE__ */ jsxs204("div", { className: "popup-datepicker-footer", children: [
|
|
7265
|
-
/* @__PURE__ */
|
|
7307
|
+
/* @__PURE__ */ jsx318(
|
|
7266
7308
|
Button_default,
|
|
7267
7309
|
{
|
|
7268
7310
|
type: "secondary",
|
|
@@ -7270,7 +7312,7 @@ var PopupPicker = (props) => {
|
|
|
7270
7312
|
children: locale === "ko" ? "\uCDE8\uC18C" : "Cancel"
|
|
7271
7313
|
}
|
|
7272
7314
|
),
|
|
7273
|
-
/* @__PURE__ */
|
|
7315
|
+
/* @__PURE__ */ jsx318(Button_default, { type: "primary", onClick: handleClose, children: locale === "ko" ? "\uC801\uC6A9" : "Apply" })
|
|
7274
7316
|
] })
|
|
7275
7317
|
] }) })
|
|
7276
7318
|
] });
|
|
@@ -7279,10 +7321,10 @@ PopupPicker.displayName = "PopupPicker";
|
|
|
7279
7321
|
var PopupPicker_default = PopupPicker;
|
|
7280
7322
|
|
|
7281
7323
|
// src/components/Divider/Divider.tsx
|
|
7282
|
-
import { jsx as
|
|
7324
|
+
import { jsx as jsx319 } from "react/jsx-runtime";
|
|
7283
7325
|
var Divider = (props) => {
|
|
7284
7326
|
const { orientation = "horizontal" } = props;
|
|
7285
|
-
return /* @__PURE__ */
|
|
7327
|
+
return /* @__PURE__ */ jsx319(
|
|
7286
7328
|
"div",
|
|
7287
7329
|
{
|
|
7288
7330
|
className: clsx_default("lib-xplat-divider", orientation),
|
|
@@ -7295,15 +7337,15 @@ Divider.displayName = "Divider";
|
|
|
7295
7337
|
var Divider_default = Divider;
|
|
7296
7338
|
|
|
7297
7339
|
// src/components/Drawer/Drawer.tsx
|
|
7298
|
-
import
|
|
7340
|
+
import React16 from "react";
|
|
7299
7341
|
import { createPortal as createPortal2 } from "react-dom";
|
|
7300
|
-
import { jsx as
|
|
7342
|
+
import { jsx as jsx320, jsxs as jsxs205 } from "react/jsx-runtime";
|
|
7301
7343
|
var ANIMATION_DURATION_MS2 = 250;
|
|
7302
7344
|
var Drawer = (props) => {
|
|
7303
7345
|
const { isOpen, onClose, placement = "right", width = 320, title, children } = props;
|
|
7304
|
-
const [mounted, setMounted] =
|
|
7305
|
-
const [visible, setVisible] =
|
|
7306
|
-
|
|
7346
|
+
const [mounted, setMounted] = React16.useState(false);
|
|
7347
|
+
const [visible, setVisible] = React16.useState(false);
|
|
7348
|
+
React16.useEffect(() => {
|
|
7307
7349
|
if (isOpen) {
|
|
7308
7350
|
setMounted(true);
|
|
7309
7351
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -7318,7 +7360,7 @@ var Drawer = (props) => {
|
|
|
7318
7360
|
const stateClass = visible ? "enter" : "exit";
|
|
7319
7361
|
const widthValue = typeof width === "number" ? `${width}px` : width;
|
|
7320
7362
|
return createPortal2(
|
|
7321
|
-
/* @__PURE__ */
|
|
7363
|
+
/* @__PURE__ */ jsx320(
|
|
7322
7364
|
"div",
|
|
7323
7365
|
{
|
|
7324
7366
|
className: clsx_default("lib-xplat-drawer-overlay", stateClass),
|
|
@@ -7333,10 +7375,10 @@ var Drawer = (props) => {
|
|
|
7333
7375
|
onClick: (e) => e.stopPropagation(),
|
|
7334
7376
|
children: [
|
|
7335
7377
|
title && /* @__PURE__ */ jsxs205("div", { className: "drawer-header", children: [
|
|
7336
|
-
/* @__PURE__ */
|
|
7337
|
-
/* @__PURE__ */
|
|
7378
|
+
/* @__PURE__ */ jsx320("span", { className: "drawer-title", children: title }),
|
|
7379
|
+
/* @__PURE__ */ jsx320("button", { className: "close-btn", onClick: onClose, "aria-label": "\uB2EB\uAE30", children: "\xD7" })
|
|
7338
7380
|
] }),
|
|
7339
|
-
/* @__PURE__ */
|
|
7381
|
+
/* @__PURE__ */ jsx320("div", { className: "drawer-body", children })
|
|
7340
7382
|
]
|
|
7341
7383
|
}
|
|
7342
7384
|
)
|
|
@@ -7349,16 +7391,16 @@ Drawer.displayName = "Drawer";
|
|
|
7349
7391
|
var Drawer_default = Drawer;
|
|
7350
7392
|
|
|
7351
7393
|
// src/components/Dropdown/Dropdown.tsx
|
|
7352
|
-
import
|
|
7394
|
+
import React19 from "react";
|
|
7353
7395
|
|
|
7354
7396
|
// src/tokens/hooks/useAutoPosition.ts
|
|
7355
|
-
import
|
|
7397
|
+
import React17 from "react";
|
|
7356
7398
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
7357
|
-
const [position, setPosition] =
|
|
7399
|
+
const [position, setPosition] = React17.useState({
|
|
7358
7400
|
position: {},
|
|
7359
7401
|
direction: "bottom"
|
|
7360
7402
|
});
|
|
7361
|
-
const calculatePosition =
|
|
7403
|
+
const calculatePosition = React17.useCallback(() => {
|
|
7362
7404
|
if (!triggerRef.current || !popRef.current) return;
|
|
7363
7405
|
const triggerRect = triggerRef.current.getBoundingClientRect();
|
|
7364
7406
|
const popRect = popRef.current.getBoundingClientRect();
|
|
@@ -7382,12 +7424,15 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
7382
7424
|
direction
|
|
7383
7425
|
});
|
|
7384
7426
|
}, [triggerRef, popRef]);
|
|
7385
|
-
|
|
7427
|
+
React17.useEffect(() => {
|
|
7386
7428
|
if (!enabled) return;
|
|
7387
|
-
|
|
7429
|
+
const raf = requestAnimationFrame(() => {
|
|
7430
|
+
calculatePosition();
|
|
7431
|
+
});
|
|
7388
7432
|
window.addEventListener("resize", calculatePosition);
|
|
7389
7433
|
window.addEventListener("scroll", calculatePosition, true);
|
|
7390
7434
|
return () => {
|
|
7435
|
+
cancelAnimationFrame(raf);
|
|
7391
7436
|
window.removeEventListener("resize", calculatePosition);
|
|
7392
7437
|
window.removeEventListener("scroll", calculatePosition, true);
|
|
7393
7438
|
};
|
|
@@ -7397,9 +7442,9 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
7397
7442
|
var useAutoPosition_default = useAutoPosition;
|
|
7398
7443
|
|
|
7399
7444
|
// src/tokens/hooks/useClickOutside.ts
|
|
7400
|
-
import
|
|
7445
|
+
import React18 from "react";
|
|
7401
7446
|
var useClickOutside = (refs, handler, enabled = true) => {
|
|
7402
|
-
|
|
7447
|
+
React18.useEffect(() => {
|
|
7403
7448
|
if (!enabled) return;
|
|
7404
7449
|
const refArray = Array.isArray(refs) ? refs : [refs];
|
|
7405
7450
|
const listener = (event) => {
|
|
@@ -7422,17 +7467,17 @@ var useClickOutside = (refs, handler, enabled = true) => {
|
|
|
7422
7467
|
var useClickOutside_default = useClickOutside;
|
|
7423
7468
|
|
|
7424
7469
|
// src/components/Dropdown/Dropdown.tsx
|
|
7425
|
-
import { jsx as
|
|
7470
|
+
import { jsx as jsx321, jsxs as jsxs206 } from "react/jsx-runtime";
|
|
7426
7471
|
var Dropdown = (props) => {
|
|
7427
7472
|
const { items, children } = props;
|
|
7428
|
-
const [isOpen, setIsOpen] =
|
|
7429
|
-
const [mounted, setMounted] =
|
|
7430
|
-
const [visible, setVisible] =
|
|
7431
|
-
const triggerRef =
|
|
7432
|
-
const menuRef =
|
|
7433
|
-
const { position, direction } = useAutoPosition_default(triggerRef, menuRef,
|
|
7434
|
-
useClickOutside_default([triggerRef, menuRef], () => setIsOpen(false));
|
|
7435
|
-
|
|
7473
|
+
const [isOpen, setIsOpen] = React19.useState(false);
|
|
7474
|
+
const [mounted, setMounted] = React19.useState(false);
|
|
7475
|
+
const [visible, setVisible] = React19.useState(false);
|
|
7476
|
+
const triggerRef = React19.useRef(null);
|
|
7477
|
+
const menuRef = React19.useRef(null);
|
|
7478
|
+
const { position, direction } = useAutoPosition_default(triggerRef, menuRef, mounted);
|
|
7479
|
+
useClickOutside_default([triggerRef, menuRef], () => setIsOpen(false), isOpen);
|
|
7480
|
+
React19.useEffect(() => {
|
|
7436
7481
|
if (isOpen) {
|
|
7437
7482
|
setMounted(true);
|
|
7438
7483
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -7448,7 +7493,7 @@ var Dropdown = (props) => {
|
|
|
7448
7493
|
setIsOpen(false);
|
|
7449
7494
|
};
|
|
7450
7495
|
return /* @__PURE__ */ jsxs206("div", { className: "lib-xplat-dropdown", children: [
|
|
7451
|
-
/* @__PURE__ */
|
|
7496
|
+
/* @__PURE__ */ jsx321(
|
|
7452
7497
|
"div",
|
|
7453
7498
|
{
|
|
7454
7499
|
ref: triggerRef,
|
|
@@ -7457,14 +7502,14 @@ var Dropdown = (props) => {
|
|
|
7457
7502
|
children
|
|
7458
7503
|
}
|
|
7459
7504
|
),
|
|
7460
|
-
mounted && /* @__PURE__ */
|
|
7505
|
+
mounted && /* @__PURE__ */ jsx321(Portal_default, { children: /* @__PURE__ */ jsx321(
|
|
7461
7506
|
"div",
|
|
7462
7507
|
{
|
|
7463
7508
|
ref: menuRef,
|
|
7464
|
-
className: clsx_default("dropdown-menu", direction, { visible }),
|
|
7509
|
+
className: clsx_default("lib-xplat-dropdown-menu", direction, { visible }),
|
|
7465
7510
|
style: { top: position.top, left: position.left },
|
|
7466
7511
|
role: "menu",
|
|
7467
|
-
children: items.map((item) => /* @__PURE__ */
|
|
7512
|
+
children: items.map((item) => /* @__PURE__ */ jsx321(
|
|
7468
7513
|
"button",
|
|
7469
7514
|
{
|
|
7470
7515
|
className: clsx_default("dropdown-item", {
|
|
@@ -7479,30 +7524,30 @@ var Dropdown = (props) => {
|
|
|
7479
7524
|
item.key
|
|
7480
7525
|
))
|
|
7481
7526
|
}
|
|
7482
|
-
)
|
|
7527
|
+
) })
|
|
7483
7528
|
] });
|
|
7484
7529
|
};
|
|
7485
7530
|
Dropdown.displayName = "Dropdown";
|
|
7486
7531
|
var Dropdown_default = Dropdown;
|
|
7487
7532
|
|
|
7488
7533
|
// src/components/EmptyState/EmptyState.tsx
|
|
7489
|
-
import { jsx as
|
|
7534
|
+
import { jsx as jsx322, jsxs as jsxs207 } from "react/jsx-runtime";
|
|
7490
7535
|
var EmptyState = (props) => {
|
|
7491
7536
|
const { icon, title = "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4", description, action } = props;
|
|
7492
7537
|
return /* @__PURE__ */ jsxs207("div", { className: "lib-xplat-empty-state", children: [
|
|
7493
|
-
icon && /* @__PURE__ */
|
|
7494
|
-
!icon && /* @__PURE__ */
|
|
7495
|
-
/* @__PURE__ */
|
|
7496
|
-
description && /* @__PURE__ */
|
|
7497
|
-
action && /* @__PURE__ */
|
|
7538
|
+
icon && /* @__PURE__ */ jsx322("div", { className: "empty-icon", children: icon }),
|
|
7539
|
+
!icon && /* @__PURE__ */ jsx322("div", { className: "empty-icon", children: /* @__PURE__ */ jsx322("svg", { viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx322("path", { d: "M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z" }) }) }),
|
|
7540
|
+
/* @__PURE__ */ jsx322("p", { className: "empty-title", children: title }),
|
|
7541
|
+
description && /* @__PURE__ */ jsx322("p", { className: "empty-description", children: description }),
|
|
7542
|
+
action && /* @__PURE__ */ jsx322("div", { className: "empty-action", children: action })
|
|
7498
7543
|
] });
|
|
7499
7544
|
};
|
|
7500
7545
|
EmptyState.displayName = "EmptyState";
|
|
7501
7546
|
var EmptyState_default = EmptyState;
|
|
7502
7547
|
|
|
7503
7548
|
// src/components/FileUpload/FileUpload.tsx
|
|
7504
|
-
import
|
|
7505
|
-
import { jsx as
|
|
7549
|
+
import React20 from "react";
|
|
7550
|
+
import { jsx as jsx323, jsxs as jsxs208 } from "react/jsx-runtime";
|
|
7506
7551
|
var FileUpload = (props) => {
|
|
7507
7552
|
const {
|
|
7508
7553
|
accept,
|
|
@@ -7512,8 +7557,8 @@ var FileUpload = (props) => {
|
|
|
7512
7557
|
label = "\uD30C\uC77C\uC744 \uB4DC\uB798\uADF8\uD558\uAC70\uB098 \uD074\uB9AD\uD558\uC5EC \uC5C5\uB85C\uB4DC",
|
|
7513
7558
|
description
|
|
7514
7559
|
} = props;
|
|
7515
|
-
const [isDragOver, setIsDragOver] =
|
|
7516
|
-
const inputRef =
|
|
7560
|
+
const [isDragOver, setIsDragOver] = React20.useState(false);
|
|
7561
|
+
const inputRef = React20.useRef(null);
|
|
7517
7562
|
const handleFiles = (fileList) => {
|
|
7518
7563
|
let files = Array.from(fileList);
|
|
7519
7564
|
if (maxSize) {
|
|
@@ -7552,7 +7597,7 @@ var FileUpload = (props) => {
|
|
|
7552
7597
|
onDragLeave: handleDragLeave,
|
|
7553
7598
|
onClick: () => inputRef.current?.click(),
|
|
7554
7599
|
children: [
|
|
7555
|
-
/* @__PURE__ */
|
|
7600
|
+
/* @__PURE__ */ jsx323(
|
|
7556
7601
|
"input",
|
|
7557
7602
|
{
|
|
7558
7603
|
ref: inputRef,
|
|
@@ -7562,9 +7607,9 @@ var FileUpload = (props) => {
|
|
|
7562
7607
|
onChange: handleChange
|
|
7563
7608
|
}
|
|
7564
7609
|
),
|
|
7565
|
-
/* @__PURE__ */
|
|
7566
|
-
/* @__PURE__ */
|
|
7567
|
-
description && /* @__PURE__ */
|
|
7610
|
+
/* @__PURE__ */ jsx323("div", { className: "upload-icon", children: /* @__PURE__ */ jsx323(UploadIcon_default, {}) }),
|
|
7611
|
+
/* @__PURE__ */ jsx323("p", { className: "upload-label", children: label }),
|
|
7612
|
+
description && /* @__PURE__ */ jsx323("p", { className: "upload-description", children: description })
|
|
7568
7613
|
]
|
|
7569
7614
|
}
|
|
7570
7615
|
);
|
|
@@ -7573,10 +7618,10 @@ FileUpload.displayName = "FileUpload";
|
|
|
7573
7618
|
var FileUpload_default = FileUpload;
|
|
7574
7619
|
|
|
7575
7620
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
7576
|
-
import
|
|
7621
|
+
import React22 from "react";
|
|
7577
7622
|
|
|
7578
7623
|
// src/components/HtmlTypeWriter/utils.ts
|
|
7579
|
-
import
|
|
7624
|
+
import React21 from "react";
|
|
7580
7625
|
var voidTags = /* @__PURE__ */ new Set([
|
|
7581
7626
|
"br",
|
|
7582
7627
|
"img",
|
|
@@ -7644,41 +7689,41 @@ var convertNodeToReactWithRange = (node, typedLen, rangeMap) => {
|
|
|
7644
7689
|
props[attr.name] = attr.value;
|
|
7645
7690
|
});
|
|
7646
7691
|
if (voidTags.has(tag)) {
|
|
7647
|
-
return
|
|
7692
|
+
return React21.createElement(tag, props);
|
|
7648
7693
|
}
|
|
7649
7694
|
const children = Array.from(element.childNodes).map((child) => convertNodeToReactWithRange(child, typedLen, rangeMap)).filter((n) => n != null);
|
|
7650
|
-
return
|
|
7695
|
+
return React21.createElement(tag, props, ...children);
|
|
7651
7696
|
};
|
|
7652
7697
|
var htmlToReactProgressive = (root, typedLen, rangeMap) => {
|
|
7653
7698
|
const nodes = Array.from(root.childNodes).map((child, idx) => {
|
|
7654
7699
|
const node = convertNodeToReactWithRange(child, typedLen, rangeMap);
|
|
7655
|
-
return node == null ? null :
|
|
7700
|
+
return node == null ? null : React21.createElement(React21.Fragment, { key: idx }, node);
|
|
7656
7701
|
}).filter(Boolean);
|
|
7657
7702
|
return nodes.length === 0 ? null : nodes;
|
|
7658
7703
|
};
|
|
7659
7704
|
|
|
7660
7705
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
7661
|
-
import { jsx as
|
|
7706
|
+
import { jsx as jsx324 } from "react/jsx-runtime";
|
|
7662
7707
|
var HtmlTypeWriter = ({
|
|
7663
7708
|
html,
|
|
7664
7709
|
duration = 20,
|
|
7665
7710
|
onDone,
|
|
7666
7711
|
onChange
|
|
7667
7712
|
}) => {
|
|
7668
|
-
const [typedLen, setTypedLen] =
|
|
7669
|
-
const doneCalledRef =
|
|
7670
|
-
const { doc, rangeMap, totalLength } =
|
|
7713
|
+
const [typedLen, setTypedLen] = React22.useState(0);
|
|
7714
|
+
const doneCalledRef = React22.useRef(false);
|
|
7715
|
+
const { doc, rangeMap, totalLength } = React22.useMemo(() => {
|
|
7671
7716
|
if (typeof window === "undefined") return { doc: null, rangeMap: /* @__PURE__ */ new Map(), totalLength: 0 };
|
|
7672
7717
|
const decoded = decodeHtmlEntities(html);
|
|
7673
7718
|
const doc2 = new DOMParser().parseFromString(decoded, "text/html");
|
|
7674
7719
|
const { rangeMap: rangeMap2, totalLength: totalLength2 } = buildRangeMap(doc2.body);
|
|
7675
7720
|
return { doc: doc2, rangeMap: rangeMap2, totalLength: totalLength2 };
|
|
7676
7721
|
}, [html]);
|
|
7677
|
-
|
|
7722
|
+
React22.useEffect(() => {
|
|
7678
7723
|
setTypedLen(0);
|
|
7679
7724
|
doneCalledRef.current = false;
|
|
7680
7725
|
}, [html]);
|
|
7681
|
-
|
|
7726
|
+
React22.useEffect(() => {
|
|
7682
7727
|
if (!totalLength) return;
|
|
7683
7728
|
if (typedLen >= totalLength) return;
|
|
7684
7729
|
const timer = window.setInterval(() => {
|
|
@@ -7686,33 +7731,33 @@ var HtmlTypeWriter = ({
|
|
|
7686
7731
|
}, duration);
|
|
7687
7732
|
return () => window.clearInterval(timer);
|
|
7688
7733
|
}, [typedLen, totalLength, duration]);
|
|
7689
|
-
|
|
7734
|
+
React22.useEffect(() => {
|
|
7690
7735
|
if (typedLen > 0 && typedLen < totalLength) {
|
|
7691
7736
|
onChange?.();
|
|
7692
7737
|
}
|
|
7693
7738
|
}, [typedLen, totalLength, onChange]);
|
|
7694
|
-
|
|
7739
|
+
React22.useEffect(() => {
|
|
7695
7740
|
if (typedLen === totalLength && totalLength > 0 && !doneCalledRef.current) {
|
|
7696
7741
|
doneCalledRef.current = true;
|
|
7697
7742
|
onDone?.();
|
|
7698
7743
|
}
|
|
7699
7744
|
}, [typedLen, totalLength, onDone]);
|
|
7700
|
-
const parsed =
|
|
7745
|
+
const parsed = React22.useMemo(
|
|
7701
7746
|
() => doc ? htmlToReactProgressive(doc.body, typedLen, rangeMap) : null,
|
|
7702
7747
|
[doc, typedLen, rangeMap]
|
|
7703
7748
|
);
|
|
7704
|
-
return /* @__PURE__ */
|
|
7749
|
+
return /* @__PURE__ */ jsx324("div", { className: "lib-xplat-htmlTypewriter", children: parsed });
|
|
7705
7750
|
};
|
|
7706
7751
|
HtmlTypeWriter.displayName = "HtmlTypeWriter";
|
|
7707
7752
|
var HtmlTypeWriter_default = HtmlTypeWriter;
|
|
7708
7753
|
|
|
7709
7754
|
// src/components/ImageSelector/ImageSelector.tsx
|
|
7710
|
-
import
|
|
7711
|
-
import { jsx as
|
|
7755
|
+
import React23 from "react";
|
|
7756
|
+
import { jsx as jsx325, jsxs as jsxs209 } from "react/jsx-runtime";
|
|
7712
7757
|
var ImageSelector = (props) => {
|
|
7713
7758
|
const { value, label, onChange } = props;
|
|
7714
|
-
const [previewUrl, setPreviewUrl] =
|
|
7715
|
-
|
|
7759
|
+
const [previewUrl, setPreviewUrl] = React23.useState();
|
|
7760
|
+
React23.useEffect(() => {
|
|
7716
7761
|
if (!value) {
|
|
7717
7762
|
setPreviewUrl(void 0);
|
|
7718
7763
|
return;
|
|
@@ -7721,7 +7766,7 @@ var ImageSelector = (props) => {
|
|
|
7721
7766
|
setPreviewUrl(url);
|
|
7722
7767
|
return () => URL.revokeObjectURL(url);
|
|
7723
7768
|
}, [value]);
|
|
7724
|
-
const inputRef =
|
|
7769
|
+
const inputRef = React23.useRef(null);
|
|
7725
7770
|
const handleFileChange = (e) => {
|
|
7726
7771
|
const selectedFile = e.target.files?.[0];
|
|
7727
7772
|
if (selectedFile) {
|
|
@@ -7735,7 +7780,7 @@ var ImageSelector = (props) => {
|
|
|
7735
7780
|
inputRef.current?.click();
|
|
7736
7781
|
};
|
|
7737
7782
|
return /* @__PURE__ */ jsxs209("div", { className: `lib-xplat-imageselector${value ? "" : " none-value"}`, children: [
|
|
7738
|
-
/* @__PURE__ */
|
|
7783
|
+
/* @__PURE__ */ jsx325(
|
|
7739
7784
|
"input",
|
|
7740
7785
|
{
|
|
7741
7786
|
type: "file",
|
|
@@ -7746,12 +7791,12 @@ var ImageSelector = (props) => {
|
|
|
7746
7791
|
}
|
|
7747
7792
|
),
|
|
7748
7793
|
value && /* @__PURE__ */ jsxs209("div", { className: "action-bar", children: [
|
|
7749
|
-
/* @__PURE__ */
|
|
7750
|
-
/* @__PURE__ */
|
|
7794
|
+
/* @__PURE__ */ jsx325("div", { className: "icon-wrapper", onClick: handleOpenFileDialog, children: /* @__PURE__ */ jsx325(UploadIcon_default, {}) }),
|
|
7795
|
+
/* @__PURE__ */ jsx325("div", { className: "icon-wrapper", onClick: handleDeleteFile, children: /* @__PURE__ */ jsx325(DeleteIcon_default, {}) })
|
|
7751
7796
|
] }),
|
|
7752
|
-
/* @__PURE__ */
|
|
7753
|
-
/* @__PURE__ */
|
|
7754
|
-
/* @__PURE__ */
|
|
7797
|
+
/* @__PURE__ */ jsx325("div", { className: "content", children: previewUrl ? /* @__PURE__ */ jsx325("img", { src: previewUrl, alt: "preview" }) : /* @__PURE__ */ jsxs209("div", { className: "skeleton", onClick: handleOpenFileDialog, children: [
|
|
7798
|
+
/* @__PURE__ */ jsx325("div", { className: "icon-wrapper", children: /* @__PURE__ */ jsx325(ImageIcon_default, {}) }),
|
|
7799
|
+
/* @__PURE__ */ jsx325("div", { className: "label", children: label || "\uC774\uBBF8\uC9C0 \uCD94\uAC00\uD558\uAE30" })
|
|
7755
7800
|
] }) })
|
|
7756
7801
|
] });
|
|
7757
7802
|
};
|
|
@@ -7759,7 +7804,7 @@ ImageSelector.displayName = "ImageSelector";
|
|
|
7759
7804
|
var ImageSelector_default = ImageSelector;
|
|
7760
7805
|
|
|
7761
7806
|
// src/components/Pagination/Pagination.tsx
|
|
7762
|
-
import { jsx as
|
|
7807
|
+
import { jsx as jsx326, jsxs as jsxs210 } from "react/jsx-runtime";
|
|
7763
7808
|
var getPageRange = (current, totalPages, siblingCount) => {
|
|
7764
7809
|
const totalNumbers = siblingCount * 2 + 5;
|
|
7765
7810
|
if (totalPages <= totalNumbers) {
|
|
@@ -7803,18 +7848,18 @@ var Pagination = (props) => {
|
|
|
7803
7848
|
}
|
|
7804
7849
|
};
|
|
7805
7850
|
return /* @__PURE__ */ jsxs210("nav", { className: clsx_default("lib-xplat-pagination", size, type), "aria-label": "\uD398\uC774\uC9C0 \uB124\uBE44\uAC8C\uC774\uC158", children: [
|
|
7806
|
-
/* @__PURE__ */
|
|
7851
|
+
/* @__PURE__ */ jsx326(
|
|
7807
7852
|
"button",
|
|
7808
7853
|
{
|
|
7809
7854
|
className: "page-btn prev",
|
|
7810
7855
|
disabled: current <= 1,
|
|
7811
7856
|
onClick: () => handleClick(current - 1),
|
|
7812
7857
|
"aria-label": "\uC774\uC804 \uD398\uC774\uC9C0",
|
|
7813
|
-
children: /* @__PURE__ */
|
|
7858
|
+
children: /* @__PURE__ */ jsx326(ChevronLeftIcon_default, {})
|
|
7814
7859
|
}
|
|
7815
7860
|
),
|
|
7816
7861
|
pages.map(
|
|
7817
|
-
(page, i) => page === "..." ? /* @__PURE__ */
|
|
7862
|
+
(page, i) => page === "..." ? /* @__PURE__ */ jsx326("span", { className: "dots", children: "..." }, `dots-${i}`) : /* @__PURE__ */ jsx326(
|
|
7818
7863
|
"button",
|
|
7819
7864
|
{
|
|
7820
7865
|
className: clsx_default("page-btn", { active: page === current }),
|
|
@@ -7825,14 +7870,14 @@ var Pagination = (props) => {
|
|
|
7825
7870
|
page
|
|
7826
7871
|
)
|
|
7827
7872
|
),
|
|
7828
|
-
/* @__PURE__ */
|
|
7873
|
+
/* @__PURE__ */ jsx326(
|
|
7829
7874
|
"button",
|
|
7830
7875
|
{
|
|
7831
7876
|
className: "page-btn next",
|
|
7832
7877
|
disabled: current >= totalPages,
|
|
7833
7878
|
onClick: () => handleClick(current + 1),
|
|
7834
7879
|
"aria-label": "\uB2E4\uC74C \uD398\uC774\uC9C0",
|
|
7835
|
-
children: /* @__PURE__ */
|
|
7880
|
+
children: /* @__PURE__ */ jsx326(ChevronRightIcon_default, {})
|
|
7836
7881
|
}
|
|
7837
7882
|
)
|
|
7838
7883
|
] });
|
|
@@ -7841,17 +7886,17 @@ Pagination.displayName = "Pagination";
|
|
|
7841
7886
|
var Pagination_default = Pagination;
|
|
7842
7887
|
|
|
7843
7888
|
// src/components/PopOver/PopOver.tsx
|
|
7844
|
-
import
|
|
7845
|
-
import { jsx as
|
|
7889
|
+
import React24 from "react";
|
|
7890
|
+
import { jsx as jsx327, jsxs as jsxs211 } from "react/jsx-runtime";
|
|
7846
7891
|
var PopOver = (props) => {
|
|
7847
7892
|
const { children, isOpen, onClose, PopOverEl } = props;
|
|
7848
|
-
const popRef =
|
|
7849
|
-
const triggerRef =
|
|
7850
|
-
const [localOpen, setLocalOpen] =
|
|
7851
|
-
const [eventTrigger, setEventTrigger] =
|
|
7893
|
+
const popRef = React24.useRef(null);
|
|
7894
|
+
const triggerRef = React24.useRef(null);
|
|
7895
|
+
const [localOpen, setLocalOpen] = React24.useState(false);
|
|
7896
|
+
const [eventTrigger, setEventTrigger] = React24.useState(false);
|
|
7852
7897
|
useClickOutside_default([popRef, triggerRef], onClose, isOpen);
|
|
7853
7898
|
const position = useAutoPosition_default(triggerRef, popRef, localOpen);
|
|
7854
|
-
|
|
7899
|
+
React24.useEffect(() => {
|
|
7855
7900
|
if (isOpen) {
|
|
7856
7901
|
setLocalOpen(isOpen);
|
|
7857
7902
|
setTimeout(() => {
|
|
@@ -7874,11 +7919,11 @@ var PopOver = (props) => {
|
|
|
7874
7919
|
},
|
|
7875
7920
|
children: [
|
|
7876
7921
|
children,
|
|
7877
|
-
localOpen && /* @__PURE__ */
|
|
7922
|
+
localOpen && /* @__PURE__ */ jsx327(Portal_default, { children: /* @__PURE__ */ jsx327(
|
|
7878
7923
|
"div",
|
|
7879
7924
|
{
|
|
7880
7925
|
className: clsx_default(
|
|
7881
|
-
"content
|
|
7926
|
+
"lib-xplat-pop-over-content",
|
|
7882
7927
|
position.direction,
|
|
7883
7928
|
eventTrigger && "visible"
|
|
7884
7929
|
),
|
|
@@ -7888,7 +7933,7 @@ var PopOver = (props) => {
|
|
|
7888
7933
|
},
|
|
7889
7934
|
children: PopOverEl
|
|
7890
7935
|
}
|
|
7891
|
-
)
|
|
7936
|
+
) })
|
|
7892
7937
|
]
|
|
7893
7938
|
}
|
|
7894
7939
|
);
|
|
@@ -7897,7 +7942,7 @@ PopOver.displayName = "PopOver";
|
|
|
7897
7942
|
var PopOver_default = PopOver;
|
|
7898
7943
|
|
|
7899
7944
|
// src/components/Progress/Progress.tsx
|
|
7900
|
-
import { jsx as
|
|
7945
|
+
import { jsx as jsx328, jsxs as jsxs212 } from "react/jsx-runtime";
|
|
7901
7946
|
var Progress = (props) => {
|
|
7902
7947
|
const {
|
|
7903
7948
|
value,
|
|
@@ -7908,7 +7953,7 @@ var Progress = (props) => {
|
|
|
7908
7953
|
} = props;
|
|
7909
7954
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
7910
7955
|
return /* @__PURE__ */ jsxs212("div", { className: clsx_default("lib-xplat-progress", size, type), children: [
|
|
7911
|
-
/* @__PURE__ */
|
|
7956
|
+
/* @__PURE__ */ jsx328(
|
|
7912
7957
|
"div",
|
|
7913
7958
|
{
|
|
7914
7959
|
className: "track",
|
|
@@ -7916,7 +7961,7 @@ var Progress = (props) => {
|
|
|
7916
7961
|
"aria-valuenow": value,
|
|
7917
7962
|
"aria-valuemin": 0,
|
|
7918
7963
|
"aria-valuemax": max,
|
|
7919
|
-
children: /* @__PURE__ */
|
|
7964
|
+
children: /* @__PURE__ */ jsx328(
|
|
7920
7965
|
"div",
|
|
7921
7966
|
{
|
|
7922
7967
|
className: "bar",
|
|
@@ -7935,17 +7980,17 @@ Progress.displayName = "Progress";
|
|
|
7935
7980
|
var Progress_default = Progress;
|
|
7936
7981
|
|
|
7937
7982
|
// src/components/Radio/RadioGroupContext.tsx
|
|
7938
|
-
import
|
|
7939
|
-
var RadioGroupContext =
|
|
7983
|
+
import React25 from "react";
|
|
7984
|
+
var RadioGroupContext = React25.createContext(
|
|
7940
7985
|
null
|
|
7941
7986
|
);
|
|
7942
7987
|
var useRadioGroupContext = () => {
|
|
7943
|
-
return
|
|
7988
|
+
return React25.useContext(RadioGroupContext);
|
|
7944
7989
|
};
|
|
7945
7990
|
var RadioGroupContext_default = RadioGroupContext;
|
|
7946
7991
|
|
|
7947
7992
|
// src/components/Radio/Radio.tsx
|
|
7948
|
-
import { jsx as
|
|
7993
|
+
import { jsx as jsx329, jsxs as jsxs213 } from "react/jsx-runtime";
|
|
7949
7994
|
var Radio = (props) => {
|
|
7950
7995
|
const {
|
|
7951
7996
|
label,
|
|
@@ -7973,18 +8018,18 @@ var Radio = (props) => {
|
|
|
7973
8018
|
localChecked ? "checked" : void 0
|
|
7974
8019
|
),
|
|
7975
8020
|
children: [
|
|
7976
|
-
/* @__PURE__ */
|
|
7977
|
-
/* @__PURE__ */
|
|
8021
|
+
/* @__PURE__ */ jsx329("input", { ...rest, ...inputProps, checked: localChecked, type: "radio" }),
|
|
8022
|
+
/* @__PURE__ */ jsx329(
|
|
7978
8023
|
"div",
|
|
7979
8024
|
{
|
|
7980
8025
|
className: clsx_default(
|
|
7981
8026
|
"circle",
|
|
7982
8027
|
localChecked ? "checked" : void 0
|
|
7983
8028
|
),
|
|
7984
|
-
children: localChecked && /* @__PURE__ */
|
|
8029
|
+
children: localChecked && /* @__PURE__ */ jsx329("div", { className: "inner-circle" })
|
|
7985
8030
|
}
|
|
7986
8031
|
),
|
|
7987
|
-
label && /* @__PURE__ */
|
|
8032
|
+
label && /* @__PURE__ */ jsx329("span", { children: label })
|
|
7988
8033
|
]
|
|
7989
8034
|
}
|
|
7990
8035
|
);
|
|
@@ -7993,28 +8038,28 @@ Radio.displayName = "Radio";
|
|
|
7993
8038
|
var Radio_default = Radio;
|
|
7994
8039
|
|
|
7995
8040
|
// src/components/Radio/RadioGroup.tsx
|
|
7996
|
-
import { Fragment as
|
|
8041
|
+
import { Fragment as Fragment4, jsx as jsx330 } from "react/jsx-runtime";
|
|
7997
8042
|
var RadioGroup = (props) => {
|
|
7998
8043
|
const { children, ...rest } = props;
|
|
7999
|
-
return /* @__PURE__ */
|
|
8044
|
+
return /* @__PURE__ */ jsx330(Fragment4, { children: /* @__PURE__ */ jsx330(RadioGroupContext_default.Provider, { value: rest, children }) });
|
|
8000
8045
|
};
|
|
8001
8046
|
RadioGroup.displayName = "RadioGroup";
|
|
8002
8047
|
var RadioGroup_default = RadioGroup;
|
|
8003
8048
|
|
|
8004
8049
|
// src/components/Select/Select.tsx
|
|
8005
|
-
import
|
|
8050
|
+
import React28 from "react";
|
|
8006
8051
|
|
|
8007
8052
|
// src/components/Select/context.ts
|
|
8008
|
-
import
|
|
8009
|
-
var SelectContext =
|
|
8053
|
+
import React26 from "react";
|
|
8054
|
+
var SelectContext = React26.createContext(null);
|
|
8010
8055
|
var context_default = SelectContext;
|
|
8011
8056
|
|
|
8012
8057
|
// src/components/Select/SelectItem.tsx
|
|
8013
|
-
import
|
|
8014
|
-
import { jsx as
|
|
8058
|
+
import React27 from "react";
|
|
8059
|
+
import { jsx as jsx331 } from "react/jsx-runtime";
|
|
8015
8060
|
var SelectItem = (props) => {
|
|
8016
8061
|
const { children, value, onClick, disabled = false } = props;
|
|
8017
|
-
const ctx =
|
|
8062
|
+
const ctx = React27.useContext(context_default);
|
|
8018
8063
|
const handleClick = (e) => {
|
|
8019
8064
|
e.preventDefault();
|
|
8020
8065
|
e.stopPropagation();
|
|
@@ -8023,7 +8068,7 @@ var SelectItem = (props) => {
|
|
|
8023
8068
|
ctx?.close();
|
|
8024
8069
|
onClick?.();
|
|
8025
8070
|
};
|
|
8026
|
-
return /* @__PURE__ */
|
|
8071
|
+
return /* @__PURE__ */ jsx331(
|
|
8027
8072
|
"div",
|
|
8028
8073
|
{
|
|
8029
8074
|
className: clsx_default("select-item", disabled && "disabled"),
|
|
@@ -8044,7 +8089,7 @@ SelectItem.displayName = "Select.Item";
|
|
|
8044
8089
|
var SelectItem_default = SelectItem;
|
|
8045
8090
|
|
|
8046
8091
|
// src/components/Select/Select.tsx
|
|
8047
|
-
import { jsx as
|
|
8092
|
+
import { jsx as jsx332, jsxs as jsxs214 } from "react/jsx-runtime";
|
|
8048
8093
|
var ANIMATION_DURATION_MS3 = 200;
|
|
8049
8094
|
var SelectRoot = (props) => {
|
|
8050
8095
|
const {
|
|
@@ -8056,26 +8101,26 @@ var SelectRoot = (props) => {
|
|
|
8056
8101
|
error = false,
|
|
8057
8102
|
size = "md"
|
|
8058
8103
|
} = props;
|
|
8059
|
-
const itemChildren =
|
|
8060
|
-
(child) =>
|
|
8104
|
+
const itemChildren = React28.Children.toArray(children).filter(
|
|
8105
|
+
(child) => React28.isValidElement(child) && child.type === SelectItem_default
|
|
8061
8106
|
);
|
|
8062
8107
|
const isControlled = valueProp !== void 0;
|
|
8063
|
-
const [isOpen, setOpen] =
|
|
8064
|
-
const [uncontrolledLabel, setUncontrolledLabel] =
|
|
8065
|
-
const controlledLabel =
|
|
8108
|
+
const [isOpen, setOpen] = React28.useState(false);
|
|
8109
|
+
const [uncontrolledLabel, setUncontrolledLabel] = React28.useState(null);
|
|
8110
|
+
const controlledLabel = React28.useMemo(() => {
|
|
8066
8111
|
if (!isControlled) return null;
|
|
8067
8112
|
const match = itemChildren.find((child) => child.props.value === valueProp);
|
|
8068
8113
|
return match ? match.props.children : null;
|
|
8069
8114
|
}, [isControlled, valueProp, itemChildren]);
|
|
8070
8115
|
const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
|
|
8071
|
-
const triggerRef =
|
|
8072
|
-
const contentRef =
|
|
8073
|
-
const [mounted, setMounted] =
|
|
8074
|
-
const [visible, setVisible] =
|
|
8075
|
-
|
|
8116
|
+
const triggerRef = React28.useRef(null);
|
|
8117
|
+
const contentRef = React28.useRef(null);
|
|
8118
|
+
const [mounted, setMounted] = React28.useState(false);
|
|
8119
|
+
const [visible, setVisible] = React28.useState(false);
|
|
8120
|
+
React28.useEffect(() => {
|
|
8076
8121
|
if (disabled && isOpen) setOpen(false);
|
|
8077
8122
|
}, [disabled, isOpen]);
|
|
8078
|
-
|
|
8123
|
+
React28.useEffect(() => {
|
|
8079
8124
|
if (isOpen) {
|
|
8080
8125
|
setMounted(true);
|
|
8081
8126
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -8085,12 +8130,12 @@ var SelectRoot = (props) => {
|
|
|
8085
8130
|
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS3);
|
|
8086
8131
|
return () => clearTimeout(t);
|
|
8087
8132
|
}, [isOpen]);
|
|
8088
|
-
const open =
|
|
8089
|
-
const close =
|
|
8090
|
-
const toggle =
|
|
8133
|
+
const open = React28.useCallback(() => setOpen(true), []);
|
|
8134
|
+
const close = React28.useCallback(() => setOpen(false), []);
|
|
8135
|
+
const toggle = React28.useCallback(() => setOpen((prev) => !prev), []);
|
|
8091
8136
|
useClickOutside_default([contentRef, triggerRef], close, isOpen);
|
|
8092
8137
|
const position = useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
8093
|
-
const setSelected =
|
|
8138
|
+
const setSelected = React28.useCallback(
|
|
8094
8139
|
(label, itemValue) => {
|
|
8095
8140
|
if (!isControlled) {
|
|
8096
8141
|
setUncontrolledLabel(label);
|
|
@@ -8099,7 +8144,7 @@ var SelectRoot = (props) => {
|
|
|
8099
8144
|
},
|
|
8100
8145
|
[isControlled, onChange]
|
|
8101
8146
|
);
|
|
8102
|
-
const ctxValue =
|
|
8147
|
+
const ctxValue = React28.useMemo(
|
|
8103
8148
|
() => ({
|
|
8104
8149
|
isOpen,
|
|
8105
8150
|
mounted,
|
|
@@ -8120,7 +8165,7 @@ var SelectRoot = (props) => {
|
|
|
8120
8165
|
if (disabled) return;
|
|
8121
8166
|
toggle();
|
|
8122
8167
|
};
|
|
8123
|
-
return /* @__PURE__ */
|
|
8168
|
+
return /* @__PURE__ */ jsx332(context_default.Provider, { value: ctxValue, children: /* @__PURE__ */ jsxs214(
|
|
8124
8169
|
"div",
|
|
8125
8170
|
{
|
|
8126
8171
|
className: clsx_default(
|
|
@@ -8155,7 +8200,7 @@ var SelectRoot = (props) => {
|
|
|
8155
8200
|
}
|
|
8156
8201
|
},
|
|
8157
8202
|
children: [
|
|
8158
|
-
/* @__PURE__ */
|
|
8203
|
+
/* @__PURE__ */ jsx332(
|
|
8159
8204
|
"span",
|
|
8160
8205
|
{
|
|
8161
8206
|
className: clsx_default(
|
|
@@ -8165,27 +8210,27 @@ var SelectRoot = (props) => {
|
|
|
8165
8210
|
children: selectedLabel ?? placeholder
|
|
8166
8211
|
}
|
|
8167
8212
|
),
|
|
8168
|
-
/* @__PURE__ */
|
|
8213
|
+
/* @__PURE__ */ jsx332(
|
|
8169
8214
|
"span",
|
|
8170
8215
|
{
|
|
8171
8216
|
className: clsx_default("select-trigger-icon", isOpen && "open"),
|
|
8172
8217
|
"aria-hidden": true,
|
|
8173
|
-
children: /* @__PURE__ */
|
|
8218
|
+
children: /* @__PURE__ */ jsx332(ChevronDownIcon_default, {})
|
|
8174
8219
|
}
|
|
8175
8220
|
)
|
|
8176
8221
|
]
|
|
8177
8222
|
}
|
|
8178
8223
|
),
|
|
8179
|
-
mounted && /* @__PURE__ */
|
|
8224
|
+
mounted && /* @__PURE__ */ jsx332(Portal_default, { children: /* @__PURE__ */ jsx332(
|
|
8180
8225
|
"div",
|
|
8181
8226
|
{
|
|
8182
|
-
className: clsx_default("select-content", position.direction, stateClass),
|
|
8227
|
+
className: clsx_default("lib-xplat-select-content", position.direction, stateClass),
|
|
8183
8228
|
ref: contentRef,
|
|
8184
8229
|
style: { ...position.position, minWidth: position.position.width },
|
|
8185
8230
|
role: "listbox",
|
|
8186
|
-
children: itemChildren
|
|
8231
|
+
children: /* @__PURE__ */ jsx332(context_default.Provider, { value: ctxValue, children: itemChildren })
|
|
8187
8232
|
}
|
|
8188
|
-
)
|
|
8233
|
+
) })
|
|
8189
8234
|
]
|
|
8190
8235
|
}
|
|
8191
8236
|
) });
|
|
@@ -8197,14 +8242,14 @@ var Select = Object.assign(SelectRoot, {
|
|
|
8197
8242
|
var Select_default = Select;
|
|
8198
8243
|
|
|
8199
8244
|
// src/components/Skeleton/Skeleton.tsx
|
|
8200
|
-
import { jsx as
|
|
8245
|
+
import { jsx as jsx333 } from "react/jsx-runtime";
|
|
8201
8246
|
var Skeleton = (props) => {
|
|
8202
8247
|
const { variant = "text", width, height } = props;
|
|
8203
8248
|
const style = {
|
|
8204
8249
|
width: typeof width === "number" ? `${width}px` : width,
|
|
8205
8250
|
height: typeof height === "number" ? `${height}px` : height
|
|
8206
8251
|
};
|
|
8207
|
-
return /* @__PURE__ */
|
|
8252
|
+
return /* @__PURE__ */ jsx333(
|
|
8208
8253
|
"div",
|
|
8209
8254
|
{
|
|
8210
8255
|
className: clsx_default("lib-xplat-skeleton", variant),
|
|
@@ -8217,20 +8262,20 @@ Skeleton.displayName = "Skeleton";
|
|
|
8217
8262
|
var Skeleton_default = Skeleton;
|
|
8218
8263
|
|
|
8219
8264
|
// src/components/Spinner/Spinner.tsx
|
|
8220
|
-
import { jsx as
|
|
8265
|
+
import { jsx as jsx334, jsxs as jsxs215 } from "react/jsx-runtime";
|
|
8221
8266
|
var Spinner = (props) => {
|
|
8222
8267
|
const {
|
|
8223
8268
|
size = "md",
|
|
8224
8269
|
type = "brand"
|
|
8225
8270
|
} = props;
|
|
8226
|
-
return /* @__PURE__ */
|
|
8271
|
+
return /* @__PURE__ */ jsx334(
|
|
8227
8272
|
"div",
|
|
8228
8273
|
{
|
|
8229
8274
|
className: clsx_default("lib-xplat-spinner", size, type),
|
|
8230
8275
|
role: "status",
|
|
8231
8276
|
"aria-label": "\uB85C\uB529 \uC911",
|
|
8232
8277
|
children: /* @__PURE__ */ jsxs215("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
8233
|
-
/* @__PURE__ */
|
|
8278
|
+
/* @__PURE__ */ jsx334(
|
|
8234
8279
|
"circle",
|
|
8235
8280
|
{
|
|
8236
8281
|
className: "track",
|
|
@@ -8240,7 +8285,7 @@ var Spinner = (props) => {
|
|
|
8240
8285
|
strokeWidth: "3"
|
|
8241
8286
|
}
|
|
8242
8287
|
),
|
|
8243
|
-
/* @__PURE__ */
|
|
8288
|
+
/* @__PURE__ */ jsx334(
|
|
8244
8289
|
"circle",
|
|
8245
8290
|
{
|
|
8246
8291
|
className: "indicator",
|
|
@@ -8259,20 +8304,20 @@ Spinner.displayName = "Spinner";
|
|
|
8259
8304
|
var Spinner_default = Spinner;
|
|
8260
8305
|
|
|
8261
8306
|
// src/components/Steps/Steps.tsx
|
|
8262
|
-
import { jsx as
|
|
8307
|
+
import { jsx as jsx335, jsxs as jsxs216 } from "react/jsx-runtime";
|
|
8263
8308
|
var Steps = (props) => {
|
|
8264
8309
|
const {
|
|
8265
8310
|
items,
|
|
8266
8311
|
current,
|
|
8267
8312
|
type = "brand"
|
|
8268
8313
|
} = props;
|
|
8269
|
-
return /* @__PURE__ */
|
|
8314
|
+
return /* @__PURE__ */ jsx335("div", { className: clsx_default("lib-xplat-steps", type), children: items.map((item, index) => {
|
|
8270
8315
|
const status = index < current ? "completed" : index === current ? "active" : "pending";
|
|
8271
8316
|
return /* @__PURE__ */ jsxs216("div", { className: clsx_default("step-item", status), children: [
|
|
8272
|
-
/* @__PURE__ */
|
|
8317
|
+
/* @__PURE__ */ jsx335("div", { className: "step-circle", children: status === "completed" ? /* @__PURE__ */ jsx335(CheckIcon_default, {}) : /* @__PURE__ */ jsx335("span", { children: index + 1 }) }),
|
|
8273
8318
|
/* @__PURE__ */ jsxs216("div", { className: "step-content", children: [
|
|
8274
|
-
/* @__PURE__ */
|
|
8275
|
-
item.description && /* @__PURE__ */
|
|
8319
|
+
/* @__PURE__ */ jsx335("span", { className: "step-title", children: item.title }),
|
|
8320
|
+
item.description && /* @__PURE__ */ jsx335("span", { className: "step-description", children: item.description })
|
|
8276
8321
|
] })
|
|
8277
8322
|
] }, index);
|
|
8278
8323
|
}) });
|
|
@@ -8281,8 +8326,8 @@ Steps.displayName = "Steps";
|
|
|
8281
8326
|
var Steps_default = Steps;
|
|
8282
8327
|
|
|
8283
8328
|
// src/components/Swiper/Swiper.tsx
|
|
8284
|
-
import
|
|
8285
|
-
import { jsx as
|
|
8329
|
+
import React29 from "react";
|
|
8330
|
+
import { jsx as jsx336, jsxs as jsxs217 } from "react/jsx-runtime";
|
|
8286
8331
|
var Swiper = (props) => {
|
|
8287
8332
|
const {
|
|
8288
8333
|
auto = false,
|
|
@@ -8305,23 +8350,23 @@ var Swiper = (props) => {
|
|
|
8305
8350
|
const maxIndex = Math.max(0, totalSlides - viewItemCount);
|
|
8306
8351
|
const useLoop = loop && canSlide;
|
|
8307
8352
|
const cloneCount = useLoop ? totalSlides : 0;
|
|
8308
|
-
const extendedItems =
|
|
8353
|
+
const extendedItems = React29.useMemo(() => {
|
|
8309
8354
|
if (!useLoop) return items;
|
|
8310
8355
|
return [...items, ...items, ...items];
|
|
8311
8356
|
}, [items, useLoop]);
|
|
8312
8357
|
const initialIdx = Math.max(0, Math.min(indexProp ?? 0, maxIndex));
|
|
8313
|
-
const [innerIndex, setInnerIndex] =
|
|
8358
|
+
const [innerIndex, setInnerIndex] = React29.useState(
|
|
8314
8359
|
useLoop ? cloneCount + initialIdx : initialIdx
|
|
8315
8360
|
);
|
|
8316
|
-
const [isDragging, setIsDragging] =
|
|
8317
|
-
const [dragOffset, setDragOffset] =
|
|
8318
|
-
const [animated, setAnimated] =
|
|
8319
|
-
const [containerWidth, setContainerWidth] =
|
|
8320
|
-
const containerRef =
|
|
8321
|
-
const startXRef =
|
|
8322
|
-
const startTimeRef =
|
|
8323
|
-
const autoplayTimerRef =
|
|
8324
|
-
|
|
8361
|
+
const [isDragging, setIsDragging] = React29.useState(false);
|
|
8362
|
+
const [dragOffset, setDragOffset] = React29.useState(0);
|
|
8363
|
+
const [animated, setAnimated] = React29.useState(true);
|
|
8364
|
+
const [containerWidth, setContainerWidth] = React29.useState(0);
|
|
8365
|
+
const containerRef = React29.useRef(null);
|
|
8366
|
+
const startXRef = React29.useRef(0);
|
|
8367
|
+
const startTimeRef = React29.useRef(0);
|
|
8368
|
+
const autoplayTimerRef = React29.useRef(null);
|
|
8369
|
+
React29.useEffect(() => {
|
|
8325
8370
|
const el = containerRef.current;
|
|
8326
8371
|
if (!el) return;
|
|
8327
8372
|
const ro = new ResizeObserver((entries) => {
|
|
@@ -8340,7 +8385,7 @@ var Swiper = (props) => {
|
|
|
8340
8385
|
return ((inner - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
8341
8386
|
};
|
|
8342
8387
|
const realIndex = getRealIndex(innerIndex);
|
|
8343
|
-
const moveToInner =
|
|
8388
|
+
const moveToInner = React29.useCallback(
|
|
8344
8389
|
(idx, withAnim = true) => {
|
|
8345
8390
|
if (!useLoop) {
|
|
8346
8391
|
setAnimated(withAnim);
|
|
@@ -8368,7 +8413,7 @@ var Swiper = (props) => {
|
|
|
8368
8413
|
},
|
|
8369
8414
|
[useLoop, cloneCount, totalSlides]
|
|
8370
8415
|
);
|
|
8371
|
-
const handleTransitionEnd =
|
|
8416
|
+
const handleTransitionEnd = React29.useCallback(() => {
|
|
8372
8417
|
if (!useLoop) return;
|
|
8373
8418
|
const real = getRealIndex(innerIndex);
|
|
8374
8419
|
const canonical = cloneCount + real;
|
|
@@ -8378,7 +8423,7 @@ var Swiper = (props) => {
|
|
|
8378
8423
|
}
|
|
8379
8424
|
onChange?.(Math.min(real, maxIndex));
|
|
8380
8425
|
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange]);
|
|
8381
|
-
const slideTo =
|
|
8426
|
+
const slideTo = React29.useCallback(
|
|
8382
8427
|
(logicalIndex) => {
|
|
8383
8428
|
if (!canSlide) return;
|
|
8384
8429
|
const clamped = useLoop ? logicalIndex : Math.max(0, Math.min(logicalIndex, maxIndex));
|
|
@@ -8388,7 +8433,7 @@ var Swiper = (props) => {
|
|
|
8388
8433
|
},
|
|
8389
8434
|
[canSlide, useLoop, cloneCount, maxIndex, onChange, moveToInner]
|
|
8390
8435
|
);
|
|
8391
|
-
const slideNext =
|
|
8436
|
+
const slideNext = React29.useCallback(() => {
|
|
8392
8437
|
if (!canSlide) return;
|
|
8393
8438
|
const nextInner = innerIndex + slideBy;
|
|
8394
8439
|
if (useLoop) {
|
|
@@ -8397,7 +8442,7 @@ var Swiper = (props) => {
|
|
|
8397
8442
|
moveToInner(Math.min(nextInner, maxIndex), true);
|
|
8398
8443
|
}
|
|
8399
8444
|
}, [canSlide, useLoop, innerIndex, slideBy, maxIndex, moveToInner]);
|
|
8400
|
-
const slidePrev =
|
|
8445
|
+
const slidePrev = React29.useCallback(() => {
|
|
8401
8446
|
if (!canSlide) return;
|
|
8402
8447
|
const prevInner = innerIndex - slideBy;
|
|
8403
8448
|
if (useLoop) {
|
|
@@ -8406,7 +8451,7 @@ var Swiper = (props) => {
|
|
|
8406
8451
|
moveToInner(Math.max(prevInner, 0), true);
|
|
8407
8452
|
}
|
|
8408
8453
|
}, [canSlide, useLoop, innerIndex, slideBy, moveToInner]);
|
|
8409
|
-
|
|
8454
|
+
React29.useEffect(() => {
|
|
8410
8455
|
if (indexProp === void 0) return;
|
|
8411
8456
|
const clamped = Math.max(0, Math.min(indexProp, maxIndex));
|
|
8412
8457
|
const target = useLoop ? cloneCount + clamped : clamped;
|
|
@@ -8414,12 +8459,12 @@ var Swiper = (props) => {
|
|
|
8414
8459
|
moveToInner(target, true);
|
|
8415
8460
|
}
|
|
8416
8461
|
}, [indexProp]);
|
|
8417
|
-
|
|
8462
|
+
React29.useImperativeHandle(swiperRef, () => ({
|
|
8418
8463
|
slidePrev,
|
|
8419
8464
|
slideNext,
|
|
8420
8465
|
slideTo
|
|
8421
8466
|
}));
|
|
8422
|
-
|
|
8467
|
+
React29.useEffect(() => {
|
|
8423
8468
|
if (!auto || !canSlide) return;
|
|
8424
8469
|
autoplayTimerRef.current = setInterval(slideNext, autoplayDelay);
|
|
8425
8470
|
return () => {
|
|
@@ -8442,7 +8487,7 @@ var Swiper = (props) => {
|
|
|
8442
8487
|
startXRef.current = getClientX(e);
|
|
8443
8488
|
startTimeRef.current = Date.now();
|
|
8444
8489
|
};
|
|
8445
|
-
|
|
8490
|
+
React29.useEffect(() => {
|
|
8446
8491
|
if (!isDragging) return;
|
|
8447
8492
|
const handleMove = (e) => {
|
|
8448
8493
|
setDragOffset(getClientX(e) - startXRef.current);
|
|
@@ -8480,8 +8525,8 @@ var Swiper = (props) => {
|
|
|
8480
8525
|
}, [isDragging, dragOffset, innerIndex, useLoop, maxIndex, slideStep, moveToInner]);
|
|
8481
8526
|
const slideWidthPercent = 100 / viewItemCount;
|
|
8482
8527
|
const gapAdjust = spaceBetween * (viewItemCount - 1) / viewItemCount;
|
|
8483
|
-
const slideElements =
|
|
8484
|
-
() => extendedItems.map((item, idx) => /* @__PURE__ */
|
|
8528
|
+
const slideElements = React29.useMemo(
|
|
8529
|
+
() => extendedItems.map((item, idx) => /* @__PURE__ */ jsx336(
|
|
8485
8530
|
"div",
|
|
8486
8531
|
{
|
|
8487
8532
|
className: "lib-xplat-swiper__slide",
|
|
@@ -8501,13 +8546,13 @@ var Swiper = (props) => {
|
|
|
8501
8546
|
totalSteps - 1
|
|
8502
8547
|
);
|
|
8503
8548
|
return /* @__PURE__ */ jsxs217("div", { className: "lib-xplat-swiper", ref: containerRef, children: [
|
|
8504
|
-
/* @__PURE__ */
|
|
8549
|
+
/* @__PURE__ */ jsx336(
|
|
8505
8550
|
"div",
|
|
8506
8551
|
{
|
|
8507
8552
|
className: "lib-xplat-swiper__viewport",
|
|
8508
8553
|
onMouseDown: handleDragStart,
|
|
8509
8554
|
onTouchStart: handleDragStart,
|
|
8510
|
-
children: /* @__PURE__ */
|
|
8555
|
+
children: /* @__PURE__ */ jsx336(
|
|
8511
8556
|
"div",
|
|
8512
8557
|
{
|
|
8513
8558
|
className: clsx_default(
|
|
@@ -8525,7 +8570,7 @@ var Swiper = (props) => {
|
|
|
8525
8570
|
)
|
|
8526
8571
|
}
|
|
8527
8572
|
),
|
|
8528
|
-
showProgress && canSlide && /* @__PURE__ */
|
|
8573
|
+
showProgress && canSlide && /* @__PURE__ */ jsx336("div", { className: "lib-xplat-swiper__progress", children: /* @__PURE__ */ jsx336("div", { className: "lib-xplat-swiper__progress-track", children: /* @__PURE__ */ jsx336(
|
|
8529
8574
|
"span",
|
|
8530
8575
|
{
|
|
8531
8576
|
className: "lib-xplat-swiper__progress-fill",
|
|
@@ -8535,7 +8580,7 @@ var Swiper = (props) => {
|
|
|
8535
8580
|
}
|
|
8536
8581
|
}
|
|
8537
8582
|
) }) }),
|
|
8538
|
-
canSlide && /* @__PURE__ */
|
|
8583
|
+
canSlide && /* @__PURE__ */ jsx336("div", { className: "lib-xplat-swiper__dots", children: Array.from({ length: totalSteps }, (_, i) => /* @__PURE__ */ jsx336(
|
|
8539
8584
|
"button",
|
|
8540
8585
|
{
|
|
8541
8586
|
className: clsx_default(
|
|
@@ -8553,8 +8598,8 @@ Swiper.displayName = "Swiper";
|
|
|
8553
8598
|
var Swiper_default = Swiper;
|
|
8554
8599
|
|
|
8555
8600
|
// src/components/Switch/Switch.tsx
|
|
8556
|
-
import
|
|
8557
|
-
import { jsx as
|
|
8601
|
+
import React30 from "react";
|
|
8602
|
+
import { jsx as jsx337 } from "react/jsx-runtime";
|
|
8558
8603
|
var KNOB_TRANSITION_MS = 250;
|
|
8559
8604
|
var Switch = (props) => {
|
|
8560
8605
|
const {
|
|
@@ -8564,9 +8609,9 @@ var Switch = (props) => {
|
|
|
8564
8609
|
disabled,
|
|
8565
8610
|
onChange
|
|
8566
8611
|
} = props;
|
|
8567
|
-
const [isAnimating, setIsAnimating] =
|
|
8568
|
-
const timeoutRef =
|
|
8569
|
-
|
|
8612
|
+
const [isAnimating, setIsAnimating] = React30.useState(false);
|
|
8613
|
+
const timeoutRef = React30.useRef(null);
|
|
8614
|
+
React30.useEffect(() => {
|
|
8570
8615
|
return () => {
|
|
8571
8616
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
8572
8617
|
};
|
|
@@ -8581,7 +8626,7 @@ var Switch = (props) => {
|
|
|
8581
8626
|
timeoutRef.current = null;
|
|
8582
8627
|
}, KNOB_TRANSITION_MS);
|
|
8583
8628
|
};
|
|
8584
|
-
return /* @__PURE__ */
|
|
8629
|
+
return /* @__PURE__ */ jsx337(
|
|
8585
8630
|
"div",
|
|
8586
8631
|
{
|
|
8587
8632
|
className: clsx_default(
|
|
@@ -8594,7 +8639,7 @@ var Switch = (props) => {
|
|
|
8594
8639
|
),
|
|
8595
8640
|
onClick: handleClick,
|
|
8596
8641
|
"aria-disabled": disabled || isAnimating,
|
|
8597
|
-
children: /* @__PURE__ */
|
|
8642
|
+
children: /* @__PURE__ */ jsx337("div", { className: clsx_default("knob", value ? "checked" : void 0) })
|
|
8598
8643
|
}
|
|
8599
8644
|
);
|
|
8600
8645
|
};
|
|
@@ -8602,17 +8647,17 @@ Switch.displayName = "Switch";
|
|
|
8602
8647
|
var Switch_default = Switch;
|
|
8603
8648
|
|
|
8604
8649
|
// src/components/Table/TableContext.tsx
|
|
8605
|
-
import
|
|
8606
|
-
var TableContext =
|
|
8650
|
+
import React31 from "react";
|
|
8651
|
+
var TableContext = React31.createContext(null);
|
|
8607
8652
|
var useTableContext = () => {
|
|
8608
|
-
const ctx =
|
|
8653
|
+
const ctx = React31.useContext(TableContext);
|
|
8609
8654
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
8610
8655
|
return ctx;
|
|
8611
8656
|
};
|
|
8612
8657
|
var TableContext_default = TableContext;
|
|
8613
8658
|
|
|
8614
8659
|
// src/components/Table/Table.tsx
|
|
8615
|
-
import { jsx as
|
|
8660
|
+
import { jsx as jsx338 } from "react/jsx-runtime";
|
|
8616
8661
|
var Table = (props) => {
|
|
8617
8662
|
const {
|
|
8618
8663
|
children,
|
|
@@ -8621,7 +8666,7 @@ var Table = (props) => {
|
|
|
8621
8666
|
headerSticky = false,
|
|
8622
8667
|
stickyShadow = true
|
|
8623
8668
|
} = props;
|
|
8624
|
-
return /* @__PURE__ */
|
|
8669
|
+
return /* @__PURE__ */ jsx338("div", { className: "lib-xplat-table-wrapper", children: /* @__PURE__ */ jsx338(
|
|
8625
8670
|
TableContext_default.Provider,
|
|
8626
8671
|
{
|
|
8627
8672
|
value: {
|
|
@@ -8630,7 +8675,7 @@ var Table = (props) => {
|
|
|
8630
8675
|
headerSticky,
|
|
8631
8676
|
stickyShadow
|
|
8632
8677
|
},
|
|
8633
|
-
children: /* @__PURE__ */
|
|
8678
|
+
children: /* @__PURE__ */ jsx338("table", { className: "lib-xplat-table", children })
|
|
8634
8679
|
}
|
|
8635
8680
|
) });
|
|
8636
8681
|
};
|
|
@@ -8638,41 +8683,41 @@ Table.displayName = "Table";
|
|
|
8638
8683
|
var Table_default = Table;
|
|
8639
8684
|
|
|
8640
8685
|
// src/components/Table/TableBody.tsx
|
|
8641
|
-
import { jsx as
|
|
8686
|
+
import { jsx as jsx339 } from "react/jsx-runtime";
|
|
8642
8687
|
var TableBody = (props) => {
|
|
8643
8688
|
const { children } = props;
|
|
8644
|
-
return /* @__PURE__ */
|
|
8689
|
+
return /* @__PURE__ */ jsx339("tbody", { children });
|
|
8645
8690
|
};
|
|
8646
8691
|
TableBody.displayName = "TableBody";
|
|
8647
8692
|
var TableBody_default = TableBody;
|
|
8648
8693
|
|
|
8649
8694
|
// src/components/Table/TableCell.tsx
|
|
8650
|
-
import
|
|
8695
|
+
import React34 from "react";
|
|
8651
8696
|
|
|
8652
8697
|
// src/components/Table/TableHeadContext.tsx
|
|
8653
|
-
import
|
|
8654
|
-
var TableHeadContext =
|
|
8698
|
+
import React32 from "react";
|
|
8699
|
+
var TableHeadContext = React32.createContext(
|
|
8655
8700
|
null
|
|
8656
8701
|
);
|
|
8657
8702
|
var useTableHeadContext = () => {
|
|
8658
|
-
const ctx =
|
|
8703
|
+
const ctx = React32.useContext(TableHeadContext);
|
|
8659
8704
|
return ctx;
|
|
8660
8705
|
};
|
|
8661
8706
|
var TableHeadContext_default = TableHeadContext;
|
|
8662
8707
|
|
|
8663
8708
|
// src/components/Table/TableRowContext.tsx
|
|
8664
|
-
import
|
|
8665
|
-
var TableRowContext =
|
|
8709
|
+
import React33 from "react";
|
|
8710
|
+
var TableRowContext = React33.createContext(null);
|
|
8666
8711
|
var useTableRowContext = () => {
|
|
8667
|
-
const ctx =
|
|
8712
|
+
const ctx = React33.useContext(TableRowContext);
|
|
8668
8713
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
8669
8714
|
return ctx;
|
|
8670
8715
|
};
|
|
8671
8716
|
var TableRowContext_default = TableRowContext;
|
|
8672
8717
|
|
|
8673
8718
|
// src/components/Table/TableCell.tsx
|
|
8674
|
-
import { jsx as
|
|
8675
|
-
var TableCell =
|
|
8719
|
+
import { jsx as jsx340 } from "react/jsx-runtime";
|
|
8720
|
+
var TableCell = React34.memo((props) => {
|
|
8676
8721
|
const {
|
|
8677
8722
|
children,
|
|
8678
8723
|
align = "center",
|
|
@@ -8684,9 +8729,9 @@ var TableCell = React33.memo((props) => {
|
|
|
8684
8729
|
const { registerStickyCell, stickyCells } = useTableRowContext();
|
|
8685
8730
|
const { stickyShadow } = useTableContext();
|
|
8686
8731
|
const headContext = useTableHeadContext();
|
|
8687
|
-
const [left, setLeft] =
|
|
8688
|
-
const cellRef =
|
|
8689
|
-
const calculateLeft =
|
|
8732
|
+
const [left, setLeft] = React34.useState(0);
|
|
8733
|
+
const cellRef = React34.useRef(null);
|
|
8734
|
+
const calculateLeft = React34.useCallback(() => {
|
|
8690
8735
|
if (!cellRef.current) return 0;
|
|
8691
8736
|
let totalLeft = 0;
|
|
8692
8737
|
for (const ref of stickyCells) {
|
|
@@ -8695,7 +8740,7 @@ var TableCell = React33.memo((props) => {
|
|
|
8695
8740
|
}
|
|
8696
8741
|
return totalLeft;
|
|
8697
8742
|
}, [stickyCells]);
|
|
8698
|
-
|
|
8743
|
+
React34.useEffect(() => {
|
|
8699
8744
|
if (!isSticky || !cellRef.current) return;
|
|
8700
8745
|
registerStickyCell(cellRef);
|
|
8701
8746
|
setLeft(calculateLeft());
|
|
@@ -8713,7 +8758,7 @@ var TableCell = React33.memo((props) => {
|
|
|
8713
8758
|
const CellTag = cellRef.current?.tagName === "TH" ? "th" : "td";
|
|
8714
8759
|
const isLastSticky = isSticky && stickyCells[stickyCells.length - 1] === cellRef;
|
|
8715
8760
|
const enableHover = headContext && headContext.cellHover;
|
|
8716
|
-
return /* @__PURE__ */
|
|
8761
|
+
return /* @__PURE__ */ jsx340(
|
|
8717
8762
|
CellTag,
|
|
8718
8763
|
{
|
|
8719
8764
|
ref: cellRef,
|
|
@@ -8738,21 +8783,21 @@ TableCell.displayName = "TableCell";
|
|
|
8738
8783
|
var TableCell_default = TableCell;
|
|
8739
8784
|
|
|
8740
8785
|
// src/components/Table/TableHead.tsx
|
|
8741
|
-
import { jsx as
|
|
8786
|
+
import { jsx as jsx341 } from "react/jsx-runtime";
|
|
8742
8787
|
var TableHead = ({
|
|
8743
8788
|
children,
|
|
8744
8789
|
cellHover = false
|
|
8745
8790
|
}) => {
|
|
8746
8791
|
const { headerSticky } = useTableContext();
|
|
8747
|
-
return /* @__PURE__ */
|
|
8792
|
+
return /* @__PURE__ */ jsx341(TableHeadContext_default.Provider, { value: { cellHover }, children: /* @__PURE__ */ jsx341("thead", { className: clsx_default(headerSticky ? "table-sticky" : null), children }) });
|
|
8748
8793
|
};
|
|
8749
8794
|
TableHead.displayName = "TableHead";
|
|
8750
8795
|
var TableHead_default = TableHead;
|
|
8751
8796
|
|
|
8752
8797
|
// src/components/Table/TableRow.tsx
|
|
8753
|
-
import
|
|
8754
|
-
import { jsx as
|
|
8755
|
-
var TableRow =
|
|
8798
|
+
import React35 from "react";
|
|
8799
|
+
import { jsx as jsx342 } from "react/jsx-runtime";
|
|
8800
|
+
var TableRow = React35.memo((props) => {
|
|
8756
8801
|
const {
|
|
8757
8802
|
children,
|
|
8758
8803
|
type = "secondary",
|
|
@@ -8760,14 +8805,14 @@ var TableRow = React34.memo((props) => {
|
|
|
8760
8805
|
onClick
|
|
8761
8806
|
} = props;
|
|
8762
8807
|
const { rowBorderUse } = useTableContext();
|
|
8763
|
-
const [stickyCells, setStickyCells] =
|
|
8808
|
+
const [stickyCells, setStickyCells] = React35.useState([]);
|
|
8764
8809
|
const registerStickyCell = (ref) => {
|
|
8765
8810
|
setStickyCells((prev) => {
|
|
8766
8811
|
if (prev.includes(ref)) return prev;
|
|
8767
8812
|
return [...prev, ref];
|
|
8768
8813
|
});
|
|
8769
8814
|
};
|
|
8770
|
-
return /* @__PURE__ */
|
|
8815
|
+
return /* @__PURE__ */ jsx342(TableRowContext_default.Provider, { value: { stickyCells, registerStickyCell }, children: /* @__PURE__ */ jsx342(
|
|
8771
8816
|
"tr",
|
|
8772
8817
|
{
|
|
8773
8818
|
className: clsx_default(
|
|
@@ -8785,7 +8830,7 @@ TableRow.displayName = "TableRow";
|
|
|
8785
8830
|
var TableRow_default = TableRow;
|
|
8786
8831
|
|
|
8787
8832
|
// src/components/Tag/Tag.tsx
|
|
8788
|
-
import { jsx as
|
|
8833
|
+
import { jsx as jsx343, jsxs as jsxs218 } from "react/jsx-runtime";
|
|
8789
8834
|
var Tag = (props) => {
|
|
8790
8835
|
const {
|
|
8791
8836
|
children,
|
|
@@ -8806,8 +8851,8 @@ var Tag = (props) => {
|
|
|
8806
8851
|
disabled && "disabled"
|
|
8807
8852
|
),
|
|
8808
8853
|
children: [
|
|
8809
|
-
/* @__PURE__ */
|
|
8810
|
-
onClose && /* @__PURE__ */
|
|
8854
|
+
/* @__PURE__ */ jsx343("span", { className: "tag-label", children }),
|
|
8855
|
+
onClose && /* @__PURE__ */ jsx343("button", { className: "tag-close", onClick: onClose, "aria-label": "\uC0AD\uC81C", disabled, children: /* @__PURE__ */ jsx343(XIcon_default, {}) })
|
|
8811
8856
|
]
|
|
8812
8857
|
}
|
|
8813
8858
|
);
|
|
@@ -8816,12 +8861,12 @@ Tag.displayName = "Tag";
|
|
|
8816
8861
|
var Tag_default = Tag;
|
|
8817
8862
|
|
|
8818
8863
|
// src/components/TextArea/TextArea.tsx
|
|
8819
|
-
import
|
|
8820
|
-
import { jsx as
|
|
8821
|
-
var TextArea =
|
|
8864
|
+
import React36 from "react";
|
|
8865
|
+
import { jsx as jsx344 } from "react/jsx-runtime";
|
|
8866
|
+
var TextArea = React36.forwardRef(
|
|
8822
8867
|
(props, ref) => {
|
|
8823
8868
|
const { value, onChange, disabled, ...textareaProps } = props;
|
|
8824
|
-
const localRef =
|
|
8869
|
+
const localRef = React36.useRef(null);
|
|
8825
8870
|
const setRefs = (el) => {
|
|
8826
8871
|
localRef.current = el;
|
|
8827
8872
|
if (!ref) return;
|
|
@@ -8841,21 +8886,21 @@ var TextArea = React35.forwardRef(
|
|
|
8841
8886
|
onChange(event);
|
|
8842
8887
|
}
|
|
8843
8888
|
};
|
|
8844
|
-
|
|
8889
|
+
React36.useEffect(() => {
|
|
8845
8890
|
const el = localRef.current;
|
|
8846
8891
|
if (!el) return;
|
|
8847
8892
|
el.style.height = "0px";
|
|
8848
8893
|
const nextHeight = Math.min(el.scrollHeight, 400);
|
|
8849
8894
|
el.style.height = `${nextHeight}px`;
|
|
8850
8895
|
}, [value]);
|
|
8851
|
-
return /* @__PURE__ */
|
|
8896
|
+
return /* @__PURE__ */ jsx344("div", { className: "lib-xplat-textarea-wrapper", children: /* @__PURE__ */ jsx344(
|
|
8852
8897
|
"div",
|
|
8853
8898
|
{
|
|
8854
8899
|
className: clsx_default(
|
|
8855
8900
|
"lib-xplat-textarea",
|
|
8856
8901
|
disabled ? "disabled" : void 0
|
|
8857
8902
|
),
|
|
8858
|
-
children: /* @__PURE__ */
|
|
8903
|
+
children: /* @__PURE__ */ jsx344(
|
|
8859
8904
|
"textarea",
|
|
8860
8905
|
{
|
|
8861
8906
|
...textareaProps,
|
|
@@ -8873,25 +8918,25 @@ TextArea.displayName = "TextArea";
|
|
|
8873
8918
|
var TextArea_default = TextArea;
|
|
8874
8919
|
|
|
8875
8920
|
// src/components/Toast/Toast.tsx
|
|
8876
|
-
import
|
|
8921
|
+
import React37 from "react";
|
|
8877
8922
|
import { createPortal as createPortal3 } from "react-dom";
|
|
8878
|
-
import { jsx as
|
|
8879
|
-
var ToastContext =
|
|
8923
|
+
import { jsx as jsx345, jsxs as jsxs219 } from "react/jsx-runtime";
|
|
8924
|
+
var ToastContext = React37.createContext(null);
|
|
8880
8925
|
var useToast = () => {
|
|
8881
|
-
const ctx =
|
|
8926
|
+
const ctx = React37.useContext(ToastContext);
|
|
8882
8927
|
if (!ctx) throw new Error("useToast must be used within ToastProvider");
|
|
8883
8928
|
return ctx;
|
|
8884
8929
|
};
|
|
8885
8930
|
var EXIT_DURATION = 300;
|
|
8886
8931
|
var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
8887
|
-
const ref =
|
|
8888
|
-
const [height, setHeight] =
|
|
8889
|
-
|
|
8932
|
+
const ref = React37.useRef(null);
|
|
8933
|
+
const [height, setHeight] = React37.useState(void 0);
|
|
8934
|
+
React37.useEffect(() => {
|
|
8890
8935
|
if (ref.current && !isExiting) {
|
|
8891
8936
|
setHeight(ref.current.offsetHeight);
|
|
8892
8937
|
}
|
|
8893
8938
|
}, [isExiting]);
|
|
8894
|
-
return /* @__PURE__ */
|
|
8939
|
+
return /* @__PURE__ */ jsx345(
|
|
8895
8940
|
"div",
|
|
8896
8941
|
{
|
|
8897
8942
|
className: clsx_default("lib-xplat-toast-wrapper", { exit: isExiting }),
|
|
@@ -8906,8 +8951,8 @@ var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
|
8906
8951
|
className: clsx_default("lib-xplat-toast", item.type, { exit: isExiting }),
|
|
8907
8952
|
role: "alert",
|
|
8908
8953
|
children: [
|
|
8909
|
-
/* @__PURE__ */
|
|
8910
|
-
/* @__PURE__ */
|
|
8954
|
+
/* @__PURE__ */ jsx345("span", { className: "message", children: item.message }),
|
|
8955
|
+
/* @__PURE__ */ jsx345("button", { className: "close-btn", onClick: onClose, "aria-label": "\uB2EB\uAE30", children: "\xD7" })
|
|
8911
8956
|
]
|
|
8912
8957
|
}
|
|
8913
8958
|
)
|
|
@@ -8918,13 +8963,13 @@ var ToastProvider = ({
|
|
|
8918
8963
|
children,
|
|
8919
8964
|
position = "top-right"
|
|
8920
8965
|
}) => {
|
|
8921
|
-
const [toasts, setToasts] =
|
|
8922
|
-
const [removing, setRemoving] =
|
|
8923
|
-
const [mounted, setMounted] =
|
|
8924
|
-
|
|
8966
|
+
const [toasts, setToasts] = React37.useState([]);
|
|
8967
|
+
const [removing, setRemoving] = React37.useState(/* @__PURE__ */ new Set());
|
|
8968
|
+
const [mounted, setMounted] = React37.useState(false);
|
|
8969
|
+
React37.useEffect(() => {
|
|
8925
8970
|
setMounted(true);
|
|
8926
8971
|
}, []);
|
|
8927
|
-
const remove =
|
|
8972
|
+
const remove = React37.useCallback((id) => {
|
|
8928
8973
|
setRemoving((prev) => new Set(prev).add(id));
|
|
8929
8974
|
setTimeout(() => {
|
|
8930
8975
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
@@ -8935,7 +8980,7 @@ var ToastProvider = ({
|
|
|
8935
8980
|
});
|
|
8936
8981
|
}, EXIT_DURATION);
|
|
8937
8982
|
}, []);
|
|
8938
|
-
const toast =
|
|
8983
|
+
const toast = React37.useCallback(
|
|
8939
8984
|
(type, message, duration = 3e3) => {
|
|
8940
8985
|
const id = `${Date.now()}-${Math.random()}`;
|
|
8941
8986
|
setToasts((prev) => [...prev, { id, type, message }]);
|
|
@@ -8948,7 +8993,7 @@ var ToastProvider = ({
|
|
|
8948
8993
|
return /* @__PURE__ */ jsxs219(ToastContext.Provider, { value: { toast }, children: [
|
|
8949
8994
|
children,
|
|
8950
8995
|
mounted && createPortal3(
|
|
8951
|
-
/* @__PURE__ */
|
|
8996
|
+
/* @__PURE__ */ jsx345("div", { className: clsx_default("lib-xplat-toast-container", position), children: toasts.map((t) => /* @__PURE__ */ jsx345(
|
|
8952
8997
|
ToastItemComponent,
|
|
8953
8998
|
{
|
|
8954
8999
|
item: t,
|
|
@@ -8964,29 +9009,29 @@ var ToastProvider = ({
|
|
|
8964
9009
|
ToastProvider.displayName = "ToastProvider";
|
|
8965
9010
|
|
|
8966
9011
|
// src/components/Tooltip/Tooltip.tsx
|
|
8967
|
-
import
|
|
8968
|
-
import { jsx as
|
|
9012
|
+
import React38 from "react";
|
|
9013
|
+
import { jsx as jsx346, jsxs as jsxs220 } from "react/jsx-runtime";
|
|
8969
9014
|
var Tooltip = (props) => {
|
|
8970
9015
|
const {
|
|
8971
9016
|
type = "primary",
|
|
8972
9017
|
description,
|
|
8973
9018
|
children
|
|
8974
9019
|
} = props;
|
|
8975
|
-
const iconRef =
|
|
9020
|
+
const iconRef = React38.useRef(null);
|
|
8976
9021
|
return /* @__PURE__ */ jsxs220("div", { className: "lib-xplat-tooltip", children: [
|
|
8977
|
-
/* @__PURE__ */
|
|
8978
|
-
/* @__PURE__ */
|
|
9022
|
+
/* @__PURE__ */ jsx346("div", { className: "tooltip-content", ref: iconRef, children: children || "Tooltip" }),
|
|
9023
|
+
/* @__PURE__ */ jsx346("div", { className: clsx_default("tooltip-wrapper", type), children: description })
|
|
8979
9024
|
] });
|
|
8980
9025
|
};
|
|
8981
9026
|
Tooltip.displayName = "Tooltip";
|
|
8982
9027
|
var Tooltip_default = Tooltip;
|
|
8983
9028
|
|
|
8984
9029
|
// src/components/Video/Video.tsx
|
|
8985
|
-
import
|
|
8986
|
-
import { jsx as
|
|
9030
|
+
import React39 from "react";
|
|
9031
|
+
import { jsx as jsx347, jsxs as jsxs221 } from "react/jsx-runtime";
|
|
8987
9032
|
var PipIcon = () => /* @__PURE__ */ jsxs221("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
8988
|
-
/* @__PURE__ */
|
|
8989
|
-
/* @__PURE__ */
|
|
9033
|
+
/* @__PURE__ */ jsx347("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
|
|
9034
|
+
/* @__PURE__ */ jsx347("rect", { x: "12", y: "11", width: "7", height: "6", rx: "1", fill: "currentColor" })
|
|
8990
9035
|
] });
|
|
8991
9036
|
var formatTime = (sec) => {
|
|
8992
9037
|
if (!Number.isFinite(sec) || sec < 0) return "0:00";
|
|
@@ -8994,7 +9039,7 @@ var formatTime = (sec) => {
|
|
|
8994
9039
|
const s = Math.floor(sec % 60);
|
|
8995
9040
|
return `${m}:${s.toString().padStart(2, "0")}`;
|
|
8996
9041
|
};
|
|
8997
|
-
var Video =
|
|
9042
|
+
var Video = React39.forwardRef((props, ref) => {
|
|
8998
9043
|
const {
|
|
8999
9044
|
src,
|
|
9000
9045
|
poster,
|
|
@@ -9018,21 +9063,21 @@ var Video = React38.forwardRef((props, ref) => {
|
|
|
9018
9063
|
children,
|
|
9019
9064
|
...rest
|
|
9020
9065
|
} = props;
|
|
9021
|
-
const containerRef =
|
|
9022
|
-
const videoRef =
|
|
9023
|
-
const [isPlaying, setIsPlaying] =
|
|
9024
|
-
const [isLoaded, setIsLoaded] =
|
|
9025
|
-
const [currentTime, setCurrentTime] =
|
|
9026
|
-
const [duration, setDuration] =
|
|
9027
|
-
const [buffered, setBuffered] =
|
|
9028
|
-
const [volume, setVolume] =
|
|
9029
|
-
const [isMuted, setIsMuted] =
|
|
9030
|
-
const [isFullscreen, setIsFullscreen] =
|
|
9031
|
-
const [playbackRate, setPlaybackRate] =
|
|
9032
|
-
const [rateMenuOpen, setRateMenuOpen] =
|
|
9033
|
-
const [captionsOn, setCaptionsOn] =
|
|
9034
|
-
const [isPip, setIsPip] =
|
|
9035
|
-
const setRefs =
|
|
9066
|
+
const containerRef = React39.useRef(null);
|
|
9067
|
+
const videoRef = React39.useRef(null);
|
|
9068
|
+
const [isPlaying, setIsPlaying] = React39.useState(Boolean(autoPlay));
|
|
9069
|
+
const [isLoaded, setIsLoaded] = React39.useState(false);
|
|
9070
|
+
const [currentTime, setCurrentTime] = React39.useState(0);
|
|
9071
|
+
const [duration, setDuration] = React39.useState(0);
|
|
9072
|
+
const [buffered, setBuffered] = React39.useState(0);
|
|
9073
|
+
const [volume, setVolume] = React39.useState(1);
|
|
9074
|
+
const [isMuted, setIsMuted] = React39.useState(Boolean(muted));
|
|
9075
|
+
const [isFullscreen, setIsFullscreen] = React39.useState(false);
|
|
9076
|
+
const [playbackRate, setPlaybackRate] = React39.useState(1);
|
|
9077
|
+
const [rateMenuOpen, setRateMenuOpen] = React39.useState(false);
|
|
9078
|
+
const [captionsOn, setCaptionsOn] = React39.useState(false);
|
|
9079
|
+
const [isPip, setIsPip] = React39.useState(false);
|
|
9080
|
+
const setRefs = React39.useCallback(
|
|
9036
9081
|
(el) => {
|
|
9037
9082
|
videoRef.current = el;
|
|
9038
9083
|
if (typeof ref === "function") ref(el);
|
|
@@ -9040,14 +9085,14 @@ var Video = React38.forwardRef((props, ref) => {
|
|
|
9040
9085
|
},
|
|
9041
9086
|
[ref]
|
|
9042
9087
|
);
|
|
9043
|
-
|
|
9088
|
+
React39.useEffect(() => {
|
|
9044
9089
|
const onFsChange = () => {
|
|
9045
9090
|
setIsFullscreen(document.fullscreenElement === containerRef.current);
|
|
9046
9091
|
};
|
|
9047
9092
|
document.addEventListener("fullscreenchange", onFsChange);
|
|
9048
9093
|
return () => document.removeEventListener("fullscreenchange", onFsChange);
|
|
9049
9094
|
}, []);
|
|
9050
|
-
|
|
9095
|
+
React39.useEffect(() => {
|
|
9051
9096
|
const v = videoRef.current;
|
|
9052
9097
|
if (!v) return;
|
|
9053
9098
|
const onEnter = () => setIsPip(true);
|
|
@@ -9167,7 +9212,7 @@ var Video = React38.forwardRef((props, ref) => {
|
|
|
9167
9212
|
ref: containerRef,
|
|
9168
9213
|
className: clsx_default("lib-xplat-video", showControls && "has-controls"),
|
|
9169
9214
|
children: [
|
|
9170
|
-
/* @__PURE__ */
|
|
9215
|
+
/* @__PURE__ */ jsx347(
|
|
9171
9216
|
"video",
|
|
9172
9217
|
{
|
|
9173
9218
|
ref: setRefs,
|
|
@@ -9188,7 +9233,7 @@ var Video = React38.forwardRef((props, ref) => {
|
|
|
9188
9233
|
children
|
|
9189
9234
|
}
|
|
9190
9235
|
),
|
|
9191
|
-
showCenterPlay && /* @__PURE__ */
|
|
9236
|
+
showCenterPlay && /* @__PURE__ */ jsx347(
|
|
9192
9237
|
"button",
|
|
9193
9238
|
{
|
|
9194
9239
|
type: "button",
|
|
@@ -9200,11 +9245,11 @@ var Video = React38.forwardRef((props, ref) => {
|
|
|
9200
9245
|
onClick: togglePlay,
|
|
9201
9246
|
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
9202
9247
|
tabIndex: -1,
|
|
9203
|
-
children: /* @__PURE__ */
|
|
9248
|
+
children: /* @__PURE__ */ jsx347("span", { className: "center-play-icon", children: /* @__PURE__ */ jsx347(PlayCircleIcon_default, {}) })
|
|
9204
9249
|
}
|
|
9205
9250
|
),
|
|
9206
9251
|
showControls && /* @__PURE__ */ jsxs221("div", { className: "controls", onClick: (e) => e.stopPropagation(), children: [
|
|
9207
|
-
/* @__PURE__ */
|
|
9252
|
+
/* @__PURE__ */ jsx347(
|
|
9208
9253
|
"input",
|
|
9209
9254
|
{
|
|
9210
9255
|
type: "range",
|
|
@@ -9222,28 +9267,28 @@ var Video = React38.forwardRef((props, ref) => {
|
|
|
9222
9267
|
}
|
|
9223
9268
|
),
|
|
9224
9269
|
/* @__PURE__ */ jsxs221("div", { className: "controls-row", children: [
|
|
9225
|
-
/* @__PURE__ */
|
|
9270
|
+
/* @__PURE__ */ jsx347(
|
|
9226
9271
|
"button",
|
|
9227
9272
|
{
|
|
9228
9273
|
type: "button",
|
|
9229
9274
|
className: "control-btn",
|
|
9230
9275
|
onClick: togglePlay,
|
|
9231
9276
|
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
9232
|
-
children: isPlaying ? /* @__PURE__ */
|
|
9277
|
+
children: isPlaying ? /* @__PURE__ */ jsx347(PauseIcon_default, {}) : /* @__PURE__ */ jsx347(PlayIcon_default, {})
|
|
9233
9278
|
}
|
|
9234
9279
|
),
|
|
9235
9280
|
/* @__PURE__ */ jsxs221("div", { className: "volume-group", children: [
|
|
9236
|
-
/* @__PURE__ */
|
|
9281
|
+
/* @__PURE__ */ jsx347(
|
|
9237
9282
|
"button",
|
|
9238
9283
|
{
|
|
9239
9284
|
type: "button",
|
|
9240
9285
|
className: "control-btn",
|
|
9241
9286
|
onClick: toggleMute,
|
|
9242
9287
|
"aria-label": isMuted ? "\uC74C\uC18C\uAC70 \uD574\uC81C" : "\uC74C\uC18C\uAC70",
|
|
9243
|
-
children: /* @__PURE__ */
|
|
9288
|
+
children: /* @__PURE__ */ jsx347(VolumeGlyph, {})
|
|
9244
9289
|
}
|
|
9245
9290
|
),
|
|
9246
|
-
/* @__PURE__ */
|
|
9291
|
+
/* @__PURE__ */ jsx347(
|
|
9247
9292
|
"input",
|
|
9248
9293
|
{
|
|
9249
9294
|
type: "range",
|
|
@@ -9263,7 +9308,7 @@ var Video = React38.forwardRef((props, ref) => {
|
|
|
9263
9308
|
" / ",
|
|
9264
9309
|
formatTime(duration)
|
|
9265
9310
|
] }),
|
|
9266
|
-
/* @__PURE__ */
|
|
9311
|
+
/* @__PURE__ */ jsx347("div", { className: "controls-spacer" }),
|
|
9267
9312
|
playbackRates && playbackRates.length > 0 && /* @__PURE__ */ jsxs221("div", { className: clsx_default("rate-group", rateMenuOpen && "is-open"), children: [
|
|
9268
9313
|
/* @__PURE__ */ jsxs221(
|
|
9269
9314
|
"button",
|
|
@@ -9279,7 +9324,7 @@ var Video = React38.forwardRef((props, ref) => {
|
|
|
9279
9324
|
]
|
|
9280
9325
|
}
|
|
9281
9326
|
),
|
|
9282
|
-
rateMenuOpen && /* @__PURE__ */
|
|
9327
|
+
rateMenuOpen && /* @__PURE__ */ jsx347("ul", { className: "rate-menu", role: "menu", children: playbackRates.map((r2) => /* @__PURE__ */ jsx347("li", { children: /* @__PURE__ */ jsxs221(
|
|
9283
9328
|
"button",
|
|
9284
9329
|
{
|
|
9285
9330
|
type: "button",
|
|
@@ -9293,7 +9338,7 @@ var Video = React38.forwardRef((props, ref) => {
|
|
|
9293
9338
|
}
|
|
9294
9339
|
) }, r2)) })
|
|
9295
9340
|
] }),
|
|
9296
|
-
showCaptions && /* @__PURE__ */
|
|
9341
|
+
showCaptions && /* @__PURE__ */ jsx347(
|
|
9297
9342
|
"button",
|
|
9298
9343
|
{
|
|
9299
9344
|
type: "button",
|
|
@@ -9301,37 +9346,37 @@ var Video = React38.forwardRef((props, ref) => {
|
|
|
9301
9346
|
onClick: toggleCaptions,
|
|
9302
9347
|
"aria-label": captionsOn ? "\uC790\uB9C9 \uB044\uAE30" : "\uC790\uB9C9 \uCF1C\uAE30",
|
|
9303
9348
|
"aria-pressed": captionsOn,
|
|
9304
|
-
children: /* @__PURE__ */
|
|
9349
|
+
children: /* @__PURE__ */ jsx347(TypeIcon_default, {})
|
|
9305
9350
|
}
|
|
9306
9351
|
),
|
|
9307
|
-
showPip && pipSupported && /* @__PURE__ */
|
|
9352
|
+
showPip && pipSupported && /* @__PURE__ */ jsx347(
|
|
9308
9353
|
"button",
|
|
9309
9354
|
{
|
|
9310
9355
|
type: "button",
|
|
9311
9356
|
className: clsx_default("control-btn", isPip && "is-active"),
|
|
9312
9357
|
onClick: togglePip,
|
|
9313
9358
|
"aria-label": isPip ? "PIP \uC885\uB8CC" : "PIP",
|
|
9314
|
-
children: /* @__PURE__ */
|
|
9359
|
+
children: /* @__PURE__ */ jsx347(PipIcon, {})
|
|
9315
9360
|
}
|
|
9316
9361
|
),
|
|
9317
|
-
showDownload && /* @__PURE__ */
|
|
9362
|
+
showDownload && /* @__PURE__ */ jsx347(
|
|
9318
9363
|
"a",
|
|
9319
9364
|
{
|
|
9320
9365
|
className: "control-btn",
|
|
9321
9366
|
href: src,
|
|
9322
9367
|
download: downloadFileName ?? true,
|
|
9323
9368
|
"aria-label": "\uB2E4\uC6B4\uB85C\uB4DC",
|
|
9324
|
-
children: /* @__PURE__ */
|
|
9369
|
+
children: /* @__PURE__ */ jsx347(DownloadIcon_default, {})
|
|
9325
9370
|
}
|
|
9326
9371
|
),
|
|
9327
|
-
/* @__PURE__ */
|
|
9372
|
+
/* @__PURE__ */ jsx347(
|
|
9328
9373
|
"button",
|
|
9329
9374
|
{
|
|
9330
9375
|
type: "button",
|
|
9331
9376
|
className: "control-btn",
|
|
9332
9377
|
onClick: toggleFullscreen,
|
|
9333
9378
|
"aria-label": isFullscreen ? "\uC804\uCCB4\uD654\uBA74 \uC885\uB8CC" : "\uC804\uCCB4\uD654\uBA74",
|
|
9334
|
-
children: isFullscreen ? /* @__PURE__ */
|
|
9379
|
+
children: isFullscreen ? /* @__PURE__ */ jsx347(MinimizeIcon_default, {}) : /* @__PURE__ */ jsx347(MaximizeIcon_default, {})
|
|
9335
9380
|
}
|
|
9336
9381
|
)
|
|
9337
9382
|
] })
|
|
@@ -9344,10 +9389,10 @@ Video.displayName = "Video";
|
|
|
9344
9389
|
var Video_default = Video;
|
|
9345
9390
|
|
|
9346
9391
|
// src/layout/Grid/FullGrid/FullGrid.tsx
|
|
9347
|
-
import { jsx as
|
|
9392
|
+
import { jsx as jsx348 } from "react/jsx-runtime";
|
|
9348
9393
|
var FullGrid = (props) => {
|
|
9349
9394
|
const { children, gap } = props;
|
|
9350
|
-
return /* @__PURE__ */
|
|
9395
|
+
return /* @__PURE__ */ jsx348(
|
|
9351
9396
|
"div",
|
|
9352
9397
|
{
|
|
9353
9398
|
className: "lib-xplat-full-grid",
|
|
@@ -9360,10 +9405,10 @@ FullGrid.displayName = "FullGrid";
|
|
|
9360
9405
|
var FullGrid_default = FullGrid;
|
|
9361
9406
|
|
|
9362
9407
|
// src/layout/Grid/FullScreen/FullScreen.tsx
|
|
9363
|
-
import { jsx as
|
|
9408
|
+
import { jsx as jsx349 } from "react/jsx-runtime";
|
|
9364
9409
|
var FullScreen = (props) => {
|
|
9365
9410
|
const { children, gap } = props;
|
|
9366
|
-
return /* @__PURE__ */
|
|
9411
|
+
return /* @__PURE__ */ jsx349(
|
|
9367
9412
|
"div",
|
|
9368
9413
|
{
|
|
9369
9414
|
className: "lib-xplat-full-screen",
|
|
@@ -9376,7 +9421,7 @@ FullScreen.displayName = "FullScreen";
|
|
|
9376
9421
|
var FullScreen_default = FullScreen;
|
|
9377
9422
|
|
|
9378
9423
|
// src/layout/Grid/Item/Item.tsx
|
|
9379
|
-
import { jsx as
|
|
9424
|
+
import { jsx as jsx350 } from "react/jsx-runtime";
|
|
9380
9425
|
var calculateSpans = (column) => {
|
|
9381
9426
|
const spans = {};
|
|
9382
9427
|
let inherited = column.default;
|
|
@@ -9393,35 +9438,35 @@ var GridItem = ({ column, children, className }) => {
|
|
|
9393
9438
|
Object.entries(spans).forEach(([key, value]) => {
|
|
9394
9439
|
style[`--column-${key}`] = value;
|
|
9395
9440
|
});
|
|
9396
|
-
return /* @__PURE__ */
|
|
9441
|
+
return /* @__PURE__ */ jsx350("div", { className: clsx_default("lib-xplat-grid-item", className), style, children });
|
|
9397
9442
|
};
|
|
9398
9443
|
GridItem.displayName = "GridItem";
|
|
9399
9444
|
var Item_default = GridItem;
|
|
9400
9445
|
|
|
9401
9446
|
// src/layout/Header/Header.tsx
|
|
9402
|
-
import { jsx as
|
|
9447
|
+
import { jsx as jsx351, jsxs as jsxs222 } from "react/jsx-runtime";
|
|
9403
9448
|
var Header = ({
|
|
9404
9449
|
logo,
|
|
9405
9450
|
centerContent,
|
|
9406
9451
|
rightContent
|
|
9407
9452
|
}) => {
|
|
9408
9453
|
return /* @__PURE__ */ jsxs222("div", { className: "lib-xplat-layout-header", children: [
|
|
9409
|
-
/* @__PURE__ */
|
|
9410
|
-
/* @__PURE__ */
|
|
9411
|
-
/* @__PURE__ */
|
|
9454
|
+
/* @__PURE__ */ jsx351("div", { children: logo }),
|
|
9455
|
+
/* @__PURE__ */ jsx351("div", { children: centerContent }),
|
|
9456
|
+
/* @__PURE__ */ jsx351("div", { children: rightContent })
|
|
9412
9457
|
] });
|
|
9413
9458
|
};
|
|
9414
9459
|
Header.displayName = "Header";
|
|
9415
9460
|
var Header_default = Header;
|
|
9416
9461
|
|
|
9417
9462
|
// src/layout/Layout/Layout.tsx
|
|
9418
|
-
import { Fragment as
|
|
9463
|
+
import { Fragment as Fragment5, jsx as jsx352, jsxs as jsxs223 } from "react/jsx-runtime";
|
|
9419
9464
|
var Layout = (props) => {
|
|
9420
9465
|
const { header, sideBar, children } = props;
|
|
9421
|
-
return /* @__PURE__ */
|
|
9422
|
-
sideBar && /* @__PURE__ */
|
|
9466
|
+
return /* @__PURE__ */ jsx352("div", { className: "lib-xplat-layout", children: /* @__PURE__ */ jsxs223("div", { className: "lib-xplat-layout-content-wrapper", children: [
|
|
9467
|
+
sideBar && /* @__PURE__ */ jsx352(Fragment5, { children: sideBar }),
|
|
9423
9468
|
/* @__PURE__ */ jsxs223("div", { className: "lib-xplat-layout-content", children: [
|
|
9424
|
-
header && /* @__PURE__ */
|
|
9469
|
+
header && /* @__PURE__ */ jsx352("div", { className: "lib-xplat-layout-conent-header", children: header }),
|
|
9425
9470
|
children
|
|
9426
9471
|
] })
|
|
9427
9472
|
] }) });
|
|
@@ -9430,31 +9475,31 @@ Layout.displayName = "Layout";
|
|
|
9430
9475
|
var Layout_default = Layout;
|
|
9431
9476
|
|
|
9432
9477
|
// src/layout/SideBar/SideBar.tsx
|
|
9433
|
-
import
|
|
9478
|
+
import React41 from "react";
|
|
9434
9479
|
|
|
9435
9480
|
// src/layout/SideBar/SideBarContext.tsx
|
|
9436
|
-
import
|
|
9437
|
-
var SideBarContext =
|
|
9481
|
+
import React40 from "react";
|
|
9482
|
+
var SideBarContext = React40.createContext(null);
|
|
9438
9483
|
var useSideBarContext = () => {
|
|
9439
|
-
const ctx =
|
|
9484
|
+
const ctx = React40.useContext(SideBarContext);
|
|
9440
9485
|
if (!ctx) throw new Error("Error");
|
|
9441
9486
|
return ctx;
|
|
9442
9487
|
};
|
|
9443
9488
|
var SideBarContext_default = SideBarContext;
|
|
9444
9489
|
|
|
9445
9490
|
// src/layout/SideBar/SideBar.tsx
|
|
9446
|
-
import { jsx as
|
|
9491
|
+
import { jsx as jsx353 } from "react/jsx-runtime";
|
|
9447
9492
|
var SideBar = (props) => {
|
|
9448
9493
|
const { children, className } = props;
|
|
9449
|
-
const [isOpen, setIsOpen] =
|
|
9494
|
+
const [isOpen, setIsOpen] = React41.useState(true);
|
|
9450
9495
|
const handleSwitchSideBar = () => {
|
|
9451
9496
|
setIsOpen((prev) => !prev);
|
|
9452
9497
|
};
|
|
9453
|
-
return /* @__PURE__ */
|
|
9498
|
+
return /* @__PURE__ */ jsx353(
|
|
9454
9499
|
SideBarContext_default.Provider,
|
|
9455
9500
|
{
|
|
9456
9501
|
value: { isSidebarOpen: isOpen, handleSwitchSideBar },
|
|
9457
|
-
children: /* @__PURE__ */
|
|
9502
|
+
children: /* @__PURE__ */ jsx353(
|
|
9458
9503
|
"div",
|
|
9459
9504
|
{
|
|
9460
9505
|
className: clsx_default(
|