@justeattakeaway/pie-switch 0.30.1 → 0.30.3

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 CHANGED
@@ -1,12 +1,12 @@
1
- import { LitElement as xe, nothing as L, html as N, unsafeCSS as Fe } from "lit";
2
- import { property as E, query as le } from "lit/decorators.js";
3
- import { classMap as Se } from "lit/directives/class-map.js";
4
- import { ifDefined as Ie } from "lit/directives/if-defined.js";
5
- import { FormControlMixin as Ve, RtlMixin as Te, wrapNativeEvent as Le, validPropertyValues as Ne, defineCustomElement as Pe } from "@justeattakeaway/pie-webc-core";
1
+ import { LitElement as Fe, unsafeCSS as Ie, nothing as L, html as N } from "lit";
2
+ import { property as y, query as ce } from "lit/decorators.js";
3
+ import { classMap as Ve } from "lit/directives/class-map.js";
4
+ import { ifDefined as Se } from "lit/directives/if-defined.js";
5
+ import { FormControlMixin as Te, RtlMixin as Le, wrapNativeEvent as Ne, validPropertyValues as Oe, defineCustomElement as Pe } from "@justeattakeaway/pie-webc-core";
6
6
  import "@justeattakeaway/pie-icons-webc/dist/IconCheck.js";
7
7
  (function() {
8
- (function(v) {
9
- const o = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakMap(), A = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), j = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), F = {
8
+ (function(E) {
9
+ const o = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), A = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), j = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), F = {
10
10
  ariaAtomic: "aria-atomic",
11
11
  ariaAutoComplete: "aria-autocomplete",
12
12
  ariaBusy: "aria-busy",
@@ -49,7 +49,7 @@ import "@justeattakeaway/pie-icons-webc/dist/IconCheck.js";
49
49
  ariaValueNow: "aria-valuenow",
50
50
  ariaValueText: "aria-valuetext",
51
51
  role: "role"
52
- }, de = (t, e) => {
52
+ }, he = (t, e) => {
53
53
  for (let i in F) {
54
54
  e[i] = null;
55
55
  let a = null;
@@ -64,11 +64,11 @@ import "@justeattakeaway/pie-icons-webc/dist/IconCheck.js";
64
64
  });
65
65
  }
66
66
  };
