-
Notifications
You must be signed in to change notification settings - Fork 377
docs(ProgressStepper): add examples to show alignment modifiers working together #7727
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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
369 changes: 13 additions & 356 deletions
369
packages/react-core/src/components/ProgressStepper/examples/ProgressStepper.md
Large diffs are not rendered by default.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
packages/react-core/src/components/ProgressStepper/examples/ProgressStepperBasic.tsx
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,21 @@ | ||
| import React from 'react'; | ||
| import { ProgressStepper, ProgressStep } from '@patternfly/react-core'; | ||
|
|
||
| export const ProgressStepperBasic: React.FunctionComponent = () => ( | ||
| <ProgressStepper> | ||
| <ProgressStep | ||
| variant="success" | ||
| id="basic-step1" | ||
| titleId="basic-step1-title" | ||
| aria-label="completed step, step with success" | ||
| > | ||
| First step | ||
| </ProgressStep> | ||
| <ProgressStep variant="info" isCurrent id="basic-step2" titleId="basic-step2-title" aria-label="step with info"> | ||
| Second step | ||
| </ProgressStep> | ||
| <ProgressStep variant="pending" id="basic-step3" titleId="basic-step3-title" aria-label="pending step"> | ||
| Third step | ||
| </ProgressStep> | ||
| </ProgressStepper> | ||
| ); | ||
48 changes: 48 additions & 0 deletions
48
packages/react-core/src/components/ProgressStepper/examples/ProgressStepperBasicFailure.tsx
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,48 @@ | ||
| import React from 'react'; | ||
| import { ProgressStepper, ProgressStep } from '@patternfly/react-core'; | ||
|
|
||
| export const ProgressStepperBasicFailure: React.FunctionComponent = () => ( | ||
| <ProgressStepper> | ||
| <ProgressStep | ||
| variant="success" | ||
| id="basic-with-failure-step1" | ||
| titleId="basic-with-failure-step1-title" | ||
| aria-label="completed step, step with success" | ||
| > | ||
| First step | ||
| </ProgressStep> | ||
| <ProgressStep | ||
| variant="success" | ||
| id="basic-with-failure-step2" | ||
| titleId="basic-with-failure-step2-title" | ||
| aria-label="completed step, step with success" | ||
| > | ||
| Second step | ||
| </ProgressStep> | ||
| <ProgressStep | ||
| variant="success" | ||
| id="basic-with-failure-step3" | ||
| titleId="basic-with-failure-step3-title" | ||
| aria-label="completed step, step with success" | ||
| > | ||
| Third step | ||
| </ProgressStep> | ||
| <ProgressStep | ||
| variant="danger" | ||
| isCurrent | ||
| id="basic-with-failure-step4" | ||
| titleId="basic-with-failure-step4-title" | ||
| aria-label="step with danger" | ||
| > | ||
| Fourth step | ||
| </ProgressStep> | ||
| <ProgressStep | ||
| variant="pending" | ||
| id="basic-with-failure-step5" | ||
| titleId="basic-with-failure-step5-title" | ||
| aria-label="pending step" | ||
| > | ||
| Fifth step | ||
| </ProgressStep> | ||
| </ProgressStepper> | ||
| ); |
48 changes: 48 additions & 0 deletions
48
packages/react-core/src/components/ProgressStepper/examples/ProgressStepperBasicIssue.tsx
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,48 @@ | ||
| import React from 'react'; | ||
| import { ProgressStepper, ProgressStep } from '@patternfly/react-core'; | ||
|
|
||
| export const ProgressStepperBasicIssue: React.FunctionComponent = () => ( | ||
| <ProgressStepper> | ||
| <ProgressStep | ||
| variant="success" | ||
| id="basic-with-issue-step1" | ||
| titleId="basic-with-issue-step1-title" | ||
| aria-label="completed step, step with success" | ||
| > | ||
| First step | ||
| </ProgressStep> | ||
| <ProgressStep | ||
| variant="success" | ||
| id="basic-with-issue-step2" | ||
| titleId="basic-with-issue-step2-title" | ||
| aria-label="completed step, step with success" | ||
| > | ||
| Second step | ||
| </ProgressStep> | ||
| <ProgressStep | ||
| variant="warning" | ||
| id="basic-with-issue-step3" | ||
| titleId="basic-with-issue-step3-title" | ||
| aria-label="completed step, step with warning" | ||
| > | ||
| Third step | ||
| </ProgressStep> | ||
| <ProgressStep | ||
| variant="info" | ||
| isCurrent | ||
| id="basic-with-issue-step4" | ||
| titleId="basic-with-issue-step4-title" | ||
| aria-label="step with info" | ||
| > | ||
| Fourth step | ||
| </ProgressStep> | ||
| <ProgressStep | ||
| variant="pending" | ||
| id="basic-with-issue-step5" | ||
| titleId="basic-with-issue-step5-title" | ||
| aria-label="pending step" | ||
| > | ||
| Fifth step | ||
| </ProgressStep> | ||
| </ProgressStepper> | ||
| ); |
59 changes: 59 additions & 0 deletions
59
.../react-core/src/components/ProgressStepper/examples/ProgressStepperBasicWithAlignment.tsx
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,59 @@ | ||
| import React from 'react'; | ||
| import { ProgressStepper, ProgressStep, Checkbox } from '@patternfly/react-core'; | ||
|
|
||
| export const ProgressStepperBasicWithAlignment: React.FunctionComponent = () => { | ||
| const [isVertical, setIsVertical] = React.useState(false); | ||
| const [isCenterAligned, setIsCenterAligned] = React.useState(false); | ||
|
|
||
| return ( | ||
| <React.Fragment> | ||
| <Checkbox | ||
| label="Vertical alignment" | ||
| isChecked={isVertical} | ||
| onChange={setIsVertical} | ||
| aria-label="Toggle vertical alignment" | ||
| id="toggle-vertical" | ||
| name="toggle-vertical" | ||
| /> | ||
| <Checkbox | ||
| label="Center alignment" | ||
| isChecked={isCenterAligned} | ||
| onChange={setIsCenterAligned} | ||
| aria-label="Toggle center alignment" | ||
| id="toggle-center" | ||
| name="toggle-center" | ||
| /> | ||
| <br /> | ||
| <ProgressStepper isVertical={isVertical} isCenterAligned={isCenterAligned}> | ||
| <ProgressStep | ||
| variant="success" | ||
| description="This is the first thing to happen" | ||
| id="basic-alignment-step1" | ||
| titleId="basic-alignment-step1-title" | ||
| aria-label="completed step, step with success" | ||
| > | ||
| First step | ||
| </ProgressStep> | ||
| <ProgressStep | ||
| variant="info" | ||
| isCurrent | ||
| description="This is the second thing to happen" | ||
| id="basic-alignment-step2" | ||
| titleId="basic-alignment-step2-title" | ||
| aria-label="step with info" | ||
| > | ||
| Second step | ||
| </ProgressStep> | ||
| <ProgressStep | ||
| variant="pending" | ||
| description="This is the last thing to happen" | ||
| id="basic-alignment-step3" | ||
| titleId="basic-alignment-step3-title" | ||
| aria-label="pending step" | ||
| > | ||
| Third step | ||
| </ProgressStep> | ||
| </ProgressStepper> | ||
| </React.Fragment> | ||
| ); | ||
| }; |
35 changes: 35 additions & 0 deletions
35
...eact-core/src/components/ProgressStepper/examples/ProgressStepperBasicWithDescription.tsx
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,35 @@ | ||
| import React from 'react'; | ||
| import { ProgressStepper, ProgressStep } from '@patternfly/react-core'; | ||
|
|
||
| export const ProgressStepperBasicWithDescription: React.FunctionComponent = () => ( | ||
| <ProgressStepper> | ||
| <ProgressStep | ||
| variant="success" | ||
| description="This is the first thing to happen" | ||
| id="basic-desc-step1" | ||
| titleId="basic-desc-step1-title" | ||
| aria-label="completed step, step with success" | ||
| > | ||
| First step | ||
| </ProgressStep> | ||
| <ProgressStep | ||
| variant="info" | ||
| isCurrent | ||
| description="This is the second thing to happen" | ||
| id="basic-desc-step2" | ||
| titleId="basic-desc-step2-title" | ||
| aria-label="step with info" | ||
| > | ||
| Second step | ||
| </ProgressStep> | ||
| <ProgressStep | ||
| variant="pending" | ||
| description="This is the last thing to happen" | ||
| id="basic-desc-step3" | ||
| titleId="basic-desc-step3-title" | ||
| aria-label="pending step" | ||
| > | ||
| Third step | ||
| </ProgressStep> | ||
| </ProgressStepper> | ||
| ); |
51 changes: 51 additions & 0 deletions
51
packages/react-core/src/components/ProgressStepper/examples/ProgressStepperCompact.tsx
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,51 @@ | ||
| import React from 'react'; | ||
| import { ProgressStepper, ProgressStep, Checkbox } from '@patternfly/react-core'; | ||
|
|
||
| export const ProgressStepperCompact: React.FunctionComponent = () => { | ||
| const [isVertical, setIsVertical] = React.useState(false); | ||
| const [isCenterAligned, setIsCenterAligned] = React.useState(false); | ||
|
|
||
| return ( | ||
| <React.Fragment> | ||
| <Checkbox | ||
| label="Vertical alignment" | ||
| isChecked={isVertical} | ||
| onChange={setIsVertical} | ||
| aria-label="Toggle compact vertical alignment" | ||
| id="toggle-compact-vertical" | ||
| name="toggle-compact-vertical" | ||
| /> | ||
| <Checkbox | ||
| label="Center alignment" | ||
| isChecked={isCenterAligned} | ||
| onChange={setIsCenterAligned} | ||
| aria-label="Toggle compact center alignment" | ||
| id="toggle-compact-center" | ||
| name="toggle-compact-center" | ||
| /> | ||
| <br /> | ||
| <ProgressStepper isCompact isVertical={isVertical} isCenterAligned={isCenterAligned}> | ||
| <ProgressStep | ||
| variant="success" | ||
| id="compact-step1" | ||
| titleId="compact-step1-title" | ||
| aria-label="completed step, step with success" | ||
| > | ||
| First step | ||
| </ProgressStep> | ||
| <ProgressStep | ||
| variant="info" | ||
| isCurrent | ||
| id="compact-step2" | ||
| titleId="compact-step2-title" | ||
| aria-label="step with info" | ||
| > | ||
| Second step | ||
| </ProgressStep> | ||
| <ProgressStep variant="pending" id="compact-step3" titleId="compact-step3-title" aria-label="pending step"> | ||
| Third step | ||
| </ProgressStep> | ||
| </ProgressStepper> | ||
| </React.Fragment> | ||
| ); | ||
| }; |
35 changes: 35 additions & 0 deletions
35
packages/react-core/src/components/ProgressStepper/examples/ProgressStepperCustomIcons.tsx
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,35 @@ | ||
| import React from 'react'; | ||
| import { ProgressStepper, ProgressStep } from '@patternfly/react-core'; | ||
| import InProgressIcon from '@patternfly/react-icons/dist/esm/icons/in-progress-icon'; | ||
| import PendingIcon from '@patternfly/react-icons/dist/esm/icons/pending-icon'; | ||
|
|
||
| export const ProgressStepperCustomIcons: React.FunctionComponent = () => ( | ||
| <ProgressStepper> | ||
| <ProgressStep | ||
| variant="success" | ||
| id="custom-step1" | ||
| titleId="custom-step1-title" | ||
| aria-label="completed step, step with success" | ||
| > | ||
| Successful completion | ||
| </ProgressStep> | ||
| <ProgressStep | ||
| isCurrent | ||
| icon={<InProgressIcon />} | ||
| id="custom-step2" | ||
| titleId="custom-step2-title" | ||
| aria-label="in progress" | ||
| > | ||
| In process | ||
| </ProgressStep> | ||
| <ProgressStep | ||
| variant="pending" | ||
| icon={<PendingIcon />} | ||
| id="custom-step3" | ||
| titleId="custom-step3-title" | ||
| aria-label="pending step" | ||
| > | ||
| Pending | ||
| </ProgressStep> | ||
| </ProgressStepper> | ||
| ); |
62 changes: 62 additions & 0 deletions
62
packages/react-core/src/components/ProgressStepper/examples/ProgressStepperHelpPopover.tsx
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,62 @@ | ||
| import React from 'react'; | ||
| import { ProgressStepper, ProgressStep, Popover } from '@patternfly/react-core'; | ||
|
|
||
| export const PopoverProgressStep = () => ( | ||
kmcfaul marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <ProgressStepper> | ||
| <ProgressStep | ||
| variant="success" | ||
| id="popover-step1" | ||
| titleId="popover-step1-title" | ||
| aria-label="completed step with popover, step with success" | ||
| popoverRender={stepRef => ( | ||
| <Popover | ||
| aria-label="First step help" | ||
| headerContent={<div>First step popover</div>} | ||
| bodyContent={<div>Additional info or help text content.</div>} | ||
| reference={stepRef} | ||
| position="right" | ||
| /> | ||
| )} | ||
| > | ||
| First step | ||
| </ProgressStep> | ||
| <ProgressStep | ||
| variant="danger" | ||
| id="popover-step2" | ||
| titleId="popover-step2-title" | ||
| aria-label="completed step with popover, step with danger" | ||
| popoverRender={stepRef => ( | ||
| <Popover | ||
| aria-label="Second step help" | ||
| headerContent={<div>Second step popover</div>} | ||
| bodyContent={<div>Additional info or help text content.</div>} | ||
| reference={stepRef} | ||
| position="right" | ||
| /> | ||
| )} | ||
| > | ||
| Second step | ||
| </ProgressStep> | ||
| <ProgressStep | ||
| variant="info" | ||
| id="popover-step3" | ||
| titleId="popover-step3-title" | ||
| aria-label="step with popover" | ||
| popoverRender={stepRef => ( | ||
| <Popover | ||
| aria-label="Third step help" | ||
| headerContent={<div>Third step popover</div>} | ||
| bodyContent={<div>Additional info or help text content.</div>} | ||
| reference={stepRef} | ||
| position="right" | ||
| /> | ||
| )} | ||
| isCurrent | ||
| > | ||
| Third step | ||
| </ProgressStep> | ||
| <ProgressStep variant="pending" id="popover-step4" titleId="popover-step4-title" aria-label="pending step"> | ||
| Fourth step | ||
| </ProgressStep> | ||
| </ProgressStepper> | ||
| ); | ||
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.
Uh oh!
There was an error while loading. Please reload this page.