/** * CuiMainMenu data model — shared between the React and Vue component libraries. * * These interfaces describe the menu tree passed to CuiMainMenu and are * framework-agnostic. Framework-specific props (callbacks vs. emits, className, * etc.) live in each package's own `CuiMainMenuProps`. */ /** Fields common to every menu entry (items and groups). */ export interface MainMenuItemBase { id: string; label: string; icon: string; disabled?: boolean; /** * Exclude this entry (and, for a group, its subtree) from menu * filtering/search. The entry still renders normally in the unfiltered * menu. Defaults to false, so existing menus are unaffected. */ hiddenFromFilter?: boolean; } /** A selectable leaf entry in the menu. */ export interface MainMenuItem extends MainMenuItemBase { type: "item"; badge?: string; badgeType?: "badge" | "pill-small" | "pill-large"; badgeOutline?: boolean; /** Optional URL used as the entry point for this item (participates in search). */ entryPointUrl?: string; /** Whether the link should open in a new tab/window. */ external?: boolean; } /** A group entry containing nested items or groups (supports multiple levels). */ export interface MenuGroup extends MainMenuItemBase { type: "group"; /** Children can be items, dividers, or nested groups. */ children: MenuEntry[]; expanded?: boolean; /** Whether the link should open in a new tab/window. */ external?: boolean; } /** * A non-interactive divider used to visually separate entries within a level. * * When `label` is set it renders as a small section caption alongside a thin * rule; without a label it renders as a plain thin rule. Dividers are intended * primarily for sublevels (inside a group's `children`) to sub-section them, * but are valid at any level. They are skipped by search/filtering and are * never reported as active or clickable. */ export interface MenuDivider { id: string; type: "divider"; /** Optional caption text shown next to the divider rule. */ label?: string; } /** * A menu entry can be a selectable item, a group of nested entries, or a * (optionally labelled) divider. */ export type MenuEntry = MainMenuItem | MenuGroup | MenuDivider;