67
- function K(t) {
67
+ function G(t) {
68
68
  const e = l.get(t), { form: i } = e;
69
- Z(t, i, e), X(t, e.labels);
69
+ ee(t, i, e), Z(t, e.labels);
70
70
  }
71
- const G = (t, e = !1) => {
71
+ const Y = (t, e = !1) => {
72
72
  const i = document.createTreeWalker(t, NodeFilter.SHOW_ELEMENT, {
73
73
  acceptNode(s) {
74
74
  return l.has(s) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
@@ -78,21 +78,21 @@ import "@justeattakeaway/pie-icons-webc/dist/IconCheck.js";
78
78
  const r = !e || t.disabled;
79
79
  for (; a; )
80
80
  a.formDisabledCallback && r && $(a, t.disabled), a = i.nextNode();
81
- }, Y = { attributes: !0, attributeFilter: ["disabled", "name"] }, S = T() ? new MutationObserver((t) => {
81
+ }, J = { attributes: !0, attributeFilter: ["disabled", "name"] }, I = T() ? new MutationObserver((t) => {
82
82
  for (const e of t) {
83
83
  const i = e.target;
84
- if (e.attributeName === "disabled" && (i.constructor.formAssociated ? $(i, i.hasAttribute("disabled")) : i.localName === "fieldset" && G(i)), e.attributeName === "name" && i.constructor.formAssociated) {
85
- const a = l.get(i), r = z.get(i);
84
+ if (e.attributeName === "disabled" && (i.constructor.formAssociated ? $(i, i.hasAttribute("disabled")) : i.localName === "fieldset" && Y(i)), e.attributeName === "name" && i.constructor.formAssociated) {
85
+ const a = l.get(i), r = q.get(i);
86
86
  a.setFormValue(r);
87
87
  }
88
88
  }
89
89
  }) : {};
90
- function O(t) {
90
+ function P(t) {
91
91
  t.forEach((e) => {
92
92
  const { addedNodes: i, removedNodes: a } = e, r = Array.from(i), s = Array.from(a);
93
93
  r.forEach((n) => {
94
- var u;
95
- if (l.has(n) && n.constructor.formAssociated && K(n), A.has(n)) {
94
+ var h;
95
+ if (l.has(n) && n.constructor.formAssociated && G(n), A.has(n)) {
96
96
  const d = A.get(n);
97
97
  Object.keys(F).filter((f) => d[f] !== null).forEach((f) => {
98
98
  n.setAttribute(F[f], d[f]);
@@ -103,125 +103,125 @@ import "@justeattakeaway/pie-icons-webc/dist/IconCheck.js";
103
103
  n.setAttribute("internals-valid", d.validity.valid.toString()), n.setAttribute("internals-invalid", (!d.validity.valid).toString()), n.setAttribute("aria-invalid", (!d.validity.valid).toString()), x.delete(n);
104
104
  }
105
105
  if (n.localName === "form") {
106
- const d = y.get(n), b = document.createTreeWalker(n, NodeFilter.SHOW_ELEMENT, {
106
+ const d = g.get(n), b = document.createTreeWalker(n, NodeFilter.SHOW_ELEMENT, {
107
107
  acceptNode(W) {
108
108
  return l.has(W) && W.constructor.formAssociated && !(d && d.has(W)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
109
109
  }
110
110
  });
111
111
  let f = b.nextNode();
112
112
  for (; f; )
113
- K(f), f = b.nextNode();
113
+ G(f), f = b.nextNode();
114
114
  }
115
- n.localName === "fieldset" && ((u = S.observe) === null || u === void 0 || u.call(S, n, Y), G(n, !0));
115
+ n.localName === "fieldset" && ((h = I.observe) === null || h === void 0 || h.call(I, n, J), Y(n, !0));
116
116
  }), s.forEach((n) => {
117
- const u = l.get(n);
118
- u && h.get(u) && J(u), P.has(n) && P.get(n).disconnect();
117
+ const h = l.get(n);
118
+ h && u.get(h) && Q(h), O.has(n) && O.get(n).disconnect();
119
119
  });
120
120
  });
121
121
  }
122
- function he(t) {
122
+ function ue(t) {
123
123
  t.forEach((e) => {
124
124
  const { removedNodes: i } = e;
125
125
  i.forEach((a) => {
126
- const r = U.get(e.target);
127
- l.has(a) && te(a), r.disconnect();
126
+ const r = j.get(e.target);
127
+ l.has(a) && ie(a), r.disconnect();
128
128
  });
129
129
  });
130
130
  }
131
- const ue = (t) => {
131
+ const pe = (t) => {
132
132
  var e, i;
133
- const a = new MutationObserver(he);
134
- !((e = window == null ? void 0 : window.ShadyDOM) === null || e === void 0) && e.inUse && t.mode && t.host && (t = t.host), (i = a.observe) === null || i === void 0 || i.call(a, t, { childList: !0 }), U.set(t, a);
133
+ const a = new MutationObserver(ue);
134
+ !((e = window == null ? void 0 : window.ShadyDOM) === null || e === void 0) && e.inUse && t.mode && t.host && (t = t.host), (i = a.observe) === null || i === void 0 || i.call(a, t, { childList: !0 }), j.set(t, a);
135
135
  };
136
- T() && new MutationObserver(O);
136
+ T() && new MutationObserver(P);
137
137
  const _ = {
138
138
  childList: !0,
139
139
  subtree: !0
140
140
  }, $ = (t, e) => {
141
141
  t.toggleAttribute("internals-disabled", e), e ? t.setAttribute("aria-disabled", "true") : t.removeAttribute("aria-disabled"), t.formDisabledCallback && t.formDisabledCallback.apply(t, [e]);
142
- }, J = (t) => {
143
- h.get(t).forEach((i) => {
142
+ }, Q = (t) => {
143
+ u.get(t).forEach((i) => {
144
144
  i.remove();
145
- }), h.set(t, []);
146
- }, Q = (t, e) => {
145
+ }), u.set(t, []);
146
+ }, X = (t, e) => {
147
147
  const i = document.createElement("input");
148
- return i.type = "hidden", i.name = t.getAttribute("name"), t.after(i), h.get(e).push(i), i;
149
- }, pe = (t, e) => {
148
+ return i.type = "hidden", i.name = t.getAttribute("name"), t.after(i), u.get(e).push(i), i;
149
+ }, fe = (t, e) => {
150
150
  var i;
151
- h.set(e, []), (i = S.observe) === null || i === void 0 || i.call(S, t, Y);
152
- }, X = (t, e) => {
151
+ u.set(e, []), (i = I.observe) === null || i === void 0 || i.call(I, t, J);
152
+ }, Z = (t, e) => {
153
153
  if (e.length) {
154
154
  Array.from(e).forEach((a) => a.addEventListener("click", t.click.bind(t)));
155
155
  let i = e[0].id;
156
156
  e[0].id || (i = `${e[0].htmlFor}_Label`, e[0].id = i), t.setAttribute("aria-labelledby", i);
157
157
  }
158
- }, I = (t) => {
159
- const e = Array.from(t.elements).filter((s) => !s.tagName.includes("-") && s.validity).map((s) => s.validity.valid), i = y.get(t) || [], a = Array.from(i).filter((s) => s.isConnected).map((s) => l.get(s).validity.valid), r = [...e, ...a].includes(!1);
158
+ }, V = (t) => {
159
+ const e = Array.from(t.elements).filter((s) => !s.tagName.includes("-") && s.validity).map((s) => s.validity.valid), i = g.get(t) || [], a = Array.from(i).filter((s) => s.isConnected).map((s) => l.get(s).validity.valid), r = [...e, ...a].includes(!1);
160
160
  t.toggleAttribute("internals-invalid", r), t.toggleAttribute("internals-valid", !r);
161
- }, fe = (t) => {
162
- I(V(t.target));
163
161
  }, me = (t) => {
164
- I(V(t.target));
162
+ V(S(t.target));
165
163
  }, we = (t) => {
164
+ V(S(t.target));
165
+ }, be = (t) => {
166
166
  const e = ["button[type=submit]", "input[type=submit]", "button:not([type])"].map((i) => `${i}:not([disabled])`).map((i) => `${i}:not([form])${t.id ? `,${i}[form='${t.id}']` : ""}`).join(",");
167
167
  t.addEventListener("click", (i) => {
168
168
  if (i.target.closest(e)) {
169
- const r = y.get(t);
169
+ const r = g.get(t);
170
170
  if (t.noValidate)
171
171
  return;
172
- r.size && Array.from(r).reverse().map((u) => l.get(u).reportValidity()).includes(!1) && i.preventDefault();
172
+ r.size && Array.from(r).reverse().map((h) => l.get(h).reportValidity()).includes(!1) && i.preventDefault();
173
173
  }
174
174
  });
175
- }, be = (t) => {
176
- const e = y.get(t.target);
175
+ }, ve = (t) => {
176
+ const e = g.get(t.target);
177
177
  e && e.size && e.forEach((i) => {
178
178
  i.constructor.formAssociated && i.formResetCallback && i.formResetCallback.apply(i);
179
179
  });
180
- }, Z = (t, e, i) => {
180
+ }, ee = (t, e, i) => {
181
181
  if (e) {
182
- const a = y.get(e);
182
+ const a = g.get(e);
183
183
  if (a)
184
184
  a.add(t);
185
185
  else {
186
186
  const r = /* @__PURE__ */ new Set();
187
- r.add(t), y.set(e, r), we(e), e.addEventListener("reset", be), e.addEventListener("input", fe), e.addEventListener("change", me);
187
+ r.add(t), g.set(e, r), be(e), e.addEventListener("reset", ve), e.addEventListener("input", me), e.addEventListener("change", we);
188
188
  }
189
- k.set(e, { ref: t, internals: i }), t.constructor.formAssociated && t.formAssociatedCallback && setTimeout(() => {
189
+ M.set(e, { ref: t, internals: i }), t.constructor.formAssociated && t.formAssociatedCallback && setTimeout(() => {
190
190
  t.formAssociatedCallback.apply(t, [e]);
191
- }, 0), I(e);
191
+ }, 0), V(e);
192
192
  }
193
- }, V = (t) => {
193
+ }, S = (t) => {
194
194
  let e = t.parentNode;
195
- return e && e.tagName !== "FORM" && (e = V(e)), e;
195
+ return e && e.tagName !== "FORM" && (e = S(e)), e;
196
196
  }, w = (t, e, i = DOMException) => {
197
197
  if (!t.constructor.formAssociated)
198
198
  throw new i(e);
199
- }, ee = (t, e, i) => {
200
- const a = y.get(t);
199
+ }, te = (t, e, i) => {
200
+ const a = g.get(t);
201
201
  return a && a.size && a.forEach((r) => {
202
202
  l.get(r)[i]() || (e = !1);
203
203
  }), e;
204
- }, te = (t) => {
204
+ }, ie = (t) => {
205
205
  if (t.constructor.formAssociated) {
206
206
  const e = l.get(t), { labels: i, form: a } = e;
207
- X(t, i), Z(t, a, e);
207
+ Z(t, i), ee(t, a, e);
208
208
  }
209
209
  };
210
210
  function T() {
211
211
  return typeof MutationObserver < "u";
212
212
  }
213
- class ve {
213
+ class ge {
214
214
  constructor() {
215
215
  this.badInput = !1, this.customError = !1, this.patternMismatch = !1, this.rangeOverflow = !1, this.rangeUnderflow = !1, this.stepMismatch = !1, this.tooLong = !1, this.tooShort = !1, this.typeMismatch = !1, this.valid = !0, this.valueMissing = !1, Object.seal(this);
216
216
  }
217
217
  }
218
- const ge = (t) => (t.badInput = !1, t.customError = !1, t.patternMismatch = !1, t.rangeOverflow = !1, t.rangeUnderflow = !1, t.stepMismatch = !1, t.tooLong = !1, t.tooShort = !1, t.typeMismatch = !1, t.valid = !0, t.valueMissing = !1, t), ye = (t, e, i) => (t.valid = Ee(e), Object.keys(e).forEach((a) => t[a] = e[a]), i && I(i), t), Ee = (t) => {
218
+ const ye = (t) => (t.badInput = !1, t.customError = !1, t.patternMismatch = !1, t.rangeOverflow = !1, t.rangeUnderflow = !1, t.stepMismatch = !1, t.tooLong = !1, t.tooShort = !1, t.typeMismatch = !1, t.valid = !0, t.valueMissing = !1, t), Ee = (t, e, i) => (t.valid = ke(e), Object.keys(e).forEach((a) => t[a] = e[a]), i && V(i), t), ke = (t) => {
219
219
  let e = !0;
220
220
  for (let i in t)
221
221
  i !== "valid" && t[i] !== !1 && (e = !1);
222
222
  return e;
223
223
  }, R = /* @__PURE__ */ new WeakMap();
224
- function ie(t, e) {
224
+ function ae(t, e) {
225
225
  t.toggleAttribute(e, !0), t.part && t.part.add(e);
226
226
  }
227
227
  class D extends Set {
@@ -237,8 +237,8 @@ import "@justeattakeaway/pie-icons-webc/dist/IconCheck.js";
237
237
  if (!/^--/.test(e) || typeof e != "string")
238
238
  throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${e} must start with '--'.`);
239
239
  const i = super.add(e), a = R.get(this), r = `state${e}`;
240
- return a.isConnected ? ie(a, r) : setTimeout(() => {
241
- ie(a, r);
240
+ return a.isConnected ? ae(a, r) : setTimeout(() => {
241
+ ae(a, r);
242
242
  }), i;
243
243
  }
244
244
  clear() {
@@ -253,26 +253,19 @@ import "@justeattakeaway/pie-icons-webc/dist/IconCheck.js";
253
253
  }), i;
254
254
  }
255
255
  }
256
- function ae(t, e, i, a) {
257
- if (i === "a" && !a)
258
- throw new TypeError("Private accessor was defined without a getter");
259
- if (typeof e == "function" ? t !== e || !a : !e.has(t))
260
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
256
+ function re(t, e, i, a) {
257
+ if (i === "a" && !a) throw new TypeError("Private accessor was defined without a getter");
258
+ if (typeof e == "function" ? t !== e || !a : !e.has(t)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
261
259
  return i === "m" ? a : i === "a" ? a.call(t) : a ? a.value : e.get(t);
262
260
  }
263
- function ke(t, e, i, a, r) {
264
- if (a === "m")
265
- throw new TypeError("Private method is not writable");
266
- if (a === "a" && !r)
267
- throw new TypeError("Private accessor was defined without a setter");
268
- if (typeof e == "function" ? t !== e || !r : !e.has(t))
269
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
270
- return a === "a" ? r.call(t, i) : r ? r.value = i : e.set(t, i), i;
261
+ function Me(t, e, i, a, r) {
262
+ if (typeof e == "function" ? t !== e || !r : !e.has(t)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
263
+ return e.set(t, i), i;
271
264
  }
272
265
  var C;
273
- class Me {
266
+ class Ce {
274
267
  constructor(e) {
275
- C.set(this, void 0), ke(this, C, e, "f");
268
+ C.set(this, void 0), Me(this, C, e);
276
269
  for (let i = 0; i < e.length; i++) {
277
270
  let a = e[i];
278
271
  this[i] = a, a.hasAttribute("name") && (this[a.getAttribute("name")] = a);
@@ -280,10 +273,10 @@ import "@justeattakeaway/pie-icons-webc/dist/IconCheck.js";
280
273
  Object.freeze(this);
281
274
  }
282
275
  get length() {
283
- return ae(this, C, "f").length;
276
+ return re(this, C, "f").length;
284
277
  }
285
278
  [(C = /* @__PURE__ */ new WeakMap(), Symbol.iterator)]() {
286
- return ae(this, C, "f")[Symbol.iterator]();
279
+ return re(this, C, "f")[Symbol.iterator]();
287
280
  }
288
281
  item(e) {
289
282
  return this[e] == null ? null : this[e];
@@ -292,39 +285,39 @@ import "@justeattakeaway/pie-icons-webc/dist/IconCheck.js";
292
285
  return this[e] == null ? null : this[e];
293
286
  }
294
287
  }
295
- function Ce() {
288
+ function Ae() {
296
289
  const t = HTMLFormElement.prototype.checkValidity;
297
290
  HTMLFormElement.prototype.checkValidity = i;
298
291
  const e = HTMLFormElement.prototype.reportValidity;
299
292
  HTMLFormElement.prototype.reportValidity = a;
300
293
  function i(...s) {
301
294
  let n = t.apply(this, s);
302
- return ee(this, n, "checkValidity");
295
+ return te(this, n, "checkValidity");
303
296
  }
304
297
  function a(...s) {
305
298
  let n = e.apply(this, s);
306
- return ee(this, n, "reportValidity");
299
+ return te(this, n, "reportValidity");
307
300
  }
308
301
  const { get: r } = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, "elements");
309
302
  Object.defineProperty(HTMLFormElement.prototype, "elements", {
310
303
  get(...s) {
311
- const n = r.call(this, ...s), u = Array.from(y.get(this) || []);
312
- if (u.length === 0)
304
+ const n = r.call(this, ...s), h = Array.from(g.get(this) || []);
305
+ if (h.length === 0)
313
306
  return n;
314
- const d = Array.from(n).concat(u).sort((b, f) => b.compareDocumentPosition ? b.compareDocumentPosition(f) & 2 ? 1 : -1 : 0);
315
- return new Me(d);
307
+ const d = Array.from(n).concat(h).sort((b, f) => b.compareDocumentPosition ? b.compareDocumentPosition(f) & 2 ? 1 : -1 : 0);
308
+ return new Ce(d);
316
309
  }
317
310
  });
318
311
  }
319
- class re {
312
+ class oe {
320
313
  static get isPolyfilled() {
321
314
  return !0;
322
315
  }
323
316
  constructor(e) {
324
317
  if (!e || !e.tagName || e.tagName.indexOf("-") === -1)
325
318
  throw new TypeError("Illegal constructor");
326
- const i = e.getRootNode(), a = new ve();
327
- this.states = new D(e), o.set(this, e), c.set(this, a), l.set(e, this), de(e, this), pe(e, this), Object.seal(this), i instanceof DocumentFragment && ue(i);
319
+ const i = e.getRootNode(), a = new ge();
320
+ this.states = new D(e), o.set(this, e), c.set(this, a), l.set(e, this), he(e, this), fe(e, this), Object.seal(this), i instanceof DocumentFragment && pe(i);
328
321
  }
329
322
  checkValidity() {
330
323
  const e = o.get(this);
@@ -345,7 +338,7 @@ import "@justeattakeaway/pie-icons-webc/dist/IconCheck.js";
345
338
  const e = o.get(this);
346
339
  w(e, "Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");
347
340
  let i;
348
- return e.constructor.formAssociated === !0 && (i = V(e)), i;
341
+ return e.constructor.formAssociated === !0 && (i = S(e)), i;
349
342
  }
350
343
  get labels() {
351
344
  const e = o.get(this);
@@ -357,50 +350,49 @@ import "@justeattakeaway/pie-icons-webc/dist/IconCheck.js";
357
350
  const e = o.get(this);
358
351
  if (w(e, "Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
359
352
  return !0;
360
- const i = this.checkValidity(), a = B.get(this);
353
+ const i = this.checkValidity(), a = U.get(this);
361
354
  if (a && !e.constructor.formAssociated)
362
355
  throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");
363
356
  return !i && a && (e.focus(), a.focus()), i;
364
357
  }
365
358
  setFormValue(e) {
366
359
  const i = o.get(this);
367
- if (w(i, "Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."), J(this), e != null && !(e instanceof FormData)) {
360
+ if (w(i, "Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."), Q(this), e != null && !(e instanceof FormData)) {
368
361
  if (i.getAttribute("name")) {
369
- const a = Q(i, this);
362
+ const a = X(i, this);
370
363
  a.value = e;
371
364
  }
372
- } else
373
- e != null && e instanceof FormData && Array.from(e).reverse().forEach(([a, r]) => {
374
- if (typeof r == "string") {
375
- const s = Q(i, this);
376
- s.name = a, s.value = r;
377
- }
378
- });
379
- z.set(i, e);
365
+ } else e != null && e instanceof FormData && Array.from(e).reverse().forEach(([a, r]) => {
366
+ if (typeof r == "string") {
367
+ const s = X(i, this);
368
+ s.name = a, s.value = r;
369
+ }
370
+ });
371
+ q.set(i, e);
380
372
  }
381
373
  setValidity(e, i, a) {
382
374
  const r = o.get(this);
383
375
  if (w(r, "Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !e)
384
376
  throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");
385
- B.set(this, a);
377
+ U.set(this, a);
386
378
  const s = c.get(this), n = {};
387
379
  for (const b in e)
388
380
  n[b] = e[b];
389
- Object.keys(n).length === 0 && ge(s);
390
- const u = Object.assign(Object.assign({}, s), n);
391
- delete u.valid;
392
- const { valid: d } = ye(s, u, this.form);
381
+ Object.keys(n).length === 0 && ye(s);
382
+ const h = Object.assign(Object.assign({}, s), n);
383
+ delete h.valid;
384
+ const { valid: d } = Ee(s, h, this.form);
393
385
  if (!d && !i)
394
386
  throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");
395
- g.set(this, d ? "" : i), r.isConnected ? (r.toggleAttribute("internals-invalid", !d), r.toggleAttribute("internals-valid", d), r.setAttribute("aria-invalid", `${!d}`)) : x.set(r, this);
387
+ v.set(this, d ? "" : i), r.isConnected ? (r.toggleAttribute("internals-invalid", !d), r.toggleAttribute("internals-valid", d), r.setAttribute("aria-invalid", `${!d}`)) : x.set(r, this);
396
388
  }
397
389
  get shadowRoot() {
398
- const e = o.get(this), i = q.get(e);
390
+ const e = o.get(this), i = B.get(e);
399
391
  return i || null;
400
392
  }
401
393
  get validationMessage() {
402
394
  const e = o.get(this);
403
- return w(e, "Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."), g.get(this);
395
+ return w(e, "Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."), v.get(this);
404
396
  }
405
397
  get validity() {
406
398
  const e = o.get(this);
@@ -411,7 +403,7 @@ import "@justeattakeaway/pie-icons-webc/dist/IconCheck.js";
411
403
  return w(e, "Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."), !(e.disabled || e.hasAttribute("disabled") || e.hasAttribute("readonly"));
412
404
  }
413
405
  }
414
- function Ae() {
406
+ function xe() {
415
407
  if (typeof window > "u" || !window.ElementInternals || !HTMLElement.prototype.attachInternals)
416
408
  return !1;
417
409
  class t extends HTMLElement {
@@ -435,22 +427,22 @@ import "@justeattakeaway/pie-icons-webc/dist/IconCheck.js";
435
427
  "reportValidity"
436
428
  ].every((a) => a in i.internals);
437
429
  }
438
- let oe = !1, se = !1;
430
+ let se = !1, ne = !1;
439
431
  function H(t) {
440
- se || (se = !0, window.CustomStateSet = D, t && (HTMLElement.prototype.attachInternals = function(...e) {
432
+ ne || (ne = !0, window.CustomStateSet = D, t && (HTMLElement.prototype.attachInternals = function(...e) {
441
433
  const i = t.call(this, e);
442
434
  return i.states = new D(this), i;
443
435
  }));
444
436
  }
445
- function ne(t = !0) {
446
- if (!oe) {
447
- if (oe = !0, typeof window < "u" && (window.ElementInternals = re), typeof CustomElementRegistry < "u") {
437
+ function le(t = !0) {
438
+ if (!se) {
439
+ if (se = !0, typeof window < "u" && (window.ElementInternals = oe), typeof CustomElementRegistry < "u") {
448
440
  const e = CustomElementRegistry.prototype.define;
449
441
  CustomElementRegistry.prototype.define = function(i, a, r) {
450
442
  if (a.formAssociated) {
451
443
  const s = a.prototype.connectedCallback;
452
444
  a.prototype.connectedCallback = function() {
453
- j.has(this) || (j.set(this, !0), this.hasAttribute("disabled") && $(this, !0)), s != null && s.apply(this), te(this);
445
+ K.has(this) || (K.set(this, !0), this.hasAttribute("disabled") && $(this, !0)), s != null && s.apply(this), ie(this);
454
446
  };
455
447
  }
456
448
  e.call(this, i, a, r);
@@ -460,46 +452,43 @@ import "@justeattakeaway/pie-icons-webc/dist/IconCheck.js";
460
452
  if (this.tagName) {
461
453
  if (this.tagName.indexOf("-") === -1)
462
454
  throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.");
463
- } else
464
- return {};
455
+ } else return {};
465
456
  if (l.has(this))
466
457
  throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");
467
- return new re(this);
458
+ return new oe(this);
468
459
  }), typeof Element < "u") {
469
460
  let e = function(...a) {
470
461
  const r = i.apply(this, a);
471
- if (q.set(this, r), T()) {
472
- const s = new MutationObserver(O);
473
- window.ShadyDOM ? s.observe(this, _) : s.observe(r, _), P.set(this, s);
462
+ if (B.set(this, r), T()) {
463
+ const s = new MutationObserver(P);
464
+ window.ShadyDOM ? s.observe(this, _) : s.observe(r, _), O.set(this, s);
474
465
  }
475
466
  return r;
476
467
  };
477
468
  const i = Element.prototype.attachShadow;
478
469
  Element.prototype.attachShadow = e;
479
470
  }
480
- T() && typeof document < "u" && new MutationObserver(O).observe(document.documentElement, _), typeof HTMLFormElement < "u" && Ce(), (t || typeof window < "u" && !window.CustomStateSet) && H();
471
+ T() && typeof document < "u" && new MutationObserver(P).observe(document.documentElement, _), typeof HTMLFormElement < "u" && Ae(), (t || typeof window < "u" && !window.CustomStateSet) && H();
481
472
  }
482
473
  }
483
- return !!customElements.polyfillWrapFlushCallback || (Ae() ? typeof window < "u" && !window.CustomStateSet && H(HTMLElement.prototype.attachInternals) : ne(!1)), v.forceCustomStateSetPolyfill = H, v.forceElementInternalsPolyfill = ne, Object.defineProperty(v, "__esModule", { value: !0 }), v;
474
+ return !!customElements.polyfillWrapFlushCallback || (xe() ? typeof window < "u" && !window.CustomStateSet && H(HTMLElement.prototype.attachInternals) : le(!1)), E.forceCustomStateSetPolyfill = H, E.forceElementInternalsPolyfill = le, Object.defineProperty(E, "__esModule", { value: !0 }), E;
484
475
  })({});
485
476
  })();
486
- const Oe = `*,*:after,*:before{box-sizing:inherit}*,*:before,*:after{cursor:inherit}.c-switch-wrapper{display:inline-flex;align-items:center;gap:var(--dt-spacing-b);font-family:var(--dt-font-body-l-family);cursor:pointer}.c-switch-wrapper[disabled]{cursor:not-allowed}.c-switch{--switch-bg-color: var(--dt-color-interactive-form);--switch-bg-color--checked: var(--dt-color-interactive-brand);--switch-bg-color--disabled: var(--dt-color-disabled-01);--switch-width: 48px;--switch-height: 24px;--switch-control-size: 20px;--switch-padding: 2px;--switch-radius: var(--dt-radius-rounded-e);--switch-translation: calc(var(--switch-width) - var(--switch-control-size) - 2 * var(--switch-padding));position:relative;display:flex;width:var(--switch-width);height:var(--switch-height);flex-shrink:0;padding:var(--switch-padding);border-radius:var(--switch-radius);background-color:var(--switch-bg-color)}@media (prefers-reduced-motion: no-preference){.c-switch{transition:background-color .15s cubic-bezier(.4,0,.9,1) 0s}}.c-switch:hover{background-color:hsl(var(--dt-color-interactive-form-h),var(--dt-color-interactive-form-s),calc(var(--dt-color-interactive-form-l) - var(--dt-color-hover-01)))}.c-switch:focus,.c-switch:focus-within{box-shadow:0 0 0 2px var(--dt-color-focus-inner),0 0 0 4px var(--dt-color-focus-outer);outline:none}.c-switch:active{background-color:hsl(var(--dt-color-interactive-form-h),var(--dt-color-interactive-form-s),calc(var(--dt-color-interactive-form-l) - var(--dt-color-active-01)))}.c-switch[checked]{background-color:var(--switch-bg-color--checked)}@media (prefers-reduced-motion: no-preference){.c-switch[checked]{transition:background-color .15s cubic-bezier(.4,0,.9,1) 0s}}.c-switch[checked]:hover{background-color:hsl(var(--dt-color-interactive-brand-h),var(--dt-color-interactive-brand-s),calc(var(--dt-color-interactive-brand-l) - var(--dt-color-hover-01)))}.c-switch[checked]:focus,.c-switch[checked]:focus-within{background-color:var(--switch-bg-color--checked)}.c-switch[checked]:active{background-color:hsl(var(--dt-color-interactive-brand-h),var(--dt-color-interactive-brand-s),calc(var(--dt-color-interactive-brand-l) - var(--dt-color-active-01)))}[disabled] .c-switch{background-color:var(--switch-bg-color--disabled);pointer-events:none}.c-switch-input{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;left:50%;transform:translate(-50%) translateY(-50%);bottom:0}.c-switch-input:disabled{background-color:transparent}.c-switch-control{position:absolute;left:2px;width:var(--switch-control-size);height:var(--switch-control-size);border-radius:var(--switch-radius);background-color:var(--dt-color-interactive-light);padding:var(--switch-padding)}@media (prefers-reduced-motion: no-preference){.c-switch-control{transition:transform .15s cubic-bezier(.4,0,.9,1) 0s}}.c-switch-wrapper--rtl .c-switch-control{position:absolute;left:initial;right:2px}.c-switch-input:checked+.c-switch-control{transform:translate(var(--switch-translation))}@media (prefers-reduced-motion: no-preference){.c-switch-input:checked+.c-switch-control{transition:transform .15s cubic-bezier(.4,0,.9,1) 0s}}.c-switch-input:checked+.c-switch-control .c-pieIcon--check{color:var(--switch-bg-color--checked)}@media (prefers-reduced-motion: no-preference){.c-switch-input:checked+.c-switch-control .c-pieIcon--check{transition:color .15s cubic-bezier(.4,0,.9,1) 0s}}.c-switch-input:disabled~.c-switch-control{color:var(--switch-bg-color--disabled)}.c-switch-input:disabled~.c-switch-control .c-pieIcon--check{color:var(--switch-bg-color--disabled)}@media (prefers-reduced-motion: no-preference){.c-switch-input:disabled~.c-switch-control .c-pieIcon--check{transition:color .15s cubic-bezier(.4,0,.9,1) 0s}}.c-switch-description{position:absolute;display:block;height:1px;width:1px;overflow:hidden;padding:1px;white-space:nowrap}.c-switch-wrapper--rtl .c-switch-input:checked+.c-switch-control{transform:translate(calc(-1 * var(--switch-translation)))}@media (prefers-reduced-motion: no-preference){.c-switch-wrapper--rtl .c-switch-input:checked+.c-switch-control{transition:transform .15s cubic-bezier(.4,0,.9,1) 0s}}
487
- `, _e = ["leading", "trailing"], je = "change", M = {
477
+ const _e = "*,*:after,*:before{box-sizing:inherit}*,*:before,*:after{cursor:inherit}.c-switch-wrapper{display:inline-flex;align-items:center;gap:var(--dt-spacing-b);font-family:var(--dt-font-body-l-family);cursor:pointer}.c-switch-wrapper[disabled]{cursor:not-allowed}.c-switch{--switch-bg-color: var(--dt-color-interactive-form);--switch-bg-color--checked: var(--dt-color-interactive-brand);--switch-bg-color--disabled: var(--dt-color-disabled-01);--switch-width: 48px;--switch-height: 24px;--switch-control-size: 20px;--switch-padding: 2px;--switch-radius: var(--dt-radius-rounded-e);--switch-translation: calc(var(--switch-width) - var(--switch-control-size) - 2 * var(--switch-padding));position:relative;display:flex;width:var(--switch-width);height:var(--switch-height);flex-shrink:0;padding:var(--switch-padding);border-radius:var(--switch-radius);background-color:var(--switch-bg-color)}@media (prefers-reduced-motion: no-preference){.c-switch{transition:background-color .15s cubic-bezier(.4,0,.9,1) 0s}}.c-switch:hover{background-color:hsl(var(--dt-color-interactive-form-h),var(--dt-color-interactive-form-s),calc(var(--dt-color-interactive-form-l) - var(--dt-color-hover-01)))}.c-switch:focus,.c-switch:focus-within{box-shadow:0 0 0 2px var(--dt-color-focus-inner),0 0 0 4px var(--dt-color-focus-outer);outline:none}.c-switch:active{background-color:hsl(var(--dt-color-interactive-form-h),var(--dt-color-interactive-form-s),calc(var(--dt-color-interactive-form-l) - var(--dt-color-active-01)))}.c-switch[checked]{background-color:var(--switch-bg-color--checked)}@media (prefers-reduced-motion: no-preference){.c-switch[checked]{transition:background-color .15s cubic-bezier(.4,0,.9,1) 0s}}.c-switch[checked]:hover{background-color:hsl(var(--dt-color-interactive-brand-h),var(--dt-color-interactive-brand-s),calc(var(--dt-color-interactive-brand-l) - var(--dt-color-hover-01)))}.c-switch[checked]:focus,.c-switch[checked]:focus-within{background-color:var(--switch-bg-color--checked)}.c-switch[checked]:active{background-color:hsl(var(--dt-color-interactive-brand-h),var(--dt-color-interactive-brand-s),calc(var(--dt-color-interactive-brand-l) - var(--dt-color-active-01)))}[disabled] .c-switch{background-color:var(--switch-bg-color--disabled);pointer-events:none}.c-switch-input{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;left:50%;transform:translate(-50%) translateY(-50%);bottom:0}.c-switch-input:disabled{background-color:transparent}.c-switch-control{position:absolute;left:2px;width:var(--switch-control-size);height:var(--switch-control-size);border-radius:var(--switch-radius);background-color:var(--dt-color-interactive-light);padding:var(--switch-padding)}@media (prefers-reduced-motion: no-preference){.c-switch-control{transition:transform .15s cubic-bezier(.4,0,.9,1) 0s}}.c-switch-wrapper--rtl .c-switch-control{position:absolute;left:initial;right:2px}.c-switch-input:checked+.c-switch-control{transform:translate(var(--switch-translation))}@media (prefers-reduced-motion: no-preference){.c-switch-input:checked+.c-switch-control{transition:transform .15s cubic-bezier(.4,0,.9,1) 0s}}.c-switch-input:checked+.c-switch-control .c-pieIcon--check{color:var(--switch-bg-color--checked)}@media (prefers-reduced-motion: no-preference){.c-switch-input:checked+.c-switch-control .c-pieIcon--check{transition:color .15s cubic-bezier(.4,0,.9,1) 0s}}.c-switch-input:disabled~.c-switch-control{color:var(--switch-bg-color--disabled)}.c-switch-input:disabled~.c-switch-control .c-pieIcon--check{color:var(--switch-bg-color--disabled)}@media (prefers-reduced-motion: no-preference){.c-switch-input:disabled~.c-switch-control .c-pieIcon--check{transition:color .15s cubic-bezier(.4,0,.9,1) 0s}}.c-switch-description{position:absolute;display:block;height:1px;width:1px;overflow:hidden;padding:1px;white-space:nowrap}.c-switch-wrapper--rtl .c-switch-input:checked+.c-switch-control{transform:translate(calc(-1 * var(--switch-translation)))}@media (prefers-reduced-motion: no-preference){.c-switch-wrapper--rtl .c-switch-input:checked+.c-switch-control{transition:transform .15s cubic-bezier(.4,0,.9,1) 0s}}", $e = ["leading", "trailing"], je = "change", k = {
488
478
  checked: !1,
489
479
  disabled: !1,
490
480
  labelPlacement: "leading",
491
481
  required: !1,
492
482
  value: "on"
493
483
  };
494
- var $e = Object.defineProperty, Re = Object.getOwnPropertyDescriptor, m = (v, o, c, h) => {
495
- for (var l = h > 1 ? void 0 : h ? Re(o, c) : o, g = v.length - 1, k; g >= 0; g--)
496
- (k = v[g]) && (l = (h ? k(o, c, l) : k(l)) || l);
497
- return h && l && $e(o, c, l), l;
484
+ var Re = Object.defineProperty, m = (E, o, c, u) => {
485
+ for (var l = void 0, v = E.length - 1, M; v >= 0; v--)
486
+ (M = E[v]) && (l = M(o, c, l) || l);
487
+ return l && Re(o, c, l), l;
498
488
  };
499
- const ce = "pie-switch";
500
- class p extends Ve(Te(xe)) {
489
+ const de = "pie-switch", z = class z extends Te(Le(Fe)) {
501
490
  constructor() {
502
- super(...arguments), this.labelPlacement = M.labelPlacement, this.checked = M.checked, this.required = M.required, this.value = M.value, this.disabled = M.disabled;
491
+ super(...arguments), this.labelPlacement = k.labelPlacement, this.checked = k.checked, this.required = k.required, this.value = k.value, this.disabled = k.disabled;
503
492
  }
504
493
  firstUpdated() {
505
494
  var o;
@@ -523,8 +512,8 @@ class p extends Ve(Te(xe)) {
523
512
  handleChange(o) {
524
513
  const { checked: c } = o == null ? void 0 : o.currentTarget;
525
514
  this.checked = c;
526
- const h = Le(o);
527
- this.dispatchEvent(h), this.handleFormAssociation();
515
+ const u = Ne(o);
516
+ this.dispatchEvent(u), this.handleFormAssociation();
528
517
  }
529
518
  /**
530
519
  * Returns a boolean value which indicates validity of the value of the component. If the value is invalid, this method also fires the invalid event on the component.
@@ -572,9 +561,9 @@ class p extends Ve(Te(xe)) {
572
561
  * @private
573
562
  */
574
563
  renderSwitchLabel(o) {
575
- const { label: c, labelPlacement: h } = this;
576
- return !c || h !== o ? L : N`
577
- <span data-test-id="switch-label-${h}">
564
+ const { label: c, labelPlacement: u } = this;
565
+ return !c || u !== o ? L : N`
566
+ <span data-test-id="switch-label-${u}">
578
567
  ${c}
579
568
  </span>`;
580
569
  }
@@ -592,17 +581,17 @@ class p extends Ve(Te(xe)) {
592
581
  const {
593
582
  aria: o,
594
583
  checked: c,
595
- disabled: h,
584
+ disabled: u,
596
585
  isRTL: l,
597
- required: g
586
+ required: v
598
587
  } = this;
599
588
  return N`
600
589
  <label
601
- class="${Se({
590
+ class="${Ve({
602
591
  "c-switch-wrapper": !0,
603
592
  "c-switch-wrapper--rtl": l
604
593
  })}"
605
- ?disabled=${h}>
594
+ ?disabled=${u}>
606
595
  ${this.renderSwitchLabel("leading")}
607
596
  <div
608
597
  data-test-id="switch-component"
@@ -613,11 +602,11 @@ class p extends Ve(Te(xe)) {
613
602
  role="switch"
614
603
  type="checkbox"
615
604
  class="c-switch-input"
616
- .required=${g}
605
+ .required=${v}
617
606
  .checked="${c}"
618
- .disabled="${h}"
607
+ .disabled="${u}"
619
608
  @change="${this.handleChange}"
620
- aria-label="${Ie(o == null ? void 0 : o.label)}"
609
+ aria-label="${Se(o == null ? void 0 : o.label)}"
621
610
  aria-describedby="${o != null && o.describedBy ? "switch-description" : L}">
622
611
  <div class="c-switch-control">
623
612
  ${c ? N`<icon-check></icon-check>` : L}
@@ -627,43 +616,44 @@ class p extends Ve(Te(xe)) {
627
616
  ${this.renderAriaDescription()}
628
617
  </label>`;
629
618
  }
630
- }
631
- p.styles = Fe(Oe);
619
+ };
620
+ z.styles = Ie(_e);
621
+ let p = z;
632
622
  m([
633
- E({ type: String })
634
- ], p.prototype, "label", 2);
623
+ y({ type: String })
624
+ ], p.prototype, "label");
635
625
  m([
636
- E({ type: String }),
637
- Ne(ce, _e, M.labelPlacement)
638
- ], p.prototype, "labelPlacement", 2);
626
+ y({ type: String }),
627
+ Oe(de, $e, k.labelPlacement)
628
+ ], p.prototype, "labelPlacement");
639
629
  m([
640
- E({ type: Object })
641
- ], p.prototype, "aria", 2);
630
+ y({ type: Object })
631
+ ], p.prototype, "aria");
642
632
  m([
643
- E({ type: Boolean, reflect: !0 })
644
- ], p.prototype, "checked", 2);
633
+ y({ type: Boolean, reflect: !0 })
634
+ ], p.prototype, "checked");
645
635
  m([
646
- E({ type: Boolean, reflect: !0 })
647
- ], p.prototype, "required", 2);
636
+ y({ type: Boolean, reflect: !0 })
637
+ ], p.prototype, "required");
648
638
  m([
649
- E({ type: String })
650
- ], p.prototype, "value", 2);
639
+ y({ type: String })
640
+ ], p.prototype, "value");
651
641
  m([
652
- E({ type: String })
653
- ], p.prototype, "name", 2);
642
+ y({ type: String })
643
+ ], p.prototype, "name");
654
644
  m([
655
- E({ type: Boolean, reflect: !0 })
656
- ], p.prototype, "disabled", 2);
645
+ y({ type: Boolean, reflect: !0 })
646
+ ], p.prototype, "disabled");
657
647
  m([
658
- le('input[type="checkbox"]')
659
- ], p.prototype, "input", 2);
648
+ ce('input[type="checkbox"]')
649
+ ], p.prototype, "input");
660
650
  m([
661
- le("label")
662
- ], p.prototype, "focusTarget", 2);
663
- Pe(ce, p);
651
+ ce("label")
652
+ ], p.prototype, "focusTarget");
653
+ Pe(de, p);
664
654
  export {
665
655
  je as ON_SWITCH_CHANGED_EVENT,
666
656
  p as PieSwitch,
667
- M as defaultProps,
668
- _e as labelPlacements
657
+ k as defaultProps,
658
+ $e as labelPlacements
669
659
  };
