@x-plat/design-system 0.5.8 → 0.5.9
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/{Card → Box}/index.cjs +34 -13
- package/dist/components/Box/index.css +55 -0
- package/dist/components/Box/index.d.cts +13 -0
- package/dist/components/Box/index.d.ts +13 -0
- package/dist/components/Box/index.js +34 -0
- package/dist/components/Button/index.css +5 -0
- package/dist/components/Chart/index.cjs +152 -32
- package/dist/components/Chart/index.css +25 -9
- package/dist/components/Chart/index.d.cts +1 -1
- package/dist/components/Chart/index.d.ts +1 -1
- package/dist/components/Chart/index.js +152 -32
- package/dist/components/DatePicker/index.cjs +667 -682
- package/dist/components/DatePicker/index.css +211 -128
- package/dist/components/DatePicker/index.d.cts +2 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/DatePicker/index.js +656 -671
- package/dist/components/index.cjs +687 -619
- package/dist/components/index.css +197 -156
- package/dist/components/index.d.cts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +681 -613
- package/dist/index.cjs +687 -619
- package/dist/index.css +197 -156
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +681 -613
- package/package.json +1 -1
- package/dist/components/Card/index.css +0 -28
- package/dist/components/Card/index.d.cts +0 -9
- package/dist/components/Card/index.d.ts +0 -9
- package/dist/components/Card/index.js +0 -13
package/dist/index.js
CHANGED
|
@@ -6035,16 +6035,21 @@ var Calendar = (props) => {
|
|
|
6035
6035
|
Calendar.displayName = "Calendar";
|
|
6036
6036
|
var Calendar_default = Calendar;
|
|
6037
6037
|
|
|
6038
|
-
// src/components/
|
|
6038
|
+
// src/components/Box/Box.tsx
|
|
6039
6039
|
import { jsx as jsx302, jsxs as jsxs194 } from "react/jsx-runtime";
|
|
6040
|
-
var
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6040
|
+
var Box = ({
|
|
6041
|
+
children,
|
|
6042
|
+
title,
|
|
6043
|
+
variant = "outlined",
|
|
6044
|
+
padding = "md"
|
|
6045
|
+
}) => {
|
|
6046
|
+
return /* @__PURE__ */ jsxs194("div", { className: clsx_default("lib-xplat-box", variant, `pad-${padding}`), children: [
|
|
6047
|
+
title && /* @__PURE__ */ jsx302("div", { className: "box-title", children: title }),
|
|
6048
|
+
/* @__PURE__ */ jsx302("div", { className: "box-content", children })
|
|
6044
6049
|
] });
|
|
6045
6050
|
};
|
|
6046
|
-
|
|
6047
|
-
var
|
|
6051
|
+
Box.displayName = "Box";
|
|
6052
|
+
var Box_default = Box;
|
|
6048
6053
|
|
|
6049
6054
|
// src/components/CardTab/CardTab.tsx
|
|
6050
6055
|
import React4 from "react";
|
|
@@ -6143,6 +6148,39 @@ var getPalette = (palettes, index, key) => {
|
|
|
6143
6148
|
return palettes[(index + offset) % palettes.length];
|
|
6144
6149
|
};
|
|
6145
6150
|
var PADDING = { top: 20, right: 20, bottom: 30, left: 40 };
|
|
6151
|
+
var toSmoothPath = (points) => {
|
|
6152
|
+
if (points.length < 2) return "";
|
|
6153
|
+
const p = points;
|
|
6154
|
+
let d = `M ${p[0].x} ${p[0].y}`;
|
|
6155
|
+
for (let i = 0; i < p.length - 1; i++) {
|
|
6156
|
+
const p0 = p[Math.max(0, i - 1)];
|
|
6157
|
+
const p1 = p[i];
|
|
6158
|
+
const p2 = p[i + 1];
|
|
6159
|
+
const p3 = p[Math.min(p.length - 1, i + 2)];
|
|
6160
|
+
const cp1x = p1.x + (p2.x - p0.x) / 6;
|
|
6161
|
+
const cp1y = p1.y + (p2.y - p0.y) / 6;
|
|
6162
|
+
const cp2x = p2.x - (p3.x - p1.x) / 6;
|
|
6163
|
+
const cp2y = p2.y - (p3.y - p1.y) / 6;
|
|
6164
|
+
d += ` C ${cp1x} ${cp1y}, ${cp2x} ${cp2y}, ${p2.x} ${p2.y}`;
|
|
6165
|
+
}
|
|
6166
|
+
return d;
|
|
6167
|
+
};
|
|
6168
|
+
var useChartSize = (ref) => {
|
|
6169
|
+
const [size, setSize] = React5.useState({ width: 0, height: 0 });
|
|
6170
|
+
React5.useEffect(() => {
|
|
6171
|
+
const el = ref.current;
|
|
6172
|
+
if (!el) return;
|
|
6173
|
+
const observer = new ResizeObserver((entries) => {
|
|
6174
|
+
const entry = entries[0];
|
|
6175
|
+
if (!entry) return;
|
|
6176
|
+
const { width, height } = entry.contentRect;
|
|
6177
|
+
setSize({ width: Math.floor(width), height: Math.floor(height) });
|
|
6178
|
+
});
|
|
6179
|
+
observer.observe(el);
|
|
6180
|
+
return () => observer.disconnect();
|
|
6181
|
+
}, [ref]);
|
|
6182
|
+
return size;
|
|
6183
|
+
};
|
|
6146
6184
|
var useChartTooltip = (enabled) => {
|
|
6147
6185
|
const [tooltip, setTooltip] = React5.useState({
|
|
6148
6186
|
visible: false,
|
|
@@ -6177,15 +6215,15 @@ var useChartTooltip = (enabled) => {
|
|
|
6177
6215
|
}, []);
|
|
6178
6216
|
return { tooltip, show, hide, move, containerRef };
|
|
6179
6217
|
};
|
|
6180
|
-
var LineChart = React5.memo(({ data, labels, onHover, onMove, onLeave }) => {
|
|
6218
|
+
var LineChart = React5.memo(({ data, labels, width, height, onHover, onMove, onLeave }) => {
|
|
6181
6219
|
const entries = React5.useMemo(() => Object.entries(data), [data]);
|
|
6182
6220
|
const maxVal = React5.useMemo(() => {
|
|
6183
6221
|
const allValues = entries.flatMap(([, v]) => v);
|
|
6184
6222
|
return Math.max(...allValues) * 1.2 || 1;
|
|
6185
6223
|
}, [entries]);
|
|
6186
6224
|
const count = labels.length;
|
|
6187
|
-
const chartW =
|
|
6188
|
-
const chartH =
|
|
6225
|
+
const chartW = width - PADDING.left - PADDING.right;
|
|
6226
|
+
const chartH = height - PADDING.top - PADDING.bottom;
|
|
6189
6227
|
const seriesPoints = React5.useMemo(
|
|
6190
6228
|
() => entries.map(
|
|
6191
6229
|
([, values]) => values.map((v, i) => ({
|
|
@@ -6196,18 +6234,18 @@ var LineChart = React5.memo(({ data, labels, onHover, onMove, onLeave }) => {
|
|
|
6196
6234
|
),
|
|
6197
6235
|
[entries, count, chartW, chartH, maxVal]
|
|
6198
6236
|
);
|
|
6199
|
-
return /* @__PURE__ */ jsxs196("svg", { viewBox:
|
|
6237
|
+
return /* @__PURE__ */ jsxs196("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
6200
6238
|
[0, 0.25, 0.5, 0.75, 1].map((ratio) => {
|
|
6201
6239
|
const y = PADDING.top + (1 - ratio) * chartH;
|
|
6202
6240
|
const val = Math.round(maxVal * ratio);
|
|
6203
6241
|
return /* @__PURE__ */ jsxs196("g", { children: [
|
|
6204
|
-
/* @__PURE__ */ jsx305("line", { x1: PADDING.left, y1: y, x2:
|
|
6242
|
+
/* @__PURE__ */ jsx305("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
|
|
6205
6243
|
/* @__PURE__ */ jsx305("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
|
|
6206
6244
|
] }, ratio);
|
|
6207
6245
|
}),
|
|
6208
6246
|
labels.map((label, i) => {
|
|
6209
6247
|
const x = PADDING.left + i / (count - 1 || 1) * chartW;
|
|
6210
|
-
return /* @__PURE__ */ jsx305("text", { x, y:
|
|
6248
|
+
return /* @__PURE__ */ jsx305("text", { x, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
6211
6249
|
}),
|
|
6212
6250
|
entries.map(([key], di) => {
|
|
6213
6251
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
@@ -6242,7 +6280,73 @@ var LineChart = React5.memo(({ data, labels, onHover, onMove, onLeave }) => {
|
|
|
6242
6280
|
] });
|
|
6243
6281
|
});
|
|
6244
6282
|
LineChart.displayName = "LineChart";
|
|
6245
|
-
var
|
|
6283
|
+
var CurveChart = React5.memo(({ data, labels, width, height, onHover, onMove, onLeave }) => {
|
|
6284
|
+
const entries = React5.useMemo(() => Object.entries(data), [data]);
|
|
6285
|
+
const maxVal = React5.useMemo(() => {
|
|
6286
|
+
const allValues = entries.flatMap(([, v]) => v);
|
|
6287
|
+
return Math.max(...allValues) * 1.2 || 1;
|
|
6288
|
+
}, [entries]);
|
|
6289
|
+
const count = labels.length;
|
|
6290
|
+
const chartW = width - PADDING.left - PADDING.right;
|
|
6291
|
+
const chartH = height - PADDING.top - PADDING.bottom;
|
|
6292
|
+
const seriesPoints = React5.useMemo(
|
|
6293
|
+
() => entries.map(
|
|
6294
|
+
([, values]) => values.map((v, i) => ({
|
|
6295
|
+
x: PADDING.left + i / (count - 1 || 1) * chartW,
|
|
6296
|
+
y: PADDING.top + (1 - v / maxVal) * chartH,
|
|
6297
|
+
v
|
|
6298
|
+
}))
|
|
6299
|
+
),
|
|
6300
|
+
[entries, count, chartW, chartH, maxVal]
|
|
6301
|
+
);
|
|
6302
|
+
return /* @__PURE__ */ jsxs196("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
6303
|
+
[0, 0.25, 0.5, 0.75, 1].map((ratio) => {
|
|
6304
|
+
const y = PADDING.top + (1 - ratio) * chartH;
|
|
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
|
+
}),
|
|
6315
|
+
entries.map(([key], di) => {
|
|
6316
|
+
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
6317
|
+
const color = palette[2];
|
|
6318
|
+
const areaColor = palette[0];
|
|
6319
|
+
const points = seriesPoints[di];
|
|
6320
|
+
const gradientId = `curve-gradient-${di}`;
|
|
6321
|
+
const linePath = toSmoothPath(points);
|
|
6322
|
+
const areaPath = linePath + ` L ${points[points.length - 1].x} ${PADDING.top + chartH} L ${points[0].x} ${PADDING.top + chartH} Z`;
|
|
6323
|
+
return /* @__PURE__ */ jsxs196("g", { children: [
|
|
6324
|
+
/* @__PURE__ */ jsx305("defs", { children: /* @__PURE__ */ jsxs196("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
6325
|
+
/* @__PURE__ */ jsx305("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.4" }),
|
|
6326
|
+
/* @__PURE__ */ jsx305("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0.02" })
|
|
6327
|
+
] }) }),
|
|
6328
|
+
/* @__PURE__ */ jsx305("path", { d: areaPath, fill: `url(#${gradientId})` }),
|
|
6329
|
+
/* @__PURE__ */ jsx305("path", { d: linePath, fill: "none", stroke: color, strokeWidth: "2" }),
|
|
6330
|
+
points.map((p, i) => /* @__PURE__ */ jsx305(
|
|
6331
|
+
"circle",
|
|
6332
|
+
{
|
|
6333
|
+
cx: p.x,
|
|
6334
|
+
cy: p.y,
|
|
6335
|
+
r: "4",
|
|
6336
|
+
fill: color,
|
|
6337
|
+
className: "chart-point",
|
|
6338
|
+
onMouseEnter: (e) => onHover(e, `${key}: ${labels[i]} \u2014 ${p.v}`),
|
|
6339
|
+
onMouseMove: onMove,
|
|
6340
|
+
onMouseLeave: onLeave
|
|
6341
|
+
},
|
|
6342
|
+
i
|
|
6343
|
+
))
|
|
6344
|
+
] }, di);
|
|
6345
|
+
})
|
|
6346
|
+
] });
|
|
6347
|
+
});
|
|
6348
|
+
CurveChart.displayName = "CurveChart";
|
|
6349
|
+
var BarChart = React5.memo(({ data, labels, width, height, onHover, onMove, onLeave }) => {
|
|
6246
6350
|
const entries = React5.useMemo(() => Object.entries(data), [data]);
|
|
6247
6351
|
const maxVal = React5.useMemo(() => {
|
|
6248
6352
|
const allValues = entries.flatMap(([, v]) => v);
|
|
@@ -6250,8 +6354,8 @@ var BarChart = React5.memo(({ data, labels, onHover, onMove, onLeave }) => {
|
|
|
6250
6354
|
}, [entries]);
|
|
6251
6355
|
const count = labels.length;
|
|
6252
6356
|
const groupCount = entries.length;
|
|
6253
|
-
const chartW =
|
|
6254
|
-
const chartH =
|
|
6357
|
+
const chartW = width - PADDING.left - PADDING.right;
|
|
6358
|
+
const chartH = height - PADDING.top - PADDING.bottom;
|
|
6255
6359
|
const groupW = chartW / count;
|
|
6256
6360
|
const barW = Math.min(32, groupW * 0.7 / groupCount);
|
|
6257
6361
|
const bars = React5.useMemo(
|
|
@@ -6265,16 +6369,16 @@ var BarChart = React5.memo(({ data, labels, onHover, onMove, onLeave }) => {
|
|
|
6265
6369
|
),
|
|
6266
6370
|
[entries, maxVal, chartH, groupW, barW, groupCount]
|
|
6267
6371
|
);
|
|
6268
|
-
return /* @__PURE__ */ jsxs196("svg", { viewBox:
|
|
6372
|
+
return /* @__PURE__ */ jsxs196("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
6269
6373
|
[0, 0.25, 0.5, 0.75, 1].map((ratio) => {
|
|
6270
6374
|
const y = PADDING.top + (1 - ratio) * chartH;
|
|
6271
6375
|
const val = Math.round(maxVal * ratio);
|
|
6272
6376
|
return /* @__PURE__ */ jsxs196("g", { children: [
|
|
6273
|
-
/* @__PURE__ */ jsx305("line", { x1: PADDING.left, y1: y, x2:
|
|
6377
|
+
/* @__PURE__ */ jsx305("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
|
|
6274
6378
|
/* @__PURE__ */ jsx305("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
|
|
6275
6379
|
] }, ratio);
|
|
6276
6380
|
}),
|
|
6277
|
-
labels.map((label, i) => /* @__PURE__ */ jsx305("text", { x: PADDING.left + groupW * i + groupW / 2, y:
|
|
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)),
|
|
6278
6382
|
entries.map(([key], di) => {
|
|
6279
6383
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
6280
6384
|
const color = palette[2];
|
|
@@ -6285,7 +6389,7 @@ var BarChart = React5.memo(({ data, labels, onHover, onMove, onLeave }) => {
|
|
|
6285
6389
|
y: b.y,
|
|
6286
6390
|
width: b.w,
|
|
6287
6391
|
height: b.h,
|
|
6288
|
-
rx:
|
|
6392
|
+
rx: Math.min(4, b.w / 2),
|
|
6289
6393
|
fill: color,
|
|
6290
6394
|
className: "chart-bar",
|
|
6291
6395
|
onMouseEnter: (e) => onHover(e, `${key}: ${labels[i]} \u2014 ${b.v}`),
|
|
@@ -6299,14 +6403,15 @@ var BarChart = React5.memo(({ data, labels, onHover, onMove, onLeave }) => {
|
|
|
6299
6403
|
});
|
|
6300
6404
|
BarChart.displayName = "BarChart";
|
|
6301
6405
|
var PieDonutChart = React5.memo(
|
|
6302
|
-
({ data, labels, isDoughnut, onHover, onMove, onLeave }) => {
|
|
6406
|
+
({ data, labels, width, height, isDoughnut, onHover, onMove, onLeave }) => {
|
|
6303
6407
|
const entries = React5.useMemo(() => Object.entries(data), [data]);
|
|
6304
6408
|
const values = React5.useMemo(() => entries.flatMap(([, v]) => v), [entries]);
|
|
6305
6409
|
const total = React5.useMemo(() => values.reduce((a, b) => a + b, 0) || 1, [values]);
|
|
6306
|
-
const
|
|
6307
|
-
const
|
|
6308
|
-
const
|
|
6309
|
-
const
|
|
6410
|
+
const size = Math.min(width, height);
|
|
6411
|
+
const cx = size / 2;
|
|
6412
|
+
const cy = size / 2;
|
|
6413
|
+
const r2 = size * 0.4;
|
|
6414
|
+
const innerR = isDoughnut ? r2 * 0.5 : 0;
|
|
6310
6415
|
const firstKey = entries[0]?.[0] ?? "";
|
|
6311
6416
|
const colorOffset = hashString(firstKey);
|
|
6312
6417
|
const sliceData = React5.useMemo(() => {
|
|
@@ -6337,8 +6442,8 @@ var PieDonutChart = React5.memo(
|
|
|
6337
6442
|
angle0 = endAngle;
|
|
6338
6443
|
return { d, lx, ly, v, pct, angle, label: labels[i] || `${i + 1}` };
|
|
6339
6444
|
});
|
|
6340
|
-
}, [values, total, innerR, labels]);
|
|
6341
|
-
return /* @__PURE__ */ jsx305("svg", { viewBox:
|
|
6445
|
+
}, [values, total, cx, cy, r2, innerR, labels]);
|
|
6446
|
+
return /* @__PURE__ */ jsx305("svg", { viewBox: `0 0 ${size} ${size}`, className: "chart-svg chart-pie", children: sliceData.map((s, i) => /* @__PURE__ */ jsxs196("g", { children: [
|
|
6342
6447
|
/* @__PURE__ */ jsx305(
|
|
6343
6448
|
"path",
|
|
6344
6449
|
{
|
|
@@ -6355,22 +6460,42 @@ var PieDonutChart = React5.memo(
|
|
|
6355
6460
|
}
|
|
6356
6461
|
);
|
|
6357
6462
|
PieDonutChart.displayName = "PieDonutChart";
|
|
6463
|
+
var TooltipBubble = ({ x, y, containerWidth, children }) => {
|
|
6464
|
+
const ref = React5.useRef(null);
|
|
6465
|
+
const [adjustedX, setAdjustedX] = React5.useState(x);
|
|
6466
|
+
React5.useEffect(() => {
|
|
6467
|
+
const el = ref.current;
|
|
6468
|
+
if (!el) return;
|
|
6469
|
+
const w = el.offsetWidth;
|
|
6470
|
+
const half = w / 2;
|
|
6471
|
+
const margin = 8;
|
|
6472
|
+
let nx = x;
|
|
6473
|
+
if (x - half < margin) nx = half + margin;
|
|
6474
|
+
else if (x + half > containerWidth - margin) nx = containerWidth - half - margin;
|
|
6475
|
+
setAdjustedX(nx);
|
|
6476
|
+
}, [x, containerWidth]);
|
|
6477
|
+
return /* @__PURE__ */ jsx305(
|
|
6478
|
+
"div",
|
|
6479
|
+
{
|
|
6480
|
+
ref,
|
|
6481
|
+
className: "chart-tooltip",
|
|
6482
|
+
style: { left: adjustedX, top: y },
|
|
6483
|
+
children
|
|
6484
|
+
}
|
|
6485
|
+
);
|
|
6486
|
+
};
|
|
6358
6487
|
var Chart = (props) => {
|
|
6359
6488
|
const { type, data, labels, tooltip: showTooltip = true } = props;
|
|
6360
6489
|
const { tooltip, show, hide, move, containerRef } = useChartTooltip(showTooltip);
|
|
6490
|
+
const { width, height } = useChartSize(containerRef);
|
|
6491
|
+
const ready = width > 0 && height > 0;
|
|
6361
6492
|
return /* @__PURE__ */ jsxs196("div", { className: "lib-xplat-chart", ref: containerRef, children: [
|
|
6362
|
-
type === "line" && /* @__PURE__ */ jsx305(LineChart, { data, labels, onHover: show, onMove: move, onLeave: hide }),
|
|
6363
|
-
type === "
|
|
6364
|
-
type === "
|
|
6365
|
-
type === "
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
{
|
|
6369
|
-
className: "chart-tooltip",
|
|
6370
|
-
style: { left: tooltip.x, top: tooltip.y },
|
|
6371
|
-
children: tooltip.content
|
|
6372
|
-
}
|
|
6373
|
-
)
|
|
6493
|
+
ready && type === "line" && /* @__PURE__ */ jsx305(LineChart, { data, labels, width, height, onHover: show, onMove: move, onLeave: hide }),
|
|
6494
|
+
ready && type === "curve" && /* @__PURE__ */ jsx305(CurveChart, { data, labels, width, height, onHover: show, onMove: move, onLeave: hide }),
|
|
6495
|
+
ready && type === "bar" && /* @__PURE__ */ jsx305(BarChart, { data, labels, width, height, onHover: show, onMove: move, onLeave: hide }),
|
|
6496
|
+
ready && type === "pie" && /* @__PURE__ */ jsx305(PieDonutChart, { data, labels, width, height, onHover: show, onMove: move, onLeave: hide }),
|
|
6497
|
+
ready && type === "doughnut" && /* @__PURE__ */ jsx305(PieDonutChart, { data, labels, width, height, isDoughnut: true, onHover: show, onMove: move, onLeave: hide }),
|
|
6498
|
+
tooltip.visible && /* @__PURE__ */ jsx305(TooltipBubble, { x: tooltip.x, y: tooltip.y, containerWidth: width, children: tooltip.content })
|
|
6374
6499
|
] });
|
|
6375
6500
|
};
|
|
6376
6501
|
Chart.displayName = "Chart";
|
|
@@ -6635,42 +6760,66 @@ var PasswordInput = React7.forwardRef(
|
|
|
6635
6760
|
PasswordInput.displayName = "PasswordInput";
|
|
6636
6761
|
var PasswordInput_default = PasswordInput;
|
|
6637
6762
|
|
|
6638
|
-
// src/
|
|
6763
|
+
// src/components/Modal/Modal.tsx
|
|
6639
6764
|
import React8 from "react";
|
|
6640
|
-
|
|
6765
|
+
import { createPortal } from "react-dom";
|
|
6766
|
+
import { jsx as jsx311 } from "react/jsx-runtime";
|
|
6767
|
+
var ANIMATION_DURATION_MS = 200;
|
|
6768
|
+
var Modal = (props) => {
|
|
6769
|
+
const { isOpen, onClose, children } = props;
|
|
6770
|
+
const [mounted, setMounted] = React8.useState(false);
|
|
6771
|
+
const [visible, setVisible] = React8.useState(false);
|
|
6641
6772
|
React8.useEffect(() => {
|
|
6642
|
-
if (
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
|
|
6773
|
+
if (isOpen) {
|
|
6774
|
+
setMounted(true);
|
|
6775
|
+
const t2 = setTimeout(() => setVisible(true), 1);
|
|
6776
|
+
return () => clearTimeout(t2);
|
|
6777
|
+
}
|
|
6778
|
+
setVisible(false);
|
|
6779
|
+
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS);
|
|
6780
|
+
return () => clearTimeout(t);
|
|
6781
|
+
}, [isOpen]);
|
|
6782
|
+
if (typeof document === "undefined") return null;
|
|
6783
|
+
if (!mounted) return null;
|
|
6784
|
+
const stateClass = visible ? "enter" : "exit";
|
|
6785
|
+
return createPortal(
|
|
6786
|
+
/* @__PURE__ */ jsx311(
|
|
6787
|
+
"div",
|
|
6788
|
+
{
|
|
6789
|
+
className: clsx_default("lib-xplat-modal", "dim", stateClass),
|
|
6790
|
+
onClick: onClose,
|
|
6791
|
+
children: /* @__PURE__ */ jsx311(
|
|
6792
|
+
"div",
|
|
6793
|
+
{
|
|
6794
|
+
className: clsx_default("lib-xplat-modal", "modal-box", stateClass),
|
|
6795
|
+
role: "dialog",
|
|
6796
|
+
"aria-modal": "true",
|
|
6797
|
+
onClick: (e) => e.stopPropagation(),
|
|
6798
|
+
children
|
|
6799
|
+
}
|
|
6800
|
+
)
|
|
6651
6801
|
}
|
|
6652
|
-
|
|
6653
|
-
document.
|
|
6654
|
-
|
|
6655
|
-
return () => {
|
|
6656
|
-
document.removeEventListener("mousedown", listener);
|
|
6657
|
-
document.removeEventListener("touchstart", listener);
|
|
6658
|
-
};
|
|
6659
|
-
}, [refs, handler, enabled]);
|
|
6802
|
+
),
|
|
6803
|
+
document.body
|
|
6804
|
+
);
|
|
6660
6805
|
};
|
|
6661
|
-
|
|
6806
|
+
Modal.displayName = "Modal";
|
|
6807
|
+
var Modal_default = Modal;
|
|
6662
6808
|
|
|
6663
6809
|
// src/components/DatePicker/SingleDatePicker/index.tsx
|
|
6664
6810
|
import React9 from "react";
|
|
6665
|
-
import { Fragment as Fragment2, jsx as
|
|
6811
|
+
import { Fragment as Fragment2, jsx as jsx312, jsxs as jsxs200 } from "react/jsx-runtime";
|
|
6666
6812
|
var DayCell2 = React9.memo(
|
|
6667
6813
|
({
|
|
6668
6814
|
day,
|
|
6669
6815
|
disabled,
|
|
6670
6816
|
selected,
|
|
6671
6817
|
highlighted,
|
|
6818
|
+
isStart,
|
|
6819
|
+
isEnd,
|
|
6820
|
+
inRange,
|
|
6672
6821
|
onSelect
|
|
6673
|
-
}) => /* @__PURE__ */
|
|
6822
|
+
}) => /* @__PURE__ */ jsx312(
|
|
6674
6823
|
"button",
|
|
6675
6824
|
{
|
|
6676
6825
|
type: "button",
|
|
@@ -6678,8 +6827,9 @@ var DayCell2 = React9.memo(
|
|
|
6678
6827
|
"datepicker-day",
|
|
6679
6828
|
!day.isCurrentMonth && "outside",
|
|
6680
6829
|
disabled && "disabled",
|
|
6681
|
-
selected && "selected",
|
|
6830
|
+
(selected || isStart || isEnd) && "selected",
|
|
6682
6831
|
highlighted && !selected && "highlighted",
|
|
6832
|
+
inRange && !isStart && !isEnd && "in-range",
|
|
6683
6833
|
day.isToday && "today",
|
|
6684
6834
|
day.isSunday && "sunday",
|
|
6685
6835
|
day.isSaturday && "saturday"
|
|
@@ -6691,7 +6841,7 @@ var DayCell2 = React9.memo(
|
|
|
6691
6841
|
children: day.day
|
|
6692
6842
|
}
|
|
6693
6843
|
),
|
|
6694
|
-
(prev, next) => prev.selected === next.selected && prev.disabled === next.disabled && prev.highlighted === next.highlighted && prev.day === next.day
|
|
6844
|
+
(prev, next) => prev.selected === next.selected && prev.disabled === next.disabled && prev.highlighted === next.highlighted && prev.isStart === next.isStart && prev.isEnd === next.isEnd && prev.inRange === next.inRange && prev.day === next.day
|
|
6695
6845
|
);
|
|
6696
6846
|
DayCell2.displayName = "DayCell";
|
|
6697
6847
|
var SingleDatePicker = (props) => {
|
|
@@ -6701,7 +6851,9 @@ var SingleDatePicker = (props) => {
|
|
|
6701
6851
|
minDate,
|
|
6702
6852
|
maxDate,
|
|
6703
6853
|
highlightDates = [],
|
|
6704
|
-
locale = "ko"
|
|
6854
|
+
locale = "ko",
|
|
6855
|
+
rangeStart,
|
|
6856
|
+
rangeEnd
|
|
6705
6857
|
} = props;
|
|
6706
6858
|
const initialYear = value?.getFullYear();
|
|
6707
6859
|
const initialMonth = value?.getMonth();
|
|
@@ -6749,6 +6901,8 @@ var SingleDatePicker = (props) => {
|
|
|
6749
6901
|
else if (pickerMode === "months") {
|
|
6750
6902
|
setYearRangeStart(Math.floor(year / 12) * 12);
|
|
6751
6903
|
setPickerMode("years");
|
|
6904
|
+
} else {
|
|
6905
|
+
setPickerMode("days");
|
|
6752
6906
|
}
|
|
6753
6907
|
};
|
|
6754
6908
|
const handleMonthSelect = (m) => {
|
|
@@ -6762,71 +6916,80 @@ var SingleDatePicker = (props) => {
|
|
|
6762
6916
|
const weekdays = WEEKDAY_LABELS[locale];
|
|
6763
6917
|
const monthLabels = MONTH_LABELS[locale];
|
|
6764
6918
|
const titleText = pickerMode === "days" ? locale === "ko" ? `${year}\uB144 ${monthLabels[month]}` : `${monthLabels[month]} ${year}` : pickerMode === "months" ? `${year}` : `${yearRangeStart} - ${yearRangeStart + 11}`;
|
|
6919
|
+
const hasRange = rangeStart != null && rangeEnd != null;
|
|
6765
6920
|
return /* @__PURE__ */ jsxs200(
|
|
6766
6921
|
"div",
|
|
6767
6922
|
{
|
|
6768
6923
|
className: clsx_default("lib-xplat-datepicker", "single"),
|
|
6769
6924
|
children: [
|
|
6770
6925
|
/* @__PURE__ */ jsxs200("div", { className: "datepicker-header", children: [
|
|
6771
|
-
/* @__PURE__ */
|
|
6772
|
-
/* @__PURE__ */
|
|
6773
|
-
/* @__PURE__ */
|
|
6926
|
+
/* @__PURE__ */ jsx312("button", { className: "datepicker-nav", onClick: handlePrev, type: "button", children: /* @__PURE__ */ jsx312(ChevronLeftIcon_default, {}) }),
|
|
6927
|
+
/* @__PURE__ */ jsx312("button", { className: "datepicker-title", onClick: handleTitleClick, type: "button", children: titleText }),
|
|
6928
|
+
/* @__PURE__ */ jsx312("button", { className: "datepicker-nav", onClick: handleNext, type: "button", children: /* @__PURE__ */ jsx312(ChevronRightIcon_default, {}) })
|
|
6774
6929
|
] }),
|
|
6775
|
-
|
|
6776
|
-
|
|
6777
|
-
|
|
6930
|
+
/* @__PURE__ */ jsxs200("div", { className: "datepicker-body", children: [
|
|
6931
|
+
pickerMode === "years" && /* @__PURE__ */ jsx312("div", { className: "datepicker-picker-grid", children: Array.from({ length: 12 }, (_, i) => {
|
|
6932
|
+
const y = yearRangeStart + i;
|
|
6933
|
+
return /* @__PURE__ */ jsx312(
|
|
6934
|
+
"button",
|
|
6935
|
+
{
|
|
6936
|
+
type: "button",
|
|
6937
|
+
className: clsx_default("datepicker-picker-cell", y === year && "active"),
|
|
6938
|
+
onClick: () => handleYearSelect(y),
|
|
6939
|
+
children: y
|
|
6940
|
+
},
|
|
6941
|
+
y
|
|
6942
|
+
);
|
|
6943
|
+
}) }),
|
|
6944
|
+
pickerMode === "months" && /* @__PURE__ */ jsx312("div", { className: "datepicker-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ jsx312(
|
|
6778
6945
|
"button",
|
|
6779
6946
|
{
|
|
6780
6947
|
type: "button",
|
|
6781
|
-
className: clsx_default("datepicker-picker-cell",
|
|
6782
|
-
onClick: () =>
|
|
6783
|
-
children: y
|
|
6784
|
-
},
|
|
6785
|
-
y
|
|
6786
|
-
);
|
|
6787
|
-
}) }),
|
|
6788
|
-
pickerMode === "months" && /* @__PURE__ */ jsx311("div", { className: "datepicker-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ jsx311(
|
|
6789
|
-
"button",
|
|
6790
|
-
{
|
|
6791
|
-
type: "button",
|
|
6792
|
-
className: clsx_default("datepicker-picker-cell", i === month && "active"),
|
|
6793
|
-
onClick: () => handleMonthSelect(i),
|
|
6794
|
-
children: label
|
|
6795
|
-
},
|
|
6796
|
-
i
|
|
6797
|
-
)) }),
|
|
6798
|
-
pickerMode === "days" && /* @__PURE__ */ jsxs200(Fragment2, { children: [
|
|
6799
|
-
/* @__PURE__ */ jsx311("div", { className: "datepicker-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ jsx311(
|
|
6800
|
-
"div",
|
|
6801
|
-
{
|
|
6802
|
-
className: clsx_default(
|
|
6803
|
-
"datepicker-weekday",
|
|
6804
|
-
i === 0 && "sunday",
|
|
6805
|
-
i === 6 && "saturday"
|
|
6806
|
-
),
|
|
6948
|
+
className: clsx_default("datepicker-picker-cell", i === month && "active"),
|
|
6949
|
+
onClick: () => handleMonthSelect(i),
|
|
6807
6950
|
children: label
|
|
6808
6951
|
},
|
|
6809
|
-
|
|
6952
|
+
i
|
|
6810
6953
|
)) }),
|
|
6811
|
-
/* @__PURE__ */
|
|
6812
|
-
|
|
6813
|
-
|
|
6814
|
-
const selected = value ? isSameDay(day.date, value) : false;
|
|
6815
|
-
const highlighted = highlightSet.has(
|
|
6816
|
-
`${day.date.getFullYear()}-${day.date.getMonth()}-${day.date.getDate()}`
|
|
6817
|
-
);
|
|
6818
|
-
return /* @__PURE__ */ jsx311(
|
|
6819
|
-
DayCell2,
|
|
6954
|
+
pickerMode === "days" && /* @__PURE__ */ jsxs200(Fragment2, { children: [
|
|
6955
|
+
/* @__PURE__ */ jsx312("div", { className: "datepicker-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ jsx312(
|
|
6956
|
+
"div",
|
|
6820
6957
|
{
|
|
6821
|
-
|
|
6822
|
-
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
|
|
6958
|
+
className: clsx_default(
|
|
6959
|
+
"datepicker-weekday",
|
|
6960
|
+
i === 0 && "sunday",
|
|
6961
|
+
i === 6 && "saturday"
|
|
6962
|
+
),
|
|
6963
|
+
children: label
|
|
6826
6964
|
},
|
|
6827
|
-
|
|
6828
|
-
)
|
|
6829
|
-
|
|
6965
|
+
label
|
|
6966
|
+
)) }),
|
|
6967
|
+
/* @__PURE__ */ jsx312("div", { className: "datepicker-grid", children: days.map((day, idx) => {
|
|
6968
|
+
const t = day.date.getTime();
|
|
6969
|
+
const disabled = t < minTime || t > maxTime;
|
|
6970
|
+
const selected = value ? isSameDay(day.date, value) : false;
|
|
6971
|
+
const highlighted = highlightSet.has(
|
|
6972
|
+
`${day.date.getFullYear()}-${day.date.getMonth()}-${day.date.getDate()}`
|
|
6973
|
+
);
|
|
6974
|
+
const isStart = hasRange ? isSameDay(day.date, rangeStart) : false;
|
|
6975
|
+
const isEnd = hasRange ? isSameDay(day.date, rangeEnd) : false;
|
|
6976
|
+
const inRangeVal = hasRange ? isInRange(day.date, rangeStart, rangeEnd) : false;
|
|
6977
|
+
return /* @__PURE__ */ jsx312(
|
|
6978
|
+
DayCell2,
|
|
6979
|
+
{
|
|
6980
|
+
day,
|
|
6981
|
+
disabled,
|
|
6982
|
+
selected,
|
|
6983
|
+
highlighted,
|
|
6984
|
+
isStart,
|
|
6985
|
+
isEnd,
|
|
6986
|
+
inRange: inRangeVal,
|
|
6987
|
+
onSelect: handleSelect
|
|
6988
|
+
},
|
|
6989
|
+
idx
|
|
6990
|
+
);
|
|
6991
|
+
}) })
|
|
6992
|
+
] })
|
|
6830
6993
|
] })
|
|
6831
6994
|
]
|
|
6832
6995
|
}
|
|
@@ -6836,7 +6999,7 @@ SingleDatePicker.displayName = "SingleDatePicker";
|
|
|
6836
6999
|
var SingleDatePicker_default = SingleDatePicker;
|
|
6837
7000
|
|
|
6838
7001
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
6839
|
-
import { jsx as
|
|
7002
|
+
import { jsx as jsx313, jsxs as jsxs201 } from "react/jsx-runtime";
|
|
6840
7003
|
var formatDate = (date) => {
|
|
6841
7004
|
if (!date || !(date instanceof Date) || isNaN(date.getTime())) return "";
|
|
6842
7005
|
const y = date.getFullYear();
|
|
@@ -6845,137 +7008,131 @@ var formatDate = (date) => {
|
|
|
6845
7008
|
return `${y}/${m}/${d}`;
|
|
6846
7009
|
};
|
|
6847
7010
|
var InputDatePicker = (props) => {
|
|
6848
|
-
const { value, onChange, minDate, maxDate, disabled, locale, placeholder } = props;
|
|
7011
|
+
const { value, onChange, minDate, maxDate, disabled, locale = "ko", placeholder } = props;
|
|
6849
7012
|
const [isOpen, setIsOpen] = React10.useState(false);
|
|
6850
|
-
const
|
|
6851
|
-
const
|
|
6852
|
-
|
|
7013
|
+
const [tempDate, setTempDate] = React10.useState(value ?? /* @__PURE__ */ new Date());
|
|
7014
|
+
const handleOpen = () => {
|
|
7015
|
+
if (disabled) return;
|
|
7016
|
+
setTempDate(value ?? /* @__PURE__ */ new Date());
|
|
7017
|
+
setIsOpen(true);
|
|
7018
|
+
};
|
|
6853
7019
|
const handleSelect = (date) => {
|
|
6854
|
-
if (
|
|
6855
|
-
|
|
7020
|
+
if (date) setTempDate(date);
|
|
7021
|
+
};
|
|
7022
|
+
const handleApply = () => {
|
|
7023
|
+
onChange?.(tempDate);
|
|
6856
7024
|
setIsOpen(false);
|
|
6857
7025
|
};
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
|
|
6865
|
-
|
|
6866
|
-
|
|
6867
|
-
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6886
|
-
|
|
6887
|
-
|
|
6888
|
-
|
|
6889
|
-
}
|
|
6890
|
-
) })
|
|
6891
|
-
]
|
|
6892
|
-
}
|
|
6893
|
-
);
|
|
7026
|
+
const handleClose = () => {
|
|
7027
|
+
setIsOpen(false);
|
|
7028
|
+
};
|
|
7029
|
+
return /* @__PURE__ */ jsxs201("div", { className: clsx_default("lib-xplat-datepicker input-datepicker", disabled && "disabled"), children: [
|
|
7030
|
+
/* @__PURE__ */ jsx313("div", { className: "input-datepicker-trigger", onClick: handleOpen, children: /* @__PURE__ */ jsx313(
|
|
7031
|
+
Input_default,
|
|
7032
|
+
{
|
|
7033
|
+
value: formatDate(value),
|
|
7034
|
+
placeholder,
|
|
7035
|
+
suffix: /* @__PURE__ */ jsx313(CalenderIcon_default, {}),
|
|
7036
|
+
disabled,
|
|
7037
|
+
readOnly: true
|
|
7038
|
+
}
|
|
7039
|
+
) }),
|
|
7040
|
+
/* @__PURE__ */ jsx313(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ jsxs201("div", { className: "lib-xplat-popup-datepicker-card", children: [
|
|
7041
|
+
/* @__PURE__ */ jsx313("div", { className: "popup-datepicker-content", children: /* @__PURE__ */ jsx313(
|
|
7042
|
+
SingleDatePicker_default,
|
|
7043
|
+
{
|
|
7044
|
+
value: tempDate,
|
|
7045
|
+
onChange: handleSelect,
|
|
7046
|
+
minDate,
|
|
7047
|
+
maxDate,
|
|
7048
|
+
locale
|
|
7049
|
+
}
|
|
7050
|
+
) }),
|
|
7051
|
+
/* @__PURE__ */ jsxs201("div", { className: "popup-datepicker-footer", children: [
|
|
7052
|
+
/* @__PURE__ */ jsx313(Button_default, { type: "secondary", onClick: handleClose, children: locale === "ko" ? "\uCDE8\uC18C" : "Cancel" }),
|
|
7053
|
+
/* @__PURE__ */ jsx313(Button_default, { type: "primary", onClick: handleApply, children: locale === "ko" ? "\uC801\uC6A9" : "Apply" })
|
|
7054
|
+
] })
|
|
7055
|
+
] }) })
|
|
7056
|
+
] });
|
|
6894
7057
|
};
|
|
6895
7058
|
InputDatePicker.displayName = "InputDatePicker";
|
|
6896
7059
|
var InputDatePicker_default = InputDatePicker;
|
|
6897
7060
|
|
|
6898
7061
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
7062
|
+
import React14 from "react";
|
|
7063
|
+
|
|
7064
|
+
// src/components/DatePicker/RangePicker/index.tsx
|
|
6899
7065
|
import React13 from "react";
|
|
6900
7066
|
|
|
6901
|
-
// src/components/
|
|
7067
|
+
// src/components/Tab/Tab.tsx
|
|
7068
|
+
import React12 from "react";
|
|
7069
|
+
|
|
7070
|
+
// src/components/Tab/TabItem.tsx
|
|
6902
7071
|
import React11 from "react";
|
|
6903
|
-
import {
|
|
6904
|
-
|
|
6905
|
-
|
|
6906
|
-
|
|
6907
|
-
|
|
6908
|
-
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
|
|
6912
|
-
|
|
6913
|
-
const t2 = setTimeout(() => setVisible(true), 1);
|
|
6914
|
-
return () => clearTimeout(t2);
|
|
7072
|
+
import { jsx as jsx314 } from "react/jsx-runtime";
|
|
7073
|
+
var TabItem = React11.forwardRef((props, ref) => {
|
|
7074
|
+
const { isActive, title, onClick } = props;
|
|
7075
|
+
return /* @__PURE__ */ jsx314(
|
|
7076
|
+
"div",
|
|
7077
|
+
{
|
|
7078
|
+
ref,
|
|
7079
|
+
className: clsx_default("tab-item", isActive ? "active" : null),
|
|
7080
|
+
onClick,
|
|
7081
|
+
children: title
|
|
6915
7082
|
}
|
|
6916
|
-
|
|
6917
|
-
|
|
6918
|
-
|
|
6919
|
-
|
|
6920
|
-
|
|
6921
|
-
|
|
6922
|
-
|
|
6923
|
-
|
|
6924
|
-
|
|
7083
|
+
);
|
|
7084
|
+
});
|
|
7085
|
+
TabItem.displayName = "TabItem";
|
|
7086
|
+
var TabItem_default = TabItem;
|
|
7087
|
+
|
|
7088
|
+
// src/components/Tab/Tab.tsx
|
|
7089
|
+
import { jsx as jsx315, jsxs as jsxs202 } from "react/jsx-runtime";
|
|
7090
|
+
var Tab = (props) => {
|
|
7091
|
+
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
7092
|
+
const [underlineStyle, setUnderlineStyle] = React12.useState({
|
|
7093
|
+
left: 0,
|
|
7094
|
+
width: 0
|
|
7095
|
+
});
|
|
7096
|
+
const itemRefs = React12.useRef([]);
|
|
7097
|
+
const handleChangeActiveTab = (tabItem, tabIdx) => {
|
|
7098
|
+
onChange(tabItem, tabIdx);
|
|
7099
|
+
};
|
|
7100
|
+
React12.useEffect(() => {
|
|
7101
|
+
const el = itemRefs.current[activeIndex];
|
|
7102
|
+
if (el) {
|
|
7103
|
+
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
7104
|
+
}
|
|
7105
|
+
}, [activeIndex, tabs.length]);
|
|
7106
|
+
return /* @__PURE__ */ jsxs202("div", { className: clsx_default("lib-xplat-tab", `type-${type}`, size), children: [
|
|
7107
|
+
tabs.map((tab, idx) => /* @__PURE__ */ jsx315(
|
|
7108
|
+
TabItem_default,
|
|
7109
|
+
{
|
|
7110
|
+
onClick: () => handleChangeActiveTab(tab, idx),
|
|
7111
|
+
isActive: activeIndex === idx,
|
|
7112
|
+
ref: (el) => {
|
|
7113
|
+
itemRefs.current[idx] = el;
|
|
7114
|
+
},
|
|
7115
|
+
title: tab.title
|
|
7116
|
+
},
|
|
7117
|
+
`${tab.value}_${idx}`
|
|
7118
|
+
)),
|
|
7119
|
+
type === "toggle" && /* @__PURE__ */ jsx315(
|
|
6925
7120
|
"div",
|
|
6926
7121
|
{
|
|
6927
|
-
className:
|
|
6928
|
-
|
|
6929
|
-
|
|
6930
|
-
|
|
6931
|
-
|
|
6932
|
-
className: clsx_default("lib-xplat-modal", "modal-box", stateClass),
|
|
6933
|
-
role: "dialog",
|
|
6934
|
-
"aria-modal": "true",
|
|
6935
|
-
onClick: (e) => e.stopPropagation(),
|
|
6936
|
-
children
|
|
6937
|
-
}
|
|
6938
|
-
)
|
|
7122
|
+
className: "tab-toggle-underline",
|
|
7123
|
+
style: {
|
|
7124
|
+
left: underlineStyle.left,
|
|
7125
|
+
width: underlineStyle.width
|
|
7126
|
+
}
|
|
6939
7127
|
}
|
|
6940
|
-
)
|
|
6941
|
-
|
|
6942
|
-
);
|
|
7128
|
+
)
|
|
7129
|
+
] });
|
|
6943
7130
|
};
|
|
6944
|
-
|
|
6945
|
-
var
|
|
7131
|
+
Tab.displayName = "Tab";
|
|
7132
|
+
var Tab_default = Tab;
|
|
6946
7133
|
|
|
6947
7134
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
6948
|
-
import
|
|
6949
|
-
import { jsx as jsx314, jsxs as jsxs202 } from "react/jsx-runtime";
|
|
6950
|
-
var RangeDayCell = React12.memo(
|
|
6951
|
-
({
|
|
6952
|
-
day,
|
|
6953
|
-
disabled,
|
|
6954
|
-
isStart,
|
|
6955
|
-
isEnd,
|
|
6956
|
-
inRange,
|
|
6957
|
-
onClick
|
|
6958
|
-
}) => /* @__PURE__ */ jsx314(
|
|
6959
|
-
"button",
|
|
6960
|
-
{
|
|
6961
|
-
type: "button",
|
|
6962
|
-
className: clsx_default(
|
|
6963
|
-
"datepicker-day",
|
|
6964
|
-
!day.isCurrentMonth && "outside",
|
|
6965
|
-
disabled && "disabled",
|
|
6966
|
-
(isStart || isEnd) && "selected",
|
|
6967
|
-
inRange && !isStart && !isEnd && "in-range",
|
|
6968
|
-
day.isToday && "today",
|
|
6969
|
-
day.isSunday && "sunday",
|
|
6970
|
-
day.isSaturday && "saturday"
|
|
6971
|
-
),
|
|
6972
|
-
disabled: disabled || !day.isCurrentMonth,
|
|
6973
|
-
onClick,
|
|
6974
|
-
children: day.day
|
|
6975
|
-
}
|
|
6976
|
-
)
|
|
6977
|
-
);
|
|
6978
|
-
RangeDayCell.displayName = "RangeDayCell";
|
|
7135
|
+
import { jsx as jsx316, jsxs as jsxs203 } from "react/jsx-runtime";
|
|
6979
7136
|
var RangePicker = (props) => {
|
|
6980
7137
|
const {
|
|
6981
7138
|
startDate,
|
|
@@ -6985,139 +7142,92 @@ var RangePicker = (props) => {
|
|
|
6985
7142
|
maxDate,
|
|
6986
7143
|
locale = "ko"
|
|
6987
7144
|
} = props;
|
|
6988
|
-
const [activeTab, setActiveTab] =
|
|
6989
|
-
const
|
|
6990
|
-
|
|
6991
|
-
|
|
6992
|
-
|
|
6993
|
-
if (minDate) {
|
|
6994
|
-
const min = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()).getTime();
|
|
6995
|
-
if (d < min) return true;
|
|
6996
|
-
}
|
|
6997
|
-
if (maxDate) {
|
|
6998
|
-
const max = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()).getTime();
|
|
6999
|
-
if (d > max) return true;
|
|
7000
|
-
}
|
|
7001
|
-
if (type === "end") {
|
|
7002
|
-
const start = new Date(startDate.getFullYear(), startDate.getMonth(), startDate.getDate()).getTime();
|
|
7003
|
-
if (d < start) return true;
|
|
7004
|
-
}
|
|
7005
|
-
if (type === "start") {
|
|
7006
|
-
const end = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate()).getTime();
|
|
7007
|
-
if (d > end) return true;
|
|
7008
|
-
}
|
|
7009
|
-
return false;
|
|
7145
|
+
const [activeTab, setActiveTab] = React13.useState("start");
|
|
7146
|
+
const handleStartChange = (date) => {
|
|
7147
|
+
if (!date) return;
|
|
7148
|
+
const newStart = date > endDate ? endDate : date;
|
|
7149
|
+
onChange?.({ startDate: newStart, endDate });
|
|
7010
7150
|
};
|
|
7011
|
-
const
|
|
7012
|
-
|
|
7013
|
-
const
|
|
7014
|
-
|
|
7015
|
-
/* @__PURE__ */ jsx314("span", { className: "datepicker-range-label", children: label }),
|
|
7016
|
-
/* @__PURE__ */ jsxs202("div", { className: "datepicker-header", children: [
|
|
7017
|
-
/* @__PURE__ */ jsx314(
|
|
7018
|
-
"button",
|
|
7019
|
-
{
|
|
7020
|
-
className: "datepicker-nav",
|
|
7021
|
-
onClick: cal.goToPrevMonth,
|
|
7022
|
-
type: "button",
|
|
7023
|
-
children: /* @__PURE__ */ jsx314(ChevronLeftIcon_default, {})
|
|
7024
|
-
}
|
|
7025
|
-
),
|
|
7026
|
-
/* @__PURE__ */ jsx314("span", { className: "datepicker-title", children: locale === "ko" ? `${cal.year}\uB144 ${MONTH_LABELS.ko[cal.month]}` : `${MONTH_LABELS.en[cal.month]} ${cal.year}` }),
|
|
7027
|
-
/* @__PURE__ */ jsx314(
|
|
7028
|
-
"button",
|
|
7029
|
-
{
|
|
7030
|
-
className: "datepicker-nav",
|
|
7031
|
-
onClick: cal.goToNextMonth,
|
|
7032
|
-
type: "button",
|
|
7033
|
-
children: /* @__PURE__ */ jsx314(ChevronRightIcon_default, {})
|
|
7034
|
-
}
|
|
7035
|
-
)
|
|
7036
|
-
] }),
|
|
7037
|
-
/* @__PURE__ */ jsx314("div", { className: "datepicker-weekdays", children: weekdays.map((w, i) => /* @__PURE__ */ jsx314(
|
|
7038
|
-
"div",
|
|
7039
|
-
{
|
|
7040
|
-
className: clsx_default(
|
|
7041
|
-
"datepicker-weekday",
|
|
7042
|
-
i === 0 && "sunday",
|
|
7043
|
-
i === 6 && "saturday"
|
|
7044
|
-
),
|
|
7045
|
-
children: w
|
|
7046
|
-
},
|
|
7047
|
-
w
|
|
7048
|
-
)) }),
|
|
7049
|
-
/* @__PURE__ */ jsx314("div", { className: "datepicker-grid", children: cal.days.map((day, idx) => {
|
|
7050
|
-
const disabled = isDisabled(day.date, type);
|
|
7051
|
-
const isStart = isSameDay(day.date, startDate);
|
|
7052
|
-
const isEnd = isSameDay(day.date, endDate);
|
|
7053
|
-
const inRange = isInRange(day.date, startDate, endDate);
|
|
7054
|
-
return /* @__PURE__ */ jsx314(
|
|
7055
|
-
RangeDayCell,
|
|
7056
|
-
{
|
|
7057
|
-
day,
|
|
7058
|
-
disabled,
|
|
7059
|
-
isStart,
|
|
7060
|
-
isEnd,
|
|
7061
|
-
inRange,
|
|
7062
|
-
onClick: () => {
|
|
7063
|
-
if (!disabled && day.isCurrentMonth) {
|
|
7064
|
-
if (type === "start") {
|
|
7065
|
-
const newStart = day.date > endDate ? endDate : day.date;
|
|
7066
|
-
onChange?.({ startDate: newStart, endDate });
|
|
7067
|
-
} else {
|
|
7068
|
-
const newEnd = day.date < startDate ? startDate : day.date;
|
|
7069
|
-
onChange?.({ startDate, endDate: newEnd });
|
|
7070
|
-
}
|
|
7071
|
-
}
|
|
7072
|
-
}
|
|
7073
|
-
},
|
|
7074
|
-
idx
|
|
7075
|
-
);
|
|
7076
|
-
}) })
|
|
7077
|
-
] });
|
|
7151
|
+
const handleEndChange = (date) => {
|
|
7152
|
+
if (!date) return;
|
|
7153
|
+
const newEnd = date < startDate ? startDate : date;
|
|
7154
|
+
onChange?.({ startDate, endDate: newEnd });
|
|
7078
7155
|
};
|
|
7079
|
-
|
|
7080
|
-
|
|
7081
|
-
|
|
7082
|
-
|
|
7083
|
-
|
|
7084
|
-
|
|
7085
|
-
|
|
7086
|
-
|
|
7087
|
-
|
|
7088
|
-
|
|
7089
|
-
|
|
7090
|
-
|
|
7091
|
-
|
|
7092
|
-
|
|
7093
|
-
|
|
7094
|
-
|
|
7095
|
-
|
|
7096
|
-
|
|
7097
|
-
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
|
|
7103
|
-
|
|
7104
|
-
|
|
7105
|
-
|
|
7106
|
-
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
|
|
7110
|
-
|
|
7111
|
-
|
|
7156
|
+
const startMaxDate = maxDate && endDate < maxDate ? endDate : endDate;
|
|
7157
|
+
const endMinDate = minDate && startDate > minDate ? startDate : startDate;
|
|
7158
|
+
return /* @__PURE__ */ jsxs203("div", { className: clsx_default("lib-xplat-datepicker", "range"), children: [
|
|
7159
|
+
/* @__PURE__ */ jsx316("div", { className: "datepicker-range-tabs", children: /* @__PURE__ */ jsx316(
|
|
7160
|
+
Tab_default,
|
|
7161
|
+
{
|
|
7162
|
+
activeIndex: activeTab === "start" ? 0 : 1,
|
|
7163
|
+
tabs: [
|
|
7164
|
+
{ value: "start", title: locale === "ko" ? "\uC2DC\uC791\uC77C" : "Start" },
|
|
7165
|
+
{ value: "end", title: locale === "ko" ? "\uC885\uB8CC\uC77C" : "End" }
|
|
7166
|
+
],
|
|
7167
|
+
onChange: (tab) => setActiveTab(tab.value),
|
|
7168
|
+
type: "toggle",
|
|
7169
|
+
size: "sm"
|
|
7170
|
+
}
|
|
7171
|
+
) }),
|
|
7172
|
+
/* @__PURE__ */ jsxs203("div", { className: "datepicker-range-panels", children: [
|
|
7173
|
+
/* @__PURE__ */ jsx316(
|
|
7174
|
+
SingleDatePicker_default,
|
|
7175
|
+
{
|
|
7176
|
+
value: startDate,
|
|
7177
|
+
onChange: handleStartChange,
|
|
7178
|
+
minDate,
|
|
7179
|
+
maxDate: startMaxDate,
|
|
7180
|
+
rangeStart: startDate,
|
|
7181
|
+
rangeEnd: endDate,
|
|
7182
|
+
locale
|
|
7183
|
+
}
|
|
7184
|
+
),
|
|
7185
|
+
/* @__PURE__ */ jsx316(
|
|
7186
|
+
SingleDatePicker_default,
|
|
7187
|
+
{
|
|
7188
|
+
value: endDate,
|
|
7189
|
+
onChange: handleEndChange,
|
|
7190
|
+
minDate: endMinDate,
|
|
7191
|
+
maxDate,
|
|
7192
|
+
rangeStart: startDate,
|
|
7193
|
+
rangeEnd: endDate,
|
|
7194
|
+
locale
|
|
7195
|
+
}
|
|
7196
|
+
)
|
|
7197
|
+
] }),
|
|
7198
|
+
/* @__PURE__ */ jsx316("div", { className: "datepicker-range-mobile", children: activeTab === "start" ? /* @__PURE__ */ jsx316(
|
|
7199
|
+
SingleDatePicker_default,
|
|
7200
|
+
{
|
|
7201
|
+
value: startDate,
|
|
7202
|
+
onChange: handleStartChange,
|
|
7203
|
+
minDate,
|
|
7204
|
+
maxDate: startMaxDate,
|
|
7205
|
+
rangeStart: startDate,
|
|
7206
|
+
rangeEnd: endDate,
|
|
7207
|
+
locale
|
|
7208
|
+
}
|
|
7209
|
+
) : /* @__PURE__ */ jsx316(
|
|
7210
|
+
SingleDatePicker_default,
|
|
7211
|
+
{
|
|
7212
|
+
value: endDate,
|
|
7213
|
+
onChange: handleEndChange,
|
|
7214
|
+
minDate: endMinDate,
|
|
7215
|
+
maxDate,
|
|
7216
|
+
rangeStart: startDate,
|
|
7217
|
+
rangeEnd: endDate,
|
|
7218
|
+
locale
|
|
7219
|
+
}
|
|
7220
|
+
) })
|
|
7221
|
+
] });
|
|
7112
7222
|
};
|
|
7113
7223
|
RangePicker.displayName = "RangePicker";
|
|
7114
7224
|
var RangePicker_default = RangePicker;
|
|
7115
7225
|
|
|
7116
7226
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
7117
|
-
import { jsx as
|
|
7227
|
+
import { jsx as jsx317, jsxs as jsxs204 } from "react/jsx-runtime";
|
|
7118
7228
|
var PopupPicker = (props) => {
|
|
7119
7229
|
const { component, type, locale } = props;
|
|
7120
|
-
const [isOpen, setIsOpen] =
|
|
7230
|
+
const [isOpen, setIsOpen] = React14.useState(false);
|
|
7121
7231
|
const handleClick = () => setIsOpen(true);
|
|
7122
7232
|
const handleClose = () => setIsOpen(false);
|
|
7123
7233
|
const handleSingleChange = (date) => {
|
|
@@ -7125,11 +7235,11 @@ var PopupPicker = (props) => {
|
|
|
7125
7235
|
props.onChange?.(date);
|
|
7126
7236
|
handleClose();
|
|
7127
7237
|
};
|
|
7128
|
-
return /* @__PURE__ */
|
|
7129
|
-
|
|
7130
|
-
/* @__PURE__ */
|
|
7131
|
-
/* @__PURE__ */
|
|
7132
|
-
type === "single" && /* @__PURE__ */
|
|
7238
|
+
return /* @__PURE__ */ jsxs204("div", { className: "lib-xplat-popup-datepicker", children: [
|
|
7239
|
+
React14.cloneElement(component, { onClick: handleClick }),
|
|
7240
|
+
/* @__PURE__ */ jsx317(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ jsxs204("div", { className: clsx_default("lib-xplat-popup-datepicker-card", type === "range" && "range-mode"), children: [
|
|
7241
|
+
/* @__PURE__ */ jsxs204("div", { className: "popup-datepicker-content", children: [
|
|
7242
|
+
type === "single" && /* @__PURE__ */ jsx317(
|
|
7133
7243
|
SingleDatePicker_default,
|
|
7134
7244
|
{
|
|
7135
7245
|
value: props.value,
|
|
@@ -7139,7 +7249,7 @@ var PopupPicker = (props) => {
|
|
|
7139
7249
|
locale
|
|
7140
7250
|
}
|
|
7141
7251
|
),
|
|
7142
|
-
type === "range" && /* @__PURE__ */
|
|
7252
|
+
type === "range" && /* @__PURE__ */ jsx317(
|
|
7143
7253
|
RangePicker_default,
|
|
7144
7254
|
{
|
|
7145
7255
|
startDate: props.startDate,
|
|
@@ -7151,8 +7261,8 @@ var PopupPicker = (props) => {
|
|
|
7151
7261
|
}
|
|
7152
7262
|
)
|
|
7153
7263
|
] }),
|
|
7154
|
-
/* @__PURE__ */
|
|
7155
|
-
/* @__PURE__ */
|
|
7264
|
+
/* @__PURE__ */ jsxs204("div", { className: "popup-datepicker-footer", children: [
|
|
7265
|
+
/* @__PURE__ */ jsx317(
|
|
7156
7266
|
Button_default,
|
|
7157
7267
|
{
|
|
7158
7268
|
type: "secondary",
|
|
@@ -7160,7 +7270,7 @@ var PopupPicker = (props) => {
|
|
|
7160
7270
|
children: locale === "ko" ? "\uCDE8\uC18C" : "Cancel"
|
|
7161
7271
|
}
|
|
7162
7272
|
),
|
|
7163
|
-
/* @__PURE__ */
|
|
7273
|
+
/* @__PURE__ */ jsx317(Button_default, { type: "primary", onClick: handleClose, children: locale === "ko" ? "\uC801\uC6A9" : "Apply" })
|
|
7164
7274
|
] })
|
|
7165
7275
|
] }) })
|
|
7166
7276
|
] });
|
|
@@ -7169,10 +7279,10 @@ PopupPicker.displayName = "PopupPicker";
|
|
|
7169
7279
|
var PopupPicker_default = PopupPicker;
|
|
7170
7280
|
|
|
7171
7281
|
// src/components/Divider/Divider.tsx
|
|
7172
|
-
import { jsx as
|
|
7282
|
+
import { jsx as jsx318 } from "react/jsx-runtime";
|
|
7173
7283
|
var Divider = (props) => {
|
|
7174
7284
|
const { orientation = "horizontal" } = props;
|
|
7175
|
-
return /* @__PURE__ */
|
|
7285
|
+
return /* @__PURE__ */ jsx318(
|
|
7176
7286
|
"div",
|
|
7177
7287
|
{
|
|
7178
7288
|
className: clsx_default("lib-xplat-divider", orientation),
|
|
@@ -7185,15 +7295,15 @@ Divider.displayName = "Divider";
|
|
|
7185
7295
|
var Divider_default = Divider;
|
|
7186
7296
|
|
|
7187
7297
|
// src/components/Drawer/Drawer.tsx
|
|
7188
|
-
import
|
|
7298
|
+
import React15 from "react";
|
|
7189
7299
|
import { createPortal as createPortal2 } from "react-dom";
|
|
7190
|
-
import { jsx as
|
|
7300
|
+
import { jsx as jsx319, jsxs as jsxs205 } from "react/jsx-runtime";
|
|
7191
7301
|
var ANIMATION_DURATION_MS2 = 250;
|
|
7192
7302
|
var Drawer = (props) => {
|
|
7193
7303
|
const { isOpen, onClose, placement = "right", width = 320, title, children } = props;
|
|
7194
|
-
const [mounted, setMounted] =
|
|
7195
|
-
const [visible, setVisible] =
|
|
7196
|
-
|
|
7304
|
+
const [mounted, setMounted] = React15.useState(false);
|
|
7305
|
+
const [visible, setVisible] = React15.useState(false);
|
|
7306
|
+
React15.useEffect(() => {
|
|
7197
7307
|
if (isOpen) {
|
|
7198
7308
|
setMounted(true);
|
|
7199
7309
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -7208,12 +7318,12 @@ var Drawer = (props) => {
|
|
|
7208
7318
|
const stateClass = visible ? "enter" : "exit";
|
|
7209
7319
|
const widthValue = typeof width === "number" ? `${width}px` : width;
|
|
7210
7320
|
return createPortal2(
|
|
7211
|
-
/* @__PURE__ */
|
|
7321
|
+
/* @__PURE__ */ jsx319(
|
|
7212
7322
|
"div",
|
|
7213
7323
|
{
|
|
7214
7324
|
className: clsx_default("lib-xplat-drawer-overlay", stateClass),
|
|
7215
7325
|
onClick: onClose,
|
|
7216
|
-
children: /* @__PURE__ */
|
|
7326
|
+
children: /* @__PURE__ */ jsxs205(
|
|
7217
7327
|
"div",
|
|
7218
7328
|
{
|
|
7219
7329
|
className: clsx_default("lib-xplat-drawer", placement, stateClass),
|
|
@@ -7222,11 +7332,11 @@ var Drawer = (props) => {
|
|
|
7222
7332
|
"aria-modal": "true",
|
|
7223
7333
|
onClick: (e) => e.stopPropagation(),
|
|
7224
7334
|
children: [
|
|
7225
|
-
title && /* @__PURE__ */
|
|
7226
|
-
/* @__PURE__ */
|
|
7227
|
-
/* @__PURE__ */
|
|
7335
|
+
title && /* @__PURE__ */ jsxs205("div", { className: "drawer-header", children: [
|
|
7336
|
+
/* @__PURE__ */ jsx319("span", { className: "drawer-title", children: title }),
|
|
7337
|
+
/* @__PURE__ */ jsx319("button", { className: "close-btn", onClick: onClose, "aria-label": "\uB2EB\uAE30", children: "\xD7" })
|
|
7228
7338
|
] }),
|
|
7229
|
-
/* @__PURE__ */
|
|
7339
|
+
/* @__PURE__ */ jsx319("div", { className: "drawer-body", children })
|
|
7230
7340
|
]
|
|
7231
7341
|
}
|
|
7232
7342
|
)
|
|
@@ -7239,16 +7349,16 @@ Drawer.displayName = "Drawer";
|
|
|
7239
7349
|
var Drawer_default = Drawer;
|
|
7240
7350
|
|
|
7241
7351
|
// src/components/Dropdown/Dropdown.tsx
|
|
7242
|
-
import
|
|
7352
|
+
import React18 from "react";
|
|
7243
7353
|
|
|
7244
7354
|
// src/tokens/hooks/useAutoPosition.ts
|
|
7245
|
-
import
|
|
7355
|
+
import React16 from "react";
|
|
7246
7356
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
7247
|
-
const [position, setPosition] =
|
|
7357
|
+
const [position, setPosition] = React16.useState({
|
|
7248
7358
|
position: {},
|
|
7249
7359
|
direction: "bottom"
|
|
7250
7360
|
});
|
|
7251
|
-
const calculatePosition =
|
|
7361
|
+
const calculatePosition = React16.useCallback(() => {
|
|
7252
7362
|
if (!triggerRef.current || !popRef.current) return;
|
|
7253
7363
|
const triggerRect = triggerRef.current.getBoundingClientRect();
|
|
7254
7364
|
const popRect = popRef.current.getBoundingClientRect();
|
|
@@ -7270,7 +7380,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
7270
7380
|
direction
|
|
7271
7381
|
});
|
|
7272
7382
|
}, [triggerRef, popRef]);
|
|
7273
|
-
|
|
7383
|
+
React16.useEffect(() => {
|
|
7274
7384
|
calculatePosition();
|
|
7275
7385
|
window.addEventListener("resize", calculatePosition);
|
|
7276
7386
|
return () => window.removeEventListener("resize", calculatePosition);
|
|
@@ -7279,18 +7389,43 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
7279
7389
|
};
|
|
7280
7390
|
var useAutoPosition_default = useAutoPosition;
|
|
7281
7391
|
|
|
7392
|
+
// src/tokens/hooks/useClickOutside.ts
|
|
7393
|
+
import React17 from "react";
|
|
7394
|
+
var useClickOutside = (refs, handler, enabled = true) => {
|
|
7395
|
+
React17.useEffect(() => {
|
|
7396
|
+
if (!enabled) return;
|
|
7397
|
+
const refArray = Array.isArray(refs) ? refs : [refs];
|
|
7398
|
+
const listener = (event) => {
|
|
7399
|
+
const target = event.target;
|
|
7400
|
+
const isInside = refArray.some(
|
|
7401
|
+
(ref) => ref.current && ref.current.contains(target)
|
|
7402
|
+
);
|
|
7403
|
+
if (!isInside) {
|
|
7404
|
+
handler();
|
|
7405
|
+
}
|
|
7406
|
+
};
|
|
7407
|
+
document.addEventListener("mousedown", listener);
|
|
7408
|
+
document.addEventListener("touchstart", listener);
|
|
7409
|
+
return () => {
|
|
7410
|
+
document.removeEventListener("mousedown", listener);
|
|
7411
|
+
document.removeEventListener("touchstart", listener);
|
|
7412
|
+
};
|
|
7413
|
+
}, [refs, handler, enabled]);
|
|
7414
|
+
};
|
|
7415
|
+
var useClickOutside_default = useClickOutside;
|
|
7416
|
+
|
|
7282
7417
|
// src/components/Dropdown/Dropdown.tsx
|
|
7283
|
-
import { jsx as
|
|
7418
|
+
import { jsx as jsx320, jsxs as jsxs206 } from "react/jsx-runtime";
|
|
7284
7419
|
var Dropdown = (props) => {
|
|
7285
7420
|
const { items, children } = props;
|
|
7286
|
-
const [isOpen, setIsOpen] =
|
|
7287
|
-
const [mounted, setMounted] =
|
|
7288
|
-
const [visible, setVisible] =
|
|
7289
|
-
const triggerRef =
|
|
7290
|
-
const menuRef =
|
|
7421
|
+
const [isOpen, setIsOpen] = React18.useState(false);
|
|
7422
|
+
const [mounted, setMounted] = React18.useState(false);
|
|
7423
|
+
const [visible, setVisible] = React18.useState(false);
|
|
7424
|
+
const triggerRef = React18.useRef(null);
|
|
7425
|
+
const menuRef = React18.useRef(null);
|
|
7291
7426
|
const { position, direction } = useAutoPosition_default(triggerRef, menuRef, isOpen);
|
|
7292
7427
|
useClickOutside_default([triggerRef, menuRef], () => setIsOpen(false));
|
|
7293
|
-
|
|
7428
|
+
React18.useEffect(() => {
|
|
7294
7429
|
if (isOpen) {
|
|
7295
7430
|
setMounted(true);
|
|
7296
7431
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -7305,8 +7440,8 @@ var Dropdown = (props) => {
|
|
|
7305
7440
|
item.onClick?.();
|
|
7306
7441
|
setIsOpen(false);
|
|
7307
7442
|
};
|
|
7308
|
-
return /* @__PURE__ */
|
|
7309
|
-
/* @__PURE__ */
|
|
7443
|
+
return /* @__PURE__ */ jsxs206("div", { className: "lib-xplat-dropdown", children: [
|
|
7444
|
+
/* @__PURE__ */ jsx320(
|
|
7310
7445
|
"div",
|
|
7311
7446
|
{
|
|
7312
7447
|
ref: triggerRef,
|
|
@@ -7315,14 +7450,14 @@ var Dropdown = (props) => {
|
|
|
7315
7450
|
children
|
|
7316
7451
|
}
|
|
7317
7452
|
),
|
|
7318
|
-
mounted && /* @__PURE__ */
|
|
7453
|
+
mounted && /* @__PURE__ */ jsx320(
|
|
7319
7454
|
"div",
|
|
7320
7455
|
{
|
|
7321
7456
|
ref: menuRef,
|
|
7322
7457
|
className: clsx_default("dropdown-menu", direction, { visible }),
|
|
7323
7458
|
style: { top: position.top, left: position.left },
|
|
7324
7459
|
role: "menu",
|
|
7325
|
-
children: items.map((item) => /* @__PURE__ */
|
|
7460
|
+
children: items.map((item) => /* @__PURE__ */ jsx320(
|
|
7326
7461
|
"button",
|
|
7327
7462
|
{
|
|
7328
7463
|
className: clsx_default("dropdown-item", {
|
|
@@ -7344,23 +7479,23 @@ Dropdown.displayName = "Dropdown";
|
|
|
7344
7479
|
var Dropdown_default = Dropdown;
|
|
7345
7480
|
|
|
7346
7481
|
// src/components/EmptyState/EmptyState.tsx
|
|
7347
|
-
import { jsx as
|
|
7482
|
+
import { jsx as jsx321, jsxs as jsxs207 } from "react/jsx-runtime";
|
|
7348
7483
|
var EmptyState = (props) => {
|
|
7349
7484
|
const { icon, title = "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4", description, action } = props;
|
|
7350
|
-
return /* @__PURE__ */
|
|
7351
|
-
icon && /* @__PURE__ */
|
|
7352
|
-
!icon && /* @__PURE__ */
|
|
7353
|
-
/* @__PURE__ */
|
|
7354
|
-
description && /* @__PURE__ */
|
|
7355
|
-
action && /* @__PURE__ */
|
|
7485
|
+
return /* @__PURE__ */ jsxs207("div", { className: "lib-xplat-empty-state", children: [
|
|
7486
|
+
icon && /* @__PURE__ */ jsx321("div", { className: "empty-icon", children: icon }),
|
|
7487
|
+
!icon && /* @__PURE__ */ jsx321("div", { className: "empty-icon", children: /* @__PURE__ */ jsx321("svg", { viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx321("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" }) }) }),
|
|
7488
|
+
/* @__PURE__ */ jsx321("p", { className: "empty-title", children: title }),
|
|
7489
|
+
description && /* @__PURE__ */ jsx321("p", { className: "empty-description", children: description }),
|
|
7490
|
+
action && /* @__PURE__ */ jsx321("div", { className: "empty-action", children: action })
|
|
7356
7491
|
] });
|
|
7357
7492
|
};
|
|
7358
7493
|
EmptyState.displayName = "EmptyState";
|
|
7359
7494
|
var EmptyState_default = EmptyState;
|
|
7360
7495
|
|
|
7361
7496
|
// src/components/FileUpload/FileUpload.tsx
|
|
7362
|
-
import
|
|
7363
|
-
import { jsx as
|
|
7497
|
+
import React19 from "react";
|
|
7498
|
+
import { jsx as jsx322, jsxs as jsxs208 } from "react/jsx-runtime";
|
|
7364
7499
|
var FileUpload = (props) => {
|
|
7365
7500
|
const {
|
|
7366
7501
|
accept,
|
|
@@ -7370,8 +7505,8 @@ var FileUpload = (props) => {
|
|
|
7370
7505
|
label = "\uD30C\uC77C\uC744 \uB4DC\uB798\uADF8\uD558\uAC70\uB098 \uD074\uB9AD\uD558\uC5EC \uC5C5\uB85C\uB4DC",
|
|
7371
7506
|
description
|
|
7372
7507
|
} = props;
|
|
7373
|
-
const [isDragOver, setIsDragOver] =
|
|
7374
|
-
const inputRef =
|
|
7508
|
+
const [isDragOver, setIsDragOver] = React19.useState(false);
|
|
7509
|
+
const inputRef = React19.useRef(null);
|
|
7375
7510
|
const handleFiles = (fileList) => {
|
|
7376
7511
|
let files = Array.from(fileList);
|
|
7377
7512
|
if (maxSize) {
|
|
@@ -7401,7 +7536,7 @@ var FileUpload = (props) => {
|
|
|
7401
7536
|
handleFiles(e.target.files);
|
|
7402
7537
|
}
|
|
7403
7538
|
};
|
|
7404
|
-
return /* @__PURE__ */
|
|
7539
|
+
return /* @__PURE__ */ jsxs208(
|
|
7405
7540
|
"div",
|
|
7406
7541
|
{
|
|
7407
7542
|
className: clsx_default("lib-xplat-file-upload", { "drag-over": isDragOver }),
|
|
@@ -7410,7 +7545,7 @@ var FileUpload = (props) => {
|
|
|
7410
7545
|
onDragLeave: handleDragLeave,
|
|
7411
7546
|
onClick: () => inputRef.current?.click(),
|
|
7412
7547
|
children: [
|
|
7413
|
-
/* @__PURE__ */
|
|
7548
|
+
/* @__PURE__ */ jsx322(
|
|
7414
7549
|
"input",
|
|
7415
7550
|
{
|
|
7416
7551
|
ref: inputRef,
|
|
@@ -7420,9 +7555,9 @@ var FileUpload = (props) => {
|
|
|
7420
7555
|
onChange: handleChange
|
|
7421
7556
|
}
|
|
7422
7557
|
),
|
|
7423
|
-
/* @__PURE__ */
|
|
7424
|
-
/* @__PURE__ */
|
|
7425
|
-
description && /* @__PURE__ */
|
|
7558
|
+
/* @__PURE__ */ jsx322("div", { className: "upload-icon", children: /* @__PURE__ */ jsx322(UploadIcon_default, {}) }),
|
|
7559
|
+
/* @__PURE__ */ jsx322("p", { className: "upload-label", children: label }),
|
|
7560
|
+
description && /* @__PURE__ */ jsx322("p", { className: "upload-description", children: description })
|
|
7426
7561
|
]
|
|
7427
7562
|
}
|
|
7428
7563
|
);
|
|
@@ -7431,10 +7566,10 @@ FileUpload.displayName = "FileUpload";
|
|
|
7431
7566
|
var FileUpload_default = FileUpload;
|
|
7432
7567
|
|
|
7433
7568
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
7434
|
-
import
|
|
7569
|
+
import React21 from "react";
|
|
7435
7570
|
|
|
7436
7571
|
// src/components/HtmlTypeWriter/utils.ts
|
|
7437
|
-
import
|
|
7572
|
+
import React20 from "react";
|
|
7438
7573
|
var voidTags = /* @__PURE__ */ new Set([
|
|
7439
7574
|
"br",
|
|
7440
7575
|
"img",
|
|
@@ -7502,41 +7637,41 @@ var convertNodeToReactWithRange = (node, typedLen, rangeMap) => {
|
|
|
7502
7637
|
props[attr.name] = attr.value;
|
|
7503
7638
|
});
|
|
7504
7639
|
if (voidTags.has(tag)) {
|
|
7505
|
-
return
|
|
7640
|
+
return React20.createElement(tag, props);
|
|
7506
7641
|
}
|
|
7507
7642
|
const children = Array.from(element.childNodes).map((child) => convertNodeToReactWithRange(child, typedLen, rangeMap)).filter((n) => n != null);
|
|
7508
|
-
return
|
|
7643
|
+
return React20.createElement(tag, props, ...children);
|
|
7509
7644
|
};
|
|
7510
7645
|
var htmlToReactProgressive = (root, typedLen, rangeMap) => {
|
|
7511
7646
|
const nodes = Array.from(root.childNodes).map((child, idx) => {
|
|
7512
7647
|
const node = convertNodeToReactWithRange(child, typedLen, rangeMap);
|
|
7513
|
-
return node == null ? null :
|
|
7648
|
+
return node == null ? null : React20.createElement(React20.Fragment, { key: idx }, node);
|
|
7514
7649
|
}).filter(Boolean);
|
|
7515
7650
|
return nodes.length === 0 ? null : nodes;
|
|
7516
7651
|
};
|
|
7517
7652
|
|
|
7518
7653
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
7519
|
-
import { jsx as
|
|
7654
|
+
import { jsx as jsx323 } from "react/jsx-runtime";
|
|
7520
7655
|
var HtmlTypeWriter = ({
|
|
7521
7656
|
html,
|
|
7522
7657
|
duration = 20,
|
|
7523
7658
|
onDone,
|
|
7524
7659
|
onChange
|
|
7525
7660
|
}) => {
|
|
7526
|
-
const [typedLen, setTypedLen] =
|
|
7527
|
-
const doneCalledRef =
|
|
7528
|
-
const { doc, rangeMap, totalLength } =
|
|
7661
|
+
const [typedLen, setTypedLen] = React21.useState(0);
|
|
7662
|
+
const doneCalledRef = React21.useRef(false);
|
|
7663
|
+
const { doc, rangeMap, totalLength } = React21.useMemo(() => {
|
|
7529
7664
|
if (typeof window === "undefined") return { doc: null, rangeMap: /* @__PURE__ */ new Map(), totalLength: 0 };
|
|
7530
7665
|
const decoded = decodeHtmlEntities(html);
|
|
7531
7666
|
const doc2 = new DOMParser().parseFromString(decoded, "text/html");
|
|
7532
7667
|
const { rangeMap: rangeMap2, totalLength: totalLength2 } = buildRangeMap(doc2.body);
|
|
7533
7668
|
return { doc: doc2, rangeMap: rangeMap2, totalLength: totalLength2 };
|
|
7534
7669
|
}, [html]);
|
|
7535
|
-
|
|
7670
|
+
React21.useEffect(() => {
|
|
7536
7671
|
setTypedLen(0);
|
|
7537
7672
|
doneCalledRef.current = false;
|
|
7538
7673
|
}, [html]);
|
|
7539
|
-
|
|
7674
|
+
React21.useEffect(() => {
|
|
7540
7675
|
if (!totalLength) return;
|
|
7541
7676
|
if (typedLen >= totalLength) return;
|
|
7542
7677
|
const timer = window.setInterval(() => {
|
|
@@ -7544,33 +7679,33 @@ var HtmlTypeWriter = ({
|
|
|
7544
7679
|
}, duration);
|
|
7545
7680
|
return () => window.clearInterval(timer);
|
|
7546
7681
|
}, [typedLen, totalLength, duration]);
|
|
7547
|
-
|
|
7682
|
+
React21.useEffect(() => {
|
|
7548
7683
|
if (typedLen > 0 && typedLen < totalLength) {
|
|
7549
7684
|
onChange?.();
|
|
7550
7685
|
}
|
|
7551
7686
|
}, [typedLen, totalLength, onChange]);
|
|
7552
|
-
|
|
7687
|
+
React21.useEffect(() => {
|
|
7553
7688
|
if (typedLen === totalLength && totalLength > 0 && !doneCalledRef.current) {
|
|
7554
7689
|
doneCalledRef.current = true;
|
|
7555
7690
|
onDone?.();
|
|
7556
7691
|
}
|
|
7557
7692
|
}, [typedLen, totalLength, onDone]);
|
|
7558
|
-
const parsed =
|
|
7693
|
+
const parsed = React21.useMemo(
|
|
7559
7694
|
() => doc ? htmlToReactProgressive(doc.body, typedLen, rangeMap) : null,
|
|
7560
7695
|
[doc, typedLen, rangeMap]
|
|
7561
7696
|
);
|
|
7562
|
-
return /* @__PURE__ */
|
|
7697
|
+
return /* @__PURE__ */ jsx323("div", { className: "lib-xplat-htmlTypewriter", children: parsed });
|
|
7563
7698
|
};
|
|
7564
7699
|
HtmlTypeWriter.displayName = "HtmlTypeWriter";
|
|
7565
7700
|
var HtmlTypeWriter_default = HtmlTypeWriter;
|
|
7566
7701
|
|
|
7567
7702
|
// src/components/ImageSelector/ImageSelector.tsx
|
|
7568
|
-
import
|
|
7569
|
-
import { jsx as
|
|
7703
|
+
import React22 from "react";
|
|
7704
|
+
import { jsx as jsx324, jsxs as jsxs209 } from "react/jsx-runtime";
|
|
7570
7705
|
var ImageSelector = (props) => {
|
|
7571
7706
|
const { value, label, onChange } = props;
|
|
7572
|
-
const [previewUrl, setPreviewUrl] =
|
|
7573
|
-
|
|
7707
|
+
const [previewUrl, setPreviewUrl] = React22.useState();
|
|
7708
|
+
React22.useEffect(() => {
|
|
7574
7709
|
if (!value) {
|
|
7575
7710
|
setPreviewUrl(void 0);
|
|
7576
7711
|
return;
|
|
@@ -7579,7 +7714,7 @@ var ImageSelector = (props) => {
|
|
|
7579
7714
|
setPreviewUrl(url);
|
|
7580
7715
|
return () => URL.revokeObjectURL(url);
|
|
7581
7716
|
}, [value]);
|
|
7582
|
-
const inputRef =
|
|
7717
|
+
const inputRef = React22.useRef(null);
|
|
7583
7718
|
const handleFileChange = (e) => {
|
|
7584
7719
|
const selectedFile = e.target.files?.[0];
|
|
7585
7720
|
if (selectedFile) {
|
|
@@ -7592,8 +7727,8 @@ var ImageSelector = (props) => {
|
|
|
7592
7727
|
const handleOpenFileDialog = () => {
|
|
7593
7728
|
inputRef.current?.click();
|
|
7594
7729
|
};
|
|
7595
|
-
return /* @__PURE__ */
|
|
7596
|
-
/* @__PURE__ */
|
|
7730
|
+
return /* @__PURE__ */ jsxs209("div", { className: `lib-xplat-imageselector${value ? "" : " none-value"}`, children: [
|
|
7731
|
+
/* @__PURE__ */ jsx324(
|
|
7597
7732
|
"input",
|
|
7598
7733
|
{
|
|
7599
7734
|
type: "file",
|
|
@@ -7603,13 +7738,13 @@ var ImageSelector = (props) => {
|
|
|
7603
7738
|
ref: inputRef
|
|
7604
7739
|
}
|
|
7605
7740
|
),
|
|
7606
|
-
value && /* @__PURE__ */
|
|
7607
|
-
/* @__PURE__ */
|
|
7608
|
-
/* @__PURE__ */
|
|
7741
|
+
value && /* @__PURE__ */ jsxs209("div", { className: "action-bar", children: [
|
|
7742
|
+
/* @__PURE__ */ jsx324("div", { className: "icon-wrapper", onClick: handleOpenFileDialog, children: /* @__PURE__ */ jsx324(UploadIcon_default, {}) }),
|
|
7743
|
+
/* @__PURE__ */ jsx324("div", { className: "icon-wrapper", onClick: handleDeleteFile, children: /* @__PURE__ */ jsx324(DeleteIcon_default, {}) })
|
|
7609
7744
|
] }),
|
|
7610
|
-
/* @__PURE__ */
|
|
7611
|
-
/* @__PURE__ */
|
|
7612
|
-
/* @__PURE__ */
|
|
7745
|
+
/* @__PURE__ */ jsx324("div", { className: "content", children: previewUrl ? /* @__PURE__ */ jsx324("img", { src: previewUrl, alt: "preview" }) : /* @__PURE__ */ jsxs209("div", { className: "skeleton", onClick: handleOpenFileDialog, children: [
|
|
7746
|
+
/* @__PURE__ */ jsx324("div", { className: "icon-wrapper", children: /* @__PURE__ */ jsx324(ImageIcon_default, {}) }),
|
|
7747
|
+
/* @__PURE__ */ jsx324("div", { className: "label", children: label || "\uC774\uBBF8\uC9C0 \uCD94\uAC00\uD558\uAE30" })
|
|
7613
7748
|
] }) })
|
|
7614
7749
|
] });
|
|
7615
7750
|
};
|
|
@@ -7617,7 +7752,7 @@ ImageSelector.displayName = "ImageSelector";
|
|
|
7617
7752
|
var ImageSelector_default = ImageSelector;
|
|
7618
7753
|
|
|
7619
7754
|
// src/components/Pagination/Pagination.tsx
|
|
7620
|
-
import { jsx as
|
|
7755
|
+
import { jsx as jsx325, jsxs as jsxs210 } from "react/jsx-runtime";
|
|
7621
7756
|
var getPageRange = (current, totalPages, siblingCount) => {
|
|
7622
7757
|
const totalNumbers = siblingCount * 2 + 5;
|
|
7623
7758
|
if (totalPages <= totalNumbers) {
|
|
@@ -7660,19 +7795,19 @@ var Pagination = (props) => {
|
|
|
7660
7795
|
onChange?.(page);
|
|
7661
7796
|
}
|
|
7662
7797
|
};
|
|
7663
|
-
return /* @__PURE__ */
|
|
7664
|
-
/* @__PURE__ */
|
|
7798
|
+
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__ */ jsx325(
|
|
7665
7800
|
"button",
|
|
7666
7801
|
{
|
|
7667
7802
|
className: "page-btn prev",
|
|
7668
7803
|
disabled: current <= 1,
|
|
7669
7804
|
onClick: () => handleClick(current - 1),
|
|
7670
7805
|
"aria-label": "\uC774\uC804 \uD398\uC774\uC9C0",
|
|
7671
|
-
children: /* @__PURE__ */
|
|
7806
|
+
children: /* @__PURE__ */ jsx325(ChevronLeftIcon_default, {})
|
|
7672
7807
|
}
|
|
7673
7808
|
),
|
|
7674
7809
|
pages.map(
|
|
7675
|
-
(page, i) => page === "..." ? /* @__PURE__ */
|
|
7810
|
+
(page, i) => page === "..." ? /* @__PURE__ */ jsx325("span", { className: "dots", children: "..." }, `dots-${i}`) : /* @__PURE__ */ jsx325(
|
|
7676
7811
|
"button",
|
|
7677
7812
|
{
|
|
7678
7813
|
className: clsx_default("page-btn", { active: page === current }),
|
|
@@ -7683,14 +7818,14 @@ var Pagination = (props) => {
|
|
|
7683
7818
|
page
|
|
7684
7819
|
)
|
|
7685
7820
|
),
|
|
7686
|
-
/* @__PURE__ */
|
|
7821
|
+
/* @__PURE__ */ jsx325(
|
|
7687
7822
|
"button",
|
|
7688
7823
|
{
|
|
7689
7824
|
className: "page-btn next",
|
|
7690
7825
|
disabled: current >= totalPages,
|
|
7691
7826
|
onClick: () => handleClick(current + 1),
|
|
7692
7827
|
"aria-label": "\uB2E4\uC74C \uD398\uC774\uC9C0",
|
|
7693
|
-
children: /* @__PURE__ */
|
|
7828
|
+
children: /* @__PURE__ */ jsx325(ChevronRightIcon_default, {})
|
|
7694
7829
|
}
|
|
7695
7830
|
)
|
|
7696
7831
|
] });
|
|
@@ -7699,17 +7834,17 @@ Pagination.displayName = "Pagination";
|
|
|
7699
7834
|
var Pagination_default = Pagination;
|
|
7700
7835
|
|
|
7701
7836
|
// src/components/PopOver/PopOver.tsx
|
|
7702
|
-
import
|
|
7703
|
-
import { jsx as
|
|
7837
|
+
import React23 from "react";
|
|
7838
|
+
import { jsx as jsx326, jsxs as jsxs211 } from "react/jsx-runtime";
|
|
7704
7839
|
var PopOver = (props) => {
|
|
7705
7840
|
const { children, isOpen, onClose, PopOverEl } = props;
|
|
7706
|
-
const popRef =
|
|
7707
|
-
const triggerRef =
|
|
7708
|
-
const [localOpen, setLocalOpen] =
|
|
7709
|
-
const [eventTrigger, setEventTrigger] =
|
|
7841
|
+
const popRef = React23.useRef(null);
|
|
7842
|
+
const triggerRef = React23.useRef(null);
|
|
7843
|
+
const [localOpen, setLocalOpen] = React23.useState(false);
|
|
7844
|
+
const [eventTrigger, setEventTrigger] = React23.useState(false);
|
|
7710
7845
|
useClickOutside_default([popRef, triggerRef], onClose, isOpen);
|
|
7711
7846
|
const position = useAutoPosition_default(triggerRef, popRef, localOpen);
|
|
7712
|
-
|
|
7847
|
+
React23.useEffect(() => {
|
|
7713
7848
|
if (isOpen) {
|
|
7714
7849
|
setLocalOpen(isOpen);
|
|
7715
7850
|
setTimeout(() => {
|
|
@@ -7722,7 +7857,7 @@ var PopOver = (props) => {
|
|
|
7722
7857
|
}, 200);
|
|
7723
7858
|
}
|
|
7724
7859
|
}, [isOpen]);
|
|
7725
|
-
return /* @__PURE__ */
|
|
7860
|
+
return /* @__PURE__ */ jsxs211(
|
|
7726
7861
|
"div",
|
|
7727
7862
|
{
|
|
7728
7863
|
className: "lib-xplat-pop-over",
|
|
@@ -7732,7 +7867,7 @@ var PopOver = (props) => {
|
|
|
7732
7867
|
},
|
|
7733
7868
|
children: [
|
|
7734
7869
|
children,
|
|
7735
|
-
localOpen && /* @__PURE__ */
|
|
7870
|
+
localOpen && /* @__PURE__ */ jsx326(
|
|
7736
7871
|
"div",
|
|
7737
7872
|
{
|
|
7738
7873
|
className: clsx_default(
|
|
@@ -7755,7 +7890,7 @@ PopOver.displayName = "PopOver";
|
|
|
7755
7890
|
var PopOver_default = PopOver;
|
|
7756
7891
|
|
|
7757
7892
|
// src/components/Progress/Progress.tsx
|
|
7758
|
-
import { jsx as
|
|
7893
|
+
import { jsx as jsx327, jsxs as jsxs212 } from "react/jsx-runtime";
|
|
7759
7894
|
var Progress = (props) => {
|
|
7760
7895
|
const {
|
|
7761
7896
|
value,
|
|
@@ -7765,8 +7900,8 @@ var Progress = (props) => {
|
|
|
7765
7900
|
showLabel = false
|
|
7766
7901
|
} = props;
|
|
7767
7902
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
7768
|
-
return /* @__PURE__ */
|
|
7769
|
-
/* @__PURE__ */
|
|
7903
|
+
return /* @__PURE__ */ jsxs212("div", { className: clsx_default("lib-xplat-progress", size, type), children: [
|
|
7904
|
+
/* @__PURE__ */ jsx327(
|
|
7770
7905
|
"div",
|
|
7771
7906
|
{
|
|
7772
7907
|
className: "track",
|
|
@@ -7774,7 +7909,7 @@ var Progress = (props) => {
|
|
|
7774
7909
|
"aria-valuenow": value,
|
|
7775
7910
|
"aria-valuemin": 0,
|
|
7776
7911
|
"aria-valuemax": max,
|
|
7777
|
-
children: /* @__PURE__ */
|
|
7912
|
+
children: /* @__PURE__ */ jsx327(
|
|
7778
7913
|
"div",
|
|
7779
7914
|
{
|
|
7780
7915
|
className: "bar",
|
|
@@ -7783,7 +7918,7 @@ var Progress = (props) => {
|
|
|
7783
7918
|
)
|
|
7784
7919
|
}
|
|
7785
7920
|
),
|
|
7786
|
-
showLabel && /* @__PURE__ */
|
|
7921
|
+
showLabel && /* @__PURE__ */ jsxs212("span", { className: "label", children: [
|
|
7787
7922
|
Math.round(percentage),
|
|
7788
7923
|
"%"
|
|
7789
7924
|
] })
|
|
@@ -7793,17 +7928,17 @@ Progress.displayName = "Progress";
|
|
|
7793
7928
|
var Progress_default = Progress;
|
|
7794
7929
|
|
|
7795
7930
|
// src/components/Radio/RadioGroupContext.tsx
|
|
7796
|
-
import
|
|
7797
|
-
var RadioGroupContext =
|
|
7931
|
+
import React24 from "react";
|
|
7932
|
+
var RadioGroupContext = React24.createContext(
|
|
7798
7933
|
null
|
|
7799
7934
|
);
|
|
7800
7935
|
var useRadioGroupContext = () => {
|
|
7801
|
-
return
|
|
7936
|
+
return React24.useContext(RadioGroupContext);
|
|
7802
7937
|
};
|
|
7803
7938
|
var RadioGroupContext_default = RadioGroupContext;
|
|
7804
7939
|
|
|
7805
7940
|
// src/components/Radio/Radio.tsx
|
|
7806
|
-
import { jsx as
|
|
7941
|
+
import { jsx as jsx328, jsxs as jsxs213 } from "react/jsx-runtime";
|
|
7807
7942
|
var Radio = (props) => {
|
|
7808
7943
|
const {
|
|
7809
7944
|
label,
|
|
@@ -7821,7 +7956,7 @@ var Radio = (props) => {
|
|
|
7821
7956
|
value,
|
|
7822
7957
|
onChange: rest.onChange
|
|
7823
7958
|
};
|
|
7824
|
-
return /* @__PURE__ */
|
|
7959
|
+
return /* @__PURE__ */ jsxs213(
|
|
7825
7960
|
"label",
|
|
7826
7961
|
{
|
|
7827
7962
|
className: clsx_default(
|
|
@@ -7831,18 +7966,18 @@ var Radio = (props) => {
|
|
|
7831
7966
|
localChecked ? "checked" : void 0
|
|
7832
7967
|
),
|
|
7833
7968
|
children: [
|
|
7834
|
-
/* @__PURE__ */
|
|
7835
|
-
/* @__PURE__ */
|
|
7969
|
+
/* @__PURE__ */ jsx328("input", { ...rest, ...inputProps, checked: localChecked, type: "radio" }),
|
|
7970
|
+
/* @__PURE__ */ jsx328(
|
|
7836
7971
|
"div",
|
|
7837
7972
|
{
|
|
7838
7973
|
className: clsx_default(
|
|
7839
7974
|
"circle",
|
|
7840
7975
|
localChecked ? "checked" : void 0
|
|
7841
7976
|
),
|
|
7842
|
-
children: localChecked && /* @__PURE__ */
|
|
7977
|
+
children: localChecked && /* @__PURE__ */ jsx328("div", { className: "inner-circle" })
|
|
7843
7978
|
}
|
|
7844
7979
|
),
|
|
7845
|
-
label && /* @__PURE__ */
|
|
7980
|
+
label && /* @__PURE__ */ jsx328("span", { children: label })
|
|
7846
7981
|
]
|
|
7847
7982
|
}
|
|
7848
7983
|
);
|
|
@@ -7851,28 +7986,28 @@ Radio.displayName = "Radio";
|
|
|
7851
7986
|
var Radio_default = Radio;
|
|
7852
7987
|
|
|
7853
7988
|
// src/components/Radio/RadioGroup.tsx
|
|
7854
|
-
import { Fragment as Fragment3, jsx as
|
|
7989
|
+
import { Fragment as Fragment3, jsx as jsx329 } from "react/jsx-runtime";
|
|
7855
7990
|
var RadioGroup = (props) => {
|
|
7856
7991
|
const { children, ...rest } = props;
|
|
7857
|
-
return /* @__PURE__ */
|
|
7992
|
+
return /* @__PURE__ */ jsx329(Fragment3, { children: /* @__PURE__ */ jsx329(RadioGroupContext_default.Provider, { value: rest, children }) });
|
|
7858
7993
|
};
|
|
7859
7994
|
RadioGroup.displayName = "RadioGroup";
|
|
7860
7995
|
var RadioGroup_default = RadioGroup;
|
|
7861
7996
|
|
|
7862
7997
|
// src/components/Select/Select.tsx
|
|
7863
|
-
import
|
|
7998
|
+
import React27 from "react";
|
|
7864
7999
|
|
|
7865
8000
|
// src/components/Select/context.ts
|
|
7866
|
-
import
|
|
7867
|
-
var SelectContext =
|
|
8001
|
+
import React25 from "react";
|
|
8002
|
+
var SelectContext = React25.createContext(null);
|
|
7868
8003
|
var context_default = SelectContext;
|
|
7869
8004
|
|
|
7870
8005
|
// src/components/Select/SelectItem.tsx
|
|
7871
|
-
import
|
|
7872
|
-
import { jsx as
|
|
8006
|
+
import React26 from "react";
|
|
8007
|
+
import { jsx as jsx330 } from "react/jsx-runtime";
|
|
7873
8008
|
var SelectItem = (props) => {
|
|
7874
8009
|
const { children, value, onClick, disabled = false } = props;
|
|
7875
|
-
const ctx =
|
|
8010
|
+
const ctx = React26.useContext(context_default);
|
|
7876
8011
|
const handleClick = (e) => {
|
|
7877
8012
|
e.preventDefault();
|
|
7878
8013
|
e.stopPropagation();
|
|
@@ -7881,7 +8016,7 @@ var SelectItem = (props) => {
|
|
|
7881
8016
|
ctx?.close();
|
|
7882
8017
|
onClick?.();
|
|
7883
8018
|
};
|
|
7884
|
-
return /* @__PURE__ */
|
|
8019
|
+
return /* @__PURE__ */ jsx330(
|
|
7885
8020
|
"div",
|
|
7886
8021
|
{
|
|
7887
8022
|
className: clsx_default("select-item", disabled && "disabled"),
|
|
@@ -7902,7 +8037,7 @@ SelectItem.displayName = "Select.Item";
|
|
|
7902
8037
|
var SelectItem_default = SelectItem;
|
|
7903
8038
|
|
|
7904
8039
|
// src/components/Select/Select.tsx
|
|
7905
|
-
import { jsx as
|
|
8040
|
+
import { jsx as jsx331, jsxs as jsxs214 } from "react/jsx-runtime";
|
|
7906
8041
|
var ANIMATION_DURATION_MS3 = 200;
|
|
7907
8042
|
var SelectRoot = (props) => {
|
|
7908
8043
|
const {
|
|
@@ -7914,26 +8049,26 @@ var SelectRoot = (props) => {
|
|
|
7914
8049
|
error = false,
|
|
7915
8050
|
size = "md"
|
|
7916
8051
|
} = props;
|
|
7917
|
-
const itemChildren =
|
|
7918
|
-
(child) =>
|
|
8052
|
+
const itemChildren = React27.Children.toArray(children).filter(
|
|
8053
|
+
(child) => React27.isValidElement(child) && child.type === SelectItem_default
|
|
7919
8054
|
);
|
|
7920
8055
|
const isControlled = valueProp !== void 0;
|
|
7921
|
-
const [isOpen, setOpen] =
|
|
7922
|
-
const [uncontrolledLabel, setUncontrolledLabel] =
|
|
7923
|
-
const controlledLabel =
|
|
8056
|
+
const [isOpen, setOpen] = React27.useState(false);
|
|
8057
|
+
const [uncontrolledLabel, setUncontrolledLabel] = React27.useState(null);
|
|
8058
|
+
const controlledLabel = React27.useMemo(() => {
|
|
7924
8059
|
if (!isControlled) return null;
|
|
7925
8060
|
const match = itemChildren.find((child) => child.props.value === valueProp);
|
|
7926
8061
|
return match ? match.props.children : null;
|
|
7927
8062
|
}, [isControlled, valueProp, itemChildren]);
|
|
7928
8063
|
const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
|
|
7929
|
-
const triggerRef =
|
|
7930
|
-
const contentRef =
|
|
7931
|
-
const [mounted, setMounted] =
|
|
7932
|
-
const [visible, setVisible] =
|
|
7933
|
-
|
|
8064
|
+
const triggerRef = React27.useRef(null);
|
|
8065
|
+
const contentRef = React27.useRef(null);
|
|
8066
|
+
const [mounted, setMounted] = React27.useState(false);
|
|
8067
|
+
const [visible, setVisible] = React27.useState(false);
|
|
8068
|
+
React27.useEffect(() => {
|
|
7934
8069
|
if (disabled && isOpen) setOpen(false);
|
|
7935
8070
|
}, [disabled, isOpen]);
|
|
7936
|
-
|
|
8071
|
+
React27.useEffect(() => {
|
|
7937
8072
|
if (isOpen) {
|
|
7938
8073
|
setMounted(true);
|
|
7939
8074
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -7943,12 +8078,12 @@ var SelectRoot = (props) => {
|
|
|
7943
8078
|
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS3);
|
|
7944
8079
|
return () => clearTimeout(t);
|
|
7945
8080
|
}, [isOpen]);
|
|
7946
|
-
const open =
|
|
7947
|
-
const close =
|
|
7948
|
-
const toggle =
|
|
8081
|
+
const open = React27.useCallback(() => setOpen(true), []);
|
|
8082
|
+
const close = React27.useCallback(() => setOpen(false), []);
|
|
8083
|
+
const toggle = React27.useCallback(() => setOpen((prev) => !prev), []);
|
|
7949
8084
|
useClickOutside_default([contentRef, triggerRef], close, isOpen);
|
|
7950
8085
|
const position = useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
7951
|
-
const setSelected =
|
|
8086
|
+
const setSelected = React27.useCallback(
|
|
7952
8087
|
(label, itemValue) => {
|
|
7953
8088
|
if (!isControlled) {
|
|
7954
8089
|
setUncontrolledLabel(label);
|
|
@@ -7957,7 +8092,7 @@ var SelectRoot = (props) => {
|
|
|
7957
8092
|
},
|
|
7958
8093
|
[isControlled, onChange]
|
|
7959
8094
|
);
|
|
7960
|
-
const ctxValue =
|
|
8095
|
+
const ctxValue = React27.useMemo(
|
|
7961
8096
|
() => ({
|
|
7962
8097
|
isOpen,
|
|
7963
8098
|
mounted,
|
|
@@ -7978,7 +8113,7 @@ var SelectRoot = (props) => {
|
|
|
7978
8113
|
if (disabled) return;
|
|
7979
8114
|
toggle();
|
|
7980
8115
|
};
|
|
7981
|
-
return /* @__PURE__ */
|
|
8116
|
+
return /* @__PURE__ */ jsx331(context_default.Provider, { value: ctxValue, children: /* @__PURE__ */ jsxs214(
|
|
7982
8117
|
"div",
|
|
7983
8118
|
{
|
|
7984
8119
|
className: clsx_default(
|
|
@@ -7989,7 +8124,7 @@ var SelectRoot = (props) => {
|
|
|
7989
8124
|
mounted && "is-open"
|
|
7990
8125
|
),
|
|
7991
8126
|
children: [
|
|
7992
|
-
/* @__PURE__ */
|
|
8127
|
+
/* @__PURE__ */ jsxs214(
|
|
7993
8128
|
"div",
|
|
7994
8129
|
{
|
|
7995
8130
|
ref: triggerRef,
|
|
@@ -8013,7 +8148,7 @@ var SelectRoot = (props) => {
|
|
|
8013
8148
|
}
|
|
8014
8149
|
},
|
|
8015
8150
|
children: [
|
|
8016
|
-
/* @__PURE__ */
|
|
8151
|
+
/* @__PURE__ */ jsx331(
|
|
8017
8152
|
"span",
|
|
8018
8153
|
{
|
|
8019
8154
|
className: clsx_default(
|
|
@@ -8023,18 +8158,18 @@ var SelectRoot = (props) => {
|
|
|
8023
8158
|
children: selectedLabel ?? placeholder
|
|
8024
8159
|
}
|
|
8025
8160
|
),
|
|
8026
|
-
/* @__PURE__ */
|
|
8161
|
+
/* @__PURE__ */ jsx331(
|
|
8027
8162
|
"span",
|
|
8028
8163
|
{
|
|
8029
8164
|
className: clsx_default("select-trigger-icon", isOpen && "open"),
|
|
8030
8165
|
"aria-hidden": true,
|
|
8031
|
-
children: /* @__PURE__ */
|
|
8166
|
+
children: /* @__PURE__ */ jsx331(ChevronDownIcon_default, {})
|
|
8032
8167
|
}
|
|
8033
8168
|
)
|
|
8034
8169
|
]
|
|
8035
8170
|
}
|
|
8036
8171
|
),
|
|
8037
|
-
mounted && /* @__PURE__ */
|
|
8172
|
+
mounted && /* @__PURE__ */ jsx331(
|
|
8038
8173
|
"div",
|
|
8039
8174
|
{
|
|
8040
8175
|
className: clsx_default("select-content", position.direction, stateClass),
|
|
@@ -8055,14 +8190,14 @@ var Select = Object.assign(SelectRoot, {
|
|
|
8055
8190
|
var Select_default = Select;
|
|
8056
8191
|
|
|
8057
8192
|
// src/components/Skeleton/Skeleton.tsx
|
|
8058
|
-
import { jsx as
|
|
8193
|
+
import { jsx as jsx332 } from "react/jsx-runtime";
|
|
8059
8194
|
var Skeleton = (props) => {
|
|
8060
8195
|
const { variant = "text", width, height } = props;
|
|
8061
8196
|
const style = {
|
|
8062
8197
|
width: typeof width === "number" ? `${width}px` : width,
|
|
8063
8198
|
height: typeof height === "number" ? `${height}px` : height
|
|
8064
8199
|
};
|
|
8065
|
-
return /* @__PURE__ */
|
|
8200
|
+
return /* @__PURE__ */ jsx332(
|
|
8066
8201
|
"div",
|
|
8067
8202
|
{
|
|
8068
8203
|
className: clsx_default("lib-xplat-skeleton", variant),
|
|
@@ -8075,20 +8210,20 @@ Skeleton.displayName = "Skeleton";
|
|
|
8075
8210
|
var Skeleton_default = Skeleton;
|
|
8076
8211
|
|
|
8077
8212
|
// src/components/Spinner/Spinner.tsx
|
|
8078
|
-
import { jsx as
|
|
8213
|
+
import { jsx as jsx333, jsxs as jsxs215 } from "react/jsx-runtime";
|
|
8079
8214
|
var Spinner = (props) => {
|
|
8080
8215
|
const {
|
|
8081
8216
|
size = "md",
|
|
8082
8217
|
type = "brand"
|
|
8083
8218
|
} = props;
|
|
8084
|
-
return /* @__PURE__ */
|
|
8219
|
+
return /* @__PURE__ */ jsx333(
|
|
8085
8220
|
"div",
|
|
8086
8221
|
{
|
|
8087
8222
|
className: clsx_default("lib-xplat-spinner", size, type),
|
|
8088
8223
|
role: "status",
|
|
8089
8224
|
"aria-label": "\uB85C\uB529 \uC911",
|
|
8090
|
-
children: /* @__PURE__ */
|
|
8091
|
-
/* @__PURE__ */
|
|
8225
|
+
children: /* @__PURE__ */ jsxs215("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
8226
|
+
/* @__PURE__ */ jsx333(
|
|
8092
8227
|
"circle",
|
|
8093
8228
|
{
|
|
8094
8229
|
className: "track",
|
|
@@ -8098,7 +8233,7 @@ var Spinner = (props) => {
|
|
|
8098
8233
|
strokeWidth: "3"
|
|
8099
8234
|
}
|
|
8100
8235
|
),
|
|
8101
|
-
/* @__PURE__ */
|
|
8236
|
+
/* @__PURE__ */ jsx333(
|
|
8102
8237
|
"circle",
|
|
8103
8238
|
{
|
|
8104
8239
|
className: "indicator",
|
|
@@ -8117,20 +8252,20 @@ Spinner.displayName = "Spinner";
|
|
|
8117
8252
|
var Spinner_default = Spinner;
|
|
8118
8253
|
|
|
8119
8254
|
// src/components/Steps/Steps.tsx
|
|
8120
|
-
import { jsx as
|
|
8255
|
+
import { jsx as jsx334, jsxs as jsxs216 } from "react/jsx-runtime";
|
|
8121
8256
|
var Steps = (props) => {
|
|
8122
8257
|
const {
|
|
8123
8258
|
items,
|
|
8124
8259
|
current,
|
|
8125
8260
|
type = "brand"
|
|
8126
8261
|
} = props;
|
|
8127
|
-
return /* @__PURE__ */
|
|
8262
|
+
return /* @__PURE__ */ jsx334("div", { className: clsx_default("lib-xplat-steps", type), children: items.map((item, index) => {
|
|
8128
8263
|
const status = index < current ? "completed" : index === current ? "active" : "pending";
|
|
8129
|
-
return /* @__PURE__ */
|
|
8130
|
-
/* @__PURE__ */
|
|
8131
|
-
/* @__PURE__ */
|
|
8132
|
-
/* @__PURE__ */
|
|
8133
|
-
item.description && /* @__PURE__ */
|
|
8264
|
+
return /* @__PURE__ */ jsxs216("div", { className: clsx_default("step-item", status), children: [
|
|
8265
|
+
/* @__PURE__ */ jsx334("div", { className: "step-circle", children: status === "completed" ? /* @__PURE__ */ jsx334(CheckIcon_default, {}) : /* @__PURE__ */ jsx334("span", { children: index + 1 }) }),
|
|
8266
|
+
/* @__PURE__ */ jsxs216("div", { className: "step-content", children: [
|
|
8267
|
+
/* @__PURE__ */ jsx334("span", { className: "step-title", children: item.title }),
|
|
8268
|
+
item.description && /* @__PURE__ */ jsx334("span", { className: "step-description", children: item.description })
|
|
8134
8269
|
] })
|
|
8135
8270
|
] }, index);
|
|
8136
8271
|
}) });
|
|
@@ -8139,8 +8274,8 @@ Steps.displayName = "Steps";
|
|
|
8139
8274
|
var Steps_default = Steps;
|
|
8140
8275
|
|
|
8141
8276
|
// src/components/Swiper/Swiper.tsx
|
|
8142
|
-
import
|
|
8143
|
-
import { jsx as
|
|
8277
|
+
import React28 from "react";
|
|
8278
|
+
import { jsx as jsx335, jsxs as jsxs217 } from "react/jsx-runtime";
|
|
8144
8279
|
var Swiper = (props) => {
|
|
8145
8280
|
const {
|
|
8146
8281
|
auto = false,
|
|
@@ -8163,23 +8298,23 @@ var Swiper = (props) => {
|
|
|
8163
8298
|
const maxIndex = Math.max(0, totalSlides - viewItemCount);
|
|
8164
8299
|
const useLoop = loop && canSlide;
|
|
8165
8300
|
const cloneCount = useLoop ? totalSlides : 0;
|
|
8166
|
-
const extendedItems =
|
|
8301
|
+
const extendedItems = React28.useMemo(() => {
|
|
8167
8302
|
if (!useLoop) return items;
|
|
8168
8303
|
return [...items, ...items, ...items];
|
|
8169
8304
|
}, [items, useLoop]);
|
|
8170
8305
|
const initialIdx = Math.max(0, Math.min(indexProp ?? 0, maxIndex));
|
|
8171
|
-
const [innerIndex, setInnerIndex] =
|
|
8306
|
+
const [innerIndex, setInnerIndex] = React28.useState(
|
|
8172
8307
|
useLoop ? cloneCount + initialIdx : initialIdx
|
|
8173
8308
|
);
|
|
8174
|
-
const [isDragging, setIsDragging] =
|
|
8175
|
-
const [dragOffset, setDragOffset] =
|
|
8176
|
-
const [animated, setAnimated] =
|
|
8177
|
-
const [containerWidth, setContainerWidth] =
|
|
8178
|
-
const containerRef =
|
|
8179
|
-
const startXRef =
|
|
8180
|
-
const startTimeRef =
|
|
8181
|
-
const autoplayTimerRef =
|
|
8182
|
-
|
|
8309
|
+
const [isDragging, setIsDragging] = React28.useState(false);
|
|
8310
|
+
const [dragOffset, setDragOffset] = React28.useState(0);
|
|
8311
|
+
const [animated, setAnimated] = React28.useState(true);
|
|
8312
|
+
const [containerWidth, setContainerWidth] = React28.useState(0);
|
|
8313
|
+
const containerRef = React28.useRef(null);
|
|
8314
|
+
const startXRef = React28.useRef(0);
|
|
8315
|
+
const startTimeRef = React28.useRef(0);
|
|
8316
|
+
const autoplayTimerRef = React28.useRef(null);
|
|
8317
|
+
React28.useEffect(() => {
|
|
8183
8318
|
const el = containerRef.current;
|
|
8184
8319
|
if (!el) return;
|
|
8185
8320
|
const ro = new ResizeObserver((entries) => {
|
|
@@ -8198,7 +8333,7 @@ var Swiper = (props) => {
|
|
|
8198
8333
|
return ((inner - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
8199
8334
|
};
|
|
8200
8335
|
const realIndex = getRealIndex(innerIndex);
|
|
8201
|
-
const moveToInner =
|
|
8336
|
+
const moveToInner = React28.useCallback(
|
|
8202
8337
|
(idx, withAnim = true) => {
|
|
8203
8338
|
if (!useLoop) {
|
|
8204
8339
|
setAnimated(withAnim);
|
|
@@ -8226,7 +8361,7 @@ var Swiper = (props) => {
|
|
|
8226
8361
|
},
|
|
8227
8362
|
[useLoop, cloneCount, totalSlides]
|
|
8228
8363
|
);
|
|
8229
|
-
const handleTransitionEnd =
|
|
8364
|
+
const handleTransitionEnd = React28.useCallback(() => {
|
|
8230
8365
|
if (!useLoop) return;
|
|
8231
8366
|
const real = getRealIndex(innerIndex);
|
|
8232
8367
|
const canonical = cloneCount + real;
|
|
@@ -8236,7 +8371,7 @@ var Swiper = (props) => {
|
|
|
8236
8371
|
}
|
|
8237
8372
|
onChange?.(Math.min(real, maxIndex));
|
|
8238
8373
|
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange]);
|
|
8239
|
-
const slideTo =
|
|
8374
|
+
const slideTo = React28.useCallback(
|
|
8240
8375
|
(logicalIndex) => {
|
|
8241
8376
|
if (!canSlide) return;
|
|
8242
8377
|
const clamped = useLoop ? logicalIndex : Math.max(0, Math.min(logicalIndex, maxIndex));
|
|
@@ -8246,7 +8381,7 @@ var Swiper = (props) => {
|
|
|
8246
8381
|
},
|
|
8247
8382
|
[canSlide, useLoop, cloneCount, maxIndex, onChange, moveToInner]
|
|
8248
8383
|
);
|
|
8249
|
-
const slideNext =
|
|
8384
|
+
const slideNext = React28.useCallback(() => {
|
|
8250
8385
|
if (!canSlide) return;
|
|
8251
8386
|
const nextInner = innerIndex + slideBy;
|
|
8252
8387
|
if (useLoop) {
|
|
@@ -8255,7 +8390,7 @@ var Swiper = (props) => {
|
|
|
8255
8390
|
moveToInner(Math.min(nextInner, maxIndex), true);
|
|
8256
8391
|
}
|
|
8257
8392
|
}, [canSlide, useLoop, innerIndex, slideBy, maxIndex, moveToInner]);
|
|
8258
|
-
const slidePrev =
|
|
8393
|
+
const slidePrev = React28.useCallback(() => {
|
|
8259
8394
|
if (!canSlide) return;
|
|
8260
8395
|
const prevInner = innerIndex - slideBy;
|
|
8261
8396
|
if (useLoop) {
|
|
@@ -8264,7 +8399,7 @@ var Swiper = (props) => {
|
|
|
8264
8399
|
moveToInner(Math.max(prevInner, 0), true);
|
|
8265
8400
|
}
|
|
8266
8401
|
}, [canSlide, useLoop, innerIndex, slideBy, moveToInner]);
|
|
8267
|
-
|
|
8402
|
+
React28.useEffect(() => {
|
|
8268
8403
|
if (indexProp === void 0) return;
|
|
8269
8404
|
const clamped = Math.max(0, Math.min(indexProp, maxIndex));
|
|
8270
8405
|
const target = useLoop ? cloneCount + clamped : clamped;
|
|
@@ -8272,12 +8407,12 @@ var Swiper = (props) => {
|
|
|
8272
8407
|
moveToInner(target, true);
|
|
8273
8408
|
}
|
|
8274
8409
|
}, [indexProp]);
|
|
8275
|
-
|
|
8410
|
+
React28.useImperativeHandle(swiperRef, () => ({
|
|
8276
8411
|
slidePrev,
|
|
8277
8412
|
slideNext,
|
|
8278
8413
|
slideTo
|
|
8279
8414
|
}));
|
|
8280
|
-
|
|
8415
|
+
React28.useEffect(() => {
|
|
8281
8416
|
if (!auto || !canSlide) return;
|
|
8282
8417
|
autoplayTimerRef.current = setInterval(slideNext, autoplayDelay);
|
|
8283
8418
|
return () => {
|
|
@@ -8300,7 +8435,7 @@ var Swiper = (props) => {
|
|
|
8300
8435
|
startXRef.current = getClientX(e);
|
|
8301
8436
|
startTimeRef.current = Date.now();
|
|
8302
8437
|
};
|
|
8303
|
-
|
|
8438
|
+
React28.useEffect(() => {
|
|
8304
8439
|
if (!isDragging) return;
|
|
8305
8440
|
const handleMove = (e) => {
|
|
8306
8441
|
setDragOffset(getClientX(e) - startXRef.current);
|
|
@@ -8338,8 +8473,8 @@ var Swiper = (props) => {
|
|
|
8338
8473
|
}, [isDragging, dragOffset, innerIndex, useLoop, maxIndex, slideStep, moveToInner]);
|
|
8339
8474
|
const slideWidthPercent = 100 / viewItemCount;
|
|
8340
8475
|
const gapAdjust = spaceBetween * (viewItemCount - 1) / viewItemCount;
|
|
8341
|
-
const slideElements =
|
|
8342
|
-
() => extendedItems.map((item, idx) => /* @__PURE__ */
|
|
8476
|
+
const slideElements = React28.useMemo(
|
|
8477
|
+
() => extendedItems.map((item, idx) => /* @__PURE__ */ jsx335(
|
|
8343
8478
|
"div",
|
|
8344
8479
|
{
|
|
8345
8480
|
className: "lib-xplat-swiper__slide",
|
|
@@ -8358,14 +8493,14 @@ var Swiper = (props) => {
|
|
|
8358
8493
|
Math.floor(realIndex / slideBy),
|
|
8359
8494
|
totalSteps - 1
|
|
8360
8495
|
);
|
|
8361
|
-
return /* @__PURE__ */
|
|
8362
|
-
/* @__PURE__ */
|
|
8496
|
+
return /* @__PURE__ */ jsxs217("div", { className: "lib-xplat-swiper", ref: containerRef, children: [
|
|
8497
|
+
/* @__PURE__ */ jsx335(
|
|
8363
8498
|
"div",
|
|
8364
8499
|
{
|
|
8365
8500
|
className: "lib-xplat-swiper__viewport",
|
|
8366
8501
|
onMouseDown: handleDragStart,
|
|
8367
8502
|
onTouchStart: handleDragStart,
|
|
8368
|
-
children: /* @__PURE__ */
|
|
8503
|
+
children: /* @__PURE__ */ jsx335(
|
|
8369
8504
|
"div",
|
|
8370
8505
|
{
|
|
8371
8506
|
className: clsx_default(
|
|
@@ -8383,7 +8518,7 @@ var Swiper = (props) => {
|
|
|
8383
8518
|
)
|
|
8384
8519
|
}
|
|
8385
8520
|
),
|
|
8386
|
-
showProgress && canSlide && /* @__PURE__ */
|
|
8521
|
+
showProgress && canSlide && /* @__PURE__ */ jsx335("div", { className: "lib-xplat-swiper__progress", children: /* @__PURE__ */ jsx335("div", { className: "lib-xplat-swiper__progress-track", children: /* @__PURE__ */ jsx335(
|
|
8387
8522
|
"span",
|
|
8388
8523
|
{
|
|
8389
8524
|
className: "lib-xplat-swiper__progress-fill",
|
|
@@ -8393,7 +8528,7 @@ var Swiper = (props) => {
|
|
|
8393
8528
|
}
|
|
8394
8529
|
}
|
|
8395
8530
|
) }) }),
|
|
8396
|
-
canSlide && /* @__PURE__ */
|
|
8531
|
+
canSlide && /* @__PURE__ */ jsx335("div", { className: "lib-xplat-swiper__dots", children: Array.from({ length: totalSteps }, (_, i) => /* @__PURE__ */ jsx335(
|
|
8397
8532
|
"button",
|
|
8398
8533
|
{
|
|
8399
8534
|
className: clsx_default(
|
|
@@ -8411,8 +8546,8 @@ Swiper.displayName = "Swiper";
|
|
|
8411
8546
|
var Swiper_default = Swiper;
|
|
8412
8547
|
|
|
8413
8548
|
// src/components/Switch/Switch.tsx
|
|
8414
|
-
import
|
|
8415
|
-
import { jsx as
|
|
8549
|
+
import React29 from "react";
|
|
8550
|
+
import { jsx as jsx336 } from "react/jsx-runtime";
|
|
8416
8551
|
var KNOB_TRANSITION_MS = 250;
|
|
8417
8552
|
var Switch = (props) => {
|
|
8418
8553
|
const {
|
|
@@ -8422,9 +8557,9 @@ var Switch = (props) => {
|
|
|
8422
8557
|
disabled,
|
|
8423
8558
|
onChange
|
|
8424
8559
|
} = props;
|
|
8425
|
-
const [isAnimating, setIsAnimating] =
|
|
8426
|
-
const timeoutRef =
|
|
8427
|
-
|
|
8560
|
+
const [isAnimating, setIsAnimating] = React29.useState(false);
|
|
8561
|
+
const timeoutRef = React29.useRef(null);
|
|
8562
|
+
React29.useEffect(() => {
|
|
8428
8563
|
return () => {
|
|
8429
8564
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
8430
8565
|
};
|
|
@@ -8439,7 +8574,7 @@ var Switch = (props) => {
|
|
|
8439
8574
|
timeoutRef.current = null;
|
|
8440
8575
|
}, KNOB_TRANSITION_MS);
|
|
8441
8576
|
};
|
|
8442
|
-
return /* @__PURE__ */
|
|
8577
|
+
return /* @__PURE__ */ jsx336(
|
|
8443
8578
|
"div",
|
|
8444
8579
|
{
|
|
8445
8580
|
className: clsx_default(
|
|
@@ -8452,80 +8587,13 @@ var Switch = (props) => {
|
|
|
8452
8587
|
),
|
|
8453
8588
|
onClick: handleClick,
|
|
8454
8589
|
"aria-disabled": disabled || isAnimating,
|
|
8455
|
-
children: /* @__PURE__ */
|
|
8590
|
+
children: /* @__PURE__ */ jsx336("div", { className: clsx_default("knob", value ? "checked" : void 0) })
|
|
8456
8591
|
}
|
|
8457
8592
|
);
|
|
8458
8593
|
};
|
|
8459
8594
|
Switch.displayName = "Switch";
|
|
8460
8595
|
var Switch_default = Switch;
|
|
8461
8596
|
|
|
8462
|
-
// src/components/Tab/Tab.tsx
|
|
8463
|
-
import React29 from "react";
|
|
8464
|
-
|
|
8465
|
-
// src/components/Tab/TabItem.tsx
|
|
8466
|
-
import React28 from "react";
|
|
8467
|
-
import { jsx as jsx335 } from "react/jsx-runtime";
|
|
8468
|
-
var TabItem = React28.forwardRef((props, ref) => {
|
|
8469
|
-
const { isActive, title, onClick } = props;
|
|
8470
|
-
return /* @__PURE__ */ jsx335(
|
|
8471
|
-
"div",
|
|
8472
|
-
{
|
|
8473
|
-
ref,
|
|
8474
|
-
className: clsx_default("tab-item", isActive ? "active" : null),
|
|
8475
|
-
onClick,
|
|
8476
|
-
children: title
|
|
8477
|
-
}
|
|
8478
|
-
);
|
|
8479
|
-
});
|
|
8480
|
-
TabItem.displayName = "TabItem";
|
|
8481
|
-
var TabItem_default = TabItem;
|
|
8482
|
-
|
|
8483
|
-
// src/components/Tab/Tab.tsx
|
|
8484
|
-
import { jsx as jsx336, jsxs as jsxs217 } from "react/jsx-runtime";
|
|
8485
|
-
var Tab = (props) => {
|
|
8486
|
-
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
8487
|
-
const [underlineStyle, setUnderlineStyle] = React29.useState({
|
|
8488
|
-
left: 0,
|
|
8489
|
-
width: 0
|
|
8490
|
-
});
|
|
8491
|
-
const itemRefs = React29.useRef([]);
|
|
8492
|
-
const handleChangeActiveTab = (tabItem, tabIdx) => {
|
|
8493
|
-
onChange(tabItem, tabIdx);
|
|
8494
|
-
};
|
|
8495
|
-
React29.useEffect(() => {
|
|
8496
|
-
const el = itemRefs.current[activeIndex];
|
|
8497
|
-
if (el) {
|
|
8498
|
-
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
8499
|
-
}
|
|
8500
|
-
}, [activeIndex, tabs.length]);
|
|
8501
|
-
return /* @__PURE__ */ jsxs217("div", { className: clsx_default("lib-xplat-tab", `type-${type}`, size), children: [
|
|
8502
|
-
tabs.map((tab, idx) => /* @__PURE__ */ jsx336(
|
|
8503
|
-
TabItem_default,
|
|
8504
|
-
{
|
|
8505
|
-
onClick: () => handleChangeActiveTab(tab, idx),
|
|
8506
|
-
isActive: activeIndex === idx,
|
|
8507
|
-
ref: (el) => {
|
|
8508
|
-
itemRefs.current[idx] = el;
|
|
8509
|
-
},
|
|
8510
|
-
title: tab.title
|
|
8511
|
-
},
|
|
8512
|
-
`${tab.value}_${idx}`
|
|
8513
|
-
)),
|
|
8514
|
-
type === "toggle" && /* @__PURE__ */ jsx336(
|
|
8515
|
-
"div",
|
|
8516
|
-
{
|
|
8517
|
-
className: "tab-toggle-underline",
|
|
8518
|
-
style: {
|
|
8519
|
-
left: underlineStyle.left,
|
|
8520
|
-
width: underlineStyle.width
|
|
8521
|
-
}
|
|
8522
|
-
}
|
|
8523
|
-
)
|
|
8524
|
-
] });
|
|
8525
|
-
};
|
|
8526
|
-
Tab.displayName = "Tab";
|
|
8527
|
-
var Tab_default = Tab;
|
|
8528
|
-
|
|
8529
8597
|
// src/components/Table/TableContext.tsx
|
|
8530
8598
|
import React30 from "react";
|
|
8531
8599
|
var TableContext = React30.createContext(null);
|
|
@@ -9438,6 +9506,7 @@ export {
|
|
|
9438
9506
|
BookIcon_default as BookIcon,
|
|
9439
9507
|
BookOpenIcon_default as BookOpenIcon,
|
|
9440
9508
|
BookmarkIcon_default as BookmarkIcon,
|
|
9509
|
+
Box_default as Box,
|
|
9441
9510
|
BoxIcon_default as BoxIcon,
|
|
9442
9511
|
Breadcrumb_default as Breadcrumb,
|
|
9443
9512
|
BriefcaseIcon_default as BriefcaseIcon,
|
|
@@ -9454,7 +9523,6 @@ export {
|
|
|
9454
9523
|
CallOutgoingIcon_default as CallOutgoingIcon,
|
|
9455
9524
|
CameraIcon_default as CameraIcon,
|
|
9456
9525
|
CameraOffIcon_default as CameraOffIcon,
|
|
9457
|
-
Card_default as Card,
|
|
9458
9526
|
CardTab_default as CardTab,
|
|
9459
9527
|
CastIcon_default as CastIcon,
|
|
9460
9528
|
Chart_default as Chart,
|