@@ -4,7 +4,26 @@ import { IStep, IStepperProps } from './types';
44import Bubble from '../bubble' ;
55
66const Stepper = ( props : IStepperProps ) : ReactElement => {
7- const { steps, currentActiveStepIndex, onStepClick, enableStepClick = false , renderAdornment } = props ;
7+ const {
8+ steps,
9+ currentActiveStepIndex,
10+ enableStepClick = false ,
11+ onStepClick,
12+ renderAdornment,
13+ stylesOverride
14+ } = props ;
15+
16+ const {
17+ getLabelDescriptionStyles,
18+ getLabelTitleStyles,
19+ getActiveLabelTitleStyles,
20+ getActiveLabelDescriptionStyles,
21+ getLineSeparatorStyles,
22+ getInactiveLineSeparatorStyles,
23+ getBubbleStyles,
24+ getActiveBubbleStyles,
25+ getInActiveBubbleStyles
26+ } = stylesOverride ;
827
928 const [ currentActiveStepIndexVal , setCurrentActiveStepIndexVal ] = useState < number > ( ) ;
1029
@@ -31,12 +50,18 @@ const Stepper = (props: IStepperProps): ReactElement => {
3150 currentActiveStepIndexVal = { currentActiveStepIndexVal }
3251 handleStepClick = { handleStepClick }
3352 renderAdornment = { renderAdornment }
53+ getBubbleStyles = { getBubbleStyles }
54+ getActiveBubbleStyles = { getActiveBubbleStyles }
55+ getInActiveBubbleStyles = { getInActiveBubbleStyles }
3456 />
3557 < div style = { styles . eachLabel } >
3658 { step ?. label && (
3759 < span
3860 style = { { ...styles . labelTitle ,
39- ...( ( index === currentActiveStepIndexVal && styles . activeLabelTitle ) || { } ) } }
61+ ...( ( getLabelTitleStyles && getLabelTitleStyles ( step , index ) ) || { } ) ,
62+ ...( ( index === currentActiveStepIndexVal && styles . activeLabelTitle ) || { } ) ,
63+ ...( ( index === currentActiveStepIndexVal && getActiveLabelTitleStyles && getActiveLabelTitleStyles ( step , index ) ) || { } )
64+ } }
4065 onClick = { ( ) : void => handleStepClick ( index ) }
4166 role = "presentation"
4267 >
@@ -45,14 +70,21 @@ const Stepper = (props: IStepperProps): ReactElement => {
4570 ) }
4671 { step ?. description && (
4772 < span style = { { ...styles . labelDescription ,
48- ...( ( index === currentActiveStepIndexVal ) && styles . activeLabelDescription || { } ) } } >
73+ ...( ( getLabelDescriptionStyles && getLabelDescriptionStyles ( step , index ) ) || { } ) ,
74+ ...( ( index === currentActiveStepIndexVal ) && styles . activeLabelDescription || { } ) ,
75+ ...( ( index === currentActiveStepIndexVal && getActiveLabelDescriptionStyles && getActiveLabelDescriptionStyles ( step , index ) ) || { } )
76+ } } >
4977 { step . description }
5078 </ span >
5179 ) }
5280 </ div >
5381 { index < steps ?. length - 1 && (
5482 < div style = { { ...styles . lineSeparator ,
55- ...( ( index > currentActiveStepIndexVal - 1 ) && styles . activeStepLineSeparator || { } ) } } />
83+ ...( ( getLineSeparatorStyles && getLineSeparatorStyles ( step , index ) ) || { } ) ,
84+ ...( ( index > currentActiveStepIndexVal - 1 ) && styles . inactiveStepLineSeparator || { } ) ,
85+ ...( ( index > currentActiveStepIndexVal - 1 && getInactiveLineSeparatorStyles && getInactiveLineSeparatorStyles ( step , index ) ) || { } )
86+
87+ } } />
5688 ) }
5789 </ div >
5890 </ div >
0 commit comments