@warp-ds/elements 2.0.0-next.2 → 2.0.0-next.4

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.
Files changed (53) hide show
  1. package/dist/api.js +3 -6
  2. package/dist/api.js.map +1 -1
  3. package/dist/index.js +519 -603
  4. package/dist/index.js.map +4 -4
  5. package/dist/packages/affix/index.d.ts +13 -6
  6. package/dist/packages/affix/index.js +66 -113
  7. package/dist/packages/affix/index.js.map +4 -4
  8. package/dist/packages/alert/index.js +48 -114
  9. package/dist/packages/alert/index.js.map +3 -3
  10. package/dist/packages/attention/index.js +147 -179
  11. package/dist/packages/attention/index.js.map +4 -4
  12. package/dist/packages/badge/index.js +27 -77
  13. package/dist/packages/badge/index.js.map +4 -4
  14. package/dist/packages/box/index.d.ts +1 -1
  15. package/dist/packages/box/index.js +26 -68
  16. package/dist/packages/box/index.js.map +4 -4
  17. package/dist/packages/breadcrumbs/index.js +42 -103
  18. package/dist/packages/breadcrumbs/index.js.map +3 -3
  19. package/dist/packages/broadcast/index.js +2 -6
  20. package/dist/packages/broadcast/index.js.map +1 -1
  21. package/dist/packages/button/index.d.ts +6 -0
  22. package/dist/packages/button/index.js +101 -156
  23. package/dist/packages/button/index.js.map +3 -3
  24. package/dist/packages/card/index.d.ts +5 -5
  25. package/dist/packages/card/index.js +1462 -96
  26. package/dist/packages/card/index.js.map +4 -4
  27. package/dist/packages/card/locales/da/messages.d.mts +1 -0
  28. package/dist/packages/card/locales/en/messages.d.mts +1 -0
  29. package/dist/packages/card/locales/fi/messages.d.mts +1 -0
  30. package/dist/packages/card/locales/nb/messages.d.mts +1 -0
  31. package/dist/packages/expandable/index.d.ts +1 -6
  32. package/dist/packages/expandable/index.js +104 -135
  33. package/dist/packages/expandable/index.js.map +4 -4
  34. package/dist/packages/modal/index.js +51 -119
  35. package/dist/packages/modal/index.js.map +3 -3
  36. package/dist/packages/modal/modal-header.d.ts +1 -1
  37. package/dist/packages/modal/modal-main.d.ts +3 -3
  38. package/dist/packages/pill/index.js +53 -119
  39. package/dist/packages/pill/index.js.map +3 -3
  40. package/dist/packages/select/index.d.ts +9 -0
  41. package/dist/packages/select/index.js +90 -155
  42. package/dist/packages/select/index.js.map +3 -3
  43. package/dist/packages/textfield/index.d.ts +9 -5
  44. package/dist/packages/textfield/index.js +54 -89
  45. package/dist/packages/textfield/index.js.map +4 -4
  46. package/dist/packages/toast/api.d.ts +1 -1
  47. package/dist/packages/toast/index.js +118 -195
  48. package/dist/packages/toast/index.js.map +4 -4
  49. package/dist/packages/toast/toast-container.d.ts +1 -1
  50. package/dist/packages/toast/toast.d.ts +1 -2
  51. package/dist/packages/utils/index.d.ts +1 -1
  52. package/dist/packages/utils/unstyled-heading.d.ts +1 -1
  53. package/package.json +29 -30
@@ -52,10 +52,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
52
52
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
53
53
  mod
54
54
  ));
55
- var __publicField = (obj, key, value) => {
56
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
57
- return value;
58
- };
55
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
59
56
 
60
57
  // node_modules/.pnpm/unraw@3.0.0/node_modules/unraw/dist/errors.js
61
58
  var require_errors = __commonJS({
@@ -228,8 +225,7 @@ var require_moo = __commonJS({
228
225
  return "(" + s + ")";
229
226
  }
230
227
  function reUnion(regexps) {
231
- if (!regexps.length)
232
- return "(?!)";
228
+ if (!regexps.length) return "(?!)";
233
229
  var source = regexps.map(function(s) {
234
230
  return "(?:" + s + ")";
235
231
  }).join("|");
@@ -239,14 +235,10 @@ var require_moo = __commonJS({
239
235
  if (typeof obj === "string") {
240
236
  return "(?:" + reEscape(obj) + ")";
241
237
  } else if (isRegExp(obj)) {
242
- if (obj.ignoreCase)
243
- throw new Error("RegExp /i flag not allowed");
244
- if (obj.global)
245
- throw new Error("RegExp /g flag is implied");
246
- if (obj.sticky)
247
- throw new Error("RegExp /y flag is implied");
248
- if (obj.multiline)
249
- throw new Error("RegExp /m flag is implied");
238
+ if (obj.ignoreCase) throw new Error("RegExp /i flag not allowed");
239
+ if (obj.global) throw new Error("RegExp /g flag is implied");
240
+ if (obj.sticky) throw new Error("RegExp /y flag is implied");
241
+ if (obj.multiline) throw new Error("RegExp /m flag is implied");
250
242
  return obj.source;
251
243
  } else {
252
244
  throw new Error("Not a pattern: " + obj);
@@ -295,16 +287,14 @@ var require_moo = __commonJS({
295
287
  var match = [];
296
288
  rules.forEach(function(rule) {
297
289
  if (isObject(rule)) {
298
- if (match.length)
299
- result.push(ruleOptions(key, match));
290
+ if (match.length) result.push(ruleOptions(key, match));
300
291
  result.push(ruleOptions(key, rule));
301
292
  match = [];
302
293
  } else {
303
294
  match.push(rule);
304
295
  }
305
296
  });
306
- if (match.length)
307
- result.push(ruleOptions(key, match));
297
+ if (match.length) result.push(ruleOptions(key, match));
308
298
  }
309
299
  return result;
310
300
  }
@@ -439,8 +429,7 @@ var require_moo = __commonJS({
439
429
  var fallbackRule = errorRule && errorRule.fallback;
440
430
  var flags = hasSticky && !fallbackRule ? "ym" : "gm";
441
431
  var suffix2 = hasSticky || fallbackRule ? "" : "|";
442
- if (unicodeFlag === true)
443
- flags += "u";
432
+ if (unicodeFlag === true) flags += "u";
444
433
  var combined = new RegExp(reUnion(parts) + suffix2, flags);
445
434
  return { regexp: combined, groups, fast, error: errorRule || defaultErrorRule };
446
435
  }
@@ -461,8 +450,7 @@ var require_moo = __commonJS({
461
450
  var all = states.$all ? toRules(states.$all) : [];
462
451
  delete states.$all;
463
452
  var keys = Object.getOwnPropertyNames(states);
464
- if (!start)
465
- start = keys[0];
453
+ if (!start) start = keys[0];
466
454
  var ruleMap = /* @__PURE__ */ Object.create(null);
467
455
  for (var i = 0; i < keys.length; i++) {
468
456
  var key = keys[i];
@@ -474,8 +462,7 @@ var require_moo = __commonJS({
474
462
  var included = /* @__PURE__ */ Object.create(null);
475
463
  for (var j = 0; j < rules.length; j++) {
476
464
  var rule = rules[j];
477
- if (!rule.include)
478
- continue;
465
+ if (!rule.include) continue;
479
466
  var splice = [j, 1];
480
467
  if (rule.include !== key && !included[rule.include]) {
481
468
  included[rule.include] = true;
@@ -485,8 +472,7 @@ var require_moo = __commonJS({
485
472
  }
486
473
  for (var k = 0; k < newRules.length; k++) {
487
474
  var newRule = newRules[k];
488
- if (rules.indexOf(newRule) !== -1)
489
- continue;
475
+ if (rules.indexOf(newRule) !== -1) continue;
490
476
  splice.push(newRule);
491
477
  }
492
478
  }
@@ -567,8 +553,7 @@ var require_moo = __commonJS({
567
553
  };
568
554
  };
569
555
  Lexer.prototype.setState = function(state) {
570
- if (!state || this.state === state)
571
- return;
556
+ if (!state || this.state === state) return;
572
557
  this.state = state;
573
558
  var info = this.states[state];
574
559
  this.groups = info.groups;
@@ -636,7 +621,7 @@ var require_moo = __commonJS({
636
621
  }
637
622
  return this._token(group, text, index);
638
623
  };
639
- Lexer.prototype._token = function(group, text, offset2) {
624
+ Lexer.prototype._token = function(group, text, offset3) {
640
625
  var lineBreaks = 0;
641
626
  if (group.lineBreaks) {
642
627
  var matchNL = /\n/g;
@@ -655,7 +640,7 @@ var require_moo = __commonJS({
655
640
  value: typeof group.value === "function" ? group.value(text) : text,
656
641
  text,
657
642
  toString: tokenToString,
658
- offset: offset2,
643
+ offset: offset3,
659
644
  lineBreaks,
660
645
  line: this.line,
661
646
  col: this.col
@@ -672,12 +657,9 @@ var require_moo = __commonJS({
672
657
  var err = new Error(this.formatError(token, "invalid syntax"));
673
658
  throw err;
674
659
  }
675
- if (group.pop)
676
- this.popState();
677
- else if (group.push)
678
- this.pushState(group.push);
679
- else if (group.next)
680
- this.setState(group.next);
660
+ if (group.pop) this.popState();
661
+ else if (group.push) this.pushState(group.push);
662
+ else if (group.next) this.setState(group.next);
681
663
  return token;
682
664
  };
683
665
  if (typeof Symbol !== "undefined" && Symbol.iterator) {
@@ -1030,10 +1012,20 @@ var require_parser = __commonJS({
1030
1012
  // packages/attention/index.js
1031
1013
  import { css, html as html2, nothing } from "lit";
1032
1014
 
1033
- // node_modules/.pnpm/@lingui+core@4.7.1/node_modules/@lingui/core/dist/index.mjs
1015
+ // node_modules/.pnpm/@chbphone55+classnames@2.0.0/node_modules/@chbphone55/classnames/dist/index.m.js
1016
+ var r = function() {
1017
+ for (var t = [], n = arguments.length; n--; ) t[n] = arguments[n];
1018
+ return t.reduce(function(t2, n2) {
1019
+ return t2.concat("string" == typeof n2 ? n2 : Array.isArray(n2) ? r.apply(void 0, n2) : "object" == typeof n2 && n2 ? Object.keys(n2).map(function(r2) {
1020
+ return n2[r2] ? r2 : "";
1021
+ }) : "");
1022
+ }, []).join(" ");
1023
+ };
1024
+
1025
+ // node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
1034
1026
  var import_unraw = __toESM(require_dist(), 1);
1035
1027
 
1036
- // node_modules/.pnpm/@lingui+message-utils@4.7.1/node_modules/@lingui/message-utils/dist/compileMessage.mjs
1028
+ // node_modules/.pnpm/@lingui+message-utils@4.11.2/node_modules/@lingui/message-utils/dist/compileMessage.mjs
1037
1029
  var import_parser = __toESM(require_parser(), 1);
1038
1030
  function processTokens(tokens, mapText) {
1039
1031
  if (!tokens.filter((token) => token.type !== "content").length) {
@@ -1055,19 +1047,17 @@ function processTokens(tokens, mapText) {
1055
1047
  return [token.arg, token.key];
1056
1048
  }
1057
1049
  }
1058
- const offset2 = token.pluralOffset;
1050
+ const offset3 = token.pluralOffset;
1059
1051
  const formatProps = {};
1060
- token.cases.forEach((item) => {
1061
- formatProps[item.key.replace(/^=(.)+/, "$1")] = processTokens(
1062
- item.tokens,
1063
- mapText
1064
- );
1052
+ token.cases.forEach(({ key, tokens: tokens2 }) => {
1053
+ const prop = key[0] === "=" ? key.slice(1) : key;
1054
+ formatProps[prop] = processTokens(tokens2, mapText);
1065
1055
  });
1066
1056
  return [
1067
1057
  token.arg,
1068
1058
  token.type,
1069
1059
  __spreadValues({
1070
- offset: offset2
1060
+ offset: offset3
1071
1061
  }, formatProps)
1072
1062
  ];
1073
1063
  });
@@ -1083,7 +1073,7 @@ Message: ${message}`);
1083
1073
  }
1084
1074
  }
1085
1075
 
1086
- // node_modules/.pnpm/@lingui+core@4.7.1/node_modules/@lingui/core/dist/index.mjs
1076
+ // node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
1087
1077
  var isString = (s) => typeof s === "string";
1088
1078
  var isFunction = (f) => typeof f === "function";
1089
1079
  var cache = /* @__PURE__ */ new Map();
@@ -1109,7 +1099,7 @@ function number(locales, value, format) {
1109
1099
  return formatter.format(value);
1110
1100
  }
1111
1101
  function plural(locales, ordinal, value, _a) {
1112
- var _b = _a, { offset: offset2 = 0 } = _b, rules = __objRest(_b, ["offset"]);
1102
+ var _b = _a, { offset: offset3 = 0 } = _b, rules = __objRest(_b, ["offset"]);
1113
1103
  var _a2, _b2;
1114
1104
  const _locales = normalizeLocales(locales);
1115
1105
  const plurals = ordinal ? getMemoized(
@@ -1119,7 +1109,7 @@ function plural(locales, ordinal, value, _a) {
1119
1109
  () => cacheKey("plural-cardinal", _locales),
1120
1110
  () => new Intl.PluralRules(_locales, { type: "cardinal" })
1121
1111
  );
1122
- return (_b2 = (_a2 = rules[value]) != null ? _a2 : rules[plurals.select(value - offset2)]) != null ? _b2 : rules.other;
1112
+ return (_b2 = (_a2 = rules[value]) != null ? _a2 : rules[plurals.select(value - offset3)]) != null ? _b2 : rules.other;
1123
1113
  }
1124
1114
  function getMemoized(getKey, construct) {
1125
1115
  const key = getKey();
@@ -1148,14 +1138,14 @@ var getDefaultFormats = (locale, passedLocales, formats = {}) => {
1148
1138
  };
1149
1139
  return {
1150
1140
  plural: (value, cases) => {
1151
- const { offset: offset2 = 0 } = cases;
1141
+ const { offset: offset3 = 0 } = cases;
1152
1142
  const message = plural(locales, false, value, cases);
1153
- return replaceOctothorpe(value - offset2, message);
1143
+ return replaceOctothorpe(value - offset3, message);
1154
1144
  },
1155
1145
  selectordinal: (value, cases) => {
1156
- const { offset: offset2 = 0 } = cases;
1146
+ const { offset: offset3 = 0 } = cases;
1157
1147
  const message = plural(locales, true, value, cases);
1158
- return replaceOctothorpe(value - offset2, message);
1148
+ return replaceOctothorpe(value - offset3, message);
1159
1149
  },
1160
1150
  select: selectFormatter,
1161
1151
  number: (value, format) => number(locales, value, style(format)),
@@ -1169,11 +1159,11 @@ var selectFormatter = (value, rules) => {
1169
1159
  function interpolate(translation, locale, locales) {
1170
1160
  return (values = {}, formats) => {
1171
1161
  const formatters = getDefaultFormats(locale, locales, formats);
1172
- const formatMessage = (tokens) => {
1162
+ const formatMessage = (tokens, replaceOctothorpe = false) => {
1173
1163
  if (!Array.isArray(tokens))
1174
1164
  return tokens;
1175
1165
  return tokens.reduce((message, token) => {
1176
- if (token === "#") {
1166
+ if (token === "#" && replaceOctothorpe) {
1177
1167
  return message + OCTOTHORPE_PH;
1178
1168
  }
1179
1169
  if (isString(token)) {
@@ -1184,7 +1174,10 @@ function interpolate(translation, locale, locales) {
1184
1174
  if (type === "plural" || type === "selectordinal" || type === "select") {
1185
1175
  Object.entries(format).forEach(
1186
1176
  ([key, value2]) => {
1187
- interpolatedFormat[key] = formatMessage(value2);
1177
+ interpolatedFormat[key] = formatMessage(
1178
+ value2,
1179
+ type === "plural" || type === "selectordinal"
1180
+ );
1188
1181
  }
1189
1182
  );
1190
1183
  } else {
@@ -1352,6 +1345,9 @@ var I18n = class extends EventEmitter {
1352
1345
  }
1353
1346
  _(id, values, options) {
1354
1347
  let message = options == null ? void 0 : options.message;
1348
+ if (!id) {
1349
+ id = "";
1350
+ }
1355
1351
  if (!isString(id)) {
1356
1352
  values = id.values || values;
1357
1353
  message = id.message;
@@ -1392,7 +1388,7 @@ function setupI18n(params = {}) {
1392
1388
  }
1393
1389
  var i18n = setupI18n();
1394
1390
 
1395
- // node_modules/.pnpm/@floating-ui+utils@0.2.2/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
1391
+ // node_modules/.pnpm/@floating-ui+utils@0.2.7/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
1396
1392
  var sides = ["top", "right", "bottom", "left"];
1397
1393
  var min = Math.min;
1398
1394
  var max = Math.max;
@@ -1463,8 +1459,7 @@ function getSideList(side2, isStart, rtl) {
1463
1459
  switch (side2) {
1464
1460
  case "top":
1465
1461
  case "bottom":
1466
- if (rtl)
1467
- return isStart ? rl : lr;
1462
+ if (rtl) return isStart ? rl : lr;
1468
1463
  return isStart ? lr : rl;
1469
1464
  case "left":
1470
1465
  case "right":
@@ -1522,7 +1517,7 @@ function rectToClientRect(rect) {
1522
1517
  };
1523
1518
  }
1524
1519
 
1525
- // node_modules/.pnpm/@floating-ui+core@1.6.2/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
1520
+ // node_modules/.pnpm/@floating-ui+core@1.6.7/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
1526
1521
  function computeCoordsFromPlacement(_ref, placement, rtl) {
1527
1522
  let {
1528
1523
  reference,
@@ -1759,14 +1754,14 @@ var arrow = (options) => ({
1759
1754
  const min$1 = minPadding;
1760
1755
  const max2 = clientSize - arrowDimensions[length] - maxPadding;
1761
1756
  const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
1762
- const offset2 = clamp(min$1, center, max2);
1763
- const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset2 && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
1757
+ const offset3 = clamp(min$1, center, max2);
1758
+ const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset3 && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
1764
1759
  const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max2 : 0;
1765
1760
  return {
1766
1761
  [axis]: coords[axis] + alignmentOffset,
1767
1762
  data: __spreadValues({
1768
- [axis]: offset2,
1769
- centerOffset: center - offset2 - alignmentOffset
1763
+ [axis]: offset3,
1764
+ centerOffset: center - offset3 - alignmentOffset
1770
1765
  }, shouldAddOffset && {
1771
1766
  alignmentOffset
1772
1767
  }),
@@ -1810,10 +1805,12 @@ var flip = function(options) {
1810
1805
  return {};
1811
1806
  }
1812
1807
  const side2 = getSide(placement);
1808
+ const initialSideAxis = getSideAxis(initialPlacement);
1813
1809
  const isBasePlacement = getSide(initialPlacement) === initialPlacement;
1814
1810
  const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
1815
1811
  const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
1816
- if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== "none") {
1812
+ const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
1813
+ if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
1817
1814
  fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
1818
1815
  }
1819
1816
  const placements2 = [initialPlacement, ...fallbackPlacements];
@@ -1850,8 +1847,16 @@ var flip = function(options) {
1850
1847
  if (!resetPlacement) {
1851
1848
  switch (fallbackStrategy) {
1852
1849
  case "bestFit": {
1853
- var _overflowsData$map$so;
1854
- const placement2 = (_overflowsData$map$so = overflowsData.map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0];
1850
+ var _overflowsData$filter2;
1851
+ const placement2 = (_overflowsData$filter2 = overflowsData.filter((d) => {
1852
+ if (hasFallbackAxisSideDirection) {
1853
+ const currentSideAxis = getSideAxis(d.placement);
1854
+ return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
1855
+ // reading directions favoring greater width.
1856
+ currentSideAxis === "y";
1857
+ }
1858
+ return true;
1859
+ }).map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
1855
1860
  if (placement2) {
1856
1861
  resetPlacement = placement2;
1857
1862
  }
@@ -2000,7 +2005,7 @@ var offset = function(options) {
2000
2005
  };
2001
2006
  };
2002
2007
 
2003
- // node_modules/.pnpm/@floating-ui+utils@0.2.2/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
2008
+ // node_modules/.pnpm/@floating-ui+utils@0.2.7/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
2004
2009
  function getNodeName(node) {
2005
2010
  if (isNode(node)) {
2006
2011
  return (node.nodeName || "").toLowerCase();
@@ -2042,9 +2047,18 @@ function isOverflowElement(element) {
2042
2047
  function isTableElement(element) {
2043
2048
  return ["table", "td", "th"].includes(getNodeName(element));
2044
2049
  }
2045
- function isContainingBlock(element) {
2050
+ function isTopLayer(element) {
2051
+ return [":popover-open", ":modal"].some((selector) => {
2052
+ try {
2053
+ return element.matches(selector);
2054
+ } catch (e) {
2055
+ return false;
2056
+ }
2057
+ });
2058
+ }
2059
+ function isContainingBlock(elementOrCss) {
2046
2060
  const webkit = isWebKit();
2047
- const css2 = getComputedStyle(element);
2061
+ const css2 = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
2048
2062
  return css2.transform !== "none" || css2.perspective !== "none" || (css2.containerType ? css2.containerType !== "normal" : false) || !webkit && (css2.backdropFilter ? css2.backdropFilter !== "none" : false) || !webkit && (css2.filter ? css2.filter !== "none" : false) || ["transform", "perspective", "filter"].some((value) => (css2.willChange || "").includes(value)) || ["paint", "layout", "strict", "content"].some((value) => (css2.contain || "").includes(value));
2049
2063
  }
2050
2064
  function getContainingBlock(element) {
@@ -2052,14 +2066,15 @@ function getContainingBlock(element) {
2052
2066
  while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
2053
2067
  if (isContainingBlock(currentNode)) {
2054
2068
  return currentNode;
2069
+ } else if (isTopLayer(currentNode)) {
2070
+ return null;
2055
2071
  }
2056
2072
  currentNode = getParentNode(currentNode);
2057
2073
  }
2058
2074
  return null;
2059
2075
  }
2060
2076
  function isWebKit() {
2061
- if (typeof CSS === "undefined" || !CSS.supports)
2062
- return false;
2077
+ if (typeof CSS === "undefined" || !CSS.supports) return false;
2063
2078
  return CSS.supports("-webkit-backdrop-filter", "none");
2064
2079
  }
2065
2080
  function isLastTraversableNode(node) {
@@ -2076,8 +2091,8 @@ function getNodeScroll(element) {
2076
2091
  };
2077
2092
  }
2078
2093
  return {
2079
- scrollLeft: element.pageXOffset,
2080
- scrollTop: element.pageYOffset
2094
+ scrollLeft: element.scrollX,
2095
+ scrollTop: element.scrollY
2081
2096
  };
2082
2097
  }
2083
2098
  function getParentNode(node) {
@@ -2115,12 +2130,16 @@ function getOverflowAncestors(node, list, traverseIframes) {
2115
2130
  const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
2116
2131
  const win = getWindow(scrollableAncestor);
2117
2132
  if (isBody) {
2118
- return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
2133
+ const frameElement = getFrameElement(win);
2134
+ return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
2119
2135
  }
2120
2136
  return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
2121
2137
  }
2138
+ function getFrameElement(win) {
2139
+ return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
2140
+ }
2122
2141
 
2123
- // node_modules/.pnpm/@floating-ui+dom@1.6.3/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
2142
+ // node_modules/.pnpm/@floating-ui+dom@1.6.10/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
2124
2143
  function getCssDimensions(element) {
2125
2144
  const css2 = getComputedStyle(element);
2126
2145
  let width = parseFloat(css2.width) || 0;
@@ -2214,7 +2233,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
2214
2233
  const win = getWindow(domElement);
2215
2234
  const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
2216
2235
  let currentWin = win;
2217
- let currentIFrame = currentWin.frameElement;
2236
+ let currentIFrame = getFrameElement(currentWin);
2218
2237
  while (currentIFrame && offsetParent && offsetWin !== currentWin) {
2219
2238
  const iframeScale = getScale(currentIFrame);
2220
2239
  const iframeRect = currentIFrame.getBoundingClientRect();
@@ -2228,7 +2247,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
2228
2247
  x += left;
2229
2248
  y += top;
2230
2249
  currentWin = getWindow(currentIFrame);
2231
- currentIFrame = currentWin.frameElement;
2250
+ currentIFrame = getFrameElement(currentWin);
2232
2251
  }
2233
2252
  }
2234
2253
  return rectToClientRect({
@@ -2238,16 +2257,6 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
2238
2257
  y
2239
2258
  });
2240
2259
  }
2241
- var topLayerSelectors = [":popover-open", ":modal"];
2242
- function isTopLayer(floating) {
2243
- return topLayerSelectors.some((selector) => {
2244
- try {
2245
- return floating.matches(selector);
2246
- } catch (e) {
2247
- return false;
2248
- }
2249
- });
2250
- }
2251
2260
  function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
2252
2261
  let {
2253
2262
  elements,
@@ -2407,7 +2416,7 @@ function getClippingRect(_ref) {
2407
2416
  rootBoundary,
2408
2417
  strategy
2409
2418
  } = _ref;
2410
- const elementClippingAncestors = boundary === "clippingAncestors" ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
2419
+ const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
2411
2420
  const clippingAncestors = [...elementClippingAncestors, rootBoundary];
2412
2421
  const firstClippingAncestor = clippingAncestors[0];
2413
2422
  const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
@@ -2466,6 +2475,9 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
2466
2475
  height: rect.height
2467
2476
  };
2468
2477
  }
2478
+ function isStaticPositioned(element) {
2479
+ return getComputedStyle(element).position === "static";
2480
+ }
2469
2481
  function getTrueOffsetParent(element, polyfill) {
2470
2482
  if (!isHTMLElement(element) || getComputedStyle(element).position === "fixed") {
2471
2483
  return null;
@@ -2476,28 +2488,41 @@ function getTrueOffsetParent(element, polyfill) {
2476
2488
  return element.offsetParent;
2477
2489
  }
2478
2490
  function getOffsetParent(element, polyfill) {
2479
- const window2 = getWindow(element);
2480
- if (!isHTMLElement(element) || isTopLayer(element)) {
2481
- return window2;
2491
+ const win = getWindow(element);
2492
+ if (isTopLayer(element)) {
2493
+ return win;
2494
+ }
2495
+ if (!isHTMLElement(element)) {
2496
+ let svgOffsetParent = getParentNode(element);
2497
+ while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
2498
+ if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
2499
+ return svgOffsetParent;
2500
+ }
2501
+ svgOffsetParent = getParentNode(svgOffsetParent);
2502
+ }
2503
+ return win;
2482
2504
  }
2483
2505
  let offsetParent = getTrueOffsetParent(element, polyfill);
2484
- while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === "static") {
2506
+ while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
2485
2507
  offsetParent = getTrueOffsetParent(offsetParent, polyfill);
2486
2508
  }
2487
- if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle(offsetParent).position === "static" && !isContainingBlock(offsetParent))) {
2488
- return window2;
2509
+ if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
2510
+ return win;
2489
2511
  }
2490
- return offsetParent || getContainingBlock(element) || window2;
2512
+ return offsetParent || getContainingBlock(element) || win;
2491
2513
  }
2492
2514
  var getElementRects = async function(data) {
2493
2515
  const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
2494
2516
  const getDimensionsFn = this.getDimensions;
2517
+ const floatingDimensions = await getDimensionsFn(data.floating);
2495
2518
  return {
2496
2519
  reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
2497
- floating: __spreadValues({
2520
+ floating: {
2498
2521
  x: 0,
2499
- y: 0
2500
- }, await getDimensionsFn(data.floating))
2522
+ y: 0,
2523
+ width: floatingDimensions.width,
2524
+ height: floatingDimensions.height
2525
+ }
2501
2526
  };
2502
2527
  };
2503
2528
  function isRTL(element) {
@@ -2515,6 +2540,7 @@ var platform = {
2515
2540
  isElement,
2516
2541
  isRTL
2517
2542
  };
2543
+ var offset2 = offset;
2518
2544
  var flip2 = flip;
2519
2545
  var hide2 = hide;
2520
2546
  var arrow2 = arrow;
@@ -2531,7 +2557,7 @@ var computePosition2 = (reference, floating, options) => {
2531
2557
  }));
2532
2558
  };
2533
2559
 
2534
- // node_modules/.pnpm/@warp-ds+core@1.1.2_@floating-ui+dom@1.6.3/node_modules/@warp-ds/core/dist/attention/utils/helpers.js
2560
+ // node_modules/.pnpm/@warp-ds+core@1.1.5_@floating-ui+dom@1.6.10/node_modules/@warp-ds/core/dist/attention/utils/helpers.js
2535
2561
  var TOP_START = "top-start";
2536
2562
  var TOP = "top";
2537
2563
  var TOP_END = "top-end";
@@ -2622,10 +2648,12 @@ async function useRecompute(state) {
2622
2648
  computePosition2(targetEl, attentionEl, {
2623
2649
  placement: (_a = state == null ? void 0 : state.directionName) != null ? _a : BOTTOM,
2624
2650
  middleware: [
2625
- offset({ mainAxis: (_b = state == null ? void 0 : state.distance) != null ? _b : 8, crossAxis: (_c = state == null ? void 0 : state.skidding) != null ? _c : 0 }),
2651
+ offset2({ mainAxis: (_b = state == null ? void 0 : state.distance) != null ? _b : 8, crossAxis: (_c = state == null ? void 0 : state.skidding) != null ? _c : 0 }),
2652
+ // offers flexibility over how to place the attentionEl towards its targetEl both on the x and y axis (horizontally and vertically).
2626
2653
  (state == null ? void 0 : state.flip) && flip2({
2627
2654
  // when flip is set to true it will move the attentionEl's placement to its opposite side or to the preferred placements if fallbackPlacements has a value
2628
2655
  crossAxis: state == null ? void 0 : state.crossAxis,
2656
+ // checks overflow to trigger a flip. When disabled, it will ignore overflow
2629
2657
  fallbackPlacements: state == null ? void 0 : state.fallbackPlacements
2630
2658
  }),
2631
2659
  !(state == null ? void 0 : state.noArrow) && (state == null ? void 0 : state.arrowEl) && arrow2({ element: state == null ? void 0 : state.arrowEl }),
@@ -2681,41 +2709,7 @@ async function useRecompute(state) {
2681
2709
  return state;
2682
2710
  }
2683
2711
 
2684
- // node_modules/.pnpm/@warp-ds+css@2.0.0-next.4_@warp-ds+uno@2.0.0_unocss@0.58.5_postcss@8.4.38_rollup@4.18.0_vite@_d2fzbudswaxjysaqn4v4imsdwy/node_modules/@warp-ds/css/component-classes/index.js
2685
- var box = {
2686
- box: "group block relative break-words last-child:mb-0 p-16 rounded-8",
2687
- // Relative here enables w-clickable
2688
- bleed: "-mx-16 sm:mx-0 rounded-l-0 rounded-r-0 sm:rounded-8",
2689
- // We target L and R to override the default rounded-8
2690
- info: "s-bg-info-subtle",
2691
- neutral: "s-surface-sunken",
2692
- bordered: "border-2 s-border s-bg"
2693
- };
2694
- var buttonReset = "focus:outline-none appearance-none cursor-pointer bg-transparent border-0 m-0 p-0 inline-block";
2695
- var expandable = {
2696
- expandable: "will-change-height",
2697
- expandableTitle: "font-bold s-text",
2698
- expandableBox: "s-surface-sunken hover:s-bg-hover active:s-bg-active py-0 px-0 " + box.box,
2699
- expandableInfo: "s-bg-info-subtle! hover:s-bg-info-subtle-hover!",
2700
- expandableBleed: box.bleed,
2701
- chevron: "inline-block align-middle s-icon",
2702
- chevronNonBox: "ml-8",
2703
- chevronBox: "",
2704
- chevronTransform: "transform transition-transform transform-gpu ease-in-out",
2705
- chevronExpand: "-rotate-180",
2706
- chevronCollapse: "rotate-180",
2707
- elementsTransformChevronDownPart: "part-[w-icon-chevron-down-16-part]:transform part-[w-icon-chevron-down-16-part]:transition-transform part-[w-icon-chevron-down-16-part]:transform-gpu part-[w-icon-chevron-down-16-part]:ease-in-out",
2708
- elementsChevronDownExpandPart: "part-[w-icon-chevron-down-16-part]:-rotate-180",
2709
- elementsTransformChevronUpPart: "part-[w-icon-chevron-up-16-part]:transform part-[w-icon-chevron-up-16-part]:transition-transform part-[w-icon-chevron-up-16-part]:transform-gpu part-[w-icon-chevron-up-16-part]:ease-in-out",
2710
- elementsChevronUpCollapsePart: "part-[w-icon-chevron-up-16-part]:rotate-180",
2711
- expansion: "overflow-hidden",
2712
- expansionNotExpanded: "h-0 invisible",
2713
- button: buttonReset + " hover:underline focus-visible:underline",
2714
- buttonBox: "w-full text-left relative inline-flex items-center justify-between " + box.box,
2715
- paddingTop: "pt-0",
2716
- title: "flex w-full justify-between items-center",
2717
- titleType: "h4"
2718
- };
2712
+ // node_modules/.pnpm/@warp-ds+css@2.0.0_@warp-ds+uno@2.0.0_unocss@0.62.0_postcss@8.4.41_rollup@4.20.0_vite@5.3.3_@_vyiy5vwpqfzwy5hpmfkwp3zmle/node_modules/@warp-ds/css/component-classes/index.js
2719
2713
  var buttonDefaultStyling = "font-bold focusable justify-center transition-colors ease-in-out";
2720
2714
  var buttonColors = {
2721
2715
  primary: "s-text-inverted bg-[--w-color-button-primary-background] hover:bg-[--w-color-button-primary-background-hover] active:bg-[--w-color-button-primary-background-active]",
@@ -2833,7 +2827,7 @@ var button = {
2833
2827
  };
2834
2828
  var modal = {
2835
2829
  backdrop: "fixed inset-0 flex sm:place-content-center sm:place-items-center items-end z-30 [--w-modal-max-height:80%] [--w-modal-width:640px] bg-[--w-black/25]",
2836
- modal: "pb-safe-[32] shadow-m max-h-[--w-modal-max-height] min-h-[--w-modal-min-height] w-[--w-modal-width] h-[--w-modal-height] relative transition-300 ease-in-out backface-hidden will-change-height rounded-8 mx-0 sm:mx-16 bg-[--w-s-color-surface-elevated-100] flex flex-col overflow-hidden outline-none space-y-16 pt-8 sm:pt-32 sm:pb-32 rounded-b-0 sm:rounded-b-8",
2830
+ base: "pb-safe-[32] shadow-m max-h-[--w-modal-max-height] min-h-[--w-modal-min-height] w-[--w-modal-width] h-[--w-modal-height] relative transition-300 ease-in-out backface-hidden will-change-height rounded-8 mx-0 sm:mx-16 bg-[--w-s-color-surface-elevated-100] flex flex-col overflow-hidden outline-none space-y-16 pt-8 sm:pt-32 sm:pb-32 rounded-b-0 sm:rounded-b-8",
2837
2831
  content: "block overflow-y-auto overflow-x-hidden last-child:mb-0 grow shrink px-16 sm:px-32 relative",
2838
2832
  footer: "flex justify-end shrink-0 px-16 sm:px-32",
2839
2833
  transitionTitle: "transition-all duration-300",
@@ -2847,19 +2841,15 @@ var modal = {
2847
2841
  titleButtonIcon: "h-16 w-16 sm:h-24 sm:w-24",
2848
2842
  titleButtonIconRotated: "transform rotate-90"
2849
2843
  };
2850
- var label = {
2851
- label: "antialiased block relative text-s font-bold pb-4 cursor-pointer s-text",
2852
- optional: "pl-8 font-normal text-s s-text-subtle"
2853
- };
2854
- var prefixSuffixWrapperBase = "absolute top-0 bottom-0 flex justify-center items-center focusable rounded-4 focus:[--w-outline-offset:-2px] bg-transparent ";
2844
+ var prefixSuffixWrapper = "absolute top-0 bottom-0 flex justify-center items-center focusable rounded-4 focus:[--w-outline-offset:-2px] bg-transparent ";
2855
2845
  var suffix = {
2856
- wrapper: prefixSuffixWrapperBase + "right-0",
2846
+ wrapper: prefixSuffixWrapper + "right-0",
2857
2847
  wrapperWithLabel: "w-max pr-12",
2858
2848
  wrapperWithIcon: "w-40",
2859
2849
  label: "antialiased block relative cursor-default pb-0 font-bold text-xs s-text"
2860
2850
  };
2861
2851
  var prefix = {
2862
- wrapper: prefixSuffixWrapperBase + "left-0",
2852
+ wrapper: prefixSuffixWrapper + "left-0",
2863
2853
  wrapperWithLabel: "w-max pl-12",
2864
2854
  wrapperWithIcon: "w-40",
2865
2855
  label: "antialiased block relative cursor-default pb-0 font-bold text-xs s-text"
@@ -2916,15 +2906,9 @@ var deadToggle = {
2916
2906
  wrapper: `${toggle.wrapper} h-20 w-20 pointer-events-none`,
2917
2907
  input: `${toggle.input} hidden`,
2918
2908
  inputVue: "hidden",
2909
+ labelVue: "-mt-2",
2919
2910
  labelRadio: `${toggle.label} ${toggle.labelBefore} ${toggle.radio}`,
2920
- labelCheckbox: `${toggle.label} ${toggle.labelBefore} ${toggle.checkbox}`,
2921
- labelVue: "-mt-2"
2922
- };
2923
- var clickable = {
2924
- toggle: "absolute inset-0 h-full w-full appearance-none cursor-pointer focusable focusable-inset",
2925
- label: `px-12 ${label.label} py-8! cursor-pointer focusable focusable-inset`,
2926
- buttonOrLink: "bg-transparent focusable",
2927
- buttonOrLinkStretch: "inset-0 absolute"
2911
+ labelCheckbox: `${toggle.label} ${toggle.labelBefore} ${toggle.checkbox}`
2928
2912
  };
2929
2913
  var attention = {
2930
2914
  base: "border-2 relative flex items-start",
@@ -2980,12 +2964,9 @@ function detectLocale() {
2980
2964
  }
2981
2965
  }
2982
2966
  var getMessages = (locale, enMsg, nbMsg, fiMsg, daMsg) => {
2983
- if (locale === "nb")
2984
- return nbMsg;
2985
- if (locale === "fi")
2986
- return fiMsg;
2987
- if (locale === "da")
2988
- return daMsg;
2967
+ if (locale === "nb") return nbMsg;
2968
+ if (locale === "fi") return fiMsg;
2969
+ if (locale === "da") return daMsg;
2989
2970
  return enMsg;
2990
2971
  };
2991
2972
  var activateI18n = (enMessages, nbMessages, fiMessages, daMessages) => {
@@ -3011,14 +2992,6 @@ function kebabCaseAttributes(constructor) {
3011
2992
  }
3012
2993
  };
3013
2994
  }
3014
- function classes(defn) {
3015
- const classes2 = [];
3016
- for (const [key, value] of Object.entries(defn)) {
3017
- if (value)
3018
- classes2.push(key);
3019
- }
3020
- return classes2.join(" ");
3021
- }
3022
2995
  function generateRandomId() {
3023
2996
  return `m${Math.random().toString(36).slice(2)}`;
3024
2997
  }
@@ -3035,7 +3008,7 @@ var messages3 = JSON.parse('{"attention.aria.callout":"Vihre\xE4 puhekupla, joka
3035
3008
  // packages/attention/locales/nb/messages.mjs
3036
3009
  var messages4 = JSON.parse('{"attention.aria.callout":"Gr\xF8nn taleboble som introduserer noe nytt","attention.aria.close":"Lukk","attention.aria.highlight":"En uthevet taleboble med viktig informasjon","attention.aria.pointingDown":"peker ned","attention.aria.pointingLeft":"peker til venstre","attention.aria.pointingRight":"peker til h\xF8yre","attention.aria.pointingUp":"peker opp","attention.aria.popover":"En hvit taleboble som gir tilleggsinformasjon","attention.aria.tooltip":"En svart taleboble som forklarer konteksten"}');
3037
3010
 
3038
- // node_modules/.pnpm/@warp-ds+icons@2.0.1/node_modules/@warp-ds/icons/dist/elements/close-16.js
3011
+ // node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/close-16.js
3039
3012
  import { LitElement } from "lit";
3040
3013
  import { unsafeStatic, html } from "lit/static-html.js";
3041
3014
  var messages5 = JSON.parse('{"icon.title.close":"Kryss"}');
@@ -3204,11 +3177,11 @@ ${JSON.stringify(directions)}`
3204
3177
  return opposites[this._actualDirection];
3205
3178
  }
3206
3179
  get _arrowClasses() {
3207
- return classes({
3208
- [attention.arrowBase]: true,
3209
- [attention[`arrowDirection${arrowDirectionClassname(this._arrowDirection)}`]]: true,
3210
- [this._activeVariantClasses.arrow]: true
3211
- });
3180
+ return r([
3181
+ attention.arrowBase,
3182
+ this._activeVariantClasses.arrow,
3183
+ attention[`arrowDirection${arrowDirectionClassname(this._arrowDirection)}`]
3184
+ ]);
3212
3185
  }
3213
3186
  get _arrowHtml() {
3214
3187
  return this.noArrow ? "" : html2`<div id="arrow" role="img" class="${this._arrowClasses}"></div>`;
@@ -3239,10 +3212,7 @@ ${JSON.stringify(directions)}`
3239
3212
  return messageSlot ? messageSlot.assignedNodes()[0] : null;
3240
3213
  }
3241
3214
  get _wrapperClasses() {
3242
- return classes({
3243
- [attention.base]: true,
3244
- [this._activeVariantClasses.wrapper]: true
3245
- });
3215
+ return r([attention.base, this._activeVariantClasses.wrapper]);
3246
3216
  }
3247
3217
  get _ariaClose() {
3248
3218
  return i18n._({
@@ -3374,16 +3344,14 @@ ${JSON.stringify(directions)}`
3374
3344
  this.updateComplete.then(() => this.dispatchEvent(event));
3375
3345
  }
3376
3346
  keypressed(e) {
3377
- if (!this.canClose)
3378
- return;
3347
+ if (!this.canClose) return;
3379
3348
  if (e.key === "Escape") {
3380
3349
  e.preventDefault();
3381
3350
  this.close();
3382
3351
  }
3383
3352
  }
3384
3353
  render() {
3385
- if (!this.callout && this._targetEl === void 0)
3386
- return html2``;
3354
+ if (!this.callout && this._targetEl === void 0) return html2``;
3387
3355
  return html2`
3388
3356
  <div class=${ifDefined(this.className ? this.className : void 0)}>
3389
3357
  ${this.placement === "right-start" || this.placement === "right" || this.placement === "right-end" || this.placement === "bottom-start" || this.placement === "bottom" || this.placement === "bottom-end" ? html2`