import { SvelteComponentTyped } from "svelte"; import type { SvelteHTMLElements } from "svelte/elements"; type $RestProps = SvelteHTMLElements["a"]; type $Props = { /** * Whether the tile has been clicked. * Toggles on click and on Space/Enter. * @default false */ clicked?: boolean; /** * Set the size: `"sm"` for a compact tile, such as a row in a list of * choices, with less padding and no minimum height. */ size?: "sm" | "md" | undefined; /** * Set to `true` to disable the tile * @default false */ disabled?: boolean; /** * Set to `true` to stretch the tile to fill the height of its container * @default false */ fullHeight?: boolean; /** * Set to `true` to remove the tile's padding * @default false */ noPadding?: boolean; /** * Set to `true` to round the tile's corners when it has a `decorator`, * such as an `AILabel`. Carbon reserves rounded tiles for AI content. * @default false */ rounded?: boolean; /** * Specify an icon to render in the bottom-right corner (bottom-left and * mirrored in right-to-left layouts), such as `ArrowRight` for a link * within the app or `Launch` for an external link. The icon is * decorative and hidden from assistive technology. */ icon?: Icon | undefined; /** * Set the `href`. */ href?: string | undefined; /** * Obtain a reference to the underlying anchor HTML element. * @default null */ ref?: null | HTMLAnchorElement; decorator?: (this: void) => void; children?: (this: void) => void; [key: `data-${string}`]: unknown; }; export type ClickableTileProps = Omit<$RestProps, keyof $Props> & $Props; export default class ClickableTile extends SvelteComponentTyped< ClickableTileProps, { blur: WindowEventMap["blur"]; click: WindowEventMap["click"]; focus: WindowEventMap["focus"]; keydown: WindowEventMap["keydown"]; keyup: WindowEventMap["keyup"]; mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; mouseover: WindowEventMap["mouseover"]; }, { default: Record; decorator: Record; } > {}