@gitlab/ui 64.10.2 → 64.11.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.
- package/CHANGELOG.md +14 -0
- package/dist/components/base/new_dropdowns/listbox/listbox.js +2 -2
- package/dist/components/base/new_dropdowns/listbox/mock_data.js +1 -7
- package/package.json +1 -1
- package/scss_to_js/scss_variables.js +16 -0
- package/scss_to_js/scss_variables.json +80 -0
- package/src/components/base/new_dropdowns/listbox/listbox.spec.js +10 -36
- package/src/components/base/new_dropdowns/listbox/listbox.vue +2 -2
- package/src/components/base/new_dropdowns/listbox/mock_data.js +0 -2
- package/src/scss/variables.scss +26 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [64.11.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v64.11.0...v64.11.1) (2023-06-19)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **GlCollapsibleListbox:** revert to previous clear all logic ([a9ef6d6](https://gitlab.com/gitlab-org/gitlab-ui/commit/a9ef6d6ce69b470be3d2f0c1471d164e0eea24bd))
|
|
7
|
+
|
|
8
|
+
# [64.11.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v64.10.2...v64.11.0) (2023-06-16)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **Typography:** add text size scale variables ([355c159](https://gitlab.com/gitlab-org/gitlab-ui/commit/355c159d5d1753273a65d6ff98c598c7d6b130c3))
|
|
14
|
+
|
|
1
15
|
## [64.10.2](https://gitlab.com/gitlab-org/gitlab-ui/compare/v64.10.1...v64.10.2) (2023-06-16)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -399,7 +399,7 @@ var script = {
|
|
|
399
399
|
return false;
|
|
400
400
|
}
|
|
401
401
|
if (this.multiple) {
|
|
402
|
-
return this.selected.length
|
|
402
|
+
return this.selected.length > 0;
|
|
403
403
|
}
|
|
404
404
|
return Boolean(this.selected);
|
|
405
405
|
},
|
|
@@ -418,7 +418,7 @@ var script = {
|
|
|
418
418
|
if (!this.hasItems) {
|
|
419
419
|
return false;
|
|
420
420
|
}
|
|
421
|
-
return this.selected.length
|
|
421
|
+
return this.selected.length === 0;
|
|
422
422
|
},
|
|
423
423
|
showIntersectionObserver() {
|
|
424
424
|
return this.infiniteScroll && !this.infiniteScrollLoading && !this.loading && !this.searching;
|
|
@@ -35,12 +35,6 @@ const mockOptions = [{
|
|
|
35
35
|
value: 'sup',
|
|
36
36
|
text: 'Support'
|
|
37
37
|
}];
|
|
38
|
-
const mockOptionsValues = mockOptions.map(_ref => {
|
|
39
|
-
let {
|
|
40
|
-
value
|
|
41
|
-
} = _ref;
|
|
42
|
-
return value;
|
|
43
|
-
});
|
|
44
38
|
const mockGroups = [{
|
|
45
39
|
text: 'Branches',
|
|
46
40
|
options: [{
|
|
@@ -109,4 +103,4 @@ const mockUsers = [{
|
|
|
109
103
|
icon: 'bin'
|
|
110
104
|
}];
|
|
111
105
|
|
|
112
|
-
export { mockGroups, mockGroupsWithTextSrOnly, mockOptions,
|
|
106
|
+
export { mockGroups, mockGroupsWithTextSrOnly, mockOptions, mockUsers };
|
package/package.json
CHANGED
|
@@ -266,6 +266,22 @@ export const glLineHeight36 = '2.25rem'
|
|
|
266
266
|
export const glLineHeight42 = '2.625rem'
|
|
267
267
|
export const glLineHeight44 = '2.75rem'
|
|
268
268
|
export const glLineHeight52 = '3.25rem'
|
|
269
|
+
export const glFontSize100Fixed = '0.75rem'
|
|
270
|
+
export const glFontSize200Fixed = '0.8125rem'
|
|
271
|
+
export const glFontSize300Fixed = '0.875rem'
|
|
272
|
+
export const glFontSize400Fixed = '1rem'
|
|
273
|
+
export const glFontSize500Fixed = '1.125rem'
|
|
274
|
+
export const glFontSize600Fixed = '1.3125rem'
|
|
275
|
+
export const glFontSize700Fixed = '1.5rem'
|
|
276
|
+
export const glFontSize800Fixed = '1.75rem'
|
|
277
|
+
export const glFontSize100 = '0.75rem'
|
|
278
|
+
export const glFontSize200 = '0.8125rem'
|
|
279
|
+
export const glFontSize300 = '0.875rem'
|
|
280
|
+
export const glFontSize400 = '1rem'
|
|
281
|
+
export const glFontSize500 = 'clamp(1.125rem, calc(0.9027777778rem + 0.462962963vw), 1.25rem)'
|
|
282
|
+
export const glFontSize600 = 'clamp(1.3125rem, calc(0.8680555556rem + 0.9259259259vw), 1.5625rem)'
|
|
283
|
+
export const glFontSize700 = 'clamp(1.5rem, calc(0.8333333333rem + 1.3888888889vw), 1.875rem)'
|
|
284
|
+
export const glFontSize800 = 'clamp(1.75rem, calc(0.8611111111rem + 1.8518518519vw), 2.25rem)'
|
|
269
285
|
export const glFontSize = '0.875rem'
|
|
270
286
|
export const glFontSizeXs = '0.625rem'
|
|
271
287
|
export const glFontSizeSm = '0.75rem'
|
|
@@ -1379,6 +1379,86 @@
|
|
|
1379
1379
|
"value": "px-to-rem(52px)",
|
|
1380
1380
|
"compiledValue": "3.25rem"
|
|
1381
1381
|
},
|
|
1382
|
+
{
|
|
1383
|
+
"name": "$gl-font-size-100-fixed",
|
|
1384
|
+
"value": "px-to-rem(12px)",
|
|
1385
|
+
"compiledValue": "0.75rem"
|
|
1386
|
+
},
|
|
1387
|
+
{
|
|
1388
|
+
"name": "$gl-font-size-200-fixed",
|
|
1389
|
+
"value": "px-to-rem(13px)",
|
|
1390
|
+
"compiledValue": "0.8125rem"
|
|
1391
|
+
},
|
|
1392
|
+
{
|
|
1393
|
+
"name": "$gl-font-size-300-fixed",
|
|
1394
|
+
"value": "px-to-rem(14px)",
|
|
1395
|
+
"compiledValue": "0.875rem"
|
|
1396
|
+
},
|
|
1397
|
+
{
|
|
1398
|
+
"name": "$gl-font-size-400-fixed",
|
|
1399
|
+
"value": "px-to-rem(16px)",
|
|
1400
|
+
"compiledValue": "1rem"
|
|
1401
|
+
},
|
|
1402
|
+
{
|
|
1403
|
+
"name": "$gl-font-size-500-fixed",
|
|
1404
|
+
"value": "px-to-rem(18px)",
|
|
1405
|
+
"compiledValue": "1.125rem"
|
|
1406
|
+
},
|
|
1407
|
+
{
|
|
1408
|
+
"name": "$gl-font-size-600-fixed",
|
|
1409
|
+
"value": "px-to-rem(21px)",
|
|
1410
|
+
"compiledValue": "1.3125rem"
|
|
1411
|
+
},
|
|
1412
|
+
{
|
|
1413
|
+
"name": "$gl-font-size-700-fixed",
|
|
1414
|
+
"value": "px-to-rem(24px)",
|
|
1415
|
+
"compiledValue": "1.5rem"
|
|
1416
|
+
},
|
|
1417
|
+
{
|
|
1418
|
+
"name": "$gl-font-size-800-fixed",
|
|
1419
|
+
"value": "px-to-rem(28px)",
|
|
1420
|
+
"compiledValue": "1.75rem"
|
|
1421
|
+
},
|
|
1422
|
+
{
|
|
1423
|
+
"name": "$gl-font-size-100",
|
|
1424
|
+
"value": "$gl-font-size-100-fixed",
|
|
1425
|
+
"compiledValue": "0.75rem"
|
|
1426
|
+
},
|
|
1427
|
+
{
|
|
1428
|
+
"name": "$gl-font-size-200",
|
|
1429
|
+
"value": "$gl-font-size-200-fixed",
|
|
1430
|
+
"compiledValue": "0.8125rem"
|
|
1431
|
+
},
|
|
1432
|
+
{
|
|
1433
|
+
"name": "$gl-font-size-300",
|
|
1434
|
+
"value": "$gl-font-size-300-fixed",
|
|
1435
|
+
"compiledValue": "0.875rem"
|
|
1436
|
+
},
|
|
1437
|
+
{
|
|
1438
|
+
"name": "$gl-font-size-400",
|
|
1439
|
+
"value": "$gl-font-size-400-fixed",
|
|
1440
|
+
"compiledValue": "1rem"
|
|
1441
|
+
},
|
|
1442
|
+
{
|
|
1443
|
+
"name": "$gl-font-size-500",
|
|
1444
|
+
"value": "#{clamp-between($gl-font-size-500-fixed, px-to-rem(20px))}",
|
|
1445
|
+
"compiledValue": "clamp(1.125rem, calc(0.9027777778rem + 0.462962963vw), 1.25rem)"
|
|
1446
|
+
},
|
|
1447
|
+
{
|
|
1448
|
+
"name": "$gl-font-size-600",
|
|
1449
|
+
"value": "#{clamp-between($gl-font-size-600-fixed, px-to-rem(25px))}",
|
|
1450
|
+
"compiledValue": "clamp(1.3125rem, calc(0.8680555556rem + 0.9259259259vw), 1.5625rem)"
|
|
1451
|
+
},
|
|
1452
|
+
{
|
|
1453
|
+
"name": "$gl-font-size-700",
|
|
1454
|
+
"value": "#{clamp-between($gl-font-size-700-fixed, px-to-rem(30px))}",
|
|
1455
|
+
"compiledValue": "clamp(1.5rem, calc(0.8333333333rem + 1.3888888889vw), 1.875rem)"
|
|
1456
|
+
},
|
|
1457
|
+
{
|
|
1458
|
+
"name": "$gl-font-size-800",
|
|
1459
|
+
"value": "#{clamp-between($gl-font-size-800-fixed, px-to-rem(36px))}",
|
|
1460
|
+
"compiledValue": "clamp(1.75rem, calc(0.8611111111rem + 1.8518518519vw), 2.25rem)"
|
|
1461
|
+
},
|
|
1382
1462
|
{
|
|
1383
1463
|
"name": "$gl-font-size",
|
|
1384
1464
|
"value": "px-to-rem(14px)",
|
|
@@ -18,7 +18,7 @@ import GlIntersectionObserver from '../../../utilities/intersection_observer/int
|
|
|
18
18
|
import GlCollapsibleListbox, { ITEM_SELECTOR } from './listbox.vue';
|
|
19
19
|
import GlListboxItem from './listbox_item.vue';
|
|
20
20
|
import GlListboxGroup from './listbox_group.vue';
|
|
21
|
-
import { mockOptions,
|
|
21
|
+
import { mockOptions, mockGroups, mockGroupsWithTextSrOnly } from './mock_data';
|
|
22
22
|
|
|
23
23
|
jest.mock('@floating-ui/dom');
|
|
24
24
|
autoUpdate.mockImplementation(() => {
|
|
@@ -485,16 +485,16 @@ describe('GlCollapsibleListbox', () => {
|
|
|
485
485
|
});
|
|
486
486
|
|
|
487
487
|
it.each`
|
|
488
|
-
|
|
489
|
-
${
|
|
490
|
-
${
|
|
488
|
+
multiple
|
|
489
|
+
${true}
|
|
490
|
+
${false}
|
|
491
491
|
`(
|
|
492
|
-
'
|
|
493
|
-
({ multiple
|
|
492
|
+
'shows the reset button if the label is provided and the selection is not empty and mode if multiple mode is $multiple',
|
|
493
|
+
({ multiple }) => {
|
|
494
494
|
buildWrapper({
|
|
495
495
|
headerText: 'Select assignee',
|
|
496
496
|
resetButtonLabel: 'Unassign',
|
|
497
|
-
selected,
|
|
497
|
+
selected: mockOptions[1].value,
|
|
498
498
|
items: mockOptions,
|
|
499
499
|
multiple,
|
|
500
500
|
});
|
|
@@ -503,7 +503,7 @@ describe('GlCollapsibleListbox', () => {
|
|
|
503
503
|
}
|
|
504
504
|
);
|
|
505
505
|
|
|
506
|
-
it('
|
|
506
|
+
it('shows the reset button if the label is provided and the selection is not empty', () => {
|
|
507
507
|
buildWrapper({
|
|
508
508
|
headerText: 'Select assignee',
|
|
509
509
|
resetButtonLabel: 'Unassign',
|
|
@@ -512,7 +512,7 @@ describe('GlCollapsibleListbox', () => {
|
|
|
512
512
|
multiple: true,
|
|
513
513
|
});
|
|
514
514
|
|
|
515
|
-
expect(findResetButton().
|
|
515
|
+
expect(findResetButton().text()).toBe('Unassign');
|
|
516
516
|
});
|
|
517
517
|
|
|
518
518
|
it('hides reset button if dropdown has no items', () => {
|
|
@@ -546,7 +546,7 @@ describe('GlCollapsibleListbox', () => {
|
|
|
546
546
|
buildWrapper({
|
|
547
547
|
headerText: 'Select assignee',
|
|
548
548
|
resetButtonLabel: 'Unassign',
|
|
549
|
-
selected:
|
|
549
|
+
selected: mockOptions[1].value,
|
|
550
550
|
items: mockOptions,
|
|
551
551
|
multiple: true,
|
|
552
552
|
});
|
|
@@ -605,32 +605,6 @@ describe('GlCollapsibleListbox', () => {
|
|
|
605
605
|
expect(findSelectAllButton().exists()).toBe(false);
|
|
606
606
|
});
|
|
607
607
|
|
|
608
|
-
it('hides select all button if all items are selected', () => {
|
|
609
|
-
buildWrapper({
|
|
610
|
-
headerText: 'Select assignee',
|
|
611
|
-
resetButtonLabel: 'Unassign',
|
|
612
|
-
showSelectAllButtonLabel: 'Select All',
|
|
613
|
-
selected: mockOptionsValues,
|
|
614
|
-
items: mockOptions,
|
|
615
|
-
multiple: true,
|
|
616
|
-
});
|
|
617
|
-
|
|
618
|
-
expect(findSelectAllButton().exists()).toBe(false);
|
|
619
|
-
});
|
|
620
|
-
|
|
621
|
-
it('has the label text "Select All" if the label is provided and some items are selected', () => {
|
|
622
|
-
buildWrapper({
|
|
623
|
-
headerText: 'Select assignee',
|
|
624
|
-
resetButtonLabel: 'Unassign',
|
|
625
|
-
showSelectAllButtonLabel: 'Select All',
|
|
626
|
-
selected: [mockOptions[1].value],
|
|
627
|
-
items: mockOptions,
|
|
628
|
-
multiple: true,
|
|
629
|
-
});
|
|
630
|
-
|
|
631
|
-
expect(findSelectAllButton().text()).toBe('Select All');
|
|
632
|
-
});
|
|
633
|
-
|
|
634
608
|
it('has the label text "Select All" if the label is provided and the selection is empty', () => {
|
|
635
609
|
buildWrapper({
|
|
636
610
|
headerText: 'Select assignee',
|
|
@@ -411,7 +411,7 @@ export default {
|
|
|
411
411
|
}
|
|
412
412
|
|
|
413
413
|
if (this.multiple) {
|
|
414
|
-
return this.selected.length
|
|
414
|
+
return this.selected.length > 0;
|
|
415
415
|
}
|
|
416
416
|
return Boolean(this.selected);
|
|
417
417
|
},
|
|
@@ -432,7 +432,7 @@ export default {
|
|
|
432
432
|
return false;
|
|
433
433
|
}
|
|
434
434
|
|
|
435
|
-
return this.selected.length
|
|
435
|
+
return this.selected.length === 0;
|
|
436
436
|
},
|
|
437
437
|
showIntersectionObserver() {
|
|
438
438
|
return this.infiniteScroll && !this.infiniteScrollLoading && !this.loading && !this.searching;
|
package/src/scss/variables.scss
CHANGED
|
@@ -342,6 +342,32 @@ $gl-line-height-42: px-to-rem(42px);
|
|
|
342
342
|
$gl-line-height-44: px-to-rem(44px);
|
|
343
343
|
$gl-line-height-52: px-to-rem(52px);
|
|
344
344
|
|
|
345
|
+
// New UI type scale
|
|
346
|
+
// Implements the type scale from https://gitlab.com/groups/gitlab-org/gitlab-services/-/epics/15
|
|
347
|
+
// Old variables and styles need to be removed after intergration
|
|
348
|
+
|
|
349
|
+
// Font size scale
|
|
350
|
+
|
|
351
|
+
// fixed scale (compact markdown)
|
|
352
|
+
$gl-font-size-100-fixed: px-to-rem(12px);
|
|
353
|
+
$gl-font-size-200-fixed: px-to-rem(13px);
|
|
354
|
+
$gl-font-size-300-fixed: px-to-rem(14px);
|
|
355
|
+
$gl-font-size-400-fixed: px-to-rem(16px);
|
|
356
|
+
$gl-font-size-500-fixed: px-to-rem(18px);
|
|
357
|
+
$gl-font-size-600-fixed: px-to-rem(21px);
|
|
358
|
+
$gl-font-size-700-fixed: px-to-rem(24px);
|
|
359
|
+
$gl-font-size-800-fixed: px-to-rem(28px);
|
|
360
|
+
|
|
361
|
+
// dynamic scale (default) resizes based on viewport width
|
|
362
|
+
$gl-font-size-100: $gl-font-size-100-fixed;
|
|
363
|
+
$gl-font-size-200: $gl-font-size-200-fixed;
|
|
364
|
+
$gl-font-size-300: $gl-font-size-300-fixed;
|
|
365
|
+
$gl-font-size-400: $gl-font-size-400-fixed;
|
|
366
|
+
$gl-font-size-500: #{clamp-between($gl-font-size-500-fixed, px-to-rem(20px))};
|
|
367
|
+
$gl-font-size-600: #{clamp-between($gl-font-size-600-fixed, px-to-rem(25px))};
|
|
368
|
+
$gl-font-size-700: #{clamp-between($gl-font-size-700-fixed, px-to-rem(30px))};
|
|
369
|
+
$gl-font-size-800: #{clamp-between($gl-font-size-800-fixed, px-to-rem(36px))};
|
|
370
|
+
|
|
345
371
|
// UI typescale
|
|
346
372
|
|
|
347
373
|
// default (min-width: 0)
|