-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consume core Penta updates: Form controls, checkbox, radio (#10016)
* feat(FormGroup): add FormGroupLabelHelp and update examples to use it * docs(FormGroup): recommend using FormGroupLabelHelp * test(FormGroup): update spaces in snapshots * Updated labelIcon prop name * Update prop in example * feat(Checkbox/Radio): replace isLabelBeforeButton flag with labelPosition "start" / "end" * test(Radio): update snapshot to v6 * docs(FormFieldGroupHeader): prop description --------- Co-authored-by: Eric Olkowski <[email protected]>
- Loading branch information
1 parent
3214a34
commit 59d2df2
Showing
21 changed files
with
133 additions
and
212 deletions.
There are no files selected for viewing
This file contains 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 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 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 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
24 changes: 24 additions & 0 deletions
24
packages/react-core/src/components/Form/FormGroupLabelHelp.tsx
This file contains 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,24 @@ | ||
import React from 'react'; | ||
import { Button, ButtonProps } from '../Button'; | ||
import QuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/question-circle-icon'; | ||
|
||
/** A help button to be passed to the FormGroup's labelHelp property. This should be wrapped or linked | ||
* to our Popover component. | ||
*/ | ||
export interface FormGroupLabelHelpProps extends ButtonProps { | ||
/** Adds an accessible name for the help button. */ | ||
'aria-label': string; | ||
/** Additional classes added to the help button. */ | ||
className?: string; | ||
} | ||
|
||
export const FormGroupLabelHelp: React.FunctionComponent<FormGroupLabelHelpProps> = ({ | ||
'aria-label': ariaLabel, | ||
className, | ||
...props | ||
}) => ( | ||
<Button aria-label={ariaLabel} className={className} variant="plain" hasNoPadding {...props}> | ||
<QuestionCircleIcon /> | ||
</Button> | ||
); | ||
FormGroupLabelHelp.displayName = 'FormGroupLabelHelp'; |
This file contains 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 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 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 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 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 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
Oops, something went wrong.