Visitar URL original
USWDS 3.1.0 by thisisdano · Pull Request #4904 · uswds/uswds · GitHub
Skip to content

USWDS 3.1.0 - #4904

Merged
thisisdano merged 184 commits into
mainfrom
release-3.1.0
Aug 5, 2022
Merged

thisisdano merged 184 commits into
mainfrom
release-3.1.0

Conversation

@thisisdano

@thisisdano thisisdano commented Aug 5, 2022 •

Copy link
Copy Markdown
Contributor

What's new in USWDS 3.1.0

This release contains markup changes and potentially breaking changes. A ⚠️ icon indicates where we've made a change that might be a breaking change for your project.

Package updates

usa-button

Style aria-disabled to match disabled. Now disabled styling is applied whether you use disabled (disabled and hidden from screen readers) or aria-disabled (disabled and visible to screen readers). (#4783)

This also affects these dependent or related packages:

  • usa-button-group
  • usa-card
  • usa-modal

⚠️ Added type="button" to all non-form buttons to prevent default submit behaviors. This allowed us to remove preventDefault() from the relevant component JS.

This is a potentially breaking change. Teams should update all non-form buttons to include type="button" in their markup. <button> elements that do not receive a defined type attribute will inherit type="submit" behaviors by default. This can cause unintended and undesired behavior in our buttons. Resource: Details on button types (Mozilla) (#4695)

This also affects these dependent or related packages:

  • usa-accordion
  • usa-banner
  • usa-card
  • usa-header
  • usa-navbar
  • usa-modal
  • usa-nav
  • usa-sidenav

usa-button-group

Unstyled buttons in a button group now have proper baseline alignment. (#4812)

usa-checkbox

Style aria-disabled to match disabled. Now disabled styling is applied whether you use disabled (disabled and hidden from screen readers) or aria-disabled (disabled and visible to screen readers). (#4783)

usa-date-picker

Style aria-disabled to match disabled. Now disabled styling is applied whether you use disabled (disabled and hidden from screen readers) or aria-disabled (disabled and visible to screen readers). (#4783)

usa-date-range-picker

Updated documentation to properly show how to disable dates. Our documentation provided incorrect information about where to add data-min-date and data-max-date attributes to the date range picker component. Add these attributes to the usa-date-range-picker element. (uswds/uswds-site#1605)

Style aria-disabled to match disabled. Now disabled styling is applied whether you use disabled (disabled and hidden from screen readers) or aria-disabled (disabled and visible to screen readers). (#4783)

usa-header

Fixed mobile menu appearance for different CSS layouts. The menu now appears properly on layouts using flex or CSS grid. (#4817)

usa-hero

Optimize hero image. We replaced our default hero image (644 KB PNG) with an optimized image (147 KB JPG), saving 477 KB. We've also provided a next-generation image format version of the image (105 KB WEBP) as an example.

⚠️ This changes the value of $theme-hero-image. If your project uses this default hero image, you'll need to make sure to move the new asset (hero.jpg) to your project images directory.

Setting Old default New default
$theme-hero-image "#{general.$theme-image-path}/hero.png" "#{general.$theme-image-path}/hero.jpg"

usa-icon

Added LinkedIn icon. We now have a LinkedIn icon included in our default icon sprite as linkedin.

⚠️ Use unmodified social media icons. We now provide simpler social media icons, and removed any decoration not in the original icon. This means that the new icons are not in an enclosing circle unless the original icon is enclosed in a circle. (#4872)

This also affects these dependent or related packages:

  • usa-footer

usa-password

⚠️ Updated markup in the usa-password package to use a <button> element instead of an anchor element. This markup is more semantically appropriate for the related on-page user interaction.

This is not a breaking change. The old markup is still supported, but teams should consider updating to the new markup for improved semantics. (#4847)

Old

<p class="usa-form__note">
  <a href="#" class="usa-show-multipassword" aria-controls="password confirmPassword"
    data-hide-text="Hide my typing">Show my typing</a>
</p>

New

<button type="button" 
  class="usa-show-password usa-button usa-button--unstyled" 
  aria-controls="password confirmPassword"
  data-hide-text="Hide my typing">Show my typing</button>

usa-radio

Style aria-disabled to match disabled. Now disabled styling is applied whether you use disabled (disabled and hidden from screen readers) or aria-disabled (disabled and visible to screen readers). (#4783)

usa-select

Improved styling for select when the multiple attribute is present. According to the HTML5 standard, a select element whose multiple attribute is present is "expected to render as an inline-block box whose height is the height necessary to contain as many rows for items as given by the element's display size, or four rows if the [size] attribute is absent." Our select now conforms to this guidance. (#4766)

uswds-core

Style aria-disabled to match disabled. Now disabled styling is applied whether you use disabled (disabled and hidden from screen readers) or aria-disabled (disabled and visible to screen readers). (#4783)

uswds-utilities

Integrated the CSS aspect-ratio property into our add-aspect utility and mixins. This change aligns us more closely with expected CSS behavior, while also extending the capabilities of add-aspect. Users can now apply add-aspect directly to media and media wrappers — without the need to use .usa-embed-container. This update is backwards compatible and was written to preserve previous behavior for browsers that do not support the CSS aspect-ratio property. (#4811)

Dependency updates

No dependency updates.

0 vulnerabilities in regular dependencies (dependencies for USWDS projects installed with npm install uswds)

Internal only: 3 moderate, 32 high vulnerabilities in devDependencies (development dependencies)

Release TGZ SHA-256 hash: 727a1883badb336f67f6f355e8fdf7ace9af871ca8af7dbb231b2e3cc7649a9b

Charlie Mahoney and others added 30 commits May 9, 2022 15:50
- Changes affect screen readers only
- packages/usa-validation/src/index.js now adds hidden "incomplete" span on initialization
- validate-input.js targets hidden data attribute for list items and sets complete/incomplete labels as necessary.
- Turning Multiple to true adds multiple and size attributes to markdown (twig)
- Setting size to 0 defaults in 4 row height as standard for multiple select when size is absent
Updates the validation component's unit test and JS. The new hidden span
is created by traversing the parent of validation input until it finds the
checklist.

Previously it looked for the first validation checklist, which causes problems
when the component init's outside of document.body

- Replace `select` with `selectOrMatches` to get proper elem context
- Create constants for validation input and checklist item
- Create function for hidden label span
- Restores select to it's original settings
@thisisdano
thisisdano requested review from amyleadem and mejiaj August 5, 2022 16:26
@thisisdano
thisisdano marked this pull request as ready for review August 5, 2022 16:26
USWDS - HTMLProofer update broken links
@thisisdano
thisisdano marked this pull request as draft August 5, 2022 16:29
@thisisdano

Copy link
Copy Markdown
Contributor Author

Updated with most recent merge to develop but this did not affect the contents of the distribution package or the hash.

@thisisdano
thisisdano marked this pull request as ready for review August 5, 2022 16:35

@amyleadem amyleadem left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me!

Note: I made one small copy edit in the description changing "HTML 5" to "HTML5"

@thisisdano
thisisdano marked this pull request as draft August 5, 2022 20:09
@thisisdano

Copy link
Copy Markdown
Contributor Author

Reverting changes to usa-checklist since it's failing accessibility checks.

@thisisdano
thisisdano marked this pull request as ready for review August 5, 2022 21:09
@thisisdano
thisisdano requested a review from amyleadem August 5, 2022 21:13
@thisisdano

Copy link
Copy Markdown
Contributor Author

Updated hash: 727a1883badb336f67f6f355e8fdf7ace9af871ca8af7dbb231b2e3cc7649a9b

@thisisdano
thisisdano requested a review from mejiaj August 5, 2022 21:18

@amyleadem amyleadem left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good on my checks

@thisisdano
thisisdano merged commit 728ba78 into main Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants