@gitlab/ui 127.0.0 → 127.1.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 (96) hide show
  1. package/dist/components/base/alert/alert.js +0 -2
  2. package/dist/components/base/avatar/avatar.js +0 -2
  3. package/dist/components/base/badge/badge.js +0 -2
  4. package/dist/components/base/breadcrumb/breadcrumb.js +0 -2
  5. package/dist/components/base/button/button.js +0 -2
  6. package/dist/components/base/card/card.js +0 -2
  7. package/dist/components/base/collapse/collapse.js +0 -2
  8. package/dist/components/base/datepicker/datepicker.js +0 -2
  9. package/dist/components/base/drawer/drawer.js +0 -2
  10. package/dist/components/base/filtered_search/filtered_search.js +9 -7
  11. package/dist/components/base/filtered_search/filtered_search_suggestion_list.js +2 -2
  12. package/dist/components/base/filtered_search/filtered_search_token_segment.js +10 -2
  13. package/dist/components/base/filtered_search/filtered_search_utils.js +2 -1
  14. package/dist/components/base/form/form.js +0 -2
  15. package/dist/components/base/icon/icon.js +0 -2
  16. package/dist/components/base/illustration/illustration.js +0 -2
  17. package/dist/components/base/label/label.js +0 -2
  18. package/dist/components/base/link/link.js +0 -2
  19. package/dist/components/base/markdown/markdown.js +0 -2
  20. package/dist/components/base/modal/modal.js +0 -2
  21. package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown.js +0 -2
  22. package/dist/components/base/new_dropdowns/listbox/listbox.js +0 -2
  23. package/dist/components/base/pagination/pagination.js +1 -3
  24. package/dist/components/base/path/path.js +0 -2
  25. package/dist/components/base/popover/popover.js +0 -2
  26. package/dist/components/base/table/table.js +0 -2
  27. package/dist/components/base/tabs/tab/tab.js +0 -2
  28. package/dist/components/base/tabs/tabs/tabs.js +0 -2
  29. package/dist/components/base/toast/toast.js +2 -1
  30. package/dist/components/base/toggle/toggle.js +0 -2
  31. package/dist/components/base/token/token.js +0 -2
  32. package/dist/components/base/tooltip/tooltip.js +0 -2
  33. package/dist/components/charts/area/area.js +15 -1
  34. package/dist/components/charts/bar/bar.js +0 -3
  35. package/dist/components/charts/chart/chart.js +0 -3
  36. package/dist/components/charts/column/column.js +0 -2
  37. package/dist/components/charts/gauge/gauge.js +0 -2
  38. package/dist/components/charts/heatmap/heatmap.js +0 -2
  39. package/dist/components/charts/legend/legend.js +0 -2
  40. package/dist/components/charts/line/line.js +17 -1
  41. package/dist/components/charts/shared/tooltip/tooltip.js +0 -2
  42. package/dist/components/charts/sparkline/sparkline.js +0 -3
  43. package/dist/components/utilities/intersperse/intersperse.js +0 -2
  44. package/dist/components/utilities/sprintf/sprintf.js +1 -2
  45. package/dist/components/utilities/truncate/truncate.js +0 -2
  46. package/dist/index.css +1 -1
  47. package/dist/index.css.map +1 -1
  48. package/package.json +1 -1
  49. package/src/components/base/alert/alert.vue +0 -1
  50. package/src/components/base/avatar/avatar.vue +0 -1
  51. package/src/components/base/badge/badge.vue +0 -1
  52. package/src/components/base/breadcrumb/breadcrumb.vue +0 -1
  53. package/src/components/base/button/button.vue +0 -1
  54. package/src/components/base/card/card.vue +0 -1
  55. package/src/components/base/collapse/collapse.vue +0 -1
  56. package/src/components/base/datepicker/datepicker.vue +0 -1
  57. package/src/components/base/drawer/drawer.vue +0 -1
  58. package/src/components/base/dropdown/dropdown.vue +1 -1
  59. package/src/components/base/filtered_search/filtered_search.vue +8 -7
  60. package/src/components/base/filtered_search/filtered_search_suggestion_list.vue +2 -2
  61. package/src/components/base/filtered_search/filtered_search_token_segment.vue +15 -2
  62. package/src/components/base/filtered_search/filtered_search_utils.js +2 -0
  63. package/src/components/base/form/form.vue +0 -1
  64. package/src/components/base/icon/icon.vue +0 -1
  65. package/src/components/base/illustration/illustration.vue +0 -1
  66. package/src/components/base/label/label.vue +0 -1
  67. package/src/components/base/link/link.vue +0 -1
  68. package/src/components/base/markdown/markdown.vue +0 -1
  69. package/src/components/base/modal/modal.vue +0 -1
  70. package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.vue +0 -1
  71. package/src/components/base/new_dropdowns/listbox/listbox.vue +0 -1
  72. package/src/components/base/pagination/pagination.vue +1 -2
  73. package/src/components/base/path/path.vue +0 -1
  74. package/src/components/base/popover/popover.vue +0 -1
  75. package/src/components/base/table/table.vue +0 -1
  76. package/src/components/base/tabs/tab/tab.vue +0 -1
  77. package/src/components/base/tabs/tabs/tabs.vue +0 -1
  78. package/src/components/base/toast/toast.js +1 -0
  79. package/src/components/base/toast/toast.scss +18 -2
  80. package/src/components/base/toggle/toggle.vue +0 -1
  81. package/src/components/base/token/token.vue +0 -1
  82. package/src/components/base/tooltip/tooltip.vue +0 -1
  83. package/src/components/charts/area/area.vue +0 -1
  84. package/src/components/charts/bar/bar.vue +0 -1
  85. package/src/components/charts/chart/chart.vue +0 -1
  86. package/src/components/charts/column/column.vue +0 -1
  87. package/src/components/charts/gauge/gauge.vue +0 -1
  88. package/src/components/charts/heatmap/heatmap.vue +0 -1
  89. package/src/components/charts/legend/legend.vue +0 -1
  90. package/src/components/charts/line/line.vue +0 -1
  91. package/src/components/charts/shared/tooltip/tooltip.vue +0 -1
  92. package/src/components/charts/sparkline/sparkline.vue +0 -1
  93. package/src/components/utilities/intersperse/intersperse.vue +0 -1
  94. package/src/components/utilities/sprintf/sprintf.vue +0 -1
  95. package/src/components/utilities/truncate/truncate.vue +0 -1
  96. package/tailwind.defaults.js +12 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "127.0.0",
