@gitlab/ui 80.11.0 → 80.12.0

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.
Files changed (39) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -20
  3. package/dist/components/base/new_dropdowns/base_dropdown/base_dropdown.js +5 -9
  4. package/dist/components/base/new_dropdowns/constants.js +1 -2
  5. package/dist/tailwind.css +1 -1
  6. package/dist/tailwind.css.map +1 -1
  7. package/dist/tokens/build/js/tokens.dark.js +106 -1
  8. package/dist/tokens/build/js/tokens.js +70 -1
  9. package/dist/tokens/css/tokens.css +77 -8
  10. package/dist/tokens/css/tokens.dark.css +111 -6
  11. package/dist/tokens/js/tokens.dark.js +105 -0
  12. package/dist/tokens/js/tokens.js +69 -0
  13. package/dist/tokens/json/tokens.dark.json +4002 -2053
  14. package/dist/tokens/json/tokens.json +1207 -14
  15. package/dist/tokens/scss/_tokens.dark.scss +111 -6
  16. package/dist/tokens/scss/_tokens.scss +77 -8
  17. package/dist/tokens/scss/_tokens_custom_properties.scss +69 -0
  18. package/dist/tokens/tailwind/tokens.cjs +9 -8
  19. package/dist/utils/utils.js +1 -19
  20. package/package.json +1 -1
  21. package/src/components/base/new_dropdowns/base_dropdown/base_dropdown.spec.js +17 -55
  22. package/src/components/base/new_dropdowns/base_dropdown/base_dropdown.vue +4 -16
  23. package/src/components/base/new_dropdowns/constants.js +0 -1
  24. package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.stories.js +0 -28
  25. package/src/tokens/build/css/tokens.css +77 -8
  26. package/src/tokens/build/css/tokens.dark.css +111 -6
  27. package/src/tokens/build/js/tokens.dark.js +105 -0
  28. package/src/tokens/build/js/tokens.js +69 -0
  29. package/src/tokens/build/json/tokens.dark.json +4002 -2053
  30. package/src/tokens/build/json/tokens.json +1207 -14
  31. package/src/tokens/build/scss/_tokens.dark.scss +111 -6
  32. package/src/tokens/build/scss/_tokens.scss +77 -8
  33. package/src/tokens/build/scss/_tokens_custom_properties.scss +69 -0
  34. package/src/tokens/build/tailwind/tokens.cjs +9 -8
  35. package/src/tokens/color.constant.tokens.json +292 -0
  36. package/src/tokens/color.constant.tokens.stories.js +19 -0
  37. package/src/tokens/text.tokens.json +20 -14
  38. package/src/utils/utils.js +0 -18
  39. package/src/utils/utils.spec.js +0 -52
@@ -2,15 +2,43 @@
2
2
  // Automatically generated
3
3
  // Do not edit directly
4
4
 
5
- $gl-text-color-disabled: #89888d !default; // Used for disabled text.
6
- $gl-text-color-link: #63a6e9 !default; // Used for default text links.
7
- $gl-text-color-heading: #fff !default; // Used for headings level 1-6.
8
- $gl-text-color-strong: #fff !default; // Used for text with the highest contrast.
9
- $gl-text-color-subtle: #bfbfc3 !default; // Used for supplemental text that doesn't need to be as prominent as other text.
10
- $gl-text-color-default: #ececef !default; // Used for the default text color.
11
5
  $gl-text-tertiary: #737278 !default; // Use text.color.disabled instead
12
6
  $gl-text-secondary: #89888d !default; // Use text.color.subtle instead
13
7
  $gl-text-primary: #ececef !default; // Use text.color.default instead
8
+ $gl-line-height-52: 3.25rem;
9
+ $gl-line-height-44: 2.75rem;
10
+ $gl-line-height-42: 2.625rem;
11
+ $gl-line-height-36: 2.25rem;
12
+ $gl-line-height-32: 2rem;
13
+ $gl-line-height-28: 1.75rem;
14
+ $gl-line-height-24: 1.5rem;
15
+ $gl-line-height-20: 1.25rem;
16
+ $gl-line-height-16: 1rem;
17
+ $gl-line-height-12: 0.75rem;
18
+ $t-white-a-08: rgba(255, 255, 255, 0.08) !default;
19
+ $t-white-a-06: rgba(255, 255, 255, 0.06) !default;
20
+ $t-white-a-04: rgba(255, 255, 255, 0.04) !default;
21
+ $t-white-a-02: rgba(255, 255, 255, 0.02) !default;
22
+ $t-white-a-36: rgba(255, 255, 255, 0.36) !default;
23
+ $t-white-a-24: rgba(255, 255, 255, 0.24) !default;
24
+ $t-white-a-16: rgba(255, 255, 255, 0.16) !default;
25
+ $t-gray-a-08: rgba(31, 30, 36, 0.08) !default;
26
+ $t-gray-a-06: rgba(31, 30, 36, 0.06) !default;
27
+ $t-gray-a-04: rgba(31, 30, 36, 0.04) !default;
28
+ $t-gray-a-02: rgba(31, 30, 36, 0.02) !default;
29
+ $t-gray-a-24: rgba(31, 30, 36, 0.24) !default;
30
+ $t-gray-a-16: rgba(31, 30, 36, 0.16) !default;
31
+ $brand-gray-05: #2b2838 !default;
32
+ $brand-gray-04: #45424d !default;
33
+ $brand-gray-03: #74717a !default;
34
+ $brand-gray-02: #a2a1a6 !default;
35
+ $brand-gray-01: #d1d0d3 !default;
36
+ $brand-purple-02: #7759c2 !default;
37
+ $brand-purple-01: #a989f5 !default;
38
+ $brand-orange-03: #e24329 !default;
39
+ $brand-orange-02: #fc6d26 !default;
40
+ $brand-orange-01: #fca326 !default;
41
+ $brand-charcoal: #171321 !default;
14
42
  $red-950: #fff4f3 !default;
