@gitlab/ui 115.4.0 → 115.6.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.
@@ -121,9 +121,18 @@ const plugin = Vue => {
121
121
  }
122
122
  });
123
123
  // Create a mount point (a DIV) and mount it (which triggers the show)
124
- const div = document.createElement('div');
125
- document.body.appendChild(div);
126
- toast.$mount(div);
124
+ function createMountPoint() {
125
+ const div = document.createElement('div');
126
+ document.body.appendChild(div);
127
+ toast.$mount(div);
128
+ }
129
+
130
+ // ViewTransition fallback
131
+ if (!document.startViewTransition) {
132
+ createMountPoint();
133
+ return;
134
+ }
135
+ document.startViewTransition(createMountPoint);
127
136
  };
128
137
 
129
138
  // Declare BvToast instance property class
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "115.4.0",
3
+ "version": "115.6.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -70,7 +70,7 @@
70
70
  "dependencies": {
71
71
  "@floating-ui/dom": "1.7.2",
72
72
  "echarts": "^5.6.0",
73
- "gridstack": "^12.2.1",
73
+ "gridstack": "^12.2.2",
74
74
  "iframe-resizer": "^4.4.5",
75
75
  "lodash": "^4.17.21",
76
76
  "popper.js": "^1.16.1",
@@ -87,12 +87,12 @@
87
87
  "vue": "^2.7.16"
88
88
  },
89
89
  "resolutions": {
90
- "chokidar": "^3.6.0",
90
+ "chokidar": "^4.0.3",
91
91
  "sane": "^5.0.1",
92
92
  "jackspeak": "2.1.1",
93
93
  "postcss": "8.5.6",
94
94
  "json5": "2.2.3",
95
- "rollup-plugin-vue/@vue/component-compiler/postcss-modules-sync/generic-names/loader-utils": "2.0.4"
95
+ "rollup-plugin-vue/@vue/component-compiler/postcss-modules-sync/generic-names/loader-utils": "3.3.1"
96
96
  },
