@gitlab/ui 32.64.0 → 32.64.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.
Files changed (37) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/components/base/paginated_list/paginated_list.documentation.js +2 -5
  3. package/dist/components/base/toast/toast.documentation.js +2 -5
  4. package/dist/utility_classes.css +1 -1
  5. package/dist/utility_classes.css.map +1 -1
  6. package/documentation/documented_stories.js +2 -0
  7. package/package.json +1 -1
  8. package/src/components/base/paginated_list/paginated_list.documentation.js +0 -2
  9. package/src/components/base/paginated_list/paginated_list.md +0 -2
  10. package/src/components/base/paginated_list/paginated_list.stories.js +162 -154
  11. package/src/components/base/toast/toast.documentation.js +0 -2
  12. package/src/components/base/toast/toast.md +0 -11
  13. package/src/components/base/toast/toast.stories.js +66 -50
  14. package/src/scss/utilities.scss +2 -2
  15. package/src/scss/utility-mixins/spacing.scss +1 -1
  16. package/dist/components/base/paginated_list/examples/index.js +0 -49
  17. package/dist/components/base/paginated_list/examples/paginated_list.basic.example.js +0 -51
  18. package/dist/components/base/paginated_list/examples/paginated_list.no_filter.example.js +0 -51
  19. package/dist/components/base/paginated_list/examples/paginated_list.with_empty_list.example.js +0 -38
  20. package/dist/components/base/paginated_list/examples/paginated_list.with_filter_function.example.js +0 -51
  21. package/dist/components/base/paginated_list/examples/paginated_list.with_header_slot.example.js +0 -51
  22. package/dist/components/base/paginated_list/examples/paginated_list.with_row_slot.example.js +0 -53
  23. package/dist/components/base/paginated_list/examples/paginated_list.with_subheader_slot.example.js +0 -51
  24. package/dist/components/base/toast/examples/index.js +0 -19
  25. package/dist/components/base/toast/examples/toast.action.example.js +0 -40
  26. package/dist/components/base/toast/examples/toast.default.example.js +0 -38
  27. package/src/components/base/paginated_list/examples/index.js +0 -57
  28. package/src/components/base/paginated_list/examples/paginated_list.basic.example.vue +0 -19
  29. package/src/components/base/paginated_list/examples/paginated_list.no_filter.example.vue +0 -20
  30. package/src/components/base/paginated_list/examples/paginated_list.with_empty_list.example.vue +0 -3
  31. package/src/components/base/paginated_list/examples/paginated_list.with_filter_function.example.vue +0 -20
  32. package/src/components/base/paginated_list/examples/paginated_list.with_header_slot.example.vue +0 -23
  33. package/src/components/base/paginated_list/examples/paginated_list.with_row_slot.example.vue +0 -25
  34. package/src/components/base/paginated_list/examples/paginated_list.with_subheader_slot.example.vue +0 -23
  35. package/src/components/base/toast/examples/index.js +0 -22
  36. package/src/components/base/toast/examples/toast.action.example.vue +0 -11
  37. package/src/components/base/toast/examples/toast.default.example.vue +0 -3
@@ -117,6 +117,8 @@ export const setupStorybookReadme = () =>
117
117
  'GlKeysetPagination',
118
118
  'GlForm',
119
119
  'GlTable',
120
+ 'GlToast',
121
+ 'GlPaginatedList',
120
122
  ],
