@gitlab/ui 80.11.0 → 80.13.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 (42) hide show
  1. package/CHANGELOG.md +24 -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/tokens/tokens_table.js +12 -1
  20. package/dist/utils/utils.js +1 -19
  21. package/package.json +1 -1
  22. package/src/components/base/icon/icon.stories.js +3 -1
  23. package/src/components/base/new_dropdowns/base_dropdown/base_dropdown.spec.js +17 -55
  24. package/src/components/base/new_dropdowns/base_dropdown/base_dropdown.vue +4 -16
  25. package/src/components/base/new_dropdowns/constants.js +0 -1
  26. package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.stories.js +0 -28
  27. package/src/tokens/build/css/tokens.css +77 -8
  28. package/src/tokens/build/css/tokens.dark.css +111 -6
  29. package/src/tokens/build/js/tokens.dark.js +105 -0
  30. package/src/tokens/build/js/tokens.js +69 -0
  31. package/src/tokens/build/json/tokens.dark.json +4002 -2053
  32. package/src/tokens/build/json/tokens.json +1207 -14
  33. package/src/tokens/build/scss/_tokens.dark.scss +111 -6
  34. package/src/tokens/build/scss/_tokens.scss +77 -8
  35. package/src/tokens/build/scss/_tokens_custom_properties.scss +69 -0
  36. package/src/tokens/build/tailwind/tokens.cjs +9 -8
  37. package/src/tokens/color.constant.tokens.json +292 -0
  38. package/src/tokens/color.constant.tokens.stories.js +19 -0
  39. package/src/tokens/text.tokens.json +20 -14
  40. package/src/tokens/tokens_table.vue +12 -1
  41. package/src/utils/utils.js +0 -18
  42. package/src/utils/utils.spec.js +0 -52
@@ -33,8 +33,8 @@
33
33
  "color": {
34
34
  "default": {
35
35
  "$value": {
36
- "default": "#434248",
37
- "dark": "#ececef"
36
+ "default": "{color.neutral.800}",
37
+ "dark": "{color.neutral.50}"
38
38
  },
39
39
  "$type": "color",
40
40
  "$description": "Used for the default text color.",
@@ -42,8 +42,8 @@
42
42
  },
43
43
  "subtle": {
44
44
  "$value": {
45
- "default": "#626168",
46
- "dark": "#bfbfc3"
45
+ "default": "{color.neutral.600}",
46
+ "dark": "{color.neutral.200}"
47
47
  },
48
48
  "$type": "color",
49
49
  "$description": "Used for supplemental text that doesn't need to be as prominent as other text.",
@@ -51,8 +51,8 @@
51
51
  },
52
52
  "strong": {
53
53
  "$value": {
54
- "default": "#1f1e24",
55
- "dark": "#fff"
54
+ "default": "{color.neutral.950}",
55
+ "dark": "{color.neutral.0}"
56
56
  },
57
57
  "$type": "color",
58
58
  "$description": "Used for text with the highest contrast.",
@@ -60,8 +60,8 @@
60
60
  },
61
61
  "heading": {
62
62
  "$value": {
63
- "default": "#1f1e24",
64
- "dark": "#fff"
63
+ "default": "{color.neutral.950}",
64
+ "dark": "{color.neutral.0}"
65
65
  },
66
66
  "$type": "color",
67
67
  "$description": "Used for headings level 1-6.",
@@ -69,29 +69,35 @@
69
69
  },
70
70
  "link": {
71
71
  "$value": {
72
- "default": "#0b5cad",
73
- "dark": "#63a6e9"
72
+ "default": "{color.blue.700}",
73
+ "dark": "{color.blue.300}"
74
74
  },
75
75
  "$type": "color",
76
76
  "$description": "Used for default text links.",
77
77
  "themeable": true
78
78
  },
79
79
  "danger": {
80
- "$value": "#c91c00",
80
+ "$value": {
81
+ "default": "{color.red.600}",
82
+ "dark": "{color.red.300}"
83
+ },
81
84
  "$type": "color",
82
85
  "$description": "Used for text indicating a problem, critical state, destructive action, error, failure, removal, stop, or declination.",
83
86
  "themeable": true
84
87
  },
85
88
  "success": {
86
- "$value": "#217645",
89
+ "$value": {
90
+ "default": "{color.green.600}",
91
+ "dark": "{color.green.300}"
92
+ },
87
93
  "$type": "color",
88
94
  "$description": "Used for text indicating success or validity.",
89
95
  "themeable": true
90
96
  },
91
97
  "disabled": {
92
98
  "$value": {
93
- "default": "#89888d",
94
- "dark": "#89888d"
99
+ "default": "{color.neutral.400}",
100
+ "dark": "{color.neutral.400}"
95
101
  },
96
102
  "$type": "color",
97
103
  "$description": "Used for disabled text.",
@@ -101,6 +101,17 @@ export default {
101
101
  }
102
102
  });
103
103
 
104
+ // Sort tokensArray so deprecated items are last
105
+ tokensArray.sort((a, b) => {
106
+ if (a.deprecated && !b.deprecated) {
107
+ return 1;
108
+ }
109
+ if (!a.deprecated && b.deprecated) {
110
+ return -1;
111
+ }
112
+ return 0;
113
+ });
114
+
104
115
  return tokensArray;
105
116
  },
106
117
  },
@@ -130,8 +141,8 @@ export default {
130
141
  <template #cell(description)="{ item: { name, deprecated, description } }">
131
142
  <code class="gl-font-base gl-text-strong">
132
143
  {{ name }}
133
- <gl-badge v-if="deprecated" size="sm" variant="neutral">Deprecated</gl-badge>
134
144
  </code>
145
+ <gl-badge v-if="deprecated" size="sm" variant="danger">Deprecated</gl-badge>
135
146
  <div v-if="description" class="gl-mt-3 gl-text-subtle">
136
147
  {{ description }}
137
148
  </div>
@@ -204,21 +204,3 @@ export function stopEvent(
204
204
  export function filterVisible(els) {
205
205
  return (els || []).filter((el) => isVisible(el));
206
206
  }
207
-
208
- /**
209
- * Given an element, returns a Rect object
210
- * with top and bottom boundaries removed.
211
- */
212
- export function getHorizontalBoundingClientRect(el) {
213
- const rect = el?.getBoundingClientRect();
214
-
215
- if (rect) {
216
- return {
217
- x: rect.x,
218
- width: rect.width,
219
- y: 0, // top of the document
220
- height: document.documentElement.clientHeight, // bottom of the document
221
- };
222
- }
223
- return null;
224
- }
@@ -3,7 +3,6 @@ import {
3
3
  isElementTabbable,
4
4
  focusFirstFocusableElement,
5
5
  stopEvent,
6
- getHorizontalBoundingClientRect,
7
6
  } from './utils';
8
7
 
9
8
  describe('isElementFocusable', () => {
@@ -154,55 +153,4 @@ describe('stopEvent', () => {
154
153
  expect(event.stopPropagation).not.toHaveBeenCalled();
155
154
  expect(event.stopImmediatePropagation).toHaveBeenCalledTimes(1);
156
155
  });
157
-
158
- describe('getHorizontalBoundingClientRect', () => {
159
- describe('when there is a reference element', () => {
160
- let mainElement;
161
-
162
- const [
163
- MAIN_LEFT_BOUNDARY,
164
- MAIN_WIDTH,
165
- MAIN_TOP_BOUNDARY,
166
- MAIN_HEIGHT,
167
- DOCUMENT_TOP_BOUNDARY,
168
- DOCUMENT_HEIGHT,
169
- ] = [10, 20, 30, 40, 0, 50];
170
-
171
- beforeEach(() => {
172
- mainElement = document.createElement('main');
173
- jest.spyOn(mainElement, 'getBoundingClientRect').mockImplementation(() => {
174
- return {
175
- x: MAIN_LEFT_BOUNDARY,
176
- width: MAIN_WIDTH,
177
- y: MAIN_TOP_BOUNDARY,
178
- height: MAIN_HEIGHT,
179
- };
180
- });
181
- Object.defineProperty(document.documentElement, 'clientHeight', {
182
- get() {
183
- return DOCUMENT_HEIGHT;
184
- },
185
- });
186
- });
187
-
188
- afterEach(() => {
189
- mainElement = null;
190
- });
191
-
192
- it("returns the element's horizontal boundaries and the document's vertical boundaries", () => {
193
- expect(getHorizontalBoundingClientRect(mainElement)).toEqual({
194
- x: MAIN_LEFT_BOUNDARY,
195
- width: MAIN_WIDTH,
196
- y: DOCUMENT_TOP_BOUNDARY,
197
- height: DOCUMENT_HEIGHT,
198
- });
199
- });
200
- });
201
-
202
- describe('when there is no reference element', () => {
203
- it('returns `null`', () => {
204
- expect(getHorizontalBoundingClientRect(null)).toEqual(null);
205
- });
206
- });
207
- });
208
156
  });