Skip to content

Input field components - text, checkbox, radio - #1611

Merged
mperrotti merged 74 commits into
mainfrom
mp/form-field-component
Dec 17, 2021
Merged

Input field components - text, checkbox, radio#1611
mperrotti merged 74 commits into
mainfrom
mp/form-field-component

Conversation

@mperrotti

@mperrottimperrotti commented Nov 16, 2021

Copy link
Copy Markdown
Contributor

This component renders input along with its label, validation content, and hint content. It will correctly associate labels and other related content with the input.

Screenshots

Value input
Screen Shot 2021-11-15 at 8 04 37 PM

Toggle (radio/checkbox) input
Screen Shot 2021-11-15 at 8 10 53 PM

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

ClosesPrimer issue #480

@mperrotti
mperrotti requested review from a team and pksjceNovember 16, 2021 01:18
@changeset-bot

changeset-botBot commented Nov 16, 2021

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ad9e954

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
NameType
@primer/reactMinor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment threadsrc/utils/use-force-update.tsx Outdated
@mperrotti
mperrotti marked this pull request as draft November 16, 2021 01:23
Comment threadsrc/InputLabel.tsx Outdated
@mperrottimperrotti mentioned this pull request Nov 16, 2021
6 tasks
@github-actions

github-actionsBot commented Nov 22, 2021

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
dist/browser.esm.js58.92 KB (+4.6% 🔺)
dist/browser.umd.js59.25 KB (+4.54% 🔺)

@mperrottimperrotti changed the title [WIP] Form field componentInput field components - text, checkbox, radioNov 23, 2021
@mperrotti
mperrotti marked this pull request as ready for review November 23, 2021 22:49
Co-authored-by: Rez <rezrah@github.com>
Comment threaddocs/content/InputField.mdx Outdated
Comment threadsrc/__tests__/ChoiceInputField.test.tsx Outdated
Comment threaddocs/content/ChoiceInputField.mdx Outdated

<!--
TODO: add `validationStatus` examples when we have the validation styling done
-->

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.

Do we need this? ☝️

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we could get rid of it

Comment threaddocs/content/ChoiceInputField.mdx Outdated
import {ChoiceInputField, Checkbox, Radio} from '@primer/react'
import {MarkGithubIcon} from '@primer/octicons-react'
import {ComponentChecklist} from '../src/component-checklist'
import {PropsTable} from '../src/props-table'

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.

Some of these imports may not be needed anymore

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll see what I can get rid of. When I excluded the PropsTable import, it caused a deployment error in Vercel.

Co-authored-by: Rez <rezrah@github.com>
)
const results = await axe(container)
expect(results).toHaveNoViolations()
cleanup()

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.

Might be worth running cleanup and jest.clearAllMocks(); on an afterEach block at the top of the test suite, as you're using spy a fair bit here

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

💥 nice one @mperrotti

@mperrotti
mperrotti merged commit 11382ee into mainDec 17, 2021
@mperrotti
mperrotti deleted the mp/form-field-component branch December 17, 2021 19:28
@primer-cssprimer-css mentioned this pull request Dec 17, 2021
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@mperrotti@siddharthkp@rezrah@langermank