@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
package/dist/index.js
CHANGED
|
@@ -1035,7 +1035,7 @@ var r = function() {
|
|
|
1035
1035
|
}, []).join(" ");
|
|
1036
1036
|
};
|
|
1037
1037
|
|
|
1038
|
-
// node_modules/.pnpm/@warp-ds+css@2.
|
|
1038
|
+
// 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
|
|
1039
1039
|
var badge = {
|
|
1040
1040
|
base: "py-4 px-8 border-0 rounded-4 text-xs inline-flex",
|
|
1041
1041
|
neutral: "bg-[--w-color-badge-neutral-background] s-text",
|
|
@@ -1436,15 +1436,273 @@ var attention = {
|
|
|
1436
1436
|
import WarpElement from "@warp-ds/elements-core";
|
|
1437
1437
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
1438
1438
|
|
|
1439
|
-
// node_modules/.pnpm/@warp-ds+icons@2.5.
|
|
1439
|
+
// 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/search-16.js
|
|
1440
1440
|
import { LitElement } from "lit";
|
|
1441
1441
|
import { unsafeStatic, html } from "lit/static-html.js";
|
|
1442
1442
|
|
|
1443
|
-
// node_modules/.pnpm/@lingui+core@5.
|
|
1443
|
+
// 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
|
|
1444
1444
|
var import_unraw = __toESM(require_dist(), 1);
|
|
1445
1445
|
|
|
1446
|
-
// node_modules/.pnpm/@lingui+message-utils@5.
|
|
1446
|
+
// node_modules/.pnpm/@lingui+message-utils@5.2.0/node_modules/@lingui/message-utils/dist/compileMessage.mjs
|
|
1447
1447
|
var import_parser = __toESM(require_parser(), 1);
|
|
1448
|
+
var DateFormatError = class extends Error {
|
|
1449
|
+
/** @internal */
|
|
1450
|
+
constructor(msg, token, type) {
|
|
1451
|
+
super(msg);
|
|
1452
|
+
this.token = token;
|
|
1453
|
+
this.type = type || "error";
|
|
1454
|
+
}
|
|
1455
|
+
};
|
|
1456
|
+
var alpha = (width) => width < 4 ? "short" : width === 4 ? "long" : "narrow";
|
|
1457
|
+
var numeric = (width) => width % 2 === 0 ? "2-digit" : "numeric";
|
|
1458
|
+
function yearOptions(token, onError) {
|
|
1459
|
+
switch (token.char) {
|
|
1460
|
+
case "y":
|
|
1461
|
+
return { year: numeric(token.width) };
|
|
1462
|
+
case "r":
|
|
1463
|
+
return { calendar: "gregory", year: "numeric" };
|
|
1464
|
+
case "u":
|
|
1465
|
+
case "U":
|
|
1466
|
+
case "Y":
|
|
1467
|
+
default:
|
|
1468
|
+
onError(`${token.desc} is not supported; falling back to year:numeric`, DateFormatError.WARNING);
|
|
1469
|
+
return { year: "numeric" };
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
function monthStyle(token, onError) {
|
|
1473
|
+
switch (token.width) {
|
|
1474
|
+
case 1:
|
|
1475
|
+
return "numeric";
|
|
1476
|
+
case 2:
|
|
1477
|
+
return "2-digit";
|
|
1478
|
+
case 3:
|
|
1479
|
+
return "short";
|
|
1480
|
+
case 4:
|
|
1481
|
+
return "long";
|
|
1482
|
+
case 5:
|
|
1483
|
+
return "narrow";
|
|
1484
|
+
default:
|
|
1485
|
+
onError(`${token.desc} is not supported with width ${token.width}`);
|
|
1486
|
+
return void 0;
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
function dayStyle(token, onError) {
|
|
1490
|
+
const { char, desc, width } = token;
|
|
1491
|
+
if (char === "d") {
|
|
1492
|
+
return numeric(width);
|
|
1493
|
+
} else {
|
|
1494
|
+
onError(`${desc} is not supported`);
|
|
1495
|
+
return void 0;
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
function weekdayStyle(token, onError) {
|
|
1499
|
+
const { char, desc, width } = token;
|
|
1500
|
+
if ((char === "c" || char === "e") && width < 3) {
|
|
1501
|
+
const msg = `Numeric value is not supported for ${desc}; falling back to weekday:short`;
|
|
1502
|
+
onError(msg, DateFormatError.WARNING);
|
|
1503
|
+
}
|
|
1504
|
+
return alpha(width);
|
|
1505
|
+
}
|
|
1506
|
+
function hourOptions(token) {
|
|
1507
|
+
const hour = numeric(token.width);
|
|
1508
|
+
let hourCycle;
|
|
1509
|
+
switch (token.char) {
|
|
1510
|
+
case "h":
|
|
1511
|
+
hourCycle = "h12";
|
|
1512
|
+
break;
|
|
1513
|
+
case "H":
|
|
1514
|
+
hourCycle = "h23";
|
|
1515
|
+
break;
|
|
1516
|
+
case "k":
|
|
1517
|
+
hourCycle = "h24";
|
|
1518
|
+
break;
|
|
1519
|
+
case "K":
|
|
1520
|
+
hourCycle = "h11";
|
|
1521
|
+
break;
|
|
1522
|
+
}
|
|
1523
|
+
return hourCycle ? { hour, hourCycle } : { hour };
|
|
1524
|
+
}
|
|
1525
|
+
function timeZoneNameStyle(token, onError) {
|
|
1526
|
+
const { char, desc, width } = token;
|
|
1527
|
+
switch (char) {
|
|
1528
|
+
case "v":
|
|
1529
|
+
case "z":
|
|
1530
|
+
return width === 4 ? "long" : "short";
|
|
1531
|
+
case "V":
|
|
1532
|
+
if (width === 4)
|
|
1533
|
+
return "long";
|
|
1534
|
+
onError(`${desc} is not supported with width ${width}`);
|
|
1535
|
+
return void 0;
|
|
1536
|
+
case "X":
|
|
1537
|
+
onError(`${desc} is not supported`);
|
|
1538
|
+
return void 0;
|
|
1539
|
+
}
|
|
1540
|
+
return "short";
|
|
1541
|
+
}
|
|
1542
|
+
function compileOptions(token, onError) {
|
|
1543
|
+
switch (token.field) {
|
|
1544
|
+
case "era":
|
|
1545
|
+
return { era: alpha(token.width) };
|
|
1546
|
+
case "year":
|
|
1547
|
+
return yearOptions(token, onError);
|
|
1548
|
+
case "month":
|
|
1549
|
+
return { month: monthStyle(token, onError) };
|
|
1550
|
+
case "day":
|
|
1551
|
+
return { day: dayStyle(token, onError) };
|
|
1552
|
+
case "weekday":
|
|
1553
|
+
return { weekday: weekdayStyle(token, onError) };
|
|
1554
|
+
case "period":
|
|
1555
|
+
return void 0;
|
|
1556
|
+
case "hour":
|
|
1557
|
+
return hourOptions(token);
|
|
1558
|
+
case "min":
|
|
1559
|
+
return { minute: numeric(token.width) };
|
|
1560
|
+
case "sec":
|
|
1561
|
+
return { second: numeric(token.width) };
|
|
1562
|
+
case "tz":
|
|
1563
|
+
return { timeZoneName: timeZoneNameStyle(token, onError) };
|
|
1564
|
+
case "quarter":
|
|
1565
|
+
case "week":
|
|
1566
|
+
case "sec-frac":
|
|
1567
|
+
case "ms":
|
|
1568
|
+
onError(`${token.desc} is not supported`);
|
|
1569
|
+
}
|
|
1570
|
+
return void 0;
|
|
1571
|
+
}
|
|
1572
|
+
function getDateFormatOptions(tokens, timeZone, onError = (error) => {
|
|
1573
|
+
throw error;
|
|
1574
|
+
}) {
|
|
1575
|
+
const options = {
|
|
1576
|
+
timeZone
|
|
1577
|
+
};
|
|
1578
|
+
const fields2 = [];
|
|
1579
|
+
for (const token of tokens) {
|
|
1580
|
+
const { error, field, str } = token;
|
|
1581
|
+
if (error) {
|
|
1582
|
+
const dte = new DateFormatError(error.message, token);
|
|
1583
|
+
dte.stack = error.stack;
|
|
1584
|
+
onError(dte);
|
|
1585
|
+
}
|
|
1586
|
+
if (str) {
|
|
1587
|
+
const msg = `Ignoring string part: ${str}`;
|
|
1588
|
+
onError(new DateFormatError(msg, token, DateFormatError.WARNING));
|
|
1589
|
+
}
|
|
1590
|
+
if (field) {
|
|
1591
|
+
if (fields2.indexOf(field) === -1)
|
|
1592
|
+
fields2.push(field);
|
|
1593
|
+
else
|
|
1594
|
+
onError(new DateFormatError(`Duplicate ${field} token`, token));
|
|
1595
|
+
}
|
|
1596
|
+
const opt = compileOptions(token, (msg, isWarning) => onError(new DateFormatError(msg, token, isWarning)));
|
|
1597
|
+
if (opt)
|
|
1598
|
+
Object.assign(options, opt);
|
|
1599
|
+
}
|
|
1600
|
+
return options;
|
|
1601
|
+
}
|
|
1602
|
+
var fields = {
|
|
1603
|
+
G: { field: "era", desc: "Era" },
|
|
1604
|
+
y: { field: "year", desc: "Year" },
|
|
1605
|
+
Y: { field: "year", desc: 'Year of "Week of Year"' },
|
|
1606
|
+
u: { field: "year", desc: "Extended year" },
|
|
1607
|
+
U: { field: "year", desc: "Cyclic year name" },
|
|
1608
|
+
r: { field: "year", desc: "Related Gregorian year" },
|
|
1609
|
+
Q: { field: "quarter", desc: "Quarter" },
|
|
1610
|
+
q: { field: "quarter", desc: "Stand-alone quarter" },
|
|
1611
|
+
M: { field: "month", desc: "Month in year" },
|
|
1612
|
+
L: { field: "month", desc: "Stand-alone month in year" },
|
|
1613
|
+
w: { field: "week", desc: "Week of year" },
|
|
1614
|
+
W: { field: "week", desc: "Week of month" },
|
|
1615
|
+
d: { field: "day", desc: "Day in month" },
|
|
1616
|
+
D: { field: "day", desc: "Day of year" },
|
|
1617
|
+
F: { field: "day", desc: "Day of week in month" },
|
|
1618
|
+
g: { field: "day", desc: "Modified julian day" },
|
|
1619
|
+
E: { field: "weekday", desc: "Day of week" },
|
|
1620
|
+
e: { field: "weekday", desc: "Local day of week" },
|
|
1621
|
+
c: { field: "weekday", desc: "Stand-alone local day of week" },
|
|
1622
|
+
a: { field: "period", desc: "AM/PM marker" },
|
|
1623
|
+
b: { field: "period", desc: "AM/PM/noon/midnight marker" },
|
|
1624
|
+
B: { field: "period", desc: "Flexible day period" },
|
|
1625
|
+
h: { field: "hour", desc: "Hour in AM/PM (1~12)" },
|
|
1626
|
+
H: { field: "hour", desc: "Hour in day (0~23)" },
|
|
1627
|
+
k: { field: "hour", desc: "Hour in day (1~24)" },
|
|
1628
|
+
K: { field: "hour", desc: "Hour in AM/PM (0~11)" },
|
|
1629
|
+
j: { field: "hour", desc: "Hour in preferred cycle" },
|
|
1630
|
+
J: { field: "hour", desc: "Hour in preferred cycle without marker" },
|
|
1631
|
+
C: { field: "hour", desc: "Hour in preferred cycle with flexible marker" },
|
|
1632
|
+
m: { field: "min", desc: "Minute in hour" },
|
|
1633
|
+
s: { field: "sec", desc: "Second in minute" },
|
|
1634
|
+
S: { field: "sec-frac", desc: "Fractional second" },
|
|
1635
|
+
A: { field: "ms", desc: "Milliseconds in day" },
|
|
1636
|
+
z: { field: "tz", desc: "Time Zone: specific non-location" },
|
|
1637
|
+
Z: { field: "tz", desc: "Time Zone" },
|
|
1638
|
+
O: { field: "tz", desc: "Time Zone: localized" },
|
|
1639
|
+
v: { field: "tz", desc: "Time Zone: generic non-location" },
|
|
1640
|
+
V: { field: "tz", desc: "Time Zone: ID" },
|
|
1641
|
+
X: { field: "tz", desc: "Time Zone: ISO8601 with Z" },
|
|
1642
|
+
x: { field: "tz", desc: "Time Zone: ISO8601" }
|
|
1643
|
+
};
|
|
1644
|
+
var isLetter = (char) => char >= "A" && char <= "Z" || char >= "a" && char <= "z";
|
|
1645
|
+
function readFieldToken(src, pos) {
|
|
1646
|
+
const char = src[pos];
|
|
1647
|
+
let width = 1;
|
|
1648
|
+
while (src[++pos] === char)
|
|
1649
|
+
++width;
|
|
1650
|
+
const field = fields[char];
|
|
1651
|
+
if (!field) {
|
|
1652
|
+
const msg = `The letter ${char} is not a valid field identifier`;
|
|
1653
|
+
return { char, error: new Error(msg), width };
|
|
1654
|
+
}
|
|
1655
|
+
return { char, field: field.field, desc: field.desc, width };
|
|
1656
|
+
}
|
|
1657
|
+
function readQuotedToken(src, pos) {
|
|
1658
|
+
let str = src[++pos];
|
|
1659
|
+
let width = 2;
|
|
1660
|
+
if (str === "'")
|
|
1661
|
+
return { char: "'", str, width };
|
|
1662
|
+
while (true) {
|
|
1663
|
+
const next = src[++pos];
|
|
1664
|
+
++width;
|
|
1665
|
+
if (next === void 0) {
|
|
1666
|
+
const msg = `Unterminated quoted literal in pattern: ${str || src}`;
|
|
1667
|
+
return { char: "'", error: new Error(msg), str, width };
|
|
1668
|
+
} else if (next === "'") {
|
|
1669
|
+
if (src[++pos] !== "'")
|
|
1670
|
+
return { char: "'", str, width };
|
|
1671
|
+
else
|
|
1672
|
+
++width;
|
|
1673
|
+
}
|
|
1674
|
+
str += next;
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1677
|
+
function readToken(src, pos) {
|
|
1678
|
+
const char = src[pos];
|
|
1679
|
+
if (!char)
|
|
1680
|
+
return null;
|
|
1681
|
+
if (isLetter(char))
|
|
1682
|
+
return readFieldToken(src, pos);
|
|
1683
|
+
if (char === "'")
|
|
1684
|
+
return readQuotedToken(src, pos);
|
|
1685
|
+
let str = char;
|
|
1686
|
+
let width = 1;
|
|
1687
|
+
while (true) {
|
|
1688
|
+
const next = src[++pos];
|
|
1689
|
+
if (!next || isLetter(next) || next === "'")
|
|
1690
|
+
return { char, str, width };
|
|
1691
|
+
str += next;
|
|
1692
|
+
width += 1;
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1695
|
+
function parseDateTokens(src) {
|
|
1696
|
+
const tokens = [];
|
|
1697
|
+
let pos = 0;
|
|
1698
|
+
while (true) {
|
|
1699
|
+
const token = readToken(src, pos);
|
|
1700
|
+
if (!token)
|
|
1701
|
+
return tokens;
|
|
1702
|
+
tokens.push(token);
|
|
1703
|
+
pos += token.width;
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1448
1706
|
function processTokens(tokens, mapText) {
|
|
1449
1707
|
if (!tokens.filter((token) => token.type !== "content").length) {
|
|
1450
1708
|
return tokens.map((token) => mapText(token.value));
|
|
@@ -1459,6 +1717,12 @@ function processTokens(tokens, mapText) {
|
|
|
1459
1717
|
return [token.arg];
|
|
1460
1718
|
} else if (token.type === "function") {
|
|
1461
1719
|
const _param = (_a = token == null ? void 0 : token.param) == null ? void 0 : _a[0];
|
|
1720
|
+
if (token.key === "date" && _param) {
|
|
1721
|
+
const opts = compileDateExpression(_param.value.trim(), (e) => {
|
|
1722
|
+
throw new Error(`Unable to compile date expression: ${e.message}`);
|
|
1723
|
+
});
|
|
1724
|
+
return [token.arg, token.key, opts];
|
|
1725
|
+
}
|
|
1462
1726
|
if (_param) {
|
|
1463
1727
|
return [token.arg, token.key, _param.value.trim()];
|
|
1464
1728
|
} else {
|
|
@@ -1480,6 +1744,13 @@ function processTokens(tokens, mapText) {
|
|
|
1480
1744
|
];
|
|
1481
1745
|
});
|
|
1482
1746
|
}
|
|
1747
|
+
function compileDateExpression(format, onError) {
|
|
1748
|
+
if (/^::/.test(format)) {
|
|
1749
|
+
const tokens = parseDateTokens(format.substring(2));
|
|
1750
|
+
return getDateFormatOptions(tokens, void 0, onError);
|
|
1751
|
+
}
|
|
1752
|
+
return format;
|
|
1753
|
+
}
|
|
1483
1754
|
function compileMessage(message, mapText = (v) => v) {
|
|
1484
1755
|
try {
|
|
1485
1756
|
return processTokens((0, import_parser.parse)(message), mapText);
|
|
@@ -1491,7 +1762,7 @@ Message: ${message}`);
|
|
|
1491
1762
|
}
|
|
1492
1763
|
}
|
|
1493
1764
|
|
|
1494
|
-
// node_modules/.pnpm/@lingui+core@5.
|
|
1765
|
+
// 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
|
|
1495
1766
|
var isString = (s) => typeof s === "string";
|
|
1496
1767
|
var isFunction = (f2) => typeof f2 === "function";
|
|
1497
1768
|
var cache = /* @__PURE__ */ new Map();
|
|
@@ -1502,12 +1773,59 @@ function normalizeLocales(locales) {
|
|
|
1502
1773
|
}
|
|
1503
1774
|
function date(locales, value, format) {
|
|
1504
1775
|
const _locales = normalizeLocales(locales);
|
|
1776
|
+
if (!format) {
|
|
1777
|
+
format = "default";
|
|
1778
|
+
}
|
|
1779
|
+
let o;
|
|
1780
|
+
if (typeof format === "string") {
|
|
1781
|
+
o = {
|
|
1782
|
+
day: "numeric",
|
|
1783
|
+
month: "short",
|
|
1784
|
+
year: "numeric"
|
|
1785
|
+
};
|
|
1786
|
+
switch (format) {
|
|
1787
|
+
case "full":
|
|
1788
|
+
o.weekday = "long";
|
|
1789
|
+
case "long":
|
|
1790
|
+
o.month = "long";
|
|
1791
|
+
break;
|
|
1792
|
+
case "short":
|
|
1793
|
+
o.month = "numeric";
|
|
1794
|
+
break;
|
|
1795
|
+
}
|
|
1796
|
+
} else {
|
|
1797
|
+
o = format;
|
|
1798
|
+
}
|
|
1505
1799
|
const formatter = getMemoized(
|
|
1506
1800
|
() => cacheKey("date", _locales, format),
|
|
1507
|
-
() => new Intl.DateTimeFormat(_locales,
|
|
1801
|
+
() => new Intl.DateTimeFormat(_locales, o)
|
|
1508
1802
|
);
|
|
1509
1803
|
return formatter.format(isString(value) ? new Date(value) : value);
|
|
1510
1804
|
}
|
|
1805
|
+
function time(locales, value, format) {
|
|
1806
|
+
let o;
|
|
1807
|
+
if (!format) {
|
|
1808
|
+
format = "default";
|
|
1809
|
+
}
|
|
1810
|
+
if (typeof format === "string") {
|
|
1811
|
+
o = {
|
|
1812
|
+
second: "numeric",
|
|
1813
|
+
minute: "numeric",
|
|
1814
|
+
hour: "numeric"
|
|
1815
|
+
};
|
|
1816
|
+
switch (format) {
|
|
1817
|
+
case "full":
|
|
1818
|
+
case "long":
|
|
1819
|
+
o.timeZoneName = "short";
|
|
1820
|
+
break;
|
|
1821
|
+
case "short":
|
|
1822
|
+
delete o.second;
|
|
1823
|
+
}
|
|
1824
|
+
} else {
|
|
1825
|
+
o = format;
|
|
1826
|
+
}
|
|
1827
|
+
return date(locales, value, o);
|
|
1828
|
+
}
|
|
1511
1829
|
function number(locales, value, format) {
|
|
1512
1830
|
const _locales = normalizeLocales(locales);
|
|
1513
1831
|
const formatter = getMemoized(
|
|
@@ -1547,7 +1865,9 @@ var OCTOTHORPE_PH = "%__lingui_octothorpe__%";
|
|
|
1547
1865
|
var getDefaultFormats = (locale, passedLocales, formats = {}) => {
|
|
1548
1866
|
const locales = passedLocales || locale;
|
|
1549
1867
|
const style = (format) => {
|
|
1550
|
-
|
|
1868
|
+
if (typeof format === "object")
|
|
1869
|
+
return format;
|
|
1870
|
+
return formats[format];
|
|
1551
1871
|
};
|
|
1552
1872
|
const replaceOctothorpe = (value, message) => {
|
|
1553
1873
|
const numberFormat = Object.keys(formats).length ? style("number") : void 0;
|
|
@@ -1566,8 +1886,13 @@ var getDefaultFormats = (locale, passedLocales, formats = {}) => {
|
|
|
1566
1886
|
return replaceOctothorpe(value - offset3, message);
|
|
1567
1887
|
},
|
|
1568
1888
|
select: selectFormatter,
|
|
1569
|
-
number: (value, format) => number(
|
|
1570
|
-
|
|
1889
|
+
number: (value, format) => number(
|
|
1890
|
+
locales,
|
|
1891
|
+
value,
|
|
1892
|
+
style(format) || { style: format }
|
|
1893
|
+
),
|
|
1894
|
+
date: (value, format) => date(locales, value, style(format) || format),
|
|
1895
|
+
time: (value, format) => time(locales, value, style(format) || format)
|
|
1571
1896
|
};
|
|
1572
1897
|
};
|
|
1573
1898
|
var selectFormatter = (value, rules) => {
|
|
@@ -1616,10 +1941,10 @@ function interpolate(translation, locale, locales) {
|
|
|
1616
1941
|
};
|
|
1617
1942
|
const result = formatMessage(translation);
|
|
1618
1943
|
if (isString(result) && UNICODE_REGEX.test(result)) {
|
|
1619
|
-
return (0, import_unraw.unraw)(result
|
|
1944
|
+
return (0, import_unraw.unraw)(result);
|
|
1620
1945
|
}
|
|
1621
1946
|
if (isString(result))
|
|
1622
|
-
return result
|
|
1947
|
+
return result;
|
|
1623
1948
|
return result ? String(result) : "";
|
|
1624
1949
|
};
|
|
1625
1950
|
}
|
|
@@ -1736,9 +2061,8 @@ var I18n = class extends EventEmitter {
|
|
|
1736
2061
|
/**
|
|
1737
2062
|
* @deprecated Plurals automatically used from Intl.PluralRules you can safely remove this call. Deprecated in v4
|
|
1738
2063
|
*/
|
|
1739
|
-
// @ts-ignore deprecated, so ignore the reported error
|
|
1740
2064
|
loadLocaleData(localeOrAllData, localeData) {
|
|
1741
|
-
if (
|
|
2065
|
+
if (typeof localeOrAllData === "string") {
|
|
1742
2066
|
this._loadLocaleData(localeOrAllData, localeData);
|
|
1743
2067
|
} else {
|
|
1744
2068
|
Object.keys(localeOrAllData).forEach(
|
|
@@ -1785,6 +2109,11 @@ var I18n = class extends EventEmitter {
|
|
|
1785
2109
|
this.emit("change");
|
|
1786
2110
|
}
|
|
1787
2111
|
_(id, values, options) {
|
|
2112
|
+
if (!this.locale) {
|
|
2113
|
+
throw new Error(
|
|
2114
|
+
"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."
|
|
2115
|
+
);
|
|
2116
|
+
}
|
|
1788
2117
|
let message = options == null ? void 0 : options.message;
|
|
1789
2118
|
if (!id) {
|
|
1790
2119
|
id = "";
|
|
@@ -1841,7 +2170,7 @@ function setupI18n(params = {}) {
|
|
|
1841
2170
|
}
|
|
1842
2171
|
var i18n = setupI18n();
|
|
1843
2172
|
|
|
1844
|
-
// node_modules/.pnpm/@warp-ds+icons@2.5.
|
|
2173
|
+
// 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/search-16.js
|
|
1845
2174
|
var messages = JSON.parse('{"icon.title.search":["Forst\xF8rrelsesglass"]}');
|
|
1846
2175
|
var messages2 = JSON.parse('{"icon.title.search":["Magnifying glass"]}');
|
|
1847
2176
|
var messages3 = JSON.parse('{"icon.title.search":["Suurennuslasi"]}');
|
|
@@ -1933,7 +2262,7 @@ if (!customElements.get("w-icon-search-16")) {
|
|
|
1933
2262
|
customElements.define("w-icon-search-16", IconSearch16);
|
|
1934
2263
|
}
|
|
1935
2264
|
|
|
1936
|
-
// node_modules/.pnpm/@warp-ds+icons@2.5.
|
|
2265
|
+
// 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/close-16.js
|
|
1937
2266
|
import { LitElement as LitElement2 } from "lit";
|
|
1938
2267
|
import { unsafeStatic as unsafeStatic2, html as html2 } from "lit/static-html.js";
|
|
1939
2268
|
var messages6 = JSON.parse('{"icon.title.close":["Kryss"]}');
|
|
@@ -2104,7 +2433,7 @@ if (!customElements.get("w-affix")) {
|
|
|
2104
2433
|
import { css, html as html8 } from "lit";
|
|
2105
2434
|
import WarpElement2 from "@warp-ds/elements-core";
|
|
2106
2435
|
|
|
2107
|
-
// node_modules/.pnpm/@warp-ds+icons@2.5.
|
|
2436
|
+
// 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
|
|
2108
2437
|
import { LitElement as LitElement3 } from "lit";
|
|
2109
2438
|
import { unsafeStatic as unsafeStatic3, html as html4 } from "lit/static-html.js";
|
|
2110
2439
|
var messages7 = JSON.parse('{"icon.title.info":["Informasjonssirkel"]}');
|
|
@@ -2198,7 +2527,7 @@ if (!customElements.get("w-icon-info-16")) {
|
|
|
2198
2527
|
customElements.define("w-icon-info-16", IconInfo16);
|
|
2199
2528
|
}
|
|
2200
2529
|
|
|
2201
|
-
// node_modules/.pnpm/@warp-ds+icons@2.5.
|
|
2530
|
+
// 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
|
|
2202
2531
|
import { LitElement as LitElement4 } from "lit";
|
|
2203
2532
|
import { unsafeStatic as unsafeStatic4, html as html5 } from "lit/static-html.js";
|
|
2204
2533
|
var messages8 = JSON.parse('{"icon.title.warning":["Varseltrekant med utropstegn"]}');
|
|
@@ -2292,7 +2621,7 @@ if (!customElements.get("w-icon-warning-16")) {
|
|
|
2292
2621
|
customElements.define("w-icon-warning-16", IconWarning16);
|
|
2293
2622
|
}
|
|
2294
2623
|
|
|
2295
|
-
// node_modules/.pnpm/@warp-ds+icons@2.5.
|
|
2624
|
+
// 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
|
|
2296
2625
|
import { LitElement as LitElement5 } from "lit";
|
|
2297
2626
|
import { unsafeStatic as unsafeStatic5, html as html6 } from "lit/static-html.js";
|
|
2298
2627
|
var messages9 = JSON.parse('{"icon.title.error":["\xC5ttekant med utropstegn"]}');
|
|
@@ -2386,7 +2715,7 @@ if (!customElements.get("w-icon-error-16")) {
|
|
|
2386
2715
|
customElements.define("w-icon-error-16", IconError16);
|
|
2387
2716
|
}
|
|
2388
2717
|
|
|
2389
|
-
// node_modules/.pnpm/@warp-ds+icons@2.5.
|
|
2718
|
+
// 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
|
|
2390
2719
|
import { LitElement as LitElement6 } from "lit";
|
|
2391
2720
|
import { unsafeStatic as unsafeStatic6, html as html7 } from "lit/static-html.js";
|
|
2392
2721
|
var messages10 = JSON.parse('{"icon.title.success":["Sirkel med sjekkmerke"]}');
|
|
@@ -4943,7 +5272,7 @@ import { css as css5, html as html18 } from "lit";
|
|
|
4943
5272
|
import WarpElement10 from "@warp-ds/elements-core";
|
|
4944
5273
|
import { ifDefined as ifDefined4 } from "lit/directives/if-defined.js";
|
|
4945
5274
|
|
|
4946
|
-
// node_modules/.pnpm/@warp-ds+icons@2.5.
|
|
5275
|
+
// 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/chevron-down-16.js
|
|
4947
5276
|
import { LitElement as LitElement7 } from "lit";
|
|
4948
5277
|
import { unsafeStatic as unsafeStatic7, html as html16 } from "lit/static-html.js";
|
|
4949
5278
|
var messages41 = JSON.parse('{"icon.title.chevron-down":["Nedoverpil"]}');
|
|
@@ -5037,7 +5366,7 @@ if (!customElements.get("w-icon-chevron-down-16")) {
|
|
|
5037
5366
|
customElements.define("w-icon-chevron-down-16", IconChevronDown16);
|
|
5038
5367
|
}
|
|
5039
5368
|
|
|
5040
|
-
// node_modules/.pnpm/@warp-ds+icons@2.5.
|
|
5369
|
+
// 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/chevron-up-16.js
|
|
5041
5370
|
import { LitElement as LitElement8 } from "lit";
|
|
5042
5371
|
import { unsafeStatic as unsafeStatic8, html as html17 } from "lit/static-html.js";
|
|
5043
5372
|
var messages48 = JSON.parse('{"icon.title.chevron-up":["Oppoverpil"]}');
|
|
@@ -5352,7 +5681,7 @@ var Move = class {
|
|
|
5352
5681
|
}
|
|
5353
5682
|
};
|
|
5354
5683
|
|
|
5355
|
-
// node_modules/.pnpm/@warp-ds+icons@2.5.
|
|
5684
|
+
// 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/arrow-left-16.js
|
|
5356
5685
|
import { LitElement as LitElement9 } from "lit";
|
|
5357
5686
|
import { unsafeStatic as unsafeStatic9, html as html20 } from "lit/static-html.js";
|
|
5358
5687
|
var messages50 = JSON.parse('{"icon.title.arrow-left":["Pil som peker mot venstre"]}');
|