@gitlab/ui 101.10.0 → 101.11.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
+ # [101.11.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v101.10.0...v101.11.0) (2024-11-06)
2
+
3
+
4
+ ### Features
5
+
6
+ * **GlChartsLegend:** Replace legacy CSS Class with design tokens ([78a3ece](https://gitlab.com/gitlab-org/gitlab-ui/commit/78a3ece8857c554d3fc2b491af62fc0e7ef8e5d0))
7
+
1
8
  # [101.10.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v101.9.0...v101.10.0) (2024-11-06)
2
9
 
3
10
 
@@ -202,7 +202,8 @@ const __vue_script__ = script;
202
202
 
203
203
  /* template */
204
204
  var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-legend",attrs:{"data-testid":"gl-chart-legend"}},[(_vm.layout === _vm.$options.legendLayoutTypes.LEGEND_LAYOUT_INLINE)?[_c('div',{ref:"inlineLegendEl",staticClass:"gl-legend-inline",class:{ 'gl-legend-b-fade': _vm.shouldApplyFadeClass }},_vm._l((_vm.seriesInfo),function(series,key){return _c('div',{key:key,staticClass:"gl-legend-inline-series",class:{
205
- 'text-muted': _vm.disabledSeries[key],
205
+ 'gl-text-subtle': _vm.disabledSeries[key],
206
+ 'gl-text-strong': !_vm.disabledSeries[key],
206
207
  'gl-w-full': _vm.seriesNameIsLong(series.name),
207
208
  'hover:!gl-cursor-not-allowed':
208
209
  _vm.hasOneSeriesElement || _vm.isToggleDisabled(series.name, series.disabled),
@@ -1,13 +1,11 @@
1
1
  import { extend } from '../../vue';
2
2
  import { NAME_LINK } from '../../constants/components';
3
3
  import { EVENT_NAME_CLICK } from '../../constants/events';
4
- import { PROP_TYPE_STRING, PROP_TYPE_BOOLEAN, PROP_TYPE_ARRAY_STRING, PROP_TYPE_OBJECT_STRING } from '../../constants/props';
5
4
  import { concat } from '../../utils/array';
6
5
  import { isTag, attemptFocus, attemptBlur } from '../../utils/dom';
7
6
  import { getRootEventName, stopEvent } from '../../utils/events';
8
7
  import { isBoolean, isUndefined, isEvent, isFunction } from '../../utils/inspect';
9
- import { sortKeys, omit } from '../../utils/object';
10
- import { makeProp, makePropsConfigurable, pluckProps } from '../../utils/props';
8
+ import { pluckProps } from '../../utils/props';
11
9
  import { computeTag, isRouterLink, computeRel, computeHref } from '../../utils/router';
12
10
  import { attrsMixin } from '../../mixins/attrs';
13
11
  import { listenOnRootMixin } from '../../mixins/listen-on-root';
@@ -20,49 +18,92 @@ const ROOT_EVENT_NAME_CLICKED = getRootEventName(NAME_LINK, 'clicked');
20
18
 
21
19
  // --- Props ---
22
20
 
23
- // `<router-link>` specific props
24
- const routerLinkProps = {
25
- activeClass: makeProp(PROP_TYPE_STRING),
26
- append: makeProp(PROP_TYPE_BOOLEAN, false),
27
- event: makeProp(PROP_TYPE_ARRAY_STRING),
28
- exact: makeProp(PROP_TYPE_BOOLEAN, false),
29
- exactActiveClass: makeProp(PROP_TYPE_STRING),
30
- exactPath: makeProp(PROP_TYPE_BOOLEAN, false),
31
- exactPathActiveClass: makeProp(PROP_TYPE_STRING),
32
- replace: makeProp(PROP_TYPE_BOOLEAN, false),
33
- routerTag: makeProp(PROP_TYPE_STRING),
34
- to: makeProp(PROP_TYPE_OBJECT_STRING)
35
- };
36
-
37
- // `<nuxt-link>` specific props
38
- const nuxtLinkProps = {
39
- noPrefetch: makeProp(PROP_TYPE_BOOLEAN, false),
21
+ const props = {
22
+ active: {
23
+ type: Boolean,
24
+ default: false
25
+ },
26
+ disabled: {
27
+ type: Boolean,
28
+ default: false
29
+ },
30
+ href: {
31
+ type: String,
32
+ default: undefined
33
+ },
34
+ // Must be `null` if no value provided
35
+ rel: {
36
+ type: String,
37
+ default: null
38
+ },
39
+ // To support 3rd party router links based on `<router-link>` (i.e. `g-link` for Gridsome)
40
+ // Default is to auto choose between `<router-link>` and `<nuxt-link>`
41
+ // Gridsome doesn't provide a mechanism to auto detect and has caveats
42
+ // such as not supporting FQDN URLs or hash only URLs
43
+ routerComponentName: {
44
+ type: String,
45
+ default: undefined
46
+ },
47
+ target: {
48
+ type: String,
49
+ default: '_self'
50
+ },
51
+ activeClass: {
52
+ type: String,
53
+ default: undefined
54
+ },
55
+ append: {
56
+ type: Boolean,
57
+ default: false
58
+ },
59
+ event: {
60
+ type: [Array, String],
61
+ default: undefined
62
+ },
63
+ exact: {
64
+ type: Boolean,
65
+ default: false
66
+ },
67
+ exactActiveClass: {
68
+ type: String,
69
+ default: undefined
70
+ },
71
+ exactPath: {
72
+ type: Boolean,
73
+ default: false
74
+ },
75
+ exactPathActiveClass: {
76
+ type: String,
77
+ default: undefined
78
+ },
79
+ replace: {
80
+ type: Boolean,
81
+ default: false
82
+ },
83
+ routerTag: {
84
+ type: String,
85
+ default: undefined
86
+ },
87
+ to: {
88
+ type: [Object, String],
89
+ default: undefined
90
+ },
91
+ noPrefetch: {
92
+ type: Boolean,
93
+ default: false
94
+ },
40
95
  // Must be `null` to fall back to the value defined in the
41
96
  // `nuxt.config.js` configuration file for `router.prefetchLinks`
42
97
  // We convert `null` to `undefined`, so that Nuxt.js will use the
43
98
  // compiled default
44
99
  // Vue treats `undefined` as default of `false` for Boolean props,
45
100
  // so we must set it as `null` here to be a true tri-state prop
46
- prefetch: makeProp(PROP_TYPE_BOOLEAN, null)
101
+ prefetch: {
102
+ type: Boolean,
103
+ default: null
104
+ }
47
105
  };
48
106
 
49
- // All `<b-link>` props
50
- const props = makePropsConfigurable(sortKeys({
51
- ...nuxtLinkProps,
52
- ...routerLinkProps,
53
- active: makeProp(PROP_TYPE_BOOLEAN, false),
54
- disabled: makeProp(PROP_TYPE_BOOLEAN, false),
55
- href: makeProp(PROP_TYPE_STRING),
56
- // Must be `null` if no value provided
57
- rel: makeProp(PROP_TYPE_STRING, null),
58
- // To support 3rd party router links based on `<router-link>` (i.e. `g-link` for Gridsome)
59
- // Default is to auto choose between `<router-link>` and `<nuxt-link>`
60
- // Gridsome doesn't provide a mechanism to auto detect and has caveats
61
- // such as not supporting FQDN URLs or hash only URLs
62
- routerComponentName: makeProp(PROP_TYPE_STRING),
63
- target: makeProp(PROP_TYPE_STRING, '_self')
64
- }), NAME_LINK);
65
-
66
107
  // --- Main component ---
67
108
 
68
109
  // @vue/component
@@ -86,6 +127,9 @@ const BLink = /*#__PURE__*/extend({
86
127
  routerComponentName
87
128
  }, this);
88
129
  },
130
+ isNuxtLink() {
131
+ return this.computedTag === 'nuxt-link';
132
+ },
89
133
  isRouterLink() {
90
134
  return isRouterLink(this.computedTag);
91
135
  },
@@ -112,16 +156,16 @@ const BLink = /*#__PURE__*/extend({
112
156
  }, this.computedTag);
113
157
  },
114
158
  computedProps() {
159
+ if (!this.isRouterLink) return {};
115
160
  const {
116
161
  event,
117
162
  prefetch,
118
163
  routerTag
119
164
  } = this;
120
- return this.isRouterLink ? {
121
- ...pluckProps(omit({
122
- ...routerLinkProps,
123
- ...(this.computedTag === 'nuxt-link' ? nuxtLinkProps : {})
124
- }, ['event', 'prefetch', 'routerTag']), this),
165
+ const propsToPass = ['activeClass', 'append', 'exact', 'exactActiveClass', 'exactPath', 'exactPathActiveClass', 'replace', 'to'];
166
+ if (this.isNuxtLink) propsToPass.push('noPrefetch');
167
+ return {
168
+ ...pluckProps(propsToPass, this),
125
169
  // Only add these props, when actually defined
126
170
  ...(event ? {
127
171
  event
@@ -133,7 +177,7 @@ const BLink = /*#__PURE__*/extend({
133
177
  ...(routerTag ? {
134
178
  tag: routerTag
135
179
  } : {})
136
- } : {};
180
+ };
137
181
  },
138
182
  computedAttrs() {
139
183
  const {
@@ -236,4 +280,4 @@ const BLink = /*#__PURE__*/extend({
236
280
  }
237
281
  });
238
282
 
239
- export { BLink, nuxtLinkProps, props, routerLinkProps };
283
+ export { BLink, props };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "101.10.0",
3
+ "version": "101.11.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -197,7 +197,8 @@ export default {
197
197
  v-for="(series, key) in seriesInfo"
198
198
  :key="key"
199
199
  :class="{
200
- 'text-muted': disabledSeries[key],
200
+ 'gl-text-subtle': disabledSeries[key],
201
+ 'gl-text-strong': !disabledSeries[key],
201
202
  'gl-w-full': seriesNameIsLong(series.name),
202
203
  'hover:!gl-cursor-not-allowed':
203
204
  hasOneSeriesElement || isToggleDisabled(series.name, series.disabled),
@@ -1,18 +1,11 @@
1
1
  import { extend } from '../../vue'
2
2
  import { NAME_LINK } from '../../constants/components'
3
3
  import { EVENT_NAME_CLICK } from '../../constants/events'
4
- import {
5
- PROP_TYPE_ARRAY_STRING,
6
- PROP_TYPE_BOOLEAN,
7
- PROP_TYPE_OBJECT_STRING,
8
- PROP_TYPE_STRING
9
- } from '../../constants/props'
10
4
  import { concat } from '../../utils/array'
11
5
  import { attemptBlur, attemptFocus, isTag } from '../../utils/dom'
12
6
  import { getRootEventName, stopEvent } from '../../utils/events'
13
7
  import { isBoolean, isEvent, isFunction, isUndefined } from '../../utils/inspect'
14
- import { omit, sortKeys } from '../../utils/object'
15
- import { makeProp, makePropsConfigurable, pluckProps } from '../../utils/props'
8
+ import { pluckProps } from '../../utils/props'
16
9
  import { computeHref, computeRel, computeTag, isRouterLink } from '../../utils/router'
17
10
  import { attrsMixin } from '../../mixins/attrs'
18
11
  import { listenOnRootMixin } from '../../mixins/listen-on-root'
@@ -25,52 +18,92 @@ const ROOT_EVENT_NAME_CLICKED = getRootEventName(NAME_LINK, 'clicked')
25
18
 
26
19
  // --- Props ---
27
20
 
28
- // `<router-link>` specific props
29
- export const routerLinkProps = {
30
- activeClass: makeProp(PROP_TYPE_STRING),
31
- append: makeProp(PROP_TYPE_BOOLEAN, false),
32
- event: makeProp(PROP_TYPE_ARRAY_STRING),
33
- exact: makeProp(PROP_TYPE_BOOLEAN, false),
34
- exactActiveClass: makeProp(PROP_TYPE_STRING),
35
- exactPath: makeProp(PROP_TYPE_BOOLEAN, false),
36
- exactPathActiveClass: makeProp(PROP_TYPE_STRING),
37
- replace: makeProp(PROP_TYPE_BOOLEAN, false),
38
- routerTag: makeProp(PROP_TYPE_STRING),
39
- to: makeProp(PROP_TYPE_OBJECT_STRING)
40
- }
41
-
42
- // `<nuxt-link>` specific props
43
- export const nuxtLinkProps = {
44
- noPrefetch: makeProp(PROP_TYPE_BOOLEAN, false),
21
+ export const props = {
22
+ active: {
23
+ type: Boolean,
24
+ default: false
25
+ },
26
+ disabled: {
27
+ type: Boolean,
28
+ default: false
29
+ },
30
+ href: {
31
+ type: String,
32
+ default: undefined
33
+ },
34
+ // Must be `null` if no value provided
35
+ rel: {
36
+ type: String,
37
+ default: null
38
+ },
39
+ // To support 3rd party router links based on `<router-link>` (i.e. `g-link` for Gridsome)
40
+ // Default is to auto choose between `<router-link>` and `<nuxt-link>`
41
+ // Gridsome doesn't provide a mechanism to auto detect and has caveats
42
+ // such as not supporting FQDN URLs or hash only URLs
43
+ routerComponentName: {
44
+ type: String,
45
+ default: undefined
46
+ },
47
+ target: {
48
+ type: String,
49
+ default: '_self'
50
+ },
51
+ activeClass: {
52
+ type: String,
53
+ default: undefined
54
+ },
55
+ append: {
56
+ type: Boolean,
57
+ default: false
58
+ },
59
+ event: {
60
+ type: [Array, String],
61
+ default: undefined
62
+ },
63
+ exact: {
64
+ type: Boolean,
65
+ default: false
66
+ },
67
+ exactActiveClass: {
68
+ type: String,
69
+ default: undefined
70
+ },
71
+ exactPath: {
72
+ type: Boolean,
73
+ default: false
74
+ },
75
+ exactPathActiveClass: {
76
+ type: String,
77
+ default: undefined
78
+ },
79
+ replace: {
80
+ type: Boolean,
81
+ default: false
82
+ },
83
+ routerTag: {
84
+ type: String,
85
+ default: undefined
86
+ },
87
+ to: {
88
+ type: [Object, String],
89
+ default: undefined
90
+ },
91
+ noPrefetch: {
92
+ type: Boolean,
93
+ default: false
94
+ },
45
95
  // Must be `null` to fall back to the value defined in the
46
96
  // `nuxt.config.js` configuration file for `router.prefetchLinks`
47
97
  // We convert `null` to `undefined`, so that Nuxt.js will use the
48
98
  // compiled default
49
99
  // Vue treats `undefined` as default of `false` for Boolean props,
50
100
  // so we must set it as `null` here to be a true tri-state prop
51
- prefetch: makeProp(PROP_TYPE_BOOLEAN, null)
101
+ prefetch: {
102
+ type: Boolean,
103
+ default: null
104
+ }
52
105
  }
53
106
 
54
- // All `<b-link>` props
55
- export const props = makePropsConfigurable(
56
- sortKeys({
57
- ...nuxtLinkProps,
58
- ...routerLinkProps,
59
- active: makeProp(PROP_TYPE_BOOLEAN, false),
60
- disabled: makeProp(PROP_TYPE_BOOLEAN, false),
61
- href: makeProp(PROP_TYPE_STRING),
62
- // Must be `null` if no value provided
63
- rel: makeProp(PROP_TYPE_STRING, null),
64
- // To support 3rd party router links based on `<router-link>` (i.e. `g-link` for Gridsome)
65
- // Default is to auto choose between `<router-link>` and `<nuxt-link>`
66
- // Gridsome doesn't provide a mechanism to auto detect and has caveats
67
- // such as not supporting FQDN URLs or hash only URLs
68
- routerComponentName: makeProp(PROP_TYPE_STRING),
69
- target: makeProp(PROP_TYPE_STRING, '_self')
70
- }),
71
- NAME_LINK
72
- )
73
-
74
107
  // --- Main component ---
75
108
 
76
109
  // @vue/component
@@ -86,6 +119,9 @@ export const BLink = /*#__PURE__*/ extend({
86
119
  const { to, disabled, routerComponentName } = this
87
120
  return computeTag({ to, disabled, routerComponentName }, this)
88
121
  },
122
+ isNuxtLink() {
123
+ return this.computedTag === 'nuxt-link'
124
+ },
89
125
  isRouterLink() {
90
126
  return isRouterLink(this.computedTag)
91
127
  },
@@ -100,23 +136,30 @@ export const BLink = /*#__PURE__*/ extend({
100
136
  return computeHref({ to, href }, this.computedTag)
101
137
  },
102
138
  computedProps() {
139
+ if (!this.isRouterLink) return {}
140
+
103
141
  const { event, prefetch, routerTag } = this
104
- return this.isRouterLink
105
- ? {
106
- ...pluckProps(
107
- omit(
108
- { ...routerLinkProps, ...(this.computedTag === 'nuxt-link' ? nuxtLinkProps : {}) },
109
- ['event', 'prefetch', 'routerTag']
110
- ),
111
- this
112
- ),
113
- // Only add these props, when actually defined
114
- ...(event ? { event } : {}),
115
- ...(isBoolean(prefetch) ? { prefetch } : {}),
116
- // Pass `router-tag` as `tag` prop
117
- ...(routerTag ? { tag: routerTag } : {})
118
- }
119
- : {}
142
+
143
+ const propsToPass = [
144
+ 'activeClass',
145
+ 'append',
146
+ 'exact',
147
+ 'exactActiveClass',
148
+ 'exactPath',
149
+ 'exactPathActiveClass',
150
+ 'replace',
151
+ 'to'
152
+ ]
153
+ if (this.isNuxtLink) propsToPass.push('noPrefetch')
154
+
155
+ return {
156
+ ...pluckProps(propsToPass, this),
157
+ // Only add these props, when actually defined
158
+ ...(event ? { event } : {}),
159
+ ...(isBoolean(prefetch) ? { prefetch } : {}),
160
+ // Pass `router-tag` as `tag` prop
161
+ ...(routerTag ? { tag: routerTag } : {})
162
+ }
120
163
  },
121
164
  computedAttrs() {
122
165
  const {
@@ -1,8 +0,0 @@
1
- //
2
- // VBModal
3
- //
4
- import { DirectiveOptions } from 'vue'
5
-
6
-
7
- // directive: v-b-modal
8
- export declare const VBModal: DirectiveOptions
@@ -1,7 +0,0 @@
1
- //
2
- // VBToggle
3
- //
4
- import { DirectiveOptions } from 'vue'
5
-
6
- // directive: v-b-toggle
7
- export declare const VBToggle: DirectiveOptions
@@ -1,7 +0,0 @@
1
- //
2
- // VBTooltip
3
- //
4
- import { DirectiveOptions } from 'vue'
5
-
6
- // directive: v-b-tooltip
7
- export declare const VBTooltip: DirectiveOptions
@@ -1,7 +0,0 @@
1
- //
2
- // VBVisible
3
- //
4
- import { DirectiveOptions } from 'vue'
5
-
6
- // Directive: v-b-visible
7
- export declare const VBVisible: DirectiveOptions