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

Visually hidden component #593

Merged
merged 10 commits into from
Oct 17, 2023

Conversation

bjarnef
Copy link
Contributor

@bjarnef bjarnef commented Oct 3, 2023

Description

Often in the current Umbraco backoffice we had something like this to provide information to screen readers, but not visually hidden to users.

<span class="sr-only">
   <localize key="general_close">Close</localize>
</span>

https://github.com/umbraco/Umbraco-CMS/blob/511ee96c9e0c54480b5350fa0bcabe693bdc1e0a/src/Umbraco.Web.UI.Client/src/views/components/umb-lightbox.html#L7-L9C12

Inspired by the https://shoelace.style/components/visually-hidden component, I think it would be useful to have a <uui-visually-hidden> component.

<uui-visually-hidden>
    Something here...
</uui-visually-hidden>

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (minor updates related to the tooling or maintenance of the repository, does not impact compiled assets)

Motivation and context

How to test?

Screenshots (if appropriate)

Checklist

  • If my change requires a change to the documentation, I have updated the documentation in this pull request.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@github-actions
Copy link

github-actions bot commented Oct 3, 2023

Hi there @bjarnef, thank you for this contribution! 👍

While we wait for the team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:

  • It's clear what problem this is solving, there's a connected issue or a description of what the changes do and how to test them
  • The automated tests all pass (see "Checks" tab on this PR)
  • The level of security for this contribution is the same or improved
  • The level of performance for this contribution is the same or improved
  • Avoids creating breaking changes; note that behavioral changes might also be perceived as breaking
  • If this is a new feature, Umbraco HQ provided guidance on the implementation beforehand
  • 💡 The contribution looks original and the contributor is presumably allowed to share it

Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution.

If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@bjarnef
Copy link
Contributor Author

bjarnef commented Oct 3, 2023

@iOvergaard npm run new-package generates the following:
https://github.com/umbraco/Umbraco.UI/blob/v1/contrib/docs/CONTRIBUTING.md#how-to-get-started

export * from '@umbraco-ui/uui-visually-hidden/lib/index.js';

but the rest of the packages just includes:

export * from '@umbraco-ui/[package]/lib';

@iOvergaard
Copy link
Contributor

@bjarnef that is technically a better way to export es modules. We probably need to change the whole library to use that style at some point. I don't know if it brings any value at this point, so feel free to change it back to the same style as the rest of the imports.

I think you need to run prettier to make the tests pass, though, and could you perhaps add some more context in the README so people know why the component is useful? Shoelace has a wonderful description on their page for why it's important with such a component.

@bjarnef
Copy link
Contributor Author

bjarnef commented Oct 6, 2023

@iOvergaard regarding description do you think it need to add additional description after "Umbraco style visually-hidden component." or just change/update this text?

I have run prettier, but some of this format was actually formatted when running npm run new-package e.g. the space after the interface HTMLElementTagNameMap name here:
3128d35#diff-3db6849b8b6fe8429e9dcca736545456bc3593548d5f57fade24e20d0457927dR32

The build error doesn't seem to be related to this component though?

image

@iOvergaard iOvergaard merged commit 875d46e into umbraco:v1/contrib Oct 17, 2023
5 of 7 checks passed
@bjarnef bjarnef deleted the feature/visually-hidden branch October 17, 2023 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants