-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! Refactor(web-react): Move away from the
defaultProps
- Loading branch information
Showing
3 changed files
with
42 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { ElementType, JSXElementConstructor, ReactNode } from 'react'; | ||
import { ValidationTextProp } from '../../types'; | ||
import { RegisterType } from './useAriaIds'; | ||
|
||
export interface FieldElementTypeProps<T extends ElementType = 'div'> { | ||
/** | ||
* The HTML element or React element used to render the pill, e.g. 'div', 'span'. | ||
* | ||
* @default 'div' | ||
*/ | ||
elementType?: T | JSXElementConstructor<unknown>; | ||
} | ||
|
||
export interface FieldProps<T extends ElementType = 'div'> extends FieldElementTypeProps<T> { | ||
className?: string; | ||
id?: string; | ||
registerAria?: RegisterType; | ||
} | ||
|
||
export interface HelperTextProps<T extends ElementType = 'div'> extends FieldProps<T> { | ||
helperText: ReactNode; | ||
} | ||
|
||
export interface ValidationTextProps<T extends ElementType = 'div'> extends FieldProps<T>, ValidationTextProp {} |