@gitlab/ui 41.10.0 → 42.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.
@@ -80,7 +80,6 @@ const buttonVariantOptions = {
80
80
  confirm: 'confirm',
81
81
  info: 'info (deprecated)',
82
82
  success: 'success (deprecated)',
83
- warning: 'warning (deprecated)',
84
83
  danger: 'danger',
85
84
  dashed: 'dashed',
86
85
  link: 'link',
@@ -103,7 +102,6 @@ const dropdownVariantOptions = {
103
102
  confirm: 'confirm',
104
103
  info: 'info (deprecated)',
105
104
  success: 'success (deprecated)',
106
- warning: 'warning (deprecated)',
107
105
  danger: 'danger',
108
106
  link: 'link'
109
107
  };
@@ -224,7 +222,8 @@ const keyboard = {
224
222
  right: 'Right',
225
223
  arrowRight: 'ArrowRight',
226
224
  home: 'Home',
227
- end: 'End'
225
+ end: 'End',
226
+ tab: 'Tab'
228
227
  };
229
228
  const truncateOptions = POSITION;
230
229
  const formInputSizes = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "41.10.0",
3
+ "version": "42.1.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -82,8 +82,8 @@
82
82
  "@babel/core": "^7.10.2",
83
83
  "@babel/preset-env": "^7.10.2",
84
84
  "@gitlab/eslint-plugin": "12.3.0",
85
- "@gitlab/stylelint-config": "4.0.0",
86
- "@gitlab/svgs": "2.19.0",
85
+ "@gitlab/stylelint-config": "4.1.0",
86
+ "@gitlab/svgs": "2.20.0",
87
87
  "@rollup/plugin-commonjs": "^11.1.0",
88
88
  "@rollup/plugin-node-resolve": "^7.1.3",
89
89
  "@rollup/plugin-replace": "^2.3.2",
@@ -122,7 +122,7 @@
122
122
  "npm-run-all": "^4.1.5",
123
123
  "pikaday": "^1.8.0",
124
124
  "plop": "^2.5.4",
125
- "postcss": "8.4.12",
125
+ "postcss": "8.4.14",
126
126
  "postcss-loader": "^3.0.0",
127
127
  "postcss-scss": "4.0.4",
128
128
  "prettier": "2.6.2",
@@ -140,7 +140,7 @@
140
140
  "sass-true": "^5.0.0",
141
141
  "start-server-and-test": "^1.10.6",
142
142
  "storybook-dark-mode": "^1.0.8",
143
- "stylelint": "14.3.0",
143
+ "stylelint": "14.9.1",
144
144
  "stylelint-config-prettier": "9.0.3",
145
145
  "stylelint-prettier": "2.0.0",
146
146
  "vue": "2.6.11",
@@ -135,8 +135,7 @@
135
135
  &.btn-confirm,
136
136
  &.btn-info,
137
137
  &.btn-success,
138
- &.btn-danger,
139
- &.btn-warning {
138
+ &.btn-danger {
140
139
  @include gl-text-contrast-light;
141
140
  }
142
141
 
@@ -251,60 +250,6 @@
251
250
  }
252
251
  }
253
252
 
