diff --git a/packages/react-core/src/components/ProgressStepper/examples/ProgressStepper.md b/packages/react-core/src/components/ProgressStepper/examples/ProgressStepper.md index d2ef2be29c4..6ef7dd060dc 100644 --- a/packages/react-core/src/components/ProgressStepper/examples/ProgressStepper.md +++ b/packages/react-core/src/components/ProgressStepper/examples/ProgressStepper.md @@ -15,387 +15,44 @@ Progress steppers have default icons associated with the `variant` property, and ### Basic -```js -import React from 'react'; -import { ProgressStepper, ProgressStep } from '@patternfly/react-core'; - - - - First step - - - Second step - - - Third step - -; +```ts file="ProgressStepperBasic.tsx" ``` -### Basic with descriptions - -```js -import React from 'react'; -import { ProgressStepper, ProgressStep } from '@patternfly/react-core'; +### With step descriptions - - - First step - - - Second step - - - Third step - -; +```ts file="ProgressStepperBasicWithDescription.tsx" ``` -### Center aligned with descriptions - -```js -import React from 'react'; -import { ProgressStepper, ProgressStep } from '@patternfly/react-core'; - - - - First step - - - Second step - - - Third step - -; -``` - -### Vertical with descriptions - -```js -import React from 'react'; -import { ProgressStepper, ProgressStep } from '@patternfly/react-core'; +### With alignment - - - First step - - - Second step - - - Third step - -; +```ts file="ProgressStepperBasicWithAlignment.tsx" ``` ### Compact Compact progress steppers will only display the current step's `title`, and will not display any steps' `description` texts. -```js -import React from 'react'; -import { ProgressStepper, ProgressStep } from '@patternfly/react-core'; - - - - First step - - - Second step - - - Third step - -; +```ts file="ProgressStepperCompact.tsx" ``` -### Basic with an issue - -```js -import React from 'react'; -import { ProgressStepper, ProgressStep } from '@patternfly/react-core'; +### With an issue - - - First step - - - Second step - - - Third step - - - Fourth step - - - Fifth step - -; +```ts file="ProgressStepperBasicIssue.tsx" ``` -### Basic with a failure +### With a failure -```js -import React from 'react'; -import { ProgressStepper, ProgressStep } from '@patternfly/react-core'; - - - - First step - - - Second step - - - Third step - - - Fourth step - - - Fifth step - -; +```ts file="ProgressStepperBasicFailure.tsx" ``` -### Basic with Patternfly icons +### With custom icons -```js -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'; - - - - Successful completion - - } - id="custom-step2" - titleId="custom-step2-title" - aria-label="in progress" - > - In process - - } - id="custom-step3" - titleId="custom-step3-title" - aria-label="pending step" - > - Pending - -; +```ts file="ProgressStepperCustomIcons.tsx" ``` ### With help popover To add a popover to a progress step, set the `popoverRender` properties on the `ProgressStep` component. -```js -import React from 'react'; -import { ProgressStepper, ProgressStep, Popover } from '@patternfly/react-core'; - -PopoverProgressStep = () => { - return ( - - ( - First step popover} - bodyContent={Additional info or help text content.} - reference={stepRef} - position="right" - /> - )} - > - First step - - ( - Second step popover} - bodyContent={Additional info or help text content.} - reference={stepRef} - position="right" - /> - )} - > - Second step - - ( - Third step popover} - bodyContent={Additional info or help text content.} - reference={stepRef} - position="right" - /> - )} - isCurrent - > - Third step - - - Fourth step - - - ); -}; +```ts file="ProgressStepperHelpPopover.tsx" ``` diff --git a/packages/react-core/src/components/ProgressStepper/examples/ProgressStepperBasic.tsx b/packages/react-core/src/components/ProgressStepper/examples/ProgressStepperBasic.tsx new file mode 100644 index 00000000000..614f0d66db4 --- /dev/null +++ b/packages/react-core/src/components/ProgressStepper/examples/ProgressStepperBasic.tsx @@ -0,0 +1,21 @@ +import React from 'react'; +import { ProgressStepper, ProgressStep } from '@patternfly/react-core'; + +export const ProgressStepperBasic: React.FunctionComponent = () => ( + + + First step + + + Second step + + + Third step + + +); diff --git a/packages/react-core/src/components/ProgressStepper/examples/ProgressStepperBasicFailure.tsx b/packages/react-core/src/components/ProgressStepper/examples/ProgressStepperBasicFailure.tsx new file mode 100644 index 00000000000..63819b50361 --- /dev/null +++ b/packages/react-core/src/components/ProgressStepper/examples/ProgressStepperBasicFailure.tsx @@ -0,0 +1,48 @@ +import React from 'react'; +import { ProgressStepper, ProgressStep } from '@patternfly/react-core'; + +export const ProgressStepperBasicFailure: React.FunctionComponent = () => ( + + + First step + + + Second step + + + Third step + + + Fourth step + + + Fifth step + + +); diff --git a/packages/react-core/src/components/ProgressStepper/examples/ProgressStepperBasicIssue.tsx b/packages/react-core/src/components/ProgressStepper/examples/ProgressStepperBasicIssue.tsx new file mode 100644 index 00000000000..fcecdd989bf --- /dev/null +++ b/packages/react-core/src/components/ProgressStepper/examples/ProgressStepperBasicIssue.tsx @@ -0,0 +1,48 @@ +import React from 'react'; +import { ProgressStepper, ProgressStep } from '@patternfly/react-core'; + +export const ProgressStepperBasicIssue: React.FunctionComponent = () => ( + + + First step + + + Second step + + + Third step + + + Fourth step + + + Fifth step + + +); diff --git a/packages/react-core/src/components/ProgressStepper/examples/ProgressStepperBasicWithAlignment.tsx b/packages/react-core/src/components/ProgressStepper/examples/ProgressStepperBasicWithAlignment.tsx new file mode 100644 index 00000000000..d94bc74d72f --- /dev/null +++ b/packages/react-core/src/components/ProgressStepper/examples/ProgressStepperBasicWithAlignment.tsx @@ -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 ( + + + + + + + First step + + + Second step + + + Third step + + + + ); +}; diff --git a/packages/react-core/src/components/ProgressStepper/examples/ProgressStepperBasicWithDescription.tsx b/packages/react-core/src/components/ProgressStepper/examples/ProgressStepperBasicWithDescription.tsx new file mode 100644 index 00000000000..3e1eaeda69e --- /dev/null +++ b/packages/react-core/src/components/ProgressStepper/examples/ProgressStepperBasicWithDescription.tsx @@ -0,0 +1,35 @@ +import React from 'react'; +import { ProgressStepper, ProgressStep } from '@patternfly/react-core'; + +export const ProgressStepperBasicWithDescription: React.FunctionComponent = () => ( + + + First step + + + Second step + + + Third step + + +); diff --git a/packages/react-core/src/components/ProgressStepper/examples/ProgressStepperCompact.tsx b/packages/react-core/src/components/ProgressStepper/examples/ProgressStepperCompact.tsx new file mode 100644 index 00000000000..297f6ad884f --- /dev/null +++ b/packages/react-core/src/components/ProgressStepper/examples/ProgressStepperCompact.tsx @@ -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 ( + + + + + + + First step + + + Second step + + + Third step + + + + ); +}; diff --git a/packages/react-core/src/components/ProgressStepper/examples/ProgressStepperCustomIcons.tsx b/packages/react-core/src/components/ProgressStepper/examples/ProgressStepperCustomIcons.tsx new file mode 100644 index 00000000000..3c353a3c2c5 --- /dev/null +++ b/packages/react-core/src/components/ProgressStepper/examples/ProgressStepperCustomIcons.tsx @@ -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 = () => ( + + + Successful completion + + } + id="custom-step2" + titleId="custom-step2-title" + aria-label="in progress" + > + In process + + } + id="custom-step3" + titleId="custom-step3-title" + aria-label="pending step" + > + Pending + + +); diff --git a/packages/react-core/src/components/ProgressStepper/examples/ProgressStepperHelpPopover.tsx b/packages/react-core/src/components/ProgressStepper/examples/ProgressStepperHelpPopover.tsx new file mode 100644 index 00000000000..a4e80e5c37c --- /dev/null +++ b/packages/react-core/src/components/ProgressStepper/examples/ProgressStepperHelpPopover.tsx @@ -0,0 +1,62 @@ +import React from 'react'; +import { ProgressStepper, ProgressStep, Popover } from '@patternfly/react-core'; + +export const PopoverProgressStep = () => ( + + ( + First step popover} + bodyContent={Additional info or help text content.} + reference={stepRef} + position="right" + /> + )} + > + First step + + ( + Second step popover} + bodyContent={Additional info or help text content.} + reference={stepRef} + position="right" + /> + )} + > + Second step + + ( + Third step popover} + bodyContent={Additional info or help text content.} + reference={stepRef} + position="right" + /> + )} + isCurrent + > + Third step + + + Fourth step + + +);