@sero-ai/ui 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/.turbo/turbo-typecheck.log +1 -1
  2. package/LICENSE +201 -0
  3. package/package.json +19 -16
  4. package/src/components/ai-elements/attachments.tsx +4 -4
  5. package/src/components/ai-elements/audio-player.tsx +1 -1
  6. package/src/components/ai-elements/chain-of-thought.tsx +2 -2
  7. package/src/components/ai-elements/confirmation.tsx +2 -2
  8. package/src/components/ai-elements/context.tsx +2 -2
  9. package/src/components/ai-elements/environment-variables.tsx +6 -6
  10. package/src/components/ai-elements/file-tree.tsx +3 -3
  11. package/src/components/ai-elements/inline-citation.tsx +2 -2
  12. package/src/components/ai-elements/jsx-preview.tsx +2 -2
  13. package/src/components/ai-elements/message.tsx +2 -2
  14. package/src/components/ai-elements/mic-selector.tsx +8 -8
  15. package/src/components/ai-elements/open-in-chat.tsx +2 -2
  16. package/src/components/ai-elements/package-info.tsx +4 -4
  17. package/src/components/ai-elements/plan.tsx +2 -2
  18. package/src/components/ai-elements/prompt-input-context.tsx +8 -8
  19. package/src/components/ai-elements/queue.tsx +1 -1
  20. package/src/components/ai-elements/reasoning.tsx +3 -3
  21. package/src/components/ai-elements/schema-display.tsx +7 -7
  22. package/src/components/ai-elements/snippet.tsx +3 -3
  23. package/src/components/ai-elements/sources.tsx +2 -2
  24. package/src/components/ai-elements/terminal.tsx +5 -5
  25. package/src/components/ai-elements/test-results.tsx +8 -8
  26. package/src/components/ai-elements/transcription.tsx +2 -2
  27. package/src/components/ai-elements/voice-selector.tsx +2 -2
  28. package/src/components/ai-elements/web-preview.tsx +5 -6
  29. package/src/components/model-selection/available-model-picker.tsx +1 -1
  30. package/src/components/ui/calendar.tsx +1 -1
  31. package/src/components/ui/carousel.tsx +1 -1
  32. package/src/components/ui/chart.tsx +3 -3
  33. package/src/components/ui/command.tsx +1 -1
  34. package/src/components/ui/field.tsx +2 -2
  35. package/src/components/ui/form.tsx +2 -2
  36. package/src/components/ui/input-otp.tsx +2 -2
  37. package/src/components/ui/input.tsx +3 -1
  38. package/src/components/ui/menubar.tsx +1 -1
  39. package/src/components/ui/native-select.tsx +2 -0
  40. package/src/components/ui/navigation-menu.tsx +1 -1
  41. package/src/components/ui/plugin-safety-disclaimer.tsx +3 -3
  42. package/src/components/ui/progress.tsx +1 -1
  43. package/src/components/ui/resizable.tsx +1 -1
  44. package/src/components/ui/search-input.tsx +26 -27
  45. package/src/components/ui/slider.tsx +7 -2
  46. package/src/components/ui/textarea.tsx +3 -1
  47. package/src/components/ui/toggle-group.tsx +1 -1
  48. package/src/components/ui/tree.tsx +3 -3
  49. package/src/index.ts +3 -0
  50. package/src/styles/globals.css +91 -26
  51. package/src/styles/plugin.css +4 -0
  52. package/src/theme/apply-theme.ts +250 -0
  53. package/src/theme/index.ts +2 -0
  54. package/src/theme/types.ts +253 -0
