@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
@@ -8,6 +8,9 @@ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
8
  var __getProtoOf = Object.getPrototypeOf;
9
9
  var __hasOwnProp = Object.prototype.hasOwnProperty;
10
10
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
+ var __typeError = (msg) => {
12
+ throw TypeError(msg);
13
+ };
11
14
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
15
  var __spreadValues = (a, b) => {
13
16
  for (var prop in b || (b = {}))
@@ -52,10 +55,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
52
55
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
53
56
  mod
54
57
  ));
55
- var __publicField = (obj, key, value) => {
56
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
57
- return value;
58
- };
58
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
59
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
60
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
61
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
59
62
 
60
63
  // node_modules/.pnpm/unraw@3.0.0/node_modules/unraw/dist/errors.js
61
64
  var require_errors = __commonJS({
@@ -228,8 +231,7 @@ var require_moo = __commonJS({
228
231
  return "(" + s + ")";
229
232
  }
230
233
  function reUnion(regexps) {
231
- if (!regexps.length)
232
- return "(?!)";
234
+ if (!regexps.length) return "(?!)";
233
235
  var source = regexps.map(function(s) {
234
236
  return "(?:" + s + ")";
235
237
  }).join("|");
@@ -239,14 +241,10 @@ var require_moo = __commonJS({
239
241
  if (typeof obj === "string") {
240
242
  return "(?:" + reEscape(obj) + ")";
241
243
  } 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");
244
+ if (obj.ignoreCase) throw new Error("RegExp /i flag not allowed");
245
+ if (obj.global) throw new Error("RegExp /g flag is implied");
246
+ if (obj.sticky) throw new Error("RegExp /y flag is implied");
247
+ if (obj.multiline) throw new Error("RegExp /m flag is implied");
250
248
  return obj.source;
251
249
  } else {
252
250
  throw new Error("Not a pattern: " + obj);
@@ -295,16 +293,14 @@ var require_moo = __commonJS({
295
293
  var match = [];
296
294
  rules.forEach(function(rule) {
297
295
  if (isObject(rule)) {
298
- if (match.length)
299
- result.push(ruleOptions(key, match));
296
+ if (match.length) result.push(ruleOptions(key, match));
300
297
  result.push(ruleOptions(key, rule));
301
298
  match = [];
302
299
  } else {
303
300
  match.push(rule);
304
301
  }
305
302
  });
306
- if (match.length)
307
- result.push(ruleOptions(key, match));
303
+ if (match.length) result.push(ruleOptions(key, match));
308
304
  }
309
305
  return result;
310
306
  }
@@ -439,8 +435,7 @@ var require_moo = __commonJS({
439
435
  var fallbackRule = errorRule && errorRule.fallback;
440
436
  var flags = hasSticky && !fallbackRule ? "ym" : "gm";
441
437
  var suffix2 = hasSticky || fallbackRule ? "" : "|";
442
- if (unicodeFlag === true)
443
- flags += "u";
438
+ if (unicodeFlag === true) flags += "u";
444
439
  var combined = new RegExp(reUnion(parts) + suffix2, flags);
445
440
  return { regexp: combined, groups, fast, error: errorRule || defaultErrorRule };
446
441
  }
@@ -461,8 +456,7 @@ var require_moo = __commonJS({
461
456
  var all = states.$all ? toRules(states.$all) : [];
462
457
  delete states.$all;
463
458
  var keys = Object.getOwnPropertyNames(states);
464
- if (!start)
465
- start = keys[0];
459
+ if (!start) start = keys[0];
466
460
  var ruleMap = /* @__PURE__ */ Object.create(null);
467
461
  for (var i = 0; i < keys.length; i++) {
468
462
  var key = keys[i];
@@ -474,8 +468,7 @@ var require_moo = __commonJS({
474
468
  var included = /* @__PURE__ */ Object.create(null);
475
469
  for (var j = 0; j < rules.length; j++) {
476
470
  var rule = rules[j];
477
- if (!rule.include)
478
- continue;
471
+ if (!rule.include) continue;
479
472
  var splice = [j, 1];
480
473
  if (rule.include !== key && !included[rule.include]) {
481
474
  included[rule.include] = true;
@@ -485,8 +478,7 @@ var require_moo = __commonJS({
485
478
  }
486
479
  for (var k = 0; k < newRules.length; k++) {
487
480
  var newRule = newRules[k];
488
- if (rules.indexOf(newRule) !== -1)
489
- continue;
481
+ if (rules.indexOf(newRule) !== -1) continue;
490
482
  splice.push(newRule);
491
483
  }
492
484
  }
@@ -567,8 +559,7 @@ var require_moo = __commonJS({
567
559
  };
568
560
  };
569
561
  Lexer.prototype.setState = function(state) {
570
- if (!state || this.state === state)
571
- return;
562
+ if (!state || this.state === state) return;
572
563
  this.state = state;
573
564
  var info = this.states[state];
574
565
  this.groups = info.groups;
@@ -672,12 +663,9 @@ var require_moo = __commonJS({
672
663
  var err = new Error(this.formatError(token, "invalid syntax"));
673
664
  throw err;
674
665
  }
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);
666
+ if (group.pop) this.popState();
667
+ else if (group.push) this.pushState(group.push);
668
+ else if (group.next) this.setState(group.next);
681
669
  return token;
682
670
  };
683
671
  if (typeof Symbol !== "undefined" && Symbol.iterator) {
@@ -1030,10 +1018,20 @@ var require_parser = __commonJS({
1030
1018
  // packages/toast/toast.js
1031
1019
  import { css, html as html5 } from "lit";
1032
1020
 
1033
- // node_modules/.pnpm/@lingui+core@4.7.1/node_modules/@lingui/core/dist/index.mjs
1021
+ // node_modules/.pnpm/@chbphone55+classnames@2.0.0/node_modules/@chbphone55/classnames/dist/index.m.js
1022
+ var r = function() {
1023
+ for (var t = [], n = arguments.length; n--; ) t[n] = arguments[n];
1024
+ return t.reduce(function(t2, n2) {
1025
+ 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) {
1026
+ return n2[r2] ? r2 : "";
1027
+ }) : "");
1028
+ }, []).join(" ");
1029
+ };
1030
+
1031
+ // node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
1034
1032
  var import_unraw = __toESM(require_dist(), 1);
1035
1033
 
1036
- // node_modules/.pnpm/@lingui+message-utils@4.7.1/node_modules/@lingui/message-utils/dist/compileMessage.mjs
1034
+ // node_modules/.pnpm/@lingui+message-utils@4.11.2/node_modules/@lingui/message-utils/dist/compileMessage.mjs
1037
1035
  var import_parser = __toESM(require_parser(), 1);
1038
1036
  function processTokens(tokens, mapText) {
1039
1037
  if (!tokens.filter((token) => token.type !== "content").length) {
@@ -1057,11 +1055,9 @@ function processTokens(tokens, mapText) {
1057
1055
  }
1058
1056
  const offset = token.pluralOffset;
1059
1057
  const formatProps = {};
1060
- token.cases.forEach((item) => {
1061
- formatProps[item.key.replace(/^=(.)+/, "$1")] = processTokens(
1062
- item.tokens,
1063
- mapText
1064
- );
1058
+ token.cases.forEach(({ key, tokens: tokens2 }) => {
1059
+ const prop = key[0] === "=" ? key.slice(1) : key;
1060
+ formatProps[prop] = processTokens(tokens2, mapText);
1065
1061
  });
1066
1062
  return [
1067
1063
  token.arg,
@@ -1083,7 +1079,7 @@ Message: ${message}`);
1083
1079
  }
1084
1080
  }
1085
1081
 
1086
- // node_modules/.pnpm/@lingui+core@4.7.1/node_modules/@lingui/core/dist/index.mjs
1082
+ // node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
1087
1083
  var isString = (s) => typeof s === "string";
1088
1084
  var isFunction = (f) => typeof f === "function";
1089
1085
  var cache = /* @__PURE__ */ new Map();
@@ -1169,11 +1165,11 @@ var selectFormatter = (value, rules) => {
1169
1165
  function interpolate(translation, locale, locales) {
1170
1166
  return (values = {}, formats) => {
1171
1167
  const formatters = getDefaultFormats(locale, locales, formats);
1172
- const formatMessage = (tokens) => {
1168
+ const formatMessage = (tokens, replaceOctothorpe = false) => {
1173
1169
  if (!Array.isArray(tokens))
1174
1170
  return tokens;
1175
1171
  return tokens.reduce((message, token) => {
1176
- if (token === "#") {
1172
+ if (token === "#" && replaceOctothorpe) {
1177
1173
  return message + OCTOTHORPE_PH;
1178
1174
  }
1179
1175
  if (isString(token)) {
@@ -1184,7 +1180,10 @@ function interpolate(translation, locale, locales) {
1184
1180
  if (type === "plural" || type === "selectordinal" || type === "select") {
1185
1181
  Object.entries(format).forEach(
1186
1182
  ([key, value2]) => {
1187
- interpolatedFormat[key] = formatMessage(value2);
1183
+ interpolatedFormat[key] = formatMessage(
1184
+ value2,
1185
+ type === "plural" || type === "selectordinal"
1186
+ );
1188
1187
  }
1189
1188
  );
1190
1189
  } else {
@@ -1352,6 +1351,9 @@ var I18n = class extends EventEmitter {
1352
1351
  }
1353
1352
  _(id, values, options) {
1354
1353
  let message = options == null ? void 0 : options.message;
1354
+ if (!id) {
1355
+ id = "";
1356
+ }
1355
1357
  if (!isString(id)) {
1356
1358
  values = id.values || values;
1357
1359
  message = id.message;
@@ -1392,28 +1394,19 @@ function setupI18n(params = {}) {
1392
1394
  }
1393
1395
  var i18n = setupI18n();
1394
1396
 
1395
- // 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
1396
- var box = {
1397
- box: "group block relative break-words last-child:mb-0 p-16 rounded-8",
1398
- // Relative here enables w-clickable
1399
- bleed: "-mx-16 sm:mx-0 rounded-l-0 rounded-r-0 sm:rounded-8",
1400
- // We target L and R to override the default rounded-8
1401
- info: "s-bg-info-subtle",
1402
- neutral: "s-surface-sunken",
1403
- bordered: "border-2 s-border s-bg"
1404
- };
1397
+ // 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
1405
1398
  var toaster = {
1406
- container: "fixed transform translate-z-0 bottom-16 left-0 right-0 mx-8 sm:mx-16 z-50 pointer-events-none",
1407
- content: "w-full",
1408
- toaster: "grid auto-rows-auto justify-items-center justify-center mx-auto pointer-events-none"
1399
+ wrapper: "fixed transform translate-z-0 bottom-16 left-0 right-0 mx-8 sm:mx-16 z-50 pointer-events-none",
1400
+ base: "grid auto-rows-auto justify-items-center justify-center mx-auto pointer-events-none",
1401
+ content: "w-full"
1409
1402
  };
1410
1403
  var toast = {
1411
1404
  wrapper: "relative overflow-hidden w-full",
1412
- toast: "flex group p-8 mt-16 rounded-8 border-2 w-full pointer-events-auto transition-all",
1405
+ base: "flex group p-8 mt-16 rounded-8 border-2 pointer-events-auto transition-all",
1413
1406
  positive: "s-bg-positive-subtle s-border-positive-subtle s-text",
1414
1407
  warning: "s-bg-warning-subtle s-border-warning-subtle s-text",
1415
1408
  negative: "s-bg-negative-subtle s-border-negative-subtle s-text",
1416
- icon: "shrink-0 rounded-full w-[16px] h-[16px] m-[8px]",
1409
+ iconBase: "shrink-0 rounded-full w-[16px] h-[16px] m-[8px]",
1417
1410
  iconPositive: "s-icon-positive",
1418
1411
  iconWarning: "s-icon-warning",
1419
1412
  iconNegative: "s-icon-negative",
@@ -1421,31 +1414,6 @@ var toast = {
1421
1414
  content: "self-center mr-8 py-4 last-child:mb-0",
1422
1415
  close: "bg-transparent ml-auto p-[8px] s-icon hover:s-icon-hover active:s-icon-active"
1423
1416
  };
1424
- var buttonReset = "focus:outline-none appearance-none cursor-pointer bg-transparent border-0 m-0 p-0 inline-block";
1425
- var expandable = {
1426
- expandable: "will-change-height",
1427
- expandableTitle: "font-bold s-text",
1428
- expandableBox: "s-surface-sunken hover:s-bg-hover active:s-bg-active py-0 px-0 " + box.box,
1429
- expandableInfo: "s-bg-info-subtle! hover:s-bg-info-subtle-hover!",
1430
- expandableBleed: box.bleed,
1431
- chevron: "inline-block align-middle s-icon",
1432
- chevronNonBox: "ml-8",
1433
- chevronBox: "",
1434
- chevronTransform: "transform transition-transform transform-gpu ease-in-out",
1435
- chevronExpand: "-rotate-180",
1436
- chevronCollapse: "rotate-180",
1437
- 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",
1438
- elementsChevronDownExpandPart: "part-[w-icon-chevron-down-16-part]:-rotate-180",
1439
- 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",
1440
- elementsChevronUpCollapsePart: "part-[w-icon-chevron-up-16-part]:rotate-180",
1441
- expansion: "overflow-hidden",
1442
- expansionNotExpanded: "h-0 invisible",
1443
- button: buttonReset + " hover:underline focus-visible:underline",
1444
- buttonBox: "w-full text-left relative inline-flex items-center justify-between " + box.box,
1445
- paddingTop: "pt-0",
1446
- title: "flex w-full justify-between items-center",
1447
- titleType: "h4"
1448
- };
1449
1417
  var buttonDefaultStyling = "font-bold focusable justify-center transition-colors ease-in-out";
1450
1418
  var buttonColors = {
1451
1419
  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]",
@@ -1563,7 +1531,7 @@ var button = {
1563
1531
  };
1564
1532
  var modal = {
1565
1533
  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]",
1566
- 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",
1534
+ 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",
1567
1535
  content: "block overflow-y-auto overflow-x-hidden last-child:mb-0 grow shrink px-16 sm:px-32 relative",
1568
1536
  footer: "flex justify-end shrink-0 px-16 sm:px-32",
1569
1537
  transitionTitle: "transition-all duration-300",
@@ -1577,19 +1545,15 @@ var modal = {
1577
1545
  titleButtonIcon: "h-16 w-16 sm:h-24 sm:w-24",
1578
1546
  titleButtonIconRotated: "transform rotate-90"
1579
1547
  };
1580
- var label = {
1581
- label: "antialiased block relative text-s font-bold pb-4 cursor-pointer s-text",
1582
- optional: "pl-8 font-normal text-s s-text-subtle"
1583
- };
1584
- var prefixSuffixWrapperBase = "absolute top-0 bottom-0 flex justify-center items-center focusable rounded-4 focus:[--w-outline-offset:-2px] bg-transparent ";
1548
+ var prefixSuffixWrapper = "absolute top-0 bottom-0 flex justify-center items-center focusable rounded-4 focus:[--w-outline-offset:-2px] bg-transparent ";
1585
1549
  var suffix = {
1586
- wrapper: prefixSuffixWrapperBase + "right-0",
1550
+ wrapper: prefixSuffixWrapper + "right-0",
1587
1551
  wrapperWithLabel: "w-max pr-12",
1588
1552
  wrapperWithIcon: "w-40",
1589
1553
  label: "antialiased block relative cursor-default pb-0 font-bold text-xs s-text"
1590
1554
  };
1591
1555
  var prefix = {
1592
- wrapper: prefixSuffixWrapperBase + "left-0",
1556
+ wrapper: prefixSuffixWrapper + "left-0",
1593
1557
  wrapperWithLabel: "w-max pl-12",
1594
1558
  wrapperWithIcon: "w-40",
1595
1559
  label: "antialiased block relative cursor-default pb-0 font-bold text-xs s-text"
@@ -1646,15 +1610,9 @@ var deadToggle = {
1646
1610
  wrapper: `${toggle.wrapper} h-20 w-20 pointer-events-none`,
1647
1611
  input: `${toggle.input} hidden`,
1648
1612
  inputVue: "hidden",
1613
+ labelVue: "-mt-2",
1649
1614
  labelRadio: `${toggle.label} ${toggle.labelBefore} ${toggle.radio}`,
1650
- labelCheckbox: `${toggle.label} ${toggle.labelBefore} ${toggle.checkbox}`,
1651
- labelVue: "-mt-2"
1652
- };
1653
- var clickable = {
1654
- toggle: "absolute inset-0 h-full w-full appearance-none cursor-pointer focusable focusable-inset",
1655
- label: `px-12 ${label.label} py-8! cursor-pointer focusable focusable-inset`,
1656
- buttonOrLink: "bg-transparent focusable",
1657
- buttonOrLinkStretch: "inset-0 absolute"
1615
+ labelCheckbox: `${toggle.label} ${toggle.labelBefore} ${toggle.checkbox}`
1658
1616
  };
1659
1617
  var attention = {
1660
1618
  base: "border-2 relative flex items-start",
@@ -1693,8 +1651,7 @@ var prefersMotion = true;
1693
1651
  if (windowExists) {
1694
1652
  const query = window.matchMedia("(prefers-reduced-motion: reduce)");
1695
1653
  const callback = ({ matches }) => prefersMotion = !matches;
1696
- if (query.addEventListener)
1697
- query.addEventListener("change", callback);
1654
+ if (query.addEventListener) query.addEventListener("change", callback);
1698
1655
  callback(query);
1699
1656
  }
1700
1657
  var removeTransition = (el) => {
@@ -1711,19 +1668,16 @@ var addTransition = (el) => {
1711
1668
  var getAfterExpandCallback = (el, done) => () => {
1712
1669
  el.style.height = "auto";
1713
1670
  el.style.overflow = null;
1714
- if (done)
1715
- done();
1671
+ if (done) done();
1716
1672
  };
1717
1673
  var getAfterCollapseCallback = (done) => () => {
1718
- if (done)
1719
- done();
1674
+ if (done) done();
1720
1675
  };
1721
1676
  var expand = (el, done) => {
1722
1677
  const returnPromise = (() => {
1723
- if (!done)
1724
- return new Promise((r) => {
1725
- done = r;
1726
- });
1678
+ if (!done) return new Promise((r2) => {
1679
+ done = r2;
1680
+ });
1727
1681
  })();
1728
1682
  const afterExpandCallback = getAfterExpandCallback(el, done);
1729
1683
  removeTransition(el);
@@ -1736,15 +1690,13 @@ var expand = (el, done) => {
1736
1690
  addTransition(el);
1737
1691
  requestAnimationFrame(() => el.style.height = dest + "px");
1738
1692
  });
1739
- if (returnPromise)
1740
- return returnPromise;
1693
+ if (returnPromise) return returnPromise;
1741
1694
  };
1742
1695
  var collapse = (el, done) => {
1743
1696
  const returnPromise = (() => {
1744
- if (!done)
1745
- return new Promise((r) => {
1746
- done = r;
1747
- });
1697
+ if (!done) return new Promise((r2) => {
1698
+ done = r2;
1699
+ });
1748
1700
  })();
1749
1701
  const afterCollapseCallback = getAfterCollapseCallback(done);
1750
1702
  removeTransition(el);
@@ -1756,15 +1708,13 @@ var collapse = (el, done) => {
1756
1708
  addTransition(el);
1757
1709
  requestAnimationFrame(() => el.style.height = "0px");
1758
1710
  });
1759
- if (returnPromise)
1760
- return returnPromise;
1711
+ if (returnPromise) return returnPromise;
1761
1712
  };
1762
1713
 
1763
1714
  // packages/toast/toast.js
1764
- import { classMap } from "lit/directives/class-map.js";
1765
1715
  import { when } from "lit/directives/when.js";
1766
1716
 
1767
- // node_modules/.pnpm/@warp-ds+icons@2.0.1/node_modules/@warp-ds/icons/dist/elements/warning-16.js
1717
+ // node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/warning-16.js
1768
1718
  import { LitElement } from "lit";
1769
1719
  import { unsafeStatic, html } from "lit/static-html.js";
1770
1720
  var messages = JSON.parse('{"icon.title.warning":"Varseltrekant med utropstegn"}');
@@ -1855,7 +1805,7 @@ if (!customElements.get("w-icon-warning-16")) {
1855
1805
  customElements.define("w-icon-warning-16", IconWarning16);
1856
1806
  }
1857
1807
 
1858
- // node_modules/.pnpm/@warp-ds+icons@2.0.1/node_modules/@warp-ds/icons/dist/elements/error-16.js
1808
+ // node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/error-16.js
1859
1809
  import { LitElement as LitElement2 } from "lit";
1860
1810
  import { unsafeStatic as unsafeStatic2, html as html2 } from "lit/static-html.js";
1861
1811
  var messages4 = JSON.parse('{"icon.title.error":"\xC5ttekant med utropstegn"}');
@@ -1946,7 +1896,7 @@ if (!customElements.get("w-icon-error-16")) {
1946
1896
  customElements.define("w-icon-error-16", IconError16);
1947
1897
  }
1948
1898
 
1949
- // node_modules/.pnpm/@warp-ds+icons@2.0.1/node_modules/@warp-ds/icons/dist/elements/success-16.js
1899
+ // node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/success-16.js
1950
1900
  import { LitElement as LitElement3 } from "lit";
1951
1901
  import { unsafeStatic as unsafeStatic3, html as html3 } from "lit/static-html.js";
1952
1902
  var messages5 = JSON.parse('{"icon.title.success":"Sirkel med sjekkmerke"}');
@@ -2037,7 +1987,7 @@ if (!customElements.get("w-icon-success-16")) {
2037
1987
  customElements.define("w-icon-success-16", IconSuccess16);
2038
1988
  }
2039
1989
 
2040
- // node_modules/.pnpm/@warp-ds+icons@2.0.1/node_modules/@warp-ds/icons/dist/elements/close-16.js
1990
+ // node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/close-16.js
2041
1991
  import { LitElement as LitElement4 } from "lit";
2042
1992
  import { unsafeStatic as unsafeStatic4, html as html4 } from "lit/static-html.js";
2043
1993
  var messages6 = JSON.parse('{"icon.title.close":"Kryss"}');
@@ -2150,12 +2100,9 @@ function detectLocale5() {
2150
2100
  }
2151
2101
  }
2152
2102
  var getMessages5 = (locale, enMsg, nbMsg, fiMsg, daMsg) => {
2153
- if (locale === "nb")
2154
- return nbMsg;
2155
- if (locale === "fi")
2156
- return fiMsg;
2157
- if (locale === "da")
2158
- return daMsg;
2103
+ if (locale === "nb") return nbMsg;
2104
+ if (locale === "fi") return fiMsg;
2105
+ if (locale === "da") return daMsg;
2159
2106
  return enMsg;
2160
2107
  };
2161
2108
  var activateI18n5 = (enMessages, nbMessages, fiMessages, daMessages) => {
@@ -2178,23 +2125,16 @@ var messages9 = JSON.parse('{"toast.aria.error":"Virhe","toast.aria.successful":
2178
2125
  var messages10 = JSON.parse('{"toast.aria.error":"Feil","toast.aria.successful":"Vellykket","toast.aria.warning":"Advarsel"}');
2179
2126
 
2180
2127
  // packages/toast/toast.js
2181
- var classes = (definition) => {
2182
- const defn = {};
2183
- for (const [key, value] of Object.entries(definition)) {
2184
- for (const className of key.split(" ")) {
2185
- defn[className] = value;
2186
- }
2187
- }
2188
- return classMap(defn);
2189
- };
2190
2128
  var toastType = {
2191
2129
  success: "success",
2192
2130
  error: "error",
2193
2131
  warning: "warning"
2194
2132
  };
2133
+ var _WarpToast_instances, primaryClasses_get, iconClasses_get;
2195
2134
  var WarpToast = class extends WarpElement {
2196
2135
  constructor() {
2197
2136
  super();
2137
+ __privateAdd(this, _WarpToast_instances);
2198
2138
  activateI18n5(messages8, messages10, messages9, messages7);
2199
2139
  this.id = Date.now().toString(36) + Math.random().toString(36).slice(2, 5);
2200
2140
  this.type = "success";
@@ -2208,24 +2148,7 @@ var WarpToast = class extends WarpElement {
2208
2148
  super.disconnectedCallback();
2209
2149
  }
2210
2150
  updated() {
2211
- if (!this._expanded && this._wrapper)
2212
- expand(this._wrapper, () => this._expanded = true);
2213
- }
2214
- get _primaryClasses() {
2215
- return classes({
2216
- [toast.toast]: true,
2217
- [toast.positive]: this.type === toastType.success,
2218
- [toast.warning]: this.type === toastType.warning,
2219
- [toast.negative]: this.type === toastType.error
2220
- });
2221
- }
2222
- get _iconClasses() {
2223
- return classes({
2224
- [toast.icon]: true,
2225
- [toast.iconPositive]: this.type === toastType.success,
2226
- [toast.iconWarning]: this.type === toastType.warning,
2227
- [toast.iconNegative]: this.type === toastType.error
2228
- });
2151
+ if (!this._expanded && this._wrapper) expand(this._wrapper, () => this._expanded = true);
2229
2152
  }
2230
2153
  get _wrapper() {
2231
2154
  var _a, _b;
@@ -2263,19 +2186,14 @@ var WarpToast = class extends WarpElement {
2263
2186
  }
2264
2187
  }
2265
2188
  get _iconMarkup() {
2266
- if (this._warning)
2267
- return html5`<w-icon-warning-16></w-icon-warning-16>`;
2268
- if (this._error)
2269
- return html5`<w-icon-error-16></w-icon-error-16>`;
2270
- else
2271
- return html5`<w-icon-success-16></w-icon-success-16>`;
2189
+ if (this._warning) return html5`<w-icon-warning-16></w-icon-warning-16>`;
2190
+ if (this._error) return html5`<w-icon-error-16></w-icon-error-16>`;
2191
+ else return html5`<w-icon-success-16></w-icon-success-16>`;
2272
2192
  }
2273
2193
  async collapse() {
2274
2194
  return new Promise((resolve) => {
2275
- if (this._expanded && this._wrapper)
2276
- collapse(this._wrapper, resolve);
2277
- else
2278
- resolve();
2195
+ if (this._expanded && this._wrapper) collapse(this._wrapper, resolve);
2196
+ else resolve();
2279
2197
  });
2280
2198
  }
2281
2199
  close() {
@@ -2287,11 +2205,10 @@ var WarpToast = class extends WarpElement {
2287
2205
  this.updateComplete.then(() => this.dispatchEvent(event));
2288
2206
  }
2289
2207
  render() {
2290
- if (!this.text)
2291
- return html5``;
2208
+ if (!this.text) return html5``;
2292
2209
  return html5` <section class="${toast.wrapper}" aria-label="${this._typeLabel}">
2293
- <div class="${this._primaryClasses}">
2294
- <div class="${this._iconClasses}">${this._iconMarkup}</div>
2210
+ <div class="${__privateGet(this, _WarpToast_instances, primaryClasses_get)}">
2211
+ <div class="${__privateGet(this, _WarpToast_instances, iconClasses_get)}">${this._iconMarkup}</div>
2295
2212
  <div role="${this._role}" class="${toast.content}">
2296
2213
  <p>${this.text}</p>
2297
2214
  </div>
@@ -2307,6 +2224,23 @@ var WarpToast = class extends WarpElement {
2307
2224
  </section>`;
2308
2225
  }
2309
2226
  };
2227
+ _WarpToast_instances = new WeakSet();
2228
+ primaryClasses_get = function() {
2229
+ return r([
2230
+ toast.base,
2231
+ this.type === toastType.success && toast.positive,
2232
+ this.type === toastType.warning && toast.warning,
2233
+ this.type === toastType.error && toast.negative
2234
+ ]);
2235
+ };
2236
+ iconClasses_get = function() {
2237
+ return r([
2238
+ toast.iconBase,
2239
+ this.type === toastType.success && toast.iconPositive,
2240
+ this.type === toastType.warning && toast.iconWarning,
2241
+ this.type === toastType.error && toast.iconNegative
2242
+ ]);
2243
+ };
2310
2244
  __publicField(WarpToast, "styles", [
2311
2245
  WarpElement.styles,
2312
2246
  css`
@@ -2340,10 +2274,8 @@ var WarpToastContainer = class extends WarpElement2 {
2340
2274
  const keep = [];
2341
2275
  const remove = [];
2342
2276
  for (const toast3 of this._toasts) {
2343
- if (Date.now() <= toast3[1].duration)
2344
- keep.push(toast3);
2345
- else
2346
- remove.push(toast3);
2277
+ if (Date.now() <= toast3[1].duration) keep.push(toast3);
2278
+ else remove.push(toast3);
2347
2279
  }
2348
2280
  const collapseTasks = [];
2349
2281
  for (const [id] of remove) {
@@ -2351,15 +2283,13 @@ var WarpToastContainer = class extends WarpElement2 {
2351
2283
  collapseTasks.push(el.collapse());
2352
2284
  }
2353
2285
  Promise.all(collapseTasks).then(() => {
2354
- if (keep.length !== this._toasts.size)
2355
- this._toasts = new Map(keep);
2286
+ if (keep.length !== this._toasts.size) this._toasts = new Map(keep);
2356
2287
  });
2357
2288
  }, 500);
2358
2289
  }
2359
2290
  disconnectedCallback() {
2360
2291
  super.disconnectedCallback();
2361
- if (this._interval)
2362
- clearTimeout(this._interval);
2292
+ if (this._interval) clearTimeout(this._interval);
2363
2293
  }
2364
2294
  static init() {
2365
2295
  let el = document.querySelector("w-toast-container");
@@ -2381,8 +2311,7 @@ var WarpToastContainer = class extends WarpElement2 {
2381
2311
  if (!id) {
2382
2312
  throw new Error('undefined "id" given when attempting to retrieve toast');
2383
2313
  }
2384
- if (typeof id !== "string" && !Number.isInteger(id))
2385
- throw new Error('"id" must be number or string when attempting to retrieve toast');
2314
+ if (typeof id !== "string" && !Number.isInteger(id)) throw new Error('"id" must be number or string when attempting to retrieve toast');
2386
2315
  return this._toasts.get(id);
2387
2316
  }
2388
2317
  /**
@@ -2391,8 +2320,7 @@ var WarpToastContainer = class extends WarpElement2 {
2391
2320
  * @returns {WarpToastContainer}
2392
2321
  */
2393
2322
  set(toast3) {
2394
- if (!toast3.id)
2395
- throw new Error('invalid or undefined "id" on toast object');
2323
+ if (!toast3.id) throw new Error('invalid or undefined "id" on toast object');
2396
2324
  const result = this._toasts.set(toast3.id, __spreadProps(__spreadValues({}, toast3), {
2397
2325
  duration: Date.now() + (toast3.duration || 5e3)
2398
2326
  }));
@@ -2408,11 +2336,9 @@ var WarpToastContainer = class extends WarpElement2 {
2408
2336
  if (!id) {
2409
2337
  throw new Error('undefined "id" given when attempting to retrieve toast');
2410
2338
  }
2411
- if (typeof id !== "string" && !Number.isInteger(id))
2412
- throw new Error('"id" must be number or string when attempting to retrieve toast');
2339
+ if (typeof id !== "string" && !Number.isInteger(id)) throw new Error('"id" must be number or string when attempting to retrieve toast');
2413
2340
  const el = this.renderRoot.querySelector(`#${id}`);
2414
- if (!this._toasts.has(id))
2415
- return false;
2341
+ if (!this._toasts.has(id)) return false;
2416
2342
  await el.collapse();
2417
2343
  const result = this._toasts.delete(id);
2418
2344
  this._toasts = new Map(Array.from(this._toasts));
@@ -2420,8 +2346,8 @@ var WarpToastContainer = class extends WarpElement2 {
2420
2346
  }
2421
2347
  render() {
2422
2348
  return html6`
2423
- <aside class="${toaster.container}">
2424
- <div class="${toaster.toaster}" id="w-toast-container-list">
2349
+ <aside class="${toaster.wrapper}">
2350
+ <div class="${toaster.base}" id="w-toast-container-list">
2425
2351
  ${repeat(
2426
2352
  this._toastsArray,
2427
2353
  (toast3) => toast3.id,
@@ -2459,8 +2385,7 @@ var windowExists2 = typeof window !== "undefined";
2459
2385
 
2460
2386
  // packages/toast/api.js
2461
2387
  function toast2(message, options) {
2462
- if (!windowExists2)
2463
- return;
2388
+ if (!windowExists2) return;
2464
2389
  const toast3 = customElements.get("w-toast-container").init();
2465
2390
  const data = __spreadValues({
2466
2391
  id: Date.now().toString(36) + Math.random().toString(36).slice(2, 5),
@@ -2472,14 +2397,12 @@ function toast2(message, options) {
2472
2397
  return data;
2473
2398
  }
2474
2399
  function removeToast(id) {
2475
- if (!windowExists2)
2476
- return;
2400
+ if (!windowExists2) return;
2477
2401
  const toast3 = customElements.get("w-toast-container").init();
2478
2402
  return toast3.del(id);
2479
2403
  }
2480
2404
  function updateToast(id, options) {
2481
- if (!windowExists2)
2482
- return;
2405
+ if (!windowExists2) return;
2483
2406
  const toast3 = customElements.get("w-toast-container").init();
2484
2407
  toast3.set(__spreadValues(__spreadValues({}, toast3.get(id)), options));
2485
2408
  return toast3.get(id);