@gitlab/ui 36.7.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 (103) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/components/base/alert/alert.js +1 -11
  3. package/dist/components/base/card/card.js +1 -1
  4. package/dist/components/base/drawer/drawer.documentation.js +1 -1
  5. package/dist/components/base/pagination/pagination.js +1 -0
  6. package/dist/components/base/path/data.js +2 -1
  7. package/dist/components/base/path/path.js +5 -4
  8. package/dist/components/base/tabs/tab/tab.js +4 -0
  9. package/dist/components/base/tabs/tabs/tabs.documentation.js +2 -14
  10. package/dist/components/base/tabs/tabs/tabs.js +8 -0
  11. package/dist/components/charts/area/area.documentation.js +1 -7
  12. package/dist/components/charts/legend/legend.js +12 -0
  13. package/dist/components/charts/line/line.documentation.js +2 -5
  14. package/dist/index.css +2 -2
  15. package/dist/index.css.map +1 -1
  16. package/dist/utils/stories_utils.js +13 -1
  17. package/documentation/components_documentation.js +0 -2
  18. package/documentation/documented_stories.js +5 -0
  19. package/package.json +3 -3
  20. package/src/components/base/accordion/accordion.stories.js +2 -1
  21. package/src/components/base/alert/alert.scss +0 -38
  22. package/src/components/base/alert/alert.spec.js +0 -1
  23. package/src/components/base/alert/alert.stories.js +0 -8
  24. package/src/components/base/alert/alert.vue +30 -41
  25. package/src/components/base/badge/badge.stories.js +4 -24
  26. package/src/components/base/card/card.vue +2 -2
  27. package/src/components/base/daterange_picker/daterange_picker.stories.js +10 -35
  28. package/src/components/base/drawer/drawer.documentation.js +1 -1
  29. package/src/components/base/icon/icon.stories.js +2 -5
  30. package/src/components/base/pagination/pagination.spec.js +3 -0
  31. package/src/components/base/pagination/pagination.vue +1 -0
  32. package/src/components/base/path/__snapshots__/path.spec.js.snap +6 -0
  33. package/src/components/base/path/data.js +1 -0
  34. package/src/components/base/path/path.scss +6 -1
  35. package/src/components/base/path/path.spec.js +8 -0
  36. package/src/components/base/path/path.vue +10 -4
  37. package/src/components/base/tabs/tab/tab.vue +4 -0
  38. package/src/components/base/tabs/tabs/tabs.documentation.js +0 -12
  39. package/src/components/base/tabs/tabs/tabs.md +2 -7
  40. package/src/components/base/tabs/tabs/tabs.stories.js +221 -161
  41. package/src/components/base/tabs/tabs/tabs.vue +6 -0
  42. package/src/components/base/toggle/toggle.stories.js +2 -3
  43. package/src/components/charts/area/area.documentation.js +0 -5
  44. package/src/components/charts/area/area.stories.js +127 -127
  45. package/src/components/charts/bar/bar.stories.js +8 -5
  46. package/src/components/charts/heatmap/heatmap.stories.js +13 -16
  47. package/src/components/charts/legend/legend.stories.js +22 -15
  48. package/src/components/charts/legend/legend.vue +9 -0
  49. package/src/components/charts/line/line.documentation.js +0 -2
  50. package/src/components/charts/line/line.md +0 -2
  51. package/src/components/charts/line/line.stories.js +124 -113
  52. package/src/utils/stories_utils.js +6 -0
  53. package/src/utils/stories_utils.spec.js +18 -0
  54. package/dist/components/base/tabs/tab/examples/index.js +0 -13
  55. package/dist/components/base/tabs/tab/examples/tab.basic.example.js +0 -38
  56. package/dist/components/base/tabs/tab/tab.documentation.js +0 -18
  57. package/dist/components/base/tabs/tabs/examples/index.js +0 -60
  58. package/dist/components/base/tabs/tabs/examples/tabs.basic.example.js +0 -38
  59. package/dist/components/base/tabs/tabs/examples/tabs.contentless_tab.example.js +0 -38
  60. package/dist/components/base/tabs/tabs/examples/tabs.counterbadges.example.js +0 -38
  61. package/dist/components/base/tabs/tabs/examples/tabs.custom_title.example.js +0 -38
  62. package/dist/components/base/tabs/tabs/examples/tabs.disabled.example.js +0 -38
  63. package/dist/components/base/tabs/tabs/examples/tabs.justified.example.js +0 -38
  64. package/dist/components/base/tabs/tabs/examples/tabs.no_tabs.example.js +0 -38
  65. package/dist/components/base/tabs/tabs/examples/tabs.scrollable.example.js +0 -47
  66. package/dist/components/base/tabs/tabs/examples/tabs.styles_only.example.js +0 -38
  67. package/dist/components/charts/area/examples/area.basic.example.js +0 -45
  68. package/dist/components/charts/area/examples/area.basic_plus.example.js +0 -53
  69. package/dist/components/charts/area/examples/index.js +0 -19
  70. package/dist/components/charts/legend/examples/index.js +0 -22
  71. package/dist/components/charts/legend/examples/legend.basic.example.js +0 -93
  72. package/dist/components/charts/legend/examples/legend.toggled.example.js +0 -100
  73. package/dist/components/charts/legend/legend.documentation.js +0 -21
  74. package/dist/components/charts/line/examples/index.js +0 -19
  75. package/dist/components/charts/line/examples/line.basic.example.js +0 -45
  76. package/dist/components/charts/line/examples/line.series.example.js +0 -53
  77. package/src/components/base/tabs/tab/examples/index.js +0 -15
  78. package/src/components/base/tabs/tab/examples/tab.basic.example.vue +0 -5
  79. package/src/components/base/tabs/tab/tab.documentation.js +0 -16
  80. package/src/components/base/tabs/tab/tab.md +0 -3
  81. package/src/components/base/tabs/tab/tab.stories.js +0 -12
  82. package/src/components/base/tabs/tabs/examples/index.js +0 -72
  83. package/src/components/base/tabs/tabs/examples/tabs.basic.example.vue +0 -6
  84. package/src/components/base/tabs/tabs/examples/tabs.contentless_tab.example.vue +0 -17
  85. package/src/components/base/tabs/tabs/examples/tabs.counterbadges.example.vue +0 -28
  86. package/src/components/base/tabs/tabs/examples/tabs.custom_title.example.vue +0 -9
  87. package/src/components/base/tabs/tabs/examples/tabs.disabled.example.vue +0 -7
  88. package/src/components/base/tabs/tabs/examples/tabs.justified.example.vue +0 -6
  89. package/src/components/base/tabs/tabs/examples/tabs.no_tabs.example.vue +0 -8
  90. package/src/components/base/tabs/tabs/examples/tabs.scrollable.example.vue +0 -20
  91. package/src/components/base/tabs/tabs/examples/tabs.styles_only.example.vue +0 -22
  92. package/src/components/charts/area/area.md +0 -1
  93. package/src/components/charts/area/examples/area.basic.example.vue +0 -14
  94. package/src/components/charts/area/examples/area.basic_plus.example.vue +0 -25
  95. package/src/components/charts/area/examples/index.js +0 -22
  96. package/src/components/charts/legend/examples/index.js +0 -27
  97. package/src/components/charts/legend/examples/legend.basic.example.vue +0 -55
  98. package/src/components/charts/legend/examples/legend.toggled.example.vue +0 -60
  99. package/src/components/charts/legend/legend.documentation.js +0 -19
  100. package/src/components/charts/legend/legend.md +0 -0
  101. package/src/components/charts/line/examples/index.js +0 -22
  102. package/src/components/charts/line/examples/line.basic.example.vue +0 -14
  103. package/src/components/charts/line/examples/line.series.example.vue +0 -25
@@ -9,5 +9,17 @@ const SERIES_NAME = {
9
9
  [SERIES_NAME_LONG]: 'Series name long. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tincidunt interdum sapien ut blandit. Nulla fermentum nisi id euismod vulputate. END',
10
10
  [SERIES_NAME_LONG_WITHOUT_SPACES]: 'Series_name_long._Lorem_ipsum_dolor_sit_amet,_consectetur_adipiscing_elit._Sed_tincidunt_interdum_sapien_ut_blandit._Nulla_fermentum_nisi_id_euismod_vulputate._END'
11
11
  };
12
+ /**
13
+ * Builds the parameters object disable one or multiple controls.
14
+ */
15
+
16
+ const disableControls = function () {
17
+ let controls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
18
+ return Object.fromEntries(controls.map(control => [control, {
19
+ control: {
20
+ disable: true
21
+ }
22
+ }]));
23
+ };
12
24
 
13
- export { SERIES_NAME, SERIES_NAME_LONG, SERIES_NAME_LONG_WITHOUT_SPACES, SERIES_NAME_SHORT };
25
+ export { SERIES_NAME, SERIES_NAME_LONG, SERIES_NAME_LONG_WITHOUT_SPACES, SERIES_NAME_SHORT, disableControls };
@@ -16,7 +16,6 @@ export { default as GlNavbarDocumentation } from '../src/components/base/navbar/
16
16
  export { default as GlIntersectionObserverDocumentation } from '../src/components/utilities/intersection_observer/intersection_observer.documentation';
