glchat-a2ui-react-renderer 0.2.7 → 0.2.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 (110) hide show
  1. package/README.md +223 -178
  2. package/dist/index.d.ts +10 -4
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +13 -5
  5. package/dist/src/Provider.d.ts +21 -14
  6. package/dist/src/Provider.d.ts.map +1 -1
  7. package/dist/src/Provider.js +56 -42
  8. package/dist/src/SurfaceRenderer.d.ts +17 -0
  9. package/dist/src/SurfaceRenderer.d.ts.map +1 -0
  10. package/dist/src/SurfaceRenderer.js +28 -0
  11. package/dist/src/components/a2ui/Button/Button.d.ts +313 -3
  12. package/dist/src/components/a2ui/Button/Button.d.ts.map +1 -1
  13. package/dist/src/components/a2ui/Button/Button.js +29 -14
  14. package/dist/src/components/a2ui/{MultipleChoice → ChoicePicker}/CheckboxList.d.ts +1 -2
  15. package/dist/src/components/a2ui/ChoicePicker/CheckboxList.d.ts.map +1 -0
  16. package/dist/src/components/a2ui/{MultipleChoice → ChoicePicker}/CheckboxList.js +2 -13
  17. package/dist/src/components/a2ui/ChoicePicker/ChoicePicker.d.ts +9 -0
  18. package/dist/src/components/a2ui/ChoicePicker/ChoicePicker.d.ts.map +1 -0
  19. package/dist/src/components/a2ui/ChoicePicker/ChoicePicker.js +54 -0
  20. package/dist/src/components/a2ui/ChoicePicker/theme.d.ts +10 -0
  21. package/dist/src/components/a2ui/ChoicePicker/theme.d.ts.map +1 -0
  22. package/dist/src/components/a2ui/{MultipleChoice → ChoicePicker}/theme.js +12 -9
  23. package/dist/src/components/a2ui/TagInput/TagInput.d.ts +289 -3
  24. package/dist/src/components/a2ui/TagInput/TagInput.d.ts.map +1 -1
  25. package/dist/src/components/a2ui/TagInput/TagInput.js +44 -54
  26. package/dist/src/components/a2ui/TagInput/theme.d.ts +0 -9
  27. package/dist/src/components/a2ui/TagInput/theme.d.ts.map +1 -1
  28. package/dist/src/components/a2ui/TagInput/theme.js +1 -9
  29. package/dist/src/components/a2ui/Timeout/Timeout.d.ts +154 -3
  30. package/dist/src/components/a2ui/Timeout/Timeout.d.ts.map +1 -1
  31. package/dist/src/components/a2ui/Timeout/Timeout.js +40 -25
  32. package/dist/src/components/a2ui/common.d.ts +87 -0
  33. package/dist/src/components/a2ui/common.d.ts.map +1 -0
  34. package/dist/src/components/a2ui/common.js +23 -0
  35. package/dist/src/components/ui/Button/theme.d.ts +1 -1
  36. package/dist/src/components/ui/Button/theme.d.ts.map +1 -1
  37. package/dist/src/components/ui/Button/theme.js +11 -0
  38. package/dist/src/components/ui/MultiSelect/MultiSelect.d.ts +1 -1
  39. package/dist/src/components/ui/MultiSelect/MultiSelect.d.ts.map +1 -1
  40. package/dist/src/components/ui/Select/theme.d.ts.map +1 -1
  41. package/dist/src/components/ui/Select/theme.js +0 -1
  42. package/dist/src/utils/catalog.d.ts +16 -4
  43. package/dist/src/utils/catalog.d.ts.map +1 -1
  44. package/dist/src/utils/catalog.js +32 -23
  45. package/dist/src/utils/useSurfaces.d.ts +9 -0
  46. package/dist/src/utils/useSurfaces.d.ts.map +1 -0
  47. package/dist/src/utils/useSurfaces.js +28 -0
  48. package/json/README.md +36 -49
  49. package/json/a2ui-sample-messages.json +170 -315
  50. package/json/glchat_standard_catalog_definition.json +1236 -610
  51. package/package.json +11 -5
  52. package/styles/globals.css +196 -120
  53. package/dist/src/AllSurfacesRenderer.d.ts +0 -14
  54. package/dist/src/AllSurfacesRenderer.d.ts.map +0 -1
  55. package/dist/src/AllSurfacesRenderer.js +0 -18
  56. package/dist/src/SingleSurfaceRenderer.d.ts +0 -15
  57. package/dist/src/SingleSurfaceRenderer.d.ts.map +0 -1
  58. package/dist/src/SingleSurfaceRenderer.js +0 -9
  59. package/dist/src/components/a2ui/Button/theme.d.ts +0 -5
  60. package/dist/src/components/a2ui/Button/theme.d.ts.map +0 -1
  61. package/dist/src/components/a2ui/Button/theme.js +0 -5
  62. package/dist/src/components/a2ui/ButtonAsLink/ButtonAsLink.d.ts +0 -4
  63. package/dist/src/components/a2ui/ButtonAsLink/ButtonAsLink.d.ts.map +0 -1
  64. package/dist/src/components/a2ui/ButtonAsLink/ButtonAsLink.js +0 -42
  65. package/dist/src/components/a2ui/ButtonAsLink/theme.d.ts +0 -8
  66. package/dist/src/components/a2ui/ButtonAsLink/theme.d.ts.map +0 -1
  67. package/dist/src/components/a2ui/ButtonAsLink/theme.js +0 -8
  68. package/dist/src/components/a2ui/Card/theme.d.ts +0 -4
  69. package/dist/src/components/a2ui/Card/theme.d.ts.map +0 -1
  70. package/dist/src/components/a2ui/Card/theme.js +0 -15
  71. package/dist/src/components/a2ui/CheckBox/theme.d.ts +0 -4
  72. package/dist/src/components/a2ui/CheckBox/theme.d.ts.map +0 -1
  73. package/dist/src/components/a2ui/CheckBox/theme.js +0 -11
  74. package/dist/src/components/a2ui/DateTimeInput/theme.d.ts +0 -8
  75. package/dist/src/components/a2ui/DateTimeInput/theme.d.ts.map +0 -1
  76. package/dist/src/components/a2ui/DateTimeInput/theme.js +0 -11
  77. package/dist/src/components/a2ui/DestructiveButton/DestructiveButton.d.ts +0 -4
  78. package/dist/src/components/a2ui/DestructiveButton/DestructiveButton.d.ts.map +0 -1
  79. package/dist/src/components/a2ui/DestructiveButton/DestructiveButton.js +0 -22
  80. package/dist/src/components/a2ui/DestructiveButton/theme.d.ts +0 -8
  81. package/dist/src/components/a2ui/DestructiveButton/theme.d.ts.map +0 -1
  82. package/dist/src/components/a2ui/DestructiveButton/theme.js +0 -8
  83. package/dist/src/components/a2ui/MultipleChoice/CheckboxList.d.ts.map +0 -1
  84. package/dist/src/components/a2ui/MultipleChoice/MultipleChoice.d.ts +0 -4
  85. package/dist/src/components/a2ui/MultipleChoice/MultipleChoice.d.ts.map +0 -1
  86. package/dist/src/components/a2ui/MultipleChoice/MultipleChoice.js +0 -72
  87. package/dist/src/components/a2ui/MultipleChoice/theme.d.ts +0 -13
  88. package/dist/src/components/a2ui/MultipleChoice/theme.d.ts.map +0 -1
  89. package/dist/src/components/a2ui/TextField/theme.d.ts +0 -4
  90. package/dist/src/components/a2ui/TextField/theme.d.ts.map +0 -1
  91. package/dist/src/components/a2ui/TextField/theme.js +0 -9
  92. package/dist/src/components/a2ui/Timeout/theme.d.ts +0 -8
  93. package/dist/src/components/a2ui/Timeout/theme.d.ts.map +0 -1
  94. package/dist/src/components/a2ui/Timeout/theme.js +0 -12
  95. package/dist/src/components/a2ui/types.d.ts +0 -12
  96. package/dist/src/components/a2ui/types.d.ts.map +0 -1
  97. package/dist/src/components/a2ui/types.js +0 -1
  98. package/dist/src/components/ui/Button/ButtonAsLink.d.ts +0 -15
  99. package/dist/src/components/ui/Button/ButtonAsLink.d.ts.map +0 -1
  100. package/dist/src/components/ui/Button/ButtonAsLink.js +0 -17
  101. package/dist/src/components/ui/TextField/theme.d.ts +0 -4
  102. package/dist/src/components/ui/TextField/theme.d.ts.map +0 -1
  103. package/dist/src/components/ui/TextField/theme.js +0 -22
  104. package/dist/src/utils/href.d.ts +0 -11
  105. package/dist/src/utils/href.d.ts.map +0 -1
  106. package/dist/src/utils/href.js +0 -34
  107. package/dist/src/utils/theme.d.ts +0 -15
  108. package/dist/src/utils/theme.d.ts.map +0 -1
  109. package/dist/src/utils/theme.js +0 -93
  110. package/json/glchat_server_to_client_with_catalog.json +0 -1000
