import { PropertyValueMap } from "lit"; import SgdsElement from "../../base/sgds-element"; /** * @summary Base class for sidebar navigation components. * Provides core functionality for sidebar items and groups including keyboard navigation, * selection state management, and nesting support. This class manages hierarchical navigation, * active state tracking, and drawer overlay coordination through context providers. * * Features: * - Multi-level keyboard navigation (Arrow keys, Enter) * - Active state management via Lit context subscription * - Support for nested hierarchies up to 3 levels deep * - Focus management and full ARIA attribute support * - Event emission for sidebar coordination (i-sgds-click) * - Automatic child element tracking and nesting level detection * * Keyboard Navigation: * - Arrow Up/Down: Navigate between siblings in the same level * - Arrow Left/Right: Navigate hierarchically (collapse/expand or move in drawer) * - Enter: Activate focused item or toggle group * * Context Management: * - Consumes: SidebarCollapsed, SidebarActiveItem, SidebarActiveGroup, SidebarDrawerItems * - Updates state based on context changes for responsive UI updates * * @internal */ export declare class SidebarElement extends SgdsElement { static styles: import("lit").CSSResult[]; /** * The display title/label for the sidebar element. * Shown in the UI and used for accessibility labels (aria-label). * @attribute title * @type {string} * @default "" */ title: string; /** * The unique name identifier for the sidebar element. * Used to identify selections in sgds-select events and manage active states. * Should be unique among siblings in the same navigation level. * @attribute name * @type {string} * @default "" */ name: string; /** @internal */ _sidebarCollapsed: boolean; /** @internal */ _sidebarActiveItem: SidebarElement | null; /** @internal */ _sidebarActiveGroup: SidebarElement | null; /** @internal */ _drawerItems: SidebarElement[] | null; /** @internal Tracks whether a drawer overlay is currently open */ _showDrawer: boolean; /** @internal Tracks whether sidebar is overlay or not */ _isOverlay: boolean; /** @internal */ _childLevel: number; /** * Indicates whether this element is currently selected/active in the sidebar. * @internal */ _selected: boolean; /** * Indicates whether this element should be hidden based on parent drawer visibility. * Used to hide level 2 items until their parent's drawer is opened. * @internal */ _hidden: boolean; /** * List of direct child sidebar elements (items or groups). * Updated when slot content changes. * @internal */ _childElements: SidebarElement[]; /** @internal */ _childActive: boolean; /** @internal */ private _defaultNodes; connectedCallback(): void; disconnectedCallback(): void; firstUpdated(changedProperties: PropertyValueMap): void; updated(): void; /** * Updates child elements from slot content when DOM changes. * Called automatically when slot content changes. * @internal * @returns {void} */ protected _handleSlotChange(): void; /** * Handles click/activation of this element, emitting internal event for parent sidebar. * Parent sidebar processes this event to manage selection and drawer state. * @internal * @returns {void} */ protected _handleClick(): void; /** * Manages keyboard navigation for the sidebar hierarchy. * Handles arrow keys for navigation, Enter to activate, and manages drawer/submenu expansion. * Prevents default browser behavior and stops event propagation. * @internal * @param {KeyboardEvent} event - The keyboard event * @returns {void} */ private _handleKeyDown; /** * Calculates the nesting depth by counting sgds-sidebar-group ancestors. * Level 1 = root items, Level 2+ = nested within groups. * Accounts for items positioned in drawer overlays. * @internal * @returns {void} */ private _getChildLevel; }