-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an indeterminate linear progress bar (#3429)
Co-authored-by: origami-z <[email protected]> Co-authored-by: Josh Wooding <[email protected]> Co-authored-by: navkaur76 <[email protected]>
- Loading branch information
1 parent
da92421
commit 8b43adf
Showing
16 changed files
with
201 additions
and
219 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,9 @@ | ||
--- | ||
"@salt-ds/core": minor | ||
--- | ||
|
||
Updated `LinearProgress` to display a moving line to represent an unspecified wait time, when `value` is `undefined`. | ||
|
||
`<LinearProgress />` | ||
|
||
_Note_: `value` and `bufferValue` are no longer default to `0`. Previously above code would render a 0% progress bar, which was not a good reflection of intent. You can still achieve it by passing in `value={0}`. |
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
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
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
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
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,3 @@ | ||
.noAnimation.saltLinearProgress .saltLinearProgress-indeterminate.saltLinearProgress-bar { | ||
animation: none; | ||
} |
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
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
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 |
---|---|---|
@@ -1,39 +1,20 @@ | ||
import { ReactElement, useState } from "react"; | ||
import { | ||
FlexItem, | ||
FlexLayout, | ||
FlowLayout, | ||
RadioButton, | ||
RadioButtonGroup, | ||
CircularProgress, | ||
FlexItem, | ||
LinearProgress, | ||
StackLayout, | ||
} from "@salt-ds/core"; | ||
import { ReactElement } from "react"; | ||
|
||
export const HiddenLabel = (): ReactElement => { | ||
const [selectedType, setSelectedType] = useState("circular"); | ||
|
||
return ( | ||
<FlexLayout direction="column" style={{ height: "100%" }}> | ||
<FlowLayout justify="center" gap={1}> | ||
<RadioButtonGroup | ||
direction="horizontal" | ||
value={selectedType} | ||
aria-label="Progress type control" | ||
onChange={(e) => setSelectedType(e.target.value)} | ||
> | ||
<RadioButton label="Circular" value="circular" /> | ||
<RadioButton label="Linear" value="linear" /> | ||
</RadioButtonGroup> | ||
</FlowLayout> | ||
|
||
<FlexItem style={{ margin: "auto" }}> | ||
{selectedType === "circular" && ( | ||
<CircularProgress aria-label="Download" value={38} hideLabel /> | ||
)} | ||
{selectedType === "linear" && ( | ||
<LinearProgress aria-label="Download" value={38} hideLabel /> | ||
)} | ||
<StackLayout align="center"> | ||
<FlexItem> | ||
<CircularProgress aria-label="Download" value={38} hideLabel /> | ||
</FlexItem> | ||
<FlexItem> | ||
<LinearProgress aria-label="Download" value={38} hideLabel /> | ||
</FlexItem> | ||
</FlexLayout> | ||
</StackLayout> | ||
); | ||
}; |
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,28 @@ | ||
import { | ||
Button, | ||
LinearProgress, | ||
Text, | ||
Toast, | ||
ToastContent, | ||
} from "@salt-ds/core"; | ||
import { CloseIcon } from "@salt-ds/icons"; | ||
import { ReactElement } from "react"; | ||
|
||
export const LinearIndeterminate = (): ReactElement => { | ||
return ( | ||
<Toast status="info"> | ||
<ToastContent> | ||
<div> | ||
<Text> | ||
<strong>File uploading</strong> | ||
</Text> | ||
<Text>File upload to shared drive in progress.</Text> | ||
<LinearProgress aria-label="Download" /> | ||
</div> | ||
</ToastContent> | ||
<Button variant="secondary" aria-label="Dismiss"> | ||
<CloseIcon aria-hidden /> | ||
</Button> | ||
</Toast> | ||
); | ||
}; |
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 |
---|---|---|
@@ -1,41 +1,23 @@ | ||
import { ReactElement, useState } from "react"; | ||
import { | ||
CircularProgress, | ||
FlexItem, | ||
FlexLayout, | ||
FlowLayout, | ||
H3, | ||
RadioButton, | ||
RadioButtonGroup, | ||
CircularProgress, | ||
LinearProgress, | ||
StackLayout, | ||
} from "@salt-ds/core"; | ||
import { ReactElement } from "react"; | ||
|
||
export const WithBuffer = (): ReactElement => { | ||
const [selectedType, setSelectedType] = useState("circular"); | ||
|
||
return ( | ||
<FlexLayout direction="column" align="center" style={{ height: "100%" }}> | ||
<StackLayout align="center"> | ||
<H3> value = 38, buffer value = 60</H3> | ||
<FlowLayout justify="center" gap={1}> | ||
<RadioButtonGroup | ||
direction="horizontal" | ||
value={selectedType} | ||
aria-label="Progress type control" | ||
onChange={(e) => setSelectedType(e.target.value)} | ||
> | ||
<RadioButton label="Circular" value="circular" /> | ||
<RadioButton label="Linear" value="linear" /> | ||
</RadioButtonGroup> | ||
</FlowLayout> | ||
|
||
<FlexItem style={{ margin: "auto" }}> | ||
{selectedType === "circular" && ( | ||
<CircularProgress aria-label="Download" value={38} bufferValue={60} /> | ||
)} | ||
{selectedType === "linear" && ( | ||
<LinearProgress aria-label="Download" value={38} bufferValue={60} /> | ||
)} | ||
<FlexItem> | ||
<CircularProgress aria-label="Download" value={38} bufferValue={60} /> | ||
</FlexItem> | ||
<FlexItem> | ||
<LinearProgress aria-label="Download" value={38} bufferValue={60} /> | ||
</FlexItem> | ||
</FlexLayout> | ||
</StackLayout> | ||
); | ||
}; |
Oops, something went wrong.