@gitlab/ui 136.3.2 → 137.0.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.
Files changed (31) hide show
  1. package/dist/components/base/alert/alert.js +4 -4
  2. package/dist/components/base/datepicker/datepicker.js +1 -1
  3. package/dist/components/base/infinite_scroll/infinite_scroll.js +12 -3
  4. package/dist/components/base/new_dropdowns/constants.js +2 -2
  5. package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown.js +1 -1
  6. package/dist/components/base/sorting/sorting.js +2 -2
  7. package/dist/components/charts/chart/chart.js +1 -1
  8. package/dist/components/charts/sparkline/sparkline.js +2 -2
  9. package/dist/components/dashboards/dashboard_panel/dashboard_panel.js +1 -1
  10. package/dist/index.css +1 -1
  11. package/dist/index.css.map +1 -1
  12. package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip-template.js +4 -2
  13. package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip.js +3 -1
  14. package/dist/vendor/bootstrap-vue/src/directives/tooltip/tooltip.js +2 -1
  15. package/package.json +1 -1
  16. package/src/components/base/alert/alert.vue +4 -4
  17. package/src/components/base/datepicker/datepicker.vue +1 -1
  18. package/src/components/base/infinite_scroll/infinite_scroll.vue +7 -3
  19. package/src/components/base/new_dropdowns/constants.js +2 -2
  20. package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.vue +1 -1
  21. package/src/components/base/sorting/sorting.vue +2 -2
  22. package/src/components/base/toggle/toggle.scss +29 -1
  23. package/src/components/charts/chart/chart.vue +1 -1
  24. package/src/components/charts/sparkline/sparkline.vue +2 -2
  25. package/src/components/dashboards/dashboard_panel/dashboard_panel.vue +2 -2
  26. package/src/tokens/build/docs/tokens-tailwind-docs.dark.json +34 -0
  27. package/src/tokens/build/docs/tokens-tailwind-docs.json +34 -0
  28. package/src/tokens/build/tailwind/tokens.cjs +1 -0
  29. package/src/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip-template.js +4 -2
  30. package/src/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip.js +3 -1
  31. package/src/vendor/bootstrap-vue/src/directives/tooltip/tooltip.js +2 -1
