@gitlab/ui 38.8.1 → 38.10.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 (63) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/components/base/filtered_search/filtered_search.js +0 -5
  3. package/dist/components/base/form/form_textarea/form_textarea.js +62 -2
  4. package/dist/components/base/label/label.js +1 -1
  5. package/dist/components/base/popover/popover.js +7 -1
  6. package/dist/index.css +2 -2
  7. package/dist/index.css.map +1 -1
  8. package/dist/utility_classes.css +1 -1
  9. package/dist/utility_classes.css.map +1 -1
  10. package/dist/utils/constants.js +7 -2
  11. package/package.json +1 -2
  12. package/src/components/base/accordion/accordion.stories.js +2 -4
  13. package/src/components/base/accordion/accordion_item.stories.js +2 -4
  14. package/src/components/base/alert/alert.stories.js +2 -4
  15. package/src/components/base/avatar/avatar.stories.js +3 -9
  16. package/src/components/base/avatar_labeled/avatar_labeled.stories.js +6 -12
  17. package/src/components/base/avatar_link/avatar_link.stories.js +2 -6
  18. package/src/components/base/avatars_inline/avatars_inline.stories.js +2 -4
  19. package/src/components/base/badge/badge.scss +10 -0
  20. package/src/components/base/badge/badge.stories.js +3 -9
  21. package/src/components/base/banner/banner.stories.js +1 -3
  22. package/src/components/base/broadcast_message/broadcast_message.stories.js +4 -8
  23. package/src/components/base/button/button.stories.js +8 -16
  24. package/src/components/base/datepicker/datepicker.stories.js +2 -2
  25. package/src/components/base/daterange_picker/daterange_picker.stories.js +2 -6
  26. package/src/components/base/dropdown/dropdown.stories.js +4 -12
  27. package/src/components/base/dropdown/dropdown_item.stories.js +2 -6
  28. package/src/components/base/filtered_search/filtered_search.vue +0 -5
  29. package/src/components/base/form/form_group/form_group.stories.js +1 -1
  30. package/src/components/base/form/form_input/form_input.stories.js +1 -3
  31. package/src/components/base/form/form_input_group/form_input_group.stories.js +4 -12
  32. package/src/components/base/form/form_radio/form_radio.stories.js +1 -3
  33. package/src/components/base/form/form_select/form_select.stories.js +4 -8
  34. package/src/components/base/form/form_textarea/form_textarea.spec.js +115 -8
  35. package/src/components/base/form/form_textarea/form_textarea.stories.js +21 -0
  36. package/src/components/base/form/form_textarea/form_textarea.vue +73 -8
  37. package/src/components/base/icon/icon.stories.js +4 -8
  38. package/src/components/base/infinite_scroll/infinite_scroll.stories.js +37 -13
  39. package/src/components/base/label/label.stories.js +2 -6
  40. package/src/components/base/label/label.vue +3 -10
  41. package/src/components/base/link/link.stories.js +2 -4
  42. package/src/components/base/loading_icon/loading_icon.stories.js +4 -8
  43. package/src/components/base/modal/modal.stories.js +16 -32
  44. package/src/components/base/path/path.stories.js +2 -6
  45. package/src/components/base/popover/popover.scss +3 -1
  46. package/src/components/base/popover/popover.spec.js +15 -1
  47. package/src/components/base/popover/popover.stories.js +3 -5
  48. package/src/components/base/popover/popover.vue +7 -0
  49. package/src/components/base/progress_bar/progress_bar.stories.js +2 -4
  50. package/src/components/base/search_box_by_click/search_box_by_click.stories.js +1 -3
  51. package/src/components/base/segmented_control/segmented_control.stories.js +1 -3
  52. package/src/components/base/skeleton_loading/skeleton_loading.stories.js +2 -4
  53. package/src/components/base/table/table.stories.js +2 -4
  54. package/src/components/base/toggle/toggle.stories.js +4 -10
  55. package/src/components/base/token/token.stories.js +2 -4
  56. package/src/components/base/token_selector/token_selector.stories.js +2 -4
  57. package/src/components/charts/single_stat/single_stat.stories.js +1 -3
  58. package/src/directives/resize_observer/resize_observer.stories.js +1 -3
  59. package/src/scss/utilities.scss +32 -0
  60. package/src/scss/utility-mixins/color.scss +4 -0
  61. package/src/scss/utility-mixins/sizing.scss +12 -0
  62. package/src/utils/constants.js +6 -0
  63. package/documentation/documented_stories.js +0 -215
@@ -55,9 +55,7 @@ Default.args = generateProps();
55
55
 
56
56
  const makeControl = () => ({
57
57
  options: ['100%', '75%', '50%'],
58
- control: {
59
- type: 'select',
60
- },
58
+ control: 'select',
61
59
  });
62
60
 
63
61
  export default {
@@ -2433,6 +2433,14 @@
2433
2433
  color: $purple-600 !important;
2434
2434
  }
2435
2435
 
2436
+ .gl-text-purple-700 {
2437
+ color: $purple-700;
2438
+ }
2439
+
2440
+ .gl-text-purple-700\! {
2441
+ color: $purple-700 !important;
2442
+ }
2443
+
2436
2444
  .gl-text-theme-indigo-200 {
2437
2445
  color: $theme-indigo-200;
2438
2446
  }
@@ -4495,6 +4503,30 @@
4495
4503
  }
4496
4504
  }
4497
4505
 
4506
+ .gl-md-w-half {
4507
+ @include gl-media-breakpoint-up(md) {
4508
+ width: 50%;
4509
+ }
4510
+ }
4511
+
4512
+ .gl-md-w-half\! {
4513
+ @include gl-media-breakpoint-up(md) {
4514
+ width: 50% !important;
4515
+ }
4516
+ }
4517
+
4518
+ .gl-lg-w-half {
4519
+ @include gl-media-breakpoint-up(lg) {
4520
+ width: 50%;
4521
+ }
4522
+ }
4523
+
4524
+ .gl-lg-w-half\! {
4525
+ @include gl-media-breakpoint-up(lg) {
4526
+ width: 50% !important;
4527
+ }
4528
+ }
4529
+
4498
4530
  .gl-md-w-auto {
4499
4531
  @include gl-media-breakpoint-up(md) {
4500
4532
  width: auto;
@@ -185,6 +185,10 @@
185
185
  color: $purple-600;
186
186
  }
187
187
 
188
+ @mixin gl-text-purple-700 {
189
+ color: $purple-700;
190
+ }
191
+
188
192
  @mixin gl-text-theme-indigo-200 {
189
193
  color: $theme-indigo-200;
190
194
  }
@@ -234,6 +234,18 @@
234
234
  }
235
235
  }
236
236
 
