@gitlab/ui 118.0.0 → 118.1.1

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": "118.0.0",
3
+ "version": "118.1.1",
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.3",
72
72
  "echarts": "^5.6.0",
73
- "gridstack": "^12.3.0",
73
+ "gridstack": "^12.3.3",
74
74
  "iframe-resizer": "^4.4.5",
75
75
  "lodash": "^4.17.21",
76
76
  "popper.js": "^1.16.1",
@@ -95,10 +95,10 @@
95
95
  "rollup-plugin-vue/@vue/component-compiler/postcss-modules-sync/generic-names/loader-utils": "3.3.1"
96
96
  },
97
97
  "devDependencies": {
98
- "@babel/core": "^7.28.0",
98
+ "@babel/core": "^7.28.3",
99
99
  "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
100
100
  "@babel/plugin-proposal-optional-chaining": "^7.21.0",
101
- "@babel/preset-env": "^7.28.0",
101
+ "@babel/preset-env": "^7.28.3",
102
102
  "@babel/preset-react": "^7.27.1",
103
103
  "@cypress/grep": "^4.1.1",
104
104
  "@gitlab/fonts": "^1.3.0",
@@ -138,7 +138,7 @@
138
138
  "cypress-real-events": "^1.14.0",
139
139
  "dompurify": "^3.1.2",
140
140
  "emoji-regex": "^10.4.0",
141
- "esbuild": "^0.25.8",
141
+ "esbuild": "^0.25.9",
142
142
  "gitlab-api-async-iterator": "^1.3.1",
143
143
  "glob": "11.0.3",
144
144
  "globby": "^14.1.0",
@@ -0,0 +1,56 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
2
+ <script>
3
+ import illustrationsPath from '@gitlab/svgs/dist/illustrations.svg';
4
+ import illustrationsInfo from '@gitlab/svgs/dist/illustrations.json';
5
+
6
+ const knownIllustrations = illustrationsInfo.icons;
7
+
8
+ /** This is a re-usable vue component for rendering a svg sprite icon
9
+ * @example
10
+ * <illustration
11
+ * name="status-success-sm"
12
+ * />
13
+ */
14
+ export default {
15
+ name: 'GlIllustration',
16
+ props: {
17
+ /**
18
+ * One of the illustrations from https://gitlab-org.gitlab.io/gitlab-svgs/ project
19
+ */
20
+ name: {
21
+ type: String,
22
+ required: true,
23
+ validator: (value) => {
24
+ if (knownIllustrations.some((obj) => obj.name === value)) {
25
+ return true;
26
+ }
27
+ // eslint-disable-next-line no-console
28
+ console.warn(`Illustration '${value}' is not a known illustration of @gitlab/svgs`);
29
+ return false;
30
+ },
31
+ },
32
+ },
33
+ computed: {
34
+ spriteHref() {
35
+ return `${illustrationsPath}#${this.name}`;
36
+ },
37
+ illustrationSize() {
38
+ return knownIllustrations.find((obj) => obj.name === this.name).svg_size;
39
+ },
40
+ },
41
+ };
42
+ </script>
43
+
44
+ <template>
45
+ <svg
46
+ :key="spriteHref"
47
+ :data-testid="`${name}-illustration`"
48
+ aria-label=""
49
+ role="presentation"
50
+ :width="illustrationSize"
51
+ :height="illustrationSize"
52
+ v-on="$listeners"
53
+ >
54
+ <use :href="spriteHref" />
55
+ </svg>
56
+ </template>
@@ -414,12 +414,11 @@ export default {
414
414
  @cancel-focus="cancelTokenFocus"
415
415
  @clear-all="clearAll"
416
416
  >
417
- <template #token-content="{ token }">
418
- <!-- @slot Content to pass to the token component slot. Can be used
419
- to add an avatar to the token. Default content is "{{ token.name }}".
420
- @binding {object} token
421
- -->
422
- <slot name="token-content" :token="token"></slot>
417
+ <template #token-content="{ token }"
418
+ ><!--
419
+ @slot Content to pass to the token component slot. Can be used to add an avatar to the token. Default content is "{{ token.name }}".
420
+ @binding {object} token
421
+ --><slot name="token-content" :token="token"></slot>
423
422
  </template>
424
423
  <template #text-input>
425
424
  <!-- Can't use `v-model` due to this bug: -->
@@ -465,34 +464,32 @@ export default {
465
464
  @dropdown-item-click="addToken"
466
465
  @show="openDropdown"
467
466
  >
468
- <template #loading-content>
469
- <!-- @slot Content to display when `loading` prop is `true`. Default
470
- content is "Searching..." -->
471
- <slot name="loading-content"></slot>
467
+ <template #loading-content
468
+ ><!--
469
+ @slot Content to display when `loading` prop is `true`. Default content is "Searching..."
470
+ --><slot name="loading-content"></slot>
472
471
  </template>
473
- <template #user-defined-token-content>
474
- <!-- @slot Content to display when adding a user defined token. Default content is 'Add "{{ inputText }}"'.
475
- @binding {string} inputText
476
- -->
477
- <slot name="user-defined-token-content" :input-text="inputText"></slot>
472
+ <template #user-defined-token-content
473
+ ><!--
474
+ @slot Content to display when adding a user defined token. Default content is 'Add "{{ inputText }}"'.
475
+ @binding {string} inputText
476
+ --><slot name="user-defined-token-content" :input-text="inputText"></slot>
478
477
  </template>
479
- <template #no-results-content>
480
- <!-- @slot Content to display when `dropdown-items` is empty and
481
- both `allow-user-defined-tokens` and `show-add-new-always` is `false`. Default content is "No matches found". -->
482
- <slot name="no-results-content"></slot>
478
+ <template #no-results-content
479
+ ><!--
480
+ @slot Content to display when `dropdown-items` is empty and both `allow-user-defined-tokens` and `show-add-new-always` is `false`. Default content is "No matches found".
481
+ --><slot name="no-results-content"></slot>
483
482
  </template>
484
- <template #dropdown-item-content="{ dropdownItem }">
485
- <!-- @slot Dropdown item content. Default content is "{{ dropdownItem.name }}".
486
- @binding {object} dropdownItem
487
- -->
488
- <slot name="dropdown-item-content" :dropdown-item="dropdownItem"></slot>
483
+ <template #dropdown-item-content="{ dropdownItem }"
484
+ ><!--
485
+ @slot Dropdown item content. Default content is "{{ dropdownItem.name }}".
486
+ @binding {object} dropdownItem
487
+ --><slot name="dropdown-item-content" :dropdown-item="dropdownItem"></slot>
489
488
  </template>
490
- <template #dropdown-footer>
491
- <!-- @slot Content to add to the bottom of the dropdown.
492
- Can be used in conjunction with `gl-intersection-observer` to load
493
- more items as the user scrolls.
494
- -->
495
- <slot name="dropdown-footer"></slot>
489
+ <template #dropdown-footer
490
+ ><!--
491
+ @slot Content to add to the bottom of the dropdown. Can be used in conjunction with `gl-intersection-observer` to load more items as the user scrolls.
492
+ --><slot name="dropdown-footer"></slot>
496
493
  </template>
497
494
  </gl-token-selector-dropdown>
498
495
  </div>
@@ -8,6 +8,7 @@ export { default as GlTokenSelector } from './base/token_selector/token_selector
8
8
  export { default as GlMarkdown } from './base/markdown/markdown.vue';
9
9
  export { default as GlLink, default as GlDeprecatedLink } from './base/link/link.vue';
10
10
  export { default as GlIcon } from './base/icon/icon.vue';
11
+ export { default as GlIllustration } from './base/illustration/illustration.vue';
11
12
  export { default as GlAnimatedChevronRightDownIcon } from './base/animated_icon/animated_chevron_right_down_icon.vue';
12
13
  export { default as GlAnimatedChevronLgRightDownIcon } from './base/animated_icon/animated_chevron_lg_right_down_icon.vue';
13
14
  export { default as GlAnimatedChevronDownUpIcon } from './base/animated_icon/animated_chevron_down_up_icon.vue';
@@ -15,6 +15,19 @@ export default {
15
15
  required: false,
16
16
  default: null,
17
17
  },
18
+ /**
19
+ * The header tag used in the empty state component (h1/h2/h3/h4/h5/h6).
20
+ * For accessibility this should be set to an appropriate value in the context where the component is used.
21
+ * Defaults to `h2`
22
+ */
23
+ headerLevel: {
24
+ type: Number,
25
+ required: false,
26
+ default: 2,
27
+ validator(value) {
28
+ return value > 0 && value <= 6;
29
+ },
30
+ },
18
31
  /**
19
32
  * The illustration's URL.
20
33
  */
@@ -94,6 +107,10 @@ export default {
94
107
  },
95
108
  },
96
109
  computed: {
110
+ headerComponent() {
111
+ const level = this.headerLevel;
112
+ return `h${level}`;
113
+ },
97
114
  height() {
98
115
  return this.shouldPreventImageReflow ? this.svgHeight : null;
99
116
  },
@@ -141,12 +158,13 @@ export default {
141
158
  Overrides the `title` prop.
142
159
  -->
143
160
  <slot ref="title" name="title">
144
- <h1
161
+ <component
162
+ :is="headerComponent"
145
163
  class="gl-mb-0 gl-mt-0 gl-text-size-h-display gl-leading-36"
146
164
  :class="compact ? 'h5' : 'h4'"
147
165
  >
148
166
  {{ title }}
149
- </h1>
167
+ </component>
150
168
  </slot>
151
169
  <p
152
170
  v-if="description || $scopedSlots.description"