@gitlab/ui 38.8.0 → 38.9.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 (54) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/components/base/form/form_textarea/form_textarea.js +62 -2
  3. package/dist/components/base/label/label.js +1 -1
  4. package/dist/components/charts/series_label/series_label.js +1 -6
  5. package/dist/index.css +1 -1
  6. package/dist/index.css.map +1 -1
  7. package/dist/utils/constants.js +7 -2
  8. package/package.json +1 -2
  9. package/src/components/base/accordion/accordion.stories.js +2 -4
  10. package/src/components/base/accordion/accordion_item.stories.js +2 -4
  11. package/src/components/base/alert/alert.stories.js +2 -4
  12. package/src/components/base/avatar/avatar.stories.js +3 -9
  13. package/src/components/base/avatar_labeled/avatar_labeled.stories.js +6 -12
  14. package/src/components/base/avatar_link/avatar_link.stories.js +2 -6
  15. package/src/components/base/avatars_inline/avatars_inline.stories.js +2 -4
  16. package/src/components/base/badge/badge.scss +10 -0
  17. package/src/components/base/badge/badge.stories.js +3 -9
  18. package/src/components/base/banner/banner.stories.js +1 -3
  19. package/src/components/base/broadcast_message/broadcast_message.stories.js +4 -8
  20. package/src/components/base/button/button.stories.js +8 -16
  21. package/src/components/base/datepicker/datepicker.stories.js +2 -2
  22. package/src/components/base/daterange_picker/daterange_picker.stories.js +2 -6
  23. package/src/components/base/dropdown/dropdown.stories.js +4 -12
  24. package/src/components/base/dropdown/dropdown_item.stories.js +2 -6
  25. package/src/components/base/form/form_group/form_group.stories.js +1 -1
  26. package/src/components/base/form/form_input/form_input.stories.js +1 -3
  27. package/src/components/base/form/form_input_group/form_input_group.stories.js +4 -12
  28. package/src/components/base/form/form_radio/form_radio.stories.js +1 -3
  29. package/src/components/base/form/form_select/form_select.stories.js +4 -8
  30. package/src/components/base/form/form_textarea/form_textarea.spec.js +115 -8
  31. package/src/components/base/form/form_textarea/form_textarea.stories.js +21 -0
  32. package/src/components/base/form/form_textarea/form_textarea.vue +73 -8
  33. package/src/components/base/icon/icon.stories.js +4 -8
  34. package/src/components/base/label/label.stories.js +2 -6
  35. package/src/components/base/label/label.vue +3 -10
  36. package/src/components/base/link/link.stories.js +2 -4
  37. package/src/components/base/loading_icon/loading_icon.stories.js +4 -8
  38. package/src/components/base/modal/modal.stories.js +16 -32
  39. package/src/components/base/path/path.stories.js +2 -6
  40. package/src/components/base/popover/popover.stories.js +2 -4
  41. package/src/components/base/progress_bar/progress_bar.stories.js +2 -4
  42. package/src/components/base/search_box_by_click/search_box_by_click.stories.js +1 -3
  43. package/src/components/base/segmented_control/segmented_control.stories.js +1 -3
  44. package/src/components/base/skeleton_loading/skeleton_loading.stories.js +2 -4
  45. package/src/components/base/table/table.stories.js +2 -4
  46. package/src/components/base/toggle/toggle.stories.js +4 -10
  47. package/src/components/base/token/token.stories.js +2 -4
  48. package/src/components/base/token_selector/token_selector.stories.js +2 -4
  49. package/src/components/charts/series_label/series_label.stories.js +3 -6
  50. package/src/components/charts/series_label/series_label.vue +0 -3
  51. package/src/components/charts/single_stat/single_stat.stories.js +1 -3
  52. package/src/directives/resize_observer/resize_observer.stories.js +1 -3
  53. package/src/utils/constants.js +6 -0
  54. package/documentation/documented_stories.js +0 -215
@@ -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
- };