@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.
- package/CHANGELOG.md +12 -0
- package/README.md +1 -20
- package/dist/components/base/new_dropdowns/base_dropdown/base_dropdown.js +5 -9
- package/dist/components/base/new_dropdowns/constants.js +1 -2
- package/dist/tailwind.css +1 -1
- package/dist/tailwind.css.map +1 -1
- package/dist/tokens/build/js/tokens.dark.js +106 -1
- package/dist/tokens/build/js/tokens.js +70 -1
- package/dist/tokens/css/tokens.css +77 -8
- package/dist/tokens/css/tokens.dark.css +111 -6
- package/dist/tokens/js/tokens.dark.js +105 -0
- package/dist/tokens/js/tokens.js +69 -0
- package/dist/tokens/json/tokens.dark.json +4002 -2053
- package/dist/tokens/json/tokens.json +1207 -14
- package/dist/tokens/scss/_tokens.dark.scss +111 -6
- package/dist/tokens/scss/_tokens.scss +77 -8
- package/dist/tokens/scss/_tokens_custom_properties.scss +69 -0
- package/dist/tokens/tailwind/tokens.cjs +9 -8
- package/dist/utils/utils.js +1 -19
- package/package.json +1 -1
- package/src/components/base/new_dropdowns/base_dropdown/base_dropdown.spec.js +17 -55
- package/src/components/base/new_dropdowns/base_dropdown/base_dropdown.vue +4 -16
- package/src/components/base/new_dropdowns/constants.js +0 -1
- package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.stories.js +0 -28
- package/src/tokens/build/css/tokens.css +77 -8
- package/src/tokens/build/css/tokens.dark.css +111 -6
- package/src/tokens/build/js/tokens.dark.js +105 -0
- package/src/tokens/build/js/tokens.js +69 -0
- package/src/tokens/build/json/tokens.dark.json +4002 -2053
- package/src/tokens/build/json/tokens.json +1207 -14
- package/src/tokens/build/scss/_tokens.dark.scss +111 -6
- package/src/tokens/build/scss/_tokens.scss +77 -8
- package/src/tokens/build/scss/_tokens_custom_properties.scss +69 -0
- package/src/tokens/build/tailwind/tokens.cjs +9 -8
- package/src/tokens/color.constant.tokens.json +292 -0
- package/src/tokens/color.constant.tokens.stories.js +19 -0
- package/src/tokens/text.tokens.json +20 -14
- package/src/utils/utils.js +0 -18
- package/src/utils/utils.spec.js +0 -52
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"color": {
|
|
34
34
|
"default": {
|
|
35
35
|
"$value": {
|
|
36
|
-
"default": "
|
|
37
|
-
"dark": "
|
|
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": "
|
|
46
|
-
"dark": "
|
|
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": "
|
|
55
|
-
"dark": "
|
|
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": "
|
|
64
|
-
"dark": "
|
|
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": "
|
|
73
|
-
"dark": "
|
|
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":
|
|
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":
|
|
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": "
|
|
94
|
-
"dark": "
|
|
99
|
+
"default": "{color.neutral.400}",
|
|
100
|
+
"dark": "{color.neutral.400}"
|
|
95
101
|
},
|
|
96
102
|
"$type": "color",
|
|
97
103
|
"$description": "Used for disabled text.",
|
package/src/utils/utils.js
CHANGED
|
@@ -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
|
-
}
|
package/src/utils/utils.spec.js
CHANGED
|
@@ -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
|
});
|