-
Notifications
You must be signed in to change notification settings - Fork 3
CircularProgress & LinearProgress visual styling
#1594
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
Open
FlyersPh9
wants to merge
43
commits into
main
Choose a base branch
from
jon/progress-colors
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 38 commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
d488feb
Initial commit
FlyersPh9 ba6771c
Attempt to fix visual artifacting
FlyersPh9 d8bc772
Use neutral color instead of mono
FlyersPh9 e811588
Border color for track, icon color for fill
FlyersPh9 b86eac4
Revert ba6771c
FlyersPh9 51815e4
Determinate LinearProgress has end indicator
FlyersPh9 ad07d5a
Merge branch 'main' into jon/progress-colors
FlyersPh9 21d8031
Mention end marker in docs
FlyersPh9 cbaf3f2
Split Progress.md into 2 files
FlyersPh9 8609725
Add color documentation and simplify demo.
FlyersPh9 2d26aec
Add determinate documentation and demo.
FlyersPh9 1f03f4d
Update anchors to new progress docs.
FlyersPh9 f8a5294
Simplify determinate demos
FlyersPh9 a004452
Merge branch 'main' into jon/progress-colors
FlyersPh9 96d9c61
Add support for buffer variant
FlyersPh9 671fd08
Merge branch 'main' into jon/progress-colors
FlyersPh9 ea1fe63
Reduce size of track
FlyersPh9 450c3bf
Reduce size of track on CircularProgress
FlyersPh9 2369d77
Change thickness of both Circular & Linear track.
FlyersPh9 7c94fa9
Determinate demos display percentage completed.
FlyersPh9 7381b04
Merge branch 'main' into jon/progress-colors
FlyersPh9 e3ebe16
Singular color for progress indicators
FlyersPh9 096ffbd
Increase size of fill from 4 to 5
FlyersPh9 ef3e5bd
Remove end dot from determinate linear
FlyersPh9 4a15d98
Use CSS module for CircularProgress determinate demo
FlyersPh9 60dc625
Revert ef3e5bd.
FlyersPh9 ce00408
Updated docs
FlyersPh9 4ef2862
Merge branch 'main' into jon/progress-colors
FlyersPh9 9cc0a75
Add error, warning, info, success colors in CSS.
FlyersPh9 61ab7ef
Change thickness to 5
FlyersPh9 4401d88
Use accent base color
FlyersPh9 aceb5c7
Oops, that wasn't supposed to be there
FlyersPh9 14e0a87
Use inset-block-start, translate, and block-size instead of inset-blo…
FlyersPh9 77644b2
Use strong color only for primary
FlyersPh9 9dc22d3
Use strong color only for primary (circular)
FlyersPh9 2691f5f
Merge branch 'main' into jon/progress-colors
FlyersPh9 55621f6
Clean up buffer dashed line
FlyersPh9 0af89fe
Use inset-block-start and block-size instead of inset-block for progr…
FlyersPh9 a976f2e
Update packages/mui/src/~components/MuiLinearProgress.css
FlyersPh9 d8dfa20
min-width on linear progress docs demos
FlyersPh9 ebacbe1
Merge branch 'main' into jon/progress-colors
FlyersPh9 e9a6901
Merge branch 'main' into jon/progress-colors
FlyersPh9 4262a77
Update jsdocs for CircularProgress
FlyersPh9 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 @@ | ||
| --- | ||
| "@stratakit/mui": patch | ||
| --- | ||
|
|
||
| Styled `LinearProgress` to match the Strata visual design language. |
This file contains hidden or 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 @@ | ||
| --- | ||
| "@stratakit/mui": patch | ||
| --- | ||
|
|
||
| Styled `CircularProgress` to match the Strata visual design language. |
This file contains hidden or 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
This file contains hidden or 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
30 changes: 30 additions & 0 deletions
30
apps/website/src/content/docs/components/mui/CircularProgress.md
This file contains hidden or 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,30 @@ | ||
| --- | ||
| title: CircularProgress | ||
| description: Progress indicators are used to display a loading state or visualize the progress of an operation. | ||
| links: | ||
| muiDocs: https://mui.com/material-ui/react-progress/ | ||
| apiReference: https://mui.com/material-ui/api/circular-progress/ | ||
| --- | ||
|
|
||
| ::example{src="mui/CircularProgress.default"} | ||
|
|
||
| ## StrataKit MUI modifications | ||
|
|
||
| - The `enableTrackSlot` prop defaults to true. | ||
|
mayank99 marked this conversation as resolved.
|
||
| - Restyled using StrataKit's visual language. | ||
| - Includes full `forced-colors` support. | ||
|
|
||
| ## Examples | ||
|
|
||
| ### Colors | ||
|
|
||
| - **Primary:** The default. Use when indicating the primary loading state on a page. | ||
| - **Secondary:** Use when indicating a secondary loading state or when multiple loading states are shown at once. | ||
|
|
||
| ::example{src="mui/CircularProgress.colors"} | ||
|
|
||
| ### Determinate | ||
|
|
||
| Set the `variant` prop to `"determinate"` when the completion percentage is known. | ||
|
|
||
| ::example{src="mui/CircularProgress.determinate"} | ||
36 changes: 36 additions & 0 deletions
36
apps/website/src/content/docs/components/mui/LinearProgress.md
This file contains hidden or 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,36 @@ | ||
| --- | ||
| title: LinearProgress | ||
| description: Progress indicators are used to display a loading state or visualize the progress of an operation. | ||
| links: | ||
| muiDocs: https://mui.com/material-ui/react-progress/ | ||
| apiReference: https://mui.com/material-ui/api/linear-progress/ | ||
| --- | ||
|
|
||
| ::example{src="mui/LinearProgress.default"} | ||
|
FlyersPh9 marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## StrataKit MUI modifications | ||
|
|
||
| - Added an end marker when the `variant` prop is set to `"determinate"` or `"buffer"`. | ||
| - Restyled using StrataKit's visual language. | ||
| - Includes full `forced-colors` support. | ||
|
|
||
| ## Examples | ||
|
|
||
| ### Colors | ||
|
|
||
| - **Primary:** The default. Use when indicating the primary loading state on a page. | ||
| - **Secondary:** Use when indicating a secondary loading state or when multiple loading states are shown at once. | ||
|
|
||
| ::example{src="mui/LinearProgress.colors"} | ||
|
FlyersPh9 marked this conversation as resolved.
Outdated
|
||
|
|
||
| ### Determinate | ||
|
|
||
| Set the `variant` prop to `"determinate"` when the completion percentage is known. | ||
|
|
||
| ::example{src="mui/LinearProgress.determinate"} | ||
|
FlyersPh9 marked this conversation as resolved.
Outdated
|
||
|
|
||
| ### Buffer | ||
|
|
||
| Set the `variant` prop to `"buffer"` when progress and buffered work are tracked separately. | ||
|
|
||
| ::example{src="mui/LinearProgress.buffer"} | ||
|
FlyersPh9 marked this conversation as resolved.
Outdated
|
||
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,19 @@ | ||
| /*--------------------------------------------------------------------------------------------- | ||
| * Copyright (c) Bentley Systems, Incorporated. All rights reserved. | ||
| * See LICENSE.md in the project root for license terms and full copyright notice. | ||
| *--------------------------------------------------------------------------------------------*/ | ||
|
|
||
| import * as React from "react"; | ||
| import CircularProgress from "@mui/material/CircularProgress"; | ||
| import Typography from "@mui/material/Typography"; | ||
|
|
||
| export default () => { | ||
| const labelId = React.useId(); | ||
|
|
||
| return ( | ||
| <> | ||
| <CircularProgress color="secondary" aria-labelledby={labelId} /> | ||
| <Typography id={labelId}>Analyzing results…</Typography> | ||
| </> | ||
| ); | ||
| }; |
This file contains hidden or 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,17 @@ | ||
| /*--------------------------------------------------------------------------------------------- | ||
| * Copyright (c) Bentley Systems, Incorporated. All rights reserved. | ||
| * See LICENSE.md in the project root for license terms and full copyright notice. | ||
| *--------------------------------------------------------------------------------------------*/ | ||
|
|
||
| .container { | ||
| display: inline-flex; | ||
| position: relative; | ||
| } | ||
|
|
||
| .percentage { | ||
| align-items: center; | ||
| display: flex; | ||
| inset: 0; | ||
| justify-content: center; | ||
| position: absolute; | ||
| } |
This file contains hidden or 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
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,24 @@ | ||
| /*--------------------------------------------------------------------------------------------- | ||
| * Copyright (c) Bentley Systems, Incorporated. All rights reserved. | ||
| * See LICENSE.md in the project root for license terms and full copyright notice. | ||
| *--------------------------------------------------------------------------------------------*/ | ||
|
|
||
| import * as React from "react"; | ||
| import LinearProgress from "@mui/material/LinearProgress"; | ||
| import Typography from "@mui/material/Typography"; | ||
|
|
||
| export default () => { | ||
| const labelId = React.useId(); | ||
|
|
||
| return ( | ||
| <> | ||
| <LinearProgress | ||
| variant="buffer" | ||
| value={33} | ||
| valueBuffer={66} | ||
| aria-labelledby={labelId} | ||
| /> | ||
| <Typography id={labelId}>Buffering results…</Typography> | ||
| </> | ||
| ); | ||
| }; |
This file contains hidden or 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,19 @@ | ||
| /*--------------------------------------------------------------------------------------------- | ||
| * Copyright (c) Bentley Systems, Incorporated. All rights reserved. | ||
| * See LICENSE.md in the project root for license terms and full copyright notice. | ||
| *--------------------------------------------------------------------------------------------*/ | ||
|
|
||
| import * as React from "react"; | ||
| import LinearProgress from "@mui/material/LinearProgress"; | ||
| import Typography from "@mui/material/Typography"; | ||
|
|
||
| export default () => { | ||
| const labelId = React.useId(); | ||
|
|
||
| return ( | ||
| <> | ||
| <LinearProgress color="secondary" aria-labelledby={labelId} /> | ||
| <Typography id={labelId}>Analyzing results…</Typography> | ||
| </> | ||
| ); | ||
| }; |
This file contains hidden or 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,28 @@ | ||
| /*--------------------------------------------------------------------------------------------- | ||
| * Copyright (c) Bentley Systems, Incorporated. All rights reserved. | ||
| * See LICENSE.md in the project root for license terms and full copyright notice. | ||
| *--------------------------------------------------------------------------------------------*/ | ||
|
|
||
| import * as React from "react"; | ||
| import LinearProgress from "@mui/material/LinearProgress"; | ||
| import Stack from "@mui/material/Stack"; | ||
| import Typography from "@mui/material/Typography"; | ||
|
|
||
| export default () => { | ||
| const labelId = React.useId(); | ||
| const progress = 50; | ||
|
|
||
| return ( | ||
| <> | ||
| <LinearProgress | ||
| variant="determinate" | ||
| value={progress} | ||
| aria-labelledby={labelId} | ||
| /> | ||
| <Stack direction="row" sx={{ justifyContent: "space-between" }}> | ||
| <Typography id={labelId}>Uploading…</Typography> | ||
| <Typography>{progress}%</Typography> | ||
| </Stack> | ||
| </> | ||
| ); | ||
| }; |
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd prefer separate documentation pages per component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, we can split
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'll need to take a closer look at the determinate demos.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check for broken links now that
/components/progressno longer exists.And yeah, I don't feel confident in those determinate demos.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed anchors pointing to old progress docs URL in 1f03f4d.
The things I am uncertain about:
aria-labelledbyis tied only to "Uploading…", does not include the %.CircularProgressrequires an absolute positioned box to get the percentage centered.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Today we agreed to simplify the determinate examples to show the most basic usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplified determinate examples in f8a5294.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the determinate examples in 7c94fa9 to show the percentage but left out the animation.