@bestow-ui/react 0.0.0-stage → 0.2.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 ADDED
@@ -0,0 +1,519 @@
1
+ "use client";
2
+
3
+ // src/theme/contract.css.ts
4
+ var themeClass = { light: "tkagtb29", dark: "tkagtb2a" };
5
+ var vars = { space: { "0": "var(--tkagtb0)", "1": "var(--tkagtb1)", "2": "var(--tkagtb2)", "3": "var(--tkagtb3)", "4": "var(--tkagtb4)", "5": "var(--tkagtb5)", "6": "var(--tkagtb6)", "8": "var(--tkagtb7)", "10": "var(--tkagtb8)", "12": "var(--tkagtb9)", "16": "var(--tkagtba)" }, radius: { none: "var(--tkagtbb)", sm: "var(--tkagtbc)", md: "var(--tkagtbd)", lg: "var(--tkagtbe)", xl: "var(--tkagtbf)", full: "var(--tkagtbg)" }, font: { family: { sans: "var(--tkagtbh)", mono: "var(--tkagtbi)" }, size: { xs: "var(--tkagtbj)", sm: "var(--tkagtbk)", md: "var(--tkagtbl)", lg: "var(--tkagtbm)", xl: "var(--tkagtbn)", "2xl": "var(--tkagtbo)", "3xl": "var(--tkagtbp)", "4xl": "var(--tkagtbq)" }, weight: { regular: "var(--tkagtbr)", medium: "var(--tkagtbs)", semibold: "var(--tkagtbt)", bold: "var(--tkagtbu)" }, lineHeight: { tight: "var(--tkagtbv)", normal: "var(--tkagtbw)", relaxed: "var(--tkagtbx)" } }, shadow: { sm: "var(--tkagtby)", md: "var(--tkagtbz)", lg: "var(--tkagtb10)" }, duration: { fast: "var(--tkagtb11)", normal: "var(--tkagtb12)", slow: "var(--tkagtb13)" }, zIndex: { dropdown: "var(--tkagtb14)", overlay: "var(--tkagtb15)", modal: "var(--tkagtb16)", toast: "var(--tkagtb17)", tooltip: "var(--tkagtb18)" }, color: { bg: { "default": "var(--tkagtb19)", subtle: "var(--tkagtb1a)", muted: "var(--tkagtb1b)", inverse: "var(--tkagtb1c)", overlay: "var(--tkagtb1d)" }, fg: { "default": "var(--tkagtb1e)", muted: "var(--tkagtb1f)", subtle: "var(--tkagtb1g)", inverse: "var(--tkagtb1h)" }, border: { "default": "var(--tkagtb1i)", strong: "var(--tkagtb1j)", focus: "var(--tkagtb1k)" }, primary: { solid: "var(--tkagtb1l)", solidHover: "var(--tkagtb1m)", contrast: "var(--tkagtb1n)", subtle: "var(--tkagtb1o)", subtleHover: "var(--tkagtb1p)", text: "var(--tkagtb1q)" }, neutral: { solid: "var(--tkagtb1r)", solidHover: "var(--tkagtb1s)", contrast: "var(--tkagtb1t)", subtle: "var(--tkagtb1u)", subtleHover: "var(--tkagtb1v)", text: "var(--tkagtb1w)" }, danger: { solid: "var(--tkagtb1x)", solidHover: "var(--tkagtb1y)", contrast: "var(--tkagtb1z)", subtle: "var(--tkagtb20)", subtleHover: "var(--tkagtb21)", text: "var(--tkagtb22)" }, success: { solid: "var(--tkagtb23)", solidHover: "var(--tkagtb24)", contrast: "var(--tkagtb25)", subtle: "var(--tkagtb26)", subtleHover: "var(--tkagtb27)", text: "var(--tkagtb28)" } } };
6
+
7
+ // src/theme/ThemeProvider.tsx
8
+ import { createContext, forwardRef, useContext } from "react";
9
+
10
+ // src/utils/cx.ts
11
+ function cx(...classNames) {
12
+ return classNames.filter(Boolean).join(" ");
13
+ }
14
+
15
+ // src/theme/ThemeProvider.css.ts
16
+ var portal = "sfyhlv0";
17
+ var root = "sfyhlv1 sfyhlv0";
18
+
19
+ // src/theme/ThemeProvider.tsx
20
+ import { jsx } from "react/jsx-runtime";
21
+ var ThemeContext = createContext("light");
22
+ var ThemeProvider = forwardRef(function ThemeProvider2({ theme = "light", className, children, ...rest }, ref) {
23
+ return /* @__PURE__ */ jsx(ThemeContext.Provider, { value: theme, children: /* @__PURE__ */ jsx("div", { ref, "data-theme": theme, className: cx(themeClass[theme], root, className), ...rest, children }) });
24
+ });
25
+ function useTheme() {
26
+ return useContext(ThemeContext);
27
+ }
28
+ function usePortalClassName() {
29
+ return cx(themeClass[useTheme()], portal);
30
+ }
31
+
32
+ // src/components/Button/Button.tsx
33
+ import { forwardRef as forwardRef2 } from "react";
34
+
35
+ // src/components/Button/Button.css.ts
36
+ import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntimeFn";
37
+ var button = _7a468({ 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: [] });
38
+ var icon = "xcekdai";
39
+
40
+ // src/components/Button/Button.tsx
41
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
42
+ var Button = forwardRef2(function Button2({ variant, color, size, fullWidth, startIcon, endIcon, className, type = "button", children, ...rest }, ref) {
43
+ return /* @__PURE__ */ jsxs(
44
+ "button",
45
+ {
46
+ ref,
47
+ type,
48
+ className: cx(button({ variant, color, size, fullWidth }), className),
49
+ ...rest,
50
+ children: [
51
+ startIcon && /* @__PURE__ */ jsx2("span", { className: icon, children: startIcon }),
52
+ children,
53
+ endIcon && /* @__PURE__ */ jsx2("span", { className: icon, children: endIcon })
54
+ ]
55
+ }
56
+ );
57
+ });
58
+
59
+ // src/components/Checkbox/Checkbox.tsx
60
+ import { forwardRef as forwardRef3, useEffect, useRef } from "react";
61
+
62
+ // src/utils/mergeRefs.ts
63
+ function mergeRefs(...refs) {
64
+ return (value2) => {
65
+ for (const ref of refs) {
66
+ if (typeof ref === "function") ref(value2);
67
+ else if (ref) ref.current = value2;
68
+ }
69
+ };
70
+ }
71
+
72
+ // src/components/Checkbox/Checkbox.css.ts
73
+ import { createRuntimeFn as _7a4682 } from "@vanilla-extract/recipes/createRuntimeFn";
74
+ var checkIcon = "_1y7mzsn8 _1y7mzsn7";
75
+ var control = _7a4682({ defaultClassName: "_1y7mzsn3", variantClassNames: { size: { sm: "_1y7mzsn4", md: "_1y7mzsn5" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
76
+ var indeterminateIcon = "_1y7mzsn9 _1y7mzsn7";
77
+ var input = "_1y7mzsn6";
78
+ var root2 = _7a4682({ defaultClassName: "_1y7mzsn0", variantClassNames: { size: { sm: "_1y7mzsn1", md: "_1y7mzsn2" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
79
+
80
+ // src/components/Checkbox/Checkbox.tsx
81
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
82
+ var Checkbox = forwardRef3(function Checkbox2({ label: label2, size, indeterminate = false, invalid, disabled, className, ...rest }, ref) {
83
+ const innerRef = useRef(null);
84
+ useEffect(() => {
85
+ if (innerRef.current) innerRef.current.indeterminate = indeterminate;
86
+ }, [indeterminate]);
87
+ return /* @__PURE__ */ jsxs2("label", { className: cx(root2({ size }), className), "data-disabled": disabled || void 0, children: [
88
+ /* @__PURE__ */ jsxs2("span", { className: control({ size }), children: [
89
+ /* @__PURE__ */ jsx3(
90
+ "input",
91
+ {
92
+ ref: mergeRefs(innerRef, ref),
93
+ type: "checkbox",
94
+ className: input,
95
+ disabled,
96
+ "aria-invalid": invalid || void 0,
97
+ ...rest
98
+ }
99
+ ),
100
+ /* @__PURE__ */ jsx3("svg", { className: checkIcon, viewBox: "0 0 20 20", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx3("path", { d: "M5 10.5l3.2 3L15 7", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }),
101
+ /* @__PURE__ */ jsx3("svg", { className: indeterminateIcon, viewBox: "0 0 20 20", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx3("path", { d: "M6 10h8", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) })
102
+ ] }),
103
+ label2
104
+ ] });
105
+ });
106
+
107
+ // src/components/Input/Input.tsx
108
+ import { forwardRef as forwardRef4 } from "react";
109
+
110
+ // src/components/Input/Input.css.ts
111
+ import { createRuntimeFn as _7a4683 } from "@vanilla-extract/recipes/createRuntimeFn";
112
+ var adornment = "_19p5zvh6";
113
+ var field = "_19p5zvh7";
114
+ var fieldFullWidth = "_19p5zvh8";
115
+ var helperText = _7a4683({ defaultClassName: "_19p5zvhb", variantClassNames: { error: { true: "_19p5zvhc" } }, defaultVariants: {}, compoundVariants: [] });
116
+ var input2 = "_19p5zvh5";
117
+ var label = "_19p5zvh9";
118
+ var requiredMark = "_19p5zvha";
119
+ var root3 = _7a4683({ defaultClassName: "_19p5zvh0", variantClassNames: { size: { sm: "_19p5zvh1", md: "_19p5zvh2", lg: "_19p5zvh3" }, fullWidth: { true: "_19p5zvh4" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
120
+
121
+ // src/components/Input/Input.tsx
122
+ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
123
+ var Input = forwardRef4(function Input2({ size, invalid, fullWidth, startAdornment, endAdornment, rootClassName, className, disabled, ...rest }, ref) {
124
+ return /* @__PURE__ */ jsxs3(
125
+ "div",
126
+ {
127
+ className: cx(root3({ size, fullWidth }), rootClassName),
128
+ "data-invalid": invalid || void 0,
129
+ "data-disabled": disabled || void 0,
130
+ children: [
131
+ startAdornment && /* @__PURE__ */ jsx4("span", { className: adornment, children: startAdornment }),
132
+ /* @__PURE__ */ jsx4(
133
+ "input",
134
+ {
135
+ ref,
136
+ className: cx(input2, className),
137
+ disabled,
138
+ "aria-invalid": invalid || void 0,
139
+ ...rest
140
+ }
141
+ ),
142
+ endAdornment && /* @__PURE__ */ jsx4("span", { className: adornment, children: endAdornment })
143
+ ]
144
+ }
145
+ );
146
+ });
147
+
148
+ // src/components/Input/TextField.tsx
149
+ import { forwardRef as forwardRef5, useId } from "react";
150
+ import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
151
+ var TextField = forwardRef5(function TextField2({ label: label2, helperText: helperText2, error, required, fullWidth, id, "aria-describedby": ariaDescribedBy, ...rest }, ref) {
152
+ const generatedId = useId();
153
+ const inputId = id ?? generatedId;
154
+ const helperId = helperText2 ? `${inputId}-helper` : void 0;
155
+ return /* @__PURE__ */ jsxs4("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
156
+ label2 && /* @__PURE__ */ jsxs4("label", { htmlFor: inputId, className: label, children: [
157
+ label2,
158
+ required && /* @__PURE__ */ jsx5("span", { className: requiredMark, "aria-hidden": true, children: "*" })
159
+ ] }),
160
+ /* @__PURE__ */ jsx5(
161
+ Input,
162
+ {
163
+ ref,
164
+ id: inputId,
165
+ invalid: error,
166
+ required,
167
+ fullWidth,
168
+ "aria-describedby": cx(helperId, ariaDescribedBy) || void 0,
169
+ ...rest
170
+ }
171
+ ),
172
+ helperText2 && /* @__PURE__ */ jsx5("p", { id: helperId, className: helperText({ error }), children: helperText2 })
173
+ ] });
174
+ });
175
+
176
+ // src/components/Modal/Modal.tsx
177
+ import * as Dialog from "@radix-ui/react-dialog";
178
+
179
+ // src/icons/index.tsx
180
+ import { jsx as jsx6 } from "react/jsx-runtime";
181
+ var base = { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", "aria-hidden": true };
182
+ function CloseIcon(props) {
183
+ return /* @__PURE__ */ jsx6("svg", { ...base, ...props, children: /* @__PURE__ */ jsx6("path", { d: "M4 4l8 8M12 4l-8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) });
184
+ }
185
+ function ChevronDownIcon(props) {
186
+ return /* @__PURE__ */ jsx6("svg", { ...base, ...props, children: /* @__PURE__ */ jsx6("path", { d: "M4 6l4 4 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
187
+ }
188
+ function CheckIcon(props) {
189
+ return /* @__PURE__ */ jsx6("svg", { ...base, ...props, children: /* @__PURE__ */ jsx6("path", { d: "M3.5 8.5l3 3 6-7", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
190
+ }
191
+
192
+ // src/components/Modal/Modal.css.ts
193
+ import { createRuntimeFn as _7a4684 } from "@vanilla-extract/recipes/createRuntimeFn";
194
+ var body = "_1pdsmv0a";
195
+ var closeButton = "_1pdsmv09";
196
+ var content = _7a4684({ defaultClassName: "_1pdsmv01", variantClassNames: { size: { sm: "_1pdsmv02", md: "_1pdsmv03", lg: "_1pdsmv04" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
197
+ var description = "_1pdsmv08";
198
+ var footer = "_1pdsmv0b";
199
+ var header = "_1pdsmv05";
200
+ var headings = "_1pdsmv06";
201
+ var overlay = "_1pdsmv00";
202
+ var title = "_1pdsmv07";
203
+
204
+ // src/components/Modal/Modal.tsx
205
+ import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
206
+ function Modal({
207
+ open,
208
+ defaultOpen,
209
+ onOpenChange,
210
+ trigger: trigger2,
211
+ title: title3,
212
+ description: description3,
213
+ children,
214
+ footer: footer2,
215
+ size,
216
+ hideCloseButton = false,
217
+ closeOnOverlayClick = true,
218
+ className
219
+ }) {
220
+ const portalClassName = usePortalClassName();
221
+ return /* @__PURE__ */ jsxs5(Dialog.Root, { open, defaultOpen, onOpenChange, children: [
222
+ trigger2 && /* @__PURE__ */ jsx7(Dialog.Trigger, { asChild: true, children: trigger2 }),
223
+ /* @__PURE__ */ jsxs5(Dialog.Portal, { children: [
224
+ /* @__PURE__ */ jsx7(Dialog.Overlay, { className: cx(portalClassName, overlay) }),
225
+ /* @__PURE__ */ jsxs5(
226
+ Dialog.Content,
227
+ {
228
+ className: cx(portalClassName, content({ size }), className),
229
+ onPointerDownOutside: closeOnOverlayClick ? void 0 : (event) => event.preventDefault(),
230
+ ...description3 ? {} : { "aria-describedby": void 0 },
231
+ children: [
232
+ /* @__PURE__ */ jsxs5("div", { className: header, children: [
233
+ /* @__PURE__ */ jsxs5("div", { className: headings, children: [
234
+ /* @__PURE__ */ jsx7(Dialog.Title, { className: title, children: title3 }),
235
+ description3 && /* @__PURE__ */ jsx7(Dialog.Description, { className: description, children: description3 })
236
+ ] }),
237
+ !hideCloseButton && /* @__PURE__ */ jsx7(Dialog.Close, { className: closeButton, "aria-label": "\uB2EB\uAE30", children: /* @__PURE__ */ jsx7(CloseIcon, {}) })
238
+ ] }),
239
+ children && /* @__PURE__ */ jsx7("div", { className: body, children }),
240
+ footer2 && /* @__PURE__ */ jsx7("div", { className: footer, children: footer2 })
241
+ ]
242
+ }
243
+ )
244
+ ] })
245
+ ] });
246
+ }
247
+ var ModalClose = Dialog.Close;
248
+
249
+ // src/components/Select/Select.tsx
250
+ import * as RadixSelect from "@radix-ui/react-select";
251
+ import { forwardRef as forwardRef6, useId as useId2 } from "react";
252
+
253
+ // src/components/Select/Select.css.ts
254
+ var content2 = "_1kx81e83";
255
+ var icon2 = "_1kx81e82";
256
+ var item = "_1kx81e85";
257
+ var itemIndicator = "_1kx81e86";
258
+ var trigger = "_1kx81e80";
259
+ var value = "_1kx81e81";
260
+ var viewport = "_1kx81e84";
261
+
262
+ // src/components/Select/Select.tsx
263
+ import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
264
+ var Select = forwardRef6(function Select2({
265
+ options,
266
+ value: value2,
267
+ defaultValue,
268
+ onValueChange,
269
+ placeholder,
270
+ label: label2,
271
+ helperText: helperText2,
272
+ error,
273
+ size,
274
+ fullWidth,
275
+ disabled,
276
+ required,
277
+ name,
278
+ id,
279
+ "aria-label": ariaLabel,
280
+ className
281
+ }, ref) {
282
+ const generatedId = useId2();
283
+ const triggerId = id ?? generatedId;
284
+ const helperId = helperText2 ? `${triggerId}-helper` : void 0;
285
+ const portalClassName = usePortalClassName();
286
+ return /* @__PURE__ */ jsxs6("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
287
+ label2 && /* @__PURE__ */ jsxs6("label", { htmlFor: triggerId, className: label, children: [
288
+ label2,
289
+ required && /* @__PURE__ */ jsx8("span", { className: requiredMark, "aria-hidden": true, children: "*" })
290
+ ] }),
291
+ /* @__PURE__ */ jsxs6(
292
+ RadixSelect.Root,
293
+ {
294
+ value: value2,
295
+ defaultValue,
296
+ onValueChange,
297
+ disabled,
298
+ required,
299
+ name,
300
+ children: [
301
+ /* @__PURE__ */ jsxs6(
302
+ RadixSelect.Trigger,
303
+ {
304
+ ref,
305
+ id: triggerId,
306
+ "aria-label": ariaLabel,
307
+ "aria-invalid": error || void 0,
308
+ "aria-describedby": helperId,
309
+ "data-invalid": error || void 0,
310
+ className: cx(root3({ size, fullWidth }), trigger, className),
311
+ children: [
312
+ /* @__PURE__ */ jsx8("span", { className: value, children: /* @__PURE__ */ jsx8(RadixSelect.Value, { placeholder }) }),
313
+ /* @__PURE__ */ jsx8(RadixSelect.Icon, { className: icon2, children: /* @__PURE__ */ jsx8(ChevronDownIcon, {}) })
314
+ ]
315
+ }
316
+ ),
317
+ /* @__PURE__ */ jsx8(RadixSelect.Portal, { children: /* @__PURE__ */ jsx8(
318
+ RadixSelect.Content,
319
+ {
320
+ position: "popper",
321
+ sideOffset: 4,
322
+ collisionPadding: 8,
323
+ className: cx(portalClassName, content2),
324
+ children: /* @__PURE__ */ jsx8(RadixSelect.Viewport, { className: viewport, children: options.map((option) => /* @__PURE__ */ jsxs6(
325
+ RadixSelect.Item,
326
+ {
327
+ value: option.value,
328
+ disabled: option.disabled,
329
+ className: item,
330
+ children: [
331
+ /* @__PURE__ */ jsx8(RadixSelect.ItemText, { children: option.label }),
332
+ /* @__PURE__ */ jsx8(RadixSelect.ItemIndicator, { className: itemIndicator, children: /* @__PURE__ */ jsx8(CheckIcon, {}) })
333
+ ]
334
+ },
335
+ option.value
336
+ )) })
337
+ }
338
+ ) })
339
+ ]
340
+ }
341
+ ),
342
+ helperText2 && /* @__PURE__ */ jsx8("p", { id: helperId, className: helperText({ error }), children: helperText2 })
343
+ ] });
344
+ });
345
+
346
+ // src/components/Stack/Stack.tsx
347
+ import { forwardRef as forwardRef7 } from "react";
348
+
349
+ // src/components/Stack/Stack.css.ts
350
+ import { createRuntimeFn as _7a4685 } from "@vanilla-extract/recipes/createRuntimeFn";
351
+ var stack = _7a4685({ 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: [] });
352
+
353
+ // src/components/Stack/Stack.tsx
354
+ import { jsx as jsx9 } from "react/jsx-runtime";
355
+ var Stack = forwardRef7(function Stack2({ as: Component = "div", direction, gap, align, justify, wrap, className, ...rest }, ref) {
356
+ return /* @__PURE__ */ jsx9(
357
+ Component,
358
+ {
359
+ ref,
360
+ className: cx(stack({ direction, gap, align, justify, wrap }), className),
361
+ ...rest
362
+ }
363
+ );
364
+ });
365
+
366
+ // src/components/Toast/Toast.tsx
367
+ import * as RadixToast from "@radix-ui/react-toast";
368
+ import { createContext as createContext2, useCallback, useContext as useContext2, useMemo, useRef as useRef2, useState } from "react";
369
+
370
+ // src/components/Toast/Toast.css.ts
371
+ import { createRuntimeFn as _7a4686 } from "@vanilla-extract/recipes/createRuntimeFn";
372
+ var action = "_1g11zvx7";
373
+ var close = "_1g11zvx8";
374
+ var description2 = "_1g11zvx6";
375
+ var title2 = "_1g11zvx5";
376
+ var toast = _7a4686({ defaultClassName: "_1g11zvx1", variantClassNames: { variant: { "default": "_1g11zvx2", success: "_1g11zvx3", danger: "_1g11zvx4" } }, defaultVariants: { variant: "default" }, compoundVariants: [] });
377
+ var viewport2 = "_1g11zvx0";
378
+
379
+ // src/components/Toast/Toast.tsx
380
+ import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
381
+ var REMOVE_DELAY = 500;
382
+ var ToastContext = createContext2(null);
383
+ function ToastProvider({ children, duration = 5e3, label: label2 = "\uC54C\uB9BC" }) {
384
+ const [toasts, setToasts] = useState([]);
385
+ const nextId = useRef2(0);
386
+ const portalClassName = usePortalClassName();
387
+ const toast2 = useCallback((options) => {
388
+ const id = nextId.current++;
389
+ setToasts((prev) => [...prev, { ...options, id, open: true }]);
390
+ return id;
391
+ }, []);
392
+ const dismiss = useCallback((id) => {
393
+ const isTarget = (t) => id === void 0 || t.id === id;
394
+ setToasts((prev) => prev.map((t) => isTarget(t) ? { ...t, open: false } : t));
395
+ setTimeout(() => setToasts((prev) => prev.filter((t) => t.open || !isTarget(t))), REMOVE_DELAY);
396
+ }, []);
397
+ const value2 = useMemo(() => ({ toast: toast2, dismiss }), [toast2, dismiss]);
398
+ return /* @__PURE__ */ jsx10(ToastContext.Provider, { value: value2, children: /* @__PURE__ */ jsxs7(RadixToast.Provider, { duration, label: label2, swipeDirection: "right", children: [
399
+ children,
400
+ toasts.map(({ id, open, title: title3, description: description3, variant, duration: itemDuration, action: action2 }) => /* @__PURE__ */ jsxs7(
401
+ RadixToast.Root,
402
+ {
403
+ open,
404
+ duration: itemDuration,
405
+ onOpenChange: (nextOpen) => {
406
+ if (!nextOpen) dismiss(id);
407
+ },
408
+ className: toast({ variant }),
409
+ children: [
410
+ /* @__PURE__ */ jsx10(RadixToast.Title, { className: title2, children: title3 }),
411
+ description3 && /* @__PURE__ */ jsx10(RadixToast.Description, { className: description2, children: description3 }),
412
+ action2 && /* @__PURE__ */ jsx10(RadixToast.Action, { asChild: true, altText: action2.altText ?? action2.label, className: action, children: /* @__PURE__ */ jsx10(Button, { size: "sm", variant: "soft", color: "neutral", onClick: action2.onClick, children: action2.label }) }),
413
+ /* @__PURE__ */ jsx10(RadixToast.Close, { className: close, "aria-label": "\uB2EB\uAE30", children: /* @__PURE__ */ jsx10(CloseIcon, {}) })
414
+ ]
415
+ },
416
+ id
417
+ )),
418
+ /* @__PURE__ */ jsx10(RadixToast.Viewport, { className: cx(portalClassName, viewport2) })
419
+ ] }) });
420
+ }
421
+ function useToast() {
422
+ const context = useContext2(ToastContext);
423
+ if (!context) throw new Error("useToast \uB294 ToastProvider \uC548\uC5D0\uC11C \uC0AC\uC6A9\uD574\uC57C \uD569\uB2C8\uB2E4.");
424
+ return context;
425
+ }
426
+
427
+ // src/components/Tooltip/Tooltip.tsx
428
+ import * as RadixTooltip from "@radix-ui/react-tooltip";
429
+
430
+ // src/components/Tooltip/Tooltip.css.ts
431
+ var arrow = "z7rufs1";
432
+ var content3 = "z7rufs0";
433
+
434
+ // src/components/Tooltip/Tooltip.tsx
435
+ import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
436
+ function Tooltip({
437
+ content: content4,
438
+ children,
439
+ side = "top",
440
+ align = "center",
441
+ delay = 300,
442
+ open,
443
+ defaultOpen,
444
+ onOpenChange,
445
+ disabled,
446
+ className
447
+ }) {
448
+ const portalClassName = usePortalClassName();
449
+ if (disabled || content4 == null || content4 === "") return children;
450
+ return /* @__PURE__ */ jsx11(RadixTooltip.Provider, { delayDuration: delay, children: /* @__PURE__ */ jsxs8(RadixTooltip.Root, { open, defaultOpen, onOpenChange, children: [
451
+ /* @__PURE__ */ jsx11(RadixTooltip.Trigger, { asChild: true, children }),
452
+ /* @__PURE__ */ jsx11(RadixTooltip.Portal, { children: /* @__PURE__ */ jsxs8(
453
+ RadixTooltip.Content,
454
+ {
455
+ side,
456
+ align,
457
+ sideOffset: 6,
458
+ collisionPadding: 8,
459
+ className: cx(portalClassName, content3, className),
460
+ children: [
461
+ content4,
462
+ /* @__PURE__ */ jsx11(RadixTooltip.Arrow, { className: arrow, width: 10, height: 5 })
463
+ ]
464
+ }
465
+ ) })
466
+ ] }) });
467
+ }
468
+
469
+ // src/components/Typography/Typography.tsx
470
+ import { forwardRef as forwardRef8 } from "react";
471
+
472
+ // src/components/Typography/Typography.css.ts
473
+ import { createRuntimeFn as _7a4687 } from "@vanilla-extract/recipes/createRuntimeFn";
474
+ var typography = _7a4687({ 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", inherit: "kioliog" }, weight: { regular: "kiolioh", medium: "kiolioi", semibold: "kiolioj", bold: "kioliok" }, align: { start: "kioliol", center: "kioliom", end: "kiolion" }, truncate: { true: "kiolioo" } }, defaultVariants: { variant: "body", color: "default" }, compoundVariants: [] });
475
+
476
+ // src/components/Typography/Typography.tsx
477
+ import { jsx as jsx12 } from "react/jsx-runtime";
478
+ var defaultElement = {
479
+ display: "h1",
480
+ h1: "h1",
481
+ h2: "h2",
482
+ h3: "h3",
483
+ h4: "h4",
484
+ "body-lg": "p",
485
+ body: "p",
486
+ "body-sm": "p",
487
+ caption: "span"
488
+ };
489
+ var Typography = forwardRef8(function Typography2({ variant = "body", as, color, weight, align, truncate, className, ...rest }, ref) {
490
+ const Component = as ?? defaultElement[variant];
491
+ return /* @__PURE__ */ jsx12(
492
+ Component,
493
+ {
494
+ ref,
495
+ className: cx(typography({ variant, color, weight, align, truncate }), className),
496
+ ...rest
497
+ }
498
+ );
499
+ });
500
+ export {
501
+ Button,
502
+ Checkbox,
503
+ Input,
504
+ Modal,
505
+ ModalClose,
506
+ Select,
507
+ Stack,
508
+ TextField,
509
+ ThemeProvider,
510
+ ToastProvider,
511
+ Tooltip,
512
+ Typography,
513
+ themeClass,
514
+ usePortalClassName,
515
+ useTheme,
516
+ useToast,
517
+ vars
518
+ };
519
+ //# sourceMappingURL=index.js.map