@cloudcrane/app-spec 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +22 -2
- package/dist/src/a2ui.d.ts +12 -0
- package/dist/src/a2ui.js +89 -0
- package/dist/src/blueprint.d.ts +27 -0
- package/dist/src/blueprint.js +62 -0
- package/dist/src/canonical.d.ts +2 -0
- package/dist/src/canonical.js +8 -0
- package/dist/src/catalog.d.ts +7 -0
- package/dist/src/catalog.js +83 -0
- package/dist/src/index.d.ts +9 -0
- package/dist/src/index.js +11 -0
- package/dist/src/jsonschema.d.ts +2 -0
- package/dist/src/jsonschema.js +11 -0
- package/dist/src/leak.d.ts +3 -0
- package/dist/src/leak.js +141 -0
- package/dist/src/logic.d.ts +36 -0
- package/dist/src/logic.js +197 -0
- package/dist/src/schema.d.ts +418 -0
- package/dist/src/schema.js +137 -0
- package/dist/src/validate.d.ts +6 -0
- package/dist/src/validate.js +54 -0
- package/dist/vendor/a2ui/v0_9_1/catalogs/basic/catalog.json +1383 -0
- package/dist/vendor/a2ui/v0_9_1/common_types.json +305 -0
- package/dist/vendor/a2ui/v0_9_1/server_to_client.json +131 -0
- package/package.json +78 -3
- package/schema/app-spec.v1.json +460 -0
- package/vendor/a2ui/v0_9_1/LICENSE +227 -0
- package/vendor/a2ui/v0_9_1/VENDOR.json +6 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/catalog.json +1383 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/00_complex-layout.json +65 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/00_formatted-text.json +56 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/00_incremental.json +134 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/00_interactive-button.json +51 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/00_row-layout.json +40 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/00_simple-login-form.json +77 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/00_simple-text.json +27 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/01_flight-status.json +201 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/02_email-compose.json +185 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/03_calendar-day.json +166 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/04_weather-current.json +168 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/05_product-card.json +151 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/06_music-player.json +165 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/07_task-card.json +107 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/08_user-profile.json +190 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/09_login-form.json +214 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/10_notification-permission.json +105 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/11_purchase-complete.json +169 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/12_chat-message.json +144 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/13_coffee-order.json +253 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/14_sports-player.json +177 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/15_account-balance.json +126 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/16_workout-summary.json +160 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/17_event-detail.json +144 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/18_track-list.json +152 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/19_software-purchase.json +194 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/20_restaurant-card.json +140 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/21_shipping-status.json +137 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/22_credit-card.json +117 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/23_step-counter.json +149 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/24_recipe-card.json +204 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/25_contact-card.json +175 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/26_podcast-episode.json +123 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/27_stats-card.json +106 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/28_countdown-timer.json +135 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/29_movie-card.json +156 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/30_live-invitation-builder.json +205 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/31_incremental-dashboard.json +128 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/32_advanced-form-validator.json +166 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/33_financial-data-grid.json +171 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/34_child-list-template.json +80 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/35_markdown-text.json +44 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/36_modal.json +65 -0
- package/vendor/a2ui/v0_9_1/client_capabilities.json +89 -0
- package/vendor/a2ui/v0_9_1/client_data_model.json +22 -0
- package/vendor/a2ui/v0_9_1/client_to_server.json +98 -0
- package/vendor/a2ui/v0_9_1/client_to_server_list.json +10 -0
- package/vendor/a2ui/v0_9_1/client_to_server_list_wrapper.json +14 -0
- package/vendor/a2ui/v0_9_1/common_types.json +305 -0
- package/vendor/a2ui/v0_9_1/sample.json +22 -0
- package/vendor/a2ui/v0_9_1/server_capabilities.json +26 -0
- package/vendor/a2ui/v0_9_1/server_to_client.json +132 -0
- package/vendor/a2ui/v0_9_1/server_to_client_list.json +10 -0
- package/vendor/a2ui/v0_9_1/server_to_client_list_wrapper.json +14 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Live Invitation Builder",
|
|
3
|
+
"description": "Demonstrates reactive two-way binding where editor inputs update a live preview in real-time.",
|
|
4
|
+
"messages": [
|
|
5
|
+
{
|
|
6
|
+
"version": "v0.9",
|
|
7
|
+
"createSurface": {
|
|
8
|
+
"surfaceId": "gallery-invitation-builder",
|
|
9
|
+
"catalogId": "https://a2ui.org/specification/v0_9/catalogs/basic/catalog.json",
|
|
10
|
+
"sendDataModel": true
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"version": "v0.9",
|
|
15
|
+
"updateComponents": {
|
|
16
|
+
"surfaceId": "gallery-invitation-builder",
|
|
17
|
+
"components": [
|
|
18
|
+
{
|
|
19
|
+
"id": "root",
|
|
20
|
+
"component": "Column",
|
|
21
|
+
"children": ["header", "main-content"],
|
|
22
|
+
"align": "stretch"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"id": "header",
|
|
26
|
+
"component": "Text",
|
|
27
|
+
"text": "# Invitation Builder",
|
|
28
|
+
"variant": "h1"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"id": "main-content",
|
|
32
|
+
"component": "Row",
|
|
33
|
+
"children": ["editor-col", "preview-col"],
|
|
34
|
+
"align": "start"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "editor-col",
|
|
38
|
+
"component": "Column",
|
|
39
|
+
"children": [
|
|
40
|
+
"editor-title",
|
|
41
|
+
"event-name-input",
|
|
42
|
+
"guest-input",
|
|
43
|
+
"date-input",
|
|
44
|
+
"location-picker"
|
|
45
|
+
],
|
|
46
|
+
"weight": 1,
|
|
47
|
+
"align": "stretch"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"id": "editor-title",
|
|
51
|
+
"component": "Text",
|
|
52
|
+
"text": "Customize your invitation",
|
|
53
|
+
"variant": "h3"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"id": "event-name-input",
|
|
57
|
+
"component": "TextField",
|
|
58
|
+
"label": "Event Name",
|
|
59
|
+
"value": {
|
|
60
|
+
"path": "/event/name"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"id": "guest-input",
|
|
65
|
+
"component": "TextField",
|
|
66
|
+
"label": "Guest of Honor",
|
|
67
|
+
"value": {
|
|
68
|
+
"path": "/event/guest"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"id": "date-input",
|
|
73
|
+
"component": "DateTimeInput",
|
|
74
|
+
"label": "Event Date & Time",
|
|
75
|
+
"value": {
|
|
76
|
+
"path": "/event/date"
|
|
77
|
+
},
|
|
78
|
+
"enableDate": true,
|
|
79
|
+
"enableTime": true
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"id": "location-picker",
|
|
83
|
+
"component": "ChoicePicker",
|
|
84
|
+
"label": "Location",
|
|
85
|
+
"options": [
|
|
86
|
+
{"label": "Grand Ballroom", "value": "ballroom"},
|
|
87
|
+
{"label": "Sunset Terrace", "value": "terrace"},
|
|
88
|
+
{"label": "Garden Pavillion", "value": "garden"}
|
|
89
|
+
],
|
|
90
|
+
"value": {
|
|
91
|
+
"path": "/event/location"
|
|
92
|
+
},
|
|
93
|
+
"variant": "mutuallyExclusive",
|
|
94
|
+
"displayStyle": "chips"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"id": "preview-col",
|
|
98
|
+
"component": "Column",
|
|
99
|
+
"children": ["preview-title", "invitation-card"],
|
|
100
|
+
"weight": 1,
|
|
101
|
+
"align": "center"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"id": "preview-title",
|
|
105
|
+
"component": "Text",
|
|
106
|
+
"text": "Live Preview",
|
|
107
|
+
"variant": "caption"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"id": "invitation-card",
|
|
111
|
+
"component": "Card",
|
|
112
|
+
"child": "invitation-content"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"id": "invitation-content",
|
|
116
|
+
"component": "Column",
|
|
117
|
+
"children": [
|
|
118
|
+
"invite-image",
|
|
119
|
+
"invite-event-name",
|
|
120
|
+
"invite-guest-row",
|
|
121
|
+
"invite-date-text",
|
|
122
|
+
"invite-location-text"
|
|
123
|
+
],
|
|
124
|
+
"align": "center"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"id": "invite-image",
|
|
128
|
+
"component": "Image",
|
|
129
|
+
"url": "https://images.unsplash.com/photo-1511795409834-ef04bbd61622?w=400&h=200&fit=crop",
|
|
130
|
+
"variant": "mediumFeature"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"id": "invite-event-name",
|
|
134
|
+
"component": "Text",
|
|
135
|
+
"text": {
|
|
136
|
+
"path": "/event/name"
|
|
137
|
+
},
|
|
138
|
+
"variant": "h2"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"id": "invite-guest-row",
|
|
142
|
+
"component": "Row",
|
|
143
|
+
"children": ["invite-for-text", "invite-guest-name"],
|
|
144
|
+
"align": "center"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"id": "invite-for-text",
|
|
148
|
+
"component": "Text",
|
|
149
|
+
"text": "Celebrating",
|
|
150
|
+
"variant": "body"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"id": "invite-guest-name",
|
|
154
|
+
"component": "Text",
|
|
155
|
+
"text": {
|
|
156
|
+
"path": "/event/guest"
|
|
157
|
+
},
|
|
158
|
+
"variant": "h3"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"id": "invite-date-text",
|
|
162
|
+
"component": "Text",
|
|
163
|
+
"text": {
|
|
164
|
+
"call": "formatDate",
|
|
165
|
+
"args": {
|
|
166
|
+
"value": {
|
|
167
|
+
"path": "/event/date"
|
|
168
|
+
},
|
|
169
|
+
"format": "EEEE, MMMM d, yyyy 'at' h:mm a"
|
|
170
|
+
},
|
|
171
|
+
"returnType": "string"
|
|
172
|
+
},
|
|
173
|
+
"variant": "body"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"id": "invite-location-text",
|
|
177
|
+
"component": "Text",
|
|
178
|
+
"text": {
|
|
179
|
+
"call": "formatString",
|
|
180
|
+
"args": {
|
|
181
|
+
"value": "Location: ${/event/location/0}"
|
|
182
|
+
},
|
|
183
|
+
"returnType": "string"
|
|
184
|
+
},
|
|
185
|
+
"variant": "caption"
|
|
186
|
+
}
|
|
187
|
+
]
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"version": "v0.9",
|
|
192
|
+
"updateDataModel": {
|
|
193
|
+
"surfaceId": "gallery-invitation-builder",
|
|
194
|
+
"value": {
|
|
195
|
+
"event": {
|
|
196
|
+
"name": "Summer Gala",
|
|
197
|
+
"guest": "Alex Johnson",
|
|
198
|
+
"date": "2025-07-15T19:00:00Z",
|
|
199
|
+
"location": ["terrace"]
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
]
|
|
205
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Incremental Dashboard",
|
|
3
|
+
"description": "Demonstrates structural evolution of a UI where loading placeholders are incrementally replaced by actual components.",
|
|
4
|
+
"messages": [
|
|
5
|
+
{
|
|
6
|
+
"version": "v0.9",
|
|
7
|
+
"createSurface": {
|
|
8
|
+
"surfaceId": "gallery-incremental-dashboard",
|
|
9
|
+
"catalogId": "https://a2ui.org/specification/v0_9/catalogs/basic/catalog.json"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"version": "v0.9",
|
|
14
|
+
"updateComponents": {
|
|
15
|
+
"surfaceId": "gallery-incremental-dashboard",
|
|
16
|
+
"components": [
|
|
17
|
+
{
|
|
18
|
+
"id": "root",
|
|
19
|
+
"component": "Column",
|
|
20
|
+
"children": ["header", "content-grid"],
|
|
21
|
+
"align": "stretch"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "header",
|
|
25
|
+
"component": "Text",
|
|
26
|
+
"text": "System Dashboard",
|
|
27
|
+
"variant": "h2"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"id": "content-grid",
|
|
31
|
+
"component": "Row",
|
|
32
|
+
"children": ["left-panel", "right-panel"]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"id": "left-panel",
|
|
36
|
+
"component": "Column",
|
|
37
|
+
"children": ["panel-a-loading"],
|
|
38
|
+
"weight": 1
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"id": "right-panel",
|
|
42
|
+
"component": "Column",
|
|
43
|
+
"children": ["panel-b-loading"],
|
|
44
|
+
"weight": 1
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"id": "panel-a-loading",
|
|
48
|
+
"component": "Text",
|
|
49
|
+
"text": "Loading analytics...",
|
|
50
|
+
"variant": "caption"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"id": "panel-b-loading",
|
|
54
|
+
"component": "Text",
|
|
55
|
+
"text": "Loading logs...",
|
|
56
|
+
"variant": "caption"
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"version": "v0.9",
|
|
63
|
+
"updateComponents": {
|
|
64
|
+
"surfaceId": "gallery-incremental-dashboard",
|
|
65
|
+
"components": [
|
|
66
|
+
{
|
|
67
|
+
"id": "left-panel",
|
|
68
|
+
"component": "Column",
|
|
69
|
+
"children": ["analytics-card"],
|
|
70
|
+
"weight": 1
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"id": "analytics-card",
|
|
74
|
+
"component": "Card",
|
|
75
|
+
"child": "analytics-text"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"id": "analytics-text",
|
|
79
|
+
"component": "Text",
|
|
80
|
+
"text": "Analytics are ready.",
|
|
81
|
+
"variant": "body"
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"version": "v0.9",
|
|
88
|
+
"updateComponents": {
|
|
89
|
+
"surfaceId": "gallery-incremental-dashboard",
|
|
90
|
+
"components": [
|
|
91
|
+
{
|
|
92
|
+
"id": "right-panel",
|
|
93
|
+
"component": "Column",
|
|
94
|
+
"children": ["logs-list"],
|
|
95
|
+
"weight": 1
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"id": "logs-list",
|
|
99
|
+
"component": "List",
|
|
100
|
+
"children": {
|
|
101
|
+
"path": "/logs",
|
|
102
|
+
"componentId": "log-template"
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"id": "log-template",
|
|
107
|
+
"component": "Text",
|
|
108
|
+
"text": {"path": "message"},
|
|
109
|
+
"variant": "caption"
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"version": "v0.9",
|
|
116
|
+
"updateDataModel": {
|
|
117
|
+
"surfaceId": "gallery-incremental-dashboard",
|
|
118
|
+
"value": {
|
|
119
|
+
"logs": [
|
|
120
|
+
{"message": "System boot complete."},
|
|
121
|
+
{"message": "All services healthy."},
|
|
122
|
+
{"message": "Waiting for user input."}
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Advanced Form Validator",
|
|
3
|
+
"description": "Demonstrates complex validation logic and deeply nested formatting functions.",
|
|
4
|
+
"messages": [
|
|
5
|
+
{
|
|
6
|
+
"version": "v0.9",
|
|
7
|
+
"createSurface": {
|
|
8
|
+
"surfaceId": "gallery-advanced-validator",
|
|
9
|
+
"catalogId": "https://a2ui.org/specification/v0_9/catalogs/basic/catalog.json",
|
|
10
|
+
"sendDataModel": true
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"version": "v0.9",
|
|
15
|
+
"updateComponents": {
|
|
16
|
+
"surfaceId": "gallery-advanced-validator",
|
|
17
|
+
"components": [
|
|
18
|
+
{
|
|
19
|
+
"id": "root",
|
|
20
|
+
"component": "Card",
|
|
21
|
+
"child": "main-column"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "main-column",
|
|
25
|
+
"component": "Column",
|
|
26
|
+
"children": [
|
|
27
|
+
"welcome-text",
|
|
28
|
+
"email-field",
|
|
29
|
+
"phone-field",
|
|
30
|
+
"zip-field",
|
|
31
|
+
"terms-checkbox",
|
|
32
|
+
"submit-btn"
|
|
33
|
+
],
|
|
34
|
+
"align": "stretch"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "welcome-text",
|
|
38
|
+
"component": "Text",
|
|
39
|
+
"text": {
|
|
40
|
+
"call": "formatString",
|
|
41
|
+
"args": {
|
|
42
|
+
"value": "Hello! Today is ${formatDate(value: ${/now}, format: 'EEEE, MMMM d')}."
|
|
43
|
+
},
|
|
44
|
+
"returnType": "string"
|
|
45
|
+
},
|
|
46
|
+
"variant": "h3"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"id": "email-field",
|
|
50
|
+
"component": "TextField",
|
|
51
|
+
"label": "Email Address",
|
|
52
|
+
"value": {"path": "/formData/email"},
|
|
53
|
+
"checks": [
|
|
54
|
+
{
|
|
55
|
+
"condition": {
|
|
56
|
+
"call": "email",
|
|
57
|
+
"args": {"value": {"path": "/formData/email"}}
|
|
58
|
+
},
|
|
59
|
+
"message": "Invalid email format"
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"id": "phone-field",
|
|
65
|
+
"component": "TextField",
|
|
66
|
+
"label": "Phone Number",
|
|
67
|
+
"value": {"path": "/formData/phone"},
|
|
68
|
+
"checks": [
|
|
69
|
+
{
|
|
70
|
+
"condition": {
|
|
71
|
+
"call": "regex",
|
|
72
|
+
"args": {
|
|
73
|
+
"value": {"path": "/formData/phone"},
|
|
74
|
+
"pattern": "^\\+?[0-9]{10,15}$"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"message": "Invalid phone format"
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"id": "zip-field",
|
|
83
|
+
"component": "TextField",
|
|
84
|
+
"label": "Zip Code",
|
|
85
|
+
"value": {"path": "/formData/zip"},
|
|
86
|
+
"checks": [
|
|
87
|
+
{
|
|
88
|
+
"condition": {
|
|
89
|
+
"call": "regex",
|
|
90
|
+
"args": {"value": {"path": "/formData/zip"}, "pattern": "^[0-9]{5}$"}
|
|
91
|
+
},
|
|
92
|
+
"message": "Must be exactly 5 digits"
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"id": "terms-checkbox",
|
|
98
|
+
"component": "CheckBox",
|
|
99
|
+
"label": "I agree to the terms and conditions",
|
|
100
|
+
"value": {"path": "/formData/agree"}
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"id": "submit-btn-text",
|
|
104
|
+
"component": "Text",
|
|
105
|
+
"text": "Submit Registration"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"id": "submit-btn",
|
|
109
|
+
"component": "Button",
|
|
110
|
+
"child": "submit-btn-text",
|
|
111
|
+
"checks": [
|
|
112
|
+
{
|
|
113
|
+
"condition": {
|
|
114
|
+
"call": "and",
|
|
115
|
+
"args": {
|
|
116
|
+
"values": [
|
|
117
|
+
{"path": "/formData/agree"},
|
|
118
|
+
{
|
|
119
|
+
"call": "or",
|
|
120
|
+
"args": {
|
|
121
|
+
"values": [
|
|
122
|
+
{
|
|
123
|
+
"call": "required",
|
|
124
|
+
"args": {"value": {"path": "/formData/email"}}
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"call": "required",
|
|
128
|
+
"args": {"value": {"path": "/formData/phone"}}
|
|
129
|
+
}
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
{"call": "required", "args": {"value": {"path": "/formData/zip"}}}
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"message": "You must agree to terms AND provide either Email or Phone, plus a Zip code."
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
"action": {
|
|
141
|
+
"event": {
|
|
142
|
+
"name": "register",
|
|
143
|
+
"context": {"data": {"path": "/formData"}}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"version": "v0.9",
|
|
152
|
+
"updateDataModel": {
|
|
153
|
+
"surfaceId": "gallery-advanced-validator",
|
|
154
|
+
"value": {
|
|
155
|
+
"now": "2025-12-15T12:00:00Z",
|
|
156
|
+
"formData": {
|
|
157
|
+
"email": "",
|
|
158
|
+
"phone": "",
|
|
159
|
+
"zip": "",
|
|
160
|
+
"agree": false
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
]
|
|
166
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Financial Data Grid",
|
|
3
|
+
"description": "Demonstrates complex layout weighting and alignment using Rows and Columns with templates.",
|
|
4
|
+
"messages": [
|
|
5
|
+
{
|
|
6
|
+
"version": "v0.9",
|
|
7
|
+
"createSurface": {
|
|
8
|
+
"surfaceId": "gallery-financial-grid",
|
|
9
|
+
"catalogId": "https://a2ui.org/specification/v0_9/catalogs/basic/catalog.json",
|
|
10
|
+
"sendDataModel": true
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"version": "v0.9",
|
|
15
|
+
"updateComponents": {
|
|
16
|
+
"surfaceId": "gallery-financial-grid",
|
|
17
|
+
"components": [
|
|
18
|
+
{
|
|
19
|
+
"id": "root",
|
|
20
|
+
"component": "Card",
|
|
21
|
+
"child": "main-column"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "main-column",
|
|
25
|
+
"component": "Column",
|
|
26
|
+
"children": ["header-row", "grid-list"],
|
|
27
|
+
"align": "stretch"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"id": "header-row",
|
|
31
|
+
"component": "Row",
|
|
32
|
+
"children": ["col-asset", "col-price", "col-change", "col-market-cap"],
|
|
33
|
+
"align": "center"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "col-asset",
|
|
37
|
+
"component": "Text",
|
|
38
|
+
"text": "Asset",
|
|
39
|
+
"variant": "caption",
|
|
40
|
+
"weight": 2
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"id": "col-price",
|
|
44
|
+
"component": "Text",
|
|
45
|
+
"text": "Price",
|
|
46
|
+
"variant": "caption",
|
|
47
|
+
"weight": 1
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"id": "col-change",
|
|
51
|
+
"component": "Text",
|
|
52
|
+
"text": "24h Change",
|
|
53
|
+
"variant": "caption",
|
|
54
|
+
"weight": 1
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"id": "col-market-cap",
|
|
58
|
+
"component": "Text",
|
|
59
|
+
"text": "Market Cap",
|
|
60
|
+
"variant": "caption",
|
|
61
|
+
"weight": 1.5
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"id": "grid-list",
|
|
65
|
+
"component": "List",
|
|
66
|
+
"children": {
|
|
67
|
+
"path": "/assets",
|
|
68
|
+
"componentId": "row-template"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"id": "row-template",
|
|
73
|
+
"component": "Row",
|
|
74
|
+
"children": ["asset-info", "asset-price", "asset-change", "asset-market-cap"],
|
|
75
|
+
"align": "center"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"id": "asset-info",
|
|
79
|
+
"component": "Row",
|
|
80
|
+
"children": ["asset-icon", "asset-name-col"],
|
|
81
|
+
"weight": 2,
|
|
82
|
+
"align": "center"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"id": "asset-icon",
|
|
86
|
+
"component": "Icon",
|
|
87
|
+
"name": "payment"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"id": "asset-name-col",
|
|
91
|
+
"component": "Column",
|
|
92
|
+
"children": ["asset-name", "asset-symbol"]
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"id": "asset-name",
|
|
96
|
+
"component": "Text",
|
|
97
|
+
"text": {"path": "name"},
|
|
98
|
+
"variant": "body"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"id": "asset-symbol",
|
|
102
|
+
"component": "Text",
|
|
103
|
+
"text": {"path": "symbol"},
|
|
104
|
+
"variant": "caption"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"id": "asset-price",
|
|
108
|
+
"component": "Text",
|
|
109
|
+
"text": {
|
|
110
|
+
"call": "formatCurrency",
|
|
111
|
+
"args": {"value": {"path": "price"}, "currency": "USD"},
|
|
112
|
+
"returnType": "string"
|
|
113
|
+
},
|
|
114
|
+
"weight": 1
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"id": "asset-change",
|
|
118
|
+
"component": "Text",
|
|
119
|
+
"text": {
|
|
120
|
+
"call": "formatString",
|
|
121
|
+
"args": {"value": "${change}%"},
|
|
122
|
+
"returnType": "string"
|
|
123
|
+
},
|
|
124
|
+
"weight": 1
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"id": "asset-market-cap",
|
|
128
|
+
"component": "Text",
|
|
129
|
+
"text": {
|
|
130
|
+
"call": "formatCurrency",
|
|
131
|
+
"args": {"value": {"path": "marketCap"}, "currency": "USD"},
|
|
132
|
+
"returnType": "string"
|
|
133
|
+
},
|
|
134
|
+
"weight": 1.5
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"version": "v0.9",
|
|
141
|
+
"updateDataModel": {
|
|
142
|
+
"surfaceId": "gallery-financial-grid",
|
|
143
|
+
"value": {
|
|
144
|
+
"assets": [
|
|
145
|
+
{
|
|
146
|
+
"name": "Bitcoin",
|
|
147
|
+
"symbol": "BTC",
|
|
148
|
+
"price": 43500.25,
|
|
149
|
+
"change": 1.2,
|
|
150
|
+
"marketCap": 850000000000
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"name": "Ethereum",
|
|
154
|
+
"symbol": "ETH",
|
|
155
|
+
"price": 2250.5,
|
|
156
|
+
"change": -0.5,
|
|
157
|
+
"marketCap": 270000000000
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"name": "Solana",
|
|
161
|
+
"symbol": "SOL",
|
|
162
|
+
"price": 95.8,
|
|
163
|
+
"change": 5.4,
|
|
164
|
+
"marketCap": 40000000000
|
|
165
|
+
}
|
|
166
|
+
]
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
}
|