summaryrefslogtreecommitdiffhomepage
path: root/packages/ui/src/components/dialog.css
blob: 979906e262aa310c26ebffbdac03b882b8a65c68 (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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/* [data-component="dialog-trigger"] { } */

[data-component="dialog-overlay"] {
  position: fixed;
  inset: 0;
  z-index: 50;
  background-color: transparent;

  /* animation: overlayHide 250ms ease 100ms forwards; */
  /**/
  /* &[data-expanded] { */
  /*   animation: overlayShow 250ms ease; */
  /* } */
}

[data-component="dialog"] {
  position: fixed;
  inset: 0;
  margin-left: var(--dialog-left-margin);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;

  [data-slot="dialog-container"] {
    position: relative;
    z-index: 50;
    width: min(calc(100vw - 16px), 480px);
    height: min(calc(100vh - 16px), 512px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-items: start;

    [data-slot="dialog-content"] {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      align-self: stretch;
      width: 100%;
      max-height: 100%;
      min-height: 280px;

      /* padding: 8px; */
      /* padding: 8px 8px 0 8px; */
      border: 1px solid var(--border-base);
      border-radius: var(--radius-xl);
      background: var(--surface-raised-stronger-non-alpha);
      box-shadow:
        0 15px 45px 0 rgba(19, 16, 16, 0.22),
        0 3.35px 10.051px 0 rgba(19, 16, 16, 0.13),
        0 0.998px 2.993px 0 rgba(19, 16, 16, 0.09);

      /* animation: contentHide 300ms ease-in forwards; */
      /**/
      /* &[data-expanded] { */
      /*   animation: contentShow 300ms ease-out; */
      /* } */

      [data-slot="dialog-header"] {
        display: flex;
        /* height: 40px; */
        /* padding: 4px 4px 4px 8px; */
        padding: 20px;
        justify-content: space-between;
        align-items: center;
        flex-shrink: 0;
        align-self: stretch;

        [data-slot="dialog-title"] {
          color: var(--text-strong);

          /* text-16-medium */
          font-family: var(--font-family-sans);
          font-size: var(--font-size-large);
          font-style: normal;
          font-weight: var(--font-weight-medium);
          line-height: var(--line-height-x-large); /* 150% */
          letter-spacing: var(--letter-spacing-tight);
        }
        /* [data-slot="dialog-close-button"] {} */
      }
      /* [data-slot="dialog-description"] {} */
      [data-slot="dialog-body"] {
        width: 100%;
        position: relative;
        display: flex;
        flex-direction: column;
        flex: 1;
        overflow-y: auto;

        &:focus-visible {
          outline: none;
        }
      }
      &:focus-visible {
        outline: none;
      }
    }

    &:focus-visible {
      outline: none;
    }
  }
}

@keyframes overlayShow {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes overlayHide {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
@keyframes contentShow {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes contentHide {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.96);
  }
}