import { AriaRole } from "../utils/types/AriaRole.js"; import { PolymorphicProps } from "../utils/modern-polymorphic.js"; import React from "react"; //#region src/ActionList/shared.d.ts type ExcludeSelectEventHandler = T extends any ? Omit : never; type ActionListItemProps = ExcludeSelectEventHandler> & { /** * Primary content for an Item */ children?: React.ReactNode; /** * Callback that will trigger both on click selection and keyboard selection. * This is not called for disabled or inactive items. */ onSelect?: (event: React.MouseEvent | React.KeyboardEvent) => void; /** * Is the `Item` is currently selected? */ selected?: boolean; /** * Indicate whether the item is active. There should never be more than one active item. */ active?: boolean; /** * Style variations associated with various `Item` types. * * - `"default"` - An action `Item`. * - `"danger"` - A destructive action `Item`. */ variant?: 'default' | 'danger'; size?: 'medium' | 'large'; /** * Items that are disabled can not be clicked, selected, or navigated through. */ disabled?: boolean; /** * The ARIA role describing the function of `Item` component. `option` is a common value. */ role?: AriaRole; /** * id to attach to the root element of the Item */ id?: string; /** * Text describing why the item is inactive. This may be used when an item's usual functionality * is unavailable due to a system error such as a database outage. */ inactiveText?: string; /** * Whether the item is loading */ loading?: boolean; /** * Private API for use internally only. Used by LinkItem to wrap contents in an anchor */ _PrivateItemWrapper?: React.FC>; /** * Private API for use internally only. Adds a tooltip to the interactive item. */ _PrivateTooltipText?: string; className?: string; groupId?: string; renderItem?: (item: React.FC>) => React.ReactNode; handleAddItem?: (item: React.FC>) => void; /** * @deprecated `as` prop has no effect on `ActionList.Item`, only `ActionList.LinkItem` */ as?: As; }; type MenuItemProps = { onClick?: (event: React.MouseEvent) => void; onKeyPress?: (event: React.KeyboardEvent) => void; 'aria-disabled'?: boolean; tabIndex?: number; 'aria-labelledby'?: string; 'aria-describedby'?: string; role?: string; className?: string; }; type ActionListProps = PolymorphicProps>; //#endregion export { ActionListItemProps, ActionListProps };