@gitlab/ui 32.43.0 → 32.44.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 (123) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +6 -1
  3. package/dist/components/base/avatar/avatar.documentation.js +2 -5
  4. package/dist/components/base/avatar_link/avatar_link.documentation.js +2 -5
  5. package/dist/components/base/form/form_group/examples/form_group/form_group.validation.example.js +3 -3
  6. package/dist/components/base/form/form_input/form_input.documentation.js +2 -27
  7. package/dist/components/base/form/form_input/form_input.js +23 -6
  8. package/dist/components/base/form/form_text/form_text.documentation.js +1 -4
  9. package/dist/components/base/form/form_textarea/form_textarea.documentation.js +1 -20
  10. package/dist/components/base/form/form_textarea/form_textarea.js +8 -0
  11. package/dist/components/base/pagination/pagination.documentation.js +2 -85
  12. package/dist/components/base/pagination/pagination.js +76 -0
  13. package/dist/components/base/segmented_control/segmented_control.documentation.js +2 -14
  14. package/dist/components/base/segmented_control/segmented_control.js +6 -0
  15. package/dist/components/regions/empty_state/empty_state.js +1 -1
  16. package/documentation/documented_stories.js +6 -0
  17. package/package.json +13 -12
  18. package/src/components/base/alert/alert.spec.js +2 -2
  19. package/src/components/base/avatar/avatar.documentation.js +0 -2
  20. package/src/components/base/avatar/avatar.md +0 -2
  21. package/src/components/base/avatar/avatar.spec.js +1 -2
  22. package/src/components/base/avatar/avatar.stories.js +88 -101
  23. package/src/components/base/avatar_link/avatar_link.documentation.js +0 -2
  24. package/src/components/base/avatar_link/avatar_link.md +4 -7
  25. package/src/components/base/avatar_link/avatar_link.stories.js +66 -54
  26. package/src/components/base/filtered_search/filtered_search.spec.js +35 -35
  27. package/src/components/base/filtered_search/filtered_search_term.spec.js +1 -1
  28. package/src/components/base/form/form_group/examples/form_group/form_group.validation.example.vue +3 -3
  29. package/src/components/base/form/form_group/form_group.stories.js +3 -3
  30. package/src/components/base/form/form_input/form_input.documentation.js +0 -31
  31. package/src/components/base/form/form_input/form_input.md +0 -2
  32. package/src/components/base/form/form_input/form_input.stories.js +50 -42
  33. package/src/components/base/form/form_input/form_input.vue +23 -6
  34. package/src/components/base/form/form_input_group/form_input_group.spec.js +1 -3
  35. package/src/components/base/form/form_text/form_text.documentation.js +0 -2
  36. package/src/components/base/form/form_text/form_text.md +1 -3
  37. package/src/components/base/form/form_text/form_text.stories.js +20 -8
  38. package/src/components/base/form/form_textarea/form_textarea.documentation.js +0 -25
  39. package/src/components/base/form/form_textarea/form_textarea.stories.js +31 -30
  40. package/src/components/base/form/form_textarea/form_textarea.vue +8 -0
  41. package/src/components/base/icon/icon.spec.js +1 -4
  42. package/src/components/base/infinite_scroll/infinite_scroll.spec.js +1 -4
  43. package/src/components/base/modal/modal.spec.js +19 -23
  44. package/src/components/base/paginated_list/__snapshots__/paginated_list.spec.js.snap +10 -10
  45. package/src/components/base/pagination/pagination.documentation.js +0 -100
  46. package/src/components/base/pagination/pagination.md +5 -9
  47. package/src/components/base/pagination/pagination.spec.js +1 -4
  48. package/src/components/base/pagination/pagination.stories.js +109 -117
  49. package/src/components/base/pagination/pagination.vue +85 -0
  50. package/src/components/base/search_box_by_click/search_box_by_click.spec.js +1 -5
  51. package/src/components/base/segmented_control/segmented_control.documentation.js +0 -15
  52. package/src/components/base/segmented_control/segmented_control.md +0 -2
  53. package/src/components/base/segmented_control/segmented_control.stories.js +46 -36
  54. package/src/components/base/segmented_control/segmented_control.vue +5 -0
  55. package/src/components/base/sorting/sorting.spec.js +1 -4
  56. package/src/components/base/toast/toast.spec.js +4 -6
  57. package/src/components/base/token/token.spec.js +1 -4
  58. package/src/components/base/token_selector/token_container.spec.js +2 -3
  59. package/src/components/charts/gauge/gauge.spec.js +7 -7
  60. package/src/components/charts/sparkline/sparkline.spec.js +1 -4
  61. package/src/components/regions/empty_state/empty_state.vue +8 -2
  62. package/src/components/utilities/friendly_wrap/friendly_wrap.spec.js +1 -4
  63. package/src/components/utilities/intersperse/intersperse.spec.js +1 -4
  64. package/src/directives/hover_load/hover_load.spec.js +2 -13
  65. package/src/directives/outside/outside.spec.js +1 -6
  66. package/src/directives/resize_observer/resize_observer.spec.js +4 -10
  67. package/src/scss/storybook.scss +8 -0
  68. package/dist/components/base/avatar/examples/avatar.fallback.example.js +0 -38
  69. package/dist/components/base/avatar/examples/avatar.image.example.js +0 -38
  70. package/dist/components/base/avatar/examples/avatar.rect.example.js +0 -38
  71. package/dist/components/base/avatar/examples/avatar.tooltip.example.js +0 -38
  72. package/dist/components/base/avatar/examples/index.js +0 -31
  73. package/dist/components/base/avatar_link/examples/avatar.link.example.js +0 -38
  74. package/dist/components/base/avatar_link/examples/index.js +0 -13
  75. package/dist/components/base/form/form_input/examples/form_input/form_input.text.example.js +0 -38
  76. package/dist/components/base/form/form_input/examples/form_input/form_input.text_disabled.example.js +0 -38
  77. package/dist/components/base/form/form_input/examples/form_input/form_input.text_reactive.example.js +0 -57
  78. package/dist/components/base/form/form_input/examples/form_input/index.js +0 -22
  79. package/dist/components/base/form/form_text/examples/form_text.basic.example.js +0 -38
  80. package/dist/components/base/form/form_text/examples/index.js +0 -13
  81. package/dist/components/base/form/form_textarea/examples/form_textarea.basic.example.js +0 -47
  82. package/dist/components/base/form/form_textarea/examples/form_textarea.invalid.example.js +0 -47
  83. package/dist/components/base/form/form_textarea/examples/form_textarea.plaintext.example.js +0 -47
  84. package/dist/components/base/form/form_textarea/examples/form_textarea.readonly.example.js +0 -45
  85. package/dist/components/base/form/form_textarea/examples/form_textarea.submit.example.js +0 -47
  86. package/dist/components/base/form/form_textarea/examples/index.js +0 -37
  87. package/dist/components/base/pagination/examples/index.js +0 -37
  88. package/dist/components/base/pagination/examples/pagination.basic.example.js +0 -45
  89. package/dist/components/base/pagination/examples/pagination.compact.example.js +0 -58
  90. package/dist/components/base/pagination/examples/pagination.double_truncation.example.js +0 -45
  91. package/dist/components/base/pagination/examples/pagination.event.example.js +0 -51
  92. package/dist/components/base/pagination/examples/pagination.links.example.js +0 -45
  93. package/dist/components/base/segmented_control/examples/index.js +0 -19
  94. package/dist/components/base/segmented_control/examples/segmented_control.basic.example.js +0 -65
  95. package/dist/components/base/segmented_control/examples/segmented_control.whitespace.example.js +0 -55
  96. package/src/components/base/avatar/examples/avatar.fallback.example.vue +0 -3
  97. package/src/components/base/avatar/examples/avatar.image.example.vue +0 -3
  98. package/src/components/base/avatar/examples/avatar.rect.example.vue +0 -6
  99. package/src/components/base/avatar/examples/avatar.tooltip.example.vue +0 -3
  100. package/src/components/base/avatar/examples/index.js +0 -36
  101. package/src/components/base/avatar_link/examples/avatar.link.example.vue +0 -5
  102. package/src/components/base/avatar_link/examples/index.js +0 -15
  103. package/src/components/base/form/form_input/examples/form_input/form_input.text.example.vue +0 -3
  104. package/src/components/base/form/form_input/examples/form_input/form_input.text_disabled.example.vue +0 -3
  105. package/src/components/base/form/form_input/examples/form_input/form_input.text_reactive.example.vue +0 -24
  106. package/src/components/base/form/form_input/examples/form_input/index.js +0 -26
  107. package/src/components/base/form/form_text/examples/form_text.basic.example.vue +0 -5
  108. package/src/components/base/form/form_text/examples/index.js +0 -15
  109. package/src/components/base/form/form_textarea/examples/form_textarea.basic.example.vue +0 -11
  110. package/src/components/base/form/form_textarea/examples/form_textarea.invalid.example.vue +0 -11
  111. package/src/components/base/form/form_textarea/examples/form_textarea.plaintext.example.vue +0 -13
  112. package/src/components/base/form/form_textarea/examples/form_textarea.readonly.example.vue +0 -9
  113. package/src/components/base/form/form_textarea/examples/form_textarea.submit.example.vue +0 -11
  114. package/src/components/base/form/form_textarea/examples/index.js +0 -43
  115. package/src/components/base/pagination/examples/index.js +0 -43
  116. package/src/components/base/pagination/examples/pagination.basic.example.vue +0 -17
  117. package/src/components/base/pagination/examples/pagination.compact.example.vue +0 -33
  118. package/src/components/base/pagination/examples/pagination.double_truncation.example.vue +0 -11
  119. package/src/components/base/pagination/examples/pagination.event.example.vue +0 -26
  120. package/src/components/base/pagination/examples/pagination.links.example.vue +0 -18
  121. package/src/components/base/segmented_control/examples/index.js +0 -22
  122. package/src/components/base/segmented_control/examples/segmented_control.basic.example.vue +0 -19
  123. package/src/components/base/segmented_control/examples/segmented_control.whitespace.example.vue +0 -18