254
- &.btn-warning {
255
- @include gl-bg-orange-500;
256
- @include gl-inset-border-1-orange-600;
257
-
258
- &:hover {
259
- @include gl-tmp-button-hover($orange-800, $orange-600);
260
- }
261
-
262
- &:focus {
263
- @include gl-focus($color: $orange-800);
264
- @include gl-bg-orange-600;
265
- }
266
-
267
- &:active,
268
- &.active {
269
- @include gl-focus($color: $orange-900);
270
- @include gl-bg-orange-700;
271
-
272
- &:focus {
273
- @include gl-focus($color: $orange-900);
274
- }
275
- }
276
- }
277
-
278
- &.btn-warning-secondary,
279
- &.btn-warning-tertiary {
280
- @include gl-bg-transparent;
281
- @include gl-text-orange-500;
282
- @include gl-font-weight-normal;
283
- @include gl-inset-border-1-orange-500;
284
-
285
- &:hover {
286
- @include gl-text-orange-700;
287
- @include gl-tmp-button-hover($orange-700, $orange-50);
288
- }
289
-
290
- &:focus {
291
- @include gl-text-orange-700;
292
- @include gl-focus($color: $orange-700);
293
- @include gl-bg-orange-50;
294
- }
295
-
296
- &:active,
297
- &.active {
298
- @include gl-text-orange-900;
299
- @include gl-focus($color: $orange-900);
300
- @include gl-bg-orange-100;
301
-
302
- &:focus {
303
- @include gl-focus($color: $orange-900);
304
- }
305
- }
306
- }
307
-
308
253
  &.btn-danger {
309
254
  @include gl-bg-red-500;
310
255
  @include gl-inset-border-1-red-600;
@@ -364,8 +309,7 @@
364
309
  &.btn-confirm,
365
310
  &.btn-info,
366
311
  &.btn-success,
367
- &.btn-danger,
368
- &.btn-warning {
312
+ &.btn-danger {
369
313
  &-secondary {
370
314
  @include gl-bg-white;
371
315
  }
@@ -376,8 +320,7 @@
376
320
  &.btn-confirm,
377
321
  &.btn-info,
378
322
  &.btn-success,
379
- &.btn-danger,
380
- &.btn-warning {
323
+ &.btn-danger {
381
324
  &-tertiary {
382
325
  @include gl-shadow-none;
383
326
  mix-blend-mode: multiply;
@@ -99,9 +99,6 @@ describe('button component', () => {
99
99
  ${'success'} | ${'primary'} | ${'btn-success'}
100
100
  ${'success'} | ${'secondary'} | ${'btn-success-secondary'}
101
101
  ${'success'} | ${'tertiary'} | ${'btn-success-tertiary'}
102
- ${'warning'} | ${'primary'} | ${'btn-warning'}
103
- ${'warning'} | ${'secondary'} | ${'btn-warning-secondary'}
104
- ${'warning'} | ${'tertiary'} | ${'btn-warning-tertiary'}
105
102
  ${'danger'} | ${'primary'} | ${'btn-danger'}
106
103
  ${'danger'} | ${'secondary'} | ${'btn-danger-secondary'}
107
104
  ${'danger'} | ${'tertiary'} | ${'btn-danger-tertiary'}
@@ -108,8 +108,7 @@
108
108
  &.btn-confirm,
109
109
  &.btn-info,
110
110
  &.btn-success,
111
- &.btn-danger,
112
- &.btn-warning {
111
+ &.btn-danger {
113
112
  margin-left: 1px;
114
113
  }
115
114
 
@@ -256,6 +256,17 @@ describe('GlTokenContainer', () => {
256
256
  const expectedFocusedToken = findTokenByName(tokens[2].name);
257
257
  expect(expectedFocusedToken.element).toHaveFocus();
258
258
  });
259
+
260
+ it('emits the `cancel-focus` event when tab key is pressed', async () => {
261
+ createComponent({});
262
+
263
+ const focusedToken = findTokenByName(tokens[0].name);
264
+
265
+ await focusedToken.trigger('focus');
266
+ await focusedToken.trigger('keydown', { key: keyboard.tab });
267
+
268
+ expect(wrapper.emitted('cancel-focus')).toEqual([[]]);
269
+ });
259
270
  });
260
271
  });
261
272
  });
@@ -95,6 +95,9 @@ export default {
95
95
  this.focusedTokenIndex = null;
96
96
  this.$emit('cancel-focus');
97
97
  },
98
+ handleTab() {
99
+ this.$emit('cancel-focus');
100
+ },
98
101
  // Only called when a token is focused by a click/tap
99
102
  handleTokenFocus(index) {
100
103
  this.focusedTokenIndex = index;
@@ -132,7 +135,7 @@ export default {
132
135
  @keydown.end="handleEnd"
133
136
  @keydown.delete="handleDelete"
134
137
  @keydown.esc="handleEscape"
135
- @keydown.prevent
138
+ @keydown.tab.prevent="handleTab"
136
139
  >
137
140
  <div
138
141
  v-for="(token, index) in tokens"
@@ -4687,6 +4687,30 @@
4687
4687
  }
4688
4688
  }
4689
4689
 
4690
+ .gl-lg-w-30p {
4691
+ @include gl-media-breakpoint-up(lg) {
4692
+ width: 30%;
4693
+ }
4694
+ }
4695
+
4696
+ .gl-lg-w-30p\! {
4697
+ @include gl-media-breakpoint-up(lg) {
4698
+ width: 30% !important;
4699
+ }
4700
+ }
4701
+
4702
+ .gl-lg-w-40p {
4703
+ @include gl-media-breakpoint-up(lg) {
4704
+ width: 40%;
4705
+ }
4706
+ }
4707
+
4708
+ .gl-lg-w-40p\! {
4709
+ @include gl-media-breakpoint-up(lg) {
4710
+ width: 40% !important;
4711
+ }
4712
+ }
4713
+
4690
4714
  .gl-lg-w-50p {
4691
4715
  @include gl-media-breakpoint-up(lg) {
4692
4716
  width: 50%;
@@ -6280,6 +6304,26 @@
6280
6304
  margin-right: $gl-spacing-scale-3 !important;
6281
6305
  }
6282
6306
  }
6307
+ .gl-lg-mr-10 {
6308
+ @include gl-media-breakpoint-up(lg) {
6309
+ margin-right: $gl-spacing-scale-10;
6310
+ }
6311
+ }
6312
+ .gl-lg-mr-10\! {
6313
+ @include gl-media-breakpoint-up(lg) {
6314
+ margin-right: $gl-spacing-scale-10 !important;
6315
+ }
6316
+ }
6317
+ .gl-lg-mr-12 {
6318
+ @include gl-media-breakpoint-up(lg) {
6319
+ margin-right: $gl-spacing-scale-12;
6320
+ }
6321
+ }
6322
+ .gl-lg-mr-12\! {
6323
+ @include gl-media-breakpoint-up(lg) {
6324
+ margin-right: $gl-spacing-scale-12 !important;
6325
+ }
6326
+ }
6283
6327
  .gl-lg-ml-2 {
6284
6328
  @include gl-media-breakpoint-up(lg) {
6285
6329
  margin-left: $gl-spacing-scale-2;
@@ -6300,6 +6344,26 @@
6300
6344
  margin-left: $gl-spacing-scale-3 !important;
6301
6345
  }
6302
6346
  }
6347
+ .gl-lg-ml-10 {
6348
+ @include gl-media-breakpoint-up(lg) {
6349
+ margin-left: $gl-spacing-scale-10;
6350
+ }
6351
+ }
6352
+ .gl-lg-ml-10\! {
6353
+ @include gl-media-breakpoint-up(lg) {
6354
+ margin-left: $gl-spacing-scale-10 !important;
6355
+ }
6356
+ }
6357
+ .gl-lg-ml-12 {
6358
+ @include gl-media-breakpoint-up(lg) {
6359
+ margin-left: $gl-spacing-scale-12;
6360
+ }
6361
+ }
6362
+ .gl-lg-ml-12\! {
6363
+ @include gl-media-breakpoint-up(lg) {
6364
+ margin-left: $gl-spacing-scale-12 !important;
6365
+ }
6366
+ }
6303
6367
  .gl-lg-mx-2 {
6304
6368
  @include gl-media-breakpoint-up(lg) {
6305
6369
  margin-left: $gl-spacing-scale-2;
@@ -6324,6 +6388,18 @@
6324
6388
  margin-right: $gl-spacing-scale-3 !important;
6325
6389
  }
6326
6390
  }
6391
+ .gl-lg-mx-12 {
6392
+ @include gl-media-breakpoint-up(lg) {
6393
+ margin-left: $gl-spacing-scale-12;
6394
+ margin-right: $gl-spacing-scale-12;
6395
+ }
6396
+ }
6397
+ .gl-lg-mx-12\! {
6398
+ @include gl-media-breakpoint-up(lg) {
6399
+ margin-left: $gl-spacing-scale-12 !important;
6400
+ margin-right: $gl-spacing-scale-12 !important;
6401
+ }
6402
+ }
6327
6403
  .gl-lg-my-5 {
6328
6404
  @include gl-media-breakpoint-up(lg) {
6329
6405
  margin-top: $gl-spacing-scale-5;
@@ -276,6 +276,18 @@
276
276
  }
277
277
  }
278
278
 
279
+ @mixin gl-lg-w-30p {
280
+ @include gl-media-breakpoint-up(lg) {
281
+ width: 30%;
282
+ }
283
+ }
284
+
285
+ @mixin gl-lg-w-40p {
286
+ @include gl-media-breakpoint-up(lg) {
287
+ width: 40%;
288
+ }
289
+ }
290
+
279
291
  @mixin gl-lg-w-50p {
280
292
  @include gl-media-breakpoint-up(lg) {
281
293
  width: 50%;
@@ -889,6 +889,18 @@
889
889
  }
890
890
  }
891
891
 
892
+ @mixin gl-lg-mr-10 {
893
+ @include gl-media-breakpoint-up(lg) {
894
+ margin-right: $gl-spacing-scale-10;
895
+ }
896
+ }
897
+
898
+ @mixin gl-lg-mr-12 {
899
+ @include gl-media-breakpoint-up(lg) {
900
+ margin-right: $gl-spacing-scale-12;
901
+ }
902
+ }
903
+
892
904
  @mixin gl-lg-ml-2 {
893
905
  @include gl-media-breakpoint-up(lg) {
894
906
  @include gl-ml-2;
@@ -901,6 +913,18 @@
901
913
  }
902
914
  }
903
915
 
916
+ @mixin gl-lg-ml-10 {
917
+ @include gl-media-breakpoint-up(lg) {
918
+ margin-left: $gl-spacing-scale-10;
919
+ }
920
+ }
921
+
922
+ @mixin gl-lg-ml-12 {
923
+ @include gl-media-breakpoint-up(lg) {
924
+ margin-left: $gl-spacing-scale-12;
925
+ }
926
+ }
927
+
904
928
  @mixin gl-lg-mx-2 {
905
929
  @include gl-media-breakpoint-up(lg) {
906
930
  @include gl-mx-2;
@@ -913,6 +937,13 @@
913
937
  }
914
938
  }
915
939
 
940
+ @mixin gl-lg-mx-12 {
941
+ @include gl-media-breakpoint-up(lg) {
942
+ margin-left: $gl-spacing-scale-12;
943
+ margin-right: $gl-spacing-scale-12;
944
+ }
945
+ }
946
+
916
947
  @mixin gl-lg-my-5 {
917
948
  @include gl-media-breakpoint-up(lg) {
918
949
  @include gl-my-5;
@@ -97,7 +97,6 @@ export const buttonVariantOptions = {
97
97
  confirm: 'confirm',
98
98
  info: 'info (deprecated)',
99
99
  success: 'success (deprecated)',
100
- warning: 'warning (deprecated)',
101
100
  danger: 'danger',
102
101
  dashed: 'dashed',
103
102
  link: 'link',
@@ -121,7 +120,6 @@ export const dropdownVariantOptions = {
121
120
  confirm: 'confirm',
122
121
  info: 'info (deprecated)',
123
122
  success: 'success (deprecated)',
124
- warning: 'warning (deprecated)',
125
123
  danger: 'danger',
126
124
  link: 'link',
127
125
  };
@@ -266,6 +264,7 @@ export const keyboard = {
266
264
  arrowRight: 'ArrowRight',
267
265
  home: 'Home',
268
266
  end: 'End',
267
+ tab: 'Tab',
269
268
  };
270
269
 
271
270
  export const truncateOptions = POSITION;