@gitlab/ui 66.22.0 → 66.23.1

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,17 @@
1
+ ## [66.23.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v66.23.0...v66.23.1) (2023-10-04)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **GlCollapsibleListbox, GlDisclosureDropdown:** Update group border color ([6dc4bf2](https://gitlab.com/gitlab-org/gitlab-ui/commit/6dc4bf25af9fcd85f7de70f3919e5152b0979de0))
7
+
8
+ # [66.23.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v66.22.0...v66.23.0) (2023-10-03)
9
+
10
+
11
+ ### Features
12
+
13
+ * **GlDuoChatPredefinedPrompts:** new component ([c3e2347](https://gitlab.com/gitlab-org/gitlab-ui/commit/c3e234717b9c33ab8bb3d3f66e13387efe235fd7))
14
+
1
15
  # [66.22.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v66.21.0...v66.22.0) (2023-10-03)
2
16
 
3
17
 
@@ -5,8 +5,8 @@ import { DISCLOSURE_DROPDOWN_GROUP_BORDER_POSITIONS, DISCLOSURE_DROPDOWN_GROUP_N
5
5
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
6
6
 
7
7
  const BORDER_CLASSES = {
8
- [DISCLOSURE_DROPDOWN_GROUP_BORDER_POSITIONS.top]: 'gl-border-t gl-pt-2 gl-mt-2',
9
- [DISCLOSURE_DROPDOWN_GROUP_BORDER_POSITIONS.bottom]: 'gl-border-b gl-pb-2 gl-mb-2'
8
+ [DISCLOSURE_DROPDOWN_GROUP_BORDER_POSITIONS.top]: 'gl-border-t gl-border-t-gray-200 gl-pt-2 gl-mt-2',
9
+ [DISCLOSURE_DROPDOWN_GROUP_BORDER_POSITIONS.bottom]: 'gl-border-b gl-border-b-gray-200 gl-pb-2 gl-mb-2'
10
10
  };
11
11
  var script = {
12
12
  name: DISCLOSURE_DROPDOWN_GROUP_NAME,
@@ -18,7 +18,7 @@ import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
18
18
  //
19
19
  const ITEM_SELECTOR = '[role="option"]';
20
20
  const HEADER_ITEMS_BORDER_CLASSES = ['gl-border-b-1', 'gl-border-b-solid', 'gl-border-b-gray-200'];
21
- const GROUP_TOP_BORDER_CLASSES = ['gl-border-t', 'gl-pt-1', 'gl-mt-2'];
21
+ const GROUP_TOP_BORDER_CLASSES = ['gl-border-t', 'gl-border-t-gray-200', 'gl-pt-1', 'gl-mt-2'];
22
22
  const SEARCH_INPUT_SELECTOR = '.gl-listbox-search-input';
23
23
  var script = {
24
24
  name: 'GlCollapsibleListbox',
@@ -0,0 +1,64 @@
1
+ import { GlButton } from '../../../../../../index';
2
+ import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
3
+
4
+ var script = {
5
+ name: 'GlDuoChatPredefinedPrompts',
6
+ components: {
7
+ GlButton
8
+ },
9
+ props: {
10
+ /**
11
+ * Array of predefined prompts to display. Every prompt should be a string which will be converted into a prompt when clicked.
12
+ */
13
+ prompts: {
14
+ type: Array,
15
+ required: true
16
+ }
17
+ },
18
+ methods: {
19
+ handleClick(prompt) {
20
+ /**
21
+ * Emits the prompt string that was clicked.
22
+ */
23
+ this.$emit('click', prompt);
24
+ }
25
+ }
26
+ };
27
+
28
+ /* script */
29
+ const __vue_script__ = script;
30
+
31
+ /* template */
32
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-text-right"},_vm._l((_vm.prompts),function(prompt,index){return _c('div',{key:("question-" + index),staticClass:"gl-mt-3"},[_c('gl-button',{attrs:{"category":"secondary","variant":"confirm"},on:{"click":function($event){return _vm.handleClick(prompt)}}},[_c('span',{staticClass:"gl-white-space-normal"},[_vm._v(_vm._s(prompt))])])],1)}),0)};
33
+ var __vue_staticRenderFns__ = [];
34
+
35
+ /* style */
36
+ const __vue_inject_styles__ = undefined;
37
+ /* scoped */
38
+ const __vue_scope_id__ = undefined;
39
+ /* module identifier */
40
+ const __vue_module_identifier__ = undefined;
41
+ /* functional template */
42
+ const __vue_is_functional_template__ = false;
43
+ /* style inject */
44
+
45
+ /* style inject SSR */
46
+
47
+ /* style inject shadow dom */
48
+
49
+
50
+
51
+ const __vue_component__ = __vue_normalize__(
52
+ { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
53
+ __vue_inject_styles__,
54
+ __vue_script__,
55
+ __vue_scope_id__,
56
+ __vue_is_functional_template__,
57
+ __vue_module_identifier__,
58
+ false,
59
+ undefined,
60
+ undefined,
61
+ undefined
62
+ );
63
+
64
+ export default __vue_component__;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 03 Oct 2023 10:22:26 GMT
3
+ * Generated on Wed, 04 Oct 2023 09:48:50 GMT
4
4
  */
5
5
 
6
6
  :root {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 03 Oct 2023 10:22:26 GMT
3
+ * Generated on Wed, 04 Oct 2023 09:48:50 GMT
4
4
  */
5
5
 
6
6
  :root {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 03 Oct 2023 10:22:26 GMT
3
+ * Generated on Wed, 04 Oct 2023 09:48:50 GMT
4
4
  */
5
5
 
6
6
  export const BLACK = "#fff";
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 03 Oct 2023 10:22:26 GMT
3
+ * Generated on Wed, 04 Oct 2023 09:48:50 GMT
4
4
  */
5
5
 
6
6
  export const BLACK = "#000";
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Tue, 03 Oct 2023 10:22:26 GMT
3
+ // Generated on Wed, 04 Oct 2023 09:48:50 GMT
4
4
 
5
5
  $red-950: #fff4f3;
6
6
  $red-900: #fcf1ef;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Tue, 03 Oct 2023 10:22:26 GMT
3
+ // Generated on Wed, 04 Oct 2023 09:48:50 GMT
4
4
 
5
5
  $gl-line-height-52: 3.25rem;
6
6
  $gl-line-height-44: 2.75rem;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "66.22.0",
3
+ "version": "66.23.1",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -94,7 +94,7 @@
94
94
  "@gitlab/eslint-plugin": "19.0.0",
95
95
  "@gitlab/fonts": "^1.2.0",
96
96
  "@gitlab/stylelint-config": "5.0.0",
97
- "@gitlab/svgs": "3.63.0",
97
+ "@gitlab/svgs": "3.65.0",
98
98
  "@rollup/plugin-commonjs": "^11.1.0",
99
99
  "@rollup/plugin-node-resolve": "^7.1.3",
100
100
  "@rollup/plugin-replace": "^2.3.2",
@@ -8,8 +8,8 @@ import {
8
8
  } from './constants';
9
9
 
10
10
  export const BORDER_CLASSES = {
11
- [borderPositions.top]: 'gl-border-t gl-pt-2 gl-mt-2',
12
- [borderPositions.bottom]: 'gl-border-b gl-pb-2 gl-mb-2',
11
+ [borderPositions.top]: 'gl-border-t gl-border-t-gray-200 gl-pt-2 gl-mt-2',
12
+ [borderPositions.bottom]: 'gl-border-b gl-border-b-gray-200 gl-pb-2 gl-mb-2',
13
13
  };
14
14
 
15
15
  export default {
@@ -199,7 +199,7 @@ export const HeaderAndFooter = (args, { argTypes }) => ({
199
199
  template: template(
200
200
  `
201
201
  <template #footer>
202
- <div class="gl-border-t-solid gl-border-t-1 gl-border-t-gray-100 gl-display-flex gl-flex-direction-column gl-p-2! gl-pt-0!">
202
+ <div class="gl-border-t-solid gl-border-t-1 gl-border-t-gray-200 gl-display-flex gl-flex-direction-column gl-p-2! gl-pt-0!">
203
203
  <gl-button @click="selectAllItems" category="tertiary" block class="gl-justify-content-start! gl-mt-2!">
204
204
  Select all
205
205
  </gl-button>
@@ -33,7 +33,7 @@ import { isOption, itemsValidator, flattenedOptions } from './utils';
33
33
 
34
34
  export const ITEM_SELECTOR = '[role="option"]';
35
35
  const HEADER_ITEMS_BORDER_CLASSES = ['gl-border-b-1', 'gl-border-b-solid', 'gl-border-b-gray-200'];
36
- const GROUP_TOP_BORDER_CLASSES = ['gl-border-t', 'gl-pt-1', 'gl-mt-2'];
36
+ const GROUP_TOP_BORDER_CLASSES = ['gl-border-t', 'gl-border-t-gray-200', 'gl-pt-1', 'gl-mt-2'];
37
37
  export const SEARCH_INPUT_SELECTOR = '.gl-listbox-search-input';
38
38
 
39
39
  export default {
@@ -0,0 +1 @@
1
+ The component is a simple list of strings representing possible prompts to AI.
@@ -0,0 +1,35 @@
1
+ import { shallowMount } from '@vue/test-utils';
2
+ import { GlButton } from '../../../../../../index';
3
+ import GlDuoChatPredefinedPrompts from './duo_chat_predefined_prompts.vue';
4
+
5
+ describe('GlDuoChatPredefinedPrompts', () => {
6
+ let wrapper;
7
+ const predefinedPrompt1 = 'foo';
8
+ const predefinedPrompt2 = 'bar';
9
+
10
+ const createComponent = () => {
11
+ wrapper = shallowMount(GlDuoChatPredefinedPrompts, {
12
+ propsData: {
13
+ prompts: [predefinedPrompt1, predefinedPrompt2],
14
+ },
15
+ });
16
+ };
17
+
18
+ const findButtons = () => wrapper.findAllComponents(GlButton);
19
+
20
+ it('renders a button for each predefined prompt', () => {
21
+ createComponent();
22
+
23
+ expect(findButtons()).toHaveLength(2);
24
+ });
25
+
26
+ it('emits the click event when a button is clicked', () => {
27
+ createComponent();
28
+
29
+ findButtons().at(0).vm.$emit('click');
30
+ expect(wrapper.emitted('click')).toEqual([[predefinedPrompt1]]);
31
+
32
+ findButtons().at(1).vm.$emit('click');
33
+ expect(wrapper.emitted('click')).toEqual([[predefinedPrompt1], [predefinedPrompt2]]);
34
+ });
35
+ });
@@ -0,0 +1,36 @@
1
+ import GlDuoChatPredefinedPrompts from './duo_chat_predefined_prompts.vue';
2
+ import readme from './duo_chat_predefined_prompts.md';
3
+
4
+ const generateProps = ({ prompts = [] } = {}) => ({
5
+ prompts,
6
+ });
7
+
8
+ const Template = (args, { argTypes }) => ({
9
+ components: { GlDuoChatPredefinedPrompts },
10
+ props: Object.keys(argTypes),
11
+ template: `
12
+ <gl-duo-chat-predefined-prompts :prompts="prompts" />
13
+ `,
14
+ });
15
+
16
+ export const Default = Template.bind({});
17
+ Default.args = generateProps({
18
+ prompts: [
19
+ 'How do I change my password in GitLab?',
20
+ 'How do I fork a project?',
21
+ 'How do I clone a repository?',
22
+ 'How do I create a template?',
23
+ ],
24
+ });
25
+
26
+ export default {
27
+ title: 'experimental/duo/chat/duo_chat_predefined_prompts',
28
+ component: GlDuoChatPredefinedPrompts,
29
+ parameters: {
30
+ docs: {
31
+ description: {
32
+ component: readme,
33
+ },
34
+ },
35
+ },
36
+ };
@@ -0,0 +1,36 @@
1
+ <script>
2
+ import { GlButton } from '../../../../../../index';
3
+
4
+ export default {
5
+ name: 'GlDuoChatPredefinedPrompts',
6
+ components: {
7
+ GlButton,
8
+ },
9
+ props: {
10
+ /**
11
+ * Array of predefined prompts to display. Every prompt should be a string which will be converted into a prompt when clicked.
12
+ */
13
+ prompts: {
14
+ type: Array,
15
+ required: true,
16
+ },
17
+ },
18
+ methods: {
19
+ handleClick(prompt) {
20
+ /**
21
+ * Emits the prompt string that was clicked.
22
+ */
23
+ this.$emit('click', prompt);
24
+ },
25
+ },
26
+ };
27
+ </script>
28
+ <template>
29
+ <div class="gl-text-right">
30
+ <div v-for="(prompt, index) in prompts" :key="`question-${index}`" class="gl-mt-3">
31
+ <gl-button category="secondary" variant="confirm" @click="handleClick(prompt)"
32
+ ><span class="gl-white-space-normal">{{ prompt }}</span></gl-button
33
+ >
34
+ </div>
35
+ </div>
36
+ </template>