Skip to content

Commit

Permalink
fix(docs): add title to visually hidden stories (#4998)
Browse files Browse the repository at this point in the history
* fix(docs): add title to visually hidden stories

* test(vrt): update snapshots

---------

Co-authored-by: francinelucca <[email protected]>
  • Loading branch information
2 people authored and TylerJDev committed Sep 23, 2024
1 parent dbfb504 commit a21674f
Show file tree
Hide file tree
Showing 20 changed files with 12 additions and 4 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions packages/react/src/Select/Select.features.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import {Select, FormControl, Box} from '..'
import {Select, FormControl, Box, Heading} from '..'

export default {
title: 'Components/Select/Features',
Expand Down Expand Up @@ -60,8 +60,11 @@ export const WithCaption = () => (

export const VisuallyHiddenLabel = () => (
<Box as="form">
<Heading as="h2" variant="small">
Primer form title
</Heading>
<FormControl>
<FormControl.Label visuallyHidden>Default label</FormControl.Label>
<FormControl.Label visuallyHidden>Primer form label</FormControl.Label>
<Select>
<Select.Option value="one">Choice one</Select.Option>
<Select.Option value="two">Choice two</Select.Option>
Expand All @@ -70,6 +73,7 @@ export const VisuallyHiddenLabel = () => (
<Select.Option value="five">Choice five</Select.Option>
<Select.Option value="six">Choice six</Select.Option>
</Select>
<FormControl.Caption>Label is visually hidden; the title describes the purpose visually</FormControl.Caption>
</FormControl>
</Box>
)
Expand Down
8 changes: 6 additions & 2 deletions packages/react/src/TextInput/TextInput.features.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {useState} from 'react'
import {Box, FormControl, Stack} from '..'
import {Box, FormControl, Heading, Stack} from '..'
import type {TextInputProps} from '../TextInput'
import TextInput from '../TextInput'
import {CalendarIcon, CheckIcon, XCircleFillIcon} from '@primer/octicons-react'
Expand Down Expand Up @@ -31,9 +31,13 @@ export const WithCaption = () => (

export const VisuallyHiddenLabel = () => (
<Box as="form">
<Heading as="h2" variant="small">
Primer form title
</Heading>
<FormControl>
<FormControl.Label visuallyHidden>Default label</FormControl.Label>
<FormControl.Label visuallyHidden>Primer form label</FormControl.Label>
<TextInput />
<FormControl.Caption>Label is visually hidden; the title describes the purpose visually</FormControl.Caption>
</FormControl>
</Box>
)
Expand Down

0 comments on commit a21674f

Please sign in to comment.