Skip to content

Commit 155f2f9

Browse files
author
Alex
committed
add AccordionOwnProps interface
1 parent 8ea1738 commit 155f2f9

File tree

1 file changed

+57
-55
lines changed

1 file changed

+57
-55
lines changed

packages/mui-material/src/Accordion/Accordion.d.ts

Lines changed: 57 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -70,66 +70,68 @@ export type AccordionSlotsAndSlotProps = CreateSlotsAndSlotProps<
7070
}
7171
>;
7272

73+
export interface AccordionOwnProps {
74+
/**
75+
* The content of the component.
76+
*/
77+
children: NonNullable<React.ReactNode>;
78+
/**
79+
* Override or extend the styles applied to the component.
80+
*/
81+
classes?: Partial<AccordionClasses>;
82+
/**
83+
* If `true`, expands the accordion by default.
84+
* @default false
85+
*/
86+
defaultExpanded?: boolean;
87+
/**
88+
* If `true`, the component is disabled.
89+
* @default false
90+
*/
91+
disabled?: boolean;
92+
/**
93+
* If `true`, it removes the margin between two expanded accordion items and the increase of height.
94+
* @default false
95+
*/
96+
disableGutters?: boolean;
97+
/**
98+
* If `true`, expands the accordion, otherwise collapse it.
99+
* Setting this prop enables control over the accordion.
100+
*/
101+
expanded?: boolean;
102+
/**
103+
* Callback fired when the expand/collapse state is changed.
104+
*
105+
* @param {React.SyntheticEvent} event The event source of the callback. **Warning**: This is a generic event not a change event.
106+
* @param {boolean} expanded The `expanded` state of the accordion.
107+
*/
108+
onChange?: (event: React.SyntheticEvent, expanded: boolean) => void;
109+
/**
110+
* The system prop that allows defining system overrides as well as additional CSS styles.
111+
*/
112+
sx?: SxProps<Theme>;
113+
/**
114+
* The component used for the transition.
115+
* [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
116+
* @deprecated Use `slots.transition` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
117+
*/
118+
TransitionComponent?: React.JSXElementConstructor<
119+
TransitionProps & { children?: React.ReactElement<unknown, any> }
120+
>;
121+
/**
122+
* Props applied to the transition element.
123+
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
124+
* @deprecated Use `slotProps.transition` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
125+
*/
126+
TransitionProps?: TransitionProps;
127+
}
128+
73129
export type AccordionTypeMap<
74130
AdditionalProps = {},
75131
RootComponent extends React.ElementType = 'div',
76132
> = ExtendPaperTypeMap<
77133
{
78-
props: AdditionalProps & {
79-
/**
80-
* The content of the component.
81-
*/
82-
children: NonNullable<React.ReactNode>;
83-
/**
84-
* Override or extend the styles applied to the component.
85-
*/
86-
classes?: Partial<AccordionClasses>;
87-
/**
88-
* If `true`, expands the accordion by default.
89-
* @default false
90-
*/
91-
defaultExpanded?: boolean;
92-
/**
93-
* If `true`, the component is disabled.
94-
* @default false
95-
*/
96-
disabled?: boolean;
97-
/**
98-
* If `true`, it removes the margin between two expanded accordion items and the increase of height.
99-
* @default false
100-
*/
101-
disableGutters?: boolean;
102-
/**
103-
* If `true`, expands the accordion, otherwise collapse it.
104-
* Setting this prop enables control over the accordion.
105-
*/
106-
expanded?: boolean;
107-
/**
108-
* Callback fired when the expand/collapse state is changed.
109-
*
110-
* @param {React.SyntheticEvent} event The event source of the callback. **Warning**: This is a generic event not a change event.
111-
* @param {boolean} expanded The `expanded` state of the accordion.
112-
*/
113-
onChange?: (event: React.SyntheticEvent, expanded: boolean) => void;
114-
/**
115-
* The system prop that allows defining system overrides as well as additional CSS styles.
116-
*/
117-
sx?: SxProps<Theme>;
118-
/**
119-
* The component used for the transition.
120-
* [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
121-
* @deprecated Use `slots.transition` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
122-
*/
123-
TransitionComponent?: React.JSXElementConstructor<
124-
TransitionProps & { children?: React.ReactElement<unknown, any> }
125-
>;
126-
/**
127-
* Props applied to the transition element.
128-
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
129-
* @deprecated Use `slotProps.transition` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
130-
*/
131-
TransitionProps?: TransitionProps;
132-
} & AccordionSlotsAndSlotProps;
134+
props: AdditionalProps & AccordionOwnProps & AccordionSlotsAndSlotProps;
133135
defaultComponent: RootComponent;
134136
},
135137
'onChange' | 'classes'

0 commit comments

Comments
 (0)