97
97
  "devDependencies": {
98
98
  "@babel/core": "^7.28.0",
@@ -138,29 +138,28 @@
138
138
  "cypress-real-events": "^1.14.0",
139
139
  "dompurify": "^3.1.2",
140
140
  "emoji-regex": "^10.4.0",
141
- "entities": "^5.0.0",
142
- "esbuild": "^0.18.0",
141
+ "esbuild": "^0.25.6",
143
142
  "fuse.js": "^7.1.0",
144
143
  "gitlab-api-async-iterator": "^1.3.1",
145
144
  "glob": "11.0.3",
146
145
  "globby": "^14.1.0",
147
146
  "identity-obj-proxy": "^3.0.0",
148
- "jest": "30.0.2",
149
- "jest-circus": "30.0.2",
150
- "jest-environment-jsdom": "30.0.2",
147
+ "jest": "30.0.4",
148
+ "jest-circus": "30.0.4",
149
+ "jest-environment-jsdom": "30.0.4",
151
150
  "jest-image-snapshot": "^6.5.1",
152
151
  "merge-cobertura": "^1.0.4",
153
- "mockdate": "^2.0.5",
152
+ "mockdate": "^3.0.5",
154
153
  "module-alias": "^2.2.3",
155
154
  "npm-run-all": "^4.1.5",
156
155
  "pikaday": "^1.8.0",
157
- "playwright": "^1.53.2",
158
- "playwright-core": "^1.53.2",
156
+ "playwright": "^1.54.1",
157
+ "playwright-core": "^1.54.1",
159
158
  "postcss": "8.5.6",
160
159
  "postcss-loader": "8.1.1",
161
160
  "postcss-scss": "4.0.9",
162
- "react": "^18.3.1",
163
- "react-dom": "^18.3.1",
161
+ "react": "18.3.1",
162
+ "react-dom": "18.3.1",
164
163
  "rollup": "^2.79.2",
165
164
  "rollup-plugin-babel": "^4.4.0",
166
165
  "rollup-plugin-postcss": "4.0.2",
@@ -112,13 +112,16 @@ $gl-drawer-scrim-gradient: linear-gradient(
112
112
 
113
113
  .gl-drawer-body {
114
114
  @apply gl-grow;
115
- min-height: 0;
116
115
  // prevent safari bug where box shadow is visible
117
116
  // above the drawer when hovering interactive elements
118
117
  // see https://gitlab.com/gitlab-org/gitlab/-/issues/366558
119
118
  background-color: inherit;
120
119
  }
121
120
 
121
+ .gl-drawer-body-shrink {
122
+ overflow-y: auto;
123
+ }
124
+
122
125
  .gl-drawer-body-scrim {
123
126
  &::after {
124
127
  background: $gl-drawer-scrim-gradient;
@@ -120,13 +120,18 @@ export default {
120
120
  </div>
121
121
  <slot name="header"></slot>
122
122
  </div>
123
- <div class="gl-drawer-body" :class="{ 'gl-drawer-body-scrim': !shouldRenderFooter }">
123
+ <div
124
+ class="gl-drawer-body"
125
+ :class="{
126
+ 'gl-drawer-body-shrink': headerSticky,
127
+ 'gl-drawer-body-scrim': !shouldRenderFooter,
128
+ }"
129
+ >
124
130
  <slot></slot>
125
131
  </div>
126
132
  <div
127
133
  v-if="shouldRenderFooter"
128
- class="gl-drawer-footer gl-drawer-footer-sticky"
129
- :class="{ 'gl-drawer-body-scrim-on-footer': shouldRenderFooter }"
134
+ class="gl-drawer-footer gl-drawer-footer-sticky gl-drawer-body-scrim-on-footer"
130
135
  :style="{ zIndex }"
131
136
  >
132
137
  <slot name="footer"></slot>
@@ -5,10 +5,14 @@
5
5
  .b-toaster {
6
6
  &.b-toaster-bottom-left {
7
7
  .b-toaster-slot {
8
+ @apply gl-w-auto;
9
+ @apply gl-flex;
8
10
  bottom: $gl-spacing-scale-6;
9
11
  left: $gl-spacing-scale-6;
10
12
  right: auto;
11
- @apply gl-w-auto;
13
+ flex-direction: column-reverse;
14
+ gap: $gl-spacing-scale-4;
15
+ view-transition-name: gl-toast;
12
16
 
13
17
  @include media-breakpoint-down(xs) {
14
18
  @apply gl-w-full;
@@ -60,3 +64,8 @@
60
64
  color: inherit !important;
61
65
  }
62
66
  }
67
+
68
+ ::view-transition-group(gl-toast) {
69
+ animation-duration: $gl-transition-duration-medium;
70
+ animation-timing-function: $gl-easing-out-cubic;
71
+ }
@@ -20,14 +20,8 @@ export default {
20
20
  * @typedef {Object} Dashboard
21
21
  * @property {string} title - The dashboard title to render. Expected if no #title or #header slot is provided.
22
22
  * @property {string} description - Optional: The dashboard description to render.
23
- * @property {Array<Object>} panels - Optional: The dashboard panels. The entire object is passed to the #panel slot.
24
- * @property {string} panels[].id - Each panel must have a unique ID.
25
- * @property {string} panels[].title - The panel title to render.
26
- * @property {Object} panels[].gridAttributes - Layout settings for the panel.
27
- * @property {number} panels[].gridAttributes.width - Width of the panel in grid units.
28
- * @property {number} panels[].gridAttributes.height - Height of the panel in grid units.
29
- * @property {number} panels[].gridAttributes.xPos - X position of the panel in the grid, expressed in grid units, starts from 0.
30
- * @property {number} panels[].gridAttributes.yPos - Y position of the panel in the grid, expressed in grid units, starts from 0.
23
+ * @property {DashboardGrid} panels - Optional: The grid configuration.
24
+ * @see GridLayout.vue
31
25
  *
32
26
  * @type {Dashboard}
33
27
  */
@@ -112,7 +106,7 @@ export default {
112
106
  <grid-layout
113
107
  v-if="dashboardHasPanels"
114
108
  :value="config"
115
- :is-static="isStaticGrid"
109
+ :is-static-grid="isStaticGrid"
116
110
  class="-gl-mx-3"
117
111
  @input="emitChanges"
118
112
  >
@@ -8,11 +8,29 @@ const CURSOR_GRABBING_CLASS = '!gl-cursor-grabbing';
8
8
  export default {
9
9
  name: 'GlGridLayout',
10
10
  props: {
11
+ /**
12
+ * The grid configuration object.
13
+ *
14
+ * @typedef {Object} DashboardGrid
15
+ * @property {Array<Object>} panels - The dashboard panels. If empty, it will render an empty grid
16
+ * @property {string} panels[].id - Each panel must have a unique ID.
17
+ * @property {string} panels[].title - The panel title to render.
18
+ * @property {Object} panels[].gridAttributes - Layout settings for the panel.
19
+ * @property {number} panels[].gridAttributes.width - Width of the panel in grid units.
20
+ * @property {number} panels[].gridAttributes.height - Height of the panel in grid units.
21
+ * @property {number} panels[].gridAttributes.xPos - X position of the panel in the grid, expressed in grid units, starts from 0.
22
+ * @property {number} panels[].gridAttributes.yPos - Y position of the panel in the grid, expressed in grid units, starts from 0.
23
+ *
24
+ * @type {DashboardGrid}
25
+ */
11
26
  value: {
12
27
  type: Object,
13
28
  required: true,
14
29
  },
15
- isStatic: {
30
+ /**
31
+ * Set to `false` to enable user-driven modification of the grid layout.
32
+ */
33
+ isStaticGrid: {
16
34
  type: Boolean,
17
35
  required: false,
18
36
  default: true,
@@ -37,7 +55,7 @@ export default {
37
55
  },
38
56
  },
39
57
  watch: {
40
- isStatic(value) {
58
+ isStaticGrid(value) {
41
59
  this.grid?.setStatic(value);
42
60
  },
43
61
  gridConfig: {
@@ -138,7 +156,7 @@ export default {
138
156
  animate: true,
139
157
  float: true,
140
158
  // Toggles user-customization of grid layout
141
- staticGrid: this.isStatic,
159
+ staticGrid: this.isStaticGrid,
142
160
  },
143
161
  this.$refs.grid,
144
162
  ).load(this.gridConfig);
@@ -238,7 +256,7 @@ export default {
238
256
  ref="panelWrappers"
239
257
  :key="panel.id"
240
258
  class="gl-h-full"
241
- :class="{ 'gl-cursor-grab': !isStatic }"
259
+ :class="{ 'gl-cursor-grab': !isStaticGrid }"
242
260
  data-testid="gridstack-panel"
243
261
  >
244
262
  <slot name="panel" v-bind="{ panel: panel.props }"></slot>
@@ -19,10 +19,6 @@
19
19
  background-color: rgba($toast-background-color, $b-toast-background-opacity);
20
20
  }
21
21
 
22
- &:not(:last-child) {
23
- margin-bottom: $toast-padding-x;
24
- }
25
-
26
22
  &.b-toast-solid {
27
23
  .toast {
28
24
  background-color: rgba($toast-background-color, 1);
@@ -133,9 +133,19 @@ const plugin = Vue => {
133
133
  }
134
134
  })
135
135
  // Create a mount point (a DIV) and mount it (which triggers the show)
136
- const div = document.createElement('div')
137
- document.body.appendChild(div)
138
- toast.$mount(div)
136
+ function createMountPoint() {
137
+ const div = document.createElement('div')
138
+ document.body.appendChild(div)
139
+ toast.$mount(div)
140
+ }
141
+
142
+ // ViewTransition fallback
143
+ if (!document.startViewTransition) {
144
+ createMountPoint()
145
+ return
146
+ }
147
+
148
+ document.startViewTransition(createMountPoint)
139
149
  }
140
150
 
141
151
  // Declare BvToast instance property class
@@ -1,3 +1,2 @@
1
1
  @import "toast";
2
2
  @import "toaster";
3
- @import "toaster-transition";
@@ -1,45 +0,0 @@
1
- // --- <b-toast> custom transition SCSS ---
2
-
3
- // PortalVue appears to have issues with transition classes on portaled items
4
-
5
- .b-toaster {
6
- &.b-toaster-top-right,
7
- &.b-toaster-top-left,
8
- &.b-toaster-bottom-right,
9
- &.b-toaster-bottom-left {
10
- .b-toast {
11
- &.b-toaster-enter-active,
12
- &.b-toaster-leave-active,
13
- &.b-toaster-move {
14
- transition: transform 0.175s;
15
- }
16
-
17
- &.b-toaster-enter {
18
- }
19
-
20
- &.b-toaster-enter-to,
21
- &.b-toaster-enter-active {
22
- .toast.fade {
23
- // Delay the appearance of the toast until
24
- // the move transition has completed
25
- transition-delay: 0.175s;
26
- }
27
- }
28
-
29
- &.b-toaster-enter-to {
30
- }
31
-
32
- &.b-toaster-leave-active {
33
- position: absolute;
34
- transition-delay: 0.175s;
35
-
36
- .toast.fade {
37
- transition-delay: 0s;
38
- }
39
- }
40
-
41
- &.b-toaster-leave-to {
42
- }
43
- }
44
- }
45
- }