package/dist/react.js CHANGED
@@ -1,27 +1,21 @@
1
- import * as t from "react";
2
- import { createComponent as e } from "@lit/react";
1
+ import * as e from "react";
2
+ import { createComponent as t } from "@lit/react";
3
3
  import { PieSwitch as i } from "./index.js";
4
- import { ON_SWITCH_CHANGED_EVENT as S, defaultProps as f, labelPlacements as C } from "./index.js";
5
- import "lit";
6
- import "lit/decorators.js";
7
- import "lit/directives/class-map.js";
8
- import "lit/directives/if-defined.js";
9
- import "@justeattakeaway/pie-webc-core";
10
- import "@justeattakeaway/pie-icons-webc/dist/IconCheck.js";
11
- const o = e({
4
+ import { ON_SWITCH_CHANGED_EVENT as s, defaultProps as l, labelPlacements as p } from "./index.js";
5
+ const a = t({
12
6
  displayName: "PieSwitch",
13
7
  elementClass: i,
14
- react: t,
8
+ react: e,
15
9
  tagName: "pie-switch",
16
10
  events: {
17
11
  onInvalid: "invalid",
18
12
  onChange: "change"
19
13
  // when the switch checked state is changed.
20
14
  }
21
- }), h = o;
15
+ }), n = a;
22
16
  export {
23
- S as ON_SWITCH_CHANGED_EVENT,
24
- h as PieSwitch,
25
- f as defaultProps,
26
- C as labelPlacements
17
+ s as ON_SWITCH_CHANGED_EVENT,
18
+ n as PieSwitch,
19
+ l as defaultProps,
20
+ p as labelPlacements
27
21
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@justeattakeaway/pie-switch",
3
3
  "description": "PIE Design System Switch built using Web Components",
4
- "version": "0.30.1",
4
+ "version": "0.30.3",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -37,13 +37,13 @@
37
37
  "devDependencies": {
38
38
  "@custom-elements-manifest/analyzer": "0.9.0",
39
39
  "@justeattakeaway/pie-components-config": "0.18.0",
40
- "@justeattakeaway/pie-css": "0.12.1",
40
+ "@justeattakeaway/pie-css": "0.13.1",
41
41
  "cem-plugin-module-file-extensions": "0.0.5"
42
42
  },
43
43
  "dependencies": {
44
- "@justeattakeaway/pie-icons-webc": "0.25.1",
45
- "@justeattakeaway/pie-webc-core": "0.24.0",
46
- "@justeattakeaway/pie-wrapper-react": "0.14.1",
44
+ "@justeattakeaway/pie-icons-webc": "0.25.3",
45
+ "@justeattakeaway/pie-webc-core": "0.24.2",
46
+ "@justeattakeaway/pie-wrapper-react": "0.14.2",
47
47
  "element-internals-polyfill": "1.3.11"
48
48
  },
49
49
  "volta": {
package/src/react.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
- import { createComponent, EventName } from '@lit/react';
2
+ import { createComponent, type EventName } from '@lit/react';
3
3
  import { PieSwitch as PieSwitchLit } from './index';
4
- import { SwitchProps } from './defs';
4
+ import { type SwitchProps } from './defs';
5
5
 
6
6
  export * from './defs';
7
7