@gitlab/ui 72.5.2 → 72.7.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 (49) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +2 -14
  3. package/dist/components/base/avatars_inline/avatars_inline.js +6 -12
  4. package/dist/components/regions/empty_state/empty_state.js +1 -1
  5. package/dist/index.css +1 -1
  6. package/dist/index.css.map +1 -1
  7. package/dist/tokens/css/tokens.css +1 -1
  8. package/dist/tokens/css/tokens.dark.css +1 -1
  9. package/dist/tokens/js/tokens.dark.js +1 -1
  10. package/dist/tokens/js/tokens.js +1 -1
  11. package/dist/tokens/scss/_tokens.dark.scss +1 -1
  12. package/dist/tokens/scss/_tokens.scss +1 -1
  13. package/dist/utility_classes.css +1 -1
  14. package/dist/utility_classes.css.map +1 -1
  15. package/dist/utils/constants.js +1 -1
  16. package/package.json +12 -10
  17. package/src/components/base/accordion/accordion_item.stories.js +1 -1
  18. package/src/components/base/alert/alert.stories.js +4 -12
  19. package/src/components/base/avatar/avatar.scss +2 -3
  20. package/src/components/base/avatars_inline/avatars_inline.md +1 -1
  21. package/src/components/base/avatars_inline/avatars_inline.scss +55 -19
  22. package/src/components/base/avatars_inline/avatars_inline.vue +10 -30
  23. package/src/components/base/badge/badge.stories.js +2 -6
  24. package/src/components/base/broadcast_message/broadcast_message.stories.js +1 -3
  25. package/src/components/base/icon/icon.stories.js +1 -1
  26. package/src/components/base/new_dropdowns/listbox/listbox.stories.js +1 -3
  27. package/src/components/base/popover/popover.stories.js +1 -3
  28. package/src/components/base/tabs/tabs/tabs.stories.js +1 -3
  29. package/src/components/base/token_selector/token_selector.stories.js +1 -1
  30. package/src/components/charts/area/area.stories.js +1 -3
  31. package/src/components/charts/chart/chart.stories.js +1 -3
  32. package/src/components/charts/line/line.stories.js +1 -3
  33. package/src/components/charts/sparkline/sparkline.stories.js +2 -2
  34. package/src/components/experimental/duo/user_feedback/user_feedback.stories.js +1 -1
  35. package/src/components/experimental/experiment_badge/experiment_badge.stories.js +1 -1
  36. package/src/components/regions/empty_state/empty_state.vue +0 -1
  37. package/src/components/utilities/animated_number/animated_number.stories.js +1 -0
  38. package/src/components/utilities/intersection_observer/intersection_observer.stories.js +1 -1
  39. package/src/components/utilities/sprintf/sprintf.stories.js +4 -4
  40. package/src/components/utilities/truncate/truncate.stories.js +1 -1
  41. package/src/components/utilities/truncate_text/truncate_text.stories.js +1 -1
  42. package/src/directives/hover_load/hover_load.stories.js +1 -1
  43. package/src/directives/outside/outside.stories.js +1 -3
  44. package/src/directives/resize_observer/resize_observer.stories.js +1 -1
  45. package/src/directives/safe_html/safe_html.stories.js +1 -1
  46. package/src/directives/safe_link/safe_link.stories.js +1 -1
  47. package/src/scss/utilities.scss +8 -0
  48. package/src/scss/utility-mixins/sizing.scss +4 -0
  49. package/src/utils/constants.js +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,22 @@
