@gitlab/ui 118.1.2 → 119.1.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 (29) hide show
  1. package/dist/components/base/breadcrumb/breadcrumb.js +7 -4
  2. package/dist/components/base/daterange_picker/daterange_picker.js +1 -1
  3. package/dist/components/base/pagination/pagination.js +2 -2
  4. package/dist/components/regions/dashboard_skeleton/dashboard_skeleton.js +1 -1
  5. package/dist/components/regions/empty_state/empty_state.js +1 -1
  6. package/dist/index.css +1 -1
  7. package/dist/index.css.map +1 -1
  8. package/dist/tailwind.css +1 -1
  9. package/dist/tailwind.css.map +1 -1
  10. package/dist/tokens/figma/contextual.tokens.json +8 -4
  11. package/dist/tokens/json/tokens.dark.json +8 -0
  12. package/dist/tokens/json/tokens.json +8 -0
  13. package/dist/utils/constants.js +0 -1
  14. package/package.json +2 -1
  15. package/src/components/base/breadcrumb/breadcrumb.vue +10 -3
  16. package/src/components/base/button/button.scss +1 -23
  17. package/src/components/base/button_group/button_group.scss +0 -28
  18. package/src/components/base/daterange_picker/daterange_picker.vue +2 -2
  19. package/src/components/base/pagination/pagination.vue +2 -2
  20. package/src/components/base/tabs/tabs/tabs.scss +4 -4
  21. package/src/components/regions/dashboard_skeleton/dashboard_skeleton.vue +1 -1
  22. package/src/components/regions/empty_state/empty_state.vue +1 -1
  23. package/src/tokens/build/figma/contextual.tokens.json +8 -4
  24. package/src/tokens/build/json/tokens.dark.json +8 -0
  25. package/src/tokens/build/json/tokens.json +8 -0
  26. package/src/tokens/contextual/button.tokens.json +8 -4
  27. package/src/utils/constants.js +0 -1
  28. package/tailwind.defaults.js +4 -1
  29. package/tailwind_cqs_mqs_plugin.js +98 -0
@@ -16513,6 +16513,7 @@
16513
16513
  "STROKE_COLOR"
16514
16514
  ]
16515
16515
  },
16516
+ "$deprecated": true,
16516
16517
  "filePath": "src/tokens/contextual/button.tokens.json",
16517
16518
  "isSource": true,
16518
16519
  "original": {
@@ -16527,6 +16528,7 @@
16527
16528
  "STROKE_COLOR"
16528
16529
  ]
16529
16530
  },
16531
+ "$deprecated": true,
16530
16532
  "key": "{button.dashed.border.color.default}"
16531
16533
  },
16532
16534
  "name": "BUTTON_DASHED_BORDER_COLOR_DEFAULT",
@@ -16549,6 +16551,7 @@
16549
16551
  "STROKE_COLOR"
16550
16552
  ]
16551
16553
  },
16554
+ "$deprecated": true,
16552
16555
  "filePath": "src/tokens/contextual/button.tokens.json",
16553
16556
  "isSource": true,
16554
16557
  "original": {
@@ -16560,6 +16563,7 @@
16560
16563
  "STROKE_COLOR"
16561
16564
  ]
16562
16565
  },
16566
+ "$deprecated": true,
16563
16567
  "key": "{button.dashed.border.color.hover}"
16564
16568
  },
16565
16569
  "name": "BUTTON_DASHED_BORDER_COLOR_HOVER",
@@ -16582,6 +16586,7 @@
16582
16586
  "STROKE_COLOR"
16583
16587
  ]
16584
16588
  },
16589
+ "$deprecated": true,
16585
16590
  "filePath": "src/tokens/contextual/button.tokens.json",
16586
16591
  "isSource": true,
16587
16592
  "original": {
@@ -16593,6 +16598,7 @@
16593
16598
  "STROKE_COLOR"
16594
16599
  ]
16595
16600
  },
16601
+ "$deprecated": true,
16596
16602
  "key": "{button.dashed.border.color.focus}"
16597
16603
  },
16598
16604
  "name": "BUTTON_DASHED_BORDER_COLOR_FOCUS",
@@ -16615,6 +16621,7 @@
16615
16621
  "STROKE_COLOR"
16616
16622
  ]
16617
16623
  },
16624
+ "$deprecated": true,
16618
16625
  "filePath": "src/tokens/contextual/button.tokens.json",
16619
16626
  "isSource": true,
16620
16627
  "original": {
@@ -16629,6 +16636,7 @@
16629
16636
  "STROKE_COLOR"
16630
16637
  ]
16631
16638
  },
16639
+ "$deprecated": true,
16632
16640
  "key": "{button.dashed.border.color.active}"
16633
16641
  },
16634
16642
  "name": "BUTTON_DASHED_BORDER_COLOR_ACTIVE",
@@ -1264,7 +1264,8 @@
1264
1264
  "com.figma.scope": [
1265
1265
  "STROKE_COLOR"
1266
1266
  ]
1267
- }
1267
+ },
1268
+ "$deprecated": true
1268
1269
  },
1269
1270
  "hover": {
1270
1271
  "$value": "{button.dashed.border.color.default}",
@@ -1274,7 +1275,8 @@
1274
1275
  "com.figma.scope": [
1275
1276
  "STROKE_COLOR"
1276
1277
  ]
1277
- }
1278
+ },
1279
+ "$deprecated": true
1278
1280
  },
