@gitlab/ui 111.0.0 → 111.1.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 (35) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/components/charts/discrete_scatter/discrete_scatter.js +1 -2
  3. package/dist/components/charts/heatmap/heatmap.js +4 -4
  4. package/dist/components/charts/legend/legend.js +1 -2
  5. package/dist/components/charts/line/line.js +1 -2
  6. package/dist/index.css +1 -1
  7. package/dist/index.css.map +1 -1
  8. package/dist/tokens/build/js/tokens.dark.js +8 -1
  9. package/dist/tokens/build/js/tokens.js +8 -1
  10. package/dist/tokens/css/tokens.css +7 -0
  11. package/dist/tokens/css/tokens.dark.css +7 -0
  12. package/dist/tokens/js/tokens.dark.js +7 -0
  13. package/dist/tokens/js/tokens.js +7 -0
  14. package/dist/tokens/json/tokens.dark.json +171 -0
  15. package/dist/tokens/json/tokens.json +171 -0
  16. package/dist/tokens/scss/_tokens.dark.scss +7 -0
  17. package/dist/tokens/scss/_tokens.scss +7 -0
  18. package/dist/tokens/scss/_tokens_custom_properties.scss +7 -0
  19. package/dist/utils/charts/theme.js +31 -29
  20. package/package.json +1 -1
  21. package/src/components/charts/discrete_scatter/discrete_scatter.vue +1 -2
  22. package/src/components/charts/heatmap/heatmap.vue +4 -4
  23. package/src/components/charts/legend/legend.vue +1 -2
  24. package/src/components/charts/line/line.vue +1 -2
  25. package/src/tokens/build/css/tokens.css +7 -0
  26. package/src/tokens/build/css/tokens.dark.css +7 -0
  27. package/src/tokens/build/js/tokens.dark.js +7 -0
  28. package/src/tokens/build/js/tokens.js +7 -0
  29. package/src/tokens/build/json/tokens.dark.json +171 -0
  30. package/src/tokens/build/json/tokens.json +171 -0
  31. package/src/tokens/build/scss/_tokens.dark.scss +7 -0
  32. package/src/tokens/build/scss/_tokens.scss +7 -0
  33. package/src/tokens/build/scss/_tokens_custom_properties.scss +7 -0
  34. package/src/tokens/contextual/chart.tokens.json +68 -0
  35. package/src/utils/charts/theme.js +150 -153
