@gitlab/ui 103.6.0 → 103.7.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 +14 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/tokens/build/js/tokens.dark.js +1 -1
- package/dist/tokens/css/tokens.dark.css +1 -1
- package/dist/tokens/js/tokens.dark.js +1 -1
- package/dist/tokens/json/tokens.dark.json +2 -2
- package/dist/tokens/json/tokens.json +1 -1
- package/dist/tokens/scss/_tokens.dark.scss +1 -1
- package/dist/utils/stories_utils.js +16 -1
- package/dist/vendor/bootstrap-vue/src/components/collapse/collapse.js +0 -33
- package/package.json +2 -1
- package/src/tokens/border.tokens.json +1 -1
- package/src/tokens/build/css/tokens.dark.css +1 -1
- package/src/tokens/build/js/tokens.dark.js +1 -1
- package/src/tokens/build/json/tokens.dark.json +2 -2
- package/src/tokens/build/json/tokens.json +1 -1
- package/src/tokens/build/scss/_tokens.dark.scss +1 -1
- package/src/utils/stories_utils.js +9 -0
- package/src/vendor/bootstrap-vue/src/components/collapse/collapse.js +1 -32
|
@@ -85,7 +85,7 @@ const GL_BACKGROUND_COLOR_OVERLAP = '#28272d';
|
|
|
85
85
|
const GL_BACKGROUND_COLOR_SECTION = '#3a383f';
|
|
86
86
|
const GL_BACKGROUND_COLOR_OVERLAY = 'rgba(0,0,0,0.64)';
|
|
87
87
|
const GL_BORDER_COLOR_DEFAULT = '#4c4b51';
|
|
88
|
-
const GL_BORDER_COLOR_SUBTLE = '#
|
|
88
|
+
const GL_BORDER_COLOR_SUBTLE = '#3a383f';
|
|
89
89
|
const GL_BORDER_COLOR_STRONG = '#626168';
|
|
90
90
|
const GL_BORDER_COLOR_SECTION = '#18171d';
|
|
91
91
|
const GL_BORDER_COLOR_TRANSPARENT = 'transparent';
|
|
@@ -460,7 +460,7 @@
|
|
|
460
460
|
--gl-background-color-section: var(--gl-color-neutral-800); /* Used for containers, like a card header, that are visually distinct from the default page background only when necessary to maintain affordance and hierarchy in different modes. */
|
|
461
461
|
--gl-background-color-overlay: rgba(0,0,0,0.64); /* Used for an overlay that covers other content. */
|
|
462
462
|
--gl-border-color-default: var(--gl-color-neutral-700); /* Used for the default border color. */
|
|
463
|
-
--gl-border-color-subtle: var(--gl-color-neutral-
|
|
463
|
+
--gl-border-color-subtle: var(--gl-color-neutral-800); /* Used for a subtle border in combination with the default background. */
|
|
464
464
|
--gl-border-color-strong: var(--gl-color-neutral-600); /* Used for a distinct border that emphasizes an edge or boundaries. */
|
|
465
465
|
--gl-border-color-transparent: var(--gl-color-alpha-0); /* Used when a border needs to be present, but not visibly perceived. */
|
|
466
466
|
--gl-alert-neutral-border-top-color: var(--gl-color-neutral-400); /* Used for the border center color of a neutral alert. */
|
|
@@ -85,7 +85,7 @@ export const GL_BACKGROUND_COLOR_OVERLAP = '#28272d';
|
|
|
85
85
|
export const GL_BACKGROUND_COLOR_SECTION = '#3a383f';
|
|
86
86
|
export const GL_BACKGROUND_COLOR_OVERLAY = 'rgba(0,0,0,0.64)';
|
|
87
87
|
export const GL_BORDER_COLOR_DEFAULT = '#4c4b51';
|
|
88
|
-
export const GL_BORDER_COLOR_SUBTLE = '#
|
|
88
|
+
export const GL_BORDER_COLOR_SUBTLE = '#3a383f';
|
|
89
89
|
export const GL_BORDER_COLOR_STRONG = '#626168';
|
|
90
90
|
export const GL_BORDER_COLOR_SECTION = '#18171d';
|
|
91
91
|
export const GL_BORDER_COLOR_TRANSPARENT = 'transparent';
|
|
@@ -1976,7 +1976,7 @@
|
|
|
1976
1976
|
]
|
|
1977
1977
|
},
|
|
1978
1978
|
"subtle": {
|
|
1979
|
-
"$value": "#
|
|
1979
|
+
"$value": "#3a383f",
|
|
1980
1980
|
"$type": "color",
|
|
1981
1981
|
"$description": "Used for a subtle border in combination with the default background.",
|
|
1982
1982
|
"filePath": "src/tokens/border.tokens.json",
|
|
@@ -1984,7 +1984,7 @@
|
|
|
1984
1984
|
"original": {
|
|
1985
1985
|
"$value": {
|
|
1986
1986
|
"default": "{color.neutral.50}",
|
|
1987
|
-
"dark": "{color.neutral.
|
|
1987
|
+
"dark": "{color.neutral.800}"
|
|
1988
1988
|
},
|
|
1989
1989
|
"$type": "color",
|
|
1990
1990
|
"$description": "Used for a subtle border in combination with the default background."
|
|
@@ -1984,7 +1984,7 @@
|
|
|
1984
1984
|
"original": {
|
|
1985
1985
|
"$value": {
|
|
1986
1986
|
"default": "{color.neutral.50}",
|
|
1987
|
-
"dark": "{color.neutral.
|
|
1987
|
+
"dark": "{color.neutral.800}"
|
|
1988
1988
|
},
|
|
1989
1989
|
"$type": "color",
|
|
1990
1990
|
"$description": "Used for a subtle border in combination with the default background."
|
|
@@ -458,7 +458,7 @@ $gl-background-color-overlap: $gl-color-neutral-900; // Used for components, lik
|
|
|
458
458
|
$gl-background-color-section: $gl-color-neutral-800; // Used for containers, like a card header, that are visually distinct from the default page background only when necessary to maintain affordance and hierarchy in different modes.
|
|
459
459
|
$gl-background-color-overlay: rgba(0,0,0,0.64); // Used for an overlay that covers other content.
|
|
460
460
|
$gl-border-color-default: $gl-color-neutral-700; // Used for the default border color.
|
|
461
|
-
$gl-border-color-subtle: $gl-color-neutral-
|
|
461
|
+
$gl-border-color-subtle: $gl-color-neutral-800; // Used for a subtle border in combination with the default background.
|
|
462
462
|
$gl-border-color-strong: $gl-color-neutral-600; // Used for a distinct border that emphasizes an edge or boundaries.
|
|
463
463
|
$gl-border-color-transparent: $gl-color-alpha-0; // Used when a border needs to be present, but not visibly perceived.
|
|
464
464
|
$gl-alert-neutral-border-top-color: $gl-color-neutral-400; // Used for the border center color of a neutral alert.
|
|
@@ -9,5 +9,20 @@ const disableControls = function () {
|
|
|
9
9
|
}
|
|
10
10
|
}]));
|
|
11
11
|
};
|
|
12
|
+
const getA11yParameters = function () {
|
|
13
|
+
let {
|
|
14
|
+
skipRules = [],
|
|
15
|
+
temporarySkipRules = []
|
|
16
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
17
|
+
const skippedRules = skipRules.concat(temporarySkipRules).map(id => ({
|
|
18
|
+
id,
|
|
19
|
+
enabled: false
|
|
20
|
+
}));
|
|
21
|
+
return {
|
|
22
|
+
config: {
|
|
23
|
+
rules: skippedRules
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
};
|
|
12
27
|
|
|
13
|
-
export { disableControls };
|
|
28
|
+
export { disableControls, getA11yParameters };
|
|
@@ -3,7 +3,6 @@ import { NAME_COLLAPSE } from '../../constants/components';
|
|
|
3
3
|
import { EVENT_NAME_SHOW, EVENT_NAME_SHOWN, EVENT_NAME_HIDE, EVENT_NAME_HIDDEN } from '../../constants/events';
|
|
4
4
|
import { PROP_TYPE_BOOLEAN, PROP_TYPE_STRING } from '../../constants/props';
|
|
5
5
|
import { SLOT_NAME_DEFAULT } from '../../constants/slots';
|
|
6
|
-
import { hasClass, removeClass, getCS, addClass, matches, closest } from '../../utils/dom';
|
|
7
6
|
import { getRootActionEventName, getRootEventName } from '../../utils/events';
|
|
8
7
|
import { makeModelMixin } from '../../utils/model';
|
|
9
8
|
import { sortKeys } from '../../utils/object';
|
|
@@ -14,7 +13,6 @@ import { normalizeSlotMixin } from '../../mixins/normalize-slot';
|
|
|
14
13
|
import { BVCollapse } from './helpers/bv-collapse';
|
|
15
14
|
|
|
16
15
|
// --- Constants ---
|
|
17
|
-
const CLASS_NAME_SHOW = 'show';
|
|
18
16
|
const ROOT_ACTION_EVENT_NAME_TOGGLE = getRootActionEventName(NAME_COLLAPSE, 'toggle');
|
|
19
17
|
const ROOT_ACTION_EVENT_NAME_REQUEST_STATE = getRootActionEventName(NAME_COLLAPSE, 'request-state');
|
|
20
18
|
const ROOT_EVENT_NAME_ACCORDION = getRootEventName(NAME_COLLAPSE, 'accordion');
|
|
@@ -157,34 +155,6 @@ const BCollapse = /*#__PURE__*/extend({
|
|
|
157
155
|
// It is emitted regardless if the visible state changes
|
|
158
156
|
this.emitOnRoot(ROOT_EVENT_NAME_SYNC_STATE, this.safeId(), this.show);
|
|
159
157
|
},
|
|
160
|
-
checkDisplayBlock() {
|
|
161
|
-
// Check to see if the collapse has `display: block !important` set
|
|
162
|
-
// We can't set `display: none` directly on `this.$el`, as it would
|
|
163
|
-
// trigger a new transition to start (or cancel a current one)
|
|
164
|
-
const {
|
|
165
|
-
$el
|
|
166
|
-
} = this;
|
|
167
|
-
const restore = hasClass($el, CLASS_NAME_SHOW);
|
|
168
|
-
removeClass($el, CLASS_NAME_SHOW);
|
|
169
|
-
const isBlock = getCS($el).display === 'block';
|
|
170
|
-
if (restore) {
|
|
171
|
-
addClass($el, CLASS_NAME_SHOW);
|
|
172
|
-
}
|
|
173
|
-
return isBlock;
|
|
174
|
-
},
|
|
175
|
-
clickHandler(event) {
|
|
176
|
-
const {
|
|
177
|
-
target: el
|
|
178
|
-
} = event;
|
|
179
|
-
/* istanbul ignore next: can't test `getComputedStyle()` in JSDOM */
|
|
180
|
-
if (!el || getCS(this.$el).display !== 'block') {
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
|
-
// Only close the collapse if it is not forced to be `display: block !important`
|
|
184
|
-
if ((matches(el, '.nav-link,.dropdown-item') || closest('.nav-link,.dropdown-item', el)) && !this.checkDisplayBlock()) {
|
|
185
|
-
this.show = false;
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
158
|
handleToggleEvent(id) {
|
|
189
159
|
if (id === this.safeId()) {
|
|
190
160
|
this.toggle();
|
|
@@ -218,9 +188,6 @@ const BCollapse = /*#__PURE__*/extend({
|
|
|
218
188
|
}],
|
|
219
189
|
attrs: {
|
|
220
190
|
id: this.safeId()
|
|
221
|
-
},
|
|
222
|
-
on: {
|
|
223
|
-
click: this.clickHandler
|
|
224
191
|
}
|
|
225
192
|
}, this.normalizeSlot(SLOT_NAME_DEFAULT, this.slotScope));
|
|
226
193
|
return h(BVCollapse, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "103.
|
|
3
|
+
"version": "103.7.0",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -141,6 +141,7 @@
|
|
|
141
141
|
"acorn-walk": "^8.3.2",
|
|
142
142
|
"autoprefixer": "^9.7.6",
|
|
143
143
|
"axe-core": "^4.2.3",
|
|
144
|
+
"axe-playwright": "^2.0.3",
|
|
144
145
|
"babel-jest": "29.0.1",
|
|
145
146
|
"babel-loader": "^8.0.5",
|
|
146
147
|
"cypress": "13.16.0",
|
|
@@ -460,7 +460,7 @@
|
|
|
460
460
|
--gl-background-color-section: var(--gl-color-neutral-800); /* Used for containers, like a card header, that are visually distinct from the default page background only when necessary to maintain affordance and hierarchy in different modes. */
|
|
461
461
|
--gl-background-color-overlay: rgba(0,0,0,0.64); /* Used for an overlay that covers other content. */
|
|
462
462
|
--gl-border-color-default: var(--gl-color-neutral-700); /* Used for the default border color. */
|
|
463
|
-
--gl-border-color-subtle: var(--gl-color-neutral-
|
|
463
|
+
--gl-border-color-subtle: var(--gl-color-neutral-800); /* Used for a subtle border in combination with the default background. */
|
|
464
464
|
--gl-border-color-strong: var(--gl-color-neutral-600); /* Used for a distinct border that emphasizes an edge or boundaries. */
|
|
465
465
|
--gl-border-color-transparent: var(--gl-color-alpha-0); /* Used when a border needs to be present, but not visibly perceived. */
|
|
466
466
|
--gl-alert-neutral-border-top-color: var(--gl-color-neutral-400); /* Used for the border center color of a neutral alert. */
|
|
@@ -85,7 +85,7 @@ export const GL_BACKGROUND_COLOR_OVERLAP = '#28272d';
|
|
|
85
85
|
export const GL_BACKGROUND_COLOR_SECTION = '#3a383f';
|
|
86
86
|
export const GL_BACKGROUND_COLOR_OVERLAY = 'rgba(0,0,0,0.64)';
|
|
87
87
|
export const GL_BORDER_COLOR_DEFAULT = '#4c4b51';
|
|
88
|
-
export const GL_BORDER_COLOR_SUBTLE = '#
|
|
88
|
+
export const GL_BORDER_COLOR_SUBTLE = '#3a383f';
|
|
89
89
|
export const GL_BORDER_COLOR_STRONG = '#626168';
|
|
90
90
|
export const GL_BORDER_COLOR_SECTION = '#18171d';
|
|
91
91
|
export const GL_BORDER_COLOR_TRANSPARENT = 'transparent';
|
|
@@ -1976,7 +1976,7 @@
|
|
|
1976
1976
|
]
|
|
1977
1977
|
},
|
|
1978
1978
|
"subtle": {
|
|
1979
|
-
"$value": "#
|
|
1979
|
+
"$value": "#3a383f",
|
|
1980
1980
|
"$type": "color",
|
|
1981
1981
|
"$description": "Used for a subtle border in combination with the default background.",
|
|
1982
1982
|
"filePath": "src/tokens/border.tokens.json",
|
|
@@ -1984,7 +1984,7 @@
|
|
|
1984
1984
|
"original": {
|
|
1985
1985
|
"$value": {
|
|
1986
1986
|
"default": "{color.neutral.50}",
|
|
1987
|
-
"dark": "{color.neutral.
|
|
1987
|
+
"dark": "{color.neutral.800}"
|
|
1988
1988
|
},
|
|
1989
1989
|
"$type": "color",
|
|
1990
1990
|
"$description": "Used for a subtle border in combination with the default background."
|
|
@@ -1984,7 +1984,7 @@
|
|
|
1984
1984
|
"original": {
|
|
1985
1985
|
"$value": {
|
|
1986
1986
|
"default": "{color.neutral.50}",
|
|
1987
|
-
"dark": "{color.neutral.
|
|
1987
|
+
"dark": "{color.neutral.800}"
|
|
1988
1988
|
},
|
|
1989
1989
|
"$type": "color",
|
|
1990
1990
|
"$description": "Used for a subtle border in combination with the default background."
|
|
@@ -458,7 +458,7 @@ $gl-background-color-overlap: $gl-color-neutral-900; // Used for components, lik
|
|
|
458
458
|
$gl-background-color-section: $gl-color-neutral-800; // Used for containers, like a card header, that are visually distinct from the default page background only when necessary to maintain affordance and hierarchy in different modes.
|
|
459
459
|
$gl-background-color-overlay: rgba(0,0,0,0.64); // Used for an overlay that covers other content.
|
|
460
460
|
$gl-border-color-default: $gl-color-neutral-700; // Used for the default border color.
|
|
461
|
-
$gl-border-color-subtle: $gl-color-neutral-
|
|
461
|
+
$gl-border-color-subtle: $gl-color-neutral-800; // Used for a subtle border in combination with the default background.
|
|
462
462
|
$gl-border-color-strong: $gl-color-neutral-600; // Used for a distinct border that emphasizes an edge or boundaries.
|
|
463
463
|
$gl-border-color-transparent: $gl-color-alpha-0; // Used when a border needs to be present, but not visibly perceived.
|
|
464
464
|
$gl-alert-neutral-border-top-color: $gl-color-neutral-400; // Used for the border center color of a neutral alert.
|
|
@@ -3,3 +3,12 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const disableControls = (controls = []) =>
|
|
5
5
|
Object.fromEntries(controls.map((control) => [control, { control: { disable: true } }]));
|
|
6
|
+
|
|
7
|
+
export const getA11yParameters = ({ skipRules = [], temporarySkipRules = [] } = {}) => {
|
|
8
|
+
const skippedRules = skipRules.concat(temporarySkipRules).map((id) => ({ id, enabled: false }));
|
|
9
|
+
return {
|
|
10
|
+
config: {
|
|
11
|
+
rules: skippedRules,
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
} from '../../constants/events'
|
|
9
9
|
import { PROP_TYPE_BOOLEAN, PROP_TYPE_STRING } from '../../constants/props'
|
|
10
10
|
import { SLOT_NAME_DEFAULT } from '../../constants/slots'
|
|
11
|
-
import { addClass, hasClass, removeClass, closest, matches, getCS } from '../../utils/dom'
|
|
12
11
|
import { getRootActionEventName, getRootEventName } from '../../utils/events'
|
|
13
12
|
import { makeModelMixin } from '../../utils/model'
|
|
14
13
|
import { sortKeys } from '../../utils/object'
|
|
@@ -19,8 +18,6 @@ import { normalizeSlotMixin } from '../../mixins/normalize-slot'
|
|
|
19
18
|
import { BVCollapse } from './helpers/bv-collapse'
|
|
20
19
|
|
|
21
20
|
// --- Constants ---
|
|
22
|
-
const CLASS_NAME_SHOW = 'show'
|
|
23
|
-
|
|
24
21
|
const ROOT_ACTION_EVENT_NAME_TOGGLE = getRootActionEventName(NAME_COLLAPSE, 'toggle')
|
|
25
22
|
const ROOT_ACTION_EVENT_NAME_REQUEST_STATE = getRootActionEventName(NAME_COLLAPSE, 'request-state')
|
|
26
23
|
|
|
@@ -162,33 +159,6 @@ export const BCollapse = /*#__PURE__*/ extend({
|
|
|
162
159
|
// It is emitted regardless if the visible state changes
|
|
163
160
|
this.emitOnRoot(ROOT_EVENT_NAME_SYNC_STATE, this.safeId(), this.show)
|
|
164
161
|
},
|
|
165
|
-
checkDisplayBlock() {
|
|
166
|
-
// Check to see if the collapse has `display: block !important` set
|
|
167
|
-
// We can't set `display: none` directly on `this.$el`, as it would
|
|
168
|
-
// trigger a new transition to start (or cancel a current one)
|
|
169
|
-
const { $el } = this
|
|
170
|
-
const restore = hasClass($el, CLASS_NAME_SHOW)
|
|
171
|
-
removeClass($el, CLASS_NAME_SHOW)
|
|
172
|
-
const isBlock = getCS($el).display === 'block'
|
|
173
|
-
if (restore) {
|
|
174
|
-
addClass($el, CLASS_NAME_SHOW)
|
|
175
|
-
}
|
|
176
|
-
return isBlock
|
|
177
|
-
},
|
|
178
|
-
clickHandler(event) {
|
|
179
|
-
const { target: el } = event
|
|
180
|
-
/* istanbul ignore next: can't test `getComputedStyle()` in JSDOM */
|
|
181
|
-
if (!el || getCS(this.$el).display !== 'block') {
|
|
182
|
-
return
|
|
183
|
-
}
|
|
184
|
-
// Only close the collapse if it is not forced to be `display: block !important`
|
|
185
|
-
if (
|
|
186
|
-
(matches(el, '.nav-link,.dropdown-item') || closest('.nav-link,.dropdown-item', el)) &&
|
|
187
|
-
!this.checkDisplayBlock()
|
|
188
|
-
) {
|
|
189
|
-
this.show = false
|
|
190
|
-
}
|
|
191
|
-
},
|
|
192
162
|
handleToggleEvent(id) {
|
|
193
163
|
if (id === this.safeId()) {
|
|
194
164
|
this.toggle()
|
|
@@ -215,8 +185,7 @@ export const BCollapse = /*#__PURE__*/ extend({
|
|
|
215
185
|
{
|
|
216
186
|
class: this.classObject,
|
|
217
187
|
directives: [{ name: 'show', value: this.show }],
|
|
218
|
-
attrs: { id: this.safeId() }
|
|
219
|
-
on: { click: this.clickHandler }
|
|
188
|
+
attrs: { id: this.safeId() }
|
|
220
189
|
},
|
|
221
190
|
this.normalizeSlot(SLOT_NAME_DEFAULT, this.slotScope)
|
|
222
191
|
)
|