@bestow-ui/react 0.1.0 → 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.cjs +319 -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 +302 -18
- package/dist/index.js.map +1 -1
- package/package.json +7 -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,187 @@ 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
|
+
|
|
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
|
+
|
|
172
346
|
// src/components/Stack/Stack.tsx
|
|
173
|
-
import { forwardRef as
|
|
347
|
+
import { forwardRef as forwardRef7 } from "react";
|
|
174
348
|
|
|
175
349
|
// src/components/Stack/Stack.css.ts
|
|
176
|
-
import { createRuntimeFn as
|
|
177
|
-
var stack =
|
|
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: [] });
|
|
178
352
|
|
|
179
353
|
// src/components/Stack/Stack.tsx
|
|
180
|
-
import { jsx as
|
|
181
|
-
var Stack =
|
|
182
|
-
return /* @__PURE__ */
|
|
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(
|
|
183
357
|
Component,
|
|
184
358
|
{
|
|
185
359
|
ref,
|
|
@@ -189,15 +363,118 @@ var Stack = forwardRef6(function Stack2({ as: Component = "div", direction, gap,
|
|
|
189
363
|
);
|
|
190
364
|
});
|
|
191
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
|
+
|
|
192
469
|
// src/components/Typography/Typography.tsx
|
|
193
|
-
import { forwardRef as
|
|
470
|
+
import { forwardRef as forwardRef8 } from "react";
|
|
194
471
|
|
|
195
472
|
// src/components/Typography/Typography.css.ts
|
|
196
|
-
import { createRuntimeFn as
|
|
197
|
-
var typography =
|
|
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: [] });
|
|
198
475
|
|
|
199
476
|
// src/components/Typography/Typography.tsx
|
|
200
|
-
import { jsx as
|
|
477
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
201
478
|
var defaultElement = {
|
|
202
479
|
display: "h1",
|
|
203
480
|
h1: "h1",
|
|
@@ -209,9 +486,9 @@ var defaultElement = {
|
|
|
209
486
|
"body-sm": "p",
|
|
210
487
|
caption: "span"
|
|
211
488
|
};
|
|
212
|
-
var Typography =
|
|
489
|
+
var Typography = forwardRef8(function Typography2({ variant = "body", as, color, weight, align, truncate, className, ...rest }, ref) {
|
|
213
490
|
const Component = as ?? defaultElement[variant];
|
|
214
|
-
return /* @__PURE__ */
|
|
491
|
+
return /* @__PURE__ */ jsx12(
|
|
215
492
|
Component,
|
|
216
493
|
{
|
|
217
494
|
ref,
|
|
@@ -224,12 +501,19 @@ export {
|
|
|
224
501
|
Button,
|
|
225
502
|
Checkbox,
|
|
226
503
|
Input,
|
|
504
|
+
Modal,
|
|
505
|
+
ModalClose,
|
|
506
|
+
Select,
|
|
227
507
|
Stack,
|
|
228
508
|
TextField,
|
|
229
509
|
ThemeProvider,
|
|
510
|
+
ToastProvider,
|
|
511
|
+
Tooltip,
|
|
230
512
|
Typography,
|
|
231
513
|
themeClass,
|
|
514
|
+
usePortalClassName,
|
|
232
515
|
useTheme,
|
|
516
|
+
useToast,
|
|
233
517
|
vars
|
|
234
518
|
};
|
|
235
519
|
//# sourceMappingURL=index.js.map
|