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(components): add focus styles to all relevant components #586

Merged
merged 15 commits into from
May 5, 2020

Conversation

connor-baer
Copy link
Member

@connor-baer connor-baer commented May 3, 2020

Closes #410.

Purpose

The goal of this PR is to improve accessibility for users who prefer to navigate using their keyboard or a screen reader. Initially, I focused on the focus styles (pun intended), but there were some other low-hanging fruits that I tackled as well.

I want to thank @larimaza for doing the initial investigation and testing in #410.

Approach and changes

  • make style helpers work with Emotion's css prop (they now accept the plain theme or wrapped in an object — theme and { theme })
  • add focus outline to style helpers
  • add focus styles to Badge, Checkbox, RadioButton, Selector, Table, Tabs, Tag, and Toggle components
  • switch the cursor to pointer on hover for Checkbox, RadioButton, Select, Tabs, and Toggle components
  • make Table component keyboard and screen reader accessible

Definition of done

  • Development completed
  • Reviewers assigned
  • Unit and integration tests
  • Meets minimum browser support
  • Meets accessibility requirements

@connor-baer connor-baer added 🎨 design Requires input from designers ♿ accessibility Improves usability labels May 3, 2020
@connor-baer connor-baer added this to the v2.0 milestone May 3, 2020
@vercel
Copy link

vercel bot commented May 3, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/sumup-oss/circuit-ui/iu5snb4u4
✅ Preview: https://circuit-ui-git-feature-focus-outline.sumup-oss.now.sh

@codecov
Copy link

codecov bot commented May 3, 2020

Codecov Report

Merging #586 into alpha will increase coverage by 0.07%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##            alpha     #586      +/-   ##
==========================================
+ Coverage   93.50%   93.58%   +0.07%     
==========================================
  Files         153      153              
  Lines        2448     2477      +29     
  Branches      685      691       +6     
==========================================
+ Hits         2289     2318      +29     
  Misses        132      132              
  Partials       27       27              
Impacted Files Coverage Δ
src/components/CardList/components/Item/Item.js 100.00% <ø> (ø)
src/components/Checkbox/Checkbox.js 100.00% <ø> (ø)
src/components/Select/Select.js 100.00% <ø> (ø)
src/components/Selector/Selector.js 100.00% <ø> (ø)
src/components/Tabs/components/Tab/Tab.js 100.00% <ø> (ø)
src/util/key-codes.js 90.00% <ø> (ø)
src/components/Badge/Badge.js 100.00% <100.00%> (ø)
src/components/RadioButton/RadioButton.js 100.00% <100.00%> (ø)
...components/Table/components/SortArrow/SortArrow.js 100.00% <100.00%> (ø)
...components/Table/components/TableBody/TableBody.js 100.00% <100.00%> (ø)
... and 6 more

@connor-baer connor-baer linked an issue May 3, 2020 that may be closed by this pull request
This is just a wrapper around box-shadow. There's no benefit to turn this in to a helper.

BREAKING CHANGE:
The `shadowBorder` style helper has been removed. Use the `box-shadow` CSS property instead.

feature/focus-outline
Make sort arrows and table rows focusable, add focus styles, and trigger their onClick functions
using the keyboard.

feature/focus-outline
feature/focus-outline
@connor-baer connor-baer merged commit ad371b1 into alpha May 5, 2020
@connor-baer connor-baer deleted the feature/focus-outline branch May 5, 2020 09:34
@github-actions
Copy link
Contributor

github-actions bot commented May 5, 2020

🎉 This PR is included in version 2.0.0-alpha.16 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link
Contributor

github-actions bot commented Jun 8, 2020

🎉 This PR is included in version 2.0.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link
Contributor

🎉 This PR is included in version 2.0.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
♿ accessibility Improves usability 🎨 design Requires input from designers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure all relevant components have a focus state
2 participants