@bestow-ui/react 0.2.1 → 0.3.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 +200 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +476 -476
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +138 -8
- package/dist/index.d.ts +138 -8
- package/dist/index.js +199 -19
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -1,11 +1,163 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
// src/theme/contract.css.ts
|
|
4
|
-
var themeClass = { light: "
|
|
5
|
-
var vars = { space: { "0": "var(--
|
|
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)" } }, shadow: { sm: "var(--bestow-shadow-sm)", md: "var(--bestow-shadow-md)", lg: "var(--bestow-shadow-lg)" }, 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)" } } };
|
|
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((v) => Math.round(Math.min(1, Math.max(0, v)) * 255).toString(16).padStart(2, "0")).join("")}`;
|
|
18
|
+
}
|
|
19
|
+
var toLinear = (c) => c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
|
|
20
|
+
var fromLinear = (c) => c <= 31308e-7 ? 12.92 * c : 1.055 * c ** (1 / 2.4) - 0.055;
|
|
21
|
+
function rgbToOklch([r, g, b]) {
|
|
22
|
+
const [lr, lg, lb] = [toLinear(r), toLinear(g), toLinear(b)];
|
|
23
|
+
const l_ = Math.cbrt(0.4122214708 * lr + 0.5363325363 * lg + 0.0514459929 * lb);
|
|
24
|
+
const m_ = Math.cbrt(0.2119034982 * lr + 0.6806995451 * lg + 0.1073969566 * lb);
|
|
25
|
+
const s_ = Math.cbrt(0.0883024619 * lr + 0.2817188376 * lg + 0.6299787005 * lb);
|
|
26
|
+
const L = 0.2104542553 * l_ + 0.793617785 * m_ - 0.0040720468 * s_;
|
|
27
|
+
const a = 1.9779984951 * l_ - 2.428592205 * m_ + 0.4505937099 * s_;
|
|
28
|
+
const bb = 0.0259040371 * l_ + 0.7827717662 * m_ - 0.808675766 * s_;
|
|
29
|
+
return { l: L, c: Math.hypot(a, bb), h: Math.atan2(bb, a) };
|
|
30
|
+
}
|
|
31
|
+
function oklchToRgbUnclamped({ l, c, h }) {
|
|
32
|
+
const a = c * Math.cos(h);
|
|
33
|
+
const b = c * Math.sin(h);
|
|
34
|
+
const l_ = (l + 0.3963377774 * a + 0.2158037573 * b) ** 3;
|
|
35
|
+
const m_ = (l - 0.1055613458 * a - 0.0638541728 * b) ** 3;
|
|
36
|
+
const s_ = (l - 0.0894841775 * a - 1.291485548 * b) ** 3;
|
|
37
|
+
return [
|
|
38
|
+
fromLinear(4.0767416621 * l_ - 3.3077115913 * m_ + 0.2309699292 * s_),
|
|
39
|
+
fromLinear(-1.2684380046 * l_ + 2.6097574011 * m_ - 0.3413193965 * s_),
|
|
40
|
+
fromLinear(-0.0041960863 * l_ - 0.7034186147 * m_ + 1.707614701 * s_)
|
|
41
|
+
];
|
|
42
|
+
}
|
|
43
|
+
var inGamut = (rgb) => rgb.every((v) => v >= -1e-4 && v <= 1 + 1e-4);
|
|
44
|
+
function oklchToRgb(color) {
|
|
45
|
+
const l = Math.min(1, Math.max(0, color.l));
|
|
46
|
+
let rgb = oklchToRgbUnclamped({ ...color, l });
|
|
47
|
+
if (inGamut(rgb)) return rgb;
|
|
48
|
+
let lo = 0;
|
|
49
|
+
let hi = color.c;
|
|
50
|
+
for (let i = 0; i < 20; i++) {
|
|
51
|
+
const mid = (lo + hi) / 2;
|
|
52
|
+
if (inGamut(oklchToRgbUnclamped({ l, c: mid, h: color.h }))) lo = mid;
|
|
53
|
+
else hi = mid;
|
|
54
|
+
}
|
|
55
|
+
rgb = oklchToRgbUnclamped({ l, c: lo, h: color.h });
|
|
56
|
+
return rgb;
|
|
57
|
+
}
|
|
58
|
+
function luminance([r, g, b]) {
|
|
59
|
+
return 0.2126 * toLinear(r) + 0.7152 * toLinear(g) + 0.0722 * toLinear(b);
|
|
60
|
+
}
|
|
61
|
+
function contrastRatio(a, b) {
|
|
62
|
+
const [la, lb] = [luminance(parseHex(a)), luminance(parseHex(b))];
|
|
63
|
+
return (Math.max(la, lb) + 0.05) / (Math.min(la, lb) + 0.05);
|
|
64
|
+
}
|
|
65
|
+
function blend(fg, alpha, bg) {
|
|
66
|
+
const [f, b] = [parseHex(fg), parseHex(bg)];
|
|
67
|
+
return toHex(f.map((v, i) => v * alpha + b[i] * (1 - alpha)));
|
|
68
|
+
}
|
|
69
|
+
var withL = (base, l, c = base.c) => toHex(oklchToRgb({ l, c, h: base.h }));
|
|
70
|
+
function findReadable(base, startL, step, backgrounds) {
|
|
71
|
+
let l = startL;
|
|
72
|
+
for (let i = 0; i < 40; i++) {
|
|
73
|
+
const hex = withL(base, l);
|
|
74
|
+
if (backgrounds.every((bg) => contrastRatio(hex, bg) >= 4.5)) return hex;
|
|
75
|
+
l = Math.min(1, Math.max(0, l + step));
|
|
76
|
+
}
|
|
77
|
+
return step < 0 ? palette.black : palette.white;
|
|
78
|
+
}
|
|
79
|
+
function pickContrast(solid) {
|
|
80
|
+
const white = palette.white;
|
|
81
|
+
const dark = palette.gray[900];
|
|
82
|
+
if (contrastRatio(white, solid) >= 4.5) return white;
|
|
83
|
+
return contrastRatio(dark, solid) >= contrastRatio(white, solid) ? dark : white;
|
|
84
|
+
}
|
|
85
|
+
var rgba = (hex, alpha) => {
|
|
86
|
+
const [r, g, b] = parseHex(hex).map((v) => Math.round(v * 255));
|
|
87
|
+
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
88
|
+
};
|
|
89
|
+
function createIntentColors(intent, color) {
|
|
90
|
+
const solid = toHex(parseHex(color));
|
|
91
|
+
const base = rgbToOklch(parseHex(solid));
|
|
92
|
+
const lightSubtle = withL(base, 0.97, Math.min(base.c, 0.12) * 0.3);
|
|
93
|
+
const lightSubtleHover = withL(base, 0.93, Math.min(base.c, 0.12) * 0.45);
|
|
94
|
+
const light = {
|
|
95
|
+
solid,
|
|
96
|
+
solidHover: withL(base, Math.max(0, base.l - 0.06)),
|
|
97
|
+
contrast: pickContrast(solid),
|
|
98
|
+
subtle: lightSubtle,
|
|
99
|
+
subtleHover: lightSubtleHover,
|
|
100
|
+
text: findReadable(base, Math.min(base.l, 0.55), -0.02, [lightColors.bg.default, lightSubtle, lightSubtleHover])
|
|
101
|
+
};
|
|
102
|
+
const darkBg = darkColors.bg.default;
|
|
103
|
+
const darkSolid = base.l < 0.5 ? withL(base, 0.55) : solid;
|
|
104
|
+
const darkBase = rgbToOklch(parseHex(darkSolid));
|
|
105
|
+
const darkSubtleOnBg = blend(darkSolid, 0.16, darkBg);
|
|
106
|
+
const darkSubtleHoverOnBg = blend(darkSolid, 0.26, darkBg);
|
|
107
|
+
const dark = {
|
|
108
|
+
solid: darkSolid,
|
|
109
|
+
solidHover: withL(darkBase, Math.min(1, darkBase.l + 0.06)),
|
|
110
|
+
contrast: pickContrast(darkSolid),
|
|
111
|
+
subtle: rgba(darkSolid, 0.16),
|
|
112
|
+
subtleHover: rgba(darkSolid, 0.26),
|
|
113
|
+
text: findReadable(darkBase, Math.max(darkBase.l, 0.75), 0.02, [darkBg, darkSubtleOnBg, darkSubtleHoverOnBg])
|
|
114
|
+
};
|
|
115
|
+
return { light: { color: { [intent]: light } }, dark: { color: { [intent]: dark } } };
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// src/theme/createTheme.ts
|
|
119
|
+
import { assignInlineVars } from "@vanilla-extract/dynamic";
|
|
120
|
+
function deepMerge(target, source) {
|
|
121
|
+
if (!source) return target;
|
|
122
|
+
const out = { ...target };
|
|
123
|
+
for (const [key, value2] of Object.entries(source)) {
|
|
124
|
+
if (value2 === void 0) continue;
|
|
125
|
+
const prev = out[key];
|
|
126
|
+
out[key] = typeof value2 === "object" && typeof prev === "object" ? deepMerge(prev, value2) : value2;
|
|
127
|
+
}
|
|
128
|
+
return out;
|
|
129
|
+
}
|
|
130
|
+
function createTheme(...inputs) {
|
|
131
|
+
let light = {};
|
|
132
|
+
let dark = {};
|
|
133
|
+
for (const input3 of inputs) {
|
|
134
|
+
light = deepMerge(deepMerge(light, input3.common), input3.light);
|
|
135
|
+
dark = deepMerge(deepMerge(dark, input3.common), input3.dark);
|
|
136
|
+
}
|
|
137
|
+
return Object.freeze({ light, dark });
|
|
138
|
+
}
|
|
139
|
+
function mergeThemes(a, b) {
|
|
140
|
+
if (!a) return b;
|
|
141
|
+
if (!b) return a;
|
|
142
|
+
return createTheme(a, b);
|
|
143
|
+
}
|
|
144
|
+
function flatten(partial, contract, out) {
|
|
145
|
+
for (const [key, value2] of Object.entries(partial)) {
|
|
146
|
+
const target = contract[key];
|
|
147
|
+
if (target === void 0) continue;
|
|
148
|
+
if (typeof target === "string" && typeof value2 === "string") out[target] = value2;
|
|
149
|
+
else if (typeof target === "object" && typeof value2 === "object") flatten(value2, target, out);
|
|
150
|
+
}
|
|
151
|
+
return out;
|
|
152
|
+
}
|
|
153
|
+
function themeToStyle(theme, mode) {
|
|
154
|
+
if (!theme) return void 0;
|
|
155
|
+
const map = flatten(theme[mode], vars, {});
|
|
156
|
+
return Object.keys(map).length ? assignInlineVars(map) : void 0;
|
|
157
|
+
}
|
|
6
158
|
|
|
7
159
|
// src/theme/ThemeProvider.tsx
|
|
8
|
-
import { createContext, forwardRef, useContext } from "react";
|
|
160
|
+
import { createContext, forwardRef, useContext, useMemo } from "react";
|
|
9
161
|
|
|
10
162
|
// src/utils/cx.ts
|
|
11
163
|
function cx(...classNames) {
|
|
@@ -18,15 +170,36 @@ var root = "sfyhlv1 sfyhlv0";
|
|
|
18
170
|
|
|
19
171
|
// src/theme/ThemeProvider.tsx
|
|
20
172
|
import { jsx } from "react/jsx-runtime";
|
|
21
|
-
var ThemeContext = createContext("light");
|
|
22
|
-
var ThemeProvider = forwardRef(function ThemeProvider2({ theme
|
|
23
|
-
|
|
173
|
+
var ThemeContext = createContext({ theme: "light" });
|
|
174
|
+
var ThemeProvider = forwardRef(function ThemeProvider2({ theme: themeProp, overrides, className, style, children, ...rest }, ref) {
|
|
175
|
+
const parent = useContext(ThemeContext);
|
|
176
|
+
const theme = themeProp ?? parent.theme;
|
|
177
|
+
const merged = useMemo(() => mergeThemes(parent.overrides, overrides), [parent.overrides, overrides]);
|
|
178
|
+
const value2 = useMemo(
|
|
179
|
+
() => ({ theme, overrides: merged, style: themeToStyle(merged, theme) }),
|
|
180
|
+
[theme, merged]
|
|
181
|
+
);
|
|
182
|
+
return /* @__PURE__ */ jsx(ThemeContext.Provider, { value: value2, children: /* @__PURE__ */ jsx(
|
|
183
|
+
"div",
|
|
184
|
+
{
|
|
185
|
+
ref,
|
|
186
|
+
"data-theme": theme,
|
|
187
|
+
className: cx(themeClass[theme], root, className),
|
|
188
|
+
style: value2.style ? { ...value2.style, ...style } : style,
|
|
189
|
+
...rest,
|
|
190
|
+
children
|
|
191
|
+
}
|
|
192
|
+
) });
|
|
24
193
|
});
|
|
25
194
|
function useTheme() {
|
|
26
|
-
return useContext(ThemeContext);
|
|
195
|
+
return useContext(ThemeContext).theme;
|
|
196
|
+
}
|
|
197
|
+
function usePortalProps() {
|
|
198
|
+
const { theme, style } = useContext(ThemeContext);
|
|
199
|
+
return { className: cx(themeClass[theme], portal), style };
|
|
27
200
|
}
|
|
28
201
|
function usePortalClassName() {
|
|
29
|
-
return
|
|
202
|
+
return usePortalProps().className;
|
|
30
203
|
}
|
|
31
204
|
|
|
32
205
|
// src/components/Button/Button.tsx
|
|
@@ -205,15 +378,16 @@ function Modal({
|
|
|
205
378
|
closeOnOverlayClick = true,
|
|
206
379
|
className
|
|
207
380
|
}) {
|
|
208
|
-
const
|
|
381
|
+
const portal2 = usePortalProps();
|
|
209
382
|
return /* @__PURE__ */ jsxs5(Dialog.Root, { open, defaultOpen, onOpenChange, children: [
|
|
210
383
|
trigger2 && /* @__PURE__ */ jsx6(Dialog.Trigger, { asChild: true, children: trigger2 }),
|
|
211
384
|
/* @__PURE__ */ jsxs5(Dialog.Portal, { children: [
|
|
212
|
-
/* @__PURE__ */ jsx6(Dialog.Overlay, { className: cx(
|
|
385
|
+
/* @__PURE__ */ jsx6(Dialog.Overlay, { className: cx(portal2.className, overlay), style: portal2.style }),
|
|
213
386
|
/* @__PURE__ */ jsxs5(
|
|
214
387
|
Dialog.Content,
|
|
215
388
|
{
|
|
216
|
-
className: cx(
|
|
389
|
+
className: cx(portal2.className, content({ size }), className),
|
|
390
|
+
style: portal2.style,
|
|
217
391
|
onPointerDownOutside: closeOnOverlayClick ? void 0 : (event) => event.preventDefault(),
|
|
218
392
|
...description3 ? {} : { "aria-describedby": void 0 },
|
|
219
393
|
children: [
|
|
@@ -271,7 +445,7 @@ var Select = forwardRef6(function Select2({
|
|
|
271
445
|
const generatedId = useId2();
|
|
272
446
|
const triggerId = id ?? generatedId;
|
|
273
447
|
const helperId = helperText2 ? `${triggerId}-helper` : void 0;
|
|
274
|
-
const
|
|
448
|
+
const portal2 = usePortalProps();
|
|
275
449
|
return /* @__PURE__ */ jsxs6("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
|
|
276
450
|
label2 && /* @__PURE__ */ jsxs6("label", { htmlFor: triggerId, className: label, children: [
|
|
277
451
|
label2,
|
|
@@ -309,7 +483,8 @@ var Select = forwardRef6(function Select2({
|
|
|
309
483
|
position: "popper",
|
|
310
484
|
sideOffset: 4,
|
|
311
485
|
collisionPadding: 8,
|
|
312
|
-
className: cx(
|
|
486
|
+
className: cx(portal2.className, content2),
|
|
487
|
+
style: portal2.style,
|
|
313
488
|
children: /* @__PURE__ */ jsx7(RadixSelect.Viewport, { className: viewport, children: options.map((option) => /* @__PURE__ */ jsxs6(
|
|
314
489
|
RadixSelect.Item,
|
|
315
490
|
{
|
|
@@ -354,7 +529,7 @@ var Stack = forwardRef7(function Stack2({ as: Component = "div", direction, gap,
|
|
|
354
529
|
|
|
355
530
|
// src/components/Toast/Toast.tsx
|
|
356
531
|
import * as RadixToast from "@radix-ui/react-toast";
|
|
357
|
-
import { createContext as createContext2, useCallback, useContext as useContext2, useMemo, useRef as useRef2, useState } from "react";
|
|
532
|
+
import { createContext as createContext2, useCallback, useContext as useContext2, useMemo as useMemo2, useRef as useRef2, useState } from "react";
|
|
358
533
|
import { XIcon as XIcon2 } from "@bestow-ui/icons";
|
|
359
534
|
|
|
360
535
|
// src/components/Toast/Toast.css.ts
|
|
@@ -373,7 +548,7 @@ var ToastContext = createContext2(null);
|
|
|
373
548
|
function ToastProvider({ children, duration = 5e3, label: label2 = "\uC54C\uB9BC" }) {
|
|
374
549
|
const [toasts, setToasts] = useState([]);
|
|
375
550
|
const nextId = useRef2(0);
|
|
376
|
-
const
|
|
551
|
+
const portal2 = usePortalProps();
|
|
377
552
|
const toast2 = useCallback((options) => {
|
|
378
553
|
const id = nextId.current++;
|
|
379
554
|
setToasts((prev) => [...prev, { ...options, id, open: true }]);
|
|
@@ -384,7 +559,7 @@ function ToastProvider({ children, duration = 5e3, label: label2 = "\uC54C\uB9BC
|
|
|
384
559
|
setToasts((prev) => prev.map((t) => isTarget(t) ? { ...t, open: false } : t));
|
|
385
560
|
setTimeout(() => setToasts((prev) => prev.filter((t) => t.open || !isTarget(t))), REMOVE_DELAY);
|
|
386
561
|
}, []);
|
|
387
|
-
const value2 =
|
|
562
|
+
const value2 = useMemo2(() => ({ toast: toast2, dismiss }), [toast2, dismiss]);
|
|
388
563
|
return /* @__PURE__ */ jsx9(ToastContext.Provider, { value: value2, children: /* @__PURE__ */ jsxs7(RadixToast.Provider, { duration, label: label2, swipeDirection: "right", children: [
|
|
389
564
|
children,
|
|
390
565
|
toasts.map(({ id, open, title: title3, description: description3, variant, duration: itemDuration, action: action2 }) => /* @__PURE__ */ jsxs7(
|
|
@@ -405,7 +580,7 @@ function ToastProvider({ children, duration = 5e3, label: label2 = "\uC54C\uB9BC
|
|
|
405
580
|
},
|
|
406
581
|
id
|
|
407
582
|
)),
|
|
408
|
-
/* @__PURE__ */ jsx9(RadixToast.Viewport, { className: cx(
|
|
583
|
+
/* @__PURE__ */ jsx9(RadixToast.Viewport, { className: cx(portal2.className, viewport2), style: portal2.style })
|
|
409
584
|
] }) });
|
|
410
585
|
}
|
|
411
586
|
function useToast() {
|
|
@@ -435,7 +610,7 @@ function Tooltip({
|
|
|
435
610
|
disabled,
|
|
436
611
|
className
|
|
437
612
|
}) {
|
|
438
|
-
const
|
|
613
|
+
const portal2 = usePortalProps();
|
|
439
614
|
if (disabled || content4 == null || content4 === "") return children;
|
|
440
615
|
return /* @__PURE__ */ jsx10(RadixTooltip.Provider, { delayDuration: delay, children: /* @__PURE__ */ jsxs8(RadixTooltip.Root, { open, defaultOpen, onOpenChange, children: [
|
|
441
616
|
/* @__PURE__ */ jsx10(RadixTooltip.Trigger, { asChild: true, children }),
|
|
@@ -446,7 +621,8 @@ function Tooltip({
|
|
|
446
621
|
align,
|
|
447
622
|
sideOffset: 6,
|
|
448
623
|
collisionPadding: 8,
|
|
449
|
-
className: cx(
|
|
624
|
+
className: cx(portal2.className, content3, className),
|
|
625
|
+
style: portal2.style,
|
|
450
626
|
children: [
|
|
451
627
|
content4,
|
|
452
628
|
/* @__PURE__ */ jsx10(RadixTooltip.Arrow, { className: arrow, width: 10, height: 5 })
|
|
@@ -500,8 +676,12 @@ export {
|
|
|
500
676
|
ToastProvider,
|
|
501
677
|
Tooltip,
|
|
502
678
|
Typography,
|
|
679
|
+
contrastRatio,
|
|
680
|
+
createIntentColors,
|
|
681
|
+
createTheme,
|
|
503
682
|
themeClass,
|
|
504
683
|
usePortalClassName,
|
|
684
|
+
usePortalProps,
|
|
505
685
|
useTheme,
|
|
506
686
|
useToast,
|
|
507
687
|
vars
|