From 8be97d1a257c23660f4f47d25c1ae24d53b5cfca Mon Sep 17 00:00:00 2001 From: Jacob Simionato Date: Wed, 4 Mar 2026 09:28:04 +1030 Subject: [PATCH 1/5] Add 29 example layouts for the v0.9 basic catalog --- .../basic/examples/01_flight-status.json | 204 ++++++++++++ .../basic/examples/02_email-compose.json | 205 ++++++++++++ .../basic/examples/03_calendar-day.json | 212 +++++++++++++ .../basic/examples/04_weather-current.json | 246 +++++++++++++++ .../basic/examples/05_product-card.json | 144 +++++++++ .../basic/examples/06_music-player.json | 177 +++++++++++ .../catalogs/basic/examples/07_task-card.json | 101 ++++++ .../basic/examples/08_user-profile.json | 190 ++++++++++++ .../basic/examples/09_login-form.json | 147 +++++++++ .../examples/10_notification-permission.json | 109 +++++++ .../basic/examples/11_purchase-complete.json | 173 +++++++++++ .../basic/examples/12_chat-message.json | 206 ++++++++++++ .../basic/examples/13_coffee-order.json | 292 ++++++++++++++++++ .../basic/examples/14_sports-player.json | 197 ++++++++++++ .../basic/examples/15_account-balance.json | 127 ++++++++ .../basic/examples/16_workout-summary.json | 160 ++++++++++ .../basic/examples/17_event-detail.json | 151 +++++++++ .../basic/examples/18_track-list.json | 265 ++++++++++++++++ .../basic/examples/19_software-purchase.json | 190 ++++++++++++ .../basic/examples/20_restaurant-card.json | 154 +++++++++ .../basic/examples/21_shipping-status.json | 191 ++++++++++++ .../basic/examples/22_credit-card.json | 129 ++++++++ .../basic/examples/23_step-counter.json | 142 +++++++++ .../basic/examples/24_recipe-card.json | 163 ++++++++++ .../basic/examples/25_contact-card.json | 194 ++++++++++++ .../basic/examples/26_podcast-episode.json | 129 ++++++++ .../basic/examples/27_stats-card.json | 101 ++++++ .../basic/examples/28_countdown-timer.json | 141 +++++++++ .../basic/examples/29_movie-card.json | 140 +++++++++ 29 files changed, 4980 insertions(+) create mode 100644 specification/v0_9/json/catalogs/basic/examples/01_flight-status.json create mode 100644 specification/v0_9/json/catalogs/basic/examples/02_email-compose.json create mode 100644 specification/v0_9/json/catalogs/basic/examples/03_calendar-day.json create mode 100644 specification/v0_9/json/catalogs/basic/examples/04_weather-current.json create mode 100644 specification/v0_9/json/catalogs/basic/examples/05_product-card.json create mode 100644 specification/v0_9/json/catalogs/basic/examples/06_music-player.json create mode 100644 specification/v0_9/json/catalogs/basic/examples/07_task-card.json create mode 100644 specification/v0_9/json/catalogs/basic/examples/08_user-profile.json create mode 100644 specification/v0_9/json/catalogs/basic/examples/09_login-form.json create mode 100644 specification/v0_9/json/catalogs/basic/examples/10_notification-permission.json create mode 100644 specification/v0_9/json/catalogs/basic/examples/11_purchase-complete.json create mode 100644 specification/v0_9/json/catalogs/basic/examples/12_chat-message.json create mode 100644 specification/v0_9/json/catalogs/basic/examples/13_coffee-order.json create mode 100644 specification/v0_9/json/catalogs/basic/examples/14_sports-player.json create mode 100644 specification/v0_9/json/catalogs/basic/examples/15_account-balance.json create mode 100644 specification/v0_9/json/catalogs/basic/examples/16_workout-summary.json create mode 100644 specification/v0_9/json/catalogs/basic/examples/17_event-detail.json create mode 100644 specification/v0_9/json/catalogs/basic/examples/18_track-list.json create mode 100644 specification/v0_9/json/catalogs/basic/examples/19_software-purchase.json create mode 100644 specification/v0_9/json/catalogs/basic/examples/20_restaurant-card.json create mode 100644 specification/v0_9/json/catalogs/basic/examples/21_shipping-status.json create mode 100644 specification/v0_9/json/catalogs/basic/examples/22_credit-card.json create mode 100644 specification/v0_9/json/catalogs/basic/examples/23_step-counter.json create mode 100644 specification/v0_9/json/catalogs/basic/examples/24_recipe-card.json create mode 100644 specification/v0_9/json/catalogs/basic/examples/25_contact-card.json create mode 100644 specification/v0_9/json/catalogs/basic/examples/26_podcast-episode.json create mode 100644 specification/v0_9/json/catalogs/basic/examples/27_stats-card.json create mode 100644 specification/v0_9/json/catalogs/basic/examples/28_countdown-timer.json create mode 100644 specification/v0_9/json/catalogs/basic/examples/29_movie-card.json diff --git a/specification/v0_9/json/catalogs/basic/examples/01_flight-status.json b/specification/v0_9/json/catalogs/basic/examples/01_flight-status.json new file mode 100644 index 000000000..08526e75b --- /dev/null +++ b/specification/v0_9/json/catalogs/basic/examples/01_flight-status.json @@ -0,0 +1,204 @@ +[ + { + "version": "v0.9", + "createSurface": { + "surfaceId": "gallery-flight-status", + "catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json", + "sendDataModel": true + } + }, + { + "version": "v0.9", + "updateComponents": { + "surfaceId": "gallery-flight-status", + "components": [ + { + "id": "root", + "component": "Card", + "child": "main-column" + }, + { + "id": "main-column", + "component": "Column", + "children": [ + "header-row", + "route-row", + "divider", + "times-row" + ], + "align": "stretch" + }, + { + "id": "header-row", + "component": "Row", + "children": [ + "header-left", + "date" + ], + "justify": "spaceBetween", + "align": "center" + }, + { + "id": "header-left", + "component": "Row", + "children": [ + "flight-indicator", + "flight-number" + ], + "align": "center" + }, + { + "id": "flight-indicator", + "component": "Icon", + "name": "flight" + }, + { + "id": "flight-number", + "component": "Text", + "text": { + "path": "/flightNumber" + }, + "variant": "h3" + }, + { + "id": "date", + "component": "Text", + "text": { + "path": "/date" + }, + "variant": "caption" + }, + { + "id": "route-row", + "component": "Row", + "children": [ + "origin", + "arrow", + "destination" + ], + "align": "center" + }, + { + "id": "origin", + "component": "Text", + "text": { + "path": "/origin" + }, + "variant": "h2" + }, + { + "id": "arrow", + "component": "Text", + "text": "→", + "variant": "h2" + }, + { + "id": "destination", + "component": "Text", + "text": { + "path": "/destination" + }, + "variant": "h2" + }, + { + "id": "divider", + "component": "Divider" + }, + { + "id": "times-row", + "component": "Row", + "children": [ + "departure-col", + "status-col", + "arrival-col" + ], + "justify": "spaceBetween" + }, + { + "id": "departure-col", + "component": "Column", + "children": [ + "departure-label", + "departure-time" + ], + "align": "start" + }, + { + "id": "departure-label", + "component": "Text", + "text": "Departs", + "variant": "caption" + }, + { + "id": "departure-time", + "component": "Text", + "text": { + "path": "/departureTime" + }, + "variant": "h3" + }, + { + "id": "status-col", + "component": "Column", + "children": [ + "status-label", + "status-value" + ], + "align": "center" + }, + { + "id": "status-label", + "component": "Text", + "text": "Status", + "variant": "caption" + }, + { + "id": "status-value", + "component": "Text", + "text": { + "path": "/status" + }, + "variant": "body" + }, + { + "id": "arrival-col", + "component": "Column", + "children": [ + "arrival-label", + "arrival-time" + ], + "align": "end" + }, + { + "id": "arrival-label", + "component": "Text", + "text": "Arrives", + "variant": "caption" + }, + { + "id": "arrival-time", + "component": "Text", + "text": { + "path": "/arrivalTime" + }, + "variant": "h3" + } + ] + } + }, + { + "version": "v0.9", + "updateDataModel": { + "surfaceId": "gallery-flight-status", + "value": { + "flightNumber": "OS 87", + "date": "Mon, Dec 15", + "origin": "Vienna", + "destination": "New York", + "departureTime": "10:15 AM", + "status": "On Time", + "arrivalTime": "2:30 PM" + } + } + } +] \ No newline at end of file diff --git a/specification/v0_9/json/catalogs/basic/examples/02_email-compose.json b/specification/v0_9/json/catalogs/basic/examples/02_email-compose.json new file mode 100644 index 000000000..ceeb876e8 --- /dev/null +++ b/specification/v0_9/json/catalogs/basic/examples/02_email-compose.json @@ -0,0 +1,205 @@ +[ + { + "version": "v0.9", + "createSurface": { + "surfaceId": "gallery-email-compose", + "catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json", + "sendDataModel": true + } + }, + { + "version": "v0.9", + "updateComponents": { + "surfaceId": "gallery-email-compose", + "components": [ + { + "id": "root", + "component": "Card", + "child": "main-column" + }, + { + "id": "main-column", + "component": "Column", + "children": [ + "from-row", + "to-row", + "subject-row", + "divider", + "message", + "actions" + ] + }, + { + "id": "from-row", + "component": "Row", + "children": [ + "from-label", + "from-value" + ], + "align": "center" + }, + { + "id": "from-label", + "component": "Text", + "text": "FROM", + "variant": "caption" + }, + { + "id": "from-value", + "component": "Text", + "text": { + "path": "/from" + }, + "variant": "body" + }, + { + "id": "to-row", + "component": "Row", + "children": [ + "to-label", + "to-value" + ], + "align": "center" + }, + { + "id": "to-label", + "component": "Text", + "text": "TO", + "variant": "caption" + }, + { + "id": "to-value", + "component": "Text", + "text": { + "path": "/to" + }, + "variant": "body" + }, + { + "id": "subject-row", + "component": "Row", + "children": [ + "subject-label", + "subject-value" + ], + "align": "center" + }, + { + "id": "subject-label", + "component": "Text", + "text": "SUBJECT", + "variant": "caption" + }, + { + "id": "subject-value", + "component": "Text", + "text": { + "path": "/subject" + }, + "variant": "body" + }, + { + "id": "divider", + "component": "Divider" + }, + { + "id": "message", + "component": "Column", + "children": [ + "greeting", + "body-text", + "closing", + "signature" + ] + }, + { + "id": "greeting", + "component": "Text", + "text": { + "path": "/greeting" + }, + "variant": "body" + }, + { + "id": "body-text", + "component": "Text", + "text": { + "path": "/body" + }, + "variant": "body" + }, + { + "id": "closing", + "component": "Text", + "text": { + "path": "/closing" + }, + "variant": "body" + }, + { + "id": "signature", + "component": "Text", + "text": { + "path": "/signature" + }, + "variant": "body" + }, + { + "id": "actions", + "component": "Row", + "children": [ + "send-btn", + "discard-btn" + ] + }, + { + "id": "send-btn-text", + "component": "Text", + "text": "Send email" + }, + { + "id": "send-btn", + "component": "Button", + "child": "send-btn-text", + "action": { + "event": { + "name": "send", + "context": {} + } + } + }, + { + "id": "discard-btn-text", + "component": "Text", + "text": "Discard" + }, + { + "id": "discard-btn", + "component": "Button", + "child": "discard-btn-text", + "action": { + "event": { + "name": "discard", + "context": {} + } + } + } + ] + } + }, + { + "version": "v0.9", + "updateDataModel": { + "surfaceId": "gallery-email-compose", + "value": { + "from": "alex@acme.com", + "to": "jordan@acme.com", + "subject": "Q4 Revenue Forecast", + "greeting": "Hi Jordan,", + "body": "Following up on our call. Please review the attached Q4 forecast and let me know if you have questions before the board meeting.", + "closing": "Best,", + "signature": "Alex" + } + } + } +] \ No newline at end of file diff --git a/specification/v0_9/json/catalogs/basic/examples/03_calendar-day.json b/specification/v0_9/json/catalogs/basic/examples/03_calendar-day.json new file mode 100644 index 000000000..8b1e66f70 --- /dev/null +++ b/specification/v0_9/json/catalogs/basic/examples/03_calendar-day.json @@ -0,0 +1,212 @@ +[ + { + "version": "v0.9", + "createSurface": { + "surfaceId": "gallery-calendar-day", + "catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json", + "sendDataModel": true + } + }, + { + "version": "v0.9", + "updateComponents": { + "surfaceId": "gallery-calendar-day", + "components": [ + { + "id": "root", + "component": "Card", + "child": "main-column" + }, + { + "id": "main-column", + "component": "Column", + "children": [ + "header-row", + "events-list", + "actions" + ] + }, + { + "id": "header-row", + "component": "Row", + "children": [ + "date-col", + "events-col" + ] + }, + { + "id": "date-col", + "component": "Column", + "children": [ + "day-name", + "day-number" + ], + "align": "start" + }, + { + "id": "day-name", + "component": "Text", + "text": { + "path": "/dayName" + }, + "variant": "caption" + }, + { + "id": "day-number", + "component": "Text", + "text": { + "path": "/dayNumber" + }, + "variant": "h1" + }, + { + "id": "events-col", + "component": "Column", + "children": [ + "event1", + "event2", + "event3" + ] + }, + { + "id": "event1", + "component": "Column", + "children": [ + "event1-title", + "event1-time" + ] + }, + { + "id": "event1-title", + "component": "Text", + "text": { + "path": "/event1/title" + }, + "variant": "body" + }, + { + "id": "event1-time", + "component": "Text", + "text": { + "path": "/event1/time" + }, + "variant": "caption" + }, + { + "id": "event2", + "component": "Column", + "children": [ + "event2-title", + "event2-time" + ] + }, + { + "id": "event2-title", + "component": "Text", + "text": { + "path": "/event2/title" + }, + "variant": "body" + }, + { + "id": "event2-time", + "component": "Text", + "text": { + "path": "/event2/time" + }, + "variant": "caption" + }, + { + "id": "event3", + "component": "Column", + "children": [ + "event3-title", + "event3-time" + ] + }, + { + "id": "event3-title", + "component": "Text", + "text": { + "path": "/event3/title" + }, + "variant": "body" + }, + { + "id": "event3-time", + "component": "Text", + "text": { + "path": "/event3/time" + }, + "variant": "caption" + }, + { + "id": "events-list", + "component": "Divider" + }, + { + "id": "actions", + "component": "Row", + "children": [ + "add-btn", + "discard-btn" + ] + }, + { + "id": "add-btn-text", + "component": "Text", + "text": "Add to calendar" + }, + { + "id": "add-btn", + "component": "Button", + "child": "add-btn-text", + "action": { + "event": { + "name": "add", + "context": {} + } + } + }, + { + "id": "discard-btn-text", + "component": "Text", + "text": "Discard" + }, + { + "id": "discard-btn", + "component": "Button", + "child": "discard-btn-text", + "action": { + "event": { + "name": "discard", + "context": {} + } + } + } + ] + } + }, + { + "version": "v0.9", + "updateDataModel": { + "surfaceId": "gallery-calendar-day", + "value": { + "dayName": "Friday", + "dayNumber": "28", + "event1": { + "title": "Lunch", + "time": "12:00 - 12:45 PM" + }, + "event2": { + "title": "Q1 roadmap review", + "time": "1:00 - 2:00 PM" + }, + "event3": { + "title": "Team standup", + "time": "3:30 - 4:00 PM" + } + } + } + } +] \ No newline at end of file diff --git a/specification/v0_9/json/catalogs/basic/examples/04_weather-current.json b/specification/v0_9/json/catalogs/basic/examples/04_weather-current.json new file mode 100644 index 000000000..f19b9bf2e --- /dev/null +++ b/specification/v0_9/json/catalogs/basic/examples/04_weather-current.json @@ -0,0 +1,246 @@ +[ + { + "version": "v0.9", + "createSurface": { + "surfaceId": "gallery-weather-current", + "catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json", + "sendDataModel": true + } + }, + { + "version": "v0.9", + "updateComponents": { + "surfaceId": "gallery-weather-current", + "components": [ + { + "id": "root", + "component": "Card", + "child": "main-column" + }, + { + "id": "main-column", + "component": "Column", + "children": [ + "temp-row", + "location", + "description", + "forecast-row" + ], + "align": "center" + }, + { + "id": "temp-row", + "component": "Row", + "children": [ + "temp-high", + "temp-low" + ], + "align": "start" + }, + { + "id": "temp-high", + "component": "Text", + "text": { + "path": "/tempHigh" + }, + "variant": "h1" + }, + { + "id": "temp-low", + "component": "Text", + "text": { + "path": "/tempLow" + }, + "variant": "h2" + }, + { + "id": "location", + "component": "Text", + "text": { + "path": "/location" + }, + "variant": "h3" + }, + { + "id": "description", + "component": "Text", + "text": { + "path": "/description" + }, + "variant": "caption" + }, + { + "id": "forecast-row", + "component": "Row", + "children": [ + "day1", + "day2", + "day3", + "day4", + "day5" + ], + "justify": "spaceAround" + }, + { + "id": "day1", + "component": "Column", + "children": [ + "day1-icon", + "day1-temp" + ], + "align": "center" + }, + { + "id": "day1-icon", + "component": "Text", + "text": { + "path": "/forecast/0/icon" + }, + "variant": "h3" + }, + { + "id": "day1-temp", + "component": "Text", + "text": { + "path": "/forecast/0/temp" + }, + "variant": "caption" + }, + { + "id": "day2", + "component": "Column", + "children": [ + "day2-icon", + "day2-temp" + ], + "align": "center" + }, + { + "id": "day2-icon", + "component": "Text", + "text": { + "path": "/forecast/1/icon" + }, + "variant": "h3" + }, + { + "id": "day2-temp", + "component": "Text", + "text": { + "path": "/forecast/1/temp" + }, + "variant": "caption" + }, + { + "id": "day3", + "component": "Column", + "children": [ + "day3-icon", + "day3-temp" + ], + "align": "center" + }, + { + "id": "day3-icon", + "component": "Text", + "text": { + "path": "/forecast/2/icon" + }, + "variant": "h3" + }, + { + "id": "day3-temp", + "component": "Text", + "text": { + "path": "/forecast/2/temp" + }, + "variant": "caption" + }, + { + "id": "day4", + "component": "Column", + "children": [ + "day4-icon", + "day4-temp" + ], + "align": "center" + }, + { + "id": "day4-icon", + "component": "Text", + "text": { + "path": "/forecast/3/icon" + }, + "variant": "h3" + }, + { + "id": "day4-temp", + "component": "Text", + "text": { + "path": "/forecast/3/temp" + }, + "variant": "caption" + }, + { + "id": "day5", + "component": "Column", + "children": [ + "day5-icon", + "day5-temp" + ], + "align": "center" + }, + { + "id": "day5-icon", + "component": "Text", + "text": { + "path": "/forecast/4/icon" + }, + "variant": "h3" + }, + { + "id": "day5-temp", + "component": "Text", + "text": { + "path": "/forecast/4/temp" + }, + "variant": "caption" + } + ] + } + }, + { + "version": "v0.9", + "updateDataModel": { + "surfaceId": "gallery-weather-current", + "value": { + "tempHigh": "72°", + "tempLow": "58°", + "location": "Austin, TX", + "description": "Clear skies with light breeze", + "forecast": [ + { + "icon": "☀️", + "temp": "74°" + }, + { + "icon": "☀️", + "temp": "76°" + }, + { + "icon": "⛅", + "temp": "71°" + }, + { + "icon": "☀️", + "temp": "73°" + }, + { + "icon": "☀️", + "temp": "75°" + } + ] + } + } + } +] \ No newline at end of file diff --git a/specification/v0_9/json/catalogs/basic/examples/05_product-card.json b/specification/v0_9/json/catalogs/basic/examples/05_product-card.json new file mode 100644 index 000000000..54c2b2f40 --- /dev/null +++ b/specification/v0_9/json/catalogs/basic/examples/05_product-card.json @@ -0,0 +1,144 @@ +[ + { + "version": "v0.9", + "createSurface": { + "surfaceId": "gallery-product-card", + "catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json", + "sendDataModel": true + } + }, + { + "version": "v0.9", + "updateComponents": { + "surfaceId": "gallery-product-card", + "components": [ + { + "id": "root", + "component": "Card", + "child": "main-column" + }, + { + "id": "main-column", + "component": "Column", + "children": [ + "image", + "details" + ] + }, + { + "id": "image", + "component": "Image", + "url": { + "path": "/imageUrl" + }, + "fit": "cover" + }, + { + "id": "details", + "component": "Column", + "children": [ + "name", + "rating-row", + "price-row", + "actions" + ] + }, + { + "id": "name", + "component": "Text", + "text": { + "path": "/name" + }, + "variant": "h3" + }, + { + "id": "rating-row", + "component": "Row", + "children": [ + "stars", + "reviews" + ], + "align": "center" + }, + { + "id": "stars", + "component": "Text", + "text": { + "path": "/stars" + }, + "variant": "body" + }, + { + "id": "reviews", + "component": "Text", + "text": { + "path": "/reviews" + }, + "variant": "caption" + }, + { + "id": "price-row", + "component": "Row", + "children": [ + "price", + "original-price" + ], + "align": "start" + }, + { + "id": "price", + "component": "Text", + "text": { + "path": "/price" + }, + "variant": "h2" + }, + { + "id": "original-price", + "component": "Text", + "text": { + "path": "/originalPrice" + }, + "variant": "caption" + }, + { + "id": "actions", + "component": "Row", + "children": [ + "add-cart-btn" + ] + }, + { + "id": "add-cart-btn-text", + "component": "Text", + "text": "Add to Cart" + }, + { + "id": "add-cart-btn", + "component": "Button", + "child": "add-cart-btn-text", + "action": { + "event": { + "name": "addToCart", + "context": {} + } + } + } + ] + } + }, + { + "version": "v0.9", + "updateDataModel": { + "surfaceId": "gallery-product-card", + "value": { + "imageUrl": "https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=300&h=200&fit=crop", + "name": "Wireless Headphones Pro", + "stars": "★★★★★", + "reviews": "(2,847 reviews)", + "price": "$199.99", + "originalPrice": "$249.99" + } + } + } +] \ No newline at end of file diff --git a/specification/v0_9/json/catalogs/basic/examples/06_music-player.json b/specification/v0_9/json/catalogs/basic/examples/06_music-player.json new file mode 100644 index 000000000..8e134cac8 --- /dev/null +++ b/specification/v0_9/json/catalogs/basic/examples/06_music-player.json @@ -0,0 +1,177 @@ +[ + { + "version": "v0.9", + "createSurface": { + "surfaceId": "gallery-music-player", + "catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json", + "sendDataModel": true + } + }, + { + "version": "v0.9", + "updateComponents": { + "surfaceId": "gallery-music-player", + "components": [ + { + "id": "root", + "component": "Card", + "child": "main-column" + }, + { + "id": "main-column", + "component": "Column", + "children": [ + "album-art", + "track-info", + "progress", + "time-row", + "controls" + ], + "align": "center" + }, + { + "id": "album-art", + "component": "Image", + "url": { + "path": "/albumArt" + }, + "fit": "cover" + }, + { + "id": "track-info", + "component": "Column", + "children": [ + "song-title", + "artist" + ], + "align": "center" + }, + { + "id": "song-title", + "component": "Text", + "text": { + "path": "/title" + }, + "variant": "h3" + }, + { + "id": "artist", + "component": "Text", + "text": { + "path": "/artist" + }, + "variant": "caption" + }, + { + "id": "progress", + "component": "Slider", + "value": { + "path": "/progress" + }, + "max": 1 + }, + { + "id": "time-row", + "component": "Row", + "children": [ + "current-time", + "total-time" + ], + "justify": "spaceBetween" + }, + { + "id": "current-time", + "component": "Text", + "text": { + "path": "/currentTime" + }, + "variant": "caption" + }, + { + "id": "total-time", + "component": "Text", + "text": { + "path": "/totalTime" + }, + "variant": "caption" + }, + { + "id": "controls", + "component": "Row", + "children": [ + "prev-btn", + "play-btn", + "next-btn" + ], + "justify": "center" + }, + { + "id": "prev-btn-text", + "component": "Text", + "text": "⏮" + }, + { + "id": "prev-btn", + "component": "Button", + "child": "prev-btn-text", + "action": { + "event": { + "name": "previous", + "context": {} + } + } + }, + { + "id": "play-btn-text", + "component": "Text", + "text": { + "path": "/playIcon" + } + }, + { + "id": "play-btn", + "component": "Button", + "child": "play-btn-text", + "action": { + "event": { + "name": "playPause", + "context": {} + } + } + }, + { + "id": "next-btn-text", + "component": "Text", + "text": "⏭" + }, + { + "id": "next-btn", + "component": "Button", + "child": "next-btn-text", + "action": { + "event": { + "name": "next", + "context": {} + } + } + } + ] + } + }, + { + "version": "v0.9", + "updateDataModel": { + "surfaceId": "gallery-music-player", + "value": { + "albumArt": "https://images.unsplash.com/photo-1493225457124-a3eb161ffa5f?w=300&h=300&fit=crop", + "title": "Blinding Lights", + "artist": "The Weeknd", + "album": "After Hours", + "progress": 0.45, + "currentTime": "1:48", + "totalTime": "4:22", + "playIcon": "⏸" + } + } + } +] \ No newline at end of file diff --git a/specification/v0_9/json/catalogs/basic/examples/07_task-card.json b/specification/v0_9/json/catalogs/basic/examples/07_task-card.json new file mode 100644 index 000000000..6dc5fe3c6 --- /dev/null +++ b/specification/v0_9/json/catalogs/basic/examples/07_task-card.json @@ -0,0 +1,101 @@ +[ + { + "version": "v0.9", + "createSurface": { + "surfaceId": "gallery-task-card", + "catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json", + "sendDataModel": true + } + }, + { + "version": "v0.9", + "updateComponents": { + "surfaceId": "gallery-task-card", + "components": [ + { + "id": "root", + "component": "Card", + "child": "main-row" + }, + { + "id": "main-row", + "component": "Row", + "children": [ + "content", + "priority" + ], + "align": "start" + }, + { + "id": "content", + "component": "Column", + "children": [ + "title", + "description", + "meta-row" + ] + }, + { + "id": "title", + "component": "Text", + "text": { + "path": "/title" + }, + "variant": "h3" + }, + { + "id": "description", + "component": "Text", + "text": { + "path": "/description" + }, + "variant": "body" + }, + { + "id": "meta-row", + "component": "Row", + "children": [ + "due-date", + "project" + ] + }, + { + "id": "due-date", + "component": "Text", + "text": { + "path": "/dueDate" + }, + "variant": "caption" + }, + { + "id": "project", + "component": "Text", + "text": { + "path": "/project" + }, + "variant": "caption" + }, + { + "id": "priority", + "component": "Icon", + "name": { + "path": "/priorityIcon" + } + } + ] + } + }, + { + "version": "v0.9", + "updateDataModel": { + "surfaceId": "gallery-task-card", + "value": { + "title": "Review pull request", + "description": "Review and approve the authentication module changes.", + "dueDate": "Today", + "project": "Backend", + "priorityIcon": "priority_high" + } + } + } +] \ No newline at end of file diff --git a/specification/v0_9/json/catalogs/basic/examples/08_user-profile.json b/specification/v0_9/json/catalogs/basic/examples/08_user-profile.json new file mode 100644 index 000000000..35716206f --- /dev/null +++ b/specification/v0_9/json/catalogs/basic/examples/08_user-profile.json @@ -0,0 +1,190 @@ +[ + { + "version": "v0.9", + "createSurface": { + "surfaceId": "gallery-user-profile", + "catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json", + "sendDataModel": true + } + }, + { + "version": "v0.9", + "updateComponents": { + "surfaceId": "gallery-user-profile", + "components": [ + { + "id": "root", + "component": "Card", + "child": "main-column" + }, + { + "id": "main-column", + "component": "Column", + "children": [ + "header", + "info", + "bio", + "stats-row", + "follow-btn" + ], + "align": "center" + }, + { + "id": "header", + "component": "Image", + "url": { + "path": "/avatar" + }, + "fit": "cover", + "variant": "avatar" + }, + { + "id": "info", + "component": "Column", + "children": [ + "name", + "username" + ], + "align": "center" + }, + { + "id": "name", + "component": "Text", + "text": { + "path": "/name" + }, + "variant": "h2" + }, + { + "id": "username", + "component": "Text", + "text": { + "path": "/username" + }, + "variant": "caption" + }, + { + "id": "bio", + "component": "Text", + "text": { + "path": "/bio" + }, + "variant": "body" + }, + { + "id": "stats-row", + "component": "Row", + "children": [ + "followers-col", + "following-col", + "posts-col" + ], + "justify": "spaceAround" + }, + { + "id": "followers-col", + "component": "Column", + "children": [ + "followers-count", + "followers-label" + ], + "align": "center" + }, + { + "id": "followers-count", + "component": "Text", + "text": { + "path": "/followers" + }, + "variant": "h3" + }, + { + "id": "followers-label", + "component": "Text", + "text": "Followers", + "variant": "caption" + }, + { + "id": "following-col", + "component": "Column", + "children": [ + "following-count", + "following-label" + ], + "align": "center" + }, + { + "id": "following-count", + "component": "Text", + "text": { + "path": "/following" + }, + "variant": "h3" + }, + { + "id": "following-label", + "component": "Text", + "text": "Following", + "variant": "caption" + }, + { + "id": "posts-col", + "component": "Column", + "children": [ + "posts-count", + "posts-label" + ], + "align": "center" + }, + { + "id": "posts-count", + "component": "Text", + "text": { + "path": "/posts" + }, + "variant": "h3" + }, + { + "id": "posts-label", + "component": "Text", + "text": "Posts", + "variant": "caption" + }, + { + "id": "follow-btn-text", + "component": "Text", + "text": { + "path": "/followText" + } + }, + { + "id": "follow-btn", + "component": "Button", + "child": "follow-btn-text", + "action": { + "event": { + "name": "follow", + "context": {} + } + } + } + ] + } + }, + { + "version": "v0.9", + "updateDataModel": { + "surfaceId": "gallery-user-profile", + "value": { + "avatar": "https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=150&h=150&fit=crop", + "name": "Sarah Chen", + "username": "@sarahchen", + "bio": "Product Designer at Tech Co. Creating delightful experiences.", + "followers": "12.4K", + "following": "892", + "posts": "347", + "followText": "Follow" + } + } + } +] \ No newline at end of file diff --git a/specification/v0_9/json/catalogs/basic/examples/09_login-form.json b/specification/v0_9/json/catalogs/basic/examples/09_login-form.json new file mode 100644 index 000000000..36ac588c9 --- /dev/null +++ b/specification/v0_9/json/catalogs/basic/examples/09_login-form.json @@ -0,0 +1,147 @@ +[ + { + "version": "v0.9", + "createSurface": { + "surfaceId": "gallery-login-form", + "catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json", + "sendDataModel": true + } + }, + { + "version": "v0.9", + "updateComponents": { + "surfaceId": "gallery-login-form", + "components": [ + { + "id": "root", + "component": "Card", + "child": "main-column" + }, + { + "id": "main-column", + "component": "Column", + "children": [ + "header", + "email-field", + "password-field", + "login-btn", + "divider", + "signup-text" + ] + }, + { + "id": "header", + "component": "Column", + "children": [ + "title", + "subtitle" + ], + "align": "center" + }, + { + "id": "title", + "component": "Text", + "text": "Welcome back", + "variant": "h2" + }, + { + "id": "subtitle", + "component": "Text", + "text": "Sign in to your account", + "variant": "caption" + }, + { + "id": "email-field", + "component": "TextField", + "value": { + "path": "/email" + }, + "placeholder": "Email address", + "label": "Email", + "action": { + "event": { + "name": "updateEmail", + "context": {} + } + } + }, + { + "id": "password-field", + "component": "TextField", + "value": { + "path": "/password" + }, + "placeholder": "Password", + "label": "Password", + "action": { + "event": { + "name": "updatePassword", + "context": {} + } + } + }, + { + "id": "login-btn-text", + "component": "Text", + "text": "Sign in" + }, + { + "id": "login-btn", + "component": "Button", + "child": "login-btn-text", + "action": { + "event": { + "name": "login", + "context": {} + } + } + }, + { + "id": "divider", + "component": "Divider" + }, + { + "id": "signup-text", + "component": "Row", + "children": [ + "no-account", + "signup-link" + ], + "justify": "center" + }, + { + "id": "no-account", + "component": "Text", + "text": "Don't have an account?", + "variant": "caption" + }, + { + "id": "signup-link-text", + "component": "Text", + "text": "Sign up" + }, + { + "id": "signup-link", + "component": "Button", + "child": "signup-link-text", + "action": { + "event": { + "name": "signup", + "context": {} + } + } + } + ] + } + }, + { + "version": "v0.9", + "updateDataModel": { + "surfaceId": "gallery-login-form", + "value": { + "email": "", + "password": "" + } + } + } +] \ No newline at end of file diff --git a/specification/v0_9/json/catalogs/basic/examples/10_notification-permission.json b/specification/v0_9/json/catalogs/basic/examples/10_notification-permission.json new file mode 100644 index 000000000..b8a8e02eb --- /dev/null +++ b/specification/v0_9/json/catalogs/basic/examples/10_notification-permission.json @@ -0,0 +1,109 @@ +[ + { + "version": "v0.9", + "createSurface": { + "surfaceId": "gallery-notification-permission", + "catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json", + "sendDataModel": true + } + }, + { + "version": "v0.9", + "updateComponents": { + "surfaceId": "gallery-notification-permission", + "components": [ + { + "id": "root", + "component": "Card", + "child": "main-column" + }, + { + "id": "main-column", + "component": "Column", + "children": [ + "icon", + "title", + "description", + "actions" + ], + "align": "center" + }, + { + "id": "icon", + "component": "Icon", + "name": { + "path": "/icon" + } + }, + { + "id": "title", + "component": "Text", + "text": { + "path": "/title" + }, + "variant": "h3" + }, + { + "id": "description", + "component": "Text", + "text": { + "path": "/description" + }, + "variant": "body" + }, + { + "id": "actions", + "component": "Row", + "children": [ + "yes-btn", + "no-btn" + ], + "justify": "center" + }, + { + "id": "yes-btn-text", + "component": "Text", + "text": "Yes" + }, + { + "id": "yes-btn", + "component": "Button", + "child": "yes-btn-text", + "action": { + "event": { + "name": "accept", + "context": {} + } + } + }, + { + "id": "no-btn-text", + "component": "Text", + "text": "No" + }, + { + "id": "no-btn", + "component": "Button", + "child": "no-btn-text", + "action": { + "event": { + "name": "decline", + "context": {} + } + } + } + ] + } + }, + { + "version": "v0.9", + "updateDataModel": { + "surfaceId": "gallery-notification-permission", + "value": { + "icon": "check", + "title": "Enable notification", + "description": "Get alerts for order status changes" + } + } + } +] \ No newline at end of file diff --git a/specification/v0_9/json/catalogs/basic/examples/11_purchase-complete.json b/specification/v0_9/json/catalogs/basic/examples/11_purchase-complete.json new file mode 100644 index 000000000..574a234a6 --- /dev/null +++ b/specification/v0_9/json/catalogs/basic/examples/11_purchase-complete.json @@ -0,0 +1,173 @@ +[ + { + "version": "v0.9", + "createSurface": { + "surfaceId": "gallery-purchase-complete", + "catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json", + "sendDataModel": true + } + }, + { + "version": "v0.9", + "updateComponents": { + "surfaceId": "gallery-purchase-complete", + "components": [ + { + "id": "root", + "component": "Card", + "child": "main-column" + }, + { + "id": "main-column", + "component": "Column", + "children": [ + "success-icon", + "title", + "product-row", + "divider", + "details-col", + "view-btn" + ], + "align": "center" + }, + { + "id": "success-icon", + "component": "Icon", + "name": "check_circle" + }, + { + "id": "title", + "component": "Text", + "text": "Purchase Complete", + "variant": "h2" + }, + { + "id": "product-row", + "component": "Row", + "children": [ + "product-image", + "product-info" + ], + "align": "center" + }, + { + "id": "product-image", + "component": "Image", + "url": { + "path": "/productImage" + }, + "fit": "cover" + }, + { + "id": "product-info", + "component": "Column", + "children": [ + "product-name", + "product-price" + ] + }, + { + "id": "product-name", + "component": "Text", + "text": { + "path": "/productName" + }, + "variant": "h4" + }, + { + "id": "product-price", + "component": "Text", + "text": { + "path": "/price" + }, + "variant": "body" + }, + { + "id": "divider", + "component": "Divider" + }, + { + "id": "details-col", + "component": "Column", + "children": [ + "delivery-row", + "seller-row" + ] + }, + { + "id": "delivery-row", + "component": "Row", + "children": [ + "delivery-icon", + "delivery-text" + ], + "align": "center" + }, + { + "id": "delivery-icon", + "component": "Icon", + "name": "local_shipping" + }, + { + "id": "delivery-text", + "component": "Text", + "text": { + "path": "/deliveryDate" + }, + "variant": "body" + }, + { + "id": "seller-row", + "component": "Row", + "children": [ + "seller-label", + "seller-name" + ] + }, + { + "id": "seller-label", + "component": "Text", + "text": "Sold by:", + "variant": "caption" + }, + { + "id": "seller-name", + "component": "Text", + "text": { + "path": "/seller" + }, + "variant": "body" + }, + { + "id": "view-btn-text", + "component": "Text", + "text": "View Order Details" + }, + { + "id": "view-btn", + "component": "Button", + "child": "view-btn-text", + "action": { + "event": { + "name": "view_details", + "context": {} + } + } + } + ] + } + }, + { + "version": "v0.9", + "updateDataModel": { + "surfaceId": "gallery-purchase-complete", + "value": { + "productImage": "https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=100&h=100&fit=crop", + "productName": "Wireless Headphones Pro", + "price": "$199.99", + "deliveryDate": "Arrives Dec 18 - Dec 20", + "seller": "TechStore Official" + } + } + } +] \ No newline at end of file diff --git a/specification/v0_9/json/catalogs/basic/examples/12_chat-message.json b/specification/v0_9/json/catalogs/basic/examples/12_chat-message.json new file mode 100644 index 000000000..fbec85b7d --- /dev/null +++ b/specification/v0_9/json/catalogs/basic/examples/12_chat-message.json @@ -0,0 +1,206 @@ +[ + { + "version": "v0.9", + "createSurface": { + "surfaceId": "gallery-chat-message", + "catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json", + "sendDataModel": true + } + }, + { + "version": "v0.9", + "updateComponents": { + "surfaceId": "gallery-chat-message", + "components": [ + { + "id": "root", + "component": "Card", + "child": "main-column" + }, + { + "id": "main-column", + "component": "Column", + "children": [ + "header", + "divider", + "messages" + ] + }, + { + "id": "header", + "component": "Row", + "children": [ + "channel-icon", + "channel-name" + ], + "align": "center" + }, + { + "id": "channel-icon", + "component": "Icon", + "name": "tag" + }, + { + "id": "channel-name", + "component": "Text", + "text": { + "path": "/channelName" + }, + "variant": "h3" + }, + { + "id": "divider", + "component": "Divider" + }, + { + "id": "messages", + "component": "Column", + "children": [ + "message1", + "message2" + ], + "align": "start" + }, + { + "id": "message1", + "component": "Row", + "children": [ + "avatar1", + "msg1-content" + ], + "align": "start" + }, + { + "id": "avatar1", + "component": "Image", + "url": { + "path": "/message1/avatar" + }, + "fit": "cover", + "variant": "avatar" + }, + { + "id": "msg1-content", + "component": "Column", + "children": [ + "msg1-header", + "msg1-text" + ] + }, + { + "id": "msg1-header", + "component": "Row", + "children": [ + "msg1-username", + "msg1-time" + ], + "align": "center" + }, + { + "id": "msg1-username", + "component": "Text", + "text": { + "path": "/message1/username" + }, + "variant": "h4" + }, + { + "id": "msg1-time", + "component": "Text", + "text": { + "path": "/message1/time" + }, + "variant": "caption" + }, + { + "id": "msg1-text", + "component": "Text", + "text": { + "path": "/message1/text" + }, + "variant": "body" + }, + { + "id": "message2", + "component": "Row", + "children": [ + "avatar2", + "msg2-content" + ], + "align": "start" + }, + { + "id": "avatar2", + "component": "Image", + "url": { + "path": "/message2/avatar" + }, + "fit": "cover", + "variant": "avatar" + }, + { + "id": "msg2-content", + "component": "Column", + "children": [ + "msg2-header", + "msg2-text" + ] + }, + { + "id": "msg2-header", + "component": "Row", + "children": [ + "msg2-username", + "msg2-time" + ], + "align": "center" + }, + { + "id": "msg2-username", + "component": "Text", + "text": { + "path": "/message2/username" + }, + "variant": "h4" + }, + { + "id": "msg2-time", + "component": "Text", + "text": { + "path": "/message2/time" + }, + "variant": "caption" + }, + { + "id": "msg2-text", + "component": "Text", + "text": { + "path": "/message2/text" + }, + "variant": "body" + } + ] + } + }, + { + "version": "v0.9", + "updateDataModel": { + "surfaceId": "gallery-chat-message", + "value": { + "channelName": "project-updates", + "message1": { + "avatar": "https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=40&h=40&fit=crop", + "username": "Mike Chen", + "time": "10:32 AM", + "text": "Just pushed the new API changes. Ready for review." + }, + "message2": { + "avatar": "https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=40&h=40&fit=crop", + "username": "Sarah Kim", + "time": "10:45 AM", + "text": "Great! I'll take a look after standup." + } + } + } + } +] \ No newline at end of file diff --git a/specification/v0_9/json/catalogs/basic/examples/13_coffee-order.json b/specification/v0_9/json/catalogs/basic/examples/13_coffee-order.json new file mode 100644 index 000000000..6651c64d1 --- /dev/null +++ b/specification/v0_9/json/catalogs/basic/examples/13_coffee-order.json @@ -0,0 +1,292 @@ +[ + { + "version": "v0.9", + "createSurface": { + "surfaceId": "gallery-coffee-order", + "catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json", + "sendDataModel": true + } + }, + { + "version": "v0.9", + "updateComponents": { + "surfaceId": "gallery-coffee-order", + "components": [ + { + "id": "root", + "component": "Card", + "child": "main-column" + }, + { + "id": "main-column", + "component": "Column", + "children": [ + "header", + "items", + "divider", + "totals", + "actions" + ] + }, + { + "id": "header", + "component": "Row", + "children": [ + "coffee-icon", + "store-name" + ], + "align": "center" + }, + { + "id": "coffee-icon", + "component": "Icon", + "name": "local_cafe" + }, + { + "id": "store-name", + "component": "Text", + "text": { + "path": "/storeName" + }, + "variant": "h3" + }, + { + "id": "items", + "component": "Column", + "children": [ + "item1", + "item2" + ] + }, + { + "id": "item1", + "component": "Row", + "children": [ + "item1-details", + "item1-price" + ], + "justify": "spaceBetween", + "align": "start" + }, + { + "id": "item1-details", + "component": "Column", + "children": [ + "item1-name", + "item1-size" + ] + }, + { + "id": "item1-name", + "component": "Text", + "text": { + "path": "/item1/name" + }, + "variant": "body" + }, + { + "id": "item1-size", + "component": "Text", + "text": { + "path": "/item1/size" + }, + "variant": "caption" + }, + { + "id": "item1-price", + "component": "Text", + "text": { + "path": "/item1/price" + }, + "variant": "body" + }, + { + "id": "item2", + "component": "Row", + "children": [ + "item2-details", + "item2-price" + ], + "justify": "spaceBetween", + "align": "start" + }, + { + "id": "item2-details", + "component": "Column", + "children": [ + "item2-name", + "item2-size" + ] + }, + { + "id": "item2-name", + "component": "Text", + "text": { + "path": "/item2/name" + }, + "variant": "body" + }, + { + "id": "item2-size", + "component": "Text", + "text": { + "path": "/item2/size" + }, + "variant": "caption" + }, + { + "id": "item2-price", + "component": "Text", + "text": { + "path": "/item2/price" + }, + "variant": "body" + }, + { + "id": "divider", + "component": "Divider" + }, + { + "id": "totals", + "component": "Column", + "children": [ + "subtotal-row", + "tax-row", + "total-row" + ] + }, + { + "id": "subtotal-row", + "component": "Row", + "children": [ + "subtotal-label", + "subtotal-value" + ], + "justify": "spaceBetween" + }, + { + "id": "subtotal-label", + "component": "Text", + "text": "Subtotal", + "variant": "caption" + }, + { + "id": "subtotal-value", + "component": "Text", + "text": { + "path": "/subtotal" + }, + "variant": "body" + }, + { + "id": "tax-row", + "component": "Row", + "children": [ + "tax-label", + "tax-value" + ], + "justify": "spaceBetween" + }, + { + "id": "tax-label", + "component": "Text", + "text": "Tax", + "variant": "caption" + }, + { + "id": "tax-value", + "component": "Text", + "text": { + "path": "/tax" + }, + "variant": "body" + }, + { + "id": "total-row", + "component": "Row", + "children": [ + "total-label", + "total-value" + ], + "justify": "spaceBetween" + }, + { + "id": "total-label", + "component": "Text", + "text": "Total", + "variant": "h4" + }, + { + "id": "total-value", + "component": "Text", + "text": { + "path": "/total" + }, + "variant": "h4" + }, + { + "id": "actions", + "component": "Row", + "children": [ + "purchase-btn", + "add-btn" + ] + }, + { + "id": "purchase-btn-text", + "component": "Text", + "text": "Purchase" + }, + { + "id": "purchase-btn", + "component": "Button", + "child": "purchase-btn-text", + "action": { + "event": { + "name": "purchase", + "context": {} + } + } + }, + { + "id": "add-btn-text", + "component": "Text", + "text": "Add to cart" + }, + { + "id": "add-btn", + "component": "Button", + "child": "add-btn-text", + "action": { + "event": { + "name": "add_to_cart", + "context": {} + } + } + } + ] + } + }, + { + "version": "v0.9", + "updateDataModel": { + "surfaceId": "gallery-coffee-order", + "value": { + "storeName": "Sunrise Coffee", + "item1": { + "name": "Oat Milk Latte", + "size": "Grande, Extra Shot", + "price": "$6.45" + }, + "item2": { + "name": "Chocolate Croissant", + "size": "Warmed", + "price": "$4.25" + }, + "subtotal": "$10.70", + "tax": "$0.96", + "total": "$11.66" + } + } + } +] \ No newline at end of file diff --git a/specification/v0_9/json/catalogs/basic/examples/14_sports-player.json b/specification/v0_9/json/catalogs/basic/examples/14_sports-player.json new file mode 100644 index 000000000..faae5d0d1 --- /dev/null +++ b/specification/v0_9/json/catalogs/basic/examples/14_sports-player.json @@ -0,0 +1,197 @@ +[ + { + "version": "v0.9", + "createSurface": { + "surfaceId": "gallery-sports-player", + "catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json", + "sendDataModel": true + } + }, + { + "version": "v0.9", + "updateComponents": { + "surfaceId": "gallery-sports-player", + "components": [ + { + "id": "root", + "component": "Card", + "child": "main-column" + }, + { + "id": "main-column", + "component": "Column", + "children": [ + "player-image", + "player-info", + "divider", + "stats-row" + ], + "align": "center" + }, + { + "id": "player-image", + "component": "Image", + "url": { + "path": "/playerImage" + }, + "fit": "cover" + }, + { + "id": "player-info", + "component": "Column", + "children": [ + "player-name", + "player-details" + ], + "align": "center" + }, + { + "id": "player-name", + "component": "Text", + "text": { + "path": "/playerName" + }, + "variant": "h2" + }, + { + "id": "player-details", + "component": "Row", + "children": [ + "player-number", + "player-team" + ], + "align": "center" + }, + { + "id": "player-number", + "component": "Text", + "text": { + "path": "/number" + }, + "variant": "h3" + }, + { + "id": "player-team", + "component": "Text", + "text": { + "path": "/team" + }, + "variant": "caption" + }, + { + "id": "divider", + "component": "Divider" + }, + { + "id": "stats-row", + "component": "Row", + "children": [ + "stat1", + "stat2", + "stat3" + ], + "justify": "spaceAround" + }, + { + "id": "stat1", + "component": "Column", + "children": [ + "stat1-value", + "stat1-label" + ], + "align": "center" + }, + { + "id": "stat1-value", + "component": "Text", + "text": { + "path": "/stat1/value" + }, + "variant": "h3" + }, + { + "id": "stat1-label", + "component": "Text", + "text": { + "path": "/stat1/label" + }, + "variant": "caption" + }, + { + "id": "stat2", + "component": "Column", + "children": [ + "stat2-value", + "stat2-label" + ], + "align": "center" + }, + { + "id": "stat2-value", + "component": "Text", + "text": { + "path": "/stat2/value" + }, + "variant": "h3" + }, + { + "id": "stat2-label", + "component": "Text", + "text": { + "path": "/stat2/label" + }, + "variant": "caption" + }, + { + "id": "stat3", + "component": "Column", + "children": [ + "stat3-value", + "stat3-label" + ], + "align": "center" + }, + { + "id": "stat3-value", + "component": "Text", + "text": { + "path": "/stat3/value" + }, + "variant": "h3" + }, + { + "id": "stat3-label", + "component": "Text", + "text": { + "path": "/stat3/label" + }, + "variant": "caption" + } + ] + } + }, + { + "version": "v0.9", + "updateDataModel": { + "surfaceId": "gallery-sports-player", + "value": { + "playerImage": "https://images.unsplash.com/photo-1546519638-68e109498ffc?w=200&h=200&fit=crop", + "playerName": "Marcus Johnson", + "number": "#23", + "team": "LA Lakers", + "stat1": { + "value": "28.4", + "label": "PPG" + }, + "stat2": { + "value": "7.2", + "label": "RPG" + }, + "stat3": { + "value": "6.8", + "label": "APG" + } + } + } + } +] \ No newline at end of file diff --git a/specification/v0_9/json/catalogs/basic/examples/15_account-balance.json b/specification/v0_9/json/catalogs/basic/examples/15_account-balance.json new file mode 100644 index 000000000..fa58b3c29 --- /dev/null +++ b/specification/v0_9/json/catalogs/basic/examples/15_account-balance.json @@ -0,0 +1,127 @@ +[ + { + "version": "v0.9", + "createSurface": { + "surfaceId": "gallery-account-balance", + "catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json", + "sendDataModel": true + } + }, + { + "version": "v0.9", + "updateComponents": { + "surfaceId": "gallery-account-balance", + "components": [ + { + "id": "root", + "component": "Card", + "child": "main-column" + }, + { + "id": "main-column", + "component": "Column", + "children": [ + "header", + "balance", + "updated", + "divider", + "actions" + ] + }, + { + "id": "header", + "component": "Row", + "children": [ + "account-icon", + "account-name" + ], + "align": "center" + }, + { + "id": "account-icon", + "component": "Icon", + "name": "account_balance" + }, + { + "id": "account-name", + "component": "Text", + "text": { + "path": "/accountName" + }, + "variant": "h4" + }, + { + "id": "balance", + "component": "Text", + "text": { + "path": "/balance" + }, + "variant": "h1" + }, + { + "id": "updated", + "component": "Text", + "text": { + "path": "/lastUpdated" + }, + "variant": "caption" + }, + { + "id": "divider", + "component": "Divider" + }, + { + "id": "actions", + "component": "Row", + "children": [ + "transfer-btn", + "pay-btn" + ] + }, + { + "id": "transfer-btn-text", + "component": "Text", + "text": "Transfer" + }, + { + "id": "transfer-btn", + "component": "Button", + "child": "transfer-btn-text", + "action": { + "event": { + "name": "transfer", + "context": {} + } + } + }, + { + "id": "pay-btn-text", + "component": "Text", + "text": "Pay Bill" + }, + { + "id": "pay-btn", + "component": "Button", + "child": "pay-btn-text", + "action": { + "event": { + "name": "pay_bill", + "context": {} + } + } + } + ] + } + }, + { + "version": "v0.9", + "updateDataModel": { + "surfaceId": "gallery-account-balance", + "value": { + "accountName": "Primary Checking", + "balance": "$12,458.32", + "lastUpdated": "Updated just now" + } + } + } +] \ No newline at end of file diff --git a/specification/v0_9/json/catalogs/basic/examples/16_workout-summary.json b/specification/v0_9/json/catalogs/basic/examples/16_workout-summary.json new file mode 100644 index 000000000..eab3faa37 --- /dev/null +++ b/specification/v0_9/json/catalogs/basic/examples/16_workout-summary.json @@ -0,0 +1,160 @@ +[ + { + "version": "v0.9", + "createSurface": { + "surfaceId": "gallery-workout-summary", + "catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json", + "sendDataModel": true + } + }, + { + "version": "v0.9", + "updateComponents": { + "surfaceId": "gallery-workout-summary", + "components": [ + { + "id": "root", + "component": "Card", + "child": "main-column" + }, + { + "id": "main-column", + "component": "Column", + "children": [ + "header", + "divider", + "metrics-row", + "date" + ] + }, + { + "id": "header", + "component": "Row", + "children": [ + "workout-icon", + "title" + ], + "align": "center" + }, + { + "id": "workout-icon", + "component": "Icon", + "name": { + "path": "/icon" + } + }, + { + "id": "title", + "component": "Text", + "text": "Workout Complete", + "variant": "h3" + }, + { + "id": "divider", + "component": "Divider" + }, + { + "id": "metrics-row", + "component": "Row", + "children": [ + "duration-col", + "calories-col", + "distance-col" + ], + "justify": "spaceAround" + }, + { + "id": "duration-col", + "component": "Column", + "children": [ + "duration-value", + "duration-label" + ], + "align": "center" + }, + { + "id": "duration-value", + "component": "Text", + "text": { + "path": "/duration" + }, + "variant": "h3" + }, + { + "id": "duration-label", + "component": "Text", + "text": "Duration", + "variant": "caption" + }, + { + "id": "calories-col", + "component": "Column", + "children": [ + "calories-value", + "calories-label" + ], + "align": "center" + }, + { + "id": "calories-value", + "component": "Text", + "text": { + "path": "/calories" + }, + "variant": "h3" + }, + { + "id": "calories-label", + "component": "Text", + "text": "Calories", + "variant": "caption" + }, + { + "id": "distance-col", + "component": "Column", + "children": [ + "distance-value", + "distance-label" + ], + "align": "center" + }, + { + "id": "distance-value", + "component": "Text", + "text": { + "path": "/distance" + }, + "variant": "h3" + }, + { + "id": "distance-label", + "component": "Text", + "text": "Distance", + "variant": "caption" + }, + { + "id": "date", + "component": "Text", + "text": { + "path": "/date" + }, + "variant": "caption" + } + ] + } + }, + { + "version": "v0.9", + "updateDataModel": { + "surfaceId": "gallery-workout-summary", + "value": { + "icon": "directions_run", + "workoutType": "Morning Run", + "duration": "32:15", + "calories": "385", + "distance": "5.2 km", + "date": "Today at 7:30 AM" + } + } + } +] \ No newline at end of file diff --git a/specification/v0_9/json/catalogs/basic/examples/17_event-detail.json b/specification/v0_9/json/catalogs/basic/examples/17_event-detail.json new file mode 100644 index 000000000..705149148 --- /dev/null +++ b/specification/v0_9/json/catalogs/basic/examples/17_event-detail.json @@ -0,0 +1,151 @@ +[ + { + "version": "v0.9", + "createSurface": { + "surfaceId": "gallery-event-detail", + "catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json", + "sendDataModel": true + } + }, + { + "version": "v0.9", + "updateComponents": { + "surfaceId": "gallery-event-detail", + "components": [ + { + "id": "root", + "component": "Card", + "child": "main-column" + }, + { + "id": "main-column", + "component": "Column", + "children": [ + "title", + "time-row", + "location-row", + "description", + "divider", + "actions" + ] + }, + { + "id": "title", + "component": "Text", + "text": { + "path": "/title" + }, + "variant": "h2" + }, + { + "id": "time-row", + "component": "Row", + "children": [ + "time-icon", + "time-text" + ], + "align": "center" + }, + { + "id": "time-icon", + "component": "Icon", + "name": "schedule" + }, + { + "id": "time-text", + "component": "Text", + "text": { + "path": "/dateTime" + }, + "variant": "body" + }, + { + "id": "location-row", + "component": "Row", + "children": [ + "location-icon", + "location-text" + ], + "align": "center" + }, + { + "id": "location-icon", + "component": "Icon", + "name": "location_on" + }, + { + "id": "location-text", + "component": "Text", + "text": { + "path": "/location" + }, + "variant": "body" + }, + { + "id": "description", + "component": "Text", + "text": { + "path": "/description" + }, + "variant": "body" + }, + { + "id": "divider", + "component": "Divider" + }, + { + "id": "actions", + "component": "Row", + "children": [ + "accept-btn", + "decline-btn" + ] + }, + { + "id": "accept-btn-text", + "component": "Text", + "text": "Accept" + }, + { + "id": "accept-btn", + "component": "Button", + "child": "accept-btn-text", + "action": { + "event": { + "name": "accept", + "context": {} + } + } + }, + { + "id": "decline-btn-text", + "component": "Text", + "text": "Decline" + }, + { + "id": "decline-btn", + "component": "Button", + "child": "decline-btn-text", + "action": { + "event": { + "name": "decline", + "context": {} + } + } + } + ] + } + }, + { + "version": "v0.9", + "updateDataModel": { + "surfaceId": "gallery-event-detail", + "value": { + "title": "Product Launch Meeting", + "dateTime": "Thu, Dec 19 • 2:00 PM - 3:30 PM", + "location": "Conference Room A, Building 2", + "description": "Review final product specs and marketing materials before the Q1 launch." + } + } + } +] \ No newline at end of file diff --git a/specification/v0_9/json/catalogs/basic/examples/18_track-list.json b/specification/v0_9/json/catalogs/basic/examples/18_track-list.json new file mode 100644 index 000000000..425259f48 --- /dev/null +++ b/specification/v0_9/json/catalogs/basic/examples/18_track-list.json @@ -0,0 +1,265 @@ +[ + { + "version": "v0.9", + "createSurface": { + "surfaceId": "gallery-track-list", + "catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json", + "sendDataModel": true + } + }, + { + "version": "v0.9", + "updateComponents": { + "surfaceId": "gallery-track-list", + "components": [ + { + "id": "root", + "component": "Card", + "child": "main-column" + }, + { + "id": "main-column", + "component": "Column", + "children": [ + "header", + "divider", + "tracks" + ] + }, + { + "id": "header", + "component": "Row", + "children": [ + "playlist-icon", + "playlist-name" + ], + "align": "center" + }, + { + "id": "playlist-icon", + "component": "Icon", + "name": "queue_music" + }, + { + "id": "playlist-name", + "component": "Text", + "text": { + "path": "/playlistName" + }, + "variant": "h3" + }, + { + "id": "divider", + "component": "Divider" + }, + { + "id": "tracks", + "component": "Column", + "children": [ + "track1", + "track2", + "track3" + ] + }, + { + "id": "track1", + "component": "Row", + "children": [ + "track1-num", + "track1-art", + "track1-info", + "track1-duration" + ], + "align": "center" + }, + { + "id": "track1-num", + "component": "Text", + "text": "1", + "variant": "caption" + }, + { + "id": "track1-art", + "component": "Image", + "url": { + "path": "/track1/art" + }, + "fit": "cover" + }, + { + "id": "track1-info", + "component": "Column", + "children": [ + "track1-title", + "track1-artist" + ] + }, + { + "id": "track1-title", + "component": "Text", + "text": { + "path": "/track1/title" + }, + "variant": "body" + }, + { + "id": "track1-artist", + "component": "Text", + "text": { + "path": "/track1/artist" + }, + "variant": "caption" + }, + { + "id": "track1-duration", + "component": "Text", + "text": { + "path": "/track1/duration" + }, + "variant": "caption" + }, + { + "id": "track2", + "component": "Row", + "children": [ + "track2-num", + "track2-art", + "track2-info", + "track2-duration" + ], + "align": "center" + }, + { + "id": "track2-num", + "component": "Text", + "text": "2", + "variant": "caption" + }, + { + "id": "track2-art", + "component": "Image", + "url": { + "path": "/track2/art" + }, + "fit": "cover" + }, + { + "id": "track2-info", + "component": "Column", + "children": [ + "track2-title", + "track2-artist" + ] + }, + { + "id": "track2-title", + "component": "Text", + "text": { + "path": "/track2/title" + }, + "variant": "body" + }, + { + "id": "track2-artist", + "component": "Text", + "text": { + "path": "/track2/artist" + }, + "variant": "caption" + }, + { + "id": "track2-duration", + "component": "Text", + "text": { + "path": "/track2/duration" + }, + "variant": "caption" + }, + { + "id": "track3", + "component": "Row", + "children": [ + "track3-num", + "track3-art", + "track3-info", + "track3-duration" + ], + "align": "center" + }, + { + "id": "track3-num", + "component": "Text", + "text": "3", + "variant": "caption" + }, + { + "id": "track3-art", + "component": "Image", + "url": { + "path": "/track3/art" + }, + "fit": "cover" + }, + { + "id": "track3-info", + "component": "Column", + "children": [ + "track3-title", + "track3-artist" + ] + }, + { + "id": "track3-title", + "component": "Text", + "text": { + "path": "/track3/title" + }, + "variant": "body" + }, + { + "id": "track3-artist", + "component": "Text", + "text": { + "path": "/track3/artist" + }, + "variant": "caption" + }, + { + "id": "track3-duration", + "component": "Text", + "text": { + "path": "/track3/duration" + }, + "variant": "caption" + } + ] + } + }, + { + "version": "v0.9", + "updateDataModel": { + "surfaceId": "gallery-track-list", + "value": { + "playlistName": "Focus Flow", + "track1": { + "art": "https://images.unsplash.com/photo-1470225620780-dba8ba36b745?w=50&h=50&fit=crop", + "title": "Weightless", + "artist": "Marconi Union", + "duration": "8:09" + }, + "track2": { + "art": "https://images.unsplash.com/photo-1511379938547-c1f69419868d?w=50&h=50&fit=crop", + "title": "Clair de Lune", + "artist": "Debussy", + "duration": "5:12" + }, + "track3": { + "art": "https://images.unsplash.com/photo-1507838153414-b4b713384a76?w=50&h=50&fit=crop", + "title": "Ambient Light", + "artist": "Brian Eno", + "duration": "6:45" + } + } + } + } +] \ No newline at end of file diff --git a/specification/v0_9/json/catalogs/basic/examples/19_software-purchase.json b/specification/v0_9/json/catalogs/basic/examples/19_software-purchase.json new file mode 100644 index 000000000..d68d0e6d8 --- /dev/null +++ b/specification/v0_9/json/catalogs/basic/examples/19_software-purchase.json @@ -0,0 +1,190 @@ +[ + { + "version": "v0.9", + "createSurface": { + "surfaceId": "gallery-software-purchase", + "catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json", + "sendDataModel": true + } + }, + { + "version": "v0.9", + "updateComponents": { + "surfaceId": "gallery-software-purchase", + "components": [ + { + "id": "root", + "component": "Card", + "child": "main-column" + }, + { + "id": "main-column", + "component": "Column", + "children": [ + "title", + "product-name", + "divider1", + "options", + "divider2", + "total-row", + "actions" + ] + }, + { + "id": "title", + "component": "Text", + "text": "Purchase License", + "variant": "h3" + }, + { + "id": "product-name", + "component": "Text", + "text": { + "path": "/productName" + }, + "variant": "h2" + }, + { + "id": "divider1", + "component": "Divider" + }, + { + "id": "options", + "component": "Column", + "children": [ + "seats-row", + "period-row" + ] + }, + { + "id": "seats-row", + "component": "Row", + "children": [ + "seats-label", + "seats-value" + ], + "justify": "spaceBetween", + "align": "center" + }, + { + "id": "seats-label", + "component": "Text", + "text": "Number of seats", + "variant": "body" + }, + { + "id": "seats-value", + "component": "Text", + "text": { + "path": "/seats" + }, + "variant": "h4" + }, + { + "id": "period-row", + "component": "Row", + "children": [ + "period-label", + "period-value" + ], + "justify": "spaceBetween", + "align": "center" + }, + { + "id": "period-label", + "component": "Text", + "text": "Billing period", + "variant": "body" + }, + { + "id": "period-value", + "component": "Text", + "text": { + "path": "/billingPeriod" + }, + "variant": "h4" + }, + { + "id": "divider2", + "component": "Divider" + }, + { + "id": "total-row", + "component": "Row", + "children": [ + "total-label", + "total-value" + ], + "justify": "spaceBetween", + "align": "center" + }, + { + "id": "total-label", + "component": "Text", + "text": "Total", + "variant": "h4" + }, + { + "id": "total-value", + "component": "Text", + "text": { + "path": "/total" + }, + "variant": "h2" + }, + { + "id": "actions", + "component": "Row", + "children": [ + "confirm-btn", + "cancel-btn" + ] + }, + { + "id": "confirm-btn-text", + "component": "Text", + "text": "Confirm Purchase" + }, + { + "id": "confirm-btn", + "component": "Button", + "child": "confirm-btn-text", + "action": { + "event": { + "name": "confirm", + "context": {} + } + } + }, + { + "id": "cancel-btn-text", + "component": "Text", + "text": "Cancel" + }, + { + "id": "cancel-btn", + "component": "Button", + "child": "cancel-btn-text", + "action": { + "event": { + "name": "cancel", + "context": {} + } + } + } + ] + } + }, + { + "version": "v0.9", + "updateDataModel": { + "surfaceId": "gallery-software-purchase", + "value": { + "productName": "Design Suite Pro", + "seats": "10 seats", + "billingPeriod": "Annual", + "total": "$1,188/year" + } + } + } +] \ No newline at end of file diff --git a/specification/v0_9/json/catalogs/basic/examples/20_restaurant-card.json b/specification/v0_9/json/catalogs/basic/examples/20_restaurant-card.json new file mode 100644 index 000000000..4e46aa142 --- /dev/null +++ b/specification/v0_9/json/catalogs/basic/examples/20_restaurant-card.json @@ -0,0 +1,154 @@ +[ + { + "version": "v0.9", + "createSurface": { + "surfaceId": "gallery-restaurant-card", + "catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json", + "sendDataModel": true + } + }, + { + "version": "v0.9", + "updateComponents": { + "surfaceId": "gallery-restaurant-card", + "components": [ + { + "id": "root", + "component": "Card", + "child": "main-column" + }, + { + "id": "main-column", + "component": "Column", + "children": [ + "restaurant-image", + "content" + ] + }, + { + "id": "restaurant-image", + "component": "Image", + "url": { + "path": "/image" + }, + "fit": "cover" + }, + { + "id": "content", + "component": "Column", + "children": [ + "name-row", + "cuisine", + "rating-row", + "details-row" + ] + }, + { + "id": "name-row", + "component": "Row", + "children": [ + "restaurant-name", + "price-range" + ], + "justify": "spaceBetween", + "align": "center" + }, + { + "id": "restaurant-name", + "component": "Text", + "text": { + "path": "/name" + }, + "variant": "h3" + }, + { + "id": "price-range", + "component": "Text", + "text": { + "path": "/priceRange" + }, + "variant": "body" + }, + { + "id": "cuisine", + "component": "Text", + "text": { + "path": "/cuisine" + }, + "variant": "caption" + }, + { + "id": "rating-row", + "component": "Row", + "children": [ + "star-icon", + "rating", + "reviews" + ], + "align": "center" + }, + { + "id": "star-icon", + "component": "Icon", + "name": "star" + }, + { + "id": "rating", + "component": "Text", + "text": { + "path": "/rating" + }, + "variant": "body" + }, + { + "id": "reviews", + "component": "Text", + "text": { + "path": "/reviewCount" + }, + "variant": "caption" + }, + { + "id": "details-row", + "component": "Row", + "children": [ + "distance", + "delivery-time" + ] + }, + { + "id": "distance", + "component": "Text", + "text": { + "path": "/distance" + }, + "variant": "caption" + }, + { + "id": "delivery-time", + "component": "Text", + "text": { + "path": "/deliveryTime" + }, + "variant": "caption" + } + ] + } + }, + { + "version": "v0.9", + "updateDataModel": { + "surfaceId": "gallery-restaurant-card", + "value": { + "image": "https://images.unsplash.com/photo-1517248135467-4c7edcad34c4?w=300&h=150&fit=crop", + "name": "The Italian Kitchen", + "priceRange": "$$$", + "cuisine": "Italian • Pasta • Wine Bar", + "rating": "4.8", + "reviewCount": "(2,847 reviews)", + "distance": "0.8 mi", + "deliveryTime": "25-35 min" + } + } + } +] \ No newline at end of file diff --git a/specification/v0_9/json/catalogs/basic/examples/21_shipping-status.json b/specification/v0_9/json/catalogs/basic/examples/21_shipping-status.json new file mode 100644 index 000000000..6b00a8293 --- /dev/null +++ b/specification/v0_9/json/catalogs/basic/examples/21_shipping-status.json @@ -0,0 +1,191 @@ +[ + { + "version": "v0.9", + "createSurface": { + "surfaceId": "gallery-shipping-status", + "catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json", + "sendDataModel": true + } + }, + { + "version": "v0.9", + "updateComponents": { + "surfaceId": "gallery-shipping-status", + "components": [ + { + "id": "root", + "component": "Card", + "child": "main-column" + }, + { + "id": "main-column", + "component": "Column", + "children": [ + "header", + "tracking-number", + "divider", + "steps", + "eta" + ] + }, + { + "id": "header", + "component": "Row", + "children": [ + "package-icon", + "title" + ], + "align": "center" + }, + { + "id": "package-icon", + "component": "Icon", + "name": "package_2" + }, + { + "id": "title", + "component": "Text", + "text": "Package Status", + "variant": "h3" + }, + { + "id": "tracking-number", + "component": "Text", + "text": { + "path": "/trackingNumber" + }, + "variant": "caption" + }, + { + "id": "divider", + "component": "Divider" + }, + { + "id": "steps", + "component": "Column", + "children": [ + "step1", + "step2", + "step3", + "step4" + ] + }, + { + "id": "step1", + "component": "Row", + "children": [ + "step1-icon", + "step1-text" + ], + "align": "center" + }, + { + "id": "step1-icon", + "component": "Icon", + "name": "check_circle" + }, + { + "id": "step1-text", + "component": "Text", + "text": "Order Placed", + "variant": "body" + }, + { + "id": "step2", + "component": "Row", + "children": [ + "step2-icon", + "step2-text" + ], + "align": "center" + }, + { + "id": "step2-icon", + "component": "Icon", + "name": "check_circle" + }, + { + "id": "step2-text", + "component": "Text", + "text": "Shipped", + "variant": "body" + }, + { + "id": "step3", + "component": "Row", + "children": [ + "step3-icon", + "step3-text" + ], + "align": "center" + }, + { + "id": "step3-icon", + "component": "Icon", + "name": { + "path": "/currentStepIcon" + } + }, + { + "id": "step3-text", + "component": "Text", + "text": "Out for Delivery", + "variant": "h4" + }, + { + "id": "step4", + "component": "Row", + "children": [ + "step4-icon", + "step4-text" + ], + "align": "center" + }, + { + "id": "step4-icon", + "component": "Icon", + "name": "circle" + }, + { + "id": "step4-text", + "component": "Text", + "text": "Delivered", + "variant": "caption" + }, + { + "id": "eta", + "component": "Row", + "children": [ + "eta-icon", + "eta-text" + ], + "align": "center" + }, + { + "id": "eta-icon", + "component": "Icon", + "name": "schedule" + }, + { + "id": "eta-text", + "component": "Text", + "text": { + "path": "/eta" + }, + "variant": "body" + } + ] + } + }, + { + "version": "v0.9", + "updateDataModel": { + "surfaceId": "gallery-shipping-status", + "value": { + "trackingNumber": "Tracking: 1Z999AA10123456784", + "currentStepIcon": "local_shipping", + "eta": "Estimated delivery: Today by 8 PM" + } + } + } +] \ No newline at end of file diff --git a/specification/v0_9/json/catalogs/basic/examples/22_credit-card.json b/specification/v0_9/json/catalogs/basic/examples/22_credit-card.json new file mode 100644 index 000000000..8706eba82 --- /dev/null +++ b/specification/v0_9/json/catalogs/basic/examples/22_credit-card.json @@ -0,0 +1,129 @@ +[ + { + "version": "v0.9", + "createSurface": { + "surfaceId": "gallery-credit-card", + "catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json", + "sendDataModel": true + } + }, + { + "version": "v0.9", + "updateComponents": { + "surfaceId": "gallery-credit-card", + "components": [ + { + "id": "root", + "component": "Card", + "child": "main-column" + }, + { + "id": "main-column", + "component": "Column", + "children": [ + "card-type-row", + "card-number", + "card-details" + ] + }, + { + "id": "card-type-row", + "component": "Row", + "children": [ + "card-icon", + "card-type" + ], + "justify": "spaceBetween", + "align": "center" + }, + { + "id": "card-icon", + "component": "Icon", + "name": "credit_card" + }, + { + "id": "card-type", + "component": "Text", + "text": { + "path": "/cardType" + }, + "variant": "h4" + }, + { + "id": "card-number", + "component": "Text", + "text": { + "path": "/cardNumber" + }, + "variant": "h2" + }, + { + "id": "card-details", + "component": "Row", + "children": [ + "holder-col", + "expiry-col" + ], + "justify": "spaceBetween" + }, + { + "id": "holder-col", + "component": "Column", + "children": [ + "holder-label", + "holder-name" + ] + }, + { + "id": "holder-label", + "component": "Text", + "text": "CARD HOLDER", + "variant": "caption" + }, + { + "id": "holder-name", + "component": "Text", + "text": { + "path": "/holderName" + }, + "variant": "body" + }, + { + "id": "expiry-col", + "component": "Column", + "children": [ + "expiry-label", + "expiry-date" + ], + "align": "end" + }, + { + "id": "expiry-label", + "component": "Text", + "text": "EXPIRES", + "variant": "caption" + }, + { + "id": "expiry-date", + "component": "Text", + "text": { + "path": "/expiryDate" + }, + "variant": "body" + } + ] + } + }, + { + "version": "v0.9", + "updateDataModel": { + "surfaceId": "gallery-credit-card", + "value": { + "cardType": "VISA", + "cardNumber": "•••• •••• •••• 4242", + "holderName": "SARAH JOHNSON", + "expiryDate": "09/27" + } + } + } +] \ No newline at end of file diff --git a/specification/v0_9/json/catalogs/basic/examples/23_step-counter.json b/specification/v0_9/json/catalogs/basic/examples/23_step-counter.json new file mode 100644 index 000000000..cfd00fac2 --- /dev/null +++ b/specification/v0_9/json/catalogs/basic/examples/23_step-counter.json @@ -0,0 +1,142 @@ +[ + { + "version": "v0.9", + "createSurface": { + "surfaceId": "gallery-step-counter", + "catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json", + "sendDataModel": true + } + }, + { + "version": "v0.9", + "updateComponents": { + "surfaceId": "gallery-step-counter", + "components": [ + { + "id": "root", + "component": "Card", + "child": "main-column" + }, + { + "id": "main-column", + "component": "Column", + "children": [ + "header", + "steps-display", + "goal-text", + "divider", + "stats-row" + ], + "align": "center" + }, + { + "id": "header", + "component": "Row", + "children": [ + "steps-icon", + "title" + ], + "align": "center" + }, + { + "id": "steps-icon", + "component": "Icon", + "name": "directions_walk" + }, + { + "id": "title", + "component": "Text", + "text": "Today's Steps", + "variant": "h4" + }, + { + "id": "steps-display", + "component": "Text", + "text": { + "path": "/steps" + }, + "variant": "h1" + }, + { + "id": "goal-text", + "component": "Text", + "text": { + "path": "/goalProgress" + }, + "variant": "body" + }, + { + "id": "divider", + "component": "Divider" + }, + { + "id": "stats-row", + "component": "Row", + "children": [ + "distance-col", + "calories-col" + ], + "justify": "spaceAround" + }, + { + "id": "distance-col", + "component": "Column", + "children": [ + "distance-value", + "distance-label" + ], + "align": "center" + }, + { + "id": "distance-value", + "component": "Text", + "text": { + "path": "/distance" + }, + "variant": "h3" + }, + { + "id": "distance-label", + "component": "Text", + "text": "Distance", + "variant": "caption" + }, + { + "id": "calories-col", + "component": "Column", + "children": [ + "calories-value", + "calories-label" + ], + "align": "center" + }, + { + "id": "calories-value", + "component": "Text", + "text": { + "path": "/calories" + }, + "variant": "h3" + }, + { + "id": "calories-label", + "component": "Text", + "text": "Calories", + "variant": "caption" + } + ] + } + }, + { + "version": "v0.9", + "updateDataModel": { + "surfaceId": "gallery-step-counter", + "value": { + "steps": "8,432", + "goalProgress": "84% of 10,000 goal", + "distance": "3.8 mi", + "calories": "312" + } + } + } +] \ No newline at end of file diff --git a/specification/v0_9/json/catalogs/basic/examples/24_recipe-card.json b/specification/v0_9/json/catalogs/basic/examples/24_recipe-card.json new file mode 100644 index 000000000..f13d9cec0 --- /dev/null +++ b/specification/v0_9/json/catalogs/basic/examples/24_recipe-card.json @@ -0,0 +1,163 @@ +[ + { + "version": "v0.9", + "createSurface": { + "surfaceId": "gallery-recipe-card", + "catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json", + "sendDataModel": true + } + }, + { + "version": "v0.9", + "updateComponents": { + "surfaceId": "gallery-recipe-card", + "components": [ + { + "id": "root", + "component": "Card", + "child": "main-column" + }, + { + "id": "main-column", + "component": "Column", + "children": [ + "recipe-image", + "content" + ] + }, + { + "id": "recipe-image", + "component": "Image", + "url": { + "path": "/image" + }, + "fit": "cover" + }, + { + "id": "content", + "component": "Column", + "children": [ + "title", + "rating-row", + "times-row", + "servings" + ] + }, + { + "id": "title", + "component": "Text", + "text": { + "path": "/title" + }, + "variant": "h3" + }, + { + "id": "rating-row", + "component": "Row", + "children": [ + "star-icon", + "rating", + "review-count" + ], + "align": "center" + }, + { + "id": "star-icon", + "component": "Icon", + "name": "star" + }, + { + "id": "rating", + "component": "Text", + "text": { + "path": "/rating" + }, + "variant": "body" + }, + { + "id": "review-count", + "component": "Text", + "text": { + "path": "/reviewCount" + }, + "variant": "caption" + }, + { + "id": "times-row", + "component": "Row", + "children": [ + "prep-time", + "cook-time" + ] + }, + { + "id": "prep-time", + "component": "Row", + "children": [ + "prep-icon", + "prep-text" + ], + "align": "center" + }, + { + "id": "prep-icon", + "component": "Icon", + "name": "timer" + }, + { + "id": "prep-text", + "component": "Text", + "text": { + "path": "/prepTime" + }, + "variant": "caption" + }, + { + "id": "cook-time", + "component": "Row", + "children": [ + "cook-icon", + "cook-text" + ], + "align": "center" + }, + { + "id": "cook-icon", + "component": "Icon", + "name": "local_fire_department" + }, + { + "id": "cook-text", + "component": "Text", + "text": { + "path": "/cookTime" + }, + "variant": "caption" + }, + { + "id": "servings", + "component": "Text", + "text": { + "path": "/servings" + }, + "variant": "caption" + } + ] + } + }, + { + "version": "v0.9", + "updateDataModel": { + "surfaceId": "gallery-recipe-card", + "value": { + "image": "https://images.unsplash.com/photo-1546069901-ba9599a7e63c?w=300&h=180&fit=crop", + "title": "Mediterranean Quinoa Bowl", + "rating": "4.9", + "reviewCount": "(1,247 reviews)", + "prepTime": "15 min prep", + "cookTime": "20 min cook", + "servings": "Serves 4" + } + } + } +] \ No newline at end of file diff --git a/specification/v0_9/json/catalogs/basic/examples/25_contact-card.json b/specification/v0_9/json/catalogs/basic/examples/25_contact-card.json new file mode 100644 index 000000000..bcf4091d7 --- /dev/null +++ b/specification/v0_9/json/catalogs/basic/examples/25_contact-card.json @@ -0,0 +1,194 @@ +[ + { + "version": "v0.9", + "createSurface": { + "surfaceId": "gallery-contact-card", + "catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json", + "sendDataModel": true + } + }, + { + "version": "v0.9", + "updateComponents": { + "surfaceId": "gallery-contact-card", + "components": [ + { + "id": "root", + "component": "Card", + "child": "main-column" + }, + { + "id": "main-column", + "component": "Column", + "children": [ + "avatar-image", + "name", + "title", + "divider", + "contact-info", + "actions" + ], + "align": "center" + }, + { + "id": "avatar-image", + "component": "Image", + "url": { + "path": "/avatar" + }, + "fit": "cover", + "variant": "avatar" + }, + { + "id": "name", + "component": "Text", + "text": { + "path": "/name" + }, + "variant": "h2" + }, + { + "id": "title", + "component": "Text", + "text": { + "path": "/title" + }, + "variant": "body" + }, + { + "id": "divider", + "component": "Divider" + }, + { + "id": "contact-info", + "component": "Column", + "children": [ + "phone-row", + "email-row", + "location-row" + ] + }, + { + "id": "phone-row", + "component": "Row", + "children": [ + "phone-icon", + "phone-text" + ], + "align": "center" + }, + { + "id": "phone-icon", + "component": "Icon", + "name": "phone" + }, + { + "id": "phone-text", + "component": "Text", + "text": { + "path": "/phone" + }, + "variant": "body" + }, + { + "id": "email-row", + "component": "Row", + "children": [ + "email-icon", + "email-text" + ], + "align": "center" + }, + { + "id": "email-icon", + "component": "Icon", + "name": "mail" + }, + { + "id": "email-text", + "component": "Text", + "text": { + "path": "/email" + }, + "variant": "body" + }, + { + "id": "location-row", + "component": "Row", + "children": [ + "location-icon", + "location-text" + ], + "align": "center" + }, + { + "id": "location-icon", + "component": "Icon", + "name": "location_on" + }, + { + "id": "location-text", + "component": "Text", + "text": { + "path": "/location" + }, + "variant": "body" + }, + { + "id": "actions", + "component": "Row", + "children": [ + "call-btn", + "message-btn" + ] + }, + { + "id": "call-btn-text", + "component": "Text", + "text": "Call" + }, + { + "id": "call-btn", + "component": "Button", + "child": "call-btn-text", + "action": { + "event": { + "name": "call", + "context": {} + } + } + }, + { + "id": "message-btn-text", + "component": "Text", + "text": "Message" + }, + { + "id": "message-btn", + "component": "Button", + "child": "message-btn-text", + "action": { + "event": { + "name": "message", + "context": {} + } + } + } + ] + } + }, + { + "version": "v0.9", + "updateDataModel": { + "surfaceId": "gallery-contact-card", + "value": { + "avatar": "https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=100&h=100&fit=crop", + "name": "David Park", + "title": "Engineering Manager", + "phone": "+1 (555) 234-5678", + "email": "david.park@company.com", + "location": "San Francisco, CA" + } + } + } +] \ No newline at end of file diff --git a/specification/v0_9/json/catalogs/basic/examples/26_podcast-episode.json b/specification/v0_9/json/catalogs/basic/examples/26_podcast-episode.json new file mode 100644 index 000000000..9e28ade2a --- /dev/null +++ b/specification/v0_9/json/catalogs/basic/examples/26_podcast-episode.json @@ -0,0 +1,129 @@ +[ + { + "version": "v0.9", + "createSurface": { + "surfaceId": "gallery-podcast-episode", + "catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json", + "sendDataModel": true + } + }, + { + "version": "v0.9", + "updateComponents": { + "surfaceId": "gallery-podcast-episode", + "components": [ + { + "id": "root", + "component": "Card", + "child": "main-row" + }, + { + "id": "main-row", + "component": "Row", + "children": [ + "artwork", + "content" + ], + "align": "start" + }, + { + "id": "artwork", + "component": "Image", + "url": { + "path": "/artwork" + }, + "fit": "cover" + }, + { + "id": "content", + "component": "Column", + "children": [ + "show-name", + "episode-title", + "meta-row", + "description", + "play-btn" + ] + }, + { + "id": "show-name", + "component": "Text", + "text": { + "path": "/showName" + }, + "variant": "caption" + }, + { + "id": "episode-title", + "component": "Text", + "text": { + "path": "/episodeTitle" + }, + "variant": "h4" + }, + { + "id": "meta-row", + "component": "Row", + "children": [ + "duration", + "date" + ] + }, + { + "id": "duration", + "component": "Text", + "text": { + "path": "/duration" + }, + "variant": "caption" + }, + { + "id": "date", + "component": "Text", + "text": { + "path": "/date" + }, + "variant": "caption" + }, + { + "id": "description", + "component": "Text", + "text": { + "path": "/description" + }, + "variant": "body" + }, + { + "id": "play-btn-text", + "component": "Text", + "text": "Play Episode" + }, + { + "id": "play-btn", + "component": "Button", + "child": "play-btn-text", + "action": { + "event": { + "name": "play", + "context": {} + } + } + } + ] + } + }, + { + "version": "v0.9", + "updateDataModel": { + "surfaceId": "gallery-podcast-episode", + "value": { + "artwork": "https://images.unsplash.com/photo-1478737270239-2f02b77fc618?w=100&h=100&fit=crop", + "showName": "Tech Talk Daily", + "episodeTitle": "The Future of AI in Product Design", + "duration": "45 min", + "date": "Dec 15, 2024", + "description": "How AI is transforming the way we design and build products." + } + } + } +] \ No newline at end of file diff --git a/specification/v0_9/json/catalogs/basic/examples/27_stats-card.json b/specification/v0_9/json/catalogs/basic/examples/27_stats-card.json new file mode 100644 index 000000000..b35169efd --- /dev/null +++ b/specification/v0_9/json/catalogs/basic/examples/27_stats-card.json @@ -0,0 +1,101 @@ +[ + { + "version": "v0.9", + "createSurface": { + "surfaceId": "gallery-stats-card", + "catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json", + "sendDataModel": true + } + }, + { + "version": "v0.9", + "updateComponents": { + "surfaceId": "gallery-stats-card", + "components": [ + { + "id": "root", + "component": "Card", + "child": "main-column" + }, + { + "id": "main-column", + "component": "Column", + "children": [ + "header", + "value", + "trend-row" + ] + }, + { + "id": "header", + "component": "Row", + "children": [ + "metric-icon", + "metric-name" + ], + "align": "center" + }, + { + "id": "metric-icon", + "component": "Icon", + "name": { + "path": "/icon" + } + }, + { + "id": "metric-name", + "component": "Text", + "text": { + "path": "/metricName" + }, + "variant": "caption" + }, + { + "id": "value", + "component": "Text", + "text": { + "path": "/value" + }, + "variant": "h1" + }, + { + "id": "trend-row", + "component": "Row", + "children": [ + "trend-icon", + "trend-text" + ], + "align": "center" + }, + { + "id": "trend-icon", + "component": "Icon", + "name": { + "path": "/trendIcon" + } + }, + { + "id": "trend-text", + "component": "Text", + "text": { + "path": "/trendText" + }, + "variant": "body" + } + ] + } + }, + { + "version": "v0.9", + "updateDataModel": { + "surfaceId": "gallery-stats-card", + "value": { + "icon": "trending_up", + "metricName": "Monthly Revenue", + "value": "$48,294", + "trendIcon": "arrow_upward", + "trendText": "+12.5% from last month" + } + } + } +] \ No newline at end of file diff --git a/specification/v0_9/json/catalogs/basic/examples/28_countdown-timer.json b/specification/v0_9/json/catalogs/basic/examples/28_countdown-timer.json new file mode 100644 index 000000000..49fe05be3 --- /dev/null +++ b/specification/v0_9/json/catalogs/basic/examples/28_countdown-timer.json @@ -0,0 +1,141 @@ +[ + { + "version": "v0.9", + "createSurface": { + "surfaceId": "gallery-countdown-timer", + "catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json", + "sendDataModel": true + } + }, + { + "version": "v0.9", + "updateComponents": { + "surfaceId": "gallery-countdown-timer", + "components": [ + { + "id": "root", + "component": "Card", + "child": "main-column" + }, + { + "id": "main-column", + "component": "Column", + "children": [ + "event-name", + "countdown-row", + "target-date" + ], + "align": "center" + }, + { + "id": "event-name", + "component": "Text", + "text": { + "path": "/eventName" + }, + "variant": "h3" + }, + { + "id": "countdown-row", + "component": "Row", + "children": [ + "days-col", + "hours-col", + "minutes-col" + ], + "justify": "spaceAround" + }, + { + "id": "days-col", + "component": "Column", + "children": [ + "days-value", + "days-label" + ], + "align": "center" + }, + { + "id": "days-value", + "component": "Text", + "text": { + "path": "/days" + }, + "variant": "h1" + }, + { + "id": "days-label", + "component": "Text", + "text": "Days", + "variant": "caption" + }, + { + "id": "hours-col", + "component": "Column", + "children": [ + "hours-value", + "hours-label" + ], + "align": "center" + }, + { + "id": "hours-value", + "component": "Text", + "text": { + "path": "/hours" + }, + "variant": "h1" + }, + { + "id": "hours-label", + "component": "Text", + "text": "Hours", + "variant": "caption" + }, + { + "id": "minutes-col", + "component": "Column", + "children": [ + "minutes-value", + "minutes-label" + ], + "align": "center" + }, + { + "id": "minutes-value", + "component": "Text", + "text": { + "path": "/minutes" + }, + "variant": "h1" + }, + { + "id": "minutes-label", + "component": "Text", + "text": "Minutes", + "variant": "caption" + }, + { + "id": "target-date", + "component": "Text", + "text": { + "path": "/targetDate" + }, + "variant": "body" + } + ] + } + }, + { + "version": "v0.9", + "updateDataModel": { + "surfaceId": "gallery-countdown-timer", + "value": { + "eventName": "Product Launch", + "days": "14", + "hours": "08", + "minutes": "32", + "targetDate": "January 15, 2025" + } + } + } +] \ No newline at end of file diff --git a/specification/v0_9/json/catalogs/basic/examples/29_movie-card.json b/specification/v0_9/json/catalogs/basic/examples/29_movie-card.json new file mode 100644 index 000000000..93b3e8f2b --- /dev/null +++ b/specification/v0_9/json/catalogs/basic/examples/29_movie-card.json @@ -0,0 +1,140 @@ +[ + { + "version": "v0.9", + "createSurface": { + "surfaceId": "gallery-movie-card", + "catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json", + "sendDataModel": true + } + }, + { + "version": "v0.9", + "updateComponents": { + "surfaceId": "gallery-movie-card", + "components": [ + { + "id": "root", + "component": "Card", + "child": "main-column" + }, + { + "id": "main-column", + "component": "Column", + "children": [ + "poster", + "content" + ] + }, + { + "id": "poster", + "component": "Image", + "url": { + "path": "/poster" + }, + "fit": "cover" + }, + { + "id": "content", + "component": "Column", + "children": [ + "title-row", + "genre", + "rating-row", + "runtime" + ] + }, + { + "id": "title-row", + "component": "Row", + "children": [ + "movie-title", + "year" + ], + "align": "start" + }, + { + "id": "movie-title", + "component": "Text", + "text": { + "path": "/title" + }, + "variant": "h3" + }, + { + "id": "year", + "component": "Text", + "text": { + "path": "/year" + }, + "variant": "caption" + }, + { + "id": "genre", + "component": "Text", + "text": { + "path": "/genre" + }, + "variant": "caption" + }, + { + "id": "rating-row", + "component": "Row", + "children": [ + "star-icon", + "rating-value" + ], + "align": "center" + }, + { + "id": "star-icon", + "component": "Icon", + "name": "star" + }, + { + "id": "rating-value", + "component": "Text", + "text": { + "path": "/rating" + }, + "variant": "body" + }, + { + "id": "runtime", + "component": "Row", + "children": [ + "time-icon", + "runtime-text" + ], + "align": "center" + }, + { + "id": "time-icon", + "component": "Icon", + "name": "schedule" + }, + { + "id": "runtime-text", + "component": "Text", + "text": { + "path": "/runtime" + }, + "variant": "caption" + } + ] + } + }, + { + "version": "v0.9", + "updateDataModel": { + "surfaceId": "gallery-movie-card", + "value": { + "poster": "https://images.unsplash.com/photo-1536440136628-849c177e76a1?w=200&h=300&fit=crop", + "title": "Interstellar", + "year": "(2014)", + "genre": "Sci-Fi • Adventure • Drama", + "rating": "8.7/10", + "runtime": "2h 49min" + } + } + } +] \ No newline at end of file From 74bd055b3f736d2e7bca5c869e24dedf5f3af06c Mon Sep 17 00:00:00 2001 From: Jacob Simionato Date: Wed, 4 Mar 2026 09:44:49 +1030 Subject: [PATCH 2/5] Fix v0.9 basic catalog examples and add v0.8 versions --- .../basic/examples/01_flight-status.json | 312 ++++++++++++ .../basic/examples/02_email-compose.json | 305 ++++++++++++ .../basic/examples/03_calendar-day.json | 322 +++++++++++++ .../basic/examples/04_weather-current.json | 321 +++++++++++++ .../basic/examples/05_product-card.json | 210 ++++++++ .../basic/examples/06_music-player.json | 254 ++++++++++ .../catalogs/basic/examples/07_task-card.json | 145 ++++++ .../basic/examples/08_user-profile.json | 283 +++++++++++ .../basic/examples/09_login-form.json | 193 ++++++++ .../examples/10_notification-permission.json | 148 ++++++ .../basic/examples/11_purchase-complete.json | 260 ++++++++++ .../basic/examples/12_chat-message.json | 317 ++++++++++++ .../basic/examples/13_coffee-order.json | 451 ++++++++++++++++++ .../basic/examples/14_sports-player.json | 302 ++++++++++++ .../basic/examples/15_account-balance.json | 178 +++++++ .../basic/examples/16_workout-summary.json | 244 ++++++++++ .../basic/examples/17_event-detail.json | 218 +++++++++ .../basic/examples/18_track-list.json | 418 ++++++++++++++++ .../basic/examples/19_software-purchase.json | 279 +++++++++++ .../basic/examples/20_restaurant-card.json | 231 +++++++++ .../basic/examples/21_shipping-status.json | 300 ++++++++++++ .../basic/examples/22_credit-card.json | 192 ++++++++ .../basic/examples/23_step-counter.json | 212 ++++++++ .../basic/examples/24_recipe-card.json | 249 ++++++++++ .../basic/examples/25_contact-card.json | 288 +++++++++++ .../basic/examples/26_podcast-episode.json | 185 +++++++ .../basic/examples/27_stats-card.json | 145 ++++++ .../basic/examples/28_countdown-timer.json | 210 ++++++++ .../basic/examples/29_movie-card.json | 210 ++++++++ .../basic/examples/01_flight-status.json | 4 +- .../basic/examples/03_calendar-day.json | 4 +- .../basic/examples/09_login-form.json | 15 +- .../basic/examples/11_purchase-complete.json | 4 +- .../basic/examples/12_chat-message.json | 2 +- .../basic/examples/13_coffee-order.json | 2 +- .../basic/examples/15_account-balance.json | 2 +- .../basic/examples/17_event-detail.json | 6 +- .../basic/examples/18_track-list.json | 2 +- .../basic/examples/21_shipping-status.json | 8 +- .../basic/examples/22_credit-card.json | 4 +- .../basic/examples/23_step-counter.json | 2 +- .../basic/examples/24_recipe-card.json | 4 +- .../basic/examples/25_contact-card.json | 2 +- .../basic/examples/29_movie-card.json | 4 +- 44 files changed, 7409 insertions(+), 38 deletions(-) create mode 100644 specification/v0_8/json/catalogs/basic/examples/01_flight-status.json create mode 100644 specification/v0_8/json/catalogs/basic/examples/02_email-compose.json create mode 100644 specification/v0_8/json/catalogs/basic/examples/03_calendar-day.json create mode 100644 specification/v0_8/json/catalogs/basic/examples/04_weather-current.json create mode 100644 specification/v0_8/json/catalogs/basic/examples/05_product-card.json create mode 100644 specification/v0_8/json/catalogs/basic/examples/06_music-player.json create mode 100644 specification/v0_8/json/catalogs/basic/examples/07_task-card.json create mode 100644 specification/v0_8/json/catalogs/basic/examples/08_user-profile.json create mode 100644 specification/v0_8/json/catalogs/basic/examples/09_login-form.json create mode 100644 specification/v0_8/json/catalogs/basic/examples/10_notification-permission.json create mode 100644 specification/v0_8/json/catalogs/basic/examples/11_purchase-complete.json create mode 100644 specification/v0_8/json/catalogs/basic/examples/12_chat-message.json create mode 100644 specification/v0_8/json/catalogs/basic/examples/13_coffee-order.json create mode 100644 specification/v0_8/json/catalogs/basic/examples/14_sports-player.json create mode 100644 specification/v0_8/json/catalogs/basic/examples/15_account-balance.json create mode 100644 specification/v0_8/json/catalogs/basic/examples/16_workout-summary.json create mode 100644 specification/v0_8/json/catalogs/basic/examples/17_event-detail.json create mode 100644 specification/v0_8/json/catalogs/basic/examples/18_track-list.json create mode 100644 specification/v0_8/json/catalogs/basic/examples/19_software-purchase.json create mode 100644 specification/v0_8/json/catalogs/basic/examples/20_restaurant-card.json create mode 100644 specification/v0_8/json/catalogs/basic/examples/21_shipping-status.json create mode 100644 specification/v0_8/json/catalogs/basic/examples/22_credit-card.json create mode 100644 specification/v0_8/json/catalogs/basic/examples/23_step-counter.json create mode 100644 specification/v0_8/json/catalogs/basic/examples/24_recipe-card.json create mode 100644 specification/v0_8/json/catalogs/basic/examples/25_contact-card.json create mode 100644 specification/v0_8/json/catalogs/basic/examples/26_podcast-episode.json create mode 100644 specification/v0_8/json/catalogs/basic/examples/27_stats-card.json create mode 100644 specification/v0_8/json/catalogs/basic/examples/28_countdown-timer.json create mode 100644 specification/v0_8/json/catalogs/basic/examples/29_movie-card.json diff --git a/specification/v0_8/json/catalogs/basic/examples/01_flight-status.json b/specification/v0_8/json/catalogs/basic/examples/01_flight-status.json new file mode 100644 index 000000000..1898acff3 --- /dev/null +++ b/specification/v0_8/json/catalogs/basic/examples/01_flight-status.json @@ -0,0 +1,312 @@ +[ + { + "surfaceUpdate": { + "surfaceId": "gallery-flight-status", + "components": [ + { + "id": "root", + "component": { + "Card": { + "child": "main-column" + } + } + }, + { + "id": "main-column", + "component": { + "Column": { + "children": { + "explicitList": [ + "header-row", + "route-row", + "divider", + "times-row" + ] + }, + "alignment": "stretch" + } + } + }, + { + "id": "header-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "header-left", + "date" + ] + }, + "distribution": "spaceBetween", + "alignment": "center" + } + } + }, + { + "id": "header-left", + "component": { + "Row": { + "children": { + "explicitList": [ + "flight-indicator", + "flight-number" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "flight-indicator", + "component": { + "Icon": { + "name": { + "literalString": "send" + } + } + } + }, + { + "id": "flight-number", + "component": { + "Text": { + "text": { + "path": "/flightNumber" + }, + "usageHint": "h3" + } + } + }, + { + "id": "date", + "component": { + "Text": { + "text": { + "path": "/date" + }, + "usageHint": "caption" + } + } + }, + { + "id": "route-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "origin", + "arrow", + "destination" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "origin", + "component": { + "Text": { + "text": { + "path": "/origin" + }, + "usageHint": "h2" + } + } + }, + { + "id": "arrow", + "component": { + "Text": { + "text": { + "literalString": "\u2192" + }, + "usageHint": "h2" + } + } + }, + { + "id": "destination", + "component": { + "Text": { + "text": { + "path": "/destination" + }, + "usageHint": "h2" + } + } + }, + { + "id": "divider", + "component": { + "Divider": {} + } + }, + { + "id": "times-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "departure-col", + "status-col", + "arrival-col" + ] + }, + "distribution": "spaceBetween" + } + } + }, + { + "id": "departure-col", + "component": { + "Column": { + "children": { + "explicitList": [ + "departure-label", + "departure-time" + ] + }, + "alignment": "start" + } + } + }, + { + "id": "departure-label", + "component": { + "Text": { + "text": { + "literalString": "Departs" + }, + "usageHint": "caption" + } + } + }, + { + "id": "departure-time", + "component": { + "Text": { + "text": { + "path": "/departureTime" + }, + "usageHint": "h3" + } + } + }, + { + "id": "status-col", + "component": { + "Column": { + "children": { + "explicitList": [ + "status-label", + "status-value" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "status-label", + "component": { + "Text": { + "text": { + "literalString": "Status" + }, + "usageHint": "caption" + } + } + }, + { + "id": "status-value", + "component": { + "Text": { + "text": { + "path": "/status" + }, + "usageHint": "body" + } + } + }, + { + "id": "arrival-col", + "component": { + "Column": { + "children": { + "explicitList": [ + "arrival-label", + "arrival-time" + ] + }, + "alignment": "end" + } + } + }, + { + "id": "arrival-label", + "component": { + "Text": { + "text": { + "literalString": "Arrives" + }, + "usageHint": "caption" + } + } + }, + { + "id": "arrival-time", + "component": { + "Text": { + "text": { + "path": "/arrivalTime" + }, + "usageHint": "h3" + } + } + } + ] + } + }, + { + "dataModelUpdate": { + "surfaceId": "gallery-flight-status", + "contents": [ + { + "key": "flightNumber", + "valueString": "OS 87" + }, + { + "key": "date", + "valueString": "Mon, Dec 15" + }, + { + "key": "origin", + "valueString": "Vienna" + }, + { + "key": "destination", + "valueString": "New York" + }, + { + "key": "departureTime", + "valueString": "10:15 AM" + }, + { + "key": "status", + "valueString": "On Time" + }, + { + "key": "arrivalTime", + "valueString": "2:30 PM" + } + ] + } + }, + { + "beginRendering": { + "surfaceId": "gallery-flight-status", + "root": "root" + } + } +] \ No newline at end of file diff --git a/specification/v0_8/json/catalogs/basic/examples/02_email-compose.json b/specification/v0_8/json/catalogs/basic/examples/02_email-compose.json new file mode 100644 index 000000000..85a458de5 --- /dev/null +++ b/specification/v0_8/json/catalogs/basic/examples/02_email-compose.json @@ -0,0 +1,305 @@ +[ + { + "surfaceUpdate": { + "surfaceId": "gallery-email-compose", + "components": [ + { + "id": "root", + "component": { + "Card": { + "child": "main-column" + } + } + }, + { + "id": "main-column", + "component": { + "Column": { + "children": { + "explicitList": [ + "from-row", + "to-row", + "subject-row", + "divider", + "message", + "actions" + ] + } + } + } + }, + { + "id": "from-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "from-label", + "from-value" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "from-label", + "component": { + "Text": { + "text": { + "literalString": "FROM" + }, + "usageHint": "caption" + } + } + }, + { + "id": "from-value", + "component": { + "Text": { + "text": { + "path": "/from" + }, + "usageHint": "body" + } + } + }, + { + "id": "to-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "to-label", + "to-value" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "to-label", + "component": { + "Text": { + "text": { + "literalString": "TO" + }, + "usageHint": "caption" + } + } + }, + { + "id": "to-value", + "component": { + "Text": { + "text": { + "path": "/to" + }, + "usageHint": "body" + } + } + }, + { + "id": "subject-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "subject-label", + "subject-value" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "subject-label", + "component": { + "Text": { + "text": { + "literalString": "SUBJECT" + }, + "usageHint": "caption" + } + } + }, + { + "id": "subject-value", + "component": { + "Text": { + "text": { + "path": "/subject" + }, + "usageHint": "body" + } + } + }, + { + "id": "divider", + "component": { + "Divider": {} + } + }, + { + "id": "message", + "component": { + "Column": { + "children": { + "explicitList": [ + "greeting", + "body-text", + "closing", + "signature" + ] + } + } + } + }, + { + "id": "greeting", + "component": { + "Text": { + "text": { + "path": "/greeting" + }, + "usageHint": "body" + } + } + }, + { + "id": "body-text", + "component": { + "Text": { + "text": { + "path": "/body" + }, + "usageHint": "body" + } + } + }, + { + "id": "closing", + "component": { + "Text": { + "text": { + "path": "/closing" + }, + "usageHint": "body" + } + } + }, + { + "id": "signature", + "component": { + "Text": { + "text": { + "path": "/signature" + }, + "usageHint": "body" + } + } + }, + { + "id": "actions", + "component": { + "Row": { + "children": { + "explicitList": [ + "send-btn", + "discard-btn" + ] + } + } + } + }, + { + "id": "send-btn-text", + "component": { + "Text": { + "text": { + "literalString": "Send email" + } + } + } + }, + { + "id": "send-btn", + "component": { + "Button": { + "child": "send-btn-text", + "action": { + "name": "send", + "context": [] + } + } + } + }, + { + "id": "discard-btn-text", + "component": { + "Text": { + "text": { + "literalString": "Discard" + } + } + } + }, + { + "id": "discard-btn", + "component": { + "Button": { + "child": "discard-btn-text", + "action": { + "name": "discard", + "context": [] + } + } + } + } + ] + } + }, + { + "dataModelUpdate": { + "surfaceId": "gallery-email-compose", + "contents": [ + { + "key": "from", + "valueString": "alex@acme.com" + }, + { + "key": "to", + "valueString": "jordan@acme.com" + }, + { + "key": "subject", + "valueString": "Q4 Revenue Forecast" + }, + { + "key": "greeting", + "valueString": "Hi Jordan," + }, + { + "key": "body", + "valueString": "Following up on our call. Please review the attached Q4 forecast and let me know if you have questions before the board meeting." + }, + { + "key": "closing", + "valueString": "Best," + }, + { + "key": "signature", + "valueString": "Alex" + } + ] + } + }, + { + "beginRendering": { + "surfaceId": "gallery-email-compose", + "root": "root" + } + } +] \ No newline at end of file diff --git a/specification/v0_8/json/catalogs/basic/examples/03_calendar-day.json b/specification/v0_8/json/catalogs/basic/examples/03_calendar-day.json new file mode 100644 index 000000000..5754e5b61 --- /dev/null +++ b/specification/v0_8/json/catalogs/basic/examples/03_calendar-day.json @@ -0,0 +1,322 @@ +[ + { + "surfaceUpdate": { + "surfaceId": "gallery-calendar-day", + "components": [ + { + "id": "root", + "component": { + "Card": { + "child": "main-column" + } + } + }, + { + "id": "main-column", + "component": { + "Column": { + "children": { + "explicitList": [ + "header-row", + "divider", + "actions" + ] + } + } + } + }, + { + "id": "header-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "date-col", + "events-col" + ] + } + } + } + }, + { + "id": "date-col", + "component": { + "Column": { + "children": { + "explicitList": [ + "day-name", + "day-number" + ] + }, + "alignment": "start" + } + } + }, + { + "id": "day-name", + "component": { + "Text": { + "text": { + "path": "/dayName" + }, + "usageHint": "caption" + } + } + }, + { + "id": "day-number", + "component": { + "Text": { + "text": { + "path": "/dayNumber" + }, + "usageHint": "h1" + } + } + }, + { + "id": "events-col", + "component": { + "Column": { + "children": { + "explicitList": [ + "event1", + "event2", + "event3" + ] + } + } + } + }, + { + "id": "event1", + "component": { + "Column": { + "children": { + "explicitList": [ + "event1-title", + "event1-time" + ] + } + } + } + }, + { + "id": "event1-title", + "component": { + "Text": { + "text": { + "path": "/event1/title" + }, + "usageHint": "body" + } + } + }, + { + "id": "event1-time", + "component": { + "Text": { + "text": { + "path": "/event1/time" + }, + "usageHint": "caption" + } + } + }, + { + "id": "event2", + "component": { + "Column": { + "children": { + "explicitList": [ + "event2-title", + "event2-time" + ] + } + } + } + }, + { + "id": "event2-title", + "component": { + "Text": { + "text": { + "path": "/event2/title" + }, + "usageHint": "body" + } + } + }, + { + "id": "event2-time", + "component": { + "Text": { + "text": { + "path": "/event2/time" + }, + "usageHint": "caption" + } + } + }, + { + "id": "event3", + "component": { + "Column": { + "children": { + "explicitList": [ + "event3-title", + "event3-time" + ] + } + } + } + }, + { + "id": "event3-title", + "component": { + "Text": { + "text": { + "path": "/event3/title" + }, + "usageHint": "body" + } + } + }, + { + "id": "event3-time", + "component": { + "Text": { + "text": { + "path": "/event3/time" + }, + "usageHint": "caption" + } + } + }, + { + "id": "divider", + "component": { + "Divider": {} + } + }, + { + "id": "actions", + "component": { + "Row": { + "children": { + "explicitList": [ + "add-btn", + "discard-btn" + ] + } + } + } + }, + { + "id": "add-btn-text", + "component": { + "Text": { + "text": { + "literalString": "Add to calendar" + } + } + } + }, + { + "id": "add-btn", + "component": { + "Button": { + "child": "add-btn-text", + "action": { + "name": "add", + "context": [] + } + } + } + }, + { + "id": "discard-btn-text", + "component": { + "Text": { + "text": { + "literalString": "Discard" + } + } + } + }, + { + "id": "discard-btn", + "component": { + "Button": { + "child": "discard-btn-text", + "action": { + "name": "discard", + "context": [] + } + } + } + } + ] + } + }, + { + "dataModelUpdate": { + "surfaceId": "gallery-calendar-day", + "contents": [ + { + "key": "dayName", + "valueString": "Friday" + }, + { + "key": "dayNumber", + "valueString": "28" + }, + { + "key": "event1", + "valueMap": [ + { + "key": "title", + "valueString": "Lunch" + }, + { + "key": "time", + "valueString": "12:00 - 12:45 PM" + } + ] + }, + { + "key": "event2", + "valueMap": [ + { + "key": "title", + "valueString": "Q1 roadmap review" + }, + { + "key": "time", + "valueString": "1:00 - 2:00 PM" + } + ] + }, + { + "key": "event3", + "valueMap": [ + { + "key": "title", + "valueString": "Team standup" + }, + { + "key": "time", + "valueString": "3:30 - 4:00 PM" + } + ] + } + ] + } + }, + { + "beginRendering": { + "surfaceId": "gallery-calendar-day", + "root": "root" + } + } +] \ No newline at end of file diff --git a/specification/v0_8/json/catalogs/basic/examples/04_weather-current.json b/specification/v0_8/json/catalogs/basic/examples/04_weather-current.json new file mode 100644 index 000000000..0996ff587 --- /dev/null +++ b/specification/v0_8/json/catalogs/basic/examples/04_weather-current.json @@ -0,0 +1,321 @@ +[ + { + "surfaceUpdate": { + "surfaceId": "gallery-weather-current", + "components": [ + { + "id": "root", + "component": { + "Card": { + "child": "main-column" + } + } + }, + { + "id": "main-column", + "component": { + "Column": { + "children": { + "explicitList": [ + "temp-row", + "location", + "description", + "forecast-row" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "temp-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "temp-high", + "temp-low" + ] + }, + "alignment": "start" + } + } + }, + { + "id": "temp-high", + "component": { + "Text": { + "text": { + "path": "/tempHigh" + }, + "usageHint": "h1" + } + } + }, + { + "id": "temp-low", + "component": { + "Text": { + "text": { + "path": "/tempLow" + }, + "usageHint": "h2" + } + } + }, + { + "id": "location", + "component": { + "Text": { + "text": { + "path": "/location" + }, + "usageHint": "h3" + } + } + }, + { + "id": "description", + "component": { + "Text": { + "text": { + "path": "/description" + }, + "usageHint": "caption" + } + } + }, + { + "id": "forecast-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "day1", + "day2", + "day3", + "day4", + "day5" + ] + }, + "distribution": "spaceAround" + } + } + }, + { + "id": "day1", + "component": { + "Column": { + "children": { + "explicitList": [ + "day1-icon", + "day1-temp" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "day1-icon", + "component": { + "Text": { + "text": { + "path": "/forecast/0/icon" + }, + "usageHint": "h3" + } + } + }, + { + "id": "day1-temp", + "component": { + "Text": { + "text": { + "path": "/forecast/0/temp" + }, + "usageHint": "caption" + } + } + }, + { + "id": "day2", + "component": { + "Column": { + "children": { + "explicitList": [ + "day2-icon", + "day2-temp" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "day2-icon", + "component": { + "Text": { + "text": { + "path": "/forecast/1/icon" + }, + "usageHint": "h3" + } + } + }, + { + "id": "day2-temp", + "component": { + "Text": { + "text": { + "path": "/forecast/1/temp" + }, + "usageHint": "caption" + } + } + }, + { + "id": "day3", + "component": { + "Column": { + "children": { + "explicitList": [ + "day3-icon", + "day3-temp" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "day3-icon", + "component": { + "Text": { + "text": { + "path": "/forecast/2/icon" + }, + "usageHint": "h3" + } + } + }, + { + "id": "day3-temp", + "component": { + "Text": { + "text": { + "path": "/forecast/2/temp" + }, + "usageHint": "caption" + } + } + }, + { + "id": "day4", + "component": { + "Column": { + "children": { + "explicitList": [ + "day4-icon", + "day4-temp" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "day4-icon", + "component": { + "Text": { + "text": { + "path": "/forecast/3/icon" + }, + "usageHint": "h3" + } + } + }, + { + "id": "day4-temp", + "component": { + "Text": { + "text": { + "path": "/forecast/3/temp" + }, + "usageHint": "caption" + } + } + }, + { + "id": "day5", + "component": { + "Column": { + "children": { + "explicitList": [ + "day5-icon", + "day5-temp" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "day5-icon", + "component": { + "Text": { + "text": { + "path": "/forecast/4/icon" + }, + "usageHint": "h3" + } + } + }, + { + "id": "day5-temp", + "component": { + "Text": { + "text": { + "path": "/forecast/4/temp" + }, + "usageHint": "caption" + } + } + } + ] + } + }, + { + "dataModelUpdate": { + "surfaceId": "gallery-weather-current", + "contents": [ + { + "key": "tempHigh", + "valueString": "72\u00b0" + }, + { + "key": "tempLow", + "valueString": "58\u00b0" + }, + { + "key": "location", + "valueString": "Austin, TX" + }, + { + "key": "description", + "valueString": "Clear skies with light breeze" + }, + { + "key": "forecast", + "valueString": "[{'icon': '\u2600\ufe0f', 'temp': '74\u00b0'}, {'icon': '\u2600\ufe0f', 'temp': '76\u00b0'}, {'icon': '\u26c5', 'temp': '71\u00b0'}, {'icon': '\u2600\ufe0f', 'temp': '73\u00b0'}, {'icon': '\u2600\ufe0f', 'temp': '75\u00b0'}]" + } + ] + } + }, + { + "beginRendering": { + "surfaceId": "gallery-weather-current", + "root": "root" + } + } +] \ No newline at end of file diff --git a/specification/v0_8/json/catalogs/basic/examples/05_product-card.json b/specification/v0_8/json/catalogs/basic/examples/05_product-card.json new file mode 100644 index 000000000..2368af55e --- /dev/null +++ b/specification/v0_8/json/catalogs/basic/examples/05_product-card.json @@ -0,0 +1,210 @@ +[ + { + "surfaceUpdate": { + "surfaceId": "gallery-product-card", + "components": [ + { + "id": "root", + "component": { + "Card": { + "child": "main-column" + } + } + }, + { + "id": "main-column", + "component": { + "Column": { + "children": { + "explicitList": [ + "image", + "details" + ] + } + } + } + }, + { + "id": "image", + "component": { + "Image": { + "url": { + "path": "/imageUrl" + }, + "fit": "cover" + } + } + }, + { + "id": "details", + "component": { + "Column": { + "children": { + "explicitList": [ + "name", + "rating-row", + "price-row", + "actions" + ] + } + } + } + }, + { + "id": "name", + "component": { + "Text": { + "text": { + "path": "/name" + }, + "usageHint": "h3" + } + } + }, + { + "id": "rating-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "stars", + "reviews" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "stars", + "component": { + "Text": { + "text": { + "path": "/stars" + }, + "usageHint": "body" + } + } + }, + { + "id": "reviews", + "component": { + "Text": { + "text": { + "path": "/reviews" + }, + "usageHint": "caption" + } + } + }, + { + "id": "price-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "price", + "original-price" + ] + }, + "alignment": "start" + } + } + }, + { + "id": "price", + "component": { + "Text": { + "text": { + "path": "/price" + }, + "usageHint": "h2" + } + } + }, + { + "id": "original-price", + "component": { + "Text": { + "text": { + "path": "/originalPrice" + }, + "usageHint": "caption" + } + } + }, + { + "id": "actions", + "component": { + "Row": { + "children": { + "explicitList": [ + "add-cart-btn" + ] + } + } + } + }, + { + "id": "add-cart-btn-text", + "component": { + "Text": { + "text": { + "literalString": "Add to Cart" + } + } + } + }, + { + "id": "add-cart-btn", + "component": { + "Button": { + "child": "add-cart-btn-text", + "action": { + "name": "addToCart", + "context": [] + } + } + } + } + ] + } + }, + { + "dataModelUpdate": { + "surfaceId": "gallery-product-card", + "contents": [ + { + "key": "imageUrl", + "valueString": "https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=300&h=200&fit=crop" + }, + { + "key": "name", + "valueString": "Wireless Headphones Pro" + }, + { + "key": "stars", + "valueString": "\u2605\u2605\u2605\u2605\u2605" + }, + { + "key": "reviews", + "valueString": "(2,847 reviews)" + }, + { + "key": "price", + "valueString": "$199.99" + }, + { + "key": "originalPrice", + "valueString": "$249.99" + } + ] + } + }, + { + "beginRendering": { + "surfaceId": "gallery-product-card", + "root": "root" + } + } +] \ No newline at end of file diff --git a/specification/v0_8/json/catalogs/basic/examples/06_music-player.json b/specification/v0_8/json/catalogs/basic/examples/06_music-player.json new file mode 100644 index 000000000..d06b841a8 --- /dev/null +++ b/specification/v0_8/json/catalogs/basic/examples/06_music-player.json @@ -0,0 +1,254 @@ +[ + { + "surfaceUpdate": { + "surfaceId": "gallery-music-player", + "components": [ + { + "id": "root", + "component": { + "Card": { + "child": "main-column" + } + } + }, + { + "id": "main-column", + "component": { + "Column": { + "children": { + "explicitList": [ + "album-art", + "track-info", + "progress", + "time-row", + "controls" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "album-art", + "component": { + "Image": { + "url": { + "path": "/albumArt" + }, + "fit": "cover" + } + } + }, + { + "id": "track-info", + "component": { + "Column": { + "children": { + "explicitList": [ + "song-title", + "artist" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "song-title", + "component": { + "Text": { + "text": { + "path": "/title" + }, + "usageHint": "h3" + } + } + }, + { + "id": "artist", + "component": { + "Text": { + "text": { + "path": "/artist" + }, + "usageHint": "caption" + } + } + }, + { + "id": "progress", + "component": { + "Slider": { + "value": { + "path": "/progress" + }, + "max": 1 + } + } + }, + { + "id": "time-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "current-time", + "total-time" + ] + }, + "distribution": "spaceBetween" + } + } + }, + { + "id": "current-time", + "component": { + "Text": { + "text": { + "path": "/currentTime" + }, + "usageHint": "caption" + } + } + }, + { + "id": "total-time", + "component": { + "Text": { + "text": { + "path": "/totalTime" + }, + "usageHint": "caption" + } + } + }, + { + "id": "controls", + "component": { + "Row": { + "children": { + "explicitList": [ + "prev-btn", + "play-btn", + "next-btn" + ] + }, + "distribution": "center" + } + } + }, + { + "id": "prev-btn-text", + "component": { + "Text": { + "text": { + "literalString": "\u23ee" + } + } + } + }, + { + "id": "prev-btn", + "component": { + "Button": { + "child": "prev-btn-text", + "action": { + "name": "previous", + "context": [] + } + } + } + }, + { + "id": "play-btn-text", + "component": { + "Text": { + "text": { + "path": "/playIcon" + } + } + } + }, + { + "id": "play-btn", + "component": { + "Button": { + "child": "play-btn-text", + "action": { + "name": "playPause", + "context": [] + } + } + } + }, + { + "id": "next-btn-text", + "component": { + "Text": { + "text": { + "literalString": "\u23ed" + } + } + } + }, + { + "id": "next-btn", + "component": { + "Button": { + "child": "next-btn-text", + "action": { + "name": "next", + "context": [] + } + } + } + } + ] + } + }, + { + "dataModelUpdate": { + "surfaceId": "gallery-music-player", + "contents": [ + { + "key": "albumArt", + "valueString": "https://images.unsplash.com/photo-1493225457124-a3eb161ffa5f?w=300&h=300&fit=crop" + }, + { + "key": "title", + "valueString": "Blinding Lights" + }, + { + "key": "artist", + "valueString": "The Weeknd" + }, + { + "key": "album", + "valueString": "After Hours" + }, + { + "key": "progress", + "valueNumber": 0.45 + }, + { + "key": "currentTime", + "valueString": "1:48" + }, + { + "key": "totalTime", + "valueString": "4:22" + }, + { + "key": "playIcon", + "valueString": "\u23f8" + } + ] + } + }, + { + "beginRendering": { + "surfaceId": "gallery-music-player", + "root": "root" + } + } +] \ No newline at end of file diff --git a/specification/v0_8/json/catalogs/basic/examples/07_task-card.json b/specification/v0_8/json/catalogs/basic/examples/07_task-card.json new file mode 100644 index 000000000..a30417a69 --- /dev/null +++ b/specification/v0_8/json/catalogs/basic/examples/07_task-card.json @@ -0,0 +1,145 @@ +[ + { + "surfaceUpdate": { + "surfaceId": "gallery-task-card", + "components": [ + { + "id": "root", + "component": { + "Card": { + "child": "main-row" + } + } + }, + { + "id": "main-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "content", + "priority" + ] + }, + "alignment": "start" + } + } + }, + { + "id": "content", + "component": { + "Column": { + "children": { + "explicitList": [ + "title", + "description", + "meta-row" + ] + } + } + } + }, + { + "id": "title", + "component": { + "Text": { + "text": { + "path": "/title" + }, + "usageHint": "h3" + } + } + }, + { + "id": "description", + "component": { + "Text": { + "text": { + "path": "/description" + }, + "usageHint": "body" + } + } + }, + { + "id": "meta-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "due-date", + "project" + ] + } + } + } + }, + { + "id": "due-date", + "component": { + "Text": { + "text": { + "path": "/dueDate" + }, + "usageHint": "caption" + } + } + }, + { + "id": "project", + "component": { + "Text": { + "text": { + "path": "/project" + }, + "usageHint": "caption" + } + } + }, + { + "id": "priority", + "component": { + "Icon": { + "name": { + "path": "/priorityIcon" + } + } + } + } + ] + } + }, + { + "dataModelUpdate": { + "surfaceId": "gallery-task-card", + "contents": [ + { + "key": "title", + "valueString": "Review pull request" + }, + { + "key": "description", + "valueString": "Review and approve the authentication module changes." + }, + { + "key": "dueDate", + "valueString": "Today" + }, + { + "key": "project", + "valueString": "Backend" + }, + { + "key": "priorityIcon", + "valueString": "priority_high" + } + ] + } + }, + { + "beginRendering": { + "surfaceId": "gallery-task-card", + "root": "root" + } + } +] \ No newline at end of file diff --git a/specification/v0_8/json/catalogs/basic/examples/08_user-profile.json b/specification/v0_8/json/catalogs/basic/examples/08_user-profile.json new file mode 100644 index 000000000..b0def3672 --- /dev/null +++ b/specification/v0_8/json/catalogs/basic/examples/08_user-profile.json @@ -0,0 +1,283 @@ +[ + { + "surfaceUpdate": { + "surfaceId": "gallery-user-profile", + "components": [ + { + "id": "root", + "component": { + "Card": { + "child": "main-column" + } + } + }, + { + "id": "main-column", + "component": { + "Column": { + "children": { + "explicitList": [ + "header", + "info", + "bio", + "stats-row", + "follow-btn" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "header", + "component": { + "Image": { + "url": { + "path": "/avatar" + }, + "fit": "cover", + "usageHint": "avatar" + } + } + }, + { + "id": "info", + "component": { + "Column": { + "children": { + "explicitList": [ + "name", + "username" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "name", + "component": { + "Text": { + "text": { + "path": "/name" + }, + "usageHint": "h2" + } + } + }, + { + "id": "username", + "component": { + "Text": { + "text": { + "path": "/username" + }, + "usageHint": "caption" + } + } + }, + { + "id": "bio", + "component": { + "Text": { + "text": { + "path": "/bio" + }, + "usageHint": "body" + } + } + }, + { + "id": "stats-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "followers-col", + "following-col", + "posts-col" + ] + }, + "distribution": "spaceAround" + } + } + }, + { + "id": "followers-col", + "component": { + "Column": { + "children": { + "explicitList": [ + "followers-count", + "followers-label" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "followers-count", + "component": { + "Text": { + "text": { + "path": "/followers" + }, + "usageHint": "h3" + } + } + }, + { + "id": "followers-label", + "component": { + "Text": { + "text": { + "literalString": "Followers" + }, + "usageHint": "caption" + } + } + }, + { + "id": "following-col", + "component": { + "Column": { + "children": { + "explicitList": [ + "following-count", + "following-label" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "following-count", + "component": { + "Text": { + "text": { + "path": "/following" + }, + "usageHint": "h3" + } + } + }, + { + "id": "following-label", + "component": { + "Text": { + "text": { + "literalString": "Following" + }, + "usageHint": "caption" + } + } + }, + { + "id": "posts-col", + "component": { + "Column": { + "children": { + "explicitList": [ + "posts-count", + "posts-label" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "posts-count", + "component": { + "Text": { + "text": { + "path": "/posts" + }, + "usageHint": "h3" + } + } + }, + { + "id": "posts-label", + "component": { + "Text": { + "text": { + "literalString": "Posts" + }, + "usageHint": "caption" + } + } + }, + { + "id": "follow-btn-text", + "component": { + "Text": { + "text": { + "path": "/followText" + } + } + } + }, + { + "id": "follow-btn", + "component": { + "Button": { + "child": "follow-btn-text", + "action": { + "name": "follow", + "context": [] + } + } + } + } + ] + } + }, + { + "dataModelUpdate": { + "surfaceId": "gallery-user-profile", + "contents": [ + { + "key": "avatar", + "valueString": "https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=150&h=150&fit=crop" + }, + { + "key": "name", + "valueString": "Sarah Chen" + }, + { + "key": "username", + "valueString": "@sarahchen" + }, + { + "key": "bio", + "valueString": "Product Designer at Tech Co. Creating delightful experiences." + }, + { + "key": "followers", + "valueString": "12.4K" + }, + { + "key": "following", + "valueString": "892" + }, + { + "key": "posts", + "valueString": "347" + }, + { + "key": "followText", + "valueString": "Follow" + } + ] + } + }, + { + "beginRendering": { + "surfaceId": "gallery-user-profile", + "root": "root" + } + } +] \ No newline at end of file diff --git a/specification/v0_8/json/catalogs/basic/examples/09_login-form.json b/specification/v0_8/json/catalogs/basic/examples/09_login-form.json new file mode 100644 index 000000000..ca412bd7f --- /dev/null +++ b/specification/v0_8/json/catalogs/basic/examples/09_login-form.json @@ -0,0 +1,193 @@ +[ + { + "surfaceUpdate": { + "surfaceId": "gallery-login-form", + "components": [ + { + "id": "root", + "component": { + "Card": { + "child": "main-column" + } + } + }, + { + "id": "main-column", + "component": { + "Column": { + "children": { + "explicitList": [ + "header", + "email-field", + "password-field", + "login-btn", + "divider", + "signup-text" + ] + } + } + } + }, + { + "id": "header", + "component": { + "Column": { + "children": { + "explicitList": [ + "title", + "subtitle" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "title", + "component": { + "Text": { + "text": { + "literalString": "Welcome back" + }, + "usageHint": "h2" + } + } + }, + { + "id": "subtitle", + "component": { + "Text": { + "text": { + "literalString": "Sign in to your account" + }, + "usageHint": "caption" + } + } + }, + { + "id": "email-field", + "component": { + "TextField": { + "label": { + "literalString": "Email" + }, + "text": { + "path": "/email" + } + } + } + }, + { + "id": "password-field", + "component": { + "TextField": { + "label": { + "literalString": "Password" + }, + "text": { + "path": "/password" + }, + "textFieldType": "obscured" + } + } + }, + { + "id": "login-btn-text", + "component": { + "Text": { + "text": { + "literalString": "Sign in" + } + } + } + }, + { + "id": "login-btn", + "component": { + "Button": { + "child": "login-btn-text", + "action": { + "name": "login", + "context": [] + } + } + } + }, + { + "id": "divider", + "component": { + "Divider": {} + } + }, + { + "id": "signup-text", + "component": { + "Row": { + "children": { + "explicitList": [ + "no-account", + "signup-link" + ] + }, + "distribution": "center" + } + } + }, + { + "id": "no-account", + "component": { + "Text": { + "text": { + "literalString": "Don't have an account?" + }, + "usageHint": "caption" + } + } + }, + { + "id": "signup-link-text", + "component": { + "Text": { + "text": { + "literalString": "Sign up" + } + } + } + }, + { + "id": "signup-link", + "component": { + "Button": { + "child": "signup-link-text", + "action": { + "name": "signup", + "context": [] + } + } + } + } + ] + } + }, + { + "dataModelUpdate": { + "surfaceId": "gallery-login-form", + "contents": [ + { + "key": "email", + "valueString": "" + }, + { + "key": "password", + "valueString": "" + } + ] + } + }, + { + "beginRendering": { + "surfaceId": "gallery-login-form", + "root": "root" + } + } +] \ No newline at end of file diff --git a/specification/v0_8/json/catalogs/basic/examples/10_notification-permission.json b/specification/v0_8/json/catalogs/basic/examples/10_notification-permission.json new file mode 100644 index 000000000..c4036d76e --- /dev/null +++ b/specification/v0_8/json/catalogs/basic/examples/10_notification-permission.json @@ -0,0 +1,148 @@ +[ + { + "surfaceUpdate": { + "surfaceId": "gallery-notification-permission", + "components": [ + { + "id": "root", + "component": { + "Card": { + "child": "main-column" + } + } + }, + { + "id": "main-column", + "component": { + "Column": { + "children": { + "explicitList": [ + "icon", + "title", + "description", + "actions" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "icon", + "component": { + "Icon": { + "name": { + "path": "/icon" + } + } + } + }, + { + "id": "title", + "component": { + "Text": { + "text": { + "path": "/title" + }, + "usageHint": "h3" + } + } + }, + { + "id": "description", + "component": { + "Text": { + "text": { + "path": "/description" + }, + "usageHint": "body" + } + } + }, + { + "id": "actions", + "component": { + "Row": { + "children": { + "explicitList": [ + "yes-btn", + "no-btn" + ] + }, + "distribution": "center" + } + } + }, + { + "id": "yes-btn-text", + "component": { + "Text": { + "text": { + "literalString": "Yes" + } + } + } + }, + { + "id": "yes-btn", + "component": { + "Button": { + "child": "yes-btn-text", + "action": { + "name": "accept", + "context": [] + } + } + } + }, + { + "id": "no-btn-text", + "component": { + "Text": { + "text": { + "literalString": "No" + } + } + } + }, + { + "id": "no-btn", + "component": { + "Button": { + "child": "no-btn-text", + "action": { + "name": "decline", + "context": [] + } + } + } + } + ] + } + }, + { + "dataModelUpdate": { + "surfaceId": "gallery-notification-permission", + "contents": [ + { + "key": "icon", + "valueString": "check" + }, + { + "key": "title", + "valueString": "Enable notification" + }, + { + "key": "description", + "valueString": "Get alerts for order status changes" + } + ] + } + }, + { + "beginRendering": { + "surfaceId": "gallery-notification-permission", + "root": "root" + } + } +] \ No newline at end of file diff --git a/specification/v0_8/json/catalogs/basic/examples/11_purchase-complete.json b/specification/v0_8/json/catalogs/basic/examples/11_purchase-complete.json new file mode 100644 index 000000000..d796da812 --- /dev/null +++ b/specification/v0_8/json/catalogs/basic/examples/11_purchase-complete.json @@ -0,0 +1,260 @@ +[ + { + "surfaceUpdate": { + "surfaceId": "gallery-purchase-complete", + "components": [ + { + "id": "root", + "component": { + "Card": { + "child": "main-column" + } + } + }, + { + "id": "main-column", + "component": { + "Column": { + "children": { + "explicitList": [ + "success-icon", + "title", + "product-row", + "divider", + "details-col", + "view-btn" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "success-icon", + "component": { + "Icon": { + "name": { + "literalString": "check" + } + } + } + }, + { + "id": "title", + "component": { + "Text": { + "text": { + "literalString": "Purchase Complete" + }, + "usageHint": "h2" + } + } + }, + { + "id": "product-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "product-image", + "product-info" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "product-image", + "component": { + "Image": { + "url": { + "path": "/productImage" + }, + "fit": "cover" + } + } + }, + { + "id": "product-info", + "component": { + "Column": { + "children": { + "explicitList": [ + "product-name", + "product-price" + ] + } + } + } + }, + { + "id": "product-name", + "component": { + "Text": { + "text": { + "path": "/productName" + }, + "usageHint": "h4" + } + } + }, + { + "id": "product-price", + "component": { + "Text": { + "text": { + "path": "/price" + }, + "usageHint": "body" + } + } + }, + { + "id": "divider", + "component": { + "Divider": {} + } + }, + { + "id": "details-col", + "component": { + "Column": { + "children": { + "explicitList": [ + "delivery-row", + "seller-row" + ] + } + } + } + }, + { + "id": "delivery-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "delivery-icon", + "delivery-text" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "delivery-icon", + "component": { + "Icon": { + "name": { + "literalString": "arrowForward" + } + } + } + }, + { + "id": "delivery-text", + "component": { + "Text": { + "text": { + "path": "/deliveryDate" + }, + "usageHint": "body" + } + } + }, + { + "id": "seller-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "seller-label", + "seller-name" + ] + } + } + } + }, + { + "id": "seller-label", + "component": { + "Text": { + "text": { + "literalString": "Sold by:" + }, + "usageHint": "caption" + } + } + }, + { + "id": "seller-name", + "component": { + "Text": { + "text": { + "path": "/seller" + }, + "usageHint": "body" + } + } + }, + { + "id": "view-btn-text", + "component": { + "Text": { + "text": { + "literalString": "View Order Details" + } + } + } + }, + { + "id": "view-btn", + "component": { + "Button": { + "child": "view-btn-text", + "action": { + "name": "view_details", + "context": [] + } + } + } + } + ] + } + }, + { + "dataModelUpdate": { + "surfaceId": "gallery-purchase-complete", + "contents": [ + { + "key": "productImage", + "valueString": "https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=100&h=100&fit=crop" + }, + { + "key": "productName", + "valueString": "Wireless Headphones Pro" + }, + { + "key": "price", + "valueString": "$199.99" + }, + { + "key": "deliveryDate", + "valueString": "Arrives Dec 18 - Dec 20" + }, + { + "key": "seller", + "valueString": "TechStore Official" + } + ] + } + }, + { + "beginRendering": { + "surfaceId": "gallery-purchase-complete", + "root": "root" + } + } +] \ No newline at end of file diff --git a/specification/v0_8/json/catalogs/basic/examples/12_chat-message.json b/specification/v0_8/json/catalogs/basic/examples/12_chat-message.json new file mode 100644 index 000000000..cee8a15e6 --- /dev/null +++ b/specification/v0_8/json/catalogs/basic/examples/12_chat-message.json @@ -0,0 +1,317 @@ +[ + { + "surfaceUpdate": { + "surfaceId": "gallery-chat-message", + "components": [ + { + "id": "root", + "component": { + "Card": { + "child": "main-column" + } + } + }, + { + "id": "main-column", + "component": { + "Column": { + "children": { + "explicitList": [ + "header", + "divider", + "messages" + ] + } + } + } + }, + { + "id": "header", + "component": { + "Row": { + "children": { + "explicitList": [ + "channel-icon", + "channel-name" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "channel-icon", + "component": { + "Icon": { + "name": { + "literalString": "info" + } + } + } + }, + { + "id": "channel-name", + "component": { + "Text": { + "text": { + "path": "/channelName" + }, + "usageHint": "h3" + } + } + }, + { + "id": "divider", + "component": { + "Divider": {} + } + }, + { + "id": "messages", + "component": { + "Column": { + "children": { + "explicitList": [ + "message1", + "message2" + ] + }, + "alignment": "start" + } + } + }, + { + "id": "message1", + "component": { + "Row": { + "children": { + "explicitList": [ + "avatar1", + "msg1-content" + ] + }, + "alignment": "start" + } + } + }, + { + "id": "avatar1", + "component": { + "Image": { + "url": { + "path": "/message1/avatar" + }, + "fit": "cover", + "usageHint": "avatar" + } + } + }, + { + "id": "msg1-content", + "component": { + "Column": { + "children": { + "explicitList": [ + "msg1-header", + "msg1-text" + ] + } + } + } + }, + { + "id": "msg1-header", + "component": { + "Row": { + "children": { + "explicitList": [ + "msg1-username", + "msg1-time" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "msg1-username", + "component": { + "Text": { + "text": { + "path": "/message1/username" + }, + "usageHint": "h4" + } + } + }, + { + "id": "msg1-time", + "component": { + "Text": { + "text": { + "path": "/message1/time" + }, + "usageHint": "caption" + } + } + }, + { + "id": "msg1-text", + "component": { + "Text": { + "text": { + "path": "/message1/text" + }, + "usageHint": "body" + } + } + }, + { + "id": "message2", + "component": { + "Row": { + "children": { + "explicitList": [ + "avatar2", + "msg2-content" + ] + }, + "alignment": "start" + } + } + }, + { + "id": "avatar2", + "component": { + "Image": { + "url": { + "path": "/message2/avatar" + }, + "fit": "cover", + "usageHint": "avatar" + } + } + }, + { + "id": "msg2-content", + "component": { + "Column": { + "children": { + "explicitList": [ + "msg2-header", + "msg2-text" + ] + } + } + } + }, + { + "id": "msg2-header", + "component": { + "Row": { + "children": { + "explicitList": [ + "msg2-username", + "msg2-time" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "msg2-username", + "component": { + "Text": { + "text": { + "path": "/message2/username" + }, + "usageHint": "h4" + } + } + }, + { + "id": "msg2-time", + "component": { + "Text": { + "text": { + "path": "/message2/time" + }, + "usageHint": "caption" + } + } + }, + { + "id": "msg2-text", + "component": { + "Text": { + "text": { + "path": "/message2/text" + }, + "usageHint": "body" + } + } + } + ] + } + }, + { + "dataModelUpdate": { + "surfaceId": "gallery-chat-message", + "contents": [ + { + "key": "channelName", + "valueString": "project-updates" + }, + { + "key": "message1", + "valueMap": [ + { + "key": "avatar", + "valueString": "https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=40&h=40&fit=crop" + }, + { + "key": "username", + "valueString": "Mike Chen" + }, + { + "key": "time", + "valueString": "10:32 AM" + }, + { + "key": "text", + "valueString": "Just pushed the new API changes. Ready for review." + } + ] + }, + { + "key": "message2", + "valueMap": [ + { + "key": "avatar", + "valueString": "https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=40&h=40&fit=crop" + }, + { + "key": "username", + "valueString": "Sarah Kim" + }, + { + "key": "time", + "valueString": "10:45 AM" + }, + { + "key": "text", + "valueString": "Great! I'll take a look after standup." + } + ] + } + ] + } + }, + { + "beginRendering": { + "surfaceId": "gallery-chat-message", + "root": "root" + } + } +] \ No newline at end of file diff --git a/specification/v0_8/json/catalogs/basic/examples/13_coffee-order.json b/specification/v0_8/json/catalogs/basic/examples/13_coffee-order.json new file mode 100644 index 000000000..8e7e52284 --- /dev/null +++ b/specification/v0_8/json/catalogs/basic/examples/13_coffee-order.json @@ -0,0 +1,451 @@ +[ + { + "surfaceUpdate": { + "surfaceId": "gallery-coffee-order", + "components": [ + { + "id": "root", + "component": { + "Card": { + "child": "main-column" + } + } + }, + { + "id": "main-column", + "component": { + "Column": { + "children": { + "explicitList": [ + "header", + "items", + "divider", + "totals", + "actions" + ] + } + } + } + }, + { + "id": "header", + "component": { + "Row": { + "children": { + "explicitList": [ + "coffee-icon", + "store-name" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "coffee-icon", + "component": { + "Icon": { + "name": { + "literalString": "favorite" + } + } + } + }, + { + "id": "store-name", + "component": { + "Text": { + "text": { + "path": "/storeName" + }, + "usageHint": "h3" + } + } + }, + { + "id": "items", + "component": { + "Column": { + "children": { + "explicitList": [ + "item1", + "item2" + ] + } + } + } + }, + { + "id": "item1", + "component": { + "Row": { + "children": { + "explicitList": [ + "item1-details", + "item1-price" + ] + }, + "distribution": "spaceBetween", + "alignment": "start" + } + } + }, + { + "id": "item1-details", + "component": { + "Column": { + "children": { + "explicitList": [ + "item1-name", + "item1-size" + ] + } + } + } + }, + { + "id": "item1-name", + "component": { + "Text": { + "text": { + "path": "/item1/name" + }, + "usageHint": "body" + } + } + }, + { + "id": "item1-size", + "component": { + "Text": { + "text": { + "path": "/item1/size" + }, + "usageHint": "caption" + } + } + }, + { + "id": "item1-price", + "component": { + "Text": { + "text": { + "path": "/item1/price" + }, + "usageHint": "body" + } + } + }, + { + "id": "item2", + "component": { + "Row": { + "children": { + "explicitList": [ + "item2-details", + "item2-price" + ] + }, + "distribution": "spaceBetween", + "alignment": "start" + } + } + }, + { + "id": "item2-details", + "component": { + "Column": { + "children": { + "explicitList": [ + "item2-name", + "item2-size" + ] + } + } + } + }, + { + "id": "item2-name", + "component": { + "Text": { + "text": { + "path": "/item2/name" + }, + "usageHint": "body" + } + } + }, + { + "id": "item2-size", + "component": { + "Text": { + "text": { + "path": "/item2/size" + }, + "usageHint": "caption" + } + } + }, + { + "id": "item2-price", + "component": { + "Text": { + "text": { + "path": "/item2/price" + }, + "usageHint": "body" + } + } + }, + { + "id": "divider", + "component": { + "Divider": {} + } + }, + { + "id": "totals", + "component": { + "Column": { + "children": { + "explicitList": [ + "subtotal-row", + "tax-row", + "total-row" + ] + } + } + } + }, + { + "id": "subtotal-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "subtotal-label", + "subtotal-value" + ] + }, + "distribution": "spaceBetween" + } + } + }, + { + "id": "subtotal-label", + "component": { + "Text": { + "text": { + "literalString": "Subtotal" + }, + "usageHint": "caption" + } + } + }, + { + "id": "subtotal-value", + "component": { + "Text": { + "text": { + "path": "/subtotal" + }, + "usageHint": "body" + } + } + }, + { + "id": "tax-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "tax-label", + "tax-value" + ] + }, + "distribution": "spaceBetween" + } + } + }, + { + "id": "tax-label", + "component": { + "Text": { + "text": { + "literalString": "Tax" + }, + "usageHint": "caption" + } + } + }, + { + "id": "tax-value", + "component": { + "Text": { + "text": { + "path": "/tax" + }, + "usageHint": "body" + } + } + }, + { + "id": "total-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "total-label", + "total-value" + ] + }, + "distribution": "spaceBetween" + } + } + }, + { + "id": "total-label", + "component": { + "Text": { + "text": { + "literalString": "Total" + }, + "usageHint": "h4" + } + } + }, + { + "id": "total-value", + "component": { + "Text": { + "text": { + "path": "/total" + }, + "usageHint": "h4" + } + } + }, + { + "id": "actions", + "component": { + "Row": { + "children": { + "explicitList": [ + "purchase-btn", + "add-btn" + ] + } + } + } + }, + { + "id": "purchase-btn-text", + "component": { + "Text": { + "text": { + "literalString": "Purchase" + } + } + } + }, + { + "id": "purchase-btn", + "component": { + "Button": { + "child": "purchase-btn-text", + "action": { + "name": "purchase", + "context": [] + } + } + } + }, + { + "id": "add-btn-text", + "component": { + "Text": { + "text": { + "literalString": "Add to cart" + } + } + } + }, + { + "id": "add-btn", + "component": { + "Button": { + "child": "add-btn-text", + "action": { + "name": "add_to_cart", + "context": [] + } + } + } + } + ] + } + }, + { + "dataModelUpdate": { + "surfaceId": "gallery-coffee-order", + "contents": [ + { + "key": "storeName", + "valueString": "Sunrise Coffee" + }, + { + "key": "item1", + "valueMap": [ + { + "key": "name", + "valueString": "Oat Milk Latte" + }, + { + "key": "size", + "valueString": "Grande, Extra Shot" + }, + { + "key": "price", + "valueString": "$6.45" + } + ] + }, + { + "key": "item2", + "valueMap": [ + { + "key": "name", + "valueString": "Chocolate Croissant" + }, + { + "key": "size", + "valueString": "Warmed" + }, + { + "key": "price", + "valueString": "$4.25" + } + ] + }, + { + "key": "subtotal", + "valueString": "$10.70" + }, + { + "key": "tax", + "valueString": "$0.96" + }, + { + "key": "total", + "valueString": "$11.66" + } + ] + } + }, + { + "beginRendering": { + "surfaceId": "gallery-coffee-order", + "root": "root" + } + } +] \ No newline at end of file diff --git a/specification/v0_8/json/catalogs/basic/examples/14_sports-player.json b/specification/v0_8/json/catalogs/basic/examples/14_sports-player.json new file mode 100644 index 000000000..7de840112 --- /dev/null +++ b/specification/v0_8/json/catalogs/basic/examples/14_sports-player.json @@ -0,0 +1,302 @@ +[ + { + "surfaceUpdate": { + "surfaceId": "gallery-sports-player", + "components": [ + { + "id": "root", + "component": { + "Card": { + "child": "main-column" + } + } + }, + { + "id": "main-column", + "component": { + "Column": { + "children": { + "explicitList": [ + "player-image", + "player-info", + "divider", + "stats-row" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "player-image", + "component": { + "Image": { + "url": { + "path": "/playerImage" + }, + "fit": "cover" + } + } + }, + { + "id": "player-info", + "component": { + "Column": { + "children": { + "explicitList": [ + "player-name", + "player-details" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "player-name", + "component": { + "Text": { + "text": { + "path": "/playerName" + }, + "usageHint": "h2" + } + } + }, + { + "id": "player-details", + "component": { + "Row": { + "children": { + "explicitList": [ + "player-number", + "player-team" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "player-number", + "component": { + "Text": { + "text": { + "path": "/number" + }, + "usageHint": "h3" + } + } + }, + { + "id": "player-team", + "component": { + "Text": { + "text": { + "path": "/team" + }, + "usageHint": "caption" + } + } + }, + { + "id": "divider", + "component": { + "Divider": {} + } + }, + { + "id": "stats-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "stat1", + "stat2", + "stat3" + ] + }, + "distribution": "spaceAround" + } + } + }, + { + "id": "stat1", + "component": { + "Column": { + "children": { + "explicitList": [ + "stat1-value", + "stat1-label" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "stat1-value", + "component": { + "Text": { + "text": { + "path": "/stat1/value" + }, + "usageHint": "h3" + } + } + }, + { + "id": "stat1-label", + "component": { + "Text": { + "text": { + "path": "/stat1/label" + }, + "usageHint": "caption" + } + } + }, + { + "id": "stat2", + "component": { + "Column": { + "children": { + "explicitList": [ + "stat2-value", + "stat2-label" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "stat2-value", + "component": { + "Text": { + "text": { + "path": "/stat2/value" + }, + "usageHint": "h3" + } + } + }, + { + "id": "stat2-label", + "component": { + "Text": { + "text": { + "path": "/stat2/label" + }, + "usageHint": "caption" + } + } + }, + { + "id": "stat3", + "component": { + "Column": { + "children": { + "explicitList": [ + "stat3-value", + "stat3-label" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "stat3-value", + "component": { + "Text": { + "text": { + "path": "/stat3/value" + }, + "usageHint": "h3" + } + } + }, + { + "id": "stat3-label", + "component": { + "Text": { + "text": { + "path": "/stat3/label" + }, + "usageHint": "caption" + } + } + } + ] + } + }, + { + "dataModelUpdate": { + "surfaceId": "gallery-sports-player", + "contents": [ + { + "key": "playerImage", + "valueString": "https://images.unsplash.com/photo-1546519638-68e109498ffc?w=200&h=200&fit=crop" + }, + { + "key": "playerName", + "valueString": "Marcus Johnson" + }, + { + "key": "number", + "valueString": "#23" + }, + { + "key": "team", + "valueString": "LA Lakers" + }, + { + "key": "stat1", + "valueMap": [ + { + "key": "value", + "valueString": "28.4" + }, + { + "key": "label", + "valueString": "PPG" + } + ] + }, + { + "key": "stat2", + "valueMap": [ + { + "key": "value", + "valueString": "7.2" + }, + { + "key": "label", + "valueString": "RPG" + } + ] + }, + { + "key": "stat3", + "valueMap": [ + { + "key": "value", + "valueString": "6.8" + }, + { + "key": "label", + "valueString": "APG" + } + ] + } + ] + } + }, + { + "beginRendering": { + "surfaceId": "gallery-sports-player", + "root": "root" + } + } +] \ No newline at end of file diff --git a/specification/v0_8/json/catalogs/basic/examples/15_account-balance.json b/specification/v0_8/json/catalogs/basic/examples/15_account-balance.json new file mode 100644 index 000000000..efce32910 --- /dev/null +++ b/specification/v0_8/json/catalogs/basic/examples/15_account-balance.json @@ -0,0 +1,178 @@ +[ + { + "surfaceUpdate": { + "surfaceId": "gallery-account-balance", + "components": [ + { + "id": "root", + "component": { + "Card": { + "child": "main-column" + } + } + }, + { + "id": "main-column", + "component": { + "Column": { + "children": { + "explicitList": [ + "header", + "balance", + "updated", + "divider", + "actions" + ] + } + } + } + }, + { + "id": "header", + "component": { + "Row": { + "children": { + "explicitList": [ + "account-icon", + "account-name" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "account-icon", + "component": { + "Icon": { + "name": { + "literalString": "payment" + } + } + } + }, + { + "id": "account-name", + "component": { + "Text": { + "text": { + "path": "/accountName" + }, + "usageHint": "h4" + } + } + }, + { + "id": "balance", + "component": { + "Text": { + "text": { + "path": "/balance" + }, + "usageHint": "h1" + } + } + }, + { + "id": "updated", + "component": { + "Text": { + "text": { + "path": "/lastUpdated" + }, + "usageHint": "caption" + } + } + }, + { + "id": "divider", + "component": { + "Divider": {} + } + }, + { + "id": "actions", + "component": { + "Row": { + "children": { + "explicitList": [ + "transfer-btn", + "pay-btn" + ] + } + } + } + }, + { + "id": "transfer-btn-text", + "component": { + "Text": { + "text": { + "literalString": "Transfer" + } + } + } + }, + { + "id": "transfer-btn", + "component": { + "Button": { + "child": "transfer-btn-text", + "action": { + "name": "transfer", + "context": [] + } + } + } + }, + { + "id": "pay-btn-text", + "component": { + "Text": { + "text": { + "literalString": "Pay Bill" + } + } + } + }, + { + "id": "pay-btn", + "component": { + "Button": { + "child": "pay-btn-text", + "action": { + "name": "pay_bill", + "context": [] + } + } + } + } + ] + } + }, + { + "dataModelUpdate": { + "surfaceId": "gallery-account-balance", + "contents": [ + { + "key": "accountName", + "valueString": "Primary Checking" + }, + { + "key": "balance", + "valueString": "$12,458.32" + }, + { + "key": "lastUpdated", + "valueString": "Updated just now" + } + ] + } + }, + { + "beginRendering": { + "surfaceId": "gallery-account-balance", + "root": "root" + } + } +] \ No newline at end of file diff --git a/specification/v0_8/json/catalogs/basic/examples/16_workout-summary.json b/specification/v0_8/json/catalogs/basic/examples/16_workout-summary.json new file mode 100644 index 000000000..f5ef61493 --- /dev/null +++ b/specification/v0_8/json/catalogs/basic/examples/16_workout-summary.json @@ -0,0 +1,244 @@ +[ + { + "surfaceUpdate": { + "surfaceId": "gallery-workout-summary", + "components": [ + { + "id": "root", + "component": { + "Card": { + "child": "main-column" + } + } + }, + { + "id": "main-column", + "component": { + "Column": { + "children": { + "explicitList": [ + "header", + "divider", + "metrics-row", + "date" + ] + } + } + } + }, + { + "id": "header", + "component": { + "Row": { + "children": { + "explicitList": [ + "workout-icon", + "title" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "workout-icon", + "component": { + "Icon": { + "name": { + "path": "/icon" + } + } + } + }, + { + "id": "title", + "component": { + "Text": { + "text": { + "literalString": "Workout Complete" + }, + "usageHint": "h3" + } + } + }, + { + "id": "divider", + "component": { + "Divider": {} + } + }, + { + "id": "metrics-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "duration-col", + "calories-col", + "distance-col" + ] + }, + "distribution": "spaceAround" + } + } + }, + { + "id": "duration-col", + "component": { + "Column": { + "children": { + "explicitList": [ + "duration-value", + "duration-label" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "duration-value", + "component": { + "Text": { + "text": { + "path": "/duration" + }, + "usageHint": "h3" + } + } + }, + { + "id": "duration-label", + "component": { + "Text": { + "text": { + "literalString": "Duration" + }, + "usageHint": "caption" + } + } + }, + { + "id": "calories-col", + "component": { + "Column": { + "children": { + "explicitList": [ + "calories-value", + "calories-label" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "calories-value", + "component": { + "Text": { + "text": { + "path": "/calories" + }, + "usageHint": "h3" + } + } + }, + { + "id": "calories-label", + "component": { + "Text": { + "text": { + "literalString": "Calories" + }, + "usageHint": "caption" + } + } + }, + { + "id": "distance-col", + "component": { + "Column": { + "children": { + "explicitList": [ + "distance-value", + "distance-label" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "distance-value", + "component": { + "Text": { + "text": { + "path": "/distance" + }, + "usageHint": "h3" + } + } + }, + { + "id": "distance-label", + "component": { + "Text": { + "text": { + "literalString": "Distance" + }, + "usageHint": "caption" + } + } + }, + { + "id": "date", + "component": { + "Text": { + "text": { + "path": "/date" + }, + "usageHint": "caption" + } + } + } + ] + } + }, + { + "dataModelUpdate": { + "surfaceId": "gallery-workout-summary", + "contents": [ + { + "key": "icon", + "valueString": "directions_run" + }, + { + "key": "workoutType", + "valueString": "Morning Run" + }, + { + "key": "duration", + "valueString": "32:15" + }, + { + "key": "calories", + "valueString": "385" + }, + { + "key": "distance", + "valueString": "5.2 km" + }, + { + "key": "date", + "valueString": "Today at 7:30 AM" + } + ] + } + }, + { + "beginRendering": { + "surfaceId": "gallery-workout-summary", + "root": "root" + } + } +] \ No newline at end of file diff --git a/specification/v0_8/json/catalogs/basic/examples/17_event-detail.json b/specification/v0_8/json/catalogs/basic/examples/17_event-detail.json new file mode 100644 index 000000000..bfbbd44a9 --- /dev/null +++ b/specification/v0_8/json/catalogs/basic/examples/17_event-detail.json @@ -0,0 +1,218 @@ +[ + { + "surfaceUpdate": { + "surfaceId": "gallery-event-detail", + "components": [ + { + "id": "root", + "component": { + "Card": { + "child": "main-column" + } + } + }, + { + "id": "main-column", + "component": { + "Column": { + "children": { + "explicitList": [ + "title", + "time-row", + "location-row", + "description", + "divider", + "actions" + ] + } + } + } + }, + { + "id": "title", + "component": { + "Text": { + "text": { + "path": "/title" + }, + "usageHint": "h2" + } + } + }, + { + "id": "time-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "time-icon", + "time-text" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "time-icon", + "component": { + "Icon": { + "name": { + "literalString": "calendarToday" + } + } + } + }, + { + "id": "time-text", + "component": { + "Text": { + "text": { + "path": "/dateTime" + }, + "usageHint": "body" + } + } + }, + { + "id": "location-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "location-icon", + "location-text" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "location-icon", + "component": { + "Icon": { + "name": { + "literalString": "locationOn" + } + } + } + }, + { + "id": "location-text", + "component": { + "Text": { + "text": { + "path": "/location" + }, + "usageHint": "body" + } + } + }, + { + "id": "description", + "component": { + "Text": { + "text": { + "path": "/description" + }, + "usageHint": "body" + } + } + }, + { + "id": "divider", + "component": { + "Divider": {} + } + }, + { + "id": "actions", + "component": { + "Row": { + "children": { + "explicitList": [ + "accept-btn", + "decline-btn" + ] + } + } + } + }, + { + "id": "accept-btn-text", + "component": { + "Text": { + "text": { + "literalString": "Accept" + } + } + } + }, + { + "id": "accept-btn", + "component": { + "Button": { + "child": "accept-btn-text", + "action": { + "name": "accept", + "context": [] + } + } + } + }, + { + "id": "decline-btn-text", + "component": { + "Text": { + "text": { + "literalString": "Decline" + } + } + } + }, + { + "id": "decline-btn", + "component": { + "Button": { + "child": "decline-btn-text", + "action": { + "name": "decline", + "context": [] + } + } + } + } + ] + } + }, + { + "dataModelUpdate": { + "surfaceId": "gallery-event-detail", + "contents": [ + { + "key": "title", + "valueString": "Product Launch Meeting" + }, + { + "key": "dateTime", + "valueString": "Thu, Dec 19 \u2022 2:00 PM - 3:30 PM" + }, + { + "key": "location", + "valueString": "Conference Room A, Building 2" + }, + { + "key": "description", + "valueString": "Review final product specs and marketing materials before the Q1 launch." + } + ] + } + }, + { + "beginRendering": { + "surfaceId": "gallery-event-detail", + "root": "root" + } + } +] \ No newline at end of file diff --git a/specification/v0_8/json/catalogs/basic/examples/18_track-list.json b/specification/v0_8/json/catalogs/basic/examples/18_track-list.json new file mode 100644 index 000000000..189996536 --- /dev/null +++ b/specification/v0_8/json/catalogs/basic/examples/18_track-list.json @@ -0,0 +1,418 @@ +[ + { + "surfaceUpdate": { + "surfaceId": "gallery-track-list", + "components": [ + { + "id": "root", + "component": { + "Card": { + "child": "main-column" + } + } + }, + { + "id": "main-column", + "component": { + "Column": { + "children": { + "explicitList": [ + "header", + "divider", + "tracks" + ] + } + } + } + }, + { + "id": "header", + "component": { + "Row": { + "children": { + "explicitList": [ + "playlist-icon", + "playlist-name" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "playlist-icon", + "component": { + "Icon": { + "name": { + "literalString": "play" + } + } + } + }, + { + "id": "playlist-name", + "component": { + "Text": { + "text": { + "path": "/playlistName" + }, + "usageHint": "h3" + } + } + }, + { + "id": "divider", + "component": { + "Divider": {} + } + }, + { + "id": "tracks", + "component": { + "Column": { + "children": { + "explicitList": [ + "track1", + "track2", + "track3" + ] + } + } + } + }, + { + "id": "track1", + "component": { + "Row": { + "children": { + "explicitList": [ + "track1-num", + "track1-art", + "track1-info", + "track1-duration" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "track1-num", + "component": { + "Text": { + "text": { + "literalString": "1" + }, + "usageHint": "caption" + } + } + }, + { + "id": "track1-art", + "component": { + "Image": { + "url": { + "path": "/track1/art" + }, + "fit": "cover" + } + } + }, + { + "id": "track1-info", + "component": { + "Column": { + "children": { + "explicitList": [ + "track1-title", + "track1-artist" + ] + } + } + } + }, + { + "id": "track1-title", + "component": { + "Text": { + "text": { + "path": "/track1/title" + }, + "usageHint": "body" + } + } + }, + { + "id": "track1-artist", + "component": { + "Text": { + "text": { + "path": "/track1/artist" + }, + "usageHint": "caption" + } + } + }, + { + "id": "track1-duration", + "component": { + "Text": { + "text": { + "path": "/track1/duration" + }, + "usageHint": "caption" + } + } + }, + { + "id": "track2", + "component": { + "Row": { + "children": { + "explicitList": [ + "track2-num", + "track2-art", + "track2-info", + "track2-duration" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "track2-num", + "component": { + "Text": { + "text": { + "literalString": "2" + }, + "usageHint": "caption" + } + } + }, + { + "id": "track2-art", + "component": { + "Image": { + "url": { + "path": "/track2/art" + }, + "fit": "cover" + } + } + }, + { + "id": "track2-info", + "component": { + "Column": { + "children": { + "explicitList": [ + "track2-title", + "track2-artist" + ] + } + } + } + }, + { + "id": "track2-title", + "component": { + "Text": { + "text": { + "path": "/track2/title" + }, + "usageHint": "body" + } + } + }, + { + "id": "track2-artist", + "component": { + "Text": { + "text": { + "path": "/track2/artist" + }, + "usageHint": "caption" + } + } + }, + { + "id": "track2-duration", + "component": { + "Text": { + "text": { + "path": "/track2/duration" + }, + "usageHint": "caption" + } + } + }, + { + "id": "track3", + "component": { + "Row": { + "children": { + "explicitList": [ + "track3-num", + "track3-art", + "track3-info", + "track3-duration" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "track3-num", + "component": { + "Text": { + "text": { + "literalString": "3" + }, + "usageHint": "caption" + } + } + }, + { + "id": "track3-art", + "component": { + "Image": { + "url": { + "path": "/track3/art" + }, + "fit": "cover" + } + } + }, + { + "id": "track3-info", + "component": { + "Column": { + "children": { + "explicitList": [ + "track3-title", + "track3-artist" + ] + } + } + } + }, + { + "id": "track3-title", + "component": { + "Text": { + "text": { + "path": "/track3/title" + }, + "usageHint": "body" + } + } + }, + { + "id": "track3-artist", + "component": { + "Text": { + "text": { + "path": "/track3/artist" + }, + "usageHint": "caption" + } + } + }, + { + "id": "track3-duration", + "component": { + "Text": { + "text": { + "path": "/track3/duration" + }, + "usageHint": "caption" + } + } + } + ] + } + }, + { + "dataModelUpdate": { + "surfaceId": "gallery-track-list", + "contents": [ + { + "key": "playlistName", + "valueString": "Focus Flow" + }, + { + "key": "track1", + "valueMap": [ + { + "key": "art", + "valueString": "https://images.unsplash.com/photo-1470225620780-dba8ba36b745?w=50&h=50&fit=crop" + }, + { + "key": "title", + "valueString": "Weightless" + }, + { + "key": "artist", + "valueString": "Marconi Union" + }, + { + "key": "duration", + "valueString": "8:09" + } + ] + }, + { + "key": "track2", + "valueMap": [ + { + "key": "art", + "valueString": "https://images.unsplash.com/photo-1511379938547-c1f69419868d?w=50&h=50&fit=crop" + }, + { + "key": "title", + "valueString": "Clair de Lune" + }, + { + "key": "artist", + "valueString": "Debussy" + }, + { + "key": "duration", + "valueString": "5:12" + } + ] + }, + { + "key": "track3", + "valueMap": [ + { + "key": "art", + "valueString": "https://images.unsplash.com/photo-1507838153414-b4b713384a76?w=50&h=50&fit=crop" + }, + { + "key": "title", + "valueString": "Ambient Light" + }, + { + "key": "artist", + "valueString": "Brian Eno" + }, + { + "key": "duration", + "valueString": "6:45" + } + ] + } + ] + } + }, + { + "beginRendering": { + "surfaceId": "gallery-track-list", + "root": "root" + } + } +] \ No newline at end of file diff --git a/specification/v0_8/json/catalogs/basic/examples/19_software-purchase.json b/specification/v0_8/json/catalogs/basic/examples/19_software-purchase.json new file mode 100644 index 000000000..fbac53abf --- /dev/null +++ b/specification/v0_8/json/catalogs/basic/examples/19_software-purchase.json @@ -0,0 +1,279 @@ +[ + { + "surfaceUpdate": { + "surfaceId": "gallery-software-purchase", + "components": [ + { + "id": "root", + "component": { + "Card": { + "child": "main-column" + } + } + }, + { + "id": "main-column", + "component": { + "Column": { + "children": { + "explicitList": [ + "title", + "product-name", + "divider1", + "options", + "divider2", + "total-row", + "actions" + ] + } + } + } + }, + { + "id": "title", + "component": { + "Text": { + "text": { + "literalString": "Purchase License" + }, + "usageHint": "h3" + } + } + }, + { + "id": "product-name", + "component": { + "Text": { + "text": { + "path": "/productName" + }, + "usageHint": "h2" + } + } + }, + { + "id": "divider1", + "component": { + "Divider": {} + } + }, + { + "id": "options", + "component": { + "Column": { + "children": { + "explicitList": [ + "seats-row", + "period-row" + ] + } + } + } + }, + { + "id": "seats-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "seats-label", + "seats-value" + ] + }, + "distribution": "spaceBetween", + "alignment": "center" + } + } + }, + { + "id": "seats-label", + "component": { + "Text": { + "text": { + "literalString": "Number of seats" + }, + "usageHint": "body" + } + } + }, + { + "id": "seats-value", + "component": { + "Text": { + "text": { + "path": "/seats" + }, + "usageHint": "h4" + } + } + }, + { + "id": "period-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "period-label", + "period-value" + ] + }, + "distribution": "spaceBetween", + "alignment": "center" + } + } + }, + { + "id": "period-label", + "component": { + "Text": { + "text": { + "literalString": "Billing period" + }, + "usageHint": "body" + } + } + }, + { + "id": "period-value", + "component": { + "Text": { + "text": { + "path": "/billingPeriod" + }, + "usageHint": "h4" + } + } + }, + { + "id": "divider2", + "component": { + "Divider": {} + } + }, + { + "id": "total-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "total-label", + "total-value" + ] + }, + "distribution": "spaceBetween", + "alignment": "center" + } + } + }, + { + "id": "total-label", + "component": { + "Text": { + "text": { + "literalString": "Total" + }, + "usageHint": "h4" + } + } + }, + { + "id": "total-value", + "component": { + "Text": { + "text": { + "path": "/total" + }, + "usageHint": "h2" + } + } + }, + { + "id": "actions", + "component": { + "Row": { + "children": { + "explicitList": [ + "confirm-btn", + "cancel-btn" + ] + } + } + } + }, + { + "id": "confirm-btn-text", + "component": { + "Text": { + "text": { + "literalString": "Confirm Purchase" + } + } + } + }, + { + "id": "confirm-btn", + "component": { + "Button": { + "child": "confirm-btn-text", + "action": { + "name": "confirm", + "context": [] + } + } + } + }, + { + "id": "cancel-btn-text", + "component": { + "Text": { + "text": { + "literalString": "Cancel" + } + } + } + }, + { + "id": "cancel-btn", + "component": { + "Button": { + "child": "cancel-btn-text", + "action": { + "name": "cancel", + "context": [] + } + } + } + } + ] + } + }, + { + "dataModelUpdate": { + "surfaceId": "gallery-software-purchase", + "contents": [ + { + "key": "productName", + "valueString": "Design Suite Pro" + }, + { + "key": "seats", + "valueString": "10 seats" + }, + { + "key": "billingPeriod", + "valueString": "Annual" + }, + { + "key": "total", + "valueString": "$1,188/year" + } + ] + } + }, + { + "beginRendering": { + "surfaceId": "gallery-software-purchase", + "root": "root" + } + } +] \ No newline at end of file diff --git a/specification/v0_8/json/catalogs/basic/examples/20_restaurant-card.json b/specification/v0_8/json/catalogs/basic/examples/20_restaurant-card.json new file mode 100644 index 000000000..cdea1d545 --- /dev/null +++ b/specification/v0_8/json/catalogs/basic/examples/20_restaurant-card.json @@ -0,0 +1,231 @@ +[ + { + "surfaceUpdate": { + "surfaceId": "gallery-restaurant-card", + "components": [ + { + "id": "root", + "component": { + "Card": { + "child": "main-column" + } + } + }, + { + "id": "main-column", + "component": { + "Column": { + "children": { + "explicitList": [ + "restaurant-image", + "content" + ] + } + } + } + }, + { + "id": "restaurant-image", + "component": { + "Image": { + "url": { + "path": "/image" + }, + "fit": "cover" + } + } + }, + { + "id": "content", + "component": { + "Column": { + "children": { + "explicitList": [ + "name-row", + "cuisine", + "rating-row", + "details-row" + ] + } + } + } + }, + { + "id": "name-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "restaurant-name", + "price-range" + ] + }, + "distribution": "spaceBetween", + "alignment": "center" + } + } + }, + { + "id": "restaurant-name", + "component": { + "Text": { + "text": { + "path": "/name" + }, + "usageHint": "h3" + } + } + }, + { + "id": "price-range", + "component": { + "Text": { + "text": { + "path": "/priceRange" + }, + "usageHint": "body" + } + } + }, + { + "id": "cuisine", + "component": { + "Text": { + "text": { + "path": "/cuisine" + }, + "usageHint": "caption" + } + } + }, + { + "id": "rating-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "star-icon", + "rating", + "reviews" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "star-icon", + "component": { + "Icon": { + "name": { + "literalString": "star" + } + } + } + }, + { + "id": "rating", + "component": { + "Text": { + "text": { + "path": "/rating" + }, + "usageHint": "body" + } + } + }, + { + "id": "reviews", + "component": { + "Text": { + "text": { + "path": "/reviewCount" + }, + "usageHint": "caption" + } + } + }, + { + "id": "details-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "distance", + "delivery-time" + ] + } + } + } + }, + { + "id": "distance", + "component": { + "Text": { + "text": { + "path": "/distance" + }, + "usageHint": "caption" + } + } + }, + { + "id": "delivery-time", + "component": { + "Text": { + "text": { + "path": "/deliveryTime" + }, + "usageHint": "caption" + } + } + } + ] + } + }, + { + "dataModelUpdate": { + "surfaceId": "gallery-restaurant-card", + "contents": [ + { + "key": "image", + "valueString": "https://images.unsplash.com/photo-1517248135467-4c7edcad34c4?w=300&h=150&fit=crop" + }, + { + "key": "name", + "valueString": "The Italian Kitchen" + }, + { + "key": "priceRange", + "valueString": "$$$" + }, + { + "key": "cuisine", + "valueString": "Italian \u2022 Pasta \u2022 Wine Bar" + }, + { + "key": "rating", + "valueString": "4.8" + }, + { + "key": "reviewCount", + "valueString": "(2,847 reviews)" + }, + { + "key": "distance", + "valueString": "0.8 mi" + }, + { + "key": "deliveryTime", + "valueString": "25-35 min" + } + ] + } + }, + { + "beginRendering": { + "surfaceId": "gallery-restaurant-card", + "root": "root" + } + } +] \ No newline at end of file diff --git a/specification/v0_8/json/catalogs/basic/examples/21_shipping-status.json b/specification/v0_8/json/catalogs/basic/examples/21_shipping-status.json new file mode 100644 index 000000000..f14890228 --- /dev/null +++ b/specification/v0_8/json/catalogs/basic/examples/21_shipping-status.json @@ -0,0 +1,300 @@ +[ + { + "surfaceUpdate": { + "surfaceId": "gallery-shipping-status", + "components": [ + { + "id": "root", + "component": { + "Card": { + "child": "main-column" + } + } + }, + { + "id": "main-column", + "component": { + "Column": { + "children": { + "explicitList": [ + "header", + "tracking-number", + "divider", + "steps", + "eta" + ] + } + } + } + }, + { + "id": "header", + "component": { + "Row": { + "children": { + "explicitList": [ + "package-icon", + "title" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "package-icon", + "component": { + "Icon": { + "name": { + "literalString": "info" + } + } + } + }, + { + "id": "title", + "component": { + "Text": { + "text": { + "literalString": "Package Status" + }, + "usageHint": "h3" + } + } + }, + { + "id": "tracking-number", + "component": { + "Text": { + "text": { + "path": "/trackingNumber" + }, + "usageHint": "caption" + } + } + }, + { + "id": "divider", + "component": { + "Divider": {} + } + }, + { + "id": "steps", + "component": { + "Column": { + "children": { + "explicitList": [ + "step1", + "step2", + "step3", + "step4" + ] + } + } + } + }, + { + "id": "step1", + "component": { + "Row": { + "children": { + "explicitList": [ + "step1-icon", + "step1-text" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "step1-icon", + "component": { + "Icon": { + "name": { + "literalString": "check" + } + } + } + }, + { + "id": "step1-text", + "component": { + "Text": { + "text": { + "literalString": "Order Placed" + }, + "usageHint": "body" + } + } + }, + { + "id": "step2", + "component": { + "Row": { + "children": { + "explicitList": [ + "step2-icon", + "step2-text" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "step2-icon", + "component": { + "Icon": { + "name": { + "literalString": "check" + } + } + } + }, + { + "id": "step2-text", + "component": { + "Text": { + "text": { + "literalString": "Shipped" + }, + "usageHint": "body" + } + } + }, + { + "id": "step3", + "component": { + "Row": { + "children": { + "explicitList": [ + "step3-icon", + "step3-text" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "step3-icon", + "component": { + "Icon": { + "name": { + "path": "/currentStepIcon" + } + } + } + }, + { + "id": "step3-text", + "component": { + "Text": { + "text": { + "literalString": "Out for Delivery" + }, + "usageHint": "h4" + } + } + }, + { + "id": "step4", + "component": { + "Row": { + "children": { + "explicitList": [ + "step4-icon", + "step4-text" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "step4-icon", + "component": { + "Icon": { + "name": { + "literalString": "circle" + } + } + } + }, + { + "id": "step4-text", + "component": { + "Text": { + "text": { + "literalString": "Delivered" + }, + "usageHint": "caption" + } + } + }, + { + "id": "eta", + "component": { + "Row": { + "children": { + "explicitList": [ + "eta-icon", + "eta-text" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "eta-icon", + "component": { + "Icon": { + "name": { + "literalString": "calendarToday" + } + } + } + }, + { + "id": "eta-text", + "component": { + "Text": { + "text": { + "path": "/eta" + }, + "usageHint": "body" + } + } + } + ] + } + }, + { + "dataModelUpdate": { + "surfaceId": "gallery-shipping-status", + "contents": [ + { + "key": "trackingNumber", + "valueString": "Tracking: 1Z999AA10123456784" + }, + { + "key": "currentStepIcon", + "valueString": "local_shipping" + }, + { + "key": "eta", + "valueString": "Estimated delivery: Today by 8 PM" + } + ] + } + }, + { + "beginRendering": { + "surfaceId": "gallery-shipping-status", + "root": "root" + } + } +] \ No newline at end of file diff --git a/specification/v0_8/json/catalogs/basic/examples/22_credit-card.json b/specification/v0_8/json/catalogs/basic/examples/22_credit-card.json new file mode 100644 index 000000000..46607f306 --- /dev/null +++ b/specification/v0_8/json/catalogs/basic/examples/22_credit-card.json @@ -0,0 +1,192 @@ +[ + { + "surfaceUpdate": { + "surfaceId": "gallery-credit-card", + "components": [ + { + "id": "root", + "component": { + "Card": { + "child": "main-column" + } + } + }, + { + "id": "main-column", + "component": { + "Column": { + "children": { + "explicitList": [ + "card-type-row", + "card-number", + "card-details" + ] + } + } + } + }, + { + "id": "card-type-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "card-icon", + "card-type" + ] + }, + "distribution": "spaceBetween", + "alignment": "center" + } + } + }, + { + "id": "card-icon", + "component": { + "Icon": { + "name": { + "literalString": "payment" + } + } + } + }, + { + "id": "card-type", + "component": { + "Text": { + "text": { + "path": "/cardType" + }, + "usageHint": "h4" + } + } + }, + { + "id": "card-number", + "component": { + "Text": { + "text": { + "path": "/cardNumber" + }, + "usageHint": "h2" + } + } + }, + { + "id": "card-details", + "component": { + "Row": { + "children": { + "explicitList": [ + "holder-col", + "expiry-col" + ] + }, + "distribution": "spaceBetween" + } + } + }, + { + "id": "holder-col", + "component": { + "Column": { + "children": { + "explicitList": [ + "holder-label", + "holder-name" + ] + } + } + } + }, + { + "id": "holder-label", + "component": { + "Text": { + "text": { + "literalString": "CARD HOLDER" + }, + "usageHint": "caption" + } + } + }, + { + "id": "holder-name", + "component": { + "Text": { + "text": { + "path": "/holderName" + }, + "usageHint": "body" + } + } + }, + { + "id": "expiry-col", + "component": { + "Column": { + "children": { + "explicitList": [ + "expiry-label", + "expiry-date" + ] + }, + "alignment": "end" + } + } + }, + { + "id": "expiry-label", + "component": { + "Text": { + "text": { + "literalString": "EXPIRES" + }, + "usageHint": "caption" + } + } + }, + { + "id": "expiry-date", + "component": { + "Text": { + "text": { + "path": "/expiryDate" + }, + "usageHint": "body" + } + } + } + ] + } + }, + { + "dataModelUpdate": { + "surfaceId": "gallery-credit-card", + "contents": [ + { + "key": "cardType", + "valueString": "VISA" + }, + { + "key": "cardNumber", + "valueString": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242" + }, + { + "key": "holderName", + "valueString": "SARAH JOHNSON" + }, + { + "key": "expiryDate", + "valueString": "09/27" + } + ] + } + }, + { + "beginRendering": { + "surfaceId": "gallery-credit-card", + "root": "root" + } + } +] \ No newline at end of file diff --git a/specification/v0_8/json/catalogs/basic/examples/23_step-counter.json b/specification/v0_8/json/catalogs/basic/examples/23_step-counter.json new file mode 100644 index 000000000..d88ab6565 --- /dev/null +++ b/specification/v0_8/json/catalogs/basic/examples/23_step-counter.json @@ -0,0 +1,212 @@ +[ + { + "surfaceUpdate": { + "surfaceId": "gallery-step-counter", + "components": [ + { + "id": "root", + "component": { + "Card": { + "child": "main-column" + } + } + }, + { + "id": "main-column", + "component": { + "Column": { + "children": { + "explicitList": [ + "header", + "steps-display", + "goal-text", + "divider", + "stats-row" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "header", + "component": { + "Row": { + "children": { + "explicitList": [ + "steps-icon", + "title" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "steps-icon", + "component": { + "Icon": { + "name": { + "literalString": "person" + } + } + } + }, + { + "id": "title", + "component": { + "Text": { + "text": { + "literalString": "Today's Steps" + }, + "usageHint": "h4" + } + } + }, + { + "id": "steps-display", + "component": { + "Text": { + "text": { + "path": "/steps" + }, + "usageHint": "h1" + } + } + }, + { + "id": "goal-text", + "component": { + "Text": { + "text": { + "path": "/goalProgress" + }, + "usageHint": "body" + } + } + }, + { + "id": "divider", + "component": { + "Divider": {} + } + }, + { + "id": "stats-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "distance-col", + "calories-col" + ] + }, + "distribution": "spaceAround" + } + } + }, + { + "id": "distance-col", + "component": { + "Column": { + "children": { + "explicitList": [ + "distance-value", + "distance-label" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "distance-value", + "component": { + "Text": { + "text": { + "path": "/distance" + }, + "usageHint": "h3" + } + } + }, + { + "id": "distance-label", + "component": { + "Text": { + "text": { + "literalString": "Distance" + }, + "usageHint": "caption" + } + } + }, + { + "id": "calories-col", + "component": { + "Column": { + "children": { + "explicitList": [ + "calories-value", + "calories-label" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "calories-value", + "component": { + "Text": { + "text": { + "path": "/calories" + }, + "usageHint": "h3" + } + } + }, + { + "id": "calories-label", + "component": { + "Text": { + "text": { + "literalString": "Calories" + }, + "usageHint": "caption" + } + } + } + ] + } + }, + { + "dataModelUpdate": { + "surfaceId": "gallery-step-counter", + "contents": [ + { + "key": "steps", + "valueString": "8,432" + }, + { + "key": "goalProgress", + "valueString": "84% of 10,000 goal" + }, + { + "key": "distance", + "valueString": "3.8 mi" + }, + { + "key": "calories", + "valueString": "312" + } + ] + } + }, + { + "beginRendering": { + "surfaceId": "gallery-step-counter", + "root": "root" + } + } +] \ No newline at end of file diff --git a/specification/v0_8/json/catalogs/basic/examples/24_recipe-card.json b/specification/v0_8/json/catalogs/basic/examples/24_recipe-card.json new file mode 100644 index 000000000..a14b1a214 --- /dev/null +++ b/specification/v0_8/json/catalogs/basic/examples/24_recipe-card.json @@ -0,0 +1,249 @@ +[ + { + "surfaceUpdate": { + "surfaceId": "gallery-recipe-card", + "components": [ + { + "id": "root", + "component": { + "Card": { + "child": "main-column" + } + } + }, + { + "id": "main-column", + "component": { + "Column": { + "children": { + "explicitList": [ + "recipe-image", + "content" + ] + } + } + } + }, + { + "id": "recipe-image", + "component": { + "Image": { + "url": { + "path": "/image" + }, + "fit": "cover" + } + } + }, + { + "id": "content", + "component": { + "Column": { + "children": { + "explicitList": [ + "title", + "rating-row", + "times-row", + "servings" + ] + } + } + } + }, + { + "id": "title", + "component": { + "Text": { + "text": { + "path": "/title" + }, + "usageHint": "h3" + } + } + }, + { + "id": "rating-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "star-icon", + "rating", + "review-count" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "star-icon", + "component": { + "Icon": { + "name": { + "literalString": "star" + } + } + } + }, + { + "id": "rating", + "component": { + "Text": { + "text": { + "path": "/rating" + }, + "usageHint": "body" + } + } + }, + { + "id": "review-count", + "component": { + "Text": { + "text": { + "path": "/reviewCount" + }, + "usageHint": "caption" + } + } + }, + { + "id": "times-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "prep-time", + "cook-time" + ] + } + } + } + }, + { + "id": "prep-time", + "component": { + "Row": { + "children": { + "explicitList": [ + "prep-icon", + "prep-text" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "prep-icon", + "component": { + "Icon": { + "name": { + "literalString": "calendarToday" + } + } + } + }, + { + "id": "prep-text", + "component": { + "Text": { + "text": { + "path": "/prepTime" + }, + "usageHint": "caption" + } + } + }, + { + "id": "cook-time", + "component": { + "Row": { + "children": { + "explicitList": [ + "cook-icon", + "cook-text" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "cook-icon", + "component": { + "Icon": { + "name": { + "literalString": "warning" + } + } + } + }, + { + "id": "cook-text", + "component": { + "Text": { + "text": { + "path": "/cookTime" + }, + "usageHint": "caption" + } + } + }, + { + "id": "servings", + "component": { + "Text": { + "text": { + "path": "/servings" + }, + "usageHint": "caption" + } + } + } + ] + } + }, + { + "dataModelUpdate": { + "surfaceId": "gallery-recipe-card", + "contents": [ + { + "key": "image", + "valueString": "https://images.unsplash.com/photo-1546069901-ba9599a7e63c?w=300&h=180&fit=crop" + }, + { + "key": "title", + "valueString": "Mediterranean Quinoa Bowl" + }, + { + "key": "rating", + "valueString": "4.9" + }, + { + "key": "reviewCount", + "valueString": "(1,247 reviews)" + }, + { + "key": "prepTime", + "valueString": "15 min prep" + }, + { + "key": "cookTime", + "valueString": "20 min cook" + }, + { + "key": "servings", + "valueString": "Serves 4" + } + ] + } + }, + { + "beginRendering": { + "surfaceId": "gallery-recipe-card", + "root": "root" + } + } +] \ No newline at end of file diff --git a/specification/v0_8/json/catalogs/basic/examples/25_contact-card.json b/specification/v0_8/json/catalogs/basic/examples/25_contact-card.json new file mode 100644 index 000000000..36bed1cbd --- /dev/null +++ b/specification/v0_8/json/catalogs/basic/examples/25_contact-card.json @@ -0,0 +1,288 @@ +[ + { + "surfaceUpdate": { + "surfaceId": "gallery-contact-card", + "components": [ + { + "id": "root", + "component": { + "Card": { + "child": "main-column" + } + } + }, + { + "id": "main-column", + "component": { + "Column": { + "children": { + "explicitList": [ + "avatar-image", + "name", + "title", + "divider", + "contact-info", + "actions" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "avatar-image", + "component": { + "Image": { + "url": { + "path": "/avatar" + }, + "fit": "cover", + "usageHint": "avatar" + } + } + }, + { + "id": "name", + "component": { + "Text": { + "text": { + "path": "/name" + }, + "usageHint": "h2" + } + } + }, + { + "id": "title", + "component": { + "Text": { + "text": { + "path": "/title" + }, + "usageHint": "body" + } + } + }, + { + "id": "divider", + "component": { + "Divider": {} + } + }, + { + "id": "contact-info", + "component": { + "Column": { + "children": { + "explicitList": [ + "phone-row", + "email-row", + "location-row" + ] + } + } + } + }, + { + "id": "phone-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "phone-icon", + "phone-text" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "phone-icon", + "component": { + "Icon": { + "name": { + "literalString": "phone" + } + } + } + }, + { + "id": "phone-text", + "component": { + "Text": { + "text": { + "path": "/phone" + }, + "usageHint": "body" + } + } + }, + { + "id": "email-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "email-icon", + "email-text" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "email-icon", + "component": { + "Icon": { + "name": { + "literalString": "mail" + } + } + } + }, + { + "id": "email-text", + "component": { + "Text": { + "text": { + "path": "/email" + }, + "usageHint": "body" + } + } + }, + { + "id": "location-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "location-icon", + "location-text" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "location-icon", + "component": { + "Icon": { + "name": { + "literalString": "locationOn" + } + } + } + }, + { + "id": "location-text", + "component": { + "Text": { + "text": { + "path": "/location" + }, + "usageHint": "body" + } + } + }, + { + "id": "actions", + "component": { + "Row": { + "children": { + "explicitList": [ + "call-btn", + "message-btn" + ] + } + } + } + }, + { + "id": "call-btn-text", + "component": { + "Text": { + "text": { + "literalString": "Call" + } + } + } + }, + { + "id": "call-btn", + "component": { + "Button": { + "child": "call-btn-text", + "action": { + "name": "call", + "context": [] + } + } + } + }, + { + "id": "message-btn-text", + "component": { + "Text": { + "text": { + "literalString": "Message" + } + } + } + }, + { + "id": "message-btn", + "component": { + "Button": { + "child": "message-btn-text", + "action": { + "name": "message", + "context": [] + } + } + } + } + ] + } + }, + { + "dataModelUpdate": { + "surfaceId": "gallery-contact-card", + "contents": [ + { + "key": "avatar", + "valueString": "https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=100&h=100&fit=crop" + }, + { + "key": "name", + "valueString": "David Park" + }, + { + "key": "title", + "valueString": "Engineering Manager" + }, + { + "key": "phone", + "valueString": "+1 (555) 234-5678" + }, + { + "key": "email", + "valueString": "david.park@company.com" + }, + { + "key": "location", + "valueString": "San Francisco, CA" + } + ] + } + }, + { + "beginRendering": { + "surfaceId": "gallery-contact-card", + "root": "root" + } + } +] \ No newline at end of file diff --git a/specification/v0_8/json/catalogs/basic/examples/26_podcast-episode.json b/specification/v0_8/json/catalogs/basic/examples/26_podcast-episode.json new file mode 100644 index 000000000..d5961fb6d --- /dev/null +++ b/specification/v0_8/json/catalogs/basic/examples/26_podcast-episode.json @@ -0,0 +1,185 @@ +[ + { + "surfaceUpdate": { + "surfaceId": "gallery-podcast-episode", + "components": [ + { + "id": "root", + "component": { + "Card": { + "child": "main-row" + } + } + }, + { + "id": "main-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "artwork", + "content" + ] + }, + "alignment": "start" + } + } + }, + { + "id": "artwork", + "component": { + "Image": { + "url": { + "path": "/artwork" + }, + "fit": "cover" + } + } + }, + { + "id": "content", + "component": { + "Column": { + "children": { + "explicitList": [ + "show-name", + "episode-title", + "meta-row", + "description", + "play-btn" + ] + } + } + } + }, + { + "id": "show-name", + "component": { + "Text": { + "text": { + "path": "/showName" + }, + "usageHint": "caption" + } + } + }, + { + "id": "episode-title", + "component": { + "Text": { + "text": { + "path": "/episodeTitle" + }, + "usageHint": "h4" + } + } + }, + { + "id": "meta-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "duration", + "date" + ] + } + } + } + }, + { + "id": "duration", + "component": { + "Text": { + "text": { + "path": "/duration" + }, + "usageHint": "caption" + } + } + }, + { + "id": "date", + "component": { + "Text": { + "text": { + "path": "/date" + }, + "usageHint": "caption" + } + } + }, + { + "id": "description", + "component": { + "Text": { + "text": { + "path": "/description" + }, + "usageHint": "body" + } + } + }, + { + "id": "play-btn-text", + "component": { + "Text": { + "text": { + "literalString": "Play Episode" + } + } + } + }, + { + "id": "play-btn", + "component": { + "Button": { + "child": "play-btn-text", + "action": { + "name": "play", + "context": [] + } + } + } + } + ] + } + }, + { + "dataModelUpdate": { + "surfaceId": "gallery-podcast-episode", + "contents": [ + { + "key": "artwork", + "valueString": "https://images.unsplash.com/photo-1478737270239-2f02b77fc618?w=100&h=100&fit=crop" + }, + { + "key": "showName", + "valueString": "Tech Talk Daily" + }, + { + "key": "episodeTitle", + "valueString": "The Future of AI in Product Design" + }, + { + "key": "duration", + "valueString": "45 min" + }, + { + "key": "date", + "valueString": "Dec 15, 2024" + }, + { + "key": "description", + "valueString": "How AI is transforming the way we design and build products." + } + ] + } + }, + { + "beginRendering": { + "surfaceId": "gallery-podcast-episode", + "root": "root" + } + } +] \ No newline at end of file diff --git a/specification/v0_8/json/catalogs/basic/examples/27_stats-card.json b/specification/v0_8/json/catalogs/basic/examples/27_stats-card.json new file mode 100644 index 000000000..4589369a8 --- /dev/null +++ b/specification/v0_8/json/catalogs/basic/examples/27_stats-card.json @@ -0,0 +1,145 @@ +[ + { + "surfaceUpdate": { + "surfaceId": "gallery-stats-card", + "components": [ + { + "id": "root", + "component": { + "Card": { + "child": "main-column" + } + } + }, + { + "id": "main-column", + "component": { + "Column": { + "children": { + "explicitList": [ + "header", + "value", + "trend-row" + ] + } + } + } + }, + { + "id": "header", + "component": { + "Row": { + "children": { + "explicitList": [ + "metric-icon", + "metric-name" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "metric-icon", + "component": { + "Icon": { + "name": { + "path": "/icon" + } + } + } + }, + { + "id": "metric-name", + "component": { + "Text": { + "text": { + "path": "/metricName" + }, + "usageHint": "caption" + } + } + }, + { + "id": "value", + "component": { + "Text": { + "text": { + "path": "/value" + }, + "usageHint": "h1" + } + } + }, + { + "id": "trend-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "trend-icon", + "trend-text" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "trend-icon", + "component": { + "Icon": { + "name": { + "path": "/trendIcon" + } + } + } + }, + { + "id": "trend-text", + "component": { + "Text": { + "text": { + "path": "/trendText" + }, + "usageHint": "body" + } + } + } + ] + } + }, + { + "dataModelUpdate": { + "surfaceId": "gallery-stats-card", + "contents": [ + { + "key": "icon", + "valueString": "trending_up" + }, + { + "key": "metricName", + "valueString": "Monthly Revenue" + }, + { + "key": "value", + "valueString": "$48,294" + }, + { + "key": "trendIcon", + "valueString": "arrow_upward" + }, + { + "key": "trendText", + "valueString": "+12.5% from last month" + } + ] + } + }, + { + "beginRendering": { + "surfaceId": "gallery-stats-card", + "root": "root" + } + } +] \ No newline at end of file diff --git a/specification/v0_8/json/catalogs/basic/examples/28_countdown-timer.json b/specification/v0_8/json/catalogs/basic/examples/28_countdown-timer.json new file mode 100644 index 000000000..045781264 --- /dev/null +++ b/specification/v0_8/json/catalogs/basic/examples/28_countdown-timer.json @@ -0,0 +1,210 @@ +[ + { + "surfaceUpdate": { + "surfaceId": "gallery-countdown-timer", + "components": [ + { + "id": "root", + "component": { + "Card": { + "child": "main-column" + } + } + }, + { + "id": "main-column", + "component": { + "Column": { + "children": { + "explicitList": [ + "event-name", + "countdown-row", + "target-date" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "event-name", + "component": { + "Text": { + "text": { + "path": "/eventName" + }, + "usageHint": "h3" + } + } + }, + { + "id": "countdown-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "days-col", + "hours-col", + "minutes-col" + ] + }, + "distribution": "spaceAround" + } + } + }, + { + "id": "days-col", + "component": { + "Column": { + "children": { + "explicitList": [ + "days-value", + "days-label" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "days-value", + "component": { + "Text": { + "text": { + "path": "/days" + }, + "usageHint": "h1" + } + } + }, + { + "id": "days-label", + "component": { + "Text": { + "text": { + "literalString": "Days" + }, + "usageHint": "caption" + } + } + }, + { + "id": "hours-col", + "component": { + "Column": { + "children": { + "explicitList": [ + "hours-value", + "hours-label" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "hours-value", + "component": { + "Text": { + "text": { + "path": "/hours" + }, + "usageHint": "h1" + } + } + }, + { + "id": "hours-label", + "component": { + "Text": { + "text": { + "literalString": "Hours" + }, + "usageHint": "caption" + } + } + }, + { + "id": "minutes-col", + "component": { + "Column": { + "children": { + "explicitList": [ + "minutes-value", + "minutes-label" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "minutes-value", + "component": { + "Text": { + "text": { + "path": "/minutes" + }, + "usageHint": "h1" + } + } + }, + { + "id": "minutes-label", + "component": { + "Text": { + "text": { + "literalString": "Minutes" + }, + "usageHint": "caption" + } + } + }, + { + "id": "target-date", + "component": { + "Text": { + "text": { + "path": "/targetDate" + }, + "usageHint": "body" + } + } + } + ] + } + }, + { + "dataModelUpdate": { + "surfaceId": "gallery-countdown-timer", + "contents": [ + { + "key": "eventName", + "valueString": "Product Launch" + }, + { + "key": "days", + "valueString": "14" + }, + { + "key": "hours", + "valueString": "08" + }, + { + "key": "minutes", + "valueString": "32" + }, + { + "key": "targetDate", + "valueString": "January 15, 2025" + } + ] + } + }, + { + "beginRendering": { + "surfaceId": "gallery-countdown-timer", + "root": "root" + } + } +] \ No newline at end of file diff --git a/specification/v0_8/json/catalogs/basic/examples/29_movie-card.json b/specification/v0_8/json/catalogs/basic/examples/29_movie-card.json new file mode 100644 index 000000000..c312fe8a0 --- /dev/null +++ b/specification/v0_8/json/catalogs/basic/examples/29_movie-card.json @@ -0,0 +1,210 @@ +[ + { + "surfaceUpdate": { + "surfaceId": "gallery-movie-card", + "components": [ + { + "id": "root", + "component": { + "Card": { + "child": "main-column" + } + } + }, + { + "id": "main-column", + "component": { + "Column": { + "children": { + "explicitList": [ + "poster", + "content" + ] + } + } + } + }, + { + "id": "poster", + "component": { + "Image": { + "url": { + "path": "/poster" + }, + "fit": "cover" + } + } + }, + { + "id": "content", + "component": { + "Column": { + "children": { + "explicitList": [ + "title-row", + "genre", + "rating-row", + "runtime" + ] + } + } + } + }, + { + "id": "title-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "movie-title", + "year" + ] + }, + "alignment": "start" + } + } + }, + { + "id": "movie-title", + "component": { + "Text": { + "text": { + "path": "/title" + }, + "usageHint": "h3" + } + } + }, + { + "id": "year", + "component": { + "Text": { + "text": { + "path": "/year" + }, + "usageHint": "caption" + } + } + }, + { + "id": "genre", + "component": { + "Text": { + "text": { + "path": "/genre" + }, + "usageHint": "caption" + } + } + }, + { + "id": "rating-row", + "component": { + "Row": { + "children": { + "explicitList": [ + "star-icon", + "rating-value" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "star-icon", + "component": { + "Icon": { + "name": { + "literalString": "star" + } + } + } + }, + { + "id": "rating-value", + "component": { + "Text": { + "text": { + "path": "/rating" + }, + "usageHint": "body" + } + } + }, + { + "id": "runtime", + "component": { + "Row": { + "children": { + "explicitList": [ + "time-icon", + "runtime-text" + ] + }, + "alignment": "center" + } + } + }, + { + "id": "time-icon", + "component": { + "Icon": { + "name": { + "literalString": "calendarToday" + } + } + } + }, + { + "id": "runtime-text", + "component": { + "Text": { + "text": { + "path": "/runtime" + }, + "usageHint": "caption" + } + } + } + ] + } + }, + { + "dataModelUpdate": { + "surfaceId": "gallery-movie-card", + "contents": [ + { + "key": "poster", + "valueString": "https://images.unsplash.com/photo-1536440136628-849c177e76a1?w=200&h=300&fit=crop" + }, + { + "key": "title", + "valueString": "Interstellar" + }, + { + "key": "year", + "valueString": "(2014)" + }, + { + "key": "genre", + "valueString": "Sci-Fi \u2022 Adventure \u2022 Drama" + }, + { + "key": "rating", + "valueString": "8.7/10" + }, + { + "key": "runtime", + "valueString": "2h 49min" + } + ] + } + }, + { + "beginRendering": { + "surfaceId": "gallery-movie-card", + "root": "root" + } + } +] \ No newline at end of file diff --git a/specification/v0_9/json/catalogs/basic/examples/01_flight-status.json b/specification/v0_9/json/catalogs/basic/examples/01_flight-status.json index 08526e75b..566b97d2e 100644 --- a/specification/v0_9/json/catalogs/basic/examples/01_flight-status.json +++ b/specification/v0_9/json/catalogs/basic/examples/01_flight-status.json @@ -50,7 +50,7 @@ { "id": "flight-indicator", "component": "Icon", - "name": "flight" + "name": "send" }, { "id": "flight-number", @@ -89,7 +89,7 @@ { "id": "arrow", "component": "Text", - "text": "→", + "text": "\u2192", "variant": "h2" }, { diff --git a/specification/v0_9/json/catalogs/basic/examples/03_calendar-day.json b/specification/v0_9/json/catalogs/basic/examples/03_calendar-day.json index 8b1e66f70..e1e0fc885 100644 --- a/specification/v0_9/json/catalogs/basic/examples/03_calendar-day.json +++ b/specification/v0_9/json/catalogs/basic/examples/03_calendar-day.json @@ -22,7 +22,7 @@ "component": "Column", "children": [ "header-row", - "events-list", + "divider", "actions" ] }, @@ -141,7 +141,7 @@ "variant": "caption" }, { - "id": "events-list", + "id": "divider", "component": "Divider" }, { diff --git a/specification/v0_9/json/catalogs/basic/examples/09_login-form.json b/specification/v0_9/json/catalogs/basic/examples/09_login-form.json index 36ac588c9..b66ec4d6d 100644 --- a/specification/v0_9/json/catalogs/basic/examples/09_login-form.json +++ b/specification/v0_9/json/catalogs/basic/examples/09_login-form.json @@ -57,13 +57,7 @@ "path": "/email" }, "placeholder": "Email address", - "label": "Email", - "action": { - "event": { - "name": "updateEmail", - "context": {} - } - } + "label": "Email" }, { "id": "password-field", @@ -73,12 +67,7 @@ }, "placeholder": "Password", "label": "Password", - "action": { - "event": { - "name": "updatePassword", - "context": {} - } - } + "variant": "obscured" }, { "id": "login-btn-text", diff --git a/specification/v0_9/json/catalogs/basic/examples/11_purchase-complete.json b/specification/v0_9/json/catalogs/basic/examples/11_purchase-complete.json index 574a234a6..5e0d44f40 100644 --- a/specification/v0_9/json/catalogs/basic/examples/11_purchase-complete.json +++ b/specification/v0_9/json/catalogs/basic/examples/11_purchase-complete.json @@ -33,7 +33,7 @@ { "id": "success-icon", "component": "Icon", - "name": "check_circle" + "name": "check" }, { "id": "title", @@ -106,7 +106,7 @@ { "id": "delivery-icon", "component": "Icon", - "name": "local_shipping" + "name": "arrowForward" }, { "id": "delivery-text", diff --git a/specification/v0_9/json/catalogs/basic/examples/12_chat-message.json b/specification/v0_9/json/catalogs/basic/examples/12_chat-message.json index fbec85b7d..078f175da 100644 --- a/specification/v0_9/json/catalogs/basic/examples/12_chat-message.json +++ b/specification/v0_9/json/catalogs/basic/examples/12_chat-message.json @@ -38,7 +38,7 @@ { "id": "channel-icon", "component": "Icon", - "name": "tag" + "name": "info" }, { "id": "channel-name", diff --git a/specification/v0_9/json/catalogs/basic/examples/13_coffee-order.json b/specification/v0_9/json/catalogs/basic/examples/13_coffee-order.json index 6651c64d1..daa7f8ecf 100644 --- a/specification/v0_9/json/catalogs/basic/examples/13_coffee-order.json +++ b/specification/v0_9/json/catalogs/basic/examples/13_coffee-order.json @@ -40,7 +40,7 @@ { "id": "coffee-icon", "component": "Icon", - "name": "local_cafe" + "name": "favorite" }, { "id": "store-name", diff --git a/specification/v0_9/json/catalogs/basic/examples/15_account-balance.json b/specification/v0_9/json/catalogs/basic/examples/15_account-balance.json index fa58b3c29..33c7a696e 100644 --- a/specification/v0_9/json/catalogs/basic/examples/15_account-balance.json +++ b/specification/v0_9/json/catalogs/basic/examples/15_account-balance.json @@ -40,7 +40,7 @@ { "id": "account-icon", "component": "Icon", - "name": "account_balance" + "name": "payment" }, { "id": "account-name", diff --git a/specification/v0_9/json/catalogs/basic/examples/17_event-detail.json b/specification/v0_9/json/catalogs/basic/examples/17_event-detail.json index 705149148..6bc851538 100644 --- a/specification/v0_9/json/catalogs/basic/examples/17_event-detail.json +++ b/specification/v0_9/json/catalogs/basic/examples/17_event-detail.json @@ -49,7 +49,7 @@ { "id": "time-icon", "component": "Icon", - "name": "schedule" + "name": "calendarToday" }, { "id": "time-text", @@ -71,7 +71,7 @@ { "id": "location-icon", "component": "Icon", - "name": "location_on" + "name": "locationOn" }, { "id": "location-text", @@ -142,7 +142,7 @@ "surfaceId": "gallery-event-detail", "value": { "title": "Product Launch Meeting", - "dateTime": "Thu, Dec 19 • 2:00 PM - 3:30 PM", + "dateTime": "Thu, Dec 19 \u2022 2:00 PM - 3:30 PM", "location": "Conference Room A, Building 2", "description": "Review final product specs and marketing materials before the Q1 launch." } diff --git a/specification/v0_9/json/catalogs/basic/examples/18_track-list.json b/specification/v0_9/json/catalogs/basic/examples/18_track-list.json index 425259f48..13ae817c3 100644 --- a/specification/v0_9/json/catalogs/basic/examples/18_track-list.json +++ b/specification/v0_9/json/catalogs/basic/examples/18_track-list.json @@ -38,7 +38,7 @@ { "id": "playlist-icon", "component": "Icon", - "name": "queue_music" + "name": "play" }, { "id": "playlist-name", diff --git a/specification/v0_9/json/catalogs/basic/examples/21_shipping-status.json b/specification/v0_9/json/catalogs/basic/examples/21_shipping-status.json index 6b00a8293..785a27f0a 100644 --- a/specification/v0_9/json/catalogs/basic/examples/21_shipping-status.json +++ b/specification/v0_9/json/catalogs/basic/examples/21_shipping-status.json @@ -40,7 +40,7 @@ { "id": "package-icon", "component": "Icon", - "name": "package_2" + "name": "info" }, { "id": "title", @@ -82,7 +82,7 @@ { "id": "step1-icon", "component": "Icon", - "name": "check_circle" + "name": "check" }, { "id": "step1-text", @@ -102,7 +102,7 @@ { "id": "step2-icon", "component": "Icon", - "name": "check_circle" + "name": "check" }, { "id": "step2-text", @@ -164,7 +164,7 @@ { "id": "eta-icon", "component": "Icon", - "name": "schedule" + "name": "calendarToday" }, { "id": "eta-text", diff --git a/specification/v0_9/json/catalogs/basic/examples/22_credit-card.json b/specification/v0_9/json/catalogs/basic/examples/22_credit-card.json index 8706eba82..eab3a1182 100644 --- a/specification/v0_9/json/catalogs/basic/examples/22_credit-card.json +++ b/specification/v0_9/json/catalogs/basic/examples/22_credit-card.json @@ -39,7 +39,7 @@ { "id": "card-icon", "component": "Icon", - "name": "credit_card" + "name": "payment" }, { "id": "card-type", @@ -120,7 +120,7 @@ "surfaceId": "gallery-credit-card", "value": { "cardType": "VISA", - "cardNumber": "•••• •••• •••• 4242", + "cardNumber": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "holderName": "SARAH JOHNSON", "expiryDate": "09/27" } diff --git a/specification/v0_9/json/catalogs/basic/examples/23_step-counter.json b/specification/v0_9/json/catalogs/basic/examples/23_step-counter.json index cfd00fac2..6e8596889 100644 --- a/specification/v0_9/json/catalogs/basic/examples/23_step-counter.json +++ b/specification/v0_9/json/catalogs/basic/examples/23_step-counter.json @@ -41,7 +41,7 @@ { "id": "steps-icon", "component": "Icon", - "name": "directions_walk" + "name": "person" }, { "id": "title", diff --git a/specification/v0_9/json/catalogs/basic/examples/24_recipe-card.json b/specification/v0_9/json/catalogs/basic/examples/24_recipe-card.json index f13d9cec0..d74570ce4 100644 --- a/specification/v0_9/json/catalogs/basic/examples/24_recipe-card.json +++ b/specification/v0_9/json/catalogs/basic/examples/24_recipe-card.json @@ -102,7 +102,7 @@ { "id": "prep-icon", "component": "Icon", - "name": "timer" + "name": "calendarToday" }, { "id": "prep-text", @@ -124,7 +124,7 @@ { "id": "cook-icon", "component": "Icon", - "name": "local_fire_department" + "name": "warning" }, { "id": "cook-text", diff --git a/specification/v0_9/json/catalogs/basic/examples/25_contact-card.json b/specification/v0_9/json/catalogs/basic/examples/25_contact-card.json index bcf4091d7..674465a41 100644 --- a/specification/v0_9/json/catalogs/basic/examples/25_contact-card.json +++ b/specification/v0_9/json/catalogs/basic/examples/25_contact-card.json @@ -124,7 +124,7 @@ { "id": "location-icon", "component": "Icon", - "name": "location_on" + "name": "locationOn" }, { "id": "location-text", diff --git a/specification/v0_9/json/catalogs/basic/examples/29_movie-card.json b/specification/v0_9/json/catalogs/basic/examples/29_movie-card.json index 93b3e8f2b..2224e5ab4 100644 --- a/specification/v0_9/json/catalogs/basic/examples/29_movie-card.json +++ b/specification/v0_9/json/catalogs/basic/examples/29_movie-card.json @@ -110,7 +110,7 @@ { "id": "time-icon", "component": "Icon", - "name": "schedule" + "name": "calendarToday" }, { "id": "runtime-text", @@ -131,7 +131,7 @@ "poster": "https://images.unsplash.com/photo-1536440136628-849c177e76a1?w=200&h=300&fit=crop", "title": "Interstellar", "year": "(2014)", - "genre": "Sci-Fi • Adventure • Drama", + "genre": "Sci-Fi \u2022 Adventure \u2022 Drama", "rating": "8.7/10", "runtime": "2h 49min" } From 6e3bf37707cdfa618e58fa6eb5a3976e28c8f2ac Mon Sep 17 00:00:00 2001 From: Jacob Simionato Date: Wed, 4 Mar 2026 11:33:31 +1030 Subject: [PATCH 3/5] fix more catalog items --- .../basic/examples/04_weather-current.json | 2 +- .../basic/examples/06_music-player.json | 30 +++++++++---------- .../basic/examples/21_shipping-status.json | 2 +- .../basic/examples/06_music-player.json | 26 ++++++++-------- .../basic/examples/21_shipping-status.json | 2 +- 5 files changed, 31 insertions(+), 31 deletions(-) diff --git a/specification/v0_8/json/catalogs/basic/examples/04_weather-current.json b/specification/v0_8/json/catalogs/basic/examples/04_weather-current.json index 0996ff587..4963d83fe 100644 --- a/specification/v0_8/json/catalogs/basic/examples/04_weather-current.json +++ b/specification/v0_8/json/catalogs/basic/examples/04_weather-current.json @@ -307,7 +307,7 @@ }, { "key": "forecast", - "valueString": "[{'icon': '\u2600\ufe0f', 'temp': '74\u00b0'}, {'icon': '\u2600\ufe0f', 'temp': '76\u00b0'}, {'icon': '\u26c5', 'temp': '71\u00b0'}, {'icon': '\u2600\ufe0f', 'temp': '73\u00b0'}, {'icon': '\u2600\ufe0f', 'temp': '75\u00b0'}]" + "valueString": "[{\"icon\": \"\\u2600\\ufe0f\", \"temp\": \"74\\u00b0\"}, {\"icon\": \"\\u2600\\ufe0f\", \"temp\": \"76\\u00b0\"}, {\"icon\": \"\\u26c5\", \"temp\": \"71\\u00b0\"}, {\"icon\": \"\\u2600\\ufe0f\", \"temp\": \"73\\u00b0\"}, {\"icon\": \"\\u2600\\ufe0f\", \"temp\": \"75\\u00b0\"}]" } ] } diff --git a/specification/v0_8/json/catalogs/basic/examples/06_music-player.json b/specification/v0_8/json/catalogs/basic/examples/06_music-player.json index d06b841a8..68e5e2f1c 100644 --- a/specification/v0_8/json/catalogs/basic/examples/06_music-player.json +++ b/specification/v0_8/json/catalogs/basic/examples/06_music-player.json @@ -138,11 +138,11 @@ } }, { - "id": "prev-btn-text", + "id": "prev-btn-icon", "component": { - "Text": { - "text": { - "literalString": "\u23ee" + "Icon": { + "name": { + "literalString": "arrowBack" } } } @@ -151,7 +151,7 @@ "id": "prev-btn", "component": { "Button": { - "child": "prev-btn-text", + "child": "prev-btn-icon", "action": { "name": "previous", "context": [] @@ -160,10 +160,10 @@ } }, { - "id": "play-btn-text", + "id": "play-btn-icon", "component": { - "Text": { - "text": { + "Icon": { + "name": { "path": "/playIcon" } } @@ -173,7 +173,7 @@ "id": "play-btn", "component": { "Button": { - "child": "play-btn-text", + "child": "play-btn-icon", "action": { "name": "playPause", "context": [] @@ -182,11 +182,11 @@ } }, { - "id": "next-btn-text", + "id": "next-btn-icon", "component": { - "Text": { - "text": { - "literalString": "\u23ed" + "Icon": { + "name": { + "literalString": "arrowForward" } } } @@ -195,7 +195,7 @@ "id": "next-btn", "component": { "Button": { - "child": "next-btn-text", + "child": "next-btn-icon", "action": { "name": "next", "context": [] @@ -240,7 +240,7 @@ }, { "key": "playIcon", - "valueString": "\u23f8" + "valueString": "pause" } ] } diff --git a/specification/v0_8/json/catalogs/basic/examples/21_shipping-status.json b/specification/v0_8/json/catalogs/basic/examples/21_shipping-status.json index f14890228..c35aa5266 100644 --- a/specification/v0_8/json/catalogs/basic/examples/21_shipping-status.json +++ b/specification/v0_8/json/catalogs/basic/examples/21_shipping-status.json @@ -282,7 +282,7 @@ }, { "key": "currentStepIcon", - "valueString": "local_shipping" + "valueString": "send" }, { "key": "eta", diff --git a/specification/v0_9/json/catalogs/basic/examples/06_music-player.json b/specification/v0_9/json/catalogs/basic/examples/06_music-player.json index 8e134cac8..cf5cd20f1 100644 --- a/specification/v0_9/json/catalogs/basic/examples/06_music-player.json +++ b/specification/v0_9/json/catalogs/basic/examples/06_music-player.json @@ -106,14 +106,14 @@ "justify": "center" }, { - "id": "prev-btn-text", - "component": "Text", - "text": "⏮" + "id": "prev-btn-icon", + "component": "Icon", + "name": "skipPrevious" }, { "id": "prev-btn", "component": "Button", - "child": "prev-btn-text", + "child": "prev-btn-icon", "action": { "event": { "name": "previous", @@ -122,16 +122,16 @@ } }, { - "id": "play-btn-text", - "component": "Text", - "text": { + "id": "play-btn-icon", + "component": "Icon", + "name": { "path": "/playIcon" } }, { "id": "play-btn", "component": "Button", - "child": "play-btn-text", + "child": "play-btn-icon", "action": { "event": { "name": "playPause", @@ -140,14 +140,14 @@ } }, { - "id": "next-btn-text", - "component": "Text", - "text": "⏭" + "id": "next-btn-icon", + "component": "Icon", + "name": "skipNext" }, { "id": "next-btn", "component": "Button", - "child": "next-btn-text", + "child": "next-btn-icon", "action": { "event": { "name": "next", @@ -170,7 +170,7 @@ "progress": 0.45, "currentTime": "1:48", "totalTime": "4:22", - "playIcon": "⏸" + "playIcon": "pause" } } } diff --git a/specification/v0_9/json/catalogs/basic/examples/21_shipping-status.json b/specification/v0_9/json/catalogs/basic/examples/21_shipping-status.json index 785a27f0a..7ef758843 100644 --- a/specification/v0_9/json/catalogs/basic/examples/21_shipping-status.json +++ b/specification/v0_9/json/catalogs/basic/examples/21_shipping-status.json @@ -183,7 +183,7 @@ "surfaceId": "gallery-shipping-status", "value": { "trackingNumber": "Tracking: 1Z999AA10123456784", - "currentStepIcon": "local_shipping", + "currentStepIcon": "send", "eta": "Estimated delivery: Today by 8 PM" } } From 93d66d5536ea39bccfd308ee85b83b6298fe67ab Mon Sep 17 00:00:00 2001 From: Jacob Simionato Date: Wed, 4 Mar 2026 11:59:23 +1030 Subject: [PATCH 4/5] Add samples with validation --- .github/workflows/validate_specifications.yml | 53 ++++++++ specification/scripts/validate.py | 128 ++++++++++++++++++ .../basic/examples/06_music-player.json | 2 +- .../basic/examples/18_track-list.json | 2 +- .../basic/examples/21_shipping-status.json | 2 +- .../basic/examples/09_login-form.json | 2 - .../basic/examples/21_shipping-status.json | 2 +- 7 files changed, 185 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/validate_specifications.yml create mode 100755 specification/scripts/validate.py diff --git a/.github/workflows/validate_specifications.yml b/.github/workflows/validate_specifications.yml new file mode 100644 index 000000000..7c257e5f6 --- /dev/null +++ b/.github/workflows/validate_specifications.yml @@ -0,0 +1,53 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Validate A2UI Specification Examples + +on: + push: + branches: [ main ] + paths: + - 'specification/**/json/**' + - '.github/workflows/validate_specifications.yml' + - 'specification/scripts/validate.py' + pull_request: + paths: + - 'specification/**/json/**' + - '.github/workflows/validate_specifications.yml' + - 'specification/scripts/validate.py' + +jobs: + validate: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Run validation script + run: python3 specification/scripts/validate.py diff --git a/specification/scripts/validate.py b/specification/scripts/validate.py new file mode 100755 index 000000000..026d7b28a --- /dev/null +++ b/specification/scripts/validate.py @@ -0,0 +1,128 @@ +#!/usr/bin/env python3 + +import os +import json +import subprocess +import glob +import sys +import shutil + +def run_ajv(schema_path, data_path, refs=None): + """Runs ajv validate via subprocess using pnpm dlx.""" + cmd = ["pnpm", "dlx", "ajv-cli", "validate", "-s", schema_path, "--spec=draft2020", "--strict=false", "-c", "ajv-formats", "-d", data_path] + if refs: + for ref in refs: + cmd.extend(["-r", ref]) + + result = subprocess.run(cmd, capture_output=True, text=True) + return result.returncode == 0, result.stdout + result.stderr + +def validate_messages(root_schema, example_files, refs=None, temp_dir="temp_val"): + """Validates a list of JSON files where each file contains a list of messages.""" + os.makedirs(temp_dir, exist_ok=True) + success = True + + for example_file in sorted(example_files): + print(f" Validating {os.path.basename(example_file)}...") + with open(example_file, 'r') as f: + try: + messages = json.load(f) + except json.JSONDecodeError as e: + print(f" [FAIL] Invalid JSON: {e}") + success = False + continue + + if not isinstance(messages, list): + # Try single object + messages = [messages] + + file_ok = True + for i, msg in enumerate(messages): + temp_data_path = os.path.join(temp_dir, f"msg_{os.path.basename(example_file)}_{i}.json") + with open(temp_data_path, 'w') as f: + json.dump(msg, f) + + is_valid, output = run_ajv(root_schema, temp_data_path, refs) + if not is_valid: + print(f" [FAIL] Message #{i+1} failed validation:") + print(output.strip()) + file_ok = False + success = False + + if file_ok: + print(f" [PASS]") + + shutil.rmtree(temp_dir) + return success + +def main(): + repo_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "../..")) + spec_root = os.path.join(repo_root, "specification") + + overall_success = True + + # Configuration for versions + configs = { + "v0_8": { + "root_schema": "specification/v0_8/json/server_to_client_with_standard_catalog.json", + "refs": [], + "examples": "specification/v0_8/json/catalogs/basic/examples/*.json" + }, + "v0_9": { + "root_schema": "specification/v0_9/json/server_to_client.json", + "refs": [ + "specification/v0_9/json/common_types.json", + "specification/v0_9/json/basic_catalog.json" # Will be aliased below + ], + "examples": "specification/v0_9/json/catalogs/basic/examples/*.json" + } + } + + for version, config in configs.items(): + print(f"\n=== Validating {version} ===") + + version_temp_dir = os.path.join(repo_root, f"temp_val_{version}") + os.makedirs(version_temp_dir, exist_ok=True) + + root_schema = os.path.join(repo_root, config["root_schema"]) + if not os.path.exists(root_schema): + print(f"Error: Root schema not found at {root_schema}") + overall_success = False + continue + + refs = [] + for ref in config["refs"]: + ref_path = os.path.join(repo_root, ref) + if "basic_catalog.json" in ref: + # v0.9 basic_catalog needs aliasing to catalog.json as expected by server_to_client.json + with open(ref_path, 'r') as f: + catalog = json.load(f) + if "$id" in catalog: + catalog["$id"] = catalog["$id"].replace("basic_catalog.json", "catalog.json") + alias_path = os.path.join(version_temp_dir, "catalog.json") + with open(alias_path, 'w') as f: + json.dump(catalog, f) + refs.append(alias_path) + else: + refs.append(ref_path) + + example_pattern = os.path.join(repo_root, config["examples"]) + example_files = glob.glob(example_pattern) + + if not example_files: + print(f"No examples found for {version} matching {example_pattern}") + else: + if not validate_messages(root_schema, example_files, refs, version_temp_dir): + overall_success = False + + if os.path.exists(version_temp_dir): + shutil.rmtree(version_temp_dir) + + if not overall_success: + print("\nOverall Validation: FAILED") + sys.exit(1) + else: + print("\nOverall Validation: PASSED") + +if __name__ == "__main__": + main() diff --git a/specification/v0_8/json/catalogs/basic/examples/06_music-player.json b/specification/v0_8/json/catalogs/basic/examples/06_music-player.json index 68e5e2f1c..ace24950a 100644 --- a/specification/v0_8/json/catalogs/basic/examples/06_music-player.json +++ b/specification/v0_8/json/catalogs/basic/examples/06_music-player.json @@ -82,7 +82,7 @@ "value": { "path": "/progress" }, - "max": 1 + "maxValue": 1 } } }, diff --git a/specification/v0_8/json/catalogs/basic/examples/18_track-list.json b/specification/v0_8/json/catalogs/basic/examples/18_track-list.json index 189996536..32727be24 100644 --- a/specification/v0_8/json/catalogs/basic/examples/18_track-list.json +++ b/specification/v0_8/json/catalogs/basic/examples/18_track-list.json @@ -44,7 +44,7 @@ "component": { "Icon": { "name": { - "literalString": "play" + "literalString": "arrowForward" } } } diff --git a/specification/v0_8/json/catalogs/basic/examples/21_shipping-status.json b/specification/v0_8/json/catalogs/basic/examples/21_shipping-status.json index c35aa5266..474f015c6 100644 --- a/specification/v0_8/json/catalogs/basic/examples/21_shipping-status.json +++ b/specification/v0_8/json/catalogs/basic/examples/21_shipping-status.json @@ -218,7 +218,7 @@ "component": { "Icon": { "name": { - "literalString": "circle" + "literalString": "check" } } } diff --git a/specification/v0_9/json/catalogs/basic/examples/09_login-form.json b/specification/v0_9/json/catalogs/basic/examples/09_login-form.json index b66ec4d6d..b3515b99f 100644 --- a/specification/v0_9/json/catalogs/basic/examples/09_login-form.json +++ b/specification/v0_9/json/catalogs/basic/examples/09_login-form.json @@ -56,7 +56,6 @@ "value": { "path": "/email" }, - "placeholder": "Email address", "label": "Email" }, { @@ -65,7 +64,6 @@ "value": { "path": "/password" }, - "placeholder": "Password", "label": "Password", "variant": "obscured" }, diff --git a/specification/v0_9/json/catalogs/basic/examples/21_shipping-status.json b/specification/v0_9/json/catalogs/basic/examples/21_shipping-status.json index 7ef758843..a0c65ede3 100644 --- a/specification/v0_9/json/catalogs/basic/examples/21_shipping-status.json +++ b/specification/v0_9/json/catalogs/basic/examples/21_shipping-status.json @@ -144,7 +144,7 @@ { "id": "step4-icon", "component": "Icon", - "name": "circle" + "name": "check" }, { "id": "step4-text", From 3006206d2efbb53e89119dd399a9fd0c7cc3c432 Mon Sep 17 00:00:00 2001 From: Jacob Simionato Date: Wed, 4 Mar 2026 12:13:35 +1030 Subject: [PATCH 5/5] Fix for ajd --- .github/workflows/validate_specifications.yml | 4 ++ specification/scripts/validate.py | 46 ++++++++++++------- 2 files changed, 34 insertions(+), 16 deletions(-) diff --git a/.github/workflows/validate_specifications.yml b/.github/workflows/validate_specifications.yml index 7c257e5f6..651b4f58c 100644 --- a/.github/workflows/validate_specifications.yml +++ b/.github/workflows/validate_specifications.yml @@ -49,5 +49,9 @@ jobs: with: python-version: '3.12' + - name: Install dependencies + working-directory: ./specification/v0_9/test + run: pnpm install + - name: Run validation script run: python3 specification/scripts/validate.py diff --git a/specification/scripts/validate.py b/specification/scripts/validate.py index 026d7b28a..8ce34ee11 100755 --- a/specification/scripts/validate.py +++ b/specification/scripts/validate.py @@ -7,13 +7,25 @@ import sys import shutil -def run_ajv(schema_path, data_path, refs=None): - """Runs ajv validate via subprocess using pnpm dlx.""" - cmd = ["pnpm", "dlx", "ajv-cli", "validate", "-s", schema_path, "--spec=draft2020", "--strict=false", "-c", "ajv-formats", "-d", data_path] +def run_ajv(schema_path, data_paths, refs=None): + """Runs ajv validate via subprocess. Batch validates multiple data paths.""" + repo_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "../..")) + # Try to find local ajv in specification/v0_9/test first + local_ajv = os.path.join(repo_root, "specification", "v0_9", "test", "node_modules", ".bin", "ajv") + + if os.path.exists(local_ajv): + cmd = [local_ajv, "validate", "-s", schema_path, "--spec=draft2020", "--strict=false", "-c", "ajv-formats"] + else: + # Fallback to pnpm dlx with both packages + cmd = ["pnpm", "dlx", "--package=ajv-cli", "--package=ajv-formats", "ajv", "validate", "-s", schema_path, "--spec=draft2020", "--strict=false", "-c", "ajv-formats"] + if refs: for ref in refs: cmd.extend(["-r", ref]) + for data_path in data_paths: + cmd.extend(["-d", data_path]) + result = subprocess.run(cmd, capture_output=True, text=True) return result.returncode == 0, result.stdout + result.stderr @@ -33,31 +45,31 @@ def validate_messages(root_schema, example_files, refs=None, temp_dir="temp_val" continue if not isinstance(messages, list): - # Try single object messages = [messages] - file_ok = True + temp_data_paths = [] for i, msg in enumerate(messages): temp_data_path = os.path.join(temp_dir, f"msg_{os.path.basename(example_file)}_{i}.json") with open(temp_data_path, 'w') as f: json.dump(msg, f) - - is_valid, output = run_ajv(root_schema, temp_data_path, refs) - if not is_valid: - print(f" [FAIL] Message #{i+1} failed validation:") - print(output.strip()) - file_ok = False - success = False + temp_data_paths.append(temp_data_path) - if file_ok: + if not temp_data_paths: + print(" [SKIP] No messages to validate") + continue + + is_valid, output = run_ajv(root_schema, temp_data_paths, refs) + if not is_valid: + print(f" [FAIL] Validation failed for {os.path.basename(example_file)}:") + print(output.strip()) + success = False + else: print(f" [PASS]") - shutil.rmtree(temp_dir) return success def main(): repo_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "../..")) - spec_root = os.path.join(repo_root, "specification") overall_success = True @@ -72,7 +84,7 @@ def main(): "root_schema": "specification/v0_9/json/server_to_client.json", "refs": [ "specification/v0_9/json/common_types.json", - "specification/v0_9/json/basic_catalog.json" # Will be aliased below + "specification/v0_9/json/basic_catalog.json" ], "examples": "specification/v0_9/json/catalogs/basic/examples/*.json" } @@ -82,6 +94,8 @@ def main(): print(f"\n=== Validating {version} ===") version_temp_dir = os.path.join(repo_root, f"temp_val_{version}") + if os.path.exists(version_temp_dir): + shutil.rmtree(version_temp_dir) os.makedirs(version_temp_dir, exist_ok=True) root_schema = os.path.join(repo_root, config["root_schema"])