diff --git a/packages/react-core/src/components/Wizard/WizardBody.tsx b/packages/react-core/src/components/Wizard/WizardBody.tsx index 56688070a7c..b0c3e9153ad 100644 --- a/packages/react-core/src/components/Wizard/WizardBody.tsx +++ b/packages/react-core/src/components/Wizard/WizardBody.tsx @@ -10,9 +10,11 @@ import { getResizeObserver } from '../../helpers/resizeObserver'; * Used as a wrapper for WizardStep content, where the wrapping element is customizable. */ -export interface WizardBodyProps { +export interface WizardBodyProps extends React.HTMLProps { /** Anything that can be rendered in the Wizard body */ children: React.ReactNode; + /** Additional classes spread to the wizard body */ + className?: string; /** Flag to remove the default body padding */ hasNoPadding?: boolean; /** Adds an accessible name to the wrapper element when the content overflows and renders @@ -29,10 +31,12 @@ export interface WizardBodyProps { export const WizardBody = ({ children, + className, hasNoPadding = false, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, - component = 'div' + component = 'div', + ...props }: WizardBodyProps) => { const [hasScrollbar, setHasScrollbar] = React.useState(false); const [previousWidth, setPreviousWidth] = React.useState(undefined); @@ -74,7 +78,8 @@ export const WizardBody = ({ {...(shouldFocusContent && { tabIndex: -1 })} {...(component === 'div' && hasScrollbar && { role: 'region' })} {...(hasScrollbar && { 'aria-label': defaultAriaLabel, 'aria-labelledby': ariaLabelledBy, tabIndex: 0 })} - className={css(styles.wizardMain)} + className={css(styles.wizardMain, className)} + {...props} >
{children}
diff --git a/packages/react-core/src/components/Wizard/WizardFooter.tsx b/packages/react-core/src/components/Wizard/WizardFooter.tsx index bd4596dc477..05ce38d53fb 100644 --- a/packages/react-core/src/components/Wizard/WizardFooter.tsx +++ b/packages/react-core/src/components/Wizard/WizardFooter.tsx @@ -5,12 +5,11 @@ import styles from '@patternfly/react-styles/css/components/Wizard/wizard'; import { Button, ButtonVariant } from '../Button'; import { isCustomWizardFooter, WizardFooterButtonProps, WizardStepType } from './types'; - /** * Hosts the standard structure of a footer with ties to the active step so that text for buttons can vary from step to step. */ -export interface WizardFooterProps { +export interface WizardFooterProps extends React.HTMLProps { /** The active step */ activeStep: WizardStepType; /** Next button callback */ @@ -39,18 +38,23 @@ export interface WizardFooterProps { backButtonProps?: Omit; /** Additional props for the Cancel button. */ cancelButtonProps?: WizardFooterButtonProps; + /** Additional classes spread to the wizard footer */ + className?: string; } /** * Applies default wizard footer styling any number of child elements. */ -interface WizardFooterWrapperProps { +interface WizardFooterWrapperProps extends React.HTMLProps { children: React.ReactNode; + className?: string; } -export const WizardFooterWrapper = ({ children }: WizardFooterWrapperProps) => ( -
{children}
+export const WizardFooterWrapper = ({ children, className, ...props }: WizardFooterWrapperProps) => ( +
+ {children} +
); export const WizardFooter = ({ activeStep, ...internalProps }: WizardFooterProps) => { @@ -71,9 +75,11 @@ const InternalWizardFooter = ({ cancelButtonText = 'Cancel', nextButtonProps, backButtonProps, - cancelButtonProps + cancelButtonProps, + className, + ...props }: Omit) => ( - + {!isBackHidden && (