@gitlab/ui 35.1.0 → 36.3.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 (131) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/components/base/filtered_search/filtered_search.documentation.js +6 -0
  3. package/dist/components/base/filtered_search/filtered_search.js +12 -2
  4. package/dist/components/base/filtered_search/filtered_search_term.documentation.js +6 -0
  5. package/dist/components/base/filtered_search/filtered_search_term.js +11 -1
  6. package/dist/components/base/filtered_search/filtered_search_token_segment.documentation.js +6 -0
  7. package/dist/components/base/filtered_search/filtered_search_token_segment.js +11 -1
  8. package/dist/components/base/popover/popover.documentation.js +1 -23
  9. package/dist/components/base/popover/popover.js +10 -0
  10. package/dist/components/base/search_box_by_click/search_box_by_click.documentation.js +3 -0
  11. package/dist/components/base/search_box_by_click/search_box_by_click.js +6 -1
  12. package/dist/utility_classes.css +1 -1
  13. package/dist/utility_classes.css.map +1 -1
  14. package/documentation/all_components.js +2 -2
  15. package/documentation/documented_stories.js +1 -0
  16. package/package.json +4 -7
  17. package/src/charts.js +19 -0
  18. package/src/components/base/alert/alert.stories.js +1 -1
  19. package/src/components/base/avatar/avatar.stories.js +1 -1
  20. package/src/components/base/avatar_labeled/avatar_labeled.stories.js +1 -1
  21. package/src/components/base/avatar_link/avatar_link.stories.js +1 -1
  22. package/src/components/base/avatars_inline/avatars_inline.stories.js +1 -1
  23. package/src/components/base/badge/badge.stories.js +1 -1
  24. package/src/components/base/banner/banner.stories.js +1 -1
  25. package/src/components/base/breadcrumb/breadcrumb.stories.js +1 -1
  26. package/src/components/base/broadcast_message/broadcast_message.stories.js +1 -1
  27. package/src/components/base/button/button.stories.js +1 -1
  28. package/src/components/base/button_group/button_group.stories.js +1 -1
  29. package/src/components/base/collapse/collapse.stories.js +1 -1
  30. package/src/components/base/drawer/drawer.stories.js +1 -1
  31. package/src/components/base/dropdown/dropdown.stories.js +1 -1
  32. package/src/components/base/dropdown/dropdown_divider.stories.js +1 -1
  33. package/src/components/base/dropdown/dropdown_form.stories.js +1 -1
  34. package/src/components/base/dropdown/dropdown_item.stories.js +1 -1
  35. package/src/components/base/dropdown/dropdown_section_header.stories.js +1 -1
  36. package/src/components/base/dropdown/dropdown_text.stories.js +1 -1
  37. package/src/components/base/filtered_search/filtered_search.documentation.js +6 -0
  38. package/src/components/base/filtered_search/filtered_search.spec.js +81 -47
  39. package/src/components/base/filtered_search/filtered_search.stories.js +1 -1
  40. package/src/components/base/filtered_search/filtered_search.vue +13 -0
  41. package/src/components/base/filtered_search/filtered_search_suggestion.stories.js +1 -1
  42. package/src/components/base/filtered_search/filtered_search_suggestion_list.stories.js +1 -1
  43. package/src/components/base/filtered_search/filtered_search_term.documentation.js +6 -0
  44. package/src/components/base/filtered_search/filtered_search_term.spec.js +42 -9
  45. package/src/components/base/filtered_search/filtered_search_term.vue +13 -0
  46. package/src/components/base/filtered_search/filtered_search_token.stories.js +1 -1
  47. package/src/components/base/filtered_search/filtered_search_token_segment.documentation.js +6 -0
  48. package/src/components/base/filtered_search/filtered_search_token_segment.spec.js +53 -0
  49. package/src/components/base/filtered_search/filtered_search_token_segment.stories.js +1 -1
  50. package/src/components/base/filtered_search/filtered_search_token_segment.vue +12 -0
  51. package/src/components/base/form/form.stories.js +1 -1
  52. package/src/components/base/form/form_checkbox/form_checkbox.stories.js +1 -1
  53. package/src/components/base/form/form_group/form_group.stories.js +1 -1
  54. package/src/components/base/form/form_input/form_input.stories.js +1 -1
  55. package/src/components/base/form/form_input_group/form_input_group.stories.js +1 -1
  56. package/src/components/base/form/form_radio/form_radio.stories.js +1 -1
  57. package/src/components/base/form/form_radio_group/form_radio_group.stories.js +1 -1
  58. package/src/components/base/form/form_select/form_select.stories.js +1 -1
  59. package/src/components/base/form/form_text/form_text.vue +3 -1
  60. package/src/components/base/form/form_textarea/form_textarea.stories.js +1 -1
  61. package/src/components/base/icon/icon.stories.js +1 -1
  62. package/src/components/base/infinite_scroll/infinite_scroll.stories.js +1 -1
  63. package/src/components/base/label/label.stories.js +1 -1
  64. package/src/components/base/link/link.stories.js +1 -1
  65. package/src/components/base/loading_icon/loading_icon.stories.js +1 -1
  66. package/src/components/base/modal/modal.stories.js +1 -1
  67. package/src/components/base/nav/nav.stories.js +1 -1
  68. package/src/components/base/navbar/navbar.stories.js +1 -1
  69. package/src/components/base/paginated_list/paginated_list.stories.js +1 -1
  70. package/src/components/base/path/path.stories.js +1 -1
  71. package/src/components/base/popover/popover.documentation.js +0 -25
  72. package/src/components/base/popover/popover.stories.js +79 -75
  73. package/src/components/base/popover/popover.vue +8 -0
  74. package/src/components/base/progress_bar/progress_bar.stories.js +1 -1
  75. package/src/components/base/search_box_by_click/search_box_by_click.documentation.js +3 -0
  76. package/src/components/base/search_box_by_click/search_box_by_click.spec.js +14 -3
  77. package/src/components/base/search_box_by_click/search_box_by_click.stories.js +1 -1
  78. package/src/components/base/search_box_by_click/search_box_by_click.vue +7 -0
  79. package/src/components/base/search_box_by_type/search_box_by_type.stories.js +1 -1
  80. package/src/components/base/segmented_control/segmented_control.stories.js +1 -1
  81. package/src/components/base/skeleton_loader/skeleton_loader.stories.js +1 -1
  82. package/src/components/base/skeleton_loading/skeleton_loading.stories.js +1 -1
  83. package/src/components/base/sorting/sorting.stories.js +1 -1
  84. package/src/components/base/sorting/sorting_item.stories.js +1 -1
  85. package/src/components/base/table/table.stories.js +1 -1
  86. package/src/components/base/tabs/tabs/tabs.spec.js +1 -1
  87. package/src/components/base/tabs/tabs/tabs.stories.js +1 -1
  88. package/src/components/base/toast/toast.stories.js +1 -1
  89. package/src/components/base/toggle/toggle.stories.js +1 -1
  90. package/src/components/base/token/token.stories.js +1 -1
  91. package/src/components/base/tooltip/tooltip.stories.js +1 -1
  92. package/src/components/charts/area/area.stories.js +1 -1
  93. package/src/components/charts/bar/bar.stories.js +1 -1
  94. package/src/components/charts/chart/chart.stories.js +2 -2
  95. package/src/components/charts/column/column.stories.js +1 -1
  96. package/src/components/charts/discrete_scatter/discrete_scatter.stories.js +1 -1
  97. package/src/components/charts/heatmap/heatmap.stories.js +1 -1
  98. package/src/components/charts/legend/legend.stories.js +1 -1
  99. package/src/components/charts/line/line.stories.js +1 -1
  100. package/src/components/charts/series_label/series_label.stories.js +1 -1
  101. package/src/components/charts/single_stat/single_stat.stories.js +1 -1
  102. package/src/components/charts/sparkline/sparkline.stories.js +1 -1
  103. package/src/components/charts/stacked_column/stacked_column.stories.js +1 -1
  104. package/src/components/charts/tooltip/tooltip.stories.js +1 -1
  105. package/src/components/regions/dashboard_skeleton/dashboard_skeleton.stories.js +1 -1
  106. package/src/components/regions/empty_state/empty_state.stories.js +1 -1
  107. package/src/components/utilities/friendly_wrap/friendly_wrap.stories.js +1 -1
  108. package/src/components/utilities/intersection_observer/intersection_observer.stories.js +1 -1
  109. package/src/components/utilities/intersperse/intersperse.stories.js +1 -1
  110. package/src/components/utilities/sprintf/sprintf.stories.js +1 -1
  111. package/src/components/utilities/truncate/truncate.stories.js +1 -1
  112. package/{config.js → src/config.js} +1 -1
  113. package/src/directives/hover_load/hover_load.stories.js +1 -1
  114. package/src/directives/outside/outside.stories.js +1 -1
  115. package/src/directives/resize_observer/resize_observer.stories.js +1 -1
  116. package/src/directives/safe_html/safe_html.stories.js +1 -1
  117. package/src/index.js +111 -0
  118. package/src/scss/utilities.scss +20 -0
  119. package/src/scss/utility-mixins/color.scss +4 -0
  120. package/src/scss/utility-mixins/spacing.scss +6 -0
  121. package/{utils.js → src/utils.js} +1 -1
  122. package/charts.js +0 -19
  123. package/dist/components/base/popover/examples/index.js +0 -25
  124. package/dist/components/base/popover/examples/popover.basic.example.js +0 -38
  125. package/dist/components/base/popover/examples/popover.loading.example.js +0 -38
  126. package/dist/components/base/popover/examples/popover.notitle.example.js +0 -38
  127. package/index.js +0 -111
  128. package/src/components/base/popover/examples/index.js +0 -29
  129. package/src/components/base/popover/examples/popover.basic.example.vue +0 -13
  130. package/src/components/base/popover/examples/popover.loading.example.vue +0 -15
  131. package/src/components/base/popover/examples/popover.notitle.example.vue +0 -12
@@ -1,8 +1,8 @@
1
- import { withKnobs, select, text } from '@storybook/addon-knobs';
2
- import { GlPopover, GlButton } from '../../../../index';
3
- import { documentedStoriesOf } from '../../../../documentation/documented_stories';
1
+ import { GlPopover, GlButton } from '../../../index';
4
2
  import { popoverPlacements } from '../../../utils/constants';
5
3
 
4
+ const defaultValue = (prop) => GlPopover.props[prop].default;
5
+
6
6
  const components = { GlPopover, GlButton };
7
7
 
8
8
  const contentString = `
@@ -11,84 +11,88 @@ const contentString = `
11
11
  massa ac, porta condimentum libero. Ut id lacus tristique, egestas arcu non, molestie nisi.
12
12
  `;
13
13
 
14
- const template = `
15
- <div class="gl-display-flex gl-justify-content-center gl-p-6">
16
- <gl-button id="pop-top">{{placement}}</gl-button>
17
- <gl-popover target="pop-top"
18
- triggers="hover focus"
14
+ const getTemplate = (id, slots = '') => `
15
+ <div style="height:400px;" class="gl-display-flex gl-justify-content-center gl-align-items-center">
16
+ <gl-button id="${id}">{{placement}}</gl-button>
17
+ <gl-popover
18
+ target="${id}"
19
+ :triggers="triggers"
19
20
  :title="title"
20
21
  :placement="placement"
22
+ :show-close-button="showCloseButton"
21
23
  content="${contentString}"
22
- data-testid="popover-with-props"
23
- show
24
- />
25
- </div>
26
- `;
24
+ data-testid="${id}"
25
+ :show="$options.viewMode !== 'docs'">${slots}</gl-popover>
26
+ </div>`;
27
27
 
28
- const scopedSlotTemplate = `
29
- <div class="gl-display-flex gl-justify-content-center gl-p-6">
30
- <gl-button id="pop-top-two" data-testid="popover-button-click">{{placement}}</gl-button>
31
- <gl-popover target="pop-top-two"
32
- triggers="click"
33
- :placement="placement"
34
- content="${contentString}"
35
- >
36
- <template #title>
37
- <span data-testid="popover-title">Popover title</span>
38
- </template>
39
- </gl-popover>
40
- </div>
41
- `;
28
+ const generateProps = ({
29
+ placement = popoverPlacements.top,
30
+ title = 'Popover',
31
+ triggers = defaultValue('triggers'),
32
+ cssClasses = defaultValue('cssClasses'),
33
+ showCloseButton = defaultValue('showCloseButton'),
34
+ } = {}) => ({
35
+ placement,
36
+ title,
37
+ triggers,
38
+ cssClasses,
39
+ showCloseButton,
40
+ });
41
+
42
+ export const Default = (_args, { viewMode, argTypes }) => ({
43
+ viewMode,
44
+ components,
45
+ props: Object.keys(argTypes),
46
+ template: getTemplate('popover-with-props'),
47
+ });
48
+ Default.args = generateProps();
42
49
 
43
- function generateProps({ placement = popoverPlacements.top, title = 'Popover', triggers } = {}) {
44
- return {
50
+ export const WithCloseButton = (_args, { viewMode, argTypes }) => ({
51
+ viewMode,
52
+ components,
53
+ props: Object.keys(argTypes),
54
+ template: getTemplate('popover-with-close-button'),
55
+ });
56
+ WithCloseButton.args = generateProps({
57
+ showCloseButton: true,
58
+ });
59
+
60
+ export const OnClick = (_args, { viewMode, argTypes }) => ({
61
+ viewMode,
62
+ components,
63
+ props: Object.keys(argTypes),
64
+ template: getTemplate(
65
+ 'popover-button-click',
66
+ `
67
+ <template #title>
68
+ <span data-testid="popover-title">Popover title</span>
69
+ </template>
70
+ `
71
+ ),
72
+ });
73
+ OnClick.args = generateProps({
74
+ triggers: 'click',
75
+ });
76
+ OnClick.parameters = {
77
+ storyshots: { disable: true },
78
+ };
79
+
80
+ export default {
81
+ title: 'base/popover',
82
+ component: GlPopover,
83
+ parameters: {
84
+ knobs: { disable: true },
85
+ bootstrapComponent: 'b-popover',
86
+ },
87
+ argTypes: {
45
88
  placement: {
46
- type: String,
47
- default: select('placement', popoverPlacements, placement),
89
+ options: Object.values(popoverPlacements),
90
+ control: {
91
+ type: 'select',
92
+ },
48
93
  },
49
94
  title: {
50
- type: String,
51
- default: text('title', title),
95
+ control: { type: 'text' },
52
96
  },
53
- triggers: {
54
- type: String,
55
- default: text('hover focus', triggers),
56
- },
57
- };
58
- }
59
-
60
- documentedStoriesOf('base/popover', '')
61
- .addDecorator(withKnobs)
62
- .add('default', () => ({
63
- components,
64
- template,
65
- props: generateProps(),
66
- }))
67
- .add('with close button', () => ({
68
- components,
69
- template: `
70
- <div class="gl-display-flex gl-justify-content-center gl-p-6">
71
- <gl-button id="pop-with-close-button">{{placement}}</gl-button>
72
- <gl-popover
73
- target="pop-with-close-button"
74
- data-testid="popover-with-close-button"
75
- triggers="hover focus"
76
- :title="title"
77
- :placement="placement"
78
- content="${contentString}"
79
- show
80
- show-close-button
81
- />
82
- </div>
83
- `,
84
- props: generateProps(),
85
- }))
86
- .add(
87
- 'on click',
88
- () => ({
89
- components,
90
- template: scopedSlotTemplate,
91
- props: generateProps(),
92
- }),
93
- { storyshots: false }
94
- );
97
+ },
98
+ };
@@ -18,6 +18,11 @@ export default {
18
18
  required: false,
19
19
  default: () => [],
20
20
  },
21
+ /**
22
+ * Space-separated triggers for the popover.
23
+ *
24
+ * @values click, hover, focus, manual
25
+ */
21
26
  triggers: {
22
27
  type: String,
23
28
  required: false,
@@ -45,6 +50,9 @@ export default {
45
50
  methods: {
46
51
  close(e) {
47
52
  this.$refs[popoverRefName].doClose();
53
+ /**
54
+ * Emitted when the close button is clicked (requires showCloseButton to be `true`).
55
+ */
48
56
  this.$emit('close-button-clicked', e);
49
57
  },
50
58
  },
@@ -1,4 +1,4 @@
1
- import { GlProgressBar } from '../../../../index';
1
+ import { GlProgressBar } from '../../../index';
2
2
  import { variantOptions } from '../../../utils/constants';
3
3
 
4
4
  const generateProps = ({ value = 30, variant = variantOptions.primary } = {}) => ({
@@ -52,6 +52,9 @@ export default {
52
52
  additionalInfo:
53
53
  'Container for tooltip. Valid values: DOM node, selector string or `false` for default',
54
54
  },
55
+ searchButtonAttributes: {
56
+ additionalInfo: 'HTML attributes to add to the search button',
57
+ },
55
58
  },
56
59
  events: [
57
60
  {
@@ -25,6 +25,7 @@ describe('search box by click component', () => {
25
25
  };
26
26
 
27
27
  const findClearIcon = () => wrapper.findComponent(ClearIcon);
28
+ const findSearchButton = () => wrapper.find('[data-testid="search-button"]');
28
29
 
29
30
  it('emits input event when input changes', async () => {
30
31
  createComponent({ value: 'somevalue' });
@@ -125,8 +126,8 @@ describe('search box by click component', () => {
125
126
  });
126
127
 
127
128
  it('displays disabled search button', () => {
128
- expect(wrapper.findComponent({ ref: 'searchButton' }).exists()).toBe(true);
129
- expect(wrapper.findComponent({ ref: 'searchButton' }).attributes('disabled')).toBe('true');
129
+ expect(findSearchButton().exists()).toBe(true);
130
+ expect(findSearchButton().attributes('disabled')).toBe('true');
130
131
  });
131
132
 
132
133
  it('does not render clear icon even with value', () => {
@@ -145,9 +146,19 @@ describe('search box by click component', () => {
145
146
 
146
147
  it('emits submit event when search button is pressed', async () => {
147
148
  createComponent({ value: 'some-input' });
148
- wrapper.findComponent({ ref: 'searchButton' }).vm.$emit('click');
149
+ findSearchButton().vm.$emit('click');
149
150
 
150
151
  await wrapper.vm.$nextTick();
151
152
  expect(wrapper.emitted().submit[0]).toEqual(['some-input']);
152
153
  });
154
+
155
+ it('adds `searchButtonAttributes` prop to search button', () => {
156
+ const searchButtonAttributes = { 'data-qa-selector': 'foo-bar' };
157
+
158
+ createComponent({ searchButtonAttributes });
159
+
160
+ expect(findSearchButton().attributes('data-qa-selector')).toBe(
161
+ searchButtonAttributes['data-qa-selector']
162
+ );
163
+ });
153
164
  });
@@ -1,6 +1,6 @@
1
1
  import { withKnobs, boolean, text } from '@storybook/addon-knobs';
2
2
  import { documentedStoriesOf } from '../../../../documentation/documented_stories';
3
- import { GlSearchBoxByClick } from '../../../../index';
3
+ import { GlSearchBoxByClick } from '../../../index';
4
4
  import readme from './search_box_by_click.md';
5
5
 
6
6
  const components = {
@@ -84,6 +84,11 @@ export default {
84
84
  validator: (value) =>
85
85
  value === false || typeof value === 'string' || value instanceof HTMLElement,
86
86
  },
87
+ searchButtonAttributes: {
88
+ type: Object,
89
+ required: false,
90
+ default: () => ({}),
91
+ },
87
92
  },
88
93
  data() {
89
94
  return {
@@ -216,11 +221,13 @@ export default {
216
221
  />
217
222
  <template #append class="gl-search-box-by-click-input-group-control">
218
223
  <gl-button
224
+ v-bind="searchButtonAttributes"
219
225
  ref="searchButton"
220
226
  class="gl-search-box-by-click-search-button"
221
227
  icon="search"
222
228
  :disabled="disabled"
223
229
  aria-label="Search"
230
+ data-testid="search-button"
224
231
  @click="search(currentValue)"
225
232
  />
226
233
  </template>
@@ -1,6 +1,6 @@
1
1
  import { withKnobs, boolean, text } from '@storybook/addon-knobs';
2
2
  import { documentedStoriesOf } from '../../../../documentation/documented_stories';
3
- import { GlSearchBoxByType } from '../../../../index';
3
+ import { GlSearchBoxByType } from '../../../index';
4
4
  import readme from './search_box_by_type.md';
5
5
 
6
6
  const components = {
@@ -1,4 +1,4 @@
1
- import { GlSegmentedControl } from '../../../../index';
1
+ import { GlSegmentedControl } from '../../../index';
2
2
  import readme from './segmented_control.md';
3
3
 
4
4
  const defaultOptions = [
@@ -1,4 +1,4 @@
1
- import { GlSkeletonLoader } from '../../../../index';
1
+ import { GlSkeletonLoader } from '../../../index';
2
2
  import readme from './skeleton_loader.md';
3
3
 
4
4
  const Template = (args) => ({
@@ -1,4 +1,4 @@
1
- import { GlDeprecatedSkeletonLoading } from '../../../../index';
1
+ import { GlDeprecatedSkeletonLoading } from '../../../index';
2
2
  import readme from './skeleton_loading.md';
3
3
 
4
4
  const components = {
@@ -1,4 +1,4 @@
1
- import { GlSorting, GlSortingItem } from '../../../../index';
1
+ import { GlSorting, GlSortingItem } from '../../../index';
2
2
  import { makeContainer } from '../../../utils/story_decorators/container';
3
3
  import readme from './sorting.md';
4
4
 
@@ -1,4 +1,4 @@
1
- import { GlSorting, GlSortingItem } from '../../../../index';
1
+ import { GlSorting, GlSortingItem } from '../../../index';
2
2
  import { makeContainer } from '../../../utils/story_decorators/container';
3
3
  import readme from './sorting_item.md';
4
4
 
@@ -1,4 +1,4 @@
1
- import { GlTable, GlFormInput } from '../../../../index';
1
+ import { GlTable, GlFormInput } from '../../../index';
2
2
  import readme from './table.md';
3
3
 
4
4
  const components = { GlTable };
@@ -1,6 +1,6 @@
1
1
  import { mount } from '@vue/test-utils';
2
2
  import { nextTick } from 'vue';
3
- import { GlButton } from '../../../../../index';
3
+ import { GlButton } from '../../../../index';
4
4
  import { tabsButtonDefaults } from '../../../../utils/constants';
5
5
  import GlTab from '../tab/tab.vue';
6
6
  import GlTabs from './tabs.vue';
@@ -1,7 +1,7 @@
1
1
  import { withKnobs, boolean } from '@storybook/addon-knobs';
2
2
  import { range } from 'lodash';
3
3
  import { documentedStoriesOf } from '../../../../../documentation/documented_stories';
4
- import { GlTabs, GlTab, GlScrollableTabs } from '../../../../../index';
4
+ import { GlTabs, GlTab, GlScrollableTabs } from '../../../../index';
5
5
  import docs from './tabs.md';
6
6
 
7
7
  const ScrollableTabsGenerator = {
@@ -1,5 +1,5 @@
1
1
  import Vue from 'vue';
2
- import { GlToast, GlButton } from '../../../../index';
2
+ import { GlToast, GlButton } from '../../../index';
3
3
  import readme from './toast.md';
4
4
 
5
5
  Vue.use(GlToast);
@@ -1,4 +1,4 @@
1
- import { GlToggle } from '../../../../index';
1
+ import { GlToggle } from '../../../index';
2
2
  import { toggleLabelPosition } from '../../../utils/constants';
3
3
  import readme from './toggle.md';
4
4
 
@@ -1,4 +1,4 @@
1
- import { GlToken, GlAvatar } from '../../../../index';
1
+ import { GlToken, GlAvatar } from '../../../index';
2
2
  import { tokenVariants } from '../../../utils/constants';
3
3
 
4
4
  import readme from './token.md';
@@ -1,4 +1,4 @@
1
- import { GlTooltip, GlTooltipDirective, GlButton } from '../../../../index';
1
+ import { GlTooltip, GlTooltipDirective, GlButton } from '../../../index';
2
2
  import readme from './tooltip.md';
3
3
 
4
4
  function makeTooltip(modifier = '') {
@@ -1,6 +1,6 @@
1
1
  import { withKnobs, object, array, boolean } from '@storybook/addon-knobs';
2
2
  import { times } from 'lodash';
3
- import { GlAreaChart } from '../../../../charts';
3
+ import { GlAreaChart } from '../../../charts';
4
4
  import { documentedStoriesOf } from '../../../../documentation/documented_stories';
5
5
  import { mockAnnotationsSeries, mockAnnotationsConfigs } from '../../../utils/charts/mock_data';
6
6
  import { toolbox } from '../../../utils/charts/story_config';
@@ -1,4 +1,4 @@
1
- import { GlBarChart } from '../../../../charts';
1
+ import { GlBarChart } from '../../../charts';
2
2
  import readme from './bar.md';
3
3
 
4
4
  const Template = (args, { argTypes }) => ({
@@ -1,5 +1,5 @@
1
- import { GlChart } from '../../../../charts';
2
- import { GlTabs, GlTab } from '../../../../index';
1
+ import { GlChart } from '../../../charts';
2
+ import { GlTabs, GlTab } from '../../../index';
3
3
  import readme from './chart.md';
4
4
 
5
5
  const Template = (args, { argTypes = {} }) => ({
@@ -1,4 +1,4 @@
1
- import { GlColumnChart } from '../../../../charts';
1
+ import { GlColumnChart } from '../../../charts';
2
2
  import {
3
3
  mockDefaultLineData,
4
4
  mockDefaultBarData,
@@ -1,4 +1,4 @@
1
- import { GlDiscreteScatterChart } from '../../../../charts';
1
+ import { GlDiscreteScatterChart } from '../../../charts';
2
2
 
3
3
  const Template = (args, { argTypes }) => ({
4
4
  components: { GlDiscreteScatterChart },
@@ -1,4 +1,4 @@
1
- import { GlHeatmap } from '../../../../charts';
1
+ import { GlHeatmap } from '../../../charts';
2
2
  import { documentedStoriesOf } from '../../../../documentation/documented_stories';
3
3
  import { toolbox } from '../../../utils/charts/story_config';
4
4
  import readme from '../area/area.md';
@@ -1,4 +1,4 @@
1
- import { GlChart, GlChartLegend } from '../../../../charts';
1
+ import { GlChart, GlChartLegend } from '../../../charts';
2
2
  import { documentedStoriesOf } from '../../../../documentation/documented_stories';
3
3
  import { LEGEND_LAYOUT_TABLE } from '../../../utils/charts/constants';
4
4
  import { generateSeriesData } from '../../../utils/charts/story_config';
@@ -1,5 +1,5 @@
1
1
  import { withKnobs, object, boolean, array } from '@storybook/addon-knobs';
2
- import { GlLineChart } from '../../../../charts';
2
+ import { GlLineChart } from '../../../charts';
3
3
  import { documentedStoriesOf } from '../../../../documentation/documented_stories';
4
4
  import { mockAnnotationsSeries, mockAnnotationsConfigs } from '../../../utils/charts/mock_data';
5
5
  import { toolbox } from '../../../utils/charts/story_config';
@@ -1,5 +1,5 @@
1
1
  import { withKnobs, text } from '@storybook/addon-knobs';
2
- import { GlChartSeriesLabel } from '../../../../charts';
2
+ import { GlChartSeriesLabel } from '../../../charts';
3
3
  import { documentedStoriesOf } from '../../../../documentation/documented_stories';
4
4
  import { colorPaletteDefault } from '../../../utils/charts/theme';
5
5
  import {
@@ -1,6 +1,6 @@
1
1
  import iconSpriteInfo from '@gitlab/svgs/dist/icons.json';
2
2
  import { withKnobs, text, select, boolean, number } from '@storybook/addon-knobs';
3
- import { GlSingleStat } from '../../../../charts';
3
+ import { GlSingleStat } from '../../../charts';
4
4
  import { documentedStoriesOf } from '../../../../documentation/documented_stories';
5
5
  import { badgeVariantOptions } from '../../../utils/constants';
6
6
  import readme from './single_stat.md';
@@ -1,4 +1,4 @@
1
- import { GlSparklineChart } from '../../../../charts';
1
+ import { GlSparklineChart } from '../../../charts';
2
2
  import readme from './sparkline.md';
3
3
 
4
4
  const chartData = [
@@ -1,4 +1,4 @@
1
- import { GlStackedColumnChart } from '../../../../charts';
1
+ import { GlStackedColumnChart } from '../../../charts';
2
2
  import {
3
3
  mockDefaultStackedLineData,
4
4
  mockDefaultStackedBarData,
@@ -1,4 +1,4 @@
1
- import { GlChart, GlChartTooltip, GlChartSeriesLabel } from '../../../../charts';
1
+ import { GlChart, GlChartTooltip, GlChartSeriesLabel } from '../../../charts';
2
2
  import {
3
3
  SERIES_NAME,
4
4
  SERIES_NAME_LONG,
@@ -1,4 +1,4 @@
1
- import { GlDashboardSkeleton } from '../../../../index';
1
+ import { GlDashboardSkeleton } from '../../../index';
2
2
  import readme from './dashboard_skeleton.md';
3
3
 
4
4
  const defaultValue = (prop) => GlDashboardSkeleton.props[prop].default;
@@ -1,4 +1,4 @@
1
- import { GlButton, GlEmptyState } from '../../../../index';
1
+ import { GlButton, GlEmptyState } from '../../../index';
2
2
  import readme from './empty_state.md';
3
3
 
4
4
  const template = `
