mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
46 lines
998 B
TypeScript
46 lines
998 B
TypeScript
import type { SvelteComponentTyped } from "svelte";
|
|
import type { SvelteHTMLElements } from "svelte/elements";
|
|
|
|
type $RestProps = SvelteHTMLElements["a"] & SvelteHTMLElements["p"];
|
|
|
|
type $Props = {
|
|
/**
|
|
* Set to `true` to click the tile
|
|
* @default false
|
|
*/
|
|
clicked?: boolean;
|
|
|
|
/**
|
|
* Set to `true` to enable the light variant
|
|
* @default false
|
|
*/
|
|
light?: boolean;
|
|
|
|
/**
|
|
* Set to `true` to disable the tile
|
|
* @default false
|
|
*/
|
|
disabled?: boolean;
|
|
|
|
/**
|
|
* Set the `href`
|
|
* @default undefined
|
|
*/
|
|
href?: string;
|
|
|
|
[key: `data-${string}`]: any;
|
|
};
|
|
|
|
export type ClickableTileProps = Omit<$RestProps, keyof $Props> & $Props;
|
|
|
|
export default class ClickableTile extends SvelteComponentTyped<
|
|
ClickableTileProps,
|
|
{
|
|
click: WindowEventMap["click"];
|
|
keydown: WindowEventMap["keydown"];
|
|
mouseover: WindowEventMap["mouseover"];
|
|
mouseenter: WindowEventMap["mouseenter"];
|
|
mouseleave: WindowEventMap["mouseleave"];
|
|
},
|
|
{ default: {} }
|
|
> {}
|