-
Notifications
You must be signed in to change notification settings - Fork 638
Allows asterisk in FormControl.Label
to be adjustable
#4543
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
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
ad64388
Add new props to `FormControl.Label`
TylerJDev 3ab4b1e
Add conditional
TylerJDev 413ac1e
Add changeset
TylerJDev add9be3
Update docs json
TylerJDev fc84578
Add more examples
TylerJDev 4d31493
Merge branch 'main' into form-control-required-indicator
TylerJDev 78d7033
chore(deps-dev): bump ejs from 3.1.9 to 3.1.10 (#4549)
dependabot[bot] 5ee837c
BranchName: Add style for span and add v8 tokens (#4556)
lukasoppermann 60dc115
refactor(Banner): update region to use a dedicated aria-label (#4539)
joshblack 58bd238
chore(deps-dev): bump cross-env from 7.0.2 to 7.0.3 (#4561)
dependabot[bot] 8a33d1a
chore(deps-dev): bump @babel/plugin-transform-modules-commonjs (#4562)
dependabot[bot] 35d55bd
chore(deps-dev): bump jest-fail-on-console from 3.1.1 to 3.2.0 (#4563)
dependabot[bot] 5dd5603
feat(FeatureFlags): broaden feature flag type to accept undefined (#4…
joshblack f73f461
prevent form submit (#4551)
siddharthkp 8d4b60d
deprecate title prop on ActionList.Group component on docs (#4544)
broccolinisoup dad8950
chore: add hydro analytics to storybook (#4558)
joshblack e6a173b
Revert "Revert "Add support for nested submenus to `ActionMenu`"" (#4…
iansan5653 5f29736
chore(deps): update typescript to 5.4.5 (#4568)
joshblack 741a6a5
Use dynamic height and width for dialogs (#4567)
dgreif 6bb1726
Make asterisk default, update story scenarios
TylerJDev 5aa4144
Merge branch 'main' into form-control-required-indicator
TylerJDev 0d0b531
Merge branch 'main' into form-control-required-indicator
TylerJDev afe895d
Update packages/react/src/FormControl/FormControl.docs.json
TylerJDev be9b4a6
Update packages/react/src/internal/components/InputLabel.tsx
TylerJDev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@primer/react': patch | ||
--- | ||
|
||
FormControl: Adds new props to `FormControl.Label`, `requiredText` and `requiredIndicator` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if this might be better handled on
<FormControl>
itself, as to apply the required indicator settings to all labels that exist within. The main con here is that there could be cases where you'd only want to adjust one of the indicators, not all.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes sense to me to add this to the
FormControl.Label
🤔 Because that's where the indicator is. I could see users wanting to be able to set a defaultrequiredText
for an entire form but it looks like there's noForm
element so that's not really possible. I guess in that instance an engineer would probably create a custom component which inherits from theFormControl.Label
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I agree! I think if there's truly value here we could come back to it, but for now I think handling it on
FormControl.Label
is good enough.