mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 19:46:36 +00:00
docs: do not open modals initially
Open modals can steal the document focus.
This commit is contained in:
parent
6acd0bf425
commit
c804761ad2
6 changed files with 36 additions and 12 deletions
|
@ -1,10 +1,14 @@
|
||||||
<script>
|
<script>
|
||||||
import { Modal } from "carbon-components-svelte";
|
import { Button, Modal } from "carbon-components-svelte";
|
||||||
import Send from "carbon-icons-svelte/lib/Send.svelte";
|
import Send from "carbon-icons-svelte/lib/Send.svelte";
|
||||||
|
|
||||||
|
let open = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<Button on:click="{() => (open = true)}">Create database</Button>
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
open
|
bind:open
|
||||||
modalHeading="Invite someone"
|
modalHeading="Invite someone"
|
||||||
primaryButtonText="Send invitation"
|
primaryButtonText="Send invitation"
|
||||||
primaryButtonIcon="{Send}"
|
primaryButtonIcon="{Send}"
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
<script>
|
<script>
|
||||||
import { Modal } from "carbon-components-svelte";
|
import { Button, Modal } from "carbon-components-svelte";
|
||||||
|
|
||||||
|
let open = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<Button on:click="{() => (open = true)}">Create database</Button>
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
size="xs"
|
size="xs"
|
||||||
open
|
bind:open
|
||||||
modalHeading="Create database"
|
modalHeading="Create database"
|
||||||
primaryButtonText="Confirm"
|
primaryButtonText="Confirm"
|
||||||
secondaryButtonText="Cancel"
|
secondaryButtonText="Cancel"
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
<script>
|
<script>
|
||||||
import { Modal } from "carbon-components-svelte";
|
import { Button, Modal } from "carbon-components-svelte";
|
||||||
|
|
||||||
|
let open = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<Button on:click="{() => (open = true)}">Create database</Button>
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
size="lg"
|
size="lg"
|
||||||
open
|
bind:open
|
||||||
modalHeading="Create database"
|
modalHeading="Create database"
|
||||||
primaryButtonText="Confirm"
|
primaryButtonText="Confirm"
|
||||||
secondaryButtonText="Cancel"
|
secondaryButtonText="Cancel"
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
<script>
|
<script>
|
||||||
import { Modal } from "carbon-components-svelte";
|
import { Button, Modal } from "carbon-components-svelte";
|
||||||
|
|
||||||
|
let open = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<Button on:click="{() => (open = true)}">Create database</Button>
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
preventCloseOnClickOutside
|
preventCloseOnClickOutside
|
||||||
open
|
bind:open
|
||||||
modalHeading="Create database"
|
modalHeading="Create database"
|
||||||
primaryButtonText="Confirm"
|
primaryButtonText="Confirm"
|
||||||
secondaryButtonText="Cancel"
|
secondaryButtonText="Cancel"
|
||||||
|
|
|
@ -1,8 +1,12 @@
|
||||||
<script>
|
<script>
|
||||||
import { Modal } from "carbon-components-svelte";
|
import { Button, Modal } from "carbon-components-svelte";
|
||||||
|
|
||||||
|
let open = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Modal open passiveModal modalHeading="About Cloudant" hasScrollingContent>
|
<Button on:click="{() => (open = true)}">Create database</Button>
|
||||||
|
|
||||||
|
<Modal bind:open passiveModal modalHeading="About Cloudant" hasScrollingContent>
|
||||||
<p>
|
<p>
|
||||||
Cloudant is a fully managed, distributed database optimized for heavy
|
Cloudant is a fully managed, distributed database optimized for heavy
|
||||||
workloads and fast-growing web and mobile apps, IBM Cloudant is available as
|
workloads and fast-growing web and mobile apps, IBM Cloudant is available as
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
<script>
|
<script>
|
||||||
import { Modal } from "carbon-components-svelte";
|
import { Button, Modal } from "carbon-components-svelte";
|
||||||
|
|
||||||
|
let open = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<Button on:click="{() => (open = true)}">Create database</Button>
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
size="sm"
|
size="sm"
|
||||||
open
|
bind:open
|
||||||
modalHeading="Create database"
|
modalHeading="Create database"
|
||||||
primaryButtonText="Confirm"
|
primaryButtonText="Confirm"
|
||||||
secondaryButtonText="Cancel"
|
secondaryButtonText="Cancel"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue