@sero-ai/ui 0.3.2 → 0.4.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 (169) hide show
  1. package/.turbo/turbo-build.log +615 -0
  2. package/.turbo/turbo-typecheck.log +1 -1
  3. package/CHANGELOG.md +58 -0
  4. package/dist/components/context-editor/CapabilitySection.cjs +57 -0
  5. package/dist/components/context-editor/CapabilitySection.d.cts +20 -0
  6. package/dist/components/context-editor/CapabilitySection.d.ts +20 -0
  7. package/dist/components/context-editor/CapabilitySection.js +57 -0
  8. package/dist/components/context-editor/ContextEditor.cjs +108 -0
  9. package/dist/components/context-editor/ContextEditor.d.cts +26 -0
  10. package/dist/components/context-editor/ContextEditor.d.ts +26 -0
  11. package/dist/components/context-editor/ContextEditor.js +108 -0
  12. package/dist/components/context-editor/PresetBar.cjs +71 -0
  13. package/dist/components/context-editor/PresetBar.d.cts +19 -0
  14. package/dist/components/context-editor/PresetBar.d.ts +19 -0
  15. package/dist/components/context-editor/PresetBar.js +71 -0
  16. package/dist/components/context-editor/SkillsSection.cjs +31 -0
  17. package/dist/components/context-editor/SkillsSection.d.cts +14 -0
  18. package/dist/components/context-editor/SkillsSection.d.ts +14 -0
  19. package/dist/components/context-editor/SkillsSection.js +31 -0
  20. package/dist/components/context-editor/SystemPromptSection.cjs +58 -0
  21. package/dist/components/context-editor/SystemPromptSection.d.cts +25 -0
  22. package/dist/components/context-editor/SystemPromptSection.d.ts +25 -0
  23. package/dist/components/context-editor/SystemPromptSection.js +58 -0
  24. package/dist/components/context-editor/ToolsSection.cjs +31 -0
  25. package/dist/components/context-editor/ToolsSection.d.cts +14 -0
  26. package/dist/components/context-editor/ToolsSection.d.ts +14 -0
  27. package/dist/components/context-editor/ToolsSection.js +31 -0
  28. package/dist/components/context-editor/index.cjs +8 -0
  29. package/dist/components/context-editor/index.d.cts +5 -0
  30. package/dist/components/context-editor/index.d.ts +5 -0
  31. package/dist/components/context-editor/index.js +8 -0
  32. package/dist/components/context-editor/parts.cjs +184 -0
  33. package/dist/components/context-editor/parts.d.cts +32 -0
  34. package/dist/components/context-editor/parts.d.ts +32 -0
  35. package/dist/components/context-editor/parts.js +184 -0
  36. package/dist/components/context-editor/use-context-editor-model.cjs +194 -0
  37. package/dist/components/context-editor/use-context-editor-model.d.cts +57 -0
  38. package/dist/components/context-editor/use-context-editor-model.d.ts +57 -0
  39. package/dist/components/context-editor/use-context-editor-model.js +194 -0
  40. package/dist/components/dashboard/activity-list.cjs +59 -0
  41. package/dist/components/dashboard/activity-list.d.cts +27 -0
  42. package/dist/components/dashboard/activity-list.d.ts +27 -0
  43. package/dist/components/dashboard/activity-list.js +59 -0
  44. package/dist/components/dashboard/catalog.cjs +1 -0
  45. package/dist/components/dashboard/catalog.d.cts +13 -0
  46. package/dist/components/dashboard/catalog.d.ts +13 -0
  47. package/dist/components/dashboard/catalog.js +0 -0
  48. package/dist/components/dashboard/catalog.json +312 -0
  49. package/dist/components/dashboard/data-boundary.cjs +29 -0
  50. package/dist/components/dashboard/data-boundary.d.cts +21 -0
  51. package/dist/components/dashboard/data-boundary.d.ts +21 -0
  52. package/dist/components/dashboard/data-boundary.js +29 -0
  53. package/dist/components/dashboard/empty-state.cjs +49 -0
  54. package/dist/components/dashboard/empty-state.d.cts +20 -0
  55. package/dist/components/dashboard/empty-state.d.ts +20 -0
  56. package/dist/components/dashboard/empty-state.js +49 -0
  57. package/dist/components/dashboard/icon-button.cjs +40 -0
  58. package/dist/components/dashboard/icon-button.d.cts +24 -0
  59. package/dist/components/dashboard/icon-button.d.ts +24 -0
  60. package/dist/components/dashboard/icon-button.js +40 -0
  61. package/dist/components/dashboard/index.cjs +15 -0
  62. package/dist/components/dashboard/index.d.cts +24 -0
  63. package/dist/components/dashboard/index.d.ts +24 -0
  64. package/dist/components/dashboard/index.js +15 -0
  65. package/dist/components/dashboard/item-list.cjs +71 -0
  66. package/dist/components/dashboard/item-list.d.cts +28 -0
  67. package/dist/components/dashboard/item-list.d.ts +28 -0
  68. package/dist/components/dashboard/item-list.js +71 -0
  69. package/dist/components/dashboard/key-value.cjs +39 -0
  70. package/dist/components/dashboard/key-value.d.cts +17 -0
  71. package/dist/components/dashboard/key-value.d.ts +17 -0
  72. package/dist/components/dashboard/key-value.js +39 -0
  73. package/dist/components/dashboard/layout.cjs +193 -0
  74. package/dist/components/dashboard/layout.d.cts +91 -0
  75. package/dist/components/dashboard/layout.d.ts +91 -0
  76. package/dist/components/dashboard/layout.js +193 -0
  77. package/dist/components/dashboard/metric.cjs +98 -0
  78. package/dist/components/dashboard/metric.d.cts +44 -0
  79. package/dist/components/dashboard/metric.d.ts +44 -0
  80. package/dist/components/dashboard/metric.js +98 -0
  81. package/dist/components/dashboard/progress-ring.cjs +77 -0
  82. package/dist/components/dashboard/progress-ring.d.cts +25 -0
  83. package/dist/components/dashboard/progress-ring.d.ts +25 -0
  84. package/dist/components/dashboard/progress-ring.js +77 -0
  85. package/dist/components/dashboard/skeletons.cjs +54 -0
  86. package/dist/components/dashboard/skeletons.d.cts +15 -0
  87. package/dist/components/dashboard/skeletons.d.ts +15 -0
  88. package/dist/components/dashboard/skeletons.js +54 -0
  89. package/dist/components/dashboard/spacing.cjs +10 -0
  90. package/dist/components/dashboard/spacing.d.cts +4 -0
  91. package/dist/components/dashboard/spacing.d.ts +4 -0
  92. package/dist/components/dashboard/spacing.js +10 -0
  93. package/dist/components/dashboard/stale-indicator.cjs +42 -0
  94. package/dist/components/dashboard/stale-indicator.d.cts +15 -0
  95. package/dist/components/dashboard/stale-indicator.d.ts +15 -0
  96. package/dist/components/dashboard/stale-indicator.js +42 -0
  97. package/dist/components/dashboard/status.cjs +66 -0
  98. package/dist/components/dashboard/status.d.cts +15 -0
  99. package/dist/components/dashboard/status.d.ts +15 -0
  100. package/dist/components/dashboard/status.js +66 -0
  101. package/dist/components/dashboard/tone.cjs +34 -0
  102. package/dist/components/dashboard/tone.d.cts +15 -0
  103. package/dist/components/dashboard/tone.d.ts +15 -0
  104. package/dist/components/dashboard/tone.js +34 -0
  105. package/dist/components/dashboard/typography.cjs +99 -0
  106. package/dist/components/dashboard/typography.d.cts +57 -0
  107. package/dist/components/dashboard/typography.d.ts +57 -0
  108. package/dist/components/dashboard/typography.js +99 -0
  109. package/dist/components/ui/badge.cjs +5 -1
  110. package/dist/components/ui/badge.d.cts +1 -1
  111. package/dist/components/ui/badge.d.ts +1 -1
  112. package/dist/components/ui/badge.js +5 -1
  113. package/dist/index.cjs +1 -0
  114. package/dist/index.d.cts +16 -0
  115. package/dist/index.d.ts +16 -0
  116. package/dist/index.js +1 -0
  117. package/dist/reference.cjs +1260 -0
  118. package/dist/reference.d.cts +11 -0
  119. package/dist/reference.d.ts +11 -0
  120. package/dist/reference.js +1230 -0
  121. package/dist/styles/glass-board.css +43 -0
  122. package/dist/styles/globals.css +59 -0
  123. package/package.json +16 -4
  124. package/scripts/ensure-pnpm-publish.mjs +23 -0
  125. package/scripts/smoke-dist.mjs +68 -0
  126. package/src/components/context-editor/CapabilitySection.tsx +85 -0
  127. package/src/components/context-editor/ContextEditor.tsx +138 -0
  128. package/src/components/context-editor/PresetBar.tsx +94 -0
  129. package/src/components/context-editor/SkillsSection.tsx +37 -0
  130. package/src/components/context-editor/SystemPromptSection.tsx +88 -0
  131. package/src/components/context-editor/ToolsSection.tsx +37 -0
  132. package/src/components/context-editor/index.ts +7 -0
  133. package/src/components/context-editor/parts.tsx +217 -0
  134. package/src/components/context-editor/use-context-editor-model.ts +296 -0
  135. package/src/components/dashboard/__tests__/catalog.test.ts +62 -0
  136. package/src/components/dashboard/__tests__/glass.test.tsx +42 -0
  137. package/src/components/dashboard/__tests__/state.test.tsx +127 -0
  138. package/src/components/dashboard/__tests__/variants.test.tsx +95 -0
  139. package/src/components/dashboard/activity-list.tsx +99 -0
  140. package/src/components/dashboard/catalog.json +312 -0
  141. package/src/components/dashboard/catalog.ts +29 -0
  142. package/src/components/dashboard/data-boundary.tsx +54 -0
  143. package/src/components/dashboard/empty-state.tsx +70 -0
  144. package/src/components/dashboard/icon-button.tsx +58 -0
  145. package/src/components/dashboard/index.ts +21 -0
  146. package/src/components/dashboard/item-list.tsx +106 -0
  147. package/src/components/dashboard/key-value.tsx +54 -0
  148. package/src/components/dashboard/layout.tsx +286 -0
  149. package/src/components/dashboard/metric.tsx +139 -0
  150. package/src/components/dashboard/progress-ring.tsx +100 -0
  151. package/src/components/dashboard/skeletons.tsx +73 -0
  152. package/src/components/dashboard/spacing.ts +14 -0
  153. package/src/components/dashboard/stale-indicator.tsx +55 -0
  154. package/src/components/dashboard/status.tsx +88 -0
  155. package/src/components/dashboard/tone.ts +48 -0
  156. package/src/components/dashboard/typography.tsx +151 -0
  157. package/src/components/reference/ActivityExample.tsx +68 -0
  158. package/src/components/reference/ResourceExample.tsx +78 -0
  159. package/src/components/reference/SchedulerExample.tsx +88 -0
  160. package/src/components/reference/StarterExample.tsx +48 -0
  161. package/src/components/reference/index.ts +10 -0
  162. package/src/components/ui/badge.tsx +6 -0
  163. package/src/index.ts +7 -0
  164. package/src/reference.ts +15 -0
  165. package/src/styles/glass-board.css +43 -0
  166. package/src/styles/globals.css +59 -0
  167. package/tsup.config.ts +18 -4
  168. package/tsup.reference.config.ts +15 -0
  169. package/vitest.config.ts +8 -0
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Shared glass board — the frosted-board look, framework-agnostic.
3
+ *
4
+ * `.glass-canvas` paints the ambient accent-glow backdrop; `.glass-tile`
5
+ * is a translucent, backdrop-blurred surface with a luminous hairline rim.
6
+ * The desktop dashboard and the styleguide preview both consume this file
7
+ * so widgets render on an identical board.
8
+ *
9
+ * Depends on the canonical `--glass-*` tokens in globals.css. Dark is the
10
+ * primary target; light mirrors the same relationships (frosted white
11
+ * glass over a soft tinted canvas).
12
+ */
13
+
14
+ /* ── Canvas ──────────────────────────────────────────────────────
15
+ Ambient accent glow the glass tiles pick up. */
16
+ .glass-canvas {
17
+ --glass-canvas-base: #e9eaef;
18
+ --glass-glow-a: color-mix(in srgb, var(--accent-primary) 16%, transparent);
19
+ --glass-glow-b: color-mix(in srgb, var(--brand-primary) 12%, transparent);
20
+ background:
21
+ radial-gradient(90% 70% at 85% -10%, var(--glass-glow-a), transparent 60%),
22
+ radial-gradient(80% 60% at -10% 110%, var(--glass-glow-b), transparent 60%),
23
+ var(--glass-canvas-base);
24
+ }
25
+
26
+ .dark .glass-canvas {
27
+ --glass-canvas-base: #060608;
28
+ --glass-glow-a: color-mix(in srgb, var(--accent-primary) 48%, transparent);
29
+ --glass-glow-b: color-mix(in srgb, var(--brand-primary) 30%, transparent);
30
+ }
31
+
32
+ /* ── Glass tile surface ──────────────────────────────────────────
33
+ Translucent, blurred surface floating over the canvas. The surface is
34
+ static on hover — the tile is content, not a button, so pointing at it
35
+ must not change it. (`--glass-hover` is still used for row hover *inside*
36
+ widgets.) The transition covers the drag/resize state changes only. */
37
+ .glass-tile {
38
+ background: var(--glass-tile);
39
+ border: 1px solid var(--glass-border);
40
+ backdrop-filter: blur(24px) saturate(140%);
41
+ box-shadow: inset 0 1px 0 var(--glass-rim);
42
+ transition: background-color 150ms ease, border-color 150ms ease;
43
+ }
@@ -179,6 +179,27 @@
179
179
  --sidebar-accent-foreground: var(--text-primary);
