Skip to content
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

Large diffs are not rendered by default.

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>
);
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>
);
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>
);
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>
);
};
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>
);
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>
);
};
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>
);
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 = () => (
<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>
);