@bestow-ui/react 1.4.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 +10 -4
- package/dist/{chunk-TIFI6ZQU.js → chunk-NKLDAXUR.js} +3 -78
- package/dist/chunk-NKLDAXUR.js.map +1 -0
- package/dist/client.js +395 -213
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +428 -302
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +82 -6
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +46 -48
- package/dist/index.d.ts +46 -48
- package/dist/shared.js +14 -8
- package/dist/shared.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-TIFI6ZQU.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,
|
|
@@ -143,7 +144,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
143
144
|
|
|
144
145
|
// src/theme/contract.css.ts
|
|
145
146
|
var themeClass = { light: "tkagtb0", dark: "tkagtb1" };
|
|
146
|
-
var vars = { space: { "0": "var(--bestow-space-0)", "1": "var(--bestow-space-1)", "2": "var(--bestow-space-2)", "3": "var(--bestow-space-3)", "4": "var(--bestow-space-4)", "5": "var(--bestow-space-5)", "6": "var(--bestow-space-6)", "8": "var(--bestow-space-8)", "10": "var(--bestow-space-10)", "12": "var(--bestow-space-12)", "16": "var(--bestow-space-16)" }, radius: { none: "var(--bestow-radius-none)", sm: "var(--bestow-radius-sm)", md: "var(--bestow-radius-md)", lg: "var(--bestow-radius-lg)", xl: "var(--bestow-radius-xl)", full: "var(--bestow-radius-full)" }, font: { family: { sans: "var(--bestow-font-family-sans)", mono: "var(--bestow-font-family-mono)" }, size: { xs: "var(--bestow-font-size-xs)", sm: "var(--bestow-font-size-sm)", md: "var(--bestow-font-size-md)", lg: "var(--bestow-font-size-lg)", xl: "var(--bestow-font-size-xl)", "2xl": "var(--bestow-font-size-2xl)", "3xl": "var(--bestow-font-size-3xl)", "4xl": "var(--bestow-font-size-4xl)" }, weight: { regular: "var(--bestow-font-weight-regular)", medium: "var(--bestow-font-weight-medium)", semibold: "var(--bestow-font-weight-semibold)", bold: "var(--bestow-font-weight-bold)" }, lineHeight: { tight: "var(--bestow-font-line-height-tight)", normal: "var(--bestow-font-line-height-normal)", relaxed: "var(--bestow-font-line-height-relaxed)" } }, duration: { fast: "var(--bestow-duration-fast)", normal: "var(--bestow-duration-normal)", slow: "var(--bestow-duration-slow)" }, zIndex: { overlay: "var(--bestow-z-index-overlay)", modal: "var(--bestow-z-index-modal)", dropdown: "var(--bestow-z-index-dropdown)", toast: "var(--bestow-z-index-toast)", tooltip: "var(--bestow-z-index-tooltip)" }, color: { bg: { "default": "var(--bestow-color-bg-default)", subtle: "var(--bestow-color-bg-subtle)", muted: "var(--bestow-color-bg-muted)", inverse: "var(--bestow-color-bg-inverse)", overlay: "var(--bestow-color-bg-overlay)" }, fg: { "default": "var(--bestow-color-fg-default)", muted: "var(--bestow-color-fg-muted)", subtle: "var(--bestow-color-fg-subtle)", inverse: "var(--bestow-color-fg-inverse)" }, border: { "default": "var(--bestow-color-border-default)", strong: "var(--bestow-color-border-strong)", focus: "var(--bestow-color-border-focus)", input: "var(--bestow-color-border-input)", inputHover: "var(--bestow-color-border-input-hover)" }, primary: { solid: "var(--bestow-color-primary-solid)", solidHover: "var(--bestow-color-primary-solid-hover)", contrast: "var(--bestow-color-primary-contrast)", subtle: "var(--bestow-color-primary-subtle)", subtleHover: "var(--bestow-color-primary-subtle-hover)", text: "var(--bestow-color-primary-text)" }, neutral: { solid: "var(--bestow-color-neutral-solid)", solidHover: "var(--bestow-color-neutral-solid-hover)", contrast: "var(--bestow-color-neutral-contrast)", subtle: "var(--bestow-color-neutral-subtle)", subtleHover: "var(--bestow-color-neutral-subtle-hover)", text: "var(--bestow-color-neutral-text)" }, danger: { solid: "var(--bestow-color-danger-solid)", solidHover: "var(--bestow-color-danger-solid-hover)", contrast: "var(--bestow-color-danger-contrast)", subtle: "var(--bestow-color-danger-subtle)", subtleHover: "var(--bestow-color-danger-subtle-hover)", text: "var(--bestow-color-danger-text)" }, success: { solid: "var(--bestow-color-success-solid)", solidHover: "var(--bestow-color-success-solid-hover)", contrast: "var(--bestow-color-success-contrast)", subtle: "var(--bestow-color-success-subtle)", subtleHover: "var(--bestow-color-success-subtle-hover)", text: "var(--bestow-color-success-text)" }, warning: { solid: "var(--bestow-color-warning-solid)", solidHover: "var(--bestow-color-warning-solid-hover)", contrast: "var(--bestow-color-warning-contrast)", subtle: "var(--bestow-color-warning-subtle)", subtleHover: "var(--bestow-color-warning-subtle-hover)", text: "var(--bestow-color-warning-text)" } }, shadow: { sm: "var(--bestow-shadow-sm)", md: "var(--bestow-shadow-md)", lg: "var(--bestow-shadow-lg)" } };
|
|
147
|
+
var vars = { space: { "0": "var(--bestow-space-0)", "1": "var(--bestow-space-1)", "2": "var(--bestow-space-2)", "3": "var(--bestow-space-3)", "4": "var(--bestow-space-4)", "5": "var(--bestow-space-5)", "6": "var(--bestow-space-6)", "8": "var(--bestow-space-8)", "10": "var(--bestow-space-10)", "12": "var(--bestow-space-12)", "16": "var(--bestow-space-16)" }, radius: { none: "var(--bestow-radius-none)", sm: "var(--bestow-radius-sm)", md: "var(--bestow-radius-md)", lg: "var(--bestow-radius-lg)", xl: "var(--bestow-radius-xl)", full: "var(--bestow-radius-full)" }, font: { family: { sans: "var(--bestow-font-family-sans)", mono: "var(--bestow-font-family-mono)" }, size: { xs: "var(--bestow-font-size-xs)", sm: "var(--bestow-font-size-sm)", md: "var(--bestow-font-size-md)", lg: "var(--bestow-font-size-lg)", xl: "var(--bestow-font-size-xl)", "2xl": "var(--bestow-font-size-2xl)", "3xl": "var(--bestow-font-size-3xl)", "4xl": "var(--bestow-font-size-4xl)" }, weight: { regular: "var(--bestow-font-weight-regular)", medium: "var(--bestow-font-weight-medium)", semibold: "var(--bestow-font-weight-semibold)", bold: "var(--bestow-font-weight-bold)" }, lineHeight: { tight: "var(--bestow-font-line-height-tight)", normal: "var(--bestow-font-line-height-normal)", relaxed: "var(--bestow-font-line-height-relaxed)" } }, duration: { fast: "var(--bestow-duration-fast)", normal: "var(--bestow-duration-normal)", slow: "var(--bestow-duration-slow)" }, zIndex: { overlay: "var(--bestow-z-index-overlay)", modal: "var(--bestow-z-index-modal)", dropdown: "var(--bestow-z-index-dropdown)", toast: "var(--bestow-z-index-toast)", tooltip: "var(--bestow-z-index-tooltip)" }, color: { bg: { "default": "var(--bestow-color-bg-default)", subtle: "var(--bestow-color-bg-subtle)", muted: "var(--bestow-color-bg-muted)", inverse: "var(--bestow-color-bg-inverse)", overlay: "var(--bestow-color-bg-overlay)" }, fg: { "default": "var(--bestow-color-fg-default)", muted: "var(--bestow-color-fg-muted)", subtle: "var(--bestow-color-fg-subtle)", inverse: "var(--bestow-color-fg-inverse)" }, border: { "default": "var(--bestow-color-border-default)", strong: "var(--bestow-color-border-strong)", focus: "var(--bestow-color-border-focus)", input: "var(--bestow-color-border-input)", inputHover: "var(--bestow-color-border-input-hover)", control: "var(--bestow-color-border-control)" }, primary: { solid: "var(--bestow-color-primary-solid)", solidHover: "var(--bestow-color-primary-solid-hover)", contrast: "var(--bestow-color-primary-contrast)", subtle: "var(--bestow-color-primary-subtle)", subtleHover: "var(--bestow-color-primary-subtle-hover)", text: "var(--bestow-color-primary-text)" }, neutral: { solid: "var(--bestow-color-neutral-solid)", solidHover: "var(--bestow-color-neutral-solid-hover)", contrast: "var(--bestow-color-neutral-contrast)", subtle: "var(--bestow-color-neutral-subtle)", subtleHover: "var(--bestow-color-neutral-subtle-hover)", text: "var(--bestow-color-neutral-text)" }, danger: { solid: "var(--bestow-color-danger-solid)", solidHover: "var(--bestow-color-danger-solid-hover)", contrast: "var(--bestow-color-danger-contrast)", subtle: "var(--bestow-color-danger-subtle)", subtleHover: "var(--bestow-color-danger-subtle-hover)", text: "var(--bestow-color-danger-text)" }, success: { solid: "var(--bestow-color-success-solid)", solidHover: "var(--bestow-color-success-solid-hover)", contrast: "var(--bestow-color-success-contrast)", subtle: "var(--bestow-color-success-subtle)", subtleHover: "var(--bestow-color-success-subtle-hover)", text: "var(--bestow-color-success-text)" }, warning: { solid: "var(--bestow-color-warning-solid)", solidHover: "var(--bestow-color-warning-solid-hover)", contrast: "var(--bestow-color-warning-contrast)", subtle: "var(--bestow-color-warning-subtle)", subtleHover: "var(--bestow-color-warning-subtle-hover)", text: "var(--bestow-color-warning-text)" } }, shadow: { sm: "var(--bestow-shadow-sm)", md: "var(--bestow-shadow-md)", lg: "var(--bestow-shadow-lg)" } };
|
|
147
148
|
|
|
148
149
|
// src/theme/color.ts
|
|
149
150
|
var import_tokens = require("@bestow-ui/tokens");
|
|
@@ -326,9 +327,11 @@ function themeToStyle(theme, mode) {
|
|
|
326
327
|
// src/theme/presets.ts
|
|
327
328
|
var strongInputBorders = /* @__PURE__ */ Object.freeze({
|
|
328
329
|
// 라이트: gray600 / gray700 — 흰 배경 5.18:1, bg.subtle(gray50) 4.91:1
|
|
329
|
-
|
|
330
|
+
// 체크 컨트롤: gray600 — 흰 배경 5.18:1
|
|
331
|
+
light: { color: { border: { input: "#666e76", inputHover: "#495057", control: "#666e76" } } },
|
|
330
332
|
// 다크: gray500 / gray300 — gray600 은 bg.subtle(gray900) 위에서 2.98:1 이라 한 단계 밝게. bg.default 8.57:1, bg.subtle 7.43:1
|
|
331
|
-
|
|
333
|
+
// 체크 컨트롤: gray500 — 다크 기본값(border.strong)과 같다(이미 8.57:1)
|
|
334
|
+
dark: { color: { border: { input: "#adb5bd", inputHover: "#dee2e6", control: "#adb5bd" } } }
|
|
332
335
|
});
|
|
333
336
|
|
|
334
337
|
// src/i18n/en.ts
|
|
@@ -421,62 +424,8 @@ var en = {
|
|
|
421
424
|
dateIncomplete: "Enter the date as YYYY-MM-DD."
|
|
422
425
|
};
|
|
423
426
|
|
|
424
|
-
// src/
|
|
425
|
-
var
|
|
426
|
-
function phoneNumberMaxDigits(digits) {
|
|
427
|
-
if (digits.startsWith("02")) return 10;
|
|
428
|
-
if (/^1[568]/.test(digits)) return 8;
|
|
429
|
-
return 11;
|
|
430
|
-
}
|
|
431
|
-
function formatPhoneNumber(input6) {
|
|
432
|
-
const d = onlyDigits(input6).slice(0, phoneNumberMaxDigits(onlyDigits(input6)));
|
|
433
|
-
if (d.startsWith("02")) {
|
|
434
|
-
if (d.length <= 2) return d;
|
|
435
|
-
if (d.length <= 5) return `${d.slice(0, 2)}-${d.slice(2)}`;
|
|
436
|
-
if (d.length <= 9) return `${d.slice(0, 2)}-${d.slice(2, 5)}-${d.slice(5)}`;
|
|
437
|
-
return `${d.slice(0, 2)}-${d.slice(2, 6)}-${d.slice(6)}`;
|
|
438
|
-
}
|
|
439
|
-
if (/^1[568]/.test(d)) {
|
|
440
|
-
return d.length <= 4 ? d : `${d.slice(0, 4)}-${d.slice(4)}`;
|
|
441
|
-
}
|
|
442
|
-
if (d.length <= 3) return d;
|
|
443
|
-
if (d.length <= 6) return `${d.slice(0, 3)}-${d.slice(3)}`;
|
|
444
|
-
if (d.length <= 10) return `${d.slice(0, 3)}-${d.slice(3, 6)}-${d.slice(6)}`;
|
|
445
|
-
return `${d.slice(0, 3)}-${d.slice(3, 7)}-${d.slice(7)}`;
|
|
446
|
-
}
|
|
447
|
-
function formatBusinessNumber(input6) {
|
|
448
|
-
const d = onlyDigits(input6).slice(0, 10);
|
|
449
|
-
if (d.length <= 3) return d;
|
|
450
|
-
if (d.length <= 5) return `${d.slice(0, 3)}-${d.slice(3)}`;
|
|
451
|
-
return `${d.slice(0, 3)}-${d.slice(3, 5)}-${d.slice(5)}`;
|
|
452
|
-
}
|
|
453
|
-
function isValidBusinessNumber(input6) {
|
|
454
|
-
const d = onlyDigits(input6);
|
|
455
|
-
if (d.length !== 10) return false;
|
|
456
|
-
const weights = [1, 3, 7, 1, 3, 7, 1, 3, 5];
|
|
457
|
-
const digits = [...d].map(Number);
|
|
458
|
-
let sum = weights.reduce((acc, w, i) => acc + w * digits[i], 0);
|
|
459
|
-
sum += Math.floor(digits[8] * 5 / 10);
|
|
460
|
-
return (10 - sum % 10) % 10 === digits[9];
|
|
461
|
-
}
|
|
462
|
-
function formatKoreanAmount(amount, unit2 = "\uC6D0") {
|
|
463
|
-
const n = Math.floor(Math.abs(amount));
|
|
464
|
-
if (n === 0) return `0${unit2}`;
|
|
465
|
-
const units = [
|
|
466
|
-
{ value: 1e12, label: "\uC870" },
|
|
467
|
-
{ value: 1e8, label: "\uC5B5" },
|
|
468
|
-
{ value: 1e4, label: "\uB9CC" },
|
|
469
|
-
{ value: 1, label: "" }
|
|
470
|
-
];
|
|
471
|
-
let rest = n;
|
|
472
|
-
const parts = [];
|
|
473
|
-
for (const u of units) {
|
|
474
|
-
const q = Math.floor(rest / u.value);
|
|
475
|
-
rest %= u.value;
|
|
476
|
-
if (q > 0) parts.push(`${q.toLocaleString("ko-KR")}${u.label}`);
|
|
477
|
-
}
|
|
478
|
-
return `${amount < 0 ? "-" : ""}${parts.join(" ")}${unit2}`;
|
|
479
|
-
}
|
|
427
|
+
// src/shared.ts
|
|
428
|
+
var import_korean_utils2 = require("@bestow-ui/korean-utils");
|
|
480
429
|
|
|
481
430
|
// src/utils/date.ts
|
|
482
431
|
var pad = (n) => String(n).padStart(2, "0");
|
|
@@ -514,13 +463,9 @@ function getCalendarWeeks(year, month) {
|
|
|
514
463
|
const start = addDays(first, -first.getDay());
|
|
515
464
|
return Array.from({ length: 6 }, (_, week) => Array.from({ length: 7 }, (_2, day2) => addDays(start, week * 7 + day2)));
|
|
516
465
|
}
|
|
517
|
-
var KOREAN_WEEKDAYS = ["\uC77C", "\uC6D4", "\uD654", "\uC218", "\uBAA9", "\uAE08", "\uD1A0"];
|
|
518
|
-
function formatKoreanDate(date, withWeekday = true) {
|
|
519
|
-
const base = `${date.getFullYear()}\uB144 ${date.getMonth() + 1}\uC6D4 ${date.getDate()}\uC77C`;
|
|
520
|
-
return withWeekday ? `${base} ${KOREAN_WEEKDAYS[date.getDay()]}\uC694\uC77C` : base;
|
|
521
|
-
}
|
|
522
466
|
|
|
523
467
|
// src/components/AddressInput/addressProviders.ts
|
|
468
|
+
var import_korean_utils = require("@bestow-ui/korean-utils");
|
|
524
469
|
var KAKAO_POSTCODE_SRC = "https://t1.kakaocdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js";
|
|
525
470
|
var loading = null;
|
|
526
471
|
function loadKakaoPostcode() {
|
|
@@ -544,13 +489,6 @@ function loadKakaoPostcode() {
|
|
|
544
489
|
}));
|
|
545
490
|
return loading;
|
|
546
491
|
}
|
|
547
|
-
function composeExtraAddress(data) {
|
|
548
|
-
if (data.userSelectedType !== "R") return "";
|
|
549
|
-
const parts = [];
|
|
550
|
-
if (data.bname && /[동로가]$/.test(data.bname)) parts.push(data.bname);
|
|
551
|
-
if (data.buildingName && data.apartment === "Y") parts.push(data.buildingName);
|
|
552
|
-
return parts.length ? ` (${parts.join(", ")})` : "";
|
|
553
|
-
}
|
|
554
492
|
var kakaoPostcodeProvider = async (container2, onSelect) => {
|
|
555
493
|
const Postcode = await loadKakaoPostcode();
|
|
556
494
|
new Postcode({
|
|
@@ -558,7 +496,7 @@ var kakaoPostcodeProvider = async (container2, onSelect) => {
|
|
|
558
496
|
height: "100%",
|
|
559
497
|
oncomplete: (data) => {
|
|
560
498
|
const address = data.userSelectedType === "R" ? data.roadAddress : data.jibunAddress || data.autoJibunAddress || "";
|
|
561
|
-
onSelect({ zonecode: data.zonecode, address, extraAddress: composeExtraAddress(data) });
|
|
499
|
+
onSelect({ zonecode: data.zonecode, address, extraAddress: (0, import_korean_utils.composeExtraAddress)(data) });
|
|
562
500
|
}
|
|
563
501
|
}).embed(container2);
|
|
564
502
|
};
|
|
@@ -1580,7 +1518,7 @@ var Alert = /* @__PURE__ */ (0, import_react21.forwardRef)(function Alert2({
|
|
|
1580
1518
|
variant,
|
|
1581
1519
|
color = "primary",
|
|
1582
1520
|
title: title6,
|
|
1583
|
-
icon:
|
|
1521
|
+
icon: icon8,
|
|
1584
1522
|
action: action3,
|
|
1585
1523
|
onClose,
|
|
1586
1524
|
closeLabel: closeLabelProp,
|
|
@@ -1591,7 +1529,7 @@ var Alert = /* @__PURE__ */ (0, import_react21.forwardRef)(function Alert2({
|
|
|
1591
1529
|
const m = useMessages();
|
|
1592
1530
|
const closeLabel = closeLabelProp ?? m.close ?? "\uB2EB\uAE30";
|
|
1593
1531
|
const DefaultIcon = defaultIcons[color];
|
|
1594
|
-
const iconNode =
|
|
1532
|
+
const iconNode = icon8 === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DefaultIcon, { size: 18 }) : icon8;
|
|
1595
1533
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { ref, className: cx(alert({ variant, color }), className), ...rest, children: [
|
|
1596
1534
|
iconNode !== false && iconNode !== null && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: icon3, "aria-hidden": true, children: iconNode }),
|
|
1597
1535
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: content4, children: [
|
|
@@ -1605,6 +1543,7 @@ var Alert = /* @__PURE__ */ (0, import_react21.forwardRef)(function Alert2({
|
|
|
1605
1543
|
|
|
1606
1544
|
// src/components/AmountInput/AmountInput.tsx
|
|
1607
1545
|
var import_react24 = require("react");
|
|
1546
|
+
var import_korean_utils3 = require("@bestow-ui/korean-utils");
|
|
1608
1547
|
|
|
1609
1548
|
// src/utils/useFormattedInput.ts
|
|
1610
1549
|
var import_react23 = require("react");
|
|
@@ -1719,7 +1658,7 @@ var AmountInput = /* @__PURE__ */ (0, import_react24.forwardRef)(
|
|
|
1719
1658
|
isMeaningful: isDigit,
|
|
1720
1659
|
inputRef
|
|
1721
1660
|
});
|
|
1722
|
-
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;
|
|
1723
1662
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1724
1663
|
TextField,
|
|
1725
1664
|
{
|
|
@@ -1856,6 +1795,7 @@ var Breadcrumb = /* @__PURE__ */ (0, import_react27.forwardRef)(function Breadcr
|
|
|
1856
1795
|
|
|
1857
1796
|
// src/components/BusinessNumberInput/BusinessNumberInput.tsx
|
|
1858
1797
|
var import_react28 = require("react");
|
|
1798
|
+
var import_korean_utils4 = require("@bestow-ui/korean-utils");
|
|
1859
1799
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1860
1800
|
var sanitize = (input6) => input6.replace(/\D/g, "").slice(0, 10);
|
|
1861
1801
|
var isDigit2 = (char) => /\d/.test(char);
|
|
@@ -1885,14 +1825,14 @@ var BusinessNumberInput = /* @__PURE__ */ (0, import_react28.forwardRef)(
|
|
|
1885
1825
|
isControlled: "value" in props,
|
|
1886
1826
|
value: value4,
|
|
1887
1827
|
defaultValue,
|
|
1888
|
-
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),
|
|
1889
1829
|
sanitize,
|
|
1890
|
-
format: formatBusinessNumber,
|
|
1830
|
+
format: import_korean_utils4.formatBusinessNumber,
|
|
1891
1831
|
isMeaningful: isDigit2,
|
|
1892
1832
|
inputRef
|
|
1893
1833
|
});
|
|
1894
1834
|
const complete = field4.raw.length === 10;
|
|
1895
|
-
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);
|
|
1896
1836
|
const showAuto = autoInvalid && error === void 0;
|
|
1897
1837
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1898
1838
|
TextField,
|
|
@@ -1922,6 +1862,7 @@ var BusinessNumberInput = /* @__PURE__ */ (0, import_react28.forwardRef)(
|
|
|
1922
1862
|
// src/components/Calendar/Calendar.tsx
|
|
1923
1863
|
var import_react31 = require("react");
|
|
1924
1864
|
var import_icons9 = require("@bestow-ui/icons");
|
|
1865
|
+
var import_korean_utils5 = require("@bestow-ui/korean-utils");
|
|
1925
1866
|
|
|
1926
1867
|
// src/utils/useIsClient.ts
|
|
1927
1868
|
var import_react29 = require("react");
|
|
@@ -1989,8 +1930,8 @@ var Calendar = /* @__PURE__ */ (0, import_react31.forwardRef)(function Calendar2
|
|
|
1989
1930
|
const m = useMessages();
|
|
1990
1931
|
const prevMonthLabel = prevMonthLabelProp ?? m.previousMonth ?? "\uC774\uC804 \uB2EC";
|
|
1991
1932
|
const nextMonthLabel = nextMonthLabelProp ?? m.nextMonth ?? "\uB2E4\uC74C \uB2EC";
|
|
1992
|
-
const weekdaysShort = m.weekdaysShort ?? KOREAN_WEEKDAYS;
|
|
1993
|
-
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`);
|
|
1994
1935
|
const headingId = (0, import_react31.useId)();
|
|
1995
1936
|
const gridRef = (0, import_react31.useRef)(null);
|
|
1996
1937
|
const isControlled = "value" in props;
|
|
@@ -2024,7 +1965,7 @@ var Calendar = /* @__PURE__ */ (0, import_react31.forwardRef)(function Calendar2
|
|
|
2024
1965
|
moveFocus.current = true;
|
|
2025
1966
|
setFocused(clamp(date));
|
|
2026
1967
|
};
|
|
2027
|
-
const
|
|
1968
|
+
const select2 = (date) => {
|
|
2028
1969
|
if (isDisabled(date)) return;
|
|
2029
1970
|
const iso = toISODate(date);
|
|
2030
1971
|
if (!isControlled) setInnerValue(iso);
|
|
@@ -2107,7 +2048,7 @@ var Calendar = /* @__PURE__ */ (0, import_react31.forwardRef)(function Calendar2
|
|
|
2107
2048
|
"aria-label": label7,
|
|
2108
2049
|
"aria-current": isToday ? "date" : void 0,
|
|
2109
2050
|
"aria-disabled": disabled || void 0,
|
|
2110
|
-
onClick: () =>
|
|
2051
|
+
onClick: () => select2(date),
|
|
2111
2052
|
onFocus: () => !isSameDay(date, focused) && setFocused(date),
|
|
2112
2053
|
children: date.getDate()
|
|
2113
2054
|
}
|
|
@@ -2139,6 +2080,7 @@ var toggle2 = "c2pbq71 c2pbq70";
|
|
|
2139
2080
|
|
|
2140
2081
|
// src/components/Combobox/Combobox.tsx
|
|
2141
2082
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2083
|
+
var NO_RESULTS_ANNOUNCE_DELAY = 800;
|
|
2142
2084
|
var defaultFilter = (option2, query) => option2.label.toLowerCase().includes(query.trim().toLowerCase());
|
|
2143
2085
|
var Combobox = /* @__PURE__ */ (0, import_react32.forwardRef)(function Combobox2(props, ref) {
|
|
2144
2086
|
const {
|
|
@@ -2210,7 +2152,7 @@ var Combobox = /* @__PURE__ */ (0, import_react32.forwardRef)(function Combobox2
|
|
|
2210
2152
|
if (query === "" && selectedValue) clearSelection();
|
|
2211
2153
|
reset();
|
|
2212
2154
|
};
|
|
2213
|
-
const
|
|
2155
|
+
const select2 = (option2) => {
|
|
2214
2156
|
if (option2.disabled) return;
|
|
2215
2157
|
if (!isControlled) setInnerValue(option2.value);
|
|
2216
2158
|
if (option2.value !== selectedValue) onValueChange?.(option2.value);
|
|
@@ -2244,7 +2186,7 @@ var Combobox = /* @__PURE__ */ (0, import_react32.forwardRef)(function Combobox2
|
|
|
2244
2186
|
if (open) {
|
|
2245
2187
|
event.preventDefault();
|
|
2246
2188
|
const option2 = filtered[activeIndex];
|
|
2247
|
-
if (option2)
|
|
2189
|
+
if (option2) select2(option2);
|
|
2248
2190
|
else close2();
|
|
2249
2191
|
}
|
|
2250
2192
|
break;
|
|
@@ -2264,6 +2206,14 @@ var Combobox = /* @__PURE__ */ (0, import_react32.forwardRef)(function Combobox2
|
|
|
2264
2206
|
document.getElementById(optionId(activeIndex))?.scrollIntoView?.({ block: "nearest" });
|
|
2265
2207
|
}, [open, activeIndex]);
|
|
2266
2208
|
const hasOptions = filtered.length > 0;
|
|
2209
|
+
const noResults = open && !disabled && !hasOptions;
|
|
2210
|
+
const [announcedFor, setAnnouncedFor] = (0, import_react32.useState)(void 0);
|
|
2211
|
+
(0, import_react32.useEffect)(() => {
|
|
2212
|
+
if (!noResults) return;
|
|
2213
|
+
const timer2 = setTimeout(() => setAnnouncedFor(query), NO_RESULTS_ANNOUNCE_DELAY);
|
|
2214
|
+
return () => clearTimeout(timer2);
|
|
2215
|
+
}, [noResults, query]);
|
|
2216
|
+
const announceNoResults = noResults && announcedFor === query;
|
|
2267
2217
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
|
|
2268
2218
|
label7 && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("label", { id: labelId, htmlFor: inputId, className: label2, children: [
|
|
2269
2219
|
label7,
|
|
@@ -2382,7 +2332,7 @@ var Combobox = /* @__PURE__ */ (0, import_react32.forwardRef)(function Combobox2
|
|
|
2382
2332
|
className: item5,
|
|
2383
2333
|
onMouseDown: (event) => event.preventDefault(),
|
|
2384
2334
|
onMouseMove: () => !option2.disabled && setActiveIndex(index),
|
|
2385
|
-
onClick: () =>
|
|
2335
|
+
onClick: () => select2(option2),
|
|
2386
2336
|
children: [
|
|
2387
2337
|
option2.label,
|
|
2388
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 }) })
|
|
@@ -2393,10 +2343,14 @@ var Combobox = /* @__PURE__ */ (0, import_react32.forwardRef)(function Combobox2
|
|
|
2393
2343
|
);
|
|
2394
2344
|
})
|
|
2395
2345
|
}
|
|
2396
|
-
) :
|
|
2346
|
+
) : (
|
|
2347
|
+
// 스크린리더 알림은 아래의 항상 있는 status 영역이 맡는다 (여기는 화면 표시만)
|
|
2348
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: empty, children: emptyMessage })
|
|
2349
|
+
)
|
|
2397
2350
|
}
|
|
2398
2351
|
) })
|
|
2399
2352
|
] }),
|
|
2353
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { role: "status", className: visuallyHidden, children: announceNoResults ? emptyMessage : "" }),
|
|
2400
2354
|
name && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("input", { type: "hidden", name, value: selectedValue ?? "" }),
|
|
2401
2355
|
helperText3 && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { id: helperId, className: helperText({ error }), children: helperText3 })
|
|
2402
2356
|
] });
|
|
@@ -2863,6 +2817,7 @@ var root10 = "r2jefr0";
|
|
|
2863
2817
|
|
|
2864
2818
|
// src/components/FileUpload/FileUpload.tsx
|
|
2865
2819
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2820
|
+
var REMOVED_ANNOUNCE_DELAY = 500;
|
|
2866
2821
|
function formatSize(bytes) {
|
|
2867
2822
|
if (bytes < 1024) return `${bytes} B`;
|
|
2868
2823
|
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(bytes < 10 * 1024 ? 1 : 0)} KB`;
|
|
@@ -2913,6 +2868,8 @@ var FileUpload = /* @__PURE__ */ (0, import_react37.forwardRef)(function FileUpl
|
|
|
2913
2868
|
const selectButtonRef = (0, import_react37.useRef)(null);
|
|
2914
2869
|
const removeButtonRefs = (0, import_react37.useRef)([]);
|
|
2915
2870
|
const focusAfterRemove = (0, import_react37.useRef)(null);
|
|
2871
|
+
const announceTimer = (0, import_react37.useRef)(void 0);
|
|
2872
|
+
(0, import_react37.useEffect)(() => () => clearTimeout(announceTimer.current), []);
|
|
2916
2873
|
const selectLabel = m.fileSelect ?? "\uD30C\uC77C \uC120\uD0DD";
|
|
2917
2874
|
const reasonText = (rejection) => {
|
|
2918
2875
|
const fileName2 = rejection.file.name;
|
|
@@ -2921,10 +2878,16 @@ var FileUpload = /* @__PURE__ */ (0, import_react37.forwardRef)(function FileUpl
|
|
|
2921
2878
|
if (rejection.reason === "type") return m.fileTypeNotAllowed?.(fileName2) ?? `${fileName2}: \uC62C\uB9B4 \uC218 \uC5C6\uB294 \uD615\uC2DD\uC774\uC5D0\uC694.`;
|
|
2922
2879
|
return m.fileTooMany?.(maxFiles ?? 0) ?? `\uD30C\uC77C\uC740 ${maxFiles}\uAC1C\uAE4C\uC9C0 \uC62C\uB9B4 \uC218 \uC788\uC5B4\uC694.`;
|
|
2923
2880
|
};
|
|
2924
|
-
const
|
|
2881
|
+
const announce = (message, delay = 0) => {
|
|
2882
|
+
clearTimeout(announceTimer.current);
|
|
2883
|
+
if (delay === 0) return setAnnouncement(message);
|
|
2884
|
+
setAnnouncement("");
|
|
2885
|
+
announceTimer.current = setTimeout(() => setAnnouncement(message), delay);
|
|
2886
|
+
};
|
|
2887
|
+
const commit = (next, message, delay = 0) => {
|
|
2925
2888
|
if (!isControlled) setInnerFiles(next);
|
|
2926
2889
|
onValueChange?.(next);
|
|
2927
|
-
|
|
2890
|
+
announce(message, delay);
|
|
2928
2891
|
};
|
|
2929
2892
|
const addFiles = (incoming) => {
|
|
2930
2893
|
if (disabled || incoming.length === 0) return;
|
|
@@ -2945,14 +2908,14 @@ var FileUpload = /* @__PURE__ */ (0, import_react37.forwardRef)(function FileUpl
|
|
|
2945
2908
|
const summary = m.filesSelected?.(next.length) ?? `\uD30C\uC77C ${next.length}\uAC1C \uC120\uD0DD\uB428`;
|
|
2946
2909
|
const errors2 = [...new Set(rejected.map(reasonText))].join(" ");
|
|
2947
2910
|
if (accepted.length > 0) commit(next, [summary, errors2].filter(Boolean).join(" "));
|
|
2948
|
-
else
|
|
2911
|
+
else announce(errors2);
|
|
2949
2912
|
};
|
|
2950
2913
|
const removeAt = (index) => {
|
|
2951
2914
|
const removed = files[index];
|
|
2952
2915
|
const next = files.filter((_, i) => i !== index);
|
|
2953
2916
|
focusAfterRemove.current = Math.min(index, next.length - 1);
|
|
2954
2917
|
setRejections([]);
|
|
2955
|
-
commit(next, m.fileRemoved?.(removed.name) ?? `${removed.name} \uC0AD\uC81C\uB428
|
|
2918
|
+
commit(next, m.fileRemoved?.(removed.name) ?? `${removed.name} \uC0AD\uC81C\uB428`, REMOVED_ANNOUNCE_DELAY);
|
|
2956
2919
|
};
|
|
2957
2920
|
(0, import_react37.useEffect)(() => {
|
|
2958
2921
|
if (focusAfterRemove.current === null) return;
|
|
@@ -3041,7 +3004,7 @@ var FileUpload = /* @__PURE__ */ (0, import_react37.forwardRef)(function FileUpl
|
|
|
3041
3004
|
files.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("ul", { "aria-label": m.fileList ?? "\uC120\uD0DD\uD55C \uD30C\uC77C", className: list4, children: files.map((file, index) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("li", { className: item6, children: [
|
|
3042
3005
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: fileIcon, "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons14.FileIcon, { size: 16 }) }),
|
|
3043
3006
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: fileName, children: file.name }),
|
|
3044
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: fileSize, children: formatSize(file.size) }),
|
|
3007
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { id: `${baseId}-size-${index}`, className: fileSize, children: formatSize(file.size) }),
|
|
3045
3008
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3046
3009
|
IconButton,
|
|
3047
3010
|
{
|
|
@@ -3050,6 +3013,7 @@ var FileUpload = /* @__PURE__ */ (0, import_react37.forwardRef)(function FileUpl
|
|
|
3050
3013
|
},
|
|
3051
3014
|
size: "sm",
|
|
3052
3015
|
"aria-label": m.fileRemove?.(file.name) ?? `${file.name} \uC0AD\uC81C`,
|
|
3016
|
+
"aria-describedby": `${baseId}-size-${index}`,
|
|
3053
3017
|
disabled,
|
|
3054
3018
|
onClick: () => removeAt(index),
|
|
3055
3019
|
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons14.XIcon, {})
|
|
@@ -3105,9 +3069,9 @@ var DropdownMenuContent = /* @__PURE__ */ (0, import_react38.forwardRef)(
|
|
|
3105
3069
|
}
|
|
3106
3070
|
);
|
|
3107
3071
|
var DropdownMenuItem = /* @__PURE__ */ (0, import_react38.forwardRef)(
|
|
3108
|
-
function DropdownMenuItem2({ icon:
|
|
3072
|
+
function DropdownMenuItem2({ icon: icon8, shortcut: shortcut2, color = "neutral", className, children, ...rest }, ref) {
|
|
3109
3073
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(RadixMenu.Item, { ref, className: cx(item7, color === "danger" && danger, className), ...rest, children: [
|
|
3110
|
-
|
|
3074
|
+
icon8 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: icon5, "aria-hidden": true, children: icon8 }),
|
|
3111
3075
|
children,
|
|
3112
3076
|
shortcut2 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: shortcut, "aria-hidden": true, children: shortcut2 })
|
|
3113
3077
|
] });
|
|
@@ -3142,9 +3106,9 @@ var DropdownMenuRadioItem = /* @__PURE__ */ (0, import_react38.forwardRef)(
|
|
|
3142
3106
|
);
|
|
3143
3107
|
var DropdownMenuSub = RadixMenu.Sub;
|
|
3144
3108
|
var DropdownMenuSubTrigger = /* @__PURE__ */ (0, import_react38.forwardRef)(
|
|
3145
|
-
function DropdownMenuSubTrigger2({ icon:
|
|
3109
|
+
function DropdownMenuSubTrigger2({ icon: icon8, className, children, ...rest }, ref) {
|
|
3146
3110
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(RadixMenu.SubTrigger, { ref, className: cx(item7, subTrigger, className), ...rest, children: [
|
|
3147
|
-
|
|
3111
|
+
icon8 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: icon5, "aria-hidden": true, children: icon8 }),
|
|
3148
3112
|
children,
|
|
3149
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 }) })
|
|
3150
3114
|
] });
|
|
@@ -3256,9 +3220,12 @@ var NumberInput = /* @__PURE__ */ (0, import_react39.forwardRef)(
|
|
|
3256
3220
|
if (parse(field4.raw) !== next) setRaw(toRaw(next));
|
|
3257
3221
|
}, [value4]);
|
|
3258
3222
|
const current2 = parse(field4.raw);
|
|
3259
|
-
const
|
|
3223
|
+
const valueText = (n) => `${format2(toRaw(n))}${unit2 ?? ""}`;
|
|
3224
|
+
const [announcement, setAnnouncement] = (0, import_react39.useState)("");
|
|
3225
|
+
const setValue = (next, announce = true) => {
|
|
3260
3226
|
setRaw(toRaw(next));
|
|
3261
3227
|
emit(next);
|
|
3228
|
+
if (announce) setAnnouncement(valueText(next));
|
|
3262
3229
|
};
|
|
3263
3230
|
const stepBy = (delta) => {
|
|
3264
3231
|
if (disabled || readOnly) return;
|
|
@@ -3314,13 +3281,17 @@ var NumberInput = /* @__PURE__ */ (0, import_react39.forwardRef)(
|
|
|
3314
3281
|
"aria-valuenow": current2 ?? void 0,
|
|
3315
3282
|
"aria-valuemin": min,
|
|
3316
3283
|
"aria-valuemax": max,
|
|
3317
|
-
"aria-valuetext": current2 === null ? void 0 :
|
|
3284
|
+
"aria-valuetext": current2 === null ? void 0 : valueText(current2),
|
|
3318
3285
|
value: field4.display,
|
|
3319
|
-
onChange:
|
|
3286
|
+
onChange: (event) => {
|
|
3287
|
+
setAnnouncement("");
|
|
3288
|
+
field4.onChange(event);
|
|
3289
|
+
},
|
|
3320
3290
|
onKeyDown: handleKeyDown,
|
|
3321
3291
|
onBlur: (event) => {
|
|
3322
|
-
if (current2 !== null && clamp(current2) !== current2) setValue(clamp(current2));
|
|
3292
|
+
if (current2 !== null && clamp(current2) !== current2) setValue(clamp(current2), false);
|
|
3323
3293
|
else if (current2 === null && field4.raw !== "") setRaw("");
|
|
3294
|
+
setAnnouncement("");
|
|
3324
3295
|
onBlur?.(event);
|
|
3325
3296
|
},
|
|
3326
3297
|
size,
|
|
@@ -3335,7 +3306,8 @@ var NumberInput = /* @__PURE__ */ (0, import_react39.forwardRef)(
|
|
|
3335
3306
|
...rest
|
|
3336
3307
|
}
|
|
3337
3308
|
),
|
|
3338
|
-
name && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("input", { type: "hidden", name, value: current2 === null ? "" : String(current2) })
|
|
3309
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("input", { type: "hidden", name, value: current2 === null ? "" : String(current2) }),
|
|
3310
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { "aria-live": "assertive", "aria-atomic": "true", className: visuallyHidden, children: announcement })
|
|
3339
3311
|
] });
|
|
3340
3312
|
}
|
|
3341
3313
|
);
|
|
@@ -3442,10 +3414,11 @@ var Pagination = /* @__PURE__ */ (0, import_react40.forwardRef)(function Paginat
|
|
|
3442
3414
|
|
|
3443
3415
|
// src/components/PhoneNumberInput/PhoneNumberInput.tsx
|
|
3444
3416
|
var import_react41 = require("react");
|
|
3417
|
+
var import_korean_utils6 = require("@bestow-ui/korean-utils");
|
|
3445
3418
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3446
3419
|
var sanitize3 = (input6) => {
|
|
3447
3420
|
const digits = input6.replace(/\D/g, "");
|
|
3448
|
-
return digits.slice(0, phoneNumberMaxDigits(digits));
|
|
3421
|
+
return digits.slice(0, (0, import_korean_utils6.phoneNumberMaxDigits)(digits));
|
|
3449
3422
|
};
|
|
3450
3423
|
var isDigit4 = (char) => /\d/.test(char);
|
|
3451
3424
|
var PhoneNumberInput = /* @__PURE__ */ (0, import_react41.forwardRef)(
|
|
@@ -3468,7 +3441,7 @@ var PhoneNumberInput = /* @__PURE__ */ (0, import_react41.forwardRef)(
|
|
|
3468
3441
|
defaultValue,
|
|
3469
3442
|
onValueChange,
|
|
3470
3443
|
sanitize: sanitize3,
|
|
3471
|
-
format: formatPhoneNumber,
|
|
3444
|
+
format: import_korean_utils6.formatPhoneNumber,
|
|
3472
3445
|
isMeaningful: isDigit4,
|
|
3473
3446
|
inputRef
|
|
3474
3447
|
});
|
|
@@ -3628,7 +3601,7 @@ var SegmentedControl = /* @__PURE__ */ (0, import_react43.forwardRef)(
|
|
|
3628
3601
|
const labelId = label7 ? `${id ?? generatedId}-label` : void 0;
|
|
3629
3602
|
const itemRefs = (0, import_react43.useRef)([]);
|
|
3630
3603
|
const isEnabled = (index) => !disabled && !options[index]?.disabled;
|
|
3631
|
-
const
|
|
3604
|
+
const select2 = (index) => {
|
|
3632
3605
|
const next = options[index].value;
|
|
3633
3606
|
if (next === current2) return;
|
|
3634
3607
|
if (!isControlled) setInnerValue(next);
|
|
@@ -3655,7 +3628,7 @@ var SegmentedControl = /* @__PURE__ */ (0, import_react43.forwardRef)(
|
|
|
3655
3628
|
if (target < 0) return;
|
|
3656
3629
|
event.preventDefault();
|
|
3657
3630
|
itemRefs.current[target]?.focus();
|
|
3658
|
-
|
|
3631
|
+
select2(target);
|
|
3659
3632
|
};
|
|
3660
3633
|
const group = /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
3661
3634
|
"div",
|
|
@@ -3684,7 +3657,7 @@ var SegmentedControl = /* @__PURE__ */ (0, import_react43.forwardRef)(
|
|
|
3684
3657
|
"data-state": checked ? "checked" : "unchecked",
|
|
3685
3658
|
"data-disabled": isEnabled(index) ? void 0 : "",
|
|
3686
3659
|
className: item9({ size, fullWidth }),
|
|
3687
|
-
onClick: () =>
|
|
3660
|
+
onClick: () => select2(index),
|
|
3688
3661
|
onKeyDown: (event) => handleKeyDown(event, index),
|
|
3689
3662
|
children: [
|
|
3690
3663
|
option2.icon && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { "aria-hidden": true, className: icon6, children: option2.icon }),
|
|
@@ -3706,12 +3679,91 @@ var SegmentedControl = /* @__PURE__ */ (0, import_react43.forwardRef)(
|
|
|
3706
3679
|
}
|
|
3707
3680
|
);
|
|
3708
3681
|
|
|
3709
|
-
// src/components/
|
|
3710
|
-
var RadixSelect = __toESM(require("@radix-ui/react-select"), 1);
|
|
3682
|
+
// src/components/NativeSelect/NativeSelect.tsx
|
|
3711
3683
|
var import_react44 = require("react");
|
|
3712
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
|
|
3713
3693
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3714
|
-
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) {
|
|
3715
3767
|
const {
|
|
3716
3768
|
options,
|
|
3717
3769
|
value: value4,
|
|
@@ -3731,16 +3783,16 @@ var Select = /* @__PURE__ */ (0, import_react44.forwardRef)(function Select2(pro
|
|
|
3731
3783
|
className
|
|
3732
3784
|
} = props;
|
|
3733
3785
|
const isControlled = "value" in props;
|
|
3734
|
-
const generatedId = (0,
|
|
3786
|
+
const generatedId = (0, import_react45.useId)();
|
|
3735
3787
|
const triggerId = id ?? generatedId;
|
|
3736
3788
|
const helperId = helperText3 ? `${triggerId}-helper` : void 0;
|
|
3737
3789
|
const portal2 = usePortalProps();
|
|
3738
|
-
return /* @__PURE__ */ (0,
|
|
3739
|
-
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: [
|
|
3740
3792
|
label7,
|
|
3741
|
-
required && /* @__PURE__ */ (0,
|
|
3793
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
3742
3794
|
] }),
|
|
3743
|
-
/* @__PURE__ */ (0,
|
|
3795
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
3744
3796
|
RadixSelect.Root,
|
|
3745
3797
|
{
|
|
3746
3798
|
value: isControlled ? value4 ?? "" : void 0,
|
|
@@ -3750,7 +3802,7 @@ var Select = /* @__PURE__ */ (0, import_react44.forwardRef)(function Select2(pro
|
|
|
3750
3802
|
required,
|
|
3751
3803
|
name,
|
|
3752
3804
|
children: [
|
|
3753
|
-
/* @__PURE__ */ (0,
|
|
3805
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
3754
3806
|
RadixSelect.Trigger,
|
|
3755
3807
|
{
|
|
3756
3808
|
ref,
|
|
@@ -3761,12 +3813,12 @@ var Select = /* @__PURE__ */ (0, import_react44.forwardRef)(function Select2(pro
|
|
|
3761
3813
|
"data-invalid": error || void 0,
|
|
3762
3814
|
className: cx(root5({ size, fullWidth }), trigger2, className),
|
|
3763
3815
|
children: [
|
|
3764
|
-
/* @__PURE__ */ (0,
|
|
3765
|
-
/* @__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 }) })
|
|
3766
3818
|
]
|
|
3767
3819
|
}
|
|
3768
3820
|
),
|
|
3769
|
-
/* @__PURE__ */ (0,
|
|
3821
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(RadixSelect.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3770
3822
|
RadixSelect.Content,
|
|
3771
3823
|
{
|
|
3772
3824
|
position: "popper",
|
|
@@ -3774,15 +3826,15 @@ var Select = /* @__PURE__ */ (0, import_react44.forwardRef)(function Select2(pro
|
|
|
3774
3826
|
collisionPadding: 8,
|
|
3775
3827
|
className: cx(portal2.className, content5),
|
|
3776
3828
|
style: portal2.style,
|
|
3777
|
-
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)(
|
|
3778
3830
|
RadixSelect.Item,
|
|
3779
3831
|
{
|
|
3780
3832
|
value: option2.value,
|
|
3781
3833
|
disabled: option2.disabled,
|
|
3782
3834
|
className: item5,
|
|
3783
3835
|
children: [
|
|
3784
|
-
/* @__PURE__ */ (0,
|
|
3785
|
-
/* @__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 }) })
|
|
3786
3838
|
]
|
|
3787
3839
|
},
|
|
3788
3840
|
option2.value
|
|
@@ -3792,19 +3844,19 @@ var Select = /* @__PURE__ */ (0, import_react44.forwardRef)(function Select2(pro
|
|
|
3792
3844
|
]
|
|
3793
3845
|
}
|
|
3794
3846
|
),
|
|
3795
|
-
helperText3 && /* @__PURE__ */ (0,
|
|
3847
|
+
helperText3 && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { id: helperId, className: helperText({ error }), children: helperText3 })
|
|
3796
3848
|
] });
|
|
3797
3849
|
});
|
|
3798
3850
|
|
|
3799
3851
|
// src/components/SkipLink/SkipLink.tsx
|
|
3800
|
-
var
|
|
3852
|
+
var import_react46 = require("react");
|
|
3801
3853
|
|
|
3802
3854
|
// src/components/SkipLink/SkipLink.css.ts
|
|
3803
3855
|
var skipLink = "_1t9jaar0";
|
|
3804
3856
|
|
|
3805
3857
|
// src/components/SkipLink/SkipLink.tsx
|
|
3806
|
-
var
|
|
3807
|
-
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) {
|
|
3808
3860
|
const m = useMessages();
|
|
3809
3861
|
const handleClick = (event) => {
|
|
3810
3862
|
onClick?.(event);
|
|
@@ -3816,28 +3868,28 @@ var SkipLink = /* @__PURE__ */ (0, import_react45.forwardRef)(function SkipLink2
|
|
|
3816
3868
|
target.focus();
|
|
3817
3869
|
target.scrollIntoView?.({ block: "start" });
|
|
3818
3870
|
};
|
|
3819
|
-
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" });
|
|
3820
3872
|
});
|
|
3821
3873
|
|
|
3822
3874
|
// src/components/Slider/Slider.tsx
|
|
3823
3875
|
var RadixSlider = __toESM(require("@radix-ui/react-slider"), 1);
|
|
3824
|
-
var
|
|
3876
|
+
var import_react47 = require("react");
|
|
3825
3877
|
|
|
3826
3878
|
// src/components/Slider/Slider.css.ts
|
|
3827
|
-
var
|
|
3879
|
+
var import_createRuntimeFn24 = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
3828
3880
|
var field3 = "_126mzjm0";
|
|
3829
3881
|
var header8 = "_126mzjm1";
|
|
3830
3882
|
var helperText2 = "_126mzjm4";
|
|
3831
3883
|
var label4 = "_126mzjm2";
|
|
3832
3884
|
var range2 = "_126mzjmb";
|
|
3833
|
-
var root12 = /* @__PURE__ */ (0,
|
|
3834
|
-
var thumb = /* @__PURE__ */ (0,
|
|
3835
|
-
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: [] });
|
|
3836
3888
|
var value3 = "_126mzjm3";
|
|
3837
3889
|
|
|
3838
3890
|
// src/components/Slider/Slider.tsx
|
|
3839
|
-
var
|
|
3840
|
-
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) {
|
|
3841
3893
|
const {
|
|
3842
3894
|
value: value4,
|
|
3843
3895
|
defaultValue,
|
|
@@ -3858,12 +3910,12 @@ var Slider = /* @__PURE__ */ (0, import_react46.forwardRef)(function Slider2(pro
|
|
|
3858
3910
|
} = props;
|
|
3859
3911
|
const m = useMessages();
|
|
3860
3912
|
const thumbLabels = thumbLabelsProp ?? [m.rangeStart ?? "\uCD5C\uC18C", m.rangeEnd ?? "\uCD5C\uB300"];
|
|
3861
|
-
const generatedId = (0,
|
|
3913
|
+
const generatedId = (0, import_react47.useId)();
|
|
3862
3914
|
const baseId = id ?? generatedId;
|
|
3863
3915
|
const labelId = `${baseId}-label`;
|
|
3864
3916
|
const helperId = `${baseId}-helper`;
|
|
3865
3917
|
const isControlled = "value" in props;
|
|
3866
|
-
const [innerValue, setInnerValue] = (0,
|
|
3918
|
+
const [innerValue, setInnerValue] = (0, import_react47.useState)(defaultValue ?? [min]);
|
|
3867
3919
|
const current2 = isControlled ? value4 ?? [min] : innerValue;
|
|
3868
3920
|
const isRange = current2.length > 1;
|
|
3869
3921
|
const handleChange = (next) => {
|
|
@@ -3871,12 +3923,12 @@ var Slider = /* @__PURE__ */ (0, import_react46.forwardRef)(function Slider2(pro
|
|
|
3871
3923
|
onValueChange?.(next);
|
|
3872
3924
|
};
|
|
3873
3925
|
const valueText = current2.map(formatValue).join(" \u2013 ");
|
|
3874
|
-
return /* @__PURE__ */ (0,
|
|
3875
|
-
(label7 || showValue) && /* @__PURE__ */ (0,
|
|
3876
|
-
label7 && /* @__PURE__ */ (0,
|
|
3877
|
-
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 })
|
|
3878
3930
|
] }),
|
|
3879
|
-
/* @__PURE__ */ (0,
|
|
3931
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
3880
3932
|
RadixSlider.Root,
|
|
3881
3933
|
{
|
|
3882
3934
|
ref,
|
|
@@ -3889,10 +3941,10 @@ var Slider = /* @__PURE__ */ (0, import_react46.forwardRef)(function Slider2(pro
|
|
|
3889
3941
|
className: root12({ size }),
|
|
3890
3942
|
...rest,
|
|
3891
3943
|
children: [
|
|
3892
|
-
/* @__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 }) }),
|
|
3893
3945
|
current2.map((thumbValue, index) => {
|
|
3894
3946
|
const thumbLabelId = `${baseId}-thumb-${index}`;
|
|
3895
|
-
return /* @__PURE__ */ (0,
|
|
3947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3896
3948
|
RadixSlider.Thumb,
|
|
3897
3949
|
{
|
|
3898
3950
|
className: thumb({ size }),
|
|
@@ -3907,32 +3959,32 @@ var Slider = /* @__PURE__ */ (0, import_react46.forwardRef)(function Slider2(pro
|
|
|
3907
3959
|
]
|
|
3908
3960
|
}
|
|
3909
3961
|
),
|
|
3910
|
-
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: [
|
|
3911
3963
|
label7 ? "" : ariaLabel ? `${ariaLabel} ` : "",
|
|
3912
3964
|
thumbLabels[index] ?? `${index + 1}`
|
|
3913
3965
|
] }, index)),
|
|
3914
|
-
helperText3 && /* @__PURE__ */ (0,
|
|
3966
|
+
helperText3 && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { id: helperId, className: helperText2, children: helperText3 })
|
|
3915
3967
|
] });
|
|
3916
3968
|
});
|
|
3917
3969
|
|
|
3918
3970
|
// src/components/Stepper/Stepper.tsx
|
|
3919
|
-
var
|
|
3920
|
-
var
|
|
3971
|
+
var import_react48 = require("react");
|
|
3972
|
+
var import_icons20 = require("@bestow-ui/icons");
|
|
3921
3973
|
|
|
3922
3974
|
// src/components/Stepper/Stepper.css.ts
|
|
3923
|
-
var
|
|
3975
|
+
var import_createRuntimeFn25 = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
3924
3976
|
var description6 = "kervhmh";
|
|
3925
|
-
var indicator3 = /* @__PURE__ */ (0,
|
|
3926
|
-
var label5 = /* @__PURE__ */ (0,
|
|
3927
|
-
var root13 = /* @__PURE__ */ (0,
|
|
3928
|
-
var step = /* @__PURE__ */ (0,
|
|
3929
|
-
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: [] });
|
|
3930
3982
|
|
|
3931
3983
|
// src/components/Stepper/Stepper.tsx
|
|
3932
|
-
var
|
|
3933
|
-
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) {
|
|
3934
3986
|
const m = useMessages();
|
|
3935
|
-
return /* @__PURE__ */ (0,
|
|
3987
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3936
3988
|
"ol",
|
|
3937
3989
|
{
|
|
3938
3990
|
ref,
|
|
@@ -3941,24 +3993,24 @@ var Stepper = /* @__PURE__ */ (0, import_react47.forwardRef)(function Stepper2({
|
|
|
3941
3993
|
...rest,
|
|
3942
3994
|
children: steps.map((step2, index) => {
|
|
3943
3995
|
const status = index < current2 ? "complete" : index === current2 ? "current" : "upcoming";
|
|
3944
|
-
return /* @__PURE__ */ (0,
|
|
3996
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
3945
3997
|
"li",
|
|
3946
3998
|
{
|
|
3947
3999
|
className: step({ orientation }),
|
|
3948
4000
|
"data-status": status,
|
|
3949
4001
|
"aria-current": status === "current" ? "step" : void 0,
|
|
3950
4002
|
children: [
|
|
3951
|
-
/* @__PURE__ */ (0,
|
|
3952
|
-
/* @__PURE__ */ (0,
|
|
3953
|
-
/* @__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: [
|
|
3954
4006
|
step2.label,
|
|
3955
|
-
status === "complete" && /* @__PURE__ */ (0,
|
|
4007
|
+
status === "complete" && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { className: visuallyHidden, children: [
|
|
3956
4008
|
" (",
|
|
3957
4009
|
m.stepCompleted ?? "\uC644\uB8CC",
|
|
3958
4010
|
")"
|
|
3959
4011
|
] })
|
|
3960
4012
|
] }),
|
|
3961
|
-
step2.description && /* @__PURE__ */ (0,
|
|
4013
|
+
step2.description && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: description6, children: step2.description })
|
|
3962
4014
|
] })
|
|
3963
4015
|
]
|
|
3964
4016
|
},
|
|
@@ -3970,47 +4022,120 @@ var Stepper = /* @__PURE__ */ (0, import_react47.forwardRef)(function Stepper2({
|
|
|
3970
4022
|
});
|
|
3971
4023
|
|
|
3972
4024
|
// src/components/Switch/Switch.tsx
|
|
3973
|
-
var
|
|
3974
|
-
var import_react48 = require("react");
|
|
4025
|
+
var import_react49 = require("react");
|
|
3975
4026
|
|
|
3976
4027
|
// src/components/Switch/Switch.css.ts
|
|
3977
|
-
var
|
|
3978
|
-
var
|
|
3979
|
-
var
|
|
3980
|
-
var
|
|
3981
|
-
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: [] });
|
|
3982
4034
|
|
|
3983
4035
|
// src/components/Switch/Switch.tsx
|
|
3984
|
-
var
|
|
3985
|
-
|
|
3986
|
-
|
|
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)();
|
|
3987
4055
|
const switchId = id ?? generatedId;
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
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",
|
|
3991
4094
|
{
|
|
3992
|
-
ref,
|
|
4095
|
+
ref: mergeRefs(ref, buttonRef),
|
|
4096
|
+
type: "button",
|
|
4097
|
+
role: "switch",
|
|
3993
4098
|
id: switchId,
|
|
3994
|
-
|
|
4099
|
+
"aria-checked": checked,
|
|
4100
|
+
"aria-required": required,
|
|
3995
4101
|
"aria-label": ariaLabel,
|
|
4102
|
+
"data-state": state,
|
|
4103
|
+
"data-disabled": disabled ? "" : void 0,
|
|
4104
|
+
disabled,
|
|
4105
|
+
value: value4,
|
|
3996
4106
|
className: track3({ size }),
|
|
3997
|
-
|
|
3998
|
-
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 })
|
|
3999
4109
|
}
|
|
4000
4110
|
),
|
|
4001
|
-
|
|
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 })
|
|
4002
4127
|
] });
|
|
4003
4128
|
});
|
|
4004
4129
|
|
|
4005
4130
|
// src/components/Table/Table.tsx
|
|
4006
|
-
var
|
|
4007
|
-
var
|
|
4131
|
+
var import_react50 = require("react");
|
|
4132
|
+
var import_icons21 = require("@bestow-ui/icons");
|
|
4008
4133
|
|
|
4009
4134
|
// src/components/Table/Table.css.ts
|
|
4010
|
-
var
|
|
4135
|
+
var import_createRuntimeFn27 = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
4011
4136
|
var body4 = "l3ploy5";
|
|
4012
4137
|
var caption = "l3ploy2";
|
|
4013
|
-
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: [] });
|
|
4014
4139
|
var container = "l3ploy0";
|
|
4015
4140
|
var emptyCell = "l3ployj";
|
|
4016
4141
|
var emptyContent = "l3ployk";
|
|
@@ -4026,10 +4151,10 @@ var striped = "l3ploy6";
|
|
|
4026
4151
|
var table = "l3ploy1";
|
|
4027
4152
|
|
|
4028
4153
|
// src/components/Table/Table.tsx
|
|
4029
|
-
var
|
|
4030
|
-
var TableSizeContext = /* @__PURE__ */ (0,
|
|
4031
|
-
var TableSectionContext = /* @__PURE__ */ (0,
|
|
4032
|
-
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({
|
|
4033
4158
|
size = "md",
|
|
4034
4159
|
striped: striped2,
|
|
4035
4160
|
stickyHeader: stickyHeader2,
|
|
@@ -4041,8 +4166,8 @@ var Table = /* @__PURE__ */ (0, import_react49.forwardRef)(function Table2({
|
|
|
4041
4166
|
children,
|
|
4042
4167
|
...rest
|
|
4043
4168
|
}, ref) {
|
|
4044
|
-
const captionId = (0,
|
|
4045
|
-
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)(
|
|
4046
4171
|
"div",
|
|
4047
4172
|
{
|
|
4048
4173
|
className: cx(container, containerClassName),
|
|
@@ -4051,7 +4176,7 @@ var Table = /* @__PURE__ */ (0, import_react49.forwardRef)(function Table2({
|
|
|
4051
4176
|
role: "region",
|
|
4052
4177
|
"aria-labelledby": caption2 ? captionId : void 0,
|
|
4053
4178
|
"aria-label": caption2 ? void 0 : ariaLabel,
|
|
4054
|
-
children: /* @__PURE__ */ (0,
|
|
4179
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
4055
4180
|
"table",
|
|
4056
4181
|
{
|
|
4057
4182
|
ref,
|
|
@@ -4059,7 +4184,7 @@ var Table = /* @__PURE__ */ (0, import_react49.forwardRef)(function Table2({
|
|
|
4059
4184
|
"aria-label": caption2 ? void 0 : ariaLabel,
|
|
4060
4185
|
...rest,
|
|
4061
4186
|
children: [
|
|
4062
|
-
caption2 && /* @__PURE__ */ (0,
|
|
4187
|
+
caption2 && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("caption", { id: captionId, className: caption, children: caption2 }),
|
|
4063
4188
|
children
|
|
4064
4189
|
]
|
|
4065
4190
|
}
|
|
@@ -4067,31 +4192,31 @@ var Table = /* @__PURE__ */ (0, import_react49.forwardRef)(function Table2({
|
|
|
4067
4192
|
}
|
|
4068
4193
|
) });
|
|
4069
4194
|
});
|
|
4070
|
-
var TableHeader = /* @__PURE__ */ (0,
|
|
4195
|
+
var TableHeader = /* @__PURE__ */ (0, import_react50.forwardRef)(
|
|
4071
4196
|
function TableHeader2({ className, ...rest }, ref) {
|
|
4072
|
-
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 }) });
|
|
4073
4198
|
}
|
|
4074
4199
|
);
|
|
4075
|
-
var TableBody = /* @__PURE__ */ (0,
|
|
4200
|
+
var TableBody = /* @__PURE__ */ (0, import_react50.forwardRef)(
|
|
4076
4201
|
function TableBody2({ className, ...rest }, ref) {
|
|
4077
|
-
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 }) });
|
|
4078
4203
|
}
|
|
4079
4204
|
);
|
|
4080
|
-
var TableFooter = /* @__PURE__ */ (0,
|
|
4205
|
+
var TableFooter = /* @__PURE__ */ (0, import_react50.forwardRef)(
|
|
4081
4206
|
function TableFooter2({ className, ...rest }, ref) {
|
|
4082
|
-
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 }) });
|
|
4083
4208
|
}
|
|
4084
4209
|
);
|
|
4085
|
-
var TableRow = /* @__PURE__ */ (0,
|
|
4086
|
-
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 });
|
|
4087
4212
|
});
|
|
4088
|
-
var TableHead = /* @__PURE__ */ (0,
|
|
4089
|
-
const size = (0,
|
|
4090
|
-
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);
|
|
4091
4216
|
const sortable = onSort !== void 0;
|
|
4092
4217
|
const direction = sortDirection ?? "none";
|
|
4093
|
-
const SortIcon = direction === "descending" ?
|
|
4094
|
-
return /* @__PURE__ */ (0,
|
|
4218
|
+
const SortIcon = direction === "descending" ? import_icons21.ArrowDownIcon : import_icons21.ArrowUpIcon;
|
|
4219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4095
4220
|
"th",
|
|
4096
4221
|
{
|
|
4097
4222
|
ref,
|
|
@@ -4103,17 +4228,17 @@ var TableHead = /* @__PURE__ */ (0, import_react49.forwardRef)(function TableHea
|
|
|
4103
4228
|
className
|
|
4104
4229
|
),
|
|
4105
4230
|
...rest,
|
|
4106
|
-
children: sortable ? /* @__PURE__ */ (0,
|
|
4231
|
+
children: sortable ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("button", { type: "button", className: sortButton, onClick: onSort, children: [
|
|
4107
4232
|
children,
|
|
4108
|
-
/* @__PURE__ */ (0,
|
|
4233
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SortIcon, { size: 14, className: sortIcon, "data-active": direction !== "none", "aria-hidden": true })
|
|
4109
4234
|
] }) : children
|
|
4110
4235
|
}
|
|
4111
4236
|
);
|
|
4112
4237
|
});
|
|
4113
|
-
var TableCell = /* @__PURE__ */ (0,
|
|
4114
|
-
const size = (0,
|
|
4115
|
-
const section = (0,
|
|
4116
|
-
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)(
|
|
4117
4242
|
"td",
|
|
4118
4243
|
{
|
|
4119
4244
|
ref,
|
|
@@ -4122,26 +4247,26 @@ var TableCell = /* @__PURE__ */ (0, import_react49.forwardRef)(function TableCel
|
|
|
4122
4247
|
}
|
|
4123
4248
|
);
|
|
4124
4249
|
});
|
|
4125
|
-
var TableEmpty = /* @__PURE__ */ (0,
|
|
4126
|
-
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 }) }) });
|
|
4127
4252
|
});
|
|
4128
4253
|
function TableSkeleton({ rows = 5, columns }) {
|
|
4129
|
-
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)) });
|
|
4130
4255
|
}
|
|
4131
4256
|
|
|
4132
4257
|
// src/components/Table/useTableSelection.ts
|
|
4133
|
-
var
|
|
4258
|
+
var import_react51 = require("react");
|
|
4134
4259
|
function useTableSelection(initial = []) {
|
|
4135
|
-
const [selected, setSelected] = (0,
|
|
4136
|
-
const isSelected = (0,
|
|
4137
|
-
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) => {
|
|
4138
4263
|
setSelected((prev) => {
|
|
4139
4264
|
const on = checked ?? !prev.includes(id);
|
|
4140
4265
|
if (on) return prev.includes(id) ? prev : [...prev, id];
|
|
4141
4266
|
return prev.filter((value4) => value4 !== id);
|
|
4142
4267
|
});
|
|
4143
4268
|
}, []);
|
|
4144
|
-
const clear2 = (0,
|
|
4269
|
+
const clear2 = (0, import_react51.useCallback)(() => setSelected([]), []);
|
|
4145
4270
|
const selectAllProps = (pageIds) => {
|
|
4146
4271
|
const all2 = pageIds.length > 0 && pageIds.every((id) => selected.includes(id));
|
|
4147
4272
|
const some = pageIds.some((id) => selected.includes(id));
|
|
@@ -4162,48 +4287,48 @@ function useTableSelection(initial = []) {
|
|
|
4162
4287
|
|
|
4163
4288
|
// src/components/Tabs/Tabs.tsx
|
|
4164
4289
|
var RadixTabs = __toESM(require("@radix-ui/react-tabs"), 1);
|
|
4165
|
-
var
|
|
4290
|
+
var import_react52 = require("react");
|
|
4166
4291
|
|
|
4167
4292
|
// src/components/Tabs/Tabs.css.ts
|
|
4168
|
-
var
|
|
4293
|
+
var import_createRuntimeFn28 = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
4169
4294
|
var content10 = "fvhbtdb";
|
|
4170
|
-
var list6 = /* @__PURE__ */ (0,
|
|
4295
|
+
var list6 = /* @__PURE__ */ (0, import_createRuntimeFn28.createRuntimeFn)({ defaultClassName: "fvhbtd1", variantClassNames: { variant: { line: "fvhbtd2", soft: "fvhbtd3" } }, defaultVariants: { variant: "line" }, compoundVariants: [] });
|
|
4171
4296
|
var root15 = "fvhbtd0";
|
|
4172
|
-
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"]] });
|
|
4173
4298
|
|
|
4174
4299
|
// src/components/Tabs/Tabs.tsx
|
|
4175
|
-
var
|
|
4176
|
-
var TabsStyleContext = /* @__PURE__ */ (0,
|
|
4177
|
-
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) {
|
|
4178
4303
|
const controlled = "value" in props ? { value: props.value ?? "" } : {};
|
|
4179
|
-
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 }) });
|
|
4180
4305
|
});
|
|
4181
|
-
var TabsList = /* @__PURE__ */ (0,
|
|
4182
|
-
const { variant } = (0,
|
|
4183
|
-
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 });
|
|
4184
4309
|
});
|
|
4185
|
-
var TabsTrigger = /* @__PURE__ */ (0,
|
|
4186
|
-
const { variant, size } = (0,
|
|
4187
|
-
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 });
|
|
4188
4313
|
});
|
|
4189
|
-
var TabsContent = /* @__PURE__ */ (0,
|
|
4190
|
-
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 });
|
|
4191
4316
|
});
|
|
4192
4317
|
|
|
4193
4318
|
// src/components/Textarea/Textarea.tsx
|
|
4194
|
-
var
|
|
4319
|
+
var import_react53 = require("react");
|
|
4195
4320
|
|
|
4196
4321
|
// src/components/Textarea/Textarea.css.ts
|
|
4197
|
-
var
|
|
4322
|
+
var import_createRuntimeFn29 = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
4198
4323
|
var count = "_1koawa9";
|
|
4199
4324
|
var countOver = "_1koawaa";
|
|
4200
4325
|
var defaultWidth = "_1koawa7";
|
|
4201
4326
|
var footer5 = "_1koawa8";
|
|
4202
|
-
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: [] });
|
|
4203
4328
|
|
|
4204
4329
|
// src/components/Textarea/Textarea.tsx
|
|
4205
|
-
var
|
|
4206
|
-
var Textarea = /* @__PURE__ */ (0,
|
|
4330
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
4331
|
+
var Textarea = /* @__PURE__ */ (0, import_react53.forwardRef)(function Textarea2({
|
|
4207
4332
|
label: label7,
|
|
4208
4333
|
helperText: helperText3,
|
|
4209
4334
|
error,
|
|
@@ -4224,13 +4349,13 @@ var Textarea = /* @__PURE__ */ (0, import_react52.forwardRef)(function Textarea2
|
|
|
4224
4349
|
"aria-describedby": ariaDescribedBy,
|
|
4225
4350
|
...rest
|
|
4226
4351
|
}, ref) {
|
|
4227
|
-
const generatedId = (0,
|
|
4352
|
+
const generatedId = (0, import_react53.useId)();
|
|
4228
4353
|
const textareaId = id ?? generatedId;
|
|
4229
4354
|
const helperId = helperText3 ? `${textareaId}-helper` : void 0;
|
|
4230
|
-
const innerRef = (0,
|
|
4231
|
-
const [uncontrolledLength, setUncontrolledLength] = (0,
|
|
4355
|
+
const innerRef = (0, import_react53.useRef)(null);
|
|
4356
|
+
const [uncontrolledLength, setUncontrolledLength] = (0, import_react53.useState)(() => String(defaultValue ?? "").length);
|
|
4232
4357
|
const length = value4 !== void 0 ? String(value4).length : uncontrolledLength;
|
|
4233
|
-
const fitHeight = (0,
|
|
4358
|
+
const fitHeight = (0, import_react53.useCallback)(() => {
|
|
4234
4359
|
const el = innerRef.current;
|
|
4235
4360
|
if (!autoResize || !el) return;
|
|
4236
4361
|
el.style.height = "auto";
|
|
@@ -4243,12 +4368,12 @@ var Textarea = /* @__PURE__ */ (0, import_react52.forwardRef)(function Textarea2
|
|
|
4243
4368
|
fitHeight();
|
|
4244
4369
|
onChange?.(event);
|
|
4245
4370
|
};
|
|
4246
|
-
return /* @__PURE__ */ (0,
|
|
4247
|
-
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: [
|
|
4248
4373
|
label7,
|
|
4249
|
-
required && /* @__PURE__ */ (0,
|
|
4374
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
4250
4375
|
] }),
|
|
4251
|
-
/* @__PURE__ */ (0,
|
|
4376
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4252
4377
|
"textarea",
|
|
4253
4378
|
{
|
|
4254
4379
|
ref: mergeRefs(innerRef, ref),
|
|
@@ -4270,51 +4395,51 @@ var Textarea = /* @__PURE__ */ (0, import_react52.forwardRef)(function Textarea2
|
|
|
4270
4395
|
...rest
|
|
4271
4396
|
}
|
|
4272
4397
|
),
|
|
4273
|
-
(helperText3 || showCount) && /* @__PURE__ */ (0,
|
|
4274
|
-
helperText3 && /* @__PURE__ */ (0,
|
|
4275
|
-
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 })
|
|
4276
4401
|
] })
|
|
4277
4402
|
] });
|
|
4278
4403
|
});
|
|
4279
4404
|
|
|
4280
4405
|
// src/components/Toast/Toast.tsx
|
|
4281
4406
|
var RadixToast = __toESM(require("@radix-ui/react-toast"), 1);
|
|
4282
|
-
var
|
|
4283
|
-
var
|
|
4407
|
+
var import_react54 = require("react");
|
|
4408
|
+
var import_icons22 = require("@bestow-ui/icons");
|
|
4284
4409
|
|
|
4285
4410
|
// src/components/Toast/Toast.css.ts
|
|
4286
|
-
var
|
|
4411
|
+
var import_createRuntimeFn30 = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
4287
4412
|
var action2 = "_1g11zvx9";
|
|
4288
4413
|
var close = "_1g11zvxa";
|
|
4289
4414
|
var description7 = "_1g11zvx8";
|
|
4290
4415
|
var title5 = "_1g11zvx7";
|
|
4291
|
-
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: [] });
|
|
4292
4417
|
var viewport2 = "_1g11zvx0";
|
|
4293
4418
|
|
|
4294
4419
|
// src/components/Toast/Toast.tsx
|
|
4295
|
-
var
|
|
4420
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
4296
4421
|
var REMOVE_DELAY = 500;
|
|
4297
|
-
var ToastContext = /* @__PURE__ */ (0,
|
|
4422
|
+
var ToastContext = /* @__PURE__ */ (0, import_react54.createContext)(null);
|
|
4298
4423
|
function ToastProvider({ children, duration = 5e3, label: labelProp }) {
|
|
4299
4424
|
const m = useMessages();
|
|
4300
4425
|
const label7 = labelProp ?? m.notifications ?? "\uC54C\uB9BC";
|
|
4301
|
-
const [toasts, setToasts] = (0,
|
|
4302
|
-
const nextId = (0,
|
|
4426
|
+
const [toasts, setToasts] = (0, import_react54.useState)([]);
|
|
4427
|
+
const nextId = (0, import_react54.useRef)(0);
|
|
4303
4428
|
const portal2 = usePortalProps();
|
|
4304
|
-
const toast2 = (0,
|
|
4429
|
+
const toast2 = (0, import_react54.useCallback)((options) => {
|
|
4305
4430
|
const id = nextId.current++;
|
|
4306
4431
|
setToasts((prev) => [...prev, { ...options, id, open: true }]);
|
|
4307
4432
|
return id;
|
|
4308
4433
|
}, []);
|
|
4309
|
-
const dismiss = (0,
|
|
4434
|
+
const dismiss = (0, import_react54.useCallback)((id) => {
|
|
4310
4435
|
const isTarget = (t) => id === void 0 || t.id === id;
|
|
4311
4436
|
setToasts((prev) => prev.map((t) => isTarget(t) ? { ...t, open: false } : t));
|
|
4312
4437
|
setTimeout(() => setToasts((prev) => prev.filter((t) => t.open || !isTarget(t))), REMOVE_DELAY);
|
|
4313
4438
|
}, []);
|
|
4314
|
-
const value4 = (0,
|
|
4315
|
-
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: [
|
|
4316
4441
|
children,
|
|
4317
|
-
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)(
|
|
4318
4443
|
RadixToast.Root,
|
|
4319
4444
|
{
|
|
4320
4445
|
open,
|
|
@@ -4324,19 +4449,19 @@ function ToastProvider({ children, duration = 5e3, label: labelProp }) {
|
|
|
4324
4449
|
},
|
|
4325
4450
|
className: toast({ color }),
|
|
4326
4451
|
children: [
|
|
4327
|
-
/* @__PURE__ */ (0,
|
|
4328
|
-
description8 && /* @__PURE__ */ (0,
|
|
4329
|
-
action3 && /* @__PURE__ */ (0,
|
|
4330
|
-
/* @__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 }) })
|
|
4331
4456
|
]
|
|
4332
4457
|
},
|
|
4333
4458
|
id
|
|
4334
4459
|
)),
|
|
4335
|
-
/* @__PURE__ */ (0,
|
|
4460
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(RadixToast.Viewport, { className: cx(portal2.className, viewport2), style: portal2.style })
|
|
4336
4461
|
] }) });
|
|
4337
4462
|
}
|
|
4338
4463
|
function useToast() {
|
|
4339
|
-
const context = (0,
|
|
4464
|
+
const context = (0, import_react54.useContext)(ToastContext);
|
|
4340
4465
|
if (!context) throw new Error("useToast \uB294 ToastProvider \uC548\uC5D0\uC11C \uC0AC\uC6A9\uD574\uC57C \uD569\uB2C8\uB2E4.");
|
|
4341
4466
|
return context;
|
|
4342
4467
|
}
|
|
@@ -4349,7 +4474,7 @@ var arrow2 = "z7rufs1";
|
|
|
4349
4474
|
var content11 = "z7rufs0";
|
|
4350
4475
|
|
|
4351
4476
|
// src/components/Tooltip/Tooltip.tsx
|
|
4352
|
-
var
|
|
4477
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4353
4478
|
function Tooltip({
|
|
4354
4479
|
content: content12,
|
|
4355
4480
|
children,
|
|
@@ -4364,9 +4489,9 @@ function Tooltip({
|
|
|
4364
4489
|
}) {
|
|
4365
4490
|
const portal2 = usePortalProps();
|
|
4366
4491
|
if (disabled || content12 == null || content12 === "") return children;
|
|
4367
|
-
return /* @__PURE__ */ (0,
|
|
4368
|
-
/* @__PURE__ */ (0,
|
|
4369
|
-
/* @__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)(
|
|
4370
4495
|
RadixTooltip.Content,
|
|
4371
4496
|
{
|
|
4372
4497
|
side,
|
|
@@ -4377,7 +4502,7 @@ function Tooltip({
|
|
|
4377
4502
|
style: portal2.style,
|
|
4378
4503
|
children: [
|
|
4379
4504
|
content12,
|
|
4380
|
-
/* @__PURE__ */ (0,
|
|
4505
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(RadixTooltip.Arrow, { className: arrow2, width: 10, height: 5 })
|
|
4381
4506
|
]
|
|
4382
4507
|
}
|
|
4383
4508
|
) })
|
|
@@ -4385,7 +4510,7 @@ function Tooltip({
|
|
|
4385
4510
|
}
|
|
4386
4511
|
|
|
4387
4512
|
// src/components/VerificationCodeInput/VerificationCodeInput.tsx
|
|
4388
|
-
var
|
|
4513
|
+
var import_react55 = require("react");
|
|
4389
4514
|
|
|
4390
4515
|
// src/components/VerificationCodeInput/VerificationCodeInput.css.ts
|
|
4391
4516
|
var input5 = "ea01812";
|
|
@@ -4395,9 +4520,9 @@ var slots = "ea01811";
|
|
|
4395
4520
|
var timer = "ea01814";
|
|
4396
4521
|
|
|
4397
4522
|
// src/components/VerificationCodeInput/VerificationCodeInput.tsx
|
|
4398
|
-
var
|
|
4523
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4399
4524
|
var formatTime = (seconds) => `${String(Math.floor(seconds / 60)).padStart(2, "0")}:${String(seconds % 60).padStart(2, "0")}`;
|
|
4400
|
-
var VerificationCodeInput = /* @__PURE__ */ (0,
|
|
4525
|
+
var VerificationCodeInput = /* @__PURE__ */ (0, import_react55.forwardRef)(
|
|
4401
4526
|
function VerificationCodeInput2(props, ref) {
|
|
4402
4527
|
const {
|
|
4403
4528
|
length = 6,
|
|
@@ -4424,23 +4549,23 @@ var VerificationCodeInput = /* @__PURE__ */ (0, import_react54.forwardRef)(
|
|
|
4424
4549
|
const label7 = labelProp ?? m.verificationCode ?? "\uC778\uC99D\uBC88\uD638";
|
|
4425
4550
|
const resendText = resendTextProp ?? m.resend ?? "\uC7AC\uC804\uC1A1";
|
|
4426
4551
|
const expiredText = expiredTextProp ?? m.verificationExpired ?? "\uC778\uC99D \uC2DC\uAC04\uC774 \uC9C0\uB0AC\uC5B4\uC694. \uC7AC\uC804\uC1A1\uD574 \uC8FC\uC138\uC694.";
|
|
4427
|
-
const generatedId = (0,
|
|
4552
|
+
const generatedId = (0, import_react55.useId)();
|
|
4428
4553
|
const inputId = id ?? generatedId;
|
|
4429
4554
|
const helperId = `${inputId}-helper`;
|
|
4430
4555
|
const statusId = `${inputId}-status`;
|
|
4431
|
-
const inputRef = (0,
|
|
4556
|
+
const inputRef = (0, import_react55.useRef)(null);
|
|
4432
4557
|
const isControlled = "value" in props;
|
|
4433
|
-
const [innerValue, setInnerValue] = (0,
|
|
4558
|
+
const [innerValue, setInnerValue] = (0, import_react55.useState)(defaultValue ?? "");
|
|
4434
4559
|
const code = (isControlled ? value4 ?? "" : innerValue).slice(0, length);
|
|
4435
|
-
const [focused, setFocused] = (0,
|
|
4436
|
-
const [endAt, setEndAt] = (0,
|
|
4437
|
-
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);
|
|
4438
4563
|
const expired = expiresIn !== void 0 && remaining <= 0;
|
|
4439
|
-
const onExpireRef = (0,
|
|
4440
|
-
(0,
|
|
4564
|
+
const onExpireRef = (0, import_react55.useRef)(onExpire);
|
|
4565
|
+
(0, import_react55.useEffect)(() => {
|
|
4441
4566
|
onExpireRef.current = onExpire;
|
|
4442
4567
|
});
|
|
4443
|
-
(0,
|
|
4568
|
+
(0, import_react55.useEffect)(() => {
|
|
4444
4569
|
if (endAt === null) return;
|
|
4445
4570
|
const tick = () => {
|
|
4446
4571
|
const left = Math.max(0, Math.ceil((endAt - Date.now()) / 1e3));
|
|
@@ -4475,17 +4600,17 @@ var VerificationCodeInput = /* @__PURE__ */ (0, import_react54.forwardRef)(
|
|
|
4475
4600
|
};
|
|
4476
4601
|
const description8 = helperText3 ?? m.verificationCodeHint?.(length, type) ?? `${length}\uC790\uB9AC ${type === "numeric" ? "\uC22B\uC790" : "\uBB38\uC790"}\uB97C \uC785\uB825\uD558\uC138\uC694.`;
|
|
4477
4602
|
const activeIndex = Math.min(code.length, length - 1);
|
|
4478
|
-
return /* @__PURE__ */ (0,
|
|
4603
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
4479
4604
|
"div",
|
|
4480
4605
|
{
|
|
4481
4606
|
className: cx(field, className),
|
|
4482
4607
|
"data-invalid": error || void 0,
|
|
4483
4608
|
"data-disabled": disabled || void 0,
|
|
4484
4609
|
children: [
|
|
4485
|
-
/* @__PURE__ */ (0,
|
|
4486
|
-
/* @__PURE__ */ (0,
|
|
4487
|
-
/* @__PURE__ */ (0,
|
|
4488
|
-
/* @__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)(
|
|
4489
4614
|
"input",
|
|
4490
4615
|
{
|
|
4491
4616
|
ref: mergeRefs(ref, inputRef),
|
|
@@ -4505,7 +4630,7 @@ var VerificationCodeInput = /* @__PURE__ */ (0, import_react54.forwardRef)(
|
|
|
4505
4630
|
className: input5
|
|
4506
4631
|
}
|
|
4507
4632
|
),
|
|
4508
|
-
Array.from({ length }, (_, index) => /* @__PURE__ */ (0,
|
|
4633
|
+
Array.from({ length }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4509
4634
|
"div",
|
|
4510
4635
|
{
|
|
4511
4636
|
className: slot,
|
|
@@ -4516,12 +4641,12 @@ var VerificationCodeInput = /* @__PURE__ */ (0, import_react54.forwardRef)(
|
|
|
4516
4641
|
index
|
|
4517
4642
|
))
|
|
4518
4643
|
] }),
|
|
4519
|
-
expiresIn !== void 0 && /* @__PURE__ */ (0,
|
|
4520
|
-
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 })
|
|
4521
4646
|
] }),
|
|
4522
|
-
/* @__PURE__ */ (0,
|
|
4523
|
-
/* @__PURE__ */ (0,
|
|
4524
|
-
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 })
|
|
4525
4650
|
]
|
|
4526
4651
|
}
|
|
4527
4652
|
);
|
|
@@ -4574,6 +4699,7 @@ var VerificationCodeInput = /* @__PURE__ */ (0, import_react54.forwardRef)(
|
|
|
4574
4699
|
LocaleProvider,
|
|
4575
4700
|
Modal,
|
|
4576
4701
|
ModalClose,
|
|
4702
|
+
NativeSelect,
|
|
4577
4703
|
NumberInput,
|
|
4578
4704
|
Pagination,
|
|
4579
4705
|
PhoneNumberInput,
|