@@ -39,32 +39,38 @@ const defaultLabels = {
3939 next : 'Next'
4040} ;
4141
42- const Layout = ( { nav, fields } ) => (
42+ const Layout = ( { nav, fields, WizardBodyProps } ) => (
4343 < React . Fragment >
4444 { nav }
45- { fields }
45+ < div { ...WizardBodyProps } className = { clsx ( 'ddorg__carbon-wizard-body' , WizardBodyProps ?. className ) } >
46+ { fields }
47+ </ div >
4648 </ React . Fragment >
4749) ;
4850
4951Layout . propTypes = {
5052 nav : PropTypes . node ,
51- fields : PropTypes . node
53+ fields : PropTypes . node ,
54+ WizardBodyProps : PropTypes . object
5255} ;
5356
54- const VerticalLayout = ( { nav, fields } ) => (
57+ const VerticalLayout = ( { nav, fields, WizardBodyProps } ) => (
5558 < Grid narrow >
5659 < Row >
5760 < Column sm = { 1 } md = { 2 } lg = { 3 } >
5861 { nav }
5962 </ Column >
60- < Column > { fields } </ Column >
63+ < Column { ...WizardBodyProps } className = { clsx ( 'ddorg__carbon-wizard-body' , WizardBodyProps ?. className ) } >
64+ { fields }
65+ </ Column >
6166 </ Row >
6267 </ Grid >
6368) ;
6469
6570VerticalLayout . propTypes = {
6671 nav : PropTypes . node ,
67- fields : PropTypes . node
72+ fields : PropTypes . node ,
73+ WizardBodyProps : PropTypes . object
6874} ;
6975
7076const WizardInternal = ( {
@@ -76,6 +82,7 @@ const WizardInternal = ({
7682 SubmitButtonProps,
7783 ProgressIndicatorProps,
7884 vertical,
85+ WizardBodyProps,
7986 ...props
8087} ) => {
8188 const { formOptions, currentStep, handlePrev, onKeyDown, handleNext, activeStepIndex, selectNext, jumpToStep } = useContext ( WizardContext ) ;
@@ -94,7 +101,7 @@ const WizardInternal = ({
94101
95102 return (
96103 < div onKeyDown = { onKeyDown } { ...props } >
97- < WizardLayout nav = { nav ? nav : null } fields = { fields } />
104+ < WizardLayout nav = { nav ? nav : null } fields = { fields } WizardBodyProps = { WizardBodyProps } />
98105 < FormSpy >
99106 { ( { invalid, validating, submitting } ) => (
100107 < div { ...ButtonSetProps } className = { clsx ( 'ddorg__carbon-wizard-button-set' , ButtonSetProps . className ) } >
@@ -141,15 +148,17 @@ WizardInternal.propTypes = {
141148 SubmitButtonProps : PropTypes . object ,
142149 ButtonSetProps : PropTypes . object ,
143150 ProgressIndicatorProps : PropTypes . object ,
144- vertical : PropTypes . bool
151+ vertical : PropTypes . bool ,
152+ WizardBodyProps : PropTypes . object
145153} ;
146154
147155WizardInternal . defaultProps = {
148156 BackButtonProps : { } ,
149157 NextButtonProps : { } ,
150158 SubmitButtonProps : { } ,
151159 ButtonSetProps : { } ,
152- ProgressIndicatorProps : { }
160+ ProgressIndicatorProps : { } ,
161+ WizardBodyProps : { }
153162} ;
154163
155164const Wizard = ( props ) => < WizardCommon Wizard = { WizardInternal } { ...props } /> ;
0 commit comments