@bestow-ui/react 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -5
- package/dist/{chunk-NKLDAXUR.js → chunk-YYLDXZWR.js} +26 -5
- package/dist/chunk-YYLDXZWR.js.map +1 -0
- package/dist/client.js +885 -578
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +1333 -863
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +600 -116
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +237 -22
- package/dist/index.d.ts +237 -22
- package/dist/shared.js +210 -52
- package/dist/shared.js.map +1 -1
- package/package.json +3 -3
- package/dist/chunk-NKLDAXUR.js.map +0 -1
package/dist/client.js
CHANGED
|
@@ -3,49 +3,103 @@ import {
|
|
|
3
3
|
Skeleton,
|
|
4
4
|
addDays,
|
|
5
5
|
addMonths,
|
|
6
|
+
adornment,
|
|
6
7
|
compareDays,
|
|
7
8
|
cx,
|
|
9
|
+
field,
|
|
10
|
+
fieldFullWidth,
|
|
8
11
|
focusField,
|
|
9
12
|
getCalendarWeeks,
|
|
13
|
+
helperText,
|
|
14
|
+
input,
|
|
10
15
|
isSameDay,
|
|
11
16
|
isSameMonth,
|
|
12
17
|
kakaoPostcodeProvider,
|
|
18
|
+
label,
|
|
13
19
|
mergeThemes,
|
|
14
20
|
parseISODate,
|
|
15
21
|
presetRange,
|
|
22
|
+
requiredMark,
|
|
23
|
+
root,
|
|
24
|
+
systemThemeClass,
|
|
16
25
|
themeClass,
|
|
17
26
|
themeToStyle,
|
|
18
27
|
toISODate,
|
|
19
28
|
visuallyHidden
|
|
20
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-YYLDXZWR.js";
|
|
21
30
|
|
|
22
31
|
// src/theme/ThemeProvider.tsx
|
|
23
|
-
import { createContext, forwardRef, useContext, useMemo } from "react";
|
|
32
|
+
import { createContext, forwardRef, useContext, useId, useMemo } from "react";
|
|
24
33
|
|
|
25
34
|
// src/theme/ThemeProvider.css.ts
|
|
26
35
|
var portal = "sfyhlv0";
|
|
27
|
-
var
|
|
36
|
+
var root2 = "sfyhlv1 sfyhlv0";
|
|
37
|
+
|
|
38
|
+
// src/theme/useSystemTheme.ts
|
|
39
|
+
import { useSyncExternalStore } from "react";
|
|
40
|
+
var query = "(prefers-color-scheme: dark)";
|
|
41
|
+
var getMediaQuery = () => typeof window !== "undefined" && window.matchMedia ? window.matchMedia(query) : void 0;
|
|
42
|
+
function subscribe(onChange) {
|
|
43
|
+
const mql = getMediaQuery();
|
|
44
|
+
mql?.addEventListener("change", onChange);
|
|
45
|
+
return () => mql?.removeEventListener("change", onChange);
|
|
46
|
+
}
|
|
47
|
+
var noopSubscribe = () => () => {
|
|
48
|
+
};
|
|
49
|
+
var getSnapshot = () => getMediaQuery()?.matches ? "dark" : "light";
|
|
50
|
+
var getLight = () => "light";
|
|
51
|
+
var getServerSnapshot = () => null;
|
|
52
|
+
function useSystemTheme(enabled) {
|
|
53
|
+
return useSyncExternalStore(
|
|
54
|
+
enabled ? subscribe : noopSubscribe,
|
|
55
|
+
enabled ? getSnapshot : getLight,
|
|
56
|
+
enabled ? getServerSnapshot : getLight
|
|
57
|
+
);
|
|
58
|
+
}
|
|
28
59
|
|
|
29
60
|
// src/theme/ThemeProvider.tsx
|
|
30
|
-
import { jsx } from "react/jsx-runtime";
|
|
31
|
-
var ThemeContext = /* @__PURE__ */ createContext({
|
|
61
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
62
|
+
var ThemeContext = /* @__PURE__ */ createContext({
|
|
63
|
+
mode: "light",
|
|
64
|
+
theme: "light",
|
|
65
|
+
pending: false
|
|
66
|
+
});
|
|
67
|
+
var declarations = (style) => (
|
|
68
|
+
// 값은 개발자가 준 테마지만 </style> 로 태그가 끝나지 않게 < 를 CSS 이스케이프로 바꾼다
|
|
69
|
+
Object.entries(style ?? {}).map(([name, value3]) => `${name}:${value3.replace(/</g, "\\3c ")}`).join(";")
|
|
70
|
+
);
|
|
71
|
+
function pendingOverridesCss(selector, theme) {
|
|
72
|
+
const light = declarations(themeToStyle(theme, "light"));
|
|
73
|
+
const dark = declarations(themeToStyle(theme, "dark"));
|
|
74
|
+
if (!light && !dark) return void 0;
|
|
75
|
+
return `${selector}{${light}}@media (prefers-color-scheme: dark){${selector}{${dark}}}`;
|
|
76
|
+
}
|
|
32
77
|
var ThemeProvider = /* @__PURE__ */ forwardRef(function ThemeProvider2({ theme: themeProp, overrides, className, style, children, ...rest }, ref) {
|
|
33
78
|
const parent = useContext(ThemeContext);
|
|
34
|
-
const
|
|
79
|
+
const mode = themeProp ?? parent.mode;
|
|
80
|
+
const system = useSystemTheme(mode === "system");
|
|
81
|
+
const pending = mode === "system" && system === null;
|
|
82
|
+
const theme = mode === "system" ? system ?? "light" : mode;
|
|
35
83
|
const merged = useMemo(() => mergeThemes(parent.overrides, overrides), [parent.overrides, overrides]);
|
|
36
84
|
const value3 = useMemo(
|
|
37
|
-
() => ({ theme, overrides: merged, style: themeToStyle(merged, theme) }),
|
|
38
|
-
[theme, merged]
|
|
85
|
+
() => ({ mode, theme, pending, overrides: merged, style: pending ? void 0 : themeToStyle(merged, theme) }),
|
|
86
|
+
[mode, theme, pending, merged]
|
|
39
87
|
);
|
|
40
|
-
|
|
88
|
+
const id = useId();
|
|
89
|
+
const pendingCss = pending && pendingOverridesCss(`.${systemThemeClass}[data-bestow-theme-id="${id}"]`, merged);
|
|
90
|
+
return /* @__PURE__ */ jsx(ThemeContext.Provider, { value: value3, children: /* @__PURE__ */ jsxs(
|
|
41
91
|
"div",
|
|
42
92
|
{
|
|
43
93
|
ref,
|
|
44
|
-
"data-theme": theme,
|
|
45
|
-
|
|
94
|
+
"data-theme": pending ? "system" : theme,
|
|
95
|
+
"data-bestow-theme-id": pendingCss ? id : void 0,
|
|
96
|
+
className: cx(pending ? systemThemeClass : themeClass[theme], root2, className),
|
|
46
97
|
style: value3.style ? { ...value3.style, ...style } : style,
|
|
47
98
|
...rest,
|
|
48
|
-
children
|
|
99
|
+
children: [
|
|
100
|
+
pendingCss && /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: pendingCss } }),
|
|
101
|
+
children
|
|
102
|
+
]
|
|
49
103
|
}
|
|
50
104
|
) });
|
|
51
105
|
});
|
|
@@ -53,8 +107,8 @@ function useTheme() {
|
|
|
53
107
|
return useContext(ThemeContext).theme;
|
|
54
108
|
}
|
|
55
109
|
function usePortalProps() {
|
|
56
|
-
const { theme, style } = useContext(ThemeContext);
|
|
57
|
-
return { className: cx(themeClass[theme], portal), style };
|
|
110
|
+
const { theme, pending, style } = useContext(ThemeContext);
|
|
111
|
+
return { className: cx(pending ? systemThemeClass : themeClass[theme], portal), style };
|
|
58
112
|
}
|
|
59
113
|
|
|
60
114
|
// src/i18n/LocaleProvider.tsx
|
|
@@ -81,21 +135,21 @@ var content = "v58j0l5";
|
|
|
81
135
|
var contentInner = "v58j0l6";
|
|
82
136
|
var header = "v58j0l2";
|
|
83
137
|
var item = "v58j0l1";
|
|
84
|
-
var
|
|
138
|
+
var root3 = "v58j0l0";
|
|
85
139
|
var trigger = "v58j0l3";
|
|
86
140
|
|
|
87
141
|
// src/components/Accordion/Accordion.tsx
|
|
88
|
-
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
142
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
89
143
|
var Accordion = /* @__PURE__ */ forwardRef2(function Accordion2({ className, ...props }, ref) {
|
|
90
144
|
const { collapsible, ...multipleProps } = props;
|
|
91
145
|
const typedProps = props.type === "multiple" ? multipleProps : { ...multipleProps, collapsible };
|
|
92
146
|
const rootProps = "value" in props ? { ...typedProps, value: props.value ?? (props.type === "multiple" ? [] : "") } : typedProps;
|
|
93
|
-
return /* @__PURE__ */ jsx3(RadixAccordion.Root, { ref, className: cx(
|
|
147
|
+
return /* @__PURE__ */ jsx3(RadixAccordion.Root, { ref, className: cx(root3, className), ...rootProps });
|
|
94
148
|
});
|
|
95
149
|
var AccordionItem = /* @__PURE__ */ forwardRef2(function AccordionItem2({ title: title6, headingLevel = 3, className, children, ...rest }, ref) {
|
|
96
150
|
const Heading = `h${headingLevel}`;
|
|
97
|
-
return /* @__PURE__ */
|
|
98
|
-
/* @__PURE__ */ jsx3(RadixAccordion.Header, { asChild: true, children: /* @__PURE__ */ jsx3(Heading, { className: header, children: /* @__PURE__ */
|
|
151
|
+
return /* @__PURE__ */ jsxs2(RadixAccordion.Item, { ref, className: cx(item, className), ...rest, children: [
|
|
152
|
+
/* @__PURE__ */ jsx3(RadixAccordion.Header, { asChild: true, children: /* @__PURE__ */ jsx3(Heading, { className: header, children: /* @__PURE__ */ jsxs2(RadixAccordion.Trigger, { className: trigger, children: [
|
|
99
153
|
title6,
|
|
100
154
|
/* @__PURE__ */ jsx3(ChevronDownIcon, { size: 18, className: chevron })
|
|
101
155
|
] }) }) }),
|
|
@@ -104,7 +158,7 @@ var AccordionItem = /* @__PURE__ */ forwardRef2(function AccordionItem2({ title:
|
|
|
104
158
|
});
|
|
105
159
|
|
|
106
160
|
// src/components/AddressInput/AddressInput.tsx
|
|
107
|
-
import { forwardRef as forwardRef7, useEffect, useId as
|
|
161
|
+
import { forwardRef as forwardRef7, useEffect, useId as useId3, useRef as useRef2, useState } from "react";
|
|
108
162
|
|
|
109
163
|
// src/components/Button/Button.tsx
|
|
110
164
|
import { forwardRef as forwardRef4 } from "react";
|
|
@@ -118,12 +172,12 @@ import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntim
|
|
|
118
172
|
var spinner = /* @__PURE__ */ _7a468({ defaultClassName: "_4b5tg40", variantClassNames: { color: { inherit: "_4b5tg41", primary: "_4b5tg42", neutral: "_4b5tg43", danger: "_4b5tg44" }, size: { sm: "_4b5tg45", md: "_4b5tg46", lg: "_4b5tg47" } }, defaultVariants: { color: "inherit", size: "md" }, compoundVariants: [] });
|
|
119
173
|
|
|
120
174
|
// src/components/Spinner/Spinner.tsx
|
|
121
|
-
import { jsx as jsx4, jsxs as
|
|
175
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
122
176
|
var Spinner = /* @__PURE__ */ forwardRef3(function Spinner2({ size, color, label: labelProp, className, ...rest }, ref) {
|
|
123
177
|
const m = useMessages();
|
|
124
178
|
const label6 = labelProp ?? m.loading ?? "\uB85C\uB529 \uC911";
|
|
125
179
|
const a11y = label6 ? { role: "status" } : { "aria-hidden": true };
|
|
126
|
-
return /* @__PURE__ */
|
|
180
|
+
return /* @__PURE__ */ jsxs3("span", { ref, className: cx(spinner({ size, color }), className), ...a11y, ...rest, children: [
|
|
127
181
|
/* @__PURE__ */ jsx4(LoaderIcon, { size: "100%" }),
|
|
128
182
|
label6 && /* @__PURE__ */ jsx4("span", { className: visuallyHidden, children: label6 })
|
|
129
183
|
] });
|
|
@@ -135,7 +189,7 @@ var button = /* @__PURE__ */ _7a4682({ defaultClassName: "xcekda6", variantClass
|
|
|
135
189
|
var icon = "xcekdai";
|
|
136
190
|
|
|
137
191
|
// src/components/Button/Button.tsx
|
|
138
|
-
import { jsx as jsx5, jsxs as
|
|
192
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
139
193
|
var Button = /* @__PURE__ */ forwardRef4(function Button2({
|
|
140
194
|
variant,
|
|
141
195
|
color,
|
|
@@ -158,7 +212,7 @@ var Button = /* @__PURE__ */ forwardRef4(function Button2({
|
|
|
158
212
|
onClick?.(event);
|
|
159
213
|
};
|
|
160
214
|
const leading = loading ? /* @__PURE__ */ jsx5(Spinner, { size: "sm", label: "" }) : startIcon;
|
|
161
|
-
return /* @__PURE__ */
|
|
215
|
+
return /* @__PURE__ */ jsxs4(
|
|
162
216
|
"button",
|
|
163
217
|
{
|
|
164
218
|
ref,
|
|
@@ -177,25 +231,14 @@ var Button = /* @__PURE__ */ forwardRef4(function Button2({
|
|
|
177
231
|
);
|
|
178
232
|
});
|
|
179
233
|
|
|
180
|
-
// src/components/Input/Input.css.ts
|
|
181
|
-
import { createRuntimeFn as _7a4683 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
182
|
-
var adornment = "_19p5zvh6";
|
|
183
|
-
var field = "_19p5zvh7";
|
|
184
|
-
var fieldFullWidth = "_19p5zvh8";
|
|
185
|
-
var helperText = /* @__PURE__ */ _7a4683({ defaultClassName: "_19p5zvhb", variantClassNames: { error: { true: "_19p5zvhc" } }, defaultVariants: {}, compoundVariants: [] });
|
|
186
|
-
var input = "_19p5zvh5";
|
|
187
|
-
var label = "_19p5zvh9";
|
|
188
|
-
var requiredMark = "_19p5zvha";
|
|
189
|
-
var root3 = /* @__PURE__ */ _7a4683({ defaultClassName: "_19p5zvh0", variantClassNames: { size: { sm: "_19p5zvh1", md: "_19p5zvh2", lg: "_19p5zvh3" }, fullWidth: { true: "_19p5zvh4" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
190
|
-
|
|
191
234
|
// src/components/Input/Input.tsx
|
|
192
235
|
import { forwardRef as forwardRef5 } from "react";
|
|
193
|
-
import { jsx as jsx6, jsxs as
|
|
236
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
194
237
|
var Input = /* @__PURE__ */ forwardRef5(function Input2({ size, invalid, fullWidth, startAdornment, endAdornment, rootClassName, className, disabled, ...rest }, ref) {
|
|
195
|
-
return /* @__PURE__ */
|
|
238
|
+
return /* @__PURE__ */ jsxs5(
|
|
196
239
|
"div",
|
|
197
240
|
{
|
|
198
|
-
className: cx(
|
|
241
|
+
className: cx(root({ size, fullWidth }), rootClassName),
|
|
199
242
|
"data-invalid": invalid || void 0,
|
|
200
243
|
"data-disabled": disabled || void 0,
|
|
201
244
|
children: [
|
|
@@ -217,14 +260,14 @@ var Input = /* @__PURE__ */ forwardRef5(function Input2({ size, invalid, fullWid
|
|
|
217
260
|
});
|
|
218
261
|
|
|
219
262
|
// src/components/Input/TextField.tsx
|
|
220
|
-
import { forwardRef as forwardRef6, useId } from "react";
|
|
221
|
-
import { jsx as jsx7, jsxs as
|
|
263
|
+
import { forwardRef as forwardRef6, useId as useId2 } from "react";
|
|
264
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
222
265
|
var TextField = /* @__PURE__ */ forwardRef6(function TextField2({ label: label6, helperText: helperText3, error, required, fullWidth, id, "aria-describedby": ariaDescribedBy, ...rest }, ref) {
|
|
223
|
-
const generatedId =
|
|
266
|
+
const generatedId = useId2();
|
|
224
267
|
const inputId = id ?? generatedId;
|
|
225
268
|
const helperId = helperText3 ? `${inputId}-helper` : void 0;
|
|
226
|
-
return /* @__PURE__ */
|
|
227
|
-
label6 && /* @__PURE__ */
|
|
269
|
+
return /* @__PURE__ */ jsxs6("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
|
|
270
|
+
label6 && /* @__PURE__ */ jsxs6("label", { htmlFor: inputId, className: label, children: [
|
|
228
271
|
label6,
|
|
229
272
|
required && /* @__PURE__ */ jsx7("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
230
273
|
] }),
|
|
@@ -272,10 +315,10 @@ function useReturnFocus(hasTrigger, onCloseAutoFocus) {
|
|
|
272
315
|
}
|
|
273
316
|
|
|
274
317
|
// src/components/Modal/Modal.css.ts
|
|
275
|
-
import { createRuntimeFn as
|
|
318
|
+
import { createRuntimeFn as _7a4683 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
276
319
|
var body = "_1pdsmv0a";
|
|
277
320
|
var closeButton = "_1pdsmv09";
|
|
278
|
-
var content2 = /* @__PURE__ */
|
|
321
|
+
var content2 = /* @__PURE__ */ _7a4683({ defaultClassName: "_1pdsmv01", variantClassNames: { size: { sm: "_1pdsmv02", md: "_1pdsmv03", lg: "_1pdsmv04" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
279
322
|
var description = "_1pdsmv08";
|
|
280
323
|
var footer = "_1pdsmv0b";
|
|
281
324
|
var header2 = "_1pdsmv05";
|
|
@@ -284,14 +327,14 @@ var overlay = "_1pdsmv00";
|
|
|
284
327
|
var title = "_1pdsmv07";
|
|
285
328
|
|
|
286
329
|
// src/components/Modal/Modal.tsx
|
|
287
|
-
import { jsx as jsx8, jsxs as
|
|
330
|
+
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
288
331
|
function Modal({
|
|
289
332
|
open,
|
|
290
333
|
defaultOpen,
|
|
291
334
|
onOpenChange,
|
|
292
335
|
trigger: trigger4,
|
|
293
336
|
title: title6,
|
|
294
|
-
description:
|
|
337
|
+
description: description8,
|
|
295
338
|
children,
|
|
296
339
|
footer: footer5,
|
|
297
340
|
size,
|
|
@@ -303,11 +346,11 @@ function Modal({
|
|
|
303
346
|
const portal2 = usePortalProps();
|
|
304
347
|
const m = useMessages();
|
|
305
348
|
const focus = useReturnFocus(Boolean(trigger4), onCloseAutoFocus);
|
|
306
|
-
return /* @__PURE__ */
|
|
349
|
+
return /* @__PURE__ */ jsxs7(Dialog.Root, { open, defaultOpen, onOpenChange, children: [
|
|
307
350
|
trigger4 && /* @__PURE__ */ jsx8(Dialog.Trigger, { asChild: true, children: trigger4 }),
|
|
308
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ jsxs7(Dialog.Portal, { children: [
|
|
309
352
|
/* @__PURE__ */ jsx8(Dialog.Overlay, { className: cx(portal2.className, overlay), style: portal2.style }),
|
|
310
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ jsxs7(
|
|
311
354
|
Dialog.Content,
|
|
312
355
|
{
|
|
313
356
|
className: cx(portal2.className, content2({ size }), className),
|
|
@@ -315,12 +358,12 @@ function Modal({
|
|
|
315
358
|
onPointerDownOutside: closeOnOverlayClick ? void 0 : (event) => event.preventDefault(),
|
|
316
359
|
onOpenAutoFocus: focus.onOpenAutoFocus,
|
|
317
360
|
onCloseAutoFocus: focus.onCloseAutoFocus,
|
|
318
|
-
...
|
|
361
|
+
...description8 ? {} : { "aria-describedby": void 0 },
|
|
319
362
|
children: [
|
|
320
|
-
/* @__PURE__ */
|
|
321
|
-
/* @__PURE__ */
|
|
363
|
+
/* @__PURE__ */ jsxs7("div", { className: header2, children: [
|
|
364
|
+
/* @__PURE__ */ jsxs7("div", { className: headings, children: [
|
|
322
365
|
/* @__PURE__ */ jsx8(Dialog.Title, { className: title, children: title6 }),
|
|
323
|
-
|
|
366
|
+
description8 && /* @__PURE__ */ jsx8(Dialog.Description, { className: description, children: description8 })
|
|
324
367
|
] }),
|
|
325
368
|
!hideCloseButton && /* @__PURE__ */ jsx8(Dialog.Close, { className: closeButton, "aria-label": m.close ?? "\uB2EB\uAE30", children: /* @__PURE__ */ jsx8(XIcon, { size: 16 }) })
|
|
326
369
|
] }),
|
|
@@ -343,7 +386,7 @@ var searchStatus = "_16fi7uy5";
|
|
|
343
386
|
var zonecode = "_16fi7uy3";
|
|
344
387
|
|
|
345
388
|
// src/components/AddressInput/AddressInput.tsx
|
|
346
|
-
import { Fragment, jsx as jsx9, jsxs as
|
|
389
|
+
import { Fragment, jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
347
390
|
var EMPTY = { zonecode: "", address: "", extraAddress: "", detail: "" };
|
|
348
391
|
function SearchArea({
|
|
349
392
|
provider,
|
|
@@ -374,7 +417,7 @@ function SearchArea({
|
|
|
374
417
|
cleanup?.();
|
|
375
418
|
};
|
|
376
419
|
}, [provider]);
|
|
377
|
-
return /* @__PURE__ */
|
|
420
|
+
return /* @__PURE__ */ jsxs8("div", { className: searchArea, children: [
|
|
378
421
|
/* @__PURE__ */ jsx9("div", { ref: containerRef, style: { width: "100%", height: "100%" } }),
|
|
379
422
|
status !== "ready" && /* @__PURE__ */ jsx9("div", { className: searchStatus, role: "status", children: status === "loading" ? /* @__PURE__ */ jsx9(Spinner, { label: loadingText }) : loadErrorText })
|
|
380
423
|
] });
|
|
@@ -402,7 +445,7 @@ var AddressInput = /* @__PURE__ */ forwardRef7(
|
|
|
402
445
|
const searchLabel = searchLabelProp ?? m.addressSearch ?? "\uC8FC\uC18C \uAC80\uC0C9";
|
|
403
446
|
const detailPlaceholder = detailPlaceholderProp ?? m.detailAddressPlaceholder ?? "\uC0C1\uC138 \uC8FC\uC18C (\uB3D9\xB7\uD638\uC218 \uB4F1)";
|
|
404
447
|
const loadErrorText = loadErrorTextProp ?? m.addressLoadError ?? "\uC8FC\uC18C \uAC80\uC0C9\uC744 \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC5B4\uC694. \uC7A0\uC2DC \uB4A4 \uB2E4\uC2DC \uC2DC\uB3C4\uD574 \uC8FC\uC138\uC694.";
|
|
405
|
-
const baseId =
|
|
448
|
+
const baseId = useId3();
|
|
406
449
|
const helperId = helperText3 ? `${baseId}-helper` : void 0;
|
|
407
450
|
const detailRef = useRef2(null);
|
|
408
451
|
const selectedRef = useRef2(false);
|
|
@@ -430,12 +473,12 @@ var AddressInput = /* @__PURE__ */ forwardRef7(
|
|
|
430
473
|
setOpen(false);
|
|
431
474
|
};
|
|
432
475
|
const fullAddress = `${current2.address}${current2.extraAddress ?? ""}`;
|
|
433
|
-
return /* @__PURE__ */
|
|
434
|
-
/* @__PURE__ */
|
|
476
|
+
return /* @__PURE__ */ jsxs8("fieldset", { ref, className: cx(fieldset, className), disabled, "aria-describedby": helperId, children: [
|
|
477
|
+
/* @__PURE__ */ jsxs8("legend", { className: legend, children: [
|
|
435
478
|
label6,
|
|
436
479
|
required && /* @__PURE__ */ jsx9("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
437
480
|
] }),
|
|
438
|
-
/* @__PURE__ */
|
|
481
|
+
/* @__PURE__ */ jsxs8("div", { className: row, children: [
|
|
439
482
|
/* @__PURE__ */ jsx9(
|
|
440
483
|
TextField,
|
|
441
484
|
{
|
|
@@ -477,7 +520,7 @@ var AddressInput = /* @__PURE__ */ forwardRef7(
|
|
|
477
520
|
}
|
|
478
521
|
),
|
|
479
522
|
helperText3 && /* @__PURE__ */ jsx9("p", { id: helperId, className: helperText({ error }), children: helperText3 }),
|
|
480
|
-
name && /* @__PURE__ */
|
|
523
|
+
name && /* @__PURE__ */ jsxs8(Fragment, { children: [
|
|
481
524
|
/* @__PURE__ */ jsx9("input", { type: "hidden", name: `${name}[zonecode]`, value: current2.zonecode }),
|
|
482
525
|
/* @__PURE__ */ jsx9("input", { type: "hidden", name: `${name}[address]`, value: fullAddress }),
|
|
483
526
|
/* @__PURE__ */ jsx9("input", { type: "hidden", name: `${name}[detail]`, value: current2.detail })
|
|
@@ -511,7 +554,7 @@ var AddressInput = /* @__PURE__ */ forwardRef7(
|
|
|
511
554
|
);
|
|
512
555
|
|
|
513
556
|
// src/components/AgreementGroup/AgreementGroup.tsx
|
|
514
|
-
import { forwardRef as forwardRef9, useId as
|
|
557
|
+
import { forwardRef as forwardRef9, useId as useId4, useState as useState2 } from "react";
|
|
515
558
|
import { ChevronDownIcon as ChevronDownIcon2 } from "@bestow-ui/icons";
|
|
516
559
|
|
|
517
560
|
// src/components/Checkbox/Checkbox.tsx
|
|
@@ -528,22 +571,22 @@ function mergeRefs(...refs) {
|
|
|
528
571
|
}
|
|
529
572
|
|
|
530
573
|
// src/components/Checkbox/Checkbox.css.ts
|
|
531
|
-
import { createRuntimeFn as
|
|
574
|
+
import { createRuntimeFn as _7a4684 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
532
575
|
var checkIcon = "_1y7mzsn8 _1y7mzsn7";
|
|
533
|
-
var control = /* @__PURE__ */
|
|
576
|
+
var control = /* @__PURE__ */ _7a4684({ defaultClassName: "_1y7mzsn3", variantClassNames: { size: { sm: "_1y7mzsn4", md: "_1y7mzsn5" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
534
577
|
var indeterminateIcon = "_1y7mzsn9 _1y7mzsn7";
|
|
535
578
|
var input2 = "_1y7mzsn6";
|
|
536
|
-
var root4 = /* @__PURE__ */
|
|
579
|
+
var root4 = /* @__PURE__ */ _7a4684({ defaultClassName: "_1y7mzsn0", variantClassNames: { size: { sm: "_1y7mzsn1", md: "_1y7mzsn2" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
537
580
|
|
|
538
581
|
// src/components/Checkbox/Checkbox.tsx
|
|
539
|
-
import { jsx as jsx10, jsxs as
|
|
582
|
+
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
540
583
|
var Checkbox = /* @__PURE__ */ forwardRef8(function Checkbox2({ label: label6, size, indeterminate = false, invalid, disabled, onChange, onCheckedChange, className, ...rest }, ref) {
|
|
541
584
|
const innerRef = useRef3(null);
|
|
542
585
|
useEffect2(() => {
|
|
543
586
|
if (innerRef.current) innerRef.current.indeterminate = indeterminate;
|
|
544
587
|
}, [indeterminate]);
|
|
545
|
-
return /* @__PURE__ */
|
|
546
|
-
/* @__PURE__ */
|
|
588
|
+
return /* @__PURE__ */ jsxs9("label", { className: cx(root4({ size }), className), "data-disabled": disabled || void 0, children: [
|
|
589
|
+
/* @__PURE__ */ jsxs9("span", { className: control({ size }), children: [
|
|
547
590
|
/* @__PURE__ */ jsx10(
|
|
548
591
|
"input",
|
|
549
592
|
{
|
|
@@ -589,11 +632,11 @@ var tag = "j3uxdc7";
|
|
|
589
632
|
var toggle = "j3uxdc8";
|
|
590
633
|
|
|
591
634
|
// src/components/AgreementGroup/AgreementGroup.tsx
|
|
592
|
-
import { jsx as jsx11, jsxs as
|
|
635
|
+
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
593
636
|
var AgreementGroup = /* @__PURE__ */ forwardRef9(
|
|
594
637
|
function AgreementGroup2(props, ref) {
|
|
595
638
|
const {
|
|
596
|
-
items:
|
|
639
|
+
items: items3,
|
|
597
640
|
value: value3,
|
|
598
641
|
defaultValue,
|
|
599
642
|
onValueChange,
|
|
@@ -616,7 +659,7 @@ var AgreementGroup = /* @__PURE__ */ forwardRef9(
|
|
|
616
659
|
const optionalText = optionalTextProp ?? m.optional ?? "\uC120\uD0DD";
|
|
617
660
|
const showText = showTextProp ?? m.show ?? "\uBCF4\uAE30";
|
|
618
661
|
const hideText = hideTextProp ?? m.hide ?? "\uC811\uAE30";
|
|
619
|
-
const baseId =
|
|
662
|
+
const baseId = useId4();
|
|
620
663
|
const helperId = helperText3 ? `${baseId}-helper` : void 0;
|
|
621
664
|
const isControlled = "value" in props;
|
|
622
665
|
const [innerValue, setInnerValue] = useState2(defaultValue ?? []);
|
|
@@ -626,11 +669,11 @@ var AgreementGroup = /* @__PURE__ */ forwardRef9(
|
|
|
626
669
|
if (!isControlled) setInnerValue(next);
|
|
627
670
|
onValueChange?.(next);
|
|
628
671
|
};
|
|
629
|
-
const allValues =
|
|
672
|
+
const allValues = items3.map((item9) => item9.value);
|
|
630
673
|
const agreedCount = allValues.filter((v) => agreed.includes(v)).length;
|
|
631
|
-
const allChecked =
|
|
674
|
+
const allChecked = items3.length > 0 && agreedCount === items3.length;
|
|
632
675
|
const toggleItem = (itemValue, checked) => update(checked ? [...agreed.filter((v) => v !== itemValue), itemValue] : agreed.filter((v) => v !== itemValue));
|
|
633
|
-
return /* @__PURE__ */
|
|
676
|
+
return /* @__PURE__ */ jsxs10(
|
|
634
677
|
"fieldset",
|
|
635
678
|
{
|
|
636
679
|
ref,
|
|
@@ -641,7 +684,7 @@ var AgreementGroup = /* @__PURE__ */ forwardRef9(
|
|
|
641
684
|
"data-invalid": error || void 0,
|
|
642
685
|
children: [
|
|
643
686
|
label6 && /* @__PURE__ */ jsx11("legend", { className: legend2, children: label6 }),
|
|
644
|
-
/* @__PURE__ */
|
|
687
|
+
/* @__PURE__ */ jsxs10("div", { className: box, children: [
|
|
645
688
|
/* @__PURE__ */ jsx11("div", { className: all, children: /* @__PURE__ */ jsx11(
|
|
646
689
|
Checkbox,
|
|
647
690
|
{
|
|
@@ -651,13 +694,13 @@ var AgreementGroup = /* @__PURE__ */ forwardRef9(
|
|
|
651
694
|
onChange: (event) => update(event.target.checked ? allValues : [])
|
|
652
695
|
}
|
|
653
696
|
) }),
|
|
654
|
-
/* @__PURE__ */ jsx11("ul", { className: list, children:
|
|
697
|
+
/* @__PURE__ */ jsx11("ul", { className: list, children: items3.map((item9) => {
|
|
655
698
|
const labelId = `${baseId}-${item9.value}-label`;
|
|
656
699
|
const toggleTextId = `${baseId}-${item9.value}-toggle`;
|
|
657
700
|
const contentId = `${baseId}-${item9.value}-content`;
|
|
658
701
|
const isOpen = expanded.includes(item9.value);
|
|
659
|
-
return /* @__PURE__ */
|
|
660
|
-
/* @__PURE__ */
|
|
702
|
+
return /* @__PURE__ */ jsxs10("li", { className: item2, children: [
|
|
703
|
+
/* @__PURE__ */ jsxs10("div", { className: row2, children: [
|
|
661
704
|
/* @__PURE__ */ jsx11(
|
|
662
705
|
Checkbox,
|
|
663
706
|
{
|
|
@@ -665,14 +708,14 @@ var AgreementGroup = /* @__PURE__ */ forwardRef9(
|
|
|
665
708
|
checked: agreed.includes(item9.value),
|
|
666
709
|
invalid: error && item9.required && !agreed.includes(item9.value),
|
|
667
710
|
onChange: (event) => toggleItem(item9.value, event.target.checked),
|
|
668
|
-
label: /* @__PURE__ */
|
|
711
|
+
label: /* @__PURE__ */ jsxs10("span", { id: labelId, children: [
|
|
669
712
|
/* @__PURE__ */ jsx11("span", { className: tag, "data-required": item9.required || void 0, children: item9.required ? requiredText : optionalText }),
|
|
670
713
|
" ",
|
|
671
714
|
item9.label
|
|
672
715
|
] })
|
|
673
716
|
}
|
|
674
717
|
),
|
|
675
|
-
item9.content && /* @__PURE__ */
|
|
718
|
+
item9.content && /* @__PURE__ */ jsxs10(
|
|
676
719
|
"button",
|
|
677
720
|
{
|
|
678
721
|
type: "button",
|
|
@@ -707,23 +750,24 @@ import { forwardRef as forwardRef10 } from "react";
|
|
|
707
750
|
import { CircleAlertIcon, CircleCheckIcon, InfoIcon, TriangleAlertIcon, XIcon as XIcon2 } from "@bestow-ui/icons";
|
|
708
751
|
|
|
709
752
|
// src/components/Alert/Alert.css.ts
|
|
710
|
-
import { createRuntimeFn as
|
|
711
|
-
var action = "
|
|
712
|
-
var alert = /* @__PURE__ */
|
|
713
|
-
var closeButton2 = "
|
|
714
|
-
var content4 = "
|
|
715
|
-
var description2 = "
|
|
716
|
-
var icon2 = "
|
|
717
|
-
var title2 = "
|
|
753
|
+
import { createRuntimeFn as _7a4685 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
754
|
+
var action = "bsmpc0k";
|
|
755
|
+
var alert = /* @__PURE__ */ _7a4685({ defaultClassName: "bsmpc06", variantClassNames: { variant: { soft: "bsmpc07", outline: "bsmpc08", solid: "bsmpc09" }, color: { primary: "bsmpc0a", neutral: "bsmpc0b", danger: "bsmpc0c", success: "bsmpc0d", warning: "bsmpc0e", info: "bsmpc0f" } }, defaultVariants: { variant: "soft", color: "primary" }, compoundVariants: [] });
|
|
756
|
+
var closeButton2 = "bsmpc0l";
|
|
757
|
+
var content4 = "bsmpc0h";
|
|
758
|
+
var description2 = "bsmpc0j";
|
|
759
|
+
var icon2 = "bsmpc0g";
|
|
760
|
+
var title2 = "bsmpc0i";
|
|
718
761
|
|
|
719
762
|
// src/components/Alert/Alert.tsx
|
|
720
|
-
import { jsx as jsx12, jsxs as
|
|
763
|
+
import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
721
764
|
var defaultIcons = {
|
|
722
765
|
primary: InfoIcon,
|
|
723
766
|
neutral: InfoIcon,
|
|
724
767
|
success: CircleCheckIcon,
|
|
725
768
|
warning: TriangleAlertIcon,
|
|
726
|
-
danger: CircleAlertIcon
|
|
769
|
+
danger: CircleAlertIcon,
|
|
770
|
+
info: InfoIcon
|
|
727
771
|
};
|
|
728
772
|
var Alert = /* @__PURE__ */ forwardRef10(function Alert2({
|
|
729
773
|
variant,
|
|
@@ -741,9 +785,9 @@ var Alert = /* @__PURE__ */ forwardRef10(function Alert2({
|
|
|
741
785
|
const closeLabel = closeLabelProp ?? m.close ?? "\uB2EB\uAE30";
|
|
742
786
|
const DefaultIcon = defaultIcons[color];
|
|
743
787
|
const iconNode = icon7 === void 0 ? /* @__PURE__ */ jsx12(DefaultIcon, { size: 18 }) : icon7;
|
|
744
|
-
return /* @__PURE__ */
|
|
788
|
+
return /* @__PURE__ */ jsxs11("div", { ref, className: cx(alert({ variant, color }), className), ...rest, children: [
|
|
745
789
|
iconNode !== false && iconNode !== null && /* @__PURE__ */ jsx12("span", { className: icon2, "aria-hidden": true, children: iconNode }),
|
|
746
|
-
/* @__PURE__ */
|
|
790
|
+
/* @__PURE__ */ jsxs11("div", { className: content4, children: [
|
|
747
791
|
title6 && /* @__PURE__ */ jsx12("div", { className: title2, children: title6 }),
|
|
748
792
|
children && /* @__PURE__ */ jsx12("div", { className: description2, children })
|
|
749
793
|
] }),
|
|
@@ -830,7 +874,7 @@ function useFormattedInput({
|
|
|
830
874
|
var input3 = "_70qkav0";
|
|
831
875
|
|
|
832
876
|
// src/components/AmountInput/AmountInput.tsx
|
|
833
|
-
import { Fragment as Fragment2, jsx as jsx13, jsxs as
|
|
877
|
+
import { Fragment as Fragment2, jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
834
878
|
var MAX_DIGITS = 15;
|
|
835
879
|
var isDigit = (char) => /\d/.test(char);
|
|
836
880
|
var AmountInput = /* @__PURE__ */ forwardRef11(
|
|
@@ -884,7 +928,7 @@ var AmountInput = /* @__PURE__ */ forwardRef11(
|
|
|
884
928
|
onKeyDown?.(event);
|
|
885
929
|
},
|
|
886
930
|
endAdornment: unit2,
|
|
887
|
-
helperText: reading && helperText3 ? /* @__PURE__ */
|
|
931
|
+
helperText: reading && helperText3 ? /* @__PURE__ */ jsxs12(Fragment2, { children: [
|
|
888
932
|
reading,
|
|
889
933
|
/* @__PURE__ */ jsx13("br", {}),
|
|
890
934
|
helperText3
|
|
@@ -902,13 +946,13 @@ import { UserIcon } from "@bestow-ui/icons";
|
|
|
902
946
|
import { forwardRef as forwardRef12 } from "react";
|
|
903
947
|
|
|
904
948
|
// src/components/Avatar/Avatar.css.ts
|
|
905
|
-
import { createRuntimeFn as
|
|
949
|
+
import { createRuntimeFn as _7a4686 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
906
950
|
var fallback = "_1fd2kp27";
|
|
907
951
|
var image = "_1fd2kp26";
|
|
908
|
-
var root5 = /* @__PURE__ */
|
|
952
|
+
var root5 = /* @__PURE__ */ _7a4686({ defaultClassName: "_1fd2kp20", variantClassNames: { size: { sm: "_1fd2kp21", md: "_1fd2kp22", lg: "_1fd2kp23" }, shape: { circle: "_1fd2kp24", square: "_1fd2kp25" } }, defaultVariants: { size: "md", shape: "circle" }, compoundVariants: [] });
|
|
909
953
|
|
|
910
954
|
// src/components/Avatar/Avatar.tsx
|
|
911
|
-
import { jsx as jsx14, jsxs as
|
|
955
|
+
import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
912
956
|
function getInitials(name) {
|
|
913
957
|
const [a = "", b = ""] = name.trim().split(/\s+/);
|
|
914
958
|
const first = (word) => Array.from(word)[0] ?? "";
|
|
@@ -918,7 +962,7 @@ var Avatar = /* @__PURE__ */ forwardRef12(function Avatar2({ src, alt, name, fal
|
|
|
918
962
|
const label6 = alt ?? name;
|
|
919
963
|
const a11y = label6 ? { role: "img", "aria-label": label6 } : { "aria-hidden": true };
|
|
920
964
|
const initials = name ? getInitials(name) : "";
|
|
921
|
-
return /* @__PURE__ */
|
|
965
|
+
return /* @__PURE__ */ jsxs13(RadixAvatar.Root, { ref, className: cx(root5({ size, shape }), className), ...a11y, ...rest, children: [
|
|
922
966
|
src && /* @__PURE__ */ jsx14(RadixAvatar.Image, { src, alt: "", className: image }),
|
|
923
967
|
/* @__PURE__ */ jsx14(RadixAvatar.Fallback, { className: fallback, children: fallback2 ?? (initials || /* @__PURE__ */ jsx14(UserIcon, { size: "60%" })) })
|
|
924
968
|
] });
|
|
@@ -934,12 +978,12 @@ import { forwardRef as forwardRef13 } from "react";
|
|
|
934
978
|
import { ExternalLinkIcon } from "@bestow-ui/icons";
|
|
935
979
|
|
|
936
980
|
// src/components/Link/Link.css.ts
|
|
937
|
-
import { createRuntimeFn as
|
|
981
|
+
import { createRuntimeFn as _7a4687 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
938
982
|
var externalIcon = "_1t4hlp6";
|
|
939
|
-
var link = /* @__PURE__ */
|
|
983
|
+
var link = /* @__PURE__ */ _7a4687({ defaultClassName: "_1t4hlp0", variantClassNames: { color: { primary: "_1t4hlp1", neutral: "_1t4hlp2", inherit: "_1t4hlp3" }, underline: { always: "_1t4hlp4", hover: "_1t4hlp5" } }, defaultVariants: { color: "primary", underline: "always" }, compoundVariants: [] });
|
|
940
984
|
|
|
941
985
|
// src/components/Link/Link.tsx
|
|
942
|
-
import { Fragment as Fragment3, jsx as jsx15, jsxs as
|
|
986
|
+
import { Fragment as Fragment3, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
943
987
|
var Link = /* @__PURE__ */ forwardRef13(function Link2({
|
|
944
988
|
as: Component = "a",
|
|
945
989
|
asChild,
|
|
@@ -962,7 +1006,7 @@ var Link = /* @__PURE__ */ forwardRef13(function Link2({
|
|
|
962
1006
|
/* @__PURE__ */ jsx15(Slot, { ref, className: linkClassName, ...{ target, rel, ...rest }, children })
|
|
963
1007
|
);
|
|
964
1008
|
}
|
|
965
|
-
return /* @__PURE__ */
|
|
1009
|
+
return /* @__PURE__ */ jsxs14(
|
|
966
1010
|
Component,
|
|
967
1011
|
{
|
|
968
1012
|
ref,
|
|
@@ -972,7 +1016,7 @@ var Link = /* @__PURE__ */ forwardRef13(function Link2({
|
|
|
972
1016
|
...rest,
|
|
973
1017
|
children: [
|
|
974
1018
|
children,
|
|
975
|
-
external && /* @__PURE__ */
|
|
1019
|
+
external && /* @__PURE__ */ jsxs14(Fragment3, { children: [
|
|
976
1020
|
" ",
|
|
977
1021
|
/* @__PURE__ */ jsx15(ExternalLinkIcon, { className: externalIcon }),
|
|
978
1022
|
/* @__PURE__ */ jsx15("span", { className: visuallyHidden, children: externalLabel })
|
|
@@ -990,14 +1034,14 @@ var list2 = "_18t8ztt0";
|
|
|
990
1034
|
var separator = "_18t8ztt4";
|
|
991
1035
|
|
|
992
1036
|
// src/components/Breadcrumb/Breadcrumb.tsx
|
|
993
|
-
import { jsx as jsx16, jsxs as
|
|
994
|
-
var Breadcrumb = /* @__PURE__ */ forwardRef14(function Breadcrumb2({ items:
|
|
1037
|
+
import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1038
|
+
var Breadcrumb = /* @__PURE__ */ forwardRef14(function Breadcrumb2({ items: items3, linkAs, separator: separator5, "aria-label": ariaLabelProp, className, ...rest }, ref) {
|
|
995
1039
|
const m = useMessages();
|
|
996
1040
|
const ariaLabel = ariaLabelProp ?? m.breadcrumb ?? "\uC774\uB3D9 \uACBD\uB85C";
|
|
997
|
-
const sep =
|
|
998
|
-
return /* @__PURE__ */ jsx16("nav", { ref, "aria-label": ariaLabel, className, ...rest, children: /* @__PURE__ */ jsx16("ol", { className: list2, children:
|
|
999
|
-
const isCurrent = index ===
|
|
1000
|
-
return /* @__PURE__ */
|
|
1041
|
+
const sep = separator5 ?? /* @__PURE__ */ jsx16(ChevronRightIcon, { size: 14 });
|
|
1042
|
+
return /* @__PURE__ */ jsx16("nav", { ref, "aria-label": ariaLabel, className, ...rest, children: /* @__PURE__ */ jsx16("ol", { className: list2, children: items3.map((item9, index) => {
|
|
1043
|
+
const isCurrent = index === items3.length - 1;
|
|
1044
|
+
return /* @__PURE__ */ jsxs15("li", { className: item3, children: [
|
|
1001
1045
|
index > 0 && /* @__PURE__ */ jsx16("span", { className: separator, "aria-hidden": true, children: sep }),
|
|
1002
1046
|
isCurrent || item9.href === void 0 ? /* @__PURE__ */ jsx16("span", { className: isCurrent ? current : void 0, "aria-current": isCurrent ? "page" : void 0, children: item9.label }) : /* @__PURE__ */ jsx16(Link, { as: linkAs, href: item9.href, color: "neutral", underline: "hover", className: link2, children: item9.label })
|
|
1003
1047
|
] }, index);
|
|
@@ -1005,9 +1049,23 @@ var Breadcrumb = /* @__PURE__ */ forwardRef14(function Breadcrumb2({ items: item
|
|
|
1005
1049
|
});
|
|
1006
1050
|
|
|
1007
1051
|
// src/components/BusinessNumberInput/BusinessNumberInput.tsx
|
|
1008
|
-
import { forwardRef as forwardRef15, useRef as useRef6, useState as
|
|
1052
|
+
import { forwardRef as forwardRef15, useRef as useRef6, useState as useState5 } from "react";
|
|
1009
1053
|
import { formatBusinessNumber, isValidBusinessNumber } from "@bestow-ui/korean-utils";
|
|
1010
|
-
|
|
1054
|
+
|
|
1055
|
+
// src/utils/useDelayedAnnouncement.ts
|
|
1056
|
+
import { useEffect as useEffect4, useState as useState4 } from "react";
|
|
1057
|
+
var ANNOUNCE_DELAY = 800;
|
|
1058
|
+
function useDelayedAnnouncement(message, delay = ANNOUNCE_DELAY) {
|
|
1059
|
+
const [announced, setAnnounced] = useState4("");
|
|
1060
|
+
useEffect4(() => {
|
|
1061
|
+
const timer2 = setTimeout(() => setAnnounced(message), message ? delay : 0);
|
|
1062
|
+
return () => clearTimeout(timer2);
|
|
1063
|
+
}, [message, delay]);
|
|
1064
|
+
return message && announced === message ? message : "";
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
// src/components/BusinessNumberInput/BusinessNumberInput.tsx
|
|
1068
|
+
import { Fragment as Fragment4, jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1011
1069
|
var sanitize = (input6) => input6.replace(/\D/g, "").slice(0, 10);
|
|
1012
1070
|
var isDigit2 = (char) => /\d/.test(char);
|
|
1013
1071
|
var BusinessNumberInput = /* @__PURE__ */ forwardRef15(
|
|
@@ -1031,7 +1089,7 @@ var BusinessNumberInput = /* @__PURE__ */ forwardRef15(
|
|
|
1031
1089
|
const invalidText = invalidTextProp ?? m.businessNumberInvalid ?? "\uC62C\uBC14\uB978 \uC0AC\uC5C5\uC790\uB4F1\uB85D\uBC88\uD638\uAC00 \uC544\uB2C8\uC5D0\uC694. \uBC88\uD638\uB97C \uB2E4\uC2DC \uD655\uC778\uD574 \uC8FC\uC138\uC694.";
|
|
1032
1090
|
const label6 = labelProp ?? m.businessNumber ?? "\uC0AC\uC5C5\uC790\uB4F1\uB85D\uBC88\uD638";
|
|
1033
1091
|
const incompleteText = m.businessNumberIncomplete ?? "10\uC790\uB9AC\uB97C \uBAA8\uB450 \uC785\uB825\uD574 \uC8FC\uC138\uC694.";
|
|
1034
|
-
const [touched, setTouched] =
|
|
1092
|
+
const [touched, setTouched] = useState5(false);
|
|
1035
1093
|
const field4 = useFormattedInput({
|
|
1036
1094
|
isControlled: "value" in props,
|
|
1037
1095
|
value: value3,
|
|
@@ -1045,42 +1103,46 @@ var BusinessNumberInput = /* @__PURE__ */ forwardRef15(
|
|
|
1045
1103
|
const complete = field4.raw.length === 10;
|
|
1046
1104
|
const autoInvalid = validate && field4.raw.length > 0 && (complete ? !isValidBusinessNumber(field4.raw) : touched);
|
|
1047
1105
|
const showAuto = autoInvalid && error === void 0;
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
field4.
|
|
1059
|
-
onKeyDown
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
onBlur
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1106
|
+
const announcement = useDelayedAnnouncement(showAuto && complete ? invalidText : "");
|
|
1107
|
+
return /* @__PURE__ */ jsxs16(Fragment4, { children: [
|
|
1108
|
+
/* @__PURE__ */ jsx17(
|
|
1109
|
+
TextField,
|
|
1110
|
+
{
|
|
1111
|
+
ref: mergeRefs(ref, inputRef),
|
|
1112
|
+
label: label6,
|
|
1113
|
+
placeholder,
|
|
1114
|
+
inputMode: "numeric",
|
|
1115
|
+
value: field4.display,
|
|
1116
|
+
onChange: field4.onChange,
|
|
1117
|
+
onKeyDown: (event) => {
|
|
1118
|
+
field4.onKeyDown(event);
|
|
1119
|
+
onKeyDown?.(event);
|
|
1120
|
+
},
|
|
1121
|
+
onBlur: (event) => {
|
|
1122
|
+
setTouched(true);
|
|
1123
|
+
onBlur?.(event);
|
|
1124
|
+
},
|
|
1125
|
+
error: error ?? autoInvalid,
|
|
1126
|
+
helperText: showAuto ? complete ? invalidText : incompleteText : helperText3,
|
|
1127
|
+
...rest
|
|
1128
|
+
}
|
|
1129
|
+
),
|
|
1130
|
+
/* @__PURE__ */ jsx17("span", { role: "status", className: visuallyHidden, children: announcement })
|
|
1131
|
+
] });
|
|
1070
1132
|
}
|
|
1071
1133
|
);
|
|
1072
1134
|
|
|
1073
1135
|
// src/components/Calendar/Calendar.tsx
|
|
1074
|
-
import { forwardRef as forwardRef17, useEffect as
|
|
1136
|
+
import { forwardRef as forwardRef17, useEffect as useEffect5, useId as useId5, useRef as useRef7, useState as useState6 } from "react";
|
|
1075
1137
|
import { ChevronLeftIcon, ChevronRightIcon as ChevronRightIcon2 } from "@bestow-ui/icons";
|
|
1076
1138
|
import { KOREAN_WEEKDAYS } from "@bestow-ui/korean-utils";
|
|
1077
1139
|
|
|
1078
1140
|
// src/utils/useIsClient.ts
|
|
1079
|
-
import { useSyncExternalStore } from "react";
|
|
1141
|
+
import { useSyncExternalStore as useSyncExternalStore2 } from "react";
|
|
1080
1142
|
var subscribeNothing = () => () => {
|
|
1081
1143
|
};
|
|
1082
1144
|
function useIsClient() {
|
|
1083
|
-
return
|
|
1145
|
+
return useSyncExternalStore2(
|
|
1084
1146
|
subscribeNothing,
|
|
1085
1147
|
() => true,
|
|
1086
1148
|
() => false
|
|
@@ -1091,8 +1153,8 @@ function useIsClient() {
|
|
|
1091
1153
|
import { forwardRef as forwardRef16 } from "react";
|
|
1092
1154
|
|
|
1093
1155
|
// src/components/IconButton/IconButton.css.ts
|
|
1094
|
-
import { createRuntimeFn as
|
|
1095
|
-
var iconButton = /* @__PURE__ */
|
|
1156
|
+
import { createRuntimeFn as _7a4688 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
1157
|
+
var iconButton = /* @__PURE__ */ _7a4688({ defaultClassName: "ip9et20", variantClassNames: { size: { sm: "ip9et21", md: "ip9et22", lg: "ip9et23" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
1096
1158
|
|
|
1097
1159
|
// src/components/IconButton/IconButton.tsx
|
|
1098
1160
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
@@ -1122,7 +1184,7 @@ var root6 = "_1qyq67b0";
|
|
|
1122
1184
|
var weekday = "_1qyq67b4";
|
|
1123
1185
|
|
|
1124
1186
|
// src/components/Calendar/Calendar.tsx
|
|
1125
|
-
import { jsx as jsx19, jsxs as
|
|
1187
|
+
import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1126
1188
|
var Calendar = /* @__PURE__ */ forwardRef17(function Calendar2(props, ref) {
|
|
1127
1189
|
const {
|
|
1128
1190
|
value: value3,
|
|
@@ -1143,10 +1205,10 @@ var Calendar = /* @__PURE__ */ forwardRef17(function Calendar2(props, ref) {
|
|
|
1143
1205
|
const nextMonthLabel = nextMonthLabelProp ?? m.nextMonth ?? "\uB2E4\uC74C \uB2EC";
|
|
1144
1206
|
const weekdaysShort = m.weekdaysShort ?? KOREAN_WEEKDAYS;
|
|
1145
1207
|
const weekdaysLong = m.weekdaysLong ?? KOREAN_WEEKDAYS.map((name) => `${name}\uC694\uC77C`);
|
|
1146
|
-
const headingId =
|
|
1208
|
+
const headingId = useId5();
|
|
1147
1209
|
const gridRef = useRef7(null);
|
|
1148
1210
|
const isControlled = "value" in props;
|
|
1149
|
-
const [innerValue, setInnerValue] =
|
|
1211
|
+
const [innerValue, setInnerValue] = useState6(defaultValue ?? "");
|
|
1150
1212
|
const selected = parseISODate(isControlled ? value3 : innerValue);
|
|
1151
1213
|
const isClient = useIsClient();
|
|
1152
1214
|
const today = parseISODate(todayProp) ?? (isClient ? /* @__PURE__ */ new Date() : null);
|
|
@@ -1158,16 +1220,16 @@ var Calendar = /* @__PURE__ */ forwardRef17(function Calendar2(props, ref) {
|
|
|
1158
1220
|
return date;
|
|
1159
1221
|
};
|
|
1160
1222
|
const isDisabled = (date) => minDate !== null && compareDays(date, minDate) < 0 || maxDate !== null && compareDays(date, maxDate) > 0 || !!isDateDisabled?.(date);
|
|
1161
|
-
const [focusedState, setFocused] =
|
|
1223
|
+
const [focusedState, setFocused] = useState6(null);
|
|
1162
1224
|
const base = selected ?? today;
|
|
1163
1225
|
const focused = focusedState ?? (base ? clamp(base) : null);
|
|
1164
1226
|
const moveFocus = useRef7(initialFocus ?? false);
|
|
1165
1227
|
const selectedIso = selected ? toISODate(selected) : "";
|
|
1166
|
-
|
|
1228
|
+
useEffect5(() => {
|
|
1167
1229
|
const date = parseISODate(selectedIso);
|
|
1168
1230
|
if (date) setFocused((prev) => isSameDay(prev, date) ? prev : date);
|
|
1169
1231
|
}, [selectedIso]);
|
|
1170
|
-
|
|
1232
|
+
useEffect5(() => {
|
|
1171
1233
|
if (!moveFocus.current || !focused) return;
|
|
1172
1234
|
moveFocus.current = false;
|
|
1173
1235
|
gridRef.current?.querySelector(`[data-date="${toISODate(focused)}"]`)?.focus();
|
|
@@ -1207,8 +1269,8 @@ var Calendar = /* @__PURE__ */ forwardRef17(function Calendar2(props, ref) {
|
|
|
1207
1269
|
) : [];
|
|
1208
1270
|
const canPrev = !!visible && (!minDate || compareDays(new Date(visible.getFullYear(), visible.getMonth(), 0), minDate) >= 0);
|
|
1209
1271
|
const canNext = !!visible && (!maxDate || compareDays(new Date(visible.getFullYear(), visible.getMonth() + 1, 1), maxDate) <= 0);
|
|
1210
|
-
return /* @__PURE__ */
|
|
1211
|
-
/* @__PURE__ */
|
|
1272
|
+
return /* @__PURE__ */ jsxs17("div", { ref, className: cx(root6, className), children: [
|
|
1273
|
+
/* @__PURE__ */ jsxs17("div", { className: header3, children: [
|
|
1212
1274
|
/* @__PURE__ */ jsx19(
|
|
1213
1275
|
IconButton,
|
|
1214
1276
|
{
|
|
@@ -1231,7 +1293,7 @@ var Calendar = /* @__PURE__ */ forwardRef17(function Calendar2(props, ref) {
|
|
|
1231
1293
|
}
|
|
1232
1294
|
)
|
|
1233
1295
|
] }),
|
|
1234
|
-
/* @__PURE__ */
|
|
1296
|
+
/* @__PURE__ */ jsxs17("table", { ref: gridRef, role: "grid", "aria-labelledby": headingId, className: grid, onKeyDown: handleKeyDown, children: [
|
|
1235
1297
|
/* @__PURE__ */ jsx19("thead", { children: /* @__PURE__ */ jsx19("tr", { children: weekdaysShort.map((name, index) => /* @__PURE__ */ jsx19("th", { scope: "col", abbr: weekdaysLong[index], className: weekday, "data-weekday": index, children: name }, index)) }) }),
|
|
1236
1298
|
/* @__PURE__ */ jsx19("tbody", { children: weeks.map((week) => /* @__PURE__ */ jsx19("tr", { children: week.map((date) => {
|
|
1237
1299
|
const iso = toISODate(date);
|
|
@@ -1269,15 +1331,111 @@ var Calendar = /* @__PURE__ */ forwardRef17(function Calendar2(props, ref) {
|
|
|
1269
1331
|
] });
|
|
1270
1332
|
});
|
|
1271
1333
|
|
|
1334
|
+
// src/components/CheckboxGroup/CheckboxGroup.tsx
|
|
1335
|
+
import { forwardRef as forwardRef18, useId as useId6, useState as useState7 } from "react";
|
|
1336
|
+
|
|
1337
|
+
// src/components/CheckboxGroup/CheckboxGroup.css.ts
|
|
1338
|
+
import { createRuntimeFn as _7a4689 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
1339
|
+
var description3 = /* @__PURE__ */ _7a4689({ defaultClassName: "_1z0r6xj5", variantClassNames: { size: { sm: "_1z0r6xj6", md: "_1z0r6xj7" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
1340
|
+
var groupLabel = "_1z0r6xj0";
|
|
1341
|
+
var items = /* @__PURE__ */ _7a4689({ defaultClassName: "_1z0r6xj1", variantClassNames: { orientation: { vertical: "_1z0r6xj2", horizontal: "_1z0r6xj3" } }, defaultVariants: { orientation: "vertical" }, compoundVariants: [] });
|
|
1342
|
+
var option = "_1z0r6xj4";
|
|
1343
|
+
|
|
1344
|
+
// src/components/CheckboxGroup/CheckboxGroup.tsx
|
|
1345
|
+
import { Fragment as Fragment5, jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1346
|
+
var CheckboxGroup = /* @__PURE__ */ forwardRef18(
|
|
1347
|
+
function CheckboxGroup2(props, ref) {
|
|
1348
|
+
const {
|
|
1349
|
+
options,
|
|
1350
|
+
value: value3,
|
|
1351
|
+
defaultValue,
|
|
1352
|
+
onValueChange,
|
|
1353
|
+
label: label6,
|
|
1354
|
+
helperText: helperText3,
|
|
1355
|
+
error,
|
|
1356
|
+
orientation,
|
|
1357
|
+
size,
|
|
1358
|
+
disabled,
|
|
1359
|
+
required,
|
|
1360
|
+
name,
|
|
1361
|
+
id,
|
|
1362
|
+
"aria-label": ariaLabel,
|
|
1363
|
+
className
|
|
1364
|
+
} = props;
|
|
1365
|
+
const m = useMessages();
|
|
1366
|
+
const isControlled = "value" in props;
|
|
1367
|
+
const [innerValue, setInnerValue] = useState7(defaultValue ?? []);
|
|
1368
|
+
const current2 = isControlled ? value3 ?? [] : innerValue;
|
|
1369
|
+
const generatedId = useId6();
|
|
1370
|
+
const baseId = id ?? generatedId;
|
|
1371
|
+
const labelId = label6 ? `${baseId}-label` : void 0;
|
|
1372
|
+
const helperId = helperText3 ? `${baseId}-helper` : void 0;
|
|
1373
|
+
const toggle3 = (optionValue, checked) => {
|
|
1374
|
+
const next = options.map((option3) => option3.value).filter((v) => v === optionValue ? checked : current2.includes(v));
|
|
1375
|
+
if (!isControlled) setInnerValue(next);
|
|
1376
|
+
onValueChange?.(next);
|
|
1377
|
+
};
|
|
1378
|
+
return /* @__PURE__ */ jsxs18("div", { className: cx(field, className), children: [
|
|
1379
|
+
label6 && /* @__PURE__ */ jsxs18("span", { id: labelId, className: cx(label, groupLabel), children: [
|
|
1380
|
+
label6,
|
|
1381
|
+
required && /* @__PURE__ */ jsxs18(Fragment5, { children: [
|
|
1382
|
+
/* @__PURE__ */ jsx20("span", { className: requiredMark, "aria-hidden": true, children: "*" }),
|
|
1383
|
+
" ",
|
|
1384
|
+
/* @__PURE__ */ jsxs18("span", { className: visuallyHidden, children: [
|
|
1385
|
+
"(",
|
|
1386
|
+
m.required ?? "\uD544\uC218",
|
|
1387
|
+
")"
|
|
1388
|
+
] })
|
|
1389
|
+
] })
|
|
1390
|
+
] }),
|
|
1391
|
+
/* @__PURE__ */ jsx20(
|
|
1392
|
+
"div",
|
|
1393
|
+
{
|
|
1394
|
+
ref,
|
|
1395
|
+
id: baseId,
|
|
1396
|
+
role: "group",
|
|
1397
|
+
"aria-label": ariaLabel,
|
|
1398
|
+
"aria-labelledby": labelId,
|
|
1399
|
+
"aria-describedby": helperId,
|
|
1400
|
+
className: items({ orientation }),
|
|
1401
|
+
children: options.map((option3) => {
|
|
1402
|
+
const itemId = `${baseId}-${option3.value}`;
|
|
1403
|
+
const descriptionId = option3.description ? `${itemId}-description` : void 0;
|
|
1404
|
+
return /* @__PURE__ */ jsxs18("div", { className: option, children: [
|
|
1405
|
+
/* @__PURE__ */ jsx20(
|
|
1406
|
+
Checkbox,
|
|
1407
|
+
{
|
|
1408
|
+
id: itemId,
|
|
1409
|
+
name,
|
|
1410
|
+
value: option3.value,
|
|
1411
|
+
label: option3.label,
|
|
1412
|
+
size,
|
|
1413
|
+
checked: current2.includes(option3.value),
|
|
1414
|
+
onCheckedChange: (checked) => toggle3(option3.value, checked),
|
|
1415
|
+
disabled: disabled || option3.disabled,
|
|
1416
|
+
invalid: error,
|
|
1417
|
+
"aria-describedby": descriptionId
|
|
1418
|
+
}
|
|
1419
|
+
),
|
|
1420
|
+
option3.description && /* @__PURE__ */ jsx20("span", { id: descriptionId, className: description3({ size }), children: option3.description })
|
|
1421
|
+
] }, option3.value);
|
|
1422
|
+
})
|
|
1423
|
+
}
|
|
1424
|
+
),
|
|
1425
|
+
helperText3 && /* @__PURE__ */ jsx20("p", { id: helperId, className: helperText({ error }), children: helperText3 })
|
|
1426
|
+
] });
|
|
1427
|
+
}
|
|
1428
|
+
);
|
|
1429
|
+
|
|
1272
1430
|
// src/components/Combobox/Combobox.tsx
|
|
1273
1431
|
import * as Popover from "@radix-ui/react-popover";
|
|
1274
1432
|
import {
|
|
1275
|
-
forwardRef as
|
|
1276
|
-
useEffect as
|
|
1277
|
-
useId as
|
|
1433
|
+
forwardRef as forwardRef19,
|
|
1434
|
+
useEffect as useEffect6,
|
|
1435
|
+
useId as useId7,
|
|
1278
1436
|
useMemo as useMemo3,
|
|
1279
1437
|
useRef as useRef8,
|
|
1280
|
-
useState as
|
|
1438
|
+
useState as useState8
|
|
1281
1439
|
} from "react";
|
|
1282
1440
|
import { CheckIcon, ChevronDownIcon as ChevronDownIcon3, XIcon as XIcon3 } from "@bestow-ui/icons";
|
|
1283
1441
|
|
|
@@ -1297,10 +1455,9 @@ var empty = "c2pbq74";
|
|
|
1297
1455
|
var toggle2 = "c2pbq71 c2pbq70";
|
|
1298
1456
|
|
|
1299
1457
|
// src/components/Combobox/Combobox.tsx
|
|
1300
|
-
import { jsx as
|
|
1301
|
-
var
|
|
1302
|
-
var
|
|
1303
|
-
var Combobox = /* @__PURE__ */ forwardRef18(function Combobox2(props, ref) {
|
|
1458
|
+
import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1459
|
+
var defaultFilter = (option3, query2) => option3.label.toLowerCase().includes(query2.trim().toLowerCase());
|
|
1460
|
+
var Combobox = /* @__PURE__ */ forwardRef19(function Combobox2(props, ref) {
|
|
1304
1461
|
const {
|
|
1305
1462
|
options,
|
|
1306
1463
|
value: value3,
|
|
@@ -1328,7 +1485,7 @@ var Combobox = /* @__PURE__ */ forwardRef18(function Combobox2(props, ref) {
|
|
|
1328
1485
|
const emptyMessage = emptyMessageProp ?? m.noResults ?? "\uACB0\uACFC\uAC00 \uC5C6\uC5B4\uC694";
|
|
1329
1486
|
const toggleLabel = toggleLabelProp ?? m.openList ?? "\uBAA9\uB85D \uC5F4\uAE30";
|
|
1330
1487
|
const clearLabel = clearLabelProp ?? m.clearSelection ?? "\uC120\uD0DD \uC9C0\uC6B0\uAE30";
|
|
1331
|
-
const generatedId =
|
|
1488
|
+
const generatedId = useId7();
|
|
1332
1489
|
const inputId = id ?? generatedId;
|
|
1333
1490
|
const labelId = `${inputId}-label`;
|
|
1334
1491
|
const listId = `${inputId}-listbox`;
|
|
@@ -1338,14 +1495,14 @@ var Combobox = /* @__PURE__ */ forwardRef18(function Combobox2(props, ref) {
|
|
|
1338
1495
|
const inputRef = useRef8(null);
|
|
1339
1496
|
const anchorRef = useRef8(null);
|
|
1340
1497
|
const isControlled = "value" in props;
|
|
1341
|
-
const [innerValue, setInnerValue] =
|
|
1498
|
+
const [innerValue, setInnerValue] = useState8(defaultValue);
|
|
1342
1499
|
const selectedValue = isControlled ? value3 : innerValue;
|
|
1343
1500
|
const selectedOption = options.find((o) => o.value === selectedValue);
|
|
1344
|
-
const [open, setOpen] =
|
|
1345
|
-
const [
|
|
1346
|
-
const [activeIndex, setActiveIndex] =
|
|
1347
|
-
const filtered = useMemo3(() =>
|
|
1348
|
-
const inputText =
|
|
1501
|
+
const [open, setOpen] = useState8(false);
|
|
1502
|
+
const [query2, setQuery] = useState8(null);
|
|
1503
|
+
const [activeIndex, setActiveIndex] = useState8(-1);
|
|
1504
|
+
const filtered = useMemo3(() => query2 ? options.filter((o) => filter(o, query2)) : options, [options, filter, query2]);
|
|
1505
|
+
const inputText = query2 ?? selectedOption?.label ?? "";
|
|
1349
1506
|
const firstEnabled = (list7, from = 0, step2 = 1) => {
|
|
1350
1507
|
for (let i = from; i >= 0 && i < list7.length; i += step2) if (!list7[i].disabled) return i;
|
|
1351
1508
|
return -1;
|
|
@@ -1367,13 +1524,13 @@ var Combobox = /* @__PURE__ */ forwardRef18(function Combobox2(props, ref) {
|
|
|
1367
1524
|
if (selectedValue) onValueChange?.("");
|
|
1368
1525
|
};
|
|
1369
1526
|
const close2 = () => {
|
|
1370
|
-
if (
|
|
1527
|
+
if (query2 === "" && selectedValue) clearSelection();
|
|
1371
1528
|
reset();
|
|
1372
1529
|
};
|
|
1373
|
-
const select2 = (
|
|
1374
|
-
if (
|
|
1375
|
-
if (!isControlled) setInnerValue(
|
|
1376
|
-
if (
|
|
1530
|
+
const select2 = (option3) => {
|
|
1531
|
+
if (option3.disabled) return;
|
|
1532
|
+
if (!isControlled) setInnerValue(option3.value);
|
|
1533
|
+
if (option3.value !== selectedValue) onValueChange?.(option3.value);
|
|
1377
1534
|
reset();
|
|
1378
1535
|
};
|
|
1379
1536
|
const move = (step2) => {
|
|
@@ -1403,8 +1560,8 @@ var Combobox = /* @__PURE__ */ forwardRef18(function Combobox2(props, ref) {
|
|
|
1403
1560
|
case "Enter":
|
|
1404
1561
|
if (open) {
|
|
1405
1562
|
event.preventDefault();
|
|
1406
|
-
const
|
|
1407
|
-
if (
|
|
1563
|
+
const option3 = filtered[activeIndex];
|
|
1564
|
+
if (option3) select2(option3);
|
|
1408
1565
|
else close2();
|
|
1409
1566
|
}
|
|
1410
1567
|
break;
|
|
@@ -1419,34 +1576,34 @@ var Combobox = /* @__PURE__ */ forwardRef18(function Combobox2(props, ref) {
|
|
|
1419
1576
|
break;
|
|
1420
1577
|
}
|
|
1421
1578
|
};
|
|
1422
|
-
|
|
1579
|
+
useEffect6(() => {
|
|
1423
1580
|
if (!open || activeIndex < 0) return;
|
|
1424
1581
|
document.getElementById(optionId(activeIndex))?.scrollIntoView?.({ block: "nearest" });
|
|
1425
1582
|
}, [open, activeIndex]);
|
|
1426
1583
|
const hasOptions = filtered.length > 0;
|
|
1427
1584
|
const noResults = open && !disabled && !hasOptions;
|
|
1428
|
-
const [announcedFor, setAnnouncedFor] =
|
|
1429
|
-
|
|
1585
|
+
const [announcedFor, setAnnouncedFor] = useState8(void 0);
|
|
1586
|
+
useEffect6(() => {
|
|
1430
1587
|
if (!noResults) return;
|
|
1431
|
-
const timer2 = setTimeout(() => setAnnouncedFor(
|
|
1588
|
+
const timer2 = setTimeout(() => setAnnouncedFor(query2), ANNOUNCE_DELAY);
|
|
1432
1589
|
return () => clearTimeout(timer2);
|
|
1433
|
-
}, [noResults,
|
|
1434
|
-
const announceNoResults = noResults && announcedFor ===
|
|
1435
|
-
return /* @__PURE__ */
|
|
1436
|
-
label6 && /* @__PURE__ */
|
|
1590
|
+
}, [noResults, query2]);
|
|
1591
|
+
const announceNoResults = noResults && announcedFor === query2;
|
|
1592
|
+
return /* @__PURE__ */ jsxs19("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
|
|
1593
|
+
label6 && /* @__PURE__ */ jsxs19("label", { id: labelId, htmlFor: inputId, className: label, children: [
|
|
1437
1594
|
label6,
|
|
1438
|
-
required && /* @__PURE__ */
|
|
1595
|
+
required && /* @__PURE__ */ jsx21("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
1439
1596
|
] }),
|
|
1440
|
-
/* @__PURE__ */
|
|
1441
|
-
/* @__PURE__ */
|
|
1597
|
+
/* @__PURE__ */ jsxs19(Popover.Root, { open: open && !disabled, onOpenChange: (next) => next ? openList() : close2(), children: [
|
|
1598
|
+
/* @__PURE__ */ jsx21(Popover.Anchor, { asChild: true, children: /* @__PURE__ */ jsxs19(
|
|
1442
1599
|
"div",
|
|
1443
1600
|
{
|
|
1444
1601
|
ref: anchorRef,
|
|
1445
|
-
className: cx(
|
|
1602
|
+
className: cx(root({ size, fullWidth }), className),
|
|
1446
1603
|
"data-invalid": error || void 0,
|
|
1447
1604
|
"data-disabled": disabled || void 0,
|
|
1448
1605
|
children: [
|
|
1449
|
-
/* @__PURE__ */
|
|
1606
|
+
/* @__PURE__ */ jsx21(
|
|
1450
1607
|
"input",
|
|
1451
1608
|
{
|
|
1452
1609
|
ref: mergeRefs(ref, inputRef),
|
|
@@ -1473,7 +1630,7 @@ var Combobox = /* @__PURE__ */ forwardRef18(function Combobox2(props, ref) {
|
|
|
1473
1630
|
className: input
|
|
1474
1631
|
}
|
|
1475
1632
|
),
|
|
1476
|
-
clearable && selectedOption && !disabled && /* @__PURE__ */
|
|
1633
|
+
clearable && selectedOption && !disabled && /* @__PURE__ */ jsx21(
|
|
1477
1634
|
"button",
|
|
1478
1635
|
{
|
|
1479
1636
|
type: "button",
|
|
@@ -1486,10 +1643,10 @@ var Combobox = /* @__PURE__ */ forwardRef18(function Combobox2(props, ref) {
|
|
|
1486
1643
|
reset();
|
|
1487
1644
|
inputRef.current?.focus();
|
|
1488
1645
|
},
|
|
1489
|
-
children: /* @__PURE__ */
|
|
1646
|
+
children: /* @__PURE__ */ jsx21(XIcon3, { size: 16 })
|
|
1490
1647
|
}
|
|
1491
1648
|
),
|
|
1492
|
-
/* @__PURE__ */
|
|
1649
|
+
/* @__PURE__ */ jsx21(
|
|
1493
1650
|
"button",
|
|
1494
1651
|
{
|
|
1495
1652
|
type: "button",
|
|
@@ -1504,13 +1661,13 @@ var Combobox = /* @__PURE__ */ forwardRef18(function Combobox2(props, ref) {
|
|
|
1504
1661
|
else openList(options);
|
|
1505
1662
|
inputRef.current?.focus();
|
|
1506
1663
|
},
|
|
1507
|
-
children: /* @__PURE__ */
|
|
1664
|
+
children: /* @__PURE__ */ jsx21(ChevronDownIcon3, { size: 16 })
|
|
1508
1665
|
}
|
|
1509
1666
|
)
|
|
1510
1667
|
]
|
|
1511
1668
|
}
|
|
1512
1669
|
) }),
|
|
1513
|
-
/* @__PURE__ */
|
|
1670
|
+
/* @__PURE__ */ jsx21(Popover.Portal, { children: /* @__PURE__ */ jsx21(
|
|
1514
1671
|
Popover.Content,
|
|
1515
1672
|
{
|
|
1516
1673
|
role: "presentation",
|
|
@@ -1525,63 +1682,63 @@ var Combobox = /* @__PURE__ */ forwardRef18(function Combobox2(props, ref) {
|
|
|
1525
1682
|
onInteractOutside: (event) => {
|
|
1526
1683
|
if (anchorRef.current?.contains(event.target)) event.preventDefault();
|
|
1527
1684
|
},
|
|
1528
|
-
children: hasOptions ? /* @__PURE__ */
|
|
1685
|
+
children: hasOptions ? /* @__PURE__ */ jsx21(
|
|
1529
1686
|
"div",
|
|
1530
1687
|
{
|
|
1531
1688
|
id: listId,
|
|
1532
1689
|
role: "listbox",
|
|
1533
1690
|
"aria-labelledby": label6 ? labelId : void 0,
|
|
1534
1691
|
"aria-label": label6 ? void 0 : ariaLabel,
|
|
1535
|
-
children: filtered.map((
|
|
1536
|
-
const isSelected =
|
|
1692
|
+
children: filtered.map((option3, index) => {
|
|
1693
|
+
const isSelected = option3.value === selectedValue;
|
|
1537
1694
|
return (
|
|
1538
1695
|
// aria-activedescendant 패턴: 포커스·키보드는 입력창이 맡고 항목은 포커스를 받지 않는다 (WAI-ARIA combobox)
|
|
1539
1696
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/interactive-supports-focus
|
|
1540
|
-
/* @__PURE__ */
|
|
1697
|
+
/* @__PURE__ */ jsxs19(
|
|
1541
1698
|
"div",
|
|
1542
1699
|
{
|
|
1543
1700
|
id: optionId(index),
|
|
1544
1701
|
role: "option",
|
|
1545
1702
|
"aria-selected": isSelected,
|
|
1546
|
-
"aria-disabled":
|
|
1703
|
+
"aria-disabled": option3.disabled || void 0,
|
|
1547
1704
|
"data-highlighted": index === activeIndex ? "" : void 0,
|
|
1548
1705
|
"data-state": isSelected ? "checked" : "unchecked",
|
|
1549
|
-
"data-disabled":
|
|
1706
|
+
"data-disabled": option3.disabled ? "" : void 0,
|
|
1550
1707
|
className: item4,
|
|
1551
1708
|
onMouseDown: (event) => event.preventDefault(),
|
|
1552
|
-
onMouseMove: () => !
|
|
1553
|
-
onClick: () => select2(
|
|
1709
|
+
onMouseMove: () => !option3.disabled && setActiveIndex(index),
|
|
1710
|
+
onClick: () => select2(option3),
|
|
1554
1711
|
children: [
|
|
1555
|
-
|
|
1556
|
-
isSelected && /* @__PURE__ */
|
|
1712
|
+
option3.label,
|
|
1713
|
+
isSelected && /* @__PURE__ */ jsx21("span", { className: itemIndicator, "aria-hidden": true, children: /* @__PURE__ */ jsx21(CheckIcon, { size: 16 }) })
|
|
1557
1714
|
]
|
|
1558
1715
|
},
|
|
1559
|
-
|
|
1716
|
+
option3.value
|
|
1560
1717
|
)
|
|
1561
1718
|
);
|
|
1562
1719
|
})
|
|
1563
1720
|
}
|
|
1564
1721
|
) : (
|
|
1565
1722
|
// 스크린리더 알림은 아래의 항상 있는 status 영역이 맡는다 (여기는 화면 표시만)
|
|
1566
|
-
/* @__PURE__ */
|
|
1723
|
+
/* @__PURE__ */ jsx21("div", { className: empty, children: emptyMessage })
|
|
1567
1724
|
)
|
|
1568
1725
|
}
|
|
1569
1726
|
) })
|
|
1570
1727
|
] }),
|
|
1571
|
-
/* @__PURE__ */
|
|
1572
|
-
name && /* @__PURE__ */
|
|
1573
|
-
helperText3 && /* @__PURE__ */
|
|
1728
|
+
/* @__PURE__ */ jsx21("span", { role: "status", className: visuallyHidden, children: announceNoResults ? emptyMessage : "" }),
|
|
1729
|
+
name && /* @__PURE__ */ jsx21("input", { type: "hidden", name, value: selectedValue ?? "" }),
|
|
1730
|
+
helperText3 && /* @__PURE__ */ jsx21("p", { id: helperId, className: helperText({ error }), children: helperText3 })
|
|
1574
1731
|
] });
|
|
1575
1732
|
});
|
|
1576
1733
|
|
|
1577
1734
|
// src/components/DatePicker/DatePicker.tsx
|
|
1578
|
-
import { forwardRef as
|
|
1735
|
+
import { forwardRef as forwardRef20, useEffect as useEffect7, useRef as useRef9, useState as useState9 } from "react";
|
|
1579
1736
|
import { CalendarIcon } from "@bestow-ui/icons";
|
|
1580
1737
|
|
|
1581
1738
|
// src/components/Popover/Popover.tsx
|
|
1582
1739
|
import * as RadixPopover from "@radix-ui/react-popover";
|
|
1583
1740
|
import { XIcon as XIcon4 } from "@bestow-ui/icons";
|
|
1584
|
-
import { useId as
|
|
1741
|
+
import { useId as useId8 } from "react";
|
|
1585
1742
|
|
|
1586
1743
|
// src/components/Popover/Popover.css.ts
|
|
1587
1744
|
var arrow = "_1j99p8x4";
|
|
@@ -1591,7 +1748,7 @@ var header4 = "_1j99p8x1";
|
|
|
1591
1748
|
var title3 = "_1j99p8x2";
|
|
1592
1749
|
|
|
1593
1750
|
// src/components/Popover/Popover.tsx
|
|
1594
|
-
import { jsx as
|
|
1751
|
+
import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1595
1752
|
function Popover2({
|
|
1596
1753
|
content: content12,
|
|
1597
1754
|
children,
|
|
@@ -1611,10 +1768,10 @@ function Popover2({
|
|
|
1611
1768
|
}) {
|
|
1612
1769
|
const portal2 = usePortalProps();
|
|
1613
1770
|
const m = useMessages();
|
|
1614
|
-
const titleId =
|
|
1615
|
-
return /* @__PURE__ */
|
|
1616
|
-
/* @__PURE__ */
|
|
1617
|
-
/* @__PURE__ */
|
|
1771
|
+
const titleId = useId8();
|
|
1772
|
+
return /* @__PURE__ */ jsxs20(RadixPopover.Root, { open, defaultOpen, onOpenChange, modal, children: [
|
|
1773
|
+
/* @__PURE__ */ jsx22(RadixPopover.Trigger, { asChild: true, children }),
|
|
1774
|
+
/* @__PURE__ */ jsx22(RadixPopover.Portal, { children: /* @__PURE__ */ jsxs20(
|
|
1618
1775
|
RadixPopover.Content,
|
|
1619
1776
|
{
|
|
1620
1777
|
side,
|
|
@@ -1627,12 +1784,12 @@ function Popover2({
|
|
|
1627
1784
|
className: cx(portal2.className, content7, className),
|
|
1628
1785
|
style: { ...portal2.style, ...style },
|
|
1629
1786
|
children: [
|
|
1630
|
-
(title6 || showClose) && /* @__PURE__ */
|
|
1631
|
-
title6 && /* @__PURE__ */
|
|
1632
|
-
showClose && /* @__PURE__ */
|
|
1787
|
+
(title6 || showClose) && /* @__PURE__ */ jsxs20("div", { className: header4, children: [
|
|
1788
|
+
title6 && /* @__PURE__ */ jsx22("h2", { id: titleId, className: title3, children: title6 }),
|
|
1789
|
+
showClose && /* @__PURE__ */ jsx22(RadixPopover.Close, { className: closeButton3, "aria-label": m.close ?? "\uB2EB\uAE30", children: /* @__PURE__ */ jsx22(XIcon4, { size: 16 }) })
|
|
1633
1790
|
] }),
|
|
1634
1791
|
content12,
|
|
1635
|
-
showArrow && /* @__PURE__ */
|
|
1792
|
+
showArrow && /* @__PURE__ */ jsx22(RadixPopover.Arrow, { className: arrow, width: 12, height: 6 })
|
|
1636
1793
|
]
|
|
1637
1794
|
}
|
|
1638
1795
|
) })
|
|
@@ -1641,11 +1798,11 @@ function Popover2({
|
|
|
1641
1798
|
var PopoverClose = RadixPopover.Close;
|
|
1642
1799
|
|
|
1643
1800
|
// src/components/DatePicker/DatePicker.tsx
|
|
1644
|
-
import { Fragment as
|
|
1801
|
+
import { Fragment as Fragment6, jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1645
1802
|
var sanitize2 = (input6) => input6.replace(/\D/g, "").slice(0, 8);
|
|
1646
1803
|
var format = (digits) => digits.length <= 4 ? digits : digits.length <= 6 ? `${digits.slice(0, 4)}-${digits.slice(4)}` : `${digits.slice(0, 4)}-${digits.slice(4, 6)}-${digits.slice(6)}`;
|
|
1647
1804
|
var isDigit3 = (char) => /\d/.test(char);
|
|
1648
|
-
var DatePicker = /* @__PURE__ */
|
|
1805
|
+
var DatePicker = /* @__PURE__ */ forwardRef20(
|
|
1649
1806
|
function DatePicker2(props, ref) {
|
|
1650
1807
|
const {
|
|
1651
1808
|
value: value3,
|
|
@@ -1678,8 +1835,8 @@ var DatePicker = /* @__PURE__ */ forwardRef19(
|
|
|
1678
1835
|
const invalidText = invalidTextProp ?? m.dateInvalid ?? "\uC62C\uBC14\uB978 \uB0A0\uC9DC\uAC00 \uC544\uB2C8\uC5D0\uC694.";
|
|
1679
1836
|
const unavailableText = unavailableTextProp ?? m.dateUnavailable ?? "\uACE0\uB97C \uC218 \uC5C6\uB294 \uB0A0\uC9DC\uC608\uC694.";
|
|
1680
1837
|
const incompleteText = incompleteTextProp ?? m.dateIncomplete ?? "\uB0A0\uC9DC\uB97C YYYY-MM-DD \uD615\uC2DD\uC73C\uB85C \uC785\uB825\uD574 \uC8FC\uC138\uC694.";
|
|
1681
|
-
const [open, setOpen] =
|
|
1682
|
-
const [touched, setTouched] =
|
|
1838
|
+
const [open, setOpen] = useState9(false);
|
|
1839
|
+
const [touched, setTouched] = useState9(false);
|
|
1683
1840
|
const isControlled = "value" in props;
|
|
1684
1841
|
const lastEmitted = useRef9(isControlled ? value3 ?? "" : defaultValue ?? "");
|
|
1685
1842
|
const minDate = parseISODate(min);
|
|
@@ -1706,7 +1863,7 @@ var DatePicker = /* @__PURE__ */ forwardRef19(
|
|
|
1706
1863
|
});
|
|
1707
1864
|
const textIso = toIso(field4.raw);
|
|
1708
1865
|
const { setRaw } = field4;
|
|
1709
|
-
|
|
1866
|
+
useEffect7(() => {
|
|
1710
1867
|
if (!isControlled) return;
|
|
1711
1868
|
const next = value3 ?? "";
|
|
1712
1869
|
lastEmitted.current = next;
|
|
@@ -1720,9 +1877,10 @@ var DatePicker = /* @__PURE__ */ forwardRef19(
|
|
|
1720
1877
|
const complete = field4.raw.length === 8;
|
|
1721
1878
|
const autoError = complete ? !date ? invalidText : isUnavailable(date) ? unavailableText : null : touched && field4.raw.length > 0 ? incompleteText : null;
|
|
1722
1879
|
const showAuto = autoError !== null && error === void 0;
|
|
1880
|
+
const announcement = useDelayedAnnouncement(showAuto && complete ? autoError ?? "" : "");
|
|
1723
1881
|
const selectedIso = date && !isUnavailable(date) ? textIso : "";
|
|
1724
|
-
return /* @__PURE__ */
|
|
1725
|
-
/* @__PURE__ */
|
|
1882
|
+
return /* @__PURE__ */ jsxs21(Fragment6, { children: [
|
|
1883
|
+
/* @__PURE__ */ jsx23(
|
|
1726
1884
|
TextField,
|
|
1727
1885
|
{
|
|
1728
1886
|
ref: mergeRefs(ref, inputRef),
|
|
@@ -1741,7 +1899,7 @@ var DatePicker = /* @__PURE__ */ forwardRef19(
|
|
|
1741
1899
|
disabled,
|
|
1742
1900
|
fullWidth,
|
|
1743
1901
|
rootClassName: className,
|
|
1744
|
-
endAdornment: /* @__PURE__ */
|
|
1902
|
+
endAdornment: /* @__PURE__ */ jsx23(
|
|
1745
1903
|
Popover2,
|
|
1746
1904
|
{
|
|
1747
1905
|
open,
|
|
@@ -1750,7 +1908,7 @@ var DatePicker = /* @__PURE__ */ forwardRef19(
|
|
|
1750
1908
|
align: "end",
|
|
1751
1909
|
"aria-label": m.calendar ?? "\uB2EC\uB825",
|
|
1752
1910
|
onOpenAutoFocus: (event) => event.preventDefault(),
|
|
1753
|
-
content: /* @__PURE__ */
|
|
1911
|
+
content: /* @__PURE__ */ jsx23(
|
|
1754
1912
|
Calendar,
|
|
1755
1913
|
{
|
|
1756
1914
|
value: selectedIso,
|
|
@@ -1767,18 +1925,19 @@ var DatePicker = /* @__PURE__ */ forwardRef19(
|
|
|
1767
1925
|
initialFocus: true
|
|
1768
1926
|
}
|
|
1769
1927
|
),
|
|
1770
|
-
children: /* @__PURE__ */
|
|
1928
|
+
children: /* @__PURE__ */ jsx23(IconButton, { "aria-label": calendarLabel, size: "sm", disabled, children: /* @__PURE__ */ jsx23(CalendarIcon, {}) })
|
|
1771
1929
|
}
|
|
1772
1930
|
)
|
|
1773
1931
|
}
|
|
1774
1932
|
),
|
|
1775
|
-
|
|
1933
|
+
/* @__PURE__ */ jsx23("span", { role: "status", className: visuallyHidden, children: announcement }),
|
|
1934
|
+
name && /* @__PURE__ */ jsx23("input", { type: "hidden", name, value: selectedIso })
|
|
1776
1935
|
] });
|
|
1777
1936
|
}
|
|
1778
1937
|
);
|
|
1779
1938
|
|
|
1780
1939
|
// src/components/DateRangePicker/DateRangePicker.tsx
|
|
1781
|
-
import { forwardRef as
|
|
1940
|
+
import { forwardRef as forwardRef21, useId as useId9, useState as useState10 } from "react";
|
|
1782
1941
|
|
|
1783
1942
|
// src/components/DateRangePicker/DateRangePicker.css.ts
|
|
1784
1943
|
var field2 = "_17277dh3";
|
|
@@ -1789,8 +1948,8 @@ var presets = "_17277dh5";
|
|
|
1789
1948
|
var separator2 = "_17277dh4";
|
|
1790
1949
|
|
|
1791
1950
|
// src/components/DateRangePicker/DateRangePicker.tsx
|
|
1792
|
-
import { jsx as
|
|
1793
|
-
var DateRangePicker = /* @__PURE__ */
|
|
1951
|
+
import { jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1952
|
+
var DateRangePicker = /* @__PURE__ */ forwardRef21(
|
|
1794
1953
|
function DateRangePicker2(props, ref) {
|
|
1795
1954
|
const {
|
|
1796
1955
|
value: value3,
|
|
@@ -1815,12 +1974,12 @@ var DateRangePicker = /* @__PURE__ */ forwardRef20(
|
|
|
1815
1974
|
className
|
|
1816
1975
|
} = props;
|
|
1817
1976
|
const m = useMessages();
|
|
1818
|
-
const generatedId =
|
|
1977
|
+
const generatedId = useId9();
|
|
1819
1978
|
const baseId = id ?? generatedId;
|
|
1820
1979
|
const helperId = helperText3 ? `${baseId}-helper` : void 0;
|
|
1821
1980
|
const isClient = useIsClient();
|
|
1822
1981
|
const isControlled = "value" in props;
|
|
1823
|
-
const [inner, setInner] =
|
|
1982
|
+
const [inner, setInner] = useState10(defaultValue ?? { start: "", end: "" });
|
|
1824
1983
|
const range3 = isControlled ? value3 ?? { start: "", end: "" } : inner;
|
|
1825
1984
|
const update = (next) => {
|
|
1826
1985
|
if (next.start === range3.start && next.end === range3.end) return;
|
|
@@ -1831,7 +1990,7 @@ var DateRangePicker = /* @__PURE__ */ forwardRef20(
|
|
|
1831
1990
|
const startLabel = startLabelProp ?? m.dateRangeStart ?? "\uC2DC\uC791\uC77C";
|
|
1832
1991
|
const endLabel = endLabelProp ?? m.dateRangeEnd ?? "\uC885\uB8CC\uC77C";
|
|
1833
1992
|
const common = { isDateDisabled, isHoliday, today, disabled, required, fullWidth: true };
|
|
1834
|
-
return /* @__PURE__ */
|
|
1993
|
+
return /* @__PURE__ */ jsxs22(
|
|
1835
1994
|
"fieldset",
|
|
1836
1995
|
{
|
|
1837
1996
|
ref,
|
|
@@ -1840,12 +1999,12 @@ var DateRangePicker = /* @__PURE__ */ forwardRef20(
|
|
|
1840
1999
|
"aria-describedby": helperId,
|
|
1841
2000
|
"data-invalid": error || void 0,
|
|
1842
2001
|
children: [
|
|
1843
|
-
label6 && /* @__PURE__ */
|
|
2002
|
+
label6 && /* @__PURE__ */ jsxs22("legend", { className: legend3, children: [
|
|
1844
2003
|
label6,
|
|
1845
|
-
required && /* @__PURE__ */
|
|
2004
|
+
required && /* @__PURE__ */ jsx24("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
1846
2005
|
] }),
|
|
1847
|
-
/* @__PURE__ */
|
|
1848
|
-
/* @__PURE__ */
|
|
2006
|
+
/* @__PURE__ */ jsxs22("div", { className: fields, children: [
|
|
2007
|
+
/* @__PURE__ */ jsx24("div", { className: field2, children: /* @__PURE__ */ jsx24(
|
|
1849
2008
|
DatePicker,
|
|
1850
2009
|
{
|
|
1851
2010
|
...common,
|
|
@@ -1859,8 +2018,8 @@ var DateRangePicker = /* @__PURE__ */ forwardRef20(
|
|
|
1859
2018
|
error: error || void 0
|
|
1860
2019
|
}
|
|
1861
2020
|
) }),
|
|
1862
|
-
/* @__PURE__ */
|
|
1863
|
-
/* @__PURE__ */
|
|
2021
|
+
/* @__PURE__ */ jsx24("span", { className: separator2, "aria-hidden": true, children: "~" }),
|
|
2022
|
+
/* @__PURE__ */ jsx24("div", { className: field2, children: /* @__PURE__ */ jsx24(
|
|
1864
2023
|
DatePicker,
|
|
1865
2024
|
{
|
|
1866
2025
|
...common,
|
|
@@ -1875,10 +2034,10 @@ var DateRangePicker = /* @__PURE__ */ forwardRef20(
|
|
|
1875
2034
|
}
|
|
1876
2035
|
) })
|
|
1877
2036
|
] }),
|
|
1878
|
-
presets2 && presets2.length > 0 && /* @__PURE__ */
|
|
2037
|
+
presets2 && presets2.length > 0 && /* @__PURE__ */ jsx24("div", { role: "group", "aria-label": m.dateRangePresets ?? "\uBE60\uB978 \uC120\uD0DD", className: presets, children: presets2.map((preset) => {
|
|
1879
2038
|
const target = isClient ? presetRange(preset, todayIso()) : null;
|
|
1880
2039
|
const pressed = !!target && target.start === range3.start && target.end === range3.end;
|
|
1881
|
-
return /* @__PURE__ */
|
|
2040
|
+
return /* @__PURE__ */ jsx24(
|
|
1882
2041
|
Button,
|
|
1883
2042
|
{
|
|
1884
2043
|
type: "button",
|
|
@@ -1893,7 +2052,7 @@ var DateRangePicker = /* @__PURE__ */ forwardRef20(
|
|
|
1893
2052
|
preset.label
|
|
1894
2053
|
);
|
|
1895
2054
|
}) }),
|
|
1896
|
-
helperText3 && /* @__PURE__ */
|
|
2055
|
+
helperText3 && /* @__PURE__ */ jsx24("p", { id: helperId, className: helperText({ error }), children: helperText3 })
|
|
1897
2056
|
]
|
|
1898
2057
|
}
|
|
1899
2058
|
);
|
|
@@ -1909,7 +2068,7 @@ import { createRuntimeFn as _7a46810 } from "@vanilla-extract/recipes/createRunt
|
|
|
1909
2068
|
var body2 = "nmobyvy";
|
|
1910
2069
|
var closeButton4 = "nmobyvx";
|
|
1911
2070
|
var content8 = /* @__PURE__ */ _7a46810({ defaultClassName: "nmobyv9", variantClassNames: { side: { right: "nmobyva", left: "nmobyvb", top: "nmobyvc", bottom: "nmobyvd" }, size: { sm: "nmobyve", md: "nmobyvf", lg: "nmobyvg" } }, defaultVariants: { side: "right", size: "md" }, compoundVariants: [[{ side: "right", size: "sm" }, "nmobyvh"], [{ side: "right", size: "md" }, "nmobyvi"], [{ side: "right", size: "lg" }, "nmobyvj"], [{ side: "left", size: "sm" }, "nmobyvk"], [{ side: "left", size: "md" }, "nmobyvl"], [{ side: "left", size: "lg" }, "nmobyvm"], [{ side: "top", size: "sm" }, "nmobyvn"], [{ side: "top", size: "md" }, "nmobyvo"], [{ side: "top", size: "lg" }, "nmobyvp"], [{ side: "bottom", size: "sm" }, "nmobyvq"], [{ side: "bottom", size: "md" }, "nmobyvr"], [{ side: "bottom", size: "lg" }, "nmobyvs"]] });
|
|
1912
|
-
var
|
|
2071
|
+
var description4 = "nmobyvw";
|
|
1913
2072
|
var footer2 = "nmobyvz";
|
|
1914
2073
|
var header5 = "nmobyvt";
|
|
1915
2074
|
var headings2 = "nmobyvu";
|
|
@@ -1917,14 +2076,14 @@ var overlay2 = "nmobyv0";
|
|
|
1917
2076
|
var title4 = "nmobyvv";
|
|
1918
2077
|
|
|
1919
2078
|
// src/components/Drawer/Drawer.tsx
|
|
1920
|
-
import { jsx as
|
|
2079
|
+
import { jsx as jsx25, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
1921
2080
|
function Drawer({
|
|
1922
2081
|
open,
|
|
1923
2082
|
defaultOpen,
|
|
1924
2083
|
onOpenChange,
|
|
1925
2084
|
trigger: trigger4,
|
|
1926
2085
|
title: title6,
|
|
1927
|
-
description:
|
|
2086
|
+
description: description8,
|
|
1928
2087
|
children,
|
|
1929
2088
|
footer: footer5,
|
|
1930
2089
|
side,
|
|
@@ -1936,11 +2095,11 @@ function Drawer({
|
|
|
1936
2095
|
const portal2 = usePortalProps();
|
|
1937
2096
|
const m = useMessages();
|
|
1938
2097
|
const focus = useReturnFocus(Boolean(trigger4));
|
|
1939
|
-
return /* @__PURE__ */
|
|
1940
|
-
trigger4 && /* @__PURE__ */
|
|
1941
|
-
/* @__PURE__ */
|
|
1942
|
-
/* @__PURE__ */
|
|
1943
|
-
/* @__PURE__ */
|
|
2098
|
+
return /* @__PURE__ */ jsxs23(Dialog2.Root, { open, defaultOpen, onOpenChange, children: [
|
|
2099
|
+
trigger4 && /* @__PURE__ */ jsx25(Dialog2.Trigger, { asChild: true, children: trigger4 }),
|
|
2100
|
+
/* @__PURE__ */ jsxs23(Dialog2.Portal, { children: [
|
|
2101
|
+
/* @__PURE__ */ jsx25(Dialog2.Overlay, { className: cx(portal2.className, overlay2), style: portal2.style }),
|
|
2102
|
+
/* @__PURE__ */ jsxs23(
|
|
1944
2103
|
Dialog2.Content,
|
|
1945
2104
|
{
|
|
1946
2105
|
className: cx(portal2.className, content8({ side, size }), className),
|
|
@@ -1949,17 +2108,17 @@ function Drawer({
|
|
|
1949
2108
|
onPointerDownOutside: closeOnOverlayClick ? void 0 : (event) => event.preventDefault(),
|
|
1950
2109
|
onOpenAutoFocus: focus.onOpenAutoFocus,
|
|
1951
2110
|
onCloseAutoFocus: focus.onCloseAutoFocus,
|
|
1952
|
-
...
|
|
2111
|
+
...description8 ? {} : { "aria-describedby": void 0 },
|
|
1953
2112
|
children: [
|
|
1954
|
-
/* @__PURE__ */
|
|
1955
|
-
/* @__PURE__ */
|
|
1956
|
-
/* @__PURE__ */
|
|
1957
|
-
|
|
2113
|
+
/* @__PURE__ */ jsxs23("div", { className: header5, children: [
|
|
2114
|
+
/* @__PURE__ */ jsxs23("div", { className: headings2, children: [
|
|
2115
|
+
/* @__PURE__ */ jsx25(Dialog2.Title, { className: title4, children: title6 }),
|
|
2116
|
+
description8 && /* @__PURE__ */ jsx25(Dialog2.Description, { className: description4, children: description8 })
|
|
1958
2117
|
] }),
|
|
1959
|
-
!hideCloseButton && /* @__PURE__ */
|
|
2118
|
+
!hideCloseButton && /* @__PURE__ */ jsx25(Dialog2.Close, { asChild: true, children: /* @__PURE__ */ jsx25(IconButton, { "aria-label": m.close ?? "\uB2EB\uAE30", size: "sm", className: closeButton4, children: /* @__PURE__ */ jsx25(XIcon5, {}) }) })
|
|
1960
2119
|
] }),
|
|
1961
|
-
children && /* @__PURE__ */
|
|
1962
|
-
footer5 && /* @__PURE__ */
|
|
2120
|
+
children && /* @__PURE__ */ jsx25("div", { className: body2, children }),
|
|
2121
|
+
footer5 && /* @__PURE__ */ jsx25("div", { className: footer2, children: footer5 })
|
|
1963
2122
|
]
|
|
1964
2123
|
}
|
|
1965
2124
|
)
|
|
@@ -1969,7 +2128,7 @@ function Drawer({
|
|
|
1969
2128
|
var DrawerClose = Dialog2.Close;
|
|
1970
2129
|
|
|
1971
2130
|
// src/components/ErrorSummary/ErrorSummary.tsx
|
|
1972
|
-
import { forwardRef as
|
|
2131
|
+
import { forwardRef as forwardRef22, useEffect as useEffect8, useId as useId10, useRef as useRef10 } from "react";
|
|
1973
2132
|
|
|
1974
2133
|
// src/components/ErrorSummary/ErrorSummary.css.ts
|
|
1975
2134
|
var link3 = "_1cdophv2";
|
|
@@ -1977,17 +2136,17 @@ var list3 = "_1cdophv1";
|
|
|
1977
2136
|
var root7 = "_1cdophv0";
|
|
1978
2137
|
|
|
1979
2138
|
// src/components/ErrorSummary/ErrorSummary.tsx
|
|
1980
|
-
import { jsx as
|
|
1981
|
-
var ErrorSummary = /* @__PURE__ */
|
|
2139
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
2140
|
+
var ErrorSummary = /* @__PURE__ */ forwardRef22(function ErrorSummary2({ errors: errors2, title: title6, focusKey, className, ...rest }, ref) {
|
|
1982
2141
|
const m = useMessages();
|
|
1983
|
-
const titleId =
|
|
2142
|
+
const titleId = useId10();
|
|
1984
2143
|
const rootRef = useRef10(null);
|
|
1985
2144
|
const hasErrors = errors2.length > 0;
|
|
1986
|
-
|
|
2145
|
+
useEffect8(() => {
|
|
1987
2146
|
if (hasErrors) rootRef.current?.focus();
|
|
1988
2147
|
}, [focusKey, hasErrors]);
|
|
1989
2148
|
if (!hasErrors) return null;
|
|
1990
|
-
return /* @__PURE__ */
|
|
2149
|
+
return /* @__PURE__ */ jsx26(
|
|
1991
2150
|
"div",
|
|
1992
2151
|
{
|
|
1993
2152
|
ref: mergeRefs(ref, rootRef),
|
|
@@ -1995,12 +2154,12 @@ var ErrorSummary = /* @__PURE__ */ forwardRef21(function ErrorSummary2({ errors:
|
|
|
1995
2154
|
"aria-labelledby": titleId,
|
|
1996
2155
|
className: cx(root7, className),
|
|
1997
2156
|
...rest,
|
|
1998
|
-
children: /* @__PURE__ */
|
|
2157
|
+
children: /* @__PURE__ */ jsx26(
|
|
1999
2158
|
Alert,
|
|
2000
2159
|
{
|
|
2001
2160
|
color: "danger",
|
|
2002
|
-
title: /* @__PURE__ */
|
|
2003
|
-
children: /* @__PURE__ */
|
|
2161
|
+
title: /* @__PURE__ */ jsx26("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` }),
|
|
2162
|
+
children: /* @__PURE__ */ jsx26("ul", { className: list3, children: errors2.map((error) => /* @__PURE__ */ jsx26("li", { children: /* @__PURE__ */ jsx26(
|
|
2004
2163
|
"a",
|
|
2005
2164
|
{
|
|
2006
2165
|
href: `#${error.id}`,
|
|
@@ -2018,7 +2177,7 @@ var ErrorSummary = /* @__PURE__ */ forwardRef21(function ErrorSummary2({ errors:
|
|
|
2018
2177
|
});
|
|
2019
2178
|
|
|
2020
2179
|
// src/components/FileUpload/FileUpload.tsx
|
|
2021
|
-
import { forwardRef as
|
|
2180
|
+
import { forwardRef as forwardRef23, useEffect as useEffect9, useId as useId11, useRef as useRef11, useState as useState11 } from "react";
|
|
2022
2181
|
import { FileIcon, UploadIcon, XIcon as XIcon6 } from "@bestow-ui/icons";
|
|
2023
2182
|
|
|
2024
2183
|
// src/components/FileUpload/FileUpload.css.ts
|
|
@@ -2034,7 +2193,7 @@ var list4 = "r2jefr4";
|
|
|
2034
2193
|
var root8 = "r2jefr0";
|
|
2035
2194
|
|
|
2036
2195
|
// src/components/FileUpload/FileUpload.tsx
|
|
2037
|
-
import { jsx as
|
|
2196
|
+
import { jsx as jsx27, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2038
2197
|
var REMOVED_ANNOUNCE_DELAY = 500;
|
|
2039
2198
|
function formatSize(bytes) {
|
|
2040
2199
|
if (bytes < 1024) return `${bytes} B`;
|
|
@@ -2051,7 +2210,7 @@ function matchesAccept(file, accept) {
|
|
|
2051
2210
|
}
|
|
2052
2211
|
var NO_FILES = [];
|
|
2053
2212
|
var sameFile = (a, b) => a.name === b.name && a.size === b.size && a.lastModified === b.lastModified;
|
|
2054
|
-
var FileUpload = /* @__PURE__ */
|
|
2213
|
+
var FileUpload = /* @__PURE__ */ forwardRef23(function FileUpload2(props, ref) {
|
|
2055
2214
|
const {
|
|
2056
2215
|
value: value3,
|
|
2057
2216
|
defaultValue,
|
|
@@ -2072,12 +2231,12 @@ var FileUpload = /* @__PURE__ */ forwardRef22(function FileUpload2(props, ref) {
|
|
|
2072
2231
|
} = props;
|
|
2073
2232
|
const m = useMessages();
|
|
2074
2233
|
const isControlled = "value" in props;
|
|
2075
|
-
const [innerFiles, setInnerFiles] =
|
|
2234
|
+
const [innerFiles, setInnerFiles] = useState11(defaultValue ?? []);
|
|
2076
2235
|
const files = isControlled ? value3 ?? NO_FILES : innerFiles;
|
|
2077
|
-
const [rejections, setRejections] =
|
|
2078
|
-
const [announcement, setAnnouncement] =
|
|
2079
|
-
const [dragging, setDragging] =
|
|
2080
|
-
const generatedId =
|
|
2236
|
+
const [rejections, setRejections] = useState11([]);
|
|
2237
|
+
const [announcement, setAnnouncement] = useState11("");
|
|
2238
|
+
const [dragging, setDragging] = useState11(false);
|
|
2239
|
+
const generatedId = useId11();
|
|
2081
2240
|
const baseId = id ?? generatedId;
|
|
2082
2241
|
const labelId = label6 ? `${baseId}-label` : void 0;
|
|
2083
2242
|
const helperId = helperText3 ? `${baseId}-helper` : void 0;
|
|
@@ -2087,7 +2246,7 @@ var FileUpload = /* @__PURE__ */ forwardRef22(function FileUpload2(props, ref) {
|
|
|
2087
2246
|
const removeButtonRefs = useRef11([]);
|
|
2088
2247
|
const focusAfterRemove = useRef11(null);
|
|
2089
2248
|
const announceTimer = useRef11(void 0);
|
|
2090
|
-
|
|
2249
|
+
useEffect9(() => () => clearTimeout(announceTimer.current), []);
|
|
2091
2250
|
const selectLabel = m.fileSelect ?? "\uD30C\uC77C \uC120\uD0DD";
|
|
2092
2251
|
const reasonText = (rejection) => {
|
|
2093
2252
|
const fileName2 = rejection.file.name;
|
|
@@ -2135,13 +2294,13 @@ var FileUpload = /* @__PURE__ */ forwardRef22(function FileUpload2(props, ref) {
|
|
|
2135
2294
|
setRejections([]);
|
|
2136
2295
|
commit(next, m.fileRemoved?.(removed.name) ?? `${removed.name} \uC0AD\uC81C\uB428`, REMOVED_ANNOUNCE_DELAY);
|
|
2137
2296
|
};
|
|
2138
|
-
|
|
2297
|
+
useEffect9(() => {
|
|
2139
2298
|
if (focusAfterRemove.current === null) return;
|
|
2140
2299
|
const target = focusAfterRemove.current;
|
|
2141
2300
|
focusAfterRemove.current = null;
|
|
2142
2301
|
(target >= 0 ? removeButtonRefs.current[target] : selectButtonRef.current)?.focus();
|
|
2143
2302
|
}, [files]);
|
|
2144
|
-
|
|
2303
|
+
useEffect9(() => {
|
|
2145
2304
|
const input6 = inputRef.current;
|
|
2146
2305
|
if (!name || !input6 || typeof DataTransfer === "undefined") return;
|
|
2147
2306
|
try {
|
|
@@ -2156,12 +2315,12 @@ var FileUpload = /* @__PURE__ */ forwardRef22(function FileUpload2(props, ref) {
|
|
|
2156
2315
|
event.preventDefault();
|
|
2157
2316
|
setDragging(over);
|
|
2158
2317
|
};
|
|
2159
|
-
return /* @__PURE__ */
|
|
2160
|
-
label6 && /* @__PURE__ */
|
|
2318
|
+
return /* @__PURE__ */ jsxs24("div", { ref, className: cx(field, root8, className), children: [
|
|
2319
|
+
label6 && /* @__PURE__ */ jsxs24("span", { id: labelId, className: label, children: [
|
|
2161
2320
|
label6,
|
|
2162
|
-
required && /* @__PURE__ */
|
|
2321
|
+
required && /* @__PURE__ */ jsx27("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
2163
2322
|
] }),
|
|
2164
|
-
/* @__PURE__ */
|
|
2323
|
+
/* @__PURE__ */ jsxs24(
|
|
2165
2324
|
"div",
|
|
2166
2325
|
{
|
|
2167
2326
|
role: "group",
|
|
@@ -2181,8 +2340,8 @@ var FileUpload = /* @__PURE__ */ forwardRef22(function FileUpload2(props, ref) {
|
|
|
2181
2340
|
if (!disabled) addFiles(Array.from(event.dataTransfer.files));
|
|
2182
2341
|
},
|
|
2183
2342
|
children: [
|
|
2184
|
-
/* @__PURE__ */
|
|
2185
|
-
/* @__PURE__ */
|
|
2343
|
+
/* @__PURE__ */ jsx27("span", { className: dropIcon, "aria-hidden": true, children: /* @__PURE__ */ jsx27(UploadIcon, { size: 24 }) }),
|
|
2344
|
+
/* @__PURE__ */ jsx27(
|
|
2186
2345
|
Button,
|
|
2187
2346
|
{
|
|
2188
2347
|
ref: selectButtonRef,
|
|
@@ -2195,8 +2354,8 @@ var FileUpload = /* @__PURE__ */ forwardRef22(function FileUpload2(props, ref) {
|
|
|
2195
2354
|
children: selectLabel
|
|
2196
2355
|
}
|
|
2197
2356
|
),
|
|
2198
|
-
/* @__PURE__ */
|
|
2199
|
-
/* @__PURE__ */
|
|
2357
|
+
/* @__PURE__ */ jsx27("span", { className: dropHint, children: m.fileDropHint ?? "\uB610\uB294 \uC5EC\uAE30\uB85C \uB04C\uC5B4\uB2E4 \uB193\uC73C\uC138\uC694" }),
|
|
2358
|
+
/* @__PURE__ */ jsx27(
|
|
2200
2359
|
"input",
|
|
2201
2360
|
{
|
|
2202
2361
|
ref: inputRef,
|
|
@@ -2219,11 +2378,11 @@ var FileUpload = /* @__PURE__ */ forwardRef22(function FileUpload2(props, ref) {
|
|
|
2219
2378
|
]
|
|
2220
2379
|
}
|
|
2221
2380
|
),
|
|
2222
|
-
files.length > 0 && /* @__PURE__ */
|
|
2223
|
-
/* @__PURE__ */
|
|
2224
|
-
/* @__PURE__ */
|
|
2225
|
-
/* @__PURE__ */
|
|
2226
|
-
/* @__PURE__ */
|
|
2381
|
+
files.length > 0 && /* @__PURE__ */ jsx27("ul", { "aria-label": m.fileList ?? "\uC120\uD0DD\uD55C \uD30C\uC77C", className: list4, children: files.map((file, index) => /* @__PURE__ */ jsxs24("li", { className: item5, children: [
|
|
2382
|
+
/* @__PURE__ */ jsx27("span", { className: fileIcon, "aria-hidden": true, children: /* @__PURE__ */ jsx27(FileIcon, { size: 16 }) }),
|
|
2383
|
+
/* @__PURE__ */ jsx27("span", { className: fileName, children: file.name }),
|
|
2384
|
+
/* @__PURE__ */ jsx27("span", { id: `${baseId}-size-${index}`, className: fileSize, children: formatSize(file.size) }),
|
|
2385
|
+
/* @__PURE__ */ jsx27(
|
|
2227
2386
|
IconButton,
|
|
2228
2387
|
{
|
|
2229
2388
|
ref: (node) => {
|
|
@@ -2234,20 +2393,20 @@ var FileUpload = /* @__PURE__ */ forwardRef22(function FileUpload2(props, ref) {
|
|
|
2234
2393
|
"aria-describedby": `${baseId}-size-${index}`,
|
|
2235
2394
|
disabled,
|
|
2236
2395
|
onClick: () => removeAt(index),
|
|
2237
|
-
children: /* @__PURE__ */
|
|
2396
|
+
children: /* @__PURE__ */ jsx27(XIcon6, {})
|
|
2238
2397
|
}
|
|
2239
2398
|
)
|
|
2240
2399
|
] }, `${file.name}-${file.size}-${file.lastModified}`)) }),
|
|
2241
|
-
rejections.length > 0 && /* @__PURE__ */
|
|
2242
|
-
helperText3 && /* @__PURE__ */
|
|
2243
|
-
/* @__PURE__ */
|
|
2400
|
+
rejections.length > 0 && /* @__PURE__ */ jsx27("ul", { id: errorsId, className: errors, children: [...new Set(rejections.map(reasonText))].map((text3) => /* @__PURE__ */ jsx27("li", { children: text3 }, text3)) }),
|
|
2401
|
+
helperText3 && /* @__PURE__ */ jsx27("p", { id: helperId, className: helperText({ error }), children: helperText3 }),
|
|
2402
|
+
/* @__PURE__ */ jsx27("div", { role: "status", className: visuallyHidden, children: announcement })
|
|
2244
2403
|
] });
|
|
2245
2404
|
});
|
|
2246
2405
|
|
|
2247
2406
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
2248
2407
|
import * as RadixMenu from "@radix-ui/react-dropdown-menu";
|
|
2249
2408
|
import { CheckIcon as CheckIcon2, ChevronRightIcon as ChevronRightIcon3, MinusIcon } from "@bestow-ui/icons";
|
|
2250
|
-
import { forwardRef as
|
|
2409
|
+
import { forwardRef as forwardRef24 } from "react";
|
|
2251
2410
|
|
|
2252
2411
|
// src/components/DropdownMenu/DropdownMenu.css.ts
|
|
2253
2412
|
var content9 = "_1d7ahux0";
|
|
@@ -2264,14 +2423,14 @@ var subChevron = "_1d7ahuxb";
|
|
|
2264
2423
|
var subTrigger = "_1d7ahuxa";
|
|
2265
2424
|
|
|
2266
2425
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
2267
|
-
import { jsx as
|
|
2426
|
+
import { jsx as jsx28, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2268
2427
|
var DropdownMenu = RadixMenu.Root;
|
|
2269
2428
|
var DropdownMenuTrigger = RadixMenu.Trigger;
|
|
2270
2429
|
var DropdownMenuGroup = RadixMenu.Group;
|
|
2271
|
-
var DropdownMenuContent = /* @__PURE__ */
|
|
2430
|
+
var DropdownMenuContent = /* @__PURE__ */ forwardRef24(
|
|
2272
2431
|
function DropdownMenuContent2({ className, style, side = "bottom", align = "start", sideOffset = 4, collisionPadding = 8, ...rest }, ref) {
|
|
2273
2432
|
const portal2 = usePortalProps();
|
|
2274
|
-
return /* @__PURE__ */
|
|
2433
|
+
return /* @__PURE__ */ jsx28(RadixMenu.Portal, { children: /* @__PURE__ */ jsx28(
|
|
2275
2434
|
RadixMenu.Content,
|
|
2276
2435
|
{
|
|
2277
2436
|
ref,
|
|
@@ -2286,56 +2445,56 @@ var DropdownMenuContent = /* @__PURE__ */ forwardRef23(
|
|
|
2286
2445
|
) });
|
|
2287
2446
|
}
|
|
2288
2447
|
);
|
|
2289
|
-
var DropdownMenuItem = /* @__PURE__ */
|
|
2448
|
+
var DropdownMenuItem = /* @__PURE__ */ forwardRef24(
|
|
2290
2449
|
function DropdownMenuItem2({ icon: icon7, shortcut: shortcut2, color = "neutral", className, children, ...rest }, ref) {
|
|
2291
|
-
return /* @__PURE__ */
|
|
2292
|
-
icon7 && /* @__PURE__ */
|
|
2450
|
+
return /* @__PURE__ */ jsxs25(RadixMenu.Item, { ref, className: cx(item6, color === "danger" && danger, className), ...rest, children: [
|
|
2451
|
+
icon7 && /* @__PURE__ */ jsx28("span", { className: icon4, "aria-hidden": true, children: icon7 }),
|
|
2293
2452
|
children,
|
|
2294
|
-
shortcut2 && /* @__PURE__ */
|
|
2453
|
+
shortcut2 && /* @__PURE__ */ jsx28("span", { className: shortcut, "aria-hidden": true, children: shortcut2 })
|
|
2295
2454
|
] });
|
|
2296
2455
|
}
|
|
2297
2456
|
);
|
|
2298
|
-
var DropdownMenuLabel = /* @__PURE__ */
|
|
2457
|
+
var DropdownMenuLabel = /* @__PURE__ */ forwardRef24(
|
|
2299
2458
|
function DropdownMenuLabel2({ className, ...rest }, ref) {
|
|
2300
|
-
return /* @__PURE__ */
|
|
2459
|
+
return /* @__PURE__ */ jsx28(RadixMenu.Label, { ref, className: cx(label2, className), ...rest });
|
|
2301
2460
|
}
|
|
2302
2461
|
);
|
|
2303
|
-
var DropdownMenuSeparator = /* @__PURE__ */
|
|
2462
|
+
var DropdownMenuSeparator = /* @__PURE__ */ forwardRef24(
|
|
2304
2463
|
function DropdownMenuSeparator2({ className, ...rest }, ref) {
|
|
2305
|
-
return /* @__PURE__ */
|
|
2464
|
+
return /* @__PURE__ */ jsx28(RadixMenu.Separator, { ref, className: cx(separator3, className), ...rest });
|
|
2306
2465
|
}
|
|
2307
2466
|
);
|
|
2308
|
-
var DropdownMenuCheckboxItem = /* @__PURE__ */
|
|
2467
|
+
var DropdownMenuCheckboxItem = /* @__PURE__ */ forwardRef24(
|
|
2309
2468
|
function DropdownMenuCheckboxItem2({ className, children, ...rest }, ref) {
|
|
2310
|
-
return /* @__PURE__ */
|
|
2311
|
-
/* @__PURE__ */
|
|
2469
|
+
return /* @__PURE__ */ jsxs25(RadixMenu.CheckboxItem, { ref, className: cx(item6, className), ...rest, children: [
|
|
2470
|
+
/* @__PURE__ */ jsx28("span", { className: indicator, "aria-hidden": true, children: /* @__PURE__ */ jsx28(RadixMenu.ItemIndicator, { className: indicatorInner, children: rest.checked === "indeterminate" ? /* @__PURE__ */ jsx28(MinusIcon, { size: 16 }) : /* @__PURE__ */ jsx28(CheckIcon2, { size: 16 }) }) }),
|
|
2312
2471
|
children
|
|
2313
2472
|
] });
|
|
2314
2473
|
}
|
|
2315
2474
|
);
|
|
2316
2475
|
var DropdownMenuRadioGroup = RadixMenu.RadioGroup;
|
|
2317
|
-
var DropdownMenuRadioItem = /* @__PURE__ */
|
|
2476
|
+
var DropdownMenuRadioItem = /* @__PURE__ */ forwardRef24(
|
|
2318
2477
|
function DropdownMenuRadioItem2({ className, children, ...rest }, ref) {
|
|
2319
|
-
return /* @__PURE__ */
|
|
2320
|
-
/* @__PURE__ */
|
|
2478
|
+
return /* @__PURE__ */ jsxs25(RadixMenu.RadioItem, { ref, className: cx(item6, className), ...rest, children: [
|
|
2479
|
+
/* @__PURE__ */ jsx28("span", { className: indicator, "aria-hidden": true, children: /* @__PURE__ */ jsx28(RadixMenu.ItemIndicator, { className: indicatorInner, children: /* @__PURE__ */ jsx28("span", { className: radioDot }) }) }),
|
|
2321
2480
|
children
|
|
2322
2481
|
] });
|
|
2323
2482
|
}
|
|
2324
2483
|
);
|
|
2325
2484
|
var DropdownMenuSub = RadixMenu.Sub;
|
|
2326
|
-
var DropdownMenuSubTrigger = /* @__PURE__ */
|
|
2485
|
+
var DropdownMenuSubTrigger = /* @__PURE__ */ forwardRef24(
|
|
2327
2486
|
function DropdownMenuSubTrigger2({ icon: icon7, className, children, ...rest }, ref) {
|
|
2328
|
-
return /* @__PURE__ */
|
|
2329
|
-
icon7 && /* @__PURE__ */
|
|
2487
|
+
return /* @__PURE__ */ jsxs25(RadixMenu.SubTrigger, { ref, className: cx(item6, subTrigger, className), ...rest, children: [
|
|
2488
|
+
icon7 && /* @__PURE__ */ jsx28("span", { className: icon4, "aria-hidden": true, children: icon7 }),
|
|
2330
2489
|
children,
|
|
2331
|
-
/* @__PURE__ */
|
|
2490
|
+
/* @__PURE__ */ jsx28("span", { className: subChevron, "aria-hidden": true, children: /* @__PURE__ */ jsx28(ChevronRightIcon3, { size: 16 }) })
|
|
2332
2491
|
] });
|
|
2333
2492
|
}
|
|
2334
2493
|
);
|
|
2335
|
-
var DropdownMenuSubContent = /* @__PURE__ */
|
|
2494
|
+
var DropdownMenuSubContent = /* @__PURE__ */ forwardRef24(
|
|
2336
2495
|
function DropdownMenuSubContent2({ className, style, sideOffset = 4, alignOffset = -5, collisionPadding = 8, ...rest }, ref) {
|
|
2337
2496
|
const portal2 = usePortalProps();
|
|
2338
|
-
return /* @__PURE__ */
|
|
2497
|
+
return /* @__PURE__ */ jsx28(RadixMenu.Portal, { children: /* @__PURE__ */ jsx28(
|
|
2339
2498
|
RadixMenu.SubContent,
|
|
2340
2499
|
{
|
|
2341
2500
|
ref,
|
|
@@ -2351,7 +2510,7 @@ var DropdownMenuSubContent = /* @__PURE__ */ forwardRef23(
|
|
|
2351
2510
|
);
|
|
2352
2511
|
|
|
2353
2512
|
// src/components/NumberInput/NumberInput.tsx
|
|
2354
|
-
import { forwardRef as
|
|
2513
|
+
import { forwardRef as forwardRef25, useEffect as useEffect10, useId as useId12, useRef as useRef12, useState as useState12 } from "react";
|
|
2355
2514
|
import { MinusIcon as MinusIcon2, PlusIcon } from "@bestow-ui/icons";
|
|
2356
2515
|
|
|
2357
2516
|
// src/components/NumberInput/NumberInput.css.ts
|
|
@@ -2362,12 +2521,12 @@ var stepper = /* @__PURE__ */ _7a46811({ defaultClassName: "_1vq2qhv3", variantC
|
|
|
2362
2521
|
var unit = "_1vq2qhv2";
|
|
2363
2522
|
|
|
2364
2523
|
// src/components/NumberInput/NumberInput.tsx
|
|
2365
|
-
import { Fragment as
|
|
2524
|
+
import { Fragment as Fragment7, jsx as jsx29, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2366
2525
|
var MAX_DIGITS2 = 15;
|
|
2367
2526
|
var isMeaningful = (char) => /[\d.-]/.test(char);
|
|
2368
2527
|
var decimalsOf = (n) => Number.isFinite(n) ? String(n).split(".")[1]?.length ?? 0 : 0;
|
|
2369
2528
|
var parse = (raw) => /\d/.test(raw) ? Number(raw) : null;
|
|
2370
|
-
var NumberInput = /* @__PURE__ */
|
|
2529
|
+
var NumberInput = /* @__PURE__ */ forwardRef25(
|
|
2371
2530
|
function NumberInput2(props, ref) {
|
|
2372
2531
|
const {
|
|
2373
2532
|
value: value3,
|
|
@@ -2394,7 +2553,7 @@ var NumberInput = /* @__PURE__ */ forwardRef24(
|
|
|
2394
2553
|
const isControlled = "value" in props;
|
|
2395
2554
|
const m = useMessages();
|
|
2396
2555
|
const inputRef = useRef12(null);
|
|
2397
|
-
const generatedId =
|
|
2556
|
+
const generatedId = useId12();
|
|
2398
2557
|
const inputId = id ?? generatedId;
|
|
2399
2558
|
const precision = Math.max(0, precisionProp ?? decimalsOf(step2));
|
|
2400
2559
|
const allowNegative = min === void 0 || min < 0;
|
|
@@ -2431,7 +2590,7 @@ var NumberInput = /* @__PURE__ */ forwardRef24(
|
|
|
2431
2590
|
inputRef
|
|
2432
2591
|
});
|
|
2433
2592
|
const { setRaw } = field4;
|
|
2434
|
-
|
|
2593
|
+
useEffect10(() => {
|
|
2435
2594
|
if (!isControlled) return;
|
|
2436
2595
|
const next = value3 ?? null;
|
|
2437
2596
|
lastEmitted.current = next;
|
|
@@ -2439,7 +2598,7 @@ var NumberInput = /* @__PURE__ */ forwardRef24(
|
|
|
2439
2598
|
}, [value3]);
|
|
2440
2599
|
const current2 = parse(field4.raw);
|
|
2441
2600
|
const valueText = (n) => `${format2(toRaw(n))}${unit2 ?? ""}`;
|
|
2442
|
-
const [announcement, setAnnouncement] =
|
|
2601
|
+
const [announcement, setAnnouncement] = useState12("");
|
|
2443
2602
|
const setValue = (next, announce = true) => {
|
|
2444
2603
|
setRaw(toRaw(next));
|
|
2445
2604
|
emit(next);
|
|
@@ -2473,7 +2632,7 @@ var NumberInput = /* @__PURE__ */ forwardRef24(
|
|
|
2473
2632
|
field4.onKeyDown(event);
|
|
2474
2633
|
}
|
|
2475
2634
|
};
|
|
2476
|
-
const stepper2 = (direction) => /* @__PURE__ */
|
|
2635
|
+
const stepper2 = (direction) => /* @__PURE__ */ jsx29(
|
|
2477
2636
|
IconButton,
|
|
2478
2637
|
{
|
|
2479
2638
|
size: "sm",
|
|
@@ -2484,11 +2643,11 @@ var NumberInput = /* @__PURE__ */ forwardRef24(
|
|
|
2484
2643
|
onMouseDown: (event) => event.preventDefault(),
|
|
2485
2644
|
onClick: () => stepBy(direction * step2),
|
|
2486
2645
|
className: stepper({ size }),
|
|
2487
|
-
children: direction < 0 ? /* @__PURE__ */
|
|
2646
|
+
children: direction < 0 ? /* @__PURE__ */ jsx29(MinusIcon2, {}) : /* @__PURE__ */ jsx29(PlusIcon, {})
|
|
2488
2647
|
}
|
|
2489
2648
|
);
|
|
2490
|
-
return /* @__PURE__ */
|
|
2491
|
-
/* @__PURE__ */
|
|
2649
|
+
return /* @__PURE__ */ jsxs26(Fragment7, { children: [
|
|
2650
|
+
/* @__PURE__ */ jsx29(
|
|
2492
2651
|
TextField,
|
|
2493
2652
|
{
|
|
2494
2653
|
ref: mergeRefs(ref, inputRef),
|
|
@@ -2516,23 +2675,23 @@ var NumberInput = /* @__PURE__ */ forwardRef24(
|
|
|
2516
2675
|
disabled,
|
|
2517
2676
|
readOnly,
|
|
2518
2677
|
startAdornment: hideStepper ? void 0 : stepper2(-1),
|
|
2519
|
-
endAdornment: unit2 || !hideStepper ? /* @__PURE__ */
|
|
2520
|
-
unit2 && /* @__PURE__ */
|
|
2678
|
+
endAdornment: unit2 || !hideStepper ? /* @__PURE__ */ jsxs26("span", { className: end, children: [
|
|
2679
|
+
unit2 && /* @__PURE__ */ jsx29("span", { className: unit, children: unit2 }),
|
|
2521
2680
|
!hideStepper && stepper2(1)
|
|
2522
2681
|
] }) : void 0,
|
|
2523
2682
|
className: cx(input4, className),
|
|
2524
2683
|
...rest
|
|
2525
2684
|
}
|
|
2526
2685
|
),
|
|
2527
|
-
name && /* @__PURE__ */
|
|
2528
|
-
/* @__PURE__ */
|
|
2686
|
+
name && /* @__PURE__ */ jsx29("input", { type: "hidden", name, value: current2 === null ? "" : String(current2) }),
|
|
2687
|
+
/* @__PURE__ */ jsx29("span", { "aria-live": "assertive", "aria-atomic": "true", className: visuallyHidden, children: announcement })
|
|
2529
2688
|
] });
|
|
2530
2689
|
}
|
|
2531
2690
|
);
|
|
2532
2691
|
|
|
2533
2692
|
// src/components/Pagination/Pagination.tsx
|
|
2534
2693
|
import { ChevronLeftIcon as ChevronLeftIcon2, ChevronRightIcon as ChevronRightIcon4 } from "@bestow-ui/icons";
|
|
2535
|
-
import { forwardRef as
|
|
2694
|
+
import { forwardRef as forwardRef26, useState as useState13 } from "react";
|
|
2536
2695
|
|
|
2537
2696
|
// src/components/Pagination/getPaginationItems.ts
|
|
2538
2697
|
var range = (start, end2) => end2 < start ? [] : Array.from({ length: end2 - start + 1 }, (_, i) => start + i);
|
|
@@ -2548,14 +2707,14 @@ function getPaginationItems(page, totalPages, siblingCount = 1, boundaryCount =
|
|
|
2548
2707
|
Math.max(page + siblingCount, boundaryCount + siblingCount * 2 + 2),
|
|
2549
2708
|
endPages.length > 0 ? endPages[0] - 2 : totalPages - 1
|
|
2550
2709
|
);
|
|
2551
|
-
const
|
|
2552
|
-
if (siblingsStart > boundaryCount + 2)
|
|
2553
|
-
else if (boundaryCount + 1 < totalPages - boundaryCount)
|
|
2554
|
-
|
|
2555
|
-
if (siblingsEnd < totalPages - boundaryCount - 1)
|
|
2556
|
-
else if (totalPages - boundaryCount > boundaryCount)
|
|
2557
|
-
|
|
2558
|
-
return
|
|
2710
|
+
const items3 = [...startPages];
|
|
2711
|
+
if (siblingsStart > boundaryCount + 2) items3.push("ellipsis-start");
|
|
2712
|
+
else if (boundaryCount + 1 < totalPages - boundaryCount) items3.push(boundaryCount + 1);
|
|
2713
|
+
items3.push(...range(siblingsStart, siblingsEnd));
|
|
2714
|
+
if (siblingsEnd < totalPages - boundaryCount - 1) items3.push("ellipsis-end");
|
|
2715
|
+
else if (totalPages - boundaryCount > boundaryCount) items3.push(totalPages - boundaryCount);
|
|
2716
|
+
items3.push(...endPages);
|
|
2717
|
+
return items3;
|
|
2559
2718
|
}
|
|
2560
2719
|
|
|
2561
2720
|
// src/components/Pagination/Pagination.css.ts
|
|
@@ -2565,8 +2724,8 @@ var item7 = /* @__PURE__ */ _7a46812({ defaultClassName: "_1iraoak1", variantCla
|
|
|
2565
2724
|
var list5 = "_1iraoak0";
|
|
2566
2725
|
|
|
2567
2726
|
// src/components/Pagination/Pagination.tsx
|
|
2568
|
-
import { jsx as
|
|
2569
|
-
var Pagination = /* @__PURE__ */
|
|
2727
|
+
import { jsx as jsx30, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2728
|
+
var Pagination = /* @__PURE__ */ forwardRef26(function Pagination2({
|
|
2570
2729
|
totalPages,
|
|
2571
2730
|
page: pageProp,
|
|
2572
2731
|
defaultPage = 1,
|
|
@@ -2579,7 +2738,7 @@ var Pagination = /* @__PURE__ */ forwardRef25(function Pagination2({
|
|
|
2579
2738
|
"aria-label": ariaLabelProp,
|
|
2580
2739
|
...rest
|
|
2581
2740
|
}, ref) {
|
|
2582
|
-
const [uncontrolledPage, setUncontrolledPage] =
|
|
2741
|
+
const [uncontrolledPage, setUncontrolledPage] = useState13(defaultPage);
|
|
2583
2742
|
const m = useMessages();
|
|
2584
2743
|
const ariaLabel = ariaLabelProp ?? m.pagination ?? "\uD398\uC774\uC9C0 \uD0D0\uC0C9";
|
|
2585
2744
|
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`);
|
|
@@ -2591,8 +2750,8 @@ var Pagination = /* @__PURE__ */ forwardRef25(function Pagination2({
|
|
|
2591
2750
|
onPageChange?.(next);
|
|
2592
2751
|
};
|
|
2593
2752
|
const itemClass = item7({ size });
|
|
2594
|
-
return /* @__PURE__ */
|
|
2595
|
-
/* @__PURE__ */
|
|
2753
|
+
return /* @__PURE__ */ jsx30("nav", { ref, "aria-label": ariaLabel, className, ...rest, children: /* @__PURE__ */ jsxs27("ul", { className: list5, children: [
|
|
2754
|
+
/* @__PURE__ */ jsx30("li", { children: /* @__PURE__ */ jsx30(
|
|
2596
2755
|
"button",
|
|
2597
2756
|
{
|
|
2598
2757
|
type: "button",
|
|
@@ -2600,11 +2759,11 @@ var Pagination = /* @__PURE__ */ forwardRef25(function Pagination2({
|
|
|
2600
2759
|
"aria-label": getItemLabel("previous", page - 1),
|
|
2601
2760
|
disabled: page <= 1,
|
|
2602
2761
|
onClick: () => goTo(page - 1),
|
|
2603
|
-
children: /* @__PURE__ */
|
|
2762
|
+
children: /* @__PURE__ */ jsx30(ChevronLeftIcon2, { size: 16 })
|
|
2604
2763
|
}
|
|
2605
2764
|
) }),
|
|
2606
2765
|
getPaginationItems(page, totalPages, siblingCount, boundaryCount).map(
|
|
2607
|
-
(item9) => typeof item9 === "number" ? /* @__PURE__ */
|
|
2766
|
+
(item9) => typeof item9 === "number" ? /* @__PURE__ */ jsx30("li", { children: /* @__PURE__ */ jsx30(
|
|
2608
2767
|
"button",
|
|
2609
2768
|
{
|
|
2610
2769
|
type: "button",
|
|
@@ -2614,9 +2773,9 @@ var Pagination = /* @__PURE__ */ forwardRef25(function Pagination2({
|
|
|
2614
2773
|
onClick: () => goTo(item9),
|
|
2615
2774
|
children: item9
|
|
2616
2775
|
}
|
|
2617
|
-
) }, item9) : /* @__PURE__ */
|
|
2776
|
+
) }, item9) : /* @__PURE__ */ jsx30("li", { "aria-hidden": true, className: cx(itemClass, ellipsis), children: "\u2026" }, item9)
|
|
2618
2777
|
),
|
|
2619
|
-
/* @__PURE__ */
|
|
2778
|
+
/* @__PURE__ */ jsx30("li", { children: /* @__PURE__ */ jsx30(
|
|
2620
2779
|
"button",
|
|
2621
2780
|
{
|
|
2622
2781
|
type: "button",
|
|
@@ -2624,22 +2783,22 @@ var Pagination = /* @__PURE__ */ forwardRef25(function Pagination2({
|
|
|
2624
2783
|
"aria-label": getItemLabel("next", page + 1),
|
|
2625
2784
|
disabled: page >= totalPages,
|
|
2626
2785
|
onClick: () => goTo(page + 1),
|
|
2627
|
-
children: /* @__PURE__ */
|
|
2786
|
+
children: /* @__PURE__ */ jsx30(ChevronRightIcon4, { size: 16 })
|
|
2628
2787
|
}
|
|
2629
2788
|
) })
|
|
2630
2789
|
] }) });
|
|
2631
2790
|
});
|
|
2632
2791
|
|
|
2633
2792
|
// src/components/PhoneNumberInput/PhoneNumberInput.tsx
|
|
2634
|
-
import { forwardRef as
|
|
2793
|
+
import { forwardRef as forwardRef27, useRef as useRef13 } from "react";
|
|
2635
2794
|
import { formatPhoneNumber, phoneNumberMaxDigits } from "@bestow-ui/korean-utils";
|
|
2636
|
-
import { jsx as
|
|
2795
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2637
2796
|
var sanitize3 = (input6) => {
|
|
2638
2797
|
const digits = input6.replace(/\D/g, "");
|
|
2639
2798
|
return digits.slice(0, phoneNumberMaxDigits(digits));
|
|
2640
2799
|
};
|
|
2641
2800
|
var isDigit4 = (char) => /\d/.test(char);
|
|
2642
|
-
var PhoneNumberInput = /* @__PURE__ */
|
|
2801
|
+
var PhoneNumberInput = /* @__PURE__ */ forwardRef27(
|
|
2643
2802
|
function PhoneNumberInput2(props, ref) {
|
|
2644
2803
|
const {
|
|
2645
2804
|
value: value3,
|
|
@@ -2663,7 +2822,7 @@ var PhoneNumberInput = /* @__PURE__ */ forwardRef26(
|
|
|
2663
2822
|
isMeaningful: isDigit4,
|
|
2664
2823
|
inputRef
|
|
2665
2824
|
});
|
|
2666
|
-
return /* @__PURE__ */
|
|
2825
|
+
return /* @__PURE__ */ jsx31(
|
|
2667
2826
|
TextField,
|
|
2668
2827
|
{
|
|
2669
2828
|
ref: mergeRefs(ref, inputRef),
|
|
@@ -2685,21 +2844,21 @@ var PhoneNumberInput = /* @__PURE__ */ forwardRef26(
|
|
|
2685
2844
|
);
|
|
2686
2845
|
|
|
2687
2846
|
// src/components/RadioGroup/RadioGroup.tsx
|
|
2688
|
-
import { forwardRef as
|
|
2847
|
+
import { forwardRef as forwardRef28, useId as useId13, useState as useState14 } from "react";
|
|
2689
2848
|
|
|
2690
2849
|
// src/components/RadioGroup/RadioGroup.css.ts
|
|
2691
2850
|
import { createRuntimeFn as _7a46813 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
2692
|
-
var
|
|
2693
|
-
var
|
|
2694
|
-
var
|
|
2851
|
+
var description5 = "_1w9iwjmc";
|
|
2852
|
+
var groupLabel2 = "_1w9iwjmd";
|
|
2853
|
+
var items2 = /* @__PURE__ */ _7a46813({ defaultClassName: "_1w9iwjm0", variantClassNames: { orientation: { vertical: "_1w9iwjm1", horizontal: "_1w9iwjm2" } }, defaultVariants: { orientation: "vertical" }, compoundVariants: [] });
|
|
2695
2854
|
var labelText = "_1w9iwjmb";
|
|
2696
|
-
var
|
|
2855
|
+
var option2 = /* @__PURE__ */ _7a46813({ defaultClassName: "_1w9iwjm3", variantClassNames: { size: { sm: "_1w9iwjm4", md: "_1w9iwjm5" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
2697
2856
|
var radio = /* @__PURE__ */ _7a46813({ defaultClassName: "_1w9iwjm7", variantClassNames: { size: { sm: "_1w9iwjm8", md: "_1w9iwjm9" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
2698
2857
|
var text = "_1w9iwjma";
|
|
2699
2858
|
|
|
2700
2859
|
// src/components/RadioGroup/RadioGroup.tsx
|
|
2701
|
-
import { jsx as
|
|
2702
|
-
var RadioGroup2 = /* @__PURE__ */
|
|
2860
|
+
import { jsx as jsx32, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2861
|
+
var RadioGroup2 = /* @__PURE__ */ forwardRef28(function RadioGroup3(props, ref) {
|
|
2703
2862
|
const {
|
|
2704
2863
|
options,
|
|
2705
2864
|
value: value3,
|
|
@@ -2718,9 +2877,9 @@ var RadioGroup2 = /* @__PURE__ */ forwardRef27(function RadioGroup3(props, ref)
|
|
|
2718
2877
|
className
|
|
2719
2878
|
} = props;
|
|
2720
2879
|
const isControlled = "value" in props;
|
|
2721
|
-
const [innerValue, setInnerValue] =
|
|
2880
|
+
const [innerValue, setInnerValue] = useState14(defaultValue ?? "");
|
|
2722
2881
|
const current2 = isControlled ? value3 ?? "" : innerValue;
|
|
2723
|
-
const generatedId =
|
|
2882
|
+
const generatedId = useId13();
|
|
2724
2883
|
const baseId = id ?? generatedId;
|
|
2725
2884
|
const labelId = label6 ? `${baseId}-label` : void 0;
|
|
2726
2885
|
const helperId = helperText3 ? `${baseId}-helper` : void 0;
|
|
@@ -2731,12 +2890,12 @@ var RadioGroup2 = /* @__PURE__ */ forwardRef27(function RadioGroup3(props, ref)
|
|
|
2731
2890
|
if (!isControlled) setInnerValue(next);
|
|
2732
2891
|
onValueChange?.(next);
|
|
2733
2892
|
};
|
|
2734
|
-
return /* @__PURE__ */
|
|
2735
|
-
label6 && /* @__PURE__ */
|
|
2893
|
+
return /* @__PURE__ */ jsxs28("div", { className: cx(field, className), children: [
|
|
2894
|
+
label6 && /* @__PURE__ */ jsxs28("span", { id: labelId, className: cx(label, groupLabel2), children: [
|
|
2736
2895
|
label6,
|
|
2737
|
-
required && /* @__PURE__ */
|
|
2896
|
+
required && /* @__PURE__ */ jsx32("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
2738
2897
|
] }),
|
|
2739
|
-
/* @__PURE__ */
|
|
2898
|
+
/* @__PURE__ */ jsx32(
|
|
2740
2899
|
"div",
|
|
2741
2900
|
{
|
|
2742
2901
|
ref,
|
|
@@ -2748,23 +2907,23 @@ var RadioGroup2 = /* @__PURE__ */ forwardRef27(function RadioGroup3(props, ref)
|
|
|
2748
2907
|
"aria-invalid": error || void 0,
|
|
2749
2908
|
"aria-required": required || void 0,
|
|
2750
2909
|
"data-disabled": disabled || void 0,
|
|
2751
|
-
className:
|
|
2752
|
-
children: options.map((
|
|
2753
|
-
const itemId = `${baseId}-${
|
|
2754
|
-
const descriptionId =
|
|
2755
|
-
const itemDisabled = disabled ||
|
|
2756
|
-
const checked =
|
|
2757
|
-
return /* @__PURE__ */
|
|
2758
|
-
/* @__PURE__ */
|
|
2910
|
+
className: items2({ orientation }),
|
|
2911
|
+
children: options.map((option3) => {
|
|
2912
|
+
const itemId = `${baseId}-${option3.value}`;
|
|
2913
|
+
const descriptionId = option3.description ? `${itemId}-description` : void 0;
|
|
2914
|
+
const itemDisabled = disabled || option3.disabled;
|
|
2915
|
+
const checked = option3.value === current2;
|
|
2916
|
+
return /* @__PURE__ */ jsxs28("div", { className: option2({ size }), "data-disabled": itemDisabled || void 0, children: [
|
|
2917
|
+
/* @__PURE__ */ jsx32(
|
|
2759
2918
|
"input",
|
|
2760
2919
|
{
|
|
2761
2920
|
type: "radio",
|
|
2762
2921
|
id: itemId,
|
|
2763
2922
|
name: groupName,
|
|
2764
2923
|
form: detachedForm,
|
|
2765
|
-
value:
|
|
2924
|
+
value: option3.value,
|
|
2766
2925
|
checked,
|
|
2767
|
-
onChange: () => handleChange(
|
|
2926
|
+
onChange: () => handleChange(option3.value),
|
|
2768
2927
|
disabled: itemDisabled,
|
|
2769
2928
|
required,
|
|
2770
2929
|
"aria-describedby": descriptionId,
|
|
@@ -2772,20 +2931,166 @@ var RadioGroup2 = /* @__PURE__ */ forwardRef27(function RadioGroup3(props, ref)
|
|
|
2772
2931
|
className: radio({ size })
|
|
2773
2932
|
}
|
|
2774
2933
|
),
|
|
2775
|
-
/* @__PURE__ */
|
|
2776
|
-
/* @__PURE__ */
|
|
2777
|
-
|
|
2934
|
+
/* @__PURE__ */ jsxs28("span", { className: text, children: [
|
|
2935
|
+
/* @__PURE__ */ jsx32("label", { htmlFor: itemId, className: labelText, children: option3.label }),
|
|
2936
|
+
option3.description && /* @__PURE__ */ jsx32("span", { id: descriptionId, className: description5, children: option3.description })
|
|
2778
2937
|
] })
|
|
2779
|
-
] },
|
|
2938
|
+
] }, option3.value);
|
|
2780
2939
|
})
|
|
2781
2940
|
}
|
|
2782
2941
|
),
|
|
2783
|
-
helperText3 && /* @__PURE__ */
|
|
2942
|
+
helperText3 && /* @__PURE__ */ jsx32("p", { id: helperId, className: helperText({ error }), children: helperText3 })
|
|
2784
2943
|
] });
|
|
2785
2944
|
});
|
|
2786
2945
|
|
|
2946
|
+
// src/components/ResidentNumberInput/ResidentNumberInput.tsx
|
|
2947
|
+
import { forwardRef as forwardRef29, useId as useId14, useRef as useRef14, useState as useState15 } from "react";
|
|
2948
|
+
import { isValidResidentNumber, parseResidentNumber } from "@bestow-ui/korean-utils";
|
|
2949
|
+
|
|
2950
|
+
// src/components/ResidentNumberInput/ResidentNumberInput.css.ts
|
|
2951
|
+
var back = "_1llmfr72";
|
|
2952
|
+
var backOne = "_1llmfr73";
|
|
2953
|
+
var front = "_1llmfr71";
|
|
2954
|
+
var hiddenDigits = "_1llmfr75";
|
|
2955
|
+
var row3 = "_1llmfr70";
|
|
2956
|
+
var separator4 = "_1llmfr74";
|
|
2957
|
+
|
|
2958
|
+
// src/components/ResidentNumberInput/ResidentNumberInput.tsx
|
|
2959
|
+
import { jsx as jsx33, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2960
|
+
var onlyDigits = (input6) => input6.replace(/\D/g, "");
|
|
2961
|
+
var ResidentNumberInput = /* @__PURE__ */ forwardRef29(
|
|
2962
|
+
function ResidentNumberInput2(props, ref) {
|
|
2963
|
+
const {
|
|
2964
|
+
value: value3,
|
|
2965
|
+
defaultValue,
|
|
2966
|
+
onValueChange,
|
|
2967
|
+
digits = 13,
|
|
2968
|
+
validate = true,
|
|
2969
|
+
invalidText: invalidTextProp,
|
|
2970
|
+
label: labelProp,
|
|
2971
|
+
helperText: helperText3,
|
|
2972
|
+
error,
|
|
2973
|
+
required,
|
|
2974
|
+
disabled,
|
|
2975
|
+
size,
|
|
2976
|
+
name,
|
|
2977
|
+
id,
|
|
2978
|
+
className,
|
|
2979
|
+
onBlur
|
|
2980
|
+
} = props;
|
|
2981
|
+
const m = useMessages();
|
|
2982
|
+
const label6 = labelProp ?? m.residentNumber ?? "\uC8FC\uBBFC\uB4F1\uB85D\uBC88\uD638";
|
|
2983
|
+
const invalidText = invalidTextProp ?? m.residentNumberInvalid ?? "\uC62C\uBC14\uB978 \uC8FC\uBBFC\uB4F1\uB85D\uBC88\uD638\uAC00 \uC544\uB2C8\uC5D0\uC694. \uC0DD\uB144\uC6D4\uC77C\uACFC \uB4B7\uC790\uB9AC \uCCAB \uC22B\uC790\uB97C \uD655\uC778\uD574 \uC8FC\uC138\uC694.";
|
|
2984
|
+
const incompleteText = m.residentNumberIncomplete?.(digits) ?? `${digits}\uC790\uB9AC\uB97C \uBAA8\uB450 \uC785\uB825\uD574 \uC8FC\uC138\uC694.`;
|
|
2985
|
+
const backLength = digits - 6;
|
|
2986
|
+
const isControlled = "value" in props;
|
|
2987
|
+
const split = (v) => {
|
|
2988
|
+
const d = onlyDigits(v).slice(0, digits);
|
|
2989
|
+
return { front: d.slice(0, 6), back: d.slice(6) };
|
|
2990
|
+
};
|
|
2991
|
+
const [parts, setParts] = useState15(() => split((isControlled ? value3 : defaultValue) ?? ""));
|
|
2992
|
+
const current2 = isControlled && (value3 ?? "") !== parts.front + parts.back ? split(value3 ?? "") : parts;
|
|
2993
|
+
const raw = current2.front + current2.back;
|
|
2994
|
+
const generatedId = useId14();
|
|
2995
|
+
const baseId = id ?? generatedId;
|
|
2996
|
+
const frontId = `${baseId}-front`;
|
|
2997
|
+
const backId = `${baseId}-back`;
|
|
2998
|
+
const labelId = `${baseId}-label`;
|
|
2999
|
+
const frontRef = useRef14(null);
|
|
3000
|
+
const backRef = useRef14(null);
|
|
3001
|
+
const complete = current2.front.length === 6 && current2.back.length === backLength;
|
|
3002
|
+
const isValid = (v) => digits === 13 ? isValidResidentNumber(v) : parseResidentNumber(v) !== null;
|
|
3003
|
+
const update = (next) => {
|
|
3004
|
+
setParts(next);
|
|
3005
|
+
const nextRaw = next.front + next.back;
|
|
3006
|
+
if (nextRaw === raw) return;
|
|
3007
|
+
const nextComplete = next.front.length === 6 && next.back.length === backLength;
|
|
3008
|
+
onValueChange?.(nextRaw, nextComplete ? isValid(nextRaw) : null);
|
|
3009
|
+
};
|
|
3010
|
+
const [touched, setTouched] = useState15(false);
|
|
3011
|
+
const autoInvalid = validate && raw.length > 0 && (complete ? !isValid(raw) : touched);
|
|
3012
|
+
const showAuto = autoInvalid && error === void 0;
|
|
3013
|
+
const invalid = error ?? autoInvalid;
|
|
3014
|
+
const helper = showAuto ? complete ? invalidText : incompleteText : helperText3;
|
|
3015
|
+
const helperId = helper ? `${baseId}-helper` : void 0;
|
|
3016
|
+
const announcement = useDelayedAnnouncement(showAuto && complete ? invalidText : "");
|
|
3017
|
+
const common = {
|
|
3018
|
+
inputMode: "numeric",
|
|
3019
|
+
autoComplete: "off",
|
|
3020
|
+
size,
|
|
3021
|
+
disabled,
|
|
3022
|
+
required,
|
|
3023
|
+
invalid,
|
|
3024
|
+
"aria-describedby": helperId
|
|
3025
|
+
};
|
|
3026
|
+
return /* @__PURE__ */ jsxs29(
|
|
3027
|
+
"div",
|
|
3028
|
+
{
|
|
3029
|
+
className: cx(field, className),
|
|
3030
|
+
onBlur: (event) => {
|
|
3031
|
+
if (!event.currentTarget.contains(event.relatedTarget)) setTouched(true);
|
|
3032
|
+
onBlur?.(event);
|
|
3033
|
+
},
|
|
3034
|
+
children: [
|
|
3035
|
+
/* @__PURE__ */ jsxs29("label", { id: labelId, htmlFor: frontId, className: label, children: [
|
|
3036
|
+
label6,
|
|
3037
|
+
required && /* @__PURE__ */ jsx33("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
3038
|
+
] }),
|
|
3039
|
+
/* @__PURE__ */ jsxs29("div", { role: "group", id: baseId, "aria-labelledby": labelId, className: row3, children: [
|
|
3040
|
+
/* @__PURE__ */ jsx33(
|
|
3041
|
+
Input,
|
|
3042
|
+
{
|
|
3043
|
+
...common,
|
|
3044
|
+
ref: mergeRefs(ref, frontRef),
|
|
3045
|
+
id: frontId,
|
|
3046
|
+
"aria-label": m.residentNumberFront ?? "\uC55E 6\uC790\uB9AC",
|
|
3047
|
+
placeholder: "000000",
|
|
3048
|
+
rootClassName: front,
|
|
3049
|
+
maxLength: 6,
|
|
3050
|
+
value: current2.front,
|
|
3051
|
+
onChange: (event) => update({ front: onlyDigits(event.target.value).slice(0, 6), back: current2.back }),
|
|
3052
|
+
onPaste: (event) => {
|
|
3053
|
+
const pasted = onlyDigits(event.clipboardData.getData("text"));
|
|
3054
|
+
if (pasted.length <= 6) return;
|
|
3055
|
+
event.preventDefault();
|
|
3056
|
+
update(split(pasted));
|
|
3057
|
+
}
|
|
3058
|
+
}
|
|
3059
|
+
),
|
|
3060
|
+
/* @__PURE__ */ jsx33("span", { className: separator4, "aria-hidden": true, children: "-" }),
|
|
3061
|
+
/* @__PURE__ */ jsx33(
|
|
3062
|
+
Input,
|
|
3063
|
+
{
|
|
3064
|
+
...common,
|
|
3065
|
+
ref: backRef,
|
|
3066
|
+
id: backId,
|
|
3067
|
+
type: digits === 13 ? "password" : "text",
|
|
3068
|
+
"aria-label": digits === 13 ? m.residentNumberBack ?? "\uB4A4 7\uC790\uB9AC" : m.residentNumberBackFirst ?? "\uB4B7\uC790\uB9AC \uCCAB \uC22B\uC790",
|
|
3069
|
+
maxLength: backLength,
|
|
3070
|
+
rootClassName: digits === 13 ? back : backOne,
|
|
3071
|
+
value: current2.back,
|
|
3072
|
+
onChange: (event) => update({ front: current2.front, back: onlyDigits(event.target.value).slice(0, backLength) }),
|
|
3073
|
+
onKeyDown: (event) => {
|
|
3074
|
+
if (event.key === "Backspace" && current2.back === "") {
|
|
3075
|
+
event.preventDefault();
|
|
3076
|
+
frontRef.current?.focus();
|
|
3077
|
+
}
|
|
3078
|
+
}
|
|
3079
|
+
}
|
|
3080
|
+
),
|
|
3081
|
+
digits === 7 && /* @__PURE__ */ jsx33("span", { className: hiddenDigits, "aria-hidden": true, children: "\u25CF\u25CF\u25CF\u25CF\u25CF\u25CF" })
|
|
3082
|
+
] }),
|
|
3083
|
+
helper && /* @__PURE__ */ jsx33("p", { id: helperId, className: helperText({ error: invalid }), children: helper }),
|
|
3084
|
+
name && /* @__PURE__ */ jsx33("input", { type: "hidden", name, value: raw }),
|
|
3085
|
+
/* @__PURE__ */ jsx33("span", { role: "status", className: visuallyHidden, children: announcement })
|
|
3086
|
+
]
|
|
3087
|
+
}
|
|
3088
|
+
);
|
|
3089
|
+
}
|
|
3090
|
+
);
|
|
3091
|
+
|
|
2787
3092
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
2788
|
-
import { forwardRef as
|
|
3093
|
+
import { forwardRef as forwardRef30, useId as useId15, useRef as useRef15, useState as useState16 } from "react";
|
|
2789
3094
|
|
|
2790
3095
|
// src/components/SegmentedControl/SegmentedControl.css.ts
|
|
2791
3096
|
import { createRuntimeFn as _7a46814 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
@@ -2794,9 +3099,9 @@ var item8 = /* @__PURE__ */ _7a46814({ defaultClassName: "_1h65mmo2", variantCla
|
|
|
2794
3099
|
var root9 = /* @__PURE__ */ _7a46814({ defaultClassName: "_1h65mmo0", variantClassNames: { fullWidth: { true: "_1h65mmo1" } }, defaultVariants: {}, compoundVariants: [] });
|
|
2795
3100
|
|
|
2796
3101
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
2797
|
-
import { jsx as
|
|
3102
|
+
import { jsx as jsx34, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2798
3103
|
var NEXT_KEYS = { ArrowRight: 1, ArrowDown: 1, ArrowLeft: -1, ArrowUp: -1 };
|
|
2799
|
-
var SegmentedControl = /* @__PURE__ */
|
|
3104
|
+
var SegmentedControl = /* @__PURE__ */ forwardRef30(
|
|
2800
3105
|
function SegmentedControl2(props, ref) {
|
|
2801
3106
|
const {
|
|
2802
3107
|
options,
|
|
@@ -2813,11 +3118,11 @@ var SegmentedControl = /* @__PURE__ */ forwardRef28(
|
|
|
2813
3118
|
className
|
|
2814
3119
|
} = props;
|
|
2815
3120
|
const isControlled = "value" in props;
|
|
2816
|
-
const [innerValue, setInnerValue] =
|
|
3121
|
+
const [innerValue, setInnerValue] = useState16(defaultValue ?? "");
|
|
2817
3122
|
const current2 = isControlled ? value3 ?? "" : innerValue;
|
|
2818
|
-
const generatedId =
|
|
3123
|
+
const generatedId = useId15();
|
|
2819
3124
|
const labelId = label6 ? `${id ?? generatedId}-label` : void 0;
|
|
2820
|
-
const itemRefs =
|
|
3125
|
+
const itemRefs = useRef15([]);
|
|
2821
3126
|
const isEnabled = (index) => !disabled && !options[index]?.disabled;
|
|
2822
3127
|
const select2 = (index) => {
|
|
2823
3128
|
const next = options[index].value;
|
|
@@ -2825,7 +3130,7 @@ var SegmentedControl = /* @__PURE__ */ forwardRef28(
|
|
|
2825
3130
|
if (!isControlled) setInnerValue(next);
|
|
2826
3131
|
onValueChange?.(next);
|
|
2827
3132
|
};
|
|
2828
|
-
const checkedIndex = options.findIndex((
|
|
3133
|
+
const checkedIndex = options.findIndex((option3) => option3.value === current2);
|
|
2829
3134
|
const tabStop = checkedIndex >= 0 && isEnabled(checkedIndex) ? checkedIndex : options.findIndex((_, i) => isEnabled(i));
|
|
2830
3135
|
const handleKeyDown = (event, index) => {
|
|
2831
3136
|
let target = -1;
|
|
@@ -2848,7 +3153,7 @@ var SegmentedControl = /* @__PURE__ */ forwardRef28(
|
|
|
2848
3153
|
itemRefs.current[target]?.focus();
|
|
2849
3154
|
select2(target);
|
|
2850
3155
|
};
|
|
2851
|
-
const group = /* @__PURE__ */
|
|
3156
|
+
const group = /* @__PURE__ */ jsxs30(
|
|
2852
3157
|
"div",
|
|
2853
3158
|
{
|
|
2854
3159
|
ref,
|
|
@@ -2859,9 +3164,9 @@ var SegmentedControl = /* @__PURE__ */ forwardRef28(
|
|
|
2859
3164
|
"aria-disabled": disabled || void 0,
|
|
2860
3165
|
className: cx(root9({ fullWidth }), !label6 && className),
|
|
2861
3166
|
children: [
|
|
2862
|
-
options.map((
|
|
3167
|
+
options.map((option3, index) => {
|
|
2863
3168
|
const checked = index === checkedIndex;
|
|
2864
|
-
return /* @__PURE__ */
|
|
3169
|
+
return /* @__PURE__ */ jsxs30(
|
|
2865
3170
|
"button",
|
|
2866
3171
|
{
|
|
2867
3172
|
ref: (node) => {
|
|
@@ -2878,27 +3183,27 @@ var SegmentedControl = /* @__PURE__ */ forwardRef28(
|
|
|
2878
3183
|
onClick: () => select2(index),
|
|
2879
3184
|
onKeyDown: (event) => handleKeyDown(event, index),
|
|
2880
3185
|
children: [
|
|
2881
|
-
|
|
2882
|
-
|
|
3186
|
+
option3.icon && /* @__PURE__ */ jsx34("span", { "aria-hidden": true, className: icon5, children: option3.icon }),
|
|
3187
|
+
option3.label
|
|
2883
3188
|
]
|
|
2884
3189
|
},
|
|
2885
|
-
|
|
3190
|
+
option3.value
|
|
2886
3191
|
);
|
|
2887
3192
|
}),
|
|
2888
|
-
name && /* @__PURE__ */
|
|
3193
|
+
name && /* @__PURE__ */ jsx34("input", { type: "hidden", name, value: current2 })
|
|
2889
3194
|
]
|
|
2890
3195
|
}
|
|
2891
3196
|
);
|
|
2892
3197
|
if (!label6) return group;
|
|
2893
|
-
return /* @__PURE__ */
|
|
2894
|
-
/* @__PURE__ */
|
|
3198
|
+
return /* @__PURE__ */ jsxs30("div", { className: cx(field, className), children: [
|
|
3199
|
+
/* @__PURE__ */ jsx34("span", { id: labelId, className: label, children: label6 }),
|
|
2895
3200
|
group
|
|
2896
3201
|
] });
|
|
2897
3202
|
}
|
|
2898
3203
|
);
|
|
2899
3204
|
|
|
2900
3205
|
// src/components/NativeSelect/NativeSelect.tsx
|
|
2901
|
-
import { forwardRef as
|
|
3206
|
+
import { forwardRef as forwardRef31, useId as useId16 } from "react";
|
|
2902
3207
|
import { ChevronDownIcon as ChevronDownIcon4 } from "@bestow-ui/icons";
|
|
2903
3208
|
|
|
2904
3209
|
// src/components/NativeSelect/NativeSelect.css.ts
|
|
@@ -2908,8 +3213,8 @@ var select = /* @__PURE__ */ _7a46815({ defaultClassName: "_5silym1", variantCla
|
|
|
2908
3213
|
var wrapper = "_5silym0";
|
|
2909
3214
|
|
|
2910
3215
|
// src/components/NativeSelect/NativeSelect.tsx
|
|
2911
|
-
import { jsx as
|
|
2912
|
-
var NativeSelect = /* @__PURE__ */
|
|
3216
|
+
import { jsx as jsx35, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3217
|
+
var NativeSelect = /* @__PURE__ */ forwardRef31(function NativeSelect2({
|
|
2913
3218
|
options,
|
|
2914
3219
|
onValueChange,
|
|
2915
3220
|
onChange,
|
|
@@ -2929,26 +3234,26 @@ var NativeSelect = /* @__PURE__ */ forwardRef29(function NativeSelect2({
|
|
|
2929
3234
|
"aria-describedby": ariaDescribedBy,
|
|
2930
3235
|
...rest
|
|
2931
3236
|
}, ref) {
|
|
2932
|
-
const generatedId =
|
|
3237
|
+
const generatedId = useId16();
|
|
2933
3238
|
const selectId = id ?? generatedId;
|
|
2934
3239
|
const helperId = helperText3 ? `${selectId}-helper` : void 0;
|
|
2935
3240
|
const handleChange = (event) => {
|
|
2936
3241
|
onChange?.(event);
|
|
2937
3242
|
onValueChange?.(event.target.value);
|
|
2938
3243
|
};
|
|
2939
|
-
return /* @__PURE__ */
|
|
2940
|
-
label6 && /* @__PURE__ */
|
|
3244
|
+
return /* @__PURE__ */ jsxs31("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
|
|
3245
|
+
label6 && /* @__PURE__ */ jsxs31("label", { htmlFor: selectId, className: label, children: [
|
|
2941
3246
|
label6,
|
|
2942
|
-
required && /* @__PURE__ */
|
|
3247
|
+
required && /* @__PURE__ */ jsx35("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
2943
3248
|
] }),
|
|
2944
|
-
/* @__PURE__ */
|
|
3249
|
+
/* @__PURE__ */ jsxs31(
|
|
2945
3250
|
"span",
|
|
2946
3251
|
{
|
|
2947
|
-
className: cx(
|
|
3252
|
+
className: cx(root({ size, fullWidth }), wrapper),
|
|
2948
3253
|
"data-invalid": error || void 0,
|
|
2949
3254
|
"data-disabled": disabled || void 0,
|
|
2950
3255
|
children: [
|
|
2951
|
-
/* @__PURE__ */
|
|
3256
|
+
/* @__PURE__ */ jsxs31(
|
|
2952
3257
|
"select",
|
|
2953
3258
|
{
|
|
2954
3259
|
ref,
|
|
@@ -2963,25 +3268,25 @@ var NativeSelect = /* @__PURE__ */ forwardRef29(function NativeSelect2({
|
|
|
2963
3268
|
className: cx(select({ size }), className),
|
|
2964
3269
|
...rest,
|
|
2965
3270
|
children: [
|
|
2966
|
-
placeholder !== void 0 && /* @__PURE__ */
|
|
2967
|
-
options ? options.map((
|
|
3271
|
+
placeholder !== void 0 && /* @__PURE__ */ jsx35("option", { value: "", disabled: true, children: placeholder }),
|
|
3272
|
+
options ? options.map((option3) => /* @__PURE__ */ jsx35("option", { value: option3.value, disabled: option3.disabled, children: option3.label }, option3.value)) : children
|
|
2968
3273
|
]
|
|
2969
3274
|
}
|
|
2970
3275
|
),
|
|
2971
|
-
/* @__PURE__ */
|
|
3276
|
+
/* @__PURE__ */ jsx35(ChevronDownIcon4, { size: 16, className: icon6({ size }) })
|
|
2972
3277
|
]
|
|
2973
3278
|
}
|
|
2974
3279
|
),
|
|
2975
|
-
helperText3 && /* @__PURE__ */
|
|
3280
|
+
helperText3 && /* @__PURE__ */ jsx35("p", { id: helperId, className: helperText({ error }), children: helperText3 })
|
|
2976
3281
|
] });
|
|
2977
3282
|
});
|
|
2978
3283
|
|
|
2979
3284
|
// src/components/Select/Select.tsx
|
|
2980
3285
|
import * as RadixSelect from "@radix-ui/react-select";
|
|
2981
|
-
import { forwardRef as
|
|
3286
|
+
import { forwardRef as forwardRef32, useId as useId17 } from "react";
|
|
2982
3287
|
import { CheckIcon as CheckIcon3, ChevronDownIcon as ChevronDownIcon5 } from "@bestow-ui/icons";
|
|
2983
|
-
import { jsx as
|
|
2984
|
-
var Select = /* @__PURE__ */
|
|
3288
|
+
import { jsx as jsx36, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3289
|
+
var Select = /* @__PURE__ */ forwardRef32(function Select2(props, ref) {
|
|
2985
3290
|
const {
|
|
2986
3291
|
options,
|
|
2987
3292
|
value: value3,
|
|
@@ -3001,16 +3306,16 @@ var Select = /* @__PURE__ */ forwardRef30(function Select2(props, ref) {
|
|
|
3001
3306
|
className
|
|
3002
3307
|
} = props;
|
|
3003
3308
|
const isControlled = "value" in props;
|
|
3004
|
-
const generatedId =
|
|
3309
|
+
const generatedId = useId17();
|
|
3005
3310
|
const triggerId = id ?? generatedId;
|
|
3006
3311
|
const helperId = helperText3 ? `${triggerId}-helper` : void 0;
|
|
3007
3312
|
const portal2 = usePortalProps();
|
|
3008
|
-
return /* @__PURE__ */
|
|
3009
|
-
label6 && /* @__PURE__ */
|
|
3313
|
+
return /* @__PURE__ */ jsxs32("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
|
|
3314
|
+
label6 && /* @__PURE__ */ jsxs32("label", { htmlFor: triggerId, className: label, children: [
|
|
3010
3315
|
label6,
|
|
3011
|
-
required && /* @__PURE__ */
|
|
3316
|
+
required && /* @__PURE__ */ jsx36("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
3012
3317
|
] }),
|
|
3013
|
-
/* @__PURE__ */
|
|
3318
|
+
/* @__PURE__ */ jsxs32(
|
|
3014
3319
|
RadixSelect.Root,
|
|
3015
3320
|
{
|
|
3016
3321
|
value: isControlled ? value3 ?? "" : void 0,
|
|
@@ -3020,7 +3325,7 @@ var Select = /* @__PURE__ */ forwardRef30(function Select2(props, ref) {
|
|
|
3020
3325
|
required,
|
|
3021
3326
|
name,
|
|
3022
3327
|
children: [
|
|
3023
|
-
/* @__PURE__ */
|
|
3328
|
+
/* @__PURE__ */ jsxs32(
|
|
3024
3329
|
RadixSelect.Trigger,
|
|
3025
3330
|
{
|
|
3026
3331
|
ref,
|
|
@@ -3029,14 +3334,14 @@ var Select = /* @__PURE__ */ forwardRef30(function Select2(props, ref) {
|
|
|
3029
3334
|
"aria-invalid": error || void 0,
|
|
3030
3335
|
"aria-describedby": helperId,
|
|
3031
3336
|
"data-invalid": error || void 0,
|
|
3032
|
-
className: cx(
|
|
3337
|
+
className: cx(root({ size, fullWidth }), trigger2, className),
|
|
3033
3338
|
children: [
|
|
3034
|
-
/* @__PURE__ */
|
|
3035
|
-
/* @__PURE__ */
|
|
3339
|
+
/* @__PURE__ */ jsx36("span", { className: value, children: /* @__PURE__ */ jsx36(RadixSelect.Value, { placeholder }) }),
|
|
3340
|
+
/* @__PURE__ */ jsx36(RadixSelect.Icon, { className: icon3, children: /* @__PURE__ */ jsx36(ChevronDownIcon5, { size: 16 }) })
|
|
3036
3341
|
]
|
|
3037
3342
|
}
|
|
3038
3343
|
),
|
|
3039
|
-
/* @__PURE__ */
|
|
3344
|
+
/* @__PURE__ */ jsx36(RadixSelect.Portal, { children: /* @__PURE__ */ jsx36(
|
|
3040
3345
|
RadixSelect.Content,
|
|
3041
3346
|
{
|
|
3042
3347
|
position: "popper",
|
|
@@ -3044,37 +3349,37 @@ var Select = /* @__PURE__ */ forwardRef30(function Select2(props, ref) {
|
|
|
3044
3349
|
collisionPadding: 8,
|
|
3045
3350
|
className: cx(portal2.className, content5),
|
|
3046
3351
|
style: portal2.style,
|
|
3047
|
-
children: /* @__PURE__ */
|
|
3352
|
+
children: /* @__PURE__ */ jsx36(RadixSelect.Viewport, { className: viewport, children: options.map((option3) => /* @__PURE__ */ jsxs32(
|
|
3048
3353
|
RadixSelect.Item,
|
|
3049
3354
|
{
|
|
3050
|
-
value:
|
|
3051
|
-
disabled:
|
|
3355
|
+
value: option3.value,
|
|
3356
|
+
disabled: option3.disabled,
|
|
3052
3357
|
className: item4,
|
|
3053
3358
|
children: [
|
|
3054
|
-
/* @__PURE__ */
|
|
3055
|
-
/* @__PURE__ */
|
|
3359
|
+
/* @__PURE__ */ jsx36(RadixSelect.ItemText, { children: option3.label }),
|
|
3360
|
+
/* @__PURE__ */ jsx36(RadixSelect.ItemIndicator, { className: itemIndicator, children: /* @__PURE__ */ jsx36(CheckIcon3, { size: 16 }) })
|
|
3056
3361
|
]
|
|
3057
3362
|
},
|
|
3058
|
-
|
|
3363
|
+
option3.value
|
|
3059
3364
|
)) })
|
|
3060
3365
|
}
|
|
3061
3366
|
) })
|
|
3062
3367
|
]
|
|
3063
3368
|
}
|
|
3064
3369
|
),
|
|
3065
|
-
helperText3 && /* @__PURE__ */
|
|
3370
|
+
helperText3 && /* @__PURE__ */ jsx36("p", { id: helperId, className: helperText({ error }), children: helperText3 })
|
|
3066
3371
|
] });
|
|
3067
3372
|
});
|
|
3068
3373
|
|
|
3069
3374
|
// src/components/SkipLink/SkipLink.tsx
|
|
3070
|
-
import { forwardRef as
|
|
3375
|
+
import { forwardRef as forwardRef33 } from "react";
|
|
3071
3376
|
|
|
3072
3377
|
// src/components/SkipLink/SkipLink.css.ts
|
|
3073
3378
|
var skipLink = "_1t9jaar0";
|
|
3074
3379
|
|
|
3075
3380
|
// src/components/SkipLink/SkipLink.tsx
|
|
3076
|
-
import { jsx as
|
|
3077
|
-
var SkipLink = /* @__PURE__ */
|
|
3381
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
3382
|
+
var SkipLink = /* @__PURE__ */ forwardRef33(function SkipLink2({ href = "#main", className, children, onClick, ...rest }, ref) {
|
|
3078
3383
|
const m = useMessages();
|
|
3079
3384
|
const handleClick = (event) => {
|
|
3080
3385
|
onClick?.(event);
|
|
@@ -3086,12 +3391,12 @@ var SkipLink = /* @__PURE__ */ forwardRef31(function SkipLink2({ href = "#main",
|
|
|
3086
3391
|
target.focus();
|
|
3087
3392
|
target.scrollIntoView?.({ block: "start" });
|
|
3088
3393
|
};
|
|
3089
|
-
return /* @__PURE__ */
|
|
3394
|
+
return /* @__PURE__ */ jsx37("a", { ref, href, className: cx(skipLink, className), onClick: handleClick, ...rest, children: children ?? m.skipToContent ?? "\uBCF8\uBB38 \uBC14\uB85C\uAC00\uAE30" });
|
|
3090
3395
|
});
|
|
3091
3396
|
|
|
3092
3397
|
// src/components/Slider/Slider.tsx
|
|
3093
3398
|
import * as RadixSlider from "@radix-ui/react-slider";
|
|
3094
|
-
import { forwardRef as
|
|
3399
|
+
import { forwardRef as forwardRef34, useId as useId18, useState as useState17 } from "react";
|
|
3095
3400
|
|
|
3096
3401
|
// src/components/Slider/Slider.css.ts
|
|
3097
3402
|
import { createRuntimeFn as _7a46816 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
@@ -3106,8 +3411,8 @@ var track = /* @__PURE__ */ _7a46816({ defaultClassName: "_126mzjm8", variantCla
|
|
|
3106
3411
|
var value2 = "_126mzjm3";
|
|
3107
3412
|
|
|
3108
3413
|
// src/components/Slider/Slider.tsx
|
|
3109
|
-
import { jsx as
|
|
3110
|
-
var Slider = /* @__PURE__ */
|
|
3414
|
+
import { jsx as jsx38, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
3415
|
+
var Slider = /* @__PURE__ */ forwardRef34(function Slider2(props, ref) {
|
|
3111
3416
|
const {
|
|
3112
3417
|
value: value3,
|
|
3113
3418
|
defaultValue,
|
|
@@ -3128,12 +3433,12 @@ var Slider = /* @__PURE__ */ forwardRef32(function Slider2(props, ref) {
|
|
|
3128
3433
|
} = props;
|
|
3129
3434
|
const m = useMessages();
|
|
3130
3435
|
const thumbLabels = thumbLabelsProp ?? [m.rangeStart ?? "\uCD5C\uC18C", m.rangeEnd ?? "\uCD5C\uB300"];
|
|
3131
|
-
const generatedId =
|
|
3436
|
+
const generatedId = useId18();
|
|
3132
3437
|
const baseId = id ?? generatedId;
|
|
3133
3438
|
const labelId = `${baseId}-label`;
|
|
3134
3439
|
const helperId = `${baseId}-helper`;
|
|
3135
3440
|
const isControlled = "value" in props;
|
|
3136
|
-
const [innerValue, setInnerValue] =
|
|
3441
|
+
const [innerValue, setInnerValue] = useState17(defaultValue ?? [min]);
|
|
3137
3442
|
const current2 = isControlled ? value3 ?? [min] : innerValue;
|
|
3138
3443
|
const isRange = current2.length > 1;
|
|
3139
3444
|
const handleChange = (next) => {
|
|
@@ -3141,12 +3446,12 @@ var Slider = /* @__PURE__ */ forwardRef32(function Slider2(props, ref) {
|
|
|
3141
3446
|
onValueChange?.(next);
|
|
3142
3447
|
};
|
|
3143
3448
|
const valueText = current2.map(formatValue).join(" \u2013 ");
|
|
3144
|
-
return /* @__PURE__ */
|
|
3145
|
-
(label6 || showValue) && /* @__PURE__ */
|
|
3146
|
-
label6 && /* @__PURE__ */
|
|
3147
|
-
showValue && /* @__PURE__ */
|
|
3449
|
+
return /* @__PURE__ */ jsxs33("div", { className: cx(field3, className), children: [
|
|
3450
|
+
(label6 || showValue) && /* @__PURE__ */ jsxs33("div", { className: header6, children: [
|
|
3451
|
+
label6 && /* @__PURE__ */ jsx38("span", { id: labelId, className: label3, children: label6 }),
|
|
3452
|
+
showValue && /* @__PURE__ */ jsx38("span", { className: value2, "aria-hidden": true, children: valueText })
|
|
3148
3453
|
] }),
|
|
3149
|
-
/* @__PURE__ */
|
|
3454
|
+
/* @__PURE__ */ jsxs33(
|
|
3150
3455
|
RadixSlider.Root,
|
|
3151
3456
|
{
|
|
3152
3457
|
ref,
|
|
@@ -3159,10 +3464,10 @@ var Slider = /* @__PURE__ */ forwardRef32(function Slider2(props, ref) {
|
|
|
3159
3464
|
className: root10({ size }),
|
|
3160
3465
|
...rest,
|
|
3161
3466
|
children: [
|
|
3162
|
-
/* @__PURE__ */
|
|
3467
|
+
/* @__PURE__ */ jsx38(RadixSlider.Track, { className: track({ size }), children: /* @__PURE__ */ jsx38(RadixSlider.Range, { className: range2 }) }),
|
|
3163
3468
|
current2.map((thumbValue, index) => {
|
|
3164
3469
|
const thumbLabelId = `${baseId}-thumb-${index}`;
|
|
3165
|
-
return /* @__PURE__ */
|
|
3470
|
+
return /* @__PURE__ */ jsx38(
|
|
3166
3471
|
RadixSlider.Thumb,
|
|
3167
3472
|
{
|
|
3168
3473
|
className: thumb({ size }),
|
|
@@ -3177,21 +3482,21 @@ var Slider = /* @__PURE__ */ forwardRef32(function Slider2(props, ref) {
|
|
|
3177
3482
|
]
|
|
3178
3483
|
}
|
|
3179
3484
|
),
|
|
3180
|
-
isRange && current2.map((_, index) => /* @__PURE__ */
|
|
3485
|
+
isRange && current2.map((_, index) => /* @__PURE__ */ jsxs33("span", { id: `${baseId}-thumb-${index}`, hidden: true, children: [
|
|
3181
3486
|
label6 ? "" : ariaLabel ? `${ariaLabel} ` : "",
|
|
3182
3487
|
thumbLabels[index] ?? `${index + 1}`
|
|
3183
3488
|
] }, index)),
|
|
3184
|
-
helperText3 && /* @__PURE__ */
|
|
3489
|
+
helperText3 && /* @__PURE__ */ jsx38("span", { id: helperId, className: helperText2, children: helperText3 })
|
|
3185
3490
|
] });
|
|
3186
3491
|
});
|
|
3187
3492
|
|
|
3188
3493
|
// src/components/Stepper/Stepper.tsx
|
|
3189
|
-
import { forwardRef as
|
|
3494
|
+
import { forwardRef as forwardRef35 } from "react";
|
|
3190
3495
|
import { CheckIcon as CheckIcon4 } from "@bestow-ui/icons";
|
|
3191
3496
|
|
|
3192
3497
|
// src/components/Stepper/Stepper.css.ts
|
|
3193
3498
|
import { createRuntimeFn as _7a46817 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3194
|
-
var
|
|
3499
|
+
var description6 = "kervhmh";
|
|
3195
3500
|
var indicator2 = /* @__PURE__ */ _7a46817({ defaultClassName: "kervhm6", variantClassNames: { status: { complete: "kervhm7", current: "kervhm8", upcoming: "kervhm9" } }, defaultVariants: {}, compoundVariants: [] });
|
|
3196
3501
|
var label4 = /* @__PURE__ */ _7a46817({ defaultClassName: "kervhmd", variantClassNames: { status: { complete: "kervhme", current: "kervhmf", upcoming: "kervhmg" } }, defaultVariants: {}, compoundVariants: [] });
|
|
3197
3502
|
var root11 = /* @__PURE__ */ _7a46817({ defaultClassName: "kervhm0", variantClassNames: { orientation: { horizontal: "kervhm1", vertical: "kervhm2" } }, defaultVariants: { orientation: "horizontal" }, compoundVariants: [] });
|
|
@@ -3199,10 +3504,10 @@ var step = /* @__PURE__ */ _7a46817({ defaultClassName: "kervhm3", variantClassN
|
|
|
3199
3504
|
var text2 = /* @__PURE__ */ _7a46817({ defaultClassName: "kervhma", variantClassNames: { orientation: { horizontal: "kervhmb", vertical: "kervhmc" } }, defaultVariants: {}, compoundVariants: [] });
|
|
3200
3505
|
|
|
3201
3506
|
// src/components/Stepper/Stepper.tsx
|
|
3202
|
-
import { jsx as
|
|
3203
|
-
var Stepper = /* @__PURE__ */
|
|
3507
|
+
import { jsx as jsx39, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
3508
|
+
var Stepper = /* @__PURE__ */ forwardRef35(function Stepper2({ steps, current: current2, orientation = "horizontal", "aria-label": ariaLabel, className, ...rest }, ref) {
|
|
3204
3509
|
const m = useMessages();
|
|
3205
|
-
return /* @__PURE__ */
|
|
3510
|
+
return /* @__PURE__ */ jsx39(
|
|
3206
3511
|
"ol",
|
|
3207
3512
|
{
|
|
3208
3513
|
ref,
|
|
@@ -3211,24 +3516,24 @@ var Stepper = /* @__PURE__ */ forwardRef33(function Stepper2({ steps, current: c
|
|
|
3211
3516
|
...rest,
|
|
3212
3517
|
children: steps.map((step2, index) => {
|
|
3213
3518
|
const status = index < current2 ? "complete" : index === current2 ? "current" : "upcoming";
|
|
3214
|
-
return /* @__PURE__ */
|
|
3519
|
+
return /* @__PURE__ */ jsxs34(
|
|
3215
3520
|
"li",
|
|
3216
3521
|
{
|
|
3217
3522
|
className: step({ orientation }),
|
|
3218
3523
|
"data-status": status,
|
|
3219
3524
|
"aria-current": status === "current" ? "step" : void 0,
|
|
3220
3525
|
children: [
|
|
3221
|
-
/* @__PURE__ */
|
|
3222
|
-
/* @__PURE__ */
|
|
3223
|
-
/* @__PURE__ */
|
|
3526
|
+
/* @__PURE__ */ jsx39("span", { className: indicator2({ status }), "aria-hidden": true, children: status === "complete" ? /* @__PURE__ */ jsx39(CheckIcon4, { size: 16, strokeWidth: 2.5 }) : index + 1 }),
|
|
3527
|
+
/* @__PURE__ */ jsxs34("span", { className: text2({ orientation }), children: [
|
|
3528
|
+
/* @__PURE__ */ jsxs34("span", { className: label4({ status }), children: [
|
|
3224
3529
|
step2.label,
|
|
3225
|
-
status === "complete" && /* @__PURE__ */
|
|
3530
|
+
status === "complete" && /* @__PURE__ */ jsxs34("span", { className: visuallyHidden, children: [
|
|
3226
3531
|
" (",
|
|
3227
3532
|
m.stepCompleted ?? "\uC644\uB8CC",
|
|
3228
3533
|
")"
|
|
3229
3534
|
] })
|
|
3230
3535
|
] }),
|
|
3231
|
-
step2.description && /* @__PURE__ */
|
|
3536
|
+
step2.description && /* @__PURE__ */ jsx39("span", { className: description6, children: step2.description })
|
|
3232
3537
|
] })
|
|
3233
3538
|
]
|
|
3234
3539
|
},
|
|
@@ -3240,7 +3545,7 @@ var Stepper = /* @__PURE__ */ forwardRef33(function Stepper2({ steps, current: c
|
|
|
3240
3545
|
});
|
|
3241
3546
|
|
|
3242
3547
|
// src/components/Switch/Switch.tsx
|
|
3243
|
-
import { forwardRef as
|
|
3548
|
+
import { forwardRef as forwardRef36, useEffect as useEffect11, useId as useId19, useRef as useRef16, useState as useState18 } from "react";
|
|
3244
3549
|
|
|
3245
3550
|
// src/components/Switch/Switch.css.ts
|
|
3246
3551
|
import { createRuntimeFn as _7a46818 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
@@ -3251,11 +3556,11 @@ var thumb2 = /* @__PURE__ */ _7a46818({ defaultClassName: "o33ul26", variantClas
|
|
|
3251
3556
|
var track2 = /* @__PURE__ */ _7a46818({ defaultClassName: "o33ul23", variantClassNames: { size: { sm: "o33ul24", md: "o33ul25" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
3252
3557
|
|
|
3253
3558
|
// src/components/Switch/Switch.tsx
|
|
3254
|
-
import { jsx as
|
|
3559
|
+
import { jsx as jsx40, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
3255
3560
|
function setNativeChecked(input6, checked) {
|
|
3256
3561
|
Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "checked")?.set?.call(input6, checked);
|
|
3257
3562
|
}
|
|
3258
|
-
var Switch = /* @__PURE__ */
|
|
3563
|
+
var Switch = /* @__PURE__ */ forwardRef36(function Switch2({
|
|
3259
3564
|
label: label6,
|
|
3260
3565
|
size,
|
|
3261
3566
|
id,
|
|
@@ -3269,22 +3574,22 @@ var Switch = /* @__PURE__ */ forwardRef34(function Switch2({
|
|
|
3269
3574
|
onCheckedChange,
|
|
3270
3575
|
"aria-label": ariaLabel
|
|
3271
3576
|
}, ref) {
|
|
3272
|
-
const generatedId =
|
|
3577
|
+
const generatedId = useId19();
|
|
3273
3578
|
const switchId = id ?? generatedId;
|
|
3274
|
-
const [uncontrolled, setUncontrolled] =
|
|
3579
|
+
const [uncontrolled, setUncontrolled] = useState18(defaultChecked ?? false);
|
|
3275
3580
|
const isControlled = checkedProp !== void 0;
|
|
3276
3581
|
const checked = isControlled ? checkedProp : uncontrolled;
|
|
3277
|
-
const buttonRef =
|
|
3278
|
-
const inputRef =
|
|
3279
|
-
const [inForm, setInForm] =
|
|
3280
|
-
const userToggled =
|
|
3582
|
+
const buttonRef = useRef16(null);
|
|
3583
|
+
const inputRef = useRef16(null);
|
|
3584
|
+
const [inForm, setInForm] = useState18(true);
|
|
3585
|
+
const userToggled = useRef16(false);
|
|
3281
3586
|
const setChecked = (next) => {
|
|
3282
3587
|
if (!isControlled) setUncontrolled(next);
|
|
3283
3588
|
if (next !== checked) onCheckedChange?.(next);
|
|
3284
3589
|
};
|
|
3285
|
-
const setCheckedRef =
|
|
3590
|
+
const setCheckedRef = useRef16(setChecked);
|
|
3286
3591
|
setCheckedRef.current = setChecked;
|
|
3287
|
-
|
|
3592
|
+
useEffect11(() => {
|
|
3288
3593
|
const form = buttonRef.current?.form;
|
|
3289
3594
|
setInForm(!!form);
|
|
3290
3595
|
if (!form) return;
|
|
@@ -3293,7 +3598,7 @@ var Switch = /* @__PURE__ */ forwardRef34(function Switch2({
|
|
|
3293
3598
|
form.addEventListener("reset", onReset);
|
|
3294
3599
|
return () => form.removeEventListener("reset", onReset);
|
|
3295
3600
|
}, []);
|
|
3296
|
-
|
|
3601
|
+
useEffect11(() => {
|
|
3297
3602
|
const input6 = inputRef.current;
|
|
3298
3603
|
if (!input6 || input6.checked === checked) return;
|
|
3299
3604
|
setNativeChecked(input6, checked);
|
|
@@ -3306,8 +3611,8 @@ var Switch = /* @__PURE__ */ forwardRef34(function Switch2({
|
|
|
3306
3611
|
if (inForm) event.stopPropagation();
|
|
3307
3612
|
};
|
|
3308
3613
|
const state = checked ? "checked" : "unchecked";
|
|
3309
|
-
return /* @__PURE__ */
|
|
3310
|
-
/* @__PURE__ */
|
|
3614
|
+
return /* @__PURE__ */ jsxs35("span", { className: cx(root12({ size }), className), "data-disabled": disabled || void 0, children: [
|
|
3615
|
+
/* @__PURE__ */ jsx40(
|
|
3311
3616
|
"button",
|
|
3312
3617
|
{
|
|
3313
3618
|
ref: mergeRefs(ref, buttonRef),
|
|
@@ -3323,10 +3628,10 @@ var Switch = /* @__PURE__ */ forwardRef34(function Switch2({
|
|
|
3323
3628
|
value: value3,
|
|
3324
3629
|
className: track2({ size }),
|
|
3325
3630
|
onClick: handleClick,
|
|
3326
|
-
children: /* @__PURE__ */
|
|
3631
|
+
children: /* @__PURE__ */ jsx40("span", { className: thumb2({ size }), "data-state": state, "data-disabled": disabled ? "" : void 0 })
|
|
3327
3632
|
}
|
|
3328
3633
|
),
|
|
3329
|
-
inForm && /* @__PURE__ */
|
|
3634
|
+
inForm && /* @__PURE__ */ jsx40(
|
|
3330
3635
|
"input",
|
|
3331
3636
|
{
|
|
3332
3637
|
ref: inputRef,
|
|
@@ -3341,16 +3646,16 @@ var Switch = /* @__PURE__ */ forwardRef34(function Switch2({
|
|
|
3341
3646
|
className: bubbleInput({ size })
|
|
3342
3647
|
}
|
|
3343
3648
|
),
|
|
3344
|
-
label6 && /* @__PURE__ */
|
|
3649
|
+
label6 && /* @__PURE__ */ jsx40("label", { htmlFor: switchId, className: label5, children: label6 })
|
|
3345
3650
|
] });
|
|
3346
3651
|
});
|
|
3347
3652
|
|
|
3348
3653
|
// src/components/Table/Table.tsx
|
|
3349
3654
|
import {
|
|
3350
3655
|
createContext as createContext3,
|
|
3351
|
-
forwardRef as
|
|
3656
|
+
forwardRef as forwardRef37,
|
|
3352
3657
|
useContext as useContext3,
|
|
3353
|
-
useId as
|
|
3658
|
+
useId as useId20
|
|
3354
3659
|
} from "react";
|
|
3355
3660
|
import { ArrowDownIcon, ArrowUpIcon } from "@bestow-ui/icons";
|
|
3356
3661
|
|
|
@@ -3366,7 +3671,7 @@ var footer3 = "l3ploy7";
|
|
|
3366
3671
|
var footerCell = "l3ployg";
|
|
3367
3672
|
var head = "l3ployf";
|
|
3368
3673
|
var header7 = "l3ploy3";
|
|
3369
|
-
var
|
|
3674
|
+
var row4 = "l3ploy8";
|
|
3370
3675
|
var sortButton = "l3ployh";
|
|
3371
3676
|
var sortIcon = "l3ployi";
|
|
3372
3677
|
var stickyHeader = "l3ploy4";
|
|
@@ -3374,10 +3679,10 @@ var striped = "l3ploy6";
|
|
|
3374
3679
|
var table = "l3ploy1";
|
|
3375
3680
|
|
|
3376
3681
|
// src/components/Table/Table.tsx
|
|
3377
|
-
import { Fragment as
|
|
3682
|
+
import { Fragment as Fragment8, jsx as jsx41, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
3378
3683
|
var TableSizeContext = /* @__PURE__ */ createContext3("md");
|
|
3379
3684
|
var TableSectionContext = /* @__PURE__ */ createContext3("body");
|
|
3380
|
-
var Table = /* @__PURE__ */
|
|
3685
|
+
var Table = /* @__PURE__ */ forwardRef37(function Table2({
|
|
3381
3686
|
size = "md",
|
|
3382
3687
|
striped: striped2,
|
|
3383
3688
|
stickyHeader: stickyHeader2,
|
|
@@ -3389,8 +3694,8 @@ var Table = /* @__PURE__ */ forwardRef35(function Table2({
|
|
|
3389
3694
|
children,
|
|
3390
3695
|
...rest
|
|
3391
3696
|
}, ref) {
|
|
3392
|
-
const captionId =
|
|
3393
|
-
return /* @__PURE__ */
|
|
3697
|
+
const captionId = useId20();
|
|
3698
|
+
return /* @__PURE__ */ jsx41(TableSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsx41(
|
|
3394
3699
|
"div",
|
|
3395
3700
|
{
|
|
3396
3701
|
className: cx(container, containerClassName),
|
|
@@ -3399,7 +3704,7 @@ var Table = /* @__PURE__ */ forwardRef35(function Table2({
|
|
|
3399
3704
|
role: "region",
|
|
3400
3705
|
"aria-labelledby": caption2 ? captionId : void 0,
|
|
3401
3706
|
"aria-label": caption2 ? void 0 : ariaLabel,
|
|
3402
|
-
children: /* @__PURE__ */
|
|
3707
|
+
children: /* @__PURE__ */ jsxs36(
|
|
3403
3708
|
"table",
|
|
3404
3709
|
{
|
|
3405
3710
|
ref,
|
|
@@ -3407,7 +3712,7 @@ var Table = /* @__PURE__ */ forwardRef35(function Table2({
|
|
|
3407
3712
|
"aria-label": caption2 ? void 0 : ariaLabel,
|
|
3408
3713
|
...rest,
|
|
3409
3714
|
children: [
|
|
3410
|
-
caption2 && /* @__PURE__ */
|
|
3715
|
+
caption2 && /* @__PURE__ */ jsx41("caption", { id: captionId, className: caption, children: caption2 }),
|
|
3411
3716
|
children
|
|
3412
3717
|
]
|
|
3413
3718
|
}
|
|
@@ -3415,31 +3720,31 @@ var Table = /* @__PURE__ */ forwardRef35(function Table2({
|
|
|
3415
3720
|
}
|
|
3416
3721
|
) });
|
|
3417
3722
|
});
|
|
3418
|
-
var TableHeader = /* @__PURE__ */
|
|
3723
|
+
var TableHeader = /* @__PURE__ */ forwardRef37(
|
|
3419
3724
|
function TableHeader2({ className, ...rest }, ref) {
|
|
3420
|
-
return /* @__PURE__ */
|
|
3725
|
+
return /* @__PURE__ */ jsx41(TableSectionContext.Provider, { value: "header", children: /* @__PURE__ */ jsx41("thead", { ref, className: cx(header7, className), ...rest }) });
|
|
3421
3726
|
}
|
|
3422
3727
|
);
|
|
3423
|
-
var TableBody = /* @__PURE__ */
|
|
3728
|
+
var TableBody = /* @__PURE__ */ forwardRef37(
|
|
3424
3729
|
function TableBody2({ className, ...rest }, ref) {
|
|
3425
|
-
return /* @__PURE__ */
|
|
3730
|
+
return /* @__PURE__ */ jsx41(TableSectionContext.Provider, { value: "body", children: /* @__PURE__ */ jsx41("tbody", { ref, className: cx(body3, className), ...rest }) });
|
|
3426
3731
|
}
|
|
3427
3732
|
);
|
|
3428
|
-
var TableFooter = /* @__PURE__ */
|
|
3733
|
+
var TableFooter = /* @__PURE__ */ forwardRef37(
|
|
3429
3734
|
function TableFooter2({ className, ...rest }, ref) {
|
|
3430
|
-
return /* @__PURE__ */
|
|
3735
|
+
return /* @__PURE__ */ jsx41(TableSectionContext.Provider, { value: "footer", children: /* @__PURE__ */ jsx41("tfoot", { ref, className: cx(footer3, className), ...rest }) });
|
|
3431
3736
|
}
|
|
3432
3737
|
);
|
|
3433
|
-
var TableRow = /* @__PURE__ */
|
|
3434
|
-
return /* @__PURE__ */
|
|
3738
|
+
var TableRow = /* @__PURE__ */ forwardRef37(function TableRow2({ selected, className, ...rest }, ref) {
|
|
3739
|
+
return /* @__PURE__ */ jsx41("tr", { ref, className: cx(row4, className), "data-state": selected ? "selected" : void 0, ...rest });
|
|
3435
3740
|
});
|
|
3436
|
-
var TableHead = /* @__PURE__ */
|
|
3741
|
+
var TableHead = /* @__PURE__ */ forwardRef37(function TableHead2({ align, sortDirection, onSort, scope, className, children, ...rest }, ref) {
|
|
3437
3742
|
const size = useContext3(TableSizeContext);
|
|
3438
3743
|
const section = useContext3(TableSectionContext);
|
|
3439
3744
|
const sortable = onSort !== void 0;
|
|
3440
3745
|
const direction = sortDirection ?? "none";
|
|
3441
3746
|
const SortIcon = direction === "descending" ? ArrowDownIcon : ArrowUpIcon;
|
|
3442
|
-
return /* @__PURE__ */
|
|
3747
|
+
return /* @__PURE__ */ jsx41(
|
|
3443
3748
|
"th",
|
|
3444
3749
|
{
|
|
3445
3750
|
ref,
|
|
@@ -3451,17 +3756,17 @@ var TableHead = /* @__PURE__ */ forwardRef35(function TableHead2({ align, sortDi
|
|
|
3451
3756
|
className
|
|
3452
3757
|
),
|
|
3453
3758
|
...rest,
|
|
3454
|
-
children: sortable ? /* @__PURE__ */
|
|
3759
|
+
children: sortable ? /* @__PURE__ */ jsxs36("button", { type: "button", className: sortButton, onClick: onSort, children: [
|
|
3455
3760
|
children,
|
|
3456
|
-
/* @__PURE__ */
|
|
3761
|
+
/* @__PURE__ */ jsx41(SortIcon, { size: 14, className: sortIcon, "data-active": direction !== "none", "aria-hidden": true })
|
|
3457
3762
|
] }) : children
|
|
3458
3763
|
}
|
|
3459
3764
|
);
|
|
3460
3765
|
});
|
|
3461
|
-
var TableCell = /* @__PURE__ */
|
|
3766
|
+
var TableCell = /* @__PURE__ */ forwardRef37(function TableCell2({ align, className, ...rest }, ref) {
|
|
3462
3767
|
const size = useContext3(TableSizeContext);
|
|
3463
3768
|
const section = useContext3(TableSectionContext);
|
|
3464
|
-
return /* @__PURE__ */
|
|
3769
|
+
return /* @__PURE__ */ jsx41(
|
|
3465
3770
|
"td",
|
|
3466
3771
|
{
|
|
3467
3772
|
ref,
|
|
@@ -3470,17 +3775,17 @@ var TableCell = /* @__PURE__ */ forwardRef35(function TableCell2({ align, classN
|
|
|
3470
3775
|
}
|
|
3471
3776
|
);
|
|
3472
3777
|
});
|
|
3473
|
-
var TableEmpty = /* @__PURE__ */
|
|
3474
|
-
return /* @__PURE__ */
|
|
3778
|
+
var TableEmpty = /* @__PURE__ */ forwardRef37(function TableEmpty2({ colSpan, className, children, ...rest }, ref) {
|
|
3779
|
+
return /* @__PURE__ */ jsx41(TableRow, { children: /* @__PURE__ */ jsx41(TableCell, { ref, colSpan, className: cx(emptyCell, className), ...rest, children: /* @__PURE__ */ jsx41("div", { className: emptyContent, children }) }) });
|
|
3475
3780
|
});
|
|
3476
3781
|
function TableSkeleton({ rows = 5, columns }) {
|
|
3477
|
-
return /* @__PURE__ */
|
|
3782
|
+
return /* @__PURE__ */ jsx41(Fragment8, { children: Array.from({ length: rows }, (_, row6) => /* @__PURE__ */ jsx41(TableRow, { "aria-hidden": true, children: Array.from({ length: columns }, (_2, column) => /* @__PURE__ */ jsx41(TableCell, { children: /* @__PURE__ */ jsx41(Skeleton, { width: column === 0 ? "60%" : "80%" }) }, column)) }, row6)) });
|
|
3478
3783
|
}
|
|
3479
3784
|
|
|
3480
3785
|
// src/components/Table/useTableSelection.ts
|
|
3481
|
-
import { useCallback, useState as
|
|
3786
|
+
import { useCallback, useState as useState19 } from "react";
|
|
3482
3787
|
function useTableSelection(initial = []) {
|
|
3483
|
-
const [selected, setSelected] =
|
|
3788
|
+
const [selected, setSelected] = useState19(initial);
|
|
3484
3789
|
const isSelected = useCallback((id) => selected.includes(id), [selected]);
|
|
3485
3790
|
const toggle3 = useCallback((id, checked) => {
|
|
3486
3791
|
setSelected((prev) => {
|
|
@@ -3510,7 +3815,7 @@ function useTableSelection(initial = []) {
|
|
|
3510
3815
|
|
|
3511
3816
|
// src/components/Tabs/Tabs.tsx
|
|
3512
3817
|
import * as RadixTabs from "@radix-ui/react-tabs";
|
|
3513
|
-
import { createContext as createContext4, forwardRef as
|
|
3818
|
+
import { createContext as createContext4, forwardRef as forwardRef38, useContext as useContext4 } from "react";
|
|
3514
3819
|
|
|
3515
3820
|
// src/components/Tabs/Tabs.css.ts
|
|
3516
3821
|
import { createRuntimeFn as _7a46820 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
@@ -3520,31 +3825,31 @@ var root13 = "fvhbtd0";
|
|
|
3520
3825
|
var trigger3 = /* @__PURE__ */ _7a46820({ defaultClassName: "fvhbtd4", variantClassNames: { variant: { line: "fvhbtd5", soft: "fvhbtd6" }, size: { sm: "fvhbtd7", md: "fvhbtd8" } }, defaultVariants: { variant: "line", size: "md" }, compoundVariants: [[{ variant: "soft", size: "sm" }, "fvhbtd9"], [{ variant: "soft", size: "md" }, "fvhbtda"]] });
|
|
3521
3826
|
|
|
3522
3827
|
// src/components/Tabs/Tabs.tsx
|
|
3523
|
-
import { jsx as
|
|
3828
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
3524
3829
|
var TabsStyleContext = /* @__PURE__ */ createContext4({ variant: "line", size: "md" });
|
|
3525
|
-
var Tabs = /* @__PURE__ */
|
|
3830
|
+
var Tabs = /* @__PURE__ */ forwardRef38(function Tabs2({ variant = "line", size = "md", className, ...props }, ref) {
|
|
3526
3831
|
const controlled = "value" in props ? { value: props.value ?? "" } : {};
|
|
3527
|
-
return /* @__PURE__ */
|
|
3832
|
+
return /* @__PURE__ */ jsx42(TabsStyleContext.Provider, { value: { variant, size }, children: /* @__PURE__ */ jsx42(RadixTabs.Root, { ref, className: cx(root13, className), ...props, ...controlled }) });
|
|
3528
3833
|
});
|
|
3529
|
-
var TabsList = /* @__PURE__ */
|
|
3834
|
+
var TabsList = /* @__PURE__ */ forwardRef38(function TabsList2({ className, ...rest }, ref) {
|
|
3530
3835
|
const { variant } = useContext4(TabsStyleContext);
|
|
3531
|
-
return /* @__PURE__ */
|
|
3836
|
+
return /* @__PURE__ */ jsx42(RadixTabs.List, { ref, className: cx(list6({ variant }), className), ...rest });
|
|
3532
3837
|
});
|
|
3533
|
-
var TabsTrigger = /* @__PURE__ */
|
|
3838
|
+
var TabsTrigger = /* @__PURE__ */ forwardRef38(function TabsTrigger2({ className, ...rest }, ref) {
|
|
3534
3839
|
const { variant, size } = useContext4(TabsStyleContext);
|
|
3535
|
-
return /* @__PURE__ */
|
|
3840
|
+
return /* @__PURE__ */ jsx42(RadixTabs.Trigger, { ref, className: cx(trigger3({ variant, size }), className), ...rest });
|
|
3536
3841
|
});
|
|
3537
|
-
var TabsContent = /* @__PURE__ */
|
|
3538
|
-
return /* @__PURE__ */
|
|
3842
|
+
var TabsContent = /* @__PURE__ */ forwardRef38(function TabsContent2({ className, ...rest }, ref) {
|
|
3843
|
+
return /* @__PURE__ */ jsx42(RadixTabs.Content, { ref, className: cx(content10, className), ...rest });
|
|
3539
3844
|
});
|
|
3540
3845
|
|
|
3541
3846
|
// src/components/Textarea/Textarea.tsx
|
|
3542
3847
|
import {
|
|
3543
|
-
forwardRef as
|
|
3848
|
+
forwardRef as forwardRef39,
|
|
3544
3849
|
useCallback as useCallback2,
|
|
3545
|
-
useId as
|
|
3546
|
-
useRef as
|
|
3547
|
-
useState as
|
|
3850
|
+
useId as useId21,
|
|
3851
|
+
useRef as useRef17,
|
|
3852
|
+
useState as useState20
|
|
3548
3853
|
} from "react";
|
|
3549
3854
|
|
|
3550
3855
|
// src/components/Textarea/Textarea.css.ts
|
|
@@ -3556,8 +3861,8 @@ var footer4 = "_1koawa8";
|
|
|
3556
3861
|
var textarea = /* @__PURE__ */ _7a46821({ defaultClassName: "_1koawa0", variantClassNames: { size: { sm: "_1koawa1", md: "_1koawa2", lg: "_1koawa3" }, resize: { none: "_1koawa4", vertical: "_1koawa5", both: "_1koawa6" } }, defaultVariants: { size: "md", resize: "vertical" }, compoundVariants: [] });
|
|
3557
3862
|
|
|
3558
3863
|
// src/components/Textarea/Textarea.tsx
|
|
3559
|
-
import { jsx as
|
|
3560
|
-
var Textarea = /* @__PURE__ */
|
|
3864
|
+
import { jsx as jsx43, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
3865
|
+
var Textarea = /* @__PURE__ */ forwardRef39(function Textarea2({
|
|
3561
3866
|
label: label6,
|
|
3562
3867
|
helperText: helperText3,
|
|
3563
3868
|
error,
|
|
@@ -3578,11 +3883,11 @@ var Textarea = /* @__PURE__ */ forwardRef37(function Textarea2({
|
|
|
3578
3883
|
"aria-describedby": ariaDescribedBy,
|
|
3579
3884
|
...rest
|
|
3580
3885
|
}, ref) {
|
|
3581
|
-
const generatedId =
|
|
3886
|
+
const generatedId = useId21();
|
|
3582
3887
|
const textareaId = id ?? generatedId;
|
|
3583
3888
|
const helperId = helperText3 ? `${textareaId}-helper` : void 0;
|
|
3584
|
-
const innerRef =
|
|
3585
|
-
const [uncontrolledLength, setUncontrolledLength] =
|
|
3889
|
+
const innerRef = useRef17(null);
|
|
3890
|
+
const [uncontrolledLength, setUncontrolledLength] = useState20(() => String(defaultValue ?? "").length);
|
|
3586
3891
|
const length = value3 !== void 0 ? String(value3).length : uncontrolledLength;
|
|
3587
3892
|
const fitHeight = useCallback2(() => {
|
|
3588
3893
|
const el = innerRef.current;
|
|
@@ -3597,12 +3902,12 @@ var Textarea = /* @__PURE__ */ forwardRef37(function Textarea2({
|
|
|
3597
3902
|
fitHeight();
|
|
3598
3903
|
onChange?.(event);
|
|
3599
3904
|
};
|
|
3600
|
-
return /* @__PURE__ */
|
|
3601
|
-
label6 && /* @__PURE__ */
|
|
3905
|
+
return /* @__PURE__ */ jsxs37("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
|
|
3906
|
+
label6 && /* @__PURE__ */ jsxs37("label", { htmlFor: textareaId, className: label, children: [
|
|
3602
3907
|
label6,
|
|
3603
|
-
required && /* @__PURE__ */
|
|
3908
|
+
required && /* @__PURE__ */ jsx43("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
3604
3909
|
] }),
|
|
3605
|
-
/* @__PURE__ */
|
|
3910
|
+
/* @__PURE__ */ jsx43(
|
|
3606
3911
|
"textarea",
|
|
3607
3912
|
{
|
|
3608
3913
|
ref: mergeRefs(innerRef, ref),
|
|
@@ -3624,36 +3929,36 @@ var Textarea = /* @__PURE__ */ forwardRef37(function Textarea2({
|
|
|
3624
3929
|
...rest
|
|
3625
3930
|
}
|
|
3626
3931
|
),
|
|
3627
|
-
(helperText3 || showCount) && /* @__PURE__ */
|
|
3628
|
-
helperText3 && /* @__PURE__ */
|
|
3629
|
-
showCount && /* @__PURE__ */
|
|
3932
|
+
(helperText3 || showCount) && /* @__PURE__ */ jsxs37("div", { className: footer4, children: [
|
|
3933
|
+
helperText3 && /* @__PURE__ */ jsx43("p", { id: helperId, className: helperText({ error }), children: helperText3 }),
|
|
3934
|
+
showCount && /* @__PURE__ */ jsx43("span", { className: cx(count, maxLength !== void 0 && length >= maxLength && countOver), children: maxLength !== void 0 ? `${length}/${maxLength}` : length })
|
|
3630
3935
|
] })
|
|
3631
3936
|
] });
|
|
3632
3937
|
});
|
|
3633
3938
|
|
|
3634
3939
|
// src/components/Toast/Toast.tsx
|
|
3635
3940
|
import * as RadixToast from "@radix-ui/react-toast";
|
|
3636
|
-
import { createContext as createContext5, useCallback as useCallback3, useContext as useContext5, useMemo as useMemo4, useRef as
|
|
3941
|
+
import { createContext as createContext5, useCallback as useCallback3, useContext as useContext5, useMemo as useMemo4, useRef as useRef18, useState as useState21 } from "react";
|
|
3637
3942
|
import { XIcon as XIcon7 } from "@bestow-ui/icons";
|
|
3638
3943
|
|
|
3639
3944
|
// src/components/Toast/Toast.css.ts
|
|
3640
3945
|
import { createRuntimeFn as _7a46822 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3641
|
-
var action2 = "
|
|
3642
|
-
var close = "
|
|
3643
|
-
var
|
|
3644
|
-
var title5 = "
|
|
3645
|
-
var toast = /* @__PURE__ */ _7a46822({ defaultClassName: "_1g11zvx1", variantClassNames: { color: { primary: "_1g11zvx2", neutral: "_1g11zvx3", success: "_1g11zvx4", warning: "_1g11zvx5", danger: "_1g11zvx6" } }, defaultVariants: { color: "neutral" }, compoundVariants: [] });
|
|
3946
|
+
var action2 = "_1g11zvxa";
|
|
3947
|
+
var close = "_1g11zvxb";
|
|
3948
|
+
var description7 = "_1g11zvx9";
|
|
3949
|
+
var title5 = "_1g11zvx8";
|
|
3950
|
+
var toast = /* @__PURE__ */ _7a46822({ defaultClassName: "_1g11zvx1", variantClassNames: { color: { primary: "_1g11zvx2", neutral: "_1g11zvx3", success: "_1g11zvx4", warning: "_1g11zvx5", danger: "_1g11zvx6", info: "_1g11zvx7" } }, defaultVariants: { color: "neutral" }, compoundVariants: [] });
|
|
3646
3951
|
var viewport2 = "_1g11zvx0";
|
|
3647
3952
|
|
|
3648
3953
|
// src/components/Toast/Toast.tsx
|
|
3649
|
-
import { jsx as
|
|
3954
|
+
import { jsx as jsx44, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
3650
3955
|
var REMOVE_DELAY = 500;
|
|
3651
3956
|
var ToastContext = /* @__PURE__ */ createContext5(null);
|
|
3652
3957
|
function ToastProvider({ children, duration = 5e3, label: labelProp }) {
|
|
3653
3958
|
const m = useMessages();
|
|
3654
3959
|
const label6 = labelProp ?? m.notifications ?? "\uC54C\uB9BC";
|
|
3655
|
-
const [toasts, setToasts] =
|
|
3656
|
-
const nextId =
|
|
3960
|
+
const [toasts, setToasts] = useState21([]);
|
|
3961
|
+
const nextId = useRef18(0);
|
|
3657
3962
|
const portal2 = usePortalProps();
|
|
3658
3963
|
const toast2 = useCallback3((options) => {
|
|
3659
3964
|
const id = nextId.current++;
|
|
@@ -3666,9 +3971,9 @@ function ToastProvider({ children, duration = 5e3, label: labelProp }) {
|
|
|
3666
3971
|
setTimeout(() => setToasts((prev) => prev.filter((t) => t.open || !isTarget(t))), REMOVE_DELAY);
|
|
3667
3972
|
}, []);
|
|
3668
3973
|
const value3 = useMemo4(() => ({ toast: toast2, dismiss }), [toast2, dismiss]);
|
|
3669
|
-
return /* @__PURE__ */
|
|
3974
|
+
return /* @__PURE__ */ jsx44(ToastContext.Provider, { value: value3, children: /* @__PURE__ */ jsxs38(RadixToast.Provider, { duration, label: label6, swipeDirection: "right", children: [
|
|
3670
3975
|
children,
|
|
3671
|
-
toasts.map(({ id, open, title: title6, description:
|
|
3976
|
+
toasts.map(({ id, open, title: title6, description: description8, color, duration: itemDuration, action: action3 }) => /* @__PURE__ */ jsxs38(
|
|
3672
3977
|
RadixToast.Root,
|
|
3673
3978
|
{
|
|
3674
3979
|
open,
|
|
@@ -3678,15 +3983,15 @@ function ToastProvider({ children, duration = 5e3, label: labelProp }) {
|
|
|
3678
3983
|
},
|
|
3679
3984
|
className: toast({ color }),
|
|
3680
3985
|
children: [
|
|
3681
|
-
/* @__PURE__ */
|
|
3682
|
-
|
|
3683
|
-
action3 && /* @__PURE__ */
|
|
3684
|
-
/* @__PURE__ */
|
|
3986
|
+
/* @__PURE__ */ jsx44(RadixToast.Title, { className: title5, children: title6 }),
|
|
3987
|
+
description8 && /* @__PURE__ */ jsx44(RadixToast.Description, { className: description7, children: description8 }),
|
|
3988
|
+
action3 && /* @__PURE__ */ jsx44(RadixToast.Action, { asChild: true, altText: action3.altText ?? action3.label, className: action2, children: /* @__PURE__ */ jsx44(Button, { size: "sm", variant: "soft", color: "neutral", onClick: action3.onClick, children: action3.label }) }),
|
|
3989
|
+
/* @__PURE__ */ jsx44(RadixToast.Close, { className: close, "aria-label": m.close ?? "\uB2EB\uAE30", children: /* @__PURE__ */ jsx44(XIcon7, { size: 16 }) })
|
|
3685
3990
|
]
|
|
3686
3991
|
},
|
|
3687
3992
|
id
|
|
3688
3993
|
)),
|
|
3689
|
-
/* @__PURE__ */
|
|
3994
|
+
/* @__PURE__ */ jsx44(RadixToast.Viewport, { className: cx(portal2.className, viewport2), style: portal2.style })
|
|
3690
3995
|
] }) });
|
|
3691
3996
|
}
|
|
3692
3997
|
function useToast() {
|
|
@@ -3703,7 +4008,7 @@ var arrow2 = "z7rufs1";
|
|
|
3703
4008
|
var content11 = "z7rufs0";
|
|
3704
4009
|
|
|
3705
4010
|
// src/components/Tooltip/Tooltip.tsx
|
|
3706
|
-
import { jsx as
|
|
4011
|
+
import { jsx as jsx45, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
3707
4012
|
function Tooltip({
|
|
3708
4013
|
content: content12,
|
|
3709
4014
|
children,
|
|
@@ -3718,9 +4023,9 @@ function Tooltip({
|
|
|
3718
4023
|
}) {
|
|
3719
4024
|
const portal2 = usePortalProps();
|
|
3720
4025
|
if (disabled || content12 == null || content12 === "") return children;
|
|
3721
|
-
return /* @__PURE__ */
|
|
3722
|
-
/* @__PURE__ */
|
|
3723
|
-
/* @__PURE__ */
|
|
4026
|
+
return /* @__PURE__ */ jsx45(RadixTooltip.Provider, { delayDuration: delay, children: /* @__PURE__ */ jsxs39(RadixTooltip.Root, { open, defaultOpen, onOpenChange, children: [
|
|
4027
|
+
/* @__PURE__ */ jsx45(RadixTooltip.Trigger, { asChild: true, children }),
|
|
4028
|
+
/* @__PURE__ */ jsx45(RadixTooltip.Portal, { children: /* @__PURE__ */ jsxs39(
|
|
3724
4029
|
RadixTooltip.Content,
|
|
3725
4030
|
{
|
|
3726
4031
|
side,
|
|
@@ -3731,7 +4036,7 @@ function Tooltip({
|
|
|
3731
4036
|
style: portal2.style,
|
|
3732
4037
|
children: [
|
|
3733
4038
|
content12,
|
|
3734
|
-
/* @__PURE__ */
|
|
4039
|
+
/* @__PURE__ */ jsx45(RadixTooltip.Arrow, { className: arrow2, width: 10, height: 5 })
|
|
3735
4040
|
]
|
|
3736
4041
|
}
|
|
3737
4042
|
) })
|
|
@@ -3739,19 +4044,19 @@ function Tooltip({
|
|
|
3739
4044
|
}
|
|
3740
4045
|
|
|
3741
4046
|
// src/components/VerificationCodeInput/VerificationCodeInput.tsx
|
|
3742
|
-
import { forwardRef as
|
|
4047
|
+
import { forwardRef as forwardRef40, useEffect as useEffect12, useId as useId22, useRef as useRef19, useState as useState22 } from "react";
|
|
3743
4048
|
|
|
3744
4049
|
// src/components/VerificationCodeInput/VerificationCodeInput.css.ts
|
|
3745
4050
|
var input5 = "ea01812";
|
|
3746
|
-
var
|
|
4051
|
+
var row5 = "ea01810";
|
|
3747
4052
|
var slot = "ea01813";
|
|
3748
4053
|
var slots = "ea01811";
|
|
3749
4054
|
var timer = "ea01814";
|
|
3750
4055
|
|
|
3751
4056
|
// src/components/VerificationCodeInput/VerificationCodeInput.tsx
|
|
3752
|
-
import { jsx as
|
|
4057
|
+
import { jsx as jsx46, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
3753
4058
|
var formatTime = (seconds) => `${String(Math.floor(seconds / 60)).padStart(2, "0")}:${String(seconds % 60).padStart(2, "0")}`;
|
|
3754
|
-
var VerificationCodeInput = /* @__PURE__ */
|
|
4059
|
+
var VerificationCodeInput = /* @__PURE__ */ forwardRef40(
|
|
3755
4060
|
function VerificationCodeInput2(props, ref) {
|
|
3756
4061
|
const {
|
|
3757
4062
|
length = 6,
|
|
@@ -3778,23 +4083,23 @@ var VerificationCodeInput = /* @__PURE__ */ forwardRef38(
|
|
|
3778
4083
|
const label6 = labelProp ?? m.verificationCode ?? "\uC778\uC99D\uBC88\uD638";
|
|
3779
4084
|
const resendText = resendTextProp ?? m.resend ?? "\uC7AC\uC804\uC1A1";
|
|
3780
4085
|
const expiredText = expiredTextProp ?? m.verificationExpired ?? "\uC778\uC99D \uC2DC\uAC04\uC774 \uC9C0\uB0AC\uC5B4\uC694. \uC7AC\uC804\uC1A1\uD574 \uC8FC\uC138\uC694.";
|
|
3781
|
-
const generatedId =
|
|
4086
|
+
const generatedId = useId22();
|
|
3782
4087
|
const inputId = id ?? generatedId;
|
|
3783
4088
|
const helperId = `${inputId}-helper`;
|
|
3784
4089
|
const statusId = `${inputId}-status`;
|
|
3785
|
-
const inputRef =
|
|
4090
|
+
const inputRef = useRef19(null);
|
|
3786
4091
|
const isControlled = "value" in props;
|
|
3787
|
-
const [innerValue, setInnerValue] =
|
|
4092
|
+
const [innerValue, setInnerValue] = useState22(defaultValue ?? "");
|
|
3788
4093
|
const code = (isControlled ? value3 ?? "" : innerValue).slice(0, length);
|
|
3789
|
-
const [focused, setFocused] =
|
|
3790
|
-
const [endAt, setEndAt] =
|
|
3791
|
-
const [remaining, setRemaining] =
|
|
4094
|
+
const [focused, setFocused] = useState22(false);
|
|
4095
|
+
const [endAt, setEndAt] = useState22(() => expiresIn ? Date.now() + expiresIn * 1e3 : null);
|
|
4096
|
+
const [remaining, setRemaining] = useState22(expiresIn ?? 0);
|
|
3792
4097
|
const expired = expiresIn !== void 0 && remaining <= 0;
|
|
3793
|
-
const onExpireRef =
|
|
3794
|
-
|
|
4098
|
+
const onExpireRef = useRef19(onExpire);
|
|
4099
|
+
useEffect12(() => {
|
|
3795
4100
|
onExpireRef.current = onExpire;
|
|
3796
4101
|
});
|
|
3797
|
-
|
|
4102
|
+
useEffect12(() => {
|
|
3798
4103
|
if (endAt === null) return;
|
|
3799
4104
|
const tick = () => {
|
|
3800
4105
|
const left = Math.max(0, Math.ceil((endAt - Date.now()) / 1e3));
|
|
@@ -3827,19 +4132,19 @@ var VerificationCodeInput = /* @__PURE__ */ forwardRef38(
|
|
|
3827
4132
|
}
|
|
3828
4133
|
inputRef.current?.focus();
|
|
3829
4134
|
};
|
|
3830
|
-
const
|
|
4135
|
+
const description8 = helperText3 ?? m.verificationCodeHint?.(length, type) ?? `${length}\uC790\uB9AC ${type === "numeric" ? "\uC22B\uC790" : "\uBB38\uC790"}\uB97C \uC785\uB825\uD558\uC138\uC694.`;
|
|
3831
4136
|
const activeIndex = Math.min(code.length, length - 1);
|
|
3832
|
-
return /* @__PURE__ */
|
|
4137
|
+
return /* @__PURE__ */ jsxs40(
|
|
3833
4138
|
"div",
|
|
3834
4139
|
{
|
|
3835
4140
|
className: cx(field, className),
|
|
3836
4141
|
"data-invalid": error || void 0,
|
|
3837
4142
|
"data-disabled": disabled || void 0,
|
|
3838
4143
|
children: [
|
|
3839
|
-
/* @__PURE__ */
|
|
3840
|
-
/* @__PURE__ */
|
|
3841
|
-
/* @__PURE__ */
|
|
3842
|
-
/* @__PURE__ */
|
|
4144
|
+
/* @__PURE__ */ jsx46("label", { htmlFor: inputId, className: label, children: label6 }),
|
|
4145
|
+
/* @__PURE__ */ jsxs40("div", { className: row5, children: [
|
|
4146
|
+
/* @__PURE__ */ jsxs40("div", { className: slots, children: [
|
|
4147
|
+
/* @__PURE__ */ jsx46(
|
|
3843
4148
|
"input",
|
|
3844
4149
|
{
|
|
3845
4150
|
ref: mergeRefs(ref, inputRef),
|
|
@@ -3859,7 +4164,7 @@ var VerificationCodeInput = /* @__PURE__ */ forwardRef38(
|
|
|
3859
4164
|
className: input5
|
|
3860
4165
|
}
|
|
3861
4166
|
),
|
|
3862
|
-
Array.from({ length }, (_, index) => /* @__PURE__ */
|
|
4167
|
+
Array.from({ length }, (_, index) => /* @__PURE__ */ jsx46(
|
|
3863
4168
|
"div",
|
|
3864
4169
|
{
|
|
3865
4170
|
className: slot,
|
|
@@ -3870,12 +4175,12 @@ var VerificationCodeInput = /* @__PURE__ */ forwardRef38(
|
|
|
3870
4175
|
index
|
|
3871
4176
|
))
|
|
3872
4177
|
] }),
|
|
3873
|
-
expiresIn !== void 0 && /* @__PURE__ */
|
|
3874
|
-
onResend && /* @__PURE__ */
|
|
4178
|
+
expiresIn !== void 0 && /* @__PURE__ */ jsx46("span", { role: "timer", className: timer, children: formatTime(remaining) }),
|
|
4179
|
+
onResend && /* @__PURE__ */ jsx46(Button, { size: "sm", variant: "outline", color: "neutral", onClick: resend, disabled, children: resendText })
|
|
3875
4180
|
] }),
|
|
3876
|
-
/* @__PURE__ */
|
|
3877
|
-
/* @__PURE__ */
|
|
3878
|
-
name && /* @__PURE__ */
|
|
4181
|
+
/* @__PURE__ */ jsx46("p", { id: helperId, className: helperText({ error }), children: description8 }),
|
|
4182
|
+
/* @__PURE__ */ jsx46("p", { id: statusId, role: "status", className: helperText({ error: true }), children: expired ? expiredText : "" }),
|
|
4183
|
+
name && /* @__PURE__ */ jsx46("input", { type: "hidden", name, value: code })
|
|
3879
4184
|
]
|
|
3880
4185
|
}
|
|
3881
4186
|
);
|
|
@@ -3894,6 +4199,7 @@ export {
|
|
|
3894
4199
|
Button,
|
|
3895
4200
|
Calendar,
|
|
3896
4201
|
Checkbox,
|
|
4202
|
+
CheckboxGroup,
|
|
3897
4203
|
Combobox,
|
|
3898
4204
|
DatePicker,
|
|
3899
4205
|
DateRangePicker,
|
|
@@ -3927,6 +4233,7 @@ export {
|
|
|
3927
4233
|
Popover2 as Popover,
|
|
3928
4234
|
PopoverClose,
|
|
3929
4235
|
RadioGroup2 as RadioGroup,
|
|
4236
|
+
ResidentNumberInput,
|
|
3930
4237
|
SegmentedControl,
|
|
3931
4238
|
Select,
|
|
3932
4239
|
SkipLink,
|