Skip to content

Commit

Permalink
[material-ui][types] Make slots partial in CreateSlotsAndSlotPropty…
Browse files Browse the repository at this point in the history
…pe (#42077)
  • Loading branch information
lhilgert9 authored Sep 4, 2024
1 parent c7cd5bd commit a6dc0c3
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions packages/mui-material/src/Accordion/Accordion.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ export interface AccordionSlots {
* The component that renders the heading.
* @default 'h3'
*/
heading?: React.ElementType;
heading: React.ElementType;
/**
* The component that renders the transition.
* [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
* @default Collapse
*/
transition?: React.JSXElementConstructor<
transition: React.JSXElementConstructor<
TransitionProps & { children?: React.ReactElement<unknown, any> }
>;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/mui-material/src/Alert/Alert.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ export interface AlertSlots {
* The component that renders the close button.
* @default IconButton
*/
closeButton?: React.ElementType;
closeButton: React.ElementType;
/**
* The component that renders the close icon.
* @default svg
*/
closeIcon?: React.ElementType;
closeIcon: React.ElementType;
}

export type AlertSlotsAndSlotProps = CreateSlotsAndSlotProps<
Expand Down
6 changes: 3 additions & 3 deletions packages/mui-material/src/Autocomplete/Autocomplete.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,17 @@ export interface AutocompleteSlots {
* The component used to render the listbox.
* @default 'ul'
*/
listbox?: React.JSXElementConstructor<React.HTMLAttributes<HTMLElement>>;
listbox: React.JSXElementConstructor<React.HTMLAttributes<HTMLElement>>;
/**
* The component used to render the body of the popup.
* @default Paper
*/
paper?: React.JSXElementConstructor<PaperProps>;
paper: React.JSXElementConstructor<PaperProps>;
/**
* The component used to position the popup.
* @default Popper
*/
popper?: React.JSXElementConstructor<PopperProps>;
popper: React.JSXElementConstructor<PopperProps>;
}

export type AutocompleteSlotsAndSlotProps<
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material/src/Avatar/Avatar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface AvatarSlots {
* [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
* @default Collapse
*/
img?: React.JSXElementConstructor<React.ImgHTMLAttributes<HTMLImageElement>>;
img: React.JSXElementConstructor<React.ImgHTMLAttributes<HTMLImageElement>>;
}

export interface AvatarPropsVariantOverrides {}
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material/src/AvatarGroup/AvatarGroup.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface AvatarGroupPropsVariantOverrides {}
export interface AvatarGroupComponentsPropsOverrides {}

export interface AvatarGroupSlots {
surplus?: React.ElementType;
surplus: React.ElementType;
}

export type AvatarGroupSlotsAndSlotProps = CreateSlotsAndSlotProps<
Expand Down
4 changes: 2 additions & 2 deletions packages/mui-material/src/Backdrop/Backdrop.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ export interface BackdropSlots {
* The component that renders the root.
* @default 'div'
*/
root?: React.ElementType;
root: React.ElementType;
/**
* The component that renders the transition.
* [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
* @default Fade
*/
transition?: React.JSXElementConstructor<
transition: React.JSXElementConstructor<
TransitionProps & { children: React.ReactElement<unknown, any> }
>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface FormControlLabelSlots {
* This is unused if `disableTypography` is true.
* @default Typography
*/
typography?: React.ElementType;
typography: React.ElementType;
}

export type FormControlLabelSlotsAndSlotProps = CreateSlotsAndSlotProps<
Expand Down
8 changes: 4 additions & 4 deletions packages/mui-material/src/PaginationItem/PaginationItem.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ export interface PaginationItemPropsSizeOverrides {}
export interface PaginationItemPropsColorOverrides {}

export interface PaginationItemSlots {
first?: React.ElementType;
last?: React.ElementType;
next?: React.ElementType;
previous?: React.ElementType;
first: React.ElementType;
last: React.ElementType;
next: React.ElementType;
previous: React.ElementType;
}

export type PaginationItemSlotsAndSlotProps = CreateSlotsAndSlotProps<
Expand Down
4 changes: 2 additions & 2 deletions packages/mui-material/src/Popover/Popover.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { PopoverClasses } from './popoverClasses';
import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types';

export interface PopoverSlots {
root?: React.ElementType;
paper?: React.ElementType;
root: React.ElementType;
paper: React.ElementType;
}

export type PopoverSlotsAndSlotProps = CreateSlotsAndSlotProps<
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material/src/SpeedDial/SpeedDial.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface SpeedDialSlots {
* [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
* @default {}
*/
transition?: React.JSXElementConstructor<
transition: React.JSXElementConstructor<
TransitionProps & { children: React.ReactElement<unknown, any> }
>;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/mui-material/src/StepLabel/StepLabel.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ export interface StepLabelSlots {
* The component that renders the label.
* @default span
*/
label?: React.ElementType;
label: React.ElementType;
/**
* The component to render in place of the [`StepIcon`](https://mui.com/material-ui/api/step-icon/).
*/
stepIcon?: React.ElementType<StepIconProps>;
stepIcon: React.ElementType<StepIconProps>;
}

export type StepLabelSlotsAndSlotProps = CreateSlotsAndSlotProps<
Expand Down
10 changes: 5 additions & 5 deletions packages/mui-material/src/TextField/TextField.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,27 @@ export interface TextFieldSlots {
* The component that renders the input.
* @default OutlinedInput
*/
input?: React.ElementType;
input: React.ElementType;
/**
* The component that renders the input's label.
* @default InputLabel
*/
inputLabel?: React.ElementType;
inputLabel: React.ElementType;
/**
* The html input element.
* @default 'input'
*/
htmlInput?: React.ElementType;
htmlInput: React.ElementType;
/**
* The component that renders the helper text.
* @default FormHelperText
*/
formHelperText?: React.ElementType;
formHelperText: React.ElementType;
/**
* The component that renders the select.
* @default Select
*/
select?: React.ElementType;
select: React.ElementType;
}

export type TextFieldSlotsAndSlotProps<InputPropsType> = CreateSlotsAndSlotProps<
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material/src/utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export type CreateSlotsAndSlotProps<Slots, K extends Record<keyof Slots, any>> =
* The components used for each slot inside.
* @default {}
*/
slots?: Slots;
slots?: Partial<Slots>;
/**
* The props used for each slot inside.
* @default {}
Expand Down

0 comments on commit a6dc0c3

Please sign in to comment.