summaryrefslogtreecommitdiffstats
path: root/tpl/objects/menu.pug
blob: 97a571dfe3957318624e02940be8aa70f68d511b (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
include icon.pug
include status-indicator.pug
include action-button.pug

mixin menu
    .o-menu
        block

mixin menu-item
    -
        let classes = {
            'o-menu__item': true,
            'is-selected':  attributes.selected,
        }

    button(class=classes, disabled=attributes.disabled)
        .l-card.l-card--flush
            if attributes.icon
                .l-card__block.o-menu__icon-slot
                    if attributes.iconIsStatus
                        +status-indicator(attributes.icon)(class='o-menu__icon')
                    else
                        +icon(attributes.icon)(class='o-menu__icon')
            .l-card__block.l-card__block--main&attributes({ class: attributes.contentClass })
                block
            if attributes.postIcon
                .l-card__block.o-menu__icon-slot
                    +icon(attributes.postIcon)(class='o-menu__icon')

mixin menu-header
    header.o-menu__header
        block

mixin menu-separator
    .o-menu__separator