@x-plat/design-system 0.5.22 → 0.5.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ChatInput/index.cjs +57 -94
- package/dist/components/ChatInput/index.css +2 -48
- package/dist/components/ChatInput/index.js +55 -92
- package/dist/components/index.cjs +529 -509
- package/dist/components/index.css +48 -48
- package/dist/components/index.js +483 -463
- package/dist/index.cjs +529 -509
- package/dist/index.css +48 -48
- package/dist/index.js +483 -463
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -1949,68 +1949,10 @@ Calendar.displayName = "Calendar";
|
|
|
1949
1949
|
var Calendar_default = Calendar;
|
|
1950
1950
|
|
|
1951
1951
|
// src/components/ChatInput/ChatInput.tsx
|
|
1952
|
-
import React5 from "react";
|
|
1953
|
-
|
|
1954
|
-
// src/components/TextArea/TextArea.tsx
|
|
1955
1952
|
import React4 from "react";
|
|
1956
|
-
import { jsx as jsx302 } from "react/jsx-runtime";
|
|
1957
|
-
var
|
|
1958
|
-
|
|
1959
|
-
const { value, onChange, disabled, ...textareaProps } = props;
|
|
1960
|
-
const localRef = React4.useRef(null);
|
|
1961
|
-
const setRefs = (el) => {
|
|
1962
|
-
localRef.current = el;
|
|
1963
|
-
if (!ref) return;
|
|
1964
|
-
if (typeof ref === "function") {
|
|
1965
|
-
ref(el);
|
|
1966
|
-
} else if (ref && typeof ref === "object" && "current" in ref) {
|
|
1967
|
-
ref.current = el;
|
|
1968
|
-
}
|
|
1969
|
-
};
|
|
1970
|
-
const handleOnChange = (e) => {
|
|
1971
|
-
const val = e.target.value;
|
|
1972
|
-
if (onChange) {
|
|
1973
|
-
const event = {
|
|
1974
|
-
...e,
|
|
1975
|
-
target: { value: val }
|
|
1976
|
-
};
|
|
1977
|
-
onChange(event);
|
|
1978
|
-
}
|
|
1979
|
-
};
|
|
1980
|
-
React4.useEffect(() => {
|
|
1981
|
-
const el = localRef.current;
|
|
1982
|
-
if (!el) return;
|
|
1983
|
-
el.style.height = "0px";
|
|
1984
|
-
const nextHeight = Math.min(el.scrollHeight, 400);
|
|
1985
|
-
el.style.height = `${nextHeight}px`;
|
|
1986
|
-
}, [value]);
|
|
1987
|
-
return /* @__PURE__ */ jsx302("div", { className: "lib-xplat-textarea-wrapper", children: /* @__PURE__ */ jsx302(
|
|
1988
|
-
"div",
|
|
1989
|
-
{
|
|
1990
|
-
className: clsx_default(
|
|
1991
|
-
"lib-xplat-textarea",
|
|
1992
|
-
disabled ? "disabled" : void 0
|
|
1993
|
-
),
|
|
1994
|
-
children: /* @__PURE__ */ jsx302(
|
|
1995
|
-
"textarea",
|
|
1996
|
-
{
|
|
1997
|
-
...textareaProps,
|
|
1998
|
-
ref: setRefs,
|
|
1999
|
-
disabled,
|
|
2000
|
-
value,
|
|
2001
|
-
onChange: handleOnChange
|
|
2002
|
-
}
|
|
2003
|
-
)
|
|
2004
|
-
}
|
|
2005
|
-
) });
|
|
2006
|
-
}
|
|
2007
|
-
);
|
|
2008
|
-
TextArea.displayName = "TextArea";
|
|
2009
|
-
var TextArea_default = TextArea;
|
|
2010
|
-
|
|
2011
|
-
// src/components/ChatInput/ChatInput.tsx
|
|
2012
|
-
import { jsx as jsx303, jsxs as jsxs194 } from "react/jsx-runtime";
|
|
2013
|
-
var ChatInput = React5.forwardRef(
|
|
1953
|
+
import { jsx as jsx302, jsxs as jsxs194 } from "react/jsx-runtime";
|
|
1954
|
+
var MAX_HEIGHT = 200;
|
|
1955
|
+
var ChatInput = React4.forwardRef(
|
|
2014
1956
|
(props, ref) => {
|
|
2015
1957
|
const {
|
|
2016
1958
|
placeholder,
|
|
@@ -2021,9 +1963,24 @@ var ChatInput = React5.forwardRef(
|
|
|
2021
1963
|
onChange
|
|
2022
1964
|
} = props;
|
|
2023
1965
|
const isControlled = valueProp !== void 0;
|
|
2024
|
-
const [internalValue, setInternalValue] =
|
|
1966
|
+
const [internalValue, setInternalValue] = React4.useState("");
|
|
2025
1967
|
const value = isControlled ? valueProp : internalValue;
|
|
2026
1968
|
const hasText = value.trim().length > 0;
|
|
1969
|
+
const textareaRef = React4.useRef(null);
|
|
1970
|
+
const setRefs = React4.useCallback(
|
|
1971
|
+
(el) => {
|
|
1972
|
+
textareaRef.current = el;
|
|
1973
|
+
if (typeof ref === "function") ref(el);
|
|
1974
|
+
else if (ref) ref.current = el;
|
|
1975
|
+
},
|
|
1976
|
+
[ref]
|
|
1977
|
+
);
|
|
1978
|
+
const updateHeight = React4.useCallback(() => {
|
|
1979
|
+
const el = textareaRef.current;
|
|
1980
|
+
if (!el) return;
|
|
1981
|
+
el.style.height = "0px";
|
|
1982
|
+
el.style.height = `${Math.min(el.scrollHeight, MAX_HEIGHT)}px`;
|
|
1983
|
+
}, []);
|
|
2027
1984
|
const handleChange = (e) => {
|
|
2028
1985
|
const val = e.target.value;
|
|
2029
1986
|
if (!isControlled) setInternalValue(val);
|
|
@@ -2033,6 +1990,7 @@ var ChatInput = React5.forwardRef(
|
|
|
2033
1990
|
if (!hasText || disabled) return;
|
|
2034
1991
|
onSubmit?.(value);
|
|
2035
1992
|
if (!isControlled) setInternalValue("");
|
|
1993
|
+
requestAnimationFrame(updateHeight);
|
|
2036
1994
|
};
|
|
2037
1995
|
const handleKeyDown = (e) => {
|
|
2038
1996
|
if (e.key === "Enter" && !e.shiftKey) {
|
|
@@ -2040,19 +1998,24 @@ var ChatInput = React5.forwardRef(
|
|
|
2040
1998
|
handleSubmit();
|
|
2041
1999
|
}
|
|
2042
2000
|
};
|
|
2001
|
+
React4.useEffect(() => {
|
|
2002
|
+
updateHeight();
|
|
2003
|
+
}, [value, updateHeight]);
|
|
2043
2004
|
return /* @__PURE__ */ jsxs194("div", { className: clsx_default("lib-xplat-chat-input", disabled && "disabled"), children: [
|
|
2044
|
-
/* @__PURE__ */
|
|
2045
|
-
|
|
2005
|
+
/* @__PURE__ */ jsx302(
|
|
2006
|
+
"textarea",
|
|
2046
2007
|
{
|
|
2047
|
-
ref,
|
|
2008
|
+
ref: setRefs,
|
|
2009
|
+
className: "chat-input-textarea",
|
|
2048
2010
|
placeholder,
|
|
2049
2011
|
value,
|
|
2050
2012
|
disabled,
|
|
2013
|
+
rows: 1,
|
|
2051
2014
|
onChange: handleChange,
|
|
2052
2015
|
onKeyDown: handleKeyDown
|
|
2053
2016
|
}
|
|
2054
2017
|
),
|
|
2055
|
-
/* @__PURE__ */
|
|
2018
|
+
/* @__PURE__ */ jsx302(
|
|
2056
2019
|
"button",
|
|
2057
2020
|
{
|
|
2058
2021
|
type: "button",
|
|
@@ -2060,7 +2023,7 @@ var ChatInput = React5.forwardRef(
|
|
|
2060
2023
|
disabled: !hasText || disabled,
|
|
2061
2024
|
onClick: handleSubmit,
|
|
2062
2025
|
"aria-label": "\uC804\uC1A1",
|
|
2063
|
-
children: /* @__PURE__ */
|
|
2026
|
+
children: /* @__PURE__ */ jsx302(SendIcon_default, {})
|
|
2064
2027
|
}
|
|
2065
2028
|
)
|
|
2066
2029
|
] });
|
|
@@ -2070,7 +2033,7 @@ ChatInput.displayName = "ChatInput";
|
|
|
2070
2033
|
var ChatInput_default = ChatInput;
|
|
2071
2034
|
|
|
2072
2035
|
// src/components/Box/Box.tsx
|
|
2073
|
-
import { jsx as
|
|
2036
|
+
import { jsx as jsx303, jsxs as jsxs195 } from "react/jsx-runtime";
|
|
2074
2037
|
var Box = ({
|
|
2075
2038
|
children,
|
|
2076
2039
|
title,
|
|
@@ -2078,21 +2041,21 @@ var Box = ({
|
|
|
2078
2041
|
padding = "md"
|
|
2079
2042
|
}) => {
|
|
2080
2043
|
return /* @__PURE__ */ jsxs195("div", { className: clsx_default("lib-xplat-box", variant, `pad-${padding}`), children: [
|
|
2081
|
-
title && /* @__PURE__ */
|
|
2082
|
-
/* @__PURE__ */
|
|
2044
|
+
title && /* @__PURE__ */ jsx303("div", { className: "box-title", children: title }),
|
|
2045
|
+
/* @__PURE__ */ jsx303("div", { className: "box-content", children })
|
|
2083
2046
|
] });
|
|
2084
2047
|
};
|
|
2085
2048
|
Box.displayName = "Box";
|
|
2086
2049
|
var Box_default = Box;
|
|
2087
2050
|
|
|
2088
2051
|
// src/components/CardTab/CardTab.tsx
|
|
2089
|
-
import
|
|
2052
|
+
import React5 from "react";
|
|
2090
2053
|
|
|
2091
2054
|
// src/components/CardTab/CardTabPanel.tsx
|
|
2092
|
-
import { jsx as
|
|
2055
|
+
import { jsx as jsx304 } from "react/jsx-runtime";
|
|
2093
2056
|
var CardTabPanel = (props) => {
|
|
2094
2057
|
const { children, columns = 3 } = props;
|
|
2095
|
-
return /* @__PURE__ */
|
|
2058
|
+
return /* @__PURE__ */ jsx304(
|
|
2096
2059
|
"div",
|
|
2097
2060
|
{
|
|
2098
2061
|
className: "card-tab-panel",
|
|
@@ -2105,7 +2068,7 @@ CardTabPanel.displayName = "CardTab.Panel";
|
|
|
2105
2068
|
var CardTabPanel_default = CardTabPanel;
|
|
2106
2069
|
|
|
2107
2070
|
// src/components/CardTab/CardTab.tsx
|
|
2108
|
-
import { jsx as
|
|
2071
|
+
import { jsx as jsx305, jsxs as jsxs196 } from "react/jsx-runtime";
|
|
2109
2072
|
var CardTabRoot = (props) => {
|
|
2110
2073
|
const {
|
|
2111
2074
|
tabs,
|
|
@@ -2115,7 +2078,7 @@ var CardTabRoot = (props) => {
|
|
|
2115
2078
|
children
|
|
2116
2079
|
} = props;
|
|
2117
2080
|
const isControlled = activeValueProp !== void 0;
|
|
2118
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
2081
|
+
const [uncontrolledValue, setUncontrolledValue] = React5.useState(tabs[0]?.value ?? "");
|
|
2119
2082
|
const activeValue = isControlled ? activeValueProp : uncontrolledValue;
|
|
2120
2083
|
const handleTabClick = (tab) => {
|
|
2121
2084
|
if (!isControlled) {
|
|
@@ -2123,16 +2086,16 @@ var CardTabRoot = (props) => {
|
|
|
2123
2086
|
}
|
|
2124
2087
|
onChange?.(tab);
|
|
2125
2088
|
};
|
|
2126
|
-
const panels =
|
|
2127
|
-
(child) =>
|
|
2089
|
+
const panels = React5.Children.toArray(children).filter(
|
|
2090
|
+
(child) => React5.isValidElement(child) && child.type === CardTabPanel_default
|
|
2128
2091
|
);
|
|
2129
2092
|
const activePanel = panels.find(
|
|
2130
2093
|
(panel) => panel.props.value === activeValue
|
|
2131
2094
|
);
|
|
2132
2095
|
return /* @__PURE__ */ jsxs196("div", { className: clsx_default("lib-xplat-card-tab", size), children: [
|
|
2133
|
-
/* @__PURE__ */
|
|
2096
|
+
/* @__PURE__ */ jsx305("div", { className: "card-tab-bar", children: tabs.map((tab) => {
|
|
2134
2097
|
const isActive = tab.value === activeValue;
|
|
2135
|
-
return /* @__PURE__ */
|
|
2098
|
+
return /* @__PURE__ */ jsx305(
|
|
2136
2099
|
"button",
|
|
2137
2100
|
{
|
|
2138
2101
|
className: clsx_default("card-tab-trigger", isActive && "active"),
|
|
@@ -2144,7 +2107,7 @@ var CardTabRoot = (props) => {
|
|
|
2144
2107
|
tab.value
|
|
2145
2108
|
);
|
|
2146
2109
|
}) }),
|
|
2147
|
-
/* @__PURE__ */
|
|
2110
|
+
/* @__PURE__ */ jsx305("div", { className: "card-tab-body", children: activePanel })
|
|
2148
2111
|
] });
|
|
2149
2112
|
};
|
|
2150
2113
|
CardTabRoot.displayName = "CardTab";
|
|
@@ -2154,8 +2117,8 @@ var CardTab = Object.assign(CardTabRoot, {
|
|
|
2154
2117
|
var CardTab_default = CardTab;
|
|
2155
2118
|
|
|
2156
2119
|
// src/components/Chart/Chart.tsx
|
|
2157
|
-
import
|
|
2158
|
-
import { Fragment as Fragment2, jsx as
|
|
2120
|
+
import React6 from "react";
|
|
2121
|
+
import { Fragment as Fragment2, jsx as jsx306, jsxs as jsxs197 } from "react/jsx-runtime";
|
|
2159
2122
|
var CATEGORICAL_COUNT2 = 8;
|
|
2160
2123
|
var LINE_BAR_PALETTES = Array.from({ length: CATEGORICAL_COUNT2 }, (_, i) => {
|
|
2161
2124
|
const n = i + 1;
|
|
@@ -2201,11 +2164,11 @@ var toSmoothPath = (points) => {
|
|
|
2201
2164
|
};
|
|
2202
2165
|
var RESIZE_SETTLE_MS = 150;
|
|
2203
2166
|
var useChartSize = (ref) => {
|
|
2204
|
-
const [size, setSize] =
|
|
2205
|
-
const settleTimer =
|
|
2206
|
-
const committedSize =
|
|
2207
|
-
const initialRef =
|
|
2208
|
-
|
|
2167
|
+
const [size, setSize] = React6.useState({ width: 0, height: 0 });
|
|
2168
|
+
const settleTimer = React6.useRef(0);
|
|
2169
|
+
const committedSize = React6.useRef({ width: 0, height: 0 });
|
|
2170
|
+
const initialRef = React6.useRef(true);
|
|
2171
|
+
React6.useEffect(() => {
|
|
2209
2172
|
const el = ref.current;
|
|
2210
2173
|
if (!el) return;
|
|
2211
2174
|
const observer = new ResizeObserver((entries) => {
|
|
@@ -2247,10 +2210,10 @@ var useChartSize = (ref) => {
|
|
|
2247
2210
|
};
|
|
2248
2211
|
var prefersReducedMotion = () => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
2249
2212
|
var useChartAnimation = (containerRef, dataKey) => {
|
|
2250
|
-
const [animate, setAnimate] =
|
|
2251
|
-
const prevDataKey =
|
|
2252
|
-
const hasAnimated =
|
|
2253
|
-
|
|
2213
|
+
const [animate, setAnimate] = React6.useState(false);
|
|
2214
|
+
const prevDataKey = React6.useRef(dataKey);
|
|
2215
|
+
const hasAnimated = React6.useRef(false);
|
|
2216
|
+
React6.useEffect(() => {
|
|
2254
2217
|
if (prefersReducedMotion()) return;
|
|
2255
2218
|
const el = containerRef.current;
|
|
2256
2219
|
if (!el) return;
|
|
@@ -2266,7 +2229,7 @@ var useChartAnimation = (containerRef, dataKey) => {
|
|
|
2266
2229
|
observer.observe(el);
|
|
2267
2230
|
return () => observer.disconnect();
|
|
2268
2231
|
}, [containerRef]);
|
|
2269
|
-
|
|
2232
|
+
React6.useEffect(() => {
|
|
2270
2233
|
if (dataKey !== prevDataKey.current) {
|
|
2271
2234
|
prevDataKey.current = dataKey;
|
|
2272
2235
|
if (prefersReducedMotion()) return;
|
|
@@ -2277,15 +2240,15 @@ var useChartAnimation = (containerRef, dataKey) => {
|
|
|
2277
2240
|
return animate || prefersReducedMotion();
|
|
2278
2241
|
};
|
|
2279
2242
|
var useChartTooltip = (enabled) => {
|
|
2280
|
-
const [tooltip, setTooltip] =
|
|
2243
|
+
const [tooltip, setTooltip] = React6.useState({
|
|
2281
2244
|
visible: false,
|
|
2282
2245
|
x: 0,
|
|
2283
2246
|
y: 0,
|
|
2284
2247
|
content: ""
|
|
2285
2248
|
});
|
|
2286
|
-
const containerRef =
|
|
2287
|
-
const rafRef =
|
|
2288
|
-
const move =
|
|
2249
|
+
const containerRef = React6.useRef(null);
|
|
2250
|
+
const rafRef = React6.useRef(0);
|
|
2251
|
+
const move = React6.useCallback((e) => {
|
|
2289
2252
|
if (!enabled) return;
|
|
2290
2253
|
const clientX = e.clientX;
|
|
2291
2254
|
const clientY = e.clientY;
|
|
@@ -2300,7 +2263,7 @@ var useChartTooltip = (enabled) => {
|
|
|
2300
2263
|
}));
|
|
2301
2264
|
});
|
|
2302
2265
|
}, [enabled]);
|
|
2303
|
-
const show =
|
|
2266
|
+
const show = React6.useCallback((e, content) => {
|
|
2304
2267
|
if (!enabled) return;
|
|
2305
2268
|
const rect = containerRef.current?.getBoundingClientRect();
|
|
2306
2269
|
if (!rect) return;
|
|
@@ -2311,18 +2274,18 @@ var useChartTooltip = (enabled) => {
|
|
|
2311
2274
|
content
|
|
2312
2275
|
});
|
|
2313
2276
|
}, [enabled]);
|
|
2314
|
-
const hide =
|
|
2277
|
+
const hide = React6.useCallback(() => {
|
|
2315
2278
|
cancelAnimationFrame(rafRef.current);
|
|
2316
2279
|
setTooltip((prev) => ({ ...prev, visible: false }));
|
|
2317
2280
|
}, []);
|
|
2318
2281
|
return { tooltip, show, hide, move, containerRef };
|
|
2319
2282
|
};
|
|
2320
|
-
var GridLines =
|
|
2283
|
+
var GridLines = React6.memo(({ width, height, chartH, maxVal }) => /* @__PURE__ */ jsx306(Fragment2, { children: [0, 0.25, 0.5, 0.75, 1].map((ratio) => {
|
|
2321
2284
|
const y = PADDING.top + (1 - ratio) * chartH;
|
|
2322
2285
|
const val = Math.round(maxVal * ratio);
|
|
2323
2286
|
return /* @__PURE__ */ jsxs197("g", { children: [
|
|
2324
|
-
/* @__PURE__ */
|
|
2325
|
-
/* @__PURE__ */
|
|
2287
|
+
/* @__PURE__ */ jsx306("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
|
|
2288
|
+
/* @__PURE__ */ jsx306("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
|
|
2326
2289
|
] }, ratio);
|
|
2327
2290
|
}) }));
|
|
2328
2291
|
GridLines.displayName = "GridLines";
|
|
@@ -2332,25 +2295,25 @@ var getLabelStep = (count, chartW) => {
|
|
|
2332
2295
|
if (count <= maxLabels) return 1;
|
|
2333
2296
|
return Math.ceil(count / maxLabels);
|
|
2334
2297
|
};
|
|
2335
|
-
var AxisLabels =
|
|
2298
|
+
var AxisLabels = React6.memo(({ labels, count, chartW, height }) => {
|
|
2336
2299
|
const step = getLabelStep(count, chartW);
|
|
2337
|
-
return /* @__PURE__ */
|
|
2300
|
+
return /* @__PURE__ */ jsx306(Fragment2, { children: labels.map((label, i) => {
|
|
2338
2301
|
if (i % step !== 0) return null;
|
|
2339
2302
|
const x = PADDING.left + i / (count - 1 || 1) * chartW;
|
|
2340
|
-
return /* @__PURE__ */
|
|
2303
|
+
return /* @__PURE__ */ jsx306("text", { x, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
2341
2304
|
}) });
|
|
2342
2305
|
});
|
|
2343
2306
|
AxisLabels.displayName = "AxisLabels";
|
|
2344
|
-
var LineChart =
|
|
2345
|
-
const entries =
|
|
2346
|
-
const maxVal =
|
|
2307
|
+
var LineChart = React6.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
|
|
2308
|
+
const entries = React6.useMemo(() => Object.entries(data), [data]);
|
|
2309
|
+
const maxVal = React6.useMemo(() => {
|
|
2347
2310
|
const allValues = entries.flatMap(([, v]) => v);
|
|
2348
2311
|
return Math.max(...allValues) * 1.2 || 1;
|
|
2349
2312
|
}, [entries]);
|
|
2350
2313
|
const count = labels.length;
|
|
2351
2314
|
const chartW = width - PADDING.left - PADDING.right;
|
|
2352
2315
|
const chartH = height - PADDING.top - PADDING.bottom;
|
|
2353
|
-
const seriesPoints =
|
|
2316
|
+
const seriesPoints = React6.useMemo(
|
|
2354
2317
|
() => entries.map(
|
|
2355
2318
|
([, values]) => values.map((v, i) => ({
|
|
2356
2319
|
x: PADDING.left + i / (count - 1 || 1) * chartW,
|
|
@@ -2361,8 +2324,8 @@ var LineChart = React7.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
2361
2324
|
[entries, count, chartW, chartH, maxVal]
|
|
2362
2325
|
);
|
|
2363
2326
|
const showPoints = count <= 100;
|
|
2364
|
-
const lineRefs =
|
|
2365
|
-
|
|
2327
|
+
const lineRefs = React6.useRef([]);
|
|
2328
|
+
React6.useEffect(() => {
|
|
2366
2329
|
if (!animate) return;
|
|
2367
2330
|
lineRefs.current.forEach((el) => {
|
|
2368
2331
|
if (!el) return;
|
|
@@ -2376,8 +2339,8 @@ var LineChart = React7.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
2376
2339
|
});
|
|
2377
2340
|
}, [animate, seriesPoints]);
|
|
2378
2341
|
return /* @__PURE__ */ jsxs197("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
2379
|
-
/* @__PURE__ */
|
|
2380
|
-
/* @__PURE__ */
|
|
2342
|
+
/* @__PURE__ */ jsx306(GridLines, { width, height, chartH, maxVal }),
|
|
2343
|
+
/* @__PURE__ */ jsx306(AxisLabels, { labels, count, chartW, height }),
|
|
2381
2344
|
entries.map(([key], di) => {
|
|
2382
2345
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
2383
2346
|
const color = palette[2];
|
|
@@ -2387,11 +2350,11 @@ var LineChart = React7.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
2387
2350
|
const polyPoints = points.map((p) => `${p.x},${p.y}`).join(" ");
|
|
2388
2351
|
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`;
|
|
2389
2352
|
return /* @__PURE__ */ jsxs197("g", { children: [
|
|
2390
|
-
/* @__PURE__ */
|
|
2391
|
-
/* @__PURE__ */
|
|
2392
|
-
/* @__PURE__ */
|
|
2353
|
+
/* @__PURE__ */ jsx306("defs", { children: /* @__PURE__ */ jsxs197("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
2354
|
+
/* @__PURE__ */ jsx306("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.2" }),
|
|
2355
|
+
/* @__PURE__ */ jsx306("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0" })
|
|
2393
2356
|
] }) }),
|
|
2394
|
-
/* @__PURE__ */
|
|
2357
|
+
/* @__PURE__ */ jsx306(
|
|
2395
2358
|
"path",
|
|
2396
2359
|
{
|
|
2397
2360
|
d: areaD,
|
|
@@ -2400,7 +2363,7 @@ var LineChart = React7.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
2400
2363
|
style: animate ? { animationDelay: "600ms" } : { opacity: 1 }
|
|
2401
2364
|
}
|
|
2402
2365
|
),
|
|
2403
|
-
/* @__PURE__ */
|
|
2366
|
+
/* @__PURE__ */ jsx306(
|
|
2404
2367
|
"polyline",
|
|
2405
2368
|
{
|
|
2406
2369
|
ref: (el) => {
|
|
@@ -2412,7 +2375,7 @@ var LineChart = React7.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
2412
2375
|
strokeWidth: "2"
|
|
2413
2376
|
}
|
|
2414
2377
|
),
|
|
2415
|
-
showPoints && points.map((p, i) => /* @__PURE__ */
|
|
2378
|
+
showPoints && points.map((p, i) => /* @__PURE__ */ jsx306(
|
|
2416
2379
|
"circle",
|
|
2417
2380
|
{
|
|
2418
2381
|
cx: p.x,
|
|
@@ -2431,16 +2394,16 @@ var LineChart = React7.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
2431
2394
|
] });
|
|
2432
2395
|
});
|
|
2433
2396
|
LineChart.displayName = "LineChart";
|
|
2434
|
-
var CurveChart =
|
|
2435
|
-
const entries =
|
|
2436
|
-
const maxVal =
|
|
2397
|
+
var CurveChart = React6.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
|
|
2398
|
+
const entries = React6.useMemo(() => Object.entries(data), [data]);
|
|
2399
|
+
const maxVal = React6.useMemo(() => {
|
|
2437
2400
|
const allValues = entries.flatMap(([, v]) => v);
|
|
2438
2401
|
return Math.max(...allValues) * 1.2 || 1;
|
|
2439
2402
|
}, [entries]);
|
|
2440
2403
|
const count = labels.length;
|
|
2441
2404
|
const chartW = width - PADDING.left - PADDING.right;
|
|
2442
2405
|
const chartH = height - PADDING.top - PADDING.bottom;
|
|
2443
|
-
const seriesPoints =
|
|
2406
|
+
const seriesPoints = React6.useMemo(
|
|
2444
2407
|
() => entries.map(
|
|
2445
2408
|
([, values]) => values.map((v, i) => ({
|
|
2446
2409
|
x: PADDING.left + i / (count - 1 || 1) * chartW,
|
|
@@ -2451,8 +2414,8 @@ var CurveChart = React7.memo(({ data, labels, width, height, animate, onHover, o
|
|
|
2451
2414
|
[entries, count, chartW, chartH, maxVal]
|
|
2452
2415
|
);
|
|
2453
2416
|
const showPoints = count <= 100;
|
|
2454
|
-
const lineRefs =
|
|
2455
|
-
|
|
2417
|
+
const lineRefs = React6.useRef([]);
|
|
2418
|
+
React6.useEffect(() => {
|
|
2456
2419
|
if (!animate) return;
|
|
2457
2420
|
lineRefs.current.forEach((el) => {
|
|
2458
2421
|
if (!el) return;
|
|
@@ -2466,8 +2429,8 @@ var CurveChart = React7.memo(({ data, labels, width, height, animate, onHover, o
|
|
|
2466
2429
|
});
|
|
2467
2430
|
}, [animate, seriesPoints]);
|
|
2468
2431
|
return /* @__PURE__ */ jsxs197("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
2469
|
-
/* @__PURE__ */
|
|
2470
|
-
/* @__PURE__ */
|
|
2432
|
+
/* @__PURE__ */ jsx306(GridLines, { width, height, chartH, maxVal }),
|
|
2433
|
+
/* @__PURE__ */ jsx306(AxisLabels, { labels, count, chartW, height }),
|
|
2471
2434
|
entries.map(([key], di) => {
|
|
2472
2435
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
2473
2436
|
const color = palette[2];
|
|
@@ -2477,11 +2440,11 @@ var CurveChart = React7.memo(({ data, labels, width, height, animate, onHover, o
|
|
|
2477
2440
|
const linePath = toSmoothPath(points);
|
|
2478
2441
|
const areaPath = linePath + ` L ${points[points.length - 1].x} ${PADDING.top + chartH} L ${points[0].x} ${PADDING.top + chartH} Z`;
|
|
2479
2442
|
return /* @__PURE__ */ jsxs197("g", { children: [
|
|
2480
|
-
/* @__PURE__ */
|
|
2481
|
-
/* @__PURE__ */
|
|
2482
|
-
/* @__PURE__ */
|
|
2443
|
+
/* @__PURE__ */ jsx306("defs", { children: /* @__PURE__ */ jsxs197("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
2444
|
+
/* @__PURE__ */ jsx306("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.4" }),
|
|
2445
|
+
/* @__PURE__ */ jsx306("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0.02" })
|
|
2483
2446
|
] }) }),
|
|
2484
|
-
/* @__PURE__ */
|
|
2447
|
+
/* @__PURE__ */ jsx306(
|
|
2485
2448
|
"path",
|
|
2486
2449
|
{
|
|
2487
2450
|
d: areaPath,
|
|
@@ -2490,7 +2453,7 @@ var CurveChart = React7.memo(({ data, labels, width, height, animate, onHover, o
|
|
|
2490
2453
|
style: animate ? { animationDelay: "600ms" } : { opacity: 1 }
|
|
2491
2454
|
}
|
|
2492
2455
|
),
|
|
2493
|
-
/* @__PURE__ */
|
|
2456
|
+
/* @__PURE__ */ jsx306(
|
|
2494
2457
|
"path",
|
|
2495
2458
|
{
|
|
2496
2459
|
ref: (el) => {
|
|
@@ -2502,7 +2465,7 @@ var CurveChart = React7.memo(({ data, labels, width, height, animate, onHover, o
|
|
|
2502
2465
|
strokeWidth: "2"
|
|
2503
2466
|
}
|
|
2504
2467
|
),
|
|
2505
|
-
showPoints && points.map((p, i) => /* @__PURE__ */
|
|
2468
|
+
showPoints && points.map((p, i) => /* @__PURE__ */ jsx306(
|
|
2506
2469
|
"circle",
|
|
2507
2470
|
{
|
|
2508
2471
|
cx: p.x,
|
|
@@ -2521,9 +2484,9 @@ var CurveChart = React7.memo(({ data, labels, width, height, animate, onHover, o
|
|
|
2521
2484
|
] });
|
|
2522
2485
|
});
|
|
2523
2486
|
CurveChart.displayName = "CurveChart";
|
|
2524
|
-
var BarChart =
|
|
2525
|
-
const entries =
|
|
2526
|
-
const maxVal =
|
|
2487
|
+
var BarChart = React6.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
|
|
2488
|
+
const entries = React6.useMemo(() => Object.entries(data), [data]);
|
|
2489
|
+
const maxVal = React6.useMemo(() => {
|
|
2527
2490
|
const allValues = entries.flatMap(([, v]) => v);
|
|
2528
2491
|
return Math.max(...allValues) * 1.2 || 1;
|
|
2529
2492
|
}, [entries]);
|
|
@@ -2535,7 +2498,7 @@ var BarChart = React7.memo(({ data, labels, width, height, animate, onHover, onM
|
|
|
2535
2498
|
const barGap = groupCount > 1 ? 2 : 0;
|
|
2536
2499
|
const barW = Math.max(1, Math.min(32, (groupW * 0.7 - barGap * (groupCount - 1)) / groupCount));
|
|
2537
2500
|
const baseline = PADDING.top + chartH;
|
|
2538
|
-
const bars =
|
|
2501
|
+
const bars = React6.useMemo(
|
|
2539
2502
|
() => entries.map(
|
|
2540
2503
|
([, values], di) => values.map((v, i) => {
|
|
2541
2504
|
const totalBarsW = barW * groupCount + barGap * (groupCount - 1);
|
|
@@ -2549,10 +2512,10 @@ var BarChart = React7.memo(({ data, labels, width, height, animate, onHover, onM
|
|
|
2549
2512
|
);
|
|
2550
2513
|
const barLabelStep = getLabelStep(count, chartW);
|
|
2551
2514
|
return /* @__PURE__ */ jsxs197("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
2552
|
-
/* @__PURE__ */
|
|
2515
|
+
/* @__PURE__ */ jsx306(GridLines, { width, height, chartH, maxVal }),
|
|
2553
2516
|
labels.map((label, i) => {
|
|
2554
2517
|
if (i % barLabelStep !== 0) return null;
|
|
2555
|
-
return /* @__PURE__ */
|
|
2518
|
+
return /* @__PURE__ */ jsx306("text", { x: PADDING.left + groupW * i + groupW / 2, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
2556
2519
|
}),
|
|
2557
2520
|
entries.map(([key], di) => {
|
|
2558
2521
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
@@ -2561,7 +2524,7 @@ var BarChart = React7.memo(({ data, labels, width, height, animate, onHover, onM
|
|
|
2561
2524
|
const r2 = Math.min(4, b.w / 2);
|
|
2562
2525
|
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`;
|
|
2563
2526
|
const delay = 100 + i * 80;
|
|
2564
|
-
return /* @__PURE__ */
|
|
2527
|
+
return /* @__PURE__ */ jsx306(
|
|
2565
2528
|
"path",
|
|
2566
2529
|
{
|
|
2567
2530
|
d,
|
|
@@ -2582,11 +2545,11 @@ var BarChart = React7.memo(({ data, labels, width, height, animate, onHover, onM
|
|
|
2582
2545
|
] });
|
|
2583
2546
|
});
|
|
2584
2547
|
BarChart.displayName = "BarChart";
|
|
2585
|
-
var PieDonutChart =
|
|
2548
|
+
var PieDonutChart = React6.memo(
|
|
2586
2549
|
({ data, labels, width, height, animate, isDoughnut, onHover, onMove, onLeave }) => {
|
|
2587
|
-
const entries =
|
|
2588
|
-
const values =
|
|
2589
|
-
const total =
|
|
2550
|
+
const entries = React6.useMemo(() => Object.entries(data), [data]);
|
|
2551
|
+
const values = React6.useMemo(() => entries.flatMap(([, v]) => v), [entries]);
|
|
2552
|
+
const total = React6.useMemo(() => values.reduce((a, b) => a + b, 0) || 1, [values]);
|
|
2590
2553
|
const size = Math.min(width, height);
|
|
2591
2554
|
const cx = size / 2;
|
|
2592
2555
|
const cy = size / 2;
|
|
@@ -2594,10 +2557,10 @@ var PieDonutChart = React7.memo(
|
|
|
2594
2557
|
const innerR = isDoughnut ? r2 * 0.5 : 0;
|
|
2595
2558
|
const firstKey = entries[0]?.[0] ?? "";
|
|
2596
2559
|
const colorOffset = hashString(firstKey);
|
|
2597
|
-
const maskRef =
|
|
2560
|
+
const maskRef = React6.useRef(null);
|
|
2598
2561
|
const maskR = r2 + 10;
|
|
2599
2562
|
const maskCircumference = 2 * Math.PI * maskR;
|
|
2600
|
-
|
|
2563
|
+
React6.useEffect(() => {
|
|
2601
2564
|
if (!animate || !maskRef.current) return;
|
|
2602
2565
|
const el = maskRef.current;
|
|
2603
2566
|
el.style.strokeDasharray = `${maskCircumference}`;
|
|
@@ -2607,7 +2570,7 @@ var PieDonutChart = React7.memo(
|
|
|
2607
2570
|
el.style.strokeDashoffset = "0";
|
|
2608
2571
|
});
|
|
2609
2572
|
}, [animate, maskCircumference]);
|
|
2610
|
-
const sliceData =
|
|
2573
|
+
const sliceData = React6.useMemo(() => {
|
|
2611
2574
|
let angle0 = -Math.PI / 2;
|
|
2612
2575
|
let cumulativeAngle = 0;
|
|
2613
2576
|
return values.map((v, i) => {
|
|
@@ -2642,7 +2605,7 @@ var PieDonutChart = React7.memo(
|
|
|
2642
2605
|
}, [values, total, cx, cy, r2, innerR, labels]);
|
|
2643
2606
|
const maskId = `pie-mask-${isDoughnut ? "d" : "p"}`;
|
|
2644
2607
|
return /* @__PURE__ */ jsxs197("svg", { viewBox: `0 0 ${size} ${size}`, className: "chart-svg chart-pie", children: [
|
|
2645
|
-
animate && /* @__PURE__ */
|
|
2608
|
+
animate && /* @__PURE__ */ jsx306("defs", { children: /* @__PURE__ */ jsx306("mask", { id: maskId, children: /* @__PURE__ */ jsx306(
|
|
2646
2609
|
"circle",
|
|
2647
2610
|
{
|
|
2648
2611
|
ref: maskRef,
|
|
@@ -2655,7 +2618,7 @@ var PieDonutChart = React7.memo(
|
|
|
2655
2618
|
transform: `rotate(-90 ${cx} ${cy})`
|
|
2656
2619
|
}
|
|
2657
2620
|
) }) }),
|
|
2658
|
-
/* @__PURE__ */
|
|
2621
|
+
/* @__PURE__ */ jsx306("g", { mask: animate ? `url(#${maskId})` : void 0, children: sliceData.map((s, i) => /* @__PURE__ */ jsx306("g", { children: /* @__PURE__ */ jsx306(
|
|
2659
2622
|
"path",
|
|
2660
2623
|
{
|
|
2661
2624
|
d: s.d,
|
|
@@ -2666,7 +2629,7 @@ var PieDonutChart = React7.memo(
|
|
|
2666
2629
|
onMouseLeave: onLeave
|
|
2667
2630
|
}
|
|
2668
2631
|
) }, i)) }),
|
|
2669
|
-
sliceData.map((s, i) => s.angle > 0.2 && /* @__PURE__ */
|
|
2632
|
+
sliceData.map((s, i) => s.angle > 0.2 && /* @__PURE__ */ jsx306(
|
|
2670
2633
|
"text",
|
|
2671
2634
|
{
|
|
2672
2635
|
x: s.lx,
|
|
@@ -2684,9 +2647,9 @@ var PieDonutChart = React7.memo(
|
|
|
2684
2647
|
);
|
|
2685
2648
|
PieDonutChart.displayName = "PieDonutChart";
|
|
2686
2649
|
var TooltipBubble = ({ x, y, containerWidth, children }) => {
|
|
2687
|
-
const ref =
|
|
2688
|
-
const [adjustedX, setAdjustedX] =
|
|
2689
|
-
|
|
2650
|
+
const ref = React6.useRef(null);
|
|
2651
|
+
const [adjustedX, setAdjustedX] = React6.useState(x);
|
|
2652
|
+
React6.useEffect(() => {
|
|
2690
2653
|
const el = ref.current;
|
|
2691
2654
|
if (!el) return;
|
|
2692
2655
|
const w = el.offsetWidth;
|
|
@@ -2697,7 +2660,7 @@ var TooltipBubble = ({ x, y, containerWidth, children }) => {
|
|
|
2697
2660
|
else if (x + half > containerWidth - margin) nx = containerWidth - half - margin;
|
|
2698
2661
|
setAdjustedX(nx);
|
|
2699
2662
|
}, [x, containerWidth]);
|
|
2700
|
-
return /* @__PURE__ */
|
|
2663
|
+
return /* @__PURE__ */ jsx306(
|
|
2701
2664
|
"div",
|
|
2702
2665
|
{
|
|
2703
2666
|
ref,
|
|
@@ -2707,22 +2670,22 @@ var TooltipBubble = ({ x, y, containerWidth, children }) => {
|
|
|
2707
2670
|
}
|
|
2708
2671
|
);
|
|
2709
2672
|
};
|
|
2710
|
-
var Chart =
|
|
2673
|
+
var Chart = React6.memo((props) => {
|
|
2711
2674
|
const { type, data, labels, tooltip: showTooltip = true } = props;
|
|
2712
2675
|
const { tooltip, show, hide, move, containerRef } = useChartTooltip(showTooltip);
|
|
2713
2676
|
const { width, height } = useChartSize(containerRef);
|
|
2714
|
-
const stableData =
|
|
2715
|
-
const stableLabels =
|
|
2716
|
-
const dataKey =
|
|
2677
|
+
const stableData = React6.useMemo(() => data, [JSON.stringify(data)]);
|
|
2678
|
+
const stableLabels = React6.useMemo(() => labels, [JSON.stringify(labels)]);
|
|
2679
|
+
const dataKey = React6.useMemo(() => JSON.stringify(labels), [labels]);
|
|
2717
2680
|
const animate = useChartAnimation(containerRef, dataKey);
|
|
2718
2681
|
const ready = width > 0 && height > 0;
|
|
2719
2682
|
return /* @__PURE__ */ jsxs197("div", { className: "lib-xplat-chart", ref: containerRef, children: [
|
|
2720
|
-
ready && type === "line" && /* @__PURE__ */
|
|
2721
|
-
ready && type === "curve" && /* @__PURE__ */
|
|
2722
|
-
ready && type === "bar" && /* @__PURE__ */
|
|
2723
|
-
ready && type === "pie" && /* @__PURE__ */
|
|
2724
|
-
ready && type === "doughnut" && /* @__PURE__ */
|
|
2725
|
-
tooltip.visible && /* @__PURE__ */
|
|
2683
|
+
ready && type === "line" && /* @__PURE__ */ jsx306(LineChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2684
|
+
ready && type === "curve" && /* @__PURE__ */ jsx306(CurveChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2685
|
+
ready && type === "bar" && /* @__PURE__ */ jsx306(BarChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2686
|
+
ready && type === "pie" && /* @__PURE__ */ jsx306(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2687
|
+
ready && type === "doughnut" && /* @__PURE__ */ jsx306(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, isDoughnut: true, onHover: show, onMove: move, onLeave: hide }),
|
|
2688
|
+
tooltip.visible && /* @__PURE__ */ jsx306(TooltipBubble, { x: tooltip.x, y: tooltip.y, containerWidth: width, children: tooltip.content })
|
|
2726
2689
|
] });
|
|
2727
2690
|
});
|
|
2728
2691
|
Chart.displayName = "Chart";
|
|
@@ -2735,7 +2698,7 @@ import { primitive, semantic } from "@x-plat/tokens-core";
|
|
|
2735
2698
|
import { cssVar } from "@x-plat/tokens-core";
|
|
2736
2699
|
|
|
2737
2700
|
// src/components/CheckBox/CheckBox.tsx
|
|
2738
|
-
import { jsx as
|
|
2701
|
+
import { jsx as jsx307, jsxs as jsxs198 } from "react/jsx-runtime";
|
|
2739
2702
|
var CheckBox = (props) => {
|
|
2740
2703
|
const {
|
|
2741
2704
|
checked,
|
|
@@ -2754,7 +2717,7 @@ var CheckBox = (props) => {
|
|
|
2754
2717
|
const disabledClasses = "disabled";
|
|
2755
2718
|
const boxClasses = disabled ? disabledClasses : checked ? checkedClasses : uncheckedClasses;
|
|
2756
2719
|
return /* @__PURE__ */ jsxs198("label", { className: clsx_default("lib-xplat-checkbox", size, type), children: [
|
|
2757
|
-
/* @__PURE__ */
|
|
2720
|
+
/* @__PURE__ */ jsx307(
|
|
2758
2721
|
"input",
|
|
2759
2722
|
{
|
|
2760
2723
|
type: "checkbox",
|
|
@@ -2764,44 +2727,44 @@ var CheckBox = (props) => {
|
|
|
2764
2727
|
...rest
|
|
2765
2728
|
}
|
|
2766
2729
|
),
|
|
2767
|
-
/* @__PURE__ */
|
|
2768
|
-
label && /* @__PURE__ */
|
|
2730
|
+
/* @__PURE__ */ jsx307("span", { className: clsx_default("checkbox", boxClasses), children: /* @__PURE__ */ jsx307("span", { className: clsx_default("check-icon", { visible: checked }), children: /* @__PURE__ */ jsx307(CheckIcon_default, {}) }) }),
|
|
2731
|
+
label && /* @__PURE__ */ jsx307("span", { className: "label", children: label })
|
|
2769
2732
|
] });
|
|
2770
2733
|
};
|
|
2771
2734
|
CheckBox.displayName = "CheckBox";
|
|
2772
2735
|
var CheckBox_default = CheckBox;
|
|
2773
2736
|
|
|
2774
2737
|
// src/components/Chip/Chip.tsx
|
|
2775
|
-
import { jsx as
|
|
2738
|
+
import { jsx as jsx308 } from "react/jsx-runtime";
|
|
2776
2739
|
var Chip = (props) => {
|
|
2777
2740
|
const {
|
|
2778
2741
|
children,
|
|
2779
2742
|
type = "primary",
|
|
2780
2743
|
size = "md"
|
|
2781
2744
|
} = props;
|
|
2782
|
-
return /* @__PURE__ */
|
|
2745
|
+
return /* @__PURE__ */ jsx308("div", { className: clsx_default("lib-xplat-chip", type, size), children });
|
|
2783
2746
|
};
|
|
2784
2747
|
Chip.displayName = "Chip";
|
|
2785
2748
|
var Chip_default = Chip;
|
|
2786
2749
|
|
|
2787
2750
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
2788
|
-
import
|
|
2751
|
+
import React12 from "react";
|
|
2789
2752
|
|
|
2790
2753
|
// src/components/Input/Input.tsx
|
|
2791
|
-
import
|
|
2754
|
+
import React7 from "react";
|
|
2792
2755
|
|
|
2793
2756
|
// src/components/Input/InputValidations.tsx
|
|
2794
|
-
import { jsx as
|
|
2757
|
+
import { jsx as jsx309, jsxs as jsxs199 } from "react/jsx-runtime";
|
|
2795
2758
|
var InputValidations = (props) => {
|
|
2796
2759
|
const { message, status = "default" } = props;
|
|
2797
2760
|
return /* @__PURE__ */ jsxs199("div", { className: clsx_default("lib-xplat-input-validation", status), children: [
|
|
2798
2761
|
/* @__PURE__ */ jsxs199("div", { className: "icon", children: [
|
|
2799
|
-
status === "default" && /* @__PURE__ */
|
|
2800
|
-
status === "success" && /* @__PURE__ */
|
|
2801
|
-
status === "warning" && /* @__PURE__ */
|
|
2802
|
-
status === "error" && /* @__PURE__ */
|
|
2762
|
+
status === "default" && /* @__PURE__ */ jsx309(InfoIcon_default, {}),
|
|
2763
|
+
status === "success" && /* @__PURE__ */ jsx309(SuccessIcon_default, {}),
|
|
2764
|
+
status === "warning" && /* @__PURE__ */ jsx309(InfoIcon_default, {}),
|
|
2765
|
+
status === "error" && /* @__PURE__ */ jsx309(ErrorIcon_default, {})
|
|
2803
2766
|
] }),
|
|
2804
|
-
/* @__PURE__ */
|
|
2767
|
+
/* @__PURE__ */ jsx309("div", { className: "message", children: message })
|
|
2805
2768
|
] });
|
|
2806
2769
|
};
|
|
2807
2770
|
InputValidations.displayName = "InputValidations";
|
|
@@ -2842,7 +2805,7 @@ var handleTelBackspace = (prevValue, currValue) => {
|
|
|
2842
2805
|
};
|
|
2843
2806
|
|
|
2844
2807
|
// src/components/Input/Input.tsx
|
|
2845
|
-
import { jsx as
|
|
2808
|
+
import { jsx as jsx310, jsxs as jsxs200 } from "react/jsx-runtime";
|
|
2846
2809
|
import { createElement } from "react";
|
|
2847
2810
|
var formatValue = (type, value) => {
|
|
2848
2811
|
if (value === null || value === void 0) return "";
|
|
@@ -2891,7 +2854,7 @@ var parseValue = (type, value) => {
|
|
|
2891
2854
|
return value;
|
|
2892
2855
|
}
|
|
2893
2856
|
};
|
|
2894
|
-
var Input =
|
|
2857
|
+
var Input = React7.forwardRef((props, ref) => {
|
|
2895
2858
|
const {
|
|
2896
2859
|
value,
|
|
2897
2860
|
onChange,
|
|
@@ -2923,7 +2886,7 @@ var Input = React8.forwardRef((props, ref) => {
|
|
|
2923
2886
|
{
|
|
2924
2887
|
className: clsx_default("lib-xplat-input", size, disabled ? "disabled" : void 0),
|
|
2925
2888
|
children: [
|
|
2926
|
-
/* @__PURE__ */
|
|
2889
|
+
/* @__PURE__ */ jsx310(
|
|
2927
2890
|
"input",
|
|
2928
2891
|
{
|
|
2929
2892
|
...inputProps,
|
|
@@ -2934,11 +2897,11 @@ var Input = React8.forwardRef((props, ref) => {
|
|
|
2934
2897
|
onChange: handleChange
|
|
2935
2898
|
}
|
|
2936
2899
|
),
|
|
2937
|
-
suffix && /* @__PURE__ */
|
|
2900
|
+
suffix && /* @__PURE__ */ jsx310("div", { className: "suffix", children: suffix })
|
|
2938
2901
|
]
|
|
2939
2902
|
}
|
|
2940
2903
|
),
|
|
2941
|
-
validations && /* @__PURE__ */
|
|
2904
|
+
validations && /* @__PURE__ */ jsx310("div", { className: "lib-xplat-input-validation-wrap", children: validations?.map((validation, idx) => /* @__PURE__ */ createElement(
|
|
2942
2905
|
InputValidations_default,
|
|
2943
2906
|
{
|
|
2944
2907
|
...validation,
|
|
@@ -2951,20 +2914,20 @@ Input.displayName = "Input";
|
|
|
2951
2914
|
var Input_default = Input;
|
|
2952
2915
|
|
|
2953
2916
|
// src/components/Input/PasswordInput/PasswordInput.tsx
|
|
2954
|
-
import
|
|
2955
|
-
import { jsx as
|
|
2956
|
-
var PasswordInput =
|
|
2917
|
+
import React8 from "react";
|
|
2918
|
+
import { jsx as jsx311 } from "react/jsx-runtime";
|
|
2919
|
+
var PasswordInput = React8.forwardRef(
|
|
2957
2920
|
(props, ref) => {
|
|
2958
2921
|
const { reg: _reg, ...inputProps } = props;
|
|
2959
|
-
const [isView, setIsView] =
|
|
2922
|
+
const [isView, setIsView] = React8.useState(false);
|
|
2960
2923
|
const handleChangeView = () => {
|
|
2961
2924
|
setIsView((prev) => !prev);
|
|
2962
2925
|
};
|
|
2963
|
-
return /* @__PURE__ */
|
|
2926
|
+
return /* @__PURE__ */ jsx311(
|
|
2964
2927
|
Input_default,
|
|
2965
2928
|
{
|
|
2966
2929
|
...inputProps,
|
|
2967
|
-
suffix: /* @__PURE__ */
|
|
2930
|
+
suffix: /* @__PURE__ */ jsx311("div", { className: "wrapper pointer", onClick: handleChangeView, children: isView ? /* @__PURE__ */ jsx311(OpenEyeIcon_default, {}) : /* @__PURE__ */ jsx311(CloseEyeIcon_default, {}) }),
|
|
2968
2931
|
type: isView ? "text" : "password",
|
|
2969
2932
|
ref
|
|
2970
2933
|
}
|
|
@@ -2975,17 +2938,17 @@ PasswordInput.displayName = "PasswordInput";
|
|
|
2975
2938
|
var PasswordInput_default = PasswordInput;
|
|
2976
2939
|
|
|
2977
2940
|
// src/components/Modal/Modal.tsx
|
|
2978
|
-
import
|
|
2941
|
+
import React10 from "react";
|
|
2979
2942
|
import { createPortal } from "react-dom";
|
|
2980
2943
|
|
|
2981
2944
|
// src/tokens/hooks/Portal.tsx
|
|
2982
|
-
import
|
|
2945
|
+
import React9 from "react";
|
|
2983
2946
|
import ReactDOM from "react-dom";
|
|
2984
|
-
import { jsx as
|
|
2985
|
-
var PortalContainerContext =
|
|
2986
|
-
var PortalProvider = ({ container, children }) => /* @__PURE__ */
|
|
2947
|
+
import { jsx as jsx312 } from "react/jsx-runtime";
|
|
2948
|
+
var PortalContainerContext = React9.createContext(null);
|
|
2949
|
+
var PortalProvider = ({ container, children }) => /* @__PURE__ */ jsx312(PortalContainerContext.Provider, { value: container, children });
|
|
2987
2950
|
var Portal = ({ children }) => {
|
|
2988
|
-
const contextContainer =
|
|
2951
|
+
const contextContainer = React9.useContext(PortalContainerContext);
|
|
2989
2952
|
if (typeof document === "undefined") return null;
|
|
2990
2953
|
const container = contextContainer ?? document.body;
|
|
2991
2954
|
return ReactDOM.createPortal(children, container);
|
|
@@ -2994,14 +2957,14 @@ Portal.displayName = "Portal";
|
|
|
2994
2957
|
var Portal_default = Portal;
|
|
2995
2958
|
|
|
2996
2959
|
// src/components/Modal/Modal.tsx
|
|
2997
|
-
import { jsx as
|
|
2960
|
+
import { jsx as jsx313 } from "react/jsx-runtime";
|
|
2998
2961
|
var ANIMATION_DURATION_MS = 200;
|
|
2999
2962
|
var Modal = (props) => {
|
|
3000
2963
|
const { isOpen, onClose, children } = props;
|
|
3001
|
-
const [mounted, setMounted] =
|
|
3002
|
-
const [visible, setVisible] =
|
|
3003
|
-
const boxRef =
|
|
3004
|
-
|
|
2964
|
+
const [mounted, setMounted] = React10.useState(false);
|
|
2965
|
+
const [visible, setVisible] = React10.useState(false);
|
|
2966
|
+
const boxRef = React10.useRef(null);
|
|
2967
|
+
React10.useEffect(() => {
|
|
3005
2968
|
if (isOpen) {
|
|
3006
2969
|
setMounted(true);
|
|
3007
2970
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -3015,12 +2978,12 @@ var Modal = (props) => {
|
|
|
3015
2978
|
if (!mounted) return null;
|
|
3016
2979
|
const stateClass = visible ? "enter" : "exit";
|
|
3017
2980
|
return createPortal(
|
|
3018
|
-
/* @__PURE__ */
|
|
2981
|
+
/* @__PURE__ */ jsx313(
|
|
3019
2982
|
"div",
|
|
3020
2983
|
{
|
|
3021
2984
|
className: clsx_default("lib-xplat-modal", "dim", stateClass),
|
|
3022
2985
|
onClick: onClose,
|
|
3023
|
-
children: /* @__PURE__ */
|
|
2986
|
+
children: /* @__PURE__ */ jsx313(
|
|
3024
2987
|
"div",
|
|
3025
2988
|
{
|
|
3026
2989
|
ref: boxRef,
|
|
@@ -3028,7 +2991,7 @@ var Modal = (props) => {
|
|
|
3028
2991
|
role: "dialog",
|
|
3029
2992
|
"aria-modal": "true",
|
|
3030
2993
|
onClick: (e) => e.stopPropagation(),
|
|
3031
|
-
children: /* @__PURE__ */
|
|
2994
|
+
children: /* @__PURE__ */ jsx313(PortalProvider, { container: boxRef.current, children })
|
|
3032
2995
|
}
|
|
3033
2996
|
)
|
|
3034
2997
|
}
|
|
@@ -3040,9 +3003,9 @@ Modal.displayName = "Modal";
|
|
|
3040
3003
|
var Modal_default = Modal;
|
|
3041
3004
|
|
|
3042
3005
|
// src/components/DatePicker/SingleDatePicker/index.tsx
|
|
3043
|
-
import
|
|
3044
|
-
import { Fragment as Fragment3, jsx as
|
|
3045
|
-
var DayCell2 =
|
|
3006
|
+
import React11 from "react";
|
|
3007
|
+
import { Fragment as Fragment3, jsx as jsx314, jsxs as jsxs201 } from "react/jsx-runtime";
|
|
3008
|
+
var DayCell2 = React11.memo(
|
|
3046
3009
|
({
|
|
3047
3010
|
day,
|
|
3048
3011
|
disabled,
|
|
@@ -3052,7 +3015,7 @@ var DayCell2 = React12.memo(
|
|
|
3052
3015
|
isEnd,
|
|
3053
3016
|
inRange,
|
|
3054
3017
|
onSelect
|
|
3055
|
-
}) => /* @__PURE__ */
|
|
3018
|
+
}) => /* @__PURE__ */ jsx314(
|
|
3056
3019
|
"button",
|
|
3057
3020
|
{
|
|
3058
3021
|
type: "button",
|
|
@@ -3094,26 +3057,26 @@ var SingleDatePicker = (props) => {
|
|
|
3094
3057
|
initialYear,
|
|
3095
3058
|
initialMonth
|
|
3096
3059
|
);
|
|
3097
|
-
const [pickerMode, setPickerMode] =
|
|
3098
|
-
const [yearRangeStart, setYearRangeStart] =
|
|
3060
|
+
const [pickerMode, setPickerMode] = React11.useState("days");
|
|
3061
|
+
const [yearRangeStart, setYearRangeStart] = React11.useState(
|
|
3099
3062
|
Math.floor((initialYear ?? (/* @__PURE__ */ new Date()).getFullYear()) / 12) * 12
|
|
3100
3063
|
);
|
|
3101
|
-
const minTime =
|
|
3064
|
+
const minTime = React11.useMemo(
|
|
3102
3065
|
() => minDate ? new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()).getTime() : -Infinity,
|
|
3103
3066
|
[minDate]
|
|
3104
3067
|
);
|
|
3105
|
-
const maxTime =
|
|
3068
|
+
const maxTime = React11.useMemo(
|
|
3106
3069
|
() => maxDate ? new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()).getTime() : Infinity,
|
|
3107
3070
|
[maxDate]
|
|
3108
3071
|
);
|
|
3109
|
-
const highlightSet =
|
|
3072
|
+
const highlightSet = React11.useMemo(() => {
|
|
3110
3073
|
const set = /* @__PURE__ */ new Set();
|
|
3111
3074
|
for (const h of highlightDates) {
|
|
3112
3075
|
set.add(`${h.getFullYear()}-${h.getMonth()}-${h.getDate()}`);
|
|
3113
3076
|
}
|
|
3114
3077
|
return set;
|
|
3115
3078
|
}, [highlightDates]);
|
|
3116
|
-
const handleSelect =
|
|
3079
|
+
const handleSelect = React11.useCallback(
|
|
3117
3080
|
(date) => {
|
|
3118
3081
|
onChange?.(date);
|
|
3119
3082
|
},
|
|
@@ -3156,14 +3119,14 @@ var SingleDatePicker = (props) => {
|
|
|
3156
3119
|
className: clsx_default("lib-xplat-datepicker", "single"),
|
|
3157
3120
|
children: [
|
|
3158
3121
|
/* @__PURE__ */ jsxs201("div", { className: "datepicker-header", children: [
|
|
3159
|
-
/* @__PURE__ */
|
|
3160
|
-
/* @__PURE__ */
|
|
3161
|
-
/* @__PURE__ */
|
|
3122
|
+
/* @__PURE__ */ jsx314("button", { className: "datepicker-nav", onClick: handlePrev, type: "button", children: /* @__PURE__ */ jsx314(ChevronLeftIcon_default, {}) }),
|
|
3123
|
+
/* @__PURE__ */ jsx314("button", { className: "datepicker-title", onClick: handleTitleClick, type: "button", children: titleText }),
|
|
3124
|
+
/* @__PURE__ */ jsx314("button", { className: "datepicker-nav", onClick: handleNext, type: "button", children: /* @__PURE__ */ jsx314(ChevronRightIcon_default, {}) })
|
|
3162
3125
|
] }),
|
|
3163
3126
|
/* @__PURE__ */ jsxs201("div", { className: "datepicker-body", children: [
|
|
3164
|
-
pickerMode === "years" && /* @__PURE__ */
|
|
3127
|
+
pickerMode === "years" && /* @__PURE__ */ jsx314("div", { className: "datepicker-picker-grid", children: Array.from({ length: 12 }, (_, i) => {
|
|
3165
3128
|
const y = yearRangeStart + i;
|
|
3166
|
-
return /* @__PURE__ */
|
|
3129
|
+
return /* @__PURE__ */ jsx314(
|
|
3167
3130
|
"button",
|
|
3168
3131
|
{
|
|
3169
3132
|
type: "button",
|
|
@@ -3174,7 +3137,7 @@ var SingleDatePicker = (props) => {
|
|
|
3174
3137
|
y
|
|
3175
3138
|
);
|
|
3176
3139
|
}) }),
|
|
3177
|
-
pickerMode === "months" && /* @__PURE__ */
|
|
3140
|
+
pickerMode === "months" && /* @__PURE__ */ jsx314("div", { className: "datepicker-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ jsx314(
|
|
3178
3141
|
"button",
|
|
3179
3142
|
{
|
|
3180
3143
|
type: "button",
|
|
@@ -3185,7 +3148,7 @@ var SingleDatePicker = (props) => {
|
|
|
3185
3148
|
i
|
|
3186
3149
|
)) }),
|
|
3187
3150
|
pickerMode === "days" && /* @__PURE__ */ jsxs201(Fragment3, { children: [
|
|
3188
|
-
/* @__PURE__ */
|
|
3151
|
+
/* @__PURE__ */ jsx314("div", { className: "datepicker-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ jsx314(
|
|
3189
3152
|
"div",
|
|
3190
3153
|
{
|
|
3191
3154
|
className: clsx_default(
|
|
@@ -3197,7 +3160,7 @@ var SingleDatePicker = (props) => {
|
|
|
3197
3160
|
},
|
|
3198
3161
|
label
|
|
3199
3162
|
)) }),
|
|
3200
|
-
/* @__PURE__ */
|
|
3163
|
+
/* @__PURE__ */ jsx314("div", { className: "datepicker-grid", children: days.map((day, idx) => {
|
|
3201
3164
|
const t = day.date.getTime();
|
|
3202
3165
|
const disabled = t < minTime || t > maxTime;
|
|
3203
3166
|
const selected = value ? isSameDay(day.date, value) : false;
|
|
@@ -3207,7 +3170,7 @@ var SingleDatePicker = (props) => {
|
|
|
3207
3170
|
const isStart = hasRange ? isSameDay(day.date, rangeStart) : false;
|
|
3208
3171
|
const isEnd = hasRange ? isSameDay(day.date, rangeEnd) : false;
|
|
3209
3172
|
const inRangeVal = hasRange ? isInRange(day.date, rangeStart, rangeEnd) : false;
|
|
3210
|
-
return /* @__PURE__ */
|
|
3173
|
+
return /* @__PURE__ */ jsx314(
|
|
3211
3174
|
DayCell2,
|
|
3212
3175
|
{
|
|
3213
3176
|
day,
|
|
@@ -3232,7 +3195,7 @@ SingleDatePicker.displayName = "SingleDatePicker";
|
|
|
3232
3195
|
var SingleDatePicker_default = SingleDatePicker;
|
|
3233
3196
|
|
|
3234
3197
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
3235
|
-
import { jsx as
|
|
3198
|
+
import { jsx as jsx315, jsxs as jsxs202 } from "react/jsx-runtime";
|
|
3236
3199
|
var formatDate = (date) => {
|
|
3237
3200
|
if (!date || !(date instanceof Date) || isNaN(date.getTime())) return "";
|
|
3238
3201
|
const y = date.getFullYear();
|
|
@@ -3242,8 +3205,8 @@ var formatDate = (date) => {
|
|
|
3242
3205
|
};
|
|
3243
3206
|
var InputDatePicker = (props) => {
|
|
3244
3207
|
const { value, onChange, minDate, maxDate, disabled, locale = "ko", placeholder } = props;
|
|
3245
|
-
const [isOpen, setIsOpen] =
|
|
3246
|
-
const [tempDate, setTempDate] =
|
|
3208
|
+
const [isOpen, setIsOpen] = React12.useState(false);
|
|
3209
|
+
const [tempDate, setTempDate] = React12.useState(value ?? /* @__PURE__ */ new Date());
|
|
3247
3210
|
const handleOpen = () => {
|
|
3248
3211
|
if (disabled) return;
|
|
3249
3212
|
setTempDate(value ?? /* @__PURE__ */ new Date());
|
|
@@ -3260,18 +3223,18 @@ var InputDatePicker = (props) => {
|
|
|
3260
3223
|
setIsOpen(false);
|
|
3261
3224
|
};
|
|
3262
3225
|
return /* @__PURE__ */ jsxs202("div", { className: clsx_default("lib-xplat-datepicker input-datepicker", disabled && "disabled"), children: [
|
|
3263
|
-
/* @__PURE__ */
|
|
3226
|
+
/* @__PURE__ */ jsx315("div", { className: "input-datepicker-trigger", onClick: handleOpen, children: /* @__PURE__ */ jsx315(
|
|
3264
3227
|
Input_default,
|
|
3265
3228
|
{
|
|
3266
3229
|
value: formatDate(value),
|
|
3267
3230
|
placeholder,
|
|
3268
|
-
suffix: /* @__PURE__ */
|
|
3231
|
+
suffix: /* @__PURE__ */ jsx315(CalenderIcon_default, {}),
|
|
3269
3232
|
disabled,
|
|
3270
3233
|
readOnly: true
|
|
3271
3234
|
}
|
|
3272
3235
|
) }),
|
|
3273
|
-
/* @__PURE__ */
|
|
3274
|
-
/* @__PURE__ */
|
|
3236
|
+
/* @__PURE__ */ jsx315(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ jsxs202("div", { className: "lib-xplat-popup-datepicker-card", children: [
|
|
3237
|
+
/* @__PURE__ */ jsx315("div", { className: "popup-datepicker-content", children: /* @__PURE__ */ jsx315(
|
|
3275
3238
|
SingleDatePicker_default,
|
|
3276
3239
|
{
|
|
3277
3240
|
value: tempDate,
|
|
@@ -3282,8 +3245,8 @@ var InputDatePicker = (props) => {
|
|
|
3282
3245
|
}
|
|
3283
3246
|
) }),
|
|
3284
3247
|
/* @__PURE__ */ jsxs202("div", { className: "popup-datepicker-footer", children: [
|
|
3285
|
-
/* @__PURE__ */
|
|
3286
|
-
/* @__PURE__ */
|
|
3248
|
+
/* @__PURE__ */ jsx315(Button_default, { type: "secondary", onClick: handleClose, children: locale === "ko" ? "\uCDE8\uC18C" : "Cancel" }),
|
|
3249
|
+
/* @__PURE__ */ jsx315(Button_default, { type: "primary", onClick: handleApply, children: locale === "ko" ? "\uC801\uC6A9" : "Apply" })
|
|
3287
3250
|
] })
|
|
3288
3251
|
] }) })
|
|
3289
3252
|
] });
|
|
@@ -3292,20 +3255,20 @@ InputDatePicker.displayName = "InputDatePicker";
|
|
|
3292
3255
|
var InputDatePicker_default = InputDatePicker;
|
|
3293
3256
|
|
|
3294
3257
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
3295
|
-
import
|
|
3258
|
+
import React16 from "react";
|
|
3296
3259
|
|
|
3297
3260
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
3298
|
-
import
|
|
3261
|
+
import React15 from "react";
|
|
3299
3262
|
|
|
3300
3263
|
// src/components/Tab/Tab.tsx
|
|
3301
|
-
import
|
|
3264
|
+
import React14 from "react";
|
|
3302
3265
|
|
|
3303
3266
|
// src/components/Tab/TabItem.tsx
|
|
3304
|
-
import
|
|
3305
|
-
import { jsx as
|
|
3306
|
-
var TabItem =
|
|
3267
|
+
import React13 from "react";
|
|
3268
|
+
import { jsx as jsx316 } from "react/jsx-runtime";
|
|
3269
|
+
var TabItem = React13.forwardRef((props, ref) => {
|
|
3307
3270
|
const { isActive, title, onClick } = props;
|
|
3308
|
-
return /* @__PURE__ */
|
|
3271
|
+
return /* @__PURE__ */ jsx316(
|
|
3309
3272
|
"div",
|
|
3310
3273
|
{
|
|
3311
3274
|
ref,
|
|
@@ -3319,25 +3282,25 @@ TabItem.displayName = "TabItem";
|
|
|
3319
3282
|
var TabItem_default = TabItem;
|
|
3320
3283
|
|
|
3321
3284
|
// src/components/Tab/Tab.tsx
|
|
3322
|
-
import { jsx as
|
|
3285
|
+
import { jsx as jsx317, jsxs as jsxs203 } from "react/jsx-runtime";
|
|
3323
3286
|
var Tab = (props) => {
|
|
3324
3287
|
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
3325
|
-
const [underlineStyle, setUnderlineStyle] =
|
|
3288
|
+
const [underlineStyle, setUnderlineStyle] = React14.useState({
|
|
3326
3289
|
left: 0,
|
|
3327
3290
|
width: 0
|
|
3328
3291
|
});
|
|
3329
|
-
const itemRefs =
|
|
3292
|
+
const itemRefs = React14.useRef([]);
|
|
3330
3293
|
const handleChangeActiveTab = (tabItem, tabIdx) => {
|
|
3331
3294
|
onChange(tabItem, tabIdx);
|
|
3332
3295
|
};
|
|
3333
|
-
|
|
3296
|
+
React14.useEffect(() => {
|
|
3334
3297
|
const el = itemRefs.current[activeIndex];
|
|
3335
3298
|
if (el) {
|
|
3336
3299
|
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
3337
3300
|
}
|
|
3338
3301
|
}, [activeIndex, tabs.length]);
|
|
3339
3302
|
return /* @__PURE__ */ jsxs203("div", { className: clsx_default("lib-xplat-tab", `type-${type}`, size), children: [
|
|
3340
|
-
tabs.map((tab, idx) => /* @__PURE__ */
|
|
3303
|
+
tabs.map((tab, idx) => /* @__PURE__ */ jsx317(
|
|
3341
3304
|
TabItem_default,
|
|
3342
3305
|
{
|
|
3343
3306
|
onClick: () => handleChangeActiveTab(tab, idx),
|
|
@@ -3349,7 +3312,7 @@ var Tab = (props) => {
|
|
|
3349
3312
|
},
|
|
3350
3313
|
`${tab.value}_${idx}`
|
|
3351
3314
|
)),
|
|
3352
|
-
type === "toggle" && /* @__PURE__ */
|
|
3315
|
+
type === "toggle" && /* @__PURE__ */ jsx317(
|
|
3353
3316
|
"div",
|
|
3354
3317
|
{
|
|
3355
3318
|
className: "tab-toggle-underline",
|
|
@@ -3365,7 +3328,7 @@ Tab.displayName = "Tab";
|
|
|
3365
3328
|
var Tab_default = Tab;
|
|
3366
3329
|
|
|
3367
3330
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
3368
|
-
import { jsx as
|
|
3331
|
+
import { jsx as jsx318, jsxs as jsxs204 } from "react/jsx-runtime";
|
|
3369
3332
|
var RangePicker = (props) => {
|
|
3370
3333
|
const {
|
|
3371
3334
|
startDate,
|
|
@@ -3375,7 +3338,7 @@ var RangePicker = (props) => {
|
|
|
3375
3338
|
maxDate,
|
|
3376
3339
|
locale = "ko"
|
|
3377
3340
|
} = props;
|
|
3378
|
-
const [activeTab, setActiveTab] =
|
|
3341
|
+
const [activeTab, setActiveTab] = React15.useState("start");
|
|
3379
3342
|
const handleStartChange = (date) => {
|
|
3380
3343
|
if (!date) return;
|
|
3381
3344
|
const newStart = date > endDate ? endDate : date;
|
|
@@ -3389,7 +3352,7 @@ var RangePicker = (props) => {
|
|
|
3389
3352
|
const startMaxDate = maxDate && endDate < maxDate ? endDate : endDate;
|
|
3390
3353
|
const endMinDate = minDate && startDate > minDate ? startDate : startDate;
|
|
3391
3354
|
return /* @__PURE__ */ jsxs204("div", { className: clsx_default("lib-xplat-datepicker", "range"), children: [
|
|
3392
|
-
/* @__PURE__ */
|
|
3355
|
+
/* @__PURE__ */ jsx318("div", { className: "datepicker-range-tabs", children: /* @__PURE__ */ jsx318(
|
|
3393
3356
|
Tab_default,
|
|
3394
3357
|
{
|
|
3395
3358
|
activeIndex: activeTab === "start" ? 0 : 1,
|
|
@@ -3403,7 +3366,7 @@ var RangePicker = (props) => {
|
|
|
3403
3366
|
}
|
|
3404
3367
|
) }),
|
|
3405
3368
|
/* @__PURE__ */ jsxs204("div", { className: "datepicker-range-panels", children: [
|
|
3406
|
-
/* @__PURE__ */
|
|
3369
|
+
/* @__PURE__ */ jsx318(
|
|
3407
3370
|
SingleDatePicker_default,
|
|
3408
3371
|
{
|
|
3409
3372
|
value: startDate,
|
|
@@ -3415,7 +3378,7 @@ var RangePicker = (props) => {
|
|
|
3415
3378
|
locale
|
|
3416
3379
|
}
|
|
3417
3380
|
),
|
|
3418
|
-
/* @__PURE__ */
|
|
3381
|
+
/* @__PURE__ */ jsx318(
|
|
3419
3382
|
SingleDatePicker_default,
|
|
3420
3383
|
{
|
|
3421
3384
|
value: endDate,
|
|
@@ -3428,7 +3391,7 @@ var RangePicker = (props) => {
|
|
|
3428
3391
|
}
|
|
3429
3392
|
)
|
|
3430
3393
|
] }),
|
|
3431
|
-
/* @__PURE__ */
|
|
3394
|
+
/* @__PURE__ */ jsx318("div", { className: "datepicker-range-mobile", children: activeTab === "start" ? /* @__PURE__ */ jsx318(
|
|
3432
3395
|
SingleDatePicker_default,
|
|
3433
3396
|
{
|
|
3434
3397
|
value: startDate,
|
|
@@ -3439,7 +3402,7 @@ var RangePicker = (props) => {
|
|
|
3439
3402
|
rangeEnd: endDate,
|
|
3440
3403
|
locale
|
|
3441
3404
|
}
|
|
3442
|
-
) : /* @__PURE__ */
|
|
3405
|
+
) : /* @__PURE__ */ jsx318(
|
|
3443
3406
|
SingleDatePicker_default,
|
|
3444
3407
|
{
|
|
3445
3408
|
value: endDate,
|
|
@@ -3457,10 +3420,10 @@ RangePicker.displayName = "RangePicker";
|
|
|
3457
3420
|
var RangePicker_default = RangePicker;
|
|
3458
3421
|
|
|
3459
3422
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
3460
|
-
import { jsx as
|
|
3423
|
+
import { jsx as jsx319, jsxs as jsxs205 } from "react/jsx-runtime";
|
|
3461
3424
|
var PopupPicker = (props) => {
|
|
3462
3425
|
const { component, type, locale } = props;
|
|
3463
|
-
const [isOpen, setIsOpen] =
|
|
3426
|
+
const [isOpen, setIsOpen] = React16.useState(false);
|
|
3464
3427
|
const handleClick = () => setIsOpen(true);
|
|
3465
3428
|
const handleClose = () => setIsOpen(false);
|
|
3466
3429
|
const handleSingleChange = (date) => {
|
|
@@ -3469,10 +3432,10 @@ var PopupPicker = (props) => {
|
|
|
3469
3432
|
handleClose();
|
|
3470
3433
|
};
|
|
3471
3434
|
return /* @__PURE__ */ jsxs205("div", { className: "lib-xplat-popup-datepicker", children: [
|
|
3472
|
-
|
|
3473
|
-
/* @__PURE__ */
|
|
3435
|
+
React16.cloneElement(component, { onClick: handleClick }),
|
|
3436
|
+
/* @__PURE__ */ jsx319(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ jsxs205("div", { className: clsx_default("lib-xplat-popup-datepicker-card", type === "range" && "range-mode"), children: [
|
|
3474
3437
|
/* @__PURE__ */ jsxs205("div", { className: "popup-datepicker-content", children: [
|
|
3475
|
-
type === "single" && /* @__PURE__ */
|
|
3438
|
+
type === "single" && /* @__PURE__ */ jsx319(
|
|
3476
3439
|
SingleDatePicker_default,
|
|
3477
3440
|
{
|
|
3478
3441
|
value: props.value,
|
|
@@ -3482,7 +3445,7 @@ var PopupPicker = (props) => {
|
|
|
3482
3445
|
locale
|
|
3483
3446
|
}
|
|
3484
3447
|
),
|
|
3485
|
-
type === "range" && /* @__PURE__ */
|
|
3448
|
+
type === "range" && /* @__PURE__ */ jsx319(
|
|
3486
3449
|
RangePicker_default,
|
|
3487
3450
|
{
|
|
3488
3451
|
startDate: props.startDate,
|
|
@@ -3495,7 +3458,7 @@ var PopupPicker = (props) => {
|
|
|
3495
3458
|
)
|
|
3496
3459
|
] }),
|
|
3497
3460
|
/* @__PURE__ */ jsxs205("div", { className: "popup-datepicker-footer", children: [
|
|
3498
|
-
/* @__PURE__ */
|
|
3461
|
+
/* @__PURE__ */ jsx319(
|
|
3499
3462
|
Button_default,
|
|
3500
3463
|
{
|
|
3501
3464
|
type: "secondary",
|
|
@@ -3503,7 +3466,7 @@ var PopupPicker = (props) => {
|
|
|
3503
3466
|
children: locale === "ko" ? "\uCDE8\uC18C" : "Cancel"
|
|
3504
3467
|
}
|
|
3505
3468
|
),
|
|
3506
|
-
/* @__PURE__ */
|
|
3469
|
+
/* @__PURE__ */ jsx319(Button_default, { type: "primary", onClick: handleClose, children: locale === "ko" ? "\uC801\uC6A9" : "Apply" })
|
|
3507
3470
|
] })
|
|
3508
3471
|
] }) })
|
|
3509
3472
|
] });
|
|
@@ -3512,10 +3475,10 @@ PopupPicker.displayName = "PopupPicker";
|
|
|
3512
3475
|
var PopupPicker_default = PopupPicker;
|
|
3513
3476
|
|
|
3514
3477
|
// src/components/Divider/Divider.tsx
|
|
3515
|
-
import { jsx as
|
|
3478
|
+
import { jsx as jsx320 } from "react/jsx-runtime";
|
|
3516
3479
|
var Divider = (props) => {
|
|
3517
3480
|
const { orientation = "horizontal" } = props;
|
|
3518
|
-
return /* @__PURE__ */
|
|
3481
|
+
return /* @__PURE__ */ jsx320(
|
|
3519
3482
|
"div",
|
|
3520
3483
|
{
|
|
3521
3484
|
className: clsx_default("lib-xplat-divider", orientation),
|
|
@@ -3528,15 +3491,15 @@ Divider.displayName = "Divider";
|
|
|
3528
3491
|
var Divider_default = Divider;
|
|
3529
3492
|
|
|
3530
3493
|
// src/components/Drawer/Drawer.tsx
|
|
3531
|
-
import
|
|
3494
|
+
import React17 from "react";
|
|
3532
3495
|
import { createPortal as createPortal2 } from "react-dom";
|
|
3533
|
-
import { jsx as
|
|
3496
|
+
import { jsx as jsx321, jsxs as jsxs206 } from "react/jsx-runtime";
|
|
3534
3497
|
var ANIMATION_DURATION_MS2 = 250;
|
|
3535
3498
|
var Drawer = (props) => {
|
|
3536
3499
|
const { isOpen, onClose, placement = "right", size = "md", title, children } = props;
|
|
3537
|
-
const [mounted, setMounted] =
|
|
3538
|
-
const [visible, setVisible] =
|
|
3539
|
-
|
|
3500
|
+
const [mounted, setMounted] = React17.useState(false);
|
|
3501
|
+
const [visible, setVisible] = React17.useState(false);
|
|
3502
|
+
React17.useEffect(() => {
|
|
3540
3503
|
if (isOpen) {
|
|
3541
3504
|
setMounted(true);
|
|
3542
3505
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -3550,7 +3513,7 @@ var Drawer = (props) => {
|
|
|
3550
3513
|
if (!mounted) return null;
|
|
3551
3514
|
const stateClass = visible ? "enter" : "exit";
|
|
3552
3515
|
return createPortal2(
|
|
3553
|
-
/* @__PURE__ */
|
|
3516
|
+
/* @__PURE__ */ jsx321(
|
|
3554
3517
|
"div",
|
|
3555
3518
|
{
|
|
3556
3519
|
className: clsx_default("lib-xplat-drawer-overlay", stateClass),
|
|
@@ -3564,10 +3527,10 @@ var Drawer = (props) => {
|
|
|
3564
3527
|
onClick: (e) => e.stopPropagation(),
|
|
3565
3528
|
children: [
|
|
3566
3529
|
title && /* @__PURE__ */ jsxs206("div", { className: "drawer-header", children: [
|
|
3567
|
-
/* @__PURE__ */
|
|
3568
|
-
/* @__PURE__ */
|
|
3530
|
+
/* @__PURE__ */ jsx321("span", { className: "drawer-title", children: title }),
|
|
3531
|
+
/* @__PURE__ */ jsx321("button", { className: "close-btn", onClick: onClose, "aria-label": "\uB2EB\uAE30", children: "\xD7" })
|
|
3569
3532
|
] }),
|
|
3570
|
-
/* @__PURE__ */
|
|
3533
|
+
/* @__PURE__ */ jsx321("div", { className: "drawer-body", children })
|
|
3571
3534
|
]
|
|
3572
3535
|
}
|
|
3573
3536
|
)
|
|
@@ -3580,16 +3543,16 @@ Drawer.displayName = "Drawer";
|
|
|
3580
3543
|
var Drawer_default = Drawer;
|
|
3581
3544
|
|
|
3582
3545
|
// src/components/Dropdown/Dropdown.tsx
|
|
3583
|
-
import
|
|
3546
|
+
import React20 from "react";
|
|
3584
3547
|
|
|
3585
3548
|
// src/tokens/hooks/useAutoPosition.ts
|
|
3586
|
-
import
|
|
3549
|
+
import React18 from "react";
|
|
3587
3550
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
3588
|
-
const [position, setPosition] =
|
|
3551
|
+
const [position, setPosition] = React18.useState({
|
|
3589
3552
|
position: {},
|
|
3590
3553
|
direction: "bottom"
|
|
3591
3554
|
});
|
|
3592
|
-
const calculatePosition =
|
|
3555
|
+
const calculatePosition = React18.useCallback(() => {
|
|
3593
3556
|
if (!triggerRef.current || !popRef.current) return;
|
|
3594
3557
|
const triggerRect = triggerRef.current.getBoundingClientRect();
|
|
3595
3558
|
const popW = popRef.current.offsetWidth;
|
|
@@ -3616,13 +3579,13 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
3616
3579
|
direction
|
|
3617
3580
|
});
|
|
3618
3581
|
}, [triggerRef, popRef]);
|
|
3619
|
-
|
|
3582
|
+
React18.useLayoutEffect(() => {
|
|
3620
3583
|
if (!enabled) return;
|
|
3621
3584
|
calculatePosition();
|
|
3622
3585
|
const raf = requestAnimationFrame(calculatePosition);
|
|
3623
3586
|
return () => cancelAnimationFrame(raf);
|
|
3624
3587
|
}, [calculatePosition, enabled]);
|
|
3625
|
-
|
|
3588
|
+
React18.useEffect(() => {
|
|
3626
3589
|
if (!enabled || !popRef.current) return;
|
|
3627
3590
|
const observer = new ResizeObserver(() => {
|
|
3628
3591
|
calculatePosition();
|
|
@@ -3630,7 +3593,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
3630
3593
|
observer.observe(popRef.current);
|
|
3631
3594
|
return () => observer.disconnect();
|
|
3632
3595
|
}, [calculatePosition, enabled, popRef]);
|
|
3633
|
-
|
|
3596
|
+
React18.useEffect(() => {
|
|
3634
3597
|
if (!enabled) return;
|
|
3635
3598
|
window.addEventListener("resize", calculatePosition);
|
|
3636
3599
|
window.addEventListener("scroll", calculatePosition, true);
|
|
@@ -3644,9 +3607,9 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
3644
3607
|
var useAutoPosition_default = useAutoPosition;
|
|
3645
3608
|
|
|
3646
3609
|
// src/tokens/hooks/useClickOutside.ts
|
|
3647
|
-
import
|
|
3610
|
+
import React19 from "react";
|
|
3648
3611
|
var useClickOutside = (refs, handler, enabled = true) => {
|
|
3649
|
-
|
|
3612
|
+
React19.useEffect(() => {
|
|
3650
3613
|
if (!enabled) return;
|
|
3651
3614
|
const refArray = Array.isArray(refs) ? refs : [refs];
|
|
3652
3615
|
const listener = (event) => {
|
|
@@ -3669,17 +3632,17 @@ var useClickOutside = (refs, handler, enabled = true) => {
|
|
|
3669
3632
|
var useClickOutside_default = useClickOutside;
|
|
3670
3633
|
|
|
3671
3634
|
// src/components/Dropdown/Dropdown.tsx
|
|
3672
|
-
import { jsx as
|
|
3635
|
+
import { jsx as jsx322, jsxs as jsxs207 } from "react/jsx-runtime";
|
|
3673
3636
|
var Dropdown = (props) => {
|
|
3674
3637
|
const { items, children } = props;
|
|
3675
|
-
const [isOpen, setIsOpen] =
|
|
3676
|
-
const [mounted, setMounted] =
|
|
3677
|
-
const [visible, setVisible] =
|
|
3678
|
-
const triggerRef =
|
|
3679
|
-
const menuRef =
|
|
3638
|
+
const [isOpen, setIsOpen] = React20.useState(false);
|
|
3639
|
+
const [mounted, setMounted] = React20.useState(false);
|
|
3640
|
+
const [visible, setVisible] = React20.useState(false);
|
|
3641
|
+
const triggerRef = React20.useRef(null);
|
|
3642
|
+
const menuRef = React20.useRef(null);
|
|
3680
3643
|
const { position, direction } = useAutoPosition_default(triggerRef, menuRef, mounted);
|
|
3681
3644
|
useClickOutside_default([triggerRef, menuRef], () => setIsOpen(false), isOpen);
|
|
3682
|
-
|
|
3645
|
+
React20.useEffect(() => {
|
|
3683
3646
|
if (isOpen) {
|
|
3684
3647
|
setMounted(true);
|
|
3685
3648
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -3695,7 +3658,7 @@ var Dropdown = (props) => {
|
|
|
3695
3658
|
setIsOpen(false);
|
|
3696
3659
|
};
|
|
3697
3660
|
return /* @__PURE__ */ jsxs207("div", { className: "lib-xplat-dropdown", children: [
|
|
3698
|
-
/* @__PURE__ */
|
|
3661
|
+
/* @__PURE__ */ jsx322(
|
|
3699
3662
|
"div",
|
|
3700
3663
|
{
|
|
3701
3664
|
ref: triggerRef,
|
|
@@ -3704,14 +3667,14 @@ var Dropdown = (props) => {
|
|
|
3704
3667
|
children
|
|
3705
3668
|
}
|
|
3706
3669
|
),
|
|
3707
|
-
mounted && /* @__PURE__ */
|
|
3670
|
+
mounted && /* @__PURE__ */ jsx322(Portal_default, { children: /* @__PURE__ */ jsx322(
|
|
3708
3671
|
"div",
|
|
3709
3672
|
{
|
|
3710
3673
|
ref: menuRef,
|
|
3711
3674
|
className: clsx_default("lib-xplat-dropdown-menu", direction, { visible }),
|
|
3712
3675
|
style: { top: position.top, left: position.left },
|
|
3713
3676
|
role: "menu",
|
|
3714
|
-
children: items.map((item) => /* @__PURE__ */
|
|
3677
|
+
children: items.map((item) => /* @__PURE__ */ jsx322(
|
|
3715
3678
|
"button",
|
|
3716
3679
|
{
|
|
3717
3680
|
className: clsx_default("dropdown-item", {
|
|
@@ -3733,23 +3696,23 @@ Dropdown.displayName = "Dropdown";
|
|
|
3733
3696
|
var Dropdown_default = Dropdown;
|
|
3734
3697
|
|
|
3735
3698
|
// src/components/EmptyState/EmptyState.tsx
|
|
3736
|
-
import { jsx as
|
|
3699
|
+
import { jsx as jsx323, jsxs as jsxs208 } from "react/jsx-runtime";
|
|
3737
3700
|
var EmptyState = (props) => {
|
|
3738
3701
|
const { icon, title = "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4", description, action } = props;
|
|
3739
3702
|
return /* @__PURE__ */ jsxs208("div", { className: "lib-xplat-empty-state", children: [
|
|
3740
|
-
icon && /* @__PURE__ */
|
|
3741
|
-
!icon && /* @__PURE__ */
|
|
3742
|
-
/* @__PURE__ */
|
|
3743
|
-
description && /* @__PURE__ */
|
|
3744
|
-
action && /* @__PURE__ */
|
|
3703
|
+
icon && /* @__PURE__ */ jsx323("div", { className: "empty-icon", children: icon }),
|
|
3704
|
+
!icon && /* @__PURE__ */ jsx323("div", { className: "empty-icon", children: /* @__PURE__ */ jsx323("svg", { viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx323("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" }) }) }),
|
|
3705
|
+
/* @__PURE__ */ jsx323("p", { className: "empty-title", children: title }),
|
|
3706
|
+
description && /* @__PURE__ */ jsx323("p", { className: "empty-description", children: description }),
|
|
3707
|
+
action && /* @__PURE__ */ jsx323("div", { className: "empty-action", children: action })
|
|
3745
3708
|
] });
|
|
3746
3709
|
};
|
|
3747
3710
|
EmptyState.displayName = "EmptyState";
|
|
3748
3711
|
var EmptyState_default = EmptyState;
|
|
3749
3712
|
|
|
3750
3713
|
// src/components/FileUpload/FileUpload.tsx
|
|
3751
|
-
import
|
|
3752
|
-
import { jsx as
|
|
3714
|
+
import React21 from "react";
|
|
3715
|
+
import { jsx as jsx324, jsxs as jsxs209 } from "react/jsx-runtime";
|
|
3753
3716
|
var FileUpload = (props) => {
|
|
3754
3717
|
const {
|
|
3755
3718
|
accept,
|
|
@@ -3759,8 +3722,8 @@ var FileUpload = (props) => {
|
|
|
3759
3722
|
label = "\uD30C\uC77C\uC744 \uB4DC\uB798\uADF8\uD558\uAC70\uB098 \uD074\uB9AD\uD558\uC5EC \uC5C5\uB85C\uB4DC",
|
|
3760
3723
|
description
|
|
3761
3724
|
} = props;
|
|
3762
|
-
const [isDragOver, setIsDragOver] =
|
|
3763
|
-
const inputRef =
|
|
3725
|
+
const [isDragOver, setIsDragOver] = React21.useState(false);
|
|
3726
|
+
const inputRef = React21.useRef(null);
|
|
3764
3727
|
const handleFiles = (fileList) => {
|
|
3765
3728
|
let files = Array.from(fileList);
|
|
3766
3729
|
if (maxSize) {
|
|
@@ -3799,7 +3762,7 @@ var FileUpload = (props) => {
|
|
|
3799
3762
|
onDragLeave: handleDragLeave,
|
|
3800
3763
|
onClick: () => inputRef.current?.click(),
|
|
3801
3764
|
children: [
|
|
3802
|
-
/* @__PURE__ */
|
|
3765
|
+
/* @__PURE__ */ jsx324(
|
|
3803
3766
|
"input",
|
|
3804
3767
|
{
|
|
3805
3768
|
ref: inputRef,
|
|
@@ -3809,9 +3772,9 @@ var FileUpload = (props) => {
|
|
|
3809
3772
|
onChange: handleChange
|
|
3810
3773
|
}
|
|
3811
3774
|
),
|
|
3812
|
-
/* @__PURE__ */
|
|
3813
|
-
/* @__PURE__ */
|
|
3814
|
-
description && /* @__PURE__ */
|
|
3775
|
+
/* @__PURE__ */ jsx324("div", { className: "upload-icon", children: /* @__PURE__ */ jsx324(UploadIcon_default, {}) }),
|
|
3776
|
+
/* @__PURE__ */ jsx324("p", { className: "upload-label", children: label }),
|
|
3777
|
+
description && /* @__PURE__ */ jsx324("p", { className: "upload-description", children: description })
|
|
3815
3778
|
]
|
|
3816
3779
|
}
|
|
3817
3780
|
);
|
|
@@ -3820,10 +3783,10 @@ FileUpload.displayName = "FileUpload";
|
|
|
3820
3783
|
var FileUpload_default = FileUpload;
|
|
3821
3784
|
|
|
3822
3785
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
3823
|
-
import
|
|
3786
|
+
import React23 from "react";
|
|
3824
3787
|
|
|
3825
3788
|
// src/components/HtmlTypeWriter/utils.ts
|
|
3826
|
-
import
|
|
3789
|
+
import React22 from "react";
|
|
3827
3790
|
var voidTags = /* @__PURE__ */ new Set([
|
|
3828
3791
|
"br",
|
|
3829
3792
|
"img",
|
|
@@ -3891,41 +3854,41 @@ var convertNodeToReactWithRange = (node, typedLen, rangeMap) => {
|
|
|
3891
3854
|
props[attr.name] = attr.value;
|
|
3892
3855
|
});
|
|
3893
3856
|
if (voidTags.has(tag)) {
|
|
3894
|
-
return
|
|
3857
|
+
return React22.createElement(tag, props);
|
|
3895
3858
|
}
|
|
3896
3859
|
const children = Array.from(element.childNodes).map((child) => convertNodeToReactWithRange(child, typedLen, rangeMap)).filter((n) => n != null);
|
|
3897
|
-
return
|
|
3860
|
+
return React22.createElement(tag, props, ...children);
|
|
3898
3861
|
};
|
|
3899
3862
|
var htmlToReactProgressive = (root, typedLen, rangeMap) => {
|
|
3900
3863
|
const nodes = Array.from(root.childNodes).map((child, idx) => {
|
|
3901
3864
|
const node = convertNodeToReactWithRange(child, typedLen, rangeMap);
|
|
3902
|
-
return node == null ? null :
|
|
3865
|
+
return node == null ? null : React22.createElement(React22.Fragment, { key: idx }, node);
|
|
3903
3866
|
}).filter(Boolean);
|
|
3904
3867
|
return nodes.length === 0 ? null : nodes;
|
|
3905
3868
|
};
|
|
3906
3869
|
|
|
3907
3870
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
3908
|
-
import { jsx as
|
|
3871
|
+
import { jsx as jsx325 } from "react/jsx-runtime";
|
|
3909
3872
|
var HtmlTypeWriter = ({
|
|
3910
3873
|
html,
|
|
3911
3874
|
duration = 20,
|
|
3912
3875
|
onDone,
|
|
3913
3876
|
onChange
|
|
3914
3877
|
}) => {
|
|
3915
|
-
const [typedLen, setTypedLen] =
|
|
3916
|
-
const doneCalledRef =
|
|
3917
|
-
const { doc, rangeMap, totalLength } =
|
|
3878
|
+
const [typedLen, setTypedLen] = React23.useState(0);
|
|
3879
|
+
const doneCalledRef = React23.useRef(false);
|
|
3880
|
+
const { doc, rangeMap, totalLength } = React23.useMemo(() => {
|
|
3918
3881
|
if (typeof window === "undefined") return { doc: null, rangeMap: /* @__PURE__ */ new Map(), totalLength: 0 };
|
|
3919
3882
|
const decoded = decodeHtmlEntities(html);
|
|
3920
3883
|
const doc2 = new DOMParser().parseFromString(decoded, "text/html");
|
|
3921
3884
|
const { rangeMap: rangeMap2, totalLength: totalLength2 } = buildRangeMap(doc2.body);
|
|
3922
3885
|
return { doc: doc2, rangeMap: rangeMap2, totalLength: totalLength2 };
|
|
3923
3886
|
}, [html]);
|
|
3924
|
-
|
|
3887
|
+
React23.useEffect(() => {
|
|
3925
3888
|
setTypedLen(0);
|
|
3926
3889
|
doneCalledRef.current = false;
|
|
3927
3890
|
}, [html]);
|
|
3928
|
-
|
|
3891
|
+
React23.useEffect(() => {
|
|
3929
3892
|
if (!totalLength) return;
|
|
3930
3893
|
if (typedLen >= totalLength) return;
|
|
3931
3894
|
const timer = window.setInterval(() => {
|
|
@@ -3933,33 +3896,33 @@ var HtmlTypeWriter = ({
|
|
|
3933
3896
|
}, duration);
|
|
3934
3897
|
return () => window.clearInterval(timer);
|
|
3935
3898
|
}, [typedLen, totalLength, duration]);
|
|
3936
|
-
|
|
3899
|
+
React23.useEffect(() => {
|
|
3937
3900
|
if (typedLen > 0 && typedLen < totalLength) {
|
|
3938
3901
|
onChange?.();
|
|
3939
3902
|
}
|
|
3940
3903
|
}, [typedLen, totalLength, onChange]);
|
|
3941
|
-
|
|
3904
|
+
React23.useEffect(() => {
|
|
3942
3905
|
if (typedLen === totalLength && totalLength > 0 && !doneCalledRef.current) {
|
|
3943
3906
|
doneCalledRef.current = true;
|
|
3944
3907
|
onDone?.();
|
|
3945
3908
|
}
|
|
3946
3909
|
}, [typedLen, totalLength, onDone]);
|
|
3947
|
-
const parsed =
|
|
3910
|
+
const parsed = React23.useMemo(
|
|
3948
3911
|
() => doc ? htmlToReactProgressive(doc.body, typedLen, rangeMap) : null,
|
|
3949
3912
|
[doc, typedLen, rangeMap]
|
|
3950
3913
|
);
|
|
3951
|
-
return /* @__PURE__ */
|
|
3914
|
+
return /* @__PURE__ */ jsx325("div", { className: "lib-xplat-htmlTypewriter", children: parsed });
|
|
3952
3915
|
};
|
|
3953
3916
|
HtmlTypeWriter.displayName = "HtmlTypeWriter";
|
|
3954
3917
|
var HtmlTypeWriter_default = HtmlTypeWriter;
|
|
3955
3918
|
|
|
3956
3919
|
// src/components/ImageSelector/ImageSelector.tsx
|
|
3957
|
-
import
|
|
3958
|
-
import { jsx as
|
|
3920
|
+
import React24 from "react";
|
|
3921
|
+
import { jsx as jsx326, jsxs as jsxs210 } from "react/jsx-runtime";
|
|
3959
3922
|
var ImageSelector = (props) => {
|
|
3960
3923
|
const { value, label, onChange } = props;
|
|
3961
|
-
const [previewUrl, setPreviewUrl] =
|
|
3962
|
-
|
|
3924
|
+
const [previewUrl, setPreviewUrl] = React24.useState();
|
|
3925
|
+
React24.useEffect(() => {
|
|
3963
3926
|
if (!value) {
|
|
3964
3927
|
setPreviewUrl(void 0);
|
|
3965
3928
|
return;
|
|
@@ -3968,7 +3931,7 @@ var ImageSelector = (props) => {
|
|
|
3968
3931
|
setPreviewUrl(url);
|
|
3969
3932
|
return () => URL.revokeObjectURL(url);
|
|
3970
3933
|
}, [value]);
|
|
3971
|
-
const inputRef =
|
|
3934
|
+
const inputRef = React24.useRef(null);
|
|
3972
3935
|
const handleFileChange = (e) => {
|
|
3973
3936
|
const selectedFile = e.target.files?.[0];
|
|
3974
3937
|
if (selectedFile) {
|
|
@@ -3982,7 +3945,7 @@ var ImageSelector = (props) => {
|
|
|
3982
3945
|
inputRef.current?.click();
|
|
3983
3946
|
};
|
|
3984
3947
|
return /* @__PURE__ */ jsxs210("div", { className: `lib-xplat-imageselector${value ? "" : " none-value"}`, children: [
|
|
3985
|
-
/* @__PURE__ */
|
|
3948
|
+
/* @__PURE__ */ jsx326(
|
|
3986
3949
|
"input",
|
|
3987
3950
|
{
|
|
3988
3951
|
type: "file",
|
|
@@ -3993,12 +3956,12 @@ var ImageSelector = (props) => {
|
|
|
3993
3956
|
}
|
|
3994
3957
|
),
|
|
3995
3958
|
value && /* @__PURE__ */ jsxs210("div", { className: "action-bar", children: [
|
|
3996
|
-
/* @__PURE__ */
|
|
3997
|
-
/* @__PURE__ */
|
|
3959
|
+
/* @__PURE__ */ jsx326("div", { className: "icon-wrapper", onClick: handleOpenFileDialog, children: /* @__PURE__ */ jsx326(UploadIcon_default, {}) }),
|
|
3960
|
+
/* @__PURE__ */ jsx326("div", { className: "icon-wrapper", onClick: handleDeleteFile, children: /* @__PURE__ */ jsx326(DeleteIcon_default, {}) })
|
|
3998
3961
|
] }),
|
|
3999
|
-
/* @__PURE__ */
|
|
4000
|
-
/* @__PURE__ */
|
|
4001
|
-
/* @__PURE__ */
|
|
3962
|
+
/* @__PURE__ */ jsx326("div", { className: "content", children: previewUrl ? /* @__PURE__ */ jsx326("img", { src: previewUrl, alt: "preview" }) : /* @__PURE__ */ jsxs210("div", { className: "skeleton", onClick: handleOpenFileDialog, children: [
|
|
3963
|
+
/* @__PURE__ */ jsx326("div", { className: "icon-wrapper", children: /* @__PURE__ */ jsx326(ImageIcon_default, {}) }),
|
|
3964
|
+
/* @__PURE__ */ jsx326("div", { className: "label", children: label || "\uC774\uBBF8\uC9C0 \uCD94\uAC00\uD558\uAE30" })
|
|
4002
3965
|
] }) })
|
|
4003
3966
|
] });
|
|
4004
3967
|
};
|
|
@@ -4006,7 +3969,7 @@ ImageSelector.displayName = "ImageSelector";
|
|
|
4006
3969
|
var ImageSelector_default = ImageSelector;
|
|
4007
3970
|
|
|
4008
3971
|
// src/components/Pagination/Pagination.tsx
|
|
4009
|
-
import { jsx as
|
|
3972
|
+
import { jsx as jsx327, jsxs as jsxs211 } from "react/jsx-runtime";
|
|
4010
3973
|
var getPageRange = (current, totalPages, siblingCount) => {
|
|
4011
3974
|
const totalNumbers = siblingCount * 2 + 5;
|
|
4012
3975
|
if (totalPages <= totalNumbers) {
|
|
@@ -4050,18 +4013,18 @@ var Pagination = (props) => {
|
|
|
4050
4013
|
}
|
|
4051
4014
|
};
|
|
4052
4015
|
return /* @__PURE__ */ jsxs211("nav", { className: clsx_default("lib-xplat-pagination", size, type), "aria-label": "\uD398\uC774\uC9C0 \uB124\uBE44\uAC8C\uC774\uC158", children: [
|
|
4053
|
-
/* @__PURE__ */
|
|
4016
|
+
/* @__PURE__ */ jsx327(
|
|
4054
4017
|
"button",
|
|
4055
4018
|
{
|
|
4056
4019
|
className: "page-btn prev",
|
|
4057
4020
|
disabled: current <= 1,
|
|
4058
4021
|
onClick: () => handleClick(current - 1),
|
|
4059
4022
|
"aria-label": "\uC774\uC804 \uD398\uC774\uC9C0",
|
|
4060
|
-
children: /* @__PURE__ */
|
|
4023
|
+
children: /* @__PURE__ */ jsx327(ChevronLeftIcon_default, {})
|
|
4061
4024
|
}
|
|
4062
4025
|
),
|
|
4063
4026
|
pages.map(
|
|
4064
|
-
(page, i) => page === "..." ? /* @__PURE__ */
|
|
4027
|
+
(page, i) => page === "..." ? /* @__PURE__ */ jsx327("span", { className: "dots", children: "..." }, `dots-${i}`) : /* @__PURE__ */ jsx327(
|
|
4065
4028
|
"button",
|
|
4066
4029
|
{
|
|
4067
4030
|
className: clsx_default("page-btn", { active: page === current }),
|
|
@@ -4072,14 +4035,14 @@ var Pagination = (props) => {
|
|
|
4072
4035
|
page
|
|
4073
4036
|
)
|
|
4074
4037
|
),
|
|
4075
|
-
/* @__PURE__ */
|
|
4038
|
+
/* @__PURE__ */ jsx327(
|
|
4076
4039
|
"button",
|
|
4077
4040
|
{
|
|
4078
4041
|
className: "page-btn next",
|
|
4079
4042
|
disabled: current >= totalPages,
|
|
4080
4043
|
onClick: () => handleClick(current + 1),
|
|
4081
4044
|
"aria-label": "\uB2E4\uC74C \uD398\uC774\uC9C0",
|
|
4082
|
-
children: /* @__PURE__ */
|
|
4045
|
+
children: /* @__PURE__ */ jsx327(ChevronRightIcon_default, {})
|
|
4083
4046
|
}
|
|
4084
4047
|
)
|
|
4085
4048
|
] });
|
|
@@ -4088,17 +4051,17 @@ Pagination.displayName = "Pagination";
|
|
|
4088
4051
|
var Pagination_default = Pagination;
|
|
4089
4052
|
|
|
4090
4053
|
// src/components/PopOver/PopOver.tsx
|
|
4091
|
-
import
|
|
4092
|
-
import { jsx as
|
|
4054
|
+
import React25 from "react";
|
|
4055
|
+
import { jsx as jsx328, jsxs as jsxs212 } from "react/jsx-runtime";
|
|
4093
4056
|
var PopOver = (props) => {
|
|
4094
4057
|
const { children, isOpen, onClose, PopOverEl } = props;
|
|
4095
|
-
const popRef =
|
|
4096
|
-
const triggerRef =
|
|
4097
|
-
const [localOpen, setLocalOpen] =
|
|
4098
|
-
const [eventTrigger, setEventTrigger] =
|
|
4058
|
+
const popRef = React25.useRef(null);
|
|
4059
|
+
const triggerRef = React25.useRef(null);
|
|
4060
|
+
const [localOpen, setLocalOpen] = React25.useState(false);
|
|
4061
|
+
const [eventTrigger, setEventTrigger] = React25.useState(false);
|
|
4099
4062
|
useClickOutside_default([popRef, triggerRef], onClose, isOpen);
|
|
4100
4063
|
const position = useAutoPosition_default(triggerRef, popRef, localOpen);
|
|
4101
|
-
|
|
4064
|
+
React25.useEffect(() => {
|
|
4102
4065
|
if (isOpen) {
|
|
4103
4066
|
setLocalOpen(isOpen);
|
|
4104
4067
|
setTimeout(() => {
|
|
@@ -4121,7 +4084,7 @@ var PopOver = (props) => {
|
|
|
4121
4084
|
},
|
|
4122
4085
|
children: [
|
|
4123
4086
|
children,
|
|
4124
|
-
localOpen && /* @__PURE__ */
|
|
4087
|
+
localOpen && /* @__PURE__ */ jsx328(Portal_default, { children: /* @__PURE__ */ jsx328(
|
|
4125
4088
|
"div",
|
|
4126
4089
|
{
|
|
4127
4090
|
className: clsx_default(
|
|
@@ -4144,7 +4107,7 @@ PopOver.displayName = "PopOver";
|
|
|
4144
4107
|
var PopOver_default = PopOver;
|
|
4145
4108
|
|
|
4146
4109
|
// src/components/Progress/Progress.tsx
|
|
4147
|
-
import { jsx as
|
|
4110
|
+
import { jsx as jsx329, jsxs as jsxs213 } from "react/jsx-runtime";
|
|
4148
4111
|
var Progress = (props) => {
|
|
4149
4112
|
const {
|
|
4150
4113
|
value,
|
|
@@ -4155,7 +4118,7 @@ var Progress = (props) => {
|
|
|
4155
4118
|
} = props;
|
|
4156
4119
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
4157
4120
|
return /* @__PURE__ */ jsxs213("div", { className: clsx_default("lib-xplat-progress", size, type), children: [
|
|
4158
|
-
/* @__PURE__ */
|
|
4121
|
+
/* @__PURE__ */ jsx329(
|
|
4159
4122
|
"div",
|
|
4160
4123
|
{
|
|
4161
4124
|
className: "track",
|
|
@@ -4163,7 +4126,7 @@ var Progress = (props) => {
|
|
|
4163
4126
|
"aria-valuenow": value,
|
|
4164
4127
|
"aria-valuemin": 0,
|
|
4165
4128
|
"aria-valuemax": max,
|
|
4166
|
-
children: /* @__PURE__ */
|
|
4129
|
+
children: /* @__PURE__ */ jsx329(
|
|
4167
4130
|
"div",
|
|
4168
4131
|
{
|
|
4169
4132
|
className: "bar",
|
|
@@ -4182,17 +4145,17 @@ Progress.displayName = "Progress";
|
|
|
4182
4145
|
var Progress_default = Progress;
|
|
4183
4146
|
|
|
4184
4147
|
// src/components/Radio/RadioGroupContext.tsx
|
|
4185
|
-
import
|
|
4186
|
-
var RadioGroupContext =
|
|
4148
|
+
import React26 from "react";
|
|
4149
|
+
var RadioGroupContext = React26.createContext(
|
|
4187
4150
|
null
|
|
4188
4151
|
);
|
|
4189
4152
|
var useRadioGroupContext = () => {
|
|
4190
|
-
return
|
|
4153
|
+
return React26.useContext(RadioGroupContext);
|
|
4191
4154
|
};
|
|
4192
4155
|
var RadioGroupContext_default = RadioGroupContext;
|
|
4193
4156
|
|
|
4194
4157
|
// src/components/Radio/Radio.tsx
|
|
4195
|
-
import { jsx as
|
|
4158
|
+
import { jsx as jsx330, jsxs as jsxs214 } from "react/jsx-runtime";
|
|
4196
4159
|
var Radio = (props) => {
|
|
4197
4160
|
const {
|
|
4198
4161
|
label,
|
|
@@ -4220,18 +4183,18 @@ var Radio = (props) => {
|
|
|
4220
4183
|
localChecked ? "checked" : void 0
|
|
4221
4184
|
),
|
|
4222
4185
|
children: [
|
|
4223
|
-
/* @__PURE__ */
|
|
4224
|
-
/* @__PURE__ */
|
|
4186
|
+
/* @__PURE__ */ jsx330("input", { ...rest, ...inputProps, checked: localChecked, type: "radio" }),
|
|
4187
|
+
/* @__PURE__ */ jsx330(
|
|
4225
4188
|
"div",
|
|
4226
4189
|
{
|
|
4227
4190
|
className: clsx_default(
|
|
4228
4191
|
"circle",
|
|
4229
4192
|
localChecked ? "checked" : void 0
|
|
4230
4193
|
),
|
|
4231
|
-
children: localChecked && /* @__PURE__ */
|
|
4194
|
+
children: localChecked && /* @__PURE__ */ jsx330("div", { className: "inner-circle" })
|
|
4232
4195
|
}
|
|
4233
4196
|
),
|
|
4234
|
-
label && /* @__PURE__ */
|
|
4197
|
+
label && /* @__PURE__ */ jsx330("span", { children: label })
|
|
4235
4198
|
]
|
|
4236
4199
|
}
|
|
4237
4200
|
);
|
|
@@ -4240,28 +4203,28 @@ Radio.displayName = "Radio";
|
|
|
4240
4203
|
var Radio_default = Radio;
|
|
4241
4204
|
|
|
4242
4205
|
// src/components/Radio/RadioGroup.tsx
|
|
4243
|
-
import { Fragment as Fragment4, jsx as
|
|
4206
|
+
import { Fragment as Fragment4, jsx as jsx331 } from "react/jsx-runtime";
|
|
4244
4207
|
var RadioGroup = (props) => {
|
|
4245
4208
|
const { children, ...rest } = props;
|
|
4246
|
-
return /* @__PURE__ */
|
|
4209
|
+
return /* @__PURE__ */ jsx331(Fragment4, { children: /* @__PURE__ */ jsx331(RadioGroupContext_default.Provider, { value: rest, children }) });
|
|
4247
4210
|
};
|
|
4248
4211
|
RadioGroup.displayName = "RadioGroup";
|
|
4249
4212
|
var RadioGroup_default = RadioGroup;
|
|
4250
4213
|
|
|
4251
4214
|
// src/components/Select/Select.tsx
|
|
4252
|
-
import
|
|
4215
|
+
import React29 from "react";
|
|
4253
4216
|
|
|
4254
4217
|
// src/components/Select/context.ts
|
|
4255
|
-
import
|
|
4256
|
-
var SelectContext =
|
|
4218
|
+
import React27 from "react";
|
|
4219
|
+
var SelectContext = React27.createContext(null);
|
|
4257
4220
|
var context_default = SelectContext;
|
|
4258
4221
|
|
|
4259
4222
|
// src/components/Select/SelectItem.tsx
|
|
4260
|
-
import
|
|
4261
|
-
import { jsx as
|
|
4223
|
+
import React28 from "react";
|
|
4224
|
+
import { jsx as jsx332 } from "react/jsx-runtime";
|
|
4262
4225
|
var SelectItem = (props) => {
|
|
4263
4226
|
const { children, value, onClick, disabled = false } = props;
|
|
4264
|
-
const ctx =
|
|
4227
|
+
const ctx = React28.useContext(context_default);
|
|
4265
4228
|
const handleClick = (e) => {
|
|
4266
4229
|
e.preventDefault();
|
|
4267
4230
|
e.stopPropagation();
|
|
@@ -4270,7 +4233,7 @@ var SelectItem = (props) => {
|
|
|
4270
4233
|
ctx?.close();
|
|
4271
4234
|
onClick?.();
|
|
4272
4235
|
};
|
|
4273
|
-
return /* @__PURE__ */
|
|
4236
|
+
return /* @__PURE__ */ jsx332(
|
|
4274
4237
|
"div",
|
|
4275
4238
|
{
|
|
4276
4239
|
className: clsx_default("select-item", disabled && "disabled"),
|
|
@@ -4291,7 +4254,7 @@ SelectItem.displayName = "Select.Item";
|
|
|
4291
4254
|
var SelectItem_default = SelectItem;
|
|
4292
4255
|
|
|
4293
4256
|
// src/components/Select/Select.tsx
|
|
4294
|
-
import { jsx as
|
|
4257
|
+
import { jsx as jsx333, jsxs as jsxs215 } from "react/jsx-runtime";
|
|
4295
4258
|
var ANIMATION_DURATION_MS3 = 200;
|
|
4296
4259
|
var SelectRoot = (props) => {
|
|
4297
4260
|
const {
|
|
@@ -4303,26 +4266,26 @@ var SelectRoot = (props) => {
|
|
|
4303
4266
|
error = false,
|
|
4304
4267
|
size = "md"
|
|
4305
4268
|
} = props;
|
|
4306
|
-
const itemChildren =
|
|
4307
|
-
(child) =>
|
|
4269
|
+
const itemChildren = React29.Children.toArray(children).filter(
|
|
4270
|
+
(child) => React29.isValidElement(child) && child.type === SelectItem_default
|
|
4308
4271
|
);
|
|
4309
4272
|
const isControlled = valueProp !== void 0;
|
|
4310
|
-
const [isOpen, setOpen] =
|
|
4311
|
-
const [uncontrolledLabel, setUncontrolledLabel] =
|
|
4312
|
-
const controlledLabel =
|
|
4273
|
+
const [isOpen, setOpen] = React29.useState(false);
|
|
4274
|
+
const [uncontrolledLabel, setUncontrolledLabel] = React29.useState(null);
|
|
4275
|
+
const controlledLabel = React29.useMemo(() => {
|
|
4313
4276
|
if (!isControlled) return null;
|
|
4314
4277
|
const match = itemChildren.find((child) => child.props.value === valueProp);
|
|
4315
4278
|
return match ? match.props.children : null;
|
|
4316
4279
|
}, [isControlled, valueProp, itemChildren]);
|
|
4317
4280
|
const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
|
|
4318
|
-
const triggerRef =
|
|
4319
|
-
const contentRef =
|
|
4320
|
-
const [mounted, setMounted] =
|
|
4321
|
-
const [visible, setVisible] =
|
|
4322
|
-
|
|
4281
|
+
const triggerRef = React29.useRef(null);
|
|
4282
|
+
const contentRef = React29.useRef(null);
|
|
4283
|
+
const [mounted, setMounted] = React29.useState(false);
|
|
4284
|
+
const [visible, setVisible] = React29.useState(false);
|
|
4285
|
+
React29.useEffect(() => {
|
|
4323
4286
|
if (disabled && isOpen) setOpen(false);
|
|
4324
4287
|
}, [disabled, isOpen]);
|
|
4325
|
-
|
|
4288
|
+
React29.useEffect(() => {
|
|
4326
4289
|
if (isOpen) {
|
|
4327
4290
|
setMounted(true);
|
|
4328
4291
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -4332,12 +4295,12 @@ var SelectRoot = (props) => {
|
|
|
4332
4295
|
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS3);
|
|
4333
4296
|
return () => clearTimeout(t);
|
|
4334
4297
|
}, [isOpen]);
|
|
4335
|
-
const open =
|
|
4336
|
-
const close =
|
|
4337
|
-
const toggle =
|
|
4298
|
+
const open = React29.useCallback(() => setOpen(true), []);
|
|
4299
|
+
const close = React29.useCallback(() => setOpen(false), []);
|
|
4300
|
+
const toggle = React29.useCallback(() => setOpen((prev) => !prev), []);
|
|
4338
4301
|
useClickOutside_default([contentRef, triggerRef], close, isOpen);
|
|
4339
4302
|
const position = useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
4340
|
-
const setSelected =
|
|
4303
|
+
const setSelected = React29.useCallback(
|
|
4341
4304
|
(label, itemValue) => {
|
|
4342
4305
|
if (!isControlled) {
|
|
4343
4306
|
setUncontrolledLabel(label);
|
|
@@ -4346,7 +4309,7 @@ var SelectRoot = (props) => {
|
|
|
4346
4309
|
},
|
|
4347
4310
|
[isControlled, onChange]
|
|
4348
4311
|
);
|
|
4349
|
-
const ctxValue =
|
|
4312
|
+
const ctxValue = React29.useMemo(
|
|
4350
4313
|
() => ({
|
|
4351
4314
|
isOpen,
|
|
4352
4315
|
mounted,
|
|
@@ -4367,7 +4330,7 @@ var SelectRoot = (props) => {
|
|
|
4367
4330
|
if (disabled) return;
|
|
4368
4331
|
toggle();
|
|
4369
4332
|
};
|
|
4370
|
-
return /* @__PURE__ */
|
|
4333
|
+
return /* @__PURE__ */ jsx333(context_default.Provider, { value: ctxValue, children: /* @__PURE__ */ jsxs215(
|
|
4371
4334
|
"div",
|
|
4372
4335
|
{
|
|
4373
4336
|
className: clsx_default(
|
|
@@ -4402,7 +4365,7 @@ var SelectRoot = (props) => {
|
|
|
4402
4365
|
}
|
|
4403
4366
|
},
|
|
4404
4367
|
children: [
|
|
4405
|
-
/* @__PURE__ */
|
|
4368
|
+
/* @__PURE__ */ jsx333(
|
|
4406
4369
|
"span",
|
|
4407
4370
|
{
|
|
4408
4371
|
className: clsx_default(
|
|
@@ -4412,25 +4375,25 @@ var SelectRoot = (props) => {
|
|
|
4412
4375
|
children: selectedLabel ?? placeholder
|
|
4413
4376
|
}
|
|
4414
4377
|
),
|
|
4415
|
-
/* @__PURE__ */
|
|
4378
|
+
/* @__PURE__ */ jsx333(
|
|
4416
4379
|
"span",
|
|
4417
4380
|
{
|
|
4418
4381
|
className: clsx_default("select-trigger-icon", isOpen && "open"),
|
|
4419
4382
|
"aria-hidden": true,
|
|
4420
|
-
children: /* @__PURE__ */
|
|
4383
|
+
children: /* @__PURE__ */ jsx333(ChevronDownIcon_default, {})
|
|
4421
4384
|
}
|
|
4422
4385
|
)
|
|
4423
4386
|
]
|
|
4424
4387
|
}
|
|
4425
4388
|
),
|
|
4426
|
-
mounted && /* @__PURE__ */
|
|
4389
|
+
mounted && /* @__PURE__ */ jsx333(Portal_default, { children: /* @__PURE__ */ jsx333(
|
|
4427
4390
|
"div",
|
|
4428
4391
|
{
|
|
4429
4392
|
className: clsx_default("lib-xplat-select-content", position.direction, stateClass),
|
|
4430
4393
|
ref: contentRef,
|
|
4431
4394
|
style: { ...position.position, width: triggerRef.current?.offsetWidth },
|
|
4432
4395
|
role: "listbox",
|
|
4433
|
-
children: /* @__PURE__ */
|
|
4396
|
+
children: /* @__PURE__ */ jsx333(context_default.Provider, { value: ctxValue, children: itemChildren })
|
|
4434
4397
|
}
|
|
4435
4398
|
) })
|
|
4436
4399
|
]
|
|
@@ -4444,7 +4407,7 @@ var Select = Object.assign(SelectRoot, {
|
|
|
4444
4407
|
var Select_default = Select;
|
|
4445
4408
|
|
|
4446
4409
|
// src/components/Skeleton/Skeleton.tsx
|
|
4447
|
-
import { jsx as
|
|
4410
|
+
import { jsx as jsx334 } from "react/jsx-runtime";
|
|
4448
4411
|
var SIZE_MAP = {
|
|
4449
4412
|
xs: "var(--spacing-size-1)",
|
|
4450
4413
|
sm: "var(--spacing-size-2)",
|
|
@@ -4460,7 +4423,7 @@ var Skeleton = (props) => {
|
|
|
4460
4423
|
...width != null && { width: SIZE_MAP[width] },
|
|
4461
4424
|
...height != null && { height: SIZE_MAP[height] }
|
|
4462
4425
|
};
|
|
4463
|
-
return /* @__PURE__ */
|
|
4426
|
+
return /* @__PURE__ */ jsx334(
|
|
4464
4427
|
"div",
|
|
4465
4428
|
{
|
|
4466
4429
|
className: clsx_default("lib-xplat-skeleton", variant),
|
|
@@ -4473,20 +4436,20 @@ Skeleton.displayName = "Skeleton";
|
|
|
4473
4436
|
var Skeleton_default = Skeleton;
|
|
4474
4437
|
|
|
4475
4438
|
// src/components/Spinner/Spinner.tsx
|
|
4476
|
-
import { jsx as
|
|
4439
|
+
import { jsx as jsx335, jsxs as jsxs216 } from "react/jsx-runtime";
|
|
4477
4440
|
var Spinner = (props) => {
|
|
4478
4441
|
const {
|
|
4479
4442
|
size = "md",
|
|
4480
4443
|
type = "brand"
|
|
4481
4444
|
} = props;
|
|
4482
|
-
return /* @__PURE__ */
|
|
4445
|
+
return /* @__PURE__ */ jsx335(
|
|
4483
4446
|
"div",
|
|
4484
4447
|
{
|
|
4485
4448
|
className: clsx_default("lib-xplat-spinner", size, type),
|
|
4486
4449
|
role: "status",
|
|
4487
4450
|
"aria-label": "\uB85C\uB529 \uC911",
|
|
4488
4451
|
children: /* @__PURE__ */ jsxs216("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
4489
|
-
/* @__PURE__ */
|
|
4452
|
+
/* @__PURE__ */ jsx335(
|
|
4490
4453
|
"circle",
|
|
4491
4454
|
{
|
|
4492
4455
|
className: "track",
|
|
@@ -4496,7 +4459,7 @@ var Spinner = (props) => {
|
|
|
4496
4459
|
strokeWidth: "3"
|
|
4497
4460
|
}
|
|
4498
4461
|
),
|
|
4499
|
-
/* @__PURE__ */
|
|
4462
|
+
/* @__PURE__ */ jsx335(
|
|
4500
4463
|
"circle",
|
|
4501
4464
|
{
|
|
4502
4465
|
className: "indicator",
|
|
@@ -4515,20 +4478,20 @@ Spinner.displayName = "Spinner";
|
|
|
4515
4478
|
var Spinner_default = Spinner;
|
|
4516
4479
|
|
|
4517
4480
|
// src/components/Steps/Steps.tsx
|
|
4518
|
-
import { jsx as
|
|
4481
|
+
import { jsx as jsx336, jsxs as jsxs217 } from "react/jsx-runtime";
|
|
4519
4482
|
var Steps = (props) => {
|
|
4520
4483
|
const {
|
|
4521
4484
|
items,
|
|
4522
4485
|
current,
|
|
4523
4486
|
type = "brand"
|
|
4524
4487
|
} = props;
|
|
4525
|
-
return /* @__PURE__ */
|
|
4488
|
+
return /* @__PURE__ */ jsx336("div", { className: clsx_default("lib-xplat-steps", type), children: items.map((item, index) => {
|
|
4526
4489
|
const status = index < current ? "completed" : index === current ? "active" : "pending";
|
|
4527
4490
|
return /* @__PURE__ */ jsxs217("div", { className: clsx_default("step-item", status), children: [
|
|
4528
|
-
/* @__PURE__ */
|
|
4491
|
+
/* @__PURE__ */ jsx336("div", { className: "step-circle", children: status === "completed" ? /* @__PURE__ */ jsx336(CheckIcon_default, {}) : /* @__PURE__ */ jsx336("span", { children: index + 1 }) }),
|
|
4529
4492
|
/* @__PURE__ */ jsxs217("div", { className: "step-content", children: [
|
|
4530
|
-
/* @__PURE__ */
|
|
4531
|
-
item.description && /* @__PURE__ */
|
|
4493
|
+
/* @__PURE__ */ jsx336("span", { className: "step-title", children: item.title }),
|
|
4494
|
+
item.description && /* @__PURE__ */ jsx336("span", { className: "step-description", children: item.description })
|
|
4532
4495
|
] })
|
|
4533
4496
|
] }, index);
|
|
4534
4497
|
}) });
|
|
@@ -4537,8 +4500,8 @@ Steps.displayName = "Steps";
|
|
|
4537
4500
|
var Steps_default = Steps;
|
|
4538
4501
|
|
|
4539
4502
|
// src/components/Swiper/Swiper.tsx
|
|
4540
|
-
import
|
|
4541
|
-
import { jsx as
|
|
4503
|
+
import React30 from "react";
|
|
4504
|
+
import { jsx as jsx337, jsxs as jsxs218 } from "react/jsx-runtime";
|
|
4542
4505
|
var Swiper = (props) => {
|
|
4543
4506
|
const {
|
|
4544
4507
|
auto = false,
|
|
@@ -4561,23 +4524,23 @@ var Swiper = (props) => {
|
|
|
4561
4524
|
const maxIndex = Math.max(0, totalSlides - viewItemCount);
|
|
4562
4525
|
const useLoop = loop && canSlide;
|
|
4563
4526
|
const cloneCount = useLoop ? totalSlides : 0;
|
|
4564
|
-
const extendedItems =
|
|
4527
|
+
const extendedItems = React30.useMemo(() => {
|
|
4565
4528
|
if (!useLoop) return items;
|
|
4566
4529
|
return [...items, ...items, ...items];
|
|
4567
4530
|
}, [items, useLoop]);
|
|
4568
4531
|
const initialIdx = Math.max(0, Math.min(indexProp ?? 0, maxIndex));
|
|
4569
|
-
const [innerIndex, setInnerIndex] =
|
|
4532
|
+
const [innerIndex, setInnerIndex] = React30.useState(
|
|
4570
4533
|
useLoop ? cloneCount + initialIdx : initialIdx
|
|
4571
4534
|
);
|
|
4572
|
-
const [isDragging, setIsDragging] =
|
|
4573
|
-
const [dragOffset, setDragOffset] =
|
|
4574
|
-
const [animated, setAnimated] =
|
|
4575
|
-
const [containerWidth, setContainerWidth] =
|
|
4576
|
-
const containerRef =
|
|
4577
|
-
const startXRef =
|
|
4578
|
-
const startTimeRef =
|
|
4579
|
-
const autoplayTimerRef =
|
|
4580
|
-
|
|
4535
|
+
const [isDragging, setIsDragging] = React30.useState(false);
|
|
4536
|
+
const [dragOffset, setDragOffset] = React30.useState(0);
|
|
4537
|
+
const [animated, setAnimated] = React30.useState(true);
|
|
4538
|
+
const [containerWidth, setContainerWidth] = React30.useState(0);
|
|
4539
|
+
const containerRef = React30.useRef(null);
|
|
4540
|
+
const startXRef = React30.useRef(0);
|
|
4541
|
+
const startTimeRef = React30.useRef(0);
|
|
4542
|
+
const autoplayTimerRef = React30.useRef(null);
|
|
4543
|
+
React30.useEffect(() => {
|
|
4581
4544
|
const el = containerRef.current;
|
|
4582
4545
|
if (!el) return;
|
|
4583
4546
|
const ro = new ResizeObserver((entries) => {
|
|
@@ -4596,7 +4559,7 @@ var Swiper = (props) => {
|
|
|
4596
4559
|
return ((inner - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
4597
4560
|
};
|
|
4598
4561
|
const realIndex = getRealIndex(innerIndex);
|
|
4599
|
-
const moveToInner =
|
|
4562
|
+
const moveToInner = React30.useCallback(
|
|
4600
4563
|
(idx, withAnim = true) => {
|
|
4601
4564
|
if (!useLoop) {
|
|
4602
4565
|
setAnimated(withAnim);
|
|
@@ -4624,7 +4587,7 @@ var Swiper = (props) => {
|
|
|
4624
4587
|
},
|
|
4625
4588
|
[useLoop, cloneCount, totalSlides]
|
|
4626
4589
|
);
|
|
4627
|
-
const handleTransitionEnd =
|
|
4590
|
+
const handleTransitionEnd = React30.useCallback(() => {
|
|
4628
4591
|
if (!useLoop) return;
|
|
4629
4592
|
const real = getRealIndex(innerIndex);
|
|
4630
4593
|
const canonical = cloneCount + real;
|
|
@@ -4634,7 +4597,7 @@ var Swiper = (props) => {
|
|
|
4634
4597
|
}
|
|
4635
4598
|
onChange?.(Math.min(real, maxIndex));
|
|
4636
4599
|
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange]);
|
|
4637
|
-
const slideTo =
|
|
4600
|
+
const slideTo = React30.useCallback(
|
|
4638
4601
|
(logicalIndex) => {
|
|
4639
4602
|
if (!canSlide) return;
|
|
4640
4603
|
const clamped = useLoop ? logicalIndex : Math.max(0, Math.min(logicalIndex, maxIndex));
|
|
@@ -4644,7 +4607,7 @@ var Swiper = (props) => {
|
|
|
4644
4607
|
},
|
|
4645
4608
|
[canSlide, useLoop, cloneCount, maxIndex, onChange, moveToInner]
|
|
4646
4609
|
);
|
|
4647
|
-
const slideNext =
|
|
4610
|
+
const slideNext = React30.useCallback(() => {
|
|
4648
4611
|
if (!canSlide) return;
|
|
4649
4612
|
const nextInner = innerIndex + slideBy;
|
|
4650
4613
|
if (useLoop) {
|
|
@@ -4653,7 +4616,7 @@ var Swiper = (props) => {
|
|
|
4653
4616
|
moveToInner(Math.min(nextInner, maxIndex), true);
|
|
4654
4617
|
}
|
|
4655
4618
|
}, [canSlide, useLoop, innerIndex, slideBy, maxIndex, moveToInner]);
|
|
4656
|
-
const slidePrev =
|
|
4619
|
+
const slidePrev = React30.useCallback(() => {
|
|
4657
4620
|
if (!canSlide) return;
|
|
4658
4621
|
const prevInner = innerIndex - slideBy;
|
|
4659
4622
|
if (useLoop) {
|
|
@@ -4662,7 +4625,7 @@ var Swiper = (props) => {
|
|
|
4662
4625
|
moveToInner(Math.max(prevInner, 0), true);
|
|
4663
4626
|
}
|
|
4664
4627
|
}, [canSlide, useLoop, innerIndex, slideBy, moveToInner]);
|
|
4665
|
-
|
|
4628
|
+
React30.useEffect(() => {
|
|
4666
4629
|
if (indexProp === void 0) return;
|
|
4667
4630
|
const clamped = Math.max(0, Math.min(indexProp, maxIndex));
|
|
4668
4631
|
const target = useLoop ? cloneCount + clamped : clamped;
|
|
@@ -4670,12 +4633,12 @@ var Swiper = (props) => {
|
|
|
4670
4633
|
moveToInner(target, true);
|
|
4671
4634
|
}
|
|
4672
4635
|
}, [indexProp]);
|
|
4673
|
-
|
|
4636
|
+
React30.useImperativeHandle(swiperRef, () => ({
|
|
4674
4637
|
slidePrev,
|
|
4675
4638
|
slideNext,
|
|
4676
4639
|
slideTo
|
|
4677
4640
|
}));
|
|
4678
|
-
|
|
4641
|
+
React30.useEffect(() => {
|
|
4679
4642
|
if (!auto || !canSlide) return;
|
|
4680
4643
|
autoplayTimerRef.current = setInterval(slideNext, autoplayDelay);
|
|
4681
4644
|
return () => {
|
|
@@ -4698,7 +4661,7 @@ var Swiper = (props) => {
|
|
|
4698
4661
|
startXRef.current = getClientX(e);
|
|
4699
4662
|
startTimeRef.current = Date.now();
|
|
4700
4663
|
};
|
|
4701
|
-
|
|
4664
|
+
React30.useEffect(() => {
|
|
4702
4665
|
if (!isDragging) return;
|
|
4703
4666
|
const handleMove = (e) => {
|
|
4704
4667
|
setDragOffset(getClientX(e) - startXRef.current);
|
|
@@ -4736,8 +4699,8 @@ var Swiper = (props) => {
|
|
|
4736
4699
|
}, [isDragging, dragOffset, innerIndex, useLoop, maxIndex, slideStep, moveToInner]);
|
|
4737
4700
|
const slideWidthPercent = 100 / viewItemCount;
|
|
4738
4701
|
const gapAdjust = spaceBetween * (viewItemCount - 1) / viewItemCount;
|
|
4739
|
-
const slideElements =
|
|
4740
|
-
() => extendedItems.map((item, idx) => /* @__PURE__ */
|
|
4702
|
+
const slideElements = React30.useMemo(
|
|
4703
|
+
() => extendedItems.map((item, idx) => /* @__PURE__ */ jsx337(
|
|
4741
4704
|
"div",
|
|
4742
4705
|
{
|
|
4743
4706
|
className: "lib-xplat-swiper__slide",
|
|
@@ -4757,13 +4720,13 @@ var Swiper = (props) => {
|
|
|
4757
4720
|
totalSteps - 1
|
|
4758
4721
|
);
|
|
4759
4722
|
return /* @__PURE__ */ jsxs218("div", { className: "lib-xplat-swiper", ref: containerRef, children: [
|
|
4760
|
-
/* @__PURE__ */
|
|
4723
|
+
/* @__PURE__ */ jsx337(
|
|
4761
4724
|
"div",
|
|
4762
4725
|
{
|
|
4763
4726
|
className: "lib-xplat-swiper__viewport",
|
|
4764
4727
|
onMouseDown: handleDragStart,
|
|
4765
4728
|
onTouchStart: handleDragStart,
|
|
4766
|
-
children: /* @__PURE__ */
|
|
4729
|
+
children: /* @__PURE__ */ jsx337(
|
|
4767
4730
|
"div",
|
|
4768
4731
|
{
|
|
4769
4732
|
className: clsx_default(
|
|
@@ -4781,7 +4744,7 @@ var Swiper = (props) => {
|
|
|
4781
4744
|
)
|
|
4782
4745
|
}
|
|
4783
4746
|
),
|
|
4784
|
-
showProgress && canSlide && /* @__PURE__ */
|
|
4747
|
+
showProgress && canSlide && /* @__PURE__ */ jsx337("div", { className: "lib-xplat-swiper__progress", children: /* @__PURE__ */ jsx337("div", { className: "lib-xplat-swiper__progress-track", children: /* @__PURE__ */ jsx337(
|
|
4785
4748
|
"span",
|
|
4786
4749
|
{
|
|
4787
4750
|
className: "lib-xplat-swiper__progress-fill",
|
|
@@ -4791,7 +4754,7 @@ var Swiper = (props) => {
|
|
|
4791
4754
|
}
|
|
4792
4755
|
}
|
|
4793
4756
|
) }) }),
|
|
4794
|
-
canSlide && /* @__PURE__ */
|
|
4757
|
+
canSlide && /* @__PURE__ */ jsx337("div", { className: "lib-xplat-swiper__dots", children: Array.from({ length: totalSteps }, (_, i) => /* @__PURE__ */ jsx337(
|
|
4795
4758
|
"button",
|
|
4796
4759
|
{
|
|
4797
4760
|
className: clsx_default(
|
|
@@ -4809,8 +4772,8 @@ Swiper.displayName = "Swiper";
|
|
|
4809
4772
|
var Swiper_default = Swiper;
|
|
4810
4773
|
|
|
4811
4774
|
// src/components/Switch/Switch.tsx
|
|
4812
|
-
import
|
|
4813
|
-
import { jsx as
|
|
4775
|
+
import React31 from "react";
|
|
4776
|
+
import { jsx as jsx338 } from "react/jsx-runtime";
|
|
4814
4777
|
var KNOB_TRANSITION_MS = 250;
|
|
4815
4778
|
var Switch = (props) => {
|
|
4816
4779
|
const {
|
|
@@ -4820,9 +4783,9 @@ var Switch = (props) => {
|
|
|
4820
4783
|
disabled,
|
|
4821
4784
|
onChange
|
|
4822
4785
|
} = props;
|
|
4823
|
-
const [isAnimating, setIsAnimating] =
|
|
4824
|
-
const timeoutRef =
|
|
4825
|
-
|
|
4786
|
+
const [isAnimating, setIsAnimating] = React31.useState(false);
|
|
4787
|
+
const timeoutRef = React31.useRef(null);
|
|
4788
|
+
React31.useEffect(() => {
|
|
4826
4789
|
return () => {
|
|
4827
4790
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4828
4791
|
};
|
|
@@ -4837,7 +4800,7 @@ var Switch = (props) => {
|
|
|
4837
4800
|
timeoutRef.current = null;
|
|
4838
4801
|
}, KNOB_TRANSITION_MS);
|
|
4839
4802
|
};
|
|
4840
|
-
return /* @__PURE__ */
|
|
4803
|
+
return /* @__PURE__ */ jsx338(
|
|
4841
4804
|
"div",
|
|
4842
4805
|
{
|
|
4843
4806
|
className: clsx_default(
|
|
@@ -4850,7 +4813,7 @@ var Switch = (props) => {
|
|
|
4850
4813
|
),
|
|
4851
4814
|
onClick: handleClick,
|
|
4852
4815
|
"aria-disabled": disabled || isAnimating,
|
|
4853
|
-
children: /* @__PURE__ */
|
|
4816
|
+
children: /* @__PURE__ */ jsx338("div", { className: clsx_default("knob", value ? "checked" : void 0) })
|
|
4854
4817
|
}
|
|
4855
4818
|
);
|
|
4856
4819
|
};
|
|
@@ -4858,17 +4821,17 @@ Switch.displayName = "Switch";
|
|
|
4858
4821
|
var Switch_default = Switch;
|
|
4859
4822
|
|
|
4860
4823
|
// src/components/Table/TableContext.tsx
|
|
4861
|
-
import
|
|
4862
|
-
var TableContext =
|
|
4824
|
+
import React32 from "react";
|
|
4825
|
+
var TableContext = React32.createContext(null);
|
|
4863
4826
|
var useTableContext = () => {
|
|
4864
|
-
const ctx =
|
|
4827
|
+
const ctx = React32.useContext(TableContext);
|
|
4865
4828
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
4866
4829
|
return ctx;
|
|
4867
4830
|
};
|
|
4868
4831
|
var TableContext_default = TableContext;
|
|
4869
4832
|
|
|
4870
4833
|
// src/components/Table/Table.tsx
|
|
4871
|
-
import { jsx as
|
|
4834
|
+
import { jsx as jsx339 } from "react/jsx-runtime";
|
|
4872
4835
|
var Table = (props) => {
|
|
4873
4836
|
const {
|
|
4874
4837
|
children,
|
|
@@ -4878,7 +4841,7 @@ var Table = (props) => {
|
|
|
4878
4841
|
headerSticky = false,
|
|
4879
4842
|
stickyShadow = true
|
|
4880
4843
|
} = props;
|
|
4881
|
-
return /* @__PURE__ */
|
|
4844
|
+
return /* @__PURE__ */ jsx339("div", { className: `lib-xplat-table-wrapper ${size}`, children: /* @__PURE__ */ jsx339(
|
|
4882
4845
|
TableContext_default.Provider,
|
|
4883
4846
|
{
|
|
4884
4847
|
value: {
|
|
@@ -4887,7 +4850,7 @@ var Table = (props) => {
|
|
|
4887
4850
|
headerSticky,
|
|
4888
4851
|
stickyShadow
|
|
4889
4852
|
},
|
|
4890
|
-
children: /* @__PURE__ */
|
|
4853
|
+
children: /* @__PURE__ */ jsx339("table", { className: "lib-xplat-table", children })
|
|
4891
4854
|
}
|
|
4892
4855
|
) });
|
|
4893
4856
|
};
|
|
@@ -4895,41 +4858,41 @@ Table.displayName = "Table";
|
|
|
4895
4858
|
var Table_default = Table;
|
|
4896
4859
|
|
|
4897
4860
|
// src/components/Table/TableBody.tsx
|
|
4898
|
-
import { jsx as
|
|
4861
|
+
import { jsx as jsx340 } from "react/jsx-runtime";
|
|
4899
4862
|
var TableBody = (props) => {
|
|
4900
4863
|
const { children } = props;
|
|
4901
|
-
return /* @__PURE__ */
|
|
4864
|
+
return /* @__PURE__ */ jsx340("tbody", { children });
|
|
4902
4865
|
};
|
|
4903
4866
|
TableBody.displayName = "TableBody";
|
|
4904
4867
|
var TableBody_default = TableBody;
|
|
4905
4868
|
|
|
4906
4869
|
// src/components/Table/TableCell.tsx
|
|
4907
|
-
import
|
|
4870
|
+
import React35 from "react";
|
|
4908
4871
|
|
|
4909
4872
|
// src/components/Table/TableHeadContext.tsx
|
|
4910
|
-
import
|
|
4911
|
-
var TableHeadContext =
|
|
4873
|
+
import React33 from "react";
|
|
4874
|
+
var TableHeadContext = React33.createContext(
|
|
4912
4875
|
null
|
|
4913
4876
|
);
|
|
4914
4877
|
var useTableHeadContext = () => {
|
|
4915
|
-
const ctx =
|
|
4878
|
+
const ctx = React33.useContext(TableHeadContext);
|
|
4916
4879
|
return ctx;
|
|
4917
4880
|
};
|
|
4918
4881
|
var TableHeadContext_default = TableHeadContext;
|
|
4919
4882
|
|
|
4920
4883
|
// src/components/Table/TableRowContext.tsx
|
|
4921
|
-
import
|
|
4922
|
-
var TableRowContext =
|
|
4884
|
+
import React34 from "react";
|
|
4885
|
+
var TableRowContext = React34.createContext(null);
|
|
4923
4886
|
var useTableRowContext = () => {
|
|
4924
|
-
const ctx =
|
|
4887
|
+
const ctx = React34.useContext(TableRowContext);
|
|
4925
4888
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
4926
4889
|
return ctx;
|
|
4927
4890
|
};
|
|
4928
4891
|
var TableRowContext_default = TableRowContext;
|
|
4929
4892
|
|
|
4930
4893
|
// src/components/Table/TableCell.tsx
|
|
4931
|
-
import { jsx as
|
|
4932
|
-
var TableCell =
|
|
4894
|
+
import { jsx as jsx341 } from "react/jsx-runtime";
|
|
4895
|
+
var TableCell = React35.memo((props) => {
|
|
4933
4896
|
const {
|
|
4934
4897
|
children,
|
|
4935
4898
|
align = "center",
|
|
@@ -4941,9 +4904,9 @@ var TableCell = React36.memo((props) => {
|
|
|
4941
4904
|
const { registerStickyCell, stickyCells } = useTableRowContext();
|
|
4942
4905
|
const { stickyShadow } = useTableContext();
|
|
4943
4906
|
const headContext = useTableHeadContext();
|
|
4944
|
-
const [left, setLeft] =
|
|
4945
|
-
const cellRef =
|
|
4946
|
-
const calculateLeft =
|
|
4907
|
+
const [left, setLeft] = React35.useState(0);
|
|
4908
|
+
const cellRef = React35.useRef(null);
|
|
4909
|
+
const calculateLeft = React35.useCallback(() => {
|
|
4947
4910
|
if (!cellRef.current) return 0;
|
|
4948
4911
|
let totalLeft = 0;
|
|
4949
4912
|
for (const ref of stickyCells) {
|
|
@@ -4952,7 +4915,7 @@ var TableCell = React36.memo((props) => {
|
|
|
4952
4915
|
}
|
|
4953
4916
|
return totalLeft;
|
|
4954
4917
|
}, [stickyCells]);
|
|
4955
|
-
|
|
4918
|
+
React35.useEffect(() => {
|
|
4956
4919
|
if (!isSticky || !cellRef.current) return;
|
|
4957
4920
|
registerStickyCell(cellRef);
|
|
4958
4921
|
setLeft(calculateLeft());
|
|
@@ -4970,7 +4933,7 @@ var TableCell = React36.memo((props) => {
|
|
|
4970
4933
|
const CellTag = cellRef.current?.tagName === "TH" ? "th" : "td";
|
|
4971
4934
|
const isLastSticky = isSticky && stickyCells[stickyCells.length - 1] === cellRef;
|
|
4972
4935
|
const enableHover = headContext && headContext.cellHover;
|
|
4973
|
-
return /* @__PURE__ */
|
|
4936
|
+
return /* @__PURE__ */ jsx341(
|
|
4974
4937
|
CellTag,
|
|
4975
4938
|
{
|
|
4976
4939
|
ref: cellRef,
|
|
@@ -4995,21 +4958,21 @@ TableCell.displayName = "TableCell";
|
|
|
4995
4958
|
var TableCell_default = TableCell;
|
|
4996
4959
|
|
|
4997
4960
|
// src/components/Table/TableHead.tsx
|
|
4998
|
-
import { jsx as
|
|
4961
|
+
import { jsx as jsx342 } from "react/jsx-runtime";
|
|
4999
4962
|
var TableHead = ({
|
|
5000
4963
|
children,
|
|
5001
4964
|
cellHover = false
|
|
5002
4965
|
}) => {
|
|
5003
4966
|
const { headerSticky } = useTableContext();
|
|
5004
|
-
return /* @__PURE__ */
|
|
4967
|
+
return /* @__PURE__ */ jsx342(TableHeadContext_default.Provider, { value: { cellHover }, children: /* @__PURE__ */ jsx342("thead", { className: clsx_default(headerSticky ? "table-sticky" : null), children }) });
|
|
5005
4968
|
};
|
|
5006
4969
|
TableHead.displayName = "TableHead";
|
|
5007
4970
|
var TableHead_default = TableHead;
|
|
5008
4971
|
|
|
5009
4972
|
// src/components/Table/TableRow.tsx
|
|
5010
|
-
import
|
|
5011
|
-
import { jsx as
|
|
5012
|
-
var TableRow =
|
|
4973
|
+
import React36 from "react";
|
|
4974
|
+
import { jsx as jsx343 } from "react/jsx-runtime";
|
|
4975
|
+
var TableRow = React36.memo((props) => {
|
|
5013
4976
|
const {
|
|
5014
4977
|
children,
|
|
5015
4978
|
type = "secondary",
|
|
@@ -5017,14 +4980,14 @@ var TableRow = React37.memo((props) => {
|
|
|
5017
4980
|
onClick
|
|
5018
4981
|
} = props;
|
|
5019
4982
|
const { rowBorderUse } = useTableContext();
|
|
5020
|
-
const [stickyCells, setStickyCells] =
|
|
4983
|
+
const [stickyCells, setStickyCells] = React36.useState([]);
|
|
5021
4984
|
const registerStickyCell = (ref) => {
|
|
5022
4985
|
setStickyCells((prev) => {
|
|
5023
4986
|
if (prev.includes(ref)) return prev;
|
|
5024
4987
|
return [...prev, ref];
|
|
5025
4988
|
});
|
|
5026
4989
|
};
|
|
5027
|
-
return /* @__PURE__ */
|
|
4990
|
+
return /* @__PURE__ */ jsx343(TableRowContext_default.Provider, { value: { stickyCells, registerStickyCell }, children: /* @__PURE__ */ jsx343(
|
|
5028
4991
|
"tr",
|
|
5029
4992
|
{
|
|
5030
4993
|
className: clsx_default(
|
|
@@ -5042,7 +5005,7 @@ TableRow.displayName = "TableRow";
|
|
|
5042
5005
|
var TableRow_default = TableRow;
|
|
5043
5006
|
|
|
5044
5007
|
// src/components/Tag/Tag.tsx
|
|
5045
|
-
import { jsx as
|
|
5008
|
+
import { jsx as jsx344, jsxs as jsxs219 } from "react/jsx-runtime";
|
|
5046
5009
|
var Tag = (props) => {
|
|
5047
5010
|
const {
|
|
5048
5011
|
children,
|
|
@@ -5063,8 +5026,8 @@ var Tag = (props) => {
|
|
|
5063
5026
|
disabled && "disabled"
|
|
5064
5027
|
),
|
|
5065
5028
|
children: [
|
|
5066
|
-
/* @__PURE__ */
|
|
5067
|
-
onClose && /* @__PURE__ */
|
|
5029
|
+
/* @__PURE__ */ jsx344("span", { className: "tag-label", children }),
|
|
5030
|
+
onClose && /* @__PURE__ */ jsx344("button", { className: "tag-close", onClick: onClose, "aria-label": "\uC0AD\uC81C", disabled, children: /* @__PURE__ */ jsx344(XIcon_default, {}) })
|
|
5068
5031
|
]
|
|
5069
5032
|
}
|
|
5070
5033
|
);
|
|
@@ -5072,6 +5035,63 @@ var Tag = (props) => {
|
|
|
5072
5035
|
Tag.displayName = "Tag";
|
|
5073
5036
|
var Tag_default = Tag;
|
|
5074
5037
|
|
|
5038
|
+
// src/components/TextArea/TextArea.tsx
|
|
5039
|
+
import React37 from "react";
|
|
5040
|
+
import { jsx as jsx345 } from "react/jsx-runtime";
|
|
5041
|
+
var TextArea = React37.forwardRef(
|
|
5042
|
+
(props, ref) => {
|
|
5043
|
+
const { value, onChange, disabled, ...textareaProps } = props;
|
|
5044
|
+
const localRef = React37.useRef(null);
|
|
5045
|
+
const setRefs = (el) => {
|
|
5046
|
+
localRef.current = el;
|
|
5047
|
+
if (!ref) return;
|
|
5048
|
+
if (typeof ref === "function") {
|
|
5049
|
+
ref(el);
|
|
5050
|
+
} else if (ref && typeof ref === "object" && "current" in ref) {
|
|
5051
|
+
ref.current = el;
|
|
5052
|
+
}
|
|
5053
|
+
};
|
|
5054
|
+
const handleOnChange = (e) => {
|
|
5055
|
+
const val = e.target.value;
|
|
5056
|
+
if (onChange) {
|
|
5057
|
+
const event = {
|
|
5058
|
+
...e,
|
|
5059
|
+
target: { value: val }
|
|
5060
|
+
};
|
|
5061
|
+
onChange(event);
|
|
5062
|
+
}
|
|
5063
|
+
};
|
|
5064
|
+
React37.useEffect(() => {
|
|
5065
|
+
const el = localRef.current;
|
|
5066
|
+
if (!el) return;
|
|
5067
|
+
el.style.height = "0px";
|
|
5068
|
+
const nextHeight = Math.min(el.scrollHeight, 400);
|
|
5069
|
+
el.style.height = `${nextHeight}px`;
|
|
5070
|
+
}, [value]);
|
|
5071
|
+
return /* @__PURE__ */ jsx345("div", { className: "lib-xplat-textarea-wrapper", children: /* @__PURE__ */ jsx345(
|
|
5072
|
+
"div",
|
|
5073
|
+
{
|
|
5074
|
+
className: clsx_default(
|
|
5075
|
+
"lib-xplat-textarea",
|
|
5076
|
+
disabled ? "disabled" : void 0
|
|
5077
|
+
),
|
|
5078
|
+
children: /* @__PURE__ */ jsx345(
|
|
5079
|
+
"textarea",
|
|
5080
|
+
{
|
|
5081
|
+
...textareaProps,
|
|
5082
|
+
ref: setRefs,
|
|
5083
|
+
disabled,
|
|
5084
|
+
value,
|
|
5085
|
+
onChange: handleOnChange
|
|
5086
|
+
}
|
|
5087
|
+
)
|
|
5088
|
+
}
|
|
5089
|
+
) });
|
|
5090
|
+
}
|
|
5091
|
+
);
|
|
5092
|
+
TextArea.displayName = "TextArea";
|
|
5093
|
+
var TextArea_default = TextArea;
|
|
5094
|
+
|
|
5075
5095
|
// src/components/Toast/Toast.tsx
|
|
5076
5096
|
import React38 from "react";
|
|
5077
5097
|
import { createPortal as createPortal3 } from "react-dom";
|