15
43
  $red-900: #fcf1ef !default;
16
44
  $red-800: #fdd4cd !default;
@@ -207,3 +235,80 @@ $data-viz-green-300: #366800 !default;
207
235
  $data-viz-green-200: #275600 !default;
208
236
  $data-viz-green-100: #1a4500 !default;
209
237
  $data-viz-green-50: #133a03 !default;
238
+ $gl-color-red-950: #4d0a00;
239
+ $gl-color-red-900: #660e00;
240
+ $gl-color-red-800: #8d1300;
241
+ $gl-color-red-700: #ae1800;
242
+ $gl-color-red-600: #c91c00;
243
+ $gl-color-red-500: #dd2b0e;
244
+ $gl-color-red-400: #ec5941;
245
+ $gl-color-red-300: #f57f6c;
246
+ $gl-color-red-200: #fcb5aa;
247
+ $gl-color-red-100: #fdd4cd;
248
+ $gl-color-red-50: #fcf1ef;
249
+ $gl-color-purple-950: #232150;
250
+ $gl-color-purple-900: #2f2a6b;
251
+ $gl-color-purple-800: #453894;
252
+ $gl-color-purple-700: #5943b6;
253
+ $gl-color-purple-600: #694cc0;
254
+ $gl-color-purple-500: #7b58cf;
255
+ $gl-color-purple-400: #9475db;
256
+ $gl-color-purple-300: #ac93e6;
257
+ $gl-color-purple-200: #cbbbf2;
258
+ $gl-color-purple-100: #e1d8f9;
259
+ $gl-color-purple-50: #f4f0ff;
260
+ $gl-color-orange-950: #421f00;
261
+ $gl-color-orange-900: #5c2900;
262
+ $gl-color-orange-800: #703800;
263
+ $gl-color-orange-700: #8f4700;
264
+ $gl-color-orange-600: #9e5400;
265
+ $gl-color-orange-500: #ab6100;
266
+ $gl-color-orange-400: #c17d10;
267
+ $gl-color-orange-300: #d99530;
268
+ $gl-color-orange-200: #e9be74;
269
+ $gl-color-orange-100: #f5d9a8;
270
+ $gl-color-orange-50: #fdf1dd;
271
+ $gl-color-green-950: #072b15;
272
+ $gl-color-green-900: #0a4020;
273
+ $gl-color-green-800: #0d532a;
274
+ $gl-color-green-700: #24663b;
275
+ $gl-color-green-600: #217645;
276
+ $gl-color-green-500: #108548;
277
+ $gl-color-green-400: #2da160;
278
+ $gl-color-green-300: #52b87a;
279
+ $gl-color-green-200: #91d4a8;
280
+ $gl-color-green-100: #c3e6cd;
281
+ $gl-color-green-50: #ecf4ee;
282
+ $gl-color-neutral-1000: #000;
283
+ $gl-color-neutral-950: #1f1e24;
284
+ $gl-color-neutral-900: #333238;
285
+ $gl-color-neutral-800: #434248;
286
+ $gl-color-neutral-700: #535158;
287
+ $gl-color-neutral-600: #626168;
288
+ $gl-color-neutral-500: #737278;
289
+ $gl-color-neutral-400: #89888d;
290
+ $gl-color-neutral-300: #a4a3a8;
291
+ $gl-color-neutral-200: #bfbfc3;
292
+ $gl-color-neutral-100: #dcdcde;
293
+ $gl-color-neutral-50: #ececef;
294
+ $gl-color-neutral-10: #fbfafd;
295
+ $gl-color-neutral-0: #fff;
296
+ $gl-color-blue-950: #002850;
297
+ $gl-color-blue-900: #033464;
298
+ $gl-color-blue-800: #064787;
299
+ $gl-color-blue-700: #0b5cad;
300
+ $gl-color-blue-600: #1068bf;
301
+ $gl-color-blue-500: #1f75cb;
302
+ $gl-color-blue-400: #428fdc;
303
+ $gl-color-blue-300: #63a6e9;
304
+ $gl-color-blue-200: #9dc7f1;
305
+ $gl-color-blue-100: #cbe2f9;
306
+ $gl-color-blue-50: #e9f3fc;
307
+ $gl-text-color-disabled: $gl-color-neutral-400 !default; // Used for disabled text.
308
+ $gl-text-color-success: $gl-color-green-300 !default; // Used for text indicating success or validity.
309
+ $gl-text-color-danger: $gl-color-red-300 !default; // Used for text indicating a problem, critical state, destructive action, error, failure, removal, stop, or declination.
310
+ $gl-text-color-link: $gl-color-blue-300 !default; // Used for default text links.
311
+ $gl-text-color-heading: $gl-color-neutral-0 !default; // Used for headings level 1-6.
312
+ $gl-text-color-strong: $gl-color-neutral-0 !default; // Used for text with the highest contrast.
313
+ $gl-text-color-subtle: $gl-color-neutral-200 !default; // Used for supplemental text that doesn't need to be as prominent as other text.
314
+ $gl-text-color-default: $gl-color-neutral-50 !default; // Used for the default text color.
@@ -2,14 +2,6 @@
2
2
  // Automatically generated
