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

Add MdRadioButton component #127

Merged
merged 2 commits into from
Jun 3, 2024
Merged

Add MdRadioButton component #127

merged 2 commits into from
Jun 3, 2024

Conversation

aurorascharff
Copy link
Contributor

@aurorascharff aurorascharff commented May 31, 2024

Describe your changes

Similarly to MdCheckbox and MdCheckboxGroup, MdRadioGroup needed a "single" component option, to allow for more flexibility.

In addition, clean up some old story-documentation code to follow one standard.

Example of a situation where single radiobuttons is useful (keep in mind to add your own a11y when using these solo):

image

Checklist before requesting a review

  • I have performed a self-review and test of my code
  • I have added label to the PR (major, minor or patch)
  • If new component: Is story for component created in stories-folder?
  • If new component: Is tsx-file import added to packages/react/index.tsx?
  • If new component: Is css-file added to packages/css/index.css?

@aurorascharff aurorascharff requested a review from a team as a code owner May 31, 2024 11:53
Copy link
Contributor

Please set a versioning label of either major, minor, or patch to the pull request.

@aurorascharff aurorascharff changed the title Md radiobutton Add MdRadioButton component May 31, 2024
}

/* Disabled */
.md-radiobutton--disabled:hover {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep in mind :disabled is a selector. This works with the disabled prop on an element. Any reason not to use this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy paste css from existing component. Avoiding refactoring unrelated things and follow existing structure.

Copy link
Contributor Author

@aurorascharff aurorascharff Jun 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E.g prøver å ikke henge meg opp i måten det har blitt gjort tidligere - isåfall burde det refaktorers overalt det er relevant. Men skal se på det.

const classNames = classnames(
'md-radiobutton',
{
'md-radiobutton--disabled': !!disabled,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider changing this to an element property and style via :disabled instead

Copy link
Contributor Author

@aurorascharff aurorascharff Jun 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Evt gjøre disse tingene i ny PR så man slipper å lage ulik konvenskjon på tvers av komponenter. Eks. radiobutton bruker :disabled mens radiogroup bruker --disabled. Skal se på det.

Copy link

@thomaslarsson thomaslarsson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved based on discussions

@aurorascharff aurorascharff merged commit 1fa7e3d into main Jun 3, 2024
5 checks passed
@aurorascharff aurorascharff deleted the md-radiobutton branch June 3, 2024 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants