@gitlab/ui 37.0.0 → 37.1.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 (66) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/components/base/drawer/drawer.documentation.js +1 -1
  3. package/dist/components/base/pagination/pagination.js +1 -0
  4. package/dist/components/base/path/data.js +2 -1
  5. package/dist/components/base/path/path.js +5 -4
  6. package/dist/components/base/tabs/tab/tab.js +4 -0
  7. package/dist/components/base/tabs/tabs/tabs.documentation.js +2 -14
  8. package/dist/components/base/tabs/tabs/tabs.js +8 -0
  9. package/dist/components/charts/legend/legend.js +12 -0
  10. package/dist/index.css +1 -1
  11. package/dist/index.css.map +1 -1
  12. package/documentation/components_documentation.js +0 -2
  13. package/documentation/documented_stories.js +3 -0
  14. package/package.json +1 -1
  15. package/src/components/base/drawer/drawer.documentation.js +1 -1
  16. package/src/components/base/pagination/pagination.spec.js +3 -0
  17. package/src/components/base/pagination/pagination.vue +1 -0
  18. package/src/components/base/path/__snapshots__/path.spec.js.snap +6 -0
  19. package/src/components/base/path/data.js +1 -0
  20. package/src/components/base/path/path.scss +6 -1
  21. package/src/components/base/path/path.spec.js +8 -0
  22. package/src/components/base/path/path.vue +10 -4
  23. package/src/components/base/tabs/tab/tab.vue +4 -0
  24. package/src/components/base/tabs/tabs/tabs.documentation.js +0 -12
  25. package/src/components/base/tabs/tabs/tabs.md +2 -7
  26. package/src/components/base/tabs/tabs/tabs.stories.js +221 -161
  27. package/src/components/base/tabs/tabs/tabs.vue +6 -0
  28. package/src/components/charts/legend/legend.stories.js +22 -15
  29. package/src/components/charts/legend/legend.vue +9 -0
  30. package/dist/components/base/tabs/tab/examples/index.js +0 -13
  31. package/dist/components/base/tabs/tab/examples/tab.basic.example.js +0 -38
  32. package/dist/components/base/tabs/tab/tab.documentation.js +0 -18
  33. package/dist/components/base/tabs/tabs/examples/index.js +0 -60
  34. package/dist/components/base/tabs/tabs/examples/tabs.basic.example.js +0 -38
  35. package/dist/components/base/tabs/tabs/examples/tabs.contentless_tab.example.js +0 -38
  36. package/dist/components/base/tabs/tabs/examples/tabs.counterbadges.example.js +0 -38
  37. package/dist/components/base/tabs/tabs/examples/tabs.custom_title.example.js +0 -38
  38. package/dist/components/base/tabs/tabs/examples/tabs.disabled.example.js +0 -38
  39. package/dist/components/base/tabs/tabs/examples/tabs.justified.example.js +0 -38
  40. package/dist/components/base/tabs/tabs/examples/tabs.no_tabs.example.js +0 -38
  41. package/dist/components/base/tabs/tabs/examples/tabs.scrollable.example.js +0 -47
  42. package/dist/components/base/tabs/tabs/examples/tabs.styles_only.example.js +0 -38
  43. package/dist/components/charts/legend/examples/index.js +0 -22
  44. package/dist/components/charts/legend/examples/legend.basic.example.js +0 -93
  45. package/dist/components/charts/legend/examples/legend.toggled.example.js +0 -100
  46. package/dist/components/charts/legend/legend.documentation.js +0 -21
  47. package/src/components/base/tabs/tab/examples/index.js +0 -15
  48. package/src/components/base/tabs/tab/examples/tab.basic.example.vue +0 -5
  49. package/src/components/base/tabs/tab/tab.documentation.js +0 -16
  50. package/src/components/base/tabs/tab/tab.md +0 -3
  51. package/src/components/base/tabs/tab/tab.stories.js +0 -12
  52. package/src/components/base/tabs/tabs/examples/index.js +0 -72
  53. package/src/components/base/tabs/tabs/examples/tabs.basic.example.vue +0 -6
  54. package/src/components/base/tabs/tabs/examples/tabs.contentless_tab.example.vue +0 -17
  55. package/src/components/base/tabs/tabs/examples/tabs.counterbadges.example.vue +0 -28
  56. package/src/components/base/tabs/tabs/examples/tabs.custom_title.example.vue +0 -9
  57. package/src/components/base/tabs/tabs/examples/tabs.disabled.example.vue +0 -7
  58. package/src/components/base/tabs/tabs/examples/tabs.justified.example.vue +0 -6
  59. package/src/components/base/tabs/tabs/examples/tabs.no_tabs.example.vue +0 -8
  60. package/src/components/base/tabs/tabs/examples/tabs.scrollable.example.vue +0 -20
  61. package/src/components/base/tabs/tabs/examples/tabs.styles_only.example.vue +0 -22
  62. package/src/components/charts/legend/examples/index.js +0 -27
  63. package/src/components/charts/legend/examples/legend.basic.example.vue +0 -55
  64. package/src/components/charts/legend/examples/legend.toggled.example.vue +0 -60
  65. package/src/components/charts/legend/legend.documentation.js +0 -19
  66. package/src/components/charts/legend/legend.md +0 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [37.1.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v37.0.0...v37.1.0) (2022-02-28)
