Skip to content

Commit

Permalink
feat: Update to USWDS 2.10.3 (#1106)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonlenz authored Apr 20, 2021
1 parent 1d0db77 commit c9f71d7
Show file tree
Hide file tree
Showing 13 changed files with 241 additions and 145 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"peerDependencies": {
"react": "^16.x || ^17.x",
"react-dom": "^16.x || ^17.x",
"uswds": "2.9.0"
"uswds": "2.10.3"
},
"devDependencies": {
"@babel/core": "^7.10.5",
Expand Down Expand Up @@ -126,7 +126,7 @@
"ts-jest": "^26.1.2",
"typescript": "^3.8.0",
"url-loader": "^4.0.0",
"uswds": "2.9.0",
"uswds": "2.10.3",
"webpack": "^4.41.0",
"webpack-cli": "^4.0.0"
},
Expand Down
18 changes: 15 additions & 3 deletions src/components/Footer/Footer/Footer.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export const SlimFooter = (): React.ReactElement => (
src={logoImg}
/>
}
heading={<h3 className="usa-footer__logo-heading">Name of Agency</h3>}
heading={<p className="usa-footer__logo-heading">Name of Agency</p>}
/>
}
/>
Expand Down Expand Up @@ -127,7 +127,7 @@ export const MediumFooter = (): React.ReactElement => (
src={logoImg}
/>
}
heading={<h3 className="usa-footer__logo-heading">Name of Agency</h3>}
heading={<p className="usa-footer__logo-heading">Name of Agency</p>}
/>
<div className="usa-footer__contact-links mobile-lg:grid-col-6">
<SocialLinks
Expand All @@ -150,6 +150,12 @@ export const MediumFooter = (): React.ReactElement => (
href="#">
<span>YouTube</span>
</a>,
<a
key="instagram"
className="usa-social-link usa-social-link--instagram"
href="#">
<span>Instagram</span>
</a>,
<a
key="rss"
className="usa-social-link usa-social-link--rss"
Expand Down Expand Up @@ -240,7 +246,7 @@ export const BigFooter = (): React.ReactElement => (
src={logoImg}
/>
}
heading={<h3 className="usa-footer__logo-heading">Name of Agency</h3>}
heading={<p className="usa-footer__logo-heading">Name of Agency</p>}
/>
<div className="usa-footer__contact-links mobile-lg:grid-col-6">
<SocialLinks
Expand All @@ -263,6 +269,12 @@ export const BigFooter = (): React.ReactElement => (
href="#">
<span>YouTube</span>
</a>,
<a
key="instagram"
className="usa-social-link usa-social-link--instagram"
href="#">
<span>Instagram</span>
</a>,
<a
key="rss"
className="usa-social-link usa-social-link--rss"
Expand Down
2 changes: 1 addition & 1 deletion src/components/Footer/Logo/Logo.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const Slim = (): React.ReactElement => (
image={
<img className="usa-footer__logo-img" src={logoImg} alt="Mock logo" />
}
heading={<h3 className="usa-footer__logo-heading">Name of Agency</h3>}
heading={<p className="usa-footer__logo-heading">Name of Agency</p>}
/>
</div>
)
Expand Down
2 changes: 1 addition & 1 deletion src/components/Footer/Logo/Logo.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jest.mock('../../../deprecation')
import { deprecationWarning } from '../../../deprecation'
import { Logo } from './Logo'

const heading = <h3 className="usa-footer__logo-heading">Swoosh Branding</h3>
const heading = <p className="usa-footer__logo-heading">Swoosh Branding</p>
const logoImage = (
<img
className="usa-footer__logo-img"
Expand Down
6 changes: 6 additions & 0 deletions src/components/Footer/SocialLinks/SocialLinks.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ const links = [
href="#">
<span>YouTube</span>
</a>,
<a
key="instagram"
className="usa-social-link usa-social-link--instagram"
href="#">
<span>Instagram</span>
</a>,
<a key="rss" className="usa-social-link usa-social-link--rss" href="#">
<span>RSS</span>
</a>,
Expand Down
17 changes: 14 additions & 3 deletions src/components/GovBanner/GovBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ interface GovBannerCopy {
const getCopy = (language: Language, tld: TLD): GovBannerCopy => {
const lock = (
<span className="icon-lock">
<img src={lockIcon} className="usa-banner__lock-image" alt="lock" />
{/* eslint-disable-next-line jsx-a11y/no-redundant-roles */}
<img
src={lockIcon}
className="usa-banner__lock-image"
alt="lock"
title="Lock"
role="img"
/>
</span>
)

Expand Down Expand Up @@ -154,7 +161,9 @@ export const GovBanner = ({
<img
className="usa-banner__icon usa-media-block__img"
src={dotGovIcon}
alt="Dot gov"
role="img"
alt=""
aria-hidden="true"
/>
<div className="usa-media-block__body">
<p>
Expand All @@ -168,7 +177,9 @@ export const GovBanner = ({
<img
className="usa-banner__icon usa-media-block__img"
src={httpsIcon}
alt="Https"
role="img"
alt=""
aria-hidden="true"
/>
<div className="usa-media-block__body">
<p>
Expand Down
50 changes: 40 additions & 10 deletions src/components/GovBanner/__snapshots__/GovBanner.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ exports[`GovBanner component static content renders consistently in English for
className="usa-banner__guidance tablet:grid-col-6"
>
<img
alt="Dot gov"
alt=""
aria-hidden="true"
className="usa-banner__icon usa-media-block__img"
role="img"
src="test-file-stub"
/>
<div
Expand All @@ -89,8 +91,10 @@ exports[`GovBanner component static content renders consistently in English for
className="usa-banner__guidance tablet:grid-col-6"
>
<img
alt="Https"
alt=""
aria-hidden="true"
className="usa-banner__icon usa-media-block__img"
role="img"
src="test-file-stub"
/>
<div
Expand All @@ -110,7 +114,9 @@ exports[`GovBanner component static content renders consistently in English for
<img
alt="lock"
className="usa-banner__lock-image"
role="img"
src="test-file-stub"
title="Lock"
/>
</span>
)
Expand Down Expand Up @@ -196,8 +202,10 @@ exports[`GovBanner component static content renders consistently in English for
className="usa-banner__guidance tablet:grid-col-6"
>
<img
alt="Dot gov"
alt=""
aria-hidden="true"
className="usa-banner__icon usa-media-block__img"
role="img"
src="test-file-stub"
/>
<div
Expand All @@ -220,8 +228,10 @@ exports[`GovBanner component static content renders consistently in English for
className="usa-banner__guidance tablet:grid-col-6"
>
<img
alt="Https"
alt=""
aria-hidden="true"
className="usa-banner__icon usa-media-block__img"
role="img"
src="test-file-stub"
/>
<div
Expand All @@ -241,7 +251,9 @@ exports[`GovBanner component static content renders consistently in English for
<img
alt="lock"
className="usa-banner__lock-image"
role="img"
src="test-file-stub"
title="Lock"
/>
</span>
)
Expand Down Expand Up @@ -327,8 +339,10 @@ exports[`GovBanner component static content renders consistently in Spanish for
className="usa-banner__guidance tablet:grid-col-6"
>
<img
alt="Dot gov"
alt=""
aria-hidden="true"
className="usa-banner__icon usa-media-block__img"
role="img"
src="test-file-stub"
/>
<div
Expand All @@ -351,8 +365,10 @@ exports[`GovBanner component static content renders consistently in Spanish for
className="usa-banner__guidance tablet:grid-col-6"
>
<img
alt="Https"
alt=""
aria-hidden="true"
className="usa-banner__icon usa-media-block__img"
role="img"
src="test-file-stub"
/>
<div
Expand All @@ -372,7 +388,9 @@ exports[`GovBanner component static content renders consistently in Spanish for
<img
alt="lock"
className="usa-banner__lock-image"
role="img"
src="test-file-stub"
title="Lock"
/>
</span>
)
Expand Down Expand Up @@ -459,8 +477,10 @@ exports[`GovBanner component static content renders consistently in Spanish for
className="usa-banner__guidance tablet:grid-col-6"
>
<img
alt="Dot gov"
alt=""
aria-hidden="true"
className="usa-banner__icon usa-media-block__img"
role="img"
src="test-file-stub"
/>
<div
Expand All @@ -483,8 +503,10 @@ exports[`GovBanner component static content renders consistently in Spanish for
className="usa-banner__guidance tablet:grid-col-6"
>
<img
alt="Https"
alt=""
aria-hidden="true"
className="usa-banner__icon usa-media-block__img"
role="img"
src="test-file-stub"
/>
<div
Expand All @@ -504,7 +526,9 @@ exports[`GovBanner component static content renders consistently in Spanish for
<img
alt="lock"
className="usa-banner__lock-image"
role="img"
src="test-file-stub"
title="Lock"
/>
</span>
)
Expand Down Expand Up @@ -591,8 +615,10 @@ exports[`GovBanner component static content renders consistently with default pr
className="usa-banner__guidance tablet:grid-col-6"
>
<img
alt="Dot gov"
alt=""
aria-hidden="true"
className="usa-banner__icon usa-media-block__img"
role="img"
src="test-file-stub"
/>
<div
Expand All @@ -615,8 +641,10 @@ exports[`GovBanner component static content renders consistently with default pr
className="usa-banner__guidance tablet:grid-col-6"
>
<img
alt="Https"
alt=""
aria-hidden="true"
className="usa-banner__icon usa-media-block__img"
role="img"
src="test-file-stub"
/>
<div
Expand All @@ -636,7 +664,9 @@ exports[`GovBanner component static content renders consistently with default pr
<img
alt="lock"
className="usa-banner__lock-image"
role="img"
src="test-file-stub"
title="Lock"
/>
</span>
)
Expand Down
12 changes: 10 additions & 2 deletions src/components/forms/ComboBox/ComboBox.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,16 @@ export const withLabel = (): React.ReactElement => {

return (
<Form onSubmit={noop}>
<Label htmlFor="fruit">Select A Fruit</Label>
<ComboBox id="fruit" name="fruit" options={fruitList} onChange={noop} />
<Label id="fruit-label" htmlFor="fruit">
Select A Fruit
</Label>
<ComboBox
id="fruit"
name="fruit"
options={fruitList}
onChange={noop}
ulProps={{ 'aria-labelledby': 'fruit-label' }}
/>
</Form>
)
}
Expand Down
Loading

0 comments on commit c9f71d7

Please sign in to comment.