180
180
  --sidebar-border: var(--border-subtle);
181
181
  --sidebar-ring: var(--border-focus);
182
+
183
+ /* ── Glass (dashboard) ────────────────────────────────────
184
+ Canonical translucent surface language for the glass
185
+ dashboard. The host `dashboard.css` derives its `--dash-*`
186
+ tokens from these, and the `.glass` scope below remaps the
187
+ component-facing `--surface-*` tokens to them. Light =
188
+ frosted white; dark values live in the `.dark` block. */
189
+ --glass-tile: rgba(255, 255, 255, 0.52); /* base tile (host) */
190
+ --glass-surface: rgba(255, 255, 255, 0.62); /* raised card */
191
+ --glass-surface-flat: rgba(255, 255, 255, 0.40); /* flat row */
192
+ --glass-border: rgba(15, 17, 23, 0.10);
193
+ --glass-rim: rgba(255, 255, 255, 0.60);
194
+ --glass-hover: rgba(255, 255, 255, 0.72);
195
+
196
+ /* Component-facing surface tokens. Default to the solid design
197
+ tokens so components look unchanged outside the `.glass`
198
+ scope; the scope flips them to the glass values above. */
199
+ --surface-raised: var(--bg-surface);
200
+ --surface-flat: var(--bg-elevated);
201
+ --surface-line: var(--border-subtle);
202
+ --surface-rim: transparent;
182
203
  }
