Skip to content

Commit 118b520

Browse files
authored
feat(progress-indicator): add new vertical variant with new class for green success (#3068)
* feat(progress-indicator): add new class annotations for slds-progress__marker_icon-success
1 parent 3b6f741 commit 118b520

21 files changed

+786
-17
lines changed

shared/styles/doc.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
.docs-codeblock-example {
1515
overflow: auto;
16+
transform: translate3d(0, 0, 0);
1617
}
1718

1819
.docs-codeblock-source {

ui/components/_index.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@
173173
// Progress Indicator
174174
'progress-bar/base/index',
175175
'progress-indicator/base/index',
176+
'progress-indicator/vertical/index',
176177
'progress-ring/base/index',
177178

178179
// Rich Text Editor

ui/components/progress-bar/base/_index.scss

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,31 @@
109109
.slds-progress-bar__value_success {
110110
background: $progress-bar-color-background-fill-success;
111111
}
112+
113+
/**
114+
* @summary Create a vertical progress bar
115+
*
116+
* @selector .slds-progress-bar_vertical
117+
* @restrict .slds-progress-bar
118+
* @modifier
119+
*/
120+
.slds-progress-bar_vertical {
121+
height: 100%;
122+
width: ($progress-bar-height * 4);
123+
124+
&.slds-progress-bar_x-small {
125+
width: $progress-bar-height;
126+
}
127+
128+
&.slds-progress-bar_small {
129+
width: ($progress-bar-height * 2);
130+
}
131+
132+
&.slds-progress-bar_medium {
133+
width: ($progress-bar-height * 4);
134+
}
135+
136+
&.slds-progress-bar_large {
137+
width: ($progress-bar-height * 6);
138+
}
139+
}

ui/components/progress-bar/base/example.jsx

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,31 @@ import _ from '../../../shared/helpers';
99
// Partial(s)
1010
/// ///////////////////////////////////////////
1111

12-
export const ProgressBar = props => (
13-
<div
14-
className={classNames('slds-progress-bar', props.className)}
15-
aria-valuemin="0"
16-
aria-valuemax="100"
17-
aria-valuenow={props.value}
18-
aria-labelledby={props['aria-labelledby']}
19-
role="progressbar"
20-
>
21-
<span
22-
className="slds-progress-bar__value"
23-
style={{ width: `${props.value}%` }}
12+
export const ProgressBar = props => {
13+
let progressBarStyle = props.isVertical
14+
? { height: `${props.value}%` }
15+
: { width: `${props.value}%` };
16+
return (
17+
<div
18+
className={classNames(
19+
'slds-progress-bar',
20+
{ 'slds-progress-bar_vertical': props.isVertical },
21+
props.className
22+
)}
23+
aria-valuemin="0"
24+
aria-valuemax="100"
25+
aria-valuenow={props.value}
26+
aria-labelledby={props['aria-labelledby']}
27+
role="progressbar"
2428
>
25-
<span className="slds-assistive-text">Progress: {`${props.value}%`}</span>
26-
</span>
27-
</div>
28-
);
29+
<span className="slds-progress-bar__value" style={progressBarStyle}>
30+
<span className="slds-assistive-text">
31+
Progress: {`${props.value}%`}
32+
</span>
33+
</span>
34+
</div>
35+
);
36+
};
2937

3038
export const ProgressBarDescriptive = props => {
3139
const labelUniqueId = _.uniqueId('progress-bar-label-id-');

ui/components/progress-indicator/__tests__/__snapshots__/Base_Progress_Indicator_renders_a_base_progress_indicator.json

Lines changed: 18 additions & 0 deletions
Large diffs are not rendered by default.

ui/components/progress-indicator/__tests__/__snapshots__/Base_Progress_Indicator_renders_a_base_step.json

Lines changed: 10 additions & 0 deletions
Large diffs are not rendered by default.

ui/components/progress-indicator/__tests__/__snapshots__/Base_Progress_Indicator_renders_a_done_base_step.json

Lines changed: 12 additions & 0 deletions
Large diffs are not rendered by default.

ui/components/progress-indicator/__tests__/__snapshots__/Base_Progress_Indicator_renders_an_active_base_step.json

Lines changed: 10 additions & 0 deletions
Large diffs are not rendered by default.

ui/components/progress-indicator/__tests__/__snapshots__/Base_Progress_Indicator_renders_an_active_base_step_with_aria_describedby.json

Lines changed: 10 additions & 0 deletions
Large diffs are not rendered by default.

ui/components/progress-indicator/__tests__/__snapshots__/Base_Progress_Indicator_renders_an_error_base_step.json

Lines changed: 12 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)