@gitlab/ui 126.3.1 → 126.3.3

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 (85) hide show
  1. package/dist/components/base/badge/badge.js +4 -1
  2. package/dist/components/base/button/button.js +4 -1
  3. package/dist/components/base/filtered_search/filtered_search.js +4 -2
  4. package/dist/components/base/icon/icon.js +5 -3
  5. package/dist/components/base/illustration/illustration.js +5 -3
  6. package/dist/components/base/modal/modal.js +4 -1
  7. package/dist/components/base/new_dropdowns/base_dropdown/base_dropdown.js +8 -4
  8. package/dist/components/base/new_dropdowns/listbox/listbox.js +4 -3
  9. package/dist/components/base/table/table.js +4 -1
  10. package/dist/components/base/tabs/tab/tab.js +5 -3
  11. package/dist/utils/utils.js +14 -7
  12. package/package.json +4 -4
  13. package/src/components/base/badge/badge.vue +2 -2
  14. package/src/components/base/button/button.vue +4 -4
  15. package/src/components/base/dropdown/dropdown.vue +2 -2
  16. package/src/components/base/filtered_search/filtered_search.vue +3 -2
  17. package/src/components/base/icon/icon.vue +3 -3
  18. package/src/components/base/illustration/illustration.vue +5 -3
  19. package/src/components/base/modal/modal.vue +8 -8
  20. package/src/components/base/new_dropdowns/base_dropdown/base_dropdown.vue +7 -4
  21. package/src/components/base/new_dropdowns/listbox/listbox.vue +3 -3
  22. package/src/components/base/table/table.vue +1 -1
  23. package/src/components/base/tabs/tab/tab.vue +5 -4
  24. package/src/tokens/build/docs/tokens-tailwind-docs.dark.json +2788 -2788
  25. package/src/tokens/build/docs/tokens-tailwind-docs.json +2788 -2788
  26. package/src/tokens/build/figma/constants.tokens.json +326 -326
  27. package/src/tokens/build/figma/contextual.tokens.json +428 -428
  28. package/src/tokens/build/figma/deprecated.tokens.json +220 -220
  29. package/src/tokens/build/figma/semantic.tokens.json +191 -191
  30. package/src/tokens/build/json/tokens.dark.json +2330 -2330
  31. package/src/tokens/build/json/tokens.json +2330 -2330
  32. package/src/tokens/constant/border.tokens.json +10 -10
  33. package/src/tokens/constant/color.alpha.tokens.json +15 -15
  34. package/src/tokens/constant/color.tokens.json +211 -211
  35. package/src/tokens/constant/font.tokens.json +27 -27
  36. package/src/tokens/constant/line_height.tokens.json +10 -10
  37. package/src/tokens/constant/opacity.tokens.json +11 -11
  38. package/src/tokens/constant/shadow.tokens.json +3 -3
  39. package/src/tokens/constant/spacing_scale.tokens.json +32 -32
  40. package/src/tokens/constant/zindex.tokens.json +7 -7
  41. package/src/tokens/contextual/alert.tokens.json +20 -20
  42. package/src/tokens/contextual/avatar.tokens.json +14 -14
  43. package/src/tokens/contextual/badge.tokens.json +112 -112
  44. package/src/tokens/contextual/banner.tokens.json +3 -3
  45. package/src/tokens/contextual/breadcrumb.tokens.json +1 -1
  46. package/src/tokens/contextual/broadcast.tokens.json +41 -41
  47. package/src/tokens/contextual/button.tokens.json +122 -122
  48. package/src/tokens/contextual/card.tokens.json +1 -1
  49. package/src/tokens/contextual/chart.tokens.json +7 -7
  50. package/src/tokens/contextual/datepicker.tokens.json +2 -2
  51. package/src/tokens/contextual/drawer.tokens.json +1 -1
  52. package/src/tokens/contextual/dropdown.tokens.json +22 -22
  53. package/src/tokens/contextual/filtered-search.tokens.json +6 -6
  54. package/src/tokens/contextual/illustration.tokens.json +32 -32
  55. package/src/tokens/contextual/label.tokens.json +12 -12
  56. package/src/tokens/contextual/link.tokens.json +4 -4
  57. package/src/tokens/contextual/modal.tokens.json +1 -1
  58. package/src/tokens/contextual/progress-bar.tokens.json +5 -5
  59. package/src/tokens/contextual/skeleton-loader.tokens.json +2 -2
  60. package/src/tokens/contextual/spinner.tokens.json +4 -4
  61. package/src/tokens/contextual/table.tokens.json +2 -2
  62. package/src/tokens/contextual/tabs.tokens.json +1 -1
  63. package/src/tokens/contextual/toggle.tokens.json +9 -9
  64. package/src/tokens/contextual/token-selector.tokens.json +1 -1
  65. package/src/tokens/contextual/token.tokens.json +3 -3
  66. package/src/tokens/deprecated/deprecated.color.data_viz.tokens.json +55 -55
  67. package/src/tokens/deprecated/deprecated.color.theme.tokens.json +72 -72
  68. package/src/tokens/deprecated/deprecated.color.tokens.json +80 -80
  69. package/src/tokens/deprecated/deprecated.color.transparency.tokens.json +13 -13
  70. package/src/tokens/semantic/action.tokens.json +76 -76
  71. package/src/tokens/semantic/background.tokens.json +7 -7
  72. package/src/tokens/semantic/border.tokens.json +5 -5
  73. package/src/tokens/semantic/control.tokens.json +21 -21
  74. package/src/tokens/semantic/feedback.tokens.json +30 -30
  75. package/src/tokens/semantic/focus-ring.tokens.json +2 -2
  76. package/src/tokens/semantic/font.tokens.json +2 -2
  77. package/src/tokens/semantic/heading.tokens.json +2 -2
  78. package/src/tokens/semantic/highlight.tokens.json +4 -4
  79. package/src/tokens/semantic/icon.tokens.json +9 -9
  80. package/src/tokens/semantic/letter_spacing.tokens.json +1 -1
  81. package/src/tokens/semantic/line_height.tokens.json +1 -1
  82. package/src/tokens/semantic/shadow.tokens.json +1 -1
  83. package/src/tokens/semantic/status.tokens.json +18 -18
  84. package/src/tokens/semantic/text.tokens.json +12 -12
  85. package/src/utils/utils.js +10 -5
