@gitlab/ui 128.3.0 → 128.5.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "128.3.0",
3
+ "version": "128.5.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -146,8 +146,8 @@
146
146
  "mockdate": "^3.0.5",
147
147
  "module-alias": "^2.2.3",
148
148
  "pikaday": "^1.8.0",
149
- "playwright": "^1.57.0",
150
- "playwright-core": "^1.57.0",
149
+ "playwright": "^1.58.0",
150
+ "playwright-core": "^1.58.0",
151
151
  "postcss": "8.5.6",
152
152
  "postcss-loader": "8.2.0",
153
153
  "postcss-scss": "4.0.9",
@@ -159,7 +159,7 @@
159
159
  "rollup-plugin-string": "^3.0.0",
160
160
  "rollup-plugin-svg": "^2.0.0",
161
161
  "rollup-plugin-vue": "^5.1.9",
162
- "sass": "^1.97.2",
162
+ "sass": "^1.97.3",
163
163
  "sass-loader": "^10.5.2",
164
164
  "sass-true": "^9",
165
165
  "start-server-and-test": "^2.1.3",
@@ -60,8 +60,10 @@ $breadcrumb-max-width: $grid-size * 16;
60
60
 
61
61
  .gl-breadcrumb-item-md {
62
62
  @apply gl-text-base;
63
+ }
63
64
 
64
- /**
65
+ .gl-breadcrumb-item {
66
+ /**
65
67
  * If the last/only item, which is always visible, has a very long title,
66
68
  * it could overflow the breadcrumb component. This CSS makes sure it
67
69
  * shows an ellipsis instead.
@@ -69,7 +71,8 @@ $breadcrumb-max-width: $grid-size * 16;
69
71
  * would then not take the real unshrunk width of that item into account.
70
72
  */
