@bestow-ui/react 0.12.0 → 1.1.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/dist/client.js ADDED
@@ -0,0 +1,3279 @@
1
+ "use client";
2
+ import {
3
+ KOREAN_WEEKDAYS,
4
+ addDays,
5
+ addMonths,
6
+ compareDays,
7
+ formatBusinessNumber,
8
+ formatKoreanAmount,
9
+ formatPhoneNumber,
10
+ getCalendarWeeks,
11
+ isSameDay,
12
+ isSameMonth,
13
+ isValidBusinessNumber,
14
+ kakaoPostcodeProvider,
15
+ mergeThemes,
16
+ parseISODate,
17
+ phoneNumberMaxDigits,
18
+ themeClass,
19
+ themeToStyle,
20
+ toISODate
21
+ } from "./chunk-PFEZ3D2H.js";
22
+
23
+ // src/theme/ThemeProvider.tsx
24
+ import { createContext, forwardRef, useContext, useMemo } from "react";
25
+
26
+ // src/utils/cx.ts
27
+ function cx(...classNames) {
28
+ return classNames.filter(Boolean).join(" ");
29
+ }
30
+
31
+ // src/theme/ThemeProvider.css.ts
32
+ var portal = "sfyhlv0";
33
+ var root = "sfyhlv1 sfyhlv0";
34
+
35
+ // src/theme/ThemeProvider.tsx
36
+ import { jsx } from "react/jsx-runtime";
37
+ var ThemeContext = /* @__PURE__ */ createContext({ theme: "light" });
38
+ var ThemeProvider = /* @__PURE__ */ forwardRef(function ThemeProvider2({ theme: themeProp, overrides, className, style, children, ...rest }, ref) {
39
+ const parent = useContext(ThemeContext);
40
+ const theme = themeProp ?? parent.theme;
41
+ const merged = useMemo(() => mergeThemes(parent.overrides, overrides), [parent.overrides, overrides]);
42
+ const value4 = useMemo(
43
+ () => ({ theme, overrides: merged, style: themeToStyle(merged, theme) }),
44
+ [theme, merged]
45
+ );
46
+ return /* @__PURE__ */ jsx(ThemeContext.Provider, { value: value4, children: /* @__PURE__ */ jsx(
47
+ "div",
48
+ {
49
+ ref,
50
+ "data-theme": theme,
51
+ className: cx(themeClass[theme], root, className),
52
+ style: value4.style ? { ...value4.style, ...style } : style,
53
+ ...rest,
54
+ children
55
+ }
56
+ ) });
57
+ });
58
+ function useTheme() {
59
+ return useContext(ThemeContext).theme;
60
+ }
61
+ function usePortalProps() {
62
+ const { theme, style } = useContext(ThemeContext);
63
+ return { className: cx(themeClass[theme], portal), style };
64
+ }
65
+
66
+ // src/i18n/LocaleProvider.tsx
67
+ import { createContext as createContext2, useContext as useContext2, useMemo as useMemo2 } from "react";
68
+ import { jsx as jsx2 } from "react/jsx-runtime";
69
+ var MessagesContext = /* @__PURE__ */ createContext2({});
70
+ function LocaleProvider({ messages, children }) {
71
+ const parent = useContext2(MessagesContext);
72
+ const value4 = useMemo2(() => ({ ...parent, ...messages }), [parent, messages]);
73
+ return /* @__PURE__ */ jsx2(MessagesContext.Provider, { value: value4, children });
74
+ }
75
+ function useMessages() {
76
+ return useContext2(MessagesContext);
77
+ }
78
+
79
+ // src/components/Accordion/Accordion.tsx
80
+ import * as RadixAccordion from "@radix-ui/react-accordion";
81
+ import { ChevronDownIcon } from "@bestow-ui/icons";
82
+ import { forwardRef as forwardRef2 } from "react";
83
+
84
+ // src/components/Accordion/Accordion.css.ts
85
+ var chevron = "v58j0l4";
86
+ var content = "v58j0l5";
87
+ var contentInner = "v58j0l6";
88
+ var header = "v58j0l2";
89
+ var item = "v58j0l1";
90
+ var root2 = "v58j0l0";
91
+ var trigger = "v58j0l3";
92
+
93
+ // src/components/Accordion/Accordion.tsx
94
+ import { jsx as jsx3, jsxs } from "react/jsx-runtime";
95
+ var Accordion = /* @__PURE__ */ forwardRef2(function Accordion2({ className, ...props }, ref) {
96
+ const { collapsible, ...multipleProps } = props;
97
+ const typedProps = props.type === "multiple" ? multipleProps : { ...multipleProps, collapsible };
98
+ const rootProps = "value" in props ? { ...typedProps, value: props.value ?? (props.type === "multiple" ? [] : "") } : typedProps;
99
+ return /* @__PURE__ */ jsx3(RadixAccordion.Root, { ref, className: cx(root2, className), ...rootProps });
100
+ });
101
+ var AccordionItem = /* @__PURE__ */ forwardRef2(function AccordionItem2({ title: title6, headingLevel = 3, className, children, ...rest }, ref) {
102
+ const Heading = `h${headingLevel}`;
103
+ return /* @__PURE__ */ jsxs(RadixAccordion.Item, { ref, className: cx(item, className), ...rest, children: [
104
+ /* @__PURE__ */ jsx3(RadixAccordion.Header, { asChild: true, children: /* @__PURE__ */ jsx3(Heading, { className: header, children: /* @__PURE__ */ jsxs(RadixAccordion.Trigger, { className: trigger, children: [
105
+ title6,
106
+ /* @__PURE__ */ jsx3(ChevronDownIcon, { size: 18, className: chevron })
107
+ ] }) }) }),
108
+ /* @__PURE__ */ jsx3(RadixAccordion.Content, { className: content, children: /* @__PURE__ */ jsx3("div", { className: contentInner, children }) })
109
+ ] });
110
+ });
111
+
112
+ // src/components/AddressInput/AddressInput.tsx
113
+ import { forwardRef as forwardRef7, useEffect, useId as useId2, useRef as useRef2, useState } from "react";
114
+
115
+ // src/components/Button/Button.tsx
116
+ import { forwardRef as forwardRef4 } from "react";
117
+
118
+ // src/components/Spinner/Spinner.tsx
119
+ import { LoaderIcon } from "@bestow-ui/icons";
120
+ import { forwardRef as forwardRef3 } from "react";
121
+
122
+ // src/styles/visuallyHidden.css.ts
123
+ var visuallyHidden = "_1kdtbw10";
124
+
125
+ // src/components/Spinner/Spinner.css.ts
126
+ import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntimeFn";
127
+ 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: [] });
128
+
129
+ // src/components/Spinner/Spinner.tsx
130
+ import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
131
+ var Spinner = /* @__PURE__ */ forwardRef3(function Spinner2({ size, color, label: labelProp, className, ...rest }, ref) {
132
+ const m = useMessages();
133
+ const label6 = labelProp ?? m.loading ?? "\uB85C\uB529 \uC911";
134
+ const a11y = label6 ? { role: "status" } : { "aria-hidden": true };
135
+ return /* @__PURE__ */ jsxs2("span", { ref, className: cx(spinner({ size, color }), className), ...a11y, ...rest, children: [
136
+ /* @__PURE__ */ jsx4(LoaderIcon, { size: "100%" }),
137
+ label6 && /* @__PURE__ */ jsx4("span", { className: visuallyHidden, children: label6 })
138
+ ] });
139
+ });
140
+
141
+ // src/components/Button/Button.css.ts
142
+ import { createRuntimeFn as _7a4682 } from "@vanilla-extract/recipes/createRuntimeFn";
143
+ var button = /* @__PURE__ */ _7a4682({ defaultClassName: "xcekda6", variantClassNames: { variant: { solid: "xcekda7", soft: "xcekda8", outline: "xcekda9", ghost: "xcekdaa" }, color: { primary: "xcekdab", neutral: "xcekdac", danger: "xcekdad" }, size: { sm: "xcekdae", md: "xcekdaf", lg: "xcekdag" }, fullWidth: { true: "xcekdah" } }, defaultVariants: { variant: "solid", color: "primary", size: "md" }, compoundVariants: [] });
144
+ var icon = "xcekdai";
145
+
146
+ // src/components/Button/Button.tsx
147
+ import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
148
+ var Button = /* @__PURE__ */ forwardRef4(function Button2({
149
+ variant,
150
+ color,
151
+ size,
152
+ fullWidth,
153
+ startIcon,
154
+ endIcon,
155
+ loading,
156
+ className,
157
+ type = "button",
158
+ onClick,
159
+ children,
160
+ ...rest
161
+ }, ref) {
162
+ const handleClick = (event) => {
163
+ if (loading) {
164
+ event.preventDefault();
165
+ return;
166
+ }
167
+ onClick?.(event);
168
+ };
169
+ const leading = loading ? /* @__PURE__ */ jsx5(Spinner, { size: "sm", label: "" }) : startIcon;
170
+ return /* @__PURE__ */ jsxs3(
171
+ "button",
172
+ {
173
+ ref,
174
+ type,
175
+ className: cx(button({ variant, color, size, fullWidth }), className),
176
+ "aria-busy": loading || void 0,
177
+ "aria-disabled": loading || void 0,
178
+ onClick: handleClick,
179
+ ...rest,
180
+ children: [
181
+ leading && /* @__PURE__ */ jsx5("span", { className: icon, children: leading }),
182
+ children,
183
+ endIcon && /* @__PURE__ */ jsx5("span", { className: icon, children: endIcon })
184
+ ]
185
+ }
186
+ );
187
+ });
188
+
189
+ // src/components/Input/Input.css.ts
190
+ import { createRuntimeFn as _7a4683 } from "@vanilla-extract/recipes/createRuntimeFn";
191
+ var adornment = "_19p5zvh6";
192
+ var field = "_19p5zvh7";
193
+ var fieldFullWidth = "_19p5zvh8";
194
+ var helperText = /* @__PURE__ */ _7a4683({ defaultClassName: "_19p5zvhb", variantClassNames: { error: { true: "_19p5zvhc" } }, defaultVariants: {}, compoundVariants: [] });
195
+ var input = "_19p5zvh5";
196
+ var label = "_19p5zvh9";
197
+ var requiredMark = "_19p5zvha";
198
+ var root3 = /* @__PURE__ */ _7a4683({ defaultClassName: "_19p5zvh0", variantClassNames: { size: { sm: "_19p5zvh1", md: "_19p5zvh2", lg: "_19p5zvh3" }, fullWidth: { true: "_19p5zvh4" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
199
+
200
+ // src/components/Input/Input.tsx
201
+ import { forwardRef as forwardRef5 } from "react";
202
+ import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
203
+ var Input = /* @__PURE__ */ forwardRef5(function Input2({ size, invalid, fullWidth, startAdornment, endAdornment, rootClassName, className, disabled, ...rest }, ref) {
204
+ return /* @__PURE__ */ jsxs4(
205
+ "div",
206
+ {
207
+ className: cx(root3({ size, fullWidth }), rootClassName),
208
+ "data-invalid": invalid || void 0,
209
+ "data-disabled": disabled || void 0,
210
+ children: [
211
+ startAdornment && /* @__PURE__ */ jsx6("span", { className: adornment, children: startAdornment }),
212
+ /* @__PURE__ */ jsx6(
213
+ "input",
214
+ {
215
+ ref,
216
+ className: cx(input, className),
217
+ disabled,
218
+ "aria-invalid": invalid || void 0,
219
+ ...rest
220
+ }
221
+ ),
222
+ endAdornment && /* @__PURE__ */ jsx6("span", { className: adornment, children: endAdornment })
223
+ ]
224
+ }
225
+ );
226
+ });
227
+
228
+ // src/components/Input/TextField.tsx
229
+ import { forwardRef as forwardRef6, useId } from "react";
230
+ import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
231
+ var TextField = /* @__PURE__ */ forwardRef6(function TextField2({ label: label6, helperText: helperText3, error, required, fullWidth, id, "aria-describedby": ariaDescribedBy, ...rest }, ref) {
232
+ const generatedId = useId();
233
+ const inputId = id ?? generatedId;
234
+ const helperId = helperText3 ? `${inputId}-helper` : void 0;
235
+ return /* @__PURE__ */ jsxs5("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
236
+ label6 && /* @__PURE__ */ jsxs5("label", { htmlFor: inputId, className: label, children: [
237
+ label6,
238
+ required && /* @__PURE__ */ jsx7("span", { className: requiredMark, "aria-hidden": true, children: "*" })
239
+ ] }),
240
+ /* @__PURE__ */ jsx7(
241
+ Input,
242
+ {
243
+ ref,
244
+ id: inputId,
245
+ invalid: error,
246
+ required,
247
+ fullWidth,
248
+ "aria-describedby": cx(helperId, ariaDescribedBy) || void 0,
249
+ ...rest
250
+ }
251
+ ),
252
+ helperText3 && /* @__PURE__ */ jsx7("p", { id: helperId, className: helperText({ error }), children: helperText3 })
253
+ ] });
254
+ });
255
+
256
+ // src/components/Modal/Modal.tsx
257
+ import * as Dialog from "@radix-ui/react-dialog";
258
+ import { XIcon } from "@bestow-ui/icons";
259
+
260
+ // src/utils/useReturnFocus.ts
261
+ import { useRef } from "react";
262
+ function useReturnFocus(hasTrigger, onCloseAutoFocus) {
263
+ const returnTo = useRef(null);
264
+ return {
265
+ onOpenAutoFocus: () => {
266
+ returnTo.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
267
+ },
268
+ onCloseAutoFocus: (event) => {
269
+ onCloseAutoFocus?.(event);
270
+ if (event.defaultPrevented || hasTrigger) return;
271
+ const target = returnTo.current;
272
+ if (target && target.isConnected && target !== document.body) {
273
+ event.preventDefault();
274
+ target.focus();
275
+ }
276
+ }
277
+ };
278
+ }
279
+
280
+ // src/components/Modal/Modal.css.ts
281
+ import { createRuntimeFn as _7a4684 } from "@vanilla-extract/recipes/createRuntimeFn";
282
+ var body = "_1pdsmv0a";
283
+ var closeButton = "_1pdsmv09";
284
+ var content2 = /* @__PURE__ */ _7a4684({ defaultClassName: "_1pdsmv01", variantClassNames: { size: { sm: "_1pdsmv02", md: "_1pdsmv03", lg: "_1pdsmv04" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
285
+ var description = "_1pdsmv08";
286
+ var footer = "_1pdsmv0b";
287
+ var header2 = "_1pdsmv05";
288
+ var headings = "_1pdsmv06";
289
+ var overlay = "_1pdsmv00";
290
+ var title = "_1pdsmv07";
291
+
292
+ // src/components/Modal/Modal.tsx
293
+ import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
294
+ function Modal({
295
+ open,
296
+ defaultOpen,
297
+ onOpenChange,
298
+ trigger: trigger4,
299
+ title: title6,
300
+ description: description6,
301
+ children,
302
+ footer: footer6,
303
+ size,
304
+ hideCloseButton = false,
305
+ closeOnOverlayClick = true,
306
+ className,
307
+ onCloseAutoFocus
308
+ }) {
309
+ const portal2 = usePortalProps();
310
+ const m = useMessages();
311
+ const focus = useReturnFocus(Boolean(trigger4), onCloseAutoFocus);
312
+ return /* @__PURE__ */ jsxs6(Dialog.Root, { open, defaultOpen, onOpenChange, children: [
313
+ trigger4 && /* @__PURE__ */ jsx8(Dialog.Trigger, { asChild: true, children: trigger4 }),
314
+ /* @__PURE__ */ jsxs6(Dialog.Portal, { children: [
315
+ /* @__PURE__ */ jsx8(Dialog.Overlay, { className: cx(portal2.className, overlay), style: portal2.style }),
316
+ /* @__PURE__ */ jsxs6(
317
+ Dialog.Content,
318
+ {
319
+ className: cx(portal2.className, content2({ size }), className),
320
+ style: portal2.style,
321
+ onPointerDownOutside: closeOnOverlayClick ? void 0 : (event) => event.preventDefault(),
322
+ onOpenAutoFocus: focus.onOpenAutoFocus,
323
+ onCloseAutoFocus: focus.onCloseAutoFocus,
324
+ ...description6 ? {} : { "aria-describedby": void 0 },
325
+ children: [
326
+ /* @__PURE__ */ jsxs6("div", { className: header2, children: [
327
+ /* @__PURE__ */ jsxs6("div", { className: headings, children: [
328
+ /* @__PURE__ */ jsx8(Dialog.Title, { className: title, children: title6 }),
329
+ description6 && /* @__PURE__ */ jsx8(Dialog.Description, { className: description, children: description6 })
330
+ ] }),
331
+ !hideCloseButton && /* @__PURE__ */ jsx8(Dialog.Close, { className: closeButton, "aria-label": m.close ?? "\uB2EB\uAE30", children: /* @__PURE__ */ jsx8(XIcon, { size: 16 }) })
332
+ ] }),
333
+ children && /* @__PURE__ */ jsx8("div", { className: body, children }),
334
+ footer6 && /* @__PURE__ */ jsx8("div", { className: footer, children: footer6 })
335
+ ]
336
+ }
337
+ )
338
+ ] })
339
+ ] });
340
+ }
341
+ var ModalClose = Dialog.Close;
342
+
343
+ // src/components/AddressInput/AddressInput.css.ts
344
+ var fieldset = "_16fi7uy0";
345
+ var legend = "_16fi7uy1";
346
+ var row = "_16fi7uy2";
347
+ var searchArea = "_16fi7uy4";
348
+ var searchStatus = "_16fi7uy5";
349
+ var zonecode = "_16fi7uy3";
350
+
351
+ // src/components/AddressInput/AddressInput.tsx
352
+ import { Fragment, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
353
+ var EMPTY = { zonecode: "", address: "", extraAddress: "", detail: "" };
354
+ function SearchArea({
355
+ provider,
356
+ onSelect,
357
+ loadErrorText,
358
+ loadingText
359
+ }) {
360
+ const containerRef = useRef2(null);
361
+ const [status, setStatus] = useState("loading");
362
+ const onSelectRef = useRef2(onSelect);
363
+ useEffect(() => {
364
+ onSelectRef.current = onSelect;
365
+ });
366
+ useEffect(() => {
367
+ const container2 = containerRef.current;
368
+ if (!container2) return;
369
+ let cleanup;
370
+ let cancelled = false;
371
+ Promise.resolve().then(() => provider(container2, (result) => onSelectRef.current(result))).then((fn) => {
372
+ if (cancelled) fn?.();
373
+ else {
374
+ cleanup = fn;
375
+ setStatus("ready");
376
+ }
377
+ }).catch(() => !cancelled && setStatus("error"));
378
+ return () => {
379
+ cancelled = true;
380
+ cleanup?.();
381
+ };
382
+ }, [provider]);
383
+ return /* @__PURE__ */ jsxs7("div", { className: searchArea, children: [
384
+ /* @__PURE__ */ jsx9("div", { ref: containerRef, style: { width: "100%", height: "100%" } }),
385
+ status !== "ready" && /* @__PURE__ */ jsx9("div", { className: searchStatus, role: "status", children: status === "loading" ? /* @__PURE__ */ jsx9(Spinner, { label: loadingText }) : loadErrorText })
386
+ ] });
387
+ }
388
+ var AddressInput = /* @__PURE__ */ forwardRef7(
389
+ function AddressInput2(props, ref) {
390
+ const {
391
+ value: value4,
392
+ defaultValue,
393
+ onValueChange,
394
+ label: labelProp,
395
+ required,
396
+ helperText: helperText3,
397
+ error,
398
+ disabled,
399
+ provider = kakaoPostcodeProvider,
400
+ searchLabel: searchLabelProp,
401
+ detailPlaceholder: detailPlaceholderProp,
402
+ loadErrorText: loadErrorTextProp,
403
+ name,
404
+ className
405
+ } = props;
406
+ const m = useMessages();
407
+ const label6 = labelProp ?? m.address ?? "\uC8FC\uC18C";
408
+ const searchLabel = searchLabelProp ?? m.addressSearch ?? "\uC8FC\uC18C \uAC80\uC0C9";
409
+ const detailPlaceholder = detailPlaceholderProp ?? m.detailAddressPlaceholder ?? "\uC0C1\uC138 \uC8FC\uC18C (\uB3D9\xB7\uD638\uC218 \uB4F1)";
410
+ 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.";
411
+ const baseId = useId2();
412
+ const helperId = helperText3 ? `${baseId}-helper` : void 0;
413
+ const detailRef = useRef2(null);
414
+ const selectedRef = useRef2(false);
415
+ const [open, setOpen] = useState(false);
416
+ const isControlled = "value" in props;
417
+ const [innerValue, setInnerValue] = useState(defaultValue ?? EMPTY);
418
+ const current2 = isControlled ? value4 ?? EMPTY : innerValue;
419
+ const update = (next) => {
420
+ if (!isControlled) setInnerValue(next);
421
+ onValueChange?.(next);
422
+ };
423
+ const openSearch = () => {
424
+ if (disabled) return;
425
+ selectedRef.current = false;
426
+ setOpen(true);
427
+ };
428
+ const handleSelect = (result) => {
429
+ selectedRef.current = true;
430
+ update({
431
+ ...current2,
432
+ zonecode: result.zonecode,
433
+ address: result.address,
434
+ extraAddress: result.extraAddress ?? ""
435
+ });
436
+ setOpen(false);
437
+ };
438
+ const fullAddress = `${current2.address}${current2.extraAddress ?? ""}`;
439
+ return /* @__PURE__ */ jsxs7("fieldset", { ref, className: cx(fieldset, className), disabled, "aria-describedby": helperId, children: [
440
+ /* @__PURE__ */ jsxs7("legend", { className: legend, children: [
441
+ label6,
442
+ required && /* @__PURE__ */ jsx9("span", { className: requiredMark, "aria-hidden": true, children: "*" })
443
+ ] }),
444
+ /* @__PURE__ */ jsxs7("div", { className: row, children: [
445
+ /* @__PURE__ */ jsx9(
446
+ TextField,
447
+ {
448
+ "aria-label": m.postalCode ?? "\uC6B0\uD3B8\uBC88\uD638",
449
+ readOnly: true,
450
+ value: current2.zonecode,
451
+ placeholder: m.postalCode ?? "\uC6B0\uD3B8\uBC88\uD638",
452
+ error: error && !current2.zonecode,
453
+ "aria-required": required || void 0,
454
+ rootClassName: zonecode,
455
+ onClick: openSearch
456
+ }
457
+ ),
458
+ /* @__PURE__ */ jsx9(Button, { variant: "outline", color: "neutral", onClick: openSearch, disabled, children: searchLabel })
459
+ ] }),
460
+ /* @__PURE__ */ jsx9(
461
+ TextField,
462
+ {
463
+ "aria-label": m.baseAddress ?? "\uAE30\uBCF8 \uC8FC\uC18C",
464
+ readOnly: true,
465
+ value: fullAddress,
466
+ placeholder: m.baseAddressPlaceholder ?? `${searchLabel}\uC744 \uB20C\uB7EC \uC8FC\uC18C\uB97C \uACE0\uB974\uC138\uC694`,
467
+ error: error && !current2.address,
468
+ "aria-required": required || void 0,
469
+ fullWidth: true,
470
+ onClick: openSearch
471
+ }
472
+ ),
473
+ /* @__PURE__ */ jsx9(
474
+ TextField,
475
+ {
476
+ ref: detailRef,
477
+ "aria-label": m.detailAddress ?? "\uC0C1\uC138 \uC8FC\uC18C",
478
+ value: current2.detail,
479
+ placeholder: detailPlaceholder,
480
+ onChange: (event) => update({ ...current2, detail: event.target.value }),
481
+ autoComplete: "address-line2",
482
+ fullWidth: true
483
+ }
484
+ ),
485
+ helperText3 && /* @__PURE__ */ jsx9("p", { id: helperId, className: helperText({ error }), children: helperText3 }),
486
+ name && /* @__PURE__ */ jsxs7(Fragment, { children: [
487
+ /* @__PURE__ */ jsx9("input", { type: "hidden", name: `${name}[zonecode]`, value: current2.zonecode }),
488
+ /* @__PURE__ */ jsx9("input", { type: "hidden", name: `${name}[address]`, value: fullAddress }),
489
+ /* @__PURE__ */ jsx9("input", { type: "hidden", name: `${name}[detail]`, value: current2.detail })
490
+ ] }),
491
+ /* @__PURE__ */ jsx9(
492
+ Modal,
493
+ {
494
+ open,
495
+ onOpenChange: setOpen,
496
+ title: searchLabel,
497
+ description: m.addressSearchDescription ?? "\uB3C4\uB85C\uBA85, \uAC74\uBB3C\uBA85, \uC9C0\uBC88\uC73C\uB85C \uAC80\uC0C9\uD560 \uC218 \uC788\uC5B4\uC694.",
498
+ onCloseAutoFocus: (event) => {
499
+ if (selectedRef.current) {
500
+ event.preventDefault();
501
+ detailRef.current?.focus();
502
+ }
503
+ },
504
+ children: /* @__PURE__ */ jsx9(
505
+ SearchArea,
506
+ {
507
+ provider,
508
+ onSelect: handleSelect,
509
+ loadErrorText,
510
+ loadingText: m.addressLoading ?? "\uC8FC\uC18C \uAC80\uC0C9\uC744 \uBD88\uB7EC\uC624\uB294 \uC911"
511
+ }
512
+ )
513
+ }
514
+ )
515
+ ] });
516
+ }
517
+ );
518
+
519
+ // src/components/AgreementGroup/AgreementGroup.tsx
520
+ import { forwardRef as forwardRef9, useId as useId3, useState as useState2 } from "react";
521
+ import { ChevronDownIcon as ChevronDownIcon2 } from "@bestow-ui/icons";
522
+
523
+ // src/components/Checkbox/Checkbox.tsx
524
+ import { forwardRef as forwardRef8, useEffect as useEffect2, useRef as useRef3 } from "react";
525
+
526
+ // src/utils/mergeRefs.ts
527
+ function mergeRefs(...refs) {
528
+ return (value4) => {
529
+ for (const ref of refs) {
530
+ if (typeof ref === "function") ref(value4);
531
+ else if (ref) ref.current = value4;
532
+ }
533
+ };
534
+ }
535
+
536
+ // src/components/Checkbox/Checkbox.css.ts
537
+ import { createRuntimeFn as _7a4685 } from "@vanilla-extract/recipes/createRuntimeFn";
538
+ var checkIcon = "_1y7mzsn8 _1y7mzsn7";
539
+ var control = /* @__PURE__ */ _7a4685({ defaultClassName: "_1y7mzsn3", variantClassNames: { size: { sm: "_1y7mzsn4", md: "_1y7mzsn5" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
540
+ var indeterminateIcon = "_1y7mzsn9 _1y7mzsn7";
541
+ var input2 = "_1y7mzsn6";
542
+ var root4 = /* @__PURE__ */ _7a4685({ defaultClassName: "_1y7mzsn0", variantClassNames: { size: { sm: "_1y7mzsn1", md: "_1y7mzsn2" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
543
+
544
+ // src/components/Checkbox/Checkbox.tsx
545
+ import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
546
+ var Checkbox = /* @__PURE__ */ forwardRef8(function Checkbox2({ label: label6, size, indeterminate = false, invalid, disabled, onChange, onCheckedChange, className, ...rest }, ref) {
547
+ const innerRef = useRef3(null);
548
+ useEffect2(() => {
549
+ if (innerRef.current) innerRef.current.indeterminate = indeterminate;
550
+ }, [indeterminate]);
551
+ return /* @__PURE__ */ jsxs8("label", { className: cx(root4({ size }), className), "data-disabled": disabled || void 0, children: [
552
+ /* @__PURE__ */ jsxs8("span", { className: control({ size }), children: [
553
+ /* @__PURE__ */ jsx10(
554
+ "input",
555
+ {
556
+ ref: mergeRefs(innerRef, ref),
557
+ type: "checkbox",
558
+ className: input2,
559
+ disabled,
560
+ "aria-invalid": invalid || void 0,
561
+ onChange: (event) => {
562
+ onChange?.(event);
563
+ onCheckedChange?.(event.target.checked);
564
+ },
565
+ ...rest
566
+ }
567
+ ),
568
+ /* @__PURE__ */ jsx10("svg", { className: checkIcon, viewBox: "0 0 20 20", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx10(
569
+ "path",
570
+ {
571
+ d: "M5 10.5l3.2 3L15 7",
572
+ stroke: "currentColor",
573
+ strokeWidth: "2",
574
+ strokeLinecap: "round",
575
+ strokeLinejoin: "round"
576
+ }
577
+ ) }),
578
+ /* @__PURE__ */ jsx10("svg", { className: indeterminateIcon, viewBox: "0 0 20 20", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx10("path", { d: "M6 10h8", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) })
579
+ ] }),
580
+ label6
581
+ ] });
582
+ });
583
+
584
+ // src/components/AgreementGroup/AgreementGroup.css.ts
585
+ var all = "j3uxdc3";
586
+ var box = "j3uxdc2";
587
+ var chevron2 = "j3uxdc9";
588
+ var content3 = "j3uxdca";
589
+ var fieldset2 = "j3uxdc0";
590
+ var item2 = "j3uxdc5";
591
+ var legend2 = "j3uxdc1";
592
+ var list = "j3uxdc4";
593
+ var row2 = "j3uxdc6";
594
+ var tag = "j3uxdc7";
595
+ var toggle = "j3uxdc8";
596
+
597
+ // src/components/AgreementGroup/AgreementGroup.tsx
598
+ import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
599
+ var AgreementGroup = /* @__PURE__ */ forwardRef9(
600
+ function AgreementGroup2(props, ref) {
601
+ const {
602
+ items: items2,
603
+ value: value4,
604
+ defaultValue,
605
+ onValueChange,
606
+ label: label6,
607
+ allLabel: allLabelProp,
608
+ helperText: helperText3,
609
+ error,
610
+ disabled,
611
+ requiredText: requiredTextProp,
612
+ optionalText: optionalTextProp,
613
+ showText: showTextProp,
614
+ hideText: hideTextProp,
615
+ name,
616
+ className
617
+ } = props;
618
+ const m = useMessages();
619
+ const allLabel = allLabelProp ?? m.agreeAll ?? "\uC804\uCCB4 \uB3D9\uC758";
620
+ const requiredText = requiredTextProp ?? m.required ?? "\uD544\uC218";
621
+ const optionalText = optionalTextProp ?? m.optional ?? "\uC120\uD0DD";
622
+ const showText = showTextProp ?? m.show ?? "\uBCF4\uAE30";
623
+ const hideText = hideTextProp ?? m.hide ?? "\uC811\uAE30";
624
+ const baseId = useId3();
625
+ const helperId = helperText3 ? `${baseId}-helper` : void 0;
626
+ const isControlled = "value" in props;
627
+ const [innerValue, setInnerValue] = useState2(defaultValue ?? []);
628
+ const agreed = isControlled ? value4 ?? [] : innerValue;
629
+ const [expanded, setExpanded] = useState2([]);
630
+ const update = (next) => {
631
+ if (!isControlled) setInnerValue(next);
632
+ onValueChange?.(next);
633
+ };
634
+ const allValues = items2.map((item8) => item8.value);
635
+ const agreedCount = allValues.filter((v) => agreed.includes(v)).length;
636
+ const allChecked = items2.length > 0 && agreedCount === items2.length;
637
+ const toggleItem = (itemValue, checked) => update(checked ? [...agreed.filter((v) => v !== itemValue), itemValue] : agreed.filter((v) => v !== itemValue));
638
+ return /* @__PURE__ */ jsxs9(
639
+ "fieldset",
640
+ {
641
+ ref,
642
+ className: cx(fieldset2, className),
643
+ disabled,
644
+ "aria-describedby": helperId,
645
+ "data-invalid": error || void 0,
646
+ children: [
647
+ label6 && /* @__PURE__ */ jsx11("legend", { className: legend2, children: label6 }),
648
+ /* @__PURE__ */ jsxs9("div", { className: box, children: [
649
+ /* @__PURE__ */ jsx11("div", { className: all, children: /* @__PURE__ */ jsx11(
650
+ Checkbox,
651
+ {
652
+ label: allLabel,
653
+ checked: allChecked,
654
+ indeterminate: agreedCount > 0 && !allChecked,
655
+ onChange: (event) => update(event.target.checked ? allValues : [])
656
+ }
657
+ ) }),
658
+ /* @__PURE__ */ jsx11("ul", { className: list, children: items2.map((item8) => {
659
+ const labelId = `${baseId}-${item8.value}-label`;
660
+ const toggleTextId = `${baseId}-${item8.value}-toggle`;
661
+ const contentId = `${baseId}-${item8.value}-content`;
662
+ const isOpen = expanded.includes(item8.value);
663
+ return /* @__PURE__ */ jsxs9("li", { className: item2, children: [
664
+ /* @__PURE__ */ jsxs9("div", { className: row2, children: [
665
+ /* @__PURE__ */ jsx11(
666
+ Checkbox,
667
+ {
668
+ size: "sm",
669
+ checked: agreed.includes(item8.value),
670
+ invalid: error && item8.required && !agreed.includes(item8.value),
671
+ onChange: (event) => toggleItem(item8.value, event.target.checked),
672
+ label: /* @__PURE__ */ jsxs9("span", { id: labelId, children: [
673
+ /* @__PURE__ */ jsx11("span", { className: tag, "data-required": item8.required || void 0, children: item8.required ? requiredText : optionalText }),
674
+ " ",
675
+ item8.label
676
+ ] })
677
+ }
678
+ ),
679
+ item8.content && /* @__PURE__ */ jsxs9(
680
+ "button",
681
+ {
682
+ type: "button",
683
+ className: toggle,
684
+ "aria-expanded": isOpen,
685
+ "aria-controls": contentId,
686
+ "aria-labelledby": `${labelId} ${toggleTextId}`,
687
+ onClick: () => setExpanded((prev) => isOpen ? prev.filter((v) => v !== item8.value) : [...prev, item8.value]),
688
+ children: [
689
+ /* @__PURE__ */ jsx11("span", { id: toggleTextId, children: isOpen ? hideText : showText }),
690
+ /* @__PURE__ */ jsx11(ChevronDownIcon2, { size: 14, className: chevron2 })
691
+ ]
692
+ }
693
+ )
694
+ ] }),
695
+ item8.content && isOpen && // 내용이 길면 스크롤된다 — 키보드로도 스크롤할 수 있게 포커스를 받는 이름 있는 영역으로 둔다
696
+ // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
697
+ /* @__PURE__ */ jsx11("div", { id: contentId, role: "region", "aria-labelledby": labelId, tabIndex: 0, className: content3, children: item8.content })
698
+ ] }, item8.value);
699
+ }) })
700
+ ] }),
701
+ name && agreed.map((v) => /* @__PURE__ */ jsx11("input", { type: "hidden", name, value: v }, v)),
702
+ helperText3 && /* @__PURE__ */ jsx11("p", { id: helperId, className: helperText({ error }), children: helperText3 })
703
+ ]
704
+ }
705
+ );
706
+ }
707
+ );
708
+
709
+ // src/components/Alert/Alert.tsx
710
+ import { forwardRef as forwardRef10 } from "react";
711
+ import { CircleAlertIcon, CircleCheckIcon, InfoIcon, TriangleAlertIcon, XIcon as XIcon2 } from "@bestow-ui/icons";
712
+
713
+ // src/components/Alert/Alert.css.ts
714
+ import { createRuntimeFn as _7a4686 } from "@vanilla-extract/recipes/createRuntimeFn";
715
+ var action = "bsmpc0j";
716
+ var alert = /* @__PURE__ */ _7a4686({ defaultClassName: "bsmpc06", variantClassNames: { variant: { soft: "bsmpc07", outline: "bsmpc08", solid: "bsmpc09" }, color: { primary: "bsmpc0a", neutral: "bsmpc0b", danger: "bsmpc0c", success: "bsmpc0d", warning: "bsmpc0e" } }, defaultVariants: { variant: "soft", color: "primary" }, compoundVariants: [] });
717
+ var closeButton2 = "bsmpc0k";
718
+ var content4 = "bsmpc0g";
719
+ var description2 = "bsmpc0i";
720
+ var icon2 = "bsmpc0f";
721
+ var title2 = "bsmpc0h";
722
+
723
+ // src/components/Alert/Alert.tsx
724
+ import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
725
+ var defaultIcons = {
726
+ primary: InfoIcon,
727
+ neutral: InfoIcon,
728
+ success: CircleCheckIcon,
729
+ warning: TriangleAlertIcon,
730
+ danger: CircleAlertIcon
731
+ };
732
+ var Alert = /* @__PURE__ */ forwardRef10(function Alert2({
733
+ variant,
734
+ color = "primary",
735
+ title: title6,
736
+ icon: icon7,
737
+ action: action3,
738
+ onClose,
739
+ closeLabel: closeLabelProp,
740
+ className,
741
+ children,
742
+ ...rest
743
+ }, ref) {
744
+ const m = useMessages();
745
+ const closeLabel = closeLabelProp ?? m.close ?? "\uB2EB\uAE30";
746
+ const DefaultIcon = defaultIcons[color];
747
+ const iconNode = icon7 === void 0 ? /* @__PURE__ */ jsx12(DefaultIcon, { size: 18 }) : icon7;
748
+ return /* @__PURE__ */ jsxs10("div", { ref, className: cx(alert({ variant, color }), className), ...rest, children: [
749
+ iconNode !== false && iconNode !== null && /* @__PURE__ */ jsx12("span", { className: icon2, "aria-hidden": true, children: iconNode }),
750
+ /* @__PURE__ */ jsxs10("div", { className: content4, children: [
751
+ title6 && /* @__PURE__ */ jsx12("div", { className: title2, children: title6 }),
752
+ children && /* @__PURE__ */ jsx12("div", { className: description2, children })
753
+ ] }),
754
+ action3 && /* @__PURE__ */ jsx12("div", { className: action, children: action3 }),
755
+ onClose && /* @__PURE__ */ jsx12("button", { type: "button", className: closeButton2, "aria-label": closeLabel, onClick: onClose, children: /* @__PURE__ */ jsx12(XIcon2, { size: 16 }) })
756
+ ] });
757
+ });
758
+
759
+ // src/components/AmountInput/AmountInput.tsx
760
+ import { forwardRef as forwardRef11, useRef as useRef5 } from "react";
761
+
762
+ // src/utils/useFormattedInput.ts
763
+ import { useRef as useRef4, useState as useState3 } from "react";
764
+
765
+ // src/utils/useIsomorphicLayoutEffect.ts
766
+ import { useEffect as useEffect3, useLayoutEffect } from "react";
767
+ var useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect3;
768
+
769
+ // src/utils/useFormattedInput.ts
770
+ function caretAfter(display, count2, isMeaningful) {
771
+ if (count2 <= 0) return 0;
772
+ let seen = 0;
773
+ for (let i = 0; i < display.length; i++) {
774
+ if (isMeaningful(display[i])) seen++;
775
+ if (seen === count2) return i + 1;
776
+ }
777
+ return display.length;
778
+ }
779
+ function useFormattedInput({
780
+ isControlled,
781
+ value: value4,
782
+ defaultValue,
783
+ onValueChange,
784
+ sanitize: sanitize4,
785
+ format: format2,
786
+ isMeaningful,
787
+ inputRef
788
+ }) {
789
+ const [innerValue, setInnerValue] = useState3(() => sanitize4(defaultValue ?? ""));
790
+ const raw = isControlled ? sanitize4(value4 ?? "") : innerValue;
791
+ const display = format2(raw);
792
+ const pendingCaret = useRef4(null);
793
+ useIsomorphicLayoutEffect(() => {
794
+ const input5 = inputRef.current;
795
+ if (pendingCaret.current === null || !input5 || document.activeElement !== input5) return;
796
+ const position = caretAfter(input5.value, pendingCaret.current, isMeaningful);
797
+ input5.setSelectionRange(position, position);
798
+ pendingCaret.current = null;
799
+ });
800
+ const commit = (next, caretCount) => {
801
+ pendingCaret.current = caretCount;
802
+ if (!isControlled) setInnerValue(next);
803
+ if (next !== raw) onValueChange?.(next);
804
+ };
805
+ const onChange = (event) => {
806
+ const { value: typed, selectionStart } = event.target;
807
+ const next = sanitize4(typed);
808
+ const before = sanitize4(typed.slice(0, selectionStart ?? typed.length));
809
+ commit(next, Math.min(before.length, next.length));
810
+ };
811
+ const onKeyDown = (event) => {
812
+ const input5 = event.currentTarget;
813
+ const { selectionStart: start, selectionEnd: end } = input5;
814
+ if (start === null || start !== end) return;
815
+ const countBefore = (text2) => [...text2].filter(isMeaningful).length;
816
+ if (event.key === "Backspace" && start > 0 && !isMeaningful(input5.value[start - 1])) {
817
+ const index = countBefore(input5.value.slice(0, start)) - 1;
818
+ if (index < 0) return;
819
+ event.preventDefault();
820
+ commit(raw.slice(0, index) + raw.slice(index + 1), index);
821
+ } else if (event.key === "Delete" && start < input5.value.length && !isMeaningful(input5.value[start])) {
822
+ const index = countBefore(input5.value.slice(0, start));
823
+ if (index >= raw.length) return;
824
+ event.preventDefault();
825
+ commit(raw.slice(0, index) + raw.slice(index + 1), index);
826
+ }
827
+ };
828
+ const setRaw = (next) => setInnerValue(sanitize4(next));
829
+ return { raw, display, onChange, onKeyDown, setRaw };
830
+ }
831
+
832
+ // src/components/AmountInput/AmountInput.css.ts
833
+ var input3 = "_70qkav0";
834
+
835
+ // src/components/AmountInput/AmountInput.tsx
836
+ import { Fragment as Fragment2, jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
837
+ var MAX_DIGITS = 15;
838
+ var isDigit = (char) => /\d/.test(char);
839
+ var AmountInput = /* @__PURE__ */ forwardRef11(
840
+ function AmountInput2(props, ref) {
841
+ const {
842
+ value: value4,
843
+ defaultValue,
844
+ onValueChange,
845
+ max,
846
+ unit: unitProp,
847
+ showKoreanAmount = true,
848
+ label: labelProp,
849
+ placeholder = "0",
850
+ helperText: helperText3,
851
+ onKeyDown,
852
+ className,
853
+ ...rest
854
+ } = props;
855
+ const inputRef = useRef5(null);
856
+ const m = useMessages();
857
+ const unit = unitProp ?? m.currencyUnit ?? "\uC6D0";
858
+ const label6 = labelProp ?? m.amount ?? "\uAE08\uC561";
859
+ const sanitize4 = (input5) => {
860
+ let digits = input5.replace(/\D/g, "").replace(/^0+(?=\d)/, "").slice(0, MAX_DIGITS);
861
+ if (max !== void 0 && digits && Number(digits) > max) digits = String(Math.floor(max));
862
+ return digits;
863
+ };
864
+ const toRaw = (amount) => amount === null || amount === void 0 ? "" : String(Math.floor(Math.abs(amount)));
865
+ const field3 = useFormattedInput({
866
+ isControlled: "value" in props,
867
+ value: toRaw(value4),
868
+ defaultValue: toRaw(defaultValue),
869
+ onValueChange: (digits) => onValueChange?.(digits === "" ? null : Number(digits)),
870
+ sanitize: sanitize4,
871
+ format: (digits) => digits === "" ? "" : Number(digits).toLocaleString("ko-KR"),
872
+ isMeaningful: isDigit,
873
+ inputRef
874
+ });
875
+ const reading = showKoreanAmount && field3.raw !== "" ? formatKoreanAmount(Number(field3.raw), unit) : null;
876
+ return /* @__PURE__ */ jsx13(
877
+ TextField,
878
+ {
879
+ ref: mergeRefs(ref, inputRef),
880
+ label: label6,
881
+ placeholder,
882
+ inputMode: "numeric",
883
+ value: field3.display,
884
+ onChange: field3.onChange,
885
+ onKeyDown: (event) => {
886
+ field3.onKeyDown(event);
887
+ onKeyDown?.(event);
888
+ },
889
+ endAdornment: unit,
890
+ helperText: reading && helperText3 ? /* @__PURE__ */ jsxs11(Fragment2, { children: [
891
+ reading,
892
+ /* @__PURE__ */ jsx13("br", {}),
893
+ helperText3
894
+ ] }) : reading ?? helperText3,
895
+ className: cx(input3, className),
896
+ ...rest
897
+ }
898
+ );
899
+ }
900
+ );
901
+
902
+ // src/components/Avatar/Avatar.tsx
903
+ import * as RadixAvatar from "@radix-ui/react-avatar";
904
+ import { UserIcon } from "@bestow-ui/icons";
905
+ import { forwardRef as forwardRef12 } from "react";
906
+
907
+ // src/components/Avatar/Avatar.css.ts
908
+ import { createRuntimeFn as _7a4687 } from "@vanilla-extract/recipes/createRuntimeFn";
909
+ var fallback = "_1fd2kp27";
910
+ var image = "_1fd2kp26";
911
+ var root5 = /* @__PURE__ */ _7a4687({ defaultClassName: "_1fd2kp20", variantClassNames: { size: { sm: "_1fd2kp21", md: "_1fd2kp22", lg: "_1fd2kp23" }, shape: { circle: "_1fd2kp24", square: "_1fd2kp25" } }, defaultVariants: { size: "md", shape: "circle" }, compoundVariants: [] });
912
+
913
+ // src/components/Avatar/Avatar.tsx
914
+ import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
915
+ function getInitials(name) {
916
+ const [a = "", b = ""] = name.trim().split(/\s+/);
917
+ const first = (word) => Array.from(word)[0] ?? "";
918
+ return (first(a) + first(b)).toUpperCase();
919
+ }
920
+ var Avatar = /* @__PURE__ */ forwardRef12(function Avatar2({ src, alt, name, fallback: fallback2, size, shape, className, ...rest }, ref) {
921
+ const label6 = alt ?? name;
922
+ const a11y = label6 ? { role: "img", "aria-label": label6 } : { "aria-hidden": true };
923
+ const initials = name ? getInitials(name) : "";
924
+ return /* @__PURE__ */ jsxs12(RadixAvatar.Root, { ref, className: cx(root5({ size, shape }), className), ...a11y, ...rest, children: [
925
+ src && /* @__PURE__ */ jsx14(RadixAvatar.Image, { src, alt: "", className: image }),
926
+ /* @__PURE__ */ jsx14(RadixAvatar.Fallback, { className: fallback, children: fallback2 ?? (initials || /* @__PURE__ */ jsx14(UserIcon, { size: "60%" })) })
927
+ ] });
928
+ });
929
+
930
+ // src/components/Badge/Badge.tsx
931
+ import { forwardRef as forwardRef13 } from "react";
932
+
933
+ // src/components/Badge/Badge.css.ts
934
+ import { createRuntimeFn as _7a4688 } from "@vanilla-extract/recipes/createRuntimeFn";
935
+ var badge = /* @__PURE__ */ _7a4688({ defaultClassName: "_1295cfn4", variantClassNames: { variant: { solid: "_1295cfn5", soft: "_1295cfn6", outline: "_1295cfn7" }, color: { primary: "_1295cfn8", neutral: "_1295cfn9", danger: "_1295cfna", success: "_1295cfnb", warning: "_1295cfnc" }, size: { sm: "_1295cfnd", md: "_1295cfne", lg: "_1295cfnf" } }, defaultVariants: { variant: "soft", color: "neutral", size: "md" }, compoundVariants: [] });
936
+ var icon3 = "_1295cfng";
937
+
938
+ // src/components/Badge/Badge.tsx
939
+ import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
940
+ var Badge = /* @__PURE__ */ forwardRef13(function Badge2({ variant, color, size, startIcon, className, children, ...rest }, ref) {
941
+ return /* @__PURE__ */ jsxs13("span", { ref, className: cx(badge({ variant, color, size }), className), ...rest, children: [
942
+ startIcon && /* @__PURE__ */ jsx15("span", { className: icon3, children: startIcon }),
943
+ children
944
+ ] });
945
+ });
946
+
947
+ // src/components/Breadcrumb/Breadcrumb.tsx
948
+ import { forwardRef as forwardRef15 } from "react";
949
+ import { ChevronRightIcon } from "@bestow-ui/icons";
950
+
951
+ // src/components/Link/Link.tsx
952
+ import { Slot } from "@radix-ui/react-slot";
953
+ import { forwardRef as forwardRef14 } from "react";
954
+ import { ExternalLinkIcon } from "@bestow-ui/icons";
955
+
956
+ // src/components/Link/Link.css.ts
957
+ import { createRuntimeFn as _7a4689 } from "@vanilla-extract/recipes/createRuntimeFn";
958
+ var externalIcon = "_1t4hlp6";
959
+ var link = /* @__PURE__ */ _7a4689({ defaultClassName: "_1t4hlp0", variantClassNames: { color: { primary: "_1t4hlp1", neutral: "_1t4hlp2", inherit: "_1t4hlp3" }, underline: { always: "_1t4hlp4", hover: "_1t4hlp5" } }, defaultVariants: { color: "primary", underline: "always" }, compoundVariants: [] });
960
+
961
+ // src/components/Link/Link.tsx
962
+ import { Fragment as Fragment3, jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
963
+ var Link = /* @__PURE__ */ forwardRef14(function Link2({
964
+ as: Component = "a",
965
+ asChild,
966
+ color,
967
+ underline,
968
+ external,
969
+ externalLabel: externalLabelProp,
970
+ target,
971
+ rel,
972
+ className,
973
+ children,
974
+ ...rest
975
+ }, ref) {
976
+ const m = useMessages();
977
+ const externalLabel = externalLabelProp ?? m.newWindow ?? "(\uC0C8 \uCC3D)";
978
+ const linkClassName = cx(link({ color, underline }), className);
979
+ if (asChild) {
980
+ return (
981
+ // Slot 의 props 타입은 HTMLElement 기준이라 <a> 전용 속성(target·rel 등)은 그대로 넘기도록 단언한다
982
+ /* @__PURE__ */ jsx16(Slot, { ref, className: linkClassName, ...{ target, rel, ...rest }, children })
983
+ );
984
+ }
985
+ return /* @__PURE__ */ jsxs14(
986
+ Component,
987
+ {
988
+ ref,
989
+ className: linkClassName,
990
+ target: external ? target ?? "_blank" : target,
991
+ rel: external ? rel ?? "noopener noreferrer" : rel,
992
+ ...rest,
993
+ children: [
994
+ children,
995
+ external && /* @__PURE__ */ jsxs14(Fragment3, { children: [
996
+ " ",
997
+ /* @__PURE__ */ jsx16(ExternalLinkIcon, { className: externalIcon }),
998
+ /* @__PURE__ */ jsx16("span", { className: visuallyHidden, children: externalLabel })
999
+ ] })
1000
+ ]
1001
+ }
1002
+ );
1003
+ });
1004
+
1005
+ // src/components/Breadcrumb/Breadcrumb.css.ts
1006
+ var current = "_18t8ztt3";
1007
+ var item3 = "_18t8ztt1";
1008
+ var link2 = "_18t8ztt2";
1009
+ var list2 = "_18t8ztt0";
1010
+ var separator = "_18t8ztt4";
1011
+
1012
+ // src/components/Breadcrumb/Breadcrumb.tsx
1013
+ import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
1014
+ var Breadcrumb = /* @__PURE__ */ forwardRef15(function Breadcrumb2({ items: items2, linkAs, separator: separator3, "aria-label": ariaLabelProp, className, ...rest }, ref) {
1015
+ const m = useMessages();
1016
+ const ariaLabel = ariaLabelProp ?? m.breadcrumb ?? "\uC774\uB3D9 \uACBD\uB85C";
1017
+ const sep = separator3 ?? /* @__PURE__ */ jsx17(ChevronRightIcon, { size: 14 });
1018
+ return /* @__PURE__ */ jsx17("nav", { ref, "aria-label": ariaLabel, className, ...rest, children: /* @__PURE__ */ jsx17("ol", { className: list2, children: items2.map((item8, index) => {
1019
+ const isCurrent = index === items2.length - 1;
1020
+ return /* @__PURE__ */ jsxs15("li", { className: item3, children: [
1021
+ index > 0 && /* @__PURE__ */ jsx17("span", { className: separator, "aria-hidden": true, children: sep }),
1022
+ isCurrent || item8.href === void 0 ? /* @__PURE__ */ jsx17("span", { className: isCurrent ? current : void 0, "aria-current": isCurrent ? "page" : void 0, children: item8.label }) : /* @__PURE__ */ jsx17(Link, { as: linkAs, href: item8.href, color: "neutral", underline: "hover", className: link2, children: item8.label })
1023
+ ] }, index);
1024
+ }) }) });
1025
+ });
1026
+
1027
+ // src/components/BusinessNumberInput/BusinessNumberInput.tsx
1028
+ import { forwardRef as forwardRef16, useRef as useRef6, useState as useState4 } from "react";
1029
+ import { jsx as jsx18 } from "react/jsx-runtime";
1030
+ var sanitize = (input5) => input5.replace(/\D/g, "").slice(0, 10);
1031
+ var isDigit2 = (char) => /\d/.test(char);
1032
+ var BusinessNumberInput = /* @__PURE__ */ forwardRef16(
1033
+ function BusinessNumberInput2(props, ref) {
1034
+ const {
1035
+ value: value4,
1036
+ defaultValue,
1037
+ onValueChange,
1038
+ validate = true,
1039
+ invalidText: invalidTextProp,
1040
+ label: labelProp,
1041
+ placeholder = "000-00-00000",
1042
+ error,
1043
+ helperText: helperText3,
1044
+ onBlur,
1045
+ onKeyDown,
1046
+ ...rest
1047
+ } = props;
1048
+ const inputRef = useRef6(null);
1049
+ const m = useMessages();
1050
+ 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.";
1051
+ const label6 = labelProp ?? m.businessNumber ?? "\uC0AC\uC5C5\uC790\uB4F1\uB85D\uBC88\uD638";
1052
+ const incompleteText = m.businessNumberIncomplete ?? "10\uC790\uB9AC\uB97C \uBAA8\uB450 \uC785\uB825\uD574 \uC8FC\uC138\uC694.";
1053
+ const [touched, setTouched] = useState4(false);
1054
+ const field3 = useFormattedInput({
1055
+ isControlled: "value" in props,
1056
+ value: value4,
1057
+ defaultValue,
1058
+ onValueChange: (digits) => onValueChange?.(digits, digits.length === 10 ? isValidBusinessNumber(digits) : null),
1059
+ sanitize,
1060
+ format: formatBusinessNumber,
1061
+ isMeaningful: isDigit2,
1062
+ inputRef
1063
+ });
1064
+ const complete = field3.raw.length === 10;
1065
+ const autoInvalid = validate && field3.raw.length > 0 && (complete ? !isValidBusinessNumber(field3.raw) : touched);
1066
+ const showAuto = autoInvalid && error === void 0;
1067
+ return /* @__PURE__ */ jsx18(
1068
+ TextField,
1069
+ {
1070
+ ref: mergeRefs(ref, inputRef),
1071
+ label: label6,
1072
+ placeholder,
1073
+ inputMode: "numeric",
1074
+ value: field3.display,
1075
+ onChange: field3.onChange,
1076
+ onKeyDown: (event) => {
1077
+ field3.onKeyDown(event);
1078
+ onKeyDown?.(event);
1079
+ },
1080
+ onBlur: (event) => {
1081
+ setTouched(true);
1082
+ onBlur?.(event);
1083
+ },
1084
+ error: error ?? autoInvalid,
1085
+ helperText: showAuto ? complete ? invalidText : incompleteText : helperText3,
1086
+ ...rest
1087
+ }
1088
+ );
1089
+ }
1090
+ );
1091
+
1092
+ // src/components/Calendar/Calendar.tsx
1093
+ import { forwardRef as forwardRef18, useEffect as useEffect4, useId as useId4, useRef as useRef7, useState as useState5 } from "react";
1094
+ import { ChevronLeftIcon, ChevronRightIcon as ChevronRightIcon2 } from "@bestow-ui/icons";
1095
+
1096
+ // src/utils/useIsClient.ts
1097
+ import { useSyncExternalStore } from "react";
1098
+ var subscribeNothing = () => () => {
1099
+ };
1100
+ function useIsClient() {
1101
+ return useSyncExternalStore(
1102
+ subscribeNothing,
1103
+ () => true,
1104
+ () => false
1105
+ );
1106
+ }
1107
+
1108
+ // src/components/IconButton/IconButton.tsx
1109
+ import { forwardRef as forwardRef17 } from "react";
1110
+
1111
+ // src/components/IconButton/IconButton.css.ts
1112
+ import { createRuntimeFn as _7a46810 } from "@vanilla-extract/recipes/createRuntimeFn";
1113
+ var iconButton = /* @__PURE__ */ _7a46810({ defaultClassName: "ip9et20", variantClassNames: { size: { sm: "ip9et21", md: "ip9et22", lg: "ip9et23" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
1114
+
1115
+ // src/components/IconButton/IconButton.tsx
1116
+ import { jsx as jsx19 } from "react/jsx-runtime";
1117
+ var IconButton = /* @__PURE__ */ forwardRef17(function IconButton2({ variant = "ghost", color = "neutral", size, loading, className, children, ...rest }, ref) {
1118
+ return /* @__PURE__ */ jsx19(
1119
+ Button,
1120
+ {
1121
+ ref,
1122
+ variant,
1123
+ color,
1124
+ size,
1125
+ loading,
1126
+ className: cx(iconButton({ size }), className),
1127
+ ...rest,
1128
+ children: !loading && children
1129
+ }
1130
+ );
1131
+ });
1132
+
1133
+ // src/components/Calendar/Calendar.css.ts
1134
+ var cell = "_1qyq67b5";
1135
+ var day = "_1qyq67b6";
1136
+ var grid = "_1qyq67b3";
1137
+ var header3 = "_1qyq67b1";
1138
+ var heading = "_1qyq67b2";
1139
+ var root6 = "_1qyq67b0";
1140
+ var weekday = "_1qyq67b4";
1141
+
1142
+ // src/components/Calendar/Calendar.tsx
1143
+ import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
1144
+ var Calendar = /* @__PURE__ */ forwardRef18(function Calendar2(props, ref) {
1145
+ const {
1146
+ value: value4,
1147
+ defaultValue,
1148
+ onValueChange,
1149
+ min,
1150
+ max,
1151
+ isDateDisabled,
1152
+ isHoliday,
1153
+ today: todayProp,
1154
+ initialFocus,
1155
+ prevMonthLabel: prevMonthLabelProp,
1156
+ nextMonthLabel: nextMonthLabelProp,
1157
+ className
1158
+ } = props;
1159
+ const m = useMessages();
1160
+ const prevMonthLabel = prevMonthLabelProp ?? m.previousMonth ?? "\uC774\uC804 \uB2EC";
1161
+ const nextMonthLabel = nextMonthLabelProp ?? m.nextMonth ?? "\uB2E4\uC74C \uB2EC";
1162
+ const weekdaysShort = m.weekdaysShort ?? KOREAN_WEEKDAYS;
1163
+ const weekdaysLong = m.weekdaysLong ?? KOREAN_WEEKDAYS.map((name) => `${name}\uC694\uC77C`);
1164
+ const headingId = useId4();
1165
+ const gridRef = useRef7(null);
1166
+ const isControlled = "value" in props;
1167
+ const [innerValue, setInnerValue] = useState5(defaultValue ?? "");
1168
+ const selected = parseISODate(isControlled ? value4 : innerValue);
1169
+ const isClient = useIsClient();
1170
+ const today = parseISODate(todayProp) ?? (isClient ? /* @__PURE__ */ new Date() : null);
1171
+ const minDate = parseISODate(min);
1172
+ const maxDate = parseISODate(max);
1173
+ const clamp = (date) => {
1174
+ if (minDate && compareDays(date, minDate) < 0) return minDate;
1175
+ if (maxDate && compareDays(date, maxDate) > 0) return maxDate;
1176
+ return date;
1177
+ };
1178
+ const isDisabled = (date) => minDate !== null && compareDays(date, minDate) < 0 || maxDate !== null && compareDays(date, maxDate) > 0 || !!isDateDisabled?.(date);
1179
+ const [focusedState, setFocused] = useState5(null);
1180
+ const base = selected ?? today;
1181
+ const focused = focusedState ?? (base ? clamp(base) : null);
1182
+ const moveFocus = useRef7(initialFocus ?? false);
1183
+ const selectedIso = selected ? toISODate(selected) : "";
1184
+ useEffect4(() => {
1185
+ const date = parseISODate(selectedIso);
1186
+ if (date) setFocused((prev) => isSameDay(prev, date) ? prev : date);
1187
+ }, [selectedIso]);
1188
+ useEffect4(() => {
1189
+ if (!moveFocus.current || !focused) return;
1190
+ moveFocus.current = false;
1191
+ gridRef.current?.querySelector(`[data-date="${toISODate(focused)}"]`)?.focus();
1192
+ }, [focused]);
1193
+ const focusDate = (date) => {
1194
+ moveFocus.current = true;
1195
+ setFocused(clamp(date));
1196
+ };
1197
+ const select = (date) => {
1198
+ if (isDisabled(date)) return;
1199
+ const iso = toISODate(date);
1200
+ if (!isControlled) setInnerValue(iso);
1201
+ onValueChange?.(iso);
1202
+ setFocused(date);
1203
+ };
1204
+ const handleKeyDown = (event) => {
1205
+ if (!focused) return;
1206
+ const moves = {
1207
+ ArrowLeft: () => addDays(focused, -1),
1208
+ ArrowRight: () => addDays(focused, 1),
1209
+ ArrowUp: () => addDays(focused, -7),
1210
+ ArrowDown: () => addDays(focused, 7),
1211
+ Home: () => addDays(focused, -focused.getDay()),
1212
+ End: () => addDays(focused, 6 - focused.getDay()),
1213
+ PageUp: () => addMonths(focused, event.shiftKey ? -12 : -1),
1214
+ PageDown: () => addMonths(focused, event.shiftKey ? 12 : 1)
1215
+ };
1216
+ const move = moves[event.key];
1217
+ if (move) {
1218
+ event.preventDefault();
1219
+ focusDate(move());
1220
+ }
1221
+ };
1222
+ const visible = focused;
1223
+ const weeks = visible ? getCalendarWeeks(visible.getFullYear(), visible.getMonth()).filter(
1224
+ (week) => week.some((date) => isSameMonth(date, visible))
1225
+ ) : [];
1226
+ const canPrev = !!visible && (!minDate || compareDays(new Date(visible.getFullYear(), visible.getMonth(), 0), minDate) >= 0);
1227
+ const canNext = !!visible && (!maxDate || compareDays(new Date(visible.getFullYear(), visible.getMonth() + 1, 1), maxDate) <= 0);
1228
+ return /* @__PURE__ */ jsxs16("div", { ref, className: cx(root6, className), children: [
1229
+ /* @__PURE__ */ jsxs16("div", { className: header3, children: [
1230
+ /* @__PURE__ */ jsx20(
1231
+ IconButton,
1232
+ {
1233
+ "aria-label": prevMonthLabel,
1234
+ size: "sm",
1235
+ disabled: !canPrev,
1236
+ onClick: () => visible && setFocused(clamp(addMonths(visible, -1))),
1237
+ children: /* @__PURE__ */ jsx20(ChevronLeftIcon, {})
1238
+ }
1239
+ ),
1240
+ /* @__PURE__ */ jsx20("div", { id: headingId, className: heading, "aria-live": "polite", children: visible && (m.monthTitle?.(visible.getFullYear(), visible.getMonth() + 1) ?? `${visible.getFullYear()}\uB144 ${visible.getMonth() + 1}\uC6D4`) }),
1241
+ /* @__PURE__ */ jsx20(
1242
+ IconButton,
1243
+ {
1244
+ "aria-label": nextMonthLabel,
1245
+ size: "sm",
1246
+ disabled: !canNext,
1247
+ onClick: () => visible && setFocused(clamp(addMonths(visible, 1))),
1248
+ children: /* @__PURE__ */ jsx20(ChevronRightIcon2, {})
1249
+ }
1250
+ )
1251
+ ] }),
1252
+ /* @__PURE__ */ jsxs16("table", { ref: gridRef, role: "grid", "aria-labelledby": headingId, className: grid, onKeyDown: handleKeyDown, children: [
1253
+ /* @__PURE__ */ jsx20("thead", { children: /* @__PURE__ */ jsx20("tr", { children: weekdaysShort.map((name, index) => /* @__PURE__ */ jsx20("th", { scope: "col", abbr: weekdaysLong[index], className: weekday, "data-weekday": index, children: name }, index)) }) }),
1254
+ /* @__PURE__ */ jsx20("tbody", { children: weeks.map((week) => /* @__PURE__ */ jsx20("tr", { children: week.map((date) => {
1255
+ const iso = toISODate(date);
1256
+ if (!visible || !isSameMonth(date, visible))
1257
+ return /* @__PURE__ */ jsx20("td", { role: "gridcell", className: cell }, iso);
1258
+ const isSelected = isSameDay(date, selected);
1259
+ const isToday = isSameDay(date, today);
1260
+ const holiday = !!isHoliday?.(date);
1261
+ const disabled = isDisabled(date);
1262
+ const label6 = [
1263
+ m.dayLabel?.(date, weekdaysLong[date.getDay()]) ?? `${date.getDate()}, ${date.getFullYear()}\uB144 ${date.getMonth() + 1}\uC6D4 ${weekdaysLong[date.getDay()]}`,
1264
+ holiday && (m.holiday ?? "\uACF5\uD734\uC77C"),
1265
+ isToday && (m.today ?? "\uC624\uB298")
1266
+ ].filter(Boolean).join(", ");
1267
+ return /* @__PURE__ */ jsx20("td", { role: "gridcell", "aria-selected": isSelected, className: cell, children: /* @__PURE__ */ jsx20(
1268
+ "button",
1269
+ {
1270
+ type: "button",
1271
+ className: day,
1272
+ "data-date": iso,
1273
+ "data-weekday": date.getDay(),
1274
+ "data-holiday": holiday || void 0,
1275
+ "data-selected": isSelected || void 0,
1276
+ tabIndex: isSameDay(date, focused) ? 0 : -1,
1277
+ "aria-label": label6,
1278
+ "aria-current": isToday ? "date" : void 0,
1279
+ "aria-disabled": disabled || void 0,
1280
+ onClick: () => select(date),
1281
+ onFocus: () => !isSameDay(date, focused) && setFocused(date),
1282
+ children: date.getDate()
1283
+ }
1284
+ ) }, iso);
1285
+ }) }, toISODate(week[0]))) })
1286
+ ] })
1287
+ ] });
1288
+ });
1289
+
1290
+ // src/components/Card/Card.tsx
1291
+ import { forwardRef as forwardRef19 } from "react";
1292
+
1293
+ // src/components/Card/Card.css.ts
1294
+ import { createRuntimeFn as _7a46811 } from "@vanilla-extract/recipes/createRuntimeFn";
1295
+ var body2 = "dnuf1u9";
1296
+ var card = /* @__PURE__ */ _7a46811({ defaultClassName: "dnuf1u0", variantClassNames: { variant: { outline: "dnuf1u1", elevated: "dnuf1u2", soft: "dnuf1u3" }, padding: { none: "dnuf1u4", sm: "dnuf1u5", md: "dnuf1u6", lg: "dnuf1u7" } }, defaultVariants: { variant: "outline", padding: "md" }, compoundVariants: [] });
1297
+ var footer2 = "dnuf1ua";
1298
+ var header4 = "dnuf1u8";
1299
+
1300
+ // src/components/Card/Card.tsx
1301
+ import { jsx as jsx21 } from "react/jsx-runtime";
1302
+ var Card = /* @__PURE__ */ forwardRef19(function Card2({ variant, padding, as: Component = "div", className, ...rest }, ref) {
1303
+ return /* @__PURE__ */ jsx21(Component, { ref, className: cx(card({ variant, padding }), className), ...rest });
1304
+ });
1305
+ var CardHeader = /* @__PURE__ */ forwardRef19(function CardHeader2({ className, ...rest }, ref) {
1306
+ return /* @__PURE__ */ jsx21("div", { ref, className: cx(header4, className), ...rest });
1307
+ });
1308
+ var CardBody = /* @__PURE__ */ forwardRef19(function CardBody2({ className, ...rest }, ref) {
1309
+ return /* @__PURE__ */ jsx21("div", { ref, className: cx(body2, className), ...rest });
1310
+ });
1311
+ var CardFooter = /* @__PURE__ */ forwardRef19(function CardFooter2({ className, ...rest }, ref) {
1312
+ return /* @__PURE__ */ jsx21("div", { ref, className: cx(footer2, className), ...rest });
1313
+ });
1314
+
1315
+ // src/components/Combobox/Combobox.tsx
1316
+ import * as Popover from "@radix-ui/react-popover";
1317
+ import {
1318
+ forwardRef as forwardRef20,
1319
+ useEffect as useEffect5,
1320
+ useId as useId5,
1321
+ useMemo as useMemo3,
1322
+ useRef as useRef8,
1323
+ useState as useState6
1324
+ } from "react";
1325
+ import { CheckIcon, ChevronDownIcon as ChevronDownIcon3, XIcon as XIcon3 } from "@bestow-ui/icons";
1326
+
1327
+ // src/components/Select/Select.css.ts
1328
+ var content5 = "_1kx81e83";
1329
+ var icon4 = "_1kx81e82";
1330
+ var item4 = "_1kx81e85";
1331
+ var itemIndicator = "_1kx81e86";
1332
+ var trigger2 = "_1kx81e80";
1333
+ var value = "_1kx81e81";
1334
+ var viewport = "_1kx81e84";
1335
+
1336
+ // src/components/Combobox/Combobox.css.ts
1337
+ var clear = "c2pbq72 c2pbq70";
1338
+ var content6 = "c2pbq73";
1339
+ var empty = "c2pbq74";
1340
+ var toggle2 = "c2pbq71 c2pbq70";
1341
+
1342
+ // src/components/Combobox/Combobox.tsx
1343
+ import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
1344
+ var defaultFilter = (option2, query) => option2.label.toLowerCase().includes(query.trim().toLowerCase());
1345
+ var Combobox = /* @__PURE__ */ forwardRef20(function Combobox2(props, ref) {
1346
+ const {
1347
+ options,
1348
+ value: value4,
1349
+ defaultValue,
1350
+ onValueChange,
1351
+ filter = defaultFilter,
1352
+ emptyMessage: emptyMessageProp,
1353
+ placeholder,
1354
+ label: label6,
1355
+ helperText: helperText3,
1356
+ error,
1357
+ size,
1358
+ fullWidth,
1359
+ disabled,
1360
+ required,
1361
+ name,
1362
+ id,
1363
+ "aria-label": ariaLabel,
1364
+ toggleLabel: toggleLabelProp,
1365
+ clearable,
1366
+ clearLabel: clearLabelProp,
1367
+ className
1368
+ } = props;
1369
+ const m = useMessages();
1370
+ const emptyMessage = emptyMessageProp ?? m.noResults ?? "\uACB0\uACFC\uAC00 \uC5C6\uC5B4\uC694";
1371
+ const toggleLabel = toggleLabelProp ?? m.openList ?? "\uBAA9\uB85D \uC5F4\uAE30";
1372
+ const clearLabel = clearLabelProp ?? m.clearSelection ?? "\uC120\uD0DD \uC9C0\uC6B0\uAE30";
1373
+ const generatedId = useId5();
1374
+ const inputId = id ?? generatedId;
1375
+ const labelId = `${inputId}-label`;
1376
+ const listId = `${inputId}-listbox`;
1377
+ const helperId = helperText3 ? `${inputId}-helper` : void 0;
1378
+ const optionId = (index) => `${inputId}-option-${index}`;
1379
+ const portal2 = usePortalProps();
1380
+ const inputRef = useRef8(null);
1381
+ const anchorRef = useRef8(null);
1382
+ const isControlled = "value" in props;
1383
+ const [innerValue, setInnerValue] = useState6(defaultValue);
1384
+ const selectedValue = isControlled ? value4 : innerValue;
1385
+ const selectedOption = options.find((o) => o.value === selectedValue);
1386
+ const [open, setOpen] = useState6(false);
1387
+ const [query, setQuery] = useState6(null);
1388
+ const [activeIndex, setActiveIndex] = useState6(-1);
1389
+ const filtered = useMemo3(() => query ? options.filter((o) => filter(o, query)) : options, [options, filter, query]);
1390
+ const inputText = query ?? selectedOption?.label ?? "";
1391
+ const firstEnabled = (list5, from = 0, step = 1) => {
1392
+ for (let i = from; i >= 0 && i < list5.length; i += step) if (!list5[i].disabled) return i;
1393
+ return -1;
1394
+ };
1395
+ const openList = (list5 = filtered, preferLast = false) => {
1396
+ setOpen(true);
1397
+ const selectedIndex = list5.findIndex((o) => o.value === selectedValue);
1398
+ setActiveIndex(
1399
+ selectedIndex >= 0 && !list5[selectedIndex].disabled ? selectedIndex : preferLast ? firstEnabled(list5, list5.length - 1, -1) : firstEnabled(list5)
1400
+ );
1401
+ };
1402
+ const reset = () => {
1403
+ setOpen(false);
1404
+ setQuery(null);
1405
+ setActiveIndex(-1);
1406
+ };
1407
+ const clearSelection = () => {
1408
+ if (!isControlled) setInnerValue(void 0);
1409
+ if (selectedValue) onValueChange?.("");
1410
+ };
1411
+ const close2 = () => {
1412
+ if (query === "" && selectedValue) clearSelection();
1413
+ reset();
1414
+ };
1415
+ const select = (option2) => {
1416
+ if (option2.disabled) return;
1417
+ if (!isControlled) setInnerValue(option2.value);
1418
+ if (option2.value !== selectedValue) onValueChange?.(option2.value);
1419
+ reset();
1420
+ };
1421
+ const move = (step) => {
1422
+ const start = activeIndex < 0 ? step === 1 ? 0 : filtered.length - 1 : activeIndex + step;
1423
+ const next = firstEnabled(filtered, start, step);
1424
+ if (next >= 0) setActiveIndex(next);
1425
+ };
1426
+ const handleChange = (event) => {
1427
+ const nextQuery = event.target.value;
1428
+ const nextList = nextQuery ? options.filter((o) => filter(o, nextQuery)) : options;
1429
+ setQuery(nextQuery);
1430
+ setOpen(true);
1431
+ setActiveIndex(nextQuery ? firstEnabled(nextList) : -1);
1432
+ };
1433
+ const handleKeyDown = (event) => {
1434
+ switch (event.key) {
1435
+ case "ArrowDown":
1436
+ event.preventDefault();
1437
+ if (!open) openList();
1438
+ else move(1);
1439
+ break;
1440
+ case "ArrowUp":
1441
+ event.preventDefault();
1442
+ if (!open) openList(filtered, true);
1443
+ else move(-1);
1444
+ break;
1445
+ case "Enter":
1446
+ if (open) {
1447
+ event.preventDefault();
1448
+ const option2 = filtered[activeIndex];
1449
+ if (option2) select(option2);
1450
+ else close2();
1451
+ }
1452
+ break;
1453
+ case "Escape":
1454
+ if (open) {
1455
+ event.preventDefault();
1456
+ close2();
1457
+ }
1458
+ break;
1459
+ case "Tab":
1460
+ if (open) close2();
1461
+ break;
1462
+ }
1463
+ };
1464
+ useEffect5(() => {
1465
+ if (!open || activeIndex < 0) return;
1466
+ document.getElementById(optionId(activeIndex))?.scrollIntoView?.({ block: "nearest" });
1467
+ }, [open, activeIndex]);
1468
+ const hasOptions = filtered.length > 0;
1469
+ return /* @__PURE__ */ jsxs17("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
1470
+ label6 && /* @__PURE__ */ jsxs17("label", { id: labelId, htmlFor: inputId, className: label, children: [
1471
+ label6,
1472
+ required && /* @__PURE__ */ jsx22("span", { className: requiredMark, "aria-hidden": true, children: "*" })
1473
+ ] }),
1474
+ /* @__PURE__ */ jsxs17(Popover.Root, { open: open && !disabled, onOpenChange: (next) => next ? openList() : close2(), children: [
1475
+ /* @__PURE__ */ jsx22(Popover.Anchor, { asChild: true, children: /* @__PURE__ */ jsxs17(
1476
+ "div",
1477
+ {
1478
+ ref: anchorRef,
1479
+ className: cx(root3({ size, fullWidth }), className),
1480
+ "data-invalid": error || void 0,
1481
+ "data-disabled": disabled || void 0,
1482
+ children: [
1483
+ /* @__PURE__ */ jsx22(
1484
+ "input",
1485
+ {
1486
+ ref: mergeRefs(ref, inputRef),
1487
+ id: inputId,
1488
+ type: "text",
1489
+ role: "combobox",
1490
+ "aria-expanded": open,
1491
+ "aria-controls": open && hasOptions ? listId : void 0,
1492
+ "aria-autocomplete": "list",
1493
+ "aria-activedescendant": open && activeIndex >= 0 ? optionId(activeIndex) : void 0,
1494
+ "aria-label": label6 ? void 0 : ariaLabel,
1495
+ "aria-invalid": error || void 0,
1496
+ "aria-required": required || void 0,
1497
+ "aria-describedby": helperId,
1498
+ autoComplete: "off",
1499
+ placeholder,
1500
+ disabled,
1501
+ value: inputText,
1502
+ onChange: handleChange,
1503
+ onKeyDown: handleKeyDown,
1504
+ onBlur: () => {
1505
+ if (open) close2();
1506
+ },
1507
+ className: input
1508
+ }
1509
+ ),
1510
+ clearable && selectedOption && !disabled && /* @__PURE__ */ jsx22(
1511
+ "button",
1512
+ {
1513
+ type: "button",
1514
+ tabIndex: -1,
1515
+ "aria-label": clearLabel,
1516
+ className: clear,
1517
+ onMouseDown: (event) => event.preventDefault(),
1518
+ onClick: () => {
1519
+ clearSelection();
1520
+ reset();
1521
+ inputRef.current?.focus();
1522
+ },
1523
+ children: /* @__PURE__ */ jsx22(XIcon3, { size: 16 })
1524
+ }
1525
+ ),
1526
+ /* @__PURE__ */ jsx22(
1527
+ "button",
1528
+ {
1529
+ type: "button",
1530
+ tabIndex: -1,
1531
+ "aria-label": toggleLabel,
1532
+ "aria-expanded": open,
1533
+ disabled,
1534
+ className: toggle2,
1535
+ onMouseDown: (event) => event.preventDefault(),
1536
+ onClick: () => {
1537
+ if (open) close2();
1538
+ else openList(options);
1539
+ inputRef.current?.focus();
1540
+ },
1541
+ children: /* @__PURE__ */ jsx22(ChevronDownIcon3, { size: 16 })
1542
+ }
1543
+ )
1544
+ ]
1545
+ }
1546
+ ) }),
1547
+ /* @__PURE__ */ jsx22(Popover.Portal, { children: /* @__PURE__ */ jsx22(
1548
+ Popover.Content,
1549
+ {
1550
+ role: "presentation",
1551
+ align: "start",
1552
+ sideOffset: 4,
1553
+ collisionPadding: 8,
1554
+ className: cx(portal2.className, content6),
1555
+ style: portal2.style,
1556
+ onOpenAutoFocus: (event) => event.preventDefault(),
1557
+ onCloseAutoFocus: (event) => event.preventDefault(),
1558
+ onMouseDown: (event) => event.preventDefault(),
1559
+ onInteractOutside: (event) => {
1560
+ if (anchorRef.current?.contains(event.target)) event.preventDefault();
1561
+ },
1562
+ children: hasOptions ? /* @__PURE__ */ jsx22(
1563
+ "div",
1564
+ {
1565
+ id: listId,
1566
+ role: "listbox",
1567
+ "aria-labelledby": label6 ? labelId : void 0,
1568
+ "aria-label": label6 ? void 0 : ariaLabel,
1569
+ children: filtered.map((option2, index) => {
1570
+ const isSelected = option2.value === selectedValue;
1571
+ return (
1572
+ // aria-activedescendant 패턴: 포커스·키보드는 입력창이 맡고 항목은 포커스를 받지 않는다 (WAI-ARIA combobox)
1573
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/interactive-supports-focus
1574
+ /* @__PURE__ */ jsxs17(
1575
+ "div",
1576
+ {
1577
+ id: optionId(index),
1578
+ role: "option",
1579
+ "aria-selected": isSelected,
1580
+ "aria-disabled": option2.disabled || void 0,
1581
+ "data-highlighted": index === activeIndex ? "" : void 0,
1582
+ "data-state": isSelected ? "checked" : "unchecked",
1583
+ "data-disabled": option2.disabled ? "" : void 0,
1584
+ className: item4,
1585
+ onMouseDown: (event) => event.preventDefault(),
1586
+ onMouseMove: () => !option2.disabled && setActiveIndex(index),
1587
+ onClick: () => select(option2),
1588
+ children: [
1589
+ option2.label,
1590
+ isSelected && /* @__PURE__ */ jsx22("span", { className: itemIndicator, "aria-hidden": true, children: /* @__PURE__ */ jsx22(CheckIcon, { size: 16 }) })
1591
+ ]
1592
+ },
1593
+ option2.value
1594
+ )
1595
+ );
1596
+ })
1597
+ }
1598
+ ) : /* @__PURE__ */ jsx22("div", { className: empty, role: "status", children: emptyMessage })
1599
+ }
1600
+ ) })
1601
+ ] }),
1602
+ name && /* @__PURE__ */ jsx22("input", { type: "hidden", name, value: selectedValue ?? "" }),
1603
+ helperText3 && /* @__PURE__ */ jsx22("p", { id: helperId, className: helperText({ error }), children: helperText3 })
1604
+ ] });
1605
+ });
1606
+
1607
+ // src/components/DatePicker/DatePicker.tsx
1608
+ import { forwardRef as forwardRef21, useEffect as useEffect6, useRef as useRef9, useState as useState7 } from "react";
1609
+ import { CalendarIcon } from "@bestow-ui/icons";
1610
+
1611
+ // src/components/Popover/Popover.tsx
1612
+ import * as RadixPopover from "@radix-ui/react-popover";
1613
+ import { XIcon as XIcon4 } from "@bestow-ui/icons";
1614
+ import { useId as useId6 } from "react";
1615
+
1616
+ // src/components/Popover/Popover.css.ts
1617
+ var arrow = "_1j99p8x4";
1618
+ var closeButton3 = "_1j99p8x3";
1619
+ var content7 = "_1j99p8x0";
1620
+ var header5 = "_1j99p8x1";
1621
+ var title3 = "_1j99p8x2";
1622
+
1623
+ // src/components/Popover/Popover.tsx
1624
+ import { jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
1625
+ function Popover2({
1626
+ content: content12,
1627
+ children,
1628
+ title: title6,
1629
+ "aria-label": ariaLabel,
1630
+ showClose = false,
1631
+ showArrow = false,
1632
+ side = "bottom",
1633
+ align = "center",
1634
+ open,
1635
+ defaultOpen,
1636
+ onOpenChange,
1637
+ modal,
1638
+ className,
1639
+ style,
1640
+ onOpenAutoFocus
1641
+ }) {
1642
+ const portal2 = usePortalProps();
1643
+ const m = useMessages();
1644
+ const titleId = useId6();
1645
+ return /* @__PURE__ */ jsxs18(RadixPopover.Root, { open, defaultOpen, onOpenChange, modal, children: [
1646
+ /* @__PURE__ */ jsx23(RadixPopover.Trigger, { asChild: true, children }),
1647
+ /* @__PURE__ */ jsx23(RadixPopover.Portal, { children: /* @__PURE__ */ jsxs18(
1648
+ RadixPopover.Content,
1649
+ {
1650
+ side,
1651
+ align,
1652
+ sideOffset: 6,
1653
+ onOpenAutoFocus,
1654
+ collisionPadding: 8,
1655
+ "aria-labelledby": title6 ? titleId : void 0,
1656
+ "aria-label": title6 ? void 0 : ariaLabel,
1657
+ className: cx(portal2.className, content7, className),
1658
+ style: { ...portal2.style, ...style },
1659
+ children: [
1660
+ (title6 || showClose) && /* @__PURE__ */ jsxs18("div", { className: header5, children: [
1661
+ title6 && /* @__PURE__ */ jsx23("h2", { id: titleId, className: title3, children: title6 }),
1662
+ showClose && /* @__PURE__ */ jsx23(RadixPopover.Close, { className: closeButton3, "aria-label": m.close ?? "\uB2EB\uAE30", children: /* @__PURE__ */ jsx23(XIcon4, { size: 16 }) })
1663
+ ] }),
1664
+ content12,
1665
+ showArrow && /* @__PURE__ */ jsx23(RadixPopover.Arrow, { className: arrow, width: 12, height: 6 })
1666
+ ]
1667
+ }
1668
+ ) })
1669
+ ] });
1670
+ }
1671
+ var PopoverClose = RadixPopover.Close;
1672
+
1673
+ // src/components/DatePicker/DatePicker.tsx
1674
+ import { Fragment as Fragment4, jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
1675
+ var sanitize2 = (input5) => input5.replace(/\D/g, "").slice(0, 8);
1676
+ 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)}`;
1677
+ var isDigit3 = (char) => /\d/.test(char);
1678
+ var DatePicker = /* @__PURE__ */ forwardRef21(
1679
+ function DatePicker2(props, ref) {
1680
+ const {
1681
+ value: value4,
1682
+ defaultValue,
1683
+ onValueChange,
1684
+ min,
1685
+ max,
1686
+ isDateDisabled,
1687
+ isHoliday,
1688
+ today,
1689
+ label: labelProp,
1690
+ helperText: helperText3,
1691
+ error,
1692
+ required,
1693
+ disabled,
1694
+ fullWidth,
1695
+ placeholder = "YYYY-MM-DD",
1696
+ calendarLabel: calendarLabelProp,
1697
+ invalidText: invalidTextProp,
1698
+ unavailableText: unavailableTextProp,
1699
+ incompleteText: incompleteTextProp,
1700
+ name,
1701
+ id,
1702
+ className
1703
+ } = props;
1704
+ const inputRef = useRef9(null);
1705
+ const m = useMessages();
1706
+ const label6 = labelProp ?? m.date ?? "\uB0A0\uC9DC";
1707
+ const calendarLabel = calendarLabelProp ?? m.openCalendar ?? "\uB2EC\uB825 \uC5F4\uAE30";
1708
+ const invalidText = invalidTextProp ?? m.dateInvalid ?? "\uC62C\uBC14\uB978 \uB0A0\uC9DC\uAC00 \uC544\uB2C8\uC5D0\uC694.";
1709
+ const unavailableText = unavailableTextProp ?? m.dateUnavailable ?? "\uACE0\uB97C \uC218 \uC5C6\uB294 \uB0A0\uC9DC\uC608\uC694.";
1710
+ const incompleteText = incompleteTextProp ?? m.dateIncomplete ?? "\uB0A0\uC9DC\uB97C YYYY-MM-DD \uD615\uC2DD\uC73C\uB85C \uC785\uB825\uD574 \uC8FC\uC138\uC694.";
1711
+ const [open, setOpen] = useState7(false);
1712
+ const [touched, setTouched] = useState7(false);
1713
+ const isControlled = "value" in props;
1714
+ const lastEmitted = useRef9(isControlled ? value4 ?? "" : defaultValue ?? "");
1715
+ const minDate = parseISODate(min);
1716
+ const maxDate = parseISODate(max);
1717
+ const toIso = (digits) => digits.length === 8 ? `${digits.slice(0, 4)}-${digits.slice(4, 6)}-${digits.slice(6)}` : "";
1718
+ const isUnavailable = (date2) => minDate !== null && compareDays(date2, minDate) < 0 || maxDate !== null && compareDays(date2, maxDate) > 0 || !!isDateDisabled?.(date2);
1719
+ const emit = (iso) => {
1720
+ if (iso === lastEmitted.current) return;
1721
+ lastEmitted.current = iso;
1722
+ onValueChange?.(iso);
1723
+ };
1724
+ const field3 = useFormattedInput({
1725
+ isControlled: false,
1726
+ value: void 0,
1727
+ defaultValue: (isControlled ? value4 : defaultValue)?.replace(/\D/g, ""),
1728
+ onValueChange: (digits) => {
1729
+ const date2 = parseISODate(toIso(digits));
1730
+ emit(date2 && !isUnavailable(date2) ? toIso(digits) : "");
1731
+ },
1732
+ sanitize: sanitize2,
1733
+ format,
1734
+ isMeaningful: isDigit3,
1735
+ inputRef
1736
+ });
1737
+ const textIso = toIso(field3.raw);
1738
+ const { setRaw } = field3;
1739
+ useEffect6(() => {
1740
+ if (!isControlled) return;
1741
+ const next = value4 ?? "";
1742
+ lastEmitted.current = next;
1743
+ if (next === textIso) return;
1744
+ const textDate = parseISODate(textIso);
1745
+ const textIsValid = textDate !== null && !isUnavailable(textDate);
1746
+ if (next === "" && !textIsValid) return;
1747
+ setRaw(next.replace(/\D/g, ""));
1748
+ }, [value4]);
1749
+ const date = parseISODate(textIso);
1750
+ const complete = field3.raw.length === 8;
1751
+ const autoError = complete ? !date ? invalidText : isUnavailable(date) ? unavailableText : null : touched && field3.raw.length > 0 ? incompleteText : null;
1752
+ const showAuto = autoError !== null && error === void 0;
1753
+ const selectedIso = date && !isUnavailable(date) ? textIso : "";
1754
+ return /* @__PURE__ */ jsxs19(Fragment4, { children: [
1755
+ /* @__PURE__ */ jsx24(
1756
+ TextField,
1757
+ {
1758
+ ref: mergeRefs(ref, inputRef),
1759
+ id,
1760
+ label: label6,
1761
+ placeholder,
1762
+ inputMode: "numeric",
1763
+ autoComplete: "off",
1764
+ value: field3.display,
1765
+ onChange: field3.onChange,
1766
+ onKeyDown: field3.onKeyDown,
1767
+ onBlur: () => setTouched(true),
1768
+ error: error ?? autoError !== null,
1769
+ helperText: showAuto ? autoError : helperText3,
1770
+ required,
1771
+ disabled,
1772
+ fullWidth,
1773
+ rootClassName: className,
1774
+ endAdornment: /* @__PURE__ */ jsx24(
1775
+ Popover2,
1776
+ {
1777
+ open,
1778
+ onOpenChange: setOpen,
1779
+ modal: true,
1780
+ align: "end",
1781
+ "aria-label": m.calendar ?? "\uB2EC\uB825",
1782
+ onOpenAutoFocus: (event) => event.preventDefault(),
1783
+ content: /* @__PURE__ */ jsx24(
1784
+ Calendar,
1785
+ {
1786
+ value: selectedIso,
1787
+ onValueChange: (iso) => {
1788
+ setRaw(iso.replace(/\D/g, ""));
1789
+ emit(iso);
1790
+ setOpen(false);
1791
+ },
1792
+ min,
1793
+ max,
1794
+ isDateDisabled,
1795
+ isHoliday,
1796
+ today,
1797
+ initialFocus: true
1798
+ }
1799
+ ),
1800
+ children: /* @__PURE__ */ jsx24(IconButton, { "aria-label": calendarLabel, size: "sm", disabled, children: /* @__PURE__ */ jsx24(CalendarIcon, {}) })
1801
+ }
1802
+ )
1803
+ }
1804
+ ),
1805
+ name && /* @__PURE__ */ jsx24("input", { type: "hidden", name, value: selectedIso })
1806
+ ] });
1807
+ }
1808
+ );
1809
+
1810
+ // src/components/Divider/Divider.tsx
1811
+ import { forwardRef as forwardRef22 } from "react";
1812
+
1813
+ // src/components/Divider/Divider.css.ts
1814
+ import { createRuntimeFn as _7a46812 } from "@vanilla-extract/recipes/createRuntimeFn";
1815
+ var divider = /* @__PURE__ */ _7a46812({ defaultClassName: "_1t3gq8v0", variantClassNames: { orientation: { horizontal: "_1t3gq8v1", vertical: "_1t3gq8v2" } }, defaultVariants: { orientation: "horizontal" }, compoundVariants: [] });
1816
+ var labeled = "_1t3gq8v3";
1817
+ var line = "_1t3gq8v4";
1818
+
1819
+ // src/components/Divider/Divider.tsx
1820
+ import { jsx as jsx25, jsxs as jsxs20 } from "react/jsx-runtime";
1821
+ var Divider = /* @__PURE__ */ forwardRef22(function Divider2({ orientation = "horizontal", decorative, className, children, ...rest }, ref) {
1822
+ if (children && orientation === "horizontal") {
1823
+ return /* @__PURE__ */ jsxs20("div", { ref, className: cx(labeled, className), ...rest, children: [
1824
+ /* @__PURE__ */ jsx25("span", { className: line, "aria-hidden": true }),
1825
+ children,
1826
+ /* @__PURE__ */ jsx25("span", { className: line, "aria-hidden": true })
1827
+ ] });
1828
+ }
1829
+ const a11y = decorative ? { role: "none" } : { role: "separator", "aria-orientation": orientation === "vertical" ? "vertical" : void 0 };
1830
+ return /* @__PURE__ */ jsx25("div", { ref, className: cx(divider({ orientation }), className), ...a11y, ...rest });
1831
+ });
1832
+
1833
+ // src/components/Drawer/Drawer.tsx
1834
+ import * as Dialog2 from "@radix-ui/react-dialog";
1835
+ import { XIcon as XIcon5 } from "@bestow-ui/icons";
1836
+
1837
+ // src/components/Drawer/Drawer.css.ts
1838
+ import { createRuntimeFn as _7a46813 } from "@vanilla-extract/recipes/createRuntimeFn";
1839
+ var body3 = "nmobyvy";
1840
+ var closeButton4 = "nmobyvx";
1841
+ var content8 = /* @__PURE__ */ _7a46813({ 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"]] });
1842
+ var description3 = "nmobyvw";
1843
+ var footer3 = "nmobyvz";
1844
+ var header6 = "nmobyvt";
1845
+ var headings2 = "nmobyvu";
1846
+ var overlay2 = "nmobyv0";
1847
+ var title4 = "nmobyvv";
1848
+
1849
+ // src/components/Drawer/Drawer.tsx
1850
+ import { jsx as jsx26, jsxs as jsxs21 } from "react/jsx-runtime";
1851
+ function Drawer({
1852
+ open,
1853
+ defaultOpen,
1854
+ onOpenChange,
1855
+ trigger: trigger4,
1856
+ title: title6,
1857
+ description: description6,
1858
+ children,
1859
+ footer: footer6,
1860
+ side,
1861
+ size,
1862
+ hideCloseButton = false,
1863
+ closeOnOverlayClick = true,
1864
+ className
1865
+ }) {
1866
+ const portal2 = usePortalProps();
1867
+ const m = useMessages();
1868
+ const focus = useReturnFocus(Boolean(trigger4));
1869
+ return /* @__PURE__ */ jsxs21(Dialog2.Root, { open, defaultOpen, onOpenChange, children: [
1870
+ trigger4 && /* @__PURE__ */ jsx26(Dialog2.Trigger, { asChild: true, children: trigger4 }),
1871
+ /* @__PURE__ */ jsxs21(Dialog2.Portal, { children: [
1872
+ /* @__PURE__ */ jsx26(Dialog2.Overlay, { className: cx(portal2.className, overlay2), style: portal2.style }),
1873
+ /* @__PURE__ */ jsxs21(
1874
+ Dialog2.Content,
1875
+ {
1876
+ className: cx(portal2.className, content8({ side, size }), className),
1877
+ style: portal2.style,
1878
+ "data-side": side ?? "right",
1879
+ onPointerDownOutside: closeOnOverlayClick ? void 0 : (event) => event.preventDefault(),
1880
+ onOpenAutoFocus: focus.onOpenAutoFocus,
1881
+ onCloseAutoFocus: focus.onCloseAutoFocus,
1882
+ ...description6 ? {} : { "aria-describedby": void 0 },
1883
+ children: [
1884
+ /* @__PURE__ */ jsxs21("div", { className: header6, children: [
1885
+ /* @__PURE__ */ jsxs21("div", { className: headings2, children: [
1886
+ /* @__PURE__ */ jsx26(Dialog2.Title, { className: title4, children: title6 }),
1887
+ description6 && /* @__PURE__ */ jsx26(Dialog2.Description, { className: description3, children: description6 })
1888
+ ] }),
1889
+ !hideCloseButton && /* @__PURE__ */ jsx26(Dialog2.Close, { asChild: true, children: /* @__PURE__ */ jsx26(IconButton, { "aria-label": m.close ?? "\uB2EB\uAE30", size: "sm", className: closeButton4, children: /* @__PURE__ */ jsx26(XIcon5, {}) }) })
1890
+ ] }),
1891
+ children && /* @__PURE__ */ jsx26("div", { className: body3, children }),
1892
+ footer6 && /* @__PURE__ */ jsx26("div", { className: footer3, children: footer6 })
1893
+ ]
1894
+ }
1895
+ )
1896
+ ] })
1897
+ ] });
1898
+ }
1899
+ var DrawerClose = Dialog2.Close;
1900
+
1901
+ // src/components/DropdownMenu/DropdownMenu.tsx
1902
+ import * as RadixMenu from "@radix-ui/react-dropdown-menu";
1903
+ import { forwardRef as forwardRef23 } from "react";
1904
+
1905
+ // src/components/DropdownMenu/DropdownMenu.css.ts
1906
+ var content9 = "_1d7ahux0";
1907
+ var danger = "_1d7ahux2";
1908
+ var icon5 = "_1d7ahux3";
1909
+ var item5 = "_1d7ahux1";
1910
+ var label2 = "_1d7ahux5";
1911
+ var separator2 = "_1d7ahux6";
1912
+ var shortcut = "_1d7ahux4";
1913
+
1914
+ // src/components/DropdownMenu/DropdownMenu.tsx
1915
+ import { jsx as jsx27, jsxs as jsxs22 } from "react/jsx-runtime";
1916
+ var DropdownMenu = RadixMenu.Root;
1917
+ var DropdownMenuTrigger = RadixMenu.Trigger;
1918
+ var DropdownMenuGroup = RadixMenu.Group;
1919
+ var DropdownMenuContent = /* @__PURE__ */ forwardRef23(
1920
+ function DropdownMenuContent2({ className, style, side = "bottom", align = "start", sideOffset = 4, collisionPadding = 8, ...rest }, ref) {
1921
+ const portal2 = usePortalProps();
1922
+ return /* @__PURE__ */ jsx27(RadixMenu.Portal, { children: /* @__PURE__ */ jsx27(
1923
+ RadixMenu.Content,
1924
+ {
1925
+ ref,
1926
+ side,
1927
+ align,
1928
+ sideOffset,
1929
+ collisionPadding,
1930
+ className: cx(portal2.className, content9, className),
1931
+ style: { ...portal2.style, ...style },
1932
+ ...rest
1933
+ }
1934
+ ) });
1935
+ }
1936
+ );
1937
+ var DropdownMenuItem = /* @__PURE__ */ forwardRef23(
1938
+ function DropdownMenuItem2({ icon: icon7, shortcut: shortcut2, color = "neutral", className, children, ...rest }, ref) {
1939
+ return /* @__PURE__ */ jsxs22(RadixMenu.Item, { ref, className: cx(item5, color === "danger" && danger, className), ...rest, children: [
1940
+ icon7 && /* @__PURE__ */ jsx27("span", { className: icon5, "aria-hidden": true, children: icon7 }),
1941
+ children,
1942
+ shortcut2 && /* @__PURE__ */ jsx27("span", { className: shortcut, "aria-hidden": true, children: shortcut2 })
1943
+ ] });
1944
+ }
1945
+ );
1946
+ var DropdownMenuLabel = /* @__PURE__ */ forwardRef23(
1947
+ function DropdownMenuLabel2({ className, ...rest }, ref) {
1948
+ return /* @__PURE__ */ jsx27(RadixMenu.Label, { ref, className: cx(label2, className), ...rest });
1949
+ }
1950
+ );
1951
+ var DropdownMenuSeparator = /* @__PURE__ */ forwardRef23(
1952
+ function DropdownMenuSeparator2({ className, ...rest }, ref) {
1953
+ return /* @__PURE__ */ jsx27(RadixMenu.Separator, { ref, className: cx(separator2, className), ...rest });
1954
+ }
1955
+ );
1956
+
1957
+ // src/components/Pagination/Pagination.tsx
1958
+ import { ChevronLeftIcon as ChevronLeftIcon2, ChevronRightIcon as ChevronRightIcon3 } from "@bestow-ui/icons";
1959
+ import { forwardRef as forwardRef24, useState as useState8 } from "react";
1960
+
1961
+ // src/components/Pagination/getPaginationItems.ts
1962
+ var range = (start, end) => end < start ? [] : Array.from({ length: end - start + 1 }, (_, i) => start + i);
1963
+ function getPaginationItems(page, totalPages, siblingCount = 1, boundaryCount = 1) {
1964
+ if (totalPages < 1) return [];
1965
+ const startPages = range(1, Math.min(boundaryCount, totalPages));
1966
+ const endPages = range(Math.max(totalPages - boundaryCount + 1, boundaryCount + 1), totalPages);
1967
+ const siblingsStart = Math.max(
1968
+ Math.min(page - siblingCount, totalPages - boundaryCount - siblingCount * 2 - 1),
1969
+ boundaryCount + 2
1970
+ );
1971
+ const siblingsEnd = Math.min(
1972
+ Math.max(page + siblingCount, boundaryCount + siblingCount * 2 + 2),
1973
+ endPages.length > 0 ? endPages[0] - 2 : totalPages - 1
1974
+ );
1975
+ const items2 = [...startPages];
1976
+ if (siblingsStart > boundaryCount + 2) items2.push("ellipsis-start");
1977
+ else if (boundaryCount + 1 < totalPages - boundaryCount) items2.push(boundaryCount + 1);
1978
+ items2.push(...range(siblingsStart, siblingsEnd));
1979
+ if (siblingsEnd < totalPages - boundaryCount - 1) items2.push("ellipsis-end");
1980
+ else if (totalPages - boundaryCount > boundaryCount) items2.push(totalPages - boundaryCount);
1981
+ items2.push(...endPages);
1982
+ return items2;
1983
+ }
1984
+
1985
+ // src/components/Pagination/Pagination.css.ts
1986
+ import { createRuntimeFn as _7a46814 } from "@vanilla-extract/recipes/createRuntimeFn";
1987
+ var ellipsis = "_1iraoak4";
1988
+ var item6 = /* @__PURE__ */ _7a46814({ defaultClassName: "_1iraoak1", variantClassNames: { size: { sm: "_1iraoak2", md: "_1iraoak3" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
1989
+ var list3 = "_1iraoak0";
1990
+
1991
+ // src/components/Pagination/Pagination.tsx
1992
+ import { jsx as jsx28, jsxs as jsxs23 } from "react/jsx-runtime";
1993
+ var Pagination = /* @__PURE__ */ forwardRef24(function Pagination2({
1994
+ totalPages,
1995
+ page: pageProp,
1996
+ defaultPage = 1,
1997
+ onPageChange,
1998
+ siblingCount = 1,
1999
+ boundaryCount = 1,
2000
+ size,
2001
+ getItemLabel: getItemLabelProp,
2002
+ className,
2003
+ "aria-label": ariaLabelProp,
2004
+ ...rest
2005
+ }, ref) {
2006
+ const [uncontrolledPage, setUncontrolledPage] = useState8(defaultPage);
2007
+ const m = useMessages();
2008
+ const ariaLabel = ariaLabelProp ?? m.pagination ?? "\uD398\uC774\uC9C0 \uD0D0\uC0C9";
2009
+ 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`);
2010
+ if (totalPages < 1) return null;
2011
+ const page = Math.min(Math.max(pageProp ?? uncontrolledPage, 1), totalPages);
2012
+ const goTo = (next) => {
2013
+ if (next === page || next < 1 || next > totalPages) return;
2014
+ if (pageProp === void 0) setUncontrolledPage(next);
2015
+ onPageChange?.(next);
2016
+ };
2017
+ const itemClass = item6({ size });
2018
+ return /* @__PURE__ */ jsx28("nav", { ref, "aria-label": ariaLabel, className, ...rest, children: /* @__PURE__ */ jsxs23("ul", { className: list3, children: [
2019
+ /* @__PURE__ */ jsx28("li", { children: /* @__PURE__ */ jsx28(
2020
+ "button",
2021
+ {
2022
+ type: "button",
2023
+ className: itemClass,
2024
+ "aria-label": getItemLabel("previous", page - 1),
2025
+ disabled: page <= 1,
2026
+ onClick: () => goTo(page - 1),
2027
+ children: /* @__PURE__ */ jsx28(ChevronLeftIcon2, { size: 16 })
2028
+ }
2029
+ ) }),
2030
+ getPaginationItems(page, totalPages, siblingCount, boundaryCount).map(
2031
+ (item8) => typeof item8 === "number" ? /* @__PURE__ */ jsx28("li", { children: /* @__PURE__ */ jsx28(
2032
+ "button",
2033
+ {
2034
+ type: "button",
2035
+ className: itemClass,
2036
+ "aria-label": getItemLabel("page", item8),
2037
+ "aria-current": item8 === page ? "page" : void 0,
2038
+ onClick: () => goTo(item8),
2039
+ children: item8
2040
+ }
2041
+ ) }, item8) : /* @__PURE__ */ jsx28("li", { "aria-hidden": true, className: cx(itemClass, ellipsis), children: "\u2026" }, item8)
2042
+ ),
2043
+ /* @__PURE__ */ jsx28("li", { children: /* @__PURE__ */ jsx28(
2044
+ "button",
2045
+ {
2046
+ type: "button",
2047
+ className: itemClass,
2048
+ "aria-label": getItemLabel("next", page + 1),
2049
+ disabled: page >= totalPages,
2050
+ onClick: () => goTo(page + 1),
2051
+ children: /* @__PURE__ */ jsx28(ChevronRightIcon3, { size: 16 })
2052
+ }
2053
+ ) })
2054
+ ] }) });
2055
+ });
2056
+
2057
+ // src/components/PhoneNumberInput/PhoneNumberInput.tsx
2058
+ import { forwardRef as forwardRef25, useRef as useRef10 } from "react";
2059
+ import { jsx as jsx29 } from "react/jsx-runtime";
2060
+ var sanitize3 = (input5) => {
2061
+ const digits = input5.replace(/\D/g, "");
2062
+ return digits.slice(0, phoneNumberMaxDigits(digits));
2063
+ };
2064
+ var isDigit4 = (char) => /\d/.test(char);
2065
+ var PhoneNumberInput = /* @__PURE__ */ forwardRef25(
2066
+ function PhoneNumberInput2(props, ref) {
2067
+ const {
2068
+ value: value4,
2069
+ defaultValue,
2070
+ onValueChange,
2071
+ label: labelProp,
2072
+ placeholder = "010-0000-0000",
2073
+ onKeyDown,
2074
+ ...rest
2075
+ } = props;
2076
+ const inputRef = useRef10(null);
2077
+ const m = useMessages();
2078
+ const label6 = labelProp ?? m.phoneNumber ?? "\uD734\uB300\uD3F0 \uBC88\uD638";
2079
+ const field3 = useFormattedInput({
2080
+ isControlled: "value" in props,
2081
+ value: value4,
2082
+ defaultValue,
2083
+ onValueChange,
2084
+ sanitize: sanitize3,
2085
+ format: formatPhoneNumber,
2086
+ isMeaningful: isDigit4,
2087
+ inputRef
2088
+ });
2089
+ return /* @__PURE__ */ jsx29(
2090
+ TextField,
2091
+ {
2092
+ ref: mergeRefs(ref, inputRef),
2093
+ label: label6,
2094
+ placeholder,
2095
+ type: "tel",
2096
+ inputMode: "tel",
2097
+ autoComplete: "tel-national",
2098
+ value: field3.display,
2099
+ onChange: field3.onChange,
2100
+ onKeyDown: (event) => {
2101
+ field3.onKeyDown(event);
2102
+ onKeyDown?.(event);
2103
+ },
2104
+ ...rest
2105
+ }
2106
+ );
2107
+ }
2108
+ );
2109
+
2110
+ // src/components/Progress/Progress.tsx
2111
+ import { forwardRef as forwardRef26, useId as useId7 } from "react";
2112
+
2113
+ // src/components/Progress/Progress.css.ts
2114
+ import { createRuntimeFn as _7a46815 } from "@vanilla-extract/recipes/createRuntimeFn";
2115
+ var header7 = "_1tvkq001";
2116
+ var indicator = /* @__PURE__ */ _7a46815({ defaultClassName: "_1tvkq008", variantClassNames: { color: { primary: "_1tvkq009", neutral: "_1tvkq00a", success: "_1tvkq00b", warning: "_1tvkq00c", danger: "_1tvkq00d" } }, defaultVariants: { color: "primary" }, compoundVariants: [] });
2117
+ var label3 = "_1tvkq002";
2118
+ var root7 = "_1tvkq000";
2119
+ var track = /* @__PURE__ */ _7a46815({ defaultClassName: "_1tvkq004", variantClassNames: { size: { sm: "_1tvkq005", md: "_1tvkq006", lg: "_1tvkq007" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
2120
+ var value2 = "_1tvkq003";
2121
+
2122
+ // src/components/Progress/Progress.tsx
2123
+ import { jsx as jsx30, jsxs as jsxs24 } from "react/jsx-runtime";
2124
+ var defaultFormat = (value4, max) => `${Math.round(value4 / max * 100)}%`;
2125
+ var Progress = /* @__PURE__ */ forwardRef26(function Progress2({
2126
+ value: value4,
2127
+ max = 100,
2128
+ label: label6,
2129
+ "aria-label": ariaLabel,
2130
+ showValue,
2131
+ formatValue = defaultFormat,
2132
+ size,
2133
+ color,
2134
+ className,
2135
+ ...rest
2136
+ }, ref) {
2137
+ const labelId = useId7();
2138
+ const isIndeterminate = value4 === void 0 || value4 === null;
2139
+ const safeMax = max > 0 ? max : 100;
2140
+ const clamped = isIndeterminate ? 0 : Math.min(safeMax, Math.max(0, value4));
2141
+ const valueText = isIndeterminate ? void 0 : formatValue(clamped, safeMax);
2142
+ return /* @__PURE__ */ jsxs24("div", { ref, className: cx(root7, className), ...rest, children: [
2143
+ (label6 || showValue && valueText) && /* @__PURE__ */ jsxs24("div", { className: header7, children: [
2144
+ label6 && /* @__PURE__ */ jsx30("span", { id: labelId, className: label3, children: label6 }),
2145
+ showValue && valueText && /* @__PURE__ */ jsx30("span", { className: value2, "aria-hidden": true, children: valueText })
2146
+ ] }),
2147
+ /* @__PURE__ */ jsx30(
2148
+ "div",
2149
+ {
2150
+ role: "progressbar",
2151
+ "aria-labelledby": label6 ? labelId : void 0,
2152
+ "aria-label": label6 ? void 0 : ariaLabel,
2153
+ "aria-valuemin": 0,
2154
+ "aria-valuemax": safeMax,
2155
+ "aria-valuenow": isIndeterminate ? void 0 : clamped,
2156
+ "aria-valuetext": valueText,
2157
+ className: track({ size }),
2158
+ children: /* @__PURE__ */ jsx30(
2159
+ "div",
2160
+ {
2161
+ className: indicator({ color }),
2162
+ "data-state": isIndeterminate ? "indeterminate" : clamped >= safeMax ? "complete" : "loading",
2163
+ style: isIndeterminate ? void 0 : { width: `${clamped / safeMax * 100}%` }
2164
+ }
2165
+ )
2166
+ }
2167
+ )
2168
+ ] });
2169
+ });
2170
+
2171
+ // src/components/RadioGroup/RadioGroup.tsx
2172
+ import * as RadixRadioGroup from "@radix-ui/react-radio-group";
2173
+ import { forwardRef as forwardRef27, useId as useId8 } from "react";
2174
+
2175
+ // src/components/RadioGroup/RadioGroup.css.ts
2176
+ import { createRuntimeFn as _7a46816 } from "@vanilla-extract/recipes/createRuntimeFn";
2177
+ var description4 = "_1w9iwjmd";
2178
+ var groupLabel = "_1w9iwjme";
2179
+ var indicator2 = "_1w9iwjma";
2180
+ var items = /* @__PURE__ */ _7a46816({ defaultClassName: "_1w9iwjm0", variantClassNames: { orientation: { vertical: "_1w9iwjm1", horizontal: "_1w9iwjm2" } }, defaultVariants: { orientation: "vertical" }, compoundVariants: [] });
2181
+ var labelText = "_1w9iwjmc";
2182
+ var option = /* @__PURE__ */ _7a46816({ defaultClassName: "_1w9iwjm3", variantClassNames: { size: { sm: "_1w9iwjm4", md: "_1w9iwjm5" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
2183
+ var radio = /* @__PURE__ */ _7a46816({ defaultClassName: "_1w9iwjm7", variantClassNames: { size: { sm: "_1w9iwjm8", md: "_1w9iwjm9" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
2184
+ var text = "_1w9iwjmb";
2185
+
2186
+ // src/components/RadioGroup/RadioGroup.tsx
2187
+ import { jsx as jsx31, jsxs as jsxs25 } from "react/jsx-runtime";
2188
+ var RadioGroup = /* @__PURE__ */ forwardRef27(function RadioGroup2(props, ref) {
2189
+ const {
2190
+ options,
2191
+ value: value4,
2192
+ defaultValue,
2193
+ onValueChange,
2194
+ label: label6,
2195
+ helperText: helperText3,
2196
+ error,
2197
+ orientation = "vertical",
2198
+ size,
2199
+ disabled,
2200
+ required,
2201
+ name,
2202
+ id,
2203
+ "aria-label": ariaLabel,
2204
+ className
2205
+ } = props;
2206
+ const isControlled = "value" in props;
2207
+ const generatedId = useId8();
2208
+ const baseId = id ?? generatedId;
2209
+ const labelId = label6 ? `${baseId}-label` : void 0;
2210
+ const helperId = helperText3 ? `${baseId}-helper` : void 0;
2211
+ return /* @__PURE__ */ jsxs25("div", { className: cx(field, className), children: [
2212
+ label6 && /* @__PURE__ */ jsxs25("span", { id: labelId, className: cx(label, groupLabel), children: [
2213
+ label6,
2214
+ required && /* @__PURE__ */ jsx31("span", { className: requiredMark, "aria-hidden": true, children: "*" })
2215
+ ] }),
2216
+ /* @__PURE__ */ jsx31(
2217
+ RadixRadioGroup.Root,
2218
+ {
2219
+ ref,
2220
+ id: baseId,
2221
+ value: isControlled ? value4 ?? "" : void 0,
2222
+ defaultValue,
2223
+ onValueChange,
2224
+ orientation,
2225
+ disabled,
2226
+ required,
2227
+ name,
2228
+ "aria-label": ariaLabel,
2229
+ "aria-labelledby": labelId,
2230
+ "aria-describedby": helperId,
2231
+ "aria-invalid": error || void 0,
2232
+ className: items({ orientation }),
2233
+ children: options.map((option2) => {
2234
+ const itemId = `${baseId}-${option2.value}`;
2235
+ const descriptionId = option2.description ? `${itemId}-description` : void 0;
2236
+ const itemDisabled = disabled || option2.disabled;
2237
+ return /* @__PURE__ */ jsxs25("div", { className: option({ size }), "data-disabled": itemDisabled || void 0, children: [
2238
+ /* @__PURE__ */ jsx31(
2239
+ RadixRadioGroup.Item,
2240
+ {
2241
+ id: itemId,
2242
+ value: option2.value,
2243
+ disabled: option2.disabled,
2244
+ "aria-describedby": descriptionId,
2245
+ className: radio({ size }),
2246
+ children: /* @__PURE__ */ jsx31(RadixRadioGroup.Indicator, { className: indicator2 })
2247
+ }
2248
+ ),
2249
+ /* @__PURE__ */ jsxs25("span", { className: text, children: [
2250
+ /* @__PURE__ */ jsx31("label", { htmlFor: itemId, className: labelText, children: option2.label }),
2251
+ option2.description && /* @__PURE__ */ jsx31("span", { id: descriptionId, className: description4, children: option2.description })
2252
+ ] })
2253
+ ] }, option2.value);
2254
+ })
2255
+ }
2256
+ ),
2257
+ helperText3 && /* @__PURE__ */ jsx31("p", { id: helperId, className: helperText({ error }), children: helperText3 })
2258
+ ] });
2259
+ });
2260
+
2261
+ // src/components/SegmentedControl/SegmentedControl.tsx
2262
+ import { forwardRef as forwardRef28, useId as useId9, useRef as useRef11, useState as useState9 } from "react";
2263
+
2264
+ // src/components/SegmentedControl/SegmentedControl.css.ts
2265
+ import { createRuntimeFn as _7a46817 } from "@vanilla-extract/recipes/createRuntimeFn";
2266
+ var icon6 = "_1h65mmo7";
2267
+ var item7 = /* @__PURE__ */ _7a46817({ defaultClassName: "_1h65mmo2", variantClassNames: { size: { sm: "_1h65mmo3", md: "_1h65mmo4", lg: "_1h65mmo5" }, fullWidth: { true: "_1h65mmo6" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
2268
+ var root8 = /* @__PURE__ */ _7a46817({ defaultClassName: "_1h65mmo0", variantClassNames: { fullWidth: { true: "_1h65mmo1" } }, defaultVariants: {}, compoundVariants: [] });
2269
+
2270
+ // src/components/SegmentedControl/SegmentedControl.tsx
2271
+ import { jsx as jsx32, jsxs as jsxs26 } from "react/jsx-runtime";
2272
+ var NEXT_KEYS = { ArrowRight: 1, ArrowDown: 1, ArrowLeft: -1, ArrowUp: -1 };
2273
+ var SegmentedControl = /* @__PURE__ */ forwardRef28(
2274
+ function SegmentedControl2(props, ref) {
2275
+ const {
2276
+ options,
2277
+ value: value4,
2278
+ defaultValue,
2279
+ onValueChange,
2280
+ label: label6,
2281
+ "aria-label": ariaLabel,
2282
+ size,
2283
+ fullWidth,
2284
+ disabled,
2285
+ name,
2286
+ id,
2287
+ className
2288
+ } = props;
2289
+ const isControlled = "value" in props;
2290
+ const [innerValue, setInnerValue] = useState9(defaultValue ?? "");
2291
+ const current2 = isControlled ? value4 ?? "" : innerValue;
2292
+ const generatedId = useId9();
2293
+ const labelId = label6 ? `${id ?? generatedId}-label` : void 0;
2294
+ const itemRefs = useRef11([]);
2295
+ const isEnabled = (index) => !disabled && !options[index]?.disabled;
2296
+ const select = (index) => {
2297
+ const next = options[index].value;
2298
+ if (next === current2) return;
2299
+ if (!isControlled) setInnerValue(next);
2300
+ onValueChange?.(next);
2301
+ };
2302
+ const checkedIndex = options.findIndex((option2) => option2.value === current2);
2303
+ const tabStop = checkedIndex >= 0 && isEnabled(checkedIndex) ? checkedIndex : options.findIndex((_, i) => isEnabled(i));
2304
+ const handleKeyDown = (event, index) => {
2305
+ let target = -1;
2306
+ const step = NEXT_KEYS[event.key];
2307
+ if (step) {
2308
+ for (let i = 1; i <= options.length; i++) {
2309
+ const candidate = (index + step * i + options.length) % options.length;
2310
+ if (isEnabled(candidate)) {
2311
+ target = candidate;
2312
+ break;
2313
+ }
2314
+ }
2315
+ } else if (event.key === "Home") {
2316
+ target = options.findIndex((_, i) => isEnabled(i));
2317
+ } else if (event.key === "End") {
2318
+ for (let i = options.length - 1; i >= 0 && target < 0; i--) if (isEnabled(i)) target = i;
2319
+ }
2320
+ if (target < 0) return;
2321
+ event.preventDefault();
2322
+ itemRefs.current[target]?.focus();
2323
+ select(target);
2324
+ };
2325
+ const group = /* @__PURE__ */ jsxs26(
2326
+ "div",
2327
+ {
2328
+ ref,
2329
+ id,
2330
+ role: "radiogroup",
2331
+ "aria-labelledby": labelId,
2332
+ "aria-label": label6 ? void 0 : ariaLabel,
2333
+ "aria-disabled": disabled || void 0,
2334
+ className: cx(root8({ fullWidth }), !label6 && className),
2335
+ children: [
2336
+ options.map((option2, index) => {
2337
+ const checked = index === checkedIndex;
2338
+ return /* @__PURE__ */ jsxs26(
2339
+ "button",
2340
+ {
2341
+ ref: (node) => {
2342
+ itemRefs.current[index] = node;
2343
+ },
2344
+ type: "button",
2345
+ role: "radio",
2346
+ "aria-checked": checked,
2347
+ tabIndex: index === tabStop ? 0 : -1,
2348
+ disabled: !isEnabled(index),
2349
+ "data-state": checked ? "checked" : "unchecked",
2350
+ "data-disabled": isEnabled(index) ? void 0 : "",
2351
+ className: item7({ size, fullWidth }),
2352
+ onClick: () => select(index),
2353
+ onKeyDown: (event) => handleKeyDown(event, index),
2354
+ children: [
2355
+ option2.icon && /* @__PURE__ */ jsx32("span", { "aria-hidden": true, className: icon6, children: option2.icon }),
2356
+ option2.label
2357
+ ]
2358
+ },
2359
+ option2.value
2360
+ );
2361
+ }),
2362
+ name && /* @__PURE__ */ jsx32("input", { type: "hidden", name, value: current2 })
2363
+ ]
2364
+ }
2365
+ );
2366
+ if (!label6) return group;
2367
+ return /* @__PURE__ */ jsxs26("div", { className: cx(field, className), children: [
2368
+ /* @__PURE__ */ jsx32("span", { id: labelId, className: label, children: label6 }),
2369
+ group
2370
+ ] });
2371
+ }
2372
+ );
2373
+
2374
+ // src/components/Select/Select.tsx
2375
+ import * as RadixSelect from "@radix-ui/react-select";
2376
+ import { forwardRef as forwardRef29, useId as useId10 } from "react";
2377
+ import { CheckIcon as CheckIcon2, ChevronDownIcon as ChevronDownIcon4 } from "@bestow-ui/icons";
2378
+ import { jsx as jsx33, jsxs as jsxs27 } from "react/jsx-runtime";
2379
+ var Select = /* @__PURE__ */ forwardRef29(function Select2(props, ref) {
2380
+ const {
2381
+ options,
2382
+ value: value4,
2383
+ defaultValue,
2384
+ onValueChange,
2385
+ placeholder,
2386
+ label: label6,
2387
+ helperText: helperText3,
2388
+ error,
2389
+ size,
2390
+ fullWidth,
2391
+ disabled,
2392
+ required,
2393
+ name,
2394
+ id,
2395
+ "aria-label": ariaLabel,
2396
+ className
2397
+ } = props;
2398
+ const isControlled = "value" in props;
2399
+ const generatedId = useId10();
2400
+ const triggerId = id ?? generatedId;
2401
+ const helperId = helperText3 ? `${triggerId}-helper` : void 0;
2402
+ const portal2 = usePortalProps();
2403
+ return /* @__PURE__ */ jsxs27("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
2404
+ label6 && /* @__PURE__ */ jsxs27("label", { htmlFor: triggerId, className: label, children: [
2405
+ label6,
2406
+ required && /* @__PURE__ */ jsx33("span", { className: requiredMark, "aria-hidden": true, children: "*" })
2407
+ ] }),
2408
+ /* @__PURE__ */ jsxs27(
2409
+ RadixSelect.Root,
2410
+ {
2411
+ value: isControlled ? value4 ?? "" : void 0,
2412
+ defaultValue,
2413
+ onValueChange,
2414
+ disabled,
2415
+ required,
2416
+ name,
2417
+ children: [
2418
+ /* @__PURE__ */ jsxs27(
2419
+ RadixSelect.Trigger,
2420
+ {
2421
+ ref,
2422
+ id: triggerId,
2423
+ "aria-label": ariaLabel,
2424
+ "aria-invalid": error || void 0,
2425
+ "aria-describedby": helperId,
2426
+ "data-invalid": error || void 0,
2427
+ className: cx(root3({ size, fullWidth }), trigger2, className),
2428
+ children: [
2429
+ /* @__PURE__ */ jsx33("span", { className: value, children: /* @__PURE__ */ jsx33(RadixSelect.Value, { placeholder }) }),
2430
+ /* @__PURE__ */ jsx33(RadixSelect.Icon, { className: icon4, children: /* @__PURE__ */ jsx33(ChevronDownIcon4, { size: 16 }) })
2431
+ ]
2432
+ }
2433
+ ),
2434
+ /* @__PURE__ */ jsx33(RadixSelect.Portal, { children: /* @__PURE__ */ jsx33(
2435
+ RadixSelect.Content,
2436
+ {
2437
+ position: "popper",
2438
+ sideOffset: 4,
2439
+ collisionPadding: 8,
2440
+ className: cx(portal2.className, content5),
2441
+ style: portal2.style,
2442
+ children: /* @__PURE__ */ jsx33(RadixSelect.Viewport, { className: viewport, children: options.map((option2) => /* @__PURE__ */ jsxs27(
2443
+ RadixSelect.Item,
2444
+ {
2445
+ value: option2.value,
2446
+ disabled: option2.disabled,
2447
+ className: item4,
2448
+ children: [
2449
+ /* @__PURE__ */ jsx33(RadixSelect.ItemText, { children: option2.label }),
2450
+ /* @__PURE__ */ jsx33(RadixSelect.ItemIndicator, { className: itemIndicator, children: /* @__PURE__ */ jsx33(CheckIcon2, { size: 16 }) })
2451
+ ]
2452
+ },
2453
+ option2.value
2454
+ )) })
2455
+ }
2456
+ ) })
2457
+ ]
2458
+ }
2459
+ ),
2460
+ helperText3 && /* @__PURE__ */ jsx33("p", { id: helperId, className: helperText({ error }), children: helperText3 })
2461
+ ] });
2462
+ });
2463
+
2464
+ // src/components/Skeleton/Skeleton.tsx
2465
+ import { assignInlineVars } from "@vanilla-extract/dynamic";
2466
+ import { forwardRef as forwardRef30 } from "react";
2467
+
2468
+ // src/components/Skeleton/Skeleton.css.ts
2469
+ import { createRuntimeFn as _7a46818 } from "@vanilla-extract/recipes/createRuntimeFn";
2470
+ var height = "var(--_1s8datd1)";
2471
+ var lines = "_1s8datd6";
2472
+ var skeleton = /* @__PURE__ */ _7a46818({ defaultClassName: "_1s8datd2", variantClassNames: { variant: { text: "_1s8datd3", rect: "_1s8datd4", circle: "_1s8datd5" } }, defaultVariants: { variant: "text" }, compoundVariants: [] });
2473
+ var width = "var(--_1s8datd0)";
2474
+
2475
+ // src/components/Skeleton/Skeleton.tsx
2476
+ import { jsx as jsx34 } from "react/jsx-runtime";
2477
+ var toCss = (value4) => typeof value4 === "number" ? `${value4}px` : value4;
2478
+ var Skeleton = /* @__PURE__ */ forwardRef30(function Skeleton2({ variant = "text", width: width2, height: height2, lines: lines2 = 1, className, style, ...rest }, ref) {
2479
+ const w = toCss(width2 ?? (variant === "circle" ? 40 : "100%"));
2480
+ const h = toCss(height2 ?? (variant === "circle" ? w : variant === "rect" ? 100 : "1em"));
2481
+ if (variant === "text" && lines2 > 1) {
2482
+ return /* @__PURE__ */ jsx34(
2483
+ "span",
2484
+ {
2485
+ ref,
2486
+ "aria-hidden": true,
2487
+ className: cx(lines, className),
2488
+ style: { ...assignInlineVars({ [width]: w }), ...style },
2489
+ ...rest,
2490
+ children: Array.from({ length: lines2 }, (_, i) => /* @__PURE__ */ jsx34(
2491
+ "span",
2492
+ {
2493
+ className: skeleton({ variant }),
2494
+ style: assignInlineVars({ [width]: i === lines2 - 1 ? "60%" : "100%", [height]: h })
2495
+ },
2496
+ i
2497
+ ))
2498
+ }
2499
+ );
2500
+ }
2501
+ return /* @__PURE__ */ jsx34(
2502
+ "span",
2503
+ {
2504
+ ref,
2505
+ "aria-hidden": true,
2506
+ className: cx(skeleton({ variant }), className),
2507
+ style: { ...assignInlineVars({ [width]: w, [height]: h }), ...style },
2508
+ ...rest
2509
+ }
2510
+ );
2511
+ });
2512
+
2513
+ // src/components/SkipLink/SkipLink.tsx
2514
+ import { forwardRef as forwardRef31 } from "react";
2515
+
2516
+ // src/components/SkipLink/SkipLink.css.ts
2517
+ var skipLink = "_1t9jaar0";
2518
+
2519
+ // src/components/SkipLink/SkipLink.tsx
2520
+ import { jsx as jsx35 } from "react/jsx-runtime";
2521
+ var SkipLink = /* @__PURE__ */ forwardRef31(function SkipLink2({ href = "#main", className, children, onClick, ...rest }, ref) {
2522
+ const m = useMessages();
2523
+ const handleClick = (event) => {
2524
+ onClick?.(event);
2525
+ if (event.defaultPrevented || !href.startsWith("#")) return;
2526
+ const target = document.getElementById(decodeURIComponent(href.slice(1)));
2527
+ if (!target) return;
2528
+ event.preventDefault();
2529
+ if (!target.hasAttribute("tabindex")) target.setAttribute("tabindex", "-1");
2530
+ target.focus();
2531
+ target.scrollIntoView?.({ block: "start" });
2532
+ };
2533
+ return /* @__PURE__ */ jsx35("a", { ref, href, className: cx(skipLink, className), onClick: handleClick, ...rest, children: children ?? m.skipToContent ?? "\uBCF8\uBB38 \uBC14\uB85C\uAC00\uAE30" });
2534
+ });
2535
+
2536
+ // src/components/Slider/Slider.tsx
2537
+ import * as RadixSlider from "@radix-ui/react-slider";
2538
+ import { forwardRef as forwardRef32, useId as useId11, useState as useState10 } from "react";
2539
+
2540
+ // src/components/Slider/Slider.css.ts
2541
+ import { createRuntimeFn as _7a46819 } from "@vanilla-extract/recipes/createRuntimeFn";
2542
+ var field2 = "_126mzjm0";
2543
+ var header8 = "_126mzjm1";
2544
+ var helperText2 = "_126mzjm4";
2545
+ var label4 = "_126mzjm2";
2546
+ var range2 = "_126mzjmb";
2547
+ var root9 = /* @__PURE__ */ _7a46819({ defaultClassName: "_126mzjm5", variantClassNames: { size: { sm: "_126mzjm6", md: "_126mzjm7" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
2548
+ var thumb = /* @__PURE__ */ _7a46819({ defaultClassName: "_126mzjmc", variantClassNames: { size: { sm: "_126mzjmd", md: "_126mzjme" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
2549
+ var track2 = /* @__PURE__ */ _7a46819({ defaultClassName: "_126mzjm8", variantClassNames: { size: { sm: "_126mzjm9", md: "_126mzjma" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
2550
+ var value3 = "_126mzjm3";
2551
+
2552
+ // src/components/Slider/Slider.tsx
2553
+ import { jsx as jsx36, jsxs as jsxs28 } from "react/jsx-runtime";
2554
+ var Slider = /* @__PURE__ */ forwardRef32(function Slider2(props, ref) {
2555
+ const {
2556
+ value: value4,
2557
+ defaultValue,
2558
+ onValueChange,
2559
+ min = 0,
2560
+ max = 100,
2561
+ label: label6,
2562
+ "aria-label": ariaLabel,
2563
+ helperText: helperText3,
2564
+ showValue,
2565
+ formatValue = String,
2566
+ thumbLabels: thumbLabelsProp,
2567
+ size,
2568
+ id,
2569
+ className,
2570
+ disabled,
2571
+ ...rest
2572
+ } = props;
2573
+ const m = useMessages();
2574
+ const thumbLabels = thumbLabelsProp ?? [m.rangeStart ?? "\uCD5C\uC18C", m.rangeEnd ?? "\uCD5C\uB300"];
2575
+ const generatedId = useId11();
2576
+ const baseId = id ?? generatedId;
2577
+ const labelId = `${baseId}-label`;
2578
+ const helperId = `${baseId}-helper`;
2579
+ const isControlled = "value" in props;
2580
+ const [innerValue, setInnerValue] = useState10(defaultValue ?? [min]);
2581
+ const current2 = isControlled ? value4 ?? [min] : innerValue;
2582
+ const isRange = current2.length > 1;
2583
+ const handleChange = (next) => {
2584
+ if (!isControlled) setInnerValue(next);
2585
+ onValueChange?.(next);
2586
+ };
2587
+ const valueText = current2.map(formatValue).join(" \u2013 ");
2588
+ return /* @__PURE__ */ jsxs28("div", { className: cx(field2, className), children: [
2589
+ (label6 || showValue) && /* @__PURE__ */ jsxs28("div", { className: header8, children: [
2590
+ label6 && /* @__PURE__ */ jsx36("span", { id: labelId, className: label4, children: label6 }),
2591
+ showValue && /* @__PURE__ */ jsx36("span", { className: value3, "aria-hidden": true, children: valueText })
2592
+ ] }),
2593
+ /* @__PURE__ */ jsxs28(
2594
+ RadixSlider.Root,
2595
+ {
2596
+ ref,
2597
+ id: baseId,
2598
+ min,
2599
+ max,
2600
+ disabled,
2601
+ value: current2,
2602
+ onValueChange: handleChange,
2603
+ className: root9({ size }),
2604
+ ...rest,
2605
+ children: [
2606
+ /* @__PURE__ */ jsx36(RadixSlider.Track, { className: track2({ size }), children: /* @__PURE__ */ jsx36(RadixSlider.Range, { className: range2 }) }),
2607
+ current2.map((thumbValue, index) => {
2608
+ const thumbLabelId = `${baseId}-thumb-${index}`;
2609
+ return /* @__PURE__ */ jsx36(
2610
+ RadixSlider.Thumb,
2611
+ {
2612
+ className: thumb({ size }),
2613
+ "aria-labelledby": label6 ? isRange ? `${labelId} ${thumbLabelId}` : labelId : isRange ? thumbLabelId : void 0,
2614
+ "aria-label": label6 ? void 0 : isRange ? void 0 : ariaLabel,
2615
+ "aria-valuetext": formatValue(thumbValue),
2616
+ "aria-describedby": helperText3 ? helperId : void 0
2617
+ },
2618
+ index
2619
+ );
2620
+ })
2621
+ ]
2622
+ }
2623
+ ),
2624
+ isRange && current2.map((_, index) => /* @__PURE__ */ jsxs28("span", { id: `${baseId}-thumb-${index}`, hidden: true, children: [
2625
+ label6 ? "" : ariaLabel ? `${ariaLabel} ` : "",
2626
+ thumbLabels[index] ?? `${index + 1}`
2627
+ ] }, index)),
2628
+ helperText3 && /* @__PURE__ */ jsx36("span", { id: helperId, className: helperText2, children: helperText3 })
2629
+ ] });
2630
+ });
2631
+
2632
+ // src/components/Stack/Stack.tsx
2633
+ import { forwardRef as forwardRef33 } from "react";
2634
+
2635
+ // src/components/Stack/Stack.css.ts
2636
+ import { createRuntimeFn as _7a46820 } from "@vanilla-extract/recipes/createRuntimeFn";
2637
+ var stack = /* @__PURE__ */ _7a46820({ defaultClassName: "_1jz9hj90", variantClassNames: { direction: { row: "_1jz9hj91", column: "_1jz9hj92", "row-reverse": "_1jz9hj93", "column-reverse": "_1jz9hj94" }, gap: { "0": "_1jz9hj95", "1": "_1jz9hj96", "2": "_1jz9hj97", "3": "_1jz9hj98", "4": "_1jz9hj99", "5": "_1jz9hj9a", "6": "_1jz9hj9b", "8": "_1jz9hj9c", "10": "_1jz9hj9d", "12": "_1jz9hj9e", "16": "_1jz9hj9f" }, align: { start: "_1jz9hj9g", center: "_1jz9hj9h", end: "_1jz9hj9i", stretch: "_1jz9hj9j", baseline: "_1jz9hj9k" }, justify: { start: "_1jz9hj9l", center: "_1jz9hj9m", end: "_1jz9hj9n", between: "_1jz9hj9o", around: "_1jz9hj9p", evenly: "_1jz9hj9q" }, wrap: { true: "_1jz9hj9r" } }, defaultVariants: { direction: "column" }, compoundVariants: [] });
2638
+
2639
+ // src/components/Stack/Stack.tsx
2640
+ import { jsx as jsx37 } from "react/jsx-runtime";
2641
+ var Stack = /* @__PURE__ */ forwardRef33(function Stack2({ as: Component = "div", direction, gap, align, justify, wrap, className, ...rest }, ref) {
2642
+ return /* @__PURE__ */ jsx37(Component, { ref, className: cx(stack({ direction, gap, align, justify, wrap }), className), ...rest });
2643
+ });
2644
+
2645
+ // src/components/Switch/Switch.tsx
2646
+ import * as RadixSwitch from "@radix-ui/react-switch";
2647
+ import { forwardRef as forwardRef34, useId as useId12 } from "react";
2648
+
2649
+ // src/components/Switch/Switch.css.ts
2650
+ import { createRuntimeFn as _7a46821 } from "@vanilla-extract/recipes/createRuntimeFn";
2651
+ var label5 = "o33ul29";
2652
+ var root10 = /* @__PURE__ */ _7a46821({ defaultClassName: "o33ul20", variantClassNames: { size: { sm: "o33ul21", md: "o33ul22" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
2653
+ var thumb2 = /* @__PURE__ */ _7a46821({ defaultClassName: "o33ul26", variantClassNames: { size: { sm: "o33ul27", md: "o33ul28" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
2654
+ var track3 = /* @__PURE__ */ _7a46821({ defaultClassName: "o33ul23", variantClassNames: { size: { sm: "o33ul24", md: "o33ul25" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
2655
+
2656
+ // src/components/Switch/Switch.tsx
2657
+ import { jsx as jsx38, jsxs as jsxs29 } from "react/jsx-runtime";
2658
+ var Switch = /* @__PURE__ */ forwardRef34(function Switch2({ label: label6, size, id, className, disabled, "aria-label": ariaLabel, ...rest }, ref) {
2659
+ const generatedId = useId12();
2660
+ const switchId = id ?? generatedId;
2661
+ return /* @__PURE__ */ jsxs29("span", { className: cx(root10({ size }), className), "data-disabled": disabled || void 0, children: [
2662
+ /* @__PURE__ */ jsx38(
2663
+ RadixSwitch.Root,
2664
+ {
2665
+ ref,
2666
+ id: switchId,
2667
+ disabled,
2668
+ "aria-label": ariaLabel,
2669
+ className: track3({ size }),
2670
+ ...rest,
2671
+ children: /* @__PURE__ */ jsx38(RadixSwitch.Thumb, { className: thumb2({ size }) })
2672
+ }
2673
+ ),
2674
+ label6 && /* @__PURE__ */ jsx38("label", { htmlFor: switchId, className: label5, children: label6 })
2675
+ ] });
2676
+ });
2677
+
2678
+ // src/components/Table/Table.tsx
2679
+ import {
2680
+ createContext as createContext3,
2681
+ forwardRef as forwardRef35,
2682
+ useContext as useContext3,
2683
+ useId as useId13
2684
+ } from "react";
2685
+ import { ArrowDownIcon, ArrowUpIcon } from "@bestow-ui/icons";
2686
+
2687
+ // src/components/Table/Table.css.ts
2688
+ import { createRuntimeFn as _7a46822 } from "@vanilla-extract/recipes/createRuntimeFn";
2689
+ var body4 = "l3ploy5";
2690
+ var caption = "l3ploy2";
2691
+ var cell2 = /* @__PURE__ */ _7a46822({ defaultClassName: "l3ploy9", variantClassNames: { size: { sm: "l3ploya", md: "l3ployb" }, align: { left: "l3ployc", center: "l3ployd", right: "l3ploye" } }, defaultVariants: { size: "md", align: "left" }, compoundVariants: [] });
2692
+ var container = "l3ploy0";
2693
+ var footer4 = "l3ploy7";
2694
+ var footerCell = "l3ployg";
2695
+ var head = "l3ployf";
2696
+ var header9 = "l3ploy3";
2697
+ var row3 = "l3ploy8";
2698
+ var sortButton = "l3ployh";
2699
+ var sortIcon = "l3ployi";
2700
+ var stickyHeader = "l3ploy4";
2701
+ var striped = "l3ploy6";
2702
+ var table = "l3ploy1";
2703
+
2704
+ // src/components/Table/Table.tsx
2705
+ import { jsx as jsx39, jsxs as jsxs30 } from "react/jsx-runtime";
2706
+ var TableSizeContext = /* @__PURE__ */ createContext3("md");
2707
+ var TableSectionContext = /* @__PURE__ */ createContext3("body");
2708
+ var Table = /* @__PURE__ */ forwardRef35(function Table2({
2709
+ size = "md",
2710
+ striped: striped2,
2711
+ stickyHeader: stickyHeader2,
2712
+ caption: caption2,
2713
+ "aria-label": ariaLabel,
2714
+ containerClassName,
2715
+ containerStyle,
2716
+ className,
2717
+ children,
2718
+ ...rest
2719
+ }, ref) {
2720
+ const captionId = useId13();
2721
+ return /* @__PURE__ */ jsx39(TableSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsx39(
2722
+ "div",
2723
+ {
2724
+ className: cx(container, containerClassName),
2725
+ style: containerStyle,
2726
+ tabIndex: 0,
2727
+ role: "region",
2728
+ "aria-labelledby": caption2 ? captionId : void 0,
2729
+ "aria-label": caption2 ? void 0 : ariaLabel,
2730
+ children: /* @__PURE__ */ jsxs30(
2731
+ "table",
2732
+ {
2733
+ ref,
2734
+ className: cx(table, striped2 && striped, stickyHeader2 && stickyHeader, className),
2735
+ "aria-label": caption2 ? void 0 : ariaLabel,
2736
+ ...rest,
2737
+ children: [
2738
+ caption2 && /* @__PURE__ */ jsx39("caption", { id: captionId, className: caption, children: caption2 }),
2739
+ children
2740
+ ]
2741
+ }
2742
+ )
2743
+ }
2744
+ ) });
2745
+ });
2746
+ var TableHeader = /* @__PURE__ */ forwardRef35(
2747
+ function TableHeader2({ className, ...rest }, ref) {
2748
+ return /* @__PURE__ */ jsx39(TableSectionContext.Provider, { value: "header", children: /* @__PURE__ */ jsx39("thead", { ref, className: cx(header9, className), ...rest }) });
2749
+ }
2750
+ );
2751
+ var TableBody = /* @__PURE__ */ forwardRef35(
2752
+ function TableBody2({ className, ...rest }, ref) {
2753
+ return /* @__PURE__ */ jsx39(TableSectionContext.Provider, { value: "body", children: /* @__PURE__ */ jsx39("tbody", { ref, className: cx(body4, className), ...rest }) });
2754
+ }
2755
+ );
2756
+ var TableFooter = /* @__PURE__ */ forwardRef35(
2757
+ function TableFooter2({ className, ...rest }, ref) {
2758
+ return /* @__PURE__ */ jsx39(TableSectionContext.Provider, { value: "footer", children: /* @__PURE__ */ jsx39("tfoot", { ref, className: cx(footer4, className), ...rest }) });
2759
+ }
2760
+ );
2761
+ var TableRow = /* @__PURE__ */ forwardRef35(function TableRow2({ selected, className, ...rest }, ref) {
2762
+ return /* @__PURE__ */ jsx39("tr", { ref, className: cx(row3, className), "data-state": selected ? "selected" : void 0, ...rest });
2763
+ });
2764
+ var TableHead = /* @__PURE__ */ forwardRef35(function TableHead2({ align, sortDirection, onSort, scope, className, children, ...rest }, ref) {
2765
+ const size = useContext3(TableSizeContext);
2766
+ const section = useContext3(TableSectionContext);
2767
+ const sortable = onSort !== void 0;
2768
+ const direction = sortDirection ?? "none";
2769
+ const SortIcon = direction === "descending" ? ArrowDownIcon : ArrowUpIcon;
2770
+ return /* @__PURE__ */ jsx39(
2771
+ "th",
2772
+ {
2773
+ ref,
2774
+ scope: scope ?? (section === "header" ? "col" : "row"),
2775
+ "aria-sort": sortable && direction !== "none" ? direction : void 0,
2776
+ className: cx(
2777
+ cell2({ size, align }),
2778
+ section === "header" ? head : section === "footer" ? footerCell : void 0,
2779
+ className
2780
+ ),
2781
+ ...rest,
2782
+ children: sortable ? /* @__PURE__ */ jsxs30("button", { type: "button", className: sortButton, onClick: onSort, children: [
2783
+ children,
2784
+ /* @__PURE__ */ jsx39(SortIcon, { size: 14, className: sortIcon, "data-active": direction !== "none", "aria-hidden": true })
2785
+ ] }) : children
2786
+ }
2787
+ );
2788
+ });
2789
+ var TableCell = /* @__PURE__ */ forwardRef35(function TableCell2({ align, className, ...rest }, ref) {
2790
+ const size = useContext3(TableSizeContext);
2791
+ const section = useContext3(TableSectionContext);
2792
+ return /* @__PURE__ */ jsx39(
2793
+ "td",
2794
+ {
2795
+ ref,
2796
+ className: cx(cell2({ size, align }), section === "footer" && footerCell, className),
2797
+ ...rest
2798
+ }
2799
+ );
2800
+ });
2801
+
2802
+ // src/components/Tabs/Tabs.tsx
2803
+ import * as RadixTabs from "@radix-ui/react-tabs";
2804
+ import { createContext as createContext4, forwardRef as forwardRef36, useContext as useContext4 } from "react";
2805
+
2806
+ // src/components/Tabs/Tabs.css.ts
2807
+ import { createRuntimeFn as _7a46823 } from "@vanilla-extract/recipes/createRuntimeFn";
2808
+ var content10 = "fvhbtda";
2809
+ var list4 = /* @__PURE__ */ _7a46823({ defaultClassName: "fvhbtd0", variantClassNames: { variant: { line: "fvhbtd1", soft: "fvhbtd2" } }, defaultVariants: { variant: "line" }, compoundVariants: [] });
2810
+ var trigger3 = /* @__PURE__ */ _7a46823({ defaultClassName: "fvhbtd3", variantClassNames: { variant: { line: "fvhbtd4", soft: "fvhbtd5" }, size: { sm: "fvhbtd6", md: "fvhbtd7" } }, defaultVariants: { variant: "line", size: "md" }, compoundVariants: [[{ variant: "soft", size: "sm" }, "fvhbtd8"], [{ variant: "soft", size: "md" }, "fvhbtd9"]] });
2811
+
2812
+ // src/components/Tabs/Tabs.tsx
2813
+ import { jsx as jsx40 } from "react/jsx-runtime";
2814
+ var TabsStyleContext = /* @__PURE__ */ createContext4({ variant: "line", size: "md" });
2815
+ var Tabs = /* @__PURE__ */ forwardRef36(function Tabs2({ variant = "line", size = "md", ...props }, ref) {
2816
+ const controlled = "value" in props ? { value: props.value ?? "" } : {};
2817
+ return /* @__PURE__ */ jsx40(TabsStyleContext.Provider, { value: { variant, size }, children: /* @__PURE__ */ jsx40(RadixTabs.Root, { ref, ...props, ...controlled }) });
2818
+ });
2819
+ var TabsList = /* @__PURE__ */ forwardRef36(function TabsList2({ className, ...rest }, ref) {
2820
+ const { variant } = useContext4(TabsStyleContext);
2821
+ return /* @__PURE__ */ jsx40(RadixTabs.List, { ref, className: cx(list4({ variant }), className), ...rest });
2822
+ });
2823
+ var TabsTrigger = /* @__PURE__ */ forwardRef36(function TabsTrigger2({ className, ...rest }, ref) {
2824
+ const { variant, size } = useContext4(TabsStyleContext);
2825
+ return /* @__PURE__ */ jsx40(RadixTabs.Trigger, { ref, className: cx(trigger3({ variant, size }), className), ...rest });
2826
+ });
2827
+ var TabsContent = /* @__PURE__ */ forwardRef36(function TabsContent2({ className, ...rest }, ref) {
2828
+ return /* @__PURE__ */ jsx40(RadixTabs.Content, { ref, className: cx(content10, className), ...rest });
2829
+ });
2830
+
2831
+ // src/components/Textarea/Textarea.tsx
2832
+ import {
2833
+ forwardRef as forwardRef37,
2834
+ useCallback,
2835
+ useId as useId14,
2836
+ useRef as useRef12,
2837
+ useState as useState11
2838
+ } from "react";
2839
+
2840
+ // src/components/Textarea/Textarea.css.ts
2841
+ import { createRuntimeFn as _7a46824 } from "@vanilla-extract/recipes/createRuntimeFn";
2842
+ var count = "_1koawa9";
2843
+ var countOver = "_1koawaa";
2844
+ var defaultWidth = "_1koawa7";
2845
+ var footer5 = "_1koawa8";
2846
+ var textarea = /* @__PURE__ */ _7a46824({ defaultClassName: "_1koawa0", variantClassNames: { size: { sm: "_1koawa1", md: "_1koawa2", lg: "_1koawa3" }, resize: { none: "_1koawa4", vertical: "_1koawa5", both: "_1koawa6" } }, defaultVariants: { size: "md", resize: "vertical" }, compoundVariants: [] });
2847
+
2848
+ // src/components/Textarea/Textarea.tsx
2849
+ import { jsx as jsx41, jsxs as jsxs31 } from "react/jsx-runtime";
2850
+ var Textarea = /* @__PURE__ */ forwardRef37(function Textarea2({
2851
+ label: label6,
2852
+ helperText: helperText3,
2853
+ error,
2854
+ size,
2855
+ fullWidth,
2856
+ resize,
2857
+ autoResize,
2858
+ showCount,
2859
+ required,
2860
+ id,
2861
+ rows = 3,
2862
+ value: value4,
2863
+ defaultValue,
2864
+ onChange,
2865
+ maxLength,
2866
+ className,
2867
+ style,
2868
+ "aria-describedby": ariaDescribedBy,
2869
+ ...rest
2870
+ }, ref) {
2871
+ const generatedId = useId14();
2872
+ const textareaId = id ?? generatedId;
2873
+ const helperId = helperText3 ? `${textareaId}-helper` : void 0;
2874
+ const innerRef = useRef12(null);
2875
+ const [uncontrolledLength, setUncontrolledLength] = useState11(() => String(defaultValue ?? "").length);
2876
+ const length = value4 !== void 0 ? String(value4).length : uncontrolledLength;
2877
+ const fitHeight = useCallback(() => {
2878
+ const el = innerRef.current;
2879
+ if (!autoResize || !el) return;
2880
+ el.style.height = "auto";
2881
+ const borders = el.offsetHeight - el.clientHeight;
2882
+ el.style.height = `${el.scrollHeight + borders}px`;
2883
+ }, [autoResize]);
2884
+ useIsomorphicLayoutEffect(fitHeight, [fitHeight, value4]);
2885
+ const handleChange = (event) => {
2886
+ if (value4 === void 0) setUncontrolledLength(event.target.value.length);
2887
+ fitHeight();
2888
+ onChange?.(event);
2889
+ };
2890
+ return /* @__PURE__ */ jsxs31("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
2891
+ label6 && /* @__PURE__ */ jsxs31("label", { htmlFor: textareaId, className: label, children: [
2892
+ label6,
2893
+ required && /* @__PURE__ */ jsx41("span", { className: requiredMark, "aria-hidden": true, children: "*" })
2894
+ ] }),
2895
+ /* @__PURE__ */ jsx41(
2896
+ "textarea",
2897
+ {
2898
+ ref: mergeRefs(innerRef, ref),
2899
+ id: textareaId,
2900
+ rows,
2901
+ value: value4,
2902
+ defaultValue,
2903
+ onChange: handleChange,
2904
+ maxLength,
2905
+ required,
2906
+ "aria-invalid": error || void 0,
2907
+ "aria-describedby": cx(helperId, ariaDescribedBy) || void 0,
2908
+ className: cx(
2909
+ textarea({ size, resize: autoResize ? "none" : resize }),
2910
+ !fullWidth && defaultWidth,
2911
+ className
2912
+ ),
2913
+ style: autoResize ? { overflowY: "auto", ...style } : style,
2914
+ ...rest
2915
+ }
2916
+ ),
2917
+ (helperText3 || showCount) && /* @__PURE__ */ jsxs31("div", { className: footer5, children: [
2918
+ helperText3 && /* @__PURE__ */ jsx41("p", { id: helperId, className: helperText({ error }), children: helperText3 }),
2919
+ showCount && /* @__PURE__ */ jsx41("span", { className: cx(count, maxLength !== void 0 && length >= maxLength && countOver), children: maxLength !== void 0 ? `${length}/${maxLength}` : length })
2920
+ ] })
2921
+ ] });
2922
+ });
2923
+
2924
+ // src/components/Toast/Toast.tsx
2925
+ import * as RadixToast from "@radix-ui/react-toast";
2926
+ import { createContext as createContext5, useCallback as useCallback2, useContext as useContext5, useMemo as useMemo4, useRef as useRef13, useState as useState12 } from "react";
2927
+ import { XIcon as XIcon6 } from "@bestow-ui/icons";
2928
+
2929
+ // src/components/Toast/Toast.css.ts
2930
+ import { createRuntimeFn as _7a46825 } from "@vanilla-extract/recipes/createRuntimeFn";
2931
+ var action2 = "_1g11zvx9";
2932
+ var close = "_1g11zvxa";
2933
+ var description5 = "_1g11zvx8";
2934
+ var title5 = "_1g11zvx7";
2935
+ var toast = /* @__PURE__ */ _7a46825({ defaultClassName: "_1g11zvx1", variantClassNames: { color: { primary: "_1g11zvx2", neutral: "_1g11zvx3", success: "_1g11zvx4", warning: "_1g11zvx5", danger: "_1g11zvx6" } }, defaultVariants: { color: "neutral" }, compoundVariants: [] });
2936
+ var viewport2 = "_1g11zvx0";
2937
+
2938
+ // src/components/Toast/Toast.tsx
2939
+ import { jsx as jsx42, jsxs as jsxs32 } from "react/jsx-runtime";
2940
+ var REMOVE_DELAY = 500;
2941
+ var ToastContext = /* @__PURE__ */ createContext5(null);
2942
+ function ToastProvider({ children, duration = 5e3, label: labelProp }) {
2943
+ const m = useMessages();
2944
+ const label6 = labelProp ?? m.notifications ?? "\uC54C\uB9BC";
2945
+ const [toasts, setToasts] = useState12([]);
2946
+ const nextId = useRef13(0);
2947
+ const portal2 = usePortalProps();
2948
+ const toast2 = useCallback2((options) => {
2949
+ const id = nextId.current++;
2950
+ setToasts((prev) => [...prev, { ...options, id, open: true }]);
2951
+ return id;
2952
+ }, []);
2953
+ const dismiss = useCallback2((id) => {
2954
+ const isTarget = (t) => id === void 0 || t.id === id;
2955
+ setToasts((prev) => prev.map((t) => isTarget(t) ? { ...t, open: false } : t));
2956
+ setTimeout(() => setToasts((prev) => prev.filter((t) => t.open || !isTarget(t))), REMOVE_DELAY);
2957
+ }, []);
2958
+ const value4 = useMemo4(() => ({ toast: toast2, dismiss }), [toast2, dismiss]);
2959
+ return /* @__PURE__ */ jsx42(ToastContext.Provider, { value: value4, children: /* @__PURE__ */ jsxs32(RadixToast.Provider, { duration, label: label6, swipeDirection: "right", children: [
2960
+ children,
2961
+ toasts.map(({ id, open, title: title6, description: description6, color, duration: itemDuration, action: action3 }) => /* @__PURE__ */ jsxs32(
2962
+ RadixToast.Root,
2963
+ {
2964
+ open,
2965
+ duration: itemDuration,
2966
+ onOpenChange: (nextOpen) => {
2967
+ if (!nextOpen) dismiss(id);
2968
+ },
2969
+ className: toast({ color }),
2970
+ children: [
2971
+ /* @__PURE__ */ jsx42(RadixToast.Title, { className: title5, children: title6 }),
2972
+ description6 && /* @__PURE__ */ jsx42(RadixToast.Description, { className: description5, children: description6 }),
2973
+ action3 && /* @__PURE__ */ jsx42(RadixToast.Action, { asChild: true, altText: action3.altText ?? action3.label, className: action2, children: /* @__PURE__ */ jsx42(Button, { size: "sm", variant: "soft", color: "neutral", onClick: action3.onClick, children: action3.label }) }),
2974
+ /* @__PURE__ */ jsx42(RadixToast.Close, { className: close, "aria-label": m.close ?? "\uB2EB\uAE30", children: /* @__PURE__ */ jsx42(XIcon6, { size: 16 }) })
2975
+ ]
2976
+ },
2977
+ id
2978
+ )),
2979
+ /* @__PURE__ */ jsx42(RadixToast.Viewport, { className: cx(portal2.className, viewport2), style: portal2.style })
2980
+ ] }) });
2981
+ }
2982
+ function useToast() {
2983
+ const context = useContext5(ToastContext);
2984
+ if (!context) throw new Error("useToast \uB294 ToastProvider \uC548\uC5D0\uC11C \uC0AC\uC6A9\uD574\uC57C \uD569\uB2C8\uB2E4.");
2985
+ return context;
2986
+ }
2987
+
2988
+ // src/components/Tooltip/Tooltip.tsx
2989
+ import * as RadixTooltip from "@radix-ui/react-tooltip";
2990
+
2991
+ // src/components/Tooltip/Tooltip.css.ts
2992
+ var arrow2 = "z7rufs1";
2993
+ var content11 = "z7rufs0";
2994
+
2995
+ // src/components/Tooltip/Tooltip.tsx
2996
+ import { jsx as jsx43, jsxs as jsxs33 } from "react/jsx-runtime";
2997
+ function Tooltip({
2998
+ content: content12,
2999
+ children,
3000
+ side = "top",
3001
+ align = "center",
3002
+ delay = 300,
3003
+ open,
3004
+ defaultOpen,
3005
+ onOpenChange,
3006
+ disabled,
3007
+ className
3008
+ }) {
3009
+ const portal2 = usePortalProps();
3010
+ if (disabled || content12 == null || content12 === "") return children;
3011
+ return /* @__PURE__ */ jsx43(RadixTooltip.Provider, { delayDuration: delay, children: /* @__PURE__ */ jsxs33(RadixTooltip.Root, { open, defaultOpen, onOpenChange, children: [
3012
+ /* @__PURE__ */ jsx43(RadixTooltip.Trigger, { asChild: true, children }),
3013
+ /* @__PURE__ */ jsx43(RadixTooltip.Portal, { children: /* @__PURE__ */ jsxs33(
3014
+ RadixTooltip.Content,
3015
+ {
3016
+ side,
3017
+ align,
3018
+ sideOffset: 6,
3019
+ collisionPadding: 8,
3020
+ className: cx(portal2.className, content11, className),
3021
+ style: portal2.style,
3022
+ children: [
3023
+ content12,
3024
+ /* @__PURE__ */ jsx43(RadixTooltip.Arrow, { className: arrow2, width: 10, height: 5 })
3025
+ ]
3026
+ }
3027
+ ) })
3028
+ ] }) });
3029
+ }
3030
+
3031
+ // src/components/Typography/Typography.tsx
3032
+ import { forwardRef as forwardRef38 } from "react";
3033
+
3034
+ // src/components/Typography/Typography.css.ts
3035
+ import { createRuntimeFn as _7a46826 } from "@vanilla-extract/recipes/createRuntimeFn";
3036
+ var typography = /* @__PURE__ */ _7a46826({ defaultClassName: "kiolio0", variantClassNames: { variant: { display: "kiolio1", h1: "kiolio2", h2: "kiolio3", h3: "kiolio4", h4: "kiolio5", "body-lg": "kiolio6", body: "kiolio7", "body-sm": "kiolio8", caption: "kiolio9" }, color: { "default": "kiolioa", muted: "kioliob", subtle: "kiolioc", primary: "kioliod", danger: "kiolioe", success: "kioliof", warning: "kioliog", inherit: "kiolioh" }, weight: { regular: "kiolioi", medium: "kiolioj", semibold: "kioliok", bold: "kioliol" }, align: { start: "kioliom", center: "kiolion", end: "kiolioo" }, truncate: { true: "kioliop" } }, defaultVariants: { variant: "body", color: "default" }, compoundVariants: [] });
3037
+
3038
+ // src/components/Typography/Typography.tsx
3039
+ import { jsx as jsx44 } from "react/jsx-runtime";
3040
+ var defaultElement = {
3041
+ display: "h1",
3042
+ h1: "h1",
3043
+ h2: "h2",
3044
+ h3: "h3",
3045
+ h4: "h4",
3046
+ "body-lg": "p",
3047
+ body: "p",
3048
+ "body-sm": "p",
3049
+ caption: "span"
3050
+ };
3051
+ var Typography = /* @__PURE__ */ forwardRef38(function Typography2({ variant = "body", as, color, weight, align, truncate, className, ...rest }, ref) {
3052
+ const Component = as ?? defaultElement[variant];
3053
+ return /* @__PURE__ */ jsx44(
3054
+ Component,
3055
+ {
3056
+ ref,
3057
+ className: cx(typography({ variant, color, weight, align, truncate }), className),
3058
+ ...rest
3059
+ }
3060
+ );
3061
+ });
3062
+
3063
+ // src/components/VerificationCodeInput/VerificationCodeInput.tsx
3064
+ import { forwardRef as forwardRef39, useEffect as useEffect7, useId as useId15, useRef as useRef14, useState as useState13 } from "react";
3065
+
3066
+ // src/components/VerificationCodeInput/VerificationCodeInput.css.ts
3067
+ var input4 = "ea01812";
3068
+ var row4 = "ea01810";
3069
+ var slot = "ea01813";
3070
+ var slots = "ea01811";
3071
+ var timer = "ea01814";
3072
+
3073
+ // src/components/VerificationCodeInput/VerificationCodeInput.tsx
3074
+ import { jsx as jsx45, jsxs as jsxs34 } from "react/jsx-runtime";
3075
+ var formatTime = (seconds) => `${String(Math.floor(seconds / 60)).padStart(2, "0")}:${String(seconds % 60).padStart(2, "0")}`;
3076
+ var VerificationCodeInput = /* @__PURE__ */ forwardRef39(
3077
+ function VerificationCodeInput2(props, ref) {
3078
+ const {
3079
+ length = 6,
3080
+ value: value4,
3081
+ defaultValue,
3082
+ onValueChange,
3083
+ onComplete,
3084
+ type = "numeric",
3085
+ label: labelProp,
3086
+ helperText: helperText3,
3087
+ error,
3088
+ disabled,
3089
+ autoFocus,
3090
+ expiresIn,
3091
+ onExpire,
3092
+ onResend,
3093
+ resendText: resendTextProp,
3094
+ expiredText: expiredTextProp,
3095
+ name,
3096
+ id,
3097
+ className
3098
+ } = props;
3099
+ const m = useMessages();
3100
+ const label6 = labelProp ?? m.verificationCode ?? "\uC778\uC99D\uBC88\uD638";
3101
+ const resendText = resendTextProp ?? m.resend ?? "\uC7AC\uC804\uC1A1";
3102
+ const expiredText = expiredTextProp ?? m.verificationExpired ?? "\uC778\uC99D \uC2DC\uAC04\uC774 \uC9C0\uB0AC\uC5B4\uC694. \uC7AC\uC804\uC1A1\uD574 \uC8FC\uC138\uC694.";
3103
+ const generatedId = useId15();
3104
+ const inputId = id ?? generatedId;
3105
+ const helperId = `${inputId}-helper`;
3106
+ const statusId = `${inputId}-status`;
3107
+ const inputRef = useRef14(null);
3108
+ const isControlled = "value" in props;
3109
+ const [innerValue, setInnerValue] = useState13(defaultValue ?? "");
3110
+ const code = (isControlled ? value4 ?? "" : innerValue).slice(0, length);
3111
+ const [focused, setFocused] = useState13(false);
3112
+ const [endAt, setEndAt] = useState13(() => expiresIn ? Date.now() + expiresIn * 1e3 : null);
3113
+ const [remaining, setRemaining] = useState13(expiresIn ?? 0);
3114
+ const expired = expiresIn !== void 0 && remaining <= 0;
3115
+ const onExpireRef = useRef14(onExpire);
3116
+ useEffect7(() => {
3117
+ onExpireRef.current = onExpire;
3118
+ });
3119
+ useEffect7(() => {
3120
+ if (endAt === null) return;
3121
+ const tick = () => {
3122
+ const left = Math.max(0, Math.ceil((endAt - Date.now()) / 1e3));
3123
+ setRemaining(left);
3124
+ if (left === 0) {
3125
+ clearInterval(timer2);
3126
+ onExpireRef.current?.();
3127
+ }
3128
+ };
3129
+ const timer2 = setInterval(tick, 250);
3130
+ tick();
3131
+ return () => clearInterval(timer2);
3132
+ }, [endAt]);
3133
+ const setCode = (next) => {
3134
+ if (!isControlled) setInnerValue(next);
3135
+ onValueChange?.(next);
3136
+ if (next.length === length && code.length !== length) onComplete?.(next);
3137
+ };
3138
+ const handleChange = (event) => {
3139
+ const raw = event.target.value;
3140
+ const cleaned = (type === "numeric" ? raw.replace(/\D/g, "") : raw.replace(/[^0-9a-z]/gi, "").toUpperCase()).slice(0, length);
3141
+ setCode(cleaned);
3142
+ };
3143
+ const resend = () => {
3144
+ onResend?.();
3145
+ setCode("");
3146
+ if (expiresIn) {
3147
+ setEndAt(Date.now() + expiresIn * 1e3);
3148
+ setRemaining(expiresIn);
3149
+ }
3150
+ inputRef.current?.focus();
3151
+ };
3152
+ const description6 = helperText3 ?? m.verificationCodeHint?.(length, type) ?? `${length}\uC790\uB9AC ${type === "numeric" ? "\uC22B\uC790" : "\uBB38\uC790"}\uB97C \uC785\uB825\uD558\uC138\uC694.`;
3153
+ const activeIndex = Math.min(code.length, length - 1);
3154
+ return /* @__PURE__ */ jsxs34(
3155
+ "div",
3156
+ {
3157
+ className: cx(field, className),
3158
+ "data-invalid": error || void 0,
3159
+ "data-disabled": disabled || void 0,
3160
+ children: [
3161
+ /* @__PURE__ */ jsx45("label", { htmlFor: inputId, className: label, children: label6 }),
3162
+ /* @__PURE__ */ jsxs34("div", { className: row4, children: [
3163
+ /* @__PURE__ */ jsxs34("div", { className: slots, children: [
3164
+ /* @__PURE__ */ jsx45(
3165
+ "input",
3166
+ {
3167
+ ref: mergeRefs(ref, inputRef),
3168
+ id: inputId,
3169
+ type: "text",
3170
+ inputMode: type === "numeric" ? "numeric" : "text",
3171
+ autoComplete: "one-time-code",
3172
+ pattern: type === "numeric" ? "[0-9]*" : void 0,
3173
+ value: code,
3174
+ onChange: handleChange,
3175
+ onFocus: () => setFocused(true),
3176
+ onBlur: () => setFocused(false),
3177
+ disabled,
3178
+ autoFocus,
3179
+ "aria-invalid": error || void 0,
3180
+ "aria-describedby": `${helperId} ${statusId}`,
3181
+ className: input4
3182
+ }
3183
+ ),
3184
+ Array.from({ length }, (_, index) => /* @__PURE__ */ jsx45(
3185
+ "div",
3186
+ {
3187
+ className: slot,
3188
+ "data-active": focused && index === activeIndex ? "" : void 0,
3189
+ "aria-hidden": true,
3190
+ children: code[index] ?? ""
3191
+ },
3192
+ index
3193
+ ))
3194
+ ] }),
3195
+ expiresIn !== void 0 && /* @__PURE__ */ jsx45("span", { role: "timer", className: timer, children: formatTime(remaining) }),
3196
+ onResend && /* @__PURE__ */ jsx45(Button, { size: "sm", variant: "outline", color: "neutral", onClick: resend, disabled, children: resendText })
3197
+ ] }),
3198
+ /* @__PURE__ */ jsx45("p", { id: helperId, className: helperText({ error }), children: description6 }),
3199
+ /* @__PURE__ */ jsx45("p", { id: statusId, role: "status", className: helperText({ error: true }), children: expired ? expiredText : "" }),
3200
+ name && /* @__PURE__ */ jsx45("input", { type: "hidden", name, value: code })
3201
+ ]
3202
+ }
3203
+ );
3204
+ }
3205
+ );
3206
+ export {
3207
+ Accordion,
3208
+ AccordionItem,
3209
+ AddressInput,
3210
+ AgreementGroup,
3211
+ Alert,
3212
+ AmountInput,
3213
+ Avatar,
3214
+ Badge,
3215
+ Breadcrumb,
3216
+ BusinessNumberInput,
3217
+ Button,
3218
+ Calendar,
3219
+ Card,
3220
+ CardBody,
3221
+ CardFooter,
3222
+ CardHeader,
3223
+ Checkbox,
3224
+ Combobox,
3225
+ DatePicker,
3226
+ Divider,
3227
+ Drawer,
3228
+ DrawerClose,
3229
+ DropdownMenu,
3230
+ DropdownMenuContent,
3231
+ DropdownMenuGroup,
3232
+ DropdownMenuItem,
3233
+ DropdownMenuLabel,
3234
+ DropdownMenuSeparator,
3235
+ DropdownMenuTrigger,
3236
+ IconButton,
3237
+ Input,
3238
+ Link,
3239
+ LocaleProvider,
3240
+ Modal,
3241
+ ModalClose,
3242
+ Pagination,
3243
+ PhoneNumberInput,
3244
+ Popover2 as Popover,
3245
+ PopoverClose,
3246
+ Progress,
3247
+ RadioGroup,
3248
+ SegmentedControl,
3249
+ Select,
3250
+ Skeleton,
3251
+ SkipLink,
3252
+ Slider,
3253
+ Spinner,
3254
+ Stack,
3255
+ Switch,
3256
+ Table,
3257
+ TableBody,
3258
+ TableCell,
3259
+ TableFooter,
3260
+ TableHead,
3261
+ TableHeader,
3262
+ TableRow,
3263
+ Tabs,
3264
+ TabsContent,
3265
+ TabsList,
3266
+ TabsTrigger,
3267
+ TextField,
3268
+ Textarea,
3269
+ ThemeProvider,
3270
+ ToastProvider,
3271
+ Tooltip,
3272
+ Typography,
3273
+ VerificationCodeInput,
3274
+ useMessages,
3275
+ usePortalProps,
3276
+ useTheme,
3277
+ useToast
3278
+ };
3279
+ //# sourceMappingURL=client.js.map