@@ -152,7 +152,10 @@ var script = {
152
152
  },
153
153
  mounted() {
154
154
  if (this.hasIconOnly && !this.$attrs['aria-label']) {
155
- logWarning('[GlBadge] Icon-only badges require an aria-label for accessibility. The label should describe the metadata (e.g., "Due date", "Open issue"), not the icon name. See https://design.gitlab.com/components/badge#using-icon-only-badges', this.$el);
155
+ logWarning('Icon-only badges require an aria-label for accessibility. The label should describe the metadata (e.g., "Due date", "Open issue"), not the icon name. See https://design.gitlab.com/components/badge#using-icon-only-badges', {
156
+ name: 'GlBadge',
157
+ element: this.$el
158
+ });
156
159
  }
157
160
  }
158
161
  };
@@ -364,7 +364,10 @@ var script = {
364
364
  mounted() {
365
365
  // eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
366
366
  if (!this.$slots.default && !this.$attrs['aria-label'] && !this.$props.label) {
367
- logWarning('[gl-button]: Accessible name missing. Please add inner text or aria-label.', this.$el);
367
+ logWarning('Accessible name missing. Please add inner text or aria-label.', {
368
+ name: 'GlButton',
369
+ element: this.$el
370
+ });
368
371
  }
369
372
  },
370
373
  methods: {
@@ -2,6 +2,7 @@ import isEqual from 'lodash/isEqual';
2
2
  import cloneDeep from 'lodash/cloneDeep';
3
3
  import { PortalTarget } from 'portal-vue';
4
4
  import { GlTooltipDirective } from '../../../directives/tooltip/tooltip';
5
+ import { logWarning } from '../../../utils/utils';
5
6
  import GlIcon from '../icon/icon';
6
7
  import GlSearchBoxByClick from '../search_box_by_click/search_box_by_click';
7
8
  import GlFilteredSearchTerm from './filtered_search_term';
@@ -67,8 +68,9 @@ var script = {
67
68
  return !token || token.__v_skip;
68
69
  });
69
70
  if (!isOk) {
70
- // eslint-disable-next-line no-console
71
- console.warn('You are using Vue3. In Vue3 each token component passed to filtered search must be wrapped into markRaw');
71
+ logWarning('You are using Vue3. In Vue3 each token component passed to filtered search must be wrapped into markRaw', {
72
+ name: 'GlFilteredSearch'
73
+ });
72
74
  }
73
75
  return isOk;
74
76
  }
