Skip to content

Commit

Permalink
Merge pull request #2812 from SUI-Components/label-a11y-demo
Browse files Browse the repository at this point in the history
docs(components/atom/label): add accessibility section on the docs
  • Loading branch information
andresin87 authored Jan 21, 2025
2 parents 58b2693 + fe3ca7e commit 85362b7
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 12 deletions.
2 changes: 1 addition & 1 deletion components/atom/actionButton/demo/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "atom-action-button-demo",
"name": "@s-ui/react-atom-action-button-demo",
"version": "1.1.0",
"description": "",
"main": "index.js",
Expand Down
24 changes: 24 additions & 0 deletions components/atom/label/demo/articles/ArticleA11y.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import {Article, Anchor, Box, Code, H2, Paragraph} from '@s-ui/documentation-library'

const ArticleA11y = ({className}: {className?: string}) => {
return (
<Article className={className}>
<H2>
Accessibility – <Anchor>Guidelines</Anchor>
</H2>
<Box style={{backgroundColor: 'color-mix(in srgb, #00FF00 10%, transparent)'}}>
<Paragraph>
✅ This component has been successfully tested for WCAG 2.0 levels A and AA, WCAG 2.1 levels A and AA and for
common accessibility best practices.
</Paragraph>
</Box>
<Paragraph>
This component is based on the native label element, it will automatically apply the correct labelling when
wrapping controls or using the <Code>htmlFor</Code> attribute. For your own custom controls to work correctly,
ensure they use native elements such as button or input as a base.
</Paragraph>
</Article>
)
}

export default ArticleA11y
3 changes: 3 additions & 0 deletions components/atom/label/demo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {H1, Paragraph} from '@s-ui/documentation-library'
import ArticleFontSize from './articles/ArticleFontSize'
import ArticleInline from './articles/ArticleInline'
import ArticleType from './articles/ArticleType'
import ArticleA11y from './articles/ArticleA11y'
import {CLASS_SECTION} from './settings'

const Demo = () => {
Expand All @@ -18,6 +19,8 @@ const Demo = () => {
<ArticleInline className={CLASS_SECTION} />
<br />
<ArticleFontSize className={CLASS_SECTION} />
<br />
<ArticleA11y className={CLASS_SECTION} />
</div>
)
}
Expand Down
22 changes: 11 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 85362b7

Please sign in to comment.