@gitlab/ui 33.1.2 → 36.0.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 +55 -0
- package/dist/components/base/avatars_inline/avatars_inline.documentation.js +1 -1
- package/dist/components/base/avatars_inline/avatars_inline.js +5 -1
- package/dist/components/base/nav/nav.documentation.js +2 -7
- 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 +15 -18
- 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.md +5 -0
- package/src/components/base/avatars_inline/avatars_inline.spec.js +21 -1
- package/src/components/base/avatars_inline/avatars_inline.stories.js +23 -9
- package/src/components/base/avatars_inline/avatars_inline.vue +11 -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.stories.js +11 -1
- 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_token.stories.js +2 -0
- package/src/components/base/filtered_search/filtered_search_token_segment.stories.js +2 -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.stories.js +1 -1
- 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
|
@@ -2,6 +2,8 @@ import { alignOptions } from '../../../utils/constants';
|
|
|
2
2
|
import readme from './pagination.md';
|
|
3
3
|
import GlPagination from './pagination.vue';
|
|
4
4
|
|
|
5
|
+
const components = { GlPagination };
|
|
6
|
+
|
|
5
7
|
const generateBaseProps = ({ prevText = 'Prev', nextText = 'Next', disabled = false } = {}) => ({
|
|
6
8
|
prevText,
|
|
7
9
|
nextText,
|
|
@@ -30,6 +32,7 @@ const defaults = {
|
|
|
30
32
|
};
|
|
31
33
|
|
|
32
34
|
export const Default = (args, { argTypes }) => ({
|
|
35
|
+
components,
|
|
33
36
|
props: Object.keys(argTypes),
|
|
34
37
|
...defaults,
|
|
35
38
|
template: `<gl-pagination
|
|
@@ -44,6 +47,7 @@ export const Default = (args, { argTypes }) => ({
|
|
|
44
47
|
Default.args = generateFullProps();
|
|
45
48
|
|
|
46
49
|
export const Compact = () => ({
|
|
50
|
+
components,
|
|
47
51
|
...defaults,
|
|
48
52
|
props: generateFullProps(),
|
|
49
53
|
data() {
|
|
@@ -77,6 +81,7 @@ export const Compact = () => ({
|
|
|
77
81
|
});
|
|
78
82
|
|
|
79
83
|
export const LinkBased = (args, { argTypes }) => ({
|
|
84
|
+
components,
|
|
80
85
|
props: Object.keys(argTypes),
|
|
81
86
|
...defaults,
|
|
82
87
|
methods: {
|
|
@@ -97,6 +102,7 @@ export const LinkBased = (args, { argTypes }) => ({
|
|
|
97
102
|
LinkBased.args = generateFullProps();
|
|
98
103
|
|
|
99
104
|
export const AlignCenter = (args, { argTypes }) => ({
|
|
105
|
+
components,
|
|
100
106
|
props: Object.keys(argTypes),
|
|
101
107
|
...defaults,
|
|
102
108
|
template: `<gl-pagination
|
|
@@ -112,6 +118,7 @@ export const AlignCenter = (args, { argTypes }) => ({
|
|
|
112
118
|
AlignCenter.args = generateFullProps();
|
|
113
119
|
|
|
114
120
|
export const AlignRight = (args, { argTypes }) => ({
|
|
121
|
+
components,
|
|
115
122
|
props: Object.keys(argTypes),
|
|
116
123
|
...defaults,
|
|
117
124
|
template: `<gl-pagination
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GlPath } from '
|
|
1
|
+
import { GlPath, GlPopover } from '../../../index';
|
|
2
2
|
import { glThemes } from '../../../utils/constants';
|
|
3
3
|
import { mockPathItems } from './data';
|
|
4
4
|
import readme from './path.md';
|
|
@@ -28,7 +28,7 @@ export const Default = (args, { argTypes }) => ({
|
|
|
28
28
|
Default.args = generateProps();
|
|
29
29
|
|
|
30
30
|
export const WithPopovers = (args, { argTypes }) => ({
|
|
31
|
-
components: { GlPath },
|
|
31
|
+
components: { GlPath, GlPopover },
|
|
32
32
|
props: Object.keys(argTypes),
|
|
33
33
|
template: template(`
|
|
34
34
|
<template #default="{ pathItem, pathId }">
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { withKnobs, select, text } from '@storybook/addon-knobs';
|
|
2
|
+
import { GlPopover, GlButton } from '../../../index';
|
|
2
3
|
import { documentedStoriesOf } from '../../../../documentation/documented_stories';
|
|
3
4
|
import { popoverPlacements } from '../../../utils/constants';
|
|
4
5
|
|
|
6
|
+
const components = { GlPopover, GlButton };
|
|
7
|
+
|
|
5
8
|
const contentString = `
|
|
6
9
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent volutpat a nisi non
|
|
7
10
|
pellentesque. Pellentesque efficitur vulputate rutrum. Fusce nisl magna, porttitor in
|
|
@@ -57,10 +60,12 @@ function generateProps({ placement = popoverPlacements.top, title = 'Popover', t
|
|
|
57
60
|
documentedStoriesOf('base/popover', '')
|
|
58
61
|
.addDecorator(withKnobs)
|
|
59
62
|
.add('default', () => ({
|
|
63
|
+
components,
|
|
60
64
|
template,
|
|
61
65
|
props: generateProps(),
|
|
62
66
|
}))
|
|
63
67
|
.add('with close button', () => ({
|
|
68
|
+
components,
|
|
64
69
|
template: `
|
|
65
70
|
<div class="gl-display-flex gl-justify-content-center gl-p-6">
|
|
66
71
|
<gl-button id="pop-with-close-button">{{placement}}</gl-button>
|
|
@@ -81,6 +86,7 @@ documentedStoriesOf('base/popover', '')
|
|
|
81
86
|
.add(
|
|
82
87
|
'on click',
|
|
83
88
|
() => ({
|
|
89
|
+
components,
|
|
84
90
|
template: scopedSlotTemplate,
|
|
85
91
|
props: generateProps(),
|
|
86
92
|
}),
|
|
@@ -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 '
|
|
3
|
+
import { GlSearchBoxByClick } from '../../../index';
|
|
4
4
|
import readme from './search_box_by_click.md';
|
|
5
5
|
|
|
6
6
|
const components = {
|
|
@@ -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 '
|
|
3
|
+
import { GlSearchBoxByType } from '../../../index';
|
|
4
4
|
import readme from './search_box_by_type.md';
|
|
5
5
|
|
|
6
6
|
const components = {
|
|
@@ -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';
|