@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
@@ -16,7 +16,7 @@ export class WarpAffix {
16
16
  };
17
17
  };
18
18
  get _classBase(): typeof suffix;
19
- get _classes(): import(".pnpm/lit-html@3.1.4/node_modules/lit-html/directive").DirectiveResult<typeof import(".pnpm/lit-html@3.1.4/node_modules/lit-html/directives/class-map").ClassMapDirective>;
19
+ get _classes(): import(".pnpm/lit-html@3.1.4/node_modules/lit-html/directive").DirectiveResult<typeof import("lit/directives/class-map").ClassMapDirective>;
20
20
  get _searchButton(): import("lit").TemplateResult<1>;
21
21
  get _clearButton(): import("lit").TemplateResult<1>;
22
22
  get _text(): import("lit").TemplateResult<1>;
@@ -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) {
@@ -1027,7 +1009,7 @@ var require_parser = __commonJS({
1027
1009
  // packages/affix/index.js
1028
1010
  import { html as html3 } from "lit";
1029
1011
 
1030
- // 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
1012
+ // 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
1031
1013
  var box = {
1032
1014
  box: "group block relative break-words last-child:mb-0 p-16 rounded-8",
1033
1015
  // Relative here enables w-clickable
@@ -1304,14 +1286,14 @@ var attention = {
1304
1286
  import WarpElement from "@warp-ds/elements-core";
1305
1287
  import { ifDefined } from "lit/directives/if-defined.js";
1306
1288
 
1307
- // node_modules/.pnpm/@warp-ds+icons@2.0.1/node_modules/@warp-ds/icons/dist/elements/search-16.js
1289
+ // node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/search-16.js
1308
1290
  import { LitElement } from "lit";
1309
1291
  import { unsafeStatic, html } from "lit/static-html.js";
1310
1292
 
1311
- // node_modules/.pnpm/@lingui+core@4.7.1/node_modules/@lingui/core/dist/index.mjs
1293
+ // node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
1312
1294
  var import_unraw = __toESM(require_dist(), 1);
1313
1295
 
1314
- // node_modules/.pnpm/@lingui+message-utils@4.7.1/node_modules/@lingui/message-utils/dist/compileMessage.mjs
1296
+ // node_modules/.pnpm/@lingui+message-utils@4.11.2/node_modules/@lingui/message-utils/dist/compileMessage.mjs
1315
1297
  var import_parser = __toESM(require_parser(), 1);
1316
1298
  function processTokens(tokens, mapText) {
1317
1299
  if (!tokens.filter((token) => token.type !== "content").length) {
@@ -1335,11 +1317,9 @@ function processTokens(tokens, mapText) {
1335
1317
  }
1336
1318
  const offset = token.pluralOffset;
1337
1319
  const formatProps = {};
1338
- token.cases.forEach((item) => {
1339
- formatProps[item.key.replace(/^=(.)+/, "$1")] = processTokens(
1340
- item.tokens,
1341
- mapText
1342
- );
1320
+ token.cases.forEach(({ key, tokens: tokens2 }) => {
1321
+ const prop = key[0] === "=" ? key.slice(1) : key;
1322
+ formatProps[prop] = processTokens(tokens2, mapText);
1343
1323
  });
1344
1324
  return [
1345
1325
  token.arg,
@@ -1361,7 +1341,7 @@ Message: ${message}`);
1361
1341
  }
1362
1342
  }
1363
1343
 
1364
- // node_modules/.pnpm/@lingui+core@4.7.1/node_modules/@lingui/core/dist/index.mjs
1344
+ // node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
1365
1345
  var isString = (s) => typeof s === "string";
1366
1346
  var isFunction = (f) => typeof f === "function";
1367
1347
  var cache = /* @__PURE__ */ new Map();
@@ -1447,11 +1427,11 @@ var selectFormatter = (value, rules) => {
1447
1427
  function interpolate(translation, locale, locales) {
1448
1428
  return (values = {}, formats) => {
1449
1429
  const formatters = getDefaultFormats(locale, locales, formats);
1450
- const formatMessage = (tokens) => {
1430
+ const formatMessage = (tokens, replaceOctothorpe = false) => {
1451
1431
  if (!Array.isArray(tokens))
1452
1432
  return tokens;
1453
1433
  return tokens.reduce((message, token) => {
1454
- if (token === "#") {
1434
+ if (token === "#" && replaceOctothorpe) {
1455
1435
  return message + OCTOTHORPE_PH;
1456
1436
  }
1457
1437
  if (isString(token)) {
@@ -1462,7 +1442,10 @@ function interpolate(translation, locale, locales) {
1462
1442
  if (type === "plural" || type === "selectordinal" || type === "select") {
1463
1443
  Object.entries(format).forEach(
1464
1444
  ([key, value2]) => {
1465
- interpolatedFormat[key] = formatMessage(value2);
1445
+ interpolatedFormat[key] = formatMessage(
1446
+ value2,
1447
+ type === "plural" || type === "selectordinal"
1448
+ );
1466
1449
  }
1467
1450
  );
1468
1451
  } else {
@@ -1630,6 +1613,9 @@ var I18n = class extends EventEmitter {
1630
1613
  }
1631
1614
  _(id, values, options) {
1632
1615
  let message = options == null ? void 0 : options.message;
1616
+ if (!id) {
1617
+ id = "";
1618
+ }
1633
1619
  if (!isString(id)) {
1634
1620
  values = id.values || values;
1635
1621
  message = id.message;
@@ -1670,7 +1656,7 @@ function setupI18n(params = {}) {
1670
1656
  }
1671
1657
  var i18n = setupI18n();
1672
1658
 
1673
- // node_modules/.pnpm/@warp-ds+icons@2.0.1/node_modules/@warp-ds/icons/dist/elements/search-16.js
1659
+ // node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/search-16.js
1674
1660
  var messages = JSON.parse('{"icon.title.search":"Forst\xF8rrelsesglass"}');
1675
1661
  var messages2 = JSON.parse('{"icon.title.search":"Magnifying glass"}');
1676
1662
  var messages3 = JSON.parse('{"icon.title.search":"Suurennuslasi"}');
@@ -1759,7 +1745,7 @@ if (!customElements.get("w-icon-search-16")) {
1759
1745
  customElements.define("w-icon-search-16", IconSearch16);
1760
1746
  }
1761
1747
 
1762
- // node_modules/.pnpm/@warp-ds+icons@2.0.1/node_modules/@warp-ds/icons/dist/elements/close-16.js
1748
+ // node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/close-16.js
1763
1749
  import { LitElement as LitElement2 } from "lit";
1764
1750
  import { unsafeStatic as unsafeStatic2, html as html2 } from "lit/static-html.js";
1765
1751
  var messages4 = JSON.parse('{"icon.title.close":"Kryss"}');