@spaced-out/ui-design-system
Version:
Sense UI components library
74 lines • 2.44 kB
TypeScript
import * as React from 'react';
import type { Flow } from 'flow-to-typescript-codemod';
import type { MenuClassNames, MenuLabelTooltip } from '../../types/menu';
import type { IconType } from '../Icon/Icon';
type ClassNames = MenuClassNames;
type OptionClassNames = Readonly<{
wrapper?: string;
}>;
export type Virtualization = Readonly<{
enable: boolean;
itemHeight?: number;
menuHeight?: number;
}>;
export type 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;
};
export type 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;
};
export type MenuOptionTypes = {
options?: Array<MenuOption>;
composeOptions?: Array<Array<MenuOption>>;
groupTitleOptions?: Array<MenuGroupTitleOption>;
};
export type MenuSizeTypes = 'medium' | 'small';
export type MenuOptionsVariant = 'checkbox' | 'radio' | 'normal';
export type MenuGroupTitleOption = {
groupTitle?: React.ReactNode;
options?: Array<MenuOption>;
showLineDivider?: boolean;
};
export type MenuProps = BaseMenuProps & MenuOptionTypes;
export type RenderOptionProps = MenuProps & {
searchText?: string;
};
export declare const Menu: Flow.AbstractComponent<MenuProps, HTMLDivElement>;
export {};
//# sourceMappingURL=Menu.d.ts.map