@gitlab/ui 86.11.0 → 86.12.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.
@@ -1,25 +1,7 @@
1
1
  import times from 'lodash/times';
2
2
  import { SERIES_NAME, SERIES_NAME_SHORT } from '../stories_constants';
3
- import { marqueeSelectionSvgPath, redoSvgPath, clearAllSvgPath, downloadSvgPath } from '../svgs/svg_paths';
4
3
  import { colorFromDefaultPalette } from './theme';
5
4
 
6
- const toolbox = {
7
- feature: {
8
- dataZoom: {
9
- icon: {
10
- zoom: marqueeSelectionSvgPath,
11
- back: redoSvgPath
12
- }
13
- },
14
- restore: {
15
- icon: clearAllSvgPath
16
- },
17
- saveAsImage: {
18
- icon: downloadSvgPath
19
- }
20
- }
21
- };
22
-
23
5
  /**
24
6
  * Generates series data for usage in chart examples
25
7
  *
@@ -39,4 +21,4 @@ const generateSeriesData = function () {
39
21
  }));
40
22
  };
41
23
 
42
- export { generateSeriesData, toolbox };
24
+ export { generateSeriesData };
@@ -1,5 +1,5 @@
1
1
  import { GRAY_600, GRAY_200, GRAY_50, GRAY_300, GRAY_100, DATA_VIZ_BLUE_200, DATA_VIZ_BLUE_400, DATA_VIZ_BLUE_600, DATA_VIZ_BLUE_800, GRAY_900, GRAY_500, DATA_VIZ_BLUE_500, DATA_VIZ_BLUE_900, DATA_VIZ_ORANGE_500, DATA_VIZ_ORANGE_600, DATA_VIZ_AQUA_500, DATA_VIZ_GREEN_600, DATA_VIZ_MAGENTA_500, DATA_VIZ_BLUE_700, DATA_VIZ_ORANGE_800, DATA_VIZ_AQUA_700, DATA_VIZ_GREEN_800, DATA_VIZ_MAGENTA_700, DATA_VIZ_ORANGE_950, DATA_VIZ_AQUA_900, DATA_VIZ_GREEN_950, DATA_VIZ_MAGENTA_900, DATA_VIZ_ORANGE_700, DATA_VIZ_AQUA_600, DATA_VIZ_GREEN_700, DATA_VIZ_MAGENTA_600, DATA_VIZ_ORANGE_900, DATA_VIZ_AQUA_800, DATA_VIZ_GREEN_900, DATA_VIZ_MAGENTA_800, DATA_VIZ_BLUE_950, DATA_VIZ_AQUA_950, DATA_VIZ_GREEN_500, DATA_VIZ_MAGENTA_950, DATA_VIZ_ORANGE_400, DATA_VIZ_GREEN_400, DATA_VIZ_BLUE_300, DATA_VIZ_ORANGE_200, DATA_VIZ_AQUA_300, DATA_VIZ_GREEN_200, DATA_VIZ_MAGENTA_300, DATA_VIZ_BLUE_100, DATA_VIZ_ORANGE_50, DATA_VIZ_AQUA_100, DATA_VIZ_GREEN_50, DATA_VIZ_MAGENTA_100, DATA_VIZ_ORANGE_300, DATA_VIZ_AQUA_400, DATA_VIZ_GREEN_300, DATA_VIZ_MAGENTA_400, DATA_VIZ_ORANGE_100, DATA_VIZ_AQUA_200, DATA_VIZ_GREEN_100, DATA_VIZ_MAGENTA_200, DATA_VIZ_BLUE_50, DATA_VIZ_AQUA_50, DATA_VIZ_MAGENTA_50, RED_500, WHITE } from '../../tokens/build/js/tokens';
2
- import { scrollHandleSvgPath } from '../svgs/svg_paths';
2
+ import { scrollHandleSvgPath, marqueeSelectionSvgPath, redoSvgPath, clearAllSvgPath, downloadSvgPath } from '../svgs/svg_paths';
3
3
  import { hexToRgba } from '../utils';
4
4
 
5
5
  const GL_BORDER_RADIUS_BASE = '0.25rem';
@@ -141,14 +141,20 @@ const createTheme = function () {
141
141
  title: {
142
142
  zoom: 'Click to zoom in on a portion of the graph',
143
143
  back: 'Remove selection'
144
+ },
145
+ icon: {
146
+ zoom: marqueeSelectionSvgPath,
147
+ back: redoSvgPath
144
148
  }
145
149
  },
146
150
  restore: {
147
- title: 'Remove all selections and return chart to default state'
151
+ title: 'Remove all selections and return chart to default state',
152
+ icon: clearAllSvgPath
148
153
  },
149
154
  saveAsImage: {
150
155
  title: 'Save chart as an image',
151
- name: 'graph'
156
+ name: 'graph',
157
+ icon: downloadSvgPath
152
158
  }
153
159
  }
154
160
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "86.11.0",
3
+ "version": "86.12.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -76,14 +76,15 @@ $badge-min-width: $gl-spacing-scale-3;
76
76
  * Content inside the badge should shrink when gl-text-truncate class is used on the contents
77
77
  * Badge should have a minimal width of 20 pixels (for example when `1` is passed inside the slot)
78
78
  */
