File tree 4 files changed +22
-3
lines changed
4 files changed +22
-3
lines changed Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div class =" sr-only" aria-label =" Loading..." role =" status" />
3
+ </template >
4
+
5
+ <style scoped>
6
+ .sr-only {
7
+ position : absolute ;
8
+ width : 1px ;
9
+ height : 1px ;
10
+ padding : 0 ;
11
+ margin : -1px ;
12
+ overflow : hidden ;
13
+ clip : rect (0 , 0 , 0 , 0 );
14
+ border : 0 ;
15
+ }
16
+ </style >
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import type { ElementScriptTrigger } from '../types'
11
11
import { scriptRuntimeConfig } from ' ../utils'
12
12
import { useScriptTriggerElement } from ' ../composables/useScriptTriggerElement'
13
13
import { useScriptGoogleMaps } from ' ../registry/google-maps'
14
+ import ScriptAriaLoadingIndicator from ' ./ScriptAriaLoadingIndicator.vue'
14
15
15
16
interface PlaceholderOptions {
16
17
width? : string | number
@@ -458,7 +459,7 @@ onBeforeUnmount(async () => {
458
459
<img v-bind =" placeholderAttrs" >
459
460
</slot >
460
461
<slot v-if =" status !== 'awaitingLoad' && !ready" name =" loading" >
461
- <ScriptLoadingIndicator color = " black " />
462
+ <ScriptAriaLoadingIndicator />
462
463
</slot >
463
464
<slot v-if =" status === 'awaitingLoad'" name =" awaitingLoad" />
464
465
<slot v-else-if =" status === 'error'" name =" error" />
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { useHead } from '@unhead/vue'
8
8
import type { ElementScriptTrigger } from ' ../types'
9
9
import { useScriptTriggerElement } from ' ../composables/useScriptTriggerElement'
10
10
import { useScriptVimeoPlayer } from ' ../registry/vimeo-player'
11
+ import ScriptAriaLoadingIndicator from ' ./ScriptAriaLoadingIndicator.vue'
11
12
12
13
interface VimeoOptions {
13
14
// copied from @types/vimeo__player
@@ -274,7 +275,7 @@ onBeforeUnmount(() => player?.unload())
274
275
<img v-if =" placeholder" v-bind =" placeholderAttrs" >
275
276
</slot >
276
277
<slot v-if =" status === 'loading'" name =" loading" >
277
- <ScriptLoadingIndicator color =" white" />
278
+ <ScriptAriaLoadingIndicator color =" white" />
278
279
</slot >
279
280
<slot v-if =" status === 'awaitingLoad'" name =" awaitingLoad" />
280
281
<slot v-else-if =" status === 'error'" name =" error" />
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { useHead } from '@unhead/vue'
7
7
import type { ElementScriptTrigger } from ' ../types'
8
8
import { useScriptTriggerElement } from ' ../composables/useScriptTriggerElement'
9
9
import { useScriptYouTubePlayer } from ' ../registry/youtube-player'
10
+ import ScriptAriaLoadingIndicator from ' ./ScriptAriaLoadingIndicator.vue'
10
11
11
12
const props = withDefaults (defineProps <{
12
13
placeholderAttrs? : ImgHTMLAttributes
@@ -178,7 +179,7 @@ const placeholderAttrs = computed(() => {
178
179
<img v-bind =" placeholderAttrs" >
179
180
</slot >
180
181
<slot v-if =" status === 'loading'" name =" loading" >
181
- <ScriptLoadingIndicator />
182
+ <ScriptAriaLoadingIndicator />
182
183
</slot >
183
184
<slot v-if =" status === 'awaitingLoad'" name =" awaitingLoad" />
184
185
<slot v-else-if =" status === 'error'" name =" error" />
You can’t perform that action at this time.
0 commit comments