@gitlab/ui 42.1.0 → 42.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "42.1.0",
3
+ "version": "42.3.1",
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",
@@ -89,7 +89,7 @@ export const purple700 = '#5943b6'
89
89
  export const purple800 = '#453894'
90
90
  export const purple900 = '#2f2a6b'
91
91
  export const purple950 = '#232150'
92
- export const gray10 = '#fafafa'
92
+ export const gray10 = '#f5f5f5'
93
93
  export const gray50 = '#f0f0f0'
94
94
  export const gray100 = '#dbdbdb'
95
95
  export const gray200 = '#bfbfbf'
@@ -342,7 +342,7 @@ export const spacer = '0.5rem'
342
342
  export const spacers = '(1: 0.25rem, 2: 0.5rem, 3: 1rem, 4: 1.5rem, 5: 2rem, 6: 2.5rem, 7: 3rem, 8: 3.5rem, 9: 4rem)'
343
343
  export const tableAccentBg = '#f0f0f0'
344
344
  export const cardBorderColor = '#dbdbdb'
345
- export const cardCapBg = '#fafafa'
345
+ export const cardCapBg = '#f5f5f5'
346
346
  export const glFormInputSizes = '(xs: 5rem, sm: 10rem, md: 15rem, lg: 20rem, xl: 35rem)'
347
347
  export const popoverBg = '#fff'
348
348
  export const popoverArrowWidth = '0.5rem'
@@ -484,8 +484,8 @@
484
484
  },
485
485
  {
486
486
  "name": "$gray-10",
487
- "value": "#fafafa",
488
- "compiledValue": "#fafafa"
487
+ "value": "#f5f5f5",
488
+ "compiledValue": "#f5f5f5"
489
489
  },
490
490
  {
491
491
  "name": "$gray-50",
@@ -1795,7 +1795,7 @@
1795
1795
  {
1796
1796
  "name": "$card-cap-bg",
1797
1797
  "value": "$gray-10",
1798
- "compiledValue": "#fafafa"
1798
+ "compiledValue": "#f5f5f5"
1799
1799
  },
1800
1800
  {
1801
1801
  "name": "$gl-form-input-sizes",
@@ -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
 
@@ -257,7 +257,7 @@ describe('GlTokenContainer', () => {
257
257
  expect(expectedFocusedToken.element).toHaveFocus();
258
258
  });
259
259
 
260
- it('emits the `cancel-focus` event when tab key is pressed', async () => {
260
+ it('emits the `cancel-focus` event when tab key is pressed without modifiers', async () => {
261
261
  createComponent({});
262
262
 
263
263
  const focusedToken = findTokenByName(tokens[0].name);
@@ -267,6 +267,17 @@ describe('GlTokenContainer', () => {
267
267
 
268
268
  expect(wrapper.emitted('cancel-focus')).toEqual([[]]);
269
269
  });
270
+
271
+ it('does not emit the `cancel-focus` event when tab key is pressed with modifiers', async () => {
272
+ createComponent({});
273
+
274
+ const focusedToken = findTokenByName(tokens[0].name);
275
+
276
+ await focusedToken.trigger('focus');
277
+ await focusedToken.trigger('keydown', { key: keyboard.tab, shiftKey: true });
278
+
279
+ expect(wrapper.emitted('cancel-focus')).toBeUndefined();
280
+ });
270
281
  });
271
282
  });
272
283
  });
@@ -135,7 +135,7 @@ export default {
135
135
  @keydown.end="handleEnd"
136
136
  @keydown.delete="handleDelete"
137
137
  @keydown.esc="handleEscape"
138
- @keydown.tab.prevent="handleTab"
138
+ @keydown.tab.exact.prevent="handleTab"
139
139
  >
140
140
  <div
141
141
  v-for="(token, index) in tokens"
@@ -136,7 +136,7 @@ Before After (reflected below)
136
136
  * Passes 4.5:1 contrast ratio on $gray-10
137
137
  */
138
138
 
139
- $gray-10: #fafafa !default;
139
+ $gray-10: #f5f5f5 !default;
140
140
  $gray-50: #f0f0f0 !default;
141
141
  $gray-100: #dbdbdb !default;
142
142
  $gray-200: #bfbfbf !default;