@gitlab/ui 80.7.1 → 80.8.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 (30) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/components/base/button/button.js +1 -2
  3. package/dist/components/base/form/form_textarea/form_textarea.js +1 -1
  4. package/dist/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.js +3 -2
  5. package/dist/index.css +2 -2
  6. package/dist/index.css.map +1 -1
  7. package/dist/tailwind.css +1 -1
  8. package/dist/tailwind.css.map +1 -1
  9. package/dist/utility_classes.css +1 -1
  10. package/dist/utility_classes.css.map +1 -1
  11. package/package.json +1 -1
  12. package/src/components/base/alert/alert.scss +4 -0
  13. package/src/components/base/avatar_labeled/avatar_labeled.scss +1 -1
  14. package/src/components/base/badge/badge.scss +4 -0
  15. package/src/components/base/button/button.scss +33 -0
  16. package/src/components/base/button/button.vue +1 -9
  17. package/src/components/base/form/form_checkbox/form_checkbox.scss +25 -1
  18. package/src/components/base/form/form_combobox/form_combobox.stories.js +1 -1
  19. package/src/components/base/form/form_input/form_input.scss +4 -0
  20. package/src/components/base/form/form_select/form_select.scss +5 -0
  21. package/src/components/base/form/form_textarea/form_textarea.vue +3 -3
  22. package/src/components/base/label/label.scss +8 -0
  23. package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.stories.js +1 -1
  24. package/src/components/base/new_dropdowns/listbox/listbox.md +1 -1
  25. package/src/components/base/new_dropdowns/listbox/listbox.stories.js +2 -2
  26. package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.vue +3 -2
  27. package/src/internal/color_contrast/color_contrast.vue +1 -1
  28. package/src/scss/mixins.scss +12 -0
  29. package/src/scss/storybook.scss +2 -2
  30. package/src/scss/variables.scss +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "80.7.1",
3
+ "version": "80.8.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -14,6 +14,10 @@ $gl-alert-padding-x: var(--gl-alert-padding-x, 0px);
14
14
  padding-inline: calc(#{$gl-spacing-scale-9} + #{$gl-alert-padding-x});
15
15
  @include gl-py-5;
16
16
 
17
+ @media (forced-colors: active) {
18
+ border: 1px solid;
19
+ }
20
+
17
21
  &-not-dismissible {
18
22
  padding-right: calc(#{$gl-spacing-scale-5} + #{$gl-alert-padding-x});
19
23
  }
@@ -24,7 +24,7 @@
24
24
  }
25
25
 
26
26
  &-sublabel {
27
- @include gl-text-gray-500;
27
+ color: $gl-text-color-subtle;
28
28
  overflow-wrap: anywhere;
29
29
  }
30
30
  }
@@ -72,6 +72,10 @@
72
72
  @include gl-py-2;
73
73
  @include gl-px-3;
74
74
 
75
+ @media (forced-colors: active) {
76
+ border: 1px solid;
77
+ }
78
+
75
79
  &.sm {
76
80
  @include gl-py-0;
77
81
  }
@@ -34,6 +34,10 @@
34
34
  @include gl-font-base;
35
35
  @include gl-rounded-base;
36
36
 
37
+ @media (forced-colors: active) {
38
+ border: 1px solid;
39
+ }
40
+
37
41
  .gl-button-text {
38
42
  @include gl-overflow-hidden;
39
43
  @include gl-text-overflow-ellipsis;
@@ -314,6 +318,20 @@
314
318
  }
315
319
  }
316
320
 
321
+ &.btn-default-secondary,
322
+ &.btn-dashed-secondary,
323
+ &.btn-confirm-secondary,
324
+ &.btn-info-secondary,
325
+ &.btn-success-secondary,
326
+ &.btn-danger-secondary,
327
+ &.btn-reset-secondary,
328
+ &.btn-reset-tertiary {
329
+ @media (forced-colors: active) {
330
+ color: LinkText; // stylelint-disable-line scale-unlimited/declaration-strict-value
331
+ border: 1px solid LinkText; // stylelint-disable-line scale-unlimited/declaration-strict-value
332
+ }
333
+ }
334
+
317
335
  &.btn-default,
318
336
  &.btn-dashed,
319
337
  &.btn-confirm,
@@ -324,6 +342,12 @@
324
342
  @include gl-shadow-none;
325
343
  mix-blend-mode: multiply;
326
344
 
345
+ @media (forced-colors: active) {
346
+ color: LinkText; // stylelint-disable-line scale-unlimited/declaration-strict-value
347
+ mix-blend-mode: initial;
348
+ border: 0;
349
+ }
350
+
327
351
  &:hover {
328
352
  @include gl-shadow-none;
329
353
  }
@@ -336,6 +360,15 @@
336
360
  }
