@gitlab/ui 43.21.0 → 44.1.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 +41 -0
- package/dist/components/base/alert/alert.js +9 -1
- package/dist/utility_classes.css +1 -1
- package/dist/utility_classes.css.map +1 -1
- package/package.json +7 -7
- package/src/components/base/alert/alert.spec.js +21 -1
- package/src/components/base/alert/alert.vue +8 -1
- package/src/scss/utilities.scss +0 -60
- package/src/scss/utility-mixins/spacing.scss +0 -42
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "44.1.0",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -77,8 +77,8 @@
|
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"@arkweid/lefthook": "0.7.7",
|
|
80
|
-
"@babel/core": "^7.19.
|
|
81
|
-
"@babel/preset-env": "^7.19.
|
|
80
|
+
"@babel/core": "^7.19.3",
|
|
81
|
+
"@babel/preset-env": "^7.19.3",
|
|
82
82
|
"@gitlab/eslint-plugin": "18.0.0",
|
|
83
83
|
"@gitlab/stylelint-config": "4.1.0",
|
|
84
84
|
"@gitlab/svgs": "3.4.0",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"babel-plugin-require-context-hook": "^1.0.0",
|
|
103
103
|
"babel-preset-vue": "^2.0.2",
|
|
104
104
|
"bootstrap": "4.5.3",
|
|
105
|
-
"cypress": "^10.
|
|
105
|
+
"cypress": "^10.9.0",
|
|
106
106
|
"emoji-regex": "^10.0.0",
|
|
107
107
|
"eslint": "8.24.0",
|
|
108
108
|
"eslint-import-resolver-jest": "3.0.2",
|
|
@@ -112,9 +112,9 @@
|
|
|
112
112
|
"glob": "^7.2.0",
|
|
113
113
|
"identity-obj-proxy": "^3.0.0",
|
|
114
114
|
"inquirer-select-directory": "^1.2.0",
|
|
115
|
-
"jest": "^29.
|
|
116
|
-
"jest-circus": "29.
|
|
117
|
-
"jest-environment-jsdom": "29.
|
|
115
|
+
"jest": "^29.1.2",
|
|
116
|
+
"jest-circus": "29.1.2",
|
|
117
|
+
"jest-environment-jsdom": "29.1.2",
|
|
118
118
|
"jest-serializer-vue": "^2.0.2",
|
|
119
119
|
"markdownlint-cli": "^0.29.0",
|
|
120
120
|
"mockdate": "^2.0.5",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { shallowMount } from '@vue/test-utils';
|
|
2
|
-
import { buttonCategoryOptions } from '../../../utils/constants';
|
|
2
|
+
import { alertVariantOptions, buttonCategoryOptions } from '../../../utils/constants';
|
|
3
3
|
import GlAlert from './alert.vue';
|
|
4
4
|
|
|
5
5
|
const DummyComponent = {
|
|
@@ -191,4 +191,24 @@ describe('Alert component', () => {
|
|
|
191
191
|
});
|
|
192
192
|
});
|
|
193
193
|
});
|
|
194
|
+
|
|
195
|
+
describe('aria-live', () => {
|
|
196
|
+
it.each([alertVariantOptions.danger, alertVariantOptions.warning])(
|
|
197
|
+
'for %p variant, has aria-live assertive attribute',
|
|
198
|
+
(variant) => {
|
|
199
|
+
createComponent({ propsData: { variant } });
|
|
200
|
+
|
|
201
|
+
expect(wrapper.find('[aria-live=assertive').exists()).toBe(true);
|
|
202
|
+
}
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
it.each([alertVariantOptions.info, alertVariantOptions.success, alertVariantOptions.tip])(
|
|
206
|
+
'for %p variant, has aria-live polite attribute',
|
|
207
|
+
(variant) => {
|
|
208
|
+
createComponent({ propsData: { variant } });
|
|
209
|
+
|
|
210
|
+
expect(wrapper.find('[aria-live=polite]').exists()).toBe(true);
|
|
211
|
+
}
|
|
212
|
+
);
|
|
213
|
+
});
|
|
194
214
|
});
|
|
@@ -90,6 +90,13 @@ export default {
|
|
|
90
90
|
},
|
|
91
91
|
},
|
|
92
92
|
computed: {
|
|
93
|
+
ariaLive() {
|
|
94
|
+
if ([alertVariantOptions.danger, alertVariantOptions.warning].includes(this.variant)) {
|
|
95
|
+
return 'assertive';
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return 'polite';
|
|
99
|
+
},
|
|
93
100
|
iconName() {
|
|
94
101
|
return alertVariantIconMap[this.variant];
|
|
95
102
|
},
|
|
@@ -185,7 +192,7 @@ export default {
|
|
|
185
192
|
:class="{ 'gl-alert-icon': true, 'gl-alert-icon-no-title': !title }"
|
|
186
193
|
/>
|
|
187
194
|
|
|
188
|
-
<div class="gl-alert-content" role="alert">
|
|
195
|
+
<div class="gl-alert-content" role="alert" :aria-live="ariaLive">
|
|
189
196
|
<h2 v-if="title" class="gl-alert-title">{{ title }}</h2>
|
|
190
197
|
|
|
191
198
|
<div class="gl-alert-body">
|
package/src/scss/utilities.scss
CHANGED
|
@@ -6704,66 +6704,6 @@
|
|
|
6704
6704
|
margin-top: $gl-spacing-scale-5 !important;
|
|
6705
6705
|
}
|
|
6706
6706
|
}
|
|
6707
|
-
.gl-sm-pt-0 {
|
|
6708
|
-
@include gl-media-breakpoint-down(sm) {
|
|
6709
|
-
padding-top: 0;
|
|
6710
|
-
}
|
|
6711
|
-
}
|
|
6712
|
-
.gl-sm-pt-0\! {
|
|
6713
|
-
@include gl-media-breakpoint-down(sm) {
|
|
6714
|
-
padding-top: 0 !important;
|
|
6715
|
-
}
|
|
6716
|
-
}
|
|
6717
|
-
.gl-sm-pt-1 {
|
|
6718
|
-
@include gl-media-breakpoint-down(sm) {
|
|
6719
|
-
padding-top: $gl-spacing-scale-1;
|
|
6720
|
-
}
|
|
6721
|
-
}
|
|
6722
|
-
.gl-sm-pt-1\! {
|
|
6723
|
-
@include gl-media-breakpoint-down(sm) {
|
|
6724
|
-
padding-top: $gl-spacing-scale-1 !important;
|
|
6725
|
-
}
|
|
6726
|
-
}
|
|
6727
|
-
.gl-sm-pt-2 {
|
|
6728
|
-
@include gl-media-breakpoint-down(sm) {
|
|
6729
|
-
padding-top: $gl-spacing-scale-2;
|
|
6730
|
-
}
|
|
6731
|
-
}
|
|
6732
|
-
.gl-sm-pt-2\! {
|
|
6733
|
-
@include gl-media-breakpoint-down(sm) {
|
|
6734
|
-
padding-top: $gl-spacing-scale-2 !important;
|
|
6735
|
-
}
|
|
6736
|
-
}
|
|
6737
|
-
.gl-sm-pt-3 {
|
|
6738
|
-
@include gl-media-breakpoint-down(sm) {
|
|
6739
|
-
padding-top: $gl-spacing-scale-3;
|
|
6740
|
-
}
|
|
6741
|
-
}
|
|
6742
|
-
.gl-sm-pt-3\! {
|
|
6743
|
-
@include gl-media-breakpoint-down(sm) {
|
|
6744
|
-
padding-top: $gl-spacing-scale-3 !important;
|
|
6745
|
-
}
|
|
6746
|
-
}
|
|
6747
|
-
.gl-sm-pt-4 {
|
|
6748
|
-
@include gl-media-breakpoint-down(sm) {
|
|
6749
|
-
padding-top: $gl-spacing-scale-4;
|
|
6750
|
-
}
|
|
6751
|
-
}
|
|
6752
|
-
.gl-sm-pt-4\! {
|
|
6753
|
-
@include gl-media-breakpoint-down(sm) {
|
|
6754
|
-
padding-top: $gl-spacing-scale-4 !important;
|
|
6755
|
-
}
|
|
6756
|
-
}
|
|
6757
|
-
.gl-sm-pt-5 {
|
|
6758
|
-
@include gl-media-breakpoint-down(sm) {
|
|
6759
|
-
padding-top: $gl-spacing-scale-5;
|
|
6760
|
-
}
|
|
6761
|
-
}
|
|
6762
|
-
.gl-sm-pt-5\! {
|
|
6763
|
-
@include gl-media-breakpoint-down(sm) {
|
|
6764
|
-
padding-top: $gl-spacing-scale-5 !important;
|
|
6765
|
-
}
|
|
6766
|
-
}
|
|
6767
6707
|
.gl-sm-pr-0 {
|
|
6768
6708
|
@include gl-media-breakpoint-down(sm) {
|
|
6769
6709
|
padding-right: 0;
|
|
@@ -1060,48 +1060,6 @@
|
|
|
1060
1060
|
* - Utilities should strictly follow $gl-spacing-scale
|
|
1061
1061
|
*/
|
|
1062
1062
|
|
|
1063
|
-
@mixin gl-sm-pt-0 {
|
|
1064
|
-
// stylelint-disable-next-line @gitlab/no-gl-media-breakpoint-down
|
|
1065
|
-
@include gl-media-breakpoint-down(sm) {
|
|
1066
|
-
@include gl-pt-0;
|
|
1067
|
-
}
|
|
1068
|
-
}
|
|
1069
|
-
|
|
1070
|
-
@mixin gl-sm-pt-1 {
|
|
1071
|
-
// stylelint-disable-next-line @gitlab/no-gl-media-breakpoint-down
|
|
1072
|
-
@include gl-media-breakpoint-down(sm) {
|
|
1073
|
-
@include gl-pt-1;
|
|
1074
|
-
}
|
|
1075
|
-
}
|
|
1076
|
-
|
|
1077
|
-
@mixin gl-sm-pt-2 {
|
|
1078
|
-
// stylelint-disable-next-line @gitlab/no-gl-media-breakpoint-down
|
|
1079
|
-
@include gl-media-breakpoint-down(sm) {
|
|
1080
|
-
@include gl-pt-2;
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
|
-
|
|
1084
|
-
@mixin gl-sm-pt-3 {
|
|
1085
|
-
// stylelint-disable-next-line @gitlab/no-gl-media-breakpoint-down
|
|
1086
|
-
@include gl-media-breakpoint-down(sm) {
|
|
1087
|
-
@include gl-pt-3;
|
|
1088
|
-
}
|
|
1089
|
-
}
|
|
1090
|
-
|
|
1091
|
-
@mixin gl-sm-pt-4 {
|
|
1092
|
-
// stylelint-disable-next-line @gitlab/no-gl-media-breakpoint-down
|
|
1093
|
-
@include gl-media-breakpoint-down(sm) {
|
|
1094
|
-
@include gl-pt-4;
|
|
1095
|
-
}
|
|
1096
|
-
}
|
|
1097
|
-
|
|
1098
|
-
@mixin gl-sm-pt-5 {
|
|
1099
|
-
// stylelint-disable-next-line @gitlab/no-gl-media-breakpoint-down
|
|
1100
|
-
@include gl-media-breakpoint-down(sm) {
|
|
1101
|
-
@include gl-pt-5;
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
|
|
1105
1063
|
@mixin gl-sm-pr-0 {
|
|
1106
1064
|
// stylelint-disable-next-line @gitlab/no-gl-media-breakpoint-down
|
|
1107
1065
|
@include gl-media-breakpoint-down(sm) {
|