237
+ @mixin gl-md-w-half {
238
+ @include gl-media-breakpoint-up(md) {
239
+ width: 50%;
240
+ }
241
+ }
242
+
243
+ @mixin gl-lg-w-half {
244
+ @include gl-media-breakpoint-up(lg) {
245
+ width: 50%;
246
+ }
247
+ }
248
+
237
249
  @mixin gl-md-w-auto {
238
250
  @include gl-media-breakpoint-up(md) {
239
251
  width: auto;
@@ -37,6 +37,7 @@ export const badgeVariantOptions = {
37
37
  success: 'success',
38
38
  warning: 'warning',
39
39
  danger: 'danger',
40
+ tier: 'tier',
40
41
  };
41
42
 
42
43
  export const variantCssColorMap = {
@@ -297,3 +298,8 @@ export const loadingIconSizes = {
297
298
  'lg (32x32)': 'lg',
298
299
  'xl (64x64)': 'xl',
299
300
  };
301
+
302
+ export const textareaCountOptions = {
303
+ max: 'max',
304
+ recommended: 'recommended',
305
+ };
@@ -1,215 +0,0 @@
1
- import { storiesOf } from '@storybook/vue';
2
- import camelCase from 'lodash/camelCase';
3
- import upperFirst from 'lodash/upperFirst';
4
- import { configureReadme } from 'storybook-readme';
5
-
6
- import 'url-search-params-polyfill';
7
-
8
- import { componentValidator as isValidComponent } from './all_components';
9
- import GlComponentDocumentation from './components/component_documentation_generator.vue';
10
- import GlExampleExplorer from './components/example_explorer.vue';
11
-
12
- /**
13
- * This functions returns the component's name from the current window location's search
14
- *
15
- * Assume you have this Structure:
16
- * - Base
17
- * - Form
18
- * - Form-Group
19
- * - Default
20
- * - With Validations
21
- *
22
- * The URI would look like this: `iframe.html?id=base-form-form-group--with-validations`
23
- *
24
- * The actual component name we are looking for is `GlFormGroup`.
25
- * We know that we can remove the last part.
26
- * But unfortunately from `base-form-form-group` we cannot guess which of the following is the component name:
27
- * - GlBaseFormFormGroup
28
- * - GlFormFormGroup
29
- * - GlFormGroup
30
- * - GlGroup
31
- *
32
- * So we are going to through loop all of these and return the first valid component (`GlFormGroup`)
33
- *
34
- * @returns {string}
35
- */
36
- function getComponentName() {
37
- const urlParams = new URLSearchParams(window.location.search);
38
-
39
- const storySlug = urlParams.get('id').split('--')[0];
40
- const splitSlug = storySlug.split('-');
41
-
42
- let componentName;
43
-
44
- do {
45
- splitSlug.shift();
46
- componentName = `Gl${upperFirst(camelCase(splitSlug.join('-')))}`;
47
- } while (splitSlug.length > 0 && !isValidComponent(componentName));
48
-
49
- if (!isValidComponent(componentName)) {
50
- throw new Error('Could not find a matching component');
51
- }
52
-
53
- return componentName;
54
- }
55
-
56
- export const setupStorybookReadme = () =>
57
- configureReadme({
58
- StoryPreview: {
59
- disableForComponents: [
60
- 'GlTableLite',
61
- 'GlAlert',
62
- 'GlSparklineChart',
63
- 'GlAvatarsInline',
64
- 'GlSprintf',
65
- 'GlLink',
66
- 'GlChart',
67
- 'GlDropdown',
68
- 'GlDropdownItem',
69
- 'GlBadge',
70
- 'GlButtonGroup',
71
- 'GlOutsideDirective',
72
- 'GlBanner',
73
- 'GlBreadcrumb',
74
- 'GlBroadcastMessage',
75
- 'GlCollapse',
76
- 'GlToken',
77
- 'GlButton',
78
- 'GlEmptyState',
79
- 'GlSorting',
80
- 'GlSortingItem',
81
- 'GlIcon',
82
- 'GlDatepicker',
83
- 'GlSafeLinkDirective',
84
- 'GlDashboardSkeleton',
85
- 'GlToggle',
86
- 'GlNavbar',
87
- 'GlFormCheckboxTree',
88
- 'GlProgressBar',
89
- 'GlPath',
90
- 'GlFriendlyWrap',
91
- 'GlLoadingIcon',
92
- 'GlDeprecatedSkeletonLoading',
93
- 'GlCard',
94
- 'GlFormCheckbox',
95
- 'GlAccordion',
96
- 'GlAccordionItem',
97
- 'GlFilteredSearch',
98
- 'GlFilteredSearchSuggestion',
99
- 'GlFilteredSearchSuggestionList',
100
- 'GlFilteredSearchTerm',
101
- 'GlFilteredSearchToken',
102
- 'GlFilteredSearchTokenSegment',
103
- 'GlIntersperse',
104
- 'GlFormSelect',
105
- 'GlDaterangePicker',
106
- 'GlFormGroup',
107
- 'GlAvatarLabeled',
108
- 'GlBarChart',
109
- 'GlCarousel',
110
- 'GlMarkdown',
111
- 'GlTokenSelector',
112
- 'GlTooltip',
113
- 'GlFormTextarea',
114
- 'GlFormInput',
115
- 'GlSegmentedControl',
116
- 'GlAvatar',
117
- 'GlChartLegend',
118
- 'GlAvatarLink',
119
- 'GlPagination',
120
- 'GlSkeletonLoader',
121
- 'GlLabel',
122
- 'GlHoverLoadDirective',
123
- 'GlStackedColumnChart',
124
- 'GlDiscreteScatterChart',
125
- 'GlResizeObserverDirective',
126
- 'GlFormCombobox',
127
- 'GlChartTooltip',
128
- 'GlInputGroupText',
129
- 'GlGaugeChart',
130
- 'GlSafeHtmlDirective',
131
- 'GlFormRadio',
132
- 'GlModal',
133
- 'GlKeysetPagination',
134
- 'GlForm',
135
- 'GlTable',
136
- 'GlTab',
137
- 'GlTabs',
138
- 'GlToast',
139
- 'GlPaginatedList',
140
- 'GlIntersectionObserver',
141
- 'GlInfiniteScroll',
142
- 'GlColumnChart',
143
- 'GlTruncate',
144
- 'GlNav',
145
- 'GlSearchBoxByType',
146
- 'GlNavItem',
147
- 'GlNavItemDropdown',
148
- 'GlPopover',
149
- 'GlSingleStat',
150
- 'GlDrawer',
151
- 'GlHeatmap',
152
- 'GlFormRadioGroup',
153
- 'GlChartSeriesLabel',
154
- 'GlAreaChart',
155
- 'GlLineChart',
156
- 'GlFormInputGroup',
157
- 'GlSearchBoxByClick',
158
- ],
159
- components: {
160
- GlComponentDocumentation,
161
- GlExampleExplorer,
162
- },
163
- data() {
164
- return {
165
- componentName: null,
166
- error: '',
167
- // Style the preview component container
168
- // Default container forcefully centers the preview element
169
- styles: {
170
- padding: '50px 35px',
171
- margin: '16px 0',
172
- border: '1px dashed rgb(229, 229, 229)',
173
- },
174
- };
175
- },
176
- // We infer the component's name from the URL so that we can load related examples and docs.
177
- // This needs to be done in the created hook to make sure that componentName is always set
178
- // to a valid value once the story loads.
179
- created() {
180
- try {
181
- this.componentName = getComponentName();
182
- this.error = '';
183
- } catch (error) {
184
- this.componentName = false;
185
- this.error = error.message;
186
- }
187
- },
188
- template: `
189
- <div>
190
- <div class="story-container" v-if="!componentName || $options.disableForComponents.includes(componentName)">
191
- <slot></slot>
192
- </div>
193
- <template v-else>
194
- <div class="story-container" v-bind:style="styles"><slot></slot></div>
195
- {{ error }}
196
- <template v-if="componentName">
197
- <gl-example-explorer :componentName="componentName" />
198
- <gl-component-documentation :componentName="componentName" />
199
- </template>
200
- </template>
201
- </div>`,
202
- },
203
- });
204
-
205
- export const documentedStoriesOf = (name, readme) => {
206
- const story = storiesOf(name, module);
207
- if (process.env.NODE_ENV !== 'test') {
208
- story.addParameters({
209
- readme: {
210
- content: readme,
211
- },
212
- });
213
- }
214
- return story;
215
- };