feat(modal): support primaryButtonIcon prop (#1047)

This commit is contained in:
Gregor Wassmann 2022-01-29 18:35:08 +01:00 committed by GitHub
commit a8039a4d1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 96 additions and 31 deletions

View file

@ -55,6 +55,12 @@
/** Set to `true` to disable the primary button */
export let primaryButtonDisabled = false;
/**
* Specify the primary button icon
* @type {typeof import("svelte").SvelteComponent}
*/
export let primaryButtonIcon = undefined;
/**
* Set to `true` for the "submit" and "click:button--primary" events
* to be dispatched when pressing "Enter"
@ -300,6 +306,7 @@
<Button
kind="{danger ? 'danger' : 'primary'}"
disabled="{primaryButtonDisabled}"
icon="{primaryButtonIcon}"
on:click="{() => {
dispatch('submit');
dispatch('click:button--primary');