@@ -1,68 +1,63 @@
1
1
  import {
2
- WHITE,
3
- GRAY_50,
4
- GRAY_100,
5
- GRAY_200,
6
- GRAY_300,
7
- GRAY_500,
8
- GRAY_600,
9
- GRAY_900,
10
- RED_500,
11
- DATA_VIZ_AQUA_50,
12
- DATA_VIZ_AQUA_100,
13
- DATA_VIZ_AQUA_200,
14
- DATA_VIZ_AQUA_300,
15
- DATA_VIZ_AQUA_400,
16
- DATA_VIZ_AQUA_500,
17
- DATA_VIZ_AQUA_600,
18
- DATA_VIZ_AQUA_700,
19
- DATA_VIZ_AQUA_800,
20
- DATA_VIZ_AQUA_900,
21
- DATA_VIZ_AQUA_950,
22
- DATA_VIZ_BLUE_50,
23
- DATA_VIZ_BLUE_100,
24
- DATA_VIZ_BLUE_200,
25
- DATA_VIZ_BLUE_300,
26
- DATA_VIZ_BLUE_400,
27
- DATA_VIZ_BLUE_500,
28
- DATA_VIZ_BLUE_600,
29
- DATA_VIZ_BLUE_700,
30
- DATA_VIZ_BLUE_800,
31
- DATA_VIZ_BLUE_900,
32
- DATA_VIZ_BLUE_950,
33
- DATA_VIZ_GREEN_50,
34
- DATA_VIZ_GREEN_100,
35
- DATA_VIZ_GREEN_200,
36
- DATA_VIZ_GREEN_300,
37
- DATA_VIZ_GREEN_400,
38
- DATA_VIZ_GREEN_500,
39
- DATA_VIZ_GREEN_600,
40
- DATA_VIZ_GREEN_700,
41
- DATA_VIZ_GREEN_800,
42
- DATA_VIZ_GREEN_900,
43
- DATA_VIZ_GREEN_950,
44
- DATA_VIZ_MAGENTA_50,
45
- DATA_VIZ_MAGENTA_100,
46
- DATA_VIZ_MAGENTA_200,
47
- DATA_VIZ_MAGENTA_300,
48
- DATA_VIZ_MAGENTA_400,
49
- DATA_VIZ_MAGENTA_500,
50
- DATA_VIZ_MAGENTA_600,
51
- DATA_VIZ_MAGENTA_700,
52
- DATA_VIZ_MAGENTA_800,
53
- DATA_VIZ_MAGENTA_900,
54
- DATA_VIZ_MAGENTA_950,
55
- DATA_VIZ_ORANGE_50,
56
- DATA_VIZ_ORANGE_100,
57
- DATA_VIZ_ORANGE_200,
58
- DATA_VIZ_ORANGE_300,
59
- DATA_VIZ_ORANGE_400,
60
- DATA_VIZ_ORANGE_500,
61
- DATA_VIZ_ORANGE_600,
62
- DATA_VIZ_ORANGE_700,
63
- DATA_VIZ_ORANGE_800,
64
- DATA_VIZ_ORANGE_950,
65
- DATA_VIZ_ORANGE_900,
2
+ GL_COLOR_NEUTRAL_50,
3
+ GL_COLOR_NEUTRAL_100,
4
+ GL_COLOR_NEUTRAL_500,
5
+ GL_COLOR_NEUTRAL_900,
6
+ GL_COLOR_DATA_AQUA_50,
7
+ GL_COLOR_DATA_AQUA_100,
8
+ GL_COLOR_DATA_AQUA_200,
9
+ GL_COLOR_DATA_AQUA_300,
10
+ GL_COLOR_DATA_AQUA_400,
11
+ GL_COLOR_DATA_AQUA_500,
12
+ GL_COLOR_DATA_AQUA_600,
13
+ GL_COLOR_DATA_AQUA_700,
14
+ GL_COLOR_DATA_AQUA_800,
15
+ GL_COLOR_DATA_AQUA_900,
16
+ GL_COLOR_DATA_AQUA_950,
17
+ GL_COLOR_DATA_BLUE_50,
18
+ GL_COLOR_DATA_BLUE_100,
19
+ GL_COLOR_DATA_BLUE_200,
20
+ GL_COLOR_DATA_BLUE_300,
21
+ GL_COLOR_DATA_BLUE_400,
22
+ GL_COLOR_DATA_BLUE_500,
23
+ GL_COLOR_DATA_BLUE_600,
24
+ GL_COLOR_DATA_BLUE_700,
25
+ GL_COLOR_DATA_BLUE_800,
26
+ GL_COLOR_DATA_BLUE_900,
27
+ GL_COLOR_DATA_BLUE_950,
28
+ GL_COLOR_DATA_GREEN_50,
29
+ GL_COLOR_DATA_GREEN_100,
30
+ GL_COLOR_DATA_GREEN_200,
31
+ GL_COLOR_DATA_GREEN_300,
32
+ GL_COLOR_DATA_GREEN_400,
33
+ GL_COLOR_DATA_GREEN_500,
34
+ GL_COLOR_DATA_GREEN_600,
35
+ GL_COLOR_DATA_GREEN_700,
36
+ GL_COLOR_DATA_GREEN_800,
37
+ GL_COLOR_DATA_GREEN_900,
38
+ GL_COLOR_DATA_GREEN_950,
39
+ GL_COLOR_DATA_MAGENTA_50,
40
+ GL_COLOR_DATA_MAGENTA_100,
41
+ GL_COLOR_DATA_MAGENTA_200,
42
+ GL_COLOR_DATA_MAGENTA_300,
43
+ GL_COLOR_DATA_MAGENTA_400,
44
+ GL_COLOR_DATA_MAGENTA_500,
45
+ GL_COLOR_DATA_MAGENTA_600,
46
+ GL_COLOR_DATA_MAGENTA_700,
47
+ GL_COLOR_DATA_MAGENTA_800,
48
+ GL_COLOR_DATA_MAGENTA_900,
49
+ GL_COLOR_DATA_MAGENTA_950,
50
+ GL_COLOR_DATA_ORANGE_50,
51
+ GL_COLOR_DATA_ORANGE_100,
52
+ GL_COLOR_DATA_ORANGE_200,
53
+ GL_COLOR_DATA_ORANGE_300,
54
+ GL_COLOR_DATA_ORANGE_400,
55
+ GL_COLOR_DATA_ORANGE_500,
56
+ GL_COLOR_DATA_ORANGE_600,
57
+ GL_COLOR_DATA_ORANGE_700,
58
+ GL_COLOR_DATA_ORANGE_800,
59
+ GL_COLOR_DATA_ORANGE_950,
60
+ GL_COLOR_DATA_ORANGE_900,
66
61
  } from '../../tokens/build/js/tokens';