337
361
  }
338
362
 
363
+ &.btn-default-tertiary,
364
+ &.btn-confirm-tertiary,
365
+ &.btn-danger-tertiary {
366
+ @media (forced-colors: active) {
367
+ color: $black;
368
+ border: 0;
369
+ }
370
+ }
371
+
339
372
  &.btn-default-tertiary.selected {
340
373
  box-shadow: inset 0 0 0 $gl-border-size-2 $gray-300;
341
374
  }
@@ -87,16 +87,8 @@ export default {
87
87
  },
88
88
  buttonClasses() {
89
89
  const classes = ['gl-button'];
90
- const nonCategoryVariants = [
91
- buttonVariantOptions.dashed,
92
- buttonVariantOptions.link,
93
- buttonVariantOptions.reset,
94
- ];
95
90
 
96
- if (
97
- !nonCategoryVariants.includes(this.variant) &&
98
- this.category !== buttonCategoryOptions.primary
99
- ) {
91
+ if (this.category !== buttonCategoryOptions.primary) {
100
92
  classes.push(`btn-${this.variant}-${this.category}`);
101
93
  }
102
94
 
@@ -81,6 +81,11 @@
81
81
  &::before {
82
82
  @include gl-bg-blue-500;
83
83
  @include gl-border-blue-500;
84
+
85
+ @media (forced-colors: active) {
86
+ background-color: LinkText; // stylelint-disable-line scale-unlimited/declaration-strict-value
87
+ border-color: LinKText; // stylelint-disable-line scale-unlimited/declaration-strict-value
88
+ }
84
89
  }
85
90
  }
86
91
 
@@ -115,6 +120,11 @@
115
120
  &::before {
116
121
  @include gl-bg-blue-700;
117
122
  @include gl-border-blue-700;
123
+
124
+ @media (forced-colors: active) {
125
+ background-color: LinkText; // stylelint-disable-line scale-unlimited/declaration-strict-value
126
+ border-color: LinKText; // stylelint-disable-line scale-unlimited/declaration-strict-value
127
+ }
118
128
  }
119
129
  }
120
130
 
@@ -122,12 +132,22 @@
122
132
  .custom-control-input:indeterminate ~ .custom-control-label::before {
123
133
  @include gl-bg-blue-500;
124
134
  @include gl-border-blue-500;
135
+
136
+ @media (forced-colors: active) {
137
+ background-color: LinkText; // stylelint-disable-line scale-unlimited/declaration-strict-value
138
+ border-color: LinKText; // stylelint-disable-line scale-unlimited/declaration-strict-value
139
+ }
125
140
  }
126
141
 
127
142
  .custom-control-input:not(:disabled):indeterminate ~ .custom-control-label:hover::before,
128
143
  .custom-control-input:not(:disabled):focus:indeterminate ~ .custom-control-label::before {
129
144
  @include gl-bg-blue-700;
130
145
  @include gl-border-blue-700;
146
+
147
+ @media (forced-colors: active) {
148
+ background-color: LinkText; // stylelint-disable-line scale-unlimited/declaration-strict-value
149
+ border-color: LinKText; // stylelint-disable-line scale-unlimited/declaration-strict-value
150
+ }
131
151
  }
132
152
  }
133
153
 
@@ -138,6 +158,10 @@
138
158
  @include gl-bg-gray-50;
139
159
  @include gl-border-gray-100;
140
160
  @include gl-pointer-events-auto;
161
+
162
+ @media (forced-colors: active) {
163
+ opacity: 0.5;
164
+ }
141
165
  }
142
166
  }
143
167
 
@@ -158,7 +182,7 @@
158
182
  */
