import * as solid_js from 'solid-js'; import { JSX, ValidComponent, ComponentProps, ParentProps } from 'solid-js'; import { ElementOf, PolymorphicProps } from './polymorphic/index.js'; import { Portal } from 'solid-js/web'; import { Orientation } from '@kobalte/utils'; import { g as PopperRootOptions } from './popper-root-14a88a55.js'; import { D as DismissableLayerRenderProps } from './dismissable-layer-0aef6de3.js'; import { PointerDownOutsideEvent, FocusOutsideEvent, InteractOutsideEvent } from './primitives/create-interact-outside/index.js'; interface MenuOptions extends Omit { /** The controlled open state of the menu. */ open?: boolean; /** * The default open state when initially rendered. * Useful when you do not need to control the open state. */ defaultOpen?: boolean; /** Event handler called when the open state of the menu changes. */ onOpenChange?: (isOpen: boolean) => void; } interface MenuItemDataSet { "data-indeterminate": string | undefined; "data-checked": string | undefined; "data-disabled": string | undefined; "data-highlighted": string | undefined; } interface MenuItemBaseOptions { /** * Optional text used for typeahead purposes. * By default, the typeahead behavior will use the .textContent of the Menu.ItemLabel part * if provided, or fallback to the .textContent of the Menu.Item. * Use this when the content is complex, or you have non-textual content inside. */ textValue?: string; /** Whether the menu item is disabled. */ disabled?: boolean; /** Whether the menu item is checked (item radio or item checkbox). */ checked?: boolean; /** * When using menu item checkbox, whether the checked state is in an indeterminate mode. * Indeterminism is presentational only. * The indeterminate visual representation remains regardless of user interaction. */ indeterminate?: boolean; /** Whether the menu should close when the menu item is activated/selected. */ closeOnSelect?: boolean; /** Event handler called when the user selects an item (via mouse or keyboard). */ onSelect?: () => void; } interface MenuItemBaseCommonProps { id: string; ref: T | ((el: T) => void); onPointerMove: JSX.EventHandlerUnion; onPointerLeave: JSX.EventHandlerUnion; onPointerDown: JSX.EventHandlerUnion; onPointerUp: JSX.EventHandlerUnion; onClick: JSX.EventHandlerUnion; onKeyDown: JSX.EventHandlerUnion; onMouseDown: JSX.EventHandlerUnion; onFocus: JSX.EventHandlerUnion; } interface MenuItemBaseRenderProps extends MenuItemBaseCommonProps, MenuItemDataSet { tabIndex: number | undefined; "aria-checked": boolean | "mixed" | undefined; "aria-disabled": boolean | undefined; "aria-labelledby": string | undefined; "aria-describedby": string | undefined; "data-key": string | undefined; } interface MenuCheckboxItemOptions extends Omit { /** The controlled checked state of the menu item checkbox. */ checked?: boolean; /** * The default checked state when initially rendered. * Useful when you do not need to control the checked state. */ defaultChecked?: boolean; /** Event handler called when the checked state of the menu item checkbox changes. */ onChange?: (isChecked: boolean) => void; } interface MenuCheckboxItemCommonProps extends MenuItemBaseCommonProps { } interface MenuCheckboxItemRenderProps extends MenuCheckboxItemCommonProps, MenuItemBaseRenderProps { role: "menuitemcheckbox"; } type MenuCheckboxItemProps = MenuCheckboxItemOptions & Partial>>; /** * An item that can be controlled and rendered like a checkbox. */ declare function MenuCheckboxItem(props: PolymorphicProps>): solid_js.JSX.Element; interface MenuDataSet { "data-expanded": string | undefined; "data-closed": string | undefined; } interface MenuContentBaseOptions { /** * Event handler called when focus moves into the component after opening. * It can be prevented by calling `event.preventDefault`. */ onOpenAutoFocus?: (event: Event) => void; /** * Event handler called when focus moves to the trigger after closing. * It can be prevented by calling `event.preventDefault`. */ onCloseAutoFocus?: (event: Event) => void; /** * Event handler called when the escape key is down. * It can be prevented by calling `event.preventDefault`. */ onEscapeKeyDown?: (event: KeyboardEvent) => void; /** * Event handler called when a pointer event occurs outside the bounds of the component. * It can be prevented by calling `event.preventDefault`. */ onPointerDownOutside?: (event: PointerDownOutsideEvent) => void; /** * Event handler called when the focus moves outside the bounds of the component. * It can be prevented by calling `event.preventDefault`. */ onFocusOutside?: (event: FocusOutsideEvent) => void; /** * Event handler called when an interaction (pointer or focus event) happens outside the bounds of the component. * It can be prevented by calling `event.preventDefault`. */ onInteractOutside?: (event: InteractOutsideEvent) => void; } interface MenuContentBaseCommonProps { id: string; ref: T | ((el: T) => void); onPointerEnter: JSX.EventHandlerUnion; onPointerMove: JSX.EventHandlerUnion; onKeyDown: JSX.EventHandlerUnion; onMouseDown: JSX.EventHandlerUnion; onFocusIn: JSX.EventHandlerUnion; onFocusOut: JSX.EventHandlerUnion; style?: JSX.CSSProperties | string; } interface MenuContentBaseRenderProps extends MenuContentBaseCommonProps, DismissableLayerRenderProps, MenuDataSet { role: "menu"; tabIndex: number | undefined; "aria-labelledby": string | undefined; "data-orientation": Orientation; } interface MenuContentOptions extends MenuContentBaseOptions { } interface MenuContentCommonProps extends MenuContentBaseCommonProps { } interface MenuContentRenderProps extends MenuContentCommonProps, MenuContentBaseRenderProps { } type MenuContentProps = MenuContentOptions & Partial>>; declare function MenuContent(props: PolymorphicProps>): solid_js.JSX.Element; interface MenuGroupOptions { } interface MenuGroupCommonProps { id: string; } interface MenuGroupRenderProps extends MenuGroupCommonProps { role: "group"; "aria-labelledby": string | undefined; } type MenuGroupProps = MenuGroupOptions & Partial>>; /** * A container used to group multiple `Menu.Item`s. */ declare function MenuGroup(props: PolymorphicProps>): solid_js.JSX.Element; interface MenuGroupLabelOptions { } interface MenuGroupLabelCommonProps { id: string; } interface MenuGroupLabelRenderProps extends MenuGroupLabelCommonProps { "aria-hidden": "true"; } type MenuGroupLabelProps = MenuGroupLabelOptions & Partial>>; /** * A component used to render the label of a `Menu.Group`. * It won't be focusable using arrow keys. */ declare function MenuGroupLabel(props: PolymorphicProps>): solid_js.JSX.Element; interface MenuIconOptions { } interface MenuIconCommonProps { children: JSX.Element; } interface MenuIconRenderProps extends MenuIconCommonProps, MenuDataSet { "aria-hidden": "true"; } type MenuIconProps = MenuIconOptions & Partial>>; /** * A small icon often displayed inside the menu trigger as a visual affordance for the fact it can be open. * It renders a `▼` by default, but you can use your own icon by providing a `children`. */ declare function MenuIcon(props: PolymorphicProps>): JSX.Element; interface MenuItemOptions extends Omit { } interface MenuItemCommonProps extends MenuItemBaseCommonProps { } interface MenuItemRenderProps extends MenuItemCommonProps, MenuItemBaseRenderProps { role: "menuitem"; } type MenuItemProps = MenuItemOptions & Partial>>; /** * An item of the menu. */ declare function MenuItem(props: PolymorphicProps>): solid_js.JSX.Element; interface MenuItemDescriptionOptions { } interface MenuItemDescriptionCommonProps { id: string; } interface MenuItemDescriptionRenderProps extends MenuItemDescriptionCommonProps, MenuItemDataSet { } type MenuItemDescriptionProps = MenuItemDescriptionOptions & Partial>>; /** * An optional accessible description to be announced for the menu item. * Useful for menu items that have more complex content (e.g. icons, multiple lines of text, etc.) */ declare function MenuItemDescription(props: PolymorphicProps>): solid_js.JSX.Element; interface MenuItemIndicatorOptions { /** * Used to force mounting when more control is needed. * Useful when controlling animation with SolidJS animation libraries. */ forceMount?: boolean; } interface MenuItemIndicatorCommonProps { id: string; } interface MenuItemIndicatorRenderProps extends MenuItemIndicatorCommonProps, MenuItemDataSet { } type MenuItemIndicatorProps = MenuItemIndicatorOptions & Partial>>; /** * The visual indicator rendered when the parent menu `CheckboxItem` or `RadioItem` is checked. * You can style this element directly, or you can use it as a wrapper to put an icon into, or both. */ declare function MenuItemIndicator(props: PolymorphicProps>): solid_js.JSX.Element; interface MenuItemLabelOptions { } interface MenuItemLabelCommonProps { id: string; ref: T | ((el: T) => void); } interface MenuItemLabelRenderProps extends MenuItemLabelCommonProps, MenuItemDataSet { } type MenuItemLabelProps = MenuItemLabelOptions & Partial>>; /** * An accessible label to be announced for the menu item. * Useful for menu items that have more complex content (e.g. icons, multiple lines of text, etc.) */ declare function MenuItemLabel(props: PolymorphicProps>): solid_js.JSX.Element; interface MenuPortalProps extends ComponentProps { } /** * Portals its children into the `body` when the menu is open. */ declare function MenuPortal(props: MenuPortalProps): solid_js.JSX.Element; interface MenuRadioGroupOptions { /** The controlled value of the item radio to check. */ value?: TValue; /** * The value of the item radio that should be checked when initially rendered. * Useful when you do not need to control the state of the menu radio group. */ defaultValue?: TValue; /** Event handler called when the value changes. */ onChange?: (value: TValue) => void; /** Whether the menu radio group is disabled. */ disabled?: boolean; } interface MenuRadioGroupCommonProps extends MenuGroupCommonProps { id: string; } interface MenuRadioGroupRenderProps extends MenuRadioGroupCommonProps, MenuGroupRenderProps { } type MenuRadioGroupProps = MenuRadioGroupOptions & Partial>>; /** * A container used to group multiple `Menu.RadioItem`s and manage the selection. */ declare function MenuRadioGroup(props: PolymorphicProps>): solid_js.JSX.Element; interface MenuRadioItemOptions extends Omit { /** The value of the menu item radio. */ value: TValue; } interface MenuRadioItemCommonProps extends MenuItemBaseCommonProps { } interface MenuRadioItemRenderProps extends MenuRadioItemCommonProps, MenuItemBaseRenderProps { role: "menuitemradio"; } type MenuRadioItemProps = MenuRadioItemOptions & Partial>>; /** * An item that can be controlled and rendered like a radio. */ declare function MenuRadioItem(props: PolymorphicProps>): solid_js.JSX.Element; interface MenuRootOptions extends MenuOptions { /** * A unique identifier for the component. * The id is used to generate id attributes for nested components. * If no id prop is provided, a generated id will be used. */ id?: string; /** * Whether the menu should be the only visible content for screen readers. * When set to `true`: * - interaction with outside elements will be disabled. * - scroll will be locked. * - focus will be locked inside the menu content. * - elements outside the menu content will not be visible for screen readers. */ modal?: boolean; /** Whether the scroll should be locked even if the menu is not modal. */ preventScroll?: boolean; /** * Used to force mounting the menu (portal, positioner and content) when more control is needed. * Useful when controlling animation with SolidJS animation libraries. */ forceMount?: boolean; /** The orientation of the menu. */ orientation?: Orientation; /** * A unique value that associates the item with an active value * when the navigation menu is controlled. * This prop is managed automatically when uncontrolled. * Only used inside a Menubar. */ value?: string; } interface MenuSubOptions extends Omit { } interface MenuSubProps extends ParentProps { } /** * Contains all the parts of a submenu. */ declare function MenuSub(props: MenuSubProps): solid_js.JSX.Element; interface MenuSubContentOptions extends Omit { } interface MenuSubContentCommonProps extends MenuContentBaseCommonProps { onKeyDown: JSX.EventHandlerUnion; } interface MenuSubContentRenderProps extends MenuSubContentCommonProps, MenuContentBaseRenderProps { } type MenuSubContentProps = MenuSubContentOptions & Partial>>; /** * The component that pops out when a submenu is open. */ declare function MenuSubContent(props: PolymorphicProps>): JSX.Element; interface MenuSubTriggerOptions { /** * Optional text used for typeahead purposes. * By default, the typeahead behavior will use the .textContent of the Menu.SubTrigger. * Use this when the content is complex, or you have non-textual content inside. */ textValue?: string; /** Whether the sub menu trigger is disabled. */ disabled?: boolean; } interface MenuSubTriggerCommonProps { id: string; ref: T | ((el: T) => void); onPointerMove: JSX.EventHandlerUnion; onPointerLeave: JSX.EventHandlerUnion; onPointerDown: JSX.EventHandlerUnion; onPointerUp: JSX.EventHandlerUnion; onClick: JSX.EventHandlerUnion; onKeyDown: JSX.EventHandlerUnion; onMouseDown: JSX.EventHandlerUnion; onFocus: JSX.EventHandlerUnion; } interface MenuSubTriggerRenderProps extends MenuSubTriggerCommonProps, MenuDataSet { role: "menuitem"; tabIndex: number | undefined; "aria-haspopup": "true"; "aria-expanded": boolean; "aria-controls": string | undefined; "aria-disabled": boolean | undefined; "data-key": string | undefined; "data-highlighted": "" | undefined; "data-disabled": "" | undefined; } type MenuSubTriggerProps = MenuSubTriggerOptions & Partial>>; /** * An item that opens a submenu. */ declare function MenuSubTrigger(props: PolymorphicProps>): JSX.Element; export { MenuRadioGroupCommonProps as $, MenuGroupLabelProps as A, MenuGroupLabelRenderProps as B, MenuGroupOptions as C, MenuGroupProps as D, MenuGroupRenderProps as E, MenuIconCommonProps as F, MenuIconOptions as G, MenuIconProps as H, MenuIconRenderProps as I, MenuItemCommonProps as J, MenuItemDescriptionCommonProps as K, MenuItemDescriptionOptions as L, MenuDataSet as M, MenuItemDescriptionProps as N, MenuItemDescriptionRenderProps as O, MenuItemIndicatorCommonProps as P, MenuItemIndicatorOptions as Q, MenuItemIndicatorProps as R, MenuItemIndicatorRenderProps as S, MenuItemLabelCommonProps as T, MenuItemLabelOptions as U, MenuItemLabelProps as V, MenuItemLabelRenderProps as W, MenuItemOptions as X, MenuItemProps as Y, MenuItemRenderProps as Z, MenuPortalProps as _, MenuCheckboxItem as a, MenuRadioGroupOptions as a0, MenuRadioGroupProps as a1, MenuRadioGroupRenderProps as a2, MenuRadioItemCommonProps as a3, MenuRadioItemOptions as a4, MenuRadioItemRenderProps as a5, MenuRadioItemProps as a6, MenuSubContentCommonProps as a7, MenuSubContentOptions as a8, MenuSubContentProps as a9, MenuSubContentRenderProps as aa, MenuSubOptions as ab, MenuSubProps as ac, MenuSubTriggerCommonProps as ad, MenuSubTriggerOptions as ae, MenuSubTriggerProps as af, MenuSubTriggerRenderProps as ag, MenuRootOptions as ah, MenuContent as b, MenuGroup as c, MenuGroupLabel as d, MenuIcon as e, MenuItem as f, MenuItemDescription as g, MenuItemIndicator as h, MenuItemLabel as i, MenuPortal as j, MenuRadioGroup as k, MenuRadioItem as l, MenuSub as m, MenuSubContent as n, MenuSubTrigger as o, MenuCheckboxItemCommonProps as p, MenuCheckboxItemOptions as q, MenuCheckboxItemProps as r, MenuCheckboxItemRenderProps as s, MenuContentCommonProps as t, MenuContentOptions as u, MenuContentProps as v, MenuContentRenderProps as w, MenuGroupCommonProps as x, MenuGroupLabelCommonProps as y, MenuGroupLabelOptions as z };