@sero-ai/ui 0.4.2 → 0.6.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/.turbo/turbo-build.log +636 -628
- package/.turbo/turbo-test.log +12 -11
- package/.turbo/turbo-typecheck.log +1 -1
- package/CHANGELOG.md +20 -2
- package/dist/components/ai-elements/conversation-virtual.cjs +115 -0
- package/dist/components/ai-elements/conversation-virtual.d.cts +30 -0
- package/dist/components/ai-elements/conversation-virtual.d.ts +30 -0
- package/dist/components/ai-elements/conversation-virtual.js +115 -0
- package/dist/components/model-selection/available-model-picker.cjs +21 -77
- package/dist/components/model-selection/available-model-picker.js +22 -78
- package/dist/components/model-selection/model-picker-body.cjs +106 -0
- package/dist/components/model-selection/model-picker-body.d.cts +41 -0
- package/dist/components/model-selection/model-picker-body.d.ts +41 -0
- package/dist/components/model-selection/model-picker-body.js +106 -0
- package/dist/components/model-selection/thinking-level-picker.cjs +7 -3
- package/dist/components/model-selection/thinking-level-picker.js +7 -3
- package/dist/components/model-selection/thinking-picker.cjs +1 -1
- package/dist/components/model-selection/thinking-picker.js +1 -1
- package/dist/components/ui/calendar.cjs +1 -1
- package/dist/components/ui/calendar.js +1 -1
- package/dist/components/ui/combobox.cjs +1 -1
- package/dist/components/ui/combobox.js +1 -1
- package/dist/components/ui/form.d.cts +2 -2
- package/dist/components/ui/form.d.ts +2 -2
- package/dist/components/ui/input-group.cjs +1 -1
- package/dist/components/ui/input-group.js +1 -1
- package/dist/components/ui/input-otp.cjs +1 -1
- package/dist/components/ui/input-otp.js +1 -1
- package/dist/components/ui/input.cjs +3 -3
- package/dist/components/ui/input.js +3 -3
- package/dist/components/ui/native-select.cjs +2 -2
- package/dist/components/ui/native-select.js +2 -2
- package/dist/components/ui/select.cjs +1 -1
- package/dist/components/ui/select.js +1 -1
- package/dist/components/ui/slider.cjs +6 -0
- package/dist/components/ui/slider.d.cts +1 -1
- package/dist/components/ui/slider.d.ts +1 -1
- package/dist/components/ui/slider.js +6 -0
- package/dist/components/ui/spinner.d.cts +2 -1
- package/dist/components/ui/spinner.d.ts +2 -1
- package/dist/components/ui/textarea.cjs +1 -1
- package/dist/components/ui/textarea.js +1 -1
- package/dist/index.cjs +0 -55
- package/dist/index.d.cts +2 -66
- package/dist/index.d.ts +2 -66
- package/dist/index.js +0 -55
- package/dist/reference.cjs +56 -83
- package/dist/reference.js +56 -83
- package/dist/styles/ai-elements.css +2 -0
- package/dist/styles/context-editor.css +2 -0
- package/dist/styles/globals.css +32 -0
- package/dist/styles/model-selection.css +2 -0
- package/dist/styles/plugin.css +4 -1
- package/dist/theme/apply-theme.cjs +65 -12
- package/dist/theme/apply-theme.js +55 -2
- package/dist/theme/index.d.cts +1 -1
- package/dist/theme/index.d.ts +1 -1
- package/dist/theme/types.cjs +15 -2
- package/dist/theme/types.d.cts +21 -1
- package/dist/theme/types.d.ts +21 -1
- package/dist/theme/types.js +14 -1
- package/package.json +44 -30
- package/scripts/smoke-dist.mjs +106 -4
- package/src/components/ai-elements/conversation-virtual.test.tsx +126 -0
- package/src/components/ai-elements/conversation-virtual.tsx +162 -0
- package/src/components/model-selection/available-model-picker.tsx +26 -98
- package/src/components/model-selection/model-picker-body.test.tsx +152 -0
- package/src/components/model-selection/model-picker-body.tsx +188 -0
- package/src/components/model-selection/thinking-level-picker.tsx +9 -3
- package/src/components/model-selection/thinking-picker.test.tsx +41 -0
- package/src/components/model-selection/thinking-picker.tsx +1 -1
- package/src/components/ui/calendar.test.tsx +43 -0
- package/src/components/ui/calendar.tsx +1 -1
- package/src/components/ui/combobox.tsx +1 -1
- package/src/components/ui/input-group.tsx +1 -1
- package/src/components/ui/input-otp.tsx +1 -1
- package/src/components/ui/input.tsx +3 -3
- package/src/components/ui/native-select.tsx +2 -2
- package/src/components/ui/select.tsx +1 -1
- package/src/components/ui/slider.tsx +6 -0
- package/src/components/ui/spinner.tsx +1 -1
- package/src/components/ui/textarea.tsx +1 -1
- package/src/index.ts +4 -63
- package/src/styles/ai-elements.css +2 -0
- package/src/styles/context-editor.css +2 -0
- package/src/styles/globals.css +32 -0
- package/src/styles/model-selection.css +2 -0
- package/src/styles/plugin.css +4 -1
- package/src/theme/apply-theme.test.ts +126 -0
- package/src/theme/apply-theme.ts +66 -3
- package/src/theme/types.ts +33 -0
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _types = require('./types');
|
|
5
|
+
const COLOR_TOKEN_TO_CSS = {
|
|
2
6
|
bgBase: "--bg-base",
|
|
3
7
|
bgSurface: "--bg-surface",
|
|
4
8
|
bgElevated: "--bg-elevated",
|
|
@@ -67,6 +71,31 @@ const DERIVED_OPACITY_VARS = [
|
|
|
67
71
|
function tint(color, percentage) {
|
|
68
72
|
return `color-mix(in srgb, ${color} ${percentage}%, transparent)`;
|
|
69
73
|
}
|
|
74
|
+
function applyGlassEffect(root, glass, colors) {
|
|
75
|
+
const enabled = _optionalChain([glass, 'optionalAccess', _ => _.enabled]) === true;
|
|
76
|
+
root.classList.toggle("theme-glass", enabled);
|
|
77
|
+
root.style.removeProperty("--window-glass-opaque-base");
|
|
78
|
+
root.style.removeProperty("--window-glass-sidebar");
|
|
79
|
+
root.style.removeProperty("--window-glass-opaque-surface");
|
|
80
|
+
root.style.removeProperty("--window-glass-opaque-elevated");
|
|
81
|
+
if (!enabled) return;
|
|
82
|
+
const opacity = Math.min(1, Math.max(0, glass.opacity));
|
|
83
|
+
const percentage = Math.round(opacity * 100);
|
|
84
|
+
root.style.setProperty("--bg-base", tint(colors.bgBase, percentage));
|
|
85
|
+
root.style.setProperty(
|
|
86
|
+
"--window-glass-sidebar",
|
|
87
|
+
tint(colors.bgSurface, (_nullishCoalesce(glass.sidebarOpacity, () => ( _types.DEFAULT_GLASS_EFFECT.sidebarOpacity))) * 100)
|
|
88
|
+
);
|
|
89
|
+
root.style.setProperty("--window-glass-opaque-base", colors.bgBase);
|
|
90
|
+
root.style.setProperty("--window-glass-opaque-surface", colors.bgSurface);
|
|
91
|
+
root.style.setProperty("--window-glass-opaque-elevated", colors.bgElevated);
|
|
92
|
+
root.style.setProperty("--bg-surface", tint(colors.bgSurface, (_nullishCoalesce(glass.surfaceOpacity, () => ( _types.DEFAULT_GLASS_EFFECT.surfaceOpacity))) * 100));
|
|
93
|
+
root.style.setProperty("--bg-elevated", tint(colors.textPrimary, (_nullishCoalesce(glass.selectionOpacity, () => ( _types.DEFAULT_GLASS_EFFECT.selectionOpacity))) * 100));
|
|
94
|
+
root.style.setProperty("--text-muted", colors.textSecondary);
|
|
95
|
+
const border = (_nullishCoalesce(glass.borderOpacity, () => ( _types.DEFAULT_GLASS_EFFECT.borderOpacity))) * 100;
|
|
96
|
+
root.style.setProperty("--border-subtle", tint(colors.textPrimary, border * 2 / 3));
|
|
97
|
+
root.style.setProperty("--border-default", tint(colors.textPrimary, border));
|
|
98
|
+
}
|
|
70
99
|
function applyThemePreset(preset, mode, options = {}) {
|
|
71
100
|
const root = document.documentElement;
|
|
72
101
|
const colors = mode === "dark" ? preset.colors.dark : preset.colors.light;
|
|
@@ -78,26 +107,27 @@ function applyThemePreset(preset, mode, options = {}) {
|
|
|
78
107
|
const baseColor = colors[baseKey];
|
|
79
108
|
if (baseColor) root.style.setProperty(cssVar, tint(baseColor, percentage));
|
|
80
109
|
}
|
|
81
|
-
if (_optionalChain([preset, 'access',
|
|
82
|
-
_optionalChain([options, 'access',
|
|
110
|
+
if (_optionalChain([preset, 'access', _2 => _2.typography, 'optionalAccess', _3 => _3.fontSans])) {
|
|
111
|
+
_optionalChain([options, 'access', _4 => _4.loadFont, 'optionalCall', _5 => _5(preset.typography.fontSans)]);
|
|
83
112
|
root.style.setProperty("--font-sans", preset.typography.fontSans);
|
|
84
113
|
}
|
|
85
|
-
if (_optionalChain([preset, 'access',
|
|
86
|
-
_optionalChain([options, 'access',
|
|
114
|
+
if (_optionalChain([preset, 'access', _6 => _6.typography, 'optionalAccess', _7 => _7.fontMono])) {
|
|
115
|
+
_optionalChain([options, 'access', _8 => _8.loadFont, 'optionalCall', _9 => _9(preset.typography.fontMono)]);
|
|
87
116
|
root.style.setProperty("--font-mono", preset.typography.fontMono);
|
|
88
117
|
}
|
|
89
|
-
if (_optionalChain([preset, 'access',
|
|
118
|
+
if (_optionalChain([preset, 'access', _10 => _10.typography, 'optionalAccess', _11 => _11.fontSizeBase])) {
|
|
90
119
|
root.style.setProperty("--font-size-base", preset.typography.fontSizeBase);
|
|
91
120
|
}
|
|
92
|
-
if (_optionalChain([preset, 'access',
|
|
121
|
+
if (_optionalChain([preset, 'access', _12 => _12.spacing, 'optionalAccess', _13 => _13.md])) {
|
|
93
122
|
const mdPx = parseFloat(preset.spacing.md);
|
|
94
123
|
if (Number.isFinite(mdPx) && mdPx > 0) {
|
|
95
124
|
root.style.setProperty("--spacing", `${(mdPx / 3).toFixed(3)}px`);
|
|
96
125
|
}
|
|
97
126
|
}
|
|
98
|
-
if (_optionalChain([preset, 'access',
|
|
127
|
+
if (_optionalChain([preset, 'access', _14 => _14.radius, 'optionalAccess', _15 => _15.md])) {
|
|
99
128
|
root.style.setProperty("--radius", preset.radius.md);
|
|
100
129
|
}
|
|
130
|
+
applyGlassEffect(root, preset.glass, colors);
|
|
101
131
|
root.classList.toggle("dark", mode === "dark");
|
|
102
132
|
}
|
|
103
133
|
const ALL_MANAGED_VARS = [
|
|
@@ -107,13 +137,18 @@ const ALL_MANAGED_VARS = [
|
|
|
107
137
|
"--font-mono",
|
|
108
138
|
"--font-size-base",
|
|
109
139
|
"--spacing",
|
|
110
|
-
"--radius"
|
|
140
|
+
"--radius",
|
|
141
|
+
"--window-glass-opaque-base",
|
|
142
|
+
"--window-glass-sidebar",
|
|
143
|
+
"--window-glass-opaque-surface",
|
|
144
|
+
"--window-glass-opaque-elevated"
|
|
111
145
|
];
|
|
112
146
|
function resetTheme() {
|
|
113
147
|
const root = document.documentElement;
|
|
114
148
|
for (const cssVar of ALL_MANAGED_VARS) {
|
|
115
149
|
root.style.removeProperty(cssVar);
|
|
116
150
|
}
|
|
151
|
+
root.classList.remove("theme-glass");
|
|
117
152
|
}
|
|
118
153
|
const LEGACY_REQUIRED_COLOR_KEYS = [
|
|
119
154
|
"bgBase",
|
|
@@ -191,6 +226,23 @@ function sanitiseRadius(raw) {
|
|
|
191
226
|
}
|
|
192
227
|
return Object.keys(result).length > 0 ? result : void 0;
|
|
193
228
|
}
|
|
229
|
+
function sanitiseGlass(raw) {
|
|
230
|
+
if (!raw || typeof raw !== "object") return void 0;
|
|
231
|
+
const value = raw;
|
|
232
|
+
if (typeof value.enabled !== "boolean") return void 0;
|
|
233
|
+
const result = { ..._types.DEFAULT_GLASS_EFFECT, enabled: value.enabled };
|
|
234
|
+
for (const key of ["opacity", "sidebarOpacity", "surfaceOpacity", "selectionOpacity", "borderOpacity"]) {
|
|
235
|
+
const amount = value[key];
|
|
236
|
+
if (typeof amount === "number" && Number.isFinite(amount)) {
|
|
237
|
+
result[key] = Math.min(1, Math.max(0, amount));
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
if (typeof value.blurRadius === "number" && Number.isFinite(value.blurRadius)) {
|
|
241
|
+
result.blurRadius = Math.round(Math.min(64, Math.max(0, value.blurRadius)));
|
|
242
|
+
}
|
|
243
|
+
result.windowsMaterial = _nullishCoalesce(_types.WINDOWS_GLASS_MATERIALS.find((material) => material === value.windowsMaterial), () => ( _types.DEFAULT_GLASS_EFFECT.windowsMaterial));
|
|
244
|
+
return result;
|
|
245
|
+
}
|
|
194
246
|
function validateThemePreset(data) {
|
|
195
247
|
if (!data || typeof data !== "object") return null;
|
|
196
248
|
const d = data;
|
|
@@ -198,8 +250,8 @@ function validateThemePreset(data) {
|
|
|
198
250
|
if (typeof d.name !== "string" || !d.name) return null;
|
|
199
251
|
if (d.version !== 1) return null;
|
|
200
252
|
const colors = d.colors;
|
|
201
|
-
const light = normaliseColorTokens(_optionalChain([colors, 'optionalAccess',
|
|
202
|
-
const dark = normaliseColorTokens(_optionalChain([colors, 'optionalAccess',
|
|
253
|
+
const light = normaliseColorTokens(_optionalChain([colors, 'optionalAccess', _16 => _16.light]));
|
|
254
|
+
const dark = normaliseColorTokens(_optionalChain([colors, 'optionalAccess', _17 => _17.dark]));
|
|
203
255
|
if (!light || !dark) return null;
|
|
204
256
|
return {
|
|
205
257
|
id: d.id,
|
|
@@ -211,7 +263,8 @@ function validateThemePreset(data) {
|
|
|
211
263
|
colors: { light, dark },
|
|
212
264
|
typography: sanitiseTypography(d.typography),
|
|
213
265
|
spacing: sanitiseSpacing(d.spacing),
|
|
214
|
-
radius: sanitiseRadius(d.radius)
|
|
266
|
+
radius: sanitiseRadius(d.radius),
|
|
267
|
+
glass: sanitiseGlass(d.glass)
|
|
215
268
|
};
|
|
216
269
|
}
|
|
217
270
|
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_GLASS_EFFECT,
|
|
3
|
+
WINDOWS_GLASS_MATERIALS
|
|
4
|
+
} from "./types";
|
|
1
5
|
const COLOR_TOKEN_TO_CSS = {
|
|
2
6
|
bgBase: "--bg-base",
|
|
3
7
|
bgSurface: "--bg-surface",
|
|
@@ -67,6 +71,31 @@ const DERIVED_OPACITY_VARS = [
|
|
|
67
71
|
function tint(color, percentage) {
|
|
68
72
|
return `color-mix(in srgb, ${color} ${percentage}%, transparent)`;
|
|
69
73
|
}
|
|
74
|
+
function applyGlassEffect(root, glass, colors) {
|
|
75
|
+
const enabled = glass?.enabled === true;
|
|
76
|
+
root.classList.toggle("theme-glass", enabled);
|
|
77
|
+
root.style.removeProperty("--window-glass-opaque-base");
|
|
78
|
+
root.style.removeProperty("--window-glass-sidebar");
|
|
79
|
+
root.style.removeProperty("--window-glass-opaque-surface");
|
|
80
|
+
root.style.removeProperty("--window-glass-opaque-elevated");
|
|
81
|
+
if (!enabled) return;
|
|
82
|
+
const opacity = Math.min(1, Math.max(0, glass.opacity));
|
|
83
|
+
const percentage = Math.round(opacity * 100);
|
|
84
|
+
root.style.setProperty("--bg-base", tint(colors.bgBase, percentage));
|
|
85
|
+
root.style.setProperty(
|
|
86
|
+
"--window-glass-sidebar",
|
|
87
|
+
tint(colors.bgSurface, (glass.sidebarOpacity ?? DEFAULT_GLASS_EFFECT.sidebarOpacity) * 100)
|
|
88
|
+
);
|
|
89
|
+
root.style.setProperty("--window-glass-opaque-base", colors.bgBase);
|
|
90
|
+
root.style.setProperty("--window-glass-opaque-surface", colors.bgSurface);
|
|
91
|
+
root.style.setProperty("--window-glass-opaque-elevated", colors.bgElevated);
|
|
92
|
+
root.style.setProperty("--bg-surface", tint(colors.bgSurface, (glass.surfaceOpacity ?? DEFAULT_GLASS_EFFECT.surfaceOpacity) * 100));
|
|
93
|
+
root.style.setProperty("--bg-elevated", tint(colors.textPrimary, (glass.selectionOpacity ?? DEFAULT_GLASS_EFFECT.selectionOpacity) * 100));
|
|
94
|
+
root.style.setProperty("--text-muted", colors.textSecondary);
|
|
95
|
+
const border = (glass.borderOpacity ?? DEFAULT_GLASS_EFFECT.borderOpacity) * 100;
|
|
96
|
+
root.style.setProperty("--border-subtle", tint(colors.textPrimary, border * 2 / 3));
|
|
97
|
+
root.style.setProperty("--border-default", tint(colors.textPrimary, border));
|
|
98
|
+
}
|
|
70
99
|
function applyThemePreset(preset, mode, options = {}) {
|
|
71
100
|
const root = document.documentElement;
|
|
72
101
|
const colors = mode === "dark" ? preset.colors.dark : preset.colors.light;
|
|
@@ -98,6 +127,7 @@ function applyThemePreset(preset, mode, options = {}) {
|
|
|
98
127
|
if (preset.radius?.md) {
|
|
99
128
|
root.style.setProperty("--radius", preset.radius.md);
|
|
100
129
|
}
|
|
130
|
+
applyGlassEffect(root, preset.glass, colors);
|
|
101
131
|
root.classList.toggle("dark", mode === "dark");
|
|
102
132
|
}
|
|
103
133
|
const ALL_MANAGED_VARS = [
|
|
@@ -107,13 +137,18 @@ const ALL_MANAGED_VARS = [
|
|
|
107
137
|
"--font-mono",
|
|
108
138
|
"--font-size-base",
|
|
109
139
|
"--spacing",
|
|
110
|
-
"--radius"
|
|
140
|
+
"--radius",
|
|
141
|
+
"--window-glass-opaque-base",
|
|
142
|
+
"--window-glass-sidebar",
|
|
143
|
+
"--window-glass-opaque-surface",
|
|
144
|
+
"--window-glass-opaque-elevated"
|
|
111
145
|
];
|
|
112
146
|
function resetTheme() {
|
|
113
147
|
const root = document.documentElement;
|
|
114
148
|
for (const cssVar of ALL_MANAGED_VARS) {
|
|
115
149
|
root.style.removeProperty(cssVar);
|
|
116
150
|
}
|
|
151
|
+
root.classList.remove("theme-glass");
|
|
117
152
|
}
|
|
118
153
|
const LEGACY_REQUIRED_COLOR_KEYS = [
|
|
119
154
|
"bgBase",
|
|
@@ -191,6 +226,23 @@ function sanitiseRadius(raw) {
|
|
|
191
226
|
}
|
|
192
227
|
return Object.keys(result).length > 0 ? result : void 0;
|
|
193
228
|
}
|
|
229
|
+
function sanitiseGlass(raw) {
|
|
230
|
+
if (!raw || typeof raw !== "object") return void 0;
|
|
231
|
+
const value = raw;
|
|
232
|
+
if (typeof value.enabled !== "boolean") return void 0;
|
|
233
|
+
const result = { ...DEFAULT_GLASS_EFFECT, enabled: value.enabled };
|
|
234
|
+
for (const key of ["opacity", "sidebarOpacity", "surfaceOpacity", "selectionOpacity", "borderOpacity"]) {
|
|
235
|
+
const amount = value[key];
|
|
236
|
+
if (typeof amount === "number" && Number.isFinite(amount)) {
|
|
237
|
+
result[key] = Math.min(1, Math.max(0, amount));
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
if (typeof value.blurRadius === "number" && Number.isFinite(value.blurRadius)) {
|
|
241
|
+
result.blurRadius = Math.round(Math.min(64, Math.max(0, value.blurRadius)));
|
|
242
|
+
}
|
|
243
|
+
result.windowsMaterial = WINDOWS_GLASS_MATERIALS.find((material) => material === value.windowsMaterial) ?? DEFAULT_GLASS_EFFECT.windowsMaterial;
|
|
244
|
+
return result;
|
|
245
|
+
}
|
|
194
246
|
function validateThemePreset(data) {
|
|
195
247
|
if (!data || typeof data !== "object") return null;
|
|
196
248
|
const d = data;
|
|
@@ -211,7 +263,8 @@ function validateThemePreset(data) {
|
|
|
211
263
|
colors: { light, dark },
|
|
212
264
|
typography: sanitiseTypography(d.typography),
|
|
213
265
|
spacing: sanitiseSpacing(d.spacing),
|
|
214
|
-
radius: sanitiseRadius(d.radius)
|
|
266
|
+
radius: sanitiseRadius(d.radius),
|
|
267
|
+
glass: sanitiseGlass(d.glass)
|
|
215
268
|
};
|
|
216
269
|
}
|
|
217
270
|
export {
|
package/dist/theme/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ColorTokens, DEFAULT_DARK_COLORS, DEFAULT_LIGHT_COLORS, DEFAULT_RADIUS, DEFAULT_SPACING, DEFAULT_THEME_ID, DEFAULT_TYPOGRAPHY, RadiusTokens, SpacingTokens, TerminalColorTokens, ThemeMode, ThemePreset, ThemePresetMeta, TypographyTokens } from './types.cjs';
|
|
1
|
+
export { ColorTokens, DEFAULT_DARK_COLORS, DEFAULT_GLASS_EFFECT, DEFAULT_LIGHT_COLORS, DEFAULT_RADIUS, DEFAULT_SPACING, DEFAULT_THEME_ID, DEFAULT_TYPOGRAPHY, RadiusTokens, SpacingTokens, TerminalColorTokens, ThemeGlassEffect, ThemeMode, ThemePreset, ThemePresetMeta, TypographyTokens, WINDOWS_GLASS_MATERIALS, WindowsGlassMaterial } from './types.cjs';
|
|
2
2
|
export { ApplyThemeOptions, applyThemePreset, resetTheme, validateThemePreset } from './apply-theme.cjs';
|
package/dist/theme/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ColorTokens, DEFAULT_DARK_COLORS, DEFAULT_LIGHT_COLORS, DEFAULT_RADIUS, DEFAULT_SPACING, DEFAULT_THEME_ID, DEFAULT_TYPOGRAPHY, RadiusTokens, SpacingTokens, TerminalColorTokens, ThemeMode, ThemePreset, ThemePresetMeta, TypographyTokens } from './types.js';
|
|
1
|
+
export { ColorTokens, DEFAULT_DARK_COLORS, DEFAULT_GLASS_EFFECT, DEFAULT_LIGHT_COLORS, DEFAULT_RADIUS, DEFAULT_SPACING, DEFAULT_THEME_ID, DEFAULT_TYPOGRAPHY, RadiusTokens, SpacingTokens, TerminalColorTokens, ThemeGlassEffect, ThemeMode, ThemePreset, ThemePresetMeta, TypographyTokens, WINDOWS_GLASS_MATERIALS, WindowsGlassMaterial } from './types.js';
|
|
2
2
|
export { ApplyThemeOptions, applyThemePreset, resetTheme, validateThemePreset } from './apply-theme.js';
|
package/dist/theme/types.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});const
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});const WINDOWS_GLASS_MATERIALS = ["acrylic", "mica", "tabbed"];
|
|
2
|
+
const DEFAULT_THEME_ID = "default";
|
|
2
3
|
const DEFAULT_LIGHT_COLORS = {
|
|
3
4
|
bgBase: "#ffffff",
|
|
4
5
|
bgSurface: "#f4f5f7",
|
|
@@ -48,6 +49,16 @@ const DEFAULT_RADIUS = {
|
|
|
48
49
|
md: "8px",
|
|
49
50
|
lg: "12px"
|
|
50
51
|
};
|
|
52
|
+
const DEFAULT_GLASS_EFFECT = {
|
|
53
|
+
enabled: false,
|
|
54
|
+
opacity: 0.78,
|
|
55
|
+
blurRadius: 24,
|
|
56
|
+
windowsMaterial: "acrylic",
|
|
57
|
+
sidebarOpacity: 0.08,
|
|
58
|
+
surfaceOpacity: 0.18,
|
|
59
|
+
selectionOpacity: 0.08,
|
|
60
|
+
borderOpacity: 0.18
|
|
61
|
+
};
|
|
51
62
|
const DEFAULT_DARK_COLORS = {
|
|
52
63
|
bgBase: "#0a0a0b",
|
|
53
64
|
bgSurface: "#111113",
|
|
@@ -87,4 +98,6 @@ const DEFAULT_DARK_COLORS = {
|
|
|
87
98
|
|
|
88
99
|
|
|
89
100
|
|
|
90
|
-
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
exports.DEFAULT_DARK_COLORS = DEFAULT_DARK_COLORS; exports.DEFAULT_GLASS_EFFECT = DEFAULT_GLASS_EFFECT; exports.DEFAULT_LIGHT_COLORS = DEFAULT_LIGHT_COLORS; exports.DEFAULT_RADIUS = DEFAULT_RADIUS; exports.DEFAULT_SPACING = DEFAULT_SPACING; exports.DEFAULT_THEME_ID = DEFAULT_THEME_ID; exports.DEFAULT_TYPOGRAPHY = DEFAULT_TYPOGRAPHY; exports.WINDOWS_GLASS_MATERIALS = WINDOWS_GLASS_MATERIALS;
|
package/dist/theme/types.d.cts
CHANGED
|
@@ -78,6 +78,23 @@ interface RadiusTokens {
|
|
|
78
78
|
md?: string;
|
|
79
79
|
lg?: string;
|
|
80
80
|
}
|
|
81
|
+
declare const WINDOWS_GLASS_MATERIALS: readonly ["acrylic", "mica", "tabbed"];
|
|
82
|
+
type WindowsGlassMaterial = typeof WINDOWS_GLASS_MATERIALS[number];
|
|
83
|
+
interface ThemeGlassEffect {
|
|
84
|
+
/** Show the desktop through Sero's surfaces. */
|
|
85
|
+
enabled: boolean;
|
|
86
|
+
/** Window tint opacity from 0 to 1. */
|
|
87
|
+
opacity: number;
|
|
88
|
+
/** Direct macOS desktop blur radius, from 0 to 64 pixels. */
|
|
89
|
+
blurRadius?: number;
|
|
90
|
+
/** Windows 11 system backdrop. */
|
|
91
|
+
windowsMaterial?: WindowsGlassMaterial;
|
|
92
|
+
/** Independent local layer opacities from 0 to 1. */
|
|
93
|
+
sidebarOpacity?: number;
|
|
94
|
+
surfaceOpacity?: number;
|
|
95
|
+
selectionOpacity?: number;
|
|
96
|
+
borderOpacity?: number;
|
|
97
|
+
}
|
|
81
98
|
interface ThemePreset {
|
|
82
99
|
/** Unique ID (slug or uuid). */
|
|
83
100
|
id: string;
|
|
@@ -107,6 +124,8 @@ interface ThemePreset {
|
|
|
107
124
|
spacing?: SpacingTokens;
|
|
108
125
|
/** Border radius overrides. */
|
|
109
126
|
radius?: RadiusTokens;
|
|
127
|
+
/** Optional translucent desktop window treatment. */
|
|
128
|
+
glass?: ThemeGlassEffect;
|
|
110
129
|
}
|
|
111
130
|
/** Lightweight metadata for listing presets without loading full data. */
|
|
112
131
|
interface ThemePresetMeta {
|
|
@@ -127,7 +146,8 @@ declare const DEFAULT_TYPOGRAPHY: Required<TypographyTokens>;
|
|
|
127
146
|
declare const DEFAULT_SPACING: Required<SpacingTokens>;
|
|
128
147
|
/** Default radius matching globals.css values. */
|
|
129
148
|
declare const DEFAULT_RADIUS: Required<RadiusTokens>;
|
|
149
|
+
declare const DEFAULT_GLASS_EFFECT: Required<ThemeGlassEffect>;
|
|
130
150
|
/** Default colour tokens matching globals.css .dark values. */
|
|
131
151
|
declare const DEFAULT_DARK_COLORS: ColorTokens;
|
|
132
152
|
|
|
133
|
-
export { type ColorTokens, DEFAULT_DARK_COLORS, DEFAULT_LIGHT_COLORS, DEFAULT_RADIUS, DEFAULT_SPACING, DEFAULT_THEME_ID, DEFAULT_TYPOGRAPHY, type RadiusTokens, type SpacingTokens, type TerminalColorTokens, type ThemeMode, type ThemePreset, type ThemePresetMeta, type TypographyTokens };
|
|
153
|
+
export { type ColorTokens, DEFAULT_DARK_COLORS, DEFAULT_GLASS_EFFECT, DEFAULT_LIGHT_COLORS, DEFAULT_RADIUS, DEFAULT_SPACING, DEFAULT_THEME_ID, DEFAULT_TYPOGRAPHY, type RadiusTokens, type SpacingTokens, type TerminalColorTokens, type ThemeGlassEffect, type ThemeMode, type ThemePreset, type ThemePresetMeta, type TypographyTokens, WINDOWS_GLASS_MATERIALS, type WindowsGlassMaterial };
|
package/dist/theme/types.d.ts
CHANGED
|
@@ -78,6 +78,23 @@ interface RadiusTokens {
|
|
|
78
78
|
md?: string;
|
|
79
79
|
lg?: string;
|
|
80
80
|
}
|
|
81
|
+
declare const WINDOWS_GLASS_MATERIALS: readonly ["acrylic", "mica", "tabbed"];
|
|
82
|
+
type WindowsGlassMaterial = typeof WINDOWS_GLASS_MATERIALS[number];
|
|
83
|
+
interface ThemeGlassEffect {
|
|
84
|
+
/** Show the desktop through Sero's surfaces. */
|
|
85
|
+
enabled: boolean;
|
|
86
|
+
/** Window tint opacity from 0 to 1. */
|
|
87
|
+
opacity: number;
|
|
88
|
+
/** Direct macOS desktop blur radius, from 0 to 64 pixels. */
|
|
89
|
+
blurRadius?: number;
|
|
90
|
+
/** Windows 11 system backdrop. */
|
|
91
|
+
windowsMaterial?: WindowsGlassMaterial;
|
|
92
|
+
/** Independent local layer opacities from 0 to 1. */
|
|
93
|
+
sidebarOpacity?: number;
|
|
94
|
+
surfaceOpacity?: number;
|
|
95
|
+
selectionOpacity?: number;
|
|
96
|
+
borderOpacity?: number;
|
|
97
|
+
}
|
|
81
98
|
interface ThemePreset {
|
|
82
99
|
/** Unique ID (slug or uuid). */
|
|
83
100
|
id: string;
|
|
@@ -107,6 +124,8 @@ interface ThemePreset {
|
|
|
107
124
|
spacing?: SpacingTokens;
|
|
108
125
|
/** Border radius overrides. */
|
|
109
126
|
radius?: RadiusTokens;
|
|
127
|
+
/** Optional translucent desktop window treatment. */
|
|
128
|
+
glass?: ThemeGlassEffect;
|
|
110
129
|
}
|
|
111
130
|
/** Lightweight metadata for listing presets without loading full data. */
|
|
112
131
|
interface ThemePresetMeta {
|
|
@@ -127,7 +146,8 @@ declare const DEFAULT_TYPOGRAPHY: Required<TypographyTokens>;
|
|
|
127
146
|
declare const DEFAULT_SPACING: Required<SpacingTokens>;
|
|
128
147
|
/** Default radius matching globals.css values. */
|
|
129
148
|
declare const DEFAULT_RADIUS: Required<RadiusTokens>;
|
|
149
|
+
declare const DEFAULT_GLASS_EFFECT: Required<ThemeGlassEffect>;
|
|
130
150
|
/** Default colour tokens matching globals.css .dark values. */
|
|
131
151
|
declare const DEFAULT_DARK_COLORS: ColorTokens;
|
|
132
152
|
|
|
133
|
-
export { type ColorTokens, DEFAULT_DARK_COLORS, DEFAULT_LIGHT_COLORS, DEFAULT_RADIUS, DEFAULT_SPACING, DEFAULT_THEME_ID, DEFAULT_TYPOGRAPHY, type RadiusTokens, type SpacingTokens, type TerminalColorTokens, type ThemeMode, type ThemePreset, type ThemePresetMeta, type TypographyTokens };
|
|
153
|
+
export { type ColorTokens, DEFAULT_DARK_COLORS, DEFAULT_GLASS_EFFECT, DEFAULT_LIGHT_COLORS, DEFAULT_RADIUS, DEFAULT_SPACING, DEFAULT_THEME_ID, DEFAULT_TYPOGRAPHY, type RadiusTokens, type SpacingTokens, type TerminalColorTokens, type ThemeGlassEffect, type ThemeMode, type ThemePreset, type ThemePresetMeta, type TypographyTokens, WINDOWS_GLASS_MATERIALS, type WindowsGlassMaterial };
|
package/dist/theme/types.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const WINDOWS_GLASS_MATERIALS = ["acrylic", "mica", "tabbed"];
|
|
1
2
|
const DEFAULT_THEME_ID = "default";
|
|
2
3
|
const DEFAULT_LIGHT_COLORS = {
|
|
3
4
|
bgBase: "#ffffff",
|
|
@@ -48,6 +49,16 @@ const DEFAULT_RADIUS = {
|
|
|
48
49
|
md: "8px",
|
|
49
50
|
lg: "12px"
|
|
50
51
|
};
|
|
52
|
+
const DEFAULT_GLASS_EFFECT = {
|
|
53
|
+
enabled: false,
|
|
54
|
+
opacity: 0.78,
|
|
55
|
+
blurRadius: 24,
|
|
56
|
+
windowsMaterial: "acrylic",
|
|
57
|
+
sidebarOpacity: 0.08,
|
|
58
|
+
surfaceOpacity: 0.18,
|
|
59
|
+
selectionOpacity: 0.08,
|
|
60
|
+
borderOpacity: 0.18
|
|
61
|
+
};
|
|
51
62
|
const DEFAULT_DARK_COLORS = {
|
|
52
63
|
bgBase: "#0a0a0b",
|
|
53
64
|
bgSurface: "#111113",
|
|
@@ -82,9 +93,11 @@ const DEFAULT_DARK_COLORS = {
|
|
|
82
93
|
};
|
|
83
94
|
export {
|
|
84
95
|
DEFAULT_DARK_COLORS,
|
|
96
|
+
DEFAULT_GLASS_EFFECT,
|
|
85
97
|
DEFAULT_LIGHT_COLORS,
|
|
86
98
|
DEFAULT_RADIUS,
|
|
87
99
|
DEFAULT_SPACING,
|
|
88
100
|
DEFAULT_THEME_ID,
|
|
89
|
-
DEFAULT_TYPOGRAPHY
|
|
101
|
+
DEFAULT_TYPOGRAPHY,
|
|
102
|
+
WINDOWS_GLASS_MATERIALS
|
|
90
103
|
};
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sero-ai/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Shared UI components, AI elements, and design tokens for the Sero platform",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"**/*.css"
|
|
8
|
+
],
|
|
6
9
|
"main": "./dist/index.js",
|
|
7
10
|
"types": "./dist/index.d.ts",
|
|
8
11
|
"exports": {
|
|
@@ -11,6 +14,16 @@
|
|
|
11
14
|
"import": "./dist/index.js",
|
|
12
15
|
"require": "./dist/index.cjs"
|
|
13
16
|
},
|
|
17
|
+
"./ai-elements/*": {
|
|
18
|
+
"types": "./dist/components/ai-elements/*.d.ts",
|
|
19
|
+
"import": "./dist/components/ai-elements/*.js",
|
|
20
|
+
"require": "./dist/components/ai-elements/*.cjs"
|
|
21
|
+
},
|
|
22
|
+
"./model-selection/*": {
|
|
23
|
+
"types": "./dist/components/model-selection/*.d.ts",
|
|
24
|
+
"import": "./dist/components/model-selection/*.js",
|
|
25
|
+
"require": "./dist/components/model-selection/*.cjs"
|
|
26
|
+
},
|
|
14
27
|
"./dashboard-catalog.json": "./dist/components/dashboard/catalog.json",
|
|
15
28
|
"./reference": {
|
|
16
29
|
"types": "./dist/reference.d.ts",
|
|
@@ -36,67 +49,68 @@
|
|
|
36
49
|
}
|
|
37
50
|
},
|
|
38
51
|
"peerDependencies": {
|
|
39
|
-
"react": "^19.2.
|
|
40
|
-
"react-dom": "^19.2.
|
|
52
|
+
"react": "^19.2.8",
|
|
53
|
+
"react-dom": "^19.2.8"
|
|
41
54
|
},
|
|
42
55
|
"dependencies": {
|
|
43
|
-
"@base-ui/react": "^1.
|
|
44
|
-
"@headless-tree/core": "^1.
|
|
45
|
-
"@headless-tree/react": "^1.
|
|
46
|
-
"@radix-ui/react-use-controllable-state": "^1.2.
|
|
56
|
+
"@base-ui/react": "^1.7.0",
|
|
57
|
+
"@headless-tree/core": "^1.7.0",
|
|
58
|
+
"@headless-tree/react": "^1.7.0",
|
|
59
|
+
"@radix-ui/react-use-controllable-state": "^1.2.5",
|
|
47
60
|
"@remixicon/react": "^4.9.0",
|
|
48
|
-
"@rive-app/react-webgl2": "^4.
|
|
61
|
+
"@rive-app/react-webgl2": "^4.31.0",
|
|
49
62
|
"@streamdown/cjk": "^1.0.2",
|
|
50
63
|
"@streamdown/code": "^1.1.0",
|
|
51
64
|
"@streamdown/math": "^1.0.2",
|
|
52
65
|
"@streamdown/mermaid": "^1.0.2",
|
|
53
|
-
"@
|
|
54
|
-
"
|
|
66
|
+
"@tanstack/react-virtual": "^3.14.10",
|
|
67
|
+
"@xyflow/react": "^12.11.3",
|
|
68
|
+
"ai": "^6.0.256",
|
|
55
69
|
"ansi-to-react": "^6.2.6",
|
|
56
70
|
"class-variance-authority": "^0.7.1",
|
|
57
71
|
"clsx": "^2.1.1",
|
|
58
72
|
"cmdk": "^1.1.1",
|
|
59
|
-
"date-fns": "^4.
|
|
73
|
+
"date-fns": "^4.4.0",
|
|
60
74
|
"embla-carousel-react": "^8.6.0",
|
|
61
75
|
"input-otp": "^1.4.2",
|
|
62
|
-
"lucide-react": "^
|
|
63
|
-
"media-chrome": "^4.
|
|
64
|
-
"motion": "^12.
|
|
65
|
-
"nanoid": "^5.1.
|
|
76
|
+
"lucide-react": "^1.28.0",
|
|
77
|
+
"media-chrome": "^4.19.2",
|
|
78
|
+
"motion": "^12.43.0",
|
|
79
|
+
"nanoid": "^5.1.16",
|
|
66
80
|
"next-themes": "^0.4.6",
|
|
67
|
-
"radix-ui": "^1.
|
|
68
|
-
"react-day-picker": "^
|
|
69
|
-
"react-hook-form": "^7.
|
|
81
|
+
"radix-ui": "^1.6.5",
|
|
82
|
+
"react-day-picker": "^10.0.1",
|
|
83
|
+
"react-hook-form": "^7.85.0",
|
|
70
84
|
"react-jsx-parser": "^2.4.1",
|
|
71
|
-
"react-resizable-panels": "^4.
|
|
85
|
+
"react-resizable-panels": "^4.12.2",
|
|
72
86
|
"react-syntax-highlighter": "^16.1.1",
|
|
73
|
-
"recharts": "3.
|
|
87
|
+
"recharts": "3.10.1",
|
|
74
88
|
"shiki": "^3.23.0",
|
|
75
|
-
"sonner": "^2.0.
|
|
89
|
+
"sonner": "^2.0.8",
|
|
76
90
|
"streamdown": "^2.5.0",
|
|
77
|
-
"tailwind-merge": "^3.
|
|
91
|
+
"tailwind-merge": "^3.6.0",
|
|
78
92
|
"tokenlens": "^1.3.1",
|
|
79
|
-
"use-stick-to-bottom": "^1.1.
|
|
93
|
+
"use-stick-to-bottom": "^1.1.6",
|
|
80
94
|
"vaul": "^1.1.2",
|
|
81
|
-
"@sero-ai/common": "0.
|
|
95
|
+
"@sero-ai/common": "0.13.0"
|
|
82
96
|
},
|
|
83
97
|
"devDependencies": {
|
|
84
|
-
"@hookform/resolvers": "^5.
|
|
98
|
+
"@hookform/resolvers": "^5.9.0",
|
|
85
99
|
"@types/react": "^19.2.13",
|
|
86
100
|
"@types/react-dom": "^19.2.3",
|
|
87
101
|
"@types/react-syntax-highlighter": "^15.5.13",
|
|
88
102
|
"jsdom": "^26.1.0",
|
|
89
|
-
"react": "^19.2.
|
|
90
|
-
"react-dom": "^19.2.
|
|
103
|
+
"react": "^19.2.8",
|
|
104
|
+
"react-dom": "^19.2.8",
|
|
91
105
|
"shadcn": "^3.8.5",
|
|
92
|
-
"tailwindcss": "4.
|
|
106
|
+
"tailwindcss": "4.3.3",
|
|
93
107
|
"tsup": "^8.5.1",
|
|
94
108
|
"tw-animate-css": "^1.4.0",
|
|
95
109
|
"typescript": "^5.9.3",
|
|
96
|
-
"vitest": "^4.1.
|
|
110
|
+
"vitest": "^4.1.10"
|
|
97
111
|
},
|
|
98
112
|
"scripts": {
|
|
99
|
-
"build": "tsup && tsup --config tsup.reference.config.ts",
|
|
113
|
+
"build": "tsup && tsup --config tsup.reference.config.ts && node scripts/smoke-dist.mjs",
|
|
100
114
|
"typecheck": "tsc --noEmit",
|
|
101
115
|
"test": "vitest run",
|
|
102
116
|
"smoke": "node scripts/smoke-dist.mjs"
|