Skip to content

Commit 8df92b0

Browse files
authored
feat: add RTL support to VersionSelector (#357)
1 parent 2e59e1a commit 8df92b0

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

app/components/VersionSelector.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ watch(
485485
latest
486486
</span>
487487
<span
488-
class="i-carbon-chevron-down w-3.5 h-3.5 transition-[transform] duration-200 motion-reduce:transition-none"
488+
class="i-carbon:chevron-down w-3.5 h-3.5 transition-[transform] duration-200 motion-reduce:transition-none"
489489
:class="{ 'rotate-180': isOpen }"
490490
aria-hidden="true"
491491
/>
@@ -507,7 +507,7 @@ watch(
507507
:aria-activedescendant="
508508
focusedIndex >= 0 ? `version-${flatItems[focusedIndex]?.version?.version}` : undefined
509509
"
510-
class="absolute top-full left-0 mt-2 min-w-[220px] bg-bg-elevated border border-border rounded-lg shadow-lg z-50 py-1 max-h-[400px] overflow-y-auto overscroll-contain focus-visible:outline-none"
510+
class="absolute top-full inset-is-0 mt-2 min-w-[220px] bg-bg-elevated border border-border rounded-lg shadow-lg z-50 py-1 max-h-[400px] overflow-y-auto overscroll-contain focus-visible:outline-none"
511511
@keydown="handleListboxKeydown"
512512
>
513513
<!-- Version groups -->
@@ -541,13 +541,13 @@ watch(
541541
>
542542
<span
543543
v-if="group.isLoading"
544-
class="i-carbon-rotate-180 w-3 h-3 motion-safe:animate-spin"
544+
class="i-carbon:rotate-180 w-3 h-3 motion-safe:animate-spin"
545545
aria-hidden="true"
546546
/>
547547
<span
548548
v-else
549-
class="w-3 h-3 transition-transform duration-200"
550-
:class="group.isExpanded ? 'i-carbon-chevron-down' : 'i-carbon-chevron-right'"
549+
class="w-3 h-3 transition-transform duration-200 rtl-flip"
550+
:class="group.isExpanded ? 'i:carbon:chevron-down' : 'i-carbon:chevron-right'"
551551
aria-hidden="true"
552552
/>
553553
</button>
@@ -582,7 +582,7 @@ watch(
582582
<!-- Expanded versions -->
583583
<div
584584
v-if="group.isExpanded && group.versions.length > 1"
585-
class="ml-6 border-l border-border"
585+
class="ms-6 border-is border-border"
586586
>
587587
<template v-for="(v, vIndex) in group.versions.slice(1)" :key="v.version">
588588
<NuxtLink
@@ -595,7 +595,7 @@ watch(
595595
flatItems[focusedIndex]?.type === 'version' &&
596596
flatItems[focusedIndex]?.version?.version === v.version
597597
"
598-
class="flex items-center justify-between gap-2 pl-4 pr-3 py-1.5 text-xs font-mono hover:bg-bg-muted transition-[color,background-color] focus-visible:outline-none"
598+
class="flex items-center justify-between gap-2 ps-4 pe-3 py-1.5 text-xs font-mono hover:bg-bg-muted transition-[color,background-color] focus-visible:outline-none"
599599
:class="[
600600
v.isCurrent ? 'text-fg bg-bg-muted' : 'text-fg-subtle',
601601
flatItems[focusedIndex]?.version?.version === v.version ? 'bg-bg-muted' : '',

test/nuxt/components/VersionSelector.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ describe('VersionSelector', () => {
542542

543543
// Should show loading spinner (motion-safe:animate-spin is applied)
544544
await vi.waitFor(() => {
545-
const spinner = component.find('.i-carbon-rotate-180')
545+
const spinner = component.find('.i-carbon\\:rotate-180')
546546
expect(spinner.exists()).toBe(true)
547547
})
548548

0 commit comments

Comments
 (0)