@gitlab/ui 78.14.1 → 78.15.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 Mon, 15 Apr 2024 10:48:52 GMT
3
+ * Generated on Tue, 16 Apr 2024 20:25:30 GMT
4
4
  */
5
5
 
6
6
  :root {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Mon, 15 Apr 2024 10:48:52 GMT
3
+ * Generated on Tue, 16 Apr 2024 20:25:30 GMT
4
4
  */
5
5
 
6
6
  :root.gl-dark {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Mon, 15 Apr 2024 10:48:52 GMT
3
+ * Generated on Tue, 16 Apr 2024 20:25:30 GMT
4
4
  */
5
5
 
6
6
  export const DATA_VIZ_GREEN_50 = "#133a03";
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Mon, 15 Apr 2024 10:48:52 GMT
3
+ * Generated on Tue, 16 Apr 2024 20:25:30 GMT
4
4
  */
5
5
 
6
6
  export const DATA_VIZ_GREEN_50 = "#ddfab7";
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Mon, 15 Apr 2024 10:48:52 GMT
3
+ // Generated on Tue, 16 Apr 2024 20:25:30 GMT
4
4
 
5
5
  $gl-text-tertiary: #737278 !default;
6
6
  $gl-text-secondary: #89888d !default;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Mon, 15 Apr 2024 10:48:52 GMT
3
+ // Generated on Tue, 16 Apr 2024 20:25:30 GMT
4
4
 
5
5
  $gl-text-tertiary: #89888d !default;
6
6
  $gl-text-secondary: #737278 !default;
@@ -64,10 +64,6 @@ const variantCssColorMap = {
64
64
  danger: 'gl-text-red-500'
65
65
  };
66
66
  const targetOptions = ['_self', '_blank', '_parent', '_top', null];
67
- const labelSizeOptions = {
68
- default: null,
69
- sm: 'sm'
70
- };
71
67
  const viewModeOptions = {
72
68
  dark: 'dark',
73
69
  light: 'light'
@@ -298,4 +294,4 @@ const loadingIconVariants = {
298
294
  dots: 'dots'
299
295
  };
300
296
 
301
- export { COMMA, CONTRAST_LEVELS, HEX_REGEX, LEFT_MOUSE_BUTTON, alertVariantIconMap, alertVariantOptions, alignOptions, avatarShapeOptions, avatarSizeOptions, avatarsInlineSizeOptions, badgeForButtonOptions, badgeIconSizeOptions, badgeSizeOptions, badgeVariantOptions, bannerVariants, buttonCategoryOptions, buttonSizeOptions, buttonVariantOptions, colorThemes, columnOptions, datepickerWidthOptionsMap, defaultDateFormat, drawerVariants, dropdownAllowedAutoPlacements, dropdownPlacements, dropdownVariantOptions, focusableTags, formInputWidths, formStateOptions, glThemes, iconSizeOptions, keyboard, labelColorOptions, labelSizeOptions, loadingIconSizes, loadingIconVariants, maxZIndex, modalButtonDefaults, modalSizeOptions, popoverPlacements, resizeDebounceTime, tabsButtonDefaults, targetOptions, toggleLabelPosition, tokenVariants, tooltipActionEvents, tooltipDelay, tooltipPlacements, triggerVariantOptions, truncateOptions, variantCssColorMap, variantOptions, variantOptionsWithNoDefault, viewModeOptions };
297
+ export { COMMA, CONTRAST_LEVELS, HEX_REGEX, LEFT_MOUSE_BUTTON, alertVariantIconMap, alertVariantOptions, alignOptions, avatarShapeOptions, avatarSizeOptions, avatarsInlineSizeOptions, badgeForButtonOptions, badgeIconSizeOptions, badgeSizeOptions, badgeVariantOptions, bannerVariants, buttonCategoryOptions, buttonSizeOptions, buttonVariantOptions, colorThemes, columnOptions, datepickerWidthOptionsMap, defaultDateFormat, drawerVariants, dropdownAllowedAutoPlacements, dropdownPlacements, dropdownVariantOptions, focusableTags, formInputWidths, formStateOptions, glThemes, iconSizeOptions, keyboard, labelColorOptions, loadingIconSizes, loadingIconVariants, maxZIndex, modalButtonDefaults, modalSizeOptions, popoverPlacements, resizeDebounceTime, tabsButtonDefaults, targetOptions, toggleLabelPosition, tokenVariants, tooltipActionEvents, tooltipDelay, tooltipPlacements, triggerVariantOptions, truncateOptions, variantCssColorMap, variantOptions, variantOptionsWithNoDefault, viewModeOptions };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "78.14.1",
3
+ "version": "78.15.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -102,7 +102,7 @@
102
102
  "@gitlab/eslint-plugin": "19.5.0",
103
103
  "@gitlab/fonts": "^1.3.0",
104
104
  "@gitlab/stylelint-config": "6.1.0",
105
- "@gitlab/svgs": "3.96.0",
105
+ "@gitlab/svgs": "3.97.0",
106
106
  "@rollup/plugin-commonjs": "^11.1.0",
107
107
  "@rollup/plugin-node-resolve": "^7.1.3",
108
108
  "@rollup/plugin-replace": "^2.3.2",
@@ -131,7 +131,7 @@
131
131
  "babel-jest": "29.0.1",
132
132
  "babel-loader": "^8.0.5",
133
133
  "bootstrap": "4.6.2",
134
- "cypress": "13.7.2",
134
+ "cypress": "13.7.3",
135
135
  "cypress-axe": "^1.4.0",
136
136
  "cypress-real-events": "^1.11.0",
137
137
  "dompurify": "^3.0.0",
@@ -9,7 +9,6 @@ They provide a quick way to recognize which categories the labeled object belong
9
9
  background-color="#D9C2EE"
10
10
  title="Label content"
11
11
  description="Some content"
12
- size="sm"
13
12
  tooltipPlacement="top"
14
13
  target="http://some.url"
15
14
  />
@@ -16,7 +16,7 @@ $label-close-button: '.gl-label-close.gl-button';
16
16
  background-color: var(--label-background-color);
17
17
  }
18
18
 
19
- &:focus-within {
19
+ &:has(*:first-child:focus) {
20
20
  @include gl-focus($color: var(--label-background-color, $white), $important: true);
21
21
  }
22
22
 
@@ -30,7 +30,8 @@ $label-close-button: '.gl-label-close.gl-button';
30
30
  @include gl-max-w-full;
31
31
 
32
32
  &:focus,
33
- &:hover {
33
+ &:hover,
34
+ &:focus:active {
34
35
  @include gl-reset-color;
35
36
  @include gl-shadow-none;
36
37
  @include gl-outline-none;
@@ -40,16 +41,18 @@ $label-close-button: '.gl-label-close.gl-button';
40
41
  .gl-label-text,
41
42
  .gl-label-text-scoped {
42
43
  @include gl-display-block;
43
- @include gl-px-3;
44
- @include gl-py-2;
44
+ padding-block: $gl-spacing-scale-1;
45
+ padding-inline: calc(#{$gl-spacing-scale-3} - 2px);
45
46
  @include str-truncated($label-max-width);
46
47
  }
47
48
 
48
49
  > #{$label-close-button} {
49
50
  @include gl-border-0;
50
51
  @include gl-display-flex;
51
- @include gl-ml-n2;
52
- @include gl-mr-2;
52
+ width: px-to-rem(14px);
53
+ height: px-to-rem(14px);
54
+ margin-left: calc(#{-$gl-spacing-scale-1} - 1px);
55
+ margin-right: calc(#{$gl-spacing-scale-2} - 1px);
53
56
  @include gl-p-0;
54
57
  @include gl-rounded-full;
55
58
  @include gl-shadow-none;
@@ -72,7 +75,7 @@ $label-close-button: '.gl-label-close.gl-button';
72
75
  }
73
76
 
74
77
  .gl-icon {
75
- @include gl-p-1;
78
+ vertical-align: -1px;
76
79
  }
77
80
  }
78
81
  }
@@ -146,6 +149,8 @@ $label-close-button: '.gl-label-close.gl-button';
146
149
  }
147
150
 
148
151
  #{$label-close-button} {
152
+ margin-left: calc(#{-$gl-spacing-scale-2} - 2px);
153
+
149
154
  &:focus,
150
155
  &:hover {
151
156
  .gl-icon {
@@ -155,27 +160,13 @@ $label-close-button: '.gl-label-close.gl-button';
155
160
  }
156
161
 
157
162
  .gl-label-text {
158
- @include gl-pr-2;
159
163
  background-color: var(--label-background-color);
160
164
  }
161
165
 
162
166
  .gl-label-text-scoped {
163
167
  @include gl-text-gray-950;
164
- @include gl-pl-2;
165
- @include gl-pr-3;
166
- }
167
- }
168
-
169
- .gl-label-sm {
170
- .gl-label-text,
171
- .gl-label-text-scoped {
172
- @include gl-py-0;
173
- @include gl-line-height-normal;
174
- @include gl-font-sm;
175
- }
176
-
177
- #{$label-close-button} {
178
- @include gl-mr-1;
168
+ padding-inline-start: calc($gl-spacing-scale-3 - 4px);
169
+ padding-inline-end: $gl-spacing-scale-3;
179
170
  }
180
171
  }
181
172
 
@@ -1,5 +1,4 @@
1
1
  import { mount, shallowMount } from '@vue/test-utils';
2
- import CloseButton from '../../shared_components/close_button/close_button.vue';
3
2
  import GlLink from '../link/link.vue';
4
3
  import GlTooltip from '../tooltip/tooltip.vue';
5
4
  import Label from './label.vue';
@@ -41,7 +40,7 @@ describe('Label component', () => {
41
40
  const findSubTitle = () => wrapper.find('.gl-label-text-scoped');
42
41
  const findTooltip = () => wrapper.findComponent(GlTooltip);
43
42
  const findTooltipText = () => findTooltip().text();
44
- const findCloseButton = () => wrapper.findComponent(CloseButton);
43
+ const findCloseButton = () => wrapper.find('.gl-label-close');
45
44
 
46
45
  describe('basic label', () => {
47
46
  it('renders the label title', () => {
@@ -1,4 +1,4 @@
1
- import { labelSizeOptions, tooltipPlacements } from '../../../utils/constants';
1
+ import { tooltipPlacements } from '../../../utils/constants';
2
2
  import GlLabel from './label.vue';
3
3
  import readme from './label.md';
4
4
 
@@ -6,7 +6,6 @@ const template = `
6
6
  <div class="gl-display-flex">
7
7
  <gl-label
8
8
  :background-color="backgroundColor"
9
- :size="size"
10
9
  :title="title"
11
10
  :description="description"
12
11
  :tooltip-placement="tooltipPlacement"
@@ -25,7 +24,6 @@ const Template = (args, { argTypes }) => ({
25
24
 
26
25
  const generateProps = ({
27
26
  title = 'Label title',
28
- size = labelSizeOptions.default,
29
27
  tooltipPlacement = tooltipPlacements.top,
30
28
  scoped = false,
31
29
  description = '',
@@ -37,7 +35,6 @@ const generateProps = ({
37
35
  backgroundColor,
38
36
  title,
39
37
  description,
40
- size,
41
38
  tooltipPlacement,
42
39
  target,
43
40
  scoped,
@@ -71,10 +68,6 @@ export default {
71
68
  backgroundColor: {
72
69
  control: 'color',
73
70
  },
74
- size: {
75
- options: labelSizeOptions,
76
- control: 'select',
77
- },
78
71
  tooltipPlacement: {
79
72
  options: tooltipPlacements,
80
73
  control: 'select',
@@ -2,16 +2,18 @@
2
2
  <script>
3
3
  import { labelColorOptions } from '../../../utils/constants';
4
4
  import { colorFromBackground } from '../../../utils/utils';
5
- import CloseButton from '../../shared_components/close_button/close_button.vue';
5
+ import GlButton from '../button/button.vue';
6
+ import GlIcon from '../icon/icon.vue';
6
7
  import GlLink from '../link/link.vue';
7
8
  import GlTooltip from '../tooltip/tooltip.vue';
8
9
 
9
10
  export default {
10
11
  name: 'GlLabel',
11
12
  components: {
13
+ GlButton,
14
+ GlIcon,
12
15
  GlLink,
13
16
  GlTooltip,
14
- CloseButton,
15
17
  },
16
18
  props: {
17
19
  backgroundColor: {
@@ -29,11 +31,6 @@ export default {
29
31
  required: false,
30
32
  default: '',
31
33
  },
32
- size: {
33
- type: String,
34
- required: false,
35
- default: '',
36
- },
37
34
  tooltipPlacement: {
38
35
  type: String,
39
36
  required: false,
@@ -69,7 +66,6 @@ export default {
69
66
  cssClasses() {
70
67
  const textColorVariant = colorFromBackground(this.backgroundColor);
71
68
  return {
72
- 'gl-label-sm': this.size === 'sm',
73
69
  'gl-label-scoped': this.scoped,
74
70
  'gl-label-text-dark': textColorVariant === labelColorOptions.dark,
75
71
  'gl-label-text-light': textColorVariant === labelColorOptions.light,
@@ -78,9 +74,7 @@ export default {
78
74
  cssVariables() {
79
75
  return {
80
76
  '--label-background-color': this.backgroundColor,
81
- '--label-inset-border': `inset 0 0 0 ${this.size === 'sm' ? '1px' : '2px'} ${
82
- this.backgroundColor
83
- }`,
77
+ '--label-inset-border': `inset 0 0 0 2px ${this.backgroundColor}`,
84
78
  };
85
79
  },
86
80
  scopedKey() {
@@ -89,9 +83,6 @@ export default {
89
83
  scopedValue() {
90
84
  return this.title.slice(this.splitScopedLabelIndex + 2);
91
85
  },
92
- closeIconSize() {
93
- return this.size === 'sm' ? 12 : 16;
94
- },
95
86
  labelComponent() {
96
87
  return this.target ? GlLink : 'span';
97
88
  },
@@ -143,14 +134,18 @@ export default {
143
134
  {{ scopedValue }}
144
135
  </span>
145
136
  </component>
146
- <close-button
137
+ <gl-button
147
138
  v-if="showCloseButton"
148
139
  class="gl-label-close gl-p-0!"
149
- label="Remove label"
140
+ category="tertiary"
141
+ size="small"
150
142
  variant="reset"
143
+ aria-label="Remove label"
151
144
  :disabled="disabled"
152
145
  @click="onClose"
153
- />
146
+ >
147
+ <gl-icon name="close-xs" :size="12" />
148
+ </gl-button>
154
149
  <gl-tooltip
155
150
  v-if="description"
156
151
  :target="() => tooltipTarget"
@@ -78,11 +78,6 @@ export const variantCssColorMap = {
78
78
 
79
79
  export const targetOptions = ['_self', '_blank', '_parent', '_top', null];
80
80
 
81
- export const labelSizeOptions = {
82
- default: null,
83
- sm: 'sm',
84
- };
85
-
86
81
  export const viewModeOptions = {
87
82
  dark: 'dark',
88
83
  light: 'light',