goobs-frontend
Version:
A comprehensive React-based libary for building modern web applications
30 lines • 1.17 kB
TypeScript
import { default as React } from 'react';
import { FormFieldStyles } from '../Field/Shell/types';
/**
* Styling contract for the `styles` prop. dense / divider / selected live as
* TOP-LEVEL MenuItemProps (wired to data-attributes in the render);
* MenuItemStyles carries only the FormFieldStyles theming surface.
*/
export type MenuItemStyles = FormFieldStyles;
export interface MenuItemProps extends React.OptionHTMLAttributes<HTMLOptionElement> {
children?: React.ReactNode;
styles?: MenuItemStyles;
dense?: boolean;
divider?: boolean;
disabled?: boolean;
selected?: boolean;
/**
* Action verb — emitted as `data-action="<verb>"` on the rendered
* `<option>`. Defaults to `"select"` since activating a menu item is a
* selection. Tests target via `[data-component="MenuItem"][data-action="select"]`.
*/
action?: string;
/**
* Entity / option noun the selection targets. Emitted as
* `data-subject="<value>"` so multiple menus on one page disambiguate.
*/
subject?: string;
}
declare const MenuItem: React.FC<MenuItemProps>;
export default MenuItem;
//# sourceMappingURL=index.d.ts.map