@x-plat/design-system 0.5.21 → 0.5.23
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/ChatInput/index.cjs +177 -0
- package/dist/components/ChatInput/index.css +87 -0
- package/dist/components/ChatInput/index.d.cts +14 -0
- package/dist/components/ChatInput/index.d.ts +14 -0
- package/dist/components/ChatInput/index.js +140 -0
- package/dist/components/Table/index.cjs +2 -1
- package/dist/components/Table/index.css +117 -0
- package/dist/components/Table/index.d.cts +3 -1
- package/dist/components/Table/index.d.ts +3 -1
- package/dist/components/Table/index.js +2 -1
- package/dist/components/index.cjs +625 -523
- package/dist/components/index.css +205 -0
- package/dist/components/index.d.cts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +623 -522
- package/dist/index.cjs +634 -547
- package/dist/index.css +205 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +632 -546
- package/package.json +1 -1
|
@@ -40,6 +40,7 @@ __export(components_exports, {
|
|
|
40
40
|
Calendar: () => Calendar_default,
|
|
41
41
|
CardTab: () => CardTab_default,
|
|
42
42
|
Chart: () => Chart_default,
|
|
43
|
+
ChatInput: () => ChatInput_default,
|
|
43
44
|
CheckBox: () => CheckBox_default,
|
|
44
45
|
Chip: () => Chip_default,
|
|
45
46
|
Divider: () => Divider_default,
|
|
@@ -475,6 +476,21 @@ var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
|
475
476
|
|
|
476
477
|
// src/tokens/svg/communication/SendIcon.tsx
|
|
477
478
|
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
479
|
+
var SendIcon = () => /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
|
|
480
|
+
"svg",
|
|
481
|
+
{
|
|
482
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
483
|
+
width: "1em",
|
|
484
|
+
height: "1em",
|
|
485
|
+
viewBox: "0 0 20 20",
|
|
486
|
+
fill: "none",
|
|
487
|
+
children: [
|
|
488
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("g", { clipPath: "url(#send-clip)", children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M18.3558 0.918873C18.3887 0.919879 18.4212 0.9224 18.4535 0.927663C18.4642 0.929393 18.4751 0.930348 18.4857 0.932545C18.527 0.941123 18.5675 0.953269 18.6068 0.968678C18.6178 0.972968 18.6282 0.978499 18.639 0.983327C18.6672 0.995914 18.6945 1.01021 18.7211 1.0263C18.7403 1.03794 18.7594 1.04988 18.7777 1.0634C18.7803 1.06534 18.7829 1.0673 18.7855 1.06926C18.8126 1.08979 18.839 1.11195 18.8637 1.13665C18.8872 1.16018 18.9084 1.18517 18.9281 1.21087C18.9322 1.21625 18.9359 1.22198 18.9398 1.22747C18.9501 1.24168 18.959 1.25667 18.9681 1.27141C18.9866 1.30108 19.0029 1.33154 19.017 1.36321C19.0214 1.37309 19.0267 1.38248 19.0306 1.39251C19.0461 1.43186 19.0581 1.47231 19.0668 1.5136C19.069 1.52426 19.0699 1.5351 19.0717 1.54583C19.077 1.57815 19.0794 1.61062 19.0805 1.64348C19.0808 1.65621 19.0817 1.66884 19.0814 1.68157C19.0799 1.75981 19.0681 1.83872 19.0414 1.91497L13.2074 18.581C13.1058 18.871 12.8377 19.0703 12.5306 19.0829C12.2237 19.0954 11.9398 18.9192 11.8148 18.6386L8.59706 11.4003L1.3617 8.18547C1.08085 8.06057 0.90492 7.77678 0.917368 7.46965C0.929915 7.16252 1.12827 6.89358 1.41834 6.79192L18.0853 0.958913C18.1613 0.932334 18.2398 0.919479 18.3178 0.917897C18.3305 0.91763 18.3431 0.918498 18.3558 0.918873ZM10.0609 10.999L12.4164 16.2997L16.5375 4.52239L10.0609 10.999ZM3.69862 7.58294L9.00038 9.93841L15.4808 3.45794L3.69862 7.58294Z", fill: "currentColor" }) }),
|
|
489
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("clipPath", { id: "send-clip", children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("rect", { width: "20", height: "20", fill: "currentColor" }) }) })
|
|
490
|
+
]
|
|
491
|
+
}
|
|
492
|
+
);
|
|
493
|
+
var SendIcon_default = SendIcon;
|
|
478
494
|
|
|
479
495
|
// src/tokens/svg/date/CalendarIcon.tsx
|
|
480
496
|
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
@@ -2021,30 +2037,114 @@ var Calendar = (props) => {
|
|
|
2021
2037
|
Calendar.displayName = "Calendar";
|
|
2022
2038
|
var Calendar_default = Calendar;
|
|
2023
2039
|
|
|
2024
|
-
// src/components/
|
|
2040
|
+
// src/components/ChatInput/ChatInput.tsx
|
|
2041
|
+
var import_react4 = __toESM(require("react"), 1);
|
|
2025
2042
|
var import_jsx_runtime302 = require("react/jsx-runtime");
|
|
2043
|
+
var MAX_HEIGHT = 200;
|
|
2044
|
+
var ChatInput = import_react4.default.forwardRef(
|
|
2045
|
+
(props, ref) => {
|
|
2046
|
+
const {
|
|
2047
|
+
placeholder,
|
|
2048
|
+
value: valueProp,
|
|
2049
|
+
disabled = false,
|
|
2050
|
+
buttonType = "primary",
|
|
2051
|
+
onSubmit,
|
|
2052
|
+
onChange
|
|
2053
|
+
} = props;
|
|
2054
|
+
const isControlled = valueProp !== void 0;
|
|
2055
|
+
const [internalValue, setInternalValue] = import_react4.default.useState("");
|
|
2056
|
+
const value = isControlled ? valueProp : internalValue;
|
|
2057
|
+
const hasText = value.trim().length > 0;
|
|
2058
|
+
const textareaRef = import_react4.default.useRef(null);
|
|
2059
|
+
const setRefs = import_react4.default.useCallback(
|
|
2060
|
+
(el) => {
|
|
2061
|
+
textareaRef.current = el;
|
|
2062
|
+
if (typeof ref === "function") ref(el);
|
|
2063
|
+
else if (ref) ref.current = el;
|
|
2064
|
+
},
|
|
2065
|
+
[ref]
|
|
2066
|
+
);
|
|
2067
|
+
const updateHeight = import_react4.default.useCallback(() => {
|
|
2068
|
+
const el = textareaRef.current;
|
|
2069
|
+
if (!el) return;
|
|
2070
|
+
el.style.height = "0px";
|
|
2071
|
+
el.style.height = `${Math.min(el.scrollHeight, MAX_HEIGHT)}px`;
|
|
2072
|
+
}, []);
|
|
2073
|
+
const handleChange = (e) => {
|
|
2074
|
+
const val = e.target.value;
|
|
2075
|
+
if (!isControlled) setInternalValue(val);
|
|
2076
|
+
onChange?.(val);
|
|
2077
|
+
};
|
|
2078
|
+
const handleSubmit = () => {
|
|
2079
|
+
if (!hasText || disabled) return;
|
|
2080
|
+
onSubmit?.(value);
|
|
2081
|
+
if (!isControlled) setInternalValue("");
|
|
2082
|
+
requestAnimationFrame(updateHeight);
|
|
2083
|
+
};
|
|
2084
|
+
const handleKeyDown = (e) => {
|
|
2085
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
2086
|
+
e.preventDefault();
|
|
2087
|
+
handleSubmit();
|
|
2088
|
+
}
|
|
2089
|
+
};
|
|
2090
|
+
import_react4.default.useEffect(() => {
|
|
2091
|
+
updateHeight();
|
|
2092
|
+
}, [value, updateHeight]);
|
|
2093
|
+
return /* @__PURE__ */ (0, import_jsx_runtime302.jsxs)("div", { className: clsx_default("lib-xplat-chat-input", disabled && "disabled"), children: [
|
|
2094
|
+
/* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
|
|
2095
|
+
"textarea",
|
|
2096
|
+
{
|
|
2097
|
+
ref: setRefs,
|
|
2098
|
+
className: "chat-input-textarea",
|
|
2099
|
+
placeholder,
|
|
2100
|
+
value,
|
|
2101
|
+
disabled,
|
|
2102
|
+
rows: 1,
|
|
2103
|
+
onChange: handleChange,
|
|
2104
|
+
onKeyDown: handleKeyDown
|
|
2105
|
+
}
|
|
2106
|
+
),
|
|
2107
|
+
/* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
|
|
2108
|
+
"button",
|
|
2109
|
+
{
|
|
2110
|
+
type: "button",
|
|
2111
|
+
className: clsx_default("chat-input-send", `btn-${buttonType}`),
|
|
2112
|
+
disabled: !hasText || disabled,
|
|
2113
|
+
onClick: handleSubmit,
|
|
2114
|
+
"aria-label": "\uC804\uC1A1",
|
|
2115
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(SendIcon_default, {})
|
|
2116
|
+
}
|
|
2117
|
+
)
|
|
2118
|
+
] });
|
|
2119
|
+
}
|
|
2120
|
+
);
|
|
2121
|
+
ChatInput.displayName = "ChatInput";
|
|
2122
|
+
var ChatInput_default = ChatInput;
|
|
2123
|
+
|
|
2124
|
+
// src/components/Box/Box.tsx
|
|
2125
|
+
var import_jsx_runtime303 = require("react/jsx-runtime");
|
|
2026
2126
|
var Box = ({
|
|
2027
2127
|
children,
|
|
2028
2128
|
title,
|
|
2029
2129
|
variant = "outlined",
|
|
2030
2130
|
padding = "md"
|
|
2031
2131
|
}) => {
|
|
2032
|
-
return /* @__PURE__ */ (0,
|
|
2033
|
-
title && /* @__PURE__ */ (0,
|
|
2034
|
-
/* @__PURE__ */ (0,
|
|
2132
|
+
return /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)("div", { className: clsx_default("lib-xplat-box", variant, `pad-${padding}`), children: [
|
|
2133
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("div", { className: "box-title", children: title }),
|
|
2134
|
+
/* @__PURE__ */ (0, import_jsx_runtime303.jsx)("div", { className: "box-content", children })
|
|
2035
2135
|
] });
|
|
2036
2136
|
};
|
|
2037
2137
|
Box.displayName = "Box";
|
|
2038
2138
|
var Box_default = Box;
|
|
2039
2139
|
|
|
2040
2140
|
// src/components/CardTab/CardTab.tsx
|
|
2041
|
-
var
|
|
2141
|
+
var import_react5 = __toESM(require("react"), 1);
|
|
2042
2142
|
|
|
2043
2143
|
// src/components/CardTab/CardTabPanel.tsx
|
|
2044
|
-
var
|
|
2144
|
+
var import_jsx_runtime304 = require("react/jsx-runtime");
|
|
2045
2145
|
var CardTabPanel = (props) => {
|
|
2046
2146
|
const { children, columns = 3 } = props;
|
|
2047
|
-
return /* @__PURE__ */ (0,
|
|
2147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime304.jsx)(
|
|
2048
2148
|
"div",
|
|
2049
2149
|
{
|
|
2050
2150
|
className: "card-tab-panel",
|
|
@@ -2057,7 +2157,7 @@ CardTabPanel.displayName = "CardTab.Panel";
|
|
|
2057
2157
|
var CardTabPanel_default = CardTabPanel;
|
|
2058
2158
|
|
|
2059
2159
|
// src/components/CardTab/CardTab.tsx
|
|
2060
|
-
var
|
|
2160
|
+
var import_jsx_runtime305 = require("react/jsx-runtime");
|
|
2061
2161
|
var CardTabRoot = (props) => {
|
|
2062
2162
|
const {
|
|
2063
2163
|
tabs,
|
|
@@ -2067,7 +2167,7 @@ var CardTabRoot = (props) => {
|
|
|
2067
2167
|
children
|
|
2068
2168
|
} = props;
|
|
2069
2169
|
const isControlled = activeValueProp !== void 0;
|
|
2070
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
2170
|
+
const [uncontrolledValue, setUncontrolledValue] = import_react5.default.useState(tabs[0]?.value ?? "");
|
|
2071
2171
|
const activeValue = isControlled ? activeValueProp : uncontrolledValue;
|
|
2072
2172
|
const handleTabClick = (tab) => {
|
|
2073
2173
|
if (!isControlled) {
|
|
@@ -2075,16 +2175,16 @@ var CardTabRoot = (props) => {
|
|
|
2075
2175
|
}
|
|
2076
2176
|
onChange?.(tab);
|
|
2077
2177
|
};
|
|
2078
|
-
const panels =
|
|
2079
|
-
(child) =>
|
|
2178
|
+
const panels = import_react5.default.Children.toArray(children).filter(
|
|
2179
|
+
(child) => import_react5.default.isValidElement(child) && child.type === CardTabPanel_default
|
|
2080
2180
|
);
|
|
2081
2181
|
const activePanel = panels.find(
|
|
2082
2182
|
(panel) => panel.props.value === activeValue
|
|
2083
2183
|
);
|
|
2084
|
-
return /* @__PURE__ */ (0,
|
|
2085
|
-
/* @__PURE__ */ (0,
|
|
2184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("div", { className: clsx_default("lib-xplat-card-tab", size), children: [
|
|
2185
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("div", { className: "card-tab-bar", children: tabs.map((tab) => {
|
|
2086
2186
|
const isActive = tab.value === activeValue;
|
|
2087
|
-
return /* @__PURE__ */ (0,
|
|
2187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
|
|
2088
2188
|
"button",
|
|
2089
2189
|
{
|
|
2090
2190
|
className: clsx_default("card-tab-trigger", isActive && "active"),
|
|
@@ -2096,7 +2196,7 @@ var CardTabRoot = (props) => {
|
|
|
2096
2196
|
tab.value
|
|
2097
2197
|
);
|
|
2098
2198
|
}) }),
|
|
2099
|
-
/* @__PURE__ */ (0,
|
|
2199
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("div", { className: "card-tab-body", children: activePanel })
|
|
2100
2200
|
] });
|
|
2101
2201
|
};
|
|
2102
2202
|
CardTabRoot.displayName = "CardTab";
|
|
@@ -2106,8 +2206,8 @@ var CardTab = Object.assign(CardTabRoot, {
|
|
|
2106
2206
|
var CardTab_default = CardTab;
|
|
2107
2207
|
|
|
2108
2208
|
// src/components/Chart/Chart.tsx
|
|
2109
|
-
var
|
|
2110
|
-
var
|
|
2209
|
+
var import_react6 = __toESM(require("react"), 1);
|
|
2210
|
+
var import_jsx_runtime306 = require("react/jsx-runtime");
|
|
2111
2211
|
var CATEGORICAL_COUNT2 = 8;
|
|
2112
2212
|
var LINE_BAR_PALETTES = Array.from({ length: CATEGORICAL_COUNT2 }, (_, i) => {
|
|
2113
2213
|
const n = i + 1;
|
|
@@ -2153,11 +2253,11 @@ var toSmoothPath = (points) => {
|
|
|
2153
2253
|
};
|
|
2154
2254
|
var RESIZE_SETTLE_MS = 150;
|
|
2155
2255
|
var useChartSize = (ref) => {
|
|
2156
|
-
const [size, setSize] =
|
|
2157
|
-
const settleTimer =
|
|
2158
|
-
const committedSize =
|
|
2159
|
-
const initialRef =
|
|
2160
|
-
|
|
2256
|
+
const [size, setSize] = import_react6.default.useState({ width: 0, height: 0 });
|
|
2257
|
+
const settleTimer = import_react6.default.useRef(0);
|
|
2258
|
+
const committedSize = import_react6.default.useRef({ width: 0, height: 0 });
|
|
2259
|
+
const initialRef = import_react6.default.useRef(true);
|
|
2260
|
+
import_react6.default.useEffect(() => {
|
|
2161
2261
|
const el = ref.current;
|
|
2162
2262
|
if (!el) return;
|
|
2163
2263
|
const observer = new ResizeObserver((entries) => {
|
|
@@ -2199,10 +2299,10 @@ var useChartSize = (ref) => {
|
|
|
2199
2299
|
};
|
|
2200
2300
|
var prefersReducedMotion = () => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
2201
2301
|
var useChartAnimation = (containerRef, dataKey) => {
|
|
2202
|
-
const [animate, setAnimate] =
|
|
2203
|
-
const prevDataKey =
|
|
2204
|
-
const hasAnimated =
|
|
2205
|
-
|
|
2302
|
+
const [animate, setAnimate] = import_react6.default.useState(false);
|
|
2303
|
+
const prevDataKey = import_react6.default.useRef(dataKey);
|
|
2304
|
+
const hasAnimated = import_react6.default.useRef(false);
|
|
2305
|
+
import_react6.default.useEffect(() => {
|
|
2206
2306
|
if (prefersReducedMotion()) return;
|
|
2207
2307
|
const el = containerRef.current;
|
|
2208
2308
|
if (!el) return;
|
|
@@ -2218,7 +2318,7 @@ var useChartAnimation = (containerRef, dataKey) => {
|
|
|
2218
2318
|
observer.observe(el);
|
|
2219
2319
|
return () => observer.disconnect();
|
|
2220
2320
|
}, [containerRef]);
|
|
2221
|
-
|
|
2321
|
+
import_react6.default.useEffect(() => {
|
|
2222
2322
|
if (dataKey !== prevDataKey.current) {
|
|
2223
2323
|
prevDataKey.current = dataKey;
|
|
2224
2324
|
if (prefersReducedMotion()) return;
|
|
@@ -2229,15 +2329,15 @@ var useChartAnimation = (containerRef, dataKey) => {
|
|
|
2229
2329
|
return animate || prefersReducedMotion();
|
|
2230
2330
|
};
|
|
2231
2331
|
var useChartTooltip = (enabled) => {
|
|
2232
|
-
const [tooltip, setTooltip] =
|
|
2332
|
+
const [tooltip, setTooltip] = import_react6.default.useState({
|
|
2233
2333
|
visible: false,
|
|
2234
2334
|
x: 0,
|
|
2235
2335
|
y: 0,
|
|
2236
2336
|
content: ""
|
|
2237
2337
|
});
|
|
2238
|
-
const containerRef =
|
|
2239
|
-
const rafRef =
|
|
2240
|
-
const move =
|
|
2338
|
+
const containerRef = import_react6.default.useRef(null);
|
|
2339
|
+
const rafRef = import_react6.default.useRef(0);
|
|
2340
|
+
const move = import_react6.default.useCallback((e) => {
|
|
2241
2341
|
if (!enabled) return;
|
|
2242
2342
|
const clientX = e.clientX;
|
|
2243
2343
|
const clientY = e.clientY;
|
|
@@ -2252,7 +2352,7 @@ var useChartTooltip = (enabled) => {
|
|
|
2252
2352
|
}));
|
|
2253
2353
|
});
|
|
2254
2354
|
}, [enabled]);
|
|
2255
|
-
const show =
|
|
2355
|
+
const show = import_react6.default.useCallback((e, content) => {
|
|
2256
2356
|
if (!enabled) return;
|
|
2257
2357
|
const rect = containerRef.current?.getBoundingClientRect();
|
|
2258
2358
|
if (!rect) return;
|
|
@@ -2263,18 +2363,18 @@ var useChartTooltip = (enabled) => {
|
|
|
2263
2363
|
content
|
|
2264
2364
|
});
|
|
2265
2365
|
}, [enabled]);
|
|
2266
|
-
const hide =
|
|
2366
|
+
const hide = import_react6.default.useCallback(() => {
|
|
2267
2367
|
cancelAnimationFrame(rafRef.current);
|
|
2268
2368
|
setTooltip((prev) => ({ ...prev, visible: false }));
|
|
2269
2369
|
}, []);
|
|
2270
2370
|
return { tooltip, show, hide, move, containerRef };
|
|
2271
2371
|
};
|
|
2272
|
-
var GridLines =
|
|
2372
|
+
var GridLines = import_react6.default.memo(({ width, height, chartH, maxVal }) => /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(import_jsx_runtime306.Fragment, { children: [0, 0.25, 0.5, 0.75, 1].map((ratio) => {
|
|
2273
2373
|
const y = PADDING.top + (1 - ratio) * chartH;
|
|
2274
2374
|
const val = Math.round(maxVal * ratio);
|
|
2275
|
-
return /* @__PURE__ */ (0,
|
|
2276
|
-
/* @__PURE__ */ (0,
|
|
2277
|
-
/* @__PURE__ */ (0,
|
|
2375
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("g", { children: [
|
|
2376
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
|
|
2377
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
|
|
2278
2378
|
] }, ratio);
|
|
2279
2379
|
}) }));
|
|
2280
2380
|
GridLines.displayName = "GridLines";
|
|
@@ -2284,25 +2384,25 @@ var getLabelStep = (count, chartW) => {
|
|
|
2284
2384
|
if (count <= maxLabels) return 1;
|
|
2285
2385
|
return Math.ceil(count / maxLabels);
|
|
2286
2386
|
};
|
|
2287
|
-
var AxisLabels =
|
|
2387
|
+
var AxisLabels = import_react6.default.memo(({ labels, count, chartW, height }) => {
|
|
2288
2388
|
const step = getLabelStep(count, chartW);
|
|
2289
|
-
return /* @__PURE__ */ (0,
|
|
2389
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(import_jsx_runtime306.Fragment, { children: labels.map((label, i) => {
|
|
2290
2390
|
if (i % step !== 0) return null;
|
|
2291
2391
|
const x = PADDING.left + i / (count - 1 || 1) * chartW;
|
|
2292
|
-
return /* @__PURE__ */ (0,
|
|
2392
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("text", { x, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
2293
2393
|
}) });
|
|
2294
2394
|
});
|
|
2295
2395
|
AxisLabels.displayName = "AxisLabels";
|
|
2296
|
-
var LineChart =
|
|
2297
|
-
const entries =
|
|
2298
|
-
const maxVal =
|
|
2396
|
+
var LineChart = import_react6.default.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
|
|
2397
|
+
const entries = import_react6.default.useMemo(() => Object.entries(data), [data]);
|
|
2398
|
+
const maxVal = import_react6.default.useMemo(() => {
|
|
2299
2399
|
const allValues = entries.flatMap(([, v]) => v);
|
|
2300
2400
|
return Math.max(...allValues) * 1.2 || 1;
|
|
2301
2401
|
}, [entries]);
|
|
2302
2402
|
const count = labels.length;
|
|
2303
2403
|
const chartW = width - PADDING.left - PADDING.right;
|
|
2304
2404
|
const chartH = height - PADDING.top - PADDING.bottom;
|
|
2305
|
-
const seriesPoints =
|
|
2405
|
+
const seriesPoints = import_react6.default.useMemo(
|
|
2306
2406
|
() => entries.map(
|
|
2307
2407
|
([, values]) => values.map((v, i) => ({
|
|
2308
2408
|
x: PADDING.left + i / (count - 1 || 1) * chartW,
|
|
@@ -2313,8 +2413,8 @@ var LineChart = import_react5.default.memo(({ data, labels, width, height, anima
|
|
|
2313
2413
|
[entries, count, chartW, chartH, maxVal]
|
|
2314
2414
|
);
|
|
2315
2415
|
const showPoints = count <= 100;
|
|
2316
|
-
const lineRefs =
|
|
2317
|
-
|
|
2416
|
+
const lineRefs = import_react6.default.useRef([]);
|
|
2417
|
+
import_react6.default.useEffect(() => {
|
|
2318
2418
|
if (!animate) return;
|
|
2319
2419
|
lineRefs.current.forEach((el) => {
|
|
2320
2420
|
if (!el) return;
|
|
@@ -2327,9 +2427,9 @@ var LineChart = import_react5.default.memo(({ data, labels, width, height, anima
|
|
|
2327
2427
|
});
|
|
2328
2428
|
});
|
|
2329
2429
|
}, [animate, seriesPoints]);
|
|
2330
|
-
return /* @__PURE__ */ (0,
|
|
2331
|
-
/* @__PURE__ */ (0,
|
|
2332
|
-
/* @__PURE__ */ (0,
|
|
2430
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
2431
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)(GridLines, { width, height, chartH, maxVal }),
|
|
2432
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)(AxisLabels, { labels, count, chartW, height }),
|
|
2333
2433
|
entries.map(([key], di) => {
|
|
2334
2434
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
2335
2435
|
const color = palette[2];
|
|
@@ -2338,12 +2438,12 @@ var LineChart = import_react5.default.memo(({ data, labels, width, height, anima
|
|
|
2338
2438
|
const gradientId = `line-gradient-${di}`;
|
|
2339
2439
|
const polyPoints = points.map((p) => `${p.x},${p.y}`).join(" ");
|
|
2340
2440
|
const areaD = `M ${points[0].x},${points[0].y} ${points.map((p) => `L ${p.x},${p.y}`).join(" ")} L ${points[points.length - 1].x},${PADDING.top + chartH} L ${points[0].x},${PADDING.top + chartH} Z`;
|
|
2341
|
-
return /* @__PURE__ */ (0,
|
|
2342
|
-
/* @__PURE__ */ (0,
|
|
2343
|
-
/* @__PURE__ */ (0,
|
|
2344
|
-
/* @__PURE__ */ (0,
|
|
2441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("g", { children: [
|
|
2442
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
2443
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.2" }),
|
|
2444
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0" })
|
|
2345
2445
|
] }) }),
|
|
2346
|
-
/* @__PURE__ */ (0,
|
|
2446
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
2347
2447
|
"path",
|
|
2348
2448
|
{
|
|
2349
2449
|
d: areaD,
|
|
@@ -2352,7 +2452,7 @@ var LineChart = import_react5.default.memo(({ data, labels, width, height, anima
|
|
|
2352
2452
|
style: animate ? { animationDelay: "600ms" } : { opacity: 1 }
|
|
2353
2453
|
}
|
|
2354
2454
|
),
|
|
2355
|
-
/* @__PURE__ */ (0,
|
|
2455
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
2356
2456
|
"polyline",
|
|
2357
2457
|
{
|
|
2358
2458
|
ref: (el) => {
|
|
@@ -2364,7 +2464,7 @@ var LineChart = import_react5.default.memo(({ data, labels, width, height, anima
|
|
|
2364
2464
|
strokeWidth: "2"
|
|
2365
2465
|
}
|
|
2366
2466
|
),
|
|
2367
|
-
showPoints && points.map((p, i) => /* @__PURE__ */ (0,
|
|
2467
|
+
showPoints && points.map((p, i) => /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
2368
2468
|
"circle",
|
|
2369
2469
|
{
|
|
2370
2470
|
cx: p.x,
|
|
@@ -2383,16 +2483,16 @@ var LineChart = import_react5.default.memo(({ data, labels, width, height, anima
|
|
|
2383
2483
|
] });
|
|
2384
2484
|
});
|
|
2385
2485
|
LineChart.displayName = "LineChart";
|
|
2386
|
-
var CurveChart =
|
|
2387
|
-
const entries =
|
|
2388
|
-
const maxVal =
|
|
2486
|
+
var CurveChart = import_react6.default.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
|
|
2487
|
+
const entries = import_react6.default.useMemo(() => Object.entries(data), [data]);
|
|
2488
|
+
const maxVal = import_react6.default.useMemo(() => {
|
|
2389
2489
|
const allValues = entries.flatMap(([, v]) => v);
|
|
2390
2490
|
return Math.max(...allValues) * 1.2 || 1;
|
|
2391
2491
|
}, [entries]);
|
|
2392
2492
|
const count = labels.length;
|
|
2393
2493
|
const chartW = width - PADDING.left - PADDING.right;
|
|
2394
2494
|
const chartH = height - PADDING.top - PADDING.bottom;
|
|
2395
|
-
const seriesPoints =
|
|
2495
|
+
const seriesPoints = import_react6.default.useMemo(
|
|
2396
2496
|
() => entries.map(
|
|
2397
2497
|
([, values]) => values.map((v, i) => ({
|
|
2398
2498
|
x: PADDING.left + i / (count - 1 || 1) * chartW,
|
|
@@ -2403,8 +2503,8 @@ var CurveChart = import_react5.default.memo(({ data, labels, width, height, anim
|
|
|
2403
2503
|
[entries, count, chartW, chartH, maxVal]
|
|
2404
2504
|
);
|
|
2405
2505
|
const showPoints = count <= 100;
|
|
2406
|
-
const lineRefs =
|
|
2407
|
-
|
|
2506
|
+
const lineRefs = import_react6.default.useRef([]);
|
|
2507
|
+
import_react6.default.useEffect(() => {
|
|
2408
2508
|
if (!animate) return;
|
|
2409
2509
|
lineRefs.current.forEach((el) => {
|
|
2410
2510
|
if (!el) return;
|
|
@@ -2417,9 +2517,9 @@ var CurveChart = import_react5.default.memo(({ data, labels, width, height, anim
|
|
|
2417
2517
|
});
|
|
2418
2518
|
});
|
|
2419
2519
|
}, [animate, seriesPoints]);
|
|
2420
|
-
return /* @__PURE__ */ (0,
|
|
2421
|
-
/* @__PURE__ */ (0,
|
|
2422
|
-
/* @__PURE__ */ (0,
|
|
2520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
2521
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)(GridLines, { width, height, chartH, maxVal }),
|
|
2522
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)(AxisLabels, { labels, count, chartW, height }),
|
|
2423
2523
|
entries.map(([key], di) => {
|
|
2424
2524
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
2425
2525
|
const color = palette[2];
|
|
@@ -2428,12 +2528,12 @@ var CurveChart = import_react5.default.memo(({ data, labels, width, height, anim
|
|
|
2428
2528
|
const gradientId = `curve-gradient-${di}`;
|
|
2429
2529
|
const linePath = toSmoothPath(points);
|
|
2430
2530
|
const areaPath = linePath + ` L ${points[points.length - 1].x} ${PADDING.top + chartH} L ${points[0].x} ${PADDING.top + chartH} Z`;
|
|
2431
|
-
return /* @__PURE__ */ (0,
|
|
2432
|
-
/* @__PURE__ */ (0,
|
|
2433
|
-
/* @__PURE__ */ (0,
|
|
2434
|
-
/* @__PURE__ */ (0,
|
|
2531
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("g", { children: [
|
|
2532
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
2533
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.4" }),
|
|
2534
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0.02" })
|
|
2435
2535
|
] }) }),
|
|
2436
|
-
/* @__PURE__ */ (0,
|
|
2536
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
2437
2537
|
"path",
|
|
2438
2538
|
{
|
|
2439
2539
|
d: areaPath,
|
|
@@ -2442,7 +2542,7 @@ var CurveChart = import_react5.default.memo(({ data, labels, width, height, anim
|
|
|
2442
2542
|
style: animate ? { animationDelay: "600ms" } : { opacity: 1 }
|
|
2443
2543
|
}
|
|
2444
2544
|
),
|
|
2445
|
-
/* @__PURE__ */ (0,
|
|
2545
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
2446
2546
|
"path",
|
|
2447
2547
|
{
|
|
2448
2548
|
ref: (el) => {
|
|
@@ -2454,7 +2554,7 @@ var CurveChart = import_react5.default.memo(({ data, labels, width, height, anim
|
|
|
2454
2554
|
strokeWidth: "2"
|
|
2455
2555
|
}
|
|
2456
2556
|
),
|
|
2457
|
-
showPoints && points.map((p, i) => /* @__PURE__ */ (0,
|
|
2557
|
+
showPoints && points.map((p, i) => /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
2458
2558
|
"circle",
|
|
2459
2559
|
{
|
|
2460
2560
|
cx: p.x,
|
|
@@ -2473,9 +2573,9 @@ var CurveChart = import_react5.default.memo(({ data, labels, width, height, anim
|
|
|
2473
2573
|
] });
|
|
2474
2574
|
});
|
|
2475
2575
|
CurveChart.displayName = "CurveChart";
|
|
2476
|
-
var BarChart =
|
|
2477
|
-
const entries =
|
|
2478
|
-
const maxVal =
|
|
2576
|
+
var BarChart = import_react6.default.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
|
|
2577
|
+
const entries = import_react6.default.useMemo(() => Object.entries(data), [data]);
|
|
2578
|
+
const maxVal = import_react6.default.useMemo(() => {
|
|
2479
2579
|
const allValues = entries.flatMap(([, v]) => v);
|
|
2480
2580
|
return Math.max(...allValues) * 1.2 || 1;
|
|
2481
2581
|
}, [entries]);
|
|
@@ -2487,7 +2587,7 @@ var BarChart = import_react5.default.memo(({ data, labels, width, height, animat
|
|
|
2487
2587
|
const barGap = groupCount > 1 ? 2 : 0;
|
|
2488
2588
|
const barW = Math.max(1, Math.min(32, (groupW * 0.7 - barGap * (groupCount - 1)) / groupCount));
|
|
2489
2589
|
const baseline = PADDING.top + chartH;
|
|
2490
|
-
const bars =
|
|
2590
|
+
const bars = import_react6.default.useMemo(
|
|
2491
2591
|
() => entries.map(
|
|
2492
2592
|
([, values], di) => values.map((v, i) => {
|
|
2493
2593
|
const totalBarsW = barW * groupCount + barGap * (groupCount - 1);
|
|
@@ -2500,11 +2600,11 @@ var BarChart = import_react5.default.memo(({ data, labels, width, height, animat
|
|
|
2500
2600
|
[entries, maxVal, chartH, groupW, barW, barGap, groupCount]
|
|
2501
2601
|
);
|
|
2502
2602
|
const barLabelStep = getLabelStep(count, chartW);
|
|
2503
|
-
return /* @__PURE__ */ (0,
|
|
2504
|
-
/* @__PURE__ */ (0,
|
|
2603
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
2604
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)(GridLines, { width, height, chartH, maxVal }),
|
|
2505
2605
|
labels.map((label, i) => {
|
|
2506
2606
|
if (i % barLabelStep !== 0) return null;
|
|
2507
|
-
return /* @__PURE__ */ (0,
|
|
2607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("text", { x: PADDING.left + groupW * i + groupW / 2, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
2508
2608
|
}),
|
|
2509
2609
|
entries.map(([key], di) => {
|
|
2510
2610
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
@@ -2513,7 +2613,7 @@ var BarChart = import_react5.default.memo(({ data, labels, width, height, animat
|
|
|
2513
2613
|
const r2 = Math.min(4, b.w / 2);
|
|
2514
2614
|
const d = b.h <= r2 ? `M ${b.x} ${b.y + b.h} V ${b.y} H ${b.x + b.w} V ${b.y + b.h} Z` : `M ${b.x} ${b.y + b.h} V ${b.y + r2} Q ${b.x} ${b.y} ${b.x + r2} ${b.y} H ${b.x + b.w - r2} Q ${b.x + b.w} ${b.y} ${b.x + b.w} ${b.y + r2} V ${b.y + b.h} Z`;
|
|
2515
2615
|
const delay = 100 + i * 80;
|
|
2516
|
-
return /* @__PURE__ */ (0,
|
|
2616
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
2517
2617
|
"path",
|
|
2518
2618
|
{
|
|
2519
2619
|
d,
|
|
@@ -2534,11 +2634,11 @@ var BarChart = import_react5.default.memo(({ data, labels, width, height, animat
|
|
|
2534
2634
|
] });
|
|
2535
2635
|
});
|
|
2536
2636
|
BarChart.displayName = "BarChart";
|
|
2537
|
-
var PieDonutChart =
|
|
2637
|
+
var PieDonutChart = import_react6.default.memo(
|
|
2538
2638
|
({ data, labels, width, height, animate, isDoughnut, onHover, onMove, onLeave }) => {
|
|
2539
|
-
const entries =
|
|
2540
|
-
const values =
|
|
2541
|
-
const total =
|
|
2639
|
+
const entries = import_react6.default.useMemo(() => Object.entries(data), [data]);
|
|
2640
|
+
const values = import_react6.default.useMemo(() => entries.flatMap(([, v]) => v), [entries]);
|
|
2641
|
+
const total = import_react6.default.useMemo(() => values.reduce((a, b) => a + b, 0) || 1, [values]);
|
|
2542
2642
|
const size = Math.min(width, height);
|
|
2543
2643
|
const cx = size / 2;
|
|
2544
2644
|
const cy = size / 2;
|
|
@@ -2546,10 +2646,10 @@ var PieDonutChart = import_react5.default.memo(
|
|
|
2546
2646
|
const innerR = isDoughnut ? r2 * 0.5 : 0;
|
|
2547
2647
|
const firstKey = entries[0]?.[0] ?? "";
|
|
2548
2648
|
const colorOffset = hashString(firstKey);
|
|
2549
|
-
const maskRef =
|
|
2649
|
+
const maskRef = import_react6.default.useRef(null);
|
|
2550
2650
|
const maskR = r2 + 10;
|
|
2551
2651
|
const maskCircumference = 2 * Math.PI * maskR;
|
|
2552
|
-
|
|
2652
|
+
import_react6.default.useEffect(() => {
|
|
2553
2653
|
if (!animate || !maskRef.current) return;
|
|
2554
2654
|
const el = maskRef.current;
|
|
2555
2655
|
el.style.strokeDasharray = `${maskCircumference}`;
|
|
@@ -2559,7 +2659,7 @@ var PieDonutChart = import_react5.default.memo(
|
|
|
2559
2659
|
el.style.strokeDashoffset = "0";
|
|
2560
2660
|
});
|
|
2561
2661
|
}, [animate, maskCircumference]);
|
|
2562
|
-
const sliceData =
|
|
2662
|
+
const sliceData = import_react6.default.useMemo(() => {
|
|
2563
2663
|
let angle0 = -Math.PI / 2;
|
|
2564
2664
|
let cumulativeAngle = 0;
|
|
2565
2665
|
return values.map((v, i) => {
|
|
@@ -2593,8 +2693,8 @@ var PieDonutChart = import_react5.default.memo(
|
|
|
2593
2693
|
});
|
|
2594
2694
|
}, [values, total, cx, cy, r2, innerR, labels]);
|
|
2595
2695
|
const maskId = `pie-mask-${isDoughnut ? "d" : "p"}`;
|
|
2596
|
-
return /* @__PURE__ */ (0,
|
|
2597
|
-
animate && /* @__PURE__ */ (0,
|
|
2696
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("svg", { viewBox: `0 0 ${size} ${size}`, className: "chart-svg chart-pie", children: [
|
|
2697
|
+
animate && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("mask", { id: maskId, children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
2598
2698
|
"circle",
|
|
2599
2699
|
{
|
|
2600
2700
|
ref: maskRef,
|
|
@@ -2607,7 +2707,7 @@ var PieDonutChart = import_react5.default.memo(
|
|
|
2607
2707
|
transform: `rotate(-90 ${cx} ${cy})`
|
|
2608
2708
|
}
|
|
2609
2709
|
) }) }),
|
|
2610
|
-
/* @__PURE__ */ (0,
|
|
2710
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)("g", { mask: animate ? `url(#${maskId})` : void 0, children: sliceData.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
2611
2711
|
"path",
|
|
2612
2712
|
{
|
|
2613
2713
|
d: s.d,
|
|
@@ -2618,7 +2718,7 @@ var PieDonutChart = import_react5.default.memo(
|
|
|
2618
2718
|
onMouseLeave: onLeave
|
|
2619
2719
|
}
|
|
2620
2720
|
) }, i)) }),
|
|
2621
|
-
sliceData.map((s, i) => s.angle > 0.2 && /* @__PURE__ */ (0,
|
|
2721
|
+
sliceData.map((s, i) => s.angle > 0.2 && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
2622
2722
|
"text",
|
|
2623
2723
|
{
|
|
2624
2724
|
x: s.lx,
|
|
@@ -2636,9 +2736,9 @@ var PieDonutChart = import_react5.default.memo(
|
|
|
2636
2736
|
);
|
|
2637
2737
|
PieDonutChart.displayName = "PieDonutChart";
|
|
2638
2738
|
var TooltipBubble = ({ x, y, containerWidth, children }) => {
|
|
2639
|
-
const ref =
|
|
2640
|
-
const [adjustedX, setAdjustedX] =
|
|
2641
|
-
|
|
2739
|
+
const ref = import_react6.default.useRef(null);
|
|
2740
|
+
const [adjustedX, setAdjustedX] = import_react6.default.useState(x);
|
|
2741
|
+
import_react6.default.useEffect(() => {
|
|
2642
2742
|
const el = ref.current;
|
|
2643
2743
|
if (!el) return;
|
|
2644
2744
|
const w = el.offsetWidth;
|
|
@@ -2649,7 +2749,7 @@ var TooltipBubble = ({ x, y, containerWidth, children }) => {
|
|
|
2649
2749
|
else if (x + half > containerWidth - margin) nx = containerWidth - half - margin;
|
|
2650
2750
|
setAdjustedX(nx);
|
|
2651
2751
|
}, [x, containerWidth]);
|
|
2652
|
-
return /* @__PURE__ */ (0,
|
|
2752
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
2653
2753
|
"div",
|
|
2654
2754
|
{
|
|
2655
2755
|
ref,
|
|
@@ -2659,22 +2759,22 @@ var TooltipBubble = ({ x, y, containerWidth, children }) => {
|
|
|
2659
2759
|
}
|
|
2660
2760
|
);
|
|
2661
2761
|
};
|
|
2662
|
-
var Chart =
|
|
2762
|
+
var Chart = import_react6.default.memo((props) => {
|
|
2663
2763
|
const { type, data, labels, tooltip: showTooltip = true } = props;
|
|
2664
2764
|
const { tooltip, show, hide, move, containerRef } = useChartTooltip(showTooltip);
|
|
2665
2765
|
const { width, height } = useChartSize(containerRef);
|
|
2666
|
-
const stableData =
|
|
2667
|
-
const stableLabels =
|
|
2668
|
-
const dataKey =
|
|
2766
|
+
const stableData = import_react6.default.useMemo(() => data, [JSON.stringify(data)]);
|
|
2767
|
+
const stableLabels = import_react6.default.useMemo(() => labels, [JSON.stringify(labels)]);
|
|
2768
|
+
const dataKey = import_react6.default.useMemo(() => JSON.stringify(labels), [labels]);
|
|
2669
2769
|
const animate = useChartAnimation(containerRef, dataKey);
|
|
2670
2770
|
const ready = width > 0 && height > 0;
|
|
2671
|
-
return /* @__PURE__ */ (0,
|
|
2672
|
-
ready && type === "line" && /* @__PURE__ */ (0,
|
|
2673
|
-
ready && type === "curve" && /* @__PURE__ */ (0,
|
|
2674
|
-
ready && type === "bar" && /* @__PURE__ */ (0,
|
|
2675
|
-
ready && type === "pie" && /* @__PURE__ */ (0,
|
|
2676
|
-
ready && type === "doughnut" && /* @__PURE__ */ (0,
|
|
2677
|
-
tooltip.visible && /* @__PURE__ */ (0,
|
|
2771
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("div", { className: "lib-xplat-chart", ref: containerRef, children: [
|
|
2772
|
+
ready && type === "line" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(LineChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2773
|
+
ready && type === "curve" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(CurveChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2774
|
+
ready && type === "bar" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(BarChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2775
|
+
ready && type === "pie" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2776
|
+
ready && type === "doughnut" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, isDoughnut: true, onHover: show, onMove: move, onLeave: hide }),
|
|
2777
|
+
tooltip.visible && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(TooltipBubble, { x: tooltip.x, y: tooltip.y, containerWidth: width, children: tooltip.content })
|
|
2678
2778
|
] });
|
|
2679
2779
|
});
|
|
2680
2780
|
Chart.displayName = "Chart";
|
|
@@ -2687,7 +2787,7 @@ var import_tokens_core = require("@x-plat/tokens-core");
|
|
|
2687
2787
|
var import_tokens_core2 = require("@x-plat/tokens-core");
|
|
2688
2788
|
|
|
2689
2789
|
// src/components/CheckBox/CheckBox.tsx
|
|
2690
|
-
var
|
|
2790
|
+
var import_jsx_runtime307 = require("react/jsx-runtime");
|
|
2691
2791
|
var CheckBox = (props) => {
|
|
2692
2792
|
const {
|
|
2693
2793
|
checked,
|
|
@@ -2705,8 +2805,8 @@ var CheckBox = (props) => {
|
|
|
2705
2805
|
const checkedClasses = `checked`;
|
|
2706
2806
|
const disabledClasses = "disabled";
|
|
2707
2807
|
const boxClasses = disabled ? disabledClasses : checked ? checkedClasses : uncheckedClasses;
|
|
2708
|
-
return /* @__PURE__ */ (0,
|
|
2709
|
-
/* @__PURE__ */ (0,
|
|
2808
|
+
return /* @__PURE__ */ (0, import_jsx_runtime307.jsxs)("label", { className: clsx_default("lib-xplat-checkbox", size, type), children: [
|
|
2809
|
+
/* @__PURE__ */ (0, import_jsx_runtime307.jsx)(
|
|
2710
2810
|
"input",
|
|
2711
2811
|
{
|
|
2712
2812
|
type: "checkbox",
|
|
@@ -2716,44 +2816,44 @@ var CheckBox = (props) => {
|
|
|
2716
2816
|
...rest
|
|
2717
2817
|
}
|
|
2718
2818
|
),
|
|
2719
|
-
/* @__PURE__ */ (0,
|
|
2720
|
-
label && /* @__PURE__ */ (0,
|
|
2819
|
+
/* @__PURE__ */ (0, import_jsx_runtime307.jsx)("span", { className: clsx_default("checkbox", boxClasses), children: /* @__PURE__ */ (0, import_jsx_runtime307.jsx)("span", { className: clsx_default("check-icon", { visible: checked }), children: /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(CheckIcon_default, {}) }) }),
|
|
2820
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime307.jsx)("span", { className: "label", children: label })
|
|
2721
2821
|
] });
|
|
2722
2822
|
};
|
|
2723
2823
|
CheckBox.displayName = "CheckBox";
|
|
2724
2824
|
var CheckBox_default = CheckBox;
|
|
2725
2825
|
|
|
2726
2826
|
// src/components/Chip/Chip.tsx
|
|
2727
|
-
var
|
|
2827
|
+
var import_jsx_runtime308 = require("react/jsx-runtime");
|
|
2728
2828
|
var Chip = (props) => {
|
|
2729
2829
|
const {
|
|
2730
2830
|
children,
|
|
2731
2831
|
type = "primary",
|
|
2732
2832
|
size = "md"
|
|
2733
2833
|
} = props;
|
|
2734
|
-
return /* @__PURE__ */ (0,
|
|
2834
|
+
return /* @__PURE__ */ (0, import_jsx_runtime308.jsx)("div", { className: clsx_default("lib-xplat-chip", type, size), children });
|
|
2735
2835
|
};
|
|
2736
2836
|
Chip.displayName = "Chip";
|
|
2737
2837
|
var Chip_default = Chip;
|
|
2738
2838
|
|
|
2739
2839
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
2740
|
-
var
|
|
2840
|
+
var import_react13 = __toESM(require("react"), 1);
|
|
2741
2841
|
|
|
2742
2842
|
// src/components/Input/Input.tsx
|
|
2743
|
-
var
|
|
2843
|
+
var import_react7 = __toESM(require("react"), 1);
|
|
2744
2844
|
|
|
2745
2845
|
// src/components/Input/InputValidations.tsx
|
|
2746
|
-
var
|
|
2846
|
+
var import_jsx_runtime309 = require("react/jsx-runtime");
|
|
2747
2847
|
var InputValidations = (props) => {
|
|
2748
2848
|
const { message, status = "default" } = props;
|
|
2749
|
-
return /* @__PURE__ */ (0,
|
|
2750
|
-
/* @__PURE__ */ (0,
|
|
2751
|
-
status === "default" && /* @__PURE__ */ (0,
|
|
2752
|
-
status === "success" && /* @__PURE__ */ (0,
|
|
2753
|
-
status === "warning" && /* @__PURE__ */ (0,
|
|
2754
|
-
status === "error" && /* @__PURE__ */ (0,
|
|
2849
|
+
return /* @__PURE__ */ (0, import_jsx_runtime309.jsxs)("div", { className: clsx_default("lib-xplat-input-validation", status), children: [
|
|
2850
|
+
/* @__PURE__ */ (0, import_jsx_runtime309.jsxs)("div", { className: "icon", children: [
|
|
2851
|
+
status === "default" && /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(InfoIcon_default, {}),
|
|
2852
|
+
status === "success" && /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(SuccessIcon_default, {}),
|
|
2853
|
+
status === "warning" && /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(InfoIcon_default, {}),
|
|
2854
|
+
status === "error" && /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(ErrorIcon_default, {})
|
|
2755
2855
|
] }),
|
|
2756
|
-
/* @__PURE__ */ (0,
|
|
2856
|
+
/* @__PURE__ */ (0, import_jsx_runtime309.jsx)("div", { className: "message", children: message })
|
|
2757
2857
|
] });
|
|
2758
2858
|
};
|
|
2759
2859
|
InputValidations.displayName = "InputValidations";
|
|
@@ -2794,8 +2894,8 @@ var handleTelBackspace = (prevValue, currValue) => {
|
|
|
2794
2894
|
};
|
|
2795
2895
|
|
|
2796
2896
|
// src/components/Input/Input.tsx
|
|
2797
|
-
var
|
|
2798
|
-
var
|
|
2897
|
+
var import_jsx_runtime310 = require("react/jsx-runtime");
|
|
2898
|
+
var import_react8 = require("react");
|
|
2799
2899
|
var formatValue = (type, value) => {
|
|
2800
2900
|
if (value === null || value === void 0) return "";
|
|
2801
2901
|
const strValue = Array.isArray(value) ? String(value[0] ?? "") : String(value);
|
|
@@ -2843,7 +2943,7 @@ var parseValue = (type, value) => {
|
|
|
2843
2943
|
return value;
|
|
2844
2944
|
}
|
|
2845
2945
|
};
|
|
2846
|
-
var Input =
|
|
2946
|
+
var Input = import_react7.default.forwardRef((props, ref) => {
|
|
2847
2947
|
const {
|
|
2848
2948
|
value,
|
|
2849
2949
|
onChange,
|
|
@@ -2869,13 +2969,13 @@ var Input = import_react6.default.forwardRef((props, ref) => {
|
|
|
2869
2969
|
onChange(event);
|
|
2870
2970
|
}
|
|
2871
2971
|
};
|
|
2872
|
-
return /* @__PURE__ */ (0,
|
|
2873
|
-
/* @__PURE__ */ (0,
|
|
2972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime310.jsxs)("div", { className: "lib-xplat-input-wrap", children: [
|
|
2973
|
+
/* @__PURE__ */ (0, import_jsx_runtime310.jsxs)(
|
|
2874
2974
|
"div",
|
|
2875
2975
|
{
|
|
2876
2976
|
className: clsx_default("lib-xplat-input", size, disabled ? "disabled" : void 0),
|
|
2877
2977
|
children: [
|
|
2878
|
-
/* @__PURE__ */ (0,
|
|
2978
|
+
/* @__PURE__ */ (0, import_jsx_runtime310.jsx)(
|
|
2879
2979
|
"input",
|
|
2880
2980
|
{
|
|
2881
2981
|
...inputProps,
|
|
@@ -2886,11 +2986,11 @@ var Input = import_react6.default.forwardRef((props, ref) => {
|
|
|
2886
2986
|
onChange: handleChange
|
|
2887
2987
|
}
|
|
2888
2988
|
),
|
|
2889
|
-
suffix && /* @__PURE__ */ (0,
|
|
2989
|
+
suffix && /* @__PURE__ */ (0, import_jsx_runtime310.jsx)("div", { className: "suffix", children: suffix })
|
|
2890
2990
|
]
|
|
2891
2991
|
}
|
|
2892
2992
|
),
|
|
2893
|
-
validations && /* @__PURE__ */ (0,
|
|
2993
|
+
validations && /* @__PURE__ */ (0, import_jsx_runtime310.jsx)("div", { className: "lib-xplat-input-validation-wrap", children: validations?.map((validation, idx) => /* @__PURE__ */ (0, import_react8.createElement)(
|
|
2894
2994
|
InputValidations_default,
|
|
2895
2995
|
{
|
|
2896
2996
|
...validation,
|
|
@@ -2903,20 +3003,20 @@ Input.displayName = "Input";
|
|
|
2903
3003
|
var Input_default = Input;
|
|
2904
3004
|
|
|
2905
3005
|
// src/components/Input/PasswordInput/PasswordInput.tsx
|
|
2906
|
-
var
|
|
2907
|
-
var
|
|
2908
|
-
var PasswordInput =
|
|
3006
|
+
var import_react9 = __toESM(require("react"), 1);
|
|
3007
|
+
var import_jsx_runtime311 = require("react/jsx-runtime");
|
|
3008
|
+
var PasswordInput = import_react9.default.forwardRef(
|
|
2909
3009
|
(props, ref) => {
|
|
2910
3010
|
const { reg: _reg, ...inputProps } = props;
|
|
2911
|
-
const [isView, setIsView] =
|
|
3011
|
+
const [isView, setIsView] = import_react9.default.useState(false);
|
|
2912
3012
|
const handleChangeView = () => {
|
|
2913
3013
|
setIsView((prev) => !prev);
|
|
2914
3014
|
};
|
|
2915
|
-
return /* @__PURE__ */ (0,
|
|
3015
|
+
return /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
|
|
2916
3016
|
Input_default,
|
|
2917
3017
|
{
|
|
2918
3018
|
...inputProps,
|
|
2919
|
-
suffix: /* @__PURE__ */ (0,
|
|
3019
|
+
suffix: /* @__PURE__ */ (0, import_jsx_runtime311.jsx)("div", { className: "wrapper pointer", onClick: handleChangeView, children: isView ? /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(OpenEyeIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(CloseEyeIcon_default, {}) }),
|
|
2920
3020
|
type: isView ? "text" : "password",
|
|
2921
3021
|
ref
|
|
2922
3022
|
}
|
|
@@ -2927,17 +3027,17 @@ PasswordInput.displayName = "PasswordInput";
|
|
|
2927
3027
|
var PasswordInput_default = PasswordInput;
|
|
2928
3028
|
|
|
2929
3029
|
// src/components/Modal/Modal.tsx
|
|
2930
|
-
var
|
|
3030
|
+
var import_react11 = __toESM(require("react"), 1);
|
|
2931
3031
|
var import_react_dom2 = require("react-dom");
|
|
2932
3032
|
|
|
2933
3033
|
// src/tokens/hooks/Portal.tsx
|
|
2934
|
-
var
|
|
3034
|
+
var import_react10 = __toESM(require("react"), 1);
|
|
2935
3035
|
var import_react_dom = __toESM(require("react-dom"), 1);
|
|
2936
|
-
var
|
|
2937
|
-
var PortalContainerContext =
|
|
2938
|
-
var PortalProvider = ({ container, children }) => /* @__PURE__ */ (0,
|
|
3036
|
+
var import_jsx_runtime312 = require("react/jsx-runtime");
|
|
3037
|
+
var PortalContainerContext = import_react10.default.createContext(null);
|
|
3038
|
+
var PortalProvider = ({ container, children }) => /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(PortalContainerContext.Provider, { value: container, children });
|
|
2939
3039
|
var Portal = ({ children }) => {
|
|
2940
|
-
const contextContainer =
|
|
3040
|
+
const contextContainer = import_react10.default.useContext(PortalContainerContext);
|
|
2941
3041
|
if (typeof document === "undefined") return null;
|
|
2942
3042
|
const container = contextContainer ?? document.body;
|
|
2943
3043
|
return import_react_dom.default.createPortal(children, container);
|
|
@@ -2946,14 +3046,14 @@ Portal.displayName = "Portal";
|
|
|
2946
3046
|
var Portal_default = Portal;
|
|
2947
3047
|
|
|
2948
3048
|
// src/components/Modal/Modal.tsx
|
|
2949
|
-
var
|
|
3049
|
+
var import_jsx_runtime313 = require("react/jsx-runtime");
|
|
2950
3050
|
var ANIMATION_DURATION_MS = 200;
|
|
2951
3051
|
var Modal = (props) => {
|
|
2952
3052
|
const { isOpen, onClose, children } = props;
|
|
2953
|
-
const [mounted, setMounted] =
|
|
2954
|
-
const [visible, setVisible] =
|
|
2955
|
-
const boxRef =
|
|
2956
|
-
|
|
3053
|
+
const [mounted, setMounted] = import_react11.default.useState(false);
|
|
3054
|
+
const [visible, setVisible] = import_react11.default.useState(false);
|
|
3055
|
+
const boxRef = import_react11.default.useRef(null);
|
|
3056
|
+
import_react11.default.useEffect(() => {
|
|
2957
3057
|
if (isOpen) {
|
|
2958
3058
|
setMounted(true);
|
|
2959
3059
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -2967,12 +3067,12 @@ var Modal = (props) => {
|
|
|
2967
3067
|
if (!mounted) return null;
|
|
2968
3068
|
const stateClass = visible ? "enter" : "exit";
|
|
2969
3069
|
return (0, import_react_dom2.createPortal)(
|
|
2970
|
-
/* @__PURE__ */ (0,
|
|
3070
|
+
/* @__PURE__ */ (0, import_jsx_runtime313.jsx)(
|
|
2971
3071
|
"div",
|
|
2972
3072
|
{
|
|
2973
3073
|
className: clsx_default("lib-xplat-modal", "dim", stateClass),
|
|
2974
3074
|
onClick: onClose,
|
|
2975
|
-
children: /* @__PURE__ */ (0,
|
|
3075
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(
|
|
2976
3076
|
"div",
|
|
2977
3077
|
{
|
|
2978
3078
|
ref: boxRef,
|
|
@@ -2980,7 +3080,7 @@ var Modal = (props) => {
|
|
|
2980
3080
|
role: "dialog",
|
|
2981
3081
|
"aria-modal": "true",
|
|
2982
3082
|
onClick: (e) => e.stopPropagation(),
|
|
2983
|
-
children: /* @__PURE__ */ (0,
|
|
3083
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(PortalProvider, { container: boxRef.current, children })
|
|
2984
3084
|
}
|
|
2985
3085
|
)
|
|
2986
3086
|
}
|
|
@@ -2992,9 +3092,9 @@ Modal.displayName = "Modal";
|
|
|
2992
3092
|
var Modal_default = Modal;
|
|
2993
3093
|
|
|
2994
3094
|
// src/components/DatePicker/SingleDatePicker/index.tsx
|
|
2995
|
-
var
|
|
2996
|
-
var
|
|
2997
|
-
var DayCell2 =
|
|
3095
|
+
var import_react12 = __toESM(require("react"), 1);
|
|
3096
|
+
var import_jsx_runtime314 = require("react/jsx-runtime");
|
|
3097
|
+
var DayCell2 = import_react12.default.memo(
|
|
2998
3098
|
({
|
|
2999
3099
|
day,
|
|
3000
3100
|
disabled,
|
|
@@ -3004,7 +3104,7 @@ var DayCell2 = import_react11.default.memo(
|
|
|
3004
3104
|
isEnd,
|
|
3005
3105
|
inRange,
|
|
3006
3106
|
onSelect
|
|
3007
|
-
}) => /* @__PURE__ */ (0,
|
|
3107
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
3008
3108
|
"button",
|
|
3009
3109
|
{
|
|
3010
3110
|
type: "button",
|
|
@@ -3046,26 +3146,26 @@ var SingleDatePicker = (props) => {
|
|
|
3046
3146
|
initialYear,
|
|
3047
3147
|
initialMonth
|
|
3048
3148
|
);
|
|
3049
|
-
const [pickerMode, setPickerMode] =
|
|
3050
|
-
const [yearRangeStart, setYearRangeStart] =
|
|
3149
|
+
const [pickerMode, setPickerMode] = import_react12.default.useState("days");
|
|
3150
|
+
const [yearRangeStart, setYearRangeStart] = import_react12.default.useState(
|
|
3051
3151
|
Math.floor((initialYear ?? (/* @__PURE__ */ new Date()).getFullYear()) / 12) * 12
|
|
3052
3152
|
);
|
|
3053
|
-
const minTime =
|
|
3153
|
+
const minTime = import_react12.default.useMemo(
|
|
3054
3154
|
() => minDate ? new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()).getTime() : -Infinity,
|
|
3055
3155
|
[minDate]
|
|
3056
3156
|
);
|
|
3057
|
-
const maxTime =
|
|
3157
|
+
const maxTime = import_react12.default.useMemo(
|
|
3058
3158
|
() => maxDate ? new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()).getTime() : Infinity,
|
|
3059
3159
|
[maxDate]
|
|
3060
3160
|
);
|
|
3061
|
-
const highlightSet =
|
|
3161
|
+
const highlightSet = import_react12.default.useMemo(() => {
|
|
3062
3162
|
const set = /* @__PURE__ */ new Set();
|
|
3063
3163
|
for (const h of highlightDates) {
|
|
3064
3164
|
set.add(`${h.getFullYear()}-${h.getMonth()}-${h.getDate()}`);
|
|
3065
3165
|
}
|
|
3066
3166
|
return set;
|
|
3067
3167
|
}, [highlightDates]);
|
|
3068
|
-
const handleSelect =
|
|
3168
|
+
const handleSelect = import_react12.default.useCallback(
|
|
3069
3169
|
(date) => {
|
|
3070
3170
|
onChange?.(date);
|
|
3071
3171
|
},
|
|
@@ -3102,20 +3202,20 @@ var SingleDatePicker = (props) => {
|
|
|
3102
3202
|
const monthLabels = MONTH_LABELS[locale];
|
|
3103
3203
|
const titleText = pickerMode === "days" ? locale === "ko" ? `${year}\uB144 ${monthLabels[month]}` : `${monthLabels[month]} ${year}` : pickerMode === "months" ? `${year}` : `${yearRangeStart} - ${yearRangeStart + 11}`;
|
|
3104
3204
|
const hasRange = rangeStart != null && rangeEnd != null;
|
|
3105
|
-
return /* @__PURE__ */ (0,
|
|
3205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime314.jsxs)(
|
|
3106
3206
|
"div",
|
|
3107
3207
|
{
|
|
3108
3208
|
className: clsx_default("lib-xplat-datepicker", "single"),
|
|
3109
3209
|
children: [
|
|
3110
|
-
/* @__PURE__ */ (0,
|
|
3111
|
-
/* @__PURE__ */ (0,
|
|
3112
|
-
/* @__PURE__ */ (0,
|
|
3113
|
-
/* @__PURE__ */ (0,
|
|
3210
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsxs)("div", { className: "datepicker-header", children: [
|
|
3211
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)("button", { className: "datepicker-nav", onClick: handlePrev, type: "button", children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(ChevronLeftIcon_default, {}) }),
|
|
3212
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)("button", { className: "datepicker-title", onClick: handleTitleClick, type: "button", children: titleText }),
|
|
3213
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)("button", { className: "datepicker-nav", onClick: handleNext, type: "button", children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(ChevronRightIcon_default, {}) })
|
|
3114
3214
|
] }),
|
|
3115
|
-
/* @__PURE__ */ (0,
|
|
3116
|
-
pickerMode === "years" && /* @__PURE__ */ (0,
|
|
3215
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsxs)("div", { className: "datepicker-body", children: [
|
|
3216
|
+
pickerMode === "years" && /* @__PURE__ */ (0, import_jsx_runtime314.jsx)("div", { className: "datepicker-picker-grid", children: Array.from({ length: 12 }, (_, i) => {
|
|
3117
3217
|
const y = yearRangeStart + i;
|
|
3118
|
-
return /* @__PURE__ */ (0,
|
|
3218
|
+
return /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
3119
3219
|
"button",
|
|
3120
3220
|
{
|
|
3121
3221
|
type: "button",
|
|
@@ -3126,7 +3226,7 @@ var SingleDatePicker = (props) => {
|
|
|
3126
3226
|
y
|
|
3127
3227
|
);
|
|
3128
3228
|
}) }),
|
|
3129
|
-
pickerMode === "months" && /* @__PURE__ */ (0,
|
|
3229
|
+
pickerMode === "months" && /* @__PURE__ */ (0, import_jsx_runtime314.jsx)("div", { className: "datepicker-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
3130
3230
|
"button",
|
|
3131
3231
|
{
|
|
3132
3232
|
type: "button",
|
|
@@ -3136,8 +3236,8 @@ var SingleDatePicker = (props) => {
|
|
|
3136
3236
|
},
|
|
3137
3237
|
i
|
|
3138
3238
|
)) }),
|
|
3139
|
-
pickerMode === "days" && /* @__PURE__ */ (0,
|
|
3140
|
-
/* @__PURE__ */ (0,
|
|
3239
|
+
pickerMode === "days" && /* @__PURE__ */ (0, import_jsx_runtime314.jsxs)(import_jsx_runtime314.Fragment, { children: [
|
|
3240
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)("div", { className: "datepicker-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
3141
3241
|
"div",
|
|
3142
3242
|
{
|
|
3143
3243
|
className: clsx_default(
|
|
@@ -3149,7 +3249,7 @@ var SingleDatePicker = (props) => {
|
|
|
3149
3249
|
},
|
|
3150
3250
|
label
|
|
3151
3251
|
)) }),
|
|
3152
|
-
/* @__PURE__ */ (0,
|
|
3252
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)("div", { className: "datepicker-grid", children: days.map((day, idx) => {
|
|
3153
3253
|
const t = day.date.getTime();
|
|
3154
3254
|
const disabled = t < minTime || t > maxTime;
|
|
3155
3255
|
const selected = value ? isSameDay(day.date, value) : false;
|
|
@@ -3159,7 +3259,7 @@ var SingleDatePicker = (props) => {
|
|
|
3159
3259
|
const isStart = hasRange ? isSameDay(day.date, rangeStart) : false;
|
|
3160
3260
|
const isEnd = hasRange ? isSameDay(day.date, rangeEnd) : false;
|
|
3161
3261
|
const inRangeVal = hasRange ? isInRange(day.date, rangeStart, rangeEnd) : false;
|
|
3162
|
-
return /* @__PURE__ */ (0,
|
|
3262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
3163
3263
|
DayCell2,
|
|
3164
3264
|
{
|
|
3165
3265
|
day,
|
|
@@ -3184,7 +3284,7 @@ SingleDatePicker.displayName = "SingleDatePicker";
|
|
|
3184
3284
|
var SingleDatePicker_default = SingleDatePicker;
|
|
3185
3285
|
|
|
3186
3286
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
3187
|
-
var
|
|
3287
|
+
var import_jsx_runtime315 = require("react/jsx-runtime");
|
|
3188
3288
|
var formatDate = (date) => {
|
|
3189
3289
|
if (!date || !(date instanceof Date) || isNaN(date.getTime())) return "";
|
|
3190
3290
|
const y = date.getFullYear();
|
|
@@ -3194,8 +3294,8 @@ var formatDate = (date) => {
|
|
|
3194
3294
|
};
|
|
3195
3295
|
var InputDatePicker = (props) => {
|
|
3196
3296
|
const { value, onChange, minDate, maxDate, disabled, locale = "ko", placeholder } = props;
|
|
3197
|
-
const [isOpen, setIsOpen] =
|
|
3198
|
-
const [tempDate, setTempDate] =
|
|
3297
|
+
const [isOpen, setIsOpen] = import_react13.default.useState(false);
|
|
3298
|
+
const [tempDate, setTempDate] = import_react13.default.useState(value ?? /* @__PURE__ */ new Date());
|
|
3199
3299
|
const handleOpen = () => {
|
|
3200
3300
|
if (disabled) return;
|
|
3201
3301
|
setTempDate(value ?? /* @__PURE__ */ new Date());
|
|
@@ -3211,19 +3311,19 @@ var InputDatePicker = (props) => {
|
|
|
3211
3311
|
const handleClose = () => {
|
|
3212
3312
|
setIsOpen(false);
|
|
3213
3313
|
};
|
|
3214
|
-
return /* @__PURE__ */ (0,
|
|
3215
|
-
/* @__PURE__ */ (0,
|
|
3314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime315.jsxs)("div", { className: clsx_default("lib-xplat-datepicker input-datepicker", disabled && "disabled"), children: [
|
|
3315
|
+
/* @__PURE__ */ (0, import_jsx_runtime315.jsx)("div", { className: "input-datepicker-trigger", onClick: handleOpen, children: /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(
|
|
3216
3316
|
Input_default,
|
|
3217
3317
|
{
|
|
3218
3318
|
value: formatDate(value),
|
|
3219
3319
|
placeholder,
|
|
3220
|
-
suffix: /* @__PURE__ */ (0,
|
|
3320
|
+
suffix: /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(CalenderIcon_default, {}),
|
|
3221
3321
|
disabled,
|
|
3222
3322
|
readOnly: true
|
|
3223
3323
|
}
|
|
3224
3324
|
) }),
|
|
3225
|
-
/* @__PURE__ */ (0,
|
|
3226
|
-
/* @__PURE__ */ (0,
|
|
3325
|
+
/* @__PURE__ */ (0, import_jsx_runtime315.jsx)(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ (0, import_jsx_runtime315.jsxs)("div", { className: "lib-xplat-popup-datepicker-card", children: [
|
|
3326
|
+
/* @__PURE__ */ (0, import_jsx_runtime315.jsx)("div", { className: "popup-datepicker-content", children: /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(
|
|
3227
3327
|
SingleDatePicker_default,
|
|
3228
3328
|
{
|
|
3229
3329
|
value: tempDate,
|
|
@@ -3233,9 +3333,9 @@ var InputDatePicker = (props) => {
|
|
|
3233
3333
|
locale
|
|
3234
3334
|
}
|
|
3235
3335
|
) }),
|
|
3236
|
-
/* @__PURE__ */ (0,
|
|
3237
|
-
/* @__PURE__ */ (0,
|
|
3238
|
-
/* @__PURE__ */ (0,
|
|
3336
|
+
/* @__PURE__ */ (0, import_jsx_runtime315.jsxs)("div", { className: "popup-datepicker-footer", children: [
|
|
3337
|
+
/* @__PURE__ */ (0, import_jsx_runtime315.jsx)(Button_default, { type: "secondary", onClick: handleClose, children: locale === "ko" ? "\uCDE8\uC18C" : "Cancel" }),
|
|
3338
|
+
/* @__PURE__ */ (0, import_jsx_runtime315.jsx)(Button_default, { type: "primary", onClick: handleApply, children: locale === "ko" ? "\uC801\uC6A9" : "Apply" })
|
|
3239
3339
|
] })
|
|
3240
3340
|
] }) })
|
|
3241
3341
|
] });
|
|
@@ -3244,20 +3344,20 @@ InputDatePicker.displayName = "InputDatePicker";
|
|
|
3244
3344
|
var InputDatePicker_default = InputDatePicker;
|
|
3245
3345
|
|
|
3246
3346
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
3247
|
-
var
|
|
3347
|
+
var import_react17 = __toESM(require("react"), 1);
|
|
3248
3348
|
|
|
3249
3349
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
3250
|
-
var
|
|
3350
|
+
var import_react16 = __toESM(require("react"), 1);
|
|
3251
3351
|
|
|
3252
3352
|
// src/components/Tab/Tab.tsx
|
|
3253
|
-
var
|
|
3353
|
+
var import_react15 = __toESM(require("react"), 1);
|
|
3254
3354
|
|
|
3255
3355
|
// src/components/Tab/TabItem.tsx
|
|
3256
|
-
var
|
|
3257
|
-
var
|
|
3258
|
-
var TabItem =
|
|
3356
|
+
var import_react14 = __toESM(require("react"), 1);
|
|
3357
|
+
var import_jsx_runtime316 = require("react/jsx-runtime");
|
|
3358
|
+
var TabItem = import_react14.default.forwardRef((props, ref) => {
|
|
3259
3359
|
const { isActive, title, onClick } = props;
|
|
3260
|
-
return /* @__PURE__ */ (0,
|
|
3360
|
+
return /* @__PURE__ */ (0, import_jsx_runtime316.jsx)(
|
|
3261
3361
|
"div",
|
|
3262
3362
|
{
|
|
3263
3363
|
ref,
|
|
@@ -3271,25 +3371,25 @@ TabItem.displayName = "TabItem";
|
|
|
3271
3371
|
var TabItem_default = TabItem;
|
|
3272
3372
|
|
|
3273
3373
|
// src/components/Tab/Tab.tsx
|
|
3274
|
-
var
|
|
3374
|
+
var import_jsx_runtime317 = require("react/jsx-runtime");
|
|
3275
3375
|
var Tab = (props) => {
|
|
3276
3376
|
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
3277
|
-
const [underlineStyle, setUnderlineStyle] =
|
|
3377
|
+
const [underlineStyle, setUnderlineStyle] = import_react15.default.useState({
|
|
3278
3378
|
left: 0,
|
|
3279
3379
|
width: 0
|
|
3280
3380
|
});
|
|
3281
|
-
const itemRefs =
|
|
3381
|
+
const itemRefs = import_react15.default.useRef([]);
|
|
3282
3382
|
const handleChangeActiveTab = (tabItem, tabIdx) => {
|
|
3283
3383
|
onChange(tabItem, tabIdx);
|
|
3284
3384
|
};
|
|
3285
|
-
|
|
3385
|
+
import_react15.default.useEffect(() => {
|
|
3286
3386
|
const el = itemRefs.current[activeIndex];
|
|
3287
3387
|
if (el) {
|
|
3288
3388
|
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
3289
3389
|
}
|
|
3290
3390
|
}, [activeIndex, tabs.length]);
|
|
3291
|
-
return /* @__PURE__ */ (0,
|
|
3292
|
-
tabs.map((tab, idx) => /* @__PURE__ */ (0,
|
|
3391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime317.jsxs)("div", { className: clsx_default("lib-xplat-tab", `type-${type}`, size), children: [
|
|
3392
|
+
tabs.map((tab, idx) => /* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
|
|
3293
3393
|
TabItem_default,
|
|
3294
3394
|
{
|
|
3295
3395
|
onClick: () => handleChangeActiveTab(tab, idx),
|
|
@@ -3301,7 +3401,7 @@ var Tab = (props) => {
|
|
|
3301
3401
|
},
|
|
3302
3402
|
`${tab.value}_${idx}`
|
|
3303
3403
|
)),
|
|
3304
|
-
type === "toggle" && /* @__PURE__ */ (0,
|
|
3404
|
+
type === "toggle" && /* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
|
|
3305
3405
|
"div",
|
|
3306
3406
|
{
|
|
3307
3407
|
className: "tab-toggle-underline",
|
|
@@ -3317,7 +3417,7 @@ Tab.displayName = "Tab";
|
|
|
3317
3417
|
var Tab_default = Tab;
|
|
3318
3418
|
|
|
3319
3419
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
3320
|
-
var
|
|
3420
|
+
var import_jsx_runtime318 = require("react/jsx-runtime");
|
|
3321
3421
|
var RangePicker = (props) => {
|
|
3322
3422
|
const {
|
|
3323
3423
|
startDate,
|
|
@@ -3327,7 +3427,7 @@ var RangePicker = (props) => {
|
|
|
3327
3427
|
maxDate,
|
|
3328
3428
|
locale = "ko"
|
|
3329
3429
|
} = props;
|
|
3330
|
-
const [activeTab, setActiveTab] =
|
|
3430
|
+
const [activeTab, setActiveTab] = import_react16.default.useState("start");
|
|
3331
3431
|
const handleStartChange = (date) => {
|
|
3332
3432
|
if (!date) return;
|
|
3333
3433
|
const newStart = date > endDate ? endDate : date;
|
|
@@ -3340,8 +3440,8 @@ var RangePicker = (props) => {
|
|
|
3340
3440
|
};
|
|
3341
3441
|
const startMaxDate = maxDate && endDate < maxDate ? endDate : endDate;
|
|
3342
3442
|
const endMinDate = minDate && startDate > minDate ? startDate : startDate;
|
|
3343
|
-
return /* @__PURE__ */ (0,
|
|
3344
|
-
/* @__PURE__ */ (0,
|
|
3443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime318.jsxs)("div", { className: clsx_default("lib-xplat-datepicker", "range"), children: [
|
|
3444
|
+
/* @__PURE__ */ (0, import_jsx_runtime318.jsx)("div", { className: "datepicker-range-tabs", children: /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
|
|
3345
3445
|
Tab_default,
|
|
3346
3446
|
{
|
|
3347
3447
|
activeIndex: activeTab === "start" ? 0 : 1,
|
|
@@ -3354,8 +3454,8 @@ var RangePicker = (props) => {
|
|
|
3354
3454
|
size: "sm"
|
|
3355
3455
|
}
|
|
3356
3456
|
) }),
|
|
3357
|
-
/* @__PURE__ */ (0,
|
|
3358
|
-
/* @__PURE__ */ (0,
|
|
3457
|
+
/* @__PURE__ */ (0, import_jsx_runtime318.jsxs)("div", { className: "datepicker-range-panels", children: [
|
|
3458
|
+
/* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
|
|
3359
3459
|
SingleDatePicker_default,
|
|
3360
3460
|
{
|
|
3361
3461
|
value: startDate,
|
|
@@ -3367,7 +3467,7 @@ var RangePicker = (props) => {
|
|
|
3367
3467
|
locale
|
|
3368
3468
|
}
|
|
3369
3469
|
),
|
|
3370
|
-
/* @__PURE__ */ (0,
|
|
3470
|
+
/* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
|
|
3371
3471
|
SingleDatePicker_default,
|
|
3372
3472
|
{
|
|
3373
3473
|
value: endDate,
|
|
@@ -3380,7 +3480,7 @@ var RangePicker = (props) => {
|
|
|
3380
3480
|
}
|
|
3381
3481
|
)
|
|
3382
3482
|
] }),
|
|
3383
|
-
/* @__PURE__ */ (0,
|
|
3483
|
+
/* @__PURE__ */ (0, import_jsx_runtime318.jsx)("div", { className: "datepicker-range-mobile", children: activeTab === "start" ? /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
|
|
3384
3484
|
SingleDatePicker_default,
|
|
3385
3485
|
{
|
|
3386
3486
|
value: startDate,
|
|
@@ -3391,7 +3491,7 @@ var RangePicker = (props) => {
|
|
|
3391
3491
|
rangeEnd: endDate,
|
|
3392
3492
|
locale
|
|
3393
3493
|
}
|
|
3394
|
-
) : /* @__PURE__ */ (0,
|
|
3494
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
|
|
3395
3495
|
SingleDatePicker_default,
|
|
3396
3496
|
{
|
|
3397
3497
|
value: endDate,
|
|
@@ -3409,10 +3509,10 @@ RangePicker.displayName = "RangePicker";
|
|
|
3409
3509
|
var RangePicker_default = RangePicker;
|
|
3410
3510
|
|
|
3411
3511
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
3412
|
-
var
|
|
3512
|
+
var import_jsx_runtime319 = require("react/jsx-runtime");
|
|
3413
3513
|
var PopupPicker = (props) => {
|
|
3414
3514
|
const { component, type, locale } = props;
|
|
3415
|
-
const [isOpen, setIsOpen] =
|
|
3515
|
+
const [isOpen, setIsOpen] = import_react17.default.useState(false);
|
|
3416
3516
|
const handleClick = () => setIsOpen(true);
|
|
3417
3517
|
const handleClose = () => setIsOpen(false);
|
|
3418
3518
|
const handleSingleChange = (date) => {
|
|
@@ -3420,11 +3520,11 @@ var PopupPicker = (props) => {
|
|
|
3420
3520
|
props.onChange?.(date);
|
|
3421
3521
|
handleClose();
|
|
3422
3522
|
};
|
|
3423
|
-
return /* @__PURE__ */ (0,
|
|
3424
|
-
|
|
3425
|
-
/* @__PURE__ */ (0,
|
|
3426
|
-
/* @__PURE__ */ (0,
|
|
3427
|
-
type === "single" && /* @__PURE__ */ (0,
|
|
3523
|
+
return /* @__PURE__ */ (0, import_jsx_runtime319.jsxs)("div", { className: "lib-xplat-popup-datepicker", children: [
|
|
3524
|
+
import_react17.default.cloneElement(component, { onClick: handleClick }),
|
|
3525
|
+
/* @__PURE__ */ (0, import_jsx_runtime319.jsx)(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ (0, import_jsx_runtime319.jsxs)("div", { className: clsx_default("lib-xplat-popup-datepicker-card", type === "range" && "range-mode"), children: [
|
|
3526
|
+
/* @__PURE__ */ (0, import_jsx_runtime319.jsxs)("div", { className: "popup-datepicker-content", children: [
|
|
3527
|
+
type === "single" && /* @__PURE__ */ (0, import_jsx_runtime319.jsx)(
|
|
3428
3528
|
SingleDatePicker_default,
|
|
3429
3529
|
{
|
|
3430
3530
|
value: props.value,
|
|
@@ -3434,7 +3534,7 @@ var PopupPicker = (props) => {
|
|
|
3434
3534
|
locale
|
|
3435
3535
|
}
|
|
3436
3536
|
),
|
|
3437
|
-
type === "range" && /* @__PURE__ */ (0,
|
|
3537
|
+
type === "range" && /* @__PURE__ */ (0, import_jsx_runtime319.jsx)(
|
|
3438
3538
|
RangePicker_default,
|
|
3439
3539
|
{
|
|
3440
3540
|
startDate: props.startDate,
|
|
@@ -3446,8 +3546,8 @@ var PopupPicker = (props) => {
|
|
|
3446
3546
|
}
|
|
3447
3547
|
)
|
|
3448
3548
|
] }),
|
|
3449
|
-
/* @__PURE__ */ (0,
|
|
3450
|
-
/* @__PURE__ */ (0,
|
|
3549
|
+
/* @__PURE__ */ (0, import_jsx_runtime319.jsxs)("div", { className: "popup-datepicker-footer", children: [
|
|
3550
|
+
/* @__PURE__ */ (0, import_jsx_runtime319.jsx)(
|
|
3451
3551
|
Button_default,
|
|
3452
3552
|
{
|
|
3453
3553
|
type: "secondary",
|
|
@@ -3455,7 +3555,7 @@ var PopupPicker = (props) => {
|
|
|
3455
3555
|
children: locale === "ko" ? "\uCDE8\uC18C" : "Cancel"
|
|
3456
3556
|
}
|
|
3457
3557
|
),
|
|
3458
|
-
/* @__PURE__ */ (0,
|
|
3558
|
+
/* @__PURE__ */ (0, import_jsx_runtime319.jsx)(Button_default, { type: "primary", onClick: handleClose, children: locale === "ko" ? "\uC801\uC6A9" : "Apply" })
|
|
3459
3559
|
] })
|
|
3460
3560
|
] }) })
|
|
3461
3561
|
] });
|
|
@@ -3464,10 +3564,10 @@ PopupPicker.displayName = "PopupPicker";
|
|
|
3464
3564
|
var PopupPicker_default = PopupPicker;
|
|
3465
3565
|
|
|
3466
3566
|
// src/components/Divider/Divider.tsx
|
|
3467
|
-
var
|
|
3567
|
+
var import_jsx_runtime320 = require("react/jsx-runtime");
|
|
3468
3568
|
var Divider = (props) => {
|
|
3469
3569
|
const { orientation = "horizontal" } = props;
|
|
3470
|
-
return /* @__PURE__ */ (0,
|
|
3570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(
|
|
3471
3571
|
"div",
|
|
3472
3572
|
{
|
|
3473
3573
|
className: clsx_default("lib-xplat-divider", orientation),
|
|
@@ -3480,15 +3580,15 @@ Divider.displayName = "Divider";
|
|
|
3480
3580
|
var Divider_default = Divider;
|
|
3481
3581
|
|
|
3482
3582
|
// src/components/Drawer/Drawer.tsx
|
|
3483
|
-
var
|
|
3583
|
+
var import_react18 = __toESM(require("react"), 1);
|
|
3484
3584
|
var import_react_dom3 = require("react-dom");
|
|
3485
|
-
var
|
|
3585
|
+
var import_jsx_runtime321 = require("react/jsx-runtime");
|
|
3486
3586
|
var ANIMATION_DURATION_MS2 = 250;
|
|
3487
3587
|
var Drawer = (props) => {
|
|
3488
3588
|
const { isOpen, onClose, placement = "right", size = "md", title, children } = props;
|
|
3489
|
-
const [mounted, setMounted] =
|
|
3490
|
-
const [visible, setVisible] =
|
|
3491
|
-
|
|
3589
|
+
const [mounted, setMounted] = import_react18.default.useState(false);
|
|
3590
|
+
const [visible, setVisible] = import_react18.default.useState(false);
|
|
3591
|
+
import_react18.default.useEffect(() => {
|
|
3492
3592
|
if (isOpen) {
|
|
3493
3593
|
setMounted(true);
|
|
3494
3594
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -3502,12 +3602,12 @@ var Drawer = (props) => {
|
|
|
3502
3602
|
if (!mounted) return null;
|
|
3503
3603
|
const stateClass = visible ? "enter" : "exit";
|
|
3504
3604
|
return (0, import_react_dom3.createPortal)(
|
|
3505
|
-
/* @__PURE__ */ (0,
|
|
3605
|
+
/* @__PURE__ */ (0, import_jsx_runtime321.jsx)(
|
|
3506
3606
|
"div",
|
|
3507
3607
|
{
|
|
3508
3608
|
className: clsx_default("lib-xplat-drawer-overlay", stateClass),
|
|
3509
3609
|
onClick: onClose,
|
|
3510
|
-
children: /* @__PURE__ */ (0,
|
|
3610
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime321.jsxs)(
|
|
3511
3611
|
"div",
|
|
3512
3612
|
{
|
|
3513
3613
|
className: clsx_default("lib-xplat-drawer", placement, size, stateClass),
|
|
@@ -3515,11 +3615,11 @@ var Drawer = (props) => {
|
|
|
3515
3615
|
"aria-modal": "true",
|
|
3516
3616
|
onClick: (e) => e.stopPropagation(),
|
|
3517
3617
|
children: [
|
|
3518
|
-
title && /* @__PURE__ */ (0,
|
|
3519
|
-
/* @__PURE__ */ (0,
|
|
3520
|
-
/* @__PURE__ */ (0,
|
|
3618
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime321.jsxs)("div", { className: "drawer-header", children: [
|
|
3619
|
+
/* @__PURE__ */ (0, import_jsx_runtime321.jsx)("span", { className: "drawer-title", children: title }),
|
|
3620
|
+
/* @__PURE__ */ (0, import_jsx_runtime321.jsx)("button", { className: "close-btn", onClick: onClose, "aria-label": "\uB2EB\uAE30", children: "\xD7" })
|
|
3521
3621
|
] }),
|
|
3522
|
-
/* @__PURE__ */ (0,
|
|
3622
|
+
/* @__PURE__ */ (0, import_jsx_runtime321.jsx)("div", { className: "drawer-body", children })
|
|
3523
3623
|
]
|
|
3524
3624
|
}
|
|
3525
3625
|
)
|
|
@@ -3532,16 +3632,16 @@ Drawer.displayName = "Drawer";
|
|
|
3532
3632
|
var Drawer_default = Drawer;
|
|
3533
3633
|
|
|
3534
3634
|
// src/components/Dropdown/Dropdown.tsx
|
|
3535
|
-
var
|
|
3635
|
+
var import_react21 = __toESM(require("react"), 1);
|
|
3536
3636
|
|
|
3537
3637
|
// src/tokens/hooks/useAutoPosition.ts
|
|
3538
|
-
var
|
|
3638
|
+
var import_react19 = __toESM(require("react"), 1);
|
|
3539
3639
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
3540
|
-
const [position, setPosition] =
|
|
3640
|
+
const [position, setPosition] = import_react19.default.useState({
|
|
3541
3641
|
position: {},
|
|
3542
3642
|
direction: "bottom"
|
|
3543
3643
|
});
|
|
3544
|
-
const calculatePosition =
|
|
3644
|
+
const calculatePosition = import_react19.default.useCallback(() => {
|
|
3545
3645
|
if (!triggerRef.current || !popRef.current) return;
|
|
3546
3646
|
const triggerRect = triggerRef.current.getBoundingClientRect();
|
|
3547
3647
|
const popW = popRef.current.offsetWidth;
|
|
@@ -3568,13 +3668,13 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
3568
3668
|
direction
|
|
3569
3669
|
});
|
|
3570
3670
|
}, [triggerRef, popRef]);
|
|
3571
|
-
|
|
3671
|
+
import_react19.default.useLayoutEffect(() => {
|
|
3572
3672
|
if (!enabled) return;
|
|
3573
3673
|
calculatePosition();
|
|
3574
3674
|
const raf = requestAnimationFrame(calculatePosition);
|
|
3575
3675
|
return () => cancelAnimationFrame(raf);
|
|
3576
3676
|
}, [calculatePosition, enabled]);
|
|
3577
|
-
|
|
3677
|
+
import_react19.default.useEffect(() => {
|
|
3578
3678
|
if (!enabled || !popRef.current) return;
|
|
3579
3679
|
const observer = new ResizeObserver(() => {
|
|
3580
3680
|
calculatePosition();
|
|
@@ -3582,7 +3682,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
3582
3682
|
observer.observe(popRef.current);
|
|
3583
3683
|
return () => observer.disconnect();
|
|
3584
3684
|
}, [calculatePosition, enabled, popRef]);
|
|
3585
|
-
|
|
3685
|
+
import_react19.default.useEffect(() => {
|
|
3586
3686
|
if (!enabled) return;
|
|
3587
3687
|
window.addEventListener("resize", calculatePosition);
|
|
3588
3688
|
window.addEventListener("scroll", calculatePosition, true);
|
|
@@ -3596,9 +3696,9 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
3596
3696
|
var useAutoPosition_default = useAutoPosition;
|
|
3597
3697
|
|
|
3598
3698
|
// src/tokens/hooks/useClickOutside.ts
|
|
3599
|
-
var
|
|
3699
|
+
var import_react20 = __toESM(require("react"), 1);
|
|
3600
3700
|
var useClickOutside = (refs, handler, enabled = true) => {
|
|
3601
|
-
|
|
3701
|
+
import_react20.default.useEffect(() => {
|
|
3602
3702
|
if (!enabled) return;
|
|
3603
3703
|
const refArray = Array.isArray(refs) ? refs : [refs];
|
|
3604
3704
|
const listener = (event) => {
|
|
@@ -3621,17 +3721,17 @@ var useClickOutside = (refs, handler, enabled = true) => {
|
|
|
3621
3721
|
var useClickOutside_default = useClickOutside;
|
|
3622
3722
|
|
|
3623
3723
|
// src/components/Dropdown/Dropdown.tsx
|
|
3624
|
-
var
|
|
3724
|
+
var import_jsx_runtime322 = require("react/jsx-runtime");
|
|
3625
3725
|
var Dropdown = (props) => {
|
|
3626
3726
|
const { items, children } = props;
|
|
3627
|
-
const [isOpen, setIsOpen] =
|
|
3628
|
-
const [mounted, setMounted] =
|
|
3629
|
-
const [visible, setVisible] =
|
|
3630
|
-
const triggerRef =
|
|
3631
|
-
const menuRef =
|
|
3727
|
+
const [isOpen, setIsOpen] = import_react21.default.useState(false);
|
|
3728
|
+
const [mounted, setMounted] = import_react21.default.useState(false);
|
|
3729
|
+
const [visible, setVisible] = import_react21.default.useState(false);
|
|
3730
|
+
const triggerRef = import_react21.default.useRef(null);
|
|
3731
|
+
const menuRef = import_react21.default.useRef(null);
|
|
3632
3732
|
const { position, direction } = useAutoPosition_default(triggerRef, menuRef, mounted);
|
|
3633
3733
|
useClickOutside_default([triggerRef, menuRef], () => setIsOpen(false), isOpen);
|
|
3634
|
-
|
|
3734
|
+
import_react21.default.useEffect(() => {
|
|
3635
3735
|
if (isOpen) {
|
|
3636
3736
|
setMounted(true);
|
|
3637
3737
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -3646,8 +3746,8 @@ var Dropdown = (props) => {
|
|
|
3646
3746
|
item.onClick?.();
|
|
3647
3747
|
setIsOpen(false);
|
|
3648
3748
|
};
|
|
3649
|
-
return /* @__PURE__ */ (0,
|
|
3650
|
-
/* @__PURE__ */ (0,
|
|
3749
|
+
return /* @__PURE__ */ (0, import_jsx_runtime322.jsxs)("div", { className: "lib-xplat-dropdown", children: [
|
|
3750
|
+
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)(
|
|
3651
3751
|
"div",
|
|
3652
3752
|
{
|
|
3653
3753
|
ref: triggerRef,
|
|
@@ -3656,14 +3756,14 @@ var Dropdown = (props) => {
|
|
|
3656
3756
|
children
|
|
3657
3757
|
}
|
|
3658
3758
|
),
|
|
3659
|
-
mounted && /* @__PURE__ */ (0,
|
|
3759
|
+
mounted && /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(
|
|
3660
3760
|
"div",
|
|
3661
3761
|
{
|
|
3662
3762
|
ref: menuRef,
|
|
3663
3763
|
className: clsx_default("lib-xplat-dropdown-menu", direction, { visible }),
|
|
3664
3764
|
style: { top: position.top, left: position.left },
|
|
3665
3765
|
role: "menu",
|
|
3666
|
-
children: items.map((item) => /* @__PURE__ */ (0,
|
|
3766
|
+
children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(
|
|
3667
3767
|
"button",
|
|
3668
3768
|
{
|
|
3669
3769
|
className: clsx_default("dropdown-item", {
|
|
@@ -3685,23 +3785,23 @@ Dropdown.displayName = "Dropdown";
|
|
|
3685
3785
|
var Dropdown_default = Dropdown;
|
|
3686
3786
|
|
|
3687
3787
|
// src/components/EmptyState/EmptyState.tsx
|
|
3688
|
-
var
|
|
3788
|
+
var import_jsx_runtime323 = require("react/jsx-runtime");
|
|
3689
3789
|
var EmptyState = (props) => {
|
|
3690
3790
|
const { icon, title = "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4", description, action } = props;
|
|
3691
|
-
return /* @__PURE__ */ (0,
|
|
3692
|
-
icon && /* @__PURE__ */ (0,
|
|
3693
|
-
!icon && /* @__PURE__ */ (0,
|
|
3694
|
-
/* @__PURE__ */ (0,
|
|
3695
|
-
description && /* @__PURE__ */ (0,
|
|
3696
|
-
action && /* @__PURE__ */ (0,
|
|
3791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime323.jsxs)("div", { className: "lib-xplat-empty-state", children: [
|
|
3792
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime323.jsx)("div", { className: "empty-icon", children: icon }),
|
|
3793
|
+
!icon && /* @__PURE__ */ (0, import_jsx_runtime323.jsx)("div", { className: "empty-icon", children: /* @__PURE__ */ (0, import_jsx_runtime323.jsx)("svg", { viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime323.jsx)("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" }) }) }),
|
|
3794
|
+
/* @__PURE__ */ (0, import_jsx_runtime323.jsx)("p", { className: "empty-title", children: title }),
|
|
3795
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime323.jsx)("p", { className: "empty-description", children: description }),
|
|
3796
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime323.jsx)("div", { className: "empty-action", children: action })
|
|
3697
3797
|
] });
|
|
3698
3798
|
};
|
|
3699
3799
|
EmptyState.displayName = "EmptyState";
|
|
3700
3800
|
var EmptyState_default = EmptyState;
|
|
3701
3801
|
|
|
3702
3802
|
// src/components/FileUpload/FileUpload.tsx
|
|
3703
|
-
var
|
|
3704
|
-
var
|
|
3803
|
+
var import_react22 = __toESM(require("react"), 1);
|
|
3804
|
+
var import_jsx_runtime324 = require("react/jsx-runtime");
|
|
3705
3805
|
var FileUpload = (props) => {
|
|
3706
3806
|
const {
|
|
3707
3807
|
accept,
|
|
@@ -3711,8 +3811,8 @@ var FileUpload = (props) => {
|
|
|
3711
3811
|
label = "\uD30C\uC77C\uC744 \uB4DC\uB798\uADF8\uD558\uAC70\uB098 \uD074\uB9AD\uD558\uC5EC \uC5C5\uB85C\uB4DC",
|
|
3712
3812
|
description
|
|
3713
3813
|
} = props;
|
|
3714
|
-
const [isDragOver, setIsDragOver] =
|
|
3715
|
-
const inputRef =
|
|
3814
|
+
const [isDragOver, setIsDragOver] = import_react22.default.useState(false);
|
|
3815
|
+
const inputRef = import_react22.default.useRef(null);
|
|
3716
3816
|
const handleFiles = (fileList) => {
|
|
3717
3817
|
let files = Array.from(fileList);
|
|
3718
3818
|
if (maxSize) {
|
|
@@ -3742,7 +3842,7 @@ var FileUpload = (props) => {
|
|
|
3742
3842
|
handleFiles(e.target.files);
|
|
3743
3843
|
}
|
|
3744
3844
|
};
|
|
3745
|
-
return /* @__PURE__ */ (0,
|
|
3845
|
+
return /* @__PURE__ */ (0, import_jsx_runtime324.jsxs)(
|
|
3746
3846
|
"div",
|
|
3747
3847
|
{
|
|
3748
3848
|
className: clsx_default("lib-xplat-file-upload", { "drag-over": isDragOver }),
|
|
@@ -3751,7 +3851,7 @@ var FileUpload = (props) => {
|
|
|
3751
3851
|
onDragLeave: handleDragLeave,
|
|
3752
3852
|
onClick: () => inputRef.current?.click(),
|
|
3753
3853
|
children: [
|
|
3754
|
-
/* @__PURE__ */ (0,
|
|
3854
|
+
/* @__PURE__ */ (0, import_jsx_runtime324.jsx)(
|
|
3755
3855
|
"input",
|
|
3756
3856
|
{
|
|
3757
3857
|
ref: inputRef,
|
|
@@ -3761,9 +3861,9 @@ var FileUpload = (props) => {
|
|
|
3761
3861
|
onChange: handleChange
|
|
3762
3862
|
}
|
|
3763
3863
|
),
|
|
3764
|
-
/* @__PURE__ */ (0,
|
|
3765
|
-
/* @__PURE__ */ (0,
|
|
3766
|
-
description && /* @__PURE__ */ (0,
|
|
3864
|
+
/* @__PURE__ */ (0, import_jsx_runtime324.jsx)("div", { className: "upload-icon", children: /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(UploadIcon_default, {}) }),
|
|
3865
|
+
/* @__PURE__ */ (0, import_jsx_runtime324.jsx)("p", { className: "upload-label", children: label }),
|
|
3866
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime324.jsx)("p", { className: "upload-description", children: description })
|
|
3767
3867
|
]
|
|
3768
3868
|
}
|
|
3769
3869
|
);
|
|
@@ -3772,10 +3872,10 @@ FileUpload.displayName = "FileUpload";
|
|
|
3772
3872
|
var FileUpload_default = FileUpload;
|
|
3773
3873
|
|
|
3774
3874
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
3775
|
-
var
|
|
3875
|
+
var import_react24 = __toESM(require("react"), 1);
|
|
3776
3876
|
|
|
3777
3877
|
// src/components/HtmlTypeWriter/utils.ts
|
|
3778
|
-
var
|
|
3878
|
+
var import_react23 = __toESM(require("react"), 1);
|
|
3779
3879
|
var voidTags = /* @__PURE__ */ new Set([
|
|
3780
3880
|
"br",
|
|
3781
3881
|
"img",
|
|
@@ -3843,41 +3943,41 @@ var convertNodeToReactWithRange = (node, typedLen, rangeMap) => {
|
|
|
3843
3943
|
props[attr.name] = attr.value;
|
|
3844
3944
|
});
|
|
3845
3945
|
if (voidTags.has(tag)) {
|
|
3846
|
-
return
|
|
3946
|
+
return import_react23.default.createElement(tag, props);
|
|
3847
3947
|
}
|
|
3848
3948
|
const children = Array.from(element.childNodes).map((child) => convertNodeToReactWithRange(child, typedLen, rangeMap)).filter((n) => n != null);
|
|
3849
|
-
return
|
|
3949
|
+
return import_react23.default.createElement(tag, props, ...children);
|
|
3850
3950
|
};
|
|
3851
3951
|
var htmlToReactProgressive = (root, typedLen, rangeMap) => {
|
|
3852
3952
|
const nodes = Array.from(root.childNodes).map((child, idx) => {
|
|
3853
3953
|
const node = convertNodeToReactWithRange(child, typedLen, rangeMap);
|
|
3854
|
-
return node == null ? null :
|
|
3954
|
+
return node == null ? null : import_react23.default.createElement(import_react23.default.Fragment, { key: idx }, node);
|
|
3855
3955
|
}).filter(Boolean);
|
|
3856
3956
|
return nodes.length === 0 ? null : nodes;
|
|
3857
3957
|
};
|
|
3858
3958
|
|
|
3859
3959
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
3860
|
-
var
|
|
3960
|
+
var import_jsx_runtime325 = require("react/jsx-runtime");
|
|
3861
3961
|
var HtmlTypeWriter = ({
|
|
3862
3962
|
html,
|
|
3863
3963
|
duration = 20,
|
|
3864
3964
|
onDone,
|
|
3865
3965
|
onChange
|
|
3866
3966
|
}) => {
|
|
3867
|
-
const [typedLen, setTypedLen] =
|
|
3868
|
-
const doneCalledRef =
|
|
3869
|
-
const { doc, rangeMap, totalLength } =
|
|
3967
|
+
const [typedLen, setTypedLen] = import_react24.default.useState(0);
|
|
3968
|
+
const doneCalledRef = import_react24.default.useRef(false);
|
|
3969
|
+
const { doc, rangeMap, totalLength } = import_react24.default.useMemo(() => {
|
|
3870
3970
|
if (typeof window === "undefined") return { doc: null, rangeMap: /* @__PURE__ */ new Map(), totalLength: 0 };
|
|
3871
3971
|
const decoded = decodeHtmlEntities(html);
|
|
3872
3972
|
const doc2 = new DOMParser().parseFromString(decoded, "text/html");
|
|
3873
3973
|
const { rangeMap: rangeMap2, totalLength: totalLength2 } = buildRangeMap(doc2.body);
|
|
3874
3974
|
return { doc: doc2, rangeMap: rangeMap2, totalLength: totalLength2 };
|
|
3875
3975
|
}, [html]);
|
|
3876
|
-
|
|
3976
|
+
import_react24.default.useEffect(() => {
|
|
3877
3977
|
setTypedLen(0);
|
|
3878
3978
|
doneCalledRef.current = false;
|
|
3879
3979
|
}, [html]);
|
|
3880
|
-
|
|
3980
|
+
import_react24.default.useEffect(() => {
|
|
3881
3981
|
if (!totalLength) return;
|
|
3882
3982
|
if (typedLen >= totalLength) return;
|
|
3883
3983
|
const timer = window.setInterval(() => {
|
|
@@ -3885,33 +3985,33 @@ var HtmlTypeWriter = ({
|
|
|
3885
3985
|
}, duration);
|
|
3886
3986
|
return () => window.clearInterval(timer);
|
|
3887
3987
|
}, [typedLen, totalLength, duration]);
|
|
3888
|
-
|
|
3988
|
+
import_react24.default.useEffect(() => {
|
|
3889
3989
|
if (typedLen > 0 && typedLen < totalLength) {
|
|
3890
3990
|
onChange?.();
|
|
3891
3991
|
}
|
|
3892
3992
|
}, [typedLen, totalLength, onChange]);
|
|
3893
|
-
|
|
3993
|
+
import_react24.default.useEffect(() => {
|
|
3894
3994
|
if (typedLen === totalLength && totalLength > 0 && !doneCalledRef.current) {
|
|
3895
3995
|
doneCalledRef.current = true;
|
|
3896
3996
|
onDone?.();
|
|
3897
3997
|
}
|
|
3898
3998
|
}, [typedLen, totalLength, onDone]);
|
|
3899
|
-
const parsed =
|
|
3999
|
+
const parsed = import_react24.default.useMemo(
|
|
3900
4000
|
() => doc ? htmlToReactProgressive(doc.body, typedLen, rangeMap) : null,
|
|
3901
4001
|
[doc, typedLen, rangeMap]
|
|
3902
4002
|
);
|
|
3903
|
-
return /* @__PURE__ */ (0,
|
|
4003
|
+
return /* @__PURE__ */ (0, import_jsx_runtime325.jsx)("div", { className: "lib-xplat-htmlTypewriter", children: parsed });
|
|
3904
4004
|
};
|
|
3905
4005
|
HtmlTypeWriter.displayName = "HtmlTypeWriter";
|
|
3906
4006
|
var HtmlTypeWriter_default = HtmlTypeWriter;
|
|
3907
4007
|
|
|
3908
4008
|
// src/components/ImageSelector/ImageSelector.tsx
|
|
3909
|
-
var
|
|
3910
|
-
var
|
|
4009
|
+
var import_react25 = __toESM(require("react"), 1);
|
|
4010
|
+
var import_jsx_runtime326 = require("react/jsx-runtime");
|
|
3911
4011
|
var ImageSelector = (props) => {
|
|
3912
4012
|
const { value, label, onChange } = props;
|
|
3913
|
-
const [previewUrl, setPreviewUrl] =
|
|
3914
|
-
|
|
4013
|
+
const [previewUrl, setPreviewUrl] = import_react25.default.useState();
|
|
4014
|
+
import_react25.default.useEffect(() => {
|
|
3915
4015
|
if (!value) {
|
|
3916
4016
|
setPreviewUrl(void 0);
|
|
3917
4017
|
return;
|
|
@@ -3920,7 +4020,7 @@ var ImageSelector = (props) => {
|
|
|
3920
4020
|
setPreviewUrl(url);
|
|
3921
4021
|
return () => URL.revokeObjectURL(url);
|
|
3922
4022
|
}, [value]);
|
|
3923
|
-
const inputRef =
|
|
4023
|
+
const inputRef = import_react25.default.useRef(null);
|
|
3924
4024
|
const handleFileChange = (e) => {
|
|
3925
4025
|
const selectedFile = e.target.files?.[0];
|
|
3926
4026
|
if (selectedFile) {
|
|
@@ -3933,8 +4033,8 @@ var ImageSelector = (props) => {
|
|
|
3933
4033
|
const handleOpenFileDialog = () => {
|
|
3934
4034
|
inputRef.current?.click();
|
|
3935
4035
|
};
|
|
3936
|
-
return /* @__PURE__ */ (0,
|
|
3937
|
-
/* @__PURE__ */ (0,
|
|
4036
|
+
return /* @__PURE__ */ (0, import_jsx_runtime326.jsxs)("div", { className: `lib-xplat-imageselector${value ? "" : " none-value"}`, children: [
|
|
4037
|
+
/* @__PURE__ */ (0, import_jsx_runtime326.jsx)(
|
|
3938
4038
|
"input",
|
|
3939
4039
|
{
|
|
3940
4040
|
type: "file",
|
|
@@ -3944,13 +4044,13 @@ var ImageSelector = (props) => {
|
|
|
3944
4044
|
ref: inputRef
|
|
3945
4045
|
}
|
|
3946
4046
|
),
|
|
3947
|
-
value && /* @__PURE__ */ (0,
|
|
3948
|
-
/* @__PURE__ */ (0,
|
|
3949
|
-
/* @__PURE__ */ (0,
|
|
4047
|
+
value && /* @__PURE__ */ (0, import_jsx_runtime326.jsxs)("div", { className: "action-bar", children: [
|
|
4048
|
+
/* @__PURE__ */ (0, import_jsx_runtime326.jsx)("div", { className: "icon-wrapper", onClick: handleOpenFileDialog, children: /* @__PURE__ */ (0, import_jsx_runtime326.jsx)(UploadIcon_default, {}) }),
|
|
4049
|
+
/* @__PURE__ */ (0, import_jsx_runtime326.jsx)("div", { className: "icon-wrapper", onClick: handleDeleteFile, children: /* @__PURE__ */ (0, import_jsx_runtime326.jsx)(DeleteIcon_default, {}) })
|
|
3950
4050
|
] }),
|
|
3951
|
-
/* @__PURE__ */ (0,
|
|
3952
|
-
/* @__PURE__ */ (0,
|
|
3953
|
-
/* @__PURE__ */ (0,
|
|
4051
|
+
/* @__PURE__ */ (0, import_jsx_runtime326.jsx)("div", { className: "content", children: previewUrl ? /* @__PURE__ */ (0, import_jsx_runtime326.jsx)("img", { src: previewUrl, alt: "preview" }) : /* @__PURE__ */ (0, import_jsx_runtime326.jsxs)("div", { className: "skeleton", onClick: handleOpenFileDialog, children: [
|
|
4052
|
+
/* @__PURE__ */ (0, import_jsx_runtime326.jsx)("div", { className: "icon-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime326.jsx)(ImageIcon_default, {}) }),
|
|
4053
|
+
/* @__PURE__ */ (0, import_jsx_runtime326.jsx)("div", { className: "label", children: label || "\uC774\uBBF8\uC9C0 \uCD94\uAC00\uD558\uAE30" })
|
|
3954
4054
|
] }) })
|
|
3955
4055
|
] });
|
|
3956
4056
|
};
|
|
@@ -3958,7 +4058,7 @@ ImageSelector.displayName = "ImageSelector";
|
|
|
3958
4058
|
var ImageSelector_default = ImageSelector;
|
|
3959
4059
|
|
|
3960
4060
|
// src/components/Pagination/Pagination.tsx
|
|
3961
|
-
var
|
|
4061
|
+
var import_jsx_runtime327 = require("react/jsx-runtime");
|
|
3962
4062
|
var getPageRange = (current, totalPages, siblingCount) => {
|
|
3963
4063
|
const totalNumbers = siblingCount * 2 + 5;
|
|
3964
4064
|
if (totalPages <= totalNumbers) {
|
|
@@ -4001,19 +4101,19 @@ var Pagination = (props) => {
|
|
|
4001
4101
|
onChange?.(page);
|
|
4002
4102
|
}
|
|
4003
4103
|
};
|
|
4004
|
-
return /* @__PURE__ */ (0,
|
|
4005
|
-
/* @__PURE__ */ (0,
|
|
4104
|
+
return /* @__PURE__ */ (0, import_jsx_runtime327.jsxs)("nav", { className: clsx_default("lib-xplat-pagination", size, type), "aria-label": "\uD398\uC774\uC9C0 \uB124\uBE44\uAC8C\uC774\uC158", children: [
|
|
4105
|
+
/* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
|
|
4006
4106
|
"button",
|
|
4007
4107
|
{
|
|
4008
4108
|
className: "page-btn prev",
|
|
4009
4109
|
disabled: current <= 1,
|
|
4010
4110
|
onClick: () => handleClick(current - 1),
|
|
4011
4111
|
"aria-label": "\uC774\uC804 \uD398\uC774\uC9C0",
|
|
4012
|
-
children: /* @__PURE__ */ (0,
|
|
4112
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(ChevronLeftIcon_default, {})
|
|
4013
4113
|
}
|
|
4014
4114
|
),
|
|
4015
4115
|
pages.map(
|
|
4016
|
-
(page, i) => page === "..." ? /* @__PURE__ */ (0,
|
|
4116
|
+
(page, i) => page === "..." ? /* @__PURE__ */ (0, import_jsx_runtime327.jsx)("span", { className: "dots", children: "..." }, `dots-${i}`) : /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
|
|
4017
4117
|
"button",
|
|
4018
4118
|
{
|
|
4019
4119
|
className: clsx_default("page-btn", { active: page === current }),
|
|
@@ -4024,14 +4124,14 @@ var Pagination = (props) => {
|
|
|
4024
4124
|
page
|
|
4025
4125
|
)
|
|
4026
4126
|
),
|
|
4027
|
-
/* @__PURE__ */ (0,
|
|
4127
|
+
/* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
|
|
4028
4128
|
"button",
|
|
4029
4129
|
{
|
|
4030
4130
|
className: "page-btn next",
|
|
4031
4131
|
disabled: current >= totalPages,
|
|
4032
4132
|
onClick: () => handleClick(current + 1),
|
|
4033
4133
|
"aria-label": "\uB2E4\uC74C \uD398\uC774\uC9C0",
|
|
4034
|
-
children: /* @__PURE__ */ (0,
|
|
4134
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(ChevronRightIcon_default, {})
|
|
4035
4135
|
}
|
|
4036
4136
|
)
|
|
4037
4137
|
] });
|
|
@@ -4040,17 +4140,17 @@ Pagination.displayName = "Pagination";
|
|
|
4040
4140
|
var Pagination_default = Pagination;
|
|
4041
4141
|
|
|
4042
4142
|
// src/components/PopOver/PopOver.tsx
|
|
4043
|
-
var
|
|
4044
|
-
var
|
|
4143
|
+
var import_react26 = __toESM(require("react"), 1);
|
|
4144
|
+
var import_jsx_runtime328 = require("react/jsx-runtime");
|
|
4045
4145
|
var PopOver = (props) => {
|
|
4046
4146
|
const { children, isOpen, onClose, PopOverEl } = props;
|
|
4047
|
-
const popRef =
|
|
4048
|
-
const triggerRef =
|
|
4049
|
-
const [localOpen, setLocalOpen] =
|
|
4050
|
-
const [eventTrigger, setEventTrigger] =
|
|
4147
|
+
const popRef = import_react26.default.useRef(null);
|
|
4148
|
+
const triggerRef = import_react26.default.useRef(null);
|
|
4149
|
+
const [localOpen, setLocalOpen] = import_react26.default.useState(false);
|
|
4150
|
+
const [eventTrigger, setEventTrigger] = import_react26.default.useState(false);
|
|
4051
4151
|
useClickOutside_default([popRef, triggerRef], onClose, isOpen);
|
|
4052
4152
|
const position = useAutoPosition_default(triggerRef, popRef, localOpen);
|
|
4053
|
-
|
|
4153
|
+
import_react26.default.useEffect(() => {
|
|
4054
4154
|
if (isOpen) {
|
|
4055
4155
|
setLocalOpen(isOpen);
|
|
4056
4156
|
setTimeout(() => {
|
|
@@ -4063,7 +4163,7 @@ var PopOver = (props) => {
|
|
|
4063
4163
|
}, 200);
|
|
4064
4164
|
}
|
|
4065
4165
|
}, [isOpen]);
|
|
4066
|
-
return /* @__PURE__ */ (0,
|
|
4166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime328.jsxs)(
|
|
4067
4167
|
"div",
|
|
4068
4168
|
{
|
|
4069
4169
|
className: "lib-xplat-pop-over",
|
|
@@ -4073,7 +4173,7 @@ var PopOver = (props) => {
|
|
|
4073
4173
|
},
|
|
4074
4174
|
children: [
|
|
4075
4175
|
children,
|
|
4076
|
-
localOpen && /* @__PURE__ */ (0,
|
|
4176
|
+
localOpen && /* @__PURE__ */ (0, import_jsx_runtime328.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime328.jsx)(
|
|
4077
4177
|
"div",
|
|
4078
4178
|
{
|
|
4079
4179
|
className: clsx_default(
|
|
@@ -4096,7 +4196,7 @@ PopOver.displayName = "PopOver";
|
|
|
4096
4196
|
var PopOver_default = PopOver;
|
|
4097
4197
|
|
|
4098
4198
|
// src/components/Progress/Progress.tsx
|
|
4099
|
-
var
|
|
4199
|
+
var import_jsx_runtime329 = require("react/jsx-runtime");
|
|
4100
4200
|
var Progress = (props) => {
|
|
4101
4201
|
const {
|
|
4102
4202
|
value,
|
|
@@ -4106,8 +4206,8 @@ var Progress = (props) => {
|
|
|
4106
4206
|
showLabel = false
|
|
4107
4207
|
} = props;
|
|
4108
4208
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
4109
|
-
return /* @__PURE__ */ (0,
|
|
4110
|
-
/* @__PURE__ */ (0,
|
|
4209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime329.jsxs)("div", { className: clsx_default("lib-xplat-progress", size, type), children: [
|
|
4210
|
+
/* @__PURE__ */ (0, import_jsx_runtime329.jsx)(
|
|
4111
4211
|
"div",
|
|
4112
4212
|
{
|
|
4113
4213
|
className: "track",
|
|
@@ -4115,7 +4215,7 @@ var Progress = (props) => {
|
|
|
4115
4215
|
"aria-valuenow": value,
|
|
4116
4216
|
"aria-valuemin": 0,
|
|
4117
4217
|
"aria-valuemax": max,
|
|
4118
|
-
children: /* @__PURE__ */ (0,
|
|
4218
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime329.jsx)(
|
|
4119
4219
|
"div",
|
|
4120
4220
|
{
|
|
4121
4221
|
className: "bar",
|
|
@@ -4124,7 +4224,7 @@ var Progress = (props) => {
|
|
|
4124
4224
|
)
|
|
4125
4225
|
}
|
|
4126
4226
|
),
|
|
4127
|
-
showLabel && /* @__PURE__ */ (0,
|
|
4227
|
+
showLabel && /* @__PURE__ */ (0, import_jsx_runtime329.jsxs)("span", { className: "label", children: [
|
|
4128
4228
|
Math.round(percentage),
|
|
4129
4229
|
"%"
|
|
4130
4230
|
] })
|
|
@@ -4134,17 +4234,17 @@ Progress.displayName = "Progress";
|
|
|
4134
4234
|
var Progress_default = Progress;
|
|
4135
4235
|
|
|
4136
4236
|
// src/components/Radio/RadioGroupContext.tsx
|
|
4137
|
-
var
|
|
4138
|
-
var RadioGroupContext =
|
|
4237
|
+
var import_react27 = __toESM(require("react"), 1);
|
|
4238
|
+
var RadioGroupContext = import_react27.default.createContext(
|
|
4139
4239
|
null
|
|
4140
4240
|
);
|
|
4141
4241
|
var useRadioGroupContext = () => {
|
|
4142
|
-
return
|
|
4242
|
+
return import_react27.default.useContext(RadioGroupContext);
|
|
4143
4243
|
};
|
|
4144
4244
|
var RadioGroupContext_default = RadioGroupContext;
|
|
4145
4245
|
|
|
4146
4246
|
// src/components/Radio/Radio.tsx
|
|
4147
|
-
var
|
|
4247
|
+
var import_jsx_runtime330 = require("react/jsx-runtime");
|
|
4148
4248
|
var Radio = (props) => {
|
|
4149
4249
|
const {
|
|
4150
4250
|
label,
|
|
@@ -4162,7 +4262,7 @@ var Radio = (props) => {
|
|
|
4162
4262
|
value,
|
|
4163
4263
|
onChange: rest.onChange
|
|
4164
4264
|
};
|
|
4165
|
-
return /* @__PURE__ */ (0,
|
|
4265
|
+
return /* @__PURE__ */ (0, import_jsx_runtime330.jsxs)(
|
|
4166
4266
|
"label",
|
|
4167
4267
|
{
|
|
4168
4268
|
className: clsx_default(
|
|
@@ -4172,18 +4272,18 @@ var Radio = (props) => {
|
|
|
4172
4272
|
localChecked ? "checked" : void 0
|
|
4173
4273
|
),
|
|
4174
4274
|
children: [
|
|
4175
|
-
/* @__PURE__ */ (0,
|
|
4176
|
-
/* @__PURE__ */ (0,
|
|
4275
|
+
/* @__PURE__ */ (0, import_jsx_runtime330.jsx)("input", { ...rest, ...inputProps, checked: localChecked, type: "radio" }),
|
|
4276
|
+
/* @__PURE__ */ (0, import_jsx_runtime330.jsx)(
|
|
4177
4277
|
"div",
|
|
4178
4278
|
{
|
|
4179
4279
|
className: clsx_default(
|
|
4180
4280
|
"circle",
|
|
4181
4281
|
localChecked ? "checked" : void 0
|
|
4182
4282
|
),
|
|
4183
|
-
children: localChecked && /* @__PURE__ */ (0,
|
|
4283
|
+
children: localChecked && /* @__PURE__ */ (0, import_jsx_runtime330.jsx)("div", { className: "inner-circle" })
|
|
4184
4284
|
}
|
|
4185
4285
|
),
|
|
4186
|
-
label && /* @__PURE__ */ (0,
|
|
4286
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime330.jsx)("span", { children: label })
|
|
4187
4287
|
]
|
|
4188
4288
|
}
|
|
4189
4289
|
);
|
|
@@ -4192,28 +4292,28 @@ Radio.displayName = "Radio";
|
|
|
4192
4292
|
var Radio_default = Radio;
|
|
4193
4293
|
|
|
4194
4294
|
// src/components/Radio/RadioGroup.tsx
|
|
4195
|
-
var
|
|
4295
|
+
var import_jsx_runtime331 = require("react/jsx-runtime");
|
|
4196
4296
|
var RadioGroup = (props) => {
|
|
4197
4297
|
const { children, ...rest } = props;
|
|
4198
|
-
return /* @__PURE__ */ (0,
|
|
4298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime331.jsx)(import_jsx_runtime331.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime331.jsx)(RadioGroupContext_default.Provider, { value: rest, children }) });
|
|
4199
4299
|
};
|
|
4200
4300
|
RadioGroup.displayName = "RadioGroup";
|
|
4201
4301
|
var RadioGroup_default = RadioGroup;
|
|
4202
4302
|
|
|
4203
4303
|
// src/components/Select/Select.tsx
|
|
4204
|
-
var
|
|
4304
|
+
var import_react30 = __toESM(require("react"), 1);
|
|
4205
4305
|
|
|
4206
4306
|
// src/components/Select/context.ts
|
|
4207
|
-
var
|
|
4208
|
-
var SelectContext =
|
|
4307
|
+
var import_react28 = __toESM(require("react"), 1);
|
|
4308
|
+
var SelectContext = import_react28.default.createContext(null);
|
|
4209
4309
|
var context_default = SelectContext;
|
|
4210
4310
|
|
|
4211
4311
|
// src/components/Select/SelectItem.tsx
|
|
4212
|
-
var
|
|
4213
|
-
var
|
|
4312
|
+
var import_react29 = __toESM(require("react"), 1);
|
|
4313
|
+
var import_jsx_runtime332 = require("react/jsx-runtime");
|
|
4214
4314
|
var SelectItem = (props) => {
|
|
4215
4315
|
const { children, value, onClick, disabled = false } = props;
|
|
4216
|
-
const ctx =
|
|
4316
|
+
const ctx = import_react29.default.useContext(context_default);
|
|
4217
4317
|
const handleClick = (e) => {
|
|
4218
4318
|
e.preventDefault();
|
|
4219
4319
|
e.stopPropagation();
|
|
@@ -4222,7 +4322,7 @@ var SelectItem = (props) => {
|
|
|
4222
4322
|
ctx?.close();
|
|
4223
4323
|
onClick?.();
|
|
4224
4324
|
};
|
|
4225
|
-
return /* @__PURE__ */ (0,
|
|
4325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime332.jsx)(
|
|
4226
4326
|
"div",
|
|
4227
4327
|
{
|
|
4228
4328
|
className: clsx_default("select-item", disabled && "disabled"),
|
|
@@ -4243,7 +4343,7 @@ SelectItem.displayName = "Select.Item";
|
|
|
4243
4343
|
var SelectItem_default = SelectItem;
|
|
4244
4344
|
|
|
4245
4345
|
// src/components/Select/Select.tsx
|
|
4246
|
-
var
|
|
4346
|
+
var import_jsx_runtime333 = require("react/jsx-runtime");
|
|
4247
4347
|
var ANIMATION_DURATION_MS3 = 200;
|
|
4248
4348
|
var SelectRoot = (props) => {
|
|
4249
4349
|
const {
|
|
@@ -4255,26 +4355,26 @@ var SelectRoot = (props) => {
|
|
|
4255
4355
|
error = false,
|
|
4256
4356
|
size = "md"
|
|
4257
4357
|
} = props;
|
|
4258
|
-
const itemChildren =
|
|
4259
|
-
(child) =>
|
|
4358
|
+
const itemChildren = import_react30.default.Children.toArray(children).filter(
|
|
4359
|
+
(child) => import_react30.default.isValidElement(child) && child.type === SelectItem_default
|
|
4260
4360
|
);
|
|
4261
4361
|
const isControlled = valueProp !== void 0;
|
|
4262
|
-
const [isOpen, setOpen] =
|
|
4263
|
-
const [uncontrolledLabel, setUncontrolledLabel] =
|
|
4264
|
-
const controlledLabel =
|
|
4362
|
+
const [isOpen, setOpen] = import_react30.default.useState(false);
|
|
4363
|
+
const [uncontrolledLabel, setUncontrolledLabel] = import_react30.default.useState(null);
|
|
4364
|
+
const controlledLabel = import_react30.default.useMemo(() => {
|
|
4265
4365
|
if (!isControlled) return null;
|
|
4266
4366
|
const match = itemChildren.find((child) => child.props.value === valueProp);
|
|
4267
4367
|
return match ? match.props.children : null;
|
|
4268
4368
|
}, [isControlled, valueProp, itemChildren]);
|
|
4269
4369
|
const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
|
|
4270
|
-
const triggerRef =
|
|
4271
|
-
const contentRef =
|
|
4272
|
-
const [mounted, setMounted] =
|
|
4273
|
-
const [visible, setVisible] =
|
|
4274
|
-
|
|
4370
|
+
const triggerRef = import_react30.default.useRef(null);
|
|
4371
|
+
const contentRef = import_react30.default.useRef(null);
|
|
4372
|
+
const [mounted, setMounted] = import_react30.default.useState(false);
|
|
4373
|
+
const [visible, setVisible] = import_react30.default.useState(false);
|
|
4374
|
+
import_react30.default.useEffect(() => {
|
|
4275
4375
|
if (disabled && isOpen) setOpen(false);
|
|
4276
4376
|
}, [disabled, isOpen]);
|
|
4277
|
-
|
|
4377
|
+
import_react30.default.useEffect(() => {
|
|
4278
4378
|
if (isOpen) {
|
|
4279
4379
|
setMounted(true);
|
|
4280
4380
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -4284,12 +4384,12 @@ var SelectRoot = (props) => {
|
|
|
4284
4384
|
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS3);
|
|
4285
4385
|
return () => clearTimeout(t);
|
|
4286
4386
|
}, [isOpen]);
|
|
4287
|
-
const open =
|
|
4288
|
-
const close =
|
|
4289
|
-
const toggle =
|
|
4387
|
+
const open = import_react30.default.useCallback(() => setOpen(true), []);
|
|
4388
|
+
const close = import_react30.default.useCallback(() => setOpen(false), []);
|
|
4389
|
+
const toggle = import_react30.default.useCallback(() => setOpen((prev) => !prev), []);
|
|
4290
4390
|
useClickOutside_default([contentRef, triggerRef], close, isOpen);
|
|
4291
4391
|
const position = useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
4292
|
-
const setSelected =
|
|
4392
|
+
const setSelected = import_react30.default.useCallback(
|
|
4293
4393
|
(label, itemValue) => {
|
|
4294
4394
|
if (!isControlled) {
|
|
4295
4395
|
setUncontrolledLabel(label);
|
|
@@ -4298,7 +4398,7 @@ var SelectRoot = (props) => {
|
|
|
4298
4398
|
},
|
|
4299
4399
|
[isControlled, onChange]
|
|
4300
4400
|
);
|
|
4301
|
-
const ctxValue =
|
|
4401
|
+
const ctxValue = import_react30.default.useMemo(
|
|
4302
4402
|
() => ({
|
|
4303
4403
|
isOpen,
|
|
4304
4404
|
mounted,
|
|
@@ -4319,7 +4419,7 @@ var SelectRoot = (props) => {
|
|
|
4319
4419
|
if (disabled) return;
|
|
4320
4420
|
toggle();
|
|
4321
4421
|
};
|
|
4322
|
-
return /* @__PURE__ */ (0,
|
|
4422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime333.jsx)(context_default.Provider, { value: ctxValue, children: /* @__PURE__ */ (0, import_jsx_runtime333.jsxs)(
|
|
4323
4423
|
"div",
|
|
4324
4424
|
{
|
|
4325
4425
|
className: clsx_default(
|
|
@@ -4330,7 +4430,7 @@ var SelectRoot = (props) => {
|
|
|
4330
4430
|
mounted && "is-open"
|
|
4331
4431
|
),
|
|
4332
4432
|
children: [
|
|
4333
|
-
/* @__PURE__ */ (0,
|
|
4433
|
+
/* @__PURE__ */ (0, import_jsx_runtime333.jsxs)(
|
|
4334
4434
|
"div",
|
|
4335
4435
|
{
|
|
4336
4436
|
ref: triggerRef,
|
|
@@ -4354,7 +4454,7 @@ var SelectRoot = (props) => {
|
|
|
4354
4454
|
}
|
|
4355
4455
|
},
|
|
4356
4456
|
children: [
|
|
4357
|
-
/* @__PURE__ */ (0,
|
|
4457
|
+
/* @__PURE__ */ (0, import_jsx_runtime333.jsx)(
|
|
4358
4458
|
"span",
|
|
4359
4459
|
{
|
|
4360
4460
|
className: clsx_default(
|
|
@@ -4364,25 +4464,25 @@ var SelectRoot = (props) => {
|
|
|
4364
4464
|
children: selectedLabel ?? placeholder
|
|
4365
4465
|
}
|
|
4366
4466
|
),
|
|
4367
|
-
/* @__PURE__ */ (0,
|
|
4467
|
+
/* @__PURE__ */ (0, import_jsx_runtime333.jsx)(
|
|
4368
4468
|
"span",
|
|
4369
4469
|
{
|
|
4370
4470
|
className: clsx_default("select-trigger-icon", isOpen && "open"),
|
|
4371
4471
|
"aria-hidden": true,
|
|
4372
|
-
children: /* @__PURE__ */ (0,
|
|
4472
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime333.jsx)(ChevronDownIcon_default, {})
|
|
4373
4473
|
}
|
|
4374
4474
|
)
|
|
4375
4475
|
]
|
|
4376
4476
|
}
|
|
4377
4477
|
),
|
|
4378
|
-
mounted && /* @__PURE__ */ (0,
|
|
4478
|
+
mounted && /* @__PURE__ */ (0, import_jsx_runtime333.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime333.jsx)(
|
|
4379
4479
|
"div",
|
|
4380
4480
|
{
|
|
4381
4481
|
className: clsx_default("lib-xplat-select-content", position.direction, stateClass),
|
|
4382
4482
|
ref: contentRef,
|
|
4383
4483
|
style: { ...position.position, width: triggerRef.current?.offsetWidth },
|
|
4384
4484
|
role: "listbox",
|
|
4385
|
-
children: /* @__PURE__ */ (0,
|
|
4485
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime333.jsx)(context_default.Provider, { value: ctxValue, children: itemChildren })
|
|
4386
4486
|
}
|
|
4387
4487
|
) })
|
|
4388
4488
|
]
|
|
@@ -4396,7 +4496,7 @@ var Select = Object.assign(SelectRoot, {
|
|
|
4396
4496
|
var Select_default = Select;
|
|
4397
4497
|
|
|
4398
4498
|
// src/components/Skeleton/Skeleton.tsx
|
|
4399
|
-
var
|
|
4499
|
+
var import_jsx_runtime334 = require("react/jsx-runtime");
|
|
4400
4500
|
var SIZE_MAP = {
|
|
4401
4501
|
xs: "var(--spacing-size-1)",
|
|
4402
4502
|
sm: "var(--spacing-size-2)",
|
|
@@ -4412,7 +4512,7 @@ var Skeleton = (props) => {
|
|
|
4412
4512
|
...width != null && { width: SIZE_MAP[width] },
|
|
4413
4513
|
...height != null && { height: SIZE_MAP[height] }
|
|
4414
4514
|
};
|
|
4415
|
-
return /* @__PURE__ */ (0,
|
|
4515
|
+
return /* @__PURE__ */ (0, import_jsx_runtime334.jsx)(
|
|
4416
4516
|
"div",
|
|
4417
4517
|
{
|
|
4418
4518
|
className: clsx_default("lib-xplat-skeleton", variant),
|
|
@@ -4425,20 +4525,20 @@ Skeleton.displayName = "Skeleton";
|
|
|
4425
4525
|
var Skeleton_default = Skeleton;
|
|
4426
4526
|
|
|
4427
4527
|
// src/components/Spinner/Spinner.tsx
|
|
4428
|
-
var
|
|
4528
|
+
var import_jsx_runtime335 = require("react/jsx-runtime");
|
|
4429
4529
|
var Spinner = (props) => {
|
|
4430
4530
|
const {
|
|
4431
4531
|
size = "md",
|
|
4432
4532
|
type = "brand"
|
|
4433
4533
|
} = props;
|
|
4434
|
-
return /* @__PURE__ */ (0,
|
|
4534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime335.jsx)(
|
|
4435
4535
|
"div",
|
|
4436
4536
|
{
|
|
4437
4537
|
className: clsx_default("lib-xplat-spinner", size, type),
|
|
4438
4538
|
role: "status",
|
|
4439
4539
|
"aria-label": "\uB85C\uB529 \uC911",
|
|
4440
|
-
children: /* @__PURE__ */ (0,
|
|
4441
|
-
/* @__PURE__ */ (0,
|
|
4540
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime335.jsxs)("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
4541
|
+
/* @__PURE__ */ (0, import_jsx_runtime335.jsx)(
|
|
4442
4542
|
"circle",
|
|
4443
4543
|
{
|
|
4444
4544
|
className: "track",
|
|
@@ -4448,7 +4548,7 @@ var Spinner = (props) => {
|
|
|
4448
4548
|
strokeWidth: "3"
|
|
4449
4549
|
}
|
|
4450
4550
|
),
|
|
4451
|
-
/* @__PURE__ */ (0,
|
|
4551
|
+
/* @__PURE__ */ (0, import_jsx_runtime335.jsx)(
|
|
4452
4552
|
"circle",
|
|
4453
4553
|
{
|
|
4454
4554
|
className: "indicator",
|
|
@@ -4467,20 +4567,20 @@ Spinner.displayName = "Spinner";
|
|
|
4467
4567
|
var Spinner_default = Spinner;
|
|
4468
4568
|
|
|
4469
4569
|
// src/components/Steps/Steps.tsx
|
|
4470
|
-
var
|
|
4570
|
+
var import_jsx_runtime336 = require("react/jsx-runtime");
|
|
4471
4571
|
var Steps = (props) => {
|
|
4472
4572
|
const {
|
|
4473
4573
|
items,
|
|
4474
4574
|
current,
|
|
4475
4575
|
type = "brand"
|
|
4476
4576
|
} = props;
|
|
4477
|
-
return /* @__PURE__ */ (0,
|
|
4577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("div", { className: clsx_default("lib-xplat-steps", type), children: items.map((item, index) => {
|
|
4478
4578
|
const status = index < current ? "completed" : index === current ? "active" : "pending";
|
|
4479
|
-
return /* @__PURE__ */ (0,
|
|
4480
|
-
/* @__PURE__ */ (0,
|
|
4481
|
-
/* @__PURE__ */ (0,
|
|
4482
|
-
/* @__PURE__ */ (0,
|
|
4483
|
-
item.description && /* @__PURE__ */ (0,
|
|
4579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime336.jsxs)("div", { className: clsx_default("step-item", status), children: [
|
|
4580
|
+
/* @__PURE__ */ (0, import_jsx_runtime336.jsx)("div", { className: "step-circle", children: status === "completed" ? /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(CheckIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("span", { children: index + 1 }) }),
|
|
4581
|
+
/* @__PURE__ */ (0, import_jsx_runtime336.jsxs)("div", { className: "step-content", children: [
|
|
4582
|
+
/* @__PURE__ */ (0, import_jsx_runtime336.jsx)("span", { className: "step-title", children: item.title }),
|
|
4583
|
+
item.description && /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("span", { className: "step-description", children: item.description })
|
|
4484
4584
|
] })
|
|
4485
4585
|
] }, index);
|
|
4486
4586
|
}) });
|
|
@@ -4489,8 +4589,8 @@ Steps.displayName = "Steps";
|
|
|
4489
4589
|
var Steps_default = Steps;
|
|
4490
4590
|
|
|
4491
4591
|
// src/components/Swiper/Swiper.tsx
|
|
4492
|
-
var
|
|
4493
|
-
var
|
|
4592
|
+
var import_react31 = __toESM(require("react"), 1);
|
|
4593
|
+
var import_jsx_runtime337 = require("react/jsx-runtime");
|
|
4494
4594
|
var Swiper = (props) => {
|
|
4495
4595
|
const {
|
|
4496
4596
|
auto = false,
|
|
@@ -4513,23 +4613,23 @@ var Swiper = (props) => {
|
|
|
4513
4613
|
const maxIndex = Math.max(0, totalSlides - viewItemCount);
|
|
4514
4614
|
const useLoop = loop && canSlide;
|
|
4515
4615
|
const cloneCount = useLoop ? totalSlides : 0;
|
|
4516
|
-
const extendedItems =
|
|
4616
|
+
const extendedItems = import_react31.default.useMemo(() => {
|
|
4517
4617
|
if (!useLoop) return items;
|
|
4518
4618
|
return [...items, ...items, ...items];
|
|
4519
4619
|
}, [items, useLoop]);
|
|
4520
4620
|
const initialIdx = Math.max(0, Math.min(indexProp ?? 0, maxIndex));
|
|
4521
|
-
const [innerIndex, setInnerIndex] =
|
|
4621
|
+
const [innerIndex, setInnerIndex] = import_react31.default.useState(
|
|
4522
4622
|
useLoop ? cloneCount + initialIdx : initialIdx
|
|
4523
4623
|
);
|
|
4524
|
-
const [isDragging, setIsDragging] =
|
|
4525
|
-
const [dragOffset, setDragOffset] =
|
|
4526
|
-
const [animated, setAnimated] =
|
|
4527
|
-
const [containerWidth, setContainerWidth] =
|
|
4528
|
-
const containerRef =
|
|
4529
|
-
const startXRef =
|
|
4530
|
-
const startTimeRef =
|
|
4531
|
-
const autoplayTimerRef =
|
|
4532
|
-
|
|
4624
|
+
const [isDragging, setIsDragging] = import_react31.default.useState(false);
|
|
4625
|
+
const [dragOffset, setDragOffset] = import_react31.default.useState(0);
|
|
4626
|
+
const [animated, setAnimated] = import_react31.default.useState(true);
|
|
4627
|
+
const [containerWidth, setContainerWidth] = import_react31.default.useState(0);
|
|
4628
|
+
const containerRef = import_react31.default.useRef(null);
|
|
4629
|
+
const startXRef = import_react31.default.useRef(0);
|
|
4630
|
+
const startTimeRef = import_react31.default.useRef(0);
|
|
4631
|
+
const autoplayTimerRef = import_react31.default.useRef(null);
|
|
4632
|
+
import_react31.default.useEffect(() => {
|
|
4533
4633
|
const el = containerRef.current;
|
|
4534
4634
|
if (!el) return;
|
|
4535
4635
|
const ro = new ResizeObserver((entries) => {
|
|
@@ -4548,7 +4648,7 @@ var Swiper = (props) => {
|
|
|
4548
4648
|
return ((inner - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
4549
4649
|
};
|
|
4550
4650
|
const realIndex = getRealIndex(innerIndex);
|
|
4551
|
-
const moveToInner =
|
|
4651
|
+
const moveToInner = import_react31.default.useCallback(
|
|
4552
4652
|
(idx, withAnim = true) => {
|
|
4553
4653
|
if (!useLoop) {
|
|
4554
4654
|
setAnimated(withAnim);
|
|
@@ -4576,7 +4676,7 @@ var Swiper = (props) => {
|
|
|
4576
4676
|
},
|
|
4577
4677
|
[useLoop, cloneCount, totalSlides]
|
|
4578
4678
|
);
|
|
4579
|
-
const handleTransitionEnd =
|
|
4679
|
+
const handleTransitionEnd = import_react31.default.useCallback(() => {
|
|
4580
4680
|
if (!useLoop) return;
|
|
4581
4681
|
const real = getRealIndex(innerIndex);
|
|
4582
4682
|
const canonical = cloneCount + real;
|
|
@@ -4586,7 +4686,7 @@ var Swiper = (props) => {
|
|
|
4586
4686
|
}
|
|
4587
4687
|
onChange?.(Math.min(real, maxIndex));
|
|
4588
4688
|
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange]);
|
|
4589
|
-
const slideTo =
|
|
4689
|
+
const slideTo = import_react31.default.useCallback(
|
|
4590
4690
|
(logicalIndex) => {
|
|
4591
4691
|
if (!canSlide) return;
|
|
4592
4692
|
const clamped = useLoop ? logicalIndex : Math.max(0, Math.min(logicalIndex, maxIndex));
|
|
@@ -4596,7 +4696,7 @@ var Swiper = (props) => {
|
|
|
4596
4696
|
},
|
|
4597
4697
|
[canSlide, useLoop, cloneCount, maxIndex, onChange, moveToInner]
|
|
4598
4698
|
);
|
|
4599
|
-
const slideNext =
|
|
4699
|
+
const slideNext = import_react31.default.useCallback(() => {
|
|
4600
4700
|
if (!canSlide) return;
|
|
4601
4701
|
const nextInner = innerIndex + slideBy;
|
|
4602
4702
|
if (useLoop) {
|
|
@@ -4605,7 +4705,7 @@ var Swiper = (props) => {
|
|
|
4605
4705
|
moveToInner(Math.min(nextInner, maxIndex), true);
|
|
4606
4706
|
}
|
|
4607
4707
|
}, [canSlide, useLoop, innerIndex, slideBy, maxIndex, moveToInner]);
|
|
4608
|
-
const slidePrev =
|
|
4708
|
+
const slidePrev = import_react31.default.useCallback(() => {
|
|
4609
4709
|
if (!canSlide) return;
|
|
4610
4710
|
const prevInner = innerIndex - slideBy;
|
|
4611
4711
|
if (useLoop) {
|
|
@@ -4614,7 +4714,7 @@ var Swiper = (props) => {
|
|
|
4614
4714
|
moveToInner(Math.max(prevInner, 0), true);
|
|
4615
4715
|
}
|
|
4616
4716
|
}, [canSlide, useLoop, innerIndex, slideBy, moveToInner]);
|
|
4617
|
-
|
|
4717
|
+
import_react31.default.useEffect(() => {
|
|
4618
4718
|
if (indexProp === void 0) return;
|
|
4619
4719
|
const clamped = Math.max(0, Math.min(indexProp, maxIndex));
|
|
4620
4720
|
const target = useLoop ? cloneCount + clamped : clamped;
|
|
@@ -4622,12 +4722,12 @@ var Swiper = (props) => {
|
|
|
4622
4722
|
moveToInner(target, true);
|
|
4623
4723
|
}
|
|
4624
4724
|
}, [indexProp]);
|
|
4625
|
-
|
|
4725
|
+
import_react31.default.useImperativeHandle(swiperRef, () => ({
|
|
4626
4726
|
slidePrev,
|
|
4627
4727
|
slideNext,
|
|
4628
4728
|
slideTo
|
|
4629
4729
|
}));
|
|
4630
|
-
|
|
4730
|
+
import_react31.default.useEffect(() => {
|
|
4631
4731
|
if (!auto || !canSlide) return;
|
|
4632
4732
|
autoplayTimerRef.current = setInterval(slideNext, autoplayDelay);
|
|
4633
4733
|
return () => {
|
|
@@ -4650,7 +4750,7 @@ var Swiper = (props) => {
|
|
|
4650
4750
|
startXRef.current = getClientX(e);
|
|
4651
4751
|
startTimeRef.current = Date.now();
|
|
4652
4752
|
};
|
|
4653
|
-
|
|
4753
|
+
import_react31.default.useEffect(() => {
|
|
4654
4754
|
if (!isDragging) return;
|
|
4655
4755
|
const handleMove = (e) => {
|
|
4656
4756
|
setDragOffset(getClientX(e) - startXRef.current);
|
|
@@ -4688,8 +4788,8 @@ var Swiper = (props) => {
|
|
|
4688
4788
|
}, [isDragging, dragOffset, innerIndex, useLoop, maxIndex, slideStep, moveToInner]);
|
|
4689
4789
|
const slideWidthPercent = 100 / viewItemCount;
|
|
4690
4790
|
const gapAdjust = spaceBetween * (viewItemCount - 1) / viewItemCount;
|
|
4691
|
-
const slideElements =
|
|
4692
|
-
() => extendedItems.map((item, idx) => /* @__PURE__ */ (0,
|
|
4791
|
+
const slideElements = import_react31.default.useMemo(
|
|
4792
|
+
() => extendedItems.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
4693
4793
|
"div",
|
|
4694
4794
|
{
|
|
4695
4795
|
className: "lib-xplat-swiper__slide",
|
|
@@ -4708,14 +4808,14 @@ var Swiper = (props) => {
|
|
|
4708
4808
|
Math.floor(realIndex / slideBy),
|
|
4709
4809
|
totalSteps - 1
|
|
4710
4810
|
);
|
|
4711
|
-
return /* @__PURE__ */ (0,
|
|
4712
|
-
/* @__PURE__ */ (0,
|
|
4811
|
+
return /* @__PURE__ */ (0, import_jsx_runtime337.jsxs)("div", { className: "lib-xplat-swiper", ref: containerRef, children: [
|
|
4812
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
4713
4813
|
"div",
|
|
4714
4814
|
{
|
|
4715
4815
|
className: "lib-xplat-swiper__viewport",
|
|
4716
4816
|
onMouseDown: handleDragStart,
|
|
4717
4817
|
onTouchStart: handleDragStart,
|
|
4718
|
-
children: /* @__PURE__ */ (0,
|
|
4818
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
4719
4819
|
"div",
|
|
4720
4820
|
{
|
|
4721
4821
|
className: clsx_default(
|
|
@@ -4733,7 +4833,7 @@ var Swiper = (props) => {
|
|
|
4733
4833
|
)
|
|
4734
4834
|
}
|
|
4735
4835
|
),
|
|
4736
|
-
showProgress && canSlide && /* @__PURE__ */ (0,
|
|
4836
|
+
showProgress && canSlide && /* @__PURE__ */ (0, import_jsx_runtime337.jsx)("div", { className: "lib-xplat-swiper__progress", children: /* @__PURE__ */ (0, import_jsx_runtime337.jsx)("div", { className: "lib-xplat-swiper__progress-track", children: /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
4737
4837
|
"span",
|
|
4738
4838
|
{
|
|
4739
4839
|
className: "lib-xplat-swiper__progress-fill",
|
|
@@ -4743,7 +4843,7 @@ var Swiper = (props) => {
|
|
|
4743
4843
|
}
|
|
4744
4844
|
}
|
|
4745
4845
|
) }) }),
|
|
4746
|
-
canSlide && /* @__PURE__ */ (0,
|
|
4846
|
+
canSlide && /* @__PURE__ */ (0, import_jsx_runtime337.jsx)("div", { className: "lib-xplat-swiper__dots", children: Array.from({ length: totalSteps }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
4747
4847
|
"button",
|
|
4748
4848
|
{
|
|
4749
4849
|
className: clsx_default(
|
|
@@ -4761,8 +4861,8 @@ Swiper.displayName = "Swiper";
|
|
|
4761
4861
|
var Swiper_default = Swiper;
|
|
4762
4862
|
|
|
4763
4863
|
// src/components/Switch/Switch.tsx
|
|
4764
|
-
var
|
|
4765
|
-
var
|
|
4864
|
+
var import_react32 = __toESM(require("react"), 1);
|
|
4865
|
+
var import_jsx_runtime338 = require("react/jsx-runtime");
|
|
4766
4866
|
var KNOB_TRANSITION_MS = 250;
|
|
4767
4867
|
var Switch = (props) => {
|
|
4768
4868
|
const {
|
|
@@ -4772,9 +4872,9 @@ var Switch = (props) => {
|
|
|
4772
4872
|
disabled,
|
|
4773
4873
|
onChange
|
|
4774
4874
|
} = props;
|
|
4775
|
-
const [isAnimating, setIsAnimating] =
|
|
4776
|
-
const timeoutRef =
|
|
4777
|
-
|
|
4875
|
+
const [isAnimating, setIsAnimating] = import_react32.default.useState(false);
|
|
4876
|
+
const timeoutRef = import_react32.default.useRef(null);
|
|
4877
|
+
import_react32.default.useEffect(() => {
|
|
4778
4878
|
return () => {
|
|
4779
4879
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4780
4880
|
};
|
|
@@ -4789,7 +4889,7 @@ var Switch = (props) => {
|
|
|
4789
4889
|
timeoutRef.current = null;
|
|
4790
4890
|
}, KNOB_TRANSITION_MS);
|
|
4791
4891
|
};
|
|
4792
|
-
return /* @__PURE__ */ (0,
|
|
4892
|
+
return /* @__PURE__ */ (0, import_jsx_runtime338.jsx)(
|
|
4793
4893
|
"div",
|
|
4794
4894
|
{
|
|
4795
4895
|
className: clsx_default(
|
|
@@ -4802,7 +4902,7 @@ var Switch = (props) => {
|
|
|
4802
4902
|
),
|
|
4803
4903
|
onClick: handleClick,
|
|
4804
4904
|
"aria-disabled": disabled || isAnimating,
|
|
4805
|
-
children: /* @__PURE__ */ (0,
|
|
4905
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime338.jsx)("div", { className: clsx_default("knob", value ? "checked" : void 0) })
|
|
4806
4906
|
}
|
|
4807
4907
|
);
|
|
4808
4908
|
};
|
|
@@ -4810,26 +4910,27 @@ Switch.displayName = "Switch";
|
|
|
4810
4910
|
var Switch_default = Switch;
|
|
4811
4911
|
|
|
4812
4912
|
// src/components/Table/TableContext.tsx
|
|
4813
|
-
var
|
|
4814
|
-
var TableContext =
|
|
4913
|
+
var import_react33 = __toESM(require("react"), 1);
|
|
4914
|
+
var TableContext = import_react33.default.createContext(null);
|
|
4815
4915
|
var useTableContext = () => {
|
|
4816
|
-
const ctx =
|
|
4916
|
+
const ctx = import_react33.default.useContext(TableContext);
|
|
4817
4917
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
4818
4918
|
return ctx;
|
|
4819
4919
|
};
|
|
4820
4920
|
var TableContext_default = TableContext;
|
|
4821
4921
|
|
|
4822
4922
|
// src/components/Table/Table.tsx
|
|
4823
|
-
var
|
|
4923
|
+
var import_jsx_runtime339 = require("react/jsx-runtime");
|
|
4824
4924
|
var Table = (props) => {
|
|
4825
4925
|
const {
|
|
4826
4926
|
children,
|
|
4927
|
+
size = "md",
|
|
4827
4928
|
rowBorderUse = true,
|
|
4828
4929
|
colBorderUse = true,
|
|
4829
4930
|
headerSticky = false,
|
|
4830
4931
|
stickyShadow = true
|
|
4831
4932
|
} = props;
|
|
4832
|
-
return /* @__PURE__ */ (0,
|
|
4933
|
+
return /* @__PURE__ */ (0, import_jsx_runtime339.jsx)("div", { className: `lib-xplat-table-wrapper ${size}`, children: /* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
|
|
4833
4934
|
TableContext_default.Provider,
|
|
4834
4935
|
{
|
|
4835
4936
|
value: {
|
|
@@ -4838,7 +4939,7 @@ var Table = (props) => {
|
|
|
4838
4939
|
headerSticky,
|
|
4839
4940
|
stickyShadow
|
|
4840
4941
|
},
|
|
4841
|
-
children: /* @__PURE__ */ (0,
|
|
4942
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime339.jsx)("table", { className: "lib-xplat-table", children })
|
|
4842
4943
|
}
|
|
4843
4944
|
) });
|
|
4844
4945
|
};
|
|
@@ -4846,41 +4947,41 @@ Table.displayName = "Table";
|
|
|
4846
4947
|
var Table_default = Table;
|
|
4847
4948
|
|
|
4848
4949
|
// src/components/Table/TableBody.tsx
|
|
4849
|
-
var
|
|
4950
|
+
var import_jsx_runtime340 = require("react/jsx-runtime");
|
|
4850
4951
|
var TableBody = (props) => {
|
|
4851
4952
|
const { children } = props;
|
|
4852
|
-
return /* @__PURE__ */ (0,
|
|
4953
|
+
return /* @__PURE__ */ (0, import_jsx_runtime340.jsx)("tbody", { children });
|
|
4853
4954
|
};
|
|
4854
4955
|
TableBody.displayName = "TableBody";
|
|
4855
4956
|
var TableBody_default = TableBody;
|
|
4856
4957
|
|
|
4857
4958
|
// src/components/Table/TableCell.tsx
|
|
4858
|
-
var
|
|
4959
|
+
var import_react36 = __toESM(require("react"), 1);
|
|
4859
4960
|
|
|
4860
4961
|
// src/components/Table/TableHeadContext.tsx
|
|
4861
|
-
var
|
|
4862
|
-
var TableHeadContext =
|
|
4962
|
+
var import_react34 = __toESM(require("react"), 1);
|
|
4963
|
+
var TableHeadContext = import_react34.default.createContext(
|
|
4863
4964
|
null
|
|
4864
4965
|
);
|
|
4865
4966
|
var useTableHeadContext = () => {
|
|
4866
|
-
const ctx =
|
|
4967
|
+
const ctx = import_react34.default.useContext(TableHeadContext);
|
|
4867
4968
|
return ctx;
|
|
4868
4969
|
};
|
|
4869
4970
|
var TableHeadContext_default = TableHeadContext;
|
|
4870
4971
|
|
|
4871
4972
|
// src/components/Table/TableRowContext.tsx
|
|
4872
|
-
var
|
|
4873
|
-
var TableRowContext =
|
|
4973
|
+
var import_react35 = __toESM(require("react"), 1);
|
|
4974
|
+
var TableRowContext = import_react35.default.createContext(null);
|
|
4874
4975
|
var useTableRowContext = () => {
|
|
4875
|
-
const ctx =
|
|
4976
|
+
const ctx = import_react35.default.useContext(TableRowContext);
|
|
4876
4977
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
4877
4978
|
return ctx;
|
|
4878
4979
|
};
|
|
4879
4980
|
var TableRowContext_default = TableRowContext;
|
|
4880
4981
|
|
|
4881
4982
|
// src/components/Table/TableCell.tsx
|
|
4882
|
-
var
|
|
4883
|
-
var TableCell =
|
|
4983
|
+
var import_jsx_runtime341 = require("react/jsx-runtime");
|
|
4984
|
+
var TableCell = import_react36.default.memo((props) => {
|
|
4884
4985
|
const {
|
|
4885
4986
|
children,
|
|
4886
4987
|
align = "center",
|
|
@@ -4892,9 +4993,9 @@ var TableCell = import_react35.default.memo((props) => {
|
|
|
4892
4993
|
const { registerStickyCell, stickyCells } = useTableRowContext();
|
|
4893
4994
|
const { stickyShadow } = useTableContext();
|
|
4894
4995
|
const headContext = useTableHeadContext();
|
|
4895
|
-
const [left, setLeft] =
|
|
4896
|
-
const cellRef =
|
|
4897
|
-
const calculateLeft =
|
|
4996
|
+
const [left, setLeft] = import_react36.default.useState(0);
|
|
4997
|
+
const cellRef = import_react36.default.useRef(null);
|
|
4998
|
+
const calculateLeft = import_react36.default.useCallback(() => {
|
|
4898
4999
|
if (!cellRef.current) return 0;
|
|
4899
5000
|
let totalLeft = 0;
|
|
4900
5001
|
for (const ref of stickyCells) {
|
|
@@ -4903,7 +5004,7 @@ var TableCell = import_react35.default.memo((props) => {
|
|
|
4903
5004
|
}
|
|
4904
5005
|
return totalLeft;
|
|
4905
5006
|
}, [stickyCells]);
|
|
4906
|
-
|
|
5007
|
+
import_react36.default.useEffect(() => {
|
|
4907
5008
|
if (!isSticky || !cellRef.current) return;
|
|
4908
5009
|
registerStickyCell(cellRef);
|
|
4909
5010
|
setLeft(calculateLeft());
|
|
@@ -4921,7 +5022,7 @@ var TableCell = import_react35.default.memo((props) => {
|
|
|
4921
5022
|
const CellTag = cellRef.current?.tagName === "TH" ? "th" : "td";
|
|
4922
5023
|
const isLastSticky = isSticky && stickyCells[stickyCells.length - 1] === cellRef;
|
|
4923
5024
|
const enableHover = headContext && headContext.cellHover;
|
|
4924
|
-
return /* @__PURE__ */ (0,
|
|
5025
|
+
return /* @__PURE__ */ (0, import_jsx_runtime341.jsx)(
|
|
4925
5026
|
CellTag,
|
|
4926
5027
|
{
|
|
4927
5028
|
ref: cellRef,
|
|
@@ -4946,21 +5047,21 @@ TableCell.displayName = "TableCell";
|
|
|
4946
5047
|
var TableCell_default = TableCell;
|
|
4947
5048
|
|
|
4948
5049
|
// src/components/Table/TableHead.tsx
|
|
4949
|
-
var
|
|
5050
|
+
var import_jsx_runtime342 = require("react/jsx-runtime");
|
|
4950
5051
|
var TableHead = ({
|
|
4951
5052
|
children,
|
|
4952
5053
|
cellHover = false
|
|
4953
5054
|
}) => {
|
|
4954
5055
|
const { headerSticky } = useTableContext();
|
|
4955
|
-
return /* @__PURE__ */ (0,
|
|
5056
|
+
return /* @__PURE__ */ (0, import_jsx_runtime342.jsx)(TableHeadContext_default.Provider, { value: { cellHover }, children: /* @__PURE__ */ (0, import_jsx_runtime342.jsx)("thead", { className: clsx_default(headerSticky ? "table-sticky" : null), children }) });
|
|
4956
5057
|
};
|
|
4957
5058
|
TableHead.displayName = "TableHead";
|
|
4958
5059
|
var TableHead_default = TableHead;
|
|
4959
5060
|
|
|
4960
5061
|
// src/components/Table/TableRow.tsx
|
|
4961
|
-
var
|
|
4962
|
-
var
|
|
4963
|
-
var TableRow =
|
|
5062
|
+
var import_react37 = __toESM(require("react"), 1);
|
|
5063
|
+
var import_jsx_runtime343 = require("react/jsx-runtime");
|
|
5064
|
+
var TableRow = import_react37.default.memo((props) => {
|
|
4964
5065
|
const {
|
|
4965
5066
|
children,
|
|
4966
5067
|
type = "secondary",
|
|
@@ -4968,14 +5069,14 @@ var TableRow = import_react36.default.memo((props) => {
|
|
|
4968
5069
|
onClick
|
|
4969
5070
|
} = props;
|
|
4970
5071
|
const { rowBorderUse } = useTableContext();
|
|
4971
|
-
const [stickyCells, setStickyCells] =
|
|
5072
|
+
const [stickyCells, setStickyCells] = import_react37.default.useState([]);
|
|
4972
5073
|
const registerStickyCell = (ref) => {
|
|
4973
5074
|
setStickyCells((prev) => {
|
|
4974
5075
|
if (prev.includes(ref)) return prev;
|
|
4975
5076
|
return [...prev, ref];
|
|
4976
5077
|
});
|
|
4977
5078
|
};
|
|
4978
|
-
return /* @__PURE__ */ (0,
|
|
5079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime343.jsx)(TableRowContext_default.Provider, { value: { stickyCells, registerStickyCell }, children: /* @__PURE__ */ (0, import_jsx_runtime343.jsx)(
|
|
4979
5080
|
"tr",
|
|
4980
5081
|
{
|
|
4981
5082
|
className: clsx_default(
|
|
@@ -4993,7 +5094,7 @@ TableRow.displayName = "TableRow";
|
|
|
4993
5094
|
var TableRow_default = TableRow;
|
|
4994
5095
|
|
|
4995
5096
|
// src/components/Tag/Tag.tsx
|
|
4996
|
-
var
|
|
5097
|
+
var import_jsx_runtime344 = require("react/jsx-runtime");
|
|
4997
5098
|
var Tag = (props) => {
|
|
4998
5099
|
const {
|
|
4999
5100
|
children,
|
|
@@ -5003,7 +5104,7 @@ var Tag = (props) => {
|
|
|
5003
5104
|
disabled = false,
|
|
5004
5105
|
colorIndex
|
|
5005
5106
|
} = props;
|
|
5006
|
-
return /* @__PURE__ */ (0,
|
|
5107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime344.jsxs)(
|
|
5007
5108
|
"span",
|
|
5008
5109
|
{
|
|
5009
5110
|
className: clsx_default(
|
|
@@ -5014,8 +5115,8 @@ var Tag = (props) => {
|
|
|
5014
5115
|
disabled && "disabled"
|
|
5015
5116
|
),
|
|
5016
5117
|
children: [
|
|
5017
|
-
/* @__PURE__ */ (0,
|
|
5018
|
-
onClose && /* @__PURE__ */ (0,
|
|
5118
|
+
/* @__PURE__ */ (0, import_jsx_runtime344.jsx)("span", { className: "tag-label", children }),
|
|
5119
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime344.jsx)("button", { className: "tag-close", onClick: onClose, "aria-label": "\uC0AD\uC81C", disabled, children: /* @__PURE__ */ (0, import_jsx_runtime344.jsx)(XIcon_default, {}) })
|
|
5019
5120
|
]
|
|
5020
5121
|
}
|
|
5021
5122
|
);
|
|
@@ -5024,12 +5125,12 @@ Tag.displayName = "Tag";
|
|
|
5024
5125
|
var Tag_default = Tag;
|
|
5025
5126
|
|
|
5026
5127
|
// src/components/TextArea/TextArea.tsx
|
|
5027
|
-
var
|
|
5028
|
-
var
|
|
5029
|
-
var TextArea =
|
|
5128
|
+
var import_react38 = __toESM(require("react"), 1);
|
|
5129
|
+
var import_jsx_runtime345 = require("react/jsx-runtime");
|
|
5130
|
+
var TextArea = import_react38.default.forwardRef(
|
|
5030
5131
|
(props, ref) => {
|
|
5031
5132
|
const { value, onChange, disabled, ...textareaProps } = props;
|
|
5032
|
-
const localRef =
|
|
5133
|
+
const localRef = import_react38.default.useRef(null);
|
|
5033
5134
|
const setRefs = (el) => {
|
|
5034
5135
|
localRef.current = el;
|
|
5035
5136
|
if (!ref) return;
|
|
@@ -5049,21 +5150,21 @@ var TextArea = import_react37.default.forwardRef(
|
|
|
5049
5150
|
onChange(event);
|
|
5050
5151
|
}
|
|
5051
5152
|
};
|
|
5052
|
-
|
|
5153
|
+
import_react38.default.useEffect(() => {
|
|
5053
5154
|
const el = localRef.current;
|
|
5054
5155
|
if (!el) return;
|
|
5055
5156
|
el.style.height = "0px";
|
|
5056
5157
|
const nextHeight = Math.min(el.scrollHeight, 400);
|
|
5057
5158
|
el.style.height = `${nextHeight}px`;
|
|
5058
5159
|
}, [value]);
|
|
5059
|
-
return /* @__PURE__ */ (0,
|
|
5160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime345.jsx)("div", { className: "lib-xplat-textarea-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime345.jsx)(
|
|
5060
5161
|
"div",
|
|
5061
5162
|
{
|
|
5062
5163
|
className: clsx_default(
|
|
5063
5164
|
"lib-xplat-textarea",
|
|
5064
5165
|
disabled ? "disabled" : void 0
|
|
5065
5166
|
),
|
|
5066
|
-
children: /* @__PURE__ */ (0,
|
|
5167
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime345.jsx)(
|
|
5067
5168
|
"textarea",
|
|
5068
5169
|
{
|
|
5069
5170
|
...textareaProps,
|
|
@@ -5081,25 +5182,25 @@ TextArea.displayName = "TextArea";
|
|
|
5081
5182
|
var TextArea_default = TextArea;
|
|
5082
5183
|
|
|
5083
5184
|
// src/components/Toast/Toast.tsx
|
|
5084
|
-
var
|
|
5185
|
+
var import_react39 = __toESM(require("react"), 1);
|
|
5085
5186
|
var import_react_dom4 = require("react-dom");
|
|
5086
|
-
var
|
|
5087
|
-
var ToastContext =
|
|
5187
|
+
var import_jsx_runtime346 = require("react/jsx-runtime");
|
|
5188
|
+
var ToastContext = import_react39.default.createContext(null);
|
|
5088
5189
|
var useToast = () => {
|
|
5089
|
-
const ctx =
|
|
5190
|
+
const ctx = import_react39.default.useContext(ToastContext);
|
|
5090
5191
|
if (!ctx) throw new Error("useToast must be used within ToastProvider");
|
|
5091
5192
|
return ctx;
|
|
5092
5193
|
};
|
|
5093
5194
|
var EXIT_DURATION = 300;
|
|
5094
5195
|
var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
5095
|
-
const ref =
|
|
5096
|
-
const [height, setHeight] =
|
|
5097
|
-
|
|
5196
|
+
const ref = import_react39.default.useRef(null);
|
|
5197
|
+
const [height, setHeight] = import_react39.default.useState(void 0);
|
|
5198
|
+
import_react39.default.useEffect(() => {
|
|
5098
5199
|
if (ref.current && !isExiting) {
|
|
5099
5200
|
setHeight(ref.current.offsetHeight);
|
|
5100
5201
|
}
|
|
5101
5202
|
}, [isExiting]);
|
|
5102
|
-
return /* @__PURE__ */ (0,
|
|
5203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(
|
|
5103
5204
|
"div",
|
|
5104
5205
|
{
|
|
5105
5206
|
className: clsx_default("lib-xplat-toast-wrapper", { exit: isExiting }),
|
|
@@ -5107,15 +5208,15 @@ var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
|
5107
5208
|
maxHeight: isExiting ? 0 : height ?? "none",
|
|
5108
5209
|
marginBottom: isExiting ? 0 : void 0
|
|
5109
5210
|
},
|
|
5110
|
-
children: /* @__PURE__ */ (0,
|
|
5211
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime346.jsxs)(
|
|
5111
5212
|
"div",
|
|
5112
5213
|
{
|
|
5113
5214
|
ref,
|
|
5114
5215
|
className: clsx_default("lib-xplat-toast", item.type, { exit: isExiting }),
|
|
5115
5216
|
role: "alert",
|
|
5116
5217
|
children: [
|
|
5117
|
-
/* @__PURE__ */ (0,
|
|
5118
|
-
/* @__PURE__ */ (0,
|
|
5218
|
+
/* @__PURE__ */ (0, import_jsx_runtime346.jsx)("span", { className: "message", children: item.message }),
|
|
5219
|
+
/* @__PURE__ */ (0, import_jsx_runtime346.jsx)("button", { className: "close-btn", onClick: onClose, "aria-label": "\uB2EB\uAE30", children: "\xD7" })
|
|
5119
5220
|
]
|
|
5120
5221
|
}
|
|
5121
5222
|
)
|
|
@@ -5126,13 +5227,13 @@ var ToastProvider = ({
|
|
|
5126
5227
|
children,
|
|
5127
5228
|
position = "top-right"
|
|
5128
5229
|
}) => {
|
|
5129
|
-
const [toasts, setToasts] =
|
|
5130
|
-
const [removing, setRemoving] =
|
|
5131
|
-
const [mounted, setMounted] =
|
|
5132
|
-
|
|
5230
|
+
const [toasts, setToasts] = import_react39.default.useState([]);
|
|
5231
|
+
const [removing, setRemoving] = import_react39.default.useState(/* @__PURE__ */ new Set());
|
|
5232
|
+
const [mounted, setMounted] = import_react39.default.useState(false);
|
|
5233
|
+
import_react39.default.useEffect(() => {
|
|
5133
5234
|
setMounted(true);
|
|
5134
5235
|
}, []);
|
|
5135
|
-
const remove =
|
|
5236
|
+
const remove = import_react39.default.useCallback((id) => {
|
|
5136
5237
|
setRemoving((prev) => new Set(prev).add(id));
|
|
5137
5238
|
setTimeout(() => {
|
|
5138
5239
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
@@ -5143,7 +5244,7 @@ var ToastProvider = ({
|
|
|
5143
5244
|
});
|
|
5144
5245
|
}, EXIT_DURATION);
|
|
5145
5246
|
}, []);
|
|
5146
|
-
const toast =
|
|
5247
|
+
const toast = import_react39.default.useCallback(
|
|
5147
5248
|
(type, message, duration = 3e3) => {
|
|
5148
5249
|
const id = `${Date.now()}-${Math.random()}`;
|
|
5149
5250
|
setToasts((prev) => [...prev, { id, type, message }]);
|
|
@@ -5153,10 +5254,10 @@ var ToastProvider = ({
|
|
|
5153
5254
|
},
|
|
5154
5255
|
[remove]
|
|
5155
5256
|
);
|
|
5156
|
-
return /* @__PURE__ */ (0,
|
|
5257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime346.jsxs)(ToastContext.Provider, { value: { toast }, children: [
|
|
5157
5258
|
children,
|
|
5158
5259
|
mounted && (0, import_react_dom4.createPortal)(
|
|
5159
|
-
/* @__PURE__ */ (0,
|
|
5260
|
+
/* @__PURE__ */ (0, import_jsx_runtime346.jsx)("div", { className: clsx_default("lib-xplat-toast-container", position), children: toasts.map((t) => /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(
|
|
5160
5261
|
ToastItemComponent,
|
|
5161
5262
|
{
|
|
5162
5263
|
item: t,
|
|
@@ -5172,29 +5273,29 @@ var ToastProvider = ({
|
|
|
5172
5273
|
ToastProvider.displayName = "ToastProvider";
|
|
5173
5274
|
|
|
5174
5275
|
// src/components/Tooltip/Tooltip.tsx
|
|
5175
|
-
var
|
|
5176
|
-
var
|
|
5276
|
+
var import_react40 = __toESM(require("react"), 1);
|
|
5277
|
+
var import_jsx_runtime347 = require("react/jsx-runtime");
|
|
5177
5278
|
var Tooltip = (props) => {
|
|
5178
5279
|
const {
|
|
5179
5280
|
type = "primary",
|
|
5180
5281
|
description,
|
|
5181
5282
|
children
|
|
5182
5283
|
} = props;
|
|
5183
|
-
const iconRef =
|
|
5184
|
-
return /* @__PURE__ */ (0,
|
|
5185
|
-
/* @__PURE__ */ (0,
|
|
5186
|
-
/* @__PURE__ */ (0,
|
|
5284
|
+
const iconRef = import_react40.default.useRef(null);
|
|
5285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime347.jsxs)("div", { className: "lib-xplat-tooltip", children: [
|
|
5286
|
+
/* @__PURE__ */ (0, import_jsx_runtime347.jsx)("div", { className: "tooltip-content", ref: iconRef, children: children || "Tooltip" }),
|
|
5287
|
+
/* @__PURE__ */ (0, import_jsx_runtime347.jsx)("div", { className: clsx_default("tooltip-wrapper", type), children: description })
|
|
5187
5288
|
] });
|
|
5188
5289
|
};
|
|
5189
5290
|
Tooltip.displayName = "Tooltip";
|
|
5190
5291
|
var Tooltip_default = Tooltip;
|
|
5191
5292
|
|
|
5192
5293
|
// src/components/Video/Video.tsx
|
|
5193
|
-
var
|
|
5194
|
-
var
|
|
5195
|
-
var PipIcon = () => /* @__PURE__ */ (0,
|
|
5196
|
-
/* @__PURE__ */ (0,
|
|
5197
|
-
/* @__PURE__ */ (0,
|
|
5294
|
+
var import_react41 = __toESM(require("react"), 1);
|
|
5295
|
+
var import_jsx_runtime348 = require("react/jsx-runtime");
|
|
5296
|
+
var PipIcon = () => /* @__PURE__ */ (0, import_jsx_runtime348.jsxs)("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
5297
|
+
/* @__PURE__ */ (0, import_jsx_runtime348.jsx)("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
|
|
5298
|
+
/* @__PURE__ */ (0, import_jsx_runtime348.jsx)("rect", { x: "12", y: "11", width: "7", height: "6", rx: "1", fill: "currentColor" })
|
|
5198
5299
|
] });
|
|
5199
5300
|
var formatTime = (sec) => {
|
|
5200
5301
|
if (!Number.isFinite(sec) || sec < 0) return "0:00";
|
|
@@ -5202,7 +5303,7 @@ var formatTime = (sec) => {
|
|
|
5202
5303
|
const s = Math.floor(sec % 60);
|
|
5203
5304
|
return `${m}:${s.toString().padStart(2, "0")}`;
|
|
5204
5305
|
};
|
|
5205
|
-
var Video =
|
|
5306
|
+
var Video = import_react41.default.forwardRef((props, ref) => {
|
|
5206
5307
|
const {
|
|
5207
5308
|
src,
|
|
5208
5309
|
poster,
|
|
@@ -5226,21 +5327,21 @@ var Video = import_react40.default.forwardRef((props, ref) => {
|
|
|
5226
5327
|
children,
|
|
5227
5328
|
...rest
|
|
5228
5329
|
} = props;
|
|
5229
|
-
const containerRef =
|
|
5230
|
-
const videoRef =
|
|
5231
|
-
const [isPlaying, setIsPlaying] =
|
|
5232
|
-
const [isLoaded, setIsLoaded] =
|
|
5233
|
-
const [currentTime, setCurrentTime] =
|
|
5234
|
-
const [duration, setDuration] =
|
|
5235
|
-
const [buffered, setBuffered] =
|
|
5236
|
-
const [volume, setVolume] =
|
|
5237
|
-
const [isMuted, setIsMuted] =
|
|
5238
|
-
const [isFullscreen, setIsFullscreen] =
|
|
5239
|
-
const [playbackRate, setPlaybackRate] =
|
|
5240
|
-
const [rateMenuOpen, setRateMenuOpen] =
|
|
5241
|
-
const [captionsOn, setCaptionsOn] =
|
|
5242
|
-
const [isPip, setIsPip] =
|
|
5243
|
-
const setRefs =
|
|
5330
|
+
const containerRef = import_react41.default.useRef(null);
|
|
5331
|
+
const videoRef = import_react41.default.useRef(null);
|
|
5332
|
+
const [isPlaying, setIsPlaying] = import_react41.default.useState(Boolean(autoPlay));
|
|
5333
|
+
const [isLoaded, setIsLoaded] = import_react41.default.useState(false);
|
|
5334
|
+
const [currentTime, setCurrentTime] = import_react41.default.useState(0);
|
|
5335
|
+
const [duration, setDuration] = import_react41.default.useState(0);
|
|
5336
|
+
const [buffered, setBuffered] = import_react41.default.useState(0);
|
|
5337
|
+
const [volume, setVolume] = import_react41.default.useState(1);
|
|
5338
|
+
const [isMuted, setIsMuted] = import_react41.default.useState(Boolean(muted));
|
|
5339
|
+
const [isFullscreen, setIsFullscreen] = import_react41.default.useState(false);
|
|
5340
|
+
const [playbackRate, setPlaybackRate] = import_react41.default.useState(1);
|
|
5341
|
+
const [rateMenuOpen, setRateMenuOpen] = import_react41.default.useState(false);
|
|
5342
|
+
const [captionsOn, setCaptionsOn] = import_react41.default.useState(false);
|
|
5343
|
+
const [isPip, setIsPip] = import_react41.default.useState(false);
|
|
5344
|
+
const setRefs = import_react41.default.useCallback(
|
|
5244
5345
|
(el) => {
|
|
5245
5346
|
videoRef.current = el;
|
|
5246
5347
|
if (typeof ref === "function") ref(el);
|
|
@@ -5248,14 +5349,14 @@ var Video = import_react40.default.forwardRef((props, ref) => {
|
|
|
5248
5349
|
},
|
|
5249
5350
|
[ref]
|
|
5250
5351
|
);
|
|
5251
|
-
|
|
5352
|
+
import_react41.default.useEffect(() => {
|
|
5252
5353
|
const onFsChange = () => {
|
|
5253
5354
|
setIsFullscreen(document.fullscreenElement === containerRef.current);
|
|
5254
5355
|
};
|
|
5255
5356
|
document.addEventListener("fullscreenchange", onFsChange);
|
|
5256
5357
|
return () => document.removeEventListener("fullscreenchange", onFsChange);
|
|
5257
5358
|
}, []);
|
|
5258
|
-
|
|
5359
|
+
import_react41.default.useEffect(() => {
|
|
5259
5360
|
const v = videoRef.current;
|
|
5260
5361
|
if (!v) return;
|
|
5261
5362
|
const onEnter = () => setIsPip(true);
|
|
@@ -5369,13 +5470,13 @@ var Video = import_react40.default.forwardRef((props, ref) => {
|
|
|
5369
5470
|
const volumePct = (isMuted ? 0 : volume) * 100;
|
|
5370
5471
|
const VolumeGlyph = isMuted || volume === 0 ? VolumeXIcon_default : volume < 0.5 ? VolumeIcon_default : Volume2Icon_default;
|
|
5371
5472
|
const pipSupported = typeof document !== "undefined" && "pictureInPictureEnabled" in document && document.pictureInPictureEnabled;
|
|
5372
|
-
return /* @__PURE__ */ (0,
|
|
5473
|
+
return /* @__PURE__ */ (0, import_jsx_runtime348.jsxs)(
|
|
5373
5474
|
"div",
|
|
5374
5475
|
{
|
|
5375
5476
|
ref: containerRef,
|
|
5376
5477
|
className: clsx_default("lib-xplat-video", showControls && "has-controls"),
|
|
5377
5478
|
children: [
|
|
5378
|
-
/* @__PURE__ */ (0,
|
|
5479
|
+
/* @__PURE__ */ (0, import_jsx_runtime348.jsx)(
|
|
5379
5480
|
"video",
|
|
5380
5481
|
{
|
|
5381
5482
|
ref: setRefs,
|
|
@@ -5396,7 +5497,7 @@ var Video = import_react40.default.forwardRef((props, ref) => {
|
|
|
5396
5497
|
children
|
|
5397
5498
|
}
|
|
5398
5499
|
),
|
|
5399
|
-
showCenterPlay && /* @__PURE__ */ (0,
|
|
5500
|
+
showCenterPlay && /* @__PURE__ */ (0, import_jsx_runtime348.jsx)(
|
|
5400
5501
|
"button",
|
|
5401
5502
|
{
|
|
5402
5503
|
type: "button",
|
|
@@ -5408,11 +5509,11 @@ var Video = import_react40.default.forwardRef((props, ref) => {
|
|
|
5408
5509
|
onClick: togglePlay,
|
|
5409
5510
|
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
5410
5511
|
tabIndex: -1,
|
|
5411
|
-
children: /* @__PURE__ */ (0,
|
|
5512
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime348.jsx)("span", { className: "center-play-icon", children: /* @__PURE__ */ (0, import_jsx_runtime348.jsx)(PlayCircleIcon_default, {}) })
|
|
5412
5513
|
}
|
|
5413
5514
|
),
|
|
5414
|
-
showControls && /* @__PURE__ */ (0,
|
|
5415
|
-
/* @__PURE__ */ (0,
|
|
5515
|
+
showControls && /* @__PURE__ */ (0, import_jsx_runtime348.jsxs)("div", { className: "controls", onClick: (e) => e.stopPropagation(), children: [
|
|
5516
|
+
/* @__PURE__ */ (0, import_jsx_runtime348.jsx)(
|
|
5416
5517
|
"input",
|
|
5417
5518
|
{
|
|
5418
5519
|
type: "range",
|
|
@@ -5429,29 +5530,29 @@ var Video = import_react40.default.forwardRef((props, ref) => {
|
|
|
5429
5530
|
}
|
|
5430
5531
|
}
|
|
5431
5532
|
),
|
|
5432
|
-
/* @__PURE__ */ (0,
|
|
5433
|
-
/* @__PURE__ */ (0,
|
|
5533
|
+
/* @__PURE__ */ (0, import_jsx_runtime348.jsxs)("div", { className: "controls-row", children: [
|
|
5534
|
+
/* @__PURE__ */ (0, import_jsx_runtime348.jsx)(
|
|
5434
5535
|
"button",
|
|
5435
5536
|
{
|
|
5436
5537
|
type: "button",
|
|
5437
5538
|
className: "control-btn",
|
|
5438
5539
|
onClick: togglePlay,
|
|
5439
5540
|
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
5440
|
-
children: isPlaying ? /* @__PURE__ */ (0,
|
|
5541
|
+
children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime348.jsx)(PauseIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime348.jsx)(PlayIcon_default, {})
|
|
5441
5542
|
}
|
|
5442
5543
|
),
|
|
5443
|
-
/* @__PURE__ */ (0,
|
|
5444
|
-
/* @__PURE__ */ (0,
|
|
5544
|
+
/* @__PURE__ */ (0, import_jsx_runtime348.jsxs)("div", { className: "volume-group", children: [
|
|
5545
|
+
/* @__PURE__ */ (0, import_jsx_runtime348.jsx)(
|
|
5445
5546
|
"button",
|
|
5446
5547
|
{
|
|
5447
5548
|
type: "button",
|
|
5448
5549
|
className: "control-btn",
|
|
5449
5550
|
onClick: toggleMute,
|
|
5450
5551
|
"aria-label": isMuted ? "\uC74C\uC18C\uAC70 \uD574\uC81C" : "\uC74C\uC18C\uAC70",
|
|
5451
|
-
children: /* @__PURE__ */ (0,
|
|
5552
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime348.jsx)(VolumeGlyph, {})
|
|
5452
5553
|
}
|
|
5453
5554
|
),
|
|
5454
|
-
/* @__PURE__ */ (0,
|
|
5555
|
+
/* @__PURE__ */ (0, import_jsx_runtime348.jsx)(
|
|
5455
5556
|
"input",
|
|
5456
5557
|
{
|
|
5457
5558
|
type: "range",
|
|
@@ -5466,14 +5567,14 @@ var Video = import_react40.default.forwardRef((props, ref) => {
|
|
|
5466
5567
|
}
|
|
5467
5568
|
)
|
|
5468
5569
|
] }),
|
|
5469
|
-
/* @__PURE__ */ (0,
|
|
5570
|
+
/* @__PURE__ */ (0, import_jsx_runtime348.jsxs)("span", { className: "time", children: [
|
|
5470
5571
|
formatTime(currentTime),
|
|
5471
5572
|
" / ",
|
|
5472
5573
|
formatTime(duration)
|
|
5473
5574
|
] }),
|
|
5474
|
-
/* @__PURE__ */ (0,
|
|
5475
|
-
playbackRates && playbackRates.length > 0 && /* @__PURE__ */ (0,
|
|
5476
|
-
/* @__PURE__ */ (0,
|
|
5575
|
+
/* @__PURE__ */ (0, import_jsx_runtime348.jsx)("div", { className: "controls-spacer" }),
|
|
5576
|
+
playbackRates && playbackRates.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime348.jsxs)("div", { className: clsx_default("rate-group", rateMenuOpen && "is-open"), children: [
|
|
5577
|
+
/* @__PURE__ */ (0, import_jsx_runtime348.jsxs)(
|
|
5477
5578
|
"button",
|
|
5478
5579
|
{
|
|
5479
5580
|
type: "button",
|
|
@@ -5487,7 +5588,7 @@ var Video = import_react40.default.forwardRef((props, ref) => {
|
|
|
5487
5588
|
]
|
|
5488
5589
|
}
|
|
5489
5590
|
),
|
|
5490
|
-
rateMenuOpen && /* @__PURE__ */ (0,
|
|
5591
|
+
rateMenuOpen && /* @__PURE__ */ (0, import_jsx_runtime348.jsx)("ul", { className: "rate-menu", role: "menu", children: playbackRates.map((r2) => /* @__PURE__ */ (0, import_jsx_runtime348.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime348.jsxs)(
|
|
5491
5592
|
"button",
|
|
5492
5593
|
{
|
|
5493
5594
|
type: "button",
|
|
@@ -5501,7 +5602,7 @@ var Video = import_react40.default.forwardRef((props, ref) => {
|
|
|
5501
5602
|
}
|
|
5502
5603
|
) }, r2)) })
|
|
5503
5604
|
] }),
|
|
5504
|
-
showCaptions && /* @__PURE__ */ (0,
|
|
5605
|
+
showCaptions && /* @__PURE__ */ (0, import_jsx_runtime348.jsx)(
|
|
5505
5606
|
"button",
|
|
5506
5607
|
{
|
|
5507
5608
|
type: "button",
|
|
@@ -5509,37 +5610,37 @@ var Video = import_react40.default.forwardRef((props, ref) => {
|
|
|
5509
5610
|
onClick: toggleCaptions,
|
|
5510
5611
|
"aria-label": captionsOn ? "\uC790\uB9C9 \uB044\uAE30" : "\uC790\uB9C9 \uCF1C\uAE30",
|
|
5511
5612
|
"aria-pressed": captionsOn,
|
|
5512
|
-
children: /* @__PURE__ */ (0,
|
|
5613
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime348.jsx)(TypeIcon_default, {})
|
|
5513
5614
|
}
|
|
5514
5615
|
),
|
|
5515
|
-
showPip && pipSupported && /* @__PURE__ */ (0,
|
|
5616
|
+
showPip && pipSupported && /* @__PURE__ */ (0, import_jsx_runtime348.jsx)(
|
|
5516
5617
|
"button",
|
|
5517
5618
|
{
|
|
5518
5619
|
type: "button",
|
|
5519
5620
|
className: clsx_default("control-btn", isPip && "is-active"),
|
|
5520
5621
|
onClick: togglePip,
|
|
5521
5622
|
"aria-label": isPip ? "PIP \uC885\uB8CC" : "PIP",
|
|
5522
|
-
children: /* @__PURE__ */ (0,
|
|
5623
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime348.jsx)(PipIcon, {})
|
|
5523
5624
|
}
|
|
5524
5625
|
),
|
|
5525
|
-
showDownload && /* @__PURE__ */ (0,
|
|
5626
|
+
showDownload && /* @__PURE__ */ (0, import_jsx_runtime348.jsx)(
|
|
5526
5627
|
"a",
|
|
5527
5628
|
{
|
|
5528
5629
|
className: "control-btn",
|
|
5529
5630
|
href: src,
|
|
5530
5631
|
download: downloadFileName ?? true,
|
|
5531
5632
|
"aria-label": "\uB2E4\uC6B4\uB85C\uB4DC",
|
|
5532
|
-
children: /* @__PURE__ */ (0,
|
|
5633
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime348.jsx)(DownloadIcon_default, {})
|
|
5533
5634
|
}
|
|
5534
5635
|
),
|
|
5535
|
-
/* @__PURE__ */ (0,
|
|
5636
|
+
/* @__PURE__ */ (0, import_jsx_runtime348.jsx)(
|
|
5536
5637
|
"button",
|
|
5537
5638
|
{
|
|
5538
5639
|
type: "button",
|
|
5539
5640
|
className: "control-btn",
|
|
5540
5641
|
onClick: toggleFullscreen,
|
|
5541
5642
|
"aria-label": isFullscreen ? "\uC804\uCCB4\uD654\uBA74 \uC885\uB8CC" : "\uC804\uCCB4\uD654\uBA74",
|
|
5542
|
-
children: isFullscreen ? /* @__PURE__ */ (0,
|
|
5643
|
+
children: isFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime348.jsx)(MinimizeIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime348.jsx)(MaximizeIcon_default, {})
|
|
5543
5644
|
}
|
|
5544
5645
|
)
|
|
5545
5646
|
] })
|
|
@@ -5562,6 +5663,7 @@ var Video_default = Video;
|
|
|
5562
5663
|
Calendar,
|
|
5563
5664
|
CardTab,
|
|
5564
5665
|
Chart,
|
|
5666
|
+
ChatInput,
|
|
5565
5667
|
CheckBox,
|
|
5566
5668
|
Chip,
|
|
5567
5669
|
Divider,
|