import { SvelteComponentTyped } from "svelte"; import type { SvelteHTMLElements } from "svelte/elements"; type $RestProps = SvelteHTMLElements["div"]; type $Props = { /** * Specify the primary button text * @default "" */ primaryButtonText?: string; /** * Specify the primary button icon. */ primaryButtonIcon?: Icon | undefined; /** * Set to `true` to disable the primary button * @default false */ primaryButtonDisabled?: boolean; /** * Set to `true` to show a loading state on the primary button. * While loading, the button is non-interactive and submit is suppressed. * Same as `loadingStatus="active"`, except that the secondary buttons * stay enabled. `loadingStatus` wins when it is not `"inactive"`. * @default false */ primaryButtonLoading?: boolean; /** * Set the loading status of the footer. * Any status other than `"inactive"` shows `InlineLoading` with that * status in the primary button, disables the footer buttons, and * suppresses submit. `"finished"` dispatches `loading:success` after the * success delay. * @default "inactive" */ loadingStatus?: "inactive" | "active" | "finished" | "error"; /** * Specify the description for the primary button loading state. * Passed to `InlineLoading` as `description`. * @default "Loading" */ primaryButtonLoadingDescription?: string; /** * Specify the description for the primary button loading icon. * Passed to `InlineLoading` as `iconDescription`. */ primaryButtonLoadingIconDescription?: string | undefined; /** * Specify a class for the primary button. */ primaryClass?: string | undefined; /** * Specify the secondary button text * @default "" */ secondaryButtonText?: string; /** * Set to `true` to show a loading state on the secondary button. * Only applies to the `secondaryButtonText` path (not `secondaryButtons`). * While loading, the button is non-interactive. * @default false */ secondaryButtonLoading?: boolean; /** * Specify the description for the secondary button loading state. * Passed to `InlineLoading` as `description`. * @default "Loading" */ secondaryButtonLoadingDescription?: string; /** * One or two secondary buttons for the modal footer. * Supersedes `secondaryButtonText`. Each entry needs `text`; optional * `kind` (defaults to `"secondary"`), `disabled`, `loading`, and * `loadingDescription` (defaults to `"Loading"`) pass through to Button / * the loading state. With two entries plus a primary button, the footer * uses the three-button layout. * @default [] */ secondaryButtons?: ReadonlyArray<{ text: string; kind?: import("../Button/Button.svelte").ButtonProps["kind"]; disabled?: boolean; loading?: boolean; loadingDescription?: string }>; /** * Specify a class for the secondary button. */ secondaryClass?: string | undefined; /** * Set to `true` to use the danger variant * @default false */ danger?: boolean; children?: (this: void) => void; [key: `data-${string}`]: unknown; }; export type ModalFooterProps = Omit<$RestProps, keyof $Props> & $Props; export default class ModalFooter extends SvelteComponentTyped< ModalFooterProps, { /** Dispatched when a secondary button is clicked. For `secondaryButtonText`, the event is cancelable: call `preventDefault()` to keep the modal open. If not cancelled, the modal closes. Array `secondaryButtons` never auto-close. */ "click:button--secondary": CustomEvent<{ text: string }>; /** Dispatched when `loadingStatus` is `"finished"`, after the `InlineLoading` success delay. */ "loading:success": CustomEvent; }, { default: Record } > {}