@gitlab/ui 59.3.0 → 59.3.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [59.3.2](https://gitlab.com/gitlab-org/gitlab-ui/compare/v59.3.1...v59.3.2) (2023-04-05)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **GlSkeletonLoader:** Disable animation for reduced motion ([a70e810](https://gitlab.com/gitlab-org/gitlab-ui/commit/a70e8104361a4f51f36076d4466989df2de53f94))
7
+
8
+ ## [59.3.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v59.3.0...v59.3.1) (2023-04-05)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **base_dropdown:** conditional chaining to destroy popper ([05cf79e](https://gitlab.com/gitlab-org/gitlab-ui/commit/05cf79e0fdaf55d9403fcdaba062d416294b3815))
14
+
1
15
  # [59.3.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v59.2.0...v59.3.0) (2023-04-04)
2
16
 
3
17
 
@@ -106,7 +106,7 @@ var script = {
106
106
  mounted() {
107
107
  // eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
108
108
  if (!this.$slots.default && !this.$attrs['aria-label'] && !this.$props.label) {
109
- logWarning('[gl-button]: Accessible name missing. Please add inner text or aria-label.');
109
+ logWarning('[gl-button]: Accessible name missing. Please add inner text or aria-label.', this.$el);
110
110
  }
111
111
  }
112
112
  };
@@ -102,7 +102,7 @@ var script = {
102
102
  },
103
103
  mounted() {
104
104
  if (!this.ariaLabel && !this.title) {
105
- logWarning('[gl-modal]: Accessible name for modal missing. Please add title prop or aria-label.');
105
+ logWarning('[gl-modal]: Accessible name for modal missing. Please add title prop or aria-label.', this.$el);
106
106
  }
107
107
  },
108
108
  methods: {
@@ -200,19 +200,20 @@ var script = {
200
200
  this.checkToggleFocusable();
201
201
  },
202
202
  beforeDestroy() {
203
- this.popper.destroy();
203
+ var _this$popper;
204
+ (_this$popper = this.popper) === null || _this$popper === void 0 ? void 0 : _this$popper.destroy();
204
205
  },
205
206
  methods: {
206
207
  checkToggleFocusable() {
207
208
  if (!isElementFocusable(this.toggleElement) && !isElementTabbable(this.toggleElement)) {
208
209
  logWarning(`GlDisclosureDropdown/GlCollapsibleListbox: Toggle is missing a 'tabindex' and cannot be focused.
209
- Use 'a' or 'button' element instead or make sure to add 'role="button"' along with 'tabindex' otherwise.`);
210
+ Use 'a' or 'button' element instead or make sure to add 'role="button"' along with 'tabindex' otherwise.`, this.$el);
210
211
  }
211
212
  },
212
213
  async toggle() {
213
214
  this.visible = !this.visible;
214
215
  if (this.visible) {
215
- var _this$popper;
216
+ var _this$popper2;
216
217
  /* Initially dropdown is hidden with `display="none"`.
217
218
  When `visible` prop is toggled ON, with the `nextTick` we wait for the DOM update -
218
219
  dropdown's `display="block"` is set (adding CSS class `show`).
@@ -224,7 +225,7 @@ var script = {
224
225
  e.g. set focus.
225
226
  */
226
227
  await this.$nextTick();
227
- await ((_this$popper = this.popper) === null || _this$popper === void 0 ? void 0 : _this$popper.update());
228
+ await ((_this$popper2 = this.popper) === null || _this$popper2 === void 0 ? void 0 : _this$popper2.update());
228
229
  this.$emit(GL_DROPDOWN_SHOWN);
229
230
  } else {
230
231
  this.$emit(GL_DROPDOWN_HIDDEN);
@@ -97,6 +97,7 @@ var script = {
97
97
  }
98
98
  return `${DEFAULT_LINE_WIDTH_PERCENTAGES[index % DEFAULT_LINE_WIDTH_PERCENTAGES.length]}%`;
99
99
  };
100
+ const reducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
100
101
  const svg = createElement('svg', {
101
102
  class: {
102
103
  'gl-skeleton-loader': true,
@@ -108,15 +109,17 @@ var script = {
108
109
  preserveAspectRatio: props.preserveAspectRatio
109
110
  }
110
111
  }, [createElement('title', {}, ['Loading']), createElement('rect', {
111
- style: {
112
- fill: `url(${props.baseUrl}#${props.uniqueKey}-idGradient)`
113
- },
114
112
  attrs: {
115
113
  'clip-path': `url(${props.baseUrl}#${props.uniqueKey}-idClip)`,
116
114
  x: 0,
117
115
  y: 0,
118
116
  width: width(),
119
- height: height()
117
+ height: height(),
118
+ ...(reducedMotion ? {
119
+ class: 'gl-fill-gray-100'
120
+ } : {
121
+ fill: `url(${props.baseUrl}#${props.uniqueKey}-idGradient)`
122
+ })
120
123
  }
121
124
  }), createElement('defs', {}, [createElement('clipPath', {
122
125
  attrs: {
@@ -130,7 +133,7 @@ var script = {
130
133
  height: DEFAULT_LINE_HEIGHT,
131
134
  rx: 4
132
135
  }
133
- }))), createElement('linearGradient', {
136
+ }))), !reducedMotion && createElement('linearGradient', {
134
137
  attrs: {
135
138
  id: `${props.uniqueKey}-idGradient`
136
139
  }
@@ -31,7 +31,7 @@ var script = {
31
31
  // logWarning will call isDev before logging any message
32
32
  // this additional call to isDev is being made to exit the condition early when run in production
33
33
  if (isDev() && !shouldUseFullTable(this)) {
34
- logWarning(glTableLiteWarning);
34
+ logWarning(glTableLiteWarning, this.$el);
35
35
  }
36
36
  }
37
37
  };