1 | import { Simplify } from '@mui/types';
|
2 | import * as React from 'react';
|
3 | import { ButtonOwnProps } from '../Button';
|
4 | import { SlotComponentProps } from '../utils';
|
5 | import { UseTabRootSlotProps } from '../useTab';
|
6 | import { PolymorphicProps } from '../utils/PolymorphicComponent';
|
7 | export interface TabRootSlotPropsOverrides {
|
8 | }
|
9 | export interface TabOwnProps extends Omit<ButtonOwnProps, 'onChange' | 'slots' | 'slotProps'> {
|
10 | |
11 |
|
12 |
|
13 | value?: number | string;
|
14 | |
15 |
|
16 |
|
17 | onChange?: (event: React.SyntheticEvent, value: number | string) => void;
|
18 | |
19 |
|
20 |
|
21 |
|
22 | slotProps?: {
|
23 | root?: SlotComponentProps<'button', TabRootSlotPropsOverrides, TabOwnerState>;
|
24 | };
|
25 | |
26 |
|
27 |
|
28 |
|
29 |
|
30 | slots?: TabSlots;
|
31 | }
|
32 | export interface TabSlots {
|
33 | |
34 |
|
35 |
|
36 |
|
37 | root?: React.ElementType;
|
38 | }
|
39 | export type TabProps<RootComponentType extends React.ElementType = TabTypeMap['defaultComponent']> = PolymorphicProps<TabTypeMap<{}, RootComponentType>, RootComponentType>;
|
40 | export interface TabTypeMap<AdditionalProps = {}, RootComponentType extends React.ElementType = 'button'> {
|
41 | props: TabOwnProps & AdditionalProps;
|
42 | defaultComponent: RootComponentType;
|
43 | }
|
44 | export type TabOwnerState = Simplify<TabOwnProps & {
|
45 | active: boolean;
|
46 | disabled: boolean;
|
47 | highlighted: boolean;
|
48 | selected: boolean;
|
49 | }>;
|
50 | export type TabRootSlotProps = Simplify<UseTabRootSlotProps & {
|
51 | className?: string;
|
52 | ref: React.Ref<any>;
|
53 | ownerState: TabOwnerState;
|
54 | }>;
|