@x-plat/design-system 0.2.4 → 0.3.2
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/{colors-cxE7RsuF.d.cts → colors-BgzpjYfN.d.cts} +3 -6
- package/dist/{colors-cxE7RsuF.d.ts → colors-BgzpjYfN.d.ts} +3 -6
- package/dist/components/Avatar/index.cjs +2 -14
- package/dist/components/Avatar/index.d.cts +3 -235
- package/dist/components/Avatar/index.d.ts +3 -235
- package/dist/components/Avatar/index.js +2 -14
- package/dist/components/Badge/index.cjs +2 -14
- package/dist/components/Badge/index.d.cts +3 -235
- package/dist/components/Badge/index.d.ts +3 -235
- package/dist/components/Badge/index.js +2 -14
- package/dist/components/Button/index.cjs +2 -14
- package/dist/components/Button/index.d.cts +3 -235
- package/dist/components/Button/index.d.ts +3 -235
- package/dist/components/Button/index.js +2 -14
- package/dist/components/CheckBox/index.cjs +2 -14
- package/dist/components/CheckBox/index.d.cts +3 -235
- package/dist/components/CheckBox/index.d.ts +3 -235
- package/dist/components/CheckBox/index.js +2 -14
- package/dist/components/Chip/index.cjs +2 -14
- package/dist/components/Chip/index.d.cts +3 -235
- package/dist/components/Chip/index.d.ts +3 -235
- package/dist/components/Chip/index.js +2 -14
- package/dist/components/DatePicker/index.cjs +9 -161
- package/dist/components/DatePicker/index.d.cts +5 -469
- package/dist/components/DatePicker/index.d.ts +5 -469
- package/dist/components/DatePicker/index.js +9 -161
- package/dist/components/Pagination/index.cjs +2 -14
- package/dist/components/Pagination/index.d.cts +3 -235
- package/dist/components/Pagination/index.d.ts +3 -235
- package/dist/components/Pagination/index.js +2 -14
- package/dist/components/Progress/index.cjs +2 -14
- package/dist/components/Progress/index.d.cts +3 -235
- package/dist/components/Progress/index.d.ts +3 -235
- package/dist/components/Progress/index.js +2 -14
- package/dist/components/Radio/index.cjs +2 -14
- package/dist/components/Radio/index.d.cts +3 -235
- package/dist/components/Radio/index.d.ts +3 -235
- package/dist/components/Radio/index.js +2 -14
- package/dist/components/Spinner/index.cjs +2 -14
- package/dist/components/Spinner/index.d.cts +3 -235
- package/dist/components/Spinner/index.d.ts +3 -235
- package/dist/components/Spinner/index.js +2 -14
- package/dist/components/Steps/index.cjs +2 -14
- package/dist/components/Steps/index.d.cts +3 -235
- package/dist/components/Steps/index.d.ts +3 -235
- package/dist/components/Steps/index.js +2 -14
- package/dist/components/Swiper/index.cjs +257 -5939
- package/dist/components/Swiper/index.css +52 -211
- package/dist/components/Swiper/index.d.cts +35 -16
- package/dist/components/Swiper/index.d.ts +35 -16
- package/dist/components/Swiper/index.js +251 -5944
- package/dist/components/Switch/index.cjs +2 -14
- package/dist/components/Switch/index.d.cts +3 -235
- package/dist/components/Switch/index.d.ts +3 -235
- package/dist/components/Switch/index.js +2 -14
- package/dist/components/Table/index.cjs +2 -16
- package/dist/components/Table/index.d.cts +3 -235
- package/dist/components/Table/index.d.ts +3 -235
- package/dist/components/Table/index.js +2 -16
- package/dist/components/Tag/index.cjs +2 -14
- package/dist/components/Tag/index.d.cts +3 -235
- package/dist/components/Tag/index.d.ts +3 -235
- package/dist/components/Tag/index.js +2 -14
- package/dist/components/Tooltip/index.cjs +2 -14
- package/dist/components/Tooltip/index.d.cts +3 -238
- package/dist/components/Tooltip/index.d.ts +3 -238
- package/dist/components/Tooltip/index.js +2 -14
- package/dist/components/index.cjs +390 -251
- package/dist/components/index.css +71 -0
- package/dist/components/index.d.cts +2 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +390 -252
- package/dist/index.cjs +414 -275
- package/dist/index.css +71 -0
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +414 -276
- package/dist/tokens/index.d.cts +1 -1
- package/dist/tokens/index.d.ts +1 -1
- package/package.json +3 -9
package/dist/components/index.js
CHANGED
|
@@ -1378,11 +1378,6 @@ var Alert = (props) => {
|
|
|
1378
1378
|
Alert.displayName = "Alert";
|
|
1379
1379
|
var Alert_default = Alert;
|
|
1380
1380
|
|
|
1381
|
-
// src/util/getColor.ts
|
|
1382
|
-
var getColorClass = (namespace, palette, shade) => {
|
|
1383
|
-
return `${String(namespace)}-${String(palette)}${shade !== void 0 ? `-${String(shade)}` : ""}`;
|
|
1384
|
-
};
|
|
1385
|
-
|
|
1386
1381
|
// src/components/Avatar/Avatar.tsx
|
|
1387
1382
|
import { jsx as jsx297 } from "react/jsx-runtime";
|
|
1388
1383
|
var Avatar = (props) => {
|
|
@@ -1391,17 +1386,10 @@ var Avatar = (props) => {
|
|
|
1391
1386
|
alt,
|
|
1392
1387
|
name,
|
|
1393
1388
|
size: size4 = "md",
|
|
1394
|
-
|
|
1395
|
-
color: color2 = "blue",
|
|
1396
|
-
colorDepth,
|
|
1397
|
-
colorToken,
|
|
1389
|
+
color: color2 = "xplat-blue-500",
|
|
1398
1390
|
className
|
|
1399
1391
|
} = props;
|
|
1400
|
-
const colorClass =
|
|
1401
|
-
colorNamespace,
|
|
1402
|
-
color2,
|
|
1403
|
-
colorDepth ?? 500
|
|
1404
|
-
);
|
|
1392
|
+
const colorClass = color2;
|
|
1405
1393
|
const initials = name ? name.split(" ").map((s) => s[0]).join("").slice(0, 2).toUpperCase() : "";
|
|
1406
1394
|
return /* @__PURE__ */ jsx297("div", { className: clsx_default("lib-xplat-avatar", size4, className), children: src ? /* @__PURE__ */ jsx297("img", { src, alt: alt || name || "avatar" }) : /* @__PURE__ */ jsx297("div", { className: clsx_default("fallback", colorClass), children: initials || /* @__PURE__ */ jsx297("svg", { viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx297("path", { d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" }) }) }) });
|
|
1407
1395
|
};
|
|
@@ -1417,17 +1405,10 @@ var Badge = (props) => {
|
|
|
1417
1405
|
maxCount = 99,
|
|
1418
1406
|
dot = false,
|
|
1419
1407
|
size: size4 = "md",
|
|
1420
|
-
|
|
1421
|
-
color: color2 = "red",
|
|
1422
|
-
colorDepth,
|
|
1423
|
-
colorToken,
|
|
1408
|
+
color: color2 = "xplat-red-500",
|
|
1424
1409
|
className
|
|
1425
1410
|
} = props;
|
|
1426
|
-
const colorClass =
|
|
1427
|
-
colorNamespace,
|
|
1428
|
-
color2,
|
|
1429
|
-
colorDepth ?? 500
|
|
1430
|
-
);
|
|
1411
|
+
const colorClass = color2;
|
|
1431
1412
|
const showBadge = dot || count2 !== void 0 && count2 > 0;
|
|
1432
1413
|
const displayCount = count2 !== void 0 && count2 > maxCount ? `${maxCount}+` : count2;
|
|
1433
1414
|
return /* @__PURE__ */ jsxs191("div", { className: clsx_default("lib-xplat-badge", size4, className), children: [
|
|
@@ -1460,19 +1441,12 @@ var Button = (props) => {
|
|
|
1460
1441
|
children,
|
|
1461
1442
|
type = "primary",
|
|
1462
1443
|
size: size4 = "md",
|
|
1463
|
-
|
|
1464
|
-
color: color2 = "black",
|
|
1465
|
-
colorDepth,
|
|
1466
|
-
colorToken,
|
|
1444
|
+
color: color2 = "xplat-black",
|
|
1467
1445
|
disabled,
|
|
1468
1446
|
className,
|
|
1469
1447
|
...rest
|
|
1470
1448
|
} = props;
|
|
1471
|
-
const colorClass =
|
|
1472
|
-
colorNamespace,
|
|
1473
|
-
color2,
|
|
1474
|
-
colorDepth ?? 500
|
|
1475
|
-
);
|
|
1449
|
+
const colorClass = color2;
|
|
1476
1450
|
return /* @__PURE__ */ jsx300(
|
|
1477
1451
|
"button",
|
|
1478
1452
|
{
|
|
@@ -16090,10 +16064,7 @@ var Chart_default = Chart3;
|
|
|
16090
16064
|
import { jsx as jsx306, jsxs as jsxs195 } from "react/jsx-runtime";
|
|
16091
16065
|
var CheckBox = (props) => {
|
|
16092
16066
|
const {
|
|
16093
|
-
|
|
16094
|
-
color: color2 = "blue",
|
|
16095
|
-
colorDepth,
|
|
16096
|
-
colorToken,
|
|
16067
|
+
color: color2 = "xplat-blue-500",
|
|
16097
16068
|
checked,
|
|
16098
16069
|
label,
|
|
16099
16070
|
onChange,
|
|
@@ -16105,11 +16076,7 @@ var CheckBox = (props) => {
|
|
|
16105
16076
|
const handleChange = (e) => {
|
|
16106
16077
|
if (onChange) onChange(e);
|
|
16107
16078
|
};
|
|
16108
|
-
const mainColor =
|
|
16109
|
-
colorNamespace,
|
|
16110
|
-
color2,
|
|
16111
|
-
colorDepth ?? 500
|
|
16112
|
-
);
|
|
16079
|
+
const mainColor = color2;
|
|
16113
16080
|
const uncheckedClasses = `unchecked`;
|
|
16114
16081
|
const checkedClasses = `checked ${mainColor}`;
|
|
16115
16082
|
const disabledClasses = "disabled";
|
|
@@ -16137,19 +16104,12 @@ import { jsx as jsx307 } from "react/jsx-runtime";
|
|
|
16137
16104
|
var Chip = (props) => {
|
|
16138
16105
|
const {
|
|
16139
16106
|
children,
|
|
16140
|
-
|
|
16141
|
-
color: color2 = "black",
|
|
16142
|
-
colorDepth,
|
|
16143
|
-
colorToken,
|
|
16107
|
+
color: color2 = "xplat-black",
|
|
16144
16108
|
type = "primary",
|
|
16145
16109
|
size: size4 = "md",
|
|
16146
16110
|
className
|
|
16147
16111
|
} = props;
|
|
16148
|
-
const colorClass =
|
|
16149
|
-
colorNamespace,
|
|
16150
|
-
color2,
|
|
16151
|
-
colorDepth ?? 500
|
|
16152
|
-
);
|
|
16112
|
+
const colorClass = color2;
|
|
16153
16113
|
return /* @__PURE__ */ jsx307("div", { className: clsx_default("lib-xplat-chip", type, size4, colorClass, className), children });
|
|
16154
16114
|
};
|
|
16155
16115
|
Chip.displayName = "Chip";
|
|
@@ -27143,19 +27103,11 @@ var Modal_default = Modal;
|
|
|
27143
27103
|
|
|
27144
27104
|
// src/components/DatePicker/SingleDatePicker/index.tsx
|
|
27145
27105
|
import { jsx as jsx314 } from "react/jsx-runtime";
|
|
27146
|
-
function getColorValue(ns, color2, depth) {
|
|
27147
|
-
const nsColors = colors[ns];
|
|
27148
|
-
const colorEntry = nsColors[color2];
|
|
27149
|
-
if (typeof colorEntry === "string") return colorEntry;
|
|
27150
|
-
return colorEntry[String(depth)] ?? "";
|
|
27151
|
-
}
|
|
27152
27106
|
var SingleDatePicker = (props) => {
|
|
27153
27107
|
const {
|
|
27154
27108
|
value,
|
|
27155
27109
|
onChange,
|
|
27156
|
-
|
|
27157
|
-
color: color2 = "blue",
|
|
27158
|
-
colorDepth,
|
|
27110
|
+
color: color2 = "xplat-blue-500",
|
|
27159
27111
|
highlightDates,
|
|
27160
27112
|
...rest
|
|
27161
27113
|
} = props;
|
|
@@ -27163,16 +27115,11 @@ var SingleDatePicker = (props) => {
|
|
|
27163
27115
|
if (Array.isArray(date)) return;
|
|
27164
27116
|
onChange?.(date);
|
|
27165
27117
|
};
|
|
27166
|
-
const activeColor = getColorValue(
|
|
27167
|
-
colorNamespace,
|
|
27168
|
-
color2,
|
|
27169
|
-
colorDepth ?? 500
|
|
27170
|
-
);
|
|
27171
27118
|
return /* @__PURE__ */ jsx314(
|
|
27172
27119
|
"div",
|
|
27173
27120
|
{
|
|
27174
27121
|
className: "lib-xplat-datepicker",
|
|
27175
|
-
style: { "--datepicker-active-color":
|
|
27122
|
+
style: { "--datepicker-active-color": `var(--${color2})` },
|
|
27176
27123
|
children: /* @__PURE__ */ jsx314(
|
|
27177
27124
|
DatePicker,
|
|
27178
27125
|
{
|
|
@@ -27230,13 +27177,12 @@ var PopupPicker = (props) => {
|
|
|
27230
27177
|
Button_default,
|
|
27231
27178
|
{
|
|
27232
27179
|
type: "secondary",
|
|
27233
|
-
color: "neutral",
|
|
27234
|
-
colorDepth: 400,
|
|
27180
|
+
color: "xplat-neutral-400",
|
|
27235
27181
|
onClick: handleClose,
|
|
27236
27182
|
children: "\uCDE8\uC18C"
|
|
27237
27183
|
}
|
|
27238
27184
|
),
|
|
27239
|
-
/* @__PURE__ */ jsx315(Button_default, { type: "primary", color: "blue", onClick: handleClose, children: "\uC801\uC6A9" })
|
|
27185
|
+
/* @__PURE__ */ jsx315(Button_default, { type: "primary", color: "xplat-blue-500", onClick: handleClose, children: "\uC801\uC6A9" })
|
|
27240
27186
|
] })
|
|
27241
27187
|
] }) })
|
|
27242
27188
|
] });
|
|
@@ -27266,19 +27212,12 @@ var RangePicker = (props) => {
|
|
|
27266
27212
|
onChange,
|
|
27267
27213
|
minDate,
|
|
27268
27214
|
maxDate,
|
|
27269
|
-
|
|
27270
|
-
color: color2,
|
|
27271
|
-
colorDepth
|
|
27215
|
+
color: color2
|
|
27272
27216
|
} = props;
|
|
27273
27217
|
const rangeDates = React13.useMemo(
|
|
27274
27218
|
() => getDatesBetween(startDate, endDate),
|
|
27275
27219
|
[startDate, endDate]
|
|
27276
27220
|
);
|
|
27277
|
-
const colorProps = {
|
|
27278
|
-
...colorNamespace !== void 0 && { colorNamespace },
|
|
27279
|
-
...color2 !== void 0 && { color: color2 },
|
|
27280
|
-
...colorDepth !== void 0 && { colorDepth }
|
|
27281
|
-
};
|
|
27282
27221
|
return /* @__PURE__ */ jsxs200("div", { className: "lib-xplat-range-datepicker", children: [
|
|
27283
27222
|
/* @__PURE__ */ jsxs200("div", { className: "lib-xplat-range-datepicker-from", children: [
|
|
27284
27223
|
/* @__PURE__ */ jsx316("span", { className: "lib-xplat-range-datepicker-label", children: "\uC2DC\uC791" }),
|
|
@@ -27290,7 +27229,7 @@ var RangePicker = (props) => {
|
|
|
27290
27229
|
minDate,
|
|
27291
27230
|
maxDate: endDate,
|
|
27292
27231
|
highlightDates: rangeDates,
|
|
27293
|
-
|
|
27232
|
+
color: color2
|
|
27294
27233
|
}
|
|
27295
27234
|
)
|
|
27296
27235
|
] }),
|
|
@@ -27304,7 +27243,7 @@ var RangePicker = (props) => {
|
|
|
27304
27243
|
minDate: startDate,
|
|
27305
27244
|
maxDate,
|
|
27306
27245
|
highlightDates: rangeDates,
|
|
27307
|
-
|
|
27246
|
+
color: color2
|
|
27308
27247
|
}
|
|
27309
27248
|
)
|
|
27310
27249
|
] })
|
|
@@ -28016,17 +27955,10 @@ var Pagination = (props) => {
|
|
|
28016
27955
|
siblingCount = 1,
|
|
28017
27956
|
onChange,
|
|
28018
27957
|
size: size4 = "md",
|
|
28019
|
-
|
|
28020
|
-
color: color2 = "blue",
|
|
28021
|
-
colorDepth,
|
|
28022
|
-
colorToken,
|
|
27958
|
+
color: color2 = "xplat-blue-500",
|
|
28023
27959
|
className
|
|
28024
27960
|
} = props;
|
|
28025
|
-
const colorClass =
|
|
28026
|
-
colorNamespace,
|
|
28027
|
-
color2,
|
|
28028
|
-
colorDepth ?? 500
|
|
28029
|
-
);
|
|
27961
|
+
const colorClass = color2;
|
|
28030
27962
|
const totalPages = Math.max(1, Math.ceil(total / pageSize));
|
|
28031
27963
|
const pages = getPageRange(current, totalPages, siblingCount);
|
|
28032
27964
|
const handleClick = (page) => {
|
|
@@ -28136,17 +28068,10 @@ var Progress = (props) => {
|
|
|
28136
28068
|
max: max3 = 100,
|
|
28137
28069
|
size: size4 = "md",
|
|
28138
28070
|
showLabel = false,
|
|
28139
|
-
|
|
28140
|
-
color: color2 = "blue",
|
|
28141
|
-
colorDepth,
|
|
28142
|
-
colorToken,
|
|
28071
|
+
color: color2 = "xplat-blue-500",
|
|
28143
28072
|
className
|
|
28144
28073
|
} = props;
|
|
28145
|
-
const colorClass =
|
|
28146
|
-
colorNamespace,
|
|
28147
|
-
color2,
|
|
28148
|
-
colorDepth ?? 500
|
|
28149
|
-
);
|
|
28074
|
+
const colorClass = color2;
|
|
28150
28075
|
const percentage = Math.min(100, Math.max(0, value / max3 * 100));
|
|
28151
28076
|
return /* @__PURE__ */ jsxs209("div", { className: clsx_default("lib-xplat-progress", size4, className), children: [
|
|
28152
28077
|
/* @__PURE__ */ jsx328(
|
|
@@ -28192,10 +28117,7 @@ var Radio = (props) => {
|
|
|
28192
28117
|
label,
|
|
28193
28118
|
value,
|
|
28194
28119
|
className,
|
|
28195
|
-
|
|
28196
|
-
color: color2 = "blue",
|
|
28197
|
-
colorDepth,
|
|
28198
|
-
colorToken,
|
|
28120
|
+
color: color2 = "xplat-blue-500",
|
|
28199
28121
|
size: sizeProp,
|
|
28200
28122
|
...rest
|
|
28201
28123
|
} = props;
|
|
@@ -28208,11 +28130,7 @@ var Radio = (props) => {
|
|
|
28208
28130
|
value,
|
|
28209
28131
|
onChange: rest.onChange
|
|
28210
28132
|
};
|
|
28211
|
-
const colorClass =
|
|
28212
|
-
colorNamespace,
|
|
28213
|
-
color2,
|
|
28214
|
-
colorDepth ?? 500
|
|
28215
|
-
);
|
|
28133
|
+
const colorClass = color2;
|
|
28216
28134
|
return /* @__PURE__ */ jsxs210(
|
|
28217
28135
|
"label",
|
|
28218
28136
|
{
|
|
@@ -28277,17 +28195,10 @@ import { jsx as jsx332, jsxs as jsxs211 } from "react/jsx-runtime";
|
|
|
28277
28195
|
var Spinner = (props) => {
|
|
28278
28196
|
const {
|
|
28279
28197
|
size: size4 = "md",
|
|
28280
|
-
|
|
28281
|
-
color: color2 = "blue",
|
|
28282
|
-
colorDepth,
|
|
28283
|
-
colorToken,
|
|
28198
|
+
color: color2 = "xplat-blue-500",
|
|
28284
28199
|
className
|
|
28285
28200
|
} = props;
|
|
28286
|
-
const colorClass =
|
|
28287
|
-
colorNamespace,
|
|
28288
|
-
color2,
|
|
28289
|
-
colorDepth ?? 500
|
|
28290
|
-
);
|
|
28201
|
+
const colorClass = color2;
|
|
28291
28202
|
return /* @__PURE__ */ jsx332(
|
|
28292
28203
|
"div",
|
|
28293
28204
|
{
|
|
@@ -28329,17 +28240,10 @@ var Steps = (props) => {
|
|
|
28329
28240
|
const {
|
|
28330
28241
|
items,
|
|
28331
28242
|
current,
|
|
28332
|
-
|
|
28333
|
-
color: color2 = "blue",
|
|
28334
|
-
colorDepth,
|
|
28335
|
-
colorToken,
|
|
28243
|
+
color: color2 = "xplat-blue-500",
|
|
28336
28244
|
className
|
|
28337
28245
|
} = props;
|
|
28338
|
-
const colorClass =
|
|
28339
|
-
colorNamespace,
|
|
28340
|
-
color2,
|
|
28341
|
-
colorDepth ?? 500
|
|
28342
|
-
);
|
|
28246
|
+
const colorClass = color2;
|
|
28343
28247
|
return /* @__PURE__ */ jsx333("div", { className: clsx_default("lib-xplat-steps", className), children: items.map((item, index3) => {
|
|
28344
28248
|
const status = index3 < current ? "completed" : index3 === current ? "active" : "pending";
|
|
28345
28249
|
return /* @__PURE__ */ jsxs212("div", { className: clsx_default("step-item", status), children: [
|
|
@@ -28357,9 +28261,270 @@ var Steps = (props) => {
|
|
|
28357
28261
|
Steps.displayName = "Steps";
|
|
28358
28262
|
var Steps_default = Steps;
|
|
28359
28263
|
|
|
28360
|
-
// src/components/
|
|
28264
|
+
// src/components/Swiper/Swiper.tsx
|
|
28361
28265
|
import React27 from "react";
|
|
28362
|
-
import { jsx as jsx334 } from "react/jsx-runtime";
|
|
28266
|
+
import { jsx as jsx334, jsxs as jsxs213 } from "react/jsx-runtime";
|
|
28267
|
+
var Swiper = (props) => {
|
|
28268
|
+
const {
|
|
28269
|
+
auto = false,
|
|
28270
|
+
swiperRef,
|
|
28271
|
+
renderItems = [],
|
|
28272
|
+
viewItemCount = 1,
|
|
28273
|
+
maxItems,
|
|
28274
|
+
loop = false,
|
|
28275
|
+
spaceBetween = 16,
|
|
28276
|
+
showProgress = false,
|
|
28277
|
+
autoplayDelay = 3e3,
|
|
28278
|
+
speed = 300,
|
|
28279
|
+
slideBy = 1,
|
|
28280
|
+
index: indexProp,
|
|
28281
|
+
onChange,
|
|
28282
|
+
className
|
|
28283
|
+
} = props;
|
|
28284
|
+
const items = maxItems ? renderItems.slice(0, maxItems) : renderItems;
|
|
28285
|
+
const totalSlides = items.length;
|
|
28286
|
+
const canSlide = totalSlides > viewItemCount;
|
|
28287
|
+
const maxIndex = Math.max(0, totalSlides - viewItemCount);
|
|
28288
|
+
const useLoop = loop && canSlide;
|
|
28289
|
+
const cloneCount = useLoop ? totalSlides : 0;
|
|
28290
|
+
const extendedItems = React27.useMemo(() => {
|
|
28291
|
+
if (!useLoop) return items;
|
|
28292
|
+
return [...items, ...items, ...items];
|
|
28293
|
+
}, [items, useLoop]);
|
|
28294
|
+
const initialIdx = Math.max(0, Math.min(indexProp ?? 0, maxIndex));
|
|
28295
|
+
const [innerIndex, setInnerIndex] = React27.useState(
|
|
28296
|
+
useLoop ? cloneCount + initialIdx : initialIdx
|
|
28297
|
+
);
|
|
28298
|
+
const [isDragging, setIsDragging] = React27.useState(false);
|
|
28299
|
+
const [dragOffset, setDragOffset] = React27.useState(0);
|
|
28300
|
+
const [animated, setAnimated] = React27.useState(true);
|
|
28301
|
+
const [containerWidth, setContainerWidth] = React27.useState(0);
|
|
28302
|
+
const containerRef = React27.useRef(null);
|
|
28303
|
+
const startXRef = React27.useRef(0);
|
|
28304
|
+
const startTimeRef = React27.useRef(0);
|
|
28305
|
+
const autoplayTimerRef = React27.useRef(null);
|
|
28306
|
+
React27.useEffect(() => {
|
|
28307
|
+
const el = containerRef.current;
|
|
28308
|
+
if (!el) return;
|
|
28309
|
+
const ro = new ResizeObserver((entries) => {
|
|
28310
|
+
for (const entry of entries) {
|
|
28311
|
+
setContainerWidth(entry.contentRect.width);
|
|
28312
|
+
}
|
|
28313
|
+
});
|
|
28314
|
+
ro.observe(el);
|
|
28315
|
+
setContainerWidth(el.offsetWidth);
|
|
28316
|
+
return () => ro.disconnect();
|
|
28317
|
+
}, []);
|
|
28318
|
+
const slideStep = containerWidth > 0 ? (containerWidth - (viewItemCount - 1) * spaceBetween) / viewItemCount + spaceBetween : 0;
|
|
28319
|
+
const transformPx = -(innerIndex * slideStep) + dragOffset;
|
|
28320
|
+
const getRealIndex = (inner) => {
|
|
28321
|
+
if (!useLoop) return inner;
|
|
28322
|
+
return ((inner - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
28323
|
+
};
|
|
28324
|
+
const realIndex = getRealIndex(innerIndex);
|
|
28325
|
+
const moveToInner = React27.useCallback(
|
|
28326
|
+
(idx, withAnim = true) => {
|
|
28327
|
+
if (useLoop) {
|
|
28328
|
+
setInnerIndex((prev) => {
|
|
28329
|
+
const real = ((prev - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
28330
|
+
const canonical = cloneCount + real;
|
|
28331
|
+
if (prev !== canonical) {
|
|
28332
|
+
const delta = idx - prev;
|
|
28333
|
+
setAnimated(withAnim);
|
|
28334
|
+
return canonical + delta;
|
|
28335
|
+
}
|
|
28336
|
+
setAnimated(withAnim);
|
|
28337
|
+
return idx;
|
|
28338
|
+
});
|
|
28339
|
+
} else {
|
|
28340
|
+
setAnimated(withAnim);
|
|
28341
|
+
setInnerIndex(idx);
|
|
28342
|
+
}
|
|
28343
|
+
},
|
|
28344
|
+
[useLoop, cloneCount, totalSlides]
|
|
28345
|
+
);
|
|
28346
|
+
const handleTransitionEnd = React27.useCallback(() => {
|
|
28347
|
+
if (!useLoop) return;
|
|
28348
|
+
const real = getRealIndex(innerIndex);
|
|
28349
|
+
const canonical = cloneCount + real;
|
|
28350
|
+
if (innerIndex !== canonical) {
|
|
28351
|
+
moveToInner(canonical, false);
|
|
28352
|
+
}
|
|
28353
|
+
onChange?.(Math.min(real, maxIndex));
|
|
28354
|
+
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange, moveToInner]);
|
|
28355
|
+
const slideTo = React27.useCallback(
|
|
28356
|
+
(logicalIndex) => {
|
|
28357
|
+
if (!canSlide) return;
|
|
28358
|
+
const clamped = useLoop ? logicalIndex : Math.max(0, Math.min(logicalIndex, maxIndex));
|
|
28359
|
+
const target = useLoop ? cloneCount + clamped : clamped;
|
|
28360
|
+
moveToInner(target, true);
|
|
28361
|
+
if (!useLoop) onChange?.(clamped);
|
|
28362
|
+
},
|
|
28363
|
+
[canSlide, useLoop, cloneCount, maxIndex, onChange, moveToInner]
|
|
28364
|
+
);
|
|
28365
|
+
const slideNext = React27.useCallback(() => {
|
|
28366
|
+
if (!canSlide) return;
|
|
28367
|
+
const nextInner = innerIndex + slideBy;
|
|
28368
|
+
if (useLoop) {
|
|
28369
|
+
moveToInner(nextInner, true);
|
|
28370
|
+
} else {
|
|
28371
|
+
moveToInner(Math.min(nextInner, maxIndex), true);
|
|
28372
|
+
}
|
|
28373
|
+
}, [canSlide, useLoop, innerIndex, slideBy, maxIndex, moveToInner]);
|
|
28374
|
+
const slidePrev = React27.useCallback(() => {
|
|
28375
|
+
if (!canSlide) return;
|
|
28376
|
+
const prevInner = innerIndex - slideBy;
|
|
28377
|
+
if (useLoop) {
|
|
28378
|
+
moveToInner(prevInner, true);
|
|
28379
|
+
} else {
|
|
28380
|
+
moveToInner(Math.max(prevInner, 0), true);
|
|
28381
|
+
}
|
|
28382
|
+
}, [canSlide, useLoop, innerIndex, slideBy, moveToInner]);
|
|
28383
|
+
React27.useEffect(() => {
|
|
28384
|
+
if (indexProp === void 0) return;
|
|
28385
|
+
const clamped = Math.max(0, Math.min(indexProp, maxIndex));
|
|
28386
|
+
const target = useLoop ? cloneCount + clamped : clamped;
|
|
28387
|
+
if (target !== innerIndex) {
|
|
28388
|
+
moveToInner(target, true);
|
|
28389
|
+
}
|
|
28390
|
+
}, [indexProp]);
|
|
28391
|
+
React27.useImperativeHandle(swiperRef, () => ({
|
|
28392
|
+
slidePrev,
|
|
28393
|
+
slideNext,
|
|
28394
|
+
slideTo
|
|
28395
|
+
}));
|
|
28396
|
+
React27.useEffect(() => {
|
|
28397
|
+
if (!auto || !canSlide) return;
|
|
28398
|
+
autoplayTimerRef.current = setInterval(slideNext, autoplayDelay);
|
|
28399
|
+
return () => {
|
|
28400
|
+
if (autoplayTimerRef.current) clearInterval(autoplayTimerRef.current);
|
|
28401
|
+
};
|
|
28402
|
+
}, [auto, autoplayDelay, slideNext, canSlide]);
|
|
28403
|
+
const pauseAutoplay = () => {
|
|
28404
|
+
if (autoplayTimerRef.current) clearInterval(autoplayTimerRef.current);
|
|
28405
|
+
};
|
|
28406
|
+
const getClientX = (e) => {
|
|
28407
|
+
if ("touches" in e) return e.touches[0]?.clientX ?? 0;
|
|
28408
|
+
return e.clientX;
|
|
28409
|
+
};
|
|
28410
|
+
const handleDragStart = (e) => {
|
|
28411
|
+
if (!canSlide) return;
|
|
28412
|
+
if ("button" in e && e.button !== 0) return;
|
|
28413
|
+
pauseAutoplay();
|
|
28414
|
+
setIsDragging(true);
|
|
28415
|
+
setAnimated(false);
|
|
28416
|
+
startXRef.current = getClientX(e);
|
|
28417
|
+
startTimeRef.current = Date.now();
|
|
28418
|
+
};
|
|
28419
|
+
React27.useEffect(() => {
|
|
28420
|
+
if (!isDragging) return;
|
|
28421
|
+
const handleMove = (e) => {
|
|
28422
|
+
setDragOffset(getClientX(e) - startXRef.current);
|
|
28423
|
+
};
|
|
28424
|
+
const handleEnd = () => {
|
|
28425
|
+
setIsDragging(false);
|
|
28426
|
+
const absDrag = Math.abs(dragOffset);
|
|
28427
|
+
const elapsed = Date.now() - startTimeRef.current;
|
|
28428
|
+
const velocity = absDrag / elapsed;
|
|
28429
|
+
if ((absDrag > 30 || velocity > 0.3) && slideStep > 0) {
|
|
28430
|
+
const rawCount = Math.max(1, Math.round(absDrag / slideStep));
|
|
28431
|
+
const count2 = Math.max(slideBy, Math.round(rawCount / slideBy) * slideBy);
|
|
28432
|
+
const direction = dragOffset < 0 ? 1 : -1;
|
|
28433
|
+
const nextInner = innerIndex + direction * count2;
|
|
28434
|
+
if (useLoop) {
|
|
28435
|
+
moveToInner(nextInner, true);
|
|
28436
|
+
} else {
|
|
28437
|
+
moveToInner(Math.max(0, Math.min(nextInner, maxIndex)), true);
|
|
28438
|
+
}
|
|
28439
|
+
} else {
|
|
28440
|
+
setAnimated(true);
|
|
28441
|
+
}
|
|
28442
|
+
setDragOffset(0);
|
|
28443
|
+
};
|
|
28444
|
+
window.addEventListener("mousemove", handleMove);
|
|
28445
|
+
window.addEventListener("mouseup", handleEnd);
|
|
28446
|
+
window.addEventListener("touchmove", handleMove, { passive: true });
|
|
28447
|
+
window.addEventListener("touchend", handleEnd);
|
|
28448
|
+
return () => {
|
|
28449
|
+
window.removeEventListener("mousemove", handleMove);
|
|
28450
|
+
window.removeEventListener("mouseup", handleEnd);
|
|
28451
|
+
window.removeEventListener("touchmove", handleMove);
|
|
28452
|
+
window.removeEventListener("touchend", handleEnd);
|
|
28453
|
+
};
|
|
28454
|
+
}, [isDragging, dragOffset, innerIndex, useLoop, maxIndex, slideStep, moveToInner]);
|
|
28455
|
+
const slideWidthPercent = 100 / viewItemCount;
|
|
28456
|
+
const gapAdjust = spaceBetween * (viewItemCount - 1) / viewItemCount;
|
|
28457
|
+
const totalSteps = Math.ceil((maxIndex + 1) / slideBy);
|
|
28458
|
+
const currentStep = Math.min(
|
|
28459
|
+
Math.floor(realIndex / slideBy),
|
|
28460
|
+
totalSteps - 1
|
|
28461
|
+
);
|
|
28462
|
+
return /* @__PURE__ */ jsxs213("div", { className: clsx_default("lib-xplat-swiper", className), ref: containerRef, children: [
|
|
28463
|
+
/* @__PURE__ */ jsx334(
|
|
28464
|
+
"div",
|
|
28465
|
+
{
|
|
28466
|
+
className: "lib-xplat-swiper__viewport",
|
|
28467
|
+
onMouseDown: handleDragStart,
|
|
28468
|
+
onTouchStart: handleDragStart,
|
|
28469
|
+
children: /* @__PURE__ */ jsx334(
|
|
28470
|
+
"div",
|
|
28471
|
+
{
|
|
28472
|
+
className: clsx_default(
|
|
28473
|
+
"lib-xplat-swiper__track",
|
|
28474
|
+
animated && !isDragging && "transitioning"
|
|
28475
|
+
),
|
|
28476
|
+
style: {
|
|
28477
|
+
transform: `translateX(${transformPx}px)`,
|
|
28478
|
+
transitionDuration: isDragging || !animated ? "0ms" : `${speed}ms`,
|
|
28479
|
+
gap: `${spaceBetween}px`
|
|
28480
|
+
},
|
|
28481
|
+
onTransitionEnd: handleTransitionEnd,
|
|
28482
|
+
children: extendedItems.map((item, idx) => /* @__PURE__ */ jsx334(
|
|
28483
|
+
"div",
|
|
28484
|
+
{
|
|
28485
|
+
className: "lib-xplat-swiper__slide",
|
|
28486
|
+
style: {
|
|
28487
|
+
minWidth: `calc(${slideWidthPercent}% - ${gapAdjust}px)`,
|
|
28488
|
+
maxWidth: `calc(${slideWidthPercent}% - ${gapAdjust}px)`
|
|
28489
|
+
},
|
|
28490
|
+
children: item
|
|
28491
|
+
},
|
|
28492
|
+
idx
|
|
28493
|
+
))
|
|
28494
|
+
}
|
|
28495
|
+
)
|
|
28496
|
+
}
|
|
28497
|
+
),
|
|
28498
|
+
showProgress && canSlide && /* @__PURE__ */ jsx334("div", { className: "lib-xplat-swiper__progress", children: /* @__PURE__ */ jsx334("div", { className: "lib-xplat-swiper__progress-track", children: /* @__PURE__ */ jsx334(
|
|
28499
|
+
"span",
|
|
28500
|
+
{
|
|
28501
|
+
className: "lib-xplat-swiper__progress-fill",
|
|
28502
|
+
style: {
|
|
28503
|
+
width: `${(currentStep + 1) / totalSteps * 100}%`,
|
|
28504
|
+
transitionDuration: `${speed}ms`
|
|
28505
|
+
}
|
|
28506
|
+
}
|
|
28507
|
+
) }) }),
|
|
28508
|
+
canSlide && /* @__PURE__ */ jsx334("div", { className: "lib-xplat-swiper__dots", children: Array.from({ length: totalSteps }, (_, i) => /* @__PURE__ */ jsx334(
|
|
28509
|
+
"button",
|
|
28510
|
+
{
|
|
28511
|
+
className: clsx_default(
|
|
28512
|
+
"lib-xplat-swiper__dot",
|
|
28513
|
+
i === currentStep && "active"
|
|
28514
|
+
),
|
|
28515
|
+
onClick: () => slideTo(i * slideBy),
|
|
28516
|
+
"aria-label": `\uC2AC\uB77C\uC774\uB4DC ${i + 1}`
|
|
28517
|
+
},
|
|
28518
|
+
i
|
|
28519
|
+
)) })
|
|
28520
|
+
] });
|
|
28521
|
+
};
|
|
28522
|
+
Swiper.displayName = "Swiper";
|
|
28523
|
+
var Swiper_default = Swiper;
|
|
28524
|
+
|
|
28525
|
+
// src/components/Switch/Switch.tsx
|
|
28526
|
+
import React28 from "react";
|
|
28527
|
+
import { jsx as jsx335 } from "react/jsx-runtime";
|
|
28363
28528
|
var KNOB_TRANSITION_MS = 250;
|
|
28364
28529
|
var Switch = (props) => {
|
|
28365
28530
|
const {
|
|
@@ -28367,15 +28532,12 @@ var Switch = (props) => {
|
|
|
28367
28532
|
size: size4 = "md",
|
|
28368
28533
|
disabled,
|
|
28369
28534
|
onChange,
|
|
28370
|
-
|
|
28371
|
-
color: color2 = "blue",
|
|
28372
|
-
colorDepth,
|
|
28373
|
-
colorToken,
|
|
28535
|
+
color: color2 = "xplat-blue-500",
|
|
28374
28536
|
className
|
|
28375
28537
|
} = props;
|
|
28376
|
-
const [isAnimating, setIsAnimating] =
|
|
28377
|
-
const timeoutRef =
|
|
28378
|
-
|
|
28538
|
+
const [isAnimating, setIsAnimating] = React28.useState(false);
|
|
28539
|
+
const timeoutRef = React28.useRef(null);
|
|
28540
|
+
React28.useEffect(() => {
|
|
28379
28541
|
return () => {
|
|
28380
28542
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
28381
28543
|
};
|
|
@@ -28390,12 +28552,8 @@ var Switch = (props) => {
|
|
|
28390
28552
|
timeoutRef.current = null;
|
|
28391
28553
|
}, KNOB_TRANSITION_MS);
|
|
28392
28554
|
};
|
|
28393
|
-
const colorClass =
|
|
28394
|
-
|
|
28395
|
-
color2,
|
|
28396
|
-
colorDepth ?? 500
|
|
28397
|
-
);
|
|
28398
|
-
return /* @__PURE__ */ jsx334(
|
|
28555
|
+
const colorClass = color2;
|
|
28556
|
+
return /* @__PURE__ */ jsx335(
|
|
28399
28557
|
"div",
|
|
28400
28558
|
{
|
|
28401
28559
|
className: clsx_default(
|
|
@@ -28409,7 +28567,7 @@ var Switch = (props) => {
|
|
|
28409
28567
|
),
|
|
28410
28568
|
onClick: handleClick,
|
|
28411
28569
|
"aria-disabled": disabled || isAnimating,
|
|
28412
|
-
children: /* @__PURE__ */
|
|
28570
|
+
children: /* @__PURE__ */ jsx335("div", { className: clsx_default("knob", value ? "checked" : void 0) })
|
|
28413
28571
|
}
|
|
28414
28572
|
);
|
|
28415
28573
|
};
|
|
@@ -28417,14 +28575,14 @@ Switch.displayName = "Switch";
|
|
|
28417
28575
|
var Switch_default = Switch;
|
|
28418
28576
|
|
|
28419
28577
|
// src/components/Tab/Tab.tsx
|
|
28420
|
-
import
|
|
28578
|
+
import React30 from "react";
|
|
28421
28579
|
|
|
28422
28580
|
// src/components/Tab/TabItem.tsx
|
|
28423
|
-
import
|
|
28424
|
-
import { jsx as
|
|
28425
|
-
var TabItem =
|
|
28581
|
+
import React29 from "react";
|
|
28582
|
+
import { jsx as jsx336 } from "react/jsx-runtime";
|
|
28583
|
+
var TabItem = React29.forwardRef((props, ref) => {
|
|
28426
28584
|
const { isActive, title, onClick } = props;
|
|
28427
|
-
return /* @__PURE__ */
|
|
28585
|
+
return /* @__PURE__ */ jsx336(
|
|
28428
28586
|
"div",
|
|
28429
28587
|
{
|
|
28430
28588
|
ref,
|
|
@@ -28438,25 +28596,25 @@ TabItem.displayName = "TabItem";
|
|
|
28438
28596
|
var TabItem_default = TabItem;
|
|
28439
28597
|
|
|
28440
28598
|
// src/components/Tab/Tab.tsx
|
|
28441
|
-
import { jsx as
|
|
28599
|
+
import { jsx as jsx337, jsxs as jsxs214 } from "react/jsx-runtime";
|
|
28442
28600
|
var Tab = (props) => {
|
|
28443
28601
|
const { activeIndex, onChange, tabs, type, size: size4 = "md" } = props;
|
|
28444
|
-
const [underlineStyle, setUnderlineStyle] =
|
|
28602
|
+
const [underlineStyle, setUnderlineStyle] = React30.useState({
|
|
28445
28603
|
left: 0,
|
|
28446
28604
|
width: 0
|
|
28447
28605
|
});
|
|
28448
|
-
const itemRefs =
|
|
28606
|
+
const itemRefs = React30.useRef([]);
|
|
28449
28607
|
const handleChangeActiveTab = (tabItem, tabIdx) => {
|
|
28450
28608
|
onChange(tabItem, tabIdx);
|
|
28451
28609
|
};
|
|
28452
|
-
|
|
28610
|
+
React30.useEffect(() => {
|
|
28453
28611
|
const el = itemRefs.current[activeIndex];
|
|
28454
28612
|
if (el) {
|
|
28455
28613
|
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
28456
28614
|
}
|
|
28457
28615
|
}, [activeIndex, tabs.length]);
|
|
28458
|
-
return /* @__PURE__ */
|
|
28459
|
-
tabs.map((tab, idx) => /* @__PURE__ */
|
|
28616
|
+
return /* @__PURE__ */ jsxs214("div", { className: clsx_default("lib-xplat-tab", `type-${type}`, size4), children: [
|
|
28617
|
+
tabs.map((tab, idx) => /* @__PURE__ */ jsx337(
|
|
28460
28618
|
TabItem_default,
|
|
28461
28619
|
{
|
|
28462
28620
|
onClick: () => handleChangeActiveTab(tab, idx),
|
|
@@ -28468,7 +28626,7 @@ var Tab = (props) => {
|
|
|
28468
28626
|
},
|
|
28469
28627
|
`${tab.value}_${idx}`
|
|
28470
28628
|
)),
|
|
28471
|
-
type === "toggle" && /* @__PURE__ */
|
|
28629
|
+
type === "toggle" && /* @__PURE__ */ jsx337(
|
|
28472
28630
|
"div",
|
|
28473
28631
|
{
|
|
28474
28632
|
className: "tab-toggle-underline",
|
|
@@ -28484,17 +28642,17 @@ Tab.displayName = "Tab";
|
|
|
28484
28642
|
var Tab_default = Tab;
|
|
28485
28643
|
|
|
28486
28644
|
// src/components/Table/TableContext.tsx
|
|
28487
|
-
import
|
|
28488
|
-
var TableContext =
|
|
28645
|
+
import React31 from "react";
|
|
28646
|
+
var TableContext = React31.createContext(null);
|
|
28489
28647
|
var useTableContext = () => {
|
|
28490
|
-
const ctx =
|
|
28648
|
+
const ctx = React31.useContext(TableContext);
|
|
28491
28649
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
28492
28650
|
return ctx;
|
|
28493
28651
|
};
|
|
28494
28652
|
var TableContext_default = TableContext;
|
|
28495
28653
|
|
|
28496
28654
|
// src/components/Table/Table.tsx
|
|
28497
|
-
import { jsx as
|
|
28655
|
+
import { jsx as jsx338 } from "react/jsx-runtime";
|
|
28498
28656
|
var Table = (props) => {
|
|
28499
28657
|
const {
|
|
28500
28658
|
className,
|
|
@@ -28504,7 +28662,7 @@ var Table = (props) => {
|
|
|
28504
28662
|
headerSticky = false,
|
|
28505
28663
|
stickyShadow = true
|
|
28506
28664
|
} = props;
|
|
28507
|
-
return /* @__PURE__ */
|
|
28665
|
+
return /* @__PURE__ */ jsx338("div", { className: clsx_default("lib-xplat-table-wrapper", className), children: /* @__PURE__ */ jsx338(
|
|
28508
28666
|
TableContext_default.Provider,
|
|
28509
28667
|
{
|
|
28510
28668
|
value: {
|
|
@@ -28513,7 +28671,7 @@ var Table = (props) => {
|
|
|
28513
28671
|
headerSticky,
|
|
28514
28672
|
stickyShadow
|
|
28515
28673
|
},
|
|
28516
|
-
children: /* @__PURE__ */
|
|
28674
|
+
children: /* @__PURE__ */ jsx338("table", { className: "lib-xplat-table", children })
|
|
28517
28675
|
}
|
|
28518
28676
|
) });
|
|
28519
28677
|
};
|
|
@@ -28521,40 +28679,40 @@ Table.displayName = "Table";
|
|
|
28521
28679
|
var Table_default = Table;
|
|
28522
28680
|
|
|
28523
28681
|
// src/components/Table/TableBody.tsx
|
|
28524
|
-
import { jsx as
|
|
28682
|
+
import { jsx as jsx339 } from "react/jsx-runtime";
|
|
28525
28683
|
var TableBody = (props) => {
|
|
28526
28684
|
const { children, className } = props;
|
|
28527
|
-
return /* @__PURE__ */
|
|
28685
|
+
return /* @__PURE__ */ jsx339("tbody", { className, children });
|
|
28528
28686
|
};
|
|
28529
28687
|
TableBody.displayName = "TableBody";
|
|
28530
28688
|
var TableBody_default = TableBody;
|
|
28531
28689
|
|
|
28532
28690
|
// src/components/Table/TableCell.tsx
|
|
28533
|
-
import
|
|
28691
|
+
import React34 from "react";
|
|
28534
28692
|
|
|
28535
28693
|
// src/components/Table/TableHeadContext.tsx
|
|
28536
|
-
import
|
|
28537
|
-
var TableHeadContext =
|
|
28694
|
+
import React32 from "react";
|
|
28695
|
+
var TableHeadContext = React32.createContext(
|
|
28538
28696
|
null
|
|
28539
28697
|
);
|
|
28540
28698
|
var useTableHeadContext = () => {
|
|
28541
|
-
const ctx =
|
|
28699
|
+
const ctx = React32.useContext(TableHeadContext);
|
|
28542
28700
|
return ctx;
|
|
28543
28701
|
};
|
|
28544
28702
|
var TableHeadContext_default = TableHeadContext;
|
|
28545
28703
|
|
|
28546
28704
|
// src/components/Table/TableRowContext.tsx
|
|
28547
|
-
import
|
|
28548
|
-
var TableRowContext =
|
|
28705
|
+
import React33 from "react";
|
|
28706
|
+
var TableRowContext = React33.createContext(null);
|
|
28549
28707
|
var useTableRowContext = () => {
|
|
28550
|
-
const ctx =
|
|
28708
|
+
const ctx = React33.useContext(TableRowContext);
|
|
28551
28709
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
28552
28710
|
return ctx;
|
|
28553
28711
|
};
|
|
28554
28712
|
var TableRowContext_default = TableRowContext;
|
|
28555
28713
|
|
|
28556
28714
|
// src/components/Table/TableCell.tsx
|
|
28557
|
-
import { jsx as
|
|
28715
|
+
import { jsx as jsx340 } from "react/jsx-runtime";
|
|
28558
28716
|
var TableCell = (props) => {
|
|
28559
28717
|
const {
|
|
28560
28718
|
children,
|
|
@@ -28566,9 +28724,9 @@ var TableCell = (props) => {
|
|
|
28566
28724
|
const { registerStickyCell, stickyCells } = useTableRowContext();
|
|
28567
28725
|
const { stickyShadow } = useTableContext();
|
|
28568
28726
|
const headContext = useTableHeadContext();
|
|
28569
|
-
const [left, setLeft] =
|
|
28570
|
-
const cellRef =
|
|
28571
|
-
const calculateLeft =
|
|
28727
|
+
const [left, setLeft] = React34.useState(0);
|
|
28728
|
+
const cellRef = React34.useRef(null);
|
|
28729
|
+
const calculateLeft = React34.useCallback(() => {
|
|
28572
28730
|
if (!cellRef.current) return 0;
|
|
28573
28731
|
let totalLeft = 0;
|
|
28574
28732
|
for (const ref of stickyCells) {
|
|
@@ -28577,7 +28735,7 @@ var TableCell = (props) => {
|
|
|
28577
28735
|
}
|
|
28578
28736
|
return totalLeft;
|
|
28579
28737
|
}, [stickyCells]);
|
|
28580
|
-
|
|
28738
|
+
React34.useEffect(() => {
|
|
28581
28739
|
if (!isSticky || !cellRef.current) return;
|
|
28582
28740
|
registerStickyCell(cellRef);
|
|
28583
28741
|
setLeft(calculateLeft());
|
|
@@ -28595,7 +28753,7 @@ var TableCell = (props) => {
|
|
|
28595
28753
|
const CellTag = cellRef.current?.tagName === "TH" ? "th" : "td";
|
|
28596
28754
|
const isLastSticky = isSticky && stickyCells[stickyCells.length - 1] === cellRef;
|
|
28597
28755
|
const enableHover = headContext && headContext.cellHover;
|
|
28598
|
-
return /* @__PURE__ */
|
|
28756
|
+
return /* @__PURE__ */ jsx340(
|
|
28599
28757
|
CellTag,
|
|
28600
28758
|
{
|
|
28601
28759
|
ref: cellRef,
|
|
@@ -28617,47 +28775,40 @@ TableCell.displayName = "TableCell";
|
|
|
28617
28775
|
var TableCell_default = TableCell;
|
|
28618
28776
|
|
|
28619
28777
|
// src/components/Table/TableHead.tsx
|
|
28620
|
-
import { jsx as
|
|
28778
|
+
import { jsx as jsx341 } from "react/jsx-runtime";
|
|
28621
28779
|
var TableHead = ({
|
|
28622
28780
|
children,
|
|
28623
28781
|
className = "",
|
|
28624
28782
|
cellHover = false
|
|
28625
28783
|
}) => {
|
|
28626
28784
|
const { headerSticky } = useTableContext();
|
|
28627
|
-
return /* @__PURE__ */
|
|
28785
|
+
return /* @__PURE__ */ jsx341(TableHeadContext_default.Provider, { value: { cellHover }, children: /* @__PURE__ */ jsx341("thead", { className: clsx_default(headerSticky ? "table-sticky" : null, className), children }) });
|
|
28628
28786
|
};
|
|
28629
28787
|
TableHead.displayName = "TableHead";
|
|
28630
28788
|
var TableHead_default = TableHead;
|
|
28631
28789
|
|
|
28632
28790
|
// src/components/Table/TableRow.tsx
|
|
28633
|
-
import
|
|
28634
|
-
import { jsx as
|
|
28791
|
+
import React35 from "react";
|
|
28792
|
+
import { jsx as jsx342 } from "react/jsx-runtime";
|
|
28635
28793
|
var TableRow = (props) => {
|
|
28636
28794
|
const {
|
|
28637
28795
|
children,
|
|
28638
28796
|
className,
|
|
28639
|
-
|
|
28640
|
-
color: color2 = "black",
|
|
28641
|
-
colorDepth,
|
|
28642
|
-
colorToken,
|
|
28797
|
+
color: color2 = "xplat-neutral-900",
|
|
28643
28798
|
type = "secondary",
|
|
28644
28799
|
isHover,
|
|
28645
28800
|
onClick
|
|
28646
28801
|
} = props;
|
|
28647
28802
|
const { rowBorderUse } = useTableContext();
|
|
28648
|
-
const [stickyCells, setStickyCells] =
|
|
28803
|
+
const [stickyCells, setStickyCells] = React35.useState([]);
|
|
28649
28804
|
const registerStickyCell = (ref) => {
|
|
28650
28805
|
setStickyCells((prev) => {
|
|
28651
28806
|
if (prev.includes(ref)) return prev;
|
|
28652
28807
|
return [...prev, ref];
|
|
28653
28808
|
});
|
|
28654
28809
|
};
|
|
28655
|
-
const colorClass =
|
|
28656
|
-
|
|
28657
|
-
color2,
|
|
28658
|
-
colorDepth ?? 500
|
|
28659
|
-
);
|
|
28660
|
-
return /* @__PURE__ */ jsx341(TableRowContext_default.Provider, { value: { stickyCells, registerStickyCell }, children: /* @__PURE__ */ jsx341(
|
|
28810
|
+
const colorClass = color2;
|
|
28811
|
+
return /* @__PURE__ */ jsx342(TableRowContext_default.Provider, { value: { stickyCells, registerStickyCell }, children: /* @__PURE__ */ jsx342(
|
|
28661
28812
|
"tr",
|
|
28662
28813
|
{
|
|
28663
28814
|
className: clsx_default(
|
|
@@ -28677,38 +28828,31 @@ TableRow.displayName = "TableRow";
|
|
|
28677
28828
|
var TableRow_default = TableRow;
|
|
28678
28829
|
|
|
28679
28830
|
// src/components/Tag/Tag.tsx
|
|
28680
|
-
import { jsx as
|
|
28831
|
+
import { jsx as jsx343, jsxs as jsxs215 } from "react/jsx-runtime";
|
|
28681
28832
|
var Tag = (props) => {
|
|
28682
28833
|
const {
|
|
28683
28834
|
children,
|
|
28684
28835
|
onClose,
|
|
28685
28836
|
size: size4 = "md",
|
|
28686
|
-
|
|
28687
|
-
color: color2 = "neutral",
|
|
28688
|
-
colorDepth,
|
|
28689
|
-
colorToken,
|
|
28837
|
+
color: color2 = "xplat-neutral-500",
|
|
28690
28838
|
className
|
|
28691
28839
|
} = props;
|
|
28692
|
-
const colorClass =
|
|
28693
|
-
|
|
28694
|
-
|
|
28695
|
-
|
|
28696
|
-
);
|
|
28697
|
-
return /* @__PURE__ */ jsxs214("span", { className: clsx_default("lib-xplat-tag", size4, colorClass, className), children: [
|
|
28698
|
-
/* @__PURE__ */ jsx342("span", { className: "tag-label", children }),
|
|
28699
|
-
onClose && /* @__PURE__ */ jsx342("button", { className: "tag-close", onClick: onClose, "aria-label": "\uC0AD\uC81C", children: /* @__PURE__ */ jsx342(XIcon_default, {}) })
|
|
28840
|
+
const colorClass = color2;
|
|
28841
|
+
return /* @__PURE__ */ jsxs215("span", { className: clsx_default("lib-xplat-tag", size4, colorClass, className), children: [
|
|
28842
|
+
/* @__PURE__ */ jsx343("span", { className: "tag-label", children }),
|
|
28843
|
+
onClose && /* @__PURE__ */ jsx343("button", { className: "tag-close", onClick: onClose, "aria-label": "\uC0AD\uC81C", children: /* @__PURE__ */ jsx343(XIcon_default, {}) })
|
|
28700
28844
|
] });
|
|
28701
28845
|
};
|
|
28702
28846
|
Tag.displayName = "Tag";
|
|
28703
28847
|
var Tag_default = Tag;
|
|
28704
28848
|
|
|
28705
28849
|
// src/components/TextArea/TextArea.tsx
|
|
28706
|
-
import
|
|
28707
|
-
import { jsx as
|
|
28708
|
-
var TextArea =
|
|
28850
|
+
import React36 from "react";
|
|
28851
|
+
import { jsx as jsx344 } from "react/jsx-runtime";
|
|
28852
|
+
var TextArea = React36.forwardRef(
|
|
28709
28853
|
(props, ref) => {
|
|
28710
28854
|
const { value, onChange, className, disabled, ...textareaProps } = props;
|
|
28711
|
-
const localRef =
|
|
28855
|
+
const localRef = React36.useRef(null);
|
|
28712
28856
|
const setRefs = (el) => {
|
|
28713
28857
|
localRef.current = el;
|
|
28714
28858
|
if (!ref) return;
|
|
@@ -28728,21 +28872,21 @@ var TextArea = React35.forwardRef(
|
|
|
28728
28872
|
onChange(event);
|
|
28729
28873
|
}
|
|
28730
28874
|
};
|
|
28731
|
-
|
|
28875
|
+
React36.useEffect(() => {
|
|
28732
28876
|
const el = localRef.current;
|
|
28733
28877
|
if (!el) return;
|
|
28734
28878
|
el.style.height = "0px";
|
|
28735
28879
|
const nextHeight = Math.min(el.scrollHeight, 400);
|
|
28736
28880
|
el.style.height = `${nextHeight}px`;
|
|
28737
28881
|
}, [value]);
|
|
28738
|
-
return /* @__PURE__ */
|
|
28882
|
+
return /* @__PURE__ */ jsx344("div", { className: clsx_default("lib-xplat-textarea-wrapper", className), children: /* @__PURE__ */ jsx344(
|
|
28739
28883
|
"div",
|
|
28740
28884
|
{
|
|
28741
28885
|
className: clsx_default(
|
|
28742
28886
|
"lib-xplat-textarea",
|
|
28743
28887
|
disabled ? "disabled" : void 0
|
|
28744
28888
|
),
|
|
28745
|
-
children: /* @__PURE__ */
|
|
28889
|
+
children: /* @__PURE__ */ jsx344(
|
|
28746
28890
|
"textarea",
|
|
28747
28891
|
{
|
|
28748
28892
|
...textareaProps,
|
|
@@ -28760,25 +28904,25 @@ TextArea.displayName = "TextArea";
|
|
|
28760
28904
|
var TextArea_default = TextArea;
|
|
28761
28905
|
|
|
28762
28906
|
// src/components/Toast/Toast.tsx
|
|
28763
|
-
import
|
|
28907
|
+
import React37 from "react";
|
|
28764
28908
|
import { createPortal as createPortal4 } from "react-dom";
|
|
28765
|
-
import { jsx as
|
|
28766
|
-
var ToastContext =
|
|
28909
|
+
import { jsx as jsx345, jsxs as jsxs216 } from "react/jsx-runtime";
|
|
28910
|
+
var ToastContext = React37.createContext(null);
|
|
28767
28911
|
var useToast = () => {
|
|
28768
|
-
const ctx =
|
|
28912
|
+
const ctx = React37.useContext(ToastContext);
|
|
28769
28913
|
if (!ctx) throw new Error("useToast must be used within ToastProvider");
|
|
28770
28914
|
return ctx;
|
|
28771
28915
|
};
|
|
28772
28916
|
var EXIT_DURATION = 300;
|
|
28773
28917
|
var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
28774
|
-
const ref =
|
|
28775
|
-
const [height, setHeight] =
|
|
28776
|
-
|
|
28918
|
+
const ref = React37.useRef(null);
|
|
28919
|
+
const [height, setHeight] = React37.useState(void 0);
|
|
28920
|
+
React37.useEffect(() => {
|
|
28777
28921
|
if (ref.current && !isExiting) {
|
|
28778
28922
|
setHeight(ref.current.offsetHeight);
|
|
28779
28923
|
}
|
|
28780
28924
|
}, [isExiting]);
|
|
28781
|
-
return /* @__PURE__ */
|
|
28925
|
+
return /* @__PURE__ */ jsx345(
|
|
28782
28926
|
"div",
|
|
28783
28927
|
{
|
|
28784
28928
|
className: clsx_default("lib-xplat-toast-wrapper", { exit: isExiting }),
|
|
@@ -28786,15 +28930,15 @@ var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
|
28786
28930
|
maxHeight: isExiting ? 0 : height ?? "none",
|
|
28787
28931
|
marginBottom: isExiting ? 0 : void 0
|
|
28788
28932
|
},
|
|
28789
|
-
children: /* @__PURE__ */
|
|
28933
|
+
children: /* @__PURE__ */ jsxs216(
|
|
28790
28934
|
"div",
|
|
28791
28935
|
{
|
|
28792
28936
|
ref,
|
|
28793
28937
|
className: clsx_default("lib-xplat-toast", item.type, { exit: isExiting }),
|
|
28794
28938
|
role: "alert",
|
|
28795
28939
|
children: [
|
|
28796
|
-
/* @__PURE__ */
|
|
28797
|
-
/* @__PURE__ */
|
|
28940
|
+
/* @__PURE__ */ jsx345("span", { className: "message", children: item.message }),
|
|
28941
|
+
/* @__PURE__ */ jsx345("button", { className: "close-btn", onClick: onClose, "aria-label": "\uB2EB\uAE30", children: "\xD7" })
|
|
28798
28942
|
]
|
|
28799
28943
|
}
|
|
28800
28944
|
)
|
|
@@ -28805,13 +28949,13 @@ var ToastProvider = ({
|
|
|
28805
28949
|
children,
|
|
28806
28950
|
position = "top-right"
|
|
28807
28951
|
}) => {
|
|
28808
|
-
const [toasts, setToasts] =
|
|
28809
|
-
const [removing, setRemoving] =
|
|
28810
|
-
const [mounted, setMounted] =
|
|
28811
|
-
|
|
28952
|
+
const [toasts, setToasts] = React37.useState([]);
|
|
28953
|
+
const [removing, setRemoving] = React37.useState(/* @__PURE__ */ new Set());
|
|
28954
|
+
const [mounted, setMounted] = React37.useState(false);
|
|
28955
|
+
React37.useEffect(() => {
|
|
28812
28956
|
setMounted(true);
|
|
28813
28957
|
}, []);
|
|
28814
|
-
const remove =
|
|
28958
|
+
const remove = React37.useCallback((id) => {
|
|
28815
28959
|
setRemoving((prev) => new Set(prev).add(id));
|
|
28816
28960
|
setTimeout(() => {
|
|
28817
28961
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
@@ -28822,7 +28966,7 @@ var ToastProvider = ({
|
|
|
28822
28966
|
});
|
|
28823
28967
|
}, EXIT_DURATION);
|
|
28824
28968
|
}, []);
|
|
28825
|
-
const toast =
|
|
28969
|
+
const toast = React37.useCallback(
|
|
28826
28970
|
(type, message2, duration = 3e3) => {
|
|
28827
28971
|
const id = `${Date.now()}-${Math.random()}`;
|
|
28828
28972
|
setToasts((prev) => [...prev, { id, type, message: message2 }]);
|
|
@@ -28832,10 +28976,10 @@ var ToastProvider = ({
|
|
|
28832
28976
|
},
|
|
28833
28977
|
[remove]
|
|
28834
28978
|
);
|
|
28835
|
-
return /* @__PURE__ */
|
|
28979
|
+
return /* @__PURE__ */ jsxs216(ToastContext.Provider, { value: { toast }, children: [
|
|
28836
28980
|
children,
|
|
28837
28981
|
mounted && createPortal4(
|
|
28838
|
-
/* @__PURE__ */
|
|
28982
|
+
/* @__PURE__ */ jsx345("div", { className: clsx_default("lib-xplat-toast-container", position), children: toasts.map((t) => /* @__PURE__ */ jsx345(
|
|
28839
28983
|
ToastItemComponent,
|
|
28840
28984
|
{
|
|
28841
28985
|
item: t,
|
|
@@ -28851,36 +28995,29 @@ var ToastProvider = ({
|
|
|
28851
28995
|
ToastProvider.displayName = "ToastProvider";
|
|
28852
28996
|
|
|
28853
28997
|
// src/components/Tooltip/Tooltip.tsx
|
|
28854
|
-
import
|
|
28855
|
-
import { jsx as
|
|
28998
|
+
import React38 from "react";
|
|
28999
|
+
import { jsx as jsx346, jsxs as jsxs217 } from "react/jsx-runtime";
|
|
28856
29000
|
var Tooltip2 = (props) => {
|
|
28857
29001
|
const {
|
|
28858
29002
|
type = "primary",
|
|
28859
|
-
|
|
28860
|
-
color: color2 = "blue",
|
|
28861
|
-
colorDepth,
|
|
28862
|
-
colorToken,
|
|
29003
|
+
color: color2 = "xplat-neutral-900",
|
|
28863
29004
|
description,
|
|
28864
29005
|
children
|
|
28865
29006
|
} = props;
|
|
28866
|
-
const iconRef =
|
|
28867
|
-
const colorClass =
|
|
28868
|
-
|
|
28869
|
-
|
|
28870
|
-
|
|
28871
|
-
);
|
|
28872
|
-
return /* @__PURE__ */ jsxs216("div", { className: "lib-xplat-tooltip", children: [
|
|
28873
|
-
/* @__PURE__ */ jsx345("div", { className: "tooltip-content", ref: iconRef, children: children || "Tooltip" }),
|
|
28874
|
-
/* @__PURE__ */ jsx345("div", { className: clsx_default("tooltip-wrapper", colorClass, type), children: description })
|
|
29007
|
+
const iconRef = React38.useRef(null);
|
|
29008
|
+
const colorClass = color2;
|
|
29009
|
+
return /* @__PURE__ */ jsxs217("div", { className: "lib-xplat-tooltip", children: [
|
|
29010
|
+
/* @__PURE__ */ jsx346("div", { className: "tooltip-content", ref: iconRef, children: children || "Tooltip" }),
|
|
29011
|
+
/* @__PURE__ */ jsx346("div", { className: clsx_default("tooltip-wrapper", colorClass, type), children: description })
|
|
28875
29012
|
] });
|
|
28876
29013
|
};
|
|
28877
29014
|
Tooltip2.displayName = "Tooltip";
|
|
28878
29015
|
var Tooltip_default = Tooltip2;
|
|
28879
29016
|
|
|
28880
29017
|
// src/components/Video/Video.tsx
|
|
28881
|
-
import
|
|
28882
|
-
import { jsx as
|
|
28883
|
-
var Video =
|
|
29018
|
+
import React39 from "react";
|
|
29019
|
+
import { jsx as jsx347, jsxs as jsxs218 } from "react/jsx-runtime";
|
|
29020
|
+
var Video = React39.forwardRef((props, ref) => {
|
|
28884
29021
|
const {
|
|
28885
29022
|
src,
|
|
28886
29023
|
poster,
|
|
@@ -28894,10 +29031,10 @@ var Video = React38.forwardRef((props, ref) => {
|
|
|
28894
29031
|
onPause,
|
|
28895
29032
|
...rest
|
|
28896
29033
|
} = props;
|
|
28897
|
-
const videoRef =
|
|
28898
|
-
const [isPlaying, setIsPlaying] =
|
|
28899
|
-
const [isLoaded, setIsLoaded] =
|
|
28900
|
-
const setRefs =
|
|
29034
|
+
const videoRef = React39.useRef(null);
|
|
29035
|
+
const [isPlaying, setIsPlaying] = React39.useState(Boolean(autoPlay));
|
|
29036
|
+
const [isLoaded, setIsLoaded] = React39.useState(false);
|
|
29037
|
+
const setRefs = React39.useCallback(
|
|
28901
29038
|
(el) => {
|
|
28902
29039
|
videoRef.current = el;
|
|
28903
29040
|
if (typeof ref === "function") ref(el);
|
|
@@ -28925,7 +29062,7 @@ var Video = React38.forwardRef((props, ref) => {
|
|
|
28925
29062
|
}
|
|
28926
29063
|
};
|
|
28927
29064
|
const showCustomOverlay = !controls;
|
|
28928
|
-
return /* @__PURE__ */
|
|
29065
|
+
return /* @__PURE__ */ jsxs218(
|
|
28929
29066
|
"div",
|
|
28930
29067
|
{
|
|
28931
29068
|
className: clsx_default(
|
|
@@ -28934,7 +29071,7 @@ var Video = React38.forwardRef((props, ref) => {
|
|
|
28934
29071
|
className
|
|
28935
29072
|
),
|
|
28936
29073
|
children: [
|
|
28937
|
-
/* @__PURE__ */
|
|
29074
|
+
/* @__PURE__ */ jsx347(
|
|
28938
29075
|
"video",
|
|
28939
29076
|
{
|
|
28940
29077
|
ref: setRefs,
|
|
@@ -28951,7 +29088,7 @@ var Video = React38.forwardRef((props, ref) => {
|
|
|
28951
29088
|
...rest
|
|
28952
29089
|
}
|
|
28953
29090
|
),
|
|
28954
|
-
showCustomOverlay && /* @__PURE__ */
|
|
29091
|
+
showCustomOverlay && /* @__PURE__ */ jsx347(
|
|
28955
29092
|
"button",
|
|
28956
29093
|
{
|
|
28957
29094
|
type: "button",
|
|
@@ -28962,7 +29099,7 @@ var Video = React38.forwardRef((props, ref) => {
|
|
|
28962
29099
|
),
|
|
28963
29100
|
onClick: togglePlay,
|
|
28964
29101
|
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
28965
|
-
children: isPlaying ? /* @__PURE__ */
|
|
29102
|
+
children: isPlaying ? /* @__PURE__ */ jsx347(PauseIcon_default, {}) : /* @__PURE__ */ jsx347("span", { className: "play-icon", children: /* @__PURE__ */ jsx347(PlayCircleIcon_default, {}) })
|
|
28966
29103
|
}
|
|
28967
29104
|
)
|
|
28968
29105
|
]
|
|
@@ -29007,6 +29144,7 @@ export {
|
|
|
29007
29144
|
Skeleton_default as Skeleton,
|
|
29008
29145
|
Spinner_default as Spinner,
|
|
29009
29146
|
Steps_default as Steps,
|
|
29147
|
+
Swiper_default as Swiper,
|
|
29010
29148
|
Switch_default as Switch,
|
|
29011
29149
|
Tab_default as Tab,
|
|
29012
29150
|
Table_default as Table,
|