183
204
 
184
205
  /* ── Scrollbars ─────────────────────────────────────────────── */
@@ -421,6 +442,44 @@
421
442
  --sidebar-accent-foreground: var(--text-primary);
422
443
  --sidebar-border: var(--border-subtle);
423
444
  --sidebar-ring: var(--border-focus);
445
+
446
+ /* ── Glass (dashboard) — dark: low-opacity white over the dark
447
+ canvas glow. `--surface-*` defaults stay solid; the `.glass`
448
+ scope flips them (values shared across themes via the vars). */
449
+ --glass-tile: rgba(255, 255, 255, 0.06);
450
+ --glass-surface: rgba(255, 255, 255, 0.09);
451
+ --glass-surface-flat: rgba(255, 255, 255, 0.05);
452
+ --glass-border: rgba(255, 255, 255, 0.12);
453
+ --glass-rim: rgba(255, 255, 255, 0.08);
454
+ --glass-hover: rgba(255, 255, 255, 0.13);
455
+ }
456
+
457
+ /* ── Glass scope ─────────────────────────────────────────────────
458
+ Subtree-local class applied by `WidgetContent` (default on). It
459
+ remaps the component-facing surface tokens and the container/border
460
+ shadcn bridge tokens to the translucent glass values, so dashboard
461
+ components read as part of the frosted tile. Interactive controls
462
+ (`--input`) and portalled surfaces (`--popover`, rendered at
463
+ document.body outside this scope) stay solid for legibility. No
464
+ `backdrop-filter` here — the host tile provides the single blur. */
465
+ .glass {
466
+ /* component surface tokens */
467
+ --surface-raised: var(--glass-surface);
468
+ --surface-flat: var(--glass-surface-flat);
469
+ --surface-line: var(--glass-border);
470
+ --surface-rim: var(--glass-rim);
471
+
472
+ /* containers + borders for primitives used inside widgets */
473
+ --card: var(--glass-surface);
474
+ --secondary: var(--glass-surface-flat);
475
+ --muted: var(--glass-surface-flat);
476
+ --accent: var(--glass-surface-flat);
477
+ --border: var(--glass-border);
478
+
479
+ /* keep interactive controls + portalled surfaces solid */
480
+ --input: var(--border-subtle);
481
+ --popover: var(--bg-elevated);
482
+ --ring: var(--border-focus);
424
483
  }
