UNPKG

1.87 kBJavaScriptView Raw
1import { __rest } from "tslib";
2import * as React from 'react';
3import { InternalDropdownItem } from './InternalDropdownItem';
4import { DropdownArrowContext } from './dropdownConstants';
5import { useOUIAProps } from '../../helpers';
6export const DropdownItem = (_a) => {
7 var { children, className, component = 'a', isDisabled = false, isAriaDisabled = false, isPlainText = false, isHovered = false, href, tooltip, tooltipProps = {}, listItemClassName, onClick,
8 // eslint-disable-next-line @typescript-eslint/no-unused-vars
9 ref, // Types of Ref are different for React.FunctionComponent vs React.Component
10 additionalChild, customChild, tabIndex = -1, icon = null, autoFocus, description = null, styleChildren, ouiaId, ouiaSafe } = _a, props = __rest(_a, ["children", "className", "component", "isDisabled", "isAriaDisabled", "isPlainText", "isHovered", "href", "tooltip", "tooltipProps", "listItemClassName", "onClick", "ref", "additionalChild", "customChild", "tabIndex", "icon", "autoFocus", "description", "styleChildren", "ouiaId", "ouiaSafe"]);
11 const ouiaProps = useOUIAProps(DropdownItem.displayName, ouiaId, ouiaSafe);
12 return (React.createElement(DropdownArrowContext.Consumer, null, context => (React.createElement(InternalDropdownItem, Object.assign({ context: context, role: "menuitem", tabIndex: tabIndex, className: className, component: component, isDisabled: isDisabled, isAriaDisabled: isAriaDisabled, isPlainText: isPlainText, isHovered: isHovered, href: href, tooltip: tooltip, tooltipProps: tooltipProps, listItemClassName: listItemClassName, onClick: onClick, additionalChild: additionalChild, customChild: customChild, icon: icon, autoFocus: autoFocus, styleChildren: styleChildren, description: description }, ouiaProps, props), children))));
13};
14DropdownItem.displayName = 'DropdownItem';
15//# sourceMappingURL=DropdownItem.js.map
\No newline at end of file