@assistant-ui/react-generative-ui 0.0.6 → 0.0.8

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.
Files changed (201) hide show
  1. package/dist/JSONGenerativeUI.client.d.ts +4 -2
  2. package/dist/JSONGenerativeUI.client.d.ts.map +1 -1
  3. package/dist/JSONGenerativeUI.client.js +9 -2
  4. package/dist/JSONGenerativeUI.client.js.map +1 -1
  5. package/dist/JSONGenerativeUI.server.d.ts +0 -1
  6. package/dist/JSONGenerativeUI.server.d.ts.map +1 -1
  7. package/dist/JSONGenerativeUI.shared.d.ts +8 -1
  8. package/dist/JSONGenerativeUI.shared.d.ts.map +1 -1
  9. package/dist/JSONGenerativeUI.shared.js.map +1 -1
  10. package/dist/actionRegistry.d.ts +32 -0
  11. package/dist/actionRegistry.d.ts.map +1 -0
  12. package/dist/actionRegistry.js +41 -0
  13. package/dist/actionRegistry.js.map +1 -0
  14. package/dist/buildPresentParameters.d.ts +5 -5
  15. package/dist/buildPresentParameters.d.ts.map +1 -1
  16. package/dist/buildPresentParameters.js +20 -6
  17. package/dist/buildPresentParameters.js.map +1 -1
  18. package/dist/constants.d.ts.map +1 -1
  19. package/dist/defineGenerativeComponents.d.ts +0 -1
  20. package/dist/defineGenerativeComponents.d.ts.map +1 -1
  21. package/dist/generativeUIToJSX.d.ts +15 -10
  22. package/dist/generativeUIToJSX.d.ts.map +1 -1
  23. package/dist/generativeUIToJSX.js +47 -17
  24. package/dist/generativeUIToJSX.js.map +1 -1
  25. package/dist/index.d.ts +8 -4
  26. package/dist/index.js +5 -2
  27. package/dist/index.server.d.ts +13 -0
  28. package/dist/index.server.js +10 -0
  29. package/dist/index.shared.d.ts +11 -0
  30. package/dist/index.shared.js +9 -0
  31. package/dist/ir.d.ts +115 -0
  32. package/dist/ir.d.ts.map +1 -0
  33. package/dist/ir.js +175 -0
  34. package/dist/ir.js.map +1 -0
  35. package/dist/node_modules/.pnpm/@types_json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts +3 -3
  36. package/dist/node_modules/.pnpm/@types_json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts.map +1 -1
  37. package/dist/renderGenerativeUI.d.ts +5 -5
  38. package/dist/renderGenerativeUI.d.ts.map +1 -1
  39. package/dist/renderGenerativeUI.js +18 -45
  40. package/dist/renderGenerativeUI.js.map +1 -1
  41. package/dist/slack/constants.d.ts +111 -0
  42. package/dist/slack/constants.d.ts.map +1 -0
  43. package/dist/slack/constants.js +168 -0
  44. package/dist/slack/constants.js.map +1 -0
  45. package/dist/slack/decodeBlockAction.d.ts +11 -0
  46. package/dist/slack/decodeBlockAction.d.ts.map +1 -0
  47. package/dist/slack/decodeBlockAction.js +40 -0
  48. package/dist/slack/decodeBlockAction.js.map +1 -0
  49. package/dist/slack/fromSlackBlocks.d.ts +30 -0
  50. package/dist/slack/fromSlackBlocks.d.ts.map +1 -0
  51. package/dist/slack/fromSlackBlocks.js +447 -0
  52. package/dist/slack/fromSlackBlocks.js.map +1 -0
  53. package/dist/slack/toSlackBlocks.d.ts +7 -0
  54. package/dist/slack/toSlackBlocks.d.ts.map +1 -0
  55. package/dist/slack/toSlackBlocks.js +649 -0
  56. package/dist/slack/toSlackBlocks.js.map +1 -0
  57. package/dist/slack/types.d.ts +178 -0
  58. package/dist/slack/types.d.ts.map +1 -0
  59. package/dist/slack/types.js +0 -0
  60. package/dist/slack.d.ts +5 -0
  61. package/dist/slack.js +4 -0
  62. package/dist/teams/boundSpec.d.ts +20 -0
  63. package/dist/teams/boundSpec.d.ts.map +1 -0
  64. package/dist/teams/boundSpec.js +67 -0
  65. package/dist/teams/boundSpec.js.map +1 -0
  66. package/dist/teams/constants.d.ts +57 -0
  67. package/dist/teams/constants.d.ts.map +1 -0
  68. package/dist/teams/constants.js +92 -0
  69. package/dist/teams/constants.js.map +1 -0
  70. package/dist/teams/decodeSubmitData.d.ts +25 -0
  71. package/dist/teams/decodeSubmitData.d.ts.map +1 -0
  72. package/dist/teams/decodeSubmitData.js +44 -0
  73. package/dist/teams/decodeSubmitData.js.map +1 -0
  74. package/dist/teams/toAdaptiveCard.d.ts +39 -0
  75. package/dist/teams/toAdaptiveCard.d.ts.map +1 -0
  76. package/dist/teams/toAdaptiveCard.js +496 -0
  77. package/dist/teams/toAdaptiveCard.js.map +1 -0
  78. package/dist/teams/toTeamsAttachments.d.ts +13 -0
  79. package/dist/teams/toTeamsAttachments.d.ts.map +1 -0
  80. package/dist/teams/toTeamsAttachments.js +95 -0
  81. package/dist/teams/toTeamsAttachments.js.map +1 -0
  82. package/dist/teams/types.d.ts +196 -0
  83. package/dist/teams/types.d.ts.map +1 -0
  84. package/dist/teams/types.js +0 -0
  85. package/dist/teams.d.ts +5 -0
  86. package/dist/teams.js +4 -0
  87. package/dist/types.d.ts +41 -34
  88. package/dist/types.d.ts.map +1 -1
  89. package/dist/vocabulary/alert.d.ts +28 -0
  90. package/dist/vocabulary/alert.d.ts.map +1 -0
  91. package/dist/vocabulary/alert.js +58 -0
  92. package/dist/vocabulary/alert.js.map +1 -0
  93. package/dist/vocabulary/collectFormValues.d.ts +23 -0
  94. package/dist/vocabulary/collectFormValues.d.ts.map +1 -0
  95. package/dist/vocabulary/collectFormValues.js +32 -0
  96. package/dist/vocabulary/collectFormValues.js.map +1 -0
  97. package/dist/vocabulary/data.d.ts +52 -0
  98. package/dist/vocabulary/data.d.ts.map +1 -0
  99. package/dist/vocabulary/data.js +294 -0
  100. package/dist/vocabulary/data.js.map +1 -0
  101. package/dist/vocabulary/dispatch.d.ts +11 -0
  102. package/dist/vocabulary/dispatch.d.ts.map +1 -0
  103. package/dist/vocabulary/dispatch.js +21 -0
  104. package/dist/vocabulary/dispatch.js.map +1 -0
  105. package/dist/vocabulary/fact.d.ts +15 -0
  106. package/dist/vocabulary/fact.d.ts.map +1 -0
  107. package/dist/vocabulary/fact.js +24 -0
  108. package/dist/vocabulary/fact.js.map +1 -0
  109. package/dist/vocabulary/form.d.ts +14 -0
  110. package/dist/vocabulary/form.d.ts.map +1 -0
  111. package/dist/vocabulary/form.js +23 -0
  112. package/dist/vocabulary/form.js.map +1 -0
  113. package/dist/vocabulary/icon.d.ts +44 -0
  114. package/dist/vocabulary/icon.d.ts.map +1 -0
  115. package/dist/vocabulary/icon.js +272 -0
  116. package/dist/vocabulary/icon.js.map +1 -0
  117. package/dist/vocabulary/index.d.ts +15 -0
  118. package/dist/vocabulary/index.d.ts.map +1 -0
  119. package/dist/vocabulary/index.js +36 -0
  120. package/dist/vocabulary/index.js.map +1 -0
  121. package/dist/vocabulary/interactive.d.ts +93 -0
  122. package/dist/vocabulary/interactive.d.ts.map +1 -0
  123. package/dist/vocabulary/interactive.js +172 -0
  124. package/dist/vocabulary/interactive.js.map +1 -0
  125. package/dist/vocabulary/layout.d.ts +82 -0
  126. package/dist/vocabulary/layout.d.ts.map +1 -0
  127. package/dist/vocabulary/layout.js +136 -0
  128. package/dist/vocabulary/layout.js.map +1 -0
  129. package/dist/vocabulary/list.d.ts +17 -0
  130. package/dist/vocabulary/list.d.ts.map +1 -0
  131. package/dist/vocabulary/list.js +48 -0
  132. package/dist/vocabulary/list.js.map +1 -0
  133. package/dist/vocabulary/media.d.ts +28 -0
  134. package/dist/vocabulary/media.d.ts.map +1 -0
  135. package/dist/vocabulary/media.js +42 -0
  136. package/dist/vocabulary/media.js.map +1 -0
  137. package/dist/vocabulary/text.d.ts +60 -0
  138. package/dist/vocabulary/text.d.ts.map +1 -0
  139. package/dist/vocabulary/text.js +48 -0
  140. package/dist/vocabulary/text.js.map +1 -0
  141. package/package.json +21 -13
  142. package/src/JSONGenerativeUI.client.tsx +10 -2
  143. package/src/JSONGenerativeUI.shared.ts +8 -0
  144. package/src/actionRegistry.test.ts +90 -0
  145. package/src/actionRegistry.ts +88 -0
  146. package/src/buildPresentParameters.ts +38 -16
  147. package/src/generativeUIToJSX.test.ts +186 -0
  148. package/src/generativeUIToJSX.ts +112 -21
  149. package/src/index.server.ts +2 -0
  150. package/src/index.shared.ts +61 -0
  151. package/src/index.ts +2 -26
  152. package/src/ir.test.ts +203 -0
  153. package/src/ir.ts +279 -0
  154. package/src/renderGenerativeUI.test.tsx +69 -2
  155. package/src/renderGenerativeUI.tsx +49 -82
  156. package/src/slack/constants.ts +217 -0
  157. package/src/slack/decodeBlockAction.test.ts +135 -0
  158. package/src/slack/decodeBlockAction.ts +66 -0
  159. package/src/slack/fromSlackBlocks.test.ts +1145 -0
  160. package/src/slack/fromSlackBlocks.ts +709 -0
  161. package/src/slack/toSlackBlocks.test.ts +1936 -0
  162. package/src/slack/toSlackBlocks.ts +1319 -0
  163. package/src/slack/types.ts +230 -0
  164. package/src/slack.ts +37 -0
  165. package/src/teams/boundSpec.ts +102 -0
  166. package/src/teams/constants.ts +127 -0
  167. package/src/teams/decodeSubmitData.test.ts +148 -0
  168. package/src/teams/decodeSubmitData.ts +57 -0
  169. package/src/teams/toAdaptiveCard.test.ts +1410 -0
  170. package/src/teams/toAdaptiveCard.ts +762 -0
  171. package/src/teams/toTeamsAttachments.test.ts +29 -0
  172. package/src/teams/toTeamsAttachments.ts +137 -0
  173. package/src/teams/types.ts +237 -0
  174. package/src/teams.ts +34 -0
  175. package/src/types.ts +57 -42
  176. package/src/vocabulary/alert.test.tsx +136 -0
  177. package/src/vocabulary/alert.tsx +66 -0
  178. package/src/vocabulary/collectFormValues.test.ts +127 -0
  179. package/src/vocabulary/collectFormValues.ts +58 -0
  180. package/src/vocabulary/data.test.tsx +567 -0
  181. package/src/vocabulary/data.tsx +494 -0
  182. package/src/vocabulary/dispatch.ts +22 -0
  183. package/src/vocabulary/fact.test.tsx +15 -0
  184. package/src/vocabulary/fact.tsx +22 -0
  185. package/src/vocabulary/form.test.tsx +112 -0
  186. package/src/vocabulary/form.tsx +34 -0
  187. package/src/vocabulary/icon.test.tsx +64 -0
  188. package/src/vocabulary/icon.tsx +174 -0
  189. package/src/vocabulary/index.test.ts +63 -0
  190. package/src/vocabulary/index.ts +33 -0
  191. package/src/vocabulary/interactive.dispatch.test.tsx +352 -0
  192. package/src/vocabulary/interactive.test.tsx +248 -0
  193. package/src/vocabulary/interactive.tsx +269 -0
  194. package/src/vocabulary/layout.test.tsx +289 -0
  195. package/src/vocabulary/layout.tsx +229 -0
  196. package/src/vocabulary/list.test.tsx +195 -0
  197. package/src/vocabulary/list.tsx +48 -0
  198. package/src/vocabulary/media.test.tsx +85 -0
  199. package/src/vocabulary/media.tsx +56 -0
  200. package/src/vocabulary/text.test.tsx +73 -0
  201. package/src/vocabulary/text.tsx +59 -0