@@ -1,5 +1,6 @@
1
1
  import iconsPath from '@gitlab/svgs/dist/icons.svg';
2
2
  import iconsInfo from '@gitlab/svgs/dist/icons.json';
3
+ import { logWarning } from '../../../utils/utils';
3
4
  import { iconSizeOptions, iconVariantOptions } from '../../../utils/constants';
4
5
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
5
6
 
@@ -28,7 +29,7 @@ var script = {
28
29
  default: undefined
29
30
  },
30
31
  /**
31
- * One of the icons from https://gitlab-org.gitlab.io/gitlab-svgs/ project
32
+ * One of the icons from https://design.gitlab.com/product-foundations/iconography-directory
32
33
  */
33
34
  name: {
34
35
  type: String,
@@ -37,8 +38,9 @@ var script = {
37
38
  if (knownIcons.has(value)) {
38
39
  return true;
39
40
  }
40
- // eslint-disable-next-line no-console
41
- console.warn(`Icon '${value}' is not a known icon of @gitlab/svgs`);
41
+ logWarning(`Icon '${value}' is not a known icon of @gitlab/svgs`, {
42
+ name: 'GlIcon'
43
+ });
42
44
  return false;
43
45
  }
44
46
  },
@@ -1,5 +1,6 @@
1
1
  import illustrationsPath from '@gitlab/svgs/dist/illustrations.svg';
2
2
  import illustrationsInfo from '@gitlab/svgs/dist/illustrations.json';
3
+ import { logWarning } from '../../../utils/utils';
3
4
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
4
5
 
5
6
  //
