carbon-components-svelte
Version:
Svelte implementation of the Carbon Design System
41 lines (36 loc) • 1.12 kB
TypeScript
/** Max height values for listbox/dropdown menus by size */
export declare const MENU_MAX_HEIGHT: Readonly<{
xs: string;
sm: string;
md: string;
lg: string;
xl: string;
}>;
/**
* Get the max height for a listbox/dropdown menu based on size.
* @param size - The size variant (defaults to "md" when undefined)
* @returns The max height in rem units
*/
export declare function getMenuMaxHeight(
size?: "xs" | "sm" | "md" | "lg" | "xl",
): string;
/** Menu item heights (px) by size */
export declare const MENU_ITEM_HEIGHT: Readonly<{
xs: number;
sm: number;
md: number;
lg: number;
xl: number;
}>;
/** Fluid menu item height (px). Same height for every size. */
export declare const FLUID_MENU_ITEM_HEIGHT: number;
/**
* Get the menu item height in pixels for a listbox/dropdown size.
* @param size - The size variant (defaults to "md" when undefined)
* @param options - Pass `fluid: true` for FLUID_MENU_ITEM_HEIGHT
* @returns The item height in pixels
*/
export declare function getMenuItemHeight(
size?: "xs" | "sm" | "md" | "lg" | "xl",
options?: { fluid?: boolean },
): number;