@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,312 @@
1
+ [
2
+ {
3
+ "name": "WidgetContent",
4
+ "category": "layout",
5
+ "kind": "composite",
6
+ "summary": "Full-height widget frame with standard padding and a container-query boundary.",
7
+ "useWhen": "As the outermost element of every dashboard widget.",
8
+ "related": ["Stack", "Inline"],
9
+ "status": "stable",
10
+ "example": "<WidgetContent><Stack gap=\"sm\">…</Stack></WidgetContent>"
11
+ },
12
+ {
13
+ "name": "Stack",
14
+ "category": "layout",
15
+ "kind": "composite",
16
+ "summary": "Vertical layout with semantic spacing, alignment and optional scrolling.",
17
+ "useWhen": "For the primary top-to-bottom content flow inside a widget.",
18
+ "related": ["Inline", "WidgetContent"],
19
+ "status": "stable",
20
+ "example": "<Stack gap=\"sm\" scroll>…</Stack>"
21
+ },
22
+ {
23
+ "name": "Inline",
24
+ "category": "layout",
25
+ "kind": "composite",
26
+ "summary": "Horizontal layout with spacing, alignment, wrap and justify.",
27
+ "useWhen": "For a row of items such as a header with a trailing action.",
28
+ "related": ["Stack"],
29
+ "status": "stable",
30
+ "example": "<Inline justify=\"between\" align=\"center\">…</Inline>"
31
+ },
32
+ {
33
+ "name": "Grid",
34
+ "category": "layout",
35
+ "kind": "composite",
36
+ "summary": "Responsive grid with bounded columns and gap.",
37
+ "useWhen": "For metric and summary layouts that reflow by width.",
38
+ "related": ["MetricGroup"],
39
+ "status": "stable",
40
+ "example": "<Grid columns=\"auto\" minColumnWidth={120}>…</Grid>"
41
+ },
42
+ {
43
+ "name": "Section",
44
+ "category": "layout",
45
+ "kind": "composite",
46
+ "summary": "Compact section with optional heading, description and trailing action.",
47
+ "useWhen": "To group related content under a labelled heading.",
48
+ "related": ["Divider", "Heading"],
49
+ "status": "stable",
50
+ "example": "<Section heading=\"Summary\" action={…}>…</Section>"
51
+ },
52
+ {
53
+ "name": "Divider",
54
+ "category": "layout",
55
+ "kind": "composite",
56
+ "summary": "Compact horizontal or vertical divider built on Separator.",
57
+ "useWhen": "To separate sections without a heavy border.",
58
+ "related": ["Section"],
59
+ "status": "stable",
60
+ "example": "<Divider spacing=\"sm\" />"
61
+ },
62
+ {
63
+ "name": "Text",
64
+ "category": "typography",
65
+ "kind": "composite",
66
+ "summary": "Semantic text variants (body, label, supporting, muted, numeric) with truncation.",
67
+ "useWhen": "For any text, instead of ad-hoc font-size utilities.",
68
+ "related": ["Heading"],
69
+ "status": "stable",
70
+ "example": "<Text variant=\"label\">Jobs</Text>"
71
+ },
72
+ {
73
+ "name": "Heading",
74
+ "category": "typography",
75
+ "kind": "composite",
76
+ "summary": "Compact heading levels and sizes that keep correct HTML semantics.",
77
+ "useWhen": "For section and view titles.",
78
+ "related": ["Section", "Text"],
79
+ "status": "stable",
80
+ "example": "<Heading level={2} size=\"md\">Overview</Heading>"
81
+ },
82
+ {
83
+ "name": "Icon",
84
+ "category": "typography",
85
+ "kind": "composite",
86
+ "summary": "Consistent icon wrapper for size, tone and accessibility.",
87
+ "useWhen": "To render an icon component with a shared size and tone.",
88
+ "related": ["IconButton"],
89
+ "status": "stable",
90
+ "example": "<Icon icon={Clock} size=\"sm\" tone=\"warning\" />"
91
+ },
92
+ {
93
+ "name": "Metric",
94
+ "category": "data-display",
95
+ "kind": "composite",
96
+ "summary": "Label + value with optional icon, supporting text and trend.",
97
+ "useWhen": "To show a single number inline.",
98
+ "related": ["MetricCard", "MetricGroup"],
99
+ "status": "stable",
100
+ "example": "<Metric label=\"Jobs\" value={6} />"
101
+ },
102
+ {
103
+ "name": "MetricCard",
104
+ "category": "data-display",
105
+ "kind": "composite",
106
+ "summary": "A contained surface for a Metric or compact summary.",
107
+ "useWhen": "To give a metric its own bounded card.",
108
+ "related": ["Metric", "MetricGroup"],
109
+ "status": "stable",
110
+ "example": "<MetricCard><Metric label=\"Jobs\" value={6} /></MetricCard>"
111
+ },
112
+ {
113
+ "name": "MetricGroup",
114
+ "category": "data-display",
115
+ "kind": "composite",
116
+ "summary": "Arranges multiple metrics responsively in a bounded grid.",
117
+ "useWhen": "To show several metrics that reflow by width.",
118
+ "related": ["Metric", "Grid"],
119
+ "status": "stable",
120
+ "example": "<MetricGroup><Metric … /><Metric … /></MetricGroup>"
121
+ },
122
+ {
123
+ "name": "Status",
124
+ "category": "data-display",
125
+ "kind": "composite",
126
+ "summary": "Semantic status dot, label or pill with neutral/success/warning/error/info tones.",
127
+ "useWhen": "To show a health or state indicator. Map domain status onto a tone.",
128
+ "related": ["Badge"],
129
+ "status": "stable",
130
+ "example": "<Status tone=\"success\">Active</Status>"
131
+ },
132
+ {
133
+ "name": "Badge",
134
+ "category": "data-display",
135
+ "kind": "primitive",
136
+ "summary": "Existing badge primitive, extended with success/warning/info tones.",
137
+ "useWhen": "For compact counts, tags and category labels.",
138
+ "related": ["Status"],
139
+ "status": "stable",
140
+ "example": "<Badge variant=\"success\">Passed</Badge>"
141
+ },
142
+ {
143
+ "name": "KeyValue",
144
+ "category": "data-display",
145
+ "kind": "composite",
146
+ "summary": "A single label/value row with predictable alignment and truncation.",
147
+ "useWhen": "For metadata, totals and configuration summaries.",
148
+ "related": ["KeyValueList"],
149
+ "status": "stable",
150
+ "example": "<KeyValue label=\"Region\" value=\"eu-west-1\" mono />"
151
+ },
152
+ {
153
+ "name": "KeyValueList",
154
+ "category": "data-display",
155
+ "kind": "composite",
156
+ "summary": "A vertical list of KeyValue rows.",
157
+ "useWhen": "For a block of metadata pairs.",
158
+ "related": ["KeyValue"],
159
+ "status": "stable",
160
+ "example": "<KeyValueList><KeyValue … /></KeyValueList>"
161
+ },
162
+ {
163
+ "name": "ItemList",
164
+ "category": "data-display",
165
+ "kind": "composite",
166
+ "summary": "Compact rows with leading media, text, trailing metadata, actions and overflow.",
167
+ "useWhen": "For entity lists (files, notes, results).",
168
+ "related": ["ItemListItem", "ActivityList"],
169
+ "status": "stable",
170
+ "example": "<ItemList overflowCount={3}><ItemListItem … /></ItemList>"
171
+ },
172
+ {
173
+ "name": "ItemListItem",
174
+ "category": "data-display",
175
+ "kind": "composite",
176
+ "summary": "A single compact list row with media, primary/secondary text and actions.",
177
+ "useWhen": "As the row inside an ItemList.",
178
+ "related": ["ItemList"],
179
+ "status": "stable",
180
+ "example": "<ItemListItem primary=\"Report.pdf\" trailing=\"2h\" />"
181
+ },
182
+ {
183
+ "name": "ActivityList",
184
+ "category": "data-display",
185
+ "kind": "composite",
186
+ "summary": "A chronological list for recent events with a shared overflow footer.",
187
+ "useWhen": "For time-ordered activity or upcoming events.",
188
+ "related": ["ActivityListItem", "ItemList"],
189
+ "status": "stable",
190
+ "example": "<ActivityList><ActivityListItem … /></ActivityList>"
191
+ },
192
+ {
193
+ "name": "ActivityListItem",
194
+ "category": "data-display",
195
+ "kind": "composite",
196
+ "summary": "An event row with a status marker or icon, label, timestamp and detail.",
197
+ "useWhen": "As the row inside an ActivityList.",
198
+ "related": ["ActivityList", "Status"],
199
+ "status": "stable",
200
+ "example": "<ActivityListItem label=\"Backup\" timestamp=\"08:00\" tone=\"success\" />"
201
+ },
202
+ {
203
+ "name": "ProgressRing",
204
+ "category": "data-display",
205
+ "kind": "composite",
206
+ "summary": "Accessible circular progress / donut gauge, no charting dependency.",
207
+ "useWhen": "For a bounded value such as a success rate or usage percentage.",
208
+ "related": ["Metric"],
209
+ "status": "stable",
210
+ "example": "<ProgressRing value={75} label=\"Success rate\" tone=\"success\" />"
211
+ },
212
+ {
213
+ "name": "StaleIndicator",
214
+ "category": "data-display",
215
+ "kind": "composite",
216
+ "summary": "Compact hint that data may be out of date, with optional refresh action.",
217
+ "useWhen": "When displayed data can lag its source.",
218
+ "related": ["DataBoundary"],
219
+ "status": "stable",
220
+ "example": "<StaleIndicator lastUpdated=\"Updated 5m ago\" onRefresh={…} />"
221
+ },
222
+ {
223
+ "name": "DataBoundary",
224
+ "category": "state",
225
+ "kind": "composite",
226
+ "summary": "Selects presentation for loading / ready / empty / stale / error states.",
227
+ "useWhen": "To switch a widget's content by data state without owning fetching.",
228
+ "related": ["EmptyState", "MetricSkeleton", "StaleIndicator"],
229
+ "status": "stable",
230
+ "example": "<DataBoundary state={state} loading={…} empty={…} error={…}>…</DataBoundary>"
231
+ },
232
+ {
233
+ "name": "EmptyState",
234
+ "category": "state",
235
+ "kind": "composite",
236
+ "summary": "Compact empty state built on the Empty primitives.",
237
+ "useWhen": "When there is nothing to show yet.",
238
+ "related": ["DataBoundary"],
239
+ "status": "stable",
240
+ "example": "<EmptyState icon={Inbox} title=\"No activity yet\" />"
241
+ },
242
+ {
243
+ "name": "Alert",
244
+ "category": "state",
245
+ "kind": "primitive",
246
+ "summary": "Existing alert primitive for inline warnings and errors.",
247
+ "useWhen": "For a persistent inline message inside a widget or view.",
248
+ "related": ["DataBoundary"],
249
+ "status": "stable",
250
+ "example": "<Alert variant=\"destructive\">Failed to load</Alert>"
251
+ },
252
+ {
253
+ "name": "MetricSkeleton",
254
+ "category": "state",
255
+ "kind": "composite",
256
+ "summary": "Loading placeholder for a row of metrics.",
257
+ "useWhen": "As the `loading` fallback for metric layouts.",
258
+ "related": ["DataBoundary", "ListSkeleton"],
259
+ "status": "stable",
260
+ "example": "<MetricSkeleton count={3} />"
261
+ },
262
+ {
263
+ "name": "ListSkeleton",
264
+ "category": "state",
265
+ "kind": "composite",
266
+ "summary": "Loading placeholder for a list of rows.",
267
+ "useWhen": "As the `loading` fallback for item lists.",
268
+ "related": ["DataBoundary", "ItemList"],
269
+ "status": "stable",
270
+ "example": "<ListSkeleton count={4} />"
271
+ },
272
+ {
273
+ "name": "ActivitySkeleton",
274
+ "category": "state",
275
+ "kind": "composite",
276
+ "summary": "Loading placeholder for an activity list.",
277
+ "useWhen": "As the `loading` fallback for activity feeds.",
278
+ "related": ["DataBoundary", "ActivityList"],
279
+ "status": "stable",
280
+ "example": "<ActivitySkeleton count={4} />"
281
+ },
282
+ {
283
+ "name": "Skeleton",
284
+ "category": "state",
285
+ "kind": "primitive",
286
+ "summary": "Existing skeleton primitive for bespoke loading shapes.",
287
+ "useWhen": "When the prebuilt skeleton patterns do not fit.",
288
+ "related": ["MetricSkeleton", "ListSkeleton", "ActivitySkeleton"],
289
+ "status": "stable",
290
+ "example": "<Skeleton className=\"h-4 w-24\" />"
291
+ },
292
+ {
293
+ "name": "Button",
294
+ "category": "action",
295
+ "kind": "primitive",
296
+ "summary": "Existing button primitive, the standard text-action control.",
297
+ "useWhen": "For a labelled action.",
298
+ "related": ["IconButton"],
299
+ "status": "stable",
300
+ "example": "<Button size=\"sm\">Open</Button>"
301
+ },
302
+ {
303
+ "name": "IconButton",
304
+ "category": "action",
305
+ "kind": "composite",
306
+ "summary": "Small icon-only button with a required accessible label.",
307
+ "useWhen": "For a compact action such as refresh or dismiss.",
308
+ "related": ["Button", "Icon"],
309
+ "status": "stable",
310
+ "example": "<IconButton icon={RotateCw} label=\"Refresh\" size=\"xs\" />"
311
+ }
312
+ ]
@@ -0,0 +1,29 @@
1
+ // Dashboard component catalogue — type for the JSON source of truth.
2
+ //
3
+ // The catalogue data lives in `catalog.json` (plain data, no compiler needed)
4
+ // and ships as `@sero-ai/ui/dashboard-catalog.json`. Tooling and the agent read
5
+ // that file directly; this module only provides the entry type so TypeScript
6
+ // callers can type the parsed JSON.
7
+ //
8
+ // Keep `catalog.json` in step with the two readable views on release:
9
+ // - packages/templates/skills/sero-dashboard-ui/references/component-catalog.md
10
+ // - the docs-site dashboard component catalogue page
11
+ // (Generation + drift validation is a deferred follow-up.)
12
+
13
+ export interface DashboardComponentCatalogEntry {
14
+ name: string;
15
+ category:
16
+ | "layout"
17
+ | "typography"
18
+ | "data-display"
19
+ | "state"
20
+ | "action"
21
+ | "filter";
22
+ /** `primitive` = existing @sero-ai/ui primitive; `composite` = new dashboard component. */
23
+ kind: "primitive" | "composite";
24
+ summary: string;
25
+ useWhen: string;
26
+ related?: string[];
27
+ status: "stable" | "experimental";
28
+ example?: string;
29
+ }
@@ -0,0 +1,54 @@
1
+ // DataBoundary — a presentation boundary for runtime data states.
2
+ //
3
+ // It selects which content to show for loading / ready / empty / stale / error.
4
+ // It is presentation only: it does not fetch data, subscribe to sources or own
5
+ // retry behaviour. The plugin passes the current state and the fallback nodes.
6
+
7
+ import * as React from "react";
8
+
9
+ export type DataState = "loading" | "ready" | "empty" | "stale" | "error";
10
+
11
+ export interface DataBoundaryProps {
12
+ state: DataState;
13
+ /** Shown while `state === "loading"`. */
14
+ loading?: React.ReactNode;
15
+ /** Shown while `state === "empty"`. */
16
+ empty?: React.ReactNode;
17
+ /** Shown while `state === "error"`. */
18
+ error?: React.ReactNode;
19
+ /** Banner rendered above children while `state === "stale"`. */
20
+ stale?: React.ReactNode;
21
+ /** Ready content, also shown (below `stale`) while `state === "stale"`. */
22
+ children?: React.ReactNode;
23
+ }
24
+
25
+ /** Selects presentation for the current data state. */
26
+ function DataBoundary({
27
+ state,
28
+ loading,
29
+ empty,
30
+ error,
31
+ stale,
32
+ children,
33
+ }: DataBoundaryProps) {
34
+ switch (state) {
35
+ case "loading":
36
+ return <>{loading ?? null}</>;
37
+ case "empty":
38
+ return <>{empty ?? null}</>;
39
+ case "error":
40
+ return <>{error ?? null}</>;
41
+ case "stale":
42
+ return (
43
+ <>
44
+ {stale}
45
+ {children}
46
+ </>
47
+ );
48
+ case "ready":
49
+ default:
50
+ return <>{children}</>;
51
+ }
52
+ }
53
+
54
+ export { DataBoundary };
@@ -0,0 +1,70 @@
1
+ // EmptyState — a compact empty state built on the Empty primitives.
2
+ //
3
+ // Tightened for widget use (the base Empty primitive pads for full pages).
4
+ // Optional icon, title, message and action.
5
+
6
+ import * as React from "react";
7
+
8
+ import { cn } from "../../lib/utils";
9
+ import {
10
+ Empty,
11
+ EmptyContent,
12
+ EmptyDescription,
13
+ EmptyHeader,
14
+ EmptyMedia,
15
+ EmptyTitle,
16
+ } from "../ui/empty";
17
+ import { Icon } from "./typography";
18
+
19
+ export interface EmptyStateProps
20
+ extends Omit<React.ComponentProps<typeof Empty>, "title"> {
21
+ /** Leading icon component (e.g. a lucide-react icon). */
22
+ icon?: React.ComponentType<{ className?: string }>;
23
+ title: React.ReactNode;
24
+ message?: React.ReactNode;
25
+ /** Optional action (e.g. a Button). */
26
+ action?: React.ReactNode;
27
+ }
28
+
29
+ /** Compact empty state for widgets and plugin views. */
30
+ function EmptyState({
31
+ className,
32
+ icon,
33
+ title,
34
+ message,
35
+ action,
36
+ ...props
37
+ }: EmptyStateProps) {
38
+ return (
39
+ <Empty
40
+ data-slot="empty-state"
41
+ className={cn(
42
+ "flex-1 gap-3 border-0 p-4 md:p-4",
43
+ className,
44
+ )}
45
+ {...props}
46
+ >
47
+ <EmptyHeader className="gap-1.5">
48
+ {icon && (
49
+ <EmptyMedia
50
+ variant="icon"
51
+ className="size-9 border-[var(--surface-line)] bg-[var(--surface-flat)] text-[var(--text-muted)]"
52
+ >
53
+ <Icon icon={icon} size="md" className="text-current" />
54
+ </EmptyMedia>
55
+ )}
56
+ <EmptyTitle className="text-sm font-medium text-[var(--text-primary)]">
57
+ {title}
58
+ </EmptyTitle>
59
+ {message && (
60
+ <EmptyDescription className="text-xs text-[var(--text-muted)]">
61
+ {message}
62
+ </EmptyDescription>
63
+ )}
64
+ </EmptyHeader>
65
+ {action && <EmptyContent className="gap-2">{action}</EmptyContent>}
66
+ </Empty>
67
+ );
68
+ }
69
+
70
+ export { EmptyState };
@@ -0,0 +1,58 @@
1
+ // IconButton — a small icon-only button built on the Button primitive.
2
+ //
3
+ // Widget-appropriate sizing with a required accessible label, since an
4
+ // icon-only control carries no text for assistive tech.
5
+
6
+ import * as React from "react";
7
+
8
+ import { cn } from "../../lib/utils";
9
+ import { Button } from "../ui/button";
10
+ import { Icon } from "./typography";
11
+
12
+ const sizeMap = {
13
+ xs: "icon-xs",
14
+ sm: "icon-sm",
15
+ md: "icon",
16
+ } as const;
17
+
18
+ const iconSizeMap = {
19
+ xs: "xs",
20
+ sm: "sm",
21
+ md: "md",
22
+ } as const;
23
+
24
+ export interface IconButtonProps
25
+ extends Omit<React.ComponentProps<typeof Button>, "size" | "children"> {
26
+ /** The icon component to render (e.g. a lucide-react icon). */
27
+ icon: React.ComponentType<{ className?: string }>;
28
+ /** Required accessible label — the control has no visible text. */
29
+ label: string;
30
+ size?: keyof typeof sizeMap;
31
+ }
32
+
33
+ /** A compact icon-only button with a required accessible label. */
34
+ function IconButton({
35
+ className,
36
+ icon,
37
+ label,
38
+ size = "sm",
39
+ variant = "ghost",
40
+ ...props
41
+ }: IconButtonProps) {
42
+ return (
43
+ <Button
44
+ data-slot="icon-button"
45
+ type="button"
46
+ variant={variant}
47
+ size={sizeMap[size]}
48
+ aria-label={label}
49
+ title={label}
50
+ className={cn("text-[var(--text-muted)]", className)}
51
+ {...props}
52
+ >
53
+ <Icon icon={icon} size={iconSizeMap[size]} className="text-current" />
54
+ </Button>
55
+ );
56
+ }
57
+
58
+ export { IconButton };
@@ -0,0 +1,21 @@
1
+ // @sero-ai/ui dashboard components — shared compact presentation for widgets
2
+ // and full plugin views. Import from the package root: `@sero-ai/ui`.
3
+ //
4
+ // The component catalogue (metadata for discovery tooling) is plain data at
5
+ // `@sero-ai/ui/dashboard-catalog.json`, not exported from here.
6
+
7
+ export * from "./tone";
8
+ export * from "./spacing";
9
+ export * from "./layout";
10
+ export * from "./typography";
11
+ export * from "./metric";
12
+ export * from "./status";
13
+ export * from "./key-value";
14
+ export * from "./item-list";
15
+ export * from "./activity-list";
16
+ export * from "./progress-ring";
17
+ export * from "./stale-indicator";
18
+ export * from "./data-boundary";
19
+ export * from "./empty-state";
20
+ export * from "./skeletons";
21
+ export * from "./icon-button";
@@ -0,0 +1,106 @@
1
+ // ItemList and ItemListItem — compact rows for dashboard lists.
2
+ //
3
+ // Built on the existing Item primitive, tightened for dense widget use. Each
4
+ // row takes optional leading media, primary/secondary text, trailing metadata
5
+ // and actions. ItemList adds a shared overflow ("+N more") treatment so widgets
6
+ // stop hand-rolling it.
7
+
8
+ import * as React from "react";
9
+
10
+ import { cn } from "../../lib/utils";
11
+ import {
12
+ Item,
13
+ ItemActions,
14
+ ItemContent,
15
+ ItemDescription,
16
+ ItemMedia,
17
+ ItemTitle,
18
+ } from "../ui/item";
19
+
20
+ export interface ItemListItemProps
21
+ extends Omit<React.ComponentProps<typeof Item>, "children"> {
22
+ /** Leading media — an icon, avatar or status marker. */
23
+ leading?: React.ReactNode;
24
+ primary: React.ReactNode;
25
+ secondary?: React.ReactNode;
26
+ /** Trailing metadata (e.g. a timestamp or count). */
27
+ trailing?: React.ReactNode;
28
+ /** Trailing interactive actions (e.g. an IconButton). */
29
+ actions?: React.ReactNode;
30
+ }
31
+
32
+ /** A single compact list row with optional media, text, metadata and actions. */
33
+ function ItemListItem({
34
+ className,
35
+ leading,
36
+ primary,
37
+ secondary,
38
+ trailing,
39
+ actions,
40
+ variant = "default",
41
+ ...props
42
+ }: ItemListItemProps) {
43
+ return (
44
+ <Item
45
+ data-slot="item-list-item"
46
+ variant={variant}
47
+ size="sm"
48
+ className={cn(
49
+ "gap-2 rounded-md bg-[var(--surface-flat)] p-2 transition-colors hover:bg-[var(--glass-hover)]",
50
+ className,
51
+ )}
52
+ {...props}
53
+ >
54
+ {leading && (
55
+ <ItemMedia className="self-center">{leading}</ItemMedia>
56
+ )}
57
+ <ItemContent className="gap-0.5">
58
+ <ItemTitle className="truncate text-xs font-medium text-[var(--text-primary)]">
59
+ {primary}
60
+ </ItemTitle>
61
+ {secondary && (
62
+ <ItemDescription className="line-clamp-1 text-xs text-[var(--text-muted)]">
63
+ {secondary}
64
+ </ItemDescription>
65
+ )}
66
+ </ItemContent>
67
+ {trailing && (
68
+ <span className="shrink-0 text-[11px] tabular-nums text-[var(--text-muted)]">
69
+ {trailing}
70
+ </span>
71
+ )}
72
+ {actions && <ItemActions>{actions}</ItemActions>}
73
+ </Item>
74
+ );
75
+ }
76
+
77
+ export interface ItemListProps extends React.ComponentProps<"div"> {
78
+ /** Count of items not shown; renders a "+N more" footer when > 0. */
79
+ overflowCount?: number;
80
+ }
81
+
82
+ /** A vertical stack of ItemListItem rows with a shared overflow footer. */
83
+ function ItemList({
84
+ className,
85
+ overflowCount = 0,
86
+ children,
87
+ ...props
88
+ }: ItemListProps) {
89
+ return (
90
+ <div
91
+ data-slot="item-list"
92
+ role="list"
93
+ className={cn("flex min-w-0 flex-col gap-1", className)}
94
+ {...props}
95
+ >
96
+ {children}
97
+ {overflowCount > 0 && (
98
+ <span className="px-2 text-[11px] text-[var(--text-muted)]">
99
+ +{overflowCount} more
100
+ </span>
101
+ )}
102
+ </div>
103
+ );
104
+ }
105
+
106
+ export { ItemList, ItemListItem };