carbon-components-svelte/tests/Modal.test.svelte
Eric Liu 0a69f8ec74
Various features/fixes (#727)
* fix(data-table): export useStaticWidth prop

* docs(data-table): add static width example

* fix(data-table): do not render table header if title/description not provided

* feat(modal): dispatch "click:button--primary" as an alias to "submit"

* test: update DataTable types test

* test(modal): update modal type tests

* docs(data-table): add clear reminder to key headers/rows
2021-07-05 13:22:56 -07:00

22 lines
541 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
on:click:button--primary
>
<p>Create a new Cloudant database in the US South region.</p>
</Modal>