-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix VisuallyHidden to export props + move it to core
- Loading branch information
Showing
11 changed files
with
46 additions
and
45 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,35 @@ | ||
export { VisuallyHidden } from '../../components/Visually-hidden/Visually-hidden'; | ||
import React, { Component } from 'react'; | ||
import { default as styled } from 'styled-components'; | ||
import classnames from 'classnames'; | ||
import { HtmlSpan, HtmlSpanProps } from '../../reset/HtmlSpan/HtmlSpan'; | ||
|
||
export interface VisuallyHiddenProps extends HtmlSpanProps { | ||
className?: string; | ||
} | ||
|
||
const baseClassName = 'fi-visually-hidden'; | ||
|
||
const StyledVisuallyHidden = styled((props: VisuallyHiddenProps) => ( | ||
<HtmlSpan {...props} /> | ||
))` | ||
position: absolute; | ||
clip: rect(0 0 0 0); | ||
height: 1px; | ||
width: 1px; | ||
margin: -1px; | ||
padding: 0; | ||
border: 0; | ||
overflow: hidden; | ||
`; | ||
|
||
export class VisuallyHidden extends Component<VisuallyHiddenProps> { | ||
render() { | ||
const { className, ...passProps } = this.props; | ||
return ( | ||
<StyledVisuallyHidden | ||
{...passProps} | ||
className={classnames(baseClassName, className)} | ||
/> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters