Skip to content

(PDS-40) Radiobutton Component #215

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

Merged
merged 3 commits into from
Feb 20, 2020
Merged

(PDS-40) Radiobutton Component #215

merged 3 commits into from
Feb 20, 2020

Conversation

jilliankeenan
Copy link
Contributor

@jilliankeenan jilliankeenan commented Feb 12, 2020

  • Adding Radiobutton Component
  • Fixing issue where check icon isn't the correct color when in error state

Previous

Screenshot 2020-02-12 at 11 00 26

After

Screenshot 2020-02-12 at 11 08 26

@jilliankeenan jilliankeenan requested a review from a team as a code owner February 12, 2020 10:59
@jilliankeenan jilliankeenan requested review from a team and removed request for a team February 12, 2020 11:01
@jilliankeenan jilliankeenan changed the title PDS 40 PDS-40 Radiobutton Component Feb 12, 2020
@vine77 vine77 changed the title PDS-40 Radiobutton Component (PDS-40) Radiobutton Component Feb 19, 2020
@Sigler
Copy link
Contributor

Sigler commented Feb 19, 2020

Looks great! Just got to see it in action.

Thank you for capturing that fix for the error state checkmark as well.

Copy link
Contributor

@vine77 vine77 left a comment

Choose a reason for hiding this comment

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

This looks awesome! Thanks for doing this work @jilliankeenan.

If we want that docs example to be interactive, I think we could use React Hooks like this:

const exampleStyle = { marginRight: 10 };
const [value, setValue] = React.useState(0);

<div>
  <RadioButton
    name="radiobutton-ex-unchecked"
    label="Unchecked"
    style={exampleStyle}
    value={value === 0}
    onChange={() => setValue(0)}
  />
  <RadioButton
    name="radiobutton-ex-checked"
    label="Checked"
    style={exampleStyle}
    value={value === 1}
    onChange={() => setValue(1)}
  />
  <RadioButton
    name="radiobutton-ex-disabled"
    label="Disabled"
    style={exampleStyle}
    value={value === 2}
    onChange={() => setValue(2)}
    disabled
  />
  <RadioButton
    name="radiobutton-ex-error"
    label="Error"
    style={exampleStyle}
    value={value === 3}
    onChange={() => setValue(3)}
    error
  />
</div>;

@jilliankeenan jilliankeenan merged commit 615d4ff into puppetlabs:master Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request react-components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants