import { SvelteComponentTyped } from "svelte"; import type { SvelteHTMLElements } from "svelte/elements"; export type CarbonSelectableTileGroupContext = { groupSize: import("svelte/store").Readable<"sm" | "md" | undefined>; selectedValues: import("svelte/store").Writable; groupName: import("svelte/store").Readable; groupForm: import("svelte/store").Readable; groupDisabled: import("svelte/store").Readable; add: (data: { selected: boolean; value: T }) => void; remove: (value: T) => void; update: (data: { value: T; selected: boolean; shiftKey?: boolean }) => void; /** * Count a tile's value and warn once if two tiles share it. The check * waits for the current update to finish: tiles in a non-keyed `{#each}` * swap values one at a time, so a duplicate can exist only mid-update. * Returns a function that releases the value. */ register: (value: T) => () => void; }; type $RestProps = SvelteHTMLElements["fieldset"]; type $Props = { /** * Specify the selected tile values. * @default [] */ selected?: T[]; /** * Set to `true` to disable the tile group * @default false */ disabled?: boolean; /** * Specify a name attribute for the checkbox inputs. */ name?: string | undefined; /** * Specify the id of a form element outside the component to associate * the fieldset and checkbox inputs with. Overrides each tile's own `form`. */ form?: string | undefined; /** * Specify the legend text. * Alternatively, use the named slot "legendChildren". * @example * ```svelte * * Custom Legend * * ``` * @default "" */ legendText?: string; /** * Set to `true` to visually hide the legend * @default false */ hideLegend?: boolean; /** * Set the size of every tile in the group: `"sm"` for compact tiles, * such as rows in a list of choices. */ size?: "sm" | "md" | undefined; legendChildren?: (this: void) => void; children?: (this: void) => void; [key: `data-${string}`]: unknown; }; export type SelectableTileGroupProps = Omit<$RestProps, keyof $Props> & $Props; export default class SelectableTileGroup extends SvelteComponentTyped< SelectableTileGroupProps, { /** Fires once per user toggle or range, after `select` and `deselect`, with every selected value. */ change: CustomEvent; deselect: CustomEvent; select: CustomEvent; }, { default: Record; legendChildren: Record; } > {}