Skip to content

Commit d9853de

Browse files
feat(components): [VisuallyHidden] implements
1 parent 2593b38 commit d9853de

File tree

5 files changed

+33
-2
lines changed

5 files changed

+33
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ Enter the component you want most in the components, leave the emojis and follow
7070
| [FocusScope](https://vue-primitives.netlify.app/?path=/story/utilities-focusscope--basic) ||
7171
| Menu | 🚧 |
7272
| [Popper](https://vue-primitives.netlify.app/?path=/story/utilities-popper--styled) ||
73-
| Portal | 🚧 |
73+
| Portal | |
7474
| [Presence](https://vue-primitives.netlify.app/?path=/story/utilities-presence--basic) ||
7575
| Primitives ||
7676
| [RovingFocusGroup](https://vue-primitives.netlify.app/?path=/story/utilities-rovingfocusgroup--basic) ||
7777
| Slot ||
78-
| VisuallyHidden | 🚧 |
78+
| [VisuallyHidden](https://vue-primitives.netlify.app/?path=/story/utilities-visuallyhidden--basic) | |
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<script setup lang="ts">
2+
import { Primitive } from '../primitive/index.ts'
3+
4+
defineOptions({
5+
name: 'VisuallyHidden',
6+
})
7+
</script>
8+
9+
<template>
10+
<Primitive style="position: absolute; border: 0; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; word-wrap: normal;">
11+
<slot />
12+
</Primitive>
13+
</template>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as VisuallyHidden } from './VisuallyHidden.vue'
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<script setup lang="ts">
2+
import { VisuallyHidden } from '../index.ts'
3+
</script>
4+
5+
<template>
6+
<button>
7+
<VisuallyHidden>Save the file</VisuallyHidden>
8+
<span aria-hidden>💾</span>
9+
</button>
10+
</template>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import CBasic from './Basic.vue'
2+
3+
export default { title: 'Utilities/VisuallyHidden' }
4+
5+
export function Basic() {
6+
return CBasic
7+
}

0 commit comments

Comments
 (0)