@gitlab/ui 81.1.0 → 82.0.1
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 +30 -0
- package/dist/components/base/popover/popover.js +6 -3
- package/dist/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.js +4 -2
- package/dist/config.js +1 -1
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/tailwind.css.map +1 -1
- package/dist/utility_classes.css +1 -1
- package/dist/utility_classes.css.map +1 -1
- package/package.json +6 -4
- package/src/components/base/label/label.scss +2 -2
- package/src/components/base/popover/popover.scss +7 -0
- package/src/components/base/popover/popover.vue +17 -3
- package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.vue +4 -0
- package/src/config.js +1 -1
- package/src/scss/functions.scss +6 -13
- package/src/scss/storybook_dark_mode.scss +2 -6
- package/translations.js +13 -0
- package/translations.json +0 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "82.0.1",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"files": [
|
|
18
18
|
"src",
|
|
19
19
|
"dist",
|
|
20
|
-
"translations.
|
|
20
|
+
"translations.js",
|
|
21
21
|
"tailwind.defaults.js",
|
|
22
22
|
"!src/vendor",
|
|
23
23
|
"!*.stories.js",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"lint": "run-p prettier eslint stylelint markdownlint",
|
|
70
70
|
"lint:fix": "run-s eslint:fix prettier:fix stylelint:fix markdownlint:fix",
|
|
71
71
|
"generate:component": "plop",
|
|
72
|
-
"translations:collect": "make translations.
|
|
72
|
+
"translations:collect": "make translations.js",
|
|
73
73
|
"tailwind-config-viewer": "tailwind-config-viewer -o"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"@gitlab/eslint-plugin": "19.5.0",
|
|
109
109
|
"@gitlab/fonts": "^1.3.0",
|
|
110
110
|
"@gitlab/stylelint-config": "6.1.0",
|
|
111
|
-
"@gitlab/svgs": "3.
|
|
111
|
+
"@gitlab/svgs": "3.102.0",
|
|
112
112
|
"@jest/test-sequencer": "^29.7.0",
|
|
113
113
|
"@rollup/plugin-commonjs": "^11.1.0",
|
|
114
114
|
"@rollup/plugin-node-resolve": "^7.1.3",
|
|
@@ -134,6 +134,8 @@
|
|
|
134
134
|
"@vue/vue2-jest": "29.0.0",
|
|
135
135
|
"@vue/vue3-jest": "^29.1.1",
|
|
136
136
|
"@yarnpkg/lockfile": "^1.1.0",
|
|
137
|
+
"acorn": "^8.11.3",
|
|
138
|
+
"acorn-walk": "^8.3.2",
|
|
137
139
|
"autoprefixer": "^9.7.6",
|
|
138
140
|
"axe-core": "^4.2.3",
|
|
139
141
|
"babel-jest": "29.0.1",
|
|
@@ -54,8 +54,8 @@ $label-close-button: '.gl-label-close.gl-button';
|
|
|
54
54
|
@include gl-display-flex;
|
|
55
55
|
width: px-to-rem(14px);
|
|
56
56
|
height: px-to-rem(14px);
|
|
57
|
-
margin-left: #{-$gl-spacing-scale-1 - ($gl-spacing-scale-1 / 2)
|
|
58
|
-
margin-right: #{$gl-spacing-scale-2 - ($gl-spacing-scale-1 / 2)
|
|
57
|
+
margin-left: calc(#{-$gl-spacing-scale-1} - (#{$gl-spacing-scale-1} / 2));
|
|
58
|
+
margin-right: calc(#{$gl-spacing-scale-2} - (#{$gl-spacing-scale-1} / 2));
|
|
59
59
|
@include gl-p-0;
|
|
60
60
|
@include gl-rounded-full;
|
|
61
61
|
@include gl-shadow-none;
|
|
@@ -67,12 +67,19 @@ $gl-popover-max-width: $grid-size * 35;
|
|
|
67
67
|
@include gl-bg-white;
|
|
68
68
|
@include gl-border-bottom-0;
|
|
69
69
|
@include gl-pb-0;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&.has-title .popover-header {
|
|
70
73
|
@include gl-overflow-anywhere;
|
|
71
74
|
display: flex;
|
|
72
75
|
align-items: flex-start;
|
|
73
76
|
justify-content: space-between;
|
|
74
77
|
}
|
|
75
78
|
|
|
79
|
+
&.has-close-button:not(.has-title) .popover-header {
|
|
80
|
+
padding-top: $gl-spacing-scale-2;
|
|
81
|
+
}
|
|
82
|
+
|
|
76
83
|
.popover-body {
|
|
77
84
|
@include gl-py-3;
|
|
78
85
|
@include gl-px-4;
|
|
@@ -53,11 +53,21 @@ export default {
|
|
|
53
53
|
},
|
|
54
54
|
},
|
|
55
55
|
computed: {
|
|
56
|
+
hasTitle() {
|
|
57
|
+
return this.$scopedSlots.title || this.title;
|
|
58
|
+
},
|
|
56
59
|
customClass() {
|
|
57
|
-
return [
|
|
60
|
+
return [
|
|
61
|
+
'gl-popover',
|
|
62
|
+
this.hasTitle && 'has-title',
|
|
63
|
+
this.showCloseButton && 'has-close-button',
|
|
64
|
+
...this.cssClasses,
|
|
65
|
+
]
|
|
66
|
+
.filter(Boolean)
|
|
67
|
+
.join(' ');
|
|
58
68
|
},
|
|
59
69
|
shouldShowTitle() {
|
|
60
|
-
return this
|
|
70
|
+
return this.hasTitle || this.showCloseButton;
|
|
61
71
|
},
|
|
62
72
|
},
|
|
63
73
|
methods: {
|
|
@@ -89,7 +99,11 @@ export default {
|
|
|
89
99
|
{{ title }}
|
|
90
100
|
</slot>
|
|
91
101
|
<div v-if="showCloseButton" class="gl-mt-n2 gl-mr-n3 gl-ml-3 gl-h-0">
|
|
92
|
-
<close-button
|
|
102
|
+
<close-button
|
|
103
|
+
:class="{ 'gl-float-right gl-mt-2': !hasTitle }"
|
|
104
|
+
data-testid="close-button"
|
|
105
|
+
@click="close"
|
|
106
|
+
/>
|
|
93
107
|
</div>
|
|
94
108
|
</template>
|
|
95
109
|
<slot></slot>
|
package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.vue
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import GlIcon from '../../../../../base/icon/icon.vue';
|
|
3
|
+
import GlLoadingIcon from '../../../../../base/loading_icon/loading_icon.vue';
|
|
3
4
|
import { GlTooltipDirective } from '../../../../../../directives/tooltip';
|
|
4
5
|
import GlDuoUserFeedback from '../../../user_feedback/user_feedback.vue';
|
|
5
6
|
import GlFormGroup from '../../../../../base/form/form_group/form_group.vue';
|
|
@@ -37,6 +38,7 @@ export default {
|
|
|
37
38
|
GlFormGroup,
|
|
38
39
|
GlFormTextarea,
|
|
39
40
|
GlIcon,
|
|
41
|
+
GlLoadingIcon,
|
|
40
42
|
},
|
|
41
43
|
directives: {
|
|
42
44
|
SafeHtml,
|
|
@@ -199,7 +201,9 @@ export default {
|
|
|
199
201
|
<documentation-sources v-if="sources" :sources="sources" />
|
|
200
202
|
|
|
201
203
|
<div class="gl-display-flex gl-align-items-flex-end gl-mt-4 duo-chat-message-feedback">
|
|
204
|
+
<gl-loading-icon v-if="isChunk" class="gl-pt-4" variant="dots" inline />
|
|
202
205
|
<gl-duo-user-feedback
|
|
206
|
+
v-if="!isChunk"
|
|
203
207
|
:feedback-received="hasFeedback"
|
|
204
208
|
:modal-title="$options.i18n.MODAL.TITLE"
|
|
205
209
|
:modal-alert="$options.i18n.MODAL.ALERT_TEXT"
|
package/src/config.js
CHANGED
package/src/scss/functions.scss
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use 'sass:math';
|
|
2
|
+
|
|
1
3
|
/*
|
|
2
4
|
* SASS preserves units in arithmetic operations. For example:
|
|
3
5
|
* 12em * 0 = 0em. This function return the unit of a numeric value.
|
|
@@ -10,7 +12,7 @@
|
|
|
10
12
|
|
|
11
13
|
@function strip-unit($number) {
|
|
12
14
|
@if type-of($number) == 'number' and not unitless($number) {
|
|
13
|
-
@return $number
|
|
15
|
+
@return math.div($number, extract-unit($number));
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
@return $number;
|
|
@@ -21,10 +23,7 @@
|
|
|
21
23
|
@return $value;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
|
-
|
|
25
|
-
// We can't update this yet since GitLab uses SassC, which doesn't support math.div
|
|
26
|
-
// See https://gitlab.com/gitlab-org/gitlab-ui/-/issues/1954#note_1078281533
|
|
27
|
-
$converted: $value / $font-size-base;
|
|
26
|
+
$converted: math.div($value, $font-size-base);
|
|
28
27
|
|
|
29
28
|
@return strip-unit($converted) * 1rem;
|
|
30
29
|
}
|
|
@@ -57,14 +56,8 @@
|
|
|
57
56
|
$min-width: px-to-rem($min-width);
|
|
58
57
|
$max-width: px-to-rem($max-width);
|
|
59
58
|
|
|
60
|
-
|
|
61
|
-
// We can't update this yet since GitLab uses SassC, which doesn't support math.div
|
|
62
|
-
// See https://gitlab.com/gitlab-org/gitlab-ui/-/issues/1954#note_1078281533
|
|
63
|
-
$slope: ($max - $min) / ($max-width - $min-width);
|
|
59
|
+
$slope: math.div($max - $min, $max-width - $min-width);
|
|
64
60
|
$intersection: (-$min-width * $slope) + $min;
|
|
65
61
|
|
|
66
|
-
|
|
67
|
-
// compilation failure.
|
|
68
|
-
// See https://gitlab.com/gitlab-org/gitlab-ui/-/merge_requests/2972
|
|
69
|
-
@return clamp(#{$min}, calc(#{$intersection} + #{$slope * 100vw}), #{$max});
|
|
62
|
+
@return clamp(#{$min}, #{$intersection} + #{$slope * 100vw}, #{$max});
|
|
70
63
|
}
|
|
@@ -10,8 +10,6 @@
|
|
|
10
10
|
// to use Custom Properties instead
|
|
11
11
|
|
|
12
12
|
.gl-dark {
|
|
13
|
-
--color-body-bg: #1f1f1f;
|
|
14
|
-
|
|
15
13
|
// Note that we are assigning variables with different values due to the way GitLab inverts variables in dark mode.
|
|
16
14
|
// e.g. text color is usually $gray-900, but in dark mode $gray-900 variable gets inverted to $gray-50
|
|
17
15
|
--gl-text-color: #{$gray-50};
|
|
@@ -23,9 +21,7 @@
|
|
|
23
21
|
|
|
24
22
|
&,
|
|
25
23
|
body {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
background-color: var(--color-body-bg);
|
|
29
|
-
color: var(--gl-text-color);
|
|
24
|
+
background-color: var(--gl-background-color-default);
|
|
25
|
+
color: var(--gl-text-color-default);
|
|
30
26
|
}
|
|
31
27
|
}
|
package/translations.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* eslint-disable import/no-default-export */
|
|
2
|
+
export default {
|
|
3
|
+
'ClearIconButton.title': 'Clear',
|
|
4
|
+
'GlBreadcrumb.showMoreLabel': 'Show more breadcrumbs',
|
|
5
|
+
'GlCollapsibleListbox.srOnlyResultsLabel': 'Results count',
|
|
6
|
+
'GlKeysetPagination.navigationLabel': 'Pagination',
|
|
7
|
+
'GlKeysetPagination.nextText': 'Next',
|
|
8
|
+
'GlKeysetPagination.prevText': 'Previous',
|
|
9
|
+
'GlSearchBoxByType.clearButtonTitle': 'Clear',
|
|
10
|
+
'GlSearchBoxByType.input.placeholder': 'Search',
|
|
11
|
+
'GlSorting.sortAscending': 'Sort direction: ascending',
|
|
12
|
+
'GlSorting.sortDescending': 'Sort direction: descending',
|
|
13
|
+
};
|
package/translations.json
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"ClearIconButton.title": "Clear",
|
|
3
|
-
"GlBreadcrumb.showMoreLabel": "Show more breadcrumbs",
|
|
4
|
-
"GlCollapsibleListbox.srOnlyResultsLabel": "Results count",
|
|
5
|
-
"GlKeysetPagination.navigationLabel": "Pagination",
|
|
6
|
-
"GlKeysetPagination.nextText": "Next",
|
|
7
|
-
"GlKeysetPagination.prevText": "Previous",
|
|
8
|
-
"GlSearchBoxByType.clearButtonTitle": "Clear",
|
|
9
|
-
"GlSearchBoxByType.input.placeholder": "Search",
|
|
10
|
-
"GlSorting.sortAscending": "Sort direction: ascending",
|
|
11
|
-
"GlSorting.sortDescending": "Sort direction: descending"
|
|
12
|
-
}
|