@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.
- package/.turbo/turbo-build.log +615 -0
- package/.turbo/turbo-typecheck.log +1 -1
- package/CHANGELOG.md +58 -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 +1 -0
- package/dist/components/dashboard/catalog.d.cts +13 -0
- package/dist/components/dashboard/catalog.d.ts +13 -0
- package/dist/components/dashboard/catalog.js +0 -0
- package/dist/components/dashboard/catalog.json +312 -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 +66 -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 +66 -0
- package/dist/components/dashboard/tone.cjs +34 -0
- package/dist/components/dashboard/tone.d.cts +15 -0
- package/dist/components/dashboard/tone.d.ts +15 -0
- package/dist/components/dashboard/tone.js +34 -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/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/index.cjs +1 -0
- package/dist/index.d.cts +16 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +1 -0
- package/dist/reference.cjs +1260 -0
- package/dist/reference.d.cts +11 -0
- package/dist/reference.d.ts +11 -0
- package/dist/reference.js +1230 -0
- package/dist/styles/glass-board.css +43 -0
- package/dist/styles/globals.css +59 -0
- package/package.json +16 -4
- package/scripts/ensure-pnpm-publish.mjs +23 -0
- package/scripts/smoke-dist.mjs +68 -0
- 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 +62 -0
- package/src/components/dashboard/__tests__/glass.test.tsx +42 -0
- package/src/components/dashboard/__tests__/state.test.tsx +127 -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.json +312 -0
- package/src/components/dashboard/catalog.ts +29 -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 +88 -0
- package/src/components/dashboard/tone.ts +48 -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/index.ts +7 -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 +18 -4
- package/tsup.reference.config.ts +15 -0
- package/vitest.config.ts +8 -0
|
@@ -0,0 +1,1260 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/reference.ts
|
|
21
|
+
var reference_exports = {};
|
|
22
|
+
__export(reference_exports, {
|
|
23
|
+
ActivityExample: () => ActivityExample,
|
|
24
|
+
ResourceExample: () => ResourceExample,
|
|
25
|
+
SchedulerExample: () => SchedulerExample,
|
|
26
|
+
StarterExample: () => StarterExample
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(reference_exports);
|
|
29
|
+
|
|
30
|
+
// src/components/reference/StarterExample.tsx
|
|
31
|
+
var import_lucide_react3 = require("lucide-react");
|
|
32
|
+
|
|
33
|
+
// src/components/dashboard/tone.ts
|
|
34
|
+
var toneColor = {
|
|
35
|
+
neutral: "text-[var(--text-muted)]",
|
|
36
|
+
success: "text-[var(--status-success)]",
|
|
37
|
+
warning: "text-[var(--status-warning)]",
|
|
38
|
+
error: "text-[var(--status-error)]",
|
|
39
|
+
info: "text-[var(--status-info)]"
|
|
40
|
+
};
|
|
41
|
+
var toneDot = {
|
|
42
|
+
neutral: "bg-[var(--text-muted)]",
|
|
43
|
+
success: "bg-[var(--status-success)]",
|
|
44
|
+
warning: "bg-[var(--status-warning)]",
|
|
45
|
+
error: "bg-[var(--status-error)]",
|
|
46
|
+
info: "bg-[var(--status-info)]"
|
|
47
|
+
};
|
|
48
|
+
var toneLabel = {
|
|
49
|
+
neutral: "Neutral",
|
|
50
|
+
success: "Success",
|
|
51
|
+
warning: "Warning",
|
|
52
|
+
error: "Error",
|
|
53
|
+
info: "Info"
|
|
54
|
+
};
|
|
55
|
+
var tonePill = {
|
|
56
|
+
neutral: "bg-[var(--surface-flat)] text-[var(--text-secondary)]",
|
|
57
|
+
success: "bg-[var(--status-success-muted)] text-[var(--status-success)]",
|
|
58
|
+
warning: "bg-[var(--status-warning-muted)] text-[var(--status-warning)]",
|
|
59
|
+
error: "bg-[var(--status-error-muted)] text-[var(--status-error)]",
|
|
60
|
+
info: "bg-[var(--status-info-muted)] text-[var(--status-info)]"
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// src/components/dashboard/spacing.ts
|
|
64
|
+
var gapClass = {
|
|
65
|
+
none: "gap-0",
|
|
66
|
+
xs: "gap-1",
|
|
67
|
+
sm: "gap-2",
|
|
68
|
+
md: "gap-3",
|
|
69
|
+
lg: "gap-4"
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// src/components/dashboard/layout.tsx
|
|
73
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
74
|
+
|
|
75
|
+
// src/lib/utils.ts
|
|
76
|
+
var import_clsx = require("clsx");
|
|
77
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
78
|
+
function cn(...inputs) {
|
|
79
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// src/components/ui/separator.tsx
|
|
83
|
+
var import_radix_ui = require("radix-ui");
|
|
84
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
85
|
+
function Separator({
|
|
86
|
+
className,
|
|
87
|
+
orientation = "horizontal",
|
|
88
|
+
decorative = true,
|
|
89
|
+
...props
|
|
90
|
+
}) {
|
|
91
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
92
|
+
import_radix_ui.Separator.Root,
|
|
93
|
+
{
|
|
94
|
+
"data-slot": "separator",
|
|
95
|
+
decorative,
|
|
96
|
+
orientation,
|
|
97
|
+
className: cn(
|
|
98
|
+
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
99
|
+
className
|
|
100
|
+
),
|
|
101
|
+
...props
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// src/components/dashboard/layout.tsx
|
|
107
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
108
|
+
var widgetContentVariants = (0, import_class_variance_authority.cva)(
|
|
109
|
+
// Full-height frame with a container-query boundary so child components can
|
|
110
|
+
// respond to the widget's own size rather than the viewport.
|
|
111
|
+
"@container/widget flex h-full min-h-0 flex-col",
|
|
112
|
+
{
|
|
113
|
+
variants: {
|
|
114
|
+
padding: {
|
|
115
|
+
none: "p-0",
|
|
116
|
+
sm: "p-2",
|
|
117
|
+
md: "p-3",
|
|
118
|
+
lg: "p-4"
|
|
119
|
+
},
|
|
120
|
+
scroll: {
|
|
121
|
+
true: "overflow-auto",
|
|
122
|
+
false: "overflow-hidden"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
defaultVariants: { padding: "md", scroll: false }
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
function WidgetContent({
|
|
129
|
+
className,
|
|
130
|
+
padding,
|
|
131
|
+
scroll,
|
|
132
|
+
glass = true,
|
|
133
|
+
...props
|
|
134
|
+
}) {
|
|
135
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
136
|
+
"div",
|
|
137
|
+
{
|
|
138
|
+
"data-slot": "widget-content",
|
|
139
|
+
className: cn(widgetContentVariants({ padding, scroll }), glass && "glass", className),
|
|
140
|
+
...props
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
var alignClass = {
|
|
145
|
+
start: "items-start",
|
|
146
|
+
center: "items-center",
|
|
147
|
+
end: "items-end",
|
|
148
|
+
stretch: "items-stretch"
|
|
149
|
+
};
|
|
150
|
+
var justifyClass = {
|
|
151
|
+
start: "justify-start",
|
|
152
|
+
center: "justify-center",
|
|
153
|
+
end: "justify-end",
|
|
154
|
+
between: "justify-between",
|
|
155
|
+
around: "justify-around"
|
|
156
|
+
};
|
|
157
|
+
function Stack({
|
|
158
|
+
className,
|
|
159
|
+
gap = "sm",
|
|
160
|
+
align,
|
|
161
|
+
justify,
|
|
162
|
+
fill = false,
|
|
163
|
+
scroll = false,
|
|
164
|
+
...props
|
|
165
|
+
}) {
|
|
166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
167
|
+
"div",
|
|
168
|
+
{
|
|
169
|
+
"data-slot": "stack",
|
|
170
|
+
className: cn(
|
|
171
|
+
"flex flex-col",
|
|
172
|
+
gapClass[gap],
|
|
173
|
+
align && alignClass[align],
|
|
174
|
+
justify && justifyClass[justify],
|
|
175
|
+
(fill || scroll) && "min-h-0 flex-1",
|
|
176
|
+
scroll && "overflow-auto",
|
|
177
|
+
className
|
|
178
|
+
),
|
|
179
|
+
...props
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
function Inline({
|
|
184
|
+
className,
|
|
185
|
+
gap = "sm",
|
|
186
|
+
align = "center",
|
|
187
|
+
justify,
|
|
188
|
+
wrap = false,
|
|
189
|
+
...props
|
|
190
|
+
}) {
|
|
191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
192
|
+
"div",
|
|
193
|
+
{
|
|
194
|
+
"data-slot": "inline",
|
|
195
|
+
className: cn(
|
|
196
|
+
"flex flex-row",
|
|
197
|
+
gapClass[gap],
|
|
198
|
+
alignClass[align],
|
|
199
|
+
justify && justifyClass[justify],
|
|
200
|
+
wrap ? "flex-wrap" : "min-w-0",
|
|
201
|
+
className
|
|
202
|
+
),
|
|
203
|
+
...props
|
|
204
|
+
}
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
var columnsClass = {
|
|
208
|
+
1: "grid-cols-1",
|
|
209
|
+
2: "grid-cols-2",
|
|
210
|
+
3: "grid-cols-3",
|
|
211
|
+
4: "grid-cols-4"
|
|
212
|
+
};
|
|
213
|
+
function Grid({
|
|
214
|
+
className,
|
|
215
|
+
columns = "auto",
|
|
216
|
+
gap = "sm",
|
|
217
|
+
minColumnWidth = 120,
|
|
218
|
+
style,
|
|
219
|
+
...props
|
|
220
|
+
}) {
|
|
221
|
+
const auto = columns === "auto";
|
|
222
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
223
|
+
"div",
|
|
224
|
+
{
|
|
225
|
+
"data-slot": "grid",
|
|
226
|
+
className: cn(
|
|
227
|
+
"grid",
|
|
228
|
+
gapClass[gap],
|
|
229
|
+
!auto && columnsClass[columns],
|
|
230
|
+
className
|
|
231
|
+
),
|
|
232
|
+
style: auto ? {
|
|
233
|
+
gridTemplateColumns: `repeat(auto-fill, minmax(${minColumnWidth}px, 1fr))`,
|
|
234
|
+
...style
|
|
235
|
+
} : style,
|
|
236
|
+
...props
|
|
237
|
+
}
|
|
238
|
+
);
|
|
239
|
+
}
|
|
240
|
+
function Section({
|
|
241
|
+
className,
|
|
242
|
+
heading,
|
|
243
|
+
description,
|
|
244
|
+
action,
|
|
245
|
+
gap = "sm",
|
|
246
|
+
children,
|
|
247
|
+
...props
|
|
248
|
+
}) {
|
|
249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
250
|
+
"section",
|
|
251
|
+
{
|
|
252
|
+
"data-slot": "section",
|
|
253
|
+
className: cn("flex flex-col", gapClass[gap], className),
|
|
254
|
+
...props,
|
|
255
|
+
children: [
|
|
256
|
+
(heading || action) && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
257
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex min-w-0 flex-col gap-0.5", children: [
|
|
258
|
+
heading && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h3", { className: "truncate text-[11px] font-semibold uppercase tracking-wider text-[var(--text-muted)]", children: heading }),
|
|
259
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "truncate text-xs text-[var(--text-muted)]", children: description })
|
|
260
|
+
] }),
|
|
261
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "shrink-0", children: action })
|
|
262
|
+
] }),
|
|
263
|
+
children
|
|
264
|
+
]
|
|
265
|
+
}
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
var dividerSpacing = { none: "my-0", sm: "my-1", md: "my-2" };
|
|
269
|
+
function Divider({
|
|
270
|
+
className,
|
|
271
|
+
orientation = "horizontal",
|
|
272
|
+
spacing = "sm",
|
|
273
|
+
...props
|
|
274
|
+
}) {
|
|
275
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
276
|
+
Separator,
|
|
277
|
+
{
|
|
278
|
+
"data-slot": "divider",
|
|
279
|
+
orientation,
|
|
280
|
+
className: cn(
|
|
281
|
+
orientation === "horizontal" ? dividerSpacing[spacing] : "mx-1",
|
|
282
|
+
className
|
|
283
|
+
),
|
|
284
|
+
...props
|
|
285
|
+
}
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// src/components/dashboard/typography.tsx
|
|
290
|
+
var import_class_variance_authority2 = require("class-variance-authority");
|
|
291
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
292
|
+
var textVariants = (0, import_class_variance_authority2.cva)("min-w-0", {
|
|
293
|
+
variants: {
|
|
294
|
+
variant: {
|
|
295
|
+
body: "text-sm text-[var(--text-primary)]",
|
|
296
|
+
label: "text-[11px] font-semibold uppercase tracking-wider text-[var(--text-muted)]",
|
|
297
|
+
supporting: "text-xs text-[var(--text-secondary)]",
|
|
298
|
+
muted: "text-xs text-[var(--text-muted)]",
|
|
299
|
+
numeric: "text-sm font-semibold tabular-nums text-[var(--text-primary)]"
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
defaultVariants: { variant: "body" }
|
|
303
|
+
});
|
|
304
|
+
var clampClass = {
|
|
305
|
+
1: "line-clamp-1",
|
|
306
|
+
2: "line-clamp-2",
|
|
307
|
+
3: "line-clamp-3"
|
|
308
|
+
};
|
|
309
|
+
function Text({
|
|
310
|
+
className,
|
|
311
|
+
variant,
|
|
312
|
+
truncate,
|
|
313
|
+
clamp,
|
|
314
|
+
tone,
|
|
315
|
+
...props
|
|
316
|
+
}) {
|
|
317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
318
|
+
"span",
|
|
319
|
+
{
|
|
320
|
+
"data-slot": "text",
|
|
321
|
+
className: cn(
|
|
322
|
+
textVariants({ variant }),
|
|
323
|
+
clamp ? clampClass[clamp] : truncate && "truncate",
|
|
324
|
+
tone && toneColor[tone],
|
|
325
|
+
className
|
|
326
|
+
),
|
|
327
|
+
...props
|
|
328
|
+
}
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
var headingSize = {
|
|
332
|
+
sm: "text-xs font-semibold",
|
|
333
|
+
md: "text-sm font-semibold",
|
|
334
|
+
lg: "text-base font-semibold"
|
|
335
|
+
};
|
|
336
|
+
function Heading({
|
|
337
|
+
className,
|
|
338
|
+
level = 2,
|
|
339
|
+
size = "md",
|
|
340
|
+
truncate,
|
|
341
|
+
...props
|
|
342
|
+
}) {
|
|
343
|
+
const Tag = `h${level}`;
|
|
344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
345
|
+
Tag,
|
|
346
|
+
{
|
|
347
|
+
"data-slot": "heading",
|
|
348
|
+
className: cn(
|
|
349
|
+
"leading-snug text-[var(--text-primary)]",
|
|
350
|
+
headingSize[size],
|
|
351
|
+
truncate && "truncate",
|
|
352
|
+
className
|
|
353
|
+
),
|
|
354
|
+
...props
|
|
355
|
+
}
|
|
356
|
+
);
|
|
357
|
+
}
|
|
358
|
+
var iconSize = {
|
|
359
|
+
xs: "size-3",
|
|
360
|
+
sm: "size-3.5",
|
|
361
|
+
md: "size-4",
|
|
362
|
+
lg: "size-5"
|
|
363
|
+
};
|
|
364
|
+
function Icon({ className, icon: IconCmp, size = "md", tone, label, ...props }) {
|
|
365
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
366
|
+
"span",
|
|
367
|
+
{
|
|
368
|
+
"data-slot": "icon",
|
|
369
|
+
role: label ? "img" : void 0,
|
|
370
|
+
"aria-label": label,
|
|
371
|
+
"aria-hidden": label ? void 0 : true,
|
|
372
|
+
className: cn(
|
|
373
|
+
"inline-flex shrink-0 items-center justify-center",
|
|
374
|
+
tone ? toneColor[tone] : "text-[var(--text-muted)]",
|
|
375
|
+
className
|
|
376
|
+
),
|
|
377
|
+
...props,
|
|
378
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(IconCmp, { className: iconSize[size] })
|
|
379
|
+
}
|
|
380
|
+
);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
// src/components/dashboard/metric.tsx
|
|
384
|
+
var import_lucide_react = require("lucide-react");
|
|
385
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
386
|
+
var trendIcon = {
|
|
387
|
+
up: import_lucide_react.ArrowUp,
|
|
388
|
+
down: import_lucide_react.ArrowDown,
|
|
389
|
+
flat: import_lucide_react.ArrowRight
|
|
390
|
+
};
|
|
391
|
+
function Metric({
|
|
392
|
+
className,
|
|
393
|
+
label,
|
|
394
|
+
value,
|
|
395
|
+
icon,
|
|
396
|
+
supporting,
|
|
397
|
+
trend,
|
|
398
|
+
tone,
|
|
399
|
+
orientation = "vertical",
|
|
400
|
+
...props
|
|
401
|
+
}) {
|
|
402
|
+
const TrendIcon = trend ? trendIcon[trend.direction] : null;
|
|
403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
404
|
+
"div",
|
|
405
|
+
{
|
|
406
|
+
"data-slot": "metric",
|
|
407
|
+
className: cn(
|
|
408
|
+
"flex min-w-0",
|
|
409
|
+
orientation === "vertical" ? "flex-col gap-0.5" : "items-center justify-between gap-2",
|
|
410
|
+
className
|
|
411
|
+
),
|
|
412
|
+
...props,
|
|
413
|
+
children: [
|
|
414
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
415
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { icon, size: "sm" }),
|
|
416
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "truncate text-[11px] font-medium uppercase tracking-wide text-[var(--text-muted)]", children: label })
|
|
417
|
+
] }),
|
|
418
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-baseline gap-1.5", children: [
|
|
419
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
420
|
+
"span",
|
|
421
|
+
{
|
|
422
|
+
className: cn(
|
|
423
|
+
"text-lg font-semibold leading-none tabular-nums",
|
|
424
|
+
tone ? toneColor[tone] : "text-[var(--text-primary)]"
|
|
425
|
+
),
|
|
426
|
+
children: value
|
|
427
|
+
}
|
|
428
|
+
),
|
|
429
|
+
trend && TrendIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
430
|
+
"span",
|
|
431
|
+
{
|
|
432
|
+
className: cn(
|
|
433
|
+
"inline-flex items-center gap-0.5 text-xs font-medium tabular-nums",
|
|
434
|
+
trend.tone ? toneColor[trend.tone] : "text-[var(--text-muted)]"
|
|
435
|
+
),
|
|
436
|
+
children: [
|
|
437
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TrendIcon, { className: "size-3", "aria-hidden": true }),
|
|
438
|
+
trend.value
|
|
439
|
+
]
|
|
440
|
+
}
|
|
441
|
+
)
|
|
442
|
+
] }),
|
|
443
|
+
supporting && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "truncate text-xs text-[var(--text-muted)]", children: supporting })
|
|
444
|
+
]
|
|
445
|
+
}
|
|
446
|
+
);
|
|
447
|
+
}
|
|
448
|
+
function MetricCard({ className, ...props }) {
|
|
449
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
450
|
+
"div",
|
|
451
|
+
{
|
|
452
|
+
"data-slot": "metric-card",
|
|
453
|
+
className: cn(
|
|
454
|
+
"flex min-w-0 flex-col rounded-lg border border-[var(--surface-line)] bg-[var(--surface-raised)] p-3 shadow-[inset_0_1px_0_var(--surface-rim)]",
|
|
455
|
+
className
|
|
456
|
+
),
|
|
457
|
+
...props
|
|
458
|
+
}
|
|
459
|
+
);
|
|
460
|
+
}
|
|
461
|
+
function MetricGroup({ columns = "auto", gap = "sm", minColumnWidth = 96, ...props }) {
|
|
462
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
463
|
+
Grid,
|
|
464
|
+
{
|
|
465
|
+
"data-slot": "metric-group",
|
|
466
|
+
columns,
|
|
467
|
+
gap,
|
|
468
|
+
minColumnWidth,
|
|
469
|
+
...props
|
|
470
|
+
}
|
|
471
|
+
);
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
// src/components/dashboard/status.tsx
|
|
475
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
476
|
+
function Status({
|
|
477
|
+
className,
|
|
478
|
+
tone = "neutral",
|
|
479
|
+
variant = "dot",
|
|
480
|
+
pulse = false,
|
|
481
|
+
children,
|
|
482
|
+
...props
|
|
483
|
+
}) {
|
|
484
|
+
const hasLabel = children != null && children !== "";
|
|
485
|
+
const hasAccessibleName = props["aria-label"] != null || props["aria-labelledby"] != null;
|
|
486
|
+
const hiddenLabel = !hasLabel && !hasAccessibleName ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "sr-only", children: toneLabel[tone] }) : null;
|
|
487
|
+
if (variant === "pill") {
|
|
488
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
489
|
+
"span",
|
|
490
|
+
{
|
|
491
|
+
"data-slot": "status",
|
|
492
|
+
"data-tone": tone,
|
|
493
|
+
className: cn(
|
|
494
|
+
"inline-flex w-fit items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium",
|
|
495
|
+
tonePill[tone],
|
|
496
|
+
className
|
|
497
|
+
),
|
|
498
|
+
...props,
|
|
499
|
+
children: [
|
|
500
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: cn("size-1.5 shrink-0 rounded-full", toneDot[tone]) }),
|
|
501
|
+
children,
|
|
502
|
+
hiddenLabel
|
|
503
|
+
]
|
|
504
|
+
}
|
|
505
|
+
);
|
|
506
|
+
}
|
|
507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
508
|
+
"span",
|
|
509
|
+
{
|
|
510
|
+
"data-slot": "status",
|
|
511
|
+
"data-tone": tone,
|
|
512
|
+
role: hasLabel ? void 0 : "status",
|
|
513
|
+
className: cn(
|
|
514
|
+
"inline-flex items-center gap-1.5 text-xs font-medium text-[var(--text-secondary)]",
|
|
515
|
+
className
|
|
516
|
+
),
|
|
517
|
+
...props,
|
|
518
|
+
children: [
|
|
519
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
520
|
+
"span",
|
|
521
|
+
{
|
|
522
|
+
className: cn(
|
|
523
|
+
"size-2 shrink-0 rounded-full",
|
|
524
|
+
toneDot[tone],
|
|
525
|
+
// ring-current picks up the tone's text colour for a matching glow.
|
|
526
|
+
pulse && cn(toneColor[tone], "ring-2 ring-current/25")
|
|
527
|
+
)
|
|
528
|
+
}
|
|
529
|
+
),
|
|
530
|
+
children,
|
|
531
|
+
hiddenLabel
|
|
532
|
+
]
|
|
533
|
+
}
|
|
534
|
+
);
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
// src/components/dashboard/key-value.tsx
|
|
538
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
539
|
+
function KeyValue({ className, label, value, mono, ...props }) {
|
|
540
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
541
|
+
"div",
|
|
542
|
+
{
|
|
543
|
+
"data-slot": "key-value",
|
|
544
|
+
className: cn("flex items-baseline justify-between gap-3", className),
|
|
545
|
+
...props,
|
|
546
|
+
children: [
|
|
547
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("dt", { className: "shrink-0 truncate text-xs text-[var(--text-muted)]", children: label }),
|
|
548
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
549
|
+
"dd",
|
|
550
|
+
{
|
|
551
|
+
className: cn(
|
|
552
|
+
"min-w-0 truncate text-right text-xs text-[var(--text-primary)]",
|
|
553
|
+
mono && "font-mono tabular-nums"
|
|
554
|
+
),
|
|
555
|
+
children: value
|
|
556
|
+
}
|
|
557
|
+
)
|
|
558
|
+
]
|
|
559
|
+
}
|
|
560
|
+
);
|
|
561
|
+
}
|
|
562
|
+
function KeyValueList({ className, ...props }) {
|
|
563
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
564
|
+
"dl",
|
|
565
|
+
{
|
|
566
|
+
"data-slot": "key-value-list",
|
|
567
|
+
className: cn("flex flex-col gap-1.5", className),
|
|
568
|
+
...props
|
|
569
|
+
}
|
|
570
|
+
);
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
// src/components/ui/item.tsx
|
|
574
|
+
var import_class_variance_authority3 = require("class-variance-authority");
|
|
575
|
+
var import_radix_ui2 = require("radix-ui");
|
|
576
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
577
|
+
var itemVariants = (0, import_class_variance_authority3.cva)(
|
|
578
|
+
"group/item flex items-center border border-transparent text-sm rounded-md transition-colors [a]:hover:bg-accent/50 [a]:transition-colors duration-100 flex-wrap outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
579
|
+
{
|
|
580
|
+
variants: {
|
|
581
|
+
variant: {
|
|
582
|
+
default: "bg-transparent",
|
|
583
|
+
outline: "border-border",
|
|
584
|
+
muted: "bg-muted/50"
|
|
585
|
+
},
|
|
586
|
+
size: {
|
|
587
|
+
default: "p-4 gap-4 ",
|
|
588
|
+
sm: "py-3 px-4 gap-2.5"
|
|
589
|
+
}
|
|
590
|
+
},
|
|
591
|
+
defaultVariants: {
|
|
592
|
+
variant: "default",
|
|
593
|
+
size: "default"
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
);
|
|
597
|
+
function Item({
|
|
598
|
+
className,
|
|
599
|
+
variant = "default",
|
|
600
|
+
size = "default",
|
|
601
|
+
asChild = false,
|
|
602
|
+
...props
|
|
603
|
+
}) {
|
|
604
|
+
const Comp = asChild ? import_radix_ui2.Slot.Root : "div";
|
|
605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
606
|
+
Comp,
|
|
607
|
+
{
|
|
608
|
+
"data-slot": "item",
|
|
609
|
+
"data-variant": variant,
|
|
610
|
+
"data-size": size,
|
|
611
|
+
className: cn(itemVariants({ variant, size, className })),
|
|
612
|
+
...props
|
|
613
|
+
}
|
|
614
|
+
);
|
|
615
|
+
}
|
|
616
|
+
var itemMediaVariants = (0, import_class_variance_authority3.cva)(
|
|
617
|
+
"flex shrink-0 items-center justify-center gap-2 group-has-[[data-slot=item-description]]/item:self-start [&_svg]:pointer-events-none group-has-[[data-slot=item-description]]/item:translate-y-0.5",
|
|
618
|
+
{
|
|
619
|
+
variants: {
|
|
620
|
+
variant: {
|
|
621
|
+
default: "bg-transparent",
|
|
622
|
+
icon: "size-8 border rounded-sm bg-muted [&_svg:not([class*='size-'])]:size-4",
|
|
623
|
+
image: "size-10 rounded-sm overflow-hidden [&_img]:size-full [&_img]:object-cover"
|
|
624
|
+
}
|
|
625
|
+
},
|
|
626
|
+
defaultVariants: {
|
|
627
|
+
variant: "default"
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
);
|
|
631
|
+
function ItemMedia({
|
|
632
|
+
className,
|
|
633
|
+
variant = "default",
|
|
634
|
+
...props
|
|
635
|
+
}) {
|
|
636
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
637
|
+
"div",
|
|
638
|
+
{
|
|
639
|
+
"data-slot": "item-media",
|
|
640
|
+
"data-variant": variant,
|
|
641
|
+
className: cn(itemMediaVariants({ variant, className })),
|
|
642
|
+
...props
|
|
643
|
+
}
|
|
644
|
+
);
|
|
645
|
+
}
|
|
646
|
+
function ItemContent({ className, ...props }) {
|
|
647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
648
|
+
"div",
|
|
649
|
+
{
|
|
650
|
+
"data-slot": "item-content",
|
|
651
|
+
className: cn(
|
|
652
|
+
"flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none",
|
|
653
|
+
className
|
|
654
|
+
),
|
|
655
|
+
...props
|
|
656
|
+
}
|
|
657
|
+
);
|
|
658
|
+
}
|
|
659
|
+
function ItemTitle({ className, ...props }) {
|
|
660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
661
|
+
"div",
|
|
662
|
+
{
|
|
663
|
+
"data-slot": "item-title",
|
|
664
|
+
className: cn(
|
|
665
|
+
"flex w-fit items-center gap-2 text-sm leading-snug font-medium",
|
|
666
|
+
className
|
|
667
|
+
),
|
|
668
|
+
...props
|
|
669
|
+
}
|
|
670
|
+
);
|
|
671
|
+
}
|
|
672
|
+
function ItemDescription({ className, ...props }) {
|
|
673
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
674
|
+
"p",
|
|
675
|
+
{
|
|
676
|
+
"data-slot": "item-description",
|
|
677
|
+
className: cn(
|
|
678
|
+
"text-muted-foreground line-clamp-2 text-sm leading-normal font-normal text-balance",
|
|
679
|
+
"[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
|
|
680
|
+
className
|
|
681
|
+
),
|
|
682
|
+
...props
|
|
683
|
+
}
|
|
684
|
+
);
|
|
685
|
+
}
|
|
686
|
+
function ItemActions({ className, ...props }) {
|
|
687
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
688
|
+
"div",
|
|
689
|
+
{
|
|
690
|
+
"data-slot": "item-actions",
|
|
691
|
+
className: cn("flex items-center gap-2", className),
|
|
692
|
+
...props
|
|
693
|
+
}
|
|
694
|
+
);
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
// src/components/dashboard/item-list.tsx
|
|
698
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
699
|
+
function ItemListItem({
|
|
700
|
+
className,
|
|
701
|
+
leading,
|
|
702
|
+
primary,
|
|
703
|
+
secondary,
|
|
704
|
+
trailing,
|
|
705
|
+
actions,
|
|
706
|
+
variant = "default",
|
|
707
|
+
...props
|
|
708
|
+
}) {
|
|
709
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
710
|
+
Item,
|
|
711
|
+
{
|
|
712
|
+
"data-slot": "item-list-item",
|
|
713
|
+
variant,
|
|
714
|
+
size: "sm",
|
|
715
|
+
className: cn(
|
|
716
|
+
"gap-2 rounded-md bg-[var(--surface-flat)] p-2 transition-colors hover:bg-[var(--glass-hover)]",
|
|
717
|
+
className
|
|
718
|
+
),
|
|
719
|
+
...props,
|
|
720
|
+
children: [
|
|
721
|
+
leading && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ItemMedia, { className: "self-center", children: leading }),
|
|
722
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(ItemContent, { className: "gap-0.5", children: [
|
|
723
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ItemTitle, { className: "truncate text-xs font-medium text-[var(--text-primary)]", children: primary }),
|
|
724
|
+
secondary && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ItemDescription, { className: "line-clamp-1 text-xs text-[var(--text-muted)]", children: secondary })
|
|
725
|
+
] }),
|
|
726
|
+
trailing && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "shrink-0 text-[11px] tabular-nums text-[var(--text-muted)]", children: trailing }),
|
|
727
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ItemActions, { children: actions })
|
|
728
|
+
]
|
|
729
|
+
}
|
|
730
|
+
);
|
|
731
|
+
}
|
|
732
|
+
function ItemList({
|
|
733
|
+
className,
|
|
734
|
+
overflowCount = 0,
|
|
735
|
+
children,
|
|
736
|
+
...props
|
|
737
|
+
}) {
|
|
738
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
739
|
+
"div",
|
|
740
|
+
{
|
|
741
|
+
"data-slot": "item-list",
|
|
742
|
+
role: "list",
|
|
743
|
+
className: cn("flex min-w-0 flex-col gap-1", className),
|
|
744
|
+
...props,
|
|
745
|
+
children: [
|
|
746
|
+
children,
|
|
747
|
+
overflowCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "px-2 text-[11px] text-[var(--text-muted)]", children: [
|
|
748
|
+
"+",
|
|
749
|
+
overflowCount,
|
|
750
|
+
" more"
|
|
751
|
+
] })
|
|
752
|
+
]
|
|
753
|
+
}
|
|
754
|
+
);
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
// src/components/dashboard/activity-list.tsx
|
|
758
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
759
|
+
function ActivityListItem({
|
|
760
|
+
className,
|
|
761
|
+
label,
|
|
762
|
+
timestamp,
|
|
763
|
+
detail,
|
|
764
|
+
tone = "neutral",
|
|
765
|
+
icon,
|
|
766
|
+
...props
|
|
767
|
+
}) {
|
|
768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
769
|
+
"li",
|
|
770
|
+
{
|
|
771
|
+
"data-slot": "activity-list-item",
|
|
772
|
+
className: cn("flex items-start gap-2 py-1", className),
|
|
773
|
+
...props,
|
|
774
|
+
children: [
|
|
775
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "mt-1 flex size-3.5 shrink-0 items-center justify-center", children: icon ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { icon, size: "xs", tone: tone === "neutral" ? void 0 : tone }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: cn("size-2 rounded-full", toneDot[tone]) }) }),
|
|
776
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
777
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-baseline justify-between gap-2", children: [
|
|
778
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "truncate text-xs text-[var(--text-primary)]", children: label }),
|
|
779
|
+
timestamp && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "shrink-0 text-[11px] tabular-nums text-[var(--text-muted)]", children: timestamp })
|
|
780
|
+
] }),
|
|
781
|
+
detail && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "line-clamp-1 text-xs text-[var(--text-muted)]", children: detail })
|
|
782
|
+
] })
|
|
783
|
+
]
|
|
784
|
+
}
|
|
785
|
+
);
|
|
786
|
+
}
|
|
787
|
+
function ActivityList({
|
|
788
|
+
className,
|
|
789
|
+
overflowCount = 0,
|
|
790
|
+
children,
|
|
791
|
+
...props
|
|
792
|
+
}) {
|
|
793
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
794
|
+
"ul",
|
|
795
|
+
{
|
|
796
|
+
"data-slot": "activity-list",
|
|
797
|
+
className: cn("flex min-w-0 flex-col", className),
|
|
798
|
+
...props,
|
|
799
|
+
children: [
|
|
800
|
+
children,
|
|
801
|
+
overflowCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("li", { className: "pl-5 pt-0.5 text-[11px] text-[var(--text-muted)]", children: [
|
|
802
|
+
"+",
|
|
803
|
+
overflowCount,
|
|
804
|
+
" more"
|
|
805
|
+
] })
|
|
806
|
+
]
|
|
807
|
+
}
|
|
808
|
+
);
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
// src/components/dashboard/progress-ring.tsx
|
|
812
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
813
|
+
function ProgressRing({
|
|
814
|
+
className,
|
|
815
|
+
value,
|
|
816
|
+
max = 100,
|
|
817
|
+
size = 44,
|
|
818
|
+
thickness = 4,
|
|
819
|
+
tone = "info",
|
|
820
|
+
label,
|
|
821
|
+
showValue = true,
|
|
822
|
+
children,
|
|
823
|
+
...props
|
|
824
|
+
}) {
|
|
825
|
+
const clamped = Math.min(Math.max(value, 0), max);
|
|
826
|
+
const pct = max > 0 ? clamped / max : 0;
|
|
827
|
+
const radius = (size - thickness) / 2;
|
|
828
|
+
const circumference = 2 * Math.PI * radius;
|
|
829
|
+
const dashOffset = circumference * (1 - pct);
|
|
830
|
+
const center = size / 2;
|
|
831
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
832
|
+
"div",
|
|
833
|
+
{
|
|
834
|
+
"data-slot": "progress-ring",
|
|
835
|
+
role: "progressbar",
|
|
836
|
+
"aria-label": label,
|
|
837
|
+
"aria-valuenow": Math.round(clamped),
|
|
838
|
+
"aria-valuemin": 0,
|
|
839
|
+
"aria-valuemax": max,
|
|
840
|
+
className: cn(
|
|
841
|
+
"relative inline-flex shrink-0 items-center justify-center",
|
|
842
|
+
toneColor[tone],
|
|
843
|
+
className
|
|
844
|
+
),
|
|
845
|
+
style: { width: size, height: size },
|
|
846
|
+
...props,
|
|
847
|
+
children: [
|
|
848
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("svg", { width: size, height: size, className: "-rotate-90", children: [
|
|
849
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
850
|
+
"circle",
|
|
851
|
+
{
|
|
852
|
+
cx: center,
|
|
853
|
+
cy: center,
|
|
854
|
+
r: radius,
|
|
855
|
+
fill: "none",
|
|
856
|
+
stroke: "var(--surface-line)",
|
|
857
|
+
strokeWidth: thickness
|
|
858
|
+
}
|
|
859
|
+
),
|
|
860
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
861
|
+
"circle",
|
|
862
|
+
{
|
|
863
|
+
cx: center,
|
|
864
|
+
cy: center,
|
|
865
|
+
r: radius,
|
|
866
|
+
fill: "none",
|
|
867
|
+
stroke: "currentColor",
|
|
868
|
+
strokeWidth: thickness,
|
|
869
|
+
strokeLinecap: "round",
|
|
870
|
+
strokeDasharray: circumference,
|
|
871
|
+
strokeDashoffset: dashOffset,
|
|
872
|
+
className: "transition-[stroke-dashoffset] duration-500"
|
|
873
|
+
}
|
|
874
|
+
)
|
|
875
|
+
] }),
|
|
876
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "absolute inset-0 flex items-center justify-center text-[var(--text-primary)]", children: children ?? (showValue && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "text-xs font-semibold tabular-nums", children: [
|
|
877
|
+
Math.round(pct * 100),
|
|
878
|
+
"%"
|
|
879
|
+
] })) })
|
|
880
|
+
]
|
|
881
|
+
}
|
|
882
|
+
);
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
// src/components/dashboard/stale-indicator.tsx
|
|
886
|
+
var import_lucide_react2 = require("lucide-react");
|
|
887
|
+
|
|
888
|
+
// src/components/ui/button.tsx
|
|
889
|
+
var import_class_variance_authority4 = require("class-variance-authority");
|
|
890
|
+
var import_radix_ui3 = require("radix-ui");
|
|
891
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
892
|
+
var buttonVariants = (0, import_class_variance_authority4.cva)(
|
|
893
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
894
|
+
{
|
|
895
|
+
variants: {
|
|
896
|
+
variant: {
|
|
897
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
898
|
+
destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
899
|
+
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
900
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
901
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
902
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
903
|
+
},
|
|
904
|
+
size: {
|
|
905
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
906
|
+
xs: "h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
907
|
+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
908
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
909
|
+
icon: "size-9",
|
|
910
|
+
"icon-xs": "size-6 rounded-md [&_svg:not([class*='size-'])]:size-3",
|
|
911
|
+
"icon-sm": "size-8",
|
|
912
|
+
"icon-lg": "size-10"
|
|
913
|
+
}
|
|
914
|
+
},
|
|
915
|
+
defaultVariants: {
|
|
916
|
+
variant: "default",
|
|
917
|
+
size: "default"
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
);
|
|
921
|
+
function Button({
|
|
922
|
+
className,
|
|
923
|
+
variant = "default",
|
|
924
|
+
size = "default",
|
|
925
|
+
asChild = false,
|
|
926
|
+
...props
|
|
927
|
+
}) {
|
|
928
|
+
const Comp = asChild ? import_radix_ui3.Slot.Root : "button";
|
|
929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
930
|
+
Comp,
|
|
931
|
+
{
|
|
932
|
+
"data-slot": "button",
|
|
933
|
+
"data-variant": variant,
|
|
934
|
+
"data-size": size,
|
|
935
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
936
|
+
...props
|
|
937
|
+
}
|
|
938
|
+
);
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
// src/components/dashboard/icon-button.tsx
|
|
942
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
943
|
+
var sizeMap = {
|
|
944
|
+
xs: "icon-xs",
|
|
945
|
+
sm: "icon-sm",
|
|
946
|
+
md: "icon"
|
|
947
|
+
};
|
|
948
|
+
var iconSizeMap = {
|
|
949
|
+
xs: "xs",
|
|
950
|
+
sm: "sm",
|
|
951
|
+
md: "md"
|
|
952
|
+
};
|
|
953
|
+
function IconButton({
|
|
954
|
+
className,
|
|
955
|
+
icon,
|
|
956
|
+
label,
|
|
957
|
+
size = "sm",
|
|
958
|
+
variant = "ghost",
|
|
959
|
+
...props
|
|
960
|
+
}) {
|
|
961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
962
|
+
Button,
|
|
963
|
+
{
|
|
964
|
+
"data-slot": "icon-button",
|
|
965
|
+
type: "button",
|
|
966
|
+
variant,
|
|
967
|
+
size: sizeMap[size],
|
|
968
|
+
"aria-label": label,
|
|
969
|
+
title: label,
|
|
970
|
+
className: cn("text-[var(--text-muted)]", className),
|
|
971
|
+
...props,
|
|
972
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Icon, { icon, size: iconSizeMap[size], className: "text-current" })
|
|
973
|
+
}
|
|
974
|
+
);
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
// src/components/dashboard/stale-indicator.tsx
|
|
978
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
979
|
+
function StaleIndicator({
|
|
980
|
+
className,
|
|
981
|
+
lastUpdated,
|
|
982
|
+
onRefresh,
|
|
983
|
+
refreshing = false,
|
|
984
|
+
...props
|
|
985
|
+
}) {
|
|
986
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
987
|
+
"div",
|
|
988
|
+
{
|
|
989
|
+
"data-slot": "stale-indicator",
|
|
990
|
+
className: cn(
|
|
991
|
+
"flex items-center gap-1.5 text-[11px] text-[var(--text-muted)]",
|
|
992
|
+
className
|
|
993
|
+
),
|
|
994
|
+
...props,
|
|
995
|
+
children: [
|
|
996
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon, { icon: import_lucide_react2.Clock, size: "xs", tone: "warning" }),
|
|
997
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "truncate", children: lastUpdated ?? "Data may be out of date" }),
|
|
998
|
+
onRefresh && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
999
|
+
IconButton,
|
|
1000
|
+
{
|
|
1001
|
+
icon: import_lucide_react2.RotateCw,
|
|
1002
|
+
label: "Refresh",
|
|
1003
|
+
size: "xs",
|
|
1004
|
+
onClick: onRefresh,
|
|
1005
|
+
className: cn("ml-auto", refreshing && "animate-spin"),
|
|
1006
|
+
disabled: refreshing
|
|
1007
|
+
}
|
|
1008
|
+
)
|
|
1009
|
+
]
|
|
1010
|
+
}
|
|
1011
|
+
);
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
// src/components/dashboard/data-boundary.tsx
|
|
1015
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1016
|
+
function DataBoundary({
|
|
1017
|
+
state,
|
|
1018
|
+
loading,
|
|
1019
|
+
empty,
|
|
1020
|
+
error,
|
|
1021
|
+
stale,
|
|
1022
|
+
children
|
|
1023
|
+
}) {
|
|
1024
|
+
switch (state) {
|
|
1025
|
+
case "loading":
|
|
1026
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_jsx_runtime14.Fragment, { children: loading ?? null });
|
|
1027
|
+
case "empty":
|
|
1028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_jsx_runtime14.Fragment, { children: empty ?? null });
|
|
1029
|
+
case "error":
|
|
1030
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_jsx_runtime14.Fragment, { children: error ?? null });
|
|
1031
|
+
case "stale":
|
|
1032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
1033
|
+
stale,
|
|
1034
|
+
children
|
|
1035
|
+
] });
|
|
1036
|
+
case "ready":
|
|
1037
|
+
default:
|
|
1038
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_jsx_runtime14.Fragment, { children });
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
// src/components/ui/empty.tsx
|
|
1043
|
+
var import_class_variance_authority5 = require("class-variance-authority");
|
|
1044
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1045
|
+
var emptyMediaVariants = (0, import_class_variance_authority5.cva)(
|
|
1046
|
+
"flex shrink-0 items-center justify-center mb-2 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
1047
|
+
{
|
|
1048
|
+
variants: {
|
|
1049
|
+
variant: {
|
|
1050
|
+
default: "bg-transparent",
|
|
1051
|
+
icon: "bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6"
|
|
1052
|
+
}
|
|
1053
|
+
},
|
|
1054
|
+
defaultVariants: {
|
|
1055
|
+
variant: "default"
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
);
|
|
1059
|
+
|
|
1060
|
+
// src/components/dashboard/empty-state.tsx
|
|
1061
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1062
|
+
|
|
1063
|
+
// src/components/ui/skeleton.tsx
|
|
1064
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1065
|
+
|
|
1066
|
+
// src/components/dashboard/skeletons.tsx
|
|
1067
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1068
|
+
|
|
1069
|
+
// src/components/reference/StarterExample.tsx
|
|
1070
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1071
|
+
var RECENT = [
|
|
1072
|
+
{ id: "a", label: "Nightly build", timestamp: "12m", tone: "success" },
|
|
1073
|
+
{ id: "b", label: "Deploy to staging", timestamp: "1h", tone: "info" },
|
|
1074
|
+
{ id: "c", label: "Dependency audit", timestamp: "3h", tone: "neutral" }
|
|
1075
|
+
];
|
|
1076
|
+
function StarterExample() {
|
|
1077
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(WidgetContent, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Stack, { gap: "sm", children: [
|
|
1078
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Metric, { label: "Tasks done", value: 12, icon: import_lucide_react3.CheckCircle2, tone: "success" }),
|
|
1079
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Section, { heading: "Recent", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ActivityList, { children: RECENT.map((e) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1080
|
+
ActivityListItem,
|
|
1081
|
+
{
|
|
1082
|
+
tone: e.tone,
|
|
1083
|
+
label: e.label,
|
|
1084
|
+
timestamp: e.timestamp
|
|
1085
|
+
},
|
|
1086
|
+
e.id
|
|
1087
|
+
)) }) })
|
|
1088
|
+
] }) });
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
// src/components/reference/SchedulerExample.tsx
|
|
1092
|
+
var import_lucide_react4 = require("lucide-react");
|
|
1093
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1094
|
+
var UPCOMING = [
|
|
1095
|
+
{ id: "a", label: "Daily backup", timestamp: "08:00", tone: "success" },
|
|
1096
|
+
{ id: "b", label: "Publish report", timestamp: "in 2h", tone: "info" },
|
|
1097
|
+
{ id: "c", label: "Rotate API keys", timestamp: "tomorrow", tone: "warning" }
|
|
1098
|
+
];
|
|
1099
|
+
function SchedulerExample() {
|
|
1100
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(WidgetContent, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Stack, { gap: "sm", children: [
|
|
1101
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Inline, { justify: "between", align: "center", children: [
|
|
1102
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Status, { tone: "success", pulse: true, children: "Scheduler active" }),
|
|
1103
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ProgressRing, { value: 92, label: "Success rate", tone: "success", size: 40 })
|
|
1104
|
+
] }),
|
|
1105
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Section, { heading: "Summary", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Inline, { gap: "sm", wrap: true, children: [
|
|
1106
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(MetricCard, { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Metric, { label: "Jobs", value: 6 }) }),
|
|
1107
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(MetricCard, { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1108
|
+
Metric,
|
|
1109
|
+
{
|
|
1110
|
+
label: "Runs today",
|
|
1111
|
+
value: 18,
|
|
1112
|
+
trend: { direction: "up", value: "+4", tone: "success" }
|
|
1113
|
+
}
|
|
1114
|
+
) })
|
|
1115
|
+
] }) }),
|
|
1116
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Divider, {}),
|
|
1117
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1118
|
+
Section,
|
|
1119
|
+
{
|
|
1120
|
+
heading: "Next up",
|
|
1121
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Button, { size: "xs", variant: "ghost", children: [
|
|
1122
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react4.ExternalLink, { className: "size-3" }),
|
|
1123
|
+
"All"
|
|
1124
|
+
] }),
|
|
1125
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DataBoundary, { state: "ready", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ActivityList, { children: UPCOMING.map((e) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1126
|
+
ActivityListItem,
|
|
1127
|
+
{
|
|
1128
|
+
tone: e.tone,
|
|
1129
|
+
label: e.label,
|
|
1130
|
+
timestamp: e.timestamp
|
|
1131
|
+
},
|
|
1132
|
+
e.id
|
|
1133
|
+
)) }) })
|
|
1134
|
+
}
|
|
1135
|
+
),
|
|
1136
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(StaleIndicator, { lastUpdated: "Updated 2m ago" })
|
|
1137
|
+
] }) });
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
// src/components/reference/ResourceExample.tsx
|
|
1141
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1142
|
+
function Ring({
|
|
1143
|
+
value,
|
|
1144
|
+
label,
|
|
1145
|
+
tone
|
|
1146
|
+
}) {
|
|
1147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Stack, { gap: "xs", align: "center", children: [
|
|
1148
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ProgressRing, { value, label, tone }),
|
|
1149
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { variant: "muted", children: label })
|
|
1150
|
+
] });
|
|
1151
|
+
}
|
|
1152
|
+
function ResourceExample() {
|
|
1153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(WidgetContent, { scroll: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Stack, { gap: "sm", children: [
|
|
1154
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Heading, { level: 2, size: "md", children: "Resources" }),
|
|
1155
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(MetricGroup, { children: [
|
|
1156
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Metric, { label: "CPU", value: "42%", tone: "success" }),
|
|
1157
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Metric, { label: "Memory", value: "6.1 GB" }),
|
|
1158
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Metric, { label: "Disk", value: "71%", tone: "warning" })
|
|
1159
|
+
] }),
|
|
1160
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Divider, {}),
|
|
1161
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Section, { heading: "Usage", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Grid, { columns: 3, gap: "sm", children: [
|
|
1162
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Ring, { value: 42, label: "CPU", tone: "success" }),
|
|
1163
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Ring, { value: 61, label: "Memory", tone: "info" }),
|
|
1164
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Ring, { value: 71, label: "Disk", tone: "warning" })
|
|
1165
|
+
] }) }),
|
|
1166
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Divider, {}),
|
|
1167
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Section, { heading: "Host", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(KeyValueList, { children: [
|
|
1168
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(KeyValue, { label: "Region", value: "eu-west-1", mono: true }),
|
|
1169
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(KeyValue, { label: "Instance", value: "c7g.xlarge", mono: true }),
|
|
1170
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(KeyValue, { label: "Uptime", value: "14d 6h", mono: true }),
|
|
1171
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(KeyValue, { label: "Status", value: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Status, { tone: "success", children: "Healthy" }) })
|
|
1172
|
+
] }) })
|
|
1173
|
+
] }) });
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
// src/components/reference/ActivityExample.tsx
|
|
1177
|
+
var import_lucide_react5 = require("lucide-react");
|
|
1178
|
+
|
|
1179
|
+
// src/components/ui/badge.tsx
|
|
1180
|
+
var import_class_variance_authority6 = require("class-variance-authority");
|
|
1181
|
+
var import_radix_ui4 = require("radix-ui");
|
|
1182
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1183
|
+
var badgeVariants = (0, import_class_variance_authority6.cva)(
|
|
1184
|
+
"inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
|
|
1185
|
+
{
|
|
1186
|
+
variants: {
|
|
1187
|
+
variant: {
|
|
1188
|
+
default: "bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
1189
|
+
secondary: "bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
|
1190
|
+
destructive: "bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
1191
|
+
outline: "border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
1192
|
+
ghost: "[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
1193
|
+
link: "text-primary underline-offset-4 [a&]:hover:underline",
|
|
1194
|
+
// Semantic status tones (error is covered by `destructive`).
|
|
1195
|
+
success: "bg-[var(--status-success-muted)] text-[var(--status-success)]",
|
|
1196
|
+
warning: "bg-[var(--status-warning-muted)] text-[var(--status-warning)]",
|
|
1197
|
+
info: "bg-[var(--status-info-muted)] text-[var(--status-info)]"
|
|
1198
|
+
}
|
|
1199
|
+
},
|
|
1200
|
+
defaultVariants: {
|
|
1201
|
+
variant: "default"
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
);
|
|
1205
|
+
function Badge({
|
|
1206
|
+
className,
|
|
1207
|
+
variant = "default",
|
|
1208
|
+
asChild = false,
|
|
1209
|
+
...props
|
|
1210
|
+
}) {
|
|
1211
|
+
const Comp = asChild ? import_radix_ui4.Slot.Root : "span";
|
|
1212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1213
|
+
Comp,
|
|
1214
|
+
{
|
|
1215
|
+
"data-slot": "badge",
|
|
1216
|
+
"data-variant": variant,
|
|
1217
|
+
className: cn(badgeVariants({ variant }), className),
|
|
1218
|
+
...props
|
|
1219
|
+
}
|
|
1220
|
+
);
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
// src/components/reference/ActivityExample.tsx
|
|
1224
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1225
|
+
var ITEMS = [
|
|
1226
|
+
{ id: "1", title: "quarterly-report.pdf", meta: "2h", badge: "PDF" },
|
|
1227
|
+
{ id: "2", title: "design-tokens.json", meta: "5h", badge: "JSON" },
|
|
1228
|
+
{ id: "3", title: "release-notes.md", meta: "1d", badge: "MD" }
|
|
1229
|
+
];
|
|
1230
|
+
function ActivityExample() {
|
|
1231
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(WidgetContent, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Stack, { gap: "sm", fill: true, children: [
|
|
1232
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Inline, { justify: "between", align: "center", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Inline, { gap: "xs", align: "center", children: [
|
|
1233
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text, { variant: "label", children: "Recent files" }),
|
|
1234
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Badge, { variant: "info", children: ITEMS.length })
|
|
1235
|
+
] }) }),
|
|
1236
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Stack, { gap: "none", scroll: true, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ItemList, { children: ITEMS.map((f) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1237
|
+
ItemListItem,
|
|
1238
|
+
{
|
|
1239
|
+
leading: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react5.FileText, { className: "size-4 text-[var(--text-muted)]" }),
|
|
1240
|
+
primary: f.title,
|
|
1241
|
+
trailing: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Inline, { gap: "xs", align: "center", children: [
|
|
1242
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Badge, { variant: "secondary", children: f.badge }),
|
|
1243
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: f.meta })
|
|
1244
|
+
] })
|
|
1245
|
+
},
|
|
1246
|
+
f.id
|
|
1247
|
+
)) }) }),
|
|
1248
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Inline, { justify: "between", align: "center", children: [
|
|
1249
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Status, { tone: "info", variant: "pill", children: "Synced" }),
|
|
1250
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(StaleIndicator, { lastUpdated: "Synced 30s ago" })
|
|
1251
|
+
] })
|
|
1252
|
+
] }) });
|
|
1253
|
+
}
|
|
1254
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1255
|
+
0 && (module.exports = {
|
|
1256
|
+
ActivityExample,
|
|
1257
|
+
ResourceExample,
|
|
1258
|
+
SchedulerExample,
|
|
1259
|
+
StarterExample
|
|
1260
|
+
});
|