121
123
  components: {
122
124
  GlComponentDocumentation,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "32.64.0",
3
+ "version": "32.64.1",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -1,7 +1,5 @@
1
- import examples from './examples';
2
1
  import description from './paginated_list.md';
3
2
 
4
3
  export default {
5
4
  description,
6
- examples,
7
5
  };
@@ -1,3 +1 @@
1
- ### Paginated list
2
-
3
1
  The paginated list component allows the easy creation of list with pagination and client side sorting.
@@ -1,14 +1,7 @@
1
- import { withKnobs, object, array, boolean, number, text } from '@storybook/addon-knobs';
2
- import { documentedStoriesOf } from '../../../../documentation/documented_stories';
3
1
  import { GlPaginatedList, GlButton } from '../../../../index';
4
2
  import readme from './paginated_list.md';
5
3
 
6
- const components = {
7
- GlPaginatedList,
8
- GlButton,
9
- };
10
-
11
- const list = [
4
+ const sampleList = [
12
5
  { id: 'foo' },
13
6
  { id: 'bar' },
14
7
  { id: 'baz' },
@@ -33,167 +26,182 @@ const template = `
33
26
  :page="page"
34
27
  :filterable="filterable"
35
28
  :filter="filter"
29
+ :item-key="itemKey"
36
30
  :emptyMessage="emptyMessage"
37
31
  :emptySearchMessage="emptySearchMessage"
38
32
  />
39
33
  `;
40
34
 
41
- const templateWithSubheader = `
42
- <gl-paginated-list
43
- :list="list"
44
- :perPage="perPage"
45
- :page="page"
46
- :filterable="filterable"
47
- :filter="filter"
48
- :emptyMessage="emptyMessage"
49
- :emptySearchMessage="emptySearchMessage"
50
- >
35
+ const generateProps = ({
36
+ list = [...sampleList],
37
+ perPage = 10,
38
+ page = 1,
39
+ filterable = true,
40
+ filter = 'id',
41
+ itemKey = 'id',
42
+ emptyMessage = 'There are currently no items in this list.',
43
+ emptySearchMessage = 'Sorry, your filter produced no results.',
44
+ } = {}) => ({
45
+ list,
46
+ perPage,
47
+ page,
48
+ filterable,
49
+ filter,
50
+ itemKey,
51
+ emptyMessage,
52
+ emptySearchMessage,
53
+ });
51
54
 
52
- <template #subheader>
53
- Dropdown content can go here when like when an action button is clicked
54
- </template>
55
-
56
- </gl-paginated-list>
57
- `;
55
+ const Template = (args, { argTypes }) => ({
56
+ components: {
57
+ GlPaginatedList,
58
+ GlButton,
59
+ },
60
+ props: Object.keys(argTypes),
61
+ template,
62
+ });
58
63
 
59
- const templateWithHeader = `
60
- <gl-paginated-list
61
- :list="list"
62
- :perPage="perPage"
63
- :page="page"
64
- :filterable="filterable"
65
- :filter="filter"
66
- :emptyMessage="emptyMessage"
67
- :emptySearchMessage="emptySearchMessage"
68
- >
64
+ export const Default = Template.bind({});
65
+ Default.args = generateProps();
69
66
 
70
- <template #header>
71
- <gl-button
72
- variant="success"
73
- class="order-1"
74
- @click="alert"
75
- >
76
- Foo Button
77
- </gl-button>
78
- </template>
79
-
80
- </gl-paginated-list>
81
- `;
67
+ export const NoFilter = (args, { argTypes }) => ({
68
+ components: {
69
+ GlPaginatedList,
70
+ GlButton,
71
+ },
72
+ props: Object.keys(argTypes),
73
+ template,
74
+ });
75
+ NoFilter.args = generateProps({
76
+ filterable: false,
77
+ });
82
78
 
83
- const templateWithRow = `
84
- <gl-paginated-list
85
- :list="list"
86
- :perPage="perPage"
87
- :page="page"
88
- :filterable="filterable"
89
- :filter="filter"
90
- :emptyMessage="emptyMessage"
91
- :emptySearchMessage="emptySearchMessage"
92
- >
79
+ export const WithEmptyList = (args, { argTypes }) => ({
80
+ components: {
81
+ GlPaginatedList,
82
+ GlButton,
83
+ },
84
+ props: Object.keys(argTypes),
85
+ template,
86
+ });
87
+ WithEmptyList.args = generateProps({
88
+ list: emptyList,
89
+ });
93
90
 
94
- <template slot-scope="{ listItem }" >
95
- <gl-button
96
- variant="success"
97
- class="order-1"
98
- @click="alert"
91
+ export const WithHeaderSlot = (args, { argTypes }) => ({
92
+ components: {
93
+ GlPaginatedList,
94
+ GlButton,
95
+ },
96
+ props: Object.keys(argTypes),
97
+ template: `
98
+ <gl-paginated-list
99
+ :list="list"
100
+ :perPage="perPage"
101
+ :page="page"
102
+ :filterable="filterable"
103
+ :filter="filter"
104
+ :item-key="itemKey"
105
+ :emptyMessage="emptyMessage"
106
+ :emptySearchMessage="emptySearchMessage"
99
107
  >
100
- {{ listItem.id }}
101
- </gl-button>
102
- </template>
103
108
 
104
- </gl-paginated-list>
105
- `;
109
+ <template #header>
110
+ <gl-button
111
+ variant="success"
112
+ class="order-1"
113
+ @click="alert"
114
+ >
115
+ Foo Button
116
+ </gl-button>
117
+ </template>
106
118
 
107
- function generateProps() {
108
- return {
109
- list: {
110
- type: Array,
111
- default: object('list', list),
112
- },
113
- perPage: {
114
- type: Number,
115
- default: number('perPage', 10),
116
- },
117
- page: {
118
- type: Number,
119
- default: number('page', 1),
120
- },
121
- filterable: {
122
- type: Boolean,
123
- default: boolean('filterable', true),
124
- },
125
- filter: {
126
- type: String,
127
- default: text('filter', 'id'),
128
- },
129
- itemKey: {
130
- type: String,
131
- default: text('itemKey', 'id'),
119
+ </gl-paginated-list>
120
+ `,
121
+ methods: {
122
+ alert() {
123
+ // eslint-disable-next-line no-alert
124
+ window.alert('clicked');
132
125
  },
133
- emptyMessage: {
134
- type: String,
135
- default: text('emptyMessage', 'There are currently no items in this list.'),
136
- },
137
- emptySearchMessage: {
138
- type: String,
139
- default: text('emptySearchMessage', 'Sorry, your filter produced no results.'),
140
- },
141
- };
142
- }
126
+ },
127
+ });
128
+ WithHeaderSlot.args = generateProps();
143
129
 
