forked from CopilotKit/CopilotKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcatalog.ts
More file actions
38 lines (36 loc) · 1.03 KB
/
Copy pathcatalog.ts
File metadata and controls
38 lines (36 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { defineCatalog } from "@json-render/core";
import { schema } from "@json-render/react/schema";
import { z } from "zod";
const dataPoint = z.object({ label: z.string(), value: z.number() });
export const catalog = defineCatalog(schema, {
components: {
MetricCard: {
props: z.object({
label: z.string(),
value: z.string(),
trend: z.string().nullable(),
}),
description:
"A labelled metric (single number) with an optional trend subtitle",
},
BarChart: {
props: z.object({
title: z.string(),
description: z.string().nullable(),
data: z.array(dataPoint),
}),
description:
"A vertical bar chart for comparing discrete values side by side",
},
PieChart: {
props: z.object({
title: z.string(),
description: z.string().nullable(),
data: z.array(dataPoint),
}),
description:
"A donut-style pie chart for breaking a total down into category slices",
},
},
actions: {},
});