import { LitElement } from 'lit';
import { ContextMenuType, ContextMenuOption, ColumnGroup } from '../context-menu-input/context-menu-input.js';
import '../../icons/icon-arrow-flyout-google.js';
import '../button/button.js';
import '../context-menu-input/context-menu-input.js';
export type ObcSplitButtonChangeEvent = CustomEvent<{
    selectedValues: string[];
    selectedOptions: Array<ContextMenuOption>;
}>;
export type ObcMenuButtonItemClickEvent = CustomEvent<{
    value: string;
    option: ContextMenuOption;
}>;
/**
 * `<obc-menu-button>` – A dropdown menu button for selecting one or more options from a contextual menu.
 *
 * Provides a button that opens a configurable context menu, supporting single or multi-select, nested/flyout submenus, and multi-column layouts. The button can display a label, an optional icon, and adapts to various menu types (regular, checkboxes, flyout, multi-column, etc.).
 *
 * Appears as a compact button that, when clicked, reveals a menu for actions, filtering, or grouped selections. Useful for toolbars, filter bars, or anywhere contextual actions or selections are needed without taking up persistent space.
 *
 * ## Features
 * - **Menu Types:** Supports multiple menu variants via `menuType`:
 *   - `Regular`: Standard single-select menu (action menu).
 *   - `Checkboxes`: Multi-select with checkboxes.
 *   - `NestedCheckboxes`: Hierarchical multi-select with nested checkboxes.
 *   - `Flyout`: Multi-level flyout menu (supports nested groups).
 *   - `Multi`: Multi-column menu (for large option sets).
 *   - `MultiWithSubtitles`: Multi-column menu with group subtitles.
 * - **Selection Modes:**
 *   - Single-select or multi-select (controlled by `multiSelect` and `menuType`).
 *   - Per-group selection (only one item per group/column, via `selectPerGroup`).
 *   - Optionally persist selection state (`persistSelection`).
 * - **Layout Options:**
 *   - Full width (`fullWidth`) or fit-content.
 *   - Menu can open above or below the button (`openTop`).
 *   - Multi-column and grouped layouts (`columnGroups`, `itemsPerColumn`).
 *   - Optional title bar with close button (`hasTitleBar`, `menuTitle`).
 * - **Content Customization:**
 *   - Optional icon slot in button (`hasIcon`).
 *   - Option icons and hierarchical/nested option structures.
 * - **Accessibility & Keyboard:**
 *   - Keyboard navigation and ARIA roles.
 *   - Disabled state disables both button and menu.
 * - **Events:**
 *   - Emits `change` when selection changes.
 *   - Emits `item-click` when an item is clicked.
 *   - Emits `close` when the menu closes.
 *
 * ## Usage Guidelines
 * Use `obc-menu-button` to present a compact button that reveals a contextual menu for actions, filtering, or grouped selections. Ideal for toolbars, filter bars, or overflow menus where space is limited but multiple or hierarchical options are needed. Choose the menu type and selection mode based on your use case:
 * - Use `menuType="Regular"` for simple single-action menus.
 * - Use `multiSelect` or `menuType="Checkboxes"` for multi-select scenarios (e.g., filtering).
 * - Use `menuType="Flyout"` for hierarchical or grouped actions.
 * - Use `menuType="Multi"` or `menuType="MultiWithSubtitles"` for large sets of options, grouped or split across columns.
 * - Use the icon slot for visual context (e.g., filter, settings, actions).
 * - Avoid using for persistent navigation—this is for contextual, transient actions or selections.
 *
 * **TODO(designer):** Confirm recommended use cases for each menu type and when to use per-group selection.
 *
 * ## Slots
 * | Slot Name | Renders When...      | Purpose                                 |
 * |-----------|---------------------|-----------------------------------------|
 * | `icon`    | `hasIcon` is true   | Icon displayed at the start of the button. |
 *
 * ## Properties & Attributes
 * - `label`: Text label shown on the button.
 * - `options`: Array of menu options (each with value, label, optional icon, children, etc.).
 * - `selectedValues`: Array of currently selected option values.
 * - `fullWidth`: If true, button stretches to fill its container.
 * - `hasIcon`: If true, shows the `icon` slot.
 * - `menuType`: Controls menu variant (see Features above). Defaults to `Regular`.
 * - `multiSelect`: If true, enables multi-select (overrides default for menuType).
 * - `selectPerGroup`: If true, only one selection per group/column (flyout/multi-column).
 * - `hasTitleBar`: If true, shows a title bar with close button in the menu.
 * - `menuTitle`: Title text for the menu (if `hasTitleBar` is true).
 * - `columnGroups`: Used for `multi-with-subtitles` layout; defines grouped columns.
 * - `itemsPerColumn`: Number of items per column in multi-column layouts.
 * - `openTop`: If true, menu opens above the button.
 * - `disabled`: Disables both the button and the menu.
 *
 * ## Events
 * - `change` – Fired when the menu selection changes (returns selected values and options).
 * - `item-click` – Fired when a menu item is clicked (returns value and option).
 * - `open` – Fired when the menu is opened.
 * - `close` – Fired when the menu is closed.
 *
 * ## Best Practices & Constraints
 * - Only use multi-select for scenarios where users may need to select multiple items (e.g., filters, bulk actions).
 * - For action menus (single-select, no persistence), set `persistSelection` to false.
 * - Use per-group selection (`selectPerGroup`) for grouped flyout or multi-column menus where only one selection per group is allowed.
 * - Avoid nesting too deeply in flyout menus for usability.
 * - If using icons in options, supply them via the `icon` property of each option (e.g., `<obi-placeholder></obi-placeholder>`).
 * - The button is fully keyboard accessible and supports ARIA roles for menu and menuitem.
 * - Menu closes automatically on selection (unless in multi-select mode).
 *
 * ## Example
 * ```html
 * <obc-menu-button
 *   label="Actions"
 *   .options=${[
 *     { value: 'edit', label: 'Edit', icon: html`<obi-placeholder></obi-placeholder>` },
 *     { value: 'delete', label: 'Delete' }
 *   ]}
 *   .selectedValues=${['edit']}
 *   hasIcon
 * >
 *   <obi-placeholder slot="icon"></obi-placeholder>
 * </obc-menu-button>
 * ```
 * In this example, the button displays an icon and label, and opens a menu with two options (one with an icon).
 *
 * @slot icon - Icon displayed at the start of the button when `hasIcon` is true.
 * @fires change {CustomEvent<{selectedValues: string[], selectedOptions: Array<ContextMenuOption>}>} Fired when the menu selection changes.
 * @fires item-click {CustomEvent<{value: string, option: ContextMenuOption}>} Fired when a menu item is clicked.
 * @fires open {CustomEvent<void>} Fired when the menu is opened.
 * @fires close {CustomEvent<void>} Fired when the menu is closed.
 */
