UNPKG

@spaced-out/ui-design-system

Version:
77 lines 2.55 kB
import * as React from 'react'; import type { Flow } from 'flow-to-typescript-codemod'; import type { MenuClassNames, MenuLabelTooltip } from '../../types/menu'; import type { IconType } from '../../components/Icon/Icon'; type ClassNames = MenuClassNames; type OptionClassNames = Readonly<{ wrapper?: string; }>; export type Virtualization = Readonly<{ enable: boolean; itemHeight?: number; menuHeight?: number; }>; export interface MenuOption { key: string; classNames?: OptionClassNames; label?: string; secondaryLabel?: string; customComponent?: React.ReactNode; iconLeft?: string; iconLeftType?: IconType; iconRight?: string; iconRightType?: IconType; disabled?: boolean; optionSize?: MenuSizeTypes; optionVariant?: MenuOptionsVariant; keepMenuOpenOnOptionSelect?: boolean; indeterminate?: boolean; testId?: string; } export interface BaseMenuProps { onSelect?: (option: MenuOption, arg2?: React.SyntheticEvent<HTMLElement> | null | undefined) => unknown; selectedOption?: MenuOption | null | undefined; optionsVariant?: MenuOptionsVariant; selectedKeys?: Array<string>; classNames?: ClassNames; size?: MenuSizeTypes; width?: string; menuDisabled?: boolean; isFluid?: boolean; onTabOut?: () => unknown; allowSearch?: boolean; resolveLabel?: (option: MenuOption) => string | React.ReactNode; resolveSecondaryLabel?: (option: MenuOption) => string | React.ReactNode; virtualization?: Virtualization; header?: React.ReactNode; footer?: React.ReactNode; showResultText?: boolean; staticLabels?: { RESULT?: string; RESULTS?: string; SEARCH_PLACEHOLDER?: string; }; showLabelTooltip?: MenuLabelTooltip; allowWrap?: boolean; testId?: string; } export interface MenuOptionTypes { options?: Array<MenuOption>; composeOptions?: Array<Array<MenuOption>>; groupTitleOptions?: Array<MenuGroupTitleOption>; } export type MenuSizeTypes = 'medium' | 'small'; export type MenuOptionsVariant = 'checkbox' | 'radio' | 'normal'; export interface MenuGroupTitleOption { groupTitle?: React.ReactNode; options?: Array<MenuOption>; showLineDivider?: boolean; } export interface MenuProps extends BaseMenuProps, MenuOptionTypes { } export interface RenderOptionProps extends Omit<MenuProps, 'searchText'> { searchText?: string; } export declare const Menu: Flow.AbstractComponent<MenuProps, HTMLDivElement>; export {}; //# sourceMappingURL=Menu.d.ts.map