@justeattakeaway/pie-modal 0.38.4 → 0.38.5
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/dist/index.js +39 -39
- package/package.json +4 -4
- package/src/modal.scss +2 -4
package/dist/index.js
CHANGED
|
@@ -34,8 +34,8 @@ var B = typeof window < "u" && window.navigator && window.navigator.platform &&
|
|
|
34
34
|
return L(i.target) || i.touches.length > 1 ? !0 : (i.preventDefault && i.preventDefault(), !1);
|
|
35
35
|
}, Y = function(e) {
|
|
36
36
|
if (u === void 0) {
|
|
37
|
-
var i = !!e && e.reserveScrollBarGap === !0,
|
|
38
|
-
i &&
|
|
37
|
+
var i = !!e && e.reserveScrollBarGap === !0, o = window.innerWidth - document.documentElement.clientWidth;
|
|
38
|
+
i && o > 0 && (u = document.body.style.paddingRight, document.body.style.paddingRight = o + "px");
|
|
39
39
|
}
|
|
40
40
|
h === void 0 && (h = document.body.style.overflow, document.body.style.overflow = "hidden");
|
|
41
41
|
}, V = function() {
|
|
@@ -43,24 +43,24 @@ var B = typeof window < "u" && window.navigator && window.navigator.platform &&
|
|
|
43
43
|
}, q = function(e) {
|
|
44
44
|
return e ? e.scrollHeight - e.scrollTop <= e.clientHeight : !1;
|
|
45
45
|
}, H = function(e, i) {
|
|
46
|
-
var
|
|
47
|
-
return L(e.target) ? !1 : i && i.scrollTop === 0 &&
|
|
46
|
+
var o = e.targetTouches[0].clientY - S;
|
|
47
|
+
return L(e.target) ? !1 : i && i.scrollTop === 0 && o > 0 || q(i) && o < 0 ? w(e) : (e.stopPropagation(), !0);
|
|
48
48
|
}, U = function(e, i) {
|
|
49
49
|
if (!e) {
|
|
50
50
|
console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
|
-
if (!g.some(function(
|
|
54
|
-
return
|
|
53
|
+
if (!g.some(function(t) {
|
|
54
|
+
return t.targetElement === e;
|
|
55
55
|
})) {
|
|
56
|
-
var
|
|
56
|
+
var o = {
|
|
57
57
|
targetElement: e,
|
|
58
58
|
options: i || {}
|
|
59
59
|
};
|
|
60
|
-
g = [].concat(W(g), [
|
|
61
|
-
|
|
62
|
-
}, e.ontouchmove = function(
|
|
63
|
-
|
|
60
|
+
g = [].concat(W(g), [o]), B ? (e.ontouchstart = function(t) {
|
|
61
|
+
t.targetTouches.length === 1 && (S = t.targetTouches[0].clientY);
|
|
62
|
+
}, e.ontouchmove = function(t) {
|
|
63
|
+
t.targetTouches.length === 1 && H(t, e);
|
|
64
64
|
}, k || (document.addEventListener("touchmove", w, C ? { passive: !1 } : void 0), k = !0)) : Y(i);
|
|
65
65
|
}
|
|
66
66
|
}, K = function(e) {
|
|
@@ -72,12 +72,12 @@ var B = typeof window < "u" && window.navigator && window.navigator.platform &&
|
|
|
72
72
|
return i.targetElement !== e;
|
|
73
73
|
}), B ? (e.ontouchstart = null, e.ontouchmove = null, k && g.length === 0 && (document.removeEventListener("touchmove", w, C ? { passive: !1 } : void 0), k = !1)) : g.length || V();
|
|
74
74
|
};
|
|
75
|
-
const G = `dialog{position:absolute;left:0;right:0;width:-moz-fit-content;width:-webkit-fit-content;width:fit-content;height:-moz-fit-content;height:-webkit-fit-content;height:fit-content;margin:auto;border:solid;padding:1em;background:white;color:#000;display:block}dialog:not([open]){display:none}dialog+.backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.1)}._dialog_overlay{position:fixed;top:0;right:0;bottom:0;left:0}dialog.fixed{position:fixed;top:50%;transform:translateY(-50%)}*,*:before,*:after{box-sizing:border-box}.c-modal{--modal-size-s: 450px;--modal-size-m: 600px;--modal-size-l: 1080px;--modal-border-radius: var(--dt-radius-rounded-d);--modal-font: var(--dt-font-interactive-m-family);--modal-bg-color: var(--dt-color-container-default);--modal-elevation: var(--dt-elevation-04);border-radius:var(--modal-border-radius);border:none;box-shadow:var(--modal-elevation);font-family:var(--modal-font);background-color:var(--modal-bg-color);padding:0;--modal-margin-none: var(--dt-spacing-none);--modal-margin-small: var(--dt-spacing-g);--modal-margin-large: var(--dt-spacing-j);--modal-margin-block: var(--modal-margin-small);--modal-block-size: fit-content;--modal-inline-size: 75%;--modal-max-block-size: calc(100vh - calc(var(--modal-margin-block) * 2));--modal-max-inline-size: var(--modal-size-m);block-size:var(--modal-block-size);inline-size:var(--modal-inline-size);max-block-size:var(--modal-max-block-size);max-inline-size:var(--modal-max-inline-size)}.c-modal:focus-visible{outline:none}@media (max-width: 767px){.c-modal pie-icon-button{--btn-dimension: 40px}}.c-modal[open]{display:flex;flex-direction:column}@media (min-width: 768px){.c-modal{--modal-margin-block: var(--modal-margin-large)}}.c-modal[size=small]{--modal-max-inline-size: var(--modal-size-s)}@media (min-width: 768px){.c-modal[size=small]{--modal-margin-block: var(--modal-margin-large)}}.c-modal[size=large]{--modal-inline-size: 75%;--modal-max-inline-size: var(--modal-size-l);--modal-margin-block: var(--modal-margin-large)}@media (max-width: 767px){.c-modal[size=large],.c-modal[size=medium][isfullwidthbelowmid]{--modal-margin-block: var(--modal-margin-none);--modal-border-radius: var(--dt-radius-rounded-none);--modal-block-size: 100%;--modal-inline-size: 100%;--modal-max-inline-size: 100%}.c-modal[size=large]>.c-modal-scrollContainer,.c-modal[size=medium][isfullwidthbelowmid]>.c-modal-scrollContainer{block-size:100%}}.c-modal[position=top]{margin-block-start:var(--dt-spacing-j);max-block-size:calc(100% - var(--dt-spacing-j) * 2)}@media (max-width: 767px){.c-modal[position=top][size=large],.c-modal[position=top][isfullwidthbelowmid][size=medium]{margin-block-start:var(--dt-spacing-none);max-block-size:100%}}.c-modal::backdrop{background:rgba(0,0,0,.55)}.c-modal .c-modal-footer{--modal-button-spacing: var(--dt-spacing-d);--modal-footer-padding: var(--dt-spacing-d);display:flex;flex-flow:row-reverse;flex-wrap:wrap;gap:var(--modal-button-spacing);padding:var(--modal-footer-padding)}@media (min-width: 768px){.c-modal .c-modal-footer{--modal-footer-padding: var(--dt-spacing-e)}}@media (max-width: 767px){.c-modal[hasstackedactions] .c-modal-footer{flex-direction:column}}.c-modal .c-modal-header{display:grid;grid-template-areas:"back heading close";grid-template-columns:minmax(0,max-content) minmax(0,1fr) minmax(0,max-content);align-items:start}.c-modal .c-modal-heading{--modal-header-font-size: calc(var(--dt-font-heading-m-size--narrow) * 1px);--modal-header-font-line-height: calc(var(--dt-font-heading-m-line-height--narrow) * 1px);--modal-header-font-weight: var(--dt-font-heading-m-weight);font-size:var(--modal-header-font-size);line-height:var(--modal-header-font-line-height);font-weight:var(--modal-header-font-weight);margin:0;grid-area:heading;margin-inline-start:var(--dt-spacing-d);margin-inline-end:var(--dt-spacing-d);margin-block
|
|
75
|
+
const G = `dialog{position:absolute;left:0;right:0;width:-moz-fit-content;width:-webkit-fit-content;width:fit-content;height:-moz-fit-content;height:-webkit-fit-content;height:fit-content;margin:auto;border:solid;padding:1em;background:white;color:#000;display:block}dialog:not([open]){display:none}dialog+.backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.1)}._dialog_overlay{position:fixed;top:0;right:0;bottom:0;left:0}dialog.fixed{position:fixed;top:50%;transform:translateY(-50%)}*,*:before,*:after{box-sizing:border-box}.c-modal{--modal-size-s: 450px;--modal-size-m: 600px;--modal-size-l: 1080px;--modal-border-radius: var(--dt-radius-rounded-d);--modal-font: var(--dt-font-interactive-m-family);--modal-bg-color: var(--dt-color-container-default);--modal-elevation: var(--dt-elevation-04);border-radius:var(--modal-border-radius);border:none;box-shadow:var(--modal-elevation);font-family:var(--modal-font);background-color:var(--modal-bg-color);padding:0;--modal-margin-none: var(--dt-spacing-none);--modal-margin-small: var(--dt-spacing-g);--modal-margin-large: var(--dt-spacing-j);--modal-margin-block: var(--modal-margin-small);--modal-block-size: fit-content;--modal-inline-size: 75%;--modal-max-block-size: calc(100vh - calc(var(--modal-margin-block) * 2));--modal-max-inline-size: var(--modal-size-m);block-size:var(--modal-block-size);inline-size:var(--modal-inline-size);max-block-size:var(--modal-max-block-size);max-inline-size:var(--modal-max-inline-size)}.c-modal:focus-visible{outline:none}@media (max-width: 767px){.c-modal pie-icon-button{--btn-dimension: 40px}}.c-modal[open]{display:flex;flex-direction:column}@media (min-width: 768px){.c-modal{--modal-margin-block: var(--modal-margin-large)}}.c-modal[size=small]{--modal-max-inline-size: var(--modal-size-s)}@media (min-width: 768px){.c-modal[size=small]{--modal-margin-block: var(--modal-margin-large)}}.c-modal[size=large]{--modal-inline-size: 75%;--modal-max-inline-size: var(--modal-size-l);--modal-margin-block: var(--modal-margin-large)}@media (max-width: 767px){.c-modal[size=large],.c-modal[size=medium][isfullwidthbelowmid]{--modal-margin-block: var(--modal-margin-none);--modal-border-radius: var(--dt-radius-rounded-none);--modal-block-size: 100%;--modal-inline-size: 100%;--modal-max-inline-size: 100%}.c-modal[size=large]>.c-modal-scrollContainer,.c-modal[size=medium][isfullwidthbelowmid]>.c-modal-scrollContainer{block-size:100%}}.c-modal[position=top]{margin-block-start:var(--dt-spacing-j);max-block-size:calc(100% - var(--dt-spacing-j) * 2)}@media (max-width: 767px){.c-modal[position=top][size=large],.c-modal[position=top][isfullwidthbelowmid][size=medium]{margin-block-start:var(--dt-spacing-none);max-block-size:100%}}.c-modal::backdrop{background:rgba(0,0,0,.55)}.c-modal .c-modal-footer{--modal-button-spacing: var(--dt-spacing-d);--modal-footer-padding: var(--dt-spacing-d);display:flex;flex-flow:row-reverse;flex-wrap:wrap;gap:var(--modal-button-spacing);padding:var(--modal-footer-padding)}@media (min-width: 768px){.c-modal .c-modal-footer{--modal-footer-padding: var(--dt-spacing-e)}}@media (max-width: 767px){.c-modal[hasstackedactions] .c-modal-footer{flex-direction:column}}.c-modal .c-modal-header{display:grid;grid-template-areas:"back heading close";grid-template-columns:minmax(0,max-content) minmax(0,1fr) minmax(0,max-content);align-items:start}.c-modal .c-modal-heading{--modal-header-font-size: calc(var(--dt-font-heading-m-size--narrow) * 1px);--modal-header-font-line-height: calc(var(--dt-font-heading-m-line-height--narrow) * 1px);--modal-header-font-weight: var(--dt-font-heading-m-weight);font-size:var(--modal-header-font-size);line-height:var(--modal-header-font-line-height);font-weight:var(--modal-header-font-weight);margin:0;grid-area:heading;margin-inline-start:var(--dt-spacing-d);margin-inline-end:var(--dt-spacing-d);margin-block:14px}@media (min-width: 768px){.c-modal .c-modal-heading{--modal-header-font-size: calc(var(--dt-font-heading-m-size--wide) * 1px);--modal-header-font-line-height: calc(var(--dt-font-heading-m-line-height--wide) * 1px);margin-inline-start:var(--dt-spacing-e);margin-inline-end:var(--dt-spacing-e);margin-block:20px}}.c-modal[hasbackbutton] .c-modal-heading{margin-inline-start:var(--dt-spacing-b)}@media (min-width: 768px){.c-modal[hasbackbutton] .c-modal-heading{margin-inline-start:var(--dt-spacing-c)}}.c-modal[isdismissible] .c-modal-heading{margin-inline-end:var(--dt-spacing-d)}@media (min-width: 768px){.c-modal[isdismissible] .c-modal-heading{margin-inline-end:var(--dt-spacing-e)}}.c-modal .c-modal-backBtn{grid-area:back;margin-block-start:var(--dt-spacing-b);margin-block-end:var(--dt-spacing-b);margin-inline-start:var(--dt-spacing-b);margin-inline-end:var(--dt-spacing-none)}@media (min-width: 768px){.c-modal .c-modal-backBtn{margin-block-start:var(--dt-spacing-c);margin-block-end:var(--dt-spacing-c);margin-inline-start:var(--dt-spacing-c);margin-inline-end:var(--dt-spacing-none)}}.c-modal .c-modal-closeBtn{grid-area:close;margin-block-start:var(--dt-spacing-b);margin-block-end:var(--dt-spacing-b);margin-inline-start:var(--dt-spacing-none);margin-inline-end:var(--dt-spacing-b)}@media (min-width: 768px){.c-modal .c-modal-closeBtn{margin-block-start:var(--dt-spacing-c);margin-block-end:var(--dt-spacing-c);margin-inline-start:var(--dt-spacing-none);margin-inline-end:var(--dt-spacing-c)}}.c-modal .c-modal-content{--modal-content-font-size: calc(var(--dt-font-size-16) * 1px);--modal-content-font-weight: var(--dt-font-weight-regular);--modal-content-line-height: calc(var(--dt-font-size-16-line-height) * 1px);--modal-content-padding-block: var(--dt-spacing-a);--modal-content-padding-inline: var(--dt-spacing-d);position:relative;min-block-size:var(--dt-spacing-j);font-size:var(--modal-content-font-size);line-height:var(--modal-content-line-height);font-weight:var(--modal-content-font-weight);padding-inline-start:var(--modal-content-padding-inline);padding-inline-end:var(--modal-content-padding-inline);padding-block-start:var(--modal-content-padding-block);padding-block-end:var(--modal-content-padding-block);flex-grow:1}@media (min-width: 768px){.c-modal .c-modal-content{--modal-content-padding-inline: var(--dt-spacing-e)}}.c-modal .c-modal-content--scrollable{background:linear-gradient(to bottom,transparent,var(--dt-color-container-default) 75%) center bottom,linear-gradient(transparent,var(--dt-color-border-strong)) center bottom;background-repeat:no-repeat;background-size:100% 48px,100% 12px;background-attachment:local,scroll}.c-modal>.c-modal-scrollContainer{display:flex;flex-direction:column;overflow-y:auto;--bg-scroll-end: linear-gradient(rgba(255, 255, 255, 0), var(--dt-color-container-default) 70%) 0 100%;--bg-scroll-bottom: radial-gradient(farthest-corner at 50% 100%, rgba(0, 0, 0, .3), rgba(0, 0, 0, 0)) 0 100%;--bg-size-scroll-end: 100% 40px;--bg-size-scroll-bottom: 100% 8px;background:var(--bg-scroll-end),var(--bg-scroll-bottom);background-repeat:no-repeat;background-size:var(--bg-size-scroll-end),var(--bg-size-scroll-bottom);background-attachment:local,scroll}.c-modal>.c-modal-scrollContainer .c-modal-content{flex-shrink:0}.c-modal[isfooterpinned] .c-modal-content{overflow-y:auto}.c-modal[isLoading] .c-modal-content pie-spinner{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}.c-modal[isLoading] .c-modal-content .c-modal-contentInner{display:none}@supports not (aspect-ratio: 1/1){.c-modal .c-modal-scrollContainer{background:none}}
|
|
76
76
|
`, X = ["h1", "h2", "h3", "h4", "h5", "h6"], J = ["small", "medium", "large"], Q = ["top", "center"], x = "pie-modal-close", b = "pie-modal-open", _ = "pie-modal-back", Z = "pie-modal-leading-action-click", ee = "pie-modal-supporting-action-click";
|
|
77
|
-
var ie = Object.defineProperty,
|
|
78
|
-
for (var
|
|
79
|
-
(c = a[r]) && (
|
|
80
|
-
return
|
|
77
|
+
var ie = Object.defineProperty, oe = Object.getOwnPropertyDescriptor, l = (a, e, i, o) => {
|
|
78
|
+
for (var t = o > 1 ? void 0 : o ? oe(e, i) : e, r = a.length - 1, c; r >= 0; r--)
|
|
79
|
+
(c = a[r]) && (t = (o ? c(e, i, t) : c(t)) || t);
|
|
80
|
+
return o && t && ie(e, i, t), t;
|
|
81
81
|
};
|
|
82
82
|
const f = "pie-modal";
|
|
83
83
|
class n extends I(T) {
|
|
@@ -89,14 +89,14 @@ class n extends I(T) {
|
|
|
89
89
|
if (!this.isDismissible)
|
|
90
90
|
return;
|
|
91
91
|
const i = (v = this._dialog) == null ? void 0 : v.getBoundingClientRect(), {
|
|
92
|
-
top:
|
|
93
|
-
bottom:
|
|
92
|
+
top: o = 0,
|
|
93
|
+
bottom: t = 0,
|
|
94
94
|
left: r = 0,
|
|
95
95
|
right: c = 0
|
|
96
96
|
} = i || {};
|
|
97
|
-
if (
|
|
97
|
+
if (o === 0 && t === 0 && r === 0 && c === 0)
|
|
98
98
|
return;
|
|
99
|
-
(e.clientY <
|
|
99
|
+
(e.clientY < o || e.clientY > t || e.clientX < r || e.clientX > c) && (this.isOpen = !1);
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
connectedCallback() {
|
|
@@ -106,7 +106,7 @@ class n extends I(T) {
|
|
|
106
106
|
document.removeEventListener(b, (e) => this._handleModalOpened(e)), document.removeEventListener(x, (e) => this._handleModalClosed(e)), document.removeEventListener(_, (e) => this._handleModalClosed(e)), super.disconnectedCallback();
|
|
107
107
|
}
|
|
108
108
|
async firstUpdated(e) {
|
|
109
|
-
super.firstUpdated(e), this._dialog && ((await import("./dialog-polyfill.esm-209f54f8.js").then((
|
|
109
|
+
super.firstUpdated(e), this._dialog && ((await import("./dialog-polyfill.esm-209f54f8.js").then((o) => o.default)).registerDialog(this._dialog), this._dialog.addEventListener("cancel", (o) => this._handleDialogCancelEvent(o)), this._dialog.addEventListener("close", () => {
|
|
110
110
|
this.isOpen = !1;
|
|
111
111
|
})), this._handleModalOpenStateOnFirstRender(e);
|
|
112
112
|
}
|
|
@@ -117,11 +117,11 @@ class n extends I(T) {
|
|
|
117
117
|
* Opens the dialog element and disables page scrolling
|
|
118
118
|
*/
|
|
119
119
|
_handleModalOpened(e) {
|
|
120
|
-
var
|
|
120
|
+
var o, t, r, c;
|
|
121
121
|
const { targetModal: i } = e.detail;
|
|
122
122
|
if (i === this) {
|
|
123
|
-
const p = (
|
|
124
|
-
if (p && ("scrollTo" in window && window.scrollTo(0, 0), U(p)), (
|
|
123
|
+
const p = (o = this._dialog) == null ? void 0 : o.querySelector(".c-modal-scrollContainer");
|
|
124
|
+
if (p && ("scrollTo" in window && window.scrollTo(0, 0), U(p)), (t = this._dialog) != null && t.hasAttribute("open") || !((r = this._dialog) != null && r.isConnected))
|
|
125
125
|
return;
|
|
126
126
|
(c = this._dialog) == null || c.showModal();
|
|
127
127
|
}
|
|
@@ -130,11 +130,11 @@ class n extends I(T) {
|
|
|
130
130
|
* Closes the dialog element and re-enables page scrolling
|
|
131
131
|
*/
|
|
132
132
|
_handleModalClosed(e) {
|
|
133
|
-
var
|
|
133
|
+
var o, t;
|
|
134
134
|
const { targetModal: i } = e.detail;
|
|
135
135
|
if (i === this) {
|
|
136
|
-
const r = (
|
|
137
|
-
r && K(r), (
|
|
136
|
+
const r = (o = this._dialog) == null ? void 0 : o.querySelector(".c-modal-scrollContainer");
|
|
137
|
+
r && K(r), (t = this._dialog) == null || t.close(), this._returnFocus();
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
// Handles the value of the isOpen property on first render of the component
|
|
@@ -147,17 +147,17 @@ class n extends I(T) {
|
|
|
147
147
|
i !== void 0 && (i ? this._backButtonClicked ? (this._backButtonClicked = !1, this._dispatchModalCustomEvent(_)) : this._dispatchModalCustomEvent(x) : this._dispatchModalCustomEvent(b));
|
|
148
148
|
}
|
|
149
149
|
_handleActionClick(e) {
|
|
150
|
-
var i,
|
|
151
|
-
e === "leading" ? ((i = this._dialog) == null || i.close("leading"), this._dispatchModalCustomEvent(Z)) : e === "supporting" && ((
|
|
150
|
+
var i, o;
|
|
151
|
+
e === "leading" ? ((i = this._dialog) == null || i.close("leading"), this._dispatchModalCustomEvent(Z)) : e === "supporting" && ((o = this._dialog) == null || o.close("supporting"), this._dispatchModalCustomEvent(ee));
|
|
152
152
|
}
|
|
153
153
|
/**
|
|
154
154
|
* Return focus to the specified element, providing the selector is valid
|
|
155
155
|
* and the chosen element can be found.
|
|
156
156
|
*/
|
|
157
157
|
_returnFocus() {
|
|
158
|
-
var i,
|
|
158
|
+
var i, o;
|
|
159
159
|
const e = (i = this.returnFocusAfterCloseSelector) == null ? void 0 : i.trim();
|
|
160
|
-
e && ((
|
|
160
|
+
e && ((o = document.querySelector(e)) == null || o.focus());
|
|
161
161
|
}
|
|
162
162
|
/**
|
|
163
163
|
* Template for the close button element. Called within the
|
|
@@ -210,11 +210,11 @@ class n extends I(T) {
|
|
|
210
210
|
* @private
|
|
211
211
|
*/
|
|
212
212
|
renderLeadingAction() {
|
|
213
|
-
const { text: e, variant: i = "primary", ariaLabel:
|
|
213
|
+
const { text: e, variant: i = "primary", ariaLabel: o } = this.leadingAction;
|
|
214
214
|
return e ? m`
|
|
215
215
|
<pie-button
|
|
216
216
|
variant="${i}"
|
|
217
|
-
aria-label="${
|
|
217
|
+
aria-label="${o || s}"
|
|
218
218
|
type="submit"
|
|
219
219
|
?isFullWidth="${this.hasStackedActions}"
|
|
220
220
|
@click="${() => this._handleActionClick("leading")}"
|
|
@@ -235,11 +235,11 @@ class n extends I(T) {
|
|
|
235
235
|
* @private
|
|
236
236
|
*/
|
|
237
237
|
renderSupportingAction() {
|
|
238
|
-
const { text: e, variant: i = "ghost", ariaLabel:
|
|
238
|
+
const { text: e, variant: i = "ghost", ariaLabel: o } = this.supportingAction;
|
|
239
239
|
return e ? this.leadingAction ? m`
|
|
240
240
|
<pie-button
|
|
241
241
|
variant="${i}"
|
|
242
|
-
aria-label="${
|
|
242
|
+
aria-label="${o || s}"
|
|
243
243
|
type="reset"
|
|
244
244
|
?isFullWidth="${this.hasStackedActions}"
|
|
245
245
|
@click="${() => this._handleActionClick("supporting")}"
|
|
@@ -269,8 +269,8 @@ class n extends I(T) {
|
|
|
269
269
|
const {
|
|
270
270
|
aria: e,
|
|
271
271
|
hasBackButton: i,
|
|
272
|
-
hasStackedActions:
|
|
273
|
-
heading:
|
|
272
|
+
hasStackedActions: o,
|
|
273
|
+
heading: t,
|
|
274
274
|
headingLevel: r = "h2",
|
|
275
275
|
isDismissible: c,
|
|
276
276
|
isFooterPinned: p,
|
|
@@ -289,7 +289,7 @@ class n extends I(T) {
|
|
|
289
289
|
position="${$ || "center"}"
|
|
290
290
|
?hasActions=${M || D}
|
|
291
291
|
?hasBackButton=${i}
|
|
292
|
-
?hasStackedActions=${
|
|
292
|
+
?hasStackedActions=${o}
|
|
293
293
|
?isDismissible=${c}
|
|
294
294
|
?isFooterPinned=${p}
|
|
295
295
|
?isFullWidthBelowMid=${v}
|
|
@@ -300,7 +300,7 @@ class n extends I(T) {
|
|
|
300
300
|
<header class="c-modal-header">
|
|
301
301
|
${i ? this.renderBackButton() : s}
|
|
302
302
|
<${O} class="c-modal-heading">
|
|
303
|
-
${
|
|
303
|
+
${t}
|
|
304
304
|
</${O}>
|
|
305
305
|
${c ? this.renderCloseButton() : s}
|
|
306
306
|
</header>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justeattakeaway/pie-modal",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.5",
|
|
4
4
|
"description": "PIE design system modal built using web components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@custom-elements-manifest/analyzer": "0.9.0",
|
|
35
35
|
"@justeat/pie-design-tokens": "5.9.0",
|
|
36
|
-
"@justeattakeaway/pie-components-config": "0.
|
|
36
|
+
"@justeattakeaway/pie-components-config": "0.11.0",
|
|
37
37
|
"@justeattakeaway/pie-wrapper-react": "0.14.0",
|
|
38
38
|
"@types/body-scroll-lock": "3.1.2",
|
|
39
39
|
"cem-plugin-module-file-extensions": "0.0.5"
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"extends": "../../../package.json"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@justeattakeaway/pie-button": "0.45.
|
|
46
|
-
"@justeattakeaway/pie-icon-button": "0.27.
|
|
45
|
+
"@justeattakeaway/pie-button": "0.45.3",
|
|
46
|
+
"@justeattakeaway/pie-icon-button": "0.27.3",
|
|
47
47
|
"@justeattakeaway/pie-icons-webc": "0.17.2",
|
|
48
48
|
"@justeattakeaway/pie-spinner": "0.5.2",
|
|
49
49
|
"@justeattakeaway/pie-webc-core": "0.17.1",
|
package/src/modal.scss
CHANGED
|
@@ -175,16 +175,14 @@
|
|
|
175
175
|
|
|
176
176
|
margin-inline-start: var(--dt-spacing-d);
|
|
177
177
|
margin-inline-end: var(--dt-spacing-d);
|
|
178
|
-
margin-block
|
|
179
|
-
margin-block-end: 14px; // This is deliberately not a custom property
|
|
178
|
+
margin-block: 14px; // This is deliberately not a custom property
|
|
180
179
|
|
|
181
180
|
@media (min-width: $breakpoint-wide) {
|
|
182
181
|
--modal-header-font-size: calc(var(--dt-font-heading-m-size--wide) * 1px);
|
|
183
182
|
--modal-header-font-line-height: calc(var(--dt-font-heading-m-line-height--wide) * 1px);
|
|
184
183
|
margin-inline-start: var(--dt-spacing-e);
|
|
185
184
|
margin-inline-end: var(--dt-spacing-e);
|
|
186
|
-
margin-block
|
|
187
|
-
margin-block-end: 20px; // This is deliberately not a custom property
|
|
185
|
+
margin-block: 20px; // This is deliberately not a custom property
|
|
188
186
|
}
|
|
189
187
|
}
|
|
190
188
|
|