1 | import * as React from 'react';
|
2 | import { Simplify } from '@mui/types';
|
3 | import { UseButtonParameters, UseButtonRootSlotProps } from '../useButton';
|
4 | import { SlotComponentProps } from '../utils';
|
5 | import { PolymorphicProps } from '../utils/PolymorphicComponent';
|
6 | export interface ButtonActions {
|
7 | focusVisible(): void;
|
8 | }
|
9 | export interface ButtonRootSlotPropsOverrides {
|
10 | }
|
11 | export interface ButtonOwnProps extends Omit<UseButtonParameters, 'rootRef'> {
|
12 | |
13 |
|
14 |
|
15 | action?: React.Ref<ButtonActions>;
|
16 | children?: React.ReactNode;
|
17 | className?: string;
|
18 | |
19 |
|
20 |
|
21 |
|
22 | slotProps?: {
|
23 | root?: SlotComponentProps<'button', ButtonRootSlotPropsOverrides, ButtonOwnerState>;
|
24 | };
|
25 | |
26 |
|
27 |
|
28 |
|
29 |
|
30 | slots?: ButtonSlots;
|
31 | |
32 |
|
33 |
|
34 |
|
35 | rootElementName?: keyof HTMLElementTagNameMap;
|
36 | }
|
37 | export interface ButtonSlots {
|
38 | |
39 |
|
40 |
|
41 |
|
42 | root?: React.ElementType;
|
43 | }
|
44 | export type ButtonProps<RootComponentType extends React.ElementType = ButtonTypeMap['defaultComponent']> = PolymorphicProps<ButtonTypeMap<{}, RootComponentType>, RootComponentType>;
|
45 | export interface ButtonTypeMap<AdditionalProps = {}, RootComponentType extends React.ElementType = 'button'> {
|
46 | props: ButtonOwnProps & AdditionalProps;
|
47 | defaultComponent: RootComponentType;
|
48 | }
|
49 | export type ButtonOwnerState = Simplify<ButtonOwnProps & {
|
50 | active: boolean;
|
51 | focusVisible: boolean;
|
52 | }>;
|
53 | export type ButtonRootSlotProps = Simplify<UseButtonRootSlotProps & {
|
54 | ownerState: ButtonOwnerState;
|
55 | className?: string;
|
56 | children?: React.ReactNode;
|
57 | }>;
|