cfpb / design-system-react

A React/Storybook implementation of CFPB's Design System
https://cfpb.github.io/design-system-react/
MIT License
6 stars 4 forks source link

[Component] Checkbox #141

Closed natalia-fitzgerald closed 1 year ago

natalia-fitzgerald commented 1 year ago

Checkbox

Tracking the design and development lifecycle of the checkbox component.

Related links:

Effort level: Large

(Levels: Small, Medium, Large, Extra Large)

Definition of ready

Checklist

Definition of ready questionnaire:

Identify the use case:

Identify the current state:

Indicate which types we will include in the React component library.

Types

Definition of done

Component is fully functional

Accessibility checks have been completed

For existing components:

For new components:

Final sign off

natalia-fitzgerald commented 1 year ago

Content updates:

Things to check:

meissadia commented 1 year ago

@natalia-fitzgerald

Indicate which types we will include in the React component library.

Should each of these types be a separate story (demonstration of how to create it)? Or a separate component (a reusable implementation of this variant)? Or do we want to display them all in a single story similar to the way they are grouped in the CFPB DS?

meissadia commented 1 year ago

Separate issue to change Story names to sentence case to other components.

https://github.com/cfpb/design-stories/issues/156

natalia-fitzgerald commented 1 year ago

@meissadia Below is a checklist of Design System checklist components. In the Design System they are grouped as types and then by states.

Type: Standard checkboxes States: Default, Focused, Selected, Hover, Disabled, Disabled selected

Type: Large target area checkboxes States: Default, Focused, Selected, Hover, Disabled

I'm not sure why the large target area checkbox in the Design System live code doesn't show a Disabled selected state. I think this is an error in the live text code block because I see code for it in the HTML. So I'm going to assume we should include it in our library. I added it to the list below.

I don't know where we should incorporate the checkbox with helper text or large target checkbox with helper text. Maybe we should create a Fieldset component instead (like what's in the Design System)? There's also something called a form group. There are a number of ways we can handle this so maybe we can use this component as an example and I can post the possible approaches we can take.

Types

Standard checkboxes
Large target area checkboxes
natalia-fitzgerald commented 1 year ago

@meissadia In thinking about how we should organize and group content like checkboxes we should review/discuss the following specific examples. I will post more here as I review.

Carbon

Guidelines: https://carbondesignsystem.com/components/checkbox/usage/ Storybook: https://react.carbondesignsystem.com/?path=/docs/components-checkbox--overview

UK.gov

Guidelines: https://design-system.service.gov.uk/components/checkboxes/ Storybook: https://govuk-react.github.io/govuk-react/?path=/story/checkbox--default

VA

Guidelines: https://design.va.gov/components/form/checkbox Storybook: https://design.va.gov/storybook/?path=/docs/components-va-checkbox--default Storybook: https://design.va.gov/storybook/?path=/docs/components-va-checkbox-group--default

USWDS

Guidelines: https://designsystem.digital.gov/components/checkbox/ Storybook: https://trussworks.github.io/react-uswds/?path=/story/components-checkbox--default-checkbox

CFPB

Guidelines: https://cfpb.github.io/design-system/components/checkboxes Storybook: https://cfpb.github.io/design-stories/?path=/docs/components-checkbox--overview

meissadia commented 1 year ago

I think I like the USWDS Checkbox best with the Carbon version a close runner-up, but maybe because they're most similar to our current implementation.

It makes sense to me to have the Checkbox w/ Helper text alongside the other Checkbox variations so that users looking for what is possible with the Checkbox component have a full overview, without having to visit multiple sections of the site.

We should also show the Checkbox usage in the Fieldset section as a demonstration of how to combine the Checkbox components into more common Form input patterns. We can also add links between the Fieldset/Checkbox pages to help users grasp the difference between the two.

natalia-fitzgerald commented 1 year ago

@meissadia The USWDS Checkbox organization looks clear to me. I think it's fine to include the Checkbox with helper text in the Checkbox section. I am not aware of any actual use cases for that variation on our website but that's ok I guess.

It looks like the USWDS has a section called "Form components" and "Fieldsets" is a subsection of that. Would you want to organize things that way?

meissadia commented 1 year ago

It looks like the USWDS has a section called "Form components" and "Fieldsets" is a subsection of that. Would you want to organize things that way?

@natalia-fitzgerald That works for me, plus it aligns with the way the CFPB DS organizes them: Components > Form Elements > Fieldsets

Sidenote: PR https://github.com/cfpb/design-system-react/pull/163 adds the Disabled selected states mentioned above and fixes some styling issues with the focus/hover variants.

natalia-fitzgerald commented 1 year ago

This component has been verified. I am closing this issue.