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

[Feature] Move toggle to core #434

Merged
merged 10 commits into from
Feb 9, 2021
Merged

Conversation

aappoalander
Copy link
Contributor

@aappoalander aappoalander commented Feb 2, 2021

Description

This PR removes Toggle components level implementation and introduces various improvements and changes to the component:

  • Toggle now uses AutoId
  • Toggle input and button variants are now separate components with shared base
  • Static variants are no longer supported
  • Wrapper div added for better styling support.

Motivation and Context

Toggle button had unstyled version which was not working properly and added unnecessary maintenance burden. In addition, use of uuid prevented SSR from working properly. Also, the use cases for these components, as well as the APIs are somewhat different, so having button and input as variants of the same component makes no sense.

How Has This Been Tested?

Tested with Mac OS VoiceOver and NVDA + Windows using Chrome, Firefox, Safari and Edge. Tested using a CRA test project, styleguidist and SSR test project.

Release notes

Toggle

  • Breaking Changes:
    • Changed:
      • ToggleButton onClick parameter type is now boolean instead of { toggleState: boolean }
    • Removed:
      • variant support. <Toggle.withInput> or no longer work. Use ToggleButton and ToggleInput components instead.
      • toggleInputProps
      • toggleInputComponent
      • onClick from ToggleInput, use onChange instead
      • Additional props are now passed for button and input elements.
  • Added support for wrapperProps to support styling better.
  • Added support for AutoId to support Server Side Rendering

@aappoalander aappoalander added enhancement New feature or request DX Refactoring for maintainability labels Feb 2, 2021
@aappoalander aappoalander self-assigned this Feb 2, 2021
@aappoalander aappoalander force-pushed the feature/move-toggle-to-core branch from 40120b2 to 67b1519 Compare February 5, 2021 08:14
ketsappi
ketsappi previously approved these changes Feb 9, 2021
@aappoalander aappoalander merged commit 67276ea into develop Feb 9, 2021
@aappoalander aappoalander deleted the feature/move-toggle-to-core branch March 22, 2021 07:43
@aappoalander aappoalander mentioned this pull request Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX Refactoring for maintainability enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants