@gitlab/ui 93.0.0 → 93.2.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 (116) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/components/base/alert/alert.js +1 -0
  3. package/dist/components/base/avatar/avatar.js +7 -1
  4. package/dist/components/base/datepicker/datepicker.js +3 -1
  5. package/dist/components/base/drawer/drawer.js +1 -0
  6. package/dist/components/base/form/form_fields/form_fields.js +3 -2
  7. package/dist/components/base/form/form_input/form_input.js +7 -1
  8. package/dist/components/base/form/form_select/form_select.js +7 -1
  9. package/dist/components/base/toast/toast.js +1 -0
  10. package/dist/components/base/token/token.js +1 -0
  11. package/dist/components/experimental/duo/chat/components/duo_chat_conversation/duo_chat_conversation.js +2 -1
  12. package/dist/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.js +4 -3
  13. package/dist/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.js +8 -8
  14. package/dist/components/experimental/duo/chat/components/duo_chat_message_sources/duo_chat_message_sources.js +7 -4
  15. package/dist/components/experimental/duo/chat/duo_chat.js +13 -12
  16. package/dist/index.css +3 -3
  17. package/dist/index.css.map +1 -1
  18. package/dist/tokens/build/js/tokens.dark.js +2 -1
  19. package/dist/tokens/build/js/tokens.js +2 -1
  20. package/dist/tokens/css/tokens.css +1 -0
  21. package/dist/tokens/css/tokens.dark.css +1 -0
  22. package/dist/tokens/js/tokens.dark.js +1 -0
  23. package/dist/tokens/js/tokens.js +1 -0
  24. package/dist/tokens/json/tokens.dark.json +22 -0
  25. package/dist/tokens/json/tokens.json +22 -0
  26. package/dist/tokens/scss/_tokens.dark.scss +1 -0
  27. package/dist/tokens/scss/_tokens.scss +1 -0
  28. package/dist/tokens/scss/_tokens_custom_properties.scss +1 -0
  29. package/dist/tokens/tailwind/tokens.cjs +1 -0
  30. package/dist/utils/set_utils.js +25 -0
  31. package/package.json +1 -1
  32. package/src/components/base/accordion/accordion_item.scss +1 -1
  33. package/src/components/base/alert/alert.scss +8 -8
  34. package/src/components/base/alert/alert.vue +1 -0
  35. package/src/components/base/avatar/avatar.scss +6 -6
  36. package/src/components/base/avatar/avatar.vue +4 -0
  37. package/src/components/base/avatar_labeled/avatar_labeled.scss +9 -9
  38. package/src/components/base/avatar_link/avatar_link.scss +6 -6
  39. package/src/components/base/avatars_inline/avatars_inline.scss +9 -9
  40. package/src/components/base/badge/badge.scss +6 -6
  41. package/src/components/base/banner/banner.scss +1 -1
  42. package/src/components/base/breadcrumb/breadcrumb.scss +8 -8
  43. package/src/components/base/broadcast_message/broadcast_message.scss +9 -9
  44. package/src/components/base/button/button.scss +18 -18
  45. package/src/components/base/card/card.scss +4 -4
  46. package/src/components/base/datepicker/datepicker.scss +14 -14
  47. package/src/components/base/datepicker/datepicker.vue +1 -0
  48. package/src/components/base/daterange_picker/daterange_picker.scss +7 -7
  49. package/src/components/base/drawer/drawer.scss +14 -14
  50. package/src/components/base/drawer/drawer.vue +1 -0
  51. package/src/components/base/dropdown/dropdown.scss +15 -15
  52. package/src/components/base/dropdown/dropdown_item.scss +15 -15
  53. package/src/components/base/dropdown/dropdown_section_header.scss +4 -4
  54. package/src/components/base/filtered_search/filtered_search.scss +9 -9
  55. package/src/components/base/filtered_search/filtered_search_suggestion.scss +2 -2
  56. package/src/components/base/filtered_search/filtered_search_suggestion_list.scss +2 -2
  57. package/src/components/base/filtered_search/filtered_search_token.scss +9 -9
  58. package/src/components/base/filtered_search/filtered_search_token_segment.scss +3 -3
  59. package/src/components/base/form/form_checkbox/form_checkbox.scss +10 -10
  60. package/src/components/base/form/form_fields/form_fields.vue +3 -2
  61. package/src/components/base/form/form_group/form_group.scss +6 -6
  62. package/src/components/base/form/form_input/form_input.scss +2 -2
  63. package/src/components/base/form/form_input/form_input.vue +3 -0
  64. package/src/components/base/form/form_radio_group/form_radio_group.scss +2 -2
  65. package/src/components/base/form/form_select/form_select.scss +3 -3
  66. package/src/components/base/form/form_select/form_select.vue +3 -0
  67. package/src/components/base/infinite_scroll/infinite_scroll.scss +2 -2
  68. package/src/components/base/label/label.scss +12 -12
  69. package/src/components/base/link/link.scss +1 -1
  70. package/src/components/base/loading_icon/loading_icon.scss +4 -4
  71. package/src/components/base/markdown/markdown.scss +14 -14
  72. package/src/components/base/modal/modal.scss +12 -12
  73. package/src/components/base/new_dropdowns/dropdown.scss +21 -17
  74. package/src/components/base/new_dropdowns/dropdown_item.scss +10 -10
  75. package/src/components/base/new_dropdowns/listbox/listbox.scss +4 -4
  76. package/src/components/base/pagination/pagination.scss +5 -5
  77. package/src/components/base/path/path.scss +11 -11
  78. package/src/components/base/popover/popover.scss +1 -1
  79. package/src/components/base/search_box_by_click/search_box_by_click.scss +5 -5
  80. package/src/components/base/search_box_by_type/search_box_by_type.scss +9 -9
  81. package/src/components/base/segmented_control/segmented_control.scss +4 -4
  82. package/src/components/base/table/table.scss +6 -6
  83. package/src/components/base/tabs/tabs/tabs.scss +18 -18
  84. package/src/components/base/toast/toast.js +1 -0
  85. package/src/components/base/toast/toast.scss +10 -10
  86. package/src/components/base/toggle/toggle.scss +17 -17
  87. package/src/components/base/token/token.scss +13 -13
  88. package/src/components/base/token/token.vue +1 -0
  89. package/src/components/base/tooltip/tooltip.scss +3 -3
  90. package/src/components/charts/legend/legend.scss +17 -17
  91. package/src/components/charts/series_label/series_label.scss +6 -6
  92. package/src/components/charts/single_stat/single_stat.scss +1 -1
  93. package/src/components/experimental/duo/chat/components/duo_chat_conversation/duo_chat_conversation.md +10 -0
  94. package/src/components/experimental/duo/chat/components/duo_chat_conversation/duo_chat_conversation.vue +2 -1
  95. package/src/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.scss +1 -1
  96. package/src/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.vue +12 -3
  97. package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.scss +4 -4
  98. package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.vue +20 -9
  99. package/src/components/experimental/duo/chat/components/duo_chat_message_sources/duo_chat_message_sources.vue +5 -4
  100. package/src/components/experimental/duo/chat/duo_chat.scss +15 -15
  101. package/src/components/experimental/duo/chat/duo_chat.vue +43 -16
  102. package/src/components/shared_components/charts/tooltip_default_format.scss +5 -5
  103. package/src/scss/typescale/_index.scss +15 -15
  104. package/src/tokens/build/css/tokens.css +1 -0
  105. package/src/tokens/build/css/tokens.dark.css +1 -0
  106. package/src/tokens/build/js/tokens.dark.js +1 -0
  107. package/src/tokens/build/js/tokens.js +1 -0
  108. package/src/tokens/build/json/tokens.dark.json +22 -0
  109. package/src/tokens/build/json/tokens.json +22 -0
  110. package/src/tokens/build/scss/_tokens.dark.scss +1 -0
  111. package/src/tokens/build/scss/_tokens.scss +1 -0
  112. package/src/tokens/build/scss/_tokens_custom_properties.scss +1 -0
  113. package/src/tokens/build/tailwind/tokens.cjs +1 -0
  114. package/src/tokens/text.tokens.json +8 -0
  115. package/src/utils/set_utils.js +24 -0
  116. package/translations.js +33 -0
@@ -23,9 +23,9 @@ $toggle-translate-width: 2 * $grid-size;
23
23
  $toggle-height: 2.5 * $grid-size;
24
24
 
25
25
  .gl-toggle-wrapper {
26
- @include gl-line-height-normal;
27
- @include gl-font-weight-normal;
28
- @include gl-display-inline-flex;
26
+ @apply gl-leading-normal;
27
+ @apply gl-font-normal;
28
+ @apply gl-inline-flex;
29
29
 
30
30
  &.is-disabled {
31
31
  @include gl-cursor-not-allowed;
@@ -57,15 +57,15 @@ $toggle-height: 2.5 * $grid-size;
57
57
  .gl-help-label {
58
58
  @apply gl-mt-3;
59
59
  @include gl-text-gray-500;
60
- @include gl-font-weight-normal;
60
+ @apply gl-font-normal;
61
61
  }
62
62
 
63
63
  .gl-toggle-label-inline {
64
- @include gl-flex-direction-row;
65
- @include gl-align-items-center;
64
+ @apply gl-flex-row;
65
+ @apply gl-items-center;
66
66
 
67
67
  .gl-toggle-label {
68
- @include gl-white-space-nowrap;
68
+ @apply gl-whitespace-nowrap;
69
69
  @apply gl-mb-0;
70
70
  @apply gl-mr-3;
71
71
  }
@@ -77,13 +77,13 @@ $toggle-height: 2.5 * $grid-size;
77
77
  }
78
78
 
79
79
  .gl-toggle-label {
80
- @include gl-font-weight-bold;
80
+ @apply gl-font-bold;
81
81
  }
82
82
 
83
83
  .gl-toggle {
84
- @include gl-display-inline-flex;
85
- @include gl-align-items-center;
86
- @include gl-justify-content-center;
84
+ @apply gl-inline-flex;
85
+ @apply gl-items-center;
86
+ @apply gl-justify-center;
87
87
  @apply gl-border-0;
88
88
  @include gl-cursor-pointer;
89
89
  @include gl-bg-gray-600;
@@ -94,12 +94,12 @@ $toggle-height: 2.5 * $grid-size;
94
94
  user-select: none;
95
95
  @include gl-rounded-pill;
96
96
  @include gl-transition-slow;
97
- @include gl-line-height-normal;
97
+ @apply gl-leading-normal;
98
98
 
99
99
  &::selection,
100
100
  &::before::selection,
101
101
  &::after::selection {
102
- @include gl-bg-none;
102
+ @apply gl-bg-transparent;
103
103
  }
104
104
 
105
105
  &:hover,
@@ -123,12 +123,12 @@ $toggle-height: 2.5 * $grid-size;
123
123
  @include gl-rounded-full;
124
124
  @include gl-bg-white;
125
125
  position: absolute;
126
- @include gl-display-inline-flex;
127
- @include gl-align-items-center;
126
+ @apply gl-inline-flex;
127
+ @apply gl-items-center;
128
128
  left: $gl-spacing-scale-1;
129
129
  top: $gl-spacing-scale-1;
130
- @include gl-transition-medium;
131
- @include gl-justify-content-center;
130
+ @apply gl-transition-all;
131
+ @apply gl-justify-center;
132
132
  @apply gl-p-1;
133
133
 
134
134
  > svg {
@@ -3,9 +3,9 @@
3
3
  @include gl-bg-gray-100;
4
4
  @include gl-rounded-small;
5
5
  @apply gl-pl-3;
6
- @include gl-display-inline-flex;
7
- @include gl-flex-direction-column;
8
- @include gl-justify-content-center;
6
+ @apply gl-inline-flex;
7
+ @apply gl-flex-col;
8
+ @apply gl-justify-center;
9
9
 
10
10
  &.gl-token-view-only {
11
11
  @apply gl-py-2;
@@ -15,21 +15,21 @@
15
15
 
16
16
  .gl-token-search-type-variant {
17
17
  @include gl-bg-gray-100;
18
- @include gl-rounded-top-right-none;
19
- @include gl-rounded-bottom-right-none;
18
+ @apply gl-rounded-tr-none;
19
+ @apply gl-rounded-br-none;
20
20
  }
21
21
 
22
22
  .gl-token-search-value-variant {
23
- @include gl-rounded-top-left-none;
24
- @include gl-rounded-bottom-left-none;
23
+ @apply gl-rounded-tl-none;
24
+ @apply gl-rounded-bl-none;
25
25
  }
26
26
 
27
27
  .gl-token-content {
28
- @include gl-font-sm;
29
- @include gl-line-height-normal;
30
- @include gl-display-flex;
31
- @include gl-align-items-center;
32
- @include gl-reset-color;
28
+ @apply gl-text-sm;
29
+ @apply gl-leading-normal;
30
+ @apply gl-flex;
31
+ @apply gl-items-center;
32
+ @apply gl-text-inherit;
33
33
 
34
34
  > .gl-avatar:first-child,
35
35
  > .gl-spinner-container:first-child {
@@ -39,7 +39,7 @@
39
39
 
40
40
  .gl-token-close {
41
41
  @apply gl-ml-2;
42
- @include gl-reset-color;
42
+ @apply gl-text-inherit;
43
43
  @include gl-cursor-pointer;
44
44
 
45
45
  opacity: 0.8;
@@ -35,6 +35,7 @@ export default {
35
35
  },
36
36
  computed: {
37
37
  variantClass() {
38
+ // eslint-disable-next-line @gitlab/tailwind -- Not a CSS utility
38
39
  return `gl-token-${this.variant}-variant`;
39
40
  },
40
41
  viewOnlyClass() {
@@ -1,11 +1,11 @@
1
1
  .gl-tooltip {
2
- @include gl-font-sm;
2
+ @apply gl-text-sm;
3
3
  @apply gl-p-2;
4
4
 
5
5
  .tooltip-inner {
6
6
  @apply gl-rounded-base;
7
- @include gl-line-height-normal;
8
- @include gl-font-weight-normal;
7
+ @apply gl-leading-normal;
8
+ @apply gl-font-normal;
9
9
  @apply gl-py-3;
10
10
  @apply gl-px-4;
11
11
  background: var(--gl-feedback-strong-background-color);
@@ -20,7 +20,7 @@ $legend-body-h: $gl-spacing-scale-13 - $gl-spacing-scale-4;
20
20
  background-image: linear-gradient(to bottom, $transparent-rgba, var(--white, #{$white}));
21
21
  bottom: 0;
22
22
  content: '';
23
- @include gl-display-block;
23
+ @apply gl-block;
24
24
  @include gl-h-4;
25
25
  position: absolute;
26
26
  @include gl-w-full;
@@ -28,20 +28,20 @@ $legend-body-h: $gl-spacing-scale-13 - $gl-spacing-scale-4;
28
28
  }
29
29
 
30
30
  .gl-legend-inline {
31
- @include gl-display-flex;
31
+ @apply gl-flex;
32
32
  @include gl-flex-wrap;
33
- @include gl-flex-shrink-0;
33
+ @apply gl-shrink-0;
34
34
 
35
35
  .gl-legend-inline-series {
36
- @include gl-display-flex;
37
- @include gl-flex-shrink-0;
38
- @include gl-justify-content-space-between;
39
- @include gl-align-items-center;
36
+ @apply gl-flex;
37
+ @apply gl-shrink-0;
38
+ @apply gl-justify-between;
39
+ @apply gl-items-center;
40
40
  @apply gl-pr-5;
41
41
 
42
42
  &:hover {
43
43
  @include gl-cursor-pointer;
44
- @include gl-text-decoration-underline;
44
+ @apply gl-underline;
45
45
  }
46
46
 
47
47
  .gl-legend-inline-series-label {
@@ -52,22 +52,22 @@ $legend-body-h: $gl-spacing-scale-13 - $gl-spacing-scale-4;
52
52
 
53
53
  .gl-legend-tabular {
54
54
  .gl-legend-tabular-header {
55
- @include gl-display-flex;
56
- @include gl-justify-content-end;
55
+ @apply gl-flex;
56
+ @apply gl-justify-end;
57
57
  }
58
58
 
59
59
  .gl-legend-tabular-header-cell,
60
60
  .gl-legend-tabular-details-cell {
61
- @include gl-white-space-nowrap;
61
+ @apply gl-whitespace-nowrap;
62
62
  @include gl-overflow-hidden;
63
- @include gl-text-overflow-ellipsis;
63
+ @apply gl-text-ellipsis;
64
64
  @include gl-text-right;
65
65
  @include gl-w-eighth;
66
66
  }
67
67
 
68
68
  .gl-legend-tabular-header-cell {
69
- @include gl-font-weight-bold;
70
- @include gl-line-height-24;
69
+ @apply gl-font-bold;
70
+ @apply gl-leading-24;
71
71
  @apply gl-px-3;
72
72
  }
73
73
 
@@ -77,7 +77,7 @@ $legend-body-h: $gl-spacing-scale-13 - $gl-spacing-scale-4;
77
77
  }
78
78
 
79
79
  .gl-legend-tabular-row {
80
- @include gl-display-flex;
80
+ @apply gl-flex;
81
81
 
82
82
  &:nth-child(odd) {
83
83
  background-color: var(--gray-50, #{$gray-50});
@@ -86,12 +86,12 @@ $legend-body-h: $gl-spacing-scale-13 - $gl-spacing-scale-4;
86
86
 
87
87
  .gl-legend-tabular-title-cell,
88
88
  .gl-legend-tabular-details-cell {
89
- @include gl-line-height-24;
89
+ @apply gl-leading-24;
90
90
  @apply gl-px-3;
91
91
  }
92
92
 
93
93
  .gl-legend-tabular-title-cell {
94
94
  @include gl-overflow-hidden;
95
- @include gl-w-half;
95
+ @apply gl-w-1/2;
96
96
  }
97
97
  }
@@ -1,16 +1,16 @@
1
1
  .gl-series-label-container {
2
- @include gl-display-flex;
3
- @include gl-font-base;
2
+ @apply gl-flex;
3
+ @apply gl-text-base;
4
4
  @include gl-overflow-hidden;
5
- @include gl-overflow-wrap-break;
5
+ @apply gl-break-words;
6
6
  }
7
7
 
8
8
  .gl-series-label-color {
9
- @include gl-flex-shrink-0;
9
+ @apply gl-shrink-0;
10
10
  @apply gl-mr-3;
11
11
 
12
12
  svg {
13
- @include gl-display-block;
13
+ @apply gl-block;
14
14
  }
15
15
  }
16
16
 
@@ -19,5 +19,5 @@
19
19
  // as there are quite a few possible cases where
20
20
  // Prometheus queries return long labels with no spaces.
21
21
  @include gl-overflow-hidden;
22
- @include gl-overflow-wrap-break;
22
+ @apply gl-break-words;
23
23
  }
@@ -1,5 +1,5 @@
1
1
  .gl-single-stat {
2
- @include gl-line-height-1;
2
+ @apply gl-leading-1;
3
3
 
4
4
  &:hover[tabindex='0'] {
5
5
  @include gl-bg-gray-50;
@@ -6,3 +6,13 @@ mark the beginning of the conversation.
6
6
  ```html
7
7
  <gl-duo-chat-conversation :messages="messages" :show-delimeter="showDelimiter" />
8
8
  ```
9
+
10
+ Translations for newChatLabel can be set via the props as documented or via translation configuration:
11
+
12
+ ```js
13
+ setConfigs({
14
+ translations: {
15
+ 'GlDuoWorkflowPrompt.newChat': __('New chat'),
16
+ },
17
+ });
18
+ ```
@@ -1,8 +1,9 @@
1
1
  <script>
2
2
  import GlDuoChatMessage from '../duo_chat_message/duo_chat_message.vue';
3
+ import { translate } from '../../../../../../utils/i18n';
3
4
 
4
5
  const i18n = {
5
- CONVERSATION_NEW_CHAT: 'New chat',
6
+ CONVERSATION_NEW_CHAT: translate('GlDuoChatConversation.newChat', 'New chat'),
6
7
  };
7
8
 
8
9
  const isMessage = (item) => Boolean(item) && item?.role;
@@ -1,5 +1,5 @@
1
1
  .duo-chat-loader {
2
- @include gl-display-flex;
2
+ @apply gl-flex;
3
3
  @include gl-text-gray-500;
4
4
 
5
5
  .transition {
@@ -1,11 +1,20 @@
1
1
  <script>
2
+ import { translate } from '../../../../../../utils/i18n';
2
3
  import GlSprintf from '../../../../../utilities/sprintf/sprintf.vue';
3
4
  import { LOADING_TRANSITION_DURATION } from '../../constants';
4
5
 
5
6
  export const i18n = {
6
- LOADER_LOADING_MESSAGE: '%{tool} is %{transition} an answer',
7
- LOADER_LOADING_TRANSITIONS: ['finding', 'working on', 'generating', 'producing'],
8
- GITLAB_DUO: 'GitLab Duo',
7
+ LOADER_LOADING_MESSAGE: translate(
8
+ 'GlDuoChatLoader.loaderLoadingMessage',
9
+ '%{tool} is %{transition} an answer'
10
+ ),
11
+ LOADER_LOADING_TRANSITIONS: [
12
+ translate('GlDuoChatLoader.loaderLoadingTransitionsFinding', 'finding'),
13
+ translate('GlDuoChatLoader.loaderLoadingTransitionsWorkingOn', 'working on'),
14
+ translate('GlDuoChatLoader.loaderLoadingTransitionsGenerating', 'generating'),
15
+ translate('GlDuoChatLoader.loaderLoadingTransitionsProducing', 'producing'),
16
+ ],
17
+ GITLAB_DUO: translate('GlDuoChatLoader.gitlabDuo', 'GitLab Duo'),
9
18
  };
10
19
 
11
20
  export default {
@@ -7,13 +7,13 @@
7
7
  }
8
8
 
9
9
  pre {
10
- @include gl-reset-color;
10
+ @apply gl-text-inherit;
11
11
  padding: $gl-spacing-scale-3 $gl-spacing-scale-4;
12
12
  }
13
13
 
14
14
  pre code {
15
- @include gl-font-sm;
16
- @include gl-line-height-1;
15
+ @apply gl-text-sm;
16
+ @apply gl-leading-1;
17
17
  @include gl-bg-transparent;
18
18
  white-space: inherit;
19
19
  }
@@ -25,7 +25,7 @@
25
25
  copy-code,
26
26
  insert-code-snippet {
27
27
  position: absolute;
28
- @include gl-transition-medium;
28
+ @apply gl-transition-all;
29
29
  @include gl-opacity-0;
30
30
  right: $gl-spacing-scale-3;
31
31
  top: $gl-spacing-scale-3;
@@ -7,8 +7,8 @@ import GlDuoUserFeedback from '../../../user_feedback/user_feedback.vue';
7
7
  import GlFormGroup from '../../../../../base/form/form_group/form_group.vue';
8
8
  import GlFormTextarea from '../../../../../base/form/form_textarea/form_textarea.vue';
9
9
  import { SafeHtmlDirective as SafeHtml } from '../../../../../../directives/safe_html/safe_html';
10
- import { sprintf, translatePlural } from '../../../../../../utils/i18n';
11
10
  import { MESSAGE_MODEL_ROLES, SELECTED_CONTEXT_ITEMS_DEFAULT_COLLAPSED } from '../../constants';
11
+ import { sprintf, translate, translatePlural } from '../../../../../../utils/i18n';
12
12
  import DocumentationSources from '../duo_chat_message_sources/duo_chat_message_sources.vue';
13
13
  // eslint-disable-next-line no-restricted-imports
14
14
  import { renderDuoChatMarkdownPreview } from '../../markdown_renderer';
@@ -18,14 +18,25 @@ import { concatUntilEmpty } from './utils';
18
18
 
19
19
  export const i18n = {
20
20
  MODAL: {
21
- TITLE: 'Give feedback on GitLab Duo Chat',
22
- ALERT_TEXT:
23
- 'GitLab team members cannot view your conversation. Please be as descriptive as possible.',
24
- DID_WHAT: 'What were you doing?',
25
- INTERACTION: 'The situation in which you interacted with GitLab Duo Chat.',
26
- IMPROVE_WHAT: 'How could the response be improved?',
27
- BETTER_RESPONSE: 'How the response might better meet your needs.',
28
- MESSAGE_ERROR: 'Error sending the message',
21
+ TITLE: translate('GlDuoChatMessage.modalTitle', 'Give feedback on GitLab Duo Chat'),
22
+ ALERT_TEXT: translate(
23
+ 'GlDuoChatMessage.modalAlertText',
24
+ 'GitLab team members cannot view your conversation. Please be as descriptive as possible.'
25
+ ),
26
+ DID_WHAT: translate('GlDuoChatMessage.modalDidWhat', 'What were you doing?'),
27
+ INTERACTION: translate(
28
+ 'GlDuoChatMessage.modalInteraction',
29
+ 'The situation in which you interacted with GitLab Duo Chat.'
30
+ ),
31
+ IMPROVE_WHAT: translate(
32
+ 'GlDuoChatMessage.modalImproveWhat',
33
+ 'How could the response be improved?'
34
+ ),
35
+ BETTER_RESPONSE: translate(
36
+ 'GlDuoChatMessage.modalBetterResponse',
37
+ 'How the response might better meet your needs.'
38
+ ),
39
+ MESSAGE_ERROR: translate('GlDuoChatMessage.modalMessageError', 'Error sending the message'),
29
40
  },
30
41
  };
31
42
 
@@ -1,11 +1,12 @@
1
1
  <script>
2
+ import { translatePlural } from '../../../../../../utils/i18n';
2
3
  import GlIcon from '../../../../../base/icon/icon.vue';
3
4
  import GlLink from '../../../../../base/link/link.vue';
4
5
  import { DOCUMENTATION_SOURCE_TYPES } from '../../constants';
5
6
 
6
7
  export const i18n = {
7
- MESSAGE_SOURCE: 'Source',
8
- MESSAGE_SOURCES: 'Sources',
8
+ MESSAGE_SOURCE: (count = 1) =>
9
+ translatePlural('GlDuoChatMessageSources.messageSources', 'Source', 'Sources')(count),
9
10
  };
10
11
 
11
12
  export default {
@@ -25,7 +26,7 @@ export default {
25
26
  },
26
27
  computed: {
27
28
  sourceLabel() {
28
- return this.sources.length > 1 ? i18n.MESSAGE_SOURCES : i18n.MESSAGE_SOURCES;
29
+ return i18n.MESSAGE_SOURCE(this.sources.length);
29
30
  },
30
31
  },
31
32
  methods: {
@@ -53,7 +54,7 @@ export default {
53
54
  }
54
55
  }
55
56
 
56
- return i18n.MESSAGE_SOURCE;
57
+ return this.sourceLabel;
57
58
  },
58
59
  },
59
60
  };
@@ -37,16 +37,16 @@ $duo-chat-scrim-gradient: linear-gradient(to bottom, rgba($gray-10, 0), $gray-10
37
37
 
38
38
  .duo-chat-drawer {
39
39
  right: 0;
40
- @include gl-transition-medium;
40
+ @apply gl-transition-all;
41
41
  position: fixed;
42
42
  @include gl-h-full;
43
43
  @include gl-w-full;
44
44
  @include gl-overflow-y-auto;
45
45
  @include gl-shadow-lg;
46
- @include gl-font-base;
47
- @include gl-line-height-normal;
48
- @include gl-display-flex;
49
- @include gl-flex-direction-column;
46
+ @apply gl-text-base;
47
+ @apply gl-leading-normal;
48
+ @apply gl-flex;
49
+ @apply gl-flex-col;
50
50
  }
51
51
 
52
52
  .duo-chat-drawer-header {
@@ -60,7 +60,7 @@ $duo-chat-scrim-gradient: linear-gradient(to bottom, rgba($gray-10, 0), $gray-10
60
60
  }
61
61
 
62
62
  .duo-chat-drawer-body {
63
- @include gl-flex-grow-1;
63
+ @apply gl-grow;
64
64
  // prevent safari bug where box shadow is visible
65
65
  // above the drawer when hovering interactive elements
66
66
  // see https://gitlab.com/gitlab-org/gitlab/-/issues/366558
@@ -82,7 +82,7 @@ $duo-chat-scrim-gradient: linear-gradient(to bottom, rgba($gray-10, 0), $gray-10
82
82
  &::before {
83
83
  background: $duo-chat-scrim-gradient;
84
84
  top: -$gl-border-size-1;
85
- @include gl-translate-y-n100;
85
+ @apply -gl-translate-y-full;
86
86
  content: '';
87
87
  left: 0;
88
88
  position: absolute;
@@ -124,8 +124,8 @@ $duo-chat-scrim-gradient: linear-gradient(to bottom, rgba($gray-10, 0), $gray-10
124
124
  }
125
125
 
126
126
  .duo-chat-input {
127
- @include gl-display-flex;
128
- @include gl-flex-direction-column;
127
+ @apply gl-flex;
128
+ @apply gl-flex-col;
129
129
  max-height: 240px;
130
130
  overflow: hidden;
131
131
 
@@ -142,14 +142,14 @@ $duo-chat-scrim-gradient: linear-gradient(to bottom, rgba($gray-10, 0), $gray-10
142
142
 
143
143
  &::after {
144
144
  content: attr(data-value) ' ';
145
- @include gl-visibility-hidden;
146
- @include gl-white-space-pre-wrap;
145
+ @apply gl-invisible;
146
+ @apply gl-whitespace-pre-wrap;
147
147
  @apply gl-py-4;
148
148
  }
149
149
  }
150
150
 
151
151
  .slash-commands {
152
- @include gl-mt-n2;
152
+ @apply -gl-mt-2;
153
153
 
154
154
  .active-command {
155
155
  @include gl-bg-gray-50;
@@ -157,12 +157,12 @@ $duo-chat-scrim-gradient: linear-gradient(to bottom, rgba($gray-10, 0), $gray-10
157
157
  }
158
158
 
159
159
  .gl-dropdown-item button.dropdown-item {
160
- @include gl-font-sm;
160
+ @apply gl-text-sm;
161
161
  @apply gl-px-3;
162
- @include gl-bg-none;
162
+ @apply gl-bg-transparent;
163
163
 
164
164
  &:hover {
165
- @include gl-bg-none;
165
+ @apply gl-bg-transparent;
166
166
  }
167
167
  }
168
168
  }
@@ -12,6 +12,7 @@ import GlForm from '../../../base/form/form.vue';
12
12
  import GlExperimentBadge from '../../experiment_badge/experiment_badge.vue';
13
13
  import { badgeTypes, badgeTypeValidator } from '../../experiment_badge/constants';
14
14
  import { SafeHtmlDirective as SafeHtml } from '../../../../directives/safe_html/safe_html';
15
+ import { translate } from '../../../../utils/i18n';
15
16
  import GlDuoChatLoader from './components/duo_chat_loader/duo_chat_loader.vue';
16
17
  import GlDuoChatPredefinedPrompts from './components/duo_chat_predefined_prompts/duo_chat_predefined_prompts.vue';
17
18
  import GlDuoChatConversation from './components/duo_chat_conversation/duo_chat_conversation.vue';
@@ -25,23 +26,49 @@ import {
25
26
  import { INCLUDE_SLASH_COMMAND } from './mock_data';
26
27
 
27
28
  export const i18n = {
28
- CHAT_DEFAULT_TITLE: 'GitLab Duo Chat',
29
- CHAT_CLOSE_LABEL: 'Close the Code Explanation',
30
- CHAT_LEGAL_GENERATED_BY_AI: 'Responses generated by AI',
31
- CHAT_EMPTY_STATE_TITLE: 'Ask a question',
32
- CHAT_EMPTY_STATE_DESC: 'GitLab Duo Chat is your AI-powered assistant.',
33
- CHAT_EMPTY_STATE_SECONDARY_DESC: 'Responses may be inaccurate. Verify before use.',
34
- CHAT_PROMPT_PLACEHOLDER_DEFAULT: 'GitLab Duo Chat',
35
- CHAT_PROMPT_PLACEHOLDER_WITH_COMMANDS: 'Type "/" for slash commands',
36
- CHAT_SUBMIT_LABEL: 'Send chat message.',
37
- CHAT_CANCEL_LABEL: 'Cancel',
38
- CHAT_LEGAL_DISCLAIMER:
39
- "May provide inappropriate responses not representative of GitLab's views. Do not input personal data.",
29
+ CHAT_DEFAULT_TITLE: translate('GlDuoChat.chatDefaultTitle', 'GitLab Duo Chat'),
30
+ CHAT_CLOSE_LABEL: translate('GlDuoChat.chatCloseLabel', 'Close the Code Explanation'),
31
+ CHAT_LEGAL_GENERATED_BY_AI: translate(
32
+ 'GlDuoChat.chatLegalGeneratedByAI',
33
+ 'Responses generated by AI'
34
+ ),
35
+ CHAT_EMPTY_STATE_TITLE: translate('GlDuoChat.chatEmptyStateTitle', 'Ask a question'),
36
+ CHAT_EMPTY_STATE_DESC: translate(
37
+ 'GlDuoChat.chatEmptyStateDesc',
38
+ 'GitLab Duo Chat is your AI-powered assistant.'
39
+ ),
40
+ CHAT_EMPTY_STATE_SECONDARY_DESC: translate(
41
+ 'GlDuoChat.chatEmptyStateSecondaryDesc',
42
+ 'Responses may be inaccurate. Verify before use.'
43
+ ),
44
+ CHAT_PROMPT_PLACEHOLDER_DEFAULT: translate(
45
+ 'GlDuoChat.chatPromptPlaceholderDefault',
46
+ 'GitLab Duo Chat'
47
+ ),
48
+ CHAT_PROMPT_PLACEHOLDER_WITH_COMMANDS: translate(
49
+ 'GlDuoChat.chatPromptPlaceholderWithCommands',
50
+ 'Type "/" for slash commands'
51
+ ),
52
+ CHAT_SUBMIT_LABEL: translate('GlDuoChat.chatSubmitLabel', 'Send chat message.'),
53
+ CHAT_CANCEL_LABEL: translate('GlDuoChat.chatCancelLabel', 'Cancel'),
54
+ CHAT_LEGAL_DISCLAIMER: translate(
55
+ 'GlDuoChat.chatLegalDisclaimer',
56
+ "May provide inappropriate responses not representative of GitLab's views. Do not input personal data."
57
+ ),
40
58
  CHAT_DEFAULT_PREDEFINED_PROMPTS: [
41
- 'How do I change my password in GitLab?',
42
- 'How do I fork a project?',
43
- 'How do I clone a repository?',
44
- 'How do I create a template?',
59
+ translate(
60
+ 'GlDuoChat.chatDefaultPredefinedPromptsChangePassword',
61
+ 'How do I change my password in GitLab?'
62
+ ),
63
+ translate('GlDuoChat.chatDefaultPredefinedPromptsForkProject', 'How do I fork a project?'),
64
+ translate(
65
+ 'GlDuoChat.chatDefaultPredefinedPromptsCloneRepository',
66
+ 'How do I clone a repository?'
67
+ ),
68
+ translate(
69
+ 'GlDuoChat.chatDefaultPredefinedPromptsCreateTemplate',
70
+ 'How do I create a template?'
71
+ ),
45
72
  ],
46
73
  };
47
74
 
@@ -1,18 +1,18 @@
1
1
  .gl-charts-tooltip-default-format-series {
2
- @include gl-display-flex;
3
- @include gl-justify-content-space-between;
2
+ @apply gl-flex;
3
+ @apply gl-justify-between;
4
4
 
5
5
  &-label,
6
6
  &-value {
7
- @include gl-font-sm;
7
+ @apply gl-text-sm;
8
8
  }
9
9
 
10
10
  &-label {
11
- @include gl-line-height-normal;
11
+ @apply gl-leading-normal;
12
12
  @apply gl-mr-7;
13
13
  }
14
14
 
15
15
  &-value {
16
- @include gl-font-weight-bold;
16
+ @apply gl-font-bold;
17
17
  }
18
18
  }