diff options
author | Volpeon <git@volpeon.ink> | 2023-01-28 09:34:19 +0100 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2023-01-28 09:34:19 +0100 |
commit | ac04c0bb55f51dd18daaf6813c47a0db8525180f (patch) | |
tree | 0905dce4274c39562b630fe73268b5eba8f101ff /tpl | |
parent | Lightbox (diff) | |
download | iro-design-ac04c0bb55f51dd18daaf6813c47a0db8525180f.tar.gz iro-design-ac04c0bb55f51dd18daaf6813c47a0db8525180f.tar.bz2 iro-design-ac04c0bb55f51dd18daaf6813c47a0db8525180f.zip |
Added overflow button
Diffstat (limited to 'tpl')
-rw-r--r-- | tpl/index.pug | 3 | ||||
-rw-r--r-- | tpl/objects/action-button.pug | 4 | ||||
-rw-r--r-- | tpl/objects/overflow-button.pug | 22 | ||||
-rw-r--r-- | tpl/views/overflow-button.pug | 10 |
4 files changed, 36 insertions, 3 deletions
diff --git a/tpl/index.pug b/tpl/index.pug index 1f4f522..15929cf 100644 --- a/tpl/index.pug +++ b/tpl/index.pug | |||
@@ -17,6 +17,7 @@ include objects/checkbox.pug | |||
17 | include objects/switch.pug | 17 | include objects/switch.pug |
18 | include objects/form.pug | 18 | include objects/form.pug |
19 | include objects/action-button.pug | 19 | include objects/action-button.pug |
20 | include objects/overflow-button.pug | ||
20 | include objects/status-indicator.pug | 21 | include objects/status-indicator.pug |
21 | include objects/avatar.pug | 22 | include objects/avatar.pug |
22 | include objects/action-menu.pug | 23 | include objects/action-menu.pug |
@@ -65,6 +66,7 @@ include views/checkbox.pug | |||
65 | include views/switch.pug | 66 | include views/switch.pug |
66 | include views/form.pug | 67 | include views/form.pug |
67 | include views/action-button.pug | 68 | include views/action-button.pug |
69 | include views/overflow-button.pug | ||
68 | include views/status-indicator.pug | 70 | include views/status-indicator.pug |
69 | include views/avatar.pug | 71 | include views/avatar.pug |
70 | include views/action-menu.pug | 72 | include views/action-menu.pug |
@@ -108,6 +110,7 @@ html | |||
108 | +view-switch | 110 | +view-switch |
109 | +view-form | 111 | +view-form |
110 | +view-action-button | 112 | +view-action-button |
113 | +view-overflow-button | ||
111 | +view-status-indicator | 114 | +view-status-indicator |
112 | +view-avatar | 115 | +view-avatar |
113 | +view-action-menu | 116 | +view-action-menu |
diff --git a/tpl/objects/action-button.pug b/tpl/objects/action-button.pug index f99d789..e11e4a5 100644 --- a/tpl/objects/action-button.pug +++ b/tpl/objects/action-button.pug | |||
@@ -19,6 +19,4 @@ mixin action-button | |||
19 | if attributes.icon | 19 | if attributes.icon |
20 | +icon(attributes.icon)(block=!block) | 20 | +icon(attributes.icon)(block=!block) |
21 | = ' ' | 21 | = ' ' |
22 | if block | 22 | block |
23 | span.o-action-button__label | ||
24 | block | ||
diff --git a/tpl/objects/overflow-button.pug b/tpl/objects/overflow-button.pug new file mode 100644 index 0000000..f52f12b --- /dev/null +++ b/tpl/objects/overflow-button.pug | |||
@@ -0,0 +1,22 @@ | |||
1 | include icon.pug | ||
2 | |||
3 | mixin overflow-button | ||
4 | - | ||
5 | let classes = { | ||
6 | 'o-overflow-button': true, | ||
7 | 'u-d-block': attributes.block, | ||
8 | 'is-selected': attributes.selected | ||
9 | } | ||
10 | if (attributes.class) { | ||
11 | classes[attributes.class] = true; | ||
12 | } | ||
13 | |||
14 | let href = attributes.disabled ? null : '#'; | ||
15 | |||
16 | a(class=classes href=href) | ||
17 | .o-overflow-button__inside | ||
18 | if attributes.icon | ||
19 | +icon(attributes.icon)(block=!block) | ||
20 | = ' ' | ||
21 | .o-overflow-button__outside | ||
22 | block | ||
diff --git a/tpl/views/overflow-button.pug b/tpl/views/overflow-button.pug new file mode 100644 index 0000000..112aaab --- /dev/null +++ b/tpl/views/overflow-button.pug | |||
@@ -0,0 +1,10 @@ | |||
1 | mixin view-overflow-button | ||
2 | +view('overflow-button', 'Overflow button') | ||
3 | .c-box | ||
4 | +overflow-button(icon='trash')= '123' | ||
5 | = ' ' | ||
6 | +overflow-button(icon='trash' selected=true)= 'Delete' | ||
7 | = ' ' | ||
8 | +overflow-button(icon='trash' disabled=true)= 'Disabled' | ||
9 | = ' ' | ||
10 | +overflow-button(icon='trash' selected=true disabled=true)= 'Selected + disabled' | ||