diff options
author | Volpeon <git@volpeon.ink> | 2022-03-28 20:25:21 +0200 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2022-03-28 20:25:21 +0200 |
commit | 511a47c8964c43927563ee88b62b3f215bf9b7d1 (patch) | |
tree | 108bbc0139ede490a2038a2f6c96467f62666346 /tpl/objects/dialog.pug | |
parent | Improved bubble (diff) | |
download | iro-design-511a47c8964c43927563ee88b62b3f215bf9b7d1.tar.gz iro-design-511a47c8964c43927563ee88b62b3f215bf9b7d1.tar.bz2 iro-design-511a47c8964c43927563ee88b62b3f215bf9b7d1.zip |
Update
Diffstat (limited to 'tpl/objects/dialog.pug')
-rw-r--r-- | tpl/objects/dialog.pug | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/tpl/objects/dialog.pug b/tpl/objects/dialog.pug index 2474cc3..91b99d9 100644 --- a/tpl/objects/dialog.pug +++ b/tpl/objects/dialog.pug | |||
@@ -1,6 +1,4 @@ | |||
1 | include heading.pug | 1 | include heading.pug |
2 | include header.pug | ||
3 | include sidebar.pug | ||
4 | 2 | ||
5 | mixin dialog(title) | 3 | mixin dialog(title) |
6 | - const slots = {} | 4 | - const slots = {} |
@@ -12,9 +10,23 @@ mixin dialog(title) | |||
12 | block ? block() : undefined | 10 | block ? block() : undefined |
13 | 11 | ||
14 | let classes = { | 12 | let classes = { |
15 | 'o-dialog': true, | 13 | 'o-dialog': true, |
14 | 'o-dialog--flat': attributes.flat, | ||
16 | } | 15 | } |
17 | 16 | ||
17 | let headerClass = { | ||
18 | 'o-dialog__header': true, | ||
19 | 'u-themed': !attributes.flat, | ||
20 | 't-lowered': !attributes.flat, | ||
21 | 'l-card': true, | ||
22 | } | ||
23 | |||
24 | let sidebarHeaderClass = { | ||
25 | 'o-dialog__header--sidebar': true, | ||
26 | } | ||
27 | |||
28 | Object.assign(sidebarHeaderClass, headerClass); | ||
29 | |||
18 | let bodyClass = { | 30 | let bodyClass = { |
19 | 'o-dialog__body': true | 31 | 'o-dialog__body': true |
20 | } | 32 | } |
@@ -23,21 +35,24 @@ mixin dialog(title) | |||
23 | } | 35 | } |
24 | 36 | ||
25 | div(class=classes) | 37 | div(class=classes) |
26 | if slots['sidebar-header'] | 38 | if slots['sidebar-header'] || attributes.sidebarTitle |
27 | +header(class='o-dialog__sidebar-header') | 39 | div(class=sidebarHeaderClass) |
28 | - slots['sidebar-header']() | 40 | if slots['sidebar-header'] |
41 | - slots['sidebar-header']() | ||
42 | else | ||
43 | +div-heading('sm')(class='o-dialog__title l-card__block l-card__block--main')= attributes.sidebarTitle | ||
29 | 44 | ||
30 | if slots.sidebar | 45 | if slots.sidebar |
31 | +sidebar(class='o-dialog__sidebar') | 46 | .o-dialog__sidebar.l-overflow |
32 | - slots.sidebar() | 47 | - slots.sidebar() |
33 | 48 | ||
34 | +header(class='o-dialog__header') | 49 | div(class=headerClass) |
35 | if slots.header | 50 | if slots.header |
36 | - slots.header() | 51 | - slots.header() |
37 | else | 52 | else |
38 | if title | 53 | if title |
39 | +div-heading('sm')(class='o-dialog__label')= title | 54 | +div-heading('sm')(class='o-dialog__title l-card__block l-card__block--main')= title |
40 | +action-button(round=true quiet=true icon='x' class='o-dialog__close-btn') | 55 | +action-button(round=true quiet=true icon='x' class='o-dialog__close-btn l-card__block') |
41 | 56 | ||
42 | section(class=bodyClass) | 57 | section(class=bodyClass) |
43 | if slots.body | 58 | if slots.body |