@gitlab/ui 78.14.1 → 78.15.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [78.15.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v78.14.1...v78.15.0) (2024-04-16)
2
+
3
+
4
+ ### Features
5
+
6
+ * **label:** Reduce label variants ([b411a2d](https://gitlab.com/gitlab-org/gitlab-ui/commit/b411a2d58309acbccfb56b78b8f5e8ce61eadf0e))
7
+
1
8
  ## [78.14.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v78.14.0...v78.14.1) (2024-04-15)
2
9
 
3
10
 
@@ -1,6 +1,7 @@
1
1
  import { labelColorOptions } from '../../../utils/constants';
2
2
  import { colorFromBackground } from '../../../utils/utils';
3
- import CloseButton from '../../shared_components/close_button/close_button';
3
+ import GlButton from '../button/button';
4
+ import GlIcon from '../icon/icon';
4
5
  import GlLink from '../link/link';
5
6
  import GlTooltip from '../tooltip/tooltip';
6
7
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
@@ -9,9 +10,10 @@ import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
9
10
  var script = {
10
11
  name: 'GlLabel',
11
12
  components: {
13
+ GlButton,
14
+ GlIcon,
12
15
  GlLink,
13
- GlTooltip,
14
- CloseButton
16
+ GlTooltip
15
17
  },
16
18
  props: {
17
19
  backgroundColor: {
@@ -29,11 +31,6 @@ var script = {
29
31
  required: false,
30
32
  default: ''
31
33
  },
32
- size: {
33
- type: String,
34
- required: false,
35
- default: ''
36
- },
37
34
  tooltipPlacement: {
38
35
  type: String,
39
36
  required: false,
@@ -69,7 +66,6 @@ var script = {
69
66
  cssClasses() {
70
67
  const textColorVariant = colorFromBackground(this.backgroundColor);
71
68
  return {
72
- 'gl-label-sm': this.size === 'sm',
73
69
  'gl-label-scoped': this.scoped,
74
70
  'gl-label-text-dark': textColorVariant === labelColorOptions.dark,
75
71
  'gl-label-text-light': textColorVariant === labelColorOptions.light
@@ -78,7 +74,7 @@ var script = {
78
74
  cssVariables() {
79
75
  return {
80
76
  '--label-background-color': this.backgroundColor,
81
- '--label-inset-border': `inset 0 0 0 ${this.size === 'sm' ? '1px' : '2px'} ${this.backgroundColor}`
77
+ '--label-inset-border': `inset 0 0 0 2px ${this.backgroundColor}`
82
78
  };
83
79
  },
84
80
  scopedKey() {
@@ -87,9 +83,6 @@ var script = {
87
83
  scopedValue() {
88
84
  return this.title.slice(this.splitScopedLabelIndex + 2);
89
85
  },
90
- closeIconSize() {
91
- return this.size === 'sm' ? 12 : 16;
92
- },
93
86
  labelComponent() {
94
87
  return this.target ? GlLink : 'span';
95
88
  },
@@ -128,7 +121,7 @@ var script = {
128
121
  const __vue_script__ = script;
129
122
 
130
123
  /* template */
131
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',_vm._b({staticClass:"gl-label",class:_vm.cssClasses,style:(_vm.cssVariables),on:{"click":_vm.onClick}},'span',_vm.$attrs,false),[_c(_vm.labelComponent,{ref:"labelTitle",tag:"component",staticClass:"gl-label-link",attrs:{"href":_vm.target ? _vm.target : false,"tabindex":"0"}},[_c('span',{staticClass:"gl-label-text"},[_vm._v("\n "+_vm._s(_vm.scopedKey)+"\n ")]),_vm._v(" "),(_vm.scoped && _vm.scopedValue)?_c('span',{staticClass:"gl-label-text-scoped"},[_vm._v("\n "+_vm._s(_vm.scopedValue)+"\n ")]):_vm._e()]),_vm._v(" "),(_vm.showCloseButton)?_c('close-button',{staticClass:"gl-label-close gl-p-0!",attrs:{"label":"Remove label","variant":"reset","disabled":_vm.disabled},on:{"click":_vm.onClose}}):_vm._e(),_vm._v(" "),(_vm.description)?_c('gl-tooltip',{attrs:{"target":function () { return _vm.tooltipTarget; },"placement":_vm.tooltipPlacement,"boundary":"viewport"}},[(_vm.scoped)?_c('span',{staticClass:"gl-label-tooltip-title"},[_vm._v("Scoped label")]):_vm._e(),_vm._v("\n "+_vm._s(_vm.description)+"\n ")]):_vm._e()],1)};
124
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',_vm._b({staticClass:"gl-label",class:_vm.cssClasses,style:(_vm.cssVariables),on:{"click":_vm.onClick}},'span',_vm.$attrs,false),[_c(_vm.labelComponent,{ref:"labelTitle",tag:"component",staticClass:"gl-label-link",attrs:{"href":_vm.target ? _vm.target : false,"tabindex":"0"}},[_c('span',{staticClass:"gl-label-text"},[_vm._v("\n "+_vm._s(_vm.scopedKey)+"\n ")]),_vm._v(" "),(_vm.scoped && _vm.scopedValue)?_c('span',{staticClass:"gl-label-text-scoped"},[_vm._v("\n "+_vm._s(_vm.scopedValue)+"\n ")]):_vm._e()]),_vm._v(" "),(_vm.showCloseButton)?_c('gl-button',{staticClass:"gl-label-close gl-p-0!",attrs:{"category":"tertiary","size":"small","variant":"reset","aria-label":"Remove label","disabled":_vm.disabled},on:{"click":_vm.onClose}},[_c('gl-icon',{attrs:{"name":"close-xs","size":12}})],1):_vm._e(),_vm._v(" "),(_vm.description)?_c('gl-tooltip',{attrs:{"target":function () { return _vm.tooltipTarget; },"placement":_vm.tooltipPlacement,"boundary":"viewport"}},[(_vm.scoped)?_c('span',{staticClass:"gl-label-tooltip-title"},[_vm._v("Scoped label")]):_vm._e(),_vm._v("\n "+_vm._s(_vm.description)+"\n ")]):_vm._e()],1)};
132
125
  var __vue_staticRenderFns__ = [];
133
126
 
134
127
  /* style */