1 | import * as React from 'react';
|
2 | import { Simplify } from '@mui/types';
|
3 | import { UseOptionRootSlotProps } from '../useOption';
|
4 | import { PolymorphicProps, SlotComponentProps } from '../utils';
|
5 | export interface OptionRootSlotPropsOverrides {
|
6 | }
|
7 | export interface OptionOwnProps<OptionValue> {
|
8 | |
9 |
|
10 |
|
11 | value: OptionValue;
|
12 | children?: React.ReactNode;
|
13 | |
14 |
|
15 |
|
16 |
|
17 | disabled?: boolean;
|
18 | className?: string;
|
19 | |
20 |
|
21 |
|
22 |
|
23 | slotProps?: {
|
24 | root?: SlotComponentProps<'li', OptionRootSlotPropsOverrides, OptionOwnerState<OptionValue>>;
|
25 | };
|
26 | |
27 |
|
28 |
|
29 |
|
30 |
|
31 | slots?: OptionSlots;
|
32 | |
33 |
|
34 |
|
35 |
|
36 | label?: string;
|
37 | }
|
38 | export interface OptionSlots {
|
39 | |
40 |
|
41 |
|
42 |
|
43 | root?: React.ElementType;
|
44 | }
|
45 | export interface OptionTypeMap<OptionValue, AdditionalProps = {}, RootComponentType extends React.ElementType = 'li'> {
|
46 | props: OptionOwnProps<OptionValue> & AdditionalProps;
|
47 | defaultComponent: RootComponentType;
|
48 | }
|
49 | export type OptionProps<OptionValue, RootComponentType extends React.ElementType = OptionTypeMap<OptionValue>['defaultComponent']> = PolymorphicProps<OptionTypeMap<OptionValue, {}, RootComponentType>, RootComponentType>;
|
50 | export interface OptionType {
|
51 | <OptionValue, RootComponentType extends React.ElementType = OptionTypeMap<OptionValue>['defaultComponent']>(props: PolymorphicProps<OptionTypeMap<OptionValue>, RootComponentType>): JSX.Element | null;
|
52 | propTypes?: any;
|
53 | displayName?: string | undefined;
|
54 | }
|
55 | export type OptionOwnerState<OptionValue> = Simplify<OptionOwnProps<OptionValue> & {
|
56 | selected: boolean;
|
57 | highlighted: boolean;
|
58 | index: number;
|
59 | }>;
|
60 | export type OptionRootSlotProps<OptionValue> = Simplify<UseOptionRootSlotProps & {
|
61 | children?: React.ReactNode;
|
62 | className: string;
|
63 | ref: React.Ref<HTMLElement>;
|
64 | ownerState: OptionOwnerState<OptionValue>;
|
65 | }>;
|