Skip to content

Commit

Permalink
Merge branch 'main' into 2696-replace-card-button-with-link
Browse files Browse the repository at this point in the history
  • Loading branch information
klalicki committed Feb 29, 2024
2 parents 1771b61 + fc8eda3 commit 49374b0
Show file tree
Hide file tree
Showing 6 changed files with 131 additions and 198 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [7.0.0](https://github.com/trussworks/react-uswds/compare/6.2.0...7.0.0) (2024-02-22)


### ⚠ BREAKING CHANGES

* React 18 Upgrade ([#2714](https://github.com/trussworks/react-uswds/issues/2714))
* Uncouple uswds style ([#2532](https://github.com/trussworks/react-uswds/issues/2532))

### Features

* moved overlay into header component ([#2701](https://github.com/trussworks/react-uswds/issues/2701)) ([3433eac](https://github.com/trussworks/react-uswds/commit/3433eac9976b20ee6e3a76404079c23e85f84875))
* parametrized StepIndicator strings ([#2707](https://github.com/trussworks/react-uswds/issues/2707)) ([94912bd](https://github.com/trussworks/react-uswds/commit/94912bd772c69ed1dac7c6d9f59b9a1a4f337e53))
* React 18 Upgrade ([#2714](https://github.com/trussworks/react-uswds/issues/2714)) ([af2d2d6](https://github.com/trussworks/react-uswds/commit/af2d2d6445ef05675066134a6933a607ce2196a2))
* **storybook:** storybook 7 ([#2533](https://github.com/trussworks/react-uswds/issues/2533)) ([8f65ec4](https://github.com/trussworks/react-uswds/commit/8f65ec461d14db1350fc11d24d2676367d5b0294))
* Uncouple uswds style ([#2532](https://github.com/trussworks/react-uswds/issues/2532)) ([6ce4bbb](https://github.com/trussworks/react-uswds/commit/6ce4bbb1091670988691d10bb1e99725d96f10e7))


### Bug Fixes

* a11y: search component submit accessible naming ([#2737](https://github.com/trussworks/react-uswds/issues/2737)) ([b5fb85d](https://github.com/trussworks/react-uswds/commit/b5fb85d0ec17c1a02b1d4c2e373d2204342aac38))
* fixed lint warnings ([#2774](https://github.com/trussworks/react-uswds/issues/2774)) ([d4b30d8](https://github.com/trussworks/react-uswds/commit/d4b30d8e87858dc1b8e5fa424c89aa14eb5309f4))

## [6.2.0](https://github.com/trussworks/react-uswds/compare/6.1.0...6.2.0) (2024-01-08)


Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@trussworks/react-uswds",
"version": "6.2.0",
"version": "7.0.0",
"description": "React USWDS 3.0 component library",
"keywords": [
"react",
Expand Down Expand Up @@ -95,7 +95,7 @@
"focus-trap-react": "^10.2.3",
"fork-ts-checker-webpack-plugin": "^9.0.0",
"happo-plugin-storybook": "^4.1.0",
"happo.io": "^8.3.1",
"happo.io": "^9.1.2",
"jest": "^29.6.1",
"jest-environment-jsdom": "^29.6.1",
"mini-css-extract-plugin": "^2.6.1",
Expand Down
4 changes: 2 additions & 2 deletions src/components/Search/Search/Search.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ describe('Search component', () => {

it('renders a label', () => {
const mockSubmit = jest.fn()
const { queryByLabelText } = render(
const { queryAllByLabelText } = render(
<Search
onSubmit={mockSubmit}
label="Buscar"
i18n={sampleLocalization}></Search>
)

expect(queryByLabelText('Buscar')).toBeInTheDocument()
expect(queryAllByLabelText('Buscar')).toHaveLength(2)
})

it('does not render button text when small', () => {
Expand Down
4 changes: 3 additions & 1 deletion src/components/Search/Search/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ type SearchInputProps = {
placeholder?: string
label?: React.ReactNode
i18n?: SearchLocalization
buttonAriaLabel?: string
inputProps?: OptionalTextInputProps
}

Expand All @@ -31,6 +32,7 @@ export const Search = ({
label = 'Search',
inputId = 'search-field',
i18n,
buttonAriaLabel,
inputProps,
...formProps
}: SearchInputProps & OptionalFormProps): React.ReactElement => {
Expand All @@ -52,7 +54,7 @@ export const Search = ({
label={label}
defaultValue={formProps.defaultValue}
/>
<SearchButton size={size} i18n={i18n} />
<SearchButton size={size} i18n={i18n} buttonAriaLabel={buttonAriaLabel} />
</Form>
)
}
Expand Down
4 changes: 3 additions & 1 deletion src/components/Search/SearchButton/SearchButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ type SearchButtonProps = {
size?: 'big' | 'small'
className?: string
i18n?: SearchLocalization
buttonAriaLabel?: string
}

export const SearchButton = ({
size,
className,
i18n,
buttonAriaLabel,
}: SearchButtonProps): React.ReactElement => {
const buttonText = i18n?.buttonText || 'Search'
const isSmall = size === 'small'
Expand All @@ -33,7 +35,7 @@ export const SearchButton = ({
)
return (
<div className={classes}>
<Button type="submit">
<Button aria-label={buttonAriaLabel || buttonText} type="submit">
{!isSmall && (
<span className="usa-search__submit-text">{buttonText}</span>
)}
Expand Down
Loading

0 comments on commit 49374b0

Please sign in to comment.