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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(react-radio): integration with react-aria radio #491

Merged
merged 4 commits into from Jun 2, 2022
Merged

refactor(react-radio): integration with react-aria radio #491

merged 4 commits into from Jun 2, 2022

Conversation

tianenpang
Copy link
Member

@tianenpang tianenpang commented May 26, 2022

馃摑 Description

Refactor Radio and integration with react-aria/radio.

馃殌 New behavior

Usage

  • Radio needs to be wrapped in the Radio.Group.

Styles

  • The border-radius will be the same as the Checkbox when isSquared.
  • Keeps RadioPoint disabled style when isChecked, isDisabled and hovered.

Keyboard Accessibility

  • Tab key to navigate to the group.
  • Arrow keys to navigate and select within the group.

Radio Props

OLD APIs NEW APIs
textColor labelColor
checked -
animated disableAnimation
squared isSquared
disabled isDisabled
preventDefault -
onChange -
... -

Radio Group Props

OLD APIs NEW APIs
textColor labelColor
value: string, number value: string
initialValue: string, number defaultValue: string
row isRow
disabled isDisabled
onChange: (e:RadioEvent) => void onChange: (value: T) => void
... -

Radio Desc Props

NEW APIs
as
css

Radio Types

OLD Types NEW Types
RadioEvent -
RadioEventTarget -

馃挘 Is this a breaking change (Yes/No):

Yes

@codecov-commenter
Copy link

codecov-commenter commented May 29, 2022

Codecov Report

Merging #491 (3ada8bb) into main (3aa92a9) will increase coverage by 0.06%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #491      +/-   ##
==========================================
+ Coverage   74.95%   75.01%   +0.06%     
==========================================
  Files         183      186       +3     
  Lines        2831     2830       -1     
  Branches      843      847       +4     
==========================================
+ Hits         2122     2123       +1     
+ Misses        698      696       -2     
  Partials       11       11              
Impacted Files Coverage 螖
packages/react/src/radio/index.ts 100.00% <100.00%> (酶)
packages/react/src/radio/radio-context.ts 100.00% <100.00%> (酶)
packages/react/src/radio/radio-desc.tsx 100.00% <100.00%> (酶)
packages/react/src/radio/radio-group.tsx 100.00% <100.00%> (酶)
packages/react/src/radio/radio.styles.ts 100.00% <100.00%> (酶)
packages/react/src/radio/radio.tsx 100.00% <100.00%> (+4.65%) 猬嗭笍
packages/react/src/radio/use-radio-group.ts 100.00% <100.00%> (酶)
packages/react/src/radio/use-radio.ts 100.00% <100.00%> (酶)

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 3aa92a9...3ada8bb. Read the comment docs.

@tianenpang tianenpang marked this pull request as ready for review May 29, 2022 14:09
@jrgarciadev jrgarciadev changed the base branch from main to next June 2, 2022 18:34
@jrgarciadev jrgarciadev added this to the 馃殌 v1.0.0-beta.8 milestone Jun 2, 2022
@jrgarciadev
Copy link
Member

Thanks a lot @tianenpang 馃檹馃徎 , excellent job!

@jrgarciadev jrgarciadev linked an issue Jun 2, 2022 that may be closed by this pull request
@jrgarciadev jrgarciadev merged commit 4fb15f0 into nextui-org:next Jun 2, 2022
@jrgarciadev jrgarciadev mentioned this pull request Jun 6, 2022
@tianenpang tianenpang deleted the refactor/radio branch December 21, 2022 09:29
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.

[Feature Request] Add label to Radio Group
3 participants