@x-plat/design-system 0.5.20 → 0.5.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Chart/index.cjs +58 -29
- package/dist/components/Chart/index.css +2 -15
- package/dist/components/Chart/index.js +58 -29
- package/dist/components/ChatInput/index.cjs +214 -0
- package/dist/components/ChatInput/index.css +133 -0
- package/dist/components/ChatInput/index.d.cts +14 -0
- package/dist/components/ChatInput/index.d.ts +14 -0
- package/dist/components/ChatInput/index.js +177 -0
- package/dist/components/Dropdown/index.cjs +9 -0
- package/dist/components/Dropdown/index.js +9 -0
- package/dist/components/PopOver/index.cjs +9 -0
- package/dist/components/PopOver/index.js +9 -0
- package/dist/components/Select/index.cjs +9 -0
- package/dist/components/Select/index.js +9 -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 +715 -595
- package/dist/components/index.css +253 -61
- package/dist/components/index.d.cts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +713 -594
- package/dist/index.cjs +724 -619
- package/dist/index.css +253 -61
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +722 -618
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6035,30 +6035,151 @@ var Calendar = (props) => {
|
|
|
6035
6035
|
Calendar.displayName = "Calendar";
|
|
6036
6036
|
var Calendar_default = Calendar;
|
|
6037
6037
|
|
|
6038
|
+
// src/components/ChatInput/ChatInput.tsx
|
|
6039
|
+
import React5 from "react";
|
|
6040
|
+
|
|
6041
|
+
// src/components/TextArea/TextArea.tsx
|
|
6042
|
+
import React4 from "react";
|
|
6043
|
+
import { jsx as jsx302 } from "react/jsx-runtime";
|
|
6044
|
+
var TextArea = React4.forwardRef(
|
|
6045
|
+
(props, ref) => {
|
|
6046
|
+
const { value, onChange, disabled, ...textareaProps } = props;
|
|
6047
|
+
const localRef = React4.useRef(null);
|
|
6048
|
+
const setRefs = (el) => {
|
|
6049
|
+
localRef.current = el;
|
|
6050
|
+
if (!ref) return;
|
|
6051
|
+
if (typeof ref === "function") {
|
|
6052
|
+
ref(el);
|
|
6053
|
+
} else if (ref && typeof ref === "object" && "current" in ref) {
|
|
6054
|
+
ref.current = el;
|
|
6055
|
+
}
|
|
6056
|
+
};
|
|
6057
|
+
const handleOnChange = (e) => {
|
|
6058
|
+
const val = e.target.value;
|
|
6059
|
+
if (onChange) {
|
|
6060
|
+
const event = {
|
|
6061
|
+
...e,
|
|
6062
|
+
target: { value: val }
|
|
6063
|
+
};
|
|
6064
|
+
onChange(event);
|
|
6065
|
+
}
|
|
6066
|
+
};
|
|
6067
|
+
React4.useEffect(() => {
|
|
6068
|
+
const el = localRef.current;
|
|
6069
|
+
if (!el) return;
|
|
6070
|
+
el.style.height = "0px";
|
|
6071
|
+
const nextHeight = Math.min(el.scrollHeight, 400);
|
|
6072
|
+
el.style.height = `${nextHeight}px`;
|
|
6073
|
+
}, [value]);
|
|
6074
|
+
return /* @__PURE__ */ jsx302("div", { className: "lib-xplat-textarea-wrapper", children: /* @__PURE__ */ jsx302(
|
|
6075
|
+
"div",
|
|
6076
|
+
{
|
|
6077
|
+
className: clsx_default(
|
|
6078
|
+
"lib-xplat-textarea",
|
|
6079
|
+
disabled ? "disabled" : void 0
|
|
6080
|
+
),
|
|
6081
|
+
children: /* @__PURE__ */ jsx302(
|
|
6082
|
+
"textarea",
|
|
6083
|
+
{
|
|
6084
|
+
...textareaProps,
|
|
6085
|
+
ref: setRefs,
|
|
6086
|
+
disabled,
|
|
6087
|
+
value,
|
|
6088
|
+
onChange: handleOnChange
|
|
6089
|
+
}
|
|
6090
|
+
)
|
|
6091
|
+
}
|
|
6092
|
+
) });
|
|
6093
|
+
}
|
|
6094
|
+
);
|
|
6095
|
+
TextArea.displayName = "TextArea";
|
|
6096
|
+
var TextArea_default = TextArea;
|
|
6097
|
+
|
|
6098
|
+
// src/components/ChatInput/ChatInput.tsx
|
|
6099
|
+
import { jsx as jsx303, jsxs as jsxs194 } from "react/jsx-runtime";
|
|
6100
|
+
var ChatInput = React5.forwardRef(
|
|
6101
|
+
(props, ref) => {
|
|
6102
|
+
const {
|
|
6103
|
+
placeholder,
|
|
6104
|
+
value: valueProp,
|
|
6105
|
+
disabled = false,
|
|
6106
|
+
buttonType = "primary",
|
|
6107
|
+
onSubmit,
|
|
6108
|
+
onChange
|
|
6109
|
+
} = props;
|
|
6110
|
+
const isControlled = valueProp !== void 0;
|
|
6111
|
+
const [internalValue, setInternalValue] = React5.useState("");
|
|
6112
|
+
const value = isControlled ? valueProp : internalValue;
|
|
6113
|
+
const hasText = value.trim().length > 0;
|
|
6114
|
+
const handleChange = (e) => {
|
|
6115
|
+
const val = e.target.value;
|
|
6116
|
+
if (!isControlled) setInternalValue(val);
|
|
6117
|
+
onChange?.(val);
|
|
6118
|
+
};
|
|
6119
|
+
const handleSubmit = () => {
|
|
6120
|
+
if (!hasText || disabled) return;
|
|
6121
|
+
onSubmit?.(value);
|
|
6122
|
+
if (!isControlled) setInternalValue("");
|
|
6123
|
+
};
|
|
6124
|
+
const handleKeyDown = (e) => {
|
|
6125
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
6126
|
+
e.preventDefault();
|
|
6127
|
+
handleSubmit();
|
|
6128
|
+
}
|
|
6129
|
+
};
|
|
6130
|
+
return /* @__PURE__ */ jsxs194("div", { className: clsx_default("lib-xplat-chat-input", disabled && "disabled"), children: [
|
|
6131
|
+
/* @__PURE__ */ jsx303(
|
|
6132
|
+
TextArea_default,
|
|
6133
|
+
{
|
|
6134
|
+
ref,
|
|
6135
|
+
placeholder,
|
|
6136
|
+
value,
|
|
6137
|
+
disabled,
|
|
6138
|
+
onChange: handleChange,
|
|
6139
|
+
onKeyDown: handleKeyDown
|
|
6140
|
+
}
|
|
6141
|
+
),
|
|
6142
|
+
/* @__PURE__ */ jsx303(
|
|
6143
|
+
"button",
|
|
6144
|
+
{
|
|
6145
|
+
type: "button",
|
|
6146
|
+
className: clsx_default("chat-input-send", `btn-${buttonType}`),
|
|
6147
|
+
disabled: !hasText || disabled,
|
|
6148
|
+
onClick: handleSubmit,
|
|
6149
|
+
"aria-label": "\uC804\uC1A1",
|
|
6150
|
+
children: /* @__PURE__ */ jsx303(SendIcon_default, {})
|
|
6151
|
+
}
|
|
6152
|
+
)
|
|
6153
|
+
] });
|
|
6154
|
+
}
|
|
6155
|
+
);
|
|
6156
|
+
ChatInput.displayName = "ChatInput";
|
|
6157
|
+
var ChatInput_default = ChatInput;
|
|
6158
|
+
|
|
6038
6159
|
// src/components/Box/Box.tsx
|
|
6039
|
-
import { jsx as
|
|
6160
|
+
import { jsx as jsx304, jsxs as jsxs195 } from "react/jsx-runtime";
|
|
6040
6161
|
var Box = ({
|
|
6041
6162
|
children,
|
|
6042
6163
|
title,
|
|
6043
6164
|
variant = "outlined",
|
|
6044
6165
|
padding = "md"
|
|
6045
6166
|
}) => {
|
|
6046
|
-
return /* @__PURE__ */
|
|
6047
|
-
title && /* @__PURE__ */
|
|
6048
|
-
/* @__PURE__ */
|
|
6167
|
+
return /* @__PURE__ */ jsxs195("div", { className: clsx_default("lib-xplat-box", variant, `pad-${padding}`), children: [
|
|
6168
|
+
title && /* @__PURE__ */ jsx304("div", { className: "box-title", children: title }),
|
|
6169
|
+
/* @__PURE__ */ jsx304("div", { className: "box-content", children })
|
|
6049
6170
|
] });
|
|
6050
6171
|
};
|
|
6051
6172
|
Box.displayName = "Box";
|
|
6052
6173
|
var Box_default = Box;
|
|
6053
6174
|
|
|
6054
6175
|
// src/components/CardTab/CardTab.tsx
|
|
6055
|
-
import
|
|
6176
|
+
import React6 from "react";
|
|
6056
6177
|
|
|
6057
6178
|
// src/components/CardTab/CardTabPanel.tsx
|
|
6058
|
-
import { jsx as
|
|
6179
|
+
import { jsx as jsx305 } from "react/jsx-runtime";
|
|
6059
6180
|
var CardTabPanel = (props) => {
|
|
6060
6181
|
const { children, columns = 3 } = props;
|
|
6061
|
-
return /* @__PURE__ */
|
|
6182
|
+
return /* @__PURE__ */ jsx305(
|
|
6062
6183
|
"div",
|
|
6063
6184
|
{
|
|
6064
6185
|
className: "card-tab-panel",
|
|
@@ -6071,7 +6192,7 @@ CardTabPanel.displayName = "CardTab.Panel";
|
|
|
6071
6192
|
var CardTabPanel_default = CardTabPanel;
|
|
6072
6193
|
|
|
6073
6194
|
// src/components/CardTab/CardTab.tsx
|
|
6074
|
-
import { jsx as
|
|
6195
|
+
import { jsx as jsx306, jsxs as jsxs196 } from "react/jsx-runtime";
|
|
6075
6196
|
var CardTabRoot = (props) => {
|
|
6076
6197
|
const {
|
|
6077
6198
|
tabs,
|
|
@@ -6081,7 +6202,7 @@ var CardTabRoot = (props) => {
|
|
|
6081
6202
|
children
|
|
6082
6203
|
} = props;
|
|
6083
6204
|
const isControlled = activeValueProp !== void 0;
|
|
6084
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
6205
|
+
const [uncontrolledValue, setUncontrolledValue] = React6.useState(tabs[0]?.value ?? "");
|
|
6085
6206
|
const activeValue = isControlled ? activeValueProp : uncontrolledValue;
|
|
6086
6207
|
const handleTabClick = (tab) => {
|
|
6087
6208
|
if (!isControlled) {
|
|
@@ -6089,16 +6210,16 @@ var CardTabRoot = (props) => {
|
|
|
6089
6210
|
}
|
|
6090
6211
|
onChange?.(tab);
|
|
6091
6212
|
};
|
|
6092
|
-
const panels =
|
|
6093
|
-
(child) =>
|
|
6213
|
+
const panels = React6.Children.toArray(children).filter(
|
|
6214
|
+
(child) => React6.isValidElement(child) && child.type === CardTabPanel_default
|
|
6094
6215
|
);
|
|
6095
6216
|
const activePanel = panels.find(
|
|
6096
6217
|
(panel) => panel.props.value === activeValue
|
|
6097
6218
|
);
|
|
6098
|
-
return /* @__PURE__ */
|
|
6099
|
-
/* @__PURE__ */
|
|
6219
|
+
return /* @__PURE__ */ jsxs196("div", { className: clsx_default("lib-xplat-card-tab", size), children: [
|
|
6220
|
+
/* @__PURE__ */ jsx306("div", { className: "card-tab-bar", children: tabs.map((tab) => {
|
|
6100
6221
|
const isActive = tab.value === activeValue;
|
|
6101
|
-
return /* @__PURE__ */
|
|
6222
|
+
return /* @__PURE__ */ jsx306(
|
|
6102
6223
|
"button",
|
|
6103
6224
|
{
|
|
6104
6225
|
className: clsx_default("card-tab-trigger", isActive && "active"),
|
|
@@ -6110,7 +6231,7 @@ var CardTabRoot = (props) => {
|
|
|
6110
6231
|
tab.value
|
|
6111
6232
|
);
|
|
6112
6233
|
}) }),
|
|
6113
|
-
/* @__PURE__ */
|
|
6234
|
+
/* @__PURE__ */ jsx306("div", { className: "card-tab-body", children: activePanel })
|
|
6114
6235
|
] });
|
|
6115
6236
|
};
|
|
6116
6237
|
CardTabRoot.displayName = "CardTab";
|
|
@@ -6120,8 +6241,8 @@ var CardTab = Object.assign(CardTabRoot, {
|
|
|
6120
6241
|
var CardTab_default = CardTab;
|
|
6121
6242
|
|
|
6122
6243
|
// src/components/Chart/Chart.tsx
|
|
6123
|
-
import
|
|
6124
|
-
import { Fragment as Fragment2, jsx as
|
|
6244
|
+
import React7 from "react";
|
|
6245
|
+
import { Fragment as Fragment2, jsx as jsx307, jsxs as jsxs197 } from "react/jsx-runtime";
|
|
6125
6246
|
var CATEGORICAL_COUNT2 = 8;
|
|
6126
6247
|
var LINE_BAR_PALETTES = Array.from({ length: CATEGORICAL_COUNT2 }, (_, i) => {
|
|
6127
6248
|
const n = i + 1;
|
|
@@ -6167,11 +6288,11 @@ var toSmoothPath = (points) => {
|
|
|
6167
6288
|
};
|
|
6168
6289
|
var RESIZE_SETTLE_MS = 150;
|
|
6169
6290
|
var useChartSize = (ref) => {
|
|
6170
|
-
const [size, setSize] =
|
|
6171
|
-
const settleTimer =
|
|
6172
|
-
const committedSize =
|
|
6173
|
-
const initialRef =
|
|
6174
|
-
|
|
6291
|
+
const [size, setSize] = React7.useState({ width: 0, height: 0 });
|
|
6292
|
+
const settleTimer = React7.useRef(0);
|
|
6293
|
+
const committedSize = React7.useRef({ width: 0, height: 0 });
|
|
6294
|
+
const initialRef = React7.useRef(true);
|
|
6295
|
+
React7.useEffect(() => {
|
|
6175
6296
|
const el = ref.current;
|
|
6176
6297
|
if (!el) return;
|
|
6177
6298
|
const observer = new ResizeObserver((entries) => {
|
|
@@ -6213,10 +6334,10 @@ var useChartSize = (ref) => {
|
|
|
6213
6334
|
};
|
|
6214
6335
|
var prefersReducedMotion = () => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
6215
6336
|
var useChartAnimation = (containerRef, dataKey) => {
|
|
6216
|
-
const [animate, setAnimate] =
|
|
6217
|
-
const prevDataKey =
|
|
6218
|
-
const hasAnimated =
|
|
6219
|
-
|
|
6337
|
+
const [animate, setAnimate] = React7.useState(false);
|
|
6338
|
+
const prevDataKey = React7.useRef(dataKey);
|
|
6339
|
+
const hasAnimated = React7.useRef(false);
|
|
6340
|
+
React7.useEffect(() => {
|
|
6220
6341
|
if (prefersReducedMotion()) return;
|
|
6221
6342
|
const el = containerRef.current;
|
|
6222
6343
|
if (!el) return;
|
|
@@ -6232,7 +6353,7 @@ var useChartAnimation = (containerRef, dataKey) => {
|
|
|
6232
6353
|
observer.observe(el);
|
|
6233
6354
|
return () => observer.disconnect();
|
|
6234
6355
|
}, [containerRef]);
|
|
6235
|
-
|
|
6356
|
+
React7.useEffect(() => {
|
|
6236
6357
|
if (dataKey !== prevDataKey.current) {
|
|
6237
6358
|
prevDataKey.current = dataKey;
|
|
6238
6359
|
if (prefersReducedMotion()) return;
|
|
@@ -6243,15 +6364,15 @@ var useChartAnimation = (containerRef, dataKey) => {
|
|
|
6243
6364
|
return animate || prefersReducedMotion();
|
|
6244
6365
|
};
|
|
6245
6366
|
var useChartTooltip = (enabled) => {
|
|
6246
|
-
const [tooltip, setTooltip] =
|
|
6367
|
+
const [tooltip, setTooltip] = React7.useState({
|
|
6247
6368
|
visible: false,
|
|
6248
6369
|
x: 0,
|
|
6249
6370
|
y: 0,
|
|
6250
6371
|
content: ""
|
|
6251
6372
|
});
|
|
6252
|
-
const containerRef =
|
|
6253
|
-
const rafRef =
|
|
6254
|
-
const move =
|
|
6373
|
+
const containerRef = React7.useRef(null);
|
|
6374
|
+
const rafRef = React7.useRef(0);
|
|
6375
|
+
const move = React7.useCallback((e) => {
|
|
6255
6376
|
if (!enabled) return;
|
|
6256
6377
|
const clientX = e.clientX;
|
|
6257
6378
|
const clientY = e.clientY;
|
|
@@ -6266,7 +6387,7 @@ var useChartTooltip = (enabled) => {
|
|
|
6266
6387
|
}));
|
|
6267
6388
|
});
|
|
6268
6389
|
}, [enabled]);
|
|
6269
|
-
const show =
|
|
6390
|
+
const show = React7.useCallback((e, content) => {
|
|
6270
6391
|
if (!enabled) return;
|
|
6271
6392
|
const rect = containerRef.current?.getBoundingClientRect();
|
|
6272
6393
|
if (!rect) return;
|
|
@@ -6277,18 +6398,18 @@ var useChartTooltip = (enabled) => {
|
|
|
6277
6398
|
content
|
|
6278
6399
|
});
|
|
6279
6400
|
}, [enabled]);
|
|
6280
|
-
const hide =
|
|
6401
|
+
const hide = React7.useCallback(() => {
|
|
6281
6402
|
cancelAnimationFrame(rafRef.current);
|
|
6282
6403
|
setTooltip((prev) => ({ ...prev, visible: false }));
|
|
6283
6404
|
}, []);
|
|
6284
6405
|
return { tooltip, show, hide, move, containerRef };
|
|
6285
6406
|
};
|
|
6286
|
-
var GridLines =
|
|
6407
|
+
var GridLines = React7.memo(({ width, height, chartH, maxVal }) => /* @__PURE__ */ jsx307(Fragment2, { children: [0, 0.25, 0.5, 0.75, 1].map((ratio) => {
|
|
6287
6408
|
const y = PADDING.top + (1 - ratio) * chartH;
|
|
6288
6409
|
const val = Math.round(maxVal * ratio);
|
|
6289
|
-
return /* @__PURE__ */
|
|
6290
|
-
/* @__PURE__ */
|
|
6291
|
-
/* @__PURE__ */
|
|
6410
|
+
return /* @__PURE__ */ jsxs197("g", { children: [
|
|
6411
|
+
/* @__PURE__ */ jsx307("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
|
|
6412
|
+
/* @__PURE__ */ jsx307("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
|
|
6292
6413
|
] }, ratio);
|
|
6293
6414
|
}) }));
|
|
6294
6415
|
GridLines.displayName = "GridLines";
|
|
@@ -6298,25 +6419,25 @@ var getLabelStep = (count, chartW) => {
|
|
|
6298
6419
|
if (count <= maxLabels) return 1;
|
|
6299
6420
|
return Math.ceil(count / maxLabels);
|
|
6300
6421
|
};
|
|
6301
|
-
var AxisLabels =
|
|
6422
|
+
var AxisLabels = React7.memo(({ labels, count, chartW, height }) => {
|
|
6302
6423
|
const step = getLabelStep(count, chartW);
|
|
6303
|
-
return /* @__PURE__ */
|
|
6424
|
+
return /* @__PURE__ */ jsx307(Fragment2, { children: labels.map((label, i) => {
|
|
6304
6425
|
if (i % step !== 0) return null;
|
|
6305
6426
|
const x = PADDING.left + i / (count - 1 || 1) * chartW;
|
|
6306
|
-
return /* @__PURE__ */
|
|
6427
|
+
return /* @__PURE__ */ jsx307("text", { x, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
6307
6428
|
}) });
|
|
6308
6429
|
});
|
|
6309
6430
|
AxisLabels.displayName = "AxisLabels";
|
|
6310
|
-
var LineChart =
|
|
6311
|
-
const entries =
|
|
6312
|
-
const maxVal =
|
|
6431
|
+
var LineChart = React7.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
|
|
6432
|
+
const entries = React7.useMemo(() => Object.entries(data), [data]);
|
|
6433
|
+
const maxVal = React7.useMemo(() => {
|
|
6313
6434
|
const allValues = entries.flatMap(([, v]) => v);
|
|
6314
6435
|
return Math.max(...allValues) * 1.2 || 1;
|
|
6315
6436
|
}, [entries]);
|
|
6316
6437
|
const count = labels.length;
|
|
6317
6438
|
const chartW = width - PADDING.left - PADDING.right;
|
|
6318
6439
|
const chartH = height - PADDING.top - PADDING.bottom;
|
|
6319
|
-
const seriesPoints =
|
|
6440
|
+
const seriesPoints = React7.useMemo(
|
|
6320
6441
|
() => entries.map(
|
|
6321
6442
|
([, values]) => values.map((v, i) => ({
|
|
6322
6443
|
x: PADDING.left + i / (count - 1 || 1) * chartW,
|
|
@@ -6327,8 +6448,8 @@ var LineChart = React5.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
6327
6448
|
[entries, count, chartW, chartH, maxVal]
|
|
6328
6449
|
);
|
|
6329
6450
|
const showPoints = count <= 100;
|
|
6330
|
-
const lineRefs =
|
|
6331
|
-
|
|
6451
|
+
const lineRefs = React7.useRef([]);
|
|
6452
|
+
React7.useEffect(() => {
|
|
6332
6453
|
if (!animate) return;
|
|
6333
6454
|
lineRefs.current.forEach((el) => {
|
|
6334
6455
|
if (!el) return;
|
|
@@ -6341,9 +6462,9 @@ var LineChart = React5.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
6341
6462
|
});
|
|
6342
6463
|
});
|
|
6343
6464
|
}, [animate, seriesPoints]);
|
|
6344
|
-
return /* @__PURE__ */
|
|
6345
|
-
/* @__PURE__ */
|
|
6346
|
-
/* @__PURE__ */
|
|
6465
|
+
return /* @__PURE__ */ jsxs197("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
6466
|
+
/* @__PURE__ */ jsx307(GridLines, { width, height, chartH, maxVal }),
|
|
6467
|
+
/* @__PURE__ */ jsx307(AxisLabels, { labels, count, chartW, height }),
|
|
6347
6468
|
entries.map(([key], di) => {
|
|
6348
6469
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
6349
6470
|
const color = palette[2];
|
|
@@ -6352,12 +6473,12 @@ var LineChart = React5.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
6352
6473
|
const gradientId = `line-gradient-${di}`;
|
|
6353
6474
|
const polyPoints = points.map((p) => `${p.x},${p.y}`).join(" ");
|
|
6354
6475
|
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__ */
|
|
6476
|
+
return /* @__PURE__ */ jsxs197("g", { children: [
|
|
6477
|
+
/* @__PURE__ */ jsx307("defs", { children: /* @__PURE__ */ jsxs197("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
6478
|
+
/* @__PURE__ */ jsx307("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.2" }),
|
|
6479
|
+
/* @__PURE__ */ jsx307("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0" })
|
|
6359
6480
|
] }) }),
|
|
6360
|
-
/* @__PURE__ */
|
|
6481
|
+
/* @__PURE__ */ jsx307(
|
|
6361
6482
|
"path",
|
|
6362
6483
|
{
|
|
6363
6484
|
d: areaD,
|
|
@@ -6366,7 +6487,7 @@ var LineChart = React5.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
6366
6487
|
style: animate ? { animationDelay: "600ms" } : { opacity: 1 }
|
|
6367
6488
|
}
|
|
6368
6489
|
),
|
|
6369
|
-
/* @__PURE__ */
|
|
6490
|
+
/* @__PURE__ */ jsx307(
|
|
6370
6491
|
"polyline",
|
|
6371
6492
|
{
|
|
6372
6493
|
ref: (el) => {
|
|
@@ -6378,7 +6499,7 @@ var LineChart = React5.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
6378
6499
|
strokeWidth: "2"
|
|
6379
6500
|
}
|
|
6380
6501
|
),
|
|
6381
|
-
showPoints && points.map((p, i) => /* @__PURE__ */
|
|
6502
|
+
showPoints && points.map((p, i) => /* @__PURE__ */ jsx307(
|
|
6382
6503
|
"circle",
|
|
6383
6504
|
{
|
|
6384
6505
|
cx: p.x,
|
|
@@ -6397,16 +6518,16 @@ var LineChart = React5.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
6397
6518
|
] });
|
|
6398
6519
|
});
|
|
6399
6520
|
LineChart.displayName = "LineChart";
|
|
6400
|
-
var CurveChart =
|
|
6401
|
-
const entries =
|
|
6402
|
-
const maxVal =
|
|
6521
|
+
var CurveChart = React7.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
|
|
6522
|
+
const entries = React7.useMemo(() => Object.entries(data), [data]);
|
|
6523
|
+
const maxVal = React7.useMemo(() => {
|
|
6403
6524
|
const allValues = entries.flatMap(([, v]) => v);
|
|
6404
6525
|
return Math.max(...allValues) * 1.2 || 1;
|
|
6405
6526
|
}, [entries]);
|
|
6406
6527
|
const count = labels.length;
|
|
6407
6528
|
const chartW = width - PADDING.left - PADDING.right;
|
|
6408
6529
|
const chartH = height - PADDING.top - PADDING.bottom;
|
|
6409
|
-
const seriesPoints =
|
|
6530
|
+
const seriesPoints = React7.useMemo(
|
|
6410
6531
|
() => entries.map(
|
|
6411
6532
|
([, values]) => values.map((v, i) => ({
|
|
6412
6533
|
x: PADDING.left + i / (count - 1 || 1) * chartW,
|
|
@@ -6417,8 +6538,8 @@ var CurveChart = React5.memo(({ data, labels, width, height, animate, onHover, o
|
|
|
6417
6538
|
[entries, count, chartW, chartH, maxVal]
|
|
6418
6539
|
);
|
|
6419
6540
|
const showPoints = count <= 100;
|
|
6420
|
-
const lineRefs =
|
|
6421
|
-
|
|
6541
|
+
const lineRefs = React7.useRef([]);
|
|
6542
|
+
React7.useEffect(() => {
|
|
6422
6543
|
if (!animate) return;
|
|
6423
6544
|
lineRefs.current.forEach((el) => {
|
|
6424
6545
|
if (!el) return;
|
|
@@ -6431,9 +6552,9 @@ var CurveChart = React5.memo(({ data, labels, width, height, animate, onHover, o
|
|
|
6431
6552
|
});
|
|
6432
6553
|
});
|
|
6433
6554
|
}, [animate, seriesPoints]);
|
|
6434
|
-
return /* @__PURE__ */
|
|
6435
|
-
/* @__PURE__ */
|
|
6436
|
-
/* @__PURE__ */
|
|
6555
|
+
return /* @__PURE__ */ jsxs197("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
6556
|
+
/* @__PURE__ */ jsx307(GridLines, { width, height, chartH, maxVal }),
|
|
6557
|
+
/* @__PURE__ */ jsx307(AxisLabels, { labels, count, chartW, height }),
|
|
6437
6558
|
entries.map(([key], di) => {
|
|
6438
6559
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
6439
6560
|
const color = palette[2];
|
|
@@ -6442,12 +6563,12 @@ var CurveChart = React5.memo(({ data, labels, width, height, animate, onHover, o
|
|
|
6442
6563
|
const gradientId = `curve-gradient-${di}`;
|
|
6443
6564
|
const linePath = toSmoothPath(points);
|
|
6444
6565
|
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__ */
|
|
6566
|
+
return /* @__PURE__ */ jsxs197("g", { children: [
|
|
6567
|
+
/* @__PURE__ */ jsx307("defs", { children: /* @__PURE__ */ jsxs197("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
6568
|
+
/* @__PURE__ */ jsx307("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.4" }),
|
|
6569
|
+
/* @__PURE__ */ jsx307("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0.02" })
|
|
6449
6570
|
] }) }),
|
|
6450
|
-
/* @__PURE__ */
|
|
6571
|
+
/* @__PURE__ */ jsx307(
|
|
6451
6572
|
"path",
|
|
6452
6573
|
{
|
|
6453
6574
|
d: areaPath,
|
|
@@ -6456,7 +6577,7 @@ var CurveChart = React5.memo(({ data, labels, width, height, animate, onHover, o
|
|
|
6456
6577
|
style: animate ? { animationDelay: "600ms" } : { opacity: 1 }
|
|
6457
6578
|
}
|
|
6458
6579
|
),
|
|
6459
|
-
/* @__PURE__ */
|
|
6580
|
+
/* @__PURE__ */ jsx307(
|
|
6460
6581
|
"path",
|
|
6461
6582
|
{
|
|
6462
6583
|
ref: (el) => {
|
|
@@ -6468,7 +6589,7 @@ var CurveChart = React5.memo(({ data, labels, width, height, animate, onHover, o
|
|
|
6468
6589
|
strokeWidth: "2"
|
|
6469
6590
|
}
|
|
6470
6591
|
),
|
|
6471
|
-
showPoints && points.map((p, i) => /* @__PURE__ */
|
|
6592
|
+
showPoints && points.map((p, i) => /* @__PURE__ */ jsx307(
|
|
6472
6593
|
"circle",
|
|
6473
6594
|
{
|
|
6474
6595
|
cx: p.x,
|
|
@@ -6487,9 +6608,9 @@ var CurveChart = React5.memo(({ data, labels, width, height, animate, onHover, o
|
|
|
6487
6608
|
] });
|
|
6488
6609
|
});
|
|
6489
6610
|
CurveChart.displayName = "CurveChart";
|
|
6490
|
-
var BarChart =
|
|
6491
|
-
const entries =
|
|
6492
|
-
const maxVal =
|
|
6611
|
+
var BarChart = React7.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
|
|
6612
|
+
const entries = React7.useMemo(() => Object.entries(data), [data]);
|
|
6613
|
+
const maxVal = React7.useMemo(() => {
|
|
6493
6614
|
const allValues = entries.flatMap(([, v]) => v);
|
|
6494
6615
|
return Math.max(...allValues) * 1.2 || 1;
|
|
6495
6616
|
}, [entries]);
|
|
@@ -6501,7 +6622,7 @@ var BarChart = React5.memo(({ data, labels, width, height, animate, onHover, onM
|
|
|
6501
6622
|
const barGap = groupCount > 1 ? 2 : 0;
|
|
6502
6623
|
const barW = Math.max(1, Math.min(32, (groupW * 0.7 - barGap * (groupCount - 1)) / groupCount));
|
|
6503
6624
|
const baseline = PADDING.top + chartH;
|
|
6504
|
-
const bars =
|
|
6625
|
+
const bars = React7.useMemo(
|
|
6505
6626
|
() => entries.map(
|
|
6506
6627
|
([, values], di) => values.map((v, i) => {
|
|
6507
6628
|
const totalBarsW = barW * groupCount + barGap * (groupCount - 1);
|
|
@@ -6514,11 +6635,11 @@ var BarChart = React5.memo(({ data, labels, width, height, animate, onHover, onM
|
|
|
6514
6635
|
[entries, maxVal, chartH, groupW, barW, barGap, groupCount]
|
|
6515
6636
|
);
|
|
6516
6637
|
const barLabelStep = getLabelStep(count, chartW);
|
|
6517
|
-
return /* @__PURE__ */
|
|
6518
|
-
/* @__PURE__ */
|
|
6638
|
+
return /* @__PURE__ */ jsxs197("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
6639
|
+
/* @__PURE__ */ jsx307(GridLines, { width, height, chartH, maxVal }),
|
|
6519
6640
|
labels.map((label, i) => {
|
|
6520
6641
|
if (i % barLabelStep !== 0) return null;
|
|
6521
|
-
return /* @__PURE__ */
|
|
6642
|
+
return /* @__PURE__ */ jsx307("text", { x: PADDING.left + groupW * i + groupW / 2, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
6522
6643
|
}),
|
|
6523
6644
|
entries.map(([key], di) => {
|
|
6524
6645
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
@@ -6527,7 +6648,7 @@ var BarChart = React5.memo(({ data, labels, width, height, animate, onHover, onM
|
|
|
6527
6648
|
const r2 = Math.min(4, b.w / 2);
|
|
6528
6649
|
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
6650
|
const delay = 100 + i * 80;
|
|
6530
|
-
return /* @__PURE__ */
|
|
6651
|
+
return /* @__PURE__ */ jsx307(
|
|
6531
6652
|
"path",
|
|
6532
6653
|
{
|
|
6533
6654
|
d,
|
|
@@ -6548,11 +6669,11 @@ var BarChart = React5.memo(({ data, labels, width, height, animate, onHover, onM
|
|
|
6548
6669
|
] });
|
|
6549
6670
|
});
|
|
6550
6671
|
BarChart.displayName = "BarChart";
|
|
6551
|
-
var PieDonutChart =
|
|
6672
|
+
var PieDonutChart = React7.memo(
|
|
6552
6673
|
({ data, labels, width, height, animate, isDoughnut, onHover, onMove, onLeave }) => {
|
|
6553
|
-
const entries =
|
|
6554
|
-
const values =
|
|
6555
|
-
const total =
|
|
6674
|
+
const entries = React7.useMemo(() => Object.entries(data), [data]);
|
|
6675
|
+
const values = React7.useMemo(() => entries.flatMap(([, v]) => v), [entries]);
|
|
6676
|
+
const total = React7.useMemo(() => values.reduce((a, b) => a + b, 0) || 1, [values]);
|
|
6556
6677
|
const size = Math.min(width, height);
|
|
6557
6678
|
const cx = size / 2;
|
|
6558
6679
|
const cy = size / 2;
|
|
@@ -6560,8 +6681,22 @@ var PieDonutChart = React5.memo(
|
|
|
6560
6681
|
const innerR = isDoughnut ? r2 * 0.5 : 0;
|
|
6561
6682
|
const firstKey = entries[0]?.[0] ?? "";
|
|
6562
6683
|
const colorOffset = hashString(firstKey);
|
|
6563
|
-
const
|
|
6684
|
+
const maskRef = React7.useRef(null);
|
|
6685
|
+
const maskR = r2 + 10;
|
|
6686
|
+
const maskCircumference = 2 * Math.PI * maskR;
|
|
6687
|
+
React7.useEffect(() => {
|
|
6688
|
+
if (!animate || !maskRef.current) return;
|
|
6689
|
+
const el = maskRef.current;
|
|
6690
|
+
el.style.strokeDasharray = `${maskCircumference}`;
|
|
6691
|
+
el.style.strokeDashoffset = `${maskCircumference}`;
|
|
6692
|
+
requestAnimationFrame(() => {
|
|
6693
|
+
el.style.transition = "stroke-dashoffset 1000ms ease-out";
|
|
6694
|
+
el.style.strokeDashoffset = "0";
|
|
6695
|
+
});
|
|
6696
|
+
}, [animate, maskCircumference]);
|
|
6697
|
+
const sliceData = React7.useMemo(() => {
|
|
6564
6698
|
let angle0 = -Math.PI / 2;
|
|
6699
|
+
let cumulativeAngle = 0;
|
|
6565
6700
|
return values.map((v, i) => {
|
|
6566
6701
|
const angle = v / total * Math.PI * 2;
|
|
6567
6702
|
const endAngle = angle0 + angle;
|
|
@@ -6585,45 +6720,60 @@ var PieDonutChart = React5.memo(
|
|
|
6585
6720
|
const lx = cx + labelR * Math.cos(midAngle);
|
|
6586
6721
|
const ly = cy + labelR * Math.sin(midAngle);
|
|
6587
6722
|
const pct = Math.round(v / total * 100);
|
|
6723
|
+
cumulativeAngle += angle;
|
|
6724
|
+
const sliceEndRatio = cumulativeAngle / (Math.PI * 2);
|
|
6725
|
+
const labelDelay = 1e3 * sliceEndRatio + 150;
|
|
6588
6726
|
angle0 = endAngle;
|
|
6589
|
-
return { d, lx, ly, v, pct, angle, label: labels[i] || `${i + 1}
|
|
6727
|
+
return { d, lx, ly, v, pct, angle, label: labels[i] || `${i + 1}`, labelDelay };
|
|
6590
6728
|
});
|
|
6591
6729
|
}, [values, total, cx, cy, r2, innerR, labels]);
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
}
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
|
-
|
|
6610
|
-
|
|
6611
|
-
|
|
6612
|
-
|
|
6613
|
-
|
|
6614
|
-
|
|
6615
|
-
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
|
|
6619
|
-
|
|
6730
|
+
const maskId = `pie-mask-${isDoughnut ? "d" : "p"}`;
|
|
6731
|
+
return /* @__PURE__ */ jsxs197("svg", { viewBox: `0 0 ${size} ${size}`, className: "chart-svg chart-pie", children: [
|
|
6732
|
+
animate && /* @__PURE__ */ jsx307("defs", { children: /* @__PURE__ */ jsx307("mask", { id: maskId, children: /* @__PURE__ */ jsx307(
|
|
6733
|
+
"circle",
|
|
6734
|
+
{
|
|
6735
|
+
ref: maskRef,
|
|
6736
|
+
cx,
|
|
6737
|
+
cy,
|
|
6738
|
+
r: maskR,
|
|
6739
|
+
fill: "none",
|
|
6740
|
+
stroke: "white",
|
|
6741
|
+
strokeWidth: maskR * 2,
|
|
6742
|
+
transform: `rotate(-90 ${cx} ${cy})`
|
|
6743
|
+
}
|
|
6744
|
+
) }) }),
|
|
6745
|
+
/* @__PURE__ */ jsx307("g", { mask: animate ? `url(#${maskId})` : void 0, children: sliceData.map((s, i) => /* @__PURE__ */ jsx307("g", { children: /* @__PURE__ */ jsx307(
|
|
6746
|
+
"path",
|
|
6747
|
+
{
|
|
6748
|
+
d: s.d,
|
|
6749
|
+
fill: PIE_COLORS[(i + colorOffset) % PIE_COLORS.length],
|
|
6750
|
+
className: "chart-slice",
|
|
6751
|
+
onMouseEnter: (e) => onHover(e, `${s.label}: ${s.v} (${s.pct}%)`),
|
|
6752
|
+
onMouseMove: onMove,
|
|
6753
|
+
onMouseLeave: onLeave
|
|
6754
|
+
}
|
|
6755
|
+
) }, i)) }),
|
|
6756
|
+
sliceData.map((s, i) => s.angle > 0.2 && /* @__PURE__ */ jsx307(
|
|
6757
|
+
"text",
|
|
6758
|
+
{
|
|
6759
|
+
x: s.lx,
|
|
6760
|
+
y: s.ly,
|
|
6761
|
+
className: `chart-pie-label ${animate ? "chart-pie-label-animate" : ""}`,
|
|
6762
|
+
style: animate ? { animationDelay: `${s.labelDelay}ms` } : void 0,
|
|
6763
|
+
textAnchor: "middle",
|
|
6764
|
+
dominantBaseline: "central",
|
|
6765
|
+
children: s.v
|
|
6766
|
+
},
|
|
6767
|
+
`label-${i}`
|
|
6768
|
+
))
|
|
6769
|
+
] });
|
|
6620
6770
|
}
|
|
6621
6771
|
);
|
|
6622
6772
|
PieDonutChart.displayName = "PieDonutChart";
|
|
6623
6773
|
var TooltipBubble = ({ x, y, containerWidth, children }) => {
|
|
6624
|
-
const ref =
|
|
6625
|
-
const [adjustedX, setAdjustedX] =
|
|
6626
|
-
|
|
6774
|
+
const ref = React7.useRef(null);
|
|
6775
|
+
const [adjustedX, setAdjustedX] = React7.useState(x);
|
|
6776
|
+
React7.useEffect(() => {
|
|
6627
6777
|
const el = ref.current;
|
|
6628
6778
|
if (!el) return;
|
|
6629
6779
|
const w = el.offsetWidth;
|
|
@@ -6634,7 +6784,7 @@ var TooltipBubble = ({ x, y, containerWidth, children }) => {
|
|
|
6634
6784
|
else if (x + half > containerWidth - margin) nx = containerWidth - half - margin;
|
|
6635
6785
|
setAdjustedX(nx);
|
|
6636
6786
|
}, [x, containerWidth]);
|
|
6637
|
-
return /* @__PURE__ */
|
|
6787
|
+
return /* @__PURE__ */ jsx307(
|
|
6638
6788
|
"div",
|
|
6639
6789
|
{
|
|
6640
6790
|
ref,
|
|
@@ -6644,22 +6794,22 @@ var TooltipBubble = ({ x, y, containerWidth, children }) => {
|
|
|
6644
6794
|
}
|
|
6645
6795
|
);
|
|
6646
6796
|
};
|
|
6647
|
-
var Chart =
|
|
6797
|
+
var Chart = React7.memo((props) => {
|
|
6648
6798
|
const { type, data, labels, tooltip: showTooltip = true } = props;
|
|
6649
6799
|
const { tooltip, show, hide, move, containerRef } = useChartTooltip(showTooltip);
|
|
6650
6800
|
const { width, height } = useChartSize(containerRef);
|
|
6651
|
-
const stableData =
|
|
6652
|
-
const stableLabels =
|
|
6653
|
-
const dataKey =
|
|
6801
|
+
const stableData = React7.useMemo(() => data, [JSON.stringify(data)]);
|
|
6802
|
+
const stableLabels = React7.useMemo(() => labels, [JSON.stringify(labels)]);
|
|
6803
|
+
const dataKey = React7.useMemo(() => JSON.stringify(labels), [labels]);
|
|
6654
6804
|
const animate = useChartAnimation(containerRef, dataKey);
|
|
6655
6805
|
const ready = width > 0 && height > 0;
|
|
6656
|
-
return /* @__PURE__ */
|
|
6657
|
-
ready && type === "line" && /* @__PURE__ */
|
|
6658
|
-
ready && type === "curve" && /* @__PURE__ */
|
|
6659
|
-
ready && type === "bar" && /* @__PURE__ */
|
|
6660
|
-
ready && type === "pie" && /* @__PURE__ */
|
|
6661
|
-
ready && type === "doughnut" && /* @__PURE__ */
|
|
6662
|
-
tooltip.visible && /* @__PURE__ */
|
|
6806
|
+
return /* @__PURE__ */ jsxs197("div", { className: "lib-xplat-chart", ref: containerRef, children: [
|
|
6807
|
+
ready && type === "line" && /* @__PURE__ */ jsx307(LineChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
6808
|
+
ready && type === "curve" && /* @__PURE__ */ jsx307(CurveChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
6809
|
+
ready && type === "bar" && /* @__PURE__ */ jsx307(BarChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
6810
|
+
ready && type === "pie" && /* @__PURE__ */ jsx307(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
6811
|
+
ready && type === "doughnut" && /* @__PURE__ */ jsx307(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, isDoughnut: true, onHover: show, onMove: move, onLeave: hide }),
|
|
6812
|
+
tooltip.visible && /* @__PURE__ */ jsx307(TooltipBubble, { x: tooltip.x, y: tooltip.y, containerWidth: width, children: tooltip.content })
|
|
6663
6813
|
] });
|
|
6664
6814
|
});
|
|
6665
6815
|
Chart.displayName = "Chart";
|
|
@@ -6685,7 +6835,7 @@ import { primitive, semantic } from "@x-plat/tokens-core";
|
|
|
6685
6835
|
import { cssVar } from "@x-plat/tokens-core";
|
|
6686
6836
|
|
|
6687
6837
|
// src/components/CheckBox/CheckBox.tsx
|
|
6688
|
-
import { jsx as
|
|
6838
|
+
import { jsx as jsx308, jsxs as jsxs198 } from "react/jsx-runtime";
|
|
6689
6839
|
var CheckBox = (props) => {
|
|
6690
6840
|
const {
|
|
6691
6841
|
checked,
|
|
@@ -6703,8 +6853,8 @@ var CheckBox = (props) => {
|
|
|
6703
6853
|
const checkedClasses = `checked`;
|
|
6704
6854
|
const disabledClasses = "disabled";
|
|
6705
6855
|
const boxClasses = disabled ? disabledClasses : checked ? checkedClasses : uncheckedClasses;
|
|
6706
|
-
return /* @__PURE__ */
|
|
6707
|
-
/* @__PURE__ */
|
|
6856
|
+
return /* @__PURE__ */ jsxs198("label", { className: clsx_default("lib-xplat-checkbox", size, type), children: [
|
|
6857
|
+
/* @__PURE__ */ jsx308(
|
|
6708
6858
|
"input",
|
|
6709
6859
|
{
|
|
6710
6860
|
type: "checkbox",
|
|
@@ -6714,44 +6864,44 @@ var CheckBox = (props) => {
|
|
|
6714
6864
|
...rest
|
|
6715
6865
|
}
|
|
6716
6866
|
),
|
|
6717
|
-
/* @__PURE__ */
|
|
6718
|
-
label && /* @__PURE__ */
|
|
6867
|
+
/* @__PURE__ */ jsx308("span", { className: clsx_default("checkbox", boxClasses), children: /* @__PURE__ */ jsx308("span", { className: clsx_default("check-icon", { visible: checked }), children: /* @__PURE__ */ jsx308(CheckIcon_default, {}) }) }),
|
|
6868
|
+
label && /* @__PURE__ */ jsx308("span", { className: "label", children: label })
|
|
6719
6869
|
] });
|
|
6720
6870
|
};
|
|
6721
6871
|
CheckBox.displayName = "CheckBox";
|
|
6722
6872
|
var CheckBox_default = CheckBox;
|
|
6723
6873
|
|
|
6724
6874
|
// src/components/Chip/Chip.tsx
|
|
6725
|
-
import { jsx as
|
|
6875
|
+
import { jsx as jsx309 } from "react/jsx-runtime";
|
|
6726
6876
|
var Chip = (props) => {
|
|
6727
6877
|
const {
|
|
6728
6878
|
children,
|
|
6729
6879
|
type = "primary",
|
|
6730
6880
|
size = "md"
|
|
6731
6881
|
} = props;
|
|
6732
|
-
return /* @__PURE__ */
|
|
6882
|
+
return /* @__PURE__ */ jsx309("div", { className: clsx_default("lib-xplat-chip", type, size), children });
|
|
6733
6883
|
};
|
|
6734
6884
|
Chip.displayName = "Chip";
|
|
6735
6885
|
var Chip_default = Chip;
|
|
6736
6886
|
|
|
6737
6887
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
6738
|
-
import
|
|
6888
|
+
import React13 from "react";
|
|
6739
6889
|
|
|
6740
6890
|
// src/components/Input/Input.tsx
|
|
6741
|
-
import
|
|
6891
|
+
import React8 from "react";
|
|
6742
6892
|
|
|
6743
6893
|
// src/components/Input/InputValidations.tsx
|
|
6744
|
-
import { jsx as
|
|
6894
|
+
import { jsx as jsx310, jsxs as jsxs199 } from "react/jsx-runtime";
|
|
6745
6895
|
var InputValidations = (props) => {
|
|
6746
6896
|
const { message, status = "default" } = props;
|
|
6747
|
-
return /* @__PURE__ */
|
|
6748
|
-
/* @__PURE__ */
|
|
6749
|
-
status === "default" && /* @__PURE__ */
|
|
6750
|
-
status === "success" && /* @__PURE__ */
|
|
6751
|
-
status === "warning" && /* @__PURE__ */
|
|
6752
|
-
status === "error" && /* @__PURE__ */
|
|
6897
|
+
return /* @__PURE__ */ jsxs199("div", { className: clsx_default("lib-xplat-input-validation", status), children: [
|
|
6898
|
+
/* @__PURE__ */ jsxs199("div", { className: "icon", children: [
|
|
6899
|
+
status === "default" && /* @__PURE__ */ jsx310(InfoIcon_default, {}),
|
|
6900
|
+
status === "success" && /* @__PURE__ */ jsx310(SuccessIcon_default, {}),
|
|
6901
|
+
status === "warning" && /* @__PURE__ */ jsx310(InfoIcon_default, {}),
|
|
6902
|
+
status === "error" && /* @__PURE__ */ jsx310(ErrorIcon_default, {})
|
|
6753
6903
|
] }),
|
|
6754
|
-
/* @__PURE__ */
|
|
6904
|
+
/* @__PURE__ */ jsx310("div", { className: "message", children: message })
|
|
6755
6905
|
] });
|
|
6756
6906
|
};
|
|
6757
6907
|
InputValidations.displayName = "InputValidations";
|
|
@@ -6792,7 +6942,7 @@ var handleTelBackspace = (prevValue, currValue) => {
|
|
|
6792
6942
|
};
|
|
6793
6943
|
|
|
6794
6944
|
// src/components/Input/Input.tsx
|
|
6795
|
-
import { jsx as
|
|
6945
|
+
import { jsx as jsx311, jsxs as jsxs200 } from "react/jsx-runtime";
|
|
6796
6946
|
import { createElement } from "react";
|
|
6797
6947
|
var formatValue = (type, value) => {
|
|
6798
6948
|
if (value === null || value === void 0) return "";
|
|
@@ -6841,7 +6991,7 @@ var parseValue = (type, value) => {
|
|
|
6841
6991
|
return value;
|
|
6842
6992
|
}
|
|
6843
6993
|
};
|
|
6844
|
-
var Input =
|
|
6994
|
+
var Input = React8.forwardRef((props, ref) => {
|
|
6845
6995
|
const {
|
|
6846
6996
|
value,
|
|
6847
6997
|
onChange,
|
|
@@ -6867,13 +7017,13 @@ var Input = React6.forwardRef((props, ref) => {
|
|
|
6867
7017
|
onChange(event);
|
|
6868
7018
|
}
|
|
6869
7019
|
};
|
|
6870
|
-
return /* @__PURE__ */
|
|
6871
|
-
/* @__PURE__ */
|
|
7020
|
+
return /* @__PURE__ */ jsxs200("div", { className: "lib-xplat-input-wrap", children: [
|
|
7021
|
+
/* @__PURE__ */ jsxs200(
|
|
6872
7022
|
"div",
|
|
6873
7023
|
{
|
|
6874
7024
|
className: clsx_default("lib-xplat-input", size, disabled ? "disabled" : void 0),
|
|
6875
7025
|
children: [
|
|
6876
|
-
/* @__PURE__ */
|
|
7026
|
+
/* @__PURE__ */ jsx311(
|
|
6877
7027
|
"input",
|
|
6878
7028
|
{
|
|
6879
7029
|
...inputProps,
|
|
@@ -6884,11 +7034,11 @@ var Input = React6.forwardRef((props, ref) => {
|
|
|
6884
7034
|
onChange: handleChange
|
|
6885
7035
|
}
|
|
6886
7036
|
),
|
|
6887
|
-
suffix && /* @__PURE__ */
|
|
7037
|
+
suffix && /* @__PURE__ */ jsx311("div", { className: "suffix", children: suffix })
|
|
6888
7038
|
]
|
|
6889
7039
|
}
|
|
6890
7040
|
),
|
|
6891
|
-
validations && /* @__PURE__ */
|
|
7041
|
+
validations && /* @__PURE__ */ jsx311("div", { className: "lib-xplat-input-validation-wrap", children: validations?.map((validation, idx) => /* @__PURE__ */ createElement(
|
|
6892
7042
|
InputValidations_default,
|
|
6893
7043
|
{
|
|
6894
7044
|
...validation,
|
|
@@ -6901,20 +7051,20 @@ Input.displayName = "Input";
|
|
|
6901
7051
|
var Input_default = Input;
|
|
6902
7052
|
|
|
6903
7053
|
// src/components/Input/PasswordInput/PasswordInput.tsx
|
|
6904
|
-
import
|
|
6905
|
-
import { jsx as
|
|
6906
|
-
var PasswordInput =
|
|
7054
|
+
import React9 from "react";
|
|
7055
|
+
import { jsx as jsx312 } from "react/jsx-runtime";
|
|
7056
|
+
var PasswordInput = React9.forwardRef(
|
|
6907
7057
|
(props, ref) => {
|
|
6908
7058
|
const { reg: _reg, ...inputProps } = props;
|
|
6909
|
-
const [isView, setIsView] =
|
|
7059
|
+
const [isView, setIsView] = React9.useState(false);
|
|
6910
7060
|
const handleChangeView = () => {
|
|
6911
7061
|
setIsView((prev) => !prev);
|
|
6912
7062
|
};
|
|
6913
|
-
return /* @__PURE__ */
|
|
7063
|
+
return /* @__PURE__ */ jsx312(
|
|
6914
7064
|
Input_default,
|
|
6915
7065
|
{
|
|
6916
7066
|
...inputProps,
|
|
6917
|
-
suffix: /* @__PURE__ */
|
|
7067
|
+
suffix: /* @__PURE__ */ jsx312("div", { className: "wrapper pointer", onClick: handleChangeView, children: isView ? /* @__PURE__ */ jsx312(OpenEyeIcon_default, {}) : /* @__PURE__ */ jsx312(CloseEyeIcon_default, {}) }),
|
|
6918
7068
|
type: isView ? "text" : "password",
|
|
6919
7069
|
ref
|
|
6920
7070
|
}
|
|
@@ -6925,17 +7075,17 @@ PasswordInput.displayName = "PasswordInput";
|
|
|
6925
7075
|
var PasswordInput_default = PasswordInput;
|
|
6926
7076
|
|
|
6927
7077
|
// src/components/Modal/Modal.tsx
|
|
6928
|
-
import
|
|
7078
|
+
import React11 from "react";
|
|
6929
7079
|
import { createPortal } from "react-dom";
|
|
6930
7080
|
|
|
6931
7081
|
// src/tokens/hooks/Portal.tsx
|
|
6932
|
-
import
|
|
7082
|
+
import React10 from "react";
|
|
6933
7083
|
import ReactDOM from "react-dom";
|
|
6934
|
-
import { jsx as
|
|
6935
|
-
var PortalContainerContext =
|
|
6936
|
-
var PortalProvider = ({ container, children }) => /* @__PURE__ */
|
|
7084
|
+
import { jsx as jsx313 } from "react/jsx-runtime";
|
|
7085
|
+
var PortalContainerContext = React10.createContext(null);
|
|
7086
|
+
var PortalProvider = ({ container, children }) => /* @__PURE__ */ jsx313(PortalContainerContext.Provider, { value: container, children });
|
|
6937
7087
|
var Portal = ({ children }) => {
|
|
6938
|
-
const contextContainer =
|
|
7088
|
+
const contextContainer = React10.useContext(PortalContainerContext);
|
|
6939
7089
|
if (typeof document === "undefined") return null;
|
|
6940
7090
|
const container = contextContainer ?? document.body;
|
|
6941
7091
|
return ReactDOM.createPortal(children, container);
|
|
@@ -6944,14 +7094,14 @@ Portal.displayName = "Portal";
|
|
|
6944
7094
|
var Portal_default = Portal;
|
|
6945
7095
|
|
|
6946
7096
|
// src/components/Modal/Modal.tsx
|
|
6947
|
-
import { jsx as
|
|
7097
|
+
import { jsx as jsx314 } from "react/jsx-runtime";
|
|
6948
7098
|
var ANIMATION_DURATION_MS = 200;
|
|
6949
7099
|
var Modal = (props) => {
|
|
6950
7100
|
const { isOpen, onClose, children } = props;
|
|
6951
|
-
const [mounted, setMounted] =
|
|
6952
|
-
const [visible, setVisible] =
|
|
6953
|
-
const boxRef =
|
|
6954
|
-
|
|
7101
|
+
const [mounted, setMounted] = React11.useState(false);
|
|
7102
|
+
const [visible, setVisible] = React11.useState(false);
|
|
7103
|
+
const boxRef = React11.useRef(null);
|
|
7104
|
+
React11.useEffect(() => {
|
|
6955
7105
|
if (isOpen) {
|
|
6956
7106
|
setMounted(true);
|
|
6957
7107
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -6965,12 +7115,12 @@ var Modal = (props) => {
|
|
|
6965
7115
|
if (!mounted) return null;
|
|
6966
7116
|
const stateClass = visible ? "enter" : "exit";
|
|
6967
7117
|
return createPortal(
|
|
6968
|
-
/* @__PURE__ */
|
|
7118
|
+
/* @__PURE__ */ jsx314(
|
|
6969
7119
|
"div",
|
|
6970
7120
|
{
|
|
6971
7121
|
className: clsx_default("lib-xplat-modal", "dim", stateClass),
|
|
6972
7122
|
onClick: onClose,
|
|
6973
|
-
children: /* @__PURE__ */
|
|
7123
|
+
children: /* @__PURE__ */ jsx314(
|
|
6974
7124
|
"div",
|
|
6975
7125
|
{
|
|
6976
7126
|
ref: boxRef,
|
|
@@ -6978,7 +7128,7 @@ var Modal = (props) => {
|
|
|
6978
7128
|
role: "dialog",
|
|
6979
7129
|
"aria-modal": "true",
|
|
6980
7130
|
onClick: (e) => e.stopPropagation(),
|
|
6981
|
-
children: /* @__PURE__ */
|
|
7131
|
+
children: /* @__PURE__ */ jsx314(PortalProvider, { container: boxRef.current, children })
|
|
6982
7132
|
}
|
|
6983
7133
|
)
|
|
6984
7134
|
}
|
|
@@ -6990,9 +7140,9 @@ Modal.displayName = "Modal";
|
|
|
6990
7140
|
var Modal_default = Modal;
|
|
6991
7141
|
|
|
6992
7142
|
// src/components/DatePicker/SingleDatePicker/index.tsx
|
|
6993
|
-
import
|
|
6994
|
-
import { Fragment as Fragment3, jsx as
|
|
6995
|
-
var DayCell2 =
|
|
7143
|
+
import React12 from "react";
|
|
7144
|
+
import { Fragment as Fragment3, jsx as jsx315, jsxs as jsxs201 } from "react/jsx-runtime";
|
|
7145
|
+
var DayCell2 = React12.memo(
|
|
6996
7146
|
({
|
|
6997
7147
|
day,
|
|
6998
7148
|
disabled,
|
|
@@ -7002,7 +7152,7 @@ var DayCell2 = React10.memo(
|
|
|
7002
7152
|
isEnd,
|
|
7003
7153
|
inRange,
|
|
7004
7154
|
onSelect
|
|
7005
|
-
}) => /* @__PURE__ */
|
|
7155
|
+
}) => /* @__PURE__ */ jsx315(
|
|
7006
7156
|
"button",
|
|
7007
7157
|
{
|
|
7008
7158
|
type: "button",
|
|
@@ -7044,26 +7194,26 @@ var SingleDatePicker = (props) => {
|
|
|
7044
7194
|
initialYear,
|
|
7045
7195
|
initialMonth
|
|
7046
7196
|
);
|
|
7047
|
-
const [pickerMode, setPickerMode] =
|
|
7048
|
-
const [yearRangeStart, setYearRangeStart] =
|
|
7197
|
+
const [pickerMode, setPickerMode] = React12.useState("days");
|
|
7198
|
+
const [yearRangeStart, setYearRangeStart] = React12.useState(
|
|
7049
7199
|
Math.floor((initialYear ?? (/* @__PURE__ */ new Date()).getFullYear()) / 12) * 12
|
|
7050
7200
|
);
|
|
7051
|
-
const minTime =
|
|
7201
|
+
const minTime = React12.useMemo(
|
|
7052
7202
|
() => minDate ? new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()).getTime() : -Infinity,
|
|
7053
7203
|
[minDate]
|
|
7054
7204
|
);
|
|
7055
|
-
const maxTime =
|
|
7205
|
+
const maxTime = React12.useMemo(
|
|
7056
7206
|
() => maxDate ? new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()).getTime() : Infinity,
|
|
7057
7207
|
[maxDate]
|
|
7058
7208
|
);
|
|
7059
|
-
const highlightSet =
|
|
7209
|
+
const highlightSet = React12.useMemo(() => {
|
|
7060
7210
|
const set = /* @__PURE__ */ new Set();
|
|
7061
7211
|
for (const h of highlightDates) {
|
|
7062
7212
|
set.add(`${h.getFullYear()}-${h.getMonth()}-${h.getDate()}`);
|
|
7063
7213
|
}
|
|
7064
7214
|
return set;
|
|
7065
7215
|
}, [highlightDates]);
|
|
7066
|
-
const handleSelect =
|
|
7216
|
+
const handleSelect = React12.useCallback(
|
|
7067
7217
|
(date) => {
|
|
7068
7218
|
onChange?.(date);
|
|
7069
7219
|
},
|
|
@@ -7100,20 +7250,20 @@ var SingleDatePicker = (props) => {
|
|
|
7100
7250
|
const monthLabels = MONTH_LABELS[locale];
|
|
7101
7251
|
const titleText = pickerMode === "days" ? locale === "ko" ? `${year}\uB144 ${monthLabels[month]}` : `${monthLabels[month]} ${year}` : pickerMode === "months" ? `${year}` : `${yearRangeStart} - ${yearRangeStart + 11}`;
|
|
7102
7252
|
const hasRange = rangeStart != null && rangeEnd != null;
|
|
7103
|
-
return /* @__PURE__ */
|
|
7253
|
+
return /* @__PURE__ */ jsxs201(
|
|
7104
7254
|
"div",
|
|
7105
7255
|
{
|
|
7106
7256
|
className: clsx_default("lib-xplat-datepicker", "single"),
|
|
7107
7257
|
children: [
|
|
7108
|
-
/* @__PURE__ */
|
|
7109
|
-
/* @__PURE__ */
|
|
7110
|
-
/* @__PURE__ */
|
|
7111
|
-
/* @__PURE__ */
|
|
7258
|
+
/* @__PURE__ */ jsxs201("div", { className: "datepicker-header", children: [
|
|
7259
|
+
/* @__PURE__ */ jsx315("button", { className: "datepicker-nav", onClick: handlePrev, type: "button", children: /* @__PURE__ */ jsx315(ChevronLeftIcon_default, {}) }),
|
|
7260
|
+
/* @__PURE__ */ jsx315("button", { className: "datepicker-title", onClick: handleTitleClick, type: "button", children: titleText }),
|
|
7261
|
+
/* @__PURE__ */ jsx315("button", { className: "datepicker-nav", onClick: handleNext, type: "button", children: /* @__PURE__ */ jsx315(ChevronRightIcon_default, {}) })
|
|
7112
7262
|
] }),
|
|
7113
|
-
/* @__PURE__ */
|
|
7114
|
-
pickerMode === "years" && /* @__PURE__ */
|
|
7263
|
+
/* @__PURE__ */ jsxs201("div", { className: "datepicker-body", children: [
|
|
7264
|
+
pickerMode === "years" && /* @__PURE__ */ jsx315("div", { className: "datepicker-picker-grid", children: Array.from({ length: 12 }, (_, i) => {
|
|
7115
7265
|
const y = yearRangeStart + i;
|
|
7116
|
-
return /* @__PURE__ */
|
|
7266
|
+
return /* @__PURE__ */ jsx315(
|
|
7117
7267
|
"button",
|
|
7118
7268
|
{
|
|
7119
7269
|
type: "button",
|
|
@@ -7124,7 +7274,7 @@ var SingleDatePicker = (props) => {
|
|
|
7124
7274
|
y
|
|
7125
7275
|
);
|
|
7126
7276
|
}) }),
|
|
7127
|
-
pickerMode === "months" && /* @__PURE__ */
|
|
7277
|
+
pickerMode === "months" && /* @__PURE__ */ jsx315("div", { className: "datepicker-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ jsx315(
|
|
7128
7278
|
"button",
|
|
7129
7279
|
{
|
|
7130
7280
|
type: "button",
|
|
@@ -7134,8 +7284,8 @@ var SingleDatePicker = (props) => {
|
|
|
7134
7284
|
},
|
|
7135
7285
|
i
|
|
7136
7286
|
)) }),
|
|
7137
|
-
pickerMode === "days" && /* @__PURE__ */
|
|
7138
|
-
/* @__PURE__ */
|
|
7287
|
+
pickerMode === "days" && /* @__PURE__ */ jsxs201(Fragment3, { children: [
|
|
7288
|
+
/* @__PURE__ */ jsx315("div", { className: "datepicker-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ jsx315(
|
|
7139
7289
|
"div",
|
|
7140
7290
|
{
|
|
7141
7291
|
className: clsx_default(
|
|
@@ -7147,7 +7297,7 @@ var SingleDatePicker = (props) => {
|
|
|
7147
7297
|
},
|
|
7148
7298
|
label
|
|
7149
7299
|
)) }),
|
|
7150
|
-
/* @__PURE__ */
|
|
7300
|
+
/* @__PURE__ */ jsx315("div", { className: "datepicker-grid", children: days.map((day, idx) => {
|
|
7151
7301
|
const t = day.date.getTime();
|
|
7152
7302
|
const disabled = t < minTime || t > maxTime;
|
|
7153
7303
|
const selected = value ? isSameDay(day.date, value) : false;
|
|
@@ -7157,7 +7307,7 @@ var SingleDatePicker = (props) => {
|
|
|
7157
7307
|
const isStart = hasRange ? isSameDay(day.date, rangeStart) : false;
|
|
7158
7308
|
const isEnd = hasRange ? isSameDay(day.date, rangeEnd) : false;
|
|
7159
7309
|
const inRangeVal = hasRange ? isInRange(day.date, rangeStart, rangeEnd) : false;
|
|
7160
|
-
return /* @__PURE__ */
|
|
7310
|
+
return /* @__PURE__ */ jsx315(
|
|
7161
7311
|
DayCell2,
|
|
7162
7312
|
{
|
|
7163
7313
|
day,
|
|
@@ -7182,7 +7332,7 @@ SingleDatePicker.displayName = "SingleDatePicker";
|
|
|
7182
7332
|
var SingleDatePicker_default = SingleDatePicker;
|
|
7183
7333
|
|
|
7184
7334
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
7185
|
-
import { jsx as
|
|
7335
|
+
import { jsx as jsx316, jsxs as jsxs202 } from "react/jsx-runtime";
|
|
7186
7336
|
var formatDate = (date) => {
|
|
7187
7337
|
if (!date || !(date instanceof Date) || isNaN(date.getTime())) return "";
|
|
7188
7338
|
const y = date.getFullYear();
|
|
@@ -7192,8 +7342,8 @@ var formatDate = (date) => {
|
|
|
7192
7342
|
};
|
|
7193
7343
|
var InputDatePicker = (props) => {
|
|
7194
7344
|
const { value, onChange, minDate, maxDate, disabled, locale = "ko", placeholder } = props;
|
|
7195
|
-
const [isOpen, setIsOpen] =
|
|
7196
|
-
const [tempDate, setTempDate] =
|
|
7345
|
+
const [isOpen, setIsOpen] = React13.useState(false);
|
|
7346
|
+
const [tempDate, setTempDate] = React13.useState(value ?? /* @__PURE__ */ new Date());
|
|
7197
7347
|
const handleOpen = () => {
|
|
7198
7348
|
if (disabled) return;
|
|
7199
7349
|
setTempDate(value ?? /* @__PURE__ */ new Date());
|
|
@@ -7209,19 +7359,19 @@ var InputDatePicker = (props) => {
|
|
|
7209
7359
|
const handleClose = () => {
|
|
7210
7360
|
setIsOpen(false);
|
|
7211
7361
|
};
|
|
7212
|
-
return /* @__PURE__ */
|
|
7213
|
-
/* @__PURE__ */
|
|
7362
|
+
return /* @__PURE__ */ jsxs202("div", { className: clsx_default("lib-xplat-datepicker input-datepicker", disabled && "disabled"), children: [
|
|
7363
|
+
/* @__PURE__ */ jsx316("div", { className: "input-datepicker-trigger", onClick: handleOpen, children: /* @__PURE__ */ jsx316(
|
|
7214
7364
|
Input_default,
|
|
7215
7365
|
{
|
|
7216
7366
|
value: formatDate(value),
|
|
7217
7367
|
placeholder,
|
|
7218
|
-
suffix: /* @__PURE__ */
|
|
7368
|
+
suffix: /* @__PURE__ */ jsx316(CalenderIcon_default, {}),
|
|
7219
7369
|
disabled,
|
|
7220
7370
|
readOnly: true
|
|
7221
7371
|
}
|
|
7222
7372
|
) }),
|
|
7223
|
-
/* @__PURE__ */
|
|
7224
|
-
/* @__PURE__ */
|
|
7373
|
+
/* @__PURE__ */ jsx316(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ jsxs202("div", { className: "lib-xplat-popup-datepicker-card", children: [
|
|
7374
|
+
/* @__PURE__ */ jsx316("div", { className: "popup-datepicker-content", children: /* @__PURE__ */ jsx316(
|
|
7225
7375
|
SingleDatePicker_default,
|
|
7226
7376
|
{
|
|
7227
7377
|
value: tempDate,
|
|
@@ -7231,9 +7381,9 @@ var InputDatePicker = (props) => {
|
|
|
7231
7381
|
locale
|
|
7232
7382
|
}
|
|
7233
7383
|
) }),
|
|
7234
|
-
/* @__PURE__ */
|
|
7235
|
-
/* @__PURE__ */
|
|
7236
|
-
/* @__PURE__ */
|
|
7384
|
+
/* @__PURE__ */ jsxs202("div", { className: "popup-datepicker-footer", children: [
|
|
7385
|
+
/* @__PURE__ */ jsx316(Button_default, { type: "secondary", onClick: handleClose, children: locale === "ko" ? "\uCDE8\uC18C" : "Cancel" }),
|
|
7386
|
+
/* @__PURE__ */ jsx316(Button_default, { type: "primary", onClick: handleApply, children: locale === "ko" ? "\uC801\uC6A9" : "Apply" })
|
|
7237
7387
|
] })
|
|
7238
7388
|
] }) })
|
|
7239
7389
|
] });
|
|
@@ -7242,20 +7392,20 @@ InputDatePicker.displayName = "InputDatePicker";
|
|
|
7242
7392
|
var InputDatePicker_default = InputDatePicker;
|
|
7243
7393
|
|
|
7244
7394
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
7245
|
-
import
|
|
7395
|
+
import React17 from "react";
|
|
7246
7396
|
|
|
7247
7397
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
7248
|
-
import
|
|
7398
|
+
import React16 from "react";
|
|
7249
7399
|
|
|
7250
7400
|
// src/components/Tab/Tab.tsx
|
|
7251
|
-
import
|
|
7401
|
+
import React15 from "react";
|
|
7252
7402
|
|
|
7253
7403
|
// src/components/Tab/TabItem.tsx
|
|
7254
|
-
import
|
|
7255
|
-
import { jsx as
|
|
7256
|
-
var TabItem =
|
|
7404
|
+
import React14 from "react";
|
|
7405
|
+
import { jsx as jsx317 } from "react/jsx-runtime";
|
|
7406
|
+
var TabItem = React14.forwardRef((props, ref) => {
|
|
7257
7407
|
const { isActive, title, onClick } = props;
|
|
7258
|
-
return /* @__PURE__ */
|
|
7408
|
+
return /* @__PURE__ */ jsx317(
|
|
7259
7409
|
"div",
|
|
7260
7410
|
{
|
|
7261
7411
|
ref,
|
|
@@ -7269,25 +7419,25 @@ TabItem.displayName = "TabItem";
|
|
|
7269
7419
|
var TabItem_default = TabItem;
|
|
7270
7420
|
|
|
7271
7421
|
// src/components/Tab/Tab.tsx
|
|
7272
|
-
import { jsx as
|
|
7422
|
+
import { jsx as jsx318, jsxs as jsxs203 } from "react/jsx-runtime";
|
|
7273
7423
|
var Tab = (props) => {
|
|
7274
7424
|
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
7275
|
-
const [underlineStyle, setUnderlineStyle] =
|
|
7425
|
+
const [underlineStyle, setUnderlineStyle] = React15.useState({
|
|
7276
7426
|
left: 0,
|
|
7277
7427
|
width: 0
|
|
7278
7428
|
});
|
|
7279
|
-
const itemRefs =
|
|
7429
|
+
const itemRefs = React15.useRef([]);
|
|
7280
7430
|
const handleChangeActiveTab = (tabItem, tabIdx) => {
|
|
7281
7431
|
onChange(tabItem, tabIdx);
|
|
7282
7432
|
};
|
|
7283
|
-
|
|
7433
|
+
React15.useEffect(() => {
|
|
7284
7434
|
const el = itemRefs.current[activeIndex];
|
|
7285
7435
|
if (el) {
|
|
7286
7436
|
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
7287
7437
|
}
|
|
7288
7438
|
}, [activeIndex, tabs.length]);
|
|
7289
|
-
return /* @__PURE__ */
|
|
7290
|
-
tabs.map((tab, idx) => /* @__PURE__ */
|
|
7439
|
+
return /* @__PURE__ */ jsxs203("div", { className: clsx_default("lib-xplat-tab", `type-${type}`, size), children: [
|
|
7440
|
+
tabs.map((tab, idx) => /* @__PURE__ */ jsx318(
|
|
7291
7441
|
TabItem_default,
|
|
7292
7442
|
{
|
|
7293
7443
|
onClick: () => handleChangeActiveTab(tab, idx),
|
|
@@ -7299,7 +7449,7 @@ var Tab = (props) => {
|
|
|
7299
7449
|
},
|
|
7300
7450
|
`${tab.value}_${idx}`
|
|
7301
7451
|
)),
|
|
7302
|
-
type === "toggle" && /* @__PURE__ */
|
|
7452
|
+
type === "toggle" && /* @__PURE__ */ jsx318(
|
|
7303
7453
|
"div",
|
|
7304
7454
|
{
|
|
7305
7455
|
className: "tab-toggle-underline",
|
|
@@ -7315,7 +7465,7 @@ Tab.displayName = "Tab";
|
|
|
7315
7465
|
var Tab_default = Tab;
|
|
7316
7466
|
|
|
7317
7467
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
7318
|
-
import { jsx as
|
|
7468
|
+
import { jsx as jsx319, jsxs as jsxs204 } from "react/jsx-runtime";
|
|
7319
7469
|
var RangePicker = (props) => {
|
|
7320
7470
|
const {
|
|
7321
7471
|
startDate,
|
|
@@ -7325,7 +7475,7 @@ var RangePicker = (props) => {
|
|
|
7325
7475
|
maxDate,
|
|
7326
7476
|
locale = "ko"
|
|
7327
7477
|
} = props;
|
|
7328
|
-
const [activeTab, setActiveTab] =
|
|
7478
|
+
const [activeTab, setActiveTab] = React16.useState("start");
|
|
7329
7479
|
const handleStartChange = (date) => {
|
|
7330
7480
|
if (!date) return;
|
|
7331
7481
|
const newStart = date > endDate ? endDate : date;
|
|
@@ -7338,8 +7488,8 @@ var RangePicker = (props) => {
|
|
|
7338
7488
|
};
|
|
7339
7489
|
const startMaxDate = maxDate && endDate < maxDate ? endDate : endDate;
|
|
7340
7490
|
const endMinDate = minDate && startDate > minDate ? startDate : startDate;
|
|
7341
|
-
return /* @__PURE__ */
|
|
7342
|
-
/* @__PURE__ */
|
|
7491
|
+
return /* @__PURE__ */ jsxs204("div", { className: clsx_default("lib-xplat-datepicker", "range"), children: [
|
|
7492
|
+
/* @__PURE__ */ jsx319("div", { className: "datepicker-range-tabs", children: /* @__PURE__ */ jsx319(
|
|
7343
7493
|
Tab_default,
|
|
7344
7494
|
{
|
|
7345
7495
|
activeIndex: activeTab === "start" ? 0 : 1,
|
|
@@ -7352,8 +7502,8 @@ var RangePicker = (props) => {
|
|
|
7352
7502
|
size: "sm"
|
|
7353
7503
|
}
|
|
7354
7504
|
) }),
|
|
7355
|
-
/* @__PURE__ */
|
|
7356
|
-
/* @__PURE__ */
|
|
7505
|
+
/* @__PURE__ */ jsxs204("div", { className: "datepicker-range-panels", children: [
|
|
7506
|
+
/* @__PURE__ */ jsx319(
|
|
7357
7507
|
SingleDatePicker_default,
|
|
7358
7508
|
{
|
|
7359
7509
|
value: startDate,
|
|
@@ -7365,7 +7515,7 @@ var RangePicker = (props) => {
|
|
|
7365
7515
|
locale
|
|
7366
7516
|
}
|
|
7367
7517
|
),
|
|
7368
|
-
/* @__PURE__ */
|
|
7518
|
+
/* @__PURE__ */ jsx319(
|
|
7369
7519
|
SingleDatePicker_default,
|
|
7370
7520
|
{
|
|
7371
7521
|
value: endDate,
|
|
@@ -7378,7 +7528,7 @@ var RangePicker = (props) => {
|
|
|
7378
7528
|
}
|
|
7379
7529
|
)
|
|
7380
7530
|
] }),
|
|
7381
|
-
/* @__PURE__ */
|
|
7531
|
+
/* @__PURE__ */ jsx319("div", { className: "datepicker-range-mobile", children: activeTab === "start" ? /* @__PURE__ */ jsx319(
|
|
7382
7532
|
SingleDatePicker_default,
|
|
7383
7533
|
{
|
|
7384
7534
|
value: startDate,
|
|
@@ -7389,7 +7539,7 @@ var RangePicker = (props) => {
|
|
|
7389
7539
|
rangeEnd: endDate,
|
|
7390
7540
|
locale
|
|
7391
7541
|
}
|
|
7392
|
-
) : /* @__PURE__ */
|
|
7542
|
+
) : /* @__PURE__ */ jsx319(
|
|
7393
7543
|
SingleDatePicker_default,
|
|
7394
7544
|
{
|
|
7395
7545
|
value: endDate,
|
|
@@ -7407,10 +7557,10 @@ RangePicker.displayName = "RangePicker";
|
|
|
7407
7557
|
var RangePicker_default = RangePicker;
|
|
7408
7558
|
|
|
7409
7559
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
7410
|
-
import { jsx as
|
|
7560
|
+
import { jsx as jsx320, jsxs as jsxs205 } from "react/jsx-runtime";
|
|
7411
7561
|
var PopupPicker = (props) => {
|
|
7412
7562
|
const { component, type, locale } = props;
|
|
7413
|
-
const [isOpen, setIsOpen] =
|
|
7563
|
+
const [isOpen, setIsOpen] = React17.useState(false);
|
|
7414
7564
|
const handleClick = () => setIsOpen(true);
|
|
7415
7565
|
const handleClose = () => setIsOpen(false);
|
|
7416
7566
|
const handleSingleChange = (date) => {
|
|
@@ -7418,11 +7568,11 @@ var PopupPicker = (props) => {
|
|
|
7418
7568
|
props.onChange?.(date);
|
|
7419
7569
|
handleClose();
|
|
7420
7570
|
};
|
|
7421
|
-
return /* @__PURE__ */
|
|
7422
|
-
|
|
7423
|
-
/* @__PURE__ */
|
|
7424
|
-
/* @__PURE__ */
|
|
7425
|
-
type === "single" && /* @__PURE__ */
|
|
7571
|
+
return /* @__PURE__ */ jsxs205("div", { className: "lib-xplat-popup-datepicker", children: [
|
|
7572
|
+
React17.cloneElement(component, { onClick: handleClick }),
|
|
7573
|
+
/* @__PURE__ */ jsx320(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ jsxs205("div", { className: clsx_default("lib-xplat-popup-datepicker-card", type === "range" && "range-mode"), children: [
|
|
7574
|
+
/* @__PURE__ */ jsxs205("div", { className: "popup-datepicker-content", children: [
|
|
7575
|
+
type === "single" && /* @__PURE__ */ jsx320(
|
|
7426
7576
|
SingleDatePicker_default,
|
|
7427
7577
|
{
|
|
7428
7578
|
value: props.value,
|
|
@@ -7432,7 +7582,7 @@ var PopupPicker = (props) => {
|
|
|
7432
7582
|
locale
|
|
7433
7583
|
}
|
|
7434
7584
|
),
|
|
7435
|
-
type === "range" && /* @__PURE__ */
|
|
7585
|
+
type === "range" && /* @__PURE__ */ jsx320(
|
|
7436
7586
|
RangePicker_default,
|
|
7437
7587
|
{
|
|
7438
7588
|
startDate: props.startDate,
|
|
@@ -7444,8 +7594,8 @@ var PopupPicker = (props) => {
|
|
|
7444
7594
|
}
|
|
7445
7595
|
)
|
|
7446
7596
|
] }),
|
|
7447
|
-
/* @__PURE__ */
|
|
7448
|
-
/* @__PURE__ */
|
|
7597
|
+
/* @__PURE__ */ jsxs205("div", { className: "popup-datepicker-footer", children: [
|
|
7598
|
+
/* @__PURE__ */ jsx320(
|
|
7449
7599
|
Button_default,
|
|
7450
7600
|
{
|
|
7451
7601
|
type: "secondary",
|
|
@@ -7453,7 +7603,7 @@ var PopupPicker = (props) => {
|
|
|
7453
7603
|
children: locale === "ko" ? "\uCDE8\uC18C" : "Cancel"
|
|
7454
7604
|
}
|
|
7455
7605
|
),
|
|
7456
|
-
/* @__PURE__ */
|
|
7606
|
+
/* @__PURE__ */ jsx320(Button_default, { type: "primary", onClick: handleClose, children: locale === "ko" ? "\uC801\uC6A9" : "Apply" })
|
|
7457
7607
|
] })
|
|
7458
7608
|
] }) })
|
|
7459
7609
|
] });
|
|
@@ -7462,10 +7612,10 @@ PopupPicker.displayName = "PopupPicker";
|
|
|
7462
7612
|
var PopupPicker_default = PopupPicker;
|
|
7463
7613
|
|
|
7464
7614
|
// src/components/Divider/Divider.tsx
|
|
7465
|
-
import { jsx as
|
|
7615
|
+
import { jsx as jsx321 } from "react/jsx-runtime";
|
|
7466
7616
|
var Divider = (props) => {
|
|
7467
7617
|
const { orientation = "horizontal" } = props;
|
|
7468
|
-
return /* @__PURE__ */
|
|
7618
|
+
return /* @__PURE__ */ jsx321(
|
|
7469
7619
|
"div",
|
|
7470
7620
|
{
|
|
7471
7621
|
className: clsx_default("lib-xplat-divider", orientation),
|
|
@@ -7478,15 +7628,15 @@ Divider.displayName = "Divider";
|
|
|
7478
7628
|
var Divider_default = Divider;
|
|
7479
7629
|
|
|
7480
7630
|
// src/components/Drawer/Drawer.tsx
|
|
7481
|
-
import
|
|
7631
|
+
import React18 from "react";
|
|
7482
7632
|
import { createPortal as createPortal2 } from "react-dom";
|
|
7483
|
-
import { jsx as
|
|
7633
|
+
import { jsx as jsx322, jsxs as jsxs206 } from "react/jsx-runtime";
|
|
7484
7634
|
var ANIMATION_DURATION_MS2 = 250;
|
|
7485
7635
|
var Drawer = (props) => {
|
|
7486
7636
|
const { isOpen, onClose, placement = "right", size = "md", title, children } = props;
|
|
7487
|
-
const [mounted, setMounted] =
|
|
7488
|
-
const [visible, setVisible] =
|
|
7489
|
-
|
|
7637
|
+
const [mounted, setMounted] = React18.useState(false);
|
|
7638
|
+
const [visible, setVisible] = React18.useState(false);
|
|
7639
|
+
React18.useEffect(() => {
|
|
7490
7640
|
if (isOpen) {
|
|
7491
7641
|
setMounted(true);
|
|
7492
7642
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -7500,12 +7650,12 @@ var Drawer = (props) => {
|
|
|
7500
7650
|
if (!mounted) return null;
|
|
7501
7651
|
const stateClass = visible ? "enter" : "exit";
|
|
7502
7652
|
return createPortal2(
|
|
7503
|
-
/* @__PURE__ */
|
|
7653
|
+
/* @__PURE__ */ jsx322(
|
|
7504
7654
|
"div",
|
|
7505
7655
|
{
|
|
7506
7656
|
className: clsx_default("lib-xplat-drawer-overlay", stateClass),
|
|
7507
7657
|
onClick: onClose,
|
|
7508
|
-
children: /* @__PURE__ */
|
|
7658
|
+
children: /* @__PURE__ */ jsxs206(
|
|
7509
7659
|
"div",
|
|
7510
7660
|
{
|
|
7511
7661
|
className: clsx_default("lib-xplat-drawer", placement, size, stateClass),
|
|
@@ -7513,11 +7663,11 @@ var Drawer = (props) => {
|
|
|
7513
7663
|
"aria-modal": "true",
|
|
7514
7664
|
onClick: (e) => e.stopPropagation(),
|
|
7515
7665
|
children: [
|
|
7516
|
-
title && /* @__PURE__ */
|
|
7517
|
-
/* @__PURE__ */
|
|
7518
|
-
/* @__PURE__ */
|
|
7666
|
+
title && /* @__PURE__ */ jsxs206("div", { className: "drawer-header", children: [
|
|
7667
|
+
/* @__PURE__ */ jsx322("span", { className: "drawer-title", children: title }),
|
|
7668
|
+
/* @__PURE__ */ jsx322("button", { className: "close-btn", onClick: onClose, "aria-label": "\uB2EB\uAE30", children: "\xD7" })
|
|
7519
7669
|
] }),
|
|
7520
|
-
/* @__PURE__ */
|
|
7670
|
+
/* @__PURE__ */ jsx322("div", { className: "drawer-body", children })
|
|
7521
7671
|
]
|
|
7522
7672
|
}
|
|
7523
7673
|
)
|
|
@@ -7530,22 +7680,23 @@ Drawer.displayName = "Drawer";
|
|
|
7530
7680
|
var Drawer_default = Drawer;
|
|
7531
7681
|
|
|
7532
7682
|
// src/components/Dropdown/Dropdown.tsx
|
|
7533
|
-
import
|
|
7683
|
+
import React21 from "react";
|
|
7534
7684
|
|
|
7535
7685
|
// src/tokens/hooks/useAutoPosition.ts
|
|
7536
|
-
import
|
|
7686
|
+
import React19 from "react";
|
|
7537
7687
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
7538
|
-
const [position, setPosition] =
|
|
7688
|
+
const [position, setPosition] = React19.useState({
|
|
7539
7689
|
position: {},
|
|
7540
7690
|
direction: "bottom"
|
|
7541
7691
|
});
|
|
7542
|
-
const calculatePosition =
|
|
7692
|
+
const calculatePosition = React19.useCallback(() => {
|
|
7543
7693
|
if (!triggerRef.current || !popRef.current) return;
|
|
7544
7694
|
const triggerRect = triggerRef.current.getBoundingClientRect();
|
|
7545
7695
|
const popW = popRef.current.offsetWidth;
|
|
7546
7696
|
const popH = popRef.current.offsetHeight;
|
|
7547
7697
|
const viewportHeight = window.innerHeight;
|
|
7548
7698
|
const viewportWidth = window.innerWidth;
|
|
7699
|
+
if (popH === 0 || popW === 0) return;
|
|
7549
7700
|
let direction = "bottom";
|
|
7550
7701
|
let top;
|
|
7551
7702
|
let left;
|
|
@@ -7565,13 +7716,21 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
7565
7716
|
direction
|
|
7566
7717
|
});
|
|
7567
7718
|
}, [triggerRef, popRef]);
|
|
7568
|
-
|
|
7719
|
+
React19.useLayoutEffect(() => {
|
|
7569
7720
|
if (!enabled) return;
|
|
7570
7721
|
calculatePosition();
|
|
7571
7722
|
const raf = requestAnimationFrame(calculatePosition);
|
|
7572
7723
|
return () => cancelAnimationFrame(raf);
|
|
7573
7724
|
}, [calculatePosition, enabled]);
|
|
7574
|
-
|
|
7725
|
+
React19.useEffect(() => {
|
|
7726
|
+
if (!enabled || !popRef.current) return;
|
|
7727
|
+
const observer = new ResizeObserver(() => {
|
|
7728
|
+
calculatePosition();
|
|
7729
|
+
});
|
|
7730
|
+
observer.observe(popRef.current);
|
|
7731
|
+
return () => observer.disconnect();
|
|
7732
|
+
}, [calculatePosition, enabled, popRef]);
|
|
7733
|
+
React19.useEffect(() => {
|
|
7575
7734
|
if (!enabled) return;
|
|
7576
7735
|
window.addEventListener("resize", calculatePosition);
|
|
7577
7736
|
window.addEventListener("scroll", calculatePosition, true);
|
|
@@ -7585,9 +7744,9 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
7585
7744
|
var useAutoPosition_default = useAutoPosition;
|
|
7586
7745
|
|
|
7587
7746
|
// src/tokens/hooks/useClickOutside.ts
|
|
7588
|
-
import
|
|
7747
|
+
import React20 from "react";
|
|
7589
7748
|
var useClickOutside = (refs, handler, enabled = true) => {
|
|
7590
|
-
|
|
7749
|
+
React20.useEffect(() => {
|
|
7591
7750
|
if (!enabled) return;
|
|
7592
7751
|
const refArray = Array.isArray(refs) ? refs : [refs];
|
|
7593
7752
|
const listener = (event) => {
|
|
@@ -7610,17 +7769,17 @@ var useClickOutside = (refs, handler, enabled = true) => {
|
|
|
7610
7769
|
var useClickOutside_default = useClickOutside;
|
|
7611
7770
|
|
|
7612
7771
|
// src/components/Dropdown/Dropdown.tsx
|
|
7613
|
-
import { jsx as
|
|
7772
|
+
import { jsx as jsx323, jsxs as jsxs207 } from "react/jsx-runtime";
|
|
7614
7773
|
var Dropdown = (props) => {
|
|
7615
7774
|
const { items, children } = props;
|
|
7616
|
-
const [isOpen, setIsOpen] =
|
|
7617
|
-
const [mounted, setMounted] =
|
|
7618
|
-
const [visible, setVisible] =
|
|
7619
|
-
const triggerRef =
|
|
7620
|
-
const menuRef =
|
|
7775
|
+
const [isOpen, setIsOpen] = React21.useState(false);
|
|
7776
|
+
const [mounted, setMounted] = React21.useState(false);
|
|
7777
|
+
const [visible, setVisible] = React21.useState(false);
|
|
7778
|
+
const triggerRef = React21.useRef(null);
|
|
7779
|
+
const menuRef = React21.useRef(null);
|
|
7621
7780
|
const { position, direction } = useAutoPosition_default(triggerRef, menuRef, mounted);
|
|
7622
7781
|
useClickOutside_default([triggerRef, menuRef], () => setIsOpen(false), isOpen);
|
|
7623
|
-
|
|
7782
|
+
React21.useEffect(() => {
|
|
7624
7783
|
if (isOpen) {
|
|
7625
7784
|
setMounted(true);
|
|
7626
7785
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -7635,8 +7794,8 @@ var Dropdown = (props) => {
|
|
|
7635
7794
|
item.onClick?.();
|
|
7636
7795
|
setIsOpen(false);
|
|
7637
7796
|
};
|
|
7638
|
-
return /* @__PURE__ */
|
|
7639
|
-
/* @__PURE__ */
|
|
7797
|
+
return /* @__PURE__ */ jsxs207("div", { className: "lib-xplat-dropdown", children: [
|
|
7798
|
+
/* @__PURE__ */ jsx323(
|
|
7640
7799
|
"div",
|
|
7641
7800
|
{
|
|
7642
7801
|
ref: triggerRef,
|
|
@@ -7645,14 +7804,14 @@ var Dropdown = (props) => {
|
|
|
7645
7804
|
children
|
|
7646
7805
|
}
|
|
7647
7806
|
),
|
|
7648
|
-
mounted && /* @__PURE__ */
|
|
7807
|
+
mounted && /* @__PURE__ */ jsx323(Portal_default, { children: /* @__PURE__ */ jsx323(
|
|
7649
7808
|
"div",
|
|
7650
7809
|
{
|
|
7651
7810
|
ref: menuRef,
|
|
7652
7811
|
className: clsx_default("lib-xplat-dropdown-menu", direction, { visible }),
|
|
7653
7812
|
style: { top: position.top, left: position.left },
|
|
7654
7813
|
role: "menu",
|
|
7655
|
-
children: items.map((item) => /* @__PURE__ */
|
|
7814
|
+
children: items.map((item) => /* @__PURE__ */ jsx323(
|
|
7656
7815
|
"button",
|
|
7657
7816
|
{
|
|
7658
7817
|
className: clsx_default("dropdown-item", {
|
|
@@ -7674,23 +7833,23 @@ Dropdown.displayName = "Dropdown";
|
|
|
7674
7833
|
var Dropdown_default = Dropdown;
|
|
7675
7834
|
|
|
7676
7835
|
// src/components/EmptyState/EmptyState.tsx
|
|
7677
|
-
import { jsx as
|
|
7836
|
+
import { jsx as jsx324, jsxs as jsxs208 } from "react/jsx-runtime";
|
|
7678
7837
|
var EmptyState = (props) => {
|
|
7679
7838
|
const { icon, title = "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4", description, action } = props;
|
|
7680
|
-
return /* @__PURE__ */
|
|
7681
|
-
icon && /* @__PURE__ */
|
|
7682
|
-
!icon && /* @__PURE__ */
|
|
7683
|
-
/* @__PURE__ */
|
|
7684
|
-
description && /* @__PURE__ */
|
|
7685
|
-
action && /* @__PURE__ */
|
|
7839
|
+
return /* @__PURE__ */ jsxs208("div", { className: "lib-xplat-empty-state", children: [
|
|
7840
|
+
icon && /* @__PURE__ */ jsx324("div", { className: "empty-icon", children: icon }),
|
|
7841
|
+
!icon && /* @__PURE__ */ jsx324("div", { className: "empty-icon", children: /* @__PURE__ */ jsx324("svg", { viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx324("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" }) }) }),
|
|
7842
|
+
/* @__PURE__ */ jsx324("p", { className: "empty-title", children: title }),
|
|
7843
|
+
description && /* @__PURE__ */ jsx324("p", { className: "empty-description", children: description }),
|
|
7844
|
+
action && /* @__PURE__ */ jsx324("div", { className: "empty-action", children: action })
|
|
7686
7845
|
] });
|
|
7687
7846
|
};
|
|
7688
7847
|
EmptyState.displayName = "EmptyState";
|
|
7689
7848
|
var EmptyState_default = EmptyState;
|
|
7690
7849
|
|
|
7691
7850
|
// src/components/FileUpload/FileUpload.tsx
|
|
7692
|
-
import
|
|
7693
|
-
import { jsx as
|
|
7851
|
+
import React22 from "react";
|
|
7852
|
+
import { jsx as jsx325, jsxs as jsxs209 } from "react/jsx-runtime";
|
|
7694
7853
|
var FileUpload = (props) => {
|
|
7695
7854
|
const {
|
|
7696
7855
|
accept,
|
|
@@ -7700,8 +7859,8 @@ var FileUpload = (props) => {
|
|
|
7700
7859
|
label = "\uD30C\uC77C\uC744 \uB4DC\uB798\uADF8\uD558\uAC70\uB098 \uD074\uB9AD\uD558\uC5EC \uC5C5\uB85C\uB4DC",
|
|
7701
7860
|
description
|
|
7702
7861
|
} = props;
|
|
7703
|
-
const [isDragOver, setIsDragOver] =
|
|
7704
|
-
const inputRef =
|
|
7862
|
+
const [isDragOver, setIsDragOver] = React22.useState(false);
|
|
7863
|
+
const inputRef = React22.useRef(null);
|
|
7705
7864
|
const handleFiles = (fileList) => {
|
|
7706
7865
|
let files = Array.from(fileList);
|
|
7707
7866
|
if (maxSize) {
|
|
@@ -7731,7 +7890,7 @@ var FileUpload = (props) => {
|
|
|
7731
7890
|
handleFiles(e.target.files);
|
|
7732
7891
|
}
|
|
7733
7892
|
};
|
|
7734
|
-
return /* @__PURE__ */
|
|
7893
|
+
return /* @__PURE__ */ jsxs209(
|
|
7735
7894
|
"div",
|
|
7736
7895
|
{
|
|
7737
7896
|
className: clsx_default("lib-xplat-file-upload", { "drag-over": isDragOver }),
|
|
@@ -7740,7 +7899,7 @@ var FileUpload = (props) => {
|
|
|
7740
7899
|
onDragLeave: handleDragLeave,
|
|
7741
7900
|
onClick: () => inputRef.current?.click(),
|
|
7742
7901
|
children: [
|
|
7743
|
-
/* @__PURE__ */
|
|
7902
|
+
/* @__PURE__ */ jsx325(
|
|
7744
7903
|
"input",
|
|
7745
7904
|
{
|
|
7746
7905
|
ref: inputRef,
|
|
@@ -7750,9 +7909,9 @@ var FileUpload = (props) => {
|
|
|
7750
7909
|
onChange: handleChange
|
|
7751
7910
|
}
|
|
7752
7911
|
),
|
|
7753
|
-
/* @__PURE__ */
|
|
7754
|
-
/* @__PURE__ */
|
|
7755
|
-
description && /* @__PURE__ */
|
|
7912
|
+
/* @__PURE__ */ jsx325("div", { className: "upload-icon", children: /* @__PURE__ */ jsx325(UploadIcon_default, {}) }),
|
|
7913
|
+
/* @__PURE__ */ jsx325("p", { className: "upload-label", children: label }),
|
|
7914
|
+
description && /* @__PURE__ */ jsx325("p", { className: "upload-description", children: description })
|
|
7756
7915
|
]
|
|
7757
7916
|
}
|
|
7758
7917
|
);
|
|
@@ -7761,10 +7920,10 @@ FileUpload.displayName = "FileUpload";
|
|
|
7761
7920
|
var FileUpload_default = FileUpload;
|
|
7762
7921
|
|
|
7763
7922
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
7764
|
-
import
|
|
7923
|
+
import React24 from "react";
|
|
7765
7924
|
|
|
7766
7925
|
// src/components/HtmlTypeWriter/utils.ts
|
|
7767
|
-
import
|
|
7926
|
+
import React23 from "react";
|
|
7768
7927
|
var voidTags = /* @__PURE__ */ new Set([
|
|
7769
7928
|
"br",
|
|
7770
7929
|
"img",
|
|
@@ -7832,41 +7991,41 @@ var convertNodeToReactWithRange = (node, typedLen, rangeMap) => {
|
|
|
7832
7991
|
props[attr.name] = attr.value;
|
|
7833
7992
|
});
|
|
7834
7993
|
if (voidTags.has(tag)) {
|
|
7835
|
-
return
|
|
7994
|
+
return React23.createElement(tag, props);
|
|
7836
7995
|
}
|
|
7837
7996
|
const children = Array.from(element.childNodes).map((child) => convertNodeToReactWithRange(child, typedLen, rangeMap)).filter((n) => n != null);
|
|
7838
|
-
return
|
|
7997
|
+
return React23.createElement(tag, props, ...children);
|
|
7839
7998
|
};
|
|
7840
7999
|
var htmlToReactProgressive = (root, typedLen, rangeMap) => {
|
|
7841
8000
|
const nodes = Array.from(root.childNodes).map((child, idx) => {
|
|
7842
8001
|
const node = convertNodeToReactWithRange(child, typedLen, rangeMap);
|
|
7843
|
-
return node == null ? null :
|
|
8002
|
+
return node == null ? null : React23.createElement(React23.Fragment, { key: idx }, node);
|
|
7844
8003
|
}).filter(Boolean);
|
|
7845
8004
|
return nodes.length === 0 ? null : nodes;
|
|
7846
8005
|
};
|
|
7847
8006
|
|
|
7848
8007
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
7849
|
-
import { jsx as
|
|
8008
|
+
import { jsx as jsx326 } from "react/jsx-runtime";
|
|
7850
8009
|
var HtmlTypeWriter = ({
|
|
7851
8010
|
html,
|
|
7852
8011
|
duration = 20,
|
|
7853
8012
|
onDone,
|
|
7854
8013
|
onChange
|
|
7855
8014
|
}) => {
|
|
7856
|
-
const [typedLen, setTypedLen] =
|
|
7857
|
-
const doneCalledRef =
|
|
7858
|
-
const { doc, rangeMap, totalLength } =
|
|
8015
|
+
const [typedLen, setTypedLen] = React24.useState(0);
|
|
8016
|
+
const doneCalledRef = React24.useRef(false);
|
|
8017
|
+
const { doc, rangeMap, totalLength } = React24.useMemo(() => {
|
|
7859
8018
|
if (typeof window === "undefined") return { doc: null, rangeMap: /* @__PURE__ */ new Map(), totalLength: 0 };
|
|
7860
8019
|
const decoded = decodeHtmlEntities(html);
|
|
7861
8020
|
const doc2 = new DOMParser().parseFromString(decoded, "text/html");
|
|
7862
8021
|
const { rangeMap: rangeMap2, totalLength: totalLength2 } = buildRangeMap(doc2.body);
|
|
7863
8022
|
return { doc: doc2, rangeMap: rangeMap2, totalLength: totalLength2 };
|
|
7864
8023
|
}, [html]);
|
|
7865
|
-
|
|
8024
|
+
React24.useEffect(() => {
|
|
7866
8025
|
setTypedLen(0);
|
|
7867
8026
|
doneCalledRef.current = false;
|
|
7868
8027
|
}, [html]);
|
|
7869
|
-
|
|
8028
|
+
React24.useEffect(() => {
|
|
7870
8029
|
if (!totalLength) return;
|
|
7871
8030
|
if (typedLen >= totalLength) return;
|
|
7872
8031
|
const timer = window.setInterval(() => {
|
|
@@ -7874,33 +8033,33 @@ var HtmlTypeWriter = ({
|
|
|
7874
8033
|
}, duration);
|
|
7875
8034
|
return () => window.clearInterval(timer);
|
|
7876
8035
|
}, [typedLen, totalLength, duration]);
|
|
7877
|
-
|
|
8036
|
+
React24.useEffect(() => {
|
|
7878
8037
|
if (typedLen > 0 && typedLen < totalLength) {
|
|
7879
8038
|
onChange?.();
|
|
7880
8039
|
}
|
|
7881
8040
|
}, [typedLen, totalLength, onChange]);
|
|
7882
|
-
|
|
8041
|
+
React24.useEffect(() => {
|
|
7883
8042
|
if (typedLen === totalLength && totalLength > 0 && !doneCalledRef.current) {
|
|
7884
8043
|
doneCalledRef.current = true;
|
|
7885
8044
|
onDone?.();
|
|
7886
8045
|
}
|
|
7887
8046
|
}, [typedLen, totalLength, onDone]);
|
|
7888
|
-
const parsed =
|
|
8047
|
+
const parsed = React24.useMemo(
|
|
7889
8048
|
() => doc ? htmlToReactProgressive(doc.body, typedLen, rangeMap) : null,
|
|
7890
8049
|
[doc, typedLen, rangeMap]
|
|
7891
8050
|
);
|
|
7892
|
-
return /* @__PURE__ */
|
|
8051
|
+
return /* @__PURE__ */ jsx326("div", { className: "lib-xplat-htmlTypewriter", children: parsed });
|
|
7893
8052
|
};
|
|
7894
8053
|
HtmlTypeWriter.displayName = "HtmlTypeWriter";
|
|
7895
8054
|
var HtmlTypeWriter_default = HtmlTypeWriter;
|
|
7896
8055
|
|
|
7897
8056
|
// src/components/ImageSelector/ImageSelector.tsx
|
|
7898
|
-
import
|
|
7899
|
-
import { jsx as
|
|
8057
|
+
import React25 from "react";
|
|
8058
|
+
import { jsx as jsx327, jsxs as jsxs210 } from "react/jsx-runtime";
|
|
7900
8059
|
var ImageSelector = (props) => {
|
|
7901
8060
|
const { value, label, onChange } = props;
|
|
7902
|
-
const [previewUrl, setPreviewUrl] =
|
|
7903
|
-
|
|
8061
|
+
const [previewUrl, setPreviewUrl] = React25.useState();
|
|
8062
|
+
React25.useEffect(() => {
|
|
7904
8063
|
if (!value) {
|
|
7905
8064
|
setPreviewUrl(void 0);
|
|
7906
8065
|
return;
|
|
@@ -7909,7 +8068,7 @@ var ImageSelector = (props) => {
|
|
|
7909
8068
|
setPreviewUrl(url);
|
|
7910
8069
|
return () => URL.revokeObjectURL(url);
|
|
7911
8070
|
}, [value]);
|
|
7912
|
-
const inputRef =
|
|
8071
|
+
const inputRef = React25.useRef(null);
|
|
7913
8072
|
const handleFileChange = (e) => {
|
|
7914
8073
|
const selectedFile = e.target.files?.[0];
|
|
7915
8074
|
if (selectedFile) {
|
|
@@ -7922,8 +8081,8 @@ var ImageSelector = (props) => {
|
|
|
7922
8081
|
const handleOpenFileDialog = () => {
|
|
7923
8082
|
inputRef.current?.click();
|
|
7924
8083
|
};
|
|
7925
|
-
return /* @__PURE__ */
|
|
7926
|
-
/* @__PURE__ */
|
|
8084
|
+
return /* @__PURE__ */ jsxs210("div", { className: `lib-xplat-imageselector${value ? "" : " none-value"}`, children: [
|
|
8085
|
+
/* @__PURE__ */ jsx327(
|
|
7927
8086
|
"input",
|
|
7928
8087
|
{
|
|
7929
8088
|
type: "file",
|
|
@@ -7933,13 +8092,13 @@ var ImageSelector = (props) => {
|
|
|
7933
8092
|
ref: inputRef
|
|
7934
8093
|
}
|
|
7935
8094
|
),
|
|
7936
|
-
value && /* @__PURE__ */
|
|
7937
|
-
/* @__PURE__ */
|
|
7938
|
-
/* @__PURE__ */
|
|
8095
|
+
value && /* @__PURE__ */ jsxs210("div", { className: "action-bar", children: [
|
|
8096
|
+
/* @__PURE__ */ jsx327("div", { className: "icon-wrapper", onClick: handleOpenFileDialog, children: /* @__PURE__ */ jsx327(UploadIcon_default, {}) }),
|
|
8097
|
+
/* @__PURE__ */ jsx327("div", { className: "icon-wrapper", onClick: handleDeleteFile, children: /* @__PURE__ */ jsx327(DeleteIcon_default, {}) })
|
|
7939
8098
|
] }),
|
|
7940
|
-
/* @__PURE__ */
|
|
7941
|
-
/* @__PURE__ */
|
|
7942
|
-
/* @__PURE__ */
|
|
8099
|
+
/* @__PURE__ */ jsx327("div", { className: "content", children: previewUrl ? /* @__PURE__ */ jsx327("img", { src: previewUrl, alt: "preview" }) : /* @__PURE__ */ jsxs210("div", { className: "skeleton", onClick: handleOpenFileDialog, children: [
|
|
8100
|
+
/* @__PURE__ */ jsx327("div", { className: "icon-wrapper", children: /* @__PURE__ */ jsx327(ImageIcon_default, {}) }),
|
|
8101
|
+
/* @__PURE__ */ jsx327("div", { className: "label", children: label || "\uC774\uBBF8\uC9C0 \uCD94\uAC00\uD558\uAE30" })
|
|
7943
8102
|
] }) })
|
|
7944
8103
|
] });
|
|
7945
8104
|
};
|
|
@@ -7947,7 +8106,7 @@ ImageSelector.displayName = "ImageSelector";
|
|
|
7947
8106
|
var ImageSelector_default = ImageSelector;
|
|
7948
8107
|
|
|
7949
8108
|
// src/components/Pagination/Pagination.tsx
|
|
7950
|
-
import { jsx as
|
|
8109
|
+
import { jsx as jsx328, jsxs as jsxs211 } from "react/jsx-runtime";
|
|
7951
8110
|
var getPageRange = (current, totalPages, siblingCount) => {
|
|
7952
8111
|
const totalNumbers = siblingCount * 2 + 5;
|
|
7953
8112
|
if (totalPages <= totalNumbers) {
|
|
@@ -7990,19 +8149,19 @@ var Pagination = (props) => {
|
|
|
7990
8149
|
onChange?.(page);
|
|
7991
8150
|
}
|
|
7992
8151
|
};
|
|
7993
|
-
return /* @__PURE__ */
|
|
7994
|
-
/* @__PURE__ */
|
|
8152
|
+
return /* @__PURE__ */ jsxs211("nav", { className: clsx_default("lib-xplat-pagination", size, type), "aria-label": "\uD398\uC774\uC9C0 \uB124\uBE44\uAC8C\uC774\uC158", children: [
|
|
8153
|
+
/* @__PURE__ */ jsx328(
|
|
7995
8154
|
"button",
|
|
7996
8155
|
{
|
|
7997
8156
|
className: "page-btn prev",
|
|
7998
8157
|
disabled: current <= 1,
|
|
7999
8158
|
onClick: () => handleClick(current - 1),
|
|
8000
8159
|
"aria-label": "\uC774\uC804 \uD398\uC774\uC9C0",
|
|
8001
|
-
children: /* @__PURE__ */
|
|
8160
|
+
children: /* @__PURE__ */ jsx328(ChevronLeftIcon_default, {})
|
|
8002
8161
|
}
|
|
8003
8162
|
),
|
|
8004
8163
|
pages.map(
|
|
8005
|
-
(page, i) => page === "..." ? /* @__PURE__ */
|
|
8164
|
+
(page, i) => page === "..." ? /* @__PURE__ */ jsx328("span", { className: "dots", children: "..." }, `dots-${i}`) : /* @__PURE__ */ jsx328(
|
|
8006
8165
|
"button",
|
|
8007
8166
|
{
|
|
8008
8167
|
className: clsx_default("page-btn", { active: page === current }),
|
|
@@ -8013,14 +8172,14 @@ var Pagination = (props) => {
|
|
|
8013
8172
|
page
|
|
8014
8173
|
)
|
|
8015
8174
|
),
|
|
8016
|
-
/* @__PURE__ */
|
|
8175
|
+
/* @__PURE__ */ jsx328(
|
|
8017
8176
|
"button",
|
|
8018
8177
|
{
|
|
8019
8178
|
className: "page-btn next",
|
|
8020
8179
|
disabled: current >= totalPages,
|
|
8021
8180
|
onClick: () => handleClick(current + 1),
|
|
8022
8181
|
"aria-label": "\uB2E4\uC74C \uD398\uC774\uC9C0",
|
|
8023
|
-
children: /* @__PURE__ */
|
|
8182
|
+
children: /* @__PURE__ */ jsx328(ChevronRightIcon_default, {})
|
|
8024
8183
|
}
|
|
8025
8184
|
)
|
|
8026
8185
|
] });
|
|
@@ -8029,17 +8188,17 @@ Pagination.displayName = "Pagination";
|
|
|
8029
8188
|
var Pagination_default = Pagination;
|
|
8030
8189
|
|
|
8031
8190
|
// src/components/PopOver/PopOver.tsx
|
|
8032
|
-
import
|
|
8033
|
-
import { jsx as
|
|
8191
|
+
import React26 from "react";
|
|
8192
|
+
import { jsx as jsx329, jsxs as jsxs212 } from "react/jsx-runtime";
|
|
8034
8193
|
var PopOver = (props) => {
|
|
8035
8194
|
const { children, isOpen, onClose, PopOverEl } = props;
|
|
8036
|
-
const popRef =
|
|
8037
|
-
const triggerRef =
|
|
8038
|
-
const [localOpen, setLocalOpen] =
|
|
8039
|
-
const [eventTrigger, setEventTrigger] =
|
|
8195
|
+
const popRef = React26.useRef(null);
|
|
8196
|
+
const triggerRef = React26.useRef(null);
|
|
8197
|
+
const [localOpen, setLocalOpen] = React26.useState(false);
|
|
8198
|
+
const [eventTrigger, setEventTrigger] = React26.useState(false);
|
|
8040
8199
|
useClickOutside_default([popRef, triggerRef], onClose, isOpen);
|
|
8041
8200
|
const position = useAutoPosition_default(triggerRef, popRef, localOpen);
|
|
8042
|
-
|
|
8201
|
+
React26.useEffect(() => {
|
|
8043
8202
|
if (isOpen) {
|
|
8044
8203
|
setLocalOpen(isOpen);
|
|
8045
8204
|
setTimeout(() => {
|
|
@@ -8052,7 +8211,7 @@ var PopOver = (props) => {
|
|
|
8052
8211
|
}, 200);
|
|
8053
8212
|
}
|
|
8054
8213
|
}, [isOpen]);
|
|
8055
|
-
return /* @__PURE__ */
|
|
8214
|
+
return /* @__PURE__ */ jsxs212(
|
|
8056
8215
|
"div",
|
|
8057
8216
|
{
|
|
8058
8217
|
className: "lib-xplat-pop-over",
|
|
@@ -8062,7 +8221,7 @@ var PopOver = (props) => {
|
|
|
8062
8221
|
},
|
|
8063
8222
|
children: [
|
|
8064
8223
|
children,
|
|
8065
|
-
localOpen && /* @__PURE__ */
|
|
8224
|
+
localOpen && /* @__PURE__ */ jsx329(Portal_default, { children: /* @__PURE__ */ jsx329(
|
|
8066
8225
|
"div",
|
|
8067
8226
|
{
|
|
8068
8227
|
className: clsx_default(
|
|
@@ -8085,7 +8244,7 @@ PopOver.displayName = "PopOver";
|
|
|
8085
8244
|
var PopOver_default = PopOver;
|
|
8086
8245
|
|
|
8087
8246
|
// src/components/Progress/Progress.tsx
|
|
8088
|
-
import { jsx as
|
|
8247
|
+
import { jsx as jsx330, jsxs as jsxs213 } from "react/jsx-runtime";
|
|
8089
8248
|
var Progress = (props) => {
|
|
8090
8249
|
const {
|
|
8091
8250
|
value,
|
|
@@ -8095,8 +8254,8 @@ var Progress = (props) => {
|
|
|
8095
8254
|
showLabel = false
|
|
8096
8255
|
} = props;
|
|
8097
8256
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
8098
|
-
return /* @__PURE__ */
|
|
8099
|
-
/* @__PURE__ */
|
|
8257
|
+
return /* @__PURE__ */ jsxs213("div", { className: clsx_default("lib-xplat-progress", size, type), children: [
|
|
8258
|
+
/* @__PURE__ */ jsx330(
|
|
8100
8259
|
"div",
|
|
8101
8260
|
{
|
|
8102
8261
|
className: "track",
|
|
@@ -8104,7 +8263,7 @@ var Progress = (props) => {
|
|
|
8104
8263
|
"aria-valuenow": value,
|
|
8105
8264
|
"aria-valuemin": 0,
|
|
8106
8265
|
"aria-valuemax": max,
|
|
8107
|
-
children: /* @__PURE__ */
|
|
8266
|
+
children: /* @__PURE__ */ jsx330(
|
|
8108
8267
|
"div",
|
|
8109
8268
|
{
|
|
8110
8269
|
className: "bar",
|
|
@@ -8113,7 +8272,7 @@ var Progress = (props) => {
|
|
|
8113
8272
|
)
|
|
8114
8273
|
}
|
|
8115
8274
|
),
|
|
8116
|
-
showLabel && /* @__PURE__ */
|
|
8275
|
+
showLabel && /* @__PURE__ */ jsxs213("span", { className: "label", children: [
|
|
8117
8276
|
Math.round(percentage),
|
|
8118
8277
|
"%"
|
|
8119
8278
|
] })
|
|
@@ -8123,17 +8282,17 @@ Progress.displayName = "Progress";
|
|
|
8123
8282
|
var Progress_default = Progress;
|
|
8124
8283
|
|
|
8125
8284
|
// src/components/Radio/RadioGroupContext.tsx
|
|
8126
|
-
import
|
|
8127
|
-
var RadioGroupContext =
|
|
8285
|
+
import React27 from "react";
|
|
8286
|
+
var RadioGroupContext = React27.createContext(
|
|
8128
8287
|
null
|
|
8129
8288
|
);
|
|
8130
8289
|
var useRadioGroupContext = () => {
|
|
8131
|
-
return
|
|
8290
|
+
return React27.useContext(RadioGroupContext);
|
|
8132
8291
|
};
|
|
8133
8292
|
var RadioGroupContext_default = RadioGroupContext;
|
|
8134
8293
|
|
|
8135
8294
|
// src/components/Radio/Radio.tsx
|
|
8136
|
-
import { jsx as
|
|
8295
|
+
import { jsx as jsx331, jsxs as jsxs214 } from "react/jsx-runtime";
|
|
8137
8296
|
var Radio = (props) => {
|
|
8138
8297
|
const {
|
|
8139
8298
|
label,
|
|
@@ -8151,7 +8310,7 @@ var Radio = (props) => {
|
|
|
8151
8310
|
value,
|
|
8152
8311
|
onChange: rest.onChange
|
|
8153
8312
|
};
|
|
8154
|
-
return /* @__PURE__ */
|
|
8313
|
+
return /* @__PURE__ */ jsxs214(
|
|
8155
8314
|
"label",
|
|
8156
8315
|
{
|
|
8157
8316
|
className: clsx_default(
|
|
@@ -8161,18 +8320,18 @@ var Radio = (props) => {
|
|
|
8161
8320
|
localChecked ? "checked" : void 0
|
|
8162
8321
|
),
|
|
8163
8322
|
children: [
|
|
8164
|
-
/* @__PURE__ */
|
|
8165
|
-
/* @__PURE__ */
|
|
8323
|
+
/* @__PURE__ */ jsx331("input", { ...rest, ...inputProps, checked: localChecked, type: "radio" }),
|
|
8324
|
+
/* @__PURE__ */ jsx331(
|
|
8166
8325
|
"div",
|
|
8167
8326
|
{
|
|
8168
8327
|
className: clsx_default(
|
|
8169
8328
|
"circle",
|
|
8170
8329
|
localChecked ? "checked" : void 0
|
|
8171
8330
|
),
|
|
8172
|
-
children: localChecked && /* @__PURE__ */
|
|
8331
|
+
children: localChecked && /* @__PURE__ */ jsx331("div", { className: "inner-circle" })
|
|
8173
8332
|
}
|
|
8174
8333
|
),
|
|
8175
|
-
label && /* @__PURE__ */
|
|
8334
|
+
label && /* @__PURE__ */ jsx331("span", { children: label })
|
|
8176
8335
|
]
|
|
8177
8336
|
}
|
|
8178
8337
|
);
|
|
@@ -8181,28 +8340,28 @@ Radio.displayName = "Radio";
|
|
|
8181
8340
|
var Radio_default = Radio;
|
|
8182
8341
|
|
|
8183
8342
|
// src/components/Radio/RadioGroup.tsx
|
|
8184
|
-
import { Fragment as Fragment4, jsx as
|
|
8343
|
+
import { Fragment as Fragment4, jsx as jsx332 } from "react/jsx-runtime";
|
|
8185
8344
|
var RadioGroup = (props) => {
|
|
8186
8345
|
const { children, ...rest } = props;
|
|
8187
|
-
return /* @__PURE__ */
|
|
8346
|
+
return /* @__PURE__ */ jsx332(Fragment4, { children: /* @__PURE__ */ jsx332(RadioGroupContext_default.Provider, { value: rest, children }) });
|
|
8188
8347
|
};
|
|
8189
8348
|
RadioGroup.displayName = "RadioGroup";
|
|
8190
8349
|
var RadioGroup_default = RadioGroup;
|
|
8191
8350
|
|
|
8192
8351
|
// src/components/Select/Select.tsx
|
|
8193
|
-
import
|
|
8352
|
+
import React30 from "react";
|
|
8194
8353
|
|
|
8195
8354
|
// src/components/Select/context.ts
|
|
8196
|
-
import
|
|
8197
|
-
var SelectContext =
|
|
8355
|
+
import React28 from "react";
|
|
8356
|
+
var SelectContext = React28.createContext(null);
|
|
8198
8357
|
var context_default = SelectContext;
|
|
8199
8358
|
|
|
8200
8359
|
// src/components/Select/SelectItem.tsx
|
|
8201
|
-
import
|
|
8202
|
-
import { jsx as
|
|
8360
|
+
import React29 from "react";
|
|
8361
|
+
import { jsx as jsx333 } from "react/jsx-runtime";
|
|
8203
8362
|
var SelectItem = (props) => {
|
|
8204
8363
|
const { children, value, onClick, disabled = false } = props;
|
|
8205
|
-
const ctx =
|
|
8364
|
+
const ctx = React29.useContext(context_default);
|
|
8206
8365
|
const handleClick = (e) => {
|
|
8207
8366
|
e.preventDefault();
|
|
8208
8367
|
e.stopPropagation();
|
|
@@ -8211,7 +8370,7 @@ var SelectItem = (props) => {
|
|
|
8211
8370
|
ctx?.close();
|
|
8212
8371
|
onClick?.();
|
|
8213
8372
|
};
|
|
8214
|
-
return /* @__PURE__ */
|
|
8373
|
+
return /* @__PURE__ */ jsx333(
|
|
8215
8374
|
"div",
|
|
8216
8375
|
{
|
|
8217
8376
|
className: clsx_default("select-item", disabled && "disabled"),
|
|
@@ -8232,7 +8391,7 @@ SelectItem.displayName = "Select.Item";
|
|
|
8232
8391
|
var SelectItem_default = SelectItem;
|
|
8233
8392
|
|
|
8234
8393
|
// src/components/Select/Select.tsx
|
|
8235
|
-
import { jsx as
|
|
8394
|
+
import { jsx as jsx334, jsxs as jsxs215 } from "react/jsx-runtime";
|
|
8236
8395
|
var ANIMATION_DURATION_MS3 = 200;
|
|
8237
8396
|
var SelectRoot = (props) => {
|
|
8238
8397
|
const {
|
|
@@ -8244,26 +8403,26 @@ var SelectRoot = (props) => {
|
|
|
8244
8403
|
error = false,
|
|
8245
8404
|
size = "md"
|
|
8246
8405
|
} = props;
|
|
8247
|
-
const itemChildren =
|
|
8248
|
-
(child) =>
|
|
8406
|
+
const itemChildren = React30.Children.toArray(children).filter(
|
|
8407
|
+
(child) => React30.isValidElement(child) && child.type === SelectItem_default
|
|
8249
8408
|
);
|
|
8250
8409
|
const isControlled = valueProp !== void 0;
|
|
8251
|
-
const [isOpen, setOpen] =
|
|
8252
|
-
const [uncontrolledLabel, setUncontrolledLabel] =
|
|
8253
|
-
const controlledLabel =
|
|
8410
|
+
const [isOpen, setOpen] = React30.useState(false);
|
|
8411
|
+
const [uncontrolledLabel, setUncontrolledLabel] = React30.useState(null);
|
|
8412
|
+
const controlledLabel = React30.useMemo(() => {
|
|
8254
8413
|
if (!isControlled) return null;
|
|
8255
8414
|
const match = itemChildren.find((child) => child.props.value === valueProp);
|
|
8256
8415
|
return match ? match.props.children : null;
|
|
8257
8416
|
}, [isControlled, valueProp, itemChildren]);
|
|
8258
8417
|
const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
|
|
8259
|
-
const triggerRef =
|
|
8260
|
-
const contentRef =
|
|
8261
|
-
const [mounted, setMounted] =
|
|
8262
|
-
const [visible, setVisible] =
|
|
8263
|
-
|
|
8418
|
+
const triggerRef = React30.useRef(null);
|
|
8419
|
+
const contentRef = React30.useRef(null);
|
|
8420
|
+
const [mounted, setMounted] = React30.useState(false);
|
|
8421
|
+
const [visible, setVisible] = React30.useState(false);
|
|
8422
|
+
React30.useEffect(() => {
|
|
8264
8423
|
if (disabled && isOpen) setOpen(false);
|
|
8265
8424
|
}, [disabled, isOpen]);
|
|
8266
|
-
|
|
8425
|
+
React30.useEffect(() => {
|
|
8267
8426
|
if (isOpen) {
|
|
8268
8427
|
setMounted(true);
|
|
8269
8428
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -8273,12 +8432,12 @@ var SelectRoot = (props) => {
|
|
|
8273
8432
|
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS3);
|
|
8274
8433
|
return () => clearTimeout(t);
|
|
8275
8434
|
}, [isOpen]);
|
|
8276
|
-
const open =
|
|
8277
|
-
const close =
|
|
8278
|
-
const toggle =
|
|
8435
|
+
const open = React30.useCallback(() => setOpen(true), []);
|
|
8436
|
+
const close = React30.useCallback(() => setOpen(false), []);
|
|
8437
|
+
const toggle = React30.useCallback(() => setOpen((prev) => !prev), []);
|
|
8279
8438
|
useClickOutside_default([contentRef, triggerRef], close, isOpen);
|
|
8280
8439
|
const position = useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
8281
|
-
const setSelected =
|
|
8440
|
+
const setSelected = React30.useCallback(
|
|
8282
8441
|
(label, itemValue) => {
|
|
8283
8442
|
if (!isControlled) {
|
|
8284
8443
|
setUncontrolledLabel(label);
|
|
@@ -8287,7 +8446,7 @@ var SelectRoot = (props) => {
|
|
|
8287
8446
|
},
|
|
8288
8447
|
[isControlled, onChange]
|
|
8289
8448
|
);
|
|
8290
|
-
const ctxValue =
|
|
8449
|
+
const ctxValue = React30.useMemo(
|
|
8291
8450
|
() => ({
|
|
8292
8451
|
isOpen,
|
|
8293
8452
|
mounted,
|
|
@@ -8308,7 +8467,7 @@ var SelectRoot = (props) => {
|
|
|
8308
8467
|
if (disabled) return;
|
|
8309
8468
|
toggle();
|
|
8310
8469
|
};
|
|
8311
|
-
return /* @__PURE__ */
|
|
8470
|
+
return /* @__PURE__ */ jsx334(context_default.Provider, { value: ctxValue, children: /* @__PURE__ */ jsxs215(
|
|
8312
8471
|
"div",
|
|
8313
8472
|
{
|
|
8314
8473
|
className: clsx_default(
|
|
@@ -8319,7 +8478,7 @@ var SelectRoot = (props) => {
|
|
|
8319
8478
|
mounted && "is-open"
|
|
8320
8479
|
),
|
|
8321
8480
|
children: [
|
|
8322
|
-
/* @__PURE__ */
|
|
8481
|
+
/* @__PURE__ */ jsxs215(
|
|
8323
8482
|
"div",
|
|
8324
8483
|
{
|
|
8325
8484
|
ref: triggerRef,
|
|
@@ -8343,7 +8502,7 @@ var SelectRoot = (props) => {
|
|
|
8343
8502
|
}
|
|
8344
8503
|
},
|
|
8345
8504
|
children: [
|
|
8346
|
-
/* @__PURE__ */
|
|
8505
|
+
/* @__PURE__ */ jsx334(
|
|
8347
8506
|
"span",
|
|
8348
8507
|
{
|
|
8349
8508
|
className: clsx_default(
|
|
@@ -8353,25 +8512,25 @@ var SelectRoot = (props) => {
|
|
|
8353
8512
|
children: selectedLabel ?? placeholder
|
|
8354
8513
|
}
|
|
8355
8514
|
),
|
|
8356
|
-
/* @__PURE__ */
|
|
8515
|
+
/* @__PURE__ */ jsx334(
|
|
8357
8516
|
"span",
|
|
8358
8517
|
{
|
|
8359
8518
|
className: clsx_default("select-trigger-icon", isOpen && "open"),
|
|
8360
8519
|
"aria-hidden": true,
|
|
8361
|
-
children: /* @__PURE__ */
|
|
8520
|
+
children: /* @__PURE__ */ jsx334(ChevronDownIcon_default, {})
|
|
8362
8521
|
}
|
|
8363
8522
|
)
|
|
8364
8523
|
]
|
|
8365
8524
|
}
|
|
8366
8525
|
),
|
|
8367
|
-
mounted && /* @__PURE__ */
|
|
8526
|
+
mounted && /* @__PURE__ */ jsx334(Portal_default, { children: /* @__PURE__ */ jsx334(
|
|
8368
8527
|
"div",
|
|
8369
8528
|
{
|
|
8370
8529
|
className: clsx_default("lib-xplat-select-content", position.direction, stateClass),
|
|
8371
8530
|
ref: contentRef,
|
|
8372
8531
|
style: { ...position.position, width: triggerRef.current?.offsetWidth },
|
|
8373
8532
|
role: "listbox",
|
|
8374
|
-
children: /* @__PURE__ */
|
|
8533
|
+
children: /* @__PURE__ */ jsx334(context_default.Provider, { value: ctxValue, children: itemChildren })
|
|
8375
8534
|
}
|
|
8376
8535
|
) })
|
|
8377
8536
|
]
|
|
@@ -8385,7 +8544,7 @@ var Select = Object.assign(SelectRoot, {
|
|
|
8385
8544
|
var Select_default = Select;
|
|
8386
8545
|
|
|
8387
8546
|
// src/components/Skeleton/Skeleton.tsx
|
|
8388
|
-
import { jsx as
|
|
8547
|
+
import { jsx as jsx335 } from "react/jsx-runtime";
|
|
8389
8548
|
var SIZE_MAP = {
|
|
8390
8549
|
xs: "var(--spacing-size-1)",
|
|
8391
8550
|
sm: "var(--spacing-size-2)",
|
|
@@ -8401,7 +8560,7 @@ var Skeleton = (props) => {
|
|
|
8401
8560
|
...width != null && { width: SIZE_MAP[width] },
|
|
8402
8561
|
...height != null && { height: SIZE_MAP[height] }
|
|
8403
8562
|
};
|
|
8404
|
-
return /* @__PURE__ */
|
|
8563
|
+
return /* @__PURE__ */ jsx335(
|
|
8405
8564
|
"div",
|
|
8406
8565
|
{
|
|
8407
8566
|
className: clsx_default("lib-xplat-skeleton", variant),
|
|
@@ -8414,20 +8573,20 @@ Skeleton.displayName = "Skeleton";
|
|
|
8414
8573
|
var Skeleton_default = Skeleton;
|
|
8415
8574
|
|
|
8416
8575
|
// src/components/Spinner/Spinner.tsx
|
|
8417
|
-
import { jsx as
|
|
8576
|
+
import { jsx as jsx336, jsxs as jsxs216 } from "react/jsx-runtime";
|
|
8418
8577
|
var Spinner = (props) => {
|
|
8419
8578
|
const {
|
|
8420
8579
|
size = "md",
|
|
8421
8580
|
type = "brand"
|
|
8422
8581
|
} = props;
|
|
8423
|
-
return /* @__PURE__ */
|
|
8582
|
+
return /* @__PURE__ */ jsx336(
|
|
8424
8583
|
"div",
|
|
8425
8584
|
{
|
|
8426
8585
|
className: clsx_default("lib-xplat-spinner", size, type),
|
|
8427
8586
|
role: "status",
|
|
8428
8587
|
"aria-label": "\uB85C\uB529 \uC911",
|
|
8429
|
-
children: /* @__PURE__ */
|
|
8430
|
-
/* @__PURE__ */
|
|
8588
|
+
children: /* @__PURE__ */ jsxs216("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
8589
|
+
/* @__PURE__ */ jsx336(
|
|
8431
8590
|
"circle",
|
|
8432
8591
|
{
|
|
8433
8592
|
className: "track",
|
|
@@ -8437,7 +8596,7 @@ var Spinner = (props) => {
|
|
|
8437
8596
|
strokeWidth: "3"
|
|
8438
8597
|
}
|
|
8439
8598
|
),
|
|
8440
|
-
/* @__PURE__ */
|
|
8599
|
+
/* @__PURE__ */ jsx336(
|
|
8441
8600
|
"circle",
|
|
8442
8601
|
{
|
|
8443
8602
|
className: "indicator",
|
|
@@ -8456,20 +8615,20 @@ Spinner.displayName = "Spinner";
|
|
|
8456
8615
|
var Spinner_default = Spinner;
|
|
8457
8616
|
|
|
8458
8617
|
// src/components/Steps/Steps.tsx
|
|
8459
|
-
import { jsx as
|
|
8618
|
+
import { jsx as jsx337, jsxs as jsxs217 } from "react/jsx-runtime";
|
|
8460
8619
|
var Steps = (props) => {
|
|
8461
8620
|
const {
|
|
8462
8621
|
items,
|
|
8463
8622
|
current,
|
|
8464
8623
|
type = "brand"
|
|
8465
8624
|
} = props;
|
|
8466
|
-
return /* @__PURE__ */
|
|
8625
|
+
return /* @__PURE__ */ jsx337("div", { className: clsx_default("lib-xplat-steps", type), children: items.map((item, index) => {
|
|
8467
8626
|
const status = index < current ? "completed" : index === current ? "active" : "pending";
|
|
8468
|
-
return /* @__PURE__ */
|
|
8469
|
-
/* @__PURE__ */
|
|
8470
|
-
/* @__PURE__ */
|
|
8471
|
-
/* @__PURE__ */
|
|
8472
|
-
item.description && /* @__PURE__ */
|
|
8627
|
+
return /* @__PURE__ */ jsxs217("div", { className: clsx_default("step-item", status), children: [
|
|
8628
|
+
/* @__PURE__ */ jsx337("div", { className: "step-circle", children: status === "completed" ? /* @__PURE__ */ jsx337(CheckIcon_default, {}) : /* @__PURE__ */ jsx337("span", { children: index + 1 }) }),
|
|
8629
|
+
/* @__PURE__ */ jsxs217("div", { className: "step-content", children: [
|
|
8630
|
+
/* @__PURE__ */ jsx337("span", { className: "step-title", children: item.title }),
|
|
8631
|
+
item.description && /* @__PURE__ */ jsx337("span", { className: "step-description", children: item.description })
|
|
8473
8632
|
] })
|
|
8474
8633
|
] }, index);
|
|
8475
8634
|
}) });
|
|
@@ -8478,8 +8637,8 @@ Steps.displayName = "Steps";
|
|
|
8478
8637
|
var Steps_default = Steps;
|
|
8479
8638
|
|
|
8480
8639
|
// src/components/Swiper/Swiper.tsx
|
|
8481
|
-
import
|
|
8482
|
-
import { jsx as
|
|
8640
|
+
import React31 from "react";
|
|
8641
|
+
import { jsx as jsx338, jsxs as jsxs218 } from "react/jsx-runtime";
|
|
8483
8642
|
var Swiper = (props) => {
|
|
8484
8643
|
const {
|
|
8485
8644
|
auto = false,
|
|
@@ -8502,23 +8661,23 @@ var Swiper = (props) => {
|
|
|
8502
8661
|
const maxIndex = Math.max(0, totalSlides - viewItemCount);
|
|
8503
8662
|
const useLoop = loop && canSlide;
|
|
8504
8663
|
const cloneCount = useLoop ? totalSlides : 0;
|
|
8505
|
-
const extendedItems =
|
|
8664
|
+
const extendedItems = React31.useMemo(() => {
|
|
8506
8665
|
if (!useLoop) return items;
|
|
8507
8666
|
return [...items, ...items, ...items];
|
|
8508
8667
|
}, [items, useLoop]);
|
|
8509
8668
|
const initialIdx = Math.max(0, Math.min(indexProp ?? 0, maxIndex));
|
|
8510
|
-
const [innerIndex, setInnerIndex] =
|
|
8669
|
+
const [innerIndex, setInnerIndex] = React31.useState(
|
|
8511
8670
|
useLoop ? cloneCount + initialIdx : initialIdx
|
|
8512
8671
|
);
|
|
8513
|
-
const [isDragging, setIsDragging] =
|
|
8514
|
-
const [dragOffset, setDragOffset] =
|
|
8515
|
-
const [animated, setAnimated] =
|
|
8516
|
-
const [containerWidth, setContainerWidth] =
|
|
8517
|
-
const containerRef =
|
|
8518
|
-
const startXRef =
|
|
8519
|
-
const startTimeRef =
|
|
8520
|
-
const autoplayTimerRef =
|
|
8521
|
-
|
|
8672
|
+
const [isDragging, setIsDragging] = React31.useState(false);
|
|
8673
|
+
const [dragOffset, setDragOffset] = React31.useState(0);
|
|
8674
|
+
const [animated, setAnimated] = React31.useState(true);
|
|
8675
|
+
const [containerWidth, setContainerWidth] = React31.useState(0);
|
|
8676
|
+
const containerRef = React31.useRef(null);
|
|
8677
|
+
const startXRef = React31.useRef(0);
|
|
8678
|
+
const startTimeRef = React31.useRef(0);
|
|
8679
|
+
const autoplayTimerRef = React31.useRef(null);
|
|
8680
|
+
React31.useEffect(() => {
|
|
8522
8681
|
const el = containerRef.current;
|
|
8523
8682
|
if (!el) return;
|
|
8524
8683
|
const ro = new ResizeObserver((entries) => {
|
|
@@ -8537,7 +8696,7 @@ var Swiper = (props) => {
|
|
|
8537
8696
|
return ((inner - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
8538
8697
|
};
|
|
8539
8698
|
const realIndex = getRealIndex(innerIndex);
|
|
8540
|
-
const moveToInner =
|
|
8699
|
+
const moveToInner = React31.useCallback(
|
|
8541
8700
|
(idx, withAnim = true) => {
|
|
8542
8701
|
if (!useLoop) {
|
|
8543
8702
|
setAnimated(withAnim);
|
|
@@ -8565,7 +8724,7 @@ var Swiper = (props) => {
|
|
|
8565
8724
|
},
|
|
8566
8725
|
[useLoop, cloneCount, totalSlides]
|
|
8567
8726
|
);
|
|
8568
|
-
const handleTransitionEnd =
|
|
8727
|
+
const handleTransitionEnd = React31.useCallback(() => {
|
|
8569
8728
|
if (!useLoop) return;
|
|
8570
8729
|
const real = getRealIndex(innerIndex);
|
|
8571
8730
|
const canonical = cloneCount + real;
|
|
@@ -8575,7 +8734,7 @@ var Swiper = (props) => {
|
|
|
8575
8734
|
}
|
|
8576
8735
|
onChange?.(Math.min(real, maxIndex));
|
|
8577
8736
|
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange]);
|
|
8578
|
-
const slideTo =
|
|
8737
|
+
const slideTo = React31.useCallback(
|
|
8579
8738
|
(logicalIndex) => {
|
|
8580
8739
|
if (!canSlide) return;
|
|
8581
8740
|
const clamped = useLoop ? logicalIndex : Math.max(0, Math.min(logicalIndex, maxIndex));
|
|
@@ -8585,7 +8744,7 @@ var Swiper = (props) => {
|
|
|
8585
8744
|
},
|
|
8586
8745
|
[canSlide, useLoop, cloneCount, maxIndex, onChange, moveToInner]
|
|
8587
8746
|
);
|
|
8588
|
-
const slideNext =
|
|
8747
|
+
const slideNext = React31.useCallback(() => {
|
|
8589
8748
|
if (!canSlide) return;
|
|
8590
8749
|
const nextInner = innerIndex + slideBy;
|
|
8591
8750
|
if (useLoop) {
|
|
@@ -8594,7 +8753,7 @@ var Swiper = (props) => {
|
|
|
8594
8753
|
moveToInner(Math.min(nextInner, maxIndex), true);
|
|
8595
8754
|
}
|
|
8596
8755
|
}, [canSlide, useLoop, innerIndex, slideBy, maxIndex, moveToInner]);
|
|
8597
|
-
const slidePrev =
|
|
8756
|
+
const slidePrev = React31.useCallback(() => {
|
|
8598
8757
|
if (!canSlide) return;
|
|
8599
8758
|
const prevInner = innerIndex - slideBy;
|
|
8600
8759
|
if (useLoop) {
|
|
@@ -8603,7 +8762,7 @@ var Swiper = (props) => {
|
|
|
8603
8762
|
moveToInner(Math.max(prevInner, 0), true);
|
|
8604
8763
|
}
|
|
8605
8764
|
}, [canSlide, useLoop, innerIndex, slideBy, moveToInner]);
|
|
8606
|
-
|
|
8765
|
+
React31.useEffect(() => {
|
|
8607
8766
|
if (indexProp === void 0) return;
|
|
8608
8767
|
const clamped = Math.max(0, Math.min(indexProp, maxIndex));
|
|
8609
8768
|
const target = useLoop ? cloneCount + clamped : clamped;
|
|
@@ -8611,12 +8770,12 @@ var Swiper = (props) => {
|
|
|
8611
8770
|
moveToInner(target, true);
|
|
8612
8771
|
}
|
|
8613
8772
|
}, [indexProp]);
|
|
8614
|
-
|
|
8773
|
+
React31.useImperativeHandle(swiperRef, () => ({
|
|
8615
8774
|
slidePrev,
|
|
8616
8775
|
slideNext,
|
|
8617
8776
|
slideTo
|
|
8618
8777
|
}));
|
|
8619
|
-
|
|
8778
|
+
React31.useEffect(() => {
|
|
8620
8779
|
if (!auto || !canSlide) return;
|
|
8621
8780
|
autoplayTimerRef.current = setInterval(slideNext, autoplayDelay);
|
|
8622
8781
|
return () => {
|
|
@@ -8639,7 +8798,7 @@ var Swiper = (props) => {
|
|
|
8639
8798
|
startXRef.current = getClientX(e);
|
|
8640
8799
|
startTimeRef.current = Date.now();
|
|
8641
8800
|
};
|
|
8642
|
-
|
|
8801
|
+
React31.useEffect(() => {
|
|
8643
8802
|
if (!isDragging) return;
|
|
8644
8803
|
const handleMove = (e) => {
|
|
8645
8804
|
setDragOffset(getClientX(e) - startXRef.current);
|
|
@@ -8677,8 +8836,8 @@ var Swiper = (props) => {
|
|
|
8677
8836
|
}, [isDragging, dragOffset, innerIndex, useLoop, maxIndex, slideStep, moveToInner]);
|
|
8678
8837
|
const slideWidthPercent = 100 / viewItemCount;
|
|
8679
8838
|
const gapAdjust = spaceBetween * (viewItemCount - 1) / viewItemCount;
|
|
8680
|
-
const slideElements =
|
|
8681
|
-
() => extendedItems.map((item, idx) => /* @__PURE__ */
|
|
8839
|
+
const slideElements = React31.useMemo(
|
|
8840
|
+
() => extendedItems.map((item, idx) => /* @__PURE__ */ jsx338(
|
|
8682
8841
|
"div",
|
|
8683
8842
|
{
|
|
8684
8843
|
className: "lib-xplat-swiper__slide",
|
|
@@ -8697,14 +8856,14 @@ var Swiper = (props) => {
|
|
|
8697
8856
|
Math.floor(realIndex / slideBy),
|
|
8698
8857
|
totalSteps - 1
|
|
8699
8858
|
);
|
|
8700
|
-
return /* @__PURE__ */
|
|
8701
|
-
/* @__PURE__ */
|
|
8859
|
+
return /* @__PURE__ */ jsxs218("div", { className: "lib-xplat-swiper", ref: containerRef, children: [
|
|
8860
|
+
/* @__PURE__ */ jsx338(
|
|
8702
8861
|
"div",
|
|
8703
8862
|
{
|
|
8704
8863
|
className: "lib-xplat-swiper__viewport",
|
|
8705
8864
|
onMouseDown: handleDragStart,
|
|
8706
8865
|
onTouchStart: handleDragStart,
|
|
8707
|
-
children: /* @__PURE__ */
|
|
8866
|
+
children: /* @__PURE__ */ jsx338(
|
|
8708
8867
|
"div",
|
|
8709
8868
|
{
|
|
8710
8869
|
className: clsx_default(
|
|
@@ -8722,7 +8881,7 @@ var Swiper = (props) => {
|
|
|
8722
8881
|
)
|
|
8723
8882
|
}
|
|
8724
8883
|
),
|
|
8725
|
-
showProgress && canSlide && /* @__PURE__ */
|
|
8884
|
+
showProgress && canSlide && /* @__PURE__ */ jsx338("div", { className: "lib-xplat-swiper__progress", children: /* @__PURE__ */ jsx338("div", { className: "lib-xplat-swiper__progress-track", children: /* @__PURE__ */ jsx338(
|
|
8726
8885
|
"span",
|
|
8727
8886
|
{
|
|
8728
8887
|
className: "lib-xplat-swiper__progress-fill",
|
|
@@ -8732,7 +8891,7 @@ var Swiper = (props) => {
|
|
|
8732
8891
|
}
|
|
8733
8892
|
}
|
|
8734
8893
|
) }) }),
|
|
8735
|
-
canSlide && /* @__PURE__ */
|
|
8894
|
+
canSlide && /* @__PURE__ */ jsx338("div", { className: "lib-xplat-swiper__dots", children: Array.from({ length: totalSteps }, (_, i) => /* @__PURE__ */ jsx338(
|
|
8736
8895
|
"button",
|
|
8737
8896
|
{
|
|
8738
8897
|
className: clsx_default(
|
|
@@ -8750,8 +8909,8 @@ Swiper.displayName = "Swiper";
|
|
|
8750
8909
|
var Swiper_default = Swiper;
|
|
8751
8910
|
|
|
8752
8911
|
// src/components/Switch/Switch.tsx
|
|
8753
|
-
import
|
|
8754
|
-
import { jsx as
|
|
8912
|
+
import React32 from "react";
|
|
8913
|
+
import { jsx as jsx339 } from "react/jsx-runtime";
|
|
8755
8914
|
var KNOB_TRANSITION_MS = 250;
|
|
8756
8915
|
var Switch = (props) => {
|
|
8757
8916
|
const {
|
|
@@ -8761,9 +8920,9 @@ var Switch = (props) => {
|
|
|
8761
8920
|
disabled,
|
|
8762
8921
|
onChange
|
|
8763
8922
|
} = props;
|
|
8764
|
-
const [isAnimating, setIsAnimating] =
|
|
8765
|
-
const timeoutRef =
|
|
8766
|
-
|
|
8923
|
+
const [isAnimating, setIsAnimating] = React32.useState(false);
|
|
8924
|
+
const timeoutRef = React32.useRef(null);
|
|
8925
|
+
React32.useEffect(() => {
|
|
8767
8926
|
return () => {
|
|
8768
8927
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
8769
8928
|
};
|
|
@@ -8778,7 +8937,7 @@ var Switch = (props) => {
|
|
|
8778
8937
|
timeoutRef.current = null;
|
|
8779
8938
|
}, KNOB_TRANSITION_MS);
|
|
8780
8939
|
};
|
|
8781
|
-
return /* @__PURE__ */
|
|
8940
|
+
return /* @__PURE__ */ jsx339(
|
|
8782
8941
|
"div",
|
|
8783
8942
|
{
|
|
8784
8943
|
className: clsx_default(
|
|
@@ -8791,7 +8950,7 @@ var Switch = (props) => {
|
|
|
8791
8950
|
),
|
|
8792
8951
|
onClick: handleClick,
|
|
8793
8952
|
"aria-disabled": disabled || isAnimating,
|
|
8794
|
-
children: /* @__PURE__ */
|
|
8953
|
+
children: /* @__PURE__ */ jsx339("div", { className: clsx_default("knob", value ? "checked" : void 0) })
|
|
8795
8954
|
}
|
|
8796
8955
|
);
|
|
8797
8956
|
};
|
|
@@ -8799,26 +8958,27 @@ Switch.displayName = "Switch";
|
|
|
8799
8958
|
var Switch_default = Switch;
|
|
8800
8959
|
|
|
8801
8960
|
// src/components/Table/TableContext.tsx
|
|
8802
|
-
import
|
|
8803
|
-
var TableContext =
|
|
8961
|
+
import React33 from "react";
|
|
8962
|
+
var TableContext = React33.createContext(null);
|
|
8804
8963
|
var useTableContext = () => {
|
|
8805
|
-
const ctx =
|
|
8964
|
+
const ctx = React33.useContext(TableContext);
|
|
8806
8965
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
8807
8966
|
return ctx;
|
|
8808
8967
|
};
|
|
8809
8968
|
var TableContext_default = TableContext;
|
|
8810
8969
|
|
|
8811
8970
|
// src/components/Table/Table.tsx
|
|
8812
|
-
import { jsx as
|
|
8971
|
+
import { jsx as jsx340 } from "react/jsx-runtime";
|
|
8813
8972
|
var Table = (props) => {
|
|
8814
8973
|
const {
|
|
8815
8974
|
children,
|
|
8975
|
+
size = "md",
|
|
8816
8976
|
rowBorderUse = true,
|
|
8817
8977
|
colBorderUse = true,
|
|
8818
8978
|
headerSticky = false,
|
|
8819
8979
|
stickyShadow = true
|
|
8820
8980
|
} = props;
|
|
8821
|
-
return /* @__PURE__ */
|
|
8981
|
+
return /* @__PURE__ */ jsx340("div", { className: `lib-xplat-table-wrapper ${size}`, children: /* @__PURE__ */ jsx340(
|
|
8822
8982
|
TableContext_default.Provider,
|
|
8823
8983
|
{
|
|
8824
8984
|
value: {
|
|
@@ -8827,7 +8987,7 @@ var Table = (props) => {
|
|
|
8827
8987
|
headerSticky,
|
|
8828
8988
|
stickyShadow
|
|
8829
8989
|
},
|
|
8830
|
-
children: /* @__PURE__ */
|
|
8990
|
+
children: /* @__PURE__ */ jsx340("table", { className: "lib-xplat-table", children })
|
|
8831
8991
|
}
|
|
8832
8992
|
) });
|
|
8833
8993
|
};
|
|
@@ -8835,41 +8995,41 @@ Table.displayName = "Table";
|
|
|
8835
8995
|
var Table_default = Table;
|
|
8836
8996
|
|
|
8837
8997
|
// src/components/Table/TableBody.tsx
|
|
8838
|
-
import { jsx as
|
|
8998
|
+
import { jsx as jsx341 } from "react/jsx-runtime";
|
|
8839
8999
|
var TableBody = (props) => {
|
|
8840
9000
|
const { children } = props;
|
|
8841
|
-
return /* @__PURE__ */
|
|
9001
|
+
return /* @__PURE__ */ jsx341("tbody", { children });
|
|
8842
9002
|
};
|
|
8843
9003
|
TableBody.displayName = "TableBody";
|
|
8844
9004
|
var TableBody_default = TableBody;
|
|
8845
9005
|
|
|
8846
9006
|
// src/components/Table/TableCell.tsx
|
|
8847
|
-
import
|
|
9007
|
+
import React36 from "react";
|
|
8848
9008
|
|
|
8849
9009
|
// src/components/Table/TableHeadContext.tsx
|
|
8850
|
-
import
|
|
8851
|
-
var TableHeadContext =
|
|
9010
|
+
import React34 from "react";
|
|
9011
|
+
var TableHeadContext = React34.createContext(
|
|
8852
9012
|
null
|
|
8853
9013
|
);
|
|
8854
9014
|
var useTableHeadContext = () => {
|
|
8855
|
-
const ctx =
|
|
9015
|
+
const ctx = React34.useContext(TableHeadContext);
|
|
8856
9016
|
return ctx;
|
|
8857
9017
|
};
|
|
8858
9018
|
var TableHeadContext_default = TableHeadContext;
|
|
8859
9019
|
|
|
8860
9020
|
// src/components/Table/TableRowContext.tsx
|
|
8861
|
-
import
|
|
8862
|
-
var TableRowContext =
|
|
9021
|
+
import React35 from "react";
|
|
9022
|
+
var TableRowContext = React35.createContext(null);
|
|
8863
9023
|
var useTableRowContext = () => {
|
|
8864
|
-
const ctx =
|
|
9024
|
+
const ctx = React35.useContext(TableRowContext);
|
|
8865
9025
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
8866
9026
|
return ctx;
|
|
8867
9027
|
};
|
|
8868
9028
|
var TableRowContext_default = TableRowContext;
|
|
8869
9029
|
|
|
8870
9030
|
// src/components/Table/TableCell.tsx
|
|
8871
|
-
import { jsx as
|
|
8872
|
-
var TableCell =
|
|
9031
|
+
import { jsx as jsx342 } from "react/jsx-runtime";
|
|
9032
|
+
var TableCell = React36.memo((props) => {
|
|
8873
9033
|
const {
|
|
8874
9034
|
children,
|
|
8875
9035
|
align = "center",
|
|
@@ -8881,9 +9041,9 @@ var TableCell = React34.memo((props) => {
|
|
|
8881
9041
|
const { registerStickyCell, stickyCells } = useTableRowContext();
|
|
8882
9042
|
const { stickyShadow } = useTableContext();
|
|
8883
9043
|
const headContext = useTableHeadContext();
|
|
8884
|
-
const [left, setLeft] =
|
|
8885
|
-
const cellRef =
|
|
8886
|
-
const calculateLeft =
|
|
9044
|
+
const [left, setLeft] = React36.useState(0);
|
|
9045
|
+
const cellRef = React36.useRef(null);
|
|
9046
|
+
const calculateLeft = React36.useCallback(() => {
|
|
8887
9047
|
if (!cellRef.current) return 0;
|
|
8888
9048
|
let totalLeft = 0;
|
|
8889
9049
|
for (const ref of stickyCells) {
|
|
@@ -8892,7 +9052,7 @@ var TableCell = React34.memo((props) => {
|
|
|
8892
9052
|
}
|
|
8893
9053
|
return totalLeft;
|
|
8894
9054
|
}, [stickyCells]);
|
|
8895
|
-
|
|
9055
|
+
React36.useEffect(() => {
|
|
8896
9056
|
if (!isSticky || !cellRef.current) return;
|
|
8897
9057
|
registerStickyCell(cellRef);
|
|
8898
9058
|
setLeft(calculateLeft());
|
|
@@ -8910,7 +9070,7 @@ var TableCell = React34.memo((props) => {
|
|
|
8910
9070
|
const CellTag = cellRef.current?.tagName === "TH" ? "th" : "td";
|
|
8911
9071
|
const isLastSticky = isSticky && stickyCells[stickyCells.length - 1] === cellRef;
|
|
8912
9072
|
const enableHover = headContext && headContext.cellHover;
|
|
8913
|
-
return /* @__PURE__ */
|
|
9073
|
+
return /* @__PURE__ */ jsx342(
|
|
8914
9074
|
CellTag,
|
|
8915
9075
|
{
|
|
8916
9076
|
ref: cellRef,
|
|
@@ -8935,21 +9095,21 @@ TableCell.displayName = "TableCell";
|
|
|
8935
9095
|
var TableCell_default = TableCell;
|
|
8936
9096
|
|
|
8937
9097
|
// src/components/Table/TableHead.tsx
|
|
8938
|
-
import { jsx as
|
|
9098
|
+
import { jsx as jsx343 } from "react/jsx-runtime";
|
|
8939
9099
|
var TableHead = ({
|
|
8940
9100
|
children,
|
|
8941
9101
|
cellHover = false
|
|
8942
9102
|
}) => {
|
|
8943
9103
|
const { headerSticky } = useTableContext();
|
|
8944
|
-
return /* @__PURE__ */
|
|
9104
|
+
return /* @__PURE__ */ jsx343(TableHeadContext_default.Provider, { value: { cellHover }, children: /* @__PURE__ */ jsx343("thead", { className: clsx_default(headerSticky ? "table-sticky" : null), children }) });
|
|
8945
9105
|
};
|
|
8946
9106
|
TableHead.displayName = "TableHead";
|
|
8947
9107
|
var TableHead_default = TableHead;
|
|
8948
9108
|
|
|
8949
9109
|
// src/components/Table/TableRow.tsx
|
|
8950
|
-
import
|
|
8951
|
-
import { jsx as
|
|
8952
|
-
var TableRow =
|
|
9110
|
+
import React37 from "react";
|
|
9111
|
+
import { jsx as jsx344 } from "react/jsx-runtime";
|
|
9112
|
+
var TableRow = React37.memo((props) => {
|
|
8953
9113
|
const {
|
|
8954
9114
|
children,
|
|
8955
9115
|
type = "secondary",
|
|
@@ -8957,14 +9117,14 @@ var TableRow = React35.memo((props) => {
|
|
|
8957
9117
|
onClick
|
|
8958
9118
|
} = props;
|
|
8959
9119
|
const { rowBorderUse } = useTableContext();
|
|
8960
|
-
const [stickyCells, setStickyCells] =
|
|
9120
|
+
const [stickyCells, setStickyCells] = React37.useState([]);
|
|
8961
9121
|
const registerStickyCell = (ref) => {
|
|
8962
9122
|
setStickyCells((prev) => {
|
|
8963
9123
|
if (prev.includes(ref)) return prev;
|
|
8964
9124
|
return [...prev, ref];
|
|
8965
9125
|
});
|
|
8966
9126
|
};
|
|
8967
|
-
return /* @__PURE__ */
|
|
9127
|
+
return /* @__PURE__ */ jsx344(TableRowContext_default.Provider, { value: { stickyCells, registerStickyCell }, children: /* @__PURE__ */ jsx344(
|
|
8968
9128
|
"tr",
|
|
8969
9129
|
{
|
|
8970
9130
|
className: clsx_default(
|
|
@@ -8982,7 +9142,7 @@ TableRow.displayName = "TableRow";
|
|
|
8982
9142
|
var TableRow_default = TableRow;
|
|
8983
9143
|
|
|
8984
9144
|
// src/components/Tag/Tag.tsx
|
|
8985
|
-
import { jsx as
|
|
9145
|
+
import { jsx as jsx345, jsxs as jsxs219 } from "react/jsx-runtime";
|
|
8986
9146
|
var Tag = (props) => {
|
|
8987
9147
|
const {
|
|
8988
9148
|
children,
|
|
@@ -8992,7 +9152,7 @@ var Tag = (props) => {
|
|
|
8992
9152
|
disabled = false,
|
|
8993
9153
|
colorIndex
|
|
8994
9154
|
} = props;
|
|
8995
|
-
return /* @__PURE__ */
|
|
9155
|
+
return /* @__PURE__ */ jsxs219(
|
|
8996
9156
|
"span",
|
|
8997
9157
|
{
|
|
8998
9158
|
className: clsx_default(
|
|
@@ -9003,8 +9163,8 @@ var Tag = (props) => {
|
|
|
9003
9163
|
disabled && "disabled"
|
|
9004
9164
|
),
|
|
9005
9165
|
children: [
|
|
9006
|
-
/* @__PURE__ */
|
|
9007
|
-
onClose && /* @__PURE__ */
|
|
9166
|
+
/* @__PURE__ */ jsx345("span", { className: "tag-label", children }),
|
|
9167
|
+
onClose && /* @__PURE__ */ jsx345("button", { className: "tag-close", onClick: onClose, "aria-label": "\uC0AD\uC81C", disabled, children: /* @__PURE__ */ jsx345(XIcon_default, {}) })
|
|
9008
9168
|
]
|
|
9009
9169
|
}
|
|
9010
9170
|
);
|
|
@@ -9012,83 +9172,26 @@ var Tag = (props) => {
|
|
|
9012
9172
|
Tag.displayName = "Tag";
|
|
9013
9173
|
var Tag_default = Tag;
|
|
9014
9174
|
|
|
9015
|
-
// src/components/TextArea/TextArea.tsx
|
|
9016
|
-
import React36 from "react";
|
|
9017
|
-
import { jsx as jsx344 } from "react/jsx-runtime";
|
|
9018
|
-
var TextArea = React36.forwardRef(
|
|
9019
|
-
(props, ref) => {
|
|
9020
|
-
const { value, onChange, disabled, ...textareaProps } = props;
|
|
9021
|
-
const localRef = React36.useRef(null);
|
|
9022
|
-
const setRefs = (el) => {
|
|
9023
|
-
localRef.current = el;
|
|
9024
|
-
if (!ref) return;
|
|
9025
|
-
if (typeof ref === "function") {
|
|
9026
|
-
ref(el);
|
|
9027
|
-
} else if (ref && typeof ref === "object" && "current" in ref) {
|
|
9028
|
-
ref.current = el;
|
|
9029
|
-
}
|
|
9030
|
-
};
|
|
9031
|
-
const handleOnChange = (e) => {
|
|
9032
|
-
const val = e.target.value;
|
|
9033
|
-
if (onChange) {
|
|
9034
|
-
const event = {
|
|
9035
|
-
...e,
|
|
9036
|
-
target: { value: val }
|
|
9037
|
-
};
|
|
9038
|
-
onChange(event);
|
|
9039
|
-
}
|
|
9040
|
-
};
|
|
9041
|
-
React36.useEffect(() => {
|
|
9042
|
-
const el = localRef.current;
|
|
9043
|
-
if (!el) return;
|
|
9044
|
-
el.style.height = "0px";
|
|
9045
|
-
const nextHeight = Math.min(el.scrollHeight, 400);
|
|
9046
|
-
el.style.height = `${nextHeight}px`;
|
|
9047
|
-
}, [value]);
|
|
9048
|
-
return /* @__PURE__ */ jsx344("div", { className: "lib-xplat-textarea-wrapper", children: /* @__PURE__ */ jsx344(
|
|
9049
|
-
"div",
|
|
9050
|
-
{
|
|
9051
|
-
className: clsx_default(
|
|
9052
|
-
"lib-xplat-textarea",
|
|
9053
|
-
disabled ? "disabled" : void 0
|
|
9054
|
-
),
|
|
9055
|
-
children: /* @__PURE__ */ jsx344(
|
|
9056
|
-
"textarea",
|
|
9057
|
-
{
|
|
9058
|
-
...textareaProps,
|
|
9059
|
-
ref: setRefs,
|
|
9060
|
-
disabled,
|
|
9061
|
-
value,
|
|
9062
|
-
onChange: handleOnChange
|
|
9063
|
-
}
|
|
9064
|
-
)
|
|
9065
|
-
}
|
|
9066
|
-
) });
|
|
9067
|
-
}
|
|
9068
|
-
);
|
|
9069
|
-
TextArea.displayName = "TextArea";
|
|
9070
|
-
var TextArea_default = TextArea;
|
|
9071
|
-
|
|
9072
9175
|
// src/components/Toast/Toast.tsx
|
|
9073
|
-
import
|
|
9176
|
+
import React38 from "react";
|
|
9074
9177
|
import { createPortal as createPortal3 } from "react-dom";
|
|
9075
|
-
import { jsx as
|
|
9076
|
-
var ToastContext =
|
|
9178
|
+
import { jsx as jsx346, jsxs as jsxs220 } from "react/jsx-runtime";
|
|
9179
|
+
var ToastContext = React38.createContext(null);
|
|
9077
9180
|
var useToast = () => {
|
|
9078
|
-
const ctx =
|
|
9181
|
+
const ctx = React38.useContext(ToastContext);
|
|
9079
9182
|
if (!ctx) throw new Error("useToast must be used within ToastProvider");
|
|
9080
9183
|
return ctx;
|
|
9081
9184
|
};
|
|
9082
9185
|
var EXIT_DURATION = 300;
|
|
9083
9186
|
var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
9084
|
-
const ref =
|
|
9085
|
-
const [height, setHeight] =
|
|
9086
|
-
|
|
9187
|
+
const ref = React38.useRef(null);
|
|
9188
|
+
const [height, setHeight] = React38.useState(void 0);
|
|
9189
|
+
React38.useEffect(() => {
|
|
9087
9190
|
if (ref.current && !isExiting) {
|
|
9088
9191
|
setHeight(ref.current.offsetHeight);
|
|
9089
9192
|
}
|
|
9090
9193
|
}, [isExiting]);
|
|
9091
|
-
return /* @__PURE__ */
|
|
9194
|
+
return /* @__PURE__ */ jsx346(
|
|
9092
9195
|
"div",
|
|
9093
9196
|
{
|
|
9094
9197
|
className: clsx_default("lib-xplat-toast-wrapper", { exit: isExiting }),
|
|
@@ -9096,15 +9199,15 @@ var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
|
9096
9199
|
maxHeight: isExiting ? 0 : height ?? "none",
|
|
9097
9200
|
marginBottom: isExiting ? 0 : void 0
|
|
9098
9201
|
},
|
|
9099
|
-
children: /* @__PURE__ */
|
|
9202
|
+
children: /* @__PURE__ */ jsxs220(
|
|
9100
9203
|
"div",
|
|
9101
9204
|
{
|
|
9102
9205
|
ref,
|
|
9103
9206
|
className: clsx_default("lib-xplat-toast", item.type, { exit: isExiting }),
|
|
9104
9207
|
role: "alert",
|
|
9105
9208
|
children: [
|
|
9106
|
-
/* @__PURE__ */
|
|
9107
|
-
/* @__PURE__ */
|
|
9209
|
+
/* @__PURE__ */ jsx346("span", { className: "message", children: item.message }),
|
|
9210
|
+
/* @__PURE__ */ jsx346("button", { className: "close-btn", onClick: onClose, "aria-label": "\uB2EB\uAE30", children: "\xD7" })
|
|
9108
9211
|
]
|
|
9109
9212
|
}
|
|
9110
9213
|
)
|
|
@@ -9115,13 +9218,13 @@ var ToastProvider = ({
|
|
|
9115
9218
|
children,
|
|
9116
9219
|
position = "top-right"
|
|
9117
9220
|
}) => {
|
|
9118
|
-
const [toasts, setToasts] =
|
|
9119
|
-
const [removing, setRemoving] =
|
|
9120
|
-
const [mounted, setMounted] =
|
|
9121
|
-
|
|
9221
|
+
const [toasts, setToasts] = React38.useState([]);
|
|
9222
|
+
const [removing, setRemoving] = React38.useState(/* @__PURE__ */ new Set());
|
|
9223
|
+
const [mounted, setMounted] = React38.useState(false);
|
|
9224
|
+
React38.useEffect(() => {
|
|
9122
9225
|
setMounted(true);
|
|
9123
9226
|
}, []);
|
|
9124
|
-
const remove =
|
|
9227
|
+
const remove = React38.useCallback((id) => {
|
|
9125
9228
|
setRemoving((prev) => new Set(prev).add(id));
|
|
9126
9229
|
setTimeout(() => {
|
|
9127
9230
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
@@ -9132,7 +9235,7 @@ var ToastProvider = ({
|
|
|
9132
9235
|
});
|
|
9133
9236
|
}, EXIT_DURATION);
|
|
9134
9237
|
}, []);
|
|
9135
|
-
const toast =
|
|
9238
|
+
const toast = React38.useCallback(
|
|
9136
9239
|
(type, message, duration = 3e3) => {
|
|
9137
9240
|
const id = `${Date.now()}-${Math.random()}`;
|
|
9138
9241
|
setToasts((prev) => [...prev, { id, type, message }]);
|
|
@@ -9142,10 +9245,10 @@ var ToastProvider = ({
|
|
|
9142
9245
|
},
|
|
9143
9246
|
[remove]
|
|
9144
9247
|
);
|
|
9145
|
-
return /* @__PURE__ */
|
|
9248
|
+
return /* @__PURE__ */ jsxs220(ToastContext.Provider, { value: { toast }, children: [
|
|
9146
9249
|
children,
|
|
9147
9250
|
mounted && createPortal3(
|
|
9148
|
-
/* @__PURE__ */
|
|
9251
|
+
/* @__PURE__ */ jsx346("div", { className: clsx_default("lib-xplat-toast-container", position), children: toasts.map((t) => /* @__PURE__ */ jsx346(
|
|
9149
9252
|
ToastItemComponent,
|
|
9150
9253
|
{
|
|
9151
9254
|
item: t,
|
|
@@ -9161,29 +9264,29 @@ var ToastProvider = ({
|
|
|
9161
9264
|
ToastProvider.displayName = "ToastProvider";
|
|
9162
9265
|
|
|
9163
9266
|
// src/components/Tooltip/Tooltip.tsx
|
|
9164
|
-
import
|
|
9165
|
-
import { jsx as
|
|
9267
|
+
import React39 from "react";
|
|
9268
|
+
import { jsx as jsx347, jsxs as jsxs221 } from "react/jsx-runtime";
|
|
9166
9269
|
var Tooltip = (props) => {
|
|
9167
9270
|
const {
|
|
9168
9271
|
type = "primary",
|
|
9169
9272
|
description,
|
|
9170
9273
|
children
|
|
9171
9274
|
} = props;
|
|
9172
|
-
const iconRef =
|
|
9173
|
-
return /* @__PURE__ */
|
|
9174
|
-
/* @__PURE__ */
|
|
9175
|
-
/* @__PURE__ */
|
|
9275
|
+
const iconRef = React39.useRef(null);
|
|
9276
|
+
return /* @__PURE__ */ jsxs221("div", { className: "lib-xplat-tooltip", children: [
|
|
9277
|
+
/* @__PURE__ */ jsx347("div", { className: "tooltip-content", ref: iconRef, children: children || "Tooltip" }),
|
|
9278
|
+
/* @__PURE__ */ jsx347("div", { className: clsx_default("tooltip-wrapper", type), children: description })
|
|
9176
9279
|
] });
|
|
9177
9280
|
};
|
|
9178
9281
|
Tooltip.displayName = "Tooltip";
|
|
9179
9282
|
var Tooltip_default = Tooltip;
|
|
9180
9283
|
|
|
9181
9284
|
// src/components/Video/Video.tsx
|
|
9182
|
-
import
|
|
9183
|
-
import { jsx as
|
|
9184
|
-
var PipIcon = () => /* @__PURE__ */
|
|
9185
|
-
/* @__PURE__ */
|
|
9186
|
-
/* @__PURE__ */
|
|
9285
|
+
import React40 from "react";
|
|
9286
|
+
import { jsx as jsx348, jsxs as jsxs222 } from "react/jsx-runtime";
|
|
9287
|
+
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: [
|
|
9288
|
+
/* @__PURE__ */ jsx348("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
|
|
9289
|
+
/* @__PURE__ */ jsx348("rect", { x: "12", y: "11", width: "7", height: "6", rx: "1", fill: "currentColor" })
|
|
9187
9290
|
] });
|
|
9188
9291
|
var formatTime = (sec) => {
|
|
9189
9292
|
if (!Number.isFinite(sec) || sec < 0) return "0:00";
|
|
@@ -9191,7 +9294,7 @@ var formatTime = (sec) => {
|
|
|
9191
9294
|
const s = Math.floor(sec % 60);
|
|
9192
9295
|
return `${m}:${s.toString().padStart(2, "0")}`;
|
|
9193
9296
|
};
|
|
9194
|
-
var Video =
|
|
9297
|
+
var Video = React40.forwardRef((props, ref) => {
|
|
9195
9298
|
const {
|
|
9196
9299
|
src,
|
|
9197
9300
|
poster,
|
|
@@ -9215,21 +9318,21 @@ var Video = React39.forwardRef((props, ref) => {
|
|
|
9215
9318
|
children,
|
|
9216
9319
|
...rest
|
|
9217
9320
|
} = props;
|
|
9218
|
-
const containerRef =
|
|
9219
|
-
const videoRef =
|
|
9220
|
-
const [isPlaying, setIsPlaying] =
|
|
9221
|
-
const [isLoaded, setIsLoaded] =
|
|
9222
|
-
const [currentTime, setCurrentTime] =
|
|
9223
|
-
const [duration, setDuration] =
|
|
9224
|
-
const [buffered, setBuffered] =
|
|
9225
|
-
const [volume, setVolume] =
|
|
9226
|
-
const [isMuted, setIsMuted] =
|
|
9227
|
-
const [isFullscreen, setIsFullscreen] =
|
|
9228
|
-
const [playbackRate, setPlaybackRate] =
|
|
9229
|
-
const [rateMenuOpen, setRateMenuOpen] =
|
|
9230
|
-
const [captionsOn, setCaptionsOn] =
|
|
9231
|
-
const [isPip, setIsPip] =
|
|
9232
|
-
const setRefs =
|
|
9321
|
+
const containerRef = React40.useRef(null);
|
|
9322
|
+
const videoRef = React40.useRef(null);
|
|
9323
|
+
const [isPlaying, setIsPlaying] = React40.useState(Boolean(autoPlay));
|
|
9324
|
+
const [isLoaded, setIsLoaded] = React40.useState(false);
|
|
9325
|
+
const [currentTime, setCurrentTime] = React40.useState(0);
|
|
9326
|
+
const [duration, setDuration] = React40.useState(0);
|
|
9327
|
+
const [buffered, setBuffered] = React40.useState(0);
|
|
9328
|
+
const [volume, setVolume] = React40.useState(1);
|
|
9329
|
+
const [isMuted, setIsMuted] = React40.useState(Boolean(muted));
|
|
9330
|
+
const [isFullscreen, setIsFullscreen] = React40.useState(false);
|
|
9331
|
+
const [playbackRate, setPlaybackRate] = React40.useState(1);
|
|
9332
|
+
const [rateMenuOpen, setRateMenuOpen] = React40.useState(false);
|
|
9333
|
+
const [captionsOn, setCaptionsOn] = React40.useState(false);
|
|
9334
|
+
const [isPip, setIsPip] = React40.useState(false);
|
|
9335
|
+
const setRefs = React40.useCallback(
|
|
9233
9336
|
(el) => {
|
|
9234
9337
|
videoRef.current = el;
|
|
9235
9338
|
if (typeof ref === "function") ref(el);
|
|
@@ -9237,14 +9340,14 @@ var Video = React39.forwardRef((props, ref) => {
|
|
|
9237
9340
|
},
|
|
9238
9341
|
[ref]
|
|
9239
9342
|
);
|
|
9240
|
-
|
|
9343
|
+
React40.useEffect(() => {
|
|
9241
9344
|
const onFsChange = () => {
|
|
9242
9345
|
setIsFullscreen(document.fullscreenElement === containerRef.current);
|
|
9243
9346
|
};
|
|
9244
9347
|
document.addEventListener("fullscreenchange", onFsChange);
|
|
9245
9348
|
return () => document.removeEventListener("fullscreenchange", onFsChange);
|
|
9246
9349
|
}, []);
|
|
9247
|
-
|
|
9350
|
+
React40.useEffect(() => {
|
|
9248
9351
|
const v = videoRef.current;
|
|
9249
9352
|
if (!v) return;
|
|
9250
9353
|
const onEnter = () => setIsPip(true);
|
|
@@ -9358,13 +9461,13 @@ var Video = React39.forwardRef((props, ref) => {
|
|
|
9358
9461
|
const volumePct = (isMuted ? 0 : volume) * 100;
|
|
9359
9462
|
const VolumeGlyph = isMuted || volume === 0 ? VolumeXIcon_default : volume < 0.5 ? VolumeIcon_default : Volume2Icon_default;
|
|
9360
9463
|
const pipSupported = typeof document !== "undefined" && "pictureInPictureEnabled" in document && document.pictureInPictureEnabled;
|
|
9361
|
-
return /* @__PURE__ */
|
|
9464
|
+
return /* @__PURE__ */ jsxs222(
|
|
9362
9465
|
"div",
|
|
9363
9466
|
{
|
|
9364
9467
|
ref: containerRef,
|
|
9365
9468
|
className: clsx_default("lib-xplat-video", showControls && "has-controls"),
|
|
9366
9469
|
children: [
|
|
9367
|
-
/* @__PURE__ */
|
|
9470
|
+
/* @__PURE__ */ jsx348(
|
|
9368
9471
|
"video",
|
|
9369
9472
|
{
|
|
9370
9473
|
ref: setRefs,
|
|
@@ -9385,7 +9488,7 @@ var Video = React39.forwardRef((props, ref) => {
|
|
|
9385
9488
|
children
|
|
9386
9489
|
}
|
|
9387
9490
|
),
|
|
9388
|
-
showCenterPlay && /* @__PURE__ */
|
|
9491
|
+
showCenterPlay && /* @__PURE__ */ jsx348(
|
|
9389
9492
|
"button",
|
|
9390
9493
|
{
|
|
9391
9494
|
type: "button",
|
|
@@ -9397,11 +9500,11 @@ var Video = React39.forwardRef((props, ref) => {
|
|
|
9397
9500
|
onClick: togglePlay,
|
|
9398
9501
|
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
9399
9502
|
tabIndex: -1,
|
|
9400
|
-
children: /* @__PURE__ */
|
|
9503
|
+
children: /* @__PURE__ */ jsx348("span", { className: "center-play-icon", children: /* @__PURE__ */ jsx348(PlayCircleIcon_default, {}) })
|
|
9401
9504
|
}
|
|
9402
9505
|
),
|
|
9403
|
-
showControls && /* @__PURE__ */
|
|
9404
|
-
/* @__PURE__ */
|
|
9506
|
+
showControls && /* @__PURE__ */ jsxs222("div", { className: "controls", onClick: (e) => e.stopPropagation(), children: [
|
|
9507
|
+
/* @__PURE__ */ jsx348(
|
|
9405
9508
|
"input",
|
|
9406
9509
|
{
|
|
9407
9510
|
type: "range",
|
|
@@ -9418,29 +9521,29 @@ var Video = React39.forwardRef((props, ref) => {
|
|
|
9418
9521
|
}
|
|
9419
9522
|
}
|
|
9420
9523
|
),
|
|
9421
|
-
/* @__PURE__ */
|
|
9422
|
-
/* @__PURE__ */
|
|
9524
|
+
/* @__PURE__ */ jsxs222("div", { className: "controls-row", children: [
|
|
9525
|
+
/* @__PURE__ */ jsx348(
|
|
9423
9526
|
"button",
|
|
9424
9527
|
{
|
|
9425
9528
|
type: "button",
|
|
9426
9529
|
className: "control-btn",
|
|
9427
9530
|
onClick: togglePlay,
|
|
9428
9531
|
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
9429
|
-
children: isPlaying ? /* @__PURE__ */
|
|
9532
|
+
children: isPlaying ? /* @__PURE__ */ jsx348(PauseIcon_default, {}) : /* @__PURE__ */ jsx348(PlayIcon_default, {})
|
|
9430
9533
|
}
|
|
9431
9534
|
),
|
|
9432
|
-
/* @__PURE__ */
|
|
9433
|
-
/* @__PURE__ */
|
|
9535
|
+
/* @__PURE__ */ jsxs222("div", { className: "volume-group", children: [
|
|
9536
|
+
/* @__PURE__ */ jsx348(
|
|
9434
9537
|
"button",
|
|
9435
9538
|
{
|
|
9436
9539
|
type: "button",
|
|
9437
9540
|
className: "control-btn",
|
|
9438
9541
|
onClick: toggleMute,
|
|
9439
9542
|
"aria-label": isMuted ? "\uC74C\uC18C\uAC70 \uD574\uC81C" : "\uC74C\uC18C\uAC70",
|
|
9440
|
-
children: /* @__PURE__ */
|
|
9543
|
+
children: /* @__PURE__ */ jsx348(VolumeGlyph, {})
|
|
9441
9544
|
}
|
|
9442
9545
|
),
|
|
9443
|
-
/* @__PURE__ */
|
|
9546
|
+
/* @__PURE__ */ jsx348(
|
|
9444
9547
|
"input",
|
|
9445
9548
|
{
|
|
9446
9549
|
type: "range",
|
|
@@ -9455,14 +9558,14 @@ var Video = React39.forwardRef((props, ref) => {
|
|
|
9455
9558
|
}
|
|
9456
9559
|
)
|
|
9457
9560
|
] }),
|
|
9458
|
-
/* @__PURE__ */
|
|
9561
|
+
/* @__PURE__ */ jsxs222("span", { className: "time", children: [
|
|
9459
9562
|
formatTime(currentTime),
|
|
9460
9563
|
" / ",
|
|
9461
9564
|
formatTime(duration)
|
|
9462
9565
|
] }),
|
|
9463
|
-
/* @__PURE__ */
|
|
9464
|
-
playbackRates && playbackRates.length > 0 && /* @__PURE__ */
|
|
9465
|
-
/* @__PURE__ */
|
|
9566
|
+
/* @__PURE__ */ jsx348("div", { className: "controls-spacer" }),
|
|
9567
|
+
playbackRates && playbackRates.length > 0 && /* @__PURE__ */ jsxs222("div", { className: clsx_default("rate-group", rateMenuOpen && "is-open"), children: [
|
|
9568
|
+
/* @__PURE__ */ jsxs222(
|
|
9466
9569
|
"button",
|
|
9467
9570
|
{
|
|
9468
9571
|
type: "button",
|
|
@@ -9476,7 +9579,7 @@ var Video = React39.forwardRef((props, ref) => {
|
|
|
9476
9579
|
]
|
|
9477
9580
|
}
|
|
9478
9581
|
),
|
|
9479
|
-
rateMenuOpen && /* @__PURE__ */
|
|
9582
|
+
rateMenuOpen && /* @__PURE__ */ jsx348("ul", { className: "rate-menu", role: "menu", children: playbackRates.map((r2) => /* @__PURE__ */ jsx348("li", { children: /* @__PURE__ */ jsxs222(
|
|
9480
9583
|
"button",
|
|
9481
9584
|
{
|
|
9482
9585
|
type: "button",
|
|
@@ -9490,7 +9593,7 @@ var Video = React39.forwardRef((props, ref) => {
|
|
|
9490
9593
|
}
|
|
9491
9594
|
) }, r2)) })
|
|
9492
9595
|
] }),
|
|
9493
|
-
showCaptions && /* @__PURE__ */
|
|
9596
|
+
showCaptions && /* @__PURE__ */ jsx348(
|
|
9494
9597
|
"button",
|
|
9495
9598
|
{
|
|
9496
9599
|
type: "button",
|
|
@@ -9498,37 +9601,37 @@ var Video = React39.forwardRef((props, ref) => {
|
|
|
9498
9601
|
onClick: toggleCaptions,
|
|
9499
9602
|
"aria-label": captionsOn ? "\uC790\uB9C9 \uB044\uAE30" : "\uC790\uB9C9 \uCF1C\uAE30",
|
|
9500
9603
|
"aria-pressed": captionsOn,
|
|
9501
|
-
children: /* @__PURE__ */
|
|
9604
|
+
children: /* @__PURE__ */ jsx348(TypeIcon_default, {})
|
|
9502
9605
|
}
|
|
9503
9606
|
),
|
|
9504
|
-
showPip && pipSupported && /* @__PURE__ */
|
|
9607
|
+
showPip && pipSupported && /* @__PURE__ */ jsx348(
|
|
9505
9608
|
"button",
|
|
9506
9609
|
{
|
|
9507
9610
|
type: "button",
|
|
9508
9611
|
className: clsx_default("control-btn", isPip && "is-active"),
|
|
9509
9612
|
onClick: togglePip,
|
|
9510
9613
|
"aria-label": isPip ? "PIP \uC885\uB8CC" : "PIP",
|
|
9511
|
-
children: /* @__PURE__ */
|
|
9614
|
+
children: /* @__PURE__ */ jsx348(PipIcon, {})
|
|
9512
9615
|
}
|
|
9513
9616
|
),
|
|
9514
|
-
showDownload && /* @__PURE__ */
|
|
9617
|
+
showDownload && /* @__PURE__ */ jsx348(
|
|
9515
9618
|
"a",
|
|
9516
9619
|
{
|
|
9517
9620
|
className: "control-btn",
|
|
9518
9621
|
href: src,
|
|
9519
9622
|
download: downloadFileName ?? true,
|
|
9520
9623
|
"aria-label": "\uB2E4\uC6B4\uB85C\uB4DC",
|
|
9521
|
-
children: /* @__PURE__ */
|
|
9624
|
+
children: /* @__PURE__ */ jsx348(DownloadIcon_default, {})
|
|
9522
9625
|
}
|
|
9523
9626
|
),
|
|
9524
|
-
/* @__PURE__ */
|
|
9627
|
+
/* @__PURE__ */ jsx348(
|
|
9525
9628
|
"button",
|
|
9526
9629
|
{
|
|
9527
9630
|
type: "button",
|
|
9528
9631
|
className: "control-btn",
|
|
9529
9632
|
onClick: toggleFullscreen,
|
|
9530
9633
|
"aria-label": isFullscreen ? "\uC804\uCCB4\uD654\uBA74 \uC885\uB8CC" : "\uC804\uCCB4\uD654\uBA74",
|
|
9531
|
-
children: isFullscreen ? /* @__PURE__ */
|
|
9634
|
+
children: isFullscreen ? /* @__PURE__ */ jsx348(MinimizeIcon_default, {}) : /* @__PURE__ */ jsx348(MaximizeIcon_default, {})
|
|
9532
9635
|
}
|
|
9533
9636
|
)
|
|
9534
9637
|
] })
|
|
@@ -9541,7 +9644,7 @@ Video.displayName = "Video";
|
|
|
9541
9644
|
var Video_default = Video;
|
|
9542
9645
|
|
|
9543
9646
|
// src/layout/Grid/FullGrid/FullGrid.tsx
|
|
9544
|
-
import { jsx as
|
|
9647
|
+
import { jsx as jsx349 } from "react/jsx-runtime";
|
|
9545
9648
|
var GAP_MAP = {
|
|
9546
9649
|
none: "var(--spacing-space-none)",
|
|
9547
9650
|
xs: "var(--spacing-space-1)",
|
|
@@ -9554,13 +9657,13 @@ var GAP_MAP = {
|
|
|
9554
9657
|
var FullGrid = (props) => {
|
|
9555
9658
|
const { children, gap } = props;
|
|
9556
9659
|
const style = gap != null ? { gap: GAP_MAP[gap] } : void 0;
|
|
9557
|
-
return /* @__PURE__ */
|
|
9660
|
+
return /* @__PURE__ */ jsx349("div", { className: "lib-xplat-full-grid", style, children });
|
|
9558
9661
|
};
|
|
9559
9662
|
FullGrid.displayName = "FullGrid";
|
|
9560
9663
|
var FullGrid_default = FullGrid;
|
|
9561
9664
|
|
|
9562
9665
|
// src/layout/Grid/FullScreen/FullScreen.tsx
|
|
9563
|
-
import { jsx as
|
|
9666
|
+
import { jsx as jsx350 } from "react/jsx-runtime";
|
|
9564
9667
|
var GAP_MAP2 = {
|
|
9565
9668
|
none: "var(--spacing-space-none)",
|
|
9566
9669
|
xs: "var(--spacing-space-1)",
|
|
@@ -9573,13 +9676,13 @@ var GAP_MAP2 = {
|
|
|
9573
9676
|
var FullScreen = (props) => {
|
|
9574
9677
|
const { children, gap } = props;
|
|
9575
9678
|
const style = gap != null ? { gap: GAP_MAP2[gap] } : void 0;
|
|
9576
|
-
return /* @__PURE__ */
|
|
9679
|
+
return /* @__PURE__ */ jsx350("div", { className: "lib-xplat-full-screen", style, children });
|
|
9577
9680
|
};
|
|
9578
9681
|
FullScreen.displayName = "FullScreen";
|
|
9579
9682
|
var FullScreen_default = FullScreen;
|
|
9580
9683
|
|
|
9581
9684
|
// src/layout/Grid/Item/Item.tsx
|
|
9582
|
-
import { jsx as
|
|
9685
|
+
import { jsx as jsx351 } from "react/jsx-runtime";
|
|
9583
9686
|
var calculateSpans = (column) => {
|
|
9584
9687
|
const spans = {};
|
|
9585
9688
|
let inherited = column.default;
|
|
@@ -9596,35 +9699,35 @@ var GridItem = ({ column, children, className }) => {
|
|
|
9596
9699
|
Object.entries(spans).forEach(([key, value]) => {
|
|
9597
9700
|
style[`--column-${key}`] = value;
|
|
9598
9701
|
});
|
|
9599
|
-
return /* @__PURE__ */
|
|
9702
|
+
return /* @__PURE__ */ jsx351("div", { className: clsx_default("lib-xplat-grid-item", className), style, children });
|
|
9600
9703
|
};
|
|
9601
9704
|
GridItem.displayName = "GridItem";
|
|
9602
9705
|
var Item_default = GridItem;
|
|
9603
9706
|
|
|
9604
9707
|
// src/layout/Header/Header.tsx
|
|
9605
|
-
import { jsx as
|
|
9708
|
+
import { jsx as jsx352, jsxs as jsxs223 } from "react/jsx-runtime";
|
|
9606
9709
|
var Header = ({
|
|
9607
9710
|
logo,
|
|
9608
9711
|
centerContent,
|
|
9609
9712
|
rightContent
|
|
9610
9713
|
}) => {
|
|
9611
|
-
return /* @__PURE__ */
|
|
9612
|
-
/* @__PURE__ */
|
|
9613
|
-
/* @__PURE__ */
|
|
9614
|
-
/* @__PURE__ */
|
|
9714
|
+
return /* @__PURE__ */ jsxs223("div", { className: "lib-xplat-layout-header", children: [
|
|
9715
|
+
/* @__PURE__ */ jsx352("div", { children: logo }),
|
|
9716
|
+
/* @__PURE__ */ jsx352("div", { children: centerContent }),
|
|
9717
|
+
/* @__PURE__ */ jsx352("div", { children: rightContent })
|
|
9615
9718
|
] });
|
|
9616
9719
|
};
|
|
9617
9720
|
Header.displayName = "Header";
|
|
9618
9721
|
var Header_default = Header;
|
|
9619
9722
|
|
|
9620
9723
|
// src/layout/Layout/Layout.tsx
|
|
9621
|
-
import { Fragment as Fragment5, jsx as
|
|
9724
|
+
import { Fragment as Fragment5, jsx as jsx353, jsxs as jsxs224 } from "react/jsx-runtime";
|
|
9622
9725
|
var Layout = (props) => {
|
|
9623
9726
|
const { header, sideBar, children } = props;
|
|
9624
|
-
return /* @__PURE__ */
|
|
9625
|
-
sideBar && /* @__PURE__ */
|
|
9626
|
-
/* @__PURE__ */
|
|
9627
|
-
header && /* @__PURE__ */
|
|
9727
|
+
return /* @__PURE__ */ jsx353("div", { className: "lib-xplat-layout", children: /* @__PURE__ */ jsxs224("div", { className: "lib-xplat-layout-content-wrapper", children: [
|
|
9728
|
+
sideBar && /* @__PURE__ */ jsx353(Fragment5, { children: sideBar }),
|
|
9729
|
+
/* @__PURE__ */ jsxs224("div", { className: "lib-xplat-layout-content", children: [
|
|
9730
|
+
header && /* @__PURE__ */ jsx353("div", { className: "lib-xplat-layout-conent-header", children: header }),
|
|
9628
9731
|
children
|
|
9629
9732
|
] })
|
|
9630
9733
|
] }) });
|
|
@@ -9633,31 +9736,31 @@ Layout.displayName = "Layout";
|
|
|
9633
9736
|
var Layout_default = Layout;
|
|
9634
9737
|
|
|
9635
9738
|
// src/layout/SideBar/SideBar.tsx
|
|
9636
|
-
import
|
|
9739
|
+
import React42 from "react";
|
|
9637
9740
|
|
|
9638
9741
|
// src/layout/SideBar/SideBarContext.tsx
|
|
9639
|
-
import
|
|
9640
|
-
var SideBarContext =
|
|
9742
|
+
import React41 from "react";
|
|
9743
|
+
var SideBarContext = React41.createContext(null);
|
|
9641
9744
|
var useSideBarContext = () => {
|
|
9642
|
-
const ctx =
|
|
9745
|
+
const ctx = React41.useContext(SideBarContext);
|
|
9643
9746
|
if (!ctx) throw new Error("Error");
|
|
9644
9747
|
return ctx;
|
|
9645
9748
|
};
|
|
9646
9749
|
var SideBarContext_default = SideBarContext;
|
|
9647
9750
|
|
|
9648
9751
|
// src/layout/SideBar/SideBar.tsx
|
|
9649
|
-
import { jsx as
|
|
9752
|
+
import { jsx as jsx354 } from "react/jsx-runtime";
|
|
9650
9753
|
var SideBar = (props) => {
|
|
9651
9754
|
const { children, className } = props;
|
|
9652
|
-
const [isOpen, setIsOpen] =
|
|
9755
|
+
const [isOpen, setIsOpen] = React42.useState(true);
|
|
9653
9756
|
const handleSwitchSideBar = () => {
|
|
9654
9757
|
setIsOpen((prev) => !prev);
|
|
9655
9758
|
};
|
|
9656
|
-
return /* @__PURE__ */
|
|
9759
|
+
return /* @__PURE__ */ jsx354(
|
|
9657
9760
|
SideBarContext_default.Provider,
|
|
9658
9761
|
{
|
|
9659
9762
|
value: { isSidebarOpen: isOpen, handleSwitchSideBar },
|
|
9660
|
-
children: /* @__PURE__ */
|
|
9763
|
+
children: /* @__PURE__ */ jsx354(
|
|
9661
9764
|
"div",
|
|
9662
9765
|
{
|
|
9663
9766
|
className: clsx_default(
|
|
@@ -9736,6 +9839,7 @@ export {
|
|
|
9736
9839
|
CardTab_default as CardTab,
|
|
9737
9840
|
CastIcon_default as CastIcon,
|
|
9738
9841
|
Chart_default as Chart,
|
|
9842
|
+
ChatInput_default as ChatInput,
|
|
9739
9843
|
CheckBox_default as CheckBox,
|
|
9740
9844
|
CheckCircleIcon_default as CheckCircleIcon,
|
|
9741
9845
|
CheckIcon_default as CheckIcon,
|