UNPKG

@workday/canvas-kit-preview-react

Version:

Canvas Kit Preview is made up of components that have the full design and a11y review, are part of the DS ecosystem and are approved for use in product. The API's could be subject to change, but not without strong communication and migration strategies.

45 lines 1.99 kB
import React from 'react'; import { Themeable } from '@workday/canvas-kit-react/common'; import { SelectProps } from './Select'; import { MenuPlacement, MenuVisibility } from './types'; interface SelectMenuProps extends Themeable, React.HTMLAttributes<HTMLUListElement>, Pick<SelectProps, 'error'> { /** * The ref to the anchor button element. Required to anchor the menu. */ buttonRef?: React.RefObject<HTMLButtonElement>; /** * The ref to the underlying menu/listbox element. Use this to imperatively manipulate the menu. */ menuRef?: React.RefObject<HTMLUListElement>; /** * The function called when the menu is closed. */ onClose?: () => void; /** * The placement of the SelectMenu relative to its corresponding button. * @default 'bottom' */ placement?: MenuPlacement; /** * If true, automatically flip the SelectMenu to keep it visible if necessary (e.g., if the the SelectMenu would otherwise display below the visible area of the viewport). * @default true */ shouldAutoFlip?: boolean; /** * If true, focus the SelectMenu when it's shown. Set to false if you don't want to focus the SelectMenu automatically (for visual testing purposes, for example). * @default true */ shouldAutoFocus?: boolean; /** * The visibility state of the SelectMenu. * @default 'closed' */ visibility?: MenuVisibility; } export declare const menuAnimationDuration = 200; /** * @deprecated ⚠️ `SelectMenu` in Preview has been deprecated and will be removed in a future major version. Please use [`Select` in Main](https://workday.github.io/canvas-kit/?path=/docs/components-inputs-select--basic) instead. */ export declare const SelectMenu: ({ buttonRef, children, error, menuRef, onClose, placement, shouldAutoFlip, shouldAutoFocus, visibility, ...elemProps }: SelectMenuProps) => React.JSX.Element; export {}; //# sourceMappingURL=SelectMenu.d.ts.map