@gitlab/ui 77.4.0 → 77.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.
Files changed (27) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown_item.js +22 -12
  3. package/dist/components/base/new_dropdowns/disclosure/mock_data.js +6 -0
  4. package/dist/components/experimental/duo/chat/duo_chat.js +1 -1
  5. package/dist/index.css +1 -1
  6. package/dist/index.css.map +1 -1
  7. package/dist/tokens/css/tokens.css +4 -4
  8. package/dist/tokens/css/tokens.dark.css +4 -1
  9. package/dist/tokens/js/tokens.dark.js +4 -1
  10. package/dist/tokens/js/tokens.js +1 -1
  11. package/dist/tokens/json/tokens.dark.json +9 -9
  12. package/dist/tokens/json/tokens.json +3 -3
  13. package/dist/tokens/scss/_tokens.dark.scss +4 -1
  14. package/dist/tokens/scss/_tokens.scss +4 -4
  15. package/package.json +1 -1
  16. package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.md +3 -1
  17. package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.spec.js +8 -4
  18. package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown_item.spec.js +14 -5
  19. package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown_item.vue +11 -5
  20. package/src/components/base/new_dropdowns/disclosure/mock_data.js +7 -0
  21. package/src/components/experimental/duo/chat/duo_chat.scss +6 -0
  22. package/src/components/experimental/duo/chat/duo_chat.vue +1 -1
  23. package/src/tokens/text.dark.tokens.json +19 -0
  24. package/src/tokens/text.dark.tokens.stories.js +13 -0
  25. package/src/tokens/text.tokens.json +3 -3
  26. package/src/tokens/text.tokens.stories.js +1 -1
  27. package/tailwind.defaults.js +28 -16
