patternfly-react icon indicating copy to clipboard operation
patternfly-react copied to clipboard

Consume core Penta updates: Form controls, checkbox, radio

Open adamviktora opened this issue 1 year ago • 4 comments
trafficstars

What: Closes #9931, closes #10055

Things done:

  • introduced FormGroupLabelHelp component to make using labelIcon prop simple
  • added some spaces next to label in FormGroup to look similar to core

Breaking changes done:

  • renamed labelIcon prop in FormGroup to labelHelp
  • renamed isLabelBeforeButton prop in Checkbox/Radio to labelPosition?: 'start' | 'end'

Todo:

  • update examples of Checkbox to show isLabelWrapped and labelPosition="start" (issue: https://github.com/patternfly/patternfly-react/issues/10085)
  • (add Form control examples in React too)

adamviktora avatar Jan 17 '24 13:01 adamviktora

Preview: https://patternfly-react-pr-10016.surge.sh

A11y report: https://patternfly-react-pr-10016-a11y.surge.sh

patternfly-build avatar Jan 17 '24 14:01 patternfly-build

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.

thatblindgeye avatar Feb 08 '24 16:02 thatblindgeye

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).

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.

kmcfaul avatar Feb 20 '24 18:02 kmcfaul

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

adamviktora avatar Feb 21 '24 13:02 adamviktora

Your changes have been released in:

Thanks for your contribution! :tada:

patternfly-build avatar Mar 26 '24 16:03 patternfly-build