Skip to content

Commit 90c2c0f

Browse files
style: update Vue node designs to use semantic tokens (#6304)
## Summary Use semantic tokens instead of colors ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6304-style-update-Vue-node-designs-to-use-semantic-tokens-2986d73d365081f69acce7793a218699) by [Unito](https://www.unito.io) --------- Co-authored-by: Claude <[email protected]>
1 parent 34155bc commit 90c2c0f

File tree

6 files changed

+155
-81
lines changed

6 files changed

+155
-81
lines changed

src/renderer/extensions/vueNodes/widgets/components/WidgetSelectButton.test.ts

Lines changed: 45 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,14 @@ describe('WidgetSelectButton Button Selection', () => {
107107
const selectedButton = buttons[1] // 'banana'
108108
const unselectedButton = buttons[0] // 'apple'
109109

110-
expect(selectedButton.classes()).toContain('bg-white')
111-
expect(selectedButton.classes()).toContain('text-neutral-900')
112-
expect(unselectedButton.classes()).not.toContain('bg-white')
113-
expect(unselectedButton.classes()).not.toContain('text-neutral-900')
110+
expect(selectedButton.classes()).toContain(
111+
'bg-interface-menu-component-surface-selected'
112+
)
113+
expect(selectedButton.classes()).toContain('text-primary')
114+
expect(unselectedButton.classes()).not.toContain(
115+
'bg-interface-menu-component-surface-selected'
116+
)
117+
expect(unselectedButton.classes()).toContain('text-secondary')
114118
})
115119

116120
it('handles no selection gracefully', () => {
@@ -120,8 +124,10 @@ describe('WidgetSelectButton Button Selection', () => {
120124

121125
const buttons = wrapper.findAll('button')
122126
buttons.forEach((button) => {
123-
expect(button.classes()).not.toContain('bg-white')
124-
expect(button.classes()).not.toContain('text-neutral-900')
127+
expect(button.classes()).not.toContain(
128+
'bg-interface-menu-component-surface-selected'
129+
)
130+
expect(button.classes()).toContain('text-secondary')
125131
})
126132
})
127133

@@ -134,13 +140,19 @@ describe('WidgetSelectButton Button Selection', () => {
134140

135141
// Initially 'first' is selected
136142
let buttons = wrapper.findAll('button')
137-
expect(buttons[0].classes()).toContain('bg-white')
143+
expect(buttons[0].classes()).toContain(
144+
'bg-interface-menu-component-surface-selected'
145+
)
138146

139147
// Update to 'second'
140148
await wrapper.setProps({ modelValue: 'second' })
141149
buttons = wrapper.findAll('button')
142-
expect(buttons[0].classes()).not.toContain('bg-white')
143-
expect(buttons[1].classes()).toContain('bg-white')
150+
expect(buttons[0].classes()).not.toContain(
151+
'bg-interface-menu-component-surface-selected'
152+
)
153+
expect(buttons[1].classes()).toContain(
154+
'bg-interface-menu-component-surface-selected'
155+
)
144156
})
145157
})
146158

@@ -222,7 +234,9 @@ describe('WidgetSelectButton Button Selection', () => {
222234
expect(buttons[2].text()).toBe('3')
223235

224236
// The selected button should be the one with '2'
225-
expect(buttons[1].classes()).toContain('bg-white')
237+
expect(buttons[1].classes()).toContain(
238+
'bg-interface-menu-component-surface-selected'
239+
)
226240
})
227241

228242
it('handles object options with label and value', () => {
@@ -240,7 +254,9 @@ describe('WidgetSelectButton Button Selection', () => {
240254
expect(buttons[2].text()).toBe('Third Option')
241255

242256
// 'second' should be selected
243-
expect(buttons[1].classes()).toContain('bg-white')
257+
expect(buttons[1].classes()).toContain(
258+
'bg-interface-menu-component-surface-selected'
259+
)
244260
})
245261

246262
it('emits correct values for object options', async () => {
@@ -277,7 +293,9 @@ describe('WidgetSelectButton Button Selection', () => {
277293

278294
const buttons = wrapper.findAll('button')
279295
expect(buttons).toHaveLength(4)
280-
expect(buttons[0].classes()).toContain('bg-white') // Empty string is selected
296+
expect(buttons[0].classes()).toContain(
297+
'bg-interface-menu-component-surface-selected'
298+
) // Empty string is selected
281299
})
282300

283301
it('handles null/undefined in options', () => {
@@ -292,7 +310,9 @@ describe('WidgetSelectButton Button Selection', () => {
292310

293311
const buttons = wrapper.findAll('button')
294312
expect(buttons).toHaveLength(4)
295-
expect(buttons[0].classes()).toContain('bg-white')
313+
expect(buttons[0].classes()).toContain(
314+
'bg-interface-menu-component-surface-selected'
315+
)
296316
})
297317

298318
it('handles very long option text', () => {
@@ -313,7 +333,9 @@ describe('WidgetSelectButton Button Selection', () => {
313333

314334
const buttons = wrapper.findAll('button')
315335
expect(buttons).toHaveLength(20)
316-
expect(buttons[4].classes()).toContain('bg-white') // option5 is at index 4
336+
expect(buttons[4].classes()).toContain(
337+
'bg-interface-menu-component-surface-selected'
338+
) // option5 is at index 4
317339
})
318340

319341
it('handles duplicate options', () => {
@@ -324,8 +346,12 @@ describe('WidgetSelectButton Button Selection', () => {
324346
const buttons = wrapper.findAll('button')
325347
expect(buttons).toHaveLength(4)
326348
// Both 'duplicate' buttons should be highlighted (due to value matching)
327-
expect(buttons[0].classes()).toContain('bg-white')
328-
expect(buttons[2].classes()).toContain('bg-white')
349+
expect(buttons[0].classes()).toContain(
350+
'bg-interface-menu-component-surface-selected'
351+
)
352+
expect(buttons[2].classes()).toContain(
353+
'bg-interface-menu-component-surface-selected'
354+
)
329355
})
330356
})
331357

@@ -354,7 +380,9 @@ describe('WidgetSelectButton Button Selection', () => {
354380
const buttons = wrapper.findAll('button')
355381
const unselectedButton = buttons[1] // 'option2'
356382

357-
expect(unselectedButton.classes()).toContain('hover:bg-zinc-200/50')
383+
expect(unselectedButton.classes()).toContain(
384+
'hover:bg-interface-menu-component-surface-hovered'
385+
)
358386
expect(unselectedButton.classes()).toContain('cursor-pointer')
359387
})
360388
})

src/renderer/extensions/vueNodes/widgets/components/audio/AudioPreviewPlayer.vue

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,14 @@
2424
role="button"
2525
:tabindex="0"
2626
aria-label="Play/Pause"
27-
class="flex size-6 cursor-pointer items-center justify-center rounded hover:bg-black/10 dark-theme:hover:bg-white/10"
27+
class="flex size-6 cursor-pointer items-center justify-center rounded hover:bg-interface-menu-component-surface-hovered"
2828
@click="togglePlayPause"
2929
>
3030
<i
3131
v-if="!isPlaying"
32-
class="icon-[lucide--play] size-4 text-smoke-600 dark-theme:text-smoke-800"
33-
/>
34-
<i
35-
v-else
36-
class="icon-[lucide--pause] size-4 text-smoke-600 dark-theme:text-smoke-800"
32+
class="text-secondary icon-[lucide--play] size-4"
3733
/>
34+
<i v-else class="text-secondary icon-[lucide--pause] size-4" />
3835
</div>
3936

4037
<!-- Time Display -->
@@ -44,11 +41,9 @@
4441
</div>
4542

4643
<!-- Progress Bar -->
47-
<div
48-
class="relative h-0.5 flex-1 rounded-full bg-smoke-300 dark-theme:bg-ash-800"
49-
>
44+
<div class="relative h-0.5 flex-1 rounded-full bg-interface-stroke">
5045
<div
51-
class="absolute top-0 left-0 h-full rounded-full bg-smoke-600 transition-all dark-theme:bg-white/50"
46+
class="absolute top-0 left-0 h-full rounded-full bg-button-icon transition-all"
5247
:style="{ width: `${progressPercentage}%` }"
5348
/>
5449
<input
@@ -70,21 +65,18 @@
7065
role="button"
7166
:tabindex="0"
7267
aria-label="Volume"
73-
class="flex size-6 cursor-pointer items-center justify-center rounded hover:bg-black/10 dark-theme:hover:bg-white/10"
68+
class="flex size-6 cursor-pointer items-center justify-center rounded hover:bg-interface-menu-component-surface-hovered"
7469
@click="toggleMute"
7570
>
7671
<i
7772
v-if="showVolumeTwo"
78-
class="icon-[lucide--volume-2] size-4 text-smoke-600 dark-theme:text-smoke-800"
73+
class="text-secondary icon-[lucide--volume-2] size-4"
7974
/>
8075
<i
8176
v-else-if="showVolumeOne"
82-
class="icon-[lucide--volume-1] size-4 text-smoke-600 dark-theme:text-smoke-800"
83-
/>
84-
<i
85-
v-else
86-
class="icon-[lucide--volume-x] size-4 text-smoke-600 dark-theme:text-smoke-800"
77+
class="text-secondary icon-[lucide--volume-1] size-4"
8778
/>
79+
<i v-else class="text-secondary icon-[lucide--volume-x] size-4" />
8880
</div>
8981

9082
<!-- Options Button -->
@@ -94,12 +86,10 @@
9486
role="button"
9587
:tabindex="0"
9688
aria-label="More Options"
97-
class="flex size-6 cursor-pointer items-center justify-center rounded hover:bg-black/10 dark-theme:hover:bg-white/10"
89+
class="flex size-6 cursor-pointer items-center justify-center rounded hover:bg-interface-menu-component-surface-hovered"
9890
@click="toggleOptionsMenu"
9991
>
100-
<i
101-
class="icon-[lucide--more-vertical] size-4 text-smoke-600 dark-theme:text-smoke-800"
102-
/>
92+
<i class="text-secondary icon-[lucide--more-vertical] size-4" />
10393
</div>
10494
</div>
10595

0 commit comments

Comments
 (0)