@warp-ds/elements 2.0.0-next.2 → 2.0.0-next.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.
Files changed (45) hide show
  1. package/dist/api.js +3 -6
  2. package/dist/api.js.map +1 -1
  3. package/dist/index.js +205 -255
  4. package/dist/index.js.map +4 -4
  5. package/dist/packages/affix/index.d.ts +1 -1
  6. package/dist/packages/affix/index.js +35 -49
  7. package/dist/packages/affix/index.js.map +3 -3
  8. package/dist/packages/alert/index.js +39 -55
  9. package/dist/packages/alert/index.js.map +3 -3
  10. package/dist/packages/attention/index.js +118 -109
  11. package/dist/packages/attention/index.js.map +4 -4
  12. package/dist/packages/badge/index.js +3 -7
  13. package/dist/packages/badge/index.js.map +2 -2
  14. package/dist/packages/box/index.d.ts +1 -1
  15. package/dist/packages/box/index.js +2 -5
  16. package/dist/packages/box/index.js.map +2 -2
  17. package/dist/packages/breadcrumbs/index.js +36 -53
  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.js +36 -54
  22. package/dist/packages/button/index.js.map +3 -3
  23. package/dist/packages/card/index.d.ts +2 -2
  24. package/dist/packages/card/index.js +3 -7
  25. package/dist/packages/card/index.js.map +2 -2
  26. package/dist/packages/expandable/index.d.ts +2 -2
  27. package/dist/packages/expandable/index.js +52 -68
  28. package/dist/packages/expandable/index.js.map +4 -4
  29. package/dist/packages/modal/index.js +45 -69
  30. package/dist/packages/modal/index.js.map +3 -3
  31. package/dist/packages/modal/modal-header.d.ts +1 -1
  32. package/dist/packages/modal/modal-main.d.ts +3 -3
  33. package/dist/packages/pill/index.js +38 -56
  34. package/dist/packages/pill/index.js.map +3 -3
  35. package/dist/packages/select/index.js +54 -87
  36. package/dist/packages/select/index.js.map +3 -3
  37. package/dist/packages/textfield/index.js +7 -15
  38. package/dist/packages/textfield/index.js.map +2 -2
  39. package/dist/packages/toast/api.d.ts +1 -1
  40. package/dist/packages/toast/index.js +68 -110
  41. package/dist/packages/toast/index.js.map +3 -3
  42. package/dist/packages/toast/toast-container.d.ts +1 -1
  43. package/dist/packages/toast/toast.d.ts +2 -2
  44. package/dist/packages/utils/index.d.ts +1 -1
  45. package/package.json +27 -28
@@ -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,10 @@ 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/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
1034
1016
  var import_unraw = __toESM(require_dist(), 1);
1035
1017
 
1036
- // node_modules/.pnpm/@lingui+message-utils@4.7.1/node_modules/@lingui/message-utils/dist/compileMessage.mjs
1018
+ // node_modules/.pnpm/@lingui+message-utils@4.11.2/node_modules/@lingui/message-utils/dist/compileMessage.mjs
1037
1019
  var import_parser = __toESM(require_parser(), 1);
