Skip to content

Commit cd7f8b8

Browse files
feat: Retrofit existing and add new advanced A2UI v0.9 basic catalog samples (google#941)
1 parent 3595dab commit cd7f8b8

26 files changed

Lines changed: 1400 additions & 713 deletions

specification/v0_9/json/catalogs/basic/examples/01_flight-status.json

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Flight Status",
3-
"description": "Example of flight status",
3+
"description": "Example of flight status demonstrating date formatting.",
44
"messages": [
55
{
66
"version": "v0.9",
@@ -67,7 +67,14 @@
6767
"id": "date",
6868
"component": "Text",
6969
"text": {
70-
"path": "/date"
70+
"call": "formatDate",
71+
"args": {
72+
"value": {
73+
"path": "/date"
74+
},
75+
"format": "E, MMM d"
76+
},
77+
"returnType": "string"
7178
},
7279
"variant": "caption"
7380
},
@@ -136,7 +143,14 @@
136143
"id": "departure-time",
137144
"component": "Text",
138145
"text": {
139-
"path": "/departureTime"
146+
"call": "formatDate",
147+
"args": {
148+
"value": {
149+
"path": "/departureTime"
150+
},
151+
"format": "h:mm a"
152+
},
153+
"returnType": "string"
140154
},
141155
"variant": "h3"
142156
},
@@ -182,7 +196,14 @@
182196
"id": "arrival-time",
183197
"component": "Text",
184198
"text": {
185-
"path": "/arrivalTime"
199+
"call": "formatDate",
200+
"args": {
201+
"value": {
202+
"path": "/arrivalTime"
203+
},
204+
"format": "h:mm a"
205+
},
206+
"returnType": "string"
186207
},
187208
"variant": "h3"
188209
}
@@ -195,12 +216,12 @@
195216
"surfaceId": "gallery-flight-status",
196217
"value": {
197218
"flightNumber": "OS 87",
198-
"date": "Mon, Dec 15",
219+
"date": "2025-12-15",
199220
"origin": "Vienna",
200221
"destination": "New York",
201-
"departureTime": "10:15 AM",
222+
"departureTime": "2025-12-15T10:15:00Z",
202223
"status": "On Time",
203-
"arrivalTime": "2:30 PM"
224+
"arrivalTime": "2025-12-15T14:30:00Z"
204225
}
205226
}
206227
}

specification/v0_9/json/catalogs/basic/examples/03_calendar-day.json

Lines changed: 43 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Calendar Day",
3-
"description": "Example of calendar day",
3+
"description": "Example of calendar day demonstrating dynamic templating, relative paths, and date formatting.",
44
"messages": [
55
{
66
"version": "v0.9",
@@ -50,96 +50,61 @@
5050
"id": "day-name",
5151
"component": "Text",
5252
"text": {
53-
"path": "/dayName"
53+
"call": "formatDate",
54+
"args": {
55+
"value": {
56+
"path": "/date"
57+
},
58+
"format": "EEEE"
59+
},
60+
"returnType": "string"
5461
},
5562
"variant": "caption"
5663
},
5764
{
5865
"id": "day-number",
5966
"component": "Text",
6067
"text": {
61-
"path": "/dayNumber"
68+
"call": "formatDate",
69+
"args": {
70+
"value": {
71+
"path": "/date"
72+
},
73+
"format": "d"
74+
},
75+
"returnType": "string"
6276
},
6377
"variant": "h1"
6478
},
6579
{
6680
"id": "events-col",
6781
"component": "Column",
68-
"children": [
69-
"event1",
70-
"event2",
71-
"event3"
72-
]
73-
},
74-
{
75-
"id": "event1",
76-
"component": "Column",
77-
"children": [
78-
"event1-title",
79-
"event1-time"
80-
]
81-
},
82-
{
83-
"id": "event1-title",
84-
"component": "Text",
85-
"text": {
86-
"path": "/event1/title"
87-
},
88-
"variant": "body"
89-
},
90-
{
91-
"id": "event1-time",
92-
"component": "Text",
93-
"text": {
94-
"path": "/event1/time"
95-
},
96-
"variant": "caption"
97-
},
98-
{
99-
"id": "event2",
100-
"component": "Column",
101-
"children": [
102-
"event2-title",
103-
"event2-time"
104-
]
105-
},
106-
{
107-
"id": "event2-title",
108-
"component": "Text",
109-
"text": {
110-
"path": "/event2/title"
111-
},
112-
"variant": "body"
113-
},
114-
{
115-
"id": "event2-time",
116-
"component": "Text",
117-
"text": {
118-
"path": "/event2/time"
119-
},
120-
"variant": "caption"
82+
"children": {
83+
"path": "/events",
84+
"componentId": "event-template"
85+
}
12186
},
12287
{
123-
"id": "event3",
88+
"id": "event-template",
12489
"component": "Column",
12590
"children": [
126-
"event3-title",
127-
"event3-time"
91+
"event-title",
92+
"event-time"
12893
]
12994
},
13095
{
131-
"id": "event3-title",
96+
"id": "event-title",
13297
"component": "Text",
13398
"text": {
134-
"path": "/event3/title"
99+
"path": "title"
135100
},
136101
"variant": "body"
137102
},
138103
{
139-
"id": "event3-time",
104+
"id": "event-time",
140105
"component": "Text",
141106
"text": {
142-
"path": "/event3/time"
107+
"path": "time"
143108
},
144109
"variant": "caption"
145110
},
@@ -195,20 +160,21 @@
195160
"updateDataModel": {
196161
"surfaceId": "gallery-calendar-day",
197162
"value": {
198-
"dayName": "Friday",
199-
"dayNumber": "28",
200-
"event1": {
201-
"title": "Lunch",
202-
"time": "12:00 - 12:45 PM"
203-
},
204-
"event2": {
205-
"title": "Q1 roadmap review",
206-
"time": "1:00 - 2:00 PM"
207-
},
208-
"event3": {
209-
"title": "Team standup",
210-
"time": "3:30 - 4:00 PM"
211-
}
163+
"date": "2025-12-28",
164+
"events": [
165+
{
166+
"title": "Lunch",
167+
"time": "12:00 - 12:45 PM"
168+
},
169+
{
170+
"title": "Q1 roadmap review",
171+
"time": "1:00 - 2:00 PM"
172+
},
173+
{
174+
"title": "Team standup",
175+
"time": "3:30 - 4:00 PM"
176+
}
177+
]
212178
}
213179
}
214180
}

0 commit comments

Comments
 (0)