diff options
Diffstat (limited to 'ui/routes/(swatch)/.swatch')
| -rw-r--r-- | ui/routes/(swatch)/.swatch/+page.svelte | 1 | ||||
| -rw-r--r-- | ui/routes/(swatch)/.swatch/ConversationList/+page.svelte | 54 |
2 files changed, 55 insertions, 0 deletions
diff --git a/ui/routes/(swatch)/.swatch/+page.svelte b/ui/routes/(swatch)/.swatch/+page.svelte index abcb53f..c8f2133 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="ConversationList">ConversationList</a></li> <li><a href="swatch/EventLog">swatch/EventLog</a></li> </ul> diff --git a/ui/routes/(swatch)/.swatch/ConversationList/+page.svelte b/ui/routes/(swatch)/.swatch/ConversationList/+page.svelte new file mode 100644 index 0000000..1a56966 --- /dev/null +++ b/ui/routes/(swatch)/.swatch/ConversationList/+page.svelte @@ -0,0 +1,54 @@ +<script> + import { json } from '$lib/swatch/derive.js'; + + import ConversationList from '$lib/components/ConversationList.svelte'; + + let conversationsInput = $state( + JSON.stringify( + [ + { + id: 'Czero', + name: 'A long conversation', + hasUnreads: false, + }, + { + id: 'Cone', + name: 'A shorter conversation', + hasUnreads: true, + }, + ], + /* replacer */ null, + /* space */ 2, + ), + ); + let conversations = $derived(json(conversationsInput)); + + let active = $state(null); +</script> + +<h1><code>ConversationList</code></h1> + +<nav><p><a href=".">Back to swatches</a></p></nav> + +<h2>properties</h2> + +<div class="component-properties"> + <label + ><p>conversations (json)</p> + <textarea class="html" bind:value={conversationsInput}></textarea> + </label> + + <label>active <input type="text" bind:value={active} /></label> + <div class="suggestion"> + interesting values: + <button onclick={() => (active = null)}>(none)</button> + <button onclick={() => (active = 'Czero')}>Czero</button> + <button onclick={() => (active = 'Cone')}>Cone</button> + </div> +</div> + +<h2>rendered</h2> + +<div class="component-preview"> + <ConversationList {conversations} {active} /> +</div> |
