@warp-ds/elements 2.0.0-next.1 → 2.0.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.js +87 -67
- package/dist/index.js.map +4 -4
- package/dist/packages/attention/index.js +24 -19
- package/dist/packages/attention/index.js.map +4 -4
- package/dist/packages/attention/locales/da/messages.d.mts +1 -0
- package/dist/packages/breadcrumbs/index.js +22 -17
- package/dist/packages/breadcrumbs/index.js.map +4 -4
- package/dist/packages/breadcrumbs/locales/da/messages.d.mts +1 -0
- package/dist/packages/button/index.js +22 -17
- package/dist/packages/button/index.js.map +4 -4
- package/dist/packages/button/locales/da/messages.d.mts +1 -0
- package/dist/packages/i18n.d.ts +4 -4
- package/dist/packages/pill/index.js +22 -17
- package/dist/packages/pill/index.js.map +4 -4
- package/dist/packages/pill/locales/da/messages.d.mts +1 -0
- package/dist/packages/select/index.js +24 -19
- package/dist/packages/select/index.js.map +4 -4
- package/dist/packages/select/locales/da/messages.d.mts +1 -0
- package/dist/packages/toast/index.js +22 -17
- package/dist/packages/toast/index.js.map +4 -4
- package/dist/packages/toast/locales/da/messages.d.mts +1 -0
- package/package.json +1 -1
|
@@ -1313,17 +1313,17 @@ var I18n = class extends EventEmitter {
|
|
|
1313
1313
|
}
|
|
1314
1314
|
this.emit("change");
|
|
1315
1315
|
}
|
|
1316
|
-
_load(locale,
|
|
1316
|
+
_load(locale, messages6) {
|
|
1317
1317
|
const maybeMessages = this._messages[locale];
|
|
1318
1318
|
if (!maybeMessages) {
|
|
1319
|
-
this._messages[locale] =
|
|
1319
|
+
this._messages[locale] = messages6;
|
|
1320
1320
|
} else {
|
|
1321
|
-
Object.assign(maybeMessages,
|
|
1321
|
+
Object.assign(maybeMessages, messages6);
|
|
1322
1322
|
}
|
|
1323
1323
|
}
|
|
1324
|
-
load(localeOrMessages,
|
|
1325
|
-
if (typeof localeOrMessages == "string" && typeof
|
|
1326
|
-
this._load(localeOrMessages,
|
|
1324
|
+
load(localeOrMessages, messages6) {
|
|
1325
|
+
if (typeof localeOrMessages == "string" && typeof messages6 === "object") {
|
|
1326
|
+
this._load(localeOrMessages, messages6);
|
|
1327
1327
|
} else {
|
|
1328
1328
|
Object.entries(localeOrMessages).forEach(
|
|
1329
1329
|
([locale, messages23]) => this._load(locale, messages23)
|
|
@@ -1334,10 +1334,10 @@ var I18n = class extends EventEmitter {
|
|
|
1334
1334
|
/**
|
|
1335
1335
|
* @param options {@link LoadAndActivateOptions}
|
|
1336
1336
|
*/
|
|
1337
|
-
loadAndActivate({ locale, locales, messages:
|
|
1337
|
+
loadAndActivate({ locale, locales, messages: messages6 }) {
|
|
1338
1338
|
this._locale = locale;
|
|
1339
1339
|
this._locales = locales || void 0;
|
|
1340
|
-
this._messages[this._locale] =
|
|
1340
|
+
this._messages[this._locale] = messages6;
|
|
1341
1341
|
this.emit("change");
|
|
1342
1342
|
}
|
|
1343
1343
|
activate(locale, locales) {
|
|
@@ -2959,7 +2959,7 @@ import WarpElement from "@warp-ds/elements-core";
|
|
|
2959
2959
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
2960
2960
|
|
|
2961
2961
|
// packages/i18n.ts
|
|
2962
|
-
var supportedLocales = ["en", "nb", "fi"];
|
|
2962
|
+
var supportedLocales = ["en", "nb", "fi", "da"];
|
|
2963
2963
|
var defaultLocale2 = "en";
|
|
2964
2964
|
var getSupportedLocale = (usedLocale) => {
|
|
2965
2965
|
return supportedLocales.find(
|
|
@@ -2979,17 +2979,19 @@ function detectLocale() {
|
|
|
2979
2979
|
return defaultLocale2;
|
|
2980
2980
|
}
|
|
2981
2981
|
}
|
|
2982
|
-
var getMessages = (locale, enMsg, nbMsg, fiMsg) => {
|
|
2982
|
+
var getMessages = (locale, enMsg, nbMsg, fiMsg, daMsg) => {
|
|
2983
2983
|
if (locale === "nb")
|
|
2984
2984
|
return nbMsg;
|
|
2985
2985
|
if (locale === "fi")
|
|
2986
2986
|
return fiMsg;
|
|
2987
|
+
if (locale === "da")
|
|
2988
|
+
return daMsg;
|
|
2987
2989
|
return enMsg;
|
|
2988
2990
|
};
|
|
2989
|
-
var activateI18n = (enMessages, nbMessages, fiMessages) => {
|
|
2991
|
+
var activateI18n = (enMessages, nbMessages, fiMessages, daMessages) => {
|
|
2990
2992
|
const locale = detectLocale();
|
|
2991
|
-
const
|
|
2992
|
-
i18n.load(locale,
|
|
2993
|
+
const messages6 = getMessages(locale, enMessages, nbMessages, fiMessages, daMessages);
|
|
2994
|
+
i18n.load(locale, messages6);
|
|
2993
2995
|
i18n.activate(locale);
|
|
2994
2996
|
};
|
|
2995
2997
|
|
|
@@ -3021,19 +3023,22 @@ function generateRandomId() {
|
|
|
3021
3023
|
return `m${Math.random().toString(36).slice(2)}`;
|
|
3022
3024
|
}
|
|
3023
3025
|
|
|
3026
|
+
// packages/attention/locales/da/messages.mjs
|
|
3027
|
+
var messages = JSON.parse('{"attention.aria.callout":"En gr\xF8n taleboble der introducerer noget nyt","attention.aria.close":"Luk","attention.aria.highlight":"En opm\xE6rksomhedsskabende taleboble med vigtig information","attention.aria.pointingDown":"peger nedad","attention.aria.pointingLeft":"peger til venstre","attention.aria.pointingRight":"peger til h\xF8jre","attention.aria.pointingUp":"peger opad","attention.aria.popover":"En hvid taleboble med mere information","attention.aria.tooltip":"En sort taleboble med flere oplysninger"}');
|
|
3028
|
+
|
|
3024
3029
|
// packages/attention/locales/en/messages.mjs
|
|
3025
|
-
var
|
|
3030
|
+
var messages2 = JSON.parse('{"attention.aria.callout":"A green speech bubble introducing something new","attention.aria.close":"Close","attention.aria.highlight":"An attention speech bubble with important information","attention.aria.pointingDown":"pointing down","attention.aria.pointingLeft":"pointing left","attention.aria.pointingRight":"pointing right","attention.aria.pointingUp":"pointing up","attention.aria.popover":"A white speech bubble providing additional information","attention.aria.tooltip":"A black speech bubble providing complementary information"}');
|
|
3026
3031
|
|
|
3027
3032
|
// packages/attention/locales/fi/messages.mjs
|
|
3028
|
-
var
|
|
3033
|
+
var messages3 = JSON.parse('{"attention.aria.callout":"Vihre\xE4 puhekupla, joka esittelee jotain uutta","attention.aria.close":"Sulje","attention.aria.highlight":"Puhekupla, joka sis\xE4lt\xE4\xE4 t\xE4rke\xE4\xE4 tietoa","attention.aria.pointingDown":"osoittaa alas","attention.aria.pointingLeft":"osoittaa vasemmalle","attention.aria.pointingRight":"osoittaa oikealle","attention.aria.pointingUp":"osoittaa yl\xF6s","attention.aria.popover":"Valkoinen puhekupla, joka tarjoaa lis\xE4tietoa","attention.aria.tooltip":"Musta puhekupla, joka tarjoaa t\xE4ydent\xE4v\xE4\xE4 tietoa"}');
|
|
3029
3034
|
|
|
3030
3035
|
// packages/attention/locales/nb/messages.mjs
|
|
3031
|
-
var
|
|
3036
|
+
var messages4 = JSON.parse('{"attention.aria.callout":"Gr\xF8nn taleboble som introduserer noe nytt","attention.aria.close":"Lukk","attention.aria.highlight":"En uthevet taleboble med viktig informasjon","attention.aria.pointingDown":"peker ned","attention.aria.pointingLeft":"peker til venstre","attention.aria.pointingRight":"peker til h\xF8yre","attention.aria.pointingUp":"peker opp","attention.aria.popover":"En hvit taleboble som gir tilleggsinformasjon","attention.aria.tooltip":"En svart taleboble som forklarer konteksten"}');
|
|
3032
3037
|
|
|
3033
3038
|
// node_modules/.pnpm/@warp-ds+icons@2.0.1/node_modules/@warp-ds/icons/dist/elements/close-16.js
|
|
3034
3039
|
import { LitElement } from "lit";
|
|
3035
3040
|
import { unsafeStatic, html } from "lit/static-html.js";
|
|
3036
|
-
var
|
|
3041
|
+
var messages5 = JSON.parse('{"icon.title.close":"Kryss"}');
|
|
3037
3042
|
var messages22 = JSON.parse('{"icon.title.close":"Cross"}');
|
|
3038
3043
|
var messages32 = JSON.parse('{"icon.title.close":"Rasti"}');
|
|
3039
3044
|
var supportedLocales2 = ["en", "nb", "fi", "da", "sv"];
|
|
@@ -3110,7 +3115,7 @@ var activateI18n2 = (enMessages, nbMessages, fiMessages) => {
|
|
|
3110
3115
|
i18n.load(locale, messages42);
|
|
3111
3116
|
i18n.activate(locale);
|
|
3112
3117
|
};
|
|
3113
|
-
activateI18n2(messages22,
|
|
3118
|
+
activateI18n2(messages22, messages5, messages32);
|
|
3114
3119
|
var IconClose16 = class extends LitElement {
|
|
3115
3120
|
render() {
|
|
3116
3121
|
const title = i18n.t({ message: `Cross`, id: "icon.title.close", comment: "Title for close icon" });
|
|
@@ -3125,7 +3130,7 @@ if (!customElements.get("w-icon-close-16")) {
|
|
|
3125
3130
|
var WarpAttention = class extends kebabCaseAttributes(WarpElement) {
|
|
3126
3131
|
constructor() {
|
|
3127
3132
|
super();
|
|
3128
|
-
activateI18n(
|
|
3133
|
+
activateI18n(messages2, messages4, messages3, messages);
|
|
3129
3134
|
this.handleDone = this.handleDone.bind(this);
|
|
3130
3135
|
this.show = false;
|
|
3131
3136
|
this.placement = "bottom";
|