@warp-ds/elements 1.2.0-next.3 → 1.2.0-next.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ var X = (t, e, r) => (Br(t, e, "read from private field"), r ? r.call(t) : e.get
9
9
  throw TypeError("Cannot add the same private member more than once");
10
10
  e instanceof WeakSet ? e.add(t) : e.set(t, r);
11
11
  };
12
- import { html as m, css as se } from "lit";
12
+ import { html as m, css as se, nothing as Pr } from "lit";
13
13
  import q from "@warp-ds/elements-core";
14
14
  import { ifDefined as I } from "lit/directives/if-defined.js";
15
15
  import { classMap as Yt } from "lit/directives/class-map.js";
@@ -87,7 +87,7 @@ const Te = {
87
87
  iconLoading: "animate-bounce",
88
88
  content: "self-center mr-8 py-4 last-child:mb-0",
89
89
  close: "bg-transparent ml-auto p-[8px] i-text-$color-toast-close-icon hover:i-text-$color-toast-close-icon-hover active:i-text-$color-toast-close-icon-active"
90
- }, Pr = "focus:outline-none appearance-none cursor-pointer bg-transparent border-0 m-0 p-0 inline-block", W = {
90
+ }, Ar = "focus:outline-none appearance-none cursor-pointer bg-transparent border-0 m-0 p-0 inline-block", W = {
91
91
  expandable: "will-change-height",
92
92
  expandableTitle: "font-bold i-text-$color-expandable-title-text",
93
93
  expandableBox: "i-bg-$color-expandable-background hover:i-bg-$color-expandable-background-hover py-0 px-0 " + oe.box,
@@ -100,7 +100,7 @@ const Te = {
100
100
  chevronCollapse: "rotate-180",
101
101
  expansion: "overflow-hidden",
102
102
  expansionNotExpanded: "h-0 invisible",
103
- button: Pr + " hover:underline focus:underline",
103
+ button: Ar + " hover:underline focus:underline",
104
104
  buttonBox: "w-full text-left relative inline-flex items-center " + oe.box,
105
105
  paddingTop: "pt-0",
106
106
  title: "flex justify-between items-center",
@@ -254,12 +254,12 @@ const Te = {
254
254
  helpText: "text-xs mt-4 block i-text-$color-helptext-text",
255
255
  helpTextValid: "i-text-$color-helptext-text-positive",
256
256
  helpTextInvalid: "i-text-$color-helptext-text-negative"
257
- }, tr = "absolute top-0 bottom-0 flex justify-center items-center focusable focus:[--w-outline-offset:-2px] bg-transparent ", Ar = {
257
+ }, tr = "absolute top-0 bottom-0 flex justify-center items-center focusable focus:[--w-outline-offset:-2px] bg-transparent ", Rr = {
258
258
  wrapper: tr + "right-0",
259
259
  wrapperWithLabel: "w-max pr-12",
260
260
  wrapperWithIcon: "w-40",
261
261
  label: "antialiased block relative cursor-default pb-0 font-bold text-xs i-text-$color-label-text"
262
- }, Rr = {
262
+ }, Mr = {
263
263
  wrapper: tr + "left-0",
264
264
  wrapperWithLabel: "w-max pl-12",
265
265
  wrapperWithIcon: "w-40",
@@ -270,13 +270,13 @@ const Te = {
270
270
  link: "i-text-$color-breadcrumbs-link-text",
271
271
  separator: "select-none i-text-$color-breadcrumbs-icon",
272
272
  a11y: "sr-only"
273
- }, Mr = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
273
+ }, Nr = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
274
274
  function Re(t) {
275
275
  return class extends t {
276
276
  static createProperty(e, r) {
277
277
  let i = r;
278
278
  (typeof (r == null ? void 0 : r.attribute) > "u" || (r == null ? void 0 : r.attribute) === !0) && (i = Object.assign({}, r, {
279
- attribute: Mr(e.toString())
279
+ attribute: Nr(e.toString())
280
280
  })), super.createProperty(e, i);
281
281
  }
282
282
  };
@@ -294,12 +294,12 @@ function G(t) {
294
294
  e[o] = i;
295
295
  return Yt(e);
296
296
  }
297
- function Nr() {
297
+ function Ir() {
298
298
  return `m${Math.random().toString(36).slice(2)}`;
299
299
  }
300
300
  class ht extends q {
301
301
  get _classBase() {
302
- return this.slot === "suffix" ? Ar : Rr;
302
+ return this.slot === "suffix" ? Rr : Mr;
303
303
  }
304
304
  get _classes() {
305
305
  return G({
@@ -467,7 +467,7 @@ function Mt(t, e, r) {
467
467
  }
468
468
  return f;
469
469
  }
470
- const Ir = async (t, e, r) => {
470
+ const Qr = async (t, e, r) => {
471
471
  const { placement: i = "bottom", strategy: o = "absolute", middleware: n = [], platform: a } = r, l = await (a.isRTL == null ? void 0 : a.isRTL(e));
472
472
  let d = await a.getElementRects({ reference: t, floating: e, strategy: o }), { x, y: w } = Mt(d, i, l), f = i, D = {}, h = 0;
473
473
  for (let y = 0; y < n.length; y++) {
@@ -490,11 +490,11 @@ async function ir(t, e) {
490
490
  const { x: i, y: o, platform: n, rects: a, elements: l, strategy: d } = t, { boundary: x = "clippingAncestors", rootBoundary: w = "viewport", elementContext: f = "floating", altBoundary: D = !1, padding: h = 0 } = e, y = rr(h), _ = l[D ? f === "floating" ? "reference" : "floating" : f], C = Je(await n.getClippingRect({ element: (r = await (n.isElement == null ? void 0 : n.isElement(_))) == null || r ? _ : _.contextElement || await (n.getDocumentElement == null ? void 0 : n.getDocumentElement(l.floating)), boundary: x, rootBoundary: w, strategy: d })), N = Je(n.convertOffsetParentRelativeRectToViewportRelativeRect ? await n.convertOffsetParentRelativeRectToViewportRelativeRect({ rect: f === "floating" ? { ...a.floating, x: i, y: o } : a.reference, offsetParent: await (n.getOffsetParent == null ? void 0 : n.getOffsetParent(l.floating)), strategy: d }) : a[f]);
491
491
  return { top: C.top - N.top + y.top, bottom: N.bottom - C.bottom + y.bottom, left: C.left - N.left + y.left, right: N.right - C.right + y.right };
492
492
  }
493
- const Qr = Math.min, Ur = Math.max;
493
+ const Ur = Math.min, Fr = Math.max;
494
494
  function ft(t, e, r) {
495
- return Ur(t, Qr(e, r));
495
+ return Fr(t, Ur(e, r));
496
496
  }
497
- const Fr = (t) => ({ name: "arrow", options: t, async fn(e) {
497
+ const Hr = (t) => ({ name: "arrow", options: t, async fn(e) {
498
498
  const { element: r, padding: i = 0 } = t ?? {}, { x: o, y: n, placement: a, rects: l, platform: d } = e;
499
499
  if (r == null)
500
500
  return {};
@@ -503,23 +503,23 @@ const Fr = (t) => ({ name: "arrow", options: t, async fn(e) {
503
503
  R === 0 && (R = l.floating[h]);
504
504
  const ie = N / 2 - Q / 2, J = x[_], P = R - y[h] - x[C], F = R / 2 - y[h] / 2 + ie, V = ft(J, F, P), Z = (D === "start" ? x[_] : x[C]) > 0 && F !== V && l.reference[h] <= l.floating[h];
505
505
  return { [f]: w[f] - (Z ? F < J ? J - F : P - F : 0), data: { [f]: V, centerOffset: F - V } };
506
- } }), Hr = { left: "right", right: "left", bottom: "top", top: "bottom" };
506
+ } }), jr = { left: "right", right: "left", bottom: "top", top: "bottom" };
507
507
  function Ge(t) {
508
- return t.replace(/left|right|bottom|top/g, (e) => Hr[e]);
508
+ return t.replace(/left|right|bottom|top/g, (e) => jr[e]);
509
509
  }
510
- function jr(t, e, r) {
510
+ function Wr(t, e, r) {
511
511
  r === void 0 && (r = !1);
512
512
  const i = nt(t), o = Ne(t), n = Bt(o);
513
513
  let a = o === "x" ? i === (r ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
514
514
  return e.reference[n] > e.floating[n] && (a = Ge(a)), { main: a, cross: Ge(a) };
515
515
  }
516
- const Wr = { start: "end", end: "start" };
516
+ const Vr = { start: "end", end: "start" };
517
517
  function Nt(t) {
518
- return t.replace(/start|end/g, (e) => Wr[e]);
518
+ return t.replace(/start|end/g, (e) => Vr[e]);
519
519
  }
520
- const Vr = ["top", "right", "bottom", "left"];
521
- Vr.reduce((t, e) => t.concat(e, e + "-start", e + "-end"), []);
522
- const zr = function(t) {
520
+ const zr = ["top", "right", "bottom", "left"];
521
+ zr.reduce((t, e) => t.concat(e, e + "-start", e + "-end"), []);
522
+ const Jr = function(t) {
523
523
  return t === void 0 && (t = {}), { name: "flip", options: t, async fn(e) {
524
524
  var r;
525
525
  const { placement: i, middlewareData: o, rects: n, initialPlacement: a, platform: l, elements: d } = e, { mainAxis: x = !0, crossAxis: w = !0, fallbackPlacements: f, fallbackStrategy: D = "bestFit", flipAlignment: h = !0, ...y } = t, _ = Me(i), C = f || (_ === a || !h ? [Ge(a)] : function(F) {
@@ -528,7 +528,7 @@ const zr = function(t) {
528
528
  }(a)), N = [a, ...C], Q = await ir(e, y), U = [];
529
529
  let R = ((r = o.flip) == null ? void 0 : r.overflows) || [];
530
530
  if (x && U.push(Q[_]), w) {
531
- const { main: F, cross: V } = jr(i, n, await (l.isRTL == null ? void 0 : l.isRTL(d.floating)));
531
+ const { main: F, cross: V } = Wr(i, n, await (l.isRTL == null ? void 0 : l.isRTL(d.floating)));
532
532
  U.push(Q[F], Q[V]);
533
533
  }
534
534
  if (R = [...R, { placement: i, overflows: U }], !U.every((F) => F <= 0)) {
@@ -552,7 +552,7 @@ const zr = function(t) {
552
552
  }
553
553
  return {};
554
554
  } };
555
- }, Jr = function(t) {
555
+ }, Gr = function(t) {
556
556
  return t === void 0 && (t = 0), { name: "offset", options: t, async fn(e) {
557
557
  const { x: r, y: i } = e, o = await async function(n, a) {
558
558
  const { placement: l, platform: d, elements: x } = n, w = await (d.isRTL == null ? void 0 : d.isRTL(x.floating)), f = Me(l), D = nt(l), h = Ne(l) === "x", y = ["left", "top"].includes(f) ? -1 : 1, _ = w && h ? -1 : 1, C = typeof a == "function" ? a(n) : a;
@@ -562,15 +562,15 @@ const zr = function(t) {
562
562
  return { x: r + o.x, y: i + o.y, data: o };
563
563
  } };
564
564
  };
565
- function Gr(t) {
565
+ function Kr(t) {
566
566
  return t === "x" ? "y" : "x";
567
567
  }
568
- const Kr = function(t) {
568
+ const Xr = function(t) {
569
569
  return t === void 0 && (t = {}), { name: "shift", options: t, async fn(e) {
570
570
  const { x: r, y: i, placement: o } = e, { mainAxis: n = !0, crossAxis: a = !1, limiter: l = { fn: (C) => {
571
571
  let { x: N, y: Q } = C;
572
572
  return { x: N, y: Q };
573
- } }, ...d } = t, x = { x: r, y: i }, w = await ir(e, d), f = Ne(Me(o)), D = Gr(f);
573
+ } }, ...d } = t, x = { x: r, y: i }, w = await ir(e, d), f = Ne(Me(o)), D = Kr(f);
574
574
  let h = x[f], y = x[D];
575
575
  if (n) {
576
576
  const C = f === "y" ? "bottom" : "right";
@@ -619,7 +619,7 @@ function st(t) {
619
619
  const { overflow: e, overflowX: r, overflowY: i } = Ie(t);
620
620
  return /auto|scroll|overlay|hidden/.test(e + i + r);
621
621
  }
622
- function Xr(t) {
622
+ function Yr(t) {
623
623
  return ["table", "td", "th"].includes(ne(t));
624
624
  }
625
625
  function It(t) {
@@ -649,7 +649,7 @@ function at(t) {
649
649
  function ar(t) {
650
650
  return ve(de(t)).left + at(t).scrollLeft;
651
651
  }
652
- function Yr(t, e, r) {
652
+ function Zr(t, e, r) {
653
653
  const i = re(e), o = de(e), n = ve(t, i && function(d) {
654
654
  const x = ve(d);
655
655
  return Ke(x.width) !== d.offsetWidth || Ke(x.height) !== d.offsetHeight;
@@ -673,7 +673,7 @@ function Ut(t) {
673
673
  function gt(t) {
674
674
  const e = ae(t);
675
675
  let r = Ut(t);
676
- for (; r && Xr(r) && getComputedStyle(r).position === "static"; )
676
+ for (; r && Yr(r) && getComputedStyle(r).position === "static"; )
677
677
  r = Ut(r);
678
678
  return r && (ne(r) === "html" || ne(r) === "body" && getComputedStyle(r).position === "static" && !It(r)) ? e : r || function(i) {
679
679
  let o = lr(i);
@@ -722,7 +722,7 @@ function Ht(t, e, r) {
722
722
  return Ie(l || n).direction === "rtl" && (w += Be(n.clientWidth, l ? l.clientWidth : 0) - d), { width: d, height: x, x: w, y: f };
723
723
  }(de(t)));
724
724
  }
725
- function Zr(t) {
725
+ function ei(t) {
726
726
  const e = ur(t), r = ["absolute", "fixed"].includes(Ie(t).position) && re(t) ? gt(t) : t;
727
727
  return Ee(r) ? e.filter((i) => Ee(i) && function(o, n) {
728
728
  const a = n.getRootNode == null ? void 0 : n.getRootNode();
@@ -739,9 +739,9 @@ function Zr(t) {
739
739
  return !1;
740
740
  }(i, r) && ne(i) !== "body") : [];
741
741
  }
742
- const ei = { getClippingRect: function(t) {
742
+ const ti = { getClippingRect: function(t) {
743
743
  let { element: e, boundary: r, rootBoundary: i, strategy: o } = t;
744
- const n = [...r === "clippingAncestors" ? Zr(e) : [].concat(r), i], a = n[0], l = n.reduce((d, x) => {
744
+ const n = [...r === "clippingAncestors" ? ei(e) : [].concat(r), i], a = n[0], l = n.reduce((d, x) => {
745
745
  const w = Ht(e, x, o);
746
746
  return d.top = Be(w.top, d.top), d.right = Qt(w.right, d.right), d.bottom = Qt(w.bottom, d.bottom), d.left = Be(w.left, d.left), d;
747
747
  }, Ht(e, a, o));
@@ -760,40 +760,40 @@ const ei = { getClippingRect: function(t) {
760
760
  return { ...e, x: e.x - a.scrollLeft + l.x, y: e.y - a.scrollTop + l.y };
761
761
  }, isElement: Ee, getDimensions: Ft, getOffsetParent: gt, getDocumentElement: de, getElementRects: (t) => {
762
762
  let { reference: e, floating: r, strategy: i } = t;
763
- return { reference: Yr(e, gt(r), i), floating: { ...Ft(r), x: 0, y: 0 } };
764
- }, getClientRects: (t) => Array.from(t.getClientRects()), isRTL: (t) => Ie(t).direction === "rtl" }, ti = (t, e, r) => Ir(t, e, { platform: ei, ...r }), Xe = "top", Ye = "bottom", bt = "left", mt = "right", Ue = {
763
+ return { reference: Zr(e, gt(r), i), floating: { ...Ft(r), x: 0, y: 0 } };
764
+ }, getClientRects: (t) => Array.from(t.getClientRects()), isRTL: (t) => Ie(t).direction === "rtl" }, ri = (t, e, r) => Qr(t, e, { platform: ti, ...r }), Xe = "top", Ye = "bottom", bt = "left", mt = "right", Ue = {
765
765
  [Xe]: Ye,
766
766
  [Ye]: Xe,
767
767
  [bt]: mt,
768
768
  [mt]: bt
769
- }, ri = {
769
+ }, ii = {
770
770
  [bt]: -45,
771
771
  [Xe]: 45,
772
772
  [mt]: 135,
773
773
  [Ye]: -135
774
- }, jt = "calc(50% - 7px)", ii = (t) => [Xe, Ye].includes(t);
775
- function oi({ actualDirection: t, directionName: e, arrowEl: r }) {
774
+ }, jt = "calc(50% - 7px)", oi = (t) => [Xe, Ye].includes(t);
775
+ function ni({ actualDirection: t, directionName: e, arrowEl: r }) {
776
776
  if (!r)
777
777
  return;
778
778
  t = e;
779
- const i = ii(e);
779
+ const i = oi(e);
780
780
  r.style.left = i ? jt : "", r.style.top = i ? "" : jt;
781
781
  }
782
- async function ni(t) {
782
+ async function si(t) {
783
783
  var o, n;
784
784
  if (!t.isShowing)
785
785
  return;
786
786
  if (await ((o = t == null ? void 0 : t.waitForDOM) == null ? void 0 : o.call(t)), t.isCallout)
787
- return oi(t);
788
- const e = await ti(t.targetEl, t.attentionEl, {
787
+ return ni(t);
788
+ const e = await ri(t.targetEl, t.attentionEl, {
789
789
  placement: t.directionName,
790
790
  middleware: [
791
791
  // Should we make this configurable, but have these as sane defaults?
792
- zr(),
793
- Jr(8),
794
- Kr({ padding: 16 }),
792
+ Jr(),
793
+ Gr(8),
794
+ Xr({ padding: 16 }),
795
795
  // @ts-ignore
796
- Fr({ element: t.noArrow ? void 0 : t.arrowEl })
796
+ Hr({ element: t.noArrow ? void 0 : t.arrowEl })
797
797
  // FIXME
798
798
  ]
799
799
  });
@@ -806,7 +806,7 @@ async function ni(t) {
806
806
  t.arrowEl && (t.arrowEl.style.left = r ? r + "px" : "", t.arrowEl.style.top = i ? i + "px" : "");
807
807
  }
808
808
  var vt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
809
- function si(t) {
809
+ function ai(t) {
810
810
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
811
811
  }
812
812
  var dr = {}, hr = {};
@@ -917,7 +917,7 @@ var dr = {}, hr = {};
917
917
  }
918
918
  t.unraw = D, t.default = D;
919
919
  })(dr);
920
- const ai = /* @__PURE__ */ si(dr);
920
+ const li = /* @__PURE__ */ ai(dr);
921
921
  var Pe = {}, pr = {}, fr = { exports: {} };
922
922
  (function(t) {
923
923
  (function(e, r) {
@@ -1284,13 +1284,13 @@ Use (?: … ) instead`);
1284
1284
  };
1285
1285
  });
1286
1286
  })(fr);
1287
- var li = fr.exports;
1287
+ var ci = fr.exports;
1288
1288
  (function(t) {
1289
1289
  var e = vt && vt.__importDefault || function(i) {
1290
1290
  return i && i.__esModule ? i : { default: i };
1291
1291
  };
1292
1292
  Object.defineProperty(t, "__esModule", { value: !0 }), t.lexer = t.states = void 0;
1293
- const r = e(li);
1293
+ const r = e(ci);
1294
1294
  t.states = {
1295
1295
  body: {
1296
1296
  doubleapos: { match: "''", value: () => "'" },
@@ -1354,7 +1354,7 @@ const br = pr, Fe = (t) => ({
1354
1354
  text: t.text,
1355
1355
  lineBreaks: t.lineBreaks
1356
1356
  }), ut = (t) => t === "plural" || t === "select" || t === "selectordinal";
1357
- function ci(t, e) {
1357
+ function ui(t, e) {
1358
1358
  let r = "", i = "";
1359
1359
  for (const n of e) {
1360
1360
  const a = n.ctx.text;
@@ -1377,7 +1377,7 @@ function ci(t, e) {
1377
1377
  ctx: Object.assign({}, e[0].ctx, { text: i })
1378
1378
  }];
1379
1379
  }
1380
- const ui = [
1380
+ const di = [
1381
1381
  "number",
1382
1382
  "date",
1383
1383
  "time",
@@ -1392,7 +1392,7 @@ class H extends Error {
1392
1392
  }
1393
1393
  }
1394
1394
  Pe.ParseError = H;
1395
- class di {
1395
+ class hi {
1396
1396
  constructor(e, r) {
1397
1397
  var i, o, n, a;
1398
1398
  this.lexer = br.lexer.reset(e), this.cardinalKeys = (i = r == null ? void 0 : r.cardinal) !== null && i !== void 0 ? i : Wt, this.ordinalKeys = (o = r == null ? void 0 : r.ordinal) !== null && o !== void 0 ? o : Wt, this.strict = (n = r == null ? void 0 : r.strict) !== null && n !== void 0 ? n : !1, this.strictPluralKeys = (a = r == null ? void 0 : r.strictPluralKeys) !== null && a !== void 0 ? a : !0;
@@ -1443,7 +1443,7 @@ class di {
1443
1443
  const i = Fe(e), o = this.lexer.next();
1444
1444
  if (!o)
1445
1445
  throw new H(null, "Unexpected message end");
1446
- if (i.text += o.text, i.lineBreaks += o.lineBreaks, this.strict && (o.type === "func-simple" || o.type === "func-args") && !ui.includes(o.value)) {
1446
+ if (i.text += o.text, i.lineBreaks += o.lineBreaks, this.strict && (o.type === "func-simple" || o.type === "func-args") && !di.includes(o.value)) {
1447
1447
  const n = `Invalid strict mode function arg type: ${o.value}`;
1448
1448
  throw new H(e, n);
1449
1449
  }
@@ -1471,7 +1471,7 @@ class di {
1471
1471
  throw new H(o, a);
1472
1472
  }
1473
1473
  let n = this.parseBody(this.strict ? !1 : r);
1474
- return this.strict && n.length > 0 && (n = ci(e, n)), {
1474
+ return this.strict && n.length > 0 && (n = ui(e, n)), {
1475
1475
  type: "function",
1476
1476
  arg: e.value,
1477
1477
  key: o.value,
@@ -1515,10 +1515,10 @@ class di {
1515
1515
  throw new H(null, "Unexpected message end");
1516
1516
  }
1517
1517
  }
1518
- function hi(t, e = {}) {
1519
- return new di(t, e).parse();
1518
+ function pi(t, e = {}) {
1519
+ return new hi(t, e).parse();
1520
1520
  }
1521
- gr = Pe.parse = hi;
1521
+ gr = Pe.parse = pi;
1522
1522
  function mr(t, e) {
1523
1523
  return t.filter((r) => r.type !== "content").length ? t.map((r) => {
1524
1524
  var n;
@@ -1548,7 +1548,7 @@ function mr(t, e) {
1548
1548
  ];
1549
1549
  }) : t.map((r) => e(r.value)).join("");
1550
1550
  }
1551
- function pi(t, e = (r) => r) {
1551
+ function fi(t, e = (r) => r) {
1552
1552
  try {
1553
1553
  return mr(gr(t), e);
1554
1554
  } catch (r) {
@@ -1557,7 +1557,7 @@ function pi(t, e = (r) => r) {
1557
1557
  Message: ${t}`), t;
1558
1558
  }
1559
1559
  }
1560
- const te = (t) => typeof t == "string", fi = (t) => typeof t == "function", Vt = /* @__PURE__ */ new Map();
1560
+ const te = (t) => typeof t == "string", gi = (t) => typeof t == "function", Vt = /* @__PURE__ */ new Map();
1561
1561
  function At(t) {
1562
1562
  return [...Array.isArray(t) ? t : [t], "en"];
1563
1563
  }
@@ -1594,7 +1594,7 @@ function et(t, e, r) {
1594
1594
  const i = e.join("-");
1595
1595
  return `${t}-${i}-${JSON.stringify(r)}`;
1596
1596
  }
1597
- const yr = /\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g, gi = (t, e, r = {}) => {
1597
+ const yr = /\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g, bi = (t, e, r = {}) => {
1598
1598
  e = e || t;
1599
1599
  const i = (n) => te(n) ? r[n] || { style: n } : n, o = (n, a) => {
1600
1600
  const l = Object.keys(r).length ? i("number") : {}, d = yt(e, n, l);
@@ -1615,9 +1615,9 @@ const yr = /\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g, gi = (t, e, r = {}) => {
1615
1615
  undefined: (n) => n
1616
1616
  };
1617
1617
  };
1618
- function bi(t, e, r) {
1618
+ function mi(t, e, r) {
1619
1619
  return (i, o = {}) => {
1620
- const n = gi(e, r, o), a = (d) => Array.isArray(d) ? d.reduce((x, w) => {
1620
+ const n = bi(e, r, o), a = (d) => Array.isArray(d) ? d.reduce((x, w) => {
1621
1621
  if (te(w))
1622
1622
  return x + w;
1623
1623
  const [f, D, h] = w;
@@ -1628,13 +1628,13 @@ function bi(t, e, r) {
1628
1628
  const _ = n[D](i[f], y);
1629
1629
  return _ == null ? x : x + _;
1630
1630
  }, "") : d, l = a(t);
1631
- return te(l) && yr.test(l) ? ai(l.trim()) : te(l) ? l.trim() : l;
1631
+ return te(l) && yr.test(l) ? li(l.trim()) : te(l) ? l.trim() : l;
1632
1632
  };
1633
1633
  }
1634
- var mi = Object.defineProperty, vi = (t, e, r) => e in t ? mi(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, yi = (t, e, r) => (vi(t, typeof e != "symbol" ? e + "" : e, r), r);
1635
- class $i {
1634
+ var vi = Object.defineProperty, yi = (t, e, r) => e in t ? vi(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, $i = (t, e, r) => (yi(t, typeof e != "symbol" ? e + "" : e, r), r);
1635
+ class xi {
1636
1636
  constructor() {
1637
- yi(this, "_events", {});
1637
+ $i(this, "_events", {});
1638
1638
  }
1639
1639
  on(e, r) {
1640
1640
  return this._hasEvent(e) || (this._events[e] = []), this._events[e].push(r), () => this.removeListener(e, r);
@@ -1652,8 +1652,8 @@ class $i {
1652
1652
  return Array.isArray(this._events[e]);
1653
1653
  }
1654
1654
  }
1655
- var xi = Object.defineProperty, wi = (t, e, r) => e in t ? xi(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, we = (t, e, r) => (wi(t, typeof e != "symbol" ? e + "" : e, r), r);
1656
- class _i extends $i {
1655
+ var wi = Object.defineProperty, _i = (t, e, r) => e in t ? wi(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, we = (t, e, r) => (_i(t, typeof e != "symbol" ? e + "" : e, r), r);
1656
+ class ki extends xi {
1657
1657
  constructor(e) {
1658
1658
  super(), we(this, "_locale"), we(this, "_locales"), we(this, "_localeData"), we(this, "_messages"), we(this, "_missing"), we(this, "t", this._.bind(this)), this._messages = {}, this._localeData = {}, e.missing != null && (this._missing = e.missing), e.messages != null && this.load(e.messages), e.localeData != null && this.loadLocaleData(e.localeData), (e.locale != null || e.locales != null) && this.activate(e.locale, e.locales);
1659
1659
  }
@@ -1704,10 +1704,10 @@ class _i extends $i {
1704
1704
  te(e) || (r = e.values || r, i = e.message, e = e.id);
1705
1705
  const n = !this.messages[e], a = this._missing;
1706
1706
  if (a && n)
1707
- return fi(a) ? a(this._locale, e) : a;
1707
+ return gi(a) ? a(this._locale, e) : a;
1708
1708
  n && this.emit("missing", { id: e, locale: this._locale });
1709
1709
  let l = this.messages[e] || i || e;
1710
- return process.env.NODE_ENV !== "production" && (l = te(l) ? pi(l) : l), te(l) && yr.test(l) ? JSON.parse(`"${l}"`) : te(l) ? l : bi(
1710
+ return process.env.NODE_ENV !== "production" && (l = te(l) ? fi(l) : l), te(l) && yr.test(l) ? JSON.parse(`"${l}"`) : te(l) ? l : mi(
1711
1711
  l,
1712
1712
  this._locale,
1713
1713
  this._locales
@@ -1720,13 +1720,13 @@ class _i extends $i {
1720
1720
  return yt(this._locales || this._locale, e, r);
1721
1721
  }
1722
1722
  }
1723
- function ki(t = {}) {
1724
- return new _i(t);
1723
+ function Si(t = {}) {
1724
+ return new ki(t);
1725
1725
  }
1726
- const z = ki(), Si = JSON.parse('{"attention.callout":"callout speech bubble","attention.aria.highlight":"highlighted speech bubble","attention.pointingDown":"pointing down","attention.pointingLeft":"pointing left","attention.pointingRight":"pointing right","attention.pointingUp":"pointing up","attention.popover":"popover speech bubble","attention.tooltip":"tooltip"}'), Ei = JSON.parse('{"attention.callout":"callout speech bubble","attention.aria.highlight":"highlighted speech bubble","attention.pointingDown":"pointing down","attention.pointingLeft":"pointing left","attention.pointingRight":"pointing right","attention.pointingUp":"pointing up","attention.popover":"popover speech bubble","attention.tooltip":"tooltip"}'), Ci = JSON.parse('{"attention.callout":"callout speech bubble","attention.aria.highlight":"highlighted speech bubble","attention.pointingDown":"pointing down","attention.pointingLeft":"pointing left","attention.pointingRight":"pointing right","attention.pointingUp":"pointing up","attention.popover":"popover speech bubble","attention.tooltip":"tooltip"}'), Li = ["en", "nb", "fi"], $r = "en", Jt = (t) => Li.find(
1726
+ const z = Si(), Ei = JSON.parse('{"attention.aria.callout":"callout speech bubble","attention.aria.highlight":"highlighted speech bubble","attention.aria.pointingDown":"pointing down","attention.aria.pointingLeft":"pointing left","attention.aria.pointingRight":"pointing right","attention.aria.pointingUp":"pointing up","attention.aria.popover":"popover speech bubble","attention.aria.tooltip":"tooltip"}'), Ci = JSON.parse('{"attention.aria.callout":"callout speech bubble","attention.aria.highlight":"highlighted speech bubble","attention.aria.pointingDown":"pointing down","attention.aria.pointingLeft":"pointing left","attention.aria.pointingRight":"pointing right","attention.aria.pointingUp":"pointing up","attention.aria.popover":"popover speech bubble","attention.aria.tooltip":"tooltip"}'), Li = JSON.parse('{"attention.aria.callout":"callout speech bubble","attention.aria.highlight":"highlighted speech bubble","attention.aria.pointingDown":"pointing down","attention.aria.pointingLeft":"pointing left","attention.aria.pointingRight":"pointing right","attention.aria.pointingUp":"pointing up","attention.aria.popover":"popover speech bubble","attention.aria.tooltip":"tooltip"}'), Ti = ["en", "nb", "fi"], $r = "en", Jt = (t) => Ti.find(
1727
1727
  (e) => t === e || t.toLowerCase().includes(e)
1728
1728
  ) || $r;
1729
- function Ti() {
1729
+ function Di() {
1730
1730
  if (typeof window > "u") {
1731
1731
  const t = process.env.NMP_LANGUAGE || Intl.DateTimeFormat().resolvedOptions().locale;
1732
1732
  return Jt(t);
@@ -1738,13 +1738,13 @@ function Ti() {
1738
1738
  return console.warn("could not detect locale, falling back to source locale", t), $r;
1739
1739
  }
1740
1740
  }
1741
- const Di = (t, e, r, i) => t === "nb" ? r : t === "fi" ? i : e, lt = (t, e, r) => {
1742
- const i = Ti(), o = Di(i, t, e, r);
1741
+ const Oi = (t, e, r, i) => t === "nb" ? r : t === "fi" ? i : e, lt = (t, e, r) => {
1742
+ const i = Di(), o = Oi(i, t, e, r);
1743
1743
  z.load(i, o), z.activate(i);
1744
1744
  };
1745
1745
  class $t extends Re(q) {
1746
1746
  constructor() {
1747
- super(), lt(Si, Ei, Ci), this.show = !1, this.tooltip = !1, this.callout = !1, this.popover = !1, this.highlight = !1, this.noArrow = !1;
1747
+ super(), lt(Ei, Ci, Li), this.show = !1, this.tooltip = !1, this.callout = !1, this.popover = !1, this.highlight = !1, this.noArrow = !1;
1748
1748
  }
1749
1749
  connectedCallback() {
1750
1750
  if (super.connectedCallback(), !this.placement || !Object.keys(Ue).includes(this.placement))
@@ -1781,31 +1781,31 @@ ${JSON.stringify(
1781
1781
  attentionEl: this._attentionEl,
1782
1782
  targetEl: this._targetEl,
1783
1783
  noArrow: this.noArrow
1784
- }, ni(this.attentionState);
1784
+ }, si(this.attentionState);
1785
1785
  }
1786
1786
  pointingAtDirection() {
1787
1787
  switch (Ue[this._actualDirection]) {
1788
1788
  case "top":
1789
1789
  return z._({
1790
- id: "attention.pointingUp",
1790
+ id: "attention.aria.pointingUp",
1791
1791
  message: "pointing up",
1792
1792
  comment: "Default screenreader message for top direction in the attention component"
1793
1793
  });
1794
1794
  case "right":
1795
1795
  return z._({
1796
- id: "attention.pointingRight",
1796
+ id: "attention.aria.pointingRight",
1797
1797
  message: "pointing right",
1798
1798
  comment: "Default screenreader message for right direction in the attention component"
1799
1799
  });
1800
1800
  case "bottom":
1801
1801
  return z._({
1802
- id: "attention.pointingDown",
1802
+ id: "attention.aria.pointingDown",
1803
1803
  message: "pointing down",
1804
1804
  comment: "Default screenreader message for bottom direction in the attention component"
1805
1805
  });
1806
1806
  case "left":
1807
1807
  return z._({
1808
- id: "attention.pointingLeft",
1808
+ id: "attention.aria.pointingLeft",
1809
1809
  message: "pointing left",
1810
1810
  comment: "Default screenreader message for left direction in the attention component"
1811
1811
  });
@@ -1817,19 +1817,19 @@ ${JSON.stringify(
1817
1817
  switch (!0) {
1818
1818
  case this.tooltip:
1819
1819
  return z._({
1820
- id: "attention.tooltip",
1820
+ id: "attention.aria.tooltip",
1821
1821
  message: "tooltip",
1822
1822
  comment: "Default screenreader message for tooltip in the attention component"
1823
1823
  });
1824
1824
  case this.callout:
1825
1825
  return z._({
1826
- id: "attention.callout",
1826
+ id: "attention.aria.callout",
1827
1827
  message: "callout speech bubble",
1828
1828
  comment: "Default screenreader message for callout speech bubble in the attention component"
1829
1829
  });
1830
1830
  case this.popover:
1831
1831
  return z._({
1832
- id: "attention.popover",
1832
+ id: "attention.aria.popover",
1833
1833
  message: "popover speech bubble",
1834
1834
  comment: "Default screenreader message for popover speech bubble in the attention component"
1835
1835
  });
@@ -1848,7 +1848,7 @@ ${JSON.stringify(
1848
1848
  }
1849
1849
  setAriaLabels() {
1850
1850
  if (this._targetEl && !this._targetEl.getAttribute("aria-details")) {
1851
- const e = this._messageEl.id || (this._messageEl.id = Nr());
1851
+ const e = this._messageEl.id || (this._messageEl.id = Ir());
1852
1852
  this._targetEl.setAttribute("aria-details", e);
1853
1853
  }
1854
1854
  }
@@ -1894,7 +1894,7 @@ ${JSON.stringify(
1894
1894
  id="arrow"
1895
1895
  role="img"
1896
1896
  class="${this._arrowClasses}"
1897
- style="transform:rotate(${ri[this._arrowDirection]}deg);
1897
+ style="transform:rotate(${ii[this._arrowDirection]}deg);
1898
1898
  margin-${// border alignment is off by a fraction of a pixel, this fixes it
1899
1899
  this._arrowDirection.charAt(0).toLowerCase() + this._arrowDirection.slice(1)}:-0.5px;"
1900
1900
  />`;
@@ -2008,9 +2008,12 @@ class wt extends q {
2008
2008
  [oe.bordered]: this.bordered
2009
2009
  });
2010
2010
  }
2011
+ get _optOutRoleWithDefault() {
2012
+ return this.role === "" ? Pr : this.role ?? "region";
2013
+ }
2011
2014
  render() {
2012
2015
  return m`
2013
- <div class="${this._class}">
2016
+ <div role="${this._optOutRoleWithDefault}" class="${this._class}">
2014
2017
  <slot></slot>
2015
2018
  </div>
2016
2019
  `;
@@ -2020,7 +2023,8 @@ T(wt, "properties", {
2020
2023
  bleed: { type: Boolean },
2021
2024
  bordered: { type: Boolean },
2022
2025
  info: { type: Boolean },
2023
- neutral: { type: Boolean }
2026
+ neutral: { type: Boolean },
2027
+ role: { type: String }
2024
2028
  }), // Slotted elements remain in lightDOM which allows for control of their style outside of shadowDOM.
2025
2029
  // ::slotted([Simple Selector]) confirms to Specificity rules, but (being simple) does not add weight to lightDOM skin selectors,
2026
2030
  // so never gets higher Specificity. Thus in order to overwrite style linked within shadowDOM, we need to use !important.
@@ -2037,15 +2041,15 @@ T(wt, "styles", [
2037
2041
  `
2038
2042
  ]);
2039
2043
  customElements.get("w-box") || customElements.define("w-box", wt);
2040
- function Oi(t, e) {
2044
+ function qi(t, e) {
2041
2045
  return t.flatMap((r) => [r, e]).slice(0, -1);
2042
2046
  }
2043
- const qi = JSON.parse('{"breadcrumbs.ariaLabel":"You are here"}'), Bi = JSON.parse('{"breadcrumbs.ariaLabel":"Her er du"}'), Pi = JSON.parse('{"breadcrumbs.ariaLabel":"Olet tässä"}'), Ai = m`<span class=${_e.separator}
2047
+ const Bi = JSON.parse('{"breadcrumbs.ariaLabel":"You are here"}'), Pi = JSON.parse('{"breadcrumbs.ariaLabel":"Her er du"}'), Ai = JSON.parse('{"breadcrumbs.ariaLabel":"Olet tässä"}'), Ri = m`<span class=${_e.separator}
2044
2048
  >/</span
2045
2049
  >`;
2046
2050
  class _t extends Re(q) {
2047
2051
  constructor() {
2048
- super(), lt(qi, Bi, Pi), this.ariaLabel = z._({
2052
+ super(), lt(Bi, Pi, Ai), this.ariaLabel = z._({
2049
2053
  id: "breadcrumbs.ariaLabel",
2050
2054
  message: "You are here",
2051
2055
  comment: "Default screenreader message for the breadcrumb component"
@@ -2066,7 +2070,7 @@ class _t extends Re(q) {
2066
2070
  i.tagName === "A" ? _e.link : _e.text
2067
2071
  ), i;
2068
2072
  });
2069
- this._children = Oi(r, Ai);
2073
+ this._children = qi(r, Ri);
2070
2074
  }
2071
2075
  render() {
2072
2076
  return m`
@@ -2146,7 +2150,7 @@ T(kt, "properties", {
2146
2150
  api: { type: String, attribute: !0, reflect: !0 }
2147
2151
  }), T(kt, "styles", [q.styles]);
2148
2152
  customElements.get("w-broadcast") || customElements.define("w-broadcast", kt);
2149
- const Ri = JSON.parse('{"button.aria.loading":"Loading..."}'), Mi = JSON.parse('{"button.aria.loading":"Laster..."}'), Ni = JSON.parse('{"button.aria.loading":"Ladataan..."}'), Gt = [
2153
+ const Mi = JSON.parse('{"button.aria.loading":"Loading..."}'), Ni = JSON.parse('{"button.aria.loading":"Laster..."}'), Ii = JSON.parse('{"button.aria.loading":"Ladataan..."}'), Gt = [
2150
2154
  "primary",
2151
2155
  "secondary",
2152
2156
  "negative",
@@ -2156,7 +2160,7 @@ const Ri = JSON.parse('{"button.aria.loading":"Loading..."}'), Mi = JSON.parse('
2156
2160
  ];
2157
2161
  class je extends Re(q) {
2158
2162
  constructor() {
2159
- super(), lt(Ri, Mi, Ni), this.variant = "secondary", this.ariaValueTextLoading = z._({
2163
+ super(), lt(Mi, Ni, Ii), this.variant = "secondary", this.ariaValueTextLoading = z._({
2160
2164
  id: "button.aria.loading",
2161
2165
  message: "Loading...",
2162
2166
  comment: "Screenreader message for buttons that are loading"
@@ -2437,7 +2441,7 @@ T(Et, "styles", [
2437
2441
  `
2438
2442
  ]);
2439
2443
  customElements.get("w-expandable") || customElements.define("w-expandable", Et);
2440
- const Ii = JSON.parse('{"select.label.optional":"(optional)"}'), Qi = JSON.parse('{"select.label.optional":"(valgfritt)"}'), Ui = JSON.parse('{"select.label.optional":"(valinnainen)"}');
2444
+ const Qi = JSON.parse('{"select.label.optional":"(optional)"}'), Ui = JSON.parse('{"select.label.optional":"(valgfritt)"}'), Fi = JSON.parse('{"select.label.optional":"(valinnainen)"}');
2441
2445
  var tt, xr, rt, wr, it, _r, ot, kr, ke, We, Se, Ve;
2442
2446
  class Ct extends Re(q) {
2443
2447
  constructor() {
@@ -2448,7 +2452,7 @@ class Ct extends Re(q) {
2448
2452
  ge(this, ot);
2449
2453
  ge(this, ke);
2450
2454
  ge(this, Se);
2451
- lt(Ii, Qi, Ui), this._options = this.innerHTML;
2455
+ lt(Qi, Ui, Fi), this._options = this.innerHTML;
2452
2456
  }
2453
2457
  render() {
2454
2458
  return m`<div class="${xe.wrapper}">
@@ -2659,7 +2663,7 @@ T(Lt, "styles", [
2659
2663
  `
2660
2664
  ]);
2661
2665
  customElements.get("w-textfield") || customElements.define("w-textfield", Lt);
2662
- function Yi(t, e) {
2666
+ function Zi(t, e) {
2663
2667
  if (!Ae)
2664
2668
  return;
2665
2669
  const r = customElements.get("w-toast-container").init(), i = {
@@ -2671,10 +2675,10 @@ function Yi(t, e) {
2671
2675
  };
2672
2676
  return r.set(i), i;
2673
2677
  }
2674
- function Zi(t) {
2678
+ function eo(t) {
2675
2679
  return Ae ? customElements.get("w-toast-container").init().del(t) : void 0;
2676
2680
  }
2677
- function eo(t, e) {
2681
+ function to(t, e) {
2678
2682
  if (!Ae)
2679
2683
  return;
2680
2684
  const r = customElements.get("w-toast-container").init();
@@ -2691,9 +2695,9 @@ const Er = (t) => {
2691
2695
  }, Cr = (t) => {
2692
2696
  const e = Sr ? "var(--f-expansion-duration, 0.3s)" : "0.01s";
2693
2697
  t.style.transition = `height ${e}`, t.style.backfaceVisibility = "hidden", t.style.overflow = "hidden";
2694
- }, Fi = (t, e) => () => {
2698
+ }, Hi = (t, e) => () => {
2695
2699
  t.style.height = "auto", t.style.overflow = null, e && e();
2696
- }, Hi = (t) => () => {
2700
+ }, ji = (t) => () => {
2697
2701
  t && t();
2698
2702
  }, Lr = (t, e) => {
2699
2703
  const r = (() => {
@@ -2701,7 +2705,7 @@ const Er = (t) => {
2701
2705
  return new Promise((n) => {
2702
2706
  e = n;
2703
2707
  });
2704
- })(), i = Fi(t, e);
2708
+ })(), i = Hi(t, e);
2705
2709
  Er(t), t.style.height = "auto";
2706
2710
  let o = t.scrollHeight;
2707
2711
  if (Rt && requestAnimationFrame(() => {
@@ -2714,7 +2718,7 @@ const Er = (t) => {
2714
2718
  return new Promise((n) => {
2715
2719
  e = n;
2716
2720
  });
2717
- })(), i = Hi(e);
2721
+ })(), i = ji(e);
2718
2722
  Er(t);
2719
2723
  let o = t.scrollHeight;
2720
2724
  if (Rt && requestAnimationFrame(() => {
@@ -3009,7 +3013,7 @@ export {
3009
3013
  Lt as WarpTextField,
3010
3014
  Tt as WarpToast,
3011
3015
  Dt as WarpToastContainer,
3012
- Zi as removeToast,
3013
- Yi as toast,
3014
- eo as updateToast
3016
+ eo as removeToast,
3017
+ Zi as toast,
3018
+ to as updateToast
3015
3019
  };