@copilotkit/react-core 2.0.0-rc.7 → 2.0.0-rc.9
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/dist/{MarkdownRendererContext-B4Us6mwL.d.cts → MarkdownRendererContext-CS35epe1.d.mts} +17 -33
- package/dist/MarkdownRendererContext-CS35epe1.d.mts.map +1 -0
- package/dist/{MarkdownRendererContext-CRKFzsEB.d.mts → MarkdownRendererContext-CfTh92vk.d.cts} +17 -33
- package/dist/MarkdownRendererContext-CfTh92vk.d.cts.map +1 -0
- package/dist/{MarkdownSurfaces-S4wfUl3J.cjs → MarkdownSurfaces-Ije2ZQh0.cjs} +111 -89
- package/dist/MarkdownSurfaces-Ije2ZQh0.cjs.map +1 -0
- package/dist/{MarkdownSurfaces-Bd--93O1.mjs → MarkdownSurfaces-iFKorV2w.mjs} +95 -80
- package/dist/MarkdownSurfaces-iFKorV2w.mjs.map +1 -0
- package/dist/context.cjs +20 -17
- package/dist/context.cjs.map +1 -1
- package/dist/context.d.cts +38 -98
- package/dist/context.d.cts.map +1 -1
- package/dist/context.d.mts +38 -98
- package/dist/context.d.mts.map +1 -1
- package/dist/context.mjs +20 -17
- package/dist/context.mjs.map +1 -1
- package/dist/generative-ui.cjs +541 -520
- package/dist/generative-ui.cjs.map +1 -1
- package/dist/generative-ui.d.cts +2137 -4178
- package/dist/generative-ui.d.cts.map +1 -1
- package/dist/generative-ui.d.mts +2137 -4178
- package/dist/generative-ui.d.mts.map +1 -1
- package/dist/generative-ui.mjs +37 -17
- package/dist/generative-ui.mjs.map +1 -1
- package/dist/headless.cjs +50 -76
- package/dist/headless.cjs.map +1 -1
- package/dist/headless.d.cts +78 -253
- package/dist/headless.d.cts.map +1 -1
- package/dist/headless.d.mts +56 -202
- package/dist/headless.d.mts.map +1 -1
- package/dist/headless.mjs +43 -74
- package/dist/headless.mjs.map +1 -1
- package/dist/index.cjs +765 -1292
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +176 -518
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +175 -517
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +469 -1251
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +867 -1375
- package/dist/index.umd.js.map +1 -1
- package/package.json +15 -16
- package/dist/MarkdownRendererContext-B4Us6mwL.d.cts.map +0 -1
- package/dist/MarkdownRendererContext-CRKFzsEB.d.mts.map +0 -1
- package/dist/MarkdownSurfaces-Bd--93O1.mjs.map +0 -1
- package/dist/MarkdownSurfaces-S4wfUl3J.cjs.map +0 -1
package/dist/generative-ui.cjs
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
const require_MarkdownSurfaces = require('./MarkdownSurfaces-
|
|
4
|
+
const require_MarkdownSurfaces = require('./MarkdownSurfaces-Ije2ZQh0.cjs');
|
|
5
5
|
let react = require("react");
|
|
6
6
|
react = require_MarkdownSurfaces.__toESM(react);
|
|
7
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
8
|
let _copilotkit_shared = require("@copilotkit/shared");
|
|
9
9
|
let zod = require("zod");
|
|
10
|
+
zod = require_MarkdownSurfaces.__toESM(zod);
|
|
10
11
|
let react_dom = require("react-dom");
|
|
11
12
|
|
|
12
13
|
//#region src/generative-ui/refs.ts
|
|
@@ -33,7 +34,7 @@ const mark = (prefix, description) => description ? `${prefix} ${description}` :
|
|
|
33
34
|
* description here, not with `.describe()`, which would replace the mark.
|
|
34
35
|
*/
|
|
35
36
|
function child(description) {
|
|
36
|
-
return zod.
|
|
37
|
+
return zod.string().min(1).describe(mark(_copilotkit_shared.A2UI_COMPONENT_ID_MARK, description)).transform(toNode);
|
|
37
38
|
}
|
|
38
39
|
/**
|
|
39
40
|
* A list of component ids, or a template `{ componentId, path }` that
|
|
@@ -42,9 +43,9 @@ function child(description) {
|
|
|
42
43
|
* not with `.describe()`.
|
|
43
44
|
*/
|
|
44
45
|
function childList(description) {
|
|
45
|
-
return zod.
|
|
46
|
-
componentId: zod.
|
|
47
|
-
path: zod.
|
|
46
|
+
return zod.union([zod.array(zod.string().min(1)), zod.object({
|
|
47
|
+
componentId: zod.string().min(1),
|
|
48
|
+
path: zod.string().min(1)
|
|
48
49
|
})]).describe(mark(_copilotkit_shared.A2UI_CHILD_LIST_MARK, description)).transform(toNode);
|
|
49
50
|
}
|
|
50
51
|
|
|
@@ -970,18 +971,18 @@ function useStandardStyles() {
|
|
|
970
971
|
//#endregion
|
|
971
972
|
//#region src/generative-ui/standard/layout.tsx
|
|
972
973
|
/** A number is a count of 4px steps. A string is raw CSS. */
|
|
973
|
-
const sizeValue = zod.
|
|
974
|
+
const sizeValue = zod.union([zod.number(), zod.string()]);
|
|
974
975
|
/** The A2UI `weight`: how much of the free space of a Row or Column to take. */
|
|
975
|
-
const weightProp = zod.
|
|
976
|
-
const radiusValue = zod.
|
|
977
|
-
zod.
|
|
978
|
-
zod.
|
|
979
|
-
zod.
|
|
980
|
-
zod.
|
|
981
|
-
topLeft: zod.
|
|
982
|
-
topRight: zod.
|
|
983
|
-
bottomLeft: zod.
|
|
984
|
-
bottomRight: zod.
|
|
976
|
+
const weightProp = zod.number().optional().describe("flex-grow in a Row or Column");
|
|
977
|
+
const radiusValue = zod.union([
|
|
978
|
+
zod.enum(RADII),
|
|
979
|
+
zod.number(),
|
|
980
|
+
zod.string(),
|
|
981
|
+
zod.object({
|
|
982
|
+
topLeft: zod.string().optional(),
|
|
983
|
+
topRight: zod.string().optional(),
|
|
984
|
+
bottomLeft: zod.string().optional(),
|
|
985
|
+
bottomRight: zod.string().optional()
|
|
985
986
|
})
|
|
986
987
|
]);
|
|
987
988
|
/**
|
|
@@ -990,16 +991,16 @@ const radiusValue = zod.z.union([
|
|
|
990
991
|
* are a slot, not a prop.
|
|
991
992
|
*/
|
|
992
993
|
const layoutProps = {
|
|
993
|
-
align: zod.
|
|
994
|
-
justify: zod.
|
|
995
|
-
wrap: zod.
|
|
994
|
+
align: zod.enum(ALIGN).optional(),
|
|
995
|
+
justify: zod.enum(JUSTIFY).optional(),
|
|
996
|
+
wrap: zod.enum(WRAP).optional(),
|
|
996
997
|
gap: sizeValue.optional().describe("4px steps when a number"),
|
|
997
998
|
rowGap: sizeValue.optional(),
|
|
998
999
|
columnGap: sizeValue.optional(),
|
|
999
1000
|
padding: sizeValue.optional().describe("4px steps when a number"),
|
|
1000
|
-
background: zod.
|
|
1001
|
-
border: zod.
|
|
1002
|
-
borderColor: zod.
|
|
1001
|
+
background: zod.string().optional().describe(`One of ${BACKGROUNDS.join("|")} or a CSS color. Leave it unset. Only one summary panel in a Card can use "surface-secondary"`),
|
|
1002
|
+
border: zod.boolean().optional(),
|
|
1003
|
+
borderColor: zod.enum(BORDER_COLORS).optional(),
|
|
1003
1004
|
radius: radiusValue.optional(),
|
|
1004
1005
|
width: sizeValue.optional(),
|
|
1005
1006
|
height: sizeValue.optional(),
|
|
@@ -1007,22 +1008,22 @@ const layoutProps = {
|
|
|
1007
1008
|
maxWidth: sizeValue.optional(),
|
|
1008
1009
|
minHeight: sizeValue.optional(),
|
|
1009
1010
|
maxHeight: sizeValue.optional(),
|
|
1010
|
-
flex: zod.
|
|
1011
|
+
flex: zod.number().optional(),
|
|
1011
1012
|
weight: weightProp,
|
|
1012
|
-
aspectRatio: zod.
|
|
1013
|
-
scrollable: zod.
|
|
1014
|
-
clip: zod.
|
|
1015
|
-
shadow: zod.
|
|
1016
|
-
inline: zod.
|
|
1017
|
-
role: zod.
|
|
1018
|
-
flush: zod.
|
|
1013
|
+
aspectRatio: zod.string().optional(),
|
|
1014
|
+
scrollable: zod.boolean().optional(),
|
|
1015
|
+
clip: zod.boolean().optional(),
|
|
1016
|
+
shadow: zod.boolean().optional(),
|
|
1017
|
+
inline: zod.boolean().optional(),
|
|
1018
|
+
role: zod.string().optional().describe("ARIA role"),
|
|
1019
|
+
flush: zod.boolean().optional().describe("No padding"),
|
|
1019
1020
|
minSize: sizeValue.optional().describe("Minimum width and height"),
|
|
1020
1021
|
maxSize: sizeValue.optional().describe("Maximum width and height"),
|
|
1021
|
-
disableAutoSpacing: zod.
|
|
1022
|
+
disableAutoSpacing: zod.boolean().optional().describe("No default gap between children")
|
|
1022
1023
|
};
|
|
1023
|
-
const layoutSchema = zod.
|
|
1024
|
+
const layoutSchema = zod.object(layoutProps);
|
|
1024
1025
|
/** The arguments of a click or visibility event: none. */
|
|
1025
|
-
const NO_ARGS$3 = zod.
|
|
1026
|
+
const NO_ARGS$3 = zod.object({});
|
|
1026
1027
|
/**
|
|
1027
1028
|
* The `onVisible` event of every container: sent once, the first time the
|
|
1028
1029
|
* container scrolls into view.
|
|
@@ -1033,24 +1034,24 @@ const VISIBLE_EVENT = { onVisible: {
|
|
|
1033
1034
|
} };
|
|
1034
1035
|
/** The slot of every container: a list of children or a template. */
|
|
1035
1036
|
const CHILDREN_SLOT = { children: "multiple" };
|
|
1036
|
-
const boxSchema = zod.
|
|
1037
|
+
const boxSchema = zod.object({
|
|
1037
1038
|
...layoutProps,
|
|
1038
|
-
direction: zod.
|
|
1039
|
+
direction: zod.enum(["col", "row"]).optional().describe("Default \"col\"")
|
|
1039
1040
|
});
|
|
1040
|
-
const gridSchema = zod.
|
|
1041
|
+
const gridSchema = zod.object({
|
|
1041
1042
|
...layoutProps,
|
|
1042
|
-
columns: zod.
|
|
1043
|
+
columns: zod.union([zod.number(), zod.string()]).optional().describe("Column count or CSS template. Default 2"),
|
|
1043
1044
|
minChildWidth: sizeValue.optional(),
|
|
1044
|
-
rows: zod.
|
|
1045
|
+
rows: zod.union([zod.number(), zod.string()]).optional()
|
|
1045
1046
|
});
|
|
1046
|
-
const gridItemSchema = zod.
|
|
1047
|
+
const gridItemSchema = zod.object({
|
|
1047
1048
|
...layoutProps,
|
|
1048
|
-
span: zod.
|
|
1049
|
-
rowSpan: zod.
|
|
1049
|
+
span: zod.number().optional(),
|
|
1050
|
+
rowSpan: zod.number().optional()
|
|
1050
1051
|
});
|
|
1051
|
-
const cardSchema = zod.
|
|
1052
|
+
const cardSchema = zod.object({
|
|
1052
1053
|
...layoutProps,
|
|
1053
|
-
variant: zod.
|
|
1054
|
+
variant: zod.enum([
|
|
1054
1055
|
"default",
|
|
1055
1056
|
"outline",
|
|
1056
1057
|
"section",
|
|
@@ -1058,44 +1059,44 @@ const cardSchema = zod.z.object({
|
|
|
1058
1059
|
"elevated",
|
|
1059
1060
|
"transparent"
|
|
1060
1061
|
]).optional(),
|
|
1061
|
-
shadowStyle: zod.
|
|
1062
|
+
shadowStyle: zod.enum([
|
|
1062
1063
|
"none",
|
|
1063
1064
|
"sm",
|
|
1064
1065
|
"md"
|
|
1065
1066
|
]).optional().describe("Overrides the shadow of the variant"),
|
|
1066
|
-
size: zod.
|
|
1067
|
+
size: zod.enum([
|
|
1067
1068
|
"sm",
|
|
1068
1069
|
"md",
|
|
1069
1070
|
"lg"
|
|
1070
1071
|
]).optional().describe("The padding preset: 8, 16 or 24px. Default \"md\"")
|
|
1071
1072
|
});
|
|
1072
|
-
const flowSchema = zod.
|
|
1073
|
+
const flowSchema = zod.object({
|
|
1073
1074
|
...layoutProps,
|
|
1074
|
-
columns: zod.
|
|
1075
|
-
rows: zod.
|
|
1076
|
-
layout: zod.
|
|
1075
|
+
columns: zod.number().optional(),
|
|
1076
|
+
rows: zod.number().optional(),
|
|
1077
|
+
layout: zod.enum(["pack", "fixed"]).optional().describe("Default \"pack\"")
|
|
1077
1078
|
});
|
|
1078
|
-
const flowItemSchema = zod.
|
|
1079
|
+
const flowItemSchema = zod.object({
|
|
1079
1080
|
...layoutProps,
|
|
1080
|
-
span: zod.
|
|
1081
|
-
rowSpan: zod.
|
|
1082
|
-
aspectRatio: zod.
|
|
1083
|
-
aspectMode: zod.
|
|
1081
|
+
span: zod.number().optional(),
|
|
1082
|
+
rowSpan: zod.number().optional(),
|
|
1083
|
+
aspectRatio: zod.string().optional().describe("Default \"1 / 1\""),
|
|
1084
|
+
aspectMode: zod.enum(["soft", "fixed"]).optional()
|
|
1084
1085
|
});
|
|
1085
|
-
const carouselSchema = zod.
|
|
1086
|
+
const carouselSchema = zod.object({
|
|
1086
1087
|
...layoutProps,
|
|
1087
|
-
label: zod.
|
|
1088
|
-
visibleItems: zod.
|
|
1089
|
-
showArrows: zod.
|
|
1090
|
-
activeIndex: zod.
|
|
1091
|
-
previousLabel: zod.
|
|
1092
|
-
nextLabel: zod.
|
|
1093
|
-
snap: zod.
|
|
1088
|
+
label: zod.string().optional().describe("A short name of the carousel for screen readers"),
|
|
1089
|
+
visibleItems: zod.number().optional(),
|
|
1090
|
+
showArrows: zod.boolean().optional().describe("Default true"),
|
|
1091
|
+
activeIndex: zod.number().optional().describe("The index of the slide in view. Bind it with { \"@path\": \"/x\" } to read or set it"),
|
|
1092
|
+
previousLabel: zod.string().optional().describe("Default \"Previous\""),
|
|
1093
|
+
nextLabel: zod.string().optional().describe("Default \"Next\""),
|
|
1094
|
+
snap: zod.enum([
|
|
1094
1095
|
"none",
|
|
1095
1096
|
"proximity",
|
|
1096
1097
|
"mandatory"
|
|
1097
1098
|
]).optional(),
|
|
1098
|
-
snapAlign: zod.
|
|
1099
|
+
snapAlign: zod.enum([
|
|
1099
1100
|
"start",
|
|
1100
1101
|
"center",
|
|
1101
1102
|
"end"
|
|
@@ -1106,31 +1107,31 @@ const CAROUSEL_MEDIA_SIZES = [
|
|
|
1106
1107
|
"md",
|
|
1107
1108
|
"lg"
|
|
1108
1109
|
];
|
|
1109
|
-
const carouselMediaItemSchema = zod.
|
|
1110
|
+
const carouselMediaItemSchema = zod.object({
|
|
1110
1111
|
...layoutProps,
|
|
1111
|
-
url: zod.
|
|
1112
|
-
description: zod.
|
|
1113
|
-
size: zod.
|
|
1114
|
-
aspectRatio: zod.
|
|
1115
|
-
href: zod.
|
|
1116
|
-
lightbox: zod.
|
|
1112
|
+
url: zod.string().describe("Image URL"),
|
|
1113
|
+
description: zod.string().optional().describe("What the image shows, for screen readers"),
|
|
1114
|
+
size: zod.enum(CAROUSEL_MEDIA_SIZES).optional().describe("The width: \"sm\" 160px, \"md\" 240px, \"lg\" 320px. Default \"md\""),
|
|
1115
|
+
aspectRatio: zod.string().optional().describe("Default \"4 / 3\""),
|
|
1116
|
+
href: zod.string().optional().describe("Opens this URL in a new tab"),
|
|
1117
|
+
lightbox: zod.boolean().optional().describe("Default true: a click opens all slides full-screen")
|
|
1117
1118
|
});
|
|
1118
|
-
const spacerSchema = zod.
|
|
1119
|
-
const tabsSchema = zod.
|
|
1120
|
-
tabs: zod.
|
|
1121
|
-
title: zod.
|
|
1119
|
+
const spacerSchema = zod.object({ minSize: sizeValue.optional() });
|
|
1120
|
+
const tabsSchema = zod.object({
|
|
1121
|
+
tabs: zod.array(zod.object({
|
|
1122
|
+
title: zod.string().describe("The tab title"),
|
|
1122
1123
|
child: child("The id of the panel component")
|
|
1123
1124
|
})).describe("One entry per tab"),
|
|
1124
|
-
selectedIndex: zod.
|
|
1125
|
+
selectedIndex: zod.number().optional().describe("The open tab. Default 0. Bind it with { \"@path\": \"/x\" } to read it"),
|
|
1125
1126
|
weight: weightProp
|
|
1126
1127
|
});
|
|
1127
|
-
const dividerSchema = zod.
|
|
1128
|
-
axis: zod.
|
|
1128
|
+
const dividerSchema = zod.object({
|
|
1129
|
+
axis: zod.enum(["horizontal", "vertical"]).optional().describe("Default \"horizontal\""),
|
|
1129
1130
|
weight: weightProp,
|
|
1130
|
-
color: zod.
|
|
1131
|
-
size: zod.
|
|
1131
|
+
color: zod.enum(BORDER_COLORS).optional(),
|
|
1132
|
+
size: zod.number().optional(),
|
|
1132
1133
|
spacing: sizeValue.optional(),
|
|
1133
|
-
flush: zod.
|
|
1134
|
+
flush: zod.boolean().optional()
|
|
1134
1135
|
});
|
|
1135
1136
|
const ALIGN_CSS$1 = {
|
|
1136
1137
|
start: "flex-start",
|
|
@@ -2113,18 +2114,18 @@ function Markdown({ text, streaming = false }) {
|
|
|
2113
2114
|
|
|
2114
2115
|
//#endregion
|
|
2115
2116
|
//#region src/generative-ui/standard/media.tsx
|
|
2116
|
-
const NO_ARGS$2 = zod.
|
|
2117
|
-
const colorProp$1 = zod.
|
|
2117
|
+
const NO_ARGS$2 = zod.object({});
|
|
2118
|
+
const colorProp$1 = zod.string().optional();
|
|
2118
2119
|
const ICON_SIZES = [
|
|
2119
2120
|
"sm",
|
|
2120
2121
|
"md",
|
|
2121
2122
|
"lg",
|
|
2122
2123
|
"xl"
|
|
2123
2124
|
];
|
|
2124
|
-
const imageSchema = zod.
|
|
2125
|
-
url: zod.
|
|
2126
|
-
description: zod.
|
|
2127
|
-
variant: zod.
|
|
2125
|
+
const imageSchema = zod.object({
|
|
2126
|
+
url: zod.string().describe("Image URL"),
|
|
2127
|
+
description: zod.string().optional().describe("What the image shows, for screen readers. Leave it unset only for a decorative image"),
|
|
2128
|
+
variant: zod.enum([
|
|
2128
2129
|
"icon",
|
|
2129
2130
|
"avatar",
|
|
2130
2131
|
"smallFeature",
|
|
@@ -2133,8 +2134,8 @@ const imageSchema = zod.z.object({
|
|
|
2133
2134
|
"header"
|
|
2134
2135
|
]).optional().describe("The size: \"icon\" 24px, \"avatar\" 40px round, \"smallFeature\" 160px wide, \"largeFeature\" and \"header\" full width. Default \"mediumFeature\": the natural size"),
|
|
2135
2136
|
weight: weightProp,
|
|
2136
|
-
aspectRatio: zod.
|
|
2137
|
-
fit: zod.
|
|
2137
|
+
aspectRatio: zod.string().optional(),
|
|
2138
|
+
fit: zod.enum([
|
|
2138
2139
|
"cover",
|
|
2139
2140
|
"contain",
|
|
2140
2141
|
"fill",
|
|
@@ -2148,128 +2149,128 @@ const imageSchema = zod.z.object({
|
|
|
2148
2149
|
maxHeight: sizeValue.optional(),
|
|
2149
2150
|
minWidth: sizeValue.optional(),
|
|
2150
2151
|
minHeight: sizeValue.optional(),
|
|
2151
|
-
background: zod.
|
|
2152
|
-
frame: zod.
|
|
2153
|
-
position: zod.
|
|
2154
|
-
hideOnFailure: zod.
|
|
2155
|
-
fallback: zod.
|
|
2156
|
-
hoverZoom: zod.
|
|
2157
|
-
lightbox: zod.
|
|
2158
|
-
actionOverlay: zod.
|
|
2159
|
-
label: zod.
|
|
2160
|
-
icon: zod.
|
|
2161
|
-
href: zod.
|
|
2152
|
+
background: zod.string().optional(),
|
|
2153
|
+
frame: zod.boolean().optional(),
|
|
2154
|
+
position: zod.string().optional().describe("CSS object-position, for example \"top\" or \"50% 20%\""),
|
|
2155
|
+
hideOnFailure: zod.boolean().optional().describe("Default false"),
|
|
2156
|
+
fallback: zod.string().optional().describe("Text shown in place of the image when it does not load"),
|
|
2157
|
+
hoverZoom: zod.boolean().optional().describe("A slight zoom on hover"),
|
|
2158
|
+
lightbox: zod.boolean().optional().describe("Default true: a click opens the image full-screen"),
|
|
2159
|
+
actionOverlay: zod.object({
|
|
2160
|
+
label: zod.string(),
|
|
2161
|
+
icon: zod.string().optional().describe("Lucide icon name"),
|
|
2162
|
+
href: zod.string().optional().describe("Opens this URL in a new tab")
|
|
2162
2163
|
}).optional().describe("A button over the bottom-right corner of the image. Without href, it sends onOverlayClick")
|
|
2163
2164
|
});
|
|
2164
|
-
const iconSchema = zod.
|
|
2165
|
-
name: zod.
|
|
2166
|
-
label: zod.
|
|
2167
|
-
size: zod.
|
|
2165
|
+
const iconSchema = zod.object({
|
|
2166
|
+
name: zod.union([zod.string(), zod.object({ svgPath: zod.string() })]).describe("A Lucide icon name in kebab-case (\"arrow-right\"), an A2UI icon name (\"arrowBack\"), or { \"svgPath\" } on a 24px grid"),
|
|
2167
|
+
label: zod.string().optional().describe("What the icon means, for screen readers. Leave it unset when text next to the icon says the same"),
|
|
2168
|
+
size: zod.union([zod.enum(ICON_SIZES), zod.number()]).optional().describe("Default \"md\""),
|
|
2168
2169
|
color: colorProp$1,
|
|
2169
|
-
inline: zod.
|
|
2170
|
-
strokeWeight: zod.
|
|
2170
|
+
inline: zod.boolean().optional().describe("Default false"),
|
|
2171
|
+
strokeWeight: zod.enum(WEIGHTS).optional().describe("The stroke width"),
|
|
2171
2172
|
weight: weightProp
|
|
2172
2173
|
});
|
|
2173
|
-
const faviconSchema = zod.
|
|
2174
|
-
url: zod.
|
|
2175
|
-
alt: zod.
|
|
2176
|
-
size: zod.
|
|
2177
|
-
inline: zod.
|
|
2178
|
-
frame: zod.
|
|
2174
|
+
const faviconSchema = zod.object({
|
|
2175
|
+
url: zod.string(),
|
|
2176
|
+
alt: zod.string().optional(),
|
|
2177
|
+
size: zod.number().optional().describe("Pixels. Default 16"),
|
|
2178
|
+
inline: zod.boolean().optional().describe("Default false"),
|
|
2179
|
+
frame: zod.boolean().optional().describe("Default false")
|
|
2179
2180
|
});
|
|
2180
|
-
const svgSchema = zod.
|
|
2181
|
-
viewBox: zod.
|
|
2182
|
-
label: zod.
|
|
2181
|
+
const svgSchema = zod.object({
|
|
2182
|
+
viewBox: zod.string().optional(),
|
|
2183
|
+
label: zod.string().optional().describe("What the drawing shows, for screen readers. Leave it unset for a decorative drawing"),
|
|
2183
2184
|
width: sizeValue.optional(),
|
|
2184
2185
|
height: sizeValue.optional(),
|
|
2185
2186
|
size: sizeValue.optional(),
|
|
2186
2187
|
color: colorProp$1.describe("Default \"prose\""),
|
|
2187
2188
|
fill: colorProp$1.describe("Default \"currentColor\""),
|
|
2188
2189
|
stroke: colorProp$1,
|
|
2189
|
-
strokeWidth: zod.
|
|
2190
|
-
strokeLinecap: zod.
|
|
2190
|
+
strokeWidth: zod.number().optional(),
|
|
2191
|
+
strokeLinecap: zod.enum([
|
|
2191
2192
|
"butt",
|
|
2192
2193
|
"round",
|
|
2193
2194
|
"square"
|
|
2194
2195
|
]).optional(),
|
|
2195
|
-
strokeLinejoin: zod.
|
|
2196
|
+
strokeLinejoin: zod.enum([
|
|
2196
2197
|
"miter",
|
|
2197
2198
|
"round",
|
|
2198
2199
|
"bevel"
|
|
2199
2200
|
]).optional(),
|
|
2200
|
-
preserveAspectRatio: zod.
|
|
2201
|
-
paths: zod.
|
|
2202
|
-
d: zod.
|
|
2201
|
+
preserveAspectRatio: zod.string().optional(),
|
|
2202
|
+
paths: zod.array(zod.object({
|
|
2203
|
+
d: zod.string(),
|
|
2203
2204
|
fill: colorProp$1,
|
|
2204
2205
|
stroke: colorProp$1,
|
|
2205
|
-
strokeWidth: zod.
|
|
2206
|
+
strokeWidth: zod.number().optional()
|
|
2206
2207
|
})).optional(),
|
|
2207
|
-
circles: zod.
|
|
2208
|
-
cx: zod.
|
|
2209
|
-
cy: zod.
|
|
2210
|
-
r: zod.
|
|
2208
|
+
circles: zod.array(zod.object({
|
|
2209
|
+
cx: zod.number(),
|
|
2210
|
+
cy: zod.number(),
|
|
2211
|
+
r: zod.number(),
|
|
2211
2212
|
fill: colorProp$1,
|
|
2212
2213
|
stroke: colorProp$1
|
|
2213
2214
|
})).optional(),
|
|
2214
|
-
rects: zod.
|
|
2215
|
-
x: zod.
|
|
2216
|
-
y: zod.
|
|
2217
|
-
width: zod.
|
|
2218
|
-
height: zod.
|
|
2219
|
-
rx: zod.
|
|
2215
|
+
rects: zod.array(zod.object({
|
|
2216
|
+
x: zod.number(),
|
|
2217
|
+
y: zod.number(),
|
|
2218
|
+
width: zod.number(),
|
|
2219
|
+
height: zod.number(),
|
|
2220
|
+
rx: zod.number().optional(),
|
|
2220
2221
|
fill: colorProp$1,
|
|
2221
2222
|
stroke: colorProp$1
|
|
2222
2223
|
})).optional(),
|
|
2223
|
-
lines: zod.
|
|
2224
|
-
x1: zod.
|
|
2225
|
-
y1: zod.
|
|
2226
|
-
x2: zod.
|
|
2227
|
-
y2: zod.
|
|
2224
|
+
lines: zod.array(zod.object({
|
|
2225
|
+
x1: zod.number(),
|
|
2226
|
+
y1: zod.number(),
|
|
2227
|
+
x2: zod.number(),
|
|
2228
|
+
y2: zod.number(),
|
|
2228
2229
|
stroke: colorProp$1
|
|
2229
2230
|
})).optional(),
|
|
2230
|
-
texts: zod.
|
|
2231
|
-
x: zod.
|
|
2232
|
-
y: zod.
|
|
2233
|
-
text: zod.
|
|
2234
|
-
size: zod.
|
|
2231
|
+
texts: zod.array(zod.object({
|
|
2232
|
+
x: zod.number(),
|
|
2233
|
+
y: zod.number(),
|
|
2234
|
+
text: zod.string(),
|
|
2235
|
+
size: zod.number().optional(),
|
|
2235
2236
|
fill: colorProp$1,
|
|
2236
|
-
anchor: zod.
|
|
2237
|
+
anchor: zod.enum([
|
|
2237
2238
|
"start",
|
|
2238
2239
|
"middle",
|
|
2239
2240
|
"end"
|
|
2240
2241
|
]).optional()
|
|
2241
2242
|
})).optional()
|
|
2242
2243
|
});
|
|
2243
|
-
const captionTrack = zod.
|
|
2244
|
-
url: zod.
|
|
2245
|
-
language: zod.
|
|
2246
|
-
label: zod.
|
|
2247
|
-
kind: zod.
|
|
2244
|
+
const captionTrack = zod.object({
|
|
2245
|
+
url: zod.string().describe("The URL of a WebVTT file"),
|
|
2246
|
+
language: zod.string().optional().describe("BCP 47, for example \"en\""),
|
|
2247
|
+
label: zod.string().optional().describe("Shown in the captions menu"),
|
|
2248
|
+
kind: zod.enum([
|
|
2248
2249
|
"subtitles",
|
|
2249
2250
|
"captions",
|
|
2250
2251
|
"descriptions"
|
|
2251
2252
|
]).optional()
|
|
2252
2253
|
});
|
|
2253
|
-
const videoSchema = zod.
|
|
2254
|
-
url: zod.
|
|
2255
|
-
posterUrl: zod.
|
|
2256
|
-
title: zod.
|
|
2257
|
-
captions: zod.
|
|
2258
|
-
aspectRatio: zod.
|
|
2254
|
+
const videoSchema = zod.object({
|
|
2255
|
+
url: zod.string().describe("The URL of a video file, or of a YouTube video or short. A page on another video site shows as a link"),
|
|
2256
|
+
posterUrl: zod.string().optional().describe("The image shown before the video plays"),
|
|
2257
|
+
title: zod.string().optional().describe("Names the video for screen readers"),
|
|
2258
|
+
captions: zod.array(captionTrack).optional().describe("Caption tracks of a video file"),
|
|
2259
|
+
aspectRatio: zod.string().optional().describe("Default \"16 / 9\""),
|
|
2259
2260
|
width: sizeValue.optional().describe("Default \"100%\""),
|
|
2260
2261
|
maxWidth: sizeValue.optional().describe("Default \"100%\""),
|
|
2261
2262
|
weight: weightProp
|
|
2262
2263
|
});
|
|
2263
|
-
const audioPlayerSchema = zod.
|
|
2264
|
-
url: zod.
|
|
2265
|
-
description: zod.
|
|
2264
|
+
const audioPlayerSchema = zod.object({
|
|
2265
|
+
url: zod.string().describe("The URL of the audio file"),
|
|
2266
|
+
description: zod.string().optional().describe("A title or summary of the audio, shown above the player"),
|
|
2266
2267
|
weight: weightProp
|
|
2267
2268
|
});
|
|
2268
|
-
const htmlViewSchema = zod.
|
|
2269
|
-
html: zod.
|
|
2269
|
+
const htmlViewSchema = zod.object({
|
|
2270
|
+
html: zod.string(),
|
|
2270
2271
|
height: sizeValue.optional().describe("Pixels when a number. Default 360"),
|
|
2271
2272
|
width: sizeValue.optional().describe("Default \"100%\""),
|
|
2272
|
-
title: zod.
|
|
2273
|
+
title: zod.string().optional()
|
|
2273
2274
|
});
|
|
2274
2275
|
/** Pixels when a number, raw CSS when a string. */
|
|
2275
2276
|
function px$1(value) {
|
|
@@ -2292,10 +2293,14 @@ const ICON_STROKE = {
|
|
|
2292
2293
|
function kebabToPascal(name) {
|
|
2293
2294
|
return name.split(/[-_\s]+/).filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
|
|
2294
2295
|
}
|
|
2296
|
+
/** "ArrowRight" gives "arrow-right", as Lucide names its icon classes. */
|
|
2297
|
+
function pascalToKebab(name) {
|
|
2298
|
+
return name.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
2299
|
+
}
|
|
2295
2300
|
let lucidePromise = null;
|
|
2296
2301
|
let lucideIcons = null;
|
|
2297
2302
|
function loadLucideIcons() {
|
|
2298
|
-
lucidePromise ??= import("lucide
|
|
2303
|
+
lucidePromise ??= import("lucide").then((module) => {
|
|
2299
2304
|
const icons = module.icons;
|
|
2300
2305
|
lucideIcons = icons;
|
|
2301
2306
|
return icons;
|
|
@@ -2303,9 +2308,9 @@ function loadLucideIcons() {
|
|
|
2303
2308
|
return lucidePromise;
|
|
2304
2309
|
}
|
|
2305
2310
|
/**
|
|
2306
|
-
*
|
|
2307
|
-
*
|
|
2308
|
-
*
|
|
2311
|
+
* Lucide has about 1,500 icons. A static import of its `icons` map puts all
|
|
2312
|
+
* of them in every bundle and makes module load slow. So the map loads once,
|
|
2313
|
+
* on first use, and the icons show when it is there.
|
|
2309
2314
|
*/
|
|
2310
2315
|
function useLucideIcons() {
|
|
2311
2316
|
const [icons, setIcons] = (0, react.useState)(lucideIcons);
|
|
@@ -2321,6 +2326,20 @@ function useLucideIcons() {
|
|
|
2321
2326
|
}, []);
|
|
2322
2327
|
return icons;
|
|
2323
2328
|
}
|
|
2329
|
+
/** The icon for a kebab-case or PascalCase name, or `null` when there is none. */
|
|
2330
|
+
function findLucideIcon(icons, name) {
|
|
2331
|
+
const pascalName = kebabToPascal(name);
|
|
2332
|
+
const key = pascalName in icons ? pascalName : name in icons ? name : null;
|
|
2333
|
+
if (key === null) return null;
|
|
2334
|
+
const nodes = icons[key].map(([tag, attributes]) => ({
|
|
2335
|
+
tag,
|
|
2336
|
+
attributes
|
|
2337
|
+
}));
|
|
2338
|
+
return {
|
|
2339
|
+
lucideName: pascalToKebab(key),
|
|
2340
|
+
nodes
|
|
2341
|
+
};
|
|
2342
|
+
}
|
|
2324
2343
|
/**
|
|
2325
2344
|
* A lucide icon by kebab-case (or PascalCase) name. An unknown name renders
|
|
2326
2345
|
* nothing. Without a `label`, the icon is hidden from screen readers.
|
|
@@ -2333,18 +2352,20 @@ function useLucideIcons() {
|
|
|
2333
2352
|
function LucideIcon({ name, label, description, size = "md", color, weight, inline, style }) {
|
|
2334
2353
|
const icons = useLucideIcons();
|
|
2335
2354
|
if (!name || !icons) return null;
|
|
2336
|
-
const
|
|
2337
|
-
if (!
|
|
2355
|
+
const icon = findLucideIcon(icons, name);
|
|
2356
|
+
if (!icon) return null;
|
|
2338
2357
|
const pixels = typeof size === "number" ? size : inline ? "1em" : ICON_PX$1[size];
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2358
|
+
const a11y = label === void 0 ? { "aria-hidden": true } : {
|
|
2359
|
+
role: "img",
|
|
2360
|
+
"aria-label": label,
|
|
2361
|
+
"aria-description": description
|
|
2362
|
+
};
|
|
2363
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_MarkdownSurfaces.IconSvg, {
|
|
2364
|
+
lucideName: icon.lucideName,
|
|
2365
|
+
nodes: icon.nodes,
|
|
2366
|
+
...a11y,
|
|
2345
2367
|
focusable: "false",
|
|
2346
|
-
|
|
2347
|
-
height: pixels,
|
|
2368
|
+
size: pixels,
|
|
2348
2369
|
color: textColor(color) ?? "currentColor",
|
|
2349
2370
|
strokeWidth: weight ? ICON_STROKE[weight] : void 0,
|
|
2350
2371
|
style: {
|
|
@@ -3023,33 +3044,33 @@ const mediaComponents = {
|
|
|
3023
3044
|
* grids). Each one is a single component, so the model places it with one
|
|
3024
3045
|
* object instead of eight primitives.
|
|
3025
3046
|
*/
|
|
3026
|
-
const NO_ARGS$1 = zod.
|
|
3027
|
-
const text = (description) => zod.
|
|
3028
|
-
const linkCardSchema = zod.
|
|
3029
|
-
href: zod.
|
|
3030
|
-
title: zod.
|
|
3047
|
+
const NO_ARGS$1 = zod.object({});
|
|
3048
|
+
const text = (description) => zod.string().optional().describe(description);
|
|
3049
|
+
const linkCardSchema = zod.object({
|
|
3050
|
+
href: zod.string().describe("The URL (http, https)"),
|
|
3051
|
+
title: zod.string().describe("The page title"),
|
|
3031
3052
|
description: text("One or two lines"),
|
|
3032
3053
|
image: text("A thumbnail URL"),
|
|
3033
3054
|
domain: text("Shown next to the favicon. Default: the host of href"),
|
|
3034
|
-
favicon: zod.
|
|
3055
|
+
favicon: zod.boolean().optional().describe("Default true")
|
|
3035
3056
|
});
|
|
3036
|
-
const citationSchema = zod.
|
|
3037
|
-
index: zod.
|
|
3057
|
+
const citationSchema = zod.object({
|
|
3058
|
+
index: zod.number().optional().describe("The marker number. Default 1"),
|
|
3038
3059
|
label: text("Marker text instead of the number, for example a domain"),
|
|
3039
3060
|
title: text("The source title"),
|
|
3040
3061
|
url: text("The source URL (http, https)"),
|
|
3041
3062
|
snippet: text("The quoted passage, one or two lines"),
|
|
3042
3063
|
source: text("The publisher or domain. Default: the host of url")
|
|
3043
3064
|
});
|
|
3044
|
-
const followUpItem = zod.
|
|
3045
|
-
label: zod.
|
|
3065
|
+
const followUpItem = zod.union([zod.string(), zod.object({
|
|
3066
|
+
label: zod.string(),
|
|
3046
3067
|
message: text("The text sent when the user clicks. Default: label")
|
|
3047
3068
|
})]);
|
|
3048
|
-
const followUpSchema = zod.
|
|
3049
|
-
items: zod.
|
|
3069
|
+
const followUpSchema = zod.object({
|
|
3070
|
+
items: zod.array(followUpItem).optional().describe("Strings or { \"label\", \"message\"? }, or { \"@path\": \"/x\" }"),
|
|
3050
3071
|
title: text("A caption above the pills")
|
|
3051
3072
|
});
|
|
3052
|
-
const followUpArgs = zod.
|
|
3073
|
+
const followUpArgs = zod.object({ message: zod.string().describe("The message of the clicked pill") });
|
|
3053
3074
|
const BADGE_COLORS = [
|
|
3054
3075
|
"secondary",
|
|
3055
3076
|
"success",
|
|
@@ -3058,47 +3079,47 @@ const BADGE_COLORS = [
|
|
|
3058
3079
|
"info",
|
|
3059
3080
|
"discovery"
|
|
3060
3081
|
];
|
|
3061
|
-
const cardAction = zod.
|
|
3062
|
-
label: zod.
|
|
3082
|
+
const cardAction = zod.object({
|
|
3083
|
+
label: zod.string(),
|
|
3063
3084
|
href: text("Opens this URL in a new tab"),
|
|
3064
|
-
variant: zod.
|
|
3085
|
+
variant: zod.enum([
|
|
3065
3086
|
"solid",
|
|
3066
3087
|
"soft",
|
|
3067
3088
|
"outline",
|
|
3068
3089
|
"ghost"
|
|
3069
3090
|
]).optional()
|
|
3070
3091
|
});
|
|
3071
|
-
const entityCardSchema = zod.
|
|
3072
|
-
title: zod.
|
|
3092
|
+
const entityCardSchema = zod.object({
|
|
3093
|
+
title: zod.string().describe("The name"),
|
|
3073
3094
|
subtitle: text("A second line, for example the brand or category"),
|
|
3074
3095
|
description: text("Up to three lines"),
|
|
3075
3096
|
image: text("An image URL"),
|
|
3076
|
-
imageAspectRatio: zod.
|
|
3097
|
+
imageAspectRatio: zod.string().optional().describe("Default \"4 / 3\""),
|
|
3077
3098
|
meta: text("A short fact line, for example \"$29 / month\" or \"Open until 22:00\""),
|
|
3078
|
-
badge: zod.
|
|
3079
|
-
label: zod.
|
|
3080
|
-
color: zod.
|
|
3099
|
+
badge: zod.object({
|
|
3100
|
+
label: zod.string(),
|
|
3101
|
+
color: zod.enum(BADGE_COLORS).optional()
|
|
3081
3102
|
}).optional(),
|
|
3082
|
-
rating: zod.
|
|
3083
|
-
ratingCount: zod.
|
|
3103
|
+
rating: zod.number().optional().describe("0 to 5, shown as stars"),
|
|
3104
|
+
ratingCount: zod.number().optional().describe("The number of ratings"),
|
|
3084
3105
|
href: text("Opens this URL in a new tab when the user clicks the card"),
|
|
3085
|
-
actions: zod.
|
|
3086
|
-
layout: zod.
|
|
3106
|
+
actions: zod.array(cardAction).max(3).optional().describe("Up to three buttons. A button without href sends onAction with its label"),
|
|
3107
|
+
layout: zod.enum(["vertical", "horizontal"]).optional().describe("Default \"vertical\". \"horizontal\" puts the image on the left"),
|
|
3087
3108
|
width: sizeValue.optional()
|
|
3088
3109
|
});
|
|
3089
|
-
const entityActionArgs = zod.
|
|
3090
|
-
const gridImage = zod.
|
|
3091
|
-
url: zod.
|
|
3092
|
-
description: zod.
|
|
3093
|
-
caption: zod.
|
|
3110
|
+
const entityActionArgs = zod.object({ label: zod.string().describe("The label of the clicked button") });
|
|
3111
|
+
const gridImage = zod.object({
|
|
3112
|
+
url: zod.string(),
|
|
3113
|
+
description: zod.string().optional().describe("What the image shows"),
|
|
3114
|
+
caption: zod.string().optional(),
|
|
3094
3115
|
href: text("Opens this URL instead of the full-screen view")
|
|
3095
3116
|
});
|
|
3096
|
-
const imageGridSchema = zod.
|
|
3097
|
-
images: zod.
|
|
3098
|
-
columns: zod.
|
|
3099
|
-
aspectRatio: zod.
|
|
3117
|
+
const imageGridSchema = zod.object({
|
|
3118
|
+
images: zod.array(gridImage).optional().describe("A list of { \"url\", \"description\"?, \"caption\"?, \"href\"? }, or { \"@path\": \"/x\" }"),
|
|
3119
|
+
columns: zod.number().optional().describe("Default 3"),
|
|
3120
|
+
aspectRatio: zod.string().optional().describe("Default \"1 / 1\""),
|
|
3100
3121
|
gap: sizeValue.optional().describe("Default 2"),
|
|
3101
|
-
layout: zod.
|
|
3122
|
+
layout: zod.enum(["grid", "bento"]).optional().describe("Default \"grid\". \"bento\" makes the first image twice as large")
|
|
3102
3123
|
});
|
|
3103
3124
|
function FaviconImage({ host, size = 16 }) {
|
|
3104
3125
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
|
|
@@ -3719,13 +3740,13 @@ const compositeComponents = {
|
|
|
3719
3740
|
|
|
3720
3741
|
//#endregion
|
|
3721
3742
|
//#region src/generative-ui/standard/Chart.tsx
|
|
3722
|
-
const chartSeries = zod.
|
|
3723
|
-
key: zod.
|
|
3724
|
-
label: zod.
|
|
3725
|
-
color: zod.
|
|
3743
|
+
const chartSeries = zod.union([zod.string(), zod.object({
|
|
3744
|
+
key: zod.string(),
|
|
3745
|
+
label: zod.string().optional(),
|
|
3746
|
+
color: zod.string().optional().describe("A text color token or a CSS color")
|
|
3726
3747
|
})]);
|
|
3727
|
-
const chartSchema = zod.
|
|
3728
|
-
chartType: zod.
|
|
3748
|
+
const chartSchema = zod.object({
|
|
3749
|
+
chartType: zod.enum([
|
|
3729
3750
|
"bar",
|
|
3730
3751
|
"line",
|
|
3731
3752
|
"area",
|
|
@@ -3733,38 +3754,38 @@ const chartSchema = zod.z.object({
|
|
|
3733
3754
|
"pie",
|
|
3734
3755
|
"donut"
|
|
3735
3756
|
]).optional().describe("Default \"bar\""),
|
|
3736
|
-
data: zod.
|
|
3737
|
-
xKey: zod.
|
|
3738
|
-
series: zod.
|
|
3739
|
-
stacked: zod.
|
|
3740
|
-
layout: zod.
|
|
3741
|
-
yAxis: zod.
|
|
3742
|
-
label: zod.
|
|
3743
|
-
min: zod.
|
|
3744
|
-
max: zod.
|
|
3745
|
-
width: zod.
|
|
3757
|
+
data: zod.array(zod.record(zod.string(), zod.unknown())).optional().describe("A list of objects, or { \"@path\": \"/x\" }"),
|
|
3758
|
+
xKey: zod.string().optional().describe("The field of the category axis"),
|
|
3759
|
+
series: zod.array(chartSeries).optional().describe("The value fields: strings or { \"key\", \"label\"?, \"color\"? }. Default: every number field except xKey"),
|
|
3760
|
+
stacked: zod.boolean().optional(),
|
|
3761
|
+
layout: zod.enum(["vertical", "horizontal"]).optional().describe("\"horizontal\" draws the bars from left to right. Default \"vertical\""),
|
|
3762
|
+
yAxis: zod.object({
|
|
3763
|
+
label: zod.string().optional(),
|
|
3764
|
+
min: zod.number().optional(),
|
|
3765
|
+
max: zod.number().optional(),
|
|
3766
|
+
width: zod.number().optional().describe("Pixels")
|
|
3746
3767
|
}).optional().describe("The value axis configuration object: {label?: string, min?: number, max?: number, width?: number}. Example: {label: \"Revenue (USD)\", min: 0, max: 100}. In horizontal charts, label, min and max apply to the horizontal value axis, and width sets the width of the category axis on the left."),
|
|
3747
|
-
showDots: zod.
|
|
3748
|
-
barRadius: zod.
|
|
3749
|
-
innerRadius: zod.
|
|
3750
|
-
outerRadius: zod.
|
|
3751
|
-
startAngle: zod.
|
|
3752
|
-
endAngle: zod.
|
|
3753
|
-
cornerRadius: zod.
|
|
3754
|
-
paddingAngle: zod.
|
|
3755
|
-
showLabelLines: zod.
|
|
3756
|
-
height: zod.
|
|
3757
|
-
showLegend: zod.
|
|
3758
|
-
showGrid: zod.
|
|
3759
|
-
showTooltip: zod.
|
|
3760
|
-
showValueLabels: zod.
|
|
3761
|
-
format: zod.
|
|
3768
|
+
showDots: zod.boolean().optional().describe("Point markers on a line or area"),
|
|
3769
|
+
barRadius: zod.number().optional().describe("The corner radius of a bar, in pixels"),
|
|
3770
|
+
innerRadius: zod.union([zod.number(), zod.string()]).optional().describe("Pie and donut"),
|
|
3771
|
+
outerRadius: zod.union([zod.number(), zod.string()]).optional().describe("Pie and donut"),
|
|
3772
|
+
startAngle: zod.number().optional().describe("Pie and donut. Default 90"),
|
|
3773
|
+
endAngle: zod.number().optional().describe("Pie and donut. Default -270"),
|
|
3774
|
+
cornerRadius: zod.number().optional().describe("The corners of a slice"),
|
|
3775
|
+
paddingAngle: zod.number().optional().describe("The gap between slices"),
|
|
3776
|
+
showLabelLines: zod.boolean().optional().describe("Leader lines of the slice labels. Default true"),
|
|
3777
|
+
height: zod.number().optional().describe("Pixels. Default 240"),
|
|
3778
|
+
showLegend: zod.boolean().optional().describe("Default true"),
|
|
3779
|
+
showGrid: zod.boolean().optional().describe("Default true"),
|
|
3780
|
+
showTooltip: zod.boolean().optional().describe("Default true"),
|
|
3781
|
+
showValueLabels: zod.boolean().optional(),
|
|
3782
|
+
format: zod.enum([
|
|
3762
3783
|
"number",
|
|
3763
3784
|
"currency",
|
|
3764
3785
|
"percent"
|
|
3765
3786
|
]).optional().describe("Number formatting. With \"percent\", data values and axis min/max are fractions: 0.4 displays as 40%. For 0% to 10%, use min: 0 and max: 0.1."),
|
|
3766
|
-
currency: zod.
|
|
3767
|
-
title: zod.
|
|
3787
|
+
currency: zod.string().optional().describe("ISO code. Default \"USD\""),
|
|
3788
|
+
title: zod.string().optional()
|
|
3768
3789
|
});
|
|
3769
3790
|
const DEFAULT_HEIGHT = 240;
|
|
3770
3791
|
/** Hides an element on screen. Screen readers still read it. */
|
|
@@ -4168,22 +4189,22 @@ function Chart(props) {
|
|
|
4168
4189
|
|
|
4169
4190
|
//#endregion
|
|
4170
4191
|
//#region src/generative-ui/standard/Map.tsx
|
|
4171
|
-
const mapMarker = zod.
|
|
4172
|
-
label: zod.
|
|
4173
|
-
lat: zod.
|
|
4174
|
-
lng: zod.
|
|
4175
|
-
category: zod.
|
|
4176
|
-
icon: zod.
|
|
4192
|
+
const mapMarker = zod.object({
|
|
4193
|
+
label: zod.string(),
|
|
4194
|
+
lat: zod.number(),
|
|
4195
|
+
lng: zod.number(),
|
|
4196
|
+
category: zod.string().optional(),
|
|
4197
|
+
icon: zod.string().optional()
|
|
4177
4198
|
});
|
|
4178
|
-
const mapSchema = zod.
|
|
4179
|
-
markers: zod.
|
|
4180
|
-
route: zod.
|
|
4181
|
-
selected: zod.
|
|
4182
|
-
height: zod.
|
|
4183
|
-
zoom: zod.
|
|
4184
|
-
center: zod.
|
|
4185
|
-
lat: zod.
|
|
4186
|
-
lng: zod.
|
|
4199
|
+
const mapSchema = zod.object({
|
|
4200
|
+
markers: zod.array(mapMarker).optional().describe("A list of places, or { \"@path\": \"/x\" }"),
|
|
4201
|
+
route: zod.boolean().optional().describe("Draws a line through the markers in order"),
|
|
4202
|
+
selected: zod.string().optional().describe("The label of the selected marker. Bind it with { \"@path\": \"/x\" } to read the choice of the user"),
|
|
4203
|
+
height: zod.number().optional().describe("Pixels. Default 240"),
|
|
4204
|
+
zoom: zod.number().optional().describe("With two or more markers, only the highest zoom of the fit"),
|
|
4205
|
+
center: zod.object({
|
|
4206
|
+
lat: zod.number(),
|
|
4207
|
+
lng: zod.number()
|
|
4187
4208
|
}).optional()
|
|
4188
4209
|
});
|
|
4189
4210
|
/**
|
|
@@ -4482,7 +4503,7 @@ function MapView(props) {
|
|
|
4482
4503
|
|
|
4483
4504
|
//#endregion
|
|
4484
4505
|
//#region src/generative-ui/standard/data.tsx
|
|
4485
|
-
const cellAlign = zod.
|
|
4506
|
+
const cellAlign = zod.enum([
|
|
4486
4507
|
"start",
|
|
4487
4508
|
"center",
|
|
4488
4509
|
"end"
|
|
@@ -4491,85 +4512,85 @@ const cellAlign = zod.z.enum([
|
|
|
4491
4512
|
* A table cell or column header that shows another component. `id` is an
|
|
4492
4513
|
* alias of `componentId`.
|
|
4493
4514
|
*/
|
|
4494
|
-
const tableComponentCell = zod.
|
|
4495
|
-
const tableColumn = zod.
|
|
4496
|
-
zod.
|
|
4497
|
-
zod.
|
|
4498
|
-
label: zod.
|
|
4515
|
+
const tableComponentCell = zod.union([zod.object({ componentId: zod.string() }), zod.object({ id: zod.string() })]);
|
|
4516
|
+
const tableColumn = zod.union([
|
|
4517
|
+
zod.string(),
|
|
4518
|
+
zod.object({
|
|
4519
|
+
label: zod.string(),
|
|
4499
4520
|
align: cellAlign,
|
|
4500
4521
|
width: sizeValue.optional(),
|
|
4501
|
-
componentId: zod.
|
|
4522
|
+
componentId: zod.string().optional()
|
|
4502
4523
|
}),
|
|
4503
4524
|
tableComponentCell
|
|
4504
4525
|
]);
|
|
4505
|
-
const tableSchema = zod.
|
|
4506
|
-
caption: zod.
|
|
4507
|
-
columns: zod.
|
|
4508
|
-
rows: zod.
|
|
4509
|
-
columnSizing: zod.
|
|
4510
|
-
dividers: zod.
|
|
4511
|
-
stickyHeader: zod.
|
|
4512
|
-
emptyLabel: zod.
|
|
4526
|
+
const tableSchema = zod.object({
|
|
4527
|
+
caption: zod.string().optional().describe("A short name of the table for screen readers. It is not shown"),
|
|
4528
|
+
columns: zod.array(tableColumn).optional().describe("Strings, { \"label\", \"align\"?, \"width\"?, \"componentId\"? } or { \"componentId\" }, or { \"@path\": \"/x\" }. Default []"),
|
|
4529
|
+
rows: zod.array(zod.array(zod.unknown())).optional().describe("A list of row lists, or { \"@path\": \"/x\" }. A cell is a string, a number, or { \"componentId\": \"<id>\" } to show a component. Default []"),
|
|
4530
|
+
columnSizing: zod.enum(["auto", "equal"]).optional().describe("Default \"auto\""),
|
|
4531
|
+
dividers: zod.boolean().optional().describe("Default true"),
|
|
4532
|
+
stickyHeader: zod.boolean().optional().describe("Default false"),
|
|
4533
|
+
emptyLabel: zod.string().optional().describe("Default \"No rows\"")
|
|
4513
4534
|
});
|
|
4514
|
-
const tableSectionSchema = zod.
|
|
4515
|
-
header: zod.
|
|
4516
|
-
rowDivider: zod.
|
|
4535
|
+
const tableSectionSchema = zod.object({
|
|
4536
|
+
header: zod.boolean().optional().describe("Renders the rows as the header"),
|
|
4537
|
+
rowDivider: zod.boolean().optional()
|
|
4517
4538
|
});
|
|
4518
|
-
const tableRowSchema = zod.
|
|
4519
|
-
header: zod.
|
|
4520
|
-
label: zod.
|
|
4521
|
-
labelColSpan: zod.
|
|
4539
|
+
const tableRowSchema = zod.object({
|
|
4540
|
+
header: zod.boolean().optional(),
|
|
4541
|
+
label: zod.string().optional().describe("The text of a header cell at the start of the row"),
|
|
4542
|
+
labelColSpan: zod.number().optional().describe("Columns the label cell spans")
|
|
4522
4543
|
});
|
|
4523
|
-
const tableCellSchema = zod.
|
|
4524
|
-
text: zod.
|
|
4525
|
-
header: zod.
|
|
4544
|
+
const tableCellSchema = zod.object({
|
|
4545
|
+
text: zod.union([zod.string(), zod.number()]).optional(),
|
|
4546
|
+
header: zod.boolean().optional(),
|
|
4526
4547
|
align: cellAlign,
|
|
4527
4548
|
vAlign: cellAlign.describe("Default \"start\""),
|
|
4528
|
-
colSpan: zod.
|
|
4529
|
-
rowSpan: zod.
|
|
4549
|
+
colSpan: zod.number().optional(),
|
|
4550
|
+
rowSpan: zod.number().optional(),
|
|
4530
4551
|
width: sizeValue.optional(),
|
|
4531
4552
|
padding: sizeValue.optional()
|
|
4532
4553
|
});
|
|
4533
|
-
const listItemValue = zod.
|
|
4534
|
-
label: zod.
|
|
4535
|
-
description: zod.
|
|
4536
|
-
icon: zod.
|
|
4537
|
-
value: zod.
|
|
4554
|
+
const listItemValue = zod.union([zod.string(), zod.object({
|
|
4555
|
+
label: zod.string(),
|
|
4556
|
+
description: zod.string().optional(),
|
|
4557
|
+
icon: zod.string().optional().describe("Lucide icon name"),
|
|
4558
|
+
value: zod.union([zod.string(), zod.number()]).optional().describe("Without an action: shown on the right of the label, for a key and value fact. With an action: the payload of the pick, not shown")
|
|
4538
4559
|
})]);
|
|
4539
|
-
const listSchema = zod.
|
|
4540
|
-
items: zod.
|
|
4541
|
-
direction: zod.
|
|
4542
|
-
align: zod.
|
|
4560
|
+
const listSchema = zod.object({
|
|
4561
|
+
items: zod.array(listItemValue).optional().describe("Strings or { \"label\", \"value\"?, \"description\"?, \"icon\"? }, or { \"@path\": \"/x\" }"),
|
|
4562
|
+
direction: zod.enum(["vertical", "horizontal"]).optional().describe("Default \"vertical\". \"horizontal\" scrolls sideways"),
|
|
4563
|
+
align: zod.enum([
|
|
4543
4564
|
"start",
|
|
4544
4565
|
"center",
|
|
4545
4566
|
"end",
|
|
4546
4567
|
"stretch"
|
|
4547
4568
|
]).optional(),
|
|
4548
4569
|
weight: weightProp,
|
|
4549
|
-
marker: zod.
|
|
4570
|
+
marker: zod.enum([
|
|
4550
4571
|
"bullet",
|
|
4551
4572
|
"number",
|
|
4552
4573
|
"rich",
|
|
4553
4574
|
"none"
|
|
4554
4575
|
]).optional().describe("Default \"bullet\""),
|
|
4555
|
-
connector: zod.
|
|
4576
|
+
connector: zod.enum(["none", "solid"]).optional().describe("Default \"none\""),
|
|
4556
4577
|
gap: sizeValue.optional(),
|
|
4557
|
-
start: zod.
|
|
4558
|
-
maxMarkerSize: zod.
|
|
4578
|
+
start: zod.number().optional().describe("The first number of marker \"number\""),
|
|
4579
|
+
maxMarkerSize: zod.number().optional().describe("The width of the marker column in pixels")
|
|
4559
4580
|
});
|
|
4560
|
-
const listItemSchema = zod.
|
|
4561
|
-
label: zod.
|
|
4562
|
-
value: zod.
|
|
4563
|
-
description: zod.
|
|
4564
|
-
icon: zod.
|
|
4565
|
-
marker: zod.
|
|
4566
|
-
markerSize: zod.
|
|
4567
|
-
disabled: zod.
|
|
4581
|
+
const listItemSchema = zod.object({
|
|
4582
|
+
label: zod.string().optional(),
|
|
4583
|
+
value: zod.union([zod.string(), zod.number()]).optional().describe("Without an action: shown on the right of the label, for a key and value fact"),
|
|
4584
|
+
description: zod.string().optional(),
|
|
4585
|
+
icon: zod.string().optional().describe("Lucide icon name"),
|
|
4586
|
+
marker: zod.string().optional().describe("Shows this text as the marker"),
|
|
4587
|
+
markerSize: zod.number().optional().describe("The width of the marker column in pixels"),
|
|
4588
|
+
disabled: zod.boolean().optional().describe("Greys the item out and ignores its action")
|
|
4568
4589
|
});
|
|
4569
|
-
const listSelection = zod.
|
|
4570
|
-
index: zod.
|
|
4571
|
-
label: zod.
|
|
4572
|
-
value: zod.
|
|
4590
|
+
const listSelection = zod.object({
|
|
4591
|
+
index: zod.number(),
|
|
4592
|
+
label: zod.string(),
|
|
4593
|
+
value: zod.string().optional()
|
|
4573
4594
|
});
|
|
4574
4595
|
const TableContext = (0, react.createContext)(null);
|
|
4575
4596
|
const V_ALIGN = {
|
|
@@ -5035,7 +5056,7 @@ const dataComponents = {
|
|
|
5035
5056
|
props: listItemSchema,
|
|
5036
5057
|
events: { action: {
|
|
5037
5058
|
description: "Runs when the user picks the item.",
|
|
5038
|
-
parameters: zod.
|
|
5059
|
+
parameters: zod.object({})
|
|
5039
5060
|
} },
|
|
5040
5061
|
slots: CHILDREN_SLOT
|
|
5041
5062
|
},
|
|
@@ -5092,35 +5113,35 @@ const BUTTON_RESET = {
|
|
|
5092
5113
|
textAlign: "inherit",
|
|
5093
5114
|
cursor: "pointer"
|
|
5094
5115
|
};
|
|
5095
|
-
const pulseIndicatorSchema = zod.
|
|
5096
|
-
label: zod.
|
|
5097
|
-
color: zod.
|
|
5098
|
-
size: zod.
|
|
5099
|
-
pulseColor: zod.
|
|
5100
|
-
duration: zod.
|
|
5101
|
-
endScale: zod.
|
|
5102
|
-
startOpacity: zod.
|
|
5116
|
+
const pulseIndicatorSchema = zod.object({
|
|
5117
|
+
label: zod.string().optional().describe("What the dot means, for screen readers. Leave it unset when text next to the dot says the same"),
|
|
5118
|
+
color: zod.string().optional().describe("Text color token. Default \"success\""),
|
|
5119
|
+
size: zod.number().optional().describe("Pixels. Default 12"),
|
|
5120
|
+
pulseColor: zod.string().optional(),
|
|
5121
|
+
duration: zod.number().optional().describe("Milliseconds. Default 1500"),
|
|
5122
|
+
endScale: zod.number().optional().describe("Default 2.4"),
|
|
5123
|
+
startOpacity: zod.number().optional().describe("Default 0.6")
|
|
5103
5124
|
});
|
|
5104
|
-
const flashcardSchema = zod.
|
|
5105
|
-
front: zod.
|
|
5106
|
-
back: zod.
|
|
5107
|
-
hint: zod.
|
|
5125
|
+
const flashcardSchema = zod.object({
|
|
5126
|
+
front: zod.string().optional().describe("The text on the front"),
|
|
5127
|
+
back: zod.string().optional().describe("The text on the back"),
|
|
5128
|
+
hint: zod.string().optional().describe("A small line under the front, for example \"Click to flip\"")
|
|
5108
5129
|
});
|
|
5109
|
-
const popoverSchema = zod.
|
|
5110
|
-
open: zod.
|
|
5111
|
-
showOnHover: zod.
|
|
5112
|
-
hoverOpenDelay: zod.
|
|
5130
|
+
const popoverSchema = zod.object({
|
|
5131
|
+
open: zod.boolean().optional().describe("Default false"),
|
|
5132
|
+
showOnHover: zod.boolean().optional(),
|
|
5133
|
+
hoverOpenDelay: zod.number().optional().describe("Milliseconds before a hover opens it. Default 0")
|
|
5113
5134
|
});
|
|
5114
|
-
const popoverTriggerSchema = zod.
|
|
5115
|
-
const popoverContentSchema = zod.
|
|
5116
|
-
side: zod.
|
|
5135
|
+
const popoverTriggerSchema = zod.object({ block: zod.boolean().optional().describe("Full width") });
|
|
5136
|
+
const popoverContentSchema = zod.object({
|
|
5137
|
+
side: zod.enum([
|
|
5117
5138
|
"top",
|
|
5118
5139
|
"bottom",
|
|
5119
5140
|
"left",
|
|
5120
5141
|
"right"
|
|
5121
5142
|
]).optional().describe("Default \"bottom\""),
|
|
5122
|
-
sideOffset: zod.
|
|
5123
|
-
align: zod.
|
|
5143
|
+
sideOffset: zod.number().optional().describe("Pixels between the trigger and the content. Default 6"),
|
|
5144
|
+
align: zod.enum([
|
|
5124
5145
|
"start",
|
|
5125
5146
|
"center",
|
|
5126
5147
|
"end"
|
|
@@ -5384,9 +5405,9 @@ function PopoverContent(props) {
|
|
|
5384
5405
|
children: props.children
|
|
5385
5406
|
});
|
|
5386
5407
|
}
|
|
5387
|
-
const modalSchema = zod.
|
|
5388
|
-
title: zod.
|
|
5389
|
-
open: zod.
|
|
5408
|
+
const modalSchema = zod.object({
|
|
5409
|
+
title: zod.string().optional().describe("The heading of the dialog"),
|
|
5410
|
+
open: zod.boolean().optional().describe("Default false. Bind it with { \"@path\": \"/x\" } to read it"),
|
|
5390
5411
|
maxWidth: sizeValue.optional().describe("Default 480"),
|
|
5391
5412
|
weight: weightProp
|
|
5392
5413
|
});
|
|
@@ -5640,20 +5661,20 @@ const feedbackComponents = {
|
|
|
5640
5661
|
* The engine resolves the condition before the component renders, so a
|
|
5641
5662
|
* component sees a boolean or a `ValidationResult`.
|
|
5642
5663
|
*/
|
|
5643
|
-
const severity = zod.
|
|
5664
|
+
const severity = zod.enum([
|
|
5644
5665
|
"error",
|
|
5645
5666
|
"warning",
|
|
5646
5667
|
"info"
|
|
5647
5668
|
]);
|
|
5648
|
-
const validationResult = zod.
|
|
5649
|
-
valid: zod.
|
|
5650
|
-
message: zod.
|
|
5651
|
-
code: zod.
|
|
5669
|
+
const validationResult = zod.object({
|
|
5670
|
+
valid: zod.boolean(),
|
|
5671
|
+
message: zod.string().optional(),
|
|
5672
|
+
code: zod.string().optional(),
|
|
5652
5673
|
severity: severity.optional()
|
|
5653
|
-
}).
|
|
5654
|
-
const checksProp = zod.
|
|
5655
|
-
condition: zod.
|
|
5656
|
-
message: zod.
|
|
5674
|
+
}).loose();
|
|
5675
|
+
const checksProp = zod.array(zod.object({
|
|
5676
|
+
condition: zod.union([zod.boolean(), validationResult]).optional().describe("A validator call, for example {\"@call\":\"required\",\"args\":{\"value\":{\"@path\":\"/x\"}}}, or a boolean binding"),
|
|
5677
|
+
message: zod.string().optional().describe("Shown when the check fails, instead of the default message")
|
|
5657
5678
|
})).optional().describe("Validation rules. The control shows the first failed one");
|
|
5658
5679
|
/**
|
|
5659
5680
|
* The failed check to show, or `undefined` when every check passes: the
|
|
@@ -5730,12 +5751,12 @@ async function copyText(text) {
|
|
|
5730
5751
|
* The arguments of a click or submit event: none. The model adds values
|
|
5731
5752
|
* with the `context` of its `{ "event": ... }` binding.
|
|
5732
5753
|
*/
|
|
5733
|
-
const NO_ARGS = zod.
|
|
5754
|
+
const NO_ARGS = zod.object({});
|
|
5734
5755
|
/** A list of choices: plain strings or `{ value, label, description? }`. */
|
|
5735
|
-
const optionList = zod.
|
|
5736
|
-
value: zod.
|
|
5737
|
-
label: zod.
|
|
5738
|
-
description: zod.
|
|
5756
|
+
const optionList = zod.array(zod.union([zod.string(), zod.object({
|
|
5757
|
+
value: zod.string(),
|
|
5758
|
+
label: zod.string().optional(),
|
|
5759
|
+
description: zod.string().optional()
|
|
5739
5760
|
})])).optional().describe("Strings or { \"value\", \"label\", \"description\"? }");
|
|
5740
5761
|
const SIZES = [
|
|
5741
5762
|
"sm",
|
|
@@ -5743,60 +5764,60 @@ const SIZES = [
|
|
|
5743
5764
|
"lg",
|
|
5744
5765
|
"xl"
|
|
5745
5766
|
];
|
|
5746
|
-
const size = (fallback) => zod.
|
|
5747
|
-
const pill = zod.
|
|
5748
|
-
const fieldLabel = zod.
|
|
5749
|
-
const boundValue = zod.
|
|
5750
|
-
const buttonSchema = zod.
|
|
5751
|
-
label: zod.
|
|
5767
|
+
const size = (fallback) => zod.enum(SIZES).optional().describe(`Default "${fallback}"`);
|
|
5768
|
+
const pill = zod.boolean().optional().describe("Default true");
|
|
5769
|
+
const fieldLabel = zod.string().optional().describe("The visible label of the field. Always set it");
|
|
5770
|
+
const boundValue = zod.string().optional().describe("Bind it with { \"@path\": \"/x\" } to read what the user entered");
|
|
5771
|
+
const buttonSchema = zod.object({
|
|
5772
|
+
label: zod.string().optional().describe("The button text"),
|
|
5752
5773
|
checks: checksProp,
|
|
5753
|
-
text: zod.
|
|
5754
|
-
variant: zod.
|
|
5774
|
+
text: zod.string().optional().describe("Same as label. Used when label is not set"),
|
|
5775
|
+
variant: zod.enum([
|
|
5755
5776
|
"default",
|
|
5756
5777
|
"primary",
|
|
5757
5778
|
"soft",
|
|
5758
5779
|
"borderless"
|
|
5759
5780
|
]).optional().describe("Default \"default\": outlined. \"primary\" is filled, for the one main action. \"borderless\" has no box, like a link"),
|
|
5760
|
-
color: zod.
|
|
5781
|
+
color: zod.enum([
|
|
5761
5782
|
"primary",
|
|
5762
5783
|
"secondary",
|
|
5763
5784
|
"danger"
|
|
5764
5785
|
]).optional().describe("Default \"primary\""),
|
|
5765
|
-
size: zod.
|
|
5786
|
+
size: zod.enum([
|
|
5766
5787
|
"sm",
|
|
5767
5788
|
"md",
|
|
5768
5789
|
"lg"
|
|
5769
5790
|
]).optional().describe("Default \"lg\""),
|
|
5770
|
-
block: zod.
|
|
5791
|
+
block: zod.boolean().optional().describe("Full width"),
|
|
5771
5792
|
weight: weightProp,
|
|
5772
5793
|
pill,
|
|
5773
|
-
disabled: zod.
|
|
5774
|
-
loading: zod.
|
|
5775
|
-
submit: zod.
|
|
5776
|
-
icon: zod.
|
|
5777
|
-
uniform: zod.
|
|
5778
|
-
href: zod.
|
|
5779
|
-
copy: zod.
|
|
5794
|
+
disabled: zod.boolean().optional(),
|
|
5795
|
+
loading: zod.boolean().optional(),
|
|
5796
|
+
submit: zod.boolean().optional().describe("Submits the Form around it. The Form sends its onSubmit event"),
|
|
5797
|
+
icon: zod.string().optional().describe("Lucide icon name"),
|
|
5798
|
+
uniform: zod.boolean().optional().describe("A square button, for an icon"),
|
|
5799
|
+
href: zod.string().optional().describe("Opens this URL in a new tab on click, instead of onClick"),
|
|
5800
|
+
copy: zod.string().optional().describe("Copies this text to the clipboard on click and shows a check mark, instead of onClick")
|
|
5780
5801
|
});
|
|
5781
|
-
const pressableSchema = zod.
|
|
5802
|
+
const pressableSchema = zod.object({
|
|
5782
5803
|
...layoutProps,
|
|
5783
|
-
disabled: zod.
|
|
5784
|
-
hoverBackground: zod.
|
|
5785
|
-
href: zod.
|
|
5786
|
-
tooltip: zod.
|
|
5787
|
-
ariaPressed: zod.
|
|
5788
|
-
insetBorder: zod.
|
|
5804
|
+
disabled: zod.boolean().optional(),
|
|
5805
|
+
hoverBackground: zod.string().optional(),
|
|
5806
|
+
href: zod.string().optional().describe("Opens this URL in a new tab on click, instead of onClick"),
|
|
5807
|
+
tooltip: zod.string().optional().describe("Shown on hover"),
|
|
5808
|
+
ariaPressed: zod.boolean().optional().describe("For a toggle"),
|
|
5809
|
+
insetBorder: zod.boolean().optional().describe("A 1px border inside the box")
|
|
5789
5810
|
});
|
|
5790
|
-
const formSchema = zod.
|
|
5811
|
+
const formSchema = zod.object({
|
|
5791
5812
|
...layoutProps,
|
|
5792
|
-
label: zod.
|
|
5813
|
+
label: zod.string().optional().describe("A short name of the form for screen readers")
|
|
5793
5814
|
});
|
|
5794
|
-
const textFieldSchema = zod.
|
|
5815
|
+
const textFieldSchema = zod.object({
|
|
5795
5816
|
checks: checksProp,
|
|
5796
|
-
value: zod.
|
|
5797
|
-
placeholder: zod.
|
|
5817
|
+
value: zod.union([zod.string(), zod.number()]).optional().describe("Bind it with { \"@path\": \"/x\" } to read what the user typed"),
|
|
5818
|
+
placeholder: zod.string().optional(),
|
|
5798
5819
|
label: fieldLabel,
|
|
5799
|
-
variant: zod.
|
|
5820
|
+
variant: zod.enum([
|
|
5800
5821
|
"shortText",
|
|
5801
5822
|
"longText",
|
|
5802
5823
|
"number",
|
|
@@ -5806,140 +5827,140 @@ const textFieldSchema = zod.z.object({
|
|
|
5806
5827
|
"tel"
|
|
5807
5828
|
]).optional().describe("Default \"shortText\". \"longText\" is a multi-line field, \"obscured\" a password"),
|
|
5808
5829
|
weight: weightProp,
|
|
5809
|
-
name: zod.
|
|
5810
|
-
required: zod.
|
|
5811
|
-
disabled: zod.
|
|
5812
|
-
invalid: zod.
|
|
5830
|
+
name: zod.string().optional(),
|
|
5831
|
+
required: zod.boolean().optional(),
|
|
5832
|
+
disabled: zod.boolean().optional(),
|
|
5833
|
+
invalid: zod.boolean().optional(),
|
|
5813
5834
|
size: size("xl"),
|
|
5814
5835
|
pill,
|
|
5815
|
-
autoSelect: zod.
|
|
5816
|
-
mask: zod.
|
|
5836
|
+
autoSelect: zod.boolean().optional(),
|
|
5837
|
+
mask: zod.string().optional()
|
|
5817
5838
|
});
|
|
5818
|
-
const textAreaSchema = zod.
|
|
5839
|
+
const textAreaSchema = zod.object({
|
|
5819
5840
|
checks: checksProp,
|
|
5820
5841
|
value: boundValue,
|
|
5821
|
-
placeholder: zod.
|
|
5842
|
+
placeholder: zod.string().optional(),
|
|
5822
5843
|
label: fieldLabel,
|
|
5823
5844
|
weight: weightProp,
|
|
5824
|
-
rows: zod.
|
|
5825
|
-
maxRows: zod.
|
|
5826
|
-
autoResize: zod.
|
|
5827
|
-
name: zod.
|
|
5828
|
-
required: zod.
|
|
5829
|
-
disabled: zod.
|
|
5830
|
-
invalid: zod.
|
|
5845
|
+
rows: zod.number().optional().describe("Default 3"),
|
|
5846
|
+
maxRows: zod.number().optional(),
|
|
5847
|
+
autoResize: zod.boolean().optional(),
|
|
5848
|
+
name: zod.string().optional(),
|
|
5849
|
+
required: zod.boolean().optional(),
|
|
5850
|
+
disabled: zod.boolean().optional(),
|
|
5851
|
+
invalid: zod.boolean().optional(),
|
|
5831
5852
|
size: size("xl")
|
|
5832
5853
|
});
|
|
5833
|
-
const selectSchema = zod.
|
|
5854
|
+
const selectSchema = zod.object({
|
|
5834
5855
|
checks: checksProp,
|
|
5835
5856
|
value: boundValue,
|
|
5836
5857
|
options: optionList,
|
|
5837
|
-
placeholder: zod.
|
|
5858
|
+
placeholder: zod.string().optional(),
|
|
5838
5859
|
label: fieldLabel,
|
|
5839
|
-
name: zod.
|
|
5840
|
-
required: zod.
|
|
5841
|
-
disabled: zod.
|
|
5842
|
-
clearable: zod.
|
|
5843
|
-
clearLabel: zod.
|
|
5844
|
-
searchable: zod.
|
|
5845
|
-
icon: zod.
|
|
5846
|
-
block: zod.
|
|
5860
|
+
name: zod.string().optional(),
|
|
5861
|
+
required: zod.boolean().optional(),
|
|
5862
|
+
disabled: zod.boolean().optional(),
|
|
5863
|
+
clearable: zod.boolean().optional(),
|
|
5864
|
+
clearLabel: zod.string().optional().describe("The label of the empty option"),
|
|
5865
|
+
searchable: zod.boolean().optional(),
|
|
5866
|
+
icon: zod.string().optional().describe("Lucide icon shown before the value"),
|
|
5867
|
+
block: zod.boolean().optional().describe("Full width"),
|
|
5847
5868
|
size: size("xl"),
|
|
5848
5869
|
pill
|
|
5849
5870
|
});
|
|
5850
|
-
const checkBoxSchema = zod.
|
|
5871
|
+
const checkBoxSchema = zod.object({
|
|
5851
5872
|
checks: checksProp,
|
|
5852
|
-
value: zod.
|
|
5853
|
-
label: zod.
|
|
5854
|
-
name: zod.
|
|
5873
|
+
value: zod.boolean().optional().describe("True when checked. Bind it with { \"@path\": \"/x\" } to read the state of the box"),
|
|
5874
|
+
label: zod.string().optional().describe("The label text. Always set it"),
|
|
5875
|
+
name: zod.string().optional(),
|
|
5855
5876
|
weight: weightProp,
|
|
5856
|
-
disabled: zod.
|
|
5857
|
-
required: zod.
|
|
5858
|
-
lineThrough: zod.
|
|
5859
|
-
shape: zod.
|
|
5877
|
+
disabled: zod.boolean().optional(),
|
|
5878
|
+
required: zod.boolean().optional(),
|
|
5879
|
+
lineThrough: zod.boolean().optional().describe("Default false. Strikes the label when the box is checked"),
|
|
5880
|
+
shape: zod.enum(["round", "square"]).optional().describe("Default \"round\"")
|
|
5860
5881
|
});
|
|
5861
|
-
const radioSchema = zod.
|
|
5862
|
-
value: zod.
|
|
5863
|
-
label: zod.
|
|
5864
|
-
disabled: zod.
|
|
5865
|
-
required: zod.
|
|
5882
|
+
const radioSchema = zod.object({
|
|
5883
|
+
value: zod.string().optional(),
|
|
5884
|
+
label: zod.string().optional(),
|
|
5885
|
+
disabled: zod.boolean().optional(),
|
|
5886
|
+
required: zod.boolean().optional()
|
|
5866
5887
|
});
|
|
5867
|
-
const radioGroupSchema = zod.
|
|
5888
|
+
const radioGroupSchema = zod.object({
|
|
5868
5889
|
checks: checksProp,
|
|
5869
5890
|
value: boundValue,
|
|
5870
5891
|
options: optionList,
|
|
5871
5892
|
label: fieldLabel,
|
|
5872
|
-
name: zod.
|
|
5873
|
-
direction: zod.
|
|
5874
|
-
variant: zod.
|
|
5893
|
+
name: zod.string().optional(),
|
|
5894
|
+
direction: zod.enum(["row", "col"]).optional().describe("Default \"row\""),
|
|
5895
|
+
variant: zod.enum([
|
|
5875
5896
|
"list",
|
|
5876
5897
|
"pills",
|
|
5877
5898
|
"cards"
|
|
5878
5899
|
]).optional(),
|
|
5879
|
-
disabled: zod.
|
|
5880
|
-
required: zod.
|
|
5900
|
+
disabled: zod.boolean().optional(),
|
|
5901
|
+
required: zod.boolean().optional()
|
|
5881
5902
|
});
|
|
5882
|
-
const sliderSchema = zod.
|
|
5903
|
+
const sliderSchema = zod.object({
|
|
5883
5904
|
checks: checksProp,
|
|
5884
|
-
value: zod.
|
|
5885
|
-
min: zod.
|
|
5886
|
-
max: zod.
|
|
5887
|
-
step: zod.
|
|
5888
|
-
steps: zod.
|
|
5905
|
+
value: zod.number().optional().describe("Bind it with { \"@path\": \"/x\" } to read the number"),
|
|
5906
|
+
min: zod.number().optional().describe("Default 0"),
|
|
5907
|
+
max: zod.number().optional().describe("Default 100"),
|
|
5908
|
+
step: zod.number().optional().describe("Default 1"),
|
|
5909
|
+
steps: zod.number().int().min(1).optional().describe("The number of equal divisions between min and max, instead of step"),
|
|
5889
5910
|
label: fieldLabel,
|
|
5890
5911
|
weight: weightProp,
|
|
5891
|
-
unit: zod.
|
|
5892
|
-
marks: zod.
|
|
5893
|
-
value: zod.
|
|
5894
|
-
label: zod.
|
|
5912
|
+
unit: zod.string().optional().describe("Unit after the value, for example \"%\""),
|
|
5913
|
+
marks: zod.array(zod.object({
|
|
5914
|
+
value: zod.number(),
|
|
5915
|
+
label: zod.string().optional()
|
|
5895
5916
|
})).optional(),
|
|
5896
|
-
sliderStyle: zod.
|
|
5897
|
-
disabled: zod.
|
|
5898
|
-
name: zod.
|
|
5917
|
+
sliderStyle: zod.enum(["continuous", "discrete"]).optional().describe("Default \"continuous\""),
|
|
5918
|
+
disabled: zod.boolean().optional(),
|
|
5919
|
+
name: zod.string().optional()
|
|
5899
5920
|
});
|
|
5900
|
-
const segmentedControlSchema = zod.
|
|
5921
|
+
const segmentedControlSchema = zod.object({
|
|
5901
5922
|
checks: checksProp,
|
|
5902
5923
|
value: boundValue,
|
|
5903
5924
|
options: optionList,
|
|
5904
5925
|
label: fieldLabel,
|
|
5905
|
-
block: zod.
|
|
5926
|
+
block: zod.boolean().optional().describe("Full width"),
|
|
5906
5927
|
size: size("lg"),
|
|
5907
5928
|
pill,
|
|
5908
|
-
variant: zod.
|
|
5929
|
+
variant: zod.enum([
|
|
5909
5930
|
"solid",
|
|
5910
5931
|
"soft",
|
|
5911
5932
|
"outline",
|
|
5912
5933
|
"ghost"
|
|
5913
5934
|
]).optional().describe("Default \"ghost\""),
|
|
5914
|
-
disabled: zod.
|
|
5935
|
+
disabled: zod.boolean().optional()
|
|
5915
5936
|
});
|
|
5916
|
-
const choicePickerSchema = zod.
|
|
5937
|
+
const choicePickerSchema = zod.object({
|
|
5917
5938
|
checks: checksProp,
|
|
5918
|
-
value: zod.
|
|
5939
|
+
value: zod.array(zod.string()).optional().describe("The chosen option values. Bind it with { \"@path\": \"/x\" } to a string list"),
|
|
5919
5940
|
options: optionList,
|
|
5920
5941
|
label: fieldLabel,
|
|
5921
|
-
variant: zod.
|
|
5922
|
-
displayStyle: zod.
|
|
5923
|
-
filterable: zod.
|
|
5942
|
+
variant: zod.enum(["multipleSelection", "mutuallyExclusive"]).optional().describe("Default \"mutuallyExclusive\": the user picks one option"),
|
|
5943
|
+
displayStyle: zod.enum(["checkbox", "chips"]).optional().describe("Default \"checkbox\". \"chips\" shows the options as pills"),
|
|
5944
|
+
filterable: zod.boolean().optional().describe("Default false. Shows a field that filters the options"),
|
|
5924
5945
|
weight: weightProp,
|
|
5925
|
-
disabled: zod.
|
|
5926
|
-
required: zod.
|
|
5946
|
+
disabled: zod.boolean().optional(),
|
|
5947
|
+
required: zod.boolean().optional()
|
|
5927
5948
|
});
|
|
5928
|
-
const dateTimeInputSchema = zod.
|
|
5949
|
+
const dateTimeInputSchema = zod.object({
|
|
5929
5950
|
checks: checksProp,
|
|
5930
|
-
value: zod.
|
|
5951
|
+
value: zod.string().optional().describe("ISO 8601: \"YYYY-MM-DD\", \"HH:MM\" or \"YYYY-MM-DDTHH:MM\". Bind it with { \"@path\": \"/x\" }"),
|
|
5931
5952
|
label: fieldLabel,
|
|
5932
|
-
enableDate: zod.
|
|
5933
|
-
enableTime: zod.
|
|
5934
|
-
timeStep: zod.
|
|
5953
|
+
enableDate: zod.boolean().optional().describe("The user picks a date. Default true unless only enableTime is set"),
|
|
5954
|
+
enableTime: zod.boolean().optional().describe("The user picks a time"),
|
|
5955
|
+
timeStep: zod.number().int().min(1).max(720).optional().describe("Minutes between the times the user can pick, e.g. 15 or 30. Shows the time as a list"),
|
|
5935
5956
|
weight: weightProp,
|
|
5936
|
-
min: zod.
|
|
5937
|
-
max: zod.
|
|
5938
|
-
placeholder: zod.
|
|
5939
|
-
disabled: zod.
|
|
5940
|
-
required: zod.
|
|
5941
|
-
clearable: zod.
|
|
5942
|
-
block: zod.
|
|
5957
|
+
min: zod.string().optional().describe("The earliest value, ISO 8601"),
|
|
5958
|
+
max: zod.string().optional().describe("The latest value, ISO 8601"),
|
|
5959
|
+
placeholder: zod.string().optional(),
|
|
5960
|
+
disabled: zod.boolean().optional(),
|
|
5961
|
+
required: zod.boolean().optional(),
|
|
5962
|
+
clearable: zod.boolean().optional(),
|
|
5963
|
+
block: zod.boolean().optional().describe("Full width")
|
|
5943
5964
|
});
|
|
5944
5965
|
/** The writable list of a control that keeps its state in `value`. */
|
|
5945
5966
|
const VALUE_WRITABLE = ["value"];
|
|
@@ -7285,9 +7306,9 @@ const inputComponents = {
|
|
|
7285
7306
|
|
|
7286
7307
|
//#endregion
|
|
7287
7308
|
//#region src/generative-ui/standard/text.tsx
|
|
7288
|
-
const colorProp = zod.
|
|
7289
|
-
const fontWeight = zod.
|
|
7290
|
-
const textAlign = zod.
|
|
7309
|
+
const colorProp = zod.string().optional().describe(`One of ${TEXT_COLORS.join("|")} or a CSS color`);
|
|
7310
|
+
const fontWeight = zod.enum(WEIGHTS).optional();
|
|
7311
|
+
const textAlign = zod.enum([
|
|
7291
7312
|
"start",
|
|
7292
7313
|
"center",
|
|
7293
7314
|
"end"
|
|
@@ -7296,70 +7317,70 @@ const typographyProps = {
|
|
|
7296
7317
|
color: colorProp,
|
|
7297
7318
|
fontWeight,
|
|
7298
7319
|
textAlign,
|
|
7299
|
-
italic: zod.
|
|
7300
|
-
truncate: zod.
|
|
7301
|
-
maxLines: zod.
|
|
7302
|
-
tabularNums: zod.
|
|
7320
|
+
italic: zod.boolean().optional(),
|
|
7321
|
+
truncate: zod.boolean().optional(),
|
|
7322
|
+
maxLines: zod.number().optional(),
|
|
7323
|
+
tabularNums: zod.boolean().optional(),
|
|
7303
7324
|
width: sizeValue.optional()
|
|
7304
7325
|
};
|
|
7305
|
-
zod.
|
|
7306
|
-
const titleSchema = zod.
|
|
7326
|
+
zod.object(typographyProps);
|
|
7327
|
+
const titleSchema = zod.object({
|
|
7307
7328
|
...typographyProps,
|
|
7308
|
-
text: zod.
|
|
7309
|
-
size: zod.
|
|
7310
|
-
strong: zod.
|
|
7329
|
+
text: zod.string().describe("Heading text"),
|
|
7330
|
+
size: zod.enum(TITLE_SIZES).optional().describe("Default \"md\""),
|
|
7331
|
+
strong: zod.boolean().optional().describe("Default true")
|
|
7311
7332
|
});
|
|
7312
|
-
const textSchema = zod.
|
|
7333
|
+
const textSchema = zod.object({
|
|
7313
7334
|
...typographyProps,
|
|
7314
7335
|
weight: weightProp,
|
|
7315
|
-
text: zod.
|
|
7316
|
-
size: zod.
|
|
7336
|
+
text: zod.union([zod.string(), zod.number()]).optional().describe("Text with inline markdown. A bound number shows as text"),
|
|
7337
|
+
size: zod.enum(TEXT_SIZES).optional().describe("Default \"md\""),
|
|
7317
7338
|
fontSize: sizeValue.optional().describe("Pixels when a number. Wins over size"),
|
|
7318
|
-
lineHeight: zod.
|
|
7319
|
-
minLines: zod.
|
|
7320
|
-
strong: zod.
|
|
7321
|
-
underline: zod.
|
|
7322
|
-
lineThrough: zod.
|
|
7323
|
-
inline: zod.
|
|
7324
|
-
preserveWhitespace: zod.
|
|
7325
|
-
highlight: zod.
|
|
7339
|
+
lineHeight: zod.union([zod.number(), zod.string()]).optional().describe("A unitless ratio, or CSS"),
|
|
7340
|
+
minLines: zod.number().optional().describe("Reserves the height of this many lines"),
|
|
7341
|
+
strong: zod.boolean().optional().describe("Default false"),
|
|
7342
|
+
underline: zod.boolean().optional(),
|
|
7343
|
+
lineThrough: zod.boolean().optional(),
|
|
7344
|
+
inline: zod.boolean().optional(),
|
|
7345
|
+
preserveWhitespace: zod.boolean().optional(),
|
|
7346
|
+
highlight: zod.union([zod.enum([
|
|
7326
7347
|
"green",
|
|
7327
7348
|
"orange",
|
|
7328
7349
|
"pink"
|
|
7329
|
-
]), zod.
|
|
7350
|
+
]), zod.boolean()]).optional()
|
|
7330
7351
|
});
|
|
7331
|
-
const captionSchema = zod.
|
|
7332
|
-
text: zod.
|
|
7352
|
+
const captionSchema = zod.object({
|
|
7353
|
+
text: zod.union([zod.string(), zod.number()]).describe("Caption text"),
|
|
7333
7354
|
color: colorProp,
|
|
7334
|
-
size: zod.
|
|
7355
|
+
size: zod.enum([
|
|
7335
7356
|
"sm",
|
|
7336
7357
|
"md",
|
|
7337
7358
|
"lg"
|
|
7338
7359
|
]).optional().describe("Default \"lg\""),
|
|
7339
7360
|
fontWeight: fontWeight.describe("Default \"normal\""),
|
|
7340
7361
|
textAlign,
|
|
7341
|
-
truncate: zod.
|
|
7342
|
-
maxLines: zod.
|
|
7362
|
+
truncate: zod.boolean().optional(),
|
|
7363
|
+
maxLines: zod.number().optional()
|
|
7343
7364
|
});
|
|
7344
|
-
const labelSchema = zod.
|
|
7345
|
-
text: zod.
|
|
7346
|
-
htmlFor: zod.
|
|
7365
|
+
const labelSchema = zod.object({
|
|
7366
|
+
text: zod.union([zod.string(), zod.number()]).describe("Label text"),
|
|
7367
|
+
htmlFor: zod.string().optional(),
|
|
7347
7368
|
color: colorProp,
|
|
7348
|
-
size: zod.
|
|
7369
|
+
size: zod.enum(TEXT_SIZES).optional().describe("Default \"sm\""),
|
|
7349
7370
|
fontWeight: fontWeight.describe("Default \"medium\""),
|
|
7350
7371
|
textAlign,
|
|
7351
|
-
truncate: zod.
|
|
7372
|
+
truncate: zod.boolean().optional(),
|
|
7352
7373
|
width: sizeValue.optional()
|
|
7353
7374
|
});
|
|
7354
|
-
const boldSchema = zod.
|
|
7355
|
-
text: zod.
|
|
7375
|
+
const boldSchema = zod.object({
|
|
7376
|
+
text: zod.string(),
|
|
7356
7377
|
fontWeight
|
|
7357
7378
|
});
|
|
7358
|
-
const inlineTextSchema = zod.
|
|
7359
|
-
const blockquoteSchema = zod.
|
|
7360
|
-
const badgeSchema = zod.
|
|
7361
|
-
label: zod.
|
|
7362
|
-
color: zod.
|
|
7379
|
+
const inlineTextSchema = zod.object({ text: zod.string() });
|
|
7380
|
+
const blockquoteSchema = zod.object({ text: zod.string().describe("The quoted text, with inline markdown") });
|
|
7381
|
+
const badgeSchema = zod.object({
|
|
7382
|
+
label: zod.string().describe("Badge text"),
|
|
7383
|
+
color: zod.enum([
|
|
7363
7384
|
"secondary",
|
|
7364
7385
|
"success",
|
|
7365
7386
|
"danger",
|
|
@@ -7367,13 +7388,13 @@ const badgeSchema = zod.z.object({
|
|
|
7367
7388
|
"info",
|
|
7368
7389
|
"discovery"
|
|
7369
7390
|
]).optional().describe("Default \"secondary\""),
|
|
7370
|
-
size: zod.
|
|
7391
|
+
size: zod.enum([
|
|
7371
7392
|
"sm",
|
|
7372
7393
|
"md",
|
|
7373
7394
|
"lg"
|
|
7374
7395
|
]).optional().describe("Default \"md\""),
|
|
7375
|
-
pill: zod.
|
|
7376
|
-
variant: zod.
|
|
7396
|
+
pill: zod.boolean().optional().describe("Default true"),
|
|
7397
|
+
variant: zod.enum([
|
|
7377
7398
|
"soft",
|
|
7378
7399
|
"solid",
|
|
7379
7400
|
"outline"
|
|
@@ -7382,28 +7403,28 @@ const badgeSchema = zod.z.object({
|
|
|
7382
7403
|
maxWidth: sizeValue.optional(),
|
|
7383
7404
|
padding: sizeValue.optional()
|
|
7384
7405
|
});
|
|
7385
|
-
const codeSchema = zod.
|
|
7386
|
-
text: zod.
|
|
7387
|
-
language: zod.
|
|
7406
|
+
const codeSchema = zod.object({
|
|
7407
|
+
text: zod.string().describe("Source code"),
|
|
7408
|
+
language: zod.string().optional()
|
|
7388
7409
|
});
|
|
7389
|
-
const markdownSchema = zod.
|
|
7390
|
-
text: zod.
|
|
7391
|
-
streaming: zod.
|
|
7410
|
+
const markdownSchema = zod.object({
|
|
7411
|
+
text: zod.string().describe("Markdown source"),
|
|
7412
|
+
streaming: zod.boolean().optional().describe("Default false")
|
|
7392
7413
|
});
|
|
7393
|
-
const mathSchema = zod.
|
|
7394
|
-
value: zod.
|
|
7395
|
-
block: zod.
|
|
7414
|
+
const mathSchema = zod.object({
|
|
7415
|
+
value: zod.string().describe("TeX source"),
|
|
7416
|
+
block: zod.boolean().optional().describe("Default false")
|
|
7396
7417
|
});
|
|
7397
|
-
const shimmerSchema = zod.
|
|
7418
|
+
const shimmerSchema = zod.object({
|
|
7398
7419
|
...typographyProps,
|
|
7399
|
-
text: zod.
|
|
7400
|
-
size: zod.
|
|
7401
|
-
lineThrough: zod.
|
|
7420
|
+
text: zod.string(),
|
|
7421
|
+
size: zod.enum(TEXT_SIZES).optional().describe("Default \"md\""),
|
|
7422
|
+
lineThrough: zod.boolean().optional()
|
|
7402
7423
|
});
|
|
7403
|
-
const linkSchema = zod.
|
|
7404
|
-
text: zod.
|
|
7405
|
-
href: zod.
|
|
7406
|
-
title: zod.
|
|
7424
|
+
const linkSchema = zod.object({
|
|
7425
|
+
text: zod.string().describe("Link text"),
|
|
7426
|
+
href: zod.string().describe("URL"),
|
|
7427
|
+
title: zod.string().optional()
|
|
7407
7428
|
});
|
|
7408
7429
|
const FOCUS_RING = "2px solid var(--a2ui-color-focus, #0285ff)";
|
|
7409
7430
|
const TEXT_STYLE_ID = "a2ui-standard-text";
|