17
17
  export { default as GlChartDocumentation } from '../src/components/charts/chart/chart.documentation';
18
18
  export { default as GlAreaChartDocumentation } from '../src/components/charts/area/area.documentation';
19
- export { default as GlChartLegendDocumentation } from '../src/components/charts/legend/legend.documentation';
20
19
  export { default as GlLineChartDocumentation } from '../src/components/charts/line/line.documentation';
21
20
  export { default as GlSparklineChartDocumentation } from '../src/components/charts/sparkline/sparkline.documentation';
22
21
  export { default as GlChartSeriesLabelDocumentation } from '../src/components/charts/series_label/series_label.documentation';
@@ -64,7 +63,6 @@ export { default as GlTableDocumentation } from '../src/components/base/table/ta
64
63
  export { default as GlBreadcrumbDocumentation } from '../src/components/base/breadcrumb/breadcrumb.documentation';
65
64
  export { default as GlHeatmapDocumentation } from '../src/components/charts/heatmap/heatmap.documentation';
66
65
  export { default as GlTabsDocumentation } from '../src/components/base/tabs/tabs/tabs.documentation';
67
- export { default as GlTabDocumentation } from '../src/components/base/tabs/tab/tab.documentation';
68
66
  export { default as GlButtonGroupDocumentation } from '../src/components/base/button_group/button_group.documentation';
69
67
  export { default as GlFormCheckboxDocumentation } from '../src/components/base/form/form_checkbox/form_checkbox.documentation';
70
68
  export { default as GlLabelDocumentation } from '../src/components/base/label/label.documentation';
@@ -102,6 +102,7 @@ export const setupStorybookReadme = () =>
102
102
  'GlFormInput',
103
103
  'GlSegmentedControl',
104
104
  'GlAvatar',
105
+ 'GlChartLegend',
105
106
  'GlAvatarLink',
106
107
  'GlPagination',
107
108
  'GlSkeletonLoader',
@@ -117,6 +118,8 @@ export const setupStorybookReadme = () =>
117
118
  'GlKeysetPagination',
118
119
  'GlForm',
119
120
  'GlTable',
121
+ 'GlTab',
122
+ 'GlTabs',
120
123
  'GlToast',
121
124
  'GlPaginatedList',
122
125
  'GlIntersectionObserver',
@@ -132,6 +135,8 @@ export const setupStorybookReadme = () =>
132
135
  'GlHeatmap',
133
136
  'GlFormRadioGroup',
134
137
  'GlChartSeriesLabel',
138
+ 'GlAreaChart',
139
+ 'GlLineChart',
135
140
  ],