3
+ "version": "127.1.1",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import { translate } from '../../../utils/i18n';
4
3
  import {
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import isNumber from 'lodash/isNumber';
4
3
  import { avatarShapeOptions, avatarSizeOptions } from '../../../utils/constants';
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import GlLink from '../link/link.vue';
4
3
  import {
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import debounce from 'lodash/debounce';
4
3
  import { translate } from '../../../utils/i18n';
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import GlLink from '../link/link.vue';
4
3
  import {
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  export default {
4
3
  name: 'GlCard',
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  export default {
4
3
  name: 'GlCollapse',
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import isString from 'lodash/isString';
4
3
  import Pikaday from 'pikaday';
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import isEmpty from 'lodash/isEmpty';
4
3
  import { maxZIndex, drawerVariants } from '../../../utils/constants';
@@ -1,4 +1,4 @@
1
- <!-- eslint-disable vue/multi-word-component-names vue/one-component-per-file -->
1
+ <!-- eslint-disable vue/one-component-per-file -->
2
2
  <script>
3
3
  import Vue from 'vue';
4
4
  import merge from 'lodash/merge';
@@ -24,6 +24,11 @@ function initialState() {
24
24
  return [createTerm()];
25
25
  }
26
26
 
27
+ function computeTokens(value, termsAsTokens) {
28
+ const resolved = value?.length ? cloneDeep(value) : initialState();
29
+ return needDenormalization(resolved) ? denormalizeTokens(resolved, termsAsTokens) : resolved;
30
+ }
31
+
27
32
  export default {
28
33
  name: 'GlFilteredSearch',
29
34
  components: {
@@ -174,7 +179,7 @@ export default {
174
179
  },
175
180
  data() {
176
181
  return {
177
- tokens: initialState(),
182
+ tokens: computeTokens(this.value, this.termsAsTokens),
178
183
  activeTokenIdx: null,
179
184
  suggestionsStyle: {},
180
185
  intendedCursorPosition: 'end',
@@ -239,20 +244,16 @@ export default {
239
244
  value: {
240
245
  handler(newValue, oldValue) {
241
246
  if (!isEqual(newValue, oldValue)) {
242
- const value = newValue.length ? newValue : initialState();
243
- this.applyNewValue(cloneDeep(value));
247
+ this.applyNewValue(newValue);
244
248
  }
245
249
  },
246
250
  deep: true,
247
- immediate: true,
248
251
  },
249
252
  },
250
253
 
251
254
  methods: {
252
255
  applyNewValue(newValue) {
253
- this.tokens = needDenormalization(newValue)
254
- ? denormalizeTokens(newValue, this.termsAsTokens)
255
- : newValue;
256
+ this.tokens = computeTokens(newValue, this.termsAsTokens);
256
257
  },
257
258
 
258
259
  isActiveToken(idx) {
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import { stepIndexAndWrap } from './filtered_search_utils';
2
+ import { stepIndexAndWrap, FILTERED_SEARCH_SUGGESTIONS_CLASS } from './filtered_search_utils';
3
3
 
4
4
  const DEFER_TO_INITIAL_VALUE = -1;
5
5
  const NO_ACTIVE_ITEM = -2;
@@ -45,7 +45,7 @@ export default {
45
45
  return this.registeredItems[this.activeIdx];
46
46
  },
47
47
  listClasses() {
48
- return [this.suggestionsListClass(), 'dropdown-menu gl-filtered-search-suggestion-list'];
48
+ return [this.suggestionsListClass(), `dropdown-menu ${FILTERED_SEARCH_SUGGESTIONS_CLASS}`];
49
49
  },
50
50
  },
51
51
 
@@ -4,7 +4,13 @@ import { Portal } from 'portal-vue';
4
4
  import { LEFT_MOUSE_BUTTON } from '../../../utils/constants';
5
5
  import GlFilteredSearchSuggestion from './filtered_search_suggestion.vue';
6
6
  import GlFilteredSearchSuggestionList from './filtered_search_suggestion_list.vue';
7
- import { splitOnQuotes, wrapTokenInQuotes, match, TERM_TOKEN_TYPE } from './filtered_search_utils';
7
+ import {
8
+ splitOnQuotes,
9
+ wrapTokenInQuotes,
10
+ match,
11
+ TERM_TOKEN_TYPE,
12
+ FILTERED_SEARCH_SUGGESTIONS_CLASS,
13
+ } from './filtered_search_utils';
8
14
 
9
15
  // We need some helpers to ensure @vue/compat compatibility
10
16
  // @vue/compat will render comment nodes for v-if and comments in HTML
@@ -410,7 +416,14 @@ export default {
410
416
  });
411
417
  },
412
418
 
413
- handleBlur() {
419
+ handleBlur(e) {
420
+ // Keep focus on input when blur event is on same element
421
+ // (e.g. scrollbar in filtered search suggestions list)
422
+ if (e.relatedTarget?.classList.contains(FILTERED_SEARCH_SUGGESTIONS_CLASS)) {
423
+ this.$refs.input?.focus();
424
+ return;
425
+ }
426
+
414
427
  if (this.multiSelect) {
415
428
  this.$emit('complete');
416
429
  } else if (this.active) {
@@ -9,6 +9,8 @@ export const INTENT_ACTIVATE_PREVIOUS = 'intent-activate-previous';
9
9
 
10
10
  export const TOKEN_CLOSE_SELECTOR = '.gl-token-close';
11
11
 
12
+ export const FILTERED_SEARCH_SUGGESTIONS_CLASS = 'gl-filtered-search-suggestion-list';
13
+
12
14
  export function isEmptyTerm(token) {
13
15
  return token.type === TERM_TOKEN_TYPE && token.value.data.trim() === '';
14
16
  }
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  export default {
4
3
  name: 'GlForm',
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import iconsPath from '@gitlab/svgs/dist/icons.svg';
4
3
  import iconsInfo from '@gitlab/svgs/dist/icons.json';
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import illustrationsPath from '@gitlab/svgs/dist/illustrations.svg';
4
3
  import illustrationsInfo from '@gitlab/svgs/dist/illustrations.json';
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import { labelColorOptions } from '../../../utils/constants';
4
3
  import { colorFromBackground } from '../../../utils/utils';
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import isFunction from 'lodash/isFunction';
4
3
  import isString from 'lodash/isString';
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  export default {
4
3
  name: 'GlMarkdown',
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import { BModal } from '../../../vendor/bootstrap-vue/src/components/modal/modal';
4
3
  import { translate } from '../../../utils/i18n';
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import clamp from 'lodash/clamp';
4
3
  import uniqueId from 'lodash/uniqueId';
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import clamp from 'lodash/clamp';
4
3
  import uniqueId from 'lodash/uniqueId';
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import debounce from 'lodash/debounce';
4
3
  import isFunction from 'lodash/isFunction';
@@ -12,7 +11,7 @@ import GlLink from '../link/link.vue';
12
11
  const pageRange = (from, to) => range(from, to + 1, 1);
13
12
 
14
13
  export default {
15
- name: 'Pagination',
14
+ name: 'GlPagination',
16
15
  components: {
17
16
  GlLink,
18
17
  GlIcon,
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import iconSpriteInfo from '@gitlab/svgs/dist/icons.json';
4
3
  import uniqueId from 'lodash/uniqueId';
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import { BPopover } from '../../../vendor/bootstrap-vue/src/components/popover/popover';
4
3
  import tooltipMixin from '../../mixins/tooltip_mixin';
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import { BTable } from '../../../vendor/bootstrap-vue/src/components/table/table';
4
3
  import { logWarning, isDev } from '../../../utils/utils';
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import isPlainObject from 'lodash/isPlainObject';
4
3
  import { BTab } from '../../../../vendor/bootstrap-vue/src/components/tabs/tab';
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import { BTabs } from '../../../../vendor/bootstrap-vue/src/components/tabs/tabs';
4
3
  import { tabsButtonDefaults } from '../../../../utils/constants';
@@ -9,6 +9,7 @@ const DEFAULT_OPTIONS = {
9
9
  toastClass: 'gl-toast',
10
10
  isStatus: true,
11
11
  toaster: 'b-toaster-bottom-left',
12
+ appendToast: true,
12
13
  };
13
14
 
14
15
  let toastsCount = 0;
@@ -7,13 +7,20 @@
7
7
  .b-toaster-slot {
8
8
  @apply gl-w-auto;
9
9
  @apply gl-flex;
10
+ @apply gl-flex-col;
11
+ @apply gl-gap-4;
10
12
  bottom: $gl-spacing-scale-6;
11
13
  left: $gl-spacing-scale-6;
12
14
  right: auto;
13
- flex-direction: column-reverse;
14
- gap: $gl-spacing-scale-4;
15
15
  view-transition-name: gl-toast;
16
16
 
17
+ // Fallback for Firefox
18
+ // Fixes a bug where the view transition
19
+ // doesn’t work properly
20
+ @supports (-moz-appearance:none) {
21
+ view-transition-name: unset;
22
+ }
23
+
17
24
  @include media-breakpoint-down(xs) {
18
25
  @apply gl-w-full;
19
26
  left: 0;
@@ -22,6 +29,15 @@
22
29
  }
23
30
  }
24
31
 
32
+ .b-toast {
33
+ // Fallback for Firefox
34
+ // Fixes a bug where the view transition
35
+ // doesn’t work properly
36
+ @supports (-moz-appearance:none) {
37
+ transition: all $gl-transition-duration-medium $gl-easing-out-cubic;
38
+ }
39
+ }
40
+
25
41
  .gl-toast {
26
42
  @apply gl-text-base;
27
43
  @apply gl-py-5;
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import uniqueId from 'lodash/uniqueId';
4
3
 
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import { tokenVariants } from '../../../utils/constants';
4
3
  import { translate } from '../../../utils/i18n';
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import { BTooltip } from '../../../vendor/bootstrap-vue/src/components/tooltip/tooltip';
4
3
  import { tooltipDelay } from '../../../utils/constants';
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  /**
4
3
  * Area charts as of %12.10 support annotations.
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import merge from 'lodash/merge';
4
3
  import truncate from 'lodash/truncate';
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import * as echarts from 'echarts';
4
3
  import merge from 'lodash/merge';
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import merge from 'lodash/merge';
4
3
  import {
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import merge from 'lodash/merge';
4
3
  import uniq from 'lodash/uniq';
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import merge from 'lodash/merge';
4
3
  import { GL_COLOR_NEUTRAL_0, GL_COLOR_NEUTRAL_100 } from '../../../tokens/build/js/tokens';
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import * as echarts from 'echarts';
4
3
  import { defaultFontSize } from '../../../utils/charts/config';
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  /**
4
3
  * Line charts as of %12.10 support annotations.
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import * as echarts from 'echarts';
4
3
  import { uid, debounceByAnimationFrame } from '../../../../utils/utils';
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import merge from 'lodash/merge';
4
3
  import isNil from 'lodash/isNil';
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import Vue from 'vue';
4
3
  import compose from 'lodash/fp/compose';
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  /* eslint-disable no-continue */
4
3
  import has from 'lodash/has';
@@ -1,4 +1,3 @@
1
- <!-- eslint-disable vue/multi-word-component-names -->
2
1
  <script>
3
2
  import { GlTooltipDirective } from '../../../directives/tooltip/tooltip';
4
3
  import { GlResizeObserverDirective } from '../../../directives/resize_observer/resize_observer';
@@ -44,6 +44,18 @@ function addCustomDefinitions({ addComponents, addUtilities }) {
44
44
  'border-color': 'var(--gl-action-neutral-border-color-active)',
45
45
  },
46
46
  },
47
+ '.bg-action-neutral': {
48
+ 'background-color': 'var(--gl-action-neutral-background-color-default)',
49
+ '&:hover': {
50
+ 'background-color': 'var(--gl-action-neutral-background-color-hover)',
51
+ },
52
+ '&:focus': {
53
+ 'background-color': 'var(--gl-action-neutral-background-color-focus)',
54
+ },
55
+ '&:active': {
56
+ 'background-color': 'var(--gl-action-neutral-background-color-active)',
57
+ },
58
+ },
47
59
  '.animate-skeleton-loader': {
48
60
  overflow: 'hidden',
49
61
  'max-width': '32rem',