159
183
  @media screen and (forced-colors: active) {
160
184
  forced-color-adjust: none;
161
- /* system color reference for disabled text applied to
185
+ /* system color reference for disabled text applied to
162
186
  background here.
163
187
  */
164
188
  // stylelint-disable-next-line
@@ -57,7 +57,7 @@ export const WithObjectValue = (args, { argTypes }) => ({
57
57
  >
58
58
  <template #result="{ item }">
59
59
  <div class="gl-display-flex">
60
- <div class="gl-text-gray-400 gl-mr-4">{{ item.id }}</div>
60
+ <div class="gl-text-subtle gl-mr-4">{{ item.id }}</div>
61
61
  <div>{{ item.title }}</div>
62
62
  </div>
63
63
  </template>
@@ -13,6 +13,10 @@
13
13
  @include form-control-focus($ignore-warning: true);
14
14
  appearance: none;
15
15
 
16
+ @media (forced-colors: active) {
17
+ border: 1px solid;
18
+ }
19
+
16
20
  &:disabled,
17
21
  &:not(.form-control-plaintext):not([type='color']):read-only {
18
22
  @include gl-bg-gray-10;
@@ -25,6 +25,11 @@ See: https://gitlab.com/gitlab-org/gitlab/issues/30055
25
25
  @include gl-bg-no-repeat;
26
26
  background-image: url($gl-icon-select-chevron-down);
27
27
 
28
+ @media (forced-colors: active) {
29
+ box-shadow: none;
30
+ border: 1px solid;
31
+ }
32
+
28
33
  &:focus,
29
34
  &:focus:active {
30
35
  @include gl-focus($color: $gray-900, $important: true);
@@ -78,7 +78,7 @@ export default {
78
78
  return this.remainingCharacterCount < 0;
79
79
  },
80
80
  characterCountTextClass() {
81
- return this.isCharacterCountOverLimit ? 'gl-text-red-500' : 'gl-text-gray-500';
81
+ return this.isCharacterCountOverLimit ? 'gl-text-danger' : 'gl-text-subtle';
82
82
  },
83
83
  showCharacterCount() {
84
84
  return this.characterCount !== null;
@@ -138,7 +138,7 @@ export default {
138
138
  @[keypressEvent].native="handleKeyPress"
139
139
  />
140
140
  <small :class="['form-text', characterCountTextClass]" aria-hidden="true">
141
- <!--
141
+ <!--
142
142
  @slot Internationalized over character count text. Example: `<template #character-count-over-limit-text="{ count }">{{ n__('%d character over limit', '%d characters over limit', count) }}</template>`
143
143
  @binding {number} count
144
144
  -->
@@ -147,7 +147,7 @@ export default {
147
147
  name="character-count-over-limit-text"
148
148
  :count="Math.abs(remainingCharacterCount)"
149
149
  ></slot>
150
- <!--
150
+ <!--
151
151
  @slot Internationalized character count text. Example: `<template #character-count-text="{ count }">{{ n__('%d character remaining', '%d characters remaining', count) }}</template>`
152
152
  @binding {number} count
153
153
  -->
@@ -13,6 +13,10 @@ $label-close-button: '.gl-label-close.gl-button';
13
13
  @include gl-line-height-normal;
14
14
  box-shadow: var(--label-inset-border) !important;
15
15
 
16
+ @media (forced-colors: active) {
17
+ border: 1px solid; // stylelint-disable-line declaration-property-value-disallowed-list
18
+ }
19
+
16
20
  &:not(.gl-label-scoped) {
17
21
  background-color: var(--label-background-color);
18
22
  }
@@ -160,6 +164,10 @@ $label-close-button: '.gl-label-close.gl-button';
160
164
 
161
165
  .gl-label-text {
162
166
  background-color: var(--label-background-color);
167
+
168
+ @media (forced-colors: active) {
169
+ border-right: 1px solid;
170
+ }
163
171
  }
164
172
 
165
173
  .gl-label-text-scoped {
@@ -201,7 +201,7 @@ export const CustomGroupsItemsAndToggle = makeGroupedExample({
201
201
  <template #list-item>
202
202
  <span class="gl-display-flex gl-flex-direction-column">
203
203
  <span class="gl-font-weight-bold gl-white-space-nowrap">Orange Fox</span>
204
- <span class="gl-text-gray-600">@thefox</span>
204
+ <span class="gl-text-subtle">@thefox</span>
205
205
  </span>
206
206
  </template>
207
207
  </gl-disclosure-dropdown-item>
@@ -93,7 +93,7 @@ template. If you want to render a custom template for items, use the
93
93
  <gl-avatar :size="32" class-="gl-mr-3"/>
94
94
  <span class="gl-display-flex gl-flex-direction-column">
95
95
  <span class="gl-font-weight-bold gl-white-space-nowrap">{{ item.text }}</span>
96
- <span class="gl-text-gray-400"> {{ item.secondaryText }}</span>
96
+ <span class="gl-text-subtle"> {{ item.secondaryText }}</span>
97
97
  </span>
98
98
  </span>
99
99
  </template>
@@ -276,7 +276,7 @@ export const CustomListItem = (args, { argTypes }) => ({
276
276
  <gl-avatar :size="32" :entity-name="item.value" class="gl-mr-3"/>
277
277
  <span class="gl-display-flex gl-flex-direction-column">
278
278
  <span class="gl-font-weight-bold gl-white-space-nowrap">{{ item.text }}</span>
279
- <span class="gl-text-gray-400"> {{ item.secondaryText }}</span>
279
+ <span class="gl-text-subtle"> {{ item.secondaryText }}</span>
280
280
  </span>
281
281
  </span>
282
282
  </template>
@@ -325,7 +325,7 @@ export const CustomToggle = (args, { argTypes }) => ({
325
325
  <gl-avatar :size="32" :entity-name="item.value" class="gl-mr-3"/>
326
326
  <span class="gl-display-flex gl-flex-direction-column">
327
327
  <span class="gl-font-weight-bold gl-white-space-nowrap">{{ item.text }}</span>
328
- <span class="gl-text-gray-400"> {{ item.secondaryText }}</span>
328
+ <span class="gl-text-subtle"> {{ item.secondaryText }}</span>
329
329
  </span>
330
330
  </span>
331
331
  </template>
@@ -176,8 +176,9 @@ export default {
176
176
  class="gl-p-4 gl-mb-4 gl-rounded-lg gl-line-height-20 gl-word-break-word duo-chat-message"
177
177
  :class="{
178
178
  'gl-ml-auto gl-bg-blue-100 gl-text-blue-900 gl-rounded-bottom-right-none': isUserMessage,
179
- 'gl-rounded-bottom-left-none gl-text-gray-900 gl-bg-white gl-border-1 gl-border-solid gl-border-gray-50':
179
+ 'gl-rounded-bottom-left-none gl-text-gray-900 gl-border-1 gl-border-solid gl-border-gray-50':
180
180
  isAssistantMessage,
181
+ 'gl-bg-white': isAssistantMessage && !error,
181
182
  'gl-bg-red-50 gl-border-none!': error,
182
183
  }"
183
184
  >
@@ -190,7 +191,7 @@ export default {
190
191
  data-testid="error"
191
192
  />
192
193
  <div ref="content-wrapper" :class="{ 'has-error': error }">
193
- <div v-if="error" ref="error-message" class="error-message">{{ error }}</div>
194
+ <div v-if="error" ref="error-message">{{ error }}</div>
194
195
  <div v-else>
195
196
  <div ref="content" v-safe-html:[$options.safeHtmlConfigExtension]="messageContent"></div>
196
197
 
@@ -29,7 +29,7 @@ export default {
29
29
  const failClasses = contrastScore
30
30
  ? 'gl-inset-border-1-red-300 gl-text-red-300'
31
31
  : 'gl-inset-border-1-red-500 gl-text-red-500';
32
- return [textClass, isFail ? failClasses : ''];
32
+ return [isFail ? failClasses : textClass];
33
33
  },
34
34
  contrast() {
35
35
  return getColorContrast(this.foreground, this.background);
@@ -59,22 +59,34 @@
59
59
  inset 0 0 0 #{$outline-width + $outline-offset + 1px} $color,
60
60
  $focus-ring-inset if-important($important);
61
61
  outline: none if-important($important);
62
+ @media (forced-colors: active) {
63
+ outline: 2px solid LinkText if-important($important);
64
+ }
62
65
  } @else if $outline == true {
63
66
  outline: $focus-ring-outline if-important($important);
64
67
  outline-offset: $outline-offset;
65
68
  } @else {
66
69
  box-shadow: inset 0 0 0 $outline-width $blue-400, $focus-ring-inset if-important($important);
67
70
  outline: none if-important($important);
71
+ @media (forced-colors: active) {
72
+ outline: 2px solid LinkText if-important($important);
73
+ }
68
74
  }
69
75
  } @else if $color {
70
76
  box-shadow: inset 0 0 0 $gl-border-size-1 $color, $focus-ring if-important($important);
71
77
  outline: none if-important($important);
78
+ @media (forced-colors: active) {
79
+ outline: 2px solid LinkText if-important($important);
80
+ }
72
81
  } @else if $outline == true {
73
82
  outline: $focus-ring-outline if-important($important);
74
83
  outline-offset: $outline-offset;
75
84
  } @else {
76
85
  box-shadow: $focus-ring if-important($important);
77
86
  outline: none if-important($important);
87
+ @media (forced-colors: active) {
88
+ outline: 2px solid LinkText if-important($important);
89
+ }
78
90
  }
79
91
  }
80
92
 
@@ -1,7 +1,5 @@
1
1
  @import 'tokens';
2
2
 
3
- @tailwind utilities;
4
-
5
3
  @import 'functions';
6
4
  @import 'variables';
7
5
 
@@ -15,6 +13,8 @@
15
13
  @import 'utility-mixins/index';
16
14
  @import 'utilities';
17
15
 
16
+ @tailwind utilities;
17
+
18
18
  @import 'fonts';
19
19
 
20
20
  @import 'components';
@@ -64,7 +64,6 @@ $transparent-rgba: rgba($white, 0);
64
64
  // Text
65
65
  $gl-text-color: $gray-900 !default;
66
66
  $gl-text-color-secondary: $gray-500 !default;
67
- $gl-text-color-disabled: $gray-400 !default;
68
67
 
69
68
  $gl-font-weight-light: 300;
70
69
  $gl-font-weight-normal: 400;