@bestow-ui/react 1.5.0 → 1.6.0
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/README.md +9 -3
- package/dist/{chunk-VQ45DNC3.js → chunk-NKLDAXUR.js} +2 -77
- package/dist/chunk-NKLDAXUR.js.map +1 -0
- package/dist/client.js +345 -194
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +381 -288
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +77 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +40 -45
- package/dist/index.d.ts +40 -45
- package/dist/shared.js +10 -6
- package/dist/shared.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-VQ45DNC3.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -76,6 +76,7 @@ __export(src_exports, {
|
|
|
76
76
|
LocaleProvider: () => LocaleProvider,
|
|
77
77
|
Modal: () => Modal,
|
|
78
78
|
ModalClose: () => ModalClose,
|
|
79
|
+
NativeSelect: () => NativeSelect,
|
|
79
80
|
NumberInput: () => NumberInput,
|
|
80
81
|
Pagination: () => Pagination,
|
|
81
82
|
PhoneNumberInput: () => PhoneNumberInput,
|
|
@@ -113,19 +114,19 @@ __export(src_exports, {
|
|
|
113
114
|
Typography: () => Typography,
|
|
114
115
|
VerificationCodeInput: () => VerificationCodeInput,
|
|
115
116
|
VisuallyHidden: () => VisuallyHidden,
|
|
116
|
-
composeExtraAddress: () => composeExtraAddress,
|
|
117
|
+
composeExtraAddress: () => import_korean_utils.composeExtraAddress,
|
|
117
118
|
contrastRatio: () => contrastRatio,
|
|
118
119
|
createIntentColors: () => createIntentColors,
|
|
119
120
|
createTheme: () => createTheme,
|
|
120
121
|
dateRangePresets: () => dateRangePresets,
|
|
121
122
|
en: () => en,
|
|
122
123
|
focusField: () => focusField,
|
|
123
|
-
formatBusinessNumber: () => formatBusinessNumber,
|
|
124
|
-
formatKoreanAmount: () => formatKoreanAmount,
|
|
125
|
-
formatKoreanDate: () => formatKoreanDate,
|
|
126
|
-
formatPhoneNumber: () => formatPhoneNumber,
|
|
124
|
+
formatBusinessNumber: () => import_korean_utils2.formatBusinessNumber,
|
|
125
|
+
formatKoreanAmount: () => import_korean_utils2.formatKoreanAmount,
|
|
126
|
+
formatKoreanDate: () => import_korean_utils2.formatKoreanDate,
|
|
127
|
+
formatPhoneNumber: () => import_korean_utils2.formatPhoneNumber,
|
|
127
128
|
hasAllRequiredAgreements: () => hasAllRequiredAgreements,
|
|
128
|
-
isValidBusinessNumber: () => isValidBusinessNumber,
|
|
129
|
+
isValidBusinessNumber: () => import_korean_utils2.isValidBusinessNumber,
|
|
129
130
|
kakaoPostcodeProvider: () => kakaoPostcodeProvider,
|
|
130
131
|
parseISODate: () => parseISODate,
|
|
131
132
|
presetRange: () => presetRange,
|
|
@@ -423,62 +424,8 @@ var en = {
|
|
|
423
424
|
dateIncomplete: "Enter the date as YYYY-MM-DD."
|
|
424
425
|
};
|
|
425
426
|
|
|
426
|
-
// src/
|
|
427
|
-
var
|
|
428
|
-
function phoneNumberMaxDigits(digits) {
|
|
429
|
-
if (digits.startsWith("02")) return 10;
|
|
430
|
-
if (/^1[568]/.test(digits)) return 8;
|
|
431
|
-
return 11;
|
|
432
|
-
}
|
|
433
|
-
function formatPhoneNumber(input6) {
|
|
434
|
-
const d = onlyDigits(input6).slice(0, phoneNumberMaxDigits(onlyDigits(input6)));
|
|
435
|
-
if (d.startsWith("02")) {
|
|
436
|
-
if (d.length <= 2) return d;
|
|
437
|
-
if (d.length <= 5) return `${d.slice(0, 2)}-${d.slice(2)}`;
|
|
438
|
-
if (d.length <= 9) return `${d.slice(0, 2)}-${d.slice(2, 5)}-${d.slice(5)}`;
|
|
439
|
-
return `${d.slice(0, 2)}-${d.slice(2, 6)}-${d.slice(6)}`;
|
|
440
|
-
}
|
|
441
|
-
if (/^1[568]/.test(d)) {
|
|
442
|
-
return d.length <= 4 ? d : `${d.slice(0, 4)}-${d.slice(4)}`;
|
|
443
|
-
}
|
|
444
|
-
if (d.length <= 3) return d;
|
|
445
|
-
if (d.length <= 6) return `${d.slice(0, 3)}-${d.slice(3)}`;
|
|
446
|
-
if (d.length <= 10) return `${d.slice(0, 3)}-${d.slice(3, 6)}-${d.slice(6)}`;
|
|
447
|
-
return `${d.slice(0, 3)}-${d.slice(3, 7)}-${d.slice(7)}`;
|
|
448
|
-
}
|
|
449
|
-
function formatBusinessNumber(input6) {
|
|
450
|
-
const d = onlyDigits(input6).slice(0, 10);
|
|
451
|
-
if (d.length <= 3) return d;
|
|
452
|
-
if (d.length <= 5) return `${d.slice(0, 3)}-${d.slice(3)}`;
|
|
453
|
-
return `${d.slice(0, 3)}-${d.slice(3, 5)}-${d.slice(5)}`;
|
|
454
|
-
}
|
|
455
|
-
function isValidBusinessNumber(input6) {
|
|
456
|
-
const d = onlyDigits(input6);
|
|
457
|
-
if (d.length !== 10) return false;
|
|
458
|
-
const weights = [1, 3, 7, 1, 3, 7, 1, 3, 5];
|
|
459
|
-
const digits = [...d].map(Number);
|
|
460
|
-
let sum = weights.reduce((acc, w, i) => acc + w * digits[i], 0);
|
|
461
|
-
sum += Math.floor(digits[8] * 5 / 10);
|
|
462
|
-
return (10 - sum % 10) % 10 === digits[9];
|
|
463
|
-
}
|
|
464
|
-
function formatKoreanAmount(amount, unit2 = "\uC6D0") {
|
|
465
|
-
const n = Math.floor(Math.abs(amount));
|
|
466
|
-
if (n === 0) return `0${unit2}`;
|
|
467
|
-
const units = [
|
|
468
|
-
{ value: 1e12, label: "\uC870" },
|
|
469
|
-
{ value: 1e8, label: "\uC5B5" },
|
|
470
|
-
{ value: 1e4, label: "\uB9CC" },
|
|
471
|
-
{ value: 1, label: "" }
|
|
472
|
-
];
|
|
473
|
-
let rest = n;
|
|
474
|
-
const parts = [];
|
|
475
|
-
for (const u of units) {
|
|
476
|
-
const q = Math.floor(rest / u.value);
|
|
477
|
-
rest %= u.value;
|
|
478
|
-
if (q > 0) parts.push(`${q.toLocaleString("ko-KR")}${u.label}`);
|
|
479
|
-
}
|
|
480
|
-
return `${amount < 0 ? "-" : ""}${parts.join(" ")}${unit2}`;
|
|
481
|
-
}
|
|
427
|
+
// src/shared.ts
|
|
428
|
+
var import_korean_utils2 = require("@bestow-ui/korean-utils");
|
|
482
429
|
|
|
483
430
|
// src/utils/date.ts
|
|
484
431
|
var pad = (n) => String(n).padStart(2, "0");
|
|
@@ -516,13 +463,9 @@ function getCalendarWeeks(year, month) {
|
|
|
516
463
|
const start = addDays(first, -first.getDay());
|
|
517
464
|
return Array.from({ length: 6 }, (_, week) => Array.from({ length: 7 }, (_2, day2) => addDays(start, week * 7 + day2)));
|
|
518
465
|
}
|
|
519
|
-
var KOREAN_WEEKDAYS = ["\uC77C", "\uC6D4", "\uD654", "\uC218", "\uBAA9", "\uAE08", "\uD1A0"];
|
|
520
|
-
function formatKoreanDate(date, withWeekday = true) {
|
|
521
|
-
const base = `${date.getFullYear()}\uB144 ${date.getMonth() + 1}\uC6D4 ${date.getDate()}\uC77C`;
|
|
522
|
-
return withWeekday ? `${base} ${KOREAN_WEEKDAYS[date.getDay()]}\uC694\uC77C` : base;
|
|
523
|
-
}
|
|
524
466
|
|
|
525
467
|
// src/components/AddressInput/addressProviders.ts
|
|
468
|
+
var import_korean_utils = require("@bestow-ui/korean-utils");
|
|
526
469
|
var KAKAO_POSTCODE_SRC = "https://t1.kakaocdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js";
|
|
527
470
|
var loading = null;
|
|
528
471
|
function loadKakaoPostcode() {
|
|
@@ -546,13 +489,6 @@ function loadKakaoPostcode() {
|
|
|
546
489
|
}));
|
|
547
490
|
return loading;
|
|
548
491
|
}
|
|
549
|
-
function composeExtraAddress(data) {
|
|
550
|
-
if (data.userSelectedType !== "R") return "";
|
|
551
|
-
const parts = [];
|
|
552
|
-
if (data.bname && /[동로가]$/.test(data.bname)) parts.push(data.bname);
|
|
553
|
-
if (data.buildingName && data.apartment === "Y") parts.push(data.buildingName);
|
|
554
|
-
return parts.length ? ` (${parts.join(", ")})` : "";
|
|
555
|
-
}
|
|
556
492
|
var kakaoPostcodeProvider = async (container2, onSelect) => {
|
|
557
493
|
const Postcode = await loadKakaoPostcode();
|
|
558
494
|
new Postcode({
|
|
@@ -560,7 +496,7 @@ var kakaoPostcodeProvider = async (container2, onSelect) => {
|
|
|
560
496
|
height: "100%",
|
|
561
497
|
oncomplete: (data) => {
|
|
562
498
|
const address = data.userSelectedType === "R" ? data.roadAddress : data.jibunAddress || data.autoJibunAddress || "";
|
|
563
|
-
onSelect({ zonecode: data.zonecode, address, extraAddress: composeExtraAddress(data) });
|
|
499
|
+
onSelect({ zonecode: data.zonecode, address, extraAddress: (0, import_korean_utils.composeExtraAddress)(data) });
|
|
564
500
|
}
|
|
565
501
|
}).embed(container2);
|
|
566
502
|
};
|
|
@@ -1582,7 +1518,7 @@ var Alert = /* @__PURE__ */ (0, import_react21.forwardRef)(function Alert2({
|
|
|
1582
1518
|
variant,
|
|
1583
1519
|
color = "primary",
|
|
1584
1520
|
title: title6,
|
|
1585
|
-
icon:
|
|
1521
|
+
icon: icon8,
|
|
1586
1522
|
action: action3,
|
|
1587
1523
|
onClose,
|
|
1588
1524
|
closeLabel: closeLabelProp,
|
|
@@ -1593,7 +1529,7 @@ var Alert = /* @__PURE__ */ (0, import_react21.forwardRef)(function Alert2({
|
|
|
1593
1529
|
const m = useMessages();
|
|
1594
1530
|
const closeLabel = closeLabelProp ?? m.close ?? "\uB2EB\uAE30";
|
|
1595
1531
|
const DefaultIcon = defaultIcons[color];
|
|
1596
|
-
const iconNode =
|
|
1532
|
+
const iconNode = icon8 === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DefaultIcon, { size: 18 }) : icon8;
|
|
1597
1533
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { ref, className: cx(alert({ variant, color }), className), ...rest, children: [
|
|
1598
1534
|
iconNode !== false && iconNode !== null && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: icon3, "aria-hidden": true, children: iconNode }),
|
|
1599
1535
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: content4, children: [
|
|
@@ -1607,6 +1543,7 @@ var Alert = /* @__PURE__ */ (0, import_react21.forwardRef)(function Alert2({
|
|
|
1607
1543
|
|
|
1608
1544
|
// src/components/AmountInput/AmountInput.tsx
|
|
1609
1545
|
var import_react24 = require("react");
|
|
1546
|
+
var import_korean_utils3 = require("@bestow-ui/korean-utils");
|
|
1610
1547
|
|
|
1611
1548
|
// src/utils/useFormattedInput.ts
|
|
1612
1549
|
var import_react23 = require("react");
|
|
@@ -1721,7 +1658,7 @@ var AmountInput = /* @__PURE__ */ (0, import_react24.forwardRef)(
|
|
|
1721
1658
|
isMeaningful: isDigit,
|
|
1722
1659
|
inputRef
|
|
1723
1660
|
});
|
|
1724
|
-
const reading = showKoreanAmount && field4.raw !== "" ? formatKoreanAmount(Number(field4.raw), unit2) : null;
|
|
1661
|
+
const reading = showKoreanAmount && field4.raw !== "" ? (0, import_korean_utils3.formatKoreanAmount)(Number(field4.raw), unit2) : null;
|
|
1725
1662
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1726
1663
|
TextField,
|
|
1727
1664
|
{
|
|
@@ -1858,6 +1795,7 @@ var Breadcrumb = /* @__PURE__ */ (0, import_react27.forwardRef)(function Breadcr
|
|
|
1858
1795
|
|
|
1859
1796
|
// src/components/BusinessNumberInput/BusinessNumberInput.tsx
|
|
1860
1797
|
var import_react28 = require("react");
|
|
1798
|
+
var import_korean_utils4 = require("@bestow-ui/korean-utils");
|
|
1861
1799
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1862
1800
|
var sanitize = (input6) => input6.replace(/\D/g, "").slice(0, 10);
|
|
1863
1801
|
var isDigit2 = (char) => /\d/.test(char);
|
|
@@ -1887,14 +1825,14 @@ var BusinessNumberInput = /* @__PURE__ */ (0, import_react28.forwardRef)(
|
|
|
1887
1825
|
isControlled: "value" in props,
|
|
1888
1826
|
value: value4,
|
|
1889
1827
|
defaultValue,
|
|
1890
|
-
onValueChange: (digits) => onValueChange?.(digits, digits.length === 10 ? isValidBusinessNumber(digits) : null),
|
|
1828
|
+
onValueChange: (digits) => onValueChange?.(digits, digits.length === 10 ? (0, import_korean_utils4.isValidBusinessNumber)(digits) : null),
|
|
1891
1829
|
sanitize,
|
|
1892
|
-
format: formatBusinessNumber,
|
|
1830
|
+
format: import_korean_utils4.formatBusinessNumber,
|
|
1893
1831
|
isMeaningful: isDigit2,
|
|
1894
1832
|
inputRef
|
|
1895
1833
|
});
|
|
1896
1834
|
const complete = field4.raw.length === 10;
|
|
1897
|
-
const autoInvalid = validate && field4.raw.length > 0 && (complete ? !isValidBusinessNumber(field4.raw) : touched);
|
|
1835
|
+
const autoInvalid = validate && field4.raw.length > 0 && (complete ? !(0, import_korean_utils4.isValidBusinessNumber)(field4.raw) : touched);
|
|
1898
1836
|
const showAuto = autoInvalid && error === void 0;
|
|
1899
1837
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1900
1838
|
TextField,
|
|
@@ -1924,6 +1862,7 @@ var BusinessNumberInput = /* @__PURE__ */ (0, import_react28.forwardRef)(
|
|
|
1924
1862
|
// src/components/Calendar/Calendar.tsx
|
|
1925
1863
|
var import_react31 = require("react");
|
|
1926
1864
|
var import_icons9 = require("@bestow-ui/icons");
|
|
1865
|
+
var import_korean_utils5 = require("@bestow-ui/korean-utils");
|
|
1927
1866
|
|
|
1928
1867
|
// src/utils/useIsClient.ts
|
|
1929
1868
|
var import_react29 = require("react");
|
|
@@ -1991,8 +1930,8 @@ var Calendar = /* @__PURE__ */ (0, import_react31.forwardRef)(function Calendar2
|
|
|
1991
1930
|
const m = useMessages();
|
|
1992
1931
|
const prevMonthLabel = prevMonthLabelProp ?? m.previousMonth ?? "\uC774\uC804 \uB2EC";
|
|
1993
1932
|
const nextMonthLabel = nextMonthLabelProp ?? m.nextMonth ?? "\uB2E4\uC74C \uB2EC";
|
|
1994
|
-
const weekdaysShort = m.weekdaysShort ?? KOREAN_WEEKDAYS;
|
|
1995
|
-
const weekdaysLong = m.weekdaysLong ?? KOREAN_WEEKDAYS.map((name) => `${name}\uC694\uC77C`);
|
|
1933
|
+
const weekdaysShort = m.weekdaysShort ?? import_korean_utils5.KOREAN_WEEKDAYS;
|
|
1934
|
+
const weekdaysLong = m.weekdaysLong ?? import_korean_utils5.KOREAN_WEEKDAYS.map((name) => `${name}\uC694\uC77C`);
|
|
1996
1935
|
const headingId = (0, import_react31.useId)();
|
|
1997
1936
|
const gridRef = (0, import_react31.useRef)(null);
|
|
1998
1937
|
const isControlled = "value" in props;
|
|
@@ -2026,7 +1965,7 @@ var Calendar = /* @__PURE__ */ (0, import_react31.forwardRef)(function Calendar2
|
|
|
2026
1965
|
moveFocus.current = true;
|
|
2027
1966
|
setFocused(clamp(date));
|
|
2028
1967
|
};
|
|
2029
|
-
const
|
|
1968
|
+
const select2 = (date) => {
|
|
2030
1969
|
if (isDisabled(date)) return;
|
|
2031
1970
|
const iso = toISODate(date);
|
|
2032
1971
|
if (!isControlled) setInnerValue(iso);
|
|
@@ -2109,7 +2048,7 @@ var Calendar = /* @__PURE__ */ (0, import_react31.forwardRef)(function Calendar2
|
|
|
2109
2048
|
"aria-label": label7,
|
|
2110
2049
|
"aria-current": isToday ? "date" : void 0,
|
|
2111
2050
|
"aria-disabled": disabled || void 0,
|
|
2112
|
-
onClick: () =>
|
|
2051
|
+
onClick: () => select2(date),
|
|
2113
2052
|
onFocus: () => !isSameDay(date, focused) && setFocused(date),
|
|
2114
2053
|
children: date.getDate()
|
|
2115
2054
|
}
|
|
@@ -2213,7 +2152,7 @@ var Combobox = /* @__PURE__ */ (0, import_react32.forwardRef)(function Combobox2
|
|
|
2213
2152
|
if (query === "" && selectedValue) clearSelection();
|
|
2214
2153
|
reset();
|
|
2215
2154
|
};
|
|
2216
|
-
const
|
|
2155
|
+
const select2 = (option2) => {
|
|
2217
2156
|
if (option2.disabled) return;
|
|
2218
2157
|
if (!isControlled) setInnerValue(option2.value);
|
|
2219
2158
|
if (option2.value !== selectedValue) onValueChange?.(option2.value);
|
|
@@ -2247,7 +2186,7 @@ var Combobox = /* @__PURE__ */ (0, import_react32.forwardRef)(function Combobox2
|
|
|
2247
2186
|
if (open) {
|
|
2248
2187
|
event.preventDefault();
|
|
2249
2188
|
const option2 = filtered[activeIndex];
|
|
2250
|
-
if (option2)
|
|
2189
|
+
if (option2) select2(option2);
|
|
2251
2190
|
else close2();
|
|
2252
2191
|
}
|
|
2253
2192
|
break;
|
|
@@ -2393,7 +2332,7 @@ var Combobox = /* @__PURE__ */ (0, import_react32.forwardRef)(function Combobox2
|
|
|
2393
2332
|
className: item5,
|
|
2394
2333
|
onMouseDown: (event) => event.preventDefault(),
|
|
2395
2334
|
onMouseMove: () => !option2.disabled && setActiveIndex(index),
|
|
2396
|
-
onClick: () =>
|
|
2335
|
+
onClick: () => select2(option2),
|
|
2397
2336
|
children: [
|
|
2398
2337
|
option2.label,
|
|
2399
2338
|
isSelected && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: itemIndicator, "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_icons10.CheckIcon, { size: 16 }) })
|
|
@@ -3130,9 +3069,9 @@ var DropdownMenuContent = /* @__PURE__ */ (0, import_react38.forwardRef)(
|
|
|
3130
3069
|
}
|
|
3131
3070
|
);
|
|
3132
3071
|
var DropdownMenuItem = /* @__PURE__ */ (0, import_react38.forwardRef)(
|
|
3133
|
-
function DropdownMenuItem2({ icon:
|
|
3072
|
+
function DropdownMenuItem2({ icon: icon8, shortcut: shortcut2, color = "neutral", className, children, ...rest }, ref) {
|
|
3134
3073
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(RadixMenu.Item, { ref, className: cx(item7, color === "danger" && danger, className), ...rest, children: [
|
|
3135
|
-
|
|
3074
|
+
icon8 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: icon5, "aria-hidden": true, children: icon8 }),
|
|
3136
3075
|
children,
|
|
3137
3076
|
shortcut2 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: shortcut, "aria-hidden": true, children: shortcut2 })
|
|
3138
3077
|
] });
|
|
@@ -3167,9 +3106,9 @@ var DropdownMenuRadioItem = /* @__PURE__ */ (0, import_react38.forwardRef)(
|
|
|
3167
3106
|
);
|
|
3168
3107
|
var DropdownMenuSub = RadixMenu.Sub;
|
|
3169
3108
|
var DropdownMenuSubTrigger = /* @__PURE__ */ (0, import_react38.forwardRef)(
|
|
3170
|
-
function DropdownMenuSubTrigger2({ icon:
|
|
3109
|
+
function DropdownMenuSubTrigger2({ icon: icon8, className, children, ...rest }, ref) {
|
|
3171
3110
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(RadixMenu.SubTrigger, { ref, className: cx(item7, subTrigger, className), ...rest, children: [
|
|
3172
|
-
|
|
3111
|
+
icon8 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: icon5, "aria-hidden": true, children: icon8 }),
|
|
3173
3112
|
children,
|
|
3174
3113
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: subChevron, "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_icons15.ChevronRightIcon, { size: 16 }) })
|
|
3175
3114
|
] });
|
|
@@ -3475,10 +3414,11 @@ var Pagination = /* @__PURE__ */ (0, import_react40.forwardRef)(function Paginat
|
|
|
3475
3414
|
|
|
3476
3415
|
// src/components/PhoneNumberInput/PhoneNumberInput.tsx
|
|
3477
3416
|
var import_react41 = require("react");
|
|
3417
|
+
var import_korean_utils6 = require("@bestow-ui/korean-utils");
|
|
3478
3418
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3479
3419
|
var sanitize3 = (input6) => {
|
|
3480
3420
|
const digits = input6.replace(/\D/g, "");
|
|
3481
|
-
return digits.slice(0, phoneNumberMaxDigits(digits));
|
|
3421
|
+
return digits.slice(0, (0, import_korean_utils6.phoneNumberMaxDigits)(digits));
|
|
3482
3422
|
};
|
|
3483
3423
|
var isDigit4 = (char) => /\d/.test(char);
|
|
3484
3424
|
var PhoneNumberInput = /* @__PURE__ */ (0, import_react41.forwardRef)(
|
|
@@ -3501,7 +3441,7 @@ var PhoneNumberInput = /* @__PURE__ */ (0, import_react41.forwardRef)(
|
|
|
3501
3441
|
defaultValue,
|
|
3502
3442
|
onValueChange,
|
|
3503
3443
|
sanitize: sanitize3,
|
|
3504
|
-
format: formatPhoneNumber,
|
|
3444
|
+
format: import_korean_utils6.formatPhoneNumber,
|
|
3505
3445
|
isMeaningful: isDigit4,
|
|
3506
3446
|
inputRef
|
|
3507
3447
|
});
|
|
@@ -3661,7 +3601,7 @@ var SegmentedControl = /* @__PURE__ */ (0, import_react43.forwardRef)(
|
|
|
3661
3601
|
const labelId = label7 ? `${id ?? generatedId}-label` : void 0;
|
|
3662
3602
|
const itemRefs = (0, import_react43.useRef)([]);
|
|
3663
3603
|
const isEnabled = (index) => !disabled && !options[index]?.disabled;
|
|
3664
|
-
const
|
|
3604
|
+
const select2 = (index) => {
|
|
3665
3605
|
const next = options[index].value;
|
|
3666
3606
|
if (next === current2) return;
|
|
3667
3607
|
if (!isControlled) setInnerValue(next);
|
|
@@ -3688,7 +3628,7 @@ var SegmentedControl = /* @__PURE__ */ (0, import_react43.forwardRef)(
|
|
|
3688
3628
|
if (target < 0) return;
|
|
3689
3629
|
event.preventDefault();
|
|
3690
3630
|
itemRefs.current[target]?.focus();
|
|
3691
|
-
|
|
3631
|
+
select2(target);
|
|
3692
3632
|
};
|
|
3693
3633
|
const group = /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
3694
3634
|
"div",
|
|
@@ -3717,7 +3657,7 @@ var SegmentedControl = /* @__PURE__ */ (0, import_react43.forwardRef)(
|
|
|
3717
3657
|
"data-state": checked ? "checked" : "unchecked",
|
|
3718
3658
|
"data-disabled": isEnabled(index) ? void 0 : "",
|
|
3719
3659
|
className: item9({ size, fullWidth }),
|
|
3720
|
-
onClick: () =>
|
|
3660
|
+
onClick: () => select2(index),
|
|
3721
3661
|
onKeyDown: (event) => handleKeyDown(event, index),
|
|
3722
3662
|
children: [
|
|
3723
3663
|
option2.icon && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { "aria-hidden": true, className: icon6, children: option2.icon }),
|
|
@@ -3739,12 +3679,91 @@ var SegmentedControl = /* @__PURE__ */ (0, import_react43.forwardRef)(
|
|
|
3739
3679
|
}
|
|
3740
3680
|
);
|
|
3741
3681
|
|
|
3742
|
-
// src/components/
|
|
3743
|
-
var RadixSelect = __toESM(require("@radix-ui/react-select"), 1);
|
|
3682
|
+
// src/components/NativeSelect/NativeSelect.tsx
|
|
3744
3683
|
var import_react44 = require("react");
|
|
3745
3684
|
var import_icons18 = require("@bestow-ui/icons");
|
|
3685
|
+
|
|
3686
|
+
// src/components/NativeSelect/NativeSelect.css.ts
|
|
3687
|
+
var import_createRuntimeFn23 = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
3688
|
+
var icon7 = /* @__PURE__ */ (0, import_createRuntimeFn23.createRuntimeFn)({ defaultClassName: "_5silym5", variantClassNames: { size: { sm: "_5silym6", md: "_5silym7", lg: "_5silym8" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
3689
|
+
var select = /* @__PURE__ */ (0, import_createRuntimeFn23.createRuntimeFn)({ defaultClassName: "_5silym1", variantClassNames: { size: { sm: "_5silym2", md: "_5silym3", lg: "_5silym4" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
3690
|
+
var wrapper = "_5silym0";
|
|
3691
|
+
|
|
3692
|
+
// src/components/NativeSelect/NativeSelect.tsx
|
|
3746
3693
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3747
|
-
var
|
|
3694
|
+
var NativeSelect = /* @__PURE__ */ (0, import_react44.forwardRef)(function NativeSelect2({
|
|
3695
|
+
options,
|
|
3696
|
+
onValueChange,
|
|
3697
|
+
onChange,
|
|
3698
|
+
placeholder,
|
|
3699
|
+
label: label7,
|
|
3700
|
+
helperText: helperText3,
|
|
3701
|
+
error,
|
|
3702
|
+
size,
|
|
3703
|
+
fullWidth,
|
|
3704
|
+
required,
|
|
3705
|
+
disabled,
|
|
3706
|
+
id,
|
|
3707
|
+
value: value4,
|
|
3708
|
+
defaultValue,
|
|
3709
|
+
className,
|
|
3710
|
+
children,
|
|
3711
|
+
"aria-describedby": ariaDescribedBy,
|
|
3712
|
+
...rest
|
|
3713
|
+
}, ref) {
|
|
3714
|
+
const generatedId = (0, import_react44.useId)();
|
|
3715
|
+
const selectId = id ?? generatedId;
|
|
3716
|
+
const helperId = helperText3 ? `${selectId}-helper` : void 0;
|
|
3717
|
+
const handleChange = (event) => {
|
|
3718
|
+
onChange?.(event);
|
|
3719
|
+
onValueChange?.(event.target.value);
|
|
3720
|
+
};
|
|
3721
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
|
|
3722
|
+
label7 && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("label", { htmlFor: selectId, className: label2, children: [
|
|
3723
|
+
label7,
|
|
3724
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
3725
|
+
] }),
|
|
3726
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
3727
|
+
"span",
|
|
3728
|
+
{
|
|
3729
|
+
className: cx(root5({ size, fullWidth }), wrapper),
|
|
3730
|
+
"data-invalid": error || void 0,
|
|
3731
|
+
"data-disabled": disabled || void 0,
|
|
3732
|
+
children: [
|
|
3733
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
3734
|
+
"select",
|
|
3735
|
+
{
|
|
3736
|
+
ref,
|
|
3737
|
+
id: selectId,
|
|
3738
|
+
value: value4,
|
|
3739
|
+
defaultValue: value4 === void 0 && defaultValue === void 0 && placeholder !== void 0 ? "" : defaultValue,
|
|
3740
|
+
onChange: handleChange,
|
|
3741
|
+
required,
|
|
3742
|
+
disabled,
|
|
3743
|
+
"aria-invalid": error || void 0,
|
|
3744
|
+
"aria-describedby": cx(helperId, ariaDescribedBy) || void 0,
|
|
3745
|
+
className: cx(select({ size }), className),
|
|
3746
|
+
...rest,
|
|
3747
|
+
children: [
|
|
3748
|
+
placeholder !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("option", { value: "", disabled: true, children: placeholder }),
|
|
3749
|
+
options ? options.map((option2) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("option", { value: option2.value, disabled: option2.disabled, children: option2.label }, option2.value)) : children
|
|
3750
|
+
]
|
|
3751
|
+
}
|
|
3752
|
+
),
|
|
3753
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_icons18.ChevronDownIcon, { size: 16, className: icon7({ size }) })
|
|
3754
|
+
]
|
|
3755
|
+
}
|
|
3756
|
+
),
|
|
3757
|
+
helperText3 && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { id: helperId, className: helperText({ error }), children: helperText3 })
|
|
3758
|
+
] });
|
|
3759
|
+
});
|
|
3760
|
+
|
|
3761
|
+
// src/components/Select/Select.tsx
|
|
3762
|
+
var RadixSelect = __toESM(require("@radix-ui/react-select"), 1);
|
|
3763
|
+
var import_react45 = require("react");
|
|
3764
|
+
var import_icons19 = require("@bestow-ui/icons");
|
|
3765
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3766
|
+
var Select = /* @__PURE__ */ (0, import_react45.forwardRef)(function Select2(props, ref) {
|
|
3748
3767
|
const {
|
|
3749
3768
|
options,
|
|
3750
3769
|
value: value4,
|
|
@@ -3764,16 +3783,16 @@ var Select = /* @__PURE__ */ (0, import_react44.forwardRef)(function Select2(pro
|
|
|
3764
3783
|
className
|
|
3765
3784
|
} = props;
|
|
3766
3785
|
const isControlled = "value" in props;
|
|
3767
|
-
const generatedId = (0,
|
|
3786
|
+
const generatedId = (0, import_react45.useId)();
|
|
3768
3787
|
const triggerId = id ?? generatedId;
|
|
3769
3788
|
const helperId = helperText3 ? `${triggerId}-helper` : void 0;
|
|
3770
3789
|
const portal2 = usePortalProps();
|
|
3771
|
-
return /* @__PURE__ */ (0,
|
|
3772
|
-
label7 && /* @__PURE__ */ (0,
|
|
3790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
|
|
3791
|
+
label7 && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("label", { htmlFor: triggerId, className: label2, children: [
|
|
3773
3792
|
label7,
|
|
3774
|
-
required && /* @__PURE__ */ (0,
|
|
3793
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
3775
3794
|
] }),
|
|
3776
|
-
/* @__PURE__ */ (0,
|
|
3795
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
3777
3796
|
RadixSelect.Root,
|
|
3778
3797
|
{
|
|
3779
3798
|
value: isControlled ? value4 ?? "" : void 0,
|
|
@@ -3783,7 +3802,7 @@ var Select = /* @__PURE__ */ (0, import_react44.forwardRef)(function Select2(pro
|
|
|
3783
3802
|
required,
|
|
3784
3803
|
name,
|
|
3785
3804
|
children: [
|
|
3786
|
-
/* @__PURE__ */ (0,
|
|
3805
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
3787
3806
|
RadixSelect.Trigger,
|
|
3788
3807
|
{
|
|
3789
3808
|
ref,
|
|
@@ -3794,12 +3813,12 @@ var Select = /* @__PURE__ */ (0, import_react44.forwardRef)(function Select2(pro
|
|
|
3794
3813
|
"data-invalid": error || void 0,
|
|
3795
3814
|
className: cx(root5({ size, fullWidth }), trigger2, className),
|
|
3796
3815
|
children: [
|
|
3797
|
-
/* @__PURE__ */ (0,
|
|
3798
|
-
/* @__PURE__ */ (0,
|
|
3816
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: value2, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(RadixSelect.Value, { placeholder }) }),
|
|
3817
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(RadixSelect.Icon, { className: icon4, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_icons19.ChevronDownIcon, { size: 16 }) })
|
|
3799
3818
|
]
|
|
3800
3819
|
}
|
|
3801
3820
|
),
|
|
3802
|
-
/* @__PURE__ */ (0,
|
|
3821
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(RadixSelect.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3803
3822
|
RadixSelect.Content,
|
|
3804
3823
|
{
|
|
3805
3824
|
position: "popper",
|
|
@@ -3807,15 +3826,15 @@ var Select = /* @__PURE__ */ (0, import_react44.forwardRef)(function Select2(pro
|
|
|
3807
3826
|
collisionPadding: 8,
|
|
3808
3827
|
className: cx(portal2.className, content5),
|
|
3809
3828
|
style: portal2.style,
|
|
3810
|
-
children: /* @__PURE__ */ (0,
|
|
3829
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(RadixSelect.Viewport, { className: viewport, children: options.map((option2) => /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
3811
3830
|
RadixSelect.Item,
|
|
3812
3831
|
{
|
|
3813
3832
|
value: option2.value,
|
|
3814
3833
|
disabled: option2.disabled,
|
|
3815
3834
|
className: item5,
|
|
3816
3835
|
children: [
|
|
3817
|
-
/* @__PURE__ */ (0,
|
|
3818
|
-
/* @__PURE__ */ (0,
|
|
3836
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(RadixSelect.ItemText, { children: option2.label }),
|
|
3837
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(RadixSelect.ItemIndicator, { className: itemIndicator, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_icons19.CheckIcon, { size: 16 }) })
|
|
3819
3838
|
]
|
|
3820
3839
|
},
|
|
3821
3840
|
option2.value
|
|
@@ -3825,19 +3844,19 @@ var Select = /* @__PURE__ */ (0, import_react44.forwardRef)(function Select2(pro
|
|
|
3825
3844
|
]
|
|
3826
3845
|
}
|
|
3827
3846
|
),
|
|
3828
|
-
helperText3 && /* @__PURE__ */ (0,
|
|
3847
|
+
helperText3 && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { id: helperId, className: helperText({ error }), children: helperText3 })
|
|
3829
3848
|
] });
|
|
3830
3849
|
});
|
|
3831
3850
|
|
|
3832
3851
|
// src/components/SkipLink/SkipLink.tsx
|
|
3833
|
-
var
|
|
3852
|
+
var import_react46 = require("react");
|
|
3834
3853
|
|
|
3835
3854
|
// src/components/SkipLink/SkipLink.css.ts
|
|
3836
3855
|
var skipLink = "_1t9jaar0";
|
|
3837
3856
|
|
|
3838
3857
|
// src/components/SkipLink/SkipLink.tsx
|
|
3839
|
-
var
|
|
3840
|
-
var SkipLink = /* @__PURE__ */ (0,
|
|
3858
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3859
|
+
var SkipLink = /* @__PURE__ */ (0, import_react46.forwardRef)(function SkipLink2({ href = "#main", className, children, onClick, ...rest }, ref) {
|
|
3841
3860
|
const m = useMessages();
|
|
3842
3861
|
const handleClick = (event) => {
|
|
3843
3862
|
onClick?.(event);
|
|
@@ -3849,28 +3868,28 @@ var SkipLink = /* @__PURE__ */ (0, import_react45.forwardRef)(function SkipLink2
|
|
|
3849
3868
|
target.focus();
|
|
3850
3869
|
target.scrollIntoView?.({ block: "start" });
|
|
3851
3870
|
};
|
|
3852
|
-
return /* @__PURE__ */ (0,
|
|
3871
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("a", { ref, href, className: cx(skipLink, className), onClick: handleClick, ...rest, children: children ?? m.skipToContent ?? "\uBCF8\uBB38 \uBC14\uB85C\uAC00\uAE30" });
|
|
3853
3872
|
});
|
|
3854
3873
|
|
|
3855
3874
|
// src/components/Slider/Slider.tsx
|
|
3856
3875
|
var RadixSlider = __toESM(require("@radix-ui/react-slider"), 1);
|
|
3857
|
-
var
|
|
3876
|
+
var import_react47 = require("react");
|
|
3858
3877
|
|
|
3859
3878
|
// src/components/Slider/Slider.css.ts
|
|
3860
|
-
var
|
|
3879
|
+
var import_createRuntimeFn24 = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
3861
3880
|
var field3 = "_126mzjm0";
|
|
3862
3881
|
var header8 = "_126mzjm1";
|
|
3863
3882
|
var helperText2 = "_126mzjm4";
|
|
3864
3883
|
var label4 = "_126mzjm2";
|
|
3865
3884
|
var range2 = "_126mzjmb";
|
|
3866
|
-
var root12 = /* @__PURE__ */ (0,
|
|
3867
|
-
var thumb = /* @__PURE__ */ (0,
|
|
3868
|
-
var track2 = /* @__PURE__ */ (0,
|
|
3885
|
+
var root12 = /* @__PURE__ */ (0, import_createRuntimeFn24.createRuntimeFn)({ defaultClassName: "_126mzjm5", variantClassNames: { size: { sm: "_126mzjm6", md: "_126mzjm7" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
3886
|
+
var thumb = /* @__PURE__ */ (0, import_createRuntimeFn24.createRuntimeFn)({ defaultClassName: "_126mzjmc", variantClassNames: { size: { sm: "_126mzjmd", md: "_126mzjme" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
3887
|
+
var track2 = /* @__PURE__ */ (0, import_createRuntimeFn24.createRuntimeFn)({ defaultClassName: "_126mzjm8", variantClassNames: { size: { sm: "_126mzjm9", md: "_126mzjma" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
3869
3888
|
var value3 = "_126mzjm3";
|
|
3870
3889
|
|
|
3871
3890
|
// src/components/Slider/Slider.tsx
|
|
3872
|
-
var
|
|
3873
|
-
var Slider = /* @__PURE__ */ (0,
|
|
3891
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3892
|
+
var Slider = /* @__PURE__ */ (0, import_react47.forwardRef)(function Slider2(props, ref) {
|
|
3874
3893
|
const {
|
|
3875
3894
|
value: value4,
|
|
3876
3895
|
defaultValue,
|
|
@@ -3891,12 +3910,12 @@ var Slider = /* @__PURE__ */ (0, import_react46.forwardRef)(function Slider2(pro
|
|
|
3891
3910
|
} = props;
|
|
3892
3911
|
const m = useMessages();
|
|
3893
3912
|
const thumbLabels = thumbLabelsProp ?? [m.rangeStart ?? "\uCD5C\uC18C", m.rangeEnd ?? "\uCD5C\uB300"];
|
|
3894
|
-
const generatedId = (0,
|
|
3913
|
+
const generatedId = (0, import_react47.useId)();
|
|
3895
3914
|
const baseId = id ?? generatedId;
|
|
3896
3915
|
const labelId = `${baseId}-label`;
|
|
3897
3916
|
const helperId = `${baseId}-helper`;
|
|
3898
3917
|
const isControlled = "value" in props;
|
|
3899
|
-
const [innerValue, setInnerValue] = (0,
|
|
3918
|
+
const [innerValue, setInnerValue] = (0, import_react47.useState)(defaultValue ?? [min]);
|
|
3900
3919
|
const current2 = isControlled ? value4 ?? [min] : innerValue;
|
|
3901
3920
|
const isRange = current2.length > 1;
|
|
3902
3921
|
const handleChange = (next) => {
|
|
@@ -3904,12 +3923,12 @@ var Slider = /* @__PURE__ */ (0, import_react46.forwardRef)(function Slider2(pro
|
|
|
3904
3923
|
onValueChange?.(next);
|
|
3905
3924
|
};
|
|
3906
3925
|
const valueText = current2.map(formatValue).join(" \u2013 ");
|
|
3907
|
-
return /* @__PURE__ */ (0,
|
|
3908
|
-
(label7 || showValue) && /* @__PURE__ */ (0,
|
|
3909
|
-
label7 && /* @__PURE__ */ (0,
|
|
3910
|
-
showValue && /* @__PURE__ */ (0,
|
|
3926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: cx(field3, className), children: [
|
|
3927
|
+
(label7 || showValue) && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: header8, children: [
|
|
3928
|
+
label7 && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { id: labelId, className: label4, children: label7 }),
|
|
3929
|
+
showValue && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: value3, "aria-hidden": true, children: valueText })
|
|
3911
3930
|
] }),
|
|
3912
|
-
/* @__PURE__ */ (0,
|
|
3931
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
3913
3932
|
RadixSlider.Root,
|
|
3914
3933
|
{
|
|
3915
3934
|
ref,
|
|
@@ -3922,10 +3941,10 @@ var Slider = /* @__PURE__ */ (0, import_react46.forwardRef)(function Slider2(pro
|
|
|
3922
3941
|
className: root12({ size }),
|
|
3923
3942
|
...rest,
|
|
3924
3943
|
children: [
|
|
3925
|
-
/* @__PURE__ */ (0,
|
|
3944
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(RadixSlider.Track, { className: track2({ size }), children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(RadixSlider.Range, { className: range2 }) }),
|
|
3926
3945
|
current2.map((thumbValue, index) => {
|
|
3927
3946
|
const thumbLabelId = `${baseId}-thumb-${index}`;
|
|
3928
|
-
return /* @__PURE__ */ (0,
|
|
3947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3929
3948
|
RadixSlider.Thumb,
|
|
3930
3949
|
{
|
|
3931
3950
|
className: thumb({ size }),
|
|
@@ -3940,32 +3959,32 @@ var Slider = /* @__PURE__ */ (0, import_react46.forwardRef)(function Slider2(pro
|
|
|
3940
3959
|
]
|
|
3941
3960
|
}
|
|
3942
3961
|
),
|
|
3943
|
-
isRange && current2.map((_, index) => /* @__PURE__ */ (0,
|
|
3962
|
+
isRange && current2.map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("span", { id: `${baseId}-thumb-${index}`, hidden: true, children: [
|
|
3944
3963
|
label7 ? "" : ariaLabel ? `${ariaLabel} ` : "",
|
|
3945
3964
|
thumbLabels[index] ?? `${index + 1}`
|
|
3946
3965
|
] }, index)),
|
|
3947
|
-
helperText3 && /* @__PURE__ */ (0,
|
|
3966
|
+
helperText3 && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { id: helperId, className: helperText2, children: helperText3 })
|
|
3948
3967
|
] });
|
|
3949
3968
|
});
|
|
3950
3969
|
|
|
3951
3970
|
// src/components/Stepper/Stepper.tsx
|
|
3952
|
-
var
|
|
3953
|
-
var
|
|
3971
|
+
var import_react48 = require("react");
|
|
3972
|
+
var import_icons20 = require("@bestow-ui/icons");
|
|
3954
3973
|
|
|
3955
3974
|
// src/components/Stepper/Stepper.css.ts
|
|
3956
|
-
var
|
|
3975
|
+
var import_createRuntimeFn25 = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
3957
3976
|
var description6 = "kervhmh";
|
|
3958
|
-
var indicator3 = /* @__PURE__ */ (0,
|
|
3959
|
-
var label5 = /* @__PURE__ */ (0,
|
|
3960
|
-
var root13 = /* @__PURE__ */ (0,
|
|
3961
|
-
var step = /* @__PURE__ */ (0,
|
|
3962
|
-
var text2 = /* @__PURE__ */ (0,
|
|
3977
|
+
var indicator3 = /* @__PURE__ */ (0, import_createRuntimeFn25.createRuntimeFn)({ defaultClassName: "kervhm6", variantClassNames: { status: { complete: "kervhm7", current: "kervhm8", upcoming: "kervhm9" } }, defaultVariants: {}, compoundVariants: [] });
|
|
3978
|
+
var label5 = /* @__PURE__ */ (0, import_createRuntimeFn25.createRuntimeFn)({ defaultClassName: "kervhmd", variantClassNames: { status: { complete: "kervhme", current: "kervhmf", upcoming: "kervhmg" } }, defaultVariants: {}, compoundVariants: [] });
|
|
3979
|
+
var root13 = /* @__PURE__ */ (0, import_createRuntimeFn25.createRuntimeFn)({ defaultClassName: "kervhm0", variantClassNames: { orientation: { horizontal: "kervhm1", vertical: "kervhm2" } }, defaultVariants: { orientation: "horizontal" }, compoundVariants: [] });
|
|
3980
|
+
var step = /* @__PURE__ */ (0, import_createRuntimeFn25.createRuntimeFn)({ defaultClassName: "kervhm3", variantClassNames: { orientation: { horizontal: "kervhm4", vertical: "kervhm5" } }, defaultVariants: { orientation: "horizontal" }, compoundVariants: [] });
|
|
3981
|
+
var text2 = /* @__PURE__ */ (0, import_createRuntimeFn25.createRuntimeFn)({ defaultClassName: "kervhma", variantClassNames: { orientation: { horizontal: "kervhmb", vertical: "kervhmc" } }, defaultVariants: {}, compoundVariants: [] });
|
|
3963
3982
|
|
|
3964
3983
|
// src/components/Stepper/Stepper.tsx
|
|
3965
|
-
var
|
|
3966
|
-
var Stepper = /* @__PURE__ */ (0,
|
|
3984
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3985
|
+
var Stepper = /* @__PURE__ */ (0, import_react48.forwardRef)(function Stepper2({ steps, current: current2, orientation = "horizontal", "aria-label": ariaLabel, className, ...rest }, ref) {
|
|
3967
3986
|
const m = useMessages();
|
|
3968
|
-
return /* @__PURE__ */ (0,
|
|
3987
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3969
3988
|
"ol",
|
|
3970
3989
|
{
|
|
3971
3990
|
ref,
|
|
@@ -3974,24 +3993,24 @@ var Stepper = /* @__PURE__ */ (0, import_react47.forwardRef)(function Stepper2({
|
|
|
3974
3993
|
...rest,
|
|
3975
3994
|
children: steps.map((step2, index) => {
|
|
3976
3995
|
const status = index < current2 ? "complete" : index === current2 ? "current" : "upcoming";
|
|
3977
|
-
return /* @__PURE__ */ (0,
|
|
3996
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
3978
3997
|
"li",
|
|
3979
3998
|
{
|
|
3980
3999
|
className: step({ orientation }),
|
|
3981
4000
|
"data-status": status,
|
|
3982
4001
|
"aria-current": status === "current" ? "step" : void 0,
|
|
3983
4002
|
children: [
|
|
3984
|
-
/* @__PURE__ */ (0,
|
|
3985
|
-
/* @__PURE__ */ (0,
|
|
3986
|
-
/* @__PURE__ */ (0,
|
|
4003
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: indicator3({ status }), "aria-hidden": true, children: status === "complete" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_icons20.CheckIcon, { size: 16, strokeWidth: 2.5 }) : index + 1 }),
|
|
4004
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { className: text2({ orientation }), children: [
|
|
4005
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { className: label5({ status }), children: [
|
|
3987
4006
|
step2.label,
|
|
3988
|
-
status === "complete" && /* @__PURE__ */ (0,
|
|
4007
|
+
status === "complete" && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { className: visuallyHidden, children: [
|
|
3989
4008
|
" (",
|
|
3990
4009
|
m.stepCompleted ?? "\uC644\uB8CC",
|
|
3991
4010
|
")"
|
|
3992
4011
|
] })
|
|
3993
4012
|
] }),
|
|
3994
|
-
step2.description && /* @__PURE__ */ (0,
|
|
4013
|
+
step2.description && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: description6, children: step2.description })
|
|
3995
4014
|
] })
|
|
3996
4015
|
]
|
|
3997
4016
|
},
|
|
@@ -4003,47 +4022,120 @@ var Stepper = /* @__PURE__ */ (0, import_react47.forwardRef)(function Stepper2({
|
|
|
4003
4022
|
});
|
|
4004
4023
|
|
|
4005
4024
|
// src/components/Switch/Switch.tsx
|
|
4006
|
-
var
|
|
4007
|
-
var import_react48 = require("react");
|
|
4025
|
+
var import_react49 = require("react");
|
|
4008
4026
|
|
|
4009
4027
|
// src/components/Switch/Switch.css.ts
|
|
4010
|
-
var
|
|
4011
|
-
var
|
|
4012
|
-
var
|
|
4013
|
-
var
|
|
4014
|
-
var
|
|
4028
|
+
var import_createRuntimeFn26 = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
4029
|
+
var bubbleInput = /* @__PURE__ */ (0, import_createRuntimeFn26.createRuntimeFn)({ defaultClassName: "o33ul29", variantClassNames: { size: { sm: "o33ul2a", md: "o33ul2b" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
4030
|
+
var label6 = "o33ul2c";
|
|
4031
|
+
var root14 = /* @__PURE__ */ (0, import_createRuntimeFn26.createRuntimeFn)({ defaultClassName: "o33ul20", variantClassNames: { size: { sm: "o33ul21", md: "o33ul22" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
4032
|
+
var thumb2 = /* @__PURE__ */ (0, import_createRuntimeFn26.createRuntimeFn)({ defaultClassName: "o33ul26", variantClassNames: { size: { sm: "o33ul27", md: "o33ul28" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
4033
|
+
var track3 = /* @__PURE__ */ (0, import_createRuntimeFn26.createRuntimeFn)({ defaultClassName: "o33ul23", variantClassNames: { size: { sm: "o33ul24", md: "o33ul25" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
4015
4034
|
|
|
4016
4035
|
// src/components/Switch/Switch.tsx
|
|
4017
|
-
var
|
|
4018
|
-
|
|
4019
|
-
|
|
4036
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
4037
|
+
function setNativeChecked(input6, checked) {
|
|
4038
|
+
Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "checked")?.set?.call(input6, checked);
|
|
4039
|
+
}
|
|
4040
|
+
var Switch = /* @__PURE__ */ (0, import_react49.forwardRef)(function Switch2({
|
|
4041
|
+
label: label7,
|
|
4042
|
+
size,
|
|
4043
|
+
id,
|
|
4044
|
+
className,
|
|
4045
|
+
disabled,
|
|
4046
|
+
required,
|
|
4047
|
+
name,
|
|
4048
|
+
value: value4 = "on",
|
|
4049
|
+
checked: checkedProp,
|
|
4050
|
+
defaultChecked,
|
|
4051
|
+
onCheckedChange,
|
|
4052
|
+
"aria-label": ariaLabel
|
|
4053
|
+
}, ref) {
|
|
4054
|
+
const generatedId = (0, import_react49.useId)();
|
|
4020
4055
|
const switchId = id ?? generatedId;
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4056
|
+
const [uncontrolled, setUncontrolled] = (0, import_react49.useState)(defaultChecked ?? false);
|
|
4057
|
+
const isControlled = checkedProp !== void 0;
|
|
4058
|
+
const checked = isControlled ? checkedProp : uncontrolled;
|
|
4059
|
+
const buttonRef = (0, import_react49.useRef)(null);
|
|
4060
|
+
const inputRef = (0, import_react49.useRef)(null);
|
|
4061
|
+
const [inForm, setInForm] = (0, import_react49.useState)(true);
|
|
4062
|
+
const userToggled = (0, import_react49.useRef)(false);
|
|
4063
|
+
const setChecked = (next) => {
|
|
4064
|
+
if (!isControlled) setUncontrolled(next);
|
|
4065
|
+
if (next !== checked) onCheckedChange?.(next);
|
|
4066
|
+
};
|
|
4067
|
+
const setCheckedRef = (0, import_react49.useRef)(setChecked);
|
|
4068
|
+
setCheckedRef.current = setChecked;
|
|
4069
|
+
(0, import_react49.useEffect)(() => {
|
|
4070
|
+
const form = buttonRef.current?.form;
|
|
4071
|
+
setInForm(!!form);
|
|
4072
|
+
if (!form) return;
|
|
4073
|
+
const initial = checked;
|
|
4074
|
+
const onReset = () => setCheckedRef.current(initial);
|
|
4075
|
+
form.addEventListener("reset", onReset);
|
|
4076
|
+
return () => form.removeEventListener("reset", onReset);
|
|
4077
|
+
}, []);
|
|
4078
|
+
(0, import_react49.useEffect)(() => {
|
|
4079
|
+
const input6 = inputRef.current;
|
|
4080
|
+
if (!input6 || input6.checked === checked) return;
|
|
4081
|
+
setNativeChecked(input6, checked);
|
|
4082
|
+
if (userToggled.current) input6.dispatchEvent(new Event("click", { bubbles: true }));
|
|
4083
|
+
userToggled.current = false;
|
|
4084
|
+
}, [checked]);
|
|
4085
|
+
const handleClick = (event) => {
|
|
4086
|
+
userToggled.current = true;
|
|
4087
|
+
setChecked(!checked);
|
|
4088
|
+
if (inForm) event.stopPropagation();
|
|
4089
|
+
};
|
|
4090
|
+
const state = checked ? "checked" : "unchecked";
|
|
4091
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { className: cx(root14({ size }), className), "data-disabled": disabled || void 0, children: [
|
|
4092
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4093
|
+
"button",
|
|
4024
4094
|
{
|
|
4025
|
-
ref,
|
|
4095
|
+
ref: mergeRefs(ref, buttonRef),
|
|
4096
|
+
type: "button",
|
|
4097
|
+
role: "switch",
|
|
4026
4098
|
id: switchId,
|
|
4027
|
-
|
|
4099
|
+
"aria-checked": checked,
|
|
4100
|
+
"aria-required": required,
|
|
4028
4101
|
"aria-label": ariaLabel,
|
|
4102
|
+
"data-state": state,
|
|
4103
|
+
"data-disabled": disabled ? "" : void 0,
|
|
4104
|
+
disabled,
|
|
4105
|
+
value: value4,
|
|
4029
4106
|
className: track3({ size }),
|
|
4030
|
-
|
|
4031
|
-
children: /* @__PURE__ */ (0,
|
|
4107
|
+
onClick: handleClick,
|
|
4108
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: thumb2({ size }), "data-state": state, "data-disabled": disabled ? "" : void 0 })
|
|
4032
4109
|
}
|
|
4033
4110
|
),
|
|
4034
|
-
|
|
4111
|
+
inForm && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4112
|
+
"input",
|
|
4113
|
+
{
|
|
4114
|
+
ref: inputRef,
|
|
4115
|
+
type: "checkbox",
|
|
4116
|
+
"aria-hidden": true,
|
|
4117
|
+
tabIndex: -1,
|
|
4118
|
+
defaultChecked: checked,
|
|
4119
|
+
required,
|
|
4120
|
+
disabled,
|
|
4121
|
+
name,
|
|
4122
|
+
value: value4,
|
|
4123
|
+
className: bubbleInput({ size })
|
|
4124
|
+
}
|
|
4125
|
+
),
|
|
4126
|
+
label7 && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("label", { htmlFor: switchId, className: label6, children: label7 })
|
|
4035
4127
|
] });
|
|
4036
4128
|
});
|
|
4037
4129
|
|
|
4038
4130
|
// src/components/Table/Table.tsx
|
|
4039
|
-
var
|
|
4040
|
-
var
|
|
4131
|
+
var import_react50 = require("react");
|
|
4132
|
+
var import_icons21 = require("@bestow-ui/icons");
|
|
4041
4133
|
|
|
4042
4134
|
// src/components/Table/Table.css.ts
|
|
4043
|
-
var
|
|
4135
|
+
var import_createRuntimeFn27 = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
4044
4136
|
var body4 = "l3ploy5";
|
|
4045
4137
|
var caption = "l3ploy2";
|
|
4046
|
-
var cell2 = /* @__PURE__ */ (0,
|
|
4138
|
+
var cell2 = /* @__PURE__ */ (0, import_createRuntimeFn27.createRuntimeFn)({ defaultClassName: "l3ploy9", variantClassNames: { size: { sm: "l3ploya", md: "l3ployb" }, align: { left: "l3ployc", center: "l3ployd", right: "l3ploye" } }, defaultVariants: { size: "md", align: "left" }, compoundVariants: [] });
|
|
4047
4139
|
var container = "l3ploy0";
|
|
4048
4140
|
var emptyCell = "l3ployj";
|
|
4049
4141
|
var emptyContent = "l3ployk";
|
|
@@ -4059,10 +4151,10 @@ var striped = "l3ploy6";
|
|
|
4059
4151
|
var table = "l3ploy1";
|
|
4060
4152
|
|
|
4061
4153
|
// src/components/Table/Table.tsx
|
|
4062
|
-
var
|
|
4063
|
-
var TableSizeContext = /* @__PURE__ */ (0,
|
|
4064
|
-
var TableSectionContext = /* @__PURE__ */ (0,
|
|
4065
|
-
var Table = /* @__PURE__ */ (0,
|
|
4154
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
4155
|
+
var TableSizeContext = /* @__PURE__ */ (0, import_react50.createContext)("md");
|
|
4156
|
+
var TableSectionContext = /* @__PURE__ */ (0, import_react50.createContext)("body");
|
|
4157
|
+
var Table = /* @__PURE__ */ (0, import_react50.forwardRef)(function Table2({
|
|
4066
4158
|
size = "md",
|
|
4067
4159
|
striped: striped2,
|
|
4068
4160
|
stickyHeader: stickyHeader2,
|
|
@@ -4074,8 +4166,8 @@ var Table = /* @__PURE__ */ (0, import_react49.forwardRef)(function Table2({
|
|
|
4074
4166
|
children,
|
|
4075
4167
|
...rest
|
|
4076
4168
|
}, ref) {
|
|
4077
|
-
const captionId = (0,
|
|
4078
|
-
return /* @__PURE__ */ (0,
|
|
4169
|
+
const captionId = (0, import_react50.useId)();
|
|
4170
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableSizeContext.Provider, { value: size, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4079
4171
|
"div",
|
|
4080
4172
|
{
|
|
4081
4173
|
className: cx(container, containerClassName),
|
|
@@ -4084,7 +4176,7 @@ var Table = /* @__PURE__ */ (0, import_react49.forwardRef)(function Table2({
|
|
|
4084
4176
|
role: "region",
|
|
4085
4177
|
"aria-labelledby": caption2 ? captionId : void 0,
|
|
4086
4178
|
"aria-label": caption2 ? void 0 : ariaLabel,
|
|
4087
|
-
children: /* @__PURE__ */ (0,
|
|
4179
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
4088
4180
|
"table",
|
|
4089
4181
|
{
|
|
4090
4182
|
ref,
|
|
@@ -4092,7 +4184,7 @@ var Table = /* @__PURE__ */ (0, import_react49.forwardRef)(function Table2({
|
|
|
4092
4184
|
"aria-label": caption2 ? void 0 : ariaLabel,
|
|
4093
4185
|
...rest,
|
|
4094
4186
|
children: [
|
|
4095
|
-
caption2 && /* @__PURE__ */ (0,
|
|
4187
|
+
caption2 && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("caption", { id: captionId, className: caption, children: caption2 }),
|
|
4096
4188
|
children
|
|
4097
4189
|
]
|
|
4098
4190
|
}
|
|
@@ -4100,31 +4192,31 @@ var Table = /* @__PURE__ */ (0, import_react49.forwardRef)(function Table2({
|
|
|
4100
4192
|
}
|
|
4101
4193
|
) });
|
|
4102
4194
|
});
|
|
4103
|
-
var TableHeader = /* @__PURE__ */ (0,
|
|
4195
|
+
var TableHeader = /* @__PURE__ */ (0, import_react50.forwardRef)(
|
|
4104
4196
|
function TableHeader2({ className, ...rest }, ref) {
|
|
4105
|
-
return /* @__PURE__ */ (0,
|
|
4197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableSectionContext.Provider, { value: "header", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("thead", { ref, className: cx(header9, className), ...rest }) });
|
|
4106
4198
|
}
|
|
4107
4199
|
);
|
|
4108
|
-
var TableBody = /* @__PURE__ */ (0,
|
|
4200
|
+
var TableBody = /* @__PURE__ */ (0, import_react50.forwardRef)(
|
|
4109
4201
|
function TableBody2({ className, ...rest }, ref) {
|
|
4110
|
-
return /* @__PURE__ */ (0,
|
|
4202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableSectionContext.Provider, { value: "body", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("tbody", { ref, className: cx(body4, className), ...rest }) });
|
|
4111
4203
|
}
|
|
4112
4204
|
);
|
|
4113
|
-
var TableFooter = /* @__PURE__ */ (0,
|
|
4205
|
+
var TableFooter = /* @__PURE__ */ (0, import_react50.forwardRef)(
|
|
4114
4206
|
function TableFooter2({ className, ...rest }, ref) {
|
|
4115
|
-
return /* @__PURE__ */ (0,
|
|
4207
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableSectionContext.Provider, { value: "footer", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("tfoot", { ref, className: cx(footer4, className), ...rest }) });
|
|
4116
4208
|
}
|
|
4117
4209
|
);
|
|
4118
|
-
var TableRow = /* @__PURE__ */ (0,
|
|
4119
|
-
return /* @__PURE__ */ (0,
|
|
4210
|
+
var TableRow = /* @__PURE__ */ (0, import_react50.forwardRef)(function TableRow2({ selected, className, ...rest }, ref) {
|
|
4211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("tr", { ref, className: cx(row3, className), "data-state": selected ? "selected" : void 0, ...rest });
|
|
4120
4212
|
});
|
|
4121
|
-
var TableHead = /* @__PURE__ */ (0,
|
|
4122
|
-
const size = (0,
|
|
4123
|
-
const section = (0,
|
|
4213
|
+
var TableHead = /* @__PURE__ */ (0, import_react50.forwardRef)(function TableHead2({ align, sortDirection, onSort, scope, className, children, ...rest }, ref) {
|
|
4214
|
+
const size = (0, import_react50.useContext)(TableSizeContext);
|
|
4215
|
+
const section = (0, import_react50.useContext)(TableSectionContext);
|
|
4124
4216
|
const sortable = onSort !== void 0;
|
|
4125
4217
|
const direction = sortDirection ?? "none";
|
|
4126
|
-
const SortIcon = direction === "descending" ?
|
|
4127
|
-
return /* @__PURE__ */ (0,
|
|
4218
|
+
const SortIcon = direction === "descending" ? import_icons21.ArrowDownIcon : import_icons21.ArrowUpIcon;
|
|
4219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4128
4220
|
"th",
|
|
4129
4221
|
{
|
|
4130
4222
|
ref,
|
|
@@ -4136,17 +4228,17 @@ var TableHead = /* @__PURE__ */ (0, import_react49.forwardRef)(function TableHea
|
|
|
4136
4228
|
className
|
|
4137
4229
|
),
|
|
4138
4230
|
...rest,
|
|
4139
|
-
children: sortable ? /* @__PURE__ */ (0,
|
|
4231
|
+
children: sortable ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("button", { type: "button", className: sortButton, onClick: onSort, children: [
|
|
4140
4232
|
children,
|
|
4141
|
-
/* @__PURE__ */ (0,
|
|
4233
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SortIcon, { size: 14, className: sortIcon, "data-active": direction !== "none", "aria-hidden": true })
|
|
4142
4234
|
] }) : children
|
|
4143
4235
|
}
|
|
4144
4236
|
);
|
|
4145
4237
|
});
|
|
4146
|
-
var TableCell = /* @__PURE__ */ (0,
|
|
4147
|
-
const size = (0,
|
|
4148
|
-
const section = (0,
|
|
4149
|
-
return /* @__PURE__ */ (0,
|
|
4238
|
+
var TableCell = /* @__PURE__ */ (0, import_react50.forwardRef)(function TableCell2({ align, className, ...rest }, ref) {
|
|
4239
|
+
const size = (0, import_react50.useContext)(TableSizeContext);
|
|
4240
|
+
const section = (0, import_react50.useContext)(TableSectionContext);
|
|
4241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4150
4242
|
"td",
|
|
4151
4243
|
{
|
|
4152
4244
|
ref,
|
|
@@ -4155,26 +4247,26 @@ var TableCell = /* @__PURE__ */ (0, import_react49.forwardRef)(function TableCel
|
|
|
4155
4247
|
}
|
|
4156
4248
|
);
|
|
4157
4249
|
});
|
|
4158
|
-
var TableEmpty = /* @__PURE__ */ (0,
|
|
4159
|
-
return /* @__PURE__ */ (0,
|
|
4250
|
+
var TableEmpty = /* @__PURE__ */ (0, import_react50.forwardRef)(function TableEmpty2({ colSpan, className, children, ...rest }, ref) {
|
|
4251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableCell, { ref, colSpan, className: cx(emptyCell, className), ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: emptyContent, children }) }) });
|
|
4160
4252
|
});
|
|
4161
4253
|
function TableSkeleton({ rows = 5, columns }) {
|
|
4162
|
-
return /* @__PURE__ */ (0,
|
|
4254
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_jsx_runtime48.Fragment, { children: Array.from({ length: rows }, (_, row5) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableRow, { "aria-hidden": true, children: Array.from({ length: columns }, (_2, column) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Skeleton, { width: column === 0 ? "60%" : "80%" }) }, column)) }, row5)) });
|
|
4163
4255
|
}
|
|
4164
4256
|
|
|
4165
4257
|
// src/components/Table/useTableSelection.ts
|
|
4166
|
-
var
|
|
4258
|
+
var import_react51 = require("react");
|
|
4167
4259
|
function useTableSelection(initial = []) {
|
|
4168
|
-
const [selected, setSelected] = (0,
|
|
4169
|
-
const isSelected = (0,
|
|
4170
|
-
const toggle3 = (0,
|
|
4260
|
+
const [selected, setSelected] = (0, import_react51.useState)(initial);
|
|
4261
|
+
const isSelected = (0, import_react51.useCallback)((id) => selected.includes(id), [selected]);
|
|
4262
|
+
const toggle3 = (0, import_react51.useCallback)((id, checked) => {
|
|
4171
4263
|
setSelected((prev) => {
|
|
4172
4264
|
const on = checked ?? !prev.includes(id);
|
|
4173
4265
|
if (on) return prev.includes(id) ? prev : [...prev, id];
|
|
4174
4266
|
return prev.filter((value4) => value4 !== id);
|
|
4175
4267
|
});
|
|
4176
4268
|
}, []);
|
|
4177
|
-
const clear2 = (0,
|
|
4269
|
+
const clear2 = (0, import_react51.useCallback)(() => setSelected([]), []);
|
|
4178
4270
|
const selectAllProps = (pageIds) => {
|
|
4179
4271
|
const all2 = pageIds.length > 0 && pageIds.every((id) => selected.includes(id));
|
|
4180
4272
|
const some = pageIds.some((id) => selected.includes(id));
|
|
@@ -4195,48 +4287,48 @@ function useTableSelection(initial = []) {
|
|
|
4195
4287
|
|
|
4196
4288
|
// src/components/Tabs/Tabs.tsx
|
|
4197
4289
|
var RadixTabs = __toESM(require("@radix-ui/react-tabs"), 1);
|
|
4198
|
-
var
|
|
4290
|
+
var import_react52 = require("react");
|
|
4199
4291
|
|
|
4200
4292
|
// src/components/Tabs/Tabs.css.ts
|
|
4201
|
-
var
|
|
4293
|
+
var import_createRuntimeFn28 = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
4202
4294
|
var content10 = "fvhbtdb";
|
|
4203
|
-
var list6 = /* @__PURE__ */ (0,
|
|
4295
|
+
var list6 = /* @__PURE__ */ (0, import_createRuntimeFn28.createRuntimeFn)({ defaultClassName: "fvhbtd1", variantClassNames: { variant: { line: "fvhbtd2", soft: "fvhbtd3" } }, defaultVariants: { variant: "line" }, compoundVariants: [] });
|
|
4204
4296
|
var root15 = "fvhbtd0";
|
|
4205
|
-
var trigger3 = /* @__PURE__ */ (0,
|
|
4297
|
+
var trigger3 = /* @__PURE__ */ (0, import_createRuntimeFn28.createRuntimeFn)({ defaultClassName: "fvhbtd4", variantClassNames: { variant: { line: "fvhbtd5", soft: "fvhbtd6" }, size: { sm: "fvhbtd7", md: "fvhbtd8" } }, defaultVariants: { variant: "line", size: "md" }, compoundVariants: [[{ variant: "soft", size: "sm" }, "fvhbtd9"], [{ variant: "soft", size: "md" }, "fvhbtda"]] });
|
|
4206
4298
|
|
|
4207
4299
|
// src/components/Tabs/Tabs.tsx
|
|
4208
|
-
var
|
|
4209
|
-
var TabsStyleContext = /* @__PURE__ */ (0,
|
|
4210
|
-
var Tabs = /* @__PURE__ */ (0,
|
|
4300
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
4301
|
+
var TabsStyleContext = /* @__PURE__ */ (0, import_react52.createContext)({ variant: "line", size: "md" });
|
|
4302
|
+
var Tabs = /* @__PURE__ */ (0, import_react52.forwardRef)(function Tabs2({ variant = "line", size = "md", className, ...props }, ref) {
|
|
4211
4303
|
const controlled = "value" in props ? { value: props.value ?? "" } : {};
|
|
4212
|
-
return /* @__PURE__ */ (0,
|
|
4304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TabsStyleContext.Provider, { value: { variant, size }, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(RadixTabs.Root, { ref, className: cx(root15, className), ...props, ...controlled }) });
|
|
4213
4305
|
});
|
|
4214
|
-
var TabsList = /* @__PURE__ */ (0,
|
|
4215
|
-
const { variant } = (0,
|
|
4216
|
-
return /* @__PURE__ */ (0,
|
|
4306
|
+
var TabsList = /* @__PURE__ */ (0, import_react52.forwardRef)(function TabsList2({ className, ...rest }, ref) {
|
|
4307
|
+
const { variant } = (0, import_react52.useContext)(TabsStyleContext);
|
|
4308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(RadixTabs.List, { ref, className: cx(list6({ variant }), className), ...rest });
|
|
4217
4309
|
});
|
|
4218
|
-
var TabsTrigger = /* @__PURE__ */ (0,
|
|
4219
|
-
const { variant, size } = (0,
|
|
4220
|
-
return /* @__PURE__ */ (0,
|
|
4310
|
+
var TabsTrigger = /* @__PURE__ */ (0, import_react52.forwardRef)(function TabsTrigger2({ className, ...rest }, ref) {
|
|
4311
|
+
const { variant, size } = (0, import_react52.useContext)(TabsStyleContext);
|
|
4312
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(RadixTabs.Trigger, { ref, className: cx(trigger3({ variant, size }), className), ...rest });
|
|
4221
4313
|
});
|
|
4222
|
-
var TabsContent = /* @__PURE__ */ (0,
|
|
4223
|
-
return /* @__PURE__ */ (0,
|
|
4314
|
+
var TabsContent = /* @__PURE__ */ (0, import_react52.forwardRef)(function TabsContent2({ className, ...rest }, ref) {
|
|
4315
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(RadixTabs.Content, { ref, className: cx(content10, className), ...rest });
|
|
4224
4316
|
});
|
|
4225
4317
|
|
|
4226
4318
|
// src/components/Textarea/Textarea.tsx
|
|
4227
|
-
var
|
|
4319
|
+
var import_react53 = require("react");
|
|
4228
4320
|
|
|
4229
4321
|
// src/components/Textarea/Textarea.css.ts
|
|
4230
|
-
var
|
|
4322
|
+
var import_createRuntimeFn29 = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
4231
4323
|
var count = "_1koawa9";
|
|
4232
4324
|
var countOver = "_1koawaa";
|
|
4233
4325
|
var defaultWidth = "_1koawa7";
|
|
4234
4326
|
var footer5 = "_1koawa8";
|
|
4235
|
-
var textarea = /* @__PURE__ */ (0,
|
|
4327
|
+
var textarea = /* @__PURE__ */ (0, import_createRuntimeFn29.createRuntimeFn)({ defaultClassName: "_1koawa0", variantClassNames: { size: { sm: "_1koawa1", md: "_1koawa2", lg: "_1koawa3" }, resize: { none: "_1koawa4", vertical: "_1koawa5", both: "_1koawa6" } }, defaultVariants: { size: "md", resize: "vertical" }, compoundVariants: [] });
|
|
4236
4328
|
|
|
4237
4329
|
// src/components/Textarea/Textarea.tsx
|
|
4238
|
-
var
|
|
4239
|
-
var Textarea = /* @__PURE__ */ (0,
|
|
4330
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
4331
|
+
var Textarea = /* @__PURE__ */ (0, import_react53.forwardRef)(function Textarea2({
|
|
4240
4332
|
label: label7,
|
|
4241
4333
|
helperText: helperText3,
|
|
4242
4334
|
error,
|
|
@@ -4257,13 +4349,13 @@ var Textarea = /* @__PURE__ */ (0, import_react52.forwardRef)(function Textarea2
|
|
|
4257
4349
|
"aria-describedby": ariaDescribedBy,
|
|
4258
4350
|
...rest
|
|
4259
4351
|
}, ref) {
|
|
4260
|
-
const generatedId = (0,
|
|
4352
|
+
const generatedId = (0, import_react53.useId)();
|
|
4261
4353
|
const textareaId = id ?? generatedId;
|
|
4262
4354
|
const helperId = helperText3 ? `${textareaId}-helper` : void 0;
|
|
4263
|
-
const innerRef = (0,
|
|
4264
|
-
const [uncontrolledLength, setUncontrolledLength] = (0,
|
|
4355
|
+
const innerRef = (0, import_react53.useRef)(null);
|
|
4356
|
+
const [uncontrolledLength, setUncontrolledLength] = (0, import_react53.useState)(() => String(defaultValue ?? "").length);
|
|
4265
4357
|
const length = value4 !== void 0 ? String(value4).length : uncontrolledLength;
|
|
4266
|
-
const fitHeight = (0,
|
|
4358
|
+
const fitHeight = (0, import_react53.useCallback)(() => {
|
|
4267
4359
|
const el = innerRef.current;
|
|
4268
4360
|
if (!autoResize || !el) return;
|
|
4269
4361
|
el.style.height = "auto";
|
|
@@ -4276,12 +4368,12 @@ var Textarea = /* @__PURE__ */ (0, import_react52.forwardRef)(function Textarea2
|
|
|
4276
4368
|
fitHeight();
|
|
4277
4369
|
onChange?.(event);
|
|
4278
4370
|
};
|
|
4279
|
-
return /* @__PURE__ */ (0,
|
|
4280
|
-
label7 && /* @__PURE__ */ (0,
|
|
4371
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
|
|
4372
|
+
label7 && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("label", { htmlFor: textareaId, className: label2, children: [
|
|
4281
4373
|
label7,
|
|
4282
|
-
required && /* @__PURE__ */ (0,
|
|
4374
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
4283
4375
|
] }),
|
|
4284
|
-
/* @__PURE__ */ (0,
|
|
4376
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4285
4377
|
"textarea",
|
|
4286
4378
|
{
|
|
4287
4379
|
ref: mergeRefs(innerRef, ref),
|
|
@@ -4303,51 +4395,51 @@ var Textarea = /* @__PURE__ */ (0, import_react52.forwardRef)(function Textarea2
|
|
|
4303
4395
|
...rest
|
|
4304
4396
|
}
|
|
4305
4397
|
),
|
|
4306
|
-
(helperText3 || showCount) && /* @__PURE__ */ (0,
|
|
4307
|
-
helperText3 && /* @__PURE__ */ (0,
|
|
4308
|
-
showCount && /* @__PURE__ */ (0,
|
|
4398
|
+
(helperText3 || showCount) && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: footer5, children: [
|
|
4399
|
+
helperText3 && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { id: helperId, className: helperText({ error }), children: helperText3 }),
|
|
4400
|
+
showCount && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: cx(count, maxLength !== void 0 && length >= maxLength && countOver), children: maxLength !== void 0 ? `${length}/${maxLength}` : length })
|
|
4309
4401
|
] })
|
|
4310
4402
|
] });
|
|
4311
4403
|
});
|
|
4312
4404
|
|
|
4313
4405
|
// src/components/Toast/Toast.tsx
|
|
4314
4406
|
var RadixToast = __toESM(require("@radix-ui/react-toast"), 1);
|
|
4315
|
-
var
|
|
4316
|
-
var
|
|
4407
|
+
var import_react54 = require("react");
|
|
4408
|
+
var import_icons22 = require("@bestow-ui/icons");
|
|
4317
4409
|
|
|
4318
4410
|
// src/components/Toast/Toast.css.ts
|
|
4319
|
-
var
|
|
4411
|
+
var import_createRuntimeFn30 = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
4320
4412
|
var action2 = "_1g11zvx9";
|
|
4321
4413
|
var close = "_1g11zvxa";
|
|
4322
4414
|
var description7 = "_1g11zvx8";
|
|
4323
4415
|
var title5 = "_1g11zvx7";
|
|
4324
|
-
var toast = /* @__PURE__ */ (0,
|
|
4416
|
+
var toast = /* @__PURE__ */ (0, import_createRuntimeFn30.createRuntimeFn)({ defaultClassName: "_1g11zvx1", variantClassNames: { color: { primary: "_1g11zvx2", neutral: "_1g11zvx3", success: "_1g11zvx4", warning: "_1g11zvx5", danger: "_1g11zvx6" } }, defaultVariants: { color: "neutral" }, compoundVariants: [] });
|
|
4325
4417
|
var viewport2 = "_1g11zvx0";
|
|
4326
4418
|
|
|
4327
4419
|
// src/components/Toast/Toast.tsx
|
|
4328
|
-
var
|
|
4420
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
4329
4421
|
var REMOVE_DELAY = 500;
|
|
4330
|
-
var ToastContext = /* @__PURE__ */ (0,
|
|
4422
|
+
var ToastContext = /* @__PURE__ */ (0, import_react54.createContext)(null);
|
|
4331
4423
|
function ToastProvider({ children, duration = 5e3, label: labelProp }) {
|
|
4332
4424
|
const m = useMessages();
|
|
4333
4425
|
const label7 = labelProp ?? m.notifications ?? "\uC54C\uB9BC";
|
|
4334
|
-
const [toasts, setToasts] = (0,
|
|
4335
|
-
const nextId = (0,
|
|
4426
|
+
const [toasts, setToasts] = (0, import_react54.useState)([]);
|
|
4427
|
+
const nextId = (0, import_react54.useRef)(0);
|
|
4336
4428
|
const portal2 = usePortalProps();
|
|
4337
|
-
const toast2 = (0,
|
|
4429
|
+
const toast2 = (0, import_react54.useCallback)((options) => {
|
|
4338
4430
|
const id = nextId.current++;
|
|
4339
4431
|
setToasts((prev) => [...prev, { ...options, id, open: true }]);
|
|
4340
4432
|
return id;
|
|
4341
4433
|
}, []);
|
|
4342
|
-
const dismiss = (0,
|
|
4434
|
+
const dismiss = (0, import_react54.useCallback)((id) => {
|
|
4343
4435
|
const isTarget = (t) => id === void 0 || t.id === id;
|
|
4344
4436
|
setToasts((prev) => prev.map((t) => isTarget(t) ? { ...t, open: false } : t));
|
|
4345
4437
|
setTimeout(() => setToasts((prev) => prev.filter((t) => t.open || !isTarget(t))), REMOVE_DELAY);
|
|
4346
4438
|
}, []);
|
|
4347
|
-
const value4 = (0,
|
|
4348
|
-
return /* @__PURE__ */ (0,
|
|
4439
|
+
const value4 = (0, import_react54.useMemo)(() => ({ toast: toast2, dismiss }), [toast2, dismiss]);
|
|
4440
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ToastContext.Provider, { value: value4, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(RadixToast.Provider, { duration, label: label7, swipeDirection: "right", children: [
|
|
4349
4441
|
children,
|
|
4350
|
-
toasts.map(({ id, open, title: title6, description: description8, color, duration: itemDuration, action: action3 }) => /* @__PURE__ */ (0,
|
|
4442
|
+
toasts.map(({ id, open, title: title6, description: description8, color, duration: itemDuration, action: action3 }) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
4351
4443
|
RadixToast.Root,
|
|
4352
4444
|
{
|
|
4353
4445
|
open,
|
|
@@ -4357,19 +4449,19 @@ function ToastProvider({ children, duration = 5e3, label: labelProp }) {
|
|
|
4357
4449
|
},
|
|
4358
4450
|
className: toast({ color }),
|
|
4359
4451
|
children: [
|
|
4360
|
-
/* @__PURE__ */ (0,
|
|
4361
|
-
description8 && /* @__PURE__ */ (0,
|
|
4362
|
-
action3 && /* @__PURE__ */ (0,
|
|
4363
|
-
/* @__PURE__ */ (0,
|
|
4452
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(RadixToast.Title, { className: title5, children: title6 }),
|
|
4453
|
+
description8 && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(RadixToast.Description, { className: description7, children: description8 }),
|
|
4454
|
+
action3 && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(RadixToast.Action, { asChild: true, altText: action3.altText ?? action3.label, className: action2, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Button, { size: "sm", variant: "soft", color: "neutral", onClick: action3.onClick, children: action3.label }) }),
|
|
4455
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(RadixToast.Close, { className: close, "aria-label": m.close ?? "\uB2EB\uAE30", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_icons22.XIcon, { size: 16 }) })
|
|
4364
4456
|
]
|
|
4365
4457
|
},
|
|
4366
4458
|
id
|
|
4367
4459
|
)),
|
|
4368
|
-
/* @__PURE__ */ (0,
|
|
4460
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(RadixToast.Viewport, { className: cx(portal2.className, viewport2), style: portal2.style })
|
|
4369
4461
|
] }) });
|
|
4370
4462
|
}
|
|
4371
4463
|
function useToast() {
|
|
4372
|
-
const context = (0,
|
|
4464
|
+
const context = (0, import_react54.useContext)(ToastContext);
|
|
4373
4465
|
if (!context) throw new Error("useToast \uB294 ToastProvider \uC548\uC5D0\uC11C \uC0AC\uC6A9\uD574\uC57C \uD569\uB2C8\uB2E4.");
|
|
4374
4466
|
return context;
|
|
4375
4467
|
}
|
|
@@ -4382,7 +4474,7 @@ var arrow2 = "z7rufs1";
|
|
|
4382
4474
|
var content11 = "z7rufs0";
|
|
4383
4475
|
|
|
4384
4476
|
// src/components/Tooltip/Tooltip.tsx
|
|
4385
|
-
var
|
|
4477
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4386
4478
|
function Tooltip({
|
|
4387
4479
|
content: content12,
|
|
4388
4480
|
children,
|
|
@@ -4397,9 +4489,9 @@ function Tooltip({
|
|
|
4397
4489
|
}) {
|
|
4398
4490
|
const portal2 = usePortalProps();
|
|
4399
4491
|
if (disabled || content12 == null || content12 === "") return children;
|
|
4400
|
-
return /* @__PURE__ */ (0,
|
|
4401
|
-
/* @__PURE__ */ (0,
|
|
4402
|
-
/* @__PURE__ */ (0,
|
|
4492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(RadixTooltip.Provider, { delayDuration: delay, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(RadixTooltip.Root, { open, defaultOpen, onOpenChange, children: [
|
|
4493
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(RadixTooltip.Trigger, { asChild: true, children }),
|
|
4494
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(RadixTooltip.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
4403
4495
|
RadixTooltip.Content,
|
|
4404
4496
|
{
|
|
4405
4497
|
side,
|
|
@@ -4410,7 +4502,7 @@ function Tooltip({
|
|
|
4410
4502
|
style: portal2.style,
|
|
4411
4503
|
children: [
|
|
4412
4504
|
content12,
|
|
4413
|
-
/* @__PURE__ */ (0,
|
|
4505
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(RadixTooltip.Arrow, { className: arrow2, width: 10, height: 5 })
|
|
4414
4506
|
]
|
|
4415
4507
|
}
|
|
4416
4508
|
) })
|
|
@@ -4418,7 +4510,7 @@ function Tooltip({
|
|
|
4418
4510
|
}
|
|
4419
4511
|
|
|
4420
4512
|
// src/components/VerificationCodeInput/VerificationCodeInput.tsx
|
|
4421
|
-
var
|
|
4513
|
+
var import_react55 = require("react");
|
|
4422
4514
|
|
|
4423
4515
|
// src/components/VerificationCodeInput/VerificationCodeInput.css.ts
|
|
4424
4516
|
var input5 = "ea01812";
|
|
@@ -4428,9 +4520,9 @@ var slots = "ea01811";
|
|
|
4428
4520
|
var timer = "ea01814";
|
|
4429
4521
|
|
|
4430
4522
|
// src/components/VerificationCodeInput/VerificationCodeInput.tsx
|
|
4431
|
-
var
|
|
4523
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4432
4524
|
var formatTime = (seconds) => `${String(Math.floor(seconds / 60)).padStart(2, "0")}:${String(seconds % 60).padStart(2, "0")}`;
|
|
4433
|
-
var VerificationCodeInput = /* @__PURE__ */ (0,
|
|
4525
|
+
var VerificationCodeInput = /* @__PURE__ */ (0, import_react55.forwardRef)(
|
|
4434
4526
|
function VerificationCodeInput2(props, ref) {
|
|
4435
4527
|
const {
|
|
4436
4528
|
length = 6,
|
|
@@ -4457,23 +4549,23 @@ var VerificationCodeInput = /* @__PURE__ */ (0, import_react54.forwardRef)(
|
|
|
4457
4549
|
const label7 = labelProp ?? m.verificationCode ?? "\uC778\uC99D\uBC88\uD638";
|
|
4458
4550
|
const resendText = resendTextProp ?? m.resend ?? "\uC7AC\uC804\uC1A1";
|
|
4459
4551
|
const expiredText = expiredTextProp ?? m.verificationExpired ?? "\uC778\uC99D \uC2DC\uAC04\uC774 \uC9C0\uB0AC\uC5B4\uC694. \uC7AC\uC804\uC1A1\uD574 \uC8FC\uC138\uC694.";
|
|
4460
|
-
const generatedId = (0,
|
|
4552
|
+
const generatedId = (0, import_react55.useId)();
|
|
4461
4553
|
const inputId = id ?? generatedId;
|
|
4462
4554
|
const helperId = `${inputId}-helper`;
|
|
4463
4555
|
const statusId = `${inputId}-status`;
|
|
4464
|
-
const inputRef = (0,
|
|
4556
|
+
const inputRef = (0, import_react55.useRef)(null);
|
|
4465
4557
|
const isControlled = "value" in props;
|
|
4466
|
-
const [innerValue, setInnerValue] = (0,
|
|
4558
|
+
const [innerValue, setInnerValue] = (0, import_react55.useState)(defaultValue ?? "");
|
|
4467
4559
|
const code = (isControlled ? value4 ?? "" : innerValue).slice(0, length);
|
|
4468
|
-
const [focused, setFocused] = (0,
|
|
4469
|
-
const [endAt, setEndAt] = (0,
|
|
4470
|
-
const [remaining, setRemaining] = (0,
|
|
4560
|
+
const [focused, setFocused] = (0, import_react55.useState)(false);
|
|
4561
|
+
const [endAt, setEndAt] = (0, import_react55.useState)(() => expiresIn ? Date.now() + expiresIn * 1e3 : null);
|
|
4562
|
+
const [remaining, setRemaining] = (0, import_react55.useState)(expiresIn ?? 0);
|
|
4471
4563
|
const expired = expiresIn !== void 0 && remaining <= 0;
|
|
4472
|
-
const onExpireRef = (0,
|
|
4473
|
-
(0,
|
|
4564
|
+
const onExpireRef = (0, import_react55.useRef)(onExpire);
|
|
4565
|
+
(0, import_react55.useEffect)(() => {
|
|
4474
4566
|
onExpireRef.current = onExpire;
|
|
4475
4567
|
});
|
|
4476
|
-
(0,
|
|
4568
|
+
(0, import_react55.useEffect)(() => {
|
|
4477
4569
|
if (endAt === null) return;
|
|
4478
4570
|
const tick = () => {
|
|
4479
4571
|
const left = Math.max(0, Math.ceil((endAt - Date.now()) / 1e3));
|
|
@@ -4508,17 +4600,17 @@ var VerificationCodeInput = /* @__PURE__ */ (0, import_react54.forwardRef)(
|
|
|
4508
4600
|
};
|
|
4509
4601
|
const description8 = helperText3 ?? m.verificationCodeHint?.(length, type) ?? `${length}\uC790\uB9AC ${type === "numeric" ? "\uC22B\uC790" : "\uBB38\uC790"}\uB97C \uC785\uB825\uD558\uC138\uC694.`;
|
|
4510
4602
|
const activeIndex = Math.min(code.length, length - 1);
|
|
4511
|
-
return /* @__PURE__ */ (0,
|
|
4603
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
4512
4604
|
"div",
|
|
4513
4605
|
{
|
|
4514
4606
|
className: cx(field, className),
|
|
4515
4607
|
"data-invalid": error || void 0,
|
|
4516
4608
|
"data-disabled": disabled || void 0,
|
|
4517
4609
|
children: [
|
|
4518
|
-
/* @__PURE__ */ (0,
|
|
4519
|
-
/* @__PURE__ */ (0,
|
|
4520
|
-
/* @__PURE__ */ (0,
|
|
4521
|
-
/* @__PURE__ */ (0,
|
|
4610
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("label", { htmlFor: inputId, className: label2, children: label7 }),
|
|
4611
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: row4, children: [
|
|
4612
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: slots, children: [
|
|
4613
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4522
4614
|
"input",
|
|
4523
4615
|
{
|
|
4524
4616
|
ref: mergeRefs(ref, inputRef),
|
|
@@ -4538,7 +4630,7 @@ var VerificationCodeInput = /* @__PURE__ */ (0, import_react54.forwardRef)(
|
|
|
4538
4630
|
className: input5
|
|
4539
4631
|
}
|
|
4540
4632
|
),
|
|
4541
|
-
Array.from({ length }, (_, index) => /* @__PURE__ */ (0,
|
|
4633
|
+
Array.from({ length }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4542
4634
|
"div",
|
|
4543
4635
|
{
|
|
4544
4636
|
className: slot,
|
|
@@ -4549,12 +4641,12 @@ var VerificationCodeInput = /* @__PURE__ */ (0, import_react54.forwardRef)(
|
|
|
4549
4641
|
index
|
|
4550
4642
|
))
|
|
4551
4643
|
] }),
|
|
4552
|
-
expiresIn !== void 0 && /* @__PURE__ */ (0,
|
|
4553
|
-
onResend && /* @__PURE__ */ (0,
|
|
4644
|
+
expiresIn !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { role: "timer", className: timer, children: formatTime(remaining) }),
|
|
4645
|
+
onResend && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Button, { size: "sm", variant: "outline", color: "neutral", onClick: resend, disabled, children: resendText })
|
|
4554
4646
|
] }),
|
|
4555
|
-
/* @__PURE__ */ (0,
|
|
4556
|
-
/* @__PURE__ */ (0,
|
|
4557
|
-
name && /* @__PURE__ */ (0,
|
|
4647
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { id: helperId, className: helperText({ error }), children: description8 }),
|
|
4648
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { id: statusId, role: "status", className: helperText({ error: true }), children: expired ? expiredText : "" }),
|
|
4649
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("input", { type: "hidden", name, value: code })
|
|
4558
4650
|
]
|
|
4559
4651
|
}
|
|
4560
4652
|
);
|
|
@@ -4607,6 +4699,7 @@ var VerificationCodeInput = /* @__PURE__ */ (0, import_react54.forwardRef)(
|
|
|
4607
4699
|
LocaleProvider,
|
|
4608
4700
|
Modal,
|
|
4609
4701
|
ModalClose,
|
|
4702
|
+
NativeSelect,
|
|
4610
4703
|
NumberInput,
|
|
4611
4704
|
Pagination,
|
|
4612
4705
|
PhoneNumberInput,
|