@warp-ds/elements 1.2.3-next.2 → 1.3.0-next.2
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.d.ts +2 -1
- package/dist/index.js +811 -367
- package/dist/index.js.map +4 -4
- package/dist/packages/affix/index.js +164 -68
- package/dist/packages/affix/index.js.map +4 -4
- package/dist/packages/alert/index.js +296 -118
- package/dist/packages/alert/index.js.map +4 -4
- package/dist/packages/attention/index.js +117 -62
- package/dist/packages/attention/index.js.map +4 -4
- package/dist/packages/badge/index.js +3 -3
- package/dist/packages/badge/index.js.map +2 -2
- package/dist/packages/box/index.js +3 -3
- package/dist/packages/box/index.js.map +2 -2
- package/dist/packages/breadcrumbs/index.js +67 -53
- package/dist/packages/breadcrumbs/index.js.map +4 -4
- package/dist/packages/button/index.js +66 -52
- package/dist/packages/button/index.js.map +4 -4
- package/dist/packages/card/index.js +3 -3
- package/dist/packages/card/index.js.map +2 -2
- package/dist/packages/expandable/index.js +163 -67
- package/dist/packages/expandable/index.js.map +4 -4
- package/dist/packages/pill/index.d.ts +34 -0
- package/dist/packages/pill/index.js +1851 -0
- package/dist/packages/pill/index.js.map +7 -0
- package/dist/packages/pill/locales/en/messages.d.mts +1 -0
- package/dist/packages/pill/locales/fi/messages.d.mts +1 -0
- package/dist/packages/pill/locales/nb/messages.d.mts +1 -0
- package/dist/packages/select/index.js +116 -61
- package/dist/packages/select/index.js.map +4 -4
- package/dist/packages/textfield/index.js +3 -3
- package/dist/packages/textfield/index.js.map +2 -2
- package/dist/packages/toast/index.js +291 -113
- package/dist/packages/toast/index.js.map +4 -4
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1045,7 +1045,7 @@ import { html as html3 } from "lit";
|
|
|
1045
1045
|
import WarpElement from "@warp-ds/elements-core";
|
|
1046
1046
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
1047
1047
|
|
|
1048
|
-
// node_modules/.pnpm/@warp-ds+css@1.
|
|
1048
|
+
// node_modules/.pnpm/@warp-ds+css@1.7.0/node_modules/@warp-ds/css/component-classes/index.js
|
|
1049
1049
|
var badge = {
|
|
1050
1050
|
base: "py-4 px-8 border-0 rounded-4 text-xs inline-flex",
|
|
1051
1051
|
neutral: "i-bg-$color-badge-neutral-background i-text-$color-badge-neutral-text",
|
|
@@ -1074,6 +1074,17 @@ var box = {
|
|
|
1074
1074
|
neutralClickable: "hover:i-bg-$color-box-neutral-background-hover active:i-bg-$color-box-neutral-background-hover",
|
|
1075
1075
|
borderedClickable: "hover:i-bg-$color-box-bordered-background-hover active:i-bg-$color-box-bordered-background-hover hover:i-border-$color-box-bordered-border-hover active:i-border-$color-box-bordered-border-hover"
|
|
1076
1076
|
};
|
|
1077
|
+
var pill = {
|
|
1078
|
+
pill: "flex items-center",
|
|
1079
|
+
button: "inline-flex items-center focusable text-xs transition-all",
|
|
1080
|
+
suggestion: "i-bg-$color-pill-suggestion-background hover:i-bg-$color-pill-suggestion-background-hover active:i-bg-$color-pill-suggestion-background-active i-text-$color-pill-suggestion-text font-bold",
|
|
1081
|
+
filter: "i-bg-$color-pill-filter-background hover:i-bg-$color-pill-filter-background-hover active:i-bg-$color-pill-filter-background-active i-text-$color-pill-filter-text",
|
|
1082
|
+
label: "pl-12 py-8 rounded-l-full",
|
|
1083
|
+
labelWithoutClose: "pr-12 rounded-r-full",
|
|
1084
|
+
labelWithClose: "pr-2",
|
|
1085
|
+
close: "pr-12 pl-4 py-8 rounded-r-full",
|
|
1086
|
+
a11y: "sr-only"
|
|
1087
|
+
};
|
|
1077
1088
|
var card = {
|
|
1078
1089
|
card: "cursor-pointer overflow-hidden relative transition-all",
|
|
1079
1090
|
cardShadow: "rounded-8 i-shadow-$shadow-card hover:i-shadow-$shadow-card-hover hover:i-bg-$color-card-background-hover tap-highlight-transparent",
|
|
@@ -1253,9 +1264,9 @@ var modal = {
|
|
|
1253
1264
|
content: "block overflow-y-auto overflow-x-hidden last-child:mb-0 grow shrink px-16 sm:px-32 relative",
|
|
1254
1265
|
footer: "flex justify-end shrink-0 px-16 sm:px-32",
|
|
1255
1266
|
transitionTitle: "transition-all duration-300",
|
|
1256
|
-
transitionTitleCenter: "justify-self-center",
|
|
1267
|
+
transitionTitleCenter: "justify-self-center self-center",
|
|
1257
1268
|
transitionTitleColSpan: "col-span-2",
|
|
1258
|
-
title: "-mt-4 sm:-mt-8 h-40 sm:h-48 grid gap-8 sm:gap-16 grid-cols-[auto_1fr_auto] items-
|
|
1269
|
+
title: "py-8 sm:py-0 -mt-4 sm:-mt-8 min-h-40 sm:min-h-48 grid gap-8 sm:gap-16 grid-cols-[auto_1fr_auto] items-start px-16 sm:px-32 border-b sm:border-b-0 shrink-0",
|
|
1259
1270
|
titleText: "mb-0 h4 sm:h3",
|
|
1260
1271
|
titleButton: `${buttonTextSizes.medium} ${buttonTypes.pill} ${buttonColors.pill} sm:min-h-[44px] sm:min-w-[44px] min-h-[32px] min-w-[32px]`,
|
|
1261
1272
|
titleButtonLeft: "-ml-8 sm:-ml-12 justify-self-start",
|
|
@@ -1355,14 +1366,14 @@ var attention = {
|
|
|
1355
1366
|
closeBtn: `${buttonTextSizes.medium} ${buttonTypes.pill} ${buttonColors.pill} justify-self-end -mr-8 ml-8`
|
|
1356
1367
|
};
|
|
1357
1368
|
|
|
1358
|
-
// node_modules/.pnpm/@warp-ds+icons@
|
|
1369
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.0/node_modules/@warp-ds/icons/dist/elements/search-16.js
|
|
1359
1370
|
import { LitElement } from "lit";
|
|
1360
1371
|
import { unsafeStatic, html } from "lit/static-html.js";
|
|
1361
1372
|
|
|
1362
|
-
// node_modules/.pnpm/@lingui+core@4.
|
|
1373
|
+
// node_modules/.pnpm/@lingui+core@4.7.0/node_modules/@lingui/core/dist/index.mjs
|
|
1363
1374
|
var import_unraw = __toESM(require_dist(), 1);
|
|
1364
1375
|
|
|
1365
|
-
// node_modules/.pnpm/@lingui+message-utils@4.
|
|
1376
|
+
// node_modules/.pnpm/@lingui+message-utils@4.7.0/node_modules/@lingui/message-utils/dist/compileMessage.mjs
|
|
1366
1377
|
var import_parser = __toESM(require_parser(), 1);
|
|
1367
1378
|
function processTokens(tokens, mapText) {
|
|
1368
1379
|
if (!tokens.filter((token) => token.type !== "content").length) {
|
|
@@ -1412,13 +1423,14 @@ Message: ${message}`);
|
|
|
1412
1423
|
}
|
|
1413
1424
|
}
|
|
1414
1425
|
|
|
1415
|
-
// node_modules/.pnpm/@lingui+core@4.
|
|
1426
|
+
// node_modules/.pnpm/@lingui+core@4.7.0/node_modules/@lingui/core/dist/index.mjs
|
|
1416
1427
|
var isString = (s3) => typeof s3 === "string";
|
|
1417
1428
|
var isFunction = (f3) => typeof f3 === "function";
|
|
1418
1429
|
var cache = /* @__PURE__ */ new Map();
|
|
1430
|
+
var defaultLocale = "en";
|
|
1419
1431
|
function normalizeLocales(locales) {
|
|
1420
1432
|
const out = Array.isArray(locales) ? locales : [locales];
|
|
1421
|
-
return [...out,
|
|
1433
|
+
return [...out, defaultLocale];
|
|
1422
1434
|
}
|
|
1423
1435
|
function date(locales, value, format) {
|
|
1424
1436
|
const _locales = normalizeLocales(locales);
|
|
@@ -1463,11 +1475,13 @@ function cacheKey(type, locales, options) {
|
|
|
1463
1475
|
return `${type}-${localeKey}-${JSON.stringify(options)}`;
|
|
1464
1476
|
}
|
|
1465
1477
|
var UNICODE_REGEX = /\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g;
|
|
1466
|
-
var getDefaultFormats = (locale,
|
|
1467
|
-
locales =
|
|
1468
|
-
const style = (format) =>
|
|
1478
|
+
var getDefaultFormats = (locale, passedLocales, formats = {}) => {
|
|
1479
|
+
const locales = passedLocales || locale;
|
|
1480
|
+
const style = (format) => {
|
|
1481
|
+
return typeof format === "object" ? format : formats[format] || { style: format };
|
|
1482
|
+
};
|
|
1469
1483
|
const replaceOctothorpe = (value, message) => {
|
|
1470
|
-
const numberFormat = Object.keys(formats).length ? style("number") :
|
|
1484
|
+
const numberFormat = Object.keys(formats).length ? style("number") : void 0;
|
|
1471
1485
|
const valueStr = number(locales, value, numberFormat);
|
|
1472
1486
|
return message.replace("#", valueStr);
|
|
1473
1487
|
};
|
|
@@ -1482,17 +1496,19 @@ var getDefaultFormats = (locale, locales, formats = {}) => {
|
|
|
1482
1496
|
const message = plural(locales, true, value, cases);
|
|
1483
1497
|
return replaceOctothorpe(value - offset, message);
|
|
1484
1498
|
},
|
|
1485
|
-
select:
|
|
1486
|
-
var _a;
|
|
1487
|
-
return (_a = rules[value]) != null ? _a : rules.other;
|
|
1488
|
-
},
|
|
1499
|
+
select: selectFormatter,
|
|
1489
1500
|
number: (value, format) => number(locales, value, style(format)),
|
|
1490
1501
|
date: (value, format) => date(locales, value, style(format)),
|
|
1491
|
-
undefined:
|
|
1502
|
+
undefined: undefinedFormatter
|
|
1492
1503
|
};
|
|
1493
1504
|
};
|
|
1505
|
+
var selectFormatter = (value, rules) => {
|
|
1506
|
+
var _a;
|
|
1507
|
+
return (_a = rules[value]) != null ? _a : rules.other;
|
|
1508
|
+
};
|
|
1509
|
+
var undefinedFormatter = (value) => value;
|
|
1494
1510
|
function interpolate(translation, locale, locales) {
|
|
1495
|
-
return (values
|
|
1511
|
+
return (values = {}, formats) => {
|
|
1496
1512
|
const formatters = getDefaultFormats(locale, locales, formats);
|
|
1497
1513
|
const formatMessage = (message) => {
|
|
1498
1514
|
if (!Array.isArray(message))
|
|
@@ -1502,14 +1518,15 @@ function interpolate(translation, locale, locales) {
|
|
|
1502
1518
|
return message2 + token;
|
|
1503
1519
|
const [name, type, format] = token;
|
|
1504
1520
|
let interpolatedFormat = {};
|
|
1505
|
-
if (format != null &&
|
|
1506
|
-
Object.
|
|
1507
|
-
interpolatedFormat[key] = formatMessage(
|
|
1521
|
+
if (format != null && typeof format === "object") {
|
|
1522
|
+
Object.entries(format).forEach(([key, value2]) => {
|
|
1523
|
+
interpolatedFormat[key] = formatMessage(value2);
|
|
1508
1524
|
});
|
|
1509
1525
|
} else {
|
|
1510
1526
|
interpolatedFormat = format;
|
|
1511
1527
|
}
|
|
1512
|
-
const
|
|
1528
|
+
const formatter = formatters[type];
|
|
1529
|
+
const value = formatter(values[name], interpolatedFormat);
|
|
1513
1530
|
if (value == null)
|
|
1514
1531
|
return message2;
|
|
1515
1532
|
return message2 + value;
|
|
@@ -1521,7 +1538,7 @@ function interpolate(translation, locale, locales) {
|
|
|
1521
1538
|
}
|
|
1522
1539
|
if (isString(result))
|
|
1523
1540
|
return result.trim();
|
|
1524
|
-
return result;
|
|
1541
|
+
return result ? String(result) : "";
|
|
1525
1542
|
};
|
|
1526
1543
|
}
|
|
1527
1544
|
var __defProp$1 = Object.defineProperty;
|
|
@@ -1535,25 +1552,29 @@ var EventEmitter = class {
|
|
|
1535
1552
|
__publicField$1(this, "_events", {});
|
|
1536
1553
|
}
|
|
1537
1554
|
on(event, listener) {
|
|
1538
|
-
|
|
1539
|
-
|
|
1555
|
+
var _a2;
|
|
1556
|
+
var _a;
|
|
1557
|
+
(_a2 = (_a = this._events)[event]) != null ? _a2 : _a[event] = [];
|
|
1540
1558
|
this._events[event].push(listener);
|
|
1541
1559
|
return () => this.removeListener(event, listener);
|
|
1542
1560
|
}
|
|
1543
1561
|
removeListener(event, listener) {
|
|
1544
|
-
|
|
1562
|
+
const maybeListeners = this._getListeners(event);
|
|
1563
|
+
if (!maybeListeners)
|
|
1545
1564
|
return;
|
|
1546
|
-
const index =
|
|
1565
|
+
const index = maybeListeners.indexOf(listener);
|
|
1547
1566
|
if (~index)
|
|
1548
|
-
|
|
1567
|
+
maybeListeners.splice(index, 1);
|
|
1549
1568
|
}
|
|
1550
1569
|
emit(event, ...args) {
|
|
1551
|
-
|
|
1570
|
+
const maybeListeners = this._getListeners(event);
|
|
1571
|
+
if (!maybeListeners)
|
|
1552
1572
|
return;
|
|
1553
|
-
|
|
1573
|
+
maybeListeners.map((listener) => listener.apply(this, args));
|
|
1554
1574
|
}
|
|
1555
|
-
|
|
1556
|
-
|
|
1575
|
+
_getListeners(event) {
|
|
1576
|
+
const maybeListeners = this._events[event];
|
|
1577
|
+
return Array.isArray(maybeListeners) ? maybeListeners : false;
|
|
1557
1578
|
}
|
|
1558
1579
|
};
|
|
1559
1580
|
var __defProp2 = Object.defineProperty;
|
|
@@ -1564,23 +1585,22 @@ var __publicField2 = (obj, key, value) => {
|
|
|
1564
1585
|
};
|
|
1565
1586
|
var I18n = class extends EventEmitter {
|
|
1566
1587
|
constructor(params) {
|
|
1588
|
+
var _a;
|
|
1567
1589
|
super();
|
|
1568
|
-
__publicField2(this, "_locale");
|
|
1590
|
+
__publicField2(this, "_locale", "");
|
|
1569
1591
|
__publicField2(this, "_locales");
|
|
1570
|
-
__publicField2(this, "_localeData");
|
|
1571
|
-
__publicField2(this, "_messages");
|
|
1592
|
+
__publicField2(this, "_localeData", {});
|
|
1593
|
+
__publicField2(this, "_messages", {});
|
|
1572
1594
|
__publicField2(this, "_missing");
|
|
1573
1595
|
__publicField2(this, "t", this._.bind(this));
|
|
1574
|
-
this._messages = {};
|
|
1575
|
-
this._localeData = {};
|
|
1576
1596
|
if (params.missing != null)
|
|
1577
1597
|
this._missing = params.missing;
|
|
1578
1598
|
if (params.messages != null)
|
|
1579
1599
|
this.load(params.messages);
|
|
1580
1600
|
if (params.localeData != null)
|
|
1581
1601
|
this.loadLocaleData(params.localeData);
|
|
1582
|
-
if (params.locale
|
|
1583
|
-
this.activate(params.locale, params.locales);
|
|
1602
|
+
if (typeof params.locale === "string" || params.locales) {
|
|
1603
|
+
this.activate((_a = params.locale) != null ? _a : defaultLocale, params.locales);
|
|
1584
1604
|
}
|
|
1585
1605
|
}
|
|
1586
1606
|
get locale() {
|
|
@@ -1601,15 +1621,17 @@ var I18n = class extends EventEmitter {
|
|
|
1601
1621
|
return (_a = this._localeData[this._locale]) != null ? _a : {};
|
|
1602
1622
|
}
|
|
1603
1623
|
_loadLocaleData(locale, localeData) {
|
|
1604
|
-
|
|
1624
|
+
const maybeLocaleData = this._localeData[locale];
|
|
1625
|
+
if (!maybeLocaleData) {
|
|
1605
1626
|
this._localeData[locale] = localeData;
|
|
1606
1627
|
} else {
|
|
1607
|
-
Object.assign(
|
|
1628
|
+
Object.assign(maybeLocaleData, localeData);
|
|
1608
1629
|
}
|
|
1609
1630
|
}
|
|
1610
1631
|
/**
|
|
1611
1632
|
* @deprecated Plurals automatically used from Intl.PluralRules you can safely remove this call. Deprecated in v4
|
|
1612
1633
|
*/
|
|
1634
|
+
// @ts-ignore deprecated, so ignore the reported error
|
|
1613
1635
|
loadLocaleData(localeOrAllData, localeData) {
|
|
1614
1636
|
if (localeData != null) {
|
|
1615
1637
|
this._loadLocaleData(localeOrAllData, localeData);
|
|
@@ -1620,19 +1642,20 @@ var I18n = class extends EventEmitter {
|
|
|
1620
1642
|
}
|
|
1621
1643
|
this.emit("change");
|
|
1622
1644
|
}
|
|
1623
|
-
_load(locale,
|
|
1624
|
-
|
|
1625
|
-
|
|
1645
|
+
_load(locale, messages43) {
|
|
1646
|
+
const maybeMessages = this._messages[locale];
|
|
1647
|
+
if (!maybeMessages) {
|
|
1648
|
+
this._messages[locale] = messages43;
|
|
1626
1649
|
} else {
|
|
1627
|
-
Object.assign(
|
|
1650
|
+
Object.assign(maybeMessages, messages43);
|
|
1628
1651
|
}
|
|
1629
1652
|
}
|
|
1630
|
-
load(localeOrMessages,
|
|
1631
|
-
if (
|
|
1632
|
-
this._load(localeOrMessages,
|
|
1653
|
+
load(localeOrMessages, messages43) {
|
|
1654
|
+
if (typeof localeOrMessages == "string" && typeof messages43 === "object") {
|
|
1655
|
+
this._load(localeOrMessages, messages43);
|
|
1633
1656
|
} else {
|
|
1634
|
-
Object.
|
|
1635
|
-
(locale) => this._load(locale,
|
|
1657
|
+
Object.entries(localeOrMessages).forEach(
|
|
1658
|
+
([locale, messages210]) => this._load(locale, messages210)
|
|
1636
1659
|
);
|
|
1637
1660
|
}
|
|
1638
1661
|
this.emit("change");
|
|
@@ -1640,10 +1663,10 @@ var I18n = class extends EventEmitter {
|
|
|
1640
1663
|
/**
|
|
1641
1664
|
* @param options {@link LoadAndActivateOptions}
|
|
1642
1665
|
*/
|
|
1643
|
-
loadAndActivate({ locale, locales, messages:
|
|
1666
|
+
loadAndActivate({ locale, locales, messages: messages43 }) {
|
|
1644
1667
|
this._locale = locale;
|
|
1645
1668
|
this._locales = locales || void 0;
|
|
1646
|
-
this._messages[this._locale] =
|
|
1669
|
+
this._messages[this._locale] = messages43;
|
|
1647
1670
|
this.emit("change");
|
|
1648
1671
|
}
|
|
1649
1672
|
activate(locale, locales) {
|
|
@@ -1656,13 +1679,15 @@ var I18n = class extends EventEmitter {
|
|
|
1656
1679
|
this._locales = locales;
|
|
1657
1680
|
this.emit("change");
|
|
1658
1681
|
}
|
|
1659
|
-
_(id, values
|
|
1682
|
+
_(id, values, options) {
|
|
1683
|
+
let message = options == null ? void 0 : options.message;
|
|
1660
1684
|
if (!isString(id)) {
|
|
1661
1685
|
values = id.values || values;
|
|
1662
1686
|
message = id.message;
|
|
1663
1687
|
id = id.id;
|
|
1664
1688
|
}
|
|
1665
|
-
const
|
|
1689
|
+
const messageForId = this.messages[id];
|
|
1690
|
+
const messageMissing = messageForId === void 0;
|
|
1666
1691
|
const missing = this._missing;
|
|
1667
1692
|
if (missing && messageMissing) {
|
|
1668
1693
|
return isFunction(missing) ? missing(this._locale, id) : missing;
|
|
@@ -1670,7 +1695,7 @@ var I18n = class extends EventEmitter {
|
|
|
1670
1695
|
if (messageMissing) {
|
|
1671
1696
|
this.emit("missing", { id, locale: this._locale });
|
|
1672
1697
|
}
|
|
1673
|
-
let translation =
|
|
1698
|
+
let translation = messageForId || message || id;
|
|
1674
1699
|
if (true) {
|
|
1675
1700
|
translation = isString(translation) ? compileMessage(translation) : translation;
|
|
1676
1701
|
}
|
|
@@ -1682,7 +1707,7 @@ var I18n = class extends EventEmitter {
|
|
|
1682
1707
|
translation,
|
|
1683
1708
|
this._locale,
|
|
1684
1709
|
this._locales
|
|
1685
|
-
)(values, formats);
|
|
1710
|
+
)(values, options == null ? void 0 : options.formats);
|
|
1686
1711
|
}
|
|
1687
1712
|
date(value, format) {
|
|
1688
1713
|
return date(this._locales || this._locale, value, format);
|
|
@@ -1696,28 +1721,69 @@ function setupI18n(params = {}) {
|
|
|
1696
1721
|
}
|
|
1697
1722
|
var i18n = setupI18n();
|
|
1698
1723
|
|
|
1699
|
-
// node_modules/.pnpm/@warp-ds+icons@
|
|
1724
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.0/node_modules/@warp-ds/icons/dist/elements/search-16.js
|
|
1700
1725
|
var messages = JSON.parse('{"icon.title.search":"Forst\xF8rrelsesglass"}');
|
|
1701
1726
|
var messages2 = JSON.parse('{"icon.title.search":"Magnifying glass"}');
|
|
1702
1727
|
var messages3 = JSON.parse('{"icon.title.search":"Suurennuslasi"}');
|
|
1703
|
-
var supportedLocales = ["en", "nb", "fi"];
|
|
1704
|
-
var
|
|
1728
|
+
var supportedLocales = ["en", "nb", "fi", "da", "sv"];
|
|
1729
|
+
var defaultLocale2 = "en";
|
|
1730
|
+
var detectByBrand = () => {
|
|
1731
|
+
let value;
|
|
1732
|
+
switch (process.env.NMP_BRAND) {
|
|
1733
|
+
case "FINN":
|
|
1734
|
+
value = "nb";
|
|
1735
|
+
break;
|
|
1736
|
+
case "TORI":
|
|
1737
|
+
value = "fi";
|
|
1738
|
+
break;
|
|
1739
|
+
case "BLOCKET":
|
|
1740
|
+
value = "sv";
|
|
1741
|
+
break;
|
|
1742
|
+
case "DBA":
|
|
1743
|
+
value = "da";
|
|
1744
|
+
break;
|
|
1745
|
+
default:
|
|
1746
|
+
value = "en";
|
|
1747
|
+
}
|
|
1748
|
+
return value;
|
|
1749
|
+
};
|
|
1750
|
+
var detectByHost = () => {
|
|
1751
|
+
var _a;
|
|
1752
|
+
const hostname = (_a = document == null ? void 0 : document.location) == null ? void 0 : _a.hostname;
|
|
1753
|
+
if (hostname.includes("finn")) {
|
|
1754
|
+
return "nb";
|
|
1755
|
+
} else if (hostname.includes("tori")) {
|
|
1756
|
+
return "fi";
|
|
1757
|
+
} else if (hostname.includes("blocket")) {
|
|
1758
|
+
return "sv";
|
|
1759
|
+
} else if (hostname.includes("dba")) {
|
|
1760
|
+
return "da";
|
|
1761
|
+
} else {
|
|
1762
|
+
return defaultLocale2;
|
|
1763
|
+
}
|
|
1764
|
+
};
|
|
1705
1765
|
var getSupportedLocale = (usedLocale) => {
|
|
1706
1766
|
return supportedLocales.find(
|
|
1707
1767
|
(locale) => usedLocale === locale || usedLocale.toLowerCase().includes(locale)
|
|
1708
|
-
) ||
|
|
1768
|
+
) || detectByHost();
|
|
1709
1769
|
};
|
|
1710
1770
|
function detectLocale() {
|
|
1771
|
+
var _a;
|
|
1711
1772
|
if (typeof window === "undefined") {
|
|
1712
|
-
const serverLocale =
|
|
1773
|
+
const serverLocale = detectByBrand();
|
|
1713
1774
|
return getSupportedLocale(serverLocale);
|
|
1714
1775
|
}
|
|
1715
1776
|
try {
|
|
1716
|
-
const htmlLocale = document.documentElement.lang;
|
|
1717
|
-
|
|
1777
|
+
const htmlLocale = (_a = document == null ? void 0 : document.documentElement) == null ? void 0 : _a.lang;
|
|
1778
|
+
const hostLocale = detectByHost();
|
|
1779
|
+
if (!supportedLocales.includes(htmlLocale)) {
|
|
1780
|
+
console.warn("Unsupported locale set in html lang tag, falling back to detection by hostname");
|
|
1781
|
+
return getSupportedLocale(hostLocale);
|
|
1782
|
+
}
|
|
1783
|
+
return getSupportedLocale(htmlLocale != null ? htmlLocale : hostLocale);
|
|
1718
1784
|
} catch (e2) {
|
|
1719
1785
|
console.warn("could not detect locale, falling back to source locale", e2);
|
|
1720
|
-
return
|
|
1786
|
+
return defaultLocale2;
|
|
1721
1787
|
}
|
|
1722
1788
|
}
|
|
1723
1789
|
var getMessages = (locale, enMsg, nbMsg, fiMsg) => {
|
|
@@ -1729,45 +1795,86 @@ var getMessages = (locale, enMsg, nbMsg, fiMsg) => {
|
|
|
1729
1795
|
};
|
|
1730
1796
|
var activateI18n = (enMessages, nbMessages, fiMessages) => {
|
|
1731
1797
|
const locale = detectLocale();
|
|
1732
|
-
const
|
|
1733
|
-
i18n.load(locale,
|
|
1798
|
+
const messages43 = getMessages(locale, enMessages, nbMessages, fiMessages);
|
|
1799
|
+
i18n.load(locale, messages43);
|
|
1734
1800
|
i18n.activate(locale);
|
|
1735
1801
|
};
|
|
1736
1802
|
activateI18n(messages2, messages, messages3);
|
|
1737
1803
|
var IconSearch16 = class extends LitElement {
|
|
1738
1804
|
render() {
|
|
1739
1805
|
const title = i18n.t({ message: `Magnifying glass`, id: "icon.title.search", comment: "Title for search icon" });
|
|
1740
|
-
return html`<svg xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="none"viewBox="0 0 16 16" part="w-icon-search-16-part">${unsafeStatic(`<title>${title}</title>`)}<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
|
|
1806
|
+
return html`<svg xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="none"viewBox="0 0 16 16" part="w-icon-search-16-part">${unsafeStatic(`<title>${title}</title>`)}<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M8.905 12.102A6.042 6.042 0 1 0 4.18.981a6.042 6.042 0 0 0 4.726 11.121Zm1.909-1.289L15.5 15.5"></path></svg>`;
|
|
1741
1807
|
}
|
|
1742
1808
|
};
|
|
1743
1809
|
if (!customElements.get("w-icon-search-16")) {
|
|
1744
1810
|
customElements.define("w-icon-search-16", IconSearch16);
|
|
1745
1811
|
}
|
|
1746
1812
|
|
|
1747
|
-
// node_modules/.pnpm/@warp-ds+icons@
|
|
1813
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.0/node_modules/@warp-ds/icons/dist/elements/close-16.js
|
|
1748
1814
|
import { LitElement as LitElement2 } from "lit";
|
|
1749
1815
|
import { unsafeStatic as unsafeStatic2, html as html2 } from "lit/static-html.js";
|
|
1750
1816
|
var messages4 = JSON.parse('{"icon.title.close":"Kryss"}');
|
|
1751
1817
|
var messages22 = JSON.parse('{"icon.title.close":"Cross"}');
|
|
1752
1818
|
var messages32 = JSON.parse('{"icon.title.close":"Rasti"}');
|
|
1753
|
-
var supportedLocales2 = ["en", "nb", "fi"];
|
|
1754
|
-
var
|
|
1819
|
+
var supportedLocales2 = ["en", "nb", "fi", "da", "sv"];
|
|
1820
|
+
var defaultLocale3 = "en";
|
|
1821
|
+
var detectByBrand2 = () => {
|
|
1822
|
+
let value;
|
|
1823
|
+
switch (process.env.NMP_BRAND) {
|
|
1824
|
+
case "FINN":
|
|
1825
|
+
value = "nb";
|
|
1826
|
+
break;
|
|
1827
|
+
case "TORI":
|
|
1828
|
+
value = "fi";
|
|
1829
|
+
break;
|
|
1830
|
+
case "BLOCKET":
|
|
1831
|
+
value = "sv";
|
|
1832
|
+
break;
|
|
1833
|
+
case "DBA":
|
|
1834
|
+
value = "da";
|
|
1835
|
+
break;
|
|
1836
|
+
default:
|
|
1837
|
+
value = "en";
|
|
1838
|
+
}
|
|
1839
|
+
return value;
|
|
1840
|
+
};
|
|
1841
|
+
var detectByHost2 = () => {
|
|
1842
|
+
var _a;
|
|
1843
|
+
const hostname = (_a = document == null ? void 0 : document.location) == null ? void 0 : _a.hostname;
|
|
1844
|
+
if (hostname.includes("finn")) {
|
|
1845
|
+
return "nb";
|
|
1846
|
+
} else if (hostname.includes("tori")) {
|
|
1847
|
+
return "fi";
|
|
1848
|
+
} else if (hostname.includes("blocket")) {
|
|
1849
|
+
return "sv";
|
|
1850
|
+
} else if (hostname.includes("dba")) {
|
|
1851
|
+
return "da";
|
|
1852
|
+
} else {
|
|
1853
|
+
return defaultLocale3;
|
|
1854
|
+
}
|
|
1855
|
+
};
|
|
1755
1856
|
var getSupportedLocale2 = (usedLocale) => {
|
|
1756
1857
|
return supportedLocales2.find(
|
|
1757
1858
|
(locale) => usedLocale === locale || usedLocale.toLowerCase().includes(locale)
|
|
1758
|
-
) ||
|
|
1859
|
+
) || detectByHost2();
|
|
1759
1860
|
};
|
|
1760
1861
|
function detectLocale2() {
|
|
1862
|
+
var _a;
|
|
1761
1863
|
if (typeof window === "undefined") {
|
|
1762
|
-
const serverLocale =
|
|
1864
|
+
const serverLocale = detectByBrand2();
|
|
1763
1865
|
return getSupportedLocale2(serverLocale);
|
|
1764
1866
|
}
|
|
1765
1867
|
try {
|
|
1766
|
-
const htmlLocale = document.documentElement.lang;
|
|
1767
|
-
|
|
1868
|
+
const htmlLocale = (_a = document == null ? void 0 : document.documentElement) == null ? void 0 : _a.lang;
|
|
1869
|
+
const hostLocale = detectByHost2();
|
|
1870
|
+
if (!supportedLocales2.includes(htmlLocale)) {
|
|
1871
|
+
console.warn("Unsupported locale set in html lang tag, falling back to detection by hostname");
|
|
1872
|
+
return getSupportedLocale2(hostLocale);
|
|
1873
|
+
}
|
|
1874
|
+
return getSupportedLocale2(htmlLocale != null ? htmlLocale : hostLocale);
|
|
1768
1875
|
} catch (e2) {
|
|
1769
1876
|
console.warn("could not detect locale, falling back to source locale", e2);
|
|
1770
|
-
return
|
|
1877
|
+
return defaultLocale3;
|
|
1771
1878
|
}
|
|
1772
1879
|
}
|
|
1773
1880
|
var getMessages2 = (locale, enMsg, nbMsg, fiMsg) => {
|
|
@@ -1779,15 +1886,15 @@ var getMessages2 = (locale, enMsg, nbMsg, fiMsg) => {
|
|
|
1779
1886
|
};
|
|
1780
1887
|
var activateI18n2 = (enMessages, nbMessages, fiMessages) => {
|
|
1781
1888
|
const locale = detectLocale2();
|
|
1782
|
-
const
|
|
1783
|
-
i18n.load(locale,
|
|
1889
|
+
const messages43 = getMessages2(locale, enMessages, nbMessages, fiMessages);
|
|
1890
|
+
i18n.load(locale, messages43);
|
|
1784
1891
|
i18n.activate(locale);
|
|
1785
1892
|
};
|
|
1786
1893
|
activateI18n2(messages22, messages4, messages32);
|
|
1787
1894
|
var IconClose16 = class extends LitElement2 {
|
|
1788
1895
|
render() {
|
|
1789
1896
|
const title = i18n.t({ message: `Cross`, id: "icon.title.close", comment: "Title for close icon" });
|
|
1790
|
-
return html2`<svg xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="none"viewBox="0 0 16 16" part="w-icon-close-16-part">${unsafeStatic2(`<title>${title}</title>`)}<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m12.5 3.5-9
|
|
1897
|
+
return html2`<svg xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="none"viewBox="0 0 16 16" part="w-icon-close-16-part">${unsafeStatic2(`<title>${title}</title>`)}<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m12.5 3.5-9 9m0-9 9 9"></path></svg>`;
|
|
1791
1898
|
}
|
|
1792
1899
|
};
|
|
1793
1900
|
if (!customElements.get("w-icon-close-16")) {
|
|
@@ -1903,30 +2010,71 @@ var r = function() {
|
|
|
1903
2010
|
}, []).join(" ");
|
|
1904
2011
|
};
|
|
1905
2012
|
|
|
1906
|
-
// node_modules/.pnpm/@warp-ds+icons@
|
|
2013
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.0/node_modules/@warp-ds/icons/dist/elements/info-16.js
|
|
1907
2014
|
import { LitElement as LitElement3 } from "lit";
|
|
1908
2015
|
import { unsafeStatic as unsafeStatic3, html as html4 } from "lit/static-html.js";
|
|
1909
|
-
var messages5 = JSON.parse('{"icon.title.
|
|
1910
|
-
var messages23 = JSON.parse('{"icon.title.
|
|
1911
|
-
var messages33 = JSON.parse('{"icon.title.
|
|
1912
|
-
var supportedLocales3 = ["en", "nb", "fi"];
|
|
1913
|
-
var
|
|
2016
|
+
var messages5 = JSON.parse('{"icon.title.info":"Informasjonssirkel"}');
|
|
2017
|
+
var messages23 = JSON.parse('{"icon.title.info":"Information circle"}');
|
|
2018
|
+
var messages33 = JSON.parse('{"icon.title.info":"Ympyr\xE4, jonka sis\xE4ll\xE4 on i-kirjain"}');
|
|
2019
|
+
var supportedLocales3 = ["en", "nb", "fi", "da", "sv"];
|
|
2020
|
+
var defaultLocale4 = "en";
|
|
2021
|
+
var detectByBrand3 = () => {
|
|
2022
|
+
let value;
|
|
2023
|
+
switch (process.env.NMP_BRAND) {
|
|
2024
|
+
case "FINN":
|
|
2025
|
+
value = "nb";
|
|
2026
|
+
break;
|
|
2027
|
+
case "TORI":
|
|
2028
|
+
value = "fi";
|
|
2029
|
+
break;
|
|
2030
|
+
case "BLOCKET":
|
|
2031
|
+
value = "sv";
|
|
2032
|
+
break;
|
|
2033
|
+
case "DBA":
|
|
2034
|
+
value = "da";
|
|
2035
|
+
break;
|
|
2036
|
+
default:
|
|
2037
|
+
value = "en";
|
|
2038
|
+
}
|
|
2039
|
+
return value;
|
|
2040
|
+
};
|
|
2041
|
+
var detectByHost3 = () => {
|
|
2042
|
+
var _a;
|
|
2043
|
+
const hostname = (_a = document == null ? void 0 : document.location) == null ? void 0 : _a.hostname;
|
|
2044
|
+
if (hostname.includes("finn")) {
|
|
2045
|
+
return "nb";
|
|
2046
|
+
} else if (hostname.includes("tori")) {
|
|
2047
|
+
return "fi";
|
|
2048
|
+
} else if (hostname.includes("blocket")) {
|
|
2049
|
+
return "sv";
|
|
2050
|
+
} else if (hostname.includes("dba")) {
|
|
2051
|
+
return "da";
|
|
2052
|
+
} else {
|
|
2053
|
+
return defaultLocale4;
|
|
2054
|
+
}
|
|
2055
|
+
};
|
|
1914
2056
|
var getSupportedLocale3 = (usedLocale) => {
|
|
1915
2057
|
return supportedLocales3.find(
|
|
1916
2058
|
(locale) => usedLocale === locale || usedLocale.toLowerCase().includes(locale)
|
|
1917
|
-
) ||
|
|
2059
|
+
) || detectByHost3();
|
|
1918
2060
|
};
|
|
1919
2061
|
function detectLocale3() {
|
|
2062
|
+
var _a;
|
|
1920
2063
|
if (typeof window === "undefined") {
|
|
1921
|
-
const serverLocale =
|
|
2064
|
+
const serverLocale = detectByBrand3();
|
|
1922
2065
|
return getSupportedLocale3(serverLocale);
|
|
1923
2066
|
}
|
|
1924
2067
|
try {
|
|
1925
|
-
const htmlLocale = document.documentElement.lang;
|
|
1926
|
-
|
|
2068
|
+
const htmlLocale = (_a = document == null ? void 0 : document.documentElement) == null ? void 0 : _a.lang;
|
|
2069
|
+
const hostLocale = detectByHost3();
|
|
2070
|
+
if (!supportedLocales3.includes(htmlLocale)) {
|
|
2071
|
+
console.warn("Unsupported locale set in html lang tag, falling back to detection by hostname");
|
|
2072
|
+
return getSupportedLocale3(hostLocale);
|
|
2073
|
+
}
|
|
2074
|
+
return getSupportedLocale3(htmlLocale != null ? htmlLocale : hostLocale);
|
|
1927
2075
|
} catch (e2) {
|
|
1928
2076
|
console.warn("could not detect locale, falling back to source locale", e2);
|
|
1929
|
-
return
|
|
2077
|
+
return defaultLocale4;
|
|
1930
2078
|
}
|
|
1931
2079
|
}
|
|
1932
2080
|
var getMessages3 = (locale, enMsg, nbMsg, fiMsg) => {
|
|
@@ -1938,45 +2086,86 @@ var getMessages3 = (locale, enMsg, nbMsg, fiMsg) => {
|
|
|
1938
2086
|
};
|
|
1939
2087
|
var activateI18n3 = (enMessages, nbMessages, fiMessages) => {
|
|
1940
2088
|
const locale = detectLocale3();
|
|
1941
|
-
const
|
|
1942
|
-
i18n.load(locale,
|
|
2089
|
+
const messages43 = getMessages3(locale, enMessages, nbMessages, fiMessages);
|
|
2090
|
+
i18n.load(locale, messages43);
|
|
1943
2091
|
i18n.activate(locale);
|
|
1944
2092
|
};
|
|
1945
2093
|
activateI18n3(messages23, messages5, messages33);
|
|
1946
|
-
var
|
|
2094
|
+
var IconInfo16 = class extends LitElement3 {
|
|
1947
2095
|
render() {
|
|
1948
|
-
const title = i18n.t({ message: `
|
|
1949
|
-
return html4`<svg xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="none"viewBox="0 0 16 16" part="w-icon-
|
|
2096
|
+
const title = i18n.t({ message: `Information circle`, id: "icon.title.info", comment: "Title for info icon" });
|
|
2097
|
+
return html4`<svg xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="none"viewBox="0 0 16 16" part="w-icon-info-16-part">${unsafeStatic3(`<title>${title}</title>`)}<path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" d="M8 6.5v5"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M8 4v.5"></path><path stroke="currentColor" stroke-miterlimit="10" d="M8 .5a7.5 7.5 0 1 1 0 15 7.5 7.5 0 0 1 0-15Z"></path></svg>`;
|
|
1950
2098
|
}
|
|
1951
2099
|
};
|
|
1952
|
-
if (!customElements.get("w-icon-
|
|
1953
|
-
customElements.define("w-icon-
|
|
2100
|
+
if (!customElements.get("w-icon-info-16")) {
|
|
2101
|
+
customElements.define("w-icon-info-16", IconInfo16);
|
|
1954
2102
|
}
|
|
1955
2103
|
|
|
1956
|
-
// node_modules/.pnpm/@warp-ds+icons@
|
|
2104
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.0/node_modules/@warp-ds/icons/dist/elements/warning-16.js
|
|
1957
2105
|
import { LitElement as LitElement4 } from "lit";
|
|
1958
2106
|
import { unsafeStatic as unsafeStatic4, html as html5 } from "lit/static-html.js";
|
|
1959
|
-
var messages6 = JSON.parse('{"icon.title.
|
|
1960
|
-
var messages24 = JSON.parse('{"icon.title.
|
|
1961
|
-
var messages34 = JSON.parse('{"icon.title.
|
|
1962
|
-
var supportedLocales4 = ["en", "nb", "fi"];
|
|
1963
|
-
var
|
|
2107
|
+
var messages6 = JSON.parse('{"icon.title.warning":"Varseltrekant med utropstegn"}');
|
|
2108
|
+
var messages24 = JSON.parse('{"icon.title.warning":"Warning triangle with exclamation point"}');
|
|
2109
|
+
var messages34 = JSON.parse('{"icon.title.warning":"Varoituskolmio, jonka sis\xE4ll\xE4 on huutomerkki"}');
|
|
2110
|
+
var supportedLocales4 = ["en", "nb", "fi", "da", "sv"];
|
|
2111
|
+
var defaultLocale5 = "en";
|
|
2112
|
+
var detectByBrand4 = () => {
|
|
2113
|
+
let value;
|
|
2114
|
+
switch (process.env.NMP_BRAND) {
|
|
2115
|
+
case "FINN":
|
|
2116
|
+
value = "nb";
|
|
2117
|
+
break;
|
|
2118
|
+
case "TORI":
|
|
2119
|
+
value = "fi";
|
|
2120
|
+
break;
|
|
2121
|
+
case "BLOCKET":
|
|
2122
|
+
value = "sv";
|
|
2123
|
+
break;
|
|
2124
|
+
case "DBA":
|
|
2125
|
+
value = "da";
|
|
2126
|
+
break;
|
|
2127
|
+
default:
|
|
2128
|
+
value = "en";
|
|
2129
|
+
}
|
|
2130
|
+
return value;
|
|
2131
|
+
};
|
|
2132
|
+
var detectByHost4 = () => {
|
|
2133
|
+
var _a;
|
|
2134
|
+
const hostname = (_a = document == null ? void 0 : document.location) == null ? void 0 : _a.hostname;
|
|
2135
|
+
if (hostname.includes("finn")) {
|
|
2136
|
+
return "nb";
|
|
2137
|
+
} else if (hostname.includes("tori")) {
|
|
2138
|
+
return "fi";
|
|
2139
|
+
} else if (hostname.includes("blocket")) {
|
|
2140
|
+
return "sv";
|
|
2141
|
+
} else if (hostname.includes("dba")) {
|
|
2142
|
+
return "da";
|
|
2143
|
+
} else {
|
|
2144
|
+
return defaultLocale5;
|
|
2145
|
+
}
|
|
2146
|
+
};
|
|
1964
2147
|
var getSupportedLocale4 = (usedLocale) => {
|
|
1965
2148
|
return supportedLocales4.find(
|
|
1966
2149
|
(locale) => usedLocale === locale || usedLocale.toLowerCase().includes(locale)
|
|
1967
|
-
) ||
|
|
2150
|
+
) || detectByHost4();
|
|
1968
2151
|
};
|
|
1969
2152
|
function detectLocale4() {
|
|
2153
|
+
var _a;
|
|
1970
2154
|
if (typeof window === "undefined") {
|
|
1971
|
-
const serverLocale =
|
|
2155
|
+
const serverLocale = detectByBrand4();
|
|
1972
2156
|
return getSupportedLocale4(serverLocale);
|
|
1973
2157
|
}
|
|
1974
2158
|
try {
|
|
1975
|
-
const htmlLocale = document.documentElement.lang;
|
|
1976
|
-
|
|
2159
|
+
const htmlLocale = (_a = document == null ? void 0 : document.documentElement) == null ? void 0 : _a.lang;
|
|
2160
|
+
const hostLocale = detectByHost4();
|
|
2161
|
+
if (!supportedLocales4.includes(htmlLocale)) {
|
|
2162
|
+
console.warn("Unsupported locale set in html lang tag, falling back to detection by hostname");
|
|
2163
|
+
return getSupportedLocale4(hostLocale);
|
|
2164
|
+
}
|
|
2165
|
+
return getSupportedLocale4(htmlLocale != null ? htmlLocale : hostLocale);
|
|
1977
2166
|
} catch (e2) {
|
|
1978
2167
|
console.warn("could not detect locale, falling back to source locale", e2);
|
|
1979
|
-
return
|
|
2168
|
+
return defaultLocale5;
|
|
1980
2169
|
}
|
|
1981
2170
|
}
|
|
1982
2171
|
var getMessages4 = (locale, enMsg, nbMsg, fiMsg) => {
|
|
@@ -1988,45 +2177,86 @@ var getMessages4 = (locale, enMsg, nbMsg, fiMsg) => {
|
|
|
1988
2177
|
};
|
|
1989
2178
|
var activateI18n4 = (enMessages, nbMessages, fiMessages) => {
|
|
1990
2179
|
const locale = detectLocale4();
|
|
1991
|
-
const
|
|
1992
|
-
i18n.load(locale,
|
|
2180
|
+
const messages43 = getMessages4(locale, enMessages, nbMessages, fiMessages);
|
|
2181
|
+
i18n.load(locale, messages43);
|
|
1993
2182
|
i18n.activate(locale);
|
|
1994
2183
|
};
|
|
1995
2184
|
activateI18n4(messages24, messages6, messages34);
|
|
1996
|
-
var
|
|
2185
|
+
var IconWarning16 = class extends LitElement4 {
|
|
1997
2186
|
render() {
|
|
1998
|
-
const title = i18n.t({ message: `
|
|
1999
|
-
return html5`<svg xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="none"viewBox="0 0 16 16" part="w-icon-
|
|
2187
|
+
const title = i18n.t({ message: `Warning triangle with exclamation point`, id: "icon.title.warning", comment: "Title for warning icon" });
|
|
2188
|
+
return html5`<svg xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="none"viewBox="0 0 16 16" part="w-icon-warning-16-part">${unsafeStatic4(`<title>${title}</title>`)}<path stroke="currentColor" d="m.712 14.07 6.25-12.994a1 1 0 0 1 1.792-.022l6.635 12.995a1 1 0 0 1-.89 1.455H1.613a1 1 0 0 1-.902-1.434Z"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M8 6v4.992M8 13v.333"></path></svg>`;
|
|
2000
2189
|
}
|
|
2001
2190
|
};
|
|
2002
|
-
if (!customElements.get("w-icon-
|
|
2003
|
-
customElements.define("w-icon-
|
|
2191
|
+
if (!customElements.get("w-icon-warning-16")) {
|
|
2192
|
+
customElements.define("w-icon-warning-16", IconWarning16);
|
|
2004
2193
|
}
|
|
2005
2194
|
|
|
2006
|
-
// node_modules/.pnpm/@warp-ds+icons@
|
|
2195
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.0/node_modules/@warp-ds/icons/dist/elements/error-16.js
|
|
2007
2196
|
import { LitElement as LitElement5 } from "lit";
|
|
2008
2197
|
import { unsafeStatic as unsafeStatic5, html as html6 } from "lit/static-html.js";
|
|
2009
|
-
var messages7 = JSON.parse('{"icon.title.
|
|
2010
|
-
var messages25 = JSON.parse('{"icon.title.
|
|
2011
|
-
var messages35 = JSON.parse('{"icon.title.
|
|
2012
|
-
var supportedLocales5 = ["en", "nb", "fi"];
|
|
2013
|
-
var
|
|
2198
|
+
var messages7 = JSON.parse('{"icon.title.error":"\xC5ttekant med utropstegn"}');
|
|
2199
|
+
var messages25 = JSON.parse('{"icon.title.error":"Octagon with exclamation point"}');
|
|
2200
|
+
var messages35 = JSON.parse('{"icon.title.error":"Kahdeksankulmio, jonka sis\xE4ll\xE4 on huutomerkki"}');
|
|
2201
|
+
var supportedLocales5 = ["en", "nb", "fi", "da", "sv"];
|
|
2202
|
+
var defaultLocale6 = "en";
|
|
2203
|
+
var detectByBrand5 = () => {
|
|
2204
|
+
let value;
|
|
2205
|
+
switch (process.env.NMP_BRAND) {
|
|
2206
|
+
case "FINN":
|
|
2207
|
+
value = "nb";
|
|
2208
|
+
break;
|
|
2209
|
+
case "TORI":
|
|
2210
|
+
value = "fi";
|
|
2211
|
+
break;
|
|
2212
|
+
case "BLOCKET":
|
|
2213
|
+
value = "sv";
|
|
2214
|
+
break;
|
|
2215
|
+
case "DBA":
|
|
2216
|
+
value = "da";
|
|
2217
|
+
break;
|
|
2218
|
+
default:
|
|
2219
|
+
value = "en";
|
|
2220
|
+
}
|
|
2221
|
+
return value;
|
|
2222
|
+
};
|
|
2223
|
+
var detectByHost5 = () => {
|
|
2224
|
+
var _a;
|
|
2225
|
+
const hostname = (_a = document == null ? void 0 : document.location) == null ? void 0 : _a.hostname;
|
|
2226
|
+
if (hostname.includes("finn")) {
|
|
2227
|
+
return "nb";
|
|
2228
|
+
} else if (hostname.includes("tori")) {
|
|
2229
|
+
return "fi";
|
|
2230
|
+
} else if (hostname.includes("blocket")) {
|
|
2231
|
+
return "sv";
|
|
2232
|
+
} else if (hostname.includes("dba")) {
|
|
2233
|
+
return "da";
|
|
2234
|
+
} else {
|
|
2235
|
+
return defaultLocale6;
|
|
2236
|
+
}
|
|
2237
|
+
};
|
|
2014
2238
|
var getSupportedLocale5 = (usedLocale) => {
|
|
2015
2239
|
return supportedLocales5.find(
|
|
2016
2240
|
(locale) => usedLocale === locale || usedLocale.toLowerCase().includes(locale)
|
|
2017
|
-
) ||
|
|
2241
|
+
) || detectByHost5();
|
|
2018
2242
|
};
|
|
2019
2243
|
function detectLocale5() {
|
|
2244
|
+
var _a;
|
|
2020
2245
|
if (typeof window === "undefined") {
|
|
2021
|
-
const serverLocale =
|
|
2246
|
+
const serverLocale = detectByBrand5();
|
|
2022
2247
|
return getSupportedLocale5(serverLocale);
|
|
2023
2248
|
}
|
|
2024
2249
|
try {
|
|
2025
|
-
const htmlLocale = document.documentElement.lang;
|
|
2026
|
-
|
|
2250
|
+
const htmlLocale = (_a = document == null ? void 0 : document.documentElement) == null ? void 0 : _a.lang;
|
|
2251
|
+
const hostLocale = detectByHost5();
|
|
2252
|
+
if (!supportedLocales5.includes(htmlLocale)) {
|
|
2253
|
+
console.warn("Unsupported locale set in html lang tag, falling back to detection by hostname");
|
|
2254
|
+
return getSupportedLocale5(hostLocale);
|
|
2255
|
+
}
|
|
2256
|
+
return getSupportedLocale5(htmlLocale != null ? htmlLocale : hostLocale);
|
|
2027
2257
|
} catch (e2) {
|
|
2028
2258
|
console.warn("could not detect locale, falling back to source locale", e2);
|
|
2029
|
-
return
|
|
2259
|
+
return defaultLocale6;
|
|
2030
2260
|
}
|
|
2031
2261
|
}
|
|
2032
2262
|
var getMessages5 = (locale, enMsg, nbMsg, fiMsg) => {
|
|
@@ -2038,45 +2268,86 @@ var getMessages5 = (locale, enMsg, nbMsg, fiMsg) => {
|
|
|
2038
2268
|
};
|
|
2039
2269
|
var activateI18n5 = (enMessages, nbMessages, fiMessages) => {
|
|
2040
2270
|
const locale = detectLocale5();
|
|
2041
|
-
const
|
|
2042
|
-
i18n.load(locale,
|
|
2271
|
+
const messages43 = getMessages5(locale, enMessages, nbMessages, fiMessages);
|
|
2272
|
+
i18n.load(locale, messages43);
|
|
2043
2273
|
i18n.activate(locale);
|
|
2044
2274
|
};
|
|
2045
2275
|
activateI18n5(messages25, messages7, messages35);
|
|
2046
|
-
var
|
|
2276
|
+
var IconError16 = class extends LitElement5 {
|
|
2047
2277
|
render() {
|
|
2048
|
-
const title = i18n.t({ message: `
|
|
2049
|
-
return html6`<svg xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="none"viewBox="0 0 16 16" part="w-icon-
|
|
2278
|
+
const title = i18n.t({ message: `Octagon with exclamation point`, id: "icon.title.error", comment: "Title for error icon" });
|
|
2279
|
+
return html6`<svg xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="none"viewBox="0 0 16 16" part="w-icon-error-16-part">${unsafeStatic5(`<title>${title}</title>`)}<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M.5 11.107 4.748 15.5h6.503l4.248-4.393V4.893L11.252.5H4.748L.5 4.893z"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M8 11.398a.25.25 0 1 1 0-.5m0 .5a.25.25 0 1 0 0-.5"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M8 8.5V3"></path></svg>`;
|
|
2050
2280
|
}
|
|
2051
2281
|
};
|
|
2052
|
-
if (!customElements.get("w-icon-
|
|
2053
|
-
customElements.define("w-icon-
|
|
2282
|
+
if (!customElements.get("w-icon-error-16")) {
|
|
2283
|
+
customElements.define("w-icon-error-16", IconError16);
|
|
2054
2284
|
}
|
|
2055
2285
|
|
|
2056
|
-
// node_modules/.pnpm/@warp-ds+icons@
|
|
2286
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.0/node_modules/@warp-ds/icons/dist/elements/success-16.js
|
|
2057
2287
|
import { LitElement as LitElement6 } from "lit";
|
|
2058
2288
|
import { unsafeStatic as unsafeStatic6, html as html7 } from "lit/static-html.js";
|
|
2059
|
-
var messages8 = JSON.parse('{"icon.title.
|
|
2060
|
-
var messages26 = JSON.parse('{"icon.title.
|
|
2061
|
-
var messages36 = JSON.parse('{"icon.title.
|
|
2062
|
-
var supportedLocales6 = ["en", "nb", "fi"];
|
|
2063
|
-
var
|
|
2289
|
+
var messages8 = JSON.parse('{"icon.title.success":"Sirkel med sjekkmerke"}');
|
|
2290
|
+
var messages26 = JSON.parse('{"icon.title.success":"Circle with checkmark"}');
|
|
2291
|
+
var messages36 = JSON.parse('{"icon.title.success":"Ympyr\xE4, jonka sis\xE4ll\xE4 on valintamerkki"}');
|
|
2292
|
+
var supportedLocales6 = ["en", "nb", "fi", "da", "sv"];
|
|
2293
|
+
var defaultLocale7 = "en";
|
|
2294
|
+
var detectByBrand6 = () => {
|
|
2295
|
+
let value;
|
|
2296
|
+
switch (process.env.NMP_BRAND) {
|
|
2297
|
+
case "FINN":
|
|
2298
|
+
value = "nb";
|
|
2299
|
+
break;
|
|
2300
|
+
case "TORI":
|
|
2301
|
+
value = "fi";
|
|
2302
|
+
break;
|
|
2303
|
+
case "BLOCKET":
|
|
2304
|
+
value = "sv";
|
|
2305
|
+
break;
|
|
2306
|
+
case "DBA":
|
|
2307
|
+
value = "da";
|
|
2308
|
+
break;
|
|
2309
|
+
default:
|
|
2310
|
+
value = "en";
|
|
2311
|
+
}
|
|
2312
|
+
return value;
|
|
2313
|
+
};
|
|
2314
|
+
var detectByHost6 = () => {
|
|
2315
|
+
var _a;
|
|
2316
|
+
const hostname = (_a = document == null ? void 0 : document.location) == null ? void 0 : _a.hostname;
|
|
2317
|
+
if (hostname.includes("finn")) {
|
|
2318
|
+
return "nb";
|
|
2319
|
+
} else if (hostname.includes("tori")) {
|
|
2320
|
+
return "fi";
|
|
2321
|
+
} else if (hostname.includes("blocket")) {
|
|
2322
|
+
return "sv";
|
|
2323
|
+
} else if (hostname.includes("dba")) {
|
|
2324
|
+
return "da";
|
|
2325
|
+
} else {
|
|
2326
|
+
return defaultLocale7;
|
|
2327
|
+
}
|
|
2328
|
+
};
|
|
2064
2329
|
var getSupportedLocale6 = (usedLocale) => {
|
|
2065
2330
|
return supportedLocales6.find(
|
|
2066
2331
|
(locale) => usedLocale === locale || usedLocale.toLowerCase().includes(locale)
|
|
2067
|
-
) ||
|
|
2332
|
+
) || detectByHost6();
|
|
2068
2333
|
};
|
|
2069
2334
|
function detectLocale6() {
|
|
2335
|
+
var _a;
|
|
2070
2336
|
if (typeof window === "undefined") {
|
|
2071
|
-
const serverLocale =
|
|
2337
|
+
const serverLocale = detectByBrand6();
|
|
2072
2338
|
return getSupportedLocale6(serverLocale);
|
|
2073
2339
|
}
|
|
2074
2340
|
try {
|
|
2075
|
-
const htmlLocale = document.documentElement.lang;
|
|
2076
|
-
|
|
2341
|
+
const htmlLocale = (_a = document == null ? void 0 : document.documentElement) == null ? void 0 : _a.lang;
|
|
2342
|
+
const hostLocale = detectByHost6();
|
|
2343
|
+
if (!supportedLocales6.includes(htmlLocale)) {
|
|
2344
|
+
console.warn("Unsupported locale set in html lang tag, falling back to detection by hostname");
|
|
2345
|
+
return getSupportedLocale6(hostLocale);
|
|
2346
|
+
}
|
|
2347
|
+
return getSupportedLocale6(htmlLocale != null ? htmlLocale : hostLocale);
|
|
2077
2348
|
} catch (e2) {
|
|
2078
2349
|
console.warn("could not detect locale, falling back to source locale", e2);
|
|
2079
|
-
return
|
|
2350
|
+
return defaultLocale7;
|
|
2080
2351
|
}
|
|
2081
2352
|
}
|
|
2082
2353
|
var getMessages6 = (locale, enMsg, nbMsg, fiMsg) => {
|
|
@@ -2088,19 +2359,19 @@ var getMessages6 = (locale, enMsg, nbMsg, fiMsg) => {
|
|
|
2088
2359
|
};
|
|
2089
2360
|
var activateI18n6 = (enMessages, nbMessages, fiMessages) => {
|
|
2090
2361
|
const locale = detectLocale6();
|
|
2091
|
-
const
|
|
2092
|
-
i18n.load(locale,
|
|
2362
|
+
const messages43 = getMessages6(locale, enMessages, nbMessages, fiMessages);
|
|
2363
|
+
i18n.load(locale, messages43);
|
|
2093
2364
|
i18n.activate(locale);
|
|
2094
2365
|
};
|
|
2095
2366
|
activateI18n6(messages26, messages8, messages36);
|
|
2096
|
-
var
|
|
2367
|
+
var IconSuccess16 = class extends LitElement6 {
|
|
2097
2368
|
render() {
|
|
2098
|
-
const title = i18n.t({ message: `
|
|
2099
|
-
return html7`<svg xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="none"viewBox="0 0 16 16" part="w-icon-
|
|
2369
|
+
const title = i18n.t({ message: `Circle with checkmark`, id: "icon.title.success", comment: "Title for success icon" });
|
|
2370
|
+
return html7`<svg xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="none"viewBox="0 0 16 16" part="w-icon-success-16-part">${unsafeStatic6(`<title>${title}</title>`)}<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="m4 8.815 1.633 2.318a.7.7 0 0 0 1.138.034l5.228-6.615"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M.5 7.999a7.5 7.5 0 1 0 15 0 7.5 7.5 0 0 0-15 0"></path></svg>`;
|
|
2100
2371
|
}
|
|
2101
2372
|
};
|
|
2102
|
-
if (!customElements.get("w-icon-
|
|
2103
|
-
customElements.define("w-icon-
|
|
2373
|
+
if (!customElements.get("w-icon-success-16")) {
|
|
2374
|
+
customElements.define("w-icon-success-16", IconSuccess16);
|
|
2104
2375
|
}
|
|
2105
2376
|
|
|
2106
2377
|
// packages/alert/index.js
|
|
@@ -2139,13 +2410,13 @@ var WarpAlert = class extends WarpElement2 {
|
|
|
2139
2410
|
}
|
|
2140
2411
|
get _icon() {
|
|
2141
2412
|
if (this.variant === variants.info)
|
|
2142
|
-
return html8`<w-icon-
|
|
2413
|
+
return html8`<w-icon-info-16></w-icon-info-16>`;
|
|
2143
2414
|
if (this.variant === variants.warning)
|
|
2144
|
-
return html8`<w-icon-
|
|
2415
|
+
return html8`<w-icon-warning-16></w-icon-warning-16>`;
|
|
2145
2416
|
if (this.variant === variants.negative)
|
|
2146
|
-
return html8`<w-icon-
|
|
2417
|
+
return html8`<w-icon-error-16></w-icon-error-16>`;
|
|
2147
2418
|
if (this.variant === variants.positive)
|
|
2148
|
-
return html8`<w-icon-
|
|
2419
|
+
return html8`<w-icon-success-16></w-icon-success-16>`;
|
|
2149
2420
|
else
|
|
2150
2421
|
return "";
|
|
2151
2422
|
}
|
|
@@ -2542,7 +2813,7 @@ var D2 = { getClippingRect: function(t2) {
|
|
|
2542
2813
|
}, getClientRects: (t2) => Array.from(t2.getClientRects()), isRTL: (t2) => "rtl" === i2(t2).direction };
|
|
2543
2814
|
var z = (t2, n3, o3) => o(t2, n3, __spreadValues({ platform: D2 }, o3));
|
|
2544
2815
|
|
|
2545
|
-
// node_modules/.pnpm/@warp-ds+core@1.0.
|
|
2816
|
+
// node_modules/.pnpm/@warp-ds+core@1.0.2/node_modules/@warp-ds/core/dist/attention/utils/helpers.js
|
|
2546
2817
|
var TOP = "top";
|
|
2547
2818
|
var BOTTOM = "bottom";
|
|
2548
2819
|
var LEFT = "left";
|
|
@@ -2618,11 +2889,11 @@ var messages11 = JSON.parse('{"attention.aria.callout":"callout speech bubble","
|
|
|
2618
2889
|
|
|
2619
2890
|
// packages/i18n.ts
|
|
2620
2891
|
var supportedLocales7 = ["en", "nb", "fi"];
|
|
2621
|
-
var
|
|
2892
|
+
var defaultLocale8 = "en";
|
|
2622
2893
|
var getSupportedLocale7 = (usedLocale) => {
|
|
2623
2894
|
return supportedLocales7.find(
|
|
2624
2895
|
(locale) => usedLocale === locale || usedLocale.toLowerCase().includes(locale)
|
|
2625
|
-
) ||
|
|
2896
|
+
) || defaultLocale8;
|
|
2626
2897
|
};
|
|
2627
2898
|
function detectLocale7() {
|
|
2628
2899
|
if (typeof window === "undefined") {
|
|
@@ -2634,7 +2905,7 @@ function detectLocale7() {
|
|
|
2634
2905
|
return getSupportedLocale7(htmlLocale);
|
|
2635
2906
|
} catch (e2) {
|
|
2636
2907
|
console.warn("could not detect locale, falling back to source locale", e2);
|
|
2637
|
-
return
|
|
2908
|
+
return defaultLocale8;
|
|
2638
2909
|
}
|
|
2639
2910
|
}
|
|
2640
2911
|
var getMessages7 = (locale, enMsg, nbMsg, fiMsg) => {
|
|
@@ -2646,8 +2917,8 @@ var getMessages7 = (locale, enMsg, nbMsg, fiMsg) => {
|
|
|
2646
2917
|
};
|
|
2647
2918
|
var activateI18n7 = (enMessages, nbMessages, fiMessages) => {
|
|
2648
2919
|
const locale = detectLocale7();
|
|
2649
|
-
const
|
|
2650
|
-
i18n.load(locale,
|
|
2920
|
+
const messages43 = getMessages7(locale, enMessages, nbMessages, fiMessages);
|
|
2921
|
+
i18n.load(locale, messages43);
|
|
2651
2922
|
i18n.activate(locale);
|
|
2652
2923
|
};
|
|
2653
2924
|
|
|
@@ -3030,7 +3301,7 @@ if (!customElements.get("w-box")) {
|
|
|
3030
3301
|
import { html as html12 } from "lit";
|
|
3031
3302
|
import WarpElement6 from "@warp-ds/elements-core";
|
|
3032
3303
|
|
|
3033
|
-
// node_modules/.pnpm/@warp-ds+core@1.0.
|
|
3304
|
+
// node_modules/.pnpm/@warp-ds+core@1.0.2/node_modules/@warp-ds/core/dist/breadcrumbs/index.js
|
|
3034
3305
|
function interleave(array, separator2) {
|
|
3035
3306
|
return array.flatMap((el) => [el, separator2]).slice(0, -1);
|
|
3036
3307
|
}
|
|
@@ -3139,11 +3410,11 @@ var WarpBroadcast = class extends WarpElement7 {
|
|
|
3139
3410
|
this._hiddenMessageIds = [.../* @__PURE__ */ new Set([...this._hiddenMessageIds, id])];
|
|
3140
3411
|
}
|
|
3141
3412
|
render() {
|
|
3142
|
-
const
|
|
3413
|
+
const messages43 = this._messages.filter((item) => !this._hiddenMessageIds.includes(item.id));
|
|
3143
3414
|
return html13`
|
|
3144
|
-
<aside class=${`${
|
|
3415
|
+
<aside class=${`${messages43.length === 0 ? "hidden" : "mb-16"}`}>
|
|
3145
3416
|
${repeat(
|
|
3146
|
-
|
|
3417
|
+
messages43,
|
|
3147
3418
|
({ id }) => `broadcast-${id}`,
|
|
3148
3419
|
({ id, message }) => html13`<w-toast
|
|
3149
3420
|
id="broadcast-${id}"
|
|
@@ -3238,7 +3509,7 @@ ${buttonTypes2.join(
|
|
|
3238
3509
|
const secondary = this.variant === "secondary";
|
|
3239
3510
|
const negative = this.variant === "negative";
|
|
3240
3511
|
const utility = this.variant === "utility";
|
|
3241
|
-
const
|
|
3512
|
+
const pill2 = this.variant === "pill";
|
|
3242
3513
|
const link = this.variant === "link";
|
|
3243
3514
|
return r(
|
|
3244
3515
|
{
|
|
@@ -3274,10 +3545,10 @@ ${buttonTypes2.join(
|
|
|
3274
3545
|
[button.negativeQuiet]: negative && !this.small && this.quiet && !this.loading,
|
|
3275
3546
|
[button.negativeQuietLoading]: negative && !this.small && this.quiet && this.loading,
|
|
3276
3547
|
[button.negativeLoading]: negative && !this.small && !this.quiet && this.loading,
|
|
3277
|
-
[button.pill]:
|
|
3278
|
-
[button.pillSmall]:
|
|
3279
|
-
[button.pillLoading]:
|
|
3280
|
-
[button.pillSmallLoading]:
|
|
3548
|
+
[button.pill]: pill2 && !this.small && !this.loading,
|
|
3549
|
+
[button.pillSmall]: pill2 && this.small && !this.loading,
|
|
3550
|
+
[button.pillLoading]: pill2 && !this.small && this.loading,
|
|
3551
|
+
[button.pillSmallLoading]: pill2 && this.small && this.loading,
|
|
3281
3552
|
[button.link]: link && !this.small,
|
|
3282
3553
|
[button.linkSmall]: link && this.small,
|
|
3283
3554
|
[button.linkAsButton]: !!this.href,
|
|
@@ -3428,30 +3699,71 @@ if (!customElements.get("w-card")) {
|
|
|
3428
3699
|
import { css as css5, html as html18 } from "lit";
|
|
3429
3700
|
import WarpElement10 from "@warp-ds/elements-core";
|
|
3430
3701
|
|
|
3431
|
-
// node_modules/.pnpm/@warp-ds+icons@
|
|
3702
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.0/node_modules/@warp-ds/icons/dist/elements/chevron-down-16.js
|
|
3432
3703
|
import { LitElement as LitElement7 } from "lit";
|
|
3433
3704
|
import { unsafeStatic as unsafeStatic7, html as html16 } from "lit/static-html.js";
|
|
3434
3705
|
var messages18 = JSON.parse('{"icon.title.chevron-down":"Nedoverpil"}');
|
|
3435
3706
|
var messages27 = JSON.parse('{"icon.title.chevron-down":"Downward arrow"}');
|
|
3436
3707
|
var messages37 = JSON.parse('{"icon.title.chevron-down":"Nuoli alasp\xE4in"}');
|
|
3437
|
-
var supportedLocales8 = ["en", "nb", "fi"];
|
|
3438
|
-
var
|
|
3708
|
+
var supportedLocales8 = ["en", "nb", "fi", "da", "sv"];
|
|
3709
|
+
var defaultLocale9 = "en";
|
|
3710
|
+
var detectByBrand7 = () => {
|
|
3711
|
+
let value;
|
|
3712
|
+
switch (process.env.NMP_BRAND) {
|
|
3713
|
+
case "FINN":
|
|
3714
|
+
value = "nb";
|
|
3715
|
+
break;
|
|
3716
|
+
case "TORI":
|
|
3717
|
+
value = "fi";
|
|
3718
|
+
break;
|
|
3719
|
+
case "BLOCKET":
|
|
3720
|
+
value = "sv";
|
|
3721
|
+
break;
|
|
3722
|
+
case "DBA":
|
|
3723
|
+
value = "da";
|
|
3724
|
+
break;
|
|
3725
|
+
default:
|
|
3726
|
+
value = "en";
|
|
3727
|
+
}
|
|
3728
|
+
return value;
|
|
3729
|
+
};
|
|
3730
|
+
var detectByHost7 = () => {
|
|
3731
|
+
var _a;
|
|
3732
|
+
const hostname = (_a = document == null ? void 0 : document.location) == null ? void 0 : _a.hostname;
|
|
3733
|
+
if (hostname.includes("finn")) {
|
|
3734
|
+
return "nb";
|
|
3735
|
+
} else if (hostname.includes("tori")) {
|
|
3736
|
+
return "fi";
|
|
3737
|
+
} else if (hostname.includes("blocket")) {
|
|
3738
|
+
return "sv";
|
|
3739
|
+
} else if (hostname.includes("dba")) {
|
|
3740
|
+
return "da";
|
|
3741
|
+
} else {
|
|
3742
|
+
return defaultLocale9;
|
|
3743
|
+
}
|
|
3744
|
+
};
|
|
3439
3745
|
var getSupportedLocale8 = (usedLocale) => {
|
|
3440
3746
|
return supportedLocales8.find(
|
|
3441
3747
|
(locale) => usedLocale === locale || usedLocale.toLowerCase().includes(locale)
|
|
3442
|
-
) ||
|
|
3748
|
+
) || detectByHost7();
|
|
3443
3749
|
};
|
|
3444
3750
|
function detectLocale8() {
|
|
3751
|
+
var _a;
|
|
3445
3752
|
if (typeof window === "undefined") {
|
|
3446
|
-
const serverLocale =
|
|
3753
|
+
const serverLocale = detectByBrand7();
|
|
3447
3754
|
return getSupportedLocale8(serverLocale);
|
|
3448
3755
|
}
|
|
3449
3756
|
try {
|
|
3450
|
-
const htmlLocale = document.documentElement.lang;
|
|
3451
|
-
|
|
3757
|
+
const htmlLocale = (_a = document == null ? void 0 : document.documentElement) == null ? void 0 : _a.lang;
|
|
3758
|
+
const hostLocale = detectByHost7();
|
|
3759
|
+
if (!supportedLocales8.includes(htmlLocale)) {
|
|
3760
|
+
console.warn("Unsupported locale set in html lang tag, falling back to detection by hostname");
|
|
3761
|
+
return getSupportedLocale8(hostLocale);
|
|
3762
|
+
}
|
|
3763
|
+
return getSupportedLocale8(htmlLocale != null ? htmlLocale : hostLocale);
|
|
3452
3764
|
} catch (e2) {
|
|
3453
3765
|
console.warn("could not detect locale, falling back to source locale", e2);
|
|
3454
|
-
return
|
|
3766
|
+
return defaultLocale9;
|
|
3455
3767
|
}
|
|
3456
3768
|
}
|
|
3457
3769
|
var getMessages8 = (locale, enMsg, nbMsg, fiMsg) => {
|
|
@@ -3463,45 +3775,86 @@ var getMessages8 = (locale, enMsg, nbMsg, fiMsg) => {
|
|
|
3463
3775
|
};
|
|
3464
3776
|
var activateI18n8 = (enMessages, nbMessages, fiMessages) => {
|
|
3465
3777
|
const locale = detectLocale8();
|
|
3466
|
-
const
|
|
3467
|
-
i18n.load(locale,
|
|
3778
|
+
const messages43 = getMessages8(locale, enMessages, nbMessages, fiMessages);
|
|
3779
|
+
i18n.load(locale, messages43);
|
|
3468
3780
|
i18n.activate(locale);
|
|
3469
3781
|
};
|
|
3470
3782
|
activateI18n8(messages27, messages18, messages37);
|
|
3471
3783
|
var IconChevronDown16 = class extends LitElement7 {
|
|
3472
3784
|
render() {
|
|
3473
3785
|
const title = i18n.t({ message: `Downward arrow`, id: "icon.title.chevron-down", comment: "Title for chevron-down icon" });
|
|
3474
|
-
return html16`<svg xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="none"viewBox="0 0 16 16" part="w-icon-chevron-down-16-part">${unsafeStatic7(`<title>${title}</title>`)}<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="
|
|
3786
|
+
return html16`<svg xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="none"viewBox="0 0 16 16" part="w-icon-chevron-down-16-part">${unsafeStatic7(`<title>${title}</title>`)}<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m2.667 5.333 5.5 5.5 5.5-5.5"></path></svg>`;
|
|
3475
3787
|
}
|
|
3476
3788
|
};
|
|
3477
3789
|
if (!customElements.get("w-icon-chevron-down-16")) {
|
|
3478
3790
|
customElements.define("w-icon-chevron-down-16", IconChevronDown16);
|
|
3479
3791
|
}
|
|
3480
3792
|
|
|
3481
|
-
// node_modules/.pnpm/@warp-ds+icons@
|
|
3793
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.0/node_modules/@warp-ds/icons/dist/elements/chevron-up-16.js
|
|
3482
3794
|
import { LitElement as LitElement8 } from "lit";
|
|
3483
3795
|
import { unsafeStatic as unsafeStatic8, html as html17 } from "lit/static-html.js";
|
|
3484
3796
|
var messages19 = JSON.parse('{"icon.title.chevron-up":"Oppoverpil"}');
|
|
3485
3797
|
var messages28 = JSON.parse('{"icon.title.chevron-up":"Upward arrow"}');
|
|
3486
3798
|
var messages38 = JSON.parse('{"icon.title.chevron-up":"Nuoli yl\xF6sp\xE4in"}');
|
|
3487
|
-
var supportedLocales9 = ["en", "nb", "fi"];
|
|
3488
|
-
var
|
|
3799
|
+
var supportedLocales9 = ["en", "nb", "fi", "da", "sv"];
|
|
3800
|
+
var defaultLocale10 = "en";
|
|
3801
|
+
var detectByBrand8 = () => {
|
|
3802
|
+
let value;
|
|
3803
|
+
switch (process.env.NMP_BRAND) {
|
|
3804
|
+
case "FINN":
|
|
3805
|
+
value = "nb";
|
|
3806
|
+
break;
|
|
3807
|
+
case "TORI":
|
|
3808
|
+
value = "fi";
|
|
3809
|
+
break;
|
|
3810
|
+
case "BLOCKET":
|
|
3811
|
+
value = "sv";
|
|
3812
|
+
break;
|
|
3813
|
+
case "DBA":
|
|
3814
|
+
value = "da";
|
|
3815
|
+
break;
|
|
3816
|
+
default:
|
|
3817
|
+
value = "en";
|
|
3818
|
+
}
|
|
3819
|
+
return value;
|
|
3820
|
+
};
|
|
3821
|
+
var detectByHost8 = () => {
|
|
3822
|
+
var _a;
|
|
3823
|
+
const hostname = (_a = document == null ? void 0 : document.location) == null ? void 0 : _a.hostname;
|
|
3824
|
+
if (hostname.includes("finn")) {
|
|
3825
|
+
return "nb";
|
|
3826
|
+
} else if (hostname.includes("tori")) {
|
|
3827
|
+
return "fi";
|
|
3828
|
+
} else if (hostname.includes("blocket")) {
|
|
3829
|
+
return "sv";
|
|
3830
|
+
} else if (hostname.includes("dba")) {
|
|
3831
|
+
return "da";
|
|
3832
|
+
} else {
|
|
3833
|
+
return defaultLocale10;
|
|
3834
|
+
}
|
|
3835
|
+
};
|
|
3489
3836
|
var getSupportedLocale9 = (usedLocale) => {
|
|
3490
3837
|
return supportedLocales9.find(
|
|
3491
3838
|
(locale) => usedLocale === locale || usedLocale.toLowerCase().includes(locale)
|
|
3492
|
-
) ||
|
|
3839
|
+
) || detectByHost8();
|
|
3493
3840
|
};
|
|
3494
3841
|
function detectLocale9() {
|
|
3842
|
+
var _a;
|
|
3495
3843
|
if (typeof window === "undefined") {
|
|
3496
|
-
const serverLocale =
|
|
3844
|
+
const serverLocale = detectByBrand8();
|
|
3497
3845
|
return getSupportedLocale9(serverLocale);
|
|
3498
3846
|
}
|
|
3499
3847
|
try {
|
|
3500
|
-
const htmlLocale = document.documentElement.lang;
|
|
3501
|
-
|
|
3848
|
+
const htmlLocale = (_a = document == null ? void 0 : document.documentElement) == null ? void 0 : _a.lang;
|
|
3849
|
+
const hostLocale = detectByHost8();
|
|
3850
|
+
if (!supportedLocales9.includes(htmlLocale)) {
|
|
3851
|
+
console.warn("Unsupported locale set in html lang tag, falling back to detection by hostname");
|
|
3852
|
+
return getSupportedLocale9(hostLocale);
|
|
3853
|
+
}
|
|
3854
|
+
return getSupportedLocale9(htmlLocale != null ? htmlLocale : hostLocale);
|
|
3502
3855
|
} catch (e2) {
|
|
3503
3856
|
console.warn("could not detect locale, falling back to source locale", e2);
|
|
3504
|
-
return
|
|
3857
|
+
return defaultLocale10;
|
|
3505
3858
|
}
|
|
3506
3859
|
}
|
|
3507
3860
|
var getMessages9 = (locale, enMsg, nbMsg, fiMsg) => {
|
|
@@ -3513,8 +3866,8 @@ var getMessages9 = (locale, enMsg, nbMsg, fiMsg) => {
|
|
|
3513
3866
|
};
|
|
3514
3867
|
var activateI18n9 = (enMessages, nbMessages, fiMessages) => {
|
|
3515
3868
|
const locale = detectLocale9();
|
|
3516
|
-
const
|
|
3517
|
-
i18n.load(locale,
|
|
3869
|
+
const messages43 = getMessages9(locale, enMessages, nbMessages, fiMessages);
|
|
3870
|
+
i18n.load(locale, messages43);
|
|
3518
3871
|
i18n.activate(locale);
|
|
3519
3872
|
};
|
|
3520
3873
|
activateI18n9(messages28, messages19, messages38);
|
|
@@ -3661,25 +4014,115 @@ if (!customElements.get("w-expandable")) {
|
|
|
3661
4014
|
customElements.define("w-expandable", WarpExpandable);
|
|
3662
4015
|
}
|
|
3663
4016
|
|
|
3664
|
-
// packages/
|
|
3665
|
-
import { html as html19
|
|
4017
|
+
// packages/pill/index.js
|
|
4018
|
+
import { html as html19 } from "lit";
|
|
4019
|
+
|
|
4020
|
+
// packages/pill/locales/en/messages.mjs
|
|
4021
|
+
var messages20 = JSON.parse('{"pill.aria.openFilter":"Open filter","pill.aria.removeFilter":["Remove filter ",["label"]]}');
|
|
4022
|
+
|
|
4023
|
+
// packages/pill/locales/fi/messages.mjs
|
|
4024
|
+
var messages21 = JSON.parse('{"pill.aria.openFilter":"Avaa suodatin","pill.aria.removeFilter":["Tyhjenn\xE4 suodatin ",["label"]]}');
|
|
4025
|
+
|
|
4026
|
+
// packages/pill/locales/nb/messages.mjs
|
|
4027
|
+
var messages29 = JSON.parse('{"pill.aria.openFilter":"\xC5pne filter","pill.aria.removeFilter":["Fjern filter ",["label"]]}');
|
|
4028
|
+
|
|
4029
|
+
// packages/pill/index.js
|
|
3666
4030
|
import WarpElement11 from "@warp-ds/elements-core";
|
|
4031
|
+
var WarpPill = class extends kebabCaseAttributes(WarpElement11) {
|
|
4032
|
+
constructor() {
|
|
4033
|
+
super();
|
|
4034
|
+
activateI18n7(messages20, messages29, messages21);
|
|
4035
|
+
this.canClose = false;
|
|
4036
|
+
this.suggestion = false;
|
|
4037
|
+
this.openFilterSrText = i18n._({
|
|
4038
|
+
id: "pill.aria.openFilter",
|
|
4039
|
+
message: "Open filter",
|
|
4040
|
+
comment: "Fallback screenreader message for open filter"
|
|
4041
|
+
});
|
|
4042
|
+
this.removeFilterSrText = i18n._({
|
|
4043
|
+
id: "pill.aria.removeFilter",
|
|
4044
|
+
message: "Remove filter {label}",
|
|
4045
|
+
comment: "Fallback screenreader message for removal of the filter"
|
|
4046
|
+
});
|
|
4047
|
+
}
|
|
4048
|
+
get _labelClasses() {
|
|
4049
|
+
return r({
|
|
4050
|
+
[pill.button]: true,
|
|
4051
|
+
[this.suggestion ? pill.suggestion : pill.filter]: true,
|
|
4052
|
+
[pill.label]: true,
|
|
4053
|
+
[this.canClose ? pill.labelWithClose : pill.labelWithoutClose]: true
|
|
4054
|
+
});
|
|
4055
|
+
}
|
|
4056
|
+
get _closeClasses() {
|
|
4057
|
+
return r({
|
|
4058
|
+
[pill.button]: true,
|
|
4059
|
+
[this.suggestion ? pill.suggestion : pill.filter]: true,
|
|
4060
|
+
[pill.close]: true
|
|
4061
|
+
});
|
|
4062
|
+
}
|
|
4063
|
+
_onClick() {
|
|
4064
|
+
this.dispatchEvent(new CustomEvent("w-pill-click", { bubbles: true, composed: true }));
|
|
4065
|
+
}
|
|
4066
|
+
_onClose() {
|
|
4067
|
+
this.dispatchEvent(new CustomEvent("w-pill-close", { bubbles: true, composed: true }));
|
|
4068
|
+
}
|
|
4069
|
+
render() {
|
|
4070
|
+
return html19`
|
|
4071
|
+
<div class="${pill.pill}">
|
|
4072
|
+
<button
|
|
4073
|
+
type="button"
|
|
4074
|
+
class="${this._labelClasses}"
|
|
4075
|
+
@click="${this._onClick}"
|
|
4076
|
+
>
|
|
4077
|
+
<span class="${pill.a11y}"
|
|
4078
|
+
>${this.openSrLabel ? this.openSrLabel : this.openFilterSrText}</span
|
|
4079
|
+
>
|
|
4080
|
+
<slot></slot>
|
|
4081
|
+
</button>
|
|
4082
|
+
${this.canClose ? html19`<button
|
|
4083
|
+
type="button"
|
|
4084
|
+
class="${this._closeClasses}"
|
|
4085
|
+
@click="${this._onClose}"
|
|
4086
|
+
>
|
|
4087
|
+
<span class="${pill.a11y}"
|
|
4088
|
+
>${this.closeSrLabel ? this.closeSrLabel : this.removeFilterSrText}</span
|
|
4089
|
+
>
|
|
4090
|
+
<w-icon-close-16></w-icon-close-16>
|
|
4091
|
+
</button>` : null}
|
|
4092
|
+
</div>
|
|
4093
|
+
`;
|
|
4094
|
+
}
|
|
4095
|
+
};
|
|
4096
|
+
__publicField(WarpPill, "styles", [WarpElement11.styles]);
|
|
4097
|
+
__publicField(WarpPill, "properties", {
|
|
4098
|
+
canClose: { type: Boolean },
|
|
4099
|
+
suggestion: { type: Boolean },
|
|
4100
|
+
openSrLabel: { type: String },
|
|
4101
|
+
closeSrLabel: { type: String }
|
|
4102
|
+
});
|
|
4103
|
+
if (!customElements.get("w-pill")) {
|
|
4104
|
+
customElements.define("w-pill", WarpPill);
|
|
4105
|
+
}
|
|
4106
|
+
|
|
4107
|
+
// packages/select/index.js
|
|
4108
|
+
import { html as html20, css as css6 } from "lit";
|
|
4109
|
+
import WarpElement12 from "@warp-ds/elements-core";
|
|
3667
4110
|
import { ifDefined as ifDefined5 } from "lit/directives/if-defined.js";
|
|
3668
4111
|
import { when } from "lit/directives/when.js";
|
|
3669
4112
|
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
3670
4113
|
|
|
3671
4114
|
// packages/select/locales/en/messages.mjs
|
|
3672
|
-
var
|
|
4115
|
+
var messages30 = JSON.parse('{"select.label.optional":"(optional)"}');
|
|
3673
4116
|
|
|
3674
4117
|
// packages/select/locales/nb/messages.mjs
|
|
3675
|
-
var
|
|
4118
|
+
var messages31 = JSON.parse('{"select.label.optional":"(valgfritt)"}');
|
|
3676
4119
|
|
|
3677
4120
|
// packages/select/locales/fi/messages.mjs
|
|
3678
|
-
var
|
|
4121
|
+
var messages39 = JSON.parse('{"select.label.optional":"(vapaaehtoinen)"}');
|
|
3679
4122
|
|
|
3680
4123
|
// packages/select/index.js
|
|
3681
4124
|
var _classes, classes_get, _labelClasses, labelClasses_get, _helpTextClasses, helpTextClasses_get, _chevronClasses, chevronClasses_get, _id, id_get, _helpId, helpId_get;
|
|
3682
|
-
var WarpSelect = class extends kebabCaseAttributes(
|
|
4125
|
+
var WarpSelect = class extends kebabCaseAttributes(WarpElement12) {
|
|
3683
4126
|
constructor() {
|
|
3684
4127
|
super();
|
|
3685
4128
|
__privateAdd(this, _classes);
|
|
@@ -3688,18 +4131,18 @@ var WarpSelect = class extends kebabCaseAttributes(WarpElement11) {
|
|
|
3688
4131
|
__privateAdd(this, _chevronClasses);
|
|
3689
4132
|
__privateAdd(this, _id);
|
|
3690
4133
|
__privateAdd(this, _helpId);
|
|
3691
|
-
activateI18n7(
|
|
4134
|
+
activateI18n7(messages30, messages31, messages39);
|
|
3692
4135
|
this._options = this.innerHTML;
|
|
3693
4136
|
}
|
|
3694
4137
|
render() {
|
|
3695
|
-
return
|
|
4138
|
+
return html20`<div class="${select.wrapper}">
|
|
3696
4139
|
${when(
|
|
3697
4140
|
this.label,
|
|
3698
|
-
() =>
|
|
4141
|
+
() => html20`<label class="${__privateGet(this, _labelClasses, labelClasses_get)}" for="${__privateGet(this, _id, id_get)}">
|
|
3699
4142
|
${this.label}
|
|
3700
4143
|
${when(
|
|
3701
4144
|
this.optional,
|
|
3702
|
-
() =>
|
|
4145
|
+
() => html20`<span class="${label.optional}"
|
|
3703
4146
|
>${i18n._({
|
|
3704
4147
|
id: "select.label.optional",
|
|
3705
4148
|
message: "(optional)",
|
|
@@ -3726,7 +4169,7 @@ var WarpSelect = class extends kebabCaseAttributes(WarpElement11) {
|
|
|
3726
4169
|
</div>
|
|
3727
4170
|
${when(
|
|
3728
4171
|
this.always || this.invalid,
|
|
3729
|
-
() =>
|
|
4172
|
+
() => html20`<div id="${__privateGet(this, _helpId, helpId_get)}" class="${__privateGet(this, _helpTextClasses, helpTextClasses_get)}">
|
|
3730
4173
|
${this.hint}
|
|
3731
4174
|
</div>`
|
|
3732
4175
|
)}
|
|
@@ -3784,16 +4227,16 @@ __publicField(WarpSelect, "properties", {
|
|
|
3784
4227
|
optional: { type: Boolean, reflect: true },
|
|
3785
4228
|
_options: { state: true }
|
|
3786
4229
|
});
|
|
3787
|
-
__publicField(WarpSelect, "styles", [
|
|
4230
|
+
__publicField(WarpSelect, "styles", [WarpElement12.styles]);
|
|
3788
4231
|
if (!customElements.get("w-select")) {
|
|
3789
4232
|
customElements.define("w-select", WarpSelect);
|
|
3790
4233
|
}
|
|
3791
4234
|
|
|
3792
4235
|
// packages/textfield/index.js
|
|
3793
|
-
import { css as css7, html as
|
|
3794
|
-
import
|
|
4236
|
+
import { css as css7, html as html21 } from "lit";
|
|
4237
|
+
import WarpElement13 from "@warp-ds/elements-core";
|
|
3795
4238
|
import { ifDefined as ifDefined6 } from "lit/directives/if-defined.js";
|
|
3796
|
-
var WarpTextField = class extends
|
|
4239
|
+
var WarpTextField = class extends WarpElement13 {
|
|
3797
4240
|
constructor() {
|
|
3798
4241
|
super();
|
|
3799
4242
|
this.type = "text";
|
|
@@ -3824,7 +4267,7 @@ var WarpTextField = class extends WarpElement12 {
|
|
|
3824
4267
|
}
|
|
3825
4268
|
get _label() {
|
|
3826
4269
|
if (this.label) {
|
|
3827
|
-
return
|
|
4270
|
+
return html21`<label for="${this._id}" class=${this._labelStyles}>${this.label}</label>`;
|
|
3828
4271
|
}
|
|
3829
4272
|
}
|
|
3830
4273
|
get _helpId() {
|
|
@@ -3862,7 +4305,7 @@ var WarpTextField = class extends WarpElement12 {
|
|
|
3862
4305
|
this._hasSuffix = true;
|
|
3863
4306
|
}
|
|
3864
4307
|
render() {
|
|
3865
|
-
return
|
|
4308
|
+
return html21`
|
|
3866
4309
|
${this._label}
|
|
3867
4310
|
<div class="${input.wrapper}">
|
|
3868
4311
|
<slot @slotchange="${this.prefixSlotChange}" name="prefix"></slot>
|
|
@@ -3891,7 +4334,7 @@ var WarpTextField = class extends WarpElement12 {
|
|
|
3891
4334
|
/>
|
|
3892
4335
|
<slot @slotchange="${this.suffixSlotChange}" name="suffix"></slot>
|
|
3893
4336
|
</div>
|
|
3894
|
-
${this.helpText &&
|
|
4337
|
+
${this.helpText && html21`<div class="${this._helpTextStyles}" id="${this._helpId}">${this.helpText}</div>`}
|
|
3895
4338
|
`;
|
|
3896
4339
|
}
|
|
3897
4340
|
};
|
|
@@ -3921,7 +4364,7 @@ __publicField(WarpTextField, "properties", {
|
|
|
3921
4364
|
// so never gets higher Specificity. Thus in order to overwrite style linked within shadowDOM, we need to use !important.
|
|
3922
4365
|
// https://stackoverflow.com/a/61631668
|
|
3923
4366
|
__publicField(WarpTextField, "styles", [
|
|
3924
|
-
|
|
4367
|
+
WarpElement13.styles,
|
|
3925
4368
|
css7`
|
|
3926
4369
|
:host {
|
|
3927
4370
|
display: block;
|
|
@@ -3966,9 +4409,141 @@ function updateToast(id, options) {
|
|
|
3966
4409
|
return toast3.get(id);
|
|
3967
4410
|
}
|
|
3968
4411
|
|
|
4412
|
+
// packages/toast/toast-container.js
|
|
4413
|
+
import { css as css8, html as html22 } from "lit";
|
|
4414
|
+
import WarpElement14 from "@warp-ds/elements-core";
|
|
4415
|
+
import { repeat as repeat2 } from "lit/directives/repeat.js";
|
|
4416
|
+
var WarpToastContainer = class extends WarpElement14 {
|
|
4417
|
+
constructor() {
|
|
4418
|
+
super();
|
|
4419
|
+
this._toasts = /* @__PURE__ */ new Map();
|
|
4420
|
+
}
|
|
4421
|
+
connectedCallback() {
|
|
4422
|
+
super.connectedCallback();
|
|
4423
|
+
this._interval = setInterval(() => {
|
|
4424
|
+
const keep = [];
|
|
4425
|
+
const remove = [];
|
|
4426
|
+
for (const toast3 of this._toasts) {
|
|
4427
|
+
if (Date.now() <= toast3[1].duration)
|
|
4428
|
+
keep.push(toast3);
|
|
4429
|
+
else
|
|
4430
|
+
remove.push(toast3);
|
|
4431
|
+
}
|
|
4432
|
+
const collapseTasks = [];
|
|
4433
|
+
for (const [id] of remove) {
|
|
4434
|
+
const el = this.renderRoot.querySelector(`#${id}`);
|
|
4435
|
+
collapseTasks.push(el.collapse());
|
|
4436
|
+
}
|
|
4437
|
+
Promise.all(collapseTasks).then(() => {
|
|
4438
|
+
if (keep.length != this._toasts.size)
|
|
4439
|
+
this._toasts = new Map(keep);
|
|
4440
|
+
});
|
|
4441
|
+
}, 500);
|
|
4442
|
+
}
|
|
4443
|
+
disconnectedCallback() {
|
|
4444
|
+
super.disconnectedCallback();
|
|
4445
|
+
if (this._interval)
|
|
4446
|
+
clearTimeout(this._interval);
|
|
4447
|
+
}
|
|
4448
|
+
static init() {
|
|
4449
|
+
let el = document.querySelector("w-toast-container");
|
|
4450
|
+
if (!el) {
|
|
4451
|
+
el = document.createElement("w-toast-container");
|
|
4452
|
+
document.body.appendChild(el);
|
|
4453
|
+
}
|
|
4454
|
+
return el;
|
|
4455
|
+
}
|
|
4456
|
+
get _toastsArray() {
|
|
4457
|
+
return Array.from(this._toasts).map(([, toast3]) => toast3);
|
|
4458
|
+
}
|
|
4459
|
+
/**
|
|
4460
|
+
*
|
|
4461
|
+
* @param {String|Number} id
|
|
4462
|
+
* @returns {ToastOptions}
|
|
4463
|
+
*/
|
|
4464
|
+
get(id) {
|
|
4465
|
+
if (!id)
|
|
4466
|
+
throw new Error('undefined "id" given when attempting to retrieve toast');
|
|
4467
|
+
if (typeof id !== "string" && !Number.isInteger(id))
|
|
4468
|
+
throw new Error(
|
|
4469
|
+
'"id" must be number or string when attempting to retrieve toast'
|
|
4470
|
+
);
|
|
4471
|
+
return this._toasts.get(id);
|
|
4472
|
+
}
|
|
4473
|
+
/**
|
|
4474
|
+
*
|
|
4475
|
+
* @param {Object} toast
|
|
4476
|
+
* @returns {WarpToastContainer}
|
|
4477
|
+
*/
|
|
4478
|
+
set(toast3) {
|
|
4479
|
+
if (!toast3.id)
|
|
4480
|
+
throw new Error('invalid or undefined "id" on toast object');
|
|
4481
|
+
const result = this._toasts.set(toast3.id, __spreadProps(__spreadValues({}, toast3), {
|
|
4482
|
+
duration: Date.now() + (toast3.duration || 5e3)
|
|
4483
|
+
}));
|
|
4484
|
+
this._toasts = new Map(Array.from(this._toasts));
|
|
4485
|
+
return result;
|
|
4486
|
+
}
|
|
4487
|
+
/**
|
|
4488
|
+
*
|
|
4489
|
+
* @param {String|Number} id
|
|
4490
|
+
* @returns {ToastOptions | false}
|
|
4491
|
+
*/
|
|
4492
|
+
async del(id) {
|
|
4493
|
+
if (!id)
|
|
4494
|
+
throw new Error('undefined "id" given when attempting to retrieve toast');
|
|
4495
|
+
if (typeof id !== "string" && !Number.isInteger(id))
|
|
4496
|
+
throw new Error(
|
|
4497
|
+
'"id" must be number or string when attempting to retrieve toast'
|
|
4498
|
+
);
|
|
4499
|
+
const el = this.renderRoot.querySelector(`#${id}`);
|
|
4500
|
+
if (!this._toasts.has(id))
|
|
4501
|
+
return false;
|
|
4502
|
+
await el.collapse();
|
|
4503
|
+
const result = this._toasts.delete(id);
|
|
4504
|
+
this._toasts = new Map(Array.from(this._toasts));
|
|
4505
|
+
return result;
|
|
4506
|
+
}
|
|
4507
|
+
render() {
|
|
4508
|
+
return html22`
|
|
4509
|
+
<aside class="${toaster.container}">
|
|
4510
|
+
<div class="${toaster.toaster}" id="w-toast-container-list">
|
|
4511
|
+
${repeat2(
|
|
4512
|
+
this._toastsArray,
|
|
4513
|
+
(toast3) => toast3.id,
|
|
4514
|
+
(toast3) => html22` <w-toast
|
|
4515
|
+
class="${toaster.content}"
|
|
4516
|
+
id="${toast3.id}"
|
|
4517
|
+
type="${toast3.type}"
|
|
4518
|
+
text="${toast3.text}"
|
|
4519
|
+
?canclose=${toast3.canclose}
|
|
4520
|
+
@close=${() => this.del(toast3.id)}
|
|
4521
|
+
>
|
|
4522
|
+
</w-toast>`
|
|
4523
|
+
)}
|
|
4524
|
+
</div>
|
|
4525
|
+
</aside>
|
|
4526
|
+
`;
|
|
4527
|
+
}
|
|
4528
|
+
};
|
|
4529
|
+
__publicField(WarpToastContainer, "styles", [
|
|
4530
|
+
WarpElement14.styles,
|
|
4531
|
+
css8`
|
|
4532
|
+
:host {
|
|
4533
|
+
display: block;
|
|
4534
|
+
}
|
|
4535
|
+
`
|
|
4536
|
+
]);
|
|
4537
|
+
__publicField(WarpToastContainer, "properties", {
|
|
4538
|
+
_toasts: { state: true }
|
|
4539
|
+
});
|
|
4540
|
+
if (!customElements.get("w-toast-container")) {
|
|
4541
|
+
customElements.define("w-toast-container", WarpToastContainer);
|
|
4542
|
+
}
|
|
4543
|
+
|
|
3969
4544
|
// packages/toast/toast.js
|
|
3970
|
-
import { css as
|
|
3971
|
-
import
|
|
4545
|
+
import { css as css9, html as html23 } from "lit";
|
|
4546
|
+
import WarpElement15 from "@warp-ds/elements-core";
|
|
3972
4547
|
import { classMap as classMap2 } from "lit/directives/class-map.js";
|
|
3973
4548
|
import { when as when2 } from "lit/directives/when.js";
|
|
3974
4549
|
|
|
@@ -4046,13 +4621,13 @@ var collapse = (el, done) => {
|
|
|
4046
4621
|
};
|
|
4047
4622
|
|
|
4048
4623
|
// packages/toast/locales/en/messages.mjs
|
|
4049
|
-
var
|
|
4624
|
+
var messages40 = JSON.parse('{"toast.aria.error":"Error","toast.aria.successful":"Successful","toast.aria.warning":"Warning"}');
|
|
4050
4625
|
|
|
4051
4626
|
// packages/toast/locales/nb/messages.mjs
|
|
4052
|
-
var
|
|
4627
|
+
var messages41 = JSON.parse('{"toast.aria.error":"Varsel","toast.aria.successful":"Vellykket","toast.aria.warning":"Feil"}');
|
|
4053
4628
|
|
|
4054
4629
|
// packages/toast/locales/fi/messages.mjs
|
|
4055
|
-
var
|
|
4630
|
+
var messages42 = JSON.parse('{"toast.aria.error":"Error","toast.aria.successful":"Successful","toast.aria.warning":"Warning"}');
|
|
4056
4631
|
|
|
4057
4632
|
// packages/toast/toast.js
|
|
4058
4633
|
var classes2 = (definition) => {
|
|
@@ -4069,10 +4644,10 @@ var toastType = {
|
|
|
4069
4644
|
error: "error",
|
|
4070
4645
|
warning: "warning"
|
|
4071
4646
|
};
|
|
4072
|
-
var WarpToast = class extends
|
|
4647
|
+
var WarpToast = class extends WarpElement15 {
|
|
4073
4648
|
constructor() {
|
|
4074
4649
|
super();
|
|
4075
|
-
activateI18n7(
|
|
4650
|
+
activateI18n7(messages40, messages41, messages42);
|
|
4076
4651
|
this.id = Date.now().toString(36) + Math.random().toString(36).slice(2, 5);
|
|
4077
4652
|
this.type = "success";
|
|
4078
4653
|
this.text = "";
|
|
@@ -4138,11 +4713,11 @@ var WarpToast = class extends WarpElement13 {
|
|
|
4138
4713
|
}
|
|
4139
4714
|
get _iconMarkup() {
|
|
4140
4715
|
if (this._warning)
|
|
4141
|
-
return
|
|
4716
|
+
return html23`<w-icon-warning-16></w-icon-warning-16>`;
|
|
4142
4717
|
if (this._error)
|
|
4143
|
-
return
|
|
4718
|
+
return html23`<w-icon-error-16></w-icon-error-16>`;
|
|
4144
4719
|
else
|
|
4145
|
-
return
|
|
4720
|
+
return html23`<w-icon-success-16></w-icon-success-16>`;
|
|
4146
4721
|
}
|
|
4147
4722
|
async collapse() {
|
|
4148
4723
|
return new Promise((resolve) => {
|
|
@@ -4162,8 +4737,8 @@ var WarpToast = class extends WarpElement13 {
|
|
|
4162
4737
|
}
|
|
4163
4738
|
render() {
|
|
4164
4739
|
if (!this.text)
|
|
4165
|
-
return
|
|
4166
|
-
return
|
|
4740
|
+
return html23``;
|
|
4741
|
+
return html23` <section class="${toast.wrapper}" aria-label="${this._typeLabel}">
|
|
4167
4742
|
<div class="${this._primaryClasses}">
|
|
4168
4743
|
<div class="${this._iconClasses}">${this._iconMarkup}</div>
|
|
4169
4744
|
<div role="${this._role}" class="${toast.content}">
|
|
@@ -4171,7 +4746,7 @@ var WarpToast = class extends WarpElement13 {
|
|
|
4171
4746
|
</div>
|
|
4172
4747
|
${when2(
|
|
4173
4748
|
this.canclose === true,
|
|
4174
|
-
() =>
|
|
4749
|
+
() => html23`
|
|
4175
4750
|
<button class="${toast.close}" @click="${this.close}">
|
|
4176
4751
|
<w-icon-close-16></w-icon-close-16>
|
|
4177
4752
|
</button>
|
|
@@ -4182,8 +4757,8 @@ var WarpToast = class extends WarpElement13 {
|
|
|
4182
4757
|
}
|
|
4183
4758
|
};
|
|
4184
4759
|
__publicField(WarpToast, "styles", [
|
|
4185
|
-
|
|
4186
|
-
|
|
4760
|
+
WarpElement15.styles,
|
|
4761
|
+
css9`
|
|
4187
4762
|
:host {
|
|
4188
4763
|
display: block;
|
|
4189
4764
|
}
|
|
@@ -4199,143 +4774,11 @@ if (!customElements.get("w-toast")) {
|
|
|
4199
4774
|
customElements.define("w-toast", WarpToast);
|
|
4200
4775
|
}
|
|
4201
4776
|
|
|
4202
|
-
// packages/toast/toast-container.js
|
|
4203
|
-
import { css as css9, html as html22 } from "lit";
|
|
4204
|
-
import WarpElement14 from "@warp-ds/elements-core";
|
|
4205
|
-
import { repeat as repeat2 } from "lit/directives/repeat.js";
|
|
4206
|
-
var WarpToastContainer = class extends WarpElement14 {
|
|
4207
|
-
constructor() {
|
|
4208
|
-
super();
|
|
4209
|
-
this._toasts = /* @__PURE__ */ new Map();
|
|
4210
|
-
}
|
|
4211
|
-
connectedCallback() {
|
|
4212
|
-
super.connectedCallback();
|
|
4213
|
-
this._interval = setInterval(() => {
|
|
4214
|
-
const keep = [];
|
|
4215
|
-
const remove = [];
|
|
4216
|
-
for (const toast3 of this._toasts) {
|
|
4217
|
-
if (Date.now() <= toast3[1].duration)
|
|
4218
|
-
keep.push(toast3);
|
|
4219
|
-
else
|
|
4220
|
-
remove.push(toast3);
|
|
4221
|
-
}
|
|
4222
|
-
const collapseTasks = [];
|
|
4223
|
-
for (const [id] of remove) {
|
|
4224
|
-
const el = this.renderRoot.querySelector(`#${id}`);
|
|
4225
|
-
collapseTasks.push(el.collapse());
|
|
4226
|
-
}
|
|
4227
|
-
Promise.all(collapseTasks).then(() => {
|
|
4228
|
-
if (keep.length != this._toasts.size)
|
|
4229
|
-
this._toasts = new Map(keep);
|
|
4230
|
-
});
|
|
4231
|
-
}, 500);
|
|
4232
|
-
}
|
|
4233
|
-
disconnectedCallback() {
|
|
4234
|
-
super.disconnectedCallback();
|
|
4235
|
-
if (this._interval)
|
|
4236
|
-
clearTimeout(this._interval);
|
|
4237
|
-
}
|
|
4238
|
-
static init() {
|
|
4239
|
-
let el = document.querySelector("w-toast-container");
|
|
4240
|
-
if (!el) {
|
|
4241
|
-
el = document.createElement("w-toast-container");
|
|
4242
|
-
document.body.appendChild(el);
|
|
4243
|
-
}
|
|
4244
|
-
return el;
|
|
4245
|
-
}
|
|
4246
|
-
get _toastsArray() {
|
|
4247
|
-
return Array.from(this._toasts).map(([, toast3]) => toast3);
|
|
4248
|
-
}
|
|
4249
|
-
/**
|
|
4250
|
-
*
|
|
4251
|
-
* @param {String|Number} id
|
|
4252
|
-
* @returns {ToastOptions}
|
|
4253
|
-
*/
|
|
4254
|
-
get(id) {
|
|
4255
|
-
if (!id)
|
|
4256
|
-
throw new Error('undefined "id" given when attempting to retrieve toast');
|
|
4257
|
-
if (typeof id !== "string" && !Number.isInteger(id))
|
|
4258
|
-
throw new Error(
|
|
4259
|
-
'"id" must be number or string when attempting to retrieve toast'
|
|
4260
|
-
);
|
|
4261
|
-
return this._toasts.get(id);
|
|
4262
|
-
}
|
|
4263
|
-
/**
|
|
4264
|
-
*
|
|
4265
|
-
* @param {Object} toast
|
|
4266
|
-
* @returns {WarpToastContainer}
|
|
4267
|
-
*/
|
|
4268
|
-
set(toast3) {
|
|
4269
|
-
if (!toast3.id)
|
|
4270
|
-
throw new Error('invalid or undefined "id" on toast object');
|
|
4271
|
-
const result = this._toasts.set(toast3.id, __spreadProps(__spreadValues({}, toast3), {
|
|
4272
|
-
duration: Date.now() + (toast3.duration || 5e3)
|
|
4273
|
-
}));
|
|
4274
|
-
this._toasts = new Map(Array.from(this._toasts));
|
|
4275
|
-
return result;
|
|
4276
|
-
}
|
|
4277
|
-
/**
|
|
4278
|
-
*
|
|
4279
|
-
* @param {String|Number} id
|
|
4280
|
-
* @returns {ToastOptions | false}
|
|
4281
|
-
*/
|
|
4282
|
-
async del(id) {
|
|
4283
|
-
if (!id)
|
|
4284
|
-
throw new Error('undefined "id" given when attempting to retrieve toast');
|
|
4285
|
-
if (typeof id !== "string" && !Number.isInteger(id))
|
|
4286
|
-
throw new Error(
|
|
4287
|
-
'"id" must be number or string when attempting to retrieve toast'
|
|
4288
|
-
);
|
|
4289
|
-
const el = this.renderRoot.querySelector(`#${id}`);
|
|
4290
|
-
if (!this._toasts.has(id))
|
|
4291
|
-
return false;
|
|
4292
|
-
await el.collapse();
|
|
4293
|
-
const result = this._toasts.delete(id);
|
|
4294
|
-
this._toasts = new Map(Array.from(this._toasts));
|
|
4295
|
-
return result;
|
|
4296
|
-
}
|
|
4297
|
-
render() {
|
|
4298
|
-
return html22`
|
|
4299
|
-
<aside class="${toaster.container}">
|
|
4300
|
-
<div class="${toaster.toaster}" id="w-toast-container-list">
|
|
4301
|
-
${repeat2(
|
|
4302
|
-
this._toastsArray,
|
|
4303
|
-
(toast3) => toast3.id,
|
|
4304
|
-
(toast3) => html22` <w-toast
|
|
4305
|
-
class="${toaster.content}"
|
|
4306
|
-
id="${toast3.id}"
|
|
4307
|
-
type="${toast3.type}"
|
|
4308
|
-
text="${toast3.text}"
|
|
4309
|
-
?canclose=${toast3.canclose}
|
|
4310
|
-
@close=${() => this.del(toast3.id)}
|
|
4311
|
-
>
|
|
4312
|
-
</w-toast>`
|
|
4313
|
-
)}
|
|
4314
|
-
</div>
|
|
4315
|
-
</aside>
|
|
4316
|
-
`;
|
|
4317
|
-
}
|
|
4318
|
-
};
|
|
4319
|
-
__publicField(WarpToastContainer, "styles", [
|
|
4320
|
-
WarpElement14.styles,
|
|
4321
|
-
css9`
|
|
4322
|
-
:host {
|
|
4323
|
-
display: block;
|
|
4324
|
-
}
|
|
4325
|
-
`
|
|
4326
|
-
]);
|
|
4327
|
-
__publicField(WarpToastContainer, "properties", {
|
|
4328
|
-
_toasts: { state: true }
|
|
4329
|
-
});
|
|
4330
|
-
if (!customElements.get("w-toast-container")) {
|
|
4331
|
-
customElements.define("w-toast-container", WarpToastContainer);
|
|
4332
|
-
}
|
|
4333
|
-
|
|
4334
4777
|
// packages/utils/expand-transition.js
|
|
4335
|
-
import { css as css10, html as
|
|
4336
|
-
import
|
|
4778
|
+
import { css as css10, html as html24 } from "lit";
|
|
4779
|
+
import WarpElement16 from "@warp-ds/elements-core";
|
|
4337
4780
|
import { ifDefined as ifDefined7 } from "lit/directives/if-defined.js";
|
|
4338
|
-
var ExpandTransition = class extends
|
|
4781
|
+
var ExpandTransition = class extends WarpElement16 {
|
|
4339
4782
|
constructor() {
|
|
4340
4783
|
super();
|
|
4341
4784
|
this.show = false;
|
|
@@ -4368,8 +4811,8 @@ var ExpandTransition = class extends WarpElement15 {
|
|
|
4368
4811
|
return this != null ? this : null;
|
|
4369
4812
|
}
|
|
4370
4813
|
render() {
|
|
4371
|
-
return
|
|
4372
|
-
${this._removeElement ?
|
|
4814
|
+
return html24`<div aria-hidden=${ifDefined7(!this.show ? "true" : void 0)}>
|
|
4815
|
+
${this._removeElement ? html24`` : html24`<slot></slot>`}
|
|
4373
4816
|
</div>`;
|
|
4374
4817
|
}
|
|
4375
4818
|
};
|
|
@@ -4381,7 +4824,7 @@ __publicField(ExpandTransition, "properties", {
|
|
|
4381
4824
|
_removeElement: { type: Boolean, state: true }
|
|
4382
4825
|
});
|
|
4383
4826
|
__publicField(ExpandTransition, "styles", [
|
|
4384
|
-
|
|
4827
|
+
WarpElement16.styles,
|
|
4385
4828
|
css10`
|
|
4386
4829
|
:host {
|
|
4387
4830
|
display: block;
|
|
@@ -4393,10 +4836,10 @@ if (!customElements.get("w-expand-transition")) {
|
|
|
4393
4836
|
}
|
|
4394
4837
|
|
|
4395
4838
|
// packages/utils/unstyled-heading.js
|
|
4396
|
-
import { html as
|
|
4397
|
-
import
|
|
4839
|
+
import { html as html25 } from "lit";
|
|
4840
|
+
import WarpElement17 from "@warp-ds/elements-core";
|
|
4398
4841
|
import { unsafeHTML as unsafeHTML2 } from "lit/directives/unsafe-html.js";
|
|
4399
|
-
var UnstyledHeading = class extends
|
|
4842
|
+
var UnstyledHeading = class extends WarpElement17 {
|
|
4400
4843
|
get _markup() {
|
|
4401
4844
|
return `<h${this.level}
|
|
4402
4845
|
style="margin: 0; font-weight: unset; font-size: unset; line-height: unset;"
|
|
@@ -4406,13 +4849,13 @@ var UnstyledHeading = class extends WarpElement16 {
|
|
|
4406
4849
|
`;
|
|
4407
4850
|
}
|
|
4408
4851
|
render() {
|
|
4409
|
-
return !this.level ?
|
|
4852
|
+
return !this.level ? html25`<slot></slot>` : unsafeHTML2(this._markup);
|
|
4410
4853
|
}
|
|
4411
4854
|
};
|
|
4412
4855
|
__publicField(UnstyledHeading, "properties", {
|
|
4413
4856
|
level: { type: Number }
|
|
4414
4857
|
});
|
|
4415
|
-
__publicField(UnstyledHeading, "styles", [
|
|
4858
|
+
__publicField(UnstyledHeading, "styles", [WarpElement17.styles]);
|
|
4416
4859
|
if (!customElements.get("w-unstyled-heading")) {
|
|
4417
4860
|
customElements.define("w-unstyled-heading", UnstyledHeading);
|
|
4418
4861
|
}
|
|
@@ -4429,6 +4872,7 @@ export {
|
|
|
4429
4872
|
WarpButton,
|
|
4430
4873
|
WarpCard,
|
|
4431
4874
|
WarpExpandable,
|
|
4875
|
+
WarpPill,
|
|
4432
4876
|
WarpSelect,
|
|
4433
4877
|
WarpTextField,
|
|
4434
4878
|
WarpToast,
|