Skip to content

Commit 580ef0f

Browse files
committed
SDK-R Multistep stepper styling changes
1 parent 6e55ebf commit 580ef0f

File tree

3 files changed

+40
-37
lines changed

3 files changed

+40
-37
lines changed

packages/react-sdk-components/src/components/infra/MultiStep/MultiStep.css

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,21 @@ mat-horizontal-stepper {
7979

8080
.psdk-vertical-step-icon {
8181
margin-right: 12px;
82-
background-color: var(--app-neutral-color);
82+
background-color: var(--stepper-completed-bg-color);
8383
color: var(--app-text-color);
8484
border-radius: 50%;
8585
height: 24px;
8686
width: 24px;
87-
flex-shrink: 0;
87+
position: relative;
88+
}
89+
90+
.psdk-vertical-step-icon-future {
91+
margin-right: 12px;
92+
color: var(--app-neutral-color);
93+
border: 1px solid var(--app-neutral-color);
94+
border-radius: 50%;
95+
height: 24px;
96+
width: 24px;
8897
position: relative;
8998
}
9099

@@ -93,7 +102,6 @@ mat-horizontal-stepper {
93102
top: 50%;
94103
left: 50%;
95104
transform: translate(-50%, -50%);
96-
color: var(--app-text-color);
97105
}
98106

99107
.psdk-vertical-step-icon-selected {
@@ -162,7 +170,6 @@ mat-horizontal-stepper {
162170
white-space: nowrap;
163171
display: flex;
164172
align-items: center;
165-
text-align: left;
166173
}
167174

168175
.psdk-horizontal-step-header {
@@ -175,20 +182,24 @@ mat-horizontal-stepper {
175182
height: 72px;
176183
overflow: hidden;
177184
align-items: center;
178-
padding: 0 24px;
179185
}
180186

181187
.psdk-horizontal-step-icon {
182-
background-color: var(--app-neutral-color);
183-
color: var(--app-text-color);
188+
background-color: var(--stepper-completed-bg-color);
189+
color: white;
190+
border-radius: 50%;
191+
height: 24px;
192+
width: 24px;
193+
position: relative;
194+
}
195+
196+
.psdk-horizontal-step-icon-future {
197+
color: var(--app-neutral-color);
198+
border: 1px solid var(--app-neutral-color);
184199
border-radius: 50%;
185200
height: 24px;
186201
width: 24px;
187-
flex-shrink: 0;
188202
position: relative;
189-
display: block;
190-
margin-right: 8px;
191-
flex: none;
192203
}
193204

194205
.psdk-horizontal-step-icon-content {
@@ -205,39 +216,27 @@ mat-horizontal-stepper {
205216
border-radius: 50%;
206217
height: 24px;
207218
width: 24px;
208-
flex-shrink: 0;
209219
position: relative;
210-
display: block;
211-
margin-right: 8px;
212-
flex: none;
213220
}
214221

215222
.psdk-horizontal-step-label {
216223
color: var(--text-secondary-color);
217-
display: inline-block;
218-
min-width: 50px;
219-
vertical-align: middle;
220224
font-size: 14px;
221225
font-weight: 500;
222226
white-space: initial;
223227
}
224228

225229
.psdk-horizontal-step-label-selected {
226230
color: var(--text-primary-color);
227-
display: inline-block;
228-
min-width: 50px;
229-
vertical-align: middle;
230231
font-size: 14px;
231232
font-weight: 500;
232233
white-space: initial;
234+
margin-left: 8px;
233235
}
234236

235237
.psdk-horizontal-step-line {
236-
border-top-color: rgba(0, 0, 0, 0.12);
237-
border-top-width: 1px;
238-
border-top-style: solid;
238+
border-top: 1px solid var(--app-neutral-color);
239239
flex: auto;
240-
height: 0;
241-
margin: 0 -16px;
242240
min-width: 32px;
241+
margin: 0px 8px;
243242
}

packages/react-sdk-components/src/components/infra/MultiStep/MultiStep.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ export default function MultiStep(props: PropsWithChildren<MultiStepProps>) {
3333
function _getVIconClass(status): string {
3434
if (status === 'current') {
3535
return 'psdk-vertical-step-icon-selected';
36+
} else if (status === 'future') {
37+
return 'psdk-vertical-step-icon-future';
3638
}
3739

3840
return 'psdk-vertical-step-icon';
@@ -57,6 +59,8 @@ export default function MultiStep(props: PropsWithChildren<MultiStepProps>) {
5759
function _getHIconClass(step): string {
5860
if (step.ID === currentStep?.ID) {
5961
return 'psdk-horizontal-step-icon-selected';
62+
} else if (step.visited_status === 'future') {
63+
return 'psdk-horizontal-step-icon-future';
6064
}
6165

6266
return 'psdk-horizontal-step-icon';
@@ -92,7 +96,7 @@ export default function MultiStep(props: PropsWithChildren<MultiStepProps>) {
9296
<span>{index + 1}</span>
9397
</div>
9498
</div>
95-
<div className={_getVLabelClass(mainStep.visited_status)}>{mainStep.name}</div>
99+
<div className={_getVLabelClass(mainStep.visited_status)}>{mainStep.visited_status === 'current' && mainStep.name}</div>
96100
</div>
97101
<div className={_getVBodyClass(index)}>
98102
{mainStep?.steps && (
@@ -122,9 +126,11 @@ export default function MultiStep(props: PropsWithChildren<MultiStepProps>) {
122126
</ul>
123127
)}
124128
{!mainStep?.steps && mainStep.visited_status === 'current' && (
125-
<AssignmentCard getPConnect={getPConnect} itemKey={itemKey} actionButtons={actionButtons} onButtonPress={buttonPress}>
126-
{children}
127-
</AssignmentCard>
129+
<div style={{ paddingLeft: 20 }}>
130+
<AssignmentCard getPConnect={getPConnect} itemKey={itemKey} actionButtons={actionButtons} onButtonPress={buttonPress}>
131+
{children}
132+
</AssignmentCard>
133+
</div>
128134
)}
129135
</div>
130136
</div>
@@ -144,11 +150,7 @@ export default function MultiStep(props: PropsWithChildren<MultiStepProps>) {
144150
<span>{index + 1}</span>
145151
</div>
146152
</div>
147-
<div className={_getHLabelClass(mainStep)}>
148-
<div className='psdk-horizontal-step-text-label' id='selected-label'>
149-
{mainStep.name}
150-
</div>
151-
</div>
153+
<div className={_getHLabelClass(mainStep)}>{mainStep.visited_status === 'current' && mainStep.name}</div>
152154
</div>
153155
{_showHLine(index) && <div className='psdk-horizontal-step-line' />}
154156
</React.Fragment>

packages/react-sdk-components/src/theme.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ const lightThemeColours = {
7878
'--secondary-button-text-color': '#ffffff',
7979

8080
'--text-primary-color': '#000',
81-
'--text-secondary-color': '#c0c0c0'
81+
'--text-secondary-color': '#c0c0c0',
82+
'--stepper-completed-bg-color': '#218721'
8283
}
8384
};
8485
const darkThemeColours = {
@@ -123,7 +124,8 @@ const darkThemeColours = {
123124
'--secondary-button-text-color': '#1a103c',
124125

125126
'--text-primary-color': '#e0e0e0',
126-
'--text-secondary-color': '#c0c0c0'
127+
'--text-secondary-color': '#c0c0c0',
128+
'--stepper-completed-bg-color': '#158715'
127129
}
128130
};
129131

0 commit comments

Comments
 (0)