package/CHANGELOG.md CHANGED
@@ -1,3 +1,31 @@
1
+ # [32.44.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v32.43.3...v32.44.0) (2021-12-09)
2
+
3
+
4
+ ### Features
5
+
6
+ * **GlFormText:** Migrate storybook story ([b64bc62](https://gitlab.com/gitlab-org/gitlab-ui/commit/b64bc6239ed5421b2c2023149e6fc59da936256e))
7
+
8
+ ## [32.43.3](https://gitlab.com/gitlab-org/gitlab-ui/compare/v32.43.2...v32.43.3) (2021-12-08)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deps:** update dependency dompurify to ^2.3.4 ([6798e4f](https://gitlab.com/gitlab-org/gitlab-ui/commit/6798e4f3e4fdd2b12b1b6e4cf8e0ac3d575cf43f))
14
+
15
+ ## [32.43.2](https://gitlab.com/gitlab-org/gitlab-ui/compare/v32.43.1...v32.43.2) (2021-12-07)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **UI text:** Removed "Please," added period, and updated examples ([eabcb67](https://gitlab.com/gitlab-org/gitlab-ui/commit/eabcb6712a54c4b9e8bd175c7df117523824f89f))
21
+
22
+ ## [32.43.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v32.43.0...v32.43.1) (2021-12-06)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * **GlEmptyState:** update styles to match design specs ([c0812f5](https://gitlab.com/gitlab-org/gitlab-ui/commit/c0812f53664b5db03e643878d7894c9d448a736b))
28
+
1
29
  # [32.43.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v32.42.0...v32.43.0) (2021-12-06)
2
30
 
3
31
 
package/README.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # GitLab UI
2
2
 
3
- GitLab UI is a UI component library written in [Vue.js](https://vuejs.org).
3
+ GitLab UI is a UI component library that implements [Pajamas](https://design.gitlab.com/), our
4
+ design system. GitLab UI is written in [Vue.js](https://vuejs.org) and its objectives are to:
5
+
6
+ - Create reusable UI components to accelerate frontend development.
7
+ - Create UI consistency for all components within GitLab.
8
+
4
9
  See <https://gitlab-org.gitlab.io/gitlab-ui/> for documentation.
5
10
 
6
11
  ## Usage
@@ -1,11 +1,8 @@
1
- import examples from './examples';
2
-
3
- var description = "## Usage\n\nAvatars are used to represent a unique entity, be it a person, a group, or a project.\n";
1
+ var description = "Avatars are used to represent a unique entity, be it a person, a group, or a project.\n";
4
2
 
5
3
  var avatar_documentation = {
6
4
  followsDesignSystem: true,
7
- description,
8
- examples
5
+ description
9
6
  };
10
7
 
11
8
  export default avatar_documentation;
@@ -1,11 +1,8 @@
1
- import examples from './examples';
2
-
3
- var description = "## Avatar link\n\n`<gl-avatar-link>` decorates `<gl-avatar>` with hyperlink functionality. It accepts the same\nproperties as the `<gl-link>` component and it works in the same way too. The main purpose of this\ncomponent is to apply visual enhancements that makes evident that the user can interact with the\navatar.\n\n## Using the component\n\nWhen wrapping an `<gl-avatar>` component, `<gl-avatar-link>` darkens\nthe border that surrounds the avatar image or fallback text when hovering over it.\n\n~~~vue\n<gl-avatar-link target=\"blank\" href=\"https://gitlab.com/gitlab-org/gitlab\">\n <gl-avatar\n :size=\"32\"\n :src=\"avatarUrl\"\n />\n</gl-avatar-link>\n~~~\n\nWhen wrapping an `<avatar-labeled>` component, `<avatar-link>` underlines\nthe label and sub-label text when hovering over the avatar. It also applies the\nsame effects described in the first example.\n\n~~~vue\n<gl-avatar-link target=\"blank\" href=\"https://gitlab.com/gitlab-org/gitlab\">\n <gl-avatar-labeled\n :size=\"32\"\n entity-name=\"GitLab\"\n label=\"GitLab User\"\n sub-label=\"@gitlab\"\n />\n</gl-avatar-link>\n\n~~~\n";
1
+ var description = "`<gl-avatar-link>` decorates `<gl-avatar>` with hyperlink functionality. It accepts the same\nproperties as the `<gl-link>` component and it works in the same way too. The main purpose of this\ncomponent is to apply visual enhancements that makes evident that the user can interact with the\navatar.\n\n## Using the component\n\nWhen wrapping an `<gl-avatar>` component, `<gl-avatar-link>` darkens\nthe border that surrounds the avatar image or fallback text when hovering over it.\n\n```vue\n<gl-avatar-link target=\"blank\" href=\"https://gitlab.com/gitlab-org/gitlab\">\n <gl-avatar\n :size=\"32\"\n :src=\"avatarUrl\"\n />\n</gl-avatar-link>\n```\n\nWhen wrapping an `<avatar-labeled>` component, `<avatar-link>` underlines\nthe label and sub-label text when hovering over the avatar. It also applies the\nsame effects described in the first example.\n\n```vue\n<gl-avatar-link target=\"blank\" href=\"https://gitlab.com/gitlab-org/gitlab\">\n <gl-avatar-labeled\n :size=\"32\"\n entity-name=\"GitLab\"\n label=\"GitLab User\"\n sub-label=\"@gitlab\"\n />\n</gl-avatar-link>\n```\n";
4
2
 
5
3
  var avatar_link_documentation = {
6
4
  followsDesignSystem: true,
7
- description,
8
- examples
5
+ description
9
6
  };
10
7
 
11
8
  export default avatar_link_documentation;
@@ -13,12 +13,12 @@ var script = {
13
13
  },
14
14
 
15
15
  invalidFeedback() {
16
- let feedbackText = 'Please enter something';
16
+ let feedbackText = 'This field is required.';
17
17
 
18
18
  if (this.name.length > 4) {
19
19
  feedbackText = '';
20
20
  } else if (this.name.length > 0) {
21
- feedbackText = 'Enter at least 4 characters';
21
+ feedbackText = 'Enter at least 4 characters.';
22
22
  }
23
23
 
24
24
  return feedbackText;
@@ -31,7 +31,7 @@ var script = {
31
31
  const __vue_script__ = script;
32
32
 
33
33
  /* template */
34
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-form-group',{attrs:{"label":"Name","description":"Please enter your name","invalid-feedback":_vm.invalidFeedback,"state":_vm.state,"label-for":"input1"}},[_c('gl-form-input',{attrs:{"id":"input1","state":_vm.state},model:{value:(_vm.name),callback:function ($$v) {_vm.name=(typeof $$v === 'string'? $$v.trim(): $$v);},expression:"name"}})],1)};
34
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-form-group',{attrs:{"label":"Name","description":"Enter a first and last name.","invalid-feedback":_vm.invalidFeedback,"state":_vm.state,"label-for":"input1"}},[_c('gl-form-input',{attrs:{"id":"input1","state":_vm.state},model:{value:(_vm.name),callback:function ($$v) {_vm.name=(typeof $$v === 'string'? $$v.trim(): $$v);},expression:"name"}})],1)};
35
35
  var __vue_staticRenderFns__ = [];
36
36
 
37
37
  /* style */
@@ -1,33 +1,8 @@
1
- import examples from './examples/form_input';
2
-
3
- var description = "# Form Input\n\nGeneral user input to be used in forms.\n";
1
+ var description = "General user input to be used in forms.\n";
4
2
 
5
3
  var form_input_documentation = {
6
4
  description,
7
- examples,
8
- bootstrapComponent: 'b-form-input',
9
- followsDesignSystem: true,
10
- propsInfo: {
11
- size: {
12
- additionalInfo: 'Maximum width of the input',
13
- enum: 'formInputSizes'
14
- }
15
- },
16
- events: [{
17
- event: 'input',
18
- args: [{
19
- arg: 'value',
20
- description: '(String)'
21
- }],
22
- description: 'Emitted to update the v-model'
23
- }, {
24
- event: 'update',
25
- args: [{
26
- arg: 'value',
27
- description: '(String)'
28
- }],
29
- description: `Triggered by user interaction. Emitted after any formatting (not including 'trim' or 'number' props). Useful for getting the currently entered value when the 'debounce' or 'lazy' props are set.`
30
- }]
5
+ followsDesignSystem: true
31
6
  };
32
7
 
33
8
  export default form_input_documentation;
@@ -2,17 +2,21 @@ import { BFormInput } from 'bootstrap-vue/esm/index.js';
2
2
  import { formInputSizes } from '../../../../utils/constants';
3
3
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
4
4
 
5
- const model = {
6
- prop: 'value',
7
- event: 'input'
8
- };
5
+ const MODEL_PROP = 'value';
6
+ const MODEL_EVENT = 'input';
9
7
  var script = {
10
8
  components: {
11
9
  BFormInput
12
10
  },
13
11
  inheritAttrs: false,
14
- model,
12
+ model: {
13
+ prop: MODEL_PROP,
14
+ event: MODEL_EVENT
15
+ },
15
16
  props: {
17
+ /**
18
+ * Maximum width of the input
19
+ */
16
20
  size: {
17
21
  type: String,
18
22
  required: false,
@@ -32,10 +36,23 @@ var script = {
32
36
  // Swap purpose of input and update events from underlying BFormInput.
33
37
  // See https://gitlab.com/gitlab-org/gitlab-ui/-/issues/631.
34
38
  input: (...args) => {
39
+ /**
40
+ * Emitted to update the v-model
41
+ *
42
+ * @event update
43
+ * @property {string} value new value
44
+ */
35
45
  this.$emit('update', ...args);
36
46
  },
37
47
  update: (...args) => {
38
- this.$emit(model.event, ...args);
48
+ /**
49
+ * Triggered by user interaction. Emitted after any formatting (not including 'trim' or 'number' props).
50
+ * Useful for getting the currently entered value when the 'debounce' or 'lazy' props are set.
51
+ *
52
+ * @event input
53
+ * @property {string} value new value
54
+ */
55
+ this.$emit(MODEL_EVENT, ...args);
39
56
  }
40
57
  };
41
58
  }
@@ -1,6 +1,4 @@
1
- import examples from './examples';
2
-
3
- var form_text = "# FormText\n\n<!-- STORY -->\n\nThe component used to render form group descriptions. Useful for when you need\nto add additional form text elements to a form group.\n";
1
+ var form_text = "# Usage\n\nThe component used to render form group descriptions. Useful for when you need\nto add additional form text elements to a form group.\n";
4
2
 
5
3
  var description = /*#__PURE__*/Object.freeze({
6
4
  __proto__: null,
@@ -9,7 +7,6 @@ var description = /*#__PURE__*/Object.freeze({
9
7
 
10
8
  var form_text_documentation = {
11
9
  description,
12
- examples,
13
10
  bootstrapComponent: 'b-form-text',
14
11
  propsInfo: {}
15
12
  };
@@ -1,26 +1,7 @@
1
- import examples from './examples';
2
-
3
1
  var description = "**Note:** This needs a `v-model` property to work correctly.\nSee [this issue](https://github.com/bootstrap-vue/bootstrap-vue/issues/1915) on Bootstrap Vue for\nmore information.\n";
4
2
 
5
3
  var form_textarea_documentation = {
6
- description,
7
- examples,
8
- bootstrapComponent: 'b-form-textarea',
9
- events: [{
10
- event: 'input',
11
- args: [{
12
- arg: 'value',
13
- description: '(String)'
14
- }],
15
- description: 'Emitted to update the v-model'
16
- }, {
17
- event: 'update',
18
- args: [{
19
- arg: 'value',
20
- description: '(String)'
21
- }],
22
- description: `Triggered by user interaction. Emitted after any formatting (not including 'trim' or 'number' props). Useful for getting the currently entered value when the 'debounce' or 'lazy' props are set.`
23
- }]
4
+ description
24
5
  };
25
6
 
26
7
  export default form_textarea_documentation;
@@ -36,9 +36,17 @@ var script = {
36
36
  // Swap purpose of input and update events from underlying BFormTextarea.
37
37
  // See https://gitlab.com/gitlab-org/gitlab-ui/-/issues/631.
38
38
  input: (...args) => {
39
+ /**
40
+ * Emitted to update the v-model
41
+ */
39
42
  this.$emit('update', ...args);
40
43
  },
41
44
  update: (...args) => {
45
+ /**
46
+ * Triggered by user interaction.
47
+ * Emitted after any formatting (not including 'trim' or 'number' props).
48
+ * Useful for getting the currently entered value when the 'debounce' or 'lazy' props are set.
49
+ */
42
50
  this.$emit(model.event, ...args);
43
51
  }
44
52
  };
@@ -1,91 +1,8 @@
1
- import examples from './examples';
2
-
3
- var description = "# Pagination\n\n<!-- STORY -->\n\n## Current page\n\nThe current page's value should be bound using `v-model`, e.g.:\n\n```html\n<script>\nexport default {\n data: () => ({\n page: 2,\n }),\n};\n</script>\n\n<template>\n <gl-pagination v-model=\"page\" :per-page=\"10\" :total-items=\"100\" />\n</template>\n```\n\n## Compact pagination\n\nIn some cases, you might not be able to provide the total items count because your API doesn't\nsupport it or because of performance concerns. For such cases, the pagination component supports a\ncompact mode, where only the previous and next buttons are displayed.\n\nTo enable the compact mode, you'll need to provide the previous and/or next page numbers via the\n`prev-page` and `next-page` props respectively.\n\n> NOTE: If one of the props is omitted, the corresponding button will be disabled. If both\n> properties are omitted the pagination won't render at all.\n\n```html\n<template>\n <gl-pagination :value=\"2\" :prev-page=\"1\" :next-page=\"3\" />\n</template>\n```\n\n## Limits\n\nThe `limits` prop is used to define pagination link limits based on Bootstrap's breakpoint sizes.\nIt is strongly recommended you provide a 'default' property, even if you have accounted for all\nbreakpoint sizes. While unlikely, it is possible breakpoints could change, thus, a default property\nensures a graceful fallback.\n\nHere is `limits` default value:\n\n```js\n{\n xs: 0,\n sm: 3,\n md: 9,\n default: 9,\n}\n```\n\n> Note: The component will not render any UI if the total items available for display is less than\n> the max items per page.\n\n## Internet Explorer 11\n\nThis component makes use of the\n[`Number.isInteger` method](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger),\nwhich is not supported in IE11, make sure it's being polyfilled when using the component.\n[`core-js`](https://github.com/zloirock/core-js) incudes the appropriate polyfill for this.\n";
1
+ var description = "## Current page\n\nThe current page's value should be bound using `v-model`, e.g.:\n\n```html\n<script>\n export default {\n data: () => ({\n page: 2,\n }),\n };\n</script>\n\n<template>\n <gl-pagination v-model=\"page\" :per-page=\"10\" :total-items=\"100\" />\n</template>\n```\n\n## Compact pagination\n\nIn some cases, you might not be able to provide the total items count because your API doesn't\nsupport it or because of performance concerns. For such cases, the pagination component supports a\ncompact mode, where only the previous and next buttons are displayed.\n\nTo enable the compact mode, you'll need to provide the previous and/or next page numbers via the\n`prev-page` and `next-page` props respectively.\n\n> NOTE: If one of the props is omitted, the corresponding button will be disabled. If both\n> properties are omitted the pagination won't render at all.\n\n```html\n<template>\n <gl-pagination :value=\"2\" :prev-page=\"1\" :next-page=\"3\" />\n</template>\n```\n\n## Limits\n\nThe `limits` prop is used to define pagination link limits based on Bootstrap's breakpoint sizes.\nIt is strongly recommended you provide a 'default' property, even if you have accounted for all\nbreakpoint sizes. While unlikely, it is possible breakpoints could change, thus, a default property\nensures a graceful fallback.\n\nHere is `limits` default value:\n\n```js\n{\n xs: 0,\n sm: 3,\n md: 9,\n default: 9,\n}\n```\n\n> Note: The component will not render any UI if the total items available for display is less than\n> the max items per page.\n\n## Internet Explorer 11\n\nThis component makes use of the\n[`Number.isInteger` method](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger),\nwhich is not supported in IE11, make sure it's being polyfilled when using the component.\n[`core-js`](https://github.com/zloirock/core-js) incudes the appropriate polyfill for this.\n";
4
2
 
5
3
  var pagination_documentation = {
6
4
  followsDesignSystem: true,
7
- description,
8
- examples,
9
- propsInfo: {
10
- perPage: {
11
- additionalInfo: 'Number of items per page'
12
- },
13
- totalItems: {
14
- additionalInfo: 'Total number of items'
15
- },
16
- limits: {
17
- additionalInfo: 'The object must contain the xs, sm, md and default keys'
18
- },
19
- linkGen: {
20
- additionalInfo: 'A function that receives the page number and that returns a string representing the page URL'
21
- },
22
- prevPage: {
23
- additionalInfo: 'When using the compact pagination, use this prop to pass the previous page number'
24
- },
25
- prevText: {
26
- additionalInfo: 'Text for the previous button (overridden by "previous" slot)'
27
- },
28
- nextPage: {
29
- additionalInfo: 'When using the compact pagination, use this prop to pass the next page number'
30
- },
31
- nextText: {
32
- additionalInfo: 'Text for the next button (overridden by "next" slot)'
33
- },
34
- ellipsisText: {
35
- additionalInfo: 'Text for the ellipsis (overridden by "ellipsis-left" and "ellipsis-right" slots)'
36
- },
37
- labelFirstPage: {
38
- additionalInfo: 'aria-label for the first page item'
39
- },
40
- labelPrevPage: {
41
- additionalInfo: 'aria-label for the previous page item'
42
- },
43
- labelNextPage: {
44
- additionalInfo: 'aria-label for the next page item'
45
- },
46
- labelLastPage: {
47
- additionalInfo: 'aria-label for the last page item'
48
- },
49
- labelPage: {
50
- additionalInfo: 'aria-label getter for numbered page items, defaults to "Go to page <page_number>"'
51
- },
52
- align: {
53
- additionalInfo: 'Controls the component\'s horizontal alignment, value should be one of "left", "center", "right" or "fill"'
54
- }
55
- },
56
- events: [{
57
- event: 'input',
58
- description: 'Emitted when the page changes',
59
- args: [{
60
- arg: 'value',
61
- description: 'The page that just got loaded'
62
- }]
63
- }, {
64
- event: 'next',
65
- description: 'Emitted when the "next" button is clicked'
66
- }, {
67
- event: 'previous',
68
- description: 'Emitted when the "previous" button is clicked'
69
- }],
70
- slots: [{
71
- name: 'previous',
72
- description: `Content for the "previous" button. Overrides the "prevText" prop.`,
73
- scopedProps: `{ active: boolean, disabled: boolean, page: number }`
74
- }, {
75
- name: 'next',
76
- description: `Content for the "next" button. Overrides the "nextText" prop.`,
77
- scopedProps: `{ active: boolean, disabled: boolean, page: number }`
78
- }, {
79
- name: 'page-number',
80
- description: `Content for page number buttons.`,
81
- scopedProps: `{ active: boolean, disabled: boolean, page: number }`
82
- }, {
83
- name: 'ellipsis-left',
84
- description: `Content for the left ellipsis. Overrides the "ellipsisText" prop.`
85
- }, {
86
- name: 'ellipsis-right',
87
- description: `Content for the right ellipsis. Overrides the "ellipsisText" prop.`
88
- }]
5
+ description
89
6
  };
90
7
 
91
8
  export default pagination_documentation;
@@ -26,17 +26,29 @@ var script = {
26
26
  default: 1,
27
27
  validator: x => x > 0
28
28
  },
29
+
30
+ /**
31
+ * Number of items per page
32
+ */
29
33
  perPage: {
30
34
  type: Number,
31
35
  required: false,
32
36
  default: 20,
33
37
  validator: x => x > 0
34
38
  },
39
+
40
+ /**
41
+ * Total number of items
42
+ */
35
43
  totalItems: {
36
44
  type: Number,
37
45
  required: false,
38
46
  default: 0
39
47
  },
48
+
49
+ /**
50
+ * The object must contain the xs, sm, md and default keys
51
+ */
40
52
  limits: {
41
53
  type: Object,
42
54
  required: false,
@@ -51,61 +63,109 @@ var script = {
51
63
  return missingSizes === 0 ? true : value.default;
52
64
  }
53
65
  },
66
+
67
+ /**
68
+ * A function that receives the page number and that returns a string representing the page URL
69
+ */
54
70
  linkGen: {
55
71
  type: Function,
56
72
  required: false,
57
73
  default: null
58
74
  },
75
+
76
+ /**
77
+ * When using the compact pagination, use this prop to pass the previous page number
78
+ */
59
79
  prevPage: {
60
80
  type: Number,
61
81
  required: false,
62
82
  default: null
63
83
  },
84
+
85
+ /**
86
+ * Text for the previous button (overridden by "previous" slot)
87
+ */
64
88
  prevText: {
65
89
  type: String,
66
90
  required: false,
67
91
  default: 'Prev'
68
92
  },
93
+
94
+ /**
95
+ * When using the compact pagination, use this prop to pass the next page number
96
+ */
69
97
  nextPage: {
70
98
  type: Number,
71
99
  required: false,
72
100
  default: null
73
101
  },
102
+
103
+ /**
104
+ * Text for the next button (overridden by "next" slot)
105
+ */
74
106
  nextText: {
75
107
  type: String,
76
108
  required: false,
77
109
  default: 'Next'
78
110
  },
111
+
112
+ /**
113
+ * Text for the ellipsis (overridden by "ellipsis-left" and "ellipsis-right" slots)
114
+ */
79
115
  ellipsisText: {
80
116
  type: String,
81
117
  required: false,
82
118
  default: '…'
83
119
  },
120
+
121
+ /**
122
+ * aria-label for the first page item
123
+ */
84
124
  labelFirstPage: {
85
125
  type: String,
86
126
  required: false,
87
127
  default: 'Go to first page'
88
128
  },
129
+
130
+ /**
131
+ * aria-label for the previous page item
132
+ */
89
133
  labelPrevPage: {
90
134
  type: String,
91
135
  required: false,
92
136
  default: 'Go to previous page'
93
137
  },
138
+
139
+ /**
140
+ * aria-label for the next page item
141
+ */
94
142
  labelNextPage: {
95
143
  type: String,
96
144
  required: false,
97
145
  default: 'Go to next page'
98
146
  },
147
+
148
+ /**
149
+ * aria-label for the last page item
150
+ */
99
151
  labelLastPage: {
100
152
  type: String,
101
153
  required: false,
102
154
  default: 'Go to last page'
103
155
  },
156
+
157
+ /**
158
+ * aria-label getter for numbered page items, defaults to "Go to page <page_number>"
159
+ */
104
160
  labelPage: {
105
161
  type: Function,
106
162
  required: false,
107
163
  default: page => `Go to page ${page}`
108
164
  },
165
+
166
+ /**
167
+ * Controls the component\'s horizontal alignment, value should be one of "left", "center", "right" or "fill"
168
+ */
109
169
  align: {
110
170
  type: String,
111
171
  required: false,
@@ -290,17 +350,33 @@ var script = {
290
350
  handleClick(event, value) {
291
351
  if (!this.isLinkBased) {
292
352
  event.preventDefault();
353
+ /**
354
+ * Emitted when the page changes
355
+ * @event input
356
+ * @arg {number} value The page that just got loaded
357
+ */
358
+
293
359
  this.$emit('input', value);
294
360
  }
295
361
  },
296
362
 
297
363
  handlePrevious(event, value) {
298
364
  this.handleClick(event, value);
365
+ /**
366
+ * Emitted when the "previous" button is clicked
367
+ * @event previous
368
+ */
369
+
299
370
  this.$emit('previous');
300
371
  },
301
372
 
302
373
  handleNext(event, value) {
303
374
  this.handleClick(event, value);
375
+ /**
376
+ * Emitted when the "next" button is clicked
377
+ * @event next
378
+ */
379
+
304
380
  this.$emit('next');
305
381
  }
306
382
 
@@ -1,20 +1,8 @@
1
- import examples from './examples';
2
-
3
- var description = "# Segmented control\n\nButton group of equal options where only one can be selected and active.\n";
1
+ var description = "Button group of equal options where only one can be selected and active.\n";
4
2
 
5
3
  var segmented_control_documentation = {
6
4
  followsDesignSystem: false,
7
- description,
8
- examples,
9
- bootstrapComponent: 'b-form-radio-group',
10
- events: [{
11
- event: 'input',
12
- description: 'Emitted when the selection changes',
13
- args: [{
14
- arg: 'checked',
15
- description: 'The selected option'
16
- }]
17
- }]
5
+ description
18
6
  };
19
7
 
20
8
  export default segmented_control_documentation;
@@ -54,6 +54,12 @@ var script = {
54
54
 
55
55
  if (this.enabledOptions.length) {
56
56
  const suggestion = oldValue && this.isValidValue(oldValue) ? oldValue : this.enabledOptions[0].value;
57
+ /**
58
+ * Emitted when the selection changes
59
+ * @event input
60
+ * @argument checked The selected option
61
+ */
62
+
57
63
  this.$emit('input', suggestion);
58
64
  }
59
65
  }
@@ -110,7 +110,7 @@ var script = {
110
110
  const __vue_script__ = script;
111
111
 
112
112
  /* template */
113
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('section',{staticClass:"row",class:{ 'empty-state text-center': !_vm.compact }},[_c('div',{class:{ 'col-3 d-none d-sm-block': _vm.compact, 'col-12': !_vm.compact }},[(_vm.svgPath)?_c('div',{staticClass:"svg-250",class:{ 'svg-content': !_vm.compact }},[_c('img',{staticClass:"gl-max-w-full",attrs:{"src":_vm.svgPath,"alt":"","role":"img","height":_vm.height}})]):_vm._e()]),_vm._v(" "),_c('div',{class:_vm.compact ? 'col-sm-9' : 'col-12'},[_c('div',{staticClass:"text-content gl-mx-auto gl-my-0",class:{ 'gl-p-5': !_vm.compact }},[_c('h1',{ref:"title",class:_vm.compact ? 'h5' : 'h4'},[_vm._v(_vm._s(_vm.title))]),_vm._v(" "),(_vm.description || _vm.$scopedSlots.description)?_c('p',{ref:"description"},[_vm._t("description",[_vm._v("\n "+_vm._s(_vm.description)+"\n ")])],2):_vm._e(),_vm._v(" "),_c('div',{staticClass:"gl-display-flex gl-flex-wrap",class:{ 'gl-justify-content-center': !_vm.compact }},[_vm._t("actions",[(_vm.shouldRenderPrimaryButton)?_c('gl-button',{staticClass:"gl-mb-3",class:_vm.compact ? 'gl-mr-3' : 'gl-mx-2',attrs:{"variant":"confirm","href":_vm.primaryButtonLink}},[_vm._v(_vm._s(_vm.primaryButtonText))]):_vm._e(),_vm._v(" "),(_vm.shouldRenderSecondaryButton)?_c('gl-button',{staticClass:"gl-mb-3 gl-mr-3",class:{ 'gl-mx-2!': !_vm.compact },attrs:{"href":_vm.secondaryButtonLink}},[_vm._v(_vm._s(_vm.secondaryButtonText)+"\n ")]):_vm._e()])],2)])])])};
113
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('section',{staticClass:"row",class:{ 'empty-state text-center': !_vm.compact }},[_c('div',{class:{ 'col-3 d-none d-sm-block': _vm.compact, 'col-12': !_vm.compact }},[(_vm.svgPath)?_c('div',{staticClass:"svg-250",class:{ 'svg-content': !_vm.compact }},[_c('img',{staticClass:"gl-max-w-full",attrs:{"src":_vm.svgPath,"alt":"","role":"img","height":_vm.height}})]):_vm._e()]),_vm._v(" "),_c('div',{class:_vm.compact ? 'col-sm-9' : 'col-12'},[_c('div',{staticClass:"text-content gl-mx-auto gl-my-0",class:{ 'gl-p-5': !_vm.compact }},[_c('h1',{ref:"title",staticClass:"gl-font-size-h-display gl-line-height-36",class:_vm.compact ? 'h5' : 'h4'},[_vm._v("\n "+_vm._s(_vm.title)+"\n ")]),_vm._v(" "),(_vm.description || _vm.$scopedSlots.description)?_c('p',{ref:"description",staticClass:"gl-mt-3"},[_vm._t("description",[_vm._v("\n "+_vm._s(_vm.description)+"\n ")])],2):_vm._e(),_vm._v(" "),_c('div',{staticClass:"gl-display-flex gl-flex-wrap",class:{ 'gl-justify-content-center': !_vm.compact }},[_vm._t("actions",[(_vm.shouldRenderPrimaryButton)?_c('gl-button',{staticClass:"gl-mb-3",class:_vm.compact ? 'gl-mr-3' : 'gl-mx-2',attrs:{"variant":"confirm","href":_vm.primaryButtonLink}},[_vm._v(_vm._s(_vm.primaryButtonText))]):_vm._e(),_vm._v(" "),(_vm.shouldRenderSecondaryButton)?_c('gl-button',{staticClass:"gl-mb-3 gl-mr-3",class:{ 'gl-mx-2!': !_vm.compact },attrs:{"href":_vm.secondaryButtonLink}},[_vm._v(_vm._s(_vm.secondaryButtonText)+"\n ")]):_vm._e()])],2)])])])};
114
114
  var __vue_staticRenderFns__ = [];
115
115
 
116
116
  /* style */
@@ -94,6 +94,12 @@ export const setupStorybookReadme = () =>
94
94
  'GlMarkdown',
95
95
  'GlTokenSelector',
96
96
  'GlTooltip',
97
+ 'GlFormTextarea',
98
+ 'GlFormInput',
99
+ 'GlSegmentedControl',
100
+ 'GlAvatar',
101
+ 'GlAvatarLink',
102
+ 'GlPagination',
97
103
  ],
98
104
  components: {
99
105
  GlComponentDocumentation,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "32.43.0",
3
+ "version": "32.44.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -60,9 +60,10 @@
60
60
  "@babel/standalone": "^7.0.0",
61
61
  "bootstrap-vue": "2.20.1",
62
62
  "copy-to-clipboard": "^3.0.8",
63
- "dompurify": "^2.3.3",
63
+ "dompurify": "^2.3.4",
64
64
  "echarts": "^5.2.1",
65
65
  "highlight.js": "^10.6.0",
66
+ "iframe-resizer": "^4.3.2",
66
67
  "js-beautify": "^1.8.8",
67
68
  "lodash": "^4.17.20",
68
69
  "portal-vue": "^2.1.6",
@@ -84,20 +85,20 @@
84
85
  "@babel/preset-env": "^7.10.2",
85
86
  "@gitlab/eslint-plugin": "10.0.0",
86
87
  "@gitlab/stylelint-config": "2.6.0",
87
- "@gitlab/svgs": "1.225.0",
88
+ "@gitlab/svgs": "1.226.0",
88
89
  "@rollup/plugin-commonjs": "^11.1.0",
89
90
  "@rollup/plugin-node-resolve": "^7.1.3",
90
91
  "@rollup/plugin-replace": "^2.3.2",
91
- "@storybook/addon-a11y": "6.4.5",
92
- "@storybook/addon-docs": "6.4.5",
93
- "@storybook/addon-essentials": "6.4.5",
92
+ "@storybook/addon-a11y": "6.4.9",
93
+ "@storybook/addon-docs": "6.4.9",
94
+ "@storybook/addon-essentials": "6.4.9",
94
95
  "@storybook/addon-knobs": "6.4.0",
95
- "@storybook/addon-storyshots": "6.4.5",
96
- "@storybook/addon-storyshots-puppeteer": "6.4.5",
97
- "@storybook/addon-viewport": "6.4.5",
98
- "@storybook/theming": "6.4.5",
99
- "@storybook/vue": "6.4.5",
100
- "@vue/test-utils": "1.1.3",
96
+ "@storybook/addon-storyshots": "6.4.9",
97
+ "@storybook/addon-storyshots-puppeteer": "6.4.9",
98
+ "@storybook/addon-viewport": "6.4.9",
99
+ "@storybook/theming": "6.4.9",
100
+ "@storybook/vue": "6.4.9",
101
+ "@vue/test-utils": "1.3.0",
101
102
  "autoprefixer": "^9.7.6",
102
103
  "babel-jest": "^26.6.3",
103
104
  "babel-loader": "^8.0.5",