diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2025-07-08 19:55:34 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2025-07-08 19:55:34 -0400 |
| commit | 718ffe3dceffb4a0439d2b3192a266cb75c7fda7 (patch) | |
| tree | 979030fdcae2e42d6cd94b11e42ea159c5e94a0d /ui/routes | |
| parent | c631c8fc855b1854f14fc7fbf1d8afedaa37a0db (diff) | |
Create swatch for the `Invites` component.
Diffstat (limited to 'ui/routes')
| -rw-r--r-- | ui/routes/(swatch)/.swatch/+page.svelte | 1 | ||||
| -rw-r--r-- | ui/routes/(swatch)/.swatch/Invites/+page.svelte | 35 |
2 files changed, 36 insertions, 0 deletions
diff --git a/ui/routes/(swatch)/.swatch/+page.svelte b/ui/routes/(swatch)/.swatch/+page.svelte index abcb53f..c28b46e 100644 --- a/ui/routes/(swatch)/.swatch/+page.svelte +++ b/ui/routes/(swatch)/.swatch/+page.svelte @@ -8,5 +8,6 @@ <h2>components</h2> <ul> + <li><a href="Invites">Invites</a></li> <li><a href="swatch/EventLog">swatch/EventLog</a></li> </ul> diff --git a/ui/routes/(swatch)/.swatch/Invites/+page.svelte b/ui/routes/(swatch)/.swatch/Invites/+page.svelte new file mode 100644 index 0000000..8c24627 --- /dev/null +++ b/ui/routes/(swatch)/.swatch/Invites/+page.svelte @@ -0,0 +1,35 @@ +<script> + import { json } from '$lib/swatch/derive.js'; + import EventCapture from '$lib/swatch/event-capture.svelte.js'; + + import EventLog from '$lib/components/swatch/EventLog.svelte'; + import Invites from '$lib/components/Invites.svelte'; + + let invitesInput = $state( + JSON.stringify([{ id: 'Iaaaa' }, { id: 'Ibbbb' }], /* replacer */ null, /* space */ 2), + ); + let invites = $derived(json(invitesInput)); + + let capture = $state(new EventCapture()); + const createInvite = capture.on('createInvite'); +</script> + +<h1><code>Invites</code></h1> + +<nav><p><a href=".">Back to swatches</a></p></nav> + +<h2>properties</h2> + +<div class="component-properties"> + <label>invites (json) <textarea bind:value={invitesInput}></textarea></label> +</div> + +<h2>rendered</h2> + +<div class="component-preview"> + <Invites {invites} {createInvite} /> +</div> + +<h2>events</h2> + +<EventLog events={capture.events} clear={capture.clear.bind(capture)} /> |