3
3
  // Do not edit directly
4
4
 
5
- $gl-text-color-disabled: #89888d !default; // Used for disabled text.
6
- $gl-text-color-success: #217645 !default; // Used for text indicating success or validity.
7
- $gl-text-color-danger: #c91c00 !default; // Used for text indicating a problem, critical state, destructive action, error, failure, removal, stop, or declination.
8
- $gl-text-color-link: #0b5cad !default; // Used for default text links.
9
- $gl-text-color-heading: #1f1e24 !default; // Used for headings level 1-6.
10
- $gl-text-color-strong: #1f1e24 !default; // Used for text with the highest contrast.
11
- $gl-text-color-subtle: #626168 !default; // Used for supplemental text that doesn't need to be as prominent as other text.
12
- $gl-text-color-default: #434248 !default; // Used for the default text color.
13
5
  $gl-text-tertiary: #89888d !default; // Use text.color.disabled instead
14
6
  $gl-text-secondary: #737278 !default; // Use text.color.subtle instead
15
7
  $gl-text-primary: #333238 !default; // Use text.color.default instead
@@ -243,3 +235,80 @@ $data-viz-green-300: #94c25e !default;
243
235
  $data-viz-green-200: #b0d97b !default;
244
236
  $data-viz-green-100: #c6ed94 !default;
245
237
  $data-viz-green-50: #ddfab7 !default;
238
+ $gl-color-red-950: #4d0a00;
239
+ $gl-color-red-900: #660e00;
240
+ $gl-color-red-800: #8d1300;
241
+ $gl-color-red-700: #ae1800;
242
+ $gl-color-red-600: #c91c00;
243
+ $gl-color-red-500: #dd2b0e;
244
+ $gl-color-red-400: #ec5941;
245
+ $gl-color-red-300: #f57f6c;
246
+ $gl-color-red-200: #fcb5aa;
247
+ $gl-color-red-100: #fdd4cd;
248
+ $gl-color-red-50: #fcf1ef;
249
+ $gl-color-purple-950: #232150;
250
+ $gl-color-purple-900: #2f2a6b;
251
+ $gl-color-purple-800: #453894;
252
+ $gl-color-purple-700: #5943b6;
253
+ $gl-color-purple-600: #694cc0;
254
+ $gl-color-purple-500: #7b58cf;
255
+ $gl-color-purple-400: #9475db;
256
+ $gl-color-purple-300: #ac93e6;
257
+ $gl-color-purple-200: #cbbbf2;
258
+ $gl-color-purple-100: #e1d8f9;
259
+ $gl-color-purple-50: #f4f0ff;
260
+ $gl-color-orange-950: #421f00;
261
+ $gl-color-orange-900: #5c2900;
262
+ $gl-color-orange-800: #703800;
263
+ $gl-color-orange-700: #8f4700;
264
+ $gl-color-orange-600: #9e5400;
265
+ $gl-color-orange-500: #ab6100;
266
+ $gl-color-orange-400: #c17d10;
267
+ $gl-color-orange-300: #d99530;
268
+ $gl-color-orange-200: #e9be74;
269
+ $gl-color-orange-100: #f5d9a8;
270
+ $gl-color-orange-50: #fdf1dd;
271
+ $gl-color-green-950: #072b15;
272
+ $gl-color-green-900: #0a4020;
273
+ $gl-color-green-800: #0d532a;
274
+ $gl-color-green-700: #24663b;
275
+ $gl-color-green-600: #217645;
276
+ $gl-color-green-500: #108548;
277
+ $gl-color-green-400: #2da160;
278
+ $gl-color-green-300: #52b87a;
279
+ $gl-color-green-200: #91d4a8;
280
+ $gl-color-green-100: #c3e6cd;
281
+ $gl-color-green-50: #ecf4ee;
282
+ $gl-color-neutral-1000: #000;
283
+ $gl-color-neutral-950: #1f1e24;
284
+ $gl-color-neutral-900: #333238;
285
+ $gl-color-neutral-800: #434248;
286
+ $gl-color-neutral-700: #535158;
287
+ $gl-color-neutral-600: #626168;
288
+ $gl-color-neutral-500: #737278;
289
+ $gl-color-neutral-400: #89888d;
290
+ $gl-color-neutral-300: #a4a3a8;
291
+ $gl-color-neutral-200: #bfbfc3;
292
+ $gl-color-neutral-100: #dcdcde;
293
+ $gl-color-neutral-50: #ececef;
294
+ $gl-color-neutral-10: #fbfafd;
295
+ $gl-color-neutral-0: #fff;
296
+ $gl-color-blue-950: #002850;
297
+ $gl-color-blue-900: #033464;
298
+ $gl-color-blue-800: #064787;
299
+ $gl-color-blue-700: #0b5cad;
300
+ $gl-color-blue-600: #1068bf;
301
+ $gl-color-blue-500: #1f75cb;
302
+ $gl-color-blue-400: #428fdc;
303
+ $gl-color-blue-300: #63a6e9;
304
+ $gl-color-blue-200: #9dc7f1;
305
+ $gl-color-blue-100: #cbe2f9;
306
+ $gl-color-blue-50: #e9f3fc;
307
+ $gl-text-color-disabled: $gl-color-neutral-400 !default; // Used for disabled text.
308
+ $gl-text-color-success: $gl-color-green-600 !default; // Used for text indicating success or validity.
309
+ $gl-text-color-danger: $gl-color-red-600 !default; // Used for text indicating a problem, critical state, destructive action, error, failure, removal, stop, or declination.
310
+ $gl-text-color-link: $gl-color-blue-700 !default; // Used for default text links.
311
+ $gl-text-color-heading: $gl-color-neutral-950 !default; // Used for headings level 1-6.
312
+ $gl-text-color-strong: $gl-color-neutral-950 !default; // Used for text with the highest contrast.
313
+ $gl-text-color-subtle: $gl-color-neutral-600 !default; // Used for supplemental text that doesn't need to be as prominent as other text.
314
+ $gl-text-color-default: $gl-color-neutral-800 !default; // Used for the default text color.
@@ -3,6 +3,75 @@
3
3
  * Do not edit directly
