diff options
author | Volpeon <git@volpeon.ink> | 2024-06-26 21:47:55 +0200 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2024-06-26 21:47:55 +0200 |
commit | 03bb4268367dcd3b2d327d3834e2047a56687a86 (patch) | |
tree | 83f6f6837fc909dd8cc5f8166c3c1b4ae78c85d9 /tpl | |
parent | Update (diff) | |
download | iro-design-03bb4268367dcd3b2d327d3834e2047a56687a86.tar.gz iro-design-03bb4268367dcd3b2d327d3834e2047a56687a86.tar.bz2 iro-design-03bb4268367dcd3b2d327d3834e2047a56687a86.zip |
Menus
Diffstat (limited to 'tpl')
-rw-r--r-- | tpl/index.pug | 11 | ||||
-rw-r--r-- | tpl/objects/action-menu.pug | 35 | ||||
-rw-r--r-- | tpl/objects/menu.pug | 11 | ||||
-rw-r--r-- | tpl/objects/popover.pug | 12 | ||||
-rw-r--r-- | tpl/objects/side-nav.pug | 48 | ||||
-rw-r--r-- | tpl/views/action-menu.pug | 29 | ||||
-rw-r--r-- | tpl/views/menu.pug | 8 | ||||
-rw-r--r-- | tpl/views/popover.pug | 6 | ||||
-rw-r--r-- | tpl/views/side-nav.pug | 26 |
9 files changed, 130 insertions, 56 deletions
diff --git a/tpl/index.pug b/tpl/index.pug index a93418c..7b419b3 100644 --- a/tpl/index.pug +++ b/tpl/index.pug | |||
@@ -21,8 +21,9 @@ include objects/action-button.pug | |||
21 | include objects/overflow-button.pug | 21 | include objects/overflow-button.pug |
22 | include objects/status-indicator.pug | 22 | include objects/status-indicator.pug |
23 | include objects/avatar.pug | 23 | include objects/avatar.pug |
24 | include objects/action-menu.pug | 24 | include objects/popover.pug |
25 | include objects/menu.pug | 25 | include objects/menu.pug |
26 | include objects/side-nav.pug | ||
26 | include objects/icon-nav.pug | 27 | include objects/icon-nav.pug |
27 | include objects/emoji.pug | 28 | include objects/emoji.pug |
28 | include objects/backdrop.pug | 29 | include objects/backdrop.pug |
@@ -48,7 +49,7 @@ mixin user-card(name, hue) | |||
48 | const avaName = name.slice(0, 1) | 49 | const avaName = name.slice(0, 1) |
49 | 50 | ||
50 | .l-media.l-media--flush.l-media--75 | 51 | .l-media.l-media--flush.l-media--75 |
51 | +avatar(block=true size='50' class='l-media__block' hue=hue) | 52 | +avatar(block=true size='xs' class='l-media__block' hue=hue) |
52 | = avaName | 53 | = avaName |
53 | = name | 54 | = name |
54 | 55 | ||
@@ -71,8 +72,10 @@ include views/action-button.pug | |||
71 | include views/overflow-button.pug | 72 | include views/overflow-button.pug |
72 | include views/status-indicator.pug | 73 | include views/status-indicator.pug |
73 | include views/avatar.pug | 74 | include views/avatar.pug |
75 | include views/popover.pug | ||
74 | include views/action-menu.pug | 76 | include views/action-menu.pug |
75 | include views/menu.pug | 77 | include views/menu.pug |
78 | include views/side-nav.pug | ||
76 | include views/icon-nav.pug | 79 | include views/icon-nav.pug |
77 | include views/backdrop.pug | 80 | include views/backdrop.pug |
78 | include views/dialog.pug | 81 | include views/dialog.pug |
@@ -116,8 +119,10 @@ html | |||
116 | +view-overflow-button | 119 | +view-overflow-button |
117 | +view-status-indicator | 120 | +view-status-indicator |
118 | +view-avatar | 121 | +view-avatar |
119 | +view-action-menu | 122 | +view-side-nav |
123 | +view-popover | ||
120 | +view-menu | 124 | +view-menu |
125 | +view-action-menu | ||
121 | +view-icon-nav | 126 | +view-icon-nav |
122 | +view-backdrop | 127 | +view-backdrop |
123 | +view-dialog | 128 | +view-dialog |
diff --git a/tpl/objects/action-menu.pug b/tpl/objects/action-menu.pug deleted file mode 100644 index be9d86d..0000000 --- a/tpl/objects/action-menu.pug +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | include icon.pug | ||
2 | include status-indicator.pug | ||
3 | |||
4 | mixin action-menu | ||
5 | .o-action-menu.u-p-static.t-up | ||
6 | block | ||
7 | |||
8 | mixin action-menu-item | ||
9 | button.o-action-menu__item(disabled=attributes.disabled) | ||
10 | .l-media.l-media--flush | ||
11 | .l-media__block.o-action-menu__icon-slot | ||
12 | if attributes.icon | ||
13 | if attributes.iconIsStatus | ||
14 | +status-indicator(attributes.icon)(class='o-action-menu__icon') | ||
15 | else | ||
16 | +icon(attributes.icon)(class='o-action-menu__icon') | ||
17 | .l-media__block.l-media__block--main | ||
18 | block | ||
19 | .l-media__block.o-action-menu__icon-slot | ||
20 | if attributes.postIcon | ||
21 | +icon(attributes.postIcon)(class='o-action-menu__icon') | ||
22 | |||
23 | mixin action-menu-separator | ||
24 | .o-action-menu__separator | ||
25 | |||
26 | mixin action-menu-slot | ||
27 | - | ||
28 | let classes = { | ||
29 | 'o-action-menu__slot ': true, | ||
30 | } | ||
31 | if (attributes.class) { | ||
32 | classes[attributes.class] = true; | ||
33 | } | ||
34 | div(class=classes) | ||
35 | block | ||
diff --git a/tpl/objects/menu.pug b/tpl/objects/menu.pug index 1dd38ef..a8b20d7 100644 --- a/tpl/objects/menu.pug +++ b/tpl/objects/menu.pug | |||
@@ -46,3 +46,14 @@ mixin menu-header | |||
46 | 46 | ||
47 | mixin menu-separator | 47 | mixin menu-separator |
48 | .o-menu__separator | 48 | .o-menu__separator |
49 | |||
50 | mixin menu-slot | ||
51 | - | ||
52 | let classes = { | ||
53 | 'o-menu__slot ': true, | ||
54 | } | ||
55 | if (attributes.class) { | ||
56 | classes[attributes.class] = true; | ||
57 | } | ||
58 | div(class=classes) | ||
59 | block | ||
diff --git a/tpl/objects/popover.pug b/tpl/objects/popover.pug new file mode 100644 index 0000000..ba93a81 --- /dev/null +++ b/tpl/objects/popover.pug | |||
@@ -0,0 +1,12 @@ | |||
1 | mixin popover | ||
2 | - | ||
3 | let classes = { | ||
4 | 'o-popover': true, | ||
5 | 'u-p-static': true, | ||
6 | } | ||
7 | if (attributes.class) { | ||
8 | classes[attributes.class] = true; | ||
9 | } | ||
10 | |||
11 | div(class=classes, style=styles) | ||
12 | block | ||
diff --git a/tpl/objects/side-nav.pug b/tpl/objects/side-nav.pug new file mode 100644 index 0000000..511f298 --- /dev/null +++ b/tpl/objects/side-nav.pug | |||
@@ -0,0 +1,48 @@ | |||
1 | include icon.pug | ||
2 | include status-indicator.pug | ||
3 | include action-button.pug | ||
4 | |||
5 | mixin side-nav | ||
6 | - | ||
7 | let classes = { | ||
8 | 'o-side-nav': true, | ||
9 | } | ||
10 | if (attributes.class) { | ||
11 | classes[attributes.class] = true; | ||
12 | } | ||
13 | |||
14 | div(class=classes)&attributes(attributes) | ||
15 | block | ||
16 | |||
17 | mixin side-nav-item | ||
18 | - | ||
19 | let classes = { | ||
20 | 'o-side-nav__item': true, | ||
21 | 'l-media': true, | ||
22 | 'l-media--75': true, | ||
23 | 'o-side-nav__header': attributes.header, | ||
24 | 'is-selected': attributes.selected, | ||
25 | } | ||
26 | if (attributes.class) { | ||
27 | classes[attributes.class] = true; | ||
28 | } | ||
29 | |||
30 | #{!!attributes.tag ? attributes.tag : 'button'}(class=classes)&attributes(attributes) | ||
31 | if attributes.icon | ||
32 | .l-media__block.o-side-nav__icon-slot | ||
33 | if attributes.iconIsStatus | ||
34 | +status-indicator(attributes.icon)(class='o-side-nav__icon') | ||
35 | else | ||
36 | +icon(attributes.icon)(class='o-side-nav__icon') | ||
37 | .l-media__block.l-media__block--main&attributes({ class: attributes.contentClass }) | ||
38 | block | ||
39 | if attributes.postIcon | ||
40 | .l-media__block.o-side-nav__icon-slot | ||
41 | +icon(attributes.postIcon)(class='o-side-nav__icon') | ||
42 | |||
43 | mixin side-nav-header | ||
44 | header.o-side-nav__header | ||
45 | block | ||
46 | |||
47 | mixin side-nav-separator | ||
48 | .o-side-nav__separator | ||
diff --git a/tpl/views/action-menu.pug b/tpl/views/action-menu.pug index 3357caa..0546463 100644 --- a/tpl/views/action-menu.pug +++ b/tpl/views/action-menu.pug | |||
@@ -3,17 +3,18 @@ mixin view-action-menu | |||
3 | .c-box | 3 | .c-box |
4 | div(style={ display: 'flex', 'flex-direction': 'column', 'align-items': 'flex-start' }) | 4 | div(style={ display: 'flex', 'flex-direction': 'column', 'align-items': 'flex-start' }) |
5 | +action-button(quiet=true selected=true)= 'Menu' | 5 | +action-button(quiet=true selected=true)= 'Menu' |
6 | +action-menu | 6 | +popover |
7 | +action-menu-slot(class='l-media l-media--flush') | 7 | +menu |
8 | +avatar(block=true circle=true size='100' src='avatar.png' class='l-media__block') | 8 | +menu-slot(class='l-media l-media--flush') |
9 | .l-media__block.l-media__block--main | 9 | +avatar(block=true circle=true size='100' src='avatar.png' class='l-media__block') |
10 | strong.u-d-block= 'Volpeon' | 10 | .l-media__block.l-media__block--main |
11 | small.u-d-block= '@volpeon@mk.vulpes.one' | 11 | strong.u-d-block= 'Volpeon' |
12 | +action-menu-separator | 12 | small.u-d-block= '@volpeon@mk.vulpes.one' |
13 | +action-menu-item(icon='user')= 'View profile' | 13 | +menu-separator |
14 | +action-menu-item(icon='red' iconIsStatus=true)= 'Mark as away' | 14 | +menu-item(icon='user')= 'View profile' |
15 | +action-menu-separator | 15 | +menu-item(icon='red' iconIsStatus=true)= 'Mark as away' |
16 | +action-menu-item(icon='trash' disabled=true)= 'Delete' | 16 | +menu-separator |
17 | +action-menu-item(icon='bookmark')= 'Bookmark' | 17 | +menu-item(icon='trash' disabled=true)= 'Delete' |
18 | +action-menu-item(icon='tags')= 'Tags' | 18 | +menu-item(icon='bookmark')= 'Bookmark' |
19 | +action-menu-item(postIcon='chevron-right')= 'More' | 19 | +menu-item(icon='tags')= 'Tags' |
20 | +menu-item(postIcon='chevron-right')= 'More' | ||
diff --git a/tpl/views/menu.pug b/tpl/views/menu.pug index 4d7444f..c61cb92 100644 --- a/tpl/views/menu.pug +++ b/tpl/views/menu.pug | |||
@@ -20,11 +20,11 @@ mixin view-menu | |||
20 | +menu-item(header=true) | 20 | +menu-item(header=true) |
21 | = 'Libera' | 21 | = 'Libera' |
22 | +menu-item(icon='hash') | 22 | +menu-item(icon='hash') |
23 | = 'achannel' | 23 | = 'achannel ' |
24 | +badge('primary')(menu=true)= '12 ' | 24 | +badge('primary')(size='sm')= '12 ' |
25 | +menu-item(icon='hash') | 25 | +menu-item(icon='hash') |
26 | = 'kitsuneirc' | 26 | = 'kitsuneirc ' |
27 | +badge(menu=true)= '31 ' | 27 | +badge(size='sm')= '31 ' |
28 | +menu-item(icon='green' iconIsStatus=true) | 28 | +menu-item(icon='green' iconIsStatus=true) |
29 | = 'volpeon' | 29 | = 'volpeon' |
30 | +menu-item(icon='red' iconIsStatus=true) | 30 | +menu-item(icon='red' iconIsStatus=true) |
diff --git a/tpl/views/popover.pug b/tpl/views/popover.pug new file mode 100644 index 0000000..b269596 --- /dev/null +++ b/tpl/views/popover.pug | |||
@@ -0,0 +1,6 @@ | |||
1 | mixin view-popover | ||
2 | +view('popover', 'Popover') | ||
3 | .c-box | ||
4 | +action-button(quiet=true selected=true)= 'Popover' | ||
5 | +popover | ||
6 | = loremIpsum | ||
diff --git a/tpl/views/side-nav.pug b/tpl/views/side-nav.pug new file mode 100644 index 0000000..30fbcbb --- /dev/null +++ b/tpl/views/side-nav.pug | |||
@@ -0,0 +1,26 @@ | |||
1 | mixin view-side-nav | ||
2 | +view('side-nav', 'Side Nav') | ||
3 | .c-box | ||
4 | +side-nav | ||
5 | +side-nav-item= 'Section 1' | ||
6 | +side-nav-item(tag='div')= 'Section 2' | ||
7 | +side-nav-item= 'Section 3' | ||
8 | |||
9 | .c-box | ||
10 | +side-nav | ||
11 | +side-nav-item= 'Section 1' | ||
12 | +side-nav-item= 'Section 2' | ||
13 | |||
14 | +side-nav-header= 'Category 1' | ||
15 | +side-nav-item= 'Section 3' | ||
16 | +side-nav-item= 'Section 4' | ||
17 | |||
18 | +side-nav-header= 'Category 2' | ||
19 | +side-nav-item= 'Section 5' | ||
20 | +side-nav-item= 'Section 6' | ||
21 | |||
22 | .c-box | ||
23 | +side-nav | ||
24 | +side-nav-item(icon='hash')= 'Section 1' | ||
25 | +side-nav-item(tag='div' icon='bookmark')= 'Section 2' | ||
26 | +side-nav-item(icon='tags')= 'Section 3' | ||