package/json/README.md CHANGED
@@ -2,73 +2,60 @@
2
2
 
3
3
  This folder contains JSON schema and sample payload files for the GLChat A2UI React renderer.
4
4
 
5
+ These files are generated from the official A2UI v0.9 basic catalog plus GLChat
6
+ extensions. To regenerate the catalog JSON after changing a component schema, run:
7
+
8
+ ```bash
9
+ npm run generate:json
10
+ ```
11
+
5
12
  ---
6
13
 
7
14
  ## `glchat_standard_catalog_definition.json` — GLChat component catalog
8
15
 
9
- An extended version of the official A2UI v0.8 standard catalog.
16
+ The GLChat extended A2UI **v0.9** unified catalog (components **and** functions).
17
+ It **extends** the official basic catalog JSON Schema (same structure as the
18
+ [rizzcharts custom catalog example](https://github.com/a2ui-project/a2ui/blob/main/samples/community/agent/adk/rizzcharts/catalog_schemas/0.9/rizzcharts_catalog_definition.json)):
19
+ clone [basic/catalog.json](https://github.com/a2ui-project/a2ui/blob/main/specification/v0_9/catalogs/basic/catalog.json),
20
+ normalize `common_types.json` refs, then merge GLChat overrides and extensions
21
+ generated from the live Zod component APIs.
10
22
 
11
- **Base specification:** [google/A2UI — specification/v0_8/json/standard_catalog_definition.json](https://github.com/google/A2UI/blob/main/specification/v0_8/json/standard_catalog_definition.json)
23
+ **Base specification:** [a2ui-project/a2ui — A2UI v0.9 basic catalog](https://github.com/a2ui-project/a2ui/blob/main/specification/v0_9/catalogs/basic/catalog.json)
12
24
 
13
25
  **Catalog ID:** `https://github.com/GDP-ADMIN/glchat-sdk/blob/main/js/glchat-a2ui-react-renderer/json/glchat_standard_catalog_definition.json`
14
26
 
15
- The GLChat catalog keeps full compatibility with the upstream schema and adds:
27
+ The GLChat catalog keeps the v0.9 basic catalog and adds/overrides:
16
28
 
17
- 1. **`DestructiveButton` component**
18
- A dedicated destructive-styled button (replaces the previous `destructive` boolean flag on `Button`). Requires `child` and `action`.
29
+ 1. **`Button`** (override) — GLChat-styled button. Extends the basic catalog schema
30
+ with a `destructive` variant.
19
31
 
20
- 2. **`ButtonAsLink` component**
21
- A button-styled anchor link. Requires `child` and `href`. Optional `target` (`_self`, `_blank`, `_parent`, `_top`) controls whether the link opens in the same tab or a new tab.
32
+ 2. **`ChoicePicker`** (override) — GLChat-styled choice picker. Schema matches the
33
+ basic catalog.
22
34
 
23
- 3. **`Timeout` component**
24
- A countdown to a target UTC time (ISO 8601). Supports:
25
- - `targetTimeUtc`: literal string or data-model path
26
- - `usageHint`: optional text style (`body`, `caption`, `h3`, `h4`, `h5`)
35
+ 3. **`TagInput`** (extension) — tag input field. `label`, `value` (string array),
36
+ `placeholder`, `disabled`, `disableTextInput`, `validationRegexp`,
37
+ `validationErrorMessage`.
27
38
 
28
- 4. **`TagInput` component**
29
- A tag input field for adding and removing string tags. Supports `label`, `values`, and `placeholder` via literal values or data-model paths.
39
+ 4. **`Timeout`** (extension) — countdown to a target UTC time. `targetTimeUtc`
40
+ (ISO 8601) and optional `variant` text style (`body`, `caption`, `h3`, `h4`, `h5`).
30
41
 
31
42
  ### Components
32
43
 
33
- | Component | Key properties |
44
+ | Component | Source |
34
45
  |---|---|
35
- | Text | `text` (literalString / path), `usageHint` |
36
- | Image | `url` (literalString / path), `fit`, `usageHint` |
37
- | Icon | `name` (`{ "literalString": "..." }` / path) |
38
- | Video | `url` (literalString / path) |
39
- | AudioPlayer | `url`, `description` |
40
- | Row | `children`, `distribution`, `alignment` |
41
- | Column | `children`, `distribution`, `alignment` |
42
- | List | `children` (explicitList / template + dataBinding), `direction`, `alignment` |
43
- | Card | `child` |
44
- | Tabs | `tabItems` (`title`, `child`) |
45
- | Divider | `axis` |
46
- | Modal | `entryPointChild`, `contentChild` |
47
- | Button | `child`, `action`, `primary` |
48
- | DestructiveButton | `child`, `action` ✦ |
49
- | ButtonAsLink | `child`, `href` (literalString / path), `target` (optional) ✦ |
50
- | CheckBox | `label`, `value` (path / literalBoolean) |
51
- | TextField | `label`, `text` (path / literalString), `textFieldType` |
52
- | DateTimeInput | `value` (path / literalString), `enableDate`, `enableTime` |
53
- | MultipleChoice | `selections` (path / literalArray), `options`, `maxAllowedSelections`, `variant`, `filterable` |
54
- | Slider | `value` (path / literalNumber), `minValue`, `maxValue` |
55
- | TagInput | `label`, `values`, `placeholder` (literal / path) ✦ |
56
- | Timeout | `targetTimeUtc` (path / literalString) ✦ |
57
-
58
- ---
59
-
60
- ## `glchat_server_to_client_with_catalog.json` — full server-to-client message schema
61
-
62
- An extended version of the official A2UI v0.8 server-to-client message schema.
63
-
64
- **Base specification:** [google/A2UI — specification/v0_8/json/server_to_client_with_standard_catalog.json](https://github.com/google/A2UI/blob/main/specification/v0_8/json/server_to_client_with_standard_catalog.json)
65
-
66
- The GLChat version is identical to the upstream schema except the **`surfaceUpdate.components[].component`** section, which uses the GLChat extended catalog (`glchat_standard_catalog_definition.json`).
67
-
68
- Use this file as the authoritative schema when validating server-generated A2UI payloads or configuring LLM structured-output for the GLChat renderer.
46
+ | Text, Image, Icon, Video, AudioPlayer | v0.9 basic catalog |
47
+ | Row, Column, List, Card, Tabs, Divider, Modal | v0.9 basic catalog |
48
+ | TextField, CheckBox, Slider, DateTimeInput | v0.9 basic catalog |
49
+ | Button | GLChat override |
50
+ | ChoicePicker | GLChat override |
51
+ | TagInput | GLChat extension |
52
+ | Timeout | GLChat extension |
69
53
 
70
54
  ---
71
55
 
72
56
  ## `a2ui-sample-messages.json` — sample message sequence (all components)
73
57
 
74
- A JSON array of four A2UI messages (one of each type) with a **surface that includes every component** from the catalog. Use for reference and testing.
58
+ A JSON array of A2UI **v0.9** messages (`createSurface`, `updateDataModel`,
59
+ `updateComponents`) describing a surface that includes **every component** from the
60
+ catalog. Validated against the catalog during generation. Use for reference and
61
+ testing.
@@ -1,338 +1,193 @@
1
1
  [
2
2
  {
3
- "surfaceUpdate": {
3
+ "version": "v0.9",
4
+ "createSurface": {
5
+ "surfaceId": "main",
6
+ "catalogId": "https://github.com/GDP-ADMIN/glchat-sdk/blob/main/js/glchat-a2ui-react-renderer/json/glchat_standard_catalog_definition.json",
7
+ "theme": {
8
+ "primaryColor": "#2563eb"
9
+ }
10
+ }
11
+ },
12
+ {
13
+ "version": "v0.9",
14
+ "updateDataModel": {
15
+ "surfaceId": "main",
16
+ "value": {
17
+ "form": {
18
+ "name": "Ada",
19
+ "agree": true,
20
+ "color": ["blue"],
21
+ "volume": 60,
22
+ "meeting": "2026-07-01T09:30",
23
+ "tags": ["alpha", "beta"],
24
+ "deadline": "2026-12-31T23:59:59Z"
25
+ }
26
+ }
27
+ }
28
+ },
29
+ {
30
+ "version": "v0.9",
31
+ "updateComponents": {
4
32
  "surfaceId": "main",
5
33
  "components": [
6
34
  {
7
35
  "id": "root",
8
- "component": {
9
- "Column": {
10
- "children": {
11
- "explicitList": [
12
- "text-sample",
13
- "row-sample",
14
- "card-sample",
15
- "button-sample",
16
- "textfield-sample",
17
- "checkbox-sample",
18
- "image-sample",
19
- "icon-sample",
20
- "divider-sample",
21
- "timeout-sample",
22
- "video-sample",
23
- "audio-sample",
24
- "tabs-sample",
25
- "slider-sample",
26
- "multiple-choice-sample",
27
- "datetime-sample",
28
- "list-sample",
29
- "modal-sample"
30
- ]
31
- },
32
- "distribution": "start",
33
- "alignment": "stretch"
34
- }
35
- }
36
- },
37
- {
38
- "id": "text-sample",
39
- "component": {
40
- "Text": {
41
- "text": { "literalString": "Text (h2)" },
42
- "usageHint": "h2"
43
- }
44
- }
45
- },
46
- {
47
- "id": "row-sample",
48
- "component": {
49
- "Row": {
50
- "children": {
51
- "explicitList": ["row-text-1", "row-text-2"]
52
- },
53
- "distribution": "spaceBetween",
54
- "alignment": "center"
55
- }
56
- }
57
- },
58
- {
59
- "id": "row-text-1",
60
- "component": {
61
- "Text": {
62
- "text": { "literalString": "Row left" },
63
- "usageHint": "body"
64
- }
65
- }
66
- },
67
- {
68
- "id": "row-text-2",
69
- "component": {
70
- "Text": {
71
- "text": { "literalString": "Row right" },
72
- "usageHint": "body"
73
- }
74
- }
75
- },
76
- {
77
- "id": "card-sample",
78
- "component": {
79
- "Card": {
80
- "child": "card-content"
81
- }
82
- }
83
- },
84
- {
85
- "id": "card-content",
86
- "component": {
87
- "Text": {
88
- "text": { "literalString": "Card content" },
89
- "usageHint": "body"
90
- }
91
- }
92
- },
93
- {
94
- "id": "button-sample",
95
- "component": {
96
- "Button": {
97
- "child": "button-label",
98
- "primary": true,
99
- "action": {
100
- "name": "submit",
101
- "context": [{ "key": "source", "value": { "literalString": "sample" } }]
102
- }
103
- }
104
- }
105
- },
106
- {
107
- "id": "button-label",
108
- "component": {
109
- "Text": {
110
- "text": { "literalString": "Button" },
111
- "usageHint": "body"
112
- }
113
- }
114
- },
115
- {
116
- "id": "textfield-sample",
117
- "component": {
118
- "TextField": {
119
- "label": { "literalString": "Name" },
120
- "text": { "path": "/form/name" },
121
- "textFieldType": "shortText"
122
- }
123
- }
124
- },
125
- {
126
- "id": "checkbox-sample",
127
- "component": {
128
- "CheckBox": {
129
- "label": { "literalString": "Accept terms" },
130
- "checked": { "path": "/form/agreeTerms" }
131
- }
132
- }
133
- },
134
- {
135
- "id": "image-sample",
136
- "component": {
137
- "Image": {
138
- "url": { "literalString": "https://picsum.photos/200/100" },
139
- "fit": "cover",
140
- "usageHint": "thumbnail"
141
- }
142
- }
143
- },
144
- {
145
- "id": "divider-sample",
146
- "component": {
147
- "Divider": {
148
- "axis": "horizontal"
149
- }
150
- }
151
- },
152
- {
153
- "id": "timeout-sample",
154
- "component": {
155
- "Timeout": {
156
- "targetTimeUtc": { "literalString": "2026-12-31T23:59:59.000Z" }
157
- }
158
- }
159
- },
160
- {
161
- "id": "tabs-sample",
162
- "component": {
163
- "Tabs": {
164
- "tabItems": [
165
- { "title": "Tab A", "child": "tab-a-content" },
166
- { "title": "Tab B", "child": "tab-b-content" }
167
- ]
168
- }
169
- }
170
- },
171
- {
172
- "id": "tab-a-content",
173
- "component": {
174
- "Text": {
175
- "text": { "literalString": "Tab A content" },
176
- "usageHint": "body"
177
- }
178
- }
179
- },
180
- {
181
- "id": "tab-b-content",
182
- "component": {
183
- "Text": {
184
- "text": { "literalString": "Tab B content" },
185
- "usageHint": "body"
186
- }
187
- }
188
- },
189
- {
190
- "id": "slider-sample",
191
- "component": {
192
- "Slider": {
193
- "value": { "path": "/form/volume" },
194
- "minValue": 0,
195
- "maxValue": 100
196
- }
197
- }
198
- },
199
- {
200
- "id": "multiple-choice-sample",
201
- "component": {
202
- "MultipleChoice": {
203
- "label": { "literalString": "Choose" },
204
- "options": [
205
- { "id": "opt1", "label": { "literalString": "Option 1" } },
206
- { "id": "opt2", "label": { "literalString": "Option 2" } }
207
- ],
208
- "selections": { "path": "/form/choice" }
209
- }
210
- }
211
- },
212
- {
213
- "id": "datetime-sample",
214
- "component": {
215
- "DateTimeInput": {
216
- "value": { "path": "/form/dob" },
217
- "enableDate": true,
218
- "enableTime": false
219
- }
220
- }
221
- },
222
- {
223
- "id": "list-sample",
224
- "component": {
225
- "List": {
226
- "template": "list-item",
227
- "dataBinding": "/items"
228
- }
229
- }
230
- },
231
- {
232
- "id": "list-item",
233
- "component": {
234
- "Text": {
235
- "text": { "path": "/title" },
236
- "usageHint": "body"
237
- }
238
- }
239
- },
240
- {
241
- "id": "modal-sample",
242
- "component": {
243
- "Modal": {
244
- "entryPointChild": "modal-trigger",
245
- "contentChild": "modal-content"
246
- }
247
- }
248
- },
249
- {
250
- "id": "modal-trigger",
251
- "component": {
252
- "Button": {
253
- "child": "modal-trigger-label",
254
- "action": { "name": "open_modal" }
255
- }
256
- }
36
+ "component": "Column",
37
+ "children": [
38
+ "title",
39
+ "hero",
40
+ "star",
41
+ "clip",
42
+ "audio",
43
+ "infoRow",
44
+ "linkList",
45
+ "profileCard",
46
+ "tabsExample",
47
+ "sep",
48
+ "detailsModal",
49
+ "submitBtn",
50
+ "deleteBtn",
51
+ "docsLink",
52
+ "nameField",
53
+ "agreeBox",
54
+ "colorPicker",
55
+ "volume",
56
+ "meeting",
57
+ "tags",
58
+ "countdown"
59
+ ]
257
60
  },
61
+ { "id": "title", "component": "Text", "text": "A2UI v0.9 GLChat sample", "variant": "h3" },
258
62
  {
259
- "id": "modal-trigger-label",
260
- "component": {
261
- "Text": {
262
- "text": { "literalString": "Open modal" },
263
- "usageHint": "body"
264
- }
265
- }
63
+ "id": "hero",
64
+ "component": "Image",
65
+ "url": "https://placehold.co/600x200",
66
+ "variant": "largeFeature",
67
+ "description": "Hero image"
266
68
  },
69
+ { "id": "star", "component": "Icon", "name": "star" },
70
+ { "id": "clip", "component": "Video", "url": "https://www.w3schools.com/html/mov_bbb.mp4" },
267
71
  {
268
- "id": "modal-content",
269
- "component": {
270
- "Text": {
271
- "text": { "literalString": "Modal content" },
272
- "usageHint": "body"
273
- }
274
- }
72
+ "id": "audio",
73
+ "component": "AudioPlayer",
74
+ "url": "https://www.w3schools.com/html/horse.mp3",
75
+ "description": "Sample audio"
275
76
  },
276
77
  {
277
- "id": "icon-sample",
278
- "component": {
279
- "Icon": {
280
- "name": { "literalString": "check" }
281
- }
282
- }
78
+ "id": "infoRow",
79
+ "component": "Row",
80
+ "children": ["infoLeft", "infoRight"],
81
+ "justify": "spaceBetween",
82
+ "align": "center"
283
83
  },
84
+ { "id": "infoLeft", "component": "Text", "text": "Left" },
85
+ { "id": "infoRight", "component": "Text", "text": "Right" },
284
86
  {
285
- "id": "video-sample",
286
- "component": {
287
- "Video": {
288
- "url": { "literalString": "https://example.com/video.mp4" }
289
- }
290
- }
87
+ "id": "linkList",
88
+ "component": "List",
89
+ "children": ["item1", "item2"],
90
+ "direction": "vertical"
291
91
  },
92
+ { "id": "item1", "component": "Text", "text": "Item one" },
93
+ { "id": "item2", "component": "Text", "text": "Item two" },
94
+ { "id": "profileCard", "component": "Card", "child": "cardText" },
95
+ { "id": "cardText", "component": "Text", "text": "Inside a card" },
292
96
  {
293
- "id": "audio-sample",
294
- "component": {
295
- "AudioPlayer": {
296
- "url": { "literalString": "https://example.com/audio.mp3" },
297
- "description": { "literalString": "Sample audio" }
298
- }
299
- }
300
- }
301
- ]
302
- }
303
- },
304
- {
305
- "beginRendering": {
306
- "surfaceId": "main",
307
- "root": "root"
308
- }
309
- },
310
- {
311
- "dataModelUpdate": {
312
- "surfaceId": "main",
313
- "contents": [
314
- {
315
- "key": "form",
316
- "valueMap": [
317
- { "key": "name", "valueString": "Jane" },
318
- { "key": "agreeTerms", "valueBoolean": false },
319
- { "key": "volume", "valueNumber": 50 },
320
- { "key": "dob", "valueString": "1990-01-15" }
97
+ "id": "tabsExample",
98
+ "component": "Tabs",
99
+ "tabs": [
100
+ { "title": "Tab 1", "child": "tab1Text" },
101
+ { "title": "Tab 2", "child": "tab2Text" }
321
102
  ]
322
103
  },
323
- {
324
- "key": "items",
325
- "valueList": [
326
- { "key": "0", "valueMap": [{ "key": "title", "valueString": "Item 1" }] },
327
- { "key": "1", "valueMap": [{ "key": "title", "valueString": "Item 2" }] }
328
- ]
104
+ { "id": "tab1Text", "component": "Text", "text": "First tab content" },
105
+ { "id": "tab2Text", "component": "Text", "text": "Second tab content" },
106
+ { "id": "sep", "component": "Divider", "axis": "horizontal" },
107
+ { "id": "detailsModal", "component": "Modal", "trigger": "modalTrigger", "content": "modalContent" },
108
+ { "id": "modalTrigger", "component": "Text", "text": "Open details" },
109
+ { "id": "modalContent", "component": "Text", "text": "Modal body content" },
110
+ {
111
+ "id": "submitBtn",
112
+ "component": "Button",
113
+ "child": "submitLabel",
114
+ "variant": "primary",
115
+ "action": { "event": { "name": "submit", "context": { "form": "main" } } }
116
+ },
117
+ { "id": "submitLabel", "component": "Text", "text": "Submit" },
118
+ {
119
+ "id": "deleteBtn",
120
+ "component": "Button",
121
+ "child": "deleteLabel",
122
+ "variant": "destructive",
123
+ "action": { "event": { "name": "delete" } }
124
+ },
125
+ { "id": "deleteLabel", "component": "Text", "text": "Delete" },
126
+ {
127
+ "id": "docsLink",
128
+ "component": "Button",
129
+ "child": "docsLabel",
130
+ "variant": "borderless",
131
+ "action": {
132
+ "functionCall": {
133
+ "call": "openUrl",
134
+ "args": { "url": "https://a2ui.org" },
135
+ "returnType": "void"
136
+ }
137
+ }
138
+ },
139
+ { "id": "docsLabel", "component": "Text", "text": "Open docs" },
140
+ {
141
+ "id": "nameField",
142
+ "component": "TextField",
143
+ "label": "Name",
144
+ "value": { "path": "/form/name" },
145
+ "variant": "shortText"
146
+ },
147
+ { "id": "agreeBox", "component": "CheckBox", "label": "I agree", "value": { "path": "/form/agree" } },
148
+ {
149
+ "id": "colorPicker",
150
+ "component": "ChoicePicker",
151
+ "label": "Favorite color",
152
+ "variant": "mutuallyExclusive",
153
+ "displayStyle": "chips",
154
+ "options": [
155
+ { "label": "Red", "value": "red" },
156
+ { "label": "Green", "value": "green" },
157
+ { "label": "Blue", "value": "blue" }
158
+ ],
159
+ "value": { "path": "/form/color" }
160
+ },
161
+ {
162
+ "id": "volume",
163
+ "component": "Slider",
164
+ "label": "Volume",
165
+ "min": 0,
166
+ "max": 100,
167
+ "value": { "path": "/form/volume" }
168
+ },
169
+ {
170
+ "id": "meeting",
171
+ "component": "DateTimeInput",
172
+ "label": "Meeting",
173
+ "value": { "path": "/form/meeting" },
174
+ "enableDate": true,
175
+ "enableTime": true
176
+ },
177
+ {
178
+ "id": "tags",
179
+ "component": "TagInput",
180
+ "label": "Tags",
181
+ "value": { "path": "/form/tags" },
182
+ "placeholder": "Add a tag"
183
+ },
184
+ {
185
+ "id": "countdown",
186
+ "component": "Timeout",
187
+ "targetTimeUtc": { "path": "/form/deadline" },
188
+ "variant": "body"
329
189
  }
330
190
  ]
331
191
  }
332
- },
333
- {
334
- "deleteSurface": {
335
- "surfaceId": "main"
336
- }
337
192
  }
338
193
  ]