@warp-ds/elements 2.1.1-next.1 → 2.1.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.
- package/dist/index.js +351 -22
- package/dist/index.js.map +4 -4
- package/dist/packages/affix/index.js +344 -15
- package/dist/packages/affix/index.js.map +4 -4
- package/dist/packages/alert/index.js +346 -17
- package/dist/packages/alert/index.js.map +4 -4
- package/dist/packages/attention/index.js +342 -13
- package/dist/packages/attention/index.js.map +4 -4
- package/dist/packages/badge/index.js +1 -1
- package/dist/packages/badge/index.js.map +2 -2
- package/dist/packages/box/index.js +1 -1
- package/dist/packages/box/index.js.map +2 -2
- package/dist/packages/breadcrumbs/index.js +341 -12
- package/dist/packages/breadcrumbs/index.js.map +4 -4
- package/dist/packages/button/index.js +341 -12
- package/dist/packages/button/index.js.map +4 -4
- package/dist/packages/card/index.js +341 -12
- package/dist/packages/card/index.js.map +4 -4
- package/dist/packages/expandable/index.js +344 -15
- package/dist/packages/expandable/index.js.map +4 -4
- package/dist/packages/modal/index.js +343 -14
- package/dist/packages/modal/index.js.map +4 -4
- package/dist/packages/pill/index.js +343 -14
- package/dist/packages/pill/index.js.map +4 -4
- package/dist/packages/select/index.js +342 -13
- package/dist/packages/select/index.js.map +4 -4
- package/dist/packages/textfield/index.js +1 -1
- package/dist/packages/textfield/index.js.map +2 -2
- package/dist/packages/toast/index.js +345 -16
- package/dist/packages/toast/index.js.map +4 -4
- package/package.json +9 -8
|
@@ -1026,7 +1026,7 @@ var r = function() {
|
|
|
1026
1026
|
}, []).join(" ");
|
|
1027
1027
|
};
|
|
1028
1028
|
|
|
1029
|
-
// node_modules/.pnpm/@warp-ds+css@2.
|
|
1029
|
+
// node_modules/.pnpm/@warp-ds+css@2.1.1_@warp-ds+uno@2.1.0_unocss@0.62.0_postcss@8.5.1_rollup@4.32.1_vite@5.3.3_@t_sgrraibu65gdmqpe655kfrpl6a/node_modules/@warp-ds/css/component-classes/index.js
|
|
1030
1030
|
var buttonDefaultStyling = "font-bold focusable justify-center transition-colors ease-in-out";
|
|
1031
1031
|
var buttonColors = {
|
|
1032
1032
|
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]",
|
|
@@ -1273,15 +1273,273 @@ var attention = {
|
|
|
1273
1273
|
// packages/alert/index.js
|
|
1274
1274
|
import WarpElement from "@warp-ds/elements-core";
|
|
1275
1275
|
|
|
1276
|
-
// node_modules/.pnpm/@warp-ds+icons@2.5.
|
|
1276
|
+
// node_modules/.pnpm/@warp-ds+icons@2.5.0_@lingui+core@5.2.0_@lingui+babel-plugin-lingui-macro@5.2.0_babel-plugin-_hyhbgchrkasknlbocfng7geeci/node_modules/@warp-ds/icons/dist/elements/info-16.js
|
|
1277
1277
|
import { LitElement } from "lit";
|
|
1278
1278
|
import { unsafeStatic, html } from "lit/static-html.js";
|
|
1279
1279
|
|
|
1280
|
-
// node_modules/.pnpm/@lingui+core@5.
|
|
1280
|
+
// node_modules/.pnpm/@lingui+core@5.2.0_@lingui+babel-plugin-lingui-macro@5.2.0_babel-plugin-macros@3.1.0_typescri_qfhfd5z2jpd4amxt2golzdalsi/node_modules/@lingui/core/dist/index.mjs
|
|
1281
1281
|
var import_unraw = __toESM(require_dist(), 1);
|
|
1282
1282
|
|
|
1283
|
-
// node_modules/.pnpm/@lingui+message-utils@5.
|
|
1283
|
+
// node_modules/.pnpm/@lingui+message-utils@5.2.0/node_modules/@lingui/message-utils/dist/compileMessage.mjs
|
|
1284
1284
|
var import_parser = __toESM(require_parser(), 1);
|
|
1285
|
+
var DateFormatError = class extends Error {
|
|
1286
|
+
/** @internal */
|
|
1287
|
+
constructor(msg, token, type) {
|
|
1288
|
+
super(msg);
|
|
1289
|
+
this.token = token;
|
|
1290
|
+
this.type = type || "error";
|
|
1291
|
+
}
|
|
1292
|
+
};
|
|
1293
|
+
var alpha = (width) => width < 4 ? "short" : width === 4 ? "long" : "narrow";
|
|
1294
|
+
var numeric = (width) => width % 2 === 0 ? "2-digit" : "numeric";
|
|
1295
|
+
function yearOptions(token, onError) {
|
|
1296
|
+
switch (token.char) {
|
|
1297
|
+
case "y":
|
|
1298
|
+
return { year: numeric(token.width) };
|
|
1299
|
+
case "r":
|
|
1300
|
+
return { calendar: "gregory", year: "numeric" };
|
|
1301
|
+
case "u":
|
|
1302
|
+
case "U":
|
|
1303
|
+
case "Y":
|
|
1304
|
+
default:
|
|
1305
|
+
onError(`${token.desc} is not supported; falling back to year:numeric`, DateFormatError.WARNING);
|
|
1306
|
+
return { year: "numeric" };
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
function monthStyle(token, onError) {
|
|
1310
|
+
switch (token.width) {
|
|
1311
|
+
case 1:
|
|
1312
|
+
return "numeric";
|
|
1313
|
+
case 2:
|
|
1314
|
+
return "2-digit";
|
|
1315
|
+
case 3:
|
|
1316
|
+
return "short";
|
|
1317
|
+
case 4:
|
|
1318
|
+
return "long";
|
|
1319
|
+
case 5:
|
|
1320
|
+
return "narrow";
|
|
1321
|
+
default:
|
|
1322
|
+
onError(`${token.desc} is not supported with width ${token.width}`);
|
|
1323
|
+
return void 0;
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
function dayStyle(token, onError) {
|
|
1327
|
+
const { char, desc, width } = token;
|
|
1328
|
+
if (char === "d") {
|
|
1329
|
+
return numeric(width);
|
|
1330
|
+
} else {
|
|
1331
|
+
onError(`${desc} is not supported`);
|
|
1332
|
+
return void 0;
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
function weekdayStyle(token, onError) {
|
|
1336
|
+
const { char, desc, width } = token;
|
|
1337
|
+
if ((char === "c" || char === "e") && width < 3) {
|
|
1338
|
+
const msg = `Numeric value is not supported for ${desc}; falling back to weekday:short`;
|
|
1339
|
+
onError(msg, DateFormatError.WARNING);
|
|
1340
|
+
}
|
|
1341
|
+
return alpha(width);
|
|
1342
|
+
}
|
|
1343
|
+
function hourOptions(token) {
|
|
1344
|
+
const hour = numeric(token.width);
|
|
1345
|
+
let hourCycle;
|
|
1346
|
+
switch (token.char) {
|
|
1347
|
+
case "h":
|
|
1348
|
+
hourCycle = "h12";
|
|
1349
|
+
break;
|
|
1350
|
+
case "H":
|
|
1351
|
+
hourCycle = "h23";
|
|
1352
|
+
break;
|
|
1353
|
+
case "k":
|
|
1354
|
+
hourCycle = "h24";
|
|
1355
|
+
break;
|
|
1356
|
+
case "K":
|
|
1357
|
+
hourCycle = "h11";
|
|
1358
|
+
break;
|
|
1359
|
+
}
|
|
1360
|
+
return hourCycle ? { hour, hourCycle } : { hour };
|
|
1361
|
+
}
|
|
1362
|
+
function timeZoneNameStyle(token, onError) {
|
|
1363
|
+
const { char, desc, width } = token;
|
|
1364
|
+
switch (char) {
|
|
1365
|
+
case "v":
|
|
1366
|
+
case "z":
|
|
1367
|
+
return width === 4 ? "long" : "short";
|
|
1368
|
+
case "V":
|
|
1369
|
+
if (width === 4)
|
|
1370
|
+
return "long";
|
|
1371
|
+
onError(`${desc} is not supported with width ${width}`);
|
|
1372
|
+
return void 0;
|
|
1373
|
+
case "X":
|
|
1374
|
+
onError(`${desc} is not supported`);
|
|
1375
|
+
return void 0;
|
|
1376
|
+
}
|
|
1377
|
+
return "short";
|
|
1378
|
+
}
|
|
1379
|
+
function compileOptions(token, onError) {
|
|
1380
|
+
switch (token.field) {
|
|
1381
|
+
case "era":
|
|
1382
|
+
return { era: alpha(token.width) };
|
|
1383
|
+
case "year":
|
|
1384
|
+
return yearOptions(token, onError);
|
|
1385
|
+
case "month":
|
|
1386
|
+
return { month: monthStyle(token, onError) };
|
|
1387
|
+
case "day":
|
|
1388
|
+
return { day: dayStyle(token, onError) };
|
|
1389
|
+
case "weekday":
|
|
1390
|
+
return { weekday: weekdayStyle(token, onError) };
|
|
1391
|
+
case "period":
|
|
1392
|
+
return void 0;
|
|
1393
|
+
case "hour":
|
|
1394
|
+
return hourOptions(token);
|
|
1395
|
+
case "min":
|
|
1396
|
+
return { minute: numeric(token.width) };
|
|
1397
|
+
case "sec":
|
|
1398
|
+
return { second: numeric(token.width) };
|
|
1399
|
+
case "tz":
|
|
1400
|
+
return { timeZoneName: timeZoneNameStyle(token, onError) };
|
|
1401
|
+
case "quarter":
|
|
1402
|
+
case "week":
|
|
1403
|
+
case "sec-frac":
|
|
1404
|
+
case "ms":
|
|
1405
|
+
onError(`${token.desc} is not supported`);
|
|
1406
|
+
}
|
|
1407
|
+
return void 0;
|
|
1408
|
+
}
|
|
1409
|
+
function getDateFormatOptions(tokens, timeZone, onError = (error) => {
|
|
1410
|
+
throw error;
|
|
1411
|
+
}) {
|
|
1412
|
+
const options = {
|
|
1413
|
+
timeZone
|
|
1414
|
+
};
|
|
1415
|
+
const fields2 = [];
|
|
1416
|
+
for (const token of tokens) {
|
|
1417
|
+
const { error, field, str } = token;
|
|
1418
|
+
if (error) {
|
|
1419
|
+
const dte = new DateFormatError(error.message, token);
|
|
1420
|
+
dte.stack = error.stack;
|
|
1421
|
+
onError(dte);
|
|
1422
|
+
}
|
|
1423
|
+
if (str) {
|
|
1424
|
+
const msg = `Ignoring string part: ${str}`;
|
|
1425
|
+
onError(new DateFormatError(msg, token, DateFormatError.WARNING));
|
|
1426
|
+
}
|
|
1427
|
+
if (field) {
|
|
1428
|
+
if (fields2.indexOf(field) === -1)
|
|
1429
|
+
fields2.push(field);
|
|
1430
|
+
else
|
|
1431
|
+
onError(new DateFormatError(`Duplicate ${field} token`, token));
|
|
1432
|
+
}
|
|
1433
|
+
const opt = compileOptions(token, (msg, isWarning) => onError(new DateFormatError(msg, token, isWarning)));
|
|
1434
|
+
if (opt)
|
|
1435
|
+
Object.assign(options, opt);
|
|
1436
|
+
}
|
|
1437
|
+
return options;
|
|
1438
|
+
}
|
|
1439
|
+
var fields = {
|
|
1440
|
+
G: { field: "era", desc: "Era" },
|
|
1441
|
+
y: { field: "year", desc: "Year" },
|
|
1442
|
+
Y: { field: "year", desc: 'Year of "Week of Year"' },
|
|
1443
|
+
u: { field: "year", desc: "Extended year" },
|
|
1444
|
+
U: { field: "year", desc: "Cyclic year name" },
|
|
1445
|
+
r: { field: "year", desc: "Related Gregorian year" },
|
|
1446
|
+
Q: { field: "quarter", desc: "Quarter" },
|
|
1447
|
+
q: { field: "quarter", desc: "Stand-alone quarter" },
|
|
1448
|
+
M: { field: "month", desc: "Month in year" },
|
|
1449
|
+
L: { field: "month", desc: "Stand-alone month in year" },
|
|
1450
|
+
w: { field: "week", desc: "Week of year" },
|
|
1451
|
+
W: { field: "week", desc: "Week of month" },
|
|
1452
|
+
d: { field: "day", desc: "Day in month" },
|
|
1453
|
+
D: { field: "day", desc: "Day of year" },
|
|
1454
|
+
F: { field: "day", desc: "Day of week in month" },
|
|
1455
|
+
g: { field: "day", desc: "Modified julian day" },
|
|
1456
|
+
E: { field: "weekday", desc: "Day of week" },
|
|
1457
|
+
e: { field: "weekday", desc: "Local day of week" },
|
|
1458
|
+
c: { field: "weekday", desc: "Stand-alone local day of week" },
|
|
1459
|
+
a: { field: "period", desc: "AM/PM marker" },
|
|
1460
|
+
b: { field: "period", desc: "AM/PM/noon/midnight marker" },
|
|
1461
|
+
B: { field: "period", desc: "Flexible day period" },
|
|
1462
|
+
h: { field: "hour", desc: "Hour in AM/PM (1~12)" },
|
|
1463
|
+
H: { field: "hour", desc: "Hour in day (0~23)" },
|
|
1464
|
+
k: { field: "hour", desc: "Hour in day (1~24)" },
|
|
1465
|
+
K: { field: "hour", desc: "Hour in AM/PM (0~11)" },
|
|
1466
|
+
j: { field: "hour", desc: "Hour in preferred cycle" },
|
|
1467
|
+
J: { field: "hour", desc: "Hour in preferred cycle without marker" },
|
|
1468
|
+
C: { field: "hour", desc: "Hour in preferred cycle with flexible marker" },
|
|
1469
|
+
m: { field: "min", desc: "Minute in hour" },
|
|
1470
|
+
s: { field: "sec", desc: "Second in minute" },
|
|
1471
|
+
S: { field: "sec-frac", desc: "Fractional second" },
|
|
1472
|
+
A: { field: "ms", desc: "Milliseconds in day" },
|
|
1473
|
+
z: { field: "tz", desc: "Time Zone: specific non-location" },
|
|
1474
|
+
Z: { field: "tz", desc: "Time Zone" },
|
|
1475
|
+
O: { field: "tz", desc: "Time Zone: localized" },
|
|
1476
|
+
v: { field: "tz", desc: "Time Zone: generic non-location" },
|
|
1477
|
+
V: { field: "tz", desc: "Time Zone: ID" },
|
|
1478
|
+
X: { field: "tz", desc: "Time Zone: ISO8601 with Z" },
|
|
1479
|
+
x: { field: "tz", desc: "Time Zone: ISO8601" }
|
|
1480
|
+
};
|
|
1481
|
+
var isLetter = (char) => char >= "A" && char <= "Z" || char >= "a" && char <= "z";
|
|
1482
|
+
function readFieldToken(src, pos) {
|
|
1483
|
+
const char = src[pos];
|
|
1484
|
+
let width = 1;
|
|
1485
|
+
while (src[++pos] === char)
|
|
1486
|
+
++width;
|
|
1487
|
+
const field = fields[char];
|
|
1488
|
+
if (!field) {
|
|
1489
|
+
const msg = `The letter ${char} is not a valid field identifier`;
|
|
1490
|
+
return { char, error: new Error(msg), width };
|
|
1491
|
+
}
|
|
1492
|
+
return { char, field: field.field, desc: field.desc, width };
|
|
1493
|
+
}
|
|
1494
|
+
function readQuotedToken(src, pos) {
|
|
1495
|
+
let str = src[++pos];
|
|
1496
|
+
let width = 2;
|
|
1497
|
+
if (str === "'")
|
|
1498
|
+
return { char: "'", str, width };
|
|
1499
|
+
while (true) {
|
|
1500
|
+
const next = src[++pos];
|
|
1501
|
+
++width;
|
|
1502
|
+
if (next === void 0) {
|
|
1503
|
+
const msg = `Unterminated quoted literal in pattern: ${str || src}`;
|
|
1504
|
+
return { char: "'", error: new Error(msg), str, width };
|
|
1505
|
+
} else if (next === "'") {
|
|
1506
|
+
if (src[++pos] !== "'")
|
|
1507
|
+
return { char: "'", str, width };
|
|
1508
|
+
else
|
|
1509
|
+
++width;
|
|
1510
|
+
}
|
|
1511
|
+
str += next;
|
|
1512
|
+
}
|
|
1513
|
+
}
|
|
1514
|
+
function readToken(src, pos) {
|
|
1515
|
+
const char = src[pos];
|
|
1516
|
+
if (!char)
|
|
1517
|
+
return null;
|
|
1518
|
+
if (isLetter(char))
|
|
1519
|
+
return readFieldToken(src, pos);
|
|
1520
|
+
if (char === "'")
|
|
1521
|
+
return readQuotedToken(src, pos);
|
|
1522
|
+
let str = char;
|
|
1523
|
+
let width = 1;
|
|
1524
|
+
while (true) {
|
|
1525
|
+
const next = src[++pos];
|
|
1526
|
+
if (!next || isLetter(next) || next === "'")
|
|
1527
|
+
return { char, str, width };
|
|
1528
|
+
str += next;
|
|
1529
|
+
width += 1;
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1532
|
+
function parseDateTokens(src) {
|
|
1533
|
+
const tokens = [];
|
|
1534
|
+
let pos = 0;
|
|
1535
|
+
while (true) {
|
|
1536
|
+
const token = readToken(src, pos);
|
|
1537
|
+
if (!token)
|
|
1538
|
+
return tokens;
|
|
1539
|
+
tokens.push(token);
|
|
1540
|
+
pos += token.width;
|
|
1541
|
+
}
|
|
1542
|
+
}
|
|
1285
1543
|
function processTokens(tokens, mapText) {
|
|
1286
1544
|
if (!tokens.filter((token) => token.type !== "content").length) {
|
|
1287
1545
|
return tokens.map((token) => mapText(token.value));
|
|
@@ -1296,6 +1554,12 @@ function processTokens(tokens, mapText) {
|
|
|
1296
1554
|
return [token.arg];
|
|
1297
1555
|
} else if (token.type === "function") {
|
|
1298
1556
|
const _param = (_a = token == null ? void 0 : token.param) == null ? void 0 : _a[0];
|
|
1557
|
+
if (token.key === "date" && _param) {
|
|
1558
|
+
const opts = compileDateExpression(_param.value.trim(), (e) => {
|
|
1559
|
+
throw new Error(`Unable to compile date expression: ${e.message}`);
|
|
1560
|
+
});
|
|
1561
|
+
return [token.arg, token.key, opts];
|
|
1562
|
+
}
|
|
1299
1563
|
if (_param) {
|
|
1300
1564
|
return [token.arg, token.key, _param.value.trim()];
|
|
1301
1565
|
} else {
|
|
@@ -1317,6 +1581,13 @@ function processTokens(tokens, mapText) {
|
|
|
1317
1581
|
];
|
|
1318
1582
|
});
|
|
1319
1583
|
}
|
|
1584
|
+
function compileDateExpression(format, onError) {
|
|
1585
|
+
if (/^::/.test(format)) {
|
|
1586
|
+
const tokens = parseDateTokens(format.substring(2));
|
|
1587
|
+
return getDateFormatOptions(tokens, void 0, onError);
|
|
1588
|
+
}
|
|
1589
|
+
return format;
|
|
1590
|
+
}
|
|
1320
1591
|
function compileMessage(message, mapText = (v) => v) {
|
|
1321
1592
|
try {
|
|
1322
1593
|
return processTokens((0, import_parser.parse)(message), mapText);
|
|
@@ -1328,7 +1599,7 @@ Message: ${message}`);
|
|
|
1328
1599
|
}
|
|
1329
1600
|
}
|
|
1330
1601
|
|
|
1331
|
-
// node_modules/.pnpm/@lingui+core@5.
|
|
1602
|
+
// node_modules/.pnpm/@lingui+core@5.2.0_@lingui+babel-plugin-lingui-macro@5.2.0_babel-plugin-macros@3.1.0_typescri_qfhfd5z2jpd4amxt2golzdalsi/node_modules/@lingui/core/dist/index.mjs
|
|
1332
1603
|
var isString = (s) => typeof s === "string";
|
|
1333
1604
|
var isFunction = (f) => typeof f === "function";
|
|
1334
1605
|
var cache = /* @__PURE__ */ new Map();
|
|
@@ -1339,12 +1610,59 @@ function normalizeLocales(locales) {
|
|
|
1339
1610
|
}
|
|
1340
1611
|
function date(locales, value, format) {
|
|
1341
1612
|
const _locales = normalizeLocales(locales);
|
|
1613
|
+
if (!format) {
|
|
1614
|
+
format = "default";
|
|
1615
|
+
}
|
|
1616
|
+
let o;
|
|
1617
|
+
if (typeof format === "string") {
|
|
1618
|
+
o = {
|
|
1619
|
+
day: "numeric",
|
|
1620
|
+
month: "short",
|
|
1621
|
+
year: "numeric"
|
|
1622
|
+
};
|
|
1623
|
+
switch (format) {
|
|
1624
|
+
case "full":
|
|
1625
|
+
o.weekday = "long";
|
|
1626
|
+
case "long":
|
|
1627
|
+
o.month = "long";
|
|
1628
|
+
break;
|
|
1629
|
+
case "short":
|
|
1630
|
+
o.month = "numeric";
|
|
1631
|
+
break;
|
|
1632
|
+
}
|
|
1633
|
+
} else {
|
|
1634
|
+
o = format;
|
|
1635
|
+
}
|
|
1342
1636
|
const formatter = getMemoized(
|
|
1343
1637
|
() => cacheKey("date", _locales, format),
|
|
1344
|
-
() => new Intl.DateTimeFormat(_locales,
|
|
1638
|
+
() => new Intl.DateTimeFormat(_locales, o)
|
|
1345
1639
|
);
|
|
1346
1640
|
return formatter.format(isString(value) ? new Date(value) : value);
|
|
1347
1641
|
}
|
|
1642
|
+
function time(locales, value, format) {
|
|
1643
|
+
let o;
|
|
1644
|
+
if (!format) {
|
|
1645
|
+
format = "default";
|
|
1646
|
+
}
|
|
1647
|
+
if (typeof format === "string") {
|
|
1648
|
+
o = {
|
|
1649
|
+
second: "numeric",
|
|
1650
|
+
minute: "numeric",
|
|
1651
|
+
hour: "numeric"
|
|
1652
|
+
};
|
|
1653
|
+
switch (format) {
|
|
1654
|
+
case "full":
|
|
1655
|
+
case "long":
|
|
1656
|
+
o.timeZoneName = "short";
|
|
1657
|
+
break;
|
|
1658
|
+
case "short":
|
|
1659
|
+
delete o.second;
|
|
1660
|
+
}
|
|
1661
|
+
} else {
|
|
1662
|
+
o = format;
|
|
1663
|
+
}
|
|
1664
|
+
return date(locales, value, o);
|
|
1665
|
+
}
|
|
1348
1666
|
function number(locales, value, format) {
|
|
1349
1667
|
const _locales = normalizeLocales(locales);
|
|
1350
1668
|
const formatter = getMemoized(
|
|
@@ -1384,7 +1702,9 @@ var OCTOTHORPE_PH = "%__lingui_octothorpe__%";
|
|
|
1384
1702
|
var getDefaultFormats = (locale, passedLocales, formats = {}) => {
|
|
1385
1703
|
const locales = passedLocales || locale;
|
|
1386
1704
|
const style = (format) => {
|
|
1387
|
-
|
|
1705
|
+
if (typeof format === "object")
|
|
1706
|
+
return format;
|
|
1707
|
+
return formats[format];
|
|
1388
1708
|
};
|
|
1389
1709
|
const replaceOctothorpe = (value, message) => {
|
|
1390
1710
|
const numberFormat = Object.keys(formats).length ? style("number") : void 0;
|
|
@@ -1403,8 +1723,13 @@ var getDefaultFormats = (locale, passedLocales, formats = {}) => {
|
|
|
1403
1723
|
return replaceOctothorpe(value - offset, message);
|
|
1404
1724
|
},
|
|
1405
1725
|
select: selectFormatter,
|
|
1406
|
-
number: (value, format) => number(
|
|
1407
|
-
|
|
1726
|
+
number: (value, format) => number(
|
|
1727
|
+
locales,
|
|
1728
|
+
value,
|
|
1729
|
+
style(format) || { style: format }
|
|
1730
|
+
),
|
|
1731
|
+
date: (value, format) => date(locales, value, style(format) || format),
|
|
1732
|
+
time: (value, format) => time(locales, value, style(format) || format)
|
|
1408
1733
|
};
|
|
1409
1734
|
};
|
|
1410
1735
|
var selectFormatter = (value, rules) => {
|
|
@@ -1453,10 +1778,10 @@ function interpolate(translation, locale, locales) {
|
|
|
1453
1778
|
};
|
|
1454
1779
|
const result = formatMessage(translation);
|
|
1455
1780
|
if (isString(result) && UNICODE_REGEX.test(result)) {
|
|
1456
|
-
return (0, import_unraw.unraw)(result
|
|
1781
|
+
return (0, import_unraw.unraw)(result);
|
|
1457
1782
|
}
|
|
1458
1783
|
if (isString(result))
|
|
1459
|
-
return result
|
|
1784
|
+
return result;
|
|
1460
1785
|
return result ? String(result) : "";
|
|
1461
1786
|
};
|
|
1462
1787
|
}
|
|
@@ -1573,9 +1898,8 @@ var I18n = class extends EventEmitter {
|
|
|
1573
1898
|
/**
|
|
1574
1899
|
* @deprecated Plurals automatically used from Intl.PluralRules you can safely remove this call. Deprecated in v4
|
|
1575
1900
|
*/
|
|
1576
|
-
// @ts-ignore deprecated, so ignore the reported error
|
|
1577
1901
|
loadLocaleData(localeOrAllData, localeData) {
|
|
1578
|
-
if (
|
|
1902
|
+
if (typeof localeOrAllData === "string") {
|
|
1579
1903
|
this._loadLocaleData(localeOrAllData, localeData);
|
|
1580
1904
|
} else {
|
|
1581
1905
|
Object.keys(localeOrAllData).forEach(
|
|
@@ -1622,6 +1946,11 @@ var I18n = class extends EventEmitter {
|
|
|
1622
1946
|
this.emit("change");
|
|
1623
1947
|
}
|
|
1624
1948
|
_(id, values, options) {
|
|
1949
|
+
if (!this.locale) {
|
|
1950
|
+
throw new Error(
|
|
1951
|
+
"Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic."
|
|
1952
|
+
);
|
|
1953
|
+
}
|
|
1625
1954
|
let message = options == null ? void 0 : options.message;
|
|
1626
1955
|
if (!id) {
|
|
1627
1956
|
id = "";
|
|
@@ -1678,7 +2007,7 @@ function setupI18n(params = {}) {
|
|
|
1678
2007
|
}
|
|
1679
2008
|
var i18n = setupI18n();
|
|
1680
2009
|
|
|
1681
|
-
// node_modules/.pnpm/@warp-ds+icons@2.5.
|
|
2010
|
+
// node_modules/.pnpm/@warp-ds+icons@2.5.0_@lingui+core@5.2.0_@lingui+babel-plugin-lingui-macro@5.2.0_babel-plugin-_hyhbgchrkasknlbocfng7geeci/node_modules/@warp-ds/icons/dist/elements/info-16.js
|
|
1682
2011
|
var messages = JSON.parse('{"icon.title.info":["Informasjonssirkel"]}');
|
|
1683
2012
|
var messages2 = JSON.parse('{"icon.title.info":["Information circle"]}');
|
|
1684
2013
|
var messages3 = JSON.parse('{"icon.title.info":["Ympyr\xE4, jonka sis\xE4ll\xE4 on i-kirjain"]}');
|
|
@@ -1770,7 +2099,7 @@ if (!customElements.get("w-icon-info-16")) {
|
|
|
1770
2099
|
customElements.define("w-icon-info-16", IconInfo16);
|
|
1771
2100
|
}
|
|
1772
2101
|
|
|
1773
|
-
// node_modules/.pnpm/@warp-ds+icons@2.5.
|
|
2102
|
+
// node_modules/.pnpm/@warp-ds+icons@2.5.0_@lingui+core@5.2.0_@lingui+babel-plugin-lingui-macro@5.2.0_babel-plugin-_hyhbgchrkasknlbocfng7geeci/node_modules/@warp-ds/icons/dist/elements/warning-16.js
|
|
1774
2103
|
import { LitElement as LitElement2 } from "lit";
|
|
1775
2104
|
import { unsafeStatic as unsafeStatic2, html as html2 } from "lit/static-html.js";
|
|
1776
2105
|
var messages6 = JSON.parse('{"icon.title.warning":["Varseltrekant med utropstegn"]}');
|
|
@@ -1864,7 +2193,7 @@ if (!customElements.get("w-icon-warning-16")) {
|
|
|
1864
2193
|
customElements.define("w-icon-warning-16", IconWarning16);
|
|
1865
2194
|
}
|
|
1866
2195
|
|
|
1867
|
-
// node_modules/.pnpm/@warp-ds+icons@2.5.
|
|
2196
|
+
// node_modules/.pnpm/@warp-ds+icons@2.5.0_@lingui+core@5.2.0_@lingui+babel-plugin-lingui-macro@5.2.0_babel-plugin-_hyhbgchrkasknlbocfng7geeci/node_modules/@warp-ds/icons/dist/elements/error-16.js
|
|
1868
2197
|
import { LitElement as LitElement3 } from "lit";
|
|
1869
2198
|
import { unsafeStatic as unsafeStatic3, html as html3 } from "lit/static-html.js";
|
|
1870
2199
|
var messages7 = JSON.parse('{"icon.title.error":["\xC5ttekant med utropstegn"]}');
|
|
@@ -1958,7 +2287,7 @@ if (!customElements.get("w-icon-error-16")) {
|
|
|
1958
2287
|
customElements.define("w-icon-error-16", IconError16);
|
|
1959
2288
|
}
|
|
1960
2289
|
|
|
1961
|
-
// node_modules/.pnpm/@warp-ds+icons@2.5.
|
|
2290
|
+
// node_modules/.pnpm/@warp-ds+icons@2.5.0_@lingui+core@5.2.0_@lingui+babel-plugin-lingui-macro@5.2.0_babel-plugin-_hyhbgchrkasknlbocfng7geeci/node_modules/@warp-ds/icons/dist/elements/success-16.js
|
|
1962
2291
|
import { LitElement as LitElement4 } from "lit";
|
|
1963
2292
|
import { unsafeStatic as unsafeStatic4, html as html4 } from "lit/static-html.js";
|
|
1964
2293
|
var messages8 = JSON.parse('{"icon.title.success":["Sirkel med sjekkmerke"]}');
|