@gitlab/ui 49.8.0 → 49.9.1

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 (57) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/components/base/new_dropdowns/listbox/listbox.js +8 -5
  3. package/dist/components/base/paginated_list/paginated_list.js +1 -1
  4. package/dist/components/base/pagination/pagination.js +3 -3
  5. package/dist/components/base/path/path.js +1 -1
  6. package/dist/components/charts/area/area.js +2 -2
  7. package/dist/components/charts/bar/bar.js +1 -1
  8. package/dist/components/charts/chart/chart.js +1 -1
  9. package/dist/components/charts/column/column.js +2 -2
  10. package/dist/components/charts/discrete_scatter/discrete_scatter.js +2 -2
  11. package/dist/components/charts/gauge/gauge.js +1 -1
  12. package/dist/components/charts/heatmap/heatmap.js +1 -1
  13. package/dist/components/charts/line/line.js +2 -2
  14. package/dist/components/charts/sparkline/sparkline.js +1 -1
  15. package/dist/components/charts/stacked_column/stacked_column.js +2 -2
  16. package/dist/components/mixins/toolbox_mixin.js +2 -2
  17. package/dist/index.css +2 -2
  18. package/dist/index.css.map +1 -1
  19. package/dist/utility_classes.css +1 -1
  20. package/dist/utility_classes.css.map +1 -1
  21. package/dist/utils/breakpoints.js +2 -3
  22. package/dist/utils/charts/config.js +8 -9
  23. package/dist/utils/charts/theme.js +1 -2
  24. package/dist/utils/use_mock_intersection_observer.js +1 -1
  25. package/dist/utils.js +1 -1
  26. package/package.json +16 -8
  27. package/scss_to_js/scss_variables.js +6 -5
  28. package/scss_to_js/scss_variables.json +15 -10
  29. package/src/components/base/new_dropdowns/listbox/listbox.vue +10 -7
  30. package/src/components/base/paginated_list/__snapshots__/paginated_list.spec.js.snap +0 -8
  31. package/src/components/base/paginated_list/paginated_list.vue +4 -3
  32. package/src/components/base/pagination/pagination.vue +3 -3
  33. package/src/components/base/path/__snapshots__/path.spec.js.snap +0 -30
  34. package/src/components/base/path/path.vue +1 -2
  35. package/src/components/charts/area/area.vue +3 -2
  36. package/src/components/charts/bar/bar.vue +1 -1
  37. package/src/components/charts/chart/chart.spec.js +1 -1
  38. package/src/components/charts/chart/chart.vue +1 -1
  39. package/src/components/charts/column/column.vue +3 -2
  40. package/src/components/charts/discrete_scatter/discrete_scatter.vue +3 -2
  41. package/src/components/charts/gauge/gauge.vue +1 -1
  42. package/src/components/charts/heatmap/heatmap.vue +1 -1
  43. package/src/components/charts/line/line.vue +3 -2
  44. package/src/components/charts/sparkline/sparkline.vue +2 -1
  45. package/src/components/charts/stacked_column/stacked_column.vue +3 -2
  46. package/src/components/mixins/toolbox_mixin.js +1 -1
  47. package/src/components/utilities/intersection_observer/intersection_observer.spec.js +1 -1
  48. package/src/scss/utilities.scss +24 -0
  49. package/src/scss/utility-mixins/box-shadow.scss +21 -0
  50. package/src/scss/variables.scss +6 -5
  51. package/src/utils/breakpoints.js +1 -3
  52. package/src/utils/breakpoints.spec.js +4 -4
  53. package/src/utils/charts/config.js +8 -8
  54. package/src/utils/charts/config.spec.js +2 -2
  55. package/src/utils/charts/theme.js +1 -3
  56. package/src/utils/use_mock_intersection_observer.js +1 -3
  57. package/src/utils.js +1 -1
@@ -7,7 +7,7 @@ import { TOOLTIP_LEFT_OFFSET } from '../../../utils/charts/constants';
7
7
  import { heatmapHues } from '../../../utils/charts/theme';
8
8
  import { engineeringNotation } from '../../../utils/number_utils';
9
9
  import { debounceByAnimationFrame } from '../../../utils/utils';
10
- import ToolboxMixin from '../../mixins/toolbox_mixin';
10
+ import { ToolboxMixin } from '../../mixins/toolbox_mixin';
11
11
  import TooltipDefaultFormat from '../../shared_components/charts/tooltip_default_format.vue';
