import { SvelteComponentTyped } from "svelte"; import type { SvelteHTMLElements } from "svelte/elements"; export type CarbonSideNavContext = { expansionBreakpoint: import("svelte/store").Writable; winWidth: import("svelte/store").Writable; rail: import("svelte/store").Writable; collapsed: import("svelte/store").Writable; }; type $RestProps = SvelteHTMLElements["nav"]; type $Props = { /** * Set to `true` to use the fixed variant * @default false */ fixed?: boolean; /** * Set to `true` to use the rail variant. * @default false */ rail?: boolean; /** * Specify the ARIA label for the nav. */ ariaLabel?: string | undefined; /** * Set to `true` to toggle the expanded state. * @default false */ isOpen?: boolean; /** * The window width (px) at which the SideNav is expanded and the * hamburger menu is hidden. Defaults to Carbon's "large" breakpoint * (`breakpoints.lg` in `src/Breakpoint/breakpoints.js`). * @default 1056 */ expansionBreakpoint?: number; /** * Set to `"classic"` for the mixed UI Shell theme (White side nav). * Use with `Header` `theme="classic"` (Gray 100 header). * Requires `carbon-components-svelte/css/all.css`. */ theme?: "classic" | undefined; /** * Set to `true` to render a border between the side nav and its content. * Useful when the side nav and content share the same background and * otherwise blend together. * @default false */ border?: boolean; /** * Specify the scroll alignment used to bring the active item into view on mount. * Defaults to `"nearest"`, which only scrolls when the active item is out of view. * @default "nearest" */ activeItemScrollBlock?: "start" | "center" | "end" | "nearest"; /** * Set to `true` to allow the user to resize the side nav by dragging its * edge. Has no effect when `rail` is `true`. * @default false */ resizable?: boolean; /** * The side nav's width in pixels, when `resizable` is `true`. Rendered * clamped to `[minWidth, maxWidth]`. Ignored otherwise; non-resizable * widths stay fixed by CSS per mode (`rail` vs. expanded). * @default 256 */ width?: number; /** * Minimum width in pixels, when `resizable` is `true`. * @default 200 */ minWidth?: number; /** * Maximum width in pixels, when `resizable` is `true`. * @default 480 */ maxWidth?: number; /** * Specify the ARIA label for the resize handle. * @default "Resize side navigation" */ resizeHandleLabel?: string; /** * Specify the delay in milliseconds before hovering the resize handle * highlights it and shows the resize cursor. * Has no effect unless `resizable` is `true`. * @default 150 */ resizeEnterDelayMs?: number; /** * Specify the delay in milliseconds before the rail expands on hover. * Has no effect unless `rail` is `true`. * @default 100 */ enterDelayMs?: number; /** * Specify the delay in milliseconds before the hover-expanded rail * collapses once the pointer leaves it. * Has no effect unless `rail` is `true`. * @default 0 */ leaveDelayMs?: number; children?: (this: void) => void; [key: `data-${string}`]: unknown; }; export type SideNavProps = Omit<$RestProps, keyof $Props> & $Props; export default class SideNav extends SvelteComponentTyped< SideNavProps, { "click:overlay": CustomEvent; close: CustomEvent; open: CustomEvent; /** Fires once the user finishes resizing the side nav (drag release, key press or double click) and the width changed. */ resize: CustomEvent<{ width: number }>; }, { default: Record } > {}