@gitlab/ui 34.0.0 → 36.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.
- package/CHANGELOG.md +45 -0
- package/dist/components/base/filtered_search/filtered_search.documentation.js +6 -0
- package/dist/components/base/filtered_search/filtered_search.js +12 -2
- package/dist/components/base/filtered_search/filtered_search_term.documentation.js +6 -0
- package/dist/components/base/filtered_search/filtered_search_term.js +11 -1
- package/dist/components/base/filtered_search/filtered_search_token_segment.documentation.js +6 -0
- package/dist/components/base/filtered_search/filtered_search_token_segment.js +11 -1
- package/dist/components/base/nav/nav.documentation.js +2 -7
- package/dist/components/base/search_box_by_click/search_box_by_click.documentation.js +3 -0
- package/dist/components/base/search_box_by_click/search_box_by_click.js +6 -1
- package/dist/components/base/tabs/tabs/tabs.documentation.js +1 -1
- package/dist/components/base/tabs/tabs/tabs.js +2 -12
- package/dist/components/utilities/truncate/truncate.documentation.js +2 -17
- package/dist/components/utilities/truncate/truncate.js +11 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/utility_classes.css +1 -1
- package/dist/utility_classes.css.map +1 -1
- package/documentation/all_components.js +2 -2
- package/documentation/components_documentation.js +0 -2
- package/documentation/documented_stories.js +4 -0
- package/package.json +7 -10
- package/src/charts.js +19 -0
- package/src/components/base/alert/alert.stories.js +1 -1
- package/src/components/base/avatar/avatar.stories.js +8 -0
- package/src/components/base/avatar_labeled/avatar_labeled.stories.js +7 -0
- package/src/components/base/avatar_link/avatar_link.stories.js +7 -0
- package/src/components/base/avatars_inline/avatars_inline.stories.js +1 -1
- package/src/components/base/badge/badge.stories.js +115 -10
- package/src/components/base/banner/banner.stories.js +1 -1
- package/src/components/base/breadcrumb/breadcrumb.stories.js +1 -1
- package/src/components/base/broadcast_message/broadcast_message.stories.js +3 -3
- package/src/components/base/button/button.stories.js +11 -11
- package/src/components/base/button_group/button_group.stories.js +1 -1
- package/src/components/base/collapse/collapse.stories.js +1 -1
- package/src/components/base/drawer/drawer.stories.js +1 -1
- package/src/components/base/dropdown/dropdown.stories.js +5 -3
- package/src/components/base/dropdown/dropdown_divider.stories.js +1 -1
- package/src/components/base/dropdown/dropdown_form.stories.js +1 -1
- package/src/components/base/dropdown/dropdown_item.stories.js +1 -1
- package/src/components/base/dropdown/dropdown_section_header.stories.js +1 -1
- package/src/components/base/dropdown/dropdown_text.stories.js +1 -1
- package/src/components/base/filtered_search/filtered_search.documentation.js +6 -0
- package/src/components/base/filtered_search/filtered_search.spec.js +81 -47
- package/src/components/base/filtered_search/filtered_search.stories.js +11 -1
- package/src/components/base/filtered_search/filtered_search.vue +13 -0
- package/src/components/base/filtered_search/filtered_search_suggestion.stories.js +2 -0
- package/src/components/base/filtered_search/filtered_search_suggestion_list.stories.js +2 -0
- package/src/components/base/filtered_search/filtered_search_term.documentation.js +6 -0
- package/src/components/base/filtered_search/filtered_search_term.spec.js +42 -9
- package/src/components/base/filtered_search/filtered_search_term.vue +13 -0
- package/src/components/base/filtered_search/filtered_search_token.stories.js +2 -0
- package/src/components/base/filtered_search/filtered_search_token_segment.documentation.js +6 -0
- package/src/components/base/filtered_search/filtered_search_token_segment.spec.js +53 -0
- package/src/components/base/filtered_search/filtered_search_token_segment.stories.js +2 -0
- package/src/components/base/filtered_search/filtered_search_token_segment.vue +12 -0
- package/src/components/base/form/form.stories.js +1 -1
- package/src/components/base/form/form_checkbox/form_checkbox.stories.js +1 -1
- package/src/components/base/form/form_group/form_group.stories.js +6 -5
- package/src/components/base/form/form_input/form_input.stories.js +1 -1
- package/src/components/base/form/form_input_group/form_input_group.stories.js +1 -1
- package/src/components/base/form/form_radio/form_radio.stories.js +1 -1
- package/src/components/base/form/form_radio_group/form_radio_group.stories.js +2 -1
- package/src/components/base/form/form_select/form_select.stories.js +1 -1
- package/src/components/base/form/form_text/form_text.vue +3 -1
- package/src/components/base/form/form_textarea/form_textarea.stories.js +1 -1
- package/src/components/base/icon/icon.stories.js +1 -1
- package/src/components/base/infinite_scroll/infinite_scroll.stories.js +1 -1
- package/src/components/base/label/label.stories.js +1 -1
- package/src/components/base/link/link.stories.js +1 -1
- package/src/components/base/loading_icon/loading_icon.stories.js +2 -1
- package/src/components/base/modal/modal.scss +5 -2
- package/src/components/base/modal/modal.stories.js +1 -1
- package/src/components/base/nav/nav.documentation.js +0 -4
- package/src/components/base/nav/nav.md +8 -5
- package/src/components/base/nav/nav.stories.js +52 -15
- package/src/components/base/navbar/navbar.stories.js +1 -1
- package/src/components/base/paginated_list/paginated_list.stories.js +1 -1
- package/src/components/base/pagination/pagination.stories.js +7 -0
- package/src/components/base/path/path.stories.js +2 -2
- package/src/components/base/popover/popover.stories.js +6 -0
- package/src/components/base/progress_bar/progress_bar.stories.js +1 -1
- package/src/components/base/search_box_by_click/search_box_by_click.documentation.js +3 -0
- package/src/components/base/search_box_by_click/search_box_by_click.spec.js +14 -3
- package/src/components/base/search_box_by_click/search_box_by_click.stories.js +1 -1
- package/src/components/base/search_box_by_click/search_box_by_click.vue +7 -0
- package/src/components/base/search_box_by_type/search_box_by_type.stories.js +1 -1
- package/src/components/base/segmented_control/segmented_control.stories.js +1 -1
- package/src/components/base/skeleton_loader/skeleton_loader.stories.js +1 -1
- package/src/components/base/skeleton_loading/skeleton_loading.stories.js +1 -1
- package/src/components/base/sorting/sorting.stories.js +1 -1
- package/src/components/base/sorting/sorting_item.stories.js +1 -1
- package/src/components/base/table/table.stories.js +6 -1
- package/src/components/base/tabs/tabs/scrollable_tabs.spec.js +0 -1
- package/src/components/base/tabs/tabs/tabs.md +2 -2
- package/src/components/base/tabs/tabs/tabs.scss +3 -115
- package/src/components/base/tabs/tabs/tabs.spec.js +8 -5
- package/src/components/base/tabs/tabs/tabs.stories.js +9 -13
- package/src/components/base/tabs/tabs/tabs.vue +2 -11
- package/src/components/base/toast/toast.stories.js +6 -4
- package/src/components/base/toggle/toggle.stories.js +1 -1
- package/src/components/base/token/token.stories.js +2 -2
- package/src/components/base/tooltip/tooltip.stories.js +2 -1
- package/src/components/charts/area/area.stories.js +1 -1
- package/src/components/charts/bar/bar.stories.js +1 -1
- package/src/components/charts/chart/chart.stories.js +2 -2
- package/src/components/charts/column/column.stories.js +1 -1
- package/src/components/charts/discrete_scatter/discrete_scatter.stories.js +1 -1
- package/src/components/charts/heatmap/heatmap.stories.js +1 -1
- package/src/components/charts/legend/legend.stories.js +1 -1
- package/src/components/charts/line/line.stories.js +1 -1
- package/src/components/charts/series_label/series_label.stories.js +1 -1
- package/src/components/charts/single_stat/single_stat.stories.js +1 -1
- package/src/components/charts/sparkline/sparkline.stories.js +1 -1
- package/src/components/charts/stacked_column/stacked_column.stories.js +1 -1
- package/src/components/charts/tooltip/tooltip.stories.js +1 -1
- package/src/components/regions/dashboard_skeleton/dashboard_skeleton.stories.js +1 -1
- package/src/components/regions/empty_state/empty_state.stories.js +1 -1
- package/src/components/utilities/friendly_wrap/friendly_wrap.stories.js +1 -1
- package/src/components/utilities/intersection_observer/intersection_observer.stories.js +1 -1
- package/src/components/utilities/intersperse/intersperse.stories.js +1 -1
- package/src/components/utilities/sprintf/sprintf.stories.js +1 -1
- package/src/components/utilities/truncate/truncate.documentation.js +0 -14
- package/src/components/utilities/truncate/truncate.md +0 -4
- package/src/components/utilities/truncate/truncate.stories.js +38 -27
- package/src/components/utilities/truncate/truncate.vue +9 -0
- package/{config.js → src/config.js} +1 -1
- package/src/directives/hover_load/hover_load.stories.js +1 -1
- package/src/directives/outside/outside.stories.js +1 -1
- package/src/directives/resize_observer/resize_observer.stories.js +1 -1
- package/src/directives/safe_html/safe_html.stories.js +1 -1
- package/src/index.js +111 -0
- package/src/scss/utilities.scss +8 -0
- package/src/scss/utility-mixins/box-shadow.scss +4 -0
- package/{utils.js → src/utils.js} +1 -1
- package/charts.js +0 -19
- package/dist/components/base/nav/examples/index.js +0 -13
- package/dist/components/base/nav/examples/nav.basic.example.js +0 -38
- package/dist/components/base/nav/nav_item.documentation.js +0 -13
- package/dist/components/base/nav/nav_item_dropdown.documentation.js +0 -14
- package/dist/components/utilities/truncate/examples/index.js +0 -13
- package/dist/components/utilities/truncate/examples/truncate.basic.example.js +0 -38
- package/index.js +0 -111
- package/src/components/base/nav/examples/index.js +0 -15
- package/src/components/base/nav/examples/nav.basic.example.vue +0 -8
- package/src/components/base/nav/nav_item.documentation.js +0 -6
- package/src/components/base/nav/nav_item.md +0 -7
- package/src/components/base/nav/nav_item.stories.js +0 -23
- package/src/components/base/nav/nav_item_dropdown.documentation.js +0 -7
- package/src/components/base/nav/nav_item_dropdown.md +0 -7
- package/src/components/base/nav/nav_item_dropdown.stories.js +0 -51
- package/src/components/utilities/truncate/examples/index.js +0 -15
- package/src/components/utilities/truncate/examples/truncate.basic.example.vue +0 -5
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { GlTable } from '
|
|
1
|
+
import { GlTable, GlFormInput } from '../../../index';
|
|
2
2
|
import readme from './table.md';
|
|
3
3
|
|
|
4
|
+
const components = { GlTable };
|
|
5
|
+
|
|
4
6
|
const tableItems = [
|
|
5
7
|
{
|
|
6
8
|
column_one: 'test',
|
|
@@ -23,6 +25,7 @@ const generateProps = ({ fixed = false, footClone = false, stacked = false } = {
|
|
|
23
25
|
});
|
|
24
26
|
|
|
25
27
|
export const Default = (args, { argTypes }) => ({
|
|
28
|
+
components,
|
|
26
29
|
props: Object.keys(argTypes),
|
|
27
30
|
template: `
|
|
28
31
|
<gl-table
|
|
@@ -55,6 +58,7 @@ export const Default = (args, { argTypes }) => ({
|
|
|
55
58
|
Default.args = generateProps();
|
|
56
59
|
|
|
57
60
|
export const Empty = (args, { argTypes }) => ({
|
|
61
|
+
components,
|
|
58
62
|
props: Object.keys(argTypes),
|
|
59
63
|
template: `
|
|
60
64
|
<gl-table show-empty />
|
|
@@ -63,6 +67,7 @@ export const Empty = (args, { argTypes }) => ({
|
|
|
63
67
|
Empty.parameters = { controls: { disable: true } };
|
|
64
68
|
|
|
65
69
|
export const WithFilter = (args, { argTypes }) => ({
|
|
70
|
+
components: { ...components, GlFormInput },
|
|
66
71
|
props: Object.keys(argTypes),
|
|
67
72
|
template: `<div class="gl-line-height-normal">
|
|
68
73
|
<gl-form-input v-model="filter" placeholder="Type to search" />
|
|
@@ -10,7 +10,7 @@ tab, when active, will reveal it’s own unique content.
|
|
|
10
10
|
## Using the component Vue
|
|
11
11
|
|
|
12
12
|
~~~js
|
|
13
|
-
<gl-tabs
|
|
13
|
+
<gl-tabs>
|
|
14
14
|
<gl-tab title="Tab 1">
|
|
15
15
|
Tab panel 1
|
|
16
16
|
</gl-tab>
|
|
@@ -75,7 +75,7 @@ component. This is a separate Vue component because of some limitations:
|
|
|
75
75
|
exceptions).
|
|
76
76
|
|
|
77
77
|
~~~html
|
|
78
|
-
<gl-scrollable-tabs
|
|
78
|
+
<gl-scrollable-tabs>
|
|
79
79
|
<gl-tab v-for="tab in tabs" :key="tab.key" :title="tab.title"> {{ tab.content }} </gl-tab>
|
|
80
80
|
</gl-scrollable-tabs>
|
|
81
81
|
~~~
|
|
@@ -52,125 +52,13 @@
|
|
|
52
52
|
.gl-tab-nav-item-active {
|
|
53
53
|
@include gl-font-weight-bold;
|
|
54
54
|
@include gl-text-gray-900;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
.gl-tab-nav-item-active-indigo {
|
|
58
|
-
@include gl-inset-border-b-2-theme-indigo-500;
|
|
59
|
-
|
|
60
|
-
&:active,
|
|
61
|
-
&:focus,
|
|
62
|
-
&:focus:active {
|
|
63
|
-
box-shadow: inset 0 -#{$gl-border-size-2} 0 0 $theme-indigo-500, $focus-ring;
|
|
64
|
-
@include gl-outline-none;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.gl-tab-nav-item-active-light-indigo {
|
|
69
|
-
@include gl-inset-border-b-2-theme-indigo-300;
|
|
70
|
-
|
|
71
|
-
&:active,
|
|
72
|
-
&:focus,
|
|
73
|
-
&:focus:active {
|
|
74
|
-
box-shadow: inset 0 -#{$gl-border-size-2} 0 0 $theme-indigo-300, $focus-ring;
|
|
75
|
-
@include gl-outline-none;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.gl-tab-nav-item-active-blue {
|
|
80
|
-
@include gl-inset-border-b-2-theme-blue-500;
|
|
81
|
-
|
|
82
|
-
&:active,
|
|
83
|
-
&:focus,
|
|
84
|
-
&:focus:active {
|
|
85
|
-
box-shadow: inset 0 -#{$gl-border-size-2} 0 0 $theme-blue-500, $focus-ring;
|
|
86
|
-
@include gl-outline-none;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.gl-tab-nav-item-active-light-blue {
|
|
91
|
-
@include gl-inset-border-b-2-theme-light-blue-500;
|
|
92
|
-
|
|
93
|
-
&:active,
|
|
94
|
-
&:focus,
|
|
95
|
-
&:focus:active {
|
|
96
|
-
box-shadow: inset 0 -#{$gl-border-size-2} 0 0 $theme-light-blue-500, $focus-ring;
|
|
97
|
-
@include gl-outline-none;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.gl-tab-nav-item-active-red {
|
|
102
|
-
@include gl-inset-border-b-2-theme-red-500;
|
|
103
|
-
|
|
104
|
-
&:active,
|
|
105
|
-
&:focus,
|
|
106
|
-
&:focus:active {
|
|
107
|
-
box-shadow: inset 0 -#{$gl-border-size-2} 0 0 $theme-red-500, $focus-ring;
|
|
108
|
-
@include gl-outline-none;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.gl-tab-nav-item-active-light-red {
|
|
113
|
-
@include gl-inset-border-b-2-theme-light-red-500;
|
|
114
|
-
|
|
115
|
-
&:active,
|
|
116
|
-
&:focus,
|
|
117
|
-
&:focus:active {
|
|
118
|
-
box-shadow: inset 0 -#{$gl-border-size-2} 0 0 $theme-light-red-500, $focus-ring;
|
|
119
|
-
@include gl-outline-none;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.gl-tab-nav-item-active-green {
|
|
124
|
-
@include gl-inset-border-b-2-theme-green-500;
|
|
125
|
-
|
|
126
|
-
&:active,
|
|
127
|
-
&:focus,
|
|
128
|
-
&:focus:active {
|
|
129
|
-
box-shadow: inset 0 -#{$gl-border-size-2} 0 0 $theme-green-500, $focus-ring;
|
|
130
|
-
@include gl-outline-none;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.gl-tab-nav-item-active-light-green {
|
|
135
|
-
@include gl-inset-border-b-2-theme-green-300;
|
|
136
|
-
|
|
137
|
-
&:active,
|
|
138
|
-
&:focus,
|
|
139
|
-
&:focus:active {
|
|
140
|
-
box-shadow: inset 0 -#{$gl-border-size-2} 0 0 $theme-green-300, $focus-ring;
|
|
141
|
-
@include gl-outline-none;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.gl-tab-nav-item-active-dark {
|
|
146
|
-
@include gl-inset-border-b-2-gray-500;
|
|
147
|
-
|
|
148
|
-
&:active,
|
|
149
|
-
&:focus,
|
|
150
|
-
&:focus:active {
|
|
151
|
-
box-shadow: inset 0 -#{$gl-border-size-2} 0 0 $gray-500, $focus-ring;
|
|
152
|
-
@include gl-outline-none;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.gl-tab-nav-item-active-light {
|
|
157
|
-
@include gl-inset-border-b-2-gray-300;
|
|
158
|
-
|
|
159
|
-
&:active,
|
|
160
|
-
&:focus,
|
|
161
|
-
&:focus:active {
|
|
162
|
-
box-shadow: inset 0 -#{$gl-border-size-2} 0 0 $gray-300, $focus-ring;
|
|
163
|
-
@include gl-outline-none;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
.gl-tab-nav-item-active-gl-dark {
|
|
168
|
-
@include gl-inset-border-b-2-gray-100;
|
|
55
|
+
@include gl-inset-border-b-2-theme-accent;
|
|
169
56
|
|
|
170
57
|
&:active,
|
|
171
58
|
&:focus,
|
|
172
59
|
&:focus:active {
|
|
173
|
-
box-shadow: inset 0 -#{$gl-border-size-2} 0 0
|
|
60
|
+
box-shadow: inset 0 -#{$gl-border-size-2} 0 0 var(--gl-theme-accent, $theme-indigo-500),
|
|
61
|
+
$focus-ring;
|
|
174
62
|
@include gl-outline-none;
|
|
175
63
|
}
|
|
176
64
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { mount
|
|
1
|
+
import { mount } from '@vue/test-utils';
|
|
2
2
|
import { nextTick } from 'vue';
|
|
3
|
-
import { GlButton } from '
|
|
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';
|
|
@@ -44,9 +44,12 @@ describe('tabs component', () => {
|
|
|
44
44
|
wrapper.findAll('[role="tab"]').wrappers.find((tabWrapper) => tabWrapper.text() === text);
|
|
45
45
|
|
|
46
46
|
describe('default', () => {
|
|
47
|
-
it('
|
|
48
|
-
buildTabs(
|
|
49
|
-
|
|
47
|
+
it('the active tab should be styled', async () => {
|
|
48
|
+
buildTabs();
|
|
49
|
+
|
|
50
|
+
await nextTick();
|
|
51
|
+
|
|
52
|
+
expect(findActiveTab().classes()).toContain('gl-tab-nav-item-active');
|
|
50
53
|
});
|
|
51
54
|
});
|
|
52
55
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { withKnobs,
|
|
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 '
|
|
5
|
-
import { colorThemes } from '../../../../utils/constants';
|
|
4
|
+
import { GlTabs, GlTab, GlScrollableTabs } from '../../../../index';
|
|
6
5
|
import docs from './tabs.md';
|
|
7
6
|
|
|
8
7
|
const ScrollableTabsGenerator = {
|
|
9
8
|
components: {
|
|
9
|
+
GlTabs,
|
|
10
10
|
GlScrollableTabs,
|
|
11
11
|
GlTab,
|
|
12
12
|
},
|
|
@@ -39,10 +39,6 @@ const createBaseStory = () => ({
|
|
|
39
39
|
GlTab,
|
|
40
40
|
},
|
|
41
41
|
props: {
|
|
42
|
-
theme: {
|
|
43
|
-
type: String,
|
|
44
|
-
default: select('theme', [...Object.keys(colorThemes), 'gl-dark'], 'indigo'),
|
|
45
|
-
},
|
|
46
42
|
syncActiveTabWithQueryParams: {
|
|
47
43
|
type: Boolean,
|
|
48
44
|
default: boolean('sync-active-tab-with-query-params', false),
|
|
@@ -55,7 +51,7 @@ documentedStoriesOf('base/tabs/tabs', docs)
|
|
|
55
51
|
.add('default', () => ({
|
|
56
52
|
...createBaseStory(),
|
|
57
53
|
template: `
|
|
58
|
-
<gl-tabs :
|
|
54
|
+
<gl-tabs :sync-active-tab-with-query-params="syncActiveTabWithQueryParams">
|
|
59
55
|
<gl-tab title="Tab 1">
|
|
60
56
|
Tab panel 1
|
|
61
57
|
</gl-tab>
|
|
@@ -104,7 +100,7 @@ documentedStoriesOf('base/tabs/tabs', docs)
|
|
|
104
100
|
.add('contentless tab', () => ({
|
|
105
101
|
...createBaseStory(),
|
|
106
102
|
template: `
|
|
107
|
-
<gl-tabs
|
|
103
|
+
<gl-tabs>
|
|
108
104
|
<gl-tab title="Regular tab">
|
|
109
105
|
<p>Regular tab content.</p>
|
|
110
106
|
<p>The contentless tab is not selectable, as it has no content. This is useful for displaying things that aren't really tabs after the list of tabs.</p>
|
|
@@ -123,7 +119,7 @@ documentedStoriesOf('base/tabs/tabs', docs)
|
|
|
123
119
|
.add('empty state', () => ({
|
|
124
120
|
...createBaseStory(),
|
|
125
121
|
template: `
|
|
126
|
-
<gl-tabs
|
|
122
|
+
<gl-tabs>
|
|
127
123
|
<template #empty>
|
|
128
124
|
This content is only displayed when there are no tabs. Useful for dynamically added/removed tabs.
|
|
129
125
|
</template>
|
|
@@ -133,7 +129,7 @@ documentedStoriesOf('base/tabs/tabs', docs)
|
|
|
133
129
|
.add('justified tabs', () => ({
|
|
134
130
|
...createBaseStory(),
|
|
135
131
|
template: `
|
|
136
|
-
<gl-tabs
|
|
132
|
+
<gl-tabs justified>
|
|
137
133
|
<gl-tab title="Tab 1">
|
|
138
134
|
<p>Tab panel 1</p>
|
|
139
135
|
</gl-tab>
|
|
@@ -177,7 +173,7 @@ documentedStoriesOf('base/tabs/tabs', docs)
|
|
|
177
173
|
components: {
|
|
178
174
|
ScrollableTabsGenerator,
|
|
179
175
|
},
|
|
180
|
-
template: '<scrollable-tabs-generator :count="50"
|
|
176
|
+
template: '<scrollable-tabs-generator :count="50" />',
|
|
181
177
|
}))
|
|
182
178
|
.add(
|
|
183
179
|
'with scroll and growing',
|
|
@@ -197,7 +193,7 @@ documentedStoriesOf('base/tabs/tabs', docs)
|
|
|
197
193
|
this.count += 1;
|
|
198
194
|
}, 2000);
|
|
199
195
|
},
|
|
200
|
-
template: '<scrollable-tabs-generator :count="count"
|
|
196
|
+
template: '<scrollable-tabs-generator :count="count" />',
|
|
201
197
|
}),
|
|
202
198
|
{ storyshots: false }
|
|
203
199
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { BTabs } from 'bootstrap-vue';
|
|
3
|
-
import {
|
|
3
|
+
import { tabsButtonDefaults } from '../../../../utils/constants';
|
|
4
4
|
import GlButton from '../../button/button.vue';
|
|
5
5
|
|
|
6
6
|
const validatorHelper = (obj) =>
|
|
@@ -31,12 +31,6 @@ export default {
|
|
|
31
31
|
default: null,
|
|
32
32
|
validator: (obj) => validatorHelper(obj),
|
|
33
33
|
},
|
|
34
|
-
theme: {
|
|
35
|
-
type: String,
|
|
36
|
-
required: false,
|
|
37
|
-
default: 'indigo',
|
|
38
|
-
validator: (value) => Object.keys(colorThemes).includes(value) || value === 'gl-dark',
|
|
39
|
-
},
|
|
40
34
|
contentClass: {
|
|
41
35
|
type: [String, Array, Object],
|
|
42
36
|
required: false,
|
|
@@ -77,9 +71,6 @@ export default {
|
|
|
77
71
|
hasActions() {
|
|
78
72
|
return [this.actionPrimary, this.actionSecondary, this.actionTertiary].some(Boolean);
|
|
79
73
|
},
|
|
80
|
-
activeItemBorderClass() {
|
|
81
|
-
return `gl-tab-nav-item-active-${this.theme}`;
|
|
82
|
-
},
|
|
83
74
|
listeners() {
|
|
84
75
|
return {
|
|
85
76
|
...this.$listeners,
|
|
@@ -214,7 +205,7 @@ export default {
|
|
|
214
205
|
ref="bTabs"
|
|
215
206
|
:no-nav-style="true"
|
|
216
207
|
:no-fade="true"
|
|
217
|
-
|
|
208
|
+
active-nav-item-class="gl-tab-nav-item-active"
|
|
218
209
|
:content-class="[contentClass, 'gl-tab-content']"
|
|
219
210
|
:nav-class="[navClass, 'gl-tabs-nav']"
|
|
220
211
|
:justified="justified"
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import Vue from 'vue';
|
|
2
|
-
import { GlToast } from '
|
|
2
|
+
import { GlToast, GlButton } from '../../../index';
|
|
3
3
|
import readme from './toast.md';
|
|
4
4
|
|
|
5
5
|
Vue.use(GlToast);
|
|
6
6
|
|
|
7
|
+
const components = { GlToast, GlButton };
|
|
8
|
+
|
|
7
9
|
const Template = () => ({
|
|
8
|
-
components
|
|
10
|
+
components,
|
|
9
11
|
template: `
|
|
10
12
|
<gl-button @click="showToast()">
|
|
11
13
|
Show default toast
|
|
@@ -23,7 +25,7 @@ const Template = () => ({
|
|
|
23
25
|
export const Default = Template.bind({});
|
|
24
26
|
|
|
25
27
|
export const WithActions = () => ({
|
|
26
|
-
components
|
|
28
|
+
components,
|
|
27
29
|
template: `
|
|
28
30
|
<gl-button @click="showToast()">
|
|
29
31
|
Show toast with actions
|
|
@@ -44,7 +46,7 @@ export const WithActions = () => ({
|
|
|
44
46
|
});
|
|
45
47
|
|
|
46
48
|
export const WithLongContent = () => ({
|
|
47
|
-
components
|
|
49
|
+
components,
|
|
48
50
|
template: `
|
|
49
51
|
<gl-button @click="showToast()">
|
|
50
52
|
Show toast with a long content
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GlToken } from '
|
|
1
|
+
import { GlToken, GlAvatar } from '../../../index';
|
|
2
2
|
import { tokenVariants } from '../../../utils/constants';
|
|
3
3
|
|
|
4
4
|
import readme from './token.md';
|
|
@@ -31,7 +31,7 @@ ViewOnly.args = generateProps({
|
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
export const WithAvatar = () => ({
|
|
34
|
-
components: { GlToken },
|
|
34
|
+
components: { GlToken, GlAvatar },
|
|
35
35
|
template: `
|
|
36
36
|
<div class="gl-display-flex">
|
|
37
37
|
<gl-token><gl-avatar src="./img/avatar.png" :size="16" />Token</gl-token>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { GlTooltip, GlTooltipDirective } from '
|
|
1
|
+
import { GlTooltip, GlTooltipDirective, GlButton } from '../../../index';
|
|
2
2
|
import readme from './tooltip.md';
|
|
3
3
|
|
|
4
4
|
function makeTooltip(modifier = '') {
|
|
5
5
|
return {
|
|
6
|
+
components: { GlTooltip, GlButton },
|
|
6
7
|
directives: {
|
|
7
8
|
GlTooltip: GlTooltipDirective,
|
|
8
9
|
},
|
|
@@ -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 '
|
|
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,5 +1,5 @@
|
|
|
1
|
-
import { GlChart } from '
|
|
2
|
-
import { GlTabs, GlTab } from '
|
|
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 { GlHeatmap } from '
|
|
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 '
|
|
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 '
|
|
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 '
|
|
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 '
|
|
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,19 +1,5 @@
|
|
|
1
|
-
import examples from './examples';
|
|
2
1
|
import description from './truncate.md';
|
|
3
2
|
|
|
4
3
|
export default {
|
|
5
4
|
description,
|
|
6
|
-
examples,
|
|
7
|
-
propsInfo: {
|
|
8
|
-
text: {
|
|
9
|
-
additionalInfo: 'Text to be ellipsized',
|
|
10
|
-
},
|
|
11
|
-
position: {
|
|
12
|
-
additionalInfo: 'Ellipsis position',
|
|
13
|
-
enum: 'truncateOptions',
|
|
14
|
-
},
|
|
15
|
-
withTooltip: {
|
|
16
|
-
additionalInfo: 'Display the full text in a tooltip only if it is being truncated',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
5
|
};
|