-
-
Notifications
You must be signed in to change notification settings - Fork 282
Expand file tree
/
Copy path_Complex.svelte
More file actions
76 lines (73 loc) · 2.31 KB
/
_Complex.svelte
File metadata and controls
76 lines (73 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<div class="accordion-container">
<Accordion>
<Panel>
<Header>Panel with Simple Content</Header>
<Content>This panel has boring content.</Content>
</Panel>
<Panel>
<Header>Panel with Extravagent Content</Header>
<Content>
<div
style="display: flex; justify-content: space-between; align-items: center;"
>
This panel has really cool content!
<Wrapper>
<div style="display: inline-block;">
<Button onclick={() => menu.setOpen(true)}>
<Label>Really?</Label>
</Button>
<Menu bind:this={menu}>
<List>
<Item
onSMUIAction={() => {
dialogOpen = true;
}}
>
<Text>Yes!</Text>
</Item>
</List>
</Menu>
</div>
<Tooltip yPos="below">
This tooltip should extend outside the panel!
</Tooltip>
</Wrapper>
</div>
<Dialog
bind:open={dialogOpen}
aria-labelledby="complex-accordion-dialog-title"
aria-describedby="complex-accordion-dialog-content"
>
<!-- Title cannot contain leading whitespace due to mdc-typography-baseline-top() -->
<Title id="complex-accordion-dialog-title">A Dialog!</Title>
<DialogContent id="complex-accordion-dialog-content">
This dialog is even a child of the panel!
</DialogContent>
<Actions>
<Button defaultAction>
<Label>Wow!</Label>
</Button>
</Actions>
</Dialog>
</Content>
</Panel>
<Panel>
<Header>Panel with Simple Content</Header>
<Content>This panel has boring content.</Content>
</Panel>
</Accordion>
</div>
<script lang="ts">
import Accordion, { Panel, Header, Content } from '@smui-extra/accordion';
import Button, { Label } from '@smui/button';
import Tooltip, { Wrapper } from '@smui/tooltip';
import Menu from '@smui/menu';
import List, { Item, Text } from '@smui/list';
import Dialog, {
Title,
Content as DialogContent,
Actions,
} from '@smui/dialog';
let menu: Menu;
let dialogOpen = $state(false);
</script>