@gitlab/ui 42.18.1 → 42.21.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.
Files changed (36) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/components/base/alert/alert.js +1 -0
  3. package/dist/components/base/badge/badge.js +1 -0
  4. package/dist/components/base/button/button.js +2 -0
  5. package/dist/components/base/drawer/drawer.js +1 -0
  6. package/dist/components/base/dropdown/dropdown.js +1 -0
  7. package/dist/components/base/filtered_search/filtered_search_token_segment.js +1 -0
  8. package/dist/components/base/form/form_group/form_group.js +1 -0
  9. package/dist/components/base/modal/modal.js +4 -1
  10. package/dist/components/base/toggle/toggle.js +1 -0
  11. package/dist/index.css +1 -1
  12. package/dist/index.css.map +1 -1
  13. package/dist/utility_classes.css +1 -1
  14. package/dist/utility_classes.css.map +1 -1
  15. package/package.json +4 -4
  16. package/scss_to_js/scss_variables.js +1 -0
  17. package/scss_to_js/scss_variables.json +12 -0
  18. package/src/components/base/alert/alert.vue +1 -0
  19. package/src/components/base/badge/badge.vue +1 -0
  20. package/src/components/base/button/button.vue +2 -0
  21. package/src/components/base/carousel/carousel.vue +1 -0
  22. package/src/components/base/carousel/carousel_slide.vue +1 -0
  23. package/src/components/base/drawer/drawer.vue +1 -0
  24. package/src/components/base/dropdown/dropdown.vue +1 -0
  25. package/src/components/base/filtered_search/filtered_search_token_segment.vue +1 -0
  26. package/src/components/base/form/form_group/form_group.vue +2 -0
  27. package/src/components/base/form/form_select/form_select.scss +5 -3
  28. package/src/components/base/form/form_select/form_select.vue +1 -0
  29. package/src/components/base/modal/modal.vue +3 -0
  30. package/src/components/base/tabs/tab/tab.vue +1 -0
  31. package/src/components/base/tabs/tabs/scrollable_tabs.vue +1 -0
  32. package/src/components/base/tabs/tabs/tabs.vue +1 -0
  33. package/src/components/base/toggle/toggle.vue +1 -0
  34. package/src/scss/utilities.scss +8 -0
  35. package/src/scss/utility-mixins/display.scss +4 -0
  36. package/src/scss/variables.scss +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "42.18.1",
3
+ "version": "42.21.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -81,9 +81,9 @@
81
81
  "@arkweid/lefthook": "0.7.7",
82
82
  "@babel/core": "^7.10.2",
83
83
  "@babel/preset-env": "^7.10.2",
84
- "@gitlab/eslint-plugin": "13.0.0",
84
+ "@gitlab/eslint-plugin": "13.1.0",
85
85
  "@gitlab/stylelint-config": "4.1.0",
86
- "@gitlab/svgs": "2.26.0",
86
+ "@gitlab/svgs": "2.27.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",
@@ -108,7 +108,7 @@
108
108
  "eslint": "8.19.0",
109
109
  "eslint-import-resolver-jest": "3.0.2",
110
110
  "eslint-plugin-cypress": "2.12.1",
111
- "eslint-plugin-storybook": "0.6.0",
111
+ "eslint-plugin-storybook": "0.6.1",
112
112
  "file-loader": "^4.2.0",
113
113
  "glob": "^7.2.0",
114
114
  "identity-obj-proxy": "^3.0.0",
@@ -308,6 +308,7 @@ export const chartTooltipMaxWidth = '32rem'
308
308
  export const glIconChevronLeft = '#{'data:image/svg+xml}'
309
309
  export const glIconChevronRight = '#{'data:image/svg+xml}'
310
310
  export const glIconChevronDown = '#{'data:image/svg+xml}'
311
+ export const glIconSelectChevronDown = 'data'
311
312
  export const defaultIconSize = '1rem'
312
313
  export const glIconSizes = '8 12 14 16 24 32 48 72'
313
314
  export const glDropdownWidth = '15rem'
@@ -1622,6 +1622,18 @@
1622
1622
  ],
1623
1623
  "compiledValue": "#{'data:image/svg+xml}"
1624
1624
  },
