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
24 lines
569 B
Svelte
24 lines
569 B
Svelte
<script lang="ts">
|
|
import {
|
|
ComposedModal,
|
|
ModalHeader,
|
|
ModalBody,
|
|
ModalFooter,
|
|
Checkbox,
|
|
} from "../types";
|
|
|
|
let checked = false;
|
|
</script>
|
|
|
|
<ComposedModal open>
|
|
<ModalHeader title="Confirm changes" />
|
|
<ModalBody hasForm>
|
|
<Checkbox labelText="I have reviewed the changes" bind:checked />
|
|
</ModalBody>
|
|
<ModalFooter
|
|
primaryButtonText="Proceed"
|
|
primaryButtonDisabled="{!checked}"
|
|
secondaryButtons="{[{ text: 'Cancel' }, { text: 'Duplicate' }]}"
|
|
on:click:button--secondary="{({ detail }) => {}}"
|
|
/>
|
|
</ComposedModal>
|