1
+ # [72.7.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v72.6.0...v72.7.0) (2024-01-14)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **GlEmptyState:** remove incorrect role from img ([9e5d86f](https://gitlab.com/gitlab-org/gitlab-ui/commit/9e5d86f9c9cbeaae2f7c179f56dbbbab633890e1))
7
+
8
+
9
+ ### Features
10
+
11
+ * **css:** adds gl-max-w-12 utility class ([58254e6](https://gitlab.com/gitlab-org/gitlab-ui/commit/58254e6458e2efc8e0f9c74a80bc9d90396b5404))
12
+
13
+ # [72.6.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v72.5.2...v72.6.0) (2024-01-11)
14
+
15
+
16
+ ### Features
17
+
18
+ * **Avatar:** Update design and stacks ([cd50241](https://gitlab.com/gitlab-org/gitlab-ui/commit/cd5024198711608554a78eb918604ab72735367b))
19
+
1
20
  ## [72.5.2](https://gitlab.com/gitlab-org/gitlab-ui/compare/v72.5.1...v72.5.2) (2024-01-11)
2
21
 
3
22
 
package/README.md CHANGED
@@ -98,20 +98,8 @@ jest run them.
98
98
 
99
99
  ### Visual regression tests
100
100
 
101
- GitLab UI uses visual snapshot tests to prevent introducing unexpected regressions with CSS and
102
- layout changes on components. The tool we use is
103
- [storyshots](https://github.com/storybookjs/storybook/tree/master/addons/storyshots/storyshots-core),
104
- a storybook addon. Read the project documentation to understand how visual snapshots work.
105
-
106
- There is a visual snapshot of every component’s storybook story. To run the tests, use the
107
- `yarn test:visual` command. This command runs on the CI environment and will fail if the component
108
- visual appearance changes.
109
-
110
- #### Updating visual snapshot baseline images
111
-
112
- In some occasions, the changes in a component’s appearance are justified. In those cases, we have to
113
- update the baseline images to match the new look. See our
114
- [visual testing documentation](doc/contributing/visual_testing.md) for how to do that.
101
+ GitLab UI uses visual snapshot tests to prevent introducing regressions with CSS and
102
+ layout changes on components. Read more on this in the [visual testing documentation](doc/contributing/visual_testing.md).
115
103
 
116
104
  #### GitLab visual regression tests
117
105
 
@@ -56,7 +56,11 @@ var script = {
56
56
  return this.collapsed ? this.avatars.slice(0, this.maxVisible) : this.avatars;
57
57
  },
58
58
  badgeSize() {
59
- return this.avatarSize === 24 ? 'md' : 'lg';
59
+ return {
60
+ 16: 'sm',
61
+ 24: 'md',
62
+ 32: 'lg'
63
+ }[this.avatarSize] || 'lg';
60
64
  },
61
65
  badgeLabel() {
62
66
  return `+${this.hiddenAvatars.length}`;
@@ -73,16 +77,6 @@ var script = {
73
77
  length: this.badgeTooltipMaxChars
74
78
  }) : tooltipTitle;
75
79
  }
76
- },
77
- methods: {
78
- calcAvatarStyles(avatarIndex) {
79
- // According to pajamas, overlap is 25% of the avatar height
80
- const overlap = this.avatarSize * 0.25;
81
- const marginRight = avatarIndex === this.maxVisible || avatarIndex === this.avatars.length - 1 || !this.collapsed ? undefined : `-${overlap}px`;
82
- return {
83
- marginRight
84
- };
85
- }
86
80
  }
87
81
  };
88
82
 
@@ -90,7 +84,7 @@ var script = {
90
84
  const __vue_script__ = script;
91
85
 
92
86
  /* template */
93
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-avatars-inline"},[_vm._l((_vm.visibleAvatars),function(avatar,index){return _c('div',{key:index,staticClass:"gl-avatars-inline-child",style:(_vm.calcAvatarStyles(index))},[_vm._t("avatar",function(){return [_c('gl-avatar',_vm._b({attrs:{"size":_vm.avatarSize}},'gl-avatar',avatar,false))]},{"avatar":avatar})],2)}),_vm._v(" "),(_vm.collapsed && _vm.collapsable)?_c('div',{staticClass:"gl-avatars-inline-child",style:(_vm.calcAvatarStyles(_vm.visibleAvatars.length))},[(_vm.badgeTooltipProp)?_c('gl-tooltip',{attrs:{"target":function () { return _vm.$refs.badge; }}},[_vm._v("\n "+_vm._s(_vm.badgeTooltipTitle)+"\n ")]):_vm._e(),_vm._v(" "),_c('span',{ref:"badge",class:['gl-avatars-inline-badge', _vm.badgeSize],attrs:{"data-testid":"collapsed-avatars-badge","aria-hidden":"true"}},[_vm._v("\n "+_vm._s(_vm.badgeLabel)+"\n ")]),_vm._v(" "),_c('span',{staticClass:"sr-only",attrs:{"data-testid":"badge-sr-only-text"}},[_vm._v(_vm._s(_vm.badgeSrOnlyText))])],1):_vm._e()],2)};
87
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-avatars-inline",class:("gl-avatars-inline-" + _vm.badgeSize)},[_vm._l((_vm.visibleAvatars),function(avatar,index){return _c('div',{key:index,staticClass:"gl-avatars-inline-child"},[_vm._t("avatar",function(){return [_c('gl-avatar',_vm._b({attrs:{"size":_vm.avatarSize}},'gl-avatar',avatar,false))]},{"avatar":avatar})],2)}),_vm._v(" "),(_vm.collapsed && _vm.collapsable)?_c('div',{staticClass:"gl-avatars-inline-child"},[(_vm.badgeTooltipProp)?_c('gl-tooltip',{attrs:{"target":function () { return _vm.$refs.badge; }}},[_vm._v("\n "+_vm._s(_vm.badgeTooltipTitle)+"\n ")]):_vm._e(),_vm._v(" "),_c('span',{ref:"badge",class:['gl-avatars-inline-badge', _vm.badgeSize],attrs:{"data-testid":"collapsed-avatars-badge","aria-hidden":"true"}},[_vm._v("\n "+_vm._s(_vm.badgeLabel)+"\n ")]),_vm._v(" "),_c('span',{staticClass:"sr-only",attrs:{"data-testid":"badge-sr-only-text"}},[_vm._v(_vm._s(_vm.badgeSrOnlyText))])],1):_vm._e()],2)};
94
88
  var __vue_staticRenderFns__ = [];
95
89
 
96
90
  /* style */
@@ -119,7 +119,7 @@ const __vue_script__ = script;
119
119
  var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('section',{staticClass:"gl-display-flex",class:{
120
120
  'gl-empty-state gl-text-center gl-flex-direction-column': !_vm.compact,
121
121
  'gl-flex-direction-row': _vm.compact,
122
- }},[_c('div',{class:{ 'gl-display-none gl-sm-display-block gl-px-4': _vm.compact, 'gl-max-w-full': !_vm.compact }},[(_vm.svgPath)?_c('img',{staticClass:"gl-max-w-full",class:{ 'gl-dark-invert-keep-hue': _vm.invertInDarkMode },attrs:{"src":_vm.svgPath,"alt":"","role":"img","height":_vm.height}}):_vm._e()]),_vm._v(" "),_c('div',{staticClass:"gl-empty-state-content gl-mx-auto gl-my-0",class:_vm.contentClasses,attrs:{"data-testid":"gl-empty-state-content"}},[_vm._t("title",function(){return [_c('h1',{staticClass:"gl-font-size-h-display gl-line-height-36 gl-mt-0 gl-mb-0",class:_vm.compact ? 'h5' : 'h4'},[_vm._v("\n "+_vm._s(_vm.title)+"\n ")])]}),_vm._v(" "),(_vm.description || _vm.$scopedSlots.description)?_c('p',{ref:"description",staticClass:"gl-mt-4 gl-mb-0"},[_vm._t("description",function(){return [_vm._v("\n "+_vm._s(_vm.description)+"\n ")]})],2):_vm._e(),_vm._v(" "),_c('div',{staticClass:"gl-display-flex gl-flex-wrap gl-mt-5",class:{ 'gl-justify-content-center': !_vm.compact }},[_vm._t("actions",function(){return [(_vm.shouldRenderPrimaryButton)?_c('gl-button',{staticClass:"gl-mb-3",class:_vm.compact ? 'gl-mr-3' : 'gl-mx-2',attrs:{"variant":"confirm","href":_vm.primaryButtonLink}},[_vm._v(_vm._s(_vm.primaryButtonText))]):_vm._e(),_vm._v(" "),(_vm.shouldRenderSecondaryButton)?_c('gl-button',{staticClass:"gl-mb-3 gl-mr-3",class:{ 'gl-mx-2!': !_vm.compact },attrs:{"href":_vm.secondaryButtonLink}},[_vm._v(_vm._s(_vm.secondaryButtonText)+"\n ")]):_vm._e()]})],2)],2)])};
122
+ }},[_c('div',{class:{ 'gl-display-none gl-sm-display-block gl-px-4': _vm.compact, 'gl-max-w-full': !_vm.compact }},[(_vm.svgPath)?_c('img',{staticClass:"gl-max-w-full",class:{ 'gl-dark-invert-keep-hue': _vm.invertInDarkMode },attrs:{"src":_vm.svgPath,"alt":"","height":_vm.height}}):_vm._e()]),_vm._v(" "),_c('div',{staticClass:"gl-empty-state-content gl-mx-auto gl-my-0",class:_vm.contentClasses,attrs:{"data-testid":"gl-empty-state-content"}},[_vm._t("title",function(){return [_c('h1',{staticClass:"gl-font-size-h-display gl-line-height-36 gl-mt-0 gl-mb-0",class:_vm.compact ? 'h5' : 'h4'},[_vm._v("\n "+_vm._s(_vm.title)+"\n ")])]}),_vm._v(" "),(_vm.description || _vm.$scopedSlots.description)?_c('p',{ref:"description",staticClass:"gl-mt-4 gl-mb-0"},[_vm._t("description",function(){return [_vm._v("\n "+_vm._s(_vm.description)+"\n ")]})],2):_vm._e(),_vm._v(" "),_c('div',{staticClass:"gl-display-flex gl-flex-wrap gl-mt-5",class:{ 'gl-justify-content-center': !_vm.compact }},[_vm._t("actions",function(){return [(_vm.shouldRenderPrimaryButton)?_c('gl-button',{staticClass:"gl-mb-3",class:_vm.compact ? 'gl-mr-3' : 'gl-mx-2',attrs:{"variant":"confirm","href":_vm.primaryButtonLink}},[_vm._v(_vm._s(_vm.primaryButtonText))]):_vm._e(),_vm._v(" "),(_vm.shouldRenderSecondaryButton)?_c('gl-button',{staticClass:"gl-mb-3 gl-mr-3",class:{ 'gl-mx-2!': !_vm.compact },attrs:{"href":_vm.secondaryButtonLink}},[_vm._v(_vm._s(_vm.secondaryButtonText)+"\n ")]):_vm._e()]})],2)],2)])};
123
123
  var __vue_staticRenderFns__ = [];
124
124
 
125
125
  /* style */