@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
@@ -23,7 +23,7 @@ export class ModalHeader extends ModalHeader_base {
23
23
  };
24
24
  };
25
25
  static styles: any[];
26
- titleEl: import(".pnpm/lit-html@3.1.4/node_modules/lit-html/directives/ref.js").Ref<Element>;
26
+ titleEl: import("lit/directives/ref.js").Ref<Element>;
27
27
  _hasTopContent: boolean;
28
28
  render(): import("lit").TemplateResult<1>;
29
29
  willUpdate(changedProperties: any): Promise<void>;
@@ -18,9 +18,9 @@ export class ModalMain extends ModalMain_base {
18
18
  };
19
19
  };
20
20
  static styles: any[];
21
- dialogEl: import(".pnpm/lit-html@3.1.4/node_modules/lit-html/directives/ref.js").Ref<Element>;
22
- dialogInnerEl: import(".pnpm/lit-html@3.1.4/node_modules/lit-html/directives/ref.js").Ref<Element>;
23
- contentEl: import(".pnpm/lit-html@3.1.4/node_modules/lit-html/directives/ref.js").Ref<Element>;
21
+ dialogEl: import("lit/directives/ref.js").Ref<Element>;
22
+ dialogInnerEl: import("lit/directives/ref.js").Ref<Element>;
23
+ contentEl: import("lit/directives/ref.js").Ref<Element>;
24
24
  /** @param {KeyboardEvent} evt */
25
25
  interceptEscape(evt: KeyboardEvent): void;
26
26
  /** @param {MouseEvent} evt */
@@ -49,10 +49,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
49
49
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
50
50
  mod
51
51
  ));
52
- var __publicField = (obj, key, value) => {
53
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
54
- return value;
55
- };
52
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
56
53
 
57
54
  // node_modules/.pnpm/unraw@3.0.0/node_modules/unraw/dist/errors.js
