diff options
author | Volpeon <git@volpeon.ink> | 2022-03-31 09:51:12 +0200 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2022-03-31 09:51:12 +0200 |
commit | 9e5f08e31b4d228da011fa7cd92240433116997f (patch) | |
tree | a36e7f0a4ec407924260da24d86446235387941e /tpl | |
parent | Remove t-lo (diff) | |
download | iro-design-9e5f08e31b4d228da011fa7cd92240433116997f.tar.gz iro-design-9e5f08e31b4d228da011fa7cd92240433116997f.tar.bz2 iro-design-9e5f08e31b4d228da011fa7cd92240433116997f.zip |
Added icon nav component
Diffstat (limited to 'tpl')
-rw-r--r-- | tpl/index.pug | 3 | ||||
-rw-r--r-- | tpl/objects/icon-nav.pug | 29 | ||||
-rw-r--r-- | tpl/objects/menu.pug | 6 | ||||
-rw-r--r-- | tpl/views/icon-nav.pug | 17 |
4 files changed, 55 insertions, 0 deletions
diff --git a/tpl/index.pug b/tpl/index.pug index 4ed1ae3..6565589 100644 --- a/tpl/index.pug +++ b/tpl/index.pug | |||
@@ -21,6 +21,7 @@ include objects/status-indicator.pug | |||
21 | include objects/avatar.pug | 21 | include objects/avatar.pug |
22 | include objects/action-menu.pug | 22 | include objects/action-menu.pug |
23 | include objects/menu.pug | 23 | include objects/menu.pug |
24 | include objects/icon-nav.pug | ||
24 | include objects/backdrop.pug | 25 | include objects/backdrop.pug |
25 | include objects/dialog.pug | 26 | include objects/dialog.pug |
26 | include objects/lightbox.pug | 27 | include objects/lightbox.pug |
@@ -64,6 +65,7 @@ include views/status-indicator.pug | |||
64 | include views/avatar.pug | 65 | include views/avatar.pug |
65 | include views/action-menu.pug | 66 | include views/action-menu.pug |
66 | include views/menu.pug | 67 | include views/menu.pug |
68 | include views/icon-nav.pug | ||
67 | include views/backdrop.pug | 69 | include views/backdrop.pug |
68 | include views/dialog.pug | 70 | include views/dialog.pug |
69 | include views/lightbox.pug | 71 | include views/lightbox.pug |
@@ -101,6 +103,7 @@ html | |||
101 | +view-avatar | 103 | +view-avatar |
102 | +view-action-menu | 104 | +view-action-menu |
103 | +view-menu | 105 | +view-menu |
106 | +view-icon-nav | ||
104 | +view-backdrop | 107 | +view-backdrop |
105 | +view-dialog | 108 | +view-dialog |
106 | +view-lightbox | 109 | +view-lightbox |
diff --git a/tpl/objects/icon-nav.pug b/tpl/objects/icon-nav.pug new file mode 100644 index 0000000..6f45bf6 --- /dev/null +++ b/tpl/objects/icon-nav.pug | |||
@@ -0,0 +1,29 @@ | |||
1 | include icon.pug | ||
2 | include status-indicator.pug | ||
3 | include action-button.pug | ||
4 | |||
5 | mixin icon-nav | ||
6 | - | ||
7 | let classes = { | ||
8 | 'o-icon-nav': true, | ||
9 | 'o-icon-nav--vertical': attributes.vertical, | ||
10 | } | ||
11 | if (attributes.class) { | ||
12 | classes[attributes.class] = true; | ||
13 | } | ||
14 | |||
15 | div(class=classes)&attributes(attributes) | ||
16 | block | ||
17 | |||
18 | mixin icon-nav-item(icon) | ||
19 | - | ||
20 | let classes = { | ||
21 | 'o-icon-nav__item': true, | ||
22 | 'is-selected': attributes.selected, | ||
23 | } | ||
24 | if (attributes.class) { | ||
25 | classes[attributes.class] = true; | ||
26 | } | ||
27 | |||
28 | button(class=classes)&attributes(attributes) | ||
29 | +icon(icon)(block=true) | ||
diff --git a/tpl/objects/menu.pug b/tpl/objects/menu.pug index c6e8223..f9d59b8 100644 --- a/tpl/objects/menu.pug +++ b/tpl/objects/menu.pug | |||
@@ -7,6 +7,9 @@ mixin menu | |||
7 | let classes = { | 7 | let classes = { |
8 | 'o-menu': true, | 8 | 'o-menu': true, |
9 | } | 9 | } |
10 | if (attributes.class) { | ||
11 | classes[attributes.class] = true; | ||
12 | } | ||
10 | 13 | ||
11 | div(class=classes)&attributes(attributes) | 14 | div(class=classes)&attributes(attributes) |
12 | block | 15 | block |
@@ -17,6 +20,9 @@ mixin menu-item | |||
17 | 'o-menu__item': true, | 20 | 'o-menu__item': true, |
18 | 'is-selected': attributes.selected, | 21 | 'is-selected': attributes.selected, |
19 | } | 22 | } |
23 | if (attributes.class) { | ||
24 | classes[attributes.class] = true; | ||
25 | } | ||
20 | 26 | ||
21 | #{!!attributes.tag ? attributes.tag : 'button'}(class=classes)&attributes(attributes) | 27 | #{!!attributes.tag ? attributes.tag : 'button'}(class=classes)&attributes(attributes) |
22 | .l-card.l-card--flush.l-card--75 | 28 | .l-card.l-card--flush.l-card--75 |
diff --git a/tpl/views/icon-nav.pug b/tpl/views/icon-nav.pug new file mode 100644 index 0000000..e71229d --- /dev/null +++ b/tpl/views/icon-nav.pug | |||
@@ -0,0 +1,17 @@ | |||
1 | mixin view-icon-nav | ||
2 | +view('icon-nav', 'Icon nav') | ||
3 | .c-box | ||
4 | +icon-nav | ||
5 | +icon-nav-item('hash') | ||
6 | +icon-nav-item('bookmark')(selected=true) | ||
7 | +icon-nav-item('tags') | ||
8 | +icon-nav-item('cog')(class='u-ml-auto') | ||
9 | +icon-nav-item('logout') | ||
10 | |||
11 | .c-box | ||
12 | +icon-nav(vertical=true style={ height: '20em' }) | ||
13 | +icon-nav-item('hash') | ||
14 | +icon-nav-item('bookmark')(selected=true) | ||
15 | +icon-nav-item('tags') | ||
16 | +icon-nav-item('cog')(class='u-mt-auto') | ||
17 | +icon-nav-item('logout') | ||