Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: trussworks/react-uswds
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.17.0
Choose a base ref
...
head repository: trussworks/react-uswds
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2.0.0
Choose a head ref
Loading
Showing with 4,558 additions and 2,118 deletions.
  1. +8 −7 .circleci/config.yml
  2. +4 −3 .happo.js
  3. +29 −0 CHANGELOG.md
  4. +1 −1 docs/adding_new_components.md
  5. +5 −8 example/package.json
  6. +1 −1 example/src/App.test.tsx
  7. +1 −8 example/src/App.tsx
  8. +1 −9 example/src/index.tsx
  9. +2 −2 example/src/pages/Example.tsx
  10. +0 −98 example/src/pages/Modals.tsx
  11. +0 −30 example/src/redux/actions.test.ts
  12. +0 −16 example/src/redux/actions.tsx
  13. +0 −34 example/src/redux/reducer.test.ts
  14. +0 −36 example/src/redux/reducers.ts
  15. +0 −24 example/src/redux/types.ts
  16. +0 −1 example/src/routes.js
  17. +337 −336 example/yarn.lock
  18. +8 −0 jest.config.js
  19. +9 −8 package.json
  20. +4 −0 src/components/Accordion/Accordion.stories.tsx
  21. +71 −0 src/components/Accordion/Accordion.test.tsx
  22. +13 −3 src/components/Accordion/Accordion.tsx
  23. +460 −0 src/components/Collection/Collection.stories.tsx
  24. +33 −0 src/components/Collection/Collection.test.tsx
  25. +24 −0 src/components/Collection/Collection.tsx
  26. +19 −0 src/components/Collection/CollectionCalendarDate.test.tsx
  27. +46 −0 src/components/Collection/CollectionCalendarDate.tsx
  28. +42 −0 src/components/Collection/CollectionDescription.test.tsx
  29. +15 −0 src/components/Collection/CollectionDescription.tsx
  30. +61 −0 src/components/Collection/CollectionHeading.test.tsx
  31. +20 −0 src/components/Collection/CollectionHeading.tsx
  32. +34 −0 src/components/Collection/CollectionItem.test.tsx
  33. +22 −0 src/components/Collection/CollectionItem.tsx
  34. +51 −0 src/components/Collection/CollectionMeta.test.tsx
  35. +16 −0 src/components/Collection/CollectionMeta.tsx
  36. +46 −0 src/components/Collection/CollectionMetaItem.test.tsx
  37. +16 −0 src/components/Collection/CollectionMetaItem.tsx
  38. +74 −0 src/components/Collection/CollectionMetaItemTag.test.tsx
  39. +27 −0 src/components/Collection/CollectionMetaItemTag.tsx
  40. +55 −0 src/components/Collection/CollectionThumbnail.test.tsx
  41. +13 −0 src/components/Collection/CollectionThumbnail.tsx
  42. +1 −1 src/components/Footer/Address/Address.stories.tsx
  43. +1 −1 src/components/Footer/Footer/Footer.stories.tsx
  44. +2 −2 src/components/Footer/FooterExtendedNavList/FooterExtendedNavList.test.tsx
  45. +1 −1 src/components/Footer/FooterNav/FooterNav.stories.tsx
  46. +1 −1 src/components/Footer/Logo/Logo.stories.tsx
  47. +1 −1 src/components/Footer/SocialLinks/SocialLinks.stories.tsx
  48. +58 −52 src/components/Identifier/Identifier/Identifier.stories.tsx
  49. +60 −54 src/components/Identifier/Identifier/Identifier.test.tsx
  50. +1 −1 src/components/Identifier/IdentifierMasthead/IdentifierMasthead.tsx
  51. +0 −53 src/components/Modal/Modal.module.scss
  52. +0 −154 src/components/Modal/Modal.stories.tsx
  53. +0 −74 src/components/Modal/Modal.test.tsx
  54. +0 −106 src/components/Modal/Modal.tsx
  55. +9 −1 src/components/SiteAlert/SiteAlert.stories.tsx
  56. +11 −3 src/components/Table/Table.stories.tsx
  57. +1 −2 src/components/Tooltip/Tooltip.test.tsx
  58. +31 −61 src/components/card/Card.stories.tsx
  59. +2 −2 src/components/forms/CharacterCount/CharacterCount.stories.tsx
  60. +2 −2 src/components/forms/Checkbox/Checkbox.stories.tsx
  61. +33 −7 src/components/forms/ComboBox/ComboBox.stories.tsx
  62. +201 −13 src/components/forms/ComboBox/ComboBox.test.tsx
  63. +366 −292 src/components/forms/ComboBox/ComboBox.tsx
  64. +75 −28 src/components/forms/ComboBox/{useCombobox.ts → useComboBox.ts}
  65. +37 −0 src/components/forms/ComboBox/utils.ts
  66. +2 −2 src/components/forms/DateInput/DateInput.stories.tsx
  67. +15 −6 src/components/forms/DatePicker/Calendar.stories.tsx
  68. +10 −3 src/components/forms/DatePicker/DatePicker.stories.tsx
  69. +2 −1 src/components/forms/DatePicker/DatePicker.test.tsx
  70. +31 −13 src/components/forms/DatePicker/Day.stories.tsx
  71. +11 −3 src/components/forms/DatePicker/MonthPicker.stories.tsx
  72. +18 −5 src/components/forms/DatePicker/YearPicker.stories.tsx
  73. +17 −6 src/components/forms/DateRangePicker/DateRangePicker.stories.tsx
  74. +2 −2 src/components/forms/Dropdown/Dropdown.stories.tsx
  75. +23 −9 src/components/forms/FileInput/FileInput.stories.tsx
  76. +55 −2 src/components/forms/FileInput/FileInput.test.tsx
  77. +179 −145 src/components/forms/FileInput/FileInput.tsx
  78. +1 −1 src/components/forms/FileInput/FilePreview.stories.tsx
  79. +6 −1 src/components/forms/FileInput/FilePreview.tsx
  80. +2 −2 src/components/forms/Radio/Radio.stories.tsx
  81. +2 −2 src/components/forms/RangeInput/RangeInput.stories.tsx
  82. +2 −2 src/components/forms/TextInput/TextInput.stories.tsx
  83. +2 −2 src/components/forms/Textarea/Textarea.stories.tsx
  84. +17 −4 src/components/forms/TimePicker/TimePicker.stories.tsx
  85. +143 −3 src/components/forms/TimePicker/TimePicker.test.tsx
  86. +3 −6 src/components/forms/TimePicker/TimePicker.tsx
  87. +8 −4 src/components/forms/TimePicker/constants.ts
  88. +2 −2 src/components/forms/Validation/Validation.stories.tsx
  89. +6 −8 src/components/grid/GridContainer/GridContainer.tsx
  90. +12 −11 src/index.ts
  91. +14 −0 src/serverSideTest.js
  92. +375 −0 src/stories/templates/createaccount.stories.tsx
  93. +313 −0 src/stories/templates/mutliplesignin.stories.tsx
  94. +277 −0 src/stories/templates/signin.stories.tsx
  95. +546 −336 yarn.lock