1038
1020
  function processTokens(tokens, mapText) {
1039
1021
  if (!tokens.filter((token) => token.type !== "content").length) {
@@ -1055,19 +1037,17 @@ function processTokens(tokens, mapText) {
1055
1037
  return [token.arg, token.key];
1056
1038
  }
1057
1039
  }
1058
- const offset2 = token.pluralOffset;
1040
+ const offset3 = token.pluralOffset;
1059
1041
  const formatProps = {};
1060
- token.cases.forEach((item) => {
1061
- formatProps[item.key.replace(/^=(.)+/, "$1")] = processTokens(
1062
- item.tokens,
1063
- mapText
1064
- );
1042
+ token.cases.forEach(({ key, tokens: tokens2 }) => {
1043
+ const prop = key[0] === "=" ? key.slice(1) : key;
1044
+ formatProps[prop] = processTokens(tokens2, mapText);
1065
1045
  });
1066
1046
  return [
1067
1047
  token.arg,
1068
1048
  token.type,
1069
1049
  __spreadValues({
1070
- offset: offset2
1050
+ offset: offset3
1071
1051
  }, formatProps)
1072
1052
  ];
1073
1053
  });
@@ -1083,7 +1063,7 @@ Message: ${message}`);
1083
1063
  }
1084
1064
  }
1085
1065
 
1086
- // node_modules/.pnpm/@lingui+core@4.7.1/node_modules/@lingui/core/dist/index.mjs
1066
+ // node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
1087
1067
  var isString = (s) => typeof s === "string";
1088
1068
  var isFunction = (f) => typeof f === "function";
1089
1069
  var cache = /* @__PURE__ */ new Map();
@@ -1109,7 +1089,7 @@ function number(locales, value, format) {
1109
1089
  return formatter.format(value);
1110
1090
  }
1111
1091
  function plural(locales, ordinal, value, _a) {
1112
- var _b = _a, { offset: offset2 = 0 } = _b, rules = __objRest(_b, ["offset"]);
1092
+ var _b = _a, { offset: offset3 = 0 } = _b, rules = __objRest(_b, ["offset"]);
1113
1093
  var _a2, _b2;
1114
1094
  const _locales = normalizeLocales(locales);
1115
1095
  const plurals = ordinal ? getMemoized(
@@ -1119,7 +1099,7 @@ function plural(locales, ordinal, value, _a) {
1119
1099
  () => cacheKey("plural-cardinal", _locales),
1120
1100
  () => new Intl.PluralRules(_locales, { type: "cardinal" })
1121
1101
  );
1122
- return (_b2 = (_a2 = rules[value]) != null ? _a2 : rules[plurals.select(value - offset2)]) != null ? _b2 : rules.other;
1102
+ return (_b2 = (_a2 = rules[value]) != null ? _a2 : rules[plurals.select(value - offset3)]) != null ? _b2 : rules.other;
1123
1103
  }
1124
1104
  function getMemoized(getKey, construct) {
1125
1105
  const key = getKey();
@@ -1148,14 +1128,14 @@ var getDefaultFormats = (locale, passedLocales, formats = {}) => {
1148
1128
  };
1149
1129
  return {
1150
1130
  plural: (value, cases) => {
1151
- const { offset: offset2 = 0 } = cases;
1131
+ const { offset: offset3 = 0 } = cases;
1152
1132
  const message = plural(locales, false, value, cases);
1153
- return replaceOctothorpe(value - offset2, message);
1133
+ return replaceOctothorpe(value - offset3, message);
1154
1134
  },
1155
1135
  selectordinal: (value, cases) => {
1156
- const { offset: offset2 = 0 } = cases;
1136
+ const { offset: offset3 = 0 } = cases;
1157
1137
  const message = plural(locales, true, value, cases);
1158
- return replaceOctothorpe(value - offset2, message);
1138
+ return replaceOctothorpe(value - offset3, message);
1159
1139
  },
1160
1140
  select: selectFormatter,
1161
1141
  number: (value, format) => number(locales, value, style(format)),
@@ -1169,11 +1149,11 @@ var selectFormatter = (value, rules) => {
1169
1149
  function interpolate(translation, locale, locales) {
1170
1150
  return (values = {}, formats) => {
1171
1151
  const formatters = getDefaultFormats(locale, locales, formats);
1172
- const formatMessage = (tokens) => {
1152
+ const formatMessage = (tokens, replaceOctothorpe = false) => {
1173
1153
  if (!Array.isArray(tokens))
1174
1154
  return tokens;
1175
1155
  return tokens.reduce((message, token) => {
1176
- if (token === "#") {
1156
+ if (token === "#" && replaceOctothorpe) {
1177
1157
  return message + OCTOTHORPE_PH;
1178
1158
  }
1179
1159
  if (isString(token)) {
@@ -1184,7 +1164,10 @@ function interpolate(translation, locale, locales) {
1184
1164
  if (type === "plural" || type === "selectordinal" || type === "select") {
1185
1165
  Object.entries(format).forEach(
1186
1166
  ([key, value2]) => {
1187
- interpolatedFormat[key] = formatMessage(value2);
1167
+ interpolatedFormat[key] = formatMessage(
1168
+ value2,
1169
+ type === "plural" || type === "selectordinal"
1170
+ );
1188
1171
  }
1189
1172
  );
1190
1173
  } else {
@@ -1352,6 +1335,9 @@ var I18n = class extends EventEmitter {
1352
1335
  }
1353
1336
  _(id, values, options) {
1354
1337
  let message = options == null ? void 0 : options.message;
1338
+ if (!id) {
1339
+ id = "";
1340
+ }
1355
1341
  if (!isString(id)) {
1356
1342
  values = id.values || values;
1357
1343
  message = id.message;
@@ -1392,7 +1378,7 @@ function setupI18n(params = {}) {
1392
1378
  }
1393
1379
  var i18n = setupI18n();
1394
1380
 
1395
- // node_modules/.pnpm/@floating-ui+utils@0.2.2/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
1381
+ // node_modules/.pnpm/@floating-ui+utils@0.2.4/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
1396
1382
  var sides = ["top", "right", "bottom", "left"];
1397
1383
  var min = Math.min;
1398
1384
  var max = Math.max;
@@ -1463,8 +1449,7 @@ function getSideList(side2, isStart, rtl) {
1463
1449
  switch (side2) {
1464
1450
  case "top":
1465
1451
  case "bottom":
1466
- if (rtl)
1467
- return isStart ? rl : lr;
1452
+ if (rtl) return isStart ? rl : lr;
1468
1453
  return isStart ? lr : rl;
1469
1454
  case "left":
1470
1455
  case "right":
@@ -1522,7 +1507,7 @@ function rectToClientRect(rect) {
1522
1507
  };
1523
1508
  }
1524
1509
 
1525
- // node_modules/.pnpm/@floating-ui+core@1.6.2/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
1510
+ // node_modules/.pnpm/@floating-ui+core@1.6.4/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
1526
1511
  function computeCoordsFromPlacement(_ref, placement, rtl) {
1527
1512
  let {
1528
1513
  reference,
@@ -1759,14 +1744,14 @@ var arrow = (options) => ({
1759
1744
  const min$1 = minPadding;
1760
1745
  const max2 = clientSize - arrowDimensions[length] - maxPadding;
1761
1746
  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;
1747
+ const offset3 = clamp(min$1, center, max2);
1748
+ const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset3 && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
1764
1749
  const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max2 : 0;
1765
1750
  return {
1766
1751
  [axis]: coords[axis] + alignmentOffset,
1767
1752
  data: __spreadValues({
1768
- [axis]: offset2,
1769
- centerOffset: center - offset2 - alignmentOffset
1753
+ [axis]: offset3,
1754
+ centerOffset: center - offset3 - alignmentOffset
1770
1755
  }, shouldAddOffset && {
1771
1756
  alignmentOffset
1772
1757
  }),
@@ -1810,10 +1795,12 @@ var flip = function(options) {
1810
1795
  return {};
1811
1796
  }
1812
1797
  const side2 = getSide(placement);
1798
+ const initialSideAxis = getSideAxis(initialPlacement);
1813
1799
  const isBasePlacement = getSide(initialPlacement) === initialPlacement;
1814
1800
  const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
1815
1801
  const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
1816
- if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== "none") {
1802
+ const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
1803
+ if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
1817
1804
  fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
1818
1805
  }
1819
1806
  const placements2 = [initialPlacement, ...fallbackPlacements];
@@ -1850,8 +1837,16 @@ var flip = function(options) {
1850
1837
  if (!resetPlacement) {
1851
1838
  switch (fallbackStrategy) {
1852
1839
  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];
1840
+ var _overflowsData$filter2;
1841
+ const placement2 = (_overflowsData$filter2 = overflowsData.filter((d) => {
1842
+ if (hasFallbackAxisSideDirection) {
1843
+ const currentSideAxis = getSideAxis(d.placement);
1844
+ return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
1845
+ // reading directions favoring greater width.
1846
+ currentSideAxis === "y";
1847
+ }
1848
+ return true;
1849
+ }).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
1850
  if (placement2) {
1856
1851
  resetPlacement = placement2;
1857
1852
  }
@@ -2000,7 +1995,7 @@ var offset = function(options) {
2000
1995
  };
2001
1996
  };
2002
1997
 
2003
- // node_modules/.pnpm/@floating-ui+utils@0.2.2/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
1998
+ // node_modules/.pnpm/@floating-ui+utils@0.2.4/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
2004
1999
  function getNodeName(node) {
2005
2000
  if (isNode(node)) {
2006
2001
  return (node.nodeName || "").toLowerCase();
@@ -2042,6 +2037,15 @@ function isOverflowElement(element) {
2042
2037
  function isTableElement(element) {
2043
2038
  return ["table", "td", "th"].includes(getNodeName(element));
2044
2039
  }
2040
+ function isTopLayer(element) {
2041
+ return [":popover-open", ":modal"].some((selector) => {
2042
+ try {
2043
+ return element.matches(selector);
2044
+ } catch (e) {
2045
+ return false;
2046
+ }
2047
+ });
2048
+ }
2045
2049
  function isContainingBlock(element) {
2046
2050
  const webkit = isWebKit();
2047
2051
  const css2 = getComputedStyle(element);
@@ -2050,6 +2054,9 @@ function isContainingBlock(element) {
2050
2054
  function getContainingBlock(element) {
2051
2055
  let currentNode = getParentNode(element);
2052
2056
  while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
2057
+ if (isTopLayer(currentNode)) {
2058
+ return null;
2059
+ }
2053
2060
  if (isContainingBlock(currentNode)) {
2054
2061
  return currentNode;
2055
2062
  }
@@ -2058,8 +2065,7 @@ function getContainingBlock(element) {
2058
2065
  return null;
2059
2066
  }
2060
2067
  function isWebKit() {
2061
- if (typeof CSS === "undefined" || !CSS.supports)
2062
- return false;
2068
+ if (typeof CSS === "undefined" || !CSS.supports) return false;
2063
2069
  return CSS.supports("-webkit-backdrop-filter", "none");
2064
2070
  }
2065
2071
  function isLastTraversableNode(node) {
@@ -2076,8 +2082,8 @@ function getNodeScroll(element) {
2076
2082
  };
2077
2083
  }
2078
2084
  return {
2079
- scrollLeft: element.pageXOffset,
2080
- scrollTop: element.pageYOffset
2085
+ scrollLeft: element.scrollX,
2086
+ scrollTop: element.scrollY
2081
2087
  };
2082
2088
  }
2083
2089
  function getParentNode(node) {
@@ -2120,7 +2126,7 @@ function getOverflowAncestors(node, list, traverseIframes) {
2120
2126
  return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
2121
2127
  }
2122
2128
 
2123
- // node_modules/.pnpm/@floating-ui+dom@1.6.3/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
2129
+ // node_modules/.pnpm/@floating-ui+dom@1.6.7/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
2124
2130
  function getCssDimensions(element) {
2125
2131
  const css2 = getComputedStyle(element);
2126
2132
  let width = parseFloat(css2.width) || 0;
@@ -2238,16 +2244,6 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
2238
2244
  y
2239
2245
  });
2240
2246
  }
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
2247
  function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
2252
2248
  let {
2253
2249
  elements,
@@ -2407,7 +2403,7 @@ function getClippingRect(_ref) {
2407
2403
  rootBoundary,
2408
2404
  strategy
2409
2405
  } = _ref;
2410
- const elementClippingAncestors = boundary === "clippingAncestors" ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
2406
+ const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
2411
2407
  const clippingAncestors = [...elementClippingAncestors, rootBoundary];
2412
2408
  const firstClippingAncestor = clippingAncestors[0];
2413
2409
  const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
@@ -2466,6 +2462,9 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
2466
2462
  height: rect.height
2467
2463
  };
2468
2464
  }
2465
+ function isStaticPositioned(element) {
2466
+ return getComputedStyle(element).position === "static";
2467
+ }
2469
2468
  function getTrueOffsetParent(element, polyfill) {
2470
2469
  if (!isHTMLElement(element) || getComputedStyle(element).position === "fixed") {
2471
2470
  return null;
@@ -2476,28 +2475,41 @@ function getTrueOffsetParent(element, polyfill) {
2476
2475
  return element.offsetParent;
2477
2476
  }
2478
2477
  function getOffsetParent(element, polyfill) {
2479
- const window2 = getWindow(element);
2480
- if (!isHTMLElement(element) || isTopLayer(element)) {
2481
- return window2;
2478
+ const win = getWindow(element);
2479
+ if (isTopLayer(element)) {
2480
+ return win;
2481
+ }
2482
+ if (!isHTMLElement(element)) {
2483
+ let svgOffsetParent = getParentNode(element);
2484
+ while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
2485
+ if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
2486
+ return svgOffsetParent;
2487
+ }
2488
+ svgOffsetParent = getParentNode(svgOffsetParent);
2489
+ }
2490
+ return win;
2482
2491
  }
2483
2492
  let offsetParent = getTrueOffsetParent(element, polyfill);
2484
- while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === "static") {
2493
+ while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
2485
2494
  offsetParent = getTrueOffsetParent(offsetParent, polyfill);
2486
2495
  }
2487
- if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle(offsetParent).position === "static" && !isContainingBlock(offsetParent))) {
2488
- return window2;
2496
+ if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
2497
+ return win;
2489
2498
  }
2490
- return offsetParent || getContainingBlock(element) || window2;
2499
+ return offsetParent || getContainingBlock(element) || win;
2491
2500
  }
2492
2501
  var getElementRects = async function(data) {
2493
2502
  const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
2494
2503
  const getDimensionsFn = this.getDimensions;
2504
+ const floatingDimensions = await getDimensionsFn(data.floating);
2495
2505
  return {
2496
2506
  reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
2497
- floating: __spreadValues({
2507
+ floating: {
2498
2508
  x: 0,
2499
- y: 0
2500
- }, await getDimensionsFn(data.floating))
2509
+ y: 0,
2510
+ width: floatingDimensions.width,
2511
+ height: floatingDimensions.height
2512
+ }
2501
2513
  };
2502
2514
  };
2503
2515
  function isRTL(element) {
@@ -2515,6 +2527,7 @@ var platform = {
2515
2527
  isElement,
2516
2528
  isRTL
2517
2529
  };
2530
+ var offset2 = offset;
2518
2531
  var flip2 = flip;
2519
2532
  var hide2 = hide;
2520
2533
  var arrow2 = arrow;
@@ -2531,7 +2544,7 @@ var computePosition2 = (reference, floating, options) => {
2531
2544
  }));
2532
2545
  };
2533
2546
 
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
2547
+ // node_modules/.pnpm/@warp-ds+core@1.1.5_@floating-ui+dom@1.6.7/node_modules/@warp-ds/core/dist/attention/utils/helpers.js
2535
2548
  var TOP_START = "top-start";
2536
2549
  var TOP = "top";
2537
2550
  var TOP_END = "top-end";
@@ -2622,10 +2635,12 @@ async function useRecompute(state) {
2622
2635
  computePosition2(targetEl, attentionEl, {
2623
2636
  placement: (_a = state == null ? void 0 : state.directionName) != null ? _a : BOTTOM,
2624
2637
  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 }),
2638
+ offset2({ mainAxis: (_b = state == null ? void 0 : state.distance) != null ? _b : 8, crossAxis: (_c = state == null ? void 0 : state.skidding) != null ? _c : 0 }),
2639
+ // offers flexibility over how to place the attentionEl towards its targetEl both on the x and y axis (horizontally and vertically).
2626
2640
  (state == null ? void 0 : state.flip) && flip2({
2627
2641
  // 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
2642
  crossAxis: state == null ? void 0 : state.crossAxis,
2643
+ // checks overflow to trigger a flip. When disabled, it will ignore overflow
2629
2644
  fallbackPlacements: state == null ? void 0 : state.fallbackPlacements
2630
2645
  }),
2631
2646
  !(state == null ? void 0 : state.noArrow) && (state == null ? void 0 : state.arrowEl) && arrow2({ element: state == null ? void 0 : state.arrowEl }),
@@ -2681,7 +2696,7 @@ async function useRecompute(state) {
2681
2696
  return state;
2682
2697
  }
2683
2698
 
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
2699
+ // node_modules/.pnpm/@warp-ds+css@2.0.0-next.4_@warp-ds+uno@2.0.0_unocss@0.61.3_postcss@8.4.39_rollup@4.18.1_vite@_fn7nbuinwdlc4yeboswpxt5lie/node_modules/@warp-ds/css/component-classes/index.js
2685
2700
  var box = {
2686
2701
  box: "group block relative break-words last-child:mb-0 p-16 rounded-8",
2687
2702
  // Relative here enables w-clickable
@@ -2980,12 +2995,9 @@ function detectLocale() {
2980
2995
  }
2981
2996
  }
2982
2997
  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;
2998
+ if (locale === "nb") return nbMsg;
2999
+ if (locale === "fi") return fiMsg;
3000
+ if (locale === "da") return daMsg;
2989
3001
  return enMsg;
2990
3002
  };
2991
3003
  var activateI18n = (enMessages, nbMessages, fiMessages, daMessages) => {
@@ -3014,8 +3026,7 @@ function kebabCaseAttributes(constructor) {
3014
3026
  function classes(defn) {
3015
3027
  const classes2 = [];
3016
3028
  for (const [key, value] of Object.entries(defn)) {
3017
- if (value)
3018
- classes2.push(key);
3029
+ if (value) classes2.push(key);
3019
3030
  }
3020
3031
  return classes2.join(" ");
3021
3032
  }
@@ -3035,7 +3046,7 @@ var messages3 = JSON.parse('{"attention.aria.callout":"Vihre\xE4 puhekupla, joka
3035
3046
  // packages/attention/locales/nb/messages.mjs
3036
3047
  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
3048
 
3038
- // node_modules/.pnpm/@warp-ds+icons@2.0.1/node_modules/@warp-ds/icons/dist/elements/close-16.js
3049
+ // node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/close-16.js
3039
3050
  import { LitElement } from "lit";
3040
3051
  import { unsafeStatic, html } from "lit/static-html.js";
3041
3052
  var messages5 = JSON.parse('{"icon.title.close":"Kryss"}');
@@ -3374,16 +3385,14 @@ ${JSON.stringify(directions)}`
3374
3385
  this.updateComplete.then(() => this.dispatchEvent(event));
3375
3386
  }
3376
3387
  keypressed(e) {
3377
- if (!this.canClose)
3378
- return;
3388
+ if (!this.canClose) return;
3379
3389
  if (e.key === "Escape") {
3380
3390
  e.preventDefault();
3381
3391
  this.close();
3382
3392
  }
3383
3393
  }
3384
3394
  render() {
3385
- if (!this.callout && this._targetEl === void 0)
3386
- return html2``;
3395
+ if (!this.callout && this._targetEl === void 0) return html2``;
3387
3396
  return html2`
3388
3397
  <div class=${ifDefined(this.className ? this.className : void 0)}>
3389
3398
  ${this.placement === "right-start" || this.placement === "right" || this.placement === "right-end" || this.placement === "bottom-start" || this.placement === "bottom" || this.placement === "bottom-end" ? html2`