@x-plat/design-system 0.5.7 → 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 +185 -56
- 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 +185 -56
- 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 +720 -643
- 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 +714 -637
- package/dist/index.cjs +720 -643
- package/dist/index.css +197 -156
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +714 -637
- 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";
|
|
@@ -2015,25 +2020,65 @@ var CardTab_default = CardTab;
|
|
|
2015
2020
|
// src/components/Chart/Chart.tsx
|
|
2016
2021
|
import React5 from "react";
|
|
2017
2022
|
import { jsx as jsx305, jsxs as jsxs196 } from "react/jsx-runtime";
|
|
2018
|
-
var
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
[
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
var
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2023
|
+
var CATEGORICAL_COUNT2 = 8;
|
|
2024
|
+
var LINE_BAR_PALETTES = Array.from({ length: CATEGORICAL_COUNT2 }, (_, i) => {
|
|
2025
|
+
const n = i + 1;
|
|
2026
|
+
return [
|
|
2027
|
+
`var(--semantic-categorical-${n}-bg)`,
|
|
2028
|
+
`var(--semantic-categorical-${n}-area)`,
|
|
2029
|
+
`var(--semantic-categorical-${n}-fill)`,
|
|
2030
|
+
`var(--semantic-categorical-${n}-text)`
|
|
2031
|
+
];
|
|
2032
|
+
});
|
|
2033
|
+
var PIE_COLORS = Array.from(
|
|
2034
|
+
{ length: CATEGORICAL_COUNT2 },
|
|
2035
|
+
(_, i) => `var(--semantic-categorical-${i + 1}-fill)`
|
|
2036
|
+
);
|
|
2037
|
+
var hashString = (str) => {
|
|
2038
|
+
let hash = 0;
|
|
2039
|
+
for (let i = 0; i < str.length; i++) {
|
|
2040
|
+
hash = (hash << 5) - hash + str.charCodeAt(i) | 0;
|
|
2041
|
+
}
|
|
2042
|
+
return Math.abs(hash);
|
|
2043
|
+
};
|
|
2044
|
+
var getPalette = (palettes, index, key) => {
|
|
2045
|
+
const offset = key ? hashString(key) : 0;
|
|
2046
|
+
return palettes[(index + offset) % palettes.length];
|
|
2035
2047
|
};
|
|
2036
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
|
+
};
|
|
2037
2082
|
var useChartTooltip = (enabled) => {
|
|
2038
2083
|
const [tooltip, setTooltip] = React5.useState({
|
|
2039
2084
|
visible: false,
|
|
@@ -2068,15 +2113,15 @@ var useChartTooltip = (enabled) => {
|
|
|
2068
2113
|
}, []);
|
|
2069
2114
|
return { tooltip, show, hide, move, containerRef };
|
|
2070
2115
|
};
|
|
2071
|
-
var LineChart = React5.memo(({ data, labels, onHover, onMove, onLeave }) => {
|
|
2116
|
+
var LineChart = React5.memo(({ data, labels, width, height, onHover, onMove, onLeave }) => {
|
|
2072
2117
|
const entries = React5.useMemo(() => Object.entries(data), [data]);
|
|
2073
2118
|
const maxVal = React5.useMemo(() => {
|
|
2074
2119
|
const allValues = entries.flatMap(([, v]) => v);
|
|
2075
2120
|
return Math.max(...allValues) * 1.2 || 1;
|
|
2076
2121
|
}, [entries]);
|
|
2077
2122
|
const count = labels.length;
|
|
2078
|
-
const chartW =
|
|
2079
|
-
const chartH =
|
|
2123
|
+
const chartW = width - PADDING.left - PADDING.right;
|
|
2124
|
+
const chartH = height - PADDING.top - PADDING.bottom;
|
|
2080
2125
|
const seriesPoints = React5.useMemo(
|
|
2081
2126
|
() => entries.map(
|
|
2082
2127
|
([, values]) => values.map((v, i) => ({
|
|
@@ -2087,22 +2132,22 @@ var LineChart = React5.memo(({ data, labels, onHover, onMove, onLeave }) => {
|
|
|
2087
2132
|
),
|
|
2088
2133
|
[entries, count, chartW, chartH, maxVal]
|
|
2089
2134
|
);
|
|
2090
|
-
return /* @__PURE__ */ jsxs196("svg", { viewBox:
|
|
2135
|
+
return /* @__PURE__ */ jsxs196("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
2091
2136
|
[0, 0.25, 0.5, 0.75, 1].map((ratio) => {
|
|
2092
2137
|
const y = PADDING.top + (1 - ratio) * chartH;
|
|
2093
2138
|
const val = Math.round(maxVal * ratio);
|
|
2094
2139
|
return /* @__PURE__ */ jsxs196("g", { children: [
|
|
2095
|
-
/* @__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" }),
|
|
2096
2141
|
/* @__PURE__ */ jsx305("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
|
|
2097
2142
|
] }, ratio);
|
|
2098
2143
|
}),
|
|
2099
2144
|
labels.map((label, i) => {
|
|
2100
2145
|
const x = PADDING.left + i / (count - 1 || 1) * chartW;
|
|
2101
|
-
return /* @__PURE__ */ jsx305("text", { x, y:
|
|
2146
|
+
return /* @__PURE__ */ jsx305("text", { x, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
2102
2147
|
}),
|
|
2103
2148
|
entries.map(([key], di) => {
|
|
2104
|
-
const palette = getPalette(LINE_BAR_PALETTES, di);
|
|
2105
|
-
const color = palette[
|
|
2149
|
+
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
2150
|
+
const color = palette[2];
|
|
2106
2151
|
const points = seriesPoints[di];
|
|
2107
2152
|
return /* @__PURE__ */ jsxs196("g", { children: [
|
|
2108
2153
|
/* @__PURE__ */ jsx305(
|
|
@@ -2133,7 +2178,73 @@ var LineChart = React5.memo(({ data, labels, onHover, onMove, onLeave }) => {
|
|
|
2133
2178
|
] });
|
|
2134
2179
|
});
|
|
2135
2180
|
LineChart.displayName = "LineChart";
|
|
2136
|
-
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 }) => {
|
|
2137
2248
|
const entries = React5.useMemo(() => Object.entries(data), [data]);
|
|
2138
2249
|
const maxVal = React5.useMemo(() => {
|
|
2139
2250
|
const allValues = entries.flatMap(([, v]) => v);
|
|
@@ -2141,8 +2252,8 @@ var BarChart = React5.memo(({ data, labels, onHover, onMove, onLeave }) => {
|
|
|
2141
2252
|
}, [entries]);
|
|
2142
2253
|
const count = labels.length;
|
|
2143
2254
|
const groupCount = entries.length;
|
|
2144
|
-
const chartW =
|
|
2145
|
-
const chartH =
|
|
2255
|
+
const chartW = width - PADDING.left - PADDING.right;
|
|
2256
|
+
const chartH = height - PADDING.top - PADDING.bottom;
|
|
2146
2257
|
const groupW = chartW / count;
|
|
2147
2258
|
const barW = Math.min(32, groupW * 0.7 / groupCount);
|
|
2148
2259
|
const bars = React5.useMemo(
|
|
@@ -2156,19 +2267,19 @@ var BarChart = React5.memo(({ data, labels, onHover, onMove, onLeave }) => {
|
|
|
2156
2267
|
),
|
|
2157
2268
|
[entries, maxVal, chartH, groupW, barW, groupCount]
|
|
2158
2269
|
);
|
|
2159
|
-
return /* @__PURE__ */ jsxs196("svg", { viewBox:
|
|
2270
|
+
return /* @__PURE__ */ jsxs196("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
2160
2271
|
[0, 0.25, 0.5, 0.75, 1].map((ratio) => {
|
|
2161
2272
|
const y = PADDING.top + (1 - ratio) * chartH;
|
|
2162
2273
|
const val = Math.round(maxVal * ratio);
|
|
2163
2274
|
return /* @__PURE__ */ jsxs196("g", { children: [
|
|
2164
|
-
/* @__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" }),
|
|
2165
2276
|
/* @__PURE__ */ jsx305("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
|
|
2166
2277
|
] }, ratio);
|
|
2167
2278
|
}),
|
|
2168
|
-
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)),
|
|
2169
2280
|
entries.map(([key], di) => {
|
|
2170
|
-
const palette = getPalette(LINE_BAR_PALETTES, di);
|
|
2171
|
-
const color = palette[
|
|
2281
|
+
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
2282
|
+
const color = palette[2];
|
|
2172
2283
|
return bars[di].map((b, i) => /* @__PURE__ */ jsx305(
|
|
2173
2284
|
"rect",
|
|
2174
2285
|
{
|
|
@@ -2176,7 +2287,7 @@ var BarChart = React5.memo(({ data, labels, onHover, onMove, onLeave }) => {
|
|
|
2176
2287
|
y: b.y,
|
|
2177
2288
|
width: b.w,
|
|
2178
2289
|
height: b.h,
|
|
2179
|
-
rx:
|
|
2290
|
+
rx: Math.min(4, b.w / 2),
|
|
2180
2291
|
fill: color,
|
|
2181
2292
|
className: "chart-bar",
|
|
2182
2293
|
onMouseEnter: (e) => onHover(e, `${key}: ${labels[i]} \u2014 ${b.v}`),
|
|
@@ -2190,14 +2301,17 @@ var BarChart = React5.memo(({ data, labels, onHover, onMove, onLeave }) => {
|
|
|
2190
2301
|
});
|
|
2191
2302
|
BarChart.displayName = "BarChart";
|
|
2192
2303
|
var PieDonutChart = React5.memo(
|
|
2193
|
-
({ data, labels, isDoughnut, onHover, onMove, onLeave }) => {
|
|
2194
|
-
const
|
|
2304
|
+
({ data, labels, width, height, isDoughnut, onHover, onMove, onLeave }) => {
|
|
2305
|
+
const entries = React5.useMemo(() => Object.entries(data), [data]);
|
|
2306
|
+
const values = React5.useMemo(() => entries.flatMap(([, v]) => v), [entries]);
|
|
2195
2307
|
const total = React5.useMemo(() => values.reduce((a, b) => a + b, 0) || 1, [values]);
|
|
2196
|
-
const
|
|
2197
|
-
const
|
|
2198
|
-
const
|
|
2199
|
-
const
|
|
2200
|
-
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;
|
|
2313
|
+
const firstKey = entries[0]?.[0] ?? "";
|
|
2314
|
+
const colorOffset = hashString(firstKey);
|
|
2201
2315
|
const sliceData = React5.useMemo(() => {
|
|
2202
2316
|
let angle0 = -Math.PI / 2;
|
|
2203
2317
|
return values.map((v, i) => {
|
|
@@ -2226,13 +2340,13 @@ var PieDonutChart = React5.memo(
|
|
|
2226
2340
|
angle0 = endAngle;
|
|
2227
2341
|
return { d, lx, ly, v, pct, angle, label: labels[i] || `${i + 1}` };
|
|
2228
2342
|
});
|
|
2229
|
-
}, [values, total, innerR, labels]);
|
|
2230
|
-
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: [
|
|
2231
2345
|
/* @__PURE__ */ jsx305(
|
|
2232
2346
|
"path",
|
|
2233
2347
|
{
|
|
2234
2348
|
d: s.d,
|
|
2235
|
-
fill:
|
|
2349
|
+
fill: PIE_COLORS[(i + colorOffset) % PIE_COLORS.length],
|
|
2236
2350
|
className: "chart-slice",
|
|
2237
2351
|
onMouseEnter: (e) => onHover(e, `${s.label}: ${s.v} (${s.pct}%)`),
|
|
2238
2352
|
onMouseMove: onMove,
|
|
@@ -2244,22 +2358,42 @@ var PieDonutChart = React5.memo(
|
|
|
2244
2358
|
}
|
|
2245
2359
|
);
|
|
2246
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
|
+
};
|
|
2247
2385
|
var Chart = (props) => {
|
|
2248
2386
|
const { type, data, labels, tooltip: showTooltip = true } = props;
|
|
2249
2387
|
const { tooltip, show, hide, move, containerRef } = useChartTooltip(showTooltip);
|
|
2388
|
+
const { width, height } = useChartSize(containerRef);
|
|
2389
|
+
const ready = width > 0 && height > 0;
|
|
2250
2390
|
return /* @__PURE__ */ jsxs196("div", { className: "lib-xplat-chart", ref: containerRef, children: [
|
|
2251
|
-
type === "line" && /* @__PURE__ */ jsx305(LineChart, { data, labels, onHover: show, onMove: move, onLeave: hide }),
|
|
2252
|
-
type === "
|
|
2253
|
-
type === "
|
|
2254
|
-
type === "
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
{
|
|
2258
|
-
className: "chart-tooltip",
|
|
2259
|
-
style: { left: tooltip.x, top: tooltip.y },
|
|
2260
|
-
children: tooltip.content
|
|
2261
|
-
}
|
|
2262
|
-
)
|
|
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 })
|
|
2263
2397
|
] });
|
|
2264
2398
|
};
|
|
2265
2399
|
Chart.displayName = "Chart";
|
|
@@ -2511,42 +2645,66 @@ var PasswordInput = React7.forwardRef(
|
|
|
2511
2645
|
PasswordInput.displayName = "PasswordInput";
|
|
2512
2646
|
var PasswordInput_default = PasswordInput;
|
|
2513
2647
|
|
|
2514
|
-
// src/
|
|
2648
|
+
// src/components/Modal/Modal.tsx
|
|
2515
2649
|
import React8 from "react";
|
|
2516
|
-
|
|
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);
|
|
2517
2657
|
React8.useEffect(() => {
|
|
2518
|
-
if (
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
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
|
+
)
|
|
2527
2686
|
}
|
|
2528
|
-
|
|
2529
|
-
document.
|
|
2530
|
-
|
|
2531
|
-
return () => {
|
|
2532
|
-
document.removeEventListener("mousedown", listener);
|
|
2533
|
-
document.removeEventListener("touchstart", listener);
|
|
2534
|
-
};
|
|
2535
|
-
}, [refs, handler, enabled]);
|
|
2687
|
+
),
|
|
2688
|
+
document.body
|
|
2689
|
+
);
|
|
2536
2690
|
};
|
|
2537
|
-
|
|
2691
|
+
Modal.displayName = "Modal";
|
|
2692
|
+
var Modal_default = Modal;
|
|
2538
2693
|
|
|
2539
2694
|
// src/components/DatePicker/SingleDatePicker/index.tsx
|
|
2540
2695
|
import React9 from "react";
|
|
2541
|
-
import { Fragment as Fragment2, jsx as
|
|
2696
|
+
import { Fragment as Fragment2, jsx as jsx312, jsxs as jsxs200 } from "react/jsx-runtime";
|
|
2542
2697
|
var DayCell2 = React9.memo(
|
|
2543
2698
|
({
|
|
2544
2699
|
day,
|
|
2545
2700
|
disabled,
|
|
2546
2701
|
selected,
|
|
2547
2702
|
highlighted,
|
|
2703
|
+
isStart,
|
|
2704
|
+
isEnd,
|
|
2705
|
+
inRange,
|
|
2548
2706
|
onSelect
|
|
2549
|
-
}) => /* @__PURE__ */
|
|
2707
|
+
}) => /* @__PURE__ */ jsx312(
|
|
2550
2708
|
"button",
|
|
2551
2709
|
{
|
|
2552
2710
|
type: "button",
|
|
@@ -2554,8 +2712,9 @@ var DayCell2 = React9.memo(
|
|
|
2554
2712
|
"datepicker-day",
|
|
2555
2713
|
!day.isCurrentMonth && "outside",
|
|
2556
2714
|
disabled && "disabled",
|
|
2557
|
-
selected && "selected",
|
|
2715
|
+
(selected || isStart || isEnd) && "selected",
|
|
2558
2716
|
highlighted && !selected && "highlighted",
|
|
2717
|
+
inRange && !isStart && !isEnd && "in-range",
|
|
2559
2718
|
day.isToday && "today",
|
|
2560
2719
|
day.isSunday && "sunday",
|
|
2561
2720
|
day.isSaturday && "saturday"
|
|
@@ -2567,7 +2726,7 @@ var DayCell2 = React9.memo(
|
|
|
2567
2726
|
children: day.day
|
|
2568
2727
|
}
|
|
2569
2728
|
),
|
|
2570
|
-
(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
|
|
2571
2730
|
);
|
|
2572
2731
|
DayCell2.displayName = "DayCell";
|
|
2573
2732
|
var SingleDatePicker = (props) => {
|
|
@@ -2577,7 +2736,9 @@ var SingleDatePicker = (props) => {
|
|
|
2577
2736
|
minDate,
|
|
2578
2737
|
maxDate,
|
|
2579
2738
|
highlightDates = [],
|
|
2580
|
-
locale = "ko"
|
|
2739
|
+
locale = "ko",
|
|
2740
|
+
rangeStart,
|
|
2741
|
+
rangeEnd
|
|
2581
2742
|
} = props;
|
|
2582
2743
|
const initialYear = value?.getFullYear();
|
|
2583
2744
|
const initialMonth = value?.getMonth();
|
|
@@ -2625,6 +2786,8 @@ var SingleDatePicker = (props) => {
|
|
|
2625
2786
|
else if (pickerMode === "months") {
|
|
2626
2787
|
setYearRangeStart(Math.floor(year / 12) * 12);
|
|
2627
2788
|
setPickerMode("years");
|
|
2789
|
+
} else {
|
|
2790
|
+
setPickerMode("days");
|
|
2628
2791
|
}
|
|
2629
2792
|
};
|
|
2630
2793
|
const handleMonthSelect = (m) => {
|
|
@@ -2638,71 +2801,80 @@ var SingleDatePicker = (props) => {
|
|
|
2638
2801
|
const weekdays = WEEKDAY_LABELS[locale];
|
|
2639
2802
|
const monthLabels = MONTH_LABELS[locale];
|
|
2640
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;
|
|
2641
2805
|
return /* @__PURE__ */ jsxs200(
|
|
2642
2806
|
"div",
|
|
2643
2807
|
{
|
|
2644
2808
|
className: clsx_default("lib-xplat-datepicker", "single"),
|
|
2645
2809
|
children: [
|
|
2646
2810
|
/* @__PURE__ */ jsxs200("div", { className: "datepicker-header", children: [
|
|
2647
|
-
/* @__PURE__ */
|
|
2648
|
-
/* @__PURE__ */
|
|
2649
|
-
/* @__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, {}) })
|
|
2650
2814
|
] }),
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
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(
|
|
2654
2830
|
"button",
|
|
2655
2831
|
{
|
|
2656
2832
|
type: "button",
|
|
2657
|
-
className: clsx_default("datepicker-picker-cell",
|
|
2658
|
-
onClick: () =>
|
|
2659
|
-
children: y
|
|
2660
|
-
},
|
|
2661
|
-
y
|
|
2662
|
-
);
|
|
2663
|
-
}) }),
|
|
2664
|
-
pickerMode === "months" && /* @__PURE__ */ jsx311("div", { className: "datepicker-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ jsx311(
|
|
2665
|
-
"button",
|
|
2666
|
-
{
|
|
2667
|
-
type: "button",
|
|
2668
|
-
className: clsx_default("datepicker-picker-cell", i === month && "active"),
|
|
2669
|
-
onClick: () => handleMonthSelect(i),
|
|
2670
|
-
children: label
|
|
2671
|
-
},
|
|
2672
|
-
i
|
|
2673
|
-
)) }),
|
|
2674
|
-
pickerMode === "days" && /* @__PURE__ */ jsxs200(Fragment2, { children: [
|
|
2675
|
-
/* @__PURE__ */ jsx311("div", { className: "datepicker-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ jsx311(
|
|
2676
|
-
"div",
|
|
2677
|
-
{
|
|
2678
|
-
className: clsx_default(
|
|
2679
|
-
"datepicker-weekday",
|
|
2680
|
-
i === 0 && "sunday",
|
|
2681
|
-
i === 6 && "saturday"
|
|
2682
|
-
),
|
|
2833
|
+
className: clsx_default("datepicker-picker-cell", i === month && "active"),
|
|
2834
|
+
onClick: () => handleMonthSelect(i),
|
|
2683
2835
|
children: label
|
|
2684
2836
|
},
|
|
2685
|
-
|
|
2837
|
+
i
|
|
2686
2838
|
)) }),
|
|
2687
|
-
/* @__PURE__ */
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
const selected = value ? isSameDay(day.date, value) : false;
|
|
2691
|
-
const highlighted = highlightSet.has(
|
|
2692
|
-
`${day.date.getFullYear()}-${day.date.getMonth()}-${day.date.getDate()}`
|
|
2693
|
-
);
|
|
2694
|
-
return /* @__PURE__ */ jsx311(
|
|
2695
|
-
DayCell2,
|
|
2839
|
+
pickerMode === "days" && /* @__PURE__ */ jsxs200(Fragment2, { children: [
|
|
2840
|
+
/* @__PURE__ */ jsx312("div", { className: "datepicker-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ jsx312(
|
|
2841
|
+
"div",
|
|
2696
2842
|
{
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2843
|
+
className: clsx_default(
|
|
2844
|
+
"datepicker-weekday",
|
|
2845
|
+
i === 0 && "sunday",
|
|
2846
|
+
i === 6 && "saturday"
|
|
2847
|
+
),
|
|
2848
|
+
children: label
|
|
2702
2849
|
},
|
|
2703
|
-
|
|
2704
|
-
)
|
|
2705
|
-
|
|
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
|
+
] })
|
|
2706
2878
|
] })
|
|
2707
2879
|
]
|
|
2708
2880
|
}
|
|
@@ -2712,7 +2884,7 @@ SingleDatePicker.displayName = "SingleDatePicker";
|
|
|
2712
2884
|
var SingleDatePicker_default = SingleDatePicker;
|
|
2713
2885
|
|
|
2714
2886
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
2715
|
-
import { jsx as
|
|
2887
|
+
import { jsx as jsx313, jsxs as jsxs201 } from "react/jsx-runtime";
|
|
2716
2888
|
var formatDate = (date) => {
|
|
2717
2889
|
if (!date || !(date instanceof Date) || isNaN(date.getTime())) return "";
|
|
2718
2890
|
const y = date.getFullYear();
|
|
@@ -2721,137 +2893,131 @@ var formatDate = (date) => {
|
|
|
2721
2893
|
return `${y}/${m}/${d}`;
|
|
2722
2894
|
};
|
|
2723
2895
|
var InputDatePicker = (props) => {
|
|
2724
|
-
const { value, onChange, minDate, maxDate, disabled, locale, placeholder } = props;
|
|
2896
|
+
const { value, onChange, minDate, maxDate, disabled, locale = "ko", placeholder } = props;
|
|
2725
2897
|
const [isOpen, setIsOpen] = React10.useState(false);
|
|
2726
|
-
const
|
|
2727
|
-
const
|
|
2728
|
-
|
|
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
|
+
};
|
|
2729
2904
|
const handleSelect = (date) => {
|
|
2730
|
-
if (
|
|
2731
|
-
|
|
2905
|
+
if (date) setTempDate(date);
|
|
2906
|
+
};
|
|
2907
|
+
const handleApply = () => {
|
|
2908
|
+
onChange?.(tempDate);
|
|
2732
2909
|
setIsOpen(false);
|
|
2733
2910
|
};
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
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
|
-
);
|
|
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
|
+
] });
|
|
2770
2942
|
};
|
|
2771
2943
|
InputDatePicker.displayName = "InputDatePicker";
|
|
2772
2944
|
var InputDatePicker_default = InputDatePicker;
|
|
2773
2945
|
|
|
2774
2946
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
2947
|
+
import React14 from "react";
|
|
2948
|
+
|
|
2949
|
+
// src/components/DatePicker/RangePicker/index.tsx
|
|
2775
2950
|
import React13 from "react";
|
|
2776
2951
|
|
|
2777
|
-
// src/components/
|
|
2952
|
+
// src/components/Tab/Tab.tsx
|
|
2953
|
+
import React12 from "react";
|
|
2954
|
+
|
|
2955
|
+
// src/components/Tab/TabItem.tsx
|
|
2778
2956
|
import React11 from "react";
|
|
2779
|
-
import {
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
const t2 = setTimeout(() => setVisible(true), 1);
|
|
2790
|
-
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
|
|
2791
2967
|
}
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
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(
|
|
2801
3005
|
"div",
|
|
2802
3006
|
{
|
|
2803
|
-
className:
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
className: clsx_default("lib-xplat-modal", "modal-box", stateClass),
|
|
2809
|
-
role: "dialog",
|
|
2810
|
-
"aria-modal": "true",
|
|
2811
|
-
onClick: (e) => e.stopPropagation(),
|
|
2812
|
-
children
|
|
2813
|
-
}
|
|
2814
|
-
)
|
|
3007
|
+
className: "tab-toggle-underline",
|
|
3008
|
+
style: {
|
|
3009
|
+
left: underlineStyle.left,
|
|
3010
|
+
width: underlineStyle.width
|
|
3011
|
+
}
|
|
2815
3012
|
}
|
|
2816
|
-
)
|
|
2817
|
-
|
|
2818
|
-
);
|
|
3013
|
+
)
|
|
3014
|
+
] });
|
|
2819
3015
|
};
|
|
2820
|
-
|
|
2821
|
-
var
|
|
3016
|
+
Tab.displayName = "Tab";
|
|
3017
|
+
var Tab_default = Tab;
|
|
2822
3018
|
|
|
2823
3019
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
2824
|
-
import
|
|
2825
|
-
import { jsx as jsx314, jsxs as jsxs202 } from "react/jsx-runtime";
|
|
2826
|
-
var RangeDayCell = React12.memo(
|
|
2827
|
-
({
|
|
2828
|
-
day,
|
|
2829
|
-
disabled,
|
|
2830
|
-
isStart,
|
|
2831
|
-
isEnd,
|
|
2832
|
-
inRange,
|
|
2833
|
-
onClick
|
|
2834
|
-
}) => /* @__PURE__ */ jsx314(
|
|
2835
|
-
"button",
|
|
2836
|
-
{
|
|
2837
|
-
type: "button",
|
|
2838
|
-
className: clsx_default(
|
|
2839
|
-
"datepicker-day",
|
|
2840
|
-
!day.isCurrentMonth && "outside",
|
|
2841
|
-
disabled && "disabled",
|
|
2842
|
-
(isStart || isEnd) && "selected",
|
|
2843
|
-
inRange && !isStart && !isEnd && "in-range",
|
|
2844
|
-
day.isToday && "today",
|
|
2845
|
-
day.isSunday && "sunday",
|
|
2846
|
-
day.isSaturday && "saturday"
|
|
2847
|
-
),
|
|
2848
|
-
disabled: disabled || !day.isCurrentMonth,
|
|
2849
|
-
onClick,
|
|
2850
|
-
children: day.day
|
|
2851
|
-
}
|
|
2852
|
-
)
|
|
2853
|
-
);
|
|
2854
|
-
RangeDayCell.displayName = "RangeDayCell";
|
|
3020
|
+
import { jsx as jsx316, jsxs as jsxs203 } from "react/jsx-runtime";
|
|
2855
3021
|
var RangePicker = (props) => {
|
|
2856
3022
|
const {
|
|
2857
3023
|
startDate,
|
|
@@ -2861,139 +3027,92 @@ var RangePicker = (props) => {
|
|
|
2861
3027
|
maxDate,
|
|
2862
3028
|
locale = "ko"
|
|
2863
3029
|
} = props;
|
|
2864
|
-
const [activeTab, setActiveTab] =
|
|
2865
|
-
const
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
if (minDate) {
|
|
2870
|
-
const min = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()).getTime();
|
|
2871
|
-
if (d < min) return true;
|
|
2872
|
-
}
|
|
2873
|
-
if (maxDate) {
|
|
2874
|
-
const max = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()).getTime();
|
|
2875
|
-
if (d > max) return true;
|
|
2876
|
-
}
|
|
2877
|
-
if (type === "end") {
|
|
2878
|
-
const start = new Date(startDate.getFullYear(), startDate.getMonth(), startDate.getDate()).getTime();
|
|
2879
|
-
if (d < start) return true;
|
|
2880
|
-
}
|
|
2881
|
-
if (type === "start") {
|
|
2882
|
-
const end = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate()).getTime();
|
|
2883
|
-
if (d > end) return true;
|
|
2884
|
-
}
|
|
2885
|
-
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 });
|
|
2886
3035
|
};
|
|
2887
|
-
const
|
|
2888
|
-
|
|
2889
|
-
const
|
|
2890
|
-
|
|
2891
|
-
/* @__PURE__ */ jsx314("span", { className: "datepicker-range-label", children: label }),
|
|
2892
|
-
/* @__PURE__ */ jsxs202("div", { className: "datepicker-header", children: [
|
|
2893
|
-
/* @__PURE__ */ jsx314(
|
|
2894
|
-
"button",
|
|
2895
|
-
{
|
|
2896
|
-
className: "datepicker-nav",
|
|
2897
|
-
onClick: cal.goToPrevMonth,
|
|
2898
|
-
type: "button",
|
|
2899
|
-
children: /* @__PURE__ */ jsx314(ChevronLeftIcon_default, {})
|
|
2900
|
-
}
|
|
2901
|
-
),
|
|
2902
|
-
/* @__PURE__ */ jsx314("span", { className: "datepicker-title", children: locale === "ko" ? `${cal.year}\uB144 ${MONTH_LABELS.ko[cal.month]}` : `${MONTH_LABELS.en[cal.month]} ${cal.year}` }),
|
|
2903
|
-
/* @__PURE__ */ jsx314(
|
|
2904
|
-
"button",
|
|
2905
|
-
{
|
|
2906
|
-
className: "datepicker-nav",
|
|
2907
|
-
onClick: cal.goToNextMonth,
|
|
2908
|
-
type: "button",
|
|
2909
|
-
children: /* @__PURE__ */ jsx314(ChevronRightIcon_default, {})
|
|
2910
|
-
}
|
|
2911
|
-
)
|
|
2912
|
-
] }),
|
|
2913
|
-
/* @__PURE__ */ jsx314("div", { className: "datepicker-weekdays", children: weekdays.map((w, i) => /* @__PURE__ */ jsx314(
|
|
2914
|
-
"div",
|
|
2915
|
-
{
|
|
2916
|
-
className: clsx_default(
|
|
2917
|
-
"datepicker-weekday",
|
|
2918
|
-
i === 0 && "sunday",
|
|
2919
|
-
i === 6 && "saturday"
|
|
2920
|
-
),
|
|
2921
|
-
children: w
|
|
2922
|
-
},
|
|
2923
|
-
w
|
|
2924
|
-
)) }),
|
|
2925
|
-
/* @__PURE__ */ jsx314("div", { className: "datepicker-grid", children: cal.days.map((day, idx) => {
|
|
2926
|
-
const disabled = isDisabled(day.date, type);
|
|
2927
|
-
const isStart = isSameDay(day.date, startDate);
|
|
2928
|
-
const isEnd = isSameDay(day.date, endDate);
|
|
2929
|
-
const inRange = isInRange(day.date, startDate, endDate);
|
|
2930
|
-
return /* @__PURE__ */ jsx314(
|
|
2931
|
-
RangeDayCell,
|
|
2932
|
-
{
|
|
2933
|
-
day,
|
|
2934
|
-
disabled,
|
|
2935
|
-
isStart,
|
|
2936
|
-
isEnd,
|
|
2937
|
-
inRange,
|
|
2938
|
-
onClick: () => {
|
|
2939
|
-
if (!disabled && day.isCurrentMonth) {
|
|
2940
|
-
if (type === "start") {
|
|
2941
|
-
const newStart = day.date > endDate ? endDate : day.date;
|
|
2942
|
-
onChange?.({ startDate: newStart, endDate });
|
|
2943
|
-
} else {
|
|
2944
|
-
const newEnd = day.date < startDate ? startDate : day.date;
|
|
2945
|
-
onChange?.({ startDate, endDate: newEnd });
|
|
2946
|
-
}
|
|
2947
|
-
}
|
|
2948
|
-
}
|
|
2949
|
-
},
|
|
2950
|
-
idx
|
|
2951
|
-
);
|
|
2952
|
-
}) })
|
|
2953
|
-
] });
|
|
3036
|
+
const handleEndChange = (date) => {
|
|
3037
|
+
if (!date) return;
|
|
3038
|
+
const newEnd = date < startDate ? startDate : date;
|
|
3039
|
+
onChange?.({ startDate, endDate: newEnd });
|
|
2954
3040
|
};
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
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
|
+
] });
|
|
2988
3107
|
};
|
|
2989
3108
|
RangePicker.displayName = "RangePicker";
|
|
2990
3109
|
var RangePicker_default = RangePicker;
|
|
2991
3110
|
|
|
2992
3111
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
2993
|
-
import { jsx as
|
|
3112
|
+
import { jsx as jsx317, jsxs as jsxs204 } from "react/jsx-runtime";
|
|
2994
3113
|
var PopupPicker = (props) => {
|
|
2995
3114
|
const { component, type, locale } = props;
|
|
2996
|
-
const [isOpen, setIsOpen] =
|
|
3115
|
+
const [isOpen, setIsOpen] = React14.useState(false);
|
|
2997
3116
|
const handleClick = () => setIsOpen(true);
|
|
2998
3117
|
const handleClose = () => setIsOpen(false);
|
|
2999
3118
|
const handleSingleChange = (date) => {
|
|
@@ -3001,11 +3120,11 @@ var PopupPicker = (props) => {
|
|
|
3001
3120
|
props.onChange?.(date);
|
|
3002
3121
|
handleClose();
|
|
3003
3122
|
};
|
|
3004
|
-
return /* @__PURE__ */
|
|
3005
|
-
|
|
3006
|
-
/* @__PURE__ */
|
|
3007
|
-
/* @__PURE__ */
|
|
3008
|
-
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(
|
|
3009
3128
|
SingleDatePicker_default,
|
|
3010
3129
|
{
|
|
3011
3130
|
value: props.value,
|
|
@@ -3015,7 +3134,7 @@ var PopupPicker = (props) => {
|
|
|
3015
3134
|
locale
|
|
3016
3135
|
}
|
|
3017
3136
|
),
|
|
3018
|
-
type === "range" && /* @__PURE__ */
|
|
3137
|
+
type === "range" && /* @__PURE__ */ jsx317(
|
|
3019
3138
|
RangePicker_default,
|
|
3020
3139
|
{
|
|
3021
3140
|
startDate: props.startDate,
|
|
@@ -3027,8 +3146,8 @@ var PopupPicker = (props) => {
|
|
|
3027
3146
|
}
|
|
3028
3147
|
)
|
|
3029
3148
|
] }),
|
|
3030
|
-
/* @__PURE__ */
|
|
3031
|
-
/* @__PURE__ */
|
|
3149
|
+
/* @__PURE__ */ jsxs204("div", { className: "popup-datepicker-footer", children: [
|
|
3150
|
+
/* @__PURE__ */ jsx317(
|
|
3032
3151
|
Button_default,
|
|
3033
3152
|
{
|
|
3034
3153
|
type: "secondary",
|
|
@@ -3036,7 +3155,7 @@ var PopupPicker = (props) => {
|
|
|
3036
3155
|
children: locale === "ko" ? "\uCDE8\uC18C" : "Cancel"
|
|
3037
3156
|
}
|
|
3038
3157
|
),
|
|
3039
|
-
/* @__PURE__ */
|
|
3158
|
+
/* @__PURE__ */ jsx317(Button_default, { type: "primary", onClick: handleClose, children: locale === "ko" ? "\uC801\uC6A9" : "Apply" })
|
|
3040
3159
|
] })
|
|
3041
3160
|
] }) })
|
|
3042
3161
|
] });
|
|
@@ -3045,10 +3164,10 @@ PopupPicker.displayName = "PopupPicker";
|
|
|
3045
3164
|
var PopupPicker_default = PopupPicker;
|
|
3046
3165
|
|
|
3047
3166
|
// src/components/Divider/Divider.tsx
|
|
3048
|
-
import { jsx as
|
|
3167
|
+
import { jsx as jsx318 } from "react/jsx-runtime";
|
|
3049
3168
|
var Divider = (props) => {
|
|
3050
3169
|
const { orientation = "horizontal" } = props;
|
|
3051
|
-
return /* @__PURE__ */
|
|
3170
|
+
return /* @__PURE__ */ jsx318(
|
|
3052
3171
|
"div",
|
|
3053
3172
|
{
|
|
3054
3173
|
className: clsx_default("lib-xplat-divider", orientation),
|
|
@@ -3061,15 +3180,15 @@ Divider.displayName = "Divider";
|
|
|
3061
3180
|
var Divider_default = Divider;
|
|
3062
3181
|
|
|
3063
3182
|
// src/components/Drawer/Drawer.tsx
|
|
3064
|
-
import
|
|
3183
|
+
import React15 from "react";
|
|
3065
3184
|
import { createPortal as createPortal2 } from "react-dom";
|
|
3066
|
-
import { jsx as
|
|
3185
|
+
import { jsx as jsx319, jsxs as jsxs205 } from "react/jsx-runtime";
|
|
3067
3186
|
var ANIMATION_DURATION_MS2 = 250;
|
|
3068
3187
|
var Drawer = (props) => {
|
|
3069
3188
|
const { isOpen, onClose, placement = "right", width = 320, title, children } = props;
|
|
3070
|
-
const [mounted, setMounted] =
|
|
3071
|
-
const [visible, setVisible] =
|
|
3072
|
-
|
|
3189
|
+
const [mounted, setMounted] = React15.useState(false);
|
|
3190
|
+
const [visible, setVisible] = React15.useState(false);
|
|
3191
|
+
React15.useEffect(() => {
|
|
3073
3192
|
if (isOpen) {
|
|
3074
3193
|
setMounted(true);
|
|
3075
3194
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -3084,12 +3203,12 @@ var Drawer = (props) => {
|
|
|
3084
3203
|
const stateClass = visible ? "enter" : "exit";
|
|
3085
3204
|
const widthValue = typeof width === "number" ? `${width}px` : width;
|
|
3086
3205
|
return createPortal2(
|
|
3087
|
-
/* @__PURE__ */
|
|
3206
|
+
/* @__PURE__ */ jsx319(
|
|
3088
3207
|
"div",
|
|
3089
3208
|
{
|
|
3090
3209
|
className: clsx_default("lib-xplat-drawer-overlay", stateClass),
|
|
3091
3210
|
onClick: onClose,
|
|
3092
|
-
children: /* @__PURE__ */
|
|
3211
|
+
children: /* @__PURE__ */ jsxs205(
|
|
3093
3212
|
"div",
|
|
3094
3213
|
{
|
|
3095
3214
|
className: clsx_default("lib-xplat-drawer", placement, stateClass),
|
|
@@ -3098,11 +3217,11 @@ var Drawer = (props) => {
|
|
|
3098
3217
|
"aria-modal": "true",
|
|
3099
3218
|
onClick: (e) => e.stopPropagation(),
|
|
3100
3219
|
children: [
|
|
3101
|
-
title && /* @__PURE__ */
|
|
3102
|
-
/* @__PURE__ */
|
|
3103
|
-
/* @__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" })
|
|
3104
3223
|
] }),
|
|
3105
|
-
/* @__PURE__ */
|
|
3224
|
+
/* @__PURE__ */ jsx319("div", { className: "drawer-body", children })
|
|
3106
3225
|
]
|
|
3107
3226
|
}
|
|
3108
3227
|
)
|
|
@@ -3115,16 +3234,16 @@ Drawer.displayName = "Drawer";
|
|
|
3115
3234
|
var Drawer_default = Drawer;
|
|
3116
3235
|
|
|
3117
3236
|
// src/components/Dropdown/Dropdown.tsx
|
|
3118
|
-
import
|
|
3237
|
+
import React18 from "react";
|
|
3119
3238
|
|
|
3120
3239
|
// src/tokens/hooks/useAutoPosition.ts
|
|
3121
|
-
import
|
|
3240
|
+
import React16 from "react";
|
|
3122
3241
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
3123
|
-
const [position, setPosition] =
|
|
3242
|
+
const [position, setPosition] = React16.useState({
|
|
3124
3243
|
position: {},
|
|
3125
3244
|
direction: "bottom"
|
|
3126
3245
|
});
|
|
3127
|
-
const calculatePosition =
|
|
3246
|
+
const calculatePosition = React16.useCallback(() => {
|
|
3128
3247
|
if (!triggerRef.current || !popRef.current) return;
|
|
3129
3248
|
const triggerRect = triggerRef.current.getBoundingClientRect();
|
|
3130
3249
|
const popRect = popRef.current.getBoundingClientRect();
|
|
@@ -3146,7 +3265,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
3146
3265
|
direction
|
|
3147
3266
|
});
|
|
3148
3267
|
}, [triggerRef, popRef]);
|
|
3149
|
-
|
|
3268
|
+
React16.useEffect(() => {
|
|
3150
3269
|
calculatePosition();
|
|
3151
3270
|
window.addEventListener("resize", calculatePosition);
|
|
3152
3271
|
return () => window.removeEventListener("resize", calculatePosition);
|
|
@@ -3155,18 +3274,43 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
3155
3274
|
};
|
|
3156
3275
|
var useAutoPosition_default = useAutoPosition;
|
|
3157
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
|
+
|
|
3158
3302
|
// src/components/Dropdown/Dropdown.tsx
|
|
3159
|
-
import { jsx as
|
|
3303
|
+
import { jsx as jsx320, jsxs as jsxs206 } from "react/jsx-runtime";
|
|
3160
3304
|
var Dropdown = (props) => {
|
|
3161
3305
|
const { items, children } = props;
|
|
3162
|
-
const [isOpen, setIsOpen] =
|
|
3163
|
-
const [mounted, setMounted] =
|
|
3164
|
-
const [visible, setVisible] =
|
|
3165
|
-
const triggerRef =
|
|
3166
|
-
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);
|
|
3167
3311
|
const { position, direction } = useAutoPosition_default(triggerRef, menuRef, isOpen);
|
|
3168
3312
|
useClickOutside_default([triggerRef, menuRef], () => setIsOpen(false));
|
|
3169
|
-
|
|
3313
|
+
React18.useEffect(() => {
|
|
3170
3314
|
if (isOpen) {
|
|
3171
3315
|
setMounted(true);
|
|
3172
3316
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -3181,8 +3325,8 @@ var Dropdown = (props) => {
|
|
|
3181
3325
|
item.onClick?.();
|
|
3182
3326
|
setIsOpen(false);
|
|
3183
3327
|
};
|
|
3184
|
-
return /* @__PURE__ */
|
|
3185
|
-
/* @__PURE__ */
|
|
3328
|
+
return /* @__PURE__ */ jsxs206("div", { className: "lib-xplat-dropdown", children: [
|
|
3329
|
+
/* @__PURE__ */ jsx320(
|
|
3186
3330
|
"div",
|
|
3187
3331
|
{
|
|
3188
3332
|
ref: triggerRef,
|
|
@@ -3191,14 +3335,14 @@ var Dropdown = (props) => {
|
|
|
3191
3335
|
children
|
|
3192
3336
|
}
|
|
3193
3337
|
),
|
|
3194
|
-
mounted && /* @__PURE__ */
|
|
3338
|
+
mounted && /* @__PURE__ */ jsx320(
|
|
3195
3339
|
"div",
|
|
3196
3340
|
{
|
|
3197
3341
|
ref: menuRef,
|
|
3198
3342
|
className: clsx_default("dropdown-menu", direction, { visible }),
|
|
3199
3343
|
style: { top: position.top, left: position.left },
|
|
3200
3344
|
role: "menu",
|
|
3201
|
-
children: items.map((item) => /* @__PURE__ */
|
|
3345
|
+
children: items.map((item) => /* @__PURE__ */ jsx320(
|
|
3202
3346
|
"button",
|
|
3203
3347
|
{
|
|
3204
3348
|
className: clsx_default("dropdown-item", {
|
|
@@ -3220,23 +3364,23 @@ Dropdown.displayName = "Dropdown";
|
|
|
3220
3364
|
var Dropdown_default = Dropdown;
|
|
3221
3365
|
|
|
3222
3366
|
// src/components/EmptyState/EmptyState.tsx
|
|
3223
|
-
import { jsx as
|
|
3367
|
+
import { jsx as jsx321, jsxs as jsxs207 } from "react/jsx-runtime";
|
|
3224
3368
|
var EmptyState = (props) => {
|
|
3225
3369
|
const { icon, title = "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4", description, action } = props;
|
|
3226
|
-
return /* @__PURE__ */
|
|
3227
|
-
icon && /* @__PURE__ */
|
|
3228
|
-
!icon && /* @__PURE__ */
|
|
3229
|
-
/* @__PURE__ */
|
|
3230
|
-
description && /* @__PURE__ */
|
|
3231
|
-
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 })
|
|
3232
3376
|
] });
|
|
3233
3377
|
};
|
|
3234
3378
|
EmptyState.displayName = "EmptyState";
|
|
3235
3379
|
var EmptyState_default = EmptyState;
|
|
3236
3380
|
|
|
3237
3381
|
// src/components/FileUpload/FileUpload.tsx
|
|
3238
|
-
import
|
|
3239
|
-
import { jsx as
|
|
3382
|
+
import React19 from "react";
|
|
3383
|
+
import { jsx as jsx322, jsxs as jsxs208 } from "react/jsx-runtime";
|
|
3240
3384
|
var FileUpload = (props) => {
|
|
3241
3385
|
const {
|
|
3242
3386
|
accept,
|
|
@@ -3246,8 +3390,8 @@ var FileUpload = (props) => {
|
|
|
3246
3390
|
label = "\uD30C\uC77C\uC744 \uB4DC\uB798\uADF8\uD558\uAC70\uB098 \uD074\uB9AD\uD558\uC5EC \uC5C5\uB85C\uB4DC",
|
|
3247
3391
|
description
|
|
3248
3392
|
} = props;
|
|
3249
|
-
const [isDragOver, setIsDragOver] =
|
|
3250
|
-
const inputRef =
|
|
3393
|
+
const [isDragOver, setIsDragOver] = React19.useState(false);
|
|
3394
|
+
const inputRef = React19.useRef(null);
|
|
3251
3395
|
const handleFiles = (fileList) => {
|
|
3252
3396
|
let files = Array.from(fileList);
|
|
3253
3397
|
if (maxSize) {
|
|
@@ -3277,7 +3421,7 @@ var FileUpload = (props) => {
|
|
|
3277
3421
|
handleFiles(e.target.files);
|
|
3278
3422
|
}
|
|
3279
3423
|
};
|
|
3280
|
-
return /* @__PURE__ */
|
|
3424
|
+
return /* @__PURE__ */ jsxs208(
|
|
3281
3425
|
"div",
|
|
3282
3426
|
{
|
|
3283
3427
|
className: clsx_default("lib-xplat-file-upload", { "drag-over": isDragOver }),
|
|
@@ -3286,7 +3430,7 @@ var FileUpload = (props) => {
|
|
|
3286
3430
|
onDragLeave: handleDragLeave,
|
|
3287
3431
|
onClick: () => inputRef.current?.click(),
|
|
3288
3432
|
children: [
|
|
3289
|
-
/* @__PURE__ */
|
|
3433
|
+
/* @__PURE__ */ jsx322(
|
|
3290
3434
|
"input",
|
|
3291
3435
|
{
|
|
3292
3436
|
ref: inputRef,
|
|
@@ -3296,9 +3440,9 @@ var FileUpload = (props) => {
|
|
|
3296
3440
|
onChange: handleChange
|
|
3297
3441
|
}
|
|
3298
3442
|
),
|
|
3299
|
-
/* @__PURE__ */
|
|
3300
|
-
/* @__PURE__ */
|
|
3301
|
-
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 })
|
|
3302
3446
|
]
|
|
3303
3447
|
}
|
|
3304
3448
|
);
|
|
@@ -3307,10 +3451,10 @@ FileUpload.displayName = "FileUpload";
|
|
|
3307
3451
|
var FileUpload_default = FileUpload;
|
|
3308
3452
|
|
|
3309
3453
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
3310
|
-
import
|
|
3454
|
+
import React21 from "react";
|
|
3311
3455
|
|
|
3312
3456
|
// src/components/HtmlTypeWriter/utils.ts
|
|
3313
|
-
import
|
|
3457
|
+
import React20 from "react";
|
|
3314
3458
|
var voidTags = /* @__PURE__ */ new Set([
|
|
3315
3459
|
"br",
|
|
3316
3460
|
"img",
|
|
@@ -3378,41 +3522,41 @@ var convertNodeToReactWithRange = (node, typedLen, rangeMap) => {
|
|
|
3378
3522
|
props[attr.name] = attr.value;
|
|
3379
3523
|
});
|
|
3380
3524
|
if (voidTags.has(tag)) {
|
|
3381
|
-
return
|
|
3525
|
+
return React20.createElement(tag, props);
|
|
3382
3526
|
}
|
|
3383
3527
|
const children = Array.from(element.childNodes).map((child) => convertNodeToReactWithRange(child, typedLen, rangeMap)).filter((n) => n != null);
|
|
3384
|
-
return
|
|
3528
|
+
return React20.createElement(tag, props, ...children);
|
|
3385
3529
|
};
|
|
3386
3530
|
var htmlToReactProgressive = (root, typedLen, rangeMap) => {
|
|
3387
3531
|
const nodes = Array.from(root.childNodes).map((child, idx) => {
|
|
3388
3532
|
const node = convertNodeToReactWithRange(child, typedLen, rangeMap);
|
|
3389
|
-
return node == null ? null :
|
|
3533
|
+
return node == null ? null : React20.createElement(React20.Fragment, { key: idx }, node);
|
|
3390
3534
|
}).filter(Boolean);
|
|
3391
3535
|
return nodes.length === 0 ? null : nodes;
|
|
3392
3536
|
};
|
|
3393
3537
|
|
|
3394
3538
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
3395
|
-
import { jsx as
|
|
3539
|
+
import { jsx as jsx323 } from "react/jsx-runtime";
|
|
3396
3540
|
var HtmlTypeWriter = ({
|
|
3397
3541
|
html,
|
|
3398
3542
|
duration = 20,
|
|
3399
3543
|
onDone,
|
|
3400
3544
|
onChange
|
|
3401
3545
|
}) => {
|
|
3402
|
-
const [typedLen, setTypedLen] =
|
|
3403
|
-
const doneCalledRef =
|
|
3404
|
-
const { doc, rangeMap, totalLength } =
|
|
3546
|
+
const [typedLen, setTypedLen] = React21.useState(0);
|
|
3547
|
+
const doneCalledRef = React21.useRef(false);
|
|
3548
|
+
const { doc, rangeMap, totalLength } = React21.useMemo(() => {
|
|
3405
3549
|
if (typeof window === "undefined") return { doc: null, rangeMap: /* @__PURE__ */ new Map(), totalLength: 0 };
|
|
3406
3550
|
const decoded = decodeHtmlEntities(html);
|
|
3407
3551
|
const doc2 = new DOMParser().parseFromString(decoded, "text/html");
|
|
3408
3552
|
const { rangeMap: rangeMap2, totalLength: totalLength2 } = buildRangeMap(doc2.body);
|
|
3409
3553
|
return { doc: doc2, rangeMap: rangeMap2, totalLength: totalLength2 };
|
|
3410
3554
|
}, [html]);
|
|
3411
|
-
|
|
3555
|
+
React21.useEffect(() => {
|
|
3412
3556
|
setTypedLen(0);
|
|
3413
3557
|
doneCalledRef.current = false;
|
|
3414
3558
|
}, [html]);
|
|
3415
|
-
|
|
3559
|
+
React21.useEffect(() => {
|
|
3416
3560
|
if (!totalLength) return;
|
|
3417
3561
|
if (typedLen >= totalLength) return;
|
|
3418
3562
|
const timer = window.setInterval(() => {
|
|
@@ -3420,33 +3564,33 @@ var HtmlTypeWriter = ({
|
|
|
3420
3564
|
}, duration);
|
|
3421
3565
|
return () => window.clearInterval(timer);
|
|
3422
3566
|
}, [typedLen, totalLength, duration]);
|
|
3423
|
-
|
|
3567
|
+
React21.useEffect(() => {
|
|
3424
3568
|
if (typedLen > 0 && typedLen < totalLength) {
|
|
3425
3569
|
onChange?.();
|
|
3426
3570
|
}
|
|
3427
3571
|
}, [typedLen, totalLength, onChange]);
|
|
3428
|
-
|
|
3572
|
+
React21.useEffect(() => {
|
|
3429
3573
|
if (typedLen === totalLength && totalLength > 0 && !doneCalledRef.current) {
|
|
3430
3574
|
doneCalledRef.current = true;
|
|
3431
3575
|
onDone?.();
|
|
3432
3576
|
}
|
|
3433
3577
|
}, [typedLen, totalLength, onDone]);
|
|
3434
|
-
const parsed =
|
|
3578
|
+
const parsed = React21.useMemo(
|
|
3435
3579
|
() => doc ? htmlToReactProgressive(doc.body, typedLen, rangeMap) : null,
|
|
3436
3580
|
[doc, typedLen, rangeMap]
|
|
3437
3581
|
);
|
|
3438
|
-
return /* @__PURE__ */
|
|
3582
|
+
return /* @__PURE__ */ jsx323("div", { className: "lib-xplat-htmlTypewriter", children: parsed });
|
|
3439
3583
|
};
|
|
3440
3584
|
HtmlTypeWriter.displayName = "HtmlTypeWriter";
|
|
3441
3585
|
var HtmlTypeWriter_default = HtmlTypeWriter;
|
|
3442
3586
|
|
|
3443
3587
|
// src/components/ImageSelector/ImageSelector.tsx
|
|
3444
|
-
import
|
|
3445
|
-
import { jsx as
|
|
3588
|
+
import React22 from "react";
|
|
3589
|
+
import { jsx as jsx324, jsxs as jsxs209 } from "react/jsx-runtime";
|
|
3446
3590
|
var ImageSelector = (props) => {
|
|
3447
3591
|
const { value, label, onChange } = props;
|
|
3448
|
-
const [previewUrl, setPreviewUrl] =
|
|
3449
|
-
|
|
3592
|
+
const [previewUrl, setPreviewUrl] = React22.useState();
|
|
3593
|
+
React22.useEffect(() => {
|
|
3450
3594
|
if (!value) {
|
|
3451
3595
|
setPreviewUrl(void 0);
|
|
3452
3596
|
return;
|
|
@@ -3455,7 +3599,7 @@ var ImageSelector = (props) => {
|
|
|
3455
3599
|
setPreviewUrl(url);
|
|
3456
3600
|
return () => URL.revokeObjectURL(url);
|
|
3457
3601
|
}, [value]);
|
|
3458
|
-
const inputRef =
|
|
3602
|
+
const inputRef = React22.useRef(null);
|
|
3459
3603
|
const handleFileChange = (e) => {
|
|
3460
3604
|
const selectedFile = e.target.files?.[0];
|
|
3461
3605
|
if (selectedFile) {
|
|
@@ -3468,8 +3612,8 @@ var ImageSelector = (props) => {
|
|
|
3468
3612
|
const handleOpenFileDialog = () => {
|
|
3469
3613
|
inputRef.current?.click();
|
|
3470
3614
|
};
|
|
3471
|
-
return /* @__PURE__ */
|
|
3472
|
-
/* @__PURE__ */
|
|
3615
|
+
return /* @__PURE__ */ jsxs209("div", { className: `lib-xplat-imageselector${value ? "" : " none-value"}`, children: [
|
|
3616
|
+
/* @__PURE__ */ jsx324(
|
|
3473
3617
|
"input",
|
|
3474
3618
|
{
|
|
3475
3619
|
type: "file",
|
|
@@ -3479,13 +3623,13 @@ var ImageSelector = (props) => {
|
|
|
3479
3623
|
ref: inputRef
|
|
3480
3624
|
}
|
|
3481
3625
|
),
|
|
3482
|
-
value && /* @__PURE__ */
|
|
3483
|
-
/* @__PURE__ */
|
|
3484
|
-
/* @__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, {}) })
|
|
3485
3629
|
] }),
|
|
3486
|
-
/* @__PURE__ */
|
|
3487
|
-
/* @__PURE__ */
|
|
3488
|
-
/* @__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" })
|
|
3489
3633
|
] }) })
|
|
3490
3634
|
] });
|
|
3491
3635
|
};
|
|
@@ -3493,7 +3637,7 @@ ImageSelector.displayName = "ImageSelector";
|
|
|
3493
3637
|
var ImageSelector_default = ImageSelector;
|
|
3494
3638
|
|
|
3495
3639
|
// src/components/Pagination/Pagination.tsx
|
|
3496
|
-
import { jsx as
|
|
3640
|
+
import { jsx as jsx325, jsxs as jsxs210 } from "react/jsx-runtime";
|
|
3497
3641
|
var getPageRange = (current, totalPages, siblingCount) => {
|
|
3498
3642
|
const totalNumbers = siblingCount * 2 + 5;
|
|
3499
3643
|
if (totalPages <= totalNumbers) {
|
|
@@ -3536,19 +3680,19 @@ var Pagination = (props) => {
|
|
|
3536
3680
|
onChange?.(page);
|
|
3537
3681
|
}
|
|
3538
3682
|
};
|
|
3539
|
-
return /* @__PURE__ */
|
|
3540
|
-
/* @__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(
|
|
3541
3685
|
"button",
|
|
3542
3686
|
{
|
|
3543
3687
|
className: "page-btn prev",
|
|
3544
3688
|
disabled: current <= 1,
|
|
3545
3689
|
onClick: () => handleClick(current - 1),
|
|
3546
3690
|
"aria-label": "\uC774\uC804 \uD398\uC774\uC9C0",
|
|
3547
|
-
children: /* @__PURE__ */
|
|
3691
|
+
children: /* @__PURE__ */ jsx325(ChevronLeftIcon_default, {})
|
|
3548
3692
|
}
|
|
3549
3693
|
),
|
|
3550
3694
|
pages.map(
|
|
3551
|
-
(page, i) => page === "..." ? /* @__PURE__ */
|
|
3695
|
+
(page, i) => page === "..." ? /* @__PURE__ */ jsx325("span", { className: "dots", children: "..." }, `dots-${i}`) : /* @__PURE__ */ jsx325(
|
|
3552
3696
|
"button",
|
|
3553
3697
|
{
|
|
3554
3698
|
className: clsx_default("page-btn", { active: page === current }),
|
|
@@ -3559,14 +3703,14 @@ var Pagination = (props) => {
|
|
|
3559
3703
|
page
|
|
3560
3704
|
)
|
|
3561
3705
|
),
|
|
3562
|
-
/* @__PURE__ */
|
|
3706
|
+
/* @__PURE__ */ jsx325(
|
|
3563
3707
|
"button",
|
|
3564
3708
|
{
|
|
3565
3709
|
className: "page-btn next",
|
|
3566
3710
|
disabled: current >= totalPages,
|
|
3567
3711
|
onClick: () => handleClick(current + 1),
|
|
3568
3712
|
"aria-label": "\uB2E4\uC74C \uD398\uC774\uC9C0",
|
|
3569
|
-
children: /* @__PURE__ */
|
|
3713
|
+
children: /* @__PURE__ */ jsx325(ChevronRightIcon_default, {})
|
|
3570
3714
|
}
|
|
3571
3715
|
)
|
|
3572
3716
|
] });
|
|
@@ -3575,17 +3719,17 @@ Pagination.displayName = "Pagination";
|
|
|
3575
3719
|
var Pagination_default = Pagination;
|
|
3576
3720
|
|
|
3577
3721
|
// src/components/PopOver/PopOver.tsx
|
|
3578
|
-
import
|
|
3579
|
-
import { jsx as
|
|
3722
|
+
import React23 from "react";
|
|
3723
|
+
import { jsx as jsx326, jsxs as jsxs211 } from "react/jsx-runtime";
|
|
3580
3724
|
var PopOver = (props) => {
|
|
3581
3725
|
const { children, isOpen, onClose, PopOverEl } = props;
|
|
3582
|
-
const popRef =
|
|
3583
|
-
const triggerRef =
|
|
3584
|
-
const [localOpen, setLocalOpen] =
|
|
3585
|
-
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);
|
|
3586
3730
|
useClickOutside_default([popRef, triggerRef], onClose, isOpen);
|
|
3587
3731
|
const position = useAutoPosition_default(triggerRef, popRef, localOpen);
|
|
3588
|
-
|
|
3732
|
+
React23.useEffect(() => {
|
|
3589
3733
|
if (isOpen) {
|
|
3590
3734
|
setLocalOpen(isOpen);
|
|
3591
3735
|
setTimeout(() => {
|
|
@@ -3598,7 +3742,7 @@ var PopOver = (props) => {
|
|
|
3598
3742
|
}, 200);
|
|
3599
3743
|
}
|
|
3600
3744
|
}, [isOpen]);
|
|
3601
|
-
return /* @__PURE__ */
|
|
3745
|
+
return /* @__PURE__ */ jsxs211(
|
|
3602
3746
|
"div",
|
|
3603
3747
|
{
|
|
3604
3748
|
className: "lib-xplat-pop-over",
|
|
@@ -3608,7 +3752,7 @@ var PopOver = (props) => {
|
|
|
3608
3752
|
},
|
|
3609
3753
|
children: [
|
|
3610
3754
|
children,
|
|
3611
|
-
localOpen && /* @__PURE__ */
|
|
3755
|
+
localOpen && /* @__PURE__ */ jsx326(
|
|
3612
3756
|
"div",
|
|
3613
3757
|
{
|
|
3614
3758
|
className: clsx_default(
|
|
@@ -3631,7 +3775,7 @@ PopOver.displayName = "PopOver";
|
|
|
3631
3775
|
var PopOver_default = PopOver;
|
|
3632
3776
|
|
|
3633
3777
|
// src/components/Progress/Progress.tsx
|
|
3634
|
-
import { jsx as
|
|
3778
|
+
import { jsx as jsx327, jsxs as jsxs212 } from "react/jsx-runtime";
|
|
3635
3779
|
var Progress = (props) => {
|
|
3636
3780
|
const {
|
|
3637
3781
|
value,
|
|
@@ -3641,8 +3785,8 @@ var Progress = (props) => {
|
|
|
3641
3785
|
showLabel = false
|
|
3642
3786
|
} = props;
|
|
3643
3787
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
3644
|
-
return /* @__PURE__ */
|
|
3645
|
-
/* @__PURE__ */
|
|
3788
|
+
return /* @__PURE__ */ jsxs212("div", { className: clsx_default("lib-xplat-progress", size, type), children: [
|
|
3789
|
+
/* @__PURE__ */ jsx327(
|
|
3646
3790
|
"div",
|
|
3647
3791
|
{
|
|
3648
3792
|
className: "track",
|
|
@@ -3650,7 +3794,7 @@ var Progress = (props) => {
|
|
|
3650
3794
|
"aria-valuenow": value,
|
|
3651
3795
|
"aria-valuemin": 0,
|
|
3652
3796
|
"aria-valuemax": max,
|
|
3653
|
-
children: /* @__PURE__ */
|
|
3797
|
+
children: /* @__PURE__ */ jsx327(
|
|
3654
3798
|
"div",
|
|
3655
3799
|
{
|
|
3656
3800
|
className: "bar",
|
|
@@ -3659,7 +3803,7 @@ var Progress = (props) => {
|
|
|
3659
3803
|
)
|
|
3660
3804
|
}
|
|
3661
3805
|
),
|
|
3662
|
-
showLabel && /* @__PURE__ */
|
|
3806
|
+
showLabel && /* @__PURE__ */ jsxs212("span", { className: "label", children: [
|
|
3663
3807
|
Math.round(percentage),
|
|
3664
3808
|
"%"
|
|
3665
3809
|
] })
|
|
@@ -3669,17 +3813,17 @@ Progress.displayName = "Progress";
|
|
|
3669
3813
|
var Progress_default = Progress;
|
|
3670
3814
|
|
|
3671
3815
|
// src/components/Radio/RadioGroupContext.tsx
|
|
3672
|
-
import
|
|
3673
|
-
var RadioGroupContext =
|
|
3816
|
+
import React24 from "react";
|
|
3817
|
+
var RadioGroupContext = React24.createContext(
|
|
3674
3818
|
null
|
|
3675
3819
|
);
|
|
3676
3820
|
var useRadioGroupContext = () => {
|
|
3677
|
-
return
|
|
3821
|
+
return React24.useContext(RadioGroupContext);
|
|
3678
3822
|
};
|
|
3679
3823
|
var RadioGroupContext_default = RadioGroupContext;
|
|
3680
3824
|
|
|
3681
3825
|
// src/components/Radio/Radio.tsx
|
|
3682
|
-
import { jsx as
|
|
3826
|
+
import { jsx as jsx328, jsxs as jsxs213 } from "react/jsx-runtime";
|
|
3683
3827
|
var Radio = (props) => {
|
|
3684
3828
|
const {
|
|
3685
3829
|
label,
|
|
@@ -3697,7 +3841,7 @@ var Radio = (props) => {
|
|
|
3697
3841
|
value,
|
|
3698
3842
|
onChange: rest.onChange
|
|
3699
3843
|
};
|
|
3700
|
-
return /* @__PURE__ */
|
|
3844
|
+
return /* @__PURE__ */ jsxs213(
|
|
3701
3845
|
"label",
|
|
3702
3846
|
{
|
|
3703
3847
|
className: clsx_default(
|
|
@@ -3707,18 +3851,18 @@ var Radio = (props) => {
|
|
|
3707
3851
|
localChecked ? "checked" : void 0
|
|
3708
3852
|
),
|
|
3709
3853
|
children: [
|
|
3710
|
-
/* @__PURE__ */
|
|
3711
|
-
/* @__PURE__ */
|
|
3854
|
+
/* @__PURE__ */ jsx328("input", { ...rest, ...inputProps, checked: localChecked, type: "radio" }),
|
|
3855
|
+
/* @__PURE__ */ jsx328(
|
|
3712
3856
|
"div",
|
|
3713
3857
|
{
|
|
3714
3858
|
className: clsx_default(
|
|
3715
3859
|
"circle",
|
|
3716
3860
|
localChecked ? "checked" : void 0
|
|
3717
3861
|
),
|
|
3718
|
-
children: localChecked && /* @__PURE__ */
|
|
3862
|
+
children: localChecked && /* @__PURE__ */ jsx328("div", { className: "inner-circle" })
|
|
3719
3863
|
}
|
|
3720
3864
|
),
|
|
3721
|
-
label && /* @__PURE__ */
|
|
3865
|
+
label && /* @__PURE__ */ jsx328("span", { children: label })
|
|
3722
3866
|
]
|
|
3723
3867
|
}
|
|
3724
3868
|
);
|
|
@@ -3727,28 +3871,28 @@ Radio.displayName = "Radio";
|
|
|
3727
3871
|
var Radio_default = Radio;
|
|
3728
3872
|
|
|
3729
3873
|
// src/components/Radio/RadioGroup.tsx
|
|
3730
|
-
import { Fragment as Fragment3, jsx as
|
|
3874
|
+
import { Fragment as Fragment3, jsx as jsx329 } from "react/jsx-runtime";
|
|
3731
3875
|
var RadioGroup = (props) => {
|
|
3732
3876
|
const { children, ...rest } = props;
|
|
3733
|
-
return /* @__PURE__ */
|
|
3877
|
+
return /* @__PURE__ */ jsx329(Fragment3, { children: /* @__PURE__ */ jsx329(RadioGroupContext_default.Provider, { value: rest, children }) });
|
|
3734
3878
|
};
|
|
3735
3879
|
RadioGroup.displayName = "RadioGroup";
|
|
3736
3880
|
var RadioGroup_default = RadioGroup;
|
|
3737
3881
|
|
|
3738
3882
|
// src/components/Select/Select.tsx
|
|
3739
|
-
import
|
|
3883
|
+
import React27 from "react";
|
|
3740
3884
|
|
|
3741
3885
|
// src/components/Select/context.ts
|
|
3742
|
-
import
|
|
3743
|
-
var SelectContext =
|
|
3886
|
+
import React25 from "react";
|
|
3887
|
+
var SelectContext = React25.createContext(null);
|
|
3744
3888
|
var context_default = SelectContext;
|
|
3745
3889
|
|
|
3746
3890
|
// src/components/Select/SelectItem.tsx
|
|
3747
|
-
import
|
|
3748
|
-
import { jsx as
|
|
3891
|
+
import React26 from "react";
|
|
3892
|
+
import { jsx as jsx330 } from "react/jsx-runtime";
|
|
3749
3893
|
var SelectItem = (props) => {
|
|
3750
3894
|
const { children, value, onClick, disabled = false } = props;
|
|
3751
|
-
const ctx =
|
|
3895
|
+
const ctx = React26.useContext(context_default);
|
|
3752
3896
|
const handleClick = (e) => {
|
|
3753
3897
|
e.preventDefault();
|
|
3754
3898
|
e.stopPropagation();
|
|
@@ -3757,7 +3901,7 @@ var SelectItem = (props) => {
|
|
|
3757
3901
|
ctx?.close();
|
|
3758
3902
|
onClick?.();
|
|
3759
3903
|
};
|
|
3760
|
-
return /* @__PURE__ */
|
|
3904
|
+
return /* @__PURE__ */ jsx330(
|
|
3761
3905
|
"div",
|
|
3762
3906
|
{
|
|
3763
3907
|
className: clsx_default("select-item", disabled && "disabled"),
|
|
@@ -3778,7 +3922,7 @@ SelectItem.displayName = "Select.Item";
|
|
|
3778
3922
|
var SelectItem_default = SelectItem;
|
|
3779
3923
|
|
|
3780
3924
|
// src/components/Select/Select.tsx
|
|
3781
|
-
import { jsx as
|
|
3925
|
+
import { jsx as jsx331, jsxs as jsxs214 } from "react/jsx-runtime";
|
|
3782
3926
|
var ANIMATION_DURATION_MS3 = 200;
|
|
3783
3927
|
var SelectRoot = (props) => {
|
|
3784
3928
|
const {
|
|
@@ -3790,26 +3934,26 @@ var SelectRoot = (props) => {
|
|
|
3790
3934
|
error = false,
|
|
3791
3935
|
size = "md"
|
|
3792
3936
|
} = props;
|
|
3793
|
-
const itemChildren =
|
|
3794
|
-
(child) =>
|
|
3937
|
+
const itemChildren = React27.Children.toArray(children).filter(
|
|
3938
|
+
(child) => React27.isValidElement(child) && child.type === SelectItem_default
|
|
3795
3939
|
);
|
|
3796
3940
|
const isControlled = valueProp !== void 0;
|
|
3797
|
-
const [isOpen, setOpen] =
|
|
3798
|
-
const [uncontrolledLabel, setUncontrolledLabel] =
|
|
3799
|
-
const controlledLabel =
|
|
3941
|
+
const [isOpen, setOpen] = React27.useState(false);
|
|
3942
|
+
const [uncontrolledLabel, setUncontrolledLabel] = React27.useState(null);
|
|
3943
|
+
const controlledLabel = React27.useMemo(() => {
|
|
3800
3944
|
if (!isControlled) return null;
|
|
3801
3945
|
const match = itemChildren.find((child) => child.props.value === valueProp);
|
|
3802
3946
|
return match ? match.props.children : null;
|
|
3803
3947
|
}, [isControlled, valueProp, itemChildren]);
|
|
3804
3948
|
const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
|
|
3805
|
-
const triggerRef =
|
|
3806
|
-
const contentRef =
|
|
3807
|
-
const [mounted, setMounted] =
|
|
3808
|
-
const [visible, setVisible] =
|
|
3809
|
-
|
|
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(() => {
|
|
3810
3954
|
if (disabled && isOpen) setOpen(false);
|
|
3811
3955
|
}, [disabled, isOpen]);
|
|
3812
|
-
|
|
3956
|
+
React27.useEffect(() => {
|
|
3813
3957
|
if (isOpen) {
|
|
3814
3958
|
setMounted(true);
|
|
3815
3959
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -3819,12 +3963,12 @@ var SelectRoot = (props) => {
|
|
|
3819
3963
|
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS3);
|
|
3820
3964
|
return () => clearTimeout(t);
|
|
3821
3965
|
}, [isOpen]);
|
|
3822
|
-
const open =
|
|
3823
|
-
const close =
|
|
3824
|
-
const toggle =
|
|
3966
|
+
const open = React27.useCallback(() => setOpen(true), []);
|
|
3967
|
+
const close = React27.useCallback(() => setOpen(false), []);
|
|
3968
|
+
const toggle = React27.useCallback(() => setOpen((prev) => !prev), []);
|
|
3825
3969
|
useClickOutside_default([contentRef, triggerRef], close, isOpen);
|
|
3826
3970
|
const position = useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
3827
|
-
const setSelected =
|
|
3971
|
+
const setSelected = React27.useCallback(
|
|
3828
3972
|
(label, itemValue) => {
|
|
3829
3973
|
if (!isControlled) {
|
|
3830
3974
|
setUncontrolledLabel(label);
|
|
@@ -3833,7 +3977,7 @@ var SelectRoot = (props) => {
|
|
|
3833
3977
|
},
|
|
3834
3978
|
[isControlled, onChange]
|
|
3835
3979
|
);
|
|
3836
|
-
const ctxValue =
|
|
3980
|
+
const ctxValue = React27.useMemo(
|
|
3837
3981
|
() => ({
|
|
3838
3982
|
isOpen,
|
|
3839
3983
|
mounted,
|
|
@@ -3854,7 +3998,7 @@ var SelectRoot = (props) => {
|
|
|
3854
3998
|
if (disabled) return;
|
|
3855
3999
|
toggle();
|
|
3856
4000
|
};
|
|
3857
|
-
return /* @__PURE__ */
|
|
4001
|
+
return /* @__PURE__ */ jsx331(context_default.Provider, { value: ctxValue, children: /* @__PURE__ */ jsxs214(
|
|
3858
4002
|
"div",
|
|
3859
4003
|
{
|
|
3860
4004
|
className: clsx_default(
|
|
@@ -3865,7 +4009,7 @@ var SelectRoot = (props) => {
|
|
|
3865
4009
|
mounted && "is-open"
|
|
3866
4010
|
),
|
|
3867
4011
|
children: [
|
|
3868
|
-
/* @__PURE__ */
|
|
4012
|
+
/* @__PURE__ */ jsxs214(
|
|
3869
4013
|
"div",
|
|
3870
4014
|
{
|
|
3871
4015
|
ref: triggerRef,
|
|
@@ -3889,7 +4033,7 @@ var SelectRoot = (props) => {
|
|
|
3889
4033
|
}
|
|
3890
4034
|
},
|
|
3891
4035
|
children: [
|
|
3892
|
-
/* @__PURE__ */
|
|
4036
|
+
/* @__PURE__ */ jsx331(
|
|
3893
4037
|
"span",
|
|
3894
4038
|
{
|
|
3895
4039
|
className: clsx_default(
|
|
@@ -3899,18 +4043,18 @@ var SelectRoot = (props) => {
|
|
|
3899
4043
|
children: selectedLabel ?? placeholder
|
|
3900
4044
|
}
|
|
3901
4045
|
),
|
|
3902
|
-
/* @__PURE__ */
|
|
4046
|
+
/* @__PURE__ */ jsx331(
|
|
3903
4047
|
"span",
|
|
3904
4048
|
{
|
|
3905
4049
|
className: clsx_default("select-trigger-icon", isOpen && "open"),
|
|
3906
4050
|
"aria-hidden": true,
|
|
3907
|
-
children: /* @__PURE__ */
|
|
4051
|
+
children: /* @__PURE__ */ jsx331(ChevronDownIcon_default, {})
|
|
3908
4052
|
}
|
|
3909
4053
|
)
|
|
3910
4054
|
]
|
|
3911
4055
|
}
|
|
3912
4056
|
),
|
|
3913
|
-
mounted && /* @__PURE__ */
|
|
4057
|
+
mounted && /* @__PURE__ */ jsx331(
|
|
3914
4058
|
"div",
|
|
3915
4059
|
{
|
|
3916
4060
|
className: clsx_default("select-content", position.direction, stateClass),
|
|
@@ -3931,14 +4075,14 @@ var Select = Object.assign(SelectRoot, {
|
|
|
3931
4075
|
var Select_default = Select;
|
|
3932
4076
|
|
|
3933
4077
|
// src/components/Skeleton/Skeleton.tsx
|
|
3934
|
-
import { jsx as
|
|
4078
|
+
import { jsx as jsx332 } from "react/jsx-runtime";
|
|
3935
4079
|
var Skeleton = (props) => {
|
|
3936
4080
|
const { variant = "text", width, height } = props;
|
|
3937
4081
|
const style = {
|
|
3938
4082
|
width: typeof width === "number" ? `${width}px` : width,
|
|
3939
4083
|
height: typeof height === "number" ? `${height}px` : height
|
|
3940
4084
|
};
|
|
3941
|
-
return /* @__PURE__ */
|
|
4085
|
+
return /* @__PURE__ */ jsx332(
|
|
3942
4086
|
"div",
|
|
3943
4087
|
{
|
|
3944
4088
|
className: clsx_default("lib-xplat-skeleton", variant),
|
|
@@ -3951,20 +4095,20 @@ Skeleton.displayName = "Skeleton";
|
|
|
3951
4095
|
var Skeleton_default = Skeleton;
|
|
3952
4096
|
|
|
3953
4097
|
// src/components/Spinner/Spinner.tsx
|
|
3954
|
-
import { jsx as
|
|
4098
|
+
import { jsx as jsx333, jsxs as jsxs215 } from "react/jsx-runtime";
|
|
3955
4099
|
var Spinner = (props) => {
|
|
3956
4100
|
const {
|
|
3957
4101
|
size = "md",
|
|
3958
4102
|
type = "brand"
|
|
3959
4103
|
} = props;
|
|
3960
|
-
return /* @__PURE__ */
|
|
4104
|
+
return /* @__PURE__ */ jsx333(
|
|
3961
4105
|
"div",
|
|
3962
4106
|
{
|
|
3963
4107
|
className: clsx_default("lib-xplat-spinner", size, type),
|
|
3964
4108
|
role: "status",
|
|
3965
4109
|
"aria-label": "\uB85C\uB529 \uC911",
|
|
3966
|
-
children: /* @__PURE__ */
|
|
3967
|
-
/* @__PURE__ */
|
|
4110
|
+
children: /* @__PURE__ */ jsxs215("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
4111
|
+
/* @__PURE__ */ jsx333(
|
|
3968
4112
|
"circle",
|
|
3969
4113
|
{
|
|
3970
4114
|
className: "track",
|
|
@@ -3974,7 +4118,7 @@ var Spinner = (props) => {
|
|
|
3974
4118
|
strokeWidth: "3"
|
|
3975
4119
|
}
|
|
3976
4120
|
),
|
|
3977
|
-
/* @__PURE__ */
|
|
4121
|
+
/* @__PURE__ */ jsx333(
|
|
3978
4122
|
"circle",
|
|
3979
4123
|
{
|
|
3980
4124
|
className: "indicator",
|
|
@@ -3993,20 +4137,20 @@ Spinner.displayName = "Spinner";
|
|
|
3993
4137
|
var Spinner_default = Spinner;
|
|
3994
4138
|
|
|
3995
4139
|
// src/components/Steps/Steps.tsx
|
|
3996
|
-
import { jsx as
|
|
4140
|
+
import { jsx as jsx334, jsxs as jsxs216 } from "react/jsx-runtime";
|
|
3997
4141
|
var Steps = (props) => {
|
|
3998
4142
|
const {
|
|
3999
4143
|
items,
|
|
4000
4144
|
current,
|
|
4001
4145
|
type = "brand"
|
|
4002
4146
|
} = props;
|
|
4003
|
-
return /* @__PURE__ */
|
|
4147
|
+
return /* @__PURE__ */ jsx334("div", { className: clsx_default("lib-xplat-steps", type), children: items.map((item, index) => {
|
|
4004
4148
|
const status = index < current ? "completed" : index === current ? "active" : "pending";
|
|
4005
|
-
return /* @__PURE__ */
|
|
4006
|
-
/* @__PURE__ */
|
|
4007
|
-
/* @__PURE__ */
|
|
4008
|
-
/* @__PURE__ */
|
|
4009
|
-
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 })
|
|
4010
4154
|
] })
|
|
4011
4155
|
] }, index);
|
|
4012
4156
|
}) });
|
|
@@ -4015,8 +4159,8 @@ Steps.displayName = "Steps";
|
|
|
4015
4159
|
var Steps_default = Steps;
|
|
4016
4160
|
|
|
4017
4161
|
// src/components/Swiper/Swiper.tsx
|
|
4018
|
-
import
|
|
4019
|
-
import { jsx as
|
|
4162
|
+
import React28 from "react";
|
|
4163
|
+
import { jsx as jsx335, jsxs as jsxs217 } from "react/jsx-runtime";
|
|
4020
4164
|
var Swiper = (props) => {
|
|
4021
4165
|
const {
|
|
4022
4166
|
auto = false,
|
|
@@ -4039,23 +4183,23 @@ var Swiper = (props) => {
|
|
|
4039
4183
|
const maxIndex = Math.max(0, totalSlides - viewItemCount);
|
|
4040
4184
|
const useLoop = loop && canSlide;
|
|
4041
4185
|
const cloneCount = useLoop ? totalSlides : 0;
|
|
4042
|
-
const extendedItems =
|
|
4186
|
+
const extendedItems = React28.useMemo(() => {
|
|
4043
4187
|
if (!useLoop) return items;
|
|
4044
4188
|
return [...items, ...items, ...items];
|
|
4045
4189
|
}, [items, useLoop]);
|
|
4046
4190
|
const initialIdx = Math.max(0, Math.min(indexProp ?? 0, maxIndex));
|
|
4047
|
-
const [innerIndex, setInnerIndex] =
|
|
4191
|
+
const [innerIndex, setInnerIndex] = React28.useState(
|
|
4048
4192
|
useLoop ? cloneCount + initialIdx : initialIdx
|
|
4049
4193
|
);
|
|
4050
|
-
const [isDragging, setIsDragging] =
|
|
4051
|
-
const [dragOffset, setDragOffset] =
|
|
4052
|
-
const [animated, setAnimated] =
|
|
4053
|
-
const [containerWidth, setContainerWidth] =
|
|
4054
|
-
const containerRef =
|
|
4055
|
-
const startXRef =
|
|
4056
|
-
const startTimeRef =
|
|
4057
|
-
const autoplayTimerRef =
|
|
4058
|
-
|
|
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(() => {
|
|
4059
4203
|
const el = containerRef.current;
|
|
4060
4204
|
if (!el) return;
|
|
4061
4205
|
const ro = new ResizeObserver((entries) => {
|
|
@@ -4074,7 +4218,7 @@ var Swiper = (props) => {
|
|
|
4074
4218
|
return ((inner - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
4075
4219
|
};
|
|
4076
4220
|
const realIndex = getRealIndex(innerIndex);
|
|
4077
|
-
const moveToInner =
|
|
4221
|
+
const moveToInner = React28.useCallback(
|
|
4078
4222
|
(idx, withAnim = true) => {
|
|
4079
4223
|
if (!useLoop) {
|
|
4080
4224
|
setAnimated(withAnim);
|
|
@@ -4102,7 +4246,7 @@ var Swiper = (props) => {
|
|
|
4102
4246
|
},
|
|
4103
4247
|
[useLoop, cloneCount, totalSlides]
|
|
4104
4248
|
);
|
|
4105
|
-
const handleTransitionEnd =
|
|
4249
|
+
const handleTransitionEnd = React28.useCallback(() => {
|
|
4106
4250
|
if (!useLoop) return;
|
|
4107
4251
|
const real = getRealIndex(innerIndex);
|
|
4108
4252
|
const canonical = cloneCount + real;
|
|
@@ -4112,7 +4256,7 @@ var Swiper = (props) => {
|
|
|
4112
4256
|
}
|
|
4113
4257
|
onChange?.(Math.min(real, maxIndex));
|
|
4114
4258
|
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange]);
|
|
4115
|
-
const slideTo =
|
|
4259
|
+
const slideTo = React28.useCallback(
|
|
4116
4260
|
(logicalIndex) => {
|
|
4117
4261
|
if (!canSlide) return;
|
|
4118
4262
|
const clamped = useLoop ? logicalIndex : Math.max(0, Math.min(logicalIndex, maxIndex));
|
|
@@ -4122,7 +4266,7 @@ var Swiper = (props) => {
|
|
|
4122
4266
|
},
|
|
4123
4267
|
[canSlide, useLoop, cloneCount, maxIndex, onChange, moveToInner]
|
|
4124
4268
|
);
|
|
4125
|
-
const slideNext =
|
|
4269
|
+
const slideNext = React28.useCallback(() => {
|
|
4126
4270
|
if (!canSlide) return;
|
|
4127
4271
|
const nextInner = innerIndex + slideBy;
|
|
4128
4272
|
if (useLoop) {
|
|
@@ -4131,7 +4275,7 @@ var Swiper = (props) => {
|
|
|
4131
4275
|
moveToInner(Math.min(nextInner, maxIndex), true);
|
|
4132
4276
|
}
|
|
4133
4277
|
}, [canSlide, useLoop, innerIndex, slideBy, maxIndex, moveToInner]);
|
|
4134
|
-
const slidePrev =
|
|
4278
|
+
const slidePrev = React28.useCallback(() => {
|
|
4135
4279
|
if (!canSlide) return;
|
|
4136
4280
|
const prevInner = innerIndex - slideBy;
|
|
4137
4281
|
if (useLoop) {
|
|
@@ -4140,7 +4284,7 @@ var Swiper = (props) => {
|
|
|
4140
4284
|
moveToInner(Math.max(prevInner, 0), true);
|
|
4141
4285
|
}
|
|
4142
4286
|
}, [canSlide, useLoop, innerIndex, slideBy, moveToInner]);
|
|
4143
|
-
|
|
4287
|
+
React28.useEffect(() => {
|
|
4144
4288
|
if (indexProp === void 0) return;
|
|
4145
4289
|
const clamped = Math.max(0, Math.min(indexProp, maxIndex));
|
|
4146
4290
|
const target = useLoop ? cloneCount + clamped : clamped;
|
|
@@ -4148,12 +4292,12 @@ var Swiper = (props) => {
|
|
|
4148
4292
|
moveToInner(target, true);
|
|
4149
4293
|
}
|
|
4150
4294
|
}, [indexProp]);
|
|
4151
|
-
|
|
4295
|
+
React28.useImperativeHandle(swiperRef, () => ({
|
|
4152
4296
|
slidePrev,
|
|
4153
4297
|
slideNext,
|
|
4154
4298
|
slideTo
|
|
4155
4299
|
}));
|
|
4156
|
-
|
|
4300
|
+
React28.useEffect(() => {
|
|
4157
4301
|
if (!auto || !canSlide) return;
|
|
4158
4302
|
autoplayTimerRef.current = setInterval(slideNext, autoplayDelay);
|
|
4159
4303
|
return () => {
|
|
@@ -4176,7 +4320,7 @@ var Swiper = (props) => {
|
|
|
4176
4320
|
startXRef.current = getClientX(e);
|
|
4177
4321
|
startTimeRef.current = Date.now();
|
|
4178
4322
|
};
|
|
4179
|
-
|
|
4323
|
+
React28.useEffect(() => {
|
|
4180
4324
|
if (!isDragging) return;
|
|
4181
4325
|
const handleMove = (e) => {
|
|
4182
4326
|
setDragOffset(getClientX(e) - startXRef.current);
|
|
@@ -4214,8 +4358,8 @@ var Swiper = (props) => {
|
|
|
4214
4358
|
}, [isDragging, dragOffset, innerIndex, useLoop, maxIndex, slideStep, moveToInner]);
|
|
4215
4359
|
const slideWidthPercent = 100 / viewItemCount;
|
|
4216
4360
|
const gapAdjust = spaceBetween * (viewItemCount - 1) / viewItemCount;
|
|
4217
|
-
const slideElements =
|
|
4218
|
-
() => extendedItems.map((item, idx) => /* @__PURE__ */
|
|
4361
|
+
const slideElements = React28.useMemo(
|
|
4362
|
+
() => extendedItems.map((item, idx) => /* @__PURE__ */ jsx335(
|
|
4219
4363
|
"div",
|
|
4220
4364
|
{
|
|
4221
4365
|
className: "lib-xplat-swiper__slide",
|
|
@@ -4234,14 +4378,14 @@ var Swiper = (props) => {
|
|
|
4234
4378
|
Math.floor(realIndex / slideBy),
|
|
4235
4379
|
totalSteps - 1
|
|
4236
4380
|
);
|
|
4237
|
-
return /* @__PURE__ */
|
|
4238
|
-
/* @__PURE__ */
|
|
4381
|
+
return /* @__PURE__ */ jsxs217("div", { className: "lib-xplat-swiper", ref: containerRef, children: [
|
|
4382
|
+
/* @__PURE__ */ jsx335(
|
|
4239
4383
|
"div",
|
|
4240
4384
|
{
|
|
4241
4385
|
className: "lib-xplat-swiper__viewport",
|
|
4242
4386
|
onMouseDown: handleDragStart,
|
|
4243
4387
|
onTouchStart: handleDragStart,
|
|
4244
|
-
children: /* @__PURE__ */
|
|
4388
|
+
children: /* @__PURE__ */ jsx335(
|
|
4245
4389
|
"div",
|
|
4246
4390
|
{
|
|
4247
4391
|
className: clsx_default(
|
|
@@ -4259,7 +4403,7 @@ var Swiper = (props) => {
|
|
|
4259
4403
|
)
|
|
4260
4404
|
}
|
|
4261
4405
|
),
|
|
4262
|
-
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(
|
|
4263
4407
|
"span",
|
|
4264
4408
|
{
|
|
4265
4409
|
className: "lib-xplat-swiper__progress-fill",
|
|
@@ -4269,7 +4413,7 @@ var Swiper = (props) => {
|
|
|
4269
4413
|
}
|
|
4270
4414
|
}
|
|
4271
4415
|
) }) }),
|
|
4272
|
-
canSlide && /* @__PURE__ */
|
|
4416
|
+
canSlide && /* @__PURE__ */ jsx335("div", { className: "lib-xplat-swiper__dots", children: Array.from({ length: totalSteps }, (_, i) => /* @__PURE__ */ jsx335(
|
|
4273
4417
|
"button",
|
|
4274
4418
|
{
|
|
4275
4419
|
className: clsx_default(
|
|
@@ -4287,8 +4431,8 @@ Swiper.displayName = "Swiper";
|
|
|
4287
4431
|
var Swiper_default = Swiper;
|
|
4288
4432
|
|
|
4289
4433
|
// src/components/Switch/Switch.tsx
|
|
4290
|
-
import
|
|
4291
|
-
import { jsx as
|
|
4434
|
+
import React29 from "react";
|
|
4435
|
+
import { jsx as jsx336 } from "react/jsx-runtime";
|
|
4292
4436
|
var KNOB_TRANSITION_MS = 250;
|
|
4293
4437
|
var Switch = (props) => {
|
|
4294
4438
|
const {
|
|
@@ -4298,9 +4442,9 @@ var Switch = (props) => {
|
|
|
4298
4442
|
disabled,
|
|
4299
4443
|
onChange
|
|
4300
4444
|
} = props;
|
|
4301
|
-
const [isAnimating, setIsAnimating] =
|
|
4302
|
-
const timeoutRef =
|
|
4303
|
-
|
|
4445
|
+
const [isAnimating, setIsAnimating] = React29.useState(false);
|
|
4446
|
+
const timeoutRef = React29.useRef(null);
|
|
4447
|
+
React29.useEffect(() => {
|
|
4304
4448
|
return () => {
|
|
4305
4449
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4306
4450
|
};
|
|
@@ -4315,7 +4459,7 @@ var Switch = (props) => {
|
|
|
4315
4459
|
timeoutRef.current = null;
|
|
4316
4460
|
}, KNOB_TRANSITION_MS);
|
|
4317
4461
|
};
|
|
4318
|
-
return /* @__PURE__ */
|
|
4462
|
+
return /* @__PURE__ */ jsx336(
|
|
4319
4463
|
"div",
|
|
4320
4464
|
{
|
|
4321
4465
|
className: clsx_default(
|
|
@@ -4328,80 +4472,13 @@ var Switch = (props) => {
|
|
|
4328
4472
|
),
|
|
4329
4473
|
onClick: handleClick,
|
|
4330
4474
|
"aria-disabled": disabled || isAnimating,
|
|
4331
|
-
children: /* @__PURE__ */
|
|
4475
|
+
children: /* @__PURE__ */ jsx336("div", { className: clsx_default("knob", value ? "checked" : void 0) })
|
|
4332
4476
|
}
|
|
4333
4477
|
);
|
|
4334
4478
|
};
|
|
4335
4479
|
Switch.displayName = "Switch";
|
|
4336
4480
|
var Switch_default = Switch;
|
|
4337
4481
|
|
|
4338
|
-
// src/components/Tab/Tab.tsx
|
|
4339
|
-
import React29 from "react";
|
|
4340
|
-
|
|
4341
|
-
// src/components/Tab/TabItem.tsx
|
|
4342
|
-
import React28 from "react";
|
|
4343
|
-
import { jsx as jsx335 } from "react/jsx-runtime";
|
|
4344
|
-
var TabItem = React28.forwardRef((props, ref) => {
|
|
4345
|
-
const { isActive, title, onClick } = props;
|
|
4346
|
-
return /* @__PURE__ */ jsx335(
|
|
4347
|
-
"div",
|
|
4348
|
-
{
|
|
4349
|
-
ref,
|
|
4350
|
-
className: clsx_default("tab-item", isActive ? "active" : null),
|
|
4351
|
-
onClick,
|
|
4352
|
-
children: title
|
|
4353
|
-
}
|
|
4354
|
-
);
|
|
4355
|
-
});
|
|
4356
|
-
TabItem.displayName = "TabItem";
|
|
4357
|
-
var TabItem_default = TabItem;
|
|
4358
|
-
|
|
4359
|
-
// src/components/Tab/Tab.tsx
|
|
4360
|
-
import { jsx as jsx336, jsxs as jsxs217 } from "react/jsx-runtime";
|
|
4361
|
-
var Tab = (props) => {
|
|
4362
|
-
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
4363
|
-
const [underlineStyle, setUnderlineStyle] = React29.useState({
|
|
4364
|
-
left: 0,
|
|
4365
|
-
width: 0
|
|
4366
|
-
});
|
|
4367
|
-
const itemRefs = React29.useRef([]);
|
|
4368
|
-
const handleChangeActiveTab = (tabItem, tabIdx) => {
|
|
4369
|
-
onChange(tabItem, tabIdx);
|
|
4370
|
-
};
|
|
4371
|
-
React29.useEffect(() => {
|
|
4372
|
-
const el = itemRefs.current[activeIndex];
|
|
4373
|
-
if (el) {
|
|
4374
|
-
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
4375
|
-
}
|
|
4376
|
-
}, [activeIndex, tabs.length]);
|
|
4377
|
-
return /* @__PURE__ */ jsxs217("div", { className: clsx_default("lib-xplat-tab", `type-${type}`, size), children: [
|
|
4378
|
-
tabs.map((tab, idx) => /* @__PURE__ */ jsx336(
|
|
4379
|
-
TabItem_default,
|
|
4380
|
-
{
|
|
4381
|
-
onClick: () => handleChangeActiveTab(tab, idx),
|
|
4382
|
-
isActive: activeIndex === idx,
|
|
4383
|
-
ref: (el) => {
|
|
4384
|
-
itemRefs.current[idx] = el;
|
|
4385
|
-
},
|
|
4386
|
-
title: tab.title
|
|
4387
|
-
},
|
|
4388
|
-
`${tab.value}_${idx}`
|
|
4389
|
-
)),
|
|
4390
|
-
type === "toggle" && /* @__PURE__ */ jsx336(
|
|
4391
|
-
"div",
|
|
4392
|
-
{
|
|
4393
|
-
className: "tab-toggle-underline",
|
|
4394
|
-
style: {
|
|
4395
|
-
left: underlineStyle.left,
|
|
4396
|
-
width: underlineStyle.width
|
|
4397
|
-
}
|
|
4398
|
-
}
|
|
4399
|
-
)
|
|
4400
|
-
] });
|
|
4401
|
-
};
|
|
4402
|
-
Tab.displayName = "Tab";
|
|
4403
|
-
var Tab_default = Tab;
|
|
4404
|
-
|
|
4405
4482
|
// src/components/Table/TableContext.tsx
|
|
4406
4483
|
import React30 from "react";
|
|
4407
4484
|
var TableContext = React30.createContext(null);
|
|
@@ -5148,10 +5225,10 @@ export {
|
|
|
5148
5225
|
Alert_default as Alert,
|
|
5149
5226
|
Avatar_default as Avatar,
|
|
5150
5227
|
Badge_default as Badge,
|
|
5228
|
+
Box_default as Box,
|
|
5151
5229
|
Breadcrumb_default as Breadcrumb,
|
|
5152
5230
|
Button_default as Button,
|
|
5153
5231
|
Calendar_default as Calendar,
|
|
5154
|
-
Card_default as Card,
|
|
5155
5232
|
CardTab_default as CardTab,
|
|
5156
5233
|
Chart_default as Chart,
|
|
5157
5234
|
CheckBox_default as CheckBox,
|