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