@openproject/primer-view-components 0.9.1-rc.f4f455f1 → 0.10.0-rc.b9f751eb
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/app/assets/javascripts/primer_view_components.js +1 -1
- package/app/assets/javascripts/primer_view_components.js.map +1 -1
- package/app/assets/styles/primer_view_components.css +1 -1
- package/app/assets/styles/primer_view_components.css.map +1 -1
- package/app/components/primer/alpha/overlay.css +1 -1
- package/app/components/primer/alpha/overlay.css.json +3 -1
- package/app/components/primer/alpha/tool_tip.js +28 -8
- package/app/components/primer/anchored_position.js +14 -5
- package/package.json +1 -1
- package/static/constants.json +6 -1
- package/static/info_arch.json +26 -0
- package/static/previews.json +19 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
anchored-position[popover]{border-width:0;inset:auto;min-width:192px;overflow:visible;padding:0;position:absolute}.Overlay{display:flex}anchored-position[popover]:not(.\:popover-open){display:none}@supports selector(:popover-open){anchored-position[popover]:not(.\:popover-open){display:revert}}@supports selector(:open){anchored-position[popover]:not(.\:popover-open){display:revert}}
|
|
1
|
+
anchored-position[popover]{border-width:0;inset:auto;min-width:192px;overflow:visible;padding:0;position:absolute}.Overlay{display:flex}anchored-position[popover]:not(.\:popover-open){display:none}anchored-position.not-anchored::-webkit-backdrop{background-color:var(--overlay-backdrop-bgColor,var(--color-neutral-muted))}anchored-position.not-anchored::backdrop{background-color:var(--overlay-backdrop-bgColor,var(--color-neutral-muted))}@supports selector(:popover-open){anchored-position[popover]:not(.\:popover-open){display:revert}}@supports selector(:open){anchored-position[popover]:not(.\:popover-open){display:revert}}
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
"selectors": [
|
|
4
4
|
"anchored-position[popover]",
|
|
5
5
|
".Overlay",
|
|
6
|
-
"anchored-position[popover]:not(.\\:popover-open)"
|
|
6
|
+
"anchored-position[popover]:not(.\\:popover-open)",
|
|
7
|
+
"anchored-position.not-anchored::-webkit-backdrop",
|
|
8
|
+
"anchored-position.not-anchored::backdrop"
|
|
7
9
|
]
|
|
8
10
|
}
|
|
@@ -12,6 +12,26 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
|
|
|
12
12
|
var _ToolTipElement_instances, _ToolTipElement_abortController, _ToolTipElement_align, _ToolTipElement_side, _ToolTipElement_allowUpdatePosition, _ToolTipElement_update, _ToolTipElement_updateControlReference, _ToolTipElement_updateDirection, _ToolTipElement_updatePosition;
|
|
13
13
|
import '@oddbird/popover-polyfill';
|
|
14
14
|
import { getAnchoredPosition } from '@primer/behaviors';
|
|
15
|
+
const isPopoverOpen = (() => {
|
|
16
|
+
let selector;
|
|
17
|
+
function setSelector(el) {
|
|
18
|
+
try {
|
|
19
|
+
selector = ':popover-open';
|
|
20
|
+
return el.matches(selector);
|
|
21
|
+
}
|
|
22
|
+
catch (_a) {
|
|
23
|
+
try {
|
|
24
|
+
selector = ':open';
|
|
25
|
+
return el.matches(':open');
|
|
26
|
+
}
|
|
27
|
+
catch (_b) {
|
|
28
|
+
selector = '.\\:popover-open';
|
|
29
|
+
return el.matches('.\\:popover-open');
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return (el) => (selector ? el.matches(selector) : setSelector(el));
|
|
34
|
+
})();
|
|
15
35
|
const TOOLTIP_ARROW_EDGE_OFFSET = 6;
|
|
16
36
|
const TOOLTIP_SR_ONLY_CLASS = 'sr-only';
|
|
17
37
|
const TOOLTIP_OFFSET = 10;
|
|
@@ -29,7 +49,7 @@ function closeOpenTooltips(except) {
|
|
|
29
49
|
for (const tooltip of openTooltips) {
|
|
30
50
|
if (tooltip === except)
|
|
31
51
|
continue;
|
|
32
|
-
if (tooltip
|
|
52
|
+
if (isPopoverOpen(tooltip)) {
|
|
33
53
|
tooltip.hidePopover();
|
|
34
54
|
}
|
|
35
55
|
else {
|
|
@@ -207,16 +227,16 @@ class ToolTipElement extends HTMLElement {
|
|
|
207
227
|
}
|
|
208
228
|
/* @deprecated */
|
|
209
229
|
set hiddenFromView(value) {
|
|
210
|
-
if (value && this
|
|
230
|
+
if (value && isPopoverOpen(this)) {
|
|
211
231
|
this.hidePopover();
|
|
212
232
|
}
|
|
213
|
-
else if (!value && this
|
|
233
|
+
else if (!value && !isPopoverOpen(this)) {
|
|
214
234
|
this.showPopover();
|
|
215
235
|
}
|
|
216
236
|
}
|
|
217
237
|
/* @deprecated */
|
|
218
238
|
get hiddenFromView() {
|
|
219
|
-
return !this
|
|
239
|
+
return !isPopoverOpen(this);
|
|
220
240
|
}
|
|
221
241
|
connectedCallback() {
|
|
222
242
|
var _a, _b;
|
|
@@ -260,7 +280,7 @@ class ToolTipElement extends HTMLElement {
|
|
|
260
280
|
async handleEvent(event) {
|
|
261
281
|
if (!this.control)
|
|
262
282
|
return;
|
|
263
|
-
const showing = this
|
|
283
|
+
const showing = isPopoverOpen(this);
|
|
264
284
|
// Ensures that tooltip stays open when hovering between tooltip and element
|
|
265
285
|
// WCAG Success Criterion 1.4.13 Hoverable
|
|
266
286
|
const shouldShow = event.type === 'mouseenter' || event.type === 'focus';
|
|
@@ -272,10 +292,10 @@ class ToolTipElement extends HTMLElement {
|
|
|
272
292
|
const isOpeningOtherPopover = event.type === 'beforetoggle' && event.currentTarget !== this;
|
|
273
293
|
const shouldHide = isMouseLeaveFromButton || isEscapeKeydown || isMouseDownOnButton || isOpeningOtherPopover;
|
|
274
294
|
await Promise.resolve();
|
|
275
|
-
if (!showing && shouldShow && this
|
|
295
|
+
if (!showing && shouldShow && !isPopoverOpen(this)) {
|
|
276
296
|
this.showPopover();
|
|
277
297
|
}
|
|
278
|
-
else if (showing && shouldHide && this
|
|
298
|
+
else if (showing && shouldHide && isPopoverOpen(this)) {
|
|
279
299
|
this.hidePopover();
|
|
280
300
|
}
|
|
281
301
|
if (event.type === 'toggle') {
|
|
@@ -378,7 +398,7 @@ _ToolTipElement_abortController = new WeakMap(), _ToolTipElement_align = new Wea
|
|
|
378
398
|
}, _ToolTipElement_updatePosition = function _ToolTipElement_updatePosition() {
|
|
379
399
|
if (!this.control)
|
|
380
400
|
return;
|
|
381
|
-
if (!__classPrivateFieldGet(this, _ToolTipElement_allowUpdatePosition, "f") || !this
|
|
401
|
+
if (!__classPrivateFieldGet(this, _ToolTipElement_allowUpdatePosition, "f") || !isPopoverOpen(this))
|
|
382
402
|
return;
|
|
383
403
|
const position = getAnchoredPosition(this, this.control, {
|
|
384
404
|
side: __classPrivateFieldGet(this, _ToolTipElement_side, "f"),
|
|
@@ -131,11 +131,20 @@ export default class AnchoredPositionElement extends HTMLElement {
|
|
|
131
131
|
cancelAnimationFrame(__classPrivateFieldGet(this, _AnchoredPositionElement_animationFrame, "f"));
|
|
132
132
|
__classPrivateFieldSet(this, _AnchoredPositionElement_animationFrame, requestAnimationFrame(() => {
|
|
133
133
|
const anchor = this.anchorElement;
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
134
|
+
this.classList.toggle('not-anchored', !anchor);
|
|
135
|
+
if (anchor) {
|
|
136
|
+
const { left, top } = getAnchoredPosition(this, anchor, this);
|
|
137
|
+
this.style.top = `${top}px`;
|
|
138
|
+
this.style.left = `${left}px`;
|
|
139
|
+
this.style.bottom = 'auto';
|
|
140
|
+
this.style.right = 'auto';
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
this.style.top = '0';
|
|
144
|
+
this.style.left = '0';
|
|
145
|
+
this.style.bottom = '0';
|
|
146
|
+
this.style.right = '0';
|
|
147
|
+
}
|
|
139
148
|
}), "f");
|
|
140
149
|
}
|
|
141
150
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openproject/primer-view-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0-rc.b9f751eb",
|
|
4
4
|
"description": "ViewComponents of the Primer Design System for OpenProject",
|
|
5
5
|
"main": "app/assets/javascripts/primer_view_components.js",
|
|
6
6
|
"module": "app/components/primer/primer.js",
|
package/static/constants.json
CHANGED
|
@@ -1301,7 +1301,12 @@
|
|
|
1301
1301
|
"Primer::Navigation::TabComponent": {
|
|
1302
1302
|
},
|
|
1303
1303
|
"Primer::OpenProject::PageHeader": {
|
|
1304
|
-
"
|
|
1304
|
+
"DEFAULT_HEADER_VARIANT": "medium",
|
|
1305
|
+
"HEADER_VARIANT_OPTIONS": [
|
|
1306
|
+
"large",
|
|
1307
|
+
"medium"
|
|
1308
|
+
],
|
|
1309
|
+
"HEADING_TAG_FALLBACK": "h2",
|
|
1305
1310
|
"HEADING_TAG_OPTIONS": [
|
|
1306
1311
|
"h1",
|
|
1307
1312
|
"h2",
|
package/static/info_arch.json
CHANGED
|
@@ -5910,6 +5910,19 @@
|
|
|
5910
5910
|
]
|
|
5911
5911
|
}
|
|
5912
5912
|
},
|
|
5913
|
+
{
|
|
5914
|
+
"preview_path": "primer/alpha/overlay/in_an_action_menu",
|
|
5915
|
+
"name": "in_an_action_menu",
|
|
5916
|
+
"snapshot": "false",
|
|
5917
|
+
"skip_rules": {
|
|
5918
|
+
"wont_fix": [
|
|
5919
|
+
"region"
|
|
5920
|
+
],
|
|
5921
|
+
"will_fix": [
|
|
5922
|
+
"color-contrast"
|
|
5923
|
+
]
|
|
5924
|
+
}
|
|
5925
|
+
},
|
|
5913
5926
|
{
|
|
5914
5927
|
"preview_path": "primer/alpha/overlay/dialog_with_header_footer",
|
|
5915
5928
|
"name": "dialog_with_header_footer",
|
|
@@ -14449,6 +14462,19 @@
|
|
|
14449
14462
|
]
|
|
14450
14463
|
}
|
|
14451
14464
|
},
|
|
14465
|
+
{
|
|
14466
|
+
"preview_path": "primer/open_project/page_header/large_title",
|
|
14467
|
+
"name": "large_title",
|
|
14468
|
+
"snapshot": "false",
|
|
14469
|
+
"skip_rules": {
|
|
14470
|
+
"wont_fix": [
|
|
14471
|
+
"region"
|
|
14472
|
+
],
|
|
14473
|
+
"will_fix": [
|
|
14474
|
+
"color-contrast"
|
|
14475
|
+
]
|
|
14476
|
+
}
|
|
14477
|
+
},
|
|
14452
14478
|
{
|
|
14453
14479
|
"preview_path": "primer/open_project/page_header/actions",
|
|
14454
14480
|
"name": "actions",
|
package/static/previews.json
CHANGED
|
@@ -4417,6 +4417,19 @@
|
|
|
4417
4417
|
]
|
|
4418
4418
|
}
|
|
4419
4419
|
},
|
|
4420
|
+
{
|
|
4421
|
+
"preview_path": "primer/alpha/overlay/in_an_action_menu",
|
|
4422
|
+
"name": "in_an_action_menu",
|
|
4423
|
+
"snapshot": "false",
|
|
4424
|
+
"skip_rules": {
|
|
4425
|
+
"wont_fix": [
|
|
4426
|
+
"region"
|
|
4427
|
+
],
|
|
4428
|
+
"will_fix": [
|
|
4429
|
+
"color-contrast"
|
|
4430
|
+
]
|
|
4431
|
+
}
|
|
4432
|
+
},
|
|
4420
4433
|
{
|
|
4421
4434
|
"preview_path": "primer/alpha/overlay/dialog_with_header_footer",
|
|
4422
4435
|
"name": "dialog_with_header_footer",
|
|
@@ -4465,9 +4478,9 @@
|
|
|
4465
4478
|
}
|
|
4466
4479
|
},
|
|
4467
4480
|
{
|
|
4468
|
-
"preview_path": "primer/open_project/page_header/
|
|
4469
|
-
"name": "
|
|
4470
|
-
"snapshot": "
|
|
4481
|
+
"preview_path": "primer/open_project/page_header/large_title",
|
|
4482
|
+
"name": "large_title",
|
|
4483
|
+
"snapshot": "false",
|
|
4471
4484
|
"skip_rules": {
|
|
4472
4485
|
"wont_fix": [
|
|
4473
4486
|
"region"
|
|
@@ -4478,9 +4491,9 @@
|
|
|
4478
4491
|
}
|
|
4479
4492
|
},
|
|
4480
4493
|
{
|
|
4481
|
-
"preview_path": "primer/open_project/page_header/
|
|
4482
|
-
"name": "
|
|
4483
|
-
"snapshot": "
|
|
4494
|
+
"preview_path": "primer/open_project/page_header/actions",
|
|
4495
|
+
"name": "actions",
|
|
4496
|
+
"snapshot": "false",
|
|
4484
4497
|
"skip_rules": {
|
|
4485
4498
|
"wont_fix": [
|
|
4486
4499
|
"region"
|