@sero-ai/ui 0.3.1 → 0.3.2

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.
@@ -0,0 +1,438 @@
1
+ @import "tailwindcss";
2
+ @import "tw-animate-css";
3
+ @import "shadcn/tailwind.css";
4
+
5
+ /* Ensure monorepo consumers that @import this file also scan @sero-ai/ui
6
+ component sources for Tailwind utility classes. Without this, complex
7
+ classes like has-[>[data-align=block-end]]:flex-col won't be generated. */
8
+ @source "../components";
9
+
10
+ @custom-variant dark (&:is(.dark *));
11
+
12
+ /* ── Sero Design System ──────────────────────────────────────── */
13
+
14
+ :root {
15
+ /* Surface colors (light) */
16
+ --bg-base: #ffffff;
17
+ --bg-surface: #f4f5f7;
18
+ --bg-elevated: #eaecf0;
19
+ --bg-overlay: #dde0e6;
20
+ --bg-muted: #c8ccd4;
21
+
22
+ /* Border (light) */
23
+ --border-subtle: #d4d8e0;
24
+ --border-default: #bcc1cc;
25
+ --border-focus: #059669;
26
+
27
+ /* Text (light) */
28
+ --text-primary: #0f1117;
29
+ --text-secondary: #3b4252;
30
+ --text-muted: #6b7280;
31
+ --text-inverse: #fafafa;
32
+
33
+ /* Brand colours — product identity, actions, active UI */
34
+ --brand-primary: #059669;
35
+ --brand-primary-hover: #047857;
36
+ --brand-primary-foreground: #ffffff;
37
+ --brand-primary-muted: color-mix(in srgb, var(--brand-primary) 10%, transparent);
38
+ --brand-primary-subtle: color-mix(in srgb, var(--brand-primary) 15%, transparent);
39
+ --brand-primary-faint: color-mix(in srgb, var(--brand-primary) 3%, transparent);
40
+ --brand-primary-border: color-mix(in srgb, var(--brand-primary) 20%, transparent);
41
+ --brand-secondary: #7c3aed;
42
+ --brand-secondary-hover: #6d28d9;
43
+ --brand-secondary-foreground: #ffffff;
44
+ --brand-secondary-muted: color-mix(in srgb, var(--brand-secondary) 10%, transparent);
45
+ --brand-secondary-subtle: color-mix(in srgb, var(--brand-secondary) 15%, transparent);
46
+ --brand-secondary-faint: color-mix(in srgb, var(--brand-secondary) 3%, transparent);
47
+ --brand-secondary-border: color-mix(in srgb, var(--brand-secondary) 20%, transparent);
48
+
49
+ /* Legacy accent / syntax accent */
50
+ --accent-primary: var(--brand-secondary);
51
+ --accent-hover: var(--brand-secondary-hover);
52
+ --accent-muted: var(--brand-secondary-muted);
53
+ --accent-code: #7c3aed;
54
+
55
+ /* Status — solid */
56
+ --status-success: #16a34a;
57
+ --status-warning: #d97706;
58
+ --status-error: #dc2626;
59
+ --status-info: #2563eb;
60
+
61
+ /* Status — muted backgrounds (low-opacity tints) */
62
+ --status-success-muted: rgba(22, 163, 74, 0.10);
63
+ --status-warning-muted: rgba(217, 119, 6, 0.10);
64
+ --status-error-muted: rgba(220, 38, 38, 0.10);
65
+ --status-info-muted: rgba(37, 99, 235, 0.10);
66
+
67
+ /* Status — subtle (slightly stronger tint for borders, badges) */
68
+ --status-success-subtle: rgba(22, 163, 74, 0.15);
69
+ --status-warning-subtle: rgba(217, 119, 6, 0.15);
70
+ --status-error-subtle: rgba(220, 38, 38, 0.15);
71
+ --status-info-subtle: rgba(37, 99, 235, 0.15);
72
+
73
+ /* Status — faint (near-invisible tint for full-area backgrounds) */
74
+ --status-success-faint: rgba(22, 163, 74, 0.03);
75
+ --status-warning-faint: rgba(217, 119, 6, 0.03);
76
+ --status-error-faint: rgba(220, 38, 38, 0.03);
77
+ --status-info-faint: rgba(37, 99, 235, 0.03);
78
+
79
+ /* Status — border (20% opacity for bordered containers) */
80
+ --status-success-border: rgba(22, 163, 74, 0.20);
81
+ --status-warning-border: rgba(217, 119, 6, 0.20);
82
+ --status-error-border: rgba(220, 38, 38, 0.20);
83
+ --status-info-border: rgba(37, 99, 235, 0.20);
84
+
85
+ /* Semantic colours — collaboration / special modes */
86
+ --collab-primary: #7c3aed;
87
+ --collab-primary-muted: rgba(124, 58, 237, 0.10);
88
+ --collab-primary-subtle: rgba(124, 58, 237, 0.15);
89
+ --collab-primary-border: rgba(124, 58, 237, 0.20);
90
+
91
+ /* Semantic colours — voice / recording */
92
+ --voice-recording: #f43f5e;
93
+ --voice-recording-muted: rgba(244, 63, 94, 0.20);
94
+ --voice-processing: #06b6d4;
95
+ --voice-processing-muted: rgba(6, 182, 212, 0.15);
96
+
97
+ /* Semantic colours — indigo accent for notifications/banners */
98
+ --banner-primary: var(--brand-secondary);
99
+ --banner-primary-muted: color-mix(in srgb, var(--banner-primary) 10%, transparent);
100
+ --banner-primary-subtle: color-mix(in srgb, var(--banner-primary) 15%, transparent);
101
+ --banner-primary-border: color-mix(in srgb, var(--banner-primary) 20%, transparent);
102
+
103
+ /* Thinking / reasoning gradients */
104
+ --gradient-thinking-high: linear-gradient(135deg, rgba(245, 158, 11, 0.20), rgba(239, 68, 68, 0.20));
105
+ --gradient-thinking-low: linear-gradient(135deg, rgba(99, 102, 241, 0.20), rgba(139, 92, 246, 0.20));
106
+
107
+ /* File type icon colours */
108
+ --file-icon-ts: #3b82f6;
109
+ --file-icon-js: #eab308;
110
+ --file-icon-json: #22c55e;
111
+ --file-icon-css: #6366f1;
112
+ --file-icon-rust: #f97316;
113
+ --file-icon-markdown: #6366f1;
114
+ --file-icon-default: var(--text-muted);
115
+
116
+ /* Typography (themeable) */
117
+ --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
118
+ --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Cascadia Code', Menlo, monospace;
119
+ --font-size-base: 14px;
120
+
121
+ /* Spacing */
122
+ --space-xs: 4px;
123
+ --space-sm: 8px;
124
+ --space-md: 12px;
125
+ --space-lg: 16px;
126
+ --space-xl: 24px;
127
+
128
+ /* Sero radius (legacy — use Tailwind rounded-* for new components) */
129
+ --sero-radius-sm: 4px;
130
+ --sero-radius-md: 8px;
131
+ --sero-radius-lg: 12px;
132
+
133
+ /* Sero font sizes (legacy — use Tailwind text-* for new components) */
134
+ --sero-text-xs: 12px;
135
+ --sero-text-sm: 13px;
136
+ --sero-text-base: 14px;
137
+ --sero-text-lg: 15px;
138
+ --sero-text-xl: 16px;
139
+
140
+ /* Transition */
141
+ --transition-fast: 120ms ease;
142
+ --transition-normal: 200ms ease;
143
+ --radius: 0.625rem;
144
+
145
+ /* ── shadcn bridge ────────────────────────────────────────
146
+ Derive shadcn/ui tokens from Sero design tokens so every
147
+ shadcn component (Dialog, Command, Dropdown, Tooltip, …)
148
+ automatically follows theme changes.
149
+ NOTE: --accent here is the shadcn "hover/selection bg",
150
+ NOT a brand colour (use --brand-primary/secondary). */
151
+ --background: var(--bg-base);
152
+ --foreground: var(--text-primary);
153
+ --card: var(--bg-surface);
154
+ --card-foreground: var(--text-primary);
155
+ --popover: var(--bg-elevated);
156
+ --popover-foreground: var(--text-primary);
157
+ --primary: var(--brand-primary);
158
+ --primary-foreground: var(--brand-primary-foreground);
159
+ --secondary: var(--bg-surface);
160
+ --secondary-foreground: var(--text-primary);
161
+ --muted: var(--bg-muted);
162
+ --muted-foreground: var(--text-muted);
163
+ --accent: var(--bg-overlay);
164
+ --accent-foreground: var(--text-primary);
165
+ --destructive: var(--status-error);
166
+ --border: var(--border-default);
167
+ --input: var(--border-subtle);
168
+ --ring: var(--border-focus);
169
+ --chart-1: oklch(0.646 0.222 41.116);
170
+ --chart-2: oklch(0.6 0.118 184.704);
171
+ --chart-3: oklch(0.398 0.07 227.392);
172
+ --chart-4: oklch(0.828 0.189 84.429);
173
+ --chart-5: oklch(0.769 0.188 70.08);
174
+ --sidebar: var(--bg-surface);
175
+ --sidebar-foreground: var(--text-primary);
176
+ --sidebar-primary: var(--brand-primary);
177
+ --sidebar-primary-foreground: var(--brand-primary-foreground);
178
+ --sidebar-accent: var(--bg-elevated);
179
+ --sidebar-accent-foreground: var(--text-primary);
180
+ --sidebar-border: var(--border-subtle);
181
+ --sidebar-ring: var(--border-focus);
182
+ }
183
+
184
+ /* ── Scrollbars ─────────────────────────────────────────────── */
185
+ ::-webkit-scrollbar {
186
+ width: 6px;
187
+ height: 6px;
188
+ }
189
+
190
+ ::-webkit-scrollbar-track {
191
+ background: transparent;
192
+ }
193
+
194
+ ::-webkit-scrollbar-thumb {
195
+ background: var(--border-default);
196
+ border-radius: 3px;
197
+ }
198
+
199
+ ::-webkit-scrollbar-thumb:hover {
200
+ background: var(--text-muted);
201
+ }
202
+
203
+ /* ── Selection ──────────────────────────────────────────────── */
204
+ ::selection {
205
+ background: var(--accent-muted);
206
+ color: var(--text-primary);
207
+ }
208
+
209
+ /* ── Focus ──────────────────────────────────────────────────── */
210
+ /* Scoped to avoid conflicting with shadcn/Radix components which
211
+ manage their own focus rings via Tailwind ring utilities. */
212
+ :focus-visible:not([data-slot]) {
213
+ outline: 2px solid var(--border-focus);
214
+ outline-offset: -2px;
215
+ }
216
+
217
+ @theme inline {
218
+ --radius-sm: calc(var(--radius) - 4px);
219
+ --radius-md: calc(var(--radius) - 2px);
220
+ --radius-lg: var(--radius);
221
+ --radius-xl: calc(var(--radius) + 4px);
222
+ --radius-2xl: calc(var(--radius) + 8px);
223
+ --radius-3xl: calc(var(--radius) + 12px);
224
+ --radius-4xl: calc(var(--radius) + 16px);
225
+ --color-background: var(--background);
226
+ --color-foreground: var(--foreground);
227
+ --color-brand-primary: var(--brand-primary);
228
+ --color-brand-primary-foreground: var(--brand-primary-foreground);
229
+ --color-brand-primary-muted: var(--brand-primary-muted);
230
+ --color-brand-primary-subtle: var(--brand-primary-subtle);
231
+ --color-brand-primary-faint: var(--brand-primary-faint);
232
+ --color-brand-primary-border: var(--brand-primary-border);
233
+ --color-brand-secondary: var(--brand-secondary);
234
+ --color-brand-secondary-foreground: var(--brand-secondary-foreground);
235
+ --color-brand-secondary-muted: var(--brand-secondary-muted);
236
+ --color-brand-secondary-subtle: var(--brand-secondary-subtle);
237
+ --color-brand-secondary-faint: var(--brand-secondary-faint);
238
+ --color-brand-secondary-border: var(--brand-secondary-border);
239
+ --color-status-success: var(--status-success);
240
+ --color-status-success-muted: var(--status-success-muted);
241
+ --color-status-success-subtle: var(--status-success-subtle);
242
+ --color-status-success-faint: var(--status-success-faint);
243
+ --color-status-success-border: var(--status-success-border);
244
+ --color-status-warning: var(--status-warning);
245
+ --color-status-warning-muted: var(--status-warning-muted);
246
+ --color-status-warning-subtle: var(--status-warning-subtle);
247
+ --color-status-warning-faint: var(--status-warning-faint);
248
+ --color-status-warning-border: var(--status-warning-border);
249
+ --color-status-error: var(--status-error);
250
+ --color-status-error-muted: var(--status-error-muted);
251
+ --color-status-error-subtle: var(--status-error-subtle);
252
+ --color-status-error-faint: var(--status-error-faint);
253
+ --color-status-error-border: var(--status-error-border);
254
+ --color-status-info: var(--status-info);
255
+ --color-status-info-muted: var(--status-info-muted);
256
+ --color-status-info-subtle: var(--status-info-subtle);
257
+ --color-status-info-faint: var(--status-info-faint);
258
+ --color-status-info-border: var(--status-info-border);
259
+ --color-card: var(--card);
260
+ --color-card-foreground: var(--card-foreground);
261
+ --color-popover: var(--popover);
262
+ --color-popover-foreground: var(--popover-foreground);
263
+ --color-primary: var(--primary);
264
+ --color-primary-foreground: var(--primary-foreground);
265
+ --color-secondary: var(--secondary);
266
+ --color-secondary-foreground: var(--secondary-foreground);
267
+ --color-muted: var(--muted);
268
+ --color-muted-foreground: var(--muted-foreground);
269
+ --color-accent: var(--accent);
270
+ --color-accent-foreground: var(--accent-foreground);
271
+ --color-destructive: var(--destructive);
272
+ --color-border: var(--border);
273
+ --color-input: var(--input);
274
+ --color-ring: var(--ring);
275
+ --color-chart-1: var(--chart-1);
276
+ --color-chart-2: var(--chart-2);
277
+ --color-chart-3: var(--chart-3);
278
+ --color-chart-4: var(--chart-4);
279
+ --color-chart-5: var(--chart-5);
280
+ --color-sidebar: var(--sidebar);
281
+ --color-sidebar-foreground: var(--sidebar-foreground);
282
+ --color-sidebar-primary: var(--sidebar-primary);
283
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
284
+ --color-sidebar-accent: var(--sidebar-accent);
285
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
286
+ --color-sidebar-border: var(--sidebar-border);
287
+ --color-sidebar-ring: var(--sidebar-ring);
288
+ }
289
+
290
+ .dark {
291
+ /* Surface colors (dark) */
292
+ --bg-base: #0a0a0b;
293
+ --bg-surface: #111113;
294
+ --bg-elevated: #18181b;
295
+ --bg-overlay: #1f1f23;
296
+ --bg-muted: #27272a;
297
+
298
+ /* Border (dark) */
299
+ --border-subtle: #27272a;
300
+ --border-default: #3f3f46;
301
+ --border-focus: #34d399;
302
+
303
+ /* Text (dark) */
304
+ --text-primary: #fafafa;
305
+ --text-secondary: #a1a1aa;
306
+ --text-muted: #71717a;
307
+ --text-inverse: #09090b;
308
+
309
+ /* Brand colours (dark) */
310
+ --brand-primary: #34d399;
311
+ --brand-primary-hover: #6ee7b7;
312
+ --brand-primary-foreground: #052e1c;
313
+ --brand-primary-muted: color-mix(in srgb, var(--brand-primary) 10%, transparent);
314
+ --brand-primary-subtle: color-mix(in srgb, var(--brand-primary) 15%, transparent);
315
+ --brand-primary-faint: color-mix(in srgb, var(--brand-primary) 3%, transparent);
316
+ --brand-primary-border: color-mix(in srgb, var(--brand-primary) 20%, transparent);
317
+ --brand-secondary: #c4b5fd;
318
+ --brand-secondary-hover: #ddd6fe;
319
+ --brand-secondary-foreground: #1e1038;
320
+ --brand-secondary-muted: color-mix(in srgb, var(--brand-secondary) 10%, transparent);
321
+ --brand-secondary-subtle: color-mix(in srgb, var(--brand-secondary) 15%, transparent);
322
+ --brand-secondary-faint: color-mix(in srgb, var(--brand-secondary) 3%, transparent);
323
+ --brand-secondary-border: color-mix(in srgb, var(--brand-secondary) 20%, transparent);
324
+
325
+ /* Legacy accent / syntax accent (dark) */
326
+ --accent-primary: var(--brand-secondary);
327
+ --accent-hover: var(--brand-secondary-hover);
328
+ --accent-muted: var(--brand-secondary-muted);
329
+ --accent-code: #c4b5fd;
330
+
331
+ /* Status — solid (dark) */
332
+ --status-success: #22c55e;
333
+ --status-warning: #f59e0b;
334
+ --status-error: #ef4444;
335
+ --status-info: #3b82f6;
336
+
337
+ /* Status — muted backgrounds (dark) */
338
+ --status-success-muted: rgba(34, 197, 94, 0.10);
339
+ --status-warning-muted: rgba(245, 158, 11, 0.10);
340
+ --status-error-muted: rgba(239, 68, 68, 0.10);
341
+ --status-info-muted: rgba(59, 130, 246, 0.10);
342
+
343
+ /* Status — subtle (dark) */
344
+ --status-success-subtle: rgba(34, 197, 94, 0.15);
345
+ --status-warning-subtle: rgba(245, 158, 11, 0.15);
346
+ --status-error-subtle: rgba(239, 68, 68, 0.15);
347
+ --status-info-subtle: rgba(59, 130, 246, 0.15);
348
+
349
+ /* Status — faint (dark) */
350
+ --status-success-faint: rgba(34, 197, 94, 0.03);
351
+ --status-warning-faint: rgba(245, 158, 11, 0.03);
352
+ --status-error-faint: rgba(239, 68, 68, 0.03);
353
+ --status-info-faint: rgba(59, 130, 246, 0.03);
354
+
355
+ /* Status — border (dark) */
356
+ --status-success-border: rgba(34, 197, 94, 0.20);
357
+ --status-warning-border: rgba(245, 158, 11, 0.20);
358
+ --status-error-border: rgba(239, 68, 68, 0.20);
359
+ --status-info-border: rgba(59, 130, 246, 0.20);
360
+
361
+ /* Collaboration (dark) */
362
+ --collab-primary: #a78bfa;
363
+ --collab-primary-muted: rgba(167, 139, 250, 0.10);
364
+ --collab-primary-subtle: rgba(167, 139, 250, 0.15);
365
+ --collab-primary-border: rgba(167, 139, 250, 0.20);
366
+
367
+ /* Voice (dark) */
368
+ --voice-recording: #fb7185;
369
+ --voice-recording-muted: rgba(251, 113, 133, 0.20);
370
+ --voice-processing: #22d3ee;
371
+ --voice-processing-muted: rgba(34, 211, 238, 0.15);
372
+
373
+ /* Banner / notifications (dark) */
374
+ --banner-primary: var(--brand-secondary);
375
+ --banner-primary-muted: color-mix(in srgb, var(--banner-primary) 10%, transparent);
376
+ --banner-primary-subtle: color-mix(in srgb, var(--banner-primary) 15%, transparent);
377
+ --banner-primary-border: color-mix(in srgb, var(--banner-primary) 20%, transparent);
378
+
379
+ /* Thinking gradients (dark) */
380
+ --gradient-thinking-high: linear-gradient(135deg, rgba(245, 158, 11, 0.20), rgba(239, 68, 68, 0.20));
381
+ --gradient-thinking-low: linear-gradient(135deg, rgba(99, 102, 241, 0.20), rgba(139, 92, 246, 0.20));
382
+
383
+ /* File type icons (dark — brighter variants) */
384
+ --file-icon-ts: #60a5fa;
385
+ --file-icon-js: #facc15;
386
+ --file-icon-json: #4ade80;
387
+ --file-icon-css: #818cf8;
388
+ --file-icon-rust: #fb923c;
389
+ --file-icon-markdown: #818cf8;
390
+
391
+ /* ── shadcn bridge (identical structure to :root — resolves
392
+ to dark Sero tokens defined above in this block) ────── */
393
+ --background: var(--bg-base);
394
+ --foreground: var(--text-primary);
395
+ --card: var(--bg-surface);
396
+ --card-foreground: var(--text-primary);
397
+ --popover: var(--bg-elevated);
398
+ --popover-foreground: var(--text-primary);
399
+ --primary: var(--brand-primary);
400
+ --primary-foreground: var(--brand-primary-foreground);
401
+ --secondary: var(--bg-surface);
402
+ --secondary-foreground: var(--text-primary);
403
+ --muted: var(--bg-muted);
404
+ --muted-foreground: var(--text-muted);
405
+ --accent: var(--bg-overlay);
406
+ --accent-foreground: var(--text-primary);
407
+ --destructive: var(--status-error);
408
+ --border: var(--border-default);
409
+ --input: var(--border-subtle);
410
+ --ring: var(--border-focus);
411
+ --chart-1: oklch(0.488 0.243 264.376);
412
+ --chart-2: oklch(0.696 0.17 162.48);
413
+ --chart-3: oklch(0.769 0.188 70.08);
414
+ --chart-4: oklch(0.627 0.265 303.9);
415
+ --chart-5: oklch(0.645 0.246 16.439);
416
+ --sidebar: var(--bg-surface);
417
+ --sidebar-foreground: var(--text-primary);
418
+ --sidebar-primary: var(--brand-primary);
419
+ --sidebar-primary-foreground: var(--brand-primary-foreground);
420
+ --sidebar-accent: var(--bg-elevated);
421
+ --sidebar-accent-foreground: var(--text-primary);
422
+ --sidebar-border: var(--border-subtle);
423
+ --sidebar-ring: var(--border-focus);
424
+ }
425
+
426
+ html {
427
+ font-size: var(--font-size-base, 14px);
428
+ font-family: var(--font-sans);
429
+ }
430
+
431
+ @layer base {
432
+ * {
433
+ @apply border-border outline-ring/50;
434
+ }
435
+ body {
436
+ @apply bg-background text-foreground;
437
+ }
438
+ }
@@ -0,0 +1,4 @@
1
+ @import "./globals.css";
2
+
3
+ /* Federated Sero plugins should import this file, then add plugin-local
4
+ @source directives. It keeps Tailwind 4 token names aligned with the shell. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sero-ai/ui",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Shared UI components, AI elements, and design tokens for the Sero platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -11,6 +11,18 @@
11
11
  "import": "./dist/index.js",
12
12
  "require": "./dist/index.cjs"
13
13
  },
14
+ "./theme": {
15
+ "types": "./dist/theme/index.d.ts",
16
+ "import": "./dist/theme/index.js",
17
+ "require": "./dist/theme/index.cjs"
18
+ },
19
+ "./theme/*": {
20
+ "types": "./dist/theme/*.d.ts",
21
+ "import": "./dist/theme/*.js",
22
+ "require": "./dist/theme/*.cjs"
23
+ },
24
+ "./styles/*": "./dist/styles/*",
25
+ "./package.json": "./package.json",
14
26
  "./*": {
15
27
  "types": "./dist/*.d.ts",
16
28
  "import": "./dist/*.js",
package/tsup.config.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { defineConfig } from "tsup";
2
+ import { cpSync } from "node:fs";
2
3
 
3
4
  export default defineConfig({
4
5
  // Tells tsup to grab everything in your src directory
@@ -11,4 +12,7 @@ export default defineConfig({
11
12
  // This is the golden key: it stops esbuild from merging everything
12
13
  // into index.js and forces it to mirror your exact folder structure.
13
14
  bundle: false,
14
- });
15
+ onSuccess: () => {
16
+ cpSync("src/styles", "dist/styles", { recursive: true });
17
+ },
18
+ });