@gitlab/ui 43.2.2 → 43.5.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 +21 -0
- package/dist/components/base/modal/modal.js +7 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/utility_classes.css +1 -1
- package/dist/utility_classes.css.map +1 -1
- package/package.json +5 -5
- package/src/components/base/modal/modal.stories.js +8 -0
- package/src/components/base/modal/modal.vue +12 -5
- package/src/components/base/nav/nav.stories.js +1 -1
- package/src/scss/functions.scss +4 -1
- package/src/scss/mixins.spec.scss +2 -2
- package/src/scss/utilities.scss +26 -0
- package/src/scss/utility-mixins/overflow.scss +4 -0
- package/src/scss/utility-mixins/text.scss +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "43.
|
|
3
|
+
"version": "43.5.0",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"vue-runtime-helpers": "^1.1.2"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
|
-
"@gitlab/svgs": "^1.116.0 || ^2.0.0",
|
|
68
|
+
"@gitlab/svgs": "^1.116.0 || ^2.0.0 || ^3.0.0",
|
|
69
69
|
"bootstrap": "4.5.3",
|
|
70
70
|
"emoji-regex": ">=10.0.0",
|
|
71
71
|
"pikaday": "^1.8.0",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"@babel/preset-env": "^7.18.10",
|
|
84
84
|
"@gitlab/eslint-plugin": "15.0.0",
|
|
85
85
|
"@gitlab/stylelint-config": "4.1.0",
|
|
86
|
-
"@gitlab/svgs": "
|
|
86
|
+
"@gitlab/svgs": "3.0.0",
|
|
87
87
|
"@rollup/plugin-commonjs": "^11.1.0",
|
|
88
88
|
"@rollup/plugin-node-resolve": "^7.1.3",
|
|
89
89
|
"@rollup/plugin-replace": "^2.3.2",
|
|
@@ -106,10 +106,10 @@
|
|
|
106
106
|
"bootstrap": "4.5.3",
|
|
107
107
|
"cypress": "^6.6.0",
|
|
108
108
|
"emoji-regex": "^10.0.0",
|
|
109
|
-
"eslint": "8.
|
|
109
|
+
"eslint": "8.21.0",
|
|
110
110
|
"eslint-import-resolver-jest": "3.0.2",
|
|
111
111
|
"eslint-plugin-cypress": "2.12.1",
|
|
112
|
-
"eslint-plugin-storybook": "0.6.
|
|
112
|
+
"eslint-plugin-storybook": "0.6.3",
|
|
113
113
|
"file-loader": "^4.2.0",
|
|
114
114
|
"glob": "^7.2.0",
|
|
115
115
|
"identity-obj-proxy": "^3.0.0",
|
|
@@ -27,6 +27,7 @@ const generateTemplate = ({ props = {}, slots = {} } = {}) => {
|
|
|
27
27
|
:action-cancel="{text: 'Cancel'}"
|
|
28
28
|
:visible="$options.viewMode !== 'docs'"
|
|
29
29
|
:scrollable="scrollable"
|
|
30
|
+
:no-focus-on-show="noFocusOnShow"
|
|
30
31
|
modal-id="test-modal-id"
|
|
31
32
|
title="Example title"
|
|
32
33
|
no-fade
|
|
@@ -54,6 +55,7 @@ const generateProps = ({
|
|
|
54
55
|
variant = variantOptionsWithNoDefault.default,
|
|
55
56
|
contentPagraphs = 1,
|
|
56
57
|
scrollable = false,
|
|
58
|
+
noFocusOnShow = false,
|
|
57
59
|
} = {}) => ({
|
|
58
60
|
headerBgVariant: variant,
|
|
59
61
|
headerBorderVariant: variant,
|
|
@@ -65,6 +67,7 @@ const generateProps = ({
|
|
|
65
67
|
footerTextVariant: variant,
|
|
66
68
|
contentParagraphs: contentPagraphs,
|
|
67
69
|
scrollable,
|
|
70
|
+
noFocusOnShow,
|
|
68
71
|
});
|
|
69
72
|
|
|
70
73
|
export const Default = Template.bind({});
|
|
@@ -100,6 +103,11 @@ export const WithoutAFooter = (args, { argTypes, viewMode }) => ({
|
|
|
100
103
|
});
|
|
101
104
|
WithoutAFooter.args = generateProps();
|
|
102
105
|
|
|
106
|
+
export const WithoutFocus = Template.bind({});
|
|
107
|
+
WithoutFocus.args = generateProps({
|
|
108
|
+
noFocusOnShow: true,
|
|
109
|
+
});
|
|
110
|
+
|
|
103
111
|
export default {
|
|
104
112
|
title: 'base/modal',
|
|
105
113
|
component: GlModal,
|
|
@@ -85,6 +85,11 @@ export default {
|
|
|
85
85
|
required: false,
|
|
86
86
|
default: '',
|
|
87
87
|
},
|
|
88
|
+
noFocusOnShow: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
required: false,
|
|
91
|
+
default: false,
|
|
92
|
+
},
|
|
88
93
|
},
|
|
89
94
|
computed: {
|
|
90
95
|
shouldRenderModalOk() {
|
|
@@ -151,6 +156,8 @@ export default {
|
|
|
151
156
|
return prop.attributes;
|
|
152
157
|
},
|
|
153
158
|
setFocus() {
|
|
159
|
+
if (this.noFocusOnShow) return;
|
|
160
|
+
|
|
154
161
|
const btnElts = [...this.$refs.modal.$refs.modal.querySelectorAll('button')];
|
|
155
162
|
const modalElts = [
|
|
156
163
|
...this.$refs.modal.$refs.body.querySelectorAll(focusableTags.join(COMMA)),
|
|
@@ -171,10 +178,10 @@ export default {
|
|
|
171
178
|
</script>
|
|
172
179
|
|
|
173
180
|
<template>
|
|
174
|
-
<!--
|
|
181
|
+
<!--
|
|
175
182
|
Emitted when the modal visibility changes
|
|
176
183
|
@event change
|
|
177
|
-
|
|
184
|
+
-->
|
|
178
185
|
<b-modal
|
|
179
186
|
:id="modalId"
|
|
180
187
|
ref="modal"
|
|
@@ -217,7 +224,7 @@ export default {
|
|
|
217
224
|
<!--
|
|
218
225
|
Emitted when clicked on modal-action-cancel
|
|
219
226
|
@event canceled
|
|
220
|
-
|
|
227
|
+
-->
|
|
221
228
|
<gl-button
|
|
222
229
|
v-if="actionCancel"
|
|
223
230
|
class="js-modal-action-cancel"
|
|
@@ -229,7 +236,7 @@ export default {
|
|
|
229
236
|
<!--
|
|
230
237
|
Emitted when clicked on modal-action-secondary
|
|
231
238
|
@event secondary
|
|
232
|
-
|
|
239
|
+
-->
|
|
233
240
|
<gl-button
|
|
234
241
|
v-if="actionSecondary"
|
|
235
242
|
class="js-modal-action-secondary"
|
|
@@ -241,7 +248,7 @@ export default {
|
|
|
241
248
|
<!--
|
|
242
249
|
Emitted when clicked on modal-action-primary
|
|
243
250
|
@event primary
|
|
244
|
-
|
|
251
|
+
-->
|
|
245
252
|
<gl-button
|
|
246
253
|
v-if="actionPrimary"
|
|
247
254
|
class="js-modal-action-primary"
|
|
@@ -31,7 +31,7 @@ export const Default = (_args, { argTypes }) => ({
|
|
|
31
31
|
<gl-nav-item-dropdown text="Dropdown">
|
|
32
32
|
<template #button-content>
|
|
33
33
|
<gl-icon name="question" />
|
|
34
|
-
<gl-icon name="
|
|
34
|
+
<gl-icon name="chevron-down" />
|
|
35
35
|
</template>
|
|
36
36
|
<gl-dropdown-item>One</gl-dropdown-item>
|
|
37
37
|
<gl-dropdown-item>Two</gl-dropdown-item>
|
package/src/scss/functions.scss
CHANGED
|
@@ -57,5 +57,8 @@
|
|
|
57
57
|
$slope: ($max - $min) / ($max-width - $min-width);
|
|
58
58
|
$intersection: (-$min-width * $slope) + $min;
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
// Use calc() inside of clamp() function to work around SassC
|
|
61
|
+
// compilation failure.
|
|
62
|
+
// See https://gitlab.com/gitlab-org/gitlab-ui/-/merge_requests/2972
|
|
63
|
+
@return clamp(#{$min}, calc(#{$intersection} + #{$slope * 100vw}), #{$max});
|
|
61
64
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
}
|
|
11
11
|
@include expect {
|
|
12
12
|
// prettier-ignore
|
|
13
|
-
font-size: clamp(2rem, #{-0.66667rem} + #{5.55556vw}, 3.5rem);
|
|
13
|
+
font-size: clamp(2rem, calc(#{-0.66667rem} + #{5.55556vw}), 3.5rem);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
}
|
|
25
25
|
@include expect {
|
|
26
26
|
// prettier-ignore
|
|
27
|
-
line-height: clamp(2rem, #{-0.66667rem} + #{5.55556vw}, 3.5rem);
|
|
27
|
+
line-height: clamp(2rem, calc(#{-0.66667rem} + #{5.55556vw}), 3.5rem);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}
|
package/src/scss/utilities.scss
CHANGED
|
@@ -3778,6 +3778,14 @@
|
|
|
3778
3778
|
overflow-wrap: anywhere !important
|
|
3779
3779
|
}
|
|
3780
3780
|
|
|
3781
|
+
.gl-overflow-x-scroll {
|
|
3782
|
+
overflow-x: scroll
|
|
3783
|
+
}
|
|
3784
|
+
|
|
3785
|
+
.gl-overflow-x-scroll\! {
|
|
3786
|
+
overflow-x: scroll !important
|
|
3787
|
+
}
|
|
3788
|
+
|
|
3781
3789
|
.gl-overflow-scroll {
|
|
3782
3790
|
overflow: scroll
|
|
3783
3791
|
}
|
|
@@ -7478,9 +7486,27 @@
|
|
|
7478
7486
|
.gl-text-decoration-underline {
|
|
7479
7487
|
text-decoration: underline;
|
|
7480
7488
|
}
|
|
7489
|
+
.gl-active-text-decoration-underline:active {
|
|
7490
|
+
text-decoration: underline;
|
|
7491
|
+
}
|
|
7492
|
+
.gl-focus-text-decoration-underline:focus {
|
|
7493
|
+
text-decoration: underline;
|
|
7494
|
+
}
|
|
7495
|
+
.gl-hover-text-decoration-underline:hover {
|
|
7496
|
+
text-decoration: underline;
|
|
7497
|
+
}
|
|
7481
7498
|
.gl-text-decoration-underline\! {
|
|
7482
7499
|
text-decoration: underline !important;
|
|
7483
7500
|
}
|
|
7501
|
+
.gl-active-text-decoration-underline\!:active {
|
|
7502
|
+
text-decoration: underline !important;
|
|
7503
|
+
}
|
|
7504
|
+
.gl-focus-text-decoration-underline\!:focus {
|
|
7505
|
+
text-decoration: underline !important;
|
|
7506
|
+
}
|
|
7507
|
+
.gl-hover-text-decoration-underline\!:hover {
|
|
7508
|
+
text-decoration: underline !important;
|
|
7509
|
+
}
|
|
7484
7510
|
.gl-reset-text-decoration-color {
|
|
7485
7511
|
text-decoration-color: inherit;
|
|
7486
7512
|
}
|