@gitlab/ui 33.1.0 → 35.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.
Files changed (51) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/components/base/accordion/accordion.js +6 -2
  3. package/dist/components/base/accordion/accordion_item.js +2 -2
  4. package/dist/components/base/avatars_inline/avatars_inline.documentation.js +1 -1
  5. package/dist/components/base/avatars_inline/avatars_inline.js +5 -1
  6. package/dist/components/base/tabs/tabs/tabs.documentation.js +1 -1
  7. package/dist/components/base/tabs/tabs/tabs.js +2 -12
  8. package/dist/index.css +1 -1
  9. package/dist/index.css.map +1 -1
  10. package/dist/utility_classes.css +1 -1
  11. package/dist/utility_classes.css.map +1 -1
  12. package/package.json +12 -10
  13. package/src/components/base/accordion/accordion.vue +5 -2
  14. package/src/components/base/accordion/accordion_item.spec.js +2 -2
  15. package/src/components/base/accordion/accordion_item.stories.js +2 -2
  16. package/src/components/base/accordion/accordion_item.vue +2 -2
  17. package/src/components/base/avatar/avatar.stories.js +8 -0
  18. package/src/components/base/avatar_labeled/avatar_labeled.stories.js +7 -0
  19. package/src/components/base/avatar_link/avatar_link.stories.js +7 -0
  20. package/src/components/base/avatars_inline/avatars_inline.md +5 -0
  21. package/src/components/base/avatars_inline/avatars_inline.spec.js +21 -1
  22. package/src/components/base/avatars_inline/avatars_inline.stories.js +23 -9
  23. package/src/components/base/avatars_inline/avatars_inline.vue +11 -1
  24. package/src/components/base/badge/badge.stories.js +114 -9
  25. package/src/components/base/broadcast_message/broadcast_message.stories.js +2 -2
  26. package/src/components/base/button/button.stories.js +11 -11
  27. package/src/components/base/dropdown/dropdown.stories.js +4 -2
  28. package/src/components/base/filtered_search/filtered_search.stories.js +11 -1
  29. package/src/components/base/filtered_search/filtered_search_suggestion.stories.js +2 -0
  30. package/src/components/base/filtered_search/filtered_search_suggestion_list.stories.js +2 -0
  31. package/src/components/base/filtered_search/filtered_search_token.stories.js +2 -0
  32. package/src/components/base/filtered_search/filtered_search_token_segment.stories.js +2 -0
  33. package/src/components/base/form/form_group/form_group.stories.js +6 -5
  34. package/src/components/base/form/form_radio_group/form_radio_group.stories.js +2 -1
  35. package/src/components/base/loading_icon/loading_icon.stories.js +1 -0
  36. package/src/components/base/nav/nav_item_dropdown.stories.js +3 -2
  37. package/src/components/base/pagination/pagination.stories.js +7 -0
  38. package/src/components/base/path/path.stories.js +2 -2
  39. package/src/components/base/popover/popover.stories.js +6 -0
  40. package/src/components/base/table/table.stories.js +6 -1
  41. package/src/components/base/tabs/tabs/scrollable_tabs.spec.js +0 -1
  42. package/src/components/base/tabs/tabs/tabs.md +2 -2
  43. package/src/components/base/tabs/tabs/tabs.scss +3 -115
  44. package/src/components/base/tabs/tabs/tabs.spec.js +7 -4
  45. package/src/components/base/tabs/tabs/tabs.stories.js +8 -12
  46. package/src/components/base/tabs/tabs/tabs.vue +2 -11
  47. package/src/components/base/toast/toast.stories.js +6 -4
  48. package/src/components/base/token/token.stories.js +2 -2
  49. package/src/components/base/tooltip/tooltip.stories.js +2 -1
  50. package/src/scss/utilities.scss +8 -0
  51. package/src/scss/utility-mixins/box-shadow.scss +4 -0
@@ -9,6 +9,8 @@ import {
9
9
  GlDropdownItem,
10
10
  GlDropdownText,
11
11
  GlDropdownForm,
12
+ GlButton,
13
+ GlSearchBoxByType,
12
14
  } from '../../../../index';
