-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
[core] Generify props with component property #16487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,19 +1,24 @@ | ||
import * as React from 'react'; | ||
import { OverridableComponent, SimplifiedPropsOf } from '@material-ui/core/OverridableComponent'; | ||
import { OverridableComponent, OverrideProps } from '@material-ui/core/OverridableComponent'; | ||
|
||
declare const Skeleton: OverridableComponent<{ | ||
props: { | ||
export interface SkeletonTypeMap<P = {}, D extends React.ElementType = 'hr'> { | ||
props: P & { | ||
disableAnimate?: boolean; | ||
height?: number | string; | ||
variant?: 'text' | 'rect' | 'circle'; | ||
width?: number | string; | ||
}; | ||
defaultComponent: 'div'; | ||
classKey: SkeletonClassKey; | ||
}>; | ||
} | ||
|
||
declare const Skeleton: OverridableComponent<SkeletonTypeMap>; | ||
|
||
export type SkeletonClassKey = 'root' | 'text' | 'rect' | 'circle' | 'animate'; | ||
|
||
export type SkeletonProps = SimplifiedPropsOf<typeof Skeleton>; | ||
export type SkeletonProps< | ||
D extends React.ElementType = SkeletonTypeMap['defaultComponent'], | ||
P = {} | ||
> = OverrideProps<SkeletonTypeMap<P, D>, D>; | ||
|
||
export default Skeleton; |
24 changes: 18 additions & 6 deletions
24
packages/material-ui-lab/src/ToggleButton/ToggleButton.d.ts
This file contains hidden or 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 hidden or 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,21 +1,26 @@ | ||
import * as React from 'react'; | ||
import { OverridableComponent, SimplifiedPropsOf } from '../OverridableComponent'; | ||
import { OverridableComponent, OverrideProps } from '../OverridableComponent'; | ||
|
||
declare const Avatar: OverridableComponent<{ | ||
props: { | ||
export interface AvatarTypeMap<P = {}, D extends React.ElementType = 'div'> { | ||
props: P & { | ||
alt?: string; | ||
childrenClassName?: string; | ||
imgProps?: React.ImgHTMLAttributes<HTMLImageElement>; | ||
sizes?: string; | ||
src?: string; | ||
srcSet?: string; | ||
}; | ||
defaultComponent: 'div'; | ||
defaultComponent: D; | ||
classKey: AvatarClassKey; | ||
}>; | ||
} | ||
|
||
declare const Avatar: OverridableComponent<AvatarTypeMap>; | ||
|
||
export type AvatarClassKey = 'root' | 'colorDefault' | 'img'; | ||
|
||
export type AvatarProps = SimplifiedPropsOf<typeof Avatar>; | ||
export type AvatarProps< | ||
D extends React.ElementType = AvatarTypeMap['defaultComponent'], | ||
P = {} | ||
> = OverrideProps<AvatarTypeMap<P, D>, D>; | ||
|
||
export default Avatar; |
This file contains hidden or 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 hidden or 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,19 +1,24 @@ | ||
import * as React from 'react'; | ||
import { OverridableComponent, SimplifiedPropsOf } from '../OverridableComponent'; | ||
import { OverridableComponent, OverrideProps } from '../OverridableComponent'; | ||
|
||
declare const Breadcrumbs: OverridableComponent<{ | ||
props: { | ||
export interface BreadcrumbsTypeMap<P = {}, D extends React.ElementType = 'nav'> { | ||
props: P & { | ||
itemsAfterCollapse?: number; | ||
itemsBeforeCollapse?: number; | ||
maxItems?: number; | ||
separator?: React.ReactNode; | ||
}; | ||
defaultComponent: 'nav'; | ||
defaultComponent: D; | ||
classKey: BreadcrumbsClassKey; | ||
}>; | ||
} | ||
|
||
declare const Breadcrumbs: OverridableComponent<BreadcrumbsTypeMap>; | ||
|
||
export type BreadcrumbsClassKey = 'root' | 'ol' | 'li' | 'separator'; | ||
|
||
export type BreadcrumbsProps = SimplifiedPropsOf<typeof Breadcrumbs>; | ||
export type BreadcrumbsProps< | ||
D extends React.ElementType = BreadcrumbsTypeMap['defaultComponent'], | ||
P = {} | ||
> = OverrideProps<BreadcrumbsTypeMap<P, D>, D>; | ||
|
||
export default Breadcrumbs; |
This file contains hidden or 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 hidden or 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 hidden or 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
19 changes: 13 additions & 6 deletions
19
packages/material-ui/src/CardActionArea/CardActionArea.d.ts
This file contains hidden or 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,16 +1,23 @@ | ||
import { ButtonBaseTypeMap, ExtendButtonBase } from '../ButtonBase'; | ||
import { SimplifiedPropsOf } from '../OverridableComponent'; | ||
import { ButtonBaseTypeMap, ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase'; | ||
import { OverrideProps } from '../OverridableComponent'; | ||
|
||
declare const CardActionArea: ExtendButtonBase<{ | ||
props: { | ||
export type CardActionAreaTypeMap<P, D extends React.ElementType> = ExtendButtonBaseTypeMap<{ | ||
props: P & { | ||
focusVisibleClassName?: string; | ||
}; | ||
defaultComponent: ButtonBaseTypeMap['defaultComponent']; | ||
defaultComponent: D; | ||
classKey: CardActionAreaClassKey; | ||
}>; | ||
|
||
declare const CardActionArea: ExtendButtonBase< | ||
CardActionAreaTypeMap<{}, ButtonBaseTypeMap['defaultComponent']> | ||
>; | ||
|
||
export type CardActionAreaClassKey = 'root' | 'focusVisible' | 'focusHighlight'; | ||
|
||
export type CardActionAreaProps = SimplifiedPropsOf<typeof CardActionArea>; | ||
export type CardActionAreaProps< | ||
D extends React.ElementType = ButtonBaseTypeMap['defaultComponent'], | ||
P = {} | ||
> = OverrideProps<CardActionAreaTypeMap<P, D>, D>; | ||
|
||
export default CardActionArea; |
This file contains hidden or 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 hidden or 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,18 +1,23 @@ | ||
import { OverridableComponent, SimplifiedPropsOf } from '../OverridableComponent'; | ||
import { OverridableComponent, OverrideProps } from '../OverridableComponent'; | ||
|
||
declare const Divider: OverridableComponent<{ | ||
props: { | ||
export interface DividerTypeMap<P = {}, D extends React.ElementType = 'hr'> { | ||
props: P & { | ||
absolute?: boolean; | ||
light?: boolean; | ||
orientation?: 'horizontal' | 'vertical'; | ||
variant?: 'fullWidth' | 'inset' | 'middle'; | ||
}; | ||
defaultComponent: 'hr'; | ||
defaultComponent: D; | ||
classKey: DividerClassKey; | ||
}>; | ||
} | ||
|
||
declare const Divider: OverridableComponent<DividerTypeMap>; | ||
|
||
export type DividerClassKey = 'root' | 'absolute' | 'inset' | 'light' | 'middle' | 'vertical'; | ||
|
||
export type DividerProps = SimplifiedPropsOf<typeof Divider>; | ||
export type DividerProps< | ||
D extends React.ElementType = DividerTypeMap['defaultComponent'], | ||
P = {} | ||
> = OverrideProps<DividerTypeMap<P, D>, D>; | ||
|
||
export default Divider; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.