@bestow-ui/react 0.2.1 → 0.3.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 +225 -35
- 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 +140 -9
- package/dist/index.d.ts +140 -9
- package/dist/index.js +224 -38
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -43,8 +43,12 @@ __export(index_exports, {
|
|
|
43
43
|
ToastProvider: () => ToastProvider,
|
|
44
44
|
Tooltip: () => Tooltip,
|
|
45
45
|
Typography: () => Typography,
|
|
46
|
+
contrastRatio: () => contrastRatio,
|
|
47
|
+
createIntentColors: () => createIntentColors,
|
|
48
|
+
createTheme: () => createTheme,
|
|
46
49
|
themeClass: () => themeClass,
|
|
47
50
|
usePortalClassName: () => usePortalClassName,
|
|
51
|
+
usePortalProps: () => usePortalProps,
|
|
48
52
|
useTheme: () => useTheme,
|
|
49
53
|
useToast: () => useToast,
|
|
50
54
|
vars: () => vars
|
|
@@ -52,8 +56,164 @@ __export(index_exports, {
|
|
|
52
56
|
module.exports = __toCommonJS(index_exports);
|
|
53
57
|
|
|
54
58
|
// src/theme/contract.css.ts
|
|
55
|
-
var themeClass = { light: "
|
|
56
|
-
var vars = { space: { "0": "var(--
|
|
59
|
+
var themeClass = { light: "tkagtb0", dark: "tkagtb1" };
|
|
60
|
+
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)" } } };
|
|
61
|
+
|
|
62
|
+
// src/theme/color.ts
|
|
63
|
+
var import_tokens = require("@bestow-ui/tokens");
|
|
64
|
+
function parseHex(hex) {
|
|
65
|
+
const m = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(hex.trim());
|
|
66
|
+
if (!m) throw new Error(`\uC62C\uBC14\uB978 hex \uC0C9\uC774 \uC544\uB2C8\uC5D0\uC694: "${hex}" (\uC608: "#7c3aed")`);
|
|
67
|
+
let h = m[1];
|
|
68
|
+
if (h.length === 3) h = h.replace(/./g, (c) => c + c);
|
|
69
|
+
return [0, 2, 4].map((i) => parseInt(h.slice(i, i + 2), 16) / 255);
|
|
70
|
+
}
|
|
71
|
+
function toHex(rgb) {
|
|
72
|
+
return `#${rgb.map((v) => Math.round(Math.min(1, Math.max(0, v)) * 255).toString(16).padStart(2, "0")).join("")}`;
|
|
73
|
+
}
|
|
74
|
+
var toLinear = (c) => c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
|
|
75
|
+
var fromLinear = (c) => c <= 31308e-7 ? 12.92 * c : 1.055 * c ** (1 / 2.4) - 0.055;
|
|
76
|
+
function rgbToOklch([r, g, b]) {
|
|
77
|
+
const [lr, lg, lb] = [toLinear(r), toLinear(g), toLinear(b)];
|
|
78
|
+
const l_ = Math.cbrt(0.4122214708 * lr + 0.5363325363 * lg + 0.0514459929 * lb);
|
|
79
|
+
const m_ = Math.cbrt(0.2119034982 * lr + 0.6806995451 * lg + 0.1073969566 * lb);
|
|
80
|
+
const s_ = Math.cbrt(0.0883024619 * lr + 0.2817188376 * lg + 0.6299787005 * lb);
|
|
81
|
+
const L = 0.2104542553 * l_ + 0.793617785 * m_ - 0.0040720468 * s_;
|
|
82
|
+
const a = 1.9779984951 * l_ - 2.428592205 * m_ + 0.4505937099 * s_;
|
|
83
|
+
const bb = 0.0259040371 * l_ + 0.7827717662 * m_ - 0.808675766 * s_;
|
|
84
|
+
return { l: L, c: Math.hypot(a, bb), h: Math.atan2(bb, a) };
|
|
85
|
+
}
|
|
86
|
+
function oklchToRgbUnclamped({ l, c, h }) {
|
|
87
|
+
const a = c * Math.cos(h);
|
|
88
|
+
const b = c * Math.sin(h);
|
|
89
|
+
const l_ = (l + 0.3963377774 * a + 0.2158037573 * b) ** 3;
|
|
90
|
+
const m_ = (l - 0.1055613458 * a - 0.0638541728 * b) ** 3;
|
|
91
|
+
const s_ = (l - 0.0894841775 * a - 1.291485548 * b) ** 3;
|
|
92
|
+
return [
|
|
93
|
+
fromLinear(4.0767416621 * l_ - 3.3077115913 * m_ + 0.2309699292 * s_),
|
|
94
|
+
fromLinear(-1.2684380046 * l_ + 2.6097574011 * m_ - 0.3413193965 * s_),
|
|
95
|
+
fromLinear(-0.0041960863 * l_ - 0.7034186147 * m_ + 1.707614701 * s_)
|
|
96
|
+
];
|
|
97
|
+
}
|
|
98
|
+
var inGamut = (rgb) => rgb.every((v) => v >= -1e-4 && v <= 1 + 1e-4);
|
|
99
|
+
function oklchToRgb(color) {
|
|
100
|
+
const l = Math.min(1, Math.max(0, color.l));
|
|
101
|
+
let rgb = oklchToRgbUnclamped({ ...color, l });
|
|
102
|
+
if (inGamut(rgb)) return rgb;
|
|
103
|
+
let lo = 0;
|
|
104
|
+
let hi = color.c;
|
|
105
|
+
for (let i = 0; i < 20; i++) {
|
|
106
|
+
const mid = (lo + hi) / 2;
|
|
107
|
+
if (inGamut(oklchToRgbUnclamped({ l, c: mid, h: color.h }))) lo = mid;
|
|
108
|
+
else hi = mid;
|
|
109
|
+
}
|
|
110
|
+
rgb = oklchToRgbUnclamped({ l, c: lo, h: color.h });
|
|
111
|
+
return rgb;
|
|
112
|
+
}
|
|
113
|
+
function luminance([r, g, b]) {
|
|
114
|
+
return 0.2126 * toLinear(r) + 0.7152 * toLinear(g) + 0.0722 * toLinear(b);
|
|
115
|
+
}
|
|
116
|
+
function contrastRatio(a, b) {
|
|
117
|
+
const [la, lb] = [luminance(parseHex(a)), luminance(parseHex(b))];
|
|
118
|
+
return (Math.max(la, lb) + 0.05) / (Math.min(la, lb) + 0.05);
|
|
119
|
+
}
|
|
120
|
+
function blend(fg, alpha, bg) {
|
|
121
|
+
const [f, b] = [parseHex(fg), parseHex(bg)];
|
|
122
|
+
return toHex(f.map((v, i) => v * alpha + b[i] * (1 - alpha)));
|
|
123
|
+
}
|
|
124
|
+
var withL = (base, l, c = base.c) => toHex(oklchToRgb({ l, c, h: base.h }));
|
|
125
|
+
function findReadable(base, startL, step, backgrounds) {
|
|
126
|
+
let l = startL;
|
|
127
|
+
for (let i = 0; i < 40; i++) {
|
|
128
|
+
const hex = withL(base, l);
|
|
129
|
+
if (backgrounds.every((bg) => contrastRatio(hex, bg) >= 4.5)) return hex;
|
|
130
|
+
l = Math.min(1, Math.max(0, l + step));
|
|
131
|
+
}
|
|
132
|
+
return step < 0 ? import_tokens.palette.black : import_tokens.palette.white;
|
|
133
|
+
}
|
|
134
|
+
function pickContrast(solid) {
|
|
135
|
+
const white = import_tokens.palette.white;
|
|
136
|
+
const dark = import_tokens.palette.gray[900];
|
|
137
|
+
if (contrastRatio(white, solid) >= 4.5) return white;
|
|
138
|
+
return contrastRatio(dark, solid) >= contrastRatio(white, solid) ? dark : white;
|
|
139
|
+
}
|
|
140
|
+
var rgba = (hex, alpha) => {
|
|
141
|
+
const [r, g, b] = parseHex(hex).map((v) => Math.round(v * 255));
|
|
142
|
+
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
143
|
+
};
|
|
144
|
+
function createIntentColors(intent, color) {
|
|
145
|
+
const solid = toHex(parseHex(color));
|
|
146
|
+
const base = rgbToOklch(parseHex(solid));
|
|
147
|
+
const lightSubtle = withL(base, 0.97, Math.min(base.c, 0.12) * 0.3);
|
|
148
|
+
const lightSubtleHover = withL(base, 0.93, Math.min(base.c, 0.12) * 0.45);
|
|
149
|
+
const light = {
|
|
150
|
+
solid,
|
|
151
|
+
solidHover: withL(base, Math.max(0, base.l - 0.06)),
|
|
152
|
+
contrast: pickContrast(solid),
|
|
153
|
+
subtle: lightSubtle,
|
|
154
|
+
subtleHover: lightSubtleHover,
|
|
155
|
+
text: findReadable(base, Math.min(base.l, 0.55), -0.02, [import_tokens.lightColors.bg.default, lightSubtle, lightSubtleHover])
|
|
156
|
+
};
|
|
157
|
+
const darkBg = import_tokens.darkColors.bg.default;
|
|
158
|
+
const darkSolid = base.l < 0.5 ? withL(base, 0.55) : solid;
|
|
159
|
+
const darkBase = rgbToOklch(parseHex(darkSolid));
|
|
160
|
+
const darkSubtleOnBg = blend(darkSolid, 0.16, darkBg);
|
|
161
|
+
const darkSubtleHoverOnBg = blend(darkSolid, 0.26, darkBg);
|
|
162
|
+
const dark = {
|
|
163
|
+
solid: darkSolid,
|
|
164
|
+
solidHover: withL(darkBase, Math.min(1, darkBase.l + 0.06)),
|
|
165
|
+
contrast: pickContrast(darkSolid),
|
|
166
|
+
subtle: rgba(darkSolid, 0.16),
|
|
167
|
+
subtleHover: rgba(darkSolid, 0.26),
|
|
168
|
+
text: findReadable(darkBase, Math.max(darkBase.l, 0.75), 0.02, [darkBg, darkSubtleOnBg, darkSubtleHoverOnBg])
|
|
169
|
+
};
|
|
170
|
+
const focus = intent === "primary" ? { light: { border: { focus: light.solid } }, dark: { border: { focus: dark.solidHover } } } : void 0;
|
|
171
|
+
return {
|
|
172
|
+
light: { color: { [intent]: light, ...focus?.light } },
|
|
173
|
+
dark: { color: { [intent]: dark, ...focus?.dark } }
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// src/theme/createTheme.ts
|
|
178
|
+
var import_dynamic = require("@vanilla-extract/dynamic");
|
|
179
|
+
function deepMerge(target, source) {
|
|
180
|
+
if (!source) return target;
|
|
181
|
+
const out = { ...target };
|
|
182
|
+
for (const [key, value2] of Object.entries(source)) {
|
|
183
|
+
if (value2 === void 0) continue;
|
|
184
|
+
const prev = out[key];
|
|
185
|
+
out[key] = typeof value2 === "object" && typeof prev === "object" ? deepMerge(prev, value2) : value2;
|
|
186
|
+
}
|
|
187
|
+
return out;
|
|
188
|
+
}
|
|
189
|
+
function createTheme(...inputs) {
|
|
190
|
+
let light = {};
|
|
191
|
+
let dark = {};
|
|
192
|
+
for (const input3 of inputs) {
|
|
193
|
+
light = deepMerge(deepMerge(light, input3.common), input3.light);
|
|
194
|
+
dark = deepMerge(deepMerge(dark, input3.common), input3.dark);
|
|
195
|
+
}
|
|
196
|
+
return Object.freeze({ light, dark });
|
|
197
|
+
}
|
|
198
|
+
function mergeThemes(a, b) {
|
|
199
|
+
if (!a) return b;
|
|
200
|
+
if (!b) return a;
|
|
201
|
+
return createTheme(a, b);
|
|
202
|
+
}
|
|
203
|
+
function flatten(partial, contract, out) {
|
|
204
|
+
for (const [key, value2] of Object.entries(partial)) {
|
|
205
|
+
const target = contract[key];
|
|
206
|
+
if (target === void 0) continue;
|
|
207
|
+
if (typeof target === "string" && typeof value2 === "string") out[target] = value2;
|
|
208
|
+
else if (typeof target === "object" && typeof value2 === "object") flatten(value2, target, out);
|
|
209
|
+
}
|
|
210
|
+
return out;
|
|
211
|
+
}
|
|
212
|
+
function themeToStyle(theme, mode) {
|
|
213
|
+
if (!theme) return void 0;
|
|
214
|
+
const map = flatten(theme[mode], vars, {});
|
|
215
|
+
return Object.keys(map).length ? (0, import_dynamic.assignInlineVars)(map) : void 0;
|
|
216
|
+
}
|
|
57
217
|
|
|
58
218
|
// src/theme/ThemeProvider.tsx
|
|
59
219
|
var import_react = require("react");
|
|
@@ -69,15 +229,36 @@ var root = "sfyhlv1 sfyhlv0";
|
|
|
69
229
|
|
|
70
230
|
// src/theme/ThemeProvider.tsx
|
|
71
231
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
72
|
-
var ThemeContext = (0, import_react.createContext)("light");
|
|
73
|
-
var ThemeProvider = (0, import_react.forwardRef)(function ThemeProvider2({ theme
|
|
74
|
-
|
|
232
|
+
var ThemeContext = (0, import_react.createContext)({ theme: "light" });
|
|
233
|
+
var ThemeProvider = (0, import_react.forwardRef)(function ThemeProvider2({ theme: themeProp, overrides, className, style, children, ...rest }, ref) {
|
|
234
|
+
const parent = (0, import_react.useContext)(ThemeContext);
|
|
235
|
+
const theme = themeProp ?? parent.theme;
|
|
236
|
+
const merged = (0, import_react.useMemo)(() => mergeThemes(parent.overrides, overrides), [parent.overrides, overrides]);
|
|
237
|
+
const value2 = (0, import_react.useMemo)(
|
|
238
|
+
() => ({ theme, overrides: merged, style: themeToStyle(merged, theme) }),
|
|
239
|
+
[theme, merged]
|
|
240
|
+
);
|
|
241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThemeContext.Provider, { value: value2, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
242
|
+
"div",
|
|
243
|
+
{
|
|
244
|
+
ref,
|
|
245
|
+
"data-theme": theme,
|
|
246
|
+
className: cx(themeClass[theme], root, className),
|
|
247
|
+
style: value2.style ? { ...value2.style, ...style } : style,
|
|
248
|
+
...rest,
|
|
249
|
+
children
|
|
250
|
+
}
|
|
251
|
+
) });
|
|
75
252
|
});
|
|
76
253
|
function useTheme() {
|
|
77
|
-
return (0, import_react.useContext)(ThemeContext);
|
|
254
|
+
return (0, import_react.useContext)(ThemeContext).theme;
|
|
255
|
+
}
|
|
256
|
+
function usePortalProps() {
|
|
257
|
+
const { theme, style } = (0, import_react.useContext)(ThemeContext);
|
|
258
|
+
return { className: cx(themeClass[theme], portal), style };
|
|
78
259
|
}
|
|
79
260
|
function usePortalClassName() {
|
|
80
|
-
return
|
|
261
|
+
return usePortalProps().className;
|
|
81
262
|
}
|
|
82
263
|
|
|
83
264
|
// src/components/Button/Button.tsx
|
|
@@ -256,15 +437,16 @@ function Modal({
|
|
|
256
437
|
closeOnOverlayClick = true,
|
|
257
438
|
className
|
|
258
439
|
}) {
|
|
259
|
-
const
|
|
440
|
+
const portal2 = usePortalProps();
|
|
260
441
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Dialog.Root, { open, defaultOpen, onOpenChange, children: [
|
|
261
442
|
trigger2 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Dialog.Trigger, { asChild: true, children: trigger2 }),
|
|
262
443
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Dialog.Portal, { children: [
|
|
263
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Dialog.Overlay, { className: cx(
|
|
444
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Dialog.Overlay, { className: cx(portal2.className, overlay), style: portal2.style }),
|
|
264
445
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
265
446
|
Dialog.Content,
|
|
266
447
|
{
|
|
267
|
-
className: cx(
|
|
448
|
+
className: cx(portal2.className, content({ size }), className),
|
|
449
|
+
style: portal2.style,
|
|
268
450
|
onPointerDownOutside: closeOnOverlayClick ? void 0 : (event) => event.preventDefault(),
|
|
269
451
|
...description3 ? {} : { "aria-describedby": void 0 },
|
|
270
452
|
children: [
|
|
@@ -301,28 +483,30 @@ var viewport = "_1kx81e84";
|
|
|
301
483
|
|
|
302
484
|
// src/components/Select/Select.tsx
|
|
303
485
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
304
|
-
var Select = (0, import_react6.forwardRef)(function Select2({
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
486
|
+
var Select = (0, import_react6.forwardRef)(function Select2(props, ref) {
|
|
487
|
+
const {
|
|
488
|
+
options,
|
|
489
|
+
value: value2,
|
|
490
|
+
defaultValue,
|
|
491
|
+
onValueChange,
|
|
492
|
+
placeholder,
|
|
493
|
+
label: label2,
|
|
494
|
+
helperText: helperText2,
|
|
495
|
+
error,
|
|
496
|
+
size,
|
|
497
|
+
fullWidth,
|
|
498
|
+
disabled,
|
|
499
|
+
required,
|
|
500
|
+
name,
|
|
501
|
+
id,
|
|
502
|
+
"aria-label": ariaLabel,
|
|
503
|
+
className
|
|
504
|
+
} = props;
|
|
505
|
+
const isControlled = "value" in props;
|
|
322
506
|
const generatedId = (0, import_react6.useId)();
|
|
323
507
|
const triggerId = id ?? generatedId;
|
|
324
508
|
const helperId = helperText2 ? `${triggerId}-helper` : void 0;
|
|
325
|
-
const
|
|
509
|
+
const portal2 = usePortalProps();
|
|
326
510
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
|
|
327
511
|
label2 && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { htmlFor: triggerId, className: label, children: [
|
|
328
512
|
label2,
|
|
@@ -331,7 +515,7 @@ var Select = (0, import_react6.forwardRef)(function Select2({
|
|
|
331
515
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
332
516
|
RadixSelect.Root,
|
|
333
517
|
{
|
|
334
|
-
value: value2,
|
|
518
|
+
value: isControlled ? value2 ?? "" : void 0,
|
|
335
519
|
defaultValue,
|
|
336
520
|
onValueChange,
|
|
337
521
|
disabled,
|
|
@@ -360,7 +544,8 @@ var Select = (0, import_react6.forwardRef)(function Select2({
|
|
|
360
544
|
position: "popper",
|
|
361
545
|
sideOffset: 4,
|
|
362
546
|
collisionPadding: 8,
|
|
363
|
-
className: cx(
|
|
547
|
+
className: cx(portal2.className, content2),
|
|
548
|
+
style: portal2.style,
|
|
364
549
|
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(RadixSelect.Viewport, { className: viewport, children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
365
550
|
RadixSelect.Item,
|
|
366
551
|
{
|
|
@@ -424,7 +609,7 @@ var ToastContext = (0, import_react8.createContext)(null);
|
|
|
424
609
|
function ToastProvider({ children, duration = 5e3, label: label2 = "\uC54C\uB9BC" }) {
|
|
425
610
|
const [toasts, setToasts] = (0, import_react8.useState)([]);
|
|
426
611
|
const nextId = (0, import_react8.useRef)(0);
|
|
427
|
-
const
|
|
612
|
+
const portal2 = usePortalProps();
|
|
428
613
|
const toast2 = (0, import_react8.useCallback)((options) => {
|
|
429
614
|
const id = nextId.current++;
|
|
430
615
|
setToasts((prev) => [...prev, { ...options, id, open: true }]);
|
|
@@ -456,7 +641,7 @@ function ToastProvider({ children, duration = 5e3, label: label2 = "\uC54C\uB9BC
|
|
|
456
641
|
},
|
|
457
642
|
id
|
|
458
643
|
)),
|
|
459
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(RadixToast.Viewport, { className: cx(
|
|
644
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(RadixToast.Viewport, { className: cx(portal2.className, viewport2), style: portal2.style })
|
|
460
645
|
] }) });
|
|
461
646
|
}
|
|
462
647
|
function useToast() {
|
|
@@ -486,7 +671,7 @@ function Tooltip({
|
|
|
486
671
|
disabled,
|
|
487
672
|
className
|
|
488
673
|
}) {
|
|
489
|
-
const
|
|
674
|
+
const portal2 = usePortalProps();
|
|
490
675
|
if (disabled || content4 == null || content4 === "") return children;
|
|
491
676
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RadixTooltip.Provider, { delayDuration: delay, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(RadixTooltip.Root, { open, defaultOpen, onOpenChange, children: [
|
|
492
677
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RadixTooltip.Trigger, { asChild: true, children }),
|
|
@@ -497,7 +682,8 @@ function Tooltip({
|
|
|
497
682
|
align,
|
|
498
683
|
sideOffset: 6,
|
|
499
684
|
collisionPadding: 8,
|
|
500
|
-
className: cx(
|
|
685
|
+
className: cx(portal2.className, content3, className),
|
|
686
|
+
style: portal2.style,
|
|
501
687
|
children: [
|
|
502
688
|
content4,
|
|
503
689
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RadixTooltip.Arrow, { className: arrow, width: 10, height: 5 })
|
|
@@ -552,8 +738,12 @@ var Typography = (0, import_react9.forwardRef)(function Typography2({ variant =
|
|
|
552
738
|
ToastProvider,
|
|
553
739
|
Tooltip,
|
|
554
740
|
Typography,
|
|
741
|
+
contrastRatio,
|
|
742
|
+
createIntentColors,
|
|
743
|
+
createTheme,
|
|
555
744
|
themeClass,
|
|
556
745
|
usePortalClassName,
|
|
746
|
+
usePortalProps,
|
|
557
747
|
useTheme,
|
|
558
748
|
useToast,
|
|
559
749
|
vars
|