@x-plat/design-system 0.5.10 → 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 +55 -27
- package/dist/components/Dropdown/index.css +10 -10
- package/dist/components/Dropdown/index.js +54 -26
- 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 +50 -22
- package/dist/components/PopOver/index.css +7 -10
- package/dist/components/PopOver/index.js +49 -21
- package/dist/components/Select/index.cjs +369 -341
- package/dist/components/Select/index.css +13 -23
- package/dist/components/Select/index.js +368 -340
- package/dist/components/index.cjs +503 -451
- package/dist/components/index.css +30 -43
- package/dist/components/index.js +459 -407
- package/dist/index.cjs +527 -475
- package/dist/index.css +30 -43
- package/dist/index.js +481 -429
- 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,50 +7391,60 @@ 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();
|
|
7365
|
-
const viewportWidth = window.innerWidth;
|
|
7366
7407
|
const viewportHeight = window.innerHeight;
|
|
7367
|
-
const
|
|
7408
|
+
const viewportWidth = window.innerWidth;
|
|
7368
7409
|
let direction = "bottom";
|
|
7369
|
-
|
|
7410
|
+
let top;
|
|
7411
|
+
let left = triggerRect.left;
|
|
7412
|
+
if (triggerRect.bottom + popRect.height > viewportHeight && triggerRect.top - popRect.height > 0) {
|
|
7370
7413
|
direction = "top";
|
|
7414
|
+
top = triggerRect.top - popRect.height;
|
|
7415
|
+
} else {
|
|
7416
|
+
top = triggerRect.bottom;
|
|
7371
7417
|
}
|
|
7372
|
-
if (
|
|
7373
|
-
|
|
7374
|
-
}
|
|
7375
|
-
if (triggerRect.left < 0) {
|
|
7376
|
-
position2["left"] = 10;
|
|
7418
|
+
if (left + popRect.width > viewportWidth) {
|
|
7419
|
+
left = viewportWidth - popRect.width - 8;
|
|
7377
7420
|
}
|
|
7421
|
+
if (left < 8) left = 8;
|
|
7378
7422
|
setPosition({
|
|
7379
|
-
position:
|
|
7423
|
+
position: { top, left, width: triggerRect.width },
|
|
7380
7424
|
direction
|
|
7381
7425
|
});
|
|
7382
7426
|
}, [triggerRef, popRef]);
|
|
7383
|
-
|
|
7384
|
-
|
|
7427
|
+
React17.useEffect(() => {
|
|
7428
|
+
if (!enabled) return;
|
|
7429
|
+
const raf = requestAnimationFrame(() => {
|
|
7430
|
+
calculatePosition();
|
|
7431
|
+
});
|
|
7385
7432
|
window.addEventListener("resize", calculatePosition);
|
|
7386
|
-
|
|
7433
|
+
window.addEventListener("scroll", calculatePosition, true);
|
|
7434
|
+
return () => {
|
|
7435
|
+
cancelAnimationFrame(raf);
|
|
7436
|
+
window.removeEventListener("resize", calculatePosition);
|
|
7437
|
+
window.removeEventListener("scroll", calculatePosition, true);
|
|
7438
|
+
};
|
|
7387
7439
|
}, [calculatePosition, enabled]);
|
|
7388
7440
|
return position;
|
|
7389
7441
|
};
|
|
7390
7442
|
var useAutoPosition_default = useAutoPosition;
|
|
7391
7443
|
|
|
7392
7444
|
// src/tokens/hooks/useClickOutside.ts
|
|
7393
|
-
import
|
|
7445
|
+
import React18 from "react";
|
|
7394
7446
|
var useClickOutside = (refs, handler, enabled = true) => {
|
|
7395
|
-
|
|
7447
|
+
React18.useEffect(() => {
|
|
7396
7448
|
if (!enabled) return;
|
|
7397
7449
|
const refArray = Array.isArray(refs) ? refs : [refs];
|
|
7398
7450
|
const listener = (event) => {
|
|
@@ -7415,17 +7467,17 @@ var useClickOutside = (refs, handler, enabled = true) => {
|
|
|
7415
7467
|
var useClickOutside_default = useClickOutside;
|
|
7416
7468
|
|
|
7417
7469
|
// src/components/Dropdown/Dropdown.tsx
|
|
7418
|
-
import { jsx as
|
|
7470
|
+
import { jsx as jsx321, jsxs as jsxs206 } from "react/jsx-runtime";
|
|
7419
7471
|
var Dropdown = (props) => {
|
|
7420
7472
|
const { items, children } = props;
|
|
7421
|
-
const [isOpen, setIsOpen] =
|
|
7422
|
-
const [mounted, setMounted] =
|
|
7423
|
-
const [visible, setVisible] =
|
|
7424
|
-
const triggerRef =
|
|
7425
|
-
const menuRef =
|
|
7426
|
-
const { position, direction } = useAutoPosition_default(triggerRef, menuRef,
|
|
7427
|
-
useClickOutside_default([triggerRef, menuRef], () => setIsOpen(false));
|
|
7428
|
-
|
|
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(() => {
|
|
7429
7481
|
if (isOpen) {
|
|
7430
7482
|
setMounted(true);
|
|
7431
7483
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -7441,7 +7493,7 @@ var Dropdown = (props) => {
|
|
|
7441
7493
|
setIsOpen(false);
|
|
7442
7494
|
};
|
|
7443
7495
|
return /* @__PURE__ */ jsxs206("div", { className: "lib-xplat-dropdown", children: [
|
|
7444
|
-
/* @__PURE__ */
|
|
7496
|
+
/* @__PURE__ */ jsx321(
|
|
7445
7497
|
"div",
|
|
7446
7498
|
{
|
|
7447
7499
|
ref: triggerRef,
|
|
@@ -7450,14 +7502,14 @@ var Dropdown = (props) => {
|
|
|
7450
7502
|
children
|
|
7451
7503
|
}
|
|
7452
7504
|
),
|
|
7453
|
-
mounted && /* @__PURE__ */
|
|
7505
|
+
mounted && /* @__PURE__ */ jsx321(Portal_default, { children: /* @__PURE__ */ jsx321(
|
|
7454
7506
|
"div",
|
|
7455
7507
|
{
|
|
7456
7508
|
ref: menuRef,
|
|
7457
|
-
className: clsx_default("dropdown-menu", direction, { visible }),
|
|
7509
|
+
className: clsx_default("lib-xplat-dropdown-menu", direction, { visible }),
|
|
7458
7510
|
style: { top: position.top, left: position.left },
|
|
7459
7511
|
role: "menu",
|
|
7460
|
-
children: items.map((item) => /* @__PURE__ */
|
|
7512
|
+
children: items.map((item) => /* @__PURE__ */ jsx321(
|
|
7461
7513
|
"button",
|
|
7462
7514
|
{
|
|
7463
7515
|
className: clsx_default("dropdown-item", {
|
|
@@ -7472,30 +7524,30 @@ var Dropdown = (props) => {
|
|
|
7472
7524
|
item.key
|
|
7473
7525
|
))
|
|
7474
7526
|
}
|
|
7475
|
-
)
|
|
7527
|
+
) })
|
|
7476
7528
|
] });
|
|
7477
7529
|
};
|
|
7478
7530
|
Dropdown.displayName = "Dropdown";
|
|
7479
7531
|
var Dropdown_default = Dropdown;
|
|
7480
7532
|
|
|
7481
7533
|
// src/components/EmptyState/EmptyState.tsx
|
|
7482
|
-
import { jsx as
|
|
7534
|
+
import { jsx as jsx322, jsxs as jsxs207 } from "react/jsx-runtime";
|
|
7483
7535
|
var EmptyState = (props) => {
|
|
7484
7536
|
const { icon, title = "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4", description, action } = props;
|
|
7485
7537
|
return /* @__PURE__ */ jsxs207("div", { className: "lib-xplat-empty-state", children: [
|
|
7486
|
-
icon && /* @__PURE__ */
|
|
7487
|
-
!icon && /* @__PURE__ */
|
|
7488
|
-
/* @__PURE__ */
|
|
7489
|
-
description && /* @__PURE__ */
|
|
7490
|
-
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 })
|
|
7491
7543
|
] });
|
|
7492
7544
|
};
|
|
7493
7545
|
EmptyState.displayName = "EmptyState";
|
|
7494
7546
|
var EmptyState_default = EmptyState;
|
|
7495
7547
|
|
|
7496
7548
|
// src/components/FileUpload/FileUpload.tsx
|
|
7497
|
-
import
|
|
7498
|
-
import { jsx as
|
|
7549
|
+
import React20 from "react";
|
|
7550
|
+
import { jsx as jsx323, jsxs as jsxs208 } from "react/jsx-runtime";
|
|
7499
7551
|
var FileUpload = (props) => {
|
|
7500
7552
|
const {
|
|
7501
7553
|
accept,
|
|
@@ -7505,8 +7557,8 @@ var FileUpload = (props) => {
|
|
|
7505
7557
|
label = "\uD30C\uC77C\uC744 \uB4DC\uB798\uADF8\uD558\uAC70\uB098 \uD074\uB9AD\uD558\uC5EC \uC5C5\uB85C\uB4DC",
|
|
7506
7558
|
description
|
|
7507
7559
|
} = props;
|
|
7508
|
-
const [isDragOver, setIsDragOver] =
|
|
7509
|
-
const inputRef =
|
|
7560
|
+
const [isDragOver, setIsDragOver] = React20.useState(false);
|
|
7561
|
+
const inputRef = React20.useRef(null);
|
|
7510
7562
|
const handleFiles = (fileList) => {
|
|
7511
7563
|
let files = Array.from(fileList);
|
|
7512
7564
|
if (maxSize) {
|
|
@@ -7545,7 +7597,7 @@ var FileUpload = (props) => {
|
|
|
7545
7597
|
onDragLeave: handleDragLeave,
|
|
7546
7598
|
onClick: () => inputRef.current?.click(),
|
|
7547
7599
|
children: [
|
|
7548
|
-
/* @__PURE__ */
|
|
7600
|
+
/* @__PURE__ */ jsx323(
|
|
7549
7601
|
"input",
|
|
7550
7602
|
{
|
|
7551
7603
|
ref: inputRef,
|
|
@@ -7555,9 +7607,9 @@ var FileUpload = (props) => {
|
|
|
7555
7607
|
onChange: handleChange
|
|
7556
7608
|
}
|
|
7557
7609
|
),
|
|
7558
|
-
/* @__PURE__ */
|
|
7559
|
-
/* @__PURE__ */
|
|
7560
|
-
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 })
|
|
7561
7613
|
]
|
|
7562
7614
|
}
|
|
7563
7615
|
);
|
|
@@ -7566,10 +7618,10 @@ FileUpload.displayName = "FileUpload";
|
|
|
7566
7618
|
var FileUpload_default = FileUpload;
|
|
7567
7619
|
|
|
7568
7620
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
7569
|
-
import
|
|
7621
|
+
import React22 from "react";
|
|
7570
7622
|
|
|
7571
7623
|
// src/components/HtmlTypeWriter/utils.ts
|
|
7572
|
-
import
|
|
7624
|
+
import React21 from "react";
|
|
7573
7625
|
var voidTags = /* @__PURE__ */ new Set([
|
|
7574
7626
|
"br",
|
|
7575
7627
|
"img",
|
|
@@ -7637,41 +7689,41 @@ var convertNodeToReactWithRange = (node, typedLen, rangeMap) => {
|
|
|
7637
7689
|
props[attr.name] = attr.value;
|
|
7638
7690
|
});
|
|
7639
7691
|
if (voidTags.has(tag)) {
|
|
7640
|
-
return
|
|
7692
|
+
return React21.createElement(tag, props);
|
|
7641
7693
|
}
|
|
7642
7694
|
const children = Array.from(element.childNodes).map((child) => convertNodeToReactWithRange(child, typedLen, rangeMap)).filter((n) => n != null);
|
|
7643
|
-
return
|
|
7695
|
+
return React21.createElement(tag, props, ...children);
|
|
7644
7696
|
};
|
|
7645
7697
|
var htmlToReactProgressive = (root, typedLen, rangeMap) => {
|
|
7646
7698
|
const nodes = Array.from(root.childNodes).map((child, idx) => {
|
|
7647
7699
|
const node = convertNodeToReactWithRange(child, typedLen, rangeMap);
|
|
7648
|
-
return node == null ? null :
|
|
7700
|
+
return node == null ? null : React21.createElement(React21.Fragment, { key: idx }, node);
|
|
7649
7701
|
}).filter(Boolean);
|
|
7650
7702
|
return nodes.length === 0 ? null : nodes;
|
|
7651
7703
|
};
|
|
7652
7704
|
|
|
7653
7705
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
7654
|
-
import { jsx as
|
|
7706
|
+
import { jsx as jsx324 } from "react/jsx-runtime";
|
|
7655
7707
|
var HtmlTypeWriter = ({
|
|
7656
7708
|
html,
|
|
7657
7709
|
duration = 20,
|
|
7658
7710
|
onDone,
|
|
7659
7711
|
onChange
|
|
7660
7712
|
}) => {
|
|
7661
|
-
const [typedLen, setTypedLen] =
|
|
7662
|
-
const doneCalledRef =
|
|
7663
|
-
const { doc, rangeMap, totalLength } =
|
|
7713
|
+
const [typedLen, setTypedLen] = React22.useState(0);
|
|
7714
|
+
const doneCalledRef = React22.useRef(false);
|
|
7715
|
+
const { doc, rangeMap, totalLength } = React22.useMemo(() => {
|
|
7664
7716
|
if (typeof window === "undefined") return { doc: null, rangeMap: /* @__PURE__ */ new Map(), totalLength: 0 };
|
|
7665
7717
|
const decoded = decodeHtmlEntities(html);
|
|
7666
7718
|
const doc2 = new DOMParser().parseFromString(decoded, "text/html");
|
|
7667
7719
|
const { rangeMap: rangeMap2, totalLength: totalLength2 } = buildRangeMap(doc2.body);
|
|
7668
7720
|
return { doc: doc2, rangeMap: rangeMap2, totalLength: totalLength2 };
|
|
7669
7721
|
}, [html]);
|
|
7670
|
-
|
|
7722
|
+
React22.useEffect(() => {
|
|
7671
7723
|
setTypedLen(0);
|
|
7672
7724
|
doneCalledRef.current = false;
|
|
7673
7725
|
}, [html]);
|
|
7674
|
-
|
|
7726
|
+
React22.useEffect(() => {
|
|
7675
7727
|
if (!totalLength) return;
|
|
7676
7728
|
if (typedLen >= totalLength) return;
|
|
7677
7729
|
const timer = window.setInterval(() => {
|
|
@@ -7679,33 +7731,33 @@ var HtmlTypeWriter = ({
|
|
|
7679
7731
|
}, duration);
|
|
7680
7732
|
return () => window.clearInterval(timer);
|
|
7681
7733
|
}, [typedLen, totalLength, duration]);
|
|
7682
|
-
|
|
7734
|
+
React22.useEffect(() => {
|
|
7683
7735
|
if (typedLen > 0 && typedLen < totalLength) {
|
|
7684
7736
|
onChange?.();
|
|
7685
7737
|
}
|
|
7686
7738
|
}, [typedLen, totalLength, onChange]);
|
|
7687
|
-
|
|
7739
|
+
React22.useEffect(() => {
|
|
7688
7740
|
if (typedLen === totalLength && totalLength > 0 && !doneCalledRef.current) {
|
|
7689
7741
|
doneCalledRef.current = true;
|
|
7690
7742
|
onDone?.();
|
|
7691
7743
|
}
|
|
7692
7744
|
}, [typedLen, totalLength, onDone]);
|
|
7693
|
-
const parsed =
|
|
7745
|
+
const parsed = React22.useMemo(
|
|
7694
7746
|
() => doc ? htmlToReactProgressive(doc.body, typedLen, rangeMap) : null,
|
|
7695
7747
|
[doc, typedLen, rangeMap]
|
|
7696
7748
|
);
|
|
7697
|
-
return /* @__PURE__ */
|
|
7749
|
+
return /* @__PURE__ */ jsx324("div", { className: "lib-xplat-htmlTypewriter", children: parsed });
|
|
7698
7750
|
};
|
|
7699
7751
|
HtmlTypeWriter.displayName = "HtmlTypeWriter";
|
|
7700
7752
|
var HtmlTypeWriter_default = HtmlTypeWriter;
|
|
7701
7753
|
|
|
7702
7754
|
// src/components/ImageSelector/ImageSelector.tsx
|
|
7703
|
-
import
|
|
7704
|
-
import { jsx as
|
|
7755
|
+
import React23 from "react";
|
|
7756
|
+
import { jsx as jsx325, jsxs as jsxs209 } from "react/jsx-runtime";
|
|
7705
7757
|
var ImageSelector = (props) => {
|
|
7706
7758
|
const { value, label, onChange } = props;
|
|
7707
|
-
const [previewUrl, setPreviewUrl] =
|
|
7708
|
-
|
|
7759
|
+
const [previewUrl, setPreviewUrl] = React23.useState();
|
|
7760
|
+
React23.useEffect(() => {
|
|
7709
7761
|
if (!value) {
|
|
7710
7762
|
setPreviewUrl(void 0);
|
|
7711
7763
|
return;
|
|
@@ -7714,7 +7766,7 @@ var ImageSelector = (props) => {
|
|
|
7714
7766
|
setPreviewUrl(url);
|
|
7715
7767
|
return () => URL.revokeObjectURL(url);
|
|
7716
7768
|
}, [value]);
|
|
7717
|
-
const inputRef =
|
|
7769
|
+
const inputRef = React23.useRef(null);
|
|
7718
7770
|
const handleFileChange = (e) => {
|
|
7719
7771
|
const selectedFile = e.target.files?.[0];
|
|
7720
7772
|
if (selectedFile) {
|
|
@@ -7728,7 +7780,7 @@ var ImageSelector = (props) => {
|
|
|
7728
7780
|
inputRef.current?.click();
|
|
7729
7781
|
};
|
|
7730
7782
|
return /* @__PURE__ */ jsxs209("div", { className: `lib-xplat-imageselector${value ? "" : " none-value"}`, children: [
|
|
7731
|
-
/* @__PURE__ */
|
|
7783
|
+
/* @__PURE__ */ jsx325(
|
|
7732
7784
|
"input",
|
|
7733
7785
|
{
|
|
7734
7786
|
type: "file",
|
|
@@ -7739,12 +7791,12 @@ var ImageSelector = (props) => {
|
|
|
7739
7791
|
}
|
|
7740
7792
|
),
|
|
7741
7793
|
value && /* @__PURE__ */ jsxs209("div", { className: "action-bar", children: [
|
|
7742
|
-
/* @__PURE__ */
|
|
7743
|
-
/* @__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, {}) })
|
|
7744
7796
|
] }),
|
|
7745
|
-
/* @__PURE__ */
|
|
7746
|
-
/* @__PURE__ */
|
|
7747
|
-
/* @__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" })
|
|
7748
7800
|
] }) })
|
|
7749
7801
|
] });
|
|
7750
7802
|
};
|
|
@@ -7752,7 +7804,7 @@ ImageSelector.displayName = "ImageSelector";
|
|
|
7752
7804
|
var ImageSelector_default = ImageSelector;
|
|
7753
7805
|
|
|
7754
7806
|
// src/components/Pagination/Pagination.tsx
|
|
7755
|
-
import { jsx as
|
|
7807
|
+
import { jsx as jsx326, jsxs as jsxs210 } from "react/jsx-runtime";
|
|
7756
7808
|
var getPageRange = (current, totalPages, siblingCount) => {
|
|
7757
7809
|
const totalNumbers = siblingCount * 2 + 5;
|
|
7758
7810
|
if (totalPages <= totalNumbers) {
|
|
@@ -7796,18 +7848,18 @@ var Pagination = (props) => {
|
|
|
7796
7848
|
}
|
|
7797
7849
|
};
|
|
7798
7850
|
return /* @__PURE__ */ jsxs210("nav", { className: clsx_default("lib-xplat-pagination", size, type), "aria-label": "\uD398\uC774\uC9C0 \uB124\uBE44\uAC8C\uC774\uC158", children: [
|
|
7799
|
-
/* @__PURE__ */
|
|
7851
|
+
/* @__PURE__ */ jsx326(
|
|
7800
7852
|
"button",
|
|
7801
7853
|
{
|
|
7802
7854
|
className: "page-btn prev",
|
|
7803
7855
|
disabled: current <= 1,
|
|
7804
7856
|
onClick: () => handleClick(current - 1),
|
|
7805
7857
|
"aria-label": "\uC774\uC804 \uD398\uC774\uC9C0",
|
|
7806
|
-
children: /* @__PURE__ */
|
|
7858
|
+
children: /* @__PURE__ */ jsx326(ChevronLeftIcon_default, {})
|
|
7807
7859
|
}
|
|
7808
7860
|
),
|
|
7809
7861
|
pages.map(
|
|
7810
|
-
(page, i) => page === "..." ? /* @__PURE__ */
|
|
7862
|
+
(page, i) => page === "..." ? /* @__PURE__ */ jsx326("span", { className: "dots", children: "..." }, `dots-${i}`) : /* @__PURE__ */ jsx326(
|
|
7811
7863
|
"button",
|
|
7812
7864
|
{
|
|
7813
7865
|
className: clsx_default("page-btn", { active: page === current }),
|
|
@@ -7818,14 +7870,14 @@ var Pagination = (props) => {
|
|
|
7818
7870
|
page
|
|
7819
7871
|
)
|
|
7820
7872
|
),
|
|
7821
|
-
/* @__PURE__ */
|
|
7873
|
+
/* @__PURE__ */ jsx326(
|
|
7822
7874
|
"button",
|
|
7823
7875
|
{
|
|
7824
7876
|
className: "page-btn next",
|
|
7825
7877
|
disabled: current >= totalPages,
|
|
7826
7878
|
onClick: () => handleClick(current + 1),
|
|
7827
7879
|
"aria-label": "\uB2E4\uC74C \uD398\uC774\uC9C0",
|
|
7828
|
-
children: /* @__PURE__ */
|
|
7880
|
+
children: /* @__PURE__ */ jsx326(ChevronRightIcon_default, {})
|
|
7829
7881
|
}
|
|
7830
7882
|
)
|
|
7831
7883
|
] });
|
|
@@ -7834,17 +7886,17 @@ Pagination.displayName = "Pagination";
|
|
|
7834
7886
|
var Pagination_default = Pagination;
|
|
7835
7887
|
|
|
7836
7888
|
// src/components/PopOver/PopOver.tsx
|
|
7837
|
-
import
|
|
7838
|
-
import { jsx as
|
|
7889
|
+
import React24 from "react";
|
|
7890
|
+
import { jsx as jsx327, jsxs as jsxs211 } from "react/jsx-runtime";
|
|
7839
7891
|
var PopOver = (props) => {
|
|
7840
7892
|
const { children, isOpen, onClose, PopOverEl } = props;
|
|
7841
|
-
const popRef =
|
|
7842
|
-
const triggerRef =
|
|
7843
|
-
const [localOpen, setLocalOpen] =
|
|
7844
|
-
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);
|
|
7845
7897
|
useClickOutside_default([popRef, triggerRef], onClose, isOpen);
|
|
7846
7898
|
const position = useAutoPosition_default(triggerRef, popRef, localOpen);
|
|
7847
|
-
|
|
7899
|
+
React24.useEffect(() => {
|
|
7848
7900
|
if (isOpen) {
|
|
7849
7901
|
setLocalOpen(isOpen);
|
|
7850
7902
|
setTimeout(() => {
|
|
@@ -7867,11 +7919,11 @@ var PopOver = (props) => {
|
|
|
7867
7919
|
},
|
|
7868
7920
|
children: [
|
|
7869
7921
|
children,
|
|
7870
|
-
localOpen && /* @__PURE__ */
|
|
7922
|
+
localOpen && /* @__PURE__ */ jsx327(Portal_default, { children: /* @__PURE__ */ jsx327(
|
|
7871
7923
|
"div",
|
|
7872
7924
|
{
|
|
7873
7925
|
className: clsx_default(
|
|
7874
|
-
"content
|
|
7926
|
+
"lib-xplat-pop-over-content",
|
|
7875
7927
|
position.direction,
|
|
7876
7928
|
eventTrigger && "visible"
|
|
7877
7929
|
),
|
|
@@ -7881,7 +7933,7 @@ var PopOver = (props) => {
|
|
|
7881
7933
|
},
|
|
7882
7934
|
children: PopOverEl
|
|
7883
7935
|
}
|
|
7884
|
-
)
|
|
7936
|
+
) })
|
|
7885
7937
|
]
|
|
7886
7938
|
}
|
|
7887
7939
|
);
|
|
@@ -7890,7 +7942,7 @@ PopOver.displayName = "PopOver";
|
|
|
7890
7942
|
var PopOver_default = PopOver;
|
|
7891
7943
|
|
|
7892
7944
|
// src/components/Progress/Progress.tsx
|
|
7893
|
-
import { jsx as
|
|
7945
|
+
import { jsx as jsx328, jsxs as jsxs212 } from "react/jsx-runtime";
|
|
7894
7946
|
var Progress = (props) => {
|
|
7895
7947
|
const {
|
|
7896
7948
|
value,
|
|
@@ -7901,7 +7953,7 @@ var Progress = (props) => {
|
|
|
7901
7953
|
} = props;
|
|
7902
7954
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
7903
7955
|
return /* @__PURE__ */ jsxs212("div", { className: clsx_default("lib-xplat-progress", size, type), children: [
|
|
7904
|
-
/* @__PURE__ */
|
|
7956
|
+
/* @__PURE__ */ jsx328(
|
|
7905
7957
|
"div",
|
|
7906
7958
|
{
|
|
7907
7959
|
className: "track",
|
|
@@ -7909,7 +7961,7 @@ var Progress = (props) => {
|
|
|
7909
7961
|
"aria-valuenow": value,
|
|
7910
7962
|
"aria-valuemin": 0,
|
|
7911
7963
|
"aria-valuemax": max,
|
|
7912
|
-
children: /* @__PURE__ */
|
|
7964
|
+
children: /* @__PURE__ */ jsx328(
|
|
7913
7965
|
"div",
|
|
7914
7966
|
{
|
|
7915
7967
|
className: "bar",
|
|
@@ -7928,17 +7980,17 @@ Progress.displayName = "Progress";
|
|
|
7928
7980
|
var Progress_default = Progress;
|
|
7929
7981
|
|
|
7930
7982
|
// src/components/Radio/RadioGroupContext.tsx
|
|
7931
|
-
import
|
|
7932
|
-
var RadioGroupContext =
|
|
7983
|
+
import React25 from "react";
|
|
7984
|
+
var RadioGroupContext = React25.createContext(
|
|
7933
7985
|
null
|
|
7934
7986
|
);
|
|
7935
7987
|
var useRadioGroupContext = () => {
|
|
7936
|
-
return
|
|
7988
|
+
return React25.useContext(RadioGroupContext);
|
|
7937
7989
|
};
|
|
7938
7990
|
var RadioGroupContext_default = RadioGroupContext;
|
|
7939
7991
|
|
|
7940
7992
|
// src/components/Radio/Radio.tsx
|
|
7941
|
-
import { jsx as
|
|
7993
|
+
import { jsx as jsx329, jsxs as jsxs213 } from "react/jsx-runtime";
|
|
7942
7994
|
var Radio = (props) => {
|
|
7943
7995
|
const {
|
|
7944
7996
|
label,
|
|
@@ -7966,18 +8018,18 @@ var Radio = (props) => {
|
|
|
7966
8018
|
localChecked ? "checked" : void 0
|
|
7967
8019
|
),
|
|
7968
8020
|
children: [
|
|
7969
|
-
/* @__PURE__ */
|
|
7970
|
-
/* @__PURE__ */
|
|
8021
|
+
/* @__PURE__ */ jsx329("input", { ...rest, ...inputProps, checked: localChecked, type: "radio" }),
|
|
8022
|
+
/* @__PURE__ */ jsx329(
|
|
7971
8023
|
"div",
|
|
7972
8024
|
{
|
|
7973
8025
|
className: clsx_default(
|
|
7974
8026
|
"circle",
|
|
7975
8027
|
localChecked ? "checked" : void 0
|
|
7976
8028
|
),
|
|
7977
|
-
children: localChecked && /* @__PURE__ */
|
|
8029
|
+
children: localChecked && /* @__PURE__ */ jsx329("div", { className: "inner-circle" })
|
|
7978
8030
|
}
|
|
7979
8031
|
),
|
|
7980
|
-
label && /* @__PURE__ */
|
|
8032
|
+
label && /* @__PURE__ */ jsx329("span", { children: label })
|
|
7981
8033
|
]
|
|
7982
8034
|
}
|
|
7983
8035
|
);
|
|
@@ -7986,28 +8038,28 @@ Radio.displayName = "Radio";
|
|
|
7986
8038
|
var Radio_default = Radio;
|
|
7987
8039
|
|
|
7988
8040
|
// src/components/Radio/RadioGroup.tsx
|
|
7989
|
-
import { Fragment as
|
|
8041
|
+
import { Fragment as Fragment4, jsx as jsx330 } from "react/jsx-runtime";
|
|
7990
8042
|
var RadioGroup = (props) => {
|
|
7991
8043
|
const { children, ...rest } = props;
|
|
7992
|
-
return /* @__PURE__ */
|
|
8044
|
+
return /* @__PURE__ */ jsx330(Fragment4, { children: /* @__PURE__ */ jsx330(RadioGroupContext_default.Provider, { value: rest, children }) });
|
|
7993
8045
|
};
|
|
7994
8046
|
RadioGroup.displayName = "RadioGroup";
|
|
7995
8047
|
var RadioGroup_default = RadioGroup;
|
|
7996
8048
|
|
|
7997
8049
|
// src/components/Select/Select.tsx
|
|
7998
|
-
import
|
|
8050
|
+
import React28 from "react";
|
|
7999
8051
|
|
|
8000
8052
|
// src/components/Select/context.ts
|
|
8001
|
-
import
|
|
8002
|
-
var SelectContext =
|
|
8053
|
+
import React26 from "react";
|
|
8054
|
+
var SelectContext = React26.createContext(null);
|
|
8003
8055
|
var context_default = SelectContext;
|
|
8004
8056
|
|
|
8005
8057
|
// src/components/Select/SelectItem.tsx
|
|
8006
|
-
import
|
|
8007
|
-
import { jsx as
|
|
8058
|
+
import React27 from "react";
|
|
8059
|
+
import { jsx as jsx331 } from "react/jsx-runtime";
|
|
8008
8060
|
var SelectItem = (props) => {
|
|
8009
8061
|
const { children, value, onClick, disabled = false } = props;
|
|
8010
|
-
const ctx =
|
|
8062
|
+
const ctx = React27.useContext(context_default);
|
|
8011
8063
|
const handleClick = (e) => {
|
|
8012
8064
|
e.preventDefault();
|
|
8013
8065
|
e.stopPropagation();
|
|
@@ -8016,7 +8068,7 @@ var SelectItem = (props) => {
|
|
|
8016
8068
|
ctx?.close();
|
|
8017
8069
|
onClick?.();
|
|
8018
8070
|
};
|
|
8019
|
-
return /* @__PURE__ */
|
|
8071
|
+
return /* @__PURE__ */ jsx331(
|
|
8020
8072
|
"div",
|
|
8021
8073
|
{
|
|
8022
8074
|
className: clsx_default("select-item", disabled && "disabled"),
|
|
@@ -8037,7 +8089,7 @@ SelectItem.displayName = "Select.Item";
|
|
|
8037
8089
|
var SelectItem_default = SelectItem;
|
|
8038
8090
|
|
|
8039
8091
|
// src/components/Select/Select.tsx
|
|
8040
|
-
import { jsx as
|
|
8092
|
+
import { jsx as jsx332, jsxs as jsxs214 } from "react/jsx-runtime";
|
|
8041
8093
|
var ANIMATION_DURATION_MS3 = 200;
|
|
8042
8094
|
var SelectRoot = (props) => {
|
|
8043
8095
|
const {
|
|
@@ -8049,26 +8101,26 @@ var SelectRoot = (props) => {
|
|
|
8049
8101
|
error = false,
|
|
8050
8102
|
size = "md"
|
|
8051
8103
|
} = props;
|
|
8052
|
-
const itemChildren =
|
|
8053
|
-
(child) =>
|
|
8104
|
+
const itemChildren = React28.Children.toArray(children).filter(
|
|
8105
|
+
(child) => React28.isValidElement(child) && child.type === SelectItem_default
|
|
8054
8106
|
);
|
|
8055
8107
|
const isControlled = valueProp !== void 0;
|
|
8056
|
-
const [isOpen, setOpen] =
|
|
8057
|
-
const [uncontrolledLabel, setUncontrolledLabel] =
|
|
8058
|
-
const controlledLabel =
|
|
8108
|
+
const [isOpen, setOpen] = React28.useState(false);
|
|
8109
|
+
const [uncontrolledLabel, setUncontrolledLabel] = React28.useState(null);
|
|
8110
|
+
const controlledLabel = React28.useMemo(() => {
|
|
8059
8111
|
if (!isControlled) return null;
|
|
8060
8112
|
const match = itemChildren.find((child) => child.props.value === valueProp);
|
|
8061
8113
|
return match ? match.props.children : null;
|
|
8062
8114
|
}, [isControlled, valueProp, itemChildren]);
|
|
8063
8115
|
const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
|
|
8064
|
-
const triggerRef =
|
|
8065
|
-
const contentRef =
|
|
8066
|
-
const [mounted, setMounted] =
|
|
8067
|
-
const [visible, setVisible] =
|
|
8068
|
-
|
|
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(() => {
|
|
8069
8121
|
if (disabled && isOpen) setOpen(false);
|
|
8070
8122
|
}, [disabled, isOpen]);
|
|
8071
|
-
|
|
8123
|
+
React28.useEffect(() => {
|
|
8072
8124
|
if (isOpen) {
|
|
8073
8125
|
setMounted(true);
|
|
8074
8126
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -8078,12 +8130,12 @@ var SelectRoot = (props) => {
|
|
|
8078
8130
|
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS3);
|
|
8079
8131
|
return () => clearTimeout(t);
|
|
8080
8132
|
}, [isOpen]);
|
|
8081
|
-
const open =
|
|
8082
|
-
const close =
|
|
8083
|
-
const toggle =
|
|
8133
|
+
const open = React28.useCallback(() => setOpen(true), []);
|
|
8134
|
+
const close = React28.useCallback(() => setOpen(false), []);
|
|
8135
|
+
const toggle = React28.useCallback(() => setOpen((prev) => !prev), []);
|
|
8084
8136
|
useClickOutside_default([contentRef, triggerRef], close, isOpen);
|
|
8085
8137
|
const position = useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
8086
|
-
const setSelected =
|
|
8138
|
+
const setSelected = React28.useCallback(
|
|
8087
8139
|
(label, itemValue) => {
|
|
8088
8140
|
if (!isControlled) {
|
|
8089
8141
|
setUncontrolledLabel(label);
|
|
@@ -8092,7 +8144,7 @@ var SelectRoot = (props) => {
|
|
|
8092
8144
|
},
|
|
8093
8145
|
[isControlled, onChange]
|
|
8094
8146
|
);
|
|
8095
|
-
const ctxValue =
|
|
8147
|
+
const ctxValue = React28.useMemo(
|
|
8096
8148
|
() => ({
|
|
8097
8149
|
isOpen,
|
|
8098
8150
|
mounted,
|
|
@@ -8113,7 +8165,7 @@ var SelectRoot = (props) => {
|
|
|
8113
8165
|
if (disabled) return;
|
|
8114
8166
|
toggle();
|
|
8115
8167
|
};
|
|
8116
|
-
return /* @__PURE__ */
|
|
8168
|
+
return /* @__PURE__ */ jsx332(context_default.Provider, { value: ctxValue, children: /* @__PURE__ */ jsxs214(
|
|
8117
8169
|
"div",
|
|
8118
8170
|
{
|
|
8119
8171
|
className: clsx_default(
|
|
@@ -8148,7 +8200,7 @@ var SelectRoot = (props) => {
|
|
|
8148
8200
|
}
|
|
8149
8201
|
},
|
|
8150
8202
|
children: [
|
|
8151
|
-
/* @__PURE__ */
|
|
8203
|
+
/* @__PURE__ */ jsx332(
|
|
8152
8204
|
"span",
|
|
8153
8205
|
{
|
|
8154
8206
|
className: clsx_default(
|
|
@@ -8158,27 +8210,27 @@ var SelectRoot = (props) => {
|
|
|
8158
8210
|
children: selectedLabel ?? placeholder
|
|
8159
8211
|
}
|
|
8160
8212
|
),
|
|
8161
|
-
/* @__PURE__ */
|
|
8213
|
+
/* @__PURE__ */ jsx332(
|
|
8162
8214
|
"span",
|
|
8163
8215
|
{
|
|
8164
8216
|
className: clsx_default("select-trigger-icon", isOpen && "open"),
|
|
8165
8217
|
"aria-hidden": true,
|
|
8166
|
-
children: /* @__PURE__ */
|
|
8218
|
+
children: /* @__PURE__ */ jsx332(ChevronDownIcon_default, {})
|
|
8167
8219
|
}
|
|
8168
8220
|
)
|
|
8169
8221
|
]
|
|
8170
8222
|
}
|
|
8171
8223
|
),
|
|
8172
|
-
mounted && /* @__PURE__ */
|
|
8224
|
+
mounted && /* @__PURE__ */ jsx332(Portal_default, { children: /* @__PURE__ */ jsx332(
|
|
8173
8225
|
"div",
|
|
8174
8226
|
{
|
|
8175
|
-
className: clsx_default("select-content", position.direction, stateClass),
|
|
8227
|
+
className: clsx_default("lib-xplat-select-content", position.direction, stateClass),
|
|
8176
8228
|
ref: contentRef,
|
|
8177
|
-
style: { ...position.position },
|
|
8229
|
+
style: { ...position.position, minWidth: position.position.width },
|
|
8178
8230
|
role: "listbox",
|
|
8179
|
-
children: itemChildren
|
|
8231
|
+
children: /* @__PURE__ */ jsx332(context_default.Provider, { value: ctxValue, children: itemChildren })
|
|
8180
8232
|
}
|
|
8181
|
-
)
|
|
8233
|
+
) })
|
|
8182
8234
|
]
|
|
8183
8235
|
}
|
|
8184
8236
|
) });
|
|
@@ -8190,14 +8242,14 @@ var Select = Object.assign(SelectRoot, {
|
|
|
8190
8242
|
var Select_default = Select;
|
|
8191
8243
|
|
|
8192
8244
|
// src/components/Skeleton/Skeleton.tsx
|
|
8193
|
-
import { jsx as
|
|
8245
|
+
import { jsx as jsx333 } from "react/jsx-runtime";
|
|
8194
8246
|
var Skeleton = (props) => {
|
|
8195
8247
|
const { variant = "text", width, height } = props;
|
|
8196
8248
|
const style = {
|
|
8197
8249
|
width: typeof width === "number" ? `${width}px` : width,
|
|
8198
8250
|
height: typeof height === "number" ? `${height}px` : height
|
|
8199
8251
|
};
|
|
8200
|
-
return /* @__PURE__ */
|
|
8252
|
+
return /* @__PURE__ */ jsx333(
|
|
8201
8253
|
"div",
|
|
8202
8254
|
{
|
|
8203
8255
|
className: clsx_default("lib-xplat-skeleton", variant),
|
|
@@ -8210,20 +8262,20 @@ Skeleton.displayName = "Skeleton";
|
|
|
8210
8262
|
var Skeleton_default = Skeleton;
|
|
8211
8263
|
|
|
8212
8264
|
// src/components/Spinner/Spinner.tsx
|
|
8213
|
-
import { jsx as
|
|
8265
|
+
import { jsx as jsx334, jsxs as jsxs215 } from "react/jsx-runtime";
|
|
8214
8266
|
var Spinner = (props) => {
|
|
8215
8267
|
const {
|
|
8216
8268
|
size = "md",
|
|
8217
8269
|
type = "brand"
|
|
8218
8270
|
} = props;
|
|
8219
|
-
return /* @__PURE__ */
|
|
8271
|
+
return /* @__PURE__ */ jsx334(
|
|
8220
8272
|
"div",
|
|
8221
8273
|
{
|
|
8222
8274
|
className: clsx_default("lib-xplat-spinner", size, type),
|
|
8223
8275
|
role: "status",
|
|
8224
8276
|
"aria-label": "\uB85C\uB529 \uC911",
|
|
8225
8277
|
children: /* @__PURE__ */ jsxs215("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
8226
|
-
/* @__PURE__ */
|
|
8278
|
+
/* @__PURE__ */ jsx334(
|
|
8227
8279
|
"circle",
|
|
8228
8280
|
{
|
|
8229
8281
|
className: "track",
|
|
@@ -8233,7 +8285,7 @@ var Spinner = (props) => {
|
|
|
8233
8285
|
strokeWidth: "3"
|
|
8234
8286
|
}
|
|
8235
8287
|
),
|
|
8236
|
-
/* @__PURE__ */
|
|
8288
|
+
/* @__PURE__ */ jsx334(
|
|
8237
8289
|
"circle",
|
|
8238
8290
|
{
|
|
8239
8291
|
className: "indicator",
|
|
@@ -8252,20 +8304,20 @@ Spinner.displayName = "Spinner";
|
|
|
8252
8304
|
var Spinner_default = Spinner;
|
|
8253
8305
|
|
|
8254
8306
|
// src/components/Steps/Steps.tsx
|
|
8255
|
-
import { jsx as
|
|
8307
|
+
import { jsx as jsx335, jsxs as jsxs216 } from "react/jsx-runtime";
|
|
8256
8308
|
var Steps = (props) => {
|
|
8257
8309
|
const {
|
|
8258
8310
|
items,
|
|
8259
8311
|
current,
|
|
8260
8312
|
type = "brand"
|
|
8261
8313
|
} = props;
|
|
8262
|
-
return /* @__PURE__ */
|
|
8314
|
+
return /* @__PURE__ */ jsx335("div", { className: clsx_default("lib-xplat-steps", type), children: items.map((item, index) => {
|
|
8263
8315
|
const status = index < current ? "completed" : index === current ? "active" : "pending";
|
|
8264
8316
|
return /* @__PURE__ */ jsxs216("div", { className: clsx_default("step-item", status), children: [
|
|
8265
|
-
/* @__PURE__ */
|
|
8317
|
+
/* @__PURE__ */ jsx335("div", { className: "step-circle", children: status === "completed" ? /* @__PURE__ */ jsx335(CheckIcon_default, {}) : /* @__PURE__ */ jsx335("span", { children: index + 1 }) }),
|
|
8266
8318
|
/* @__PURE__ */ jsxs216("div", { className: "step-content", children: [
|
|
8267
|
-
/* @__PURE__ */
|
|
8268
|
-
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 })
|
|
8269
8321
|
] })
|
|
8270
8322
|
] }, index);
|
|
8271
8323
|
}) });
|
|
@@ -8274,8 +8326,8 @@ Steps.displayName = "Steps";
|
|
|
8274
8326
|
var Steps_default = Steps;
|
|
8275
8327
|
|
|
8276
8328
|
// src/components/Swiper/Swiper.tsx
|
|
8277
|
-
import
|
|
8278
|
-
import { jsx as
|
|
8329
|
+
import React29 from "react";
|
|
8330
|
+
import { jsx as jsx336, jsxs as jsxs217 } from "react/jsx-runtime";
|
|
8279
8331
|
var Swiper = (props) => {
|
|
8280
8332
|
const {
|
|
8281
8333
|
auto = false,
|
|
@@ -8298,23 +8350,23 @@ var Swiper = (props) => {
|
|
|
8298
8350
|
const maxIndex = Math.max(0, totalSlides - viewItemCount);
|
|
8299
8351
|
const useLoop = loop && canSlide;
|
|
8300
8352
|
const cloneCount = useLoop ? totalSlides : 0;
|
|
8301
|
-
const extendedItems =
|
|
8353
|
+
const extendedItems = React29.useMemo(() => {
|
|
8302
8354
|
if (!useLoop) return items;
|
|
8303
8355
|
return [...items, ...items, ...items];
|
|
8304
8356
|
}, [items, useLoop]);
|
|
8305
8357
|
const initialIdx = Math.max(0, Math.min(indexProp ?? 0, maxIndex));
|
|
8306
|
-
const [innerIndex, setInnerIndex] =
|
|
8358
|
+
const [innerIndex, setInnerIndex] = React29.useState(
|
|
8307
8359
|
useLoop ? cloneCount + initialIdx : initialIdx
|
|
8308
8360
|
);
|
|
8309
|
-
const [isDragging, setIsDragging] =
|
|
8310
|
-
const [dragOffset, setDragOffset] =
|
|
8311
|
-
const [animated, setAnimated] =
|
|
8312
|
-
const [containerWidth, setContainerWidth] =
|
|
8313
|
-
const containerRef =
|
|
8314
|
-
const startXRef =
|
|
8315
|
-
const startTimeRef =
|
|
8316
|
-
const autoplayTimerRef =
|
|
8317
|
-
|
|
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(() => {
|
|
8318
8370
|
const el = containerRef.current;
|
|
8319
8371
|
if (!el) return;
|
|
8320
8372
|
const ro = new ResizeObserver((entries) => {
|
|
@@ -8333,7 +8385,7 @@ var Swiper = (props) => {
|
|
|
8333
8385
|
return ((inner - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
8334
8386
|
};
|
|
8335
8387
|
const realIndex = getRealIndex(innerIndex);
|
|
8336
|
-
const moveToInner =
|
|
8388
|
+
const moveToInner = React29.useCallback(
|
|
8337
8389
|
(idx, withAnim = true) => {
|
|
8338
8390
|
if (!useLoop) {
|
|
8339
8391
|
setAnimated(withAnim);
|
|
@@ -8361,7 +8413,7 @@ var Swiper = (props) => {
|
|
|
8361
8413
|
},
|
|
8362
8414
|
[useLoop, cloneCount, totalSlides]
|
|
8363
8415
|
);
|
|
8364
|
-
const handleTransitionEnd =
|
|
8416
|
+
const handleTransitionEnd = React29.useCallback(() => {
|
|
8365
8417
|
if (!useLoop) return;
|
|
8366
8418
|
const real = getRealIndex(innerIndex);
|
|
8367
8419
|
const canonical = cloneCount + real;
|
|
@@ -8371,7 +8423,7 @@ var Swiper = (props) => {
|
|
|
8371
8423
|
}
|
|
8372
8424
|
onChange?.(Math.min(real, maxIndex));
|
|
8373
8425
|
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange]);
|
|
8374
|
-
const slideTo =
|
|
8426
|
+
const slideTo = React29.useCallback(
|
|
8375
8427
|
(logicalIndex) => {
|
|
8376
8428
|
if (!canSlide) return;
|
|
8377
8429
|
const clamped = useLoop ? logicalIndex : Math.max(0, Math.min(logicalIndex, maxIndex));
|
|
@@ -8381,7 +8433,7 @@ var Swiper = (props) => {
|
|
|
8381
8433
|
},
|
|
8382
8434
|
[canSlide, useLoop, cloneCount, maxIndex, onChange, moveToInner]
|
|
8383
8435
|
);
|
|
8384
|
-
const slideNext =
|
|
8436
|
+
const slideNext = React29.useCallback(() => {
|
|
8385
8437
|
if (!canSlide) return;
|
|
8386
8438
|
const nextInner = innerIndex + slideBy;
|
|
8387
8439
|
if (useLoop) {
|
|
@@ -8390,7 +8442,7 @@ var Swiper = (props) => {
|
|
|
8390
8442
|
moveToInner(Math.min(nextInner, maxIndex), true);
|
|
8391
8443
|
}
|
|
8392
8444
|
}, [canSlide, useLoop, innerIndex, slideBy, maxIndex, moveToInner]);
|
|
8393
|
-
const slidePrev =
|
|
8445
|
+
const slidePrev = React29.useCallback(() => {
|
|
8394
8446
|
if (!canSlide) return;
|
|
8395
8447
|
const prevInner = innerIndex - slideBy;
|
|
8396
8448
|
if (useLoop) {
|
|
@@ -8399,7 +8451,7 @@ var Swiper = (props) => {
|
|
|
8399
8451
|
moveToInner(Math.max(prevInner, 0), true);
|
|
8400
8452
|
}
|
|
8401
8453
|
}, [canSlide, useLoop, innerIndex, slideBy, moveToInner]);
|
|
8402
|
-
|
|
8454
|
+
React29.useEffect(() => {
|
|
8403
8455
|
if (indexProp === void 0) return;
|
|
8404
8456
|
const clamped = Math.max(0, Math.min(indexProp, maxIndex));
|
|
8405
8457
|
const target = useLoop ? cloneCount + clamped : clamped;
|
|
@@ -8407,12 +8459,12 @@ var Swiper = (props) => {
|
|
|
8407
8459
|
moveToInner(target, true);
|
|
8408
8460
|
}
|
|
8409
8461
|
}, [indexProp]);
|
|
8410
|
-
|
|
8462
|
+
React29.useImperativeHandle(swiperRef, () => ({
|
|
8411
8463
|
slidePrev,
|
|
8412
8464
|
slideNext,
|
|
8413
8465
|
slideTo
|
|
8414
8466
|
}));
|
|
8415
|
-
|
|
8467
|
+
React29.useEffect(() => {
|
|
8416
8468
|
if (!auto || !canSlide) return;
|
|
8417
8469
|
autoplayTimerRef.current = setInterval(slideNext, autoplayDelay);
|
|
8418
8470
|
return () => {
|
|
@@ -8435,7 +8487,7 @@ var Swiper = (props) => {
|
|
|
8435
8487
|
startXRef.current = getClientX(e);
|
|
8436
8488
|
startTimeRef.current = Date.now();
|
|
8437
8489
|
};
|
|
8438
|
-
|
|
8490
|
+
React29.useEffect(() => {
|
|
8439
8491
|
if (!isDragging) return;
|
|
8440
8492
|
const handleMove = (e) => {
|
|
8441
8493
|
setDragOffset(getClientX(e) - startXRef.current);
|
|
@@ -8473,8 +8525,8 @@ var Swiper = (props) => {
|
|
|
8473
8525
|
}, [isDragging, dragOffset, innerIndex, useLoop, maxIndex, slideStep, moveToInner]);
|
|
8474
8526
|
const slideWidthPercent = 100 / viewItemCount;
|
|
8475
8527
|
const gapAdjust = spaceBetween * (viewItemCount - 1) / viewItemCount;
|
|
8476
|
-
const slideElements =
|
|
8477
|
-
() => extendedItems.map((item, idx) => /* @__PURE__ */
|
|
8528
|
+
const slideElements = React29.useMemo(
|
|
8529
|
+
() => extendedItems.map((item, idx) => /* @__PURE__ */ jsx336(
|
|
8478
8530
|
"div",
|
|
8479
8531
|
{
|
|
8480
8532
|
className: "lib-xplat-swiper__slide",
|
|
@@ -8494,13 +8546,13 @@ var Swiper = (props) => {
|
|
|
8494
8546
|
totalSteps - 1
|
|
8495
8547
|
);
|
|
8496
8548
|
return /* @__PURE__ */ jsxs217("div", { className: "lib-xplat-swiper", ref: containerRef, children: [
|
|
8497
|
-
/* @__PURE__ */
|
|
8549
|
+
/* @__PURE__ */ jsx336(
|
|
8498
8550
|
"div",
|
|
8499
8551
|
{
|
|
8500
8552
|
className: "lib-xplat-swiper__viewport",
|
|
8501
8553
|
onMouseDown: handleDragStart,
|
|
8502
8554
|
onTouchStart: handleDragStart,
|
|
8503
|
-
children: /* @__PURE__ */
|
|
8555
|
+
children: /* @__PURE__ */ jsx336(
|
|
8504
8556
|
"div",
|
|
8505
8557
|
{
|
|
8506
8558
|
className: clsx_default(
|
|
@@ -8518,7 +8570,7 @@ var Swiper = (props) => {
|
|
|
8518
8570
|
)
|
|
8519
8571
|
}
|
|
8520
8572
|
),
|
|
8521
|
-
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(
|
|
8522
8574
|
"span",
|
|
8523
8575
|
{
|
|
8524
8576
|
className: "lib-xplat-swiper__progress-fill",
|
|
@@ -8528,7 +8580,7 @@ var Swiper = (props) => {
|
|
|
8528
8580
|
}
|
|
8529
8581
|
}
|
|
8530
8582
|
) }) }),
|
|
8531
|
-
canSlide && /* @__PURE__ */
|
|
8583
|
+
canSlide && /* @__PURE__ */ jsx336("div", { className: "lib-xplat-swiper__dots", children: Array.from({ length: totalSteps }, (_, i) => /* @__PURE__ */ jsx336(
|
|
8532
8584
|
"button",
|
|
8533
8585
|
{
|
|
8534
8586
|
className: clsx_default(
|
|
@@ -8546,8 +8598,8 @@ Swiper.displayName = "Swiper";
|
|
|
8546
8598
|
var Swiper_default = Swiper;
|
|
8547
8599
|
|
|
8548
8600
|
// src/components/Switch/Switch.tsx
|
|
8549
|
-
import
|
|
8550
|
-
import { jsx as
|
|
8601
|
+
import React30 from "react";
|
|
8602
|
+
import { jsx as jsx337 } from "react/jsx-runtime";
|
|
8551
8603
|
var KNOB_TRANSITION_MS = 250;
|
|
8552
8604
|
var Switch = (props) => {
|
|
8553
8605
|
const {
|
|
@@ -8557,9 +8609,9 @@ var Switch = (props) => {
|
|
|
8557
8609
|
disabled,
|
|
8558
8610
|
onChange
|
|
8559
8611
|
} = props;
|
|
8560
|
-
const [isAnimating, setIsAnimating] =
|
|
8561
|
-
const timeoutRef =
|
|
8562
|
-
|
|
8612
|
+
const [isAnimating, setIsAnimating] = React30.useState(false);
|
|
8613
|
+
const timeoutRef = React30.useRef(null);
|
|
8614
|
+
React30.useEffect(() => {
|
|
8563
8615
|
return () => {
|
|
8564
8616
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
8565
8617
|
};
|
|
@@ -8574,7 +8626,7 @@ var Switch = (props) => {
|
|
|
8574
8626
|
timeoutRef.current = null;
|
|
8575
8627
|
}, KNOB_TRANSITION_MS);
|
|
8576
8628
|
};
|
|
8577
|
-
return /* @__PURE__ */
|
|
8629
|
+
return /* @__PURE__ */ jsx337(
|
|
8578
8630
|
"div",
|
|
8579
8631
|
{
|
|
8580
8632
|
className: clsx_default(
|
|
@@ -8587,7 +8639,7 @@ var Switch = (props) => {
|
|
|
8587
8639
|
),
|
|
8588
8640
|
onClick: handleClick,
|
|
8589
8641
|
"aria-disabled": disabled || isAnimating,
|
|
8590
|
-
children: /* @__PURE__ */
|
|
8642
|
+
children: /* @__PURE__ */ jsx337("div", { className: clsx_default("knob", value ? "checked" : void 0) })
|
|
8591
8643
|
}
|
|
8592
8644
|
);
|
|
8593
8645
|
};
|
|
@@ -8595,17 +8647,17 @@ Switch.displayName = "Switch";
|
|
|
8595
8647
|
var Switch_default = Switch;
|
|
8596
8648
|
|
|
8597
8649
|
// src/components/Table/TableContext.tsx
|
|
8598
|
-
import
|
|
8599
|
-
var TableContext =
|
|
8650
|
+
import React31 from "react";
|
|
8651
|
+
var TableContext = React31.createContext(null);
|
|
8600
8652
|
var useTableContext = () => {
|
|
8601
|
-
const ctx =
|
|
8653
|
+
const ctx = React31.useContext(TableContext);
|
|
8602
8654
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
8603
8655
|
return ctx;
|
|
8604
8656
|
};
|
|
8605
8657
|
var TableContext_default = TableContext;
|
|
8606
8658
|
|
|
8607
8659
|
// src/components/Table/Table.tsx
|
|
8608
|
-
import { jsx as
|
|
8660
|
+
import { jsx as jsx338 } from "react/jsx-runtime";
|
|
8609
8661
|
var Table = (props) => {
|
|
8610
8662
|
const {
|
|
8611
8663
|
children,
|
|
@@ -8614,7 +8666,7 @@ var Table = (props) => {
|
|
|
8614
8666
|
headerSticky = false,
|
|
8615
8667
|
stickyShadow = true
|
|
8616
8668
|
} = props;
|
|
8617
|
-
return /* @__PURE__ */
|
|
8669
|
+
return /* @__PURE__ */ jsx338("div", { className: "lib-xplat-table-wrapper", children: /* @__PURE__ */ jsx338(
|
|
8618
8670
|
TableContext_default.Provider,
|
|
8619
8671
|
{
|
|
8620
8672
|
value: {
|
|
@@ -8623,7 +8675,7 @@ var Table = (props) => {
|
|
|
8623
8675
|
headerSticky,
|
|
8624
8676
|
stickyShadow
|
|
8625
8677
|
},
|
|
8626
|
-
children: /* @__PURE__ */
|
|
8678
|
+
children: /* @__PURE__ */ jsx338("table", { className: "lib-xplat-table", children })
|
|
8627
8679
|
}
|
|
8628
8680
|
) });
|
|
8629
8681
|
};
|
|
@@ -8631,41 +8683,41 @@ Table.displayName = "Table";
|
|
|
8631
8683
|
var Table_default = Table;
|
|
8632
8684
|
|
|
8633
8685
|
// src/components/Table/TableBody.tsx
|
|
8634
|
-
import { jsx as
|
|
8686
|
+
import { jsx as jsx339 } from "react/jsx-runtime";
|
|
8635
8687
|
var TableBody = (props) => {
|
|
8636
8688
|
const { children } = props;
|
|
8637
|
-
return /* @__PURE__ */
|
|
8689
|
+
return /* @__PURE__ */ jsx339("tbody", { children });
|
|
8638
8690
|
};
|
|
8639
8691
|
TableBody.displayName = "TableBody";
|
|
8640
8692
|
var TableBody_default = TableBody;
|
|
8641
8693
|
|
|
8642
8694
|
// src/components/Table/TableCell.tsx
|
|
8643
|
-
import
|
|
8695
|
+
import React34 from "react";
|
|
8644
8696
|
|
|
8645
8697
|
// src/components/Table/TableHeadContext.tsx
|
|
8646
|
-
import
|
|
8647
|
-
var TableHeadContext =
|
|
8698
|
+
import React32 from "react";
|
|
8699
|
+
var TableHeadContext = React32.createContext(
|
|
8648
8700
|
null
|
|
8649
8701
|
);
|
|
8650
8702
|
var useTableHeadContext = () => {
|
|
8651
|
-
const ctx =
|
|
8703
|
+
const ctx = React32.useContext(TableHeadContext);
|
|
8652
8704
|
return ctx;
|
|
8653
8705
|
};
|
|
8654
8706
|
var TableHeadContext_default = TableHeadContext;
|
|
8655
8707
|
|
|
8656
8708
|
// src/components/Table/TableRowContext.tsx
|
|
8657
|
-
import
|
|
8658
|
-
var TableRowContext =
|
|
8709
|
+
import React33 from "react";
|
|
8710
|
+
var TableRowContext = React33.createContext(null);
|
|
8659
8711
|
var useTableRowContext = () => {
|
|
8660
|
-
const ctx =
|
|
8712
|
+
const ctx = React33.useContext(TableRowContext);
|
|
8661
8713
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
8662
8714
|
return ctx;
|
|
8663
8715
|
};
|
|
8664
8716
|
var TableRowContext_default = TableRowContext;
|
|
8665
8717
|
|
|
8666
8718
|
// src/components/Table/TableCell.tsx
|
|
8667
|
-
import { jsx as
|
|
8668
|
-
var TableCell =
|
|
8719
|
+
import { jsx as jsx340 } from "react/jsx-runtime";
|
|
8720
|
+
var TableCell = React34.memo((props) => {
|
|
8669
8721
|
const {
|
|
8670
8722
|
children,
|
|
8671
8723
|
align = "center",
|
|
@@ -8677,9 +8729,9 @@ var TableCell = React33.memo((props) => {
|
|
|
8677
8729
|
const { registerStickyCell, stickyCells } = useTableRowContext();
|
|
8678
8730
|
const { stickyShadow } = useTableContext();
|
|
8679
8731
|
const headContext = useTableHeadContext();
|
|
8680
|
-
const [left, setLeft] =
|
|
8681
|
-
const cellRef =
|
|
8682
|
-
const calculateLeft =
|
|
8732
|
+
const [left, setLeft] = React34.useState(0);
|
|
8733
|
+
const cellRef = React34.useRef(null);
|
|
8734
|
+
const calculateLeft = React34.useCallback(() => {
|
|
8683
8735
|
if (!cellRef.current) return 0;
|
|
8684
8736
|
let totalLeft = 0;
|
|
8685
8737
|
for (const ref of stickyCells) {
|
|
@@ -8688,7 +8740,7 @@ var TableCell = React33.memo((props) => {
|
|
|
8688
8740
|
}
|
|
8689
8741
|
return totalLeft;
|
|
8690
8742
|
}, [stickyCells]);
|
|
8691
|
-
|
|
8743
|
+
React34.useEffect(() => {
|
|
8692
8744
|
if (!isSticky || !cellRef.current) return;
|
|
8693
8745
|
registerStickyCell(cellRef);
|
|
8694
8746
|
setLeft(calculateLeft());
|
|
@@ -8706,7 +8758,7 @@ var TableCell = React33.memo((props) => {
|
|
|
8706
8758
|
const CellTag = cellRef.current?.tagName === "TH" ? "th" : "td";
|
|
8707
8759
|
const isLastSticky = isSticky && stickyCells[stickyCells.length - 1] === cellRef;
|
|
8708
8760
|
const enableHover = headContext && headContext.cellHover;
|
|
8709
|
-
return /* @__PURE__ */
|
|
8761
|
+
return /* @__PURE__ */ jsx340(
|
|
8710
8762
|
CellTag,
|
|
8711
8763
|
{
|
|
8712
8764
|
ref: cellRef,
|
|
@@ -8731,21 +8783,21 @@ TableCell.displayName = "TableCell";
|
|
|
8731
8783
|
var TableCell_default = TableCell;
|
|
8732
8784
|
|
|
8733
8785
|
// src/components/Table/TableHead.tsx
|
|
8734
|
-
import { jsx as
|
|
8786
|
+
import { jsx as jsx341 } from "react/jsx-runtime";
|
|
8735
8787
|
var TableHead = ({
|
|
8736
8788
|
children,
|
|
8737
8789
|
cellHover = false
|
|
8738
8790
|
}) => {
|
|
8739
8791
|
const { headerSticky } = useTableContext();
|
|
8740
|
-
return /* @__PURE__ */
|
|
8792
|
+
return /* @__PURE__ */ jsx341(TableHeadContext_default.Provider, { value: { cellHover }, children: /* @__PURE__ */ jsx341("thead", { className: clsx_default(headerSticky ? "table-sticky" : null), children }) });
|
|
8741
8793
|
};
|
|
8742
8794
|
TableHead.displayName = "TableHead";
|
|
8743
8795
|
var TableHead_default = TableHead;
|
|
8744
8796
|
|
|
8745
8797
|
// src/components/Table/TableRow.tsx
|
|
8746
|
-
import
|
|
8747
|
-
import { jsx as
|
|
8748
|
-
var TableRow =
|
|
8798
|
+
import React35 from "react";
|
|
8799
|
+
import { jsx as jsx342 } from "react/jsx-runtime";
|
|
8800
|
+
var TableRow = React35.memo((props) => {
|
|
8749
8801
|
const {
|
|
8750
8802
|
children,
|
|
8751
8803
|
type = "secondary",
|
|
@@ -8753,14 +8805,14 @@ var TableRow = React34.memo((props) => {
|
|
|
8753
8805
|
onClick
|
|
8754
8806
|
} = props;
|
|
8755
8807
|
const { rowBorderUse } = useTableContext();
|
|
8756
|
-
const [stickyCells, setStickyCells] =
|
|
8808
|
+
const [stickyCells, setStickyCells] = React35.useState([]);
|
|
8757
8809
|
const registerStickyCell = (ref) => {
|
|
8758
8810
|
setStickyCells((prev) => {
|
|
8759
8811
|
if (prev.includes(ref)) return prev;
|
|
8760
8812
|
return [...prev, ref];
|
|
8761
8813
|
});
|
|
8762
8814
|
};
|
|
8763
|
-
return /* @__PURE__ */
|
|
8815
|
+
return /* @__PURE__ */ jsx342(TableRowContext_default.Provider, { value: { stickyCells, registerStickyCell }, children: /* @__PURE__ */ jsx342(
|
|
8764
8816
|
"tr",
|
|
8765
8817
|
{
|
|
8766
8818
|
className: clsx_default(
|
|
@@ -8778,7 +8830,7 @@ TableRow.displayName = "TableRow";
|
|
|
8778
8830
|
var TableRow_default = TableRow;
|
|
8779
8831
|
|
|
8780
8832
|
// src/components/Tag/Tag.tsx
|
|
8781
|
-
import { jsx as
|
|
8833
|
+
import { jsx as jsx343, jsxs as jsxs218 } from "react/jsx-runtime";
|
|
8782
8834
|
var Tag = (props) => {
|
|
8783
8835
|
const {
|
|
8784
8836
|
children,
|
|
@@ -8799,8 +8851,8 @@ var Tag = (props) => {
|
|
|
8799
8851
|
disabled && "disabled"
|
|
8800
8852
|
),
|
|
8801
8853
|
children: [
|
|
8802
|
-
/* @__PURE__ */
|
|
8803
|
-
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, {}) })
|
|
8804
8856
|
]
|
|
8805
8857
|
}
|
|
8806
8858
|
);
|
|
@@ -8809,12 +8861,12 @@ Tag.displayName = "Tag";
|
|
|
8809
8861
|
var Tag_default = Tag;
|
|
8810
8862
|
|
|
8811
8863
|
// src/components/TextArea/TextArea.tsx
|
|
8812
|
-
import
|
|
8813
|
-
import { jsx as
|
|
8814
|
-
var TextArea =
|
|
8864
|
+
import React36 from "react";
|
|
8865
|
+
import { jsx as jsx344 } from "react/jsx-runtime";
|
|
8866
|
+
var TextArea = React36.forwardRef(
|
|
8815
8867
|
(props, ref) => {
|
|
8816
8868
|
const { value, onChange, disabled, ...textareaProps } = props;
|
|
8817
|
-
const localRef =
|
|
8869
|
+
const localRef = React36.useRef(null);
|
|
8818
8870
|
const setRefs = (el) => {
|
|
8819
8871
|
localRef.current = el;
|
|
8820
8872
|
if (!ref) return;
|
|
@@ -8834,21 +8886,21 @@ var TextArea = React35.forwardRef(
|
|
|
8834
8886
|
onChange(event);
|
|
8835
8887
|
}
|
|
8836
8888
|
};
|
|
8837
|
-
|
|
8889
|
+
React36.useEffect(() => {
|
|
8838
8890
|
const el = localRef.current;
|
|
8839
8891
|
if (!el) return;
|
|
8840
8892
|
el.style.height = "0px";
|
|
8841
8893
|
const nextHeight = Math.min(el.scrollHeight, 400);
|
|
8842
8894
|
el.style.height = `${nextHeight}px`;
|
|
8843
8895
|
}, [value]);
|
|
8844
|
-
return /* @__PURE__ */
|
|
8896
|
+
return /* @__PURE__ */ jsx344("div", { className: "lib-xplat-textarea-wrapper", children: /* @__PURE__ */ jsx344(
|
|
8845
8897
|
"div",
|
|
8846
8898
|
{
|
|
8847
8899
|
className: clsx_default(
|
|
8848
8900
|
"lib-xplat-textarea",
|
|
8849
8901
|
disabled ? "disabled" : void 0
|
|
8850
8902
|
),
|
|
8851
|
-
children: /* @__PURE__ */
|
|
8903
|
+
children: /* @__PURE__ */ jsx344(
|
|
8852
8904
|
"textarea",
|
|
8853
8905
|
{
|
|
8854
8906
|
...textareaProps,
|
|
@@ -8866,25 +8918,25 @@ TextArea.displayName = "TextArea";
|
|
|
8866
8918
|
var TextArea_default = TextArea;
|
|
8867
8919
|
|
|
8868
8920
|
// src/components/Toast/Toast.tsx
|
|
8869
|
-
import
|
|
8921
|
+
import React37 from "react";
|
|
8870
8922
|
import { createPortal as createPortal3 } from "react-dom";
|
|
8871
|
-
import { jsx as
|
|
8872
|
-
var ToastContext =
|
|
8923
|
+
import { jsx as jsx345, jsxs as jsxs219 } from "react/jsx-runtime";
|
|
8924
|
+
var ToastContext = React37.createContext(null);
|
|
8873
8925
|
var useToast = () => {
|
|
8874
|
-
const ctx =
|
|
8926
|
+
const ctx = React37.useContext(ToastContext);
|
|
8875
8927
|
if (!ctx) throw new Error("useToast must be used within ToastProvider");
|
|
8876
8928
|
return ctx;
|
|
8877
8929
|
};
|
|
8878
8930
|
var EXIT_DURATION = 300;
|
|
8879
8931
|
var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
8880
|
-
const ref =
|
|
8881
|
-
const [height, setHeight] =
|
|
8882
|
-
|
|
8932
|
+
const ref = React37.useRef(null);
|
|
8933
|
+
const [height, setHeight] = React37.useState(void 0);
|
|
8934
|
+
React37.useEffect(() => {
|
|
8883
8935
|
if (ref.current && !isExiting) {
|
|
8884
8936
|
setHeight(ref.current.offsetHeight);
|
|
8885
8937
|
}
|
|
8886
8938
|
}, [isExiting]);
|
|
8887
|
-
return /* @__PURE__ */
|
|
8939
|
+
return /* @__PURE__ */ jsx345(
|
|
8888
8940
|
"div",
|
|
8889
8941
|
{
|
|
8890
8942
|
className: clsx_default("lib-xplat-toast-wrapper", { exit: isExiting }),
|
|
@@ -8899,8 +8951,8 @@ var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
|
8899
8951
|
className: clsx_default("lib-xplat-toast", item.type, { exit: isExiting }),
|
|
8900
8952
|
role: "alert",
|
|
8901
8953
|
children: [
|
|
8902
|
-
/* @__PURE__ */
|
|
8903
|
-
/* @__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" })
|
|
8904
8956
|
]
|
|
8905
8957
|
}
|
|
8906
8958
|
)
|
|
@@ -8911,13 +8963,13 @@ var ToastProvider = ({
|
|
|
8911
8963
|
children,
|
|
8912
8964
|
position = "top-right"
|
|
8913
8965
|
}) => {
|
|
8914
|
-
const [toasts, setToasts] =
|
|
8915
|
-
const [removing, setRemoving] =
|
|
8916
|
-
const [mounted, setMounted] =
|
|
8917
|
-
|
|
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(() => {
|
|
8918
8970
|
setMounted(true);
|
|
8919
8971
|
}, []);
|
|
8920
|
-
const remove =
|
|
8972
|
+
const remove = React37.useCallback((id) => {
|
|
8921
8973
|
setRemoving((prev) => new Set(prev).add(id));
|
|
8922
8974
|
setTimeout(() => {
|
|
8923
8975
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
@@ -8928,7 +8980,7 @@ var ToastProvider = ({
|
|
|
8928
8980
|
});
|
|
8929
8981
|
}, EXIT_DURATION);
|
|
8930
8982
|
}, []);
|
|
8931
|
-
const toast =
|
|
8983
|
+
const toast = React37.useCallback(
|
|
8932
8984
|
(type, message, duration = 3e3) => {
|
|
8933
8985
|
const id = `${Date.now()}-${Math.random()}`;
|
|
8934
8986
|
setToasts((prev) => [...prev, { id, type, message }]);
|
|
@@ -8941,7 +8993,7 @@ var ToastProvider = ({
|
|
|
8941
8993
|
return /* @__PURE__ */ jsxs219(ToastContext.Provider, { value: { toast }, children: [
|
|
8942
8994
|
children,
|
|
8943
8995
|
mounted && createPortal3(
|
|
8944
|
-
/* @__PURE__ */
|
|
8996
|
+
/* @__PURE__ */ jsx345("div", { className: clsx_default("lib-xplat-toast-container", position), children: toasts.map((t) => /* @__PURE__ */ jsx345(
|
|
8945
8997
|
ToastItemComponent,
|
|
8946
8998
|
{
|
|
8947
8999
|
item: t,
|
|
@@ -8957,29 +9009,29 @@ var ToastProvider = ({
|
|
|
8957
9009
|
ToastProvider.displayName = "ToastProvider";
|
|
8958
9010
|
|
|
8959
9011
|
// src/components/Tooltip/Tooltip.tsx
|
|
8960
|
-
import
|
|
8961
|
-
import { jsx as
|
|
9012
|
+
import React38 from "react";
|
|
9013
|
+
import { jsx as jsx346, jsxs as jsxs220 } from "react/jsx-runtime";
|
|
8962
9014
|
var Tooltip = (props) => {
|
|
8963
9015
|
const {
|
|
8964
9016
|
type = "primary",
|
|
8965
9017
|
description,
|
|
8966
9018
|
children
|
|
8967
9019
|
} = props;
|
|
8968
|
-
const iconRef =
|
|
9020
|
+
const iconRef = React38.useRef(null);
|
|
8969
9021
|
return /* @__PURE__ */ jsxs220("div", { className: "lib-xplat-tooltip", children: [
|
|
8970
|
-
/* @__PURE__ */
|
|
8971
|
-
/* @__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 })
|
|
8972
9024
|
] });
|
|
8973
9025
|
};
|
|
8974
9026
|
Tooltip.displayName = "Tooltip";
|
|
8975
9027
|
var Tooltip_default = Tooltip;
|
|
8976
9028
|
|
|
8977
9029
|
// src/components/Video/Video.tsx
|
|
8978
|
-
import
|
|
8979
|
-
import { jsx as
|
|
9030
|
+
import React39 from "react";
|
|
9031
|
+
import { jsx as jsx347, jsxs as jsxs221 } from "react/jsx-runtime";
|
|
8980
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: [
|
|
8981
|
-
/* @__PURE__ */
|
|
8982
|
-
/* @__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" })
|
|
8983
9035
|
] });
|
|
8984
9036
|
var formatTime = (sec) => {
|
|
8985
9037
|
if (!Number.isFinite(sec) || sec < 0) return "0:00";
|
|
@@ -8987,7 +9039,7 @@ var formatTime = (sec) => {
|
|
|
8987
9039
|
const s = Math.floor(sec % 60);
|
|
8988
9040
|
return `${m}:${s.toString().padStart(2, "0")}`;
|
|
8989
9041
|
};
|
|
8990
|
-
var Video =
|
|
9042
|
+
var Video = React39.forwardRef((props, ref) => {
|
|
8991
9043
|
const {
|
|
8992
9044
|
src,
|
|
8993
9045
|
poster,
|
|
@@ -9011,21 +9063,21 @@ var Video = React38.forwardRef((props, ref) => {
|
|
|
9011
9063
|
children,
|
|
9012
9064
|
...rest
|
|
9013
9065
|
} = props;
|
|
9014
|
-
const containerRef =
|
|
9015
|
-
const videoRef =
|
|
9016
|
-
const [isPlaying, setIsPlaying] =
|
|
9017
|
-
const [isLoaded, setIsLoaded] =
|
|
9018
|
-
const [currentTime, setCurrentTime] =
|
|
9019
|
-
const [duration, setDuration] =
|
|
9020
|
-
const [buffered, setBuffered] =
|
|
9021
|
-
const [volume, setVolume] =
|
|
9022
|
-
const [isMuted, setIsMuted] =
|
|
9023
|
-
const [isFullscreen, setIsFullscreen] =
|
|
9024
|
-
const [playbackRate, setPlaybackRate] =
|
|
9025
|
-
const [rateMenuOpen, setRateMenuOpen] =
|
|
9026
|
-
const [captionsOn, setCaptionsOn] =
|
|
9027
|
-
const [isPip, setIsPip] =
|
|
9028
|
-
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(
|
|
9029
9081
|
(el) => {
|
|
9030
9082
|
videoRef.current = el;
|
|
9031
9083
|
if (typeof ref === "function") ref(el);
|
|
@@ -9033,14 +9085,14 @@ var Video = React38.forwardRef((props, ref) => {
|
|
|
9033
9085
|
},
|
|
9034
9086
|
[ref]
|
|
9035
9087
|
);
|
|
9036
|
-
|
|
9088
|
+
React39.useEffect(() => {
|
|
9037
9089
|
const onFsChange = () => {
|
|
9038
9090
|
setIsFullscreen(document.fullscreenElement === containerRef.current);
|
|
9039
9091
|
};
|
|
9040
9092
|
document.addEventListener("fullscreenchange", onFsChange);
|
|
9041
9093
|
return () => document.removeEventListener("fullscreenchange", onFsChange);
|
|
9042
9094
|
}, []);
|
|
9043
|
-
|
|
9095
|
+
React39.useEffect(() => {
|
|
9044
9096
|
const v = videoRef.current;
|
|
9045
9097
|
if (!v) return;
|
|
9046
9098
|
const onEnter = () => setIsPip(true);
|
|
@@ -9160,7 +9212,7 @@ var Video = React38.forwardRef((props, ref) => {
|
|
|
9160
9212
|
ref: containerRef,
|
|
9161
9213
|
className: clsx_default("lib-xplat-video", showControls && "has-controls"),
|
|
9162
9214
|
children: [
|
|
9163
|
-
/* @__PURE__ */
|
|
9215
|
+
/* @__PURE__ */ jsx347(
|
|
9164
9216
|
"video",
|
|
9165
9217
|
{
|
|
9166
9218
|
ref: setRefs,
|
|
@@ -9181,7 +9233,7 @@ var Video = React38.forwardRef((props, ref) => {
|
|
|
9181
9233
|
children
|
|
9182
9234
|
}
|
|
9183
9235
|
),
|
|
9184
|
-
showCenterPlay && /* @__PURE__ */
|
|
9236
|
+
showCenterPlay && /* @__PURE__ */ jsx347(
|
|
9185
9237
|
"button",
|
|
9186
9238
|
{
|
|
9187
9239
|
type: "button",
|
|
@@ -9193,11 +9245,11 @@ var Video = React38.forwardRef((props, ref) => {
|
|
|
9193
9245
|
onClick: togglePlay,
|
|
9194
9246
|
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
9195
9247
|
tabIndex: -1,
|
|
9196
|
-
children: /* @__PURE__ */
|
|
9248
|
+
children: /* @__PURE__ */ jsx347("span", { className: "center-play-icon", children: /* @__PURE__ */ jsx347(PlayCircleIcon_default, {}) })
|
|
9197
9249
|
}
|
|
9198
9250
|
),
|
|
9199
9251
|
showControls && /* @__PURE__ */ jsxs221("div", { className: "controls", onClick: (e) => e.stopPropagation(), children: [
|
|
9200
|
-
/* @__PURE__ */
|
|
9252
|
+
/* @__PURE__ */ jsx347(
|
|
9201
9253
|
"input",
|
|
9202
9254
|
{
|
|
9203
9255
|
type: "range",
|
|
@@ -9215,28 +9267,28 @@ var Video = React38.forwardRef((props, ref) => {
|
|
|
9215
9267
|
}
|
|
9216
9268
|
),
|
|
9217
9269
|
/* @__PURE__ */ jsxs221("div", { className: "controls-row", children: [
|
|
9218
|
-
/* @__PURE__ */
|
|
9270
|
+
/* @__PURE__ */ jsx347(
|
|
9219
9271
|
"button",
|
|
9220
9272
|
{
|
|
9221
9273
|
type: "button",
|
|
9222
9274
|
className: "control-btn",
|
|
9223
9275
|
onClick: togglePlay,
|
|
9224
9276
|
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
9225
|
-
children: isPlaying ? /* @__PURE__ */
|
|
9277
|
+
children: isPlaying ? /* @__PURE__ */ jsx347(PauseIcon_default, {}) : /* @__PURE__ */ jsx347(PlayIcon_default, {})
|
|
9226
9278
|
}
|
|
9227
9279
|
),
|
|
9228
9280
|
/* @__PURE__ */ jsxs221("div", { className: "volume-group", children: [
|
|
9229
|
-
/* @__PURE__ */
|
|
9281
|
+
/* @__PURE__ */ jsx347(
|
|
9230
9282
|
"button",
|
|
9231
9283
|
{
|
|
9232
9284
|
type: "button",
|
|
9233
9285
|
className: "control-btn",
|
|
9234
9286
|
onClick: toggleMute,
|
|
9235
9287
|
"aria-label": isMuted ? "\uC74C\uC18C\uAC70 \uD574\uC81C" : "\uC74C\uC18C\uAC70",
|
|
9236
|
-
children: /* @__PURE__ */
|
|
9288
|
+
children: /* @__PURE__ */ jsx347(VolumeGlyph, {})
|
|
9237
9289
|
}
|
|
9238
9290
|
),
|
|
9239
|
-
/* @__PURE__ */
|
|
9291
|
+
/* @__PURE__ */ jsx347(
|
|
9240
9292
|
"input",
|
|
9241
9293
|
{
|
|
9242
9294
|
type: "range",
|
|
@@ -9256,7 +9308,7 @@ var Video = React38.forwardRef((props, ref) => {
|
|
|
9256
9308
|
" / ",
|
|
9257
9309
|
formatTime(duration)
|
|
9258
9310
|
] }),
|
|
9259
|
-
/* @__PURE__ */
|
|
9311
|
+
/* @__PURE__ */ jsx347("div", { className: "controls-spacer" }),
|
|
9260
9312
|
playbackRates && playbackRates.length > 0 && /* @__PURE__ */ jsxs221("div", { className: clsx_default("rate-group", rateMenuOpen && "is-open"), children: [
|
|
9261
9313
|
/* @__PURE__ */ jsxs221(
|
|
9262
9314
|
"button",
|
|
@@ -9272,7 +9324,7 @@ var Video = React38.forwardRef((props, ref) => {
|
|
|
9272
9324
|
]
|
|
9273
9325
|
}
|
|
9274
9326
|
),
|
|
9275
|
-
rateMenuOpen && /* @__PURE__ */
|
|
9327
|
+
rateMenuOpen && /* @__PURE__ */ jsx347("ul", { className: "rate-menu", role: "menu", children: playbackRates.map((r2) => /* @__PURE__ */ jsx347("li", { children: /* @__PURE__ */ jsxs221(
|
|
9276
9328
|
"button",
|
|
9277
9329
|
{
|
|
9278
9330
|
type: "button",
|
|
@@ -9286,7 +9338,7 @@ var Video = React38.forwardRef((props, ref) => {
|
|
|
9286
9338
|
}
|
|
9287
9339
|
) }, r2)) })
|
|
9288
9340
|
] }),
|
|
9289
|
-
showCaptions && /* @__PURE__ */
|
|
9341
|
+
showCaptions && /* @__PURE__ */ jsx347(
|
|
9290
9342
|
"button",
|
|
9291
9343
|
{
|
|
9292
9344
|
type: "button",
|
|
@@ -9294,37 +9346,37 @@ var Video = React38.forwardRef((props, ref) => {
|
|
|
9294
9346
|
onClick: toggleCaptions,
|
|
9295
9347
|
"aria-label": captionsOn ? "\uC790\uB9C9 \uB044\uAE30" : "\uC790\uB9C9 \uCF1C\uAE30",
|
|
9296
9348
|
"aria-pressed": captionsOn,
|
|
9297
|
-
children: /* @__PURE__ */
|
|
9349
|
+
children: /* @__PURE__ */ jsx347(TypeIcon_default, {})
|
|
9298
9350
|
}
|
|
9299
9351
|
),
|
|
9300
|
-
showPip && pipSupported && /* @__PURE__ */
|
|
9352
|
+
showPip && pipSupported && /* @__PURE__ */ jsx347(
|
|
9301
9353
|
"button",
|
|
9302
9354
|
{
|
|
9303
9355
|
type: "button",
|
|
9304
9356
|
className: clsx_default("control-btn", isPip && "is-active"),
|
|
9305
9357
|
onClick: togglePip,
|
|
9306
9358
|
"aria-label": isPip ? "PIP \uC885\uB8CC" : "PIP",
|
|
9307
|
-
children: /* @__PURE__ */
|
|
9359
|
+
children: /* @__PURE__ */ jsx347(PipIcon, {})
|
|
9308
9360
|
}
|
|
9309
9361
|
),
|
|
9310
|
-
showDownload && /* @__PURE__ */
|
|
9362
|
+
showDownload && /* @__PURE__ */ jsx347(
|
|
9311
9363
|
"a",
|
|
9312
9364
|
{
|
|
9313
9365
|
className: "control-btn",
|
|
9314
9366
|
href: src,
|
|
9315
9367
|
download: downloadFileName ?? true,
|
|
9316
9368
|
"aria-label": "\uB2E4\uC6B4\uB85C\uB4DC",
|
|
9317
|
-
children: /* @__PURE__ */
|
|
9369
|
+
children: /* @__PURE__ */ jsx347(DownloadIcon_default, {})
|
|
9318
9370
|
}
|
|
9319
9371
|
),
|
|
9320
|
-
/* @__PURE__ */
|
|
9372
|
+
/* @__PURE__ */ jsx347(
|
|
9321
9373
|
"button",
|
|
9322
9374
|
{
|
|
9323
9375
|
type: "button",
|
|
9324
9376
|
className: "control-btn",
|
|
9325
9377
|
onClick: toggleFullscreen,
|
|
9326
9378
|
"aria-label": isFullscreen ? "\uC804\uCCB4\uD654\uBA74 \uC885\uB8CC" : "\uC804\uCCB4\uD654\uBA74",
|
|
9327
|
-
children: isFullscreen ? /* @__PURE__ */
|
|
9379
|
+
children: isFullscreen ? /* @__PURE__ */ jsx347(MinimizeIcon_default, {}) : /* @__PURE__ */ jsx347(MaximizeIcon_default, {})
|
|
9328
9380
|
}
|
|
9329
9381
|
)
|
|
9330
9382
|
] })
|
|
@@ -9337,10 +9389,10 @@ Video.displayName = "Video";
|
|
|
9337
9389
|
var Video_default = Video;
|
|
9338
9390
|
|
|
9339
9391
|
// src/layout/Grid/FullGrid/FullGrid.tsx
|
|
9340
|
-
import { jsx as
|
|
9392
|
+
import { jsx as jsx348 } from "react/jsx-runtime";
|
|
9341
9393
|
var FullGrid = (props) => {
|
|
9342
9394
|
const { children, gap } = props;
|
|
9343
|
-
return /* @__PURE__ */
|
|
9395
|
+
return /* @__PURE__ */ jsx348(
|
|
9344
9396
|
"div",
|
|
9345
9397
|
{
|
|
9346
9398
|
className: "lib-xplat-full-grid",
|
|
@@ -9353,10 +9405,10 @@ FullGrid.displayName = "FullGrid";
|
|
|
9353
9405
|
var FullGrid_default = FullGrid;
|
|
9354
9406
|
|
|
9355
9407
|
// src/layout/Grid/FullScreen/FullScreen.tsx
|
|
9356
|
-
import { jsx as
|
|
9408
|
+
import { jsx as jsx349 } from "react/jsx-runtime";
|
|
9357
9409
|
var FullScreen = (props) => {
|
|
9358
9410
|
const { children, gap } = props;
|
|
9359
|
-
return /* @__PURE__ */
|
|
9411
|
+
return /* @__PURE__ */ jsx349(
|
|
9360
9412
|
"div",
|
|
9361
9413
|
{
|
|
9362
9414
|
className: "lib-xplat-full-screen",
|
|
@@ -9369,7 +9421,7 @@ FullScreen.displayName = "FullScreen";
|
|
|
9369
9421
|
var FullScreen_default = FullScreen;
|
|
9370
9422
|
|
|
9371
9423
|
// src/layout/Grid/Item/Item.tsx
|
|
9372
|
-
import { jsx as
|
|
9424
|
+
import { jsx as jsx350 } from "react/jsx-runtime";
|
|
9373
9425
|
var calculateSpans = (column) => {
|
|
9374
9426
|
const spans = {};
|
|
9375
9427
|
let inherited = column.default;
|
|
@@ -9386,35 +9438,35 @@ var GridItem = ({ column, children, className }) => {
|
|
|
9386
9438
|
Object.entries(spans).forEach(([key, value]) => {
|
|
9387
9439
|
style[`--column-${key}`] = value;
|
|
9388
9440
|
});
|
|
9389
|
-
return /* @__PURE__ */
|
|
9441
|
+
return /* @__PURE__ */ jsx350("div", { className: clsx_default("lib-xplat-grid-item", className), style, children });
|
|
9390
9442
|
};
|
|
9391
9443
|
GridItem.displayName = "GridItem";
|
|
9392
9444
|
var Item_default = GridItem;
|
|
9393
9445
|
|
|
9394
9446
|
// src/layout/Header/Header.tsx
|
|
9395
|
-
import { jsx as
|
|
9447
|
+
import { jsx as jsx351, jsxs as jsxs222 } from "react/jsx-runtime";
|
|
9396
9448
|
var Header = ({
|
|
9397
9449
|
logo,
|
|
9398
9450
|
centerContent,
|
|
9399
9451
|
rightContent
|
|
9400
9452
|
}) => {
|
|
9401
9453
|
return /* @__PURE__ */ jsxs222("div", { className: "lib-xplat-layout-header", children: [
|
|
9402
|
-
/* @__PURE__ */
|
|
9403
|
-
/* @__PURE__ */
|
|
9404
|
-
/* @__PURE__ */
|
|
9454
|
+
/* @__PURE__ */ jsx351("div", { children: logo }),
|
|
9455
|
+
/* @__PURE__ */ jsx351("div", { children: centerContent }),
|
|
9456
|
+
/* @__PURE__ */ jsx351("div", { children: rightContent })
|
|
9405
9457
|
] });
|
|
9406
9458
|
};
|
|
9407
9459
|
Header.displayName = "Header";
|
|
9408
9460
|
var Header_default = Header;
|
|
9409
9461
|
|
|
9410
9462
|
// src/layout/Layout/Layout.tsx
|
|
9411
|
-
import { Fragment as
|
|
9463
|
+
import { Fragment as Fragment5, jsx as jsx352, jsxs as jsxs223 } from "react/jsx-runtime";
|
|
9412
9464
|
var Layout = (props) => {
|
|
9413
9465
|
const { header, sideBar, children } = props;
|
|
9414
|
-
return /* @__PURE__ */
|
|
9415
|
-
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 }),
|
|
9416
9468
|
/* @__PURE__ */ jsxs223("div", { className: "lib-xplat-layout-content", children: [
|
|
9417
|
-
header && /* @__PURE__ */
|
|
9469
|
+
header && /* @__PURE__ */ jsx352("div", { className: "lib-xplat-layout-conent-header", children: header }),
|
|
9418
9470
|
children
|
|
9419
9471
|
] })
|
|
9420
9472
|
] }) });
|
|
@@ -9423,31 +9475,31 @@ Layout.displayName = "Layout";
|
|
|
9423
9475
|
var Layout_default = Layout;
|
|
9424
9476
|
|
|
9425
9477
|
// src/layout/SideBar/SideBar.tsx
|
|
9426
|
-
import
|
|
9478
|
+
import React41 from "react";
|
|
9427
9479
|
|
|
9428
9480
|
// src/layout/SideBar/SideBarContext.tsx
|
|
9429
|
-
import
|
|
9430
|
-
var SideBarContext =
|
|
9481
|
+
import React40 from "react";
|
|
9482
|
+
var SideBarContext = React40.createContext(null);
|
|
9431
9483
|
var useSideBarContext = () => {
|
|
9432
|
-
const ctx =
|
|
9484
|
+
const ctx = React40.useContext(SideBarContext);
|
|
9433
9485
|
if (!ctx) throw new Error("Error");
|
|
9434
9486
|
return ctx;
|
|
9435
9487
|
};
|
|
9436
9488
|
var SideBarContext_default = SideBarContext;
|
|
9437
9489
|
|
|
9438
9490
|
// src/layout/SideBar/SideBar.tsx
|
|
9439
|
-
import { jsx as
|
|
9491
|
+
import { jsx as jsx353 } from "react/jsx-runtime";
|
|
9440
9492
|
var SideBar = (props) => {
|
|
9441
9493
|
const { children, className } = props;
|
|
9442
|
-
const [isOpen, setIsOpen] =
|
|
9494
|
+
const [isOpen, setIsOpen] = React41.useState(true);
|
|
9443
9495
|
const handleSwitchSideBar = () => {
|
|
9444
9496
|
setIsOpen((prev) => !prev);
|
|
9445
9497
|
};
|
|
9446
|
-
return /* @__PURE__ */
|
|
9498
|
+
return /* @__PURE__ */ jsx353(
|
|
9447
9499
|
SideBarContext_default.Provider,
|
|
9448
9500
|
{
|
|
9449
9501
|
value: { isSidebarOpen: isOpen, handleSwitchSideBar },
|
|
9450
|
-
children: /* @__PURE__ */
|
|
9502
|
+
children: /* @__PURE__ */ jsx353(
|
|
9451
9503
|
"div",
|
|
9452
9504
|
{
|
|
9453
9505
|
className: clsx_default(
|