aboutsummaryrefslogtreecommitdiff
path: root/src/components/dialog_modal/dialog_modal.vue
blob: 341cf1054b2d8efb55d502f6e5c34d2129360c0b (plain)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<template>
  <span
    :class="{ 'dark-overlay': darkOverlay }"
    @click.self.stop="onCancel()"
  >
    <div
      class="dialog-modal panel panel-default"
      @click.stop=""
    >
      <div class="panel-heading dialog-modal-heading">
        <div class="title">
          <slot name="header" />
        </div>
      </div>
      <div class="dialog-modal-content">
        <slot name="default" />
      </div>
      <div class="dialog-modal-footer user-interactions panel-footer">
        <slot name="footer" />
      </div>
    </div>
  </span>
</template>

<script src="./dialog_modal.js"></script>

<style lang="scss">
@import "../../variables";

// TODO: unify with other modals.
.dark-overlay {
  &::before {
    bottom: 0;
    content: " ";
    display: block;
    cursor: default;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    background: rgb(27 31 35 / 50%);
    z-index: 2000;
  }
}

.dialog-modal.panel {
  top: 0;
  left: 50%;
  max-height: 80vh;
  max-width: 90vw;
  margin: 15vh auto;
  position: fixed;
  transform: translateX(-50%);
  z-index: 2001;
  cursor: default;
  display: block;
  background-color: $fallback--bg;
  background-color: var(--bg, $fallback--bg);

  .dialog-modal-heading {
    .title {
      text-align: center;
    }
  }

  .dialog-modal-content {
    margin: 0;
    padding: 1rem;
    background-color: $fallback--bg;
    background-color: var(--bg, $fallback--bg);
    white-space: normal;
  }

  .dialog-modal-footer {
    margin: 0;
    padding: 0.5em;
    background-color: $fallback--bg;
    background-color: var(--bg, $fallback--bg);
    border-top: 1px solid $fallback--border;
    border-top: 1px solid var(--border, $fallback--border);
    display: flex;
    justify-content: flex-end;

    button {
      width: auto;
      margin-left: 0.5rem;
    }
  }
}

</style>