@gitlab/ui 103.7.1 → 104.0.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.
@@ -79,8 +79,6 @@ const buttonCategoryOptions = {
79
79
  const buttonVariantOptions = {
80
80
  default: 'default',
81
81
  confirm: 'confirm',
82
- info: 'info (deprecated)',
83
- success: 'success (deprecated)',
84
82
  danger: 'danger',
85
83
  dashed: 'dashed',
86
84
  link: 'link',
@@ -101,7 +99,6 @@ const dropdownVariantOptions = {
101
99
  default: 'default',
102
100
  confirm: 'confirm',
103
101
  info: 'info (deprecated)',
104
- success: 'success (deprecated)',
105
102
  danger: 'danger',
106
103
  link: 'link'
107
104
  };
@@ -228,7 +225,7 @@ const modalButtonDefaults = {
228
225
  };
229
226
  const tabsButtonDefaults = {
230
227
  actionPrimary: {
231
- variant: 'success',
228
+ variant: 'confirm',
232
229
  category: 'primary'
233
230
  },
234
231
  actionSecondary: {
@@ -53,7 +53,7 @@ const emptyMixin = extend({
53
53
  });
54
54
  if (!$empty) {
55
55
  $empty = h('div', {
56
- class: ['text-center', 'my-2'],
56
+ class: ['gl-text-center', 'gl-my-3'],
57
57
  domProps: isFiltered ? htmlOrText(emptyFilteredHtml, emptyFilteredText) : htmlOrText(emptyHtml, emptyText)
58
58
  });
59
59
  }
@@ -118,7 +118,7 @@ const theadMixin = extend({
118
118
  class: [{
119
119
  // We need to make the header cell relative when we have
120
120
  // a `.sr-only` sort label to work around overflow issues
121
- 'position-relative': sortLabel
121
+ 'gl-relative': sortLabel
122
122
  }, this.fieldClasses(field), sortClass],
123
123
  props: {
124
124
  variant,
@@ -163,7 +163,7 @@ const theadMixin = extend({
163
163
  domProps: htmlOrText(labelHtml, label)
164
164
  });
165
165
  const $srLabel = sortLabel ? h('span', {
166
- staticClass: 'sr-only'
166
+ staticClass: 'gl-sr-only'
167
167
  }, ` (${sortLabel})`) : null;
168
168
 
169
169
  // Return the header cell
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "103.7.1",
3
+ "version": "104.0.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -241,8 +241,7 @@
241
241
  );
242
242
  }
243
243
 
244
- &.btn-confirm,
245
- &.btn-info {
244
+ &.btn-confirm {
246
245
  @include gl-button-theme(
247
246
  $color: var(--gl-button-confirm-primary-foreground-color-default),
248
247
  $background-color: var(--gl-button-confirm-primary-background-color-default),
@@ -259,8 +258,7 @@
259
258
  );
260
259
  }
261
260
 
262
- &.btn-confirm-secondary,
263
- &.btn-info-secondary {
261
+ &.btn-confirm-secondary {
264
262
  @include gl-button-theme(
265
263
  $color: var(--gl-button-confirm-secondary-foreground-color-default),
266
264
  $background-color: var(--gl-button-confirm-secondary-background-color-default),
@@ -277,8 +275,7 @@
277
275
  );
278
276
  }
279
277
 
280
- &.btn-confirm-tertiary,
281
- &.btn-info-tertiary {
278
+ &.btn-confirm-tertiary {
282
279
  @include gl-button-theme(
283
280
  $color: var(--gl-button-confirm-tertiary-foreground-color-default),
284
281
  $background-color: var(--gl-button-confirm-tertiary-background-color-default),
@@ -349,8 +346,6 @@
349
346
  &.btn-default-secondary,
350
347
  &.btn-dashed-secondary,
351
348
  &.btn-confirm-secondary,
352
- &.btn-info-secondary,
353
- &.btn-success-secondary,
354
349
  &.btn-danger-secondary,
355
350
  &.btn-reset-secondary,
356
351
  &.btn-reset-tertiary {
@@ -363,8 +358,6 @@
363
358
  &.btn-default,
364
359
  &.btn-dashed,
365
360
  &.btn-confirm,
366
- &.btn-info,
367
- &.btn-success,
368
361
  &.btn-danger {
369
362
  &-tertiary {
370
363
  @if not $feature-button-border {
@@ -400,105 +393,6 @@
400
393
  }
401
394
  }
402
395
 
403
- &.btn-success {
404
- color: var(--gl-color-neutral-0); // The text is white in light and dark mode
405
- @apply gl-bg-green-500;
406
- @if $feature-button-border {
407
- border-color: $green-600;
408
- } @else {
409
- box-shadow: inset 0 0 0 1px var(--green-600, #{$green-600});
410
- }
411
-
412
- &:hover {
413
- @if $feature-button-border {
414
- border-color: $green-800;
415
- background-color: $green-600;
416
- } @else {
417
- @include gl-button-hover-border($green-800);
418
- background-color: $green-600;
419
- }
420
- }
421
-
422
- &:focus {
423
- @if $feature-button-border {
424
- border-color: $green-800;
425
- background-color: $green-600;
426
- } @else {
427
- @include gl-focus($color: $green-800);
428
- @apply gl-bg-green-600;
429
- }
430
- }
431
-
432
- &:active,
433
- &.active {
434
- @apply gl-bg-green-700;
435
-
436
- @if $feature-button-border {
437
- border-color: $green-900;
438
- } @else {
439
- @include gl-focus($color: $green-900);
440
-
441
- &:focus {
442
- @include gl-focus($color: $green-900);
443
- }
444
- }
445
- }
446
- }
447
-
448
- &.btn-success-secondary {
449
- @apply gl-bg-white;
450
- }
451
-
452
- &.btn-success-secondary,
453
- &.btn-success-tertiary {
454
- @apply gl-bg-transparent;
455
- @apply gl-text-green-500;
456
- @apply gl-font-normal;
457
- @if $feature-button-border {
458
- border-color: $green-500;
459
- } @else {
460
- box-shadow: inset 0 0 0 1px var(--green-500, #{$green-500});
461
- }
462
-
463
- &:hover {
464
- @if $feature-button-border {
465
- @apply gl-text-green-700;
466
- border-color: $green-700;
467
- background-color: $green-50;
468
- } @else {
469
- @apply gl-text-green-700;
470
- @include gl-button-hover-border($green-700);
471
- background-color: $green-50;
472
- }
473
- }
474
-
475
- &:focus {
476
- @apply gl-text-green-700;
477
- @if $feature-button-border {
478
- border-color: $green-700;
479
- background-color: $green-50;
480
- } @else {
481
- @include gl-focus($color: $green-700);
482
- @apply gl-bg-green-50;
483
- }
484
- }
485
-
486
- &:active,
487
- &.active {
488
- @apply gl-text-green-900;
489
- @apply gl-bg-green-100;
490
- @if $feature-button-border {
491
- border-color: $green-900;
492
- } @else {
493
- @include gl-focus($color: $green-900);
494
-
495
- &:focus {
496
- @include gl-focus($color: $green-900);
497
- }
498
- }
499
- }
500
- }
501
-
502
396
  &.btn-sm {
503
397
  @apply gl-px-3;
504
398
  @apply gl-leading-normal;
@@ -97,8 +97,6 @@
97
97
  }
98
98
 
99
99
  &.btn-confirm,
100
- &.btn-info,
101
- &.btn-success,
102
100
  &.btn-danger {
103
101
  margin-left: 1px;
104
102
  }
@@ -101,8 +101,6 @@ export const buttonCategoryOptions = {
101
101
  export const buttonVariantOptions = {
102
102
  default: 'default',
103
103
  confirm: 'confirm',
104
- info: 'info (deprecated)',
105
- success: 'success (deprecated)',
106
104
  danger: 'danger',
107
105
  dashed: 'dashed',
108
106
  link: 'link',
@@ -125,7 +123,6 @@ export const dropdownVariantOptions = {
125
123
  default: 'default',
126
124
  confirm: 'confirm',
127
125
  info: 'info (deprecated)',
128
- success: 'success (deprecated)',
129
126
  danger: 'danger',
130
127
  link: 'link',
131
128
  };
@@ -266,7 +263,7 @@ export const modalButtonDefaults = {
266
263
 
267
264
  export const tabsButtonDefaults = {
268
265
  actionPrimary: {
269
- variant: 'success',
266
+ variant: 'confirm',
270
267
  category: 'primary',
271
268
  },
272
269
  actionSecondary: {
@@ -61,7 +61,7 @@ export const emptyMixin = extend({
61
61
 
62
62
  if (!$empty) {
63
63
  $empty = h('div', {
64
- class: ['text-center', 'my-2'],
64
+ class: ['gl-text-center', 'gl-my-3'],
65
65
  domProps: isFiltered
66
66
  ? htmlOrText(emptyFilteredHtml, emptyFilteredText)
67
67
  : htmlOrText(emptyHtml, emptyText)
@@ -118,7 +118,7 @@ export const theadMixin = extend({
118
118
  {
119
119
  // We need to make the header cell relative when we have
120
120
  // a `.sr-only` sort label to work around overflow issues
121
- 'position-relative': sortLabel
121
+ 'gl-relative': sortLabel
122
122
  },
123
123
  this.fieldClasses(field),
124
124
  sortClass
@@ -174,7 +174,9 @@ export const theadMixin = extend({
174
174
  this.normalizeSlot(slotNames, scope) ||
175
175
  h('div', { domProps: htmlOrText(labelHtml, label) })
176
176
 
177
- const $srLabel = sortLabel ? h('span', { staticClass: 'sr-only' }, ` (${sortLabel})`) : null
177
+ const $srLabel = sortLabel
178
+ ? h('span', { staticClass: 'gl-sr-only' }, ` (${sortLabel})`)
179
+ : null
178
180
 
179
181
  // Return the header cell
180
182
  return h(BTh, data, [$content, $srLabel].filter(identity))
@@ -122,7 +122,7 @@ describe('table > sorting', () => {
122
122
  expect(
123
123
  $ths
124
124
  .at(0)
125
- .find('.sr-only')
125
+ .find('.gl-sr-only')
126
126
  .text()
127
127
  ).toContain(wrapper.vm.labelSortDesc)
128
128
 
@@ -133,7 +133,7 @@ describe('table > sorting', () => {
133
133
  expect(
134
134
  $ths
135
135
  .at(1)
136
- .find('.sr-only')
136
+ .find('.gl-sr-only')
137
137
  .text()
138
138
  ).toContain(wrapper.vm.labelSortAsc)
139
139
 
@@ -144,7 +144,7 @@ describe('table > sorting', () => {
144
144
  expect(
145
145
  $ths
146
146
  .at(2)
147
- .find('.sr-only')
147
+ .find('.gl-sr-only')
148
148
  .text()
149
149
  ).toContain(wrapper.vm.labelSortClear)
150
150
 
@@ -172,7 +172,7 @@ describe('table > sorting', () => {
172
172
  expect(
173
173
  $ths
174
174
  .at(0)
175
- .find('.sr-only')
175
+ .find('.gl-sr-only')
176
176
  .text()
177
177
  ).toContain(wrapper.vm.labelSortAsc)
178
178
 
@@ -182,7 +182,7 @@ describe('table > sorting', () => {
182
182
  expect(
183
183
  $ths
184
184
  .at(1)
185
- .find('.sr-only')
185
+ .find('.gl-sr-only')
186
186
  .text()
187
187
  ).toContain(wrapper.vm.labelSortAsc)
188
188
 
@@ -192,7 +192,7 @@ describe('table > sorting', () => {
192
192
  expect(
193
193
  $ths
194
194
  .at(2)
195
- .find('.sr-only')
195
+ .find('.gl-sr-only')
196
196
  .text()
197
197
  ).toContain(wrapper.vm.labelSortClear)
198
198
 
@@ -228,7 +228,7 @@ describe('table > sorting', () => {
228
228
  expect(
229
229
  $ths
230
230
  .at(0)
231
- .find('.sr-only')
231
+ .find('.gl-sr-only')
232
232
  .text()
233
233
  ).toContain(wrapper.vm.labelSortAsc)
234
234
 
@@ -238,7 +238,7 @@ describe('table > sorting', () => {
238
238
  expect(
239
239
  $ths
240
240
  .at(1)
241
- .find('.sr-only')
241
+ .find('.gl-sr-only')
242
242
  .text()
243
243
  ).toContain(wrapper.vm.labelSortAsc)
244
244
 
@@ -248,7 +248,7 @@ describe('table > sorting', () => {
248
248
  expect(
249
249
  $ths
250
250
  .at(2)
251
- .find('.sr-only')
251
+ .find('.gl-sr-only')
252
252
  .exists()
253
253
  ).toBe(false)
254
254
 
@@ -439,7 +439,7 @@ describe('table > sorting', () => {
439
439
  expect(columnA[2]).toBe('2')
440
440
  // Should have aria-* labels
441
441
  expect(wrapper.findAll('tfoot > tr > th[aria-sort]').length).toBe(2)
442
- expect(wrapper.findAll('tfoot > tr > th > .sr-only').length).toBe(2)
442
+ expect(wrapper.findAll('tfoot > tr > th > .gl-sr-only').length).toBe(2)
443
443
 
444
444
  // Sort by first column
445
445
  await wrapper
@@ -463,7 +463,7 @@ describe('table > sorting', () => {
463
463
  expect(columnA[2]).toBe('3')
464
464
  // Should have aria-* labels
465
465
  expect(wrapper.findAll('tfoot > tr > th[aria-sort]').length).toBe(2)
466
- expect(wrapper.findAll('tfoot > tr > th > .sr-only').length).toBe(3)
466
+ expect(wrapper.findAll('tfoot > tr > th > .gl-sr-only').length).toBe(3)
467
467
 
468
468
  // Click first column header again to reverse sort
469
469
  await wrapper
@@ -486,7 +486,7 @@ describe('table > sorting', () => {
486
486
  expect(columnA[2]).toBe('1')
487
487
  // Should have aria-* labels
488
488
  expect(wrapper.findAll('tfoot > tr > th[aria-sort]').length).toBe(2)
489
- expect(wrapper.findAll('tfoot > tr > th > .sr-only').length).toBe(3)
489
+ expect(wrapper.findAll('tfoot > tr > th > .gl-sr-only').length).toBe(3)
490
490
 
491
491
  // Click second column header to sort by it (by using keydown.enter)
492
492
  await wrapper
@@ -529,7 +529,7 @@ describe('table > sorting', () => {
529
529
  expect(columnA[2]).toBe('2')
530
530
  // Should have aria-* labels
531
531
  expect(wrapper.findAll('tfoot > tr > th[aria-sort]').length).toBe(2)
532
- expect(wrapper.findAll('tfoot > tr > th > .sr-only').length).toBe(2)
532
+ expect(wrapper.findAll('tfoot > tr > th > .gl-sr-only').length).toBe(2)
533
533
 
534
534
  wrapper.destroy()
535
535
  })
@@ -567,7 +567,7 @@ describe('table > sorting', () => {
567
567
  expect(columnA[2]).toBe('2')
568
568
  // Shouldn't have aria-* labels
569
569
  expect(wrapper.findAll('tfoot > tr > th[aria-sort]').length).toBe(0)
570
- expect(wrapper.findAll('tfoot > tr > th > .sr-only').length).toBe(0)
570
+ expect(wrapper.findAll('tfoot > tr > th > .gl-sr-only').length).toBe(0)
571
571
 
572
572
  // Click first column
573
573
  await wrapper
@@ -589,7 +589,7 @@ describe('table > sorting', () => {
589
589
  expect(columnA[2]).toBe('2')
590
590
  // Shouldn't have aria-* labels
591
591
  expect(wrapper.findAll('tfoot > tr > th[aria-sort]').length).toBe(0)
592
- expect(wrapper.findAll('tfoot > tr > th > .sr-only').length).toBe(0)
592
+ expect(wrapper.findAll('tfoot > tr > th > .gl-sr-only').length).toBe(0)
593
593
 
594
594
  // Click third column header
595
595
  await wrapper
@@ -611,7 +611,7 @@ describe('table > sorting', () => {
611
611
  expect(columnA[2]).toBe('2')
612
612
  // Shouldn't have aria-* labels
613
613
  expect(wrapper.findAll('tfoot > tr > th[aria-sort]').length).toBe(0)
614
- expect(wrapper.findAll('tfoot > tr > th > .sr-only').length).toBe(0)
614
+ expect(wrapper.findAll('tfoot > tr > th > .gl-sr-only').length).toBe(0)
615
615
 
616
616
  wrapper.destroy()
617
617
  })
@@ -653,7 +653,7 @@ describe('table > sorting', () => {
653
653
  expect(
654
654
  $ths
655
655
  .at(0)
656
- .find('.sr-only')
656
+ .find('.gl-sr-only')
657
657
  .text()
658
658
  ).toContain(wrapper.vm.labelSortDesc)
659
659
 
@@ -663,7 +663,7 @@ describe('table > sorting', () => {
663
663
  expect(
664
664
  $ths
665
665
  .at(1)
666
- .find('.sr-only')
666
+ .find('.gl-sr-only')
667
667
  .text()
668
668
  ).toContain(wrapper.vm.labelSortDesc)
669
669
 
@@ -673,7 +673,7 @@ describe('table > sorting', () => {
673
673
  expect(
674
674
  $ths
675
675
  .at(2)
676
- .find('.sr-only')
676
+ .find('.gl-sr-only')
677
677
  .exists()
678
678
  ).toBe(false)
679
679
 
@@ -704,7 +704,7 @@ describe('table > sorting', () => {
704
704
  expect(
705
705
  $ths
706
706
  .at(0)
707
- .find('.sr-only')
707
+ .find('.gl-sr-only')
708
708
  .text()
709
709
  ).toContain(wrapper.vm.labelSortAsc)
710
710
 
@@ -714,7 +714,7 @@ describe('table > sorting', () => {
714
714
  expect(
715
715
  $ths
716
716
  .at(1)
717
- .find('.sr-only')
717
+ .find('.gl-sr-only')
718
718
  .text()
719
719
  ).toContain(wrapper.vm.labelSortDesc)
720
720
 
@@ -724,7 +724,7 @@ describe('table > sorting', () => {
724
724
  expect(
725
725
  $ths
726
726
  .at(2)
727
- .find('.sr-only')
727
+ .find('.gl-sr-only')
728
728
  .text()
729
729
  ).toContain(wrapper.vm.labelSortClear)
730
730