79
- display: inline-grid;
80
- grid-auto-flow: column;
81
- grid-template-columns: minmax($badge-min-width, auto);
79
+ display: inline-flex;
82
80
  align-items: center;
83
81
  justify-content: center;
84
82
  gap: $gl-spacing-scale-2;
85
83
  padding: $gl-spacing-scale-1 $badge-padding-horizontal;
86
- min-width: fit-content;
84
+ // Enable support for gl-text-truncate
85
+ width: 100%;
86
+ // Mitigate the effect of width: 100%
87
+ max-width: max-content;
87
88
 
88
89
  @media (forced-colors: active) {
89
90
  border: 1px solid;
@@ -95,6 +96,12 @@ $badge-min-width: $gl-spacing-scale-3;
95
96
  @include gl-flex-shrink-0;
96
97
  top: auto;
97
98
  }
99
+
100
+ .gl-badge-content {
101
+ display: flex;
102
+ justify-content: center;
103
+ min-width: $badge-min-width;
104
+ }
98
105
  }
99
106
 
100
107
  /* Variants */
@@ -83,6 +83,9 @@ export default {
83
83
  :class="{ '-gl-ml-2 gl-ml-n2': isCircularIcon }"
84
84
  :name="icon"
85
85
  />
86
- <slot></slot>
86
+ <!-- eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots -->
87
+ <span v-if="$slots.default" class="gl-badge-content">
88
+ <slot></slot>
89
+ </span>
87
90
  </b-badge>
88
91
  </template>
@@ -17,7 +17,7 @@ import { debounceByAnimationFrame } from '../../../utils/utils';
17
17
  */
18
18
  const sizeValidator = (size) => Number.isFinite(size) || size === 'auto' || size == null;
19
19
 
20
- const isChartWithToolbox = (options) => options?.toolbox !== undefined;
20
+ const isChartWithToolbox = (options) => Boolean(options?.toolbox?.show);
21
21
 
22
22
  const increaseChartGridTop = (options, increaseBy) => ({
23
23
  ...options,
@@ -1,31 +1,7 @@
1
1
  import times from 'lodash/times';
2
2
  import { SERIES_NAME, SERIES_NAME_SHORT } from '../stories_constants';
3
-
4
- import {
5
- marqueeSelectionSvgPath,
6
- redoSvgPath,
7
- clearAllSvgPath,
8
- downloadSvgPath,
9
- } from '../svgs/svg_paths';
10
3
  import { colorFromDefaultPalette } from './theme';
11
4
 
12
- export const toolbox = {
13
- feature: {
14
- dataZoom: {
15
- icon: {
16
- zoom: marqueeSelectionSvgPath,
17
- back: redoSvgPath,
18
- },
19
- },
20
- restore: {
21
- icon: clearAllSvgPath,
22
- },
23
- saveAsImage: {
24
- icon: downloadSvgPath,
25
- },
26
- },
27
- };
28
-
29
5
  /**
30
6
  * Generates series data for usage in chart examples
31
7
  *
@@ -64,7 +64,13 @@ import {
64
64
  DATA_VIZ_ORANGE_950,
65
65
  DATA_VIZ_ORANGE_900,
66
66
  } from '../../tokens/build/js/tokens';
67
- import { scrollHandleSvgPath } from '../svgs/svg_paths';
67
+ import {
68
+ scrollHandleSvgPath,
69
+ marqueeSelectionSvgPath,
70
+ redoSvgPath,
71
+ clearAllSvgPath,
72
+ downloadSvgPath,
73
+ } from '../svgs/svg_paths';
68
74
  import { hexToRgba } from '../utils';
69
75
 
70
76
  const GL_BORDER_RADIUS_BASE = '0.25rem';
@@ -285,13 +291,19 @@ export const createTheme = (options = {}) => ({
285
291
  zoom: 'Click to zoom in on a portion of the graph',
286
292
  back: 'Remove selection',
287
293
  },
294
+ icon: {
295
+ zoom: marqueeSelectionSvgPath,
296
+ back: redoSvgPath,
297
+ },
288
298
  },
289
299
  restore: {
290
300
  title: 'Remove all selections and return chart to default state',
301
+ icon: clearAllSvgPath,
291
302
  },
292
303
  saveAsImage: {
293
304
  title: 'Save chart as an image',
294
305
  name: 'graph',
306
+ icon: downloadSvgPath,
295
307
  },
296
308
  },
297
309
  },