@primer/view-components 0.15.1 → 0.16.0-rc.354ad89c
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/app/components/primer/alpha/action_bar_element.d.ts +3 -2
- package/app/assets/javascripts/app/components/primer/dialog_helper.d.ts +15 -0
- package/app/assets/javascripts/app/components/primer/primer.d.ts +1 -1
- 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/action_bar.css +1 -1
- package/app/components/primer/alpha/action_bar_element.d.ts +3 -2
- package/app/components/primer/alpha/action_bar_element.js +76 -99
- package/app/components/primer/alpha/action_menu/action_menu_element.js +8 -0
- package/app/components/primer/alpha/dialog.css +1 -1
- package/app/components/primer/alpha/dialog.css.json +2 -0
- package/app/components/primer/alpha/overlay.css +1 -1
- package/app/components/primer/alpha/overlay.css.json +3 -1
- package/app/components/primer/dialog_helper.d.ts +15 -0
- package/app/components/primer/dialog_helper.js +77 -0
- package/app/components/primer/primer.d.ts +1 -1
- package/app/components/primer/primer.js +1 -1
- package/package.json +2 -2
- package/app/assets/javascripts/app/components/primer/alpha/modal_dialog.d.ts +0 -18
- package/app/components/primer/alpha/modal_dialog.d.ts +0 -18
- package/app/components/primer/alpha/modal_dialog.js +0 -186
@@ -1 +1 @@
|
|
1
|
-
.ActionBar{display:flex!important;flex-grow:1;flex-shrink:1;justify-content:flex-end;min-width:calc(var(--control-medium-size,2rem)*3);overflow:hidden;position:relative}.ActionBar
|
1
|
+
.ActionBar{align-items:center;box-sizing:initial;display:flex!important;flex-grow:1;flex-shrink:1;justify-content:flex-end;min-width:calc(var(--control-medium-size,2rem)*3);overflow:hidden;position:relative}.ActionBar-item-container{box-sizing:initial;height:var(--control-medium-size,2rem);overflow:hidden}.ActionBar-item{float:left;position:relative}.ActionBar-more-menu{float:left}.ActionBar--small{min-width:calc(var(--control-small-size,1.75rem)*3)}.ActionBar--large{min-width:calc(var(--control-large-size,2.5rem)*3)}.ActionBar-divider{border-left:var(--borderWidth-thin,max(1px,.0625rem)) solid var(--borderColor-muted,var(--color-border-muted));bottom:50%;float:left;height:calc(var(--control-medium-size,2rem)/2);margin:0 var(--controlStack-medium-gap-condensed,.5rem);top:50%;transform:translateY(-50%)}.ActionBar--small .ActionBar-divider{margin:0 var(--controlStack-small-gap-condensed,.5rem)}.ActionBar--large .ActionBar-divider{margin:0 var(--controlStack-large-gap-condensed,.5rem)}
|
@@ -1,12 +1,13 @@
|
|
1
|
+
import { ActionMenuElement } from './action_menu/action_menu_element';
|
1
2
|
declare class ActionBarElement extends HTMLElement {
|
2
3
|
#private;
|
3
4
|
items: HTMLElement[];
|
4
5
|
itemContainer: HTMLElement;
|
5
|
-
moreMenu:
|
6
|
+
moreMenu: ActionMenuElement;
|
6
7
|
connectedCallback(): void;
|
7
8
|
disconnectedCallback(): void;
|
8
9
|
menuItemClick(event: Event): void;
|
9
|
-
update(
|
10
|
+
update(): void;
|
10
11
|
}
|
11
12
|
declare global {
|
12
13
|
interface Window {
|
@@ -4,18 +4,18 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
6
|
};
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
11
|
+
};
|
7
12
|
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
8
13
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
9
14
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
10
15
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
11
16
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
12
17
|
};
|
13
|
-
var
|
14
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
15
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
16
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
17
|
-
};
|
18
|
-
var _ActionBarElement_instances, _ActionBarElement_initialBarWidth, _ActionBarElement_previousBarWidth, _ActionBarElement_focusZoneAbortController, _ActionBarElement_isVisible, _ActionBarElement_itemGap, _ActionBarElement_availableSpace, _ActionBarElement_menuSpace, _ActionBarElement_shrink, _ActionBarElement_grow, _ActionBarElement_showItem, _ActionBarElement_hideItem, _ActionBarElement_menuItems_get;
|
18
|
+
var _ActionBarElement_instances, _ActionBarElement_focusZoneAbortController, _ActionBarElement_firstItem_get, _ActionBarElement_showItem, _ActionBarElement_hideItem, _ActionBarElement_menuItems_get, _ActionBarElement_eachItem;
|
19
19
|
import { controller, targets, target } from '@github/catalyst';
|
20
20
|
import { focusZone, FocusKeys } from '@primer/behaviors';
|
21
21
|
const instersectionObserver = new IntersectionObserver(entries => {
|
@@ -30,35 +30,37 @@ const resizeObserver = new ResizeObserver(entries => {
|
|
30
30
|
for (const entry of entries) {
|
31
31
|
const action = entry.target;
|
32
32
|
if (action instanceof ActionBarElement) {
|
33
|
-
action.update(
|
33
|
+
action.update();
|
34
34
|
}
|
35
35
|
}
|
36
36
|
});
|
37
|
+
// These are definitely used, but eslint is dumb apparently
|
38
|
+
// eslint-disable-next-line no-unused-vars
|
39
|
+
var ItemType;
|
40
|
+
(function (ItemType) {
|
41
|
+
// eslint-disable-next-line no-unused-vars
|
42
|
+
ItemType[ItemType["Item"] = 0] = "Item";
|
43
|
+
// eslint-disable-next-line no-unused-vars
|
44
|
+
ItemType[ItemType["Divider"] = 1] = "Divider";
|
45
|
+
})(ItemType || (ItemType = {}));
|
37
46
|
let ActionBarElement = class ActionBarElement extends HTMLElement {
|
38
47
|
constructor() {
|
39
48
|
super(...arguments);
|
40
49
|
_ActionBarElement_instances.add(this);
|
41
|
-
_ActionBarElement_initialBarWidth.set(this, void 0);
|
42
|
-
_ActionBarElement_previousBarWidth.set(this, void 0);
|
43
50
|
_ActionBarElement_focusZoneAbortController.set(this, null);
|
44
51
|
}
|
45
52
|
connectedCallback() {
|
46
|
-
var _a, _b
|
47
|
-
__classPrivateFieldSet(this, _ActionBarElement_previousBarWidth, (_a = this.offsetWidth) !== null && _a !== void 0 ? _a : Infinity, "f");
|
48
|
-
__classPrivateFieldSet(this, _ActionBarElement_initialBarWidth, (_b = this.itemContainer.offsetWidth) !== null && _b !== void 0 ? _b : Infinity, "f");
|
53
|
+
var _a, _b;
|
49
54
|
// Calculate the width of all the items before hiding anything
|
50
55
|
for (const item of this.items) {
|
51
56
|
const width = item.getBoundingClientRect().width;
|
52
|
-
const marginLeft = parseInt((
|
53
|
-
const marginRight = parseInt((
|
57
|
+
const marginLeft = parseInt((_a = window.getComputedStyle(item)) === null || _a === void 0 ? void 0 : _a.marginLeft, 10);
|
58
|
+
const marginRight = parseInt((_b = window.getComputedStyle(item)) === null || _b === void 0 ? void 0 : _b.marginRight, 10);
|
54
59
|
item.setAttribute('data-offset-width', `${width + marginLeft + marginRight}`);
|
55
60
|
}
|
56
61
|
resizeObserver.observe(this);
|
57
62
|
instersectionObserver.observe(this);
|
58
|
-
|
59
|
-
this.style.overflow = 'visible';
|
60
|
-
this.update();
|
61
|
-
}, 20); // Wait for the items to be rendered, making this really short to avoid a flash of unstyled content
|
63
|
+
requestAnimationFrame(() => this.update());
|
62
64
|
}
|
63
65
|
disconnectedCallback() {
|
64
66
|
resizeObserver.unobserve(this);
|
@@ -72,21 +74,37 @@ let ActionBarElement = class ActionBarElement extends HTMLElement {
|
|
72
74
|
(_a = document.getElementById(id)) === null || _a === void 0 ? void 0 : _a.click();
|
73
75
|
}
|
74
76
|
}
|
75
|
-
update(
|
76
|
-
|
77
|
-
if (
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
77
|
+
update() {
|
78
|
+
const firstItem = __classPrivateFieldGet(this, _ActionBarElement_instances, "a", _ActionBarElement_firstItem_get);
|
79
|
+
if (!firstItem)
|
80
|
+
return;
|
81
|
+
const firstItemTop = firstItem.getBoundingClientRect().top;
|
82
|
+
let previousItemType = null;
|
83
|
+
__classPrivateFieldGet(this, _ActionBarElement_instances, "m", _ActionBarElement_eachItem).call(this, (item, index, type) => {
|
84
|
+
const itemTop = item.getBoundingClientRect().top;
|
85
|
+
if (type === ItemType.Item) {
|
86
|
+
if (itemTop > firstItemTop) {
|
87
|
+
__classPrivateFieldGet(this, _ActionBarElement_instances, "m", _ActionBarElement_hideItem).call(this, index);
|
88
|
+
if (this.moreMenu.hidden) {
|
89
|
+
this.moreMenu.hidden = false;
|
90
|
+
}
|
91
|
+
if (previousItemType === ItemType.Divider) {
|
92
|
+
__classPrivateFieldGet(this, _ActionBarElement_instances, "m", _ActionBarElement_hideItem).call(this, index - 1);
|
93
|
+
}
|
94
|
+
}
|
95
|
+
else {
|
96
|
+
__classPrivateFieldGet(this, _ActionBarElement_instances, "m", _ActionBarElement_showItem).call(this, index);
|
97
|
+
if (index === this.items.length - 1) {
|
98
|
+
this.moreMenu.hidden = true;
|
99
|
+
}
|
100
|
+
if (previousItemType === ItemType.Divider) {
|
101
|
+
__classPrivateFieldGet(this, _ActionBarElement_instances, "m", _ActionBarElement_showItem).call(this, index - 1);
|
102
|
+
}
|
103
|
+
}
|
104
|
+
}
|
105
|
+
previousItemType = type;
|
106
|
+
return true;
|
107
|
+
});
|
90
108
|
if (__classPrivateFieldGet(this, _ActionBarElement_focusZoneAbortController, "f")) {
|
91
109
|
__classPrivateFieldGet(this, _ActionBarElement_focusZoneAbortController, "f").abort();
|
92
110
|
}
|
@@ -94,88 +112,47 @@ let ActionBarElement = class ActionBarElement extends HTMLElement {
|
|
94
112
|
bindKeys: FocusKeys.ArrowHorizontal | FocusKeys.HomeAndEnd,
|
95
113
|
focusOutBehavior: 'wrap',
|
96
114
|
focusableElementFilter: element => {
|
97
|
-
|
98
|
-
|
115
|
+
const idx = this.items.indexOf(element.parentElement);
|
116
|
+
const elementIsVisibleItem = idx > -1 && this.items[idx].style.visibility === 'visible';
|
117
|
+
const elementIsVisibleActionMenuInvoker = element === this.moreMenu.invokerElement && !this.moreMenu.hidden;
|
118
|
+
return elementIsVisibleItem || elementIsVisibleActionMenuInvoker;
|
119
|
+
},
|
99
120
|
}), "f");
|
100
121
|
}
|
101
122
|
};
|
102
|
-
_ActionBarElement_initialBarWidth = new WeakMap();
|
103
|
-
_ActionBarElement_previousBarWidth = new WeakMap();
|
104
123
|
_ActionBarElement_focusZoneAbortController = new WeakMap();
|
105
124
|
_ActionBarElement_instances = new WeakSet();
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
return Boolean(element.offsetParent || element.offsetWidth || element.offsetHeight);
|
113
|
-
};
|
114
|
-
_ActionBarElement_itemGap = function _ActionBarElement_itemGap() {
|
115
|
-
var _a;
|
116
|
-
return parseInt((_a = window.getComputedStyle(this.itemContainer)) === null || _a === void 0 ? void 0 : _a.columnGap, 10) || 0;
|
117
|
-
};
|
118
|
-
_ActionBarElement_availableSpace = function _ActionBarElement_availableSpace() {
|
119
|
-
// Get the offset of the item container from the container edge
|
120
|
-
return this.offsetWidth - this.itemContainer.offsetWidth;
|
121
|
-
};
|
122
|
-
_ActionBarElement_menuSpace = function _ActionBarElement_menuSpace() {
|
123
|
-
if (this.moreMenu.hidden) {
|
124
|
-
return 0;
|
125
|
-
}
|
126
|
-
return this.moreMenu.offsetWidth + __classPrivateFieldGet(this, _ActionBarElement_instances, "m", _ActionBarElement_itemGap).call(this);
|
127
|
-
};
|
128
|
-
_ActionBarElement_shrink = function _ActionBarElement_shrink() {
|
129
|
-
if (this.items[0].hidden) {
|
130
|
-
return;
|
131
|
-
}
|
132
|
-
let index = this.items.length - 1;
|
133
|
-
for (const item of this.items.reverse()) {
|
134
|
-
if (!item.hidden && __classPrivateFieldGet(this, _ActionBarElement_instances, "m", _ActionBarElement_availableSpace).call(this) < __classPrivateFieldGet(this, _ActionBarElement_instances, "m", _ActionBarElement_menuSpace).call(this)) {
|
135
|
-
__classPrivateFieldGet(this, _ActionBarElement_instances, "m", _ActionBarElement_hideItem).call(this, index);
|
125
|
+
_ActionBarElement_firstItem_get = function _ActionBarElement_firstItem_get() {
|
126
|
+
let foundItem = null;
|
127
|
+
__classPrivateFieldGet(this, _ActionBarElement_instances, "m", _ActionBarElement_eachItem).call(this, (item, _index, type) => {
|
128
|
+
if (type === ItemType.Item) {
|
129
|
+
foundItem = item;
|
130
|
+
return false;
|
136
131
|
}
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
index--;
|
141
|
-
}
|
142
|
-
};
|
143
|
-
_ActionBarElement_grow = function _ActionBarElement_grow() {
|
144
|
-
// If last item is visible, there is no need to grow
|
145
|
-
if (!this.items[this.items.length - 1].hidden) {
|
146
|
-
return;
|
147
|
-
}
|
148
|
-
let index = 0;
|
149
|
-
for (const item of this.items) {
|
150
|
-
if (item.hidden) {
|
151
|
-
const offsetWidth = Number(item.getAttribute('data-offset-width'));
|
152
|
-
if (__classPrivateFieldGet(this, _ActionBarElement_instances, "m", _ActionBarElement_availableSpace).call(this) >= __classPrivateFieldGet(this, _ActionBarElement_instances, "m", _ActionBarElement_menuSpace).call(this) + offsetWidth || index === this.items.length - 1) {
|
153
|
-
__classPrivateFieldGet(this, _ActionBarElement_instances, "m", _ActionBarElement_showItem).call(this, index);
|
154
|
-
}
|
155
|
-
else {
|
156
|
-
return;
|
157
|
-
}
|
158
|
-
}
|
159
|
-
index++;
|
160
|
-
}
|
161
|
-
if (!this.items[this.items.length - 1].hidden) {
|
162
|
-
this.moreMenu.hidden = true;
|
163
|
-
}
|
132
|
+
return true;
|
133
|
+
});
|
134
|
+
return foundItem;
|
164
135
|
};
|
165
136
|
_ActionBarElement_showItem = function _ActionBarElement_showItem(index) {
|
166
|
-
this.items[index].
|
137
|
+
this.items[index].style.setProperty('visibility', 'visible');
|
167
138
|
__classPrivateFieldGet(this, _ActionBarElement_instances, "a", _ActionBarElement_menuItems_get)[index].hidden = true;
|
168
139
|
};
|
169
140
|
_ActionBarElement_hideItem = function _ActionBarElement_hideItem(index) {
|
170
|
-
this.items[index].hidden
|
141
|
+
this.items[index].style.setProperty('visibility', 'hidden');
|
171
142
|
__classPrivateFieldGet(this, _ActionBarElement_instances, "a", _ActionBarElement_menuItems_get)[index].hidden = false;
|
172
|
-
if (this.moreMenu.hidden) {
|
173
|
-
this.moreMenu.hidden = false;
|
174
|
-
}
|
175
143
|
};
|
176
144
|
_ActionBarElement_menuItems_get = function _ActionBarElement_menuItems_get() {
|
177
145
|
return this.moreMenu.querySelectorAll('[role="menu"] > li');
|
178
146
|
};
|
147
|
+
_ActionBarElement_eachItem = function _ActionBarElement_eachItem(callback) {
|
148
|
+
for (let i = 0; i < this.items.length; i++) {
|
149
|
+
const item = this.items[i];
|
150
|
+
const type = item.classList.contains('ActionBar-divider') ? ItemType.Divider : ItemType.Item;
|
151
|
+
if (!callback(item, i, type)) {
|
152
|
+
break;
|
153
|
+
}
|
154
|
+
}
|
155
|
+
};
|
179
156
|
__decorate([
|
180
157
|
targets
|
181
158
|
], ActionBarElement.prototype, "items", void 0);
|
@@ -309,7 +309,15 @@ _ActionMenuElement_handleDialogItemActivated = function _ActionMenuElement_handl
|
|
309
309
|
if (__classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_isOpen).call(this)) {
|
310
310
|
__classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_hide).call(this);
|
311
311
|
}
|
312
|
+
const activeElement = this.ownerDocument.activeElement;
|
313
|
+
const lostFocus = this.ownerDocument.activeElement === this.ownerDocument.body;
|
314
|
+
const focusInClosedMenu = this.contains(activeElement);
|
315
|
+
if (lostFocus || focusInClosedMenu) {
|
316
|
+
setTimeout(() => { var _a; return (_a = this.invokerElement) === null || _a === void 0 ? void 0 : _a.focus(); }, 0);
|
317
|
+
}
|
312
318
|
};
|
319
|
+
// a modal <dialog> element will close all popovers
|
320
|
+
setTimeout(() => __classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_show).call(this), 0);
|
313
321
|
dialog.addEventListener('close', handleDialogClose, { signal });
|
314
322
|
dialog.addEventListener('cancel', handleDialogClose, { signal });
|
315
323
|
};
|
@@ -1 +1 @@
|
|
1
|
-
.Overlay--hidden{display:none!important}.Overlay--visibilityHidden{height:0;opacity:0;overflow:hidden;visibility:hidden}.Overlay{background-color:var(--overlay-bgColor,var(--color-canvas-overlay));border-radius:var(--borderRadius-large,.75rem);box-shadow:var(--shadow-floating-small,var(--color-overlay-shadow));display:flex;flex-direction:column;max-height:min(calc(100vh - 2rem),var(--overlay-height));min-width:192px;opacity:1;white-space:normal;width:min(var(--overlay-width),100vw - 2rem)}.Overlay.Overlay--size-auto{max-height:calc(100vh - 2rem);max-width:calc(100vw - 2rem);min-width:192px}.Overlay.Overlay--size-full{height:100vh;width:100vw}.Overlay.Overlay--size-xsmall{--overlay-width:192px;max-height:calc(100vh - 2rem)}.Overlay.Overlay--size-small{--overlay-height:256px;--overlay-width:320px}.Overlay.Overlay--size-small-portrait{--overlay-height:432px;--overlay-width:320px}.Overlay.Overlay--size-medium{--overlay-height:320px;--overlay-width:480px}.Overlay.Overlay--size-medium-portrait{--overlay-height:600px;--overlay-width:480px}.Overlay.Overlay--size-large{--overlay-height:432px;--overlay-width:640px}.Overlay.Overlay--size-xlarge{--overlay-height:600px;--overlay-width:960px}.Overlay.Overlay--height-auto{height:auto}.Overlay.Overlay--height-xsmall{height:min(192px,100vh - 2rem)}.Overlay.Overlay--height-small{height:min(256px,100vh - 2rem)}.Overlay.Overlay--height-medium{height:min(320px,100vh - 2rem)}.Overlay.Overlay--height-large{height:min(432px,100vh - 2rem)}.Overlay.Overlay--height-xlarge{height:min(600px,100vh - 2rem)}.Overlay.Overlay--width-auto{width:auto}.Overlay.Overlay--width-small{width:min(256px,100vw - 2rem)}.Overlay.Overlay--width-medium{width:min(320px,100vw - 2rem)}.Overlay.Overlay--width-large{width:min(480px,100vw - 2rem)}.Overlay.Overlay--width-xlarge{width:min(640px,100vw - 2rem)}.Overlay.Overlay--width-xxlarge{width:min(960px,100vw - 2rem)}@media screen and (prefers-reduced-motion:no-preference){.Overlay.Overlay--motion-scaleFade{animation:Overlay--motion-scaleFade .2s cubic-bezier(.33,1,.68,1) 0s 1 normal none running}}@keyframes Overlay--motion-scaleFade{0%{opacity:0;transform:scale(.5)}to{opacity:1;transform:scale(1)}}.Overlay-form{flex-grow:1;overflow:auto}.Overlay-form,.Overlay-header{display:flex;flex-direction:column}.Overlay-header{color:var(--fgColor-default,var(--color-fg-default));z-index:1}.Overlay-header.Overlay-header--divided{box-shadow:inset 0 calc(var(--borderWidth-thin,max(1px, .0625rem))*-1) var(--borderColor-default,var(--color-border-default));padding-bottom:var(--stack-padding-condensed,.5rem)}.Overlay-header.Overlay-header--divided+.Overlay-body{padding-top:var(--stack-padding-normal,1rem)}.Overlay-header.Overlay-header--large .Overlay-headerContentWrap .Overlay-titleWrap{gap:var(--stack-gap-condensed,.5rem)}.Overlay-header.Overlay-header--large .Overlay-headerContentWrap .Overlay-titleWrap .Overlay-title{font-size:var(--text-title-size-medium,1.25rem)}.Overlay-header.Overlay-header--large .Overlay-headerContentWrap .Overlay-titleWrap .Overlay-description{font-size:var(--text-body-size-medium,.875rem)}.Overlay-header .Overlay-headerContentWrap{align-items:flex-start;display:flex;gap:var(--stack-gap-condensed,.5rem);padding:var(--stack-gap-condensed,.5rem) var(--stack-gap-condensed,.5rem) 0 var(--stack-gap-condensed,.5rem)}.Overlay-header .Overlay-headerContentWrap .Overlay-actionWrap{display:flex;flex-direction:row;gap:var(--stack-gap-condensed,.5rem)}.Overlay-header .Overlay-headerContentWrap .Overlay-titleWrap{display:flex;flex-direction:column;flex-grow:1;gap:var(--control-small-gap,.25rem);padding:calc(var(--stack-gap-condensed,.5rem)*.75) 0 calc(var(--stack-gap-condensed,.5rem)*.75) var(--stack-gap-condensed,.5rem)}.Overlay-header .Overlay-headerContentWrap .Overlay-titleWrap .Overlay-title{font-size:var(--text-body-size-medium,.875rem);font-weight:var(--base-text-weight-semibold,600);margin:0}.Overlay-header .Overlay-headerContentWrap .Overlay-titleWrap .Overlay-description{color:var(--fgColor-muted,var(--color-fg-muted));font-size:var(--text-body-size-small,.75rem);font-weight:var(--base-text-weight-normal,400);margin:0}.Overlay-body{flex-grow:1;font-size:var(--text-body-size-medium,.875rem);overflow-y:auto;padding:var(--stack-padding-normal,1rem);padding-top:0;scrollbar-width:thin}.Overlay-body.Overlay-body--paddingCondensed{padding:var(--stack-padding-condensed,.5rem);padding-top:0}.Overlay-body.Overlay-body--paddingNone{padding:0}.Overlay-footer{display:flex;flex-direction:row;flex-shrink:0;flex-wrap:wrap;padding:0 var(--stack-padding-normal,1rem) var(--stack-padding-normal,1rem) var(--stack-padding-normal,1rem);z-index:1}.Overlay-footer.Overlay-footer--divided{box-shadow:inset 0 var(--borderWidth-thin,max(1px,.0625rem)) var(--borderColor-default,var(--color-border-default));padding-top:var(--stack-padding-normal,1rem)}.Overlay-footer.Overlay-footer--alignStart{gap:var(--stack-gap-condensed,.5rem);justify-content:flex-start}.Overlay-footer.Overlay-footer--alignCenter{gap:var(--stack-gap-condensed,.5rem);justify-content:center}.Overlay-footer.Overlay-footer--alignEnd{gap:var(--stack-gap-condensed,.5rem);justify-content:flex-end}.Overlay-closeButton{align-self:flex-start;background-color:initial;border:var(--borderWidth-thin,max(1px,.0625rem)) solid #0000;border-radius:var(--borderRadius-medium,.375rem);color:var(--fgColor-muted,var(--color-fg-muted));cursor:pointer;display:grid;flex-shrink:0;height:var(--base-size-32,2rem);padding:0;place-content:center;position:relative;transition:.2s cubic-bezier(.3,0,.5,1);transition-property:color,background-color,border-color;-webkit-user-select:none;user-select:none;width:var(--base-size-32,2rem)}.Overlay-closeButton:focus,.Overlay-closeButton:hover{background-color:var(--button-default-bgColor-hover,var(--color-btn-hover-bg));border:var(--borderWidth-thin,max(1px,.0625rem)) solid var(--control-bgColor-hover,var(--color-btn-hover-bg))}.Overlay-closeButton.close-button{border:var(--borderWidth-thin,max(1px,.0625rem)) solid #0000}.Overlay-backdrop--center{align-items:center;background-color:var(--overlay-backdrop-bgColor,var(--color-neutral-muted));bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0;z-index:999}.Overlay-backdrop--anchor{background-color:initial;position:absolute;z-index:999}.Overlay-backdrop--side{background-color:var(--overlay-backdrop-bgColor,var(--color-neutral-muted));bottom:0;display:flex;left:0;position:fixed;right:0;top:0;z-index:999}.Overlay-backdrop--side,.Overlay-backdrop--side.Overlay-backdrop--placement-left{align-items:center;justify-content:left}.Overlay-backdrop--side.Overlay-backdrop--placement-left>.Overlay{border-radius:var(--borderRadius-large,.75rem);border-bottom-left-radius:0;border-top-left-radius:0;height:100vh;max-height:unset}@media screen and (prefers-reduced-motion:no-preference){.Overlay-backdrop--side.Overlay-backdrop--placement-left>.Overlay{animation:Overlay--motion-slideInRight .25s cubic-bezier(.33,1,.68,1) 0s 1 normal none running}}.Overlay-backdrop--side.Overlay-backdrop--placement-right{align-items:center;justify-content:right}.Overlay-backdrop--side.Overlay-backdrop--placement-right>.Overlay{border-radius:var(--borderRadius-large,.75rem);border-bottom-right-radius:0;border-top-right-radius:0;height:100vh;max-height:unset}@media screen and (prefers-reduced-motion:no-preference){.Overlay-backdrop--side.Overlay-backdrop--placement-right>.Overlay{animation:Overlay--motion-slideInLeft .25s cubic-bezier(.33,1,.68,1) 0s 1 normal none running}}.Overlay-backdrop--side.Overlay-backdrop--placement-bottom{align-items:end;justify-content:center}.Overlay-backdrop--side.Overlay-backdrop--placement-bottom>.Overlay{border-radius:var(--borderRadius-large,.75rem);border-bottom-left-radius:0;border-bottom-right-radius:0;height:auto;max-height:calc(100vh - 2rem);width:100vw}@media screen and (prefers-reduced-motion:no-preference){.Overlay-backdrop--side.Overlay-backdrop--placement-bottom>.Overlay{animation:Overlay--motion-slideUp .25s cubic-bezier(.33,1,.68,1) 0s 1 normal none running}}.Overlay-backdrop--side.Overlay-backdrop--placement-top{align-items:start;justify-content:center}.Overlay-backdrop--side.Overlay-backdrop--placement-top>.Overlay{border-radius:var(--borderRadius-large,.75rem);border-top-left-radius:0;border-top-right-radius:0}@media screen and (prefers-reduced-motion:no-preference){.Overlay-backdrop--side.Overlay-backdrop--placement-top>.Overlay{animation:Overlay--motion-slideDown .25s cubic-bezier(.33,1,.68,1) 0s 1 normal none running}}.Overlay-backdrop--full{background-color:var(--overlay-backdrop-bgColor,var(--color-neutral-muted));bottom:0;display:flex;left:0;position:fixed;right:0;top:0;z-index:999}.Overlay-backdrop--full .Overlay{border-radius:unset!important;flex-grow:1;height:100%;max-height:100vh;max-width:100vw;width:100%}@media (max-width:767px){.Overlay-backdrop--center-whenNarrow{align-items:center;background-color:var(--overlay-backdrop-bgColor,var(--color-neutral-muted));bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0;z-index:999}.Overlay-backdrop--anchor-whenNarrow{background-color:initial;position:absolute;z-index:999}.Overlay-backdrop--side-whenNarrow{background-color:var(--overlay-backdrop-bgColor,var(--color-neutral-muted));bottom:0;display:flex;left:0;position:fixed;right:0;top:0;z-index:999}.Overlay-backdrop--side-whenNarrow,.Overlay-backdrop--side-whenNarrow.Overlay-backdrop--placement-left-whenNarrow{align-items:center;justify-content:left}.Overlay-backdrop--side-whenNarrow.Overlay-backdrop--placement-left-whenNarrow>.Overlay-whenNarrow{border-radius:var(--borderRadius-large,.75rem);border-bottom-left-radius:0;border-top-left-radius:0;height:100vh;max-height:unset}@media screen and (prefers-reduced-motion:no-preference){.Overlay-backdrop--side-whenNarrow.Overlay-backdrop--placement-left-whenNarrow>.Overlay-whenNarrow{animation:Overlay--motion-slideInRight .25s cubic-bezier(.33,1,.68,1) 0s 1 normal none running}}.Overlay-backdrop--side-whenNarrow.Overlay-backdrop--placement-right-whenNarrow{align-items:center;justify-content:right}.Overlay-backdrop--side-whenNarrow.Overlay-backdrop--placement-right-whenNarrow>.Overlay-whenNarrow{border-radius:var(--borderRadius-large,.75rem);border-bottom-right-radius:0;border-top-right-radius:0;height:100vh;max-height:unset}@media screen and (prefers-reduced-motion:no-preference){.Overlay-backdrop--side-whenNarrow.Overlay-backdrop--placement-right-whenNarrow>.Overlay-whenNarrow{animation:Overlay--motion-slideInLeft .25s cubic-bezier(.33,1,.68,1) 0s 1 normal none running}}.Overlay-backdrop--side-whenNarrow.Overlay-backdrop--placement-bottom-whenNarrow{align-items:end;justify-content:center}.Overlay-backdrop--side-whenNarrow.Overlay-backdrop--placement-bottom-whenNarrow>.Overlay-whenNarrow{border-radius:var(--borderRadius-large,.75rem);border-bottom-left-radius:0;border-bottom-right-radius:0;height:auto;max-height:calc(100vh - 2rem);width:100vw}@media screen and (prefers-reduced-motion:no-preference){.Overlay-backdrop--side-whenNarrow.Overlay-backdrop--placement-bottom-whenNarrow>.Overlay-whenNarrow{animation:Overlay--motion-slideUp .25s cubic-bezier(.33,1,.68,1) 0s 1 normal none running}}.Overlay-backdrop--side-whenNarrow.Overlay-backdrop--placement-top-whenNarrow{align-items:start;justify-content:center}.Overlay-backdrop--side-whenNarrow.Overlay-backdrop--placement-top-whenNarrow>.Overlay-whenNarrow{border-radius:var(--borderRadius-large,.75rem);border-top-left-radius:0;border-top-right-radius:0}@media screen and (prefers-reduced-motion:no-preference){.Overlay-backdrop--side-whenNarrow.Overlay-backdrop--placement-top-whenNarrow>.Overlay-whenNarrow{animation:Overlay--motion-slideDown .25s cubic-bezier(.33,1,.68,1) 0s 1 normal none running}}.Overlay-backdrop--full-whenNarrow{background-color:var(--overlay-backdrop-bgColor,var(--color-neutral-muted));bottom:0;display:flex;left:0;position:fixed;right:0;top:0;z-index:999}.Overlay-backdrop--full-whenNarrow .Overlay{border-radius:unset!important;flex-grow:1;height:100%;max-height:100vh;max-width:100vw;width:100%}}@keyframes Overlay--motion-slideDown{0%{transform:translateY(-100%)}}@keyframes Overlay--motion-slideUp{0%{transform:translateY(100%)}}@keyframes Overlay--motion-slideInRight{0%{transform:translateX(-100%)}}@keyframes Overlay--motion-slideInLeft{0%{transform:translateX(100%)}}
|
1
|
+
dialog.Overlay:not([open]){display:none}dialog.Overlay{color:var(--fgColor-default,var(--color-fg-default))}.Overlay--hidden{display:none!important}.Overlay--visibilityHidden{height:0;opacity:0;overflow:hidden;visibility:hidden}.Overlay{background-color:var(--overlay-bgColor,var(--color-canvas-overlay));border-radius:var(--borderRadius-large,.75rem);box-shadow:var(--shadow-floating-small,var(--color-overlay-shadow));display:flex;flex-direction:column;max-height:min(calc(100vh - 2rem),var(--overlay-height));min-width:192px;opacity:1;white-space:normal;width:min(var(--overlay-width),100vw - 2rem)}.Overlay.Overlay--size-auto{max-height:calc(100vh - 2rem);max-width:calc(100vw - 2rem);min-width:192px}.Overlay.Overlay--size-full{height:100vh;width:100vw}.Overlay.Overlay--size-xsmall{--overlay-width:192px;max-height:calc(100vh - 2rem)}.Overlay.Overlay--size-small{--overlay-height:256px;--overlay-width:320px}.Overlay.Overlay--size-small-portrait{--overlay-height:432px;--overlay-width:320px}.Overlay.Overlay--size-medium{--overlay-height:320px;--overlay-width:480px}.Overlay.Overlay--size-medium-portrait{--overlay-height:600px;--overlay-width:480px}.Overlay.Overlay--size-large{--overlay-height:432px;--overlay-width:640px}.Overlay.Overlay--size-xlarge{--overlay-height:600px;--overlay-width:960px}.Overlay.Overlay--height-auto{height:auto}.Overlay.Overlay--height-xsmall{height:min(192px,100vh - 2rem)}.Overlay.Overlay--height-small{height:min(256px,100vh - 2rem)}.Overlay.Overlay--height-medium{height:min(320px,100vh - 2rem)}.Overlay.Overlay--height-large{height:min(432px,100vh - 2rem)}.Overlay.Overlay--height-xlarge{height:min(600px,100vh - 2rem)}.Overlay.Overlay--width-auto{width:auto}.Overlay.Overlay--width-small{width:min(256px,100vw - 2rem)}.Overlay.Overlay--width-medium{width:min(320px,100vw - 2rem)}.Overlay.Overlay--width-large{width:min(480px,100vw - 2rem)}.Overlay.Overlay--width-xlarge{width:min(640px,100vw - 2rem)}.Overlay.Overlay--width-xxlarge{width:min(960px,100vw - 2rem)}@media screen and (prefers-reduced-motion:no-preference){.Overlay.Overlay--motion-scaleFade{animation:Overlay--motion-scaleFade .2s cubic-bezier(.33,1,.68,1) 0s 1 normal none running}}@keyframes Overlay--motion-scaleFade{0%{opacity:0;transform:scale(.5)}to{opacity:1;transform:scale(1)}}.Overlay-form{flex-grow:1;overflow:auto}.Overlay-form,.Overlay-header{display:flex;flex-direction:column}.Overlay-header{color:var(--fgColor-default,var(--color-fg-default));z-index:1}.Overlay-header.Overlay-header--divided{box-shadow:inset 0 calc(var(--borderWidth-thin,max(1px, .0625rem))*-1) var(--borderColor-default,var(--color-border-default));padding-bottom:var(--stack-padding-condensed,.5rem)}.Overlay-header.Overlay-header--divided+.Overlay-body{padding-top:var(--stack-padding-normal,1rem)}.Overlay-header.Overlay-header--large .Overlay-headerContentWrap .Overlay-titleWrap{gap:var(--stack-gap-condensed,.5rem)}.Overlay-header.Overlay-header--large .Overlay-headerContentWrap .Overlay-titleWrap .Overlay-title{font-size:var(--text-title-size-medium,1.25rem)}.Overlay-header.Overlay-header--large .Overlay-headerContentWrap .Overlay-titleWrap .Overlay-description{font-size:var(--text-body-size-medium,.875rem)}.Overlay-header .Overlay-headerContentWrap{align-items:flex-start;display:flex;gap:var(--stack-gap-condensed,.5rem);padding:var(--stack-gap-condensed,.5rem) var(--stack-gap-condensed,.5rem) 0 var(--stack-gap-condensed,.5rem)}.Overlay-header .Overlay-headerContentWrap .Overlay-actionWrap{display:flex;flex-direction:row;gap:var(--stack-gap-condensed,.5rem)}.Overlay-header .Overlay-headerContentWrap .Overlay-titleWrap{display:flex;flex-direction:column;flex-grow:1;gap:var(--control-small-gap,.25rem);padding:calc(var(--stack-gap-condensed,.5rem)*.75) 0 calc(var(--stack-gap-condensed,.5rem)*.75) var(--stack-gap-condensed,.5rem)}.Overlay-header .Overlay-headerContentWrap .Overlay-titleWrap .Overlay-title{font-size:var(--text-body-size-medium,.875rem);font-weight:var(--base-text-weight-semibold,600);margin:0}.Overlay-header .Overlay-headerContentWrap .Overlay-titleWrap .Overlay-description{color:var(--fgColor-muted,var(--color-fg-muted));font-size:var(--text-body-size-small,.75rem);font-weight:var(--base-text-weight-normal,400);margin:0}.Overlay-body{flex-grow:1;font-size:var(--text-body-size-medium,.875rem);overflow-y:auto;padding:var(--stack-padding-normal,1rem);padding-top:0;scrollbar-width:thin}.Overlay-body.Overlay-body--paddingCondensed{padding:var(--stack-padding-condensed,.5rem);padding-top:0}.Overlay-body.Overlay-body--paddingNone{padding:0}.Overlay-footer{display:flex;flex-direction:row;flex-shrink:0;flex-wrap:wrap;padding:0 var(--stack-padding-normal,1rem) var(--stack-padding-normal,1rem) var(--stack-padding-normal,1rem);z-index:1}.Overlay-footer.Overlay-footer--divided{box-shadow:inset 0 var(--borderWidth-thin,max(1px,.0625rem)) var(--borderColor-default,var(--color-border-default));padding-top:var(--stack-padding-normal,1rem)}.Overlay-footer.Overlay-footer--alignStart{gap:var(--stack-gap-condensed,.5rem);justify-content:flex-start}.Overlay-footer.Overlay-footer--alignCenter{gap:var(--stack-gap-condensed,.5rem);justify-content:center}.Overlay-footer.Overlay-footer--alignEnd{gap:var(--stack-gap-condensed,.5rem);justify-content:flex-end}.Overlay-closeButton{align-self:flex-start;background-color:initial;border:var(--borderWidth-thin,max(1px,.0625rem)) solid #0000;border-radius:var(--borderRadius-medium,.375rem);color:var(--fgColor-muted,var(--color-fg-muted));cursor:pointer;display:grid;flex-shrink:0;height:var(--base-size-32,2rem);padding:0;place-content:center;position:relative;transition:.2s cubic-bezier(.3,0,.5,1);transition-property:color,background-color,border-color;-webkit-user-select:none;user-select:none;width:var(--base-size-32,2rem)}.Overlay-closeButton:focus,.Overlay-closeButton:hover{background-color:var(--button-default-bgColor-hover,var(--color-btn-hover-bg));border:var(--borderWidth-thin,max(1px,.0625rem)) solid var(--control-bgColor-hover,var(--color-btn-hover-bg))}.Overlay-closeButton.close-button{border:var(--borderWidth-thin,max(1px,.0625rem)) solid #0000}.Overlay-backdrop--center{align-items:center;background-color:var(--overlay-backdrop-bgColor,var(--color-neutral-muted));bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0;z-index:999}.Overlay-backdrop--anchor{background-color:initial;position:absolute;z-index:999}.Overlay-backdrop--side{background-color:var(--overlay-backdrop-bgColor,var(--color-neutral-muted));bottom:0;display:flex;left:0;position:fixed;right:0;top:0;z-index:999}.Overlay-backdrop--side,.Overlay-backdrop--side.Overlay-backdrop--placement-left{align-items:center;justify-content:left}.Overlay-backdrop--side.Overlay-backdrop--placement-left>.Overlay{border-radius:var(--borderRadius-large,.75rem);border-bottom-left-radius:0;border-top-left-radius:0;height:100vh;max-height:unset}@media screen and (prefers-reduced-motion:no-preference){.Overlay-backdrop--side.Overlay-backdrop--placement-left>.Overlay{animation:Overlay--motion-slideInRight .25s cubic-bezier(.33,1,.68,1) 0s 1 normal none running}}.Overlay-backdrop--side.Overlay-backdrop--placement-right{align-items:center;justify-content:right}.Overlay-backdrop--side.Overlay-backdrop--placement-right>.Overlay{border-radius:var(--borderRadius-large,.75rem);border-bottom-right-radius:0;border-top-right-radius:0;height:100vh;max-height:unset}@media screen and (prefers-reduced-motion:no-preference){.Overlay-backdrop--side.Overlay-backdrop--placement-right>.Overlay{animation:Overlay--motion-slideInLeft .25s cubic-bezier(.33,1,.68,1) 0s 1 normal none running}}.Overlay-backdrop--side.Overlay-backdrop--placement-bottom{align-items:end;justify-content:center}.Overlay-backdrop--side.Overlay-backdrop--placement-bottom>.Overlay{border-radius:var(--borderRadius-large,.75rem);border-bottom-left-radius:0;border-bottom-right-radius:0;height:auto;max-height:calc(100vh - 2rem);width:100vw}@media screen and (prefers-reduced-motion:no-preference){.Overlay-backdrop--side.Overlay-backdrop--placement-bottom>.Overlay{animation:Overlay--motion-slideUp .25s cubic-bezier(.33,1,.68,1) 0s 1 normal none running}}.Overlay-backdrop--side.Overlay-backdrop--placement-top{align-items:start;justify-content:center}.Overlay-backdrop--side.Overlay-backdrop--placement-top>.Overlay{border-radius:var(--borderRadius-large,.75rem);border-top-left-radius:0;border-top-right-radius:0}@media screen and (prefers-reduced-motion:no-preference){.Overlay-backdrop--side.Overlay-backdrop--placement-top>.Overlay{animation:Overlay--motion-slideDown .25s cubic-bezier(.33,1,.68,1) 0s 1 normal none running}}.Overlay-backdrop--full{background-color:var(--overlay-backdrop-bgColor,var(--color-neutral-muted));bottom:0;display:flex;left:0;position:fixed;right:0;top:0;z-index:999}.Overlay-backdrop--full .Overlay{border-radius:unset!important;flex-grow:1;height:100%;max-height:100vh;max-width:100vw;width:100%}@media (max-width:767px){.Overlay-backdrop--center-whenNarrow{align-items:center;background-color:var(--overlay-backdrop-bgColor,var(--color-neutral-muted));bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0;z-index:999}.Overlay-backdrop--anchor-whenNarrow{background-color:initial;position:absolute;z-index:999}.Overlay-backdrop--side-whenNarrow{background-color:var(--overlay-backdrop-bgColor,var(--color-neutral-muted));bottom:0;display:flex;left:0;position:fixed;right:0;top:0;z-index:999}.Overlay-backdrop--side-whenNarrow,.Overlay-backdrop--side-whenNarrow.Overlay-backdrop--placement-left-whenNarrow{align-items:center;justify-content:left}.Overlay-backdrop--side-whenNarrow.Overlay-backdrop--placement-left-whenNarrow>.Overlay-whenNarrow{border-radius:var(--borderRadius-large,.75rem);border-bottom-left-radius:0;border-top-left-radius:0;height:100vh;max-height:unset}@media screen and (prefers-reduced-motion:no-preference){.Overlay-backdrop--side-whenNarrow.Overlay-backdrop--placement-left-whenNarrow>.Overlay-whenNarrow{animation:Overlay--motion-slideInRight .25s cubic-bezier(.33,1,.68,1) 0s 1 normal none running}}.Overlay-backdrop--side-whenNarrow.Overlay-backdrop--placement-right-whenNarrow{align-items:center;justify-content:right}.Overlay-backdrop--side-whenNarrow.Overlay-backdrop--placement-right-whenNarrow>.Overlay-whenNarrow{border-radius:var(--borderRadius-large,.75rem);border-bottom-right-radius:0;border-top-right-radius:0;height:100vh;max-height:unset}@media screen and (prefers-reduced-motion:no-preference){.Overlay-backdrop--side-whenNarrow.Overlay-backdrop--placement-right-whenNarrow>.Overlay-whenNarrow{animation:Overlay--motion-slideInLeft .25s cubic-bezier(.33,1,.68,1) 0s 1 normal none running}}.Overlay-backdrop--side-whenNarrow.Overlay-backdrop--placement-bottom-whenNarrow{align-items:end;justify-content:center}.Overlay-backdrop--side-whenNarrow.Overlay-backdrop--placement-bottom-whenNarrow>.Overlay-whenNarrow{border-radius:var(--borderRadius-large,.75rem);border-bottom-left-radius:0;border-bottom-right-radius:0;height:auto;max-height:calc(100vh - 2rem);width:100vw}@media screen and (prefers-reduced-motion:no-preference){.Overlay-backdrop--side-whenNarrow.Overlay-backdrop--placement-bottom-whenNarrow>.Overlay-whenNarrow{animation:Overlay--motion-slideUp .25s cubic-bezier(.33,1,.68,1) 0s 1 normal none running}}.Overlay-backdrop--side-whenNarrow.Overlay-backdrop--placement-top-whenNarrow{align-items:start;justify-content:center}.Overlay-backdrop--side-whenNarrow.Overlay-backdrop--placement-top-whenNarrow>.Overlay-whenNarrow{border-radius:var(--borderRadius-large,.75rem);border-top-left-radius:0;border-top-right-radius:0}@media screen and (prefers-reduced-motion:no-preference){.Overlay-backdrop--side-whenNarrow.Overlay-backdrop--placement-top-whenNarrow>.Overlay-whenNarrow{animation:Overlay--motion-slideDown .25s cubic-bezier(.33,1,.68,1) 0s 1 normal none running}}.Overlay-backdrop--full-whenNarrow{background-color:var(--overlay-backdrop-bgColor,var(--color-neutral-muted));bottom:0;display:flex;left:0;position:fixed;right:0;top:0;z-index:999}.Overlay-backdrop--full-whenNarrow .Overlay{border-radius:unset!important;flex-grow:1;height:100%;max-height:100vh;max-width:100vw;width:100%}}@keyframes Overlay--motion-slideDown{0%{transform:translateY(-100%)}}@keyframes Overlay--motion-slideUp{0%{transform:translateY(100%)}}@keyframes Overlay--motion-slideInRight{0%{transform:translateX(-100%)}}@keyframes Overlay--motion-slideInLeft{0%{transform:translateX(100%)}}
|
@@ -1 +1 @@
|
|
1
|
-
anchored-position[popover]{border-width:0;min-width:192px;overflow:visible;padding:0;position:absolute}anchored-position:not(.Overlay){background:none}.Overlay[popover]:not(:popover-open){display:none}anchored-position.not-anchored::backdrop{background-color:var(--overlay-backdrop-bgColor,var(--color-neutral-muted))}
|
1
|
+
anchored-position[popover]{border-width:0;min-width:192px;overflow:visible;padding:0;position:absolute}.Overlay{border-width:0;display:flex;padding:0}anchored-position:not(.Overlay){background:none}.Overlay[popover]:not(:popover-open){display:none}anchored-position.not-anchored::backdrop,dialog::backdrop{background-color:var(--overlay-backdrop-bgColor,var(--color-neutral-muted))}
|
@@ -2,8 +2,10 @@
|
|
2
2
|
"name": "alpha/overlay",
|
3
3
|
"selectors": [
|
4
4
|
"anchored-position[popover]",
|
5
|
+
".Overlay",
|
5
6
|
"anchored-position:not(.Overlay)",
|
6
7
|
".Overlay[popover]:not(:popover-open)",
|
7
|
-
"anchored-position.not-anchored::backdrop"
|
8
|
+
"anchored-position.not-anchored::backdrop",
|
9
|
+
"dialog::backdrop"
|
8
10
|
]
|
9
11
|
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
export declare class DialogHelperElement extends HTMLElement {
|
2
|
+
#private;
|
3
|
+
get dialog(): HTMLDialogElement | null;
|
4
|
+
connectedCallback(): void;
|
5
|
+
disconnectedCallback(): void;
|
6
|
+
handleEvent(event: MouseEvent): void;
|
7
|
+
}
|
8
|
+
declare global {
|
9
|
+
interface Window {
|
10
|
+
DialogHelperElement: typeof DialogHelperElement;
|
11
|
+
}
|
12
|
+
interface HTMLElementTagNameMap {
|
13
|
+
'dialog-helper': DialogHelperElement;
|
14
|
+
}
|
15
|
+
}
|
@@ -0,0 +1,77 @@
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
6
|
+
};
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
11
|
+
};
|
12
|
+
var _DialogHelperElement_abortController;
|
13
|
+
function dialogInvokerButtonHandler(event) {
|
14
|
+
const target = event.target;
|
15
|
+
const button = target === null || target === void 0 ? void 0 : target.closest('button');
|
16
|
+
if (!button || button.hasAttribute('disabled') || button.getAttribute('aria-disabled') === 'true')
|
17
|
+
return;
|
18
|
+
// If the user is clicking a valid dialog trigger
|
19
|
+
let dialogId = button === null || button === void 0 ? void 0 : button.getAttribute('data-show-dialog-id');
|
20
|
+
if (dialogId) {
|
21
|
+
event.stopPropagation();
|
22
|
+
const dialog = document.getElementById(dialogId);
|
23
|
+
if (dialog instanceof HTMLDialogElement) {
|
24
|
+
dialog.showModal();
|
25
|
+
// A buttons default behaviour in some browsers it to send a pointer event
|
26
|
+
// If the behaviour is allowed through the dialog will be shown but then
|
27
|
+
// quickly hidden- as if it were never shown. This prevents that.
|
28
|
+
event.preventDefault();
|
29
|
+
}
|
30
|
+
}
|
31
|
+
dialogId = button.getAttribute('data-close-dialog-id') || button.getAttribute('data-submit-dialog-id');
|
32
|
+
if (dialogId) {
|
33
|
+
const dialog = document.getElementById(dialogId);
|
34
|
+
if (dialog instanceof HTMLDialogElement && dialog.open) {
|
35
|
+
dialog.close();
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
39
|
+
export class DialogHelperElement extends HTMLElement {
|
40
|
+
constructor() {
|
41
|
+
super(...arguments);
|
42
|
+
_DialogHelperElement_abortController.set(this, null);
|
43
|
+
}
|
44
|
+
get dialog() {
|
45
|
+
return this.querySelector('dialog');
|
46
|
+
}
|
47
|
+
connectedCallback() {
|
48
|
+
const { signal } = (__classPrivateFieldSet(this, _DialogHelperElement_abortController, new AbortController(), "f"));
|
49
|
+
document.addEventListener('click', dialogInvokerButtonHandler);
|
50
|
+
document.addEventListener('click', this, { signal });
|
51
|
+
}
|
52
|
+
disconnectedCallback() {
|
53
|
+
var _a;
|
54
|
+
(_a = __classPrivateFieldGet(this, _DialogHelperElement_abortController, "f")) === null || _a === void 0 ? void 0 : _a.abort();
|
55
|
+
}
|
56
|
+
handleEvent(event) {
|
57
|
+
const target = event.target;
|
58
|
+
const dialog = this.dialog;
|
59
|
+
if (!(dialog === null || dialog === void 0 ? void 0 : dialog.open))
|
60
|
+
return;
|
61
|
+
if ((target === null || target === void 0 ? void 0 : target.closest('dialog')) !== dialog)
|
62
|
+
return;
|
63
|
+
const rect = dialog.getBoundingClientRect();
|
64
|
+
const clickWasInsideDialog = rect.top <= event.clientY &&
|
65
|
+
event.clientY <= rect.top + rect.height &&
|
66
|
+
rect.left <= event.clientX &&
|
67
|
+
event.clientX <= rect.left + rect.width;
|
68
|
+
if (!clickWasInsideDialog) {
|
69
|
+
dialog.close();
|
70
|
+
}
|
71
|
+
}
|
72
|
+
}
|
73
|
+
_DialogHelperElement_abortController = new WeakMap();
|
74
|
+
if (!window.customElements.get('dialog-helper')) {
|
75
|
+
window.DialogHelperElement = DialogHelperElement;
|
76
|
+
window.customElements.define('dialog-helper', DialogHelperElement);
|
77
|
+
}
|
@@ -2,9 +2,9 @@ import '@github/include-fragment-element';
|
|
2
2
|
import './alpha/action_bar_element';
|
3
3
|
import './alpha/dropdown';
|
4
4
|
import './anchored_position';
|
5
|
+
import './dialog_helper';
|
5
6
|
import './focus_group';
|
6
7
|
import './alpha/image_crop';
|
7
|
-
import './alpha/modal_dialog';
|
8
8
|
import './beta/nav_list';
|
9
9
|
import './beta/nav_list_group_element';
|
10
10
|
import './alpha/segmented_control';
|
@@ -2,9 +2,9 @@ import '@github/include-fragment-element';
|
|
2
2
|
import './alpha/action_bar_element';
|
3
3
|
import './alpha/dropdown';
|
4
4
|
import './anchored_position';
|
5
|
+
import './dialog_helper';
|
5
6
|
import './focus_group';
|
6
7
|
import './alpha/image_crop';
|
7
|
-
import './alpha/modal_dialog';
|
8
8
|
import './beta/nav_list';
|
9
9
|
import './beta/nav_list_group_element';
|
10
10
|
import './alpha/segmented_control';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@primer/view-components",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.16.0-rc.354ad89c",
|
4
4
|
"description": "ViewComponents for the Primer Design System",
|
5
5
|
"main": "app/assets/javascripts/primer_view_components.js",
|
6
6
|
"module": "app/components/primer/primer.js",
|
@@ -62,7 +62,7 @@
|
|
62
62
|
"@github/markdownlint-github": "^0.6.0",
|
63
63
|
"@github/prettier-config": "0.0.6",
|
64
64
|
"@playwright/test": "^1.35.1",
|
65
|
-
"@primer/css": "21.1.
|
65
|
+
"@primer/css": "^21.1.1",
|
66
66
|
"@primer/primitives": "7.15.4",
|
67
67
|
"@primer/stylelint-config": "^12.7.2",
|
68
68
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
@@ -1,18 +0,0 @@
|
|
1
|
-
export declare class ModalDialogElement extends HTMLElement {
|
2
|
-
#private;
|
3
|
-
openButton: HTMLButtonElement | null;
|
4
|
-
get open(): boolean;
|
5
|
-
set open(value: boolean);
|
6
|
-
get showButtons(): NodeList;
|
7
|
-
connectedCallback(): void;
|
8
|
-
show(): void;
|
9
|
-
close(closedNotCancelled?: boolean): void;
|
10
|
-
}
|
11
|
-
declare global {
|
12
|
-
interface Window {
|
13
|
-
ModalDialogElement: typeof ModalDialogElement;
|
14
|
-
}
|
15
|
-
interface HTMLElementTagNameMap {
|
16
|
-
'modal-dialog': ModalDialogElement;
|
17
|
-
}
|
18
|
-
}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
export declare class ModalDialogElement extends HTMLElement {
|
2
|
-
#private;
|
3
|
-
openButton: HTMLButtonElement | null;
|
4
|
-
get open(): boolean;
|
5
|
-
set open(value: boolean);
|
6
|
-
get showButtons(): NodeList;
|
7
|
-
connectedCallback(): void;
|
8
|
-
show(): void;
|
9
|
-
close(closedNotCancelled?: boolean): void;
|
10
|
-
}
|
11
|
-
declare global {
|
12
|
-
interface Window {
|
13
|
-
ModalDialogElement: typeof ModalDialogElement;
|
14
|
-
}
|
15
|
-
interface HTMLElementTagNameMap {
|
16
|
-
'modal-dialog': ModalDialogElement;
|
17
|
-
}
|
18
|
-
}
|