mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
* feat(modal): support 3-button modal #528, #472 * fix(modal): "supercede" --> "supersede" * test(modal): test secondaryButtons prop, updated click:button--secondary custom event * docs(modal): add multiple secondary button example for ComposedModal * docs(modal): rename example * fix(modal): do not render secondary button if secondaryButtonText is falsy * docs(composed-modal): add button to re-open modal
21 lines
514 B
Svelte
21 lines
514 B
Svelte
<script lang="ts">
|
|
import { Button, Modal } from "../types";
|
|
|
|
let open = false;
|
|
</script>
|
|
|
|
<Button on:click="{() => (open = true)}">Create database</Button>
|
|
|
|
<Modal
|
|
bind:open
|
|
modalHeading="Create database"
|
|
primaryButtonText="Confirm"
|
|
secondaryButtons="{[{ text: 'Cancel' }, { text: 'Duplicate' }]}"
|
|
secondaryButtonText="Cancel"
|
|
on:click:button--secondary="{({ detail }) => (open = false)}"
|
|
on:open
|
|
on:close
|
|
on:submit
|
|
>
|
|
<p>Create a new Cloudant database in the US South region.</p>
|
|
</Modal>
|