@gitlab/duo-ui 8.11.0 → 8.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,416 @@
1
+ $duo-chat-scrim-gradient: linear-gradient(to bottom, rgba($gray-10, 0), $gray-10);
2
+ $drawer-width: 400px;
3
+
4
+ .resizable-content {
5
+ height: 100%;
6
+ width: 100%;
7
+ background: var(--gl-background-color-default);
8
+ border-radius: $gl-border-radius-large;
9
+ @apply gl-overflow-y-auto;
10
+ @apply gl-shadow-lg;
11
+ @apply gl-text-base;
12
+ @apply gl-leading-normal;
13
+ @apply gl-flex;
14
+ @apply gl-flex-col;
15
+ }
16
+
17
+ .resizable-component {
18
+ .resizable-t,
19
+ .resizable-l {
20
+ background-color: transparent;
21
+ border-radius: 3px;
22
+ @include gl-prefers-reduced-motion-transition;
23
+ transition: background-color $gl-transition-duration-medium $gl-easing-out-cubic;
24
+
25
+ &:hover {
26
+ background-color: var(--gl-color-blue-200);
27
+ }
28
+ }
29
+
30
+ // important styles because we need
31
+ // to overwrite inline styles set by
32
+ // https://www.npmjs.com/package/vue-resizable
33
+ .resizable-t {
34
+ width: 95% !important;
35
+ transform: translateX(-50%);
36
+ left: 50% !important;
37
+ height: 4px !important;
38
+ top: 2px !important;
39
+ }
40
+
41
+ .resizable-l {
42
+ height: 95% !important;
43
+ transform: translateY(-50%);
44
+ top: 50% !important;
45
+ width: 4px !important;
46
+ left: 2px !important;
47
+ }
48
+ }
49
+
50
+ .duo-chat {
51
+ z-index: 999;
52
+
53
+ .message-enter-active,
54
+ .message-leave-active {
55
+ transition: all 0.5s ease;
56
+ }
57
+
58
+ .message-enter,
59
+ .message-leave-to {
60
+ @apply gl-opacity-0;
61
+ transform: translateY(10px);
62
+ }
63
+
64
+ .duo-chat-loader.message-leave,
65
+ .duo-chat-loader.message-leave-to {
66
+ transition: none;
67
+ }
68
+
69
+ .duo-chat-drawer-body-scrim-on-footer {
70
+ &::before {
71
+ background: $duo-chat-scrim-gradient;
72
+ }
73
+ }
74
+ }
75
+
76
+ .duo-chat-drawer {
77
+ right: 0;
78
+ @apply gl-transition-all;
79
+ position: fixed;
80
+ @apply gl-h-full;
81
+ @apply gl-w-full;
82
+ @apply gl-overflow-y-auto;
83
+ @apply gl-shadow-lg;
84
+ @apply gl-text-base;
85
+ @apply gl-leading-normal;
86
+ @apply gl-flex;
87
+ @apply gl-flex-col;
88
+ }
89
+
90
+ .duo-chat-drawer-footer {
91
+ @apply gl-border-t;
92
+ @apply gl-p-5;
93
+ }
94
+
95
+ .duo-chat-drawer-body-scrim-on-footer {
96
+ &::before {
97
+ background: $duo-chat-scrim-gradient;
98
+ top: 0;
99
+ @apply -gl-translate-y-full;
100
+ content: '';
101
+ left: 0;
102
+ position: absolute;
103
+ @apply gl-pointer-events-none;
104
+ @apply gl-w-full;
105
+ @apply gl-h-5;
106
+ }
107
+ }
108
+
109
+ .duo-chat-history {
110
+ scroll-behavior: smooth;
111
+
112
+ /*
113
+ Browsers a are pretty good at keeping the focus on an element while
114
+ the parent element grows in size. With this we mark all child elements
115
+ of the chat history as "non" anchors.
116
+ https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-anchor
117
+ */
118
+ * {
119
+ overflow-anchor: none;
120
+ }
121
+
122
+ /*
123
+ Right at the bottom of the chat history we add a scroll-anchor element.
124
+ This scroll-anchor element is the only "possible" anchor. The beauty of it:
125
+ It only will be used as an anchor _if_ it is currently inside the view port.
126
+ So if the user manually scrolls up while a chunked message is coming in,
127
+ it won't stick to the bottom while the message still loads.
128
+ */
129
+ .scroll-anchor {
130
+ overflow-anchor: auto;
131
+ height: 1px;
132
+ margin-top: -1px; // In order to not add 1px vertically, we add a negative margin
133
+ }
134
+ }
135
+
136
+ .duo-chat-input {
137
+ @apply gl-flex;
138
+ @apply gl-flex-col;
139
+ max-height: 240px;
140
+ overflow: hidden;
141
+ background: var(--gl-control-background-color-default);
142
+ box-shadow: inset 0 0 0 $gl-border-size-1 var(--gl-control-border-color-default);
143
+ border-radius: px-to-rem(20px);
144
+
145
+ &:focus-within {
146
+ @include gl-focus($color: var(--gl-control-border-color-focus));
147
+ }
148
+
149
+ .gl-form-textarea.form-control {
150
+ flex: 1;
151
+ resize: none;
152
+ max-height: 240px;
153
+ padding-right: 40px;
154
+ border-radius: px-to-rem(20px);
155
+ }
156
+
157
+ &::after {
158
+ content: attr(data-value) ' ';
159
+ @apply gl-invisible;
160
+ @apply gl-p-4;
161
+ @apply gl-font-regular;
162
+ padding-right: 40px;
163
+ word-break: break-word;
164
+ }
165
+ }
166
+
167
+ .duo-chat .duo-chat-suggestion-button {
168
+ border-radius: px-to-rem(20px);
169
+ }
170
+
171
+ .slash-commands {
172
+ @apply -gl-mt-2;
173
+
174
+ .active-command {
175
+ @apply gl-bg-strong;
176
+ @apply gl-rounded-base;
177
+ }
178
+
179
+ .gl-dropdown-item button.dropdown-item {
180
+ @apply gl-text-sm;
181
+ @apply gl-px-3;
182
+ @apply gl-bg-transparent;
183
+
184
+ &:hover {
185
+ @apply gl-bg-transparent;
186
+ }
187
+ }
188
+ }
189
+ // TODO this is techdebt from: https://gitlab.com/gitlab-org/gitlab-ui/-/merge_requests/3953#note_1762834219
190
+ // once this file is migrated to Duo-UI we need to remove these styles as a markdown fallback
191
+ // and make sure all host-system provide markdown renderer
192
+ .duo-chat-markdown {
193
+ @apply gl-text-lg;
194
+ @apply gl-leading-24;
195
+ color: $gl-text-color;
196
+ @apply gl-font-regular;
197
+ @apply gl-font-normal;
198
+
199
+ :first-child {
200
+ @apply gl-mt-0;
201
+ }
202
+
203
+ h1,
204
+ .gl-h1 {
205
+ @apply gl-heading-1;
206
+ @apply gl-mt-7;
207
+ }
208
+
209
+ h2,
210
+ .gl-h2 {
211
+ @apply gl-heading-2;
212
+ @apply gl-mt-6;
213
+ }
214
+
215
+ h3,
216
+ .gl-h3 {
217
+ @apply gl-heading-3;
218
+ @apply gl-mt-6;
219
+ }
220
+
221
+ h4,
222
+ .gl-h4 {
223
+ @apply gl-heading-4;
224
+ @apply gl-mt-5;
225
+ }
226
+
227
+ h5,
228
+ .gl-h5 {
229
+ @apply gl-heading-5;
230
+ @apply gl-mt-5;
231
+ }
232
+
233
+ h6,
234
+ .gl-h6 {
235
+ @apply gl-heading-6;
236
+ @apply gl-mt-5;
237
+ }
238
+
239
+ p,
240
+ .gl-paragraph {
241
+ @apply gl-mt-0;
242
+ @apply gl-mb-0;
243
+
244
+ + p,
245
+ + .gl-paragraph {
246
+ @apply gl-mt-5;
247
+ }
248
+
249
+ &.sm {
250
+ font-size: $gl-font-size-markdown-sm;
251
+ @apply gl-leading-20;
252
+ }
253
+ }
254
+
255
+ .sm {
256
+ font-size: $gl-font-size-markdown-sm;
257
+ @apply gl-leading-20;
258
+ }
259
+
260
+ .monospace,
261
+ code {
262
+ @apply gl-font-monospace;
263
+ }
264
+
265
+ blockquote {
266
+ @apply gl-text-gray-700;
267
+ @apply gl-py-3;
268
+ @apply gl-pl-6;
269
+ @apply gl-my-3;
270
+ @apply gl-mx-0;
271
+ box-shadow: inset $gl-border-size-4 0 0 0 $gray-100;
272
+ }
273
+
274
+ .idiff {
275
+ @apply gl-rounded-base;
276
+ @apply gl-inline-flex;
277
+ @apply gl-px-2;
278
+ }
279
+
280
+ .deletion {
281
+ @apply gl-bg-red-100;
282
+ }
283
+
284
+ .addition {
285
+ @apply gl-bg-green-100;
286
+ }
287
+
288
+ code {
289
+ @apply gl-rounded-base;
290
+ @apply gl-bg-gray-50;
291
+ @apply gl-text-gray-950;
292
+ @apply gl-px-2;
293
+ @apply gl-py-1;
294
+ }
295
+
296
+ pre {
297
+ @apply gl-rounded-base;
298
+ @apply gl-py-3;
299
+ @apply gl-px-4;
300
+ box-shadow: inset 0 0 0 $gl-border-size-1 $gray-100;
301
+ @apply gl-my-7;
302
+ @apply gl-overflow-auto;
303
+
304
+ code {
305
+ @apply gl-bg-white;
306
+ @apply gl-rounded-none;
307
+ @apply gl-text-gray-900;
308
+ @apply gl-p-0;
309
+ }
310
+ }
311
+
312
+ .audio-container {
313
+ @apply gl-inline-flex;
314
+ @apply gl-flex-col;
315
+ @apply gl-w-full;
316
+
317
+ audio {
318
+ @apply gl-w-full;
319
+ }
320
+
321
+ a {
322
+ @apply gl-mt-3;
323
+
324
+ &::before {
325
+ @apply gl-mr-2;
326
+ text-rendering: auto;
327
+ -webkit-font-smoothing: antialiased;
328
+ content: '📎';
329
+ }
330
+ }
331
+ }
332
+
333
+ table {
334
+ @apply gl-my-7;
335
+
336
+ th,
337
+ td {
338
+ @apply gl-px-3;
339
+ @apply gl-py-4;
340
+ box-shadow: inset 0 -#{$gl-border-size-1} 0 0 $gray-100;
341
+ @apply gl-align-top;
342
+ }
343
+
344
+ th {
345
+ box-shadow:
346
+ inset 0 #{$gl-border-size-1} 0 0 $gray-100,
347
+ inset 0 -#{$gl-border-size-1} 0 0 $gray-100;
348
+ @apply gl-font-bold;
349
+ }
350
+
351
+ thead {
352
+ @apply gl-bg-gray-50;
353
+ }
354
+
355
+ tr:nth-child(even) {
356
+ @apply gl-bg-gray-10;
357
+ }
358
+ }
359
+ }
360
+
361
+ .duo-chat-compact-markdown {
362
+ @apply gl-text-base;
363
+ @apply gl-leading-20;
364
+
365
+ h1,
366
+ .gl-h1 {
367
+ @apply gl-heading-1-fixed;
368
+ @apply gl-mt-7;
369
+ }
370
+
371
+ h2,
372
+ .gl-h2 {
373
+ @apply gl-heading-2-fixed;
374
+ @apply gl-mt-6;
375
+ }
376
+
377
+ h3,
378
+ .gl-h3 {
379
+ @apply gl-heading-3-fixed;
380
+ @apply gl-mt-6;
381
+ }
382
+
383
+ h4,
384
+ .gl-h4 {
385
+ @apply gl-heading-4-fixed;
386
+ @apply gl-mt-5;
387
+ }
388
+
389
+ h5,
390
+ .gl-h5 {
391
+ @apply gl-heading-5-fixed;
392
+ @apply gl-mt-5;
393
+ }
394
+
395
+ h6,
396
+ .gl-h6 {
397
+ @apply gl-heading-6-fixed;
398
+ @apply gl-mt-5;
399
+ }
400
+
401
+ .sm {
402
+ @apply gl-text-sm;
403
+ }
404
+
405
+ .monospace,
406
+ code {
407
+ @apply gl-font-monospace;
408
+ }
409
+
410
+ table {
411
+ th,
412
+ td {
413
+ @apply gl-py-3;
414
+ }
415
+ }
416
+ }