@gitlab/ui 42.0.0 → 42.2.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.
@@ -222,7 +222,8 @@ const keyboard = {
222
222
  right: 'Right',
223
223
  arrowRight: 'ArrowRight',
224
224
  home: 'Home',
225
- end: 'End'
225
+ end: 'End',
226
+ tab: 'Tab'
226
227
  };
227
228
  const truncateOptions = POSITION;
228
229
  const formInputSizes = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "42.0.0",
3
+ "version": "42.2.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -83,7 +83,7 @@
83
83
  "@babel/preset-env": "^7.10.2",
84
84
  "@gitlab/eslint-plugin": "12.3.0",
85
85
  "@gitlab/stylelint-config": "4.1.0",
86
- "@gitlab/svgs": "2.20.0",
86
+ "@gitlab/svgs": "2.21.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",
@@ -103,4 +103,19 @@ describe('GlAccordionItem', () => {
103
103
  expect(findButton().props('icon')).toBe('chevron-down');
104
104
  expect(findCollapse().props('visible')).toBe(true);
105
105
  });
106
+
107
+ it('emits the initial visible state', () => {
108
+ createComponent({ visible: true });
109
+
110
+ expect(wrapper.emitted('input')).toEqual([[true]]);
111
+ });
112
+
113
+ it('emits the visible state when toggled', async () => {
114
+ createComponent({ visible: true });
115
+
116
+ await waitForAnimationFrame();
117
+ await findButton().trigger('click');
118
+
119
+ expect(wrapper.emitted('input')).toEqual([[true], [false]]);
120
+ });
106
121
  });
@@ -15,6 +15,10 @@ export default {
15
15
  },
16
16
  inject: ['accordionSetId', 'defaultHeaderLevel'],
17
17
  inheritAttrs: false,
18
+ model: {
19
+ prop: 'visible',
20
+ event: 'input',
21
+ },
18
22
  props: {
19
23
  /*
20
24
  Used to set the title of accordion link
@@ -72,6 +76,14 @@ When set, it will ensure the accordion item is initially visible
72
76
  return this.isVisible && this.titleVisible ? this.titleVisible : this.title;
73
77
  },
74
78
  },
79
+ watch: {
80
+ isVisible: {
81
+ immediate: true,
82
+ handler(isVisible) {
83
+ this.$emit('input', isVisible);
84
+ },
85
+ },
86
+ },
75
87
  };
76
88
  </script>
77
89
 
@@ -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;
@@ -264,6 +264,7 @@ export const keyboard = {
264
264
  arrowRight: 'ArrowRight',
265
265
  home: 'Home',
266
266
  end: 'End',
267
+ tab: 'Tab',
267
268
  };
268
269
 
269
270
  export const truncateOptions = POSITION;