export declare class ObcMenuButton extends LitElement {
    /**
     * The label displayed on the button.
     * If empty, the button can be rendered as icon-only.
     */
    label: string;
    /**
     * Array of menu options with value, label, and optional level, icon, and children.
     * Each option can include:
     * - `value`: Unique string identifier.
     * - `label`: Display text.
     * - `icon`: Optional icon (e.g., `<obi-placeholder></obi-placeholder>`).
     * - `children`: Optional array of child options (for nested/flyout menus).
     * - `level`: Optional nesting level (for hierarchical menus).
     */
    options: ContextMenuOption[];
    /**
     * Array of currently selected option values.
     * Used to control which options are checked/selected in the menu.
     */
    selectedValues: string[];
    /**
     * Whether the button should fill the full width of its container.
     * If true, the button stretches to 100% width.
     */
    fullWidth: boolean;
    /**
     * Whether the button should show an icon slot.
     * If true, the `icon` slot is rendered at the start of the button.
     */
    hasIcon: boolean;
    /**
     * The variant type of context menu to display.
     * Determines menu layout and selection behavior.
     * - `Regular`: Standard single-select.
     * - `Checkboxes`: Multi-select with checkboxes.
     * - `NestedCheckboxes`: Hierarchical multi-select.
     * - `Flyout`: Multi-level flyout menu.
     * - `Multi`: Multi-column menu.
     * - `MultiWithSubtitles`: Multi-column with group subtitles.
     * @default ContextMenuType.Regular
     */
    menuType: ContextMenuType;
    /**
     * Whether multiple selections are allowed.
     * Overrides the default selection mode for the chosen variant.
     * If not explicitly set, defaults based on `menuType`.
     */
    multiSelect?: boolean;
    /**
     * Allows single selection per group (flyout/multi-column only).
     * When true, only one item per group/column can be selected.
     */
    selectPerGroup?: boolean;
    /**
     * Whether to show a title bar with close button at the top of the menu.
     * If true, the menu displays a title bar (use `menuTitle` for text).
     */
    hasTitleBar: boolean;
    /**
     * Title text displayed in the title bar (if `hasTitleBar` is true).
     */
    menuTitle: string;
    /**
     * Array of column groups for the `multi-with-subtitles` layout.
     * Used to define grouped columns with subtitles in multi-column menus.
     */
    columnGroups: ColumnGroup[];
    /**
     * Number of items per column in multi-column layouts.
     * Used for `Multi` and `MultiWithSubtitles` menu types.
     */
    itemsPerColumn: number;
    /**
     * Render the dropdown context menu above or below the button.
     * If true, the menu opens above the button; otherwise, it opens below.
     */
    openTop: boolean;
    /**
     * Whether both parts of the button are disabled.
     * Disables both the button and the menu.
     */
    disabled: boolean;
    private isOpen;
    private menu?;
    private get effectiveMultiSelect();
    private get effectiveMenuType();
    private handlePopoverToggle;
    private handleMenuChange;
    private handleItemClick;
    private handleMenuClose;
    private get isMultiSelect();
    private get effectiveSelectPerGroup();
    render(): import('lit-html').TemplateResult<1>;
    static styles: import('lit').CSSResult;
}
declare global {
    interface HTMLElementTagNameMap {
        'obc-menu-button': ObcMenuButton;
    }
}
//# sourceMappingURL=menu-button.d.ts.map