Skip to content

Commit

Permalink
Merge branch 'V2' into bl-deprecate-modal-breaking-787
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonlenz authored Mar 15, 2021
2 parents d15062f + 8521933 commit 5e87f28
Show file tree
Hide file tree
Showing 29 changed files with 2,418 additions and 906 deletions.
133 changes: 133 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
{
"projectName": "react-uswds",
"projectOwner": "trussworks",
"repoType": "github",
"repoHost": "https://github.com",
"files": [
"README.md"
],
"imageSize": 100,
"commit": true,
"commitConvention": "none",
"contributors": [
{
"login": "suzubara",
"name": "Suzanne Rozier",
"avatar_url": "https://avatars.githubusercontent.com/u/2723066?v=4",
"profile": "https://github.com/suzubara",
"contributions": [
"code",
"doc"
]
},
{
"login": "haworku",
"name": "haworku",
"avatar_url": "https://avatars.githubusercontent.com/u/10750442?v=4",
"profile": "https://github.com/haworku",
"contributions": [
"code"
]
},
{
"login": "ahobson",
"name": "Andrew Hobson",
"avatar_url": "https://avatars.githubusercontent.com/u/21983?v=4",
"profile": "https://github.com/ahobson",
"contributions": [
"code"
]
},
{
"login": "gidjin",
"name": "John Gedeon",
"avatar_url": "https://avatars.githubusercontent.com/u/940173?v=4",
"profile": "https://github.com/gidjin",
"contributions": [
"code"
]
},
{
"login": "eamahanna",
"name": "Emily Mahanna",
"avatar_url": "https://avatars.githubusercontent.com/u/56279459?v=4",
"profile": "https://github.com/eamahanna",
"contributions": [
"code"
]
},
{
"login": "brandonlenz",
"name": "Brandon Lenz",
"avatar_url": "https://avatars.githubusercontent.com/u/15805554?v=4",
"profile": "https://github.com/brandonlenz",
"contributions": [
"code"
]
},
{
"login": "sojeri",
"name": "Jeri Sommers",
"avatar_url": "https://avatars.githubusercontent.com/u/10818509?v=4",
"profile": "https://github.com/sojeri",
"contributions": [
"code"
]
},
{
"login": "tinyels",
"name": "Erin Stanfill",
"avatar_url": "https://avatars.githubusercontent.com/u/3142631?v=4",
"profile": "https://github.com/tinyels",
"contributions": [
"code"
]
},
{
"login": "esacteksab",
"name": "Barry Morrison",
"avatar_url": "https://avatars.githubusercontent.com/u/689591?v=4",
"profile": "http://www.barrymorrison.com/",
"contributions": [
"code"
]
},
{
"login": "duncan-truss",
"name": "Duncan",
"avatar_url": "https://avatars.githubusercontent.com/u/52669884?v=4",
"profile": "https://github.com/duncan-truss",
"contributions": [
"code"
]
},
{
"login": "SirenaBorracha",
"name": "Arianna Kellogg",
"avatar_url": "https://avatars.githubusercontent.com/u/16230705?v=4",
"profile": "https://github.com/SirenaBorracha",
"contributions": [
"code"
]
},
{
"login": "christopherhuii",
"name": "Christopher Hui",
"avatar_url": "https://avatars.githubusercontent.com/u/8367504?v=4",
"profile": "https://github.com/christopherhuii",
"contributions": [
"code"
]
},
{
"login": "jim",
"name": "Jim Benton",
"avatar_url": "https://avatars.githubusercontent.com/u/3331?v=4",
"profile": "http://pandasguide.com/",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7
}
16 changes: 16 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,22 @@ jobs:

- run: yarn lint
- run: yarn danger ci --failOnErrors
- run:
name: Create GitHub Deployment
command: ./scripts/deployment_start.sh > deployment
- run:
name: Build Storybook
command: yarn run build-storybook
- store_artifacts:
path: storybook-static
- run:
name: Add GitHub Deployment success status
command: ./scripts/deployment_stop.sh success
when: on_success
- run:
name: Add GitHub Deployment error status
command: ./scripts/deployment_stop.sh error
when: on_fail

workflows:
build:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/semantic_pr.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Lint PR

on:
pull_request:
pull_request_target:
types: [opened, edited, synchronize]
branches:
- main
- sr-update-semantic-pr-config

jobs:
lint:
Expand Down
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,46 @@

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.

### [1.13.2](https://github.com/trussworks/react-uswds/compare/1.13.1...1.13.2) (2021-03-11)


### Bug Fixes

* ComboBox "keyboard trap" and misc bugs ([#1010](https://github.com/trussworks/react-uswds/issues/1010)) ([50aef22](https://github.com/trussworks/react-uswds/commit/50aef22b3dcccad7da165e023bb05fe921e0af98))

### [1.13.1](https://github.com/trussworks/react-uswds/compare/1.13.0...1.13.1) (2021-03-08)


### Bug Fixes

* set CombBox focusMode to BLUR when focus is outside of the component ([#989](https://github.com/trussworks/react-uswds/issues/989)) ([fa468a0](https://github.com/trussworks/react-uswds/commit/fa468a00275c9646d43ff55fb50468c033d25ad5))

## [1.13.0](https://github.com/trussworks/react-uswds/compare/1.12.2...1.13.0) (2021-02-26)


### Features

* File Input component ([#900](https://github.com/trussworks/react-uswds/issues/900)) ([e1ccbcd](https://github.com/trussworks/react-uswds/commit/e1ccbcd0b0c0cc3ec80cd8f0fa38afd09b29ecfa))


### Documentation & Examples

* Add All-Contributors section to README ([#954](https://github.com/trussworks/react-uswds/issues/954)) ([fe23df1](https://github.com/trussworks/react-uswds/commit/fe23df1acb2de244ac45ee5f1f797a1229203822))

### [1.12.2](https://github.com/trussworks/react-uswds/compare/1.12.1...1.12.2) (2021-02-22)


### Bug Fixes

* add ActionType.CLEAR_FOCUS to indicate a user has left the field ([#902](https://github.com/trussworks/react-uswds/issues/902)) ([58159d7](https://github.com/trussworks/react-uswds/commit/58159d7430016bb88ab2fba33ab1984e0aebed66))

### [1.12.1](https://github.com/trussworks/react-uswds/compare/1.12.0...1.12.1) (2021-02-22)


### Bug Fixes

* Revert husky to V4 ([#923](https://github.com/trussworks/react-uswds/issues/923)) ([e934ff7](https://github.com/trussworks/react-uswds/commit/e934ff76a58cdbc523eef0a3c496fe2d20c02c73))

## [1.12.0](https://github.com/trussworks/react-uswds/compare/1.11.0...1.12.0) (2021-02-18)


Expand Down
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# @trussworks/react-uswds
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-13-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

[![npm version](https://img.shields.io/npm/v/@trussworks/react-uswds)](https://www.npmjs.com/package/@trussworks/react-uswds)
[![CircleCI](https://img.shields.io/circleci/build/github/trussworks/react-uswds/develop)](https://circleci.com/gh/trussworks/react-uswds)
Expand Down Expand Up @@ -126,3 +129,37 @@ distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="https://github.com/suzubara"><img src="https://avatars.githubusercontent.com/u/2723066?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Suzanne Rozier</b></sub></a><br /><a href="https://github.com/trussworks/react-uswds/commits?author=suzubara" title="Code">💻</a> <a href="https://github.com/trussworks/react-uswds/commits?author=suzubara" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/haworku"><img src="https://avatars.githubusercontent.com/u/10750442?v=4?s=100" width="100px;" alt=""/><br /><sub><b>haworku</b></sub></a><br /><a href="https://github.com/trussworks/react-uswds/commits?author=haworku" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/ahobson"><img src="https://avatars.githubusercontent.com/u/21983?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Andrew Hobson</b></sub></a><br /><a href="https://github.com/trussworks/react-uswds/commits?author=ahobson" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/gidjin"><img src="https://avatars.githubusercontent.com/u/940173?v=4?s=100" width="100px;" alt=""/><br /><sub><b>John Gedeon</b></sub></a><br /><a href="https://github.com/trussworks/react-uswds/commits?author=gidjin" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/eamahanna"><img src="https://avatars.githubusercontent.com/u/56279459?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Emily Mahanna</b></sub></a><br /><a href="https://github.com/trussworks/react-uswds/commits?author=eamahanna" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/brandonlenz"><img src="https://avatars.githubusercontent.com/u/15805554?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Brandon Lenz</b></sub></a><br /><a href="https://github.com/trussworks/react-uswds/commits?author=brandonlenz" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/sojeri"><img src="https://avatars.githubusercontent.com/u/10818509?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jeri Sommers</b></sub></a><br /><a href="https://github.com/trussworks/react-uswds/commits?author=sojeri" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/tinyels"><img src="https://avatars.githubusercontent.com/u/3142631?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Erin Stanfill</b></sub></a><br /><a href="https://github.com/trussworks/react-uswds/commits?author=tinyels" title="Code">💻</a></td>
<td align="center"><a href="http://www.barrymorrison.com/"><img src="https://avatars.githubusercontent.com/u/689591?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Barry Morrison</b></sub></a><br /><a href="https://github.com/trussworks/react-uswds/commits?author=esacteksab" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/duncan-truss"><img src="https://avatars.githubusercontent.com/u/52669884?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Duncan</b></sub></a><br /><a href="https://github.com/trussworks/react-uswds/commits?author=duncan-truss" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/SirenaBorracha"><img src="https://avatars.githubusercontent.com/u/16230705?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Arianna Kellogg</b></sub></a><br /><a href="https://github.com/trussworks/react-uswds/commits?author=SirenaBorracha" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/christopherhuii"><img src="https://avatars.githubusercontent.com/u/8367504?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Christopher Hui</b></sub></a><br /><a href="https://github.com/trussworks/react-uswds/commits?author=christopherhuii" title="Code">💻</a></td>
<td align="center"><a href="http://pandasguide.com/"><img src="https://avatars.githubusercontent.com/u/3331?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jim Benton</b></sub></a><br /><a href="https://github.com/trussworks/react-uswds/commits?author=jim" title="Code">💻</a></td>
</tr>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
10 changes: 5 additions & 5 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-router-dom": "^5.2.0",
"yup": "^0.32.8"
"yup": "^0.32.9"
},
"scripts": {
"start": "SKIP_PREFLIGHT_CHECK=true react-app-rewired start",
Expand All @@ -35,18 +35,18 @@
},
"devDependencies": {
"@testing-library/jest-dom": "^5.11.9",
"@testing-library/react": "^11.2.2",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^12.7.1",
"@types/jest": "^26.0.20",
"@types/node": "^14.14.25",
"@types/node": "^14.14.31",
"@types/react": "^17.0.2",
"@types/react-dom": "^17.0.1",
"@types/react-router-dom": "^5.1.7",
"@types/yup": "^0.29.11",
"customize-cra": "^1.0.0",
"react-app-rewired": "^2.1.8",
"react-scripts": "^4.0.2",
"typescript": "~4.1.3"
"react-scripts": "^4.0.3",
"typescript": "~4.1.5"
},
"jest": {
"moduleNameMapper": {
Expand Down
49 changes: 46 additions & 3 deletions example/src/pages/Forms.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import React, { useRef } from 'react'
import { Field, Formik } from 'formik'
import * as Yup from 'yup'
import {
Expand All @@ -12,6 +12,7 @@ import {
ValidationChecklist,
ValidationItem,
DatePicker,
FileInput,
} from '@trussworks/react-uswds'

type FormValues = {
Expand Down Expand Up @@ -44,6 +45,8 @@ const fruitOptions = Object.entries(fruits).map(([value, key]) => ({
}))

const FormsPage = (): React.ReactElement => {
const fileInputRef = useRef<HTMLInputElement>(null)

return (
<>
<h1>Forms Examples</h1>
Expand All @@ -55,12 +58,14 @@ const FormsPage = (): React.ReactElement => {
password: '',
fruit: 'avocado',
appointmentDate: '1/20/2021',
file: '',
attachments: [],
}}
validationSchema={FormSchema}
onSubmit={(values, { setSubmitting }) => {
console.log('Submit form data:', values)
setTimeout(() => {
alert(JSON.stringify(values, null, 2))

console.log('Submit complete!')
setSubmitting(false)
}, 400)
}}>
Expand Down Expand Up @@ -151,6 +156,44 @@ const FormsPage = (): React.ReactElement => {
/>
</FormGroup>

<FormGroup>
<Label htmlFor="file">File input (single)</Label>
<FileInput
id="file"
name="file"
onChange={(e: React.ChangeEvent): void => {
const event = e as React.ChangeEvent<HTMLInputElement>

if (event.target.files?.length) {
setFieldValue('file', event.target.files[0])
}
}}
/>
</FormGroup>

<FormGroup>
<Label htmlFor="attachments">File input (multiple)</Label>
<FileInput
id="attachments"
name="attachments"
multiple
onChange={(e: React.ChangeEvent): void => {
const event = e as React.ChangeEvent<HTMLInputElement>
const files = []
if (event.target.files?.length) {
for (let i = 0; i < event.target.files?.length; i++) {
files.push(event.target.files[i])
}
}
setFieldValue('attachments', files)
}}
onDrop={(e: React.DragEvent): void => {
console.log('handle drop', e)
}}
inputRef={fileInputRef}
/>
</FormGroup>

<Button type="submit" disabled={isSubmitting}>
Submit
</Button>
Expand Down
Loading

0 comments on commit 5e87f28

Please sign in to comment.