@justeattakeaway/pie-modal 0.25.0 → 0.27.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/README.md CHANGED
@@ -11,18 +11,54 @@
11
11
  # Table of Contents
12
12
 
13
13
  1. [Introduction](#pie-modal)
14
- 2. [Local Development](#local-development)
14
+ 2. [Installation](#installation)
15
15
  3. [Importing the component](#importing-the-component)
16
- 4. [Props](#props)
17
- 5. [Testing](#testing)
18
- 5. [Legacy browser support](#legacy-browser-support)
16
+ 4. [Peer Dependencies](#peer-dependencies)
17
+ 5. [Local Development](#local-development)
18
+ 6. [Props](#props)
19
+ 7. [Testing](#testing)
20
+ 8. [Legacy browser support](#legacy-browser-support)
19
21
 
20
- # pie-modal
22
+
23
+ ## pie-modal
21
24
 
22
25
  `pie-modal` is a Web Component built using the Lit library. It offers a simple and accessible modal component for web applications, which uses the native HTML `dialog` element under the hood.
23
26
 
24
27
  This component can be easily integrated into various frontend frameworks and customized through a set of properties.
25
28
 
29
+
30
+ ## Installation
31
+
32
+ To install `pie-modal` in your application, run the following on your command line:
33
+
34
+ ```bash
35
+ # npm
36
+ $ npm i @justeattakeaway/pie-modal
37
+
38
+ # yarn
39
+ $ yarn add @justeattakeaway/pie-modal
40
+ ```
41
+
42
+ For full information on using PIE components as part of an application, check out the [Getting Started Guide](https://github.com/justeattakeaway/pie/wiki/Getting-started-with-PIE-Web-Components).
43
+
44
+
45
+ ### Importing the component
46
+
47
+ ```js
48
+ // default
49
+ import { PieModal } from '@justeattakeaway/pie-modal';
50
+
51
+ // react
52
+ import { PieModal } from '@justeattakeaway/pie-modal/dist/react';
53
+ ```
54
+
55
+
56
+ ## Peer Dependencies
57
+
58
+ > [!IMPORTANT]
59
+ > When using `pie-modal`, you will also need to include a couple of dependencies to ensure the component renders as expected. See [the PIE Wiki](https://github.com/justeattakeaway/pie/wiki/Getting-started-with-PIE-Web-Components#expected-dependencies) for more information and how to include these in your application.
60
+
61
+
26
62
  ## Local development
27
63
 
28
64
  Install the dependencies. Note that this, and the following commands below, should be run from the **root of the monorepo**:
@@ -46,15 +82,6 @@ yarn watch --filter=pie-modal
46
82
  yarn dev --filter=pie-storybook
47
83
  ```
48
84
 
49
- ### Importing the component
50
-
51
- ```js
52
- // default
53
- import { PieModal } from '@justeattakeaway/pie-modal';
54
-
55
- // react
56
- import { PieModal } from '@justeattakeaway/pie-modal/dist/react';
57
- ```
58
85
 
59
86
  ## Props
60
87
 
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { isServer as te, css as I, LitElement as O, html as M, unsafeCSS as oe, nothing as c } from "lit";
2
- import { html as p, unsafeStatic as ie } from "lit/static-html.js";
3
- import { property as r, query as $ } from "lit/decorators.js";
1
+ import { isServer as te, css as I, LitElement as O, html as M, unsafeCSS as ie, nothing as c } from "lit";
2
+ import { html as p, unsafeStatic as oe } from "lit/static-html.js";
3
+ import { property as l, query as $ } from "lit/decorators.js";
4
4
  const ne = (n) => {
5
5
  class e extends n {
6
6
  /**
@@ -17,76 +17,76 @@ const ne = (n) => {
17
17
  }
18
18
  }
19
19
  return e;
20
- }, E = (n, e, t) => function(i, a) {
21
- const l = `#${a}`;
22
- Object.defineProperty(i, a, {
20
+ }, E = (n, e, t) => function(o, a) {
21
+ const r = `#${a}`;
22
+ Object.defineProperty(o, a, {
23
23
  get() {
24
- return this[l];
24
+ return this[r];
25
25
  },
26
26
  set(h) {
27
- const u = this[l];
28
- e.includes(h) ? this[l] = h : (console.error(
27
+ const m = this[r];
28
+ e.includes(h) ? this[r] = h : (console.error(
29
29
  `<${n}> Invalid value "${h}" provided for property "${a}".`,
30
30
  `Must be one of: ${e.join(" | ")}.`,
31
31
  `Falling back to default value: "${t}"`
32
- ), this[l] = t), this.requestUpdate(a, u);
32
+ ), this[r] = t), this.requestUpdate(a, m);
33
33
  }
34
34
  });
35
- }, ae = (n) => function(t, o) {
36
- const i = `#${o}`;
37
- Object.defineProperty(t, o, {
35
+ }, ae = (n) => function(t, i) {
36
+ const o = `#${i}`;
37
+ Object.defineProperty(t, i, {
38
38
  get() {
39
- return this[i];
39
+ return this[o];
40
40
  },
41
41
  set(a) {
42
- const l = this[i];
43
- (a == null || typeof a == "string" && a.trim() === "") && console.error(`<${n}> Missing required attribute "${o}"`), this[i] = a, this.requestUpdate(o, l);
42
+ const r = this[o];
43
+ (a == null || typeof a == "string" && a.trim() === "") && console.error(`<${n}> Missing required attribute "${i}"`), this[o] = a, this.requestUpdate(i, r);
44
44
  }
45
45
  });
46
- }, _ = {
46
+ }, z = {
47
47
  xs: 16,
48
48
  s: 20,
49
49
  m: 24,
50
50
  l: 28,
51
51
  xl: 32,
52
52
  xxl: 40
53
- }, W = Object.keys(_), Y = "xs", U = 8, z = 32;
54
- function le(n, e, t) {
55
- const o = parseInt(n, 10), i = o % t === 0;
56
- return o >= e && i;
53
+ }, W = Object.keys(z), Y = "xs", U = 8, _ = 32;
54
+ function re(n, e, t) {
55
+ const i = parseInt(n, 10), o = i % t === 0;
56
+ return i >= e && o;
57
57
  }
58
58
  const H = {
59
- large: (n) => le(n, z, U),
59
+ large: (n) => re(n, _, U),
60
60
  regular: (n) => W.includes(n)
61
61
  };
62
- function re(n) {
62
+ function le(n) {
63
63
  const e = H.large(n);
64
- return { isValid: e, size: e ? n : z };
64
+ return { isValid: e, size: e ? n : _ };
65
65
  }
66
66
  function se(n) {
67
- const e = H.regular(n), t = e ? _[n] : _[Y];
67
+ const e = H.regular(n), t = e ? z[n] : z[Y];
68
68
  return { isValid: e, size: t };
69
69
  }
70
- const m = (n, e, t, o) => {
71
- const i = n.endsWith("Large") || n.endsWith("-large");
72
- let a, l;
70
+ const u = (n, e, t, i) => {
71
+ const o = n.endsWith("Large") || n.endsWith("-large");
72
+ let a, r;
73
73
  if (t) {
74
- if ({ isValid: a, size: l } = i ? re(t) : se(t), !a) {
75
- const h = i ? `Invalid prop "size" value supplied to "${o}". The prop value should be a number equal or greater than ${z} and multiple of ${U}.` : `Invalid prop "size" value supplied to "${o}". The prop value should be one of the following values: ${W.join(", ")}.`;
74
+ if ({ isValid: a, size: r } = o ? le(t) : se(t), !a) {
75
+ const h = o ? `Invalid prop "size" value supplied to "${i}". The prop value should be a number equal or greater than ${_} and multiple of ${U}.` : `Invalid prop "size" value supplied to "${i}". The prop value should be one of the following values: ${W.join(", ")}.`;
76
76
  console.error(h);
77
77
  }
78
78
  } else
79
- l = i ? z : _[Y];
79
+ r = o ? _ : z[Y];
80
80
  return {
81
81
  class: [n, e].filter(Boolean).join(" "),
82
- width: l,
83
- height: l
82
+ width: r,
83
+ height: r
84
84
  };
85
85
  };
86
- var de = Object.defineProperty, ce = Object.getOwnPropertyDescriptor, P = (n, e, t, o) => {
87
- for (var i = o > 1 ? void 0 : o ? ce(e, t) : e, a = n.length - 1, l; a >= 0; a--)
88
- (l = n[a]) && (i = (o ? l(e, t, i) : l(i)) || i);
89
- return o && i && de(e, t, i), i;
86
+ var de = Object.defineProperty, ce = Object.getOwnPropertyDescriptor, P = (n, e, t, i) => {
87
+ for (var o = i > 1 ? void 0 : i ? ce(e, t) : e, a = n.length - 1, r; a >= 0; a--)
88
+ (r = n[a]) && (o = (i ? r(e, t, o) : r(o)) || o);
89
+ return i && o && de(e, t, o), o;
90
90
  };
91
91
  const R = "icon-close";
92
92
  let b = class extends O {
@@ -94,16 +94,16 @@ let b = class extends O {
94
94
  super(...arguments), this.size = "xs", this.class = "c-pieIcon c-pieIcon--close";
95
95
  }
96
96
  connectedCallback() {
97
- var e, t, o;
97
+ var e, t, i;
98
98
  if (super.connectedCallback(), ((e = this._svg) == null ? void 0 : e.getAttribute("width")) === null) {
99
- const i = m("c-pieIcon c-pieIcon--close", "", null, "IconClose");
100
- (t = this._svg) == null || t.setAttribute("width", i.width), (o = this._svg) == null || o.setAttribute("height", i.height);
99
+ const o = u("c-pieIcon c-pieIcon--close", "", null, "IconClose");
100
+ (t = this._svg) == null || t.setAttribute("width", o.width), (i = this._svg) == null || i.setAttribute("height", o.height);
101
101
  }
102
102
  }
103
103
  updated(e) {
104
- var t, o;
105
- let i;
106
- e.has("size") && (i = m("c-pieIcon c-pieIcon--close", "", this.size, "IconClose"), (t = this._svg) == null || t.setAttribute("width", i.width), (o = this._svg) == null || o.setAttribute("height", i.height));
104
+ var t, i;
105
+ let o;
106
+ e.has("size") && (o = u("c-pieIcon c-pieIcon--close", "", this.size, "IconClose"), (t = this._svg) == null || t.setAttribute("width", o.width), (i = this._svg) == null || i.setAttribute("height", o.height));
107
107
  }
108
108
  render() {
109
109
  return M`<svg xmlns="http://www.w3.org/2000/svg" role="presentation" focusable="false" fill="currentColor" viewBox="0 0 16 16" class="c-pieIcon c-pieIcon--close"><path d="M11.868 3.205 8 7.072 4.133 3.205l-.928.927L7.073 8l-3.868 3.867.928.928L8 8.927l3.868 3.868.927-.928L8.928 8l3.867-3.868-.927-.927Z"></path></svg>`;
@@ -118,19 +118,19 @@ b.styles = I`
118
118
  }
119
119
  `;
120
120
  P([
121
- r({ type: String, reflect: !0 })
121
+ l({ type: String, reflect: !0 })
122
122
  ], b.prototype, "size", 2);
123
123
  P([
124
- r({ type: String, reflect: !0 })
124
+ l({ type: String, reflect: !0 })
125
125
  ], b.prototype, "class", 2);
126
126
  P([
127
127
  $("svg")
128
128
  ], b.prototype, "_svg", 2);
129
129
  customElements.get(R) === void 0 && customElements.define(R, b);
130
- var he = Object.defineProperty, pe = Object.getOwnPropertyDescriptor, D = (n, e, t, o) => {
131
- for (var i = o > 1 ? void 0 : o ? pe(e, t) : e, a = n.length - 1, l; a >= 0; a--)
132
- (l = n[a]) && (i = (o ? l(e, t, i) : l(i)) || i);
133
- return o && i && he(e, t, i), i;
130
+ var he = Object.defineProperty, pe = Object.getOwnPropertyDescriptor, D = (n, e, t, i) => {
131
+ for (var o = i > 1 ? void 0 : i ? pe(e, t) : e, a = n.length - 1, r; a >= 0; a--)
132
+ (r = n[a]) && (o = (i ? r(e, t, o) : r(o)) || o);
133
+ return i && o && he(e, t, o), o;
134
134
  };
135
135
  const N = "icon-chevron-left";
136
136
  class w extends O {
@@ -138,16 +138,16 @@ class w extends O {
138
138
  super(...arguments), this.size = "xs", this.class = "c-pieIcon c-pieIcon--chevronLeft";
139
139
  }
140
140
  connectedCallback() {
141
- var e, t, o;
141
+ var e, t, i;
142
142
  if (super.connectedCallback(), ((e = this._svg) == null ? void 0 : e.getAttribute("width")) === null) {
143
- const i = m("c-pieIcon c-pieIcon--chevronLeft", "", null, "IconChevronLeft");
144
- (t = this._svg) == null || t.setAttribute("width", i.width), (o = this._svg) == null || o.setAttribute("height", i.height);
143
+ const o = u("c-pieIcon c-pieIcon--chevronLeft", "", null, "IconChevronLeft");
144
+ (t = this._svg) == null || t.setAttribute("width", o.width), (i = this._svg) == null || i.setAttribute("height", o.height);
145
145
  }
146
146
  }
147
147
  updated(e) {
148
- var t, o;
149
- let i;
150
- e.has("size") && (i = m("c-pieIcon c-pieIcon--chevronLeft", "", this.size, "IconChevronLeft"), (t = this._svg) == null || t.setAttribute("width", i.width), (o = this._svg) == null || o.setAttribute("height", i.height));
148
+ var t, i;
149
+ let o;
150
+ e.has("size") && (o = u("c-pieIcon c-pieIcon--chevronLeft", "", this.size, "IconChevronLeft"), (t = this._svg) == null || t.setAttribute("width", o.width), (i = this._svg) == null || i.setAttribute("height", o.height));
151
151
  }
152
152
  render() {
153
153
  return M`<svg xmlns="http://www.w3.org/2000/svg" role="presentation" focusable="false" fill="currentColor" viewBox="0 0 16 16" class="c-pieIcon c-pieIcon--chevronLeft"><path d="M10.96 2.82 5.605 8l5.399 5.197-.875.963-5.565-5.364a1.164 1.164 0 0 1 0-1.671l5.495-5.25.901.945Z"></path></svg>`;
@@ -162,19 +162,19 @@ w.styles = I`
162
162
  }
163
163
  `;
164
164
  D([
165
- r({ type: String, reflect: !0 })
165
+ l({ type: String, reflect: !0 })
166
166
  ], w.prototype, "size", 2);
167
167
  D([
168
- r({ type: String, reflect: !0 })
168
+ l({ type: String, reflect: !0 })
169
169
  ], w.prototype, "class", 2);
170
170
  D([
171
171
  $("svg")
172
172
  ], w.prototype, "_svg", 2);
173
173
  customElements.get(N) === void 0 && customElements.define(N, w);
174
- var ge = Object.defineProperty, ue = Object.getOwnPropertyDescriptor, T = (n, e, t, o) => {
175
- for (var i = o > 1 ? void 0 : o ? ue(e, t) : e, a = n.length - 1, l; a >= 0; a--)
176
- (l = n[a]) && (i = (o ? l(e, t, i) : l(i)) || i);
177
- return o && i && ge(e, t, i), i;
174
+ var ge = Object.defineProperty, me = Object.getOwnPropertyDescriptor, T = (n, e, t, i) => {
175
+ for (var o = i > 1 ? void 0 : i ? me(e, t) : e, a = n.length - 1, r; a >= 0; a--)
176
+ (r = n[a]) && (o = (i ? r(e, t, o) : r(o)) || o);
177
+ return i && o && ge(e, t, o), o;
178
178
  };
179
179
  const q = "icon-chevron-right";
180
180
  class y extends O {
@@ -182,16 +182,16 @@ class y extends O {
182
182
  super(...arguments), this.size = "xs", this.class = "c-pieIcon c-pieIcon--chevronRight";
183
183
  }
184
184
  connectedCallback() {
185
- var e, t, o;
185
+ var e, t, i;
186
186
  if (super.connectedCallback(), ((e = this._svg) == null ? void 0 : e.getAttribute("width")) === null) {
187
- const i = m("c-pieIcon c-pieIcon--chevronRight", "", null, "IconChevronRight");
188
- (t = this._svg) == null || t.setAttribute("width", i.width), (o = this._svg) == null || o.setAttribute("height", i.height);
187
+ const o = u("c-pieIcon c-pieIcon--chevronRight", "", null, "IconChevronRight");
188
+ (t = this._svg) == null || t.setAttribute("width", o.width), (i = this._svg) == null || i.setAttribute("height", o.height);
189
189
  }
190
190
  }
191
191
  updated(e) {
192
- var t, o;
193
- let i;
194
- e.has("size") && (i = m("c-pieIcon c-pieIcon--chevronRight", "", this.size, "IconChevronRight"), (t = this._svg) == null || t.setAttribute("width", i.width), (o = this._svg) == null || o.setAttribute("height", i.height));
192
+ var t, i;
193
+ let o;
194
+ e.has("size") && (o = u("c-pieIcon c-pieIcon--chevronRight", "", this.size, "IconChevronRight"), (t = this._svg) == null || t.setAttribute("width", o.width), (i = this._svg) == null || i.setAttribute("height", o.height));
195
195
  }
196
196
  render() {
197
197
  return M`<svg xmlns="http://www.w3.org/2000/svg" role="presentation" focusable="false" fill="currentColor" viewBox="0 0 16 16" class="c-pieIcon c-pieIcon--chevronRight"><path d="M5.044 13.18 10.399 8 5 2.82l.875-.962 5.539 5.346a1.164 1.164 0 0 1 0 1.636l-5.469 5.285-.901-.945Z"></path></svg>`;
@@ -206,16 +206,16 @@ y.styles = I`
206
206
  }
207
207
  `;
208
208
  T([
209
- r({ type: String, reflect: !0 })
209
+ l({ type: String, reflect: !0 })
210
210
  ], y.prototype, "size", 2);
211
211
  T([
212
- r({ type: String, reflect: !0 })
212
+ l({ type: String, reflect: !0 })
213
213
  ], y.prototype, "class", 2);
214
214
  T([
215
215
  $("svg")
216
216
  ], y.prototype, "_svg", 2);
217
217
  customElements.get(q) === void 0 && customElements.define(q, y);
218
- function me(n) {
218
+ function ue(n) {
219
219
  if (Array.isArray(n)) {
220
220
  for (var e = 0, t = Array(n.length); e < n.length; e++)
221
221
  t[e] = n[e];
@@ -241,8 +241,8 @@ var Z = typeof window < "u" && window.navigator && window.navigator.platform &&
241
241
  return X(t.target) || t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
242
242
  }, ve = function(e) {
243
243
  if (f === void 0) {
244
- var t = !!e && e.reserveScrollBarGap === !0, o = window.innerWidth - document.documentElement.clientWidth;
245
- t && o > 0 && (f = document.body.style.paddingRight, document.body.style.paddingRight = o + "px");
244
+ var t = !!e && e.reserveScrollBarGap === !0, i = window.innerWidth - document.documentElement.clientWidth;
245
+ t && i > 0 && (f = document.body.style.paddingRight, document.body.style.paddingRight = i + "px");
246
246
  }
247
247
  v === void 0 && (v = document.body.style.overflow, document.body.style.overflow = "hidden");
248
248
  }, fe = function() {
@@ -250,24 +250,24 @@ var Z = typeof window < "u" && window.navigator && window.navigator.platform &&
250
250
  }, be = function(e) {
251
251
  return e ? e.scrollHeight - e.scrollTop <= e.clientHeight : !1;
252
252
  }, we = function(e, t) {
253
- var o = e.targetTouches[0].clientY - G;
254
- return X(e.target) ? !1 : t && t.scrollTop === 0 && o > 0 || be(t) && o < 0 ? A(e) : (e.stopPropagation(), !0);
253
+ var i = e.targetTouches[0].clientY - G;
254
+ return X(e.target) ? !1 : t && t.scrollTop === 0 && i > 0 || be(t) && i < 0 ? A(e) : (e.stopPropagation(), !0);
255
255
  }, ye = function(e, t) {
256
256
  if (!e) {
257
257
  console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");
258
258
  return;
259
259
  }
260
- if (!g.some(function(i) {
261
- return i.targetElement === e;
260
+ if (!g.some(function(o) {
261
+ return o.targetElement === e;
262
262
  })) {
263
- var o = {
263
+ var i = {
264
264
  targetElement: e,
265
265
  options: t || {}
266
266
  };
267
- g = [].concat(me(g), [o]), Z ? (e.ontouchstart = function(i) {
268
- i.targetTouches.length === 1 && (G = i.targetTouches[0].clientY);
269
- }, e.ontouchmove = function(i) {
270
- i.targetTouches.length === 1 && we(i, e);
267
+ g = [].concat(ue(g), [i]), Z ? (e.ontouchstart = function(o) {
268
+ o.targetTouches.length === 1 && (G = o.targetTouches[0].clientY);
269
+ }, e.ontouchmove = function(o) {
270
+ o.targetTouches.length === 1 && we(o, e);
271
271
  }, C || (document.addEventListener("touchmove", A, j ? { passive: !1 } : void 0), C = !0)) : ve(t);
272
272
  }
273
273
  }, ke = function(e) {
@@ -279,12 +279,12 @@ var Z = typeof window < "u" && window.navigator && window.navigator.platform &&
279
279
  return t.targetElement !== e;
280
280
  }), Z ? (e.ontouchstart = null, e.ontouchmove = null, C && g.length === 0 && (document.removeEventListener("touchmove", A, j ? { passive: !1 } : void 0), C = !1)) : g.length || fe();
281
281
  };
282
- const xe = `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}@keyframes rotate360{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.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: 768px){.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)}}@media (max-width: 767px){.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]{--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]{--modal-margin-block: var(--modal-margin-none);--modal-border-radius: var(--dt-radius-rounded-none);--modal-block-size: 100%;--modal-inline-size: 100%}}.c-modal[position=top]{margin-block-start:var(--dt-spacing-j)}@media (max-width: 767px){.c-modal[position=top][isfullwidthbelowmid]{margin-block-start:var(--dt-spacing-none)}}.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{padding-inline:var(--dt-spacing-d);padding-block:14px;display:grid;grid-template-areas:"back heading close" ". heading .";grid-template-columns:minmax(0,max-content) minmax(0,1fr) minmax(0,max-content);align-items:center}@media (min-width: 768px){.c-modal .c-modal-header{padding-inline:var(--dt-spacing-e);padding-block:20px}}.c-modal[hasbackbutton] .c-modal-header{padding-block:var(--dt-spacing-b);padding-inline-start:var(--dt-spacing-b)}@media (min-width: 768px){.c-modal[hasbackbutton] .c-modal-header{padding-block:var(--dt-spacing-c);padding-inline-start:var(--dt-spacing-c)}}.c-modal[isdismissible] .c-modal-header{padding-block:var(--dt-spacing-b);padding-inline-end:var(--dt-spacing-b)}@media (min-width: 768px){.c-modal[isdismissible] .c-modal-header{padding-block:var(--dt-spacing-c);padding-inline-end:var(--dt-spacing-c)}}.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);--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}.c-modal[hasbackbutton] .c-modal-heading{padding-inline-start:var(--dt-spacing-b)}@media (min-width: 768px){.c-modal[hasbackbutton] .c-modal-heading{padding-inline-start:var(--dt-spacing-c)}}.c-modal[isdismissible] .c-modal-heading{padding-inline-end:var(--dt-spacing-d)}@media (min-width: 768px){.c-modal[isdismissible] .c-modal-heading{padding-inline-end:var(--dt-spacing-e)}}.c-modal .c-modal-backBtn{grid-area:back}.c-modal .c-modal-closeBtn{grid-area:close}.c-modal[isfooterpinned] .c-modal-content,.c-modal .c-modal-scrollContainer{overflow-y:auto}.c-modal .c-modal-scrollContainer{--bg-scroll-start: linear-gradient(var(--dt-color-container-default) 30%, rgba(255, 255, 255, 0));--bg-scroll-end: linear-gradient(rgba(255, 255, 255, 0), var(--dt-color-container-default) 70%) 0 100%;--bg-scroll-top: radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, .3), rgba(0, 0, 0, 0));--bg-scroll-bottom: radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, .3), rgba(0, 0, 0, 0)) 0 100%;--bg-size-scroll-start: 100% 40px;--bg-size-scroll-end: 100% 40px;--bg-size-scroll-top: 100% 16px;--bg-size-scroll-bottom: 100% 16px;background:var(--bg-scroll-start),var(--bg-scroll-end),var(--bg-scroll-top),var(--bg-scroll-bottom);background-repeat:no-repeat;background-color:var(--dt-color-container-default);background-size:var(--bg-size-scroll-start),var(--bg-size-scroll-end),var(--bg-size-scroll-top),var(--bg-size-scroll-bottom);background-attachment:local,local,scroll,scroll}.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: var(--dt-spacing-e);--modal-content-padding-block: var(--dt-spacing-a);--spinner-size: 48px;--spinner-border-width: 6px;--spinner-base-color-h: var(--dt-color-content-interactive-secondary-h);--spinner-base-color-s: var(--dt-color-content-interactive-secondary-s);--spinner-base-color-l: var(--dt-color-content-interactive-secondary-l);--spinner-left-color-opacity: .35;--spinner-left-color: hsl(var(--spinner-base-color-h), var(--spinner-base-color-s), var(--spinner-base-color-l), var(--spinner-left-color-opacity));--spinner-right-color: hsl(var(--spinner-base-color-h), var(--spinner-base-color-s), var(--spinner-base-color-l), 1);--spinner-animation-duration: 1.15s;--spinner-animation-timing-function: linear;--spinner-animation-iteration-count: infinite;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:var(--modal-content-padding);padding-block:var(--modal-content-padding-block)}.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-content:before{content:"";position:absolute;left:50%;top:50%;translate:-50% -50%;height:var(--spinner-size);width:var(--spinner-size);display:block;background-color:transparent;border-radius:50%;border-color:var(--spinner-left-color) var(--spinner-right-color) var(--spinner-right-color) var(--spinner-left-color);border-width:var(--spinner-border-width);border-style:solid;will-change:transform;opacity:0}.c-modal[isLoading] .c-modal-content:before{animation:rotate360 var(--spinner-animation-duration) var(--spinner-animation-timing-function) var(--spinner-animation-iteration-count);opacity:1}.c-modal[isLoading] .c-modal-content .c-modal-contentInner{opacity:0}
283
- `, _e = ["h1", "h2", "h3", "h4", "h5", "h6"], ze = ["small", "medium", "large"], Ce = ["top", "center"], S = "pie-modal-close", x = "pie-modal-open", B = "pie-modal-back", Ae = "pie-modal-leading-action-click", Oe = "pie-modal-supporting-action-click";
284
- var $e = Object.defineProperty, Le = Object.getOwnPropertyDescriptor, d = (n, e, t, o) => {
285
- for (var i = o > 1 ? void 0 : o ? Le(e, t) : e, a = n.length - 1, l; a >= 0; a--)
286
- (l = n[a]) && (i = (o ? l(e, t, i) : l(i)) || i);
287
- return o && i && $e(e, t, i), i;
282
+ const xe = `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}@keyframes rotate360{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.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: 768px){.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)}}@media (max-width: 767px){.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]{--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]{--modal-margin-block: var(--modal-margin-none);--modal-border-radius: var(--dt-radius-rounded-none);--modal-block-size: 100%;--modal-inline-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--wide) * 1px);--modal-header-font-line-height: calc(var(--dt-font-heading-m-line-height--wide) * 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:var(--dt-spacing-d);margin-block:14px}@media (min-width: 768px){.c-modal .c-modal-heading{margin-inline: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:var(--dt-spacing-b);margin-inline:var(--dt-spacing-b) var(--dt-spacing-none)}@media (min-width: 768px){.c-modal .c-modal-backBtn{margin-block:var(--dt-spacing-c);margin-inline:var(--dt-spacing-c) var(--dt-spacing-none)}}.c-modal .c-modal-closeBtn{grid-area:close;margin-block:var(--dt-spacing-b);margin-inline:var(--dt-spacing-none) var(--dt-spacing-b)}@media (min-width: 768px){.c-modal .c-modal-closeBtn{margin-block:var(--dt-spacing-c);margin-inline:var(--dt-spacing-none) var(--dt-spacing-c)}}.c-modal[isfooterpinned] .c-modal-content,.c-modal .c-modal-scrollContainer{overflow-y:auto}.c-modal .c-modal-scrollContainer{--bg-scroll-start: linear-gradient(var(--dt-color-container-default) 30%, rgba(255, 255, 255, 0));--bg-scroll-end: linear-gradient(rgba(255, 255, 255, 0), var(--dt-color-container-default) 70%) 0 100%;--bg-scroll-top: radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, .3), rgba(0, 0, 0, 0));--bg-scroll-bottom: radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, .3), rgba(0, 0, 0, 0)) 0 100%;--bg-size-scroll-start: 100% 40px;--bg-size-scroll-end: 100% 40px;--bg-size-scroll-top: 100% 16px;--bg-size-scroll-bottom: 100% 16px;background:var(--bg-scroll-start),var(--bg-scroll-end),var(--bg-scroll-top),var(--bg-scroll-bottom);background-repeat:no-repeat;background-color:var(--dt-color-container-default);background-size:var(--bg-size-scroll-start),var(--bg-size-scroll-end),var(--bg-size-scroll-top),var(--bg-size-scroll-bottom);background-attachment:local,local,scroll,scroll}.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);--spinner-size: 48px;--spinner-border-width: 6px;--spinner-base-color-h: var(--dt-color-content-interactive-secondary-h);--spinner-base-color-s: var(--dt-color-content-interactive-secondary-s);--spinner-base-color-l: var(--dt-color-content-interactive-secondary-l);--spinner-left-color-opacity: .35;--spinner-left-color: hsl(var(--spinner-base-color-h), var(--spinner-base-color-s), var(--spinner-base-color-l), var(--spinner-left-color-opacity));--spinner-right-color: hsl(var(--spinner-base-color-h), var(--spinner-base-color-s), var(--spinner-base-color-l), 1);--spinner-animation-duration: 1.15s;--spinner-animation-timing-function: linear;--spinner-animation-iteration-count: infinite;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:var(--modal-content-padding-inline);padding-block:var(--modal-content-padding-block)}@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-content:before{content:"";position:absolute;left:50%;top:50%;translate:-50% -50%;height:var(--spinner-size);width:var(--spinner-size);display:block;background-color:transparent;border-radius:50%;border-color:var(--spinner-left-color) var(--spinner-right-color) var(--spinner-right-color) var(--spinner-left-color);border-width:var(--spinner-border-width);border-style:solid;will-change:transform;opacity:0}.c-modal[isLoading] .c-modal-content:before{animation:rotate360 var(--spinner-animation-duration) var(--spinner-animation-timing-function) var(--spinner-animation-iteration-count);opacity:1}.c-modal[isLoading] .c-modal-content .c-modal-contentInner{opacity:0}
283
+ `, ze = ["h1", "h2", "h3", "h4", "h5", "h6"], _e = ["small", "medium", "large"], Ce = ["top", "center"], S = "pie-modal-close", x = "pie-modal-open", B = "pie-modal-back", Ae = "pie-modal-leading-action-click", Oe = "pie-modal-supporting-action-click";
284
+ var $e = Object.defineProperty, Le = Object.getOwnPropertyDescriptor, d = (n, e, t, i) => {
285
+ for (var o = i > 1 ? void 0 : i ? Le(e, t) : e, a = n.length - 1, r; a >= 0; a--)
286
+ (r = n[a]) && (o = (i ? r(e, t, o) : r(o)) || o);
287
+ return i && o && $e(e, t, o), o;
288
288
  };
289
289
  const k = "pie-modal";
290
290
  class s extends ne(O) {
@@ -292,18 +292,18 @@ class s extends ne(O) {
292
292
  super(...arguments), this.headingLevel = "h2", this.hasBackButton = !1, this.hasStackedActions = !1, this.isDismissible = !1, this.isFooterPinned = !0, this.isFullWidthBelowMid = !1, this.isLoading = !1, this.isOpen = !1, this.position = "center", this.size = "medium", this._backButtonClicked = !1, this._handleDialogCancelEvent = (e) => {
293
293
  this.isDismissible || e.preventDefault();
294
294
  }, this._handleDialogLightDismiss = (e) => {
295
- var u;
295
+ var m;
296
296
  if (!this.isDismissible)
297
297
  return;
298
- const t = (u = this._dialog) == null ? void 0 : u.getBoundingClientRect(), {
299
- top: o = 0,
300
- bottom: i = 0,
298
+ const t = (m = this._dialog) == null ? void 0 : m.getBoundingClientRect(), {
299
+ top: i = 0,
300
+ bottom: o = 0,
301
301
  left: a = 0,
302
- right: l = 0
302
+ right: r = 0
303
303
  } = t || {};
304
- if (o === 0 && i === 0 && a === 0 && l === 0)
304
+ if (i === 0 && o === 0 && a === 0 && r === 0)
305
305
  return;
306
- (e.clientY < o || e.clientY > i || e.clientX < a || e.clientX > l) && (this.isOpen = !1);
306
+ (e.clientY < i || e.clientY > o || e.clientX < a || e.clientX > r) && (this.isOpen = !1);
307
307
  }, this._dispatchModalCustomEvent = (e) => {
308
308
  const t = new CustomEvent(e, {
309
309
  bubbles: !0,
@@ -319,7 +319,7 @@ class s extends ne(O) {
319
319
  document.removeEventListener(x, this._handleModalOpened.bind(this)), document.removeEventListener(S, this._handleModalClosed.bind(this)), document.removeEventListener(B, this._handleModalClosed.bind(this)), super.disconnectedCallback();
320
320
  }
321
321
  async firstUpdated(e) {
322
- super.firstUpdated(e), this._dialog && ((await import("./dialog-polyfill.esm-29edb142.js").then((o) => o.default)).registerDialog(this._dialog), this._dialog.addEventListener("cancel", (o) => this._handleDialogCancelEvent(o)), this._dialog.addEventListener("close", () => {
322
+ super.firstUpdated(e), this._dialog && ((await import("./dialog-polyfill.esm-29edb142.js").then((i) => i.default)).registerDialog(this._dialog), this._dialog.addEventListener("cancel", (i) => this._handleDialogCancelEvent(i)), this._dialog.addEventListener("close", () => {
323
323
  this.isOpen = !1;
324
324
  })), this._handleModalOpenStateOnFirstRender(e);
325
325
  }
@@ -330,17 +330,17 @@ class s extends ne(O) {
330
330
  * Opens the dialog element and disables page scrolling
331
331
  */
332
332
  _handleModalOpened() {
333
- var t, o, i, a;
333
+ var t, i, o, a;
334
334
  const e = (t = this._dialog) == null ? void 0 : t.querySelector(".c-modal-scrollContainer");
335
- e && ye(e), !((o = this._dialog) != null && o.hasAttribute("open") || !((i = this._dialog) != null && i.isConnected)) && ((a = this._dialog) == null || a.showModal());
335
+ e && ye(e), !((i = this._dialog) != null && i.hasAttribute("open") || !((o = this._dialog) != null && o.isConnected)) && ((a = this._dialog) == null || a.showModal());
336
336
  }
337
337
  /**
338
338
  * Closes the dialog element and re-enables page scrolling
339
339
  */
340
340
  _handleModalClosed() {
341
- var t, o;
341
+ var t, i;
342
342
  const e = (t = this._dialog) == null ? void 0 : t.querySelector(".c-modal-scrollContainer");
343
- e && ke(e), (o = this._dialog) == null || o.close(), this._returnFocus();
343
+ e && ke(e), (i = this._dialog) == null || i.close(), this._returnFocus();
344
344
  }
345
345
  // Handles the value of the isOpen property on first render of the component
346
346
  _handleModalOpenStateOnFirstRender(e) {
@@ -352,17 +352,17 @@ class s extends ne(O) {
352
352
  t !== void 0 && (t ? this._backButtonClicked ? (this._backButtonClicked = !1, this._dispatchModalCustomEvent(B)) : this._dispatchModalCustomEvent(S) : this._dispatchModalCustomEvent(x));
353
353
  }
354
354
  _handleActionClick(e) {
355
- var t, o;
356
- e === "leading" ? ((t = this._dialog) == null || t.close("leading"), this._dispatchModalCustomEvent(Ae)) : e === "supporting" && ((o = this._dialog) == null || o.close("supporting"), this._dispatchModalCustomEvent(Oe));
355
+ var t, i;
356
+ e === "leading" ? ((t = this._dialog) == null || t.close("leading"), this._dispatchModalCustomEvent(Ae)) : e === "supporting" && ((i = this._dialog) == null || i.close("supporting"), this._dispatchModalCustomEvent(Oe));
357
357
  }
358
358
  /**
359
359
  * Return focus to the specified element, providing the selector is valid
360
360
  * and the chosen element can be found.
361
361
  */
362
362
  _returnFocus() {
363
- var t, o;
363
+ var t, i;
364
364
  const e = (t = this.returnFocusAfterCloseSelector) == null ? void 0 : t.trim();
365
- e && ((o = document.querySelector(e)) == null || o.focus());
365
+ e && ((i = document.querySelector(e)) == null || i.focus());
366
366
  }
367
367
  /**
368
368
  * Template for the close button element. Called within the
@@ -415,11 +415,11 @@ class s extends ne(O) {
415
415
  * @private
416
416
  */
417
417
  renderLeadingAction() {
418
- const { text: e, variant: t = "primary", ariaLabel: o } = this.leadingAction;
418
+ const { text: e, variant: t = "primary", ariaLabel: i } = this.leadingAction;
419
419
  return e ? p`
420
420
  <pie-button
421
421
  variant="${t}"
422
- aria-label="${o || c}"
422
+ aria-label="${i || c}"
423
423
  type="submit"
424
424
  ?isFullWidth="${this.hasStackedActions}"
425
425
  @click="${() => this._handleActionClick("leading")}"
@@ -440,11 +440,11 @@ class s extends ne(O) {
440
440
  * @private
441
441
  */
442
442
  renderSupportingAction() {
443
- const { text: e, variant: t = "ghost", ariaLabel: o } = this.supportingAction;
443
+ const { text: e, variant: t = "ghost", ariaLabel: i } = this.supportingAction;
444
444
  return e ? this.leadingAction ? p`
445
445
  <pie-button
446
446
  variant="${t}"
447
- aria-label="${o || c}"
447
+ aria-label="${i || c}"
448
448
  type="reset"
449
449
  ?isFullWidth="${this.hasStackedActions}"
450
450
  @click="${() => this._handleActionClick("supporting")}"
@@ -473,18 +473,18 @@ class s extends ne(O) {
473
473
  const {
474
474
  aria: e,
475
475
  hasBackButton: t,
476
- hasStackedActions: o,
477
- heading: i,
476
+ hasStackedActions: i,
477
+ heading: o,
478
478
  headingLevel: a = "h2",
479
- isDismissible: l,
479
+ isDismissible: r,
480
480
  isFooterPinned: h,
481
- isFullWidthBelowMid: u,
481
+ isFullWidthBelowMid: m,
482
482
  isLoading: L,
483
483
  leadingAction: J,
484
484
  position: Q,
485
485
  size: K,
486
486
  supportingAction: ee
487
- } = this, F = ie(a);
487
+ } = this, F = oe(a);
488
488
  return p`
489
489
  <dialog
490
490
  id="dialog"
@@ -493,10 +493,10 @@ class s extends ne(O) {
493
493
  position="${Q}"
494
494
  ?hasActions=${J || ee}
495
495
  ?hasBackButton=${t}
496
- ?hasStackedActions=${o}
497
- ?isDismissible=${l}
496
+ ?hasStackedActions=${i}
497
+ ?isDismissible=${r}
498
498
  ?isFooterPinned=${h}
499
- ?isFullWidthBelowMid=${u}
499
+ ?isFullWidthBelowMid=${m}
500
500
  ?isLoading=${L}
501
501
  aria-busy="${L ? "true" : "false"}"
502
502
  aria-label="${L && (e == null ? void 0 : e.loading) || c}"
@@ -504,9 +504,9 @@ class s extends ne(O) {
504
504
  <header class="c-modal-header">
505
505
  ${t ? this.renderBackButton() : c}
506
506
  <${F} class="c-modal-heading">
507
- ${i}
507
+ ${o}
508
508
  </${F}>
509
- ${l ? this.renderCloseButton() : c}
509
+ ${r ? this.renderCloseButton() : c}
510
510
  </header>
511
511
  ${// We need to wrap the remaining content in a shared scrollable container if the footer is not pinned
512
512
  h ? this.renderModalContentAndFooter() : p`
@@ -517,55 +517,55 @@ class s extends ne(O) {
517
517
  </dialog>`;
518
518
  }
519
519
  }
520
- s.styles = oe(xe);
520
+ s.styles = ie(xe);
521
521
  d([
522
- r({ type: Object })
522
+ l({ type: Object })
523
523
  ], s.prototype, "aria", 2);
524
524
  d([
525
- r({ type: String }),
525
+ l({ type: String }),
526
526
  ae(k)
527
527
  ], s.prototype, "heading", 2);
528
528
  d([
529
- r(),
530
- E(k, _e, "h2")
529
+ l(),
530
+ E(k, ze, "h2")
531
531
  ], s.prototype, "headingLevel", 2);
532
532
  d([
533
- r({ type: Boolean })
533
+ l({ type: Boolean })
534
534
  ], s.prototype, "hasBackButton", 2);
535
535
  d([
536
- r({ type: Boolean })
536
+ l({ type: Boolean })
537
537
  ], s.prototype, "hasStackedActions", 2);
538
538
  d([
539
- r({ type: Boolean, reflect: !0 })
539
+ l({ type: Boolean, reflect: !0 })
540
540
  ], s.prototype, "isDismissible", 2);
541
541
  d([
542
- r({ type: Boolean })
542
+ l({ type: Boolean })
543
543
  ], s.prototype, "isFooterPinned", 2);
544
544
  d([
545
- r({ type: Boolean })
545
+ l({ type: Boolean })
546
546
  ], s.prototype, "isFullWidthBelowMid", 2);
547
547
  d([
548
- r({ type: Boolean, reflect: !0 })
548
+ l({ type: Boolean, reflect: !0 })
549
549
  ], s.prototype, "isLoading", 2);
550
550
  d([
551
- r({ type: Boolean })
551
+ l({ type: Boolean })
552
552
  ], s.prototype, "isOpen", 2);
553
553
  d([
554
- r({ type: Object })
554
+ l({ type: Object })
555
555
  ], s.prototype, "leadingAction", 2);
556
556
  d([
557
- r(),
557
+ l(),
558
558
  E(k, Ce, "center")
559
559
  ], s.prototype, "position", 2);
560
560
  d([
561
- r()
561
+ l()
562
562
  ], s.prototype, "returnFocusAfterCloseSelector", 2);
563
563
  d([
564
- r(),
565
- E(k, ze, "medium")
564
+ l(),
565
+ E(k, _e, "medium")
566
566
  ], s.prototype, "size", 2);
567
567
  d([
568
- r({ type: Object })
568
+ l({ type: Object })
569
569
  ], s.prototype, "supportingAction", 2);
570
570
  d([
571
571
  $("dialog")
@@ -578,7 +578,7 @@ export {
578
578
  x as ON_MODAL_OPEN_EVENT,
579
579
  Oe as ON_MODAL_SUPPORTING_ACTION_CLICK,
580
580
  s as PieModal,
581
- _e as headingLevels,
581
+ ze as headingLevels,
582
582
  Ce as positions,
583
- ze as sizes
583
+ _e as sizes
584
584
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justeattakeaway/pie-modal",
3
- "version": "0.25.0",
3
+ "version": "0.27.0",
4
4
  "description": "PIE design system modal built using web components",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -29,11 +29,11 @@
29
29
  "license": "Apache-2.0",
30
30
  "devDependencies": {
31
31
  "@justeat/pie-design-tokens": "5.8.2",
32
- "@justeattakeaway/pie-button": "0.30.0",
32
+ "@justeattakeaway/pie-button": "0.32.0",
33
33
  "@justeattakeaway/pie-components-config": "0.4.0",
34
- "@justeattakeaway/pie-icon-button": "0.16.0",
35
- "@justeattakeaway/pie-icons-webc": "0.8.1",
36
- "@justeattakeaway/pie-webc-core": "0.9.1",
34
+ "@justeattakeaway/pie-icon-button": "0.17.0",
35
+ "@justeattakeaway/pie-icons-webc": "0.10.0",
36
+ "@justeattakeaway/pie-webc-core": "0.10.0",
37
37
  "@types/body-scroll-lock": "3.1.0"
38
38
  },
39
39
  "peerDependencies": {
package/src/modal.scss CHANGED
@@ -121,10 +121,13 @@
121
121
 
122
122
  &[position='top'] {
123
123
  margin-block-start: var(--dt-spacing-j);
124
+ max-block-size: calc(100% - var(--dt-spacing-j) * 2);
124
125
 
125
- &[isfullwidthbelowmid] {
126
+ &[size='large'],
127
+ &[isfullwidthbelowmid][size='medium'] {
126
128
  @media (max-width: calc($breakpoint-wide - 1px)) {
127
129
  margin-block-start: var(--dt-spacing-none);
130
+ max-block-size: 100%;
128
131
  }
129
132
  }
130
133
  }
@@ -162,39 +165,10 @@
162
165
  }
163
166
 
164
167
  & .c-modal-header {
165
- padding-inline: var(--dt-spacing-d);
166
- padding-block: 14px; // This is deliberately not a custom property
167
168
  display: grid;
168
- grid-template-areas:
169
- 'back heading close'
170
- '. heading .';
169
+ grid-template-areas: 'back heading close';
171
170
  grid-template-columns: minmax(0, max-content) minmax(0, 1fr) minmax(0, max-content);
172
- align-items: center;
173
-
174
- @media (min-width: $breakpoint-wide) {
175
- padding-inline: var(--dt-spacing-e);
176
- padding-block: 20px; // This is deliberately not a custom property
177
- }
178
- }
179
-
180
- &[hasbackbutton] .c-modal-header {
181
- padding-block: var(--dt-spacing-b);
182
- padding-inline-start: var(--dt-spacing-b);
183
-
184
- @media (min-width: $breakpoint-wide) {
185
- padding-block: var(--dt-spacing-c);
186
- padding-inline-start: var(--dt-spacing-c);
187
- }
188
- }
189
-
190
- &[isdismissible] .c-modal-header {
191
- padding-block: var(--dt-spacing-b);
192
- padding-inline-end: var(--dt-spacing-b);
193
-
194
- @media (min-width: $breakpoint-wide) {
195
- padding-block: var(--dt-spacing-c);
196
- padding-inline-end: var(--dt-spacing-c);
197
- }
171
+ align-items: start;
198
172
  }
199
173
 
200
174
  & .c-modal-heading {
@@ -207,32 +181,54 @@
207
181
  font-weight: var(--modal-header-font-weight);
208
182
  margin: 0;
209
183
  grid-area: heading;
184
+
185
+ margin-inline: var(--dt-spacing-d);
186
+ margin-block: 14px; // This is deliberately not a custom property
187
+
188
+ @media (min-width: $breakpoint-wide) {
189
+ margin-inline: var(--dt-spacing-e);
190
+ margin-block: 20px; // This is deliberately not a custom property
191
+ }
210
192
  }
211
193
 
212
194
  // Ensure correct padding when there is a back button in front of the heading
213
195
  &[hasbackbutton] .c-modal-heading {
214
- padding-inline-start: var(--dt-spacing-b);
196
+ margin-inline-start: var(--dt-spacing-b);
215
197
 
216
198
  @media (min-width: $breakpoint-wide) {
217
- padding-inline-start: var(--dt-spacing-c);
199
+ margin-inline-start: var(--dt-spacing-c);
218
200
  }
219
201
  }
220
202
 
221
203
  // Ensure correct padding when there is a close button behind the heading
222
204
  &[isdismissible] .c-modal-heading {
223
- padding-inline-end: var(--dt-spacing-d);
205
+ margin-inline-end: var(--dt-spacing-d);
224
206
 
225
207
  @media (min-width: $breakpoint-wide) {
226
- padding-inline-end: var(--dt-spacing-e);
208
+ margin-inline-end: var(--dt-spacing-e);
227
209
  }
228
210
  }
229
211
 
230
212
  & .c-modal-backBtn {
231
213
  grid-area: back;
214
+ margin-block: var(--dt-spacing-b);
215
+ margin-inline: var(--dt-spacing-b) var(--dt-spacing-none);
216
+
217
+ @media (min-width: $breakpoint-wide) {
218
+ margin-block: var(--dt-spacing-c);
219
+ margin-inline: var(--dt-spacing-c) var(--dt-spacing-none);
220
+ }
232
221
  }
233
222
 
234
223
  & .c-modal-closeBtn {
235
224
  grid-area: close;
225
+ margin-block: var(--dt-spacing-b);
226
+ margin-inline: var(--dt-spacing-none) var(--dt-spacing-b);
227
+
228
+ @media (min-width: $breakpoint-wide) {
229
+ margin-block: var(--dt-spacing-c);
230
+ margin-inline: var(--dt-spacing-none) var(--dt-spacing-c);
231
+ }
236
232
  }
237
233
 
238
234
  &[isfooterpinned] .c-modal-content,
@@ -266,8 +262,12 @@
266
262
  --modal-content-font-size: calc(var(--dt-font-size-16) * 1px);
267
263
  --modal-content-font-weight: var(--dt-font-weight-regular);
268
264
  --modal-content-line-height: calc(var(--dt-font-size-16-line-height) * 1px);
269
- --modal-content-padding: var(--dt-spacing-e);
270
265
  --modal-content-padding-block: var(--dt-spacing-a);
266
+ --modal-content-padding-inline: var(--dt-spacing-d);
267
+
268
+ @media (min-width: $breakpoint-wide) {
269
+ --modal-content-padding-inline: var(--dt-spacing-e);
270
+ }
271
271
 
272
272
  // Spinner sizes defaults
273
273
  --spinner-size: 48px;
@@ -293,7 +293,7 @@
293
293
  line-height: var(--modal-content-line-height);
294
294
  font-weight: var(--modal-content-font-weight);
295
295
 
296
- padding-inline: var(--modal-content-padding);
296
+ padding-inline: var(--modal-content-padding-inline);
297
297
  padding-block: var(--modal-content-padding-block);
298
298
 
299
299
  &--scrollable {
package/LICENSE DELETED
@@ -1,17 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- Copyright (c) Just Eat Takeaway.com
6
-
7
- Licensed under the Apache License, Version 2.0 (the "License");
8
- you may not use this file except in compliance with the License.
9
- You may obtain a copy of the License at
10
-
11
- http://www.apache.org/licenses/LICENSE-2.0
12
-
13
- Unless required by applicable law or agreed to in writing, software
14
- distributed under the License is distributed on an "AS IS" BASIS,
15
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- See the License for the specific language governing permissions and
17
- limitations under the License.