4
4
  */
5
5
 
6
+ $gl-color-blue-50: var(--gl-color-blue-50);
7
+ $gl-color-blue-100: var(--gl-color-blue-100);
8
+ $gl-color-blue-200: var(--gl-color-blue-200);
9
+ $gl-color-blue-300: var(--gl-color-blue-300);
10
+ $gl-color-blue-400: var(--gl-color-blue-400);
11
+ $gl-color-blue-500: var(--gl-color-blue-500);
12
+ $gl-color-blue-600: var(--gl-color-blue-600);
13
+ $gl-color-blue-700: var(--gl-color-blue-700);
14
+ $gl-color-blue-800: var(--gl-color-blue-800);
15
+ $gl-color-blue-900: var(--gl-color-blue-900);
16
+ $gl-color-blue-950: var(--gl-color-blue-950);
17
+ $gl-color-neutral-0: var(--gl-color-neutral-0);
18
+ $gl-color-neutral-10: var(--gl-color-neutral-10);
19
+ $gl-color-neutral-50: var(--gl-color-neutral-50);
20
+ $gl-color-neutral-100: var(--gl-color-neutral-100);
21
+ $gl-color-neutral-200: var(--gl-color-neutral-200);
22
+ $gl-color-neutral-300: var(--gl-color-neutral-300);
23
+ $gl-color-neutral-400: var(--gl-color-neutral-400);
24
+ $gl-color-neutral-500: var(--gl-color-neutral-500);
25
+ $gl-color-neutral-600: var(--gl-color-neutral-600);
26
+ $gl-color-neutral-700: var(--gl-color-neutral-700);
27
+ $gl-color-neutral-800: var(--gl-color-neutral-800);
28
+ $gl-color-neutral-900: var(--gl-color-neutral-900);
29
+ $gl-color-neutral-950: var(--gl-color-neutral-950);
30
+ $gl-color-neutral-1000: var(--gl-color-neutral-1000);
31
+ $gl-color-green-50: var(--gl-color-green-50);
32
+ $gl-color-green-100: var(--gl-color-green-100);
33
+ $gl-color-green-200: var(--gl-color-green-200);
34
+ $gl-color-green-300: var(--gl-color-green-300);
35
+ $gl-color-green-400: var(--gl-color-green-400);
36
+ $gl-color-green-500: var(--gl-color-green-500);
37
+ $gl-color-green-600: var(--gl-color-green-600);
38
+ $gl-color-green-700: var(--gl-color-green-700);
39
+ $gl-color-green-800: var(--gl-color-green-800);
40
+ $gl-color-green-900: var(--gl-color-green-900);
41
+ $gl-color-green-950: var(--gl-color-green-950);
42
+ $gl-color-orange-50: var(--gl-color-orange-50);
43
+ $gl-color-orange-100: var(--gl-color-orange-100);
44
+ $gl-color-orange-200: var(--gl-color-orange-200);
45
+ $gl-color-orange-300: var(--gl-color-orange-300);
46
+ $gl-color-orange-400: var(--gl-color-orange-400);
47
+ $gl-color-orange-500: var(--gl-color-orange-500);
48
+ $gl-color-orange-600: var(--gl-color-orange-600);
49
+ $gl-color-orange-700: var(--gl-color-orange-700);
50
+ $gl-color-orange-800: var(--gl-color-orange-800);
51
+ $gl-color-orange-900: var(--gl-color-orange-900);
52
+ $gl-color-orange-950: var(--gl-color-orange-950);
53
+ $gl-color-purple-50: var(--gl-color-purple-50);
54
+ $gl-color-purple-100: var(--gl-color-purple-100);
55
+ $gl-color-purple-200: var(--gl-color-purple-200);
56
+ $gl-color-purple-300: var(--gl-color-purple-300);
57
+ $gl-color-purple-400: var(--gl-color-purple-400);
58
+ $gl-color-purple-500: var(--gl-color-purple-500);
59
+ $gl-color-purple-600: var(--gl-color-purple-600);
60
+ $gl-color-purple-700: var(--gl-color-purple-700);
61
+ $gl-color-purple-800: var(--gl-color-purple-800);
62
+ $gl-color-purple-900: var(--gl-color-purple-900);
63
+ $gl-color-purple-950: var(--gl-color-purple-950);
64
+ $gl-color-red-50: var(--gl-color-red-50);
65
+ $gl-color-red-100: var(--gl-color-red-100);
66
+ $gl-color-red-200: var(--gl-color-red-200);
67
+ $gl-color-red-300: var(--gl-color-red-300);
68
+ $gl-color-red-400: var(--gl-color-red-400);
69
+ $gl-color-red-500: var(--gl-color-red-500);
70
+ $gl-color-red-600: var(--gl-color-red-600);
71
+ $gl-color-red-700: var(--gl-color-red-700);
72
+ $gl-color-red-800: var(--gl-color-red-800);
73
+ $gl-color-red-900: var(--gl-color-red-900);
74
+ $gl-color-red-950: var(--gl-color-red-950);
6
75
  $data-viz-green-50: var(--data-viz-green-50);
