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

@ -6073,6 +6073,16 @@
"constant": false,
"reactive": false
},
{
"name": "primaryButtonIcon",
"kind": "let",
"description": "Specify the primary button icon",
"type": "typeof import(\"svelte\").SvelteComponent",
"isFunction": false,
"isFunctionDeclaration": false,
"constant": false,
"reactive": false
},
{
"name": "shouldSubmitOnEnter",
"kind": "let",
@ -6237,6 +6247,16 @@
"constant": false,
"reactive": false
},
{
"name": "primaryButtonIcon",
"kind": "let",
"description": "Specify the primary button icon",
"type": "typeof import(\"svelte\").SvelteComponent",
"isFunction": false,
"isFunctionDeclaration": false,
"constant": false,
"reactive": false
},
{
"name": "primaryButtonDisabled",
"kind": "let",

View file

@ -42,3 +42,6 @@ Use the `secondaryButtons` prop to render two secondary buttons for a "3-button
<FileSource src="/framed/Modal/ModalPreventOutsideClick" />
### Button with icon
<FileSource src="/framed/Modal/ModalButtonWithIcon" />

View file

@ -0,0 +1,14 @@
<script>
import { Modal } from "carbon-components-svelte";
import Send16 from "carbon-icons-svelte/lib/Send16";
</script>
<Modal
open
modalHeading="Invite someone"
primaryButtonText="Send invitation"
primaryButtonIcon="{Send16}"
secondaryButtonText="Cancel"
>
<p>Do you really want to invite someone?</p>
</Modal>