136
141
  components: {
137
142
  GlComponentDocumentation,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "36.7.0",
3
+ "version": "37.1.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -58,7 +58,7 @@
58
58
  "@babel/standalone": "^7.0.0",
59
59
  "bootstrap-vue": "2.20.1",
60
60
  "copy-to-clipboard": "^3.0.8",
61
- "dompurify": "^2.3.5",
61
+ "dompurify": "^2.3.6",
62
62
  "echarts": "^5.2.1",
63
63
  "highlight.js": "^10.6.0",
64
64
  "iframe-resizer": "^4.3.2",
@@ -85,7 +85,7 @@
85
85
  "@babel/preset-env": "^7.10.2",
86
86
  "@gitlab/eslint-plugin": "10.0.2",
87
87
  "@gitlab/stylelint-config": "4.0.0",
88
- "@gitlab/svgs": "2.5.0",
88
+ "@gitlab/svgs": "2.6.0",
89
89
  "@rollup/plugin-commonjs": "^11.1.0",
90
90
  "@rollup/plugin-node-resolve": "^7.1.3",
91
91
  "@rollup/plugin-replace": "^2.3.2",
@@ -1,3 +1,4 @@
1
+ import { disableControls } from '../../../utils/stories_utils';
1
2
  import readme from './accordion.md';
2
3
  import GlAccordion from './accordion.vue';
3
4
  import GlAccordionItem from './accordion_item.vue';
@@ -63,6 +64,6 @@ export default {
63
64
  options: [1, 2, 3, 4, 5, 6],
64
65
  },
65
66
  },
66
- autoCollapse: { control: { disable: true } },
67
+ ...disableControls(['autoCollapse']),
67
68
  },
68
69
  };
@@ -85,44 +85,6 @@
85
85
  @include gl-right-4;
86
86
  }
87
87
 
88
- .gl-alert-max-content {
89
- @include gl-display-flex;
90
- @include gl-justify-content-center;
91
- @include gl-p-5;
92
-
93
- .gl-alert-icon {
94
- @include gl-static;
95
- @include gl-mr-5;
96
- @include gl-flex-shrink-0;
97
- }
98
-
99
- .gl-dismiss-btn {
100
- @include gl-static;
101
- @include gl-align-self-start;
102
- @include gl-ml-4;
103
- // The negative margins optically align the × with the title text and right padding
104
- margin-top: -$gl-spacing-scale-2;
105
- margin-right: -$gl-spacing-scale-2;
106
- order: 3;
107
- }
108
-
109
- .gl-alert-container {
110
- @include gl-relative;
111
- @include gl-display-flex;
112
- @include gl-justify-content-space-between;
113
- @include gl-flex-grow-1;
114
- @include gl-mx-auto;
115
- }
116
-
117
- .gl-alert-content {
118
- @include gl-flex-grow-1;
119
- }
120
- }
121
-
122
- .gl-alert-layout-limited .gl-alert-container {
123
- @include gl-layout-w-limited;
124
- }
125
-
126
88
  .gl-alert-danger {
127
89
  @include gl-bg-red-50;
128
90
 
@@ -154,7 +154,6 @@ describe('Alert component', () => {
154
154
  describe('top-level classes', () => {
155
155
  describe.each`
156
156
  prop | cssClass | presentIf
157
- ${'contained'} | ${'gl-alert-max-content'} | ${true}
158
157
  ${'sticky'} | ${'gl-alert-sticky'} | ${true}
159
158
  ${'dismissible'} | ${'gl-alert-not-dismissible'} | ${false}
160
159
  `('$cssClass', ({ prop, cssClass, presentIf }) => {
@@ -12,7 +12,6 @@ const template = `
12
12
  :secondary-button-text="secondaryButtonText"
13
13
  :primary-button-link="primaryButtonLink"
14
14
  :secondary-button-link="secondaryButtonLink"
15
- :contained="contained"
16
15
  :sticky="sticky"
17
16
  >{{ message }}</gl-alert>`;
18
17
 
@@ -27,7 +26,6 @@ const generateProps = ({
27
26
  primaryButtonLink = defaultValue('primaryButtonLink'),
28
27
  secondaryButtonText = defaultValue('secondaryButtonText'),
29
28
  secondaryButtonLink = defaultValue('secondaryButtonLink'),
30
- contained = defaultValue('contained'),
31
29
  sticky = defaultValue('sticky'),
32
30
  } = {}) => ({
33
31
  title,
@@ -39,7 +37,6 @@ const generateProps = ({
39
37
  primaryButtonLink,
40
38
  secondaryButtonText,
41
39
  secondaryButtonLink,
42
- contained,
43
40
  sticky,
44
41
  });
45
42
 
@@ -118,11 +115,6 @@ Variants.parameters = {
118
115
  storyshots: { disable: true },
119
116
  };
120
117
 
121
- export const Contained = Template.bind({});
122
- Contained.args = generateProps({
123
- contained: true,
124
- });
125
-
126
118
  export const Sticky = () => ({
127
119
  components: { GlAlert },
128
120
  variants: alertVariantOptions,
@@ -74,14 +74,6 @@ export default {
74
74
  required: false,
75
75
  default: '',
76
76
  },
77
- /**
78
- * Contained alerts have their content's width limited.
79
- */
80
- contained: {
81
- type: Boolean,
82
- required: false,
83
- default: false,
84
- },
85
77
  sticky: {
86
78
  type: Boolean,
87
79
  required: false,
@@ -171,48 +163,45 @@ export default {
171
163
  <div
172
164
  :class="[
173
165
  'gl-alert',
174
- { 'gl-alert-max-content gl-alert-layout-limited': contained },
175
166
  { 'gl-alert-sticky': sticky },
176
167
  { 'gl-alert-not-dismissible': !dismissible },
177
168
  variantClass,
178
169
  ]"
179
170
  >
180
- <div class="gl-alert-container">
181
- <gl-icon
182
- :name="iconName"
183
- :class="{ 'gl-alert-icon': true, 'gl-alert-icon-no-title': !title }"
184
- />
171
+ <gl-icon
172
+ :name="iconName"
173
+ :class="{ 'gl-alert-icon': true, 'gl-alert-icon-no-title': !title }"
174
+ />
185
175
 
186
- <close-button
187
- v-if="dismissible"
188
- ref="dismiss"
189
- class="gl-dismiss-btn"
190
- :label="dismissLabel"
191
- @click="onDismiss"
192
- />
176
+ <close-button
177
+ v-if="dismissible"
178
+ ref="dismiss"
179
+ class="gl-dismiss-btn"
180
+ :label="dismissLabel"
181
+ @click="onDismiss"
182
+ />
193
183
 
194
- <div class="gl-alert-content" role="alert">
195
- <h4 v-if="title" class="gl-alert-title">{{ title }}</h4>
184
+ <div class="gl-alert-content" role="alert">
185
+ <h4 v-if="title" class="gl-alert-title">{{ title }}</h4>
196
186
 
197
- <div class="gl-alert-body">
198
- <!-- @slot The alert message to display. -->
199
- <slot></slot>
200
- </div>
187
+ <div class="gl-alert-body">
188
+ <!-- @slot The alert message to display. -->
189
+ <slot></slot>
190
+ </div>
201
191
 
202
- <div v-if="shouldRenderActions" class="gl-alert-actions">
203
- <!-- @slot If the primary/secondary action buttons aren't flexible enough, place arbitrary content here. -->
204
- <slot name="actions">
205
- <gl-button
206
- v-for="(actionButton, index) in actionButtons"
207
- :key="index"
208
- class="gl-alert-action"
209
- v-bind="actionButton.attrs"
210
- v-on="actionButton.listeners"
211
- >
212
- {{ actionButton.text }}
213
- </gl-button>
214
- </slot>
215
- </div>
192
+ <div v-if="shouldRenderActions" class="gl-alert-actions">
193
+ <!-- @slot If the primary/secondary action buttons aren't flexible enough, place arbitrary content here. -->
194
+ <slot name="actions">
195
+ <gl-button
196
+ v-for="(actionButton, index) in actionButtons"
197
+ :key="index"
198
+ class="gl-alert-action"
199
+ v-bind="actionButton.attrs"
200
+ v-on="actionButton.listeners"
201
+ >
202
+ {{ actionButton.text }}
203
+ </gl-button>
204
+ </slot>
216
205
  </div>
217
206
  </div>
218
207
  </div>
@@ -1,6 +1,7 @@
1
1
  import iconSpriteInfo from '@gitlab/svgs/dist/icons.json';
2
2
  import { GlBadge } from '../../../index';
3
3
  import { badgeSizeOptions, badgeVariantOptions } from '../../../utils/constants';
4
+ import { disableControls } from '../../../utils/stories_utils';
4
5
  import readme from './badge.md';
5
6
 
6
7
  const template = `
@@ -61,14 +62,7 @@ export const Variants = (args, { argTypes }) => ({
61
62
  Variants.args = generateProps({
62
63
  variant: badgeVariantOptions.warning,
63
64
  });
64
- Variants.argTypes = {
65
- content: {
66
- control: { disable: true },
67
- },
68
- variant: {
69
- control: { disable: true },
70
- },
71
- };
65
+ Variants.argTypes = disableControls(['content', 'variant']);
72
66
 
73
67
  export const Actionable = (args, { argTypes }) => ({
74
68
  components: { GlBadge },
@@ -95,14 +89,7 @@ Actionable.args = generateProps({
95
89
  Actionable.parameters = {
96
90
  storyshots: { disable: true },
97
91
  };
98
- Actionable.argTypes = {
99
- content: {
100
- control: { disable: true },
101
- },
102
- variant: {
103
- control: { disable: true },
104
- },
105
- };
92
+ Actionable.argTypes = disableControls(['content', 'variant']);
106
93
 
107
94
  export const Sizes = (args, { argTypes }) => ({
108
95
  components: { GlBadge },
@@ -125,14 +112,7 @@ export const Sizes = (args, { argTypes }) => ({
125
112
  Sizes.args = generateProps({
126
113
  variant: badgeVariantOptions.danger,
127
114
  });
128
- Sizes.argTypes = {
129
- content: {
130
- control: { disable: true },
131
- },
132
- size: {
133
- control: { disable: true },
134
- },
135
- };
115
+ Sizes.argTypes = disableControls(['content', 'size']);
136
116
 
137
117
  export const BadgeIcon = (args, { argTypes }) => ({
138
118
  components: { GlBadge },
@@ -31,7 +31,7 @@ export default {
31
31
 
32
32
  <template>
33
33
  <div class="gl-card">
34
- <div v-if="this.$slots.header" class="gl-card-header" :class="headerClass">
34
+ <div v-if="$slots.header" class="gl-card-header" :class="headerClass">
35
35
  <!-- @slot The card's header content. -->
36
36
  <slot name="header"></slot>
37
37
  </div>
@@ -39,7 +39,7 @@ export default {
39
39
  <!-- @slot The card's main content. -->
40
40
  <slot></slot>
41
41
  </div>
42
- <div v-if="this.$slots.footer" class="gl-card-footer" :class="footerClass">
42
+ <div v-if="$slots.footer" class="gl-card-footer" :class="footerClass">
43
43
  <!-- @slot The card's footer content. -->
44
44
  <slot name="footer"></slot>
45
45
  </div>
@@ -1,3 +1,4 @@
1
+ import { disableControls } from '../../../utils/stories_utils';
1
2
  import readme from './daterange_picker.md';
2
3
  import GlDaterangePicker from './daterange_picker.vue';
3
4
 
@@ -121,31 +122,15 @@ export default {
121
122
  },
122
123
  },
123
124
  argTypes: {
124
- i18n: {
125
- control: {
126
- disable: true,
127
- },
128
- },
129
- startPickerTarget: {
130
- control: {
131
- disable: true,
132
- },
133
- },
134
- startPickerContainer: {
135
- control: {
136
- disable: true,
137
- },
138
- },
139
- endPickerTarget: {
140
- control: {
141
- disable: true,
142
- },
143
- },
144
- endPickerContainer: {
145
- control: {
146
- disable: true,
147
- },
148
- },
125
+ ...disableControls([
126
+ 'i18n',
127
+ 'startPickerTarget',
128
+ 'startPickerContainer',
129
+ 'endPickerTarget',
130
+ 'endPickerContainer',
131
+ 'defaultStartDate',
132
+ 'defaultEndDate',
133
+ ]),
149
134
  defaultMinDate: {
150
135
  control: {
151
136
  type: 'date',
@@ -156,15 +141,5 @@ export default {
156
141
  type: 'date',
157
142
  },
158
143
  },
159
- defaultStartDate: {
160
- control: {
161
- disable: true,
162
- },
163
- },
164
- defaultEndDate: {
165
- control: {
166
- disable: true,
167
- },
168
- },
169
144
  },
170
145
  };
@@ -1,6 +1,6 @@
1
1
  import description from './drawer.md';
2
2
 
3
3
  export default {
4
- followsDesignSystem: false,
4
+ followsDesignSystem: true,
5
5
  description,
6
6
  };
@@ -1,6 +1,7 @@
1
1
  import iconSpriteInfo from '@gitlab/svgs/dist/icons.json';
2
2
  import { GlIcon } from '../../../index';
3
3
  import { iconSizeOptions } from '../../../utils/constants';
4
+ import { disableControls } from '../../../utils/stories_utils';
4
5
  import readme from './icon.md';
5
6
 
6
7
  const components = {
@@ -41,6 +42,7 @@ export default {
41
42
  storyshots: { disable: true },
42
43
  },
43
44
  argTypes: {
45
+ ...disableControls(['useDeprecatedSizes']),
44
46
  name: {
45
47
  control: {
46
48
  type: 'select',
@@ -53,10 +55,5 @@ export default {
53
55
  options: iconSizeOptions,
54
56
  },
55
57
  },
56
- useDeprecatedSizes: {
57
- control: {
58
- disable: true,
59
- },
60
- },
61
58
  },
62
59
  };
@@ -179,6 +179,7 @@ describe('pagination component', () => {
179
179
  it('shows 3rd page as active and enables all buttons', () => {
180
180
  const buttons = findButtons();
181
181
  expect(buttons.at(3).classes()).toEqual(expectClassActive);
182
+ expect(buttons.at(3).attributes('aria-current')).toEqual('page');
182
183
  buttons.wrappers.forEach((button) => {
183
184
  expect(button.element.tagName).not.toBe('SPAN');
184
185
  });
@@ -222,6 +223,7 @@ describe('pagination component', () => {
222
223
  const buttons = findButtons();
223
224
  expect(buttons.at(0).element.tagName).toBe('SPAN');
224
225
  expect(buttons.at(1).classes()).toEqual(expectClassActive);
226
+ expect(buttons.at(1).attributes('aria-current')).toEqual('page');
225
227
  expect(buttons.at(buttons.length - 1).element.tagName).not.toBe('SPAN');
226
228
  });
227
229
 
@@ -310,6 +312,7 @@ describe('pagination component', () => {
310
312
  const buttons = findButtons();
311
313
  expect(buttons.at(0).element.tagName).not.toBe('SPAN');
312
314
  expect(buttons.at(7).classes()).toEqual(expectClassActive);
315
+ expect(buttons.at(7).attributes('aria-current')).toEqual('page');
313
316
  expect(buttons.at(buttons.length - 1).element.tagName).toBe('SPAN');
314
317
  });
315
318
 
@@ -293,6 +293,7 @@ export default {
293
293
  const listeners = {};
294
294
  if (isActivePage) {
295
295
  attrs.class.push('active');
296
+ attrs['aria-current'] = 'page';
296
297
  }
297
298
  // Disable previous and/or next buttons if needed
298
299
  if (this.isLinkBased) {
@@ -155,7 +155,9 @@ exports[`Path matches the snapshot 1`] = `
155
155
  id="path-1-item-7"
156
156
  >
157
157
  <button
158
+ category="tertiary"
158
159
  class="gl-path-button"
160
+ disabled="disabled"
159
161
  >
160
162
  <!---->
161
163
 
@@ -383,7 +385,9 @@ exports[`Path renders the list of items with icons matches the snapshot 1`] = `
383
385
  id="path-15-item-7"
384
386
  >
385
387
  <button
388
+ category="tertiary"
386
389
  class="gl-path-button"
390
+ disabled="disabled"
387
391
  >
388
392
  <!---->
389
393
 
@@ -606,7 +610,9 @@ exports[`Path renders the list of items with metrics matches the snapshot 1`] =
606
610
  id="path-11-item-7"
607
611
  >
608
612
  <button
613
+ category="tertiary"
609
614
  class="gl-path-button"
615
+ disabled="disabled"
610
616
  >
611
617
  <!---->
612
618
 
@@ -30,6 +30,7 @@ export const mockPathItems = [
30
30
  {
31
31
  title: 'Eighth',
32
32
  metric: '8d',
33
+ disabled: true,
33
34
  },
34
35
  {
35
36
  title: 'Ninth',
@@ -78,7 +78,12 @@ $path-chevron-right-margin: px-to-rem(14px);
78
78
  @include gl-path-chevron;
79
79
  }
80
80
 
81
- &:hover {
81
+ &[disabled] {
82
+ @include gl-text-gray-400;
83
+ @include gl-cursor-not-allowed;
84
+ }
85
+
86
+ &:not([disabled]):hover {
82
87
  @include gl-path-active-item-color($gray-100);
83
88
  @include gl-text-gray-900;
84
89
  }
@@ -188,6 +188,14 @@ describe('Path', () => {
188
188
  ]);
189
189
  });
190
190
  });
191
+
192
+ describe('when a disabled item is clicked', () => {
193
+ it('does not emit the selected event', () => {
194
+ clickItemAt(7);
195
+
196
+ expect(wrapper.emitted('selected')).toBeUndefined();
197
+ });
198
+ });
191
199
  });
192
200
 
193
201
  describe('slots', () => {
@@ -21,9 +21,10 @@ export default {
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
  */
@@ -164,7 +165,12 @@ export default {
164
165
  :key="index"
165
166
  class="gl-path-nav-list-item"
166
167
  >
167
- <button :class="pathItemClass(index)" @click="onItemClicked(index)">
168
+ <button
169
+ :class="pathItemClass(index)"
170
+ :category="item.disabled ? 'tertiary' : undefined"
171
+ :disabled="item.disabled"
172
+ @click="onItemClicked(index)"
173
+ >
168
174
  <gl-icon
169
175
  v-if="shouldDisplayIcon(item.icon)"
170
176
  :name="item.icon"
@@ -15,6 +15,9 @@ export default {
15
15
  required: false,
16
16
  default: '',
17
17
  },
18
+ /**
19
+ * Query string parameter value to use when `gl-tabs` `sync-active-tab-with-query-params` prop is set to `true`.
20
+ */
18
21
  queryParamValue: {
19
22
  type: String,
20
23
  required: false,
@@ -36,6 +39,7 @@ export default {
36
39
  },
37
40
  };
38
41
  </script>
42
+
39
43
  <template>
40
44
  <b-tab
41
45
  :title-link-class="linkClass"
@@ -1,18 +1,6 @@
1
- import examples from './examples';
2
1
  import description from './tabs.md';
3
2
 
4
3
  export default {
5
4
  description,
6
- examples,
7
- bootstrapComponent: 'b-tabs',
8
5
  followsDesignSystem: true,
9
- propsInfo: {
10
- syncActiveTabWithQueryParams: {
11
- additionalInfo:
12
- '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
- },
18
6
  };
@@ -1,15 +1,10 @@
1
- # Tabs
2
-
3
- <!-- STORY -->
4
- ## Usage
5
-
6
1
  Tabs are used to divide content into meaningful, related sections. Tabs allow users to focus on one
7
2
  specific view at a time while maintaining sight of all the relevant content options available. Each
8
3
  tab, when active, will reveal it’s own unique content.
9
4
 
10
5
  ## Using the component Vue
11
6
 
12
- ~~~js
7
+ ~~~html
13
8
  <gl-tabs>
14
9
  <gl-tab title="Tab 1">
15
10
  Tab panel 1
@@ -22,7 +17,7 @@ tab, when active, will reveal it’s own unique content.
22
17
 
23
18
  ## Using the component HTML
24
19
 
25
- ~~~js
20
+ ~~~html
26
21
  <div class="tabs gl-tabs">
27
22
  <ul role="tablist" class="nav gl-tabs-nav">
28
23
  <li role="presentation" class="nav-item">