Skip to content

Commit e60aef5

Browse files
committed
Polish: primary buttons, default v0.9, sidebar order, music player fix
- Add variant: 'primary' to main CTA buttons in 9 v0.9 gallery widgets - Change default spec version to v0.9 - Move version selector above navigation in sidebar - Fix music player: replace non-existent ProgressBar with Slider (max: 262, values in seconds)
1 parent e5ce493 commit e60aef5

File tree

12 files changed

+18
-7
lines changed

12 files changed

+18
-7
lines changed

tools/composer/src/components/layout/sidebar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ export function Sidebar() {
5959
>
6060
<SidebarHeader />
6161
<hr />
62-
<SidebarNav onNavigate={() => setIsOpen(false)} />
63-
<hr />
6462
<VersionSelector />
6563
<hr />
64+
<SidebarNav onNavigate={() => setIsOpen(false)} />
65+
<hr />
6666
<SidebarWidgets onNavigate={() => setIsOpen(false)} />
6767
</aside>
6868
</>

tools/composer/src/contexts/spec-version-context.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { createContext, useContext, useState, useEffect, useCallback, type React
1111
import type { SpecVersion } from '@/types/widget';
1212

1313
const STORAGE_KEY = 'a2ui-spec-version';
14-
const DEFAULT_VERSION: SpecVersion = '0.8';
14+
const DEFAULT_VERSION: SpecVersion = '0.9';
1515

1616
interface SpecVersionContextValue {
1717
specVersion: SpecVersion;

tools/composer/src/data/gallery/v09/account-balance.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export const V09_ACCOUNT_BALANCE_WIDGET: Widget = {
8585
id: 'transfer-btn',
8686
component: 'Button',
8787
child: 'transfer-btn-text',
88+
variant: 'primary',
8889
action: { event: { name: 'transfer' } },
8990
},
9091
{

tools/composer/src/data/gallery/v09/calendar-day.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ export const V09_CALENDAR_DAY_WIDGET: Widget = {
136136
id: 'add-btn',
137137
component: 'Button',
138138
child: 'add-btn-text',
139+
variant: 'primary',
139140
action: { event: { name: 'add' } },
140141
},
141142
{

tools/composer/src/data/gallery/v09/email-compose.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ export const V09_EMAIL_COMPOSE_WIDGET: Widget = {
142142
id: 'send-btn',
143143
component: 'Button',
144144
child: 'send-btn-text',
145+
variant: 'primary',
145146
action: { event: { name: 'send' } },
146147
},
147148
{

tools/composer/src/data/gallery/v09/event-detail.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ export const V09_EVENT_DETAIL_WIDGET: Widget = {
104104
id: 'accept-btn',
105105
component: 'Button',
106106
child: 'accept-btn-text',
107+
variant: 'primary',
107108
action: { event: { name: 'accept' } },
108109
},
109110
{

tools/composer/src/data/gallery/v09/login-form.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export const V09_LOGIN_FORM_WIDGET: Widget = {
7979
id: 'login-btn',
8080
component: 'Button',
8181
child: 'login-btn-text',
82+
variant: 'primary',
8283
action: { event: { name: 'login' } },
8384
},
8485
{

tools/composer/src/data/gallery/v09/music-player.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ export const V09_MUSIC_PLAYER_WIDGET: Widget = {
6464
},
6565
{
6666
id: 'progress',
67-
component: 'ProgressBar',
68-
progress: { path: '/progress' },
67+
component: 'Slider',
68+
value: { path: '/progress' },
69+
min: 0,
70+
max: 262,
6971
},
7072
{
7173
id: 'time-row',
@@ -134,7 +136,7 @@ export const V09_MUSIC_PLAYER_WIDGET: Widget = {
134136
title: 'Blinding Lights',
135137
artist: 'The Weeknd',
136138
album: 'After Hours',
137-
progress: 0.45,
139+
progress: 45,
138140
currentTime: '1:48',
139141
totalTime: '4:22',
140142
playIcon: '\u23f8',
@@ -147,7 +149,7 @@ export const V09_MUSIC_PLAYER_WIDGET: Widget = {
147149
title: 'Starboy',
148150
artist: 'The Weeknd ft. Daft Punk',
149151
album: 'Starboy',
150-
progress: 0.72,
152+
progress: 165,
151153
currentTime: '2:45',
152154
totalTime: '3:50',
153155
playIcon: '\u25b6',

tools/composer/src/data/gallery/v09/notification-permission.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export const V09_NOTIFICATION_PERMISSION_WIDGET: Widget = {
7070
id: 'yes-btn',
7171
component: 'Button',
7272
child: 'yes-btn-text',
73+
variant: 'primary',
7374
action: { event: { name: 'accept' } },
7475
},
7576
{

tools/composer/src/data/gallery/v09/product-card.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ export const V09_PRODUCT_CARD_WIDGET: Widget = {
108108
id: 'add-cart-btn',
109109
component: 'Button',
110110
child: 'add-cart-btn-text',
111+
variant: 'primary',
111112
action: { event: { name: 'addToCart' } },
112113
},
113114
],

0 commit comments

Comments
 (0)