7
76
  $data-viz-green-100: var(--data-viz-green-100);
8
77
  $data-viz-green-200: var(--data-viz-green-200);
@@ -204,14 +204,15 @@ const dataVizColors = {
204
204
  'data-viz-orange-950': 'var(--data-viz-orange-950, #4b2707)',
205
205
  };
206
206
  const textColors = {
207
- default: 'var(--gl-text-color-default, #434248)',
208
- subtle: 'var(--gl-text-color-subtle, #626168)',
209
- strong: 'var(--gl-text-color-strong, #1f1e24)',
210
- heading: 'var(--gl-text-color-heading, #1f1e24)',
211
- link: 'var(--gl-text-color-link, #0b5cad)',
212
- danger: 'var(--gl-text-color-danger, #c91c00)',
213
- success: 'var(--gl-text-color-success, #217645)',
214
- disabled: 'var(--gl-text-color-disabled, #89888d)',
207
+ default: 'var(--gl-text-color-default, var(--gl-color-neutral-800, #434248))',
208
+ subtle: 'var(--gl-text-color-subtle, var(--gl-color-neutral-600, #626168))',
209
+ strong: 'var(--gl-text-color-strong, var(--gl-color-neutral-950, #1f1e24))',
210
+ heading: 'var(--gl-text-color-heading, var(--gl-color-neutral-950, #1f1e24))',
211
+ link: 'var(--gl-text-color-link, var(--gl-color-blue-700, #0b5cad))',
212
+ danger: 'var(--gl-text-color-danger, var(--gl-color-red-600, #c91c00))',
213
+ success: 'var(--gl-text-color-success, var(--gl-color-green-600, #217645))',
214
+ disabled:
215
+ 'var(--gl-text-color-disabled, var(--gl-color-neutral-400, #89888d))',
215
216
  };
216
217
 
217
218
  const colors = {
@@ -194,22 +194,4 @@ function filterVisible(els) {
194
194
  return (els || []).filter(el => isVisible(el));
195
195
  }
196
196
 
197
- /**
198
- * Given an element, returns a Rect object
199
- * with top and bottom boundaries removed.
200
- */
201
- function getHorizontalBoundingClientRect(el) {
202
- const rect = el === null || el === void 0 ? void 0 : el.getBoundingClientRect();
203
- if (rect) {
204
- return {
205
- x: rect.x,
206
- width: rect.width,
207
- y: 0,
208
- // top of the document
209
- height: document.documentElement.clientHeight // bottom of the document
210
- };
211
- }
212
- return null;
213
- }
214
-
215
- export { colorFromBackground, debounceByAnimationFrame, filterVisible, focusFirstFocusableElement, getColorContrast, getHorizontalBoundingClientRect, hexToRgba, isDev, isElementFocusable, isElementTabbable, logWarning, relativeLuminance, rgbFromHex, rgbFromString, stopEvent, throttle, toSrgb, uid };
197
+ export { colorFromBackground, debounceByAnimationFrame, filterVisible, focusFirstFocusableElement, getColorContrast, hexToRgba, isDev, isElementFocusable, isElementTabbable, logWarning, relativeLuminance, rgbFromHex, rgbFromString, stopEvent, throttle, toSrgb, uid };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "80.11.0",
3
+ "version": "80.12.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -100,36 +100,6 @@ describe('base dropdown', () => {
100
100
  autoUpdate.mockImplementation(jest.requireActual('@floating-ui/dom').autoUpdate);
101
101
  });
