Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

chore(accessibility): refactor types #1421

Merged
merged 5 commits into from
Jun 4, 2019

Conversation

layershifter
Copy link
Member

@layershifter layershifter commented May 29, 2019

Motivation

We should decouple types related to React implementation and keep framework agnostic stuff separately.

Breaking Changes

These types are exported publicly, so I consider these changes as breaking. All related to types naming which allows us to have more meaningful names.

  • AccessibilityBehavior => ReactAccessibilityBehavior
  • KeyboardHandler => KeyboardEventHandler
  • ActionsKeyHandler => AccessibilityKeyHandlers
  • OnKeyDownHandler => AccessibilityHandlerProps

keyboardHandlerFilter

Was renamed to shouldHandleOnKeys and refactored to be pure function. No user facing changes.

Types improments

  • Accessibility type is now generic and allows to define props strictly
  • actionsHandlers now use React.KeyboardEvent instead of KeyboardEvent, how it should be

@layershifter layershifter changed the title Refactor/accessibility types chore(accessibility): refactor types May 29, 2019
@codecov
Copy link

codecov bot commented May 29, 2019

Codecov Report

Merging #1421 into master will decrease coverage by 0.01%.
The diff coverage is 94.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1421      +/-   ##
==========================================
- Coverage   73.27%   73.26%   -0.02%     
==========================================
  Files         802      802              
  Lines        6025     6021       -4     
  Branches     1775     1774       -1     
==========================================
- Hits         4415     4411       -4     
  Misses       1604     1604              
  Partials        6        6
Impacted Files Coverage Δ
packages/react/src/index.ts 100% <ø> (ø) ⬆️
packages/react/src/components/Menu/Menu.tsx 68.57% <ø> (ø) ⬆️
packages/react/src/lib/createStardustComponent.tsx 16.66% <ø> (ø) ⬆️
...kages/react/src/components/Accordion/Accordion.tsx 95.94% <ø> (ø) ⬆️
packages/react/src/lib/createComponent.tsx 88.23% <ø> (ø) ⬆️
packages/react/src/components/Popup/Popup.tsx 67.74% <ø> (ø) ⬆️
packages/react/src/components/Embed/Embed.tsx 94.44% <ø> (ø) ⬆️
packages/react/src/components/Chat/ChatMessage.tsx 84.61% <ø> (ø) ⬆️
packages/react/src/components/Chat/Chat.tsx 62.5% <ø> (ø) ⬆️
packages/react/src/components/Tree/TreeTitle.tsx 10% <ø> (ø) ⬆️
... and 16 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f117326...7e037ca. Read the comment docs.

@layershifter layershifter merged commit 1388367 into master Jun 4, 2019
@delete-merged-branch delete-merged-branch bot deleted the refactor/accessibility-types branch June 4, 2019 08:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants