UNPKG

@atlaskit/dropdown-menu

Version:

A dropdown menu displays a list of actions or options to a user.

251 lines (219 loc) 5.65 kB
<!-- API Report Version: 2.3 --> ## API Report File for "@atlaskit/dropdown-menu" > Do not edit this file. This report is auto-generated using > [API Extractor](https://api-extractor.com/). > [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports) ### Table of contents - [Main Entry Types](#main-entry-types) - [Peer Dependencies](#peer-dependencies) ### Main Entry Types <!--SECTION START: Main Entry Types--> ```ts /// <reference types="react" /> import type { CustomItemProps } from '@atlaskit/menu/types'; import { default as DropdownItemGroup } from '@atlaskit/menu/section'; import { KeyboardEvent as KeyboardEvent_2 } from 'react'; import type { MenuGroupProps } from '@atlaskit/menu/types'; import { MouseEvent as MouseEvent_2 } from 'react'; import { default as React_2 } from 'react'; import { ReactElement } from 'react'; import { ReactNode } from 'react'; import { Ref } from 'react'; import type { SectionProps } from '@atlaskit/menu'; import type { SectionProps as SectionProps_2 } from '@atlaskit/menu/types'; import type { TriggerProps } from '@atlaskit/popup/types'; // @public (undocumented) export interface CustomTriggerProps<TriggerElement extends HTMLElement = HTMLElement> extends Omit<TriggerProps, 'ref'> { isSelected?: boolean; onClick?: (e: KeyboardEvent_2 | MouseEvent_2) => void; testId?: string; triggerRef: Ref<TriggerElement>; } // @public export const DropdownItem: React_2.ForwardRefExoticComponent< DropdownItemProps & React_2.RefAttributes<HTMLElement> >; // @public export const DropdownItemCheckbox: ({ children, defaultSelected, description, id, isDisabled, isSelected, onClick: providedOnClick, shouldDescriptionWrap, shouldTitleWrap, testId, ...rest }: DropdownItemCheckboxProps) => JSX.Element; // @public export const DropdownItemCheckboxGroup: ({ children, hasSeparator, id, isList, isScrollable, overrides, testId, title, ...rest }: DropdownItemCheckboxGroupProps) => JSX.Element; // @public (undocumented) interface DropdownItemCheckboxGroupProps extends SectionProps { id: string; } // @public (undocumented) interface DropdownItemCheckboxProps { children: React.ReactNode; defaultSelected?: boolean; description?: JSX.Element | string; id: string; isDisabled?: boolean; isSelected?: boolean; onClick?: (e: KeyboardEvent_2 | MouseEvent_2) => void; shouldDescriptionWrap?: boolean; shouldTitleWrap?: boolean; testId?: string; title?: string; } export { DropdownItemGroup }; // @public (undocumented) export interface DropdownItemProps { children: React.ReactNode; component?: CustomItemProps['component']; description?: JSX.Element | string; elemAfter?: React.ReactNode; elemBefore?: React.ReactNode; href?: string; isDisabled?: boolean; isSelected?: boolean; onClick?: (e: KeyboardEvent_2 | MouseEvent_2) => void; rel?: string; shouldDescriptionWrap?: boolean; shouldTitleWrap?: boolean; target?: string; testId?: string; title?: string; } // @public export const DropdownItemRadio: ({ children, defaultSelected, testId, id, title, description, isDisabled, isSelected, onClick: providedOnClick, shouldDescriptionWrap, shouldTitleWrap, ...rest }: DropdownItemRadioProps) => JSX.Element; // @public export const DropdownItemRadioGroup: ({ children, hasSeparator, id, isList, isScrollable, overrides, testId, title, ...rest }: DropdownItemRadioGroupProps) => JSX.Element; // @public (undocumented) interface DropdownItemRadioGroupProps extends SectionProps { // (undocumented) id: string; } // @public (undocumented) interface DropdownItemRadioProps { children: React.ReactNode; defaultSelected?: boolean; description?: JSX.Element | string; id: string; isDisabled?: boolean; isSelected?: boolean; onClick?: (e: KeyboardEvent_2 | MouseEvent_2) => void; shouldDescriptionWrap?: boolean; shouldTitleWrap?: boolean; testId?: string; title?: string; } // @public const DropdownMenu: <T extends HTMLElement = HTMLElement>({ autoFocus, children, defaultOpen, isLoading, isOpen, onOpenChange, placement, shouldFlip, shouldRenderToParent, spacing, statusLabel, testId, trigger, zIndex, }: DropdownMenuProps<T>) => JSX.Element; export default DropdownMenu; // @public (undocumented) export interface DropdownMenuGroupProps extends SectionProps_2 {} // @public (undocumented) export interface DropdownMenuProps<TriggerElement extends HTMLElement = HTMLElement> { appearance?: 'default' | 'tall'; autoFocus?: boolean; children?: ReactNode; defaultOpen?: boolean; isLoading?: boolean; isOpen?: boolean; onOpenChange?: (args: OnOpenChangeArgs) => void; placement?: Placement; shouldFlip?: boolean; shouldRenderToParent?: boolean; spacing?: Extract<MenuGroupProps['spacing'], 'compact' | 'cozy'>; statusLabel?: string; testId?: string; trigger?: ((triggerButtonProps: CustomTriggerProps<TriggerElement>) => ReactElement) | string; zIndex?: number; } // @public (undocumented) export interface OnOpenChangeArgs { // (undocumented) event: KeyboardEvent_2 | MouseEvent_2; // (undocumented) isOpen: boolean; } // @public (undocumented) type Placement = | 'auto' | 'auto-end' | 'auto-start' | 'bottom' | 'bottom-end' | 'bottom-start' | 'left' | 'left-end' | 'left-start' | 'right' | 'right-end' | 'right-start' | 'top' | 'top-end' | 'top-start'; // (No @packageDocumentation comment for this package) ``` <!--SECTION END: Main Entry Types--> ### Peer Dependencies <!--SECTION START: Peer Dependencies--> ```json { "react": "^16.8.0", "react-dom": "^16.8.0" } ``` <!--SECTION END: Peer Dependencies-->