Skip to content
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

Merged
merged 1 commit into from
Feb 7, 2022

Conversation

thaytharma
Copy link
Contributor

@thaytharma thaytharma commented Feb 1, 2022

Added VisuallyHidden-component

I 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 Bootstrap

I'm open to suggestions as this is an initial version of the component 😊

@thaytharma thaytharma force-pushed the feat/visually-hidden branch from 2faaba6 to 14c3b41 Compare February 1, 2022 11:36
@gatsby-cloud
Copy link

gatsby-cloud bot commented Feb 1, 2022

Gatsby Cloud Build Report

DNB Eufemia Portal

🎉 Your build was successful! See the Deploy preview here.

Build Details

View the build logs here.

🕐 Build time: 10m

Performance

Lighthouse report

Metric Score
Performance 🔶 67
Accessibility 💚 100
Best Practices 💚 100
SEO 💚 92

🔗 View full report

@thaytharma thaytharma marked this pull request as draft February 2, 2022 09:38
@thaytharma thaytharma changed the title [draft] feat(VisuallyHidden): Add VisuallyHidden component feat(VisuallyHidden): Add VisuallyHidden component Feb 2, 2022
@thaytharma thaytharma force-pushed the feat/visually-hidden branch from 14c3b41 to fecbaf4 Compare February 3, 2022 13:37
@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 3, 2022

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:

Sandbox Source
eufemia-starter Configuration

@thaytharma thaytharma force-pushed the feat/visually-hidden branch from fecbaf4 to 77d7f04 Compare February 3, 2022 13:57
@thaytharma thaytharma marked this pull request as ready for review February 3, 2022 14:43
@thaytharma thaytharma requested a review from tujoworker February 3, 2022 14:45
Copy link
Member

@tujoworker tujoworker left a 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
Copy link
Member

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>)

Copy link
Contributor Author

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 🚀

@thaytharma thaytharma force-pushed the feat/visually-hidden branch from 77d7f04 to f9f53f0 Compare February 7, 2022 12:05
@thaytharma thaytharma merged commit 48819d4 into main Feb 7, 2022
@thaytharma thaytharma deleted the feat/visually-hidden branch February 7, 2022 12:23
tujoworker pushed a commit that referenced this pull request Feb 9, 2022
# [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))
@tujoworker
Copy link
Member

🎉 This PR is included in version 9.22.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants