@gitlab/ui 91.3.0 → 91.4.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/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ # [91.4.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v91.3.0...v91.4.0) (2024-09-02)
2
+
3
+
4
+ ### Features
5
+
6
+ * **GlAlert:** Replace english text with translation ([38582dd](https://gitlab.com/gitlab-org/gitlab-ui/commit/38582dddee70e6bf2b19945b5f20953359f5bc7a))
7
+ * **GlBanner:** Replace english text with translation ([a8ad872](https://gitlab.com/gitlab-org/gitlab-ui/commit/a8ad872011660d2973c9008e63b314355032e632))
8
+ * **GlBroadcastMessage:** Replace english text with translation ([6cf3e7c](https://gitlab.com/gitlab-org/gitlab-ui/commit/6cf3e7cfe272c1eb48c61d0d79dec9245a825d75))
9
+ * **GlModal:** Replace english text with translation ([2498b0e](https://gitlab.com/gitlab-org/gitlab-ui/commit/2498b0e38f74d2af7efae62b3686ff189b056932))
10
+ * **GlToken:** Add property 'removeLabel' ([87b81a6](https://gitlab.com/gitlab-org/gitlab-ui/commit/87b81a6f0838e8a644af20558a65b02d5b99e25e))
11
+
1
12
  # [91.3.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v91.2.0...v91.3.0) (2024-08-30)
2
13
 
3
14
 
@@ -1,3 +1,4 @@
1
+ import { translate } from '../../../utils/i18n';
1
2
  import { alertVariantOptions, alertVariantIconMap, buttonCategoryOptions } from '../../../utils/constants';
2
3
  import CloseButton from '../../shared_components/close_button/close_button';
3
4
  import GlButton from '../button/button';
@@ -35,12 +36,12 @@ var script = {
35
36
  default: true
36
37
  },
37
38
  /**
38
- * Dismiss button's aria-label.
39
+ * The close button's label, it is used for the button's aria-label attribute.
39
40
  */
40
41
  dismissLabel: {
41
42
  type: String,
42
43
  required: false,
43
- default: 'Dismiss'
44
+ default: () => translate('GlAlert.closeButtonTitle', 'Dismiss')
44
45
  },
45
46
  variant: {
46
47
  type: String,
@@ -1,4 +1,5 @@
1
1
  import { bannerVariants } from '../../../utils/constants';
2
+ import { translate } from '../../../utils/i18n';
2
3
  import CloseButton from '../../shared_components/close_button/close_button';
3
4
  import GlButton from '../button/button';
4
5
  import GlCard from '../card/card';
@@ -62,12 +63,12 @@ var script = {
62
63
  }
63
64
  },
64
65
  /**
65
- * Dismiss button's aria-label.
66
+ * The close button's label, it is used for the button's aria-label attribute.
66
67
  */
67
68
  dismissLabel: {
68
69
  type: String,
69
70
  required: false,
70
- default: 'Dismiss'
71
+ default: () => translate('GlBanner.closeButtonTitle', 'Dismiss')
71
72
  }
72
73
  },
73
74
  computed: {
@@ -1,4 +1,5 @@
1
1
  import { colorThemes } from '../../../utils/constants';
2
+ import { translate } from '../../../utils/i18n';
2
3
  import CloseButton from '../../shared_components/close_button/close_button';
3
4
  import GlIcon from '../icon/icon';
4
5
  import { TYPE_BANNER, TYPE_LIST, TYPE_NOTIFICATION } from './constants';
@@ -28,12 +29,12 @@ var script = {
28
29
  default: true
29
30
  },
30
31
  /**
31
- * The dismiss button's label, it is visible in mobile viewports and used for the button's aria-label attribute.
32
+ * The dismiss button's label, it is used for the button's aria-label attribute.
32
33
  */
33
34
  dismissLabel: {
34
35
  type: String,
35
36
  required: false,
36
- default: 'Dismiss'
37
+ default: () => translate('GlBroadcastMessage.closeButtonTitle', 'Dismiss')
37
38
  },
38
39
  /**
39
40
  * The theme's name to use, this should correspond to the user's selected theme in GitLab.
@@ -1,4 +1,5 @@
1
1
  import { BModal } from '../../../vendor/bootstrap-vue/src/components/modal/modal';
2
+ import { translate } from '../../../utils/i18n';
2
3
  import { modalSizeOptions, modalButtonDefaults, focusableTags, COMMA } from '../../../utils/constants';
3
4
  import { logWarning, focusFirstFocusableElement } from '../../../utils/utils';
4
5
  import CloseButton from '../../shared_components/close_button/close_button';
@@ -65,10 +66,13 @@ var script = {
65
66
  default: modalSizeOptions.md,
66
67
  validator: val => Object.keys(modalSizeOptions).includes(val)
67
68
  },
69
+ /**
70
+ * The close button's label, it is used for the button's aria-label attribute.
71
+ */
68
72
  dismissLabel: {
69
73
  type: String,
70
74
  required: false,
71
- default: 'Close'
75
+ default: () => translate('GlModal.closeButtonTitle', 'Close')
72
76
  },
73
77
  visible: {
74
78
  type: Boolean,
@@ -1,4 +1,5 @@
1
1
  import { tokenVariants } from '../../../utils/constants';
2
+ import { translate } from '../../../utils/i18n';
2
3
  import CloseButton from '../../shared_components/close_button/close_button';
3
4
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
4
5
 
@@ -22,6 +23,14 @@ var script = {
22
23
  required: false,
23
24
  default: 'default',
24
25
  validator: variant => tokenVariants.includes(variant)
26
+ },
27
+ /**
28
+ * The close button's label, it is used for the button's aria-label attribute.
29
+ */
30
+ removeLabel: {
31
+ type: String,
32
+ required: false,
33
+ default: () => translate('GlToken.closeButtonTitle', 'Remove')
25
34
  }
26
35
  },
27
36
  computed: {
@@ -50,7 +59,7 @@ var script = {
50
59
  const __vue_script__ = script;
51
60
 
52
61
  /* template */
53
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',_vm._g({class:['gl-token', _vm.variantClass, _vm.viewOnlyClass]},_vm.$listeners),[_c('span',{staticClass:"gl-token-content"},[_vm._t("default"),_vm._v(" "),(!_vm.viewOnly)?_c('close-button',{staticClass:"gl-token-close gl-close-btn-color-inherit",on:{"click":_vm.close}}):_vm._e()],2)])};
62
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',_vm._g({class:['gl-token', _vm.variantClass, _vm.viewOnlyClass]},_vm.$listeners),[_c('span',{staticClass:"gl-token-content"},[_vm._t("default"),_vm._v(" "),(!_vm.viewOnly)?_c('close-button',{staticClass:"gl-token-close gl-close-btn-color-inherit",attrs:{"label":_vm.removeLabel},on:{"click":_vm.close}}):_vm._e()],2)])};
54
63
  var __vue_staticRenderFns__ = [];
55
64
 
56
65
  /* style */
@@ -1,3 +1,4 @@
1
+ import { translate } from '../../../utils/i18n';
1
2
  import GlButton from '../../base/button/button';
2
3
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
3
4
 
@@ -10,7 +11,7 @@ var script = {
10
11
  label: {
11
12
  type: String,
12
13
  required: false,
13
- default: 'Close'
14
+ default: () => translate('CloseButton.title', 'Close')
14
15
  }
15
16
  }
16
17
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "91.3.0",
3
+ "version": "91.4.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -1,5 +1,6 @@
1
1
  <!-- eslint-disable vue/multi-word-component-names -->
2
2
  <script>
3
+ import { translate } from '../../../utils/i18n';
3
4
  import {
4
5
  alertVariantOptions,
5
6
  alertVariantIconMap,
@@ -39,12 +40,12 @@ export default {
39
40
  default: true,
40
41
  },
41
42
  /**
42
- * Dismiss button's aria-label.
43
+ * The close button's label, it is used for the button's aria-label attribute.
43
44
  */
44
45
  dismissLabel: {
45
46
  type: String,
46
47
  required: false,
47
- default: 'Dismiss',
48
+ default: () => translate('GlAlert.closeButtonTitle', 'Dismiss'),
48
49
  },
49
50
  variant: {
50
51
  type: String,
@@ -1,5 +1,6 @@
1
1
  <script>
2
2
  import { bannerVariants } from '../../../utils/constants';
3
+ import { translate } from '../../../utils/i18n';
3
4
  import CloseButton from '../../shared_components/close_button/close_button.vue';
4
5
  import GlButton from '../button/button.vue';
5
6
  import GlCard from '../card/card.vue';
@@ -62,12 +63,12 @@ export default {
62
63
  },
63
64
  },
64
65
  /**
65
- * Dismiss button's aria-label.
66
+ * The close button's label, it is used for the button's aria-label attribute.
66
67
  */
67
68
  dismissLabel: {
68
69
  type: String,
69
70
  required: false,
70
- default: 'Dismiss',
71
+ default: () => translate('GlBanner.closeButtonTitle', 'Dismiss'),
71
72
  },
72
73
  },
73
74
  computed: {
@@ -1,5 +1,6 @@
1
1
  <script>
2
2
  import { colorThemes } from '../../../utils/constants';
3
+ import { translate } from '../../../utils/i18n';
3
4
  import CloseButton from '../../shared_components/close_button/close_button.vue';
4
5
  import GlIcon from '../icon/icon.vue';
5
6
  import { TYPE_BANNER, TYPE_NOTIFICATION, TYPE_LIST } from './constants';
@@ -28,12 +29,12 @@ export default {
28
29
  default: true,
29
30
  },
30
31
  /**
31
- * The dismiss button's label, it is visible in mobile viewports and used for the button's aria-label attribute.
32
+ * The dismiss button's label, it is used for the button's aria-label attribute.
32
33
  */
33
34
  dismissLabel: {
34
35
  type: String,
35
36
  required: false,
36
- default: 'Dismiss',
37
+ default: () => translate('GlBroadcastMessage.closeButtonTitle', 'Dismiss'),
37
38
  },
38
39
  /**
39
40
  * The theme's name to use, this should correspond to the user's selected theme in GitLab.
@@ -1,6 +1,7 @@
1
1
  <!-- eslint-disable vue/multi-word-component-names -->
2
2
  <script>
3
3
  import { BModal } from '../../../vendor/bootstrap-vue/src/components/modal/modal';
4
+ import { translate } from '../../../utils/i18n';
4
5
  import {
5
6
  COMMA,
6
7
  focusableTags,
@@ -71,10 +72,13 @@ export default {
71
72
  default: modalSizeOptions.md,
72
73
  validator: (val) => Object.keys(modalSizeOptions).includes(val),
73
74
  },
75
+ /**
76
+ * The close button's label, it is used for the button's aria-label attribute.
77
+ */
74
78
  dismissLabel: {
75
79
  type: String,
76
80
  required: false,
77
- default: 'Close',
81
+ default: () => translate('GlModal.closeButtonTitle', 'Close'),
78
82
  },
79
83
  visible: {
80
84
  type: Boolean,
@@ -1,6 +1,7 @@
1
1
  <!-- eslint-disable vue/multi-word-component-names -->
2
2
  <script>
3
3
  import { tokenVariants } from '../../../utils/constants';
4
+ import { translate } from '../../../utils/i18n';
4
5
  import CloseButton from '../../shared_components/close_button/close_button.vue';
5
6
 
6
7
  export default {
@@ -23,6 +24,14 @@ export default {
23
24
  default: 'default',
24
25
  validator: (variant) => tokenVariants.includes(variant),
25
26
  },
27
+ /**
28
+ * The close button's label, it is used for the button's aria-label attribute.
29
+ */
30
+ removeLabel: {
31
+ type: String,
32
+ required: false,
33
+ default: () => translate('GlToken.closeButtonTitle', 'Remove'),
34
+ },
26
35
  },
27
36
  computed: {
28
37
  variantClass() {
@@ -54,6 +63,7 @@ export default {
54
63
  <close-button
55
64
  v-if="!viewOnly"
56
65
  class="gl-token-close gl-close-btn-color-inherit"
66
+ :label="removeLabel"
57
67
  @click="close"
58
68
  />
59
69
  </span>
@@ -1,4 +1,5 @@
1
1
  <script>
2
+ import { translate } from '../../../utils/i18n';
2
3
  import GlButton from '../../base/button/button.vue';
3
4
 
4
5
  export default {
@@ -10,7 +11,7 @@ export default {
10
11
  label: {
11
12
  type: String,
12
13
  required: false,
13
- default: 'Close',
14
+ default: () => translate('CloseButton.title', 'Close'),
14
15
  },
15
16
  },
16
17
  };
package/translations.js CHANGED
@@ -1,8 +1,12 @@
1
1
  /* eslint-disable import/no-default-export */
2
2
  export default {
3
3
  'ClearIconButton.title': 'Clear',
4
+ 'CloseButton.title': 'Close',
4
5
  'DuoChatContextItemPopover.DisabledReason': 'This item is disabled',
6
+ 'GlAlert.closeButtonTitle': 'Dismiss',
7
+ 'GlBanner.closeButtonTitle': 'Dismiss',
5
8
  'GlBreadcrumb.showMoreLabel': 'Show more breadcrumbs',
9
+ 'GlBroadcastMessage.closeButtonTitle': 'Dismiss',
6
10
  'GlCollapsibleListbox.srOnlyResultsLabel': null,
7
11
  'GlDuoChatMessage.SelectedContextItemsTitleAssistantMessage': null,
8
12
  'GlDuoChatMessage.SelectedContextItemsTitleUserMessage': null,
@@ -21,6 +25,7 @@ export default {
21
25
  'GlKeysetPagination.navigationLabel': 'Pagination',
22
26
  'GlKeysetPagination.nextText': 'Next',
23
27
  'GlKeysetPagination.prevText': 'Previous',
28
+ 'GlModal.closeButtonTitle': 'Close',
24
29
  'GlPagination.labelFirstPage': 'Go to first page',
25
30
  'GlPagination.labelLastPage': 'Go to last page',
26
31
  'GlPagination.labelNextPage': 'Go to next page',
@@ -32,4 +37,5 @@ export default {
32
37
  'GlSearchBoxByType.input.placeholder': 'Search',
33
38
  'GlSorting.sortAscending': 'Sort direction: ascending',
34
39
  'GlSorting.sortDescending': 'Sort direction: descending',
40
+ 'GlToken.closeButtonTitle': 'Remove',
35
41
  };