@gitlab/ui 78.14.0 → 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 Fri, 12 Apr 2024 16:19:06 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 Fri, 12 Apr 2024 16:19:06 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 Fri, 12 Apr 2024 16:19:06 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 Fri, 12 Apr 2024 16:19:06 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 Fri, 12 Apr 2024 16:19:06 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 Fri, 12 Apr 2024 16:19:06 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.0",
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.95.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"
@@ -1,3 +1,5 @@
1
+ $duo-chat-scrim-gradient: linear-gradient(to bottom, rgba($gray-10, 0), $gray-10);
2
+
1
3
  .duo-chat {
2
4
  @include gl-z-index-999;
3
5
 
@@ -17,23 +19,83 @@
17
19
  transition: none;
18
20
  }
19
21
 
20
- /* TODO: Avoid mixing duo-chat styles with other GitLab UI components not intended as utilities. Refactor and remove all `gl-drawer` instances out of this file. */
21
- .gl-drawer-body-scrim-on-footer {
22
+ .duo-chat-drawer-body-scrim-on-footer {
22
23
  &::before {
23
- background: linear-gradient(to bottom, rgba($gray-10, 0), $gray-10);
24
+ background: $duo-chat-scrim-gradient;
24
25
  }
25
26
  }
26
27
 
27
- .gl-drawer-body {
28
+ .duo-chat-drawer-body {
28
29
  overflow-y: auto;
29
30
  }
30
31
 
31
- .gl-drawer-header,
32
- .gl-drawer-body > * {
32
+ .duo-chat-drawer-header,
33
+ .duo-chat-drawer-body > * {
33
34
  @include gl-p-5;
34
35
  }
35
36
  }
36
37
 
38
+ .duo-chat-drawer {
39
+ right: 0;
40
+ @include gl-transition-medium;
41
+ position: fixed;
42
+ @include gl-h-full;
43
+ @include gl-w-full;
44
+ @include gl-overflow-y-auto;
45
+ @include gl-shadow-lg;
46
+ @include gl-font-base;
47
+ @include gl-line-height-normal;
48
+ @include gl-display-flex;
49
+ @include gl-flex-direction-column;
50
+ }
51
+
52
+ .duo-chat-drawer-header {
53
+ @include gl-border-b-solid;
54
+ @include gl-border-b-gray-100;
55
+ @include gl-border-b-1;
56
+ }
57
+
58
+ .duo-chat-drawer-header-sticky {
59
+ @include gl-bg-white;
60
+ top: 0;
61
+ position: sticky;
62
+ }
63
+
64
+ .duo-chat-drawer-body {
65
+ @include gl-flex-grow-1;
66
+ // prevent safari bug where box shadow is visible
67
+ // above the drawer when hovering interactive elements
68
+ // see https://gitlab.com/gitlab-org/gitlab/-/issues/366558
69
+ background-color: inherit;
70
+ }
71
+
72
+ .duo-chat-drawer-footer {
73
+ @include gl-border-t-solid;
74
+ @include gl-border-t-gray-100;
75
+ @include gl-border-t-1;
76
+ @include gl-p-5;
77
+ }
78
+
79
+ .duo-chat-drawer-footer-sticky {
80
+ @include gl-bg-white;
81
+ bottom: 0;
82
+ position: sticky;
83
+ }
84
+
85
+ .duo-chat-drawer-body-scrim-on-footer {
86
+ &::before {
87
+ background: $duo-chat-scrim-gradient;
88
+ top: -$gl-border-size-1;
89
+ @include gl-translate-y-n100;
90
+ content: '';
91
+ left: 0;
92
+ position: absolute;
93
+ @include gl-pointer-events-none;
94
+ @include gl-w-full;
95
+ @include gl-h-7;
96
+ }
97
+ }
98
+
37
99
  .duo-chat-history {
38
100
  scroll-behavior: smooth;
39
101
 
@@ -520,7 +520,7 @@ describe('GlDuoChat', () => {
520
520
 
521
521
  await nextTick();
522
522
 
523
- expect(findFooter().classes()).not.toContain('gl-drawer-body-scrim-on-footer');
523
+ expect(findFooter().classes()).not.toContain('duo-chat-drawer-body-scrim-on-footer');
524
524
  });
525
525
 
526
526
  it('when scrolling up it adds the scrim class', async () => {
@@ -532,7 +532,7 @@ describe('GlDuoChat', () => {
532
532
 
533
533
  await nextTick();
534
534
 
535
- expect(findFooter().classes()).toContain('gl-drawer-body-scrim-on-footer');
535
+ expect(findFooter().classes()).toContain('duo-chat-drawer-body-scrim-on-footer');
536
536
  });
537
537
  });
538
538
 
@@ -370,14 +370,14 @@ export default {
370
370
  <aside
371
371
  v-if="!isHidden"
372
372
  id="chat-component"
373
- class="markdown-code-block gl-drawer gl-max-h-full gl-bottom-0 gl-shadow-none gl-border-l gl-border-t duo-chat"
373
+ class="markdown-code-block duo-chat-drawer gl-max-h-full gl-bottom-0 gl-shadow-none gl-border-l gl-border-t duo-chat"
374
374
  role="complementary"
375
375
  data-testid="chat-component"
376
376
  >
377
377
  <header
378
378
  v-if="showHeader"
379
379
  data-testid="chat-header"
380
- class="gl-drawer-header gl-drawer-header-sticky gl-z-index-200 gl-p-0! gl-border-b-0"
380
+ class="duo-chat-drawer-header duo-chat-drawer-header-sticky gl-z-index-200 gl-p-0! gl-border-b-0"
381
381
  >
382
382
  <div
383
383
  class="drawer-title gl-display-flex gl-justify-content-start gl-align-items-center gl-p-5"
@@ -430,7 +430,7 @@ export default {
430
430
  </gl-alert>
431
431
  </header>
432
432
 
433
- <div class="gl-drawer-body" data-testid="chat-history" @scroll="handleScrollingTrottled">
433
+ <div class="duo-chat-drawer-body" data-testid="chat-history" @scroll="handleScrollingTrottled">
434
434
  <transition-group
435
435
  tag="section"
436
436
  name="message"
@@ -471,8 +471,8 @@ export default {
471
471
  <footer
472
472
  v-if="isChatAvailable"
473
473
  data-testid="chat-footer"
474
- class="gl-drawer-footer gl-drawer-footer-sticky gl-p-5 gl-border-t gl-bg-gray-10"
475
- :class="{ 'gl-drawer-body-scrim-on-footer': !scrolledToBottom }"
474
+ class="duo-chat-drawer-footer duo-chat-drawer-footer-sticky gl-p-5 gl-border-t gl-bg-gray-10"
475
+ :class="{ 'duo-chat-drawer-body-scrim-on-footer': !scrolledToBottom }"
476
476
  >
477
477
  <gl-form data-testid="chat-prompt-form" @submit.stop.prevent="sendChatPrompt">
478
478
  <gl-form-input-group>
@@ -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',