@gitlab/ui 99.1.0 → 101.0.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,40 @@
1
+ # [101.0.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v100.0.0...v101.0.0) (2024-10-29)
2
+
3
+
4
+ ### Features
5
+
6
+ * Remove bootstrap peer-depenceny and use vendored version instead ([1628107](https://gitlab.com/gitlab-org/gitlab-ui/commit/1628107e3fd80e2accd7f0fe30505fd600073acc))
7
+
8
+
9
+ ### BREAKING CHANGES
10
+
11
+ * In release 94.4.0 we added vendored bootstrap@4.6.2 SCSS. Now
12
+ @gitlab/ui stops relying on the bootstrap peer dependency and uses the
13
+ vendored bootstrap SCSS files instead. Unless you use JavaScript bits
14
+ of bootstrap, you can simply drop the bootstrap dependency.
15
+
16
+ # [100.0.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v99.1.0...v100.0.0) (2024-10-29)
17
+
18
+
19
+ ### Features
20
+
21
+ * migrate GlBadge ([02f3e90](https://gitlab.com/gitlab-org/gitlab-ui/commit/02f3e906087dfb5dffe7ca5c34c78c3d24aed185))
22
+
23
+
24
+ ### BREAKING CHANGES
25
+
26
+ * Remove GlBadge's router link and nuxt link related
27
+ props.
28
+
29
+ * Migrates GlBadge so it does not make use of Bootstrap Vue's
30
+ BBadge anymore.
31
+ * Still uses the BLink component if link props are provided.
32
+ * Specs are added for the additional functionality.
33
+ * Docs for the badge include information about the link badge now.
34
+ * Include link badge styling for disabled case.
35
+ * Update GlBadge default story.
36
+ * Removes vendored BBadge code.
37
+
1
38
  # [99.1.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v99.0.1...v99.1.0) (2024-10-28)
2
39
 
3
40
 
@@ -1,16 +1,24 @@
1
- import { BBadge } from '../../../vendor/bootstrap-vue/src/components/badge/badge';
1
+ import { BLink } from '../../../vendor/bootstrap-vue/src/components/link/link';
2
2
  import { badgeVariantOptions, badgeIconSizeOptions } from '../../../utils/constants';
3
3
  import GlIcon from '../icon/icon';
4
4
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
5
5
 
6
6
  //
7
+ const variantClass = {
8
+ [badgeVariantOptions.muted]: 'badge-muted',
9
+ [badgeVariantOptions.neutral]: 'badge-neutral',
10
+ [badgeVariantOptions.info]: 'badge-info',
11
+ [badgeVariantOptions.success]: 'badge-success',
12
+ [badgeVariantOptions.warning]: 'badge-warning',
13
+ [badgeVariantOptions.danger]: 'badge-danger',
14
+ [badgeVariantOptions.tier]: 'badge-tier'
15
+ };
7
16
  var script = {
8
17
  name: 'GlBadge',
9
18
  components: {
10
- BBadge,
19
+ BLink,
11
20
  GlIcon
12
21
  },
13
- inheritAttrs: false,
14
22
  props: {
15
23
  /**
16
24
  * The variant of the badge.
@@ -47,6 +55,54 @@ var script = {
47
55
  type: Boolean,
48
56
  default: false,
49
57
  required: false
58
+ },
59
+ /**
60
+ * Custom tag to use (unless `href` is defined)
61
+ */
62
+ tag: {
63
+ type: String,
64
+ required: false,
65
+ default: 'span'
66
+ },
67
+ /**
68
+ * Creates the badge as link (ignores `tag` property)
69
+ */
70
+ href: {
71
+ type: String,
72
+ required: false,
73
+ default: undefined
74
+ },
75
+ /**
76
+ * Sets the `rel` attributes, when `href` is defined
77
+ */
78
+ rel: {
79
+ type: String,
80
+ required: false,
81
+ default: null
82
+ },
83
+ /**
84
+ * Sets the `target`, when `href` is defined
85
+ */
86
+ target: {
87
+ type: String,
88
+ required: false,
89
+ default: '_self'
90
+ },
91
+ /**
92
+ * Adds the `active` class, when `href` is defined
93
+ */
94
+ active: {
95
+ type: Boolean,
96
+ required: false,
97
+ default: false
98
+ },
99
+ /**
100
+ * Disables the link, when `href` is defined
101
+ */
102
+ disabled: {
103
+ type: Boolean,
104
+ required: false,
105
+ default: false
50
106
  }
51
107
  },
52
108
  computed: {
@@ -68,6 +124,34 @@ var script = {
68
124
  },
69
125
  iconSizeComputed() {
70
126
  return badgeIconSizeOptions[this.iconSize];
127
+ },
128
+ isLink() {
129
+ return Boolean(this.href);
130
+ },
131
+ computedTag() {
132
+ return this.isLink ? BLink : this.tag;
133
+ },
134
+ computedProps() {
135
+ if (!this.isLink) return {};
136
+ const {
137
+ href,
138
+ rel,
139
+ target,
140
+ active,
141
+ disabled
142
+ } = this;
143
+ return {
144
+ href,
145
+ rel,
146
+ target,
147
+ active,
148
+ disabled
149
+ };
150
+ },
151
+ classes() {
152
+ return ['gl-badge', 'badge', 'badge-pill', variantClass[this.variant], {
153
+ '!gl-px-2': !this.$scopedSlots.default
154
+ }];
71
155
  }
72
156
  }
73
157
  };
@@ -76,7 +160,7 @@ var script = {
76
160
  const __vue_script__ = script;
77
161
 
78
162
  /* template */
79
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-badge',_vm._b({staticClass:"gl-badge",class:{ '!gl-px-2': !_vm.$scopedSlots.default },attrs:{"variant":_vm.variant,"role":_vm.role,"aria-label":_vm.ariaLabel,"pill":""}},'b-badge',_vm.$attrs,false),[(_vm.icon)?_c('gl-icon',{staticClass:"gl-badge-icon",class:{ '-gl-ml-2': _vm.isCircularIcon },attrs:{"size":_vm.iconSizeComputed,"name":_vm.icon}}):_vm._e(),_vm._v(" "),(_vm.$slots.default)?_c('span',{staticClass:"gl-badge-content"},[_vm._t("default")],2):_vm._e()],1)};
163
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c(_vm.computedTag,_vm._b({tag:"component",class:_vm.classes,attrs:{"role":_vm.role,"aria-label":_vm.ariaLabel}},'component',_vm.computedProps,false),[(_vm.icon)?_c('gl-icon',{staticClass:"gl-badge-icon",class:{ '-gl-ml-2': _vm.isCircularIcon },attrs:{"size":_vm.iconSizeComputed,"name":_vm.icon}}):_vm._e(),_vm._v(" "),(_vm.$slots.default)?_c('span',{staticClass:"gl-badge-content"},[_vm._t("default")],2):_vm._e()],1)};
80
164
  var __vue_staticRenderFns__ = [];
81
165
 
82
166
  /* style */