12
12
  import Chart from '../chart/chart.vue';
13
13
  import ChartLegend from '../legend/legend.vue';
@@ -20,7 +20,8 @@
20
20
 
21
21
  import merge from 'lodash/merge';
22
22
  import { gray200 } from '../../../../scss_to_js/scss_variables'; // eslint-disable-line import/no-unresolved
23
- import defaultChartOptions, {
23
+ import {
24
+ defaultChartOptions,
24
25
  grid,
25
26
  getThresholdConfig,
26
27
  generateAnnotationSeries,
@@ -44,7 +45,7 @@ import {
44
45
  import { colorFromDefaultPalette } from '../../../utils/charts/theme';
45
46
  import { seriesHasAnnotations, isDataPointAnnotation } from '../../../utils/charts/utils';
46
47
  import { debounceByAnimationFrame } from '../../../utils/utils';
47
- import ToolboxMixin from '../../mixins/toolbox_mixin';
48
+ import { ToolboxMixin } from '../../mixins/toolbox_mixin';
48
49
  import TooltipDefaultFormat from '../../shared_components/charts/tooltip_default_format.vue';
49
50
  import Chart from '../chart/chart.vue';
50
51
  import ChartLegend from '../legend/legend.vue';
@@ -2,7 +2,8 @@
2
2
  <script>
3
3
  import merge from 'lodash/merge';
4
4
  import { GlResizeObserverDirective } from '../../../directives/resize_observer/resize_observer';
5
- import defaultChartOptions, {
5
+ import {
6
+ defaultChartOptions,
6
7
  mergeSeriesToOptions,
7
8
  symbolSize,
8
9
  } from '../../../utils/charts/config';
@@ -1,6 +1,7 @@
1
1
  <script>
2
2
  import merge from 'lodash/merge';
3
- import defaultChartOptions, {
3
+ import {
4
+ defaultChartOptions,
4
5
  grid,
5
6
  gridWithSecondaryYAxis,
6
7
  yAxis,
@@ -22,7 +23,7 @@ import {
22
23
  import { colorFromDefaultPalette } from '../../../utils/charts/theme';
23
24
  import { columnOptions } from '../../../utils/constants';
24
25
  import { debounceByAnimationFrame } from '../../../utils/utils';
25
- import ToolboxMixin from '../../mixins/toolbox_mixin';
26
+ import { ToolboxMixin } from '../../mixins/toolbox_mixin';
26
27
  import TooltipDefaultFormat from '../../shared_components/charts/tooltip_default_format.vue';
27
28
  import Chart from '../chart/chart.vue';
28
29
  import ChartLegend from '../legend/legend.vue';
@@ -7,7 +7,7 @@
7
7
 
8
8
  import { getToolboxConfig } from '../../utils/charts/config';
9
9
 
10
- export default {
10
+ export const ToolboxMixin = {
11
11
  props: {
12
12
  showToolbox: {
13
13
  type: Boolean,
@@ -1,5 +1,5 @@
1
1
  import { shallowMount } from '@vue/test-utils';
2
- import useMockIntersectionObserver from '~/utils/use_mock_intersection_observer';
2
+ import { useMockIntersectionObserver } from '~/utils/use_mock_intersection_observer';
3
3
  import GlIntersectionObserver from './intersection_observer.vue';
4
4
 
5
5
  const TEST_SLOT = '<p>Hello world! Lorem ipsum.</p>';
@@ -2081,6 +2081,30 @@
2081
2081
  .gl-shadow-drawer\! {
2082
2082
  box-shadow: -4px 0 8px $gray-200 !important
2083
2083
  }
2084
+
2085
+ .gl-shadow-sm {
2086
+ box-shadow: 0 1px 2px rgba($gray-950, 0.1)
2087
+ }
2088
+
2089
+ .gl-shadow-sm\! {
2090
+ box-shadow: 0 1px 2px rgba($gray-950, 0.1) !important
2091
+ }
2092
+
2093
+ .gl-shadow-md {
2094
+ box-shadow: 0 2px 8px rgba($gray-950, 0.16), 0 0 2px rgba($gray-950, 0.16)
2095
+ }
2096
+
2097
+ .gl-shadow-md\! {
2098
+ box-shadow: 0 2px 8px rgba($gray-950, 0.16), 0 0 2px rgba($gray-950, 0.16) !important
2099
+ }
2100
+
2101
+ .gl-shadow-lg {
2102
+ box-shadow: 0 4px 12px rgba($gray-950, 0.16), 0 0 4px rgba($gray-950, 0.16)
2103
+ }
2104
+
2105
+ .gl-shadow-lg\! {
2106
+ box-shadow: 0 4px 12px rgba($gray-950, 0.16), 0 0 4px rgba($gray-950, 0.16) !important
2107
+ }
2084
2108
  .gl-clearfix {
2085
2109
  &::after {
2086
2110
  display: block;
@@ -185,3 +185,24 @@
185
185
  @mixin gl-shadow-drawer {
186
186
  box-shadow: -4px 0 8px $gray-200;
187
187
  }
188
+
189
+ /**
190
+ * New utilities to match design specs
191
+ * Per https: //gitlab.com/gitlab-org/gitlab-ui/-/issues/615,
192
+ * some of the above could be replaced.
193
+ *
194
+ * These use gray instead of black to align with
195
+ * tinted neutrals.
196
+ */
197
+
198
+ @mixin gl-shadow-sm {
199
+ box-shadow: 0 1px 2px rgba($gray-950, 0.1);
200
+ }
201
+
202
+ @mixin gl-shadow-md {
203
+ box-shadow: 0 2px 8px rgba($gray-950, 0.16), 0 0 2px rgba($gray-950, 0.16);
204
+ }
205
+
206
+ @mixin gl-shadow-lg {
207
+ box-shadow: 0 4px 12px rgba($gray-950, 0.16), 0 0 4px rgba($gray-950, 0.16);
208
+ }
@@ -304,11 +304,12 @@ $darken-dark-factor: 10%;
304
304
  $darken-border-factor: 5%;
305
305
  $darken-border-dashed-factor: 25%;
306
306
 
307
- $t-gray-a-02: rgba($black, 0.02);
308
- $t-gray-a-04: rgba($black, 0.04);
309
- $t-gray-a-06: rgba($black, 0.06);
310
- $t-gray-a-08: rgba(#000, 0.08);
311
- $t-gray-a-24: rgba(#000, 0.24);
307
+ $t-gray-a-02: rgba($gray-950, 0.02);
308
+ $t-gray-a-04: rgba($gray-950, 0.04);
309
+ $t-gray-a-06: rgba($gray-950, 0.06);
310
+ $t-gray-a-08: rgba($gray-950, 0.08);
311
+ $t-gray-a-16: rgba($gray-950, 0.16);
312
+ $t-gray-a-24: rgba($gray-950, 0.24);
312
313
 
313
314
  // Text
314
315
  $gl-text-color: $gray-900 !default;
@@ -6,7 +6,7 @@ export const breakpoints = {
6
6
  xs: 0,
7
7
  };
8
8
 
9
- const BreakpointInstance = {
9
+ export const GlBreakpointInstance = {
10
10
  windowWidth: () => window.innerWidth,
11
11
  getBreakpointSize() {
12
12
  const windowWidth = this.windowWidth();
@@ -19,5 +19,3 @@ const BreakpointInstance = {
19
19
  return ['xl', 'lg'].includes(this.getBreakpointSize());
20
20
  },
21
21
  };
22
-
23
- export default BreakpointInstance;
@@ -1,4 +1,4 @@
1
- import bp from './breakpoints';
1
+ import { GlBreakpointInstance } from './breakpoints';
2
2
 
3
3
  describe('breakpoints', () => {
4
4
  describe.each`
@@ -10,16 +10,16 @@ describe('breakpoints', () => {
10
10
  ${'xs'} | ${0} | ${false}
11
11
  `('$key', ({ size, key, expectedDesktop }) => {
12
12
  beforeEach(() => {
13
- jest.spyOn(bp, 'windowWidth').mockImplementationOnce(() => size + 10);
13
+ jest.spyOn(GlBreakpointInstance, 'windowWidth').mockImplementationOnce(() => size + 10);
14
14
  });
15
15
 
16
16
  it(`returns ${key} when larger than ${size}`, () => {
17
- expect(bp.getBreakpointSize()).toBe(key);
17
+ expect(GlBreakpointInstance.getBreakpointSize()).toBe(key);
18
18
  });
19
19
 
20
20
  describe('isDesktop', () => {
21
21
  it(`returns ${expectedDesktop} when screen size is ${size}`, () => {
22
- expect(bp.isDesktop()).toBe(expectedDesktop);
22
+ expect(GlBreakpointInstance.isDesktop()).toBe(expectedDesktop);
23
23
  });
24
24
  });
25
25
  });
@@ -2,7 +2,7 @@ import castArray from 'lodash/castArray';
2
2
  import isArray from 'lodash/isArray';
3
3
  import merge from 'lodash/merge';
4
4
  import { blue500 } from '../../../scss_to_js/scss_variables'; // eslint-disable-line import/no-unresolved
5
- import Breakpoints from '../breakpoints';
5
+ import { GlBreakpointInstance } from '../breakpoints';
6
6
  import { columnOptions } from '../constants';
7
7
  import { areDatesEqual } from '../datetime_utility';
8
8
  import { engineeringNotation } from '../number_utils';
@@ -42,6 +42,12 @@ export const grid = {
42
42
  right: 32,
43
43
  };
44
44
 
45
+ export const defaultChartOptions = {
46
+ grid,
47
+ xAxis,
48
+ yAxis,
49
+ };
50
+
45
51
  export const gridWithSecondaryYAxis = {
46
52
  ...grid,
47
53
  right: 64,
@@ -93,7 +99,7 @@ const LESS_THAN = ['<', '&lt;'];
93
99
  */
94
100
  export const getDataZoomConfig = ({ filterMode = 'none' } = {}) => {
95
101
  const disabledBreakpoints = ['lg', 'xl'];
96
- const disabled = disabledBreakpoints.includes(Breakpoints.getBreakpointSize());
102
+ const disabled = disabledBreakpoints.includes(GlBreakpointInstance.getBreakpointSize());
97
103
  const minSpan = filterMode === 'none' ? 0.01 : null;
98
104
 
99
105
  return {
@@ -499,9 +505,3 @@ export const getDefaultTooltipContent = (params, yAxisTitle = null) => {
499
505
 
500
506
  return { xLabels, tooltipContent };
501
507
  };
502
-
503
- export default {
504
- grid,
505
- xAxis,
506
- yAxis,
507
- };
@@ -1,5 +1,5 @@
1
1
  import merge from 'lodash/merge';
2
- import Breakpoints from '../breakpoints';
2
+ import { GlBreakpointInstance } from '../breakpoints';
3
3
  import { columnOptions } from '../constants';
4
4
  import { hexToRgba } from '../utils';
5
5
  import {
@@ -197,7 +197,7 @@ describe('chart config helpers', () => {
197
197
 
198
198
  describe('on small viewports', () => {
199
199
  it('creates a basic dataZoomConfig with inside scrolling being enabled', () => {
200
- jest.spyOn(Breakpoints, 'getBreakpointSize').mockImplementationOnce(() => 'sm');
200
+ jest.spyOn(GlBreakpointInstance, 'getBreakpointSize').mockImplementationOnce(() => 'sm');
201
201
  const actual = getDataZoomConfig();
202
202
  const dataZoomWithInsideEnabled = [
203
203
  {
@@ -147,7 +147,7 @@ const isLineChartWithoutArea = (options) =>
147
147
  Array.isArray(options?.series) &&
148
148
  options.series.some((series) => series.type === 'line' && !series.areaStyle);
149
149
 
150
- const createTheme = (options = {}) => ({
150
+ export const createTheme = (options = {}) => ({
151
151
  color: colorPaletteDefault,
152
152
  backgroundColor: 'transparent',
153
153
  textStyle: {
@@ -268,5 +268,3 @@ const createTheme = (options = {}) => ({
268
268
  logAxis: axes,
269
269
  timeAxis: axes,
270
270
  });
271
-
272
- export default createTheme;
@@ -63,7 +63,7 @@ class MockIntersectionObserver extends MockObserver {
63
63
  }
64
64
  }
65
65
 
66
- const useMockIntersectionObserver = () => {
66
+ export const useMockIntersectionObserver = () => {
67
67
  let instances;
68
68
  let origObserver;
69
69
 
@@ -94,5 +94,3 @@ const useMockIntersectionObserver = () => {
94
94
 
95
95
  return { getInstances, trigger };
96
96
  };
97
-
98
- export default useMockIntersectionObserver;
package/src/utils.js CHANGED
@@ -1 +1 @@
1
- export { default as GlBreakpointInstance, breakpoints } from './utils/breakpoints';
1
+ export { GlBreakpointInstance, breakpoints } from './utils/breakpoints';