15 changes: 8 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -2,10 +2,10 @@ version: 2.1
jobs:
build:
docker:
- auth:
password: $DOCKER_PASSWORD
username: $DOCKER_USERNAME
image: circleci/node:14.15.3
- auth:
password: $DOCKER_PASSWORD
username: $DOCKER_USERNAME
image: circleci/node:14.15.3
working_directory: ~/react-uswds
steps:
- checkout
@@ -21,7 +21,9 @@ jobs:
- ~/.cache/yarn
key: v1-yarn-{{ checksum "yarn.lock" }}

- run: yarn test -w 1
- run: yarn test:coverage -w 1

- run: yarn test:serverside

- run:
name: 'Happo'
@@ -54,5 +56,4 @@ workflows:
jobs:
- build:
context:
- org-global

- org-global
7 changes: 4 additions & 3 deletions .happo.js
Original file line number Diff line number Diff line change
@@ -14,9 +14,10 @@ module.exports = {
firefox: new RemoteBrowserTarget('firefox', {
viewport: '1024x768',
}),
edge: new RemoteBrowserTarget('edge', {
viewport: '1024x768',
}),
// happo has too many false postive diffs with edge to use it
// edge: new RemoteBrowserTarget('edge', {
// viewport: '1024x768',
// }),
'internet explorer': new RemoteBrowserTarget('internet explorer', {
viewport: '1024x768',
}),
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,35 @@

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.

## [2.0.0](https://github.com/trussworks/react-uswds/compare/1.17.0...2.0.0) (2021-06-15)


### ⚠ BREAKING CHANGES

* Expose FileInput component ref with a clearFiles method (#1165)
* Expose ComboBox component ref with a clearSelection method (#1236)
* **deps-dev:** Update Typescript to 4.0+ (#1214)
* Modal component has been removed. The USWDS Modal will be added when reaching parity with USWDS 2.11.x
* Accordion component default behavior was updated to match USWDS. To continue to use the multiselectable behavior, use the multiselectable prop.

### Features

* Collection Component ([#1133](https://github.com/trussworks/react-uswds/issues/1133)) ([cdc200f](https://github.com/trussworks/react-uswds/commit/cdc200f5e084c5d63723ce4cf5dbb40252d6b2f5))
* Deprecate the Modal component ([#956](https://github.com/trussworks/react-uswds/issues/956)) ([7ae4e30](https://github.com/trussworks/react-uswds/commit/7ae4e30cf240af917fc66128e6dc8a047271c6de))
* Expose ComboBox component ref with a clearSelection method ([#1236](https://github.com/trussworks/react-uswds/issues/1236)) ([e90e4df](https://github.com/trussworks/react-uswds/commit/e90e4df9bdb55a217174e551dabb9e6535c384b8))
* Expose FileInput component ref with a clearFiles method ([#1165](https://github.com/trussworks/react-uswds/issues/1165)) ([0bc0b54](https://github.com/trussworks/react-uswds/commit/0bc0b54a2d38e789554d9ba4af57b9f854f002fc))
* Update Accordion component default behavior to match USWDS ([#922](https://github.com/trussworks/react-uswds/issues/922)) ([c063047](https://github.com/trussworks/react-uswds/commit/c063047a86551539bba3664d2ceb591e1d50971f))


### Bug Fixes

* Fix TimePicker filter behavior. Misc ComboBox Fixes ([#1139](https://github.com/trussworks/react-uswds/issues/1139)) ([c684844](https://github.com/trussworks/react-uswds/commit/c68484418a3e53d3b4ed98c5eb66e3522f81a475))
* Update storybook form control organization and SWDS URLs ([#1136](https://github.com/trussworks/react-uswds/issues/1136)) ([bfd7344](https://github.com/trussworks/react-uswds/commit/bfd73443732e78fd06841bf5d36a2e83fdb08bd2))
* Use embedded images for storybook ([#1265](https://github.com/trussworks/react-uswds/issues/1265)) ([#1266](https://github.com/trussworks/react-uswds/issues/1266)) ([61abd79](https://github.com/trussworks/react-uswds/commit/61abd7933a3ed9fa7fedeba6857e1417c0c51770))


* **deps-dev:** Update Typescript to 4.0+ ([#1214](https://github.com/trussworks/react-uswds/issues/1214)) ([f632744](https://github.com/trussworks/react-uswds/commit/f632744b566a4da8e7f27499af51ee18e55516b8))

## [1.17.0](https://github.com/trussworks/react-uswds/compare/1.16.0...1.17.0) (2021-05-05)


2 changes: 1 addition & 1 deletion docs/adding_new_components.md
Original file line number Diff line number Diff line change
@@ -68,7 +68,7 @@ There is a significant difference between thinking about the component props in
### Common Components in `react-uswds`

- Components that apply uswds styles to a standard HTMLElement - `Button`, `Table`
- Components that encapsulate user interaction flows - `Accordion`, `Modal`
- Components that encapsulate user interaction flows - `Accordion`
- Components for a common gov tech use case - `Search`, `SocialLinks`
- Components that render children - `Card`, `Header`, `Footer`
- Components related to forms, especially form inputs - `DateInput`, `TextInput` `Checkbox`, `Label`
13 changes: 5 additions & 8 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -10,9 +10,7 @@
"formik": "^2.2.6",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-redux": "^7.2.4",
"react-router-dom": "^5.2.0",
"redux": "^4.0.5",
"yup": "^0.32.9"
},
"scripts": {
@@ -36,14 +34,13 @@
]
},
"devDependencies": {
"@testing-library/jest-dom": "^5.12.0",
"@testing-library/react": "^11.2.6",
"@testing-library/user-event": "^13.0.16",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^13.1.9",
"@types/jest": "^26.0.23",
"@types/node": "^14.14.31",
"@types/react": "^17.0.4",
"@types/react-dom": "^17.0.3",
"@types/react-redux": "^7.1.16",
"@types/react": "^17.0.11",
"@types/react-dom": "^17.0.7",
"@types/react-router-dom": "^5.1.7",
"@types/yup": "^0.29.11",
"customize-cra": "^1.0.0",
2 changes: 1 addition & 1 deletion example/src/App.test.tsx
Original file line number Diff line number Diff line change
@@ -5,5 +5,5 @@ import App from './App';
// TODO Add additional app testing
test('renders the app without error', () => {
const { getByText } = render(<App />)
expect(getByText('Modals')).toBeInTheDocument()
expect(getByText('Examples')).toBeInTheDocument()
})
9 changes: 1 addition & 8 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
@@ -20,7 +20,6 @@ import {

import HomePage from './pages/Home'
import ExamplePage from './pages/Example'
import ModalsPage from './pages/Modals'
import FormsPage from './pages/Forms'
import IconsPage from './pages/Icons'
import { Routes } from './routes'
@@ -29,7 +28,7 @@ import './App.css'

const App = () => {
const [mobileNavOpen, setMobileNavOpen] = useState(false)
const { HOME_PAGE, EXAMPLES_PAGE, MODALS_PAGE, FORMS_PAGE, ICONS_PAGE } = Routes
const { HOME_PAGE, EXAMPLES_PAGE, FORMS_PAGE, ICONS_PAGE } = Routes

const toggleMobileNav = (): void => {
setMobileNavOpen((prevOpen) => !prevOpen)
@@ -42,9 +41,6 @@ const App = () => {
<NavLink to={EXAMPLES_PAGE} activeClassName="usa-current">
Examples
</NavLink>,
<NavLink to={MODALS_PAGE} activeClassName="usa-current">
Modals
</NavLink>,
<NavLink to={ICONS_PAGE} activeClassName="usa-current">
Icons
</NavLink>,
@@ -81,9 +77,6 @@ const App = () => {
<Route path={EXAMPLES_PAGE}>
<ExamplePage />
</Route>
<Route path={MODALS_PAGE}>
<ModalsPage />
</Route>
<Route path={ICONS_PAGE}>
<IconsPage />
</Route>
10 changes: 1 addition & 9 deletions example/src/index.tsx
Original file line number Diff line number Diff line change
@@ -3,19 +3,11 @@ import ReactDOM from 'react-dom'
import './index.css'
import App from './App'
import * as serviceWorker from './serviceWorker'
import { createStore } from 'redux'
import { Provider } from 'react-redux'

import { rootReducer } from './redux/reducers'

const store = createStore(rootReducer)

ReactDOM.render(
<Provider store={store}>
<React.StrictMode>
<App />
</React.StrictMode>
</Provider>,
</React.StrictMode>,
document.getElementById('root')
)

4 changes: 2 additions & 2 deletions example/src/pages/Example.tsx
Original file line number Diff line number Diff line change
@@ -20,11 +20,11 @@ const ExamplePage = (): React.ReactElement => (
</li>
<li>
<USWDSLink
to="/modals"
to="/icons"
asCustom={Link}
variant="external"
target="_blank">
Modals
Icons
</USWDSLink>
</li>
</ul>
98 changes: 0 additions & 98 deletions example/src/pages/Modals.tsx

This file was deleted.

30 changes: 0 additions & 30 deletions example/src/redux/actions.test.ts

This file was deleted.

16 changes: 0 additions & 16 deletions example/src/redux/actions.tsx

This file was deleted.

34 changes: 0 additions & 34 deletions example/src/redux/reducer.test.ts

This file was deleted.

Loading