@gitlab/ui 32.47.0 → 32.51.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 +28 -0
- package/dist/components/base/avatar_labeled/avatar_labeled.documentation.js +2 -9
- package/dist/components/base/avatars_inline/avatars_inline.documentation.js +2 -5
- package/dist/components/base/form/form.documentation.js +1 -5
- package/dist/components/base/form/form_radio/form_radio.documentation.js +2 -33
- package/dist/components/base/form/form_radio/form_radio.js +15 -2
- package/dist/components/base/form/form_select/form_select.documentation.js +2 -17
- package/dist/components/base/keyset_pagination/keyset_pagination.documentation.js +2 -84
- package/dist/components/base/keyset_pagination/keyset_pagination.js +42 -0
- package/dist/components/base/modal/modal.documentation.js +2 -32
- package/dist/components/base/modal/modal.js +15 -1
- package/dist/components/charts/gauge/gauge.documentation.js +2 -6
- package/dist/components/utilities/intersperse/intersperse.documentation.js +2 -5
- package/dist/utility_classes.css +1 -1
- package/dist/utility_classes.css.map +1 -1
- package/documentation/documented_stories.js +9 -0
- package/package.json +3 -3
- package/scss_to_js/scss_variables.js +2 -0
- package/scss_to_js/scss_variables.json +10 -0
- package/src/components/base/avatar_labeled/avatar_labeled.documentation.js +0 -9
- package/src/components/base/avatar_labeled/avatar_labeled.md +2 -5
- package/src/components/base/avatar_labeled/avatar_labeled.stories.js +68 -62
- package/src/components/base/avatar_labeled/avatar_labeled.vue +1 -0
- package/src/components/base/avatars_inline/avatars_inline.documentation.js +0 -2
- package/src/components/base/avatars_inline/avatars_inline.md +1 -3
- package/src/components/base/avatars_inline/avatars_inline.stories.js +49 -44
- package/src/components/base/form/form.documentation.js +0 -3
- package/src/components/base/form/form.stories.js +99 -14
- package/src/components/base/form/form_radio/form_radio.documentation.js +0 -31
- package/src/components/base/form/form_radio/form_radio.md +7 -14
- package/src/components/base/form/form_radio/form_radio.stories.js +40 -28
- package/src/components/base/form/form_radio/form_radio.vue +26 -1
- package/src/components/base/form/form_select/form_select.documentation.js +0 -19
- package/src/components/base/form/form_select/form_select.md +0 -2
- package/src/components/base/form/form_select/form_select.stories.js +98 -80
- package/src/components/base/keyset_pagination/keyset_pagination.documentation.js +0 -99
- package/src/components/base/keyset_pagination/keyset_pagination.md +0 -2
- package/src/components/base/keyset_pagination/keyset_pagination.stories.js +60 -58
- package/src/components/base/keyset_pagination/keyset_pagination.vue +35 -1
- package/src/components/base/modal/modal.documentation.js +0 -42
- package/src/components/base/modal/modal.md +2 -7
- package/src/components/base/modal/modal.stories.js +107 -85
- package/src/components/base/modal/modal.vue +73 -32
- package/src/components/charts/gauge/gauge.documentation.js +0 -3
- package/src/components/charts/gauge/gauge.md +0 -2
- package/src/components/charts/gauge/gauge.stories.js +70 -86
- package/src/components/utilities/intersperse/intersperse.documentation.js +0 -2
- package/src/components/utilities/intersperse/intersperse.md +0 -2
- package/src/components/utilities/intersperse/intersperse.stories.js +38 -38
- package/src/scss/utilities.scss +16 -0
- package/src/scss/utility-mixins/sizing.scss +8 -0
- package/src/scss/variables.scss +2 -0
- package/dist/components/base/avatar_labeled/examples/avatar.labeled.example.js +0 -38
- package/dist/components/base/avatar_labeled/examples/avatar.labeled_badges.example.js +0 -38
- package/dist/components/base/avatar_labeled/examples/avatar.labeled_links.example.js +0 -38
- package/dist/components/base/avatar_labeled/examples/avatar.labeled_tooltip.example.js +0 -38
- package/dist/components/base/avatar_labeled/examples/index.js +0 -31
- package/dist/components/base/avatars_inline/examples/avatars.inline.example.js +0 -58
- package/dist/components/base/avatars_inline/examples/avatars.inline_large.example.js +0 -58
- package/dist/components/base/avatars_inline/examples/avatars.inline_links_and_tooltips.example.js +0 -70
- package/dist/components/base/avatars_inline/examples/avatars.inline_links_and_tooltips_badge.example.js +0 -70
- package/dist/components/base/avatars_inline/examples/index.js +0 -31
- package/dist/components/base/form/examples/form.basic.example.js +0 -76
- package/dist/components/base/form/examples/form.edit.example.js +0 -66
- package/dist/components/base/form/examples/form.inline.example.js +0 -62
- package/dist/components/base/form/examples/form.novalidate.example.js +0 -61
- package/dist/components/base/form/examples/index.js +0 -27
- package/dist/components/base/form/form_radio/examples/form_radio.basic.example.js +0 -48
- package/dist/components/base/form/form_radio/examples/form_radio.checked_disabled.example.js +0 -48
- package/dist/components/base/form/form_radio/examples/index.js +0 -19
- package/dist/components/base/form/form_select/examples/form_select.basic.example.js +0 -55
- package/dist/components/base/form/form_select/examples/form_select.disabled.example.js +0 -55
- package/dist/components/base/form/form_select/examples/form_select.manual_options.example.js +0 -48
- package/dist/components/base/form/form_select/examples/form_select.mixed_options.example.js +0 -55
- package/dist/components/base/form/form_select/examples/index.js +0 -27
- package/dist/components/base/keyset_pagination/examples/index.js +0 -37
- package/dist/components/base/keyset_pagination/examples/keyset_pagination.basic.example.js +0 -51
- package/dist/components/base/keyset_pagination/examples/keyset_pagination.events.example.js +0 -64
- package/dist/components/base/keyset_pagination/examples/keyset_pagination.internationalization.example.js +0 -59
- package/dist/components/base/keyset_pagination/examples/keyset_pagination.links.example.js +0 -51
- package/dist/components/base/keyset_pagination/examples/keyset_pagination.slots.example.js +0 -51
- package/dist/components/base/modal/examples/index.js +0 -31
- package/dist/components/base/modal/examples/modal.basic.example.js +0 -62
- package/dist/components/base/modal/examples/modal.disabled.example.js +0 -89
- package/dist/components/base/modal/examples/modal.sizes.example.js +0 -62
- package/dist/components/charts/gauge/examples/gauge.basic.example.js +0 -38
- package/dist/components/charts/gauge/examples/gauge.no_thresholds.example.js +0 -38
- package/dist/components/charts/gauge/examples/gauge.no_value.example.js +0 -38
- package/dist/components/charts/gauge/examples/gauge.with_text.example.js +0 -38
- package/dist/components/charts/gauge/examples/index.js +0 -31
- package/dist/components/utilities/intersperse/examples/index.js +0 -31
- package/dist/components/utilities/intersperse/examples/intersperse.custom_last_separator.example.js +0 -38
- package/dist/components/utilities/intersperse/examples/intersperse.custom_last_separator_two_items.example.js +0 -38
- package/dist/components/utilities/intersperse/examples/intersperse.custom_separator.example.js +0 -38
- package/dist/components/utilities/intersperse/examples/intersperse.default.example.js +0 -38
- package/src/components/base/avatar_labeled/examples/avatar.labeled.example.vue +0 -8
- package/src/components/base/avatar_labeled/examples/avatar.labeled_badges.example.vue +0 -17
- package/src/components/base/avatar_labeled/examples/avatar.labeled_links.example.vue +0 -10
- package/src/components/base/avatar_labeled/examples/avatar.labeled_tooltip.example.vue +0 -10
- package/src/components/base/avatar_labeled/examples/index.js +0 -36
- package/src/components/base/avatars_inline/examples/avatars.inline.example.vue +0 -18
- package/src/components/base/avatars_inline/examples/avatars.inline_large.example.vue +0 -18
- package/src/components/base/avatars_inline/examples/avatars.inline_links_and_tooltips.example.vue +0 -24
- package/src/components/base/avatars_inline/examples/avatars.inline_links_and_tooltips_badge.example.vue +0 -31
- package/src/components/base/avatars_inline/examples/index.js +0 -36
- package/src/components/base/form/examples/form.basic.example.vue +0 -73
- package/src/components/base/form/examples/form.edit.example.vue +0 -37
- package/src/components/base/form/examples/form.inline.example.vue +0 -36
- package/src/components/base/form/examples/form.novalidate.example.vue +0 -30
- package/src/components/base/form/examples/index.js +0 -32
- package/src/components/base/form/form_radio/examples/form_radio.basic.example.vue +0 -16
- package/src/components/base/form/form_radio/examples/form_radio.checked_disabled.example.vue +0 -13
- package/src/components/base/form/form_radio/examples/index.js +0 -22
- package/src/components/base/form/form_select/examples/form_select.basic.example.vue +0 -17
- package/src/components/base/form/form_select/examples/form_select.disabled.example.vue +0 -17
- package/src/components/base/form/form_select/examples/form_select.manual_options.example.vue +0 -17
- package/src/components/base/form/form_select/examples/form_select.mixed_options.example.vue +0 -21
- package/src/components/base/form/form_select/examples/index.js +0 -32
- package/src/components/base/keyset_pagination/examples/index.js +0 -43
- package/src/components/base/keyset_pagination/examples/keyset_pagination.basic.example.vue +0 -16
- package/src/components/base/keyset_pagination/examples/keyset_pagination.events.example.vue +0 -29
- package/src/components/base/keyset_pagination/examples/keyset_pagination.internationalization.example.vue +0 -23
- package/src/components/base/keyset_pagination/examples/keyset_pagination.links.example.vue +0 -20
- package/src/components/base/keyset_pagination/examples/keyset_pagination.slots.example.vue +0 -23
- package/src/components/base/modal/examples/index.js +0 -39
- package/src/components/base/modal/examples/modal.basic.example.vue +0 -39
- package/src/components/base/modal/examples/modal.disabled.example.vue +0 -58
- package/src/components/base/modal/examples/modal.sizes.example.vue +0 -61
- package/src/components/charts/gauge/examples/gauge.basic.example.vue +0 -5
- package/src/components/charts/gauge/examples/gauge.no_thresholds.example.vue +0 -5
- package/src/components/charts/gauge/examples/gauge.no_value.example.vue +0 -5
- package/src/components/charts/gauge/examples/gauge.with_text.example.vue +0 -12
- package/src/components/charts/gauge/examples/index.js +0 -36
- package/src/components/utilities/intersperse/examples/index.js +0 -36
- package/src/components/utilities/intersperse/examples/intersperse.custom_last_separator.example.vue +0 -7
- package/src/components/utilities/intersperse/examples/intersperse.custom_last_separator_two_items.example.vue +0 -6
- package/src/components/utilities/intersperse/examples/intersperse.custom_separator.example.vue +0 -7
- package/src/components/utilities/intersperse/examples/intersperse.default.example.vue +0 -7
|
@@ -60,6 +60,7 @@ export const setupStorybookReadme = () =>
|
|
|
60
60
|
'GlTableLite',
|
|
61
61
|
'GlAlert',
|
|
62
62
|
'GlSparklineChart',
|
|
63
|
+
'GlAvatarsInline',
|
|
63
64
|
'GlSprintf',
|
|
64
65
|
'GlLink',
|
|
65
66
|
'GlChart',
|
|
@@ -88,7 +89,10 @@ export const setupStorybookReadme = () =>
|
|
|
88
89
|
'GlFormCheckbox',
|
|
89
90
|
'GlAccordion',
|
|
90
91
|
'GlAccordionItem',
|
|
92
|
+
'GlIntersperse',
|
|
93
|
+
'GlFormSelect',
|
|
91
94
|
'GlDaterangePicker',
|
|
95
|
+
'GlAvatarLabeled',
|
|
92
96
|
'GlBarChart',
|
|
93
97
|
'GlCarousel',
|
|
94
98
|
'GlMarkdown',
|
|
@@ -107,6 +111,11 @@ export const setupStorybookReadme = () =>
|
|
|
107
111
|
'GlFormCombobox',
|
|
108
112
|
'GlChartTooltip',
|
|
109
113
|
'GlInputGroupText',
|
|
114
|
+
'GlGaugeChart',
|
|
115
|
+
'GlFormRadio',
|
|
116
|
+
'GlModal',
|
|
117
|
+
'GlKeysetPagination',
|
|
118
|
+
'GlForm',
|
|
110
119
|
],
|
|
111
120
|
components: {
|
|
112
121
|
GlComponentDocumentation,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "32.
|
|
3
|
+
"version": "32.51.0",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"vue-runtime-helpers": "^1.1.2"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"@gitlab/svgs": "^1.116.0",
|
|
74
|
+
"@gitlab/svgs": "^1.116.0 || ^2.0.0",
|
|
75
75
|
"bootstrap": "4.5.3",
|
|
76
76
|
"pikaday": "^1.8.0",
|
|
77
77
|
"vue": "^2.6.10"
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"@babel/preset-env": "^7.10.2",
|
|
86
86
|
"@gitlab/eslint-plugin": "10.0.0",
|
|
87
87
|
"@gitlab/stylelint-config": "2.6.0",
|
|
88
|
-
"@gitlab/svgs": "
|
|
88
|
+
"@gitlab/svgs": "2.0.0",
|
|
89
89
|
"@rollup/plugin-commonjs": "^11.1.0",
|
|
90
90
|
"@rollup/plugin-node-resolve": "^7.1.3",
|
|
91
91
|
"@rollup/plugin-replace": "^2.3.2",
|
|
@@ -15,6 +15,8 @@ export const glSpacingScale12 = '5rem'
|
|
|
15
15
|
export const glSpacingScale13 = '6rem'
|
|
16
16
|
export const glSpacingScale15 = '7.5rem'
|
|
17
17
|
export const glSpacingScale20 = '10rem'
|
|
18
|
+
export const glSpacingScale26 = '13rem'
|
|
19
|
+
export const glSpacingScale62 = '31rem'
|
|
18
20
|
export const breakpointSm = '576px'
|
|
19
21
|
export const breakpointMd = '768px'
|
|
20
22
|
export const breakpointLg = '992px'
|
|
@@ -85,6 +85,16 @@
|
|
|
85
85
|
"value": "20 * $grid-size",
|
|
86
86
|
"compiledValue": "10rem"
|
|
87
87
|
},
|
|
88
|
+
{
|
|
89
|
+
"name": "$gl-spacing-scale-26",
|
|
90
|
+
"value": "26 * $grid-size",
|
|
91
|
+
"compiledValue": "13rem"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"name": "$gl-spacing-scale-62",
|
|
95
|
+
"value": "62 * $grid-size",
|
|
96
|
+
"compiledValue": "31rem"
|
|
97
|
+
},
|
|
88
98
|
{
|
|
89
99
|
"name": "$breakpoint-sm",
|
|
90
100
|
"value": "576px",
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
import description from './avatar_labeled.md';
|
|
2
|
-
import examples from './examples';
|
|
3
2
|
|
|
4
3
|
export default {
|
|
5
4
|
followsDesignSystem: true,
|
|
6
5
|
description,
|
|
7
|
-
examples,
|
|
8
|
-
slots: [
|
|
9
|
-
{
|
|
10
|
-
name: 'meta',
|
|
11
|
-
description:
|
|
12
|
-
'Meta data to add to the avatar. Generally used for badges or user status emoji.',
|
|
13
|
-
},
|
|
14
|
-
],
|
|
15
6
|
};
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
# Avatar labeled
|
|
2
|
-
|
|
3
|
-
<!-- STORY -->
|
|
4
1
|
## Usage
|
|
5
2
|
|
|
6
3
|
Avatars may also be adjacent to a text alternative, such as a user or project name. In these cases,
|
|
@@ -12,7 +9,7 @@ properties as the avatar component to modify the avatar’s shape and size.
|
|
|
12
9
|
|
|
13
10
|
## Using the component
|
|
14
11
|
|
|
15
|
-
|
|
12
|
+
```js
|
|
16
13
|
<gl-avatar-labeled
|
|
17
14
|
:shape="shape"
|
|
18
15
|
:size="size"
|
|
@@ -20,4 +17,4 @@ properties as the avatar component to modify the avatar’s shape and size.
|
|
|
20
17
|
:label="label"
|
|
21
18
|
:sub-label="subLabel"
|
|
22
19
|
/>
|
|
23
|
-
|
|
20
|
+
```
|
|
@@ -1,62 +1,32 @@
|
|
|
1
|
-
import { text, withKnobs, select } from '@storybook/addon-knobs';
|
|
2
1
|
import Vue from 'vue';
|
|
3
|
-
import { documentedStoriesOf } from '../../../../documentation/documented_stories';
|
|
4
2
|
import { GlTooltipDirective } from '../../../directives/tooltip';
|
|
5
3
|
import { avatarSizeOptions, avatarShapeOptions, tooltipPlacements } from '../../../utils/constants';
|
|
6
4
|
import readme from './avatar_labeled.md';
|
|
7
5
|
|
|
8
6
|
Vue.directive('gl-tooltip', GlTooltipDirective);
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
shape: {
|
|
25
|
-
type: String,
|
|
26
|
-
default: select('shape', avatarShapeOptions, 'circle'),
|
|
27
|
-
},
|
|
28
|
-
src: {
|
|
29
|
-
type: String,
|
|
30
|
-
default: text(
|
|
31
|
-
'src',
|
|
32
|
-
'https://assets.gitlab-static.net/uploads/-/system/group/avatar/9970/logo-extra-whitespace.png?width=64'
|
|
33
|
-
),
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
return props;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function generateTooltipProps() {
|
|
41
|
-
const props = {
|
|
42
|
-
tooltipText: {
|
|
43
|
-
type: String,
|
|
44
|
-
default: text('tooltipText', 'Avatar tooltip'),
|
|
45
|
-
},
|
|
46
|
-
placement: {
|
|
47
|
-
type: String,
|
|
48
|
-
default: select('placement', tooltipPlacements, 'top'),
|
|
49
|
-
},
|
|
50
|
-
};
|
|
8
|
+
const generateProps = ({
|
|
9
|
+
label = 'GitLab User',
|
|
10
|
+
subLabel = '@gitlab',
|
|
11
|
+
size = 32,
|
|
12
|
+
shape = 'circle',
|
|
13
|
+
src = 'https://assets.gitlab-static.net/uploads/-/system/group/avatar/9970/logo-extra-whitespace.png?width=64',
|
|
14
|
+
} = {}) => ({
|
|
15
|
+
label,
|
|
16
|
+
subLabel,
|
|
17
|
+
size,
|
|
18
|
+
shape,
|
|
19
|
+
src,
|
|
20
|
+
});
|
|
51
21
|
|
|
52
|
-
|
|
53
|
-
|
|
22
|
+
const generateTooltipProps = ({ tooltipText = 'Avatar tooltip', placement = 'top' } = {}) => ({
|
|
23
|
+
tooltipText,
|
|
24
|
+
placement,
|
|
25
|
+
});
|
|
54
26
|
|
|
55
|
-
|
|
56
|
-
.
|
|
57
|
-
|
|
58
|
-
props: generateProps(),
|
|
59
|
-
template: `
|
|
27
|
+
export const Default = (args, { argTypes }) => ({
|
|
28
|
+
props: Object.keys(argTypes),
|
|
29
|
+
template: `
|
|
60
30
|
<gl-avatar-labeled
|
|
61
31
|
:shape="shape"
|
|
62
32
|
:size="size"
|
|
@@ -65,13 +35,12 @@ documentedStoriesOf('base/avatar/labeled', readme)
|
|
|
65
35
|
:sub-label="subLabel"
|
|
66
36
|
/>
|
|
67
37
|
`,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
template: `
|
|
38
|
+
});
|
|
39
|
+
Default.args = generateProps();
|
|
40
|
+
|
|
41
|
+
export const WithTooltip = (args, { argTypes }) => ({
|
|
42
|
+
props: Object.keys(argTypes),
|
|
43
|
+
template: `
|
|
75
44
|
<gl-avatar-labeled
|
|
76
45
|
:shape="shape"
|
|
77
46
|
:size="size"
|
|
@@ -82,10 +51,20 @@ documentedStoriesOf('base/avatar/labeled', readme)
|
|
|
82
51
|
v-gl-tooltip="{ placement }"
|
|
83
52
|
/>
|
|
84
53
|
`,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
54
|
+
});
|
|
55
|
+
WithTooltip.args = { ...generateProps(), ...generateTooltipProps() };
|
|
56
|
+
WithTooltip.argTypes = {
|
|
57
|
+
placement: {
|
|
58
|
+
control: {
|
|
59
|
+
type: 'select',
|
|
60
|
+
options: tooltipPlacements,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const WithBadges = (args, { argTypes }) => ({
|
|
66
|
+
props: Object.keys(argTypes),
|
|
67
|
+
template: `
|
|
89
68
|
<gl-avatar-labeled
|
|
90
69
|
:shape="shape"
|
|
91
70
|
:size="size"
|
|
@@ -103,4 +82,31 @@ documentedStoriesOf('base/avatar/labeled', readme)
|
|
|
103
82
|
</template>
|
|
104
83
|
</gl-avatar-labeled>
|
|
105
84
|
`,
|
|
106
|
-
|
|
85
|
+
});
|
|
86
|
+
WithBadges.args = generateProps();
|
|
87
|
+
|
|
88
|
+
export default {
|
|
89
|
+
title: 'base/avatar/labeled',
|
|
90
|
+
parameters: {
|
|
91
|
+
knobs: { disable: true },
|
|
92
|
+
docs: {
|
|
93
|
+
description: {
|
|
94
|
+
component: readme,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
argTypes: {
|
|
99
|
+
size: {
|
|
100
|
+
control: {
|
|
101
|
+
type: 'select',
|
|
102
|
+
options: avatarSizeOptions,
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
shape: {
|
|
106
|
+
control: {
|
|
107
|
+
type: 'select',
|
|
108
|
+
options: avatarShapeOptions,
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
};
|
|
@@ -49,6 +49,7 @@ export default {
|
|
|
49
49
|
<span class="gl-avatar-labeled-label">{{ label }}</span>
|
|
50
50
|
</gl-link>
|
|
51
51
|
<span v-else class="gl-avatar-labeled-label">{{ label }}</span>
|
|
52
|
+
<!-- @slot Metadata to add to the avatar. Generally used for badges or user status emoji. -->
|
|
52
53
|
<slot name="meta"></slot>
|
|
53
54
|
</div>
|
|
54
55
|
<gl-link v-if="hasSubLabelLink" :href="subLabelLink" class="gl-avatar-link">
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
## Avatars inline
|
|
2
|
-
|
|
3
1
|
Use `<avatars-inline />` to display multiple avatars organized in a single row.
|
|
4
2
|
|
|
5
3
|
### Basic usage
|
|
6
4
|
|
|
7
5
|
The `avatars` property accepts an array of objects that contains the avatar properties. By default,
|
|
8
6
|
`<avatars-inline />` expects each object contained in the array to have the same shape as the
|
|
9
|
-
properties of the
|
|
7
|
+
properties of the `<avatar />` component. You can customize the display of each avatar by
|
|
10
8
|
overriding the default slot:
|
|
11
9
|
|
|
12
10
|
```html
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { number, boolean, object, select, withKnobs } from '@storybook/addon-knobs';
|
|
2
|
-
import { documentedStoriesOf } from '../../../../documentation/documented_stories';
|
|
3
1
|
import { avatarsInlineSizeOptions } from '../../../utils/constants';
|
|
4
|
-
|
|
5
2
|
import readme from './avatars_inline.md';
|
|
6
3
|
|
|
7
4
|
const defaultAvatars = [
|
|
@@ -12,53 +9,61 @@ const defaultAvatars = [
|
|
|
12
9
|
{ src: 'https://picsum.photos/id/1012/32' },
|
|
13
10
|
];
|
|
14
11
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
size: {
|
|
26
|
-
type: Number,
|
|
27
|
-
default: select('size', avatarsInlineSizeOptions, 24),
|
|
28
|
-
},
|
|
29
|
-
avatars: {
|
|
30
|
-
type: Array,
|
|
31
|
-
default: object('avatars', avatars),
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
return props;
|
|
36
|
-
}
|
|
12
|
+
const generateProps = (
|
|
13
|
+
avatars = defaultAvatars,
|
|
14
|
+
{ maxVisible = 2, collapsed = true, avatarSize = 24 } = {}
|
|
15
|
+
) => ({
|
|
16
|
+
maxVisible,
|
|
17
|
+
collapsed,
|
|
18
|
+
avatarSize,
|
|
19
|
+
avatars,
|
|
20
|
+
});
|
|
37
21
|
|
|
38
|
-
|
|
39
|
-
.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
template: `
|
|
43
|
-
<gl-avatars-inline :avatars="avatars" :collapsed="collapsed" :avatar-size="size" :max-visible="maxVisible">
|
|
22
|
+
export const Default = (args, { argTypes }) => ({
|
|
23
|
+
props: Object.keys(argTypes),
|
|
24
|
+
template: `
|
|
25
|
+
<gl-avatars-inline :avatars="avatars" :collapsed="collapsed" :avatar-size="avatarSize" :max-visible="maxVisible">
|
|
44
26
|
</gl-avatars-inline>
|
|
45
27
|
`,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}))
|
|
54
|
-
),
|
|
55
|
-
template: `
|
|
56
|
-
<gl-avatars-inline :avatars="avatars" :collapsed="collapsed" :avatar-size="size" :max-visible="maxVisible">
|
|
28
|
+
});
|
|
29
|
+
Default.args = generateProps();
|
|
30
|
+
|
|
31
|
+
export const WithLinksAndTooltips = (args, { argTypes }) => ({
|
|
32
|
+
props: Object.keys(argTypes),
|
|
33
|
+
template: `
|
|
34
|
+
<gl-avatars-inline :avatars="avatars" :collapsed="collapsed" :avatar-size="avatarSize" :max-visible="maxVisible">
|
|
57
35
|
<template #avatar="{ avatar }">
|
|
58
36
|
<gl-avatar-link target="blank" :href="avatar.href" v-gl-tooltip :title="avatar.tooltip">
|
|
59
|
-
<gl-avatar :src="avatar.src" :size="
|
|
37
|
+
<gl-avatar :src="avatar.src" :size="avatarSize" />
|
|
60
38
|
</gl-avatar-link>
|
|
61
39
|
</template>
|
|
62
40
|
</gl-avatars-inline>
|
|
63
41
|
`,
|
|
64
|
-
|
|
42
|
+
});
|
|
43
|
+
WithLinksAndTooltips.args = generateProps(
|
|
44
|
+
defaultAvatars.map((avatar, index) => ({
|
|
45
|
+
...avatar,
|
|
46
|
+
href: '//gitlab.com',
|
|
47
|
+
tooltip: `Avatar ${index}`,
|
|
48
|
+
}))
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
export default {
|
|
52
|
+
title: 'base/avatar/avatars-inline',
|
|
53
|
+
parameters: {
|
|
54
|
+
knobs: { disable: true },
|
|
55
|
+
docs: {
|
|
56
|
+
description: {
|
|
57
|
+
component: readme,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
argTypes: {
|
|
62
|
+
avatarSize: {
|
|
63
|
+
control: {
|
|
64
|
+
type: 'select',
|
|
65
|
+
options: avatarsInlineSizeOptions,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
};
|
|
@@ -1,17 +1,102 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import {
|
|
2
|
+
GlForm,
|
|
3
|
+
GlFormGroup,
|
|
4
|
+
GlFormInput,
|
|
5
|
+
GlFormSelect,
|
|
6
|
+
GlFormCheckbox,
|
|
7
|
+
GlButton,
|
|
8
|
+
} from '../../../../index';
|
|
9
|
+
import { setStoryTimeout } from '../../../utils/test_utils';
|
|
4
10
|
import readme from './form.md';
|
|
5
11
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
12
|
+
export const Default = (args) => ({
|
|
13
|
+
components: {
|
|
14
|
+
GlForm,
|
|
15
|
+
GlFormGroup,
|
|
16
|
+
GlFormInput,
|
|
17
|
+
GlFormSelect,
|
|
18
|
+
GlFormCheckbox,
|
|
19
|
+
GlButton,
|
|
20
|
+
},
|
|
21
|
+
props: Object.keys(args),
|
|
22
|
+
data() {
|
|
23
|
+
return {
|
|
24
|
+
form: {
|
|
25
|
+
submitDisabled: false,
|
|
26
|
+
email: '',
|
|
27
|
+
name: '',
|
|
28
|
+
mergeState: null,
|
|
29
|
+
checked: [],
|
|
30
|
+
},
|
|
31
|
+
states: [{ text: 'Select One', value: null }, 'Open', 'Resolved', 'Closed', 'Blocked'],
|
|
32
|
+
show: true,
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
methods: {
|
|
36
|
+
onReset() {
|
|
37
|
+
this.form.name = '';
|
|
38
|
+
this.form.submitDisabled = false;
|
|
39
|
+
},
|
|
40
|
+
onSubmit(evt) {
|
|
41
|
+
evt.preventDefault();
|
|
42
|
+
this.form.submitDisabled = true;
|
|
43
|
+
setStoryTimeout(() => {
|
|
44
|
+
this.form.submitDisabled = false;
|
|
45
|
+
// eslint-disable-next-line no-alert
|
|
46
|
+
alert(JSON.stringify(this.form));
|
|
47
|
+
}, 1000);
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
template: `
|
|
51
|
+
<gl-form @submit="onSubmit" @reset="onReset">
|
|
52
|
+
<gl-form-group
|
|
53
|
+
id="input-group-1"
|
|
54
|
+
label="Email address:"
|
|
55
|
+
label-for="input-1"
|
|
56
|
+
description="We'll never share your email with anyone else."
|
|
57
|
+
>
|
|
58
|
+
<gl-form-input
|
|
59
|
+
id="input-1"
|
|
60
|
+
v-model="form.email"
|
|
61
|
+
type="email"
|
|
62
|
+
required
|
|
63
|
+
placeholder="Enter email"
|
|
64
|
+
/>
|
|
65
|
+
</gl-form-group>
|
|
66
|
+
|
|
67
|
+
<gl-form-group id="input-group-2" label="Your Name:" label-for="input-2">
|
|
68
|
+
<gl-form-input id="input-2" v-model="form.name" required placeholder="Enter name" />
|
|
69
|
+
</gl-form-group>
|
|
9
70
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
71
|
+
<gl-form-group id="input-group-3" label="Merge State:" label-for="input-3">
|
|
72
|
+
<gl-form-select id="input-3" v-model="form.mergeState" :options="states" required />
|
|
73
|
+
</gl-form-group>
|
|
74
|
+
|
|
75
|
+
<gl-form-group id="input-group-4">
|
|
76
|
+
<gl-form-checkbox-group id="checkboxes-4" v-model="form.checked">
|
|
77
|
+
<gl-form-checkbox value="squash">Squash Commits</gl-form-checkbox>
|
|
78
|
+
<gl-form-checkbox value="new">Create New Issue</gl-form-checkbox>
|
|
79
|
+
</gl-form-checkbox-group>
|
|
80
|
+
</gl-form-group>
|
|
81
|
+
|
|
82
|
+
<div class="gl-display-flex gl-justify-content-end">
|
|
83
|
+
<gl-button type="reset" class="gl-mr-3">Cancel</gl-button>
|
|
84
|
+
<gl-button type="submit" variant="confirm">Submit</gl-button>
|
|
85
|
+
</div>
|
|
86
|
+
</gl-form>
|
|
87
|
+
`,
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
export default {
|
|
91
|
+
title: 'base/form/form',
|
|
92
|
+
component: GlForm,
|
|
93
|
+
parameters: {
|
|
94
|
+
bootstrapComponent: 'b-form',
|
|
95
|
+
knobs: { disable: true },
|
|
96
|
+
docs: {
|
|
97
|
+
description: {
|
|
98
|
+
component: readme,
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
};
|
|
@@ -1,37 +1,6 @@
|
|
|
1
|
-
import examples from './examples';
|
|
2
1
|
import description from './form_radio.md';
|
|
3
2
|
|
|
4
3
|
export default {
|
|
5
4
|
description,
|
|
6
|
-
examples,
|
|
7
5
|
followsDesignSystem: true,
|
|
8
|
-
bootstrapComponent: 'b-form-radio',
|
|
9
|
-
propsInfo: {
|
|
10
|
-
checked: {
|
|
11
|
-
additionalInfo: 'The current value of the radio(s)',
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
events: [
|
|
15
|
-
{
|
|
16
|
-
event: 'input',
|
|
17
|
-
args: [{ arg: 'checked', description: 'current selected value of radio group' }],
|
|
18
|
-
description: 'Emitted when the selected value is changed',
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
event: 'change',
|
|
22
|
-
args: [{ arg: 'checked', description: 'current selected value of radio group' }],
|
|
23
|
-
description: 'Emitted when the selected value is changed due to user interaction',
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
slots: [
|
|
27
|
-
{
|
|
28
|
-
name: 'help',
|
|
29
|
-
description:
|
|
30
|
-
'Content provided here will be shown beneath the radio. Typically used for help or descriptive text.',
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
name: 'default',
|
|
34
|
-
description: 'Content to use for the label',
|
|
35
|
-
},
|
|
36
|
-
],
|
|
37
6
|
};
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
# GlFormRadio
|
|
2
|
-
|
|
3
|
-
A radio button typically represents a single option in a group of related
|
|
4
|
-
choices. Each radio button is boolean and only one can be selected at a time.
|
|
5
|
-
|
|
6
|
-
## Usage
|
|
7
|
-
|
|
8
1
|
`GlFormRadio` components can be used directly, or via a `GlFormRadioGroup`.
|
|
9
2
|
|
|
10
3
|
Below is an example which demonstrates the direct approach. For examples using
|
|
@@ -12,13 +5,13 @@ Below is an example which demonstrates the direct approach. For examples using
|
|
|
12
5
|
|
|
13
6
|
```html
|
|
14
7
|
<script>
|
|
15
|
-
export default {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
8
|
+
export default {
|
|
9
|
+
data() {
|
|
10
|
+
return {
|
|
11
|
+
selected: 'yes',
|
|
12
|
+
};
|
|
13
|
+
},
|
|
14
|
+
};
|
|
22
15
|
</script>
|
|
23
16
|
|
|
24
17
|
<template>
|