mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
34 lines
822 B
TypeScript
34 lines
822 B
TypeScript
import type { SvelteComponentTyped } from "svelte";
|
|
import type { SvelteHTMLElements } from "svelte/elements";
|
|
|
|
type $RestProps = SvelteHTMLElements["div"];
|
|
|
|
type $Props = {
|
|
/**
|
|
* Set the selected index of the switch item
|
|
* @default 0
|
|
*/
|
|
selectedIndex?: number;
|
|
|
|
/**
|
|
* Specify the size of the content switcher
|
|
* @default undefined
|
|
*/
|
|
size?: "sm" | "xl";
|
|
|
|
[key: `data-${string}`]: any;
|
|
};
|
|
|
|
export type ContentSwitcherProps = Omit<$RestProps, keyof $Props> & $Props;
|
|
|
|
export default class ContentSwitcher extends SvelteComponentTyped<
|
|
ContentSwitcherProps,
|
|
{
|
|
change: CustomEvent<number>;
|
|
click: WindowEventMap["click"];
|
|
mouseover: WindowEventMap["mouseover"];
|
|
mouseenter: WindowEventMap["mouseenter"];
|
|
mouseleave: WindowEventMap["mouseleave"];
|
|
},
|
|
{ default: {} }
|
|
> {}
|