58
55
  var require_errors = __commonJS({
@@ -225,8 +222,7 @@ var require_moo = __commonJS({
225
222
  return "(" + s + ")";
226
223
  }
227
224
  function reUnion(regexps) {
228
- if (!regexps.length)
229
- return "(?!)";
225
+ if (!regexps.length) return "(?!)";
230
226
  var source = regexps.map(function(s) {
231
227
  return "(?:" + s + ")";
232
228
  }).join("|");
@@ -236,14 +232,10 @@ var require_moo = __commonJS({
236
232
  if (typeof obj === "string") {
237
233
  return "(?:" + reEscape(obj) + ")";
238
234
  } else if (isRegExp(obj)) {
239
- if (obj.ignoreCase)
240
- throw new Error("RegExp /i flag not allowed");
241
- if (obj.global)
242
- throw new Error("RegExp /g flag is implied");
243
- if (obj.sticky)
244
- throw new Error("RegExp /y flag is implied");
245
- if (obj.multiline)
246
- throw new Error("RegExp /m flag is implied");
235
+ if (obj.ignoreCase) throw new Error("RegExp /i flag not allowed");
236
+ if (obj.global) throw new Error("RegExp /g flag is implied");
237
+ if (obj.sticky) throw new Error("RegExp /y flag is implied");
238
+ if (obj.multiline) throw new Error("RegExp /m flag is implied");
247
239
  return obj.source;
248
240
  } else {
249
241
  throw new Error("Not a pattern: " + obj);
@@ -292,16 +284,14 @@ var require_moo = __commonJS({
292
284
  var match = [];
293
285
  rules.forEach(function(rule) {
294
286
  if (isObject(rule)) {
295
- if (match.length)
296
- result.push(ruleOptions(key, match));
287
+ if (match.length) result.push(ruleOptions(key, match));
297
288
  result.push(ruleOptions(key, rule));
298
289
  match = [];
299
290
  } else {
300
291
  match.push(rule);
301
292
  }
302
293
  });
303
- if (match.length)
304
- result.push(ruleOptions(key, match));
294
+ if (match.length) result.push(ruleOptions(key, match));
305
295
  }
306
296
  return result;
307
297
  }
@@ -436,8 +426,7 @@ var require_moo = __commonJS({
436
426
  var fallbackRule = errorRule && errorRule.fallback;
437
427
  var flags = hasSticky && !fallbackRule ? "ym" : "gm";
438
428
  var suffix2 = hasSticky || fallbackRule ? "" : "|";
439
- if (unicodeFlag === true)
440
- flags += "u";
429
+ if (unicodeFlag === true) flags += "u";
441
430
  var combined = new RegExp(reUnion(parts) + suffix2, flags);
442
431
  return { regexp: combined, groups, fast, error: errorRule || defaultErrorRule };
443
432
  }
@@ -458,8 +447,7 @@ var require_moo = __commonJS({
458
447
  var all = states.$all ? toRules(states.$all) : [];
459
448
  delete states.$all;
460
449
  var keys = Object.getOwnPropertyNames(states);
461
- if (!start)
462
- start = keys[0];
450
+ if (!start) start = keys[0];
463
451
  var ruleMap = /* @__PURE__ */ Object.create(null);
464
452
  for (var i = 0; i < keys.length; i++) {
465
453
  var key = keys[i];
@@ -471,8 +459,7 @@ var require_moo = __commonJS({
471
459
  var included = /* @__PURE__ */ Object.create(null);
472
460
  for (var j = 0; j < rules.length; j++) {
473
461
  var rule = rules[j];
474
- if (!rule.include)
475
- continue;
462
+ if (!rule.include) continue;
476
463
  var splice = [j, 1];
477
464
  if (rule.include !== key && !included[rule.include]) {
478
465
  included[rule.include] = true;
@@ -482,8 +469,7 @@ var require_moo = __commonJS({
482
469
  }
483
470
  for (var k = 0; k < newRules.length; k++) {
484
471
  var newRule = newRules[k];
485
- if (rules.indexOf(newRule) !== -1)
486
- continue;
472
+ if (rules.indexOf(newRule) !== -1) continue;
487
473
  splice.push(newRule);
488
474
  }
489
475
  }
@@ -564,8 +550,7 @@ var require_moo = __commonJS({
564
550
  };
565
551
  };
566
552
  Lexer.prototype.setState = function(state) {
567
- if (!state || this.state === state)
568
- return;
553
+ if (!state || this.state === state) return;
569
554
  this.state = state;
570
555
  var info = this.states[state];
571
556
  this.groups = info.groups;
@@ -669,12 +654,9 @@ var require_moo = __commonJS({
669
654
  var err = new Error(this.formatError(token, "invalid syntax"));
670
655
  throw err;
671
656
  }
672
- if (group.pop)
673
- this.popState();
674
- else if (group.push)
675
- this.pushState(group.push);
676
- else if (group.next)
677
- this.setState(group.next);
657
+ if (group.pop) this.popState();
658
+ else if (group.push) this.pushState(group.push);
659
+ else if (group.next) this.setState(group.next);
678
660
  return token;
679
661
  };
680
662
  if (typeof Symbol !== "undefined" && Symbol.iterator) {
@@ -1024,14 +1006,14 @@ var require_parser = __commonJS({
1024
1006
  }
1025
1007
  });
1026
1008
 
1027
- // node_modules/.pnpm/@warp-ds+icons@2.0.1/node_modules/@warp-ds/icons/dist/elements/close-16.js
1009
+ // node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/close-16.js
1028
1010
  import { LitElement } from "lit";
1029
1011
  import { unsafeStatic, html } from "lit/static-html.js";
1030
1012
 
1031
- // node_modules/.pnpm/@lingui+core@4.7.1/node_modules/@lingui/core/dist/index.mjs
1013
+ // node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
1032
1014
  var import_unraw = __toESM(require_dist(), 1);
1033
1015
 
1034
- // node_modules/.pnpm/@lingui+message-utils@4.7.1/node_modules/@lingui/message-utils/dist/compileMessage.mjs
1016
+ // node_modules/.pnpm/@lingui+message-utils@4.11.2/node_modules/@lingui/message-utils/dist/compileMessage.mjs
1035
1017
  var import_parser = __toESM(require_parser(), 1);
1036
1018
  function processTokens(tokens, mapText) {
1037
1019
  if (!tokens.filter((token) => token.type !== "content").length) {
@@ -1055,11 +1037,9 @@ function processTokens(tokens, mapText) {
1055
1037
  }
1056
1038
  const offset = token.pluralOffset;
1057
1039
  const formatProps = {};
1058
- token.cases.forEach((item) => {
1059
- formatProps[item.key.replace(/^=(.)+/, "$1")] = processTokens(
1060
- item.tokens,
1061
- mapText
1062
- );
1040
+ token.cases.forEach(({ key, tokens: tokens2 }) => {
1041
+ const prop = key[0] === "=" ? key.slice(1) : key;
1042
+ formatProps[prop] = processTokens(tokens2, mapText);
1063
1043
  });
1064
1044
  return [
1065
1045
  token.arg,
@@ -1081,7 +1061,7 @@ Message: ${message}`);
1081
1061
  }
1082
1062
  }
1083
1063
 
1084
- // node_modules/.pnpm/@lingui+core@4.7.1/node_modules/@lingui/core/dist/index.mjs
1064
+ // node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
1085
1065
  var isString = (s) => typeof s === "string";
1086
1066
  var isFunction = (f) => typeof f === "function";
1087
1067
  var cache = /* @__PURE__ */ new Map();
@@ -1167,11 +1147,11 @@ var selectFormatter = (value, rules) => {
1167
1147
  function interpolate(translation, locale, locales) {
1168
1148
  return (values = {}, formats) => {
1169
1149
  const formatters = getDefaultFormats(locale, locales, formats);
1170
- const formatMessage = (tokens) => {
1150
+ const formatMessage = (tokens, replaceOctothorpe = false) => {
1171
1151
  if (!Array.isArray(tokens))
1172
1152
  return tokens;
1173
1153
  return tokens.reduce((message, token) => {
1174
- if (token === "#") {
1154
+ if (token === "#" && replaceOctothorpe) {
1175
1155
  return message + OCTOTHORPE_PH;
1176
1156
  }
1177
1157
  if (isString(token)) {
@@ -1182,7 +1162,10 @@ function interpolate(translation, locale, locales) {
1182
1162
  if (type === "plural" || type === "selectordinal" || type === "select") {
1183
1163
  Object.entries(format).forEach(
1184
1164
  ([key, value2]) => {
1185
- interpolatedFormat[key] = formatMessage(value2);
1165
+ interpolatedFormat[key] = formatMessage(
1166
+ value2,
1167
+ type === "plural" || type === "selectordinal"
1168
+ );
1186
1169
  }
1187
1170
  );
1188
1171
  } else {
@@ -1350,6 +1333,9 @@ var I18n = class extends EventEmitter {
1350
1333
  }
1351
1334
  _(id, values, options) {
1352
1335
  let message = options == null ? void 0 : options.message;
1336
+ if (!id) {
1337
+ id = "";
1338
+ }
1353
1339
  if (!isString(id)) {
1354
1340
  values = id.values || values;
1355
1341
  message = id.message;
@@ -1390,7 +1376,7 @@ function setupI18n(params = {}) {
1390
1376
  }
1391
1377
  var i18n = setupI18n();
1392
1378
 
1393
- // node_modules/.pnpm/@warp-ds+icons@2.0.1/node_modules/@warp-ds/icons/dist/elements/close-16.js
1379
+ // node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/close-16.js
1394
1380
  var messages = JSON.parse('{"icon.title.close":"Kryss"}');
1395
1381
  var messages2 = JSON.parse('{"icon.title.close":"Cross"}');
1396
1382
  var messages3 = JSON.parse('{"icon.title.close":"Rasti"}');
@@ -1484,8 +1470,7 @@ import { html as html2 } from "lit";
1484
1470
 
1485
1471
  // node_modules/.pnpm/@chbphone55+classnames@2.0.0/node_modules/@chbphone55/classnames/dist/index.m.js
1486
1472
  var r = function() {
1487
- for (var t = [], n = arguments.length; n--; )
1488
- t[n] = arguments[n];
1473
+ for (var t = [], n = arguments.length; n--; ) t[n] = arguments[n];
1489
1474
  return t.reduce(function(t2, n2) {
1490
1475
  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) {
1491
1476
  return n2[r2] ? r2 : "";
@@ -1493,7 +1478,7 @@ var r = function() {
1493
1478
  }, []).join(" ");
1494
1479
  };
1495
1480
 
1496
- // 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
1481
+ // 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
1497
1482
  var box = {
1498
1483
  box: "group block relative break-words last-child:mb-0 p-16 rounded-8",
1499
1484
  // Relative here enables w-clickable
@@ -1802,12 +1787,9 @@ function detectLocale2() {
1802
1787
  }
1803
1788
  }
1804
1789
  var getMessages2 = (locale, enMsg, nbMsg, fiMsg, daMsg) => {
1805
- if (locale === "nb")
1806
- return nbMsg;
1807
- if (locale === "fi")
1808
- return fiMsg;
1809
- if (locale === "da")
1810
- return daMsg;
1790
+ if (locale === "nb") return nbMsg;
1791
+ if (locale === "fi") return fiMsg;
1792
+ if (locale === "da") return daMsg;
1811
1793
  return enMsg;
1812
1794
  };
1813
1795
  var activateI18n2 = (enMessages, nbMessages, fiMessages, daMessages) => {