Skip to content

Commit 3f9fbd4

Browse files
committed
fix(path): Simplify and fix active tab focus styling across all stage states
1 parent 64d1882 commit 3f9fbd4

File tree

2 files changed

+124
-2
lines changed

2 files changed

+124
-2
lines changed

ui/components/path/base/_index.scss

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,73 @@
131131
align-items: flex-start;
132132
margin-right: $spacing-small;
133133

134+
/**
135+
* @summary Creates the incomplete stage of the path
136+
*
137+
* @selector .slds-is-incomplete
138+
* @restrict .slds-path__item
139+
* @modifier
140+
*/
141+
.slds-is-incomplete {
142+
background-color: $color-background-path-incomplete;
143+
144+
&:hover {
145+
background-color: $color-background-path-incomplete-hover;
146+
}
147+
148+
.slds-path__link {
149+
color: $color-text-default;
150+
}
151+
}
152+
153+
/**
154+
* @summary Creates the active stage of the sales path
155+
*
156+
* @selector .slds-is-active
157+
* @restrict .slds-path__item
158+
* @notes This class must be placed on the item programatically when the guidance section is activated
159+
* @modifier
160+
*/
161+
.slds-is-active {
162+
background-color: $color-background-inverse;
163+
164+
.slds-path__link {
165+
color: $color-text-inverse;
166+
}
167+
168+
&:hover {
169+
background-color: $color-background-alt-inverse;
170+
171+
+ .slds-path__item:before {
172+
background-color: $color-background-alt-inverse;
173+
}
174+
}
175+
176+
+ .slds-path__item:before {
177+
background-color: $color-background-inverse;
178+
}
179+
}
180+
181+
/**
182+
* @summary Creates success stage of the path
183+
*
184+
* @selector .slds-is-won
185+
* @restrict .slds-path__item
186+
* @modifier
187+
*/
188+
.slds-is-active,
189+
.slds-is-active.slds-is-won {
190+
191+
.slds-path__title {
192+
transform: rotateX(0deg);
193+
}
194+
195+
.slds-path__stage {
196+
transform: rotateX(-180deg);
197+
}
198+
}
199+
200+
134201
/**
135202
* @summary Creates the completed stage of the path
136203
*

ui/components/path/base/example.jsx

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ let ListItem = props => {
113113
}
114114

115115
return (
116-
<li className={classNames('slds-path__item', props.className)} role="presentation">
116+
<li className={classNames('slds-path__item', props.className, {
117+
'slds-is-active': props.tabIndex
118+
})} role="presentation">
117119
<a
118120
aria-controls={props.ariaControls}
119121
aria-expanded={ariaExpanded}
@@ -202,6 +204,54 @@ let CoachExample2 = props =>
202204
/// ///////////////////////////////////////////
203205

204206
let Default = props =>
207+
<Coach>
208+
<Path>
209+
<div className="slds-grid slds-path__scroller-container">
210+
<ListMain listRole="listbox">
211+
<ListItem className="slds-is-current" id={path1Id} role="option" tabIndex="0">
212+
<span className="slds-path__stage">
213+
<SvgIcon className="slds-icon slds-icon_x-small" sprite="utility" symbol="check" />
214+
<span className="slds-assistive-text">Stage Complete</span>
215+
</span>
216+
<span className="slds-path__title">Contacted</span>
217+
</ListItem>
218+
<ListItem className="slds-is-incomplete" id={path2Id} role="option">
219+
<span className="slds-path__stage">
220+
<SvgIcon className="slds-icon slds-icon_x-small" sprite="utility" symbol="check" />
221+
<span className="slds-assistive-text">Stage Complete</span>
222+
</span>
223+
<span className="slds-path__title">Open</span>
224+
</ListItem>
225+
<ListItem className="slds-is-incomplete" id={path3Id} role="option">
226+
<span className="slds-path__stage">
227+
<SvgIcon className="slds-icon slds-icon_x-small" sprite="utility" symbol="check" />
228+
<span className="slds-assistive-text">Current Stage:</span>
229+
</span>
230+
<span className="slds-path__title">Unqualified</span>
231+
</ListItem>
232+
<ListItem className="slds-is-incomplete" id={path4Id} role="option">
233+
<span className="slds-path__stage">
234+
<SvgIcon className="slds-icon slds-icon_x-small" sprite="utility" symbol="check" />
235+
</span>
236+
<span className="slds-path__title">Nurturing</span>
237+
</ListItem>
238+
<ListItem className="slds-is-incomplete" id={path5Id} role="option">
239+
<span className="slds-path__stage">
240+
<SvgIcon className="slds-icon slds-icon_x-small" sprite="utility" symbol="check" />
241+
</span>
242+
<span className="slds-path__title">Closed</span>
243+
</ListItem>
244+
</ListMain>
245+
</div>
246+
<div className="slds-grid slds-path__action">
247+
<span className="slds-path__stage-name">Stage: Unqualified</span>
248+
<Action><SvgIcon className="slds-button__icon slds-button__icon_left" sprite="utility" symbol="check" />
249+
Mark Status as Complete</Action>
250+
</div>
251+
</Path>
252+
</Coach>;
253+
254+
let PathNoCoachStageSelected = props =>
205255
<Coach>
206256
<Path>
207257
<div className="slds-grid slds-path__scroller-container">
@@ -913,6 +963,11 @@ export default (
913963
);
914964

915965
export let states = [
966+
{
967+
id: 'later-stage',
968+
label: 'With Different Stage Selected - without coaching',
969+
element: <PathNoCoachStageSelected />
970+
},
916971
{
917972
id: 'with-coaching',
918973
label: 'With Coaching Available',
@@ -925,7 +980,7 @@ export let states = [
925980
},
926981
{
927982
id: 'different-coaching',
928-
label: 'With Different Stage Selected',
983+
label: 'With Different Stage Selected - with coaching',
929984
element: <PathStageSelected />
930985
},
931986
{

0 commit comments

Comments
 (0)