import { SvelteComponentTyped } from "svelte"; import type { SvelteHTMLElements } from "svelte/elements"; export type CarbonToggleButtonGroupContext = { selectedValues: import("svelte/store").Readable>; disabled: import("svelte/store").Readable; orientation: import("svelte/store").Readable<"horizontal" | "vertical">; tabStopElement: import("svelte/store").Readable; toggle: (value: Value) => void; /** * Buttons call this once while initializing, in DOM order, so the first * render (server or client) already has one `tabindex="0"` without * reading the DOM: the first enabled button when nothing is pressed, * otherwise the first enabled pressed button. */ claimInitialTabStop: (value: Value, isDisabled: boolean) => boolean; notifyUnmount: (node: HTMLElement) => void; }; type $RestProps = SvelteHTMLElements["div"]; type $Props = { /** * Set the values of the pressed buttons. * Always an array, even in `single` mode (0 or 1 entries). * @default [] */ selected?: ReadonlyArray; /** * Specify the selection behavior. `single` allows at most one pressed * button; pressing the pressed button clears it unless `required` is set. * @default "multiple" */ selectionMode?: "multiple" | "single"; /** * Set to `true` so the last pressed button can't be un-pressed * @default false */ required?: boolean; /** * Specify the size of the buttons. * @default "md" */ size?: "sm" | "md" | "lg"; /** * Specify the orientation of the group. * @default "horizontal" */ orientation?: "horizontal" | "vertical"; /** * Set to `true` to lay the buttons out as an even grid that wraps onto * as many rows as it needs, such as for time slots. Columns are at * least 5rem wide, so the count follows the width of the container. * Up and Down move between rows. Has no effect on a vertical group. * @default false */ grid?: boolean; /** * Set to `true` to disable all buttons in the group * @default false */ disabled?: boolean; /** * Accessible name for the group. * Prefer setting this (or `aria-label`) since the root has no visible * label of its own. */ labelText?: string | undefined; /** * Obtain a reference to the HTML element. * @default null */ ref?: null | HTMLDivElement; children?: (this: void) => void; [key: `data-${string}`]: unknown; }; export type ToggleButtonGroupProps = Omit<$RestProps, keyof $Props> & $Props; export default class ToggleButtonGroup extends SvelteComponentTyped< ToggleButtonGroupProps, { blur: WindowEventMap["blur"]; change: CustomEvent>; click: WindowEventMap["click"]; focus: WindowEventMap["focus"]; mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; mouseover: WindowEventMap["mouseover"]; }, { default: Record } > {}