1625
+ {
1626
+ "name": "$gl-icon-select-chevron-down",
1627
+ "value": "data:image/svg+xml,%3Csvg width=\"8\" height=\"5\" viewBox=\"0 0 8 5\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cpath fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M0.21967 0.21967C0.512563 -0.0732232 0.987437 -0.0732232 1.28033 0.21967L4 2.93934L6.71967 0.21967C7.01256 -0.073223 7.48744 -0.0732229 7.78033 0.21967C8.07322 0.512563 8.07322 0.987437 7.78033 1.28033L4.53033 4.53033C4.23744 4.82322 3.76256 4.82322 3.46967 4.53033L0.21967 1.28033C-0.0732233 0.987437 -0.0732233 0.512563 0.21967 0.21967Z\" fill=\"%23666666\"/%3E%3C/svg%3E%0A",
1628
+ "mapValue": [
1629
+ {
1630
+ "name": "data",
1631
+ "value": "image",
1632
+ "compiledValue": "image"
1633
+ }
1634
+ ],
1635
+ "compiledValue": "data"
1636
+ },
1625
1637
  {
1626
1638
  "name": "$default-icon-size",
1627
1639
  "value": "px-to-rem(16px)",
@@ -94,6 +94,7 @@ export default {
94
94
  return alertVariantIconMap[this.variant];
95
95
  },
96
96
  shouldRenderActions() {
97
+ // eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
97
98
  return Boolean(this.$slots.actions || this.actionButtons.length);
98
99
  },
99
100
  actionButtons() {
@@ -44,6 +44,7 @@ export default {
44
44
  },
45
45
  computed: {
46
46
  hasIconOnly() {
47
+ // eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
47
48
  return Boolean(this.icon && Object.keys(this.$slots).length === 0);
48
49
  },
49
50
  role() {
@@ -74,6 +74,7 @@ export default {
74
74
  return this.icon !== '';
75
75
  },
76
76
  hasIconOnly() {
77
+ // eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
77
78
  return Object.keys(this.$slots).length === 0 && this.hasIcon;
78
79
  },
79
80
  isButtonDisabled() {
@@ -111,6 +112,7 @@ export default {
111
112
  },
112
113
  },
113
114
  mounted() {
115
+ // eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
114
116
  if (!this.$slots.default && !this.$attrs['aria-label'] && !this.$props.label) {
115
117
  logWarning('[gl-button]: Accessible name missing. Please add inner text or aria-label.');
116
118
  }
@@ -10,6 +10,7 @@ export default {
10
10
  </script>
11
11
  <template>
12
12
  <b-carousel v-bind="$attrs" v-on="$listeners">
13
+ <!-- eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots -->
13
14
  <template v-for="slot in Object.keys($slots)" #[slot]>
14
15
  <slot :name="slot"></slot>
15
16
  </template>
@@ -9,6 +9,7 @@ export default {
9
9
  </script>
10
10
  <template>
11
11
  <b-carousel-slide v-bind="$attrs" v-on="$listeners">
12
+ <!-- eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots -->
12
13
  <template v-for="slot in Object.keys($slots)" #[slot]>
13
14
  <slot :name="slot"></slot>
14
15
  </template>
@@ -57,6 +57,7 @@ export default {
57
57
  };
58
58
  },
59
59
  shouldRenderFooter() {
60
+ // eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
60
61
  return Boolean(this.$slots.footer);
61
62
  },
62
63
  variantClass() {
@@ -202,6 +202,7 @@ export default {
202
202
  },
203
203
  methods: {
204
204
  hasSlotContents(slotName) {
205
+ // eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
205
206
  return Boolean(this.$slots[slotName]);
206
207
  },
207
208
  show(...args) {
@@ -118,6 +118,7 @@ export default {
118
118
  },
119
119
 
120
120
  hasOptionsOrSuggestions() {
121
+ // eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
121
122
  return this.options?.length || this.$slots.suggestions;
122
123
  },
123
124
 
@@ -48,6 +48,7 @@ export default {
48
48
  return defaultClass;
49
49
  },
50
50
  hasLabelDescription() {
51
+ // eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
51
52
  return Boolean(this.labelDescription || this.$slots['label-description']);
52
53
  },
53
54
  },
@@ -67,6 +68,7 @@ export default {
67
68
  </gl-form-text>
68
69
  </template>
69
70
 
71
+ <!-- eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots -->
70
72
  <template v-for="slot in Object.keys($slots)" #[slot]>
71
73
  <slot :name="slot"></slot>
72
74
  </template>
@@ -21,8 +21,9 @@ See: https://gitlab.com/gitlab-org/gitlab/issues/30055
21
21
  @include gl-border-none;
22
22
  @include gl-appearance-none;
23
23
  @include gl-text-truncate;
24
+ @include gl-bg-no-repeat;
25
+ background-image: url($gl-icon-select-chevron-down);
24
26
 
25
- &:active,
26
27
  &:focus,
27
28
  &:focus:active {
28
29
  @include gl-focus($color: $gray-900, $important: true);
@@ -37,10 +38,11 @@ See: https://gitlab.com/gitlab-org/gitlab/issues/30055
37
38
 
38
39
  &.is-valid,
39
40
  &.is-invalid {
40
- background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e");
41
+ padding-right: $gl-spacing-scale-2 + $gl-spacing-scale-6;
42
+ background-image: url($gl-icon-select-chevron-down);
41
43
  }
42
44
 
43
- &.is-invalid {
45
+ &.is-invalid:not(:disabled) {
44
46
  @include gl-inset-border-1-red-400;
45
47
 
46
48
  &:focus {
@@ -10,6 +10,7 @@ export default {
10
10
  </script>
11
11
  <template>
12
12
  <b-form-select class="gl-form-select" v-bind="$attrs" v-on="$listeners">
13
+ <!-- eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots -->
13
14
  <template v-for="slot in Object.keys($slots)" #[slot]>
14
15
  <slot :name="slot"></slot>
15
16
  </template>
@@ -88,9 +88,11 @@ export default {
88
88
  },
89
89
  computed: {
90
90
  shouldRenderModalOk() {
91
+ // eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
91
92
  return Boolean(this.$slots['modal-ok']);
92
93
  },
93
94
  shouldRenderModalCancel() {
95
+ // eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
94
96
  return Boolean(this.$slots['modal-cancel']);
95
97
  },
96
98
  shouldRenderModalFooter() {
@@ -98,6 +100,7 @@ export default {
98
100
  this.actionCancel ||
99
101
  this.actionSecondary ||
100
102
  this.actionPrimary ||
103
+ // eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
101
104
  this.$slots['modal-footer']
102
105
  );
103
106
  },
@@ -48,6 +48,7 @@ export default {
48
48
  v-bind="$attrs"
49
49
  v-on="$listeners"
50
50
  >
51
+ <!-- eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots -->
51
52
  <template v-for="slot in Object.keys($slots)" #[slot]>
52
53
  <slot :name="slot"></slot>
53
54
  </template>
@@ -107,6 +107,7 @@ export default {
107
107
  v-bind="passthroughAttrs"
108
108
  v-on="$listeners"
109
109
  >
110
+ <!-- eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots -->
110
111
  <template v-for="slot in Object.keys($slots)" #[slot]>
111
112
  <slot :name="slot"></slot>
112
113
  </template>
@@ -221,6 +221,7 @@ export default {
221
221
  v-bind="$attrs"
222
222
  v-on="listeners"
223
223
  >
224
+ <!-- eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots -->
224
225
  <template v-for="slot in Object.keys($slots)" #[slot]>
225
226
  <slot :name="slot"></slot>
226
227
  </template>
@@ -82,6 +82,7 @@ export default {
82
82
  },
83
83
  computed: {
84
84
  shouldRenderHelp() {
85
+ // eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
85
86
  return Boolean(this.$slots.help || this.help);
86
87
  },
87
88
  icon() {
@@ -3040,6 +3040,14 @@
3040
3040
  display: table-cell !important;
3041
3041
  }
3042
3042
  }
3043
+
3044
+ .gl-display-contents {
3045
+ display: contents;
3046
+ }
3047
+
3048
+ .gl-display-contents\! {
3049
+ display: contents !important;
3050
+ }
3043
3051
  .gl-align-items-baseline {
3044
3052
  align-items: baseline;
3045
3053
  }
@@ -204,3 +204,7 @@
204
204
  @include gl-display-table-cell;
205
205
  }
206
206
  }
207
+
208
+ @mixin gl-display-contents {
209
+ display: contents;
210
+ }
@@ -441,6 +441,7 @@ $chart-tooltip-max-width: px-to-rem(512px);
441
441
  $gl-icon-chevron-left: 'data:image/svg+xml;utf8,<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 0 0 0 1.414l3 3a1 1 0 0 0 1.414-1.414L7.414 8l2.293-2.293a1 1 0 0 0-1.414-1.414l-3 3z"/></svg>';
442
442
  $gl-icon-chevron-right: 'data:image/svg+xml;utf8,<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path fill-rule="evenodd" d="M10.707 7.293a1 1 0 0 1 0 1.414l-3 3a1 1 0 0 1-1.414-1.414L8.586 8 6.293 5.707a1 1 0 0 1 1.414-1.414l3 3z"/></svg>';
443
443
  $gl-icon-chevron-down: 'data:image/svg+xml;utf8,<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path fill-rule="evenodd" d="M7.293 10.707a1 1 0 0 0 1.414 0l3-3a1 1 0 0 0-1.414-1.414L8 8.586 5.707 6.293a1 1 0 0 0-1.414 1.414l3 3z"/></svg>';
444
+ $gl-icon-select-chevron-down: 'data:image/svg+xml,%3Csvg width="8" height="5" viewBox="0 0 8 5" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath fill-rule="evenodd" clip-rule="evenodd" d="M0.21967 0.21967C0.512563 -0.0732232 0.987437 -0.0732232 1.28033 0.21967L4 2.93934L6.71967 0.21967C7.01256 -0.073223 7.48744 -0.0732229 7.78033 0.21967C8.07322 0.512563 8.07322 0.987437 7.78033 1.28033L4.53033 4.53033C4.23744 4.82322 3.76256 4.82322 3.46967 4.53033L0.21967 1.28033C-0.0732233 0.987437 -0.0732233 0.512563 0.21967 0.21967Z" fill="%23666666"/%3E%3C/svg%3E%0A';
444
445
 
445
446
  // Icons
446
447
  $default-icon-size: px-to-rem(16px);