USWDS - Indeterminate Checkbox: Cleanup scss and stories#5650
Conversation
There was a problem hiding this comment.
@mahoneycm thanks for the fixes. Is there an issue to tie this to? Can you add the preview links too?
Added a note related to treating this as a true variant instead of using test templates.
Update 12/5/23
I included the twig files in the I noticed other components, such as header or footer, use a nested folder pattern but each of those templates had their own |
…wds/uswds into cm-cleanup-scss-and-stories
amyleadem
left a comment
There was a problem hiding this comment.
Thanks for cleaning this up @mahoneycm. I added a question below about the need for breaking indeterminate styles into their own story. We don't currently do that for the checked state so I am curious about the reasoning. Curious to hear your thoughts.
I ran the following tests:
- Confirm
npm startruns without error - Confirm
npm run testruns without error - Confirm the
indeterminatestate styles match thecheckedstate when$theme-body-background-coloris set to a dark color (I tested with ”ink”) - Confirm that running prettier does not generate new fixes
packages/usa-checkbox/src/test/test-patterns/test-usa-multi-column-checkboxes.twig
Show resolved
Hide resolved
packages/usa-checkbox/src/usa-checkbox--indeterminate-tile.twig
Outdated
Show resolved
Hide resolved
mejiaj
left a comment
There was a problem hiding this comment.
LGTM, no issues with code.
Noting file size for the new assets:
- checkbox-indeterminate.svg -
657B - checkbox-indeterminate-alt.svg -
636B
Update 1/10/24To easily compare states, I've added a checked checkbox to the indeterminate stories. I also added a storybook control to activate an indeterminate checkbox on other stories as well. In my opinion, this follows similar patterns for other states such as the disabled state for this component. I also removed the indeterminate twig files in favor of using the standard template with the indeterminate state permanently set to true. PR summary also adjusted to remove "test" references and the decision to treat this as a variant. |
|
LGTM, thank you both |
Summary
Runs prettier and reorganizes storybook twig files to match existing variant patterns.
Breaking change
This is not a breaking change.
Related issue
Resolves #5658
Related pull requests
#5549
#5648
Preview link
Indeterminate checkbox story →
Indeterminate checkbox tile story →
Problem statement
Contributed work needed some minor adjustments to match USWDS patterns.
Solution
Major changes
Added indeterminate storybook control and stories to display the new variant.
Note
After discussion, we decided this qualified as a variant and not a test.
Testing and review
npm run lint:sassdoes not flag any failures.npm run prettierdoes not introduce any changes.