@@ -16,7 +17,7 @@ var script = {
16
17
  name: 'GlIllustration',
17
18
  props: {
18
19
  /**
19
- * One of the illustrations from https://gitlab-org.gitlab.io/gitlab-svgs/ project
20
+ * One of the illustrations from https://design.gitlab.com/product-foundations/illustration-directory
20
21
  */
21
22
  name: {
22
23
  type: String,
@@ -25,8 +26,9 @@ var script = {
25
26
  if (knownIllustrations.some(obj => obj.name === value)) {
26
27
  return true;
27
28
  }
28
- // eslint-disable-next-line no-console
29
- console.warn(`Illustration '${value}' is not a known illustration of @gitlab/svgs`);
29
+ logWarning(`Illustration '${value}' is not a known illustration of @gitlab/svgs`, {
30
+ name: 'GlIllustration'
31
+ });
30
32
  return false;
31
33
  }
32
34
  }
@@ -141,7 +141,10 @@ var script = {
141
141
  },
142
142
  mounted() {
143
143
  if (!this.ariaLabel && !this.title) {
144
- logWarning('[gl-modal]: Accessible name for modal missing. Please add title prop or aria-label.', this.$el);
144
+ logWarning('Accessible name for modal missing. Please add title prop or aria-label.', {
145
+ name: 'GlModal',
146
+ element: this.$el
147
+ });
145
148
  }
146
149
  },
147
150
  methods: {
@@ -90,8 +90,9 @@ var script = {
90
90
  default: 'bottom-start',
91
91
  validator: value => {
92
92
  if (['left', 'center', 'right'].includes(value)) {
93
- logWarning(`GlDisclosureDropdown/GlCollapsibleListbox: "${value}" placement is deprecated.
94
- Use ${dropdownPlacements[value]} instead.`);
93
+ logWarning(`"${value}" placement is deprecated. Use ${dropdownPlacements[value]} instead.`, {
94
+ name: 'GlDisclosureDropdown/GlCollapsibleListbox'
95
+ });
95
96
  }
96
97
  return Object.keys(dropdownPlacements).includes(value);
97
98
  }
@@ -307,8 +308,11 @@ var script = {
307
308
  methods: {
308
309
  checkToggleFocusable() {
309
310
  if (!isElementFocusable(this.toggleElement) && !isElementTabbable(this.toggleElement)) {
310
- logWarning(`GlDisclosureDropdown/GlCollapsibleListbox: Toggle is missing a 'tabindex' and cannot be focused.
311
- Use 'a' or 'button' element instead or make sure to add 'role="button"' along with 'tabindex' otherwise.`, this.$el);
311
+ logWarning(`Toggle is missing a 'tabindex' and cannot be focused.
312
+ Use 'a' or 'button' element instead or make sure to add 'role="button"' along with 'tabindex' otherwise.`, {
313
+ name: 'GlDisclosureDropdown/GlCollapsibleListbox',
314
+ element: this.$el
315
+ });
312
316
  }
313
317
  },
314
318
  getArrowOffsets(actualPlacement) {
@@ -1,6 +1,6 @@
1
1
  import clamp from 'lodash/clamp';
2
2
  import uniqueId from 'lodash/uniqueId';
3
- import { stopEvent } from '../../../../utils/utils';
3
+ import { logWarning, stopEvent } from '../../../../utils/utils';
4
4
  import { GL_DROPDOWN_SHOWN, GL_DROPDOWN_HIDDEN, POSITION_ABSOLUTE, POSITION_FIXED, GL_DROPDOWN_CONTENTS_CLASS, ARROW_UP, ENTER, ARROW_DOWN, END, HOME } from '../constants';
5
5
  import { buttonCategoryOptions, dropdownVariantOptions, buttonSizeOptions, dropdownPlacements } from '../../../../utils/constants';
6
6
  import GlButton from '../../button/button';
@@ -550,8 +550,9 @@ var script = {
550
550
  immediate: true,
551
551
  handler(newValue) {
552
552
  if (newValue && this.items.some(item => !isOption(item))) {
553
- // eslint-disable-next-line no-console
554
- console.warn('When using grouped options infinite scroll can only be used on the last group.');
553
+ logWarning('When using grouped options infinite scroll can only be used on the last group.', {
554
+ name: 'GlCollapsibleListbox'
555
+ });
555
556
  }
556
557
  }
557
558
  }
@@ -109,7 +109,10 @@ var script = {
109
109
  // logWarning will call isDev before logging any message
110
110
  // this additional call to isDev is being made to exit the condition early when run in production
111
111
  if (isDev() && !shouldUseFullTable(this)) {
112
- logWarning(glTableLiteWarning, this.$el);
112
+ logWarning(glTableLiteWarning, {
113
+ name: 'GlTable',
114
+ element: this.$el
115
+ });
113
116
  }
114
117
  },
115
118
  methods: {
@@ -1,6 +1,7 @@
1
1
  import isPlainObject from 'lodash/isPlainObject';
2
2
  import { BTab } from '../../../../vendor/bootstrap-vue/src/components/tabs/tab';
3
3
  import GlBadge from '../../badge/badge';
4
+ import { logWarning } from '../../../../utils/utils';
4
5
  import { DEFAULT_TAB_TITLE_LINK_CLASS } from '../constants';
5
6
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
6
7
 
@@ -67,9 +68,10 @@ var script = {
67
68
  }
68
69
  },
69
70
  created() {
70
- if (process.env.NODE_ENV !== 'production' && this.hasTabCount && !this.tabCountSrText) {
71
- // eslint-disable-next-line no-console
72
- console.warn('[GlTab] When using "tab-count", you should also provide "tab-count-sr-text" for screen reader accessibility. Example: :tab-count-sr-text="n__(\'%d item\', \'%d items\', count)"');
71
+ if (this.hasTabCount && !this.tabCountSrText) {
72
+ logWarning('When using "tab-count", you should also provide "tab-count-sr-text" for screen reader accessibility. Example: :tab-count-sr-text="n__(\'%d item\', \'%d items\', count)"', {
73
+ name: 'GlTab'
74
+ });
73
75
  }
74
76
  }
75
77
  };
@@ -157,14 +157,21 @@ function isDev() {
157
157
 
158
158
  /**
159
159
  * Prints a warning message to the console in non-test and non-production environments.
160
- * @param {string} message message to print to the console
161
- * @param {HTMLElement} element component that triggered the warning
160
+ * @param {string} message Message to print to the console.
161
+ * @param {Object} [context] Optional object with additional context.
162
+ * @param {string} [context.name] The name of the context of the message. Usually the component's name.
163
+ * @param {HTMLElement} [context.element] The element relevant to the message.
162
164
  */
163
- function logWarning() {
164
- let message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
165
- let element = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
166
- if (message.length && isDev()) {
167
- console.warn(message, element); // eslint-disable-line no-console
165
+ function logWarning(message) {
166
+ let context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
167
+ if (isDev()) {
168
+ const {
169
+ name,
170
+ element
171
+ } = context;
172
+ const formattedMessage = name ? `[${name}] ${message}` : message;
173
+ const args = element ? [formattedMessage, element] : [formattedMessage];
174
+ console.warn(...args); // eslint-disable-line no-console
168
175
  }
169
176
  }
170
177
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "126.3.1",
3
+ "version": "126.3.3",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -131,7 +131,7 @@
131
131
  "autoprefixer": "10.4.22",
132
132
  "axe-playwright": "^2.2.2",
133
133
  "babel-loader": "^9.2.1",
134
- "cypress": "14.5.4",
134
+ "cypress": "15.7.1",
135
135
  "cypress-real-events": "^1.15.0",
136
136
  "dompurify": "^3.1.2",
137
137
  "emoji-regex": "^10.6.0",
@@ -146,8 +146,8 @@
146
146
  "mockdate": "^3.0.5",
147
147
  "module-alias": "^2.2.3",
148
148
  "pikaday": "^1.8.0",
149
- "playwright": "^1.55.1",
150
- "playwright-core": "^1.55.1",
149
+ "playwright": "^1.57.0",
150
+ "playwright-core": "^1.57.0",
151
151
  "postcss": "8.5.6",
152
152
  "postcss-loader": "8.2.0",
153
153
  "postcss-scss": "4.0.9",
@@ -149,8 +149,8 @@ export default {
149
149
  mounted() {
150
150
  if (this.hasIconOnly && !this.$attrs['aria-label']) {
151
151
  logWarning(
152
- '[GlBadge] Icon-only badges require an aria-label for accessibility. The label should describe the metadata (e.g., "Due date", "Open issue"), not the icon name. See https://design.gitlab.com/components/badge#using-icon-only-badges',
153
- this.$el,
152
+ 'Icon-only badges require an aria-label for accessibility. The label should describe the metadata (e.g., "Due date", "Open issue"), not the icon name. See https://design.gitlab.com/components/badge#using-icon-only-badges',
153
+ { name: 'GlBadge', element: this.$el },
154
154
  );
155
155
  }
156
156
  },
@@ -369,10 +369,10 @@ export default {
369
369
  mounted() {
370
370
  // eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
371
371
  if (!this.$slots.default && !this.$attrs['aria-label'] && !this.$props.label) {
372
- logWarning(
373
- '[gl-button]: Accessible name missing. Please add inner text or aria-label.',
374
- this.$el,
375
- );
372
+ logWarning('Accessible name missing. Please add inner text or aria-label.', {
373
+ name: 'GlButton',
374
+ element: this.$el,
375
+ });
376
376
  }
377
377
  },
378
378
  methods: {
@@ -247,8 +247,8 @@ export default {
247
247
  isIconOnly() {
248
248
  return Boolean(
249
249
  this.icon &&
250
- (!this.text?.length || this.textSrOnly) &&
251
- !this.hasSlotContents('button-text'),
250
+ (!this.text?.length || this.textSrOnly) &&
251
+ !this.hasSlotContents('button-text'),
252
252
  );
253
253
  },
254
254
  isIconWithText() {
@@ -3,6 +3,7 @@ import isEqual from 'lodash/isEqual';
3
3
  import cloneDeep from 'lodash/cloneDeep';
4
4
  import { PortalTarget } from 'portal-vue';
5
5
  import { GlTooltipDirective } from '../../../directives/tooltip/tooltip';
6
+ import { logWarning } from '../../../utils/utils';
6
7
  import GlIcon from '../icon/icon.vue';
7
8
  import GlSearchBoxByClick from '../search_box_by_click/search_box_by_click.vue';
8
9
  import GlFilteredSearchTerm from './filtered_search_term.vue';
@@ -72,9 +73,9 @@ export default {
72
73
  // eslint-disable-next-line no-underscore-dangle
73
74
  const isOk = Array.isArray(value) && value.every(({ token }) => !token || token.__v_skip);
74
75
  if (!isOk) {
75
- // eslint-disable-next-line no-console
76
- console.warn(
76
+ logWarning(
77
77
  'You are using Vue3. In Vue3 each token component passed to filtered search must be wrapped into markRaw',
78
+ { name: 'GlFilteredSearch' },
78
79
  );
79
80
  }
80
81
 
@@ -2,6 +2,7 @@
2
2
  <script>
3
3
  import iconsPath from '@gitlab/svgs/dist/icons.svg';
4
4
  import iconsInfo from '@gitlab/svgs/dist/icons.json';
5
+ import { logWarning } from '../../../utils/utils';
5
6
  import { iconSizeOptions, iconVariantOptions } from '../../../utils/constants';
6
7
 
7
8
  const knownIcons = new Set(iconsInfo.icons);
@@ -27,7 +28,7 @@ export default {
27
28
  default: undefined,
28
29
  },
29
30
  /**
30
- * One of the icons from https://gitlab-org.gitlab.io/gitlab-svgs/ project
31
+ * One of the icons from https://design.gitlab.com/product-foundations/iconography-directory
31
32
  */
32
33
  name: {
33
34
  type: String,
@@ -36,8 +37,7 @@ export default {
36
37
  if (knownIcons.has(value)) {
37
38
  return true;
38
39
  }
39
- // eslint-disable-next-line no-console
40
- console.warn(`Icon '${value}' is not a known icon of @gitlab/svgs`);
40
+ logWarning(`Icon '${value}' is not a known icon of @gitlab/svgs`, { name: 'GlIcon' });
41
41
  return false;
42
42
  },
43
43
  },
@@ -2,6 +2,7 @@
2
2
  <script>
3
3
  import illustrationsPath from '@gitlab/svgs/dist/illustrations.svg';
4
4
  import illustrationsInfo from '@gitlab/svgs/dist/illustrations.json';
5
+ import { logWarning } from '../../../utils/utils';
5
6
 
6
7
  const knownIllustrations = illustrationsInfo.icons;
7
8
 
@@ -15,7 +16,7 @@ export default {
15
16
  name: 'GlIllustration',
16
17
  props: {
17
18
  /**
18
- * One of the illustrations from https://gitlab-org.gitlab.io/gitlab-svgs/ project
19
+ * One of the illustrations from https://design.gitlab.com/product-foundations/illustration-directory
19
20
  */
20
21
  name: {
21
22
  type: String,
@@ -24,8 +25,9 @@ export default {
24
25
  if (knownIllustrations.some((obj) => obj.name === value)) {
25
26
  return true;
26
27
  }
27
- // eslint-disable-next-line no-console
28
- console.warn(`Illustration '${value}' is not a known illustration of @gitlab/svgs`);
28
+ logWarning(`Illustration '${value}' is not a known illustration of @gitlab/svgs`, {
29
+ name: 'GlIllustration',
30
+ });
29
31
  return false;
30
32
  },
31
33
  },
@@ -141,19 +141,19 @@ export default {
141
141
  shouldRenderModalFooter() {
142
142
  return Boolean(
143
143
  this.actionCancel ||
144
- this.actionSecondary ||
145
- this.actionPrimary ||
146
- // eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
147
- this.$slots['modal-footer'],
144
+ this.actionSecondary ||
145
+ this.actionPrimary ||
146
+ // eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
147
+ this.$slots['modal-footer'],
148
148
  );
149
149
  },
150
150
  },
151
151
  mounted() {
152
152
  if (!this.ariaLabel && !this.title) {
153
- logWarning(
154
- '[gl-modal]: Accessible name for modal missing. Please add title prop or aria-label.',
155
- this.$el,
156
- );
153
+ logWarning('Accessible name for modal missing. Please add title prop or aria-label.', {
154
+ name: 'GlModal',
155
+ element: this.$el,
156
+ });
157
157
  }
158
158
  },
159
159
  methods: {
@@ -121,8 +121,8 @@ export default {
121
121
  validator: (value) => {
122
122
  if (['left', 'center', 'right'].includes(value)) {
123
123
  logWarning(
124
- `GlDisclosureDropdown/GlCollapsibleListbox: "${value}" placement is deprecated.
125
- Use ${dropdownPlacements[value]} instead.`,
124
+ `"${value}" placement is deprecated. Use ${dropdownPlacements[value]} instead.`,
125
+ { name: 'GlDisclosureDropdown/GlCollapsibleListbox' },
126
126
  );
127
127
  }
128
128
 
@@ -347,9 +347,12 @@ export default {
347
347
  checkToggleFocusable() {
348
348
  if (!isElementFocusable(this.toggleElement) && !isElementTabbable(this.toggleElement)) {
349
349
  logWarning(
350
- `GlDisclosureDropdown/GlCollapsibleListbox: Toggle is missing a 'tabindex' and cannot be focused.
350
+ `Toggle is missing a 'tabindex' and cannot be focused.
351
351
  Use 'a' or 'button' element instead or make sure to add 'role="button"' along with 'tabindex' otherwise.`,
352
- this.$el,
352
+ {
353
+ name: 'GlDisclosureDropdown/GlCollapsibleListbox',
354
+ element: this.$el,
355
+ },
353
356
  );
354
357
  }
355
358
  },
@@ -2,7 +2,7 @@
2
2
  <script>
3
3
  import clamp from 'lodash/clamp';
4
4
  import uniqueId from 'lodash/uniqueId';
5
- import { stopEvent } from '../../../../utils/utils';
5
+ import { stopEvent, logWarning } from '../../../../utils/utils';
6
6
  import {
7
7
  GL_DROPDOWN_SHOWN,
8
8
  GL_DROPDOWN_HIDDEN,
@@ -587,9 +587,9 @@ export default {
587
587
  immediate: true,
588
588
  handler(newValue) {
589
589
  if (newValue && this.items.some((item) => !isOption(item))) {
590
- // eslint-disable-next-line no-console
591
- console.warn(
590
+ logWarning(
592
591
  'When using grouped options infinite scroll can only be used on the last group.',
592
+ { name: 'GlCollapsibleListbox' },
593
593
  );
594
594
  }
595
595
  },
@@ -105,7 +105,7 @@ export default {
105
105
  // logWarning will call isDev before logging any message
106
106
  // this additional call to isDev is being made to exit the condition early when run in production
107
107
  if (isDev() && !shouldUseFullTable(this)) {
108
- logWarning(glTableLiteWarning, this.$el);
108
+ logWarning(glTableLiteWarning, { name: 'GlTable', element: this.$el });
109
109
  }
110
110
  },
111
111
  methods: {
@@ -3,6 +3,7 @@
3
3
  import isPlainObject from 'lodash/isPlainObject';
4
4
  import { BTab } from '../../../../vendor/bootstrap-vue/src/components/tabs/tab';
5
5
  import GlBadge from '../../badge/badge.vue';
6
+ import { logWarning } from '../../../../utils/utils';
6
7
 
7
8
  import { DEFAULT_TAB_TITLE_LINK_CLASS } from '../constants';
8
9
 
@@ -63,10 +64,10 @@ export default {
63
64
  },
64
65
  },
65
66
  created() {
66
- if (process.env.NODE_ENV !== 'production' && this.hasTabCount && !this.tabCountSrText) {
67
- // eslint-disable-next-line no-console
68
- console.warn(
69
- '[GlTab] When using "tab-count", you should also provide "tab-count-sr-text" for screen reader accessibility. Example: :tab-count-sr-text="n__(\'%d item\', \'%d items\', count)"',
67
+ if (this.hasTabCount && !this.tabCountSrText) {
68
+ logWarning(
69
+ 'When using "tab-count", you should also provide "tab-count-sr-text" for screen reader accessibility. Example: :tab-count-sr-text="n__(\'%d item\', \'%d items\', count)"',
70
+ { name: 'GlTab' },
70
71
  );
71
72
  }
72
73
  },