@@ -62,8 +62,10 @@ const BVTooltipTemplate = /*#__PURE__*/extend({
62
62
  templateAttributes() {
63
63
  const id = this.id;
64
64
  return {
65
- // Apply attributes from root tooltip component
66
- ...this.bvParent.bvParent.$attrs,
65
+ // Apply attributes from root tooltip component. A directive has no such component, so
66
+ // `bvParent.bvParent` is the component holding the target element, whose attributes
67
+ // must not leak onto the template.
68
+ ...(this.bvParent.isDirective ? {} : this.bvParent.bvParent.$attrs),
67
69
  id,
68
70
  role: 'tooltip',
69
71
  tabindex: '-1',
@@ -90,7 +90,9 @@ const templateData = {
90
90
  // ID to use for tooltip/popover
91
91
  id: null,
92
92
  // Flag used by directives only, for HTML content
93
- html: false
93
+ html: false,
94
+ // Flag used by directives only, to suppress attribute forwarding
95
+ isDirective: false
94
96
  };
95
97
 
96
98
  // --- Main component ---
@@ -217,7 +217,8 @@ const applyTooltip = (el, bindings, vnode) => {
217
217
  id: config.id,
218
218
  interactive: config.interactive,
219
219
  disabled: config.disabled,
220
- html: config.html
220
+ html: config.html,
221
+ isDirective: true
221
222
  };
222
223
  const oldData = el[BV_TOOLTIP].__bv_prev_data__;
223
224
  el[BV_TOOLTIP].__bv_prev_data__ = data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "136.3.2",
3
+ "version": "137.0.1",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -203,19 +203,19 @@ export default {
203
203
  /**
204
204
  * Emitted when the primary action button is clicked.
205
205
  *
206
- * @event primaryAction
206
+ * @event primary-action
207
207
  * @type {object}
208
208
  */
209
- this.$emit('primaryAction', event);
209
+ this.$emit('primary-action', event);
210
210
  },
211
211
  secondaryButtonClicked(event) {
212
212
  /**
213
213
  * Emitted when the secondary action button is clicked.
214
214
  *
215
- * @event secondaryAction
215
+ * @event secondary-action
216
216
  * @type {object}
217
217
  */
218
- this.$emit('secondaryAction', event);
218
+ this.$emit('secondary-action', event);
219
219
  },
220
220
  onDismiss() {
221
221
  /**
@@ -434,7 +434,7 @@ export default {
434
434
  /**
435
435
  * Emitted when the datepicker draws a new month.
436
436
  */
437
- this.$emit('monthChange');
437
+ this.$emit('month-change');
438
438
  },
439
439
  onKeydown() {
440
440
  if (this.textInput === '') {
@@ -79,7 +79,11 @@ export default {
79
79
  async mounted() {
80
80
  // Scroll to bottom for reverse effect
81
81
  await this.$nextTick();
82
- if (this.$listeners.topReached && !this.$listeners.bottomReached) {
82
+
83
+ // Check both kebab-case (Vue 2) and camelCase (@vue/compat) $listeners.
84
+ const listening = (...names) => names.some((name) => this.$listeners[name]);
85
+
86
+ if (listening('top-reached', 'topReached') && !listening('bottom-reached', 'bottomReached')) {
83
87
  this.scrollDown();
84
88
  }
85
89
  },
@@ -117,13 +121,13 @@ export default {
117
121
  /**
118
122
  * Emitted when item container is scrolled to the top
119
123
  */
120
- this.$emit('topReached');
124
+ this.$emit('top-reached');
121
125
  }, throttleDuration),
122
126
  bottomReached: throttle(function bottomReachedThrottled() {
123
127
  /**
124
128
  * Emitted when item container is scrolled to the bottom
125
129
  */
126
- this.$emit('bottomReached');
130
+ this.$emit('bottom-reached');
127
131
  }, throttleDuration),
128
132
  itemsListHeight() {
129
133
  return this.$refs.infiniteContainer.scrollHeight;
@@ -1,8 +1,8 @@
1
1
  // base dropdown events
2
2
  export const GL_DROPDOWN_SHOWN = 'shown';
3
3
  export const GL_DROPDOWN_HIDDEN = 'hidden';
4
- export const GL_DROPDOWN_BEFORE_CLOSE = 'beforeClose';
5
- export const GL_DROPDOWN_FOCUS_CONTENT = 'focusContent';
4
+ export const GL_DROPDOWN_BEFORE_CLOSE = 'before-close';
5
+ export const GL_DROPDOWN_FOCUS_CONTENT = 'focus-content';
6
6
 
7
7
  // KeyboardEvent.code values
8
8
  export const ARROW_DOWN = 'ArrowDown';
@@ -296,7 +296,7 @@ export default {
296
296
  /**
297
297
  * Emitted when dropdown is about to be closed
298
298
  *
299
- * @event beforeClose
299
+ * @event before-close
300
300
  */
301
301
  this.$emit(GL_DROPDOWN_BEFORE_CLOSE, event);
302
302
  },
@@ -152,7 +152,7 @@ export default {
152
152
  *
153
153
  * @property {boolean} isAscending
154
154
  */
155
- this.$emit('sortDirectionChange', newDirection);
155
+ this.$emit('sort-direction-change', newDirection);
156
156
  },
157
157
  onSortByChanged(event) {
158
158
  /**
@@ -164,7 +164,7 @@ export default {
164
164
  *
165
165
  * @property {string|number} value
166
166
  */
167
- this.$emit('sortByChange', event);
167
+ this.$emit('sort-by-change', event);
168
168
  },
169
169
  },
170
170
  };
@@ -82,7 +82,9 @@ $toggle-height: 2.5 * $grid-size;
82
82
  @include gl-prefers-reduced-motion-transition;
83
83
 
84
84
  @media (forced-colors: active) {
85
- border: 1px solid;
85
+ outline: 1px solid CanvasText !important; // stylelint-disable-line scale-unlimited/declaration-strict-value
86
+ outline-offset: -1px;
87
+ transition: none;
86
88
  }
87
89
 
88
90
  &::selection,
@@ -136,6 +138,10 @@ $toggle-height: 2.5 * $grid-size;
136
138
  transition: transform $gl-transition-duration-medium $gl-easing-out-cubic;
137
139
  @include gl-prefers-reduced-motion-transition;
138
140
 
141
+ @media (forced-colors: active) {
142
+ transition: none;
143
+ }
144
+
139
145
  &::before {
140
146
  content: "";
141
147
  @apply gl-absolute;
@@ -147,6 +153,11 @@ $toggle-height: 2.5 * $grid-size;
147
153
  transform $gl-transition-duration-medium $gl-easing-out-cubic,
148
154
  background-color $gl-transition-duration-medium $gl-easing-out-cubic;
149
155
  @include gl-prefers-reduced-motion-transition;
156
+
157
+ @media (forced-colors: active) {
158
+ background-color: CanvasText; // stylelint-disable-line scale-unlimited/declaration-strict-value
159
+ transition: none;
160
+ }
150
161
  }
151
162
 
152
163
  > svg {
@@ -162,6 +173,7 @@ $toggle-height: 2.5 * $grid-size;
162
173
  display: none;
163
174
 
164
175
  @media (forced-colors: active) {
176
+ color: Canvas; // stylelint-disable-line scale-unlimited/declaration-strict-value
165
177
  display: block;
166
178
  }
167
179
  }
@@ -198,6 +210,14 @@ $toggle-height: 2.5 * $grid-size;
198
210
  );
199
211
  }
200
212
 
213
+ @media (forced-colors: active) {
214
+ background-color: CanvasText !important; // stylelint-disable-line scale-unlimited/declaration-strict-value
215
+
216
+ svg {
217
+ color: CanvasText; // stylelint-disable-line scale-unlimited/declaration-strict-value
218
+ }
219
+ }
220
+
201
221
  .toggle-icon {
202
222
  transform: translateX($toggle-translate-width);
203
223
  }
@@ -223,6 +243,10 @@ $toggle-height: 2.5 * $grid-size;
223
243
 
224
244
  .toggle-icon::before {
225
245
  background-color: var(--gl-toggle-switch-background-color-unchecked-disabled);
246
+
247
+ @media (forced-colors: active) {
248
+ background-color: GrayText; // stylelint-disable-line scale-unlimited/declaration-strict-value
249
+ }
226
250
  }
227
251
 
228
252
  &:hover .toggle-icon::before,
@@ -263,6 +287,10 @@ $toggle-height: 2.5 * $grid-size;
263
287
  $important: true
264
288
  );
265
289
  }
290
+
291
+ @media (forced-colors: active) {
292
+ background-color: GrayText !important; // stylelint-disable-line scale-unlimited/declaration-strict-value
293
+ }
266
294
  }
267
295
 
268
296
  // A loading toggle renders a spinner in place of the thumb, so the track is
@@ -171,7 +171,7 @@ export default {
171
171
  * @property {object} chart The chart instance
172
172
  * @property {object} params A params object, see also https://echarts.apache.org/en/api.html#events.Mouse%20events
173
173
  */
174
- this.$emit('chartItemClicked', { chart: this.chart, params });
174
+ this.$emit('chart-item-clicked', { chart: this.chart, params });
175
175
  },
176
176
  handleResize() {
177
177
  this.chart.resize();
@@ -210,10 +210,10 @@ export default {
210
210
  /**
211
211
  * Emitted when the chart is created.
212
212
  * The payload contains the echarts instance.
213
- * @event chartCreated
213
+ * @event chart-created
214
214
  * @type {object}
215
215
  */
216
- this.$emit('chartCreated', chartInstance);
216
+ this.$emit('chart-created', chartInstance);
217
217
  },
218
218
  handleResize() {
219
219
  this.chartInstance.resize();
@@ -290,8 +290,8 @@ export default {
290
290
  category="tertiary"
291
291
  positioning-strategy="fixed"
292
292
  size="small"
293
- @shown="$emit('dropdownOpen')"
294
- @hidden="$emit('dropdownClosed')"
293
+ @shown="$emit('dropdown-open')"
294
+ @hidden="$emit('dropdown-closed')"
295
295
  >
296
296
  <template #list-item="{ item }">
297
297
  <span>{{ item.text }}</span>
@@ -5795,6 +5795,40 @@
5795
5795
  "cssWithValue": "var(--gl-feedback-brand-background-color)"
5796
5796
  }
5797
5797
  },
5798
+ "application-chrome": {
5799
+ "key": "{application-chrome.background.color}",
5800
+ "$value": "#050506",
5801
+ "$type": "color",
5802
+ "$description": "Used for the application chrome background, the lowest layer of the interface that sits beneath panels and contains global navigation, user actions, application navigation, and AI navigation.",
5803
+ "$extensions": {
5804
+ "com.figma.scopes": [
5805
+ "FRAME_FILL",
5806
+ "SHAPE_FILL"
5807
+ ]
5808
+ },
5809
+ "filePath": "src/tokens/contextual/application-chrome.tokens.json",
5810
+ "isSource": true,
5811
+ "original": {
5812
+ "$value": "{color.neutral.1000}",
5813
+ "$type": "color",
5814
+ "$description": "Used for the application chrome background, the lowest layer of the interface that sits beneath panels and contains global navigation, user actions, application navigation, and AI navigation.",
5815
+ "$extensions": {
5816
+ "com.figma.scopes": [
5817
+ "FRAME_FILL",
5818
+ "SHAPE_FILL"
5819
+ ]
5820
+ },
5821
+ "key": "{application-chrome.background.color}"
5822
+ },
5823
+ "name": "APPLICATION_CHROME_BACKGROUND_COLOR",
5824
+ "attributes": {},
5825
+ "path": [
5826
+ "application-chrome",
5827
+ "background",
5828
+ "color"
5829
+ ],
5830
+ "cssWithValue": "var(--gl-application-chrome-background-color)"
5831
+ },
5798
5832
  "dropdown": {
5799
5833
  "key": "{dropdown.background.color}",
5800
5834
  "$value": "#28272d",
@@ -5795,6 +5795,40 @@
5795
5795
  "cssWithValue": "var(--gl-feedback-brand-background-color)"
5796
5796
  }
5797
5797
  },
5798
+ "application-chrome": {
5799
+ "key": "{application-chrome.background.color}",
5800
+ "$value": "#ececef",
5801
+ "$type": "color",
5802
+ "$description": "Used for the application chrome background, the lowest layer of the interface that sits beneath panels and contains global navigation, user actions, application navigation, and AI navigation.",
5803
+ "$extensions": {
5804
+ "com.figma.scopes": [
5805
+ "FRAME_FILL",
5806
+ "SHAPE_FILL"
5807
+ ]
5808
+ },
5809
+ "filePath": "src/tokens/contextual/application-chrome.tokens.json",
5810
+ "isSource": true,
5811
+ "original": {
5812
+ "$value": "{color.neutral.50}",
5813
+ "$type": "color",
5814
+ "$description": "Used for the application chrome background, the lowest layer of the interface that sits beneath panels and contains global navigation, user actions, application navigation, and AI navigation.",
5815
+ "$extensions": {
5816
+ "com.figma.scopes": [
5817
+ "FRAME_FILL",
5818
+ "SHAPE_FILL"
5819
+ ]
5820
+ },
5821
+ "key": "{application-chrome.background.color}"
5822
+ },
5823
+ "name": "APPLICATION_CHROME_BACKGROUND_COLOR",
5824
+ "attributes": {},
5825
+ "path": [
5826
+ "application-chrome",
5827
+ "background",
5828
+ "color"
5829
+ ],
5830
+ "cssWithValue": "var(--gl-application-chrome-background-color)"
5831
+ },
5798
5832
  "dropdown": {
5799
5833
  "key": "{dropdown.background.color}",
5800
5834
  "$value": "#fff",
@@ -430,6 +430,7 @@ const backgroundColor = {
430
430
  ...backgroundColors,
431
431
  ...statusBackgroundColors,
432
432
  ...feedbackBackgroundColors,
433
+ 'application-chrome': 'var(--gl-application-chrome-background-color)',
433
434
  dropdown: 'var(--gl-dropdown-background-color)',
434
435
  control: {
435
436
  default: 'var(--gl-control-background-color-default)',
@@ -70,8 +70,10 @@ export const BVTooltipTemplate = /*#__PURE__*/ extend({
70
70
  const { id } = this
71
71
 
72
72
  return {
73
- // Apply attributes from root tooltip component
74
- ...this.bvParent.bvParent.$attrs,
73
+ // Apply attributes from root tooltip component. A directive has no such component, so
74
+ // `bvParent.bvParent` is the component holding the target element, whose attributes
75
+ // must not leak onto the template.
76
+ ...(this.bvParent.isDirective ? {} : this.bvParent.bvParent.$attrs),
75
77
 
76
78
  id,
77
79
  role: 'tooltip',
@@ -130,7 +130,9 @@ const templateData = {
130
130
  // ID to use for tooltip/popover
131
131
  id: null,
132
132
  // Flag used by directives only, for HTML content
133
- html: false
133
+ html: false,
134
+ // Flag used by directives only, to suppress attribute forwarding
135
+ isDirective: false
134
136
  }
135
137
 
136
138
  // --- Main component ---
@@ -225,7 +225,8 @@ const applyTooltip = (el, bindings, vnode) => {
225
225
  id: config.id,
226
226
  interactive: config.interactive,
227
227
  disabled: config.disabled,
228
- html: config.html
228
+ html: config.html,
229
+ isDirective: true
229
230
  }
230
231
  const oldData = el[BV_TOOLTIP].__bv_prev_data__
231
232
  el[BV_TOOLTIP].__bv_prev_data__ = data