@x-plat/design-system 0.5.21 → 0.5.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ChatInput/index.cjs +177 -0
- package/dist/components/ChatInput/index.css +87 -0
- package/dist/components/ChatInput/index.d.cts +14 -0
- package/dist/components/ChatInput/index.d.ts +14 -0
- package/dist/components/ChatInput/index.js +140 -0
- package/dist/components/Table/index.cjs +2 -1
- package/dist/components/Table/index.css +117 -0
- package/dist/components/Table/index.d.cts +3 -1
- package/dist/components/Table/index.d.ts +3 -1
- package/dist/components/Table/index.js +2 -1
- package/dist/components/index.cjs +625 -523
- package/dist/components/index.css +205 -0
- package/dist/components/index.d.cts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +623 -522
- package/dist/index.cjs +634 -547
- package/dist/index.css +205 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +632 -546
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6035,30 +6035,114 @@ var Calendar = (props) => {
|
|
|
6035
6035
|
Calendar.displayName = "Calendar";
|
|
6036
6036
|
var Calendar_default = Calendar;
|
|
6037
6037
|
|
|
6038
|
-
// src/components/
|
|
6038
|
+
// src/components/ChatInput/ChatInput.tsx
|
|
6039
|
+
import React4 from "react";
|
|
6039
6040
|
import { jsx as jsx302, jsxs as jsxs194 } from "react/jsx-runtime";
|
|
6041
|
+
var MAX_HEIGHT = 200;
|
|
6042
|
+
var ChatInput = React4.forwardRef(
|
|
6043
|
+
(props, ref) => {
|
|
6044
|
+
const {
|
|
6045
|
+
placeholder,
|
|
6046
|
+
value: valueProp,
|
|
6047
|
+
disabled = false,
|
|
6048
|
+
buttonType = "primary",
|
|
6049
|
+
onSubmit,
|
|
6050
|
+
onChange
|
|
6051
|
+
} = props;
|
|
6052
|
+
const isControlled = valueProp !== void 0;
|
|
6053
|
+
const [internalValue, setInternalValue] = React4.useState("");
|
|
6054
|
+
const value = isControlled ? valueProp : internalValue;
|
|
6055
|
+
const hasText = value.trim().length > 0;
|
|
6056
|
+
const textareaRef = React4.useRef(null);
|
|
6057
|
+
const setRefs = React4.useCallback(
|
|
6058
|
+
(el) => {
|
|
6059
|
+
textareaRef.current = el;
|
|
6060
|
+
if (typeof ref === "function") ref(el);
|
|
6061
|
+
else if (ref) ref.current = el;
|
|
6062
|
+
},
|
|
6063
|
+
[ref]
|
|
6064
|
+
);
|
|
6065
|
+
const updateHeight = React4.useCallback(() => {
|
|
6066
|
+
const el = textareaRef.current;
|
|
6067
|
+
if (!el) return;
|
|
6068
|
+
el.style.height = "0px";
|
|
6069
|
+
el.style.height = `${Math.min(el.scrollHeight, MAX_HEIGHT)}px`;
|
|
6070
|
+
}, []);
|
|
6071
|
+
const handleChange = (e) => {
|
|
6072
|
+
const val = e.target.value;
|
|
6073
|
+
if (!isControlled) setInternalValue(val);
|
|
6074
|
+
onChange?.(val);
|
|
6075
|
+
};
|
|
6076
|
+
const handleSubmit = () => {
|
|
6077
|
+
if (!hasText || disabled) return;
|
|
6078
|
+
onSubmit?.(value);
|
|
6079
|
+
if (!isControlled) setInternalValue("");
|
|
6080
|
+
requestAnimationFrame(updateHeight);
|
|
6081
|
+
};
|
|
6082
|
+
const handleKeyDown = (e) => {
|
|
6083
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
6084
|
+
e.preventDefault();
|
|
6085
|
+
handleSubmit();
|
|
6086
|
+
}
|
|
6087
|
+
};
|
|
6088
|
+
React4.useEffect(() => {
|
|
6089
|
+
updateHeight();
|
|
6090
|
+
}, [value, updateHeight]);
|
|
6091
|
+
return /* @__PURE__ */ jsxs194("div", { className: clsx_default("lib-xplat-chat-input", disabled && "disabled"), children: [
|
|
6092
|
+
/* @__PURE__ */ jsx302(
|
|
6093
|
+
"textarea",
|
|
6094
|
+
{
|
|
6095
|
+
ref: setRefs,
|
|
6096
|
+
className: "chat-input-textarea",
|
|
6097
|
+
placeholder,
|
|
6098
|
+
value,
|
|
6099
|
+
disabled,
|
|
6100
|
+
rows: 1,
|
|
6101
|
+
onChange: handleChange,
|
|
6102
|
+
onKeyDown: handleKeyDown
|
|
6103
|
+
}
|
|
6104
|
+
),
|
|
6105
|
+
/* @__PURE__ */ jsx302(
|
|
6106
|
+
"button",
|
|
6107
|
+
{
|
|
6108
|
+
type: "button",
|
|
6109
|
+
className: clsx_default("chat-input-send", `btn-${buttonType}`),
|
|
6110
|
+
disabled: !hasText || disabled,
|
|
6111
|
+
onClick: handleSubmit,
|
|
6112
|
+
"aria-label": "\uC804\uC1A1",
|
|
6113
|
+
children: /* @__PURE__ */ jsx302(SendIcon_default, {})
|
|
6114
|
+
}
|
|
6115
|
+
)
|
|
6116
|
+
] });
|
|
6117
|
+
}
|
|
6118
|
+
);
|
|
6119
|
+
ChatInput.displayName = "ChatInput";
|
|
6120
|
+
var ChatInput_default = ChatInput;
|
|
6121
|
+
|
|
6122
|
+
// src/components/Box/Box.tsx
|
|
6123
|
+
import { jsx as jsx303, jsxs as jsxs195 } from "react/jsx-runtime";
|
|
6040
6124
|
var Box = ({
|
|
6041
6125
|
children,
|
|
6042
6126
|
title,
|
|
6043
6127
|
variant = "outlined",
|
|
6044
6128
|
padding = "md"
|
|
6045
6129
|
}) => {
|
|
6046
|
-
return /* @__PURE__ */
|
|
6047
|
-
title && /* @__PURE__ */
|
|
6048
|
-
/* @__PURE__ */
|
|
6130
|
+
return /* @__PURE__ */ jsxs195("div", { className: clsx_default("lib-xplat-box", variant, `pad-${padding}`), children: [
|
|
6131
|
+
title && /* @__PURE__ */ jsx303("div", { className: "box-title", children: title }),
|
|
6132
|
+
/* @__PURE__ */ jsx303("div", { className: "box-content", children })
|
|
6049
6133
|
] });
|
|
6050
6134
|
};
|
|
6051
6135
|
Box.displayName = "Box";
|
|
6052
6136
|
var Box_default = Box;
|
|
6053
6137
|
|
|
6054
6138
|
// src/components/CardTab/CardTab.tsx
|
|
6055
|
-
import
|
|
6139
|
+
import React5 from "react";
|
|
6056
6140
|
|
|
6057
6141
|
// src/components/CardTab/CardTabPanel.tsx
|
|
6058
|
-
import { jsx as
|
|
6142
|
+
import { jsx as jsx304 } from "react/jsx-runtime";
|
|
6059
6143
|
var CardTabPanel = (props) => {
|
|
6060
6144
|
const { children, columns = 3 } = props;
|
|
6061
|
-
return /* @__PURE__ */
|
|
6145
|
+
return /* @__PURE__ */ jsx304(
|
|
6062
6146
|
"div",
|
|
6063
6147
|
{
|
|
6064
6148
|
className: "card-tab-panel",
|
|
@@ -6071,7 +6155,7 @@ CardTabPanel.displayName = "CardTab.Panel";
|
|
|
6071
6155
|
var CardTabPanel_default = CardTabPanel;
|
|
6072
6156
|
|
|
6073
6157
|
// src/components/CardTab/CardTab.tsx
|
|
6074
|
-
import { jsx as
|
|
6158
|
+
import { jsx as jsx305, jsxs as jsxs196 } from "react/jsx-runtime";
|
|
6075
6159
|
var CardTabRoot = (props) => {
|
|
6076
6160
|
const {
|
|
6077
6161
|
tabs,
|
|
@@ -6081,7 +6165,7 @@ var CardTabRoot = (props) => {
|
|
|
6081
6165
|
children
|
|
6082
6166
|
} = props;
|
|
6083
6167
|
const isControlled = activeValueProp !== void 0;
|
|
6084
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
6168
|
+
const [uncontrolledValue, setUncontrolledValue] = React5.useState(tabs[0]?.value ?? "");
|
|
6085
6169
|
const activeValue = isControlled ? activeValueProp : uncontrolledValue;
|
|
6086
6170
|
const handleTabClick = (tab) => {
|
|
6087
6171
|
if (!isControlled) {
|
|
@@ -6089,16 +6173,16 @@ var CardTabRoot = (props) => {
|
|
|
6089
6173
|
}
|
|
6090
6174
|
onChange?.(tab);
|
|
6091
6175
|
};
|
|
6092
|
-
const panels =
|
|
6093
|
-
(child) =>
|
|
6176
|
+
const panels = React5.Children.toArray(children).filter(
|
|
6177
|
+
(child) => React5.isValidElement(child) && child.type === CardTabPanel_default
|
|
6094
6178
|
);
|
|
6095
6179
|
const activePanel = panels.find(
|
|
6096
6180
|
(panel) => panel.props.value === activeValue
|
|
6097
6181
|
);
|
|
6098
|
-
return /* @__PURE__ */
|
|
6099
|
-
/* @__PURE__ */
|
|
6182
|
+
return /* @__PURE__ */ jsxs196("div", { className: clsx_default("lib-xplat-card-tab", size), children: [
|
|
6183
|
+
/* @__PURE__ */ jsx305("div", { className: "card-tab-bar", children: tabs.map((tab) => {
|
|
6100
6184
|
const isActive = tab.value === activeValue;
|
|
6101
|
-
return /* @__PURE__ */
|
|
6185
|
+
return /* @__PURE__ */ jsx305(
|
|
6102
6186
|
"button",
|
|
6103
6187
|
{
|
|
6104
6188
|
className: clsx_default("card-tab-trigger", isActive && "active"),
|
|
@@ -6110,7 +6194,7 @@ var CardTabRoot = (props) => {
|
|
|
6110
6194
|
tab.value
|
|
6111
6195
|
);
|
|
6112
6196
|
}) }),
|
|
6113
|
-
/* @__PURE__ */
|
|
6197
|
+
/* @__PURE__ */ jsx305("div", { className: "card-tab-body", children: activePanel })
|
|
6114
6198
|
] });
|
|
6115
6199
|
};
|
|
6116
6200
|
CardTabRoot.displayName = "CardTab";
|
|
@@ -6120,8 +6204,8 @@ var CardTab = Object.assign(CardTabRoot, {
|
|
|
6120
6204
|
var CardTab_default = CardTab;
|
|
6121
6205
|
|
|
6122
6206
|
// src/components/Chart/Chart.tsx
|
|
6123
|
-
import
|
|
6124
|
-
import { Fragment as Fragment2, jsx as
|
|
6207
|
+
import React6 from "react";
|
|
6208
|
+
import { Fragment as Fragment2, jsx as jsx306, jsxs as jsxs197 } from "react/jsx-runtime";
|
|
6125
6209
|
var CATEGORICAL_COUNT2 = 8;
|
|
6126
6210
|
var LINE_BAR_PALETTES = Array.from({ length: CATEGORICAL_COUNT2 }, (_, i) => {
|
|
6127
6211
|
const n = i + 1;
|
|
@@ -6167,11 +6251,11 @@ var toSmoothPath = (points) => {
|
|
|
6167
6251
|
};
|
|
6168
6252
|
var RESIZE_SETTLE_MS = 150;
|
|
6169
6253
|
var useChartSize = (ref) => {
|
|
6170
|
-
const [size, setSize] =
|
|
6171
|
-
const settleTimer =
|
|
6172
|
-
const committedSize =
|
|
6173
|
-
const initialRef =
|
|
6174
|
-
|
|
6254
|
+
const [size, setSize] = React6.useState({ width: 0, height: 0 });
|
|
6255
|
+
const settleTimer = React6.useRef(0);
|
|
6256
|
+
const committedSize = React6.useRef({ width: 0, height: 0 });
|
|
6257
|
+
const initialRef = React6.useRef(true);
|
|
6258
|
+
React6.useEffect(() => {
|
|
6175
6259
|
const el = ref.current;
|
|
6176
6260
|
if (!el) return;
|
|
6177
6261
|
const observer = new ResizeObserver((entries) => {
|
|
@@ -6213,10 +6297,10 @@ var useChartSize = (ref) => {
|
|
|
6213
6297
|
};
|
|
6214
6298
|
var prefersReducedMotion = () => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
6215
6299
|
var useChartAnimation = (containerRef, dataKey) => {
|
|
6216
|
-
const [animate, setAnimate] =
|
|
6217
|
-
const prevDataKey =
|
|
6218
|
-
const hasAnimated =
|
|
6219
|
-
|
|
6300
|
+
const [animate, setAnimate] = React6.useState(false);
|
|
6301
|
+
const prevDataKey = React6.useRef(dataKey);
|
|
6302
|
+
const hasAnimated = React6.useRef(false);
|
|
6303
|
+
React6.useEffect(() => {
|
|
6220
6304
|
if (prefersReducedMotion()) return;
|
|
6221
6305
|
const el = containerRef.current;
|
|
6222
6306
|
if (!el) return;
|
|
@@ -6232,7 +6316,7 @@ var useChartAnimation = (containerRef, dataKey) => {
|
|
|
6232
6316
|
observer.observe(el);
|
|
6233
6317
|
return () => observer.disconnect();
|
|
6234
6318
|
}, [containerRef]);
|
|
6235
|
-
|
|
6319
|
+
React6.useEffect(() => {
|
|
6236
6320
|
if (dataKey !== prevDataKey.current) {
|
|
6237
6321
|
prevDataKey.current = dataKey;
|
|
6238
6322
|
if (prefersReducedMotion()) return;
|
|
@@ -6243,15 +6327,15 @@ var useChartAnimation = (containerRef, dataKey) => {
|
|
|
6243
6327
|
return animate || prefersReducedMotion();
|
|
6244
6328
|
};
|
|
6245
6329
|
var useChartTooltip = (enabled) => {
|
|
6246
|
-
const [tooltip, setTooltip] =
|
|
6330
|
+
const [tooltip, setTooltip] = React6.useState({
|
|
6247
6331
|
visible: false,
|
|
6248
6332
|
x: 0,
|
|
6249
6333
|
y: 0,
|
|
6250
6334
|
content: ""
|
|
6251
6335
|
});
|
|
6252
|
-
const containerRef =
|
|
6253
|
-
const rafRef =
|
|
6254
|
-
const move =
|
|
6336
|
+
const containerRef = React6.useRef(null);
|
|
6337
|
+
const rafRef = React6.useRef(0);
|
|
6338
|
+
const move = React6.useCallback((e) => {
|
|
6255
6339
|
if (!enabled) return;
|
|
6256
6340
|
const clientX = e.clientX;
|
|
6257
6341
|
const clientY = e.clientY;
|
|
@@ -6266,7 +6350,7 @@ var useChartTooltip = (enabled) => {
|
|
|
6266
6350
|
}));
|
|
6267
6351
|
});
|
|
6268
6352
|
}, [enabled]);
|
|
6269
|
-
const show =
|
|
6353
|
+
const show = React6.useCallback((e, content) => {
|
|
6270
6354
|
if (!enabled) return;
|
|
6271
6355
|
const rect = containerRef.current?.getBoundingClientRect();
|
|
6272
6356
|
if (!rect) return;
|
|
@@ -6277,18 +6361,18 @@ var useChartTooltip = (enabled) => {
|
|
|
6277
6361
|
content
|
|
6278
6362
|
});
|
|
6279
6363
|
}, [enabled]);
|
|
6280
|
-
const hide =
|
|
6364
|
+
const hide = React6.useCallback(() => {
|
|
6281
6365
|
cancelAnimationFrame(rafRef.current);
|
|
6282
6366
|
setTooltip((prev) => ({ ...prev, visible: false }));
|
|
6283
6367
|
}, []);
|
|
6284
6368
|
return { tooltip, show, hide, move, containerRef };
|
|
6285
6369
|
};
|
|
6286
|
-
var GridLines =
|
|
6370
|
+
var GridLines = React6.memo(({ width, height, chartH, maxVal }) => /* @__PURE__ */ jsx306(Fragment2, { children: [0, 0.25, 0.5, 0.75, 1].map((ratio) => {
|
|
6287
6371
|
const y = PADDING.top + (1 - ratio) * chartH;
|
|
6288
6372
|
const val = Math.round(maxVal * ratio);
|
|
6289
|
-
return /* @__PURE__ */
|
|
6290
|
-
/* @__PURE__ */
|
|
6291
|
-
/* @__PURE__ */
|
|
6373
|
+
return /* @__PURE__ */ jsxs197("g", { children: [
|
|
6374
|
+
/* @__PURE__ */ jsx306("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
|
|
6375
|
+
/* @__PURE__ */ jsx306("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
|
|
6292
6376
|
] }, ratio);
|
|
6293
6377
|
}) }));
|
|
6294
6378
|
GridLines.displayName = "GridLines";
|
|
@@ -6298,25 +6382,25 @@ var getLabelStep = (count, chartW) => {
|
|
|
6298
6382
|
if (count <= maxLabels) return 1;
|
|
6299
6383
|
return Math.ceil(count / maxLabels);
|
|
6300
6384
|
};
|
|
6301
|
-
var AxisLabels =
|
|
6385
|
+
var AxisLabels = React6.memo(({ labels, count, chartW, height }) => {
|
|
6302
6386
|
const step = getLabelStep(count, chartW);
|
|
6303
|
-
return /* @__PURE__ */
|
|
6387
|
+
return /* @__PURE__ */ jsx306(Fragment2, { children: labels.map((label, i) => {
|
|
6304
6388
|
if (i % step !== 0) return null;
|
|
6305
6389
|
const x = PADDING.left + i / (count - 1 || 1) * chartW;
|
|
6306
|
-
return /* @__PURE__ */
|
|
6390
|
+
return /* @__PURE__ */ jsx306("text", { x, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
6307
6391
|
}) });
|
|
6308
6392
|
});
|
|
6309
6393
|
AxisLabels.displayName = "AxisLabels";
|
|
6310
|
-
var LineChart =
|
|
6311
|
-
const entries =
|
|
6312
|
-
const maxVal =
|
|
6394
|
+
var LineChart = React6.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
|
|
6395
|
+
const entries = React6.useMemo(() => Object.entries(data), [data]);
|
|
6396
|
+
const maxVal = React6.useMemo(() => {
|
|
6313
6397
|
const allValues = entries.flatMap(([, v]) => v);
|
|
6314
6398
|
return Math.max(...allValues) * 1.2 || 1;
|
|
6315
6399
|
}, [entries]);
|
|
6316
6400
|
const count = labels.length;
|
|
6317
6401
|
const chartW = width - PADDING.left - PADDING.right;
|
|
6318
6402
|
const chartH = height - PADDING.top - PADDING.bottom;
|
|
6319
|
-
const seriesPoints =
|
|
6403
|
+
const seriesPoints = React6.useMemo(
|
|
6320
6404
|
() => entries.map(
|
|
6321
6405
|
([, values]) => values.map((v, i) => ({
|
|
6322
6406
|
x: PADDING.left + i / (count - 1 || 1) * chartW,
|
|
@@ -6327,8 +6411,8 @@ var LineChart = React5.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
6327
6411
|
[entries, count, chartW, chartH, maxVal]
|
|
6328
6412
|
);
|
|
6329
6413
|
const showPoints = count <= 100;
|
|
6330
|
-
const lineRefs =
|
|
6331
|
-
|
|
6414
|
+
const lineRefs = React6.useRef([]);
|
|
6415
|
+
React6.useEffect(() => {
|
|
6332
6416
|
if (!animate) return;
|
|
6333
6417
|
lineRefs.current.forEach((el) => {
|
|
6334
6418
|
if (!el) return;
|
|
@@ -6341,9 +6425,9 @@ var LineChart = React5.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
6341
6425
|
});
|
|
6342
6426
|
});
|
|
6343
6427
|
}, [animate, seriesPoints]);
|
|
6344
|
-
return /* @__PURE__ */
|
|
6345
|
-
/* @__PURE__ */
|
|
6346
|
-
/* @__PURE__ */
|
|
6428
|
+
return /* @__PURE__ */ jsxs197("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
6429
|
+
/* @__PURE__ */ jsx306(GridLines, { width, height, chartH, maxVal }),
|
|
6430
|
+
/* @__PURE__ */ jsx306(AxisLabels, { labels, count, chartW, height }),
|
|
6347
6431
|
entries.map(([key], di) => {
|
|
6348
6432
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
6349
6433
|
const color = palette[2];
|
|
@@ -6352,12 +6436,12 @@ var LineChart = React5.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
6352
6436
|
const gradientId = `line-gradient-${di}`;
|
|
6353
6437
|
const polyPoints = points.map((p) => `${p.x},${p.y}`).join(" ");
|
|
6354
6438
|
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`;
|
|
6355
|
-
return /* @__PURE__ */
|
|
6356
|
-
/* @__PURE__ */
|
|
6357
|
-
/* @__PURE__ */
|
|
6358
|
-
/* @__PURE__ */
|
|
6439
|
+
return /* @__PURE__ */ jsxs197("g", { children: [
|
|
6440
|
+
/* @__PURE__ */ jsx306("defs", { children: /* @__PURE__ */ jsxs197("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
6441
|
+
/* @__PURE__ */ jsx306("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.2" }),
|
|
6442
|
+
/* @__PURE__ */ jsx306("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0" })
|
|
6359
6443
|
] }) }),
|
|
6360
|
-
/* @__PURE__ */
|
|
6444
|
+
/* @__PURE__ */ jsx306(
|
|
6361
6445
|
"path",
|
|
6362
6446
|
{
|
|
6363
6447
|
d: areaD,
|
|
@@ -6366,7 +6450,7 @@ var LineChart = React5.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
6366
6450
|
style: animate ? { animationDelay: "600ms" } : { opacity: 1 }
|
|
6367
6451
|
}
|
|
6368
6452
|
),
|
|
6369
|
-
/* @__PURE__ */
|
|
6453
|
+
/* @__PURE__ */ jsx306(
|
|
6370
6454
|
"polyline",
|
|
6371
6455
|
{
|
|
6372
6456
|
ref: (el) => {
|
|
@@ -6378,7 +6462,7 @@ var LineChart = React5.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
6378
6462
|
strokeWidth: "2"
|
|
6379
6463
|
}
|
|
6380
6464
|
),
|
|
6381
|
-
showPoints && points.map((p, i) => /* @__PURE__ */
|
|
6465
|
+
showPoints && points.map((p, i) => /* @__PURE__ */ jsx306(
|
|
6382
6466
|
"circle",
|
|
6383
6467
|
{
|
|
6384
6468
|
cx: p.x,
|
|
@@ -6397,16 +6481,16 @@ var LineChart = React5.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
6397
6481
|
] });
|
|
6398
6482
|
});
|
|
6399
6483
|
LineChart.displayName = "LineChart";
|
|
6400
|
-
var CurveChart =
|
|
6401
|
-
const entries =
|
|
6402
|
-
const maxVal =
|
|
6484
|
+
var CurveChart = React6.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
|
|
6485
|
+
const entries = React6.useMemo(() => Object.entries(data), [data]);
|
|
6486
|
+
const maxVal = React6.useMemo(() => {
|
|
6403
6487
|
const allValues = entries.flatMap(([, v]) => v);
|
|
6404
6488
|
return Math.max(...allValues) * 1.2 || 1;
|
|
6405
6489
|
}, [entries]);
|
|
6406
6490
|
const count = labels.length;
|
|
6407
6491
|
const chartW = width - PADDING.left - PADDING.right;
|
|
6408
6492
|
const chartH = height - PADDING.top - PADDING.bottom;
|
|
6409
|
-
const seriesPoints =
|
|
6493
|
+
const seriesPoints = React6.useMemo(
|
|
6410
6494
|
() => entries.map(
|
|
6411
6495
|
([, values]) => values.map((v, i) => ({
|
|
6412
6496
|
x: PADDING.left + i / (count - 1 || 1) * chartW,
|
|
@@ -6417,8 +6501,8 @@ var CurveChart = React5.memo(({ data, labels, width, height, animate, onHover, o
|
|
|
6417
6501
|
[entries, count, chartW, chartH, maxVal]
|
|
6418
6502
|
);
|
|
6419
6503
|
const showPoints = count <= 100;
|
|
6420
|
-
const lineRefs =
|
|
6421
|
-
|
|
6504
|
+
const lineRefs = React6.useRef([]);
|
|
6505
|
+
React6.useEffect(() => {
|
|
6422
6506
|
if (!animate) return;
|
|
6423
6507
|
lineRefs.current.forEach((el) => {
|
|
6424
6508
|
if (!el) return;
|
|
@@ -6431,9 +6515,9 @@ var CurveChart = React5.memo(({ data, labels, width, height, animate, onHover, o
|
|
|
6431
6515
|
});
|
|
6432
6516
|
});
|
|
6433
6517
|
}, [animate, seriesPoints]);
|
|
6434
|
-
return /* @__PURE__ */
|
|
6435
|
-
/* @__PURE__ */
|
|
6436
|
-
/* @__PURE__ */
|
|
6518
|
+
return /* @__PURE__ */ jsxs197("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
6519
|
+
/* @__PURE__ */ jsx306(GridLines, { width, height, chartH, maxVal }),
|
|
6520
|
+
/* @__PURE__ */ jsx306(AxisLabels, { labels, count, chartW, height }),
|
|
6437
6521
|
entries.map(([key], di) => {
|
|
6438
6522
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
6439
6523
|
const color = palette[2];
|
|
@@ -6442,12 +6526,12 @@ var CurveChart = React5.memo(({ data, labels, width, height, animate, onHover, o
|
|
|
6442
6526
|
const gradientId = `curve-gradient-${di}`;
|
|
6443
6527
|
const linePath = toSmoothPath(points);
|
|
6444
6528
|
const areaPath = linePath + ` L ${points[points.length - 1].x} ${PADDING.top + chartH} L ${points[0].x} ${PADDING.top + chartH} Z`;
|
|
6445
|
-
return /* @__PURE__ */
|
|
6446
|
-
/* @__PURE__ */
|
|
6447
|
-
/* @__PURE__ */
|
|
6448
|
-
/* @__PURE__ */
|
|
6529
|
+
return /* @__PURE__ */ jsxs197("g", { children: [
|
|
6530
|
+
/* @__PURE__ */ jsx306("defs", { children: /* @__PURE__ */ jsxs197("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
6531
|
+
/* @__PURE__ */ jsx306("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.4" }),
|
|
6532
|
+
/* @__PURE__ */ jsx306("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0.02" })
|
|
6449
6533
|
] }) }),
|
|
6450
|
-
/* @__PURE__ */
|
|
6534
|
+
/* @__PURE__ */ jsx306(
|
|
6451
6535
|
"path",
|
|
6452
6536
|
{
|
|
6453
6537
|
d: areaPath,
|
|
@@ -6456,7 +6540,7 @@ var CurveChart = React5.memo(({ data, labels, width, height, animate, onHover, o
|
|
|
6456
6540
|
style: animate ? { animationDelay: "600ms" } : { opacity: 1 }
|
|
6457
6541
|
}
|
|
6458
6542
|
),
|
|
6459
|
-
/* @__PURE__ */
|
|
6543
|
+
/* @__PURE__ */ jsx306(
|
|
6460
6544
|
"path",
|
|
6461
6545
|
{
|
|
6462
6546
|
ref: (el) => {
|
|
@@ -6468,7 +6552,7 @@ var CurveChart = React5.memo(({ data, labels, width, height, animate, onHover, o
|
|
|
6468
6552
|
strokeWidth: "2"
|
|
6469
6553
|
}
|
|
6470
6554
|
),
|
|
6471
|
-
showPoints && points.map((p, i) => /* @__PURE__ */
|
|
6555
|
+
showPoints && points.map((p, i) => /* @__PURE__ */ jsx306(
|
|
6472
6556
|
"circle",
|
|
6473
6557
|
{
|
|
6474
6558
|
cx: p.x,
|
|
@@ -6487,9 +6571,9 @@ var CurveChart = React5.memo(({ data, labels, width, height, animate, onHover, o
|
|
|
6487
6571
|
] });
|
|
6488
6572
|
});
|
|
6489
6573
|
CurveChart.displayName = "CurveChart";
|
|
6490
|
-
var BarChart =
|
|
6491
|
-
const entries =
|
|
6492
|
-
const maxVal =
|
|
6574
|
+
var BarChart = React6.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
|
|
6575
|
+
const entries = React6.useMemo(() => Object.entries(data), [data]);
|
|
6576
|
+
const maxVal = React6.useMemo(() => {
|
|
6493
6577
|
const allValues = entries.flatMap(([, v]) => v);
|
|
6494
6578
|
return Math.max(...allValues) * 1.2 || 1;
|
|
6495
6579
|
}, [entries]);
|
|
@@ -6501,7 +6585,7 @@ var BarChart = React5.memo(({ data, labels, width, height, animate, onHover, onM
|
|
|
6501
6585
|
const barGap = groupCount > 1 ? 2 : 0;
|
|
6502
6586
|
const barW = Math.max(1, Math.min(32, (groupW * 0.7 - barGap * (groupCount - 1)) / groupCount));
|
|
6503
6587
|
const baseline = PADDING.top + chartH;
|
|
6504
|
-
const bars =
|
|
6588
|
+
const bars = React6.useMemo(
|
|
6505
6589
|
() => entries.map(
|
|
6506
6590
|
([, values], di) => values.map((v, i) => {
|
|
6507
6591
|
const totalBarsW = barW * groupCount + barGap * (groupCount - 1);
|
|
@@ -6514,11 +6598,11 @@ var BarChart = React5.memo(({ data, labels, width, height, animate, onHover, onM
|
|
|
6514
6598
|
[entries, maxVal, chartH, groupW, barW, barGap, groupCount]
|
|
6515
6599
|
);
|
|
6516
6600
|
const barLabelStep = getLabelStep(count, chartW);
|
|
6517
|
-
return /* @__PURE__ */
|
|
6518
|
-
/* @__PURE__ */
|
|
6601
|
+
return /* @__PURE__ */ jsxs197("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
6602
|
+
/* @__PURE__ */ jsx306(GridLines, { width, height, chartH, maxVal }),
|
|
6519
6603
|
labels.map((label, i) => {
|
|
6520
6604
|
if (i % barLabelStep !== 0) return null;
|
|
6521
|
-
return /* @__PURE__ */
|
|
6605
|
+
return /* @__PURE__ */ jsx306("text", { x: PADDING.left + groupW * i + groupW / 2, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
6522
6606
|
}),
|
|
6523
6607
|
entries.map(([key], di) => {
|
|
6524
6608
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
@@ -6527,7 +6611,7 @@ var BarChart = React5.memo(({ data, labels, width, height, animate, onHover, onM
|
|
|
6527
6611
|
const r2 = Math.min(4, b.w / 2);
|
|
6528
6612
|
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`;
|
|
6529
6613
|
const delay = 100 + i * 80;
|
|
6530
|
-
return /* @__PURE__ */
|
|
6614
|
+
return /* @__PURE__ */ jsx306(
|
|
6531
6615
|
"path",
|
|
6532
6616
|
{
|
|
6533
6617
|
d,
|
|
@@ -6548,11 +6632,11 @@ var BarChart = React5.memo(({ data, labels, width, height, animate, onHover, onM
|
|
|
6548
6632
|
] });
|
|
6549
6633
|
});
|
|
6550
6634
|
BarChart.displayName = "BarChart";
|
|
6551
|
-
var PieDonutChart =
|
|
6635
|
+
var PieDonutChart = React6.memo(
|
|
6552
6636
|
({ data, labels, width, height, animate, isDoughnut, onHover, onMove, onLeave }) => {
|
|
6553
|
-
const entries =
|
|
6554
|
-
const values =
|
|
6555
|
-
const total =
|
|
6637
|
+
const entries = React6.useMemo(() => Object.entries(data), [data]);
|
|
6638
|
+
const values = React6.useMemo(() => entries.flatMap(([, v]) => v), [entries]);
|
|
6639
|
+
const total = React6.useMemo(() => values.reduce((a, b) => a + b, 0) || 1, [values]);
|
|
6556
6640
|
const size = Math.min(width, height);
|
|
6557
6641
|
const cx = size / 2;
|
|
6558
6642
|
const cy = size / 2;
|
|
@@ -6560,10 +6644,10 @@ var PieDonutChart = React5.memo(
|
|
|
6560
6644
|
const innerR = isDoughnut ? r2 * 0.5 : 0;
|
|
6561
6645
|
const firstKey = entries[0]?.[0] ?? "";
|
|
6562
6646
|
const colorOffset = hashString(firstKey);
|
|
6563
|
-
const maskRef =
|
|
6647
|
+
const maskRef = React6.useRef(null);
|
|
6564
6648
|
const maskR = r2 + 10;
|
|
6565
6649
|
const maskCircumference = 2 * Math.PI * maskR;
|
|
6566
|
-
|
|
6650
|
+
React6.useEffect(() => {
|
|
6567
6651
|
if (!animate || !maskRef.current) return;
|
|
6568
6652
|
const el = maskRef.current;
|
|
6569
6653
|
el.style.strokeDasharray = `${maskCircumference}`;
|
|
@@ -6573,7 +6657,7 @@ var PieDonutChart = React5.memo(
|
|
|
6573
6657
|
el.style.strokeDashoffset = "0";
|
|
6574
6658
|
});
|
|
6575
6659
|
}, [animate, maskCircumference]);
|
|
6576
|
-
const sliceData =
|
|
6660
|
+
const sliceData = React6.useMemo(() => {
|
|
6577
6661
|
let angle0 = -Math.PI / 2;
|
|
6578
6662
|
let cumulativeAngle = 0;
|
|
6579
6663
|
return values.map((v, i) => {
|
|
@@ -6607,8 +6691,8 @@ var PieDonutChart = React5.memo(
|
|
|
6607
6691
|
});
|
|
6608
6692
|
}, [values, total, cx, cy, r2, innerR, labels]);
|
|
6609
6693
|
const maskId = `pie-mask-${isDoughnut ? "d" : "p"}`;
|
|
6610
|
-
return /* @__PURE__ */
|
|
6611
|
-
animate && /* @__PURE__ */
|
|
6694
|
+
return /* @__PURE__ */ jsxs197("svg", { viewBox: `0 0 ${size} ${size}`, className: "chart-svg chart-pie", children: [
|
|
6695
|
+
animate && /* @__PURE__ */ jsx306("defs", { children: /* @__PURE__ */ jsx306("mask", { id: maskId, children: /* @__PURE__ */ jsx306(
|
|
6612
6696
|
"circle",
|
|
6613
6697
|
{
|
|
6614
6698
|
ref: maskRef,
|
|
@@ -6621,7 +6705,7 @@ var PieDonutChart = React5.memo(
|
|
|
6621
6705
|
transform: `rotate(-90 ${cx} ${cy})`
|
|
6622
6706
|
}
|
|
6623
6707
|
) }) }),
|
|
6624
|
-
/* @__PURE__ */
|
|
6708
|
+
/* @__PURE__ */ jsx306("g", { mask: animate ? `url(#${maskId})` : void 0, children: sliceData.map((s, i) => /* @__PURE__ */ jsx306("g", { children: /* @__PURE__ */ jsx306(
|
|
6625
6709
|
"path",
|
|
6626
6710
|
{
|
|
6627
6711
|
d: s.d,
|
|
@@ -6632,7 +6716,7 @@ var PieDonutChart = React5.memo(
|
|
|
6632
6716
|
onMouseLeave: onLeave
|
|
6633
6717
|
}
|
|
6634
6718
|
) }, i)) }),
|
|
6635
|
-
sliceData.map((s, i) => s.angle > 0.2 && /* @__PURE__ */
|
|
6719
|
+
sliceData.map((s, i) => s.angle > 0.2 && /* @__PURE__ */ jsx306(
|
|
6636
6720
|
"text",
|
|
6637
6721
|
{
|
|
6638
6722
|
x: s.lx,
|
|
@@ -6650,9 +6734,9 @@ var PieDonutChart = React5.memo(
|
|
|
6650
6734
|
);
|
|
6651
6735
|
PieDonutChart.displayName = "PieDonutChart";
|
|
6652
6736
|
var TooltipBubble = ({ x, y, containerWidth, children }) => {
|
|
6653
|
-
const ref =
|
|
6654
|
-
const [adjustedX, setAdjustedX] =
|
|
6655
|
-
|
|
6737
|
+
const ref = React6.useRef(null);
|
|
6738
|
+
const [adjustedX, setAdjustedX] = React6.useState(x);
|
|
6739
|
+
React6.useEffect(() => {
|
|
6656
6740
|
const el = ref.current;
|
|
6657
6741
|
if (!el) return;
|
|
6658
6742
|
const w = el.offsetWidth;
|
|
@@ -6663,7 +6747,7 @@ var TooltipBubble = ({ x, y, containerWidth, children }) => {
|
|
|
6663
6747
|
else if (x + half > containerWidth - margin) nx = containerWidth - half - margin;
|
|
6664
6748
|
setAdjustedX(nx);
|
|
6665
6749
|
}, [x, containerWidth]);
|
|
6666
|
-
return /* @__PURE__ */
|
|
6750
|
+
return /* @__PURE__ */ jsx306(
|
|
6667
6751
|
"div",
|
|
6668
6752
|
{
|
|
6669
6753
|
ref,
|
|
@@ -6673,22 +6757,22 @@ var TooltipBubble = ({ x, y, containerWidth, children }) => {
|
|
|
6673
6757
|
}
|
|
6674
6758
|
);
|
|
6675
6759
|
};
|
|
6676
|
-
var Chart =
|
|
6760
|
+
var Chart = React6.memo((props) => {
|
|
6677
6761
|
const { type, data, labels, tooltip: showTooltip = true } = props;
|
|
6678
6762
|
const { tooltip, show, hide, move, containerRef } = useChartTooltip(showTooltip);
|
|
6679
6763
|
const { width, height } = useChartSize(containerRef);
|
|
6680
|
-
const stableData =
|
|
6681
|
-
const stableLabels =
|
|
6682
|
-
const dataKey =
|
|
6764
|
+
const stableData = React6.useMemo(() => data, [JSON.stringify(data)]);
|
|
6765
|
+
const stableLabels = React6.useMemo(() => labels, [JSON.stringify(labels)]);
|
|
6766
|
+
const dataKey = React6.useMemo(() => JSON.stringify(labels), [labels]);
|
|
6683
6767
|
const animate = useChartAnimation(containerRef, dataKey);
|
|
6684
6768
|
const ready = width > 0 && height > 0;
|
|
6685
|
-
return /* @__PURE__ */
|
|
6686
|
-
ready && type === "line" && /* @__PURE__ */
|
|
6687
|
-
ready && type === "curve" && /* @__PURE__ */
|
|
6688
|
-
ready && type === "bar" && /* @__PURE__ */
|
|
6689
|
-
ready && type === "pie" && /* @__PURE__ */
|
|
6690
|
-
ready && type === "doughnut" && /* @__PURE__ */
|
|
6691
|
-
tooltip.visible && /* @__PURE__ */
|
|
6769
|
+
return /* @__PURE__ */ jsxs197("div", { className: "lib-xplat-chart", ref: containerRef, children: [
|
|
6770
|
+
ready && type === "line" && /* @__PURE__ */ jsx306(LineChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
6771
|
+
ready && type === "curve" && /* @__PURE__ */ jsx306(CurveChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
6772
|
+
ready && type === "bar" && /* @__PURE__ */ jsx306(BarChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
6773
|
+
ready && type === "pie" && /* @__PURE__ */ jsx306(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
6774
|
+
ready && type === "doughnut" && /* @__PURE__ */ jsx306(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, isDoughnut: true, onHover: show, onMove: move, onLeave: hide }),
|
|
6775
|
+
tooltip.visible && /* @__PURE__ */ jsx306(TooltipBubble, { x: tooltip.x, y: tooltip.y, containerWidth: width, children: tooltip.content })
|
|
6692
6776
|
] });
|
|
6693
6777
|
});
|
|
6694
6778
|
Chart.displayName = "Chart";
|
|
@@ -6714,7 +6798,7 @@ import { primitive, semantic } from "@x-plat/tokens-core";
|
|
|
6714
6798
|
import { cssVar } from "@x-plat/tokens-core";
|
|
6715
6799
|
|
|
6716
6800
|
// src/components/CheckBox/CheckBox.tsx
|
|
6717
|
-
import { jsx as
|
|
6801
|
+
import { jsx as jsx307, jsxs as jsxs198 } from "react/jsx-runtime";
|
|
6718
6802
|
var CheckBox = (props) => {
|
|
6719
6803
|
const {
|
|
6720
6804
|
checked,
|
|
@@ -6732,8 +6816,8 @@ var CheckBox = (props) => {
|
|
|
6732
6816
|
const checkedClasses = `checked`;
|
|
6733
6817
|
const disabledClasses = "disabled";
|
|
6734
6818
|
const boxClasses = disabled ? disabledClasses : checked ? checkedClasses : uncheckedClasses;
|
|
6735
|
-
return /* @__PURE__ */
|
|
6736
|
-
/* @__PURE__ */
|
|
6819
|
+
return /* @__PURE__ */ jsxs198("label", { className: clsx_default("lib-xplat-checkbox", size, type), children: [
|
|
6820
|
+
/* @__PURE__ */ jsx307(
|
|
6737
6821
|
"input",
|
|
6738
6822
|
{
|
|
6739
6823
|
type: "checkbox",
|
|
@@ -6743,44 +6827,44 @@ var CheckBox = (props) => {
|
|
|
6743
6827
|
...rest
|
|
6744
6828
|
}
|
|
6745
6829
|
),
|
|
6746
|
-
/* @__PURE__ */
|
|
6747
|
-
label && /* @__PURE__ */
|
|
6830
|
+
/* @__PURE__ */ jsx307("span", { className: clsx_default("checkbox", boxClasses), children: /* @__PURE__ */ jsx307("span", { className: clsx_default("check-icon", { visible: checked }), children: /* @__PURE__ */ jsx307(CheckIcon_default, {}) }) }),
|
|
6831
|
+
label && /* @__PURE__ */ jsx307("span", { className: "label", children: label })
|
|
6748
6832
|
] });
|
|
6749
6833
|
};
|
|
6750
6834
|
CheckBox.displayName = "CheckBox";
|
|
6751
6835
|
var CheckBox_default = CheckBox;
|
|
6752
6836
|
|
|
6753
6837
|
// src/components/Chip/Chip.tsx
|
|
6754
|
-
import { jsx as
|
|
6838
|
+
import { jsx as jsx308 } from "react/jsx-runtime";
|
|
6755
6839
|
var Chip = (props) => {
|
|
6756
6840
|
const {
|
|
6757
6841
|
children,
|
|
6758
6842
|
type = "primary",
|
|
6759
6843
|
size = "md"
|
|
6760
6844
|
} = props;
|
|
6761
|
-
return /* @__PURE__ */
|
|
6845
|
+
return /* @__PURE__ */ jsx308("div", { className: clsx_default("lib-xplat-chip", type, size), children });
|
|
6762
6846
|
};
|
|
6763
6847
|
Chip.displayName = "Chip";
|
|
6764
6848
|
var Chip_default = Chip;
|
|
6765
6849
|
|
|
6766
6850
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
6767
|
-
import
|
|
6851
|
+
import React12 from "react";
|
|
6768
6852
|
|
|
6769
6853
|
// src/components/Input/Input.tsx
|
|
6770
|
-
import
|
|
6854
|
+
import React7 from "react";
|
|
6771
6855
|
|
|
6772
6856
|
// src/components/Input/InputValidations.tsx
|
|
6773
|
-
import { jsx as
|
|
6857
|
+
import { jsx as jsx309, jsxs as jsxs199 } from "react/jsx-runtime";
|
|
6774
6858
|
var InputValidations = (props) => {
|
|
6775
6859
|
const { message, status = "default" } = props;
|
|
6776
|
-
return /* @__PURE__ */
|
|
6777
|
-
/* @__PURE__ */
|
|
6778
|
-
status === "default" && /* @__PURE__ */
|
|
6779
|
-
status === "success" && /* @__PURE__ */
|
|
6780
|
-
status === "warning" && /* @__PURE__ */
|
|
6781
|
-
status === "error" && /* @__PURE__ */
|
|
6860
|
+
return /* @__PURE__ */ jsxs199("div", { className: clsx_default("lib-xplat-input-validation", status), children: [
|
|
6861
|
+
/* @__PURE__ */ jsxs199("div", { className: "icon", children: [
|
|
6862
|
+
status === "default" && /* @__PURE__ */ jsx309(InfoIcon_default, {}),
|
|
6863
|
+
status === "success" && /* @__PURE__ */ jsx309(SuccessIcon_default, {}),
|
|
6864
|
+
status === "warning" && /* @__PURE__ */ jsx309(InfoIcon_default, {}),
|
|
6865
|
+
status === "error" && /* @__PURE__ */ jsx309(ErrorIcon_default, {})
|
|
6782
6866
|
] }),
|
|
6783
|
-
/* @__PURE__ */
|
|
6867
|
+
/* @__PURE__ */ jsx309("div", { className: "message", children: message })
|
|
6784
6868
|
] });
|
|
6785
6869
|
};
|
|
6786
6870
|
InputValidations.displayName = "InputValidations";
|
|
@@ -6821,7 +6905,7 @@ var handleTelBackspace = (prevValue, currValue) => {
|
|
|
6821
6905
|
};
|
|
6822
6906
|
|
|
6823
6907
|
// src/components/Input/Input.tsx
|
|
6824
|
-
import { jsx as
|
|
6908
|
+
import { jsx as jsx310, jsxs as jsxs200 } from "react/jsx-runtime";
|
|
6825
6909
|
import { createElement } from "react";
|
|
6826
6910
|
var formatValue = (type, value) => {
|
|
6827
6911
|
if (value === null || value === void 0) return "";
|
|
@@ -6870,7 +6954,7 @@ var parseValue = (type, value) => {
|
|
|
6870
6954
|
return value;
|
|
6871
6955
|
}
|
|
6872
6956
|
};
|
|
6873
|
-
var Input =
|
|
6957
|
+
var Input = React7.forwardRef((props, ref) => {
|
|
6874
6958
|
const {
|
|
6875
6959
|
value,
|
|
6876
6960
|
onChange,
|
|
@@ -6896,13 +6980,13 @@ var Input = React6.forwardRef((props, ref) => {
|
|
|
6896
6980
|
onChange(event);
|
|
6897
6981
|
}
|
|
6898
6982
|
};
|
|
6899
|
-
return /* @__PURE__ */
|
|
6900
|
-
/* @__PURE__ */
|
|
6983
|
+
return /* @__PURE__ */ jsxs200("div", { className: "lib-xplat-input-wrap", children: [
|
|
6984
|
+
/* @__PURE__ */ jsxs200(
|
|
6901
6985
|
"div",
|
|
6902
6986
|
{
|
|
6903
6987
|
className: clsx_default("lib-xplat-input", size, disabled ? "disabled" : void 0),
|
|
6904
6988
|
children: [
|
|
6905
|
-
/* @__PURE__ */
|
|
6989
|
+
/* @__PURE__ */ jsx310(
|
|
6906
6990
|
"input",
|
|
6907
6991
|
{
|
|
6908
6992
|
...inputProps,
|
|
@@ -6913,11 +6997,11 @@ var Input = React6.forwardRef((props, ref) => {
|
|
|
6913
6997
|
onChange: handleChange
|
|
6914
6998
|
}
|
|
6915
6999
|
),
|
|
6916
|
-
suffix && /* @__PURE__ */
|
|
7000
|
+
suffix && /* @__PURE__ */ jsx310("div", { className: "suffix", children: suffix })
|
|
6917
7001
|
]
|
|
6918
7002
|
}
|
|
6919
7003
|
),
|
|
6920
|
-
validations && /* @__PURE__ */
|
|
7004
|
+
validations && /* @__PURE__ */ jsx310("div", { className: "lib-xplat-input-validation-wrap", children: validations?.map((validation, idx) => /* @__PURE__ */ createElement(
|
|
6921
7005
|
InputValidations_default,
|
|
6922
7006
|
{
|
|
6923
7007
|
...validation,
|
|
@@ -6930,20 +7014,20 @@ Input.displayName = "Input";
|
|
|
6930
7014
|
var Input_default = Input;
|
|
6931
7015
|
|
|
6932
7016
|
// src/components/Input/PasswordInput/PasswordInput.tsx
|
|
6933
|
-
import
|
|
6934
|
-
import { jsx as
|
|
6935
|
-
var PasswordInput =
|
|
7017
|
+
import React8 from "react";
|
|
7018
|
+
import { jsx as jsx311 } from "react/jsx-runtime";
|
|
7019
|
+
var PasswordInput = React8.forwardRef(
|
|
6936
7020
|
(props, ref) => {
|
|
6937
7021
|
const { reg: _reg, ...inputProps } = props;
|
|
6938
|
-
const [isView, setIsView] =
|
|
7022
|
+
const [isView, setIsView] = React8.useState(false);
|
|
6939
7023
|
const handleChangeView = () => {
|
|
6940
7024
|
setIsView((prev) => !prev);
|
|
6941
7025
|
};
|
|
6942
|
-
return /* @__PURE__ */
|
|
7026
|
+
return /* @__PURE__ */ jsx311(
|
|
6943
7027
|
Input_default,
|
|
6944
7028
|
{
|
|
6945
7029
|
...inputProps,
|
|
6946
|
-
suffix: /* @__PURE__ */
|
|
7030
|
+
suffix: /* @__PURE__ */ jsx311("div", { className: "wrapper pointer", onClick: handleChangeView, children: isView ? /* @__PURE__ */ jsx311(OpenEyeIcon_default, {}) : /* @__PURE__ */ jsx311(CloseEyeIcon_default, {}) }),
|
|
6947
7031
|
type: isView ? "text" : "password",
|
|
6948
7032
|
ref
|
|
6949
7033
|
}
|
|
@@ -6954,17 +7038,17 @@ PasswordInput.displayName = "PasswordInput";
|
|
|
6954
7038
|
var PasswordInput_default = PasswordInput;
|
|
6955
7039
|
|
|
6956
7040
|
// src/components/Modal/Modal.tsx
|
|
6957
|
-
import
|
|
7041
|
+
import React10 from "react";
|
|
6958
7042
|
import { createPortal } from "react-dom";
|
|
6959
7043
|
|
|
6960
7044
|
// src/tokens/hooks/Portal.tsx
|
|
6961
|
-
import
|
|
7045
|
+
import React9 from "react";
|
|
6962
7046
|
import ReactDOM from "react-dom";
|
|
6963
|
-
import { jsx as
|
|
6964
|
-
var PortalContainerContext =
|
|
6965
|
-
var PortalProvider = ({ container, children }) => /* @__PURE__ */
|
|
7047
|
+
import { jsx as jsx312 } from "react/jsx-runtime";
|
|
7048
|
+
var PortalContainerContext = React9.createContext(null);
|
|
7049
|
+
var PortalProvider = ({ container, children }) => /* @__PURE__ */ jsx312(PortalContainerContext.Provider, { value: container, children });
|
|
6966
7050
|
var Portal = ({ children }) => {
|
|
6967
|
-
const contextContainer =
|
|
7051
|
+
const contextContainer = React9.useContext(PortalContainerContext);
|
|
6968
7052
|
if (typeof document === "undefined") return null;
|
|
6969
7053
|
const container = contextContainer ?? document.body;
|
|
6970
7054
|
return ReactDOM.createPortal(children, container);
|
|
@@ -6973,14 +7057,14 @@ Portal.displayName = "Portal";
|
|
|
6973
7057
|
var Portal_default = Portal;
|
|
6974
7058
|
|
|
6975
7059
|
// src/components/Modal/Modal.tsx
|
|
6976
|
-
import { jsx as
|
|
7060
|
+
import { jsx as jsx313 } from "react/jsx-runtime";
|
|
6977
7061
|
var ANIMATION_DURATION_MS = 200;
|
|
6978
7062
|
var Modal = (props) => {
|
|
6979
7063
|
const { isOpen, onClose, children } = props;
|
|
6980
|
-
const [mounted, setMounted] =
|
|
6981
|
-
const [visible, setVisible] =
|
|
6982
|
-
const boxRef =
|
|
6983
|
-
|
|
7064
|
+
const [mounted, setMounted] = React10.useState(false);
|
|
7065
|
+
const [visible, setVisible] = React10.useState(false);
|
|
7066
|
+
const boxRef = React10.useRef(null);
|
|
7067
|
+
React10.useEffect(() => {
|
|
6984
7068
|
if (isOpen) {
|
|
6985
7069
|
setMounted(true);
|
|
6986
7070
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -6994,12 +7078,12 @@ var Modal = (props) => {
|
|
|
6994
7078
|
if (!mounted) return null;
|
|
6995
7079
|
const stateClass = visible ? "enter" : "exit";
|
|
6996
7080
|
return createPortal(
|
|
6997
|
-
/* @__PURE__ */
|
|
7081
|
+
/* @__PURE__ */ jsx313(
|
|
6998
7082
|
"div",
|
|
6999
7083
|
{
|
|
7000
7084
|
className: clsx_default("lib-xplat-modal", "dim", stateClass),
|
|
7001
7085
|
onClick: onClose,
|
|
7002
|
-
children: /* @__PURE__ */
|
|
7086
|
+
children: /* @__PURE__ */ jsx313(
|
|
7003
7087
|
"div",
|
|
7004
7088
|
{
|
|
7005
7089
|
ref: boxRef,
|
|
@@ -7007,7 +7091,7 @@ var Modal = (props) => {
|
|
|
7007
7091
|
role: "dialog",
|
|
7008
7092
|
"aria-modal": "true",
|
|
7009
7093
|
onClick: (e) => e.stopPropagation(),
|
|
7010
|
-
children: /* @__PURE__ */
|
|
7094
|
+
children: /* @__PURE__ */ jsx313(PortalProvider, { container: boxRef.current, children })
|
|
7011
7095
|
}
|
|
7012
7096
|
)
|
|
7013
7097
|
}
|
|
@@ -7019,9 +7103,9 @@ Modal.displayName = "Modal";
|
|
|
7019
7103
|
var Modal_default = Modal;
|
|
7020
7104
|
|
|
7021
7105
|
// src/components/DatePicker/SingleDatePicker/index.tsx
|
|
7022
|
-
import
|
|
7023
|
-
import { Fragment as Fragment3, jsx as
|
|
7024
|
-
var DayCell2 =
|
|
7106
|
+
import React11 from "react";
|
|
7107
|
+
import { Fragment as Fragment3, jsx as jsx314, jsxs as jsxs201 } from "react/jsx-runtime";
|
|
7108
|
+
var DayCell2 = React11.memo(
|
|
7025
7109
|
({
|
|
7026
7110
|
day,
|
|
7027
7111
|
disabled,
|
|
@@ -7031,7 +7115,7 @@ var DayCell2 = React10.memo(
|
|
|
7031
7115
|
isEnd,
|
|
7032
7116
|
inRange,
|
|
7033
7117
|
onSelect
|
|
7034
|
-
}) => /* @__PURE__ */
|
|
7118
|
+
}) => /* @__PURE__ */ jsx314(
|
|
7035
7119
|
"button",
|
|
7036
7120
|
{
|
|
7037
7121
|
type: "button",
|
|
@@ -7073,26 +7157,26 @@ var SingleDatePicker = (props) => {
|
|
|
7073
7157
|
initialYear,
|
|
7074
7158
|
initialMonth
|
|
7075
7159
|
);
|
|
7076
|
-
const [pickerMode, setPickerMode] =
|
|
7077
|
-
const [yearRangeStart, setYearRangeStart] =
|
|
7160
|
+
const [pickerMode, setPickerMode] = React11.useState("days");
|
|
7161
|
+
const [yearRangeStart, setYearRangeStart] = React11.useState(
|
|
7078
7162
|
Math.floor((initialYear ?? (/* @__PURE__ */ new Date()).getFullYear()) / 12) * 12
|
|
7079
7163
|
);
|
|
7080
|
-
const minTime =
|
|
7164
|
+
const minTime = React11.useMemo(
|
|
7081
7165
|
() => minDate ? new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()).getTime() : -Infinity,
|
|
7082
7166
|
[minDate]
|
|
7083
7167
|
);
|
|
7084
|
-
const maxTime =
|
|
7168
|
+
const maxTime = React11.useMemo(
|
|
7085
7169
|
() => maxDate ? new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()).getTime() : Infinity,
|
|
7086
7170
|
[maxDate]
|
|
7087
7171
|
);
|
|
7088
|
-
const highlightSet =
|
|
7172
|
+
const highlightSet = React11.useMemo(() => {
|
|
7089
7173
|
const set = /* @__PURE__ */ new Set();
|
|
7090
7174
|
for (const h of highlightDates) {
|
|
7091
7175
|
set.add(`${h.getFullYear()}-${h.getMonth()}-${h.getDate()}`);
|
|
7092
7176
|
}
|
|
7093
7177
|
return set;
|
|
7094
7178
|
}, [highlightDates]);
|
|
7095
|
-
const handleSelect =
|
|
7179
|
+
const handleSelect = React11.useCallback(
|
|
7096
7180
|
(date) => {
|
|
7097
7181
|
onChange?.(date);
|
|
7098
7182
|
},
|
|
@@ -7129,20 +7213,20 @@ var SingleDatePicker = (props) => {
|
|
|
7129
7213
|
const monthLabels = MONTH_LABELS[locale];
|
|
7130
7214
|
const titleText = pickerMode === "days" ? locale === "ko" ? `${year}\uB144 ${monthLabels[month]}` : `${monthLabels[month]} ${year}` : pickerMode === "months" ? `${year}` : `${yearRangeStart} - ${yearRangeStart + 11}`;
|
|
7131
7215
|
const hasRange = rangeStart != null && rangeEnd != null;
|
|
7132
|
-
return /* @__PURE__ */
|
|
7216
|
+
return /* @__PURE__ */ jsxs201(
|
|
7133
7217
|
"div",
|
|
7134
7218
|
{
|
|
7135
7219
|
className: clsx_default("lib-xplat-datepicker", "single"),
|
|
7136
7220
|
children: [
|
|
7137
|
-
/* @__PURE__ */
|
|
7138
|
-
/* @__PURE__ */
|
|
7139
|
-
/* @__PURE__ */
|
|
7140
|
-
/* @__PURE__ */
|
|
7221
|
+
/* @__PURE__ */ jsxs201("div", { className: "datepicker-header", children: [
|
|
7222
|
+
/* @__PURE__ */ jsx314("button", { className: "datepicker-nav", onClick: handlePrev, type: "button", children: /* @__PURE__ */ jsx314(ChevronLeftIcon_default, {}) }),
|
|
7223
|
+
/* @__PURE__ */ jsx314("button", { className: "datepicker-title", onClick: handleTitleClick, type: "button", children: titleText }),
|
|
7224
|
+
/* @__PURE__ */ jsx314("button", { className: "datepicker-nav", onClick: handleNext, type: "button", children: /* @__PURE__ */ jsx314(ChevronRightIcon_default, {}) })
|
|
7141
7225
|
] }),
|
|
7142
|
-
/* @__PURE__ */
|
|
7143
|
-
pickerMode === "years" && /* @__PURE__ */
|
|
7226
|
+
/* @__PURE__ */ jsxs201("div", { className: "datepicker-body", children: [
|
|
7227
|
+
pickerMode === "years" && /* @__PURE__ */ jsx314("div", { className: "datepicker-picker-grid", children: Array.from({ length: 12 }, (_, i) => {
|
|
7144
7228
|
const y = yearRangeStart + i;
|
|
7145
|
-
return /* @__PURE__ */
|
|
7229
|
+
return /* @__PURE__ */ jsx314(
|
|
7146
7230
|
"button",
|
|
7147
7231
|
{
|
|
7148
7232
|
type: "button",
|
|
@@ -7153,7 +7237,7 @@ var SingleDatePicker = (props) => {
|
|
|
7153
7237
|
y
|
|
7154
7238
|
);
|
|
7155
7239
|
}) }),
|
|
7156
|
-
pickerMode === "months" && /* @__PURE__ */
|
|
7240
|
+
pickerMode === "months" && /* @__PURE__ */ jsx314("div", { className: "datepicker-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ jsx314(
|
|
7157
7241
|
"button",
|
|
7158
7242
|
{
|
|
7159
7243
|
type: "button",
|
|
@@ -7163,8 +7247,8 @@ var SingleDatePicker = (props) => {
|
|
|
7163
7247
|
},
|
|
7164
7248
|
i
|
|
7165
7249
|
)) }),
|
|
7166
|
-
pickerMode === "days" && /* @__PURE__ */
|
|
7167
|
-
/* @__PURE__ */
|
|
7250
|
+
pickerMode === "days" && /* @__PURE__ */ jsxs201(Fragment3, { children: [
|
|
7251
|
+
/* @__PURE__ */ jsx314("div", { className: "datepicker-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ jsx314(
|
|
7168
7252
|
"div",
|
|
7169
7253
|
{
|
|
7170
7254
|
className: clsx_default(
|
|
@@ -7176,7 +7260,7 @@ var SingleDatePicker = (props) => {
|
|
|
7176
7260
|
},
|
|
7177
7261
|
label
|
|
7178
7262
|
)) }),
|
|
7179
|
-
/* @__PURE__ */
|
|
7263
|
+
/* @__PURE__ */ jsx314("div", { className: "datepicker-grid", children: days.map((day, idx) => {
|
|
7180
7264
|
const t = day.date.getTime();
|
|
7181
7265
|
const disabled = t < minTime || t > maxTime;
|
|
7182
7266
|
const selected = value ? isSameDay(day.date, value) : false;
|
|
@@ -7186,7 +7270,7 @@ var SingleDatePicker = (props) => {
|
|
|
7186
7270
|
const isStart = hasRange ? isSameDay(day.date, rangeStart) : false;
|
|
7187
7271
|
const isEnd = hasRange ? isSameDay(day.date, rangeEnd) : false;
|
|
7188
7272
|
const inRangeVal = hasRange ? isInRange(day.date, rangeStart, rangeEnd) : false;
|
|
7189
|
-
return /* @__PURE__ */
|
|
7273
|
+
return /* @__PURE__ */ jsx314(
|
|
7190
7274
|
DayCell2,
|
|
7191
7275
|
{
|
|
7192
7276
|
day,
|
|
@@ -7211,7 +7295,7 @@ SingleDatePicker.displayName = "SingleDatePicker";
|
|
|
7211
7295
|
var SingleDatePicker_default = SingleDatePicker;
|
|
7212
7296
|
|
|
7213
7297
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
7214
|
-
import { jsx as
|
|
7298
|
+
import { jsx as jsx315, jsxs as jsxs202 } from "react/jsx-runtime";
|
|
7215
7299
|
var formatDate = (date) => {
|
|
7216
7300
|
if (!date || !(date instanceof Date) || isNaN(date.getTime())) return "";
|
|
7217
7301
|
const y = date.getFullYear();
|
|
@@ -7221,8 +7305,8 @@ var formatDate = (date) => {
|
|
|
7221
7305
|
};
|
|
7222
7306
|
var InputDatePicker = (props) => {
|
|
7223
7307
|
const { value, onChange, minDate, maxDate, disabled, locale = "ko", placeholder } = props;
|
|
7224
|
-
const [isOpen, setIsOpen] =
|
|
7225
|
-
const [tempDate, setTempDate] =
|
|
7308
|
+
const [isOpen, setIsOpen] = React12.useState(false);
|
|
7309
|
+
const [tempDate, setTempDate] = React12.useState(value ?? /* @__PURE__ */ new Date());
|
|
7226
7310
|
const handleOpen = () => {
|
|
7227
7311
|
if (disabled) return;
|
|
7228
7312
|
setTempDate(value ?? /* @__PURE__ */ new Date());
|
|
@@ -7238,19 +7322,19 @@ var InputDatePicker = (props) => {
|
|
|
7238
7322
|
const handleClose = () => {
|
|
7239
7323
|
setIsOpen(false);
|
|
7240
7324
|
};
|
|
7241
|
-
return /* @__PURE__ */
|
|
7242
|
-
/* @__PURE__ */
|
|
7325
|
+
return /* @__PURE__ */ jsxs202("div", { className: clsx_default("lib-xplat-datepicker input-datepicker", disabled && "disabled"), children: [
|
|
7326
|
+
/* @__PURE__ */ jsx315("div", { className: "input-datepicker-trigger", onClick: handleOpen, children: /* @__PURE__ */ jsx315(
|
|
7243
7327
|
Input_default,
|
|
7244
7328
|
{
|
|
7245
7329
|
value: formatDate(value),
|
|
7246
7330
|
placeholder,
|
|
7247
|
-
suffix: /* @__PURE__ */
|
|
7331
|
+
suffix: /* @__PURE__ */ jsx315(CalenderIcon_default, {}),
|
|
7248
7332
|
disabled,
|
|
7249
7333
|
readOnly: true
|
|
7250
7334
|
}
|
|
7251
7335
|
) }),
|
|
7252
|
-
/* @__PURE__ */
|
|
7253
|
-
/* @__PURE__ */
|
|
7336
|
+
/* @__PURE__ */ jsx315(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ jsxs202("div", { className: "lib-xplat-popup-datepicker-card", children: [
|
|
7337
|
+
/* @__PURE__ */ jsx315("div", { className: "popup-datepicker-content", children: /* @__PURE__ */ jsx315(
|
|
7254
7338
|
SingleDatePicker_default,
|
|
7255
7339
|
{
|
|
7256
7340
|
value: tempDate,
|
|
@@ -7260,9 +7344,9 @@ var InputDatePicker = (props) => {
|
|
|
7260
7344
|
locale
|
|
7261
7345
|
}
|
|
7262
7346
|
) }),
|
|
7263
|
-
/* @__PURE__ */
|
|
7264
|
-
/* @__PURE__ */
|
|
7265
|
-
/* @__PURE__ */
|
|
7347
|
+
/* @__PURE__ */ jsxs202("div", { className: "popup-datepicker-footer", children: [
|
|
7348
|
+
/* @__PURE__ */ jsx315(Button_default, { type: "secondary", onClick: handleClose, children: locale === "ko" ? "\uCDE8\uC18C" : "Cancel" }),
|
|
7349
|
+
/* @__PURE__ */ jsx315(Button_default, { type: "primary", onClick: handleApply, children: locale === "ko" ? "\uC801\uC6A9" : "Apply" })
|
|
7266
7350
|
] })
|
|
7267
7351
|
] }) })
|
|
7268
7352
|
] });
|
|
@@ -7271,20 +7355,20 @@ InputDatePicker.displayName = "InputDatePicker";
|
|
|
7271
7355
|
var InputDatePicker_default = InputDatePicker;
|
|
7272
7356
|
|
|
7273
7357
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
7274
|
-
import
|
|
7358
|
+
import React16 from "react";
|
|
7275
7359
|
|
|
7276
7360
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
7277
|
-
import
|
|
7361
|
+
import React15 from "react";
|
|
7278
7362
|
|
|
7279
7363
|
// src/components/Tab/Tab.tsx
|
|
7280
|
-
import
|
|
7364
|
+
import React14 from "react";
|
|
7281
7365
|
|
|
7282
7366
|
// src/components/Tab/TabItem.tsx
|
|
7283
|
-
import
|
|
7284
|
-
import { jsx as
|
|
7285
|
-
var TabItem =
|
|
7367
|
+
import React13 from "react";
|
|
7368
|
+
import { jsx as jsx316 } from "react/jsx-runtime";
|
|
7369
|
+
var TabItem = React13.forwardRef((props, ref) => {
|
|
7286
7370
|
const { isActive, title, onClick } = props;
|
|
7287
|
-
return /* @__PURE__ */
|
|
7371
|
+
return /* @__PURE__ */ jsx316(
|
|
7288
7372
|
"div",
|
|
7289
7373
|
{
|
|
7290
7374
|
ref,
|
|
@@ -7298,25 +7382,25 @@ TabItem.displayName = "TabItem";
|
|
|
7298
7382
|
var TabItem_default = TabItem;
|
|
7299
7383
|
|
|
7300
7384
|
// src/components/Tab/Tab.tsx
|
|
7301
|
-
import { jsx as
|
|
7385
|
+
import { jsx as jsx317, jsxs as jsxs203 } from "react/jsx-runtime";
|
|
7302
7386
|
var Tab = (props) => {
|
|
7303
7387
|
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
7304
|
-
const [underlineStyle, setUnderlineStyle] =
|
|
7388
|
+
const [underlineStyle, setUnderlineStyle] = React14.useState({
|
|
7305
7389
|
left: 0,
|
|
7306
7390
|
width: 0
|
|
7307
7391
|
});
|
|
7308
|
-
const itemRefs =
|
|
7392
|
+
const itemRefs = React14.useRef([]);
|
|
7309
7393
|
const handleChangeActiveTab = (tabItem, tabIdx) => {
|
|
7310
7394
|
onChange(tabItem, tabIdx);
|
|
7311
7395
|
};
|
|
7312
|
-
|
|
7396
|
+
React14.useEffect(() => {
|
|
7313
7397
|
const el = itemRefs.current[activeIndex];
|
|
7314
7398
|
if (el) {
|
|
7315
7399
|
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
7316
7400
|
}
|
|
7317
7401
|
}, [activeIndex, tabs.length]);
|
|
7318
|
-
return /* @__PURE__ */
|
|
7319
|
-
tabs.map((tab, idx) => /* @__PURE__ */
|
|
7402
|
+
return /* @__PURE__ */ jsxs203("div", { className: clsx_default("lib-xplat-tab", `type-${type}`, size), children: [
|
|
7403
|
+
tabs.map((tab, idx) => /* @__PURE__ */ jsx317(
|
|
7320
7404
|
TabItem_default,
|
|
7321
7405
|
{
|
|
7322
7406
|
onClick: () => handleChangeActiveTab(tab, idx),
|
|
@@ -7328,7 +7412,7 @@ var Tab = (props) => {
|
|
|
7328
7412
|
},
|
|
7329
7413
|
`${tab.value}_${idx}`
|
|
7330
7414
|
)),
|
|
7331
|
-
type === "toggle" && /* @__PURE__ */
|
|
7415
|
+
type === "toggle" && /* @__PURE__ */ jsx317(
|
|
7332
7416
|
"div",
|
|
7333
7417
|
{
|
|
7334
7418
|
className: "tab-toggle-underline",
|
|
@@ -7344,7 +7428,7 @@ Tab.displayName = "Tab";
|
|
|
7344
7428
|
var Tab_default = Tab;
|
|
7345
7429
|
|
|
7346
7430
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
7347
|
-
import { jsx as
|
|
7431
|
+
import { jsx as jsx318, jsxs as jsxs204 } from "react/jsx-runtime";
|
|
7348
7432
|
var RangePicker = (props) => {
|
|
7349
7433
|
const {
|
|
7350
7434
|
startDate,
|
|
@@ -7354,7 +7438,7 @@ var RangePicker = (props) => {
|
|
|
7354
7438
|
maxDate,
|
|
7355
7439
|
locale = "ko"
|
|
7356
7440
|
} = props;
|
|
7357
|
-
const [activeTab, setActiveTab] =
|
|
7441
|
+
const [activeTab, setActiveTab] = React15.useState("start");
|
|
7358
7442
|
const handleStartChange = (date) => {
|
|
7359
7443
|
if (!date) return;
|
|
7360
7444
|
const newStart = date > endDate ? endDate : date;
|
|
@@ -7367,8 +7451,8 @@ var RangePicker = (props) => {
|
|
|
7367
7451
|
};
|
|
7368
7452
|
const startMaxDate = maxDate && endDate < maxDate ? endDate : endDate;
|
|
7369
7453
|
const endMinDate = minDate && startDate > minDate ? startDate : startDate;
|
|
7370
|
-
return /* @__PURE__ */
|
|
7371
|
-
/* @__PURE__ */
|
|
7454
|
+
return /* @__PURE__ */ jsxs204("div", { className: clsx_default("lib-xplat-datepicker", "range"), children: [
|
|
7455
|
+
/* @__PURE__ */ jsx318("div", { className: "datepicker-range-tabs", children: /* @__PURE__ */ jsx318(
|
|
7372
7456
|
Tab_default,
|
|
7373
7457
|
{
|
|
7374
7458
|
activeIndex: activeTab === "start" ? 0 : 1,
|
|
@@ -7381,8 +7465,8 @@ var RangePicker = (props) => {
|
|
|
7381
7465
|
size: "sm"
|
|
7382
7466
|
}
|
|
7383
7467
|
) }),
|
|
7384
|
-
/* @__PURE__ */
|
|
7385
|
-
/* @__PURE__ */
|
|
7468
|
+
/* @__PURE__ */ jsxs204("div", { className: "datepicker-range-panels", children: [
|
|
7469
|
+
/* @__PURE__ */ jsx318(
|
|
7386
7470
|
SingleDatePicker_default,
|
|
7387
7471
|
{
|
|
7388
7472
|
value: startDate,
|
|
@@ -7394,7 +7478,7 @@ var RangePicker = (props) => {
|
|
|
7394
7478
|
locale
|
|
7395
7479
|
}
|
|
7396
7480
|
),
|
|
7397
|
-
/* @__PURE__ */
|
|
7481
|
+
/* @__PURE__ */ jsx318(
|
|
7398
7482
|
SingleDatePicker_default,
|
|
7399
7483
|
{
|
|
7400
7484
|
value: endDate,
|
|
@@ -7407,7 +7491,7 @@ var RangePicker = (props) => {
|
|
|
7407
7491
|
}
|
|
7408
7492
|
)
|
|
7409
7493
|
] }),
|
|
7410
|
-
/* @__PURE__ */
|
|
7494
|
+
/* @__PURE__ */ jsx318("div", { className: "datepicker-range-mobile", children: activeTab === "start" ? /* @__PURE__ */ jsx318(
|
|
7411
7495
|
SingleDatePicker_default,
|
|
7412
7496
|
{
|
|
7413
7497
|
value: startDate,
|
|
@@ -7418,7 +7502,7 @@ var RangePicker = (props) => {
|
|
|
7418
7502
|
rangeEnd: endDate,
|
|
7419
7503
|
locale
|
|
7420
7504
|
}
|
|
7421
|
-
) : /* @__PURE__ */
|
|
7505
|
+
) : /* @__PURE__ */ jsx318(
|
|
7422
7506
|
SingleDatePicker_default,
|
|
7423
7507
|
{
|
|
7424
7508
|
value: endDate,
|
|
@@ -7436,10 +7520,10 @@ RangePicker.displayName = "RangePicker";
|
|
|
7436
7520
|
var RangePicker_default = RangePicker;
|
|
7437
7521
|
|
|
7438
7522
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
7439
|
-
import { jsx as
|
|
7523
|
+
import { jsx as jsx319, jsxs as jsxs205 } from "react/jsx-runtime";
|
|
7440
7524
|
var PopupPicker = (props) => {
|
|
7441
7525
|
const { component, type, locale } = props;
|
|
7442
|
-
const [isOpen, setIsOpen] =
|
|
7526
|
+
const [isOpen, setIsOpen] = React16.useState(false);
|
|
7443
7527
|
const handleClick = () => setIsOpen(true);
|
|
7444
7528
|
const handleClose = () => setIsOpen(false);
|
|
7445
7529
|
const handleSingleChange = (date) => {
|
|
@@ -7447,11 +7531,11 @@ var PopupPicker = (props) => {
|
|
|
7447
7531
|
props.onChange?.(date);
|
|
7448
7532
|
handleClose();
|
|
7449
7533
|
};
|
|
7450
|
-
return /* @__PURE__ */
|
|
7451
|
-
|
|
7452
|
-
/* @__PURE__ */
|
|
7453
|
-
/* @__PURE__ */
|
|
7454
|
-
type === "single" && /* @__PURE__ */
|
|
7534
|
+
return /* @__PURE__ */ jsxs205("div", { className: "lib-xplat-popup-datepicker", children: [
|
|
7535
|
+
React16.cloneElement(component, { onClick: handleClick }),
|
|
7536
|
+
/* @__PURE__ */ jsx319(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ jsxs205("div", { className: clsx_default("lib-xplat-popup-datepicker-card", type === "range" && "range-mode"), children: [
|
|
7537
|
+
/* @__PURE__ */ jsxs205("div", { className: "popup-datepicker-content", children: [
|
|
7538
|
+
type === "single" && /* @__PURE__ */ jsx319(
|
|
7455
7539
|
SingleDatePicker_default,
|
|
7456
7540
|
{
|
|
7457
7541
|
value: props.value,
|
|
@@ -7461,7 +7545,7 @@ var PopupPicker = (props) => {
|
|
|
7461
7545
|
locale
|
|
7462
7546
|
}
|
|
7463
7547
|
),
|
|
7464
|
-
type === "range" && /* @__PURE__ */
|
|
7548
|
+
type === "range" && /* @__PURE__ */ jsx319(
|
|
7465
7549
|
RangePicker_default,
|
|
7466
7550
|
{
|
|
7467
7551
|
startDate: props.startDate,
|
|
@@ -7473,8 +7557,8 @@ var PopupPicker = (props) => {
|
|
|
7473
7557
|
}
|
|
7474
7558
|
)
|
|
7475
7559
|
] }),
|
|
7476
|
-
/* @__PURE__ */
|
|
7477
|
-
/* @__PURE__ */
|
|
7560
|
+
/* @__PURE__ */ jsxs205("div", { className: "popup-datepicker-footer", children: [
|
|
7561
|
+
/* @__PURE__ */ jsx319(
|
|
7478
7562
|
Button_default,
|
|
7479
7563
|
{
|
|
7480
7564
|
type: "secondary",
|
|
@@ -7482,7 +7566,7 @@ var PopupPicker = (props) => {
|
|
|
7482
7566
|
children: locale === "ko" ? "\uCDE8\uC18C" : "Cancel"
|
|
7483
7567
|
}
|
|
7484
7568
|
),
|
|
7485
|
-
/* @__PURE__ */
|
|
7569
|
+
/* @__PURE__ */ jsx319(Button_default, { type: "primary", onClick: handleClose, children: locale === "ko" ? "\uC801\uC6A9" : "Apply" })
|
|
7486
7570
|
] })
|
|
7487
7571
|
] }) })
|
|
7488
7572
|
] });
|
|
@@ -7491,10 +7575,10 @@ PopupPicker.displayName = "PopupPicker";
|
|
|
7491
7575
|
var PopupPicker_default = PopupPicker;
|
|
7492
7576
|
|
|
7493
7577
|
// src/components/Divider/Divider.tsx
|
|
7494
|
-
import { jsx as
|
|
7578
|
+
import { jsx as jsx320 } from "react/jsx-runtime";
|
|
7495
7579
|
var Divider = (props) => {
|
|
7496
7580
|
const { orientation = "horizontal" } = props;
|
|
7497
|
-
return /* @__PURE__ */
|
|
7581
|
+
return /* @__PURE__ */ jsx320(
|
|
7498
7582
|
"div",
|
|
7499
7583
|
{
|
|
7500
7584
|
className: clsx_default("lib-xplat-divider", orientation),
|
|
@@ -7507,15 +7591,15 @@ Divider.displayName = "Divider";
|
|
|
7507
7591
|
var Divider_default = Divider;
|
|
7508
7592
|
|
|
7509
7593
|
// src/components/Drawer/Drawer.tsx
|
|
7510
|
-
import
|
|
7594
|
+
import React17 from "react";
|
|
7511
7595
|
import { createPortal as createPortal2 } from "react-dom";
|
|
7512
|
-
import { jsx as
|
|
7596
|
+
import { jsx as jsx321, jsxs as jsxs206 } from "react/jsx-runtime";
|
|
7513
7597
|
var ANIMATION_DURATION_MS2 = 250;
|
|
7514
7598
|
var Drawer = (props) => {
|
|
7515
7599
|
const { isOpen, onClose, placement = "right", size = "md", title, children } = props;
|
|
7516
|
-
const [mounted, setMounted] =
|
|
7517
|
-
const [visible, setVisible] =
|
|
7518
|
-
|
|
7600
|
+
const [mounted, setMounted] = React17.useState(false);
|
|
7601
|
+
const [visible, setVisible] = React17.useState(false);
|
|
7602
|
+
React17.useEffect(() => {
|
|
7519
7603
|
if (isOpen) {
|
|
7520
7604
|
setMounted(true);
|
|
7521
7605
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -7529,12 +7613,12 @@ var Drawer = (props) => {
|
|
|
7529
7613
|
if (!mounted) return null;
|
|
7530
7614
|
const stateClass = visible ? "enter" : "exit";
|
|
7531
7615
|
return createPortal2(
|
|
7532
|
-
/* @__PURE__ */
|
|
7616
|
+
/* @__PURE__ */ jsx321(
|
|
7533
7617
|
"div",
|
|
7534
7618
|
{
|
|
7535
7619
|
className: clsx_default("lib-xplat-drawer-overlay", stateClass),
|
|
7536
7620
|
onClick: onClose,
|
|
7537
|
-
children: /* @__PURE__ */
|
|
7621
|
+
children: /* @__PURE__ */ jsxs206(
|
|
7538
7622
|
"div",
|
|
7539
7623
|
{
|
|
7540
7624
|
className: clsx_default("lib-xplat-drawer", placement, size, stateClass),
|
|
@@ -7542,11 +7626,11 @@ var Drawer = (props) => {
|
|
|
7542
7626
|
"aria-modal": "true",
|
|
7543
7627
|
onClick: (e) => e.stopPropagation(),
|
|
7544
7628
|
children: [
|
|
7545
|
-
title && /* @__PURE__ */
|
|
7546
|
-
/* @__PURE__ */
|
|
7547
|
-
/* @__PURE__ */
|
|
7629
|
+
title && /* @__PURE__ */ jsxs206("div", { className: "drawer-header", children: [
|
|
7630
|
+
/* @__PURE__ */ jsx321("span", { className: "drawer-title", children: title }),
|
|
7631
|
+
/* @__PURE__ */ jsx321("button", { className: "close-btn", onClick: onClose, "aria-label": "\uB2EB\uAE30", children: "\xD7" })
|
|
7548
7632
|
] }),
|
|
7549
|
-
/* @__PURE__ */
|
|
7633
|
+
/* @__PURE__ */ jsx321("div", { className: "drawer-body", children })
|
|
7550
7634
|
]
|
|
7551
7635
|
}
|
|
7552
7636
|
)
|
|
@@ -7559,16 +7643,16 @@ Drawer.displayName = "Drawer";
|
|
|
7559
7643
|
var Drawer_default = Drawer;
|
|
7560
7644
|
|
|
7561
7645
|
// src/components/Dropdown/Dropdown.tsx
|
|
7562
|
-
import
|
|
7646
|
+
import React20 from "react";
|
|
7563
7647
|
|
|
7564
7648
|
// src/tokens/hooks/useAutoPosition.ts
|
|
7565
|
-
import
|
|
7649
|
+
import React18 from "react";
|
|
7566
7650
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
7567
|
-
const [position, setPosition] =
|
|
7651
|
+
const [position, setPosition] = React18.useState({
|
|
7568
7652
|
position: {},
|
|
7569
7653
|
direction: "bottom"
|
|
7570
7654
|
});
|
|
7571
|
-
const calculatePosition =
|
|
7655
|
+
const calculatePosition = React18.useCallback(() => {
|
|
7572
7656
|
if (!triggerRef.current || !popRef.current) return;
|
|
7573
7657
|
const triggerRect = triggerRef.current.getBoundingClientRect();
|
|
7574
7658
|
const popW = popRef.current.offsetWidth;
|
|
@@ -7595,13 +7679,13 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
7595
7679
|
direction
|
|
7596
7680
|
});
|
|
7597
7681
|
}, [triggerRef, popRef]);
|
|
7598
|
-
|
|
7682
|
+
React18.useLayoutEffect(() => {
|
|
7599
7683
|
if (!enabled) return;
|
|
7600
7684
|
calculatePosition();
|
|
7601
7685
|
const raf = requestAnimationFrame(calculatePosition);
|
|
7602
7686
|
return () => cancelAnimationFrame(raf);
|
|
7603
7687
|
}, [calculatePosition, enabled]);
|
|
7604
|
-
|
|
7688
|
+
React18.useEffect(() => {
|
|
7605
7689
|
if (!enabled || !popRef.current) return;
|
|
7606
7690
|
const observer = new ResizeObserver(() => {
|
|
7607
7691
|
calculatePosition();
|
|
@@ -7609,7 +7693,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
7609
7693
|
observer.observe(popRef.current);
|
|
7610
7694
|
return () => observer.disconnect();
|
|
7611
7695
|
}, [calculatePosition, enabled, popRef]);
|
|
7612
|
-
|
|
7696
|
+
React18.useEffect(() => {
|
|
7613
7697
|
if (!enabled) return;
|
|
7614
7698
|
window.addEventListener("resize", calculatePosition);
|
|
7615
7699
|
window.addEventListener("scroll", calculatePosition, true);
|
|
@@ -7623,9 +7707,9 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
7623
7707
|
var useAutoPosition_default = useAutoPosition;
|
|
7624
7708
|
|
|
7625
7709
|
// src/tokens/hooks/useClickOutside.ts
|
|
7626
|
-
import
|
|
7710
|
+
import React19 from "react";
|
|
7627
7711
|
var useClickOutside = (refs, handler, enabled = true) => {
|
|
7628
|
-
|
|
7712
|
+
React19.useEffect(() => {
|
|
7629
7713
|
if (!enabled) return;
|
|
7630
7714
|
const refArray = Array.isArray(refs) ? refs : [refs];
|
|
7631
7715
|
const listener = (event) => {
|
|
@@ -7648,17 +7732,17 @@ var useClickOutside = (refs, handler, enabled = true) => {
|
|
|
7648
7732
|
var useClickOutside_default = useClickOutside;
|
|
7649
7733
|
|
|
7650
7734
|
// src/components/Dropdown/Dropdown.tsx
|
|
7651
|
-
import { jsx as
|
|
7735
|
+
import { jsx as jsx322, jsxs as jsxs207 } from "react/jsx-runtime";
|
|
7652
7736
|
var Dropdown = (props) => {
|
|
7653
7737
|
const { items, children } = props;
|
|
7654
|
-
const [isOpen, setIsOpen] =
|
|
7655
|
-
const [mounted, setMounted] =
|
|
7656
|
-
const [visible, setVisible] =
|
|
7657
|
-
const triggerRef =
|
|
7658
|
-
const menuRef =
|
|
7738
|
+
const [isOpen, setIsOpen] = React20.useState(false);
|
|
7739
|
+
const [mounted, setMounted] = React20.useState(false);
|
|
7740
|
+
const [visible, setVisible] = React20.useState(false);
|
|
7741
|
+
const triggerRef = React20.useRef(null);
|
|
7742
|
+
const menuRef = React20.useRef(null);
|
|
7659
7743
|
const { position, direction } = useAutoPosition_default(triggerRef, menuRef, mounted);
|
|
7660
7744
|
useClickOutside_default([triggerRef, menuRef], () => setIsOpen(false), isOpen);
|
|
7661
|
-
|
|
7745
|
+
React20.useEffect(() => {
|
|
7662
7746
|
if (isOpen) {
|
|
7663
7747
|
setMounted(true);
|
|
7664
7748
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -7673,8 +7757,8 @@ var Dropdown = (props) => {
|
|
|
7673
7757
|
item.onClick?.();
|
|
7674
7758
|
setIsOpen(false);
|
|
7675
7759
|
};
|
|
7676
|
-
return /* @__PURE__ */
|
|
7677
|
-
/* @__PURE__ */
|
|
7760
|
+
return /* @__PURE__ */ jsxs207("div", { className: "lib-xplat-dropdown", children: [
|
|
7761
|
+
/* @__PURE__ */ jsx322(
|
|
7678
7762
|
"div",
|
|
7679
7763
|
{
|
|
7680
7764
|
ref: triggerRef,
|
|
@@ -7683,14 +7767,14 @@ var Dropdown = (props) => {
|
|
|
7683
7767
|
children
|
|
7684
7768
|
}
|
|
7685
7769
|
),
|
|
7686
|
-
mounted && /* @__PURE__ */
|
|
7770
|
+
mounted && /* @__PURE__ */ jsx322(Portal_default, { children: /* @__PURE__ */ jsx322(
|
|
7687
7771
|
"div",
|
|
7688
7772
|
{
|
|
7689
7773
|
ref: menuRef,
|
|
7690
7774
|
className: clsx_default("lib-xplat-dropdown-menu", direction, { visible }),
|
|
7691
7775
|
style: { top: position.top, left: position.left },
|
|
7692
7776
|
role: "menu",
|
|
7693
|
-
children: items.map((item) => /* @__PURE__ */
|
|
7777
|
+
children: items.map((item) => /* @__PURE__ */ jsx322(
|
|
7694
7778
|
"button",
|
|
7695
7779
|
{
|
|
7696
7780
|
className: clsx_default("dropdown-item", {
|
|
@@ -7712,23 +7796,23 @@ Dropdown.displayName = "Dropdown";
|
|
|
7712
7796
|
var Dropdown_default = Dropdown;
|
|
7713
7797
|
|
|
7714
7798
|
// src/components/EmptyState/EmptyState.tsx
|
|
7715
|
-
import { jsx as
|
|
7799
|
+
import { jsx as jsx323, jsxs as jsxs208 } from "react/jsx-runtime";
|
|
7716
7800
|
var EmptyState = (props) => {
|
|
7717
7801
|
const { icon, title = "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4", description, action } = props;
|
|
7718
|
-
return /* @__PURE__ */
|
|
7719
|
-
icon && /* @__PURE__ */
|
|
7720
|
-
!icon && /* @__PURE__ */
|
|
7721
|
-
/* @__PURE__ */
|
|
7722
|
-
description && /* @__PURE__ */
|
|
7723
|
-
action && /* @__PURE__ */
|
|
7802
|
+
return /* @__PURE__ */ jsxs208("div", { className: "lib-xplat-empty-state", children: [
|
|
7803
|
+
icon && /* @__PURE__ */ jsx323("div", { className: "empty-icon", children: icon }),
|
|
7804
|
+
!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" }) }) }),
|
|
7805
|
+
/* @__PURE__ */ jsx323("p", { className: "empty-title", children: title }),
|
|
7806
|
+
description && /* @__PURE__ */ jsx323("p", { className: "empty-description", children: description }),
|
|
7807
|
+
action && /* @__PURE__ */ jsx323("div", { className: "empty-action", children: action })
|
|
7724
7808
|
] });
|
|
7725
7809
|
};
|
|
7726
7810
|
EmptyState.displayName = "EmptyState";
|
|
7727
7811
|
var EmptyState_default = EmptyState;
|
|
7728
7812
|
|
|
7729
7813
|
// src/components/FileUpload/FileUpload.tsx
|
|
7730
|
-
import
|
|
7731
|
-
import { jsx as
|
|
7814
|
+
import React21 from "react";
|
|
7815
|
+
import { jsx as jsx324, jsxs as jsxs209 } from "react/jsx-runtime";
|
|
7732
7816
|
var FileUpload = (props) => {
|
|
7733
7817
|
const {
|
|
7734
7818
|
accept,
|
|
@@ -7738,8 +7822,8 @@ var FileUpload = (props) => {
|
|
|
7738
7822
|
label = "\uD30C\uC77C\uC744 \uB4DC\uB798\uADF8\uD558\uAC70\uB098 \uD074\uB9AD\uD558\uC5EC \uC5C5\uB85C\uB4DC",
|
|
7739
7823
|
description
|
|
7740
7824
|
} = props;
|
|
7741
|
-
const [isDragOver, setIsDragOver] =
|
|
7742
|
-
const inputRef =
|
|
7825
|
+
const [isDragOver, setIsDragOver] = React21.useState(false);
|
|
7826
|
+
const inputRef = React21.useRef(null);
|
|
7743
7827
|
const handleFiles = (fileList) => {
|
|
7744
7828
|
let files = Array.from(fileList);
|
|
7745
7829
|
if (maxSize) {
|
|
@@ -7769,7 +7853,7 @@ var FileUpload = (props) => {
|
|
|
7769
7853
|
handleFiles(e.target.files);
|
|
7770
7854
|
}
|
|
7771
7855
|
};
|
|
7772
|
-
return /* @__PURE__ */
|
|
7856
|
+
return /* @__PURE__ */ jsxs209(
|
|
7773
7857
|
"div",
|
|
7774
7858
|
{
|
|
7775
7859
|
className: clsx_default("lib-xplat-file-upload", { "drag-over": isDragOver }),
|
|
@@ -7778,7 +7862,7 @@ var FileUpload = (props) => {
|
|
|
7778
7862
|
onDragLeave: handleDragLeave,
|
|
7779
7863
|
onClick: () => inputRef.current?.click(),
|
|
7780
7864
|
children: [
|
|
7781
|
-
/* @__PURE__ */
|
|
7865
|
+
/* @__PURE__ */ jsx324(
|
|
7782
7866
|
"input",
|
|
7783
7867
|
{
|
|
7784
7868
|
ref: inputRef,
|
|
@@ -7788,9 +7872,9 @@ var FileUpload = (props) => {
|
|
|
7788
7872
|
onChange: handleChange
|
|
7789
7873
|
}
|
|
7790
7874
|
),
|
|
7791
|
-
/* @__PURE__ */
|
|
7792
|
-
/* @__PURE__ */
|
|
7793
|
-
description && /* @__PURE__ */
|
|
7875
|
+
/* @__PURE__ */ jsx324("div", { className: "upload-icon", children: /* @__PURE__ */ jsx324(UploadIcon_default, {}) }),
|
|
7876
|
+
/* @__PURE__ */ jsx324("p", { className: "upload-label", children: label }),
|
|
7877
|
+
description && /* @__PURE__ */ jsx324("p", { className: "upload-description", children: description })
|
|
7794
7878
|
]
|
|
7795
7879
|
}
|
|
7796
7880
|
);
|
|
@@ -7799,10 +7883,10 @@ FileUpload.displayName = "FileUpload";
|
|
|
7799
7883
|
var FileUpload_default = FileUpload;
|
|
7800
7884
|
|
|
7801
7885
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
7802
|
-
import
|
|
7886
|
+
import React23 from "react";
|
|
7803
7887
|
|
|
7804
7888
|
// src/components/HtmlTypeWriter/utils.ts
|
|
7805
|
-
import
|
|
7889
|
+
import React22 from "react";
|
|
7806
7890
|
var voidTags = /* @__PURE__ */ new Set([
|
|
7807
7891
|
"br",
|
|
7808
7892
|
"img",
|
|
@@ -7870,41 +7954,41 @@ var convertNodeToReactWithRange = (node, typedLen, rangeMap) => {
|
|
|
7870
7954
|
props[attr.name] = attr.value;
|
|
7871
7955
|
});
|
|
7872
7956
|
if (voidTags.has(tag)) {
|
|
7873
|
-
return
|
|
7957
|
+
return React22.createElement(tag, props);
|
|
7874
7958
|
}
|
|
7875
7959
|
const children = Array.from(element.childNodes).map((child) => convertNodeToReactWithRange(child, typedLen, rangeMap)).filter((n) => n != null);
|
|
7876
|
-
return
|
|
7960
|
+
return React22.createElement(tag, props, ...children);
|
|
7877
7961
|
};
|
|
7878
7962
|
var htmlToReactProgressive = (root, typedLen, rangeMap) => {
|
|
7879
7963
|
const nodes = Array.from(root.childNodes).map((child, idx) => {
|
|
7880
7964
|
const node = convertNodeToReactWithRange(child, typedLen, rangeMap);
|
|
7881
|
-
return node == null ? null :
|
|
7965
|
+
return node == null ? null : React22.createElement(React22.Fragment, { key: idx }, node);
|
|
7882
7966
|
}).filter(Boolean);
|
|
7883
7967
|
return nodes.length === 0 ? null : nodes;
|
|
7884
7968
|
};
|
|
7885
7969
|
|
|
7886
7970
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
7887
|
-
import { jsx as
|
|
7971
|
+
import { jsx as jsx325 } from "react/jsx-runtime";
|
|
7888
7972
|
var HtmlTypeWriter = ({
|
|
7889
7973
|
html,
|
|
7890
7974
|
duration = 20,
|
|
7891
7975
|
onDone,
|
|
7892
7976
|
onChange
|
|
7893
7977
|
}) => {
|
|
7894
|
-
const [typedLen, setTypedLen] =
|
|
7895
|
-
const doneCalledRef =
|
|
7896
|
-
const { doc, rangeMap, totalLength } =
|
|
7978
|
+
const [typedLen, setTypedLen] = React23.useState(0);
|
|
7979
|
+
const doneCalledRef = React23.useRef(false);
|
|
7980
|
+
const { doc, rangeMap, totalLength } = React23.useMemo(() => {
|
|
7897
7981
|
if (typeof window === "undefined") return { doc: null, rangeMap: /* @__PURE__ */ new Map(), totalLength: 0 };
|
|
7898
7982
|
const decoded = decodeHtmlEntities(html);
|
|
7899
7983
|
const doc2 = new DOMParser().parseFromString(decoded, "text/html");
|
|
7900
7984
|
const { rangeMap: rangeMap2, totalLength: totalLength2 } = buildRangeMap(doc2.body);
|
|
7901
7985
|
return { doc: doc2, rangeMap: rangeMap2, totalLength: totalLength2 };
|
|
7902
7986
|
}, [html]);
|
|
7903
|
-
|
|
7987
|
+
React23.useEffect(() => {
|
|
7904
7988
|
setTypedLen(0);
|
|
7905
7989
|
doneCalledRef.current = false;
|
|
7906
7990
|
}, [html]);
|
|
7907
|
-
|
|
7991
|
+
React23.useEffect(() => {
|
|
7908
7992
|
if (!totalLength) return;
|
|
7909
7993
|
if (typedLen >= totalLength) return;
|
|
7910
7994
|
const timer = window.setInterval(() => {
|
|
@@ -7912,33 +7996,33 @@ var HtmlTypeWriter = ({
|
|
|
7912
7996
|
}, duration);
|
|
7913
7997
|
return () => window.clearInterval(timer);
|
|
7914
7998
|
}, [typedLen, totalLength, duration]);
|
|
7915
|
-
|
|
7999
|
+
React23.useEffect(() => {
|
|
7916
8000
|
if (typedLen > 0 && typedLen < totalLength) {
|
|
7917
8001
|
onChange?.();
|
|
7918
8002
|
}
|
|
7919
8003
|
}, [typedLen, totalLength, onChange]);
|
|
7920
|
-
|
|
8004
|
+
React23.useEffect(() => {
|
|
7921
8005
|
if (typedLen === totalLength && totalLength > 0 && !doneCalledRef.current) {
|
|
7922
8006
|
doneCalledRef.current = true;
|
|
7923
8007
|
onDone?.();
|
|
7924
8008
|
}
|
|
7925
8009
|
}, [typedLen, totalLength, onDone]);
|
|
7926
|
-
const parsed =
|
|
8010
|
+
const parsed = React23.useMemo(
|
|
7927
8011
|
() => doc ? htmlToReactProgressive(doc.body, typedLen, rangeMap) : null,
|
|
7928
8012
|
[doc, typedLen, rangeMap]
|
|
7929
8013
|
);
|
|
7930
|
-
return /* @__PURE__ */
|
|
8014
|
+
return /* @__PURE__ */ jsx325("div", { className: "lib-xplat-htmlTypewriter", children: parsed });
|
|
7931
8015
|
};
|
|
7932
8016
|
HtmlTypeWriter.displayName = "HtmlTypeWriter";
|
|
7933
8017
|
var HtmlTypeWriter_default = HtmlTypeWriter;
|
|
7934
8018
|
|
|
7935
8019
|
// src/components/ImageSelector/ImageSelector.tsx
|
|
7936
|
-
import
|
|
7937
|
-
import { jsx as
|
|
8020
|
+
import React24 from "react";
|
|
8021
|
+
import { jsx as jsx326, jsxs as jsxs210 } from "react/jsx-runtime";
|
|
7938
8022
|
var ImageSelector = (props) => {
|
|
7939
8023
|
const { value, label, onChange } = props;
|
|
7940
|
-
const [previewUrl, setPreviewUrl] =
|
|
7941
|
-
|
|
8024
|
+
const [previewUrl, setPreviewUrl] = React24.useState();
|
|
8025
|
+
React24.useEffect(() => {
|
|
7942
8026
|
if (!value) {
|
|
7943
8027
|
setPreviewUrl(void 0);
|
|
7944
8028
|
return;
|
|
@@ -7947,7 +8031,7 @@ var ImageSelector = (props) => {
|
|
|
7947
8031
|
setPreviewUrl(url);
|
|
7948
8032
|
return () => URL.revokeObjectURL(url);
|
|
7949
8033
|
}, [value]);
|
|
7950
|
-
const inputRef =
|
|
8034
|
+
const inputRef = React24.useRef(null);
|
|
7951
8035
|
const handleFileChange = (e) => {
|
|
7952
8036
|
const selectedFile = e.target.files?.[0];
|
|
7953
8037
|
if (selectedFile) {
|
|
@@ -7960,8 +8044,8 @@ var ImageSelector = (props) => {
|
|
|
7960
8044
|
const handleOpenFileDialog = () => {
|
|
7961
8045
|
inputRef.current?.click();
|
|
7962
8046
|
};
|
|
7963
|
-
return /* @__PURE__ */
|
|
7964
|
-
/* @__PURE__ */
|
|
8047
|
+
return /* @__PURE__ */ jsxs210("div", { className: `lib-xplat-imageselector${value ? "" : " none-value"}`, children: [
|
|
8048
|
+
/* @__PURE__ */ jsx326(
|
|
7965
8049
|
"input",
|
|
7966
8050
|
{
|
|
7967
8051
|
type: "file",
|
|
@@ -7971,13 +8055,13 @@ var ImageSelector = (props) => {
|
|
|
7971
8055
|
ref: inputRef
|
|
7972
8056
|
}
|
|
7973
8057
|
),
|
|
7974
|
-
value && /* @__PURE__ */
|
|
7975
|
-
/* @__PURE__ */
|
|
7976
|
-
/* @__PURE__ */
|
|
8058
|
+
value && /* @__PURE__ */ jsxs210("div", { className: "action-bar", children: [
|
|
8059
|
+
/* @__PURE__ */ jsx326("div", { className: "icon-wrapper", onClick: handleOpenFileDialog, children: /* @__PURE__ */ jsx326(UploadIcon_default, {}) }),
|
|
8060
|
+
/* @__PURE__ */ jsx326("div", { className: "icon-wrapper", onClick: handleDeleteFile, children: /* @__PURE__ */ jsx326(DeleteIcon_default, {}) })
|
|
7977
8061
|
] }),
|
|
7978
|
-
/* @__PURE__ */
|
|
7979
|
-
/* @__PURE__ */
|
|
7980
|
-
/* @__PURE__ */
|
|
8062
|
+
/* @__PURE__ */ jsx326("div", { className: "content", children: previewUrl ? /* @__PURE__ */ jsx326("img", { src: previewUrl, alt: "preview" }) : /* @__PURE__ */ jsxs210("div", { className: "skeleton", onClick: handleOpenFileDialog, children: [
|
|
8063
|
+
/* @__PURE__ */ jsx326("div", { className: "icon-wrapper", children: /* @__PURE__ */ jsx326(ImageIcon_default, {}) }),
|
|
8064
|
+
/* @__PURE__ */ jsx326("div", { className: "label", children: label || "\uC774\uBBF8\uC9C0 \uCD94\uAC00\uD558\uAE30" })
|
|
7981
8065
|
] }) })
|
|
7982
8066
|
] });
|
|
7983
8067
|
};
|
|
@@ -7985,7 +8069,7 @@ ImageSelector.displayName = "ImageSelector";
|
|
|
7985
8069
|
var ImageSelector_default = ImageSelector;
|
|
7986
8070
|
|
|
7987
8071
|
// src/components/Pagination/Pagination.tsx
|
|
7988
|
-
import { jsx as
|
|
8072
|
+
import { jsx as jsx327, jsxs as jsxs211 } from "react/jsx-runtime";
|
|
7989
8073
|
var getPageRange = (current, totalPages, siblingCount) => {
|
|
7990
8074
|
const totalNumbers = siblingCount * 2 + 5;
|
|
7991
8075
|
if (totalPages <= totalNumbers) {
|
|
@@ -8028,19 +8112,19 @@ var Pagination = (props) => {
|
|
|
8028
8112
|
onChange?.(page);
|
|
8029
8113
|
}
|
|
8030
8114
|
};
|
|
8031
|
-
return /* @__PURE__ */
|
|
8032
|
-
/* @__PURE__ */
|
|
8115
|
+
return /* @__PURE__ */ jsxs211("nav", { className: clsx_default("lib-xplat-pagination", size, type), "aria-label": "\uD398\uC774\uC9C0 \uB124\uBE44\uAC8C\uC774\uC158", children: [
|
|
8116
|
+
/* @__PURE__ */ jsx327(
|
|
8033
8117
|
"button",
|
|
8034
8118
|
{
|
|
8035
8119
|
className: "page-btn prev",
|
|
8036
8120
|
disabled: current <= 1,
|
|
8037
8121
|
onClick: () => handleClick(current - 1),
|
|
8038
8122
|
"aria-label": "\uC774\uC804 \uD398\uC774\uC9C0",
|
|
8039
|
-
children: /* @__PURE__ */
|
|
8123
|
+
children: /* @__PURE__ */ jsx327(ChevronLeftIcon_default, {})
|
|
8040
8124
|
}
|
|
8041
8125
|
),
|
|
8042
8126
|
pages.map(
|
|
8043
|
-
(page, i) => page === "..." ? /* @__PURE__ */
|
|
8127
|
+
(page, i) => page === "..." ? /* @__PURE__ */ jsx327("span", { className: "dots", children: "..." }, `dots-${i}`) : /* @__PURE__ */ jsx327(
|
|
8044
8128
|
"button",
|
|
8045
8129
|
{
|
|
8046
8130
|
className: clsx_default("page-btn", { active: page === current }),
|
|
@@ -8051,14 +8135,14 @@ var Pagination = (props) => {
|
|
|
8051
8135
|
page
|
|
8052
8136
|
)
|
|
8053
8137
|
),
|
|
8054
|
-
/* @__PURE__ */
|
|
8138
|
+
/* @__PURE__ */ jsx327(
|
|
8055
8139
|
"button",
|
|
8056
8140
|
{
|
|
8057
8141
|
className: "page-btn next",
|
|
8058
8142
|
disabled: current >= totalPages,
|
|
8059
8143
|
onClick: () => handleClick(current + 1),
|
|
8060
8144
|
"aria-label": "\uB2E4\uC74C \uD398\uC774\uC9C0",
|
|
8061
|
-
children: /* @__PURE__ */
|
|
8145
|
+
children: /* @__PURE__ */ jsx327(ChevronRightIcon_default, {})
|
|
8062
8146
|
}
|
|
8063
8147
|
)
|
|
8064
8148
|
] });
|
|
@@ -8067,17 +8151,17 @@ Pagination.displayName = "Pagination";
|
|
|
8067
8151
|
var Pagination_default = Pagination;
|
|
8068
8152
|
|
|
8069
8153
|
// src/components/PopOver/PopOver.tsx
|
|
8070
|
-
import
|
|
8071
|
-
import { jsx as
|
|
8154
|
+
import React25 from "react";
|
|
8155
|
+
import { jsx as jsx328, jsxs as jsxs212 } from "react/jsx-runtime";
|
|
8072
8156
|
var PopOver = (props) => {
|
|
8073
8157
|
const { children, isOpen, onClose, PopOverEl } = props;
|
|
8074
|
-
const popRef =
|
|
8075
|
-
const triggerRef =
|
|
8076
|
-
const [localOpen, setLocalOpen] =
|
|
8077
|
-
const [eventTrigger, setEventTrigger] =
|
|
8158
|
+
const popRef = React25.useRef(null);
|
|
8159
|
+
const triggerRef = React25.useRef(null);
|
|
8160
|
+
const [localOpen, setLocalOpen] = React25.useState(false);
|
|
8161
|
+
const [eventTrigger, setEventTrigger] = React25.useState(false);
|
|
8078
8162
|
useClickOutside_default([popRef, triggerRef], onClose, isOpen);
|
|
8079
8163
|
const position = useAutoPosition_default(triggerRef, popRef, localOpen);
|
|
8080
|
-
|
|
8164
|
+
React25.useEffect(() => {
|
|
8081
8165
|
if (isOpen) {
|
|
8082
8166
|
setLocalOpen(isOpen);
|
|
8083
8167
|
setTimeout(() => {
|
|
@@ -8090,7 +8174,7 @@ var PopOver = (props) => {
|
|
|
8090
8174
|
}, 200);
|
|
8091
8175
|
}
|
|
8092
8176
|
}, [isOpen]);
|
|
8093
|
-
return /* @__PURE__ */
|
|
8177
|
+
return /* @__PURE__ */ jsxs212(
|
|
8094
8178
|
"div",
|
|
8095
8179
|
{
|
|
8096
8180
|
className: "lib-xplat-pop-over",
|
|
@@ -8100,7 +8184,7 @@ var PopOver = (props) => {
|
|
|
8100
8184
|
},
|
|
8101
8185
|
children: [
|
|
8102
8186
|
children,
|
|
8103
|
-
localOpen && /* @__PURE__ */
|
|
8187
|
+
localOpen && /* @__PURE__ */ jsx328(Portal_default, { children: /* @__PURE__ */ jsx328(
|
|
8104
8188
|
"div",
|
|
8105
8189
|
{
|
|
8106
8190
|
className: clsx_default(
|
|
@@ -8123,7 +8207,7 @@ PopOver.displayName = "PopOver";
|
|
|
8123
8207
|
var PopOver_default = PopOver;
|
|
8124
8208
|
|
|
8125
8209
|
// src/components/Progress/Progress.tsx
|
|
8126
|
-
import { jsx as
|
|
8210
|
+
import { jsx as jsx329, jsxs as jsxs213 } from "react/jsx-runtime";
|
|
8127
8211
|
var Progress = (props) => {
|
|
8128
8212
|
const {
|
|
8129
8213
|
value,
|
|
@@ -8133,8 +8217,8 @@ var Progress = (props) => {
|
|
|
8133
8217
|
showLabel = false
|
|
8134
8218
|
} = props;
|
|
8135
8219
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
8136
|
-
return /* @__PURE__ */
|
|
8137
|
-
/* @__PURE__ */
|
|
8220
|
+
return /* @__PURE__ */ jsxs213("div", { className: clsx_default("lib-xplat-progress", size, type), children: [
|
|
8221
|
+
/* @__PURE__ */ jsx329(
|
|
8138
8222
|
"div",
|
|
8139
8223
|
{
|
|
8140
8224
|
className: "track",
|
|
@@ -8142,7 +8226,7 @@ var Progress = (props) => {
|
|
|
8142
8226
|
"aria-valuenow": value,
|
|
8143
8227
|
"aria-valuemin": 0,
|
|
8144
8228
|
"aria-valuemax": max,
|
|
8145
|
-
children: /* @__PURE__ */
|
|
8229
|
+
children: /* @__PURE__ */ jsx329(
|
|
8146
8230
|
"div",
|
|
8147
8231
|
{
|
|
8148
8232
|
className: "bar",
|
|
@@ -8151,7 +8235,7 @@ var Progress = (props) => {
|
|
|
8151
8235
|
)
|
|
8152
8236
|
}
|
|
8153
8237
|
),
|
|
8154
|
-
showLabel && /* @__PURE__ */
|
|
8238
|
+
showLabel && /* @__PURE__ */ jsxs213("span", { className: "label", children: [
|
|
8155
8239
|
Math.round(percentage),
|
|
8156
8240
|
"%"
|
|
8157
8241
|
] })
|
|
@@ -8161,17 +8245,17 @@ Progress.displayName = "Progress";
|
|
|
8161
8245
|
var Progress_default = Progress;
|
|
8162
8246
|
|
|
8163
8247
|
// src/components/Radio/RadioGroupContext.tsx
|
|
8164
|
-
import
|
|
8165
|
-
var RadioGroupContext =
|
|
8248
|
+
import React26 from "react";
|
|
8249
|
+
var RadioGroupContext = React26.createContext(
|
|
8166
8250
|
null
|
|
8167
8251
|
);
|
|
8168
8252
|
var useRadioGroupContext = () => {
|
|
8169
|
-
return
|
|
8253
|
+
return React26.useContext(RadioGroupContext);
|
|
8170
8254
|
};
|
|
8171
8255
|
var RadioGroupContext_default = RadioGroupContext;
|
|
8172
8256
|
|
|
8173
8257
|
// src/components/Radio/Radio.tsx
|
|
8174
|
-
import { jsx as
|
|
8258
|
+
import { jsx as jsx330, jsxs as jsxs214 } from "react/jsx-runtime";
|
|
8175
8259
|
var Radio = (props) => {
|
|
8176
8260
|
const {
|
|
8177
8261
|
label,
|
|
@@ -8189,7 +8273,7 @@ var Radio = (props) => {
|
|
|
8189
8273
|
value,
|
|
8190
8274
|
onChange: rest.onChange
|
|
8191
8275
|
};
|
|
8192
|
-
return /* @__PURE__ */
|
|
8276
|
+
return /* @__PURE__ */ jsxs214(
|
|
8193
8277
|
"label",
|
|
8194
8278
|
{
|
|
8195
8279
|
className: clsx_default(
|
|
@@ -8199,18 +8283,18 @@ var Radio = (props) => {
|
|
|
8199
8283
|
localChecked ? "checked" : void 0
|
|
8200
8284
|
),
|
|
8201
8285
|
children: [
|
|
8202
|
-
/* @__PURE__ */
|
|
8203
|
-
/* @__PURE__ */
|
|
8286
|
+
/* @__PURE__ */ jsx330("input", { ...rest, ...inputProps, checked: localChecked, type: "radio" }),
|
|
8287
|
+
/* @__PURE__ */ jsx330(
|
|
8204
8288
|
"div",
|
|
8205
8289
|
{
|
|
8206
8290
|
className: clsx_default(
|
|
8207
8291
|
"circle",
|
|
8208
8292
|
localChecked ? "checked" : void 0
|
|
8209
8293
|
),
|
|
8210
|
-
children: localChecked && /* @__PURE__ */
|
|
8294
|
+
children: localChecked && /* @__PURE__ */ jsx330("div", { className: "inner-circle" })
|
|
8211
8295
|
}
|
|
8212
8296
|
),
|
|
8213
|
-
label && /* @__PURE__ */
|
|
8297
|
+
label && /* @__PURE__ */ jsx330("span", { children: label })
|
|
8214
8298
|
]
|
|
8215
8299
|
}
|
|
8216
8300
|
);
|
|
@@ -8219,28 +8303,28 @@ Radio.displayName = "Radio";
|
|
|
8219
8303
|
var Radio_default = Radio;
|
|
8220
8304
|
|
|
8221
8305
|
// src/components/Radio/RadioGroup.tsx
|
|
8222
|
-
import { Fragment as Fragment4, jsx as
|
|
8306
|
+
import { Fragment as Fragment4, jsx as jsx331 } from "react/jsx-runtime";
|
|
8223
8307
|
var RadioGroup = (props) => {
|
|
8224
8308
|
const { children, ...rest } = props;
|
|
8225
|
-
return /* @__PURE__ */
|
|
8309
|
+
return /* @__PURE__ */ jsx331(Fragment4, { children: /* @__PURE__ */ jsx331(RadioGroupContext_default.Provider, { value: rest, children }) });
|
|
8226
8310
|
};
|
|
8227
8311
|
RadioGroup.displayName = "RadioGroup";
|
|
8228
8312
|
var RadioGroup_default = RadioGroup;
|
|
8229
8313
|
|
|
8230
8314
|
// src/components/Select/Select.tsx
|
|
8231
|
-
import
|
|
8315
|
+
import React29 from "react";
|
|
8232
8316
|
|
|
8233
8317
|
// src/components/Select/context.ts
|
|
8234
|
-
import
|
|
8235
|
-
var SelectContext =
|
|
8318
|
+
import React27 from "react";
|
|
8319
|
+
var SelectContext = React27.createContext(null);
|
|
8236
8320
|
var context_default = SelectContext;
|
|
8237
8321
|
|
|
8238
8322
|
// src/components/Select/SelectItem.tsx
|
|
8239
|
-
import
|
|
8240
|
-
import { jsx as
|
|
8323
|
+
import React28 from "react";
|
|
8324
|
+
import { jsx as jsx332 } from "react/jsx-runtime";
|
|
8241
8325
|
var SelectItem = (props) => {
|
|
8242
8326
|
const { children, value, onClick, disabled = false } = props;
|
|
8243
|
-
const ctx =
|
|
8327
|
+
const ctx = React28.useContext(context_default);
|
|
8244
8328
|
const handleClick = (e) => {
|
|
8245
8329
|
e.preventDefault();
|
|
8246
8330
|
e.stopPropagation();
|
|
@@ -8249,7 +8333,7 @@ var SelectItem = (props) => {
|
|
|
8249
8333
|
ctx?.close();
|
|
8250
8334
|
onClick?.();
|
|
8251
8335
|
};
|
|
8252
|
-
return /* @__PURE__ */
|
|
8336
|
+
return /* @__PURE__ */ jsx332(
|
|
8253
8337
|
"div",
|
|
8254
8338
|
{
|
|
8255
8339
|
className: clsx_default("select-item", disabled && "disabled"),
|
|
@@ -8270,7 +8354,7 @@ SelectItem.displayName = "Select.Item";
|
|
|
8270
8354
|
var SelectItem_default = SelectItem;
|
|
8271
8355
|
|
|
8272
8356
|
// src/components/Select/Select.tsx
|
|
8273
|
-
import { jsx as
|
|
8357
|
+
import { jsx as jsx333, jsxs as jsxs215 } from "react/jsx-runtime";
|
|
8274
8358
|
var ANIMATION_DURATION_MS3 = 200;
|
|
8275
8359
|
var SelectRoot = (props) => {
|
|
8276
8360
|
const {
|
|
@@ -8282,26 +8366,26 @@ var SelectRoot = (props) => {
|
|
|
8282
8366
|
error = false,
|
|
8283
8367
|
size = "md"
|
|
8284
8368
|
} = props;
|
|
8285
|
-
const itemChildren =
|
|
8286
|
-
(child) =>
|
|
8369
|
+
const itemChildren = React29.Children.toArray(children).filter(
|
|
8370
|
+
(child) => React29.isValidElement(child) && child.type === SelectItem_default
|
|
8287
8371
|
);
|
|
8288
8372
|
const isControlled = valueProp !== void 0;
|
|
8289
|
-
const [isOpen, setOpen] =
|
|
8290
|
-
const [uncontrolledLabel, setUncontrolledLabel] =
|
|
8291
|
-
const controlledLabel =
|
|
8373
|
+
const [isOpen, setOpen] = React29.useState(false);
|
|
8374
|
+
const [uncontrolledLabel, setUncontrolledLabel] = React29.useState(null);
|
|
8375
|
+
const controlledLabel = React29.useMemo(() => {
|
|
8292
8376
|
if (!isControlled) return null;
|
|
8293
8377
|
const match = itemChildren.find((child) => child.props.value === valueProp);
|
|
8294
8378
|
return match ? match.props.children : null;
|
|
8295
8379
|
}, [isControlled, valueProp, itemChildren]);
|
|
8296
8380
|
const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
|
|
8297
|
-
const triggerRef =
|
|
8298
|
-
const contentRef =
|
|
8299
|
-
const [mounted, setMounted] =
|
|
8300
|
-
const [visible, setVisible] =
|
|
8301
|
-
|
|
8381
|
+
const triggerRef = React29.useRef(null);
|
|
8382
|
+
const contentRef = React29.useRef(null);
|
|
8383
|
+
const [mounted, setMounted] = React29.useState(false);
|
|
8384
|
+
const [visible, setVisible] = React29.useState(false);
|
|
8385
|
+
React29.useEffect(() => {
|
|
8302
8386
|
if (disabled && isOpen) setOpen(false);
|
|
8303
8387
|
}, [disabled, isOpen]);
|
|
8304
|
-
|
|
8388
|
+
React29.useEffect(() => {
|
|
8305
8389
|
if (isOpen) {
|
|
8306
8390
|
setMounted(true);
|
|
8307
8391
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -8311,12 +8395,12 @@ var SelectRoot = (props) => {
|
|
|
8311
8395
|
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS3);
|
|
8312
8396
|
return () => clearTimeout(t);
|
|
8313
8397
|
}, [isOpen]);
|
|
8314
|
-
const open =
|
|
8315
|
-
const close =
|
|
8316
|
-
const toggle =
|
|
8398
|
+
const open = React29.useCallback(() => setOpen(true), []);
|
|
8399
|
+
const close = React29.useCallback(() => setOpen(false), []);
|
|
8400
|
+
const toggle = React29.useCallback(() => setOpen((prev) => !prev), []);
|
|
8317
8401
|
useClickOutside_default([contentRef, triggerRef], close, isOpen);
|
|
8318
8402
|
const position = useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
8319
|
-
const setSelected =
|
|
8403
|
+
const setSelected = React29.useCallback(
|
|
8320
8404
|
(label, itemValue) => {
|
|
8321
8405
|
if (!isControlled) {
|
|
8322
8406
|
setUncontrolledLabel(label);
|
|
@@ -8325,7 +8409,7 @@ var SelectRoot = (props) => {
|
|
|
8325
8409
|
},
|
|
8326
8410
|
[isControlled, onChange]
|
|
8327
8411
|
);
|
|
8328
|
-
const ctxValue =
|
|
8412
|
+
const ctxValue = React29.useMemo(
|
|
8329
8413
|
() => ({
|
|
8330
8414
|
isOpen,
|
|
8331
8415
|
mounted,
|
|
@@ -8346,7 +8430,7 @@ var SelectRoot = (props) => {
|
|
|
8346
8430
|
if (disabled) return;
|
|
8347
8431
|
toggle();
|
|
8348
8432
|
};
|
|
8349
|
-
return /* @__PURE__ */
|
|
8433
|
+
return /* @__PURE__ */ jsx333(context_default.Provider, { value: ctxValue, children: /* @__PURE__ */ jsxs215(
|
|
8350
8434
|
"div",
|
|
8351
8435
|
{
|
|
8352
8436
|
className: clsx_default(
|
|
@@ -8357,7 +8441,7 @@ var SelectRoot = (props) => {
|
|
|
8357
8441
|
mounted && "is-open"
|
|
8358
8442
|
),
|
|
8359
8443
|
children: [
|
|
8360
|
-
/* @__PURE__ */
|
|
8444
|
+
/* @__PURE__ */ jsxs215(
|
|
8361
8445
|
"div",
|
|
8362
8446
|
{
|
|
8363
8447
|
ref: triggerRef,
|
|
@@ -8381,7 +8465,7 @@ var SelectRoot = (props) => {
|
|
|
8381
8465
|
}
|
|
8382
8466
|
},
|
|
8383
8467
|
children: [
|
|
8384
|
-
/* @__PURE__ */
|
|
8468
|
+
/* @__PURE__ */ jsx333(
|
|
8385
8469
|
"span",
|
|
8386
8470
|
{
|
|
8387
8471
|
className: clsx_default(
|
|
@@ -8391,25 +8475,25 @@ var SelectRoot = (props) => {
|
|
|
8391
8475
|
children: selectedLabel ?? placeholder
|
|
8392
8476
|
}
|
|
8393
8477
|
),
|
|
8394
|
-
/* @__PURE__ */
|
|
8478
|
+
/* @__PURE__ */ jsx333(
|
|
8395
8479
|
"span",
|
|
8396
8480
|
{
|
|
8397
8481
|
className: clsx_default("select-trigger-icon", isOpen && "open"),
|
|
8398
8482
|
"aria-hidden": true,
|
|
8399
|
-
children: /* @__PURE__ */
|
|
8483
|
+
children: /* @__PURE__ */ jsx333(ChevronDownIcon_default, {})
|
|
8400
8484
|
}
|
|
8401
8485
|
)
|
|
8402
8486
|
]
|
|
8403
8487
|
}
|
|
8404
8488
|
),
|
|
8405
|
-
mounted && /* @__PURE__ */
|
|
8489
|
+
mounted && /* @__PURE__ */ jsx333(Portal_default, { children: /* @__PURE__ */ jsx333(
|
|
8406
8490
|
"div",
|
|
8407
8491
|
{
|
|
8408
8492
|
className: clsx_default("lib-xplat-select-content", position.direction, stateClass),
|
|
8409
8493
|
ref: contentRef,
|
|
8410
8494
|
style: { ...position.position, width: triggerRef.current?.offsetWidth },
|
|
8411
8495
|
role: "listbox",
|
|
8412
|
-
children: /* @__PURE__ */
|
|
8496
|
+
children: /* @__PURE__ */ jsx333(context_default.Provider, { value: ctxValue, children: itemChildren })
|
|
8413
8497
|
}
|
|
8414
8498
|
) })
|
|
8415
8499
|
]
|
|
@@ -8423,7 +8507,7 @@ var Select = Object.assign(SelectRoot, {
|
|
|
8423
8507
|
var Select_default = Select;
|
|
8424
8508
|
|
|
8425
8509
|
// src/components/Skeleton/Skeleton.tsx
|
|
8426
|
-
import { jsx as
|
|
8510
|
+
import { jsx as jsx334 } from "react/jsx-runtime";
|
|
8427
8511
|
var SIZE_MAP = {
|
|
8428
8512
|
xs: "var(--spacing-size-1)",
|
|
8429
8513
|
sm: "var(--spacing-size-2)",
|
|
@@ -8439,7 +8523,7 @@ var Skeleton = (props) => {
|
|
|
8439
8523
|
...width != null && { width: SIZE_MAP[width] },
|
|
8440
8524
|
...height != null && { height: SIZE_MAP[height] }
|
|
8441
8525
|
};
|
|
8442
|
-
return /* @__PURE__ */
|
|
8526
|
+
return /* @__PURE__ */ jsx334(
|
|
8443
8527
|
"div",
|
|
8444
8528
|
{
|
|
8445
8529
|
className: clsx_default("lib-xplat-skeleton", variant),
|
|
@@ -8452,20 +8536,20 @@ Skeleton.displayName = "Skeleton";
|
|
|
8452
8536
|
var Skeleton_default = Skeleton;
|
|
8453
8537
|
|
|
8454
8538
|
// src/components/Spinner/Spinner.tsx
|
|
8455
|
-
import { jsx as
|
|
8539
|
+
import { jsx as jsx335, jsxs as jsxs216 } from "react/jsx-runtime";
|
|
8456
8540
|
var Spinner = (props) => {
|
|
8457
8541
|
const {
|
|
8458
8542
|
size = "md",
|
|
8459
8543
|
type = "brand"
|
|
8460
8544
|
} = props;
|
|
8461
|
-
return /* @__PURE__ */
|
|
8545
|
+
return /* @__PURE__ */ jsx335(
|
|
8462
8546
|
"div",
|
|
8463
8547
|
{
|
|
8464
8548
|
className: clsx_default("lib-xplat-spinner", size, type),
|
|
8465
8549
|
role: "status",
|
|
8466
8550
|
"aria-label": "\uB85C\uB529 \uC911",
|
|
8467
|
-
children: /* @__PURE__ */
|
|
8468
|
-
/* @__PURE__ */
|
|
8551
|
+
children: /* @__PURE__ */ jsxs216("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
8552
|
+
/* @__PURE__ */ jsx335(
|
|
8469
8553
|
"circle",
|
|
8470
8554
|
{
|
|
8471
8555
|
className: "track",
|
|
@@ -8475,7 +8559,7 @@ var Spinner = (props) => {
|
|
|
8475
8559
|
strokeWidth: "3"
|
|
8476
8560
|
}
|
|
8477
8561
|
),
|
|
8478
|
-
/* @__PURE__ */
|
|
8562
|
+
/* @__PURE__ */ jsx335(
|
|
8479
8563
|
"circle",
|
|
8480
8564
|
{
|
|
8481
8565
|
className: "indicator",
|
|
@@ -8494,20 +8578,20 @@ Spinner.displayName = "Spinner";
|
|
|
8494
8578
|
var Spinner_default = Spinner;
|
|
8495
8579
|
|
|
8496
8580
|
// src/components/Steps/Steps.tsx
|
|
8497
|
-
import { jsx as
|
|
8581
|
+
import { jsx as jsx336, jsxs as jsxs217 } from "react/jsx-runtime";
|
|
8498
8582
|
var Steps = (props) => {
|
|
8499
8583
|
const {
|
|
8500
8584
|
items,
|
|
8501
8585
|
current,
|
|
8502
8586
|
type = "brand"
|
|
8503
8587
|
} = props;
|
|
8504
|
-
return /* @__PURE__ */
|
|
8588
|
+
return /* @__PURE__ */ jsx336("div", { className: clsx_default("lib-xplat-steps", type), children: items.map((item, index) => {
|
|
8505
8589
|
const status = index < current ? "completed" : index === current ? "active" : "pending";
|
|
8506
|
-
return /* @__PURE__ */
|
|
8507
|
-
/* @__PURE__ */
|
|
8508
|
-
/* @__PURE__ */
|
|
8509
|
-
/* @__PURE__ */
|
|
8510
|
-
item.description && /* @__PURE__ */
|
|
8590
|
+
return /* @__PURE__ */ jsxs217("div", { className: clsx_default("step-item", status), children: [
|
|
8591
|
+
/* @__PURE__ */ jsx336("div", { className: "step-circle", children: status === "completed" ? /* @__PURE__ */ jsx336(CheckIcon_default, {}) : /* @__PURE__ */ jsx336("span", { children: index + 1 }) }),
|
|
8592
|
+
/* @__PURE__ */ jsxs217("div", { className: "step-content", children: [
|
|
8593
|
+
/* @__PURE__ */ jsx336("span", { className: "step-title", children: item.title }),
|
|
8594
|
+
item.description && /* @__PURE__ */ jsx336("span", { className: "step-description", children: item.description })
|
|
8511
8595
|
] })
|
|
8512
8596
|
] }, index);
|
|
8513
8597
|
}) });
|
|
@@ -8516,8 +8600,8 @@ Steps.displayName = "Steps";
|
|
|
8516
8600
|
var Steps_default = Steps;
|
|
8517
8601
|
|
|
8518
8602
|
// src/components/Swiper/Swiper.tsx
|
|
8519
|
-
import
|
|
8520
|
-
import { jsx as
|
|
8603
|
+
import React30 from "react";
|
|
8604
|
+
import { jsx as jsx337, jsxs as jsxs218 } from "react/jsx-runtime";
|
|
8521
8605
|
var Swiper = (props) => {
|
|
8522
8606
|
const {
|
|
8523
8607
|
auto = false,
|
|
@@ -8540,23 +8624,23 @@ var Swiper = (props) => {
|
|
|
8540
8624
|
const maxIndex = Math.max(0, totalSlides - viewItemCount);
|
|
8541
8625
|
const useLoop = loop && canSlide;
|
|
8542
8626
|
const cloneCount = useLoop ? totalSlides : 0;
|
|
8543
|
-
const extendedItems =
|
|
8627
|
+
const extendedItems = React30.useMemo(() => {
|
|
8544
8628
|
if (!useLoop) return items;
|
|
8545
8629
|
return [...items, ...items, ...items];
|
|
8546
8630
|
}, [items, useLoop]);
|
|
8547
8631
|
const initialIdx = Math.max(0, Math.min(indexProp ?? 0, maxIndex));
|
|
8548
|
-
const [innerIndex, setInnerIndex] =
|
|
8632
|
+
const [innerIndex, setInnerIndex] = React30.useState(
|
|
8549
8633
|
useLoop ? cloneCount + initialIdx : initialIdx
|
|
8550
8634
|
);
|
|
8551
|
-
const [isDragging, setIsDragging] =
|
|
8552
|
-
const [dragOffset, setDragOffset] =
|
|
8553
|
-
const [animated, setAnimated] =
|
|
8554
|
-
const [containerWidth, setContainerWidth] =
|
|
8555
|
-
const containerRef =
|
|
8556
|
-
const startXRef =
|
|
8557
|
-
const startTimeRef =
|
|
8558
|
-
const autoplayTimerRef =
|
|
8559
|
-
|
|
8635
|
+
const [isDragging, setIsDragging] = React30.useState(false);
|
|
8636
|
+
const [dragOffset, setDragOffset] = React30.useState(0);
|
|
8637
|
+
const [animated, setAnimated] = React30.useState(true);
|
|
8638
|
+
const [containerWidth, setContainerWidth] = React30.useState(0);
|
|
8639
|
+
const containerRef = React30.useRef(null);
|
|
8640
|
+
const startXRef = React30.useRef(0);
|
|
8641
|
+
const startTimeRef = React30.useRef(0);
|
|
8642
|
+
const autoplayTimerRef = React30.useRef(null);
|
|
8643
|
+
React30.useEffect(() => {
|
|
8560
8644
|
const el = containerRef.current;
|
|
8561
8645
|
if (!el) return;
|
|
8562
8646
|
const ro = new ResizeObserver((entries) => {
|
|
@@ -8575,7 +8659,7 @@ var Swiper = (props) => {
|
|
|
8575
8659
|
return ((inner - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
8576
8660
|
};
|
|
8577
8661
|
const realIndex = getRealIndex(innerIndex);
|
|
8578
|
-
const moveToInner =
|
|
8662
|
+
const moveToInner = React30.useCallback(
|
|
8579
8663
|
(idx, withAnim = true) => {
|
|
8580
8664
|
if (!useLoop) {
|
|
8581
8665
|
setAnimated(withAnim);
|
|
@@ -8603,7 +8687,7 @@ var Swiper = (props) => {
|
|
|
8603
8687
|
},
|
|
8604
8688
|
[useLoop, cloneCount, totalSlides]
|
|
8605
8689
|
);
|
|
8606
|
-
const handleTransitionEnd =
|
|
8690
|
+
const handleTransitionEnd = React30.useCallback(() => {
|
|
8607
8691
|
if (!useLoop) return;
|
|
8608
8692
|
const real = getRealIndex(innerIndex);
|
|
8609
8693
|
const canonical = cloneCount + real;
|
|
@@ -8613,7 +8697,7 @@ var Swiper = (props) => {
|
|
|
8613
8697
|
}
|
|
8614
8698
|
onChange?.(Math.min(real, maxIndex));
|
|
8615
8699
|
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange]);
|
|
8616
|
-
const slideTo =
|
|
8700
|
+
const slideTo = React30.useCallback(
|
|
8617
8701
|
(logicalIndex) => {
|
|
8618
8702
|
if (!canSlide) return;
|
|
8619
8703
|
const clamped = useLoop ? logicalIndex : Math.max(0, Math.min(logicalIndex, maxIndex));
|
|
@@ -8623,7 +8707,7 @@ var Swiper = (props) => {
|
|
|
8623
8707
|
},
|
|
8624
8708
|
[canSlide, useLoop, cloneCount, maxIndex, onChange, moveToInner]
|
|
8625
8709
|
);
|
|
8626
|
-
const slideNext =
|
|
8710
|
+
const slideNext = React30.useCallback(() => {
|
|
8627
8711
|
if (!canSlide) return;
|
|
8628
8712
|
const nextInner = innerIndex + slideBy;
|
|
8629
8713
|
if (useLoop) {
|
|
@@ -8632,7 +8716,7 @@ var Swiper = (props) => {
|
|
|
8632
8716
|
moveToInner(Math.min(nextInner, maxIndex), true);
|
|
8633
8717
|
}
|
|
8634
8718
|
}, [canSlide, useLoop, innerIndex, slideBy, maxIndex, moveToInner]);
|
|
8635
|
-
const slidePrev =
|
|
8719
|
+
const slidePrev = React30.useCallback(() => {
|
|
8636
8720
|
if (!canSlide) return;
|
|
8637
8721
|
const prevInner = innerIndex - slideBy;
|
|
8638
8722
|
if (useLoop) {
|
|
@@ -8641,7 +8725,7 @@ var Swiper = (props) => {
|
|
|
8641
8725
|
moveToInner(Math.max(prevInner, 0), true);
|
|
8642
8726
|
}
|
|
8643
8727
|
}, [canSlide, useLoop, innerIndex, slideBy, moveToInner]);
|
|
8644
|
-
|
|
8728
|
+
React30.useEffect(() => {
|
|
8645
8729
|
if (indexProp === void 0) return;
|
|
8646
8730
|
const clamped = Math.max(0, Math.min(indexProp, maxIndex));
|
|
8647
8731
|
const target = useLoop ? cloneCount + clamped : clamped;
|
|
@@ -8649,12 +8733,12 @@ var Swiper = (props) => {
|
|
|
8649
8733
|
moveToInner(target, true);
|
|
8650
8734
|
}
|
|
8651
8735
|
}, [indexProp]);
|
|
8652
|
-
|
|
8736
|
+
React30.useImperativeHandle(swiperRef, () => ({
|
|
8653
8737
|
slidePrev,
|
|
8654
8738
|
slideNext,
|
|
8655
8739
|
slideTo
|
|
8656
8740
|
}));
|
|
8657
|
-
|
|
8741
|
+
React30.useEffect(() => {
|
|
8658
8742
|
if (!auto || !canSlide) return;
|
|
8659
8743
|
autoplayTimerRef.current = setInterval(slideNext, autoplayDelay);
|
|
8660
8744
|
return () => {
|
|
@@ -8677,7 +8761,7 @@ var Swiper = (props) => {
|
|
|
8677
8761
|
startXRef.current = getClientX(e);
|
|
8678
8762
|
startTimeRef.current = Date.now();
|
|
8679
8763
|
};
|
|
8680
|
-
|
|
8764
|
+
React30.useEffect(() => {
|
|
8681
8765
|
if (!isDragging) return;
|
|
8682
8766
|
const handleMove = (e) => {
|
|
8683
8767
|
setDragOffset(getClientX(e) - startXRef.current);
|
|
@@ -8715,8 +8799,8 @@ var Swiper = (props) => {
|
|
|
8715
8799
|
}, [isDragging, dragOffset, innerIndex, useLoop, maxIndex, slideStep, moveToInner]);
|
|
8716
8800
|
const slideWidthPercent = 100 / viewItemCount;
|
|
8717
8801
|
const gapAdjust = spaceBetween * (viewItemCount - 1) / viewItemCount;
|
|
8718
|
-
const slideElements =
|
|
8719
|
-
() => extendedItems.map((item, idx) => /* @__PURE__ */
|
|
8802
|
+
const slideElements = React30.useMemo(
|
|
8803
|
+
() => extendedItems.map((item, idx) => /* @__PURE__ */ jsx337(
|
|
8720
8804
|
"div",
|
|
8721
8805
|
{
|
|
8722
8806
|
className: "lib-xplat-swiper__slide",
|
|
@@ -8735,14 +8819,14 @@ var Swiper = (props) => {
|
|
|
8735
8819
|
Math.floor(realIndex / slideBy),
|
|
8736
8820
|
totalSteps - 1
|
|
8737
8821
|
);
|
|
8738
|
-
return /* @__PURE__ */
|
|
8739
|
-
/* @__PURE__ */
|
|
8822
|
+
return /* @__PURE__ */ jsxs218("div", { className: "lib-xplat-swiper", ref: containerRef, children: [
|
|
8823
|
+
/* @__PURE__ */ jsx337(
|
|
8740
8824
|
"div",
|
|
8741
8825
|
{
|
|
8742
8826
|
className: "lib-xplat-swiper__viewport",
|
|
8743
8827
|
onMouseDown: handleDragStart,
|
|
8744
8828
|
onTouchStart: handleDragStart,
|
|
8745
|
-
children: /* @__PURE__ */
|
|
8829
|
+
children: /* @__PURE__ */ jsx337(
|
|
8746
8830
|
"div",
|
|
8747
8831
|
{
|
|
8748
8832
|
className: clsx_default(
|
|
@@ -8760,7 +8844,7 @@ var Swiper = (props) => {
|
|
|
8760
8844
|
)
|
|
8761
8845
|
}
|
|
8762
8846
|
),
|
|
8763
|
-
showProgress && canSlide && /* @__PURE__ */
|
|
8847
|
+
showProgress && canSlide && /* @__PURE__ */ jsx337("div", { className: "lib-xplat-swiper__progress", children: /* @__PURE__ */ jsx337("div", { className: "lib-xplat-swiper__progress-track", children: /* @__PURE__ */ jsx337(
|
|
8764
8848
|
"span",
|
|
8765
8849
|
{
|
|
8766
8850
|
className: "lib-xplat-swiper__progress-fill",
|
|
@@ -8770,7 +8854,7 @@ var Swiper = (props) => {
|
|
|
8770
8854
|
}
|
|
8771
8855
|
}
|
|
8772
8856
|
) }) }),
|
|
8773
|
-
canSlide && /* @__PURE__ */
|
|
8857
|
+
canSlide && /* @__PURE__ */ jsx337("div", { className: "lib-xplat-swiper__dots", children: Array.from({ length: totalSteps }, (_, i) => /* @__PURE__ */ jsx337(
|
|
8774
8858
|
"button",
|
|
8775
8859
|
{
|
|
8776
8860
|
className: clsx_default(
|
|
@@ -8788,8 +8872,8 @@ Swiper.displayName = "Swiper";
|
|
|
8788
8872
|
var Swiper_default = Swiper;
|
|
8789
8873
|
|
|
8790
8874
|
// src/components/Switch/Switch.tsx
|
|
8791
|
-
import
|
|
8792
|
-
import { jsx as
|
|
8875
|
+
import React31 from "react";
|
|
8876
|
+
import { jsx as jsx338 } from "react/jsx-runtime";
|
|
8793
8877
|
var KNOB_TRANSITION_MS = 250;
|
|
8794
8878
|
var Switch = (props) => {
|
|
8795
8879
|
const {
|
|
@@ -8799,9 +8883,9 @@ var Switch = (props) => {
|
|
|
8799
8883
|
disabled,
|
|
8800
8884
|
onChange
|
|
8801
8885
|
} = props;
|
|
8802
|
-
const [isAnimating, setIsAnimating] =
|
|
8803
|
-
const timeoutRef =
|
|
8804
|
-
|
|
8886
|
+
const [isAnimating, setIsAnimating] = React31.useState(false);
|
|
8887
|
+
const timeoutRef = React31.useRef(null);
|
|
8888
|
+
React31.useEffect(() => {
|
|
8805
8889
|
return () => {
|
|
8806
8890
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
8807
8891
|
};
|
|
@@ -8816,7 +8900,7 @@ var Switch = (props) => {
|
|
|
8816
8900
|
timeoutRef.current = null;
|
|
8817
8901
|
}, KNOB_TRANSITION_MS);
|
|
8818
8902
|
};
|
|
8819
|
-
return /* @__PURE__ */
|
|
8903
|
+
return /* @__PURE__ */ jsx338(
|
|
8820
8904
|
"div",
|
|
8821
8905
|
{
|
|
8822
8906
|
className: clsx_default(
|
|
@@ -8829,7 +8913,7 @@ var Switch = (props) => {
|
|
|
8829
8913
|
),
|
|
8830
8914
|
onClick: handleClick,
|
|
8831
8915
|
"aria-disabled": disabled || isAnimating,
|
|
8832
|
-
children: /* @__PURE__ */
|
|
8916
|
+
children: /* @__PURE__ */ jsx338("div", { className: clsx_default("knob", value ? "checked" : void 0) })
|
|
8833
8917
|
}
|
|
8834
8918
|
);
|
|
8835
8919
|
};
|
|
@@ -8837,26 +8921,27 @@ Switch.displayName = "Switch";
|
|
|
8837
8921
|
var Switch_default = Switch;
|
|
8838
8922
|
|
|
8839
8923
|
// src/components/Table/TableContext.tsx
|
|
8840
|
-
import
|
|
8841
|
-
var TableContext =
|
|
8924
|
+
import React32 from "react";
|
|
8925
|
+
var TableContext = React32.createContext(null);
|
|
8842
8926
|
var useTableContext = () => {
|
|
8843
|
-
const ctx =
|
|
8927
|
+
const ctx = React32.useContext(TableContext);
|
|
8844
8928
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
8845
8929
|
return ctx;
|
|
8846
8930
|
};
|
|
8847
8931
|
var TableContext_default = TableContext;
|
|
8848
8932
|
|
|
8849
8933
|
// src/components/Table/Table.tsx
|
|
8850
|
-
import { jsx as
|
|
8934
|
+
import { jsx as jsx339 } from "react/jsx-runtime";
|
|
8851
8935
|
var Table = (props) => {
|
|
8852
8936
|
const {
|
|
8853
8937
|
children,
|
|
8938
|
+
size = "md",
|
|
8854
8939
|
rowBorderUse = true,
|
|
8855
8940
|
colBorderUse = true,
|
|
8856
8941
|
headerSticky = false,
|
|
8857
8942
|
stickyShadow = true
|
|
8858
8943
|
} = props;
|
|
8859
|
-
return /* @__PURE__ */
|
|
8944
|
+
return /* @__PURE__ */ jsx339("div", { className: `lib-xplat-table-wrapper ${size}`, children: /* @__PURE__ */ jsx339(
|
|
8860
8945
|
TableContext_default.Provider,
|
|
8861
8946
|
{
|
|
8862
8947
|
value: {
|
|
@@ -8865,7 +8950,7 @@ var Table = (props) => {
|
|
|
8865
8950
|
headerSticky,
|
|
8866
8951
|
stickyShadow
|
|
8867
8952
|
},
|
|
8868
|
-
children: /* @__PURE__ */
|
|
8953
|
+
children: /* @__PURE__ */ jsx339("table", { className: "lib-xplat-table", children })
|
|
8869
8954
|
}
|
|
8870
8955
|
) });
|
|
8871
8956
|
};
|
|
@@ -8873,41 +8958,41 @@ Table.displayName = "Table";
|
|
|
8873
8958
|
var Table_default = Table;
|
|
8874
8959
|
|
|
8875
8960
|
// src/components/Table/TableBody.tsx
|
|
8876
|
-
import { jsx as
|
|
8961
|
+
import { jsx as jsx340 } from "react/jsx-runtime";
|
|
8877
8962
|
var TableBody = (props) => {
|
|
8878
8963
|
const { children } = props;
|
|
8879
|
-
return /* @__PURE__ */
|
|
8964
|
+
return /* @__PURE__ */ jsx340("tbody", { children });
|
|
8880
8965
|
};
|
|
8881
8966
|
TableBody.displayName = "TableBody";
|
|
8882
8967
|
var TableBody_default = TableBody;
|
|
8883
8968
|
|
|
8884
8969
|
// src/components/Table/TableCell.tsx
|
|
8885
|
-
import
|
|
8970
|
+
import React35 from "react";
|
|
8886
8971
|
|
|
8887
8972
|
// src/components/Table/TableHeadContext.tsx
|
|
8888
|
-
import
|
|
8889
|
-
var TableHeadContext =
|
|
8973
|
+
import React33 from "react";
|
|
8974
|
+
var TableHeadContext = React33.createContext(
|
|
8890
8975
|
null
|
|
8891
8976
|
);
|
|
8892
8977
|
var useTableHeadContext = () => {
|
|
8893
|
-
const ctx =
|
|
8978
|
+
const ctx = React33.useContext(TableHeadContext);
|
|
8894
8979
|
return ctx;
|
|
8895
8980
|
};
|
|
8896
8981
|
var TableHeadContext_default = TableHeadContext;
|
|
8897
8982
|
|
|
8898
8983
|
// src/components/Table/TableRowContext.tsx
|
|
8899
|
-
import
|
|
8900
|
-
var TableRowContext =
|
|
8984
|
+
import React34 from "react";
|
|
8985
|
+
var TableRowContext = React34.createContext(null);
|
|
8901
8986
|
var useTableRowContext = () => {
|
|
8902
|
-
const ctx =
|
|
8987
|
+
const ctx = React34.useContext(TableRowContext);
|
|
8903
8988
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
8904
8989
|
return ctx;
|
|
8905
8990
|
};
|
|
8906
8991
|
var TableRowContext_default = TableRowContext;
|
|
8907
8992
|
|
|
8908
8993
|
// src/components/Table/TableCell.tsx
|
|
8909
|
-
import { jsx as
|
|
8910
|
-
var TableCell =
|
|
8994
|
+
import { jsx as jsx341 } from "react/jsx-runtime";
|
|
8995
|
+
var TableCell = React35.memo((props) => {
|
|
8911
8996
|
const {
|
|
8912
8997
|
children,
|
|
8913
8998
|
align = "center",
|
|
@@ -8919,9 +9004,9 @@ var TableCell = React34.memo((props) => {
|
|
|
8919
9004
|
const { registerStickyCell, stickyCells } = useTableRowContext();
|
|
8920
9005
|
const { stickyShadow } = useTableContext();
|
|
8921
9006
|
const headContext = useTableHeadContext();
|
|
8922
|
-
const [left, setLeft] =
|
|
8923
|
-
const cellRef =
|
|
8924
|
-
const calculateLeft =
|
|
9007
|
+
const [left, setLeft] = React35.useState(0);
|
|
9008
|
+
const cellRef = React35.useRef(null);
|
|
9009
|
+
const calculateLeft = React35.useCallback(() => {
|
|
8925
9010
|
if (!cellRef.current) return 0;
|
|
8926
9011
|
let totalLeft = 0;
|
|
8927
9012
|
for (const ref of stickyCells) {
|
|
@@ -8930,7 +9015,7 @@ var TableCell = React34.memo((props) => {
|
|
|
8930
9015
|
}
|
|
8931
9016
|
return totalLeft;
|
|
8932
9017
|
}, [stickyCells]);
|
|
8933
|
-
|
|
9018
|
+
React35.useEffect(() => {
|
|
8934
9019
|
if (!isSticky || !cellRef.current) return;
|
|
8935
9020
|
registerStickyCell(cellRef);
|
|
8936
9021
|
setLeft(calculateLeft());
|
|
@@ -8948,7 +9033,7 @@ var TableCell = React34.memo((props) => {
|
|
|
8948
9033
|
const CellTag = cellRef.current?.tagName === "TH" ? "th" : "td";
|
|
8949
9034
|
const isLastSticky = isSticky && stickyCells[stickyCells.length - 1] === cellRef;
|
|
8950
9035
|
const enableHover = headContext && headContext.cellHover;
|
|
8951
|
-
return /* @__PURE__ */
|
|
9036
|
+
return /* @__PURE__ */ jsx341(
|
|
8952
9037
|
CellTag,
|
|
8953
9038
|
{
|
|
8954
9039
|
ref: cellRef,
|
|
@@ -8973,21 +9058,21 @@ TableCell.displayName = "TableCell";
|
|
|
8973
9058
|
var TableCell_default = TableCell;
|
|
8974
9059
|
|
|
8975
9060
|
// src/components/Table/TableHead.tsx
|
|
8976
|
-
import { jsx as
|
|
9061
|
+
import { jsx as jsx342 } from "react/jsx-runtime";
|
|
8977
9062
|
var TableHead = ({
|
|
8978
9063
|
children,
|
|
8979
9064
|
cellHover = false
|
|
8980
9065
|
}) => {
|
|
8981
9066
|
const { headerSticky } = useTableContext();
|
|
8982
|
-
return /* @__PURE__ */
|
|
9067
|
+
return /* @__PURE__ */ jsx342(TableHeadContext_default.Provider, { value: { cellHover }, children: /* @__PURE__ */ jsx342("thead", { className: clsx_default(headerSticky ? "table-sticky" : null), children }) });
|
|
8983
9068
|
};
|
|
8984
9069
|
TableHead.displayName = "TableHead";
|
|
8985
9070
|
var TableHead_default = TableHead;
|
|
8986
9071
|
|
|
8987
9072
|
// src/components/Table/TableRow.tsx
|
|
8988
|
-
import
|
|
8989
|
-
import { jsx as
|
|
8990
|
-
var TableRow =
|
|
9073
|
+
import React36 from "react";
|
|
9074
|
+
import { jsx as jsx343 } from "react/jsx-runtime";
|
|
9075
|
+
var TableRow = React36.memo((props) => {
|
|
8991
9076
|
const {
|
|
8992
9077
|
children,
|
|
8993
9078
|
type = "secondary",
|
|
@@ -8995,14 +9080,14 @@ var TableRow = React35.memo((props) => {
|
|
|
8995
9080
|
onClick
|
|
8996
9081
|
} = props;
|
|
8997
9082
|
const { rowBorderUse } = useTableContext();
|
|
8998
|
-
const [stickyCells, setStickyCells] =
|
|
9083
|
+
const [stickyCells, setStickyCells] = React36.useState([]);
|
|
8999
9084
|
const registerStickyCell = (ref) => {
|
|
9000
9085
|
setStickyCells((prev) => {
|
|
9001
9086
|
if (prev.includes(ref)) return prev;
|
|
9002
9087
|
return [...prev, ref];
|
|
9003
9088
|
});
|
|
9004
9089
|
};
|
|
9005
|
-
return /* @__PURE__ */
|
|
9090
|
+
return /* @__PURE__ */ jsx343(TableRowContext_default.Provider, { value: { stickyCells, registerStickyCell }, children: /* @__PURE__ */ jsx343(
|
|
9006
9091
|
"tr",
|
|
9007
9092
|
{
|
|
9008
9093
|
className: clsx_default(
|
|
@@ -9020,7 +9105,7 @@ TableRow.displayName = "TableRow";
|
|
|
9020
9105
|
var TableRow_default = TableRow;
|
|
9021
9106
|
|
|
9022
9107
|
// src/components/Tag/Tag.tsx
|
|
9023
|
-
import { jsx as
|
|
9108
|
+
import { jsx as jsx344, jsxs as jsxs219 } from "react/jsx-runtime";
|
|
9024
9109
|
var Tag = (props) => {
|
|
9025
9110
|
const {
|
|
9026
9111
|
children,
|
|
@@ -9030,7 +9115,7 @@ var Tag = (props) => {
|
|
|
9030
9115
|
disabled = false,
|
|
9031
9116
|
colorIndex
|
|
9032
9117
|
} = props;
|
|
9033
|
-
return /* @__PURE__ */
|
|
9118
|
+
return /* @__PURE__ */ jsxs219(
|
|
9034
9119
|
"span",
|
|
9035
9120
|
{
|
|
9036
9121
|
className: clsx_default(
|
|
@@ -9041,8 +9126,8 @@ var Tag = (props) => {
|
|
|
9041
9126
|
disabled && "disabled"
|
|
9042
9127
|
),
|
|
9043
9128
|
children: [
|
|
9044
|
-
/* @__PURE__ */
|
|
9045
|
-
onClose && /* @__PURE__ */
|
|
9129
|
+
/* @__PURE__ */ jsx344("span", { className: "tag-label", children }),
|
|
9130
|
+
onClose && /* @__PURE__ */ jsx344("button", { className: "tag-close", onClick: onClose, "aria-label": "\uC0AD\uC81C", disabled, children: /* @__PURE__ */ jsx344(XIcon_default, {}) })
|
|
9046
9131
|
]
|
|
9047
9132
|
}
|
|
9048
9133
|
);
|
|
@@ -9051,12 +9136,12 @@ Tag.displayName = "Tag";
|
|
|
9051
9136
|
var Tag_default = Tag;
|
|
9052
9137
|
|
|
9053
9138
|
// src/components/TextArea/TextArea.tsx
|
|
9054
|
-
import
|
|
9055
|
-
import { jsx as
|
|
9056
|
-
var TextArea =
|
|
9139
|
+
import React37 from "react";
|
|
9140
|
+
import { jsx as jsx345 } from "react/jsx-runtime";
|
|
9141
|
+
var TextArea = React37.forwardRef(
|
|
9057
9142
|
(props, ref) => {
|
|
9058
9143
|
const { value, onChange, disabled, ...textareaProps } = props;
|
|
9059
|
-
const localRef =
|
|
9144
|
+
const localRef = React37.useRef(null);
|
|
9060
9145
|
const setRefs = (el) => {
|
|
9061
9146
|
localRef.current = el;
|
|
9062
9147
|
if (!ref) return;
|
|
@@ -9076,21 +9161,21 @@ var TextArea = React36.forwardRef(
|
|
|
9076
9161
|
onChange(event);
|
|
9077
9162
|
}
|
|
9078
9163
|
};
|
|
9079
|
-
|
|
9164
|
+
React37.useEffect(() => {
|
|
9080
9165
|
const el = localRef.current;
|
|
9081
9166
|
if (!el) return;
|
|
9082
9167
|
el.style.height = "0px";
|
|
9083
9168
|
const nextHeight = Math.min(el.scrollHeight, 400);
|
|
9084
9169
|
el.style.height = `${nextHeight}px`;
|
|
9085
9170
|
}, [value]);
|
|
9086
|
-
return /* @__PURE__ */
|
|
9171
|
+
return /* @__PURE__ */ jsx345("div", { className: "lib-xplat-textarea-wrapper", children: /* @__PURE__ */ jsx345(
|
|
9087
9172
|
"div",
|
|
9088
9173
|
{
|
|
9089
9174
|
className: clsx_default(
|
|
9090
9175
|
"lib-xplat-textarea",
|
|
9091
9176
|
disabled ? "disabled" : void 0
|
|
9092
9177
|
),
|
|
9093
|
-
children: /* @__PURE__ */
|
|
9178
|
+
children: /* @__PURE__ */ jsx345(
|
|
9094
9179
|
"textarea",
|
|
9095
9180
|
{
|
|
9096
9181
|
...textareaProps,
|
|
@@ -9108,25 +9193,25 @@ TextArea.displayName = "TextArea";
|
|
|
9108
9193
|
var TextArea_default = TextArea;
|
|
9109
9194
|
|
|
9110
9195
|
// src/components/Toast/Toast.tsx
|
|
9111
|
-
import
|
|
9196
|
+
import React38 from "react";
|
|
9112
9197
|
import { createPortal as createPortal3 } from "react-dom";
|
|
9113
|
-
import { jsx as
|
|
9114
|
-
var ToastContext =
|
|
9198
|
+
import { jsx as jsx346, jsxs as jsxs220 } from "react/jsx-runtime";
|
|
9199
|
+
var ToastContext = React38.createContext(null);
|
|
9115
9200
|
var useToast = () => {
|
|
9116
|
-
const ctx =
|
|
9201
|
+
const ctx = React38.useContext(ToastContext);
|
|
9117
9202
|
if (!ctx) throw new Error("useToast must be used within ToastProvider");
|
|
9118
9203
|
return ctx;
|
|
9119
9204
|
};
|
|
9120
9205
|
var EXIT_DURATION = 300;
|
|
9121
9206
|
var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
9122
|
-
const ref =
|
|
9123
|
-
const [height, setHeight] =
|
|
9124
|
-
|
|
9207
|
+
const ref = React38.useRef(null);
|
|
9208
|
+
const [height, setHeight] = React38.useState(void 0);
|
|
9209
|
+
React38.useEffect(() => {
|
|
9125
9210
|
if (ref.current && !isExiting) {
|
|
9126
9211
|
setHeight(ref.current.offsetHeight);
|
|
9127
9212
|
}
|
|
9128
9213
|
}, [isExiting]);
|
|
9129
|
-
return /* @__PURE__ */
|
|
9214
|
+
return /* @__PURE__ */ jsx346(
|
|
9130
9215
|
"div",
|
|
9131
9216
|
{
|
|
9132
9217
|
className: clsx_default("lib-xplat-toast-wrapper", { exit: isExiting }),
|
|
@@ -9134,15 +9219,15 @@ var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
|
9134
9219
|
maxHeight: isExiting ? 0 : height ?? "none",
|
|
9135
9220
|
marginBottom: isExiting ? 0 : void 0
|
|
9136
9221
|
},
|
|
9137
|
-
children: /* @__PURE__ */
|
|
9222
|
+
children: /* @__PURE__ */ jsxs220(
|
|
9138
9223
|
"div",
|
|
9139
9224
|
{
|
|
9140
9225
|
ref,
|
|
9141
9226
|
className: clsx_default("lib-xplat-toast", item.type, { exit: isExiting }),
|
|
9142
9227
|
role: "alert",
|
|
9143
9228
|
children: [
|
|
9144
|
-
/* @__PURE__ */
|
|
9145
|
-
/* @__PURE__ */
|
|
9229
|
+
/* @__PURE__ */ jsx346("span", { className: "message", children: item.message }),
|
|
9230
|
+
/* @__PURE__ */ jsx346("button", { className: "close-btn", onClick: onClose, "aria-label": "\uB2EB\uAE30", children: "\xD7" })
|
|
9146
9231
|
]
|
|
9147
9232
|
}
|
|
9148
9233
|
)
|
|
@@ -9153,13 +9238,13 @@ var ToastProvider = ({
|
|
|
9153
9238
|
children,
|
|
9154
9239
|
position = "top-right"
|
|
9155
9240
|
}) => {
|
|
9156
|
-
const [toasts, setToasts] =
|
|
9157
|
-
const [removing, setRemoving] =
|
|
9158
|
-
const [mounted, setMounted] =
|
|
9159
|
-
|
|
9241
|
+
const [toasts, setToasts] = React38.useState([]);
|
|
9242
|
+
const [removing, setRemoving] = React38.useState(/* @__PURE__ */ new Set());
|
|
9243
|
+
const [mounted, setMounted] = React38.useState(false);
|
|
9244
|
+
React38.useEffect(() => {
|
|
9160
9245
|
setMounted(true);
|
|
9161
9246
|
}, []);
|
|
9162
|
-
const remove =
|
|
9247
|
+
const remove = React38.useCallback((id) => {
|
|
9163
9248
|
setRemoving((prev) => new Set(prev).add(id));
|
|
9164
9249
|
setTimeout(() => {
|
|
9165
9250
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
@@ -9170,7 +9255,7 @@ var ToastProvider = ({
|
|
|
9170
9255
|
});
|
|
9171
9256
|
}, EXIT_DURATION);
|
|
9172
9257
|
}, []);
|
|
9173
|
-
const toast =
|
|
9258
|
+
const toast = React38.useCallback(
|
|
9174
9259
|
(type, message, duration = 3e3) => {
|
|
9175
9260
|
const id = `${Date.now()}-${Math.random()}`;
|
|
9176
9261
|
setToasts((prev) => [...prev, { id, type, message }]);
|
|
@@ -9180,10 +9265,10 @@ var ToastProvider = ({
|
|
|
9180
9265
|
},
|
|
9181
9266
|
[remove]
|
|
9182
9267
|
);
|
|
9183
|
-
return /* @__PURE__ */
|
|
9268
|
+
return /* @__PURE__ */ jsxs220(ToastContext.Provider, { value: { toast }, children: [
|
|
9184
9269
|
children,
|
|
9185
9270
|
mounted && createPortal3(
|
|
9186
|
-
/* @__PURE__ */
|
|
9271
|
+
/* @__PURE__ */ jsx346("div", { className: clsx_default("lib-xplat-toast-container", position), children: toasts.map((t) => /* @__PURE__ */ jsx346(
|
|
9187
9272
|
ToastItemComponent,
|
|
9188
9273
|
{
|
|
9189
9274
|
item: t,
|
|
@@ -9199,29 +9284,29 @@ var ToastProvider = ({
|
|
|
9199
9284
|
ToastProvider.displayName = "ToastProvider";
|
|
9200
9285
|
|
|
9201
9286
|
// src/components/Tooltip/Tooltip.tsx
|
|
9202
|
-
import
|
|
9203
|
-
import { jsx as
|
|
9287
|
+
import React39 from "react";
|
|
9288
|
+
import { jsx as jsx347, jsxs as jsxs221 } from "react/jsx-runtime";
|
|
9204
9289
|
var Tooltip = (props) => {
|
|
9205
9290
|
const {
|
|
9206
9291
|
type = "primary",
|
|
9207
9292
|
description,
|
|
9208
9293
|
children
|
|
9209
9294
|
} = props;
|
|
9210
|
-
const iconRef =
|
|
9211
|
-
return /* @__PURE__ */
|
|
9212
|
-
/* @__PURE__ */
|
|
9213
|
-
/* @__PURE__ */
|
|
9295
|
+
const iconRef = React39.useRef(null);
|
|
9296
|
+
return /* @__PURE__ */ jsxs221("div", { className: "lib-xplat-tooltip", children: [
|
|
9297
|
+
/* @__PURE__ */ jsx347("div", { className: "tooltip-content", ref: iconRef, children: children || "Tooltip" }),
|
|
9298
|
+
/* @__PURE__ */ jsx347("div", { className: clsx_default("tooltip-wrapper", type), children: description })
|
|
9214
9299
|
] });
|
|
9215
9300
|
};
|
|
9216
9301
|
Tooltip.displayName = "Tooltip";
|
|
9217
9302
|
var Tooltip_default = Tooltip;
|
|
9218
9303
|
|
|
9219
9304
|
// src/components/Video/Video.tsx
|
|
9220
|
-
import
|
|
9221
|
-
import { jsx as
|
|
9222
|
-
var PipIcon = () => /* @__PURE__ */
|
|
9223
|
-
/* @__PURE__ */
|
|
9224
|
-
/* @__PURE__ */
|
|
9305
|
+
import React40 from "react";
|
|
9306
|
+
import { jsx as jsx348, jsxs as jsxs222 } from "react/jsx-runtime";
|
|
9307
|
+
var PipIcon = () => /* @__PURE__ */ jsxs222("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
9308
|
+
/* @__PURE__ */ jsx348("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
|
|
9309
|
+
/* @__PURE__ */ jsx348("rect", { x: "12", y: "11", width: "7", height: "6", rx: "1", fill: "currentColor" })
|
|
9225
9310
|
] });
|
|
9226
9311
|
var formatTime = (sec) => {
|
|
9227
9312
|
if (!Number.isFinite(sec) || sec < 0) return "0:00";
|
|
@@ -9229,7 +9314,7 @@ var formatTime = (sec) => {
|
|
|
9229
9314
|
const s = Math.floor(sec % 60);
|
|
9230
9315
|
return `${m}:${s.toString().padStart(2, "0")}`;
|
|
9231
9316
|
};
|
|
9232
|
-
var Video =
|
|
9317
|
+
var Video = React40.forwardRef((props, ref) => {
|
|
9233
9318
|
const {
|
|
9234
9319
|
src,
|
|
9235
9320
|
poster,
|
|
@@ -9253,21 +9338,21 @@ var Video = React39.forwardRef((props, ref) => {
|
|
|
9253
9338
|
children,
|
|
9254
9339
|
...rest
|
|
9255
9340
|
} = props;
|
|
9256
|
-
const containerRef =
|
|
9257
|
-
const videoRef =
|
|
9258
|
-
const [isPlaying, setIsPlaying] =
|
|
9259
|
-
const [isLoaded, setIsLoaded] =
|
|
9260
|
-
const [currentTime, setCurrentTime] =
|
|
9261
|
-
const [duration, setDuration] =
|
|
9262
|
-
const [buffered, setBuffered] =
|
|
9263
|
-
const [volume, setVolume] =
|
|
9264
|
-
const [isMuted, setIsMuted] =
|
|
9265
|
-
const [isFullscreen, setIsFullscreen] =
|
|
9266
|
-
const [playbackRate, setPlaybackRate] =
|
|
9267
|
-
const [rateMenuOpen, setRateMenuOpen] =
|
|
9268
|
-
const [captionsOn, setCaptionsOn] =
|
|
9269
|
-
const [isPip, setIsPip] =
|
|
9270
|
-
const setRefs =
|
|
9341
|
+
const containerRef = React40.useRef(null);
|
|
9342
|
+
const videoRef = React40.useRef(null);
|
|
9343
|
+
const [isPlaying, setIsPlaying] = React40.useState(Boolean(autoPlay));
|
|
9344
|
+
const [isLoaded, setIsLoaded] = React40.useState(false);
|
|
9345
|
+
const [currentTime, setCurrentTime] = React40.useState(0);
|
|
9346
|
+
const [duration, setDuration] = React40.useState(0);
|
|
9347
|
+
const [buffered, setBuffered] = React40.useState(0);
|
|
9348
|
+
const [volume, setVolume] = React40.useState(1);
|
|
9349
|
+
const [isMuted, setIsMuted] = React40.useState(Boolean(muted));
|
|
9350
|
+
const [isFullscreen, setIsFullscreen] = React40.useState(false);
|
|
9351
|
+
const [playbackRate, setPlaybackRate] = React40.useState(1);
|
|
9352
|
+
const [rateMenuOpen, setRateMenuOpen] = React40.useState(false);
|
|
9353
|
+
const [captionsOn, setCaptionsOn] = React40.useState(false);
|
|
9354
|
+
const [isPip, setIsPip] = React40.useState(false);
|
|
9355
|
+
const setRefs = React40.useCallback(
|
|
9271
9356
|
(el) => {
|
|
9272
9357
|
videoRef.current = el;
|
|
9273
9358
|
if (typeof ref === "function") ref(el);
|
|
@@ -9275,14 +9360,14 @@ var Video = React39.forwardRef((props, ref) => {
|
|
|
9275
9360
|
},
|
|
9276
9361
|
[ref]
|
|
9277
9362
|
);
|
|
9278
|
-
|
|
9363
|
+
React40.useEffect(() => {
|
|
9279
9364
|
const onFsChange = () => {
|
|
9280
9365
|
setIsFullscreen(document.fullscreenElement === containerRef.current);
|
|
9281
9366
|
};
|
|
9282
9367
|
document.addEventListener("fullscreenchange", onFsChange);
|
|
9283
9368
|
return () => document.removeEventListener("fullscreenchange", onFsChange);
|
|
9284
9369
|
}, []);
|
|
9285
|
-
|
|
9370
|
+
React40.useEffect(() => {
|
|
9286
9371
|
const v = videoRef.current;
|
|
9287
9372
|
if (!v) return;
|
|
9288
9373
|
const onEnter = () => setIsPip(true);
|
|
@@ -9396,13 +9481,13 @@ var Video = React39.forwardRef((props, ref) => {
|
|
|
9396
9481
|
const volumePct = (isMuted ? 0 : volume) * 100;
|
|
9397
9482
|
const VolumeGlyph = isMuted || volume === 0 ? VolumeXIcon_default : volume < 0.5 ? VolumeIcon_default : Volume2Icon_default;
|
|
9398
9483
|
const pipSupported = typeof document !== "undefined" && "pictureInPictureEnabled" in document && document.pictureInPictureEnabled;
|
|
9399
|
-
return /* @__PURE__ */
|
|
9484
|
+
return /* @__PURE__ */ jsxs222(
|
|
9400
9485
|
"div",
|
|
9401
9486
|
{
|
|
9402
9487
|
ref: containerRef,
|
|
9403
9488
|
className: clsx_default("lib-xplat-video", showControls && "has-controls"),
|
|
9404
9489
|
children: [
|
|
9405
|
-
/* @__PURE__ */
|
|
9490
|
+
/* @__PURE__ */ jsx348(
|
|
9406
9491
|
"video",
|
|
9407
9492
|
{
|
|
9408
9493
|
ref: setRefs,
|
|
@@ -9423,7 +9508,7 @@ var Video = React39.forwardRef((props, ref) => {
|
|
|
9423
9508
|
children
|
|
9424
9509
|
}
|
|
9425
9510
|
),
|
|
9426
|
-
showCenterPlay && /* @__PURE__ */
|
|
9511
|
+
showCenterPlay && /* @__PURE__ */ jsx348(
|
|
9427
9512
|
"button",
|
|
9428
9513
|
{
|
|
9429
9514
|
type: "button",
|
|
@@ -9435,11 +9520,11 @@ var Video = React39.forwardRef((props, ref) => {
|
|
|
9435
9520
|
onClick: togglePlay,
|
|
9436
9521
|
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
9437
9522
|
tabIndex: -1,
|
|
9438
|
-
children: /* @__PURE__ */
|
|
9523
|
+
children: /* @__PURE__ */ jsx348("span", { className: "center-play-icon", children: /* @__PURE__ */ jsx348(PlayCircleIcon_default, {}) })
|
|
9439
9524
|
}
|
|
9440
9525
|
),
|
|
9441
|
-
showControls && /* @__PURE__ */
|
|
9442
|
-
/* @__PURE__ */
|
|
9526
|
+
showControls && /* @__PURE__ */ jsxs222("div", { className: "controls", onClick: (e) => e.stopPropagation(), children: [
|
|
9527
|
+
/* @__PURE__ */ jsx348(
|
|
9443
9528
|
"input",
|
|
9444
9529
|
{
|
|
9445
9530
|
type: "range",
|
|
@@ -9456,29 +9541,29 @@ var Video = React39.forwardRef((props, ref) => {
|
|
|
9456
9541
|
}
|
|
9457
9542
|
}
|
|
9458
9543
|
),
|
|
9459
|
-
/* @__PURE__ */
|
|
9460
|
-
/* @__PURE__ */
|
|
9544
|
+
/* @__PURE__ */ jsxs222("div", { className: "controls-row", children: [
|
|
9545
|
+
/* @__PURE__ */ jsx348(
|
|
9461
9546
|
"button",
|
|
9462
9547
|
{
|
|
9463
9548
|
type: "button",
|
|
9464
9549
|
className: "control-btn",
|
|
9465
9550
|
onClick: togglePlay,
|
|
9466
9551
|
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
9467
|
-
children: isPlaying ? /* @__PURE__ */
|
|
9552
|
+
children: isPlaying ? /* @__PURE__ */ jsx348(PauseIcon_default, {}) : /* @__PURE__ */ jsx348(PlayIcon_default, {})
|
|
9468
9553
|
}
|
|
9469
9554
|
),
|
|
9470
|
-
/* @__PURE__ */
|
|
9471
|
-
/* @__PURE__ */
|
|
9555
|
+
/* @__PURE__ */ jsxs222("div", { className: "volume-group", children: [
|
|
9556
|
+
/* @__PURE__ */ jsx348(
|
|
9472
9557
|
"button",
|
|
9473
9558
|
{
|
|
9474
9559
|
type: "button",
|
|
9475
9560
|
className: "control-btn",
|
|
9476
9561
|
onClick: toggleMute,
|
|
9477
9562
|
"aria-label": isMuted ? "\uC74C\uC18C\uAC70 \uD574\uC81C" : "\uC74C\uC18C\uAC70",
|
|
9478
|
-
children: /* @__PURE__ */
|
|
9563
|
+
children: /* @__PURE__ */ jsx348(VolumeGlyph, {})
|
|
9479
9564
|
}
|
|
9480
9565
|
),
|
|
9481
|
-
/* @__PURE__ */
|
|
9566
|
+
/* @__PURE__ */ jsx348(
|
|
9482
9567
|
"input",
|
|
9483
9568
|
{
|
|
9484
9569
|
type: "range",
|
|
@@ -9493,14 +9578,14 @@ var Video = React39.forwardRef((props, ref) => {
|
|
|
9493
9578
|
}
|
|
9494
9579
|
)
|
|
9495
9580
|
] }),
|
|
9496
|
-
/* @__PURE__ */
|
|
9581
|
+
/* @__PURE__ */ jsxs222("span", { className: "time", children: [
|
|
9497
9582
|
formatTime(currentTime),
|
|
9498
9583
|
" / ",
|
|
9499
9584
|
formatTime(duration)
|
|
9500
9585
|
] }),
|
|
9501
|
-
/* @__PURE__ */
|
|
9502
|
-
playbackRates && playbackRates.length > 0 && /* @__PURE__ */
|
|
9503
|
-
/* @__PURE__ */
|
|
9586
|
+
/* @__PURE__ */ jsx348("div", { className: "controls-spacer" }),
|
|
9587
|
+
playbackRates && playbackRates.length > 0 && /* @__PURE__ */ jsxs222("div", { className: clsx_default("rate-group", rateMenuOpen && "is-open"), children: [
|
|
9588
|
+
/* @__PURE__ */ jsxs222(
|
|
9504
9589
|
"button",
|
|
9505
9590
|
{
|
|
9506
9591
|
type: "button",
|
|
@@ -9514,7 +9599,7 @@ var Video = React39.forwardRef((props, ref) => {
|
|
|
9514
9599
|
]
|
|
9515
9600
|
}
|
|
9516
9601
|
),
|
|
9517
|
-
rateMenuOpen && /* @__PURE__ */
|
|
9602
|
+
rateMenuOpen && /* @__PURE__ */ jsx348("ul", { className: "rate-menu", role: "menu", children: playbackRates.map((r2) => /* @__PURE__ */ jsx348("li", { children: /* @__PURE__ */ jsxs222(
|
|
9518
9603
|
"button",
|
|
9519
9604
|
{
|
|
9520
9605
|
type: "button",
|
|
@@ -9528,7 +9613,7 @@ var Video = React39.forwardRef((props, ref) => {
|
|
|
9528
9613
|
}
|
|
9529
9614
|
) }, r2)) })
|
|
9530
9615
|
] }),
|
|
9531
|
-
showCaptions && /* @__PURE__ */
|
|
9616
|
+
showCaptions && /* @__PURE__ */ jsx348(
|
|
9532
9617
|
"button",
|
|
9533
9618
|
{
|
|
9534
9619
|
type: "button",
|
|
@@ -9536,37 +9621,37 @@ var Video = React39.forwardRef((props, ref) => {
|
|
|
9536
9621
|
onClick: toggleCaptions,
|
|
9537
9622
|
"aria-label": captionsOn ? "\uC790\uB9C9 \uB044\uAE30" : "\uC790\uB9C9 \uCF1C\uAE30",
|
|
9538
9623
|
"aria-pressed": captionsOn,
|
|
9539
|
-
children: /* @__PURE__ */
|
|
9624
|
+
children: /* @__PURE__ */ jsx348(TypeIcon_default, {})
|
|
9540
9625
|
}
|
|
9541
9626
|
),
|
|
9542
|
-
showPip && pipSupported && /* @__PURE__ */
|
|
9627
|
+
showPip && pipSupported && /* @__PURE__ */ jsx348(
|
|
9543
9628
|
"button",
|
|
9544
9629
|
{
|
|
9545
9630
|
type: "button",
|
|
9546
9631
|
className: clsx_default("control-btn", isPip && "is-active"),
|
|
9547
9632
|
onClick: togglePip,
|
|
9548
9633
|
"aria-label": isPip ? "PIP \uC885\uB8CC" : "PIP",
|
|
9549
|
-
children: /* @__PURE__ */
|
|
9634
|
+
children: /* @__PURE__ */ jsx348(PipIcon, {})
|
|
9550
9635
|
}
|
|
9551
9636
|
),
|
|
9552
|
-
showDownload && /* @__PURE__ */
|
|
9637
|
+
showDownload && /* @__PURE__ */ jsx348(
|
|
9553
9638
|
"a",
|
|
9554
9639
|
{
|
|
9555
9640
|
className: "control-btn",
|
|
9556
9641
|
href: src,
|
|
9557
9642
|
download: downloadFileName ?? true,
|
|
9558
9643
|
"aria-label": "\uB2E4\uC6B4\uB85C\uB4DC",
|
|
9559
|
-
children: /* @__PURE__ */
|
|
9644
|
+
children: /* @__PURE__ */ jsx348(DownloadIcon_default, {})
|
|
9560
9645
|
}
|
|
9561
9646
|
),
|
|
9562
|
-
/* @__PURE__ */
|
|
9647
|
+
/* @__PURE__ */ jsx348(
|
|
9563
9648
|
"button",
|
|
9564
9649
|
{
|
|
9565
9650
|
type: "button",
|
|
9566
9651
|
className: "control-btn",
|
|
9567
9652
|
onClick: toggleFullscreen,
|
|
9568
9653
|
"aria-label": isFullscreen ? "\uC804\uCCB4\uD654\uBA74 \uC885\uB8CC" : "\uC804\uCCB4\uD654\uBA74",
|
|
9569
|
-
children: isFullscreen ? /* @__PURE__ */
|
|
9654
|
+
children: isFullscreen ? /* @__PURE__ */ jsx348(MinimizeIcon_default, {}) : /* @__PURE__ */ jsx348(MaximizeIcon_default, {})
|
|
9570
9655
|
}
|
|
9571
9656
|
)
|
|
9572
9657
|
] })
|
|
@@ -9579,7 +9664,7 @@ Video.displayName = "Video";
|
|
|
9579
9664
|
var Video_default = Video;
|
|
9580
9665
|
|
|
9581
9666
|
// src/layout/Grid/FullGrid/FullGrid.tsx
|
|
9582
|
-
import { jsx as
|
|
9667
|
+
import { jsx as jsx349 } from "react/jsx-runtime";
|
|
9583
9668
|
var GAP_MAP = {
|
|
9584
9669
|
none: "var(--spacing-space-none)",
|
|
9585
9670
|
xs: "var(--spacing-space-1)",
|
|
@@ -9592,13 +9677,13 @@ var GAP_MAP = {
|
|
|
9592
9677
|
var FullGrid = (props) => {
|
|
9593
9678
|
const { children, gap } = props;
|
|
9594
9679
|
const style = gap != null ? { gap: GAP_MAP[gap] } : void 0;
|
|
9595
|
-
return /* @__PURE__ */
|
|
9680
|
+
return /* @__PURE__ */ jsx349("div", { className: "lib-xplat-full-grid", style, children });
|
|
9596
9681
|
};
|
|
9597
9682
|
FullGrid.displayName = "FullGrid";
|
|
9598
9683
|
var FullGrid_default = FullGrid;
|
|
9599
9684
|
|
|
9600
9685
|
// src/layout/Grid/FullScreen/FullScreen.tsx
|
|
9601
|
-
import { jsx as
|
|
9686
|
+
import { jsx as jsx350 } from "react/jsx-runtime";
|
|
9602
9687
|
var GAP_MAP2 = {
|
|
9603
9688
|
none: "var(--spacing-space-none)",
|
|
9604
9689
|
xs: "var(--spacing-space-1)",
|
|
@@ -9611,13 +9696,13 @@ var GAP_MAP2 = {
|
|
|
9611
9696
|
var FullScreen = (props) => {
|
|
9612
9697
|
const { children, gap } = props;
|
|
9613
9698
|
const style = gap != null ? { gap: GAP_MAP2[gap] } : void 0;
|
|
9614
|
-
return /* @__PURE__ */
|
|
9699
|
+
return /* @__PURE__ */ jsx350("div", { className: "lib-xplat-full-screen", style, children });
|
|
9615
9700
|
};
|
|
9616
9701
|
FullScreen.displayName = "FullScreen";
|
|
9617
9702
|
var FullScreen_default = FullScreen;
|
|
9618
9703
|
|
|
9619
9704
|
// src/layout/Grid/Item/Item.tsx
|
|
9620
|
-
import { jsx as
|
|
9705
|
+
import { jsx as jsx351 } from "react/jsx-runtime";
|
|
9621
9706
|
var calculateSpans = (column) => {
|
|
9622
9707
|
const spans = {};
|
|
9623
9708
|
let inherited = column.default;
|
|
@@ -9634,35 +9719,35 @@ var GridItem = ({ column, children, className }) => {
|
|
|
9634
9719
|
Object.entries(spans).forEach(([key, value]) => {
|
|
9635
9720
|
style[`--column-${key}`] = value;
|
|
9636
9721
|
});
|
|
9637
|
-
return /* @__PURE__ */
|
|
9722
|
+
return /* @__PURE__ */ jsx351("div", { className: clsx_default("lib-xplat-grid-item", className), style, children });
|
|
9638
9723
|
};
|
|
9639
9724
|
GridItem.displayName = "GridItem";
|
|
9640
9725
|
var Item_default = GridItem;
|
|
9641
9726
|
|
|
9642
9727
|
// src/layout/Header/Header.tsx
|
|
9643
|
-
import { jsx as
|
|
9728
|
+
import { jsx as jsx352, jsxs as jsxs223 } from "react/jsx-runtime";
|
|
9644
9729
|
var Header = ({
|
|
9645
9730
|
logo,
|
|
9646
9731
|
centerContent,
|
|
9647
9732
|
rightContent
|
|
9648
9733
|
}) => {
|
|
9649
|
-
return /* @__PURE__ */
|
|
9650
|
-
/* @__PURE__ */
|
|
9651
|
-
/* @__PURE__ */
|
|
9652
|
-
/* @__PURE__ */
|
|
9734
|
+
return /* @__PURE__ */ jsxs223("div", { className: "lib-xplat-layout-header", children: [
|
|
9735
|
+
/* @__PURE__ */ jsx352("div", { children: logo }),
|
|
9736
|
+
/* @__PURE__ */ jsx352("div", { children: centerContent }),
|
|
9737
|
+
/* @__PURE__ */ jsx352("div", { children: rightContent })
|
|
9653
9738
|
] });
|
|
9654
9739
|
};
|
|
9655
9740
|
Header.displayName = "Header";
|
|
9656
9741
|
var Header_default = Header;
|
|
9657
9742
|
|
|
9658
9743
|
// src/layout/Layout/Layout.tsx
|
|
9659
|
-
import { Fragment as Fragment5, jsx as
|
|
9744
|
+
import { Fragment as Fragment5, jsx as jsx353, jsxs as jsxs224 } from "react/jsx-runtime";
|
|
9660
9745
|
var Layout = (props) => {
|
|
9661
9746
|
const { header, sideBar, children } = props;
|
|
9662
|
-
return /* @__PURE__ */
|
|
9663
|
-
sideBar && /* @__PURE__ */
|
|
9664
|
-
/* @__PURE__ */
|
|
9665
|
-
header && /* @__PURE__ */
|
|
9747
|
+
return /* @__PURE__ */ jsx353("div", { className: "lib-xplat-layout", children: /* @__PURE__ */ jsxs224("div", { className: "lib-xplat-layout-content-wrapper", children: [
|
|
9748
|
+
sideBar && /* @__PURE__ */ jsx353(Fragment5, { children: sideBar }),
|
|
9749
|
+
/* @__PURE__ */ jsxs224("div", { className: "lib-xplat-layout-content", children: [
|
|
9750
|
+
header && /* @__PURE__ */ jsx353("div", { className: "lib-xplat-layout-conent-header", children: header }),
|
|
9666
9751
|
children
|
|
9667
9752
|
] })
|
|
9668
9753
|
] }) });
|
|
@@ -9671,31 +9756,31 @@ Layout.displayName = "Layout";
|
|
|
9671
9756
|
var Layout_default = Layout;
|
|
9672
9757
|
|
|
9673
9758
|
// src/layout/SideBar/SideBar.tsx
|
|
9674
|
-
import
|
|
9759
|
+
import React42 from "react";
|
|
9675
9760
|
|
|
9676
9761
|
// src/layout/SideBar/SideBarContext.tsx
|
|
9677
|
-
import
|
|
9678
|
-
var SideBarContext =
|
|
9762
|
+
import React41 from "react";
|
|
9763
|
+
var SideBarContext = React41.createContext(null);
|
|
9679
9764
|
var useSideBarContext = () => {
|
|
9680
|
-
const ctx =
|
|
9765
|
+
const ctx = React41.useContext(SideBarContext);
|
|
9681
9766
|
if (!ctx) throw new Error("Error");
|
|
9682
9767
|
return ctx;
|
|
9683
9768
|
};
|
|
9684
9769
|
var SideBarContext_default = SideBarContext;
|
|
9685
9770
|
|
|
9686
9771
|
// src/layout/SideBar/SideBar.tsx
|
|
9687
|
-
import { jsx as
|
|
9772
|
+
import { jsx as jsx354 } from "react/jsx-runtime";
|
|
9688
9773
|
var SideBar = (props) => {
|
|
9689
9774
|
const { children, className } = props;
|
|
9690
|
-
const [isOpen, setIsOpen] =
|
|
9775
|
+
const [isOpen, setIsOpen] = React42.useState(true);
|
|
9691
9776
|
const handleSwitchSideBar = () => {
|
|
9692
9777
|
setIsOpen((prev) => !prev);
|
|
9693
9778
|
};
|
|
9694
|
-
return /* @__PURE__ */
|
|
9779
|
+
return /* @__PURE__ */ jsx354(
|
|
9695
9780
|
SideBarContext_default.Provider,
|
|
9696
9781
|
{
|
|
9697
9782
|
value: { isSidebarOpen: isOpen, handleSwitchSideBar },
|
|
9698
|
-
children: /* @__PURE__ */
|
|
9783
|
+
children: /* @__PURE__ */ jsx354(
|
|
9699
9784
|
"div",
|
|
9700
9785
|
{
|
|
9701
9786
|
className: clsx_default(
|
|
@@ -9774,6 +9859,7 @@ export {
|
|
|
9774
9859
|
CardTab_default as CardTab,
|
|
9775
9860
|
CastIcon_default as CastIcon,
|
|
9776
9861
|
Chart_default as Chart,
|
|
9862
|
+
ChatInput_default as ChatInput,
|
|
9777
9863
|
CheckBox_default as CheckBox,
|
|
9778
9864
|
CheckCircleIcon_default as CheckCircleIcon,
|
|
9779
9865
|
CheckIcon_default as CheckIcon,
|