@fluentui/react-northstar
Version:
A themable React component library.
66 lines (65 loc) • 2.92 kB
TypeScript
import * as React from 'react';
import * as PropTypes from 'prop-types';
import { ShorthandValue, ComponentEventHandler, FluentComponentStaticProps } from '../../types';
import { UIComponentProps } from '../../utils/commonPropInterfaces';
import { ImageProps } from '../Image/Image';
import { BoxProps } from '../Box/Box';
export interface DropdownItemSlotClassNames {
content: string;
header: string;
image: string;
checkableIndicator: string;
main: string;
}
export interface DropdownItemProps extends UIComponentProps<DropdownItemProps> {
/** A dropdown item can be active. */
active?: boolean;
/** Item's accessibility props. */
accessibilityItemProps?: any;
/** Item's content. */
content?: ShorthandValue<BoxProps>;
/** Item can show check indicator if selected. */
checkable?: boolean;
/** A slot for a checkable indicator. */
checkableIndicator?: ShorthandValue<BoxProps>;
/** A dropdown item can show that it cannot be interacted with. */
disabled?: boolean;
/** Item's header. */
header?: ShorthandValue<BoxProps>;
/** Item's image. */
image?: ShorthandValue<ImageProps>;
/** Indicated whether the item has been set active by keyboard. */
isFromKeyboard?: boolean;
/**
* Called on dropdown item click.
*
* @param event - React's original SyntheticEvent.
* @param data - All props and proposed value.
*/
onClick?: ComponentEventHandler<DropdownItemProps>;
/** A dropdown item can be selected if single selection Dropdown is used. */
selected?: boolean;
}
export declare const dropdownItemClassName = "ui-dropdown__item";
export declare const dropdownItemSlotClassNames: DropdownItemSlotClassNames;
/**
* A DropdownItem represents an option of Dropdown list.
* Displays an item with optional rich media metadata.
*/
export declare const DropdownItem: (<TExtendedElementType extends React.ElementType<any> = "li">(props: React.RefAttributes<HTMLLIElement> & Omit<import("@fluentui/react-bindings").PropsOfElement<TExtendedElementType>, "as" | keyof DropdownItemProps> & {
as?: TExtendedElementType;
} & DropdownItemProps) => JSX.Element) & {
propTypes?: React.WeakValidationMap<DropdownItemProps> & {
as: React.Requireable<string | ((props: any, context?: any) => any) | (new (props: any, context?: any) => any)>;
};
contextTypes?: PropTypes.ValidationMap<any>;
defaultProps?: Partial<DropdownItemProps & {
as: "li";
}>;
displayName?: string;
readonly __PRIVATE_PROPS?: React.RefAttributes<HTMLLIElement> & Omit<Pick<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "key" | keyof React.LiHTMLAttributes<HTMLLIElement>> & {
ref?: React.Ref<HTMLLIElement>;
}, "as" | keyof DropdownItemProps> & {
as?: "li";
} & DropdownItemProps;
} & FluentComponentStaticProps<DropdownItemProps>;