carbon-components-svelte
Version:
Svelte implementation of the Carbon Design System
37 lines (29 loc) • 909 B
TypeScript
import { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
type $RestProps = SvelteHTMLElements["dialog"];
type $Props = {
/**
* Set to `true` to open the dialog.
* @default false
*/
open?: boolean;
/**
* Set to `true` to render the dialog as a modal using `showModal()`.
* When `false`, the dialog opens non-modally using `show()`.
* Changing `modal` while `open` is `true` has no effect until the dialog closes and reopens.
* @default false
*/
modal?: boolean;
children?: (this: void) => void;
[key: `data-${string}`]: unknown;
};
export type DialogProps = Omit<$RestProps, keyof $Props> & $Props;
export default class Dialog extends SvelteComponentTyped<
DialogProps,
{
click: WindowEventMap["click"];
close: CustomEvent<null>;
open: CustomEvent<null>;
},
{ default: Record<string, never> }
> {}