@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,194 @@
|
|
|
1
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
2
|
+
const NONE_PRESET = {
|
|
3
|
+
id: "__none__",
|
|
4
|
+
name: "None",
|
|
5
|
+
systemPrompt: "",
|
|
6
|
+
disabledTools: ["__all__"],
|
|
7
|
+
disabledSkills: ["__all__"]
|
|
8
|
+
};
|
|
9
|
+
const DEFAULT_PRESET = {
|
|
10
|
+
id: "__default__",
|
|
11
|
+
name: "Default",
|
|
12
|
+
systemPrompt: null,
|
|
13
|
+
disabledTools: [],
|
|
14
|
+
disabledSkills: []
|
|
15
|
+
};
|
|
16
|
+
const BUILTIN_PRESETS = [DEFAULT_PRESET, NONE_PRESET];
|
|
17
|
+
function normalizeDisabledNames(names, availableNames) {
|
|
18
|
+
const allowed = new Set(availableNames);
|
|
19
|
+
return new Set((names ?? []).filter((name) => allowed.has(name)));
|
|
20
|
+
}
|
|
21
|
+
function appliedSystemPrompt(overrides) {
|
|
22
|
+
if (!overrides || !Object.prototype.hasOwnProperty.call(overrides, "systemPrompt")) return null;
|
|
23
|
+
return typeof overrides.systemPrompt === "string" ? overrides.systemPrompt : null;
|
|
24
|
+
}
|
|
25
|
+
function enabledCount(items, disabled, allDisabled) {
|
|
26
|
+
if (allDisabled) return 0;
|
|
27
|
+
return items.filter((item) => !disabled.has(item.name)).length;
|
|
28
|
+
}
|
|
29
|
+
function useContextEditorModel({
|
|
30
|
+
open,
|
|
31
|
+
available,
|
|
32
|
+
initialOverrides,
|
|
33
|
+
presets,
|
|
34
|
+
onSavePreset,
|
|
35
|
+
onDeletePreset
|
|
36
|
+
}) {
|
|
37
|
+
const [systemPrompt, setSystemPromptState] = useState(null);
|
|
38
|
+
const [disabledTools, setDisabledTools] = useState(/* @__PURE__ */ new Set());
|
|
39
|
+
const [disabledSkills, setDisabledSkills] = useState(/* @__PURE__ */ new Set());
|
|
40
|
+
const [allToolsDisabled, setAllToolsDisabled] = useState(false);
|
|
41
|
+
const [allSkillsDisabled, setAllSkillsDisabled] = useState(false);
|
|
42
|
+
const [activePresetId, setActivePresetId] = useState("__default__");
|
|
43
|
+
const [showSaveInput, setShowSaveInput] = useState(false);
|
|
44
|
+
const tools = available?.tools ?? [];
|
|
45
|
+
const skills = available?.skills ?? [];
|
|
46
|
+
const seededRef = useRef(false);
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
if (!open) {
|
|
49
|
+
seededRef.current = false;
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (seededRef.current || !available) return;
|
|
53
|
+
seededRef.current = true;
|
|
54
|
+
const seedDisabledTools = normalizeDisabledNames(
|
|
55
|
+
initialOverrides?.disabledTools,
|
|
56
|
+
available.tools.map((t) => t.name)
|
|
57
|
+
);
|
|
58
|
+
const seedDisabledSkills = normalizeDisabledNames(
|
|
59
|
+
initialOverrides?.disabledSkills,
|
|
60
|
+
available.skills.map((s) => s.name)
|
|
61
|
+
);
|
|
62
|
+
const allTools = available.tools.length > 0 && seedDisabledTools.size >= available.tools.length;
|
|
63
|
+
const allSkills = available.skills.length > 0 && seedDisabledSkills.size >= available.skills.length;
|
|
64
|
+
setSystemPromptState(appliedSystemPrompt(initialOverrides));
|
|
65
|
+
setDisabledTools(allTools ? /* @__PURE__ */ new Set() : seedDisabledTools);
|
|
66
|
+
setDisabledSkills(allSkills ? /* @__PURE__ */ new Set() : seedDisabledSkills);
|
|
67
|
+
setAllToolsDisabled(allTools);
|
|
68
|
+
setAllSkillsDisabled(allSkills);
|
|
69
|
+
setActivePresetId(initialOverrides ? null : "__default__");
|
|
70
|
+
setShowSaveInput(false);
|
|
71
|
+
}, [open, available, initialOverrides]);
|
|
72
|
+
const setSystemPrompt = useCallback((value) => {
|
|
73
|
+
setSystemPromptState(value);
|
|
74
|
+
setActivePresetId(null);
|
|
75
|
+
}, []);
|
|
76
|
+
const toggleCapability = useCallback(
|
|
77
|
+
(name, items, disabled, allDisabled, setDisabled, setAll) => {
|
|
78
|
+
let next;
|
|
79
|
+
if (allDisabled) {
|
|
80
|
+
next = new Set(items.map((i) => i.name));
|
|
81
|
+
next.delete(name);
|
|
82
|
+
} else {
|
|
83
|
+
next = new Set(disabled);
|
|
84
|
+
if (next.has(name)) next.delete(name);
|
|
85
|
+
else next.add(name);
|
|
86
|
+
}
|
|
87
|
+
const total = items.length;
|
|
88
|
+
const allNowDisabled = total > 0 && next.size >= total;
|
|
89
|
+
setDisabled(allNowDisabled ? /* @__PURE__ */ new Set() : next);
|
|
90
|
+
setAll(allNowDisabled);
|
|
91
|
+
setActivePresetId(null);
|
|
92
|
+
},
|
|
93
|
+
[]
|
|
94
|
+
);
|
|
95
|
+
const loadPreset = useCallback(
|
|
96
|
+
(presetId) => {
|
|
97
|
+
const all = [...BUILTIN_PRESETS, ...presets];
|
|
98
|
+
const preset = all.find((p) => p.id === presetId);
|
|
99
|
+
if (!preset) return;
|
|
100
|
+
const allTools = preset.disabledTools.includes("__all__");
|
|
101
|
+
const allSkills = preset.disabledSkills.includes("__all__");
|
|
102
|
+
setSystemPromptState(preset.systemPrompt);
|
|
103
|
+
setDisabledTools(new Set(allTools ? [] : preset.disabledTools));
|
|
104
|
+
setDisabledSkills(new Set(allSkills ? [] : preset.disabledSkills));
|
|
105
|
+
setAllToolsDisabled(allTools);
|
|
106
|
+
setAllSkillsDisabled(allSkills);
|
|
107
|
+
setActivePresetId(presetId);
|
|
108
|
+
},
|
|
109
|
+
[presets]
|
|
110
|
+
);
|
|
111
|
+
const resetToDefault = useCallback(() => {
|
|
112
|
+
setSystemPromptState(null);
|
|
113
|
+
setDisabledTools(/* @__PURE__ */ new Set());
|
|
114
|
+
setDisabledSkills(/* @__PURE__ */ new Set());
|
|
115
|
+
setAllToolsDisabled(false);
|
|
116
|
+
setAllSkillsDisabled(false);
|
|
117
|
+
setActivePresetId("__default__");
|
|
118
|
+
setShowSaveInput(false);
|
|
119
|
+
}, []);
|
|
120
|
+
const buildOverrides = useCallback(() => {
|
|
121
|
+
const toolsToDisable = allToolsDisabled ? tools.map((t) => t.name) : Array.from(disabledTools);
|
|
122
|
+
const skillsToDisable = allSkillsDisabled ? skills.map((s) => s.name) : Array.from(disabledSkills);
|
|
123
|
+
const has = systemPrompt !== null || toolsToDisable.length > 0 || skillsToDisable.length > 0;
|
|
124
|
+
if (!has) return null;
|
|
125
|
+
return {
|
|
126
|
+
systemPrompt: systemPrompt ?? void 0,
|
|
127
|
+
disabledTools: toolsToDisable.length > 0 ? toolsToDisable : void 0,
|
|
128
|
+
disabledSkills: skillsToDisable.length > 0 ? skillsToDisable : void 0
|
|
129
|
+
};
|
|
130
|
+
}, [allToolsDisabled, allSkillsDisabled, tools, skills, disabledTools, disabledSkills, systemPrompt]);
|
|
131
|
+
const handleSavePreset = useCallback(
|
|
132
|
+
(name) => {
|
|
133
|
+
onSavePreset(name, {
|
|
134
|
+
systemPrompt,
|
|
135
|
+
disabledTools: allToolsDisabled ? ["__all__"] : Array.from(disabledTools),
|
|
136
|
+
disabledSkills: allSkillsDisabled ? ["__all__"] : Array.from(disabledSkills)
|
|
137
|
+
});
|
|
138
|
+
setShowSaveInput(false);
|
|
139
|
+
},
|
|
140
|
+
[onSavePreset, systemPrompt, allToolsDisabled, disabledTools, allSkillsDisabled, disabledSkills]
|
|
141
|
+
);
|
|
142
|
+
const allPresets = useMemo(() => [...BUILTIN_PRESETS, ...presets], [presets]);
|
|
143
|
+
const activeUserPreset = useMemo(
|
|
144
|
+
() => activePresetId && !activePresetId.startsWith("__") ? allPresets.find((p) => p.id === activePresetId) ?? null : null,
|
|
145
|
+
[activePresetId, allPresets]
|
|
146
|
+
);
|
|
147
|
+
const hasOverrides = systemPrompt !== null || disabledTools.size > 0 || disabledSkills.size > 0 || allToolsDisabled || allSkillsDisabled;
|
|
148
|
+
return {
|
|
149
|
+
displayedPrompt: systemPrompt ?? available?.systemPrompt ?? "",
|
|
150
|
+
systemPrompt,
|
|
151
|
+
setSystemPrompt,
|
|
152
|
+
preset: {
|
|
153
|
+
allPresets,
|
|
154
|
+
activePresetId,
|
|
155
|
+
activeUserPreset,
|
|
156
|
+
hasOverrides,
|
|
157
|
+
showSaveInput,
|
|
158
|
+
onPresetChange: loadPreset,
|
|
159
|
+
onDelete: onDeletePreset,
|
|
160
|
+
onReset: resetToDefault,
|
|
161
|
+
onShowSave: () => setShowSaveInput(true),
|
|
162
|
+
onSave: handleSavePreset,
|
|
163
|
+
onCancelSave: () => setShowSaveInput(false)
|
|
164
|
+
},
|
|
165
|
+
tools: {
|
|
166
|
+
items: tools,
|
|
167
|
+
allDisabled: allToolsDisabled,
|
|
168
|
+
enabledCount: enabledCount(tools, disabledTools, allToolsDisabled),
|
|
169
|
+
isEnabled: (name) => !allToolsDisabled && !disabledTools.has(name),
|
|
170
|
+
onToggle: (name) => toggleCapability(name, tools, disabledTools, allToolsDisabled, setDisabledTools, setAllToolsDisabled),
|
|
171
|
+
onToggleAll: (disabled) => {
|
|
172
|
+
setAllToolsDisabled(disabled);
|
|
173
|
+
setDisabledTools(/* @__PURE__ */ new Set());
|
|
174
|
+
setActivePresetId(null);
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
skills: {
|
|
178
|
+
items: skills,
|
|
179
|
+
allDisabled: allSkillsDisabled,
|
|
180
|
+
enabledCount: enabledCount(skills, disabledSkills, allSkillsDisabled),
|
|
181
|
+
isEnabled: (name) => !allSkillsDisabled && !disabledSkills.has(name),
|
|
182
|
+
onToggle: (name) => toggleCapability(name, skills, disabledSkills, allSkillsDisabled, setDisabledSkills, setAllSkillsDisabled),
|
|
183
|
+
onToggleAll: (disabled) => {
|
|
184
|
+
setAllSkillsDisabled(disabled);
|
|
185
|
+
setDisabledSkills(/* @__PURE__ */ new Set());
|
|
186
|
+
setActivePresetId(null);
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
buildOverrides
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
export {
|
|
193
|
+
useContextEditorModel
|
|
194
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _jsxruntime = require('react/jsx-runtime');
|
|
2
|
+
var _utils = require('../../lib/utils');
|
|
3
|
+
var _typography = require('./typography');
|
|
4
|
+
var _tone = require('./tone');
|
|
5
|
+
function ActivityListItem({
|
|
6
|
+
className,
|
|
7
|
+
label,
|
|
8
|
+
timestamp,
|
|
9
|
+
detail,
|
|
10
|
+
tone = "neutral",
|
|
11
|
+
icon,
|
|
12
|
+
...props
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
15
|
+
"li",
|
|
16
|
+
{
|
|
17
|
+
"data-slot": "activity-list-item",
|
|
18
|
+
className: _utils.cn.call(void 0, "flex items-start gap-2 py-1", className),
|
|
19
|
+
...props,
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "mt-1 flex size-3.5 shrink-0 items-center justify-center", children: icon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _typography.Icon, { icon, size: "xs", tone: tone === "neutral" ? void 0 : tone }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: _utils.cn.call(void 0, "size-2 rounded-full", _tone.toneDot[tone]) }) }),
|
|
22
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
23
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-baseline justify-between gap-2", children: [
|
|
24
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "truncate text-xs text-[var(--text-primary)]", children: label }),
|
|
25
|
+
timestamp && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "shrink-0 text-[11px] tabular-nums text-[var(--text-muted)]", children: timestamp })
|
|
26
|
+
] }),
|
|
27
|
+
detail && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "line-clamp-1 text-xs text-[var(--text-muted)]", children: detail })
|
|
28
|
+
] })
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
function ActivityList({
|
|
34
|
+
className,
|
|
35
|
+
overflowCount = 0,
|
|
36
|
+
children,
|
|
37
|
+
...props
|
|
38
|
+
}) {
|
|
39
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
40
|
+
"ul",
|
|
41
|
+
{
|
|
42
|
+
"data-slot": "activity-list",
|
|
43
|
+
className: _utils.cn.call(void 0, "flex min-w-0 flex-col", className),
|
|
44
|
+
...props,
|
|
45
|
+
children: [
|
|
46
|
+
children,
|
|
47
|
+
overflowCount > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "li", { className: "pl-5 pt-0.5 text-[11px] text-[var(--text-muted)]", children: [
|
|
48
|
+
"+",
|
|
49
|
+
overflowCount,
|
|
50
|
+
" more"
|
|
51
|
+
] })
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
exports.ActivityList = ActivityList; exports.ActivityListItem = ActivityListItem;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Tone } from './tone.cjs';
|
|
4
|
+
|
|
5
|
+
interface ActivityListItemProps extends Omit<React.ComponentProps<"li">, "title"> {
|
|
6
|
+
label: React.ReactNode;
|
|
7
|
+
/** Pre-formatted timestamp, e.g. "08:00" or "in 2h". */
|
|
8
|
+
timestamp?: React.ReactNode;
|
|
9
|
+
/** Supporting detail under the label. */
|
|
10
|
+
detail?: React.ReactNode;
|
|
11
|
+
/** Status marker tone. Ignored when `icon` is provided. */
|
|
12
|
+
tone?: Tone;
|
|
13
|
+
/** Leading icon component, used instead of the status dot. */
|
|
14
|
+
icon?: React.ComponentType<{
|
|
15
|
+
className?: string;
|
|
16
|
+
}>;
|
|
17
|
+
}
|
|
18
|
+
/** A single chronological event row. */
|
|
19
|
+
declare function ActivityListItem({ className, label, timestamp, detail, tone, icon, ...props }: ActivityListItemProps): react_jsx_runtime.JSX.Element;
|
|
20
|
+
interface ActivityListProps extends React.ComponentProps<"ul"> {
|
|
21
|
+
/** Count of events not shown; renders a "+N more" footer when > 0. */
|
|
22
|
+
overflowCount?: number;
|
|
23
|
+
}
|
|
24
|
+
/** A chronological list of ActivityListItem rows. */
|
|
25
|
+
declare function ActivityList({ className, overflowCount, children, ...props }: ActivityListProps): react_jsx_runtime.JSX.Element;
|
|
26
|
+
|
|
27
|
+
export { ActivityList, ActivityListItem, type ActivityListItemProps, type ActivityListProps };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Tone } from './tone.js';
|
|
4
|
+
|
|
5
|
+
interface ActivityListItemProps extends Omit<React.ComponentProps<"li">, "title"> {
|
|
6
|
+
label: React.ReactNode;
|
|
7
|
+
/** Pre-formatted timestamp, e.g. "08:00" or "in 2h". */
|
|
8
|
+
timestamp?: React.ReactNode;
|
|
9
|
+
/** Supporting detail under the label. */
|
|
10
|
+
detail?: React.ReactNode;
|
|
11
|
+
/** Status marker tone. Ignored when `icon` is provided. */
|
|
12
|
+
tone?: Tone;
|
|
13
|
+
/** Leading icon component, used instead of the status dot. */
|
|
14
|
+
icon?: React.ComponentType<{
|
|
15
|
+
className?: string;
|
|
16
|
+
}>;
|
|
17
|
+
}
|
|
18
|
+
/** A single chronological event row. */
|
|
19
|
+
declare function ActivityListItem({ className, label, timestamp, detail, tone, icon, ...props }: ActivityListItemProps): react_jsx_runtime.JSX.Element;
|
|
20
|
+
interface ActivityListProps extends React.ComponentProps<"ul"> {
|
|
21
|
+
/** Count of events not shown; renders a "+N more" footer when > 0. */
|
|
22
|
+
overflowCount?: number;
|
|
23
|
+
}
|
|
24
|
+
/** A chronological list of ActivityListItem rows. */
|
|
25
|
+
declare function ActivityList({ className, overflowCount, children, ...props }: ActivityListProps): react_jsx_runtime.JSX.Element;
|
|
26
|
+
|
|
27
|
+
export { ActivityList, ActivityListItem, type ActivityListItemProps, type ActivityListProps };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/utils";
|
|
3
|
+
import { Icon } from "./typography";
|
|
4
|
+
import { toneDot } from "./tone";
|
|
5
|
+
function ActivityListItem({
|
|
6
|
+
className,
|
|
7
|
+
label,
|
|
8
|
+
timestamp,
|
|
9
|
+
detail,
|
|
10
|
+
tone = "neutral",
|
|
11
|
+
icon,
|
|
12
|
+
...props
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ jsxs(
|
|
15
|
+
"li",
|
|
16
|
+
{
|
|
17
|
+
"data-slot": "activity-list-item",
|
|
18
|
+
className: cn("flex items-start gap-2 py-1", className),
|
|
19
|
+
...props,
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ jsx("span", { className: "mt-1 flex size-3.5 shrink-0 items-center justify-center", children: icon ? /* @__PURE__ */ jsx(Icon, { icon, size: "xs", tone: tone === "neutral" ? void 0 : tone }) : /* @__PURE__ */ jsx("span", { className: cn("size-2 rounded-full", toneDot[tone]) }) }),
|
|
22
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
23
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-baseline justify-between gap-2", children: [
|
|
24
|
+
/* @__PURE__ */ jsx("span", { className: "truncate text-xs text-[var(--text-primary)]", children: label }),
|
|
25
|
+
timestamp && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-[11px] tabular-nums text-[var(--text-muted)]", children: timestamp })
|
|
26
|
+
] }),
|
|
27
|
+
detail && /* @__PURE__ */ jsx("span", { className: "line-clamp-1 text-xs text-[var(--text-muted)]", children: detail })
|
|
28
|
+
] })
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
function ActivityList({
|
|
34
|
+
className,
|
|
35
|
+
overflowCount = 0,
|
|
36
|
+
children,
|
|
37
|
+
...props
|
|
38
|
+
}) {
|
|
39
|
+
return /* @__PURE__ */ jsxs(
|
|
40
|
+
"ul",
|
|
41
|
+
{
|
|
42
|
+
"data-slot": "activity-list",
|
|
43
|
+
className: cn("flex min-w-0 flex-col", className),
|
|
44
|
+
...props,
|
|
45
|
+
children: [
|
|
46
|
+
children,
|
|
47
|
+
overflowCount > 0 && /* @__PURE__ */ jsxs("li", { className: "pl-5 pt-0.5 text-[11px] text-[var(--text-muted)]", children: [
|
|
48
|
+
"+",
|
|
49
|
+
overflowCount,
|
|
50
|
+
" more"
|
|
51
|
+
] })
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
export {
|
|
57
|
+
ActivityList,
|
|
58
|
+
ActivityListItem
|
|
59
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface DashboardComponentCatalogEntry {
|
|
2
|
+
name: string;
|
|
3
|
+
category: "layout" | "typography" | "data-display" | "state" | "action" | "filter";
|
|
4
|
+
/** `primitive` = existing @sero-ai/ui primitive; `composite` = new dashboard component. */
|
|
5
|
+
kind: "primitive" | "composite";
|
|
6
|
+
summary: string;
|
|
7
|
+
useWhen: string;
|
|
8
|
+
related?: string[];
|
|
9
|
+
status: "stable" | "experimental";
|
|
10
|
+
example?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type { DashboardComponentCatalogEntry };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface DashboardComponentCatalogEntry {
|
|
2
|
+
name: string;
|
|
3
|
+
category: "layout" | "typography" | "data-display" | "state" | "action" | "filter";
|
|
4
|
+
/** `primitive` = existing @sero-ai/ui primitive; `composite` = new dashboard component. */
|
|
5
|
+
kind: "primitive" | "composite";
|
|
6
|
+
summary: string;
|
|
7
|
+
useWhen: string;
|
|
8
|
+
related?: string[];
|
|
9
|
+
status: "stable" | "experimental";
|
|
10
|
+
example?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type { DashboardComponentCatalogEntry };
|
|
File without changes
|