Skip to content

Commit 535740e

Browse files
authored
Merge pull request #2954 from SUI-Components/progressbar-new-sizes
feat(components/atom/progressBar): new sizes and strokes
2 parents 7fa1516 + ec9b549 commit 535740e

File tree

6 files changed

+23
-9
lines changed

6 files changed

+23
-9
lines changed

components/atom/progressBar/src/ProgressBarCircle/index.scss

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ $base-class-circle: '#{$base-class}Circle';
88
flex-direction: row;
99
flex-wrap: nowrap;
1010

11+
&--extraSmall {
12+
height: $w-atom-circle-progress-bar-circle-extraSmall;
13+
width: $w-atom-circle-progress-bar-circle-extraSmall;
14+
}
15+
1116
&--small {
1217
height: $h-atom-circle-progress-bar-circle-small;
1318
width: $w-atom-circle-progress-bar-circle-small;
@@ -51,7 +56,8 @@ $base-class-circle: '#{$base-class}Circle';
5156
padding: 0;
5257
position: absolute;
5358
text-align: center;
54-
&--small {
59+
&--small,
60+
&--extraSmall {
5561
top: 0;
5662
bottom: 0;
5763
left: 100%;

components/atom/progressBar/src/ProgressBarCircle/settings.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ export const SIZE_TO_WIDTH_LINE_MAP = {
88
[SIZES.EXTRA_LARGE]: 6,
99
[SIZES.LARGE]: 4,
1010
[SIZES.MEDIUM]: 8,
11-
[SIZES.SMALL]: 8
11+
[SIZES.SMALL]: 8,
12+
[SIZES.EXTRA_SMALL]: 12
1213
}
1314

1415
export const STROKE_SIZE_MAP = {
1516
[SIZES.LARGE]: 18,
1617
[SIZES.MEDIUM]: 12,
17-
[SIZES.SMALL]: 6
18+
[SIZES.SMALL]: 6,
19+
[SIZES.EXTRA_SMALL]: 4
1820
}

components/atom/progressBar/src/ProgressBarCircle/settings.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ $w-atom-circle-progress-bar-circle-medium: 24px !default;
66
$h-atom-circle-progress-bar-circle-medium: $w-atom-circle-progress-bar-circle-medium !default;
77
$w-atom-circle-progress-bar-circle-small: 16px !default;
88
$h-atom-circle-progress-bar-circle-small: $w-atom-circle-progress-bar-circle-small !default;
9+
$w-atom-circle-progress-bar-circle-extraSmall: 12px !default;
10+
$h-atom-circle-progress-bar-circle-extraSmall: $w-atom-circle-progress-bar-circle-extraSmall !default;
911
$w-atom-circle-progress-bar-circle-large--error: 32px !default;
1012
$h-atom-circle-progress-bar-circle-large--error: $w-atom-circle-progress-bar-circle-large--error !default;
1113
$w-atom-circle-progress-bar-circle-medium--error: 22px !default;

components/atom/progressBar/src/ProgressBarLine/settings.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ $c-atom-line-progress-bar-status--loading: $c-gray-lightest !default;
5050
$c-atom-line-progress-bar-status--success: $c-success !default;
5151

5252
$size-atom-line-progress-bar: (
53+
extraSmall: $sz-base * 0.25,
5354
small: $sz-base * 0.5,
5455
medium: $sz-base,
5556
large: $sz-base * 2,

components/atom/progressBar/src/settings.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,18 @@ export const TYPES = {
77
}
88

99
export const SIZES = {
10-
EXTRA_LARGE: 'extraLarge',
10+
EXTRA_SMALL: 'extraSmall',
1111
SMALL: 'small',
1212
MEDIUM: 'medium',
13-
LARGE: 'large'
13+
LARGE: 'large',
14+
EXTRA_LARGE: 'extraLarge'
1415
}
1516

1617
export const STROKE_SIZES = {
1718
SMALL: 'small',
1819
MEDIUM: 'medium',
19-
LARGE: 'large'
20+
LARGE: 'large',
21+
EXTRA_SMALL: 'extraSmall'
2022
}
2123

2224
export const LINE_CAPS = {

components/atom/progressBar/test/index.test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,15 +225,16 @@ describe(json.name, () => {
225225
// Given
226226
const library = pkg
227227
const expected = {
228-
EXTRA_LARGE: 'extraLarge',
228+
EXTRA_SMALL: 'extraSmall',
229229
LARGE: 'large',
230230
MEDIUM: 'medium',
231-
SMALL: 'small'
231+
SMALL: 'small',
232+
EXTRA_LARGE: 'extraLarge'
232233
}
233234

234235
// When
235236
const {atomProgressBarSizes: actual} = library
236-
const {EXTRA_LARGE, LARGE, MEDIUM, SMALL, ...others} = actual
237+
const {EXTRA_LARGE, LARGE, MEDIUM, SMALL, EXTRA_SMALL, ...others} = actual
237238

238239
// Then
239240
expect(Object.keys(others).length).to.equal(0)

0 commit comments

Comments
 (0)