71
73
  &.gl-breadcrumb-only-item {
72
- @apply gl-max-w-full gl-shrink;
74
+ @apply gl-shrink;
75
+ max-width: var(--gl-breadcrumb-truncated-item-max-width, 100%);
73
76
 
74
77
  a {
75
78
  @apply gl-max-w-full gl-overflow-hidden gl-text-ellipsis gl-text-nowrap;
@@ -151,14 +151,22 @@ export default {
151
151
  } else {
152
152
  this.resizeDone = true;
153
153
  }
154
- this.clipboardButtonWidth = this.showClipboardButton
155
- ? this.$refs.clipboardButton.$el.clientWidth
156
- : 0;
154
+ this.updateClipboardButtonWidth();
157
155
  },
158
156
  beforeDestroy() {
159
157
  this.disableAutoResize();
160
158
  },
161
159
  methods: {
160
+ updateClipboardButtonWidth() {
161
+ if (!this.showClipboardButton) {
162
+ this.clipboardButtonWidth = 0;
163
+ return;
164
+ }
165
+
166
+ const element = this.$refs.clipboardButton.$el;
167
+ const marginLeft = parseInt(getComputedStyle(element).marginLeft, 10);
168
+ this.clipboardButtonWidth = element.offsetWidth + marginLeft;
169
+ },
162
170
  resetItems() {
163
171
  this.fittingItems = [...this.items];
164
172
  this.overflowingItems = [];
@@ -214,6 +222,15 @@ export default {
214
222
  }
215
223
  }
216
224
 
225
+ const truncatedItemMaxWidth = Math.max(
226
+ 0,
227
+ containerWidth - (this.dropdownWidth + this.clipboardButtonWidth),
228
+ );
229
+ this.$el.style.setProperty(
230
+ '--gl-breadcrumb-truncated-item-max-width',
231
+ `${truncatedItemMaxWidth}px`,
232
+ );
233
+
217
234
  this.resizeDone = true;
218
235
  },
219
236
  isLastItem(index) {
@@ -13,7 +13,6 @@ import { isEvent } from '../../../vendor/bootstrap-vue/src/utils/inspect';
13
13
  import GlIcon from '../icon/icon.vue';
14
14
  import GlLoadingIcon from '../loading_icon/loading_icon.vue';
15
15
  import { ENTER, SPACE } from '../new_dropdowns/constants';
16
- import { glButtonConfig } from '../../../config';
17
16
 
18
17
  export default {
19
18
  name: 'GlButton',
@@ -82,14 +81,6 @@ export default {
82
81
  required: false,
83
82
  default: false,
84
83
  },
85
- /**
86
- * Keep the button accessible when `loading` is `true`.
87
- */
88
- accessibleLoading: {
89
- type: Boolean,
90
- required: false,
91
- default: () => glButtonConfig.accessibleLoadingButton,
92
- },
93
84
  /**
94
85
  * CSS classes to add to the button text.
95
86
  */
@@ -247,10 +238,10 @@ export default {
247
238
  return isSlotEmpty(this, 'default') && this.hasIcon && this.count == null;
248
239
  },
249
240
  isButtonDisabled() {
250
- return this.disabled || this.loading;
241
+ return this.disabled;
251
242
  },
252
243
  isButtonAriaDisabled() {
253
- return this.accessibleLoading && this.isButton && this.loading;
244
+ return this.isButton && this.loading;
254
245
  },
255
246
  buttonClasses() {
256
247
  const classes = ['btn', 'gl-button', `btn-${this.variant}`, `btn-${this.buttonSize}`];
@@ -316,7 +307,7 @@ export default {
316
307
  ...(this.isNonStandardTag ? { 'aria-disabled': String(this.disabled) } : {}),
317
308
  tabindex: this.tabindex,
318
309
  // We set the `aria-disabled` state for buttons while loading
319
- ...(this.isButtonAriaDisabled ? { 'aria-disabled': 'true', disabled: null } : {}),
310
+ ...(this.isButtonAriaDisabled ? { 'aria-disabled': 'true' } : {}),
320
311
  };
321
312
 
322
313
  if (this.isLink) {
package/src/config.js CHANGED
@@ -39,8 +39,6 @@ export const defaultConfig = {
39
39
  firstDayOfWeek: 0, // Defaults to 0 (Sunday)
40
40
  };
41
41
 
42
- export const glButtonConfig = {};
43
-
44
42
  let configured = false;
45
43
 
46
44
  /**
@@ -53,7 +51,7 @@ let configured = false;
53
51
  * @property {boolean} [accessibleLoadingButton] Temporary flag to enable accessible loading button.
54
52
  *
55
53
  */
56
- const setConfigs = ({ translations, firstDayOfWeek, accessibleLoadingButton = false } = {}) => {
54
+ const setConfigs = ({ translations, firstDayOfWeek } = {}) => {
57
55
  if (configured) {
58
56
  if (process.env.NODE_ENV === 'development') {
59
57
  throw new Error('GitLab UI can only be configured once!');
@@ -94,23 +92,6 @@ const setConfigs = ({ translations, firstDayOfWeek, accessibleLoadingButton = fa
94
92
 
95
93
  Object.assign(i18n, translations);
96
94
  }
97
-
98
- // Temporary flag to enable the accessible loading button feature.
99
- // This flag allows the feature to be opt-in during the rollout phase,
100
- // giving us the flexibility to test and validate its impact on user experience.
101
-
102
- // The global variable `accessibleLoadingButton` is set to a boolean value
103
- // to indicate whether the button should be disabled while loading.
104
-
105
- // Future Plan:
106
- // Once the accessible loading button feature is validated and stable,
107
- // we will remove this temporary flag and make the feature the default behavior.
108
- // At that point, there will be no need for opt-in or opt-out mechanisms for this feature.
109
- if (typeof accessibleLoadingButton === 'boolean') {
110
- Object.assign(glButtonConfig, {
111
- accessibleLoadingButton,
112
- });
113
- }
114
95
  };
115
96
 
116
97
  export default setConfigs;