Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ProgressIndicator): Sbanken styling #2631

Merged
merged 7 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ description: 'The ProgressIndicator component is a waiting loader / spinner to s
showTabs: true
redirect_from:
- /uilib/components/progress
theme: 'sbanken'
---

import ProgressIndicatorInfo from 'Docs/uilib/components/progress-indicator/info'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2282,6 +2282,10 @@ label + .dnb-dropdown[class*=__form-status] .dnb-dropdown__shell {
--progress-indicator-circular-circle: 88;
--progress-indicator-circular-circle-offset--min: 88;
--progress-indicator-circular-circle-offset--max: 1;
--progress-indicator-circular-background-color: grey;
--progress-indicator-circular-bar-color: var(--color-black);
--progress-indicator-linear-background-color: grey;
--progress-indicator-linear-bar-color: var(--color-black);
position: relative;
display: inline-flex;
align-items: center;
Expand Down Expand Up @@ -2349,12 +2353,44 @@ label + .dnb-dropdown[class*=__form-status] .dnb-dropdown__shell {
stroke-linecap: round;
}
.dnb-progress-indicator__circular__line.light .dnb-progress-indicator__circular__circle {
stroke: grey;
stroke: var(--progress-indicator-circular-background-color);
}
.dnb-progress-indicator__circular__line.dark .dnb-progress-indicator__circular__circle {
stroke: var(--color-black);
stroke: var(--progress-indicator-circular-bar-color);
}
.dnb-progress-indicator__circular--small {
width: 1rem;
height: 1rem;
}
.dnb-progress-indicator__circular--medium {
width: 1.5rem;
height: 1.5rem;
}
.dnb-progress-indicator__circular--large {
width: 3.5rem;
height: 3.5rem;
}
.dnb-progress-indicator__circular--huge {
width: 20rem;
height: 20rem;
}
.dnb-progress-indicator__circular--small .dnb-progress-indicator__circular__line.dark .dnb-progress-indicator__circular__circle {
stroke-width: 3.1;
}
.dnb-progress-indicator__circular--medium .dnb-progress-indicator__circular__line.dark .dnb-progress-indicator__circular__circle {
stroke-width: 3.3;
}
.dnb-progress-indicator__circular--default .dnb-progress-indicator__circular__line.dark .dnb-progress-indicator__circular__circle {
stroke-width: 3.5;
}
.dnb-progress-indicator__circular--large .dnb-progress-indicator__circular__line.dark .dnb-progress-indicator__circular__circle {
stroke-width: 3.7;
}
.dnb-progress-indicator__circular--huge .dnb-progress-indicator__circular__line.dark .dnb-progress-indicator__circular__circle {
stroke-width: 3.9;
}
.dnb-progress-indicator__linear {
background-color: var(--progress-indicator-linear-background-color);
position: relative;
overflow: hidden;
width: 100%;
Expand All @@ -2363,6 +2399,7 @@ label + .dnb-dropdown[class*=__form-status] .dnb-dropdown__shell {
border-radius: 0.25rem;
}
.dnb-progress-indicator__linear__bar {
background-color: var(--progress-indicator-linear-bar-color);
width: 100%;
position: absolute;
left: 0;
Expand All @@ -2382,6 +2419,22 @@ label + .dnb-dropdown[class*=__form-status] .dnb-dropdown__shell {
width: auto;
animation: progress-indicator-linear-bar-2 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;
}
.dnb-progress-indicator__linear--small {
height: 0.25rem;
border-radius: 0.125rem;
}
.dnb-progress-indicator__linear--medium {
height: 1rem;
border-radius: 0.5rem;
}
.dnb-progress-indicator__linear--large {
height: 1.5rem;
border-radius: 0.75rem;
}
.dnb-progress-indicator__linear--huge {
height: 2rem;
border-radius: 1rem;
}
html[data-visual-test] .dnb-progress-indicator__linear__bar1-animation {
left: -35%;
right: 100%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,10 @@ button.dnb-button::-moz-focus-inner {
--progress-indicator-circular-circle: 88;
--progress-indicator-circular-circle-offset--min: 88;
--progress-indicator-circular-circle-offset--max: 1;
--progress-indicator-circular-background-color: grey;
--progress-indicator-circular-bar-color: var(--color-black);
--progress-indicator-linear-background-color: grey;
--progress-indicator-linear-bar-color: var(--color-black);
position: relative;
display: inline-flex;
align-items: center;
Expand Down Expand Up @@ -638,12 +642,44 @@ button.dnb-button::-moz-focus-inner {
stroke-linecap: round;
}
.dnb-progress-indicator__circular__line.light .dnb-progress-indicator__circular__circle {
stroke: grey;
stroke: var(--progress-indicator-circular-background-color);
}
.dnb-progress-indicator__circular__line.dark .dnb-progress-indicator__circular__circle {
stroke: var(--color-black);
stroke: var(--progress-indicator-circular-bar-color);
}
.dnb-progress-indicator__circular--small {
width: 1rem;
height: 1rem;
}
.dnb-progress-indicator__circular--medium {
width: 1.5rem;
height: 1.5rem;
}
.dnb-progress-indicator__circular--large {
width: 3.5rem;
height: 3.5rem;
}
.dnb-progress-indicator__circular--huge {
width: 20rem;
height: 20rem;
}
.dnb-progress-indicator__circular--small .dnb-progress-indicator__circular__line.dark .dnb-progress-indicator__circular__circle {
stroke-width: 3.1;
}
.dnb-progress-indicator__circular--medium .dnb-progress-indicator__circular__line.dark .dnb-progress-indicator__circular__circle {
stroke-width: 3.3;
}
.dnb-progress-indicator__circular--default .dnb-progress-indicator__circular__line.dark .dnb-progress-indicator__circular__circle {
stroke-width: 3.5;
}
.dnb-progress-indicator__circular--large .dnb-progress-indicator__circular__line.dark .dnb-progress-indicator__circular__circle {
stroke-width: 3.7;
}
.dnb-progress-indicator__circular--huge .dnb-progress-indicator__circular__line.dark .dnb-progress-indicator__circular__circle {
stroke-width: 3.9;
}
.dnb-progress-indicator__linear {
background-color: var(--progress-indicator-linear-background-color);
position: relative;
overflow: hidden;
width: 100%;
Expand All @@ -652,6 +688,7 @@ button.dnb-button::-moz-focus-inner {
border-radius: 0.25rem;
}
.dnb-progress-indicator__linear__bar {
background-color: var(--progress-indicator-linear-bar-color);
width: 100%;
position: absolute;
left: 0;
Expand All @@ -671,6 +708,22 @@ button.dnb-button::-moz-focus-inner {
width: auto;
animation: progress-indicator-linear-bar-2 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;
}
.dnb-progress-indicator__linear--small {
height: 0.25rem;
border-radius: 0.125rem;
}
.dnb-progress-indicator__linear--medium {
height: 1rem;
border-radius: 0.5rem;
}
.dnb-progress-indicator__linear--large {
height: 1.5rem;
border-radius: 0.75rem;
}
.dnb-progress-indicator__linear--huge {
height: 2rem;
border-radius: 1rem;
}
html[data-visual-test] .dnb-progress-indicator__linear__bar1-animation {
left: -35%;
right: 100%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,52 @@ import {
setupPageScreenshot,
} from '../../../core/jest/jestSetupScreenshots'

describe('ProgressIndicator', () => {
setupPageScreenshot({
url: '/uilib/components/progress-indicator/demos',
})
describe.each(['ui', 'sbanken'])(
'ProgressIndicator for %s',
(themeName) => {
setupPageScreenshot({
themeName,
url: '/uilib/components/progress-indicator/demos',
})

it('have to match the static primary circular with 50 percentage', async () => {
const screenshot = await makeScreenshot({
selector:
'[data-visual-test="progress-indicator-circular--primary"] .dnb-progress-indicator',
it('have to match the static primary circular with 50 percentage', async () => {
const screenshot = await makeScreenshot({
selector:
'[data-visual-test="progress-indicator-circular--primary"] .dnb-progress-indicator',
})
expect(screenshot).toMatchImageSnapshot()
})
expect(screenshot).toMatchImageSnapshot()
})

it('have to match the static primary linear with 50 percentage', async () => {
const screenshot = await makeScreenshot({
style: {
width: '20rem',
},
selector:
'[data-visual-test="progress-indicator-linear--primary"] .dnb-progress-indicator',
it('have to match the static primary linear with 50 percentage', async () => {
const screenshot = await makeScreenshot({
style: {
width: '20rem',
},
selector:
'[data-visual-test="progress-indicator-linear--primary"] .dnb-progress-indicator',
})
expect(screenshot).toMatchImageSnapshot()
})
expect(screenshot).toMatchImageSnapshot()
})
})
}
)

describe('ProgressIndicator circular', () => {
setupPageScreenshot({
url: '/uilib/components/progress-indicator/visual-tests',
})
describe.each(['ui', 'sbanken'])(
'ProgressIndicator circular for %s',
(themeName) => {
setupPageScreenshot({
themeName,
url: '/uilib/components/progress-indicator/visual-tests',
})

it('have to match static primary circular sizes', async () => {
const screenshot = await makeScreenshot({
style: {
height: '3.5rem',
width: '8rem',
},
selector: '[data-visual-test="progress-indicator-sizes"]',
it('have to match static primary circular sizes', async () => {
const screenshot = await makeScreenshot({
style: {
height: '3.5rem',
width: '8rem',
},
selector: '[data-visual-test="progress-indicator-sizes"]',
})
expect(screenshot).toMatchImageSnapshot()
})
expect(screenshot).toMatchImageSnapshot()
})
})
}
)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading