@warp-ds/elements 2.0.0-next.2 → 2.0.0-next.4
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/api.js +3 -6
- package/dist/api.js.map +1 -1
- package/dist/index.js +519 -603
- package/dist/index.js.map +4 -4
- package/dist/packages/affix/index.d.ts +13 -6
- package/dist/packages/affix/index.js +66 -113
- package/dist/packages/affix/index.js.map +4 -4
- package/dist/packages/alert/index.js +48 -114
- package/dist/packages/alert/index.js.map +3 -3
- package/dist/packages/attention/index.js +147 -179
- package/dist/packages/attention/index.js.map +4 -4
- package/dist/packages/badge/index.js +27 -77
- package/dist/packages/badge/index.js.map +4 -4
- package/dist/packages/box/index.d.ts +1 -1
- package/dist/packages/box/index.js +26 -68
- package/dist/packages/box/index.js.map +4 -4
- package/dist/packages/breadcrumbs/index.js +42 -103
- package/dist/packages/breadcrumbs/index.js.map +3 -3
- package/dist/packages/broadcast/index.js +2 -6
- package/dist/packages/broadcast/index.js.map +1 -1
- package/dist/packages/button/index.d.ts +6 -0
- package/dist/packages/button/index.js +101 -156
- package/dist/packages/button/index.js.map +3 -3
- package/dist/packages/card/index.d.ts +5 -5
- package/dist/packages/card/index.js +1462 -96
- package/dist/packages/card/index.js.map +4 -4
- package/dist/packages/card/locales/da/messages.d.mts +1 -0
- package/dist/packages/card/locales/en/messages.d.mts +1 -0
- package/dist/packages/card/locales/fi/messages.d.mts +1 -0
- package/dist/packages/card/locales/nb/messages.d.mts +1 -0
- package/dist/packages/expandable/index.d.ts +1 -6
- package/dist/packages/expandable/index.js +104 -135
- package/dist/packages/expandable/index.js.map +4 -4
- package/dist/packages/modal/index.js +51 -119
- package/dist/packages/modal/index.js.map +3 -3
- package/dist/packages/modal/modal-header.d.ts +1 -1
- package/dist/packages/modal/modal-main.d.ts +3 -3
- package/dist/packages/pill/index.js +53 -119
- package/dist/packages/pill/index.js.map +3 -3
- package/dist/packages/select/index.d.ts +9 -0
- package/dist/packages/select/index.js +90 -155
- package/dist/packages/select/index.js.map +3 -3
- package/dist/packages/textfield/index.d.ts +9 -5
- package/dist/packages/textfield/index.js +54 -89
- package/dist/packages/textfield/index.js.map +4 -4
- package/dist/packages/toast/api.d.ts +1 -1
- package/dist/packages/toast/index.js +118 -195
- package/dist/packages/toast/index.js.map +4 -4
- package/dist/packages/toast/toast-container.d.ts +1 -1
- package/dist/packages/toast/toast.d.ts +1 -2
- package/dist/packages/utils/index.d.ts +1 -1
- package/dist/packages/utils/unstyled-heading.d.ts +1 -1
- package/package.json +29 -30
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
-
var __publicField = (obj, key, value) =>
|
|
4
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
-
return value;
|
|
6
|
-
};
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
7
4
|
|
|
8
5
|
// packages/broadcast/component.js
|
|
9
6
|
import { html } from "lit";
|
|
@@ -64,8 +61,7 @@ __publicField(WarpBroadcast, "properties", {
|
|
|
64
61
|
_messages: {
|
|
65
62
|
state: true,
|
|
66
63
|
hasChanged(newVal, oldVal) {
|
|
67
|
-
if (!oldVal || oldVal.length === 0)
|
|
68
|
-
return true;
|
|
64
|
+
if (!oldVal || oldVal.length === 0) return true;
|
|
69
65
|
const newIds = newVal.map(({ id }) => id).sort();
|
|
70
66
|
const oldIds = oldVal.map(({ id }) => id).sort();
|
|
71
67
|
return JSON.stringify(newIds) !== JSON.stringify(oldIds);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../packages/broadcast/component.js", "../../../packages/utils/window-exists.js", "../../../packages/broadcast/index.js"],
|
|
4
4
|
"sourcesContent": ["import { html } from 'lit';\n\nimport WarpElement from '@warp-ds/elements-core';\nimport { repeat } from 'lit/directives/repeat.js';\n\nimport { windowExists } from '../utils/window-exists';\n\nexport class WarpBroadcast extends WarpElement {\n static properties = {\n _messages: {\n state: true,\n hasChanged(newVal, oldVal) {\n if (!oldVal || oldVal.length === 0) return true;\n const newIds = newVal.map(({ id }) => id).sort();\n const oldIds = oldVal.map(({ id }) => id).sort();\n return JSON.stringify(newIds) !== JSON.stringify(oldIds);\n },\n },\n _hiddenMessageIds: {\n state: true,\n type: Array,\n },\n interval: { type: Number, attribute: true, reflect: true },\n url: { type: String, attribute: true, reflect: true },\n api: { type: String, attribute: true, reflect: true },\n };\n\n static styles = [WarpElement.styles];\n\n constructor() {\n super();\n this._messages = [];\n this.interval = 30000;\n this._hiddenMessageIds = [];\n this.url = windowExists ? window.location.href : '';\n }\n\n async connectedCallback() {\n super.connectedCallback();\n if (!this.api) {\n console.error('Broadcast \"api\" attribute invalid or undefined');\n return;\n }\n if (windowExists) {\n await this._fetchMessage();\n setInterval(() => this._fetchMessage(), this.interval);\n }\n }\n\n async _fetchMessage() {\n const url = `${this.api}?path=${this.url}`;\n try {\n const res = await (await fetch(url)).json();\n this._messages = res.length ? res : [];\n } catch (err) {\n console.error(`failed to fetch broadcasts from given url (${url})`, err);\n }\n }\n\n async _del(id) {\n const el = this.renderRoot.querySelector(`#broadcast-${id}`);\n await el.collapse();\n this._hiddenMessageIds = [...new Set([...this._hiddenMessageIds, id])];\n }\n\n render() {\n const messages = this._messages.filter((item) => !this._hiddenMessageIds.includes(item.id));\n\n return html`\n <aside class=${`${messages.length === 0 ? 'hidden' : 'mb-16'}`}>\n ${repeat(\n messages,\n ({ id }) => `broadcast-${id}`,\n ({ id, message }) =>\n html`<w-toast id=\"broadcast-${id}\" type=\"warning\" text=\"${message}\" canclose @close=${() => this._del(id)}> </w-toast>`,\n )}\n </aside>\n `;\n }\n}\n", "export const windowExists = typeof window !== 'undefined';\n", "import { WarpBroadcast } from './component';\n\nif (!customElements.get('w-broadcast')) {\n customElements.define('w-broadcast', WarpBroadcast);\n}\n\nexport { WarpBroadcast };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;AAAA,SAAS,YAAY;AAErB,OAAO,iBAAiB;AACxB,SAAS,cAAc;;;ACHhB,IAAM,eAAe,OAAO,WAAW;;;ADOvC,IAAM,gBAAN,cAA4B,YAAY;AAAA,EAsB7C,cAAc;AACZ,UAAM;AACN,SAAK,YAAY,CAAC;AAClB,SAAK,WAAW;AAChB,SAAK,oBAAoB,CAAC;AAC1B,SAAK,MAAM,eAAe,OAAO,SAAS,OAAO;AAAA,EACnD;AAAA,EAEA,MAAM,oBAAoB;AACxB,UAAM,kBAAkB;AACxB,QAAI,CAAC,KAAK,KAAK;AACb,cAAQ,MAAM,gDAAgD;AAC9D;AAAA,IACF;AACA,QAAI,cAAc;AAChB,YAAM,KAAK,cAAc;AACzB,kBAAY,MAAM,KAAK,cAAc,GAAG,KAAK,QAAQ;AAAA,IACvD;AAAA,EACF;AAAA,EAEA,MAAM,gBAAgB;AACpB,UAAM,MAAM,GAAG,KAAK,GAAG,SAAS,KAAK,GAAG;AACxC,QAAI;AACF,YAAM,MAAM,OAAO,MAAM,MAAM,GAAG,GAAG,KAAK;AAC1C,WAAK,YAAY,IAAI,SAAS,MAAM,CAAC;AAAA,IACvC,SAAS,KAAK;AACZ,cAAQ,MAAM,8CAA8C,GAAG,KAAK,GAAG;AAAA,IACzE;AAAA,EACF;AAAA,EAEA,MAAM,KAAK,IAAI;AACb,UAAM,KAAK,KAAK,WAAW,cAAc,cAAc,EAAE,EAAE;AAC3D,UAAM,GAAG,SAAS;AAClB,SAAK,oBAAoB,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,KAAK,mBAAmB,EAAE,CAAC,CAAC;AAAA,EACvE;AAAA,EAEA,SAAS;AACP,UAAM,WAAW,KAAK,UAAU,OAAO,CAAC,SAAS,CAAC,KAAK,kBAAkB,SAAS,KAAK,EAAE,CAAC;AAE1F,WAAO;AAAA,qBACU,GAAG,SAAS,WAAW,IAAI,WAAW,OAAO,EAAE;AAAA,UAC1D;AAAA,MACA;AAAA,MACA,CAAC,EAAE,GAAG,MAAM,aAAa,EAAE;AAAA,MAC3B,CAAC,EAAE,IAAI,QAAQ,MACb,8BAA8B,EAAE,0BAA0B,OAAO,qBAAqB,MAAM,KAAK,KAAK,EAAE,CAAC;AAAA,IAC7G,CAAC;AAAA;AAAA;AAAA,EAGP;AACF;AAvEE,cADW,eACJ,cAAa;AAAA,EAClB,WAAW;AAAA,IACT,OAAO;AAAA,IACP,WAAW,QAAQ,QAAQ;AACzB,UAAI,CAAC,UAAU,OAAO,WAAW,EAAG,QAAO;AAC3C,YAAM,SAAS,OAAO,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,EAAE,KAAK;AAC/C,YAAM,SAAS,OAAO,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,EAAE,KAAK;AAC/C,aAAO,KAAK,UAAU,MAAM,MAAM,KAAK,UAAU,MAAM;AAAA,IACzD;AAAA,EACF;AAAA,EACA,mBAAmB;AAAA,IACjB,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,UAAU,EAAE,MAAM,QAAQ,WAAW,MAAM,SAAS,KAAK;AAAA,EACzD,KAAK,EAAE,MAAM,QAAQ,WAAW,MAAM,SAAS,KAAK;AAAA,EACpD,KAAK,EAAE,MAAM,QAAQ,WAAW,MAAM,SAAS,KAAK;AACtD;AAEA,cApBW,eAoBJ,UAAS,CAAC,YAAY,MAAM;;;AEzBrC,IAAI,CAAC,eAAe,IAAI,aAAa,GAAG;AACtC,iBAAe,OAAO,eAAe,aAAa;AACpD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -58,6 +58,12 @@ export class WarpButton extends WarpButton_base {
|
|
|
58
58
|
ariaValueTextLoading: string;
|
|
59
59
|
connectedCallback(): void;
|
|
60
60
|
firstUpdated(): void;
|
|
61
|
+
get _primaryClasses(): string[];
|
|
62
|
+
get _secondaryClasses(): string[];
|
|
63
|
+
get _utilityClasses(): string[];
|
|
64
|
+
get _negativeClasses(): string[];
|
|
65
|
+
get _pillClasses(): string[];
|
|
66
|
+
get _linkClasses(): string[];
|
|
61
67
|
get _classes(): string;
|
|
62
68
|
render(): import("lit").TemplateResult<1>;
|
|
63
69
|
}
|
|
@@ -52,10 +52,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
52
52
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
53
53
|
mod
|
|
54
54
|
));
|
|
55
|
-
var __publicField = (obj, key, value) =>
|
|
56
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
57
|
-
return value;
|
|
58
|
-
};
|
|
55
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
59
56
|
|
|
60
57
|
// node_modules/.pnpm/unraw@3.0.0/node_modules/unraw/dist/errors.js
|
|
61
58
|
var require_errors = __commonJS({
|
|
@@ -228,8 +225,7 @@ var require_moo = __commonJS({
|
|
|
228
225
|
return "(" + s + ")";
|
|
229
226
|
}
|
|
230
227
|
function reUnion(regexps) {
|
|
231
|
-
if (!regexps.length)
|
|
232
|
-
return "(?!)";
|
|
228
|
+
if (!regexps.length) return "(?!)";
|
|
233
229
|
var source = regexps.map(function(s) {
|
|
234
230
|
return "(?:" + s + ")";
|
|
235
231
|
}).join("|");
|
|
@@ -239,14 +235,10 @@ var require_moo = __commonJS({
|
|
|
239
235
|
if (typeof obj === "string") {
|
|
240
236
|
return "(?:" + reEscape(obj) + ")";
|
|
241
237
|
} else if (isRegExp(obj)) {
|
|
242
|
-
if (obj.ignoreCase)
|
|
243
|
-
|
|
244
|
-
if (obj.
|
|
245
|
-
|
|
246
|
-
if (obj.sticky)
|
|
247
|
-
throw new Error("RegExp /y flag is implied");
|
|
248
|
-
if (obj.multiline)
|
|
249
|
-
throw new Error("RegExp /m flag is implied");
|
|
238
|
+
if (obj.ignoreCase) throw new Error("RegExp /i flag not allowed");
|
|
239
|
+
if (obj.global) throw new Error("RegExp /g flag is implied");
|
|
240
|
+
if (obj.sticky) throw new Error("RegExp /y flag is implied");
|
|
241
|
+
if (obj.multiline) throw new Error("RegExp /m flag is implied");
|
|
250
242
|
return obj.source;
|
|
251
243
|
} else {
|
|
252
244
|
throw new Error("Not a pattern: " + obj);
|
|
@@ -295,16 +287,14 @@ var require_moo = __commonJS({
|
|
|
295
287
|
var match = [];
|
|
296
288
|
rules.forEach(function(rule) {
|
|
297
289
|
if (isObject(rule)) {
|
|
298
|
-
if (match.length)
|
|
299
|
-
result.push(ruleOptions(key, match));
|
|
290
|
+
if (match.length) result.push(ruleOptions(key, match));
|
|
300
291
|
result.push(ruleOptions(key, rule));
|
|
301
292
|
match = [];
|
|
302
293
|
} else {
|
|
303
294
|
match.push(rule);
|
|
304
295
|
}
|
|
305
296
|
});
|
|
306
|
-
if (match.length)
|
|
307
|
-
result.push(ruleOptions(key, match));
|
|
297
|
+
if (match.length) result.push(ruleOptions(key, match));
|
|
308
298
|
}
|
|
309
299
|
return result;
|
|
310
300
|
}
|
|
@@ -439,8 +429,7 @@ var require_moo = __commonJS({
|
|
|
439
429
|
var fallbackRule = errorRule && errorRule.fallback;
|
|
440
430
|
var flags = hasSticky && !fallbackRule ? "ym" : "gm";
|
|
441
431
|
var suffix2 = hasSticky || fallbackRule ? "" : "|";
|
|
442
|
-
if (unicodeFlag === true)
|
|
443
|
-
flags += "u";
|
|
432
|
+
if (unicodeFlag === true) flags += "u";
|
|
444
433
|
var combined = new RegExp(reUnion(parts) + suffix2, flags);
|
|
445
434
|
return { regexp: combined, groups, fast, error: errorRule || defaultErrorRule };
|
|
446
435
|
}
|
|
@@ -461,8 +450,7 @@ var require_moo = __commonJS({
|
|
|
461
450
|
var all = states.$all ? toRules(states.$all) : [];
|
|
462
451
|
delete states.$all;
|
|
463
452
|
var keys = Object.getOwnPropertyNames(states);
|
|
464
|
-
if (!start)
|
|
465
|
-
start = keys[0];
|
|
453
|
+
if (!start) start = keys[0];
|
|
466
454
|
var ruleMap = /* @__PURE__ */ Object.create(null);
|
|
467
455
|
for (var i = 0; i < keys.length; i++) {
|
|
468
456
|
var key = keys[i];
|
|
@@ -474,8 +462,7 @@ var require_moo = __commonJS({
|
|
|
474
462
|
var included = /* @__PURE__ */ Object.create(null);
|
|
475
463
|
for (var j = 0; j < rules.length; j++) {
|
|
476
464
|
var rule = rules[j];
|
|
477
|
-
if (!rule.include)
|
|
478
|
-
continue;
|
|
465
|
+
if (!rule.include) continue;
|
|
479
466
|
var splice = [j, 1];
|
|
480
467
|
if (rule.include !== key && !included[rule.include]) {
|
|
481
468
|
included[rule.include] = true;
|
|
@@ -485,8 +472,7 @@ var require_moo = __commonJS({
|
|
|
485
472
|
}
|
|
486
473
|
for (var k = 0; k < newRules.length; k++) {
|
|
487
474
|
var newRule = newRules[k];
|
|
488
|
-
if (rules.indexOf(newRule) !== -1)
|
|
489
|
-
continue;
|
|
475
|
+
if (rules.indexOf(newRule) !== -1) continue;
|
|
490
476
|
splice.push(newRule);
|
|
491
477
|
}
|
|
492
478
|
}
|
|
@@ -567,8 +553,7 @@ var require_moo = __commonJS({
|
|
|
567
553
|
};
|
|
568
554
|
};
|
|
569
555
|
Lexer.prototype.setState = function(state) {
|
|
570
|
-
if (!state || this.state === state)
|
|
571
|
-
return;
|
|
556
|
+
if (!state || this.state === state) return;
|
|
572
557
|
this.state = state;
|
|
573
558
|
var info = this.states[state];
|
|
574
559
|
this.groups = info.groups;
|
|
@@ -672,12 +657,9 @@ var require_moo = __commonJS({
|
|
|
672
657
|
var err = new Error(this.formatError(token, "invalid syntax"));
|
|
673
658
|
throw err;
|
|
674
659
|
}
|
|
675
|
-
if (group.pop)
|
|
676
|
-
|
|
677
|
-
else if (group.
|
|
678
|
-
this.pushState(group.push);
|
|
679
|
-
else if (group.next)
|
|
680
|
-
this.setState(group.next);
|
|
660
|
+
if (group.pop) this.popState();
|
|
661
|
+
else if (group.push) this.pushState(group.push);
|
|
662
|
+
else if (group.next) this.setState(group.next);
|
|
681
663
|
return token;
|
|
682
664
|
};
|
|
683
665
|
if (typeof Symbol !== "undefined" && Symbol.iterator) {
|
|
@@ -1032,8 +1014,7 @@ import { html } from "lit";
|
|
|
1032
1014
|
|
|
1033
1015
|
// node_modules/.pnpm/@chbphone55+classnames@2.0.0/node_modules/@chbphone55/classnames/dist/index.m.js
|
|
1034
1016
|
var r = function() {
|
|
1035
|
-
for (var t = [], n = arguments.length; n--; )
|
|
1036
|
-
t[n] = arguments[n];
|
|
1017
|
+
for (var t = [], n = arguments.length; n--; ) t[n] = arguments[n];
|
|
1037
1018
|
return t.reduce(function(t2, n2) {
|
|
1038
1019
|
return t2.concat("string" == typeof n2 ? n2 : Array.isArray(n2) ? r.apply(void 0, n2) : "object" == typeof n2 && n2 ? Object.keys(n2).map(function(r2) {
|
|
1039
1020
|
return n2[r2] ? r2 : "";
|
|
@@ -1041,10 +1022,10 @@ var r = function() {
|
|
|
1041
1022
|
}, []).join(" ");
|
|
1042
1023
|
};
|
|
1043
1024
|
|
|
1044
|
-
// node_modules/.pnpm/@lingui+core@4.
|
|
1025
|
+
// node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
|
|
1045
1026
|
var import_unraw = __toESM(require_dist(), 1);
|
|
1046
1027
|
|
|
1047
|
-
// node_modules/.pnpm/@lingui+message-utils@4.
|
|
1028
|
+
// node_modules/.pnpm/@lingui+message-utils@4.11.2/node_modules/@lingui/message-utils/dist/compileMessage.mjs
|
|
1048
1029
|
var import_parser = __toESM(require_parser(), 1);
|
|
1049
1030
|
function processTokens(tokens, mapText) {
|
|
1050
1031
|
if (!tokens.filter((token) => token.type !== "content").length) {
|
|
@@ -1068,11 +1049,9 @@ function processTokens(tokens, mapText) {
|
|
|
1068
1049
|
}
|
|
1069
1050
|
const offset = token.pluralOffset;
|
|
1070
1051
|
const formatProps = {};
|
|
1071
|
-
token.cases.forEach((
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
mapText
|
|
1075
|
-
);
|
|
1052
|
+
token.cases.forEach(({ key, tokens: tokens2 }) => {
|
|
1053
|
+
const prop = key[0] === "=" ? key.slice(1) : key;
|
|
1054
|
+
formatProps[prop] = processTokens(tokens2, mapText);
|
|
1076
1055
|
});
|
|
1077
1056
|
return [
|
|
1078
1057
|
token.arg,
|
|
@@ -1094,7 +1073,7 @@ Message: ${message}`);
|
|
|
1094
1073
|
}
|
|
1095
1074
|
}
|
|
1096
1075
|
|
|
1097
|
-
// node_modules/.pnpm/@lingui+core@4.
|
|
1076
|
+
// node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
|
|
1098
1077
|
var isString = (s) => typeof s === "string";
|
|
1099
1078
|
var isFunction = (f) => typeof f === "function";
|
|
1100
1079
|
var cache = /* @__PURE__ */ new Map();
|
|
@@ -1180,11 +1159,11 @@ var selectFormatter = (value, rules) => {
|
|
|
1180
1159
|
function interpolate(translation, locale, locales) {
|
|
1181
1160
|
return (values = {}, formats) => {
|
|
1182
1161
|
const formatters = getDefaultFormats(locale, locales, formats);
|
|
1183
|
-
const formatMessage = (tokens) => {
|
|
1162
|
+
const formatMessage = (tokens, replaceOctothorpe = false) => {
|
|
1184
1163
|
if (!Array.isArray(tokens))
|
|
1185
1164
|
return tokens;
|
|
1186
1165
|
return tokens.reduce((message, token) => {
|
|
1187
|
-
if (token === "#") {
|
|
1166
|
+
if (token === "#" && replaceOctothorpe) {
|
|
1188
1167
|
return message + OCTOTHORPE_PH;
|
|
1189
1168
|
}
|
|
1190
1169
|
if (isString(token)) {
|
|
@@ -1195,7 +1174,10 @@ function interpolate(translation, locale, locales) {
|
|
|
1195
1174
|
if (type === "plural" || type === "selectordinal" || type === "select") {
|
|
1196
1175
|
Object.entries(format).forEach(
|
|
1197
1176
|
([key, value2]) => {
|
|
1198
|
-
interpolatedFormat[key] = formatMessage(
|
|
1177
|
+
interpolatedFormat[key] = formatMessage(
|
|
1178
|
+
value2,
|
|
1179
|
+
type === "plural" || type === "selectordinal"
|
|
1180
|
+
);
|
|
1199
1181
|
}
|
|
1200
1182
|
);
|
|
1201
1183
|
} else {
|
|
@@ -1363,6 +1345,9 @@ var I18n = class extends EventEmitter {
|
|
|
1363
1345
|
}
|
|
1364
1346
|
_(id, values, options) {
|
|
1365
1347
|
let message = options == null ? void 0 : options.message;
|
|
1348
|
+
if (!id) {
|
|
1349
|
+
id = "";
|
|
1350
|
+
}
|
|
1366
1351
|
if (!isString(id)) {
|
|
1367
1352
|
values = id.values || values;
|
|
1368
1353
|
message = id.message;
|
|
@@ -1403,41 +1388,7 @@ function setupI18n(params = {}) {
|
|
|
1403
1388
|
}
|
|
1404
1389
|
var i18n = setupI18n();
|
|
1405
1390
|
|
|
1406
|
-
// node_modules/.pnpm/@warp-ds+css@2.0.
|
|
1407
|
-
var box = {
|
|
1408
|
-
box: "group block relative break-words last-child:mb-0 p-16 rounded-8",
|
|
1409
|
-
// Relative here enables w-clickable
|
|
1410
|
-
bleed: "-mx-16 sm:mx-0 rounded-l-0 rounded-r-0 sm:rounded-8",
|
|
1411
|
-
// We target L and R to override the default rounded-8
|
|
1412
|
-
info: "s-bg-info-subtle",
|
|
1413
|
-
neutral: "s-surface-sunken",
|
|
1414
|
-
bordered: "border-2 s-border s-bg"
|
|
1415
|
-
};
|
|
1416
|
-
var buttonReset = "focus:outline-none appearance-none cursor-pointer bg-transparent border-0 m-0 p-0 inline-block";
|
|
1417
|
-
var expandable = {
|
|
1418
|
-
expandable: "will-change-height",
|
|
1419
|
-
expandableTitle: "font-bold s-text",
|
|
1420
|
-
expandableBox: "s-surface-sunken hover:s-bg-hover active:s-bg-active py-0 px-0 " + box.box,
|
|
1421
|
-
expandableInfo: "s-bg-info-subtle! hover:s-bg-info-subtle-hover!",
|
|
1422
|
-
expandableBleed: box.bleed,
|
|
1423
|
-
chevron: "inline-block align-middle s-icon",
|
|
1424
|
-
chevronNonBox: "ml-8",
|
|
1425
|
-
chevronBox: "",
|
|
1426
|
-
chevronTransform: "transform transition-transform transform-gpu ease-in-out",
|
|
1427
|
-
chevronExpand: "-rotate-180",
|
|
1428
|
-
chevronCollapse: "rotate-180",
|
|
1429
|
-
elementsTransformChevronDownPart: "part-[w-icon-chevron-down-16-part]:transform part-[w-icon-chevron-down-16-part]:transition-transform part-[w-icon-chevron-down-16-part]:transform-gpu part-[w-icon-chevron-down-16-part]:ease-in-out",
|
|
1430
|
-
elementsChevronDownExpandPart: "part-[w-icon-chevron-down-16-part]:-rotate-180",
|
|
1431
|
-
elementsTransformChevronUpPart: "part-[w-icon-chevron-up-16-part]:transform part-[w-icon-chevron-up-16-part]:transition-transform part-[w-icon-chevron-up-16-part]:transform-gpu part-[w-icon-chevron-up-16-part]:ease-in-out",
|
|
1432
|
-
elementsChevronUpCollapsePart: "part-[w-icon-chevron-up-16-part]:rotate-180",
|
|
1433
|
-
expansion: "overflow-hidden",
|
|
1434
|
-
expansionNotExpanded: "h-0 invisible",
|
|
1435
|
-
button: buttonReset + " hover:underline focus-visible:underline",
|
|
1436
|
-
buttonBox: "w-full text-left relative inline-flex items-center justify-between " + box.box,
|
|
1437
|
-
paddingTop: "pt-0",
|
|
1438
|
-
title: "flex w-full justify-between items-center",
|
|
1439
|
-
titleType: "h4"
|
|
1440
|
-
};
|
|
1391
|
+
// node_modules/.pnpm/@warp-ds+css@2.0.0_@warp-ds+uno@2.0.0_unocss@0.62.0_postcss@8.4.41_rollup@4.20.0_vite@5.3.3_@_vyiy5vwpqfzwy5hpmfkwp3zmle/node_modules/@warp-ds/css/component-classes/index.js
|
|
1441
1392
|
var buttonDefaultStyling = "font-bold focusable justify-center transition-colors ease-in-out";
|
|
1442
1393
|
var buttonColors = {
|
|
1443
1394
|
primary: "s-text-inverted bg-[--w-color-button-primary-background] hover:bg-[--w-color-button-primary-background-hover] active:bg-[--w-color-button-primary-background-active]",
|
|
@@ -1555,7 +1506,7 @@ var button = {
|
|
|
1555
1506
|
};
|
|
1556
1507
|
var modal = {
|
|
1557
1508
|
backdrop: "fixed inset-0 flex sm:place-content-center sm:place-items-center items-end z-30 [--w-modal-max-height:80%] [--w-modal-width:640px] bg-[--w-black/25]",
|
|
1558
|
-
|
|
1509
|
+
base: "pb-safe-[32] shadow-m max-h-[--w-modal-max-height] min-h-[--w-modal-min-height] w-[--w-modal-width] h-[--w-modal-height] relative transition-300 ease-in-out backface-hidden will-change-height rounded-8 mx-0 sm:mx-16 bg-[--w-s-color-surface-elevated-100] flex flex-col overflow-hidden outline-none space-y-16 pt-8 sm:pt-32 sm:pb-32 rounded-b-0 sm:rounded-b-8",
|
|
1559
1510
|
content: "block overflow-y-auto overflow-x-hidden last-child:mb-0 grow shrink px-16 sm:px-32 relative",
|
|
1560
1511
|
footer: "flex justify-end shrink-0 px-16 sm:px-32",
|
|
1561
1512
|
transitionTitle: "transition-all duration-300",
|
|
@@ -1569,19 +1520,15 @@ var modal = {
|
|
|
1569
1520
|
titleButtonIcon: "h-16 w-16 sm:h-24 sm:w-24",
|
|
1570
1521
|
titleButtonIconRotated: "transform rotate-90"
|
|
1571
1522
|
};
|
|
1572
|
-
var
|
|
1573
|
-
label: "antialiased block relative text-s font-bold pb-4 cursor-pointer s-text",
|
|
1574
|
-
optional: "pl-8 font-normal text-s s-text-subtle"
|
|
1575
|
-
};
|
|
1576
|
-
var prefixSuffixWrapperBase = "absolute top-0 bottom-0 flex justify-center items-center focusable rounded-4 focus:[--w-outline-offset:-2px] bg-transparent ";
|
|
1523
|
+
var prefixSuffixWrapper = "absolute top-0 bottom-0 flex justify-center items-center focusable rounded-4 focus:[--w-outline-offset:-2px] bg-transparent ";
|
|
1577
1524
|
var suffix = {
|
|
1578
|
-
wrapper:
|
|
1525
|
+
wrapper: prefixSuffixWrapper + "right-0",
|
|
1579
1526
|
wrapperWithLabel: "w-max pr-12",
|
|
1580
1527
|
wrapperWithIcon: "w-40",
|
|
1581
1528
|
label: "antialiased block relative cursor-default pb-0 font-bold text-xs s-text"
|
|
1582
1529
|
};
|
|
1583
1530
|
var prefix = {
|
|
1584
|
-
wrapper:
|
|
1531
|
+
wrapper: prefixSuffixWrapper + "left-0",
|
|
1585
1532
|
wrapperWithLabel: "w-max pl-12",
|
|
1586
1533
|
wrapperWithIcon: "w-40",
|
|
1587
1534
|
label: "antialiased block relative cursor-default pb-0 font-bold text-xs s-text"
|
|
@@ -1638,15 +1585,9 @@ var deadToggle = {
|
|
|
1638
1585
|
wrapper: `${toggle.wrapper} h-20 w-20 pointer-events-none`,
|
|
1639
1586
|
input: `${toggle.input} hidden`,
|
|
1640
1587
|
inputVue: "hidden",
|
|
1588
|
+
labelVue: "-mt-2",
|
|
1641
1589
|
labelRadio: `${toggle.label} ${toggle.labelBefore} ${toggle.radio}`,
|
|
1642
|
-
labelCheckbox: `${toggle.label} ${toggle.labelBefore} ${toggle.checkbox}
|
|
1643
|
-
labelVue: "-mt-2"
|
|
1644
|
-
};
|
|
1645
|
-
var clickable = {
|
|
1646
|
-
toggle: "absolute inset-0 h-full w-full appearance-none cursor-pointer focusable focusable-inset",
|
|
1647
|
-
label: `px-12 ${label.label} py-8! cursor-pointer focusable focusable-inset`,
|
|
1648
|
-
buttonOrLink: "bg-transparent focusable",
|
|
1649
|
-
buttonOrLinkStretch: "inset-0 absolute"
|
|
1590
|
+
labelCheckbox: `${toggle.label} ${toggle.labelBefore} ${toggle.checkbox}`
|
|
1650
1591
|
};
|
|
1651
1592
|
var attention = {
|
|
1652
1593
|
base: "border-2 relative flex items-start",
|
|
@@ -1701,12 +1642,9 @@ function detectLocale() {
|
|
|
1701
1642
|
}
|
|
1702
1643
|
}
|
|
1703
1644
|
var getMessages = (locale, enMsg, nbMsg, fiMsg, daMsg) => {
|
|
1704
|
-
if (locale === "nb")
|
|
1705
|
-
|
|
1706
|
-
if (locale === "
|
|
1707
|
-
return fiMsg;
|
|
1708
|
-
if (locale === "da")
|
|
1709
|
-
return daMsg;
|
|
1645
|
+
if (locale === "nb") return nbMsg;
|
|
1646
|
+
if (locale === "fi") return fiMsg;
|
|
1647
|
+
if (locale === "da") return daMsg;
|
|
1710
1648
|
return enMsg;
|
|
1711
1649
|
};
|
|
1712
1650
|
var activateI18n = (enMessages, nbMessages, fiMessages, daMessages) => {
|
|
@@ -1770,59 +1708,66 @@ ${buttonTypes2.join(", ")}.`);
|
|
|
1770
1708
|
setTimeout(() => this.focus(), 0);
|
|
1771
1709
|
}
|
|
1772
1710
|
}
|
|
1711
|
+
get _primaryClasses() {
|
|
1712
|
+
return [
|
|
1713
|
+
!this.small && !this.quiet && !this.loading && button.primary,
|
|
1714
|
+
this.small && !this.quiet && !this.loading && button.primarySmall,
|
|
1715
|
+
this.small && this.quiet && !this.loading && button.primarySmallQuiet,
|
|
1716
|
+
this.small && this.loading && (this.quiet ? button.primarySmallQuietLoading : button.primarySmallLoading),
|
|
1717
|
+
!this.small && this.quiet && !this.loading && button.primaryQuiet,
|
|
1718
|
+
!this.small && this.loading && (this.quiet ? button.primaryQuietLoading : button.primaryLoading)
|
|
1719
|
+
];
|
|
1720
|
+
}
|
|
1721
|
+
get _secondaryClasses() {
|
|
1722
|
+
return [
|
|
1723
|
+
!this.small && !this.quiet && !this.loading && button.secondary,
|
|
1724
|
+
this.small && !this.quiet && !this.loading && button.secondarySmall,
|
|
1725
|
+
this.small && this.loading && (this.quiet ? button.secondarySmallQuietLoading : button.secondarySmallLoading),
|
|
1726
|
+
this.small && this.quiet && !this.loading && button.secondarySmallQuiet,
|
|
1727
|
+
!this.small && this.quiet && !this.loading && button.secondaryQuiet,
|
|
1728
|
+
!this.small && this.loading && (this.quiet ? button.secondaryQuietLoading : button.secondaryLoading)
|
|
1729
|
+
];
|
|
1730
|
+
}
|
|
1731
|
+
get _utilityClasses() {
|
|
1732
|
+
return [
|
|
1733
|
+
!this.small && !this.quiet && !this.loading && button.utility,
|
|
1734
|
+
this.small && !this.quiet && !this.loading && button.utilitySmall,
|
|
1735
|
+
this.small && this.quiet && !this.loading && button.utilitySmallQuiet,
|
|
1736
|
+
this.small && this.loading && (this.quiet ? button.utilitySmallQuietLoading : button.utilitySmallLoading),
|
|
1737
|
+
!this.small && this.quiet && !this.loading && button.utilityQuiet,
|
|
1738
|
+
!this.small && this.loading && (this.quiet ? button.utilityQuietLoading : button.utilityLoading)
|
|
1739
|
+
];
|
|
1740
|
+
}
|
|
1741
|
+
get _negativeClasses() {
|
|
1742
|
+
return [
|
|
1743
|
+
!this.small && !this.quiet && !this.loading && button.negative,
|
|
1744
|
+
this.small && !this.quiet && !this.loading && button.negativeSmall,
|
|
1745
|
+
this.small && this.quiet && !this.loading && button.negativeSmallQuiet,
|
|
1746
|
+
this.small && this.loading && (this.quiet ? button.negativeSmallQuietLoading : button.negativeSmallLoading),
|
|
1747
|
+
!this.small && this.quiet && !this.loading && button.negativeQuiet,
|
|
1748
|
+
!this.small && this.loading && (this.quiet ? button.negativeQuietLoading : button.negativeLoading)
|
|
1749
|
+
];
|
|
1750
|
+
}
|
|
1751
|
+
get _pillClasses() {
|
|
1752
|
+
return [
|
|
1753
|
+
!this.loading && (this.small ? button.pillSmall : button.pill),
|
|
1754
|
+
this.loading && (this.small ? button.pillSmallLoading : button.pillLoading)
|
|
1755
|
+
];
|
|
1756
|
+
}
|
|
1757
|
+
get _linkClasses() {
|
|
1758
|
+
return [this.small ? button.linkSmall : button.link];
|
|
1759
|
+
}
|
|
1773
1760
|
get _classes() {
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
[button.secondarySmallLoading]: secondary && this.small && !this.quiet && this.loading,
|
|
1785
|
-
[button.secondarySmallQuiet]: secondary && this.small && this.quiet && !this.loading,
|
|
1786
|
-
[button.secondarySmallQuietLoading]: secondary && this.small && this.quiet && this.loading,
|
|
1787
|
-
[button.secondaryQuiet]: secondary && !this.small && this.quiet && !this.loading,
|
|
1788
|
-
[button.secondaryQuietLoading]: secondary && !this.small && this.quiet && this.loading,
|
|
1789
|
-
[button.secondaryLoading]: secondary && !this.small && !this.quiet && this.loading,
|
|
1790
|
-
[button.primary]: primary && !this.small && !this.quiet && !this.loading,
|
|
1791
|
-
[button.primarySmall]: primary && this.small && !this.quiet && !this.loading,
|
|
1792
|
-
[button.primarySmallQuiet]: primary && this.small && this.quiet && !this.loading,
|
|
1793
|
-
[button.primarySmallLoading]: primary && this.small && !this.quiet && this.loading,
|
|
1794
|
-
[button.primarySmallQuietLoading]: primary && this.small && this.quiet && this.loading,
|
|
1795
|
-
[button.primaryQuiet]: primary && !this.small && this.quiet && !this.loading,
|
|
1796
|
-
[button.primaryQuietLoading]: primary && !this.small && this.quiet && this.loading,
|
|
1797
|
-
[button.primaryLoading]: primary && !this.small && !this.quiet && this.loading,
|
|
1798
|
-
[button.utility]: utility && !this.small && !this.quiet && !this.loading,
|
|
1799
|
-
[button.utilitySmall]: utility && this.small && !this.quiet && !this.loading,
|
|
1800
|
-
[button.utilitySmallQuiet]: utility && this.small && this.quiet && !this.loading,
|
|
1801
|
-
[button.utilitySmallLoading]: utility && this.small && !this.quiet && this.loading,
|
|
1802
|
-
[button.utilitySmallQuietLoading]: utility && this.small && this.quiet && this.loading,
|
|
1803
|
-
[button.utilityQuiet]: utility && !this.small && this.quiet && !this.loading,
|
|
1804
|
-
[button.utilityQuietLoading]: utility && !this.small && this.quiet && this.loading,
|
|
1805
|
-
[button.utilityLoading]: utility && !this.small && !this.quiet && this.loading,
|
|
1806
|
-
[button.negative]: negative && !this.small && !this.quiet && !this.loading,
|
|
1807
|
-
[button.negativeSmall]: negative && this.small && !this.quiet && !this.loading,
|
|
1808
|
-
[button.negativeSmallQuiet]: negative && this.small && this.quiet && !this.loading,
|
|
1809
|
-
[button.negativeSmallLoading]: negative && this.small && !this.quiet && this.loading,
|
|
1810
|
-
[button.negativeSmallQuietLoading]: negative && this.small && this.quiet && this.loading,
|
|
1811
|
-
[button.negativeQuiet]: negative && !this.small && this.quiet && !this.loading,
|
|
1812
|
-
[button.negativeQuietLoading]: negative && !this.small && this.quiet && this.loading,
|
|
1813
|
-
[button.negativeLoading]: negative && !this.small && !this.quiet && this.loading,
|
|
1814
|
-
[button.pill]: pill && !this.small && !this.loading,
|
|
1815
|
-
[button.pillSmall]: pill && this.small && !this.loading,
|
|
1816
|
-
[button.pillLoading]: pill && !this.small && this.loading,
|
|
1817
|
-
[button.pillSmallLoading]: pill && this.small && this.loading,
|
|
1818
|
-
[button.link]: link && !this.small,
|
|
1819
|
-
[button.linkSmall]: link && this.small,
|
|
1820
|
-
[button.linkAsButton]: !!this.href,
|
|
1821
|
-
[button.fullWidth]: this.fullWidth,
|
|
1822
|
-
[button.contentWidth]: !this.fullWidth
|
|
1823
|
-
},
|
|
1824
|
-
this.buttonClass
|
|
1825
|
-
);
|
|
1761
|
+
return r(this.buttonClass, [
|
|
1762
|
+
this.variant === "primary" && this._primaryClasses,
|
|
1763
|
+
this.variant === "secondary" && this._secondaryClasses,
|
|
1764
|
+
this.variant === "utility" && this._utilityClasses,
|
|
1765
|
+
this.variant === "negative" && this._negativeClasses,
|
|
1766
|
+
this.variant === "pill" && this._pillClasses,
|
|
1767
|
+
this.variant === "link" && this._linkClasses,
|
|
1768
|
+
this.href && button.linkAsButton,
|
|
1769
|
+
this.fullWidth ? button.fullWidth : button.contentWidth
|
|
1770
|
+
]);
|
|
1826
1771
|
}
|
|
1827
1772
|
render() {
|
|
1828
1773
|
return html` ${this.href ? html`<a
|