@gitlab/ui 114.5.0 → 114.7.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": "114.5.0",
3
+ "version": "114.7.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -110,7 +110,7 @@ sanitization. This component exposes the `is-unsafe-link` prop for that purpose.
110
110
  href="data:text/plain;charset=utf-8,GitLab%20is%20awesome">Download</gl-button>
111
111
  ```
112
112
 
113
- [SafeLinkDirective docs]: https://gitlab-org.gitlab.io/gitlab-ui/?path=/docs/directives-safe-link-directive--default
113
+ [SafeLinkDirective docs]: https://design.gitlab.com/storybook?path=/docs/directives-safe-link-directive--default
114
114
  [Data URL]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
115
115
 
116
116
  ## vue-bootstrap component
@@ -1,7 +1,7 @@
1
1
  ## Usage
2
2
 
3
3
  `GlFormCharacterCount` can be used to add a character count to an input.
4
- If you are using `GlFormTextarea` on its own see [with character count example](https://gitlab-org.gitlab.io/gitlab-ui/?path=/story/base-form-form-textarea--with-character-count).
4
+ If you are using `GlFormTextarea` on its own see [with character count example](https://design.gitlab.com/storybook?path=/story/base-form-form-textarea--with-character-count).
5
5
  If you are wrapping your input, such as in a markdown component, and need the character
6
6
  count separate from the input, use `GlFormCharacterCount`.
7
7
 
@@ -46,7 +46,7 @@ The algorithm to match tokens with the input is very naive. If you need to use t
46
46
  very large list of matches, you may want to update the implementation or use one of the search
47
47
  inputs, like [`GlSearchBoxByType`], [`GlSearchBoxByClick`], or [`GlFilteredSearch`].
48
48
 
49
- [`GlSearchBoxByType`]: https://gitlab-org.gitlab.io/gitlab-ui/?path=/story/base-search-box-by-type--default
50
- [`GlSearchBoxByClick`]: https://gitlab-org.gitlab.io/gitlab-ui/?path=/story/base-search-box-by-click--default
51
- [`GlTokenSelector`]: https://gitlab-org.gitlab.io/gitlab-ui/?path=/story/base-token-selector--default
52
- [`GlFilteredSearch`]: https://gitlab-org.gitlab.io/gitlab-ui/?path=/story/base-filtered-search--default
49
+ [`GlSearchBoxByType`]: https://design.gitlab.com/storybook?path=/story/base-search-box-by-type--default
50
+ [`GlSearchBoxByClick`]: https://design.gitlab.com/storybook?path=/story/base-search-box-by-click--default
51
+ [`GlTokenSelector`]: https://design.gitlab.com/storybook?path=/story/base-token-selector--default
52
+ [`GlFilteredSearch`]: https://design.gitlab.com/storybook?path=/story/base-filtered-search--default
@@ -25,6 +25,39 @@ and also Vue Router and Nuxt links.
25
25
  <gl-link href="#foo">Link</gl-link>
26
26
  ```
27
27
 