102
102
 
103
- it('initializes Floating UI with a default boundary', async () => {
104
- document.body.innerHTML = '<main><div></div></main>';
105
-
106
- buildWrapper(undefined, {
107
- attachTo: document.querySelector('main div'),
108
- });
109
- await findDefaultDropdownToggle().trigger('click');
110
-
111
- expect(computePosition).toHaveBeenCalledWith(
112
- findDefaultDropdownToggle().element,
113
- findDropdownMenu().element,
114
- {
115
- placement: 'bottom-start',
116
- strategy: 'absolute',
117
- middleware: [
118
- offset({ mainAxis: DEFAULT_OFFSET }),
119
- autoPlacement(expect.any(Function)),
120
- shift(),
121
- ],
122
- }
123
- );
124
- expect(autoPlacement.mock.calls[0][0]()).toEqual({
125
- alignment: 'start',
126
- boundary: { x: 0, y: 0, width: 0, height: 0 },
127
- allowedPlacements: ['bottom-start', 'top-start', 'bottom-end', 'top-end'],
128
- });
129
-
130
- document.body.innerHTML = '';
131
- });
132
-
133
103
  it('initializes Floating UI with reference and floating elements and config for left-aligned menu', async () => {
134
104
  buildWrapper();
135
105
  await findDefaultDropdownToggle().trigger('click');
@@ -142,16 +112,14 @@ describe('base dropdown', () => {
142
112
  strategy: 'absolute',
143
113
  middleware: [
144
114
  offset({ mainAxis: DEFAULT_OFFSET }),
145
- autoPlacement(expect.any(Function)),
115
+ autoPlacement({
116
+ alignment: 'start',
117
+ allowedPlacements: ['bottom-start', 'top-start', 'bottom-end', 'top-end'],
118
+ }),
146
119
  shift(),
147
120
  ],
148
121
  }
149
122
  );
150
- expect(autoPlacement.mock.calls[0][0]()).toEqual({
151
- alignment: 'start',
152
- boundary: 'clippingAncestors',
153
- allowedPlacements: ['bottom-start', 'top-start', 'bottom-end', 'top-end'],
154
- });
155
123
  });
156
124
 
157
125
  it('initializes Floating UI with reference and floating elements and config for center-aligned menu', async () => {
@@ -166,16 +134,14 @@ describe('base dropdown', () => {
166
134
  strategy: 'absolute',
167
135
  middleware: [
168
136
  offset({ mainAxis: DEFAULT_OFFSET }),
169
- autoPlacement(expect.any(Function)),
137
+ autoPlacement({
138
+ alignment: undefined,
139
+ allowedPlacements: ['bottom', 'top'],
140
+ }),
170
141
  shift(),
171
142
  ],
172
143
  }
173
144
  );
174
- expect(autoPlacement.mock.calls[0][0]()).toEqual({
175
- alignment: undefined,
176
- boundary: 'clippingAncestors',
177
- allowedPlacements: ['bottom', 'top'],
178
- });
179
145
  });
180
146
 
181
147
  it('initializes Floating UI with reference and floating elements and config for right-aligned menu', async () => {
@@ -190,16 +156,14 @@ describe('base dropdown', () => {
190
156
  strategy: 'absolute',
191
157
  middleware: [
192
158
  offset({ mainAxis: DEFAULT_OFFSET }),
193
- autoPlacement(expect.any(Function)),
159
+ autoPlacement({
160
+ alignment: 'end',
161
+ allowedPlacements: ['bottom-start', 'top-start', 'bottom-end', 'top-end'],
162
+ }),
194
163
  shift(),
195
164
  ],
196
165
  }
197
166
  );
198
- expect(autoPlacement.mock.calls[0][0]()).toEqual({
199
- alignment: 'end',
200
- boundary: 'clippingAncestors',
201
- allowedPlacements: ['bottom-start', 'top-start', 'bottom-end', 'top-end'],
202
- });
203
167
  });
204
168
 
205
169
  it('initializes Floating UI with reference and floating elements and config for `right-start` aligned menu', async () => {
@@ -214,16 +178,14 @@ describe('base dropdown', () => {
214
178
  strategy: 'absolute',
215
179
  middleware: [
216
180
  offset({ mainAxis: DEFAULT_OFFSET }),
217
- autoPlacement(expect.any(Function)),
181
+ autoPlacement({
182
+ alignment: 'start',
183
+ allowedPlacements: ['right-start', 'right-end', 'left-start', 'left-end'],
184
+ }),
218
185
  shift(),
219
186
  ],
220
187
  }
221
188
  );
222
- expect(autoPlacement.mock.calls[0][0]()).toEqual({
223
- alignment: 'start',
224
- boundary: 'clippingAncestors',
225
- allowedPlacements: ['right-start', 'right-end', 'left-start', 'left-end'],
226
- });
227
189
  });
