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