1 |
|
2 | import { UseListItemRootSlotProps } from '../useList';
|
3 | export interface SelectOption<Value> {
|
4 | value: Value;
|
5 | label: React.ReactNode;
|
6 | disabled?: boolean;
|
7 | ref: React.RefObject<HTMLElement>;
|
8 | id?: string;
|
9 | }
|
10 | export interface UseOptionParameters<Value> {
|
11 | disabled: boolean;
|
12 | id?: string;
|
13 | label: string | React.ReactNode;
|
14 | rootRef?: React.Ref<Element>;
|
15 | value: Value;
|
16 | }
|
17 | export interface UseOptionReturnValue {
|
18 | |
19 |
|
20 |
|
21 | selected: boolean;
|
22 | |
23 |
|
24 |
|
25 | highlighted: boolean;
|
26 | index: number;
|
27 | |
28 |
|
29 |
|
30 |
|
31 |
|
32 | getRootProps: <ExternalProps extends Record<string, unknown>>(externalProps?: ExternalProps) => UseOptionRootSlotProps<ExternalProps>;
|
33 | |
34 |
|
35 |
|
36 | rootRef: React.RefCallback<Element> | null;
|
37 | }
|
38 | export type UseOptionRootSlotProps<ExternalProps extends Record<string, unknown> = {}> = UseListItemRootSlotProps<ExternalProps> & {
|
39 | ref?: React.RefCallback<Element> | null;
|
40 | } & ExternalProps;
|