Skip to content

feat: add support for className to FormControl.Validation #5984

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 29, 2025

Conversation

joshblack
Copy link
Member

Add support for className to FormControl.Validation

Changelog

New

  • Add support for className to FormControl.Validation

Changed

Removed

Rollout strategy

  • Minor release

@Copilot Copilot AI review requested due to automatic review settings April 29, 2025 17:01
@joshblack joshblack requested a review from a team as a code owner April 29, 2025 17:01
@joshblack joshblack requested a review from francinelucca April 29, 2025 17:01
Copy link

changeset-bot bot commented Apr 29, 2025

🦋 Changeset detected

Latest commit: 125f4b9

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

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

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

@github-actions github-actions bot added the staff Author is a staff member label Apr 29, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for a custom className prop to FormControl.Validation.

  • Updates the InputValidation component to accept and pass through a className prop using clsx.
  • Propagates the className prop in the internal FormControlValidation component.
  • Adds a test ensuring the className prop is correctly applied.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
packages/react/src/internal/components/InputValidation.tsx Allows a custom className by augmenting the component's props and using clsx to merge classes.
packages/react/src/FormControl/_FormControlValidation.tsx Passes the className prop to the InputValidation component.
packages/react/src/FormControl/tests/FormControl.Validation.test.tsx Adds a test to validate that the custom className is applied correctly.
.changeset/fine-bugs-shine.md Documents the minor release change for adding className support.

@joshblack joshblack requested a review from jonrohan April 29, 2025 17:01
@joshblack joshblack enabled auto-merge April 29, 2025 17:01
@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Apr 29, 2025
Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

Copy link
Contributor

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 99.11 KB (+0.03% 🔺)
packages/react/dist/browser.umd.js 99.46 KB (+0.08% 🔺)

@joshblack joshblack added this pull request to the merge queue Apr 29, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Apr 29, 2025
@joshblack joshblack added this pull request to the merge queue Apr 29, 2025
Merged via the queue into main with commit 103c3bf Apr 29, 2025
49 checks passed
@joshblack joshblack deleted the feat/add-class-name-to-form-validation branch April 29, 2025 20:48
@primer primer bot mentioned this pull request Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm staff Author is a staff member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants