@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/components/index.js
CHANGED
|
@@ -1933,16 +1933,21 @@ var Calendar = (props) => {
|
|
|
1933
1933
|
Calendar.displayName = "Calendar";
|
|
1934
1934
|
var Calendar_default = Calendar;
|
|
1935
1935
|
|
|
1936
|
-
// src/components/
|
|
1936
|
+
// src/components/Box/Box.tsx
|
|
1937
1937
|
import { jsx as jsx302, jsxs as jsxs194 } from "react/jsx-runtime";
|
|
1938
|
-
var
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1938
|
+
var Box = ({
|
|
1939
|
+
children,
|
|
1940
|
+
title,
|
|
1941
|
+
variant = "outlined",
|
|
1942
|
+
padding = "md"
|
|
1943
|
+
}) => {
|
|
1944
|
+
return /* @__PURE__ */ jsxs194("div", { className: clsx_default("lib-xplat-box", variant, `pad-${padding}`), children: [
|
|
1945
|
+
title && /* @__PURE__ */ jsx302("div", { className: "box-title", children: title }),
|
|
1946
|
+
/* @__PURE__ */ jsx302("div", { className: "box-content", children })
|
|
1942
1947
|
] });
|
|
1943
1948
|
};
|
|
1944
|
-
|
|
1945
|
-
var
|
|
1949
|
+
Box.displayName = "Box";
|
|
1950
|
+
var Box_default = Box;
|
|
1946
1951
|
|
|
1947
1952
|
// src/components/CardTab/CardTab.tsx
|
|
1948
1953
|
import React4 from "react";
|
|
@@ -2041,6 +2046,39 @@ var getPalette = (palettes, index, key) => {
|
|
|
2041
2046
|
return palettes[(index + offset) % palettes.length];
|
|
2042
2047
|
};
|
|
2043
2048
|
var PADDING = { top: 20, right: 20, bottom: 30, left: 40 };
|
|
2049
|
+
var toSmoothPath = (points) => {
|
|
2050
|
+
if (points.length < 2) return "";
|
|
2051
|
+
const p = points;
|
|
2052
|
+
let d = `M ${p[0].x} ${p[0].y}`;
|
|
2053
|
+
for (let i = 0; i < p.length - 1; i++) {
|
|
2054
|
+
const p0 = p[Math.max(0, i - 1)];
|
|
2055
|
+
const p1 = p[i];
|
|
2056
|
+
const p2 = p[i + 1];
|
|
2057
|
+
const p3 = p[Math.min(p.length - 1, i + 2)];
|
|
2058
|
+
const cp1x = p1.x + (p2.x - p0.x) / 6;
|
|
2059
|
+
const cp1y = p1.y + (p2.y - p0.y) / 6;
|
|
2060
|
+
const cp2x = p2.x - (p3.x - p1.x) / 6;
|
|
2061
|
+
const cp2y = p2.y - (p3.y - p1.y) / 6;
|
|
2062
|
+
d += ` C ${cp1x} ${cp1y}, ${cp2x} ${cp2y}, ${p2.x} ${p2.y}`;
|
|
2063
|
+
}
|
|
2064
|
+
return d;
|
|
2065
|
+
};
|
|
2066
|
+
var useChartSize = (ref) => {
|
|
2067
|
+
const [size, setSize] = React5.useState({ width: 0, height: 0 });
|
|
2068
|
+
React5.useEffect(() => {
|
|
2069
|
+
const el = ref.current;
|
|
2070
|
+
if (!el) return;
|
|
2071
|
+
const observer = new ResizeObserver((entries) => {
|
|
2072
|
+
const entry = entries[0];
|
|
2073
|
+
if (!entry) return;
|
|
2074
|
+
const { width, height } = entry.contentRect;
|
|
2075
|
+
setSize({ width: Math.floor(width), height: Math.floor(height) });
|
|
2076
|
+
});
|
|
2077
|
+
observer.observe(el);
|
|
2078
|
+
return () => observer.disconnect();
|
|
2079
|
+
}, [ref]);
|
|
2080
|
+
return size;
|
|
2081
|
+
};
|
|
2044
2082
|
var useChartTooltip = (enabled) => {
|
|
2045
2083
|
const [tooltip, setTooltip] = React5.useState({
|
|
2046
2084
|
visible: false,
|
|
@@ -2075,15 +2113,15 @@ var useChartTooltip = (enabled) => {
|
|
|
2075
2113
|
}, []);
|
|
2076
2114
|
return { tooltip, show, hide, move, containerRef };
|
|
2077
2115
|
};
|
|
2078
|
-
var LineChart = React5.memo(({ data, labels, onHover, onMove, onLeave }) => {
|
|
2116
|
+
var LineChart = React5.memo(({ data, labels, width, height, onHover, onMove, onLeave }) => {
|
|
2079
2117
|
const entries = React5.useMemo(() => Object.entries(data), [data]);
|
|
2080
2118
|
const maxVal = React5.useMemo(() => {
|
|
2081
2119
|
const allValues = entries.flatMap(([, v]) => v);
|
|
2082
2120
|
return Math.max(...allValues) * 1.2 || 1;
|
|
2083
2121
|
}, [entries]);
|
|
2084
2122
|
const count = labels.length;
|
|
2085
|
-
const chartW =
|
|
2086
|
-
const chartH =
|
|
2123
|
+
const chartW = width - PADDING.left - PADDING.right;
|
|
2124
|
+
const chartH = height - PADDING.top - PADDING.bottom;
|
|
2087
2125
|
const seriesPoints = React5.useMemo(
|
|
2088
2126
|
() => entries.map(
|
|
2089
2127
|
([, values]) => values.map((v, i) => ({
|
|
@@ -2094,18 +2132,18 @@ var LineChart = React5.memo(({ data, labels, onHover, onMove, onLeave }) => {
|
|
|
2094
2132
|
),
|
|
2095
2133
|
[entries, count, chartW, chartH, maxVal]
|
|
2096
2134
|
);
|
|
2097
|
-
return /* @__PURE__ */ jsxs196("svg", { viewBox:
|
|
2135
|
+
return /* @__PURE__ */ jsxs196("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
2098
2136
|
[0, 0.25, 0.5, 0.75, 1].map((ratio) => {
|
|
2099
2137
|
const y = PADDING.top + (1 - ratio) * chartH;
|
|
2100
2138
|
const val = Math.round(maxVal * ratio);
|
|
2101
2139
|
return /* @__PURE__ */ jsxs196("g", { children: [
|
|
2102
|
-
/* @__PURE__ */ jsx305("line", { x1: PADDING.left, y1: y, x2:
|
|
2140
|
+
/* @__PURE__ */ jsx305("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
|
|
2103
2141
|
/* @__PURE__ */ jsx305("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
|
|
2104
2142
|
] }, ratio);
|
|
2105
2143
|
}),
|
|
2106
2144
|
labels.map((label, i) => {
|
|
2107
2145
|
const x = PADDING.left + i / (count - 1 || 1) * chartW;
|
|
2108
|
-
return /* @__PURE__ */ jsx305("text", { x, y:
|
|
2146
|
+
return /* @__PURE__ */ jsx305("text", { x, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
2109
2147
|
}),
|
|
2110
2148
|
entries.map(([key], di) => {
|
|
2111
2149
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
@@ -2140,7 +2178,73 @@ var LineChart = React5.memo(({ data, labels, onHover, onMove, onLeave }) => {
|
|
|
2140
2178
|
] });
|
|
2141
2179
|
});
|
|
2142
2180
|
LineChart.displayName = "LineChart";
|
|
2143
|
-
var
|
|
2181
|
+
var CurveChart = React5.memo(({ data, labels, width, height, onHover, onMove, onLeave }) => {
|
|
2182
|
+
const entries = React5.useMemo(() => Object.entries(data), [data]);
|
|
2183
|
+
const maxVal = React5.useMemo(() => {
|
|
2184
|
+
const allValues = entries.flatMap(([, v]) => v);
|
|
2185
|
+
return Math.max(...allValues) * 1.2 || 1;
|
|
2186
|
+
}, [entries]);
|
|
2187
|
+
const count = labels.length;
|
|
2188
|
+
const chartW = width - PADDING.left - PADDING.right;
|
|
2189
|
+
const chartH = height - PADDING.top - PADDING.bottom;
|
|
2190
|
+
const seriesPoints = React5.useMemo(
|
|
2191
|
+
() => entries.map(
|
|
2192
|
+
([, values]) => values.map((v, i) => ({
|
|
2193
|
+
x: PADDING.left + i / (count - 1 || 1) * chartW,
|
|
2194
|
+
y: PADDING.top + (1 - v / maxVal) * chartH,
|
|
2195
|
+
v
|
|
2196
|
+
}))
|
|
2197
|
+
),
|
|
2198
|
+
[entries, count, chartW, chartH, maxVal]
|
|
2199
|
+
);
|
|
2200
|
+
return /* @__PURE__ */ jsxs196("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
2201
|
+
[0, 0.25, 0.5, 0.75, 1].map((ratio) => {
|
|
2202
|
+
const y = PADDING.top + (1 - ratio) * chartH;
|
|
2203
|
+
const val = Math.round(maxVal * ratio);
|
|
2204
|
+
return /* @__PURE__ */ jsxs196("g", { children: [
|
|
2205
|
+
/* @__PURE__ */ jsx305("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
|
|
2206
|
+
/* @__PURE__ */ jsx305("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
|
|
2207
|
+
] }, ratio);
|
|
2208
|
+
}),
|
|
2209
|
+
labels.map((label, i) => {
|
|
2210
|
+
const x = PADDING.left + i / (count - 1 || 1) * chartW;
|
|
2211
|
+
return /* @__PURE__ */ jsx305("text", { x, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
2212
|
+
}),
|
|
2213
|
+
entries.map(([key], di) => {
|
|
2214
|
+
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
2215
|
+
const color = palette[2];
|
|
2216
|
+
const areaColor = palette[0];
|
|
2217
|
+
const points = seriesPoints[di];
|
|
2218
|
+
const gradientId = `curve-gradient-${di}`;
|
|
2219
|
+
const linePath = toSmoothPath(points);
|
|
2220
|
+
const areaPath = linePath + ` L ${points[points.length - 1].x} ${PADDING.top + chartH} L ${points[0].x} ${PADDING.top + chartH} Z`;
|
|
2221
|
+
return /* @__PURE__ */ jsxs196("g", { children: [
|
|
2222
|
+
/* @__PURE__ */ jsx305("defs", { children: /* @__PURE__ */ jsxs196("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
2223
|
+
/* @__PURE__ */ jsx305("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.4" }),
|
|
2224
|
+
/* @__PURE__ */ jsx305("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0.02" })
|
|
2225
|
+
] }) }),
|
|
2226
|
+
/* @__PURE__ */ jsx305("path", { d: areaPath, fill: `url(#${gradientId})` }),
|
|
2227
|
+
/* @__PURE__ */ jsx305("path", { d: linePath, fill: "none", stroke: color, strokeWidth: "2" }),
|
|
2228
|
+
points.map((p, i) => /* @__PURE__ */ jsx305(
|
|
2229
|
+
"circle",
|
|
2230
|
+
{
|
|
2231
|
+
cx: p.x,
|
|
2232
|
+
cy: p.y,
|
|
2233
|
+
r: "4",
|
|
2234
|
+
fill: color,
|
|
2235
|
+
className: "chart-point",
|
|
2236
|
+
onMouseEnter: (e) => onHover(e, `${key}: ${labels[i]} \u2014 ${p.v}`),
|
|
2237
|
+
onMouseMove: onMove,
|
|
2238
|
+
onMouseLeave: onLeave
|
|
2239
|
+
},
|
|
2240
|
+
i
|
|
2241
|
+
))
|
|
2242
|
+
] }, di);
|
|
2243
|
+
})
|
|
2244
|
+
] });
|
|
2245
|
+
});
|
|
2246
|
+
CurveChart.displayName = "CurveChart";
|
|
2247
|
+
var BarChart = React5.memo(({ data, labels, width, height, onHover, onMove, onLeave }) => {
|
|
2144
2248
|
const entries = React5.useMemo(() => Object.entries(data), [data]);
|
|
2145
2249
|
const maxVal = React5.useMemo(() => {
|
|
2146
2250
|
const allValues = entries.flatMap(([, v]) => v);
|
|
@@ -2148,8 +2252,8 @@ var BarChart = React5.memo(({ data, labels, onHover, onMove, onLeave }) => {
|
|
|
2148
2252
|
}, [entries]);
|
|
2149
2253
|
const count = labels.length;
|
|
2150
2254
|
const groupCount = entries.length;
|
|
2151
|
-
const chartW =
|
|
2152
|
-
const chartH =
|
|
2255
|
+
const chartW = width - PADDING.left - PADDING.right;
|
|
2256
|
+
const chartH = height - PADDING.top - PADDING.bottom;
|
|
2153
2257
|
const groupW = chartW / count;
|
|
2154
2258
|
const barW = Math.min(32, groupW * 0.7 / groupCount);
|
|
2155
2259
|
const bars = React5.useMemo(
|
|
@@ -2163,16 +2267,16 @@ var BarChart = React5.memo(({ data, labels, onHover, onMove, onLeave }) => {
|
|
|
2163
2267
|
),
|
|
2164
2268
|
[entries, maxVal, chartH, groupW, barW, groupCount]
|
|
2165
2269
|
);
|
|
2166
|
-
return /* @__PURE__ */ jsxs196("svg", { viewBox:
|
|
2270
|
+
return /* @__PURE__ */ jsxs196("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
2167
2271
|
[0, 0.25, 0.5, 0.75, 1].map((ratio) => {
|
|
2168
2272
|
const y = PADDING.top + (1 - ratio) * chartH;
|
|
2169
2273
|
const val = Math.round(maxVal * ratio);
|
|
2170
2274
|
return /* @__PURE__ */ jsxs196("g", { children: [
|
|
2171
|
-
/* @__PURE__ */ jsx305("line", { x1: PADDING.left, y1: y, x2:
|
|
2275
|
+
/* @__PURE__ */ jsx305("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
|
|
2172
2276
|
/* @__PURE__ */ jsx305("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
|
|
2173
2277
|
] }, ratio);
|
|
2174
2278
|
}),
|
|
2175
|
-
labels.map((label, i) => /* @__PURE__ */ jsx305("text", { x: PADDING.left + groupW * i + groupW / 2, y:
|
|
2279
|
+
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)),
|
|
2176
2280
|
entries.map(([key], di) => {
|
|
2177
2281
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
2178
2282
|
const color = palette[2];
|
|
@@ -2183,7 +2287,7 @@ var BarChart = React5.memo(({ data, labels, onHover, onMove, onLeave }) => {
|
|
|
2183
2287
|
y: b.y,
|
|
2184
2288
|
width: b.w,
|
|
2185
2289
|
height: b.h,
|
|
2186
|
-
rx:
|
|
2290
|
+
rx: Math.min(4, b.w / 2),
|
|
2187
2291
|
fill: color,
|
|
2188
2292
|
className: "chart-bar",
|
|
2189
2293
|
onMouseEnter: (e) => onHover(e, `${key}: ${labels[i]} \u2014 ${b.v}`),
|
|
@@ -2197,14 +2301,15 @@ var BarChart = React5.memo(({ data, labels, onHover, onMove, onLeave }) => {
|
|
|
2197
2301
|
});
|
|
2198
2302
|
BarChart.displayName = "BarChart";
|
|
2199
2303
|
var PieDonutChart = React5.memo(
|
|
2200
|
-
({ data, labels, isDoughnut, onHover, onMove, onLeave }) => {
|
|
2304
|
+
({ data, labels, width, height, isDoughnut, onHover, onMove, onLeave }) => {
|
|
2201
2305
|
const entries = React5.useMemo(() => Object.entries(data), [data]);
|
|
2202
2306
|
const values = React5.useMemo(() => entries.flatMap(([, v]) => v), [entries]);
|
|
2203
2307
|
const total = React5.useMemo(() => values.reduce((a, b) => a + b, 0) || 1, [values]);
|
|
2204
|
-
const
|
|
2205
|
-
const
|
|
2206
|
-
const
|
|
2207
|
-
const
|
|
2308
|
+
const size = Math.min(width, height);
|
|
2309
|
+
const cx = size / 2;
|
|
2310
|
+
const cy = size / 2;
|
|
2311
|
+
const r2 = size * 0.4;
|
|
2312
|
+
const innerR = isDoughnut ? r2 * 0.5 : 0;
|
|
2208
2313
|
const firstKey = entries[0]?.[0] ?? "";
|
|
2209
2314
|
const colorOffset = hashString(firstKey);
|
|
2210
2315
|
const sliceData = React5.useMemo(() => {
|
|
@@ -2235,8 +2340,8 @@ var PieDonutChart = React5.memo(
|
|
|
2235
2340
|
angle0 = endAngle;
|
|
2236
2341
|
return { d, lx, ly, v, pct, angle, label: labels[i] || `${i + 1}` };
|
|
2237
2342
|
});
|
|
2238
|
-
}, [values, total, innerR, labels]);
|
|
2239
|
-
return /* @__PURE__ */ jsx305("svg", { viewBox:
|
|
2343
|
+
}, [values, total, cx, cy, r2, innerR, labels]);
|
|
2344
|
+
return /* @__PURE__ */ jsx305("svg", { viewBox: `0 0 ${size} ${size}`, className: "chart-svg chart-pie", children: sliceData.map((s, i) => /* @__PURE__ */ jsxs196("g", { children: [
|
|
2240
2345
|
/* @__PURE__ */ jsx305(
|
|
2241
2346
|
"path",
|
|
2242
2347
|
{
|
|
@@ -2253,22 +2358,42 @@ var PieDonutChart = React5.memo(
|
|
|
2253
2358
|
}
|
|
2254
2359
|
);
|
|
2255
2360
|
PieDonutChart.displayName = "PieDonutChart";
|
|
2361
|
+
var TooltipBubble = ({ x, y, containerWidth, children }) => {
|
|
2362
|
+
const ref = React5.useRef(null);
|
|
2363
|
+
const [adjustedX, setAdjustedX] = React5.useState(x);
|
|
2364
|
+
React5.useEffect(() => {
|
|
2365
|
+
const el = ref.current;
|
|
2366
|
+
if (!el) return;
|
|
2367
|
+
const w = el.offsetWidth;
|
|
2368
|
+
const half = w / 2;
|
|
2369
|
+
const margin = 8;
|
|
2370
|
+
let nx = x;
|
|
2371
|
+
if (x - half < margin) nx = half + margin;
|
|
2372
|
+
else if (x + half > containerWidth - margin) nx = containerWidth - half - margin;
|
|
2373
|
+
setAdjustedX(nx);
|
|
2374
|
+
}, [x, containerWidth]);
|
|
2375
|
+
return /* @__PURE__ */ jsx305(
|
|
2376
|
+
"div",
|
|
2377
|
+
{
|
|
2378
|
+
ref,
|
|
2379
|
+
className: "chart-tooltip",
|
|
2380
|
+
style: { left: adjustedX, top: y },
|
|
2381
|
+
children
|
|
2382
|
+
}
|
|
2383
|
+
);
|
|
2384
|
+
};
|
|
2256
2385
|
var Chart = (props) => {
|
|
2257
2386
|
const { type, data, labels, tooltip: showTooltip = true } = props;
|
|
2258
2387
|
const { tooltip, show, hide, move, containerRef } = useChartTooltip(showTooltip);
|
|
2388
|
+
const { width, height } = useChartSize(containerRef);
|
|
2389
|
+
const ready = width > 0 && height > 0;
|
|
2259
2390
|
return /* @__PURE__ */ jsxs196("div", { className: "lib-xplat-chart", ref: containerRef, children: [
|
|
2260
|
-
type === "line" && /* @__PURE__ */ jsx305(LineChart, { data, labels, onHover: show, onMove: move, onLeave: hide }),
|
|
2261
|
-
type === "
|
|
2262
|
-
type === "
|
|
2263
|
-
type === "
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
{
|
|
2267
|
-
className: "chart-tooltip",
|
|
2268
|
-
style: { left: tooltip.x, top: tooltip.y },
|
|
2269
|
-
children: tooltip.content
|
|
2270
|
-
}
|
|
2271
|
-
)
|
|
2391
|
+
ready && type === "line" && /* @__PURE__ */ jsx305(LineChart, { data, labels, width, height, onHover: show, onMove: move, onLeave: hide }),
|
|
2392
|
+
ready && type === "curve" && /* @__PURE__ */ jsx305(CurveChart, { data, labels, width, height, onHover: show, onMove: move, onLeave: hide }),
|
|
2393
|
+
ready && type === "bar" && /* @__PURE__ */ jsx305(BarChart, { data, labels, width, height, onHover: show, onMove: move, onLeave: hide }),
|
|
2394
|
+
ready && type === "pie" && /* @__PURE__ */ jsx305(PieDonutChart, { data, labels, width, height, onHover: show, onMove: move, onLeave: hide }),
|
|
2395
|
+
ready && type === "doughnut" && /* @__PURE__ */ jsx305(PieDonutChart, { data, labels, width, height, isDoughnut: true, onHover: show, onMove: move, onLeave: hide }),
|
|
2396
|
+
tooltip.visible && /* @__PURE__ */ jsx305(TooltipBubble, { x: tooltip.x, y: tooltip.y, containerWidth: width, children: tooltip.content })
|
|
2272
2397
|
] });
|
|
2273
2398
|
};
|
|
2274
2399
|
Chart.displayName = "Chart";
|
|
@@ -2520,42 +2645,66 @@ var PasswordInput = React7.forwardRef(
|
|
|
2520
2645
|
PasswordInput.displayName = "PasswordInput";
|
|
2521
2646
|
var PasswordInput_default = PasswordInput;
|
|
2522
2647
|
|
|
2523
|
-
// src/
|
|
2648
|
+
// src/components/Modal/Modal.tsx
|
|
2524
2649
|
import React8 from "react";
|
|
2525
|
-
|
|
2650
|
+
import { createPortal } from "react-dom";
|
|
2651
|
+
import { jsx as jsx311 } from "react/jsx-runtime";
|
|
2652
|
+
var ANIMATION_DURATION_MS = 200;
|
|
2653
|
+
var Modal = (props) => {
|
|
2654
|
+
const { isOpen, onClose, children } = props;
|
|
2655
|
+
const [mounted, setMounted] = React8.useState(false);
|
|
2656
|
+
const [visible, setVisible] = React8.useState(false);
|
|
2526
2657
|
React8.useEffect(() => {
|
|
2527
|
-
if (
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2658
|
+
if (isOpen) {
|
|
2659
|
+
setMounted(true);
|
|
2660
|
+
const t2 = setTimeout(() => setVisible(true), 1);
|
|
2661
|
+
return () => clearTimeout(t2);
|
|
2662
|
+
}
|
|
2663
|
+
setVisible(false);
|
|
2664
|
+
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS);
|
|
2665
|
+
return () => clearTimeout(t);
|
|
2666
|
+
}, [isOpen]);
|
|
2667
|
+
if (typeof document === "undefined") return null;
|
|
2668
|
+
if (!mounted) return null;
|
|
2669
|
+
const stateClass = visible ? "enter" : "exit";
|
|
2670
|
+
return createPortal(
|
|
2671
|
+
/* @__PURE__ */ jsx311(
|
|
2672
|
+
"div",
|
|
2673
|
+
{
|
|
2674
|
+
className: clsx_default("lib-xplat-modal", "dim", stateClass),
|
|
2675
|
+
onClick: onClose,
|
|
2676
|
+
children: /* @__PURE__ */ jsx311(
|
|
2677
|
+
"div",
|
|
2678
|
+
{
|
|
2679
|
+
className: clsx_default("lib-xplat-modal", "modal-box", stateClass),
|
|
2680
|
+
role: "dialog",
|
|
2681
|
+
"aria-modal": "true",
|
|
2682
|
+
onClick: (e) => e.stopPropagation(),
|
|
2683
|
+
children
|
|
2684
|
+
}
|
|
2685
|
+
)
|
|
2536
2686
|
}
|
|
2537
|
-
|
|
2538
|
-
document.
|
|
2539
|
-
|
|
2540
|
-
return () => {
|
|
2541
|
-
document.removeEventListener("mousedown", listener);
|
|
2542
|
-
document.removeEventListener("touchstart", listener);
|
|
2543
|
-
};
|
|
2544
|
-
}, [refs, handler, enabled]);
|
|
2687
|
+
),
|
|
2688
|
+
document.body
|
|
2689
|
+
);
|
|
2545
2690
|
};
|
|
2546
|
-
|
|
2691
|
+
Modal.displayName = "Modal";
|
|
2692
|
+
var Modal_default = Modal;
|
|
2547
2693
|
|
|
2548
2694
|
// src/components/DatePicker/SingleDatePicker/index.tsx
|
|
2549
2695
|
import React9 from "react";
|
|
2550
|
-
import { Fragment as Fragment2, jsx as
|
|
2696
|
+
import { Fragment as Fragment2, jsx as jsx312, jsxs as jsxs200 } from "react/jsx-runtime";
|
|
2551
2697
|
var DayCell2 = React9.memo(
|
|
2552
2698
|
({
|
|
2553
2699
|
day,
|
|
2554
2700
|
disabled,
|
|
2555
2701
|
selected,
|
|
2556
2702
|
highlighted,
|
|
2703
|
+
isStart,
|
|
2704
|
+
isEnd,
|
|
2705
|
+
inRange,
|
|
2557
2706
|
onSelect
|
|
2558
|
-
}) => /* @__PURE__ */
|
|
2707
|
+
}) => /* @__PURE__ */ jsx312(
|
|
2559
2708
|
"button",
|
|
2560
2709
|
{
|
|
2561
2710
|
type: "button",
|
|
@@ -2563,8 +2712,9 @@ var DayCell2 = React9.memo(
|
|
|
2563
2712
|
"datepicker-day",
|
|
2564
2713
|
!day.isCurrentMonth && "outside",
|
|
2565
2714
|
disabled && "disabled",
|
|
2566
|
-
selected && "selected",
|
|
2715
|
+
(selected || isStart || isEnd) && "selected",
|
|
2567
2716
|
highlighted && !selected && "highlighted",
|
|
2717
|
+
inRange && !isStart && !isEnd && "in-range",
|
|
2568
2718
|
day.isToday && "today",
|
|
2569
2719
|
day.isSunday && "sunday",
|
|
2570
2720
|
day.isSaturday && "saturday"
|
|
@@ -2576,7 +2726,7 @@ var DayCell2 = React9.memo(
|
|
|
2576
2726
|
children: day.day
|
|
2577
2727
|
}
|
|
2578
2728
|
),
|
|
2579
|
-
(prev, next) => prev.selected === next.selected && prev.disabled === next.disabled && prev.highlighted === next.highlighted && prev.day === next.day
|
|
2729
|
+
(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
|
|
2580
2730
|
);
|
|
2581
2731
|
DayCell2.displayName = "DayCell";
|
|
2582
2732
|
var SingleDatePicker = (props) => {
|
|
@@ -2586,7 +2736,9 @@ var SingleDatePicker = (props) => {
|
|
|
2586
2736
|
minDate,
|
|
2587
2737
|
maxDate,
|
|
2588
2738
|
highlightDates = [],
|
|
2589
|
-
locale = "ko"
|
|
2739
|
+
locale = "ko",
|
|
2740
|
+
rangeStart,
|
|
2741
|
+
rangeEnd
|
|
2590
2742
|
} = props;
|
|
2591
2743
|
const initialYear = value?.getFullYear();
|
|
2592
2744
|
const initialMonth = value?.getMonth();
|
|
@@ -2634,6 +2786,8 @@ var SingleDatePicker = (props) => {
|
|
|
2634
2786
|
else if (pickerMode === "months") {
|
|
2635
2787
|
setYearRangeStart(Math.floor(year / 12) * 12);
|
|
2636
2788
|
setPickerMode("years");
|
|
2789
|
+
} else {
|
|
2790
|
+
setPickerMode("days");
|
|
2637
2791
|
}
|
|
2638
2792
|
};
|
|
2639
2793
|
const handleMonthSelect = (m) => {
|
|
@@ -2647,71 +2801,80 @@ var SingleDatePicker = (props) => {
|
|
|
2647
2801
|
const weekdays = WEEKDAY_LABELS[locale];
|
|
2648
2802
|
const monthLabels = MONTH_LABELS[locale];
|
|
2649
2803
|
const titleText = pickerMode === "days" ? locale === "ko" ? `${year}\uB144 ${monthLabels[month]}` : `${monthLabels[month]} ${year}` : pickerMode === "months" ? `${year}` : `${yearRangeStart} - ${yearRangeStart + 11}`;
|
|
2804
|
+
const hasRange = rangeStart != null && rangeEnd != null;
|
|
2650
2805
|
return /* @__PURE__ */ jsxs200(
|
|
2651
2806
|
"div",
|
|
2652
2807
|
{
|
|
2653
2808
|
className: clsx_default("lib-xplat-datepicker", "single"),
|
|
2654
2809
|
children: [
|
|
2655
2810
|
/* @__PURE__ */ jsxs200("div", { className: "datepicker-header", children: [
|
|
2656
|
-
/* @__PURE__ */
|
|
2657
|
-
/* @__PURE__ */
|
|
2658
|
-
/* @__PURE__ */
|
|
2811
|
+
/* @__PURE__ */ jsx312("button", { className: "datepicker-nav", onClick: handlePrev, type: "button", children: /* @__PURE__ */ jsx312(ChevronLeftIcon_default, {}) }),
|
|
2812
|
+
/* @__PURE__ */ jsx312("button", { className: "datepicker-title", onClick: handleTitleClick, type: "button", children: titleText }),
|
|
2813
|
+
/* @__PURE__ */ jsx312("button", { className: "datepicker-nav", onClick: handleNext, type: "button", children: /* @__PURE__ */ jsx312(ChevronRightIcon_default, {}) })
|
|
2659
2814
|
] }),
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2815
|
+
/* @__PURE__ */ jsxs200("div", { className: "datepicker-body", children: [
|
|
2816
|
+
pickerMode === "years" && /* @__PURE__ */ jsx312("div", { className: "datepicker-picker-grid", children: Array.from({ length: 12 }, (_, i) => {
|
|
2817
|
+
const y = yearRangeStart + i;
|
|
2818
|
+
return /* @__PURE__ */ jsx312(
|
|
2819
|
+
"button",
|
|
2820
|
+
{
|
|
2821
|
+
type: "button",
|
|
2822
|
+
className: clsx_default("datepicker-picker-cell", y === year && "active"),
|
|
2823
|
+
onClick: () => handleYearSelect(y),
|
|
2824
|
+
children: y
|
|
2825
|
+
},
|
|
2826
|
+
y
|
|
2827
|
+
);
|
|
2828
|
+
}) }),
|
|
2829
|
+
pickerMode === "months" && /* @__PURE__ */ jsx312("div", { className: "datepicker-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ jsx312(
|
|
2663
2830
|
"button",
|
|
2664
2831
|
{
|
|
2665
2832
|
type: "button",
|
|
2666
|
-
className: clsx_default("datepicker-picker-cell",
|
|
2667
|
-
onClick: () =>
|
|
2668
|
-
children: y
|
|
2669
|
-
},
|
|
2670
|
-
y
|
|
2671
|
-
);
|
|
2672
|
-
}) }),
|
|
2673
|
-
pickerMode === "months" && /* @__PURE__ */ jsx311("div", { className: "datepicker-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ jsx311(
|
|
2674
|
-
"button",
|
|
2675
|
-
{
|
|
2676
|
-
type: "button",
|
|
2677
|
-
className: clsx_default("datepicker-picker-cell", i === month && "active"),
|
|
2678
|
-
onClick: () => handleMonthSelect(i),
|
|
2679
|
-
children: label
|
|
2680
|
-
},
|
|
2681
|
-
i
|
|
2682
|
-
)) }),
|
|
2683
|
-
pickerMode === "days" && /* @__PURE__ */ jsxs200(Fragment2, { children: [
|
|
2684
|
-
/* @__PURE__ */ jsx311("div", { className: "datepicker-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ jsx311(
|
|
2685
|
-
"div",
|
|
2686
|
-
{
|
|
2687
|
-
className: clsx_default(
|
|
2688
|
-
"datepicker-weekday",
|
|
2689
|
-
i === 0 && "sunday",
|
|
2690
|
-
i === 6 && "saturday"
|
|
2691
|
-
),
|
|
2833
|
+
className: clsx_default("datepicker-picker-cell", i === month && "active"),
|
|
2834
|
+
onClick: () => handleMonthSelect(i),
|
|
2692
2835
|
children: label
|
|
2693
2836
|
},
|
|
2694
|
-
|
|
2837
|
+
i
|
|
2695
2838
|
)) }),
|
|
2696
|
-
/* @__PURE__ */
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
const selected = value ? isSameDay(day.date, value) : false;
|
|
2700
|
-
const highlighted = highlightSet.has(
|
|
2701
|
-
`${day.date.getFullYear()}-${day.date.getMonth()}-${day.date.getDate()}`
|
|
2702
|
-
);
|
|
2703
|
-
return /* @__PURE__ */ jsx311(
|
|
2704
|
-
DayCell2,
|
|
2839
|
+
pickerMode === "days" && /* @__PURE__ */ jsxs200(Fragment2, { children: [
|
|
2840
|
+
/* @__PURE__ */ jsx312("div", { className: "datepicker-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ jsx312(
|
|
2841
|
+
"div",
|
|
2705
2842
|
{
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2843
|
+
className: clsx_default(
|
|
2844
|
+
"datepicker-weekday",
|
|
2845
|
+
i === 0 && "sunday",
|
|
2846
|
+
i === 6 && "saturday"
|
|
2847
|
+
),
|
|
2848
|
+
children: label
|
|
2711
2849
|
},
|
|
2712
|
-
|
|
2713
|
-
)
|
|
2714
|
-
|
|
2850
|
+
label
|
|
2851
|
+
)) }),
|
|
2852
|
+
/* @__PURE__ */ jsx312("div", { className: "datepicker-grid", children: days.map((day, idx) => {
|
|
2853
|
+
const t = day.date.getTime();
|
|
2854
|
+
const disabled = t < minTime || t > maxTime;
|
|
2855
|
+
const selected = value ? isSameDay(day.date, value) : false;
|
|
2856
|
+
const highlighted = highlightSet.has(
|
|
2857
|
+
`${day.date.getFullYear()}-${day.date.getMonth()}-${day.date.getDate()}`
|
|
2858
|
+
);
|
|
2859
|
+
const isStart = hasRange ? isSameDay(day.date, rangeStart) : false;
|
|
2860
|
+
const isEnd = hasRange ? isSameDay(day.date, rangeEnd) : false;
|
|
2861
|
+
const inRangeVal = hasRange ? isInRange(day.date, rangeStart, rangeEnd) : false;
|
|
2862
|
+
return /* @__PURE__ */ jsx312(
|
|
2863
|
+
DayCell2,
|
|
2864
|
+
{
|
|
2865
|
+
day,
|
|
2866
|
+
disabled,
|
|
2867
|
+
selected,
|
|
2868
|
+
highlighted,
|
|
2869
|
+
isStart,
|
|
2870
|
+
isEnd,
|
|
2871
|
+
inRange: inRangeVal,
|
|
2872
|
+
onSelect: handleSelect
|
|
2873
|
+
},
|
|
2874
|
+
idx
|
|
2875
|
+
);
|
|
2876
|
+
}) })
|
|
2877
|
+
] })
|
|
2715
2878
|
] })
|
|
2716
2879
|
]
|
|
2717
2880
|
}
|
|
@@ -2721,7 +2884,7 @@ SingleDatePicker.displayName = "SingleDatePicker";
|
|
|
2721
2884
|
var SingleDatePicker_default = SingleDatePicker;
|
|
2722
2885
|
|
|
2723
2886
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
2724
|
-
import { jsx as
|
|
2887
|
+
import { jsx as jsx313, jsxs as jsxs201 } from "react/jsx-runtime";
|
|
2725
2888
|
var formatDate = (date) => {
|
|
2726
2889
|
if (!date || !(date instanceof Date) || isNaN(date.getTime())) return "";
|
|
2727
2890
|
const y = date.getFullYear();
|
|
@@ -2730,137 +2893,131 @@ var formatDate = (date) => {
|
|
|
2730
2893
|
return `${y}/${m}/${d}`;
|
|
2731
2894
|
};
|
|
2732
2895
|
var InputDatePicker = (props) => {
|
|
2733
|
-
const { value, onChange, minDate, maxDate, disabled, locale, placeholder } = props;
|
|
2896
|
+
const { value, onChange, minDate, maxDate, disabled, locale = "ko", placeholder } = props;
|
|
2734
2897
|
const [isOpen, setIsOpen] = React10.useState(false);
|
|
2735
|
-
const
|
|
2736
|
-
const
|
|
2737
|
-
|
|
2898
|
+
const [tempDate, setTempDate] = React10.useState(value ?? /* @__PURE__ */ new Date());
|
|
2899
|
+
const handleOpen = () => {
|
|
2900
|
+
if (disabled) return;
|
|
2901
|
+
setTempDate(value ?? /* @__PURE__ */ new Date());
|
|
2902
|
+
setIsOpen(true);
|
|
2903
|
+
};
|
|
2738
2904
|
const handleSelect = (date) => {
|
|
2739
|
-
if (
|
|
2740
|
-
|
|
2905
|
+
if (date) setTempDate(date);
|
|
2906
|
+
};
|
|
2907
|
+
const handleApply = () => {
|
|
2908
|
+
onChange?.(tempDate);
|
|
2741
2909
|
setIsOpen(false);
|
|
2742
2910
|
};
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
}
|
|
2775
|
-
) })
|
|
2776
|
-
]
|
|
2777
|
-
}
|
|
2778
|
-
);
|
|
2911
|
+
const handleClose = () => {
|
|
2912
|
+
setIsOpen(false);
|
|
2913
|
+
};
|
|
2914
|
+
return /* @__PURE__ */ jsxs201("div", { className: clsx_default("lib-xplat-datepicker input-datepicker", disabled && "disabled"), children: [
|
|
2915
|
+
/* @__PURE__ */ jsx313("div", { className: "input-datepicker-trigger", onClick: handleOpen, children: /* @__PURE__ */ jsx313(
|
|
2916
|
+
Input_default,
|
|
2917
|
+
{
|
|
2918
|
+
value: formatDate(value),
|
|
2919
|
+
placeholder,
|
|
2920
|
+
suffix: /* @__PURE__ */ jsx313(CalenderIcon_default, {}),
|
|
2921
|
+
disabled,
|
|
2922
|
+
readOnly: true
|
|
2923
|
+
}
|
|
2924
|
+
) }),
|
|
2925
|
+
/* @__PURE__ */ jsx313(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ jsxs201("div", { className: "lib-xplat-popup-datepicker-card", children: [
|
|
2926
|
+
/* @__PURE__ */ jsx313("div", { className: "popup-datepicker-content", children: /* @__PURE__ */ jsx313(
|
|
2927
|
+
SingleDatePicker_default,
|
|
2928
|
+
{
|
|
2929
|
+
value: tempDate,
|
|
2930
|
+
onChange: handleSelect,
|
|
2931
|
+
minDate,
|
|
2932
|
+
maxDate,
|
|
2933
|
+
locale
|
|
2934
|
+
}
|
|
2935
|
+
) }),
|
|
2936
|
+
/* @__PURE__ */ jsxs201("div", { className: "popup-datepicker-footer", children: [
|
|
2937
|
+
/* @__PURE__ */ jsx313(Button_default, { type: "secondary", onClick: handleClose, children: locale === "ko" ? "\uCDE8\uC18C" : "Cancel" }),
|
|
2938
|
+
/* @__PURE__ */ jsx313(Button_default, { type: "primary", onClick: handleApply, children: locale === "ko" ? "\uC801\uC6A9" : "Apply" })
|
|
2939
|
+
] })
|
|
2940
|
+
] }) })
|
|
2941
|
+
] });
|
|
2779
2942
|
};
|
|
2780
2943
|
InputDatePicker.displayName = "InputDatePicker";
|
|
2781
2944
|
var InputDatePicker_default = InputDatePicker;
|
|
2782
2945
|
|
|
2783
2946
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
2947
|
+
import React14 from "react";
|
|
2948
|
+
|
|
2949
|
+
// src/components/DatePicker/RangePicker/index.tsx
|
|
2784
2950
|
import React13 from "react";
|
|
2785
2951
|
|
|
2786
|
-
// src/components/
|
|
2952
|
+
// src/components/Tab/Tab.tsx
|
|
2953
|
+
import React12 from "react";
|
|
2954
|
+
|
|
2955
|
+
// src/components/Tab/TabItem.tsx
|
|
2787
2956
|
import React11 from "react";
|
|
2788
|
-
import {
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
const t2 = setTimeout(() => setVisible(true), 1);
|
|
2799
|
-
return () => clearTimeout(t2);
|
|
2957
|
+
import { jsx as jsx314 } from "react/jsx-runtime";
|
|
2958
|
+
var TabItem = React11.forwardRef((props, ref) => {
|
|
2959
|
+
const { isActive, title, onClick } = props;
|
|
2960
|
+
return /* @__PURE__ */ jsx314(
|
|
2961
|
+
"div",
|
|
2962
|
+
{
|
|
2963
|
+
ref,
|
|
2964
|
+
className: clsx_default("tab-item", isActive ? "active" : null),
|
|
2965
|
+
onClick,
|
|
2966
|
+
children: title
|
|
2800
2967
|
}
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2968
|
+
);
|
|
2969
|
+
});
|
|
2970
|
+
TabItem.displayName = "TabItem";
|
|
2971
|
+
var TabItem_default = TabItem;
|
|
2972
|
+
|
|
2973
|
+
// src/components/Tab/Tab.tsx
|
|
2974
|
+
import { jsx as jsx315, jsxs as jsxs202 } from "react/jsx-runtime";
|
|
2975
|
+
var Tab = (props) => {
|
|
2976
|
+
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
2977
|
+
const [underlineStyle, setUnderlineStyle] = React12.useState({
|
|
2978
|
+
left: 0,
|
|
2979
|
+
width: 0
|
|
2980
|
+
});
|
|
2981
|
+
const itemRefs = React12.useRef([]);
|
|
2982
|
+
const handleChangeActiveTab = (tabItem, tabIdx) => {
|
|
2983
|
+
onChange(tabItem, tabIdx);
|
|
2984
|
+
};
|
|
2985
|
+
React12.useEffect(() => {
|
|
2986
|
+
const el = itemRefs.current[activeIndex];
|
|
2987
|
+
if (el) {
|
|
2988
|
+
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
2989
|
+
}
|
|
2990
|
+
}, [activeIndex, tabs.length]);
|
|
2991
|
+
return /* @__PURE__ */ jsxs202("div", { className: clsx_default("lib-xplat-tab", `type-${type}`, size), children: [
|
|
2992
|
+
tabs.map((tab, idx) => /* @__PURE__ */ jsx315(
|
|
2993
|
+
TabItem_default,
|
|
2994
|
+
{
|
|
2995
|
+
onClick: () => handleChangeActiveTab(tab, idx),
|
|
2996
|
+
isActive: activeIndex === idx,
|
|
2997
|
+
ref: (el) => {
|
|
2998
|
+
itemRefs.current[idx] = el;
|
|
2999
|
+
},
|
|
3000
|
+
title: tab.title
|
|
3001
|
+
},
|
|
3002
|
+
`${tab.value}_${idx}`
|
|
3003
|
+
)),
|
|
3004
|
+
type === "toggle" && /* @__PURE__ */ jsx315(
|
|
2810
3005
|
"div",
|
|
2811
3006
|
{
|
|
2812
|
-
className:
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
className: clsx_default("lib-xplat-modal", "modal-box", stateClass),
|
|
2818
|
-
role: "dialog",
|
|
2819
|
-
"aria-modal": "true",
|
|
2820
|
-
onClick: (e) => e.stopPropagation(),
|
|
2821
|
-
children
|
|
2822
|
-
}
|
|
2823
|
-
)
|
|
3007
|
+
className: "tab-toggle-underline",
|
|
3008
|
+
style: {
|
|
3009
|
+
left: underlineStyle.left,
|
|
3010
|
+
width: underlineStyle.width
|
|
3011
|
+
}
|
|
2824
3012
|
}
|
|
2825
|
-
)
|
|
2826
|
-
|
|
2827
|
-
);
|
|
3013
|
+
)
|
|
3014
|
+
] });
|
|
2828
3015
|
};
|
|
2829
|
-
|
|
2830
|
-
var
|
|
3016
|
+
Tab.displayName = "Tab";
|
|
3017
|
+
var Tab_default = Tab;
|
|
2831
3018
|
|
|
2832
3019
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
2833
|
-
import
|
|
2834
|
-
import { jsx as jsx314, jsxs as jsxs202 } from "react/jsx-runtime";
|
|
2835
|
-
var RangeDayCell = React12.memo(
|
|
2836
|
-
({
|
|
2837
|
-
day,
|
|
2838
|
-
disabled,
|
|
2839
|
-
isStart,
|
|
2840
|
-
isEnd,
|
|
2841
|
-
inRange,
|
|
2842
|
-
onClick
|
|
2843
|
-
}) => /* @__PURE__ */ jsx314(
|
|
2844
|
-
"button",
|
|
2845
|
-
{
|
|
2846
|
-
type: "button",
|
|
2847
|
-
className: clsx_default(
|
|
2848
|
-
"datepicker-day",
|
|
2849
|
-
!day.isCurrentMonth && "outside",
|
|
2850
|
-
disabled && "disabled",
|
|
2851
|
-
(isStart || isEnd) && "selected",
|
|
2852
|
-
inRange && !isStart && !isEnd && "in-range",
|
|
2853
|
-
day.isToday && "today",
|
|
2854
|
-
day.isSunday && "sunday",
|
|
2855
|
-
day.isSaturday && "saturday"
|
|
2856
|
-
),
|
|
2857
|
-
disabled: disabled || !day.isCurrentMonth,
|
|
2858
|
-
onClick,
|
|
2859
|
-
children: day.day
|
|
2860
|
-
}
|
|
2861
|
-
)
|
|
2862
|
-
);
|
|
2863
|
-
RangeDayCell.displayName = "RangeDayCell";
|
|
3020
|
+
import { jsx as jsx316, jsxs as jsxs203 } from "react/jsx-runtime";
|
|
2864
3021
|
var RangePicker = (props) => {
|
|
2865
3022
|
const {
|
|
2866
3023
|
startDate,
|
|
@@ -2870,139 +3027,92 @@ var RangePicker = (props) => {
|
|
|
2870
3027
|
maxDate,
|
|
2871
3028
|
locale = "ko"
|
|
2872
3029
|
} = props;
|
|
2873
|
-
const [activeTab, setActiveTab] =
|
|
2874
|
-
const
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
if (minDate) {
|
|
2879
|
-
const min = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()).getTime();
|
|
2880
|
-
if (d < min) return true;
|
|
2881
|
-
}
|
|
2882
|
-
if (maxDate) {
|
|
2883
|
-
const max = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()).getTime();
|
|
2884
|
-
if (d > max) return true;
|
|
2885
|
-
}
|
|
2886
|
-
if (type === "end") {
|
|
2887
|
-
const start = new Date(startDate.getFullYear(), startDate.getMonth(), startDate.getDate()).getTime();
|
|
2888
|
-
if (d < start) return true;
|
|
2889
|
-
}
|
|
2890
|
-
if (type === "start") {
|
|
2891
|
-
const end = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate()).getTime();
|
|
2892
|
-
if (d > end) return true;
|
|
2893
|
-
}
|
|
2894
|
-
return false;
|
|
3030
|
+
const [activeTab, setActiveTab] = React13.useState("start");
|
|
3031
|
+
const handleStartChange = (date) => {
|
|
3032
|
+
if (!date) return;
|
|
3033
|
+
const newStart = date > endDate ? endDate : date;
|
|
3034
|
+
onChange?.({ startDate: newStart, endDate });
|
|
2895
3035
|
};
|
|
2896
|
-
const
|
|
2897
|
-
|
|
2898
|
-
const
|
|
2899
|
-
|
|
2900
|
-
/* @__PURE__ */ jsx314("span", { className: "datepicker-range-label", children: label }),
|
|
2901
|
-
/* @__PURE__ */ jsxs202("div", { className: "datepicker-header", children: [
|
|
2902
|
-
/* @__PURE__ */ jsx314(
|
|
2903
|
-
"button",
|
|
2904
|
-
{
|
|
2905
|
-
className: "datepicker-nav",
|
|
2906
|
-
onClick: cal.goToPrevMonth,
|
|
2907
|
-
type: "button",
|
|
2908
|
-
children: /* @__PURE__ */ jsx314(ChevronLeftIcon_default, {})
|
|
2909
|
-
}
|
|
2910
|
-
),
|
|
2911
|
-
/* @__PURE__ */ jsx314("span", { className: "datepicker-title", children: locale === "ko" ? `${cal.year}\uB144 ${MONTH_LABELS.ko[cal.month]}` : `${MONTH_LABELS.en[cal.month]} ${cal.year}` }),
|
|
2912
|
-
/* @__PURE__ */ jsx314(
|
|
2913
|
-
"button",
|
|
2914
|
-
{
|
|
2915
|
-
className: "datepicker-nav",
|
|
2916
|
-
onClick: cal.goToNextMonth,
|
|
2917
|
-
type: "button",
|
|
2918
|
-
children: /* @__PURE__ */ jsx314(ChevronRightIcon_default, {})
|
|
2919
|
-
}
|
|
2920
|
-
)
|
|
2921
|
-
] }),
|
|
2922
|
-
/* @__PURE__ */ jsx314("div", { className: "datepicker-weekdays", children: weekdays.map((w, i) => /* @__PURE__ */ jsx314(
|
|
2923
|
-
"div",
|
|
2924
|
-
{
|
|
2925
|
-
className: clsx_default(
|
|
2926
|
-
"datepicker-weekday",
|
|
2927
|
-
i === 0 && "sunday",
|
|
2928
|
-
i === 6 && "saturday"
|
|
2929
|
-
),
|
|
2930
|
-
children: w
|
|
2931
|
-
},
|
|
2932
|
-
w
|
|
2933
|
-
)) }),
|
|
2934
|
-
/* @__PURE__ */ jsx314("div", { className: "datepicker-grid", children: cal.days.map((day, idx) => {
|
|
2935
|
-
const disabled = isDisabled(day.date, type);
|
|
2936
|
-
const isStart = isSameDay(day.date, startDate);
|
|
2937
|
-
const isEnd = isSameDay(day.date, endDate);
|
|
2938
|
-
const inRange = isInRange(day.date, startDate, endDate);
|
|
2939
|
-
return /* @__PURE__ */ jsx314(
|
|
2940
|
-
RangeDayCell,
|
|
2941
|
-
{
|
|
2942
|
-
day,
|
|
2943
|
-
disabled,
|
|
2944
|
-
isStart,
|
|
2945
|
-
isEnd,
|
|
2946
|
-
inRange,
|
|
2947
|
-
onClick: () => {
|
|
2948
|
-
if (!disabled && day.isCurrentMonth) {
|
|
2949
|
-
if (type === "start") {
|
|
2950
|
-
const newStart = day.date > endDate ? endDate : day.date;
|
|
2951
|
-
onChange?.({ startDate: newStart, endDate });
|
|
2952
|
-
} else {
|
|
2953
|
-
const newEnd = day.date < startDate ? startDate : day.date;
|
|
2954
|
-
onChange?.({ startDate, endDate: newEnd });
|
|
2955
|
-
}
|
|
2956
|
-
}
|
|
2957
|
-
}
|
|
2958
|
-
},
|
|
2959
|
-
idx
|
|
2960
|
-
);
|
|
2961
|
-
}) })
|
|
2962
|
-
] });
|
|
3036
|
+
const handleEndChange = (date) => {
|
|
3037
|
+
if (!date) return;
|
|
3038
|
+
const newEnd = date < startDate ? startDate : date;
|
|
3039
|
+
onChange?.({ startDate, endDate: newEnd });
|
|
2963
3040
|
};
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
3041
|
+
const startMaxDate = maxDate && endDate < maxDate ? endDate : endDate;
|
|
3042
|
+
const endMinDate = minDate && startDate > minDate ? startDate : startDate;
|
|
3043
|
+
return /* @__PURE__ */ jsxs203("div", { className: clsx_default("lib-xplat-datepicker", "range"), children: [
|
|
3044
|
+
/* @__PURE__ */ jsx316("div", { className: "datepicker-range-tabs", children: /* @__PURE__ */ jsx316(
|
|
3045
|
+
Tab_default,
|
|
3046
|
+
{
|
|
3047
|
+
activeIndex: activeTab === "start" ? 0 : 1,
|
|
3048
|
+
tabs: [
|
|
3049
|
+
{ value: "start", title: locale === "ko" ? "\uC2DC\uC791\uC77C" : "Start" },
|
|
3050
|
+
{ value: "end", title: locale === "ko" ? "\uC885\uB8CC\uC77C" : "End" }
|
|
3051
|
+
],
|
|
3052
|
+
onChange: (tab) => setActiveTab(tab.value),
|
|
3053
|
+
type: "toggle",
|
|
3054
|
+
size: "sm"
|
|
3055
|
+
}
|
|
3056
|
+
) }),
|
|
3057
|
+
/* @__PURE__ */ jsxs203("div", { className: "datepicker-range-panels", children: [
|
|
3058
|
+
/* @__PURE__ */ jsx316(
|
|
3059
|
+
SingleDatePicker_default,
|
|
3060
|
+
{
|
|
3061
|
+
value: startDate,
|
|
3062
|
+
onChange: handleStartChange,
|
|
3063
|
+
minDate,
|
|
3064
|
+
maxDate: startMaxDate,
|
|
3065
|
+
rangeStart: startDate,
|
|
3066
|
+
rangeEnd: endDate,
|
|
3067
|
+
locale
|
|
3068
|
+
}
|
|
3069
|
+
),
|
|
3070
|
+
/* @__PURE__ */ jsx316(
|
|
3071
|
+
SingleDatePicker_default,
|
|
3072
|
+
{
|
|
3073
|
+
value: endDate,
|
|
3074
|
+
onChange: handleEndChange,
|
|
3075
|
+
minDate: endMinDate,
|
|
3076
|
+
maxDate,
|
|
3077
|
+
rangeStart: startDate,
|
|
3078
|
+
rangeEnd: endDate,
|
|
3079
|
+
locale
|
|
3080
|
+
}
|
|
3081
|
+
)
|
|
3082
|
+
] }),
|
|
3083
|
+
/* @__PURE__ */ jsx316("div", { className: "datepicker-range-mobile", children: activeTab === "start" ? /* @__PURE__ */ jsx316(
|
|
3084
|
+
SingleDatePicker_default,
|
|
3085
|
+
{
|
|
3086
|
+
value: startDate,
|
|
3087
|
+
onChange: handleStartChange,
|
|
3088
|
+
minDate,
|
|
3089
|
+
maxDate: startMaxDate,
|
|
3090
|
+
rangeStart: startDate,
|
|
3091
|
+
rangeEnd: endDate,
|
|
3092
|
+
locale
|
|
3093
|
+
}
|
|
3094
|
+
) : /* @__PURE__ */ jsx316(
|
|
3095
|
+
SingleDatePicker_default,
|
|
3096
|
+
{
|
|
3097
|
+
value: endDate,
|
|
3098
|
+
onChange: handleEndChange,
|
|
3099
|
+
minDate: endMinDate,
|
|
3100
|
+
maxDate,
|
|
3101
|
+
rangeStart: startDate,
|
|
3102
|
+
rangeEnd: endDate,
|
|
3103
|
+
locale
|
|
3104
|
+
}
|
|
3105
|
+
) })
|
|
3106
|
+
] });
|
|
2997
3107
|
};
|
|
2998
3108
|
RangePicker.displayName = "RangePicker";
|
|
2999
3109
|
var RangePicker_default = RangePicker;
|
|
3000
3110
|
|
|
3001
3111
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
3002
|
-
import { jsx as
|
|
3112
|
+
import { jsx as jsx317, jsxs as jsxs204 } from "react/jsx-runtime";
|
|
3003
3113
|
var PopupPicker = (props) => {
|
|
3004
3114
|
const { component, type, locale } = props;
|
|
3005
|
-
const [isOpen, setIsOpen] =
|
|
3115
|
+
const [isOpen, setIsOpen] = React14.useState(false);
|
|
3006
3116
|
const handleClick = () => setIsOpen(true);
|
|
3007
3117
|
const handleClose = () => setIsOpen(false);
|
|
3008
3118
|
const handleSingleChange = (date) => {
|
|
@@ -3010,11 +3120,11 @@ var PopupPicker = (props) => {
|
|
|
3010
3120
|
props.onChange?.(date);
|
|
3011
3121
|
handleClose();
|
|
3012
3122
|
};
|
|
3013
|
-
return /* @__PURE__ */
|
|
3014
|
-
|
|
3015
|
-
/* @__PURE__ */
|
|
3016
|
-
/* @__PURE__ */
|
|
3017
|
-
type === "single" && /* @__PURE__ */
|
|
3123
|
+
return /* @__PURE__ */ jsxs204("div", { className: "lib-xplat-popup-datepicker", children: [
|
|
3124
|
+
React14.cloneElement(component, { onClick: handleClick }),
|
|
3125
|
+
/* @__PURE__ */ jsx317(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ jsxs204("div", { className: clsx_default("lib-xplat-popup-datepicker-card", type === "range" && "range-mode"), children: [
|
|
3126
|
+
/* @__PURE__ */ jsxs204("div", { className: "popup-datepicker-content", children: [
|
|
3127
|
+
type === "single" && /* @__PURE__ */ jsx317(
|
|
3018
3128
|
SingleDatePicker_default,
|
|
3019
3129
|
{
|
|
3020
3130
|
value: props.value,
|
|
@@ -3024,7 +3134,7 @@ var PopupPicker = (props) => {
|
|
|
3024
3134
|
locale
|
|
3025
3135
|
}
|
|
3026
3136
|
),
|
|
3027
|
-
type === "range" && /* @__PURE__ */
|
|
3137
|
+
type === "range" && /* @__PURE__ */ jsx317(
|
|
3028
3138
|
RangePicker_default,
|
|
3029
3139
|
{
|
|
3030
3140
|
startDate: props.startDate,
|
|
@@ -3036,8 +3146,8 @@ var PopupPicker = (props) => {
|
|
|
3036
3146
|
}
|
|
3037
3147
|
)
|
|
3038
3148
|
] }),
|
|
3039
|
-
/* @__PURE__ */
|
|
3040
|
-
/* @__PURE__ */
|
|
3149
|
+
/* @__PURE__ */ jsxs204("div", { className: "popup-datepicker-footer", children: [
|
|
3150
|
+
/* @__PURE__ */ jsx317(
|
|
3041
3151
|
Button_default,
|
|
3042
3152
|
{
|
|
3043
3153
|
type: "secondary",
|
|
@@ -3045,7 +3155,7 @@ var PopupPicker = (props) => {
|
|
|
3045
3155
|
children: locale === "ko" ? "\uCDE8\uC18C" : "Cancel"
|
|
3046
3156
|
}
|
|
3047
3157
|
),
|
|
3048
|
-
/* @__PURE__ */
|
|
3158
|
+
/* @__PURE__ */ jsx317(Button_default, { type: "primary", onClick: handleClose, children: locale === "ko" ? "\uC801\uC6A9" : "Apply" })
|
|
3049
3159
|
] })
|
|
3050
3160
|
] }) })
|
|
3051
3161
|
] });
|
|
@@ -3054,10 +3164,10 @@ PopupPicker.displayName = "PopupPicker";
|
|
|
3054
3164
|
var PopupPicker_default = PopupPicker;
|
|
3055
3165
|
|
|
3056
3166
|
// src/components/Divider/Divider.tsx
|
|
3057
|
-
import { jsx as
|
|
3167
|
+
import { jsx as jsx318 } from "react/jsx-runtime";
|
|
3058
3168
|
var Divider = (props) => {
|
|
3059
3169
|
const { orientation = "horizontal" } = props;
|
|
3060
|
-
return /* @__PURE__ */
|
|
3170
|
+
return /* @__PURE__ */ jsx318(
|
|
3061
3171
|
"div",
|
|
3062
3172
|
{
|
|
3063
3173
|
className: clsx_default("lib-xplat-divider", orientation),
|
|
@@ -3070,15 +3180,15 @@ Divider.displayName = "Divider";
|
|
|
3070
3180
|
var Divider_default = Divider;
|
|
3071
3181
|
|
|
3072
3182
|
// src/components/Drawer/Drawer.tsx
|
|
3073
|
-
import
|
|
3183
|
+
import React15 from "react";
|
|
3074
3184
|
import { createPortal as createPortal2 } from "react-dom";
|
|
3075
|
-
import { jsx as
|
|
3185
|
+
import { jsx as jsx319, jsxs as jsxs205 } from "react/jsx-runtime";
|
|
3076
3186
|
var ANIMATION_DURATION_MS2 = 250;
|
|
3077
3187
|
var Drawer = (props) => {
|
|
3078
3188
|
const { isOpen, onClose, placement = "right", width = 320, title, children } = props;
|
|
3079
|
-
const [mounted, setMounted] =
|
|
3080
|
-
const [visible, setVisible] =
|
|
3081
|
-
|
|
3189
|
+
const [mounted, setMounted] = React15.useState(false);
|
|
3190
|
+
const [visible, setVisible] = React15.useState(false);
|
|
3191
|
+
React15.useEffect(() => {
|
|
3082
3192
|
if (isOpen) {
|
|
3083
3193
|
setMounted(true);
|
|
3084
3194
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -3093,12 +3203,12 @@ var Drawer = (props) => {
|
|
|
3093
3203
|
const stateClass = visible ? "enter" : "exit";
|
|
3094
3204
|
const widthValue = typeof width === "number" ? `${width}px` : width;
|
|
3095
3205
|
return createPortal2(
|
|
3096
|
-
/* @__PURE__ */
|
|
3206
|
+
/* @__PURE__ */ jsx319(
|
|
3097
3207
|
"div",
|
|
3098
3208
|
{
|
|
3099
3209
|
className: clsx_default("lib-xplat-drawer-overlay", stateClass),
|
|
3100
3210
|
onClick: onClose,
|
|
3101
|
-
children: /* @__PURE__ */
|
|
3211
|
+
children: /* @__PURE__ */ jsxs205(
|
|
3102
3212
|
"div",
|
|
3103
3213
|
{
|
|
3104
3214
|
className: clsx_default("lib-xplat-drawer", placement, stateClass),
|
|
@@ -3107,11 +3217,11 @@ var Drawer = (props) => {
|
|
|
3107
3217
|
"aria-modal": "true",
|
|
3108
3218
|
onClick: (e) => e.stopPropagation(),
|
|
3109
3219
|
children: [
|
|
3110
|
-
title && /* @__PURE__ */
|
|
3111
|
-
/* @__PURE__ */
|
|
3112
|
-
/* @__PURE__ */
|
|
3220
|
+
title && /* @__PURE__ */ jsxs205("div", { className: "drawer-header", children: [
|
|
3221
|
+
/* @__PURE__ */ jsx319("span", { className: "drawer-title", children: title }),
|
|
3222
|
+
/* @__PURE__ */ jsx319("button", { className: "close-btn", onClick: onClose, "aria-label": "\uB2EB\uAE30", children: "\xD7" })
|
|
3113
3223
|
] }),
|
|
3114
|
-
/* @__PURE__ */
|
|
3224
|
+
/* @__PURE__ */ jsx319("div", { className: "drawer-body", children })
|
|
3115
3225
|
]
|
|
3116
3226
|
}
|
|
3117
3227
|
)
|
|
@@ -3124,16 +3234,16 @@ Drawer.displayName = "Drawer";
|
|
|
3124
3234
|
var Drawer_default = Drawer;
|
|
3125
3235
|
|
|
3126
3236
|
// src/components/Dropdown/Dropdown.tsx
|
|
3127
|
-
import
|
|
3237
|
+
import React18 from "react";
|
|
3128
3238
|
|
|
3129
3239
|
// src/tokens/hooks/useAutoPosition.ts
|
|
3130
|
-
import
|
|
3240
|
+
import React16 from "react";
|
|
3131
3241
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
3132
|
-
const [position, setPosition] =
|
|
3242
|
+
const [position, setPosition] = React16.useState({
|
|
3133
3243
|
position: {},
|
|
3134
3244
|
direction: "bottom"
|
|
3135
3245
|
});
|
|
3136
|
-
const calculatePosition =
|
|
3246
|
+
const calculatePosition = React16.useCallback(() => {
|
|
3137
3247
|
if (!triggerRef.current || !popRef.current) return;
|
|
3138
3248
|
const triggerRect = triggerRef.current.getBoundingClientRect();
|
|
3139
3249
|
const popRect = popRef.current.getBoundingClientRect();
|
|
@@ -3155,7 +3265,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
3155
3265
|
direction
|
|
3156
3266
|
});
|
|
3157
3267
|
}, [triggerRef, popRef]);
|
|
3158
|
-
|
|
3268
|
+
React16.useEffect(() => {
|
|
3159
3269
|
calculatePosition();
|
|
3160
3270
|
window.addEventListener("resize", calculatePosition);
|
|
3161
3271
|
return () => window.removeEventListener("resize", calculatePosition);
|
|
@@ -3164,18 +3274,43 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
3164
3274
|
};
|
|
3165
3275
|
var useAutoPosition_default = useAutoPosition;
|
|
3166
3276
|
|
|
3277
|
+
// src/tokens/hooks/useClickOutside.ts
|
|
3278
|
+
import React17 from "react";
|
|
3279
|
+
var useClickOutside = (refs, handler, enabled = true) => {
|
|
3280
|
+
React17.useEffect(() => {
|
|
3281
|
+
if (!enabled) return;
|
|
3282
|
+
const refArray = Array.isArray(refs) ? refs : [refs];
|
|
3283
|
+
const listener = (event) => {
|
|
3284
|
+
const target = event.target;
|
|
3285
|
+
const isInside = refArray.some(
|
|
3286
|
+
(ref) => ref.current && ref.current.contains(target)
|
|
3287
|
+
);
|
|
3288
|
+
if (!isInside) {
|
|
3289
|
+
handler();
|
|
3290
|
+
}
|
|
3291
|
+
};
|
|
3292
|
+
document.addEventListener("mousedown", listener);
|
|
3293
|
+
document.addEventListener("touchstart", listener);
|
|
3294
|
+
return () => {
|
|
3295
|
+
document.removeEventListener("mousedown", listener);
|
|
3296
|
+
document.removeEventListener("touchstart", listener);
|
|
3297
|
+
};
|
|
3298
|
+
}, [refs, handler, enabled]);
|
|
3299
|
+
};
|
|
3300
|
+
var useClickOutside_default = useClickOutside;
|
|
3301
|
+
|
|
3167
3302
|
// src/components/Dropdown/Dropdown.tsx
|
|
3168
|
-
import { jsx as
|
|
3303
|
+
import { jsx as jsx320, jsxs as jsxs206 } from "react/jsx-runtime";
|
|
3169
3304
|
var Dropdown = (props) => {
|
|
3170
3305
|
const { items, children } = props;
|
|
3171
|
-
const [isOpen, setIsOpen] =
|
|
3172
|
-
const [mounted, setMounted] =
|
|
3173
|
-
const [visible, setVisible] =
|
|
3174
|
-
const triggerRef =
|
|
3175
|
-
const menuRef =
|
|
3306
|
+
const [isOpen, setIsOpen] = React18.useState(false);
|
|
3307
|
+
const [mounted, setMounted] = React18.useState(false);
|
|
3308
|
+
const [visible, setVisible] = React18.useState(false);
|
|
3309
|
+
const triggerRef = React18.useRef(null);
|
|
3310
|
+
const menuRef = React18.useRef(null);
|
|
3176
3311
|
const { position, direction } = useAutoPosition_default(triggerRef, menuRef, isOpen);
|
|
3177
3312
|
useClickOutside_default([triggerRef, menuRef], () => setIsOpen(false));
|
|
3178
|
-
|
|
3313
|
+
React18.useEffect(() => {
|
|
3179
3314
|
if (isOpen) {
|
|
3180
3315
|
setMounted(true);
|
|
3181
3316
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -3190,8 +3325,8 @@ var Dropdown = (props) => {
|
|
|
3190
3325
|
item.onClick?.();
|
|
3191
3326
|
setIsOpen(false);
|
|
3192
3327
|
};
|
|
3193
|
-
return /* @__PURE__ */
|
|
3194
|
-
/* @__PURE__ */
|
|
3328
|
+
return /* @__PURE__ */ jsxs206("div", { className: "lib-xplat-dropdown", children: [
|
|
3329
|
+
/* @__PURE__ */ jsx320(
|
|
3195
3330
|
"div",
|
|
3196
3331
|
{
|
|
3197
3332
|
ref: triggerRef,
|
|
@@ -3200,14 +3335,14 @@ var Dropdown = (props) => {
|
|
|
3200
3335
|
children
|
|
3201
3336
|
}
|
|
3202
3337
|
),
|
|
3203
|
-
mounted && /* @__PURE__ */
|
|
3338
|
+
mounted && /* @__PURE__ */ jsx320(
|
|
3204
3339
|
"div",
|
|
3205
3340
|
{
|
|
3206
3341
|
ref: menuRef,
|
|
3207
3342
|
className: clsx_default("dropdown-menu", direction, { visible }),
|
|
3208
3343
|
style: { top: position.top, left: position.left },
|
|
3209
3344
|
role: "menu",
|
|
3210
|
-
children: items.map((item) => /* @__PURE__ */
|
|
3345
|
+
children: items.map((item) => /* @__PURE__ */ jsx320(
|
|
3211
3346
|
"button",
|
|
3212
3347
|
{
|
|
3213
3348
|
className: clsx_default("dropdown-item", {
|
|
@@ -3229,23 +3364,23 @@ Dropdown.displayName = "Dropdown";
|
|
|
3229
3364
|
var Dropdown_default = Dropdown;
|
|
3230
3365
|
|
|
3231
3366
|
// src/components/EmptyState/EmptyState.tsx
|
|
3232
|
-
import { jsx as
|
|
3367
|
+
import { jsx as jsx321, jsxs as jsxs207 } from "react/jsx-runtime";
|
|
3233
3368
|
var EmptyState = (props) => {
|
|
3234
3369
|
const { icon, title = "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4", description, action } = props;
|
|
3235
|
-
return /* @__PURE__ */
|
|
3236
|
-
icon && /* @__PURE__ */
|
|
3237
|
-
!icon && /* @__PURE__ */
|
|
3238
|
-
/* @__PURE__ */
|
|
3239
|
-
description && /* @__PURE__ */
|
|
3240
|
-
action && /* @__PURE__ */
|
|
3370
|
+
return /* @__PURE__ */ jsxs207("div", { className: "lib-xplat-empty-state", children: [
|
|
3371
|
+
icon && /* @__PURE__ */ jsx321("div", { className: "empty-icon", children: icon }),
|
|
3372
|
+
!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" }) }) }),
|
|
3373
|
+
/* @__PURE__ */ jsx321("p", { className: "empty-title", children: title }),
|
|
3374
|
+
description && /* @__PURE__ */ jsx321("p", { className: "empty-description", children: description }),
|
|
3375
|
+
action && /* @__PURE__ */ jsx321("div", { className: "empty-action", children: action })
|
|
3241
3376
|
] });
|
|
3242
3377
|
};
|
|
3243
3378
|
EmptyState.displayName = "EmptyState";
|
|
3244
3379
|
var EmptyState_default = EmptyState;
|
|
3245
3380
|
|
|
3246
3381
|
// src/components/FileUpload/FileUpload.tsx
|
|
3247
|
-
import
|
|
3248
|
-
import { jsx as
|
|
3382
|
+
import React19 from "react";
|
|
3383
|
+
import { jsx as jsx322, jsxs as jsxs208 } from "react/jsx-runtime";
|
|
3249
3384
|
var FileUpload = (props) => {
|
|
3250
3385
|
const {
|
|
3251
3386
|
accept,
|
|
@@ -3255,8 +3390,8 @@ var FileUpload = (props) => {
|
|
|
3255
3390
|
label = "\uD30C\uC77C\uC744 \uB4DC\uB798\uADF8\uD558\uAC70\uB098 \uD074\uB9AD\uD558\uC5EC \uC5C5\uB85C\uB4DC",
|
|
3256
3391
|
description
|
|
3257
3392
|
} = props;
|
|
3258
|
-
const [isDragOver, setIsDragOver] =
|
|
3259
|
-
const inputRef =
|
|
3393
|
+
const [isDragOver, setIsDragOver] = React19.useState(false);
|
|
3394
|
+
const inputRef = React19.useRef(null);
|
|
3260
3395
|
const handleFiles = (fileList) => {
|
|
3261
3396
|
let files = Array.from(fileList);
|
|
3262
3397
|
if (maxSize) {
|
|
@@ -3286,7 +3421,7 @@ var FileUpload = (props) => {
|
|
|
3286
3421
|
handleFiles(e.target.files);
|
|
3287
3422
|
}
|
|
3288
3423
|
};
|
|
3289
|
-
return /* @__PURE__ */
|
|
3424
|
+
return /* @__PURE__ */ jsxs208(
|
|
3290
3425
|
"div",
|
|
3291
3426
|
{
|
|
3292
3427
|
className: clsx_default("lib-xplat-file-upload", { "drag-over": isDragOver }),
|
|
@@ -3295,7 +3430,7 @@ var FileUpload = (props) => {
|
|
|
3295
3430
|
onDragLeave: handleDragLeave,
|
|
3296
3431
|
onClick: () => inputRef.current?.click(),
|
|
3297
3432
|
children: [
|
|
3298
|
-
/* @__PURE__ */
|
|
3433
|
+
/* @__PURE__ */ jsx322(
|
|
3299
3434
|
"input",
|
|
3300
3435
|
{
|
|
3301
3436
|
ref: inputRef,
|
|
@@ -3305,9 +3440,9 @@ var FileUpload = (props) => {
|
|
|
3305
3440
|
onChange: handleChange
|
|
3306
3441
|
}
|
|
3307
3442
|
),
|
|
3308
|
-
/* @__PURE__ */
|
|
3309
|
-
/* @__PURE__ */
|
|
3310
|
-
description && /* @__PURE__ */
|
|
3443
|
+
/* @__PURE__ */ jsx322("div", { className: "upload-icon", children: /* @__PURE__ */ jsx322(UploadIcon_default, {}) }),
|
|
3444
|
+
/* @__PURE__ */ jsx322("p", { className: "upload-label", children: label }),
|
|
3445
|
+
description && /* @__PURE__ */ jsx322("p", { className: "upload-description", children: description })
|
|
3311
3446
|
]
|
|
3312
3447
|
}
|
|
3313
3448
|
);
|
|
@@ -3316,10 +3451,10 @@ FileUpload.displayName = "FileUpload";
|
|
|
3316
3451
|
var FileUpload_default = FileUpload;
|
|
3317
3452
|
|
|
3318
3453
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
3319
|
-
import
|
|
3454
|
+
import React21 from "react";
|
|
3320
3455
|
|
|
3321
3456
|
// src/components/HtmlTypeWriter/utils.ts
|
|
3322
|
-
import
|
|
3457
|
+
import React20 from "react";
|
|
3323
3458
|
var voidTags = /* @__PURE__ */ new Set([
|
|
3324
3459
|
"br",
|
|
3325
3460
|
"img",
|
|
@@ -3387,41 +3522,41 @@ var convertNodeToReactWithRange = (node, typedLen, rangeMap) => {
|
|
|
3387
3522
|
props[attr.name] = attr.value;
|
|
3388
3523
|
});
|
|
3389
3524
|
if (voidTags.has(tag)) {
|
|
3390
|
-
return
|
|
3525
|
+
return React20.createElement(tag, props);
|
|
3391
3526
|
}
|
|
3392
3527
|
const children = Array.from(element.childNodes).map((child) => convertNodeToReactWithRange(child, typedLen, rangeMap)).filter((n) => n != null);
|
|
3393
|
-
return
|
|
3528
|
+
return React20.createElement(tag, props, ...children);
|
|
3394
3529
|
};
|
|
3395
3530
|
var htmlToReactProgressive = (root, typedLen, rangeMap) => {
|
|
3396
3531
|
const nodes = Array.from(root.childNodes).map((child, idx) => {
|
|
3397
3532
|
const node = convertNodeToReactWithRange(child, typedLen, rangeMap);
|
|
3398
|
-
return node == null ? null :
|
|
3533
|
+
return node == null ? null : React20.createElement(React20.Fragment, { key: idx }, node);
|
|
3399
3534
|
}).filter(Boolean);
|
|
3400
3535
|
return nodes.length === 0 ? null : nodes;
|
|
3401
3536
|
};
|
|
3402
3537
|
|
|
3403
3538
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
3404
|
-
import { jsx as
|
|
3539
|
+
import { jsx as jsx323 } from "react/jsx-runtime";
|
|
3405
3540
|
var HtmlTypeWriter = ({
|
|
3406
3541
|
html,
|
|
3407
3542
|
duration = 20,
|
|
3408
3543
|
onDone,
|
|
3409
3544
|
onChange
|
|
3410
3545
|
}) => {
|
|
3411
|
-
const [typedLen, setTypedLen] =
|
|
3412
|
-
const doneCalledRef =
|
|
3413
|
-
const { doc, rangeMap, totalLength } =
|
|
3546
|
+
const [typedLen, setTypedLen] = React21.useState(0);
|
|
3547
|
+
const doneCalledRef = React21.useRef(false);
|
|
3548
|
+
const { doc, rangeMap, totalLength } = React21.useMemo(() => {
|
|
3414
3549
|
if (typeof window === "undefined") return { doc: null, rangeMap: /* @__PURE__ */ new Map(), totalLength: 0 };
|
|
3415
3550
|
const decoded = decodeHtmlEntities(html);
|
|
3416
3551
|
const doc2 = new DOMParser().parseFromString(decoded, "text/html");
|
|
3417
3552
|
const { rangeMap: rangeMap2, totalLength: totalLength2 } = buildRangeMap(doc2.body);
|
|
3418
3553
|
return { doc: doc2, rangeMap: rangeMap2, totalLength: totalLength2 };
|
|
3419
3554
|
}, [html]);
|
|
3420
|
-
|
|
3555
|
+
React21.useEffect(() => {
|
|
3421
3556
|
setTypedLen(0);
|
|
3422
3557
|
doneCalledRef.current = false;
|
|
3423
3558
|
}, [html]);
|
|
3424
|
-
|
|
3559
|
+
React21.useEffect(() => {
|
|
3425
3560
|
if (!totalLength) return;
|
|
3426
3561
|
if (typedLen >= totalLength) return;
|
|
3427
3562
|
const timer = window.setInterval(() => {
|
|
@@ -3429,33 +3564,33 @@ var HtmlTypeWriter = ({
|
|
|
3429
3564
|
}, duration);
|
|
3430
3565
|
return () => window.clearInterval(timer);
|
|
3431
3566
|
}, [typedLen, totalLength, duration]);
|
|
3432
|
-
|
|
3567
|
+
React21.useEffect(() => {
|
|
3433
3568
|
if (typedLen > 0 && typedLen < totalLength) {
|
|
3434
3569
|
onChange?.();
|
|
3435
3570
|
}
|
|
3436
3571
|
}, [typedLen, totalLength, onChange]);
|
|
3437
|
-
|
|
3572
|
+
React21.useEffect(() => {
|
|
3438
3573
|
if (typedLen === totalLength && totalLength > 0 && !doneCalledRef.current) {
|
|
3439
3574
|
doneCalledRef.current = true;
|
|
3440
3575
|
onDone?.();
|
|
3441
3576
|
}
|
|
3442
3577
|
}, [typedLen, totalLength, onDone]);
|
|
3443
|
-
const parsed =
|
|
3578
|
+
const parsed = React21.useMemo(
|
|
3444
3579
|
() => doc ? htmlToReactProgressive(doc.body, typedLen, rangeMap) : null,
|
|
3445
3580
|
[doc, typedLen, rangeMap]
|
|
3446
3581
|
);
|
|
3447
|
-
return /* @__PURE__ */
|
|
3582
|
+
return /* @__PURE__ */ jsx323("div", { className: "lib-xplat-htmlTypewriter", children: parsed });
|
|
3448
3583
|
};
|
|
3449
3584
|
HtmlTypeWriter.displayName = "HtmlTypeWriter";
|
|
3450
3585
|
var HtmlTypeWriter_default = HtmlTypeWriter;
|
|
3451
3586
|
|
|
3452
3587
|
// src/components/ImageSelector/ImageSelector.tsx
|
|
3453
|
-
import
|
|
3454
|
-
import { jsx as
|
|
3588
|
+
import React22 from "react";
|
|
3589
|
+
import { jsx as jsx324, jsxs as jsxs209 } from "react/jsx-runtime";
|
|
3455
3590
|
var ImageSelector = (props) => {
|
|
3456
3591
|
const { value, label, onChange } = props;
|
|
3457
|
-
const [previewUrl, setPreviewUrl] =
|
|
3458
|
-
|
|
3592
|
+
const [previewUrl, setPreviewUrl] = React22.useState();
|
|
3593
|
+
React22.useEffect(() => {
|
|
3459
3594
|
if (!value) {
|
|
3460
3595
|
setPreviewUrl(void 0);
|
|
3461
3596
|
return;
|
|
@@ -3464,7 +3599,7 @@ var ImageSelector = (props) => {
|
|
|
3464
3599
|
setPreviewUrl(url);
|
|
3465
3600
|
return () => URL.revokeObjectURL(url);
|
|
3466
3601
|
}, [value]);
|
|
3467
|
-
const inputRef =
|
|
3602
|
+
const inputRef = React22.useRef(null);
|
|
3468
3603
|
const handleFileChange = (e) => {
|
|
3469
3604
|
const selectedFile = e.target.files?.[0];
|
|
3470
3605
|
if (selectedFile) {
|
|
@@ -3477,8 +3612,8 @@ var ImageSelector = (props) => {
|
|
|
3477
3612
|
const handleOpenFileDialog = () => {
|
|
3478
3613
|
inputRef.current?.click();
|
|
3479
3614
|
};
|
|
3480
|
-
return /* @__PURE__ */
|
|
3481
|
-
/* @__PURE__ */
|
|
3615
|
+
return /* @__PURE__ */ jsxs209("div", { className: `lib-xplat-imageselector${value ? "" : " none-value"}`, children: [
|
|
3616
|
+
/* @__PURE__ */ jsx324(
|
|
3482
3617
|
"input",
|
|
3483
3618
|
{
|
|
3484
3619
|
type: "file",
|
|
@@ -3488,13 +3623,13 @@ var ImageSelector = (props) => {
|
|
|
3488
3623
|
ref: inputRef
|
|
3489
3624
|
}
|
|
3490
3625
|
),
|
|
3491
|
-
value && /* @__PURE__ */
|
|
3492
|
-
/* @__PURE__ */
|
|
3493
|
-
/* @__PURE__ */
|
|
3626
|
+
value && /* @__PURE__ */ jsxs209("div", { className: "action-bar", children: [
|
|
3627
|
+
/* @__PURE__ */ jsx324("div", { className: "icon-wrapper", onClick: handleOpenFileDialog, children: /* @__PURE__ */ jsx324(UploadIcon_default, {}) }),
|
|
3628
|
+
/* @__PURE__ */ jsx324("div", { className: "icon-wrapper", onClick: handleDeleteFile, children: /* @__PURE__ */ jsx324(DeleteIcon_default, {}) })
|
|
3494
3629
|
] }),
|
|
3495
|
-
/* @__PURE__ */
|
|
3496
|
-
/* @__PURE__ */
|
|
3497
|
-
/* @__PURE__ */
|
|
3630
|
+
/* @__PURE__ */ jsx324("div", { className: "content", children: previewUrl ? /* @__PURE__ */ jsx324("img", { src: previewUrl, alt: "preview" }) : /* @__PURE__ */ jsxs209("div", { className: "skeleton", onClick: handleOpenFileDialog, children: [
|
|
3631
|
+
/* @__PURE__ */ jsx324("div", { className: "icon-wrapper", children: /* @__PURE__ */ jsx324(ImageIcon_default, {}) }),
|
|
3632
|
+
/* @__PURE__ */ jsx324("div", { className: "label", children: label || "\uC774\uBBF8\uC9C0 \uCD94\uAC00\uD558\uAE30" })
|
|
3498
3633
|
] }) })
|
|
3499
3634
|
] });
|
|
3500
3635
|
};
|
|
@@ -3502,7 +3637,7 @@ ImageSelector.displayName = "ImageSelector";
|
|
|
3502
3637
|
var ImageSelector_default = ImageSelector;
|
|
3503
3638
|
|
|
3504
3639
|
// src/components/Pagination/Pagination.tsx
|
|
3505
|
-
import { jsx as
|
|
3640
|
+
import { jsx as jsx325, jsxs as jsxs210 } from "react/jsx-runtime";
|
|
3506
3641
|
var getPageRange = (current, totalPages, siblingCount) => {
|
|
3507
3642
|
const totalNumbers = siblingCount * 2 + 5;
|
|
3508
3643
|
if (totalPages <= totalNumbers) {
|
|
@@ -3545,19 +3680,19 @@ var Pagination = (props) => {
|
|
|
3545
3680
|
onChange?.(page);
|
|
3546
3681
|
}
|
|
3547
3682
|
};
|
|
3548
|
-
return /* @__PURE__ */
|
|
3549
|
-
/* @__PURE__ */
|
|
3683
|
+
return /* @__PURE__ */ jsxs210("nav", { className: clsx_default("lib-xplat-pagination", size, type), "aria-label": "\uD398\uC774\uC9C0 \uB124\uBE44\uAC8C\uC774\uC158", children: [
|
|
3684
|
+
/* @__PURE__ */ jsx325(
|
|
3550
3685
|
"button",
|
|
3551
3686
|
{
|
|
3552
3687
|
className: "page-btn prev",
|
|
3553
3688
|
disabled: current <= 1,
|
|
3554
3689
|
onClick: () => handleClick(current - 1),
|
|
3555
3690
|
"aria-label": "\uC774\uC804 \uD398\uC774\uC9C0",
|
|
3556
|
-
children: /* @__PURE__ */
|
|
3691
|
+
children: /* @__PURE__ */ jsx325(ChevronLeftIcon_default, {})
|
|
3557
3692
|
}
|
|
3558
3693
|
),
|
|
3559
3694
|
pages.map(
|
|
3560
|
-
(page, i) => page === "..." ? /* @__PURE__ */
|
|
3695
|
+
(page, i) => page === "..." ? /* @__PURE__ */ jsx325("span", { className: "dots", children: "..." }, `dots-${i}`) : /* @__PURE__ */ jsx325(
|
|
3561
3696
|
"button",
|
|
3562
3697
|
{
|
|
3563
3698
|
className: clsx_default("page-btn", { active: page === current }),
|
|
@@ -3568,14 +3703,14 @@ var Pagination = (props) => {
|
|
|
3568
3703
|
page
|
|
3569
3704
|
)
|
|
3570
3705
|
),
|
|
3571
|
-
/* @__PURE__ */
|
|
3706
|
+
/* @__PURE__ */ jsx325(
|
|
3572
3707
|
"button",
|
|
3573
3708
|
{
|
|
3574
3709
|
className: "page-btn next",
|
|
3575
3710
|
disabled: current >= totalPages,
|
|
3576
3711
|
onClick: () => handleClick(current + 1),
|
|
3577
3712
|
"aria-label": "\uB2E4\uC74C \uD398\uC774\uC9C0",
|
|
3578
|
-
children: /* @__PURE__ */
|
|
3713
|
+
children: /* @__PURE__ */ jsx325(ChevronRightIcon_default, {})
|
|
3579
3714
|
}
|
|
3580
3715
|
)
|
|
3581
3716
|
] });
|
|
@@ -3584,17 +3719,17 @@ Pagination.displayName = "Pagination";
|
|
|
3584
3719
|
var Pagination_default = Pagination;
|
|
3585
3720
|
|
|
3586
3721
|
// src/components/PopOver/PopOver.tsx
|
|
3587
|
-
import
|
|
3588
|
-
import { jsx as
|
|
3722
|
+
import React23 from "react";
|
|
3723
|
+
import { jsx as jsx326, jsxs as jsxs211 } from "react/jsx-runtime";
|
|
3589
3724
|
var PopOver = (props) => {
|
|
3590
3725
|
const { children, isOpen, onClose, PopOverEl } = props;
|
|
3591
|
-
const popRef =
|
|
3592
|
-
const triggerRef =
|
|
3593
|
-
const [localOpen, setLocalOpen] =
|
|
3594
|
-
const [eventTrigger, setEventTrigger] =
|
|
3726
|
+
const popRef = React23.useRef(null);
|
|
3727
|
+
const triggerRef = React23.useRef(null);
|
|
3728
|
+
const [localOpen, setLocalOpen] = React23.useState(false);
|
|
3729
|
+
const [eventTrigger, setEventTrigger] = React23.useState(false);
|
|
3595
3730
|
useClickOutside_default([popRef, triggerRef], onClose, isOpen);
|
|
3596
3731
|
const position = useAutoPosition_default(triggerRef, popRef, localOpen);
|
|
3597
|
-
|
|
3732
|
+
React23.useEffect(() => {
|
|
3598
3733
|
if (isOpen) {
|
|
3599
3734
|
setLocalOpen(isOpen);
|
|
3600
3735
|
setTimeout(() => {
|
|
@@ -3607,7 +3742,7 @@ var PopOver = (props) => {
|
|
|
3607
3742
|
}, 200);
|
|
3608
3743
|
}
|
|
3609
3744
|
}, [isOpen]);
|
|
3610
|
-
return /* @__PURE__ */
|
|
3745
|
+
return /* @__PURE__ */ jsxs211(
|
|
3611
3746
|
"div",
|
|
3612
3747
|
{
|
|
3613
3748
|
className: "lib-xplat-pop-over",
|
|
@@ -3617,7 +3752,7 @@ var PopOver = (props) => {
|
|
|
3617
3752
|
},
|
|
3618
3753
|
children: [
|
|
3619
3754
|
children,
|
|
3620
|
-
localOpen && /* @__PURE__ */
|
|
3755
|
+
localOpen && /* @__PURE__ */ jsx326(
|
|
3621
3756
|
"div",
|
|
3622
3757
|
{
|
|
3623
3758
|
className: clsx_default(
|
|
@@ -3640,7 +3775,7 @@ PopOver.displayName = "PopOver";
|
|
|
3640
3775
|
var PopOver_default = PopOver;
|
|
3641
3776
|
|
|
3642
3777
|
// src/components/Progress/Progress.tsx
|
|
3643
|
-
import { jsx as
|
|
3778
|
+
import { jsx as jsx327, jsxs as jsxs212 } from "react/jsx-runtime";
|
|
3644
3779
|
var Progress = (props) => {
|
|
3645
3780
|
const {
|
|
3646
3781
|
value,
|
|
@@ -3650,8 +3785,8 @@ var Progress = (props) => {
|
|
|
3650
3785
|
showLabel = false
|
|
3651
3786
|
} = props;
|
|
3652
3787
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
3653
|
-
return /* @__PURE__ */
|
|
3654
|
-
/* @__PURE__ */
|
|
3788
|
+
return /* @__PURE__ */ jsxs212("div", { className: clsx_default("lib-xplat-progress", size, type), children: [
|
|
3789
|
+
/* @__PURE__ */ jsx327(
|
|
3655
3790
|
"div",
|
|
3656
3791
|
{
|
|
3657
3792
|
className: "track",
|
|
@@ -3659,7 +3794,7 @@ var Progress = (props) => {
|
|
|
3659
3794
|
"aria-valuenow": value,
|
|
3660
3795
|
"aria-valuemin": 0,
|
|
3661
3796
|
"aria-valuemax": max,
|
|
3662
|
-
children: /* @__PURE__ */
|
|
3797
|
+
children: /* @__PURE__ */ jsx327(
|
|
3663
3798
|
"div",
|
|
3664
3799
|
{
|
|
3665
3800
|
className: "bar",
|
|
@@ -3668,7 +3803,7 @@ var Progress = (props) => {
|
|
|
3668
3803
|
)
|
|
3669
3804
|
}
|
|
3670
3805
|
),
|
|
3671
|
-
showLabel && /* @__PURE__ */
|
|
3806
|
+
showLabel && /* @__PURE__ */ jsxs212("span", { className: "label", children: [
|
|
3672
3807
|
Math.round(percentage),
|
|
3673
3808
|
"%"
|
|
3674
3809
|
] })
|
|
@@ -3678,17 +3813,17 @@ Progress.displayName = "Progress";
|
|
|
3678
3813
|
var Progress_default = Progress;
|
|
3679
3814
|
|
|
3680
3815
|
// src/components/Radio/RadioGroupContext.tsx
|
|
3681
|
-
import
|
|
3682
|
-
var RadioGroupContext =
|
|
3816
|
+
import React24 from "react";
|
|
3817
|
+
var RadioGroupContext = React24.createContext(
|
|
3683
3818
|
null
|
|
3684
3819
|
);
|
|
3685
3820
|
var useRadioGroupContext = () => {
|
|
3686
|
-
return
|
|
3821
|
+
return React24.useContext(RadioGroupContext);
|
|
3687
3822
|
};
|
|
3688
3823
|
var RadioGroupContext_default = RadioGroupContext;
|
|
3689
3824
|
|
|
3690
3825
|
// src/components/Radio/Radio.tsx
|
|
3691
|
-
import { jsx as
|
|
3826
|
+
import { jsx as jsx328, jsxs as jsxs213 } from "react/jsx-runtime";
|
|
3692
3827
|
var Radio = (props) => {
|
|
3693
3828
|
const {
|
|
3694
3829
|
label,
|
|
@@ -3706,7 +3841,7 @@ var Radio = (props) => {
|
|
|
3706
3841
|
value,
|
|
3707
3842
|
onChange: rest.onChange
|
|
3708
3843
|
};
|
|
3709
|
-
return /* @__PURE__ */
|
|
3844
|
+
return /* @__PURE__ */ jsxs213(
|
|
3710
3845
|
"label",
|
|
3711
3846
|
{
|
|
3712
3847
|
className: clsx_default(
|
|
@@ -3716,18 +3851,18 @@ var Radio = (props) => {
|
|
|
3716
3851
|
localChecked ? "checked" : void 0
|
|
3717
3852
|
),
|
|
3718
3853
|
children: [
|
|
3719
|
-
/* @__PURE__ */
|
|
3720
|
-
/* @__PURE__ */
|
|
3854
|
+
/* @__PURE__ */ jsx328("input", { ...rest, ...inputProps, checked: localChecked, type: "radio" }),
|
|
3855
|
+
/* @__PURE__ */ jsx328(
|
|
3721
3856
|
"div",
|
|
3722
3857
|
{
|
|
3723
3858
|
className: clsx_default(
|
|
3724
3859
|
"circle",
|
|
3725
3860
|
localChecked ? "checked" : void 0
|
|
3726
3861
|
),
|
|
3727
|
-
children: localChecked && /* @__PURE__ */
|
|
3862
|
+
children: localChecked && /* @__PURE__ */ jsx328("div", { className: "inner-circle" })
|
|
3728
3863
|
}
|
|
3729
3864
|
),
|
|
3730
|
-
label && /* @__PURE__ */
|
|
3865
|
+
label && /* @__PURE__ */ jsx328("span", { children: label })
|
|
3731
3866
|
]
|
|
3732
3867
|
}
|
|
3733
3868
|
);
|
|
@@ -3736,28 +3871,28 @@ Radio.displayName = "Radio";
|
|
|
3736
3871
|
var Radio_default = Radio;
|
|
3737
3872
|
|
|
3738
3873
|
// src/components/Radio/RadioGroup.tsx
|
|
3739
|
-
import { Fragment as Fragment3, jsx as
|
|
3874
|
+
import { Fragment as Fragment3, jsx as jsx329 } from "react/jsx-runtime";
|
|
3740
3875
|
var RadioGroup = (props) => {
|
|
3741
3876
|
const { children, ...rest } = props;
|
|
3742
|
-
return /* @__PURE__ */
|
|
3877
|
+
return /* @__PURE__ */ jsx329(Fragment3, { children: /* @__PURE__ */ jsx329(RadioGroupContext_default.Provider, { value: rest, children }) });
|
|
3743
3878
|
};
|
|
3744
3879
|
RadioGroup.displayName = "RadioGroup";
|
|
3745
3880
|
var RadioGroup_default = RadioGroup;
|
|
3746
3881
|
|
|
3747
3882
|
// src/components/Select/Select.tsx
|
|
3748
|
-
import
|
|
3883
|
+
import React27 from "react";
|
|
3749
3884
|
|
|
3750
3885
|
// src/components/Select/context.ts
|
|
3751
|
-
import
|
|
3752
|
-
var SelectContext =
|
|
3886
|
+
import React25 from "react";
|
|
3887
|
+
var SelectContext = React25.createContext(null);
|
|
3753
3888
|
var context_default = SelectContext;
|
|
3754
3889
|
|
|
3755
3890
|
// src/components/Select/SelectItem.tsx
|
|
3756
|
-
import
|
|
3757
|
-
import { jsx as
|
|
3891
|
+
import React26 from "react";
|
|
3892
|
+
import { jsx as jsx330 } from "react/jsx-runtime";
|
|
3758
3893
|
var SelectItem = (props) => {
|
|
3759
3894
|
const { children, value, onClick, disabled = false } = props;
|
|
3760
|
-
const ctx =
|
|
3895
|
+
const ctx = React26.useContext(context_default);
|
|
3761
3896
|
const handleClick = (e) => {
|
|
3762
3897
|
e.preventDefault();
|
|
3763
3898
|
e.stopPropagation();
|
|
@@ -3766,7 +3901,7 @@ var SelectItem = (props) => {
|
|
|
3766
3901
|
ctx?.close();
|
|
3767
3902
|
onClick?.();
|
|
3768
3903
|
};
|
|
3769
|
-
return /* @__PURE__ */
|
|
3904
|
+
return /* @__PURE__ */ jsx330(
|
|
3770
3905
|
"div",
|
|
3771
3906
|
{
|
|
3772
3907
|
className: clsx_default("select-item", disabled && "disabled"),
|
|
@@ -3787,7 +3922,7 @@ SelectItem.displayName = "Select.Item";
|
|
|
3787
3922
|
var SelectItem_default = SelectItem;
|
|
3788
3923
|
|
|
3789
3924
|
// src/components/Select/Select.tsx
|
|
3790
|
-
import { jsx as
|
|
3925
|
+
import { jsx as jsx331, jsxs as jsxs214 } from "react/jsx-runtime";
|
|
3791
3926
|
var ANIMATION_DURATION_MS3 = 200;
|
|
3792
3927
|
var SelectRoot = (props) => {
|
|
3793
3928
|
const {
|
|
@@ -3799,26 +3934,26 @@ var SelectRoot = (props) => {
|
|
|
3799
3934
|
error = false,
|
|
3800
3935
|
size = "md"
|
|
3801
3936
|
} = props;
|
|
3802
|
-
const itemChildren =
|
|
3803
|
-
(child) =>
|
|
3937
|
+
const itemChildren = React27.Children.toArray(children).filter(
|
|
3938
|
+
(child) => React27.isValidElement(child) && child.type === SelectItem_default
|
|
3804
3939
|
);
|
|
3805
3940
|
const isControlled = valueProp !== void 0;
|
|
3806
|
-
const [isOpen, setOpen] =
|
|
3807
|
-
const [uncontrolledLabel, setUncontrolledLabel] =
|
|
3808
|
-
const controlledLabel =
|
|
3941
|
+
const [isOpen, setOpen] = React27.useState(false);
|
|
3942
|
+
const [uncontrolledLabel, setUncontrolledLabel] = React27.useState(null);
|
|
3943
|
+
const controlledLabel = React27.useMemo(() => {
|
|
3809
3944
|
if (!isControlled) return null;
|
|
3810
3945
|
const match = itemChildren.find((child) => child.props.value === valueProp);
|
|
3811
3946
|
return match ? match.props.children : null;
|
|
3812
3947
|
}, [isControlled, valueProp, itemChildren]);
|
|
3813
3948
|
const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
|
|
3814
|
-
const triggerRef =
|
|
3815
|
-
const contentRef =
|
|
3816
|
-
const [mounted, setMounted] =
|
|
3817
|
-
const [visible, setVisible] =
|
|
3818
|
-
|
|
3949
|
+
const triggerRef = React27.useRef(null);
|
|
3950
|
+
const contentRef = React27.useRef(null);
|
|
3951
|
+
const [mounted, setMounted] = React27.useState(false);
|
|
3952
|
+
const [visible, setVisible] = React27.useState(false);
|
|
3953
|
+
React27.useEffect(() => {
|
|
3819
3954
|
if (disabled && isOpen) setOpen(false);
|
|
3820
3955
|
}, [disabled, isOpen]);
|
|
3821
|
-
|
|
3956
|
+
React27.useEffect(() => {
|
|
3822
3957
|
if (isOpen) {
|
|
3823
3958
|
setMounted(true);
|
|
3824
3959
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -3828,12 +3963,12 @@ var SelectRoot = (props) => {
|
|
|
3828
3963
|
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS3);
|
|
3829
3964
|
return () => clearTimeout(t);
|
|
3830
3965
|
}, [isOpen]);
|
|
3831
|
-
const open =
|
|
3832
|
-
const close =
|
|
3833
|
-
const toggle =
|
|
3966
|
+
const open = React27.useCallback(() => setOpen(true), []);
|
|
3967
|
+
const close = React27.useCallback(() => setOpen(false), []);
|
|
3968
|
+
const toggle = React27.useCallback(() => setOpen((prev) => !prev), []);
|
|
3834
3969
|
useClickOutside_default([contentRef, triggerRef], close, isOpen);
|
|
3835
3970
|
const position = useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
3836
|
-
const setSelected =
|
|
3971
|
+
const setSelected = React27.useCallback(
|
|
3837
3972
|
(label, itemValue) => {
|
|
3838
3973
|
if (!isControlled) {
|
|
3839
3974
|
setUncontrolledLabel(label);
|
|
@@ -3842,7 +3977,7 @@ var SelectRoot = (props) => {
|
|
|
3842
3977
|
},
|
|
3843
3978
|
[isControlled, onChange]
|
|
3844
3979
|
);
|
|
3845
|
-
const ctxValue =
|
|
3980
|
+
const ctxValue = React27.useMemo(
|
|
3846
3981
|
() => ({
|
|
3847
3982
|
isOpen,
|
|
3848
3983
|
mounted,
|
|
@@ -3863,7 +3998,7 @@ var SelectRoot = (props) => {
|
|
|
3863
3998
|
if (disabled) return;
|
|
3864
3999
|
toggle();
|
|
3865
4000
|
};
|
|
3866
|
-
return /* @__PURE__ */
|
|
4001
|
+
return /* @__PURE__ */ jsx331(context_default.Provider, { value: ctxValue, children: /* @__PURE__ */ jsxs214(
|
|
3867
4002
|
"div",
|
|
3868
4003
|
{
|
|
3869
4004
|
className: clsx_default(
|
|
@@ -3874,7 +4009,7 @@ var SelectRoot = (props) => {
|
|
|
3874
4009
|
mounted && "is-open"
|
|
3875
4010
|
),
|
|
3876
4011
|
children: [
|
|
3877
|
-
/* @__PURE__ */
|
|
4012
|
+
/* @__PURE__ */ jsxs214(
|
|
3878
4013
|
"div",
|
|
3879
4014
|
{
|
|
3880
4015
|
ref: triggerRef,
|
|
@@ -3898,7 +4033,7 @@ var SelectRoot = (props) => {
|
|
|
3898
4033
|
}
|
|
3899
4034
|
},
|
|
3900
4035
|
children: [
|
|
3901
|
-
/* @__PURE__ */
|
|
4036
|
+
/* @__PURE__ */ jsx331(
|
|
3902
4037
|
"span",
|
|
3903
4038
|
{
|
|
3904
4039
|
className: clsx_default(
|
|
@@ -3908,18 +4043,18 @@ var SelectRoot = (props) => {
|
|
|
3908
4043
|
children: selectedLabel ?? placeholder
|
|
3909
4044
|
}
|
|
3910
4045
|
),
|
|
3911
|
-
/* @__PURE__ */
|
|
4046
|
+
/* @__PURE__ */ jsx331(
|
|
3912
4047
|
"span",
|
|
3913
4048
|
{
|
|
3914
4049
|
className: clsx_default("select-trigger-icon", isOpen && "open"),
|
|
3915
4050
|
"aria-hidden": true,
|
|
3916
|
-
children: /* @__PURE__ */
|
|
4051
|
+
children: /* @__PURE__ */ jsx331(ChevronDownIcon_default, {})
|
|
3917
4052
|
}
|
|
3918
4053
|
)
|
|
3919
4054
|
]
|
|
3920
4055
|
}
|
|
3921
4056
|
),
|
|
3922
|
-
mounted && /* @__PURE__ */
|
|
4057
|
+
mounted && /* @__PURE__ */ jsx331(
|
|
3923
4058
|
"div",
|
|
3924
4059
|
{
|
|
3925
4060
|
className: clsx_default("select-content", position.direction, stateClass),
|
|
@@ -3940,14 +4075,14 @@ var Select = Object.assign(SelectRoot, {
|
|
|
3940
4075
|
var Select_default = Select;
|
|
3941
4076
|
|
|
3942
4077
|
// src/components/Skeleton/Skeleton.tsx
|
|
3943
|
-
import { jsx as
|
|
4078
|
+
import { jsx as jsx332 } from "react/jsx-runtime";
|
|
3944
4079
|
var Skeleton = (props) => {
|
|
3945
4080
|
const { variant = "text", width, height } = props;
|
|
3946
4081
|
const style = {
|
|
3947
4082
|
width: typeof width === "number" ? `${width}px` : width,
|
|
3948
4083
|
height: typeof height === "number" ? `${height}px` : height
|
|
3949
4084
|
};
|
|
3950
|
-
return /* @__PURE__ */
|
|
4085
|
+
return /* @__PURE__ */ jsx332(
|
|
3951
4086
|
"div",
|
|
3952
4087
|
{
|
|
3953
4088
|
className: clsx_default("lib-xplat-skeleton", variant),
|
|
@@ -3960,20 +4095,20 @@ Skeleton.displayName = "Skeleton";
|
|
|
3960
4095
|
var Skeleton_default = Skeleton;
|
|
3961
4096
|
|
|
3962
4097
|
// src/components/Spinner/Spinner.tsx
|
|
3963
|
-
import { jsx as
|
|
4098
|
+
import { jsx as jsx333, jsxs as jsxs215 } from "react/jsx-runtime";
|
|
3964
4099
|
var Spinner = (props) => {
|
|
3965
4100
|
const {
|
|
3966
4101
|
size = "md",
|
|
3967
4102
|
type = "brand"
|
|
3968
4103
|
} = props;
|
|
3969
|
-
return /* @__PURE__ */
|
|
4104
|
+
return /* @__PURE__ */ jsx333(
|
|
3970
4105
|
"div",
|
|
3971
4106
|
{
|
|
3972
4107
|
className: clsx_default("lib-xplat-spinner", size, type),
|
|
3973
4108
|
role: "status",
|
|
3974
4109
|
"aria-label": "\uB85C\uB529 \uC911",
|
|
3975
|
-
children: /* @__PURE__ */
|
|
3976
|
-
/* @__PURE__ */
|
|
4110
|
+
children: /* @__PURE__ */ jsxs215("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
4111
|
+
/* @__PURE__ */ jsx333(
|
|
3977
4112
|
"circle",
|
|
3978
4113
|
{
|
|
3979
4114
|
className: "track",
|
|
@@ -3983,7 +4118,7 @@ var Spinner = (props) => {
|
|
|
3983
4118
|
strokeWidth: "3"
|
|
3984
4119
|
}
|
|
3985
4120
|
),
|
|
3986
|
-
/* @__PURE__ */
|
|
4121
|
+
/* @__PURE__ */ jsx333(
|
|
3987
4122
|
"circle",
|
|
3988
4123
|
{
|
|
3989
4124
|
className: "indicator",
|
|
@@ -4002,20 +4137,20 @@ Spinner.displayName = "Spinner";
|
|
|
4002
4137
|
var Spinner_default = Spinner;
|
|
4003
4138
|
|
|
4004
4139
|
// src/components/Steps/Steps.tsx
|
|
4005
|
-
import { jsx as
|
|
4140
|
+
import { jsx as jsx334, jsxs as jsxs216 } from "react/jsx-runtime";
|
|
4006
4141
|
var Steps = (props) => {
|
|
4007
4142
|
const {
|
|
4008
4143
|
items,
|
|
4009
4144
|
current,
|
|
4010
4145
|
type = "brand"
|
|
4011
4146
|
} = props;
|
|
4012
|
-
return /* @__PURE__ */
|
|
4147
|
+
return /* @__PURE__ */ jsx334("div", { className: clsx_default("lib-xplat-steps", type), children: items.map((item, index) => {
|
|
4013
4148
|
const status = index < current ? "completed" : index === current ? "active" : "pending";
|
|
4014
|
-
return /* @__PURE__ */
|
|
4015
|
-
/* @__PURE__ */
|
|
4016
|
-
/* @__PURE__ */
|
|
4017
|
-
/* @__PURE__ */
|
|
4018
|
-
item.description && /* @__PURE__ */
|
|
4149
|
+
return /* @__PURE__ */ jsxs216("div", { className: clsx_default("step-item", status), children: [
|
|
4150
|
+
/* @__PURE__ */ jsx334("div", { className: "step-circle", children: status === "completed" ? /* @__PURE__ */ jsx334(CheckIcon_default, {}) : /* @__PURE__ */ jsx334("span", { children: index + 1 }) }),
|
|
4151
|
+
/* @__PURE__ */ jsxs216("div", { className: "step-content", children: [
|
|
4152
|
+
/* @__PURE__ */ jsx334("span", { className: "step-title", children: item.title }),
|
|
4153
|
+
item.description && /* @__PURE__ */ jsx334("span", { className: "step-description", children: item.description })
|
|
4019
4154
|
] })
|
|
4020
4155
|
] }, index);
|
|
4021
4156
|
}) });
|
|
@@ -4024,8 +4159,8 @@ Steps.displayName = "Steps";
|
|
|
4024
4159
|
var Steps_default = Steps;
|
|
4025
4160
|
|
|
4026
4161
|
// src/components/Swiper/Swiper.tsx
|
|
4027
|
-
import
|
|
4028
|
-
import { jsx as
|
|
4162
|
+
import React28 from "react";
|
|
4163
|
+
import { jsx as jsx335, jsxs as jsxs217 } from "react/jsx-runtime";
|
|
4029
4164
|
var Swiper = (props) => {
|
|
4030
4165
|
const {
|
|
4031
4166
|
auto = false,
|
|
@@ -4048,23 +4183,23 @@ var Swiper = (props) => {
|
|
|
4048
4183
|
const maxIndex = Math.max(0, totalSlides - viewItemCount);
|
|
4049
4184
|
const useLoop = loop && canSlide;
|
|
4050
4185
|
const cloneCount = useLoop ? totalSlides : 0;
|
|
4051
|
-
const extendedItems =
|
|
4186
|
+
const extendedItems = React28.useMemo(() => {
|
|
4052
4187
|
if (!useLoop) return items;
|
|
4053
4188
|
return [...items, ...items, ...items];
|
|
4054
4189
|
}, [items, useLoop]);
|
|
4055
4190
|
const initialIdx = Math.max(0, Math.min(indexProp ?? 0, maxIndex));
|
|
4056
|
-
const [innerIndex, setInnerIndex] =
|
|
4191
|
+
const [innerIndex, setInnerIndex] = React28.useState(
|
|
4057
4192
|
useLoop ? cloneCount + initialIdx : initialIdx
|
|
4058
4193
|
);
|
|
4059
|
-
const [isDragging, setIsDragging] =
|
|
4060
|
-
const [dragOffset, setDragOffset] =
|
|
4061
|
-
const [animated, setAnimated] =
|
|
4062
|
-
const [containerWidth, setContainerWidth] =
|
|
4063
|
-
const containerRef =
|
|
4064
|
-
const startXRef =
|
|
4065
|
-
const startTimeRef =
|
|
4066
|
-
const autoplayTimerRef =
|
|
4067
|
-
|
|
4194
|
+
const [isDragging, setIsDragging] = React28.useState(false);
|
|
4195
|
+
const [dragOffset, setDragOffset] = React28.useState(0);
|
|
4196
|
+
const [animated, setAnimated] = React28.useState(true);
|
|
4197
|
+
const [containerWidth, setContainerWidth] = React28.useState(0);
|
|
4198
|
+
const containerRef = React28.useRef(null);
|
|
4199
|
+
const startXRef = React28.useRef(0);
|
|
4200
|
+
const startTimeRef = React28.useRef(0);
|
|
4201
|
+
const autoplayTimerRef = React28.useRef(null);
|
|
4202
|
+
React28.useEffect(() => {
|
|
4068
4203
|
const el = containerRef.current;
|
|
4069
4204
|
if (!el) return;
|
|
4070
4205
|
const ro = new ResizeObserver((entries) => {
|
|
@@ -4083,7 +4218,7 @@ var Swiper = (props) => {
|
|
|
4083
4218
|
return ((inner - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
4084
4219
|
};
|
|
4085
4220
|
const realIndex = getRealIndex(innerIndex);
|
|
4086
|
-
const moveToInner =
|
|
4221
|
+
const moveToInner = React28.useCallback(
|
|
4087
4222
|
(idx, withAnim = true) => {
|
|
4088
4223
|
if (!useLoop) {
|
|
4089
4224
|
setAnimated(withAnim);
|
|
@@ -4111,7 +4246,7 @@ var Swiper = (props) => {
|
|
|
4111
4246
|
},
|
|
4112
4247
|
[useLoop, cloneCount, totalSlides]
|
|
4113
4248
|
);
|
|
4114
|
-
const handleTransitionEnd =
|
|
4249
|
+
const handleTransitionEnd = React28.useCallback(() => {
|
|
4115
4250
|
if (!useLoop) return;
|
|
4116
4251
|
const real = getRealIndex(innerIndex);
|
|
4117
4252
|
const canonical = cloneCount + real;
|
|
@@ -4121,7 +4256,7 @@ var Swiper = (props) => {
|
|
|
4121
4256
|
}
|
|
4122
4257
|
onChange?.(Math.min(real, maxIndex));
|
|
4123
4258
|
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange]);
|
|
4124
|
-
const slideTo =
|
|
4259
|
+
const slideTo = React28.useCallback(
|
|
4125
4260
|
(logicalIndex) => {
|
|
4126
4261
|
if (!canSlide) return;
|
|
4127
4262
|
const clamped = useLoop ? logicalIndex : Math.max(0, Math.min(logicalIndex, maxIndex));
|
|
@@ -4131,7 +4266,7 @@ var Swiper = (props) => {
|
|
|
4131
4266
|
},
|
|
4132
4267
|
[canSlide, useLoop, cloneCount, maxIndex, onChange, moveToInner]
|
|
4133
4268
|
);
|
|
4134
|
-
const slideNext =
|
|
4269
|
+
const slideNext = React28.useCallback(() => {
|
|
4135
4270
|
if (!canSlide) return;
|
|
4136
4271
|
const nextInner = innerIndex + slideBy;
|
|
4137
4272
|
if (useLoop) {
|
|
@@ -4140,7 +4275,7 @@ var Swiper = (props) => {
|
|
|
4140
4275
|
moveToInner(Math.min(nextInner, maxIndex), true);
|
|
4141
4276
|
}
|
|
4142
4277
|
}, [canSlide, useLoop, innerIndex, slideBy, maxIndex, moveToInner]);
|
|
4143
|
-
const slidePrev =
|
|
4278
|
+
const slidePrev = React28.useCallback(() => {
|
|
4144
4279
|
if (!canSlide) return;
|
|
4145
4280
|
const prevInner = innerIndex - slideBy;
|
|
4146
4281
|
if (useLoop) {
|
|
@@ -4149,7 +4284,7 @@ var Swiper = (props) => {
|
|
|
4149
4284
|
moveToInner(Math.max(prevInner, 0), true);
|
|
4150
4285
|
}
|
|
4151
4286
|
}, [canSlide, useLoop, innerIndex, slideBy, moveToInner]);
|
|
4152
|
-
|
|
4287
|
+
React28.useEffect(() => {
|
|
4153
4288
|
if (indexProp === void 0) return;
|
|
4154
4289
|
const clamped = Math.max(0, Math.min(indexProp, maxIndex));
|
|
4155
4290
|
const target = useLoop ? cloneCount + clamped : clamped;
|
|
@@ -4157,12 +4292,12 @@ var Swiper = (props) => {
|
|
|
4157
4292
|
moveToInner(target, true);
|
|
4158
4293
|
}
|
|
4159
4294
|
}, [indexProp]);
|
|
4160
|
-
|
|
4295
|
+
React28.useImperativeHandle(swiperRef, () => ({
|
|
4161
4296
|
slidePrev,
|
|
4162
4297
|
slideNext,
|
|
4163
4298
|
slideTo
|
|
4164
4299
|
}));
|
|
4165
|
-
|
|
4300
|
+
React28.useEffect(() => {
|
|
4166
4301
|
if (!auto || !canSlide) return;
|
|
4167
4302
|
autoplayTimerRef.current = setInterval(slideNext, autoplayDelay);
|
|
4168
4303
|
return () => {
|
|
@@ -4185,7 +4320,7 @@ var Swiper = (props) => {
|
|
|
4185
4320
|
startXRef.current = getClientX(e);
|
|
4186
4321
|
startTimeRef.current = Date.now();
|
|
4187
4322
|
};
|
|
4188
|
-
|
|
4323
|
+
React28.useEffect(() => {
|
|
4189
4324
|
if (!isDragging) return;
|
|
4190
4325
|
const handleMove = (e) => {
|
|
4191
4326
|
setDragOffset(getClientX(e) - startXRef.current);
|
|
@@ -4223,8 +4358,8 @@ var Swiper = (props) => {
|
|
|
4223
4358
|
}, [isDragging, dragOffset, innerIndex, useLoop, maxIndex, slideStep, moveToInner]);
|
|
4224
4359
|
const slideWidthPercent = 100 / viewItemCount;
|
|
4225
4360
|
const gapAdjust = spaceBetween * (viewItemCount - 1) / viewItemCount;
|
|
4226
|
-
const slideElements =
|
|
4227
|
-
() => extendedItems.map((item, idx) => /* @__PURE__ */
|
|
4361
|
+
const slideElements = React28.useMemo(
|
|
4362
|
+
() => extendedItems.map((item, idx) => /* @__PURE__ */ jsx335(
|
|
4228
4363
|
"div",
|
|
4229
4364
|
{
|
|
4230
4365
|
className: "lib-xplat-swiper__slide",
|
|
@@ -4243,14 +4378,14 @@ var Swiper = (props) => {
|
|
|
4243
4378
|
Math.floor(realIndex / slideBy),
|
|
4244
4379
|
totalSteps - 1
|
|
4245
4380
|
);
|
|
4246
|
-
return /* @__PURE__ */
|
|
4247
|
-
/* @__PURE__ */
|
|
4381
|
+
return /* @__PURE__ */ jsxs217("div", { className: "lib-xplat-swiper", ref: containerRef, children: [
|
|
4382
|
+
/* @__PURE__ */ jsx335(
|
|
4248
4383
|
"div",
|
|
4249
4384
|
{
|
|
4250
4385
|
className: "lib-xplat-swiper__viewport",
|
|
4251
4386
|
onMouseDown: handleDragStart,
|
|
4252
4387
|
onTouchStart: handleDragStart,
|
|
4253
|
-
children: /* @__PURE__ */
|
|
4388
|
+
children: /* @__PURE__ */ jsx335(
|
|
4254
4389
|
"div",
|
|
4255
4390
|
{
|
|
4256
4391
|
className: clsx_default(
|
|
@@ -4268,7 +4403,7 @@ var Swiper = (props) => {
|
|
|
4268
4403
|
)
|
|
4269
4404
|
}
|
|
4270
4405
|
),
|
|
4271
|
-
showProgress && canSlide && /* @__PURE__ */
|
|
4406
|
+
showProgress && canSlide && /* @__PURE__ */ jsx335("div", { className: "lib-xplat-swiper__progress", children: /* @__PURE__ */ jsx335("div", { className: "lib-xplat-swiper__progress-track", children: /* @__PURE__ */ jsx335(
|
|
4272
4407
|
"span",
|
|
4273
4408
|
{
|
|
4274
4409
|
className: "lib-xplat-swiper__progress-fill",
|
|
@@ -4278,7 +4413,7 @@ var Swiper = (props) => {
|
|
|
4278
4413
|
}
|
|
4279
4414
|
}
|
|
4280
4415
|
) }) }),
|
|
4281
|
-
canSlide && /* @__PURE__ */
|
|
4416
|
+
canSlide && /* @__PURE__ */ jsx335("div", { className: "lib-xplat-swiper__dots", children: Array.from({ length: totalSteps }, (_, i) => /* @__PURE__ */ jsx335(
|
|
4282
4417
|
"button",
|
|
4283
4418
|
{
|
|
4284
4419
|
className: clsx_default(
|
|
@@ -4296,8 +4431,8 @@ Swiper.displayName = "Swiper";
|
|
|
4296
4431
|
var Swiper_default = Swiper;
|
|
4297
4432
|
|
|
4298
4433
|
// src/components/Switch/Switch.tsx
|
|
4299
|
-
import
|
|
4300
|
-
import { jsx as
|
|
4434
|
+
import React29 from "react";
|
|
4435
|
+
import { jsx as jsx336 } from "react/jsx-runtime";
|
|
4301
4436
|
var KNOB_TRANSITION_MS = 250;
|
|
4302
4437
|
var Switch = (props) => {
|
|
4303
4438
|
const {
|
|
@@ -4307,9 +4442,9 @@ var Switch = (props) => {
|
|
|
4307
4442
|
disabled,
|
|
4308
4443
|
onChange
|
|
4309
4444
|
} = props;
|
|
4310
|
-
const [isAnimating, setIsAnimating] =
|
|
4311
|
-
const timeoutRef =
|
|
4312
|
-
|
|
4445
|
+
const [isAnimating, setIsAnimating] = React29.useState(false);
|
|
4446
|
+
const timeoutRef = React29.useRef(null);
|
|
4447
|
+
React29.useEffect(() => {
|
|
4313
4448
|
return () => {
|
|
4314
4449
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4315
4450
|
};
|
|
@@ -4324,7 +4459,7 @@ var Switch = (props) => {
|
|
|
4324
4459
|
timeoutRef.current = null;
|
|
4325
4460
|
}, KNOB_TRANSITION_MS);
|
|
4326
4461
|
};
|
|
4327
|
-
return /* @__PURE__ */
|
|
4462
|
+
return /* @__PURE__ */ jsx336(
|
|
4328
4463
|
"div",
|
|
4329
4464
|
{
|
|
4330
4465
|
className: clsx_default(
|
|
@@ -4337,80 +4472,13 @@ var Switch = (props) => {
|
|
|
4337
4472
|
),
|
|
4338
4473
|
onClick: handleClick,
|
|
4339
4474
|
"aria-disabled": disabled || isAnimating,
|
|
4340
|
-
children: /* @__PURE__ */
|
|
4475
|
+
children: /* @__PURE__ */ jsx336("div", { className: clsx_default("knob", value ? "checked" : void 0) })
|
|
4341
4476
|
}
|
|
4342
4477
|
);
|
|
4343
4478
|
};
|
|
4344
4479
|
Switch.displayName = "Switch";
|
|
4345
4480
|
var Switch_default = Switch;
|
|
4346
4481
|
|
|
4347
|
-
// src/components/Tab/Tab.tsx
|
|
4348
|
-
import React29 from "react";
|
|
4349
|
-
|
|
4350
|
-
// src/components/Tab/TabItem.tsx
|
|
4351
|
-
import React28 from "react";
|
|
4352
|
-
import { jsx as jsx335 } from "react/jsx-runtime";
|
|
4353
|
-
var TabItem = React28.forwardRef((props, ref) => {
|
|
4354
|
-
const { isActive, title, onClick } = props;
|
|
4355
|
-
return /* @__PURE__ */ jsx335(
|
|
4356
|
-
"div",
|
|
4357
|
-
{
|
|
4358
|
-
ref,
|
|
4359
|
-
className: clsx_default("tab-item", isActive ? "active" : null),
|
|
4360
|
-
onClick,
|
|
4361
|
-
children: title
|
|
4362
|
-
}
|
|
4363
|
-
);
|
|
4364
|
-
});
|
|
4365
|
-
TabItem.displayName = "TabItem";
|
|
4366
|
-
var TabItem_default = TabItem;
|
|
4367
|
-
|
|
4368
|
-
// src/components/Tab/Tab.tsx
|
|
4369
|
-
import { jsx as jsx336, jsxs as jsxs217 } from "react/jsx-runtime";
|
|
4370
|
-
var Tab = (props) => {
|
|
4371
|
-
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
4372
|
-
const [underlineStyle, setUnderlineStyle] = React29.useState({
|
|
4373
|
-
left: 0,
|
|
4374
|
-
width: 0
|
|
4375
|
-
});
|
|
4376
|
-
const itemRefs = React29.useRef([]);
|
|
4377
|
-
const handleChangeActiveTab = (tabItem, tabIdx) => {
|
|
4378
|
-
onChange(tabItem, tabIdx);
|
|
4379
|
-
};
|
|
4380
|
-
React29.useEffect(() => {
|
|
4381
|
-
const el = itemRefs.current[activeIndex];
|
|
4382
|
-
if (el) {
|
|
4383
|
-
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
4384
|
-
}
|
|
4385
|
-
}, [activeIndex, tabs.length]);
|
|
4386
|
-
return /* @__PURE__ */ jsxs217("div", { className: clsx_default("lib-xplat-tab", `type-${type}`, size), children: [
|
|
4387
|
-
tabs.map((tab, idx) => /* @__PURE__ */ jsx336(
|
|
4388
|
-
TabItem_default,
|
|
4389
|
-
{
|
|
4390
|
-
onClick: () => handleChangeActiveTab(tab, idx),
|
|
4391
|
-
isActive: activeIndex === idx,
|
|
4392
|
-
ref: (el) => {
|
|
4393
|
-
itemRefs.current[idx] = el;
|
|
4394
|
-
},
|
|
4395
|
-
title: tab.title
|
|
4396
|
-
},
|
|
4397
|
-
`${tab.value}_${idx}`
|
|
4398
|
-
)),
|
|
4399
|
-
type === "toggle" && /* @__PURE__ */ jsx336(
|
|
4400
|
-
"div",
|
|
4401
|
-
{
|
|
4402
|
-
className: "tab-toggle-underline",
|
|
4403
|
-
style: {
|
|
4404
|
-
left: underlineStyle.left,
|
|
4405
|
-
width: underlineStyle.width
|
|
4406
|
-
}
|
|
4407
|
-
}
|
|
4408
|
-
)
|
|
4409
|
-
] });
|
|
4410
|
-
};
|
|
4411
|
-
Tab.displayName = "Tab";
|
|
4412
|
-
var Tab_default = Tab;
|
|
4413
|
-
|
|
4414
4482
|
// src/components/Table/TableContext.tsx
|
|
4415
4483
|
import React30 from "react";
|
|
4416
4484
|
var TableContext = React30.createContext(null);
|
|
@@ -5157,10 +5225,10 @@ export {
|
|
|
5157
5225
|
Alert_default as Alert,
|
|
5158
5226
|
Avatar_default as Avatar,
|
|
5159
5227
|
Badge_default as Badge,
|
|
5228
|
+
Box_default as Box,
|
|
5160
5229
|
Breadcrumb_default as Breadcrumb,
|
|
5161
5230
|
Button_default as Button,
|
|
5162
5231
|
Calendar_default as Calendar,
|
|
5163
|
-
Card_default as Card,
|
|
5164
5232
|
CardTab_default as CardTab,
|
|
5165
5233
|
Chart_default as Chart,
|
|
5166
5234
|
CheckBox_default as CheckBox,
|