package/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ # [77.6.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v77.5.0...v77.6.0) (2024-03-01)
2
+
3
+
4
+ ### Features
5
+
6
+ * **GlDisclosureDropdownItem:** Support Vue router links ([2bff76d](https://gitlab.com/gitlab-org/gitlab-ui/commit/2bff76de9f1c675eea407d92b646018395be0b2e))
7
+
8
+ # [77.5.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v77.4.0...v77.5.0) (2024-03-01)
9
+
10
+
11
+ ### Features
12
+
13
+ * **DuoChat:** Make DuoChat fullWidth by default ([5c8c0ea](https://gitlab.com/gitlab-org/gitlab-ui/commit/5c8c0ea0266ea3bef347327a5f0bdbbd49885c37))
14
+ * **tailwind:** add text color design tokens to the preset ([d3535f9](https://gitlab.com/gitlab-org/gitlab-ui/commit/d3535f9a2b65d3722dcd0033bfe97770583a8760))
15
+
1
16
  # [77.4.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v77.3.0...v77.4.0) (2024-02-28)
2
17
 
3
18
 
@@ -1,3 +1,4 @@
1
+ import { BLink } from 'bootstrap-vue/esm/index.js';
1
2
  import { ENTER, SPACE } from '../constants';
2
3
  import { stopEvent } from '../../../../utils/utils';
3
4
  import { isItem } from './utils';
@@ -8,6 +9,9 @@ const ITEM_CLASS = 'gl-new-dropdown-item';
8
9
  var script = {
9
10
  name: DISCLOSURE_DROPDOWN_ITEM_NAME,
10
11
  ITEM_CLASS,
12
+ components: {
13
+ BLink
14
+ },
11
15
  props: {
12
16
  item: {
13
17
  type: Object,
@@ -18,8 +22,8 @@ var script = {
18
22
  },
19
23
  computed: {
20
24
  isLink() {
21
- var _this$item;
22
- return typeof ((_this$item = this.item) === null || _this$item === void 0 ? void 0 : _this$item.href) === 'string';
25
+ var _this$item, _this$item2;
26
+ return typeof ((_this$item = this.item) === null || _this$item === void 0 ? void 0 : _this$item.href) === 'string' || typeof ((_this$item2 = this.item) === null || _this$item2 === void 0 ? void 0 : _this$item2.to) === 'string';
23
27
  },
24
28
  isCustomContent() {
25
29
  return Boolean(this.$scopedSlots.default);
@@ -29,9 +33,10 @@ var script = {
29
33
  item
30
34
  } = this;
31
35
  if (this.isLink) return {
32
- is: 'a',
36
+ is: BLink,
33
37
  attrs: {
34
38
  href: item.href,
39
+ to: item.to,
35
40
  ...item.extraAttrs
36
41
  },
37
42
  listeners: {
@@ -54,16 +59,16 @@ var script = {
54
59
  };
55
60
  },
56
61
  listIndex() {
57
- var _this$item2, _this$item2$extraAttr;
58
- return (_this$item2 = this.item) !== null && _this$item2 !== void 0 && (_this$item2$extraAttr = _this$item2.extraAttrs) !== null && _this$item2$extraAttr !== void 0 && _this$item2$extraAttr.disabled ? null : 0;
62
+ var _this$item3, _this$item3$extraAttr;
63
+ return (_this$item3 = this.item) !== null && _this$item3 !== void 0 && (_this$item3$extraAttr = _this$item3.extraAttrs) !== null && _this$item3$extraAttr !== void 0 && _this$item3$extraAttr.disabled ? null : 0;
59
64
  },
60
65
  componentIndex() {
61
- var _this$item3, _this$item3$extraAttr;
62
- return (_this$item3 = this.item) !== null && _this$item3 !== void 0 && (_this$item3$extraAttr = _this$item3.extraAttrs) !== null && _this$item3$extraAttr !== void 0 && _this$item3$extraAttr.disabled ? null : -1;
66
+ var _this$item4, _this$item4$extraAttr;
67
+ return (_this$item4 = this.item) !== null && _this$item4 !== void 0 && (_this$item4$extraAttr = _this$item4.extraAttrs) !== null && _this$item4$extraAttr !== void 0 && _this$item4$extraAttr.disabled ? null : -1;
63
68
  },
64
69
  wrapperClass() {
65
- var _this$item$wrapperCla, _this$item4;
66
- return (_this$item$wrapperCla = (_this$item4 = this.item) === null || _this$item4 === void 0 ? void 0 : _this$item4.wrapperClass) !== null && _this$item$wrapperCla !== void 0 ? _this$item$wrapperCla : '';
70
+ var _this$item$wrapperCla, _this$item5;
71
+ return (_this$item$wrapperCla = (_this$item5 = this.item) === null || _this$item5 === void 0 ? void 0 : _this$item5.wrapperClass) !== null && _this$item$wrapperCla !== void 0 ? _this$item$wrapperCla : '';
67
72
  },
68
73
  wrapperListeners() {
69
74
  const listeners = {
@@ -84,16 +89,21 @@ var script = {
84
89
  if (this.isCustomContent) {
85
90
  this.action();
86
91
  } else {
87
- var _this$$refs$item;
88
92
  stopEvent(event);
89
93
  /** Instead of simply navigating or calling the action, we want
90
94
  * the `a/button` to be the target of the event as it might have additional attributes.
91
95
  * E.g. `a` might have `target` attribute.
92
96
  */
93
- (_this$$refs$item = this.$refs.item) === null || _this$$refs$item === void 0 ? void 0 : _this$$refs$item.dispatchEvent(new MouseEvent('click', {
97
+ const e = new MouseEvent('click', {
94
98
  bubbles: true,
95
99
  cancelable: true
96
- }));
100
+ });
101
+ if (this.isLink) {
102
+ this.$refs.item.$el.dispatchEvent(e);
103
+ } else {
104
+ var _this$$refs$item;
105
+ (_this$$refs$item = this.$refs.item) === null || _this$$refs$item === void 0 ? void 0 : _this$$refs$item.dispatchEvent(e);
106
+ }
97
107
  }
98
108
  }
99
109
  },
@@ -24,6 +24,12 @@ const mockItems = [{
24
24
  rel: 'nofollow',
25
25
  target: '_blank'
26
26
  }
27
+ }, {
28
+ text: 'Edit merge request',
29
+ to: '/edit',
30
+ extraAttrs: {
31
+ 'data-uuid': '1234'
32
+ }
27
33
  }];
28
34
  const mockItemsCustomItem = [{
29
35
  text: 'Assigned to you',
@@ -343,7 +343,7 @@ var script = {
343
343
  const __vue_script__ = script;
344
344
 
345
345
  /* template */
346
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (!_vm.isHidden)?_c('aside',{staticClass:"markdown-code-block gl-drawer gl-drawer-default gl-max-h-full gl-bottom-0 gl-shadow-none gl-border-l gl-border-t duo-chat",attrs:{"id":"chat-component","role":"complementary","data-testid":"chat-component"}},[(_vm.showHeader)?_c('header',{staticClass:"gl-drawer-header gl-drawer-header-sticky gl-z-index-200 gl-p-0! gl-border-b-0",attrs:{"data-testid":"chat-header"}},[_c('div',{staticClass:"drawer-title gl-display-flex gl-justify-content-start gl-align-items-center gl-p-5"},[_c('h3',{staticClass:"gl-my-0 gl-font-size-h2"},[_vm._v(_vm._s(_vm.title))]),_vm._v(" "),_c('gl-experiment-badge',{attrs:{"help-page-url":_vm.badgeHelpPageUrl,"type":_vm.badgeType,"container-id":"chat-component"}}),_vm._v(" "),_c('gl-button',{staticClass:"gl-p-0! gl-ml-auto",attrs:{"category":"tertiary","variant":"default","icon":"close","size":"small","data-testid":"chat-close-button","aria-label":_vm.$options.i18n.CHAT_CLOSE_LABEL},on:{"click":_vm.hideChat}})],1),_vm._v(" "),_c('gl-alert',{staticClass:"gl-text-center gl-border-t gl-p-4 gl-text-gray-700 gl-bg-gray-50 legal-warning gl-max-w-full",attrs:{"dismissible":false,"variant":"tip","show-icon":false,"role":"alert","data-testid":"chat-legal-warning"}},[_vm._v(_vm._s(_vm.$options.i18n.CHAT_LEGAL_GENERATED_BY_AI))]),_vm._v(" "),_vm._t("subheader"),_vm._v(" "),(_vm.error)?_c('gl-alert',{key:"error",staticClass:"gl-pl-9!",attrs:{"dismissible":false,"variant":"danger","role":"alert","data-testid":"chat-error"}},[_c('span',{directives:[{name:"safe-html",rawName:"v-safe-html",value:(_vm.error),expression:"error"}]})]):_vm._e()],2):_vm._e(),_vm._v(" "),_c('div',{staticClass:"gl-drawer-body",attrs:{"data-testid":"chat-history"},on:{"scroll":_vm.handleScrollingTrottled}},[_c('transition-group',{staticClass:"duo-chat-history gl-display-flex gl-flex-direction-column gl-justify-content-end gl-bg-gray-10",class:[
346
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (!_vm.isHidden)?_c('aside',{staticClass:"markdown-code-block gl-drawer gl-max-h-full gl-bottom-0 gl-shadow-none gl-border-l gl-border-t duo-chat",attrs:{"id":"chat-component","role":"complementary","data-testid":"chat-component"}},[(_vm.showHeader)?_c('header',{staticClass:"gl-drawer-header gl-drawer-header-sticky gl-z-index-200 gl-p-0! gl-border-b-0",attrs:{"data-testid":"chat-header"}},[_c('div',{staticClass:"drawer-title gl-display-flex gl-justify-content-start gl-align-items-center gl-p-5"},[_c('h3',{staticClass:"gl-my-0 gl-font-size-h2"},[_vm._v(_vm._s(_vm.title))]),_vm._v(" "),_c('gl-experiment-badge',{attrs:{"help-page-url":_vm.badgeHelpPageUrl,"type":_vm.badgeType,"container-id":"chat-component"}}),_vm._v(" "),_c('gl-button',{staticClass:"gl-p-0! gl-ml-auto",attrs:{"category":"tertiary","variant":"default","icon":"close","size":"small","data-testid":"chat-close-button","aria-label":_vm.$options.i18n.CHAT_CLOSE_LABEL},on:{"click":_vm.hideChat}})],1),_vm._v(" "),_c('gl-alert',{staticClass:"gl-text-center gl-border-t gl-p-4 gl-text-gray-700 gl-bg-gray-50 legal-warning gl-max-w-full",attrs:{"dismissible":false,"variant":"tip","show-icon":false,"role":"alert","data-testid":"chat-legal-warning"}},[_vm._v(_vm._s(_vm.$options.i18n.CHAT_LEGAL_GENERATED_BY_AI))]),_vm._v(" "),_vm._t("subheader"),_vm._v(" "),(_vm.error)?_c('gl-alert',{key:"error",staticClass:"gl-pl-9!",attrs:{"dismissible":false,"variant":"danger","role":"alert","data-testid":"chat-error"}},[_c('span',{directives:[{name:"safe-html",rawName:"v-safe-html",value:(_vm.error),expression:"error"}]})]):_vm._e()],2):_vm._e(),_vm._v(" "),_c('div',{staticClass:"gl-drawer-body",attrs:{"data-testid":"chat-history"},on:{"scroll":_vm.handleScrollingTrottled}},[_c('transition-group',{staticClass:"duo-chat-history gl-display-flex gl-flex-direction-column gl-justify-content-end gl-bg-gray-10",class:[
347
347
  {
348
348
  'gl-h-full': !_vm.hasMessages,
349
349
  'force-scroll-bar': _vm.hasMessages,