@warp-ds/elements 2.1.0 → 2.1.1-next.1

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.
@@ -726,9 +726,9 @@ var require_moo = __commonJS({
726
726
  }
727
727
  });
728
728
 
729
- // node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/lexer.js
729
+ // node_modules/.pnpm/@messageformat+parser@5.1.1/node_modules/@messageformat/parser/lib/lexer.js
730
730
  var require_lexer = __commonJS({
731
- "node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/lexer.js"(exports) {
731
+ "node_modules/.pnpm/@messageformat+parser@5.1.1/node_modules/@messageformat/parser/lib/lexer.js"(exports) {
732
732
  "use strict";
733
733
  var __importDefault = exports && exports.__importDefault || function(mod) {
734
734
  return mod && mod.__esModule ? mod : { "default": mod };
@@ -741,7 +741,7 @@ var require_lexer = __commonJS({
741
741
  doubleapos: { match: "''", value: () => "'" },
742
742
  quoted: {
743
743
  lineBreaks: true,
744
- match: /'[{}#](?:[^]*?[^'])?'(?!')/u,
744
+ match: /'[{}#](?:[^']|'')*'(?!')/u,
745
745
  value: (src) => src.slice(1, -1).replace(/''/g, "'")
746
746
  },
747
747
  argument: {
@@ -793,12 +793,13 @@ var require_lexer = __commonJS({
793
793
  }
794
794
  });
795
795
 
796
- // node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/parser.js
796
+ // node_modules/.pnpm/@messageformat+parser@5.1.1/node_modules/@messageformat/parser/lib/parser.js
797
797
  var require_parser = __commonJS({
798
- "node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/parser.js"(exports) {
798
+ "node_modules/.pnpm/@messageformat+parser@5.1.1/node_modules/@messageformat/parser/lib/parser.js"(exports) {
799
799
  "use strict";
800
800
  Object.defineProperty(exports, "__esModule", { value: true });
801
- exports.parse = exports.ParseError = void 0;
801
+ exports.ParseError = void 0;
802
+ exports.parse = parse2;
802
803
  var lexer_js_1 = require_lexer();
803
804
  var getContext = (lt) => ({
804
805
  offset: lt.offset,
@@ -864,8 +865,9 @@ var require_parser = __commonJS({
864
865
  }
865
866
  checkSelectKey(lt, type, key) {
866
867
  if (key[0] === "=") {
867
- if (type === "select")
868
+ if (type === "select") {
868
869
  throw new ParseError(lt, `The case ${key} is not valid with select`);
870
+ }
869
871
  } else if (type !== "select") {
870
872
  const keys = type === "plural" ? this.cardinalKeys : this.ordinalKeys;
871
873
  if (this.strictPluralKeys && keys.length > 0 && !keys.includes(key)) {
@@ -883,10 +885,12 @@ var require_parser = __commonJS({
883
885
  for (const lt of this.lexer) {
884
886
  switch (lt.type) {
885
887
  case "offset":
886
- if (type === "select")
888
+ if (type === "select") {
887
889
  throw new ParseError(lt, "Unexpected plural offset for select");
888
- if (sel.cases.length > 0)
890
+ }
891
+ if (sel.cases.length > 0) {
889
892
  throw new ParseError(lt, "Plural offset must be set before cases");
893
+ }
890
894
  sel.pluralOffset = Number(lt.value);
891
895
  ctx.text += lt.text;
892
896
  ctx.lineBreaks += lt.lineBreaks;
@@ -926,11 +930,13 @@ var require_parser = __commonJS({
926
930
  const end = this.lexer.next();
927
931
  if (!end)
928
932
  throw new ParseError(null, "Unexpected message end");
929
- if (end.type !== "end")
933
+ if (end.type !== "end") {
930
934
  throw new ParseError(end, `Unexpected lexer token: ${end.type}`);
935
+ }
931
936
  ctx.text += end.text;
932
- if (isSelectType(argType.value.toLowerCase()))
937
+ if (isSelectType(argType.value.toLowerCase())) {
933
938
  throw new ParseError(argType, `Invalid type identifier: ${argType.value}`);
939
+ }
934
940
  return {
935
941
  type: "function",
936
942
  arg: lt.value,
@@ -944,8 +950,9 @@ var require_parser = __commonJS({
944
950
  throw new ParseError(argType, msg);
945
951
  }
946
952
  let param = this.parseBody(this.strict ? false : inPlural);
947
- if (this.strict && param.length > 0)
953
+ if (this.strict && param.length > 0) {
948
954
  param = strictArgStyleParam(lt, param);
955
+ }
949
956
  return {
950
957
  type: "function",
951
958
  arg: lt.value,
@@ -955,10 +962,11 @@ var require_parser = __commonJS({
955
962
  };
956
963
  }
957
964
  case "select":
958
- if (isSelectType(argType.value))
965
+ if (isSelectType(argType.value)) {
959
966
  return this.parseSelect(lt, inPlural, ctx, argType.value);
960
- else
967
+ } else {
961
968
  throw new ParseError(argType, `Unexpected select type ${argType.value}`);
969
+ }
962
970
  default:
963
971
  throw new ParseError(argType, `Unexpected lexer token: ${argType.type}`);
964
972
  }
@@ -1005,14 +1013,13 @@ var require_parser = __commonJS({
1005
1013
  const parser = new Parser(src, options);
1006
1014
  return parser.parse();
1007
1015
  }
1008
- exports.parse = parse2;
1009
1016
  }
1010
1017
  });
1011
1018
 
1012
1019
  // packages/modal/modal-footer.js
1013
1020
  import { html } from "lit";
1014
1021
 
1015
- // 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
1022
+ // node_modules/.pnpm/@warp-ds+css@2.0.1_@warp-ds+uno@2.0.2_unocss@0.62.0_postcss@8.5.1_rollup@4.32.1_vite@5.3.3_@t_2s4pctzvx7cgxzqlrreqkg4h34/node_modules/@warp-ds/css/component-classes/index.js
1016
1023
  var buttonDefaultStyling = "font-bold focusable justify-center transition-colors ease-in-out";
1017
1024
  var buttonColors = {
1018
1025
  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]",
@@ -1370,14 +1377,14 @@ var Move = class {
1370
1377
  }
1371
1378
  };
1372
1379
 
1373
- // node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
1380
+ // node_modules/.pnpm/@lingui+core@5.1.2_@lingui+babel-plugin-lingui-macro@5.1.2_babel-plugin-macros@3.1.0_typescri_g2ngrxg2kfutsfck3yn2icllca/node_modules/@lingui/core/dist/index.mjs
1374
1381
  var import_unraw = __toESM(require_dist(), 1);
1375
1382
 
1376
- // node_modules/.pnpm/@lingui+message-utils@4.11.2/node_modules/@lingui/message-utils/dist/compileMessage.mjs
1383
+ // node_modules/.pnpm/@lingui+message-utils@5.1.2/node_modules/@lingui/message-utils/dist/compileMessage.mjs
1377
1384
  var import_parser = __toESM(require_parser(), 1);
1378
1385
  function processTokens(tokens, mapText) {
1379
1386
  if (!tokens.filter((token) => token.type !== "content").length) {
1380
- return tokens.map((token) => mapText(token.value)).join("");
1387
+ return tokens.map((token) => mapText(token.value));
1381
1388
  }
1382
1389
  return tokens.map((token) => {
1383
1390
  var _a;
@@ -1417,11 +1424,11 @@ function compileMessage(message, mapText = (v) => v) {
1417
1424
  console.error(`${e.message}
1418
1425
 
1419
1426
  Message: ${message}`);
1420
- return message;
1427
+ return [message];
1421
1428
  }
1422
1429
  }
1423
1430
 
1424
- // node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
1431
+ // node_modules/.pnpm/@lingui+core@5.1.2_@lingui+babel-plugin-lingui-macro@5.1.2_babel-plugin-macros@3.1.0_typescri_g2ngrxg2kfutsfck3yn2icllca/node_modules/@lingui/core/dist/index.mjs
1425
1432
  var isString = (s) => typeof s === "string";
1426
1433
  var isFunction = (f2) => typeof f2 === "function";
1427
1434
  var cache = /* @__PURE__ */ new Map();
@@ -1472,7 +1479,7 @@ function cacheKey(type, locales, options) {
1472
1479
  const localeKey = locales.join("-");
1473
1480
  return `${type}-${localeKey}-${JSON.stringify(options)}`;
1474
1481
  }
1475
- var UNICODE_REGEX = /\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g;
1482
+ var UNICODE_REGEX = /\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/;
1476
1483
  var OCTOTHORPE_PH = "%__lingui_octothorpe__%";
1477
1484
  var getDefaultFormats = (locale, passedLocales, formats = {}) => {
1478
1485
  const locales = passedLocales || locale;
@@ -1604,7 +1611,11 @@ var I18n = class extends EventEmitter {
1604
1611
  __publicField2(this, "_localeData", {});
1605
1612
  __publicField2(this, "_messages", {});
1606
1613
  __publicField2(this, "_missing");
1614
+ __publicField2(this, "_messageCompiler");
1607
1615
  __publicField2(this, "t", this._.bind(this));
1616
+ if (true) {
1617
+ this.setMessagesCompiler(compileMessage);
1618
+ }
1608
1619
  if (params.missing != null)
1609
1620
  this._missing = params.missing;
1610
1621
  if (params.messages != null)
@@ -1640,6 +1651,25 @@ var I18n = class extends EventEmitter {
1640
1651
  Object.assign(maybeLocaleData, localeData);
1641
1652
  }
1642
1653
  }
1654
+ /**
1655
+ * Registers a `MessageCompiler` to enable the use of uncompiled catalogs at runtime.
1656
+ *
1657
+ * In production builds, the `MessageCompiler` is typically excluded to reduce bundle size.
1658
+ * By default, message catalogs should be precompiled during the build process. However,
1659
+ * if you need to compile catalogs at runtime, you can use this method to set a message compiler.
1660
+ *
1661
+ * Example usage:
1662
+ *
1663
+ * ```ts
1664
+ * import { compileMessage } from "@lingui/message-utils/compileMessage";
1665
+ *
1666
+ * i18n.setMessagesCompiler(compileMessage);
1667
+ * ```
1668
+ */
1669
+ setMessagesCompiler(compiler) {
1670
+ this._messageCompiler = compiler;
1671
+ return this;
1672
+ }
1643
1673
  /**
1644
1674
  * @deprecated Plurals automatically used from Intl.PluralRules you can safely remove this call. Deprecated in v4
1645
1675
  */
@@ -1711,8 +1741,20 @@ var I18n = class extends EventEmitter {
1711
1741
  this.emit("missing", { id, locale: this._locale });
1712
1742
  }
1713
1743
  let translation = messageForId || message || id;
1714
- if (true) {
1715
- translation = isString(translation) ? compileMessage(translation) : translation;
1744
+ if (isString(translation)) {
1745
+ if (this._messageCompiler) {
1746
+ translation = this._messageCompiler(translation);
1747
+ } else {
1748
+ console.warn(`Uncompiled message detected! Message:
1749
+
1750
+ > ${translation}
1751
+
1752
+ That means you use raw catalog or your catalog doesn't have a translation for the message and fallback was used.
1753
+ ICU features such as interpolation and plurals will not work properly for that message.
1754
+
1755
+ Please compile your catalog first.
1756
+ `);
1757
+ }
1716
1758
  }
1717
1759
  if (isString(translation) && UNICODE_REGEX.test(translation))
1718
1760
  return JSON.parse(`"${translation}"`);
@@ -1736,14 +1778,14 @@ function setupI18n(params = {}) {
1736
1778
  }
1737
1779
  var i18n = setupI18n();
1738
1780
 
1739
- // node_modules/.pnpm/@warp-ds+icons@2.4.0/node_modules/@warp-ds/icons/dist/elements/arrow-left-16.js
1781
+ // node_modules/.pnpm/@warp-ds+icons@2.5.0-next.1/node_modules/@warp-ds/icons/dist/elements/arrow-left-16.js
1740
1782
  import { LitElement } from "lit";
1741
1783
  import { unsafeStatic, html as html2 } from "lit/static-html.js";
1742
- var messages = JSON.parse('{"icon.title.arrow-left":"Pil som peker mot venstre"}');
1743
- var messages2 = JSON.parse('{"icon.title.arrow-left":"Leftward-pointing arrow"}');
1744
- var messages3 = JSON.parse('{"icon.title.arrow-left":"Vasemmalle osoittava nuoli"}');
1745
- var messages4 = JSON.parse('{"icon.title.arrow-left":"Pil til venstre"}');
1746
- var messages5 = JSON.parse('{"icon.title.arrow-left":"Pil som pekar v\xE4nster"}');
1784
+ var messages = JSON.parse('{"icon.title.arrow-left":["Pil som peker mot venstre"]}');
1785
+ var messages2 = JSON.parse('{"icon.title.arrow-left":["Leftward-pointing arrow"]}');
1786
+ var messages3 = JSON.parse('{"icon.title.arrow-left":["Vasemmalle osoittava nuoli"]}');
1787
+ var messages4 = JSON.parse('{"icon.title.arrow-left":["Pil til venstre"]}');
1788
+ var messages5 = JSON.parse('{"icon.title.arrow-left":["Pil som pekar v\xE4nster"]}');
1747
1789
  var supportedLocales = ["en", "nb", "fi", "da", "sv"];
1748
1790
  var defaultLocale2 = "en";
1749
1791
  var detectByBrand = () => {
@@ -1830,14 +1872,14 @@ if (!customElements.get("w-icon-arrow-left-16")) {
1830
1872
  customElements.define("w-icon-arrow-left-16", IconArrowLeft16);
1831
1873
  }
1832
1874
 
1833
- // node_modules/.pnpm/@warp-ds+icons@2.4.0/node_modules/@warp-ds/icons/dist/elements/close-16.js
1875
+ // node_modules/.pnpm/@warp-ds+icons@2.5.0-next.1/node_modules/@warp-ds/icons/dist/elements/close-16.js
1834
1876
  import { LitElement as LitElement2 } from "lit";
1835
1877
  import { unsafeStatic as unsafeStatic2, html as html3 } from "lit/static-html.js";
1836
- var messages6 = JSON.parse('{"icon.title.close":"Kryss"}');
1837
- var messages22 = JSON.parse('{"icon.title.close":"Cross"}');
1838
- var messages32 = JSON.parse('{"icon.title.close":"Rasti"}');
1839
- var messages42 = JSON.parse('{"icon.title.close":"Kryds"}');
1840
- var messages52 = JSON.parse('{"icon.title.close":"Kryss"}');
1878
+ var messages6 = JSON.parse('{"icon.title.close":["Kryss"]}');
1879
+ var messages22 = JSON.parse('{"icon.title.close":["Cross"]}');
1880
+ var messages32 = JSON.parse('{"icon.title.close":["Rasti"]}');
1881
+ var messages42 = JSON.parse('{"icon.title.close":["Kryds"]}');
1882
+ var messages52 = JSON.parse('{"icon.title.close":["Kryss"]}');
1841
1883
  var supportedLocales2 = ["en", "nb", "fi", "da", "sv"];
1842
1884
  var defaultLocale3 = "en";
1843
1885
  var detectByBrand2 = () => {
@@ -1964,19 +2006,19 @@ var activateI18n3 = (enMessages, nbMessages, fiMessages, daMessages, svMessages)
1964
2006
  };
1965
2007
 
1966
2008
  // packages/modal/locales/da/messages.mjs
1967
- var messages7 = JSON.parse('{"modal.aria.back":"Tilbage","modal.aria.close":"Luk"}');
2009
+ var messages7 = JSON.parse('{"modal.aria.back":["Tilbage"],"modal.aria.close":["Luk"]}');
1968
2010
 
1969
2011
  // packages/modal/locales/en/messages.mjs
1970
- var messages8 = JSON.parse('{"modal.aria.back":"Back","modal.aria.close":"Close"}');
2012
+ var messages8 = JSON.parse('{"modal.aria.back":["Back"],"modal.aria.close":["Close"]}');
1971
2013
 
1972
2014
  // packages/modal/locales/fi/messages.mjs
1973
- var messages9 = JSON.parse('{"modal.aria.back":"Takaisin","modal.aria.close":"Sulje"}');
2015
+ var messages9 = JSON.parse('{"modal.aria.back":["Takaisin"],"modal.aria.close":["Sulje"]}');
1974
2016
 
1975
2017
  // packages/modal/locales/nb/messages.mjs
1976
- var messages10 = JSON.parse('{"modal.aria.back":"Tilbake","modal.aria.close":"Lukk"}');
2018
+ var messages10 = JSON.parse('{"modal.aria.back":["Tilbake"],"modal.aria.close":["Lukk"]}');
1977
2019
 
1978
2020
  // packages/modal/locales/sv/messages.mjs
1979
- var messages11 = JSON.parse('{"modal.aria.back":"Tillbaka","modal.aria.close":"St\xE4ng"}');
2021
+ var messages11 = JSON.parse('{"modal.aria.back":["Tillbaka"],"modal.aria.close":["St\xE4ng"]}');
1980
2022
 
1981
2023
  // packages/modal/modal-header.js
1982
2024
  var NO_CLOSE_BUTTON = "no-close";