@@ -1,4 +1,4 @@
1
- import { GlFriendlyWrap } from '../../../../index';
1
+ import { GlFriendlyWrap } from '../../../index';
2
2
  import readme from './friendly_wrap.md';
3
3
 
4
4
  const components = {
@@ -1,4 +1,4 @@
1
- import { GlIntersectionObserver } from '../../../../index';
1
+ import { GlIntersectionObserver } from '../../../index';
2
2
  import readme from './intersection_observer.md';
3
3
 
4
4
  const components = {
@@ -1,4 +1,4 @@
1
- import { GlIntersperse } from '../../../../index';
1
+ import { GlIntersperse } from '../../../index';
2
2
  import readme from './intersperse.md';
3
3
 
4
4
  const template = `
@@ -1,4 +1,4 @@
1
- import { GlSprintf, GlButton, GlLink } from '../../../../index';
1
+ import { GlSprintf, GlButton, GlLink } from '../../../index';
2
2
  import readme from './sprintf.md';
3
3
 
4
4
  const generateProps = ({ message = 'Written by %{author}', placeholders } = {}) => ({
@@ -1,4 +1,4 @@
1
- import { GlTruncate } from '../../../../index';
1
+ import { GlTruncate } from '../../../index';
2
2
  import { POSITION } from './constants';
3
3
  import readme from './truncate.md';
4
4
 
@@ -1,6 +1,6 @@
1
1
  import { BVConfigPlugin } from 'bootstrap-vue';
2
2
  import Vue from 'vue';
3
- import { tooltipDelay } from './src/utils/constants';
3
+ import { tooltipDelay } from './utils/constants';
4
4
 
5
5
  const bFormTextGlobalConfig = {
6
6
  textVariant: 'gl-muted',
@@ -1,6 +1,6 @@
1
1
  import { text } from '@storybook/addon-knobs';
2
2
  import { documentedStoriesOf } from '../../../documentation/documented_stories';
3
- import { GlHoverLoadDirective } from '../../../index';
3
+ import { GlHoverLoadDirective } from '../../index';
4
4
  import readme from './hover_load.md';
5
5
 
6
6
  const directives = {
@@ -1,4 +1,4 @@
1
- import { GlOutsideDirective } from '../../../index';
1
+ import { GlOutsideDirective } from '../../index';
2
2
  import GlButton from '../../components/base/button/button.vue';
3
3
  import readme from './outside.md';
4
4
 
@@ -1,6 +1,6 @@
1
1
  import { withKnobs, select } from '@storybook/addon-knobs';
2
2
  import { documentedStoriesOf } from '../../../documentation/documented_stories';
3
- import { GlResizeObserverDirective } from '../../../index';
3
+ import { GlResizeObserverDirective } from '../../index';
4
4
  import readme from './resize_observer.md';
5
5
 
6
6
  documentedStoriesOf('directives/resize-observer-directive', readme)
@@ -2,7 +2,7 @@ import { withKnobs, text } from '@storybook/addon-knobs';
2
2
  import { sanitize } from 'dompurify';
3
3
  import { escape } from 'lodash';
4
4
  import { documentedStoriesOf } from '../../../documentation/documented_stories';
5
- import { GlSafeHtmlDirective } from '../../../index';
5
+ import { GlSafeHtmlDirective } from '../../index';
6
6
  import readme from './safe_html.md';
7
7
 
8
8
  documentedStoriesOf('directives/safe-html-directive', readme)