228
190
 
229
191
  it("passes custom offset to Floating UI's middleware", async () => {
@@ -240,7 +202,7 @@ describe('base dropdown', () => {
240
202
  {
241
203
  placement: 'bottom-end',
242
204
  strategy: 'absolute',
243
- middleware: [offset(customOffset), autoPlacement(expect.any(Function)), shift()],
205
+ middleware: [offset(customOffset), autoPlacement(expect.any(Object)), shift()],
244
206
  }
245
207
  );
246
208
  });
@@ -9,7 +9,6 @@ import {
9
9
  dropdownVariantOptions,
10
10
  } from '../../../../utils/constants';
11
11
  import {
12
- GL_DROPDOWN_HORIZONTAL_BOUNDARY_SELECTOR,
13
12
  GL_DROPDOWN_SHOWN,
14
13
  GL_DROPDOWN_HIDDEN,
15
14
  GL_DROPDOWN_BEFORE_CLOSE,
@@ -21,12 +20,7 @@ import {
21
20
  POSITION_ABSOLUTE,
22
21
  POSITION_FIXED,
23
22
  } from '../constants';
24
- import {
25
- logWarning,
26
- isElementTabbable,
27
- isElementFocusable,
28
- getHorizontalBoundingClientRect,
29
- } from '../../../../utils/utils';
23
+ import { logWarning, isElementTabbable, isElementFocusable } from '../../../../utils/utils';
30
24
 
31
25
  import GlButton from '../../button/button.vue';
32
26
  import GlIcon from '../../icon/icon.vue';
@@ -276,15 +270,9 @@ export default {
276
270
  strategy: this.positioningStrategy,
277
271
  middleware: [
278
272
  offset(this.offset),
279
- autoPlacement(() => {
280
- const autoHorizontalBoundary = getHorizontalBoundingClientRect(
281
- this.$el.closest(GL_DROPDOWN_HORIZONTAL_BOUNDARY_SELECTOR)
282
- );
283
- return {
284
- alignment,
285
- boundary: autoHorizontalBoundary || 'clippingAncestors',
286
- allowedPlacements: dropdownAllowedAutoPlacements[this.placement],
287
- };
273
+ autoPlacement({
274
+ alignment,
275
+ allowedPlacements: dropdownAllowedAutoPlacements[this.placement],
288
276
  }),
289
277
  shift(),
290
278
  size({
@@ -1,5 +1,4 @@
1
1
  // base dropdown events
2
- export const GL_DROPDOWN_HORIZONTAL_BOUNDARY_SELECTOR = 'main';
3
2
  export const GL_DROPDOWN_SHOWN = 'shown';
4
3
  export const GL_DROPDOWN_HIDDEN = 'hidden';
5
4
  export const GL_DROPDOWN_BEFORE_CLOSE = 'beforeClose';
@@ -343,31 +343,3 @@ export default {
343
343
  startOpened: true,
344
344
  },
345
345
  };
346
-
347
- export const InMainWrapper = (args, { argTypes }) => ({
348
- toggleId: TOGGLE_ID,
349
- props: Object.keys(argTypes),
350
- components: {
351
- GlDisclosureDropdown,
352
- GlTooltip,
353
- },
354
- template: `
355
- <div>
356
- ${template()}
357
- <gl-tooltip :target="$options.toggleId" placement="right">
358
- Automatic placement to stay inside &lt;main&gt; boundary
359
- </gl-tooltip>
360
- </div>
361
- `,
362
- });
363
- InMainWrapper.args = {
364
- items: mockItems,
365
- icon: 'ellipsis_v',
366
- noCaret: true,
367
- toggleText: 'Disclosure',
368
- textSrOnly: true,
369
- toggleId: TOGGLE_ID,
370
- };
371
- InMainWrapper.decorators = [
372
- makeContainer({ backgroundColor: '#efefef', textAlign: 'right', height: '200px' }, 'main'),
373
- ];
@@ -4,14 +4,6 @@
4
4
  */
5
5
 
6
6
  :root {
7
- --gl-text-color-disabled: #89888d; /* Used for disabled text. */
8
- --gl-text-color-success: #217645; /* Used for text indicating success or validity. */
9
- --gl-text-color-danger: #c91c00; /* Used for text indicating a problem, critical state, destructive action, error, failure, removal, stop, or declination. */
10
- --gl-text-color-link: #0b5cad; /* Used for default text links. */
11
- --gl-text-color-heading: #1f1e24; /* Used for headings level 1-6. */
12
- --gl-text-color-strong: #1f1e24; /* Used for text with the highest contrast. */
13
- --gl-text-color-subtle: #626168; /* Used for supplemental text that doesn't need to be as prominent as other text. */
14
- --gl-text-color-default: #434248; /* Used for the default text color. */
15
7
  --gl-text-tertiary: #89888d; /* Use text.color.disabled instead */
16
8
  --gl-text-secondary: #737278; /* Use text.color.subtle instead */
17
9
  --gl-text-primary: #333238; /* Use text.color.default instead */
@@ -245,4 +237,81 @@
245
237
  --data-viz-green-200: #b0d97b;
246
238
  --data-viz-green-100: #c6ed94;
247
239
  --data-viz-green-50: #ddfab7;
240
+ --gl-color-red-950: #4d0a00;
241
+ --gl-color-red-900: #660e00;
242
+ --gl-color-red-800: #8d1300;
243
+ --gl-color-red-700: #ae1800;
244
+ --gl-color-red-600: #c91c00;
245
+ --gl-color-red-500: #dd2b0e;
246
+ --gl-color-red-400: #ec5941;
247
+ --gl-color-red-300: #f57f6c;
248
+ --gl-color-red-200: #fcb5aa;
249
+ --gl-color-red-100: #fdd4cd;
250
+ --gl-color-red-50: #fcf1ef;
251
+ --gl-color-purple-950: #232150;
252
+ --gl-color-purple-900: #2f2a6b;
253
+ --gl-color-purple-800: #453894;
254
+ --gl-color-purple-700: #5943b6;
255
+ --gl-color-purple-600: #694cc0;
256
+ --gl-color-purple-500: #7b58cf;
257
+ --gl-color-purple-400: #9475db;
258
+ --gl-color-purple-300: #ac93e6;
259
+ --gl-color-purple-200: #cbbbf2;
260
+ --gl-color-purple-100: #e1d8f9;
261
+ --gl-color-purple-50: #f4f0ff;
262
+ --gl-color-orange-950: #421f00;
263
+ --gl-color-orange-900: #5c2900;
264
+ --gl-color-orange-800: #703800;
265
+ --gl-color-orange-700: #8f4700;
266
+ --gl-color-orange-600: #9e5400;
267
+ --gl-color-orange-500: #ab6100;
268
+ --gl-color-orange-400: #c17d10;
269
+ --gl-color-orange-300: #d99530;
270
+ --gl-color-orange-200: #e9be74;
271
+ --gl-color-orange-100: #f5d9a8;
272
+ --gl-color-orange-50: #fdf1dd;
273
+ --gl-color-green-950: #072b15;
274
+ --gl-color-green-900: #0a4020;
275
+ --gl-color-green-800: #0d532a;
276
+ --gl-color-green-700: #24663b;
277
+ --gl-color-green-600: #217645;
278
+ --gl-color-green-500: #108548;
279
+ --gl-color-green-400: #2da160;
280
+ --gl-color-green-300: #52b87a;
281
+ --gl-color-green-200: #91d4a8;
282
+ --gl-color-green-100: #c3e6cd;
283
+ --gl-color-green-50: #ecf4ee;
284
+ --gl-color-neutral-1000: #000;
285
+ --gl-color-neutral-950: #1f1e24;
286
+ --gl-color-neutral-900: #333238;
287
+ --gl-color-neutral-800: #434248;
288
+ --gl-color-neutral-700: #535158;
289
+ --gl-color-neutral-600: #626168;
290
+ --gl-color-neutral-500: #737278;
291
+ --gl-color-neutral-400: #89888d;
292
+ --gl-color-neutral-300: #a4a3a8;
293
+ --gl-color-neutral-200: #bfbfc3;
294
+ --gl-color-neutral-100: #dcdcde;
295
+ --gl-color-neutral-50: #ececef;
296
+ --gl-color-neutral-10: #fbfafd;
297
+ --gl-color-neutral-0: #fff;
298
+ --gl-color-blue-950: #002850;
299
+ --gl-color-blue-900: #033464;
300
+ --gl-color-blue-800: #064787;
301
+ --gl-color-blue-700: #0b5cad;
302
+ --gl-color-blue-600: #1068bf;
303
+ --gl-color-blue-500: #1f75cb;
304
+ --gl-color-blue-400: #428fdc;
305
+ --gl-color-blue-300: #63a6e9;
306
+ --gl-color-blue-200: #9dc7f1;
307
+ --gl-color-blue-100: #cbe2f9;
308
+ --gl-color-blue-50: #e9f3fc;
309
+ --gl-text-color-disabled: var(--gl-color-neutral-400); /* Used for disabled text. */
310
+ --gl-text-color-success: var(--gl-color-green-600); /* Used for text indicating success or validity. */
311
+ --gl-text-color-danger: var(--gl-color-red-600); /* Used for text indicating a problem, critical state, destructive action, error, failure, removal, stop, or declination. */
312
+ --gl-text-color-link: var(--gl-color-blue-700); /* Used for default text links. */
313
+ --gl-text-color-heading: var(--gl-color-neutral-950); /* Used for headings level 1-6. */
314
+ --gl-text-color-strong: var(--gl-color-neutral-950); /* Used for text with the highest contrast. */
315
+ --gl-text-color-subtle: var(--gl-color-neutral-600); /* Used for supplemental text that doesn't need to be as prominent as other text. */
316
+ --gl-text-color-default: var(--gl-color-neutral-800); /* Used for the default text color. */
248
317
  }