2
+
3
+
4
+ ### Features
5
+
6
+ * **GlPagination:** Add aria-current="page" on active page ([58b8993](https://gitlab.com/gitlab-org/gitlab-ui/commit/58b89935c32845406d85ce5898c501908e25d8ff))
7
+
1
8
  # [37.0.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v36.7.1...v37.0.0) (2022-02-22)
2
9
 
3
10
 
@@ -1,7 +1,7 @@
1
1
  var description = "The drawer is used to show more information about a certain resource in the UI and potentially\nhandle actions on the information.\n\n### By default\n\n```html\n<gl-drawer :open=\"open\" @close=\"close\">\n <template #header>Your Title</template>\n <template>\n ...children\n </template>\n</gl-drawer>\n```\n\n- `v-bind:open` will be a boolean you will pass to `gl-drawer` and `@close` is a listener that will\nbe a function that will toggle open to `false`.\n";
2
2
 
3
3
  var drawer_documentation = {
4
- followsDesignSystem: false,
4
+ followsDesignSystem: true,
5
5
  description
6
6
  };
7
7
 
@@ -313,6 +313,7 @@ var script = {
313
313
 
314
314
  if (isActivePage) {
315
315
  attrs.class.push('active');
316
+ attrs['aria-current'] = 'page';
316
317
  } // Disable previous and/or next buttons if needed
317
318
 
318
319
 
@@ -21,7 +21,8 @@ const mockPathItems = [{
21
21
  metric: '7d'
22
22
  }, {
23
23
  title: 'Eighth',
24
- metric: '8d'
24
+ metric: '8d',
25
+ disabled: true
25
26
  }, {
26
27
  title: 'Ninth',
27
28
  metric: '9d'
@@ -21,9 +21,10 @@ var script = {
21
21
  * A list of path items in the form:
22
22
  * ```
23
23
  * {
24
- * title: String, required
25
- * metric: Any, optional
26
- * icon: String, optional
24
+ * title: String, required
25
+ * metric: Any, optional
26
+ * icon: String, optional
27
+ * disabled: Boolean, optional
27
28
  * }
28
29
  * ```
29
30
  */
@@ -174,7 +175,7 @@ var script = {
174
175
  const __vue_script__ = script;
175
176
 
176
177
  /* template */
177
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:"gl-resize-observer-directive",rawName:"v-gl-resize-observer-directive",value:(_vm.handleResize),expression:"handleResize"}],staticClass:"gl-path-nav",style:({ '--path-bg-color': _vm.backgroundColor }),attrs:{"data-testid":"gl-path-nav"}},[_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.displayScrollLeft),expression:"displayScrollLeft"}],staticClass:"gl-path-fade gl-path-fade-left"},[_c('button',{staticClass:"gl-clear-icon-button",attrs:{"aria-label":"Scroll left"},on:{"click":_vm.scrollPathLeft}},[_c('gl-icon',{attrs:{"size":32,"name":"chevron-left"}})],1)]),_vm._v(" "),_c('ul',{ref:"pathNavList",staticClass:"gl-path-nav-list"},_vm._l((_vm.items),function(item,index){return _c('li',{key:index,ref:"pathListItems",refInFor:true,staticClass:"gl-path-nav-list-item",attrs:{"id":_vm.pathId(index)}},[_c('button',{class:_vm.pathItemClass(index),on:{"click":function($event){return _vm.onItemClicked(index)}}},[(_vm.shouldDisplayIcon(item.icon))?_c('gl-icon',{staticClass:"gl-mr-2",attrs:{"name":item.icon,"data-testid":"gl-path-item-icon"}}):_vm._e(),_vm._v("\n "+_vm._s(item.title)),(item.metric)?_c('span',{staticClass:"gl-font-weight-normal gl-pl-2"},[_vm._v(_vm._s(item.metric))]):_vm._e()],1),_vm._v(" "),_vm._t("default",null,{"pathItem":item,"pathId":_vm.pathId(index)})],2)}),0),_vm._v(" "),_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.displayScrollRight),expression:"displayScrollRight"}],staticClass:"gl-path-fade gl-path-fade-right"},[_c('button',{staticClass:"gl-clear-icon-button",attrs:{"aria-label":"Scroll right"},on:{"click":_vm.scrollPathRight}},[_c('gl-icon',{attrs:{"size":32,"name":"chevron-right"}})],1)])])};
178
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:"gl-resize-observer-directive",rawName:"v-gl-resize-observer-directive",value:(_vm.handleResize),expression:"handleResize"}],staticClass:"gl-path-nav",style:({ '--path-bg-color': _vm.backgroundColor }),attrs:{"data-testid":"gl-path-nav"}},[_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.displayScrollLeft),expression:"displayScrollLeft"}],staticClass:"gl-path-fade gl-path-fade-left"},[_c('button',{staticClass:"gl-clear-icon-button",attrs:{"aria-label":"Scroll left"},on:{"click":_vm.scrollPathLeft}},[_c('gl-icon',{attrs:{"size":32,"name":"chevron-left"}})],1)]),_vm._v(" "),_c('ul',{ref:"pathNavList",staticClass:"gl-path-nav-list"},_vm._l((_vm.items),function(item,index){return _c('li',{key:index,ref:"pathListItems",refInFor:true,staticClass:"gl-path-nav-list-item",attrs:{"id":_vm.pathId(index)}},[_c('button',{class:_vm.pathItemClass(index),attrs:{"category":item.disabled ? 'tertiary' : undefined,"disabled":item.disabled},on:{"click":function($event){return _vm.onItemClicked(index)}}},[(_vm.shouldDisplayIcon(item.icon))?_c('gl-icon',{staticClass:"gl-mr-2",attrs:{"name":item.icon,"data-testid":"gl-path-item-icon"}}):_vm._e(),_vm._v("\n "+_vm._s(item.title)),(item.metric)?_c('span',{staticClass:"gl-font-weight-normal gl-pl-2"},[_vm._v(_vm._s(item.metric))]):_vm._e()],1),_vm._v(" "),_vm._t("default",null,{"pathItem":item,"pathId":_vm.pathId(index)})],2)}),0),_vm._v(" "),_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.displayScrollRight),expression:"displayScrollRight"}],staticClass:"gl-path-fade gl-path-fade-right"},[_c('button',{staticClass:"gl-clear-icon-button",attrs:{"aria-label":"Scroll right"},on:{"click":_vm.scrollPathRight}},[_c('gl-icon',{attrs:{"size":32,"name":"chevron-right"}})],1)])])};
178
179
  var __vue_staticRenderFns__ = [];
