-
Notifications
You must be signed in to change notification settings - Fork 538
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ProgressBar): Convert ProgressBar to CSS modules behind team fea…
…ture flag (#5304) * Start module convert * Add more stuff * Add even more stuff * Add rest of styles needed * lint and format * Add changeset * Add `where` * Refactor E2E, add dev story * Add label to progressbar * test(vrt): update snapshots --------- Co-authored-by: TylerJDev <TylerJDev@users.noreply.github.com>
- Loading branch information
Showing
14 changed files
with
225 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@primer/react": minor | ||
--- | ||
|
||
Convert ProgressBar to CSS modules behind feature flag |
Binary file added
BIN
+4.15 KB
...rogressBar.test.ts-snapshots/ProgressBar-Dev-SX-Props-dark-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.14 KB
...ts/ProgressBar.test.ts-snapshots/ProgressBar-Dev-SX-Props-dark-dimmed-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.16 KB
...ressBar.test.ts-snapshots/ProgressBar-Dev-SX-Props-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.13 KB
...omponents/ProgressBar.test.ts-snapshots/ProgressBar-Dev-SX-Props-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.15 KB
...rogressBar.test.ts-snapshots/ProgressBar-Dev-SX-Props-dark-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.15 KB
...ogressBar.test.ts-snapshots/ProgressBar-Dev-SX-Props-light-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.17 KB
...essBar.test.ts-snapshots/ProgressBar-Dev-SX-Props-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.16 KB
...mponents/ProgressBar.test.ts-snapshots/ProgressBar-Dev-SX-Props-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.15 KB
...ogressBar.test.ts-snapshots/ProgressBar-Dev-SX-Props-light-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
packages/react/src/ProgressBar/ProgressBar.dev.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from 'react' | ||
import {ProgressBar} from '.' | ||
|
||
export default { | ||
title: 'Components/ProgressBar/Dev', | ||
component: ProgressBar, | ||
} | ||
|
||
export const Default = () => ( | ||
<ProgressBar | ||
aria-label="Status" | ||
progress={50} | ||
sx={{ | ||
height: '20px', | ||
borderWidth: '1px', | ||
borderStyle: 'solid', | ||
borderColor: 'success.emphasis', | ||
}} | ||
/> | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
@keyframes shimmer { | ||
from { | ||
mask-position: 200%; | ||
} | ||
|
||
to { | ||
mask-position: 0%; | ||
} | ||
} | ||
|
||
.ProgressBarItem { | ||
width: var(--progress-width); | ||
/* stylelint-disable-next-line primer/colors */ | ||
background-color: var(--progress-bg); | ||
|
||
@media (prefers-reduced-motion: no-preference) { | ||
&[data-animated='true'] { | ||
mask-image: linear-gradient(75deg, #000 30%, rgba(0, 0, 0, 0.65) 80%); | ||
mask-size: 200%; | ||
animation-name: shimmer; | ||
animation-duration: 1s; | ||
animation-iteration-count: infinite; | ||
} | ||
} | ||
} | ||
|
||
.ProgressBarContainer { | ||
display: flex; | ||
overflow: hidden; | ||
/* stylelint-disable-next-line primer/colors */ | ||
background-color: var(--borderColor-default); | ||
border-radius: var(--borderRadius-small); | ||
gap: 2px; | ||
|
||
&:where([data-progress-display='inline']) { | ||
display: inline-flex; | ||
} | ||
|
||
&:where([data-progress-bar-size='default']) { | ||
height: 8px; | ||
} | ||
|
||
&:where([data-progress-bar-size='small']) { | ||
height: 5px; | ||
} | ||
|
||
&:where([data-progress-bar-size='large']) { | ||
height: 10px; | ||
} | ||
} |
Oops, something went wrong.