mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-20 20:33:02 +00:00
docs: add new component docs
This commit is contained in:
parent
c2fb2d213d
commit
2008d0035f
130 changed files with 6662 additions and 3801 deletions
19
docs/src/pages/framed/Modal/ComposedModal.svelte
Normal file
19
docs/src/pages/framed/Modal/ComposedModal.svelte
Normal file
|
@ -0,0 +1,19 @@
|
|||
<script>
|
||||
import {
|
||||
ComposedModal,
|
||||
ModalHeader,
|
||||
ModalBody,
|
||||
ModalFooter,
|
||||
Checkbox,
|
||||
} from "carbon-components-svelte";
|
||||
|
||||
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}" />
|
||||
</ComposedModal>
|
21
docs/src/pages/framed/Modal/DangerModal.svelte
Normal file
21
docs/src/pages/framed/Modal/DangerModal.svelte
Normal file
|
@ -0,0 +1,21 @@
|
|||
<script>
|
||||
import { Button, Modal } from "carbon-components-svelte";
|
||||
|
||||
let open = false;
|
||||
</script>
|
||||
|
||||
<Button kind="danger" on:click="{() => (open = true)}">Delete all</Button>
|
||||
|
||||
<Modal
|
||||
danger
|
||||
bind:open
|
||||
modalHeading="Delete all instances"
|
||||
primaryButtonText="Delete"
|
||||
secondaryButtonText="Cancel"
|
||||
on:click:button--secondary="{() => (open = false)}"
|
||||
on:open
|
||||
on:close
|
||||
on:submit
|
||||
>
|
||||
<p>This is a permanent action and cannot be undone.</p>
|
||||
</Modal>
|
20
docs/src/pages/framed/Modal/Modal.svelte
Normal file
20
docs/src/pages/framed/Modal/Modal.svelte
Normal file
|
@ -0,0 +1,20 @@
|
|||
<script>
|
||||
import { Button, Modal } from "carbon-components-svelte";
|
||||
|
||||
let open = false;
|
||||
</script>
|
||||
|
||||
<Button on:click="{() => (open = true)}">Create database</Button>
|
||||
|
||||
<Modal
|
||||
bind:open
|
||||
modalHeading="Create database"
|
||||
primaryButtonText="Confirm"
|
||||
secondaryButtonText="Cancel"
|
||||
on:click:button--secondary="{() => (open = false)}"
|
||||
on:open
|
||||
on:close
|
||||
on:submit
|
||||
>
|
||||
<p>Create a new Cloudant database in the US South region.</p>
|
||||
</Modal>
|
17
docs/src/pages/framed/Modal/ModalExtraSmall.svelte
Normal file
17
docs/src/pages/framed/Modal/ModalExtraSmall.svelte
Normal file
|
@ -0,0 +1,17 @@
|
|||
<script>
|
||||
import { Modal } from "carbon-components-svelte";
|
||||
</script>
|
||||
|
||||
<Modal
|
||||
size="xs"
|
||||
open
|
||||
modalHeading="Create database"
|
||||
primaryButtonText="Confirm"
|
||||
secondaryButtonText="Cancel"
|
||||
on:click:button--secondary
|
||||
on:open
|
||||
on:close
|
||||
on:submit
|
||||
>
|
||||
<p>Create a new Cloudant database in the US South region.</p>
|
||||
</Modal>
|
17
docs/src/pages/framed/Modal/ModalLarge.svelte
Normal file
17
docs/src/pages/framed/Modal/ModalLarge.svelte
Normal file
|
@ -0,0 +1,17 @@
|
|||
<script>
|
||||
import { Modal } from "carbon-components-svelte";
|
||||
</script>
|
||||
|
||||
<Modal
|
||||
size="lg"
|
||||
open
|
||||
modalHeading="Create database"
|
||||
primaryButtonText="Confirm"
|
||||
secondaryButtonText="Cancel"
|
||||
on:click:button--secondary
|
||||
on:open
|
||||
on:close
|
||||
on:submit
|
||||
>
|
||||
<p>Create a new Cloudant database in the US South region.</p>
|
||||
</Modal>
|
17
docs/src/pages/framed/Modal/ModalPreventOutsideClick.svelte
Normal file
17
docs/src/pages/framed/Modal/ModalPreventOutsideClick.svelte
Normal file
|
@ -0,0 +1,17 @@
|
|||
<script>
|
||||
import { Modal } from "carbon-components-svelte";
|
||||
</script>
|
||||
|
||||
<Modal
|
||||
preventCloseOnClickOutside
|
||||
open
|
||||
modalHeading="Create database"
|
||||
primaryButtonText="Confirm"
|
||||
secondaryButtonText="Cancel"
|
||||
on:click:button--secondary
|
||||
on:open
|
||||
on:close
|
||||
on:submit
|
||||
>
|
||||
<p>Create a new Cloudant database in the US South region.</p>
|
||||
</Modal>
|
17
docs/src/pages/framed/Modal/ModalSmall.svelte
Normal file
17
docs/src/pages/framed/Modal/ModalSmall.svelte
Normal file
|
@ -0,0 +1,17 @@
|
|||
<script>
|
||||
import { Modal } from "carbon-components-svelte";
|
||||
</script>
|
||||
|
||||
<Modal
|
||||
size="sm"
|
||||
open
|
||||
modalHeading="Create database"
|
||||
primaryButtonText="Confirm"
|
||||
secondaryButtonText="Cancel"
|
||||
on:click:button--secondary
|
||||
on:open
|
||||
on:close
|
||||
on:submit
|
||||
>
|
||||
<p>Create a new Cloudant database in the US South region.</p>
|
||||
</Modal>
|
14
docs/src/pages/framed/Modal/PassiveModal.svelte
Normal file
14
docs/src/pages/framed/Modal/PassiveModal.svelte
Normal file
|
@ -0,0 +1,14 @@
|
|||
<script>
|
||||
import { Button, Modal } from "carbon-components-svelte";
|
||||
|
||||
let open = false;
|
||||
</script>
|
||||
|
||||
<Button kind="tertiary" on:click="{() => (open = true)}">Learn more</Button>
|
||||
|
||||
<Modal passiveModal bind:open modalHeading="IBM Cloudant" on:open on:close>
|
||||
<p>
|
||||
IBM Cloudant is a distributed, secure database with global availability and
|
||||
zero vendor lock-in used to build web and mobile apps at scale.
|
||||
</p>
|
||||
</Modal>
|
Loading…
Add table
Add a link
Reference in a new issue