-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(VisuallyHidden): Add VisuallyHidden component #1246
Conversation
2faaba6
to
14c3b41
Compare
Gatsby Cloud Build ReportDNB Eufemia Portal 🎉 Your build was successful! See the Deploy preview here. Build Details🕐 Build time: 10m PerformanceLighthouse report
|
14c3b41
to
fecbaf4
Compare
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit f9f53f0:
|
fecbaf4
to
77d7f04
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome! Fantastic work ✨
* Root element of the component | ||
* Default: div | ||
*/ | ||
element?: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use ReactNode here? This way its even possible to send in an existing component.
const Component = () => <div>...</div>
render(<VisuallyHidden element={Component}>hidden content</VisuallyHidden>)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great suggestion!
This has been updated 🚀
77d7f04
to
f9f53f0
Compare
# [9.22.0](v9.21.0...v9.22.0) (2022-02-09) ### Bug Fixes * **Avatar:** make the radius 100% round ([06e4133](06e4133)) * avoid Modal (dialog) from being omitted in accessibility tree ([#1205](#1205)) ([1d4d6f1](1d4d6f1)) * fix InputMasked delete key usage ([0e13054](0e13054)), closes [#1113](#1113) * **Icons:** fix svgo config ([e9326ee](e9326ee)) * **Icons:** lower icon size ([5e86696](5e86696)) * **Logo:** center logo in bounding box by using flex ([2a9eed7](2a9eed7)) * **Modal:** ensure IE11 is placing the close button to the right side ([1aab80f](1aab80f)) * **Modal:** make revalidation after Modal close work on IE11 ([c00c489](c00c489)) * **NumberUtils:** enhance missing types ([5e46814](5e46814)) * **NumberUtils:** fix IE11 issue with ([6225b9a](6225b9a)) ### Features * **Tabs:** add no_border prop ([#1279](#1279)) ([47826fd](47826fd)) * update icons: credit_note, deleted_invoice, speedometer, travel ([3b91772](3b91772)) * **Version:** run Eufemia.version in your browser console ([06e8658](06e8658)) * **VisuallyHidden:** Add VisuallyHidden component ([#1246](#1246)) ([48819d4](48819d4))
🎉 This PR is included in version 9.22.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Added
VisuallyHidden
-componentI started with using
dnb-sr-only
-class, but ended up using the thesrOnly
-mixin instead as I felt it was a "cleaner".I also added a
focusable
-option which I saw being used in other libraries like in BootstrapI'm open to suggestions as this is an initial version of the component 😊