@gitlab/ui 55.0.1 → 55.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "55.0.1",
3
+ "version": "55.2.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -33,9 +33,10 @@ describe('Filtered search token', () => {
33
33
  cursorPosition: 'end',
34
34
  };
35
35
 
36
- const createComponent = (props) => {
36
+ const createComponent = (props, options = {}) => {
37
37
  wrapper = shallowMount(GlFilteredSearchToken, {
38
38
  propsData: { ...defaultProps, ...props },
39
+ ...options,
39
40
  });
40
41
  };
41
42
 
@@ -372,4 +373,22 @@ describe('Filtered search token', () => {
372
373
  }
373
374
  );
374
375
  });
376
+
377
+ it('renders title options passed via slot', async () => {
378
+ createComponent(
379
+ {},
380
+ {
381
+ slots: {
382
+ 'title-option': '<div>new title</div>',
383
+ },
384
+ stubs: {
385
+ GlFilteredSearchTokenSegment: {
386
+ template: `<div><slot name="option" v-bind='{ option: { value: "default title"} }'></slot></div>`,
387
+ },
388
+ },
389
+ }
390
+ );
391
+
392
+ expect(findTitleSegment().text()).toBe('new title');
393
+ });
375
394
  });
@@ -303,6 +303,10 @@ export default {
303
303
  this.$emit('destroy');
304
304
  }
305
305
  },
306
+
307
+ hasTitleOptionSlot() {
308
+ return Boolean(this.$scopedSlots['title-option']);
309
+ },
306
310
  },
307
311
  };
308
312
  </script>
@@ -346,6 +350,9 @@ export default {
346
350
  {{ inputValue }}
347
351
  </gl-token>
348
352
  </template>
353
+ <template v-if="hasTitleOptionSlot()" #option>
354
+ <slot name="title-option"></slot>
355
+ </template>
349
356
  </gl-filtered-search-token-segment>
350
357
 
351
358
  <gl-filtered-search-token-segment
@@ -1,6 +1,6 @@
1
1
  <!-- eslint-disable vue/multi-word-component-names -->
2
2
  <script>
3
- import { clamp, uniqueId } from 'lodash';
3
+ import { clamp, uniqueId, isNil } from 'lodash';
4
4
  import { stopEvent } from '../../../../utils/utils';
5
5
  import {
6
6
  GL_DROPDOWN_SHOWN,
@@ -358,7 +358,7 @@ export default {
358
358
  }
359
359
  this.selectedValues = [...newSelected];
360
360
  } else {
361
- this.selectedValues = [newSelected];
361
+ this.selectedValues = isNil(newSelected) ? [] : [newSelected];
362
362
  }
363
363
  },
364
364
  },
@@ -24,11 +24,28 @@
24
24
  @include gl-display-inline-flex;
25
25
 
26
26
  &.is-disabled {
27
- @include gl-opacity-4;
28
27
  @include gl-cursor-not-allowed;
29
28
 
30
29
  .gl-toggle {
31
30
  @include gl-cursor-not-allowed;
31
+ @include gl-bg-gray-200;
32
+
33
+ .toggle-icon > svg {
34
+ @include gl-fill-gray-200;
35
+ }
36
+ }
37
+
38
+ .gl-toggle.is-checked {
39
+ @include gl-bg-blue-200;
40
+
41
+ .toggle-icon > svg {
42
+ @include gl-fill-blue-200;
43
+ }
44
+ }
45
+
46
+ .gl-toggle-label,
47
+ .gl-help-label {
48
+ @include gl-text-gray-500;
32
49
  }
33
50
  }
34
51
  }
@@ -66,7 +83,7 @@
66
83
  @include gl-justify-content-center;
67
84
  @include gl-border-0;
68
85
  @include gl-cursor-pointer;
69
- @include gl-bg-gray-400;
86
+ @include gl-bg-gray-600;
70
87
  @include gl-p-1;
71
88
  @include gl-relative;
72
89
  @include gl-w-9;
@@ -83,6 +100,13 @@
83
100
  @include gl-bg-none;
84
101
  }
85
102
 
103
+ &:hover,
104
+ &:active,
105
+ &:focus,
106
+ &:focus:active {
107
+ @include gl-bg-gray-700;
108
+ }
109
+
86
110
  &:active,
87
111
  &:focus,
88
112
  &:focus:active {
@@ -116,6 +140,13 @@
116
140
  &.is-checked {
117
141
  @include gl-bg-blue-500;
118
142
 
143
+ &:hover,
144
+ &:active,
145
+ &:focus,
146
+ &:focus:active {
147
+ @include gl-bg-blue-600;
148
+ }
149
+
119
150
  .toggle-icon {
120
151
  transform: translateX($gl-spacing-scale-6);
121
152
 
@@ -7336,6 +7336,14 @@
7336
7336
  fill: currentColor !important
7337
7337
  }
7338
7338
 
7339
+ .gl-fill-blue-200 {
7340
+ fill: $blue-200
7341
+ }
7342
+
7343
+ .gl-fill-blue-200\! {
7344
+ fill: $blue-200 !important
7345
+ }
7346
+
7339
7347
  .gl-fill-blue-500 {
7340
7348
  fill: $blue-500
7341
7349
  }
@@ -7400,6 +7408,14 @@
7400
7408
  stroke: transparent !important
7401
7409
  }
7402
7410
 
7411
+ .gl-fill-gray-200 {
7412
+ fill: $gray-200
7413
+ }
7414
+
7415
+ .gl-fill-gray-200\! {
7416
+ fill: $gray-200 !important
7417
+ }
7418
+
7403
7419
  .gl-fill-gray-400 {
7404
7420
  fill: $gray-400
7405
7421
  }
@@ -10,6 +10,10 @@
10
10
  fill: currentColor;
11
11
  }
12
12
 
13
+ @mixin gl-fill-blue-200 {
14
+ fill: $blue-200;
15
+ }
16
+
13
17
  @mixin gl-fill-blue-500 {
14
18
  fill: $blue-500;
15
19
  }
@@ -42,6 +46,10 @@
42
46
  stroke: transparent;
43
47
  }
44
48
 
49
+ @mixin gl-fill-gray-200 {
50
+ fill: $gray-200;
51
+ }
52
+
45
53
  @mixin gl-fill-gray-400 {
46
54
  fill: $gray-400;
47
55
  }