summaryrefslogtreecommitdiffhomepage
path: root/packages/ui/src/components/list.css
blob: 651f5ef971e8503604523368ff032b5103b6fd7c (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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
@property --bottom-fade {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

@keyframes scroll {
  0% {
    --bottom-fade: 20px;
  }
  90% {
    --bottom-fade: 20px;
  }
  100% {
    --bottom-fade: 0;
  }
}

[data-component="list"] {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  padding: 0 12px;

  [data-slot="list-search"] {
    display: flex;
    flex-shrink: 0;
    padding: 8px;
    align-items: center;
    gap: 12px;
    align-self: stretch;
    margin-bottom: 4px;

    border-radius: var(--radius-md);
    background: var(--surface-base);

    [data-slot="list-search-container"] {
      display: flex;
      align-items: center;
      gap: 8px;
      flex: 1 0 0;
      max-height: 20px;

      [data-slot="list-search-input"] {
        width: 100%;

        &[data-slot="input-input"] {
          line-height: 20px;
          max-height: 20px;
        }
      }
    }

    > [data-component="icon-button"] {
      width: 20px;
      height: 20px;
      background-color: transparent;

      &:hover:not(:disabled),
      &:focus:not(:disabled),
      &:active:not(:disabled) {
        background-color: transparent;
      }

      &:hover:not(:disabled) [data-slot="icon-svg"] {
        color: var(--icon-hover);
      }

      &:active:not(:disabled) [data-slot="icon-svg"] {
        color: var(--icon-active);
      }
    }
  }

  [data-slot="list-scroll"] {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
    mask: linear-gradient(to bottom, #ffff calc(100% - var(--bottom-fade)), #0000);
    animation: scroll;
    animation-timeline: --scroll;
    scroll-timeline: --scroll y;
    scrollbar-width: none;
    -ms-overflow-style: none;
    &::-webkit-scrollbar {
      display: none;
    }

    [data-slot="list-empty-state"] {
      display: flex;
      padding: 32px 0px;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      gap: 8px;
      align-self: stretch;

      [data-slot="list-message"] {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 2px;
        color: var(--text-weak);
        text-align: center;

        /* text-14-regular */
        font-family: var(--font-family-sans);
        font-size: 14px;
        font-style: normal;
        font-weight: var(--font-weight-regular);
        line-height: var(--line-height-large); /* 142.857% */
        letter-spacing: var(--letter-spacing-normal);
      }

      [data-slot="list-filter"] {
        color: var(--text-strong);
      }
    }

    [data-slot="list-group"] {
      position: relative;
      display: flex;
      flex-direction: column;

      [data-slot="list-header"] {
        display: flex;
        z-index: 10;
        padding: 0 12px 8px 8px;
        justify-content: space-between;
        align-items: center;
        align-self: stretch;
        background: var(--surface-raised-stronger-non-alpha);
        position: sticky;
        top: 0;

        color: var(--text-base);

        /* text-14-medium */
        font-family: var(--font-family-sans);
        font-size: 14px;
        font-style: normal;
        font-weight: var(--font-weight-medium);
        line-height: var(--line-height-large); /* 142.857% */
        letter-spacing: var(--letter-spacing-normal);

        &::after {
          content: "";
          position: absolute;
          top: 100%;
          left: 0;
          right: 0;
          height: 16px;
          background: linear-gradient(to bottom, var(--surface-raised-stronger-non-alpha), transparent);
          pointer-events: none;
          opacity: 0;
          transition: opacity 0.15s ease;
        }

        &[data-stuck="true"]::after {
          opacity: 1;
        }
      }

      [data-slot="list-items"] {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        align-self: stretch;

        [data-slot="list-item"] {
          display: flex;
          width: 100%;
          padding: 6px 8px 6px 8px;
          align-items: center;
          color: var(--text-strong);
          scroll-margin-top: 28px;

          /* text-14-medium */
          font-family: var(--font-family-sans);
          font-size: 14px;
          font-style: normal;
          font-weight: var(--font-weight-medium);
          line-height: var(--line-height-large); /* 142.857% */
          letter-spacing: var(--letter-spacing-normal);

          [data-slot="list-item-selected-icon"] {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            aspect-ratio: 1/1;
            [data-component="icon"] {
              color: var(--icon-strong-base);
            }
          }
          [data-slot="list-item-active-icon"] {
            display: none;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            aspect-ratio: 1/1;
            [data-component="icon"] {
              color: var(--icon-strong-base);
            }
          }

          [data-slot="list-item-extra-icon"] {
            color: var(--icon-base);
            margin-left: -4px;
          }

          &[data-active="true"] {
            border-radius: var(--radius-md);
            background: var(--surface-raised-base-hover);
            [data-slot="list-item-active-icon"] {
              display: inline-flex;
            }
            [data-slot="list-item-extra-icon"] {
              display: block !important;
              color: var(--icon-strong-base) !important;
            }
          }
          &:active {
            background: var(--surface-raised-base-active);
          }
          &:focus-visible {
            outline: none;
          }
        }
      }
    }
  }
}