@copilotkit/shared 2.0.0-rc.31 → 2.0.0-rc.33
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/README.md +1 -1
- package/dist/generative-ui/catalog/catalog-export.cjs +329 -0
- package/dist/generative-ui/catalog/catalog-export.cjs.map +1 -0
- package/dist/generative-ui/catalog/catalog-export.d.cts +92 -0
- package/dist/generative-ui/catalog/catalog-export.d.cts.map +1 -0
- package/dist/generative-ui/catalog/catalog-export.d.mts +92 -0
- package/dist/generative-ui/catalog/catalog-export.d.mts.map +1 -0
- package/dist/generative-ui/catalog/catalog-export.mjs +328 -0
- package/dist/generative-ui/catalog/catalog-export.mjs.map +1 -0
- package/dist/generative-ui/catalog/catalog.cjs +315 -0
- package/dist/generative-ui/catalog/catalog.cjs.map +1 -0
- package/dist/generative-ui/catalog/catalog.d.cts +407 -0
- package/dist/generative-ui/catalog/catalog.d.cts.map +1 -0
- package/dist/generative-ui/catalog/catalog.d.mts +407 -0
- package/dist/generative-ui/catalog/catalog.d.mts.map +1 -0
- package/dist/generative-ui/catalog/catalog.mjs +312 -0
- package/dist/generative-ui/catalog/catalog.mjs.map +1 -0
- package/dist/generative-ui/catalog/errors.cjs +13 -0
- package/dist/generative-ui/catalog/errors.cjs.map +1 -0
- package/dist/generative-ui/catalog/errors.d.cts +46 -0
- package/dist/generative-ui/catalog/errors.d.cts.map +1 -0
- package/dist/generative-ui/catalog/errors.d.mts +46 -0
- package/dist/generative-ui/catalog/errors.d.mts.map +1 -0
- package/dist/generative-ui/catalog/errors.mjs +12 -0
- package/dist/generative-ui/catalog/errors.mjs.map +1 -0
- package/dist/generative-ui/catalog/index.d.mts +6 -0
- package/dist/generative-ui/catalog/json-schema.cjs +16 -0
- package/dist/generative-ui/catalog/json-schema.cjs.map +1 -0
- package/dist/generative-ui/catalog/json-schema.d.cts +12 -0
- package/dist/generative-ui/catalog/json-schema.d.cts.map +1 -0
- package/dist/generative-ui/catalog/json-schema.d.mts +12 -0
- package/dist/generative-ui/catalog/json-schema.d.mts.map +1 -0
- package/dist/generative-ui/catalog/json-schema.mjs +16 -0
- package/dist/generative-ui/catalog/json-schema.mjs.map +1 -0
- package/dist/generative-ui/catalog/refs.cjs +21 -0
- package/dist/generative-ui/catalog/refs.cjs.map +1 -0
- package/dist/generative-ui/catalog/refs.d.cts +55 -0
- package/dist/generative-ui/catalog/refs.d.cts.map +1 -0
- package/dist/generative-ui/catalog/refs.d.mts +55 -0
- package/dist/generative-ui/catalog/refs.d.mts.map +1 -0
- package/dist/generative-ui/catalog/refs.mjs +18 -0
- package/dist/generative-ui/catalog/refs.mjs.map +1 -0
- package/dist/generative-ui/catalog/schema.cjs +74 -0
- package/dist/generative-ui/catalog/schema.cjs.map +1 -0
- package/dist/generative-ui/catalog/schema.d.cts +43 -0
- package/dist/generative-ui/catalog/schema.d.cts.map +1 -0
- package/dist/generative-ui/catalog/schema.d.mts +43 -0
- package/dist/generative-ui/catalog/schema.d.mts.map +1 -0
- package/dist/generative-ui/catalog/schema.mjs +68 -0
- package/dist/generative-ui/catalog/schema.mjs.map +1 -0
- package/dist/generative-ui/index.cjs +247 -0
- package/dist/generative-ui/index.d.cts +33 -0
- package/dist/generative-ui/index.d.mts +35 -0
- package/dist/generative-ui/index.mjs +34 -0
- package/dist/generative-ui/is-record.cjs +6 -1
- package/dist/generative-ui/is-record.cjs.map +1 -1
- package/dist/generative-ui/is-record.d.cts +6 -0
- package/dist/generative-ui/is-record.d.cts.map +1 -0
- package/dist/generative-ui/is-record.d.mts +6 -0
- package/dist/generative-ui/is-record.d.mts.map +1 -0
- package/dist/generative-ui/is-record.mjs +6 -2
- package/dist/generative-ui/is-record.mjs.map +1 -1
- package/dist/generative-ui/standard/chart.cjs +56 -0
- package/dist/generative-ui/standard/chart.cjs.map +1 -0
- package/dist/generative-ui/standard/chart.d.cts +62 -0
- package/dist/generative-ui/standard/chart.d.cts.map +1 -0
- package/dist/generative-ui/standard/chart.d.mts +62 -0
- package/dist/generative-ui/standard/chart.d.mts.map +1 -0
- package/dist/generative-ui/standard/chart.mjs +54 -0
- package/dist/generative-ui/standard/chart.mjs.map +1 -0
- package/dist/generative-ui/standard/checks.cjs +74 -0
- package/dist/generative-ui/standard/checks.cjs.map +1 -0
- package/dist/generative-ui/standard/checks.d.cts +56 -0
- package/dist/generative-ui/standard/checks.d.cts.map +1 -0
- package/dist/generative-ui/standard/checks.d.mts +56 -0
- package/dist/generative-ui/standard/checks.d.mts.map +1 -0
- package/dist/generative-ui/standard/checks.mjs +71 -0
- package/dist/generative-ui/standard/checks.mjs.map +1 -0
- package/dist/generative-ui/standard/components.cjs +23 -0
- package/dist/generative-ui/standard/components.cjs.map +1 -0
- package/dist/generative-ui/standard/components.d.cts +24 -0
- package/dist/generative-ui/standard/components.d.cts.map +1 -0
- package/dist/generative-ui/standard/components.d.mts +24 -0
- package/dist/generative-ui/standard/components.d.mts.map +1 -0
- package/dist/generative-ui/standard/components.mjs +22 -0
- package/dist/generative-ui/standard/components.mjs.map +1 -0
- package/dist/generative-ui/standard/composites.cjs +143 -0
- package/dist/generative-ui/standard/composites.cjs.map +1 -0
- package/dist/generative-ui/standard/composites.d.cts +233 -0
- package/dist/generative-ui/standard/composites.d.cts.map +1 -0
- package/dist/generative-ui/standard/composites.d.mts +233 -0
- package/dist/generative-ui/standard/composites.d.mts.map +1 -0
- package/dist/generative-ui/standard/composites.mjs +132 -0
- package/dist/generative-ui/standard/composites.mjs.map +1 -0
- package/dist/generative-ui/standard/data.cjs +176 -0
- package/dist/generative-ui/standard/data.cjs.map +1 -0
- package/dist/generative-ui/standard/data.d.cts +365 -0
- package/dist/generative-ui/standard/data.d.cts.map +1 -0
- package/dist/generative-ui/standard/data.d.mts +365 -0
- package/dist/generative-ui/standard/data.d.mts.map +1 -0
- package/dist/generative-ui/standard/data.mjs +167 -0
- package/dist/generative-ui/standard/data.mjs.map +1 -0
- package/dist/generative-ui/standard/declarations.cjs +40 -0
- package/dist/generative-ui/standard/declarations.cjs.map +1 -0
- package/dist/generative-ui/standard/declarations.d.cts +2570 -0
- package/dist/generative-ui/standard/declarations.d.cts.map +1 -0
- package/dist/generative-ui/standard/declarations.d.mts +2571 -0
- package/dist/generative-ui/standard/declarations.d.mts.map +1 -0
- package/dist/generative-ui/standard/declarations.mjs +39 -0
- package/dist/generative-ui/standard/declarations.mjs.map +1 -0
- package/dist/generative-ui/standard/feedback.cjs +97 -0
- package/dist/generative-ui/standard/feedback.cjs.map +1 -0
- package/dist/generative-ui/standard/feedback.d.cts +133 -0
- package/dist/generative-ui/standard/feedback.d.cts.map +1 -0
- package/dist/generative-ui/standard/feedback.d.mts +133 -0
- package/dist/generative-ui/standard/feedback.d.mts.map +1 -0
- package/dist/generative-ui/standard/feedback.mjs +90 -0
- package/dist/generative-ui/standard/feedback.mjs.map +1 -0
- package/dist/generative-ui/standard/index.d.mts +16 -0
- package/dist/generative-ui/standard/inputs.cjs +333 -0
- package/dist/generative-ui/standard/inputs.cjs.map +1 -0
- package/dist/generative-ui/standard/inputs.d.cts +1128 -0
- package/dist/generative-ui/standard/inputs.d.cts.map +1 -0
- package/dist/generative-ui/standard/inputs.d.mts +1128 -0
- package/dist/generative-ui/standard/inputs.d.mts.map +1 -0
- package/dist/generative-ui/standard/inputs.mjs +318 -0
- package/dist/generative-ui/standard/inputs.mjs.map +1 -0
- package/dist/generative-ui/standard/layout.cjs +289 -0
- package/dist/generative-ui/standard/layout.cjs.map +1 -0
- package/dist/generative-ui/standard/layout.d.cts +1974 -0
- package/dist/generative-ui/standard/layout.d.cts.map +1 -0
- package/dist/generative-ui/standard/layout.d.mts +1975 -0
- package/dist/generative-ui/standard/layout.d.mts.map +1 -0
- package/dist/generative-ui/standard/layout.mjs +269 -0
- package/dist/generative-ui/standard/layout.mjs.map +1 -0
- package/dist/generative-ui/standard/map.cjs +27 -0
- package/dist/generative-ui/standard/map.cjs.map +1 -0
- package/dist/generative-ui/standard/map.d.cts +31 -0
- package/dist/generative-ui/standard/map.d.cts.map +1 -0
- package/dist/generative-ui/standard/map.d.mts +31 -0
- package/dist/generative-ui/standard/map.d.mts.map +1 -0
- package/dist/generative-ui/standard/map.mjs +25 -0
- package/dist/generative-ui/standard/map.mjs.map +1 -0
- package/dist/generative-ui/standard/media.cjs +215 -0
- package/dist/generative-ui/standard/media.cjs.map +1 -0
- package/dist/generative-ui/standard/media.d.cts +396 -0
- package/dist/generative-ui/standard/media.d.cts.map +1 -0
- package/dist/generative-ui/standard/media.d.mts +396 -0
- package/dist/generative-ui/standard/media.d.mts.map +1 -0
- package/dist/generative-ui/standard/media.mjs +205 -0
- package/dist/generative-ui/standard/media.mjs.map +1 -0
- package/dist/generative-ui/standard/parameter-order.cjs +231 -0
- package/dist/generative-ui/standard/parameter-order.cjs.map +1 -0
- package/dist/generative-ui/standard/parameter-order.d.cts +84 -0
- package/dist/generative-ui/standard/parameter-order.d.cts.map +1 -0
- package/dist/generative-ui/standard/parameter-order.d.mts +84 -0
- package/dist/generative-ui/standard/parameter-order.d.mts.map +1 -0
- package/dist/generative-ui/standard/parameter-order.mjs +230 -0
- package/dist/generative-ui/standard/parameter-order.mjs.map +1 -0
- package/dist/generative-ui/standard/styles.cjs +62 -0
- package/dist/generative-ui/standard/styles.cjs.map +1 -0
- package/dist/generative-ui/standard/styles.d.cts +17 -0
- package/dist/generative-ui/standard/styles.d.cts.map +1 -0
- package/dist/generative-ui/standard/styles.d.mts +17 -0
- package/dist/generative-ui/standard/styles.d.mts.map +1 -0
- package/dist/generative-ui/standard/styles.mjs +60 -0
- package/dist/generative-ui/standard/styles.mjs.map +1 -0
- package/dist/generative-ui/standard/text.cjs +226 -0
- package/dist/generative-ui/standard/text.cjs.map +1 -0
- package/dist/generative-ui/standard/text.d.cts +522 -0
- package/dist/generative-ui/standard/text.d.cts.map +1 -0
- package/dist/generative-ui/standard/text.d.mts +522 -0
- package/dist/generative-ui/standard/text.d.mts.map +1 -0
- package/dist/generative-ui/standard/text.mjs +209 -0
- package/dist/generative-ui/standard/text.mjs.map +1 -0
- package/dist/generative-ui/standard/theme.cjs +115 -0
- package/dist/generative-ui/standard/theme.cjs.map +1 -0
- package/dist/generative-ui/standard/theme.d.cts +60 -0
- package/dist/generative-ui/standard/theme.d.cts.map +1 -0
- package/dist/generative-ui/standard/theme.d.mts +60 -0
- package/dist/generative-ui/standard/theme.d.mts.map +1 -0
- package/dist/generative-ui/standard/theme.mjs +112 -0
- package/dist/generative-ui/standard/theme.mjs.map +1 -0
- package/dist/generative-ui/standard/tokens.cjs +336 -0
- package/dist/generative-ui/standard/tokens.cjs.map +1 -0
- package/dist/generative-ui/standard/tokens.d.cts +76 -0
- package/dist/generative-ui/standard/tokens.d.cts.map +1 -0
- package/dist/generative-ui/standard/tokens.d.mts +76 -0
- package/dist/generative-ui/standard/tokens.d.mts.map +1 -0
- package/dist/generative-ui/standard/tokens.mjs +305 -0
- package/dist/generative-ui/standard/tokens.mjs.map +1 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -10
- package/dist/index.d.mts +10 -10
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.mjs +1 -1
- package/package.json +7 -3
- package/src/generative-ui/base.ts +9 -0
- package/src/generative-ui/catalog/catalog-export.ts +478 -0
- package/src/generative-ui/catalog/catalog.ts +1167 -0
- package/src/generative-ui/catalog/errors.ts +102 -0
- package/src/generative-ui/catalog/index.ts +6 -0
- package/src/generative-ui/catalog/json-schema.ts +14 -0
- package/src/generative-ui/catalog/refs.ts +87 -0
- package/src/generative-ui/catalog/schema.ts +107 -0
- package/src/generative-ui/index.ts +7 -0
- package/src/generative-ui/is-record.ts +6 -1
- package/src/generative-ui/standard/__tests__/theme.test.ts +61 -0
- package/src/generative-ui/standard/__tests__/tokens.test.ts +139 -0
- package/src/generative-ui/standard/chart.ts +79 -0
- package/src/generative-ui/standard/checks.ts +98 -0
- package/src/generative-ui/standard/components.ts +35 -0
- package/src/generative-ui/standard/composites.ts +158 -0
- package/src/generative-ui/standard/data.ts +213 -0
- package/src/generative-ui/standard/declarations.ts +57 -0
- package/src/generative-ui/standard/feedback.ts +105 -0
- package/src/generative-ui/standard/index.ts +19 -0
- package/src/generative-ui/standard/inputs.ts +423 -0
- package/src/generative-ui/standard/layout.ts +312 -0
- package/src/generative-ui/standard/map.ts +32 -0
- package/src/generative-ui/standard/media.ts +265 -0
- package/src/generative-ui/standard/parameter-order.ts +155 -0
- package/src/generative-ui/standard/styles.ts +79 -0
- package/src/generative-ui/standard/text.ts +210 -0
- package/src/generative-ui/standard/theme.ts +198 -0
- package/src/generative-ui/standard/tokens.ts +317 -0
- package/src/index.ts +1 -1
- package/tsdown.config.ts +1 -1
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
const require_checks = require('./checks.cjs');
|
|
3
|
+
const require_layout = require('./layout.cjs');
|
|
4
|
+
let zod = require("zod");
|
|
5
|
+
|
|
6
|
+
//#region src/generative-ui/standard/inputs.ts
|
|
7
|
+
/** A list of choices: plain strings or `{ value, label, description? }`. */
|
|
8
|
+
const optionList = zod.z.array(zod.z.union([zod.z.string(), zod.z.object({
|
|
9
|
+
value: zod.z.string(),
|
|
10
|
+
label: zod.z.string().optional(),
|
|
11
|
+
description: zod.z.string().optional()
|
|
12
|
+
})])).optional();
|
|
13
|
+
const INPUT_SIZES = [
|
|
14
|
+
"sm",
|
|
15
|
+
"md",
|
|
16
|
+
"lg",
|
|
17
|
+
"xl"
|
|
18
|
+
];
|
|
19
|
+
const size = (fallback) => zod.z.enum(INPUT_SIZES).optional().describe(`Default "${fallback}"`);
|
|
20
|
+
const pill = zod.z.boolean().optional().describe("Default true");
|
|
21
|
+
const fieldLabel = zod.z.string().optional().describe("The visible label of the field. Always set it");
|
|
22
|
+
const boundValue = zod.z.string().optional().describe("Bind it with { \"@path\": \"/x\" } to read what the user entered");
|
|
23
|
+
const buttonSchema = zod.z.object({
|
|
24
|
+
label: zod.z.string().optional().describe("The button text"),
|
|
25
|
+
checks: require_checks.checksProp,
|
|
26
|
+
text: zod.z.string().optional().describe("Same as label. Used when label is not set"),
|
|
27
|
+
variant: zod.z.enum([
|
|
28
|
+
"default",
|
|
29
|
+
"primary",
|
|
30
|
+
"soft",
|
|
31
|
+
"borderless"
|
|
32
|
+
]).optional().describe("Default \"default\": outlined. \"primary\" is filled, for the one main action. \"borderless\" has no box, like a link"),
|
|
33
|
+
color: zod.z.enum([
|
|
34
|
+
"primary",
|
|
35
|
+
"secondary",
|
|
36
|
+
"danger"
|
|
37
|
+
]).optional().describe("Default \"primary\""),
|
|
38
|
+
size: zod.z.enum([
|
|
39
|
+
"sm",
|
|
40
|
+
"md",
|
|
41
|
+
"lg"
|
|
42
|
+
]).optional().describe("Default \"lg\""),
|
|
43
|
+
block: zod.z.boolean().optional().describe("Full width"),
|
|
44
|
+
weight: require_layout.weightProp,
|
|
45
|
+
pill,
|
|
46
|
+
disabled: zod.z.boolean().optional(),
|
|
47
|
+
loading: zod.z.boolean().optional(),
|
|
48
|
+
submit: zod.z.boolean().optional().describe("Submits the Form around it. The Form sends its onSubmit event"),
|
|
49
|
+
icon: zod.z.string().optional().describe("Lucide icon name"),
|
|
50
|
+
uniform: zod.z.boolean().optional().describe("A square button, for an icon"),
|
|
51
|
+
href: zod.z.string().optional().describe("Opens this URL in a new tab on click, instead of onClick"),
|
|
52
|
+
copy: zod.z.string().optional().describe("Copies this text to the clipboard on click and shows a check mark, instead of onClick")
|
|
53
|
+
});
|
|
54
|
+
const pressableSchema = zod.z.object({
|
|
55
|
+
...require_layout.layoutProps,
|
|
56
|
+
disabled: zod.z.boolean().optional(),
|
|
57
|
+
hoverBackground: zod.z.string().optional(),
|
|
58
|
+
href: zod.z.string().optional().describe("Opens this URL in a new tab on click, instead of onClick"),
|
|
59
|
+
tooltip: zod.z.string().optional().describe("Shown on hover"),
|
|
60
|
+
ariaPressed: zod.z.boolean().optional().describe("For a toggle"),
|
|
61
|
+
insetBorder: zod.z.boolean().optional().describe("A 1px border inside the box")
|
|
62
|
+
});
|
|
63
|
+
const formSchema = zod.z.object({
|
|
64
|
+
...require_layout.layoutProps,
|
|
65
|
+
label: zod.z.string().optional().describe("A short name of the form for screen readers")
|
|
66
|
+
});
|
|
67
|
+
const textFieldSchema = zod.z.object({
|
|
68
|
+
checks: require_checks.checksProp,
|
|
69
|
+
value: zod.z.union([zod.z.string(), zod.z.number()]).optional().describe("Bind it with { \"@path\": \"/x\" } to read what the user typed"),
|
|
70
|
+
placeholder: zod.z.string().optional(),
|
|
71
|
+
label: fieldLabel,
|
|
72
|
+
variant: zod.z.enum([
|
|
73
|
+
"shortText",
|
|
74
|
+
"longText",
|
|
75
|
+
"number",
|
|
76
|
+
"obscured",
|
|
77
|
+
"email",
|
|
78
|
+
"url",
|
|
79
|
+
"tel"
|
|
80
|
+
]).optional().describe("Default \"shortText\". \"longText\" is a multi-line field, \"obscured\" a password"),
|
|
81
|
+
weight: require_layout.weightProp,
|
|
82
|
+
name: zod.z.string().optional(),
|
|
83
|
+
required: zod.z.boolean().optional(),
|
|
84
|
+
disabled: zod.z.boolean().optional(),
|
|
85
|
+
invalid: zod.z.boolean().optional(),
|
|
86
|
+
size: size("xl"),
|
|
87
|
+
pill,
|
|
88
|
+
autoSelect: zod.z.boolean().optional(),
|
|
89
|
+
mask: zod.z.string().optional()
|
|
90
|
+
});
|
|
91
|
+
const textAreaSchema = zod.z.object({
|
|
92
|
+
checks: require_checks.checksProp,
|
|
93
|
+
value: boundValue,
|
|
94
|
+
placeholder: zod.z.string().optional(),
|
|
95
|
+
label: fieldLabel,
|
|
96
|
+
weight: require_layout.weightProp,
|
|
97
|
+
rows: zod.z.number().optional().describe("Default 3"),
|
|
98
|
+
maxRows: zod.z.number().optional(),
|
|
99
|
+
autoResize: zod.z.boolean().optional(),
|
|
100
|
+
name: zod.z.string().optional(),
|
|
101
|
+
required: zod.z.boolean().optional(),
|
|
102
|
+
disabled: zod.z.boolean().optional(),
|
|
103
|
+
invalid: zod.z.boolean().optional(),
|
|
104
|
+
size: size("xl")
|
|
105
|
+
});
|
|
106
|
+
const selectSchema = zod.z.object({
|
|
107
|
+
checks: require_checks.checksProp,
|
|
108
|
+
value: boundValue,
|
|
109
|
+
options: optionList,
|
|
110
|
+
placeholder: zod.z.string().optional(),
|
|
111
|
+
label: fieldLabel,
|
|
112
|
+
name: zod.z.string().optional(),
|
|
113
|
+
required: zod.z.boolean().optional(),
|
|
114
|
+
disabled: zod.z.boolean().optional(),
|
|
115
|
+
clearable: zod.z.boolean().optional(),
|
|
116
|
+
clearLabel: zod.z.string().optional().describe("The label of the empty option"),
|
|
117
|
+
searchable: zod.z.boolean().optional(),
|
|
118
|
+
icon: zod.z.string().optional().describe("Lucide icon shown before the value"),
|
|
119
|
+
block: zod.z.boolean().optional().describe("Full width"),
|
|
120
|
+
size: size("xl"),
|
|
121
|
+
pill
|
|
122
|
+
});
|
|
123
|
+
const checkBoxSchema = zod.z.object({
|
|
124
|
+
checks: require_checks.checksProp,
|
|
125
|
+
value: zod.z.boolean().optional().describe("True when checked. Bind it with { \"@path\": \"/x\" } to read the state of the box"),
|
|
126
|
+
label: zod.z.string().optional().describe("The label text. Always set it"),
|
|
127
|
+
name: zod.z.string().optional(),
|
|
128
|
+
weight: require_layout.weightProp,
|
|
129
|
+
disabled: zod.z.boolean().optional(),
|
|
130
|
+
required: zod.z.boolean().optional(),
|
|
131
|
+
lineThrough: zod.z.boolean().optional().describe("Default false. Strikes the label when the box is checked"),
|
|
132
|
+
shape: zod.z.enum(["round", "square"]).optional().describe("Default \"round\"")
|
|
133
|
+
});
|
|
134
|
+
const radioSchema = zod.z.object({
|
|
135
|
+
value: zod.z.string().optional(),
|
|
136
|
+
label: zod.z.string().optional(),
|
|
137
|
+
disabled: zod.z.boolean().optional(),
|
|
138
|
+
required: zod.z.boolean().optional()
|
|
139
|
+
});
|
|
140
|
+
const radioGroupSchema = zod.z.object({
|
|
141
|
+
checks: require_checks.checksProp,
|
|
142
|
+
value: boundValue,
|
|
143
|
+
options: optionList,
|
|
144
|
+
label: fieldLabel,
|
|
145
|
+
name: zod.z.string().optional(),
|
|
146
|
+
direction: zod.z.enum(["row", "col"]).optional().describe("Default \"row\""),
|
|
147
|
+
variant: zod.z.enum([
|
|
148
|
+
"list",
|
|
149
|
+
"pills",
|
|
150
|
+
"cards"
|
|
151
|
+
]).optional(),
|
|
152
|
+
disabled: zod.z.boolean().optional(),
|
|
153
|
+
required: zod.z.boolean().optional()
|
|
154
|
+
});
|
|
155
|
+
const sliderSchema = zod.z.object({
|
|
156
|
+
checks: require_checks.checksProp,
|
|
157
|
+
value: zod.z.number().optional().describe("Bind it with { \"@path\": \"/x\" } to read the number"),
|
|
158
|
+
min: zod.z.number().optional().describe("Default 0"),
|
|
159
|
+
max: zod.z.number().optional().describe("Default 100"),
|
|
160
|
+
step: zod.z.number().optional().describe("Default 1"),
|
|
161
|
+
steps: zod.z.number().int().min(1).optional().describe("The number of equal divisions between min and max, instead of step"),
|
|
162
|
+
label: fieldLabel,
|
|
163
|
+
weight: require_layout.weightProp,
|
|
164
|
+
unit: zod.z.string().optional().describe("Unit after the value, for example \"%\""),
|
|
165
|
+
marks: zod.z.array(zod.z.object({
|
|
166
|
+
value: zod.z.number(),
|
|
167
|
+
label: zod.z.string().optional()
|
|
168
|
+
})).optional(),
|
|
169
|
+
sliderStyle: zod.z.enum(["continuous", "discrete"]).optional().describe("Default \"continuous\""),
|
|
170
|
+
disabled: zod.z.boolean().optional(),
|
|
171
|
+
name: zod.z.string().optional()
|
|
172
|
+
});
|
|
173
|
+
const segmentedControlSchema = zod.z.object({
|
|
174
|
+
checks: require_checks.checksProp,
|
|
175
|
+
value: boundValue,
|
|
176
|
+
options: optionList,
|
|
177
|
+
label: fieldLabel,
|
|
178
|
+
block: zod.z.boolean().optional().describe("Full width"),
|
|
179
|
+
size: size("lg"),
|
|
180
|
+
pill,
|
|
181
|
+
variant: zod.z.enum([
|
|
182
|
+
"solid",
|
|
183
|
+
"soft",
|
|
184
|
+
"outline",
|
|
185
|
+
"ghost"
|
|
186
|
+
]).optional().describe("Default \"ghost\""),
|
|
187
|
+
disabled: zod.z.boolean().optional()
|
|
188
|
+
});
|
|
189
|
+
const choicePickerSchema = zod.z.object({
|
|
190
|
+
checks: require_checks.checksProp,
|
|
191
|
+
value: zod.z.array(zod.z.string()).optional().describe("The chosen option values. Bind it with { \"@path\": \"/x\" } to a string list"),
|
|
192
|
+
options: optionList,
|
|
193
|
+
label: fieldLabel,
|
|
194
|
+
variant: zod.z.enum(["multipleSelection", "mutuallyExclusive"]).optional().describe("Default \"mutuallyExclusive\": the user picks one option"),
|
|
195
|
+
displayStyle: zod.z.enum(["checkbox", "chips"]).optional().describe("Default \"checkbox\". \"chips\" shows the options as pills"),
|
|
196
|
+
filterable: zod.z.boolean().optional().describe("Default false. Shows a field that filters the options"),
|
|
197
|
+
weight: require_layout.weightProp,
|
|
198
|
+
disabled: zod.z.boolean().optional(),
|
|
199
|
+
required: zod.z.boolean().optional()
|
|
200
|
+
});
|
|
201
|
+
const dateTimeInputSchema = zod.z.object({
|
|
202
|
+
checks: require_checks.checksProp,
|
|
203
|
+
value: zod.z.string().optional().describe("ISO 8601: \"YYYY-MM-DD\", \"HH:MM\" or \"YYYY-MM-DDTHH:MM\". Bind it with { \"@path\": \"/x\" }"),
|
|
204
|
+
label: fieldLabel,
|
|
205
|
+
enableDate: zod.z.boolean().optional().describe("The user picks a date. Default true unless only enableTime is set"),
|
|
206
|
+
enableTime: zod.z.boolean().optional().describe("The user picks a time"),
|
|
207
|
+
timeStep: zod.z.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"),
|
|
208
|
+
weight: require_layout.weightProp,
|
|
209
|
+
min: zod.z.string().optional().describe("The earliest value, ISO 8601"),
|
|
210
|
+
max: zod.z.string().optional().describe("The latest value, ISO 8601"),
|
|
211
|
+
placeholder: zod.z.string().optional(),
|
|
212
|
+
disabled: zod.z.boolean().optional(),
|
|
213
|
+
required: zod.z.boolean().optional(),
|
|
214
|
+
clearable: zod.z.boolean().optional(),
|
|
215
|
+
block: zod.z.boolean().optional().describe("Full width")
|
|
216
|
+
});
|
|
217
|
+
/** The writable list of a control that keeps its state in `value`. */
|
|
218
|
+
const VALUE_WRITABLE = ["value"];
|
|
219
|
+
/**
|
|
220
|
+
* The declarations of the standard input components: Button, Pressable,
|
|
221
|
+
* Form, and the controls. A framework adds its components with
|
|
222
|
+
* `withComponents`.
|
|
223
|
+
*
|
|
224
|
+
* - Button and Pressable send `onClick`. Form sends `onSubmit`. The model
|
|
225
|
+
* binds an event to `{ "event": { "name", "userMessage"?, "context"? } }`
|
|
226
|
+
* or `{ "functionCall": { "@call", "args"? } }`, or an app function with
|
|
227
|
+
* the same name binds it automatically.
|
|
228
|
+
* - The value of a control is writable: `value`.
|
|
229
|
+
* When the model binds it to `{ "@path": "/x" }`, what the user enters goes
|
|
230
|
+
* into the data model at that path, and the agent can no longer change it.
|
|
231
|
+
*/
|
|
232
|
+
const inputDeclarations = {
|
|
233
|
+
Button: {
|
|
234
|
+
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.",
|
|
235
|
+
props: buttonSchema,
|
|
236
|
+
events: { onClick: {
|
|
237
|
+
description: "Sent when the user clicks the button.",
|
|
238
|
+
parameters: require_layout.NO_ARGS
|
|
239
|
+
} },
|
|
240
|
+
slots: {
|
|
241
|
+
child: "single",
|
|
242
|
+
children: "multiple"
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
Pressable: {
|
|
246
|
+
description: "A layout container that the user can click or press with Enter or Space. It sends its onClick event, or opens href. A control inside it sends only its own event.",
|
|
247
|
+
props: pressableSchema,
|
|
248
|
+
events: {
|
|
249
|
+
...require_layout.VISIBLE_EVENT,
|
|
250
|
+
onClick: {
|
|
251
|
+
description: "Sent when the user clicks or presses the container.",
|
|
252
|
+
parameters: require_layout.NO_ARGS
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
slots: require_layout.CHILDREN_SLOT
|
|
256
|
+
},
|
|
257
|
+
Form: {
|
|
258
|
+
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\" }.",
|
|
259
|
+
props: formSchema,
|
|
260
|
+
events: { onSubmit: {
|
|
261
|
+
description: "Sent when the user submits the form.",
|
|
262
|
+
parameters: require_layout.NO_ARGS
|
|
263
|
+
} },
|
|
264
|
+
slots: require_layout.CHILDREN_SLOT
|
|
265
|
+
},
|
|
266
|
+
TextField: {
|
|
267
|
+
description: "A text input, single-line unless variant is \"longText\". Bind value with { \"@path\": \"/x\" } to read what the user typed. Give it a label.",
|
|
268
|
+
props: textFieldSchema,
|
|
269
|
+
writable: VALUE_WRITABLE
|
|
270
|
+
},
|
|
271
|
+
TextArea: {
|
|
272
|
+
description: "A multi-line text input. Bind value with { \"@path\": \"/x\" } to read what the user typed. Give it a label.",
|
|
273
|
+
props: textAreaSchema,
|
|
274
|
+
writable: VALUE_WRITABLE
|
|
275
|
+
},
|
|
276
|
+
Select: {
|
|
277
|
+
description: "A dropdown list of options. Bind value with { \"@path\": \"/x\" } to read the chosen option. Give it a label.",
|
|
278
|
+
props: selectSchema,
|
|
279
|
+
writable: VALUE_WRITABLE
|
|
280
|
+
},
|
|
281
|
+
CheckBox: {
|
|
282
|
+
description: "A checkbox with a label. Bind value with { \"@path\": \"/x\" } to read its state, true or false.",
|
|
283
|
+
props: checkBoxSchema,
|
|
284
|
+
writable: VALUE_WRITABLE
|
|
285
|
+
},
|
|
286
|
+
Radio: {
|
|
287
|
+
description: "One radio button. Use RadioGroup instead, because it keeps the chosen value.",
|
|
288
|
+
props: radioSchema
|
|
289
|
+
},
|
|
290
|
+
RadioGroup: {
|
|
291
|
+
description: "A group of radio buttons. The user chooses one option. Bind value with { \"@path\": \"/x\" } to read it. Give it a label.",
|
|
292
|
+
props: radioGroupSchema,
|
|
293
|
+
writable: VALUE_WRITABLE
|
|
294
|
+
},
|
|
295
|
+
Slider: {
|
|
296
|
+
description: "A range slider for a number between min and max. Bind value with { \"@path\": \"/x\" } to read the number. Give it a label.",
|
|
297
|
+
props: sliderSchema,
|
|
298
|
+
writable: VALUE_WRITABLE
|
|
299
|
+
},
|
|
300
|
+
SegmentedControl: {
|
|
301
|
+
description: "A row of segments. The user chooses one option. Use it for 2 to 5 short options. Bind value with { \"@path\": \"/x\" } to read it.",
|
|
302
|
+
props: segmentedControlSchema,
|
|
303
|
+
writable: VALUE_WRITABLE
|
|
304
|
+
},
|
|
305
|
+
ChoicePicker: {
|
|
306
|
+
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.",
|
|
307
|
+
props: choicePickerSchema,
|
|
308
|
+
writable: VALUE_WRITABLE
|
|
309
|
+
},
|
|
310
|
+
DateTimeInput: {
|
|
311
|
+
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.",
|
|
312
|
+
props: dateTimeInputSchema,
|
|
313
|
+
writable: VALUE_WRITABLE
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
//#endregion
|
|
318
|
+
exports.INPUT_SIZES = INPUT_SIZES;
|
|
319
|
+
exports.buttonSchema = buttonSchema;
|
|
320
|
+
exports.checkBoxSchema = checkBoxSchema;
|
|
321
|
+
exports.choicePickerSchema = choicePickerSchema;
|
|
322
|
+
exports.dateTimeInputSchema = dateTimeInputSchema;
|
|
323
|
+
exports.formSchema = formSchema;
|
|
324
|
+
exports.inputDeclarations = inputDeclarations;
|
|
325
|
+
exports.pressableSchema = pressableSchema;
|
|
326
|
+
exports.radioGroupSchema = radioGroupSchema;
|
|
327
|
+
exports.radioSchema = radioSchema;
|
|
328
|
+
exports.segmentedControlSchema = segmentedControlSchema;
|
|
329
|
+
exports.selectSchema = selectSchema;
|
|
330
|
+
exports.sliderSchema = sliderSchema;
|
|
331
|
+
exports.textAreaSchema = textAreaSchema;
|
|
332
|
+
exports.textFieldSchema = textFieldSchema;
|
|
333
|
+
//# sourceMappingURL=inputs.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputs.cjs","names":["z","checksProp","weightProp","layoutProps","NO_ARGS","VISIBLE_EVENT","CHILDREN_SLOT"],"sources":["../../../src/generative-ui/standard/inputs.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { checksProp } from \"./checks\";\nimport {\n CHILDREN_SLOT,\n NO_ARGS,\n VISIBLE_EVENT,\n layoutProps,\n weightProp,\n} from \"./layout\";\n\n// ---- Shared schemas ----\n\n/** A list of choices: plain strings or `{ value, label, description? }`. */\nconst optionList = z\n .array(\n z.union([\n z.string(),\n z.object({\n value: z.string(),\n label: z.string().optional(),\n description: z.string().optional(),\n }),\n ]),\n )\n .optional();\n\nexport type InputOptionList = z.output<typeof optionList>;\n\nexport const INPUT_SIZES = [\"sm\", \"md\", \"lg\", \"xl\"] as const;\nexport type InputSize = (typeof INPUT_SIZES)[number];\n\nconst size = (fallback: InputSize) =>\n z.enum(INPUT_SIZES).optional().describe(`Default \"${fallback}\"`);\nconst pill = z.boolean().optional().describe(\"Default true\");\nconst fieldLabel = z\n .string()\n .optional()\n .describe(\"The visible label of the field. Always set it\");\nconst boundValue = z\n .string()\n .optional()\n .describe('Bind it with { \"@path\": \"/x\" } to read what the user entered');\n\nexport const buttonSchema = z.object({\n label: z.string().optional().describe(\"The button text\"),\n checks: checksProp,\n text: z\n .string()\n .optional()\n .describe(\"Same as label. Used when label is not set\"),\n variant: z\n .enum([\"default\", \"primary\", \"soft\", \"borderless\"])\n .optional()\n .describe(\n 'Default \"default\": outlined. \"primary\" is filled, for the one main action. \"borderless\" has no box, like a link',\n ),\n color: z\n .enum([\"primary\", \"secondary\", \"danger\"])\n .optional()\n .describe('Default \"primary\"'),\n size: z.enum([\"sm\", \"md\", \"lg\"]).optional().describe('Default \"lg\"'),\n block: z.boolean().optional().describe(\"Full width\"),\n weight: weightProp,\n pill,\n disabled: z.boolean().optional(),\n loading: z.boolean().optional(),\n submit: z\n .boolean()\n .optional()\n .describe(\"Submits the Form around it. The Form sends its onSubmit event\"),\n icon: z.string().optional().describe(\"Lucide icon name\"),\n uniform: z.boolean().optional().describe(\"A square button, for an icon\"),\n href: z\n .string()\n .optional()\n .describe(\"Opens this URL in a new tab on click, instead of onClick\"),\n copy: z\n .string()\n .optional()\n .describe(\n \"Copies this text to the clipboard on click and shows a check mark, instead of onClick\",\n ),\n});\nexport const pressableSchema = z.object({\n ...layoutProps,\n disabled: z.boolean().optional(),\n hoverBackground: z.string().optional(),\n href: z\n .string()\n .optional()\n .describe(\"Opens this URL in a new tab on click, instead of onClick\"),\n tooltip: z.string().optional().describe(\"Shown on hover\"),\n ariaPressed: z.boolean().optional().describe(\"For a toggle\"),\n insetBorder: z.boolean().optional().describe(\"A 1px border inside the box\"),\n});\nexport const formSchema = z.object({\n ...layoutProps,\n label: z\n .string()\n .optional()\n .describe(\"A short name of the form for screen readers\"),\n});\nexport const textFieldSchema = z.object({\n checks: checksProp,\n value: z\n .union([z.string(), z.number()])\n .optional()\n .describe('Bind it with { \"@path\": \"/x\" } to read what the user typed'),\n placeholder: z.string().optional(),\n label: fieldLabel,\n variant: z\n .enum([\n \"shortText\",\n \"longText\",\n \"number\",\n \"obscured\",\n \"email\",\n \"url\",\n \"tel\",\n ])\n .optional()\n .describe(\n 'Default \"shortText\". \"longText\" is a multi-line field, \"obscured\" a password',\n ),\n weight: weightProp,\n name: z.string().optional(),\n required: z.boolean().optional(),\n disabled: z.boolean().optional(),\n invalid: z.boolean().optional(),\n size: size(\"xl\"),\n pill,\n autoSelect: z.boolean().optional(),\n mask: z.string().optional(),\n});\nexport const textAreaSchema = z.object({\n checks: checksProp,\n value: boundValue,\n placeholder: z.string().optional(),\n label: fieldLabel,\n weight: weightProp,\n rows: z.number().optional().describe(\"Default 3\"),\n maxRows: z.number().optional(),\n autoResize: z.boolean().optional(),\n name: z.string().optional(),\n required: z.boolean().optional(),\n disabled: z.boolean().optional(),\n invalid: z.boolean().optional(),\n size: size(\"xl\"),\n});\nexport const selectSchema = z.object({\n checks: checksProp,\n value: boundValue,\n options: optionList,\n placeholder: z.string().optional(),\n label: fieldLabel,\n name: z.string().optional(),\n required: z.boolean().optional(),\n disabled: z.boolean().optional(),\n clearable: z.boolean().optional(),\n clearLabel: z.string().optional().describe(\"The label of the empty option\"),\n searchable: z.boolean().optional(),\n icon: z.string().optional().describe(\"Lucide icon shown before the value\"),\n block: z.boolean().optional().describe(\"Full width\"),\n size: size(\"xl\"),\n pill,\n});\nexport const checkBoxSchema = z.object({\n checks: checksProp,\n value: z\n .boolean()\n .optional()\n .describe(\n 'True when checked. Bind it with { \"@path\": \"/x\" } to read the state of the box',\n ),\n label: z.string().optional().describe(\"The label text. Always set it\"),\n name: z.string().optional(),\n weight: weightProp,\n disabled: z.boolean().optional(),\n required: z.boolean().optional(),\n lineThrough: z\n .boolean()\n .optional()\n .describe(\"Default false. Strikes the label when the box is checked\"),\n shape: z.enum([\"round\", \"square\"]).optional().describe('Default \"round\"'),\n});\nexport const radioSchema = z.object({\n value: z.string().optional(),\n label: z.string().optional(),\n disabled: z.boolean().optional(),\n required: z.boolean().optional(),\n});\nexport const radioGroupSchema = z.object({\n checks: checksProp,\n value: boundValue,\n options: optionList,\n label: fieldLabel,\n name: z.string().optional(),\n direction: z.enum([\"row\", \"col\"]).optional().describe('Default \"row\"'),\n variant: z.enum([\"list\", \"pills\", \"cards\"]).optional(),\n disabled: z.boolean().optional(),\n required: z.boolean().optional(),\n});\nexport const sliderSchema = z.object({\n checks: checksProp,\n value: z\n .number()\n .optional()\n .describe('Bind it with { \"@path\": \"/x\" } to read the number'),\n min: z.number().optional().describe(\"Default 0\"),\n max: z.number().optional().describe(\"Default 100\"),\n step: z.number().optional().describe(\"Default 1\"),\n steps: z\n .number()\n .int()\n .min(1)\n .optional()\n .describe(\n \"The number of equal divisions between min and max, instead of step\",\n ),\n label: fieldLabel,\n weight: weightProp,\n unit: z.string().optional().describe('Unit after the value, for example \"%\"'),\n marks: z\n .array(z.object({ value: z.number(), label: z.string().optional() }))\n .optional(),\n sliderStyle: z\n .enum([\"continuous\", \"discrete\"])\n .optional()\n .describe('Default \"continuous\"'),\n disabled: z.boolean().optional(),\n name: z.string().optional(),\n});\nexport const segmentedControlSchema = z.object({\n checks: checksProp,\n value: boundValue,\n options: optionList,\n label: fieldLabel,\n block: z.boolean().optional().describe(\"Full width\"),\n size: size(\"lg\"),\n pill,\n variant: z\n .enum([\"solid\", \"soft\", \"outline\", \"ghost\"])\n .optional()\n .describe('Default \"ghost\"'),\n disabled: z.boolean().optional(),\n});\nexport const choicePickerSchema = z.object({\n checks: checksProp,\n value: z\n .array(z.string())\n .optional()\n .describe(\n 'The chosen option values. Bind it with { \"@path\": \"/x\" } to a string list',\n ),\n options: optionList,\n label: fieldLabel,\n variant: z\n .enum([\"multipleSelection\", \"mutuallyExclusive\"])\n .optional()\n .describe('Default \"mutuallyExclusive\": the user picks one option'),\n displayStyle: z\n .enum([\"checkbox\", \"chips\"])\n .optional()\n .describe('Default \"checkbox\". \"chips\" shows the options as pills'),\n filterable: z\n .boolean()\n .optional()\n .describe(\"Default false. Shows a field that filters the options\"),\n weight: weightProp,\n disabled: z.boolean().optional(),\n required: z.boolean().optional(),\n});\nexport const dateTimeInputSchema = z.object({\n checks: checksProp,\n value: z\n .string()\n .optional()\n .describe(\n 'ISO 8601: \"YYYY-MM-DD\", \"HH:MM\" or \"YYYY-MM-DDTHH:MM\". Bind it with { \"@path\": \"/x\" }',\n ),\n label: fieldLabel,\n enableDate: z\n .boolean()\n .optional()\n .describe(\n \"The user picks a date. Default true unless only enableTime is set\",\n ),\n enableTime: z.boolean().optional().describe(\"The user picks a time\"),\n timeStep: z\n .number()\n .int()\n .min(1)\n .max(720)\n .optional()\n .describe(\n \"Minutes between the times the user can pick, e.g. 15 or 30. Shows the time as a list\",\n ),\n weight: weightProp,\n min: z.string().optional().describe(\"The earliest value, ISO 8601\"),\n max: z.string().optional().describe(\"The latest value, ISO 8601\"),\n placeholder: z.string().optional(),\n disabled: z.boolean().optional(),\n required: z.boolean().optional(),\n clearable: z.boolean().optional(),\n block: z.boolean().optional().describe(\"Full width\"),\n});\n\n/** The writable list of a control that keeps its state in `value`. */\nconst VALUE_WRITABLE = [\"value\"] as const;\n\n// ---- Catalog ----\n\n/**\n * The declarations of the standard input components: Button, Pressable,\n * Form, and the controls. A framework adds its components with\n * `withComponents`.\n *\n * - Button and Pressable send `onClick`. Form sends `onSubmit`. The model\n * binds an event to `{ \"event\": { \"name\", \"userMessage\"?, \"context\"? } }`\n * or `{ \"functionCall\": { \"@call\", \"args\"? } }`, or an app function with\n * the same name binds it automatically.\n * - The value of a control is writable: `value`.\n * When the model binds it to `{ \"@path\": \"/x\" }`, what the user enters goes\n * into the data model at that path, and the agent can no longer change it.\n */\nexport const inputDeclarations = {\n Button: {\n description:\n '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.',\n props: buttonSchema,\n events: {\n onClick: {\n description: \"Sent when the user clicks the button.\",\n parameters: NO_ARGS,\n },\n },\n slots: { child: \"single\", children: \"multiple\" } as const,\n },\n Pressable: {\n description:\n \"A layout container that the user can click or press with Enter or Space. It sends its onClick event, or opens href. A control inside it sends only its own event.\",\n props: pressableSchema,\n events: {\n ...VISIBLE_EVENT,\n onClick: {\n description: \"Sent when the user clicks or presses the container.\",\n parameters: NO_ARGS,\n },\n },\n slots: CHILDREN_SLOT,\n },\n Form: {\n description:\n '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\" }.',\n props: formSchema,\n events: {\n onSubmit: {\n description: \"Sent when the user submits the form.\",\n parameters: NO_ARGS,\n },\n },\n slots: CHILDREN_SLOT,\n },\n TextField: {\n description:\n 'A text input, single-line unless variant is \"longText\". Bind value with { \"@path\": \"/x\" } to read what the user typed. Give it a label.',\n props: textFieldSchema,\n writable: VALUE_WRITABLE,\n },\n TextArea: {\n description:\n 'A multi-line text input. Bind value with { \"@path\": \"/x\" } to read what the user typed. Give it a label.',\n props: textAreaSchema,\n writable: VALUE_WRITABLE,\n },\n Select: {\n description:\n 'A dropdown list of options. Bind value with { \"@path\": \"/x\" } to read the chosen option. Give it a label.',\n props: selectSchema,\n writable: VALUE_WRITABLE,\n },\n CheckBox: {\n description:\n 'A checkbox with a label. Bind value with { \"@path\": \"/x\" } to read its state, true or false.',\n props: checkBoxSchema,\n writable: VALUE_WRITABLE,\n },\n Radio: {\n description:\n \"One radio button. Use RadioGroup instead, because it keeps the chosen value.\",\n props: radioSchema,\n },\n RadioGroup: {\n description:\n 'A group of radio buttons. The user chooses one option. Bind value with { \"@path\": \"/x\" } to read it. Give it a label.',\n props: radioGroupSchema,\n writable: VALUE_WRITABLE,\n },\n Slider: {\n description:\n 'A range slider for a number between min and max. Bind value with { \"@path\": \"/x\" } to read the number. Give it a label.',\n props: sliderSchema,\n writable: VALUE_WRITABLE,\n },\n SegmentedControl: {\n description:\n 'A row of segments. The user chooses one option. Use it for 2 to 5 short options. Bind value with { \"@path\": \"/x\" } to read it.',\n props: segmentedControlSchema,\n writable: VALUE_WRITABLE,\n },\n ChoicePicker: {\n description:\n 'Options as checkboxes or chips: pick one, or several with variant \"multipleSelection\". Its value is the list of chosen values. Give it a label.',\n props: choicePickerSchema,\n writable: VALUE_WRITABLE,\n },\n DateTimeInput: {\n description:\n \"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.\",\n props: dateTimeInputSchema,\n writable: VALUE_WRITABLE,\n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