425
484
 
426
485
  html {
package/tsup.config.ts CHANGED
@@ -1,18 +1,32 @@
1
1
  import { defineConfig } from "tsup";
2
2
  import { cpSync } from "node:fs";
3
3
 
4
+ // Mirror the source tree 1:1 (bundle: false) so deep imports keep working.
5
+ // The reference entry is bundled separately in tsup.reference.config.ts, which
6
+ // the build script runs *after* this pass (this one cleans; that one does not).
4
7
  export default defineConfig({
5
- // Tells tsup to grab everything in your src directory
6
- entry: ["src/**/*.{ts,tsx}"],
8
+ entry: [
9
+ "src/**/*.{ts,tsx}",
10
+ "!src/**/*.test.{ts,tsx}",
11
+ "!src/**/__tests__/**",
12
+ "!src/reference.ts",
13
+ "!src/components/reference/**",
14
+ ],
7
15
  format: ["esm", "cjs"],
8
16
  dts: true,
9
17
  clean: true,
10
18
  splitting: true,
11
-
12
- // This is the golden key: it stops esbuild from merging everything
19
+
20
+ // This is the golden key: it stops esbuild from merging everything
13
21
  // into index.js and forces it to mirror your exact folder structure.
14
22
  bundle: false,
15
23
  onSuccess: () => {
16
24
  cpSync("src/styles", "dist/styles", { recursive: true });
25
+ // The catalogue is plain data served as @sero-ai/ui/dashboard-catalog.json;
26
+ // the mirror pass only emits .ts/.tsx, so copy the JSON across by hand.
27
+ cpSync(
28
+ "src/components/dashboard/catalog.json",
29
+ "dist/components/dashboard/catalog.json",
30
+ );
17
31
  },
18
32
  });
@@ -0,0 +1,15 @@
1
+ import { defineConfig } from "tsup";
2
+
3
+ // Reference examples are a public entrypoint, so bundle them into a single
4
+ // self-contained file that resolves under Node ESM (the rest of the package is
5
+ // bundler-resolved). Runtime deps stay external; only local component code is
6
+ // inlined. Runs after the mirror pass (tsup.config.ts) with `clean: false`, so
7
+ // it adds dist/reference.* without wiping the mirrored output.
8
+ export default defineConfig({
9
+ entry: ["src/reference.ts"],
10
+ format: ["esm", "cjs"],
11
+ dts: true,
12
+ clean: false,
13
+ splitting: false,
14
+ bundle: true,
15
+ });
@@ -0,0 +1,8 @@
1
+ import { defineConfig } from "vitest/config";
2
+
3
+ export default defineConfig({
4
+ test: {
5
+ include: ["src/**/*.test.ts", "src/**/*.test.tsx"],
6
+ environment: "jsdom",
7
+ },
8
+ });