1279
1281
  "focus": {
1280
1282
  "$value": "{button.dashed.border.color.default}",
@@ -1284,7 +1286,8 @@
1284
1286
  "com.figma.scope": [
1285
1287
  "STROKE_COLOR"
1286
1288
  ]
1287
- }
1289
+ },
1290
+ "$deprecated": true
1288
1291
  },
1289
1292
  "active": {
1290
1293
  "$value": {
@@ -1297,7 +1300,8 @@
1297
1300
  "com.figma.scope": [
1298
1301
  "STROKE_COLOR"
1299
1302
  ]
1300
- }
1303
+ },
1304
+ "$deprecated": true
1301
1305
  }
1302
1306
  }
1303
1307
  }
@@ -108,7 +108,6 @@ export const buttonVariantOptions = {
108
108
  default: 'default',
109
109
  confirm: 'confirm',
110
110
  danger: 'danger',
111
- dashed: 'dashed',
112
111
  link: 'link',
113
112
  /**
114
113
  * The "reset" variant can be used when customization of GlButton styles is required
@@ -1,5 +1,6 @@
1
1
  const { range, round } = require('lodash');
2
2
  const plugin = require('tailwindcss/plugin');
3
+ const { tailwindCQsMQsPlugin } = require('./tailwind_cqs_mqs_plugin');
3
4
  const {
4
5
  colors,
5
6
  backgroundColor,
@@ -9,6 +10,8 @@ const {
9
10
  textColor,
10
11
  } = require('./src/tokens/build/tailwind/tokens.cjs');
11
12
 
13
+ const buildCQs = Boolean(process.env.USE_TAILWIND_CONTAINER_QUERIES);
14
+
12
15
  const gridSize = 0.5; // rem
13
16
  const spacing = {
14
17
  0: '0',
@@ -489,7 +492,7 @@ module.exports = {
489
492
  ringColor: false,
490
493
  ringOffsetWidth: false,
491
494
  },
492
- plugins: [plugin(addCustomDefinitions)],
495
+ plugins: [plugin(addCustomDefinitions), tailwindCQsMQsPlugin(buildCQs)],
493
496
  theme: {
494
497
  animation: {
495
498
  spin: 'spin 0.6s infinite linear',
@@ -0,0 +1,98 @@
1
+ const plugin = require('tailwindcss/plugin');
2
+
3
+ const tailwindCQsMQsPlugin = (buildCQs = false) =>
4
+ plugin(
5
+ ({ matchUtilities, matchVariant, theme }) => {
6
+ const values = theme('containers') ?? {};
7
+
8
+ function parseValue(value) {
9
+ const numericValue = value.match(/^(\d+\.\d+|\d+|\.\d+)\D+/)?.[1] ?? null;
10
+ if (numericValue === null) return null;
11
+
12
+ return parseFloat(value);
13
+ }
14
+
15
+ matchUtilities(
16
+ {
17
+ '@container': (value, { modifier }) => {
18
+ return {
19
+ 'container-type': value,
20
+ 'container-name': modifier,
21
+ };
22
+ },
23
+ },
24
+ {
25
+ values: {
26
+ DEFAULT: 'inline-size',
27
+ normal: 'normal',
28
+ },
29
+ modifiers: 'any',
30
+ },
31
+ );
32
+
33
+ const buildVariantMatcher = (variant, { cqBuilder, mqBuilder }) => [
34
+ variant,
35
+ (value = '', { modifier }) => {
36
+ const parsed = parseValue(value);
37
+
38
+ if (parsed === null) return [];
39
+
40
+ return buildCQs ? cqBuilder(modifier, value) : mqBuilder(value);
41
+ },
42
+ {
43
+ values,
44
+ sort(aVariant, zVariant) {
45
+ const a = parseFloat(aVariant.value);
46
+ const z = parseFloat(zVariant.value);
47
+
48
+ if (a === null || z === null) return 0;
49
+
50
+ // Sort values themselves regardless of unit
51
+ if (a - z !== 0) return a - z;
52
+
53
+ const aLabel = aVariant.modifier ?? '';
54
+ const zLabel = zVariant.modifier ?? '';
55
+
56
+ // Explicitly move empty labels to the end
57
+ if (aLabel === '' && zLabel !== '') {
58
+ return 1;
59
+ }
60
+ if (aLabel !== '' && zLabel === '') {
61
+ return -1;
62
+ }
63
+
64
+ // Sort labels alphabetically in the English locale
65
+ // We are intentionally overriding the locale because we do not want the sort to
66
+ // be affected by the machine's locale (be it a developer or CI environment)
67
+ return aLabel.localeCompare(zLabel, 'en', { numeric: true });
68
+ },
69
+ },
70
+ ];
71
+
72
+ matchVariant(
73
+ ...buildVariantMatcher('@', {
74
+ cqBuilder: (modifier, value) => `@container ${modifier ?? ''} (min-width: ${value})`,
75
+ mqBuilder: (value) => `@media (min-width: ${value})`,
76
+ }),
77
+ );
78
+
79
+ matchVariant(
80
+ ...buildVariantMatcher('@max', {
81
+ cqBuilder: (modifier, value) => `@container ${modifier ?? ''} (max-width: ${value})`,
82
+ mqBuilder: (value) => `@media (max-width: ${value})`,
83
+ }),
84
+ );
85
+ },
86
+ {
87
+ theme: {
88
+ containers: {
89
+ sm: '576px',
90
+ md: '768px',
91
+ lg: '992px',
92
+ xl: '1200px',
93
+ },
94
+ },
95
+ },
96
+ );
97
+
98
+ module.exports = { tailwindCQsMQsPlugin };