import React from 'react';
import type { OtherHTMLAttributes, OptionsItemTheme, AsElementType } from '@instructure/shared-types';
import type { WithStyleProps } from '@instructure/emotion';
import type { OptionsItemRenderProps, OptionsItemProps } from '@instructure/ui-options/v11_6';
import Drilldown from '../index';
import { Renderable } from '@instructure/shared-types';
type DrilldownOptionValue = string | number | undefined;
type RenderContentVAlign = 'start' | 'center' | 'end';
type ShouldCloseOnClick = 'auto' | 'always' | 'never';
type DrilldownOptionVariant = Exclude;
type RenderContentProps = {
as: DrilldownOptionOwnProps['as'];
role: DrilldownOptionOwnProps['role'];
variant: DrilldownOptionVariant;
vAlign?: RenderContentVAlign;
isSelected: boolean;
};
type DrilldownOptionOwnProps = {
id: string;
/**
* Label of the Drilldown option.
*/
children?: React.ReactNode | ((props: {
id: string;
variant: DrilldownOptionVariant;
isSelected: boolean;
}) => React.ReactNode);
/**
* The id of the sub-page the option navigates to.
*/
subPageId?: string;
/**
* Is the option disabled.
*/
disabled?: boolean;
/**
* Whether the option is selected or not. (Setting this property assumes controlled behaviour)
*/
selected?: boolean;
/**
* The value of the option. Should be set for options in selectable groups.
*/
value?: DrilldownOptionValue;
/**
* Providing href will render the option as ``. Doesn't work, if subPageId is provided or is in a selectable group.
*/
href?: string;
/**
* Element type to render as. Will be set to `` if href is provided. If the parent is "ul" or "ol", the option is forced to be "li" element. *Important*: `Drilldown` is rendered as `ul` by default so you *have to* change that as well if you want to use this prop.
*/
as?: AsElementType;
/**
* The ARIA role of the element
*/
role?: string;
/**
* Info content to render after the label.
*
* If a function is provided, it has a `props` parameter.
*/
renderLabelInfo?: Renderable;
/**
* Content to render before the label.
*
* If a function is provided, it has a `props` parameter.
*/
renderBeforeLabel?: Renderable;
/**
* Content to render after the label.
*
* If a function is provided, it has a `props` parameter.
*/
renderAfterLabel?: Renderable;
/**
* Sets the vAlign of renderBeforeLabel content
*/
beforeLabelContentVAlign?: RenderContentVAlign;
/**
* Sets the vAlign of renderAfterLabel content and renderLabelInfo
*/
afterLabelContentVAlign?: RenderContentVAlign;
/**
* Additional "secondary" description text
*/
description?: React.ReactNode | (() => React.ReactNode);
/**
* The ARIA role of the description element
*/
descriptionRole?: string;
/**
* Callback fired when the option is clicked.
*/
onOptionClick?: (event: React.SyntheticEvent, args: {
optionId: string;
drilldown: Drilldown;
pageHistory: string[];
goToPage: (pageId: string) => {
prevPageId: string;
newPageId: string;
} | undefined;
goToPreviousPage: () => {
prevPageId: string;
newPageId: string;
} | undefined;
}) => void;
/**
* Whether the option is selected by default.
*/
defaultSelected?: boolean;
/**
* Provides a reference to the underlying html root element
*/
elementRef?: (element: Element | null) => void;
/**
* Should close the container menu component, if clicked on the option marked with this prop
*/
shouldCloseOnClick?: ShouldCloseOnClick;
};
type PropKeys = keyof DrilldownOptionOwnProps;
type AllowedPropKeys = Readonly>;
type DrilldownOptionProps = DrilldownOptionOwnProps & WithStyleProps & OtherHTMLAttributes;
declare const allowedProps: AllowedPropKeys;
export type { DrilldownOptionProps, DrilldownOptionValue };
export { allowedProps };
//# sourceMappingURL=props.d.ts.map