@@ -2,7 +2,7 @@ import React, { FC } from "react";
22import type { IBubbleProps } from "./types" ;
33import { Elements } from "../constants" ;
44import whiteTick from '../assets/white-tick.svg' ;
5- import { STEP_STATUSES } from '../constants' ;
5+ import { STEP_STATUSES , LABEL_POSITION } from '../constants' ;
66import styles from './styles.module.scss' ;
77
88const Bubble : FC < IBubbleProps > = ( props ) => {
@@ -13,7 +13,8 @@ const Bubble: FC<IBubbleProps> = (props) => {
1313 currentStepIndex,
1414 handleStepClick = null ,
1515 showCursor,
16- getStyles
16+ getStyles,
17+ labelPosition
1718 } = props ;
1819
1920 return (
@@ -45,6 +46,41 @@ const Bubble: FC<IBubbleProps> = (props) => {
4546 || index + 1 }
4647 </ >
4748 ) }
49+ < div className = { `${ styles . labelContainer } ${ styles [ `labelContainer__${ labelPosition || LABEL_POSITION . RIGHT } ` ] } ` } >
50+ { step ?. label && (
51+ < span
52+ className = { `${ styles . labelTitle }
53+ ${ showCursor && styles . cursorPointer }
54+ ${ index === currentStepIndex && styles . activeLabelTitle } ` }
55+ style = { {
56+ ...( ( getStyles ( Elements . LabelTitle ) ) || { } ) ,
57+ ...( ( index === currentStepIndex && getStyles ( Elements . ActiveLabelTitle ) ) || { } )
58+ } }
59+ onClick = { ( ) : void | null => handleStepClick && handleStepClick ( ) }
60+ role = "presentation"
61+ id = { `stepper-label-${ index } ` }
62+ >
63+ { step . label }
64+ </ span >
65+ ) }
66+ { step ?. description && (
67+ < span
68+ className = { `${ styles . labelDescription }
69+ ${ handleStepClick && styles . cursorPointer }
70+ ${ index === currentStepIndex && styles . activeLabelDescription } ` }
71+ style = { {
72+ ...( ( getStyles ( Elements . LabelDescription ) ) || { } ) ,
73+ ...( ( index === currentStepIndex &&
74+ getStyles ( Elements . ActiveLabelDescription ) ) || { } )
75+ } }
76+ onClick = { ( ) : void | null => handleStepClick && handleStepClick ( ) }
77+ role = "presentation"
78+ id = { `stepper-desc-${ index } ` }
79+ >
80+ { step . description }
81+ </ span >
82+ ) }
83+ </ div >
4884 </ div >
4985 ) ;
5086} ;
0 commit comments