import { SvelteComponentTyped } from "svelte"; import type { SvelteHTMLElements } from "svelte/elements"; type $RestProps = SvelteHTMLElements["li"]; type $Props = { /** * Specify the tab label. * Alternatively, use the default slot. * @example * ```svelte * * Label * * ``` * @default "" */ label?: string; /** * Specify the href attribute * @default "#" */ href?: string; /** * Set to `true` to disable the tab * @default false */ disabled?: boolean; /** * Specify the tabindex of the selected tab. * Unselected tabs use `-1`, so the tab list is a single Tab-key stop * and arrow keys move between tabs. * Ignored when `Tabs` sets `navigation`. * @default "0" */ tabindex?: number | string | undefined; /** * Set an id for the top-level element. * Use a stable value with `Tabs` `selectedId` when tabs are added or removed dynamically. * @default uniqueId() */ id?: string; /** * Specify an optional secondary label. * Only rendered for container type tabs. * Alternatively, use the "secondaryChildren" slot. * @default "" */ secondaryLabel?: string; /** * Specify the icon to render. * Icon is rendered to the right of the label by default. * When the parent `Tabs` is `dismissible`, the icon is rendered to the left. * When the parent `Tabs` is `iconOnly`, only the icon is rendered and the * `label` is used as the accessible name and the tooltip shown on hover/focus. */ icon?: Icon | undefined; /** * Obtain a reference to the anchor HTML element. * @default null */ ref?: null | HTMLAnchorElement; /** * Set the tooltip placement in floating-ui form: the side, then `start` * or `end` along it, as Popover's `align` takes. Above and below, * `start` and `end` name inline sides, so they swap under `dir="rtl"`. * When set, takes precedence over `tooltipDirection` and `tooltipAlignment`. */ tooltipAlign?: "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | undefined; /** * Set the direction of the tooltip relative to the tab. * Only used when the tab is rendered icon-only. * @deprecated use `tooltipAlign` * @default "bottom" */ tooltipDirection?: "top" | "bottom"; /** * Set the alignment of the tooltip relative to the tab. * Only used when the tab is rendered icon-only. * @deprecated use `tooltipAlign` * @default "center" */ tooltipAlignment?: "start" | "center" | "end"; secondaryChildren?: (this: void) => void; children?: (this: void, ...args: [{ selected: boolean }]) => void; [key: `data-${string}`]: unknown; }; export type TabProps = Omit<$RestProps, keyof $Props> & $Props; export default class Tab extends SvelteComponentTyped< TabProps, { click: WindowEventMap["click"]; mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; mouseover: WindowEventMap["mouseover"]; }, { default: { selected: boolean }; secondaryChildren: Record; } > {}