-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Wizard - next): supporting component unit tests (#7731)
* feat(Wizard - next): supporting component unit tests * refactor WizardToggle a bit more and address feedback
- Loading branch information
Showing
22 changed files
with
919 additions
and
449 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
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
8 changes: 4 additions & 4 deletions
8
packages/react-core/src/next/components/Wizard/WizardStep.tsx
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,23 +1,23 @@ | ||
import React from 'react'; | ||
|
||
import { WizardControlStep } from './types'; | ||
import { WizardBasicStep } from './types'; | ||
import { WizardBody, WizardBodyProps } from './WizardBody'; | ||
|
||
/** | ||
* Used as a passthrough of step properties for Wizard and all supporting child components. | ||
* Also acts as a wrapper for content, with an optional inclusion of WizardBody. | ||
*/ | ||
|
||
export interface WizardStepProps extends Omit<WizardControlStep, 'parentId' | 'subStepIds' | 'visited'> { | ||
export interface WizardStepProps extends Omit<WizardBasicStep, 'visited'> { | ||
/** Optional for when the step is used as a parent to sub-steps */ | ||
children?: React.ReactNode; | ||
/** Props for WizardBody that wraps content by default. Can be set to null for exclusion of WizardBody. */ | ||
body?: WizardBodyProps | null; | ||
body?: Omit<WizardBodyProps, 'children'> | null; | ||
/** Optional list of sub-steps */ | ||
steps?: React.ReactElement<WizardStepProps>[]; | ||
} | ||
|
||
export const WizardStep = ({ body, children }: WizardStepProps) => | ||
body === undefined ? <WizardBody {...body}>{children}</WizardBody> : <>{children}</>; | ||
body || body === undefined ? <WizardBody {...body}>{children}</WizardBody> : <>{children}</>; | ||
|
||
WizardStep.displayName = 'WizardStep'; |
Oops, something went wrong.