patternfly-react
patternfly-react copied to clipboard
Consume core Penta updates: Form controls, checkbox, radio
What: Closes #9931, closes #10055
Things done:
- introduced
FormGroupLabelHelpcomponent to make usinglabelIconprop simple - added some spaces next to label in FormGroup to look similar to core
Breaking changes done:
- renamed
labelIconprop in FormGroup tolabelHelp - renamed
isLabelBeforeButtonprop in Checkbox/Radio tolabelPosition?: 'start' | 'end'
Todo:
- update examples of Checkbox to show
isLabelWrappedandlabelPosition="start"(issue: https://github.com/patternfly/patternfly-react/issues/10085) - (add Form control examples in React too)
Preview: https://patternfly-react-pr-10016.surge.sh
A11y report: https://patternfly-react-pr-10016-a11y.surge.sh
I updated the labelIcon prop name to labelHelp since we're going to need to write a codemod just to mention that the markup has changed for that prop (we now wrap it in the labelHelp classname, whereas previously our examples showed that class being applied directly to a button).
- The examples to show isLabelWrapped and isLabelBeforeButton in Checkbox should be added in main since those updates were made in main.
- I don't believe we'll need to add FormControl examples since for React we have the Form Select, Text Input, and Text Area component pages
- I'd agree we could rename the isLabelBeforeButton prop in Checkbox and Radio, maybe to
labelPosition?: 'start' | 'end', as it kind of goes inline with other props where we're using those values for. But that wouldn't be a priority and maybe for a post-v6 breaking change.
I updated the
labelIconprop name tolabelHelpsince we're going to need to write a codemod just to mention that the markup has changed for that prop (we now wrap it in the labelHelp classname, whereas previously our examples showed that class being applied directly to a button).
labelHelp sounds a little incomplete to me but labelHelpButton is a little long (especially if FormGroupLabelHelpButton is updated to match) so I think this is fine. Just curious what others think.
- I'd agree we could rename the isLabelBeforeButton prop in Checkbox and Radio, maybe to
labelPosition?: 'start' | 'end', as it kind of goes inline with other props where we're using those values for. But that wouldn't be a priority and maybe for a post-v6 breaking change.
A post-v6 breaking change would mean v7, so I think we should try to clean this up now versus later (depending on the remaining v6 work priority). I do like labelPosition for consistency.
I replaced the isLabelBeforeButton prop in Checkbox/Radio based on Katie's and Eric's suggestions with labelPosition?: 'start' | 'end'
Codemod issue followup: https://github.com/patternfly/pf-codemods/issues/583
Your changes have been released in:
- @patternfly/[email protected]
- @patternfly/[email protected]
- @patternfly/[email protected]
- @patternfly/[email protected]
- @patternfly/[email protected]
- [email protected]
- @patternfly/[email protected]
Thanks for your contribution! :tada: