@gitlab/ui 87.1.2 → 87.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 (29) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/components/experimental/duo/workflow/components/duo_workflow_panel/duo_workflow_panel.js +100 -0
  3. package/dist/components/experimental/duo/workflow/components/duo_workflow_prompt/duo_workflow_prompt.js +238 -0
  4. package/dist/index.css.map +1 -1
  5. package/dist/index.js +2 -0
  6. package/dist/tailwind.css +1 -1
  7. package/dist/tailwind.css.map +1 -1
  8. package/package.json +1 -1
  9. package/src/components/base/avatar/avatar.scss +2 -2
  10. package/src/components/base/broadcast_message/broadcast_message.scss +2 -2
  11. package/src/components/base/button/button.scss +1 -1
  12. package/src/components/base/card/card.scss +1 -1
  13. package/src/components/base/datepicker/datepicker.scss +3 -3
  14. package/src/components/base/dropdown/dropdown.scss +2 -2
  15. package/src/components/base/filtered_search/filtered_search.scss +1 -1
  16. package/src/components/base/markdown/markdown.scss +3 -3
  17. package/src/components/base/modal/modal.scss +1 -1
  18. package/src/components/base/new_dropdowns/dropdown_item.scss +2 -2
  19. package/src/components/base/segmented_control/segmented_control.scss +1 -1
  20. package/src/components/base/toast/toast.scss +1 -1
  21. package/src/components/base/tooltip/tooltip.scss +1 -1
  22. package/src/components/charts/single_stat/single_stat.scss +1 -1
  23. package/src/components/experimental/duo/chat/duo_chat.scss +1 -1
  24. package/src/components/experimental/duo/workflow/components/duo_workflow_panel/duo_workflow_panel.md +29 -0
  25. package/src/components/experimental/duo/workflow/components/duo_workflow_panel/duo_workflow_panel.vue +87 -0
  26. package/src/components/experimental/duo/workflow/components/duo_workflow_prompt/duo_workflow_prompt.md +37 -0
  27. package/src/components/experimental/duo/workflow/components/duo_workflow_prompt/duo_workflow_prompt.vue +261 -0
  28. package/src/index.js +2 -0
  29. package/translations.js +12 -0
@@ -0,0 +1,261 @@
1
+ <script>
2
+ import GlDuoWorkflowPanel from '../duo_workflow_panel/duo_workflow_panel.vue';
3
+ import GlButton from '../../../../../base/button/button.vue';
4
+ import GlFormGroup from '../../../../../base/form/form_group/form_group.vue';
5
+ import GlFormTextarea from '../../../../../base/form/form_textarea/form_textarea.vue';
6
+ import GlFormInput from '../../../../../base/form/form_input/form_input.vue';
7
+ import { translate } from '../../../../../../utils/i18n';
8
+
9
+ export default {
10
+ name: 'GlDuoWorkflowPrompt',
11
+ components: {
12
+ GlDuoWorkflowPanel,
13
+ GlButton,
14
+ GlFormGroup,
15
+ GlFormInput,
16
+ GlFormTextarea,
17
+ },
18
+ props: {
19
+ /**
20
+ * The prompt the user has entered
21
+ */
22
+ prompt: {
23
+ type: String,
24
+ required: false,
25
+ default: '',
26
+ },
27
+ /**
28
+ * The image to run the workflow in
29
+ */
30
+ image: {
31
+ type: String,
32
+ required: false,
33
+ default: '',
34
+ },
35
+ /**
36
+ * The text for the title of the panel
37
+ */
38
+ title: {
39
+ type: String,
40
+ required: false,
41
+ default: translate('GlDuoWorkflowPrompt.title', 'Goal'),
42
+ },
43
+ /**
44
+ * The summary of the ongoing workflow plan
45
+ */
46
+ summary: {
47
+ type: String,
48
+ required: false,
49
+ default: '',
50
+ },
51
+ /**
52
+ * Whether or not the panel is loading
53
+ */
54
+ loading: {
55
+ type: Boolean,
56
+ required: false,
57
+ default: false,
58
+ },
59
+ /**
60
+ * The label of the prompt text area
61
+ *
62
+ * See `GlFormGroup` for text placement.
63
+ */
64
+ promptLabel: {
65
+ type: String,
66
+ required: false,
67
+ default: translate('GlDuoWorkflowPrompt.promptLabel', 'Description'),
68
+ },
69
+ /**
70
+ * The label description of the prompt text area
71
+ *
72
+ * See `GlFormGroup` for text placement.
73
+ */
74
+ promptLabelDescription: {
75
+ type: String,
76
+ required: false,
77
+ default: translate(
78
+ 'GlDuoWorkflowPrompt.promptLabelDescription',
79
+ 'What would you like to do and how.'
80
+ ),
81
+ },
82
+ /**
83
+ * The description of the prompt text area
84
+ *
85
+ * See `GlFormGroup` for text placement.
86
+ */
87
+ promptDescription: {
88
+ type: String,
89
+ required: false,
90
+ default: translate(
91
+ 'GlDuoWorkflowPrompt.promptDescription',
92
+ 'Be specific and include any requirements.'
93
+ ),
94
+ },
95
+
96
+ /**
97
+ * The HTML ID of the textarea for the prompt
98
+ */
99
+ promptId: {
100
+ type: String,
101
+ required: false,
102
+ default: 'duo-workflow-prompt',
103
+ },
104
+ /**
105
+ * The label of the image input
106
+ */
107
+ imageLabel: {
108
+ type: String,
109
+ required: false,
110
+ default: translate('GlDuoWorkflowPrompt.imageLabel', 'Image'),
111
+ },
112
+ /**
113
+ * The label description of the image input
114
+ *
115
+ * See `GlFormGroup` for text placement.
116
+ */
117
+ imageLabelDescription: {
118
+ type: String,
119
+ required: false,
120
+ default: translate(
121
+ 'GlDuoWorkflowPrompt.imageLabelDescription',
122
+ 'The container image to run the workflow in.'
123
+ ),
124
+ },
125
+ /**
126
+ * The description of the image input
127
+ *
128
+ * See `GlFormGroup` for text placement.
129
+ */
130
+ imageDescription: {
131
+ type: String,
132
+ required: false,
133
+ default: translate(
134
+ 'GlDuoWorkflowPrompt.imageDescription',
135
+ 'It should have any tools necessary for the workflow installed.'
136
+ ),
137
+ },
138
+ /**
139
+ * The ID of the image input
140
+ */
141
+ imageId: {
142
+ type: String,
143
+ required: false,
144
+ default: 'duo-workflow-image',
145
+ },
146
+ /**
147
+ * The text for the confirmation button. This button emits a `confirm` event.
148
+ */
149
+ confirmButtonText: {
150
+ type: String,
151
+ required: false,
152
+ default: translate('GlDuoWorkflowPrompt.confirmButtonText', 'Generate plan'),
153
+ },
154
+ /**
155
+ * The text for the cancellation button. This button emits a `cancel` event.
156
+ */
157
+ cancelButtonText: {
158
+ type: String,
159
+ required: false,
160
+ default: translate('GlDuoWorkflowPrompt.cancelButtonText', 'Cancel'),
161
+ },
162
+ /**
163
+ * The text used as the title and aria-label for the button when the collapse is collapsed
164
+ *
165
+ * See `GlDuoWorkflowPanel`
166
+ */
167
+ expandPanelButtonTitle: {
168
+ type: String,
169
+ required: false,
170
+ default: '',
171
+ },
172
+ /**
173
+ * The text used as the title and aria-label for the button when the collapse is expanded
174
+ *
175
+ * See `GlDuoWorkflowPanel`
176
+ */
177
+ collapsePanelButtonTitle: {
178
+ type: String,
179
+ required: false,
180
+ default: '',
181
+ },
182
+ },
183
+ methods: {
184
+ emitChange(prompt) {
185
+ /**
186
+ * Notify listeners about prompt change
187
+ * @param {string} prompt The newly entered prompt
188
+ */
189
+ this.$emit('update:prompt', prompt);
190
+ },
191
+ emitImage(image) {
192
+ /**
193
+ * Notify listeners about image change
194
+ * @param {string} image The newly entered image
195
+ */
196
+ this.$emit('update:image', image);
197
+ },
198
+ clickConfirm(event) {
199
+ /**
200
+ * Notify listeners about prompt submission
201
+ * @param {*} event A click event
202
+ */
203
+ this.$emit('confirm', event);
204
+ },
205
+ clickCancel(event) {
206
+ /**
207
+ * Notify listeners about prompt submission cancellation.
208
+ * @param {*} event A click event
209
+ */
210
+ this.$emit('cancel', event);
211
+ },
212
+ },
213
+ };
214
+ </script>
215
+
216
+ <template>
217
+ <gl-duo-workflow-panel
218
+ header-icon="issue-type-objective"
219
+ :expand-panel-button-title="expandPanelButtonTitle"
220
+ :collapse-panel-button-title="collapsePanelButtonTitle"
221
+ >
222
+ <template #title>{{ title }}</template>
223
+ <template #subtitle>{{ summary }}</template>
224
+ <template #content>
225
+ <gl-form-group
226
+ :label="promptLabel"
227
+ :label-for="promptId"
228
+ :label-description="promptLabelDescription"
229
+ :description="promptDescription"
230
+ >
231
+ <gl-form-textarea
232
+ :id="promptId"
233
+ :value="prompt"
234
+ :disable="loading"
235
+ :no-resize="false"
236
+ @input="emitChange"
237
+ />
238
+ </gl-form-group>
239
+ <gl-form-group
240
+ :label="imageLabel"
241
+ :label-for="imageId"
242
+ :label-description="imageLabelDescription"
243
+ :description="imageDescription"
244
+ >
245
+ <gl-form-input :id="imageId" :value="image" :disable="loading" @input="emitImage" />
246
+ </gl-form-group>
247
+ <div class="gl-flex gl-gap-3">
248
+ <gl-button
249
+ variant="confirm"
250
+ data-test-id="duo-workflow-prompt-confirm"
251
+ :loading="loading"
252
+ @click="clickConfirm"
253
+ >{{ confirmButtonText }}</gl-button
254
+ >
255
+ <gl-button data-test-id="duo-workflow-prompt-cancel" @click="clickCancel">{{
256
+ cancelButtonText
257
+ }}</gl-button>
258
+ </div>
259
+ </template>
260
+ </gl-duo-workflow-panel>
261
+ </template>
package/src/index.js CHANGED
@@ -5,6 +5,8 @@
5
5
 
6
6
  // Components
7
7
  // ADD COMPONENT EXPORTS - needed for yarn generate:component. Do not remove
8
+ export { default as GlDuoWorkflowPrompt } from './components/experimental/duo/workflow/components/duo_workflow_prompt/duo_workflow_prompt.vue';
9
+ export { default as GlDuoWorkflowPanel } from './components/experimental/duo/workflow/components/duo_workflow_panel/duo_workflow_panel.vue';
8
10
  export { default as GlTableLite } from './components/base/table_lite/table_lite.vue';
9
11
  export { default as GlDropdownForm } from './components/base/dropdown/dropdown_form.vue';
10
12
  export { default as GlKeysetPagination } from './components/base/keyset_pagination/keyset_pagination.vue';
package/translations.js CHANGED
@@ -3,6 +3,18 @@ export default {
3
3
  'ClearIconButton.title': 'Clear',
4
4
  'GlBreadcrumb.showMoreLabel': 'Show more breadcrumbs',
5
5
  'GlCollapsibleListbox.srOnlyResultsLabel': null,
6
+ 'GlDuoWorkflowPanel.collapseButtonTitle': 'Collapse',
7
+ 'GlDuoWorkflowPanel.expandButtonTitle': 'Expand',
8
+ 'GlDuoWorkflowPrompt.cancelButtonText': 'Cancel',
9
+ 'GlDuoWorkflowPrompt.confirmButtonText': 'Generate plan',
10
+ 'GlDuoWorkflowPrompt.imageDescription':
11
+ 'It should have any tools necessary for the workflow installed.',
12
+ 'GlDuoWorkflowPrompt.imageLabel': 'Image',
13
+ 'GlDuoWorkflowPrompt.imageLabelDescription': 'The container image to run the workflow in.',
14
+ 'GlDuoWorkflowPrompt.promptDescription': 'Be specific and include any requirements.',
15
+ 'GlDuoWorkflowPrompt.promptLabel': 'Description',
16
+ 'GlDuoWorkflowPrompt.promptLabelDescription': 'What would you like to do and how.',
17
+ 'GlDuoWorkflowPrompt.title': 'Goal',
6
18
  'GlKeysetPagination.navigationLabel': 'Pagination',
7
19
  'GlKeysetPagination.nextText': 'Next',
8
20
  'GlKeysetPagination.prevText': 'Previous',