@sero-ai/ui 0.3.2 → 0.4.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 +628 -0
- package/.turbo/turbo-typecheck.log +1 -1
- package/CHANGELOG.md +38 -0
- package/dist/components/context-editor/CapabilitySection.cjs +57 -0
- package/dist/components/context-editor/CapabilitySection.d.cts +20 -0
- package/dist/components/context-editor/CapabilitySection.d.ts +20 -0
- package/dist/components/context-editor/CapabilitySection.js +57 -0
- package/dist/components/context-editor/ContextEditor.cjs +108 -0
- package/dist/components/context-editor/ContextEditor.d.cts +26 -0
- package/dist/components/context-editor/ContextEditor.d.ts +26 -0
- package/dist/components/context-editor/ContextEditor.js +108 -0
- package/dist/components/context-editor/PresetBar.cjs +71 -0
- package/dist/components/context-editor/PresetBar.d.cts +19 -0
- package/dist/components/context-editor/PresetBar.d.ts +19 -0
- package/dist/components/context-editor/PresetBar.js +71 -0
- package/dist/components/context-editor/SkillsSection.cjs +31 -0
- package/dist/components/context-editor/SkillsSection.d.cts +14 -0
- package/dist/components/context-editor/SkillsSection.d.ts +14 -0
- package/dist/components/context-editor/SkillsSection.js +31 -0
- package/dist/components/context-editor/SystemPromptSection.cjs +58 -0
- package/dist/components/context-editor/SystemPromptSection.d.cts +25 -0
- package/dist/components/context-editor/SystemPromptSection.d.ts +25 -0
- package/dist/components/context-editor/SystemPromptSection.js +58 -0
- package/dist/components/context-editor/ToolsSection.cjs +31 -0
- package/dist/components/context-editor/ToolsSection.d.cts +14 -0
- package/dist/components/context-editor/ToolsSection.d.ts +14 -0
- package/dist/components/context-editor/ToolsSection.js +31 -0
- package/dist/components/context-editor/index.cjs +8 -0
- package/dist/components/context-editor/index.d.cts +5 -0
- package/dist/components/context-editor/index.d.ts +5 -0
- package/dist/components/context-editor/index.js +8 -0
- package/dist/components/context-editor/parts.cjs +184 -0
- package/dist/components/context-editor/parts.d.cts +32 -0
- package/dist/components/context-editor/parts.d.ts +32 -0
- package/dist/components/context-editor/parts.js +184 -0
- package/dist/components/context-editor/use-context-editor-model.cjs +194 -0
- package/dist/components/context-editor/use-context-editor-model.d.cts +57 -0
- package/dist/components/context-editor/use-context-editor-model.d.ts +57 -0
- package/dist/components/context-editor/use-context-editor-model.js +194 -0
- package/dist/components/dashboard/activity-list.cjs +59 -0
- package/dist/components/dashboard/activity-list.d.cts +27 -0
- package/dist/components/dashboard/activity-list.d.ts +27 -0
- package/dist/components/dashboard/activity-list.js +59 -0
- package/dist/components/dashboard/catalog.cjs +322 -0
- package/dist/components/dashboard/catalog.d.cts +14 -0
- package/dist/components/dashboard/catalog.d.ts +14 -0
- package/dist/components/dashboard/catalog.js +322 -0
- package/dist/components/dashboard/data-boundary.cjs +29 -0
- package/dist/components/dashboard/data-boundary.d.cts +21 -0
- package/dist/components/dashboard/data-boundary.d.ts +21 -0
- package/dist/components/dashboard/data-boundary.js +29 -0
- package/dist/components/dashboard/empty-state.cjs +49 -0
- package/dist/components/dashboard/empty-state.d.cts +20 -0
- package/dist/components/dashboard/empty-state.d.ts +20 -0
- package/dist/components/dashboard/empty-state.js +49 -0
- package/dist/components/dashboard/icon-button.cjs +40 -0
- package/dist/components/dashboard/icon-button.d.cts +24 -0
- package/dist/components/dashboard/icon-button.d.ts +24 -0
- package/dist/components/dashboard/icon-button.js +40 -0
- package/dist/components/dashboard/index.cjs +15 -0
- package/dist/components/dashboard/index.d.cts +24 -0
- package/dist/components/dashboard/index.d.ts +24 -0
- package/dist/components/dashboard/index.js +15 -0
- package/dist/components/dashboard/item-list.cjs +71 -0
- package/dist/components/dashboard/item-list.d.cts +28 -0
- package/dist/components/dashboard/item-list.d.ts +28 -0
- package/dist/components/dashboard/item-list.js +71 -0
- package/dist/components/dashboard/key-value.cjs +39 -0
- package/dist/components/dashboard/key-value.d.cts +17 -0
- package/dist/components/dashboard/key-value.d.ts +17 -0
- package/dist/components/dashboard/key-value.js +39 -0
- package/dist/components/dashboard/layout.cjs +193 -0
- package/dist/components/dashboard/layout.d.cts +91 -0
- package/dist/components/dashboard/layout.d.ts +91 -0
- package/dist/components/dashboard/layout.js +193 -0
- package/dist/components/dashboard/metric.cjs +98 -0
- package/dist/components/dashboard/metric.d.cts +44 -0
- package/dist/components/dashboard/metric.d.ts +44 -0
- package/dist/components/dashboard/metric.js +98 -0
- package/dist/components/dashboard/progress-ring.cjs +77 -0
- package/dist/components/dashboard/progress-ring.d.cts +25 -0
- package/dist/components/dashboard/progress-ring.d.ts +25 -0
- package/dist/components/dashboard/progress-ring.js +77 -0
- package/dist/components/dashboard/skeletons.cjs +54 -0
- package/dist/components/dashboard/skeletons.d.cts +15 -0
- package/dist/components/dashboard/skeletons.d.ts +15 -0
- package/dist/components/dashboard/skeletons.js +54 -0
- package/dist/components/dashboard/spacing.cjs +10 -0
- package/dist/components/dashboard/spacing.d.cts +4 -0
- package/dist/components/dashboard/spacing.d.ts +4 -0
- package/dist/components/dashboard/spacing.js +10 -0
- package/dist/components/dashboard/stale-indicator.cjs +42 -0
- package/dist/components/dashboard/stale-indicator.d.cts +15 -0
- package/dist/components/dashboard/stale-indicator.d.ts +15 -0
- package/dist/components/dashboard/stale-indicator.js +42 -0
- package/dist/components/dashboard/status.cjs +62 -0
- package/dist/components/dashboard/status.d.cts +15 -0
- package/dist/components/dashboard/status.d.ts +15 -0
- package/dist/components/dashboard/status.js +62 -0
- package/dist/components/dashboard/tone.cjs +26 -0
- package/dist/components/dashboard/tone.d.cts +9 -0
- package/dist/components/dashboard/tone.d.ts +9 -0
- package/dist/components/dashboard/tone.js +26 -0
- package/dist/components/dashboard/typography.cjs +99 -0
- package/dist/components/dashboard/typography.d.cts +57 -0
- package/dist/components/dashboard/typography.d.ts +57 -0
- package/dist/components/dashboard/typography.js +99 -0
- package/dist/components/reference/ActivityExample.cjs +47 -0
- package/dist/components/reference/ActivityExample.d.cts +5 -0
- package/dist/components/reference/ActivityExample.d.ts +5 -0
- package/dist/components/reference/ActivityExample.js +47 -0
- package/dist/components/reference/ResourceExample.cjs +54 -0
- package/dist/components/reference/ResourceExample.d.cts +5 -0
- package/dist/components/reference/ResourceExample.d.ts +5 -0
- package/dist/components/reference/ResourceExample.js +54 -0
- package/dist/components/reference/SchedulerExample.cjs +68 -0
- package/dist/components/reference/SchedulerExample.d.cts +5 -0
- package/dist/components/reference/SchedulerExample.d.ts +5 -0
- package/dist/components/reference/SchedulerExample.js +68 -0
- package/dist/components/reference/StarterExample.cjs +34 -0
- package/dist/components/reference/StarterExample.d.cts +5 -0
- package/dist/components/reference/StarterExample.d.ts +5 -0
- package/dist/components/reference/StarterExample.js +34 -0
- package/dist/components/reference/index.cjs +10 -0
- package/dist/components/reference/index.d.cts +5 -0
- package/dist/components/reference/index.d.ts +5 -0
- package/dist/components/reference/index.js +10 -0
- package/dist/components/ui/badge.cjs +5 -1
- package/dist/components/ui/badge.d.cts +1 -1
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/badge.js +5 -1
- package/dist/dashboard-catalog.cjs +8 -0
- package/dist/dashboard-catalog.d.cts +1 -0
- package/dist/dashboard-catalog.d.ts +1 -0
- package/dist/dashboard-catalog.js +8 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +15 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +1 -0
- package/dist/reference.cjs +12 -0
- package/dist/reference.d.cts +5 -0
- package/dist/reference.d.ts +5 -0
- package/dist/reference.js +12 -0
- package/dist/styles/glass-board.css +43 -0
- package/dist/styles/globals.css +59 -0
- package/package.json +70 -41
- package/src/components/context-editor/CapabilitySection.tsx +85 -0
- package/src/components/context-editor/ContextEditor.tsx +138 -0
- package/src/components/context-editor/PresetBar.tsx +94 -0
- package/src/components/context-editor/SkillsSection.tsx +37 -0
- package/src/components/context-editor/SystemPromptSection.tsx +88 -0
- package/src/components/context-editor/ToolsSection.tsx +37 -0
- package/src/components/context-editor/index.ts +7 -0
- package/src/components/context-editor/parts.tsx +217 -0
- package/src/components/context-editor/use-context-editor-model.ts +296 -0
- package/src/components/dashboard/__tests__/catalog.test.ts +57 -0
- package/src/components/dashboard/__tests__/glass.test.tsx +42 -0
- package/src/components/dashboard/__tests__/state.test.tsx +110 -0
- package/src/components/dashboard/__tests__/variants.test.tsx +95 -0
- package/src/components/dashboard/activity-list.tsx +99 -0
- package/src/components/dashboard/catalog.ts +351 -0
- package/src/components/dashboard/data-boundary.tsx +54 -0
- package/src/components/dashboard/empty-state.tsx +70 -0
- package/src/components/dashboard/icon-button.tsx +58 -0
- package/src/components/dashboard/index.ts +21 -0
- package/src/components/dashboard/item-list.tsx +106 -0
- package/src/components/dashboard/key-value.tsx +54 -0
- package/src/components/dashboard/layout.tsx +286 -0
- package/src/components/dashboard/metric.tsx +139 -0
- package/src/components/dashboard/progress-ring.tsx +100 -0
- package/src/components/dashboard/skeletons.tsx +73 -0
- package/src/components/dashboard/spacing.ts +14 -0
- package/src/components/dashboard/stale-indicator.tsx +55 -0
- package/src/components/dashboard/status.tsx +75 -0
- package/src/components/dashboard/tone.ts +35 -0
- package/src/components/dashboard/typography.tsx +151 -0
- package/src/components/reference/ActivityExample.tsx +68 -0
- package/src/components/reference/ResourceExample.tsx +78 -0
- package/src/components/reference/SchedulerExample.tsx +88 -0
- package/src/components/reference/StarterExample.tsx +48 -0
- package/src/components/reference/index.ts +10 -0
- package/src/components/ui/badge.tsx +6 -0
- package/src/dashboard-catalog.ts +13 -0
- package/src/index.ts +5 -0
- package/src/reference.ts +15 -0
- package/src/styles/glass-board.css +43 -0
- package/src/styles/globals.css +59 -0
- package/tsup.config.ts +6 -2
- package/vitest.config.ts +8 -0
- package/LICENSE +0 -201
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
const dashboardComponentCatalog = [
|
|
2
|
+
// ── Layout and structure ──────────────────────────────────────
|
|
3
|
+
{
|
|
4
|
+
name: "WidgetContent",
|
|
5
|
+
category: "layout",
|
|
6
|
+
kind: "composite",
|
|
7
|
+
summary: "Full-height widget frame with standard padding and a container-query boundary.",
|
|
8
|
+
useWhen: "As the outermost element of every dashboard widget.",
|
|
9
|
+
related: ["Stack", "Inline"],
|
|
10
|
+
status: "stable",
|
|
11
|
+
example: '<WidgetContent><Stack gap="sm">\u2026</Stack></WidgetContent>'
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: "Stack",
|
|
15
|
+
category: "layout",
|
|
16
|
+
kind: "composite",
|
|
17
|
+
summary: "Vertical layout with semantic spacing, alignment and optional scrolling.",
|
|
18
|
+
useWhen: "For the primary top-to-bottom content flow inside a widget.",
|
|
19
|
+
related: ["Inline", "WidgetContent"],
|
|
20
|
+
status: "stable",
|
|
21
|
+
example: '<Stack gap="sm" scroll>\u2026</Stack>'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "Inline",
|
|
25
|
+
category: "layout",
|
|
26
|
+
kind: "composite",
|
|
27
|
+
summary: "Horizontal layout with spacing, alignment, wrap and justify.",
|
|
28
|
+
useWhen: "For a row of items such as a header with a trailing action.",
|
|
29
|
+
related: ["Stack"],
|
|
30
|
+
status: "stable",
|
|
31
|
+
example: '<Inline justify="between" align="center">\u2026</Inline>'
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "Grid",
|
|
35
|
+
category: "layout",
|
|
36
|
+
kind: "composite",
|
|
37
|
+
summary: "Responsive grid with bounded columns and gap.",
|
|
38
|
+
useWhen: "For metric and summary layouts that reflow by width.",
|
|
39
|
+
related: ["MetricGroup"],
|
|
40
|
+
status: "stable",
|
|
41
|
+
example: '<Grid columns="auto" minColumnWidth={120}>\u2026</Grid>'
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "Section",
|
|
45
|
+
category: "layout",
|
|
46
|
+
kind: "composite",
|
|
47
|
+
summary: "Compact section with optional heading, description and trailing action.",
|
|
48
|
+
useWhen: "To group related content under a labelled heading.",
|
|
49
|
+
related: ["Divider", "Heading"],
|
|
50
|
+
status: "stable",
|
|
51
|
+
example: '<Section heading="Summary" action={\u2026}>\u2026</Section>'
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "Divider",
|
|
55
|
+
category: "layout",
|
|
56
|
+
kind: "composite",
|
|
57
|
+
summary: "Compact horizontal or vertical divider built on Separator.",
|
|
58
|
+
useWhen: "To separate sections without a heavy border.",
|
|
59
|
+
related: ["Section"],
|
|
60
|
+
status: "stable",
|
|
61
|
+
example: '<Divider spacing="sm" />'
|
|
62
|
+
},
|
|
63
|
+
// ── Typography and media ──────────────────────────────────────
|
|
64
|
+
{
|
|
65
|
+
name: "Text",
|
|
66
|
+
category: "typography",
|
|
67
|
+
kind: "composite",
|
|
68
|
+
summary: "Semantic text variants (body, label, supporting, muted, numeric) with truncation.",
|
|
69
|
+
useWhen: "For any text, instead of ad-hoc font-size utilities.",
|
|
70
|
+
related: ["Heading"],
|
|
71
|
+
status: "stable",
|
|
72
|
+
example: '<Text variant="label">Jobs</Text>'
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: "Heading",
|
|
76
|
+
category: "typography",
|
|
77
|
+
kind: "composite",
|
|
78
|
+
summary: "Compact heading levels and sizes that keep correct HTML semantics.",
|
|
79
|
+
useWhen: "For section and view titles.",
|
|
80
|
+
related: ["Section", "Text"],
|
|
81
|
+
status: "stable",
|
|
82
|
+
example: '<Heading level={2} size="md">Overview</Heading>'
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: "Icon",
|
|
86
|
+
category: "typography",
|
|
87
|
+
kind: "composite",
|
|
88
|
+
summary: "Consistent icon wrapper for size, tone and accessibility.",
|
|
89
|
+
useWhen: "To render an icon component with a shared size and tone.",
|
|
90
|
+
related: ["IconButton"],
|
|
91
|
+
status: "stable",
|
|
92
|
+
example: '<Icon icon={Clock} size="sm" tone="warning" />'
|
|
93
|
+
},
|
|
94
|
+
// ── Data display ──────────────────────────────────────────────
|
|
95
|
+
{
|
|
96
|
+
name: "Metric",
|
|
97
|
+
category: "data-display",
|
|
98
|
+
kind: "composite",
|
|
99
|
+
summary: "Label + value with optional icon, supporting text and trend.",
|
|
100
|
+
useWhen: "To show a single number inline.",
|
|
101
|
+
related: ["MetricCard", "MetricGroup"],
|
|
102
|
+
status: "stable",
|
|
103
|
+
example: '<Metric label="Jobs" value={6} />'
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: "MetricCard",
|
|
107
|
+
category: "data-display",
|
|
108
|
+
kind: "composite",
|
|
109
|
+
summary: "A contained surface for a Metric or compact summary.",
|
|
110
|
+
useWhen: "To give a metric its own bounded card.",
|
|
111
|
+
related: ["Metric", "MetricGroup"],
|
|
112
|
+
status: "stable",
|
|
113
|
+
example: '<MetricCard><Metric label="Jobs" value={6} /></MetricCard>'
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: "MetricGroup",
|
|
117
|
+
category: "data-display",
|
|
118
|
+
kind: "composite",
|
|
119
|
+
summary: "Arranges multiple metrics responsively in a bounded grid.",
|
|
120
|
+
useWhen: "To show several metrics that reflow by width.",
|
|
121
|
+
related: ["Metric", "Grid"],
|
|
122
|
+
status: "stable",
|
|
123
|
+
example: "<MetricGroup><Metric \u2026 /><Metric \u2026 /></MetricGroup>"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: "Status",
|
|
127
|
+
category: "data-display",
|
|
128
|
+
kind: "composite",
|
|
129
|
+
summary: "Semantic status dot, label or pill with neutral/success/warning/error/info tones.",
|
|
130
|
+
useWhen: "To show a health or state indicator. Map domain status onto a tone.",
|
|
131
|
+
related: ["Badge"],
|
|
132
|
+
status: "stable",
|
|
133
|
+
example: '<Status tone="success">Active</Status>'
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
name: "Badge",
|
|
137
|
+
category: "data-display",
|
|
138
|
+
kind: "primitive",
|
|
139
|
+
summary: "Existing badge primitive, extended with success/warning/info tones.",
|
|
140
|
+
useWhen: "For compact counts, tags and category labels.",
|
|
141
|
+
related: ["Status"],
|
|
142
|
+
status: "stable",
|
|
143
|
+
example: '<Badge variant="success">Passed</Badge>'
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: "KeyValue",
|
|
147
|
+
category: "data-display",
|
|
148
|
+
kind: "composite",
|
|
149
|
+
summary: "A single label/value row with predictable alignment and truncation.",
|
|
150
|
+
useWhen: "For metadata, totals and configuration summaries.",
|
|
151
|
+
related: ["KeyValueList"],
|
|
152
|
+
status: "stable",
|
|
153
|
+
example: '<KeyValue label="Region" value="eu-west-1" mono />'
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: "KeyValueList",
|
|
157
|
+
category: "data-display",
|
|
158
|
+
kind: "composite",
|
|
159
|
+
summary: "A vertical list of KeyValue rows.",
|
|
160
|
+
useWhen: "For a block of metadata pairs.",
|
|
161
|
+
related: ["KeyValue"],
|
|
162
|
+
status: "stable",
|
|
163
|
+
example: "<KeyValueList><KeyValue \u2026 /></KeyValueList>"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: "ItemList",
|
|
167
|
+
category: "data-display",
|
|
168
|
+
kind: "composite",
|
|
169
|
+
summary: "Compact rows with leading media, text, trailing metadata, actions and overflow.",
|
|
170
|
+
useWhen: "For entity lists (files, notes, results).",
|
|
171
|
+
related: ["ItemListItem", "ActivityList"],
|
|
172
|
+
status: "stable",
|
|
173
|
+
example: "<ItemList overflowCount={3}><ItemListItem \u2026 /></ItemList>"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: "ItemListItem",
|
|
177
|
+
category: "data-display",
|
|
178
|
+
kind: "composite",
|
|
179
|
+
summary: "A single compact list row with media, primary/secondary text and actions.",
|
|
180
|
+
useWhen: "As the row inside an ItemList.",
|
|
181
|
+
related: ["ItemList"],
|
|
182
|
+
status: "stable",
|
|
183
|
+
example: '<ItemListItem primary="Report.pdf" trailing="2h" />'
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
name: "ActivityList",
|
|
187
|
+
category: "data-display",
|
|
188
|
+
kind: "composite",
|
|
189
|
+
summary: "A chronological list for recent events with a shared overflow footer.",
|
|
190
|
+
useWhen: "For time-ordered activity or upcoming events.",
|
|
191
|
+
related: ["ActivityListItem", "ItemList"],
|
|
192
|
+
status: "stable",
|
|
193
|
+
example: "<ActivityList><ActivityListItem \u2026 /></ActivityList>"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
name: "ActivityListItem",
|
|
197
|
+
category: "data-display",
|
|
198
|
+
kind: "composite",
|
|
199
|
+
summary: "An event row with a status marker or icon, label, timestamp and detail.",
|
|
200
|
+
useWhen: "As the row inside an ActivityList.",
|
|
201
|
+
related: ["ActivityList", "Status"],
|
|
202
|
+
status: "stable",
|
|
203
|
+
example: '<ActivityListItem label="Backup" timestamp="08:00" tone="success" />'
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
name: "ProgressRing",
|
|
207
|
+
category: "data-display",
|
|
208
|
+
kind: "composite",
|
|
209
|
+
summary: "Accessible circular progress / donut gauge, no charting dependency.",
|
|
210
|
+
useWhen: "For a bounded value such as a success rate or usage percentage.",
|
|
211
|
+
related: ["Metric"],
|
|
212
|
+
status: "stable",
|
|
213
|
+
example: '<ProgressRing value={75} label="Success rate" tone="success" />'
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
name: "StaleIndicator",
|
|
217
|
+
category: "data-display",
|
|
218
|
+
kind: "composite",
|
|
219
|
+
summary: "Compact hint that data may be out of date, with optional refresh action.",
|
|
220
|
+
useWhen: "When displayed data can lag its source.",
|
|
221
|
+
related: ["DataBoundary"],
|
|
222
|
+
status: "stable",
|
|
223
|
+
example: '<StaleIndicator lastUpdated="Updated 5m ago" onRefresh={\u2026} />'
|
|
224
|
+
},
|
|
225
|
+
// ── Runtime states and feedback ───────────────────────────────
|
|
226
|
+
{
|
|
227
|
+
name: "DataBoundary",
|
|
228
|
+
category: "state",
|
|
229
|
+
kind: "composite",
|
|
230
|
+
summary: "Selects presentation for loading / ready / empty / stale / error states.",
|
|
231
|
+
useWhen: "To switch a widget's content by data state without owning fetching.",
|
|
232
|
+
related: ["EmptyState", "MetricSkeleton", "StaleIndicator"],
|
|
233
|
+
status: "stable",
|
|
234
|
+
example: "<DataBoundary state={state} loading={\u2026} empty={\u2026} error={\u2026}>\u2026</DataBoundary>"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
name: "EmptyState",
|
|
238
|
+
category: "state",
|
|
239
|
+
kind: "composite",
|
|
240
|
+
summary: "Compact empty state built on the Empty primitives.",
|
|
241
|
+
useWhen: "When there is nothing to show yet.",
|
|
242
|
+
related: ["DataBoundary"],
|
|
243
|
+
status: "stable",
|
|
244
|
+
example: '<EmptyState icon={Inbox} title="No activity yet" />'
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
name: "Alert",
|
|
248
|
+
category: "state",
|
|
249
|
+
kind: "primitive",
|
|
250
|
+
summary: "Existing alert primitive for inline warnings and errors.",
|
|
251
|
+
useWhen: "For a persistent inline message inside a widget or view.",
|
|
252
|
+
related: ["DataBoundary"],
|
|
253
|
+
status: "stable",
|
|
254
|
+
example: '<Alert variant="destructive">Failed to load</Alert>'
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
name: "MetricSkeleton",
|
|
258
|
+
category: "state",
|
|
259
|
+
kind: "composite",
|
|
260
|
+
summary: "Loading placeholder for a row of metrics.",
|
|
261
|
+
useWhen: "As the `loading` fallback for metric layouts.",
|
|
262
|
+
related: ["DataBoundary", "ListSkeleton"],
|
|
263
|
+
status: "stable",
|
|
264
|
+
example: "<MetricSkeleton count={3} />"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
name: "ListSkeleton",
|
|
268
|
+
category: "state",
|
|
269
|
+
kind: "composite",
|
|
270
|
+
summary: "Loading placeholder for a list of rows.",
|
|
271
|
+
useWhen: "As the `loading` fallback for item lists.",
|
|
272
|
+
related: ["DataBoundary", "ItemList"],
|
|
273
|
+
status: "stable",
|
|
274
|
+
example: "<ListSkeleton count={4} />"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
name: "ActivitySkeleton",
|
|
278
|
+
category: "state",
|
|
279
|
+
kind: "composite",
|
|
280
|
+
summary: "Loading placeholder for an activity list.",
|
|
281
|
+
useWhen: "As the `loading` fallback for activity feeds.",
|
|
282
|
+
related: ["DataBoundary", "ActivityList"],
|
|
283
|
+
status: "stable",
|
|
284
|
+
example: "<ActivitySkeleton count={4} />"
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
name: "Skeleton",
|
|
288
|
+
category: "state",
|
|
289
|
+
kind: "primitive",
|
|
290
|
+
summary: "Existing skeleton primitive for bespoke loading shapes.",
|
|
291
|
+
useWhen: "When the prebuilt skeleton patterns do not fit.",
|
|
292
|
+
related: ["MetricSkeleton", "ListSkeleton", "ActivitySkeleton"],
|
|
293
|
+
status: "stable",
|
|
294
|
+
example: '<Skeleton className="h-4 w-24" />'
|
|
295
|
+
},
|
|
296
|
+
// ── Actions ───────────────────────────────────────────────────
|
|
297
|
+
{
|
|
298
|
+
name: "Button",
|
|
299
|
+
category: "action",
|
|
300
|
+
kind: "primitive",
|
|
301
|
+
summary: "Existing button primitive, the standard text-action control.",
|
|
302
|
+
useWhen: "For a labelled action.",
|
|
303
|
+
related: ["IconButton"],
|
|
304
|
+
status: "stable",
|
|
305
|
+
example: '<Button size="sm">Open</Button>'
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
name: "IconButton",
|
|
309
|
+
category: "action",
|
|
310
|
+
kind: "composite",
|
|
311
|
+
summary: "Small icon-only button with a required accessible label.",
|
|
312
|
+
useWhen: "For a compact action such as refresh or dismiss.",
|
|
313
|
+
related: ["Button", "Icon"],
|
|
314
|
+
status: "stable",
|
|
315
|
+
example: '<IconButton icon={RotateCw} label="Refresh" size="xs" />'
|
|
316
|
+
}
|
|
317
|
+
];
|
|
318
|
+
var catalog_default = dashboardComponentCatalog;
|
|
319
|
+
export {
|
|
320
|
+
dashboardComponentCatalog,
|
|
321
|
+
catalog_default as default
|
|
322
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _jsxruntime = require('react/jsx-runtime');
|
|
2
|
+
function DataBoundary({
|
|
3
|
+
state,
|
|
4
|
+
loading,
|
|
5
|
+
empty,
|
|
6
|
+
error,
|
|
7
|
+
stale,
|
|
8
|
+
children
|
|
9
|
+
}) {
|
|
10
|
+
switch (state) {
|
|
11
|
+
case "loading":
|
|
12
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: _nullishCoalesce(loading, () => ( null)) });
|
|
13
|
+
case "empty":
|
|
14
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: _nullishCoalesce(empty, () => ( null)) });
|
|
15
|
+
case "error":
|
|
16
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: _nullishCoalesce(error, () => ( null)) });
|
|
17
|
+
case "stale":
|
|
18
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
19
|
+
stale,
|
|
20
|
+
children
|
|
21
|
+
] });
|
|
22
|
+
case "ready":
|
|
23
|
+
default:
|
|
24
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children });
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
exports.DataBoundary = DataBoundary;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
type DataState = "loading" | "ready" | "empty" | "stale" | "error";
|
|
5
|
+
interface DataBoundaryProps {
|
|
6
|
+
state: DataState;
|
|
7
|
+
/** Shown while `state === "loading"`. */
|
|
8
|
+
loading?: React.ReactNode;
|
|
9
|
+
/** Shown while `state === "empty"`. */
|
|
10
|
+
empty?: React.ReactNode;
|
|
11
|
+
/** Shown while `state === "error"`. */
|
|
12
|
+
error?: React.ReactNode;
|
|
13
|
+
/** Banner rendered above children while `state === "stale"`. */
|
|
14
|
+
stale?: React.ReactNode;
|
|
15
|
+
/** Ready content, also shown (below `stale`) while `state === "stale"`. */
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
/** Selects presentation for the current data state. */
|
|
19
|
+
declare function DataBoundary({ state, loading, empty, error, stale, children, }: DataBoundaryProps): react_jsx_runtime.JSX.Element;
|
|
20
|
+
|
|
21
|
+
export { DataBoundary, type DataBoundaryProps, type DataState };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
type DataState = "loading" | "ready" | "empty" | "stale" | "error";
|
|
5
|
+
interface DataBoundaryProps {
|
|
6
|
+
state: DataState;
|
|
7
|
+
/** Shown while `state === "loading"`. */
|
|
8
|
+
loading?: React.ReactNode;
|
|
9
|
+
/** Shown while `state === "empty"`. */
|
|
10
|
+
empty?: React.ReactNode;
|
|
11
|
+
/** Shown while `state === "error"`. */
|
|
12
|
+
error?: React.ReactNode;
|
|
13
|
+
/** Banner rendered above children while `state === "stale"`. */
|
|
14
|
+
stale?: React.ReactNode;
|
|
15
|
+
/** Ready content, also shown (below `stale`) while `state === "stale"`. */
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
/** Selects presentation for the current data state. */
|
|
19
|
+
declare function DataBoundary({ state, loading, empty, error, stale, children, }: DataBoundaryProps): react_jsx_runtime.JSX.Element;
|
|
20
|
+
|
|
21
|
+
export { DataBoundary, type DataBoundaryProps, type DataState };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
function DataBoundary({
|
|
3
|
+
state,
|
|
4
|
+
loading,
|
|
5
|
+
empty,
|
|
6
|
+
error,
|
|
7
|
+
stale,
|
|
8
|
+
children
|
|
9
|
+
}) {
|
|
10
|
+
switch (state) {
|
|
11
|
+
case "loading":
|
|
12
|
+
return /* @__PURE__ */ jsx(Fragment, { children: loading ?? null });
|
|
13
|
+
case "empty":
|
|
14
|
+
return /* @__PURE__ */ jsx(Fragment, { children: empty ?? null });
|
|
15
|
+
case "error":
|
|
16
|
+
return /* @__PURE__ */ jsx(Fragment, { children: error ?? null });
|
|
17
|
+
case "stale":
|
|
18
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
19
|
+
stale,
|
|
20
|
+
children
|
|
21
|
+
] });
|
|
22
|
+
case "ready":
|
|
23
|
+
default:
|
|
24
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
DataBoundary
|
|
29
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _jsxruntime = require('react/jsx-runtime');
|
|
2
|
+
var _utils = require('../../lib/utils');
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _empty = require('../ui/empty');
|
|
11
|
+
var _typography = require('./typography');
|
|
12
|
+
function EmptyState({
|
|
13
|
+
className,
|
|
14
|
+
icon,
|
|
15
|
+
title,
|
|
16
|
+
message,
|
|
17
|
+
action,
|
|
18
|
+
...props
|
|
19
|
+
}) {
|
|
20
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
21
|
+
_empty.Empty,
|
|
22
|
+
{
|
|
23
|
+
"data-slot": "empty-state",
|
|
24
|
+
className: _utils.cn.call(void 0,
|
|
25
|
+
"flex-1 gap-3 border-0 p-4 md:p-4",
|
|
26
|
+
className
|
|
27
|
+
),
|
|
28
|
+
...props,
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _empty.EmptyHeader, { className: "gap-1.5", children: [
|
|
31
|
+
icon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
32
|
+
_empty.EmptyMedia,
|
|
33
|
+
{
|
|
34
|
+
variant: "icon",
|
|
35
|
+
className: "size-9 border-[var(--surface-line)] bg-[var(--surface-flat)] text-[var(--text-muted)]",
|
|
36
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _typography.Icon, { icon, size: "md", className: "text-current" })
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _empty.EmptyTitle, { className: "text-sm font-medium text-[var(--text-primary)]", children: title }),
|
|
40
|
+
message && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _empty.EmptyDescription, { className: "text-xs text-[var(--text-muted)]", children: message })
|
|
41
|
+
] }),
|
|
42
|
+
action && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _empty.EmptyContent, { className: "gap-2", children: action })
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
exports.EmptyState = EmptyState;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Empty } from '../ui/empty.cjs';
|
|
4
|
+
import 'class-variance-authority/types';
|
|
5
|
+
import 'class-variance-authority';
|
|
6
|
+
|
|
7
|
+
interface EmptyStateProps extends Omit<React.ComponentProps<typeof Empty>, "title"> {
|
|
8
|
+
/** Leading icon component (e.g. a lucide-react icon). */
|
|
9
|
+
icon?: React.ComponentType<{
|
|
10
|
+
className?: string;
|
|
11
|
+
}>;
|
|
12
|
+
title: React.ReactNode;
|
|
13
|
+
message?: React.ReactNode;
|
|
14
|
+
/** Optional action (e.g. a Button). */
|
|
15
|
+
action?: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
/** Compact empty state for widgets and plugin views. */
|
|
18
|
+
declare function EmptyState({ className, icon, title, message, action, ...props }: EmptyStateProps): react_jsx_runtime.JSX.Element;
|
|
19
|
+
|
|
20
|
+
export { EmptyState, type EmptyStateProps };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Empty } from '../ui/empty.js';
|
|
4
|
+
import 'class-variance-authority/types';
|
|
5
|
+
import 'class-variance-authority';
|
|
6
|
+
|
|
7
|
+
interface EmptyStateProps extends Omit<React.ComponentProps<typeof Empty>, "title"> {
|
|
8
|
+
/** Leading icon component (e.g. a lucide-react icon). */
|
|
9
|
+
icon?: React.ComponentType<{
|
|
10
|
+
className?: string;
|
|
11
|
+
}>;
|
|
12
|
+
title: React.ReactNode;
|
|
13
|
+
message?: React.ReactNode;
|
|
14
|
+
/** Optional action (e.g. a Button). */
|
|
15
|
+
action?: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
/** Compact empty state for widgets and plugin views. */
|
|
18
|
+
declare function EmptyState({ className, icon, title, message, action, ...props }: EmptyStateProps): react_jsx_runtime.JSX.Element;
|
|
19
|
+
|
|
20
|
+
export { EmptyState, type EmptyStateProps };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/utils";
|
|
3
|
+
import {
|
|
4
|
+
Empty,
|
|
5
|
+
EmptyContent,
|
|
6
|
+
EmptyDescription,
|
|
7
|
+
EmptyHeader,
|
|
8
|
+
EmptyMedia,
|
|
9
|
+
EmptyTitle
|
|
10
|
+
} from "../ui/empty";
|
|
11
|
+
import { Icon } from "./typography";
|
|
12
|
+
function EmptyState({
|
|
13
|
+
className,
|
|
14
|
+
icon,
|
|
15
|
+
title,
|
|
16
|
+
message,
|
|
17
|
+
action,
|
|
18
|
+
...props
|
|
19
|
+
}) {
|
|
20
|
+
return /* @__PURE__ */ jsxs(
|
|
21
|
+
Empty,
|
|
22
|
+
{
|
|
23
|
+
"data-slot": "empty-state",
|
|
24
|
+
className: cn(
|
|
25
|
+
"flex-1 gap-3 border-0 p-4 md:p-4",
|
|
26
|
+
className
|
|
27
|
+
),
|
|
28
|
+
...props,
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ jsxs(EmptyHeader, { className: "gap-1.5", children: [
|
|
31
|
+
icon && /* @__PURE__ */ jsx(
|
|
32
|
+
EmptyMedia,
|
|
33
|
+
{
|
|
34
|
+
variant: "icon",
|
|
35
|
+
className: "size-9 border-[var(--surface-line)] bg-[var(--surface-flat)] text-[var(--text-muted)]",
|
|
36
|
+
children: /* @__PURE__ */ jsx(Icon, { icon, size: "md", className: "text-current" })
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
/* @__PURE__ */ jsx(EmptyTitle, { className: "text-sm font-medium text-[var(--text-primary)]", children: title }),
|
|
40
|
+
message && /* @__PURE__ */ jsx(EmptyDescription, { className: "text-xs text-[var(--text-muted)]", children: message })
|
|
41
|
+
] }),
|
|
42
|
+
action && /* @__PURE__ */ jsx(EmptyContent, { className: "gap-2", children: action })
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
EmptyState
|
|
49
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _jsxruntime = require('react/jsx-runtime');
|
|
2
|
+
var _utils = require('../../lib/utils');
|
|
3
|
+
var _button = require('../ui/button');
|
|
4
|
+
var _typography = require('./typography');
|
|
5
|
+
const sizeMap = {
|
|
6
|
+
xs: "icon-xs",
|
|
7
|
+
sm: "icon-sm",
|
|
8
|
+
md: "icon"
|
|
9
|
+
};
|
|
10
|
+
const iconSizeMap = {
|
|
11
|
+
xs: "xs",
|
|
12
|
+
sm: "sm",
|
|
13
|
+
md: "md"
|
|
14
|
+
};
|
|
15
|
+
function IconButton({
|
|
16
|
+
className,
|
|
17
|
+
icon,
|
|
18
|
+
label,
|
|
19
|
+
size = "sm",
|
|
20
|
+
variant = "ghost",
|
|
21
|
+
...props
|
|
22
|
+
}) {
|
|
23
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
24
|
+
_button.Button,
|
|
25
|
+
{
|
|
26
|
+
"data-slot": "icon-button",
|
|
27
|
+
type: "button",
|
|
28
|
+
variant,
|
|
29
|
+
size: sizeMap[size],
|
|
30
|
+
"aria-label": label,
|
|
31
|
+
title: label,
|
|
32
|
+
className: _utils.cn.call(void 0, "text-[var(--text-muted)]", className),
|
|
33
|
+
...props,
|
|
34
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _typography.Icon, { icon, size: iconSizeMap[size], className: "text-current" })
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
exports.IconButton = IconButton;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Button } from '../ui/button.cjs';
|
|
4
|
+
import 'class-variance-authority/types';
|
|
5
|
+
import 'class-variance-authority';
|
|
6
|
+
|
|
7
|
+
declare const sizeMap: {
|
|
8
|
+
readonly xs: "icon-xs";
|
|
9
|
+
readonly sm: "icon-sm";
|
|
10
|
+
readonly md: "icon";
|
|
11
|
+
};
|
|
12
|
+
interface IconButtonProps extends Omit<React.ComponentProps<typeof Button>, "size" | "children"> {
|
|
13
|
+
/** The icon component to render (e.g. a lucide-react icon). */
|
|
14
|
+
icon: React.ComponentType<{
|
|
15
|
+
className?: string;
|
|
16
|
+
}>;
|
|
17
|
+
/** Required accessible label — the control has no visible text. */
|
|
18
|
+
label: string;
|
|
19
|
+
size?: keyof typeof sizeMap;
|
|
20
|
+
}
|
|
21
|
+
/** A compact icon-only button with a required accessible label. */
|
|
22
|
+
declare function IconButton({ className, icon, label, size, variant, ...props }: IconButtonProps): react_jsx_runtime.JSX.Element;
|
|
23
|
+
|
|
24
|
+
export { IconButton, type IconButtonProps };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Button } from '../ui/button.js';
|
|
4
|
+
import 'class-variance-authority/types';
|
|
5
|
+
import 'class-variance-authority';
|
|
6
|
+
|
|
7
|
+
declare const sizeMap: {
|
|
8
|
+
readonly xs: "icon-xs";
|
|
9
|
+
readonly sm: "icon-sm";
|
|
10
|
+
readonly md: "icon";
|
|
11
|
+
};
|
|
12
|
+
interface IconButtonProps extends Omit<React.ComponentProps<typeof Button>, "size" | "children"> {
|
|
13
|
+
/** The icon component to render (e.g. a lucide-react icon). */
|
|
14
|
+
icon: React.ComponentType<{
|
|
15
|
+
className?: string;
|
|
16
|
+
}>;
|
|
17
|
+
/** Required accessible label — the control has no visible text. */
|
|
18
|
+
label: string;
|
|
19
|
+
size?: keyof typeof sizeMap;
|
|
20
|
+
}
|
|
21
|
+
/** A compact icon-only button with a required accessible label. */
|
|
22
|
+
declare function IconButton({ className, icon, label, size, variant, ...props }: IconButtonProps): react_jsx_runtime.JSX.Element;
|
|
23
|
+
|
|
24
|
+
export { IconButton, type IconButtonProps };
|