@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.
@@ -729,9 +729,9 @@ var require_moo = __commonJS({
729
729
  }
730
730
  });
731
731
 
732
- // node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/lexer.js
732
+ // node_modules/.pnpm/@messageformat+parser@5.1.1/node_modules/@messageformat/parser/lib/lexer.js
733
733
  var require_lexer = __commonJS({
734
- "node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/lexer.js"(exports) {
734
+ "node_modules/.pnpm/@messageformat+parser@5.1.1/node_modules/@messageformat/parser/lib/lexer.js"(exports) {
735
735
  "use strict";
736
736
  var __importDefault = exports && exports.__importDefault || function(mod) {
737
737
  return mod && mod.__esModule ? mod : { "default": mod };
@@ -744,7 +744,7 @@ var require_lexer = __commonJS({
744
744
  doubleapos: { match: "''", value: () => "'" },
745
745
  quoted: {
746
746
  lineBreaks: true,
747
- match: /'[{}#](?:[^]*?[^'])?'(?!')/u,
747
+ match: /'[{}#](?:[^']|'')*'(?!')/u,
748
748
  value: (src) => src.slice(1, -1).replace(/''/g, "'")
749
749
  },
750
750
  argument: {
@@ -796,12 +796,13 @@ var require_lexer = __commonJS({
796
796
  }
797
797
  });
798
798
 
799
- // node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/parser.js
799
+ // node_modules/.pnpm/@messageformat+parser@5.1.1/node_modules/@messageformat/parser/lib/parser.js
800
800
  var require_parser = __commonJS({
801
- "node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/parser.js"(exports) {
801
+ "node_modules/.pnpm/@messageformat+parser@5.1.1/node_modules/@messageformat/parser/lib/parser.js"(exports) {
802
802
  "use strict";
803
803
  Object.defineProperty(exports, "__esModule", { value: true });
804
- exports.parse = exports.ParseError = void 0;
804
+ exports.ParseError = void 0;
805
+ exports.parse = parse2;
805
806
  var lexer_js_1 = require_lexer();
806
807
  var getContext = (lt) => ({
807
808
  offset: lt.offset,
@@ -867,8 +868,9 @@ var require_parser = __commonJS({
867
868
  }
868
869
  checkSelectKey(lt, type, key) {
869
870
  if (key[0] === "=") {
870
- if (type === "select")
871
+ if (type === "select") {
871
872
  throw new ParseError(lt, `The case ${key} is not valid with select`);
873
+ }
872
874
  } else if (type !== "select") {
873
875
  const keys = type === "plural" ? this.cardinalKeys : this.ordinalKeys;
874
876
  if (this.strictPluralKeys && keys.length > 0 && !keys.includes(key)) {
@@ -886,10 +888,12 @@ var require_parser = __commonJS({
886
888
  for (const lt of this.lexer) {
887
889
  switch (lt.type) {
888
890
  case "offset":
889
- if (type === "select")
891
+ if (type === "select") {
890
892
  throw new ParseError(lt, "Unexpected plural offset for select");
891
- if (sel.cases.length > 0)
893
+ }
894
+ if (sel.cases.length > 0) {
892
895
  throw new ParseError(lt, "Plural offset must be set before cases");
896
+ }
893
897
  sel.pluralOffset = Number(lt.value);
894
898
  ctx.text += lt.text;
895
899
  ctx.lineBreaks += lt.lineBreaks;
@@ -929,11 +933,13 @@ var require_parser = __commonJS({
929
933
  const end = this.lexer.next();
930
934
  if (!end)
931
935
  throw new ParseError(null, "Unexpected message end");
932
- if (end.type !== "end")
936
+ if (end.type !== "end") {
933
937
  throw new ParseError(end, `Unexpected lexer token: ${end.type}`);
938
+ }
934
939
  ctx.text += end.text;
935
- if (isSelectType(argType.value.toLowerCase()))
940
+ if (isSelectType(argType.value.toLowerCase())) {
936
941
  throw new ParseError(argType, `Invalid type identifier: ${argType.value}`);
942
+ }
937
943
  return {
938
944
  type: "function",
939
945
  arg: lt.value,
@@ -947,8 +953,9 @@ var require_parser = __commonJS({
947
953
  throw new ParseError(argType, msg);
948
954
  }
949
955
  let param = this.parseBody(this.strict ? false : inPlural);
950
- if (this.strict && param.length > 0)
956
+ if (this.strict && param.length > 0) {
951
957
  param = strictArgStyleParam(lt, param);
958
+ }
952
959
  return {
953
960
  type: "function",
954
961
  arg: lt.value,
@@ -958,10 +965,11 @@ var require_parser = __commonJS({
958
965
  };
959
966
  }
960
967
  case "select":
961
- if (isSelectType(argType.value))
968
+ if (isSelectType(argType.value)) {
962
969
  return this.parseSelect(lt, inPlural, ctx, argType.value);
963
- else
970
+ } else {
964
971
  throw new ParseError(argType, `Unexpected select type ${argType.value}`);
972
+ }
965
973
  default:
966
974
  throw new ParseError(argType, `Unexpected lexer token: ${argType.type}`);
967
975
  }
@@ -1008,7 +1016,6 @@ var require_parser = __commonJS({
1008
1016
  const parser = new Parser(src, options);
1009
1017
  return parser.parse();
1010
1018
  }
1011
- exports.parse = parse2;
1012
1019
  }
1013
1020
  });
1014
1021
 
@@ -1025,14 +1032,14 @@ var r = function() {
1025
1032
  }, []).join(" ");
1026
1033
  };
1027
1034
 
1028
- // node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
1035
+ // 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
1029
1036
  var import_unraw = __toESM(require_dist(), 1);
1030
1037
 
1031
- // node_modules/.pnpm/@lingui+message-utils@4.11.2/node_modules/@lingui/message-utils/dist/compileMessage.mjs
1038
+ // node_modules/.pnpm/@lingui+message-utils@5.1.2/node_modules/@lingui/message-utils/dist/compileMessage.mjs
1032
1039
  var import_parser = __toESM(require_parser(), 1);
1033
1040
  function processTokens(tokens, mapText) {
1034
1041
  if (!tokens.filter((token) => token.type !== "content").length) {
1035
- return tokens.map((token) => mapText(token.value)).join("");
1042
+ return tokens.map((token) => mapText(token.value));
1036
1043
  }
1037
1044
  return tokens.map((token) => {
1038
1045
  var _a;
@@ -1072,11 +1079,11 @@ function compileMessage(message, mapText = (v) => v) {
1072
1079
  console.error(`${e.message}
1073
1080
 
1074
1081
  Message: ${message}`);
1075
- return message;
1082
+ return [message];
1076
1083
  }
1077
1084
  }
1078
1085
 
1079
- // node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
1086
+ // 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
1080
1087
  var isString = (s) => typeof s === "string";
1081
1088
  var isFunction = (f) => typeof f === "function";
1082
1089
  var cache = /* @__PURE__ */ new Map();
@@ -1127,7 +1134,7 @@ function cacheKey(type, locales, options) {
1127
1134
  const localeKey = locales.join("-");
1128
1135
  return `${type}-${localeKey}-${JSON.stringify(options)}`;
1129
1136
  }
1130
- var UNICODE_REGEX = /\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g;
1137
+ var UNICODE_REGEX = /\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/;
1131
1138
  var OCTOTHORPE_PH = "%__lingui_octothorpe__%";
1132
1139
  var getDefaultFormats = (locale, passedLocales, formats = {}) => {
1133
1140
  const locales = passedLocales || locale;
@@ -1259,7 +1266,11 @@ var I18n = class extends EventEmitter {
1259
1266
  __publicField2(this, "_localeData", {});
1260
1267
  __publicField2(this, "_messages", {});
1261
1268
  __publicField2(this, "_missing");
1269
+ __publicField2(this, "_messageCompiler");
1262
1270
  __publicField2(this, "t", this._.bind(this));
1271
+ if (true) {
1272
+ this.setMessagesCompiler(compileMessage);
1273
+ }
1263
1274
  if (params.missing != null)
1264
1275
  this._missing = params.missing;
1265
1276
  if (params.messages != null)
@@ -1295,6 +1306,25 @@ var I18n = class extends EventEmitter {
1295
1306
  Object.assign(maybeLocaleData, localeData);
1296
1307
  }
1297
1308
  }
1309
+ /**
1310
+ * Registers a `MessageCompiler` to enable the use of uncompiled catalogs at runtime.
1311
+ *
1312
+ * In production builds, the `MessageCompiler` is typically excluded to reduce bundle size.
1313
+ * By default, message catalogs should be precompiled during the build process. However,
1314
+ * if you need to compile catalogs at runtime, you can use this method to set a message compiler.
1315
+ *
1316
+ * Example usage:
1317
+ *
1318
+ * ```ts
1319
+ * import { compileMessage } from "@lingui/message-utils/compileMessage";
1320
+ *
1321
+ * i18n.setMessagesCompiler(compileMessage);
1322
+ * ```
1323
+ */
1324
+ setMessagesCompiler(compiler) {
1325
+ this._messageCompiler = compiler;
1326
+ return this;
1327
+ }
1298
1328
  /**
1299
1329
  * @deprecated Plurals automatically used from Intl.PluralRules you can safely remove this call. Deprecated in v4
1300
1330
  */
@@ -1366,8 +1396,20 @@ var I18n = class extends EventEmitter {
1366
1396
  this.emit("missing", { id, locale: this._locale });
1367
1397
  }
1368
1398
  let translation = messageForId || message || id;
1369
- if (true) {
1370
- translation = isString(translation) ? compileMessage(translation) : translation;
1399
+ if (isString(translation)) {
1400
+ if (this._messageCompiler) {
1401
+ translation = this._messageCompiler(translation);
1402
+ } else {
1403
+ console.warn(`Uncompiled message detected! Message:
1404
+
1405
+ > ${translation}
1406
+
1407
+ That means you use raw catalog or your catalog doesn't have a translation for the message and fallback was used.
1408
+ ICU features such as interpolation and plurals will not work properly for that message.
1409
+
1410
+ Please compile your catalog first.
1411
+ `);
1412
+ }
1371
1413
  }
1372
1414
  if (isString(translation) && UNICODE_REGEX.test(translation))
1373
1415
  return JSON.parse(`"${translation}"`);
@@ -1391,7 +1433,7 @@ function setupI18n(params = {}) {
1391
1433
  }
1392
1434
  var i18n = setupI18n();
1393
1435
 
1394
- // 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
1436
+ // 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
1395
1437
  var buttonDefaultStyling = "font-bold focusable justify-center transition-colors ease-in-out";
1396
1438
  var buttonColors = {
1397
1439
  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]",
@@ -1699,28 +1741,28 @@ function kebabCaseAttributes(constructor) {
1699
1741
  }
1700
1742
 
1701
1743
  // packages/select/locales/da/messages.mjs
1702
- var messages = JSON.parse('{"select.label.optional":"(valgfrit)"}');
1744
+ var messages = JSON.parse('{"select.label.optional":["(valgfrit)"]}');
1703
1745
 
1704
1746
  // packages/select/locales/en/messages.mjs
1705
- var messages2 = JSON.parse('{"select.label.optional":"(optional)"}');
1747
+ var messages2 = JSON.parse('{"select.label.optional":["(optional)"]}');
1706
1748
 
1707
1749
  // packages/select/locales/fi/messages.mjs
1708
- var messages3 = JSON.parse('{"select.label.optional":"(vapaaehtoinen)"}');
1750
+ var messages3 = JSON.parse('{"select.label.optional":["(vapaaehtoinen)"]}');
1709
1751
 
1710
1752
  // packages/select/locales/nb/messages.mjs
1711
- var messages4 = JSON.parse('{"select.label.optional":"(valgfritt)"}');
1753
+ var messages4 = JSON.parse('{"select.label.optional":["(valgfritt)"]}');
1712
1754
 
1713
1755
  // packages/select/locales/sv/messages.mjs
1714
- var messages5 = JSON.parse('{"select.label.optional":"(valfritt)"}');
1756
+ var messages5 = JSON.parse('{"select.label.optional":["(valfritt)"]}');
1715
1757
 
1716
- // node_modules/.pnpm/@warp-ds+icons@2.4.0/node_modules/@warp-ds/icons/dist/elements/chevron-down-16.js
1758
+ // node_modules/.pnpm/@warp-ds+icons@2.5.0-next.1/node_modules/@warp-ds/icons/dist/elements/chevron-down-16.js
1717
1759
  import { LitElement } from "lit";
1718
1760
  import { unsafeStatic, html } from "lit/static-html.js";
1719
- var messages6 = JSON.parse('{"icon.title.chevron-down":"Nedoverpil"}');
1720
- var messages22 = JSON.parse('{"icon.title.chevron-down":"Downward arrow"}');
1721
- var messages32 = JSON.parse('{"icon.title.chevron-down":"Nuoli alasp\xE4in"}');
1722
- var messages42 = JSON.parse('{"icon.title.chevron-down":"Pil nedad"}');
1723
- var messages52 = JSON.parse('{"icon.title.chevron-down":"Pil ned"}');
1761
+ var messages6 = JSON.parse('{"icon.title.chevron-down":["Nedoverpil"]}');
1762
+ var messages22 = JSON.parse('{"icon.title.chevron-down":["Downward arrow"]}');
1763
+ var messages32 = JSON.parse('{"icon.title.chevron-down":["Nuoli alasp\xE4in"]}');
1764
+ var messages42 = JSON.parse('{"icon.title.chevron-down":["Pil nedad"]}');
1765
+ var messages52 = JSON.parse('{"icon.title.chevron-down":["Pil ned"]}');
1724
1766
  var supportedLocales2 = ["en", "nb", "fi", "da", "sv"];
1725
1767
  var defaultLocale3 = "en";
1726
1768
  var detectByBrand = () => {