13
15
  import {
14
16
  buttonCategoryOptions,
@@ -213,7 +215,7 @@ documentedStoriesOf('base/dropdown', readme)
213
215
  }))
214
216
  .add('with form', () => ({
215
217
  props: generateProps({ text: 'Some dropdown' }),
216
- components,
218
+ components: { ...components, GlButton },
217
219
  template: wrap`
218
220
  <gl-dropdown-form class="gl-px-4">
219
221
  <gl-button>One</gl-button>
@@ -242,7 +244,7 @@ documentedStoriesOf('base/dropdown', readme)
242
244
  }))
243
245
  .add('with header and footer', () => ({
244
246
  props: generateProps({ text: 'Some dropdown', headerText: 'Header', hideHeaderBorder: true }),
245
- components,
247
+ components: { ...components, GlSearchBoxByType },
246
248
  template: wrap`
247
249
  <template #header>
248
250
  <gl-search-box-by-type />
@@ -1,6 +1,13 @@
1
1
  import { withKnobs } from '@storybook/addon-knobs';
2
2
  import { documentedStoriesOf } from '../../../../documentation/documented_stories';
3
- import { GlFilteredSearch, GlFilteredSearchToken } from '../../../../index';
3
+ import {
4
+ GlFilteredSearch,
5
+ GlFilteredSearchToken,
6
+ GlFilteredSearchSuggestion,
7
+ GlLoadingIcon,
8
+ GlToken,
9
+ GlAvatar,
10
+ } from '../../../../index';
4
11
  import { setStoryTimeout } from '../../../utils/test_utils';
5
12
  import readme from './filtered_search.md';
6
13
 
@@ -29,6 +36,7 @@ const fakeLabels = [
29
36
  ];
30
37
 
31
38
  const UserToken = {
39
+ components: { GlFilteredSearchToken, GlFilteredSearchSuggestion, GlLoadingIcon, GlAvatar },
32
40
  props: ['value', 'active'],
33
41
  inheritAttrs: false,
34
42
  data() {
@@ -104,6 +112,7 @@ const UserToken = {
104
112
  };
105
113
 
106
114
  const MilestoneToken = {
115
+ components: { GlFilteredSearchToken, GlFilteredSearchSuggestion, GlLoadingIcon },
107
116
  props: ['value', 'active'],
108
117
  inheritAttrs: false,
109
118
  data() {
@@ -163,6 +172,7 @@ const MilestoneToken = {
163
172
  };
164
173
 
165
174
  const LabelToken = {
175
+ components: { GlFilteredSearchToken, GlFilteredSearchSuggestion, GlLoadingIcon, GlToken },
166
176
  props: ['value', 'active'],
167
177
  inheritAttrs: false,
168
178
  data() {
@@ -1,4 +1,5 @@
1
1
  import { withKnobs } from '@storybook/addon-knobs';
2
+ import { GlFilteredSearchSuggestion } from '../../../../index';
2
3
  import { documentedStoriesOf } from '../../../../documentation/documented_stories';
3
4
  import readme from './filtered_search_suggestion.md';
4
5
 
@@ -7,6 +8,7 @@ const noop = () => {};
7
8
  documentedStoriesOf('base/filtered-search/suggestion', readme)
8
9
  .addDecorator(withKnobs)
9
10
  .add('default', () => ({
11
+ components: { GlFilteredSearchSuggestion },
10
12
  provide: {
11
13
  filteredSearchSuggestionListInstance: {
12
14
  register: noop,
@@ -1,4 +1,5 @@
1
1
  import { withKnobs } from '@storybook/addon-knobs';
2
+ import { GlFilteredSearchSuggestionList, GlFilteredSearchSuggestion } from '../../../../index';
2
3
  import { documentedStoriesOf } from '../../../../documentation/documented_stories';
3
4
  import { provide } from './common_story_options';
4
5
  import readme from './filtered_search_suggestion_list.md';
@@ -6,6 +7,7 @@ import readme from './filtered_search_suggestion_list.md';
6
7
  documentedStoriesOf('base/filtered-search/suggestion-list', readme)
7
8
  .addDecorator(withKnobs)
8
9
  .add('default', () => ({
10
+ components: { GlFilteredSearchSuggestionList, GlFilteredSearchSuggestion },
9
11
  data() {
10
12
  return {
11
13
  iteration: 1,
@@ -2,6 +2,7 @@ import { withKnobs, boolean } from '@storybook/addon-knobs';
2
2
  import PortalVue from 'portal-vue';
3
3
  import Vue from 'vue';
4
4
  import { documentedStoriesOf } from '../../../../documentation/documented_stories';
5
+ import { GlIcon } from '../../../../index';
5
6
  import { provide } from './common_story_options';
6
7
  import GlFilteredSearchSuggestion from './filtered_search_suggestion.vue';
7
8
  import readme from './filtered_search_token.md';
@@ -15,6 +16,7 @@ documentedStoriesOf('base/filtered-search/token', readme)
15
16
  components: {
16
17
  GlFilteredSearchToken,
17
18
  GlFilteredSearchSuggestion,
19
+ GlIcon,
18
20
  },
19
21
  provide,
20
22
  props: {
@@ -1,6 +1,7 @@
1
1
  import { withKnobs, boolean } from '@storybook/addon-knobs';
2
2
  import PortalVue from 'portal-vue';
3
3
  import Vue from 'vue';
4
+ import { GlFilteredSearchSuggestion } from '../../../../index';
4
5
  import { documentedStoriesOf } from '../../../../documentation/documented_stories';
5
6
  import { provide } from './common_story_options';
6
7
  import readme from './filtered_search_term.md';
@@ -18,6 +19,7 @@ documentedStoriesOf('base/filtered-search/token-segment', readme)
18
19
  .add('default', () => ({
19
20
  components: {
20
21
  GlFilteredSearchTokenSegment,
22
+ GlFilteredSearchSuggestion,
21
23
  },
22
24
  provide,
23
25
  props: {
@@ -1,6 +1,6 @@
1
1
  import { withKnobs, text, select, boolean } from '@storybook/addon-knobs';
2
2
  import { documentedStoriesOf } from '../../../../../documentation/documented_stories';
3
- import { GlFormGroup } from '../../../../../index';
3
+ import { GlFormGroup, GlFormInput, GlFormTextarea } from '../../../../../index';
4
4
  import { sizeOptions } from '../../../../utils/constants';
5
5
  import readme from './form_group.md';
6
6
 
@@ -57,7 +57,7 @@ documentedStoriesOf('base/form/form-group', readme)
57
57
  .addDecorator(withKnobs)
58
58
  .add('default', () => ({
59
59
  props: generateProps(),
60
- components,
60
+ components: { ...components, GlFormInput },
61
61
  template: `
62
62
  <gl-form-group
63
63
  :id="id"
@@ -75,7 +75,7 @@ documentedStoriesOf('base/form/form-group', readme)
75
75
  }))
76
76
  .add('disabled', () => ({
77
77
  props: generateProps(),
78
- components,
78
+ components: { ...components, GlFormInput },
79
79
  template: `
80
80
  <gl-form-group
81
81
  id="group-id"
@@ -91,6 +91,7 @@ documentedStoriesOf('base/form/form-group', readme)
91
91
  `,
92
92
  }))
93
93
  .add('with textarea', () => ({
94
+ components: { ...components, GlFormTextarea },
94
95
  props: generateProps({ optional: true }),
95
96
  template: `
96
97
  <gl-form-group
@@ -106,7 +107,7 @@ documentedStoriesOf('base/form/form-group', readme)
106
107
  }))
107
108
  .add('with label description', () => ({
108
109
  props: generateProps({ optional: true }),
109
- components,
110
+ components: { ...components, GlFormInput },
110
111
  template: `
111
112
  <gl-form-group
112
113
  :id="id"
@@ -125,7 +126,7 @@ documentedStoriesOf('base/form/form-group', readme)
125
126
  }))
126
127
  .add('with validations', () => ({
127
128
  props: generateProps({ label: 'Name', description: 'Enter a first and last name.' }),
128
- components,
129
+ components: { ...components, GlFormInput },
129
130
  computed: {
130
131
  state() {
131
132
  return this.name.length >= 4;
@@ -1,10 +1,11 @@
1
1
  import { withKnobs, object, text } from '@storybook/addon-knobs';
2
2
  import { documentedStoriesOf } from '../../../../../documentation/documented_stories';
3
- import { GlFormRadioGroup } from '../../../../../index';
3
+ import { GlFormRadioGroup, GlFormRadio } from '../../../../../index';
4
4
  import readme from './form_radio_group.md';
5
5
 
6
6
  const components = {
7
7
  GlFormRadioGroup,
8
+ GlFormRadio,
8
9
  };
9
10
 
10
11
  const defaultOptions = [
@@ -23,6 +23,7 @@ const generateProps = () => ({
23
23
  });
24
24
 
25
25
  const Template = (args) => ({
26
+ components: { GlLoadingIcon },
26
27
  props: Object.keys(args),
27
28
  template,
28
29
  });
@@ -1,11 +1,12 @@
1
1
  import { withKnobs } from '@storybook/addon-knobs';
2
2
  import { documentedStoriesOf } from '../../../../documentation/documented_stories';
3
- import { GlNav, GlNavItemDropdown } from '../../../../index';
3
+ import { GlNav, GlNavItemDropdown, GlDropdownItem, GlDropdownDivider } from '../../../../index';
4
4
  import readme from './nav_item_dropdown.md';
5
5
 
6
6
  const components = {
7
7
  GlNav,
8
8
  GlNavItemDropdown,
9
+ GlDropdownItem,
9
10
  };
10
11
 
11
12
  documentedStoriesOf('base/nav/nav-item-dropdown', readme)
@@ -23,7 +24,7 @@ documentedStoriesOf('base/nav/nav-item-dropdown', readme)
23
24
  `,
24
25
  }))
25
26
  .add('with divider', () => ({
26
- components,
27
+ components: { ...components, GlDropdownDivider },
27
28
  template: `
28
29
  <gl-nav>
29
30
  <gl-nav-item-dropdown text="Dropdown">
@@ -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 '../../../../index';
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,8 @@
1
- import { GlTable } from '../../../../index';
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" />
@@ -13,7 +13,6 @@ const TEST_ACTION = {
13
13
  text: 'Lorem ipsum',
14
14
  };
15
15
  const TEST_DEFAULT_PROPS = {
16
- theme: 'red',
17
16
  contentClass: 'gl-test-content-class',
18
17
  navClass: 'gl-test-nav-class',
19
18
  };
@@ -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 theme="indigo">
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 theme="indigo">
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 $gray-100, $focus-ring;
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,4 +1,4 @@
1
- import { mount, shallowMount } from '@vue/test-utils';
1
+ import { mount } from '@vue/test-utils';
2
2
  import { nextTick } from 'vue';
3
3
  import { GlButton } from '../../../../../index';
4
4
  import { tabsButtonDefaults } from '../../../../utils/constants';
@@ -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('should have a default theme of indigo', () => {
48
- buildTabs({ mountFn: shallowMount });
49
- expect(wrapper.attributes('activenavitemclass')).toContain('gl-tab-nav-item-active-indigo');
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, select, boolean } from '@storybook/addon-knobs';
1
+ import { withKnobs, boolean } from '@storybook/addon-knobs';
2
2
  import { range } from 'lodash';
3
3
  import { documentedStoriesOf } from '../../../../../documentation/documented_stories';
4
4
  import { GlTabs, GlTab, GlScrollableTabs } from '../../../../../index';
5
- import { colorThemes } from '../../../../utils/constants';
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 :theme="theme" :sync-active-tab-with-query-params="syncActiveTabWithQueryParams">
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 :theme="theme">
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 :theme="theme">
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 :theme="theme" justified>
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" :theme="theme" />',
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" :theme="theme" />',
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 { colorThemes, tabsButtonDefaults } from '../../../../utils/constants';
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
- :active-nav-item-class="`gl-tab-nav-item-active ${activeItemBorderClass}`"
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"