@copilotkit/react-core 2.0.0-rc.2 → 2.0.0-rc.20
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-Bsl28Gmn.d.mts} +17 -33
- package/dist/MarkdownRendererContext-Bsl28Gmn.d.mts.map +1 -0
- package/dist/{MarkdownRendererContext-CRKFzsEB.d.mts → MarkdownRendererContext-CBppkb5j.d.cts} +17 -33
- package/dist/MarkdownRendererContext-CBppkb5j.d.cts.map +1 -0
- package/dist/{MarkdownSurfaces-Bd--93O1.mjs → MarkdownSurfaces-Bt7TD_U1.mjs} +177 -136
- package/dist/MarkdownSurfaces-Bt7TD_U1.mjs.map +1 -0
- package/dist/{MarkdownSurfaces-S4wfUl3J.cjs → MarkdownSurfaces-CoUoPhR9.cjs} +198 -156
- package/dist/MarkdownSurfaces-CoUoPhR9.cjs.map +1 -0
- package/dist/context.cjs +28 -26
- 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 +28 -26
- package/dist/context.mjs.map +1 -1
- package/dist/generative-ui.cjs +570 -567
- 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 +75 -73
- package/dist/generative-ui.mjs.map +1 -1
- package/dist/headless.cjs +55 -84
- 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 +48 -82
- package/dist/headless.mjs.map +1 -1
- package/dist/index.cjs +1628 -2398
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +203 -540
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +202 -539
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +965 -2248
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +1776 -2466
- package/dist/index.umd.js.map +1 -1
- package/package.json +17 -18
- 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-CoUoPhR9.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
|
|
|
@@ -586,27 +587,6 @@ const BORDER_COLORS = [
|
|
|
586
587
|
"danger",
|
|
587
588
|
"discovery"
|
|
588
589
|
];
|
|
589
|
-
const BACKGROUNDS = [
|
|
590
|
-
"surface",
|
|
591
|
-
"surface-secondary",
|
|
592
|
-
"surface-tertiary",
|
|
593
|
-
"surface-elevated",
|
|
594
|
-
"surface-elevated-secondary",
|
|
595
|
-
"surface-inverted",
|
|
596
|
-
"surface-soft",
|
|
597
|
-
"info",
|
|
598
|
-
"warning",
|
|
599
|
-
"caution",
|
|
600
|
-
"success",
|
|
601
|
-
"danger",
|
|
602
|
-
"discovery",
|
|
603
|
-
"info-solid",
|
|
604
|
-
"warning-solid",
|
|
605
|
-
"caution-solid",
|
|
606
|
-
"success-solid",
|
|
607
|
-
"danger-solid",
|
|
608
|
-
"discovery-solid"
|
|
609
|
-
];
|
|
610
590
|
const RADIUS_PX = {
|
|
611
591
|
"2xs": "2px",
|
|
612
592
|
xs: "4px",
|
|
@@ -970,18 +950,18 @@ function useStandardStyles() {
|
|
|
970
950
|
//#endregion
|
|
971
951
|
//#region src/generative-ui/standard/layout.tsx
|
|
972
952
|
/** A number is a count of 4px steps. A string is raw CSS. */
|
|
973
|
-
const sizeValue = zod.
|
|
953
|
+
const sizeValue = zod.union([zod.number(), zod.string()]);
|
|
974
954
|
/** 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.
|
|
955
|
+
const weightProp = zod.number().optional().describe("flex-grow in a Row or Column");
|
|
956
|
+
const radiusValue = zod.union([
|
|
957
|
+
zod.enum(RADII),
|
|
958
|
+
zod.number(),
|
|
959
|
+
zod.string(),
|
|
960
|
+
zod.object({
|
|
961
|
+
topLeft: zod.string().optional(),
|
|
962
|
+
topRight: zod.string().optional(),
|
|
963
|
+
bottomLeft: zod.string().optional(),
|
|
964
|
+
bottomRight: zod.string().optional()
|
|
985
965
|
})
|
|
986
966
|
]);
|
|
987
967
|
/**
|
|
@@ -990,16 +970,16 @@ const radiusValue = zod.z.union([
|
|
|
990
970
|
* are a slot, not a prop.
|
|
991
971
|
*/
|
|
992
972
|
const layoutProps = {
|
|
993
|
-
align: zod.
|
|
994
|
-
justify: zod.
|
|
995
|
-
wrap: zod.
|
|
973
|
+
align: zod.enum(ALIGN).optional(),
|
|
974
|
+
justify: zod.enum(JUSTIFY).optional(),
|
|
975
|
+
wrap: zod.enum(WRAP).optional(),
|
|
996
976
|
gap: sizeValue.optional().describe("4px steps when a number"),
|
|
997
977
|
rowGap: sizeValue.optional(),
|
|
998
978
|
columnGap: sizeValue.optional(),
|
|
999
979
|
padding: sizeValue.optional().describe("4px steps when a number"),
|
|
1000
|
-
background: zod.
|
|
1001
|
-
border: zod.
|
|
1002
|
-
borderColor: zod.
|
|
980
|
+
background: zod.string().optional().describe("Leave it unset. A surface token such as surface, surface-secondary, info, success, warning, danger, discovery, or one with -solid, or a CSS color. Only one summary panel in a Card uses \"surface-secondary\""),
|
|
981
|
+
border: zod.boolean().optional(),
|
|
982
|
+
borderColor: zod.enum(BORDER_COLORS).optional(),
|
|
1003
983
|
radius: radiusValue.optional(),
|
|
1004
984
|
width: sizeValue.optional(),
|
|
1005
985
|
height: sizeValue.optional(),
|
|
@@ -1007,22 +987,22 @@ const layoutProps = {
|
|
|
1007
987
|
maxWidth: sizeValue.optional(),
|
|
1008
988
|
minHeight: sizeValue.optional(),
|
|
1009
989
|
maxHeight: sizeValue.optional(),
|
|
1010
|
-
flex: zod.
|
|
990
|
+
flex: zod.number().optional(),
|
|
1011
991
|
weight: weightProp,
|
|
1012
|
-
aspectRatio: zod.
|
|
1013
|
-
scrollable: zod.
|
|
1014
|
-
clip: zod.
|
|
1015
|
-
shadow: zod.
|
|
1016
|
-
inline: zod.
|
|
1017
|
-
role: zod.
|
|
1018
|
-
flush: zod.
|
|
992
|
+
aspectRatio: zod.string().optional(),
|
|
993
|
+
scrollable: zod.boolean().optional(),
|
|
994
|
+
clip: zod.boolean().optional(),
|
|
995
|
+
shadow: zod.boolean().optional(),
|
|
996
|
+
inline: zod.boolean().optional(),
|
|
997
|
+
role: zod.string().optional().describe("ARIA role"),
|
|
998
|
+
flush: zod.boolean().optional().describe("No padding"),
|
|
1019
999
|
minSize: sizeValue.optional().describe("Minimum width and height"),
|
|
1020
1000
|
maxSize: sizeValue.optional().describe("Maximum width and height"),
|
|
1021
|
-
disableAutoSpacing: zod.
|
|
1001
|
+
disableAutoSpacing: zod.boolean().optional().describe("No default gap between children")
|
|
1022
1002
|
};
|
|
1023
|
-
const layoutSchema = zod.
|
|
1003
|
+
const layoutSchema = zod.object(layoutProps);
|
|
1024
1004
|
/** The arguments of a click or visibility event: none. */
|
|
1025
|
-
const NO_ARGS$3 = zod.
|
|
1005
|
+
const NO_ARGS$3 = zod.object({});
|
|
1026
1006
|
/**
|
|
1027
1007
|
* The `onVisible` event of every container: sent once, the first time the
|
|
1028
1008
|
* container scrolls into view.
|
|
@@ -1033,24 +1013,24 @@ const VISIBLE_EVENT = { onVisible: {
|
|
|
1033
1013
|
} };
|
|
1034
1014
|
/** The slot of every container: a list of children or a template. */
|
|
1035
1015
|
const CHILDREN_SLOT = { children: "multiple" };
|
|
1036
|
-
const boxSchema = zod.
|
|
1016
|
+
const boxSchema = zod.object({
|
|
1037
1017
|
...layoutProps,
|
|
1038
|
-
direction: zod.
|
|
1018
|
+
direction: zod.enum(["col", "row"]).optional().describe("Default \"col\"")
|
|
1039
1019
|
});
|
|
1040
|
-
const gridSchema = zod.
|
|
1020
|
+
const gridSchema = zod.object({
|
|
1041
1021
|
...layoutProps,
|
|
1042
|
-
columns: zod.
|
|
1022
|
+
columns: zod.union([zod.number(), zod.string()]).optional().describe("Column count or CSS template. Default 2"),
|
|
1043
1023
|
minChildWidth: sizeValue.optional(),
|
|
1044
|
-
rows: zod.
|
|
1024
|
+
rows: zod.union([zod.number(), zod.string()]).optional()
|
|
1045
1025
|
});
|
|
1046
|
-
const gridItemSchema = zod.
|
|
1026
|
+
const gridItemSchema = zod.object({
|
|
1047
1027
|
...layoutProps,
|
|
1048
|
-
span: zod.
|
|
1049
|
-
rowSpan: zod.
|
|
1028
|
+
span: zod.number().optional(),
|
|
1029
|
+
rowSpan: zod.number().optional()
|
|
1050
1030
|
});
|
|
1051
|
-
const cardSchema = zod.
|
|
1031
|
+
const cardSchema = zod.object({
|
|
1052
1032
|
...layoutProps,
|
|
1053
|
-
variant: zod.
|
|
1033
|
+
variant: zod.enum([
|
|
1054
1034
|
"default",
|
|
1055
1035
|
"outline",
|
|
1056
1036
|
"section",
|
|
@@ -1058,44 +1038,44 @@ const cardSchema = zod.z.object({
|
|
|
1058
1038
|
"elevated",
|
|
1059
1039
|
"transparent"
|
|
1060
1040
|
]).optional(),
|
|
1061
|
-
shadowStyle: zod.
|
|
1041
|
+
shadowStyle: zod.enum([
|
|
1062
1042
|
"none",
|
|
1063
1043
|
"sm",
|
|
1064
1044
|
"md"
|
|
1065
1045
|
]).optional().describe("Overrides the shadow of the variant"),
|
|
1066
|
-
size: zod.
|
|
1046
|
+
size: zod.enum([
|
|
1067
1047
|
"sm",
|
|
1068
1048
|
"md",
|
|
1069
1049
|
"lg"
|
|
1070
1050
|
]).optional().describe("The padding preset: 8, 16 or 24px. Default \"md\"")
|
|
1071
1051
|
});
|
|
1072
|
-
const flowSchema = zod.
|
|
1052
|
+
const flowSchema = zod.object({
|
|
1073
1053
|
...layoutProps,
|
|
1074
|
-
columns: zod.
|
|
1075
|
-
rows: zod.
|
|
1076
|
-
layout: zod.
|
|
1054
|
+
columns: zod.number().optional(),
|
|
1055
|
+
rows: zod.number().optional(),
|
|
1056
|
+
layout: zod.enum(["pack", "fixed"]).optional().describe("Default \"pack\"")
|
|
1077
1057
|
});
|
|
1078
|
-
const flowItemSchema = zod.
|
|
1058
|
+
const flowItemSchema = zod.object({
|
|
1079
1059
|
...layoutProps,
|
|
1080
|
-
span: zod.
|
|
1081
|
-
rowSpan: zod.
|
|
1082
|
-
aspectRatio: zod.
|
|
1083
|
-
aspectMode: zod.
|
|
1060
|
+
span: zod.number().optional(),
|
|
1061
|
+
rowSpan: zod.number().optional(),
|
|
1062
|
+
aspectRatio: zod.string().optional().describe("Default \"1 / 1\""),
|
|
1063
|
+
aspectMode: zod.enum(["soft", "fixed"]).optional()
|
|
1084
1064
|
});
|
|
1085
|
-
const carouselSchema = zod.
|
|
1065
|
+
const carouselSchema = zod.object({
|
|
1086
1066
|
...layoutProps,
|
|
1087
|
-
label: zod.
|
|
1088
|
-
visibleItems: zod.
|
|
1089
|
-
showArrows: zod.
|
|
1090
|
-
activeIndex: zod.
|
|
1091
|
-
previousLabel: zod.
|
|
1092
|
-
nextLabel: zod.
|
|
1093
|
-
snap: zod.
|
|
1067
|
+
label: zod.string().optional().describe("A short name of the carousel for screen readers"),
|
|
1068
|
+
visibleItems: zod.number().optional(),
|
|
1069
|
+
showArrows: zod.boolean().optional().describe("Default true"),
|
|
1070
|
+
activeIndex: zod.number().optional().describe("The index of the slide in view. Bind it with { \"@path\": \"/x\" } to read or set it"),
|
|
1071
|
+
previousLabel: zod.string().optional().describe("Default \"Previous\""),
|
|
1072
|
+
nextLabel: zod.string().optional().describe("Default \"Next\""),
|
|
1073
|
+
snap: zod.enum([
|
|
1094
1074
|
"none",
|
|
1095
1075
|
"proximity",
|
|
1096
1076
|
"mandatory"
|
|
1097
1077
|
]).optional(),
|
|
1098
|
-
snapAlign: zod.
|
|
1078
|
+
snapAlign: zod.enum([
|
|
1099
1079
|
"start",
|
|
1100
1080
|
"center",
|
|
1101
1081
|
"end"
|
|
@@ -1106,31 +1086,31 @@ const CAROUSEL_MEDIA_SIZES = [
|
|
|
1106
1086
|
"md",
|
|
1107
1087
|
"lg"
|
|
1108
1088
|
];
|
|
1109
|
-
const carouselMediaItemSchema = zod.
|
|
1089
|
+
const carouselMediaItemSchema = zod.object({
|
|
1110
1090
|
...layoutProps,
|
|
1111
|
-
url: zod.
|
|
1112
|
-
description: zod.
|
|
1113
|
-
size: zod.
|
|
1114
|
-
aspectRatio: zod.
|
|
1115
|
-
href: zod.
|
|
1116
|
-
lightbox: zod.
|
|
1091
|
+
url: zod.string().describe("Image URL"),
|
|
1092
|
+
description: zod.string().optional().describe("What the image shows, for screen readers"),
|
|
1093
|
+
size: zod.enum(CAROUSEL_MEDIA_SIZES).optional().describe("The width: \"sm\" 160px, \"md\" 240px, \"lg\" 320px. Default \"md\""),
|
|
1094
|
+
aspectRatio: zod.string().optional().describe("Default \"4 / 3\""),
|
|
1095
|
+
href: zod.string().optional().describe("Opens this URL in a new tab"),
|
|
1096
|
+
lightbox: zod.boolean().optional().describe("Default true: a click opens all slides full-screen")
|
|
1117
1097
|
});
|
|
1118
|
-
const spacerSchema = zod.
|
|
1119
|
-
const tabsSchema = zod.
|
|
1120
|
-
tabs: zod.
|
|
1121
|
-
title: zod.
|
|
1098
|
+
const spacerSchema = zod.object({ minSize: sizeValue.optional() });
|
|
1099
|
+
const tabsSchema = zod.object({
|
|
1100
|
+
tabs: zod.array(zod.object({
|
|
1101
|
+
title: zod.string().describe("The tab title"),
|
|
1122
1102
|
child: child("The id of the panel component")
|
|
1123
1103
|
})).describe("One entry per tab"),
|
|
1124
|
-
selectedIndex: zod.
|
|
1104
|
+
selectedIndex: zod.number().optional().describe("The open tab. Default 0. Bind it with { \"@path\": \"/x\" } to read it"),
|
|
1125
1105
|
weight: weightProp
|
|
1126
1106
|
});
|
|
1127
|
-
const dividerSchema = zod.
|
|
1128
|
-
axis: zod.
|
|
1107
|
+
const dividerSchema = zod.object({
|
|
1108
|
+
axis: zod.enum(["horizontal", "vertical"]).optional().describe("Default \"horizontal\""),
|
|
1129
1109
|
weight: weightProp,
|
|
1130
|
-
color: zod.
|
|
1131
|
-
size: zod.
|
|
1110
|
+
color: zod.enum(BORDER_COLORS).optional(),
|
|
1111
|
+
size: zod.number().optional(),
|
|
1132
1112
|
spacing: sizeValue.optional(),
|
|
1133
|
-
flush: zod.
|
|
1113
|
+
flush: zod.boolean().optional()
|
|
1134
1114
|
});
|
|
1135
1115
|
const ALIGN_CSS$1 = {
|
|
1136
1116
|
start: "flex-start",
|
|
@@ -1347,6 +1327,7 @@ function cardShadow(props) {
|
|
|
1347
1327
|
case "md": return SHADOW_MD;
|
|
1348
1328
|
case "sm": return SHADOW_SM;
|
|
1349
1329
|
case "none": return "none";
|
|
1330
|
+
case void 0:
|
|
1350
1331
|
default: return props.variant === "elevated" ? SHADOW_SOFT : void 0;
|
|
1351
1332
|
}
|
|
1352
1333
|
}
|
|
@@ -1865,7 +1846,7 @@ const layoutComponents = {
|
|
|
1865
1846
|
},
|
|
1866
1847
|
Row: {
|
|
1867
1848
|
component: Row,
|
|
1868
|
-
description: "A horizontal flex container.
|
|
1849
|
+
description: "A horizontal flex container. Label and value pair: justify \"spaceBetween\", a Caption left and a Text with fontWeight \"medium\" right. Buttons go in a Row at the bottom of a Card: one variant \"primary\", the others default or \"borderless\".",
|
|
1869
1850
|
props: layoutSchema,
|
|
1870
1851
|
events: VISIBLE_EVENT,
|
|
1871
1852
|
slots: CHILDREN_SLOT
|
|
@@ -1886,7 +1867,7 @@ const layoutComponents = {
|
|
|
1886
1867
|
},
|
|
1887
1868
|
Card: {
|
|
1888
1869
|
component: Card,
|
|
1889
|
-
description: "A bordered
|
|
1870
|
+
description: "A bordered panel, only for an interactive panel (controls, a form, a configurator); tables, charts and text need none. Give it a Title and a Caption. Separate groups with a Divider or the gap, never a nested Card or bordered Box. Variant \"section\": no box; \"outline\": always a box. In markdown mode, without controls it renders as \"section\" unless variant or border is set.",
|
|
1890
1871
|
props: cardSchema,
|
|
1891
1872
|
events: VISIBLE_EVENT,
|
|
1892
1873
|
slots: {
|
|
@@ -1910,7 +1891,7 @@ const layoutComponents = {
|
|
|
1910
1891
|
},
|
|
1911
1892
|
Carousel: {
|
|
1912
1893
|
component: Carousel,
|
|
1913
|
-
description: "A row that
|
|
1894
|
+
description: "A horizontally scrolling row that snaps to its CarouselItem or CarouselMediaItem children, with arrows. Bind activeIndex to read or set the slide in view.",
|
|
1914
1895
|
props: carouselSchema,
|
|
1915
1896
|
events: VISIBLE_EVENT,
|
|
1916
1897
|
slots: CHILDREN_SLOT,
|
|
@@ -1925,7 +1906,7 @@ const layoutComponents = {
|
|
|
1925
1906
|
},
|
|
1926
1907
|
CarouselMediaItem: {
|
|
1927
1908
|
component: CarouselMediaItem,
|
|
1928
|
-
description: "A
|
|
1909
|
+
description: "A Carousel slide: an image with its children (a Caption, a Text) under it. size \"sm\" 160px, \"md\" 240px (default), \"lg\" 320px wide. A click opens all slides full-screen, unless href or onClick is set.",
|
|
1929
1910
|
props: carouselMediaItemSchema,
|
|
1930
1911
|
events: {
|
|
1931
1912
|
...VISIBLE_EVENT,
|
|
@@ -2113,18 +2094,18 @@ function Markdown({ text, streaming = false }) {
|
|
|
2113
2094
|
|
|
2114
2095
|
//#endregion
|
|
2115
2096
|
//#region src/generative-ui/standard/media.tsx
|
|
2116
|
-
const NO_ARGS$2 = zod.
|
|
2117
|
-
const colorProp$1 = zod.
|
|
2097
|
+
const NO_ARGS$2 = zod.object({});
|
|
2098
|
+
const colorProp$1 = zod.string().optional();
|
|
2118
2099
|
const ICON_SIZES = [
|
|
2119
2100
|
"sm",
|
|
2120
2101
|
"md",
|
|
2121
2102
|
"lg",
|
|
2122
2103
|
"xl"
|
|
2123
2104
|
];
|
|
2124
|
-
const imageSchema = zod.
|
|
2125
|
-
url: zod.
|
|
2126
|
-
description: zod.
|
|
2127
|
-
variant: zod.
|
|
2105
|
+
const imageSchema = zod.object({
|
|
2106
|
+
url: zod.string().describe("Image URL"),
|
|
2107
|
+
description: zod.string().optional().describe("What the image shows, for screen readers. Leave it unset only for a decorative image"),
|
|
2108
|
+
variant: zod.enum([
|
|
2128
2109
|
"icon",
|
|
2129
2110
|
"avatar",
|
|
2130
2111
|
"smallFeature",
|
|
@@ -2133,8 +2114,8 @@ const imageSchema = zod.z.object({
|
|
|
2133
2114
|
"header"
|
|
2134
2115
|
]).optional().describe("The size: \"icon\" 24px, \"avatar\" 40px round, \"smallFeature\" 160px wide, \"largeFeature\" and \"header\" full width. Default \"mediumFeature\": the natural size"),
|
|
2135
2116
|
weight: weightProp,
|
|
2136
|
-
aspectRatio: zod.
|
|
2137
|
-
fit: zod.
|
|
2117
|
+
aspectRatio: zod.string().optional(),
|
|
2118
|
+
fit: zod.enum([
|
|
2138
2119
|
"cover",
|
|
2139
2120
|
"contain",
|
|
2140
2121
|
"fill",
|
|
@@ -2148,128 +2129,128 @@ const imageSchema = zod.z.object({
|
|
|
2148
2129
|
maxHeight: sizeValue.optional(),
|
|
2149
2130
|
minWidth: sizeValue.optional(),
|
|
2150
2131
|
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.
|
|
2132
|
+
background: zod.string().optional(),
|
|
2133
|
+
frame: zod.boolean().optional(),
|
|
2134
|
+
position: zod.string().optional().describe("CSS object-position, for example \"top\" or \"50% 20%\""),
|
|
2135
|
+
hideOnFailure: zod.boolean().optional().describe("Default false"),
|
|
2136
|
+
fallback: zod.string().optional().describe("Text shown in place of the image when it does not load"),
|
|
2137
|
+
hoverZoom: zod.boolean().optional().describe("A slight zoom on hover"),
|
|
2138
|
+
lightbox: zod.boolean().optional().describe("Default true: a click opens the image full-screen"),
|
|
2139
|
+
actionOverlay: zod.object({
|
|
2140
|
+
label: zod.string(),
|
|
2141
|
+
icon: zod.string().optional().describe("Lucide icon name"),
|
|
2142
|
+
href: zod.string().optional().describe("Opens this URL in a new tab")
|
|
2162
2143
|
}).optional().describe("A button over the bottom-right corner of the image. Without href, it sends onOverlayClick")
|
|
2163
2144
|
});
|
|
2164
|
-
const iconSchema = zod.
|
|
2165
|
-
name: zod.
|
|
2166
|
-
label: zod.
|
|
2167
|
-
size: zod.
|
|
2145
|
+
const iconSchema = zod.object({
|
|
2146
|
+
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"),
|
|
2147
|
+
label: zod.string().optional().describe("What the icon means, for screen readers. Leave it unset when text next to the icon says the same"),
|
|
2148
|
+
size: zod.union([zod.enum(ICON_SIZES), zod.number()]).optional().describe("Default \"md\""),
|
|
2168
2149
|
color: colorProp$1,
|
|
2169
|
-
inline: zod.
|
|
2170
|
-
strokeWeight: zod.
|
|
2150
|
+
inline: zod.boolean().optional().describe("Default false"),
|
|
2151
|
+
strokeWeight: zod.enum(WEIGHTS).optional().describe("The stroke width"),
|
|
2171
2152
|
weight: weightProp
|
|
2172
2153
|
});
|
|
2173
|
-
const faviconSchema = zod.
|
|
2174
|
-
url: zod.
|
|
2175
|
-
alt: zod.
|
|
2176
|
-
size: zod.
|
|
2177
|
-
inline: zod.
|
|
2178
|
-
frame: zod.
|
|
2154
|
+
const faviconSchema = zod.object({
|
|
2155
|
+
url: zod.string(),
|
|
2156
|
+
alt: zod.string().optional(),
|
|
2157
|
+
size: zod.number().optional().describe("Pixels. Default 16"),
|
|
2158
|
+
inline: zod.boolean().optional().describe("Default false"),
|
|
2159
|
+
frame: zod.boolean().optional().describe("Default false")
|
|
2179
2160
|
});
|
|
2180
|
-
const svgSchema = zod.
|
|
2181
|
-
viewBox: zod.
|
|
2182
|
-
label: zod.
|
|
2161
|
+
const svgSchema = zod.object({
|
|
2162
|
+
viewBox: zod.string().optional(),
|
|
2163
|
+
label: zod.string().optional().describe("What the drawing shows, for screen readers. Leave it unset for a decorative drawing"),
|
|
2183
2164
|
width: sizeValue.optional(),
|
|
2184
2165
|
height: sizeValue.optional(),
|
|
2185
2166
|
size: sizeValue.optional(),
|
|
2186
2167
|
color: colorProp$1.describe("Default \"prose\""),
|
|
2187
2168
|
fill: colorProp$1.describe("Default \"currentColor\""),
|
|
2188
2169
|
stroke: colorProp$1,
|
|
2189
|
-
strokeWidth: zod.
|
|
2190
|
-
strokeLinecap: zod.
|
|
2170
|
+
strokeWidth: zod.number().optional(),
|
|
2171
|
+
strokeLinecap: zod.enum([
|
|
2191
2172
|
"butt",
|
|
2192
2173
|
"round",
|
|
2193
2174
|
"square"
|
|
2194
2175
|
]).optional(),
|
|
2195
|
-
strokeLinejoin: zod.
|
|
2176
|
+
strokeLinejoin: zod.enum([
|
|
2196
2177
|
"miter",
|
|
2197
2178
|
"round",
|
|
2198
2179
|
"bevel"
|
|
2199
2180
|
]).optional(),
|
|
2200
|
-
preserveAspectRatio: zod.
|
|
2201
|
-
paths: zod.
|
|
2202
|
-
d: zod.
|
|
2181
|
+
preserveAspectRatio: zod.string().optional(),
|
|
2182
|
+
paths: zod.array(zod.object({
|
|
2183
|
+
d: zod.string(),
|
|
2203
2184
|
fill: colorProp$1,
|
|
2204
2185
|
stroke: colorProp$1,
|
|
2205
|
-
strokeWidth: zod.
|
|
2186
|
+
strokeWidth: zod.number().optional()
|
|
2206
2187
|
})).optional(),
|
|
2207
|
-
circles: zod.
|
|
2208
|
-
cx: zod.
|
|
2209
|
-
cy: zod.
|
|
2210
|
-
r: zod.
|
|
2188
|
+
circles: zod.array(zod.object({
|
|
2189
|
+
cx: zod.number(),
|
|
2190
|
+
cy: zod.number(),
|
|
2191
|
+
r: zod.number(),
|
|
2211
2192
|
fill: colorProp$1,
|
|
2212
2193
|
stroke: colorProp$1
|
|
2213
2194
|
})).optional(),
|
|
2214
|
-
rects: zod.
|
|
2215
|
-
x: zod.
|
|
2216
|
-
y: zod.
|
|
2217
|
-
width: zod.
|
|
2218
|
-
height: zod.
|
|
2219
|
-
rx: zod.
|
|
2195
|
+
rects: zod.array(zod.object({
|
|
2196
|
+
x: zod.number(),
|
|
2197
|
+
y: zod.number(),
|
|
2198
|
+
width: zod.number(),
|
|
2199
|
+
height: zod.number(),
|
|
2200
|
+
rx: zod.number().optional(),
|
|
2220
2201
|
fill: colorProp$1,
|
|
2221
2202
|
stroke: colorProp$1
|
|
2222
2203
|
})).optional(),
|
|
2223
|
-
lines: zod.
|
|
2224
|
-
x1: zod.
|
|
2225
|
-
y1: zod.
|
|
2226
|
-
x2: zod.
|
|
2227
|
-
y2: zod.
|
|
2204
|
+
lines: zod.array(zod.object({
|
|
2205
|
+
x1: zod.number(),
|
|
2206
|
+
y1: zod.number(),
|
|
2207
|
+
x2: zod.number(),
|
|
2208
|
+
y2: zod.number(),
|
|
2228
2209
|
stroke: colorProp$1
|
|
2229
2210
|
})).optional(),
|
|
2230
|
-
texts: zod.
|
|
2231
|
-
x: zod.
|
|
2232
|
-
y: zod.
|
|
2233
|
-
text: zod.
|
|
2234
|
-
size: zod.
|
|
2211
|
+
texts: zod.array(zod.object({
|
|
2212
|
+
x: zod.number(),
|
|
2213
|
+
y: zod.number(),
|
|
2214
|
+
text: zod.string(),
|
|
2215
|
+
size: zod.number().optional(),
|
|
2235
2216
|
fill: colorProp$1,
|
|
2236
|
-
anchor: zod.
|
|
2217
|
+
anchor: zod.enum([
|
|
2237
2218
|
"start",
|
|
2238
2219
|
"middle",
|
|
2239
2220
|
"end"
|
|
2240
2221
|
]).optional()
|
|
2241
2222
|
})).optional()
|
|
2242
2223
|
});
|
|
2243
|
-
const captionTrack = zod.
|
|
2244
|
-
url: zod.
|
|
2245
|
-
language: zod.
|
|
2246
|
-
label: zod.
|
|
2247
|
-
kind: zod.
|
|
2224
|
+
const captionTrack = zod.object({
|
|
2225
|
+
url: zod.string().describe("The URL of a WebVTT file"),
|
|
2226
|
+
language: zod.string().optional().describe("BCP 47, for example \"en\""),
|
|
2227
|
+
label: zod.string().optional().describe("Shown in the captions menu"),
|
|
2228
|
+
kind: zod.enum([
|
|
2248
2229
|
"subtitles",
|
|
2249
2230
|
"captions",
|
|
2250
2231
|
"descriptions"
|
|
2251
2232
|
]).optional()
|
|
2252
2233
|
});
|
|
2253
|
-
const videoSchema = zod.
|
|
2254
|
-
url: zod.
|
|
2255
|
-
posterUrl: zod.
|
|
2256
|
-
title: zod.
|
|
2257
|
-
captions: zod.
|
|
2258
|
-
aspectRatio: zod.
|
|
2234
|
+
const videoSchema = zod.object({
|
|
2235
|
+
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"),
|
|
2236
|
+
posterUrl: zod.string().optional().describe("The image shown before the video plays"),
|
|
2237
|
+
title: zod.string().optional().describe("Names the video for screen readers"),
|
|
2238
|
+
captions: zod.array(captionTrack).optional().describe("Caption tracks of a video file"),
|
|
2239
|
+
aspectRatio: zod.string().optional().describe("Default \"16 / 9\""),
|
|
2259
2240
|
width: sizeValue.optional().describe("Default \"100%\""),
|
|
2260
2241
|
maxWidth: sizeValue.optional().describe("Default \"100%\""),
|
|
2261
2242
|
weight: weightProp
|
|
2262
2243
|
});
|
|
2263
|
-
const audioPlayerSchema = zod.
|
|
2264
|
-
url: zod.
|
|
2265
|
-
description: zod.
|
|
2244
|
+
const audioPlayerSchema = zod.object({
|
|
2245
|
+
url: zod.string().describe("The URL of the audio file"),
|
|
2246
|
+
description: zod.string().optional().describe("A title or summary of the audio, shown above the player"),
|
|
2266
2247
|
weight: weightProp
|
|
2267
2248
|
});
|
|
2268
|
-
const htmlViewSchema = zod.
|
|
2269
|
-
html: zod.
|
|
2249
|
+
const htmlViewSchema = zod.object({
|
|
2250
|
+
html: zod.string(),
|
|
2270
2251
|
height: sizeValue.optional().describe("Pixels when a number. Default 360"),
|
|
2271
2252
|
width: sizeValue.optional().describe("Default \"100%\""),
|
|
2272
|
-
title: zod.
|
|
2253
|
+
title: zod.string().optional()
|
|
2273
2254
|
});
|
|
2274
2255
|
/** Pixels when a number, raw CSS when a string. */
|
|
2275
2256
|
function px$1(value) {
|
|
@@ -2292,10 +2273,14 @@ const ICON_STROKE = {
|
|
|
2292
2273
|
function kebabToPascal(name) {
|
|
2293
2274
|
return name.split(/[-_\s]+/).filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
|
|
2294
2275
|
}
|
|
2276
|
+
/** "ArrowRight" gives "arrow-right", as Lucide names its icon classes. */
|
|
2277
|
+
function pascalToKebab(name) {
|
|
2278
|
+
return name.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
2279
|
+
}
|
|
2295
2280
|
let lucidePromise = null;
|
|
2296
2281
|
let lucideIcons = null;
|
|
2297
2282
|
function loadLucideIcons() {
|
|
2298
|
-
lucidePromise ??= import("lucide
|
|
2283
|
+
lucidePromise ??= import("lucide").then((module) => {
|
|
2299
2284
|
const icons = module.icons;
|
|
2300
2285
|
lucideIcons = icons;
|
|
2301
2286
|
return icons;
|
|
@@ -2303,9 +2288,9 @@ function loadLucideIcons() {
|
|
|
2303
2288
|
return lucidePromise;
|
|
2304
2289
|
}
|
|
2305
2290
|
/**
|
|
2306
|
-
*
|
|
2307
|
-
*
|
|
2308
|
-
*
|
|
2291
|
+
* Lucide has about 1,500 icons. A static import of its `icons` map puts all
|
|
2292
|
+
* of them in every bundle and makes module load slow. So the map loads once,
|
|
2293
|
+
* on first use, and the icons show when it is there.
|
|
2309
2294
|
*/
|
|
2310
2295
|
function useLucideIcons() {
|
|
2311
2296
|
const [icons, setIcons] = (0, react.useState)(lucideIcons);
|
|
@@ -2321,6 +2306,20 @@ function useLucideIcons() {
|
|
|
2321
2306
|
}, []);
|
|
2322
2307
|
return icons;
|
|
2323
2308
|
}
|
|
2309
|
+
/** The icon for a kebab-case or PascalCase name, or `null` when there is none. */
|
|
2310
|
+
function findLucideIcon(icons, name) {
|
|
2311
|
+
const pascalName = kebabToPascal(name);
|
|
2312
|
+
const key = pascalName in icons ? pascalName : name in icons ? name : null;
|
|
2313
|
+
if (key === null) return null;
|
|
2314
|
+
const nodes = icons[key].map(([tag, attributes]) => ({
|
|
2315
|
+
tag,
|
|
2316
|
+
attributes
|
|
2317
|
+
}));
|
|
2318
|
+
return {
|
|
2319
|
+
lucideName: pascalToKebab(key),
|
|
2320
|
+
nodes
|
|
2321
|
+
};
|
|
2322
|
+
}
|
|
2324
2323
|
/**
|
|
2325
2324
|
* A lucide icon by kebab-case (or PascalCase) name. An unknown name renders
|
|
2326
2325
|
* nothing. Without a `label`, the icon is hidden from screen readers.
|
|
@@ -2333,18 +2332,20 @@ function useLucideIcons() {
|
|
|
2333
2332
|
function LucideIcon({ name, label, description, size = "md", color, weight, inline, style }) {
|
|
2334
2333
|
const icons = useLucideIcons();
|
|
2335
2334
|
if (!name || !icons) return null;
|
|
2336
|
-
const
|
|
2337
|
-
if (!
|
|
2335
|
+
const icon = findLucideIcon(icons, name);
|
|
2336
|
+
if (!icon) return null;
|
|
2338
2337
|
const pixels = typeof size === "number" ? size : inline ? "1em" : ICON_PX$1[size];
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2338
|
+
const a11y = label === void 0 ? { "aria-hidden": true } : {
|
|
2339
|
+
role: "img",
|
|
2340
|
+
"aria-label": label,
|
|
2341
|
+
"aria-description": description
|
|
2342
|
+
};
|
|
2343
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_MarkdownSurfaces.IconSvg, {
|
|
2344
|
+
lucideName: icon.lucideName,
|
|
2345
|
+
nodes: icon.nodes,
|
|
2346
|
+
...a11y,
|
|
2345
2347
|
focusable: "false",
|
|
2346
|
-
|
|
2347
|
-
height: pixels,
|
|
2348
|
+
size: pixels,
|
|
2348
2349
|
color: textColor(color) ?? "currentColor",
|
|
2349
2350
|
strokeWidth: weight ? ICON_STROKE[weight] : void 0,
|
|
2350
2351
|
style: {
|
|
@@ -3000,7 +3001,7 @@ const mediaComponents = {
|
|
|
3000
3001
|
},
|
|
3001
3002
|
Video: {
|
|
3002
3003
|
component: Video,
|
|
3003
|
-
description: "A video
|
|
3004
|
+
description: "A video file URL (optional captions) or a YouTube link, privacy-enhanced: the poster shows until play. Other video sites show as a link. Set title.",
|
|
3004
3005
|
props: videoSchema
|
|
3005
3006
|
},
|
|
3006
3007
|
AudioPlayer: {
|
|
@@ -3023,33 +3024,33 @@ const mediaComponents = {
|
|
|
3023
3024
|
* grids). Each one is a single component, so the model places it with one
|
|
3024
3025
|
* object instead of eight primitives.
|
|
3025
3026
|
*/
|
|
3026
|
-
const NO_ARGS$1 = zod.
|
|
3027
|
-
const text = (description) => zod.
|
|
3028
|
-
const linkCardSchema = zod.
|
|
3029
|
-
href: zod.
|
|
3030
|
-
title: zod.
|
|
3027
|
+
const NO_ARGS$1 = zod.object({});
|
|
3028
|
+
const text = (description) => zod.string().optional().describe(description);
|
|
3029
|
+
const linkCardSchema = zod.object({
|
|
3030
|
+
href: zod.string().describe("The URL (http, https)"),
|
|
3031
|
+
title: zod.string().describe("The page title"),
|
|
3031
3032
|
description: text("One or two lines"),
|
|
3032
3033
|
image: text("A thumbnail URL"),
|
|
3033
3034
|
domain: text("Shown next to the favicon. Default: the host of href"),
|
|
3034
|
-
favicon: zod.
|
|
3035
|
+
favicon: zod.boolean().optional().describe("Default true")
|
|
3035
3036
|
});
|
|
3036
|
-
const citationSchema = zod.
|
|
3037
|
-
index: zod.
|
|
3037
|
+
const citationSchema = zod.object({
|
|
3038
|
+
index: zod.number().optional().describe("The marker number. Default 1"),
|
|
3038
3039
|
label: text("Marker text instead of the number, for example a domain"),
|
|
3039
3040
|
title: text("The source title"),
|
|
3040
3041
|
url: text("The source URL (http, https)"),
|
|
3041
3042
|
snippet: text("The quoted passage, one or two lines"),
|
|
3042
3043
|
source: text("The publisher or domain. Default: the host of url")
|
|
3043
3044
|
});
|
|
3044
|
-
const followUpItem = zod.
|
|
3045
|
-
label: zod.
|
|
3045
|
+
const followUpItem = zod.union([zod.string(), zod.object({
|
|
3046
|
+
label: zod.string(),
|
|
3046
3047
|
message: text("The text sent when the user clicks. Default: label")
|
|
3047
3048
|
})]);
|
|
3048
|
-
const followUpSchema = zod.
|
|
3049
|
-
items: zod.
|
|
3049
|
+
const followUpSchema = zod.object({
|
|
3050
|
+
items: zod.array(followUpItem).optional(),
|
|
3050
3051
|
title: text("A caption above the pills")
|
|
3051
3052
|
});
|
|
3052
|
-
const followUpArgs = zod.
|
|
3053
|
+
const followUpArgs = zod.object({ message: zod.string().describe("The message of the clicked pill") });
|
|
3053
3054
|
const BADGE_COLORS = [
|
|
3054
3055
|
"secondary",
|
|
3055
3056
|
"success",
|
|
@@ -3058,47 +3059,47 @@ const BADGE_COLORS = [
|
|
|
3058
3059
|
"info",
|
|
3059
3060
|
"discovery"
|
|
3060
3061
|
];
|
|
3061
|
-
const cardAction = zod.
|
|
3062
|
-
label: zod.
|
|
3062
|
+
const cardAction = zod.object({
|
|
3063
|
+
label: zod.string(),
|
|
3063
3064
|
href: text("Opens this URL in a new tab"),
|
|
3064
|
-
variant: zod.
|
|
3065
|
+
variant: zod.enum([
|
|
3065
3066
|
"solid",
|
|
3066
3067
|
"soft",
|
|
3067
3068
|
"outline",
|
|
3068
3069
|
"ghost"
|
|
3069
3070
|
]).optional()
|
|
3070
3071
|
});
|
|
3071
|
-
const entityCardSchema = zod.
|
|
3072
|
-
title: zod.
|
|
3072
|
+
const entityCardSchema = zod.object({
|
|
3073
|
+
title: zod.string().describe("The name"),
|
|
3073
3074
|
subtitle: text("A second line, for example the brand or category"),
|
|
3074
3075
|
description: text("Up to three lines"),
|
|
3075
3076
|
image: text("An image URL"),
|
|
3076
|
-
imageAspectRatio: zod.
|
|
3077
|
+
imageAspectRatio: zod.string().optional().describe("Default \"4 / 3\""),
|
|
3077
3078
|
meta: text("A short fact line, for example \"$29 / month\" or \"Open until 22:00\""),
|
|
3078
|
-
badge: zod.
|
|
3079
|
-
label: zod.
|
|
3080
|
-
color: zod.
|
|
3079
|
+
badge: zod.object({
|
|
3080
|
+
label: zod.string(),
|
|
3081
|
+
color: zod.enum(BADGE_COLORS).optional()
|
|
3081
3082
|
}).optional(),
|
|
3082
|
-
rating: zod.
|
|
3083
|
-
ratingCount: zod.
|
|
3083
|
+
rating: zod.number().optional().describe("0 to 5, shown as stars"),
|
|
3084
|
+
ratingCount: zod.number().optional().describe("The number of ratings"),
|
|
3084
3085
|
href: text("Opens this URL in a new tab when the user clicks the card"),
|
|
3085
|
-
actions: zod.
|
|
3086
|
-
layout: zod.
|
|
3086
|
+
actions: zod.array(cardAction).max(3).optional().describe("Up to three buttons. A button without href sends onAction with its label"),
|
|
3087
|
+
layout: zod.enum(["vertical", "horizontal"]).optional().describe("Default \"vertical\". \"horizontal\" puts the image on the left"),
|
|
3087
3088
|
width: sizeValue.optional()
|
|
3088
3089
|
});
|
|
3089
|
-
const entityActionArgs = zod.
|
|
3090
|
-
const gridImage = zod.
|
|
3091
|
-
url: zod.
|
|
3092
|
-
description: zod.
|
|
3093
|
-
caption: zod.
|
|
3090
|
+
const entityActionArgs = zod.object({ label: zod.string().describe("The label of the clicked button") });
|
|
3091
|
+
const gridImage = zod.object({
|
|
3092
|
+
url: zod.string(),
|
|
3093
|
+
description: zod.string().optional().describe("What the image shows"),
|
|
3094
|
+
caption: zod.string().optional(),
|
|
3094
3095
|
href: text("Opens this URL instead of the full-screen view")
|
|
3095
3096
|
});
|
|
3096
|
-
const imageGridSchema = zod.
|
|
3097
|
-
images: zod.
|
|
3098
|
-
columns: zod.
|
|
3099
|
-
aspectRatio: zod.
|
|
3097
|
+
const imageGridSchema = zod.object({
|
|
3098
|
+
images: zod.array(gridImage).optional(),
|
|
3099
|
+
columns: zod.number().optional().describe("Default 3"),
|
|
3100
|
+
aspectRatio: zod.string().optional().describe("Default \"1 / 1\""),
|
|
3100
3101
|
gap: sizeValue.optional().describe("Default 2"),
|
|
3101
|
-
layout: zod.
|
|
3102
|
+
layout: zod.enum(["grid", "bento"]).optional().describe("Default \"grid\". \"bento\" makes the first image twice as large")
|
|
3102
3103
|
});
|
|
3103
3104
|
function FaviconImage({ host, size = 16 }) {
|
|
3104
3105
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
|
|
@@ -3674,7 +3675,7 @@ function ImageGrid(props) {
|
|
|
3674
3675
|
const compositeComponents = {
|
|
3675
3676
|
LinkCard: {
|
|
3676
3677
|
component: LinkCard,
|
|
3677
|
-
description: "A preview
|
|
3678
|
+
description: "A preview of a URL: favicon and domain, title, description, thumbnail. A click opens it in a new tab, or sends onClick when bound. For sources, articles and products with a page.",
|
|
3678
3679
|
props: linkCardSchema,
|
|
3679
3680
|
events: { onClick: {
|
|
3680
3681
|
description: "Sent when the user clicks the card, instead of the link.",
|
|
@@ -3683,12 +3684,12 @@ const compositeComponents = {
|
|
|
3683
3684
|
},
|
|
3684
3685
|
Citation: {
|
|
3685
3686
|
component: Citation,
|
|
3686
|
-
description: "An inline source marker ([1])
|
|
3687
|
+
description: "An inline source marker ([1]) showing title, snippet and link on hover or click. Put it right after the sentence it supports, as a child of a Text or in a Row.",
|
|
3687
3688
|
props: citationSchema
|
|
3688
3689
|
},
|
|
3689
3690
|
FollowUp: {
|
|
3690
3691
|
component: FollowUp,
|
|
3691
|
-
description: "Suggested next prompts as pills
|
|
3692
|
+
description: "Suggested next prompts as pills; a click sends the pill's message as the user's next turn, no event needed. At the end of a surface, two to four short items.",
|
|
3692
3693
|
props: followUpSchema,
|
|
3693
3694
|
events: { onFollowUp: {
|
|
3694
3695
|
description: "Sent when the user clicks a pill. The args carry the message of the pill.",
|
|
@@ -3697,7 +3698,7 @@ const compositeComponents = {
|
|
|
3697
3698
|
},
|
|
3698
3699
|
EntityCard: {
|
|
3699
3700
|
component: EntityCard,
|
|
3700
|
-
description: "A card for one
|
|
3701
|
+
description: "A card for one product, place, person or listing: image, title, subtitle, description, a price or meta line, badge, rating and up to three buttons. href opens a page; onClick is sent when bound. Use a Grid of them for several things.",
|
|
3701
3702
|
props: entityCardSchema,
|
|
3702
3703
|
events: {
|
|
3703
3704
|
onClick: {
|
|
@@ -3719,13 +3720,13 @@ const compositeComponents = {
|
|
|
3719
3720
|
|
|
3720
3721
|
//#endregion
|
|
3721
3722
|
//#region src/generative-ui/standard/Chart.tsx
|
|
3722
|
-
const chartSeries = zod.
|
|
3723
|
-
key: zod.
|
|
3724
|
-
label: zod.
|
|
3725
|
-
color: zod.
|
|
3723
|
+
const chartSeries = zod.union([zod.string(), zod.object({
|
|
3724
|
+
key: zod.string(),
|
|
3725
|
+
label: zod.string().optional(),
|
|
3726
|
+
color: zod.string().optional().describe("A text color token or a CSS color")
|
|
3726
3727
|
})]);
|
|
3727
|
-
const chartSchema = zod.
|
|
3728
|
-
chartType: zod.
|
|
3728
|
+
const chartSchema = zod.object({
|
|
3729
|
+
chartType: zod.enum([
|
|
3729
3730
|
"bar",
|
|
3730
3731
|
"line",
|
|
3731
3732
|
"area",
|
|
@@ -3733,38 +3734,38 @@ const chartSchema = zod.z.object({
|
|
|
3733
3734
|
"pie",
|
|
3734
3735
|
"donut"
|
|
3735
3736
|
]).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.
|
|
3746
|
-
}).optional().describe("
|
|
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.
|
|
3737
|
+
data: zod.array(zod.record(zod.string(), zod.unknown())).optional(),
|
|
3738
|
+
xKey: zod.string().optional().describe("The field of the category axis"),
|
|
3739
|
+
series: zod.array(chartSeries).optional().describe("Default: every number field except xKey"),
|
|
3740
|
+
stacked: zod.boolean().optional(),
|
|
3741
|
+
layout: zod.enum(["vertical", "horizontal"]).optional().describe("\"horizontal\" draws the bars from left to right. Default \"vertical\""),
|
|
3742
|
+
yAxis: zod.object({
|
|
3743
|
+
label: zod.string().optional(),
|
|
3744
|
+
min: zod.number().optional(),
|
|
3745
|
+
max: zod.number().optional(),
|
|
3746
|
+
width: zod.number().optional().describe("Pixels")
|
|
3747
|
+
}).optional().describe("Example: {label: \"Revenue (USD)\", min: 0, max: 100}. In a horizontal chart it is the horizontal axis, and width sets the category axis width"),
|
|
3748
|
+
showDots: zod.boolean().optional().describe("Point markers on a line or area"),
|
|
3749
|
+
barRadius: zod.number().optional().describe("The corner radius of a bar, in pixels"),
|
|
3750
|
+
innerRadius: zod.union([zod.number(), zod.string()]).optional().describe("Pie and donut"),
|
|
3751
|
+
outerRadius: zod.union([zod.number(), zod.string()]).optional().describe("Pie and donut"),
|
|
3752
|
+
startAngle: zod.number().optional().describe("Pie and donut. Default 90"),
|
|
3753
|
+
endAngle: zod.number().optional().describe("Pie and donut. Default -270"),
|
|
3754
|
+
cornerRadius: zod.number().optional().describe("The corners of a slice"),
|
|
3755
|
+
paddingAngle: zod.number().optional().describe("The gap between slices"),
|
|
3756
|
+
showLabelLines: zod.boolean().optional().describe("Leader lines of the slice labels. Default true"),
|
|
3757
|
+
height: zod.number().optional().describe("Pixels. Default 240"),
|
|
3758
|
+
showLegend: zod.boolean().optional().describe("Default true"),
|
|
3759
|
+
showGrid: zod.boolean().optional().describe("Default true"),
|
|
3760
|
+
showTooltip: zod.boolean().optional().describe("Default true"),
|
|
3761
|
+
showValueLabels: zod.boolean().optional(),
|
|
3762
|
+
format: zod.enum([
|
|
3762
3763
|
"number",
|
|
3763
3764
|
"currency",
|
|
3764
3765
|
"percent"
|
|
3765
|
-
]).optional().describe("
|
|
3766
|
-
currency: zod.
|
|
3767
|
-
title: zod.
|
|
3766
|
+
]).optional().describe("With \"percent\", data values and axis min/max are fractions: 0.4 shows as 40%; for 0% to 10%, use min: 0 and max: 0.1."),
|
|
3767
|
+
currency: zod.string().optional().describe("ISO code. Default \"USD\""),
|
|
3768
|
+
title: zod.string().optional()
|
|
3768
3769
|
});
|
|
3769
3770
|
const DEFAULT_HEIGHT = 240;
|
|
3770
3771
|
/** Hides an element on screen. Screen readers still read it. */
|
|
@@ -4168,22 +4169,22 @@ function Chart(props) {
|
|
|
4168
4169
|
|
|
4169
4170
|
//#endregion
|
|
4170
4171
|
//#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.
|
|
4172
|
+
const mapMarker = zod.object({
|
|
4173
|
+
label: zod.string(),
|
|
4174
|
+
lat: zod.number(),
|
|
4175
|
+
lng: zod.number(),
|
|
4176
|
+
category: zod.string().optional(),
|
|
4177
|
+
icon: zod.string().optional()
|
|
4177
4178
|
});
|
|
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.
|
|
4179
|
+
const mapSchema = zod.object({
|
|
4180
|
+
markers: zod.array(mapMarker).optional(),
|
|
4181
|
+
route: zod.boolean().optional().describe("Draws a line through the markers in order"),
|
|
4182
|
+
selected: zod.string().optional().describe("The label of the selected marker. Bind it with { \"@path\": \"/x\" } to read the choice of the user"),
|
|
4183
|
+
height: zod.number().optional().describe("Pixels. Default 240"),
|
|
4184
|
+
zoom: zod.number().optional().describe("With two or more markers, only the highest zoom of the fit"),
|
|
4185
|
+
center: zod.object({
|
|
4186
|
+
lat: zod.number(),
|
|
4187
|
+
lng: zod.number()
|
|
4187
4188
|
}).optional()
|
|
4188
4189
|
});
|
|
4189
4190
|
/**
|
|
@@ -4482,7 +4483,7 @@ function MapView(props) {
|
|
|
4482
4483
|
|
|
4483
4484
|
//#endregion
|
|
4484
4485
|
//#region src/generative-ui/standard/data.tsx
|
|
4485
|
-
const cellAlign = zod.
|
|
4486
|
+
const cellAlign = zod.enum([
|
|
4486
4487
|
"start",
|
|
4487
4488
|
"center",
|
|
4488
4489
|
"end"
|
|
@@ -4491,85 +4492,85 @@ const cellAlign = zod.z.enum([
|
|
|
4491
4492
|
* A table cell or column header that shows another component. `id` is an
|
|
4492
4493
|
* alias of `componentId`.
|
|
4493
4494
|
*/
|
|
4494
|
-
const tableComponentCell = zod.
|
|
4495
|
-
const tableColumn = zod.
|
|
4496
|
-
zod.
|
|
4497
|
-
zod.
|
|
4498
|
-
label: zod.
|
|
4495
|
+
const tableComponentCell = zod.union([zod.object({ componentId: zod.string() }), zod.object({ id: zod.string() })]);
|
|
4496
|
+
const tableColumn = zod.union([
|
|
4497
|
+
zod.string(),
|
|
4498
|
+
zod.object({
|
|
4499
|
+
label: zod.string(),
|
|
4499
4500
|
align: cellAlign,
|
|
4500
4501
|
width: sizeValue.optional(),
|
|
4501
|
-
componentId: zod.
|
|
4502
|
+
componentId: zod.string().optional()
|
|
4502
4503
|
}),
|
|
4503
4504
|
tableComponentCell
|
|
4504
4505
|
]);
|
|
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.
|
|
4506
|
+
const tableSchema = zod.object({
|
|
4507
|
+
caption: zod.string().optional().describe("A short name of the table for screen readers. It is not shown"),
|
|
4508
|
+
columns: zod.array(tableColumn).optional().describe("Default []"),
|
|
4509
|
+
rows: zod.array(zod.array(zod.unknown())).optional().describe("A list of row lists. A cell is a string, a number, or { \"componentId\": \"<id>\" } to show a component. Default []"),
|
|
4510
|
+
columnSizing: zod.enum(["auto", "equal"]).optional().describe("Default \"auto\""),
|
|
4511
|
+
dividers: zod.boolean().optional().describe("Default true"),
|
|
4512
|
+
stickyHeader: zod.boolean().optional().describe("Default false"),
|
|
4513
|
+
emptyLabel: zod.string().optional().describe("Default \"No rows\"")
|
|
4513
4514
|
});
|
|
4514
|
-
const tableSectionSchema = zod.
|
|
4515
|
-
header: zod.
|
|
4516
|
-
rowDivider: zod.
|
|
4515
|
+
const tableSectionSchema = zod.object({
|
|
4516
|
+
header: zod.boolean().optional().describe("Renders the rows as the header"),
|
|
4517
|
+
rowDivider: zod.boolean().optional()
|
|
4517
4518
|
});
|
|
4518
|
-
const tableRowSchema = zod.
|
|
4519
|
-
header: zod.
|
|
4520
|
-
label: zod.
|
|
4521
|
-
labelColSpan: zod.
|
|
4519
|
+
const tableRowSchema = zod.object({
|
|
4520
|
+
header: zod.boolean().optional(),
|
|
4521
|
+
label: zod.string().optional().describe("The text of a header cell at the start of the row"),
|
|
4522
|
+
labelColSpan: zod.number().optional().describe("Columns the label cell spans")
|
|
4522
4523
|
});
|
|
4523
|
-
const tableCellSchema = zod.
|
|
4524
|
-
text: zod.
|
|
4525
|
-
header: zod.
|
|
4524
|
+
const tableCellSchema = zod.object({
|
|
4525
|
+
text: zod.union([zod.string(), zod.number()]).optional(),
|
|
4526
|
+
header: zod.boolean().optional(),
|
|
4526
4527
|
align: cellAlign,
|
|
4527
4528
|
vAlign: cellAlign.describe("Default \"start\""),
|
|
4528
|
-
colSpan: zod.
|
|
4529
|
-
rowSpan: zod.
|
|
4529
|
+
colSpan: zod.number().optional(),
|
|
4530
|
+
rowSpan: zod.number().optional(),
|
|
4530
4531
|
width: sizeValue.optional(),
|
|
4531
4532
|
padding: sizeValue.optional()
|
|
4532
4533
|
});
|
|
4533
|
-
const listItemValue = zod.
|
|
4534
|
-
label: zod.
|
|
4535
|
-
description: zod.
|
|
4536
|
-
icon: zod.
|
|
4537
|
-
value: zod.
|
|
4534
|
+
const listItemValue = zod.union([zod.string(), zod.object({
|
|
4535
|
+
label: zod.string(),
|
|
4536
|
+
description: zod.string().optional(),
|
|
4537
|
+
icon: zod.string().optional().describe("Lucide icon name"),
|
|
4538
|
+
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
4539
|
})]);
|
|
4539
|
-
const listSchema = zod.
|
|
4540
|
-
items: zod.
|
|
4541
|
-
direction: zod.
|
|
4542
|
-
align: zod.
|
|
4540
|
+
const listSchema = zod.object({
|
|
4541
|
+
items: zod.array(listItemValue).optional(),
|
|
4542
|
+
direction: zod.enum(["vertical", "horizontal"]).optional().describe("Default \"vertical\". \"horizontal\" scrolls sideways"),
|
|
4543
|
+
align: zod.enum([
|
|
4543
4544
|
"start",
|
|
4544
4545
|
"center",
|
|
4545
4546
|
"end",
|
|
4546
4547
|
"stretch"
|
|
4547
4548
|
]).optional(),
|
|
4548
4549
|
weight: weightProp,
|
|
4549
|
-
marker: zod.
|
|
4550
|
+
marker: zod.enum([
|
|
4550
4551
|
"bullet",
|
|
4551
4552
|
"number",
|
|
4552
4553
|
"rich",
|
|
4553
4554
|
"none"
|
|
4554
4555
|
]).optional().describe("Default \"bullet\""),
|
|
4555
|
-
connector: zod.
|
|
4556
|
+
connector: zod.enum(["none", "solid"]).optional().describe("Default \"none\""),
|
|
4556
4557
|
gap: sizeValue.optional(),
|
|
4557
|
-
start: zod.
|
|
4558
|
-
maxMarkerSize: zod.
|
|
4558
|
+
start: zod.number().optional().describe("The first number of marker \"number\""),
|
|
4559
|
+
maxMarkerSize: zod.number().optional().describe("The width of the marker column in pixels")
|
|
4559
4560
|
});
|
|
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.
|
|
4561
|
+
const listItemSchema = zod.object({
|
|
4562
|
+
label: zod.string().optional(),
|
|
4563
|
+
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"),
|
|
4564
|
+
description: zod.string().optional(),
|
|
4565
|
+
icon: zod.string().optional().describe("Lucide icon name"),
|
|
4566
|
+
marker: zod.string().optional().describe("Shows this text as the marker"),
|
|
4567
|
+
markerSize: zod.number().optional().describe("The width of the marker column in pixels"),
|
|
4568
|
+
disabled: zod.boolean().optional().describe("Greys the item out and ignores its action")
|
|
4568
4569
|
});
|
|
4569
|
-
const listSelection = zod.
|
|
4570
|
-
index: zod.
|
|
4571
|
-
label: zod.
|
|
4572
|
-
value: zod.
|
|
4570
|
+
const listSelection = zod.object({
|
|
4571
|
+
index: zod.number(),
|
|
4572
|
+
label: zod.string(),
|
|
4573
|
+
value: zod.string().optional()
|
|
4573
4574
|
});
|
|
4574
4575
|
const TableContext = (0, react.createContext)(null);
|
|
4575
4576
|
const V_ALIGN = {
|
|
@@ -4991,7 +4992,7 @@ function ListItem(props) {
|
|
|
4991
4992
|
const dataComponents = {
|
|
4992
4993
|
Table: {
|
|
4993
4994
|
component: Table,
|
|
4994
|
-
description: "A data table
|
|
4995
|
+
description: "A data table, in a plain Column, not a Card. Give \"columns\" and \"rows\", or \"children\": TableSection or TableRow ids, or a template { \"componentId\", \"path\" } repeating a TableRow per item. A component in a cell or header (Badge, Button, Icon, Text): { \"componentId\": \"<id>\" }, with the id in \"cellComponents\".",
|
|
4995
4996
|
props: tableSchema,
|
|
4996
4997
|
slots: {
|
|
4997
4998
|
children: "multiple",
|
|
@@ -5021,7 +5022,7 @@ const dataComponents = {
|
|
|
5021
5022
|
},
|
|
5022
5023
|
List: {
|
|
5023
5024
|
component: List,
|
|
5024
|
-
description: "A list in a Card or next to another component
|
|
5025
|
+
description: "A list in a Card or next to another component; a plain list of text is markdown. Give \"items\": an item with a value and no action is a key-value row (Price: $1,599). Or give \"children\": ListItem ids or a template. With \"action\" the user picks an item; the event context gets its index, label and value.",
|
|
5025
5026
|
props: listSchema,
|
|
5026
5027
|
events: { action: {
|
|
5027
5028
|
description: "Runs when the user picks an item. The args are the index, label and value of the item.",
|
|
@@ -5035,7 +5036,7 @@ const dataComponents = {
|
|
|
5035
5036
|
props: listItemSchema,
|
|
5036
5037
|
events: { action: {
|
|
5037
5038
|
description: "Runs when the user picks the item.",
|
|
5038
|
-
parameters: zod.
|
|
5039
|
+
parameters: zod.object({})
|
|
5039
5040
|
} },
|
|
5040
5041
|
slots: CHILDREN_SLOT
|
|
5041
5042
|
},
|
|
@@ -5046,7 +5047,7 @@ const dataComponents = {
|
|
|
5046
5047
|
},
|
|
5047
5048
|
Map: {
|
|
5048
5049
|
component: MapView,
|
|
5049
|
-
description: "A map with markers
|
|
5050
|
+
description: "A map with markers; with \"route\" a line connects them in order. Bind \"selected\" to get the label of the marker the user picks. Without maps it shows a list of the places.",
|
|
5050
5051
|
props: mapSchema,
|
|
5051
5052
|
writable: ["selected"]
|
|
5052
5053
|
}
|
|
@@ -5092,35 +5093,35 @@ const BUTTON_RESET = {
|
|
|
5092
5093
|
textAlign: "inherit",
|
|
5093
5094
|
cursor: "pointer"
|
|
5094
5095
|
};
|
|
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.
|
|
5096
|
+
const pulseIndicatorSchema = zod.object({
|
|
5097
|
+
label: zod.string().optional().describe("What the dot means, for screen readers. Leave it unset when text next to the dot says the same"),
|
|
5098
|
+
color: zod.string().optional().describe("Text color token. Default \"success\""),
|
|
5099
|
+
size: zod.number().optional().describe("Pixels. Default 12"),
|
|
5100
|
+
pulseColor: zod.string().optional(),
|
|
5101
|
+
duration: zod.number().optional().describe("Milliseconds. Default 1500"),
|
|
5102
|
+
endScale: zod.number().optional().describe("Default 2.4"),
|
|
5103
|
+
startOpacity: zod.number().optional().describe("Default 0.6")
|
|
5103
5104
|
});
|
|
5104
|
-
const flashcardSchema = zod.
|
|
5105
|
-
front: zod.
|
|
5106
|
-
back: zod.
|
|
5107
|
-
hint: zod.
|
|
5105
|
+
const flashcardSchema = zod.object({
|
|
5106
|
+
front: zod.string().optional().describe("The text on the front"),
|
|
5107
|
+
back: zod.string().optional().describe("The text on the back"),
|
|
5108
|
+
hint: zod.string().optional().describe("A small line under the front, for example \"Click to flip\"")
|
|
5108
5109
|
});
|
|
5109
|
-
const popoverSchema = zod.
|
|
5110
|
-
open: zod.
|
|
5111
|
-
showOnHover: zod.
|
|
5112
|
-
hoverOpenDelay: zod.
|
|
5110
|
+
const popoverSchema = zod.object({
|
|
5111
|
+
open: zod.boolean().optional().describe("Default false"),
|
|
5112
|
+
showOnHover: zod.boolean().optional(),
|
|
5113
|
+
hoverOpenDelay: zod.number().optional().describe("Milliseconds before a hover opens it. Default 0")
|
|
5113
5114
|
});
|
|
5114
|
-
const popoverTriggerSchema = zod.
|
|
5115
|
-
const popoverContentSchema = zod.
|
|
5116
|
-
side: zod.
|
|
5115
|
+
const popoverTriggerSchema = zod.object({ block: zod.boolean().optional().describe("Full width") });
|
|
5116
|
+
const popoverContentSchema = zod.object({
|
|
5117
|
+
side: zod.enum([
|
|
5117
5118
|
"top",
|
|
5118
5119
|
"bottom",
|
|
5119
5120
|
"left",
|
|
5120
5121
|
"right"
|
|
5121
5122
|
]).optional().describe("Default \"bottom\""),
|
|
5122
|
-
sideOffset: zod.
|
|
5123
|
-
align: zod.
|
|
5123
|
+
sideOffset: zod.number().optional().describe("Pixels between the trigger and the content. Default 6"),
|
|
5124
|
+
align: zod.enum([
|
|
5124
5125
|
"start",
|
|
5125
5126
|
"center",
|
|
5126
5127
|
"end"
|
|
@@ -5384,9 +5385,9 @@ function PopoverContent(props) {
|
|
|
5384
5385
|
children: props.children
|
|
5385
5386
|
});
|
|
5386
5387
|
}
|
|
5387
|
-
const modalSchema = zod.
|
|
5388
|
-
title: zod.
|
|
5389
|
-
open: zod.
|
|
5388
|
+
const modalSchema = zod.object({
|
|
5389
|
+
title: zod.string().optional().describe("The heading of the dialog"),
|
|
5390
|
+
open: zod.boolean().optional().describe("Default false. Bind it with { \"@path\": \"/x\" } to read it"),
|
|
5390
5391
|
maxWidth: sizeValue.optional().describe("Default 480"),
|
|
5391
5392
|
weight: weightProp
|
|
5392
5393
|
});
|
|
@@ -5602,7 +5603,7 @@ const feedbackComponents = {
|
|
|
5602
5603
|
},
|
|
5603
5604
|
Popover: {
|
|
5604
5605
|
component: Popover,
|
|
5605
|
-
description: "A small overlay
|
|
5606
|
+
description: "A small overlay: exactly two children, one PopoverTrigger then one PopoverContent. A click on the trigger toggles it; Escape or a click outside closes it.",
|
|
5606
5607
|
props: popoverSchema,
|
|
5607
5608
|
slots: CHILDREN_SLOT,
|
|
5608
5609
|
writable: ["open"]
|
|
@@ -5640,20 +5641,20 @@ const feedbackComponents = {
|
|
|
5640
5641
|
* The engine resolves the condition before the component renders, so a
|
|
5641
5642
|
* component sees a boolean or a `ValidationResult`.
|
|
5642
5643
|
*/
|
|
5643
|
-
const severity = zod.
|
|
5644
|
+
const severity = zod.enum([
|
|
5644
5645
|
"error",
|
|
5645
5646
|
"warning",
|
|
5646
5647
|
"info"
|
|
5647
5648
|
]);
|
|
5648
|
-
const validationResult = zod.
|
|
5649
|
-
valid: zod.
|
|
5650
|
-
message: zod.
|
|
5651
|
-
code: zod.
|
|
5649
|
+
const validationResult = zod.object({
|
|
5650
|
+
valid: zod.boolean(),
|
|
5651
|
+
message: zod.string().optional(),
|
|
5652
|
+
code: zod.string().optional(),
|
|
5652
5653
|
severity: severity.optional()
|
|
5653
|
-
}).
|
|
5654
|
-
const checksProp = zod.
|
|
5655
|
-
condition: zod.
|
|
5656
|
-
message: zod.
|
|
5654
|
+
}).loose();
|
|
5655
|
+
const checksProp = zod.array(zod.object({
|
|
5656
|
+
condition: zod.union([zod.boolean(), validationResult]).optional().describe("A validator call, for example {\"@call\":\"required\",\"args\":{\"value\":{\"@path\":\"/x\"}}}, or a boolean binding"),
|
|
5657
|
+
message: zod.string().optional().describe("Shown when the check fails, instead of the default message")
|
|
5657
5658
|
})).optional().describe("Validation rules. The control shows the first failed one");
|
|
5658
5659
|
/**
|
|
5659
5660
|
* The failed check to show, or `undefined` when every check passes: the
|
|
@@ -5730,73 +5731,73 @@ async function copyText(text) {
|
|
|
5730
5731
|
* The arguments of a click or submit event: none. The model adds values
|
|
5731
5732
|
* with the `context` of its `{ "event": ... }` binding.
|
|
5732
5733
|
*/
|
|
5733
|
-
const NO_ARGS = zod.
|
|
5734
|
+
const NO_ARGS = zod.object({});
|
|
5734
5735
|
/** A list of choices: plain strings or `{ value, label, description? }`. */
|
|
5735
|
-
const optionList = zod.
|
|
5736
|
-
value: zod.
|
|
5737
|
-
label: zod.
|
|
5738
|
-
description: zod.
|
|
5739
|
-
})])).optional()
|
|
5736
|
+
const optionList = zod.array(zod.union([zod.string(), zod.object({
|
|
5737
|
+
value: zod.string(),
|
|
5738
|
+
label: zod.string().optional(),
|
|
5739
|
+
description: zod.string().optional()
|
|
5740
|
+
})])).optional();
|
|
5740
5741
|
const SIZES = [
|
|
5741
5742
|
"sm",
|
|
5742
5743
|
"md",
|
|
5743
5744
|
"lg",
|
|
5744
5745
|
"xl"
|
|
5745
5746
|
];
|
|
5746
|
-
const size = (fallback) => zod.
|
|
5747
|
-
const pill = zod.
|
|
5748
|
-
const fieldLabel = zod.
|
|
5749
|
-
const boundValue = zod.
|
|
5750
|
-
const buttonSchema = zod.
|
|
5751
|
-
label: zod.
|
|
5747
|
+
const size = (fallback) => zod.enum(SIZES).optional().describe(`Default "${fallback}"`);
|
|
5748
|
+
const pill = zod.boolean().optional().describe("Default true");
|
|
5749
|
+
const fieldLabel = zod.string().optional().describe("The visible label of the field. Always set it");
|
|
5750
|
+
const boundValue = zod.string().optional().describe("Bind it with { \"@path\": \"/x\" } to read what the user entered");
|
|
5751
|
+
const buttonSchema = zod.object({
|
|
5752
|
+
label: zod.string().optional().describe("The button text"),
|
|
5752
5753
|
checks: checksProp,
|
|
5753
|
-
text: zod.
|
|
5754
|
-
variant: zod.
|
|
5754
|
+
text: zod.string().optional().describe("Same as label. Used when label is not set"),
|
|
5755
|
+
variant: zod.enum([
|
|
5755
5756
|
"default",
|
|
5756
5757
|
"primary",
|
|
5757
5758
|
"soft",
|
|
5758
5759
|
"borderless"
|
|
5759
5760
|
]).optional().describe("Default \"default\": outlined. \"primary\" is filled, for the one main action. \"borderless\" has no box, like a link"),
|
|
5760
|
-
color: zod.
|
|
5761
|
+
color: zod.enum([
|
|
5761
5762
|
"primary",
|
|
5762
5763
|
"secondary",
|
|
5763
5764
|
"danger"
|
|
5764
5765
|
]).optional().describe("Default \"primary\""),
|
|
5765
|
-
size: zod.
|
|
5766
|
+
size: zod.enum([
|
|
5766
5767
|
"sm",
|
|
5767
5768
|
"md",
|
|
5768
5769
|
"lg"
|
|
5769
5770
|
]).optional().describe("Default \"lg\""),
|
|
5770
|
-
block: zod.
|
|
5771
|
+
block: zod.boolean().optional().describe("Full width"),
|
|
5771
5772
|
weight: weightProp,
|
|
5772
5773
|
pill,
|
|
5773
|
-
disabled: zod.
|
|
5774
|
-
loading: zod.
|
|
5775
|
-
submit: zod.
|
|
5776
|
-
icon: zod.
|
|
5777
|
-
uniform: zod.
|
|
5778
|
-
href: zod.
|
|
5779
|
-
copy: zod.
|
|
5774
|
+
disabled: zod.boolean().optional(),
|
|
5775
|
+
loading: zod.boolean().optional(),
|
|
5776
|
+
submit: zod.boolean().optional().describe("Submits the Form around it. The Form sends its onSubmit event"),
|
|
5777
|
+
icon: zod.string().optional().describe("Lucide icon name"),
|
|
5778
|
+
uniform: zod.boolean().optional().describe("A square button, for an icon"),
|
|
5779
|
+
href: zod.string().optional().describe("Opens this URL in a new tab on click, instead of onClick"),
|
|
5780
|
+
copy: zod.string().optional().describe("Copies this text to the clipboard on click and shows a check mark, instead of onClick")
|
|
5780
5781
|
});
|
|
5781
|
-
const pressableSchema = zod.
|
|
5782
|
+
const pressableSchema = zod.object({
|
|
5782
5783
|
...layoutProps,
|
|
5783
|
-
disabled: zod.
|
|
5784
|
-
hoverBackground: zod.
|
|
5785
|
-
href: zod.
|
|
5786
|
-
tooltip: zod.
|
|
5787
|
-
ariaPressed: zod.
|
|
5788
|
-
insetBorder: zod.
|
|
5784
|
+
disabled: zod.boolean().optional(),
|
|
5785
|
+
hoverBackground: zod.string().optional(),
|
|
5786
|
+
href: zod.string().optional().describe("Opens this URL in a new tab on click, instead of onClick"),
|
|
5787
|
+
tooltip: zod.string().optional().describe("Shown on hover"),
|
|
5788
|
+
ariaPressed: zod.boolean().optional().describe("For a toggle"),
|
|
5789
|
+
insetBorder: zod.boolean().optional().describe("A 1px border inside the box")
|
|
5789
5790
|
});
|
|
5790
|
-
const formSchema = zod.
|
|
5791
|
+
const formSchema = zod.object({
|
|
5791
5792
|
...layoutProps,
|
|
5792
|
-
label: zod.
|
|
5793
|
+
label: zod.string().optional().describe("A short name of the form for screen readers")
|
|
5793
5794
|
});
|
|
5794
|
-
const textFieldSchema = zod.
|
|
5795
|
+
const textFieldSchema = zod.object({
|
|
5795
5796
|
checks: checksProp,
|
|
5796
|
-
value: zod.
|
|
5797
|
-
placeholder: zod.
|
|
5797
|
+
value: zod.union([zod.string(), zod.number()]).optional().describe("Bind it with { \"@path\": \"/x\" } to read what the user typed"),
|
|
5798
|
+
placeholder: zod.string().optional(),
|
|
5798
5799
|
label: fieldLabel,
|
|
5799
|
-
variant: zod.
|
|
5800
|
+
variant: zod.enum([
|
|
5800
5801
|
"shortText",
|
|
5801
5802
|
"longText",
|
|
5802
5803
|
"number",
|
|
@@ -5806,140 +5807,140 @@ const textFieldSchema = zod.z.object({
|
|
|
5806
5807
|
"tel"
|
|
5807
5808
|
]).optional().describe("Default \"shortText\". \"longText\" is a multi-line field, \"obscured\" a password"),
|
|
5808
5809
|
weight: weightProp,
|
|
5809
|
-
name: zod.
|
|
5810
|
-
required: zod.
|
|
5811
|
-
disabled: zod.
|
|
5812
|
-
invalid: zod.
|
|
5810
|
+
name: zod.string().optional(),
|
|
5811
|
+
required: zod.boolean().optional(),
|
|
5812
|
+
disabled: zod.boolean().optional(),
|
|
5813
|
+
invalid: zod.boolean().optional(),
|
|
5813
5814
|
size: size("xl"),
|
|
5814
5815
|
pill,
|
|
5815
|
-
autoSelect: zod.
|
|
5816
|
-
mask: zod.
|
|
5816
|
+
autoSelect: zod.boolean().optional(),
|
|
5817
|
+
mask: zod.string().optional()
|
|
5817
5818
|
});
|
|
5818
|
-
const textAreaSchema = zod.
|
|
5819
|
+
const textAreaSchema = zod.object({
|
|
5819
5820
|
checks: checksProp,
|
|
5820
5821
|
value: boundValue,
|
|
5821
|
-
placeholder: zod.
|
|
5822
|
+
placeholder: zod.string().optional(),
|
|
5822
5823
|
label: fieldLabel,
|
|
5823
5824
|
weight: weightProp,
|
|
5824
|
-
rows: zod.
|
|
5825
|
-
maxRows: zod.
|
|
5826
|
-
autoResize: zod.
|
|
5827
|
-
name: zod.
|
|
5828
|
-
required: zod.
|
|
5829
|
-
disabled: zod.
|
|
5830
|
-
invalid: zod.
|
|
5825
|
+
rows: zod.number().optional().describe("Default 3"),
|
|
5826
|
+
maxRows: zod.number().optional(),
|
|
5827
|
+
autoResize: zod.boolean().optional(),
|
|
5828
|
+
name: zod.string().optional(),
|
|
5829
|
+
required: zod.boolean().optional(),
|
|
5830
|
+
disabled: zod.boolean().optional(),
|
|
5831
|
+
invalid: zod.boolean().optional(),
|
|
5831
5832
|
size: size("xl")
|
|
5832
5833
|
});
|
|
5833
|
-
const selectSchema = zod.
|
|
5834
|
+
const selectSchema = zod.object({
|
|
5834
5835
|
checks: checksProp,
|
|
5835
5836
|
value: boundValue,
|
|
5836
5837
|
options: optionList,
|
|
5837
|
-
placeholder: zod.
|
|
5838
|
+
placeholder: zod.string().optional(),
|
|
5838
5839
|
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.
|
|
5840
|
+
name: zod.string().optional(),
|
|
5841
|
+
required: zod.boolean().optional(),
|
|
5842
|
+
disabled: zod.boolean().optional(),
|
|
5843
|
+
clearable: zod.boolean().optional(),
|
|
5844
|
+
clearLabel: zod.string().optional().describe("The label of the empty option"),
|
|
5845
|
+
searchable: zod.boolean().optional(),
|
|
5846
|
+
icon: zod.string().optional().describe("Lucide icon shown before the value"),
|
|
5847
|
+
block: zod.boolean().optional().describe("Full width"),
|
|
5847
5848
|
size: size("xl"),
|
|
5848
5849
|
pill
|
|
5849
5850
|
});
|
|
5850
|
-
const checkBoxSchema = zod.
|
|
5851
|
+
const checkBoxSchema = zod.object({
|
|
5851
5852
|
checks: checksProp,
|
|
5852
|
-
value: zod.
|
|
5853
|
-
label: zod.
|
|
5854
|
-
name: zod.
|
|
5853
|
+
value: zod.boolean().optional().describe("True when checked. Bind it with { \"@path\": \"/x\" } to read the state of the box"),
|
|
5854
|
+
label: zod.string().optional().describe("The label text. Always set it"),
|
|
5855
|
+
name: zod.string().optional(),
|
|
5855
5856
|
weight: weightProp,
|
|
5856
|
-
disabled: zod.
|
|
5857
|
-
required: zod.
|
|
5858
|
-
lineThrough: zod.
|
|
5859
|
-
shape: zod.
|
|
5857
|
+
disabled: zod.boolean().optional(),
|
|
5858
|
+
required: zod.boolean().optional(),
|
|
5859
|
+
lineThrough: zod.boolean().optional().describe("Default false. Strikes the label when the box is checked"),
|
|
5860
|
+
shape: zod.enum(["round", "square"]).optional().describe("Default \"round\"")
|
|
5860
5861
|
});
|
|
5861
|
-
const radioSchema = zod.
|
|
5862
|
-
value: zod.
|
|
5863
|
-
label: zod.
|
|
5864
|
-
disabled: zod.
|
|
5865
|
-
required: zod.
|
|
5862
|
+
const radioSchema = zod.object({
|
|
5863
|
+
value: zod.string().optional(),
|
|
5864
|
+
label: zod.string().optional(),
|
|
5865
|
+
disabled: zod.boolean().optional(),
|
|
5866
|
+
required: zod.boolean().optional()
|
|
5866
5867
|
});
|
|
5867
|
-
const radioGroupSchema = zod.
|
|
5868
|
+
const radioGroupSchema = zod.object({
|
|
5868
5869
|
checks: checksProp,
|
|
5869
5870
|
value: boundValue,
|
|
5870
5871
|
options: optionList,
|
|
5871
5872
|
label: fieldLabel,
|
|
5872
|
-
name: zod.
|
|
5873
|
-
direction: zod.
|
|
5874
|
-
variant: zod.
|
|
5873
|
+
name: zod.string().optional(),
|
|
5874
|
+
direction: zod.enum(["row", "col"]).optional().describe("Default \"row\""),
|
|
5875
|
+
variant: zod.enum([
|
|
5875
5876
|
"list",
|
|
5876
5877
|
"pills",
|
|
5877
5878
|
"cards"
|
|
5878
5879
|
]).optional(),
|
|
5879
|
-
disabled: zod.
|
|
5880
|
-
required: zod.
|
|
5880
|
+
disabled: zod.boolean().optional(),
|
|
5881
|
+
required: zod.boolean().optional()
|
|
5881
5882
|
});
|
|
5882
|
-
const sliderSchema = zod.
|
|
5883
|
+
const sliderSchema = zod.object({
|
|
5883
5884
|
checks: checksProp,
|
|
5884
|
-
value: zod.
|
|
5885
|
-
min: zod.
|
|
5886
|
-
max: zod.
|
|
5887
|
-
step: zod.
|
|
5888
|
-
steps: zod.
|
|
5885
|
+
value: zod.number().optional().describe("Bind it with { \"@path\": \"/x\" } to read the number"),
|
|
5886
|
+
min: zod.number().optional().describe("Default 0"),
|
|
5887
|
+
max: zod.number().optional().describe("Default 100"),
|
|
5888
|
+
step: zod.number().optional().describe("Default 1"),
|
|
5889
|
+
steps: zod.number().int().min(1).optional().describe("The number of equal divisions between min and max, instead of step"),
|
|
5889
5890
|
label: fieldLabel,
|
|
5890
5891
|
weight: weightProp,
|
|
5891
|
-
unit: zod.
|
|
5892
|
-
marks: zod.
|
|
5893
|
-
value: zod.
|
|
5894
|
-
label: zod.
|
|
5892
|
+
unit: zod.string().optional().describe("Unit after the value, for example \"%\""),
|
|
5893
|
+
marks: zod.array(zod.object({
|
|
5894
|
+
value: zod.number(),
|
|
5895
|
+
label: zod.string().optional()
|
|
5895
5896
|
})).optional(),
|
|
5896
|
-
sliderStyle: zod.
|
|
5897
|
-
disabled: zod.
|
|
5898
|
-
name: zod.
|
|
5897
|
+
sliderStyle: zod.enum(["continuous", "discrete"]).optional().describe("Default \"continuous\""),
|
|
5898
|
+
disabled: zod.boolean().optional(),
|
|
5899
|
+
name: zod.string().optional()
|
|
5899
5900
|
});
|
|
5900
|
-
const segmentedControlSchema = zod.
|
|
5901
|
+
const segmentedControlSchema = zod.object({
|
|
5901
5902
|
checks: checksProp,
|
|
5902
5903
|
value: boundValue,
|
|
5903
5904
|
options: optionList,
|
|
5904
5905
|
label: fieldLabel,
|
|
5905
|
-
block: zod.
|
|
5906
|
+
block: zod.boolean().optional().describe("Full width"),
|
|
5906
5907
|
size: size("lg"),
|
|
5907
5908
|
pill,
|
|
5908
|
-
variant: zod.
|
|
5909
|
+
variant: zod.enum([
|
|
5909
5910
|
"solid",
|
|
5910
5911
|
"soft",
|
|
5911
5912
|
"outline",
|
|
5912
5913
|
"ghost"
|
|
5913
5914
|
]).optional().describe("Default \"ghost\""),
|
|
5914
|
-
disabled: zod.
|
|
5915
|
+
disabled: zod.boolean().optional()
|
|
5915
5916
|
});
|
|
5916
|
-
const choicePickerSchema = zod.
|
|
5917
|
+
const choicePickerSchema = zod.object({
|
|
5917
5918
|
checks: checksProp,
|
|
5918
|
-
value: zod.
|
|
5919
|
+
value: zod.array(zod.string()).optional().describe("The chosen option values. Bind it with { \"@path\": \"/x\" } to a string list"),
|
|
5919
5920
|
options: optionList,
|
|
5920
5921
|
label: fieldLabel,
|
|
5921
|
-
variant: zod.
|
|
5922
|
-
displayStyle: zod.
|
|
5923
|
-
filterable: zod.
|
|
5922
|
+
variant: zod.enum(["multipleSelection", "mutuallyExclusive"]).optional().describe("Default \"mutuallyExclusive\": the user picks one option"),
|
|
5923
|
+
displayStyle: zod.enum(["checkbox", "chips"]).optional().describe("Default \"checkbox\". \"chips\" shows the options as pills"),
|
|
5924
|
+
filterable: zod.boolean().optional().describe("Default false. Shows a field that filters the options"),
|
|
5924
5925
|
weight: weightProp,
|
|
5925
|
-
disabled: zod.
|
|
5926
|
-
required: zod.
|
|
5926
|
+
disabled: zod.boolean().optional(),
|
|
5927
|
+
required: zod.boolean().optional()
|
|
5927
5928
|
});
|
|
5928
|
-
const dateTimeInputSchema = zod.
|
|
5929
|
+
const dateTimeInputSchema = zod.object({
|
|
5929
5930
|
checks: checksProp,
|
|
5930
|
-
value: zod.
|
|
5931
|
+
value: zod.string().optional().describe("ISO 8601: \"YYYY-MM-DD\", \"HH:MM\" or \"YYYY-MM-DDTHH:MM\". Bind it with { \"@path\": \"/x\" }"),
|
|
5931
5932
|
label: fieldLabel,
|
|
5932
|
-
enableDate: zod.
|
|
5933
|
-
enableTime: zod.
|
|
5934
|
-
timeStep: zod.
|
|
5933
|
+
enableDate: zod.boolean().optional().describe("The user picks a date. Default true unless only enableTime is set"),
|
|
5934
|
+
enableTime: zod.boolean().optional().describe("The user picks a time"),
|
|
5935
|
+
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
5936
|
weight: weightProp,
|
|
5936
|
-
min: zod.
|
|
5937
|
-
max: zod.
|
|
5938
|
-
placeholder: zod.
|
|
5939
|
-
disabled: zod.
|
|
5940
|
-
required: zod.
|
|
5941
|
-
clearable: zod.
|
|
5942
|
-
block: zod.
|
|
5937
|
+
min: zod.string().optional().describe("The earliest value, ISO 8601"),
|
|
5938
|
+
max: zod.string().optional().describe("The latest value, ISO 8601"),
|
|
5939
|
+
placeholder: zod.string().optional(),
|
|
5940
|
+
disabled: zod.boolean().optional(),
|
|
5941
|
+
required: zod.boolean().optional(),
|
|
5942
|
+
clearable: zod.boolean().optional(),
|
|
5943
|
+
block: zod.boolean().optional().describe("Full width")
|
|
5943
5944
|
});
|
|
5944
5945
|
/** The writable list of a control that keeps its state in `value`. */
|
|
5945
5946
|
const VALUE_WRITABLE = ["value"];
|
|
@@ -6351,7 +6352,7 @@ function dateTimeMode(props) {
|
|
|
6351
6352
|
/** The date and the time of an ISO 8601 value: a date, a time, or both. */
|
|
6352
6353
|
function splitDateTime(value) {
|
|
6353
6354
|
const [head, tail] = value.split("T");
|
|
6354
|
-
if (tail !== void 0) return {
|
|
6355
|
+
if (head !== void 0 && tail !== void 0) return {
|
|
6355
6356
|
date: head,
|
|
6356
6357
|
time: tail
|
|
6357
6358
|
};
|
|
@@ -6412,7 +6413,7 @@ function fullTime(time) {
|
|
|
6412
6413
|
}
|
|
6413
6414
|
/** The minute of the day of a time, rounded up to a whole minute. */
|
|
6414
6415
|
function timeToMinute(time) {
|
|
6415
|
-
const [hours, minutes, seconds] = fullTime(time).split(":").map(Number);
|
|
6416
|
+
const [hours = NaN, minutes = NaN, seconds = NaN] = fullTime(time).split(":").map(Number);
|
|
6416
6417
|
return hours * 60 + minutes + (seconds > 0 ? 1 : 0);
|
|
6417
6418
|
}
|
|
6418
6419
|
/**
|
|
@@ -7038,8 +7039,10 @@ function SegmentedControl(props) {
|
|
|
7038
7039
|
const onKeyDown = (event, index) => {
|
|
7039
7040
|
const next = nextOptionIndex(event.key, index, options.length);
|
|
7040
7041
|
if (next === void 0) return;
|
|
7042
|
+
const option = options[next];
|
|
7043
|
+
if (option === void 0) return;
|
|
7041
7044
|
event.preventDefault();
|
|
7042
|
-
props.setValue(
|
|
7045
|
+
props.setValue(option.value);
|
|
7043
7046
|
segments.current[next]?.focus();
|
|
7044
7047
|
};
|
|
7045
7048
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
|
|
@@ -7188,7 +7191,7 @@ function Slider(props) {
|
|
|
7188
7191
|
const inputComponents = {
|
|
7189
7192
|
Button: {
|
|
7190
7193
|
component: Button,
|
|
7191
|
-
description: "
|
|
7194
|
+
description: "Sends its onClick event; with href it opens the URL, with copy it copies the text. Variant \"primary\" for the one main Button in a Row. submit true submits the Form around it. Its children render instead of the label. With checks it is disabled while a check fails.",
|
|
7192
7195
|
props: buttonSchema,
|
|
7193
7196
|
events: { onClick: {
|
|
7194
7197
|
description: "Sent when the user clicks the button.",
|
|
@@ -7214,7 +7217,7 @@ const inputComponents = {
|
|
|
7214
7217
|
},
|
|
7215
7218
|
Form: {
|
|
7216
7219
|
component: Form,
|
|
7217
|
-
description: "A layout container that is a form. It sends
|
|
7220
|
+
description: "A layout container that is a form. It sends onSubmit when the user submits (a Button with submit true, or Enter in a field). Put its field values in the event context with { \"@path\": \"/x\" }.",
|
|
7218
7221
|
props: formSchema,
|
|
7219
7222
|
events: { onSubmit: {
|
|
7220
7223
|
description: "Sent when the user submits the form.",
|
|
@@ -7271,13 +7274,13 @@ const inputComponents = {
|
|
|
7271
7274
|
},
|
|
7272
7275
|
ChoicePicker: {
|
|
7273
7276
|
component: ChoicePicker,
|
|
7274
|
-
description: "
|
|
7277
|
+
description: "Options as checkboxes or chips: pick one, or several with variant \"multipleSelection\". Its value is the list of chosen values. Give it a label.",
|
|
7275
7278
|
props: choicePickerSchema,
|
|
7276
7279
|
writable: VALUE_WRITABLE
|
|
7277
7280
|
},
|
|
7278
7281
|
DateTimeInput: {
|
|
7279
7282
|
component: DateTimeInput,
|
|
7280
|
-
description: "A date picker,
|
|
7283
|
+
description: "A date picker, a time picker with enableTime, or both. timeStep (minutes) offers fixed times, e.g. 30 for a booking. The value is ISO 8601. Give it a label.",
|
|
7281
7284
|
props: dateTimeInputSchema,
|
|
7282
7285
|
writable: VALUE_WRITABLE
|
|
7283
7286
|
}
|
|
@@ -7285,9 +7288,9 @@ const inputComponents = {
|
|
|
7285
7288
|
|
|
7286
7289
|
//#endregion
|
|
7287
7290
|
//#region src/generative-ui/standard/text.tsx
|
|
7288
|
-
const colorProp = zod.
|
|
7289
|
-
const fontWeight = zod.
|
|
7290
|
-
const textAlign = zod.
|
|
7291
|
+
const colorProp = zod.string().optional().describe(`One of ${TEXT_COLORS.join("|")} or a CSS color`);
|
|
7292
|
+
const fontWeight = zod.enum(WEIGHTS).optional();
|
|
7293
|
+
const textAlign = zod.enum([
|
|
7291
7294
|
"start",
|
|
7292
7295
|
"center",
|
|
7293
7296
|
"end"
|
|
@@ -7296,70 +7299,70 @@ const typographyProps = {
|
|
|
7296
7299
|
color: colorProp,
|
|
7297
7300
|
fontWeight,
|
|
7298
7301
|
textAlign,
|
|
7299
|
-
italic: zod.
|
|
7300
|
-
truncate: zod.
|
|
7301
|
-
maxLines: zod.
|
|
7302
|
-
tabularNums: zod.
|
|
7302
|
+
italic: zod.boolean().optional(),
|
|
7303
|
+
truncate: zod.boolean().optional(),
|
|
7304
|
+
maxLines: zod.number().optional(),
|
|
7305
|
+
tabularNums: zod.boolean().optional(),
|
|
7303
7306
|
width: sizeValue.optional()
|
|
7304
7307
|
};
|
|
7305
|
-
zod.
|
|
7306
|
-
const titleSchema = zod.
|
|
7308
|
+
zod.object(typographyProps);
|
|
7309
|
+
const titleSchema = zod.object({
|
|
7307
7310
|
...typographyProps,
|
|
7308
|
-
text: zod.
|
|
7309
|
-
size: zod.
|
|
7310
|
-
strong: zod.
|
|
7311
|
+
text: zod.string().describe("Heading text"),
|
|
7312
|
+
size: zod.enum(TITLE_SIZES).optional().describe("Default \"md\""),
|
|
7313
|
+
strong: zod.boolean().optional().describe("Default true")
|
|
7311
7314
|
});
|
|
7312
|
-
const textSchema = zod.
|
|
7315
|
+
const textSchema = zod.object({
|
|
7313
7316
|
...typographyProps,
|
|
7314
7317
|
weight: weightProp,
|
|
7315
|
-
text: zod.
|
|
7316
|
-
size: zod.
|
|
7318
|
+
text: zod.union([zod.string(), zod.number()]).optional().describe("Text with inline markdown. A bound number shows as text"),
|
|
7319
|
+
size: zod.enum(TEXT_SIZES).optional().describe("Default \"md\""),
|
|
7317
7320
|
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.
|
|
7321
|
+
lineHeight: zod.union([zod.number(), zod.string()]).optional().describe("A unitless ratio, or CSS"),
|
|
7322
|
+
minLines: zod.number().optional().describe("Reserves the height of this many lines"),
|
|
7323
|
+
strong: zod.boolean().optional().describe("Default false"),
|
|
7324
|
+
underline: zod.boolean().optional(),
|
|
7325
|
+
lineThrough: zod.boolean().optional(),
|
|
7326
|
+
inline: zod.boolean().optional(),
|
|
7327
|
+
preserveWhitespace: zod.boolean().optional(),
|
|
7328
|
+
highlight: zod.union([zod.enum([
|
|
7326
7329
|
"green",
|
|
7327
7330
|
"orange",
|
|
7328
7331
|
"pink"
|
|
7329
|
-
]), zod.
|
|
7332
|
+
]), zod.boolean()]).optional()
|
|
7330
7333
|
});
|
|
7331
|
-
const captionSchema = zod.
|
|
7332
|
-
text: zod.
|
|
7334
|
+
const captionSchema = zod.object({
|
|
7335
|
+
text: zod.union([zod.string(), zod.number()]).describe("Caption text"),
|
|
7333
7336
|
color: colorProp,
|
|
7334
|
-
size: zod.
|
|
7337
|
+
size: zod.enum([
|
|
7335
7338
|
"sm",
|
|
7336
7339
|
"md",
|
|
7337
7340
|
"lg"
|
|
7338
7341
|
]).optional().describe("Default \"lg\""),
|
|
7339
7342
|
fontWeight: fontWeight.describe("Default \"normal\""),
|
|
7340
7343
|
textAlign,
|
|
7341
|
-
truncate: zod.
|
|
7342
|
-
maxLines: zod.
|
|
7344
|
+
truncate: zod.boolean().optional(),
|
|
7345
|
+
maxLines: zod.number().optional()
|
|
7343
7346
|
});
|
|
7344
|
-
const labelSchema = zod.
|
|
7345
|
-
text: zod.
|
|
7346
|
-
htmlFor: zod.
|
|
7347
|
+
const labelSchema = zod.object({
|
|
7348
|
+
text: zod.union([zod.string(), zod.number()]).describe("Label text"),
|
|
7349
|
+
htmlFor: zod.string().optional(),
|
|
7347
7350
|
color: colorProp,
|
|
7348
|
-
size: zod.
|
|
7351
|
+
size: zod.enum(TEXT_SIZES).optional().describe("Default \"sm\""),
|
|
7349
7352
|
fontWeight: fontWeight.describe("Default \"medium\""),
|
|
7350
7353
|
textAlign,
|
|
7351
|
-
truncate: zod.
|
|
7354
|
+
truncate: zod.boolean().optional(),
|
|
7352
7355
|
width: sizeValue.optional()
|
|
7353
7356
|
});
|
|
7354
|
-
const boldSchema = zod.
|
|
7355
|
-
text: zod.
|
|
7357
|
+
const boldSchema = zod.object({
|
|
7358
|
+
text: zod.string(),
|
|
7356
7359
|
fontWeight
|
|
7357
7360
|
});
|
|
7358
|
-
const inlineTextSchema = zod.
|
|
7359
|
-
const blockquoteSchema = zod.
|
|
7360
|
-
const badgeSchema = zod.
|
|
7361
|
-
label: zod.
|
|
7362
|
-
color: zod.
|
|
7361
|
+
const inlineTextSchema = zod.object({ text: zod.string() });
|
|
7362
|
+
const blockquoteSchema = zod.object({ text: zod.string().describe("The quoted text, with inline markdown") });
|
|
7363
|
+
const badgeSchema = zod.object({
|
|
7364
|
+
label: zod.string().describe("Badge text"),
|
|
7365
|
+
color: zod.enum([
|
|
7363
7366
|
"secondary",
|
|
7364
7367
|
"success",
|
|
7365
7368
|
"danger",
|
|
@@ -7367,13 +7370,13 @@ const badgeSchema = zod.z.object({
|
|
|
7367
7370
|
"info",
|
|
7368
7371
|
"discovery"
|
|
7369
7372
|
]).optional().describe("Default \"secondary\""),
|
|
7370
|
-
size: zod.
|
|
7373
|
+
size: zod.enum([
|
|
7371
7374
|
"sm",
|
|
7372
7375
|
"md",
|
|
7373
7376
|
"lg"
|
|
7374
7377
|
]).optional().describe("Default \"md\""),
|
|
7375
|
-
pill: zod.
|
|
7376
|
-
variant: zod.
|
|
7378
|
+
pill: zod.boolean().optional().describe("Default true"),
|
|
7379
|
+
variant: zod.enum([
|
|
7377
7380
|
"soft",
|
|
7378
7381
|
"solid",
|
|
7379
7382
|
"outline"
|
|
@@ -7382,28 +7385,28 @@ const badgeSchema = zod.z.object({
|
|
|
7382
7385
|
maxWidth: sizeValue.optional(),
|
|
7383
7386
|
padding: sizeValue.optional()
|
|
7384
7387
|
});
|
|
7385
|
-
const codeSchema = zod.
|
|
7386
|
-
text: zod.
|
|
7387
|
-
language: zod.
|
|
7388
|
+
const codeSchema = zod.object({
|
|
7389
|
+
text: zod.string().describe("Source code"),
|
|
7390
|
+
language: zod.string().optional()
|
|
7388
7391
|
});
|
|
7389
|
-
const markdownSchema = zod.
|
|
7390
|
-
text: zod.
|
|
7391
|
-
streaming: zod.
|
|
7392
|
+
const markdownSchema = zod.object({
|
|
7393
|
+
text: zod.string().describe("Markdown source"),
|
|
7394
|
+
streaming: zod.boolean().optional().describe("Default false")
|
|
7392
7395
|
});
|
|
7393
|
-
const mathSchema = zod.
|
|
7394
|
-
value: zod.
|
|
7395
|
-
block: zod.
|
|
7396
|
+
const mathSchema = zod.object({
|
|
7397
|
+
value: zod.string().describe("TeX source"),
|
|
7398
|
+
block: zod.boolean().optional().describe("Default false")
|
|
7396
7399
|
});
|
|
7397
|
-
const shimmerSchema = zod.
|
|
7400
|
+
const shimmerSchema = zod.object({
|
|
7398
7401
|
...typographyProps,
|
|
7399
|
-
text: zod.
|
|
7400
|
-
size: zod.
|
|
7401
|
-
lineThrough: zod.
|
|
7402
|
+
text: zod.string(),
|
|
7403
|
+
size: zod.enum(TEXT_SIZES).optional().describe("Default \"md\""),
|
|
7404
|
+
lineThrough: zod.boolean().optional()
|
|
7402
7405
|
});
|
|
7403
|
-
const linkSchema = zod.
|
|
7404
|
-
text: zod.
|
|
7405
|
-
href: zod.
|
|
7406
|
-
title: zod.
|
|
7406
|
+
const linkSchema = zod.object({
|
|
7407
|
+
text: zod.string().describe("Link text"),
|
|
7408
|
+
href: zod.string().describe("URL"),
|
|
7409
|
+
title: zod.string().optional()
|
|
7407
7410
|
});
|
|
7408
7411
|
const FOCUS_RING = "2px solid var(--a2ui-color-focus, #0285ff)";
|
|
7409
7412
|
const TEXT_STYLE_ID = "a2ui-standard-text";
|
|
@@ -7780,12 +7783,12 @@ function Tooltip({ trigger, content }) {
|
|
|
7780
7783
|
const textComponents = {
|
|
7781
7784
|
Title: {
|
|
7782
7785
|
component: Title,
|
|
7783
|
-
description: "A heading
|
|
7786
|
+
description: "A heading in a Card or next to another component; a heading alone is markdown. Size \"2xl\" at most once per surface, \"lg\" for sections. \"sm\" is an h4, \"md\"/\"lg\" an h3 (default \"md\"), \"xl\" and up an h2. Bold unless strong is false.",
|
|
7784
7787
|
props: titleSchema
|
|
7785
7788
|
},
|
|
7786
7789
|
Text: {
|
|
7787
7790
|
component: Text,
|
|
7788
|
-
description: "Body text
|
|
7791
|
+
description: "Body text in a Card or next to another component; a paragraph alone is markdown outside the fence. Color \"default\" or \"secondary\". `text` takes inline markdown (**bold**, *italic*, ~~strike~~, ++underline++, `code`, [link](url)). `children` ids render inline after it, e.g. a Badge.",
|
|
7789
7792
|
props: textSchema,
|
|
7790
7793
|
slots: CHILDREN_SLOT
|
|
7791
7794
|
},
|
|
@@ -7856,7 +7859,7 @@ const textComponents = {
|
|
|
7856
7859
|
},
|
|
7857
7860
|
Tooltip: {
|
|
7858
7861
|
component: Tooltip,
|
|
7859
|
-
description: "Shows `content` when the user points at
|
|
7862
|
+
description: "Shows `content` when the user points at or focuses `trigger`. `trigger`: one child id, a Text, Icon or Badge (not a Button or Link). `content`: one child id of short text, no links or buttons.",
|
|
7860
7863
|
slots: {
|
|
7861
7864
|
trigger: "single",
|
|
7862
7865
|
content: "single"
|