28
+ ## External link indicator
29
+
30
+ The `show-external-icon` prop displays a "↗" character after the link text to indicate external links.
31
+ This feature is available for **inline**, **UI (default)**, and **meta** variants only.
32
+
33
+ ```html
34
+ <!-- External link with indicator -->
35
+ <gl-link href="https://kubernetes.io/docs" target="_blank" show-external-icon>
36
+ Kubernetes documentation
37
+ </gl-link>
38
+ <!-- Renders as: Kubernetes documentation ↗ -->
39
+
40
+ <!-- Different variants with external indicator -->
41
+ <gl-link variant="inline" href="https://prometheus.io" target="_blank" show-external-icon>
42
+ Learn more about Prometheus monitoring
43
+ </gl-link>
44
+
45
+ <gl-link variant="meta" href="https://docker.com" target="_blank" show-external-icon>
46
+ Docker Hub
47
+ </gl-link>
48
+ ```
49
+
50
+ **Requirements for the external icon to appear:**
51
+
52
+ - `show-external-icon` prop must be `true`.
53
+ - `href` prop must be provided.
54
+ - `target="_blank"` must be set.
55
+ - Destination domain must be [determined as external](https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/b5e4b0b4241455ed0fa45e0f6f5b83a3b76755ff/packages/gitlab-ui/src/directives/safe_link/safe_link.js#L12).
56
+ - Link variant must be `inline`, `meta`, or default (UI).
57
+
58
+ **Note:** The external icon is not available for `mention` or `unstyled` variants as these have
59
+ specific design purposes that don't align with external link indication.
60
+
28
61
  ## Link type
29
62
 
30
63
  By specifying a value in the `href` prop, a standard link (`<a>`) element will be rendered. To
@@ -150,5 +183,5 @@ sanitization. This component exposes the `is-unsafe-link` prop for that purpose.
150
183
  </gl-link>
151
184
  ```
152
185
 
153
- [SafeLinkDirective docs]: https://gitlab-org.gitlab.io/gitlab-ui/?path=/docs/directives-safe-link-directive--default
186
+ [SafeLinkDirective docs]: https://design.gitlab.com/storybook?path=/docs/directives-safe-link-directive--default
154
187
  [Data URL]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
@@ -28,7 +28,7 @@
28
28
  }
29
29
  }
30
30
 
31
- .gl-link-inline-external::after {
31
+ .gl-link-external::after {
32
32
  content: ' ↗';
33
33
  font-size: 1em;
34
34
  }
@@ -15,6 +15,7 @@ import { attemptFocus, attemptBlur } from '../../../vendor/bootstrap-vue/src/uti
15
15
  import {
16
16
  linkVariantOptions,
17
17
  linkVariantInline,
18
+ linkVariantMeta,
18
19
  linkVariantUnstyled,
19
20
  isVue3,
20
21
  } from '../../../utils/constants';
@@ -130,7 +131,7 @@ export default {
130
131
  default: null,
131
132
  },
132
133
  /**
133
- * If inline variant, controls character visibility
134
+ * Controls character visibility for external links
134
135
  */
135
136
  showExternalIcon: {
136
137
  type: Boolean,
@@ -169,10 +170,11 @@ export default {
169
170
  isVue3RouterLink() {
170
171
  return this.tag === VUE_ROUTER_LINK_TAG && isVue3;
171
172
  },
172
- isInlineAndHasExternalIcon() {
173
+ shouldShowExternalIcon() {
174
+ const allowedVariants = [linkVariantInline, linkVariantMeta, null]; // null represents default/UI variant
173
175
  return (
174
176
  this.showExternalIcon &&
175
- this.variant === linkVariantInline &&
177
+ allowedVariants.includes(this.variant) &&
176
178
  this.href &&
177
179
  isExternalURL(this.target, this.href)
178
180
  );
@@ -247,7 +249,7 @@ export default {
247
249
  {
248
250
  disabled: this.disabled,
249
251
  active: this.active,
250
- 'gl-link-inline-external': this.isInlineAndHasExternalIcon,
252
+ 'gl-link-external': this.shouldShowExternalIcon,
251
253
  },
252
254
  ];
253
255
  },
@@ -1,4 +1,5 @@
1
1
  <script>
2
+ import uniqueId from 'lodash/uniqueId';
2
3
  import { GlTooltipDirective } from '../../../directives/tooltip/tooltip';
3
4
  import GlButton from '../button/button.vue';
4
5
  import GlButtonGroup from '../button_group/button_group.vue';
@@ -94,7 +95,15 @@ export default {
94
95
  default: false,
95
96
  },
96
97
  },
98
+ data() {
99
+ return {
100
+ sortingListboxId: uniqueId('sorting-listbox-'),
101
+ };
102
+ },
97
103
  computed: {
104
+ sortingListboxLabel() {
105
+ return translate('GlSorting.sortByLabel', 'Sort by:');
106
+ },
98
107
  localSortDirection() {
99
108
  return this.isAscending ? 'sort-lowest' : 'sort-highest';
100
109
  },
@@ -146,8 +155,10 @@ export default {
146
155
  :class="dropdownClass"
147
156
  placement="bottom-end"
148
157
  :block="block"
158
+ :toggle-aria-labelled-by="sortingListboxId"
149
159
  @select="onSortByChanged"
150
160
  />
161
+ <span :id="sortingListboxId" class="gl-sr-only">{{ sortingListboxLabel }}</span>
151
162
  <gl-button
152
163
  v-gl-tooltip
153
164
  :title="sortDirectionText"
@@ -45,4 +45,4 @@ export const tableFullProps = [
45
45
  ];
46
46
 
47
47
  export const glTableLiteWarning =
48
- 'This GlTable could be a GlTableLite component, please consider using GlTableLite instead of GlTable to reduce the page bundlesize more about this here: https://gitlab-org.gitlab.io/gitlab-ui/?path=/docs/base-table-table-lite--default';
48
+ 'This GlTable could be a GlTableLite component, please consider using GlTableLite instead of GlTable to reduce the page bundlesize more about this here: https://design.gitlab.com/storybook?path=/docs/base-table-table-lite--default';
@@ -79,7 +79,7 @@ function showToast(message, options = {}) {
79
79
  * Note: This is not a typical Vue component and needs to be registered before instantiating a Vue app.
80
80
  * Once registered, the toast will be globally available throughout your app.
81
81
  *
82
- * See https://gitlab-org.gitlab.io/gitlab-ui/ for detailed documentation.
82
+ * See https://design.gitlab.com/storybook for detailed documentation.
83
83
  */
84
84
  export default {
85
85
  install(Vue) {
@@ -2,6 +2,6 @@
2
2
 
3
3
  **Note** This component uses `<gl-legend>`, which should allow a user to click on any data point(s)
4
4
  in the legend and make the corresponding data point(s) on the chart rendered disappear.
5
- _See [area chart](https://gitlab-org.gitlab.io/gitlab-ui/?path=/story/charts-area-chart--default)
5
+ _See [area chart](https://design.gitlab.com/storybook?path=/story/charts-area-chart--default)
6
6
  for an example_ For this particular chart, there is a [known issue](https://gitlab.com/gitlab-org/gitlab-ui/issues/352)
7
7
  with the functionality of the legend, where clicking on it does nothing.
package/translations.js CHANGED
@@ -31,6 +31,7 @@ export default {
31
31
  'GlProgressBar.ariaLabel': 'Progress bar',
32
32
  'GlSearchBoxByType.clearButtonTitle': 'Clear',
33
33
  'GlSearchBoxByType.input.placeholder': 'Search',
34
+ 'GlSorting.sortByLabel': 'Sort by:',
34
35
  'GlSorting.sortAscending': 'Sort direction: ascending',
35
36
  'GlSorting.sortDescending': 'Sort direction: descending',
36
37
  'GlToken.closeButtonTitle': 'Remove',