@@ -0,0 +1,253 @@
1
+ /**
2
+ * Shared Sero theme types and defaults.
3
+ *
4
+ * Presets are JSON-serialisable and map to CSS custom properties through
5
+ * `applyThemePreset()`. Keep this package renderer-safe: no Electron APIs.
6
+ */
7
+
8
+ // ── Colour Tokens ────────────────────────────────────────────
9
+
10
+ /** Core colour tokens that every theme defines for each mode. */
11
+ export interface ColorTokens {
12
+ // Surfaces
13
+ bgBase: string;
14
+ bgSurface: string;
15
+ bgElevated: string;
16
+ bgOverlay: string;
17
+ bgMuted: string;
18
+
19
+ // Borders
20
+ borderSubtle: string;
21
+ borderDefault: string;
22
+ borderFocus: string;
23
+
24
+ // Text
25
+ textPrimary: string;
26
+ textSecondary: string;
27
+ textMuted: string;
28
+ textInverse: string;
29
+
30
+ // Brand
31
+ brandPrimary: string;
32
+ brandPrimaryHover: string;
33
+ brandPrimaryForeground: string;
34
+ brandSecondary: string;
35
+ brandSecondaryHover: string;
36
+ brandSecondaryForeground: string;
37
+
38
+ // Legacy accent / syntax accent
39
+ accentPrimary: string;
40
+ accentHover: string;
41
+ accentMuted: string;
42
+ accentCode: string;
43
+
44
+ // Status (solid)
45
+ statusSuccess: string;
46
+ statusWarning: string;
47
+ statusError: string;
48
+ statusInfo: string;
49
+
50
+ // Collaboration
51
+ collabPrimary: string;
52
+
53
+ // Voice
54
+ voiceRecording: string;
55
+ voiceProcessing: string;
56
+
57
+ // Banner / notification accent
58
+ bannerPrimary: string;
59
+ }
60
+
61
+ /** Terminal ANSI colour overrides (optional per-theme). */
62
+ export interface TerminalColorTokens {
63
+ background: string;
64
+ foreground: string;
65
+ cursor: string;
66
+ cursorAccent: string;
67
+ selectionBackground: string;
68
+ black: string;
69
+ red: string;
70
+ green: string;
71
+ yellow: string;
72
+ blue: string;
73
+ magenta: string;
74
+ cyan: string;
75
+ white: string;
76
+ brightBlack: string;
77
+ brightRed: string;
78
+ brightGreen: string;
79
+ brightYellow: string;
80
+ brightBlue: string;
81
+ brightMagenta: string;
82
+ brightCyan: string;
83
+ brightWhite: string;
84
+ }
85
+
86
+ // ── Typography / Spacing / Radius ────────────────────────────
87
+
88
+ export interface TypographyTokens {
89
+ fontSans?: string;
90
+ fontMono?: string;
91
+ fontSizeBase?: string;
92
+ }
93
+
94
+ export interface SpacingTokens {
95
+ xs?: string;
96
+ sm?: string;
97
+ md?: string;
98
+ lg?: string;
99
+ xl?: string;
100
+ }
101
+
102
+ export interface RadiusTokens {
103
+ sm?: string;
104
+ md?: string;
105
+ lg?: string;
106
+ }
107
+
108
+ // ── Theme Preset ─────────────────────────────────────────────
109
+
110
+ export interface ThemePreset {
111
+ /** Unique ID (slug or uuid). */
112
+ id: string;
113
+ /** Human-readable name. */
114
+ name: string;
115
+ /** Optional description. */
116
+ description?: string;
117
+ /** Author name (for shared presets). */
118
+ author?: string;
119
+ /** Schema version for forward compatibility. */
120
+ version: 1;
121
+ /** Whether this is a built-in preset (read-only). */
122
+ builtin?: boolean;
123
+
124
+ /** Colour tokens — both modes required. */
125
+ colors: {
126
+ light: ColorTokens;
127
+ dark: ColorTokens;
128
+ };
129
+
130
+ /** Terminal ANSI colours (optional — derived from status colours if absent). */
131
+ terminal?: {
132
+ light?: Partial<TerminalColorTokens>;
133
+ dark?: Partial<TerminalColorTokens>;
134
+ };
135
+
136
+ /** Typography overrides. */
137
+ typography?: TypographyTokens;
138
+
139
+ /** Spacing scale overrides. */
140
+ spacing?: SpacingTokens;
141
+
142
+ /** Border radius overrides. */
143
+ radius?: RadiusTokens;
144
+ }
145
+
146
+ /** Lightweight metadata for listing presets without loading full data. */
147
+ export interface ThemePresetMeta {
148
+ id: string;
149
+ name: string;
150
+ description?: string;
151
+ author?: string;
152
+ builtin: boolean;
153
+ }
154
+
155
+ // ── Theme Mode ───────────────────────────────────────────────
156
+
157
+ export type ThemeMode = 'light' | 'dark' | 'system';
158
+
159
+ // ── Default Theme Constants ──────────────────────────────────
160
+
161
+ /** The default theme preset ID. */
162
+ export const DEFAULT_THEME_ID = 'default';
163
+
164
+ /** Default colour tokens matching globals.css :root values. */
165
+ export const DEFAULT_LIGHT_COLORS: ColorTokens = {
166
+ bgBase: '#ffffff',
167
+ bgSurface: '#f4f5f7',
168
+ bgElevated: '#eaecf0',
169
+ bgOverlay: '#dde0e6',
170
+ bgMuted: '#c8ccd4',
171
+ borderSubtle: '#d4d8e0',
172
+ borderDefault: '#bcc1cc',
173
+ borderFocus: '#059669',
174
+ textPrimary: '#0f1117',
175
+ textSecondary: '#3b4252',
176
+ textMuted: '#6b7280',
177
+ textInverse: '#fafafa',
178
+ brandPrimary: '#059669',
179
+ brandPrimaryHover: '#047857',
180
+ brandPrimaryForeground: '#ffffff',
181
+ brandSecondary: '#7c3aed',
182
+ brandSecondaryHover: '#6d28d9',
183
+ brandSecondaryForeground: '#ffffff',
184
+ accentPrimary: '#7c3aed',
185
+ accentHover: '#6d28d9',
186
+ accentMuted: '#7c3aed1a',
187
+ accentCode: '#7c3aed',
188
+ statusSuccess: '#16a34a',
189
+ statusWarning: '#d97706',
190
+ statusError: '#dc2626',
191
+ statusInfo: '#2563eb',
192
+ collabPrimary: '#7c3aed',
193
+ voiceRecording: '#f43f5e',
194
+ voiceProcessing: '#06b6d4',
195
+ bannerPrimary: '#7c3aed',
196
+ };
197
+
198
+ /** Default typography matching globals.css values. */
199
+ export const DEFAULT_TYPOGRAPHY: Required<TypographyTokens> = {
200
+ fontSans: "system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
201
+ fontMono: "'JetBrains Mono', 'SF Mono', 'Fira Code', 'Cascadia Code', Menlo, monospace",
202
+ fontSizeBase: '14px',
203
+ };
204
+
205
+ /** Default spacing matching globals.css values. */
206
+ export const DEFAULT_SPACING: Required<SpacingTokens> = {
207
+ xs: '4px',
208
+ sm: '8px',
209
+ md: '12px',
210
+ lg: '16px',
211
+ xl: '32px',
212
+ };
213
+
214
+ /** Default radius matching globals.css values. */
215
+ export const DEFAULT_RADIUS: Required<RadiusTokens> = {
216
+ sm: '4px',
217
+ md: '8px',
218
+ lg: '12px',
219
+ };
220
+
221
+ /** Default colour tokens matching globals.css .dark values. */
222
+ export const DEFAULT_DARK_COLORS: ColorTokens = {
223
+ bgBase: '#0a0a0b',
224
+ bgSurface: '#111113',
225
+ bgElevated: '#18181b',
226
+ bgOverlay: '#1f1f23',
227
+ bgMuted: '#27272a',
228
+ borderSubtle: '#27272a',
229
+ borderDefault: '#3f3f46',
230
+ borderFocus: '#34d399',
231
+ textPrimary: '#fafafa',
232
+ textSecondary: '#a1a1aa',
233
+ textMuted: '#71717a',
234
+ textInverse: '#09090b',
235
+ brandPrimary: '#34d399',
236
+ brandPrimaryHover: '#6ee7b7',
237
+ brandPrimaryForeground: '#052e1c',
238
+ brandSecondary: '#c4b5fd',
239
+ brandSecondaryHover: '#ddd6fe',
240
+ brandSecondaryForeground: '#1e1038',
241
+ accentPrimary: '#c4b5fd',
242
+ accentHover: '#ddd6fe',
243
+ accentMuted: '#c4b5fd33',
244
+ accentCode: '#c4b5fd',
245
+ statusSuccess: '#22c55e',
246
+ statusWarning: '#f59e0b',
247
+ statusError: '#ef4444',
248
+ statusInfo: '#3b82f6',
249
+ collabPrimary: '#a78bfa',
250
+ voiceRecording: '#fb7185',
251
+ voiceProcessing: '#22d3ee',
252
+ bannerPrimary: '#c4b5fd',
253
+ };