import { SvelteComponentTyped, type ComponentConstructorOptions } from "svelte"; import type { SvelteHTMLElements } from "svelte/elements"; /** * The stack scale maps to the following `@carbon/layout` values: * - 0 --> 0 (no gap) * - 1 --> 0.125rem * - 2 --> 0.25rem * - 3 --> 0.5rem * - 4 --> 0.75rem * - 5 --> 1rem * - 6 --> 1.5rem * - 7 --> 2rem * - 8 --> 2.5rem * - 9 --> 3rem * - 10 --> 4rem * - 11 --> 5rem * - 12 --> 6rem * - 13 --> 10rem */ export type StackScale = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13; type $RestProps = NoInfer; type $Elements = { [$Tag in keyof HTMLElementTagNameMap]: Omit<$RestProps<$Tag>, keyof $Props<$Tag>> }; type $Props = { /** * Set to `true` to apply Stack's layout classes to a caller-supplied element or component * instead of the element named by `tag`. Props (including the computed classes and gap style) * are destructured as `props` in the default slot. `tag` is ignored when `as` is `true`. * @example * ```svelte * * Content * * ``` * @default false */ as?: boolean; /** * Specify the gap between items in the stack. * The scale maps to Carbon layout values. * Use 0 to omit any gap class. * Alternatively, specify a custom value (e.g., "200px" or "1.5rem"). * Custom values *must* be a string. * @default 1 */ gap?: StackScale | string; /** * Specify the orientation of the stack. * @default "vertical" */ orientation?: "vertical" | "horizontal"; /** * Specify the cross-axis alignment of items in the stack. * @default "stretch" */ align?: "start" | "center" | "end" | "stretch" | "baseline"; /** * Specify the main-axis alignment of items in the stack. * @default "start" */ justify?: "start" | "center" | "end" | "space-between" | "space-around" | "space-evenly"; /** * Specify how items wrap onto multiple lines. * Items wrap when they overflow the main axis: the container width for a * horizontal stack, or a constrained height for a vertical stack. * @default "nowrap" */ wrap?: "nowrap" | "wrap" | "wrap-reverse"; /** * Set to `true` to use `display: inline-flex` instead of `display: flex`. * @default false */ inline?: boolean; /** * Specify the tag name. * @default "div" */ tag?: Tag; /** * Obtain a reference to the HTML element. * Stays `null` when `as` is set; use `bind:this` on your own element instead. * @default null */ ref?: null | HTMLElementTagNameMap[Tag]; children?: (this: void, ...args: [{ props: { class: string; [key: string]: any; } }]) => void; [key: `data-${string}`]: unknown; }; export type StackProps = $Elements[Tag] & $Props; export default class Stack extends SvelteComponentTyped< StackProps, { click: WindowEventMap["click"]; focusin: WindowEventMap["focusin"]; focusout: WindowEventMap["focusout"]; keydown: WindowEventMap["keydown"]; keyup: WindowEventMap["keyup"]; mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; mouseover: WindowEventMap["mouseover"]; scroll: WindowEventMap["scroll"]; }, { default: { props: { class: string; [key: string]: any; } }; } > { constructor(options: ComponentConstructorOptions>); }