179
180
 
180
181
  /* style */
@@ -15,6 +15,10 @@ var script = {
15
15
  required: false,
16
16
  default: ''
17
17
  },
18
+
19
+ /**
20
+ * Query string parameter value to use when `gl-tabs` `sync-active-tab-with-query-params` prop is set to `true`.
21
+ */
18
22
  queryParamValue: {
19
23
  type: String,
20
24
  required: false,
@@ -1,20 +1,8 @@
1
- import examples from './examples';
2
-
3
- var description = "# Tabs\n\n<!-- STORY -->\n## Usage\n\nTabs are used to divide content into meaningful, related sections. Tabs allow users to focus on one\nspecific view at a time while maintaining sight of all the relevant content options available. Each\ntab, when active, will reveal it’s own unique content.\n\n## Using the component Vue\n\n~~~js\n<gl-tabs>\n <gl-tab title=\"Tab 1\">\n Tab panel 1\n </gl-tab>\n <gl-tab title=\"Tab 2\">\n Tab panel 2\n </gl-tab>\n</gl-tabs>\n~~~\n\n## Using the component HTML\n\n~~~js\n<div class=\"tabs gl-tabs\">\n <ul role=\"tablist\" class=\"nav gl-tabs-nav\">\n <li role=\"presentation\" class=\"nav-item\">\n <a\n role=\"tab\"\n target=\"_self\"\n href=\"#\"\n class=\"nav-link gl-tab-nav-item gl-tab-nav-item-active gl-tab-nav-item-active-indigo\"\n >Tab 1</a>\n </li>\n <li role=\"presentation\" class=\"nav-item\">\n <a role=\"tab\" target=\"_self\" href=\"#\" class=\"nav-link gl-tab-nav-item\">Tab 2</a>\n </li>\n </ul>\n <div class=\"tab-content gl-tab-content\">\n <div role=\"tabpanel\" class=\"tab-pane gl-tab-content active\">Tab panel 1</div>\n <div role=\"tabpanel\" class=\"tab-pane gl-tab-content\">Tab panel 2</div>\n </div>\n</div>\n~~~\n\n## Adding Action Buttons to the Tabs\n\nTabs start and end slot can be populated via props: `action-primary`, `action-secondary` and\n`action-tertiary`. These props allow you to handle how a primary, secondary and tertiary button will\nbehave and look. The props receive an object as such:\n\n~~~js\n{\n text: 'Save Changes',\n attributes: [\n { variant: 'info' },\n { disabled: this.someState },\n { class: 'some-class' },\n ...\n ]\n}\n~~~\n\n## Scrollable tab buttons\n\nBy default, `GlTab` will wrap tab buttons when they overflow the container. To\nenable horizontally scrolling for the tab buttons, use the `GlScrollableTabs`\ncomponent. This is a separate Vue component because of some limitations:\n\n- The action props (e.g., `action-primary`) are not respected in `GlScrollableTabs`. At the\n moment, BootstrapVue does not provide a reliable way for us to achieve this desired combination.\n\n`GlScrollableTabs` composes `GlTabs` and passes through every listener, slot, or prop (with the above\nexceptions).\n\n~~~html\n<gl-scrollable-tabs>\n <gl-tab v-for=\"tab in tabs\" :key=\"tab.key\" :title=\"tab.title\"> {{ tab.content }} </gl-tab>\n</gl-scrollable-tabs>\n~~~\n";
1
+ var description = "Tabs are used to divide content into meaningful, related sections. Tabs allow users to focus on one\nspecific view at a time while maintaining sight of all the relevant content options available. Each\ntab, when active, will reveal it’s own unique content.\n\n## Using the component Vue\n\n~~~html\n<gl-tabs>\n <gl-tab title=\"Tab 1\">\n Tab panel 1\n </gl-tab>\n <gl-tab title=\"Tab 2\">\n Tab panel 2\n </gl-tab>\n</gl-tabs>\n~~~\n\n## Using the component HTML\n\n~~~html\n<div class=\"tabs gl-tabs\">\n <ul role=\"tablist\" class=\"nav gl-tabs-nav\">\n <li role=\"presentation\" class=\"nav-item\">\n <a\n role=\"tab\"\n target=\"_self\"\n href=\"#\"\n class=\"nav-link gl-tab-nav-item gl-tab-nav-item-active gl-tab-nav-item-active-indigo\"\n >Tab 1</a>\n </li>\n <li role=\"presentation\" class=\"nav-item\">\n <a role=\"tab\" target=\"_self\" href=\"#\" class=\"nav-link gl-tab-nav-item\">Tab 2</a>\n </li>\n </ul>\n <div class=\"tab-content gl-tab-content\">\n <div role=\"tabpanel\" class=\"tab-pane gl-tab-content active\">Tab panel 1</div>\n <div role=\"tabpanel\" class=\"tab-pane gl-tab-content\">Tab panel 2</div>\n </div>\n</div>\n~~~\n\n## Adding Action Buttons to the Tabs\n\nTabs start and end slot can be populated via props: `action-primary`, `action-secondary` and\n`action-tertiary`. These props allow you to handle how a primary, secondary and tertiary button will\nbehave and look. The props receive an object as such:\n\n~~~js\n{\n text: 'Save Changes',\n attributes: [\n { variant: 'info' },\n { disabled: this.someState },\n { class: 'some-class' },\n ...\n ]\n}\n~~~\n\n## Scrollable tab buttons\n\nBy default, `GlTab` will wrap tab buttons when they overflow the container. To\nenable horizontally scrolling for the tab buttons, use the `GlScrollableTabs`\ncomponent. This is a separate Vue component because of some limitations:\n\n- The action props (e.g., `action-primary`) are not respected in `GlScrollableTabs`. At the\n moment, BootstrapVue does not provide a reliable way for us to achieve this desired combination.\n\n`GlScrollableTabs` composes `GlTabs` and passes through every listener, slot, or prop (with the above\nexceptions).\n\n~~~html\n<gl-scrollable-tabs>\n <gl-tab v-for=\"tab in tabs\" :key=\"tab.key\" :title=\"tab.title\"> {{ tab.content }} </gl-tab>\n</gl-scrollable-tabs>\n~~~\n";
4
2
 
5
3
  var tabs_documentation = {
6
4
  description,
7
- examples,
8
- bootstrapComponent: 'b-tabs',
9
- followsDesignSystem: true,
10
- propsInfo: {
11
- syncActiveTabWithQueryParams: {
12
- additionalInfo: 'Sync active tab with query string parameters. Allows for deep linking into specific tabs.'
13
- },
14
- queryParamName: {
15
- additionalInfo: 'Name to use for query string parameter.'
16
- }
17
- }
5
+ followsDesignSystem: true
18
6
  };
19
7
 
20
8
  export default tabs_documentation;
@@ -45,11 +45,19 @@ var script = {
45
45
  required: false,
46
46
  default: false
47
47
  },
48
+
49
+ /**
50
+ * Sync active tab with query string parameters. Allows for deep linking into specific tabs.
51
+ */
48
52
  syncActiveTabWithQueryParams: {
49
53
  type: Boolean,
50
54
  required: false,
51
55
  default: false
52
56
  },
57
+
58
+ /**
59
+ * Name to use for query string parameter.
60
+ */
53
61
  queryParamName: {
54
62
  type: String,
55
63
  required: false,
@@ -37,6 +37,10 @@ var script = {
37
37
  required: false,
38
38
  default: () => ({})
39
39
  },
40
+
41
+ /**
42
+ * Text for data average (overridden by prop if needed for internationalization)
43
+ */
40
44
  averageText: {
41
45
  type: String,
42
46
  required: false,
@@ -52,11 +56,19 @@ var script = {
52
56
  required: false,
53
57
  default: LEGEND_MIN_TEXT
54
58
  },
59
+
60
+ /**
61
+ * Text for max amount (overridden by prop if needed for internationalization)
62
+ */
55
63
  maxText: {
56
64
  type: String,
57
65
  required: false,
58
66
  default: LEGEND_MAX_TEXT
59
67
  },
68
+
69
+ /**
70
+ * Sets the display layout
71
+ */
60
72
  layout: {
61
73
  type: String,
62
74
  required: false,