@bestow-ui/react 0.1.0 → 0.2.1
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.cjs +309 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +555 -150
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +145 -2
- package/dist/index.d.ts +145 -2
- package/dist/index.js +292 -18
- package/dist/index.js.map +1 -1
- package/package.json +8 -3
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
// src/theme/contract.css.ts
|
|
4
|
-
var themeClass = { light: "
|
|
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)" }, color: { bg: { "default": "var(--
|
|
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
6
|
|
|
7
7
|
// src/theme/ThemeProvider.tsx
|
|
8
8
|
import { createContext, forwardRef, useContext } from "react";
|
|
@@ -13,7 +13,8 @@ function cx(...classNames) {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
// src/theme/ThemeProvider.css.ts
|
|
16
|
-
var
|
|
16
|
+
var portal = "sfyhlv0";
|
|
17
|
+
var root = "sfyhlv1 sfyhlv0";
|
|
17
18
|
|
|
18
19
|
// src/theme/ThemeProvider.tsx
|
|
19
20
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -24,6 +25,9 @@ var ThemeProvider = forwardRef(function ThemeProvider2({ theme = "light", classN
|
|
|
24
25
|
function useTheme() {
|
|
25
26
|
return useContext(ThemeContext);
|
|
26
27
|
}
|
|
28
|
+
function usePortalClassName() {
|
|
29
|
+
return cx(themeClass[useTheme()], portal);
|
|
30
|
+
}
|
|
27
31
|
|
|
28
32
|
// src/components/Button/Button.tsx
|
|
29
33
|
import { forwardRef as forwardRef2 } from "react";
|
|
@@ -57,10 +61,10 @@ import { forwardRef as forwardRef3, useEffect, useRef } from "react";
|
|
|
57
61
|
|
|
58
62
|
// src/utils/mergeRefs.ts
|
|
59
63
|
function mergeRefs(...refs) {
|
|
60
|
-
return (
|
|
64
|
+
return (value2) => {
|
|
61
65
|
for (const ref of refs) {
|
|
62
|
-
if (typeof ref === "function") ref(
|
|
63
|
-
else if (ref) ref.current =
|
|
66
|
+
if (typeof ref === "function") ref(value2);
|
|
67
|
+
else if (ref) ref.current = value2;
|
|
64
68
|
}
|
|
65
69
|
};
|
|
66
70
|
}
|
|
@@ -169,17 +173,176 @@ var TextField = forwardRef5(function TextField2({ label: label2, helperText: hel
|
|
|
169
173
|
] });
|
|
170
174
|
});
|
|
171
175
|
|
|
176
|
+
// src/components/Modal/Modal.tsx
|
|
177
|
+
import * as Dialog from "@radix-ui/react-dialog";
|
|
178
|
+
import { XIcon } from "@bestow-ui/icons";
|
|
179
|
+
|
|
180
|
+
// src/components/Modal/Modal.css.ts
|
|
181
|
+
import { createRuntimeFn as _7a4684 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
182
|
+
var body = "_1pdsmv0a";
|
|
183
|
+
var closeButton = "_1pdsmv09";
|
|
184
|
+
var content = _7a4684({ defaultClassName: "_1pdsmv01", variantClassNames: { size: { sm: "_1pdsmv02", md: "_1pdsmv03", lg: "_1pdsmv04" } }, defaultVariants: { size: "md" }, compoundVariants: [] });
|
|
185
|
+
var description = "_1pdsmv08";
|
|
186
|
+
var footer = "_1pdsmv0b";
|
|
187
|
+
var header = "_1pdsmv05";
|
|
188
|
+
var headings = "_1pdsmv06";
|
|
189
|
+
var overlay = "_1pdsmv00";
|
|
190
|
+
var title = "_1pdsmv07";
|
|
191
|
+
|
|
192
|
+
// src/components/Modal/Modal.tsx
|
|
193
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
194
|
+
function Modal({
|
|
195
|
+
open,
|
|
196
|
+
defaultOpen,
|
|
197
|
+
onOpenChange,
|
|
198
|
+
trigger: trigger2,
|
|
199
|
+
title: title3,
|
|
200
|
+
description: description3,
|
|
201
|
+
children,
|
|
202
|
+
footer: footer2,
|
|
203
|
+
size,
|
|
204
|
+
hideCloseButton = false,
|
|
205
|
+
closeOnOverlayClick = true,
|
|
206
|
+
className
|
|
207
|
+
}) {
|
|
208
|
+
const portalClassName = usePortalClassName();
|
|
209
|
+
return /* @__PURE__ */ jsxs5(Dialog.Root, { open, defaultOpen, onOpenChange, children: [
|
|
210
|
+
trigger2 && /* @__PURE__ */ jsx6(Dialog.Trigger, { asChild: true, children: trigger2 }),
|
|
211
|
+
/* @__PURE__ */ jsxs5(Dialog.Portal, { children: [
|
|
212
|
+
/* @__PURE__ */ jsx6(Dialog.Overlay, { className: cx(portalClassName, overlay) }),
|
|
213
|
+
/* @__PURE__ */ jsxs5(
|
|
214
|
+
Dialog.Content,
|
|
215
|
+
{
|
|
216
|
+
className: cx(portalClassName, content({ size }), className),
|
|
217
|
+
onPointerDownOutside: closeOnOverlayClick ? void 0 : (event) => event.preventDefault(),
|
|
218
|
+
...description3 ? {} : { "aria-describedby": void 0 },
|
|
219
|
+
children: [
|
|
220
|
+
/* @__PURE__ */ jsxs5("div", { className: header, children: [
|
|
221
|
+
/* @__PURE__ */ jsxs5("div", { className: headings, children: [
|
|
222
|
+
/* @__PURE__ */ jsx6(Dialog.Title, { className: title, children: title3 }),
|
|
223
|
+
description3 && /* @__PURE__ */ jsx6(Dialog.Description, { className: description, children: description3 })
|
|
224
|
+
] }),
|
|
225
|
+
!hideCloseButton && /* @__PURE__ */ jsx6(Dialog.Close, { className: closeButton, "aria-label": "\uB2EB\uAE30", children: /* @__PURE__ */ jsx6(XIcon, { size: 16 }) })
|
|
226
|
+
] }),
|
|
227
|
+
children && /* @__PURE__ */ jsx6("div", { className: body, children }),
|
|
228
|
+
footer2 && /* @__PURE__ */ jsx6("div", { className: footer, children: footer2 })
|
|
229
|
+
]
|
|
230
|
+
}
|
|
231
|
+
)
|
|
232
|
+
] })
|
|
233
|
+
] });
|
|
234
|
+
}
|
|
235
|
+
var ModalClose = Dialog.Close;
|
|
236
|
+
|
|
237
|
+
// src/components/Select/Select.tsx
|
|
238
|
+
import * as RadixSelect from "@radix-ui/react-select";
|
|
239
|
+
import { forwardRef as forwardRef6, useId as useId2 } from "react";
|
|
240
|
+
import { CheckIcon, ChevronDownIcon } from "@bestow-ui/icons";
|
|
241
|
+
|
|
242
|
+
// src/components/Select/Select.css.ts
|
|
243
|
+
var content2 = "_1kx81e83";
|
|
244
|
+
var icon2 = "_1kx81e82";
|
|
245
|
+
var item = "_1kx81e85";
|
|
246
|
+
var itemIndicator = "_1kx81e86";
|
|
247
|
+
var trigger = "_1kx81e80";
|
|
248
|
+
var value = "_1kx81e81";
|
|
249
|
+
var viewport = "_1kx81e84";
|
|
250
|
+
|
|
251
|
+
// src/components/Select/Select.tsx
|
|
252
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
253
|
+
var Select = forwardRef6(function Select2({
|
|
254
|
+
options,
|
|
255
|
+
value: value2,
|
|
256
|
+
defaultValue,
|
|
257
|
+
onValueChange,
|
|
258
|
+
placeholder,
|
|
259
|
+
label: label2,
|
|
260
|
+
helperText: helperText2,
|
|
261
|
+
error,
|
|
262
|
+
size,
|
|
263
|
+
fullWidth,
|
|
264
|
+
disabled,
|
|
265
|
+
required,
|
|
266
|
+
name,
|
|
267
|
+
id,
|
|
268
|
+
"aria-label": ariaLabel,
|
|
269
|
+
className
|
|
270
|
+
}, ref) {
|
|
271
|
+
const generatedId = useId2();
|
|
272
|
+
const triggerId = id ?? generatedId;
|
|
273
|
+
const helperId = helperText2 ? `${triggerId}-helper` : void 0;
|
|
274
|
+
const portalClassName = usePortalClassName();
|
|
275
|
+
return /* @__PURE__ */ jsxs6("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
|
|
276
|
+
label2 && /* @__PURE__ */ jsxs6("label", { htmlFor: triggerId, className: label, children: [
|
|
277
|
+
label2,
|
|
278
|
+
required && /* @__PURE__ */ jsx7("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
279
|
+
] }),
|
|
280
|
+
/* @__PURE__ */ jsxs6(
|
|
281
|
+
RadixSelect.Root,
|
|
282
|
+
{
|
|
283
|
+
value: value2,
|
|
284
|
+
defaultValue,
|
|
285
|
+
onValueChange,
|
|
286
|
+
disabled,
|
|
287
|
+
required,
|
|
288
|
+
name,
|
|
289
|
+
children: [
|
|
290
|
+
/* @__PURE__ */ jsxs6(
|
|
291
|
+
RadixSelect.Trigger,
|
|
292
|
+
{
|
|
293
|
+
ref,
|
|
294
|
+
id: triggerId,
|
|
295
|
+
"aria-label": ariaLabel,
|
|
296
|
+
"aria-invalid": error || void 0,
|
|
297
|
+
"aria-describedby": helperId,
|
|
298
|
+
"data-invalid": error || void 0,
|
|
299
|
+
className: cx(root3({ size, fullWidth }), trigger, className),
|
|
300
|
+
children: [
|
|
301
|
+
/* @__PURE__ */ jsx7("span", { className: value, children: /* @__PURE__ */ jsx7(RadixSelect.Value, { placeholder }) }),
|
|
302
|
+
/* @__PURE__ */ jsx7(RadixSelect.Icon, { className: icon2, children: /* @__PURE__ */ jsx7(ChevronDownIcon, { size: 16 }) })
|
|
303
|
+
]
|
|
304
|
+
}
|
|
305
|
+
),
|
|
306
|
+
/* @__PURE__ */ jsx7(RadixSelect.Portal, { children: /* @__PURE__ */ jsx7(
|
|
307
|
+
RadixSelect.Content,
|
|
308
|
+
{
|
|
309
|
+
position: "popper",
|
|
310
|
+
sideOffset: 4,
|
|
311
|
+
collisionPadding: 8,
|
|
312
|
+
className: cx(portalClassName, content2),
|
|
313
|
+
children: /* @__PURE__ */ jsx7(RadixSelect.Viewport, { className: viewport, children: options.map((option) => /* @__PURE__ */ jsxs6(
|
|
314
|
+
RadixSelect.Item,
|
|
315
|
+
{
|
|
316
|
+
value: option.value,
|
|
317
|
+
disabled: option.disabled,
|
|
318
|
+
className: item,
|
|
319
|
+
children: [
|
|
320
|
+
/* @__PURE__ */ jsx7(RadixSelect.ItemText, { children: option.label }),
|
|
321
|
+
/* @__PURE__ */ jsx7(RadixSelect.ItemIndicator, { className: itemIndicator, children: /* @__PURE__ */ jsx7(CheckIcon, { size: 16 }) })
|
|
322
|
+
]
|
|
323
|
+
},
|
|
324
|
+
option.value
|
|
325
|
+
)) })
|
|
326
|
+
}
|
|
327
|
+
) })
|
|
328
|
+
]
|
|
329
|
+
}
|
|
330
|
+
),
|
|
331
|
+
helperText2 && /* @__PURE__ */ jsx7("p", { id: helperId, className: helperText({ error }), children: helperText2 })
|
|
332
|
+
] });
|
|
333
|
+
});
|
|
334
|
+
|
|
172
335
|
// src/components/Stack/Stack.tsx
|
|
173
|
-
import { forwardRef as
|
|
336
|
+
import { forwardRef as forwardRef7 } from "react";
|
|
174
337
|
|
|
175
338
|
// src/components/Stack/Stack.css.ts
|
|
176
|
-
import { createRuntimeFn as
|
|
177
|
-
var stack =
|
|
339
|
+
import { createRuntimeFn as _7a4685 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
340
|
+
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: [] });
|
|
178
341
|
|
|
179
342
|
// src/components/Stack/Stack.tsx
|
|
180
|
-
import { jsx as
|
|
181
|
-
var Stack =
|
|
182
|
-
return /* @__PURE__ */
|
|
343
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
344
|
+
var Stack = forwardRef7(function Stack2({ as: Component = "div", direction, gap, align, justify, wrap, className, ...rest }, ref) {
|
|
345
|
+
return /* @__PURE__ */ jsx8(
|
|
183
346
|
Component,
|
|
184
347
|
{
|
|
185
348
|
ref,
|
|
@@ -189,15 +352,119 @@ var Stack = forwardRef6(function Stack2({ as: Component = "div", direction, gap,
|
|
|
189
352
|
);
|
|
190
353
|
});
|
|
191
354
|
|
|
355
|
+
// src/components/Toast/Toast.tsx
|
|
356
|
+
import * as RadixToast from "@radix-ui/react-toast";
|
|
357
|
+
import { createContext as createContext2, useCallback, useContext as useContext2, useMemo, useRef as useRef2, useState } from "react";
|
|
358
|
+
import { XIcon as XIcon2 } from "@bestow-ui/icons";
|
|
359
|
+
|
|
360
|
+
// src/components/Toast/Toast.css.ts
|
|
361
|
+
import { createRuntimeFn as _7a4686 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
362
|
+
var action = "_1g11zvx7";
|
|
363
|
+
var close = "_1g11zvx8";
|
|
364
|
+
var description2 = "_1g11zvx6";
|
|
365
|
+
var title2 = "_1g11zvx5";
|
|
366
|
+
var toast = _7a4686({ defaultClassName: "_1g11zvx1", variantClassNames: { variant: { "default": "_1g11zvx2", success: "_1g11zvx3", danger: "_1g11zvx4" } }, defaultVariants: { variant: "default" }, compoundVariants: [] });
|
|
367
|
+
var viewport2 = "_1g11zvx0";
|
|
368
|
+
|
|
369
|
+
// src/components/Toast/Toast.tsx
|
|
370
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
371
|
+
var REMOVE_DELAY = 500;
|
|
372
|
+
var ToastContext = createContext2(null);
|
|
373
|
+
function ToastProvider({ children, duration = 5e3, label: label2 = "\uC54C\uB9BC" }) {
|
|
374
|
+
const [toasts, setToasts] = useState([]);
|
|
375
|
+
const nextId = useRef2(0);
|
|
376
|
+
const portalClassName = usePortalClassName();
|
|
377
|
+
const toast2 = useCallback((options) => {
|
|
378
|
+
const id = nextId.current++;
|
|
379
|
+
setToasts((prev) => [...prev, { ...options, id, open: true }]);
|
|
380
|
+
return id;
|
|
381
|
+
}, []);
|
|
382
|
+
const dismiss = useCallback((id) => {
|
|
383
|
+
const isTarget = (t) => id === void 0 || t.id === id;
|
|
384
|
+
setToasts((prev) => prev.map((t) => isTarget(t) ? { ...t, open: false } : t));
|
|
385
|
+
setTimeout(() => setToasts((prev) => prev.filter((t) => t.open || !isTarget(t))), REMOVE_DELAY);
|
|
386
|
+
}, []);
|
|
387
|
+
const value2 = useMemo(() => ({ toast: toast2, dismiss }), [toast2, dismiss]);
|
|
388
|
+
return /* @__PURE__ */ jsx9(ToastContext.Provider, { value: value2, children: /* @__PURE__ */ jsxs7(RadixToast.Provider, { duration, label: label2, swipeDirection: "right", children: [
|
|
389
|
+
children,
|
|
390
|
+
toasts.map(({ id, open, title: title3, description: description3, variant, duration: itemDuration, action: action2 }) => /* @__PURE__ */ jsxs7(
|
|
391
|
+
RadixToast.Root,
|
|
392
|
+
{
|
|
393
|
+
open,
|
|
394
|
+
duration: itemDuration,
|
|
395
|
+
onOpenChange: (nextOpen) => {
|
|
396
|
+
if (!nextOpen) dismiss(id);
|
|
397
|
+
},
|
|
398
|
+
className: toast({ variant }),
|
|
399
|
+
children: [
|
|
400
|
+
/* @__PURE__ */ jsx9(RadixToast.Title, { className: title2, children: title3 }),
|
|
401
|
+
description3 && /* @__PURE__ */ jsx9(RadixToast.Description, { className: description2, children: description3 }),
|
|
402
|
+
action2 && /* @__PURE__ */ jsx9(RadixToast.Action, { asChild: true, altText: action2.altText ?? action2.label, className: action, children: /* @__PURE__ */ jsx9(Button, { size: "sm", variant: "soft", color: "neutral", onClick: action2.onClick, children: action2.label }) }),
|
|
403
|
+
/* @__PURE__ */ jsx9(RadixToast.Close, { className: close, "aria-label": "\uB2EB\uAE30", children: /* @__PURE__ */ jsx9(XIcon2, { size: 16 }) })
|
|
404
|
+
]
|
|
405
|
+
},
|
|
406
|
+
id
|
|
407
|
+
)),
|
|
408
|
+
/* @__PURE__ */ jsx9(RadixToast.Viewport, { className: cx(portalClassName, viewport2) })
|
|
409
|
+
] }) });
|
|
410
|
+
}
|
|
411
|
+
function useToast() {
|
|
412
|
+
const context = useContext2(ToastContext);
|
|
413
|
+
if (!context) throw new Error("useToast \uB294 ToastProvider \uC548\uC5D0\uC11C \uC0AC\uC6A9\uD574\uC57C \uD569\uB2C8\uB2E4.");
|
|
414
|
+
return context;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
// src/components/Tooltip/Tooltip.tsx
|
|
418
|
+
import * as RadixTooltip from "@radix-ui/react-tooltip";
|
|
419
|
+
|
|
420
|
+
// src/components/Tooltip/Tooltip.css.ts
|
|
421
|
+
var arrow = "z7rufs1";
|
|
422
|
+
var content3 = "z7rufs0";
|
|
423
|
+
|
|
424
|
+
// src/components/Tooltip/Tooltip.tsx
|
|
425
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
426
|
+
function Tooltip({
|
|
427
|
+
content: content4,
|
|
428
|
+
children,
|
|
429
|
+
side = "top",
|
|
430
|
+
align = "center",
|
|
431
|
+
delay = 300,
|
|
432
|
+
open,
|
|
433
|
+
defaultOpen,
|
|
434
|
+
onOpenChange,
|
|
435
|
+
disabled,
|
|
436
|
+
className
|
|
437
|
+
}) {
|
|
438
|
+
const portalClassName = usePortalClassName();
|
|
439
|
+
if (disabled || content4 == null || content4 === "") return children;
|
|
440
|
+
return /* @__PURE__ */ jsx10(RadixTooltip.Provider, { delayDuration: delay, children: /* @__PURE__ */ jsxs8(RadixTooltip.Root, { open, defaultOpen, onOpenChange, children: [
|
|
441
|
+
/* @__PURE__ */ jsx10(RadixTooltip.Trigger, { asChild: true, children }),
|
|
442
|
+
/* @__PURE__ */ jsx10(RadixTooltip.Portal, { children: /* @__PURE__ */ jsxs8(
|
|
443
|
+
RadixTooltip.Content,
|
|
444
|
+
{
|
|
445
|
+
side,
|
|
446
|
+
align,
|
|
447
|
+
sideOffset: 6,
|
|
448
|
+
collisionPadding: 8,
|
|
449
|
+
className: cx(portalClassName, content3, className),
|
|
450
|
+
children: [
|
|
451
|
+
content4,
|
|
452
|
+
/* @__PURE__ */ jsx10(RadixTooltip.Arrow, { className: arrow, width: 10, height: 5 })
|
|
453
|
+
]
|
|
454
|
+
}
|
|
455
|
+
) })
|
|
456
|
+
] }) });
|
|
457
|
+
}
|
|
458
|
+
|
|
192
459
|
// src/components/Typography/Typography.tsx
|
|
193
|
-
import { forwardRef as
|
|
460
|
+
import { forwardRef as forwardRef8 } from "react";
|
|
194
461
|
|
|
195
462
|
// src/components/Typography/Typography.css.ts
|
|
196
|
-
import { createRuntimeFn as
|
|
197
|
-
var typography =
|
|
463
|
+
import { createRuntimeFn as _7a4687 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
464
|
+
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: [] });
|
|
198
465
|
|
|
199
466
|
// src/components/Typography/Typography.tsx
|
|
200
|
-
import { jsx as
|
|
467
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
201
468
|
var defaultElement = {
|
|
202
469
|
display: "h1",
|
|
203
470
|
h1: "h1",
|
|
@@ -209,9 +476,9 @@ var defaultElement = {
|
|
|
209
476
|
"body-sm": "p",
|
|
210
477
|
caption: "span"
|
|
211
478
|
};
|
|
212
|
-
var Typography =
|
|
479
|
+
var Typography = forwardRef8(function Typography2({ variant = "body", as, color, weight, align, truncate, className, ...rest }, ref) {
|
|
213
480
|
const Component = as ?? defaultElement[variant];
|
|
214
|
-
return /* @__PURE__ */
|
|
481
|
+
return /* @__PURE__ */ jsx11(
|
|
215
482
|
Component,
|
|
216
483
|
{
|
|
217
484
|
ref,
|
|
@@ -224,12 +491,19 @@ export {
|
|
|
224
491
|
Button,
|
|
225
492
|
Checkbox,
|
|
226
493
|
Input,
|
|
494
|
+
Modal,
|
|
495
|
+
ModalClose,
|
|
496
|
+
Select,
|
|
227
497
|
Stack,
|
|
228
498
|
TextField,
|
|
229
499
|
ThemeProvider,
|
|
500
|
+
ToastProvider,
|
|
501
|
+
Tooltip,
|
|
230
502
|
Typography,
|
|
231
503
|
themeClass,
|
|
504
|
+
usePortalClassName,
|
|
232
505
|
useTheme,
|
|
506
|
+
useToast,
|
|
233
507
|
vars
|
|
234
508
|
};
|
|
235
509
|
//# sourceMappingURL=index.js.map
|