summaryrefslogtreecommitdiffstats
path: root/tpl/objects/dialog.pug
blob: 12726a38fd562cbbb24d6f20383b39043539c55d (plain) (blame)
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
include rule.pug
include button.pug
include heading.pug
include action-button.pug

mixin dialog(title)
    - const slots = {}

    mixin slot(key)
        - slots[key] = block

    -
        block ? block() : undefined 

        let classes = {
            'o-dialog':        true,
            't-raised':        true,
            'o-dialog--split': !!slots.sidebar,
        }

        let bodyClass = {
            'o-dialog__body': true
        }
        if (attributes.bodyClass) {
            bodyClass[attributes.bodyClass] = true;
        }

    div(class=classes)
        if slots.sidebar
            .o-dialog__sidebar
                - slots.sidebar()
        header.o-dialog__header
            +div-heading('lg')(class='o-dialog__title')
                = title
        +action-button(round=true quiet=true icon='x' class='o-dialog__close-btn')
        section(class=bodyClass)
            if slots.body
                - slots.body()
        footer.o-dialog__footer.l-button-group
            +a-button(outline=true)= 'Cancel'
            = ' '
            +a-button(variant='accent')= 'Continue'