@bestow-ui/react 1.5.0 → 1.6.1
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 +12 -3
- package/dist/{chunk-VQ45DNC3.js → chunk-NKLDAXUR.js} +2 -77
- package/dist/chunk-NKLDAXUR.js.map +1 -0
- package/dist/client.js +481 -311
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +518 -406
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +77 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +40 -45
- package/dist/index.d.ts +40 -45
- package/dist/shared.js +10 -6
- package/dist/shared.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-VQ45DNC3.js.map +0 -1
package/dist/client.js
CHANGED
|
@@ -1,29 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
|
-
KOREAN_WEEKDAYS,
|
|
4
3
|
Skeleton,
|
|
5
4
|
addDays,
|
|
6
5
|
addMonths,
|
|
7
6
|
compareDays,
|
|
8
7
|
cx,
|
|
9
8
|
focusField,
|
|
10
|
-
formatBusinessNumber,
|
|
11
|
-
formatKoreanAmount,
|
|
12
|
-
formatPhoneNumber,
|
|
13
9
|
getCalendarWeeks,
|
|
14
10
|
isSameDay,
|
|
15
11
|
isSameMonth,
|
|
16
|
-
isValidBusinessNumber,
|
|
17
12
|
kakaoPostcodeProvider,
|
|
18
13
|
mergeThemes,
|
|
19
14
|
parseISODate,
|
|
20
|
-
phoneNumberMaxDigits,
|
|
21
15
|
presetRange,
|
|
22
16
|
themeClass,
|
|
23
17
|
themeToStyle,
|
|
24
18
|
toISODate,
|
|
25
19
|
visuallyHidden
|
|
26
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-NKLDAXUR.js";
|
|
27
21
|
|
|
28
22
|
// src/theme/ThemeProvider.tsx
|
|
29
23
|
import { createContext, forwardRef, useContext, useMemo } from "react";
|
|
@@ -735,7 +729,7 @@ var Alert = /* @__PURE__ */ forwardRef10(function Alert2({
|
|
|
735
729
|
variant,
|
|
736
730
|
color = "primary",
|
|
737
731
|
title: title6,
|
|
738
|
-
icon:
|
|
732
|
+
icon: icon7,
|
|
739
733
|
action: action3,
|
|
740
734
|
onClose,
|
|
741
735
|
closeLabel: closeLabelProp,
|
|
@@ -746,7 +740,7 @@ var Alert = /* @__PURE__ */ forwardRef10(function Alert2({
|
|
|
746
740
|
const m = useMessages();
|
|
747
741
|
const closeLabel = closeLabelProp ?? m.close ?? "\uB2EB\uAE30";
|
|
748
742
|
const DefaultIcon = defaultIcons[color];
|
|
749
|
-
const iconNode =
|
|
743
|
+
const iconNode = icon7 === void 0 ? /* @__PURE__ */ jsx12(DefaultIcon, { size: 18 }) : icon7;
|
|
750
744
|
return /* @__PURE__ */ jsxs10("div", { ref, className: cx(alert({ variant, color }), className), ...rest, children: [
|
|
751
745
|
iconNode !== false && iconNode !== null && /* @__PURE__ */ jsx12("span", { className: icon2, "aria-hidden": true, children: iconNode }),
|
|
752
746
|
/* @__PURE__ */ jsxs10("div", { className: content4, children: [
|
|
@@ -760,6 +754,7 @@ var Alert = /* @__PURE__ */ forwardRef10(function Alert2({
|
|
|
760
754
|
|
|
761
755
|
// src/components/AmountInput/AmountInput.tsx
|
|
762
756
|
import { forwardRef as forwardRef11, useRef as useRef5 } from "react";
|
|
757
|
+
import { formatKoreanAmount } from "@bestow-ui/korean-utils";
|
|
763
758
|
|
|
764
759
|
// src/utils/useFormattedInput.ts
|
|
765
760
|
import { useRef as useRef4, useState as useState3 } from "react";
|
|
@@ -1010,8 +1005,23 @@ var Breadcrumb = /* @__PURE__ */ forwardRef14(function Breadcrumb2({ items: item
|
|
|
1010
1005
|
});
|
|
1011
1006
|
|
|
1012
1007
|
// src/components/BusinessNumberInput/BusinessNumberInput.tsx
|
|
1013
|
-
import { forwardRef as forwardRef15, useRef as useRef6, useState as
|
|
1014
|
-
import {
|
|
1008
|
+
import { forwardRef as forwardRef15, useRef as useRef6, useState as useState5 } from "react";
|
|
1009
|
+
import { formatBusinessNumber, isValidBusinessNumber } from "@bestow-ui/korean-utils";
|
|
1010
|
+
|
|
1011
|
+
// src/utils/useDelayedAnnouncement.ts
|
|
1012
|
+
import { useEffect as useEffect4, useState as useState4 } from "react";
|
|
1013
|
+
var ANNOUNCE_DELAY = 800;
|
|
1014
|
+
function useDelayedAnnouncement(message, delay = ANNOUNCE_DELAY) {
|
|
1015
|
+
const [announced, setAnnounced] = useState4("");
|
|
1016
|
+
useEffect4(() => {
|
|
1017
|
+
const timer2 = setTimeout(() => setAnnounced(message), message ? delay : 0);
|
|
1018
|
+
return () => clearTimeout(timer2);
|
|
1019
|
+
}, [message, delay]);
|
|
1020
|
+
return message && announced === message ? message : "";
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
// src/components/BusinessNumberInput/BusinessNumberInput.tsx
|
|
1024
|
+
import { Fragment as Fragment4, jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1015
1025
|
var sanitize = (input6) => input6.replace(/\D/g, "").slice(0, 10);
|
|
1016
1026
|
var isDigit2 = (char) => /\d/.test(char);
|
|
1017
1027
|
var BusinessNumberInput = /* @__PURE__ */ forwardRef15(
|
|
@@ -1035,7 +1045,7 @@ var BusinessNumberInput = /* @__PURE__ */ forwardRef15(
|
|
|
1035
1045
|
const invalidText = invalidTextProp ?? m.businessNumberInvalid ?? "\uC62C\uBC14\uB978 \uC0AC\uC5C5\uC790\uB4F1\uB85D\uBC88\uD638\uAC00 \uC544\uB2C8\uC5D0\uC694. \uBC88\uD638\uB97C \uB2E4\uC2DC \uD655\uC778\uD574 \uC8FC\uC138\uC694.";
|
|
1036
1046
|
const label6 = labelProp ?? m.businessNumber ?? "\uC0AC\uC5C5\uC790\uB4F1\uB85D\uBC88\uD638";
|
|
1037
1047
|
const incompleteText = m.businessNumberIncomplete ?? "10\uC790\uB9AC\uB97C \uBAA8\uB450 \uC785\uB825\uD574 \uC8FC\uC138\uC694.";
|
|
1038
|
-
const [touched, setTouched] =
|
|
1048
|
+
const [touched, setTouched] = useState5(false);
|
|
1039
1049
|
const field4 = useFormattedInput({
|
|
1040
1050
|
isControlled: "value" in props,
|
|
1041
1051
|
value: value3,
|
|
@@ -1049,34 +1059,39 @@ var BusinessNumberInput = /* @__PURE__ */ forwardRef15(
|
|
|
1049
1059
|
const complete = field4.raw.length === 10;
|
|
1050
1060
|
const autoInvalid = validate && field4.raw.length > 0 && (complete ? !isValidBusinessNumber(field4.raw) : touched);
|
|
1051
1061
|
const showAuto = autoInvalid && error === void 0;
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
field4.
|
|
1063
|
-
onKeyDown
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
onBlur
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1062
|
+
const announcement = useDelayedAnnouncement(showAuto && complete ? invalidText : "");
|
|
1063
|
+
return /* @__PURE__ */ jsxs15(Fragment4, { children: [
|
|
1064
|
+
/* @__PURE__ */ jsx17(
|
|
1065
|
+
TextField,
|
|
1066
|
+
{
|
|
1067
|
+
ref: mergeRefs(ref, inputRef),
|
|
1068
|
+
label: label6,
|
|
1069
|
+
placeholder,
|
|
1070
|
+
inputMode: "numeric",
|
|
1071
|
+
value: field4.display,
|
|
1072
|
+
onChange: field4.onChange,
|
|
1073
|
+
onKeyDown: (event) => {
|
|
1074
|
+
field4.onKeyDown(event);
|
|
1075
|
+
onKeyDown?.(event);
|
|
1076
|
+
},
|
|
1077
|
+
onBlur: (event) => {
|
|
1078
|
+
setTouched(true);
|
|
1079
|
+
onBlur?.(event);
|
|
1080
|
+
},
|
|
1081
|
+
error: error ?? autoInvalid,
|
|
1082
|
+
helperText: showAuto ? complete ? invalidText : incompleteText : helperText3,
|
|
1083
|
+
...rest
|
|
1084
|
+
}
|
|
1085
|
+
),
|
|
1086
|
+
/* @__PURE__ */ jsx17("span", { role: "status", className: visuallyHidden, children: announcement })
|
|
1087
|
+
] });
|
|
1074
1088
|
}
|
|
1075
1089
|
);
|
|
1076
1090
|
|
|
1077
1091
|
// src/components/Calendar/Calendar.tsx
|
|
1078
|
-
import { forwardRef as forwardRef17, useEffect as
|
|
1092
|
+
import { forwardRef as forwardRef17, useEffect as useEffect5, useId as useId4, useRef as useRef7, useState as useState6 } from "react";
|
|
1079
1093
|
import { ChevronLeftIcon, ChevronRightIcon as ChevronRightIcon2 } from "@bestow-ui/icons";
|
|
1094
|
+
import { KOREAN_WEEKDAYS } from "@bestow-ui/korean-utils";
|
|
1080
1095
|
|
|
1081
1096
|
// src/utils/useIsClient.ts
|
|
1082
1097
|
import { useSyncExternalStore } from "react";
|
|
@@ -1125,7 +1140,7 @@ var root6 = "_1qyq67b0";
|
|
|
1125
1140
|
var weekday = "_1qyq67b4";
|
|
1126
1141
|
|
|
1127
1142
|
// src/components/Calendar/Calendar.tsx
|
|
1128
|
-
import { jsx as jsx19, jsxs as
|
|
1143
|
+
import { jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1129
1144
|
var Calendar = /* @__PURE__ */ forwardRef17(function Calendar2(props, ref) {
|
|
1130
1145
|
const {
|
|
1131
1146
|
value: value3,
|
|
@@ -1149,7 +1164,7 @@ var Calendar = /* @__PURE__ */ forwardRef17(function Calendar2(props, ref) {
|
|
|
1149
1164
|
const headingId = useId4();
|
|
1150
1165
|
const gridRef = useRef7(null);
|
|
1151
1166
|
const isControlled = "value" in props;
|
|
1152
|
-
const [innerValue, setInnerValue] =
|
|
1167
|
+
const [innerValue, setInnerValue] = useState6(defaultValue ?? "");
|
|
1153
1168
|
const selected = parseISODate(isControlled ? value3 : innerValue);
|
|
1154
1169
|
const isClient = useIsClient();
|
|
1155
1170
|
const today = parseISODate(todayProp) ?? (isClient ? /* @__PURE__ */ new Date() : null);
|
|
@@ -1161,16 +1176,16 @@ var Calendar = /* @__PURE__ */ forwardRef17(function Calendar2(props, ref) {
|
|
|
1161
1176
|
return date;
|
|
1162
1177
|
};
|
|
1163
1178
|
const isDisabled = (date) => minDate !== null && compareDays(date, minDate) < 0 || maxDate !== null && compareDays(date, maxDate) > 0 || !!isDateDisabled?.(date);
|
|
1164
|
-
const [focusedState, setFocused] =
|
|
1179
|
+
const [focusedState, setFocused] = useState6(null);
|
|
1165
1180
|
const base = selected ?? today;
|
|
1166
1181
|
const focused = focusedState ?? (base ? clamp(base) : null);
|
|
1167
1182
|
const moveFocus = useRef7(initialFocus ?? false);
|
|
1168
1183
|
const selectedIso = selected ? toISODate(selected) : "";
|
|
1169
|
-
|
|
1184
|
+
useEffect5(() => {
|
|
1170
1185
|
const date = parseISODate(selectedIso);
|
|
1171
1186
|
if (date) setFocused((prev) => isSameDay(prev, date) ? prev : date);
|
|
1172
1187
|
}, [selectedIso]);
|
|
1173
|
-
|
|
1188
|
+
useEffect5(() => {
|
|
1174
1189
|
if (!moveFocus.current || !focused) return;
|
|
1175
1190
|
moveFocus.current = false;
|
|
1176
1191
|
gridRef.current?.querySelector(`[data-date="${toISODate(focused)}"]`)?.focus();
|
|
@@ -1179,7 +1194,7 @@ var Calendar = /* @__PURE__ */ forwardRef17(function Calendar2(props, ref) {
|
|
|
1179
1194
|
moveFocus.current = true;
|
|
1180
1195
|
setFocused(clamp(date));
|
|
1181
1196
|
};
|
|
1182
|
-
const
|
|
1197
|
+
const select2 = (date) => {
|
|
1183
1198
|
if (isDisabled(date)) return;
|
|
1184
1199
|
const iso = toISODate(date);
|
|
1185
1200
|
if (!isControlled) setInnerValue(iso);
|
|
@@ -1210,8 +1225,8 @@ var Calendar = /* @__PURE__ */ forwardRef17(function Calendar2(props, ref) {
|
|
|
1210
1225
|
) : [];
|
|
1211
1226
|
const canPrev = !!visible && (!minDate || compareDays(new Date(visible.getFullYear(), visible.getMonth(), 0), minDate) >= 0);
|
|
1212
1227
|
const canNext = !!visible && (!maxDate || compareDays(new Date(visible.getFullYear(), visible.getMonth() + 1, 1), maxDate) <= 0);
|
|
1213
|
-
return /* @__PURE__ */
|
|
1214
|
-
/* @__PURE__ */
|
|
1228
|
+
return /* @__PURE__ */ jsxs16("div", { ref, className: cx(root6, className), children: [
|
|
1229
|
+
/* @__PURE__ */ jsxs16("div", { className: header3, children: [
|
|
1215
1230
|
/* @__PURE__ */ jsx19(
|
|
1216
1231
|
IconButton,
|
|
1217
1232
|
{
|
|
@@ -1234,7 +1249,7 @@ var Calendar = /* @__PURE__ */ forwardRef17(function Calendar2(props, ref) {
|
|
|
1234
1249
|
}
|
|
1235
1250
|
)
|
|
1236
1251
|
] }),
|
|
1237
|
-
/* @__PURE__ */
|
|
1252
|
+
/* @__PURE__ */ jsxs16("table", { ref: gridRef, role: "grid", "aria-labelledby": headingId, className: grid, onKeyDown: handleKeyDown, children: [
|
|
1238
1253
|
/* @__PURE__ */ jsx19("thead", { children: /* @__PURE__ */ jsx19("tr", { children: weekdaysShort.map((name, index) => /* @__PURE__ */ jsx19("th", { scope: "col", abbr: weekdaysLong[index], className: weekday, "data-weekday": index, children: name }, index)) }) }),
|
|
1239
1254
|
/* @__PURE__ */ jsx19("tbody", { children: weeks.map((week) => /* @__PURE__ */ jsx19("tr", { children: week.map((date) => {
|
|
1240
1255
|
const iso = toISODate(date);
|
|
@@ -1262,7 +1277,7 @@ var Calendar = /* @__PURE__ */ forwardRef17(function Calendar2(props, ref) {
|
|
|
1262
1277
|
"aria-label": label6,
|
|
1263
1278
|
"aria-current": isToday ? "date" : void 0,
|
|
1264
1279
|
"aria-disabled": disabled || void 0,
|
|
1265
|
-
onClick: () =>
|
|
1280
|
+
onClick: () => select2(date),
|
|
1266
1281
|
onFocus: () => !isSameDay(date, focused) && setFocused(date),
|
|
1267
1282
|
children: date.getDate()
|
|
1268
1283
|
}
|
|
@@ -1276,11 +1291,11 @@ var Calendar = /* @__PURE__ */ forwardRef17(function Calendar2(props, ref) {
|
|
|
1276
1291
|
import * as Popover from "@radix-ui/react-popover";
|
|
1277
1292
|
import {
|
|
1278
1293
|
forwardRef as forwardRef18,
|
|
1279
|
-
useEffect as
|
|
1294
|
+
useEffect as useEffect6,
|
|
1280
1295
|
useId as useId5,
|
|
1281
1296
|
useMemo as useMemo3,
|
|
1282
1297
|
useRef as useRef8,
|
|
1283
|
-
useState as
|
|
1298
|
+
useState as useState7
|
|
1284
1299
|
} from "react";
|
|
1285
1300
|
import { CheckIcon, ChevronDownIcon as ChevronDownIcon3, XIcon as XIcon3 } from "@bestow-ui/icons";
|
|
1286
1301
|
|
|
@@ -1300,8 +1315,7 @@ var empty = "c2pbq74";
|
|
|
1300
1315
|
var toggle2 = "c2pbq71 c2pbq70";
|
|
1301
1316
|
|
|
1302
1317
|
// src/components/Combobox/Combobox.tsx
|
|
1303
|
-
import { jsx as jsx20, jsxs as
|
|
1304
|
-
var NO_RESULTS_ANNOUNCE_DELAY = 800;
|
|
1318
|
+
import { jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1305
1319
|
var defaultFilter = (option2, query) => option2.label.toLowerCase().includes(query.trim().toLowerCase());
|
|
1306
1320
|
var Combobox = /* @__PURE__ */ forwardRef18(function Combobox2(props, ref) {
|
|
1307
1321
|
const {
|
|
@@ -1341,12 +1355,12 @@ var Combobox = /* @__PURE__ */ forwardRef18(function Combobox2(props, ref) {
|
|
|
1341
1355
|
const inputRef = useRef8(null);
|
|
1342
1356
|
const anchorRef = useRef8(null);
|
|
1343
1357
|
const isControlled = "value" in props;
|
|
1344
|
-
const [innerValue, setInnerValue] =
|
|
1358
|
+
const [innerValue, setInnerValue] = useState7(defaultValue);
|
|
1345
1359
|
const selectedValue = isControlled ? value3 : innerValue;
|
|
1346
1360
|
const selectedOption = options.find((o) => o.value === selectedValue);
|
|
1347
|
-
const [open, setOpen] =
|
|
1348
|
-
const [query, setQuery] =
|
|
1349
|
-
const [activeIndex, setActiveIndex] =
|
|
1361
|
+
const [open, setOpen] = useState7(false);
|
|
1362
|
+
const [query, setQuery] = useState7(null);
|
|
1363
|
+
const [activeIndex, setActiveIndex] = useState7(-1);
|
|
1350
1364
|
const filtered = useMemo3(() => query ? options.filter((o) => filter(o, query)) : options, [options, filter, query]);
|
|
1351
1365
|
const inputText = query ?? selectedOption?.label ?? "";
|
|
1352
1366
|
const firstEnabled = (list7, from = 0, step2 = 1) => {
|
|
@@ -1373,7 +1387,7 @@ var Combobox = /* @__PURE__ */ forwardRef18(function Combobox2(props, ref) {
|
|
|
1373
1387
|
if (query === "" && selectedValue) clearSelection();
|
|
1374
1388
|
reset();
|
|
1375
1389
|
};
|
|
1376
|
-
const
|
|
1390
|
+
const select2 = (option2) => {
|
|
1377
1391
|
if (option2.disabled) return;
|
|
1378
1392
|
if (!isControlled) setInnerValue(option2.value);
|
|
1379
1393
|
if (option2.value !== selectedValue) onValueChange?.(option2.value);
|
|
@@ -1407,7 +1421,7 @@ var Combobox = /* @__PURE__ */ forwardRef18(function Combobox2(props, ref) {
|
|
|
1407
1421
|
if (open) {
|
|
1408
1422
|
event.preventDefault();
|
|
1409
1423
|
const option2 = filtered[activeIndex];
|
|
1410
|
-
if (option2)
|
|
1424
|
+
if (option2) select2(option2);
|
|
1411
1425
|
else close2();
|
|
1412
1426
|
}
|
|
1413
1427
|
break;
|
|
@@ -1422,26 +1436,26 @@ var Combobox = /* @__PURE__ */ forwardRef18(function Combobox2(props, ref) {
|
|
|
1422
1436
|
break;
|
|
1423
1437
|
}
|
|
1424
1438
|
};
|
|
1425
|
-
|
|
1439
|
+
useEffect6(() => {
|
|
1426
1440
|
if (!open || activeIndex < 0) return;
|
|
1427
1441
|
document.getElementById(optionId(activeIndex))?.scrollIntoView?.({ block: "nearest" });
|
|
1428
1442
|
}, [open, activeIndex]);
|
|
1429
1443
|
const hasOptions = filtered.length > 0;
|
|
1430
1444
|
const noResults = open && !disabled && !hasOptions;
|
|
1431
|
-
const [announcedFor, setAnnouncedFor] =
|
|
1432
|
-
|
|
1445
|
+
const [announcedFor, setAnnouncedFor] = useState7(void 0);
|
|
1446
|
+
useEffect6(() => {
|
|
1433
1447
|
if (!noResults) return;
|
|
1434
|
-
const timer2 = setTimeout(() => setAnnouncedFor(query),
|
|
1448
|
+
const timer2 = setTimeout(() => setAnnouncedFor(query), ANNOUNCE_DELAY);
|
|
1435
1449
|
return () => clearTimeout(timer2);
|
|
1436
1450
|
}, [noResults, query]);
|
|
1437
1451
|
const announceNoResults = noResults && announcedFor === query;
|
|
1438
|
-
return /* @__PURE__ */
|
|
1439
|
-
label6 && /* @__PURE__ */
|
|
1452
|
+
return /* @__PURE__ */ jsxs17("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
|
|
1453
|
+
label6 && /* @__PURE__ */ jsxs17("label", { id: labelId, htmlFor: inputId, className: label, children: [
|
|
1440
1454
|
label6,
|
|
1441
1455
|
required && /* @__PURE__ */ jsx20("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
1442
1456
|
] }),
|
|
1443
|
-
/* @__PURE__ */
|
|
1444
|
-
/* @__PURE__ */ jsx20(Popover.Anchor, { asChild: true, children: /* @__PURE__ */
|
|
1457
|
+
/* @__PURE__ */ jsxs17(Popover.Root, { open: open && !disabled, onOpenChange: (next) => next ? openList() : close2(), children: [
|
|
1458
|
+
/* @__PURE__ */ jsx20(Popover.Anchor, { asChild: true, children: /* @__PURE__ */ jsxs17(
|
|
1445
1459
|
"div",
|
|
1446
1460
|
{
|
|
1447
1461
|
ref: anchorRef,
|
|
@@ -1540,7 +1554,7 @@ var Combobox = /* @__PURE__ */ forwardRef18(function Combobox2(props, ref) {
|
|
|
1540
1554
|
return (
|
|
1541
1555
|
// aria-activedescendant 패턴: 포커스·키보드는 입력창이 맡고 항목은 포커스를 받지 않는다 (WAI-ARIA combobox)
|
|
1542
1556
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/interactive-supports-focus
|
|
1543
|
-
/* @__PURE__ */
|
|
1557
|
+
/* @__PURE__ */ jsxs17(
|
|
1544
1558
|
"div",
|
|
1545
1559
|
{
|
|
1546
1560
|
id: optionId(index),
|
|
@@ -1553,7 +1567,7 @@ var Combobox = /* @__PURE__ */ forwardRef18(function Combobox2(props, ref) {
|
|
|
1553
1567
|
className: item4,
|
|
1554
1568
|
onMouseDown: (event) => event.preventDefault(),
|
|
1555
1569
|
onMouseMove: () => !option2.disabled && setActiveIndex(index),
|
|
1556
|
-
onClick: () =>
|
|
1570
|
+
onClick: () => select2(option2),
|
|
1557
1571
|
children: [
|
|
1558
1572
|
option2.label,
|
|
1559
1573
|
isSelected && /* @__PURE__ */ jsx20("span", { className: itemIndicator, "aria-hidden": true, children: /* @__PURE__ */ jsx20(CheckIcon, { size: 16 }) })
|
|
@@ -1578,7 +1592,7 @@ var Combobox = /* @__PURE__ */ forwardRef18(function Combobox2(props, ref) {
|
|
|
1578
1592
|
});
|
|
1579
1593
|
|
|
1580
1594
|
// src/components/DatePicker/DatePicker.tsx
|
|
1581
|
-
import { forwardRef as forwardRef19, useEffect as
|
|
1595
|
+
import { forwardRef as forwardRef19, useEffect as useEffect7, useRef as useRef9, useState as useState8 } from "react";
|
|
1582
1596
|
import { CalendarIcon } from "@bestow-ui/icons";
|
|
1583
1597
|
|
|
1584
1598
|
// src/components/Popover/Popover.tsx
|
|
@@ -1594,7 +1608,7 @@ var header4 = "_1j99p8x1";
|
|
|
1594
1608
|
var title3 = "_1j99p8x2";
|
|
1595
1609
|
|
|
1596
1610
|
// src/components/Popover/Popover.tsx
|
|
1597
|
-
import { jsx as jsx21, jsxs as
|
|
1611
|
+
import { jsx as jsx21, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1598
1612
|
function Popover2({
|
|
1599
1613
|
content: content12,
|
|
1600
1614
|
children,
|
|
@@ -1615,9 +1629,9 @@ function Popover2({
|
|
|
1615
1629
|
const portal2 = usePortalProps();
|
|
1616
1630
|
const m = useMessages();
|
|
1617
1631
|
const titleId = useId6();
|
|
1618
|
-
return /* @__PURE__ */
|
|
1632
|
+
return /* @__PURE__ */ jsxs18(RadixPopover.Root, { open, defaultOpen, onOpenChange, modal, children: [
|
|
1619
1633
|
/* @__PURE__ */ jsx21(RadixPopover.Trigger, { asChild: true, children }),
|
|
1620
|
-
/* @__PURE__ */ jsx21(RadixPopover.Portal, { children: /* @__PURE__ */
|
|
1634
|
+
/* @__PURE__ */ jsx21(RadixPopover.Portal, { children: /* @__PURE__ */ jsxs18(
|
|
1621
1635
|
RadixPopover.Content,
|
|
1622
1636
|
{
|
|
1623
1637
|
side,
|
|
@@ -1630,7 +1644,7 @@ function Popover2({
|
|
|
1630
1644
|
className: cx(portal2.className, content7, className),
|
|
1631
1645
|
style: { ...portal2.style, ...style },
|
|
1632
1646
|
children: [
|
|
1633
|
-
(title6 || showClose) && /* @__PURE__ */
|
|
1647
|
+
(title6 || showClose) && /* @__PURE__ */ jsxs18("div", { className: header4, children: [
|
|
1634
1648
|
title6 && /* @__PURE__ */ jsx21("h2", { id: titleId, className: title3, children: title6 }),
|
|
1635
1649
|
showClose && /* @__PURE__ */ jsx21(RadixPopover.Close, { className: closeButton3, "aria-label": m.close ?? "\uB2EB\uAE30", children: /* @__PURE__ */ jsx21(XIcon4, { size: 16 }) })
|
|
1636
1650
|
] }),
|
|
@@ -1644,7 +1658,7 @@ function Popover2({
|
|
|
1644
1658
|
var PopoverClose = RadixPopover.Close;
|
|
1645
1659
|
|
|
1646
1660
|
// src/components/DatePicker/DatePicker.tsx
|
|
1647
|
-
import { Fragment as
|
|
1661
|
+
import { Fragment as Fragment5, jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1648
1662
|
var sanitize2 = (input6) => input6.replace(/\D/g, "").slice(0, 8);
|
|
1649
1663
|
var format = (digits) => digits.length <= 4 ? digits : digits.length <= 6 ? `${digits.slice(0, 4)}-${digits.slice(4)}` : `${digits.slice(0, 4)}-${digits.slice(4, 6)}-${digits.slice(6)}`;
|
|
1650
1664
|
var isDigit3 = (char) => /\d/.test(char);
|
|
@@ -1681,8 +1695,8 @@ var DatePicker = /* @__PURE__ */ forwardRef19(
|
|
|
1681
1695
|
const invalidText = invalidTextProp ?? m.dateInvalid ?? "\uC62C\uBC14\uB978 \uB0A0\uC9DC\uAC00 \uC544\uB2C8\uC5D0\uC694.";
|
|
1682
1696
|
const unavailableText = unavailableTextProp ?? m.dateUnavailable ?? "\uACE0\uB97C \uC218 \uC5C6\uB294 \uB0A0\uC9DC\uC608\uC694.";
|
|
1683
1697
|
const incompleteText = incompleteTextProp ?? m.dateIncomplete ?? "\uB0A0\uC9DC\uB97C YYYY-MM-DD \uD615\uC2DD\uC73C\uB85C \uC785\uB825\uD574 \uC8FC\uC138\uC694.";
|
|
1684
|
-
const [open, setOpen] =
|
|
1685
|
-
const [touched, setTouched] =
|
|
1698
|
+
const [open, setOpen] = useState8(false);
|
|
1699
|
+
const [touched, setTouched] = useState8(false);
|
|
1686
1700
|
const isControlled = "value" in props;
|
|
1687
1701
|
const lastEmitted = useRef9(isControlled ? value3 ?? "" : defaultValue ?? "");
|
|
1688
1702
|
const minDate = parseISODate(min);
|
|
@@ -1709,7 +1723,7 @@ var DatePicker = /* @__PURE__ */ forwardRef19(
|
|
|
1709
1723
|
});
|
|
1710
1724
|
const textIso = toIso(field4.raw);
|
|
1711
1725
|
const { setRaw } = field4;
|
|
1712
|
-
|
|
1726
|
+
useEffect7(() => {
|
|
1713
1727
|
if (!isControlled) return;
|
|
1714
1728
|
const next = value3 ?? "";
|
|
1715
1729
|
lastEmitted.current = next;
|
|
@@ -1723,8 +1737,9 @@ var DatePicker = /* @__PURE__ */ forwardRef19(
|
|
|
1723
1737
|
const complete = field4.raw.length === 8;
|
|
1724
1738
|
const autoError = complete ? !date ? invalidText : isUnavailable(date) ? unavailableText : null : touched && field4.raw.length > 0 ? incompleteText : null;
|
|
1725
1739
|
const showAuto = autoError !== null && error === void 0;
|
|
1740
|
+
const announcement = useDelayedAnnouncement(showAuto && complete ? autoError ?? "" : "");
|
|
1726
1741
|
const selectedIso = date && !isUnavailable(date) ? textIso : "";
|
|
1727
|
-
return /* @__PURE__ */
|
|
1742
|
+
return /* @__PURE__ */ jsxs19(Fragment5, { children: [
|
|
1728
1743
|
/* @__PURE__ */ jsx22(
|
|
1729
1744
|
TextField,
|
|
1730
1745
|
{
|
|
@@ -1775,13 +1790,14 @@ var DatePicker = /* @__PURE__ */ forwardRef19(
|
|
|
1775
1790
|
)
|
|
1776
1791
|
}
|
|
1777
1792
|
),
|
|
1793
|
+
/* @__PURE__ */ jsx22("span", { role: "status", className: visuallyHidden, children: announcement }),
|
|
1778
1794
|
name && /* @__PURE__ */ jsx22("input", { type: "hidden", name, value: selectedIso })
|
|
1779
1795
|
] });
|
|
1780
1796
|
}
|
|
1781
1797
|
);
|
|
1782
1798
|
|
|
1783
1799
|
// src/components/DateRangePicker/DateRangePicker.tsx
|
|
1784
|
-
import { forwardRef as forwardRef20, useId as useId7, useState as
|
|
1800
|
+
import { forwardRef as forwardRef20, useId as useId7, useState as useState9 } from "react";
|
|
1785
1801
|
|
|
1786
1802
|
// src/components/DateRangePicker/DateRangePicker.css.ts
|
|
1787
1803
|
var field2 = "_17277dh3";
|
|
@@ -1792,7 +1808,7 @@ var presets = "_17277dh5";
|
|
|
1792
1808
|
var separator2 = "_17277dh4";
|
|
1793
1809
|
|
|
1794
1810
|
// src/components/DateRangePicker/DateRangePicker.tsx
|
|
1795
|
-
import { jsx as jsx23, jsxs as
|
|
1811
|
+
import { jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1796
1812
|
var DateRangePicker = /* @__PURE__ */ forwardRef20(
|
|
1797
1813
|
function DateRangePicker2(props, ref) {
|
|
1798
1814
|
const {
|
|
@@ -1823,7 +1839,7 @@ var DateRangePicker = /* @__PURE__ */ forwardRef20(
|
|
|
1823
1839
|
const helperId = helperText3 ? `${baseId}-helper` : void 0;
|
|
1824
1840
|
const isClient = useIsClient();
|
|
1825
1841
|
const isControlled = "value" in props;
|
|
1826
|
-
const [inner, setInner] =
|
|
1842
|
+
const [inner, setInner] = useState9(defaultValue ?? { start: "", end: "" });
|
|
1827
1843
|
const range3 = isControlled ? value3 ?? { start: "", end: "" } : inner;
|
|
1828
1844
|
const update = (next) => {
|
|
1829
1845
|
if (next.start === range3.start && next.end === range3.end) return;
|
|
@@ -1834,7 +1850,7 @@ var DateRangePicker = /* @__PURE__ */ forwardRef20(
|
|
|
1834
1850
|
const startLabel = startLabelProp ?? m.dateRangeStart ?? "\uC2DC\uC791\uC77C";
|
|
1835
1851
|
const endLabel = endLabelProp ?? m.dateRangeEnd ?? "\uC885\uB8CC\uC77C";
|
|
1836
1852
|
const common = { isDateDisabled, isHoliday, today, disabled, required, fullWidth: true };
|
|
1837
|
-
return /* @__PURE__ */
|
|
1853
|
+
return /* @__PURE__ */ jsxs20(
|
|
1838
1854
|
"fieldset",
|
|
1839
1855
|
{
|
|
1840
1856
|
ref,
|
|
@@ -1843,11 +1859,11 @@ var DateRangePicker = /* @__PURE__ */ forwardRef20(
|
|
|
1843
1859
|
"aria-describedby": helperId,
|
|
1844
1860
|
"data-invalid": error || void 0,
|
|
1845
1861
|
children: [
|
|
1846
|
-
label6 && /* @__PURE__ */
|
|
1862
|
+
label6 && /* @__PURE__ */ jsxs20("legend", { className: legend3, children: [
|
|
1847
1863
|
label6,
|
|
1848
1864
|
required && /* @__PURE__ */ jsx23("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
1849
1865
|
] }),
|
|
1850
|
-
/* @__PURE__ */
|
|
1866
|
+
/* @__PURE__ */ jsxs20("div", { className: fields, children: [
|
|
1851
1867
|
/* @__PURE__ */ jsx23("div", { className: field2, children: /* @__PURE__ */ jsx23(
|
|
1852
1868
|
DatePicker,
|
|
1853
1869
|
{
|
|
@@ -1920,7 +1936,7 @@ var overlay2 = "nmobyv0";
|
|
|
1920
1936
|
var title4 = "nmobyvv";
|
|
1921
1937
|
|
|
1922
1938
|
// src/components/Drawer/Drawer.tsx
|
|
1923
|
-
import { jsx as jsx24, jsxs as
|
|
1939
|
+
import { jsx as jsx24, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1924
1940
|
function Drawer({
|
|
1925
1941
|
open,
|
|
1926
1942
|
defaultOpen,
|
|
@@ -1939,11 +1955,11 @@ function Drawer({
|
|
|
1939
1955
|
const portal2 = usePortalProps();
|
|
1940
1956
|
const m = useMessages();
|
|
1941
1957
|
const focus = useReturnFocus(Boolean(trigger4));
|
|
1942
|
-
return /* @__PURE__ */
|
|
1958
|
+
return /* @__PURE__ */ jsxs21(Dialog2.Root, { open, defaultOpen, onOpenChange, children: [
|
|
1943
1959
|
trigger4 && /* @__PURE__ */ jsx24(Dialog2.Trigger, { asChild: true, children: trigger4 }),
|
|
1944
|
-
/* @__PURE__ */
|
|
1960
|
+
/* @__PURE__ */ jsxs21(Dialog2.Portal, { children: [
|
|
1945
1961
|
/* @__PURE__ */ jsx24(Dialog2.Overlay, { className: cx(portal2.className, overlay2), style: portal2.style }),
|
|
1946
|
-
/* @__PURE__ */
|
|
1962
|
+
/* @__PURE__ */ jsxs21(
|
|
1947
1963
|
Dialog2.Content,
|
|
1948
1964
|
{
|
|
1949
1965
|
className: cx(portal2.className, content8({ side, size }), className),
|
|
@@ -1954,8 +1970,8 @@ function Drawer({
|
|
|
1954
1970
|
onCloseAutoFocus: focus.onCloseAutoFocus,
|
|
1955
1971
|
...description7 ? {} : { "aria-describedby": void 0 },
|
|
1956
1972
|
children: [
|
|
1957
|
-
/* @__PURE__ */
|
|
1958
|
-
/* @__PURE__ */
|
|
1973
|
+
/* @__PURE__ */ jsxs21("div", { className: header5, children: [
|
|
1974
|
+
/* @__PURE__ */ jsxs21("div", { className: headings2, children: [
|
|
1959
1975
|
/* @__PURE__ */ jsx24(Dialog2.Title, { className: title4, children: title6 }),
|
|
1960
1976
|
description7 && /* @__PURE__ */ jsx24(Dialog2.Description, { className: description3, children: description7 })
|
|
1961
1977
|
] }),
|
|
@@ -1972,7 +1988,7 @@ function Drawer({
|
|
|
1972
1988
|
var DrawerClose = Dialog2.Close;
|
|
1973
1989
|
|
|
1974
1990
|
// src/components/ErrorSummary/ErrorSummary.tsx
|
|
1975
|
-
import { forwardRef as forwardRef21, useEffect as
|
|
1991
|
+
import { forwardRef as forwardRef21, useEffect as useEffect8, useId as useId8, useRef as useRef10 } from "react";
|
|
1976
1992
|
|
|
1977
1993
|
// src/components/ErrorSummary/ErrorSummary.css.ts
|
|
1978
1994
|
var link3 = "_1cdophv2";
|
|
@@ -1986,7 +2002,7 @@ var ErrorSummary = /* @__PURE__ */ forwardRef21(function ErrorSummary2({ errors:
|
|
|
1986
2002
|
const titleId = useId8();
|
|
1987
2003
|
const rootRef = useRef10(null);
|
|
1988
2004
|
const hasErrors = errors2.length > 0;
|
|
1989
|
-
|
|
2005
|
+
useEffect8(() => {
|
|
1990
2006
|
if (hasErrors) rootRef.current?.focus();
|
|
1991
2007
|
}, [focusKey, hasErrors]);
|
|
1992
2008
|
if (!hasErrors) return null;
|
|
@@ -2021,7 +2037,7 @@ var ErrorSummary = /* @__PURE__ */ forwardRef21(function ErrorSummary2({ errors:
|
|
|
2021
2037
|
});
|
|
2022
2038
|
|
|
2023
2039
|
// src/components/FileUpload/FileUpload.tsx
|
|
2024
|
-
import { forwardRef as forwardRef22, useEffect as
|
|
2040
|
+
import { forwardRef as forwardRef22, useEffect as useEffect9, useId as useId9, useRef as useRef11, useState as useState10 } from "react";
|
|
2025
2041
|
import { FileIcon, UploadIcon, XIcon as XIcon6 } from "@bestow-ui/icons";
|
|
2026
2042
|
|
|
2027
2043
|
// src/components/FileUpload/FileUpload.css.ts
|
|
@@ -2037,7 +2053,7 @@ var list4 = "r2jefr4";
|
|
|
2037
2053
|
var root8 = "r2jefr0";
|
|
2038
2054
|
|
|
2039
2055
|
// src/components/FileUpload/FileUpload.tsx
|
|
2040
|
-
import { jsx as jsx26, jsxs as
|
|
2056
|
+
import { jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2041
2057
|
var REMOVED_ANNOUNCE_DELAY = 500;
|
|
2042
2058
|
function formatSize(bytes) {
|
|
2043
2059
|
if (bytes < 1024) return `${bytes} B`;
|
|
@@ -2075,11 +2091,11 @@ var FileUpload = /* @__PURE__ */ forwardRef22(function FileUpload2(props, ref) {
|
|
|
2075
2091
|
} = props;
|
|
2076
2092
|
const m = useMessages();
|
|
2077
2093
|
const isControlled = "value" in props;
|
|
2078
|
-
const [innerFiles, setInnerFiles] =
|
|
2094
|
+
const [innerFiles, setInnerFiles] = useState10(defaultValue ?? []);
|
|
2079
2095
|
const files = isControlled ? value3 ?? NO_FILES : innerFiles;
|
|
2080
|
-
const [rejections, setRejections] =
|
|
2081
|
-
const [announcement, setAnnouncement] =
|
|
2082
|
-
const [dragging, setDragging] =
|
|
2096
|
+
const [rejections, setRejections] = useState10([]);
|
|
2097
|
+
const [announcement, setAnnouncement] = useState10("");
|
|
2098
|
+
const [dragging, setDragging] = useState10(false);
|
|
2083
2099
|
const generatedId = useId9();
|
|
2084
2100
|
const baseId = id ?? generatedId;
|
|
2085
2101
|
const labelId = label6 ? `${baseId}-label` : void 0;
|
|
@@ -2090,7 +2106,7 @@ var FileUpload = /* @__PURE__ */ forwardRef22(function FileUpload2(props, ref) {
|
|
|
2090
2106
|
const removeButtonRefs = useRef11([]);
|
|
2091
2107
|
const focusAfterRemove = useRef11(null);
|
|
2092
2108
|
const announceTimer = useRef11(void 0);
|
|
2093
|
-
|
|
2109
|
+
useEffect9(() => () => clearTimeout(announceTimer.current), []);
|
|
2094
2110
|
const selectLabel = m.fileSelect ?? "\uD30C\uC77C \uC120\uD0DD";
|
|
2095
2111
|
const reasonText = (rejection) => {
|
|
2096
2112
|
const fileName2 = rejection.file.name;
|
|
@@ -2138,13 +2154,13 @@ var FileUpload = /* @__PURE__ */ forwardRef22(function FileUpload2(props, ref) {
|
|
|
2138
2154
|
setRejections([]);
|
|
2139
2155
|
commit(next, m.fileRemoved?.(removed.name) ?? `${removed.name} \uC0AD\uC81C\uB428`, REMOVED_ANNOUNCE_DELAY);
|
|
2140
2156
|
};
|
|
2141
|
-
|
|
2157
|
+
useEffect9(() => {
|
|
2142
2158
|
if (focusAfterRemove.current === null) return;
|
|
2143
2159
|
const target = focusAfterRemove.current;
|
|
2144
2160
|
focusAfterRemove.current = null;
|
|
2145
2161
|
(target >= 0 ? removeButtonRefs.current[target] : selectButtonRef.current)?.focus();
|
|
2146
2162
|
}, [files]);
|
|
2147
|
-
|
|
2163
|
+
useEffect9(() => {
|
|
2148
2164
|
const input6 = inputRef.current;
|
|
2149
2165
|
if (!name || !input6 || typeof DataTransfer === "undefined") return;
|
|
2150
2166
|
try {
|
|
@@ -2159,12 +2175,12 @@ var FileUpload = /* @__PURE__ */ forwardRef22(function FileUpload2(props, ref) {
|
|
|
2159
2175
|
event.preventDefault();
|
|
2160
2176
|
setDragging(over);
|
|
2161
2177
|
};
|
|
2162
|
-
return /* @__PURE__ */
|
|
2163
|
-
label6 && /* @__PURE__ */
|
|
2178
|
+
return /* @__PURE__ */ jsxs22("div", { ref, className: cx(field, root8, className), children: [
|
|
2179
|
+
label6 && /* @__PURE__ */ jsxs22("span", { id: labelId, className: label, children: [
|
|
2164
2180
|
label6,
|
|
2165
2181
|
required && /* @__PURE__ */ jsx26("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
2166
2182
|
] }),
|
|
2167
|
-
/* @__PURE__ */
|
|
2183
|
+
/* @__PURE__ */ jsxs22(
|
|
2168
2184
|
"div",
|
|
2169
2185
|
{
|
|
2170
2186
|
role: "group",
|
|
@@ -2222,7 +2238,7 @@ var FileUpload = /* @__PURE__ */ forwardRef22(function FileUpload2(props, ref) {
|
|
|
2222
2238
|
]
|
|
2223
2239
|
}
|
|
2224
2240
|
),
|
|
2225
|
-
files.length > 0 && /* @__PURE__ */ jsx26("ul", { "aria-label": m.fileList ?? "\uC120\uD0DD\uD55C \uD30C\uC77C", className: list4, children: files.map((file, index) => /* @__PURE__ */
|
|
2241
|
+
files.length > 0 && /* @__PURE__ */ jsx26("ul", { "aria-label": m.fileList ?? "\uC120\uD0DD\uD55C \uD30C\uC77C", className: list4, children: files.map((file, index) => /* @__PURE__ */ jsxs22("li", { className: item5, children: [
|
|
2226
2242
|
/* @__PURE__ */ jsx26("span", { className: fileIcon, "aria-hidden": true, children: /* @__PURE__ */ jsx26(FileIcon, { size: 16 }) }),
|
|
2227
2243
|
/* @__PURE__ */ jsx26("span", { className: fileName, children: file.name }),
|
|
2228
2244
|
/* @__PURE__ */ jsx26("span", { id: `${baseId}-size-${index}`, className: fileSize, children: formatSize(file.size) }),
|
|
@@ -2267,7 +2283,7 @@ var subChevron = "_1d7ahuxb";
|
|
|
2267
2283
|
var subTrigger = "_1d7ahuxa";
|
|
2268
2284
|
|
|
2269
2285
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
2270
|
-
import { jsx as jsx27, jsxs as
|
|
2286
|
+
import { jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2271
2287
|
var DropdownMenu = RadixMenu.Root;
|
|
2272
2288
|
var DropdownMenuTrigger = RadixMenu.Trigger;
|
|
2273
2289
|
var DropdownMenuGroup = RadixMenu.Group;
|
|
@@ -2290,9 +2306,9 @@ var DropdownMenuContent = /* @__PURE__ */ forwardRef23(
|
|
|
2290
2306
|
}
|
|
2291
2307
|
);
|
|
2292
2308
|
var DropdownMenuItem = /* @__PURE__ */ forwardRef23(
|
|
2293
|
-
function DropdownMenuItem2({ icon:
|
|
2294
|
-
return /* @__PURE__ */
|
|
2295
|
-
|
|
2309
|
+
function DropdownMenuItem2({ icon: icon7, shortcut: shortcut2, color = "neutral", className, children, ...rest }, ref) {
|
|
2310
|
+
return /* @__PURE__ */ jsxs23(RadixMenu.Item, { ref, className: cx(item6, color === "danger" && danger, className), ...rest, children: [
|
|
2311
|
+
icon7 && /* @__PURE__ */ jsx27("span", { className: icon4, "aria-hidden": true, children: icon7 }),
|
|
2296
2312
|
children,
|
|
2297
2313
|
shortcut2 && /* @__PURE__ */ jsx27("span", { className: shortcut, "aria-hidden": true, children: shortcut2 })
|
|
2298
2314
|
] });
|
|
@@ -2310,7 +2326,7 @@ var DropdownMenuSeparator = /* @__PURE__ */ forwardRef23(
|
|
|
2310
2326
|
);
|
|
2311
2327
|
var DropdownMenuCheckboxItem = /* @__PURE__ */ forwardRef23(
|
|
2312
2328
|
function DropdownMenuCheckboxItem2({ className, children, ...rest }, ref) {
|
|
2313
|
-
return /* @__PURE__ */
|
|
2329
|
+
return /* @__PURE__ */ jsxs23(RadixMenu.CheckboxItem, { ref, className: cx(item6, className), ...rest, children: [
|
|
2314
2330
|
/* @__PURE__ */ jsx27("span", { className: indicator, "aria-hidden": true, children: /* @__PURE__ */ jsx27(RadixMenu.ItemIndicator, { className: indicatorInner, children: rest.checked === "indeterminate" ? /* @__PURE__ */ jsx27(MinusIcon, { size: 16 }) : /* @__PURE__ */ jsx27(CheckIcon2, { size: 16 }) }) }),
|
|
2315
2331
|
children
|
|
2316
2332
|
] });
|
|
@@ -2319,7 +2335,7 @@ var DropdownMenuCheckboxItem = /* @__PURE__ */ forwardRef23(
|
|
|
2319
2335
|
var DropdownMenuRadioGroup = RadixMenu.RadioGroup;
|
|
2320
2336
|
var DropdownMenuRadioItem = /* @__PURE__ */ forwardRef23(
|
|
2321
2337
|
function DropdownMenuRadioItem2({ className, children, ...rest }, ref) {
|
|
2322
|
-
return /* @__PURE__ */
|
|
2338
|
+
return /* @__PURE__ */ jsxs23(RadixMenu.RadioItem, { ref, className: cx(item6, className), ...rest, children: [
|
|
2323
2339
|
/* @__PURE__ */ jsx27("span", { className: indicator, "aria-hidden": true, children: /* @__PURE__ */ jsx27(RadixMenu.ItemIndicator, { className: indicatorInner, children: /* @__PURE__ */ jsx27("span", { className: radioDot }) }) }),
|
|
2324
2340
|
children
|
|
2325
2341
|
] });
|
|
@@ -2327,9 +2343,9 @@ var DropdownMenuRadioItem = /* @__PURE__ */ forwardRef23(
|
|
|
2327
2343
|
);
|
|
2328
2344
|
var DropdownMenuSub = RadixMenu.Sub;
|
|
2329
2345
|
var DropdownMenuSubTrigger = /* @__PURE__ */ forwardRef23(
|
|
2330
|
-
function DropdownMenuSubTrigger2({ icon:
|
|
2331
|
-
return /* @__PURE__ */
|
|
2332
|
-
|
|
2346
|
+
function DropdownMenuSubTrigger2({ icon: icon7, className, children, ...rest }, ref) {
|
|
2347
|
+
return /* @__PURE__ */ jsxs23(RadixMenu.SubTrigger, { ref, className: cx(item6, subTrigger, className), ...rest, children: [
|
|
2348
|
+
icon7 && /* @__PURE__ */ jsx27("span", { className: icon4, "aria-hidden": true, children: icon7 }),
|
|
2333
2349
|
children,
|
|
2334
2350
|
/* @__PURE__ */ jsx27("span", { className: subChevron, "aria-hidden": true, children: /* @__PURE__ */ jsx27(ChevronRightIcon3, { size: 16 }) })
|
|
2335
2351
|
] });
|
|
@@ -2354,7 +2370,7 @@ var DropdownMenuSubContent = /* @__PURE__ */ forwardRef23(
|
|
|
2354
2370
|
);
|
|
2355
2371
|
|
|
2356
2372
|
// src/components/NumberInput/NumberInput.tsx
|
|
2357
|
-
import { forwardRef as forwardRef24, useEffect as
|
|
2373
|
+
import { forwardRef as forwardRef24, useEffect as useEffect10, useId as useId10, useRef as useRef12, useState as useState11 } from "react";
|
|
2358
2374
|
import { MinusIcon as MinusIcon2, PlusIcon } from "@bestow-ui/icons";
|
|
2359
2375
|
|
|
2360
2376
|
// src/components/NumberInput/NumberInput.css.ts
|
|
@@ -2365,7 +2381,7 @@ var stepper = /* @__PURE__ */ _7a46811({ defaultClassName: "_1vq2qhv3", variantC
|
|
|
2365
2381
|
var unit = "_1vq2qhv2";
|
|
2366
2382
|
|
|
2367
2383
|
// src/components/NumberInput/NumberInput.tsx
|
|
2368
|
-
import { Fragment as
|
|
2384
|
+
import { Fragment as Fragment6, jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2369
2385
|
var MAX_DIGITS2 = 15;
|
|
2370
2386
|
var isMeaningful = (char) => /[\d.-]/.test(char);
|
|
2371
2387
|
var decimalsOf = (n) => Number.isFinite(n) ? String(n).split(".")[1]?.length ?? 0 : 0;
|
|
@@ -2434,7 +2450,7 @@ var NumberInput = /* @__PURE__ */ forwardRef24(
|
|
|
2434
2450
|
inputRef
|
|
2435
2451
|
});
|
|
2436
2452
|
const { setRaw } = field4;
|
|
2437
|
-
|
|
2453
|
+
useEffect10(() => {
|
|
2438
2454
|
if (!isControlled) return;
|
|
2439
2455
|
const next = value3 ?? null;
|
|
2440
2456
|
lastEmitted.current = next;
|
|
@@ -2442,7 +2458,7 @@ var NumberInput = /* @__PURE__ */ forwardRef24(
|
|
|
2442
2458
|
}, [value3]);
|
|
2443
2459
|
const current2 = parse(field4.raw);
|
|
2444
2460
|
const valueText = (n) => `${format2(toRaw(n))}${unit2 ?? ""}`;
|
|
2445
|
-
const [announcement, setAnnouncement] =
|
|
2461
|
+
const [announcement, setAnnouncement] = useState11("");
|
|
2446
2462
|
const setValue = (next, announce = true) => {
|
|
2447
2463
|
setRaw(toRaw(next));
|
|
2448
2464
|
emit(next);
|
|
@@ -2490,7 +2506,7 @@ var NumberInput = /* @__PURE__ */ forwardRef24(
|
|
|
2490
2506
|
children: direction < 0 ? /* @__PURE__ */ jsx28(MinusIcon2, {}) : /* @__PURE__ */ jsx28(PlusIcon, {})
|
|
2491
2507
|
}
|
|
2492
2508
|
);
|
|
2493
|
-
return /* @__PURE__ */
|
|
2509
|
+
return /* @__PURE__ */ jsxs24(Fragment6, { children: [
|
|
2494
2510
|
/* @__PURE__ */ jsx28(
|
|
2495
2511
|
TextField,
|
|
2496
2512
|
{
|
|
@@ -2519,7 +2535,7 @@ var NumberInput = /* @__PURE__ */ forwardRef24(
|
|
|
2519
2535
|
disabled,
|
|
2520
2536
|
readOnly,
|
|
2521
2537
|
startAdornment: hideStepper ? void 0 : stepper2(-1),
|
|
2522
|
-
endAdornment: unit2 || !hideStepper ? /* @__PURE__ */
|
|
2538
|
+
endAdornment: unit2 || !hideStepper ? /* @__PURE__ */ jsxs24("span", { className: end, children: [
|
|
2523
2539
|
unit2 && /* @__PURE__ */ jsx28("span", { className: unit, children: unit2 }),
|
|
2524
2540
|
!hideStepper && stepper2(1)
|
|
2525
2541
|
] }) : void 0,
|
|
@@ -2535,7 +2551,7 @@ var NumberInput = /* @__PURE__ */ forwardRef24(
|
|
|
2535
2551
|
|
|
2536
2552
|
// src/components/Pagination/Pagination.tsx
|
|
2537
2553
|
import { ChevronLeftIcon as ChevronLeftIcon2, ChevronRightIcon as ChevronRightIcon4 } from "@bestow-ui/icons";
|
|
2538
|
-
import { forwardRef as forwardRef25, useState as
|
|
2554
|
+
import { forwardRef as forwardRef25, useState as useState12 } from "react";
|
|
2539
2555
|
|
|
2540
2556
|
// src/components/Pagination/getPaginationItems.ts
|
|
2541
2557
|
var range = (start, end2) => end2 < start ? [] : Array.from({ length: end2 - start + 1 }, (_, i) => start + i);
|
|
@@ -2568,7 +2584,7 @@ var item7 = /* @__PURE__ */ _7a46812({ defaultClassName: "_1iraoak1", variantCla
|
|
|
2568
2584
|
var list5 = "_1iraoak0";
|
|
2569
2585
|
|
|
2570
2586
|
// src/components/Pagination/Pagination.tsx
|
|
2571
|
-
import { jsx as jsx29, jsxs as
|
|
2587
|
+
import { jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2572
2588
|
var Pagination = /* @__PURE__ */ forwardRef25(function Pagination2({
|
|
2573
2589
|
totalPages,
|
|
2574
2590
|
page: pageProp,
|
|
@@ -2582,7 +2598,7 @@ var Pagination = /* @__PURE__ */ forwardRef25(function Pagination2({
|
|
|
2582
2598
|
"aria-label": ariaLabelProp,
|
|
2583
2599
|
...rest
|
|
2584
2600
|
}, ref) {
|
|
2585
|
-
const [uncontrolledPage, setUncontrolledPage] =
|
|
2601
|
+
const [uncontrolledPage, setUncontrolledPage] = useState12(defaultPage);
|
|
2586
2602
|
const m = useMessages();
|
|
2587
2603
|
const ariaLabel = ariaLabelProp ?? m.pagination ?? "\uD398\uC774\uC9C0 \uD0D0\uC0C9";
|
|
2588
2604
|
const getItemLabel = getItemLabelProp ?? ((type, n) => type === "previous" ? m.paginationPrevious ?? "\uC774\uC804 \uD398\uC774\uC9C0" : type === "next" ? m.paginationNext ?? "\uB2E4\uC74C \uD398\uC774\uC9C0" : m.paginationPage?.(n) ?? `${n} \uD398\uC774\uC9C0`);
|
|
@@ -2594,7 +2610,7 @@ var Pagination = /* @__PURE__ */ forwardRef25(function Pagination2({
|
|
|
2594
2610
|
onPageChange?.(next);
|
|
2595
2611
|
};
|
|
2596
2612
|
const itemClass = item7({ size });
|
|
2597
|
-
return /* @__PURE__ */ jsx29("nav", { ref, "aria-label": ariaLabel, className, ...rest, children: /* @__PURE__ */
|
|
2613
|
+
return /* @__PURE__ */ jsx29("nav", { ref, "aria-label": ariaLabel, className, ...rest, children: /* @__PURE__ */ jsxs25("ul", { className: list5, children: [
|
|
2598
2614
|
/* @__PURE__ */ jsx29("li", { children: /* @__PURE__ */ jsx29(
|
|
2599
2615
|
"button",
|
|
2600
2616
|
{
|
|
@@ -2635,6 +2651,7 @@ var Pagination = /* @__PURE__ */ forwardRef25(function Pagination2({
|
|
|
2635
2651
|
|
|
2636
2652
|
// src/components/PhoneNumberInput/PhoneNumberInput.tsx
|
|
2637
2653
|
import { forwardRef as forwardRef26, useRef as useRef13 } from "react";
|
|
2654
|
+
import { formatPhoneNumber, phoneNumberMaxDigits } from "@bestow-ui/korean-utils";
|
|
2638
2655
|
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
2639
2656
|
var sanitize3 = (input6) => {
|
|
2640
2657
|
const digits = input6.replace(/\D/g, "");
|
|
@@ -2687,7 +2704,7 @@ var PhoneNumberInput = /* @__PURE__ */ forwardRef26(
|
|
|
2687
2704
|
);
|
|
2688
2705
|
|
|
2689
2706
|
// src/components/RadioGroup/RadioGroup.tsx
|
|
2690
|
-
import { forwardRef as forwardRef27, useId as useId11, useState as
|
|
2707
|
+
import { forwardRef as forwardRef27, useId as useId11, useState as useState13 } from "react";
|
|
2691
2708
|
|
|
2692
2709
|
// src/components/RadioGroup/RadioGroup.css.ts
|
|
2693
2710
|
import { createRuntimeFn as _7a46813 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
@@ -2700,7 +2717,7 @@ var radio = /* @__PURE__ */ _7a46813({ defaultClassName: "_1w9iwjm7", variantCla
|
|
|
2700
2717
|
var text = "_1w9iwjma";
|
|
2701
2718
|
|
|
2702
2719
|
// src/components/RadioGroup/RadioGroup.tsx
|
|
2703
|
-
import { jsx as jsx31, jsxs as
|
|
2720
|
+
import { jsx as jsx31, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2704
2721
|
var RadioGroup2 = /* @__PURE__ */ forwardRef27(function RadioGroup3(props, ref) {
|
|
2705
2722
|
const {
|
|
2706
2723
|
options,
|
|
@@ -2720,7 +2737,7 @@ var RadioGroup2 = /* @__PURE__ */ forwardRef27(function RadioGroup3(props, ref)
|
|
|
2720
2737
|
className
|
|
2721
2738
|
} = props;
|
|
2722
2739
|
const isControlled = "value" in props;
|
|
2723
|
-
const [innerValue, setInnerValue] =
|
|
2740
|
+
const [innerValue, setInnerValue] = useState13(defaultValue ?? "");
|
|
2724
2741
|
const current2 = isControlled ? value3 ?? "" : innerValue;
|
|
2725
2742
|
const generatedId = useId11();
|
|
2726
2743
|
const baseId = id ?? generatedId;
|
|
@@ -2733,8 +2750,8 @@ var RadioGroup2 = /* @__PURE__ */ forwardRef27(function RadioGroup3(props, ref)
|
|
|
2733
2750
|
if (!isControlled) setInnerValue(next);
|
|
2734
2751
|
onValueChange?.(next);
|
|
2735
2752
|
};
|
|
2736
|
-
return /* @__PURE__ */
|
|
2737
|
-
label6 && /* @__PURE__ */
|
|
2753
|
+
return /* @__PURE__ */ jsxs26("div", { className: cx(field, className), children: [
|
|
2754
|
+
label6 && /* @__PURE__ */ jsxs26("span", { id: labelId, className: cx(label, groupLabel), children: [
|
|
2738
2755
|
label6,
|
|
2739
2756
|
required && /* @__PURE__ */ jsx31("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
2740
2757
|
] }),
|
|
@@ -2756,7 +2773,7 @@ var RadioGroup2 = /* @__PURE__ */ forwardRef27(function RadioGroup3(props, ref)
|
|
|
2756
2773
|
const descriptionId = option2.description ? `${itemId}-description` : void 0;
|
|
2757
2774
|
const itemDisabled = disabled || option2.disabled;
|
|
2758
2775
|
const checked = option2.value === current2;
|
|
2759
|
-
return /* @__PURE__ */
|
|
2776
|
+
return /* @__PURE__ */ jsxs26("div", { className: option({ size }), "data-disabled": itemDisabled || void 0, children: [
|
|
2760
2777
|
/* @__PURE__ */ jsx31(
|
|
2761
2778
|
"input",
|
|
2762
2779
|
{
|
|
@@ -2774,7 +2791,7 @@ var RadioGroup2 = /* @__PURE__ */ forwardRef27(function RadioGroup3(props, ref)
|
|
|
2774
2791
|
className: radio({ size })
|
|
2775
2792
|
}
|
|
2776
2793
|
),
|
|
2777
|
-
/* @__PURE__ */
|
|
2794
|
+
/* @__PURE__ */ jsxs26("span", { className: text, children: [
|
|
2778
2795
|
/* @__PURE__ */ jsx31("label", { htmlFor: itemId, className: labelText, children: option2.label }),
|
|
2779
2796
|
option2.description && /* @__PURE__ */ jsx31("span", { id: descriptionId, className: description4, children: option2.description })
|
|
2780
2797
|
] })
|
|
@@ -2787,7 +2804,7 @@ var RadioGroup2 = /* @__PURE__ */ forwardRef27(function RadioGroup3(props, ref)
|
|
|
2787
2804
|
});
|
|
2788
2805
|
|
|
2789
2806
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
2790
|
-
import { forwardRef as forwardRef28, useId as useId12, useRef as useRef14, useState as
|
|
2807
|
+
import { forwardRef as forwardRef28, useId as useId12, useRef as useRef14, useState as useState14 } from "react";
|
|
2791
2808
|
|
|
2792
2809
|
// src/components/SegmentedControl/SegmentedControl.css.ts
|
|
2793
2810
|
import { createRuntimeFn as _7a46814 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
@@ -2796,7 +2813,7 @@ var item8 = /* @__PURE__ */ _7a46814({ defaultClassName: "_1h65mmo2", variantCla
|
|
|
2796
2813
|
var root9 = /* @__PURE__ */ _7a46814({ defaultClassName: "_1h65mmo0", variantClassNames: { fullWidth: { true: "_1h65mmo1" } }, defaultVariants: {}, compoundVariants: [] });
|
|
2797
2814
|
|
|
2798
2815
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
2799
|
-
import { jsx as jsx32, jsxs as
|
|
2816
|
+
import { jsx as jsx32, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2800
2817
|
var NEXT_KEYS = { ArrowRight: 1, ArrowDown: 1, ArrowLeft: -1, ArrowUp: -1 };
|
|
2801
2818
|
var SegmentedControl = /* @__PURE__ */ forwardRef28(
|
|
2802
2819
|
function SegmentedControl2(props, ref) {
|
|
@@ -2815,13 +2832,13 @@ var SegmentedControl = /* @__PURE__ */ forwardRef28(
|
|
|
2815
2832
|
className
|
|
2816
2833
|
} = props;
|
|
2817
2834
|
const isControlled = "value" in props;
|
|
2818
|
-
const [innerValue, setInnerValue] =
|
|
2835
|
+
const [innerValue, setInnerValue] = useState14(defaultValue ?? "");
|
|
2819
2836
|
const current2 = isControlled ? value3 ?? "" : innerValue;
|
|
2820
2837
|
const generatedId = useId12();
|
|
2821
2838
|
const labelId = label6 ? `${id ?? generatedId}-label` : void 0;
|
|
2822
2839
|
const itemRefs = useRef14([]);
|
|
2823
2840
|
const isEnabled = (index) => !disabled && !options[index]?.disabled;
|
|
2824
|
-
const
|
|
2841
|
+
const select2 = (index) => {
|
|
2825
2842
|
const next = options[index].value;
|
|
2826
2843
|
if (next === current2) return;
|
|
2827
2844
|
if (!isControlled) setInnerValue(next);
|
|
@@ -2848,9 +2865,9 @@ var SegmentedControl = /* @__PURE__ */ forwardRef28(
|
|
|
2848
2865
|
if (target < 0) return;
|
|
2849
2866
|
event.preventDefault();
|
|
2850
2867
|
itemRefs.current[target]?.focus();
|
|
2851
|
-
|
|
2868
|
+
select2(target);
|
|
2852
2869
|
};
|
|
2853
|
-
const group = /* @__PURE__ */
|
|
2870
|
+
const group = /* @__PURE__ */ jsxs27(
|
|
2854
2871
|
"div",
|
|
2855
2872
|
{
|
|
2856
2873
|
ref,
|
|
@@ -2863,7 +2880,7 @@ var SegmentedControl = /* @__PURE__ */ forwardRef28(
|
|
|
2863
2880
|
children: [
|
|
2864
2881
|
options.map((option2, index) => {
|
|
2865
2882
|
const checked = index === checkedIndex;
|
|
2866
|
-
return /* @__PURE__ */
|
|
2883
|
+
return /* @__PURE__ */ jsxs27(
|
|
2867
2884
|
"button",
|
|
2868
2885
|
{
|
|
2869
2886
|
ref: (node) => {
|
|
@@ -2877,7 +2894,7 @@ var SegmentedControl = /* @__PURE__ */ forwardRef28(
|
|
|
2877
2894
|
"data-state": checked ? "checked" : "unchecked",
|
|
2878
2895
|
"data-disabled": isEnabled(index) ? void 0 : "",
|
|
2879
2896
|
className: item8({ size, fullWidth }),
|
|
2880
|
-
onClick: () =>
|
|
2897
|
+
onClick: () => select2(index),
|
|
2881
2898
|
onKeyDown: (event) => handleKeyDown(event, index),
|
|
2882
2899
|
children: [
|
|
2883
2900
|
option2.icon && /* @__PURE__ */ jsx32("span", { "aria-hidden": true, className: icon5, children: option2.icon }),
|
|
@@ -2892,19 +2909,98 @@ var SegmentedControl = /* @__PURE__ */ forwardRef28(
|
|
|
2892
2909
|
}
|
|
2893
2910
|
);
|
|
2894
2911
|
if (!label6) return group;
|
|
2895
|
-
return /* @__PURE__ */
|
|
2912
|
+
return /* @__PURE__ */ jsxs27("div", { className: cx(field, className), children: [
|
|
2896
2913
|
/* @__PURE__ */ jsx32("span", { id: labelId, className: label, children: label6 }),
|
|
2897
2914
|
group
|
|
2898
2915
|
] });
|
|
2899
2916
|
}
|
|
2900
2917
|
);
|
|
2901
2918
|
|
|
2919
|
+
// src/components/NativeSelect/NativeSelect.tsx
|
|
2920
|
+
import { forwardRef as forwardRef29, useId as useId13 } from "react";
|
|
2921
|
+
import { ChevronDownIcon as ChevronDownIcon4 } from "@bestow-ui/icons";
|
|
2922
|
+
|
|
2923
|
+
// src/components/NativeSelect/NativeSelect.css.ts
|
|
2924
|
+
import { createRuntimeFn as _7a46815 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
2925
|
+
var icon6 = /* @__PURE__ */ _7a46815({ defaultClassName: "_5silym5", variantClassNames: { size: { sm: "_5silym6", md: "_5silym7", lg: "_5silym8" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
2926
|
+
var select = /* @__PURE__ */ _7a46815({ defaultClassName: "_5silym1", variantClassNames: { size: { sm: "_5silym2", md: "_5silym3", lg: "_5silym4" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
2927
|
+
var wrapper = "_5silym0";
|
|
2928
|
+
|
|
2929
|
+
// src/components/NativeSelect/NativeSelect.tsx
|
|
2930
|
+
import { jsx as jsx33, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2931
|
+
var NativeSelect = /* @__PURE__ */ forwardRef29(function NativeSelect2({
|
|
2932
|
+
options,
|
|
2933
|
+
onValueChange,
|
|
2934
|
+
onChange,
|
|
2935
|
+
placeholder,
|
|
2936
|
+
label: label6,
|
|
2937
|
+
helperText: helperText3,
|
|
2938
|
+
error,
|
|
2939
|
+
size,
|
|
2940
|
+
fullWidth,
|
|
2941
|
+
required,
|
|
2942
|
+
disabled,
|
|
2943
|
+
id,
|
|
2944
|
+
value: value3,
|
|
2945
|
+
defaultValue,
|
|
2946
|
+
className,
|
|
2947
|
+
children,
|
|
2948
|
+
"aria-describedby": ariaDescribedBy,
|
|
2949
|
+
...rest
|
|
2950
|
+
}, ref) {
|
|
2951
|
+
const generatedId = useId13();
|
|
2952
|
+
const selectId = id ?? generatedId;
|
|
2953
|
+
const helperId = helperText3 ? `${selectId}-helper` : void 0;
|
|
2954
|
+
const handleChange = (event) => {
|
|
2955
|
+
onChange?.(event);
|
|
2956
|
+
onValueChange?.(event.target.value);
|
|
2957
|
+
};
|
|
2958
|
+
return /* @__PURE__ */ jsxs28("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
|
|
2959
|
+
label6 && /* @__PURE__ */ jsxs28("label", { htmlFor: selectId, className: label, children: [
|
|
2960
|
+
label6,
|
|
2961
|
+
required && /* @__PURE__ */ jsx33("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
2962
|
+
] }),
|
|
2963
|
+
/* @__PURE__ */ jsxs28(
|
|
2964
|
+
"span",
|
|
2965
|
+
{
|
|
2966
|
+
className: cx(root3({ size, fullWidth }), wrapper),
|
|
2967
|
+
"data-invalid": error || void 0,
|
|
2968
|
+
"data-disabled": disabled || void 0,
|
|
2969
|
+
children: [
|
|
2970
|
+
/* @__PURE__ */ jsxs28(
|
|
2971
|
+
"select",
|
|
2972
|
+
{
|
|
2973
|
+
ref,
|
|
2974
|
+
id: selectId,
|
|
2975
|
+
value: value3,
|
|
2976
|
+
defaultValue: value3 === void 0 && defaultValue === void 0 && placeholder !== void 0 ? "" : defaultValue,
|
|
2977
|
+
onChange: handleChange,
|
|
2978
|
+
required,
|
|
2979
|
+
disabled,
|
|
2980
|
+
"aria-invalid": error || void 0,
|
|
2981
|
+
"aria-describedby": cx(helperId, ariaDescribedBy) || void 0,
|
|
2982
|
+
className: cx(select({ size }), className),
|
|
2983
|
+
...rest,
|
|
2984
|
+
children: [
|
|
2985
|
+
placeholder !== void 0 && /* @__PURE__ */ jsx33("option", { value: "", disabled: true, children: placeholder }),
|
|
2986
|
+
options ? options.map((option2) => /* @__PURE__ */ jsx33("option", { value: option2.value, disabled: option2.disabled, children: option2.label }, option2.value)) : children
|
|
2987
|
+
]
|
|
2988
|
+
}
|
|
2989
|
+
),
|
|
2990
|
+
/* @__PURE__ */ jsx33(ChevronDownIcon4, { size: 16, className: icon6({ size }) })
|
|
2991
|
+
]
|
|
2992
|
+
}
|
|
2993
|
+
),
|
|
2994
|
+
helperText3 && /* @__PURE__ */ jsx33("p", { id: helperId, className: helperText({ error }), children: helperText3 })
|
|
2995
|
+
] });
|
|
2996
|
+
});
|
|
2997
|
+
|
|
2902
2998
|
// src/components/Select/Select.tsx
|
|
2903
2999
|
import * as RadixSelect from "@radix-ui/react-select";
|
|
2904
|
-
import { forwardRef as
|
|
2905
|
-
import { CheckIcon as CheckIcon3, ChevronDownIcon as
|
|
2906
|
-
import { jsx as
|
|
2907
|
-
var Select = /* @__PURE__ */
|
|
3000
|
+
import { forwardRef as forwardRef30, useId as useId14 } from "react";
|
|
3001
|
+
import { CheckIcon as CheckIcon3, ChevronDownIcon as ChevronDownIcon5 } from "@bestow-ui/icons";
|
|
3002
|
+
import { jsx as jsx34, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3003
|
+
var Select = /* @__PURE__ */ forwardRef30(function Select2(props, ref) {
|
|
2908
3004
|
const {
|
|
2909
3005
|
options,
|
|
2910
3006
|
value: value3,
|
|
@@ -2924,16 +3020,16 @@ var Select = /* @__PURE__ */ forwardRef29(function Select2(props, ref) {
|
|
|
2924
3020
|
className
|
|
2925
3021
|
} = props;
|
|
2926
3022
|
const isControlled = "value" in props;
|
|
2927
|
-
const generatedId =
|
|
3023
|
+
const generatedId = useId14();
|
|
2928
3024
|
const triggerId = id ?? generatedId;
|
|
2929
3025
|
const helperId = helperText3 ? `${triggerId}-helper` : void 0;
|
|
2930
3026
|
const portal2 = usePortalProps();
|
|
2931
|
-
return /* @__PURE__ */
|
|
2932
|
-
label6 && /* @__PURE__ */
|
|
3027
|
+
return /* @__PURE__ */ jsxs29("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
|
|
3028
|
+
label6 && /* @__PURE__ */ jsxs29("label", { htmlFor: triggerId, className: label, children: [
|
|
2933
3029
|
label6,
|
|
2934
|
-
required && /* @__PURE__ */
|
|
3030
|
+
required && /* @__PURE__ */ jsx34("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
2935
3031
|
] }),
|
|
2936
|
-
/* @__PURE__ */
|
|
3032
|
+
/* @__PURE__ */ jsxs29(
|
|
2937
3033
|
RadixSelect.Root,
|
|
2938
3034
|
{
|
|
2939
3035
|
value: isControlled ? value3 ?? "" : void 0,
|
|
@@ -2943,7 +3039,7 @@ var Select = /* @__PURE__ */ forwardRef29(function Select2(props, ref) {
|
|
|
2943
3039
|
required,
|
|
2944
3040
|
name,
|
|
2945
3041
|
children: [
|
|
2946
|
-
/* @__PURE__ */
|
|
3042
|
+
/* @__PURE__ */ jsxs29(
|
|
2947
3043
|
RadixSelect.Trigger,
|
|
2948
3044
|
{
|
|
2949
3045
|
ref,
|
|
@@ -2954,12 +3050,12 @@ var Select = /* @__PURE__ */ forwardRef29(function Select2(props, ref) {
|
|
|
2954
3050
|
"data-invalid": error || void 0,
|
|
2955
3051
|
className: cx(root3({ size, fullWidth }), trigger2, className),
|
|
2956
3052
|
children: [
|
|
2957
|
-
/* @__PURE__ */
|
|
2958
|
-
/* @__PURE__ */
|
|
3053
|
+
/* @__PURE__ */ jsx34("span", { className: value, children: /* @__PURE__ */ jsx34(RadixSelect.Value, { placeholder }) }),
|
|
3054
|
+
/* @__PURE__ */ jsx34(RadixSelect.Icon, { className: icon3, children: /* @__PURE__ */ jsx34(ChevronDownIcon5, { size: 16 }) })
|
|
2959
3055
|
]
|
|
2960
3056
|
}
|
|
2961
3057
|
),
|
|
2962
|
-
/* @__PURE__ */
|
|
3058
|
+
/* @__PURE__ */ jsx34(RadixSelect.Portal, { children: /* @__PURE__ */ jsx34(
|
|
2963
3059
|
RadixSelect.Content,
|
|
2964
3060
|
{
|
|
2965
3061
|
position: "popper",
|
|
@@ -2967,15 +3063,15 @@ var Select = /* @__PURE__ */ forwardRef29(function Select2(props, ref) {
|
|
|
2967
3063
|
collisionPadding: 8,
|
|
2968
3064
|
className: cx(portal2.className, content5),
|
|
2969
3065
|
style: portal2.style,
|
|
2970
|
-
children: /* @__PURE__ */
|
|
3066
|
+
children: /* @__PURE__ */ jsx34(RadixSelect.Viewport, { className: viewport, children: options.map((option2) => /* @__PURE__ */ jsxs29(
|
|
2971
3067
|
RadixSelect.Item,
|
|
2972
3068
|
{
|
|
2973
3069
|
value: option2.value,
|
|
2974
3070
|
disabled: option2.disabled,
|
|
2975
3071
|
className: item4,
|
|
2976
3072
|
children: [
|
|
2977
|
-
/* @__PURE__ */
|
|
2978
|
-
/* @__PURE__ */
|
|
3073
|
+
/* @__PURE__ */ jsx34(RadixSelect.ItemText, { children: option2.label }),
|
|
3074
|
+
/* @__PURE__ */ jsx34(RadixSelect.ItemIndicator, { className: itemIndicator, children: /* @__PURE__ */ jsx34(CheckIcon3, { size: 16 }) })
|
|
2979
3075
|
]
|
|
2980
3076
|
},
|
|
2981
3077
|
option2.value
|
|
@@ -2985,19 +3081,19 @@ var Select = /* @__PURE__ */ forwardRef29(function Select2(props, ref) {
|
|
|
2985
3081
|
]
|
|
2986
3082
|
}
|
|
2987
3083
|
),
|
|
2988
|
-
helperText3 && /* @__PURE__ */
|
|
3084
|
+
helperText3 && /* @__PURE__ */ jsx34("p", { id: helperId, className: helperText({ error }), children: helperText3 })
|
|
2989
3085
|
] });
|
|
2990
3086
|
});
|
|
2991
3087
|
|
|
2992
3088
|
// src/components/SkipLink/SkipLink.tsx
|
|
2993
|
-
import { forwardRef as
|
|
3089
|
+
import { forwardRef as forwardRef31 } from "react";
|
|
2994
3090
|
|
|
2995
3091
|
// src/components/SkipLink/SkipLink.css.ts
|
|
2996
3092
|
var skipLink = "_1t9jaar0";
|
|
2997
3093
|
|
|
2998
3094
|
// src/components/SkipLink/SkipLink.tsx
|
|
2999
|
-
import { jsx as
|
|
3000
|
-
var SkipLink = /* @__PURE__ */
|
|
3095
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
3096
|
+
var SkipLink = /* @__PURE__ */ forwardRef31(function SkipLink2({ href = "#main", className, children, onClick, ...rest }, ref) {
|
|
3001
3097
|
const m = useMessages();
|
|
3002
3098
|
const handleClick = (event) => {
|
|
3003
3099
|
onClick?.(event);
|
|
@@ -3009,28 +3105,28 @@ var SkipLink = /* @__PURE__ */ forwardRef30(function SkipLink2({ href = "#main",
|
|
|
3009
3105
|
target.focus();
|
|
3010
3106
|
target.scrollIntoView?.({ block: "start" });
|
|
3011
3107
|
};
|
|
3012
|
-
return /* @__PURE__ */
|
|
3108
|
+
return /* @__PURE__ */ jsx35("a", { ref, href, className: cx(skipLink, className), onClick: handleClick, ...rest, children: children ?? m.skipToContent ?? "\uBCF8\uBB38 \uBC14\uB85C\uAC00\uAE30" });
|
|
3013
3109
|
});
|
|
3014
3110
|
|
|
3015
3111
|
// src/components/Slider/Slider.tsx
|
|
3016
3112
|
import * as RadixSlider from "@radix-ui/react-slider";
|
|
3017
|
-
import { forwardRef as
|
|
3113
|
+
import { forwardRef as forwardRef32, useId as useId15, useState as useState15 } from "react";
|
|
3018
3114
|
|
|
3019
3115
|
// src/components/Slider/Slider.css.ts
|
|
3020
|
-
import { createRuntimeFn as
|
|
3116
|
+
import { createRuntimeFn as _7a46816 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3021
3117
|
var field3 = "_126mzjm0";
|
|
3022
3118
|
var header6 = "_126mzjm1";
|
|
3023
3119
|
var helperText2 = "_126mzjm4";
|
|
3024
3120
|
var label3 = "_126mzjm2";
|
|
3025
3121
|
var range2 = "_126mzjmb";
|
|
3026
|
-
var root10 = /* @__PURE__ */
|
|
3027
|
-
var thumb = /* @__PURE__ */
|
|
3028
|
-
var track = /* @__PURE__ */
|
|
3122
|
+
var root10 = /* @__PURE__ */ _7a46816({ defaultClassName: "_126mzjm5", variantClassNames: { size: { sm: "_126mzjm6", md: "_126mzjm7" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
3123
|
+
var thumb = /* @__PURE__ */ _7a46816({ defaultClassName: "_126mzjmc", variantClassNames: { size: { sm: "_126mzjmd", md: "_126mzjme" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
3124
|
+
var track = /* @__PURE__ */ _7a46816({ defaultClassName: "_126mzjm8", variantClassNames: { size: { sm: "_126mzjm9", md: "_126mzjma" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
3029
3125
|
var value2 = "_126mzjm3";
|
|
3030
3126
|
|
|
3031
3127
|
// src/components/Slider/Slider.tsx
|
|
3032
|
-
import { jsx as
|
|
3033
|
-
var Slider = /* @__PURE__ */
|
|
3128
|
+
import { jsx as jsx36, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3129
|
+
var Slider = /* @__PURE__ */ forwardRef32(function Slider2(props, ref) {
|
|
3034
3130
|
const {
|
|
3035
3131
|
value: value3,
|
|
3036
3132
|
defaultValue,
|
|
@@ -3051,12 +3147,12 @@ var Slider = /* @__PURE__ */ forwardRef31(function Slider2(props, ref) {
|
|
|
3051
3147
|
} = props;
|
|
3052
3148
|
const m = useMessages();
|
|
3053
3149
|
const thumbLabels = thumbLabelsProp ?? [m.rangeStart ?? "\uCD5C\uC18C", m.rangeEnd ?? "\uCD5C\uB300"];
|
|
3054
|
-
const generatedId =
|
|
3150
|
+
const generatedId = useId15();
|
|
3055
3151
|
const baseId = id ?? generatedId;
|
|
3056
3152
|
const labelId = `${baseId}-label`;
|
|
3057
3153
|
const helperId = `${baseId}-helper`;
|
|
3058
3154
|
const isControlled = "value" in props;
|
|
3059
|
-
const [innerValue, setInnerValue] =
|
|
3155
|
+
const [innerValue, setInnerValue] = useState15(defaultValue ?? [min]);
|
|
3060
3156
|
const current2 = isControlled ? value3 ?? [min] : innerValue;
|
|
3061
3157
|
const isRange = current2.length > 1;
|
|
3062
3158
|
const handleChange = (next) => {
|
|
@@ -3064,12 +3160,12 @@ var Slider = /* @__PURE__ */ forwardRef31(function Slider2(props, ref) {
|
|
|
3064
3160
|
onValueChange?.(next);
|
|
3065
3161
|
};
|
|
3066
3162
|
const valueText = current2.map(formatValue).join(" \u2013 ");
|
|
3067
|
-
return /* @__PURE__ */
|
|
3068
|
-
(label6 || showValue) && /* @__PURE__ */
|
|
3069
|
-
label6 && /* @__PURE__ */
|
|
3070
|
-
showValue && /* @__PURE__ */
|
|
3163
|
+
return /* @__PURE__ */ jsxs30("div", { className: cx(field3, className), children: [
|
|
3164
|
+
(label6 || showValue) && /* @__PURE__ */ jsxs30("div", { className: header6, children: [
|
|
3165
|
+
label6 && /* @__PURE__ */ jsx36("span", { id: labelId, className: label3, children: label6 }),
|
|
3166
|
+
showValue && /* @__PURE__ */ jsx36("span", { className: value2, "aria-hidden": true, children: valueText })
|
|
3071
3167
|
] }),
|
|
3072
|
-
/* @__PURE__ */
|
|
3168
|
+
/* @__PURE__ */ jsxs30(
|
|
3073
3169
|
RadixSlider.Root,
|
|
3074
3170
|
{
|
|
3075
3171
|
ref,
|
|
@@ -3082,10 +3178,10 @@ var Slider = /* @__PURE__ */ forwardRef31(function Slider2(props, ref) {
|
|
|
3082
3178
|
className: root10({ size }),
|
|
3083
3179
|
...rest,
|
|
3084
3180
|
children: [
|
|
3085
|
-
/* @__PURE__ */
|
|
3181
|
+
/* @__PURE__ */ jsx36(RadixSlider.Track, { className: track({ size }), children: /* @__PURE__ */ jsx36(RadixSlider.Range, { className: range2 }) }),
|
|
3086
3182
|
current2.map((thumbValue, index) => {
|
|
3087
3183
|
const thumbLabelId = `${baseId}-thumb-${index}`;
|
|
3088
|
-
return /* @__PURE__ */
|
|
3184
|
+
return /* @__PURE__ */ jsx36(
|
|
3089
3185
|
RadixSlider.Thumb,
|
|
3090
3186
|
{
|
|
3091
3187
|
className: thumb({ size }),
|
|
@@ -3100,32 +3196,32 @@ var Slider = /* @__PURE__ */ forwardRef31(function Slider2(props, ref) {
|
|
|
3100
3196
|
]
|
|
3101
3197
|
}
|
|
3102
3198
|
),
|
|
3103
|
-
isRange && current2.map((_, index) => /* @__PURE__ */
|
|
3199
|
+
isRange && current2.map((_, index) => /* @__PURE__ */ jsxs30("span", { id: `${baseId}-thumb-${index}`, hidden: true, children: [
|
|
3104
3200
|
label6 ? "" : ariaLabel ? `${ariaLabel} ` : "",
|
|
3105
3201
|
thumbLabels[index] ?? `${index + 1}`
|
|
3106
3202
|
] }, index)),
|
|
3107
|
-
helperText3 && /* @__PURE__ */
|
|
3203
|
+
helperText3 && /* @__PURE__ */ jsx36("span", { id: helperId, className: helperText2, children: helperText3 })
|
|
3108
3204
|
] });
|
|
3109
3205
|
});
|
|
3110
3206
|
|
|
3111
3207
|
// src/components/Stepper/Stepper.tsx
|
|
3112
|
-
import { forwardRef as
|
|
3208
|
+
import { forwardRef as forwardRef33 } from "react";
|
|
3113
3209
|
import { CheckIcon as CheckIcon4 } from "@bestow-ui/icons";
|
|
3114
3210
|
|
|
3115
3211
|
// src/components/Stepper/Stepper.css.ts
|
|
3116
|
-
import { createRuntimeFn as
|
|
3212
|
+
import { createRuntimeFn as _7a46817 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3117
3213
|
var description5 = "kervhmh";
|
|
3118
|
-
var indicator2 = /* @__PURE__ */
|
|
3119
|
-
var label4 = /* @__PURE__ */
|
|
3120
|
-
var root11 = /* @__PURE__ */
|
|
3121
|
-
var step = /* @__PURE__ */
|
|
3122
|
-
var text2 = /* @__PURE__ */
|
|
3214
|
+
var indicator2 = /* @__PURE__ */ _7a46817({ defaultClassName: "kervhm6", variantClassNames: { status: { complete: "kervhm7", current: "kervhm8", upcoming: "kervhm9" } }, defaultVariants: {}, compoundVariants: [] });
|
|
3215
|
+
var label4 = /* @__PURE__ */ _7a46817({ defaultClassName: "kervhmd", variantClassNames: { status: { complete: "kervhme", current: "kervhmf", upcoming: "kervhmg" } }, defaultVariants: {}, compoundVariants: [] });
|
|
3216
|
+
var root11 = /* @__PURE__ */ _7a46817({ defaultClassName: "kervhm0", variantClassNames: { orientation: { horizontal: "kervhm1", vertical: "kervhm2" } }, defaultVariants: { orientation: "horizontal" }, compoundVariants: [] });
|
|
3217
|
+
var step = /* @__PURE__ */ _7a46817({ defaultClassName: "kervhm3", variantClassNames: { orientation: { horizontal: "kervhm4", vertical: "kervhm5" } }, defaultVariants: { orientation: "horizontal" }, compoundVariants: [] });
|
|
3218
|
+
var text2 = /* @__PURE__ */ _7a46817({ defaultClassName: "kervhma", variantClassNames: { orientation: { horizontal: "kervhmb", vertical: "kervhmc" } }, defaultVariants: {}, compoundVariants: [] });
|
|
3123
3219
|
|
|
3124
3220
|
// src/components/Stepper/Stepper.tsx
|
|
3125
|
-
import { jsx as
|
|
3126
|
-
var Stepper = /* @__PURE__ */
|
|
3221
|
+
import { jsx as jsx37, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3222
|
+
var Stepper = /* @__PURE__ */ forwardRef33(function Stepper2({ steps, current: current2, orientation = "horizontal", "aria-label": ariaLabel, className, ...rest }, ref) {
|
|
3127
3223
|
const m = useMessages();
|
|
3128
|
-
return /* @__PURE__ */
|
|
3224
|
+
return /* @__PURE__ */ jsx37(
|
|
3129
3225
|
"ol",
|
|
3130
3226
|
{
|
|
3131
3227
|
ref,
|
|
@@ -3134,24 +3230,24 @@ var Stepper = /* @__PURE__ */ forwardRef32(function Stepper2({ steps, current: c
|
|
|
3134
3230
|
...rest,
|
|
3135
3231
|
children: steps.map((step2, index) => {
|
|
3136
3232
|
const status = index < current2 ? "complete" : index === current2 ? "current" : "upcoming";
|
|
3137
|
-
return /* @__PURE__ */
|
|
3233
|
+
return /* @__PURE__ */ jsxs31(
|
|
3138
3234
|
"li",
|
|
3139
3235
|
{
|
|
3140
3236
|
className: step({ orientation }),
|
|
3141
3237
|
"data-status": status,
|
|
3142
3238
|
"aria-current": status === "current" ? "step" : void 0,
|
|
3143
3239
|
children: [
|
|
3144
|
-
/* @__PURE__ */
|
|
3145
|
-
/* @__PURE__ */
|
|
3146
|
-
/* @__PURE__ */
|
|
3240
|
+
/* @__PURE__ */ jsx37("span", { className: indicator2({ status }), "aria-hidden": true, children: status === "complete" ? /* @__PURE__ */ jsx37(CheckIcon4, { size: 16, strokeWidth: 2.5 }) : index + 1 }),
|
|
3241
|
+
/* @__PURE__ */ jsxs31("span", { className: text2({ orientation }), children: [
|
|
3242
|
+
/* @__PURE__ */ jsxs31("span", { className: label4({ status }), children: [
|
|
3147
3243
|
step2.label,
|
|
3148
|
-
status === "complete" && /* @__PURE__ */
|
|
3244
|
+
status === "complete" && /* @__PURE__ */ jsxs31("span", { className: visuallyHidden, children: [
|
|
3149
3245
|
" (",
|
|
3150
3246
|
m.stepCompleted ?? "\uC644\uB8CC",
|
|
3151
3247
|
")"
|
|
3152
3248
|
] })
|
|
3153
3249
|
] }),
|
|
3154
|
-
step2.description && /* @__PURE__ */
|
|
3250
|
+
step2.description && /* @__PURE__ */ jsx37("span", { className: description5, children: step2.description })
|
|
3155
3251
|
] })
|
|
3156
3252
|
]
|
|
3157
3253
|
},
|
|
@@ -3163,52 +3259,125 @@ var Stepper = /* @__PURE__ */ forwardRef32(function Stepper2({ steps, current: c
|
|
|
3163
3259
|
});
|
|
3164
3260
|
|
|
3165
3261
|
// src/components/Switch/Switch.tsx
|
|
3166
|
-
import
|
|
3167
|
-
import { forwardRef as forwardRef33, useId as useId15 } from "react";
|
|
3262
|
+
import { forwardRef as forwardRef34, useEffect as useEffect11, useId as useId16, useRef as useRef15, useState as useState16 } from "react";
|
|
3168
3263
|
|
|
3169
3264
|
// src/components/Switch/Switch.css.ts
|
|
3170
|
-
import { createRuntimeFn as
|
|
3171
|
-
var
|
|
3172
|
-
var
|
|
3173
|
-
var
|
|
3174
|
-
var
|
|
3265
|
+
import { createRuntimeFn as _7a46818 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3266
|
+
var bubbleInput = /* @__PURE__ */ _7a46818({ defaultClassName: "o33ul29", variantClassNames: { size: { sm: "o33ul2a", md: "o33ul2b" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
3267
|
+
var label5 = "o33ul2c";
|
|
3268
|
+
var root12 = /* @__PURE__ */ _7a46818({ defaultClassName: "o33ul20", variantClassNames: { size: { sm: "o33ul21", md: "o33ul22" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
3269
|
+
var thumb2 = /* @__PURE__ */ _7a46818({ defaultClassName: "o33ul26", variantClassNames: { size: { sm: "o33ul27", md: "o33ul28" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
3270
|
+
var track2 = /* @__PURE__ */ _7a46818({ defaultClassName: "o33ul23", variantClassNames: { size: { sm: "o33ul24", md: "o33ul25" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
3175
3271
|
|
|
3176
3272
|
// src/components/Switch/Switch.tsx
|
|
3177
|
-
import { jsx as
|
|
3178
|
-
|
|
3179
|
-
|
|
3273
|
+
import { jsx as jsx38, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3274
|
+
function setNativeChecked(input6, checked) {
|
|
3275
|
+
Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "checked")?.set?.call(input6, checked);
|
|
3276
|
+
}
|
|
3277
|
+
var Switch = /* @__PURE__ */ forwardRef34(function Switch2({
|
|
3278
|
+
label: label6,
|
|
3279
|
+
size,
|
|
3280
|
+
id,
|
|
3281
|
+
className,
|
|
3282
|
+
disabled,
|
|
3283
|
+
required,
|
|
3284
|
+
name,
|
|
3285
|
+
value: value3 = "on",
|
|
3286
|
+
checked: checkedProp,
|
|
3287
|
+
defaultChecked,
|
|
3288
|
+
onCheckedChange,
|
|
3289
|
+
"aria-label": ariaLabel
|
|
3290
|
+
}, ref) {
|
|
3291
|
+
const generatedId = useId16();
|
|
3180
3292
|
const switchId = id ?? generatedId;
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3293
|
+
const [uncontrolled, setUncontrolled] = useState16(defaultChecked ?? false);
|
|
3294
|
+
const isControlled = checkedProp !== void 0;
|
|
3295
|
+
const checked = isControlled ? checkedProp : uncontrolled;
|
|
3296
|
+
const buttonRef = useRef15(null);
|
|
3297
|
+
const inputRef = useRef15(null);
|
|
3298
|
+
const [inForm, setInForm] = useState16(true);
|
|
3299
|
+
const userToggled = useRef15(false);
|
|
3300
|
+
const setChecked = (next) => {
|
|
3301
|
+
if (!isControlled) setUncontrolled(next);
|
|
3302
|
+
if (next !== checked) onCheckedChange?.(next);
|
|
3303
|
+
};
|
|
3304
|
+
const setCheckedRef = useRef15(setChecked);
|
|
3305
|
+
setCheckedRef.current = setChecked;
|
|
3306
|
+
useEffect11(() => {
|
|
3307
|
+
const form = buttonRef.current?.form;
|
|
3308
|
+
setInForm(!!form);
|
|
3309
|
+
if (!form) return;
|
|
3310
|
+
const initial = checked;
|
|
3311
|
+
const onReset = () => setCheckedRef.current(initial);
|
|
3312
|
+
form.addEventListener("reset", onReset);
|
|
3313
|
+
return () => form.removeEventListener("reset", onReset);
|
|
3314
|
+
}, []);
|
|
3315
|
+
useEffect11(() => {
|
|
3316
|
+
const input6 = inputRef.current;
|
|
3317
|
+
if (!input6 || input6.checked === checked) return;
|
|
3318
|
+
setNativeChecked(input6, checked);
|
|
3319
|
+
if (userToggled.current) input6.dispatchEvent(new Event("click", { bubbles: true }));
|
|
3320
|
+
userToggled.current = false;
|
|
3321
|
+
}, [checked]);
|
|
3322
|
+
const handleClick = (event) => {
|
|
3323
|
+
userToggled.current = true;
|
|
3324
|
+
setChecked(!checked);
|
|
3325
|
+
if (inForm) event.stopPropagation();
|
|
3326
|
+
};
|
|
3327
|
+
const state = checked ? "checked" : "unchecked";
|
|
3328
|
+
return /* @__PURE__ */ jsxs32("span", { className: cx(root12({ size }), className), "data-disabled": disabled || void 0, children: [
|
|
3329
|
+
/* @__PURE__ */ jsx38(
|
|
3330
|
+
"button",
|
|
3184
3331
|
{
|
|
3185
|
-
ref,
|
|
3332
|
+
ref: mergeRefs(ref, buttonRef),
|
|
3333
|
+
type: "button",
|
|
3334
|
+
role: "switch",
|
|
3186
3335
|
id: switchId,
|
|
3187
|
-
|
|
3336
|
+
"aria-checked": checked,
|
|
3337
|
+
"aria-required": required,
|
|
3188
3338
|
"aria-label": ariaLabel,
|
|
3339
|
+
"data-state": state,
|
|
3340
|
+
"data-disabled": disabled ? "" : void 0,
|
|
3341
|
+
disabled,
|
|
3342
|
+
value: value3,
|
|
3189
3343
|
className: track2({ size }),
|
|
3190
|
-
|
|
3191
|
-
children: /* @__PURE__ */
|
|
3344
|
+
onClick: handleClick,
|
|
3345
|
+
children: /* @__PURE__ */ jsx38("span", { className: thumb2({ size }), "data-state": state, "data-disabled": disabled ? "" : void 0 })
|
|
3346
|
+
}
|
|
3347
|
+
),
|
|
3348
|
+
inForm && /* @__PURE__ */ jsx38(
|
|
3349
|
+
"input",
|
|
3350
|
+
{
|
|
3351
|
+
ref: inputRef,
|
|
3352
|
+
type: "checkbox",
|
|
3353
|
+
"aria-hidden": true,
|
|
3354
|
+
tabIndex: -1,
|
|
3355
|
+
defaultChecked: checked,
|
|
3356
|
+
required,
|
|
3357
|
+
disabled,
|
|
3358
|
+
name,
|
|
3359
|
+
value: value3,
|
|
3360
|
+
className: bubbleInput({ size })
|
|
3192
3361
|
}
|
|
3193
3362
|
),
|
|
3194
|
-
label6 && /* @__PURE__ */
|
|
3363
|
+
label6 && /* @__PURE__ */ jsx38("label", { htmlFor: switchId, className: label5, children: label6 })
|
|
3195
3364
|
] });
|
|
3196
3365
|
});
|
|
3197
3366
|
|
|
3198
3367
|
// src/components/Table/Table.tsx
|
|
3199
3368
|
import {
|
|
3200
3369
|
createContext as createContext3,
|
|
3201
|
-
forwardRef as
|
|
3370
|
+
forwardRef as forwardRef35,
|
|
3202
3371
|
useContext as useContext3,
|
|
3203
|
-
useId as
|
|
3372
|
+
useId as useId17
|
|
3204
3373
|
} from "react";
|
|
3205
3374
|
import { ArrowDownIcon, ArrowUpIcon } from "@bestow-ui/icons";
|
|
3206
3375
|
|
|
3207
3376
|
// src/components/Table/Table.css.ts
|
|
3208
|
-
import { createRuntimeFn as
|
|
3377
|
+
import { createRuntimeFn as _7a46819 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3209
3378
|
var body3 = "l3ploy5";
|
|
3210
3379
|
var caption = "l3ploy2";
|
|
3211
|
-
var cell2 = /* @__PURE__ */
|
|
3380
|
+
var cell2 = /* @__PURE__ */ _7a46819({ defaultClassName: "l3ploy9", variantClassNames: { size: { sm: "l3ploya", md: "l3ployb" }, align: { left: "l3ployc", center: "l3ployd", right: "l3ploye" } }, defaultVariants: { size: "md", align: "left" }, compoundVariants: [] });
|
|
3212
3381
|
var container = "l3ploy0";
|
|
3213
3382
|
var emptyCell = "l3ployj";
|
|
3214
3383
|
var emptyContent = "l3ployk";
|
|
@@ -3224,10 +3393,10 @@ var striped = "l3ploy6";
|
|
|
3224
3393
|
var table = "l3ploy1";
|
|
3225
3394
|
|
|
3226
3395
|
// src/components/Table/Table.tsx
|
|
3227
|
-
import { Fragment as
|
|
3396
|
+
import { Fragment as Fragment7, jsx as jsx39, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
3228
3397
|
var TableSizeContext = /* @__PURE__ */ createContext3("md");
|
|
3229
3398
|
var TableSectionContext = /* @__PURE__ */ createContext3("body");
|
|
3230
|
-
var Table = /* @__PURE__ */
|
|
3399
|
+
var Table = /* @__PURE__ */ forwardRef35(function Table2({
|
|
3231
3400
|
size = "md",
|
|
3232
3401
|
striped: striped2,
|
|
3233
3402
|
stickyHeader: stickyHeader2,
|
|
@@ -3239,8 +3408,8 @@ var Table = /* @__PURE__ */ forwardRef34(function Table2({
|
|
|
3239
3408
|
children,
|
|
3240
3409
|
...rest
|
|
3241
3410
|
}, ref) {
|
|
3242
|
-
const captionId =
|
|
3243
|
-
return /* @__PURE__ */
|
|
3411
|
+
const captionId = useId17();
|
|
3412
|
+
return /* @__PURE__ */ jsx39(TableSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsx39(
|
|
3244
3413
|
"div",
|
|
3245
3414
|
{
|
|
3246
3415
|
className: cx(container, containerClassName),
|
|
@@ -3249,7 +3418,7 @@ var Table = /* @__PURE__ */ forwardRef34(function Table2({
|
|
|
3249
3418
|
role: "region",
|
|
3250
3419
|
"aria-labelledby": caption2 ? captionId : void 0,
|
|
3251
3420
|
"aria-label": caption2 ? void 0 : ariaLabel,
|
|
3252
|
-
children: /* @__PURE__ */
|
|
3421
|
+
children: /* @__PURE__ */ jsxs33(
|
|
3253
3422
|
"table",
|
|
3254
3423
|
{
|
|
3255
3424
|
ref,
|
|
@@ -3257,7 +3426,7 @@ var Table = /* @__PURE__ */ forwardRef34(function Table2({
|
|
|
3257
3426
|
"aria-label": caption2 ? void 0 : ariaLabel,
|
|
3258
3427
|
...rest,
|
|
3259
3428
|
children: [
|
|
3260
|
-
caption2 && /* @__PURE__ */
|
|
3429
|
+
caption2 && /* @__PURE__ */ jsx39("caption", { id: captionId, className: caption, children: caption2 }),
|
|
3261
3430
|
children
|
|
3262
3431
|
]
|
|
3263
3432
|
}
|
|
@@ -3265,31 +3434,31 @@ var Table = /* @__PURE__ */ forwardRef34(function Table2({
|
|
|
3265
3434
|
}
|
|
3266
3435
|
) });
|
|
3267
3436
|
});
|
|
3268
|
-
var TableHeader = /* @__PURE__ */
|
|
3437
|
+
var TableHeader = /* @__PURE__ */ forwardRef35(
|
|
3269
3438
|
function TableHeader2({ className, ...rest }, ref) {
|
|
3270
|
-
return /* @__PURE__ */
|
|
3439
|
+
return /* @__PURE__ */ jsx39(TableSectionContext.Provider, { value: "header", children: /* @__PURE__ */ jsx39("thead", { ref, className: cx(header7, className), ...rest }) });
|
|
3271
3440
|
}
|
|
3272
3441
|
);
|
|
3273
|
-
var TableBody = /* @__PURE__ */
|
|
3442
|
+
var TableBody = /* @__PURE__ */ forwardRef35(
|
|
3274
3443
|
function TableBody2({ className, ...rest }, ref) {
|
|
3275
|
-
return /* @__PURE__ */
|
|
3444
|
+
return /* @__PURE__ */ jsx39(TableSectionContext.Provider, { value: "body", children: /* @__PURE__ */ jsx39("tbody", { ref, className: cx(body3, className), ...rest }) });
|
|
3276
3445
|
}
|
|
3277
3446
|
);
|
|
3278
|
-
var TableFooter = /* @__PURE__ */
|
|
3447
|
+
var TableFooter = /* @__PURE__ */ forwardRef35(
|
|
3279
3448
|
function TableFooter2({ className, ...rest }, ref) {
|
|
3280
|
-
return /* @__PURE__ */
|
|
3449
|
+
return /* @__PURE__ */ jsx39(TableSectionContext.Provider, { value: "footer", children: /* @__PURE__ */ jsx39("tfoot", { ref, className: cx(footer3, className), ...rest }) });
|
|
3281
3450
|
}
|
|
3282
3451
|
);
|
|
3283
|
-
var TableRow = /* @__PURE__ */
|
|
3284
|
-
return /* @__PURE__ */
|
|
3452
|
+
var TableRow = /* @__PURE__ */ forwardRef35(function TableRow2({ selected, className, ...rest }, ref) {
|
|
3453
|
+
return /* @__PURE__ */ jsx39("tr", { ref, className: cx(row3, className), "data-state": selected ? "selected" : void 0, ...rest });
|
|
3285
3454
|
});
|
|
3286
|
-
var TableHead = /* @__PURE__ */
|
|
3455
|
+
var TableHead = /* @__PURE__ */ forwardRef35(function TableHead2({ align, sortDirection, onSort, scope, className, children, ...rest }, ref) {
|
|
3287
3456
|
const size = useContext3(TableSizeContext);
|
|
3288
3457
|
const section = useContext3(TableSectionContext);
|
|
3289
3458
|
const sortable = onSort !== void 0;
|
|
3290
3459
|
const direction = sortDirection ?? "none";
|
|
3291
3460
|
const SortIcon = direction === "descending" ? ArrowDownIcon : ArrowUpIcon;
|
|
3292
|
-
return /* @__PURE__ */
|
|
3461
|
+
return /* @__PURE__ */ jsx39(
|
|
3293
3462
|
"th",
|
|
3294
3463
|
{
|
|
3295
3464
|
ref,
|
|
@@ -3301,17 +3470,17 @@ var TableHead = /* @__PURE__ */ forwardRef34(function TableHead2({ align, sortDi
|
|
|
3301
3470
|
className
|
|
3302
3471
|
),
|
|
3303
3472
|
...rest,
|
|
3304
|
-
children: sortable ? /* @__PURE__ */
|
|
3473
|
+
children: sortable ? /* @__PURE__ */ jsxs33("button", { type: "button", className: sortButton, onClick: onSort, children: [
|
|
3305
3474
|
children,
|
|
3306
|
-
/* @__PURE__ */
|
|
3475
|
+
/* @__PURE__ */ jsx39(SortIcon, { size: 14, className: sortIcon, "data-active": direction !== "none", "aria-hidden": true })
|
|
3307
3476
|
] }) : children
|
|
3308
3477
|
}
|
|
3309
3478
|
);
|
|
3310
3479
|
});
|
|
3311
|
-
var TableCell = /* @__PURE__ */
|
|
3480
|
+
var TableCell = /* @__PURE__ */ forwardRef35(function TableCell2({ align, className, ...rest }, ref) {
|
|
3312
3481
|
const size = useContext3(TableSizeContext);
|
|
3313
3482
|
const section = useContext3(TableSectionContext);
|
|
3314
|
-
return /* @__PURE__ */
|
|
3483
|
+
return /* @__PURE__ */ jsx39(
|
|
3315
3484
|
"td",
|
|
3316
3485
|
{
|
|
3317
3486
|
ref,
|
|
@@ -3320,17 +3489,17 @@ var TableCell = /* @__PURE__ */ forwardRef34(function TableCell2({ align, classN
|
|
|
3320
3489
|
}
|
|
3321
3490
|
);
|
|
3322
3491
|
});
|
|
3323
|
-
var TableEmpty = /* @__PURE__ */
|
|
3324
|
-
return /* @__PURE__ */
|
|
3492
|
+
var TableEmpty = /* @__PURE__ */ forwardRef35(function TableEmpty2({ colSpan, className, children, ...rest }, ref) {
|
|
3493
|
+
return /* @__PURE__ */ jsx39(TableRow, { children: /* @__PURE__ */ jsx39(TableCell, { ref, colSpan, className: cx(emptyCell, className), ...rest, children: /* @__PURE__ */ jsx39("div", { className: emptyContent, children }) }) });
|
|
3325
3494
|
});
|
|
3326
3495
|
function TableSkeleton({ rows = 5, columns }) {
|
|
3327
|
-
return /* @__PURE__ */
|
|
3496
|
+
return /* @__PURE__ */ jsx39(Fragment7, { children: Array.from({ length: rows }, (_, row5) => /* @__PURE__ */ jsx39(TableRow, { "aria-hidden": true, children: Array.from({ length: columns }, (_2, column) => /* @__PURE__ */ jsx39(TableCell, { children: /* @__PURE__ */ jsx39(Skeleton, { width: column === 0 ? "60%" : "80%" }) }, column)) }, row5)) });
|
|
3328
3497
|
}
|
|
3329
3498
|
|
|
3330
3499
|
// src/components/Table/useTableSelection.ts
|
|
3331
|
-
import { useCallback, useState as
|
|
3500
|
+
import { useCallback, useState as useState17 } from "react";
|
|
3332
3501
|
function useTableSelection(initial = []) {
|
|
3333
|
-
const [selected, setSelected] =
|
|
3502
|
+
const [selected, setSelected] = useState17(initial);
|
|
3334
3503
|
const isSelected = useCallback((id) => selected.includes(id), [selected]);
|
|
3335
3504
|
const toggle3 = useCallback((id, checked) => {
|
|
3336
3505
|
setSelected((prev) => {
|
|
@@ -3360,54 +3529,54 @@ function useTableSelection(initial = []) {
|
|
|
3360
3529
|
|
|
3361
3530
|
// src/components/Tabs/Tabs.tsx
|
|
3362
3531
|
import * as RadixTabs from "@radix-ui/react-tabs";
|
|
3363
|
-
import { createContext as createContext4, forwardRef as
|
|
3532
|
+
import { createContext as createContext4, forwardRef as forwardRef36, useContext as useContext4 } from "react";
|
|
3364
3533
|
|
|
3365
3534
|
// src/components/Tabs/Tabs.css.ts
|
|
3366
|
-
import { createRuntimeFn as
|
|
3535
|
+
import { createRuntimeFn as _7a46820 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3367
3536
|
var content10 = "fvhbtdb";
|
|
3368
|
-
var list6 = /* @__PURE__ */
|
|
3537
|
+
var list6 = /* @__PURE__ */ _7a46820({ defaultClassName: "fvhbtd1", variantClassNames: { variant: { line: "fvhbtd2", soft: "fvhbtd3" } }, defaultVariants: { variant: "line" }, compoundVariants: [] });
|
|
3369
3538
|
var root13 = "fvhbtd0";
|
|
3370
|
-
var trigger3 = /* @__PURE__ */
|
|
3539
|
+
var trigger3 = /* @__PURE__ */ _7a46820({ 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"]] });
|
|
3371
3540
|
|
|
3372
3541
|
// src/components/Tabs/Tabs.tsx
|
|
3373
|
-
import { jsx as
|
|
3542
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
3374
3543
|
var TabsStyleContext = /* @__PURE__ */ createContext4({ variant: "line", size: "md" });
|
|
3375
|
-
var Tabs = /* @__PURE__ */
|
|
3544
|
+
var Tabs = /* @__PURE__ */ forwardRef36(function Tabs2({ variant = "line", size = "md", className, ...props }, ref) {
|
|
3376
3545
|
const controlled = "value" in props ? { value: props.value ?? "" } : {};
|
|
3377
|
-
return /* @__PURE__ */
|
|
3546
|
+
return /* @__PURE__ */ jsx40(TabsStyleContext.Provider, { value: { variant, size }, children: /* @__PURE__ */ jsx40(RadixTabs.Root, { ref, className: cx(root13, className), ...props, ...controlled }) });
|
|
3378
3547
|
});
|
|
3379
|
-
var TabsList = /* @__PURE__ */
|
|
3548
|
+
var TabsList = /* @__PURE__ */ forwardRef36(function TabsList2({ className, ...rest }, ref) {
|
|
3380
3549
|
const { variant } = useContext4(TabsStyleContext);
|
|
3381
|
-
return /* @__PURE__ */
|
|
3550
|
+
return /* @__PURE__ */ jsx40(RadixTabs.List, { ref, className: cx(list6({ variant }), className), ...rest });
|
|
3382
3551
|
});
|
|
3383
|
-
var TabsTrigger = /* @__PURE__ */
|
|
3552
|
+
var TabsTrigger = /* @__PURE__ */ forwardRef36(function TabsTrigger2({ className, ...rest }, ref) {
|
|
3384
3553
|
const { variant, size } = useContext4(TabsStyleContext);
|
|
3385
|
-
return /* @__PURE__ */
|
|
3554
|
+
return /* @__PURE__ */ jsx40(RadixTabs.Trigger, { ref, className: cx(trigger3({ variant, size }), className), ...rest });
|
|
3386
3555
|
});
|
|
3387
|
-
var TabsContent = /* @__PURE__ */
|
|
3388
|
-
return /* @__PURE__ */
|
|
3556
|
+
var TabsContent = /* @__PURE__ */ forwardRef36(function TabsContent2({ className, ...rest }, ref) {
|
|
3557
|
+
return /* @__PURE__ */ jsx40(RadixTabs.Content, { ref, className: cx(content10, className), ...rest });
|
|
3389
3558
|
});
|
|
3390
3559
|
|
|
3391
3560
|
// src/components/Textarea/Textarea.tsx
|
|
3392
3561
|
import {
|
|
3393
|
-
forwardRef as
|
|
3562
|
+
forwardRef as forwardRef37,
|
|
3394
3563
|
useCallback as useCallback2,
|
|
3395
|
-
useId as
|
|
3396
|
-
useRef as
|
|
3397
|
-
useState as
|
|
3564
|
+
useId as useId18,
|
|
3565
|
+
useRef as useRef16,
|
|
3566
|
+
useState as useState18
|
|
3398
3567
|
} from "react";
|
|
3399
3568
|
|
|
3400
3569
|
// src/components/Textarea/Textarea.css.ts
|
|
3401
|
-
import { createRuntimeFn as
|
|
3570
|
+
import { createRuntimeFn as _7a46821 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3402
3571
|
var count = "_1koawa9";
|
|
3403
3572
|
var countOver = "_1koawaa";
|
|
3404
3573
|
var defaultWidth = "_1koawa7";
|
|
3405
3574
|
var footer4 = "_1koawa8";
|
|
3406
|
-
var textarea = /* @__PURE__ */
|
|
3575
|
+
var textarea = /* @__PURE__ */ _7a46821({ defaultClassName: "_1koawa0", variantClassNames: { size: { sm: "_1koawa1", md: "_1koawa2", lg: "_1koawa3" }, resize: { none: "_1koawa4", vertical: "_1koawa5", both: "_1koawa6" } }, defaultVariants: { size: "md", resize: "vertical" }, compoundVariants: [] });
|
|
3407
3576
|
|
|
3408
3577
|
// src/components/Textarea/Textarea.tsx
|
|
3409
|
-
import { jsx as
|
|
3410
|
-
var Textarea = /* @__PURE__ */
|
|
3578
|
+
import { jsx as jsx41, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
3579
|
+
var Textarea = /* @__PURE__ */ forwardRef37(function Textarea2({
|
|
3411
3580
|
label: label6,
|
|
3412
3581
|
helperText: helperText3,
|
|
3413
3582
|
error,
|
|
@@ -3428,11 +3597,11 @@ var Textarea = /* @__PURE__ */ forwardRef36(function Textarea2({
|
|
|
3428
3597
|
"aria-describedby": ariaDescribedBy,
|
|
3429
3598
|
...rest
|
|
3430
3599
|
}, ref) {
|
|
3431
|
-
const generatedId =
|
|
3600
|
+
const generatedId = useId18();
|
|
3432
3601
|
const textareaId = id ?? generatedId;
|
|
3433
3602
|
const helperId = helperText3 ? `${textareaId}-helper` : void 0;
|
|
3434
|
-
const innerRef =
|
|
3435
|
-
const [uncontrolledLength, setUncontrolledLength] =
|
|
3603
|
+
const innerRef = useRef16(null);
|
|
3604
|
+
const [uncontrolledLength, setUncontrolledLength] = useState18(() => String(defaultValue ?? "").length);
|
|
3436
3605
|
const length = value3 !== void 0 ? String(value3).length : uncontrolledLength;
|
|
3437
3606
|
const fitHeight = useCallback2(() => {
|
|
3438
3607
|
const el = innerRef.current;
|
|
@@ -3447,12 +3616,12 @@ var Textarea = /* @__PURE__ */ forwardRef36(function Textarea2({
|
|
|
3447
3616
|
fitHeight();
|
|
3448
3617
|
onChange?.(event);
|
|
3449
3618
|
};
|
|
3450
|
-
return /* @__PURE__ */
|
|
3451
|
-
label6 && /* @__PURE__ */
|
|
3619
|
+
return /* @__PURE__ */ jsxs34("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
|
|
3620
|
+
label6 && /* @__PURE__ */ jsxs34("label", { htmlFor: textareaId, className: label, children: [
|
|
3452
3621
|
label6,
|
|
3453
|
-
required && /* @__PURE__ */
|
|
3622
|
+
required && /* @__PURE__ */ jsx41("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
3454
3623
|
] }),
|
|
3455
|
-
/* @__PURE__ */
|
|
3624
|
+
/* @__PURE__ */ jsx41(
|
|
3456
3625
|
"textarea",
|
|
3457
3626
|
{
|
|
3458
3627
|
ref: mergeRefs(innerRef, ref),
|
|
@@ -3474,36 +3643,36 @@ var Textarea = /* @__PURE__ */ forwardRef36(function Textarea2({
|
|
|
3474
3643
|
...rest
|
|
3475
3644
|
}
|
|
3476
3645
|
),
|
|
3477
|
-
(helperText3 || showCount) && /* @__PURE__ */
|
|
3478
|
-
helperText3 && /* @__PURE__ */
|
|
3479
|
-
showCount && /* @__PURE__ */
|
|
3646
|
+
(helperText3 || showCount) && /* @__PURE__ */ jsxs34("div", { className: footer4, children: [
|
|
3647
|
+
helperText3 && /* @__PURE__ */ jsx41("p", { id: helperId, className: helperText({ error }), children: helperText3 }),
|
|
3648
|
+
showCount && /* @__PURE__ */ jsx41("span", { className: cx(count, maxLength !== void 0 && length >= maxLength && countOver), children: maxLength !== void 0 ? `${length}/${maxLength}` : length })
|
|
3480
3649
|
] })
|
|
3481
3650
|
] });
|
|
3482
3651
|
});
|
|
3483
3652
|
|
|
3484
3653
|
// src/components/Toast/Toast.tsx
|
|
3485
3654
|
import * as RadixToast from "@radix-ui/react-toast";
|
|
3486
|
-
import { createContext as createContext5, useCallback as useCallback3, useContext as useContext5, useMemo as useMemo4, useRef as
|
|
3655
|
+
import { createContext as createContext5, useCallback as useCallback3, useContext as useContext5, useMemo as useMemo4, useRef as useRef17, useState as useState19 } from "react";
|
|
3487
3656
|
import { XIcon as XIcon7 } from "@bestow-ui/icons";
|
|
3488
3657
|
|
|
3489
3658
|
// src/components/Toast/Toast.css.ts
|
|
3490
|
-
import { createRuntimeFn as
|
|
3659
|
+
import { createRuntimeFn as _7a46822 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3491
3660
|
var action2 = "_1g11zvx9";
|
|
3492
3661
|
var close = "_1g11zvxa";
|
|
3493
3662
|
var description6 = "_1g11zvx8";
|
|
3494
3663
|
var title5 = "_1g11zvx7";
|
|
3495
|
-
var toast = /* @__PURE__ */
|
|
3664
|
+
var toast = /* @__PURE__ */ _7a46822({ defaultClassName: "_1g11zvx1", variantClassNames: { color: { primary: "_1g11zvx2", neutral: "_1g11zvx3", success: "_1g11zvx4", warning: "_1g11zvx5", danger: "_1g11zvx6" } }, defaultVariants: { color: "neutral" }, compoundVariants: [] });
|
|
3496
3665
|
var viewport2 = "_1g11zvx0";
|
|
3497
3666
|
|
|
3498
3667
|
// src/components/Toast/Toast.tsx
|
|
3499
|
-
import { jsx as
|
|
3668
|
+
import { jsx as jsx42, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
3500
3669
|
var REMOVE_DELAY = 500;
|
|
3501
3670
|
var ToastContext = /* @__PURE__ */ createContext5(null);
|
|
3502
3671
|
function ToastProvider({ children, duration = 5e3, label: labelProp }) {
|
|
3503
3672
|
const m = useMessages();
|
|
3504
3673
|
const label6 = labelProp ?? m.notifications ?? "\uC54C\uB9BC";
|
|
3505
|
-
const [toasts, setToasts] =
|
|
3506
|
-
const nextId =
|
|
3674
|
+
const [toasts, setToasts] = useState19([]);
|
|
3675
|
+
const nextId = useRef17(0);
|
|
3507
3676
|
const portal2 = usePortalProps();
|
|
3508
3677
|
const toast2 = useCallback3((options) => {
|
|
3509
3678
|
const id = nextId.current++;
|
|
@@ -3516,9 +3685,9 @@ function ToastProvider({ children, duration = 5e3, label: labelProp }) {
|
|
|
3516
3685
|
setTimeout(() => setToasts((prev) => prev.filter((t) => t.open || !isTarget(t))), REMOVE_DELAY);
|
|
3517
3686
|
}, []);
|
|
3518
3687
|
const value3 = useMemo4(() => ({ toast: toast2, dismiss }), [toast2, dismiss]);
|
|
3519
|
-
return /* @__PURE__ */
|
|
3688
|
+
return /* @__PURE__ */ jsx42(ToastContext.Provider, { value: value3, children: /* @__PURE__ */ jsxs35(RadixToast.Provider, { duration, label: label6, swipeDirection: "right", children: [
|
|
3520
3689
|
children,
|
|
3521
|
-
toasts.map(({ id, open, title: title6, description: description7, color, duration: itemDuration, action: action3 }) => /* @__PURE__ */
|
|
3690
|
+
toasts.map(({ id, open, title: title6, description: description7, color, duration: itemDuration, action: action3 }) => /* @__PURE__ */ jsxs35(
|
|
3522
3691
|
RadixToast.Root,
|
|
3523
3692
|
{
|
|
3524
3693
|
open,
|
|
@@ -3528,15 +3697,15 @@ function ToastProvider({ children, duration = 5e3, label: labelProp }) {
|
|
|
3528
3697
|
},
|
|
3529
3698
|
className: toast({ color }),
|
|
3530
3699
|
children: [
|
|
3531
|
-
/* @__PURE__ */
|
|
3532
|
-
description7 && /* @__PURE__ */
|
|
3533
|
-
action3 && /* @__PURE__ */
|
|
3534
|
-
/* @__PURE__ */
|
|
3700
|
+
/* @__PURE__ */ jsx42(RadixToast.Title, { className: title5, children: title6 }),
|
|
3701
|
+
description7 && /* @__PURE__ */ jsx42(RadixToast.Description, { className: description6, children: description7 }),
|
|
3702
|
+
action3 && /* @__PURE__ */ jsx42(RadixToast.Action, { asChild: true, altText: action3.altText ?? action3.label, className: action2, children: /* @__PURE__ */ jsx42(Button, { size: "sm", variant: "soft", color: "neutral", onClick: action3.onClick, children: action3.label }) }),
|
|
3703
|
+
/* @__PURE__ */ jsx42(RadixToast.Close, { className: close, "aria-label": m.close ?? "\uB2EB\uAE30", children: /* @__PURE__ */ jsx42(XIcon7, { size: 16 }) })
|
|
3535
3704
|
]
|
|
3536
3705
|
},
|
|
3537
3706
|
id
|
|
3538
3707
|
)),
|
|
3539
|
-
/* @__PURE__ */
|
|
3708
|
+
/* @__PURE__ */ jsx42(RadixToast.Viewport, { className: cx(portal2.className, viewport2), style: portal2.style })
|
|
3540
3709
|
] }) });
|
|
3541
3710
|
}
|
|
3542
3711
|
function useToast() {
|
|
@@ -3553,7 +3722,7 @@ var arrow2 = "z7rufs1";
|
|
|
3553
3722
|
var content11 = "z7rufs0";
|
|
3554
3723
|
|
|
3555
3724
|
// src/components/Tooltip/Tooltip.tsx
|
|
3556
|
-
import { jsx as
|
|
3725
|
+
import { jsx as jsx43, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
3557
3726
|
function Tooltip({
|
|
3558
3727
|
content: content12,
|
|
3559
3728
|
children,
|
|
@@ -3568,9 +3737,9 @@ function Tooltip({
|
|
|
3568
3737
|
}) {
|
|
3569
3738
|
const portal2 = usePortalProps();
|
|
3570
3739
|
if (disabled || content12 == null || content12 === "") return children;
|
|
3571
|
-
return /* @__PURE__ */
|
|
3572
|
-
/* @__PURE__ */
|
|
3573
|
-
/* @__PURE__ */
|
|
3740
|
+
return /* @__PURE__ */ jsx43(RadixTooltip.Provider, { delayDuration: delay, children: /* @__PURE__ */ jsxs36(RadixTooltip.Root, { open, defaultOpen, onOpenChange, children: [
|
|
3741
|
+
/* @__PURE__ */ jsx43(RadixTooltip.Trigger, { asChild: true, children }),
|
|
3742
|
+
/* @__PURE__ */ jsx43(RadixTooltip.Portal, { children: /* @__PURE__ */ jsxs36(
|
|
3574
3743
|
RadixTooltip.Content,
|
|
3575
3744
|
{
|
|
3576
3745
|
side,
|
|
@@ -3581,7 +3750,7 @@ function Tooltip({
|
|
|
3581
3750
|
style: portal2.style,
|
|
3582
3751
|
children: [
|
|
3583
3752
|
content12,
|
|
3584
|
-
/* @__PURE__ */
|
|
3753
|
+
/* @__PURE__ */ jsx43(RadixTooltip.Arrow, { className: arrow2, width: 10, height: 5 })
|
|
3585
3754
|
]
|
|
3586
3755
|
}
|
|
3587
3756
|
) })
|
|
@@ -3589,7 +3758,7 @@ function Tooltip({
|
|
|
3589
3758
|
}
|
|
3590
3759
|
|
|
3591
3760
|
// src/components/VerificationCodeInput/VerificationCodeInput.tsx
|
|
3592
|
-
import { forwardRef as
|
|
3761
|
+
import { forwardRef as forwardRef38, useEffect as useEffect12, useId as useId19, useRef as useRef18, useState as useState20 } from "react";
|
|
3593
3762
|
|
|
3594
3763
|
// src/components/VerificationCodeInput/VerificationCodeInput.css.ts
|
|
3595
3764
|
var input5 = "ea01812";
|
|
@@ -3599,9 +3768,9 @@ var slots = "ea01811";
|
|
|
3599
3768
|
var timer = "ea01814";
|
|
3600
3769
|
|
|
3601
3770
|
// src/components/VerificationCodeInput/VerificationCodeInput.tsx
|
|
3602
|
-
import { jsx as
|
|
3771
|
+
import { jsx as jsx44, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
3603
3772
|
var formatTime = (seconds) => `${String(Math.floor(seconds / 60)).padStart(2, "0")}:${String(seconds % 60).padStart(2, "0")}`;
|
|
3604
|
-
var VerificationCodeInput = /* @__PURE__ */
|
|
3773
|
+
var VerificationCodeInput = /* @__PURE__ */ forwardRef38(
|
|
3605
3774
|
function VerificationCodeInput2(props, ref) {
|
|
3606
3775
|
const {
|
|
3607
3776
|
length = 6,
|
|
@@ -3628,23 +3797,23 @@ var VerificationCodeInput = /* @__PURE__ */ forwardRef37(
|
|
|
3628
3797
|
const label6 = labelProp ?? m.verificationCode ?? "\uC778\uC99D\uBC88\uD638";
|
|
3629
3798
|
const resendText = resendTextProp ?? m.resend ?? "\uC7AC\uC804\uC1A1";
|
|
3630
3799
|
const expiredText = expiredTextProp ?? m.verificationExpired ?? "\uC778\uC99D \uC2DC\uAC04\uC774 \uC9C0\uB0AC\uC5B4\uC694. \uC7AC\uC804\uC1A1\uD574 \uC8FC\uC138\uC694.";
|
|
3631
|
-
const generatedId =
|
|
3800
|
+
const generatedId = useId19();
|
|
3632
3801
|
const inputId = id ?? generatedId;
|
|
3633
3802
|
const helperId = `${inputId}-helper`;
|
|
3634
3803
|
const statusId = `${inputId}-status`;
|
|
3635
|
-
const inputRef =
|
|
3804
|
+
const inputRef = useRef18(null);
|
|
3636
3805
|
const isControlled = "value" in props;
|
|
3637
|
-
const [innerValue, setInnerValue] =
|
|
3806
|
+
const [innerValue, setInnerValue] = useState20(defaultValue ?? "");
|
|
3638
3807
|
const code = (isControlled ? value3 ?? "" : innerValue).slice(0, length);
|
|
3639
|
-
const [focused, setFocused] =
|
|
3640
|
-
const [endAt, setEndAt] =
|
|
3641
|
-
const [remaining, setRemaining] =
|
|
3808
|
+
const [focused, setFocused] = useState20(false);
|
|
3809
|
+
const [endAt, setEndAt] = useState20(() => expiresIn ? Date.now() + expiresIn * 1e3 : null);
|
|
3810
|
+
const [remaining, setRemaining] = useState20(expiresIn ?? 0);
|
|
3642
3811
|
const expired = expiresIn !== void 0 && remaining <= 0;
|
|
3643
|
-
const onExpireRef =
|
|
3644
|
-
|
|
3812
|
+
const onExpireRef = useRef18(onExpire);
|
|
3813
|
+
useEffect12(() => {
|
|
3645
3814
|
onExpireRef.current = onExpire;
|
|
3646
3815
|
});
|
|
3647
|
-
|
|
3816
|
+
useEffect12(() => {
|
|
3648
3817
|
if (endAt === null) return;
|
|
3649
3818
|
const tick = () => {
|
|
3650
3819
|
const left = Math.max(0, Math.ceil((endAt - Date.now()) / 1e3));
|
|
@@ -3679,17 +3848,17 @@ var VerificationCodeInput = /* @__PURE__ */ forwardRef37(
|
|
|
3679
3848
|
};
|
|
3680
3849
|
const description7 = helperText3 ?? m.verificationCodeHint?.(length, type) ?? `${length}\uC790\uB9AC ${type === "numeric" ? "\uC22B\uC790" : "\uBB38\uC790"}\uB97C \uC785\uB825\uD558\uC138\uC694.`;
|
|
3681
3850
|
const activeIndex = Math.min(code.length, length - 1);
|
|
3682
|
-
return /* @__PURE__ */
|
|
3851
|
+
return /* @__PURE__ */ jsxs37(
|
|
3683
3852
|
"div",
|
|
3684
3853
|
{
|
|
3685
3854
|
className: cx(field, className),
|
|
3686
3855
|
"data-invalid": error || void 0,
|
|
3687
3856
|
"data-disabled": disabled || void 0,
|
|
3688
3857
|
children: [
|
|
3689
|
-
/* @__PURE__ */
|
|
3690
|
-
/* @__PURE__ */
|
|
3691
|
-
/* @__PURE__ */
|
|
3692
|
-
/* @__PURE__ */
|
|
3858
|
+
/* @__PURE__ */ jsx44("label", { htmlFor: inputId, className: label, children: label6 }),
|
|
3859
|
+
/* @__PURE__ */ jsxs37("div", { className: row4, children: [
|
|
3860
|
+
/* @__PURE__ */ jsxs37("div", { className: slots, children: [
|
|
3861
|
+
/* @__PURE__ */ jsx44(
|
|
3693
3862
|
"input",
|
|
3694
3863
|
{
|
|
3695
3864
|
ref: mergeRefs(ref, inputRef),
|
|
@@ -3709,7 +3878,7 @@ var VerificationCodeInput = /* @__PURE__ */ forwardRef37(
|
|
|
3709
3878
|
className: input5
|
|
3710
3879
|
}
|
|
3711
3880
|
),
|
|
3712
|
-
Array.from({ length }, (_, index) => /* @__PURE__ */
|
|
3881
|
+
Array.from({ length }, (_, index) => /* @__PURE__ */ jsx44(
|
|
3713
3882
|
"div",
|
|
3714
3883
|
{
|
|
3715
3884
|
className: slot,
|
|
@@ -3720,12 +3889,12 @@ var VerificationCodeInput = /* @__PURE__ */ forwardRef37(
|
|
|
3720
3889
|
index
|
|
3721
3890
|
))
|
|
3722
3891
|
] }),
|
|
3723
|
-
expiresIn !== void 0 && /* @__PURE__ */
|
|
3724
|
-
onResend && /* @__PURE__ */
|
|
3892
|
+
expiresIn !== void 0 && /* @__PURE__ */ jsx44("span", { role: "timer", className: timer, children: formatTime(remaining) }),
|
|
3893
|
+
onResend && /* @__PURE__ */ jsx44(Button, { size: "sm", variant: "outline", color: "neutral", onClick: resend, disabled, children: resendText })
|
|
3725
3894
|
] }),
|
|
3726
|
-
/* @__PURE__ */
|
|
3727
|
-
/* @__PURE__ */
|
|
3728
|
-
name && /* @__PURE__ */
|
|
3895
|
+
/* @__PURE__ */ jsx44("p", { id: helperId, className: helperText({ error }), children: description7 }),
|
|
3896
|
+
/* @__PURE__ */ jsx44("p", { id: statusId, role: "status", className: helperText({ error: true }), children: expired ? expiredText : "" }),
|
|
3897
|
+
name && /* @__PURE__ */ jsx44("input", { type: "hidden", name, value: code })
|
|
3729
3898
|
]
|
|
3730
3899
|
}
|
|
3731
3900
|
);
|
|
@@ -3770,6 +3939,7 @@ export {
|
|
|
3770
3939
|
LocaleProvider,
|
|
3771
3940
|
Modal,
|
|
3772
3941
|
ModalClose,
|
|
3942
|
+
NativeSelect,
|
|
3773
3943
|
NumberInput,
|
|
3774
3944
|
Pagination,
|
|
3775
3945
|
PhoneNumberInput,
|