Skip to content

Commit a9fe7c6

Browse files
committed
fix(components): add missing data-orientation for consistency
1 parent 3ee3a5e commit a9fe7c6

16 files changed

+146
-145
lines changed

src/runtime/components/Carousel.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ defineExpose({
298298
:as="as"
299299
role="region"
300300
aria-roledescription="carousel"
301+
:data-orientation="orientation"
301302
tabindex="0"
302303
:class="ui.root({ class: [props.ui?.root, props.class] })"
303304
@keydown="onKeyDown"

src/runtime/components/FieldGroup.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ provide(fieldGroupInjectionKey, computed(() => ({
5353
</script>
5454

5555
<template>
56-
<Primitive :as="as" :class="ui({ orientation, class: props.class })">
56+
<Primitive :as="as" :data-orientation="orientation" :class="ui({ orientation, class: props.class })">
5757
<slot />
5858
</Primitive>
5959
</template>

src/runtime/components/Marquee.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.marquee || {
4949
</script>
5050

5151
<template>
52-
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
52+
<Primitive :as="as" :data-orientation="orientation" :class="ui.root({ class: [props.ui?.root, props.class] })">
5353
<div v-for="i in repeat" :key="i" :class="ui.content({ class: [props.ui?.content] })">
5454
<slot />
5555
</div>

src/runtime/components/Progress.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.progress ||
166166
</script>
167167

168168
<template>
169-
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
169+
<Primitive :as="as" :data-orientation="orientation" :class="ui.root({ class: [props.ui?.root, props.class] })">
170170
<div v-if="!isIndeterminate && (status || !!slots.status)" :class="ui.status({ class: props.ui?.status })" :style="statusStyle">
171171
<slot name="status" :percent="percent">
172172
{{ percent }}%

test/components/__snapshots__/Carousel-vue.spec.ts.snap

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

33
exports[`Carousel > renders with arrows correctly 1`] = `
4-
"<div role="region" aria-roledescription="carousel" tabindex="0" class="relative focus:outline-none">
4+
"<div role="region" aria-roledescription="carousel" data-orientation="horizontal" tabindex="0" class="relative focus:outline-none">
55
<div class="overflow-hidden">
66
<div class="flex items-start flex-row -ms-4" style="transform: translate3d(NaNpx,0px,0px);">
77
<div role="group" aria-roledescription="slide" class="min-w-0 shrink-0 basis-full ps-4"><img src="https://picsum.photos/600/600?random=1" width="300" height="300" class="rounded-lg"></div>
@@ -26,7 +26,7 @@ exports[`Carousel > renders with arrows correctly 1`] = `
2626
`;
2727
2828
exports[`Carousel > renders with as correctly 1`] = `
29-
"<nav role="region" aria-roledescription="carousel" tabindex="0" class="relative focus:outline-none">
29+
"<nav role="region" aria-roledescription="carousel" data-orientation="horizontal" tabindex="0" class="relative focus:outline-none">
3030
<div class="overflow-hidden">
3131
<div class="flex items-start flex-row -ms-4" style="transform: translate3d(NaNpx,0px,0px);">
3232
<div role="group" aria-roledescription="slide" class="min-w-0 shrink-0 basis-full ps-4"><img src="https://picsum.photos/600/600?random=1" width="300" height="300" class="rounded-lg"></div>
@@ -42,7 +42,7 @@ exports[`Carousel > renders with as correctly 1`] = `
4242
`;
4343
4444
exports[`Carousel > renders with class correctly 1`] = `
45-
"<div role="region" aria-roledescription="carousel" tabindex="0" class="relative focus:outline-none w-full max-w-xs">
45+
"<div role="region" aria-roledescription="carousel" data-orientation="horizontal" tabindex="0" class="relative focus:outline-none w-full max-w-xs">
4646
<div class="overflow-hidden">
4747
<div class="flex items-start flex-row -ms-4" style="transform: translate3d(NaNpx,0px,0px);">
4848
<div role="group" aria-roledescription="slide" class="min-w-0 shrink-0 basis-full ps-4"><img src="https://picsum.photos/600/600?random=1" width="300" height="300" class="rounded-lg"></div>
@@ -58,7 +58,7 @@ exports[`Carousel > renders with class correctly 1`] = `
5858
`;
5959
6060
exports[`Carousel > renders with dots correctly 1`] = `
61-
"<div role="region" aria-roledescription="carousel" tabindex="0" class="relative focus:outline-none">
61+
"<div role="region" aria-roledescription="carousel" data-orientation="horizontal" tabindex="0" class="relative focus:outline-none">
6262
<div class="overflow-hidden">
6363
<div class="flex items-start flex-row -ms-4" style="transform: translate3d(NaNpx,0px,0px);">
6464
<div role="tabpanel" class="min-w-0 shrink-0 basis-full ps-4"><img src="https://picsum.photos/600/600?random=1" width="300" height="300" class="rounded-lg"></div>
@@ -77,7 +77,7 @@ exports[`Carousel > renders with dots correctly 1`] = `
7777
`;
7878
7979
exports[`Carousel > renders with items correctly 1`] = `
80-
"<div role="region" aria-roledescription="carousel" tabindex="0" class="relative focus:outline-none">
80+
"<div role="region" aria-roledescription="carousel" data-orientation="horizontal" tabindex="0" class="relative focus:outline-none">
8181
<div class="overflow-hidden">
8282
<div class="flex items-start flex-row -ms-4" style="transform: translate3d(NaNpx,0px,0px);">
8383
<div role="group" aria-roledescription="slide" class="min-w-0 shrink-0 basis-full ps-4"><img src="https://picsum.photos/600/600?random=1" width="300" height="300" class="rounded-lg"></div>
@@ -93,7 +93,7 @@ exports[`Carousel > renders with items correctly 1`] = `
9393
`;
9494
9595
exports[`Carousel > renders with next correctly 1`] = `
96-
"<div role="region" aria-roledescription="carousel" tabindex="0" class="relative focus:outline-none">
96+
"<div role="region" aria-roledescription="carousel" data-orientation="horizontal" tabindex="0" class="relative focus:outline-none">
9797
<div class="overflow-hidden">
9898
<div class="flex items-start flex-row -ms-4" style="transform: translate3d(NaNpx,0px,0px);">
9999
<div role="group" aria-roledescription="slide" class="min-w-0 shrink-0 basis-full ps-4"><img src="https://picsum.photos/600/600?random=1" width="300" height="300" class="rounded-lg"></div>
@@ -118,7 +118,7 @@ exports[`Carousel > renders with next correctly 1`] = `
118118
`;
119119
120120
exports[`Carousel > renders with nextIcon correctly 1`] = `
121-
"<div role="region" aria-roledescription="carousel" tabindex="0" class="relative focus:outline-none">
121+
"<div role="region" aria-roledescription="carousel" data-orientation="horizontal" tabindex="0" class="relative focus:outline-none">
122122
<div class="overflow-hidden">
123123
<div class="flex items-start flex-row -ms-4" style="transform: translate3d(NaNpx,0px,0px);">
124124
<div role="group" aria-roledescription="slide" class="min-w-0 shrink-0 basis-full ps-4"><img src="https://picsum.photos/600/600?random=1" width="300" height="300" class="rounded-lg"></div>
@@ -143,7 +143,7 @@ exports[`Carousel > renders with nextIcon correctly 1`] = `
143143
`;
144144
145145
exports[`Carousel > renders with orientation vertical correctly 1`] = `
146-
"<div role="region" aria-roledescription="carousel" tabindex="0" class="relative focus:outline-none">
146+
"<div role="region" aria-roledescription="carousel" data-orientation="vertical" tabindex="0" class="relative focus:outline-none">
147147
<div class="overflow-hidden">
148148
<div class="flex items-start flex-col -mt-4" style="transform: translate3d(0px,NaNpx,0px);">
149149
<div role="group" aria-roledescription="slide" class="min-w-0 shrink-0 basis-full pt-4"><img src="https://picsum.photos/600/600?random=1" width="300" height="300" class="rounded-lg"></div>
@@ -159,7 +159,7 @@ exports[`Carousel > renders with orientation vertical correctly 1`] = `
159159
`;
160160
161161
exports[`Carousel > renders with prev correctly 1`] = `
162-
"<div role="region" aria-roledescription="carousel" tabindex="0" class="relative focus:outline-none">
162+
"<div role="region" aria-roledescription="carousel" data-orientation="horizontal" tabindex="0" class="relative focus:outline-none">
163163
<div class="overflow-hidden">
164164
<div class="flex items-start flex-row -ms-4" style="transform: translate3d(NaNpx,0px,0px);">
165165
<div role="group" aria-roledescription="slide" class="min-w-0 shrink-0 basis-full ps-4"><img src="https://picsum.photos/600/600?random=1" width="300" height="300" class="rounded-lg"></div>
@@ -184,7 +184,7 @@ exports[`Carousel > renders with prev correctly 1`] = `
184184
`;
185185
186186
exports[`Carousel > renders with prevIcon correctly 1`] = `
187-
"<div role="region" aria-roledescription="carousel" tabindex="0" class="relative focus:outline-none">
187+
"<div role="region" aria-roledescription="carousel" data-orientation="horizontal" tabindex="0" class="relative focus:outline-none">
188188
<div class="overflow-hidden">
189189
<div class="flex items-start flex-row -ms-4" style="transform: translate3d(NaNpx,0px,0px);">
190190
<div role="group" aria-roledescription="slide" class="min-w-0 shrink-0 basis-full ps-4"><img src="https://picsum.photos/600/600?random=1" width="300" height="300" class="rounded-lg"></div>
@@ -209,7 +209,7 @@ exports[`Carousel > renders with prevIcon correctly 1`] = `
209209
`;
210210
211211
exports[`Carousel > renders with ui correctly 1`] = `
212-
"<div role="region" aria-roledescription="carousel" tabindex="0" class="relative focus:outline-none">
212+
"<div role="region" aria-roledescription="carousel" data-orientation="horizontal" tabindex="0" class="relative focus:outline-none">
213213
<div class="overflow-hidden h-[320px]">
214214
<div class="flex items-start flex-row -ms-4" style="transform: translate3d(NaNpx,0px,0px);">
215215
<div role="group" aria-roledescription="slide" class="min-w-0 shrink-0 basis-full ps-4"><img src="https://picsum.photos/600/600?random=1" width="300" height="300" class="rounded-lg"></div>

test/components/__snapshots__/Carousel.spec.ts.snap

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

33
exports[`Carousel > renders with arrows correctly 1`] = `
4-
"<div role="region" aria-roledescription="carousel" tabindex="0" class="relative focus:outline-none">
4+
"<div role="region" aria-roledescription="carousel" data-orientation="horizontal" tabindex="0" class="relative focus:outline-none">
55
<div class="overflow-hidden">
66
<div class="flex items-start flex-row -ms-4" style="transform: translate3d(NaNpx,0px,0px);">
77
<div role="group" aria-roledescription="slide" class="min-w-0 shrink-0 basis-full ps-4"><img src="https://picsum.photos/600/600?random=1" width="300" height="300" class="rounded-lg"></div>
@@ -26,7 +26,7 @@ exports[`Carousel > renders with arrows correctly 1`] = `
2626
`;
2727
2828
exports[`Carousel > renders with as correctly 1`] = `
29-
"<nav role="region" aria-roledescription="carousel" tabindex="0" class="relative focus:outline-none">
29+
"<nav role="region" aria-roledescription="carousel" data-orientation="horizontal" tabindex="0" class="relative focus:outline-none">
3030
<div class="overflow-hidden">
3131
<div class="flex items-start flex-row -ms-4" style="transform: translate3d(NaNpx,0px,0px);">
3232
<div role="group" aria-roledescription="slide" class="min-w-0 shrink-0 basis-full ps-4"><img src="https://picsum.photos/600/600?random=1" width="300" height="300" class="rounded-lg"></div>
@@ -42,7 +42,7 @@ exports[`Carousel > renders with as correctly 1`] = `
4242
`;
4343
4444
exports[`Carousel > renders with class correctly 1`] = `
45-
"<div role="region" aria-roledescription="carousel" tabindex="0" class="relative focus:outline-none w-full max-w-xs">
45+
"<div role="region" aria-roledescription="carousel" data-orientation="horizontal" tabindex="0" class="relative focus:outline-none w-full max-w-xs">
4646
<div class="overflow-hidden">
4747
<div class="flex items-start flex-row -ms-4" style="transform: translate3d(NaNpx,0px,0px);">
4848
<div role="group" aria-roledescription="slide" class="min-w-0 shrink-0 basis-full ps-4"><img src="https://picsum.photos/600/600?random=1" width="300" height="300" class="rounded-lg"></div>
@@ -58,7 +58,7 @@ exports[`Carousel > renders with class correctly 1`] = `
5858
`;
5959
6060
exports[`Carousel > renders with dots correctly 1`] = `
61-
"<div role="region" aria-roledescription="carousel" tabindex="0" class="relative focus:outline-none">
61+
"<div role="region" aria-roledescription="carousel" data-orientation="horizontal" tabindex="0" class="relative focus:outline-none">
6262
<div class="overflow-hidden">
6363
<div class="flex items-start flex-row -ms-4" style="transform: translate3d(NaNpx,0px,0px);">
6464
<div role="tabpanel" class="min-w-0 shrink-0 basis-full ps-4"><img src="https://picsum.photos/600/600?random=1" width="300" height="300" class="rounded-lg"></div>
@@ -77,7 +77,7 @@ exports[`Carousel > renders with dots correctly 1`] = `
7777
`;
7878
7979
exports[`Carousel > renders with items correctly 1`] = `
80-
"<div role="region" aria-roledescription="carousel" tabindex="0" class="relative focus:outline-none">
80+
"<div role="region" aria-roledescription="carousel" data-orientation="horizontal" tabindex="0" class="relative focus:outline-none">
8181
<div class="overflow-hidden">
8282
<div class="flex items-start flex-row -ms-4" style="transform: translate3d(NaNpx,0px,0px);">
8383
<div role="group" aria-roledescription="slide" class="min-w-0 shrink-0 basis-full ps-4"><img src="https://picsum.photos/600/600?random=1" width="300" height="300" class="rounded-lg"></div>
@@ -93,7 +93,7 @@ exports[`Carousel > renders with items correctly 1`] = `
9393
`;
9494
9595
exports[`Carousel > renders with next correctly 1`] = `
96-
"<div role="region" aria-roledescription="carousel" tabindex="0" class="relative focus:outline-none">
96+
"<div role="region" aria-roledescription="carousel" data-orientation="horizontal" tabindex="0" class="relative focus:outline-none">
9797
<div class="overflow-hidden">
9898
<div class="flex items-start flex-row -ms-4" style="transform: translate3d(NaNpx,0px,0px);">
9999
<div role="group" aria-roledescription="slide" class="min-w-0 shrink-0 basis-full ps-4"><img src="https://picsum.photos/600/600?random=1" width="300" height="300" class="rounded-lg"></div>
@@ -118,7 +118,7 @@ exports[`Carousel > renders with next correctly 1`] = `
118118
`;
119119
120120
exports[`Carousel > renders with nextIcon correctly 1`] = `
121-
"<div role="region" aria-roledescription="carousel" tabindex="0" class="relative focus:outline-none">
121+
"<div role="region" aria-roledescription="carousel" data-orientation="horizontal" tabindex="0" class="relative focus:outline-none">
122122
<div class="overflow-hidden">
123123
<div class="flex items-start flex-row -ms-4" style="transform: translate3d(NaNpx,0px,0px);">
124124
<div role="group" aria-roledescription="slide" class="min-w-0 shrink-0 basis-full ps-4"><img src="https://picsum.photos/600/600?random=1" width="300" height="300" class="rounded-lg"></div>
@@ -143,7 +143,7 @@ exports[`Carousel > renders with nextIcon correctly 1`] = `
143143
`;
144144
145145
exports[`Carousel > renders with orientation vertical correctly 1`] = `
146-
"<div role="region" aria-roledescription="carousel" tabindex="0" class="relative focus:outline-none">
146+
"<div role="region" aria-roledescription="carousel" data-orientation="vertical" tabindex="0" class="relative focus:outline-none">
147147
<div class="overflow-hidden">
148148
<div class="flex items-start flex-col -mt-4" style="transform: translate3d(0px,NaNpx,0px);">
149149
<div role="group" aria-roledescription="slide" class="min-w-0 shrink-0 basis-full pt-4"><img src="https://picsum.photos/600/600?random=1" width="300" height="300" class="rounded-lg"></div>
@@ -159,7 +159,7 @@ exports[`Carousel > renders with orientation vertical correctly 1`] = `
159159
`;
160160
161161
exports[`Carousel > renders with prev correctly 1`] = `
162-
"<div role="region" aria-roledescription="carousel" tabindex="0" class="relative focus:outline-none">
162+
"<div role="region" aria-roledescription="carousel" data-orientation="horizontal" tabindex="0" class="relative focus:outline-none">
163163
<div class="overflow-hidden">
164164
<div class="flex items-start flex-row -ms-4" style="transform: translate3d(NaNpx,0px,0px);">
165165
<div role="group" aria-roledescription="slide" class="min-w-0 shrink-0 basis-full ps-4"><img src="https://picsum.photos/600/600?random=1" width="300" height="300" class="rounded-lg"></div>
@@ -184,7 +184,7 @@ exports[`Carousel > renders with prev correctly 1`] = `
184184
`;
185185
186186
exports[`Carousel > renders with prevIcon correctly 1`] = `
187-
"<div role="region" aria-roledescription="carousel" tabindex="0" class="relative focus:outline-none">
187+
"<div role="region" aria-roledescription="carousel" data-orientation="horizontal" tabindex="0" class="relative focus:outline-none">
188188
<div class="overflow-hidden">
189189
<div class="flex items-start flex-row -ms-4" style="transform: translate3d(NaNpx,0px,0px);">
190190
<div role="group" aria-roledescription="slide" class="min-w-0 shrink-0 basis-full ps-4"><img src="https://picsum.photos/600/600?random=1" width="300" height="300" class="rounded-lg"></div>
@@ -209,7 +209,7 @@ exports[`Carousel > renders with prevIcon correctly 1`] = `
209209
`;
210210
211211
exports[`Carousel > renders with ui correctly 1`] = `
212-
"<div role="region" aria-roledescription="carousel" tabindex="0" class="relative focus:outline-none">
212+
"<div role="region" aria-roledescription="carousel" data-orientation="horizontal" tabindex="0" class="relative focus:outline-none">
213213
<div class="overflow-hidden h-[320px]">
214214
<div class="flex items-start flex-row -ms-4" style="transform: translate3d(NaNpx,0px,0px);">
215215
<div role="group" aria-roledescription="slide" class="min-w-0 shrink-0 basis-full ps-4"><img src="https://picsum.photos/600/600?random=1" width="300" height="300" class="rounded-lg"></div>

0 commit comments

Comments
 (0)