@gitlab/ui 66.26.0 → 66.28.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,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 10 Oct 2023 19:49:13 GMT
3
+ * Generated on Thu, 12 Oct 2023 06:30:08 GMT
4
4
  */
5
5
 
6
6
  :root {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 10 Oct 2023 19:49:14 GMT
3
+ * Generated on Thu, 12 Oct 2023 06:30:09 GMT
4
4
  */
5
5
 
6
6
  :root {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 10 Oct 2023 19:49:14 GMT
3
+ * Generated on Thu, 12 Oct 2023 06:30:09 GMT
4
4
  */
5
5
 
6
6
  export const BLACK = "#fff";
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 10 Oct 2023 19:49:13 GMT
3
+ * Generated on Thu, 12 Oct 2023 06:30:08 GMT
4
4
  */
5
5
 
6
6
  export const BLACK = "#000";
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Tue, 10 Oct 2023 19:49:14 GMT
3
+ // Generated on Thu, 12 Oct 2023 06:30:09 GMT
4
4
 
5
5
  $red-950: #fff4f3;
6
6
  $red-900: #fcf1ef;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Tue, 10 Oct 2023 19:49:14 GMT
3
+ // Generated on Thu, 12 Oct 2023 06:30:09 GMT
4
4
 
5
5
  $gl-line-height-52: 3.25rem;
6
6
  $gl-line-height-44: 2.75rem;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "66.26.0",
3
+ "version": "66.28.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -129,7 +129,7 @@
129
129
  "eslint": "8.51.0",
130
130
  "eslint-import-resolver-jest": "3.0.2",
131
131
  "eslint-plugin-cypress": "2.15.1",
132
- "eslint-plugin-storybook": "0.6.14",
132
+ "eslint-plugin-storybook": "0.6.15",
133
133
  "glob": "10.3.3",
134
134
  "identity-obj-proxy": "^3.0.0",
135
135
  "inquirer-select-directory": "^1.2.0",
@@ -28,24 +28,26 @@
28
28
  }
29
29
 
30
30
  .gl-alert-title {
31
- @include gl-font-base;
32
- @include gl-font-weight-bold;
33
- @include gl-line-height-normal;
34
- @include gl-mt-0;
31
+ @include gl-heading-scale-500;
35
32
  @include gl-mb-3;
36
33
  }
37
34
 
38
- .gl-alert-icon {
35
+ .gl-alert-icon-container {
39
36
  @include gl-absolute;
40
37
  @include gl-top-5;
41
38
  @include gl-left-5;
42
- @include gl-w-5;
43
- @include gl-h-5;
44
- @include gl-fill-current-color;
39
+ @include gl-display-flex;
40
+ @include gl-align-items-center;
41
+ height: $gl-line-height-20;
42
+
43
+ .gl-alert-has-title & {
44
+ @include gl-heading-scale-500; // get dynamic font-size
45
+ height: $gl-line-height-heading * 1em; // give unit to unitless relative line-height (1.25)
46
+ }
45
47
  }
46
48
 
47
- .gl-alert-icon-no-title {
48
- @include gl-mt-1;
49
+ .gl-alert-icon {
50
+ @include gl-fill-current-color;
49
51
  }
50
52
 
51
53
  .gl-alert-body {
@@ -190,6 +190,22 @@ describe('Alert component', () => {
190
190
  expect(wrapper.classes()).not.toContain(cssClass);
191
191
  });
192
192
  });
193
+
194
+ it('adds the `gl-alert-has-title` class if there is a title', () => {
195
+ createComponent({
196
+ propsData: {
197
+ title: 'title',
198
+ },
199
+ });
200
+
201
+ expect(wrapper.classes()).toContain('gl-alert-has-title');
202
+ });
203
+
204
+ it('does not add the `gl-alert-has-title` class if there is no title', () => {
205
+ createComponent();
206
+
207
+ expect(wrapper.classes()).not.toContain('gl-alert-has-title');
208
+ });
193
209
  });
194
210
 
195
211
  describe('role and aria-live', () => {
@@ -197,15 +197,13 @@ export default {
197
197
  { 'gl-alert-sticky': sticky },
198
198
  { 'gl-alert-not-dismissible': !dismissible },
199
199
  { 'gl-alert-no-icon': !showIcon },
200
+ { 'gl-alert-has-title': !!title },
200
201
  variantClass,
201
202
  ]"
202
203
  >
203
- <gl-icon
204
- v-if="showIcon"
205
- :name="iconName"
206
- :class="{ 'gl-alert-icon': true, 'gl-alert-icon-no-title': !title }"
207
- />
208
-
204
+ <div v-if="showIcon" class="gl-alert-icon-container">
205
+ <gl-icon :name="iconName" class="gl-alert-icon" />
206
+ </div>
209
207
  <div class="gl-alert-content" :role="role" :aria-live="ariaLive">
210
208
  <h2 v-if="title" class="gl-alert-title">{{ title }}</h2>
211
209
 
@@ -2,6 +2,7 @@ import { shallowMount } from '@vue/test-utils';
2
2
  import { createMockChartInstance } from '~helpers/chart_stubs';
3
3
  import { expectHeightAutoClasses } from '~helpers/chart_height';
4
4
  import Chart from '../chart/chart.vue';
5
+ import ChartTooltip from '../tooltip/tooltip.vue';
5
6
  import DiscreteScatterChart from './discrete_scatter.vue';
6
7
 
7
8
  let mockChartInstance;
@@ -38,4 +39,20 @@ describe('column chart component', () => {
38
39
  findChart,
39
40
  });
40
41
  });
42
+
43
+ describe('disable-tooltip', () => {
44
+ it('is set to false by default', async () => {
45
+ createComponent();
46
+
47
+ await findChart().vm.$emit('created', mockChartInstance);
48
+
49
+ expect(wrapper.findComponent(ChartTooltip).exists()).toBe(true);
50
+ });
51
+
52
+ it('disables the tooltip', () => {
53
+ createComponent({ disableTooltip: true });
54
+
55
+ expect(wrapper.findComponent(ChartTooltip).exists()).toBe(false);
56
+ });
57
+ });
41
58
  });
@@ -11,6 +11,7 @@ const Template = (args, { argTypes }) => ({
11
11
  :x-axis-title="xAxisTitle"
12
12
  data-testid="discrete-scatter-chart"
13
13
  :height="height"
14
+ :disableTooltip="disableTooltip"
14
15
  />
15
16
  `,
16
17
  });
@@ -49,6 +49,11 @@ export default {
49
49
  required: false,
50
50
  default: null,
51
51
  },
52
+ disableTooltip: {
53
+ type: Boolean,
54
+ required: false,
55
+ default: () => false,
56
+ },
52
57
  /**
53
58
  * Sets the chart's height in pixels. Set to `"auto"` to use the height of the container.
54
59
  */
@@ -187,7 +192,7 @@ export default {
187
192
  @created="onCreated"
188
193
  />
189
194
  <chart-tooltip
190
- v-if="chart"
195
+ v-if="!disableTooltip && chart"
191
196
  :show="showTooltip"
192
197
  :chart="chart"
193
198
  :top="tooltipPosition.top"