67
62
  import {
68
63
  scrollHandleSvgPath,
@@ -71,23 +66,22 @@ import {
71
66
  clearAllSvgPath,
72
67
  downloadSvgPath,
73
68
  } from '../svgs/svg_paths';
74
- import { hexToRgba } from '../utils';
75
69
 
76
70
  const GL_BORDER_RADIUS_BASE = '0.25rem';
77
71
 
78
72
  export const themeName = 'gitlab';
79
73
 
80
74
  export const heatmapHues = [
81
- GRAY_100,
82
- DATA_VIZ_BLUE_200,
83
- DATA_VIZ_BLUE_400,
84
- DATA_VIZ_BLUE_600,
85
- DATA_VIZ_BLUE_800,
75
+ GL_COLOR_NEUTRAL_100,
76
+ GL_COLOR_DATA_BLUE_200,
77
+ GL_COLOR_DATA_BLUE_400,
78
+ GL_COLOR_DATA_BLUE_600,
79
+ GL_COLOR_DATA_BLUE_800,
86
80
  ];
87
81
 
88
- export const gaugeNeutralHues = [GRAY_900, GRAY_500];
89
- export const gaugeSafeHues = [DATA_VIZ_BLUE_500, DATA_VIZ_BLUE_900];
90
- export const gaugeWarningHue = DATA_VIZ_ORANGE_500;
82
+ export const gaugeNeutralHues = [GL_COLOR_NEUTRAL_900, GL_COLOR_NEUTRAL_500];
83
+ export const gaugeSafeHues = [GL_COLOR_DATA_BLUE_500, GL_COLOR_DATA_BLUE_900];
84
+ export const gaugeWarningHue = GL_COLOR_DATA_ORANGE_500;
91
85
 
92
86
  /**
93
87
  * The default palette is based on the Categorical data palette
@@ -96,71 +90,71 @@ export const gaugeWarningHue = DATA_VIZ_ORANGE_500;
96
90
  * More info: https://design.gitlab.com/data-visualization/color#categorical-data
97
91
  */
98
92
  export const colorPaletteDefault = [
99
- DATA_VIZ_BLUE_500,
100
- DATA_VIZ_ORANGE_600,
101
- DATA_VIZ_AQUA_500,
102
- DATA_VIZ_GREEN_600,
103
- DATA_VIZ_MAGENTA_500,
104
- DATA_VIZ_BLUE_700,
105
- DATA_VIZ_ORANGE_800,
106
- DATA_VIZ_AQUA_700,
107
- DATA_VIZ_GREEN_800,
108
- DATA_VIZ_MAGENTA_700,
109
- DATA_VIZ_BLUE_900,
110
- DATA_VIZ_ORANGE_950,
111
- DATA_VIZ_AQUA_900,
112
- DATA_VIZ_GREEN_950,
113
- DATA_VIZ_MAGENTA_900,
114
- DATA_VIZ_BLUE_600,
115
- DATA_VIZ_ORANGE_700,
116
- DATA_VIZ_AQUA_600,
117
- DATA_VIZ_GREEN_700,
118
- DATA_VIZ_MAGENTA_600,
119
- DATA_VIZ_BLUE_800,
120
- DATA_VIZ_ORANGE_900,
121
- DATA_VIZ_AQUA_800,
122
- DATA_VIZ_GREEN_900,
123
- DATA_VIZ_MAGENTA_800,
124
- DATA_VIZ_BLUE_950,
125
- DATA_VIZ_ORANGE_500,
126
- DATA_VIZ_AQUA_950,
127
- DATA_VIZ_GREEN_500,
128
- DATA_VIZ_MAGENTA_950,
93
+ GL_COLOR_DATA_BLUE_500,
94
+ GL_COLOR_DATA_ORANGE_600,
95
+ GL_COLOR_DATA_AQUA_500,
96
+ GL_COLOR_DATA_GREEN_600,
97
+ GL_COLOR_DATA_MAGENTA_500,
98
+ GL_COLOR_DATA_BLUE_700,
99
+ GL_COLOR_DATA_ORANGE_800,
100
+ GL_COLOR_DATA_AQUA_700,
101
+ GL_COLOR_DATA_GREEN_800,
102
+ GL_COLOR_DATA_MAGENTA_700,
103
+ GL_COLOR_DATA_BLUE_900,
104
+ GL_COLOR_DATA_ORANGE_950,
105
+ GL_COLOR_DATA_AQUA_900,
106
+ GL_COLOR_DATA_GREEN_950,
107
+ GL_COLOR_DATA_MAGENTA_900,
108
+ GL_COLOR_DATA_BLUE_600,
109
+ GL_COLOR_DATA_ORANGE_700,
110
+ GL_COLOR_DATA_AQUA_600,
111
+ GL_COLOR_DATA_GREEN_700,
112
+ GL_COLOR_DATA_MAGENTA_600,
113
+ GL_COLOR_DATA_BLUE_800,
114
+ GL_COLOR_DATA_ORANGE_900,
115
+ GL_COLOR_DATA_AQUA_800,
116
+ GL_COLOR_DATA_GREEN_900,
117
+ GL_COLOR_DATA_MAGENTA_800,
118
+ GL_COLOR_DATA_BLUE_950,
119
+ GL_COLOR_DATA_ORANGE_500,
120
+ GL_COLOR_DATA_AQUA_950,
121
+ GL_COLOR_DATA_GREEN_500,
122
+ GL_COLOR_DATA_MAGENTA_950,
129
123
  ];
130
124
  export const colorFromDefaultPalette = (index) =>
131
125
  colorPaletteDefault[index % colorPaletteDefault.length];
132
126
 
133
127
  export const colorPaletteDark = [
134
- DATA_VIZ_BLUE_500,
135
- DATA_VIZ_ORANGE_400,
136
- DATA_VIZ_AQUA_500,
137
- DATA_VIZ_GREEN_400,
138
- DATA_VIZ_MAGENTA_500,
139
- DATA_VIZ_BLUE_300,
140
- DATA_VIZ_ORANGE_200,
141
- DATA_VIZ_AQUA_300,
142
- DATA_VIZ_GREEN_200,
143
- DATA_VIZ_MAGENTA_300,
144
- DATA_VIZ_BLUE_100,
145
- DATA_VIZ_ORANGE_50,
146
- DATA_VIZ_AQUA_100,
147
- DATA_VIZ_GREEN_50,
148
- DATA_VIZ_MAGENTA_100,
149
- DATA_VIZ_BLUE_400,
150
- DATA_VIZ_ORANGE_300,
151
- DATA_VIZ_AQUA_400,
152
- DATA_VIZ_GREEN_300,
153
- DATA_VIZ_MAGENTA_400,
154
- DATA_VIZ_BLUE_200,
155
- DATA_VIZ_ORANGE_100,
156
- DATA_VIZ_AQUA_200,
157
- DATA_VIZ_GREEN_100,
158
- DATA_VIZ_MAGENTA_200,
159
- DATA_VIZ_BLUE_50,
160
- DATA_VIZ_ORANGE_500,
161
- DATA_VIZ_AQUA_50,
162
- DATA_VIZ_GREEN_500,
163
- DATA_VIZ_MAGENTA_50,
128
+ GL_COLOR_DATA_BLUE_500,
129
+ GL_COLOR_DATA_ORANGE_400,
130
+ GL_COLOR_DATA_AQUA_500,
131
+ GL_COLOR_DATA_GREEN_400,
132
+ GL_COLOR_DATA_MAGENTA_500,
133
+ GL_COLOR_DATA_BLUE_300,
134
+ GL_COLOR_DATA_ORANGE_200,
135
+ GL_COLOR_DATA_AQUA_300,
136
+ GL_COLOR_DATA_GREEN_200,
137
+ GL_COLOR_DATA_MAGENTA_300,
138
+ GL_COLOR_DATA_BLUE_100,
139
+ GL_COLOR_DATA_ORANGE_50,
140
+ GL_COLOR_DATA_AQUA_100,
141
+ GL_COLOR_DATA_GREEN_50,
142
+ GL_COLOR_DATA_MAGENTA_100,
143
+ GL_COLOR_DATA_BLUE_400,
144
+ GL_COLOR_DATA_ORANGE_300,
145
+ GL_COLOR_DATA_AQUA_400,
146
+ GL_COLOR_DATA_GREEN_300,
147
+ GL_COLOR_DATA_MAGENTA_400,
148
+ GL_COLOR_DATA_BLUE_200,
149
+ GL_COLOR_DATA_ORANGE_100,
150
+ GL_COLOR_DATA_AQUA_200,
151
+ GL_COLOR_DATA_GREEN_100,
152
+ GL_COLOR_DATA_MAGENTA_200,
153
+ GL_COLOR_DATA_BLUE_50,
154
+ GL_COLOR_DATA_ORANGE_500,
155
+ GL_COLOR_DATA_AQUA_50,
156
+ GL_COLOR_DATA_GREEN_500,
157
+ GL_COLOR_DATA_MAGENTA_50,
164
158
  ];
165
159
 
166
160
  export const colorFromDarkPalette = (index) => colorPaletteDark[index % colorPaletteDark.length];
@@ -169,7 +163,7 @@ const axes = {
169
163
  axisLabel: {
170
164
  margin: 8,
171
165
  show: true,
172
- color: `var(--gray-600, ${GRAY_600})`,
166
+ color: 'var(--gl-chart-axis-text-color)',
173
167
  hideOverlap: true,
174
168
  },
175
169
  axisLine: {
@@ -178,7 +172,7 @@ const axes = {
178
172
  axisPointer: {
179
173
  lineStyle: {
180
174
  type: 'solid',
181
- color: GRAY_600,
175
+ color: 'var(--gl-chart-axis-pointer-color)',
182
176
  },
183
177
  label: {
184
178
  show: false,
@@ -188,7 +182,7 @@ const axes = {
188
182
  show: true,
189
183
  alignWithLabel: true,
190
184
  lineStyle: {
191
- color: GRAY_200,
185
+ color: 'var(--gl-chart-axis-line-color)',
192
186
  },
193
187
  },
194
188
  nameGap: 30,
@@ -197,14 +191,11 @@ const axes = {
197
191
  },
198
192
  splitLine: {
199
193
  lineStyle: {
200
- color: [GRAY_200],
194
+ color: ['var(--gl-chart-axis-line-color)'],
201
195
  },
202
196
  },
203
197
  splitArea: {
204
198
  show: false,
205
- areaStyle: {
206
- color: [hexToRgba(GRAY_50, 0.3), hexToRgba(GRAY_300, 0.3)],
207
- },
208
199
  },
209
200
  };
210
201
 
@@ -216,7 +207,7 @@ export const createTheme = (options = {}) => ({
216
207
  color: colorPaletteDefault,
217
208
  backgroundColor: 'transparent',
218
209
  textStyle: {
219
- color: `var(--gl-text-color, ${GRAY_900})`,
210
+ color: 'var(--gl-text-color-default)',
220
211
  },
221
212
  markLine: {
222
213
  silent: true,
@@ -225,7 +216,7 @@ export const createTheme = (options = {}) => ({
225
216
  show: false,
226
217
  },
227
218
  lineStyle: {
228
- color: RED_500,
219
+ color: 'var(--gl-chart-threshold-line-color)',
229
220
  width: 1,
230
221
  type: 'dashed',
231
222
  },
@@ -233,7 +224,7 @@ export const createTheme = (options = {}) => ({
233
224
  markArea: {
234
225
  silent: true,
235
226
  itemStyle: {
236
- color: hexToRgba(RED_500, 0.1),
227
+ color: 'var(--gl-chart-threshold-area-color)',
237
228
  },
238
229
  },
239
230
  dataZoom: {
@@ -243,7 +234,7 @@ export const createTheme = (options = {}) => ({
243
234
  dataBackground: {
244
235
  lineStyle: {
245
236
  width: 2,
246
- color: GRAY_200,
237
+ color: 'var(--gl-chart-axis-line-color)',
247
238
  opacity: 1,
248
239
  },
249
240
  // render unfilled zoom-graph if the series is a line chart without area styles
@@ -251,20 +242,25 @@ export const createTheme = (options = {}) => ({
251
242
  areaStyle: isLineChartWithoutArea(options)
252
243
  ? {} // Use empty object instead of null, see https://gitlab.com/gitlab-org/gitlab-ui/-/merge_requests/2185#note_707711029 for more context
253
244
  : {
254
- color: GRAY_50,
245
+ color: 'var(--gl-background-color-strong)',
255
246
  opacity: 1,
256
247
  },
257
248
  },
258
- fillerColor: hexToRgba(GRAY_200, 0.23),
249
+ fillerColor: 'var(--gl-chart-zoom-filler-color)',
259
250
  handleIcon: scrollHandleSvgPath,
251
+ emphasis: {
252
+ handleStyle: {
253
+ color: 'var(--gl-chart-zoom-handle-color)',
254
+ },
255
+ },
260
256
  handleStyle: {
261
257
  borderColor: 'transparent',
262
- color: GRAY_500,
258
+ color: 'var(--gl-chart-zoom-handle-color)',
263
259
  },
264
260
  handleSize: '50%',
265
261
  labelFormatter: () => null,
266
262
  textStyle: {
267
- color: GRAY_600,
263
+ color: 'var(--gl-chart-axis-text-color)',
268
264
  },
269
265
  },
270
266
  toolbox: {
@@ -274,14 +270,15 @@ export const createTheme = (options = {}) => ({
274
270
  emphasis: {
275
271
  iconStyle: {
276
272
  borderWidth: 0,
277
- color: GRAY_900,
278
- textBackgroundColor: WHITE,
273
+ color: 'var(--gl-icon-color-default)',
274
+ textFill: 'var(--gl-feedback-strong-text-color)',
275
+ textBackgroundColor: 'var(--gl-feedback-strong-background-color)',
279
276
  textBorderRadius: GL_BORDER_RADIUS_BASE,
280
277
  textPadding: [8, 12],
281
278
  },
282
279
  },
283
280
  iconStyle: {
284
- color: GRAY_500,
281
+ color: 'var(--gl-icon-color-default)',
285
282
  borderWidth: 0,
286
283
  },
287
284
  itemGap: 8,
@@ -311,12 +308,12 @@ export const createTheme = (options = {}) => ({
311
308
  label: {
312
309
  normal: {
313
310
  textStyle: {
314
- color: GRAY_50,
311
+ color: GL_COLOR_NEUTRAL_50,
315
312
  },
316
313
  },
317
314
  emphasis: {
318
315
  textStyle: {
319
- color: GRAY_50,
316
+ color: GL_COLOR_NEUTRAL_50,
320
317
  },
321
318
  },
322
319
  },