@gitlab/ui 66.15.0 → 66.18.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 +1 -1
- package/dist/components/regions/empty_state/empty_state.js +2 -2
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/tokens/css/tokens.css +1 -1
- package/dist/tokens/css/tokens.dark.css +1 -1
- package/dist/tokens/js/tokens.dark.js +1 -1
- package/dist/tokens/js/tokens.js +1 -1
- package/dist/tokens/scss/_tokens.dark.scss +1 -1
- package/dist/tokens/scss/_tokens.scss +1 -1
- package/dist/utility_classes.css +1 -1
- package/dist/utility_classes.css.map +1 -1
- package/package.json +14 -14
- package/src/components/base/modal/modal.scss +1 -3
- package/src/components/base/modal/modal.spec.js +2 -2
- package/src/components/base/modal/modal.vue +2 -2
- package/src/components/regions/empty_state/empty_state.scss +3 -0
- package/src/components/regions/empty_state/empty_state.spec.js +11 -1
- package/src/components/regions/empty_state/empty_state.vue +60 -59
- package/src/scss/components.scss +1 -0
- package/src/scss/mixins.scss +19 -9
- package/src/scss/utilities.scss +350 -92
- package/src/scss/utility-mixins/typography.scss +153 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "66.
|
|
3
|
+
"version": "66.18.0",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -98,18 +98,18 @@
|
|
|
98
98
|
"@rollup/plugin-commonjs": "^11.1.0",
|
|
99
99
|
"@rollup/plugin-node-resolve": "^7.1.3",
|
|
100
100
|
"@rollup/plugin-replace": "^2.3.2",
|
|
101
|
-
"@storybook/addon-a11y": "7.4.
|
|
102
|
-
"@storybook/addon-docs": "7.4.
|
|
103
|
-
"@storybook/addon-essentials": "7.4.
|
|
104
|
-
"@storybook/addon-storyshots": "7.4.
|
|
105
|
-
"@storybook/addon-storyshots-puppeteer": "7.4.
|
|
106
|
-
"@storybook/addon-viewport": "7.4.
|
|
107
|
-
"@storybook/builder-webpack5": "7.4.
|
|
108
|
-
"@storybook/theming": "7.4.
|
|
109
|
-
"@storybook/vue": "7.4.
|
|
110
|
-
"@storybook/vue-webpack5": "7.4.
|
|
111
|
-
"@storybook/vue3": "7.4.
|
|
112
|
-
"@storybook/vue3-webpack5": "7.4.
|
|
101
|
+
"@storybook/addon-a11y": "7.4.5",
|
|
102
|
+
"@storybook/addon-docs": "7.4.5",
|
|
103
|
+
"@storybook/addon-essentials": "7.4.5",
|
|
104
|
+
"@storybook/addon-storyshots": "7.4.5",
|
|
105
|
+
"@storybook/addon-storyshots-puppeteer": "7.4.5",
|
|
106
|
+
"@storybook/addon-viewport": "7.4.5",
|
|
107
|
+
"@storybook/builder-webpack5": "7.4.5",
|
|
108
|
+
"@storybook/theming": "7.4.5",
|
|
109
|
+
"@storybook/vue": "7.4.5",
|
|
110
|
+
"@storybook/vue-webpack5": "7.4.5",
|
|
111
|
+
"@storybook/vue3": "7.4.5",
|
|
112
|
+
"@storybook/vue3-webpack5": "7.4.5",
|
|
113
113
|
"@vue/compat": "^3.2.40",
|
|
114
114
|
"@vue/compiler-sfc": "^3.2.40",
|
|
115
115
|
"@vue/test-utils": "1.3.0",
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
"sass-loader": "^10.2.0",
|
|
161
161
|
"sass-true": "^6.1.0",
|
|
162
162
|
"start-server-and-test": "^1.10.6",
|
|
163
|
-
"storybook": "7.4.
|
|
163
|
+
"storybook": "7.4.5",
|
|
164
164
|
"storybook-dark-mode": "3.0.1",
|
|
165
165
|
"style-dictionary": "^3.8.0",
|
|
166
166
|
"stylelint": "15.10.2",
|
|
@@ -85,7 +85,7 @@ describe('Modal component', () => {
|
|
|
85
85
|
createComponent({
|
|
86
86
|
slots: { 'modal-header': slot },
|
|
87
87
|
});
|
|
88
|
-
const defaultHeader = wrapper.find('
|
|
88
|
+
const defaultHeader = wrapper.find('h2.modal-title');
|
|
89
89
|
const customHeader = wrapper.find('h4.custom-title');
|
|
90
90
|
|
|
91
91
|
expect(defaultHeader.exists()).toBe(false);
|
|
@@ -98,7 +98,7 @@ describe('Modal component', () => {
|
|
|
98
98
|
createComponent({
|
|
99
99
|
slots: { 'modal-title': slot },
|
|
100
100
|
});
|
|
101
|
-
const defaultHeader = wrapper.find('
|
|
101
|
+
const defaultHeader = wrapper.find('h2.modal-title');
|
|
102
102
|
const customTitle = defaultHeader.find('h4.custom-title');
|
|
103
103
|
|
|
104
104
|
expect(defaultHeader.exists()).toBe(true);
|
|
@@ -206,10 +206,10 @@ export default {
|
|
|
206
206
|
<template #modal-header>
|
|
207
207
|
<!-- @slot Entire modal header container contents (including the close button on the top right corner) -->
|
|
208
208
|
<slot name="modal-header">
|
|
209
|
-
<
|
|
209
|
+
<h2 class="modal-title">
|
|
210
210
|
<!-- @slot Modal title. If modal-header slot is used, this slot will not be shown. -->
|
|
211
211
|
<slot name="modal-title">{{ title }}</slot>
|
|
212
|
-
</
|
|
212
|
+
</h2>
|
|
213
213
|
</slot>
|
|
214
214
|
<!-- @slot Content of Modal header close button. If modal-header slot is used, this slot will not be shown. -->
|
|
215
215
|
<close-button ref="close-button" :label="dismissLabel" @click="close" />
|
|
@@ -249,8 +249,18 @@ describe('empty state component', () => {
|
|
|
249
249
|
describe('with custom content class', () => {
|
|
250
250
|
const findContentContainer = () => component.find('[data-testid="gl-empty-state-content"]');
|
|
251
251
|
const customContentClass = 'gl-p-0';
|
|
252
|
-
const expectedDefaultContentClasses = [
|
|
252
|
+
const expectedDefaultContentClasses = [
|
|
253
|
+
'gl-empty-state-content',
|
|
254
|
+
'gl-mx-auto',
|
|
255
|
+
'gl-my-0',
|
|
256
|
+
'gl-m-auto',
|
|
257
|
+
'gl-p-5',
|
|
258
|
+
customContentClass,
|
|
259
|
+
];
|
|
253
260
|
const expectedCompactContentClasses = [
|
|
261
|
+
'gl-empty-state-content',
|
|
262
|
+
'gl-mx-auto',
|
|
263
|
+
'gl-my-0',
|
|
254
264
|
'gl-flex-grow-1',
|
|
255
265
|
'gl-flex-basis-0',
|
|
256
266
|
'gl-px-4',
|
|
@@ -108,7 +108,7 @@ export default {
|
|
|
108
108
|
},
|
|
109
109
|
contentClasses() {
|
|
110
110
|
return [
|
|
111
|
-
this.compact ? 'gl-flex-grow-1 gl-flex-basis-0 gl-px-4' : 'gl-
|
|
111
|
+
this.compact ? 'gl-flex-grow-1 gl-flex-basis-0 gl-px-4' : 'gl-m-auto gl-p-5',
|
|
112
112
|
this.contentClass,
|
|
113
113
|
];
|
|
114
114
|
},
|
|
@@ -127,68 +127,69 @@ export default {
|
|
|
127
127
|
<div
|
|
128
128
|
:class="{ 'gl-display-none gl-sm-display-block gl-px-4': compact, 'gl-max-w-full': !compact }"
|
|
129
129
|
>
|
|
130
|
-
<
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
</div>
|
|
130
|
+
<img
|
|
131
|
+
v-if="svgPath"
|
|
132
|
+
:src="svgPath"
|
|
133
|
+
alt=""
|
|
134
|
+
role="img"
|
|
135
|
+
:class="{ 'gl-dark-invert-keep-hue': invertInDarkMode }"
|
|
136
|
+
class="gl-max-w-full"
|
|
137
|
+
:height="height"
|
|
138
|
+
/>
|
|
140
139
|
</div>
|
|
141
|
-
<div
|
|
142
|
-
|
|
140
|
+
<div
|
|
141
|
+
class="gl-empty-state-content gl-mx-auto gl-my-0"
|
|
142
|
+
:class="contentClasses"
|
|
143
|
+
data-testid="gl-empty-state-content"
|
|
144
|
+
>
|
|
145
|
+
<!--
|
|
146
|
+
@slot Use this slot to customize the empty state's title area.
|
|
147
|
+
Overrides the `title` prop.
|
|
148
|
+
-->
|
|
149
|
+
<slot ref="title" name="title">
|
|
150
|
+
<h1
|
|
151
|
+
class="gl-font-size-h-display gl-line-height-36 gl-mt-0 gl-mb-0"
|
|
152
|
+
:class="compact ? 'h5' : 'h4'"
|
|
153
|
+
>
|
|
154
|
+
{{ title }}
|
|
155
|
+
</h1>
|
|
156
|
+
</slot>
|
|
157
|
+
<p v-if="description || $scopedSlots.description" ref="description" class="gl-mt-4 gl-mb-0">
|
|
143
158
|
<!--
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
<slot
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
159
|
+
@slot Use this slot to customize the empty state's description
|
|
160
|
+
area. Overrides the `description` prop.
|
|
161
|
+
-->
|
|
162
|
+
<slot name="description">
|
|
163
|
+
{{ description }}
|
|
164
|
+
</slot>
|
|
165
|
+
</p>
|
|
166
|
+
<div
|
|
167
|
+
class="gl-display-flex gl-flex-wrap gl-mt-5"
|
|
168
|
+
:class="{ 'gl-justify-content-center': !compact }"
|
|
169
|
+
>
|
|
170
|
+
<!--
|
|
171
|
+
@slot Use this slot to customize the empty state's actions area,
|
|
172
|
+
where the buttons are. Overrides button-related props:
|
|
173
|
+
`primaryButtonLink`, `primaryButtonText`, `secondaryButtonLink`,
|
|
174
|
+
`secondaryButtonText`.
|
|
175
|
+
-->
|
|
176
|
+
<slot name="actions">
|
|
177
|
+
<gl-button
|
|
178
|
+
v-if="shouldRenderPrimaryButton"
|
|
179
|
+
variant="confirm"
|
|
180
|
+
:class="compact ? 'gl-mr-3' : 'gl-mx-2'"
|
|
181
|
+
class="gl-mb-3"
|
|
182
|
+
:href="primaryButtonLink"
|
|
183
|
+
>{{ primaryButtonText }}</gl-button
|
|
151
184
|
>
|
|
152
|
-
|
|
153
|
-
|
|
185
|
+
<gl-button
|
|
186
|
+
v-if="shouldRenderSecondaryButton"
|
|
187
|
+
class="gl-mb-3 gl-mr-3"
|
|
188
|
+
:class="{ 'gl-mx-2!': !compact }"
|
|
189
|
+
:href="secondaryButtonLink"
|
|
190
|
+
>{{ secondaryButtonText }}
|
|
191
|
+
</gl-button>
|
|
154
192
|
</slot>
|
|
155
|
-
<p v-if="description || $scopedSlots.description" ref="description" class="gl-mt-4 gl-mb-0">
|
|
156
|
-
<!--
|
|
157
|
-
@slot Use this slot to customize the empty state's description
|
|
158
|
-
area. Overrides the `description` prop.
|
|
159
|
-
-->
|
|
160
|
-
<slot name="description">
|
|
161
|
-
{{ description }}
|
|
162
|
-
</slot>
|
|
163
|
-
</p>
|
|
164
|
-
<div
|
|
165
|
-
class="gl-display-flex gl-flex-wrap gl-mt-5"
|
|
166
|
-
:class="{ 'gl-justify-content-center': !compact }"
|
|
167
|
-
>
|
|
168
|
-
<!--
|
|
169
|
-
@slot Use this slot to customize the empty state's actions area,
|
|
170
|
-
where the buttons are. Overrides button-related props:
|
|
171
|
-
`primaryButtonLink`, `primaryButtonText`, `secondaryButtonLink`,
|
|
172
|
-
`secondaryButtonText`.
|
|
173
|
-
-->
|
|
174
|
-
<slot name="actions">
|
|
175
|
-
<gl-button
|
|
176
|
-
v-if="shouldRenderPrimaryButton"
|
|
177
|
-
variant="confirm"
|
|
178
|
-
:class="compact ? 'gl-mr-3' : 'gl-mx-2'"
|
|
179
|
-
class="gl-mb-3"
|
|
180
|
-
:href="primaryButtonLink"
|
|
181
|
-
>{{ primaryButtonText }}</gl-button
|
|
182
|
-
>
|
|
183
|
-
<gl-button
|
|
184
|
-
v-if="shouldRenderSecondaryButton"
|
|
185
|
-
class="gl-mb-3 gl-mr-3"
|
|
186
|
-
:class="{ 'gl-mx-2!': !compact }"
|
|
187
|
-
:href="secondaryButtonLink"
|
|
188
|
-
>{{ secondaryButtonText }}
|
|
189
|
-
</gl-button>
|
|
190
|
-
</slot>
|
|
191
|
-
</div>
|
|
192
193
|
</div>
|
|
193
194
|
</div>
|
|
194
195
|
</section>
|
package/src/scss/components.scss
CHANGED
package/src/scss/mixins.scss
CHANGED
|
@@ -123,9 +123,14 @@
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
// Helper functions to aid maintenance of heading styles
|
|
127
126
|
|
|
128
|
-
|
|
127
|
+
/**
|
|
128
|
+
* Helper function to resolve font-size value from $gl-font-sizes and
|
|
129
|
+
* $gl-font-sizes-fixed maps.
|
|
130
|
+
*
|
|
131
|
+
* @param $size Number font-size scale
|
|
132
|
+
* @param $fixed Boolean toggle default and fixed font size scales
|
|
133
|
+
*/
|
|
129
134
|
@function get-font-size-variable($size, $fixed) {
|
|
130
135
|
@if $fixed == true {
|
|
131
136
|
@if map-has-key($gl-font-sizes-fixed, $size) {
|
|
@@ -144,17 +149,22 @@
|
|
|
144
149
|
}
|
|
145
150
|
}
|
|
146
151
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
152
|
+
/**
|
|
153
|
+
* Defines default properties for heading typography based on font-size
|
|
154
|
+
* scale value and default or fixed sizing.
|
|
155
|
+
*
|
|
156
|
+
* Note: overrides Bootstrap margin-top, other margin is determined by
|
|
157
|
+
* individual context
|
|
158
|
+
*
|
|
159
|
+
* @param $size Number font-size scale
|
|
160
|
+
* @param $fixed Boolean toggle default and fixed font size scales
|
|
161
|
+
*/
|
|
162
|
+
@mixin gl-heading-scale($size, $fixed: false) {
|
|
151
163
|
font-weight: $gl-font-weight-heading;
|
|
152
164
|
margin-top: 0; // override bootstrap reset in GitLab
|
|
153
|
-
|
|
154
|
-
// Because we can't interpolate into a variable name we have to do some stuff
|
|
155
165
|
font-size: get-font-size-variable($size, $fixed);
|
|
156
166
|
|
|
157
|
-
// Larger headings have
|
|
167
|
+
// Larger headings have reduced letter spacing
|
|
158
168
|
@if ($size <= 500) {
|
|
159
169
|
letter-spacing: $gl-letter-spacing-heading;
|
|
160
170
|
} @else {
|