1 | import * as React from 'react';
|
2 | import { SxProps } from '@mui/system';
|
3 | import { Theme } from '..';
|
4 | import { TransitionProps } from '../transitions/transition';
|
5 | import { AccordionClasses } from './accordionClasses';
|
6 | import { OverridableComponent, OverrideProps } from '../OverridableComponent';
|
7 | import { ExtendPaperTypeMap } from '../Paper/Paper';
|
8 | import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types';
|
9 |
|
10 | export interface AccordionSlots {
|
11 | |
12 |
|
13 |
|
14 |
|
15 | heading: React.ElementType;
|
16 | |
17 |
|
18 |
|
19 |
|
20 |
|
21 | transition: React.JSXElementConstructor<
|
22 | TransitionProps & { children?: React.ReactElement<unknown, any> }
|
23 | >;
|
24 | }
|
25 |
|
26 | export interface AccordionTransitionSlotPropsOverrides {}
|
27 | export interface AccordionHeadingSlotPropsOverrides {}
|
28 |
|
29 | export type AccordionSlotsAndSlotProps = CreateSlotsAndSlotProps<
|
30 | AccordionSlots,
|
31 | {
|
32 | heading: SlotProps<
|
33 | React.ElementType<React.HTMLProps<HTMLHeadingElement>>,
|
34 | AccordionHeadingSlotPropsOverrides,
|
35 | AccordionOwnerState
|
36 | >;
|
37 | transition: SlotProps<
|
38 | React.ElementType<TransitionProps>,
|
39 | AccordionTransitionSlotPropsOverrides,
|
40 | AccordionOwnerState
|
41 | >;
|
42 | }
|
43 | >;
|
44 |
|
45 | export type AccordionTypeMap<
|
46 | AdditionalProps = {},
|
47 | RootComponent extends React.ElementType = 'div',
|
48 | > = ExtendPaperTypeMap<
|
49 | {
|
50 | props: AdditionalProps & {
|
51 | |
52 |
|
53 |
|
54 | children: NonNullable<React.ReactNode>;
|
55 | |
56 |
|
57 |
|
58 | classes?: Partial<AccordionClasses>;
|
59 | |
60 |
|
61 |
|
62 |
|
63 | defaultExpanded?: boolean;
|
64 | |
65 |
|
66 |
|
67 |
|
68 | disabled?: boolean;
|
69 | |
70 |
|
71 |
|
72 |
|
73 | disableGutters?: boolean;
|
74 | |
75 |
|
76 |
|
77 |
|
78 | expanded?: boolean;
|
79 | |
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 | onChange?: (event: React.SyntheticEvent, expanded: boolean) => void;
|
86 | |
87 |
|
88 |
|
89 | sx?: SxProps<Theme>;
|
90 | |
91 |
|
92 |
|
93 |
|
94 | TransitionComponent?: React.JSXElementConstructor<
|
95 | TransitionProps & { children?: React.ReactElement<unknown, any> }
|
96 | >;
|
97 | |
98 |
|
99 |
|
100 |
|
101 | TransitionProps?: TransitionProps;
|
102 | } & AccordionSlotsAndSlotProps;
|
103 | defaultComponent: RootComponent;
|
104 | },
|
105 | 'onChange' | 'classes'
|
106 | >;
|
107 |
|
108 |
|
109 |
|
110 |
|
111 |
|
112 |
|
113 |
|
114 |
|
115 |
|
116 |
|
117 |
|
118 |
|
119 | declare const Accordion: OverridableComponent<AccordionTypeMap>;
|
120 |
|
121 | export type AccordionProps<
|
122 | RootComponent extends React.ElementType = AccordionTypeMap['defaultComponent'],
|
123 | AdditionalProps = {},
|
124 | > = OverrideProps<AccordionTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
|
125 | component?: React.ElementType;
|
126 | };
|
127 |
|
128 | export interface AccordionOwnerState extends AccordionProps {}
|
129 |
|
130 | export default Accordion;
|