diff --git a/packages/react/src/stepper/MdStep.tsx b/packages/react/src/stepper/MdStep.tsx index f38b59fb..08cda918 100644 --- a/packages/react/src/stepper/MdStep.tsx +++ b/packages/react/src/stepper/MdStep.tsx @@ -1,13 +1,17 @@ import React from 'react'; -export interface MdStepProps { +export interface MdStepProps extends React.HTMLAttributes { title: string; children: React.ReactNode; completedContent?: React.ReactNode; } -const MdStep: React.FunctionComponent = ({ children }: MdStepProps) => { - return
{children}
; +const MdStep: React.FunctionComponent = ({ children, ...otherProps }: MdStepProps) => { + // Destructure the title and completedContent props from the otherProps object + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const { title, completedContent, ...rest } = otherProps; + + return
{children}
; }; export default MdStep; diff --git a/stories/Stepper.stories.tsx b/stories/Stepper.stories.tsx index c50858f1..51d4769b 100644 --- a/stories/Stepper.stories.tsx +++ b/stories/Stepper.stories.tsx @@ -1,9 +1,9 @@ import { Title, Subtitle, Description, Controls, Primary, Markdown } from '@storybook/addon-docs'; import { useArgs } from '@storybook/client-api'; import React from 'react'; - import Readme from '../packages/css/src/stepper/README.md'; import MdButton from '../packages/react/src/button/MdButton'; +import MdChevronIcon from '../packages/react/src/icons/MdChevronIcon'; import MdStep from '../packages/react/src/stepper/MdStep'; import MdStepper from '../packages/react/src/stepper/MdStepper'; import type { Args, StoryFn } from '@storybook/react'; @@ -97,44 +97,66 @@ export const Stepper: StoryFn = (args: Args) => { updateArgs({ activeStep: args.activeStep - 1 }); }; + const stepContentStyle: React.CSSProperties = { + display: 'flex', + flexDirection: 'column', + gap: '0.5rem', + }; + + const buttonStyle: React.CSSProperties = { + display: 'flex', + flexDirection: 'row', + gap: '1rem', + }; + + const fontStyle: React.CSSProperties = { + fontFamily: 'Open sans', + }; + return ( <> +
This is a completed step, which can be shown differently if the "completedContent" prop is - provided - + provided. +
} > -
- This is a step - - Next +
+ This is a step. + } onClick={nextStep}> + Go to step 2
This is what Step 2 looks like when completed, this is completely customizable!} + style={fontStyle} + completedContent={ +
This is what Step 2 looks like when completed, this is completely customizable!
+ } > -
+
This is the content of a MdStep. It can contain anything you want, text or HTML.

Here is a paragraph!

- - Next - - - Previous - +
+ + Previous + + } onClick={nextStep}> + Go to step 3 + +
- -
- This is the last step in this example - + +
+ This is the last step in this example. + Previous