mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
47 lines
1.1 KiB
TypeScript
47 lines
1.1 KiB
TypeScript
import type { SvelteComponentTyped } from "svelte";
|
|
import type { SvelteHTMLElements } from "svelte/elements";
|
|
|
|
type $RestProps = SvelteHTMLElements["div"];
|
|
|
|
type $Props = {
|
|
/**
|
|
* Set the loading status
|
|
* @default "active"
|
|
*/
|
|
status?: "active" | "inactive" | "finished" | "error";
|
|
|
|
/**
|
|
* Set the loading description
|
|
* @default undefined
|
|
*/
|
|
description?: string;
|
|
|
|
/**
|
|
* Specify a description for the loading icon.
|
|
* Defaults to the `status` prop for the "error" and "finished" states
|
|
* @default undefined
|
|
*/
|
|
iconDescription?: string;
|
|
|
|
/**
|
|
* Specify the timeout delay (ms) after `status` is set to "success"
|
|
* @default 1500
|
|
*/
|
|
successDelay?: number;
|
|
|
|
[key: `data-${string}`]: any;
|
|
};
|
|
|
|
export type InlineLoadingProps = Omit<$RestProps, keyof $Props> & $Props;
|
|
|
|
export default class InlineLoading extends SvelteComponentTyped<
|
|
InlineLoadingProps,
|
|
{
|
|
click: WindowEventMap["click"];
|
|
mouseover: WindowEventMap["mouseover"];
|
|
mouseenter: WindowEventMap["mouseenter"];
|
|
mouseleave: WindowEventMap["mouseleave"];
|
|
success: CustomEvent<null>;
|
|
},
|
|
{}
|
|
> {}
|