Visitar URL original
feat!: upgrade to USWDS 3.14.0 by mdmower-csnw · Pull Request #3634 · trussworks/react-uswds · GitHub
Skip to content

feat!: upgrade to USWDS 3.14.0 - #3634

Merged
brandonlenz merged 13 commits into
trussworks:mainfrom
mdmower-csnw:mdm-uswds-3.14
Sep 30, 2026
Merged

brandonlenz merged 13 commits into
trussworks:mainfrom
mdmower-csnw:mdm-uswds-3.14

Conversation

@mdmower-csnw

@mdmower-csnw mdmower-csnw commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Update @uswds/uswds to 3.14 and make changes to maintain parity. Each table row from USWDS release notes is covered below.

Features

Bug fixes

Guidance changes

  • Alert
    • Direct users to review USWDS 3.14 release notes.

Markup changes

  • Memorable date (DateInput in this project)
    • This mostly only affects the "Date Of Birth" storybook example. No real breaking changes need to be described, but new support for screen reader only hints could be mentioned.
  • File input
    • Differences in drag text based on whether hover and fine pointer are available are discussed in breaking changes.
  • Accordion icon alignment
    • Breaking changes mention the changed default icon position new theme setting $theme-accordion-icon-position.

Breaking changes

  • USWDS 3.14.0 required. Peer dependency is now @uswds/uswds ^3.14.0. USWDS 3.14 also changes the appearance of the accordion, breadcrumb, range slider, borderless table row headers, and file input error border. See the USWDS 3.14.0 release notes.
  • Accordion: USWDS now places the expand/collapse icon at the start (left) by default. Use the new iconPosition="end" prop, or set $theme-accordion-icon-position: "end" in your USWDS theme, to keep the previous placement.
  • BreadcrumbBar: Breadcrumbs wrap by default instead of truncating. variant="wrap" no longer has an effect and usa-breadcrumb--wrap is no longer applied. Use variant="truncate" to restore single-line truncation.
  • RangeSlider: Component RangeInput has been renamed to RangeSlider, matching USWDS naming. A new hint prop is available to render a usage hint above the slider; it is referenced by aria-describedby. Recommended text from USWDS: "Move the slider to change the value".
  • FileInput: On devices without hover and a fine pointer, the drag instruction is omitted and the text reads "Choose from folder". Customize it with the new chooseTextWithoutDrag prop. IE11 and legacy Edge user agent detection was removed. Tests asserting the exact instruction text may need updating.
  • CharacterCount: The screen reader status is empty on initial render and updates after 1200ms (was 1000ms). Over-limit announcements are prefixed with "Character limit exceeded." and use aria-live="assertive".
  • Modal: Initial focus goes to the [data-focus] element, then the first enabled button in ModalFooter, then the first enabled button in the modal, then the modal itself. The dialog has aria-hidden="true" while closed and aria-modal="true" while open. Tests that query the dialog role while it is closed need hidden: true.

Related Issues or PRs

How To Test

Confirm components behave the same as described in USWDS release notes for version 3.14.0.

Happo differences

  • Components/Accordion
    • This changeset sets the first accordion item to expanded, matching USWDS storybook.
    • The new default expansion icon is on the left now (configurable by theme setting: $theme-accordion-icon-position).
    • "Icon Start" and "Icon End" entries are new.
  • Components/Date input
    • Hint for "Date Of Birth" updated to match USWDS storybook entry "Memorable Date".
  • Components/Modal
    • Changes are a result of new auto-focus behavior for modals.
  • Components/File input
    • Changes are a result of new "choose file" messaging based on whether fine pointer exists.
  • Components/Breadcrumb
    • Current breadcrumb title matches new string from USWDS.
    • Default behavior is to wrap; entry "Wrapping Breadcrumb" became "Truncated Breadcrumb" with opposite behavior.
  • Components/Range slider
    • "Disabled" and "Aria Disabled" entries added for parity with USWDS storybook.
    • Default hint was added in this changeset. New entry "No Hint" shows slider without hint.

Author & Maintainer checklist

  • Is this is a breaking change?
    • Yes, and I accounted for the breaking changes according to the linked documentation
    • No
  • Once merged, add the PR and Issue author(s) as a contributor(s) via the all-contributors bot

- Update package `@uswds/uswds` to v3.14.0 and require minimum peer
  version of `3.14.0` as well.
- Apply all "Features" changes from USWDS 3.14 release notes:
  https://github.com/uswds/uswds/releases/tag/v3.14.0
When modal opens and initial focus is determined...
1. continue respecting the element with `[data-focus]` if it exists,
   then fall back to...
2. the first non-disabled button in the footer if it exists, then fall
   back to...
3. any non-disabled button in the modal if it exists, and finally fall
   back to...
4. the modal itself.

Update type annotations, fixing incorrect type assertion on the queried
elements. Update tests to account for the new logic.
Set `aria-hidden` to `"true"` when modal is hidden and set `aria-modal`
to `"true"` when it is visible.

Update tests.
- Add `srHint` prop to `DateInput`
  - Combine `aria-describedby` for the hint ID and a passed prop.
- Update "Date Of Birth Example" storybook to more closely mimic USWDS.
- Add tests.
- Remove IE11 and legacy Edge user agent tests as a basis for drag text
  hints. These browsers are not supported by USWDS 3.
- Switch from "hide drag text" to "show drag text" state based on
  whether `window.matchMedia()` matches `(hover: hover) and
  (pointer: fine)`.
  - Use an effect to react to media match changes.
- Support setting "choose text" for either the fine or not-fine cases.
- Use "Custom Text" storybook entry to demonstrate use of
  `chooseTextWithoutDrag`.
- Replace IE11/Edge choose text tests with new "pointer capability"
  tests.
- Skip announcement on initial render.
- When character limit is exceeded, prefix announcement with "Character
  limit exceeded."
- Delay announcements by 1200ms when validity is unchanged or when the
  count becomes invalid, avoiding unnecessary announcements if
  subsequent changes are made quick enough to cancel earlier ones.
  Quickly update announcement status when character count becomes valid.
- Use 'assertive' announcements when invalid and 'polite' when valid.
@mdmower-csnw mdmower-csnw changed the title [WIP] feat!: upgrade to USWDS 3.14.0 feat!: upgrade to USWDS 3.14.0 Sep 16, 2026
@mdmower-csnw
mdmower-csnw marked this pull request as ready for review September 16, 2026 01:33
@mdmower-csnw
mdmower-csnw requested review from a team as code owners September 16, 2026 01:33

@brandonlenz brandonlenz 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.

Thanks for this thorough set of changes to bring us to parity with USWDS 3.14.0!

Really only the "set the hint to null for a specific side effect" thing needs some attention here, IMO. Otherwise, this looks great. remarked on a few couple things that don't necessarily need to be something done in this PR.

Comment thread src/components/Accordion/Accordion.tsx Resolved
- Export `RangeInput` and `RangeInputProps` as passthroughs of
  `RangeSlider` and `RangeSliderProps`, respectively.
- Remove `RangeSlider`'s default value for `hint`
- Replace JSDoc for `hint` to recommend text

@brandonlenz brandonlenz 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.

Great work. Thank you!

@brandonlenz
brandonlenz merged commit ecacbe9 into trussworks:main Sep 30, 2026
8 checks passed
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.

2 participants