144
- documentedStoriesOf('base/paginated-list', readme)
145
- .addDecorator(withKnobs)
146
- .add('default', () => ({
147
- props: generateProps(),
148
- components,
149
- template,
150
- }))
151
- .add('no filter', () => ({
152
- props: {
153
- ...generateProps(),
154
- filterable: {
155
- type: Boolean,
156
- default: false,
157
- },
158
- },
159
- components,
160
- template,
161
- }))
162
- .add('with empty list', () => ({
163
- props: {
164
- ...generateProps(),
165
- list: {
166
- type: Array,
167
- default: array('list', emptyList),
168
- },
169
- },
170
- components,
171
- template,
172
- }))
173
- .add('with header slot', () => ({
174
- props: generateProps(),
175
- components,
176
- template: templateWithHeader,
177
- methods: {
178
- alert() {
179
- // eslint-disable-next-line no-alert
180
- window.alert('clicked');
181
- },
130
+ export const WithSubheaderSlot = (args, { argTypes }) => ({
131
+ components: {
132
+ GlPaginatedList,
133
+ GlButton,
134
+ },
135
+ props: Object.keys(argTypes),
136
+ template: `
137
+ <gl-paginated-list
138
+ :list="list"
139
+ :perPage="perPage"
140
+ :page="page"
141
+ :filterable="filterable"
142
+ :filter="filter"
143
+ :item-key="itemKey"
144
+ :emptyMessage="emptyMessage"
145
+ :emptySearchMessage="emptySearchMessage"
146
+ >
147
+
148
+ <template #subheader>
149
+ Dropdown content can go here when like when an action button is clicked
150
+ </template>
151
+
152
+ </gl-paginated-list>
153
+ `,
154
+ });
155
+ WithSubheaderSlot.args = generateProps();
156
+
157
+ export const WithRowSlot = (args, { argTypes }) => ({
158
+ components: {
159
+ GlPaginatedList,
160
+ GlButton,
161
+ },
162
+ props: Object.keys(argTypes),
163
+ template: `
164
+ <gl-paginated-list
165
+ :list="list"
166
+ :perPage="perPage"
167
+ :page="page"
168
+ :filterable="filterable"
169
+ :filter="filter"
170
+ :item-key="itemKey"
171
+ :emptyMessage="emptyMessage"
172
+ :emptySearchMessage="emptySearchMessage"
173
+ >
174
+
175
+ <template slot-scope="{ listItem }" >
176
+ <gl-button
177
+ variant="success"
178
+ class="order-1"
179
+ @click="alert"
180
+ >
181
+ {{ listItem.id }}
182
+ </gl-button>
183
+ </template>
184
+
185
+ </gl-paginated-list>
186
+ `,
187
+ methods: {
188
+ alert() {
189
+ // eslint-disable-next-line no-alert
190
+ window.alert('clicked');
182
191
  },
183
- }))
184
- .add('with subheader slot', () => ({
185
- props: generateProps(),
186
- components,
187
- template: templateWithSubheader,
188
- }))
189
- .add('with row slot', () => ({
190
- props: generateProps(),
191
- components,
192
- template: templateWithRow,
193
- methods: {
194
- alert() {
195
- // eslint-disable-next-line no-alert
196
- window.alert('clicked');
192
+ },
193
+ });
194
+ WithRowSlot.args = generateProps();
195
+
196
+ export default {
197
+ title: 'base/paginated-list',
198
+ component: GlPaginatedList,
199
+ parameters: {
200
+ knobs: { disable: true },
201
+ docs: {
202
+ description: {
203
+ component: readme,
197
204
  },
198
205
  },
199
- }));
206
+ },
207
+ };
@@ -1,8 +1,6 @@
1
- import examples from './examples';
2
1
  import description from './toast.md';
3
2
 
4
3
  export default {
5
4
  followsDesignSystem: true,
6
5
  description,
7
- examples,
8
6
  };
@@ -1,8 +1,3 @@
1
- # Toast
2
-
3
- <!-- STORY -->
4
-
5
- ## Usage
6
1
 
7
2
  Toasts are used to display system messages. The messages are short and straightforward. It may
8
3
  contain a dismiss button, and an action button depending on the situation.
@@ -51,9 +46,3 @@ Below are the options you can pass to create a toast
51
46
  | action | Object | close | Add single actions to toast |
52
47
  | toastClass | String, Array | 'gl-toast' | Custom css class name of the toast |
53
48
  | onComplete | Function | null | Trigger when toast is completed |
54
-
55
- ## Under the hood
56
-
57
- Toast uses [`BToast`] internally. So please take a look at their extensive documentation for more information.
58
-
59
- [`btoast`]: https://bootstrap-vue.org/docs/components/toast
@@ -1,66 +1,82 @@
1
1
  import Vue from 'vue';
2
- import { documentedStoriesOf } from '../../../../documentation/documented_stories';
3
2
  import { GlToast } from '../../../../index';
4
3
  import readme from './toast.md';
5
4
 
6
5
  Vue.use(GlToast);
7
6
 
8
- function generateDefault() {
9
- return () => ({
10
- template: `<gl-button @click="showToast()">Show default toast</gl-button>`,
11
- methods: {
12
- showToast() {
13
- this.$toast.show('This is the default toast.');
14
- },
7
+ const Template = () => ({
8
+ components: { GlToast },
9
+ template: `
10
+ <gl-button @click="showToast()">
11
+ Show default toast
12
+ </gl-button>`,
13
+ methods: {
14
+ showToast() {
15
+ this.$toast.show('This is the default toast.');
15
16
  },
16
- mounted() {
17
- this.showToast();
17
+ },
18
+ mounted() {
19
+ this.showToast();
20
+ },
21
+ });
22
+
23
+ export const Default = Template.bind({});
24
+
25
+ export const WithActions = () => ({
26
+ components: { GlToast },
27
+ template: `
28
+ <gl-button @click="showToast()">
29
+ Show toast with actions
30
+ </gl-button>`,
31
+ methods: {
32
+ showToast() {
33
+ this.$toast.show('This is a toast with an action.', {
34
+ action: {
35
+ text: 'Undo',
36
+ onClick: () => {},
37
+ },
38
+ });
18
39
  },
19
- });
20
- }
40
+ },
41
+ mounted() {
42
+ this.showToast();
43
+ },
44
+ });
21
45
 
22
- function generateWithActions() {
23
- return () => ({
24
- template: `<gl-button @click="showToast()">Show toast with actions</gl-button>`,
25
- methods: {
26
- showToast() {
27
- this.$toast.show('This is a toast with an action.', {
46
+ export const WithLongContent = () => ({
47
+ components: { GlToast },
48
+ template: `
49
+ <gl-button @click="showToast()">
50
+ Show toast with a long content
51
+ </gl-button>`,
52
+ methods: {
53
+ showToast() {
54
+ this.$toast.show(
55
+ 'This is a toast with a long content and an action. Notice how the text wraps to multiple lines when the max-width is reached.',
56
+ {
28
57
  action: {
29
- text: 'Undo',
58
+ text: 'Undo action',
30
59
  onClick: () => {},
31
60
  },
32
- });
33
- },
61
+ }
62
+ );
34
63
  },
35
- mounted() {
36
- this.showToast();
37
- },
38
- });
39
- }
64
+ },
65
+ mounted() {
66
+ this.showToast();
67
+ },
68
+ });
40
69
 
41
- function generateLong() {
42
- return () => ({
43
- template: `<gl-button @click="showToast()">Show toast with a long content</gl-button>`,
44
- methods: {
45
- showToast() {
46
- this.$toast.show(
47
- 'This is a toast with a long content and an action. Notice how the text wraps to multiple lines when the max-width is reached.',
48
- {
49
- action: {
50
- text: 'Undo action',
51
- onClick: () => {},
52
- },
53
- }
54
- );
70
+ export default {
71
+ title: 'base/toast',
72
+ component: GlToast,
73
+ parameters: {
74
+ bootstrapComponent: 'toast',
75
+ knobs: { disable: true },
76
+ docs: {
77
+ description: {
78
+ component: readme,
55
79
  },
56
80
  },
57
- mounted() {
58
- this.showToast();
59
- },
60
- });
61
- }
62
-
63
- documentedStoriesOf('base/toast', readme)
64
- .add('default', generateDefault())
65
- .add('with actions', generateWithActions())
66
- .add('with long content', generateLong());
81
+ },
82
+ };
@@ -5591,12 +5591,12 @@
5591
5591
  margin-right: -#{$gl-spacing-scale-6} !important;
5592
5592
  }
5593
5593
  .gl-gap-x-3 {
5594
- * + * {
5594
+ > * + * {
5595
5595
  margin-left: #{$gl-spacing-scale-3};
5596
5596
  }
5597
5597
  }
5598
5598
  .gl-gap-x-3\! {
5599
- * + * {
5599
+ > * + * {
5600
5600
  margin-left: #{$gl-spacing-scale-3} !important;
5601
5601
  }
5602
5602
  }
@@ -750,7 +750,7 @@
750
750
  */
751
751
 
752
752
  @mixin gl-gap-x-3 {
753
- * + * {
753
+ > * + * {
754
754
  margin-left: #{$gl-spacing-scale-3};
755
755
  }
756
756
  }
@@ -1,49 +0,0 @@
1
- import PaginatedListBasicExample from './paginated_list.basic.example';
2
- import PaginatedListNoFilterExample from './paginated_list.no_filter.example';
3
- import PaginatedListWithEmptyListExample from './paginated_list.with_empty_list.example';
4
- import PaginatedListWithFilterFunctionExample from './paginated_list.with_filter_function.example';
5
- import PaginatedListWithHeaderSlotExample from './paginated_list.with_header_slot.example';
6
- import PaginatedListWithRowSlotExample from './paginated_list.with_row_slot.example';
7
- import PaginatedListWithSubheaderSlotExample from './paginated_list.with_subheader_slot.example';
8
-
9
- var index = [{
10
- name: 'Basic',
11
- items: [{
12
- id: 'paginated-list-basic',
13
- name: 'Basic',
14
- description: 'Basic Paginated List',
15
- component: PaginatedListBasicExample
16
- }, {
17
- id: 'paginated-list-no-filter',
18
- name: 'No Filter',
19
- description: 'Paginated List with no button',
20
- component: PaginatedListNoFilterExample
21
- }, {
22
- id: 'paginated-list-with-empty-list',
23
- name: 'With empty list',
24
- description: 'Paginated List empty list',
25
- component: PaginatedListWithEmptyListExample
26
- }, {
27
- id: 'paginated-list-with-header-slot',
28
- name: 'With header slot',
29
- description: 'Paginated List header slot',
30
- component: PaginatedListWithHeaderSlotExample
31
- }, {
32
- id: 'paginated-list-with-subheader-slot',
33
- name: 'With subheader slot',
34
- description: 'Paginated List subheader slot',
35
- component: PaginatedListWithSubheaderSlotExample
36
- }, {
37
- id: 'paginated-list-with-row-slot',
38
- name: 'With row slot',
39
- description: 'Paginated List with row slot',
40
- component: PaginatedListWithRowSlotExample
41
- }, {
42
- id: 'paginated-list-with-filter-function',
43
- name: 'With filter function',
44
- description: 'Paginated List with filter function',
45
- component: PaginatedListWithFilterFunctionExample
46
- }]
47
- }];
48
-
49
- export default index;
@@ -1,51 +0,0 @@
1
- import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
2
-
3
- /* script */
4
-
5
- /* template */
6
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-paginated-list',{attrs:{"list":[
7
- { id: 'foo' },
8
- { id: 'bar' },
9
- { id: 'baz' },
10
- { id: 'qux' },
11
- { id: 'quux' },
12
- { id: 'corge' },
13
- { id: 'grault' },
14
- { id: 'garply' },
15
- { id: 'waldo' },
16
- { id: 'fred' },
17
- { id: 'xyzzy' },
18
- { id: 'plugh' },
19
- { id: 'thud' } ]}})};
20
- var __vue_staticRenderFns__ = [];
21
-
22
- /* style */
23
- const __vue_inject_styles__ = undefined;
24
- /* scoped */
25
- const __vue_scope_id__ = undefined;
26
- /* module identifier */
27
- const __vue_module_identifier__ = undefined;
28
- /* functional template */
29
- const __vue_is_functional_template__ = false;
30
- /* style inject */
31
-
32
- /* style inject SSR */
33
-
34
- /* style inject shadow dom */
35
-
36
-
37
-
38
- const __vue_component__ = __vue_normalize__(
39
- { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
40
- __vue_inject_styles__,
41
- {},
42
- __vue_scope_id__,
43
- __vue_is_functional_template__,
44
- __vue_module_identifier__,
45
- false,
46
- undefined,
47
- undefined,
48
- undefined
49
- );
50
-
51
- export default __vue_component__;