@bestow-ui/react 1.3.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -3
- package/dist/{chunk-VH7JW6N7.js → chunk-VQ45DNC3.js} +18 -2
- package/dist/chunk-VQ45DNC3.js.map +1 -0
- package/dist/client.js +459 -303
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +526 -337
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +57 -10
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +98 -9
- package/dist/index.d.ts +98 -9
- package/dist/shared.js +19 -1
- package/dist/shared.js.map +1 -1
- package/package.json +3 -3
- package/dist/chunk-VH7JW6N7.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -50,6 +50,7 @@ __export(src_exports, {
|
|
|
50
50
|
Checkbox: () => Checkbox,
|
|
51
51
|
Combobox: () => Combobox,
|
|
52
52
|
DatePicker: () => DatePicker,
|
|
53
|
+
DateRangePicker: () => DateRangePicker,
|
|
53
54
|
DescriptionList: () => DescriptionList,
|
|
54
55
|
Divider: () => Divider,
|
|
55
56
|
Drawer: () => Drawer,
|
|
@@ -116,6 +117,7 @@ __export(src_exports, {
|
|
|
116
117
|
contrastRatio: () => contrastRatio,
|
|
117
118
|
createIntentColors: () => createIntentColors,
|
|
118
119
|
createTheme: () => createTheme,
|
|
120
|
+
dateRangePresets: () => dateRangePresets,
|
|
119
121
|
en: () => en,
|
|
120
122
|
focusField: () => focusField,
|
|
121
123
|
formatBusinessNumber: () => formatBusinessNumber,
|
|
@@ -126,6 +128,8 @@ __export(src_exports, {
|
|
|
126
128
|
isValidBusinessNumber: () => isValidBusinessNumber,
|
|
127
129
|
kakaoPostcodeProvider: () => kakaoPostcodeProvider,
|
|
128
130
|
parseISODate: () => parseISODate,
|
|
131
|
+
presetRange: () => presetRange,
|
|
132
|
+
strongInputBorders: () => strongInputBorders,
|
|
129
133
|
themeClass: () => themeClass,
|
|
130
134
|
toISODate: () => toISODate,
|
|
131
135
|
useMessages: () => useMessages,
|
|
@@ -139,7 +143,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
139
143
|
|
|
140
144
|
// src/theme/contract.css.ts
|
|
141
145
|
var themeClass = { light: "tkagtb0", dark: "tkagtb1" };
|
|
142
|
-
var vars = { space: { "0": "var(--bestow-space-0)", "1": "var(--bestow-space-1)", "2": "var(--bestow-space-2)", "3": "var(--bestow-space-3)", "4": "var(--bestow-space-4)", "5": "var(--bestow-space-5)", "6": "var(--bestow-space-6)", "8": "var(--bestow-space-8)", "10": "var(--bestow-space-10)", "12": "var(--bestow-space-12)", "16": "var(--bestow-space-16)" }, radius: { none: "var(--bestow-radius-none)", sm: "var(--bestow-radius-sm)", md: "var(--bestow-radius-md)", lg: "var(--bestow-radius-lg)", xl: "var(--bestow-radius-xl)", full: "var(--bestow-radius-full)" }, font: { family: { sans: "var(--bestow-font-family-sans)", mono: "var(--bestow-font-family-mono)" }, size: { xs: "var(--bestow-font-size-xs)", sm: "var(--bestow-font-size-sm)", md: "var(--bestow-font-size-md)", lg: "var(--bestow-font-size-lg)", xl: "var(--bestow-font-size-xl)", "2xl": "var(--bestow-font-size-2xl)", "3xl": "var(--bestow-font-size-3xl)", "4xl": "var(--bestow-font-size-4xl)" }, weight: { regular: "var(--bestow-font-weight-regular)", medium: "var(--bestow-font-weight-medium)", semibold: "var(--bestow-font-weight-semibold)", bold: "var(--bestow-font-weight-bold)" }, lineHeight: { tight: "var(--bestow-font-line-height-tight)", normal: "var(--bestow-font-line-height-normal)", relaxed: "var(--bestow-font-line-height-relaxed)" } }, duration: { fast: "var(--bestow-duration-fast)", normal: "var(--bestow-duration-normal)", slow: "var(--bestow-duration-slow)" }, zIndex: { overlay: "var(--bestow-z-index-overlay)", modal: "var(--bestow-z-index-modal)", dropdown: "var(--bestow-z-index-dropdown)", toast: "var(--bestow-z-index-toast)", tooltip: "var(--bestow-z-index-tooltip)" }, color: { bg: { "default": "var(--bestow-color-bg-default)", subtle: "var(--bestow-color-bg-subtle)", muted: "var(--bestow-color-bg-muted)", inverse: "var(--bestow-color-bg-inverse)", overlay: "var(--bestow-color-bg-overlay)" }, fg: { "default": "var(--bestow-color-fg-default)", muted: "var(--bestow-color-fg-muted)", subtle: "var(--bestow-color-fg-subtle)", inverse: "var(--bestow-color-fg-inverse)" }, border: { "default": "var(--bestow-color-border-default)", strong: "var(--bestow-color-border-strong)", focus: "var(--bestow-color-border-focus)" }, primary: { solid: "var(--bestow-color-primary-solid)", solidHover: "var(--bestow-color-primary-solid-hover)", contrast: "var(--bestow-color-primary-contrast)", subtle: "var(--bestow-color-primary-subtle)", subtleHover: "var(--bestow-color-primary-subtle-hover)", text: "var(--bestow-color-primary-text)" }, neutral: { solid: "var(--bestow-color-neutral-solid)", solidHover: "var(--bestow-color-neutral-solid-hover)", contrast: "var(--bestow-color-neutral-contrast)", subtle: "var(--bestow-color-neutral-subtle)", subtleHover: "var(--bestow-color-neutral-subtle-hover)", text: "var(--bestow-color-neutral-text)" }, danger: { solid: "var(--bestow-color-danger-solid)", solidHover: "var(--bestow-color-danger-solid-hover)", contrast: "var(--bestow-color-danger-contrast)", subtle: "var(--bestow-color-danger-subtle)", subtleHover: "var(--bestow-color-danger-subtle-hover)", text: "var(--bestow-color-danger-text)" }, success: { solid: "var(--bestow-color-success-solid)", solidHover: "var(--bestow-color-success-solid-hover)", contrast: "var(--bestow-color-success-contrast)", subtle: "var(--bestow-color-success-subtle)", subtleHover: "var(--bestow-color-success-subtle-hover)", text: "var(--bestow-color-success-text)" }, warning: { solid: "var(--bestow-color-warning-solid)", solidHover: "var(--bestow-color-warning-solid-hover)", contrast: "var(--bestow-color-warning-contrast)", subtle: "var(--bestow-color-warning-subtle)", subtleHover: "var(--bestow-color-warning-subtle-hover)", text: "var(--bestow-color-warning-text)" } }, shadow: { sm: "var(--bestow-shadow-sm)", md: "var(--bestow-shadow-md)", lg: "var(--bestow-shadow-lg)" } };
|
|
146
|
+
var vars = { space: { "0": "var(--bestow-space-0)", "1": "var(--bestow-space-1)", "2": "var(--bestow-space-2)", "3": "var(--bestow-space-3)", "4": "var(--bestow-space-4)", "5": "var(--bestow-space-5)", "6": "var(--bestow-space-6)", "8": "var(--bestow-space-8)", "10": "var(--bestow-space-10)", "12": "var(--bestow-space-12)", "16": "var(--bestow-space-16)" }, radius: { none: "var(--bestow-radius-none)", sm: "var(--bestow-radius-sm)", md: "var(--bestow-radius-md)", lg: "var(--bestow-radius-lg)", xl: "var(--bestow-radius-xl)", full: "var(--bestow-radius-full)" }, font: { family: { sans: "var(--bestow-font-family-sans)", mono: "var(--bestow-font-family-mono)" }, size: { xs: "var(--bestow-font-size-xs)", sm: "var(--bestow-font-size-sm)", md: "var(--bestow-font-size-md)", lg: "var(--bestow-font-size-lg)", xl: "var(--bestow-font-size-xl)", "2xl": "var(--bestow-font-size-2xl)", "3xl": "var(--bestow-font-size-3xl)", "4xl": "var(--bestow-font-size-4xl)" }, weight: { regular: "var(--bestow-font-weight-regular)", medium: "var(--bestow-font-weight-medium)", semibold: "var(--bestow-font-weight-semibold)", bold: "var(--bestow-font-weight-bold)" }, lineHeight: { tight: "var(--bestow-font-line-height-tight)", normal: "var(--bestow-font-line-height-normal)", relaxed: "var(--bestow-font-line-height-relaxed)" } }, duration: { fast: "var(--bestow-duration-fast)", normal: "var(--bestow-duration-normal)", slow: "var(--bestow-duration-slow)" }, zIndex: { overlay: "var(--bestow-z-index-overlay)", modal: "var(--bestow-z-index-modal)", dropdown: "var(--bestow-z-index-dropdown)", toast: "var(--bestow-z-index-toast)", tooltip: "var(--bestow-z-index-tooltip)" }, color: { bg: { "default": "var(--bestow-color-bg-default)", subtle: "var(--bestow-color-bg-subtle)", muted: "var(--bestow-color-bg-muted)", inverse: "var(--bestow-color-bg-inverse)", overlay: "var(--bestow-color-bg-overlay)" }, fg: { "default": "var(--bestow-color-fg-default)", muted: "var(--bestow-color-fg-muted)", subtle: "var(--bestow-color-fg-subtle)", inverse: "var(--bestow-color-fg-inverse)" }, border: { "default": "var(--bestow-color-border-default)", strong: "var(--bestow-color-border-strong)", focus: "var(--bestow-color-border-focus)", input: "var(--bestow-color-border-input)", inputHover: "var(--bestow-color-border-input-hover)", control: "var(--bestow-color-border-control)" }, primary: { solid: "var(--bestow-color-primary-solid)", solidHover: "var(--bestow-color-primary-solid-hover)", contrast: "var(--bestow-color-primary-contrast)", subtle: "var(--bestow-color-primary-subtle)", subtleHover: "var(--bestow-color-primary-subtle-hover)", text: "var(--bestow-color-primary-text)" }, neutral: { solid: "var(--bestow-color-neutral-solid)", solidHover: "var(--bestow-color-neutral-solid-hover)", contrast: "var(--bestow-color-neutral-contrast)", subtle: "var(--bestow-color-neutral-subtle)", subtleHover: "var(--bestow-color-neutral-subtle-hover)", text: "var(--bestow-color-neutral-text)" }, danger: { solid: "var(--bestow-color-danger-solid)", solidHover: "var(--bestow-color-danger-solid-hover)", contrast: "var(--bestow-color-danger-contrast)", subtle: "var(--bestow-color-danger-subtle)", subtleHover: "var(--bestow-color-danger-subtle-hover)", text: "var(--bestow-color-danger-text)" }, success: { solid: "var(--bestow-color-success-solid)", solidHover: "var(--bestow-color-success-solid-hover)", contrast: "var(--bestow-color-success-contrast)", subtle: "var(--bestow-color-success-subtle)", subtleHover: "var(--bestow-color-success-subtle-hover)", text: "var(--bestow-color-success-text)" }, warning: { solid: "var(--bestow-color-warning-solid)", solidHover: "var(--bestow-color-warning-solid-hover)", contrast: "var(--bestow-color-warning-contrast)", subtle: "var(--bestow-color-warning-subtle)", subtleHover: "var(--bestow-color-warning-subtle-hover)", text: "var(--bestow-color-warning-text)" } }, shadow: { sm: "var(--bestow-shadow-sm)", md: "var(--bestow-shadow-md)", lg: "var(--bestow-shadow-lg)" } };
|
|
143
147
|
|
|
144
148
|
// src/theme/color.ts
|
|
145
149
|
var import_tokens = require("@bestow-ui/tokens");
|
|
@@ -319,6 +323,16 @@ function themeToStyle(theme, mode) {
|
|
|
319
323
|
return Object.keys(map).length ? (0, import_dynamic.assignInlineVars)(map) : void 0;
|
|
320
324
|
}
|
|
321
325
|
|
|
326
|
+
// src/theme/presets.ts
|
|
327
|
+
var strongInputBorders = /* @__PURE__ */ Object.freeze({
|
|
328
|
+
// 라이트: gray600 / gray700 — 흰 배경 5.18:1, bg.subtle(gray50) 4.91:1
|
|
329
|
+
// 체크 컨트롤: gray600 — 흰 배경 5.18:1
|
|
330
|
+
light: { color: { border: { input: "#666e76", inputHover: "#495057", control: "#666e76" } } },
|
|
331
|
+
// 다크: gray500 / gray300 — gray600 은 bg.subtle(gray900) 위에서 2.98:1 이라 한 단계 밝게. bg.default 8.57:1, bg.subtle 7.43:1
|
|
332
|
+
// 체크 컨트롤: gray500 — 다크 기본값(border.strong)과 같다(이미 8.57:1)
|
|
333
|
+
dark: { color: { border: { input: "#adb5bd", inputHover: "#dee2e6", control: "#adb5bd" } } }
|
|
334
|
+
});
|
|
335
|
+
|
|
322
336
|
// src/i18n/en.ts
|
|
323
337
|
var WEEKDAYS_LONG = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
|
324
338
|
var MONTHS = [
|
|
@@ -362,6 +376,9 @@ var en = {
|
|
|
362
376
|
fileTooLarge: (name, maxSize) => `${name}: files must be ${maxSize} or smaller.`,
|
|
363
377
|
fileTypeNotAllowed: (name) => `${name}: this file type is not allowed.`,
|
|
364
378
|
fileTooMany: (maxFiles) => `You can upload up to ${maxFiles} files.`,
|
|
379
|
+
dateRangeStart: "Start date",
|
|
380
|
+
dateRangeEnd: "End date",
|
|
381
|
+
dateRangePresets: "Quick select",
|
|
365
382
|
errorSummaryTitle: (count2) => `There ${count2 === 1 ? "is 1 problem" : `are ${count2} problems`} with your answers`,
|
|
366
383
|
rangeStart: "minimum",
|
|
367
384
|
rangeEnd: "maximum",
|
|
@@ -632,6 +649,20 @@ var DescriptionList = /* @__PURE__ */ (0, import_react3.forwardRef)(
|
|
|
632
649
|
}
|
|
633
650
|
);
|
|
634
651
|
|
|
652
|
+
// src/components/DateRangePicker/presets.ts
|
|
653
|
+
var dateRangePresets = [
|
|
654
|
+
{ label: "\uC624\uB298", days: 0 },
|
|
655
|
+
{ label: "1\uC8FC\uC77C", days: 7 },
|
|
656
|
+
{ label: "1\uAC1C\uC6D4", months: 1 },
|
|
657
|
+
{ label: "3\uAC1C\uC6D4", months: 3 }
|
|
658
|
+
];
|
|
659
|
+
function presetRange(preset, today) {
|
|
660
|
+
const end2 = parseISODate(today);
|
|
661
|
+
if (!end2) return { start: "", end: "" };
|
|
662
|
+
const start = preset.months !== void 0 ? addMonths(end2, -preset.months) : addDays(end2, -(preset.days ?? 0));
|
|
663
|
+
return { start: toISODate(start), end: today };
|
|
664
|
+
}
|
|
665
|
+
|
|
635
666
|
// src/components/Divider/Divider.tsx
|
|
636
667
|
var import_react4 = require("react");
|
|
637
668
|
|
|
@@ -1680,7 +1711,7 @@ var AmountInput = /* @__PURE__ */ (0, import_react24.forwardRef)(
|
|
|
1680
1711
|
return digits;
|
|
1681
1712
|
};
|
|
1682
1713
|
const toRaw = (amount) => amount === null || amount === void 0 ? "" : String(Math.floor(Math.abs(amount)));
|
|
1683
|
-
const
|
|
1714
|
+
const field4 = useFormattedInput({
|
|
1684
1715
|
isControlled: "value" in props,
|
|
1685
1716
|
value: toRaw(value4),
|
|
1686
1717
|
defaultValue: toRaw(defaultValue),
|
|
@@ -1690,7 +1721,7 @@ var AmountInput = /* @__PURE__ */ (0, import_react24.forwardRef)(
|
|
|
1690
1721
|
isMeaningful: isDigit,
|
|
1691
1722
|
inputRef
|
|
1692
1723
|
});
|
|
1693
|
-
const reading = showKoreanAmount &&
|
|
1724
|
+
const reading = showKoreanAmount && field4.raw !== "" ? formatKoreanAmount(Number(field4.raw), unit2) : null;
|
|
1694
1725
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1695
1726
|
TextField,
|
|
1696
1727
|
{
|
|
@@ -1698,10 +1729,10 @@ var AmountInput = /* @__PURE__ */ (0, import_react24.forwardRef)(
|
|
|
1698
1729
|
label: label7,
|
|
1699
1730
|
placeholder,
|
|
1700
1731
|
inputMode: "numeric",
|
|
1701
|
-
value:
|
|
1702
|
-
onChange:
|
|
1732
|
+
value: field4.display,
|
|
1733
|
+
onChange: field4.onChange,
|
|
1703
1734
|
onKeyDown: (event) => {
|
|
1704
|
-
|
|
1735
|
+
field4.onKeyDown(event);
|
|
1705
1736
|
onKeyDown?.(event);
|
|
1706
1737
|
},
|
|
1707
1738
|
endAdornment: unit2,
|
|
@@ -1812,10 +1843,10 @@ var separator = "_18t8ztt4";
|
|
|
1812
1843
|
|
|
1813
1844
|
// src/components/Breadcrumb/Breadcrumb.tsx
|
|
1814
1845
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1815
|
-
var Breadcrumb = /* @__PURE__ */ (0, import_react27.forwardRef)(function Breadcrumb2({ items: items2, linkAs, separator:
|
|
1846
|
+
var Breadcrumb = /* @__PURE__ */ (0, import_react27.forwardRef)(function Breadcrumb2({ items: items2, linkAs, separator: separator4, "aria-label": ariaLabelProp, className, ...rest }, ref) {
|
|
1816
1847
|
const m = useMessages();
|
|
1817
1848
|
const ariaLabel = ariaLabelProp ?? m.breadcrumb ?? "\uC774\uB3D9 \uACBD\uB85C";
|
|
1818
|
-
const sep =
|
|
1849
|
+
const sep = separator4 ?? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_icons8.ChevronRightIcon, { size: 14 });
|
|
1819
1850
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("nav", { ref, "aria-label": ariaLabel, className, ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("ol", { className: list2, children: items2.map((item10, index) => {
|
|
1820
1851
|
const isCurrent = index === items2.length - 1;
|
|
1821
1852
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("li", { className: item4, children: [
|
|
@@ -1852,7 +1883,7 @@ var BusinessNumberInput = /* @__PURE__ */ (0, import_react28.forwardRef)(
|
|
|
1852
1883
|
const label7 = labelProp ?? m.businessNumber ?? "\uC0AC\uC5C5\uC790\uB4F1\uB85D\uBC88\uD638";
|
|
1853
1884
|
const incompleteText = m.businessNumberIncomplete ?? "10\uC790\uB9AC\uB97C \uBAA8\uB450 \uC785\uB825\uD574 \uC8FC\uC138\uC694.";
|
|
1854
1885
|
const [touched, setTouched] = (0, import_react28.useState)(false);
|
|
1855
|
-
const
|
|
1886
|
+
const field4 = useFormattedInput({
|
|
1856
1887
|
isControlled: "value" in props,
|
|
1857
1888
|
value: value4,
|
|
1858
1889
|
defaultValue,
|
|
@@ -1862,8 +1893,8 @@ var BusinessNumberInput = /* @__PURE__ */ (0, import_react28.forwardRef)(
|
|
|
1862
1893
|
isMeaningful: isDigit2,
|
|
1863
1894
|
inputRef
|
|
1864
1895
|
});
|
|
1865
|
-
const complete =
|
|
1866
|
-
const autoInvalid = validate &&
|
|
1896
|
+
const complete = field4.raw.length === 10;
|
|
1897
|
+
const autoInvalid = validate && field4.raw.length > 0 && (complete ? !isValidBusinessNumber(field4.raw) : touched);
|
|
1867
1898
|
const showAuto = autoInvalid && error === void 0;
|
|
1868
1899
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1869
1900
|
TextField,
|
|
@@ -1872,10 +1903,10 @@ var BusinessNumberInput = /* @__PURE__ */ (0, import_react28.forwardRef)(
|
|
|
1872
1903
|
label: label7,
|
|
1873
1904
|
placeholder,
|
|
1874
1905
|
inputMode: "numeric",
|
|
1875
|
-
value:
|
|
1876
|
-
onChange:
|
|
1906
|
+
value: field4.display,
|
|
1907
|
+
onChange: field4.onChange,
|
|
1877
1908
|
onKeyDown: (event) => {
|
|
1878
|
-
|
|
1909
|
+
field4.onKeyDown(event);
|
|
1879
1910
|
onKeyDown?.(event);
|
|
1880
1911
|
},
|
|
1881
1912
|
onBlur: (event) => {
|
|
@@ -2110,6 +2141,7 @@ var toggle2 = "c2pbq71 c2pbq70";
|
|
|
2110
2141
|
|
|
2111
2142
|
// src/components/Combobox/Combobox.tsx
|
|
2112
2143
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2144
|
+
var NO_RESULTS_ANNOUNCE_DELAY = 800;
|
|
2113
2145
|
var defaultFilter = (option2, query) => option2.label.toLowerCase().includes(query.trim().toLowerCase());
|
|
2114
2146
|
var Combobox = /* @__PURE__ */ (0, import_react32.forwardRef)(function Combobox2(props, ref) {
|
|
2115
2147
|
const {
|
|
@@ -2235,6 +2267,14 @@ var Combobox = /* @__PURE__ */ (0, import_react32.forwardRef)(function Combobox2
|
|
|
2235
2267
|
document.getElementById(optionId(activeIndex))?.scrollIntoView?.({ block: "nearest" });
|
|
2236
2268
|
}, [open, activeIndex]);
|
|
2237
2269
|
const hasOptions = filtered.length > 0;
|
|
2270
|
+
const noResults = open && !disabled && !hasOptions;
|
|
2271
|
+
const [announcedFor, setAnnouncedFor] = (0, import_react32.useState)(void 0);
|
|
2272
|
+
(0, import_react32.useEffect)(() => {
|
|
2273
|
+
if (!noResults) return;
|
|
2274
|
+
const timer2 = setTimeout(() => setAnnouncedFor(query), NO_RESULTS_ANNOUNCE_DELAY);
|
|
2275
|
+
return () => clearTimeout(timer2);
|
|
2276
|
+
}, [noResults, query]);
|
|
2277
|
+
const announceNoResults = noResults && announcedFor === query;
|
|
2238
2278
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
|
|
2239
2279
|
label7 && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("label", { id: labelId, htmlFor: inputId, className: label2, children: [
|
|
2240
2280
|
label7,
|
|
@@ -2364,10 +2404,14 @@ var Combobox = /* @__PURE__ */ (0, import_react32.forwardRef)(function Combobox2
|
|
|
2364
2404
|
);
|
|
2365
2405
|
})
|
|
2366
2406
|
}
|
|
2367
|
-
) :
|
|
2407
|
+
) : (
|
|
2408
|
+
// 스크린리더 알림은 아래의 항상 있는 status 영역이 맡는다 (여기는 화면 표시만)
|
|
2409
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: empty, children: emptyMessage })
|
|
2410
|
+
)
|
|
2368
2411
|
}
|
|
2369
2412
|
) })
|
|
2370
2413
|
] }),
|
|
2414
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { role: "status", className: visuallyHidden, children: announceNoResults ? emptyMessage : "" }),
|
|
2371
2415
|
name && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("input", { type: "hidden", name, value: selectedValue ?? "" }),
|
|
2372
2416
|
helperText3 && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { id: helperId, className: helperText({ error }), children: helperText3 })
|
|
2373
2417
|
] });
|
|
@@ -2490,7 +2534,7 @@ var DatePicker = /* @__PURE__ */ (0, import_react34.forwardRef)(
|
|
|
2490
2534
|
lastEmitted.current = iso;
|
|
2491
2535
|
onValueChange?.(iso);
|
|
2492
2536
|
};
|
|
2493
|
-
const
|
|
2537
|
+
const field4 = useFormattedInput({
|
|
2494
2538
|
isControlled: false,
|
|
2495
2539
|
value: void 0,
|
|
2496
2540
|
defaultValue: (isControlled ? value4 : defaultValue)?.replace(/\D/g, ""),
|
|
@@ -2503,8 +2547,8 @@ var DatePicker = /* @__PURE__ */ (0, import_react34.forwardRef)(
|
|
|
2503
2547
|
isMeaningful: isDigit3,
|
|
2504
2548
|
inputRef
|
|
2505
2549
|
});
|
|
2506
|
-
const textIso = toIso(
|
|
2507
|
-
const { setRaw } =
|
|
2550
|
+
const textIso = toIso(field4.raw);
|
|
2551
|
+
const { setRaw } = field4;
|
|
2508
2552
|
(0, import_react34.useEffect)(() => {
|
|
2509
2553
|
if (!isControlled) return;
|
|
2510
2554
|
const next = value4 ?? "";
|
|
@@ -2516,8 +2560,8 @@ var DatePicker = /* @__PURE__ */ (0, import_react34.forwardRef)(
|
|
|
2516
2560
|
setRaw(next.replace(/\D/g, ""));
|
|
2517
2561
|
}, [value4]);
|
|
2518
2562
|
const date = parseISODate(textIso);
|
|
2519
|
-
const complete =
|
|
2520
|
-
const autoError = complete ? !date ? invalidText : isUnavailable(date) ? unavailableText : null : touched &&
|
|
2563
|
+
const complete = field4.raw.length === 8;
|
|
2564
|
+
const autoError = complete ? !date ? invalidText : isUnavailable(date) ? unavailableText : null : touched && field4.raw.length > 0 ? incompleteText : null;
|
|
2521
2565
|
const showAuto = autoError !== null && error === void 0;
|
|
2522
2566
|
const selectedIso = date && !isUnavailable(date) ? textIso : "";
|
|
2523
2567
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
@@ -2530,9 +2574,9 @@ var DatePicker = /* @__PURE__ */ (0, import_react34.forwardRef)(
|
|
|
2530
2574
|
placeholder,
|
|
2531
2575
|
inputMode: "numeric",
|
|
2532
2576
|
autoComplete: "off",
|
|
2533
|
-
value:
|
|
2534
|
-
onChange:
|
|
2535
|
-
onKeyDown:
|
|
2577
|
+
value: field4.display,
|
|
2578
|
+
onChange: field4.onChange,
|
|
2579
|
+
onKeyDown: field4.onKeyDown,
|
|
2536
2580
|
onBlur: () => setTouched(true),
|
|
2537
2581
|
error: error ?? autoError !== null,
|
|
2538
2582
|
helperText: showAuto ? autoError : helperText3,
|
|
@@ -2576,6 +2620,129 @@ var DatePicker = /* @__PURE__ */ (0, import_react34.forwardRef)(
|
|
|
2576
2620
|
}
|
|
2577
2621
|
);
|
|
2578
2622
|
|
|
2623
|
+
// src/components/DateRangePicker/DateRangePicker.tsx
|
|
2624
|
+
var import_react35 = require("react");
|
|
2625
|
+
|
|
2626
|
+
// src/components/DateRangePicker/DateRangePicker.css.ts
|
|
2627
|
+
var field2 = "_17277dh3";
|
|
2628
|
+
var fields = "_17277dh2";
|
|
2629
|
+
var fieldset3 = "_17277dh0";
|
|
2630
|
+
var legend3 = "_17277dh1";
|
|
2631
|
+
var presets = "_17277dh5";
|
|
2632
|
+
var separator2 = "_17277dh4";
|
|
2633
|
+
|
|
2634
|
+
// src/components/DateRangePicker/DateRangePicker.tsx
|
|
2635
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2636
|
+
var DateRangePicker = /* @__PURE__ */ (0, import_react35.forwardRef)(
|
|
2637
|
+
function DateRangePicker2(props, ref) {
|
|
2638
|
+
const {
|
|
2639
|
+
value: value4,
|
|
2640
|
+
defaultValue,
|
|
2641
|
+
onValueChange,
|
|
2642
|
+
label: label7,
|
|
2643
|
+
startLabel: startLabelProp,
|
|
2644
|
+
endLabel: endLabelProp,
|
|
2645
|
+
presets: presets2,
|
|
2646
|
+
min,
|
|
2647
|
+
max,
|
|
2648
|
+
isDateDisabled,
|
|
2649
|
+
isHoliday,
|
|
2650
|
+
today,
|
|
2651
|
+
helperText: helperText3,
|
|
2652
|
+
error,
|
|
2653
|
+
required,
|
|
2654
|
+
disabled,
|
|
2655
|
+
startName,
|
|
2656
|
+
endName,
|
|
2657
|
+
id,
|
|
2658
|
+
className
|
|
2659
|
+
} = props;
|
|
2660
|
+
const m = useMessages();
|
|
2661
|
+
const generatedId = (0, import_react35.useId)();
|
|
2662
|
+
const baseId = id ?? generatedId;
|
|
2663
|
+
const helperId = helperText3 ? `${baseId}-helper` : void 0;
|
|
2664
|
+
const isClient = useIsClient();
|
|
2665
|
+
const isControlled = "value" in props;
|
|
2666
|
+
const [inner, setInner] = (0, import_react35.useState)(defaultValue ?? { start: "", end: "" });
|
|
2667
|
+
const range3 = isControlled ? value4 ?? { start: "", end: "" } : inner;
|
|
2668
|
+
const update = (next) => {
|
|
2669
|
+
if (next.start === range3.start && next.end === range3.end) return;
|
|
2670
|
+
if (!isControlled) setInner(next);
|
|
2671
|
+
onValueChange?.(next);
|
|
2672
|
+
};
|
|
2673
|
+
const todayIso = () => today ?? toISODate(/* @__PURE__ */ new Date());
|
|
2674
|
+
const startLabel = startLabelProp ?? m.dateRangeStart ?? "\uC2DC\uC791\uC77C";
|
|
2675
|
+
const endLabel = endLabelProp ?? m.dateRangeEnd ?? "\uC885\uB8CC\uC77C";
|
|
2676
|
+
const common = { isDateDisabled, isHoliday, today, disabled, required, fullWidth: true };
|
|
2677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
2678
|
+
"fieldset",
|
|
2679
|
+
{
|
|
2680
|
+
ref,
|
|
2681
|
+
id,
|
|
2682
|
+
className: cx(fieldset3, className),
|
|
2683
|
+
"aria-describedby": helperId,
|
|
2684
|
+
"data-invalid": error || void 0,
|
|
2685
|
+
children: [
|
|
2686
|
+
label7 && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("legend", { className: legend3, children: [
|
|
2687
|
+
label7,
|
|
2688
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
2689
|
+
] }),
|
|
2690
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: fields, children: [
|
|
2691
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: field2, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2692
|
+
DatePicker,
|
|
2693
|
+
{
|
|
2694
|
+
...common,
|
|
2695
|
+
id: `${baseId}-start`,
|
|
2696
|
+
label: startLabel,
|
|
2697
|
+
value: range3.start,
|
|
2698
|
+
onValueChange: (start) => update({ ...range3, start }),
|
|
2699
|
+
min,
|
|
2700
|
+
max: range3.end || max,
|
|
2701
|
+
name: startName,
|
|
2702
|
+
error: error || void 0
|
|
2703
|
+
}
|
|
2704
|
+
) }),
|
|
2705
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: separator2, "aria-hidden": true, children: "~" }),
|
|
2706
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: field2, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2707
|
+
DatePicker,
|
|
2708
|
+
{
|
|
2709
|
+
...common,
|
|
2710
|
+
id: `${baseId}-end`,
|
|
2711
|
+
label: endLabel,
|
|
2712
|
+
value: range3.end,
|
|
2713
|
+
onValueChange: (end2) => update({ ...range3, end: end2 }),
|
|
2714
|
+
min: range3.start || min,
|
|
2715
|
+
max,
|
|
2716
|
+
name: endName,
|
|
2717
|
+
error: error || void 0
|
|
2718
|
+
}
|
|
2719
|
+
) })
|
|
2720
|
+
] }),
|
|
2721
|
+
presets2 && presets2.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { role: "group", "aria-label": m.dateRangePresets ?? "\uBE60\uB978 \uC120\uD0DD", className: presets, children: presets2.map((preset) => {
|
|
2722
|
+
const target = isClient ? presetRange(preset, todayIso()) : null;
|
|
2723
|
+
const pressed = !!target && target.start === range3.start && target.end === range3.end;
|
|
2724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2725
|
+
Button,
|
|
2726
|
+
{
|
|
2727
|
+
type: "button",
|
|
2728
|
+
size: "sm",
|
|
2729
|
+
variant: pressed ? "soft" : "outline",
|
|
2730
|
+
color: pressed ? "primary" : "neutral",
|
|
2731
|
+
"aria-pressed": pressed,
|
|
2732
|
+
disabled,
|
|
2733
|
+
onClick: () => update(presetRange(preset, todayIso())),
|
|
2734
|
+
children: preset.label
|
|
2735
|
+
},
|
|
2736
|
+
preset.label
|
|
2737
|
+
);
|
|
2738
|
+
}) }),
|
|
2739
|
+
helperText3 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { id: helperId, className: helperText({ error }), children: helperText3 })
|
|
2740
|
+
]
|
|
2741
|
+
}
|
|
2742
|
+
);
|
|
2743
|
+
}
|
|
2744
|
+
);
|
|
2745
|
+
|
|
2579
2746
|
// src/components/Drawer/Drawer.tsx
|
|
2580
2747
|
var Dialog2 = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
2581
2748
|
var import_icons13 = require("@bestow-ui/icons");
|
|
@@ -2593,7 +2760,7 @@ var overlay2 = "nmobyv0";
|
|
|
2593
2760
|
var title4 = "nmobyvv";
|
|
2594
2761
|
|
|
2595
2762
|
// src/components/Drawer/Drawer.tsx
|
|
2596
|
-
var
|
|
2763
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2597
2764
|
function Drawer({
|
|
2598
2765
|
open,
|
|
2599
2766
|
defaultOpen,
|
|
@@ -2612,11 +2779,11 @@ function Drawer({
|
|
|
2612
2779
|
const portal2 = usePortalProps();
|
|
2613
2780
|
const m = useMessages();
|
|
2614
2781
|
const focus = useReturnFocus(Boolean(trigger4));
|
|
2615
|
-
return /* @__PURE__ */ (0,
|
|
2616
|
-
trigger4 && /* @__PURE__ */ (0,
|
|
2617
|
-
/* @__PURE__ */ (0,
|
|
2618
|
-
/* @__PURE__ */ (0,
|
|
2619
|
-
/* @__PURE__ */ (0,
|
|
2782
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Dialog2.Root, { open, defaultOpen, onOpenChange, children: [
|
|
2783
|
+
trigger4 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Dialog2.Trigger, { asChild: true, children: trigger4 }),
|
|
2784
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Dialog2.Portal, { children: [
|
|
2785
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Dialog2.Overlay, { className: cx(portal2.className, overlay2), style: portal2.style }),
|
|
2786
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
2620
2787
|
Dialog2.Content,
|
|
2621
2788
|
{
|
|
2622
2789
|
className: cx(portal2.className, content8({ side, size }), className),
|
|
@@ -2627,15 +2794,15 @@ function Drawer({
|
|
|
2627
2794
|
onCloseAutoFocus: focus.onCloseAutoFocus,
|
|
2628
2795
|
...description8 ? {} : { "aria-describedby": void 0 },
|
|
2629
2796
|
children: [
|
|
2630
|
-
/* @__PURE__ */ (0,
|
|
2631
|
-
/* @__PURE__ */ (0,
|
|
2632
|
-
/* @__PURE__ */ (0,
|
|
2633
|
-
description8 && /* @__PURE__ */ (0,
|
|
2797
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: header7, children: [
|
|
2798
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: headings2, children: [
|
|
2799
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Dialog2.Title, { className: title4, children: title6 }),
|
|
2800
|
+
description8 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Dialog2.Description, { className: description4, children: description8 })
|
|
2634
2801
|
] }),
|
|
2635
|
-
!hideCloseButton && /* @__PURE__ */ (0,
|
|
2802
|
+
!hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Dialog2.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(IconButton, { "aria-label": m.close ?? "\uB2EB\uAE30", size: "sm", className: closeButton4, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons13.XIcon, {}) }) })
|
|
2636
2803
|
] }),
|
|
2637
|
-
children && /* @__PURE__ */ (0,
|
|
2638
|
-
footer6 && /* @__PURE__ */ (0,
|
|
2804
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: body3, children }),
|
|
2805
|
+
footer6 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: footer3, children: footer6 })
|
|
2639
2806
|
]
|
|
2640
2807
|
}
|
|
2641
2808
|
)
|
|
@@ -2645,7 +2812,7 @@ function Drawer({
|
|
|
2645
2812
|
var DrawerClose = Dialog2.Close;
|
|
2646
2813
|
|
|
2647
2814
|
// src/components/ErrorSummary/ErrorSummary.tsx
|
|
2648
|
-
var
|
|
2815
|
+
var import_react36 = require("react");
|
|
2649
2816
|
|
|
2650
2817
|
// src/components/ErrorSummary/ErrorSummary.css.ts
|
|
2651
2818
|
var link3 = "_1cdophv2";
|
|
@@ -2653,17 +2820,17 @@ var list3 = "_1cdophv1";
|
|
|
2653
2820
|
var root9 = "_1cdophv0";
|
|
2654
2821
|
|
|
2655
2822
|
// src/components/ErrorSummary/ErrorSummary.tsx
|
|
2656
|
-
var
|
|
2657
|
-
var ErrorSummary = /* @__PURE__ */ (0,
|
|
2823
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2824
|
+
var ErrorSummary = /* @__PURE__ */ (0, import_react36.forwardRef)(function ErrorSummary2({ errors: errors2, title: title6, focusKey, className, ...rest }, ref) {
|
|
2658
2825
|
const m = useMessages();
|
|
2659
|
-
const titleId = (0,
|
|
2660
|
-
const rootRef = (0,
|
|
2826
|
+
const titleId = (0, import_react36.useId)();
|
|
2827
|
+
const rootRef = (0, import_react36.useRef)(null);
|
|
2661
2828
|
const hasErrors = errors2.length > 0;
|
|
2662
|
-
(0,
|
|
2829
|
+
(0, import_react36.useEffect)(() => {
|
|
2663
2830
|
if (hasErrors) rootRef.current?.focus();
|
|
2664
2831
|
}, [focusKey, hasErrors]);
|
|
2665
2832
|
if (!hasErrors) return null;
|
|
2666
|
-
return /* @__PURE__ */ (0,
|
|
2833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2667
2834
|
"div",
|
|
2668
2835
|
{
|
|
2669
2836
|
ref: mergeRefs(ref, rootRef),
|
|
@@ -2671,12 +2838,12 @@ var ErrorSummary = /* @__PURE__ */ (0, import_react35.forwardRef)(function Error
|
|
|
2671
2838
|
"aria-labelledby": titleId,
|
|
2672
2839
|
className: cx(root9, className),
|
|
2673
2840
|
...rest,
|
|
2674
|
-
children: /* @__PURE__ */ (0,
|
|
2841
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2675
2842
|
Alert,
|
|
2676
2843
|
{
|
|
2677
2844
|
color: "danger",
|
|
2678
|
-
title: /* @__PURE__ */ (0,
|
|
2679
|
-
children: /* @__PURE__ */ (0,
|
|
2845
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { id: titleId, children: title6 ?? m.errorSummaryTitle?.(errors2.length) ?? `\uC785\uB825\uD55C \uB0B4\uC6A9\uC5D0 \uACE0\uCE60 \uACF3\uC774 ${errors2.length}\uAC1C \uC788\uC5B4\uC694` }),
|
|
2846
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("ul", { className: list3, children: errors2.map((error) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2680
2847
|
"a",
|
|
2681
2848
|
{
|
|
2682
2849
|
href: `#${error.id}`,
|
|
@@ -2694,7 +2861,7 @@ var ErrorSummary = /* @__PURE__ */ (0, import_react35.forwardRef)(function Error
|
|
|
2694
2861
|
});
|
|
2695
2862
|
|
|
2696
2863
|
// src/components/FileUpload/FileUpload.tsx
|
|
2697
|
-
var
|
|
2864
|
+
var import_react37 = require("react");
|
|
2698
2865
|
var import_icons14 = require("@bestow-ui/icons");
|
|
2699
2866
|
|
|
2700
2867
|
// src/components/FileUpload/FileUpload.css.ts
|
|
@@ -2710,7 +2877,8 @@ var list4 = "r2jefr4";
|
|
|
2710
2877
|
var root10 = "r2jefr0";
|
|
2711
2878
|
|
|
2712
2879
|
// src/components/FileUpload/FileUpload.tsx
|
|
2713
|
-
var
|
|
2880
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2881
|
+
var REMOVED_ANNOUNCE_DELAY = 500;
|
|
2714
2882
|
function formatSize(bytes) {
|
|
2715
2883
|
if (bytes < 1024) return `${bytes} B`;
|
|
2716
2884
|
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(bytes < 10 * 1024 ? 1 : 0)} KB`;
|
|
@@ -2726,7 +2894,7 @@ function matchesAccept(file, accept) {
|
|
|
2726
2894
|
}
|
|
2727
2895
|
var NO_FILES = [];
|
|
2728
2896
|
var sameFile = (a, b) => a.name === b.name && a.size === b.size && a.lastModified === b.lastModified;
|
|
2729
|
-
var FileUpload = /* @__PURE__ */ (0,
|
|
2897
|
+
var FileUpload = /* @__PURE__ */ (0, import_react37.forwardRef)(function FileUpload2(props, ref) {
|
|
2730
2898
|
const {
|
|
2731
2899
|
value: value4,
|
|
2732
2900
|
defaultValue,
|
|
@@ -2747,20 +2915,22 @@ var FileUpload = /* @__PURE__ */ (0, import_react36.forwardRef)(function FileUpl
|
|
|
2747
2915
|
} = props;
|
|
2748
2916
|
const m = useMessages();
|
|
2749
2917
|
const isControlled = "value" in props;
|
|
2750
|
-
const [innerFiles, setInnerFiles] = (0,
|
|
2918
|
+
const [innerFiles, setInnerFiles] = (0, import_react37.useState)(defaultValue ?? []);
|
|
2751
2919
|
const files = isControlled ? value4 ?? NO_FILES : innerFiles;
|
|
2752
|
-
const [rejections, setRejections] = (0,
|
|
2753
|
-
const [announcement, setAnnouncement] = (0,
|
|
2754
|
-
const [dragging, setDragging] = (0,
|
|
2755
|
-
const generatedId = (0,
|
|
2920
|
+
const [rejections, setRejections] = (0, import_react37.useState)([]);
|
|
2921
|
+
const [announcement, setAnnouncement] = (0, import_react37.useState)("");
|
|
2922
|
+
const [dragging, setDragging] = (0, import_react37.useState)(false);
|
|
2923
|
+
const generatedId = (0, import_react37.useId)();
|
|
2756
2924
|
const baseId = id ?? generatedId;
|
|
2757
2925
|
const labelId = label7 ? `${baseId}-label` : void 0;
|
|
2758
2926
|
const helperId = helperText3 ? `${baseId}-helper` : void 0;
|
|
2759
2927
|
const errorsId = rejections.length > 0 ? `${baseId}-errors` : void 0;
|
|
2760
|
-
const inputRef = (0,
|
|
2761
|
-
const selectButtonRef = (0,
|
|
2762
|
-
const removeButtonRefs = (0,
|
|
2763
|
-
const focusAfterRemove = (0,
|
|
2928
|
+
const inputRef = (0, import_react37.useRef)(null);
|
|
2929
|
+
const selectButtonRef = (0, import_react37.useRef)(null);
|
|
2930
|
+
const removeButtonRefs = (0, import_react37.useRef)([]);
|
|
2931
|
+
const focusAfterRemove = (0, import_react37.useRef)(null);
|
|
2932
|
+
const announceTimer = (0, import_react37.useRef)(void 0);
|
|
2933
|
+
(0, import_react37.useEffect)(() => () => clearTimeout(announceTimer.current), []);
|
|
2764
2934
|
const selectLabel = m.fileSelect ?? "\uD30C\uC77C \uC120\uD0DD";
|
|
2765
2935
|
const reasonText = (rejection) => {
|
|
2766
2936
|
const fileName2 = rejection.file.name;
|
|
@@ -2769,10 +2939,16 @@ var FileUpload = /* @__PURE__ */ (0, import_react36.forwardRef)(function FileUpl
|
|
|
2769
2939
|
if (rejection.reason === "type") return m.fileTypeNotAllowed?.(fileName2) ?? `${fileName2}: \uC62C\uB9B4 \uC218 \uC5C6\uB294 \uD615\uC2DD\uC774\uC5D0\uC694.`;
|
|
2770
2940
|
return m.fileTooMany?.(maxFiles ?? 0) ?? `\uD30C\uC77C\uC740 ${maxFiles}\uAC1C\uAE4C\uC9C0 \uC62C\uB9B4 \uC218 \uC788\uC5B4\uC694.`;
|
|
2771
2941
|
};
|
|
2772
|
-
const
|
|
2942
|
+
const announce = (message, delay = 0) => {
|
|
2943
|
+
clearTimeout(announceTimer.current);
|
|
2944
|
+
if (delay === 0) return setAnnouncement(message);
|
|
2945
|
+
setAnnouncement("");
|
|
2946
|
+
announceTimer.current = setTimeout(() => setAnnouncement(message), delay);
|
|
2947
|
+
};
|
|
2948
|
+
const commit = (next, message, delay = 0) => {
|
|
2773
2949
|
if (!isControlled) setInnerFiles(next);
|
|
2774
2950
|
onValueChange?.(next);
|
|
2775
|
-
|
|
2951
|
+
announce(message, delay);
|
|
2776
2952
|
};
|
|
2777
2953
|
const addFiles = (incoming) => {
|
|
2778
2954
|
if (disabled || incoming.length === 0) return;
|
|
@@ -2793,22 +2969,22 @@ var FileUpload = /* @__PURE__ */ (0, import_react36.forwardRef)(function FileUpl
|
|
|
2793
2969
|
const summary = m.filesSelected?.(next.length) ?? `\uD30C\uC77C ${next.length}\uAC1C \uC120\uD0DD\uB428`;
|
|
2794
2970
|
const errors2 = [...new Set(rejected.map(reasonText))].join(" ");
|
|
2795
2971
|
if (accepted.length > 0) commit(next, [summary, errors2].filter(Boolean).join(" "));
|
|
2796
|
-
else
|
|
2972
|
+
else announce(errors2);
|
|
2797
2973
|
};
|
|
2798
2974
|
const removeAt = (index) => {
|
|
2799
2975
|
const removed = files[index];
|
|
2800
2976
|
const next = files.filter((_, i) => i !== index);
|
|
2801
2977
|
focusAfterRemove.current = Math.min(index, next.length - 1);
|
|
2802
2978
|
setRejections([]);
|
|
2803
|
-
commit(next, m.fileRemoved?.(removed.name) ?? `${removed.name} \uC0AD\uC81C\uB428
|
|
2979
|
+
commit(next, m.fileRemoved?.(removed.name) ?? `${removed.name} \uC0AD\uC81C\uB428`, REMOVED_ANNOUNCE_DELAY);
|
|
2804
2980
|
};
|
|
2805
|
-
(0,
|
|
2981
|
+
(0, import_react37.useEffect)(() => {
|
|
2806
2982
|
if (focusAfterRemove.current === null) return;
|
|
2807
2983
|
const target = focusAfterRemove.current;
|
|
2808
2984
|
focusAfterRemove.current = null;
|
|
2809
2985
|
(target >= 0 ? removeButtonRefs.current[target] : selectButtonRef.current)?.focus();
|
|
2810
2986
|
}, [files]);
|
|
2811
|
-
(0,
|
|
2987
|
+
(0, import_react37.useEffect)(() => {
|
|
2812
2988
|
const input6 = inputRef.current;
|
|
2813
2989
|
if (!name || !input6 || typeof DataTransfer === "undefined") return;
|
|
2814
2990
|
try {
|
|
@@ -2823,12 +2999,12 @@ var FileUpload = /* @__PURE__ */ (0, import_react36.forwardRef)(function FileUpl
|
|
|
2823
2999
|
event.preventDefault();
|
|
2824
3000
|
setDragging(over);
|
|
2825
3001
|
};
|
|
2826
|
-
return /* @__PURE__ */ (0,
|
|
2827
|
-
label7 && /* @__PURE__ */ (0,
|
|
3002
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { ref, className: cx(field, root10, className), children: [
|
|
3003
|
+
label7 && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { id: labelId, className: label2, children: [
|
|
2828
3004
|
label7,
|
|
2829
|
-
required && /* @__PURE__ */ (0,
|
|
3005
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
2830
3006
|
] }),
|
|
2831
|
-
/* @__PURE__ */ (0,
|
|
3007
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
2832
3008
|
"div",
|
|
2833
3009
|
{
|
|
2834
3010
|
role: "group",
|
|
@@ -2848,8 +3024,8 @@ var FileUpload = /* @__PURE__ */ (0, import_react36.forwardRef)(function FileUpl
|
|
|
2848
3024
|
if (!disabled) addFiles(Array.from(event.dataTransfer.files));
|
|
2849
3025
|
},
|
|
2850
3026
|
children: [
|
|
2851
|
-
/* @__PURE__ */ (0,
|
|
2852
|
-
/* @__PURE__ */ (0,
|
|
3027
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: dropIcon, "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons14.UploadIcon, { size: 24 }) }),
|
|
3028
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2853
3029
|
Button,
|
|
2854
3030
|
{
|
|
2855
3031
|
ref: selectButtonRef,
|
|
@@ -2862,8 +3038,8 @@ var FileUpload = /* @__PURE__ */ (0, import_react36.forwardRef)(function FileUpl
|
|
|
2862
3038
|
children: selectLabel
|
|
2863
3039
|
}
|
|
2864
3040
|
),
|
|
2865
|
-
/* @__PURE__ */ (0,
|
|
2866
|
-
/* @__PURE__ */ (0,
|
|
3041
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: dropHint, children: m.fileDropHint ?? "\uB610\uB294 \uC5EC\uAE30\uB85C \uB04C\uC5B4\uB2E4 \uB193\uC73C\uC138\uC694" }),
|
|
3042
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2867
3043
|
"input",
|
|
2868
3044
|
{
|
|
2869
3045
|
ref: inputRef,
|
|
@@ -2886,11 +3062,11 @@ var FileUpload = /* @__PURE__ */ (0, import_react36.forwardRef)(function FileUpl
|
|
|
2886
3062
|
]
|
|
2887
3063
|
}
|
|
2888
3064
|
),
|
|
2889
|
-
files.length > 0 && /* @__PURE__ */ (0,
|
|
2890
|
-
/* @__PURE__ */ (0,
|
|
2891
|
-
/* @__PURE__ */ (0,
|
|
2892
|
-
/* @__PURE__ */ (0,
|
|
2893
|
-
/* @__PURE__ */ (0,
|
|
3065
|
+
files.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("ul", { "aria-label": m.fileList ?? "\uC120\uD0DD\uD55C \uD30C\uC77C", className: list4, children: files.map((file, index) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("li", { className: item6, children: [
|
|
3066
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: fileIcon, "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons14.FileIcon, { size: 16 }) }),
|
|
3067
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: fileName, children: file.name }),
|
|
3068
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { id: `${baseId}-size-${index}`, className: fileSize, children: formatSize(file.size) }),
|
|
3069
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2894
3070
|
IconButton,
|
|
2895
3071
|
{
|
|
2896
3072
|
ref: (node) => {
|
|
@@ -2898,22 +3074,23 @@ var FileUpload = /* @__PURE__ */ (0, import_react36.forwardRef)(function FileUpl
|
|
|
2898
3074
|
},
|
|
2899
3075
|
size: "sm",
|
|
2900
3076
|
"aria-label": m.fileRemove?.(file.name) ?? `${file.name} \uC0AD\uC81C`,
|
|
3077
|
+
"aria-describedby": `${baseId}-size-${index}`,
|
|
2901
3078
|
disabled,
|
|
2902
3079
|
onClick: () => removeAt(index),
|
|
2903
|
-
children: /* @__PURE__ */ (0,
|
|
3080
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons14.XIcon, {})
|
|
2904
3081
|
}
|
|
2905
3082
|
)
|
|
2906
3083
|
] }, `${file.name}-${file.size}-${file.lastModified}`)) }),
|
|
2907
|
-
rejections.length > 0 && /* @__PURE__ */ (0,
|
|
2908
|
-
helperText3 && /* @__PURE__ */ (0,
|
|
2909
|
-
/* @__PURE__ */ (0,
|
|
3084
|
+
rejections.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("ul", { id: errorsId, className: errors, children: [...new Set(rejections.map(reasonText))].map((text3) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("li", { children: text3 }, text3)) }),
|
|
3085
|
+
helperText3 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { id: helperId, className: helperText({ error }), children: helperText3 }),
|
|
3086
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { role: "status", className: visuallyHidden, children: announcement })
|
|
2910
3087
|
] });
|
|
2911
3088
|
});
|
|
2912
3089
|
|
|
2913
3090
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
2914
3091
|
var RadixMenu = __toESM(require("@radix-ui/react-dropdown-menu"), 1);
|
|
2915
3092
|
var import_icons15 = require("@bestow-ui/icons");
|
|
2916
|
-
var
|
|
3093
|
+
var import_react38 = require("react");
|
|
2917
3094
|
|
|
2918
3095
|
// src/components/DropdownMenu/DropdownMenu.css.ts
|
|
2919
3096
|
var content9 = "_1d7ahux0";
|
|
@@ -2924,20 +3101,20 @@ var indicatorInner = "_1d7ahux8";
|
|
|
2924
3101
|
var item7 = "_1d7ahux1";
|
|
2925
3102
|
var label3 = "_1d7ahux5";
|
|
2926
3103
|
var radioDot = "_1d7ahux9";
|
|
2927
|
-
var
|
|
3104
|
+
var separator3 = "_1d7ahux6";
|
|
2928
3105
|
var shortcut = "_1d7ahux4";
|
|
2929
3106
|
var subChevron = "_1d7ahuxb";
|
|
2930
3107
|
var subTrigger = "_1d7ahuxa";
|
|
2931
3108
|
|
|
2932
3109
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
2933
|
-
var
|
|
3110
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2934
3111
|
var DropdownMenu = RadixMenu.Root;
|
|
2935
3112
|
var DropdownMenuTrigger = RadixMenu.Trigger;
|
|
2936
3113
|
var DropdownMenuGroup = RadixMenu.Group;
|
|
2937
|
-
var DropdownMenuContent = /* @__PURE__ */ (0,
|
|
3114
|
+
var DropdownMenuContent = /* @__PURE__ */ (0, import_react38.forwardRef)(
|
|
2938
3115
|
function DropdownMenuContent2({ className, style, side = "bottom", align = "start", sideOffset = 4, collisionPadding = 8, ...rest }, ref) {
|
|
2939
3116
|
const portal2 = usePortalProps();
|
|
2940
|
-
return /* @__PURE__ */ (0,
|
|
3117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(RadixMenu.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2941
3118
|
RadixMenu.Content,
|
|
2942
3119
|
{
|
|
2943
3120
|
ref,
|
|
@@ -2952,56 +3129,56 @@ var DropdownMenuContent = /* @__PURE__ */ (0, import_react37.forwardRef)(
|
|
|
2952
3129
|
) });
|
|
2953
3130
|
}
|
|
2954
3131
|
);
|
|
2955
|
-
var DropdownMenuItem = /* @__PURE__ */ (0,
|
|
3132
|
+
var DropdownMenuItem = /* @__PURE__ */ (0, import_react38.forwardRef)(
|
|
2956
3133
|
function DropdownMenuItem2({ icon: icon7, shortcut: shortcut2, color = "neutral", className, children, ...rest }, ref) {
|
|
2957
|
-
return /* @__PURE__ */ (0,
|
|
2958
|
-
icon7 && /* @__PURE__ */ (0,
|
|
3134
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(RadixMenu.Item, { ref, className: cx(item7, color === "danger" && danger, className), ...rest, children: [
|
|
3135
|
+
icon7 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: icon5, "aria-hidden": true, children: icon7 }),
|
|
2959
3136
|
children,
|
|
2960
|
-
shortcut2 && /* @__PURE__ */ (0,
|
|
3137
|
+
shortcut2 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: shortcut, "aria-hidden": true, children: shortcut2 })
|
|
2961
3138
|
] });
|
|
2962
3139
|
}
|
|
2963
3140
|
);
|
|
2964
|
-
var DropdownMenuLabel = /* @__PURE__ */ (0,
|
|
3141
|
+
var DropdownMenuLabel = /* @__PURE__ */ (0, import_react38.forwardRef)(
|
|
2965
3142
|
function DropdownMenuLabel2({ className, ...rest }, ref) {
|
|
2966
|
-
return /* @__PURE__ */ (0,
|
|
3143
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(RadixMenu.Label, { ref, className: cx(label3, className), ...rest });
|
|
2967
3144
|
}
|
|
2968
3145
|
);
|
|
2969
|
-
var DropdownMenuSeparator = /* @__PURE__ */ (0,
|
|
3146
|
+
var DropdownMenuSeparator = /* @__PURE__ */ (0, import_react38.forwardRef)(
|
|
2970
3147
|
function DropdownMenuSeparator2({ className, ...rest }, ref) {
|
|
2971
|
-
return /* @__PURE__ */ (0,
|
|
3148
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(RadixMenu.Separator, { ref, className: cx(separator3, className), ...rest });
|
|
2972
3149
|
}
|
|
2973
3150
|
);
|
|
2974
|
-
var DropdownMenuCheckboxItem = /* @__PURE__ */ (0,
|
|
3151
|
+
var DropdownMenuCheckboxItem = /* @__PURE__ */ (0, import_react38.forwardRef)(
|
|
2975
3152
|
function DropdownMenuCheckboxItem2({ className, children, ...rest }, ref) {
|
|
2976
|
-
return /* @__PURE__ */ (0,
|
|
2977
|
-
/* @__PURE__ */ (0,
|
|
3153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(RadixMenu.CheckboxItem, { ref, className: cx(item7, className), ...rest, children: [
|
|
3154
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: indicator2, "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(RadixMenu.ItemIndicator, { className: indicatorInner, children: rest.checked === "indeterminate" ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_icons15.MinusIcon, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_icons15.CheckIcon, { size: 16 }) }) }),
|
|
2978
3155
|
children
|
|
2979
3156
|
] });
|
|
2980
3157
|
}
|
|
2981
3158
|
);
|
|
2982
3159
|
var DropdownMenuRadioGroup = RadixMenu.RadioGroup;
|
|
2983
|
-
var DropdownMenuRadioItem = /* @__PURE__ */ (0,
|
|
3160
|
+
var DropdownMenuRadioItem = /* @__PURE__ */ (0, import_react38.forwardRef)(
|
|
2984
3161
|
function DropdownMenuRadioItem2({ className, children, ...rest }, ref) {
|
|
2985
|
-
return /* @__PURE__ */ (0,
|
|
2986
|
-
/* @__PURE__ */ (0,
|
|
3162
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(RadixMenu.RadioItem, { ref, className: cx(item7, className), ...rest, children: [
|
|
3163
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: indicator2, "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(RadixMenu.ItemIndicator, { className: indicatorInner, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: radioDot }) }) }),
|
|
2987
3164
|
children
|
|
2988
3165
|
] });
|
|
2989
3166
|
}
|
|
2990
3167
|
);
|
|
2991
3168
|
var DropdownMenuSub = RadixMenu.Sub;
|
|
2992
|
-
var DropdownMenuSubTrigger = /* @__PURE__ */ (0,
|
|
3169
|
+
var DropdownMenuSubTrigger = /* @__PURE__ */ (0, import_react38.forwardRef)(
|
|
2993
3170
|
function DropdownMenuSubTrigger2({ icon: icon7, className, children, ...rest }, ref) {
|
|
2994
|
-
return /* @__PURE__ */ (0,
|
|
2995
|
-
icon7 && /* @__PURE__ */ (0,
|
|
3171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(RadixMenu.SubTrigger, { ref, className: cx(item7, subTrigger, className), ...rest, children: [
|
|
3172
|
+
icon7 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: icon5, "aria-hidden": true, children: icon7 }),
|
|
2996
3173
|
children,
|
|
2997
|
-
/* @__PURE__ */ (0,
|
|
3174
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: subChevron, "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_icons15.ChevronRightIcon, { size: 16 }) })
|
|
2998
3175
|
] });
|
|
2999
3176
|
}
|
|
3000
3177
|
);
|
|
3001
|
-
var DropdownMenuSubContent = /* @__PURE__ */ (0,
|
|
3178
|
+
var DropdownMenuSubContent = /* @__PURE__ */ (0, import_react38.forwardRef)(
|
|
3002
3179
|
function DropdownMenuSubContent2({ className, style, sideOffset = 4, alignOffset = -5, collisionPadding = 8, ...rest }, ref) {
|
|
3003
3180
|
const portal2 = usePortalProps();
|
|
3004
|
-
return /* @__PURE__ */ (0,
|
|
3181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(RadixMenu.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3005
3182
|
RadixMenu.SubContent,
|
|
3006
3183
|
{
|
|
3007
3184
|
ref,
|
|
@@ -3017,7 +3194,7 @@ var DropdownMenuSubContent = /* @__PURE__ */ (0, import_react37.forwardRef)(
|
|
|
3017
3194
|
);
|
|
3018
3195
|
|
|
3019
3196
|
// src/components/NumberInput/NumberInput.tsx
|
|
3020
|
-
var
|
|
3197
|
+
var import_react39 = require("react");
|
|
3021
3198
|
var import_icons16 = require("@bestow-ui/icons");
|
|
3022
3199
|
|
|
3023
3200
|
// src/components/NumberInput/NumberInput.css.ts
|
|
@@ -3028,12 +3205,12 @@ var stepper = /* @__PURE__ */ (0, import_createRuntimeFn19.createRuntimeFn)({ de
|
|
|
3028
3205
|
var unit = "_1vq2qhv2";
|
|
3029
3206
|
|
|
3030
3207
|
// src/components/NumberInput/NumberInput.tsx
|
|
3031
|
-
var
|
|
3208
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3032
3209
|
var MAX_DIGITS2 = 15;
|
|
3033
3210
|
var isMeaningful = (char) => /[\d.-]/.test(char);
|
|
3034
3211
|
var decimalsOf = (n) => Number.isFinite(n) ? String(n).split(".")[1]?.length ?? 0 : 0;
|
|
3035
3212
|
var parse = (raw) => /\d/.test(raw) ? Number(raw) : null;
|
|
3036
|
-
var NumberInput = /* @__PURE__ */ (0,
|
|
3213
|
+
var NumberInput = /* @__PURE__ */ (0, import_react39.forwardRef)(
|
|
3037
3214
|
function NumberInput2(props, ref) {
|
|
3038
3215
|
const {
|
|
3039
3216
|
value: value4,
|
|
@@ -3059,8 +3236,8 @@ var NumberInput = /* @__PURE__ */ (0, import_react38.forwardRef)(
|
|
|
3059
3236
|
} = props;
|
|
3060
3237
|
const isControlled = "value" in props;
|
|
3061
3238
|
const m = useMessages();
|
|
3062
|
-
const inputRef = (0,
|
|
3063
|
-
const generatedId = (0,
|
|
3239
|
+
const inputRef = (0, import_react39.useRef)(null);
|
|
3240
|
+
const generatedId = (0, import_react39.useId)();
|
|
3064
3241
|
const inputId = id ?? generatedId;
|
|
3065
3242
|
const precision = Math.max(0, precisionProp ?? decimalsOf(step2));
|
|
3066
3243
|
const allowNegative = min === void 0 || min < 0;
|
|
@@ -3080,13 +3257,13 @@ var NumberInput = /* @__PURE__ */ (0, import_react38.forwardRef)(
|
|
|
3080
3257
|
const [, sign = "", int = "", rest2 = ""] = raw.match(/^(-?)(\d*)(.*)$/) ?? [];
|
|
3081
3258
|
return `${sign}${int ? Number(int).toLocaleString("ko-KR") : ""}${rest2}`;
|
|
3082
3259
|
};
|
|
3083
|
-
const lastEmitted = (0,
|
|
3260
|
+
const lastEmitted = (0, import_react39.useRef)(parse(toRaw(isControlled ? value4 : defaultValue)));
|
|
3084
3261
|
const emit = (next) => {
|
|
3085
3262
|
if (next === lastEmitted.current) return;
|
|
3086
3263
|
lastEmitted.current = next;
|
|
3087
3264
|
onValueChange?.(next);
|
|
3088
3265
|
};
|
|
3089
|
-
const
|
|
3266
|
+
const field4 = useFormattedInput({
|
|
3090
3267
|
isControlled: false,
|
|
3091
3268
|
value: void 0,
|
|
3092
3269
|
defaultValue: toRaw(isControlled ? value4 : defaultValue),
|
|
@@ -3096,17 +3273,20 @@ var NumberInput = /* @__PURE__ */ (0, import_react38.forwardRef)(
|
|
|
3096
3273
|
isMeaningful,
|
|
3097
3274
|
inputRef
|
|
3098
3275
|
});
|
|
3099
|
-
const { setRaw } =
|
|
3100
|
-
(0,
|
|
3276
|
+
const { setRaw } = field4;
|
|
3277
|
+
(0, import_react39.useEffect)(() => {
|
|
3101
3278
|
if (!isControlled) return;
|
|
3102
3279
|
const next = value4 ?? null;
|
|
3103
3280
|
lastEmitted.current = next;
|
|
3104
|
-
if (parse(
|
|
3281
|
+
if (parse(field4.raw) !== next) setRaw(toRaw(next));
|
|
3105
3282
|
}, [value4]);
|
|
3106
|
-
const current2 = parse(
|
|
3107
|
-
const
|
|
3283
|
+
const current2 = parse(field4.raw);
|
|
3284
|
+
const valueText = (n) => `${format2(toRaw(n))}${unit2 ?? ""}`;
|
|
3285
|
+
const [announcement, setAnnouncement] = (0, import_react39.useState)("");
|
|
3286
|
+
const setValue = (next, announce = true) => {
|
|
3108
3287
|
setRaw(toRaw(next));
|
|
3109
3288
|
emit(next);
|
|
3289
|
+
if (announce) setAnnouncement(valueText(next));
|
|
3110
3290
|
};
|
|
3111
3291
|
const stepBy = (delta) => {
|
|
3112
3292
|
if (disabled || readOnly) return;
|
|
@@ -3133,10 +3313,10 @@ var NumberInput = /* @__PURE__ */ (0, import_react38.forwardRef)(
|
|
|
3133
3313
|
event.preventDefault();
|
|
3134
3314
|
setValue(max);
|
|
3135
3315
|
} else {
|
|
3136
|
-
|
|
3316
|
+
field4.onKeyDown(event);
|
|
3137
3317
|
}
|
|
3138
3318
|
};
|
|
3139
|
-
const stepper2 = (direction) => /* @__PURE__ */ (0,
|
|
3319
|
+
const stepper2 = (direction) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3140
3320
|
IconButton,
|
|
3141
3321
|
{
|
|
3142
3322
|
size: "sm",
|
|
@@ -3147,11 +3327,11 @@ var NumberInput = /* @__PURE__ */ (0, import_react38.forwardRef)(
|
|
|
3147
3327
|
onMouseDown: (event) => event.preventDefault(),
|
|
3148
3328
|
onClick: () => stepBy(direction * step2),
|
|
3149
3329
|
className: stepper({ size }),
|
|
3150
|
-
children: direction < 0 ? /* @__PURE__ */ (0,
|
|
3330
|
+
children: direction < 0 ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_icons16.MinusIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_icons16.PlusIcon, {})
|
|
3151
3331
|
}
|
|
3152
3332
|
);
|
|
3153
|
-
return /* @__PURE__ */ (0,
|
|
3154
|
-
/* @__PURE__ */ (0,
|
|
3333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
3334
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3155
3335
|
TextField,
|
|
3156
3336
|
{
|
|
3157
3337
|
ref: mergeRefs(ref, inputRef),
|
|
@@ -3162,35 +3342,40 @@ var NumberInput = /* @__PURE__ */ (0, import_react38.forwardRef)(
|
|
|
3162
3342
|
"aria-valuenow": current2 ?? void 0,
|
|
3163
3343
|
"aria-valuemin": min,
|
|
3164
3344
|
"aria-valuemax": max,
|
|
3165
|
-
"aria-valuetext": current2 === null ? void 0 :
|
|
3166
|
-
value:
|
|
3167
|
-
onChange:
|
|
3345
|
+
"aria-valuetext": current2 === null ? void 0 : valueText(current2),
|
|
3346
|
+
value: field4.display,
|
|
3347
|
+
onChange: (event) => {
|
|
3348
|
+
setAnnouncement("");
|
|
3349
|
+
field4.onChange(event);
|
|
3350
|
+
},
|
|
3168
3351
|
onKeyDown: handleKeyDown,
|
|
3169
3352
|
onBlur: (event) => {
|
|
3170
|
-
if (current2 !== null && clamp(current2) !== current2) setValue(clamp(current2));
|
|
3171
|
-
else if (current2 === null &&
|
|
3353
|
+
if (current2 !== null && clamp(current2) !== current2) setValue(clamp(current2), false);
|
|
3354
|
+
else if (current2 === null && field4.raw !== "") setRaw("");
|
|
3355
|
+
setAnnouncement("");
|
|
3172
3356
|
onBlur?.(event);
|
|
3173
3357
|
},
|
|
3174
3358
|
size,
|
|
3175
3359
|
disabled,
|
|
3176
3360
|
readOnly,
|
|
3177
3361
|
startAdornment: hideStepper ? void 0 : stepper2(-1),
|
|
3178
|
-
endAdornment: unit2 || !hideStepper ? /* @__PURE__ */ (0,
|
|
3179
|
-
unit2 && /* @__PURE__ */ (0,
|
|
3362
|
+
endAdornment: unit2 || !hideStepper ? /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: end, children: [
|
|
3363
|
+
unit2 && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: unit, children: unit2 }),
|
|
3180
3364
|
!hideStepper && stepper2(1)
|
|
3181
3365
|
] }) : void 0,
|
|
3182
3366
|
className: cx(input4, className),
|
|
3183
3367
|
...rest
|
|
3184
3368
|
}
|
|
3185
3369
|
),
|
|
3186
|
-
name && /* @__PURE__ */ (0,
|
|
3370
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("input", { type: "hidden", name, value: current2 === null ? "" : String(current2) }),
|
|
3371
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { "aria-live": "assertive", "aria-atomic": "true", className: visuallyHidden, children: announcement })
|
|
3187
3372
|
] });
|
|
3188
3373
|
}
|
|
3189
3374
|
);
|
|
3190
3375
|
|
|
3191
3376
|
// src/components/Pagination/Pagination.tsx
|
|
3192
3377
|
var import_icons17 = require("@bestow-ui/icons");
|
|
3193
|
-
var
|
|
3378
|
+
var import_react40 = require("react");
|
|
3194
3379
|
|
|
3195
3380
|
// src/components/Pagination/getPaginationItems.ts
|
|
3196
3381
|
var range = (start, end2) => end2 < start ? [] : Array.from({ length: end2 - start + 1 }, (_, i) => start + i);
|
|
@@ -3223,8 +3408,8 @@ var item8 = /* @__PURE__ */ (0, import_createRuntimeFn20.createRuntimeFn)({ defa
|
|
|
3223
3408
|
var list5 = "_1iraoak0";
|
|
3224
3409
|
|
|
3225
3410
|
// src/components/Pagination/Pagination.tsx
|
|
3226
|
-
var
|
|
3227
|
-
var Pagination = /* @__PURE__ */ (0,
|
|
3411
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3412
|
+
var Pagination = /* @__PURE__ */ (0, import_react40.forwardRef)(function Pagination2({
|
|
3228
3413
|
totalPages,
|
|
3229
3414
|
page: pageProp,
|
|
3230
3415
|
defaultPage = 1,
|
|
@@ -3237,7 +3422,7 @@ var Pagination = /* @__PURE__ */ (0, import_react39.forwardRef)(function Paginat
|
|
|
3237
3422
|
"aria-label": ariaLabelProp,
|
|
3238
3423
|
...rest
|
|
3239
3424
|
}, ref) {
|
|
3240
|
-
const [uncontrolledPage, setUncontrolledPage] = (0,
|
|
3425
|
+
const [uncontrolledPage, setUncontrolledPage] = (0, import_react40.useState)(defaultPage);
|
|
3241
3426
|
const m = useMessages();
|
|
3242
3427
|
const ariaLabel = ariaLabelProp ?? m.pagination ?? "\uD398\uC774\uC9C0 \uD0D0\uC0C9";
|
|
3243
3428
|
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`);
|
|
@@ -3249,8 +3434,8 @@ var Pagination = /* @__PURE__ */ (0, import_react39.forwardRef)(function Paginat
|
|
|
3249
3434
|
onPageChange?.(next);
|
|
3250
3435
|
};
|
|
3251
3436
|
const itemClass = item8({ size });
|
|
3252
|
-
return /* @__PURE__ */ (0,
|
|
3253
|
-
/* @__PURE__ */ (0,
|
|
3437
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("nav", { ref, "aria-label": ariaLabel, className, ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("ul", { className: list5, children: [
|
|
3438
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3254
3439
|
"button",
|
|
3255
3440
|
{
|
|
3256
3441
|
type: "button",
|
|
@@ -3258,11 +3443,11 @@ var Pagination = /* @__PURE__ */ (0, import_react39.forwardRef)(function Paginat
|
|
|
3258
3443
|
"aria-label": getItemLabel("previous", page - 1),
|
|
3259
3444
|
disabled: page <= 1,
|
|
3260
3445
|
onClick: () => goTo(page - 1),
|
|
3261
|
-
children: /* @__PURE__ */ (0,
|
|
3446
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_icons17.ChevronLeftIcon, { size: 16 })
|
|
3262
3447
|
}
|
|
3263
3448
|
) }),
|
|
3264
3449
|
getPaginationItems(page, totalPages, siblingCount, boundaryCount).map(
|
|
3265
|
-
(item10) => typeof item10 === "number" ? /* @__PURE__ */ (0,
|
|
3450
|
+
(item10) => typeof item10 === "number" ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3266
3451
|
"button",
|
|
3267
3452
|
{
|
|
3268
3453
|
type: "button",
|
|
@@ -3272,9 +3457,9 @@ var Pagination = /* @__PURE__ */ (0, import_react39.forwardRef)(function Paginat
|
|
|
3272
3457
|
onClick: () => goTo(item10),
|
|
3273
3458
|
children: item10
|
|
3274
3459
|
}
|
|
3275
|
-
) }, item10) : /* @__PURE__ */ (0,
|
|
3460
|
+
) }, item10) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("li", { "aria-hidden": true, className: cx(itemClass, ellipsis), children: "\u2026" }, item10)
|
|
3276
3461
|
),
|
|
3277
|
-
/* @__PURE__ */ (0,
|
|
3462
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3278
3463
|
"button",
|
|
3279
3464
|
{
|
|
3280
3465
|
type: "button",
|
|
@@ -3282,21 +3467,21 @@ var Pagination = /* @__PURE__ */ (0, import_react39.forwardRef)(function Paginat
|
|
|
3282
3467
|
"aria-label": getItemLabel("next", page + 1),
|
|
3283
3468
|
disabled: page >= totalPages,
|
|
3284
3469
|
onClick: () => goTo(page + 1),
|
|
3285
|
-
children: /* @__PURE__ */ (0,
|
|
3470
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_icons17.ChevronRightIcon, { size: 16 })
|
|
3286
3471
|
}
|
|
3287
3472
|
) })
|
|
3288
3473
|
] }) });
|
|
3289
3474
|
});
|
|
3290
3475
|
|
|
3291
3476
|
// src/components/PhoneNumberInput/PhoneNumberInput.tsx
|
|
3292
|
-
var
|
|
3293
|
-
var
|
|
3477
|
+
var import_react41 = require("react");
|
|
3478
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3294
3479
|
var sanitize3 = (input6) => {
|
|
3295
3480
|
const digits = input6.replace(/\D/g, "");
|
|
3296
3481
|
return digits.slice(0, phoneNumberMaxDigits(digits));
|
|
3297
3482
|
};
|
|
3298
3483
|
var isDigit4 = (char) => /\d/.test(char);
|
|
3299
|
-
var PhoneNumberInput = /* @__PURE__ */ (0,
|
|
3484
|
+
var PhoneNumberInput = /* @__PURE__ */ (0, import_react41.forwardRef)(
|
|
3300
3485
|
function PhoneNumberInput2(props, ref) {
|
|
3301
3486
|
const {
|
|
3302
3487
|
value: value4,
|
|
@@ -3307,10 +3492,10 @@ var PhoneNumberInput = /* @__PURE__ */ (0, import_react40.forwardRef)(
|
|
|
3307
3492
|
onKeyDown,
|
|
3308
3493
|
...rest
|
|
3309
3494
|
} = props;
|
|
3310
|
-
const inputRef = (0,
|
|
3495
|
+
const inputRef = (0, import_react41.useRef)(null);
|
|
3311
3496
|
const m = useMessages();
|
|
3312
3497
|
const label7 = labelProp ?? m.phoneNumber ?? "\uD734\uB300\uD3F0 \uBC88\uD638";
|
|
3313
|
-
const
|
|
3498
|
+
const field4 = useFormattedInput({
|
|
3314
3499
|
isControlled: "value" in props,
|
|
3315
3500
|
value: value4,
|
|
3316
3501
|
defaultValue,
|
|
@@ -3320,7 +3505,7 @@ var PhoneNumberInput = /* @__PURE__ */ (0, import_react40.forwardRef)(
|
|
|
3320
3505
|
isMeaningful: isDigit4,
|
|
3321
3506
|
inputRef
|
|
3322
3507
|
});
|
|
3323
|
-
return /* @__PURE__ */ (0,
|
|
3508
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3324
3509
|
TextField,
|
|
3325
3510
|
{
|
|
3326
3511
|
ref: mergeRefs(ref, inputRef),
|
|
@@ -3329,10 +3514,10 @@ var PhoneNumberInput = /* @__PURE__ */ (0, import_react40.forwardRef)(
|
|
|
3329
3514
|
type: "tel",
|
|
3330
3515
|
inputMode: "tel",
|
|
3331
3516
|
autoComplete: "tel-national",
|
|
3332
|
-
value:
|
|
3333
|
-
onChange:
|
|
3517
|
+
value: field4.display,
|
|
3518
|
+
onChange: field4.onChange,
|
|
3334
3519
|
onKeyDown: (event) => {
|
|
3335
|
-
|
|
3520
|
+
field4.onKeyDown(event);
|
|
3336
3521
|
onKeyDown?.(event);
|
|
3337
3522
|
},
|
|
3338
3523
|
...rest
|
|
@@ -3342,7 +3527,7 @@ var PhoneNumberInput = /* @__PURE__ */ (0, import_react40.forwardRef)(
|
|
|
3342
3527
|
);
|
|
3343
3528
|
|
|
3344
3529
|
// src/components/RadioGroup/RadioGroup.tsx
|
|
3345
|
-
var
|
|
3530
|
+
var import_react42 = require("react");
|
|
3346
3531
|
|
|
3347
3532
|
// src/components/RadioGroup/RadioGroup.css.ts
|
|
3348
3533
|
var import_createRuntimeFn21 = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
@@ -3355,8 +3540,8 @@ var radio = /* @__PURE__ */ (0, import_createRuntimeFn21.createRuntimeFn)({ defa
|
|
|
3355
3540
|
var text = "_1w9iwjma";
|
|
3356
3541
|
|
|
3357
3542
|
// src/components/RadioGroup/RadioGroup.tsx
|
|
3358
|
-
var
|
|
3359
|
-
var RadioGroup2 = /* @__PURE__ */ (0,
|
|
3543
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3544
|
+
var RadioGroup2 = /* @__PURE__ */ (0, import_react42.forwardRef)(function RadioGroup3(props, ref) {
|
|
3360
3545
|
const {
|
|
3361
3546
|
options,
|
|
3362
3547
|
value: value4,
|
|
@@ -3375,9 +3560,9 @@ var RadioGroup2 = /* @__PURE__ */ (0, import_react41.forwardRef)(function RadioG
|
|
|
3375
3560
|
className
|
|
3376
3561
|
} = props;
|
|
3377
3562
|
const isControlled = "value" in props;
|
|
3378
|
-
const [innerValue, setInnerValue] = (0,
|
|
3563
|
+
const [innerValue, setInnerValue] = (0, import_react42.useState)(defaultValue ?? "");
|
|
3379
3564
|
const current2 = isControlled ? value4 ?? "" : innerValue;
|
|
3380
|
-
const generatedId = (0,
|
|
3565
|
+
const generatedId = (0, import_react42.useId)();
|
|
3381
3566
|
const baseId = id ?? generatedId;
|
|
3382
3567
|
const labelId = label7 ? `${baseId}-label` : void 0;
|
|
3383
3568
|
const helperId = helperText3 ? `${baseId}-helper` : void 0;
|
|
@@ -3388,12 +3573,12 @@ var RadioGroup2 = /* @__PURE__ */ (0, import_react41.forwardRef)(function RadioG
|
|
|
3388
3573
|
if (!isControlled) setInnerValue(next);
|
|
3389
3574
|
onValueChange?.(next);
|
|
3390
3575
|
};
|
|
3391
|
-
return /* @__PURE__ */ (0,
|
|
3392
|
-
label7 && /* @__PURE__ */ (0,
|
|
3576
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: cx(field, className), children: [
|
|
3577
|
+
label7 && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { id: labelId, className: cx(label2, groupLabel), children: [
|
|
3393
3578
|
label7,
|
|
3394
|
-
required && /* @__PURE__ */ (0,
|
|
3579
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
3395
3580
|
] }),
|
|
3396
|
-
/* @__PURE__ */ (0,
|
|
3581
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3397
3582
|
"div",
|
|
3398
3583
|
{
|
|
3399
3584
|
ref,
|
|
@@ -3411,8 +3596,8 @@ var RadioGroup2 = /* @__PURE__ */ (0, import_react41.forwardRef)(function RadioG
|
|
|
3411
3596
|
const descriptionId = option2.description ? `${itemId}-description` : void 0;
|
|
3412
3597
|
const itemDisabled = disabled || option2.disabled;
|
|
3413
3598
|
const checked = option2.value === current2;
|
|
3414
|
-
return /* @__PURE__ */ (0,
|
|
3415
|
-
/* @__PURE__ */ (0,
|
|
3599
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: option({ size }), "data-disabled": itemDisabled || void 0, children: [
|
|
3600
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3416
3601
|
"input",
|
|
3417
3602
|
{
|
|
3418
3603
|
type: "radio",
|
|
@@ -3429,20 +3614,20 @@ var RadioGroup2 = /* @__PURE__ */ (0, import_react41.forwardRef)(function RadioG
|
|
|
3429
3614
|
className: radio({ size })
|
|
3430
3615
|
}
|
|
3431
3616
|
),
|
|
3432
|
-
/* @__PURE__ */ (0,
|
|
3433
|
-
/* @__PURE__ */ (0,
|
|
3434
|
-
option2.description && /* @__PURE__ */ (0,
|
|
3617
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { className: text, children: [
|
|
3618
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("label", { htmlFor: itemId, className: labelText, children: option2.label }),
|
|
3619
|
+
option2.description && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { id: descriptionId, className: description5, children: option2.description })
|
|
3435
3620
|
] })
|
|
3436
3621
|
] }, option2.value);
|
|
3437
3622
|
})
|
|
3438
3623
|
}
|
|
3439
3624
|
),
|
|
3440
|
-
helperText3 && /* @__PURE__ */ (0,
|
|
3625
|
+
helperText3 && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { id: helperId, className: helperText({ error }), children: helperText3 })
|
|
3441
3626
|
] });
|
|
3442
3627
|
});
|
|
3443
3628
|
|
|
3444
3629
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
3445
|
-
var
|
|
3630
|
+
var import_react43 = require("react");
|
|
3446
3631
|
|
|
3447
3632
|
// src/components/SegmentedControl/SegmentedControl.css.ts
|
|
3448
3633
|
var import_createRuntimeFn22 = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
@@ -3451,9 +3636,9 @@ var item9 = /* @__PURE__ */ (0, import_createRuntimeFn22.createRuntimeFn)({ defa
|
|
|
3451
3636
|
var root11 = /* @__PURE__ */ (0, import_createRuntimeFn22.createRuntimeFn)({ defaultClassName: "_1h65mmo0", variantClassNames: { fullWidth: { true: "_1h65mmo1" } }, defaultVariants: {}, compoundVariants: [] });
|
|
3452
3637
|
|
|
3453
3638
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
3454
|
-
var
|
|
3639
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3455
3640
|
var NEXT_KEYS = { ArrowRight: 1, ArrowDown: 1, ArrowLeft: -1, ArrowUp: -1 };
|
|
3456
|
-
var SegmentedControl = /* @__PURE__ */ (0,
|
|
3641
|
+
var SegmentedControl = /* @__PURE__ */ (0, import_react43.forwardRef)(
|
|
3457
3642
|
function SegmentedControl2(props, ref) {
|
|
3458
3643
|
const {
|
|
3459
3644
|
options,
|
|
@@ -3470,11 +3655,11 @@ var SegmentedControl = /* @__PURE__ */ (0, import_react42.forwardRef)(
|
|
|
3470
3655
|
className
|
|
3471
3656
|
} = props;
|
|
3472
3657
|
const isControlled = "value" in props;
|
|
3473
|
-
const [innerValue, setInnerValue] = (0,
|
|
3658
|
+
const [innerValue, setInnerValue] = (0, import_react43.useState)(defaultValue ?? "");
|
|
3474
3659
|
const current2 = isControlled ? value4 ?? "" : innerValue;
|
|
3475
|
-
const generatedId = (0,
|
|
3660
|
+
const generatedId = (0, import_react43.useId)();
|
|
3476
3661
|
const labelId = label7 ? `${id ?? generatedId}-label` : void 0;
|
|
3477
|
-
const itemRefs = (0,
|
|
3662
|
+
const itemRefs = (0, import_react43.useRef)([]);
|
|
3478
3663
|
const isEnabled = (index) => !disabled && !options[index]?.disabled;
|
|
3479
3664
|
const select = (index) => {
|
|
3480
3665
|
const next = options[index].value;
|
|
@@ -3505,7 +3690,7 @@ var SegmentedControl = /* @__PURE__ */ (0, import_react42.forwardRef)(
|
|
|
3505
3690
|
itemRefs.current[target]?.focus();
|
|
3506
3691
|
select(target);
|
|
3507
3692
|
};
|
|
3508
|
-
const group = /* @__PURE__ */ (0,
|
|
3693
|
+
const group = /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
3509
3694
|
"div",
|
|
3510
3695
|
{
|
|
3511
3696
|
ref,
|
|
@@ -3518,7 +3703,7 @@ var SegmentedControl = /* @__PURE__ */ (0, import_react42.forwardRef)(
|
|
|
3518
3703
|
children: [
|
|
3519
3704
|
options.map((option2, index) => {
|
|
3520
3705
|
const checked = index === checkedIndex;
|
|
3521
|
-
return /* @__PURE__ */ (0,
|
|
3706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
3522
3707
|
"button",
|
|
3523
3708
|
{
|
|
3524
3709
|
ref: (node) => {
|
|
@@ -3535,20 +3720,20 @@ var SegmentedControl = /* @__PURE__ */ (0, import_react42.forwardRef)(
|
|
|
3535
3720
|
onClick: () => select(index),
|
|
3536
3721
|
onKeyDown: (event) => handleKeyDown(event, index),
|
|
3537
3722
|
children: [
|
|
3538
|
-
option2.icon && /* @__PURE__ */ (0,
|
|
3723
|
+
option2.icon && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { "aria-hidden": true, className: icon6, children: option2.icon }),
|
|
3539
3724
|
option2.label
|
|
3540
3725
|
]
|
|
3541
3726
|
},
|
|
3542
3727
|
option2.value
|
|
3543
3728
|
);
|
|
3544
3729
|
}),
|
|
3545
|
-
name && /* @__PURE__ */ (0,
|
|
3730
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("input", { type: "hidden", name, value: current2 })
|
|
3546
3731
|
]
|
|
3547
3732
|
}
|
|
3548
3733
|
);
|
|
3549
3734
|
if (!label7) return group;
|
|
3550
|
-
return /* @__PURE__ */ (0,
|
|
3551
|
-
/* @__PURE__ */ (0,
|
|
3735
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: cx(field, className), children: [
|
|
3736
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { id: labelId, className: label2, children: label7 }),
|
|
3552
3737
|
group
|
|
3553
3738
|
] });
|
|
3554
3739
|
}
|
|
@@ -3556,10 +3741,10 @@ var SegmentedControl = /* @__PURE__ */ (0, import_react42.forwardRef)(
|
|
|
3556
3741
|
|
|
3557
3742
|
// src/components/Select/Select.tsx
|
|
3558
3743
|
var RadixSelect = __toESM(require("@radix-ui/react-select"), 1);
|
|
3559
|
-
var
|
|
3744
|
+
var import_react44 = require("react");
|
|
3560
3745
|
var import_icons18 = require("@bestow-ui/icons");
|
|
3561
|
-
var
|
|
3562
|
-
var Select = /* @__PURE__ */ (0,
|
|
3746
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3747
|
+
var Select = /* @__PURE__ */ (0, import_react44.forwardRef)(function Select2(props, ref) {
|
|
3563
3748
|
const {
|
|
3564
3749
|
options,
|
|
3565
3750
|
value: value4,
|
|
@@ -3579,16 +3764,16 @@ var Select = /* @__PURE__ */ (0, import_react43.forwardRef)(function Select2(pro
|
|
|
3579
3764
|
className
|
|
3580
3765
|
} = props;
|
|
3581
3766
|
const isControlled = "value" in props;
|
|
3582
|
-
const generatedId = (0,
|
|
3767
|
+
const generatedId = (0, import_react44.useId)();
|
|
3583
3768
|
const triggerId = id ?? generatedId;
|
|
3584
3769
|
const helperId = helperText3 ? `${triggerId}-helper` : void 0;
|
|
3585
3770
|
const portal2 = usePortalProps();
|
|
3586
|
-
return /* @__PURE__ */ (0,
|
|
3587
|
-
label7 && /* @__PURE__ */ (0,
|
|
3771
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
|
|
3772
|
+
label7 && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("label", { htmlFor: triggerId, className: label2, children: [
|
|
3588
3773
|
label7,
|
|
3589
|
-
required && /* @__PURE__ */ (0,
|
|
3774
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
3590
3775
|
] }),
|
|
3591
|
-
/* @__PURE__ */ (0,
|
|
3776
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
3592
3777
|
RadixSelect.Root,
|
|
3593
3778
|
{
|
|
3594
3779
|
value: isControlled ? value4 ?? "" : void 0,
|
|
@@ -3598,7 +3783,7 @@ var Select = /* @__PURE__ */ (0, import_react43.forwardRef)(function Select2(pro
|
|
|
3598
3783
|
required,
|
|
3599
3784
|
name,
|
|
3600
3785
|
children: [
|
|
3601
|
-
/* @__PURE__ */ (0,
|
|
3786
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
3602
3787
|
RadixSelect.Trigger,
|
|
3603
3788
|
{
|
|
3604
3789
|
ref,
|
|
@@ -3609,12 +3794,12 @@ var Select = /* @__PURE__ */ (0, import_react43.forwardRef)(function Select2(pro
|
|
|
3609
3794
|
"data-invalid": error || void 0,
|
|
3610
3795
|
className: cx(root5({ size, fullWidth }), trigger2, className),
|
|
3611
3796
|
children: [
|
|
3612
|
-
/* @__PURE__ */ (0,
|
|
3613
|
-
/* @__PURE__ */ (0,
|
|
3797
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: value2, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(RadixSelect.Value, { placeholder }) }),
|
|
3798
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(RadixSelect.Icon, { className: icon4, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_icons18.ChevronDownIcon, { size: 16 }) })
|
|
3614
3799
|
]
|
|
3615
3800
|
}
|
|
3616
3801
|
),
|
|
3617
|
-
/* @__PURE__ */ (0,
|
|
3802
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(RadixSelect.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3618
3803
|
RadixSelect.Content,
|
|
3619
3804
|
{
|
|
3620
3805
|
position: "popper",
|
|
@@ -3622,15 +3807,15 @@ var Select = /* @__PURE__ */ (0, import_react43.forwardRef)(function Select2(pro
|
|
|
3622
3807
|
collisionPadding: 8,
|
|
3623
3808
|
className: cx(portal2.className, content5),
|
|
3624
3809
|
style: portal2.style,
|
|
3625
|
-
children: /* @__PURE__ */ (0,
|
|
3810
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(RadixSelect.Viewport, { className: viewport, children: options.map((option2) => /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
3626
3811
|
RadixSelect.Item,
|
|
3627
3812
|
{
|
|
3628
3813
|
value: option2.value,
|
|
3629
3814
|
disabled: option2.disabled,
|
|
3630
3815
|
className: item5,
|
|
3631
3816
|
children: [
|
|
3632
|
-
/* @__PURE__ */ (0,
|
|
3633
|
-
/* @__PURE__ */ (0,
|
|
3817
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(RadixSelect.ItemText, { children: option2.label }),
|
|
3818
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(RadixSelect.ItemIndicator, { className: itemIndicator, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_icons18.CheckIcon, { size: 16 }) })
|
|
3634
3819
|
]
|
|
3635
3820
|
},
|
|
3636
3821
|
option2.value
|
|
@@ -3640,19 +3825,19 @@ var Select = /* @__PURE__ */ (0, import_react43.forwardRef)(function Select2(pro
|
|
|
3640
3825
|
]
|
|
3641
3826
|
}
|
|
3642
3827
|
),
|
|
3643
|
-
helperText3 && /* @__PURE__ */ (0,
|
|
3828
|
+
helperText3 && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { id: helperId, className: helperText({ error }), children: helperText3 })
|
|
3644
3829
|
] });
|
|
3645
3830
|
});
|
|
3646
3831
|
|
|
3647
3832
|
// src/components/SkipLink/SkipLink.tsx
|
|
3648
|
-
var
|
|
3833
|
+
var import_react45 = require("react");
|
|
3649
3834
|
|
|
3650
3835
|
// src/components/SkipLink/SkipLink.css.ts
|
|
3651
3836
|
var skipLink = "_1t9jaar0";
|
|
3652
3837
|
|
|
3653
3838
|
// src/components/SkipLink/SkipLink.tsx
|
|
3654
|
-
var
|
|
3655
|
-
var SkipLink = /* @__PURE__ */ (0,
|
|
3839
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3840
|
+
var SkipLink = /* @__PURE__ */ (0, import_react45.forwardRef)(function SkipLink2({ href = "#main", className, children, onClick, ...rest }, ref) {
|
|
3656
3841
|
const m = useMessages();
|
|
3657
3842
|
const handleClick = (event) => {
|
|
3658
3843
|
onClick?.(event);
|
|
@@ -3664,16 +3849,16 @@ var SkipLink = /* @__PURE__ */ (0, import_react44.forwardRef)(function SkipLink2
|
|
|
3664
3849
|
target.focus();
|
|
3665
3850
|
target.scrollIntoView?.({ block: "start" });
|
|
3666
3851
|
};
|
|
3667
|
-
return /* @__PURE__ */ (0,
|
|
3852
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("a", { ref, href, className: cx(skipLink, className), onClick: handleClick, ...rest, children: children ?? m.skipToContent ?? "\uBCF8\uBB38 \uBC14\uB85C\uAC00\uAE30" });
|
|
3668
3853
|
});
|
|
3669
3854
|
|
|
3670
3855
|
// src/components/Slider/Slider.tsx
|
|
3671
3856
|
var RadixSlider = __toESM(require("@radix-ui/react-slider"), 1);
|
|
3672
|
-
var
|
|
3857
|
+
var import_react46 = require("react");
|
|
3673
3858
|
|
|
3674
3859
|
// src/components/Slider/Slider.css.ts
|
|
3675
3860
|
var import_createRuntimeFn23 = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
3676
|
-
var
|
|
3861
|
+
var field3 = "_126mzjm0";
|
|
3677
3862
|
var header8 = "_126mzjm1";
|
|
3678
3863
|
var helperText2 = "_126mzjm4";
|
|
3679
3864
|
var label4 = "_126mzjm2";
|
|
@@ -3684,8 +3869,8 @@ var track2 = /* @__PURE__ */ (0, import_createRuntimeFn23.createRuntimeFn)({ def
|
|
|
3684
3869
|
var value3 = "_126mzjm3";
|
|
3685
3870
|
|
|
3686
3871
|
// src/components/Slider/Slider.tsx
|
|
3687
|
-
var
|
|
3688
|
-
var Slider = /* @__PURE__ */ (0,
|
|
3872
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3873
|
+
var Slider = /* @__PURE__ */ (0, import_react46.forwardRef)(function Slider2(props, ref) {
|
|
3689
3874
|
const {
|
|
3690
3875
|
value: value4,
|
|
3691
3876
|
defaultValue,
|
|
@@ -3706,12 +3891,12 @@ var Slider = /* @__PURE__ */ (0, import_react45.forwardRef)(function Slider2(pro
|
|
|
3706
3891
|
} = props;
|
|
3707
3892
|
const m = useMessages();
|
|
3708
3893
|
const thumbLabels = thumbLabelsProp ?? [m.rangeStart ?? "\uCD5C\uC18C", m.rangeEnd ?? "\uCD5C\uB300"];
|
|
3709
|
-
const generatedId = (0,
|
|
3894
|
+
const generatedId = (0, import_react46.useId)();
|
|
3710
3895
|
const baseId = id ?? generatedId;
|
|
3711
3896
|
const labelId = `${baseId}-label`;
|
|
3712
3897
|
const helperId = `${baseId}-helper`;
|
|
3713
3898
|
const isControlled = "value" in props;
|
|
3714
|
-
const [innerValue, setInnerValue] = (0,
|
|
3899
|
+
const [innerValue, setInnerValue] = (0, import_react46.useState)(defaultValue ?? [min]);
|
|
3715
3900
|
const current2 = isControlled ? value4 ?? [min] : innerValue;
|
|
3716
3901
|
const isRange = current2.length > 1;
|
|
3717
3902
|
const handleChange = (next) => {
|
|
@@ -3719,12 +3904,12 @@ var Slider = /* @__PURE__ */ (0, import_react45.forwardRef)(function Slider2(pro
|
|
|
3719
3904
|
onValueChange?.(next);
|
|
3720
3905
|
};
|
|
3721
3906
|
const valueText = current2.map(formatValue).join(" \u2013 ");
|
|
3722
|
-
return /* @__PURE__ */ (0,
|
|
3723
|
-
(label7 || showValue) && /* @__PURE__ */ (0,
|
|
3724
|
-
label7 && /* @__PURE__ */ (0,
|
|
3725
|
-
showValue && /* @__PURE__ */ (0,
|
|
3907
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: cx(field3, className), children: [
|
|
3908
|
+
(label7 || showValue) && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: header8, children: [
|
|
3909
|
+
label7 && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { id: labelId, className: label4, children: label7 }),
|
|
3910
|
+
showValue && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: value3, "aria-hidden": true, children: valueText })
|
|
3726
3911
|
] }),
|
|
3727
|
-
/* @__PURE__ */ (0,
|
|
3912
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
3728
3913
|
RadixSlider.Root,
|
|
3729
3914
|
{
|
|
3730
3915
|
ref,
|
|
@@ -3737,10 +3922,10 @@ var Slider = /* @__PURE__ */ (0, import_react45.forwardRef)(function Slider2(pro
|
|
|
3737
3922
|
className: root12({ size }),
|
|
3738
3923
|
...rest,
|
|
3739
3924
|
children: [
|
|
3740
|
-
/* @__PURE__ */ (0,
|
|
3925
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(RadixSlider.Track, { className: track2({ size }), children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(RadixSlider.Range, { className: range2 }) }),
|
|
3741
3926
|
current2.map((thumbValue, index) => {
|
|
3742
3927
|
const thumbLabelId = `${baseId}-thumb-${index}`;
|
|
3743
|
-
return /* @__PURE__ */ (0,
|
|
3928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3744
3929
|
RadixSlider.Thumb,
|
|
3745
3930
|
{
|
|
3746
3931
|
className: thumb({ size }),
|
|
@@ -3755,16 +3940,16 @@ var Slider = /* @__PURE__ */ (0, import_react45.forwardRef)(function Slider2(pro
|
|
|
3755
3940
|
]
|
|
3756
3941
|
}
|
|
3757
3942
|
),
|
|
3758
|
-
isRange && current2.map((_, index) => /* @__PURE__ */ (0,
|
|
3943
|
+
isRange && current2.map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { id: `${baseId}-thumb-${index}`, hidden: true, children: [
|
|
3759
3944
|
label7 ? "" : ariaLabel ? `${ariaLabel} ` : "",
|
|
3760
3945
|
thumbLabels[index] ?? `${index + 1}`
|
|
3761
3946
|
] }, index)),
|
|
3762
|
-
helperText3 && /* @__PURE__ */ (0,
|
|
3947
|
+
helperText3 && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { id: helperId, className: helperText2, children: helperText3 })
|
|
3763
3948
|
] });
|
|
3764
3949
|
});
|
|
3765
3950
|
|
|
3766
3951
|
// src/components/Stepper/Stepper.tsx
|
|
3767
|
-
var
|
|
3952
|
+
var import_react47 = require("react");
|
|
3768
3953
|
var import_icons19 = require("@bestow-ui/icons");
|
|
3769
3954
|
|
|
3770
3955
|
// src/components/Stepper/Stepper.css.ts
|
|
@@ -3777,10 +3962,10 @@ var step = /* @__PURE__ */ (0, import_createRuntimeFn24.createRuntimeFn)({ defau
|
|
|
3777
3962
|
var text2 = /* @__PURE__ */ (0, import_createRuntimeFn24.createRuntimeFn)({ defaultClassName: "kervhma", variantClassNames: { orientation: { horizontal: "kervhmb", vertical: "kervhmc" } }, defaultVariants: {}, compoundVariants: [] });
|
|
3778
3963
|
|
|
3779
3964
|
// src/components/Stepper/Stepper.tsx
|
|
3780
|
-
var
|
|
3781
|
-
var Stepper = /* @__PURE__ */ (0,
|
|
3965
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3966
|
+
var Stepper = /* @__PURE__ */ (0, import_react47.forwardRef)(function Stepper2({ steps, current: current2, orientation = "horizontal", "aria-label": ariaLabel, className, ...rest }, ref) {
|
|
3782
3967
|
const m = useMessages();
|
|
3783
|
-
return /* @__PURE__ */ (0,
|
|
3968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3784
3969
|
"ol",
|
|
3785
3970
|
{
|
|
3786
3971
|
ref,
|
|
@@ -3789,24 +3974,24 @@ var Stepper = /* @__PURE__ */ (0, import_react46.forwardRef)(function Stepper2({
|
|
|
3789
3974
|
...rest,
|
|
3790
3975
|
children: steps.map((step2, index) => {
|
|
3791
3976
|
const status = index < current2 ? "complete" : index === current2 ? "current" : "upcoming";
|
|
3792
|
-
return /* @__PURE__ */ (0,
|
|
3977
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
3793
3978
|
"li",
|
|
3794
3979
|
{
|
|
3795
3980
|
className: step({ orientation }),
|
|
3796
3981
|
"data-status": status,
|
|
3797
3982
|
"aria-current": status === "current" ? "step" : void 0,
|
|
3798
3983
|
children: [
|
|
3799
|
-
/* @__PURE__ */ (0,
|
|
3800
|
-
/* @__PURE__ */ (0,
|
|
3801
|
-
/* @__PURE__ */ (0,
|
|
3984
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: indicator3({ status }), "aria-hidden": true, children: status === "complete" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_icons19.CheckIcon, { size: 16, strokeWidth: 2.5 }) : index + 1 }),
|
|
3985
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("span", { className: text2({ orientation }), children: [
|
|
3986
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("span", { className: label5({ status }), children: [
|
|
3802
3987
|
step2.label,
|
|
3803
|
-
status === "complete" && /* @__PURE__ */ (0,
|
|
3988
|
+
status === "complete" && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("span", { className: visuallyHidden, children: [
|
|
3804
3989
|
" (",
|
|
3805
3990
|
m.stepCompleted ?? "\uC644\uB8CC",
|
|
3806
3991
|
")"
|
|
3807
3992
|
] })
|
|
3808
3993
|
] }),
|
|
3809
|
-
step2.description && /* @__PURE__ */ (0,
|
|
3994
|
+
step2.description && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: description6, children: step2.description })
|
|
3810
3995
|
] })
|
|
3811
3996
|
]
|
|
3812
3997
|
},
|
|
@@ -3819,7 +4004,7 @@ var Stepper = /* @__PURE__ */ (0, import_react46.forwardRef)(function Stepper2({
|
|
|
3819
4004
|
|
|
3820
4005
|
// src/components/Switch/Switch.tsx
|
|
3821
4006
|
var RadixSwitch = __toESM(require("@radix-ui/react-switch"), 1);
|
|
3822
|
-
var
|
|
4007
|
+
var import_react48 = require("react");
|
|
3823
4008
|
|
|
3824
4009
|
// src/components/Switch/Switch.css.ts
|
|
3825
4010
|
var import_createRuntimeFn25 = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
@@ -3829,12 +4014,12 @@ var thumb2 = /* @__PURE__ */ (0, import_createRuntimeFn25.createRuntimeFn)({ def
|
|
|
3829
4014
|
var track3 = /* @__PURE__ */ (0, import_createRuntimeFn25.createRuntimeFn)({ defaultClassName: "o33ul23", variantClassNames: { size: { sm: "o33ul24", md: "o33ul25" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
3830
4015
|
|
|
3831
4016
|
// src/components/Switch/Switch.tsx
|
|
3832
|
-
var
|
|
3833
|
-
var Switch = /* @__PURE__ */ (0,
|
|
3834
|
-
const generatedId = (0,
|
|
4017
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
4018
|
+
var Switch = /* @__PURE__ */ (0, import_react48.forwardRef)(function Switch2({ label: label7, size, id, className, disabled, "aria-label": ariaLabel, ...rest }, ref) {
|
|
4019
|
+
const generatedId = (0, import_react48.useId)();
|
|
3835
4020
|
const switchId = id ?? generatedId;
|
|
3836
|
-
return /* @__PURE__ */ (0,
|
|
3837
|
-
/* @__PURE__ */ (0,
|
|
4021
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { className: cx(root14({ size }), className), "data-disabled": disabled || void 0, children: [
|
|
4022
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3838
4023
|
RadixSwitch.Root,
|
|
3839
4024
|
{
|
|
3840
4025
|
ref,
|
|
@@ -3843,15 +4028,15 @@ var Switch = /* @__PURE__ */ (0, import_react47.forwardRef)(function Switch2({ l
|
|
|
3843
4028
|
"aria-label": ariaLabel,
|
|
3844
4029
|
className: track3({ size }),
|
|
3845
4030
|
...rest,
|
|
3846
|
-
children: /* @__PURE__ */ (0,
|
|
4031
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(RadixSwitch.Thumb, { className: thumb2({ size }) })
|
|
3847
4032
|
}
|
|
3848
4033
|
),
|
|
3849
|
-
label7 && /* @__PURE__ */ (0,
|
|
4034
|
+
label7 && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("label", { htmlFor: switchId, className: label6, children: label7 })
|
|
3850
4035
|
] });
|
|
3851
4036
|
});
|
|
3852
4037
|
|
|
3853
4038
|
// src/components/Table/Table.tsx
|
|
3854
|
-
var
|
|
4039
|
+
var import_react49 = require("react");
|
|
3855
4040
|
var import_icons20 = require("@bestow-ui/icons");
|
|
3856
4041
|
|
|
3857
4042
|
// src/components/Table/Table.css.ts
|
|
@@ -3874,10 +4059,10 @@ var striped = "l3ploy6";
|
|
|
3874
4059
|
var table = "l3ploy1";
|
|
3875
4060
|
|
|
3876
4061
|
// src/components/Table/Table.tsx
|
|
3877
|
-
var
|
|
3878
|
-
var TableSizeContext = /* @__PURE__ */ (0,
|
|
3879
|
-
var TableSectionContext = /* @__PURE__ */ (0,
|
|
3880
|
-
var Table = /* @__PURE__ */ (0,
|
|
4062
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
4063
|
+
var TableSizeContext = /* @__PURE__ */ (0, import_react49.createContext)("md");
|
|
4064
|
+
var TableSectionContext = /* @__PURE__ */ (0, import_react49.createContext)("body");
|
|
4065
|
+
var Table = /* @__PURE__ */ (0, import_react49.forwardRef)(function Table2({
|
|
3881
4066
|
size = "md",
|
|
3882
4067
|
striped: striped2,
|
|
3883
4068
|
stickyHeader: stickyHeader2,
|
|
@@ -3889,8 +4074,8 @@ var Table = /* @__PURE__ */ (0, import_react48.forwardRef)(function Table2({
|
|
|
3889
4074
|
children,
|
|
3890
4075
|
...rest
|
|
3891
4076
|
}, ref) {
|
|
3892
|
-
const captionId = (0,
|
|
3893
|
-
return /* @__PURE__ */ (0,
|
|
4077
|
+
const captionId = (0, import_react49.useId)();
|
|
4078
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableSizeContext.Provider, { value: size, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3894
4079
|
"div",
|
|
3895
4080
|
{
|
|
3896
4081
|
className: cx(container, containerClassName),
|
|
@@ -3899,7 +4084,7 @@ var Table = /* @__PURE__ */ (0, import_react48.forwardRef)(function Table2({
|
|
|
3899
4084
|
role: "region",
|
|
3900
4085
|
"aria-labelledby": caption2 ? captionId : void 0,
|
|
3901
4086
|
"aria-label": caption2 ? void 0 : ariaLabel,
|
|
3902
|
-
children: /* @__PURE__ */ (0,
|
|
4087
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
3903
4088
|
"table",
|
|
3904
4089
|
{
|
|
3905
4090
|
ref,
|
|
@@ -3907,7 +4092,7 @@ var Table = /* @__PURE__ */ (0, import_react48.forwardRef)(function Table2({
|
|
|
3907
4092
|
"aria-label": caption2 ? void 0 : ariaLabel,
|
|
3908
4093
|
...rest,
|
|
3909
4094
|
children: [
|
|
3910
|
-
caption2 && /* @__PURE__ */ (0,
|
|
4095
|
+
caption2 && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("caption", { id: captionId, className: caption, children: caption2 }),
|
|
3911
4096
|
children
|
|
3912
4097
|
]
|
|
3913
4098
|
}
|
|
@@ -3915,31 +4100,31 @@ var Table = /* @__PURE__ */ (0, import_react48.forwardRef)(function Table2({
|
|
|
3915
4100
|
}
|
|
3916
4101
|
) });
|
|
3917
4102
|
});
|
|
3918
|
-
var TableHeader = /* @__PURE__ */ (0,
|
|
4103
|
+
var TableHeader = /* @__PURE__ */ (0, import_react49.forwardRef)(
|
|
3919
4104
|
function TableHeader2({ className, ...rest }, ref) {
|
|
3920
|
-
return /* @__PURE__ */ (0,
|
|
4105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableSectionContext.Provider, { value: "header", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("thead", { ref, className: cx(header9, className), ...rest }) });
|
|
3921
4106
|
}
|
|
3922
4107
|
);
|
|
3923
|
-
var TableBody = /* @__PURE__ */ (0,
|
|
4108
|
+
var TableBody = /* @__PURE__ */ (0, import_react49.forwardRef)(
|
|
3924
4109
|
function TableBody2({ className, ...rest }, ref) {
|
|
3925
|
-
return /* @__PURE__ */ (0,
|
|
4110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableSectionContext.Provider, { value: "body", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("tbody", { ref, className: cx(body4, className), ...rest }) });
|
|
3926
4111
|
}
|
|
3927
4112
|
);
|
|
3928
|
-
var TableFooter = /* @__PURE__ */ (0,
|
|
4113
|
+
var TableFooter = /* @__PURE__ */ (0, import_react49.forwardRef)(
|
|
3929
4114
|
function TableFooter2({ className, ...rest }, ref) {
|
|
3930
|
-
return /* @__PURE__ */ (0,
|
|
4115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableSectionContext.Provider, { value: "footer", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("tfoot", { ref, className: cx(footer4, className), ...rest }) });
|
|
3931
4116
|
}
|
|
3932
4117
|
);
|
|
3933
|
-
var TableRow = /* @__PURE__ */ (0,
|
|
3934
|
-
return /* @__PURE__ */ (0,
|
|
4118
|
+
var TableRow = /* @__PURE__ */ (0, import_react49.forwardRef)(function TableRow2({ selected, className, ...rest }, ref) {
|
|
4119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("tr", { ref, className: cx(row3, className), "data-state": selected ? "selected" : void 0, ...rest });
|
|
3935
4120
|
});
|
|
3936
|
-
var TableHead = /* @__PURE__ */ (0,
|
|
3937
|
-
const size = (0,
|
|
3938
|
-
const section = (0,
|
|
4121
|
+
var TableHead = /* @__PURE__ */ (0, import_react49.forwardRef)(function TableHead2({ align, sortDirection, onSort, scope, className, children, ...rest }, ref) {
|
|
4122
|
+
const size = (0, import_react49.useContext)(TableSizeContext);
|
|
4123
|
+
const section = (0, import_react49.useContext)(TableSectionContext);
|
|
3939
4124
|
const sortable = onSort !== void 0;
|
|
3940
4125
|
const direction = sortDirection ?? "none";
|
|
3941
4126
|
const SortIcon = direction === "descending" ? import_icons20.ArrowDownIcon : import_icons20.ArrowUpIcon;
|
|
3942
|
-
return /* @__PURE__ */ (0,
|
|
4127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3943
4128
|
"th",
|
|
3944
4129
|
{
|
|
3945
4130
|
ref,
|
|
@@ -3951,17 +4136,17 @@ var TableHead = /* @__PURE__ */ (0, import_react48.forwardRef)(function TableHea
|
|
|
3951
4136
|
className
|
|
3952
4137
|
),
|
|
3953
4138
|
...rest,
|
|
3954
|
-
children: sortable ? /* @__PURE__ */ (0,
|
|
4139
|
+
children: sortable ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("button", { type: "button", className: sortButton, onClick: onSort, children: [
|
|
3955
4140
|
children,
|
|
3956
|
-
/* @__PURE__ */ (0,
|
|
4141
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SortIcon, { size: 14, className: sortIcon, "data-active": direction !== "none", "aria-hidden": true })
|
|
3957
4142
|
] }) : children
|
|
3958
4143
|
}
|
|
3959
4144
|
);
|
|
3960
4145
|
});
|
|
3961
|
-
var TableCell = /* @__PURE__ */ (0,
|
|
3962
|
-
const size = (0,
|
|
3963
|
-
const section = (0,
|
|
3964
|
-
return /* @__PURE__ */ (0,
|
|
4146
|
+
var TableCell = /* @__PURE__ */ (0, import_react49.forwardRef)(function TableCell2({ align, className, ...rest }, ref) {
|
|
4147
|
+
const size = (0, import_react49.useContext)(TableSizeContext);
|
|
4148
|
+
const section = (0, import_react49.useContext)(TableSectionContext);
|
|
4149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3965
4150
|
"td",
|
|
3966
4151
|
{
|
|
3967
4152
|
ref,
|
|
@@ -3970,26 +4155,26 @@ var TableCell = /* @__PURE__ */ (0, import_react48.forwardRef)(function TableCel
|
|
|
3970
4155
|
}
|
|
3971
4156
|
);
|
|
3972
4157
|
});
|
|
3973
|
-
var TableEmpty = /* @__PURE__ */ (0,
|
|
3974
|
-
return /* @__PURE__ */ (0,
|
|
4158
|
+
var TableEmpty = /* @__PURE__ */ (0, import_react49.forwardRef)(function TableEmpty2({ colSpan, className, children, ...rest }, ref) {
|
|
4159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableCell, { ref, colSpan, className: cx(emptyCell, className), ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: emptyContent, children }) }) });
|
|
3975
4160
|
});
|
|
3976
4161
|
function TableSkeleton({ rows = 5, columns }) {
|
|
3977
|
-
return /* @__PURE__ */ (0,
|
|
4162
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_jsx_runtime47.Fragment, { children: Array.from({ length: rows }, (_, row5) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableRow, { "aria-hidden": true, children: Array.from({ length: columns }, (_2, column) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Skeleton, { width: column === 0 ? "60%" : "80%" }) }, column)) }, row5)) });
|
|
3978
4163
|
}
|
|
3979
4164
|
|
|
3980
4165
|
// src/components/Table/useTableSelection.ts
|
|
3981
|
-
var
|
|
4166
|
+
var import_react50 = require("react");
|
|
3982
4167
|
function useTableSelection(initial = []) {
|
|
3983
|
-
const [selected, setSelected] = (0,
|
|
3984
|
-
const isSelected = (0,
|
|
3985
|
-
const toggle3 = (0,
|
|
4168
|
+
const [selected, setSelected] = (0, import_react50.useState)(initial);
|
|
4169
|
+
const isSelected = (0, import_react50.useCallback)((id) => selected.includes(id), [selected]);
|
|
4170
|
+
const toggle3 = (0, import_react50.useCallback)((id, checked) => {
|
|
3986
4171
|
setSelected((prev) => {
|
|
3987
4172
|
const on = checked ?? !prev.includes(id);
|
|
3988
4173
|
if (on) return prev.includes(id) ? prev : [...prev, id];
|
|
3989
4174
|
return prev.filter((value4) => value4 !== id);
|
|
3990
4175
|
});
|
|
3991
4176
|
}, []);
|
|
3992
|
-
const clear2 = (0,
|
|
4177
|
+
const clear2 = (0, import_react50.useCallback)(() => setSelected([]), []);
|
|
3993
4178
|
const selectAllProps = (pageIds) => {
|
|
3994
4179
|
const all2 = pageIds.length > 0 && pageIds.every((id) => selected.includes(id));
|
|
3995
4180
|
const some = pageIds.some((id) => selected.includes(id));
|
|
@@ -4010,7 +4195,7 @@ function useTableSelection(initial = []) {
|
|
|
4010
4195
|
|
|
4011
4196
|
// src/components/Tabs/Tabs.tsx
|
|
4012
4197
|
var RadixTabs = __toESM(require("@radix-ui/react-tabs"), 1);
|
|
4013
|
-
var
|
|
4198
|
+
var import_react51 = require("react");
|
|
4014
4199
|
|
|
4015
4200
|
// src/components/Tabs/Tabs.css.ts
|
|
4016
4201
|
var import_createRuntimeFn27 = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
@@ -4020,26 +4205,26 @@ var root15 = "fvhbtd0";
|
|
|
4020
4205
|
var trigger3 = /* @__PURE__ */ (0, import_createRuntimeFn27.createRuntimeFn)({ defaultClassName: "fvhbtd4", variantClassNames: { variant: { line: "fvhbtd5", soft: "fvhbtd6" }, size: { sm: "fvhbtd7", md: "fvhbtd8" } }, defaultVariants: { variant: "line", size: "md" }, compoundVariants: [[{ variant: "soft", size: "sm" }, "fvhbtd9"], [{ variant: "soft", size: "md" }, "fvhbtda"]] });
|
|
4021
4206
|
|
|
4022
4207
|
// src/components/Tabs/Tabs.tsx
|
|
4023
|
-
var
|
|
4024
|
-
var TabsStyleContext = /* @__PURE__ */ (0,
|
|
4025
|
-
var Tabs = /* @__PURE__ */ (0,
|
|
4208
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
4209
|
+
var TabsStyleContext = /* @__PURE__ */ (0, import_react51.createContext)({ variant: "line", size: "md" });
|
|
4210
|
+
var Tabs = /* @__PURE__ */ (0, import_react51.forwardRef)(function Tabs2({ variant = "line", size = "md", className, ...props }, ref) {
|
|
4026
4211
|
const controlled = "value" in props ? { value: props.value ?? "" } : {};
|
|
4027
|
-
return /* @__PURE__ */ (0,
|
|
4212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TabsStyleContext.Provider, { value: { variant, size }, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(RadixTabs.Root, { ref, className: cx(root15, className), ...props, ...controlled }) });
|
|
4028
4213
|
});
|
|
4029
|
-
var TabsList = /* @__PURE__ */ (0,
|
|
4030
|
-
const { variant } = (0,
|
|
4031
|
-
return /* @__PURE__ */ (0,
|
|
4214
|
+
var TabsList = /* @__PURE__ */ (0, import_react51.forwardRef)(function TabsList2({ className, ...rest }, ref) {
|
|
4215
|
+
const { variant } = (0, import_react51.useContext)(TabsStyleContext);
|
|
4216
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(RadixTabs.List, { ref, className: cx(list6({ variant }), className), ...rest });
|
|
4032
4217
|
});
|
|
4033
|
-
var TabsTrigger = /* @__PURE__ */ (0,
|
|
4034
|
-
const { variant, size } = (0,
|
|
4035
|
-
return /* @__PURE__ */ (0,
|
|
4218
|
+
var TabsTrigger = /* @__PURE__ */ (0, import_react51.forwardRef)(function TabsTrigger2({ className, ...rest }, ref) {
|
|
4219
|
+
const { variant, size } = (0, import_react51.useContext)(TabsStyleContext);
|
|
4220
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(RadixTabs.Trigger, { ref, className: cx(trigger3({ variant, size }), className), ...rest });
|
|
4036
4221
|
});
|
|
4037
|
-
var TabsContent = /* @__PURE__ */ (0,
|
|
4038
|
-
return /* @__PURE__ */ (0,
|
|
4222
|
+
var TabsContent = /* @__PURE__ */ (0, import_react51.forwardRef)(function TabsContent2({ className, ...rest }, ref) {
|
|
4223
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(RadixTabs.Content, { ref, className: cx(content10, className), ...rest });
|
|
4039
4224
|
});
|
|
4040
4225
|
|
|
4041
4226
|
// src/components/Textarea/Textarea.tsx
|
|
4042
|
-
var
|
|
4227
|
+
var import_react52 = require("react");
|
|
4043
4228
|
|
|
4044
4229
|
// src/components/Textarea/Textarea.css.ts
|
|
4045
4230
|
var import_createRuntimeFn28 = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
@@ -4050,8 +4235,8 @@ var footer5 = "_1koawa8";
|
|
|
4050
4235
|
var textarea = /* @__PURE__ */ (0, import_createRuntimeFn28.createRuntimeFn)({ defaultClassName: "_1koawa0", variantClassNames: { size: { sm: "_1koawa1", md: "_1koawa2", lg: "_1koawa3" }, resize: { none: "_1koawa4", vertical: "_1koawa5", both: "_1koawa6" } }, defaultVariants: { size: "md", resize: "vertical" }, compoundVariants: [] });
|
|
4051
4236
|
|
|
4052
4237
|
// src/components/Textarea/Textarea.tsx
|
|
4053
|
-
var
|
|
4054
|
-
var Textarea = /* @__PURE__ */ (0,
|
|
4238
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
4239
|
+
var Textarea = /* @__PURE__ */ (0, import_react52.forwardRef)(function Textarea2({
|
|
4055
4240
|
label: label7,
|
|
4056
4241
|
helperText: helperText3,
|
|
4057
4242
|
error,
|
|
@@ -4072,13 +4257,13 @@ var Textarea = /* @__PURE__ */ (0, import_react51.forwardRef)(function Textarea2
|
|
|
4072
4257
|
"aria-describedby": ariaDescribedBy,
|
|
4073
4258
|
...rest
|
|
4074
4259
|
}, ref) {
|
|
4075
|
-
const generatedId = (0,
|
|
4260
|
+
const generatedId = (0, import_react52.useId)();
|
|
4076
4261
|
const textareaId = id ?? generatedId;
|
|
4077
4262
|
const helperId = helperText3 ? `${textareaId}-helper` : void 0;
|
|
4078
|
-
const innerRef = (0,
|
|
4079
|
-
const [uncontrolledLength, setUncontrolledLength] = (0,
|
|
4263
|
+
const innerRef = (0, import_react52.useRef)(null);
|
|
4264
|
+
const [uncontrolledLength, setUncontrolledLength] = (0, import_react52.useState)(() => String(defaultValue ?? "").length);
|
|
4080
4265
|
const length = value4 !== void 0 ? String(value4).length : uncontrolledLength;
|
|
4081
|
-
const fitHeight = (0,
|
|
4266
|
+
const fitHeight = (0, import_react52.useCallback)(() => {
|
|
4082
4267
|
const el = innerRef.current;
|
|
4083
4268
|
if (!autoResize || !el) return;
|
|
4084
4269
|
el.style.height = "auto";
|
|
@@ -4091,12 +4276,12 @@ var Textarea = /* @__PURE__ */ (0, import_react51.forwardRef)(function Textarea2
|
|
|
4091
4276
|
fitHeight();
|
|
4092
4277
|
onChange?.(event);
|
|
4093
4278
|
};
|
|
4094
|
-
return /* @__PURE__ */ (0,
|
|
4095
|
-
label7 && /* @__PURE__ */ (0,
|
|
4279
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
|
|
4280
|
+
label7 && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("label", { htmlFor: textareaId, className: label2, children: [
|
|
4096
4281
|
label7,
|
|
4097
|
-
required && /* @__PURE__ */ (0,
|
|
4282
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
4098
4283
|
] }),
|
|
4099
|
-
/* @__PURE__ */ (0,
|
|
4284
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4100
4285
|
"textarea",
|
|
4101
4286
|
{
|
|
4102
4287
|
ref: mergeRefs(innerRef, ref),
|
|
@@ -4118,16 +4303,16 @@ var Textarea = /* @__PURE__ */ (0, import_react51.forwardRef)(function Textarea2
|
|
|
4118
4303
|
...rest
|
|
4119
4304
|
}
|
|
4120
4305
|
),
|
|
4121
|
-
(helperText3 || showCount) && /* @__PURE__ */ (0,
|
|
4122
|
-
helperText3 && /* @__PURE__ */ (0,
|
|
4123
|
-
showCount && /* @__PURE__ */ (0,
|
|
4306
|
+
(helperText3 || showCount) && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: footer5, children: [
|
|
4307
|
+
helperText3 && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { id: helperId, className: helperText({ error }), children: helperText3 }),
|
|
4308
|
+
showCount && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: cx(count, maxLength !== void 0 && length >= maxLength && countOver), children: maxLength !== void 0 ? `${length}/${maxLength}` : length })
|
|
4124
4309
|
] })
|
|
4125
4310
|
] });
|
|
4126
4311
|
});
|
|
4127
4312
|
|
|
4128
4313
|
// src/components/Toast/Toast.tsx
|
|
4129
4314
|
var RadixToast = __toESM(require("@radix-ui/react-toast"), 1);
|
|
4130
|
-
var
|
|
4315
|
+
var import_react53 = require("react");
|
|
4131
4316
|
var import_icons21 = require("@bestow-ui/icons");
|
|
4132
4317
|
|
|
4133
4318
|
// src/components/Toast/Toast.css.ts
|
|
@@ -4140,29 +4325,29 @@ var toast = /* @__PURE__ */ (0, import_createRuntimeFn29.createRuntimeFn)({ defa
|
|
|
4140
4325
|
var viewport2 = "_1g11zvx0";
|
|
4141
4326
|
|
|
4142
4327
|
// src/components/Toast/Toast.tsx
|
|
4143
|
-
var
|
|
4328
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
4144
4329
|
var REMOVE_DELAY = 500;
|
|
4145
|
-
var ToastContext = /* @__PURE__ */ (0,
|
|
4330
|
+
var ToastContext = /* @__PURE__ */ (0, import_react53.createContext)(null);
|
|
4146
4331
|
function ToastProvider({ children, duration = 5e3, label: labelProp }) {
|
|
4147
4332
|
const m = useMessages();
|
|
4148
4333
|
const label7 = labelProp ?? m.notifications ?? "\uC54C\uB9BC";
|
|
4149
|
-
const [toasts, setToasts] = (0,
|
|
4150
|
-
const nextId = (0,
|
|
4334
|
+
const [toasts, setToasts] = (0, import_react53.useState)([]);
|
|
4335
|
+
const nextId = (0, import_react53.useRef)(0);
|
|
4151
4336
|
const portal2 = usePortalProps();
|
|
4152
|
-
const toast2 = (0,
|
|
4337
|
+
const toast2 = (0, import_react53.useCallback)((options) => {
|
|
4153
4338
|
const id = nextId.current++;
|
|
4154
4339
|
setToasts((prev) => [...prev, { ...options, id, open: true }]);
|
|
4155
4340
|
return id;
|
|
4156
4341
|
}, []);
|
|
4157
|
-
const dismiss = (0,
|
|
4342
|
+
const dismiss = (0, import_react53.useCallback)((id) => {
|
|
4158
4343
|
const isTarget = (t) => id === void 0 || t.id === id;
|
|
4159
4344
|
setToasts((prev) => prev.map((t) => isTarget(t) ? { ...t, open: false } : t));
|
|
4160
4345
|
setTimeout(() => setToasts((prev) => prev.filter((t) => t.open || !isTarget(t))), REMOVE_DELAY);
|
|
4161
4346
|
}, []);
|
|
4162
|
-
const value4 = (0,
|
|
4163
|
-
return /* @__PURE__ */ (0,
|
|
4347
|
+
const value4 = (0, import_react53.useMemo)(() => ({ toast: toast2, dismiss }), [toast2, dismiss]);
|
|
4348
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ToastContext.Provider, { value: value4, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(RadixToast.Provider, { duration, label: label7, swipeDirection: "right", children: [
|
|
4164
4349
|
children,
|
|
4165
|
-
toasts.map(({ id, open, title: title6, description: description8, color, duration: itemDuration, action: action3 }) => /* @__PURE__ */ (0,
|
|
4350
|
+
toasts.map(({ id, open, title: title6, description: description8, color, duration: itemDuration, action: action3 }) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
4166
4351
|
RadixToast.Root,
|
|
4167
4352
|
{
|
|
4168
4353
|
open,
|
|
@@ -4172,19 +4357,19 @@ function ToastProvider({ children, duration = 5e3, label: labelProp }) {
|
|
|
4172
4357
|
},
|
|
4173
4358
|
className: toast({ color }),
|
|
4174
4359
|
children: [
|
|
4175
|
-
/* @__PURE__ */ (0,
|
|
4176
|
-
description8 && /* @__PURE__ */ (0,
|
|
4177
|
-
action3 && /* @__PURE__ */ (0,
|
|
4178
|
-
/* @__PURE__ */ (0,
|
|
4360
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(RadixToast.Title, { className: title5, children: title6 }),
|
|
4361
|
+
description8 && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(RadixToast.Description, { className: description7, children: description8 }),
|
|
4362
|
+
action3 && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(RadixToast.Action, { asChild: true, altText: action3.altText ?? action3.label, className: action2, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Button, { size: "sm", variant: "soft", color: "neutral", onClick: action3.onClick, children: action3.label }) }),
|
|
4363
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(RadixToast.Close, { className: close, "aria-label": m.close ?? "\uB2EB\uAE30", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_icons21.XIcon, { size: 16 }) })
|
|
4179
4364
|
]
|
|
4180
4365
|
},
|
|
4181
4366
|
id
|
|
4182
4367
|
)),
|
|
4183
|
-
/* @__PURE__ */ (0,
|
|
4368
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(RadixToast.Viewport, { className: cx(portal2.className, viewport2), style: portal2.style })
|
|
4184
4369
|
] }) });
|
|
4185
4370
|
}
|
|
4186
4371
|
function useToast() {
|
|
4187
|
-
const context = (0,
|
|
4372
|
+
const context = (0, import_react53.useContext)(ToastContext);
|
|
4188
4373
|
if (!context) throw new Error("useToast \uB294 ToastProvider \uC548\uC5D0\uC11C \uC0AC\uC6A9\uD574\uC57C \uD569\uB2C8\uB2E4.");
|
|
4189
4374
|
return context;
|
|
4190
4375
|
}
|
|
@@ -4197,7 +4382,7 @@ var arrow2 = "z7rufs1";
|
|
|
4197
4382
|
var content11 = "z7rufs0";
|
|
4198
4383
|
|
|
4199
4384
|
// src/components/Tooltip/Tooltip.tsx
|
|
4200
|
-
var
|
|
4385
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
4201
4386
|
function Tooltip({
|
|
4202
4387
|
content: content12,
|
|
4203
4388
|
children,
|
|
@@ -4212,9 +4397,9 @@ function Tooltip({
|
|
|
4212
4397
|
}) {
|
|
4213
4398
|
const portal2 = usePortalProps();
|
|
4214
4399
|
if (disabled || content12 == null || content12 === "") return children;
|
|
4215
|
-
return /* @__PURE__ */ (0,
|
|
4216
|
-
/* @__PURE__ */ (0,
|
|
4217
|
-
/* @__PURE__ */ (0,
|
|
4400
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(RadixTooltip.Provider, { delayDuration: delay, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(RadixTooltip.Root, { open, defaultOpen, onOpenChange, children: [
|
|
4401
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(RadixTooltip.Trigger, { asChild: true, children }),
|
|
4402
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(RadixTooltip.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
4218
4403
|
RadixTooltip.Content,
|
|
4219
4404
|
{
|
|
4220
4405
|
side,
|
|
@@ -4225,7 +4410,7 @@ function Tooltip({
|
|
|
4225
4410
|
style: portal2.style,
|
|
4226
4411
|
children: [
|
|
4227
4412
|
content12,
|
|
4228
|
-
/* @__PURE__ */ (0,
|
|
4413
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(RadixTooltip.Arrow, { className: arrow2, width: 10, height: 5 })
|
|
4229
4414
|
]
|
|
4230
4415
|
}
|
|
4231
4416
|
) })
|
|
@@ -4233,7 +4418,7 @@ function Tooltip({
|
|
|
4233
4418
|
}
|
|
4234
4419
|
|
|
4235
4420
|
// src/components/VerificationCodeInput/VerificationCodeInput.tsx
|
|
4236
|
-
var
|
|
4421
|
+
var import_react54 = require("react");
|
|
4237
4422
|
|
|
4238
4423
|
// src/components/VerificationCodeInput/VerificationCodeInput.css.ts
|
|
4239
4424
|
var input5 = "ea01812";
|
|
@@ -4243,9 +4428,9 @@ var slots = "ea01811";
|
|
|
4243
4428
|
var timer = "ea01814";
|
|
4244
4429
|
|
|
4245
4430
|
// src/components/VerificationCodeInput/VerificationCodeInput.tsx
|
|
4246
|
-
var
|
|
4431
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4247
4432
|
var formatTime = (seconds) => `${String(Math.floor(seconds / 60)).padStart(2, "0")}:${String(seconds % 60).padStart(2, "0")}`;
|
|
4248
|
-
var VerificationCodeInput = /* @__PURE__ */ (0,
|
|
4433
|
+
var VerificationCodeInput = /* @__PURE__ */ (0, import_react54.forwardRef)(
|
|
4249
4434
|
function VerificationCodeInput2(props, ref) {
|
|
4250
4435
|
const {
|
|
4251
4436
|
length = 6,
|
|
@@ -4272,23 +4457,23 @@ var VerificationCodeInput = /* @__PURE__ */ (0, import_react53.forwardRef)(
|
|
|
4272
4457
|
const label7 = labelProp ?? m.verificationCode ?? "\uC778\uC99D\uBC88\uD638";
|
|
4273
4458
|
const resendText = resendTextProp ?? m.resend ?? "\uC7AC\uC804\uC1A1";
|
|
4274
4459
|
const expiredText = expiredTextProp ?? m.verificationExpired ?? "\uC778\uC99D \uC2DC\uAC04\uC774 \uC9C0\uB0AC\uC5B4\uC694. \uC7AC\uC804\uC1A1\uD574 \uC8FC\uC138\uC694.";
|
|
4275
|
-
const generatedId = (0,
|
|
4460
|
+
const generatedId = (0, import_react54.useId)();
|
|
4276
4461
|
const inputId = id ?? generatedId;
|
|
4277
4462
|
const helperId = `${inputId}-helper`;
|
|
4278
4463
|
const statusId = `${inputId}-status`;
|
|
4279
|
-
const inputRef = (0,
|
|
4464
|
+
const inputRef = (0, import_react54.useRef)(null);
|
|
4280
4465
|
const isControlled = "value" in props;
|
|
4281
|
-
const [innerValue, setInnerValue] = (0,
|
|
4466
|
+
const [innerValue, setInnerValue] = (0, import_react54.useState)(defaultValue ?? "");
|
|
4282
4467
|
const code = (isControlled ? value4 ?? "" : innerValue).slice(0, length);
|
|
4283
|
-
const [focused, setFocused] = (0,
|
|
4284
|
-
const [endAt, setEndAt] = (0,
|
|
4285
|
-
const [remaining, setRemaining] = (0,
|
|
4468
|
+
const [focused, setFocused] = (0, import_react54.useState)(false);
|
|
4469
|
+
const [endAt, setEndAt] = (0, import_react54.useState)(() => expiresIn ? Date.now() + expiresIn * 1e3 : null);
|
|
4470
|
+
const [remaining, setRemaining] = (0, import_react54.useState)(expiresIn ?? 0);
|
|
4286
4471
|
const expired = expiresIn !== void 0 && remaining <= 0;
|
|
4287
|
-
const onExpireRef = (0,
|
|
4288
|
-
(0,
|
|
4472
|
+
const onExpireRef = (0, import_react54.useRef)(onExpire);
|
|
4473
|
+
(0, import_react54.useEffect)(() => {
|
|
4289
4474
|
onExpireRef.current = onExpire;
|
|
4290
4475
|
});
|
|
4291
|
-
(0,
|
|
4476
|
+
(0, import_react54.useEffect)(() => {
|
|
4292
4477
|
if (endAt === null) return;
|
|
4293
4478
|
const tick = () => {
|
|
4294
4479
|
const left = Math.max(0, Math.ceil((endAt - Date.now()) / 1e3));
|
|
@@ -4323,17 +4508,17 @@ var VerificationCodeInput = /* @__PURE__ */ (0, import_react53.forwardRef)(
|
|
|
4323
4508
|
};
|
|
4324
4509
|
const description8 = helperText3 ?? m.verificationCodeHint?.(length, type) ?? `${length}\uC790\uB9AC ${type === "numeric" ? "\uC22B\uC790" : "\uBB38\uC790"}\uB97C \uC785\uB825\uD558\uC138\uC694.`;
|
|
4325
4510
|
const activeIndex = Math.min(code.length, length - 1);
|
|
4326
|
-
return /* @__PURE__ */ (0,
|
|
4511
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
4327
4512
|
"div",
|
|
4328
4513
|
{
|
|
4329
4514
|
className: cx(field, className),
|
|
4330
4515
|
"data-invalid": error || void 0,
|
|
4331
4516
|
"data-disabled": disabled || void 0,
|
|
4332
4517
|
children: [
|
|
4333
|
-
/* @__PURE__ */ (0,
|
|
4334
|
-
/* @__PURE__ */ (0,
|
|
4335
|
-
/* @__PURE__ */ (0,
|
|
4336
|
-
/* @__PURE__ */ (0,
|
|
4518
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("label", { htmlFor: inputId, className: label2, children: label7 }),
|
|
4519
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: row4, children: [
|
|
4520
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: slots, children: [
|
|
4521
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4337
4522
|
"input",
|
|
4338
4523
|
{
|
|
4339
4524
|
ref: mergeRefs(ref, inputRef),
|
|
@@ -4353,7 +4538,7 @@ var VerificationCodeInput = /* @__PURE__ */ (0, import_react53.forwardRef)(
|
|
|
4353
4538
|
className: input5
|
|
4354
4539
|
}
|
|
4355
4540
|
),
|
|
4356
|
-
Array.from({ length }, (_, index) => /* @__PURE__ */ (0,
|
|
4541
|
+
Array.from({ length }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4357
4542
|
"div",
|
|
4358
4543
|
{
|
|
4359
4544
|
className: slot,
|
|
@@ -4364,12 +4549,12 @@ var VerificationCodeInput = /* @__PURE__ */ (0, import_react53.forwardRef)(
|
|
|
4364
4549
|
index
|
|
4365
4550
|
))
|
|
4366
4551
|
] }),
|
|
4367
|
-
expiresIn !== void 0 && /* @__PURE__ */ (0,
|
|
4368
|
-
onResend && /* @__PURE__ */ (0,
|
|
4552
|
+
expiresIn !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { role: "timer", className: timer, children: formatTime(remaining) }),
|
|
4553
|
+
onResend && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Button, { size: "sm", variant: "outline", color: "neutral", onClick: resend, disabled, children: resendText })
|
|
4369
4554
|
] }),
|
|
4370
|
-
/* @__PURE__ */ (0,
|
|
4371
|
-
/* @__PURE__ */ (0,
|
|
4372
|
-
name && /* @__PURE__ */ (0,
|
|
4555
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { id: helperId, className: helperText({ error }), children: description8 }),
|
|
4556
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { id: statusId, role: "status", className: helperText({ error: true }), children: expired ? expiredText : "" }),
|
|
4557
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("input", { type: "hidden", name, value: code })
|
|
4373
4558
|
]
|
|
4374
4559
|
}
|
|
4375
4560
|
);
|
|
@@ -4396,6 +4581,7 @@ var VerificationCodeInput = /* @__PURE__ */ (0, import_react53.forwardRef)(
|
|
|
4396
4581
|
Checkbox,
|
|
4397
4582
|
Combobox,
|
|
4398
4583
|
DatePicker,
|
|
4584
|
+
DateRangePicker,
|
|
4399
4585
|
DescriptionList,
|
|
4400
4586
|
Divider,
|
|
4401
4587
|
Drawer,
|
|
@@ -4462,6 +4648,7 @@ var VerificationCodeInput = /* @__PURE__ */ (0, import_react53.forwardRef)(
|
|
|
4462
4648
|
contrastRatio,
|
|
4463
4649
|
createIntentColors,
|
|
4464
4650
|
createTheme,
|
|
4651
|
+
dateRangePresets,
|
|
4465
4652
|
en,
|
|
4466
4653
|
focusField,
|
|
4467
4654
|
formatBusinessNumber,
|
|
@@ -4472,6 +4659,8 @@ var VerificationCodeInput = /* @__PURE__ */ (0, import_react53.forwardRef)(
|
|
|
4472
4659
|
isValidBusinessNumber,
|
|
4473
4660
|
kakaoPostcodeProvider,
|
|
4474
4661
|
parseISODate,
|
|
4662
|
+
presetRange,
|
|
4663
|
+
strongInputBorders,
|
|
4475
4664
|
themeClass,
|
|
4476
4665
|
toISODate,
|
|
4477
4666
|
useMessages,
|