@@ -0,0 +1,14 @@
1
+ import { z } from "zod";
2
+ //#region src/vocabulary/form.d.ts
3
+ declare const formVocabulary: {
4
+ Form: {
5
+ description: string;
6
+ properties: z.ZodObject<{
7
+ gap: z.ZodOptional<z.ZodNumber>;
8
+ }, z.core.$strip>;
9
+ render: ({ gap, $action, $dispatch, children }: any) => import("react").JSX.Element;
10
+ };
11
+ };
12
+ //#endregion
13
+ export { formVocabulary };
14
+ //# sourceMappingURL=form.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form.d.ts","names":[],"sources":["../../src/vocabulary/form.tsx"],"mappings":";;cAKa"}
@@ -0,0 +1,23 @@
1
+ import { actionAttr, fire } from "./dispatch.js";
2
+ import { collectFormValuesFromEvent } from "./collectFormValues.js";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { z } from "zod";
5
+ //#region src/vocabulary/form.tsx
6
+ const formVocabulary = { Form: {
7
+ description: "Wraps named child controls (Select/Input/Checkbox/RadioGroup/DatePicker with a `name`). Carries `$action`; on submit it fires with every named control's value, keyed by `name`.",
8
+ properties: z.object({ gap: z.number().min(0).max(8).optional().describe("Gap between children in 4px units. 0 to 8 is the supported range.") }),
9
+ render: ({ gap, $action, $dispatch, children }) => /* @__PURE__ */ jsx("form", {
10
+ "data-aui": "form",
11
+ "data-aui-gap": gap,
12
+ "data-aui-action": actionAttr($action),
13
+ onSubmit: (event) => {
14
+ event.preventDefault();
15
+ fire($action, $dispatch, collectFormValuesFromEvent(event));
16
+ },
17
+ children
18
+ })
19
+ } };
20
+ //#endregion
21
+ export { formVocabulary };
22
+
23
+ //# sourceMappingURL=form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form.js","names":[],"sources":["../../src/vocabulary/form.tsx"],"sourcesContent":["import { z } from \"zod\";\nimport type { GenerativeUILibrary } from \"../types\";\nimport { actionAttr, fire } from \"./dispatch\";\nimport { collectFormValuesFromEvent } from \"./collectFormValues\";\n\nexport const formVocabulary = {\n Form: {\n description:\n \"Wraps named child controls (Select/Input/Checkbox/RadioGroup/DatePicker with a `name`). Carries `$action`; on submit it fires with every named control's value, keyed by `name`.\",\n properties: z.object({\n gap: z\n .number()\n .min(0)\n .max(8)\n .optional()\n .describe(\n \"Gap between children in 4px units. 0 to 8 is the supported range.\",\n ),\n }),\n render: ({ gap, $action, $dispatch, children }) => (\n <form\n data-aui=\"form\"\n data-aui-gap={gap}\n data-aui-action={actionAttr($action)}\n onSubmit={(event) => {\n event.preventDefault();\n fire($action, $dispatch, collectFormValuesFromEvent(event));\n }}\n >\n {children}\n </form>\n ),\n },\n} satisfies GenerativeUILibrary;\n"],"mappings":";;;;;AAKA,MAAa,iBAAiB,EAC5B,MAAM;CACJ,aACE;CACF,YAAY,EAAE,OAAO,EACnB,KAAK,EACF,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,IAAI,CAAC,CAAC,CACN,SAAS,CAAC,CACV,SACC,mEACF,EACJ,CAAC;CACD,SAAS,EAAE,KAAK,SAAS,WAAW,eAClC,oBAAC,QAAD;EACE,YAAS;EACT,gBAAc;EACd,mBAAiB,WAAW,OAAO;EACnC,WAAW,UAAU;GACnB,MAAM,eAAe;GACrB,KAAK,SAAS,WAAW,2BAA2B,KAAK,CAAC;EAC5D;EAEC;CACG,CAAA;AAEV,EACF"}
@@ -0,0 +1,44 @@
1
+ import { z } from "zod";
2
+ //#region src/vocabulary/icon.d.ts
3
+ declare const iconVocabulary: {
4
+ Icon: {
5
+ description: string;
6
+ properties: z.ZodObject<{
7
+ name: z.ZodEnum<{
8
+ search: "search";
9
+ check: "check";
10
+ sun: "sun";
11
+ moon: "moon";
12
+ cloud: "cloud";
13
+ rain: "rain";
14
+ snow: "snow";
15
+ wind: "wind";
16
+ play: "play";
17
+ pause: "pause";
18
+ x: "x";
19
+ star: "star";
20
+ heart: "heart";
21
+ "arrow-right": "arrow-right";
22
+ "arrow-up-right": "arrow-up-right";
23
+ "chevron-right": "chevron-right";
24
+ calendar: "calendar";
25
+ clock: "clock";
26
+ "map-pin": "map-pin";
27
+ plane: "plane";
28
+ truck: "truck";
29
+ "credit-card": "credit-card";
30
+ user: "user";
31
+ bell: "bell";
32
+ }>;
33
+ size: z.ZodOptional<z.ZodEnum<{
34
+ sm: "sm";
35
+ md: "md";
36
+ lg: "lg";
37
+ }>>;
38
+ }, z.core.$strip>;
39
+ render: ({ name, size }: any) => import("react").JSX.Element | null;
40
+ };
41
+ };
42
+ //#endregion
43
+ export { iconVocabulary };
44
+ //# sourceMappingURL=icon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon.d.ts","names":[],"sources":["../../src/vocabulary/icon.tsx"],"mappings":";;cAyIa"}
@@ -0,0 +1,272 @@
1
+ import { ICON_NAMES } from "../ir.js";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { z } from "zod";
4
+ //#region src/vocabulary/icon.tsx
5
+ const ICON_SIZE_TOKENS = [
6
+ "sm",
7
+ "md",
8
+ "lg"
9
+ ];
10
+ const ICON_SIZE_PX = {
11
+ sm: 14,
12
+ md: 16,
13
+ lg: 20
14
+ };
15
+ const ICON_GLYPHS = {
16
+ sun: /* @__PURE__ */ jsxs(Fragment, { children: [
17
+ /* @__PURE__ */ jsx("circle", {
18
+ cx: "12",
19
+ cy: "12",
20
+ r: "4.5"
21
+ }),
22
+ /* @__PURE__ */ jsx("line", {
23
+ x1: "12",
24
+ y1: "2",
25
+ x2: "12",
26
+ y2: "5"
27
+ }),
28
+ /* @__PURE__ */ jsx("line", {
29
+ x1: "12",
30
+ y1: "19",
31
+ x2: "12",
32
+ y2: "22"
33
+ }),
34
+ /* @__PURE__ */ jsx("line", {
35
+ x1: "2",
36
+ y1: "12",
37
+ x2: "5",
38
+ y2: "12"
39
+ }),
40
+ /* @__PURE__ */ jsx("line", {
41
+ x1: "19",
42
+ y1: "12",
43
+ x2: "22",
44
+ y2: "12"
45
+ }),
46
+ /* @__PURE__ */ jsx("line", {
47
+ x1: "5.5",
48
+ y1: "5.5",
49
+ x2: "7.5",
50
+ y2: "7.5"
51
+ }),
52
+ /* @__PURE__ */ jsx("line", {
53
+ x1: "16.5",
54
+ y1: "16.5",
55
+ x2: "18.5",
56
+ y2: "18.5"
57
+ }),
58
+ /* @__PURE__ */ jsx("line", {
59
+ x1: "18.5",
60
+ y1: "5.5",
61
+ x2: "16.5",
62
+ y2: "7.5"
63
+ }),
64
+ /* @__PURE__ */ jsx("line", {
65
+ x1: "7.5",
66
+ y1: "16.5",
67
+ x2: "5.5",
68
+ y2: "18.5"
69
+ })
70
+ ] }),
71
+ moon: /* @__PURE__ */ jsx("path", { d: "M19 13.5A8.5 8.5 0 1 1 10.5 4.5 6.8 6.8 0 0 0 19 13.5Z" }),
72
+ cloud: /* @__PURE__ */ jsx("path", { d: "M7 18a4 4 0 1 1 .5-8A5.5 5.5 0 0 1 17.5 11.5 3.5 3.5 0 0 1 17 18Z" }),
73
+ rain: /* @__PURE__ */ jsxs(Fragment, { children: [
74
+ /* @__PURE__ */ jsx("path", { d: "M6.5 13a3 3 0 1 1 .4-6A4.5 4.5 0 0 1 15.5 8.5 3 3 0 0 1 15 13Z" }),
75
+ /* @__PURE__ */ jsx("line", {
76
+ x1: "8",
77
+ y1: "15",
78
+ x2: "7",
79
+ y2: "18"
80
+ }),
81
+ /* @__PURE__ */ jsx("line", {
82
+ x1: "12",
83
+ y1: "15",
84
+ x2: "11",
85
+ y2: "18"
86
+ }),
87
+ /* @__PURE__ */ jsx("line", {
88
+ x1: "16",
89
+ y1: "15",
90
+ x2: "15",
91
+ y2: "18"
92
+ })
93
+ ] }),
94
+ snow: /* @__PURE__ */ jsxs(Fragment, { children: [
95
+ /* @__PURE__ */ jsx("path", { d: "M6.5 13a3 3 0 1 1 .4-6A4.5 4.5 0 0 1 15.5 8.5 3 3 0 0 1 15 13Z" }),
96
+ /* @__PURE__ */ jsx("circle", {
97
+ cx: "7.5",
98
+ cy: "17",
99
+ r: "0.75",
100
+ fill: "currentColor",
101
+ stroke: "none"
102
+ }),
103
+ /* @__PURE__ */ jsx("circle", {
104
+ cx: "12",
105
+ cy: "18",
106
+ r: "0.75",
107
+ fill: "currentColor",
108
+ stroke: "none"
109
+ }),
110
+ /* @__PURE__ */ jsx("circle", {
111
+ cx: "16.5",
112
+ cy: "17",
113
+ r: "0.75",
114
+ fill: "currentColor",
115
+ stroke: "none"
116
+ })
117
+ ] }),
118
+ wind: /* @__PURE__ */ jsxs(Fragment, { children: [
119
+ /* @__PURE__ */ jsx("path", { d: "M3 7.5h10.5a2.5 2.5 0 1 0-2-4" }),
120
+ /* @__PURE__ */ jsx("path", { d: "M3 12h14a2.5 2.5 0 1 1-2 4" }),
121
+ /* @__PURE__ */ jsx("path", { d: "M3 16.5h8" })
122
+ ] }),
123
+ play: /* @__PURE__ */ jsx("path", { d: "M7 4.5v15l13-7.5z" }),
124
+ pause: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("line", {
125
+ x1: "8",
126
+ y1: "4",
127
+ x2: "8",
128
+ y2: "20"
129
+ }), /* @__PURE__ */ jsx("line", {
130
+ x1: "16",
131
+ y1: "4",
132
+ x2: "16",
133
+ y2: "20"
134
+ })] }),
135
+ check: /* @__PURE__ */ jsx("path", { d: "M4 12.5l5 5.5 11-12" }),
136
+ x: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("line", {
137
+ x1: "5",
138
+ y1: "5",
139
+ x2: "19",
140
+ y2: "19"
141
+ }), /* @__PURE__ */ jsx("line", {
142
+ x1: "19",
143
+ y1: "5",
144
+ x2: "5",
145
+ y2: "19"
146
+ })] }),
147
+ star: /* @__PURE__ */ jsx("path", { d: "M12 2.5l2.6 5.9 6.4.6-4.8 4.3 1.4 6.3-5.6-3-5.6 3 1.4-6.3-4.8-4.3 6.4-.6z" }),
148
+ heart: /* @__PURE__ */ jsx("path", { d: "M12 20s-7.5-4.7-9.8-9.6C.6 6.8 3 3.3 6.6 3.3c2 0 3.7 1.1 5.4 3.3 1.7-2.2 3.4-3.3 5.4-3.3 3.6 0 6 3.5 4.4 7.1C19.5 15.3 12 20 12 20z" }),
149
+ "arrow-right": /* @__PURE__ */ jsx("path", { d: "M4 12h15M13 6l6 6-6 6" }),
150
+ "arrow-up-right": /* @__PURE__ */ jsx("path", { d: "M7 17L17 7M9 7h8v8" }),
151
+ "chevron-right": /* @__PURE__ */ jsx("path", { d: "M9 5l7 7-7 7" }),
152
+ calendar: /* @__PURE__ */ jsxs(Fragment, { children: [
153
+ /* @__PURE__ */ jsx("rect", {
154
+ x: "3.5",
155
+ y: "5",
156
+ width: "17",
157
+ height: "15",
158
+ rx: "2"
159
+ }),
160
+ /* @__PURE__ */ jsx("line", {
161
+ x1: "3.5",
162
+ y1: "9.5",
163
+ x2: "20.5",
164
+ y2: "9.5"
165
+ }),
166
+ /* @__PURE__ */ jsx("line", {
167
+ x1: "8",
168
+ y1: "3",
169
+ x2: "8",
170
+ y2: "7"
171
+ }),
172
+ /* @__PURE__ */ jsx("line", {
173
+ x1: "16",
174
+ y1: "3",
175
+ x2: "16",
176
+ y2: "7"
177
+ })
178
+ ] }),
179
+ clock: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("circle", {
180
+ cx: "12",
181
+ cy: "12",
182
+ r: "8.5"
183
+ }), /* @__PURE__ */ jsx("path", { d: "M12 7.5V12l3.5 2" })] }),
184
+ "map-pin": /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("path", { d: "M12 21s7-6.7 7-12.2A7 7 0 1 0 5 8.8C5 14.3 12 21 12 21z" }), /* @__PURE__ */ jsx("circle", {
185
+ cx: "12",
186
+ cy: "8.8",
187
+ r: "2.3"
188
+ })] }),
189
+ plane: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("path", { d: "M3 12l18-8-6 18-3-7-7-3z" }), /* @__PURE__ */ jsx("path", { d: "M12 15l3-3" })] }),
190
+ truck: /* @__PURE__ */ jsxs(Fragment, { children: [
191
+ /* @__PURE__ */ jsx("path", { d: "M2 8h11v9H2z" }),
192
+ /* @__PURE__ */ jsx("path", { d: "M13 11h4l3 3v3h-7z" }),
193
+ /* @__PURE__ */ jsx("circle", {
194
+ cx: "6",
195
+ cy: "19",
196
+ r: "1.8"
197
+ }),
198
+ /* @__PURE__ */ jsx("circle", {
199
+ cx: "17",
200
+ cy: "19",
201
+ r: "1.8"
202
+ })
203
+ ] }),
204
+ "credit-card": /* @__PURE__ */ jsxs(Fragment, { children: [
205
+ /* @__PURE__ */ jsx("rect", {
206
+ x: "2.5",
207
+ y: "5.5",
208
+ width: "19",
209
+ height: "13",
210
+ rx: "2"
211
+ }),
212
+ /* @__PURE__ */ jsx("line", {
213
+ x1: "2.5",
214
+ y1: "10",
215
+ x2: "21.5",
216
+ y2: "10"
217
+ }),
218
+ /* @__PURE__ */ jsx("line", {
219
+ x1: "6",
220
+ y1: "15",
221
+ x2: "10",
222
+ y2: "15"
223
+ })
224
+ ] }),
225
+ user: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("circle", {
226
+ cx: "12",
227
+ cy: "8",
228
+ r: "3.6"
229
+ }), /* @__PURE__ */ jsx("path", { d: "M4.5 20.5a7.5 7.5 0 0 1 15 0" })] }),
230
+ search: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("circle", {
231
+ cx: "10.5",
232
+ cy: "10.5",
233
+ r: "6.5"
234
+ }), /* @__PURE__ */ jsx("line", {
235
+ x1: "20",
236
+ y1: "20",
237
+ x2: "15.3",
238
+ y2: "15.3"
239
+ })] }),
240
+ bell: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("path", { d: "M12 3a5.5 5.5 0 0 0-5.5 5.5c0 4.5-2 6-2 6h15s-2-1.5-2-6A5.5 5.5 0 0 0 12 3z" }), /* @__PURE__ */ jsx("path", { d: "M10 19a2 2 0 0 0 4 0" })] })
241
+ };
242
+ const iconVocabulary = { Icon: {
243
+ description: "A small line icon from the built-in set. `size` controls the rendered pixel size.",
244
+ properties: z.object({
245
+ name: z.enum(ICON_NAMES).describe("Which built-in icon to render."),
246
+ size: z.enum(ICON_SIZE_TOKENS).optional().describe("Icon size; defaults to `md` (16px).")
247
+ }),
248
+ render: ({ name, size }) => {
249
+ const glyph = ICON_GLYPHS[name];
250
+ if (!glyph) return null;
251
+ const px = ICON_SIZE_PX[size ?? "md"];
252
+ return /* @__PURE__ */ jsx("svg", {
253
+ "data-aui": "icon",
254
+ "data-aui-name": name,
255
+ "data-aui-size": size,
256
+ viewBox: "0 0 24 24",
257
+ width: px,
258
+ height: px,
259
+ fill: "none",
260
+ stroke: "currentColor",
261
+ strokeWidth: "2",
262
+ strokeLinecap: "round",
263
+ strokeLinejoin: "round",
264
+ "aria-hidden": "true",
265
+ children: glyph
266
+ });
267
+ }
268
+ } };
269
+ //#endregion
270
+ export { iconVocabulary };
271
+
272
+ //# sourceMappingURL=icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon.js","names":[],"sources":["../../src/vocabulary/icon.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { z } from \"zod\";\nimport type { GenerativeUILibrary } from \"../types\";\nimport { ICON_NAMES } from \"../ir\";\n\nconst ICON_SIZE_TOKENS = [\"sm\", \"md\", \"lg\"] as const;\nconst ICON_SIZE_PX: Record<(typeof ICON_SIZE_TOKENS)[number], number> = {\n sm: 14,\n md: 16,\n lg: 20,\n};\n\nconst ICON_GLYPHS: Record<(typeof ICON_NAMES)[number], ReactNode> = {\n sun: (\n <>\n <circle cx=\"12\" cy=\"12\" r=\"4.5\" />\n <line x1=\"12\" y1=\"2\" x2=\"12\" y2=\"5\" />\n <line x1=\"12\" y1=\"19\" x2=\"12\" y2=\"22\" />\n <line x1=\"2\" y1=\"12\" x2=\"5\" y2=\"12\" />\n <line x1=\"19\" y1=\"12\" x2=\"22\" y2=\"12\" />\n <line x1=\"5.5\" y1=\"5.5\" x2=\"7.5\" y2=\"7.5\" />\n <line x1=\"16.5\" y1=\"16.5\" x2=\"18.5\" y2=\"18.5\" />\n <line x1=\"18.5\" y1=\"5.5\" x2=\"16.5\" y2=\"7.5\" />\n <line x1=\"7.5\" y1=\"16.5\" x2=\"5.5\" y2=\"18.5\" />\n </>\n ),\n moon: <path d=\"M19 13.5A8.5 8.5 0 1 1 10.5 4.5 6.8 6.8 0 0 0 19 13.5Z\" />,\n cloud: (\n <path d=\"M7 18a4 4 0 1 1 .5-8A5.5 5.5 0 0 1 17.5 11.5 3.5 3.5 0 0 1 17 18Z\" />\n ),\n rain: (\n <>\n <path d=\"M6.5 13a3 3 0 1 1 .4-6A4.5 4.5 0 0 1 15.5 8.5 3 3 0 0 1 15 13Z\" />\n <line x1=\"8\" y1=\"15\" x2=\"7\" y2=\"18\" />\n <line x1=\"12\" y1=\"15\" x2=\"11\" y2=\"18\" />\n <line x1=\"16\" y1=\"15\" x2=\"15\" y2=\"18\" />\n </>\n ),\n snow: (\n <>\n <path d=\"M6.5 13a3 3 0 1 1 .4-6A4.5 4.5 0 0 1 15.5 8.5 3 3 0 0 1 15 13Z\" />\n <circle cx=\"7.5\" cy=\"17\" r=\"0.75\" fill=\"currentColor\" stroke=\"none\" />\n <circle cx=\"12\" cy=\"18\" r=\"0.75\" fill=\"currentColor\" stroke=\"none\" />\n <circle cx=\"16.5\" cy=\"17\" r=\"0.75\" fill=\"currentColor\" stroke=\"none\" />\n </>\n ),\n wind: (\n <>\n <path d=\"M3 7.5h10.5a2.5 2.5 0 1 0-2-4\" />\n <path d=\"M3 12h14a2.5 2.5 0 1 1-2 4\" />\n <path d=\"M3 16.5h8\" />\n </>\n ),\n play: <path d=\"M7 4.5v15l13-7.5z\" />,\n pause: (\n <>\n <line x1=\"8\" y1=\"4\" x2=\"8\" y2=\"20\" />\n <line x1=\"16\" y1=\"4\" x2=\"16\" y2=\"20\" />\n </>\n ),\n check: <path d=\"M4 12.5l5 5.5 11-12\" />,\n x: (\n <>\n <line x1=\"5\" y1=\"5\" x2=\"19\" y2=\"19\" />\n <line x1=\"19\" y1=\"5\" x2=\"5\" y2=\"19\" />\n </>\n ),\n star: (\n <path d=\"M12 2.5l2.6 5.9 6.4.6-4.8 4.3 1.4 6.3-5.6-3-5.6 3 1.4-6.3-4.8-4.3 6.4-.6z\" />\n ),\n heart: (\n <path d=\"M12 20s-7.5-4.7-9.8-9.6C.6 6.8 3 3.3 6.6 3.3c2 0 3.7 1.1 5.4 3.3 1.7-2.2 3.4-3.3 5.4-3.3 3.6 0 6 3.5 4.4 7.1C19.5 15.3 12 20 12 20z\" />\n ),\n \"arrow-right\": <path d=\"M4 12h15M13 6l6 6-6 6\" />,\n \"arrow-up-right\": <path d=\"M7 17L17 7M9 7h8v8\" />,\n \"chevron-right\": <path d=\"M9 5l7 7-7 7\" />,\n calendar: (\n <>\n <rect x=\"3.5\" y=\"5\" width=\"17\" height=\"15\" rx=\"2\" />\n <line x1=\"3.5\" y1=\"9.5\" x2=\"20.5\" y2=\"9.5\" />\n <line x1=\"8\" y1=\"3\" x2=\"8\" y2=\"7\" />\n <line x1=\"16\" y1=\"3\" x2=\"16\" y2=\"7\" />\n </>\n ),\n clock: (\n <>\n <circle cx=\"12\" cy=\"12\" r=\"8.5\" />\n <path d=\"M12 7.5V12l3.5 2\" />\n </>\n ),\n \"map-pin\": (\n <>\n <path d=\"M12 21s7-6.7 7-12.2A7 7 0 1 0 5 8.8C5 14.3 12 21 12 21z\" />\n <circle cx=\"12\" cy=\"8.8\" r=\"2.3\" />\n </>\n ),\n plane: (\n <>\n <path d=\"M3 12l18-8-6 18-3-7-7-3z\" />\n <path d=\"M12 15l3-3\" />\n </>\n ),\n truck: (\n <>\n <path d=\"M2 8h11v9H2z\" />\n <path d=\"M13 11h4l3 3v3h-7z\" />\n <circle cx=\"6\" cy=\"19\" r=\"1.8\" />\n <circle cx=\"17\" cy=\"19\" r=\"1.8\" />\n </>\n ),\n \"credit-card\": (\n <>\n <rect x=\"2.5\" y=\"5.5\" width=\"19\" height=\"13\" rx=\"2\" />\n <line x1=\"2.5\" y1=\"10\" x2=\"21.5\" y2=\"10\" />\n <line x1=\"6\" y1=\"15\" x2=\"10\" y2=\"15\" />\n </>\n ),\n user: (\n <>\n <circle cx=\"12\" cy=\"8\" r=\"3.6\" />\n <path d=\"M4.5 20.5a7.5 7.5 0 0 1 15 0\" />\n </>\n ),\n search: (\n <>\n <circle cx=\"10.5\" cy=\"10.5\" r=\"6.5\" />\n <line x1=\"20\" y1=\"20\" x2=\"15.3\" y2=\"15.3\" />\n </>\n ),\n bell: (\n <>\n <path d=\"M12 3a5.5 5.5 0 0 0-5.5 5.5c0 4.5-2 6-2 6h15s-2-1.5-2-6A5.5 5.5 0 0 0 12 3z\" />\n <path d=\"M10 19a2 2 0 0 0 4 0\" />\n </>\n ),\n};\n\nexport const iconVocabulary = {\n Icon: {\n description:\n \"A small line icon from the built-in set. `size` controls the rendered pixel size.\",\n properties: z.object({\n name: z.enum(ICON_NAMES).describe(\"Which built-in icon to render.\"),\n size: z\n .enum(ICON_SIZE_TOKENS)\n .optional()\n .describe(\"Icon size; defaults to `md` (16px).\"),\n }),\n render: ({ name, size }) => {\n const glyph = ICON_GLYPHS[name as keyof typeof ICON_GLYPHS];\n if (!glyph) return null;\n const px = ICON_SIZE_PX[(size as keyof typeof ICON_SIZE_PX) ?? \"md\"];\n\n return (\n <svg\n data-aui=\"icon\"\n data-aui-name={name}\n data-aui-size={size}\n viewBox=\"0 0 24 24\"\n width={px}\n height={px}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n {glyph}\n </svg>\n );\n },\n },\n} satisfies GenerativeUILibrary;\n"],"mappings":";;;;AAKA,MAAM,mBAAmB;CAAC;CAAM;CAAM;AAAI;AAC1C,MAAM,eAAkE;CACtE,IAAI;CACJ,IAAI;CACJ,IAAI;AACN;AAEA,MAAM,cAA8D;CAClE,KACE,qBAAA,UAAA,EAAA,UAAA;EACE,oBAAC,UAAD;GAAQ,IAAG;GAAK,IAAG;GAAK,GAAE;EAAO,CAAA;EACjC,oBAAC,QAAD;GAAM,IAAG;GAAK,IAAG;GAAI,IAAG;GAAK,IAAG;EAAK,CAAA;EACrC,oBAAC,QAAD;GAAM,IAAG;GAAK,IAAG;GAAK,IAAG;GAAK,IAAG;EAAM,CAAA;EACvC,oBAAC,QAAD;GAAM,IAAG;GAAI,IAAG;GAAK,IAAG;GAAI,IAAG;EAAM,CAAA;EACrC,oBAAC,QAAD;GAAM,IAAG;GAAK,IAAG;GAAK,IAAG;GAAK,IAAG;EAAM,CAAA;EACvC,oBAAC,QAAD;GAAM,IAAG;GAAM,IAAG;GAAM,IAAG;GAAM,IAAG;EAAO,CAAA;EAC3C,oBAAC,QAAD;GAAM,IAAG;GAAO,IAAG;GAAO,IAAG;GAAO,IAAG;EAAQ,CAAA;EAC/C,oBAAC,QAAD;GAAM,IAAG;GAAO,IAAG;GAAM,IAAG;GAAO,IAAG;EAAO,CAAA;EAC7C,oBAAC,QAAD;GAAM,IAAG;GAAM,IAAG;GAAO,IAAG;GAAM,IAAG;EAAQ,CAAA;CAC7C,EAAA,CAAA;CAEJ,MAAM,oBAAC,QAAD,EAAM,GAAE,yDAA0D,CAAA;CACxE,OACE,oBAAC,QAAD,EAAM,GAAE,oEAAqE,CAAA;CAE/E,MACE,qBAAA,UAAA,EAAA,UAAA;EACE,oBAA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,OAAO;EACnB,MAAM,EAAE,KAAK,UAAU,CAAC,CAAC,SAAS,gCAAgC;EAClE,MAAM,EACH,KAAK,gBAAgB,CAAC,CACtB,SAAS,CAAC,CACV,SAAS,qCAAqC;CACnD,CAAC;CACD,SAAS,EAAE,MAAM,WAAW;EAC1B,MAAM,QAAQ,YAAY;EAC1B,IAAI,CAAC,OAAO,OAAO;EACnB,MAAM,KAAK,aAAc,QAAsC;EAE/D,OACE,oBAAC,OAAD;GACE,YAAS;GACT,iBAAe;GACf,iBAAe;GACf,SAAQ;GACR,OAAO;GACP,QAAQ;GACR,MAAK;GACL,QAAO;GACP,aAAY;GACZ,eAAc;GACd,gBAAe;GACf,eAAY;aAEX;EACE,CAAA;CAET;AACF,EACF"}
@@ -0,0 +1,15 @@
1
+ import { GenerativeUILibrary } from "../types.js";
2
+ //#region src/vocabulary/index.d.ts
3
+ /**
4
+ * The closed generative-ui vocabulary the factory ships: a fixed set of
5
+ * intrinsic components the model may render, each a zod `properties` schema
6
+ * plus an unstyled structural `render` (semantic HTML with a `data-aui`
7
+ * attribute naming the component, plus `data-aui-<prop>` hooks, for the host
8
+ * to style). Users opt in by passing it to
9
+ * `new JSONGenerativeUI({ library: defaultGenerativeUILibrary })`, and override
10
+ * or extend entries with their own `defineGenerativeComponents`.
11
+ */
12
+ declare const defaultGenerativeUILibrary: GenerativeUILibrary;
13
+ //#endregion
14
+ export { defaultGenerativeUILibrary };
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/vocabulary/index.ts"],"mappings":";;;;;;;;;;;cAqBa,4BAA4B"}
@@ -0,0 +1,36 @@
1
+ import { alertVocabulary } from "./alert.js";
2
+ import { dataVocabulary } from "./data.js";
3
+ import { factVocabulary } from "./fact.js";
4
+ import { formVocabulary } from "./form.js";
5
+ import { iconVocabulary } from "./icon.js";
6
+ import { interactiveVocabulary } from "./interactive.js";
7
+ import { layoutVocabulary } from "./layout.js";
8
+ import { listVocabulary } from "./list.js";
9
+ import { mediaVocabulary } from "./media.js";
10
+ import { textVocabulary } from "./text.js";
11
+ //#region src/vocabulary/index.ts
12
+ /**
13
+ * The closed generative-ui vocabulary the factory ships: a fixed set of
14
+ * intrinsic components the model may render, each a zod `properties` schema
15
+ * plus an unstyled structural `render` (semantic HTML with a `data-aui`
16
+ * attribute naming the component, plus `data-aui-<prop>` hooks, for the host
17
+ * to style). Users opt in by passing it to
18
+ * `new JSONGenerativeUI({ library: defaultGenerativeUILibrary })`, and override
19
+ * or extend entries with their own `defineGenerativeComponents`.
20
+ */
21
+ const defaultGenerativeUILibrary = {
22
+ ...textVocabulary,
23
+ ...mediaVocabulary,
24
+ ...factVocabulary,
25
+ ...interactiveVocabulary,
26
+ ...formVocabulary,
27
+ ...layoutVocabulary,
28
+ ...listVocabulary,
29
+ ...dataVocabulary,
30
+ ...alertVocabulary,
31
+ ...iconVocabulary
32
+ };
33
+ //#endregion
34
+ export { defaultGenerativeUILibrary };
35
+
36
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/vocabulary/index.ts"],"sourcesContent":["import type { GenerativeUILibrary } from \"../types\";\nimport { alertVocabulary } from \"./alert\";\nimport { dataVocabulary } from \"./data\";\nimport { factVocabulary } from \"./fact\";\nimport { formVocabulary } from \"./form\";\nimport { iconVocabulary } from \"./icon\";\nimport { interactiveVocabulary } from \"./interactive\";\nimport { layoutVocabulary } from \"./layout\";\nimport { listVocabulary } from \"./list\";\nimport { mediaVocabulary } from \"./media\";\nimport { textVocabulary } from \"./text\";\n\n/**\n * The closed generative-ui vocabulary the factory ships: a fixed set of\n * intrinsic components the model may render, each a zod `properties` schema\n * plus an unstyled structural `render` (semantic HTML with a `data-aui`\n * attribute naming the component, plus `data-aui-<prop>` hooks, for the host\n * to style). Users opt in by passing it to\n * `new JSONGenerativeUI({ library: defaultGenerativeUILibrary })`, and override\n * or extend entries with their own `defineGenerativeComponents`.\n */\nexport const defaultGenerativeUILibrary: GenerativeUILibrary = {\n ...textVocabulary,\n ...mediaVocabulary,\n ...factVocabulary,\n ...interactiveVocabulary,\n ...formVocabulary,\n ...layoutVocabulary,\n ...listVocabulary,\n ...dataVocabulary,\n ...alertVocabulary,\n ...iconVocabulary,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqBA,MAAa,6BAAkD;CAC7D,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACL"}
@@ -0,0 +1,93 @@
1
+ import { Action } from "../ir.js";
2
+ import { GenerativeUIDispatch } from "../types.js";
3
+ import { z } from "zod";
4
+ //#region src/vocabulary/interactive.d.ts
5
+ type RadioGroupRenderProps = {
6
+ options: {
7
+ label: string;
8
+ value: string;
9
+ }[];
10
+ name?: string;
11
+ label?: string;
12
+ defaultValue?: string;
13
+ $action?: Action;
14
+ $dispatch?: GenerativeUIDispatch;
15
+ };
16
+ declare function RadioGroupRender({ options, name, label, defaultValue, $action, $dispatch }: RadioGroupRenderProps): import("react").JSX.Element;
17
+ declare const interactiveVocabulary: {
18
+ Button: {
19
+ description: string;
20
+ properties: z.ZodObject<{
21
+ label: z.ZodString;
22
+ buttonStyle: z.ZodOptional<z.ZodEnum<{
23
+ secondary: "secondary";
24
+ primary: "primary";
25
+ outline: "outline";
26
+ ghost: "ghost";
27
+ danger: "danger";
28
+ }>>;
29
+ block: z.ZodOptional<z.ZodBoolean>;
30
+ submit: z.ZodOptional<z.ZodBoolean>;
31
+ }, z.core.$strip>;
32
+ render: ({ label, buttonStyle, block, submit, $action, $dispatch, children }: any) => import("react").JSX.Element;
33
+ };
34
+ Select: {
35
+ description: string;
36
+ properties: z.ZodObject<{
37
+ options: z.ZodArray<z.ZodObject<{
38
+ label: z.ZodString;
39
+ value: z.ZodString;
40
+ }, z.core.$strip>>;
41
+ placeholder: z.ZodOptional<z.ZodString>;
42
+ label: z.ZodOptional<z.ZodString>;
43
+ name: z.ZodOptional<z.ZodString>;
44
+ }, z.core.$strip>;
45
+ render: ({ options, placeholder, label, name, $action, $dispatch, children }: any) => import("react").JSX.Element;
46
+ };
47
+ Input: {
48
+ description: string;
49
+ properties: z.ZodObject<{
50
+ placeholder: z.ZodOptional<z.ZodString>;
51
+ multiline: z.ZodOptional<z.ZodBoolean>;
52
+ label: z.ZodOptional<z.ZodString>;
53
+ name: z.ZodOptional<z.ZodString>;
54
+ }, z.core.$strip>;
55
+ render: ({ placeholder, multiline, label, name, $action, $dispatch }: any) => import("react").JSX.Element;
56
+ };
57
+ DatePicker: {
58
+ description: string;
59
+ properties: z.ZodObject<{
60
+ value: z.ZodOptional<z.ZodString>;
61
+ min: z.ZodOptional<z.ZodString>;
62
+ max: z.ZodOptional<z.ZodString>;
63
+ label: z.ZodOptional<z.ZodString>;
64
+ name: z.ZodOptional<z.ZodString>;
65
+ }, z.core.$strip>;
66
+ render: ({ value, min, max, label, name, $action, $dispatch }: any) => import("react").JSX.Element;
67
+ };
68
+ Checkbox: {
69
+ description: string;
70
+ properties: z.ZodObject<{
71
+ label: z.ZodString;
72
+ name: z.ZodOptional<z.ZodString>;
73
+ defaultChecked: z.ZodOptional<z.ZodBoolean>;
74
+ }, z.core.$strip>;
75
+ render: ({ label, name, defaultChecked, $action, $dispatch }: any) => import("react").JSX.Element;
76
+ };
77
+ RadioGroup: {
78
+ description: string;
79
+ properties: z.ZodObject<{
80
+ options: z.ZodArray<z.ZodObject<{
81
+ label: z.ZodString;
82
+ value: z.ZodString;
83
+ }, z.core.$strip>>;
84
+ name: z.ZodOptional<z.ZodString>;
85
+ label: z.ZodOptional<z.ZodString>;
86
+ defaultValue: z.ZodOptional<z.ZodString>;
87
+ }, z.core.$strip>;
88
+ render: typeof RadioGroupRender;
89
+ };
90
+ };
91
+ //#endregion
92
+ export { interactiveVocabulary };
93
+ //# sourceMappingURL=interactive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interactive.d.ts","names":[],"sources":["../../src/vocabulary/interactive.tsx"],"mappings":";;;;KAYK;EACH;IAAW;IAAe;;EAC1B;EACA;EACA;EACA,UAAU;EACV,YAAY;;iBAGL,mBACP,SACA,MACA,OACA,cACA,SACA,aACC,wCAAqB,IAAA;cA8BX"}