@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
package/dist/index.js
CHANGED
|
@@ -8,6 +8,9 @@ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
8
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
10
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __typeError = (msg) => {
|
|
12
|
+
throw TypeError(msg);
|
|
13
|
+
};
|
|
11
14
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
15
|
var __spreadValues = (a2, b2) => {
|
|
13
16
|
for (var prop in b2 || (b2 = {}))
|
|
@@ -52,23 +55,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
52
55
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
53
56
|
mod
|
|
54
57
|
));
|
|
55
|
-
var __publicField = (obj, key, value) =>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
var __accessCheck = (obj, member, msg) => {
|
|
60
|
-
if (!member.has(obj))
|
|
61
|
-
throw TypeError("Cannot " + msg);
|
|
62
|
-
};
|
|
63
|
-
var __privateGet = (obj, member, getter) => {
|
|
64
|
-
__accessCheck(obj, member, "read from private field");
|
|
65
|
-
return getter ? getter.call(obj) : member.get(obj);
|
|
66
|
-
};
|
|
67
|
-
var __privateAdd = (obj, member, value) => {
|
|
68
|
-
if (member.has(obj))
|
|
69
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
70
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
71
|
-
};
|
|
58
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
59
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
60
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
61
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
72
62
|
|
|
73
63
|
// node_modules/.pnpm/unraw@3.0.0/node_modules/unraw/dist/errors.js
|
|
74
64
|
var require_errors = __commonJS({
|
|
@@ -241,8 +231,7 @@ var require_moo = __commonJS({
|
|
|
241
231
|
return "(" + s + ")";
|
|
242
232
|
}
|
|
243
233
|
function reUnion(regexps) {
|
|
244
|
-
if (!regexps.length)
|
|
245
|
-
return "(?!)";
|
|
234
|
+
if (!regexps.length) return "(?!)";
|
|
246
235
|
var source = regexps.map(function(s) {
|
|
247
236
|
return "(?:" + s + ")";
|
|
248
237
|
}).join("|");
|
|
@@ -252,14 +241,10 @@ var require_moo = __commonJS({
|
|
|
252
241
|
if (typeof obj === "string") {
|
|
253
242
|
return "(?:" + reEscape(obj) + ")";
|
|
254
243
|
} else if (isRegExp(obj)) {
|
|
255
|
-
if (obj.ignoreCase)
|
|
256
|
-
|
|
257
|
-
if (obj.
|
|
258
|
-
|
|
259
|
-
if (obj.sticky)
|
|
260
|
-
throw new Error("RegExp /y flag is implied");
|
|
261
|
-
if (obj.multiline)
|
|
262
|
-
throw new Error("RegExp /m flag is implied");
|
|
244
|
+
if (obj.ignoreCase) throw new Error("RegExp /i flag not allowed");
|
|
245
|
+
if (obj.global) throw new Error("RegExp /g flag is implied");
|
|
246
|
+
if (obj.sticky) throw new Error("RegExp /y flag is implied");
|
|
247
|
+
if (obj.multiline) throw new Error("RegExp /m flag is implied");
|
|
263
248
|
return obj.source;
|
|
264
249
|
} else {
|
|
265
250
|
throw new Error("Not a pattern: " + obj);
|
|
@@ -308,16 +293,14 @@ var require_moo = __commonJS({
|
|
|
308
293
|
var match = [];
|
|
309
294
|
rules.forEach(function(rule) {
|
|
310
295
|
if (isObject(rule)) {
|
|
311
|
-
if (match.length)
|
|
312
|
-
result.push(ruleOptions(key, match));
|
|
296
|
+
if (match.length) result.push(ruleOptions(key, match));
|
|
313
297
|
result.push(ruleOptions(key, rule));
|
|
314
298
|
match = [];
|
|
315
299
|
} else {
|
|
316
300
|
match.push(rule);
|
|
317
301
|
}
|
|
318
302
|
});
|
|
319
|
-
if (match.length)
|
|
320
|
-
result.push(ruleOptions(key, match));
|
|
303
|
+
if (match.length) result.push(ruleOptions(key, match));
|
|
321
304
|
}
|
|
322
305
|
return result;
|
|
323
306
|
}
|
|
@@ -452,8 +435,7 @@ var require_moo = __commonJS({
|
|
|
452
435
|
var fallbackRule = errorRule && errorRule.fallback;
|
|
453
436
|
var flags = hasSticky && !fallbackRule ? "ym" : "gm";
|
|
454
437
|
var suffix2 = hasSticky || fallbackRule ? "" : "|";
|
|
455
|
-
if (unicodeFlag === true)
|
|
456
|
-
flags += "u";
|
|
438
|
+
if (unicodeFlag === true) flags += "u";
|
|
457
439
|
var combined = new RegExp(reUnion(parts) + suffix2, flags);
|
|
458
440
|
return { regexp: combined, groups, fast, error: errorRule || defaultErrorRule };
|
|
459
441
|
}
|
|
@@ -474,8 +456,7 @@ var require_moo = __commonJS({
|
|
|
474
456
|
var all = states.$all ? toRules(states.$all) : [];
|
|
475
457
|
delete states.$all;
|
|
476
458
|
var keys2 = Object.getOwnPropertyNames(states);
|
|
477
|
-
if (!start)
|
|
478
|
-
start = keys2[0];
|
|
459
|
+
if (!start) start = keys2[0];
|
|
479
460
|
var ruleMap = /* @__PURE__ */ Object.create(null);
|
|
480
461
|
for (var i2 = 0; i2 < keys2.length; i2++) {
|
|
481
462
|
var key = keys2[i2];
|
|
@@ -487,8 +468,7 @@ var require_moo = __commonJS({
|
|
|
487
468
|
var included = /* @__PURE__ */ Object.create(null);
|
|
488
469
|
for (var j = 0; j < rules.length; j++) {
|
|
489
470
|
var rule = rules[j];
|
|
490
|
-
if (!rule.include)
|
|
491
|
-
continue;
|
|
471
|
+
if (!rule.include) continue;
|
|
492
472
|
var splice = [j, 1];
|
|
493
473
|
if (rule.include !== key && !included[rule.include]) {
|
|
494
474
|
included[rule.include] = true;
|
|
@@ -498,8 +478,7 @@ var require_moo = __commonJS({
|
|
|
498
478
|
}
|
|
499
479
|
for (var k = 0; k < newRules.length; k++) {
|
|
500
480
|
var newRule = newRules[k];
|
|
501
|
-
if (rules.indexOf(newRule) !== -1)
|
|
502
|
-
continue;
|
|
481
|
+
if (rules.indexOf(newRule) !== -1) continue;
|
|
503
482
|
splice.push(newRule);
|
|
504
483
|
}
|
|
505
484
|
}
|
|
@@ -580,8 +559,7 @@ var require_moo = __commonJS({
|
|
|
580
559
|
};
|
|
581
560
|
};
|
|
582
561
|
Lexer.prototype.setState = function(state) {
|
|
583
|
-
if (!state || this.state === state)
|
|
584
|
-
return;
|
|
562
|
+
if (!state || this.state === state) return;
|
|
585
563
|
this.state = state;
|
|
586
564
|
var info = this.states[state];
|
|
587
565
|
this.groups = info.groups;
|
|
@@ -649,7 +627,7 @@ var require_moo = __commonJS({
|
|
|
649
627
|
}
|
|
650
628
|
return this._token(group, text, index);
|
|
651
629
|
};
|
|
652
|
-
Lexer.prototype._token = function(group, text,
|
|
630
|
+
Lexer.prototype._token = function(group, text, offset3) {
|
|
653
631
|
var lineBreaks = 0;
|
|
654
632
|
if (group.lineBreaks) {
|
|
655
633
|
var matchNL = /\n/g;
|
|
@@ -668,7 +646,7 @@ var require_moo = __commonJS({
|
|
|
668
646
|
value: typeof group.value === "function" ? group.value(text) : text,
|
|
669
647
|
text,
|
|
670
648
|
toString: tokenToString,
|
|
671
|
-
offset:
|
|
649
|
+
offset: offset3,
|
|
672
650
|
lineBreaks,
|
|
673
651
|
line: this.line,
|
|
674
652
|
col: this.col
|
|
@@ -685,12 +663,9 @@ var require_moo = __commonJS({
|
|
|
685
663
|
var err = new Error(this.formatError(token, "invalid syntax"));
|
|
686
664
|
throw err;
|
|
687
665
|
}
|
|
688
|
-
if (group.pop)
|
|
689
|
-
|
|
690
|
-
else if (group.
|
|
691
|
-
this.pushState(group.push);
|
|
692
|
-
else if (group.next)
|
|
693
|
-
this.setState(group.next);
|
|
666
|
+
if (group.pop) this.popState();
|
|
667
|
+
else if (group.push) this.pushState(group.push);
|
|
668
|
+
else if (group.next) this.setState(group.next);
|
|
694
669
|
return token;
|
|
695
670
|
};
|
|
696
671
|
if (typeof Symbol !== "undefined" && Symbol.iterator) {
|
|
@@ -1043,7 +1018,17 @@ var require_parser = __commonJS({
|
|
|
1043
1018
|
// packages/affix/index.js
|
|
1044
1019
|
import { html as html3 } from "lit";
|
|
1045
1020
|
|
|
1046
|
-
// node_modules/.pnpm/@
|
|
1021
|
+
// node_modules/.pnpm/@chbphone55+classnames@2.0.0/node_modules/@chbphone55/classnames/dist/index.m.js
|
|
1022
|
+
var r = function() {
|
|
1023
|
+
for (var t = [], n2 = arguments.length; n2--; ) t[n2] = arguments[n2];
|
|
1024
|
+
return t.reduce(function(t2, n3) {
|
|
1025
|
+
return t2.concat("string" == typeof n3 ? n3 : Array.isArray(n3) ? r.apply(void 0, n3) : "object" == typeof n3 && n3 ? Object.keys(n3).map(function(r3) {
|
|
1026
|
+
return n3[r3] ? r3 : "";
|
|
1027
|
+
}) : "");
|
|
1028
|
+
}, []).join(" ");
|
|
1029
|
+
};
|
|
1030
|
+
|
|
1031
|
+
// 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
|
|
1047
1032
|
var badge = {
|
|
1048
1033
|
base: "py-4 px-8 border-0 rounded-4 text-xs inline-flex",
|
|
1049
1034
|
neutral: "bg-[--w-color-badge-neutral-background] s-text",
|
|
@@ -1061,7 +1046,7 @@ var badge = {
|
|
|
1061
1046
|
positionBL: "rounded-tl-0 rounded-br-0 rounded-bl-0 bottom-0 left-0"
|
|
1062
1047
|
};
|
|
1063
1048
|
var box = {
|
|
1064
|
-
|
|
1049
|
+
base: "group block relative break-words last-child:mb-0 p-16 rounded-8",
|
|
1065
1050
|
// Relative here enables w-clickable
|
|
1066
1051
|
bleed: "-mx-16 sm:mx-0 rounded-l-0 rounded-r-0 sm:rounded-8",
|
|
1067
1052
|
// We target L and R to override the default rounded-8
|
|
@@ -1070,7 +1055,7 @@ var box = {
|
|
|
1070
1055
|
bordered: "border-2 s-border s-bg"
|
|
1071
1056
|
};
|
|
1072
1057
|
var pill = {
|
|
1073
|
-
|
|
1058
|
+
wrapper: "flex items-center",
|
|
1074
1059
|
button: "inline-flex items-center focusable text-xs transition-all",
|
|
1075
1060
|
suggestion: "bg-[--w-color-pill-suggestion-background] hover:bg-[--w-color-pill-suggestion-background-hover] active:bg-[--w-color-pill-suggestion-background-active] s-text font-bold",
|
|
1076
1061
|
filter: "s-bg-primary hover:s-bg-primary-hover active:s-bg-primary-active s-text-inverted",
|
|
@@ -1081,29 +1066,29 @@ var pill = {
|
|
|
1081
1066
|
a11y: "sr-only"
|
|
1082
1067
|
};
|
|
1083
1068
|
var card = {
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1069
|
+
base: "cursor-pointer overflow-hidden relative transition-all",
|
|
1070
|
+
shadow: "group rounded-8 s-surface-elevated-200 hover:s-surface-elevated-200-hover active:s-surface-elevated-200-active",
|
|
1071
|
+
selected: "!s-bg-selected !hover:s-bg-selected-hover !active:s-bg-selected-active",
|
|
1072
|
+
outline: "absolute border-2 rounded-8 inset-0 transition-all",
|
|
1073
|
+
outlineUnselected: "border-transparent group-active:s-border-active",
|
|
1074
|
+
outlineSelected: "s-border-selected group-hover:s-border-selected-hover group-active:s-border-selected-active",
|
|
1075
|
+
flat: "border-2 rounded-4",
|
|
1076
|
+
flatUnselected: "s-bg hover:s-bg-hover active:s-bg-active s-border hover:s-border-hover active:s-border-active",
|
|
1077
|
+
flatSelected: "s-bg-selected hover:s-bg-selected-hover active:s-bg-selected-active s-border-selected hover:s-border-selected-hover active:s-border-selected-active",
|
|
1093
1078
|
a11y: "sr-only"
|
|
1094
1079
|
};
|
|
1095
1080
|
var toaster = {
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1081
|
+
wrapper: "fixed transform translate-z-0 bottom-16 left-0 right-0 mx-8 sm:mx-16 z-50 pointer-events-none",
|
|
1082
|
+
base: "grid auto-rows-auto justify-items-center justify-center mx-auto pointer-events-none",
|
|
1083
|
+
content: "w-full"
|
|
1099
1084
|
};
|
|
1100
1085
|
var toast = {
|
|
1101
1086
|
wrapper: "relative overflow-hidden w-full",
|
|
1102
|
-
|
|
1087
|
+
base: "flex group p-8 mt-16 rounded-8 border-2 pointer-events-auto transition-all",
|
|
1103
1088
|
positive: "s-bg-positive-subtle s-border-positive-subtle s-text",
|
|
1104
1089
|
warning: "s-bg-warning-subtle s-border-warning-subtle s-text",
|
|
1105
1090
|
negative: "s-bg-negative-subtle s-border-negative-subtle s-text",
|
|
1106
|
-
|
|
1091
|
+
iconBase: "shrink-0 rounded-full w-[16px] h-[16px] m-[8px]",
|
|
1107
1092
|
iconPositive: "s-icon-positive",
|
|
1108
1093
|
iconWarning: "s-icon-warning",
|
|
1109
1094
|
iconNegative: "s-icon-negative",
|
|
@@ -1111,30 +1096,27 @@ var toast = {
|
|
|
1111
1096
|
content: "self-center mr-8 py-4 last-child:mb-0",
|
|
1112
1097
|
close: "bg-transparent ml-auto p-[8px] s-icon hover:s-icon-hover active:s-icon-active"
|
|
1113
1098
|
};
|
|
1114
|
-
var buttonReset = "focus:outline-none appearance-none cursor-pointer bg-transparent border-0 m-0 p-0 inline-block";
|
|
1115
1099
|
var expandable = {
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
expandableInfo: "s-bg-info-subtle! hover:s-bg-info-subtle-hover!",
|
|
1120
|
-
expandableBleed: box.bleed,
|
|
1100
|
+
wrapper: "will-change-height s-text",
|
|
1101
|
+
box: "s-surface-sunken hover:s-bg-hover active:s-bg-active py-0 px-0 group block relative break-words last-child:mb-0 rounded-8",
|
|
1102
|
+
bleed: "-mx-16 rounded-l-0 rounded-r-0 sm:mx-0 sm:rounded-8",
|
|
1121
1103
|
chevron: "inline-block align-middle s-icon",
|
|
1122
1104
|
chevronNonBox: "ml-8",
|
|
1123
|
-
chevronBox: "",
|
|
1124
1105
|
chevronTransform: "transform transition-transform transform-gpu ease-in-out",
|
|
1125
1106
|
chevronExpand: "-rotate-180",
|
|
1126
1107
|
chevronCollapse: "rotate-180",
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1108
|
+
// These are web component specific classes, using the ::part-selector:
|
|
1109
|
+
elementsChevronDownTransform: "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",
|
|
1110
|
+
elementsChevronUpTransform: "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",
|
|
1111
|
+
elementsChevronExpand: "part-[w-icon-chevron-down-16-part]:-rotate-180",
|
|
1112
|
+
elementsChevronCollapse: "part-[w-icon-chevron-up-16-part]:rotate-180",
|
|
1131
1113
|
expansion: "overflow-hidden",
|
|
1132
1114
|
expansionNotExpanded: "h-0 invisible",
|
|
1133
|
-
button:
|
|
1134
|
-
buttonBox: "w-full text-left relative inline-flex items-center justify-between
|
|
1135
|
-
|
|
1115
|
+
button: "focus:outline-none appearance-none cursor-pointer bg-transparent border-0 m-0 hover:underline focus-visible:underline",
|
|
1116
|
+
buttonBox: "w-full text-left relative inline-flex items-center justify-between group relative break-words last-child:mb-0 p-16 rounded-8",
|
|
1117
|
+
contentWithTitle: "pt-0",
|
|
1136
1118
|
title: "flex w-full justify-between items-center",
|
|
1137
|
-
titleType: "
|
|
1119
|
+
titleType: "t4"
|
|
1138
1120
|
};
|
|
1139
1121
|
var buttonDefaultStyling = "font-bold focusable justify-center transition-colors ease-in-out";
|
|
1140
1122
|
var buttonColors = {
|
|
@@ -1253,7 +1235,7 @@ var button = {
|
|
|
1253
1235
|
};
|
|
1254
1236
|
var modal = {
|
|
1255
1237
|
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]",
|
|
1256
|
-
|
|
1238
|
+
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",
|
|
1257
1239
|
content: "block overflow-y-auto overflow-x-hidden last-child:mb-0 grow shrink px-16 sm:px-32 relative",
|
|
1258
1240
|
footer: "flex justify-end shrink-0 px-16 sm:px-32",
|
|
1259
1241
|
transitionTitle: "transition-all duration-300",
|
|
@@ -1285,7 +1267,7 @@ var modalElement = {
|
|
|
1285
1267
|
footer: "flex justify-end shrink-0 px-16 sm:px-32 pt-24"
|
|
1286
1268
|
};
|
|
1287
1269
|
var alert = {
|
|
1288
|
-
|
|
1270
|
+
wrapper: "flex p-16 border border-l-4 rounded-4 s-text",
|
|
1289
1271
|
willChangeHeight: "will-change-height",
|
|
1290
1272
|
textWrapper: "last-child:mb-0 text-s",
|
|
1291
1273
|
title: "text-s",
|
|
@@ -1320,33 +1302,34 @@ var input = {
|
|
|
1320
1302
|
textArea: "min-h-[42] sm:min-h-[45]"
|
|
1321
1303
|
};
|
|
1322
1304
|
var select = {
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1305
|
+
base: "block text-m mb-0 py-12 pr-32 rounded-4 w-full focusable focus:[--w-outline-offset:-2px] appearance-none cursor-pointer caret-current",
|
|
1306
|
+
default: "s-text s-bg pl-8 border-1 s-border hover:s-border-hover active:s-border-active",
|
|
1307
|
+
disabled: "s-text-disabled s-bg-disabled-subtle pl-8 border-1 s-border-disabled hover:s-border-disabled active:s-border-disabled pointer-events-none",
|
|
1308
|
+
invalid: "s-text s-bg pl-8 border-1 s-border-negative hover:s-border-negative-hover active:s-border-active outline-[--w-s-color-border-negative]!",
|
|
1309
|
+
readOnly: "s-text bg-transparent pl-0 border-0 pointer-events-none before:hidden",
|
|
1327
1310
|
wrapper: "relative",
|
|
1328
1311
|
selectWrapper: `relative before:block before:absolute before:right-0 before:bottom-0 before:w-32 before:h-full before:pointer-events-none `,
|
|
1329
|
-
chevron: "absolute top-[30%]
|
|
1312
|
+
chevron: "block absolute top-[30%] right-0 bottom-0 w-32 h-full s-icon pointer-events-none cursor-pointer",
|
|
1330
1313
|
chevronDisabled: "opacity-25"
|
|
1331
1314
|
};
|
|
1332
1315
|
var label = {
|
|
1333
|
-
|
|
1316
|
+
base: "antialiased block relative text-s font-bold pb-4 cursor-pointer s-text",
|
|
1334
1317
|
optional: "pl-8 font-normal text-s s-text-subtle"
|
|
1335
1318
|
};
|
|
1336
1319
|
var helpText = {
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1320
|
+
base: "text-xs mt-4 block",
|
|
1321
|
+
color: "s-text-subtle",
|
|
1322
|
+
colorInvalid: "s-text-negative"
|
|
1340
1323
|
};
|
|
1341
|
-
var
|
|
1324
|
+
var prefixSuffixWrapper = "absolute top-0 bottom-0 flex justify-center items-center focusable rounded-4 focus:[--w-outline-offset:-2px] bg-transparent ";
|
|
1342
1325
|
var suffix = {
|
|
1343
|
-
wrapper:
|
|
1326
|
+
wrapper: prefixSuffixWrapper + "right-0",
|
|
1344
1327
|
wrapperWithLabel: "w-max pr-12",
|
|
1345
1328
|
wrapperWithIcon: "w-40",
|
|
1346
1329
|
label: "antialiased block relative cursor-default pb-0 font-bold text-xs s-text"
|
|
1347
1330
|
};
|
|
1348
1331
|
var prefix = {
|
|
1349
|
-
wrapper:
|
|
1332
|
+
wrapper: prefixSuffixWrapper + "left-0",
|
|
1350
1333
|
wrapperWithLabel: "w-max pl-12",
|
|
1351
1334
|
wrapperWithIcon: "w-40",
|
|
1352
1335
|
label: "antialiased block relative cursor-default pb-0 font-bold text-xs s-text"
|
|
@@ -1410,15 +1393,9 @@ var deadToggle = {
|
|
|
1410
1393
|
wrapper: `${toggle.wrapper} h-20 w-20 pointer-events-none`,
|
|
1411
1394
|
input: `${toggle.input} hidden`,
|
|
1412
1395
|
inputVue: "hidden",
|
|
1396
|
+
labelVue: "-mt-2",
|
|
1413
1397
|
labelRadio: `${toggle.label} ${toggle.labelBefore} ${toggle.radio}`,
|
|
1414
|
-
labelCheckbox: `${toggle.label} ${toggle.labelBefore} ${toggle.checkbox}
|
|
1415
|
-
labelVue: "-mt-2"
|
|
1416
|
-
};
|
|
1417
|
-
var clickable = {
|
|
1418
|
-
toggle: "absolute inset-0 h-full w-full appearance-none cursor-pointer focusable focusable-inset",
|
|
1419
|
-
label: `px-12 ${label.label} py-8! cursor-pointer focusable focusable-inset`,
|
|
1420
|
-
buttonOrLink: "bg-transparent focusable",
|
|
1421
|
-
buttonOrLinkStretch: "inset-0 absolute"
|
|
1398
|
+
labelCheckbox: `${toggle.label} ${toggle.labelBefore} ${toggle.checkbox}`
|
|
1422
1399
|
};
|
|
1423
1400
|
var attention = {
|
|
1424
1401
|
base: "border-2 relative flex items-start",
|
|
@@ -1452,14 +1429,14 @@ var attention = {
|
|
|
1452
1429
|
import WarpElement from "@warp-ds/elements-core";
|
|
1453
1430
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
1454
1431
|
|
|
1455
|
-
// node_modules/.pnpm/@warp-ds+icons@2.0.
|
|
1432
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/search-16.js
|
|
1456
1433
|
import { LitElement } from "lit";
|
|
1457
1434
|
import { unsafeStatic, html } from "lit/static-html.js";
|
|
1458
1435
|
|
|
1459
|
-
// node_modules/.pnpm/@lingui+core@4.
|
|
1436
|
+
// node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
|
|
1460
1437
|
var import_unraw = __toESM(require_dist(), 1);
|
|
1461
1438
|
|
|
1462
|
-
// node_modules/.pnpm/@lingui+message-utils@4.
|
|
1439
|
+
// node_modules/.pnpm/@lingui+message-utils@4.11.2/node_modules/@lingui/message-utils/dist/compileMessage.mjs
|
|
1463
1440
|
var import_parser = __toESM(require_parser(), 1);
|
|
1464
1441
|
function processTokens(tokens, mapText) {
|
|
1465
1442
|
if (!tokens.filter((token) => token.type !== "content").length) {
|
|
@@ -1481,19 +1458,17 @@ function processTokens(tokens, mapText) {
|
|
|
1481
1458
|
return [token.arg, token.key];
|
|
1482
1459
|
}
|
|
1483
1460
|
}
|
|
1484
|
-
const
|
|
1461
|
+
const offset3 = token.pluralOffset;
|
|
1485
1462
|
const formatProps = {};
|
|
1486
|
-
token.cases.forEach((
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
mapText
|
|
1490
|
-
);
|
|
1463
|
+
token.cases.forEach(({ key, tokens: tokens2 }) => {
|
|
1464
|
+
const prop = key[0] === "=" ? key.slice(1) : key;
|
|
1465
|
+
formatProps[prop] = processTokens(tokens2, mapText);
|
|
1491
1466
|
});
|
|
1492
1467
|
return [
|
|
1493
1468
|
token.arg,
|
|
1494
1469
|
token.type,
|
|
1495
1470
|
__spreadValues({
|
|
1496
|
-
offset:
|
|
1471
|
+
offset: offset3
|
|
1497
1472
|
}, formatProps)
|
|
1498
1473
|
];
|
|
1499
1474
|
});
|
|
@@ -1509,7 +1484,7 @@ Message: ${message}`);
|
|
|
1509
1484
|
}
|
|
1510
1485
|
}
|
|
1511
1486
|
|
|
1512
|
-
// node_modules/.pnpm/@lingui+core@4.
|
|
1487
|
+
// node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
|
|
1513
1488
|
var isString = (s) => typeof s === "string";
|
|
1514
1489
|
var isFunction = (f2) => typeof f2 === "function";
|
|
1515
1490
|
var cache = /* @__PURE__ */ new Map();
|
|
@@ -1535,7 +1510,7 @@ function number(locales, value, format) {
|
|
|
1535
1510
|
return formatter.format(value);
|
|
1536
1511
|
}
|
|
1537
1512
|
function plural(locales, ordinal, value, _a) {
|
|
1538
|
-
var _b = _a, { offset:
|
|
1513
|
+
var _b = _a, { offset: offset3 = 0 } = _b, rules = __objRest(_b, ["offset"]);
|
|
1539
1514
|
var _a2, _b2;
|
|
1540
1515
|
const _locales = normalizeLocales(locales);
|
|
1541
1516
|
const plurals = ordinal ? getMemoized(
|
|
@@ -1545,7 +1520,7 @@ function plural(locales, ordinal, value, _a) {
|
|
|
1545
1520
|
() => cacheKey("plural-cardinal", _locales),
|
|
1546
1521
|
() => new Intl.PluralRules(_locales, { type: "cardinal" })
|
|
1547
1522
|
);
|
|
1548
|
-
return (_b2 = (_a2 = rules[value]) != null ? _a2 : rules[plurals.select(value -
|
|
1523
|
+
return (_b2 = (_a2 = rules[value]) != null ? _a2 : rules[plurals.select(value - offset3)]) != null ? _b2 : rules.other;
|
|
1549
1524
|
}
|
|
1550
1525
|
function getMemoized(getKey, construct) {
|
|
1551
1526
|
const key = getKey();
|
|
@@ -1574,14 +1549,14 @@ var getDefaultFormats = (locale, passedLocales, formats = {}) => {
|
|
|
1574
1549
|
};
|
|
1575
1550
|
return {
|
|
1576
1551
|
plural: (value, cases) => {
|
|
1577
|
-
const { offset:
|
|
1552
|
+
const { offset: offset3 = 0 } = cases;
|
|
1578
1553
|
const message = plural(locales, false, value, cases);
|
|
1579
|
-
return replaceOctothorpe(value -
|
|
1554
|
+
return replaceOctothorpe(value - offset3, message);
|
|
1580
1555
|
},
|
|
1581
1556
|
selectordinal: (value, cases) => {
|
|
1582
|
-
const { offset:
|
|
1557
|
+
const { offset: offset3 = 0 } = cases;
|
|
1583
1558
|
const message = plural(locales, true, value, cases);
|
|
1584
|
-
return replaceOctothorpe(value -
|
|
1559
|
+
return replaceOctothorpe(value - offset3, message);
|
|
1585
1560
|
},
|
|
1586
1561
|
select: selectFormatter,
|
|
1587
1562
|
number: (value, format) => number(locales, value, style(format)),
|
|
@@ -1595,11 +1570,11 @@ var selectFormatter = (value, rules) => {
|
|
|
1595
1570
|
function interpolate(translation, locale, locales) {
|
|
1596
1571
|
return (values = {}, formats) => {
|
|
1597
1572
|
const formatters = getDefaultFormats(locale, locales, formats);
|
|
1598
|
-
const formatMessage = (tokens) => {
|
|
1573
|
+
const formatMessage = (tokens, replaceOctothorpe = false) => {
|
|
1599
1574
|
if (!Array.isArray(tokens))
|
|
1600
1575
|
return tokens;
|
|
1601
1576
|
return tokens.reduce((message, token) => {
|
|
1602
|
-
if (token === "#") {
|
|
1577
|
+
if (token === "#" && replaceOctothorpe) {
|
|
1603
1578
|
return message + OCTOTHORPE_PH;
|
|
1604
1579
|
}
|
|
1605
1580
|
if (isString(token)) {
|
|
@@ -1610,7 +1585,10 @@ function interpolate(translation, locale, locales) {
|
|
|
1610
1585
|
if (type === "plural" || type === "selectordinal" || type === "select") {
|
|
1611
1586
|
Object.entries(format).forEach(
|
|
1612
1587
|
([key, value2]) => {
|
|
1613
|
-
interpolatedFormat[key] = formatMessage(
|
|
1588
|
+
interpolatedFormat[key] = formatMessage(
|
|
1589
|
+
value2,
|
|
1590
|
+
type === "plural" || type === "selectordinal"
|
|
1591
|
+
);
|
|
1614
1592
|
}
|
|
1615
1593
|
);
|
|
1616
1594
|
} else {
|
|
@@ -1739,20 +1717,20 @@ var I18n = class extends EventEmitter {
|
|
|
1739
1717
|
}
|
|
1740
1718
|
this.emit("change");
|
|
1741
1719
|
}
|
|
1742
|
-
_load(locale,
|
|
1720
|
+
_load(locale, messages52) {
|
|
1743
1721
|
const maybeMessages = this._messages[locale];
|
|
1744
1722
|
if (!maybeMessages) {
|
|
1745
|
-
this._messages[locale] =
|
|
1723
|
+
this._messages[locale] = messages52;
|
|
1746
1724
|
} else {
|
|
1747
|
-
Object.assign(maybeMessages,
|
|
1725
|
+
Object.assign(maybeMessages, messages52);
|
|
1748
1726
|
}
|
|
1749
1727
|
}
|
|
1750
|
-
load(localeOrMessages,
|
|
1751
|
-
if (typeof localeOrMessages == "string" && typeof
|
|
1752
|
-
this._load(localeOrMessages,
|
|
1728
|
+
load(localeOrMessages, messages52) {
|
|
1729
|
+
if (typeof localeOrMessages == "string" && typeof messages52 === "object") {
|
|
1730
|
+
this._load(localeOrMessages, messages52);
|
|
1753
1731
|
} else {
|
|
1754
1732
|
Object.entries(localeOrMessages).forEach(
|
|
1755
|
-
([locale,
|
|
1733
|
+
([locale, messages213]) => this._load(locale, messages213)
|
|
1756
1734
|
);
|
|
1757
1735
|
}
|
|
1758
1736
|
this.emit("change");
|
|
@@ -1760,10 +1738,10 @@ var I18n = class extends EventEmitter {
|
|
|
1760
1738
|
/**
|
|
1761
1739
|
* @param options {@link LoadAndActivateOptions}
|
|
1762
1740
|
*/
|
|
1763
|
-
loadAndActivate({ locale, locales, messages:
|
|
1741
|
+
loadAndActivate({ locale, locales, messages: messages52 }) {
|
|
1764
1742
|
this._locale = locale;
|
|
1765
1743
|
this._locales = locales || void 0;
|
|
1766
|
-
this._messages[this._locale] =
|
|
1744
|
+
this._messages[this._locale] = messages52;
|
|
1767
1745
|
this.emit("change");
|
|
1768
1746
|
}
|
|
1769
1747
|
activate(locale, locales) {
|
|
@@ -1778,6 +1756,9 @@ var I18n = class extends EventEmitter {
|
|
|
1778
1756
|
}
|
|
1779
1757
|
_(id, values, options) {
|
|
1780
1758
|
let message = options == null ? void 0 : options.message;
|
|
1759
|
+
if (!id) {
|
|
1760
|
+
id = "";
|
|
1761
|
+
}
|
|
1781
1762
|
if (!isString(id)) {
|
|
1782
1763
|
values = id.values || values;
|
|
1783
1764
|
message = id.message;
|
|
@@ -1818,7 +1799,7 @@ function setupI18n(params = {}) {
|
|
|
1818
1799
|
}
|
|
1819
1800
|
var i18n = setupI18n();
|
|
1820
1801
|
|
|
1821
|
-
// node_modules/.pnpm/@warp-ds+icons@2.0.
|
|
1802
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/search-16.js
|
|
1822
1803
|
var messages = JSON.parse('{"icon.title.search":"Forst\xF8rrelsesglass"}');
|
|
1823
1804
|
var messages2 = JSON.parse('{"icon.title.search":"Magnifying glass"}');
|
|
1824
1805
|
var messages3 = JSON.parse('{"icon.title.search":"Suurennuslasi"}');
|
|
@@ -1907,7 +1888,7 @@ if (!customElements.get("w-icon-search-16")) {
|
|
|
1907
1888
|
customElements.define("w-icon-search-16", IconSearch16);
|
|
1908
1889
|
}
|
|
1909
1890
|
|
|
1910
|
-
// node_modules/.pnpm/@warp-ds+icons@2.0.
|
|
1891
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/close-16.js
|
|
1911
1892
|
import { LitElement as LitElement2 } from "lit";
|
|
1912
1893
|
import { unsafeStatic as unsafeStatic2, html as html2 } from "lit/static-html.js";
|
|
1913
1894
|
var messages4 = JSON.parse('{"icon.title.close":"Kryss"}');
|
|
@@ -2014,38 +1995,17 @@ function kebabCaseAttributes(constructor) {
|
|
|
2014
1995
|
}
|
|
2015
1996
|
};
|
|
2016
1997
|
}
|
|
2017
|
-
function classes(defn) {
|
|
2018
|
-
const classes3 = [];
|
|
2019
|
-
for (const [key, value] of Object.entries(defn)) {
|
|
2020
|
-
if (value)
|
|
2021
|
-
classes3.push(key);
|
|
2022
|
-
}
|
|
2023
|
-
return classes3.join(" ");
|
|
2024
|
-
}
|
|
2025
|
-
function fclasses(definition) {
|
|
2026
|
-
const defn = {};
|
|
2027
|
-
for (const [key, value] of Object.entries(definition)) {
|
|
2028
|
-
for (const className of key.split(" ")) {
|
|
2029
|
-
defn[className] = value;
|
|
2030
|
-
}
|
|
2031
|
-
}
|
|
2032
|
-
return classMap(defn);
|
|
2033
|
-
}
|
|
2034
1998
|
function generateRandomId() {
|
|
2035
1999
|
return `m${Math.random().toString(36).slice(2)}`;
|
|
2036
2000
|
}
|
|
2037
2001
|
|
|
2038
2002
|
// packages/affix/index.js
|
|
2039
|
-
var WarpAffix = class extends WarpElement {
|
|
2003
|
+
var WarpAffix = class extends kebabCaseAttributes(WarpElement) {
|
|
2040
2004
|
get _classBase() {
|
|
2041
2005
|
return this.slot === "suffix" ? suffix : prefix;
|
|
2042
2006
|
}
|
|
2043
2007
|
get _classes() {
|
|
2044
|
-
return
|
|
2045
|
-
[this._classBase.wrapper]: true,
|
|
2046
|
-
[this._classBase.wrapperWithLabel]: this.label,
|
|
2047
|
-
[this._classBase.wrapperWithIcon]: !this.label
|
|
2048
|
-
});
|
|
2008
|
+
return r([this._classBase.wrapper, this.label ? this._classBase.wrapperWithLabel : this._classBase.wrapperWithIcon]);
|
|
2049
2009
|
}
|
|
2050
2010
|
get _searchButton() {
|
|
2051
2011
|
return html3`
|
|
@@ -2081,35 +2041,22 @@ var WarpAffix = class extends WarpElement {
|
|
|
2081
2041
|
return html3`${this._markup}`;
|
|
2082
2042
|
}
|
|
2083
2043
|
};
|
|
2084
|
-
__publicField(WarpAffix, "styles", [WarpElement.styles]);
|
|
2085
2044
|
__publicField(WarpAffix, "properties", {
|
|
2086
|
-
ariaLabel: { type: String
|
|
2045
|
+
ariaLabel: { type: String },
|
|
2087
2046
|
clear: { type: Boolean },
|
|
2088
2047
|
search: { type: Boolean },
|
|
2089
2048
|
label: { type: String }
|
|
2090
2049
|
});
|
|
2050
|
+
__publicField(WarpAffix, "styles", [WarpElement.styles]);
|
|
2091
2051
|
if (!customElements.get("w-affix")) {
|
|
2092
2052
|
customElements.define("w-affix", WarpAffix);
|
|
2093
2053
|
}
|
|
2094
2054
|
|
|
2095
2055
|
// packages/alert/index.js
|
|
2096
2056
|
import { css, html as html8 } from "lit";
|
|
2097
|
-
|
|
2098
|
-
// node_modules/.pnpm/@chbphone55+classnames@2.0.0/node_modules/@chbphone55/classnames/dist/index.m.js
|
|
2099
|
-
var r = function() {
|
|
2100
|
-
for (var t = [], n2 = arguments.length; n2--; )
|
|
2101
|
-
t[n2] = arguments[n2];
|
|
2102
|
-
return t.reduce(function(t2, n3) {
|
|
2103
|
-
return t2.concat("string" == typeof n3 ? n3 : Array.isArray(n3) ? r.apply(void 0, n3) : "object" == typeof n3 && n3 ? Object.keys(n3).map(function(r3) {
|
|
2104
|
-
return n3[r3] ? r3 : "";
|
|
2105
|
-
}) : "");
|
|
2106
|
-
}, []).join(" ");
|
|
2107
|
-
};
|
|
2108
|
-
|
|
2109
|
-
// packages/alert/index.js
|
|
2110
2057
|
import WarpElement2 from "@warp-ds/elements-core";
|
|
2111
2058
|
|
|
2112
|
-
// node_modules/.pnpm/@warp-ds+icons@2.0.
|
|
2059
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/info-16.js
|
|
2113
2060
|
import { LitElement as LitElement3 } from "lit";
|
|
2114
2061
|
import { unsafeStatic as unsafeStatic3, html as html4 } from "lit/static-html.js";
|
|
2115
2062
|
var messages5 = JSON.parse('{"icon.title.info":"Informasjonssirkel"}');
|
|
@@ -2200,7 +2147,7 @@ if (!customElements.get("w-icon-info-16")) {
|
|
|
2200
2147
|
customElements.define("w-icon-info-16", IconInfo16);
|
|
2201
2148
|
}
|
|
2202
2149
|
|
|
2203
|
-
// node_modules/.pnpm/@warp-ds+icons@2.0.
|
|
2150
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/warning-16.js
|
|
2204
2151
|
import { LitElement as LitElement4 } from "lit";
|
|
2205
2152
|
import { unsafeStatic as unsafeStatic4, html as html5 } from "lit/static-html.js";
|
|
2206
2153
|
var messages6 = JSON.parse('{"icon.title.warning":"Varseltrekant med utropstegn"}');
|
|
@@ -2291,7 +2238,7 @@ if (!customElements.get("w-icon-warning-16")) {
|
|
|
2291
2238
|
customElements.define("w-icon-warning-16", IconWarning16);
|
|
2292
2239
|
}
|
|
2293
2240
|
|
|
2294
|
-
// node_modules/.pnpm/@warp-ds+icons@2.0.
|
|
2241
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/error-16.js
|
|
2295
2242
|
import { LitElement as LitElement5 } from "lit";
|
|
2296
2243
|
import { unsafeStatic as unsafeStatic5, html as html6 } from "lit/static-html.js";
|
|
2297
2244
|
var messages7 = JSON.parse('{"icon.title.error":"\xC5ttekant med utropstegn"}');
|
|
@@ -2382,7 +2329,7 @@ if (!customElements.get("w-icon-error-16")) {
|
|
|
2382
2329
|
customElements.define("w-icon-error-16", IconError16);
|
|
2383
2330
|
}
|
|
2384
2331
|
|
|
2385
|
-
// node_modules/.pnpm/@warp-ds+icons@2.0.
|
|
2332
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/success-16.js
|
|
2386
2333
|
import { LitElement as LitElement6 } from "lit";
|
|
2387
2334
|
import { unsafeStatic as unsafeStatic6, html as html7 } from "lit/static-html.js";
|
|
2388
2335
|
var messages8 = JSON.parse('{"icon.title.success":"Sirkel med sjekkmerke"}');
|
|
@@ -2493,17 +2440,11 @@ var WarpAlert = class extends WarpElement2 {
|
|
|
2493
2440
|
}
|
|
2494
2441
|
}
|
|
2495
2442
|
get _wrapperClasses() {
|
|
2496
|
-
return r(
|
|
2497
|
-
[alert.alert]: true,
|
|
2498
|
-
[alert[this.variant]]: true
|
|
2499
|
-
});
|
|
2443
|
+
return r([alert.wrapper, alert[this.variant]]);
|
|
2500
2444
|
}
|
|
2501
2445
|
get _iconClasses() {
|
|
2502
2446
|
const activeIconClassNames = alert[`${this.variant}Icon`];
|
|
2503
|
-
return r(
|
|
2504
|
-
[alert.icon]: true,
|
|
2505
|
-
[activeIconClassNames]: true
|
|
2506
|
-
});
|
|
2447
|
+
return r([alert.icon, activeIconClassNames]);
|
|
2507
2448
|
}
|
|
2508
2449
|
get _icon() {
|
|
2509
2450
|
if (this.variant === variants.info) {
|
|
@@ -2517,8 +2458,7 @@ var WarpAlert = class extends WarpElement2 {
|
|
|
2517
2458
|
}
|
|
2518
2459
|
if (this.variant === variants.positive) {
|
|
2519
2460
|
return html8`<w-icon-success-16></w-icon-success-16>`;
|
|
2520
|
-
} else
|
|
2521
|
-
return "";
|
|
2461
|
+
} else return "";
|
|
2522
2462
|
}
|
|
2523
2463
|
render() {
|
|
2524
2464
|
return html8`
|
|
@@ -2563,7 +2503,7 @@ if (!customElements.get("w-alert")) {
|
|
|
2563
2503
|
// packages/attention/index.js
|
|
2564
2504
|
import { css as css2, html as html9, nothing } from "lit";
|
|
2565
2505
|
|
|
2566
|
-
// node_modules/.pnpm/@floating-ui+utils@0.2.
|
|
2506
|
+
// node_modules/.pnpm/@floating-ui+utils@0.2.7/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
2567
2507
|
var sides = ["top", "right", "bottom", "left"];
|
|
2568
2508
|
var min = Math.min;
|
|
2569
2509
|
var max = Math.max;
|
|
@@ -2634,8 +2574,7 @@ function getSideList(side2, isStart, rtl) {
|
|
|
2634
2574
|
switch (side2) {
|
|
2635
2575
|
case "top":
|
|
2636
2576
|
case "bottom":
|
|
2637
|
-
if (rtl)
|
|
2638
|
-
return isStart ? rl : lr;
|
|
2577
|
+
if (rtl) return isStart ? rl : lr;
|
|
2639
2578
|
return isStart ? lr : rl;
|
|
2640
2579
|
case "left":
|
|
2641
2580
|
case "right":
|
|
@@ -2693,7 +2632,7 @@ function rectToClientRect(rect) {
|
|
|
2693
2632
|
};
|
|
2694
2633
|
}
|
|
2695
2634
|
|
|
2696
|
-
// node_modules/.pnpm/@floating-ui+core@1.6.
|
|
2635
|
+
// node_modules/.pnpm/@floating-ui+core@1.6.7/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
|
|
2697
2636
|
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
2698
2637
|
let {
|
|
2699
2638
|
reference,
|
|
@@ -2930,14 +2869,14 @@ var arrow = (options) => ({
|
|
|
2930
2869
|
const min$1 = minPadding;
|
|
2931
2870
|
const max2 = clientSize - arrowDimensions[length] - maxPadding;
|
|
2932
2871
|
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
2933
|
-
const
|
|
2934
|
-
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !==
|
|
2872
|
+
const offset3 = clamp(min$1, center, max2);
|
|
2873
|
+
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset3 && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
2935
2874
|
const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max2 : 0;
|
|
2936
2875
|
return {
|
|
2937
2876
|
[axis]: coords[axis] + alignmentOffset,
|
|
2938
2877
|
data: __spreadValues({
|
|
2939
|
-
[axis]:
|
|
2940
|
-
centerOffset: center -
|
|
2878
|
+
[axis]: offset3,
|
|
2879
|
+
centerOffset: center - offset3 - alignmentOffset
|
|
2941
2880
|
}, shouldAddOffset && {
|
|
2942
2881
|
alignmentOffset
|
|
2943
2882
|
}),
|
|
@@ -2981,10 +2920,12 @@ var flip = function(options) {
|
|
|
2981
2920
|
return {};
|
|
2982
2921
|
}
|
|
2983
2922
|
const side2 = getSide(placement);
|
|
2923
|
+
const initialSideAxis = getSideAxis(initialPlacement);
|
|
2984
2924
|
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
2985
2925
|
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
|
|
2986
2926
|
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
2987
|
-
|
|
2927
|
+
const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
|
|
2928
|
+
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
|
|
2988
2929
|
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
2989
2930
|
}
|
|
2990
2931
|
const placements2 = [initialPlacement, ...fallbackPlacements];
|
|
@@ -3021,8 +2962,16 @@ var flip = function(options) {
|
|
|
3021
2962
|
if (!resetPlacement) {
|
|
3022
2963
|
switch (fallbackStrategy) {
|
|
3023
2964
|
case "bestFit": {
|
|
3024
|
-
var _overflowsData$
|
|
3025
|
-
const placement2 = (_overflowsData$
|
|
2965
|
+
var _overflowsData$filter2;
|
|
2966
|
+
const placement2 = (_overflowsData$filter2 = overflowsData.filter((d2) => {
|
|
2967
|
+
if (hasFallbackAxisSideDirection) {
|
|
2968
|
+
const currentSideAxis = getSideAxis(d2.placement);
|
|
2969
|
+
return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
|
|
2970
|
+
// reading directions favoring greater width.
|
|
2971
|
+
currentSideAxis === "y";
|
|
2972
|
+
}
|
|
2973
|
+
return true;
|
|
2974
|
+
}).map((d2) => [d2.placement, d2.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a2, b2) => a2[1] - b2[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
|
|
3026
2975
|
if (placement2) {
|
|
3027
2976
|
resetPlacement = placement2;
|
|
3028
2977
|
}
|
|
@@ -3171,7 +3120,7 @@ var offset = function(options) {
|
|
|
3171
3120
|
};
|
|
3172
3121
|
};
|
|
3173
3122
|
|
|
3174
|
-
// node_modules/.pnpm/@floating-ui+utils@0.2.
|
|
3123
|
+
// node_modules/.pnpm/@floating-ui+utils@0.2.7/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
|
|
3175
3124
|
function getNodeName(node) {
|
|
3176
3125
|
if (isNode(node)) {
|
|
3177
3126
|
return (node.nodeName || "").toLowerCase();
|
|
@@ -3213,9 +3162,18 @@ function isOverflowElement(element) {
|
|
|
3213
3162
|
function isTableElement(element) {
|
|
3214
3163
|
return ["table", "td", "th"].includes(getNodeName(element));
|
|
3215
3164
|
}
|
|
3216
|
-
function
|
|
3165
|
+
function isTopLayer(element) {
|
|
3166
|
+
return [":popover-open", ":modal"].some((selector) => {
|
|
3167
|
+
try {
|
|
3168
|
+
return element.matches(selector);
|
|
3169
|
+
} catch (e) {
|
|
3170
|
+
return false;
|
|
3171
|
+
}
|
|
3172
|
+
});
|
|
3173
|
+
}
|
|
3174
|
+
function isContainingBlock(elementOrCss) {
|
|
3217
3175
|
const webkit = isWebKit();
|
|
3218
|
-
const css11 = getComputedStyle(
|
|
3176
|
+
const css11 = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
|
|
3219
3177
|
return css11.transform !== "none" || css11.perspective !== "none" || (css11.containerType ? css11.containerType !== "normal" : false) || !webkit && (css11.backdropFilter ? css11.backdropFilter !== "none" : false) || !webkit && (css11.filter ? css11.filter !== "none" : false) || ["transform", "perspective", "filter"].some((value) => (css11.willChange || "").includes(value)) || ["paint", "layout", "strict", "content"].some((value) => (css11.contain || "").includes(value));
|
|
3220
3178
|
}
|
|
3221
3179
|
function getContainingBlock(element) {
|
|
@@ -3223,14 +3181,15 @@ function getContainingBlock(element) {
|
|
|
3223
3181
|
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
3224
3182
|
if (isContainingBlock(currentNode)) {
|
|
3225
3183
|
return currentNode;
|
|
3184
|
+
} else if (isTopLayer(currentNode)) {
|
|
3185
|
+
return null;
|
|
3226
3186
|
}
|
|
3227
3187
|
currentNode = getParentNode(currentNode);
|
|
3228
3188
|
}
|
|
3229
3189
|
return null;
|
|
3230
3190
|
}
|
|
3231
3191
|
function isWebKit() {
|
|
3232
|
-
if (typeof CSS === "undefined" || !CSS.supports)
|
|
3233
|
-
return false;
|
|
3192
|
+
if (typeof CSS === "undefined" || !CSS.supports) return false;
|
|
3234
3193
|
return CSS.supports("-webkit-backdrop-filter", "none");
|
|
3235
3194
|
}
|
|
3236
3195
|
function isLastTraversableNode(node) {
|
|
@@ -3247,8 +3206,8 @@ function getNodeScroll(element) {
|
|
|
3247
3206
|
};
|
|
3248
3207
|
}
|
|
3249
3208
|
return {
|
|
3250
|
-
scrollLeft: element.
|
|
3251
|
-
scrollTop: element.
|
|
3209
|
+
scrollLeft: element.scrollX,
|
|
3210
|
+
scrollTop: element.scrollY
|
|
3252
3211
|
};
|
|
3253
3212
|
}
|
|
3254
3213
|
function getParentNode(node) {
|
|
@@ -3286,12 +3245,16 @@ function getOverflowAncestors(node, list, traverseIframes) {
|
|
|
3286
3245
|
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
3287
3246
|
const win = getWindow(scrollableAncestor);
|
|
3288
3247
|
if (isBody) {
|
|
3289
|
-
|
|
3248
|
+
const frameElement = getFrameElement(win);
|
|
3249
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
3290
3250
|
}
|
|
3291
3251
|
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
3292
3252
|
}
|
|
3253
|
+
function getFrameElement(win) {
|
|
3254
|
+
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
3255
|
+
}
|
|
3293
3256
|
|
|
3294
|
-
// node_modules/.pnpm/@floating-ui+dom@1.6.
|
|
3257
|
+
// node_modules/.pnpm/@floating-ui+dom@1.6.10/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
|
|
3295
3258
|
function getCssDimensions(element) {
|
|
3296
3259
|
const css11 = getComputedStyle(element);
|
|
3297
3260
|
let width = parseFloat(css11.width) || 0;
|
|
@@ -3385,7 +3348,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
3385
3348
|
const win = getWindow(domElement);
|
|
3386
3349
|
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
3387
3350
|
let currentWin = win;
|
|
3388
|
-
let currentIFrame = currentWin
|
|
3351
|
+
let currentIFrame = getFrameElement(currentWin);
|
|
3389
3352
|
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
3390
3353
|
const iframeScale = getScale(currentIFrame);
|
|
3391
3354
|
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
@@ -3399,7 +3362,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
3399
3362
|
x += left;
|
|
3400
3363
|
y2 += top;
|
|
3401
3364
|
currentWin = getWindow(currentIFrame);
|
|
3402
|
-
currentIFrame = currentWin
|
|
3365
|
+
currentIFrame = getFrameElement(currentWin);
|
|
3403
3366
|
}
|
|
3404
3367
|
}
|
|
3405
3368
|
return rectToClientRect({
|
|
@@ -3409,16 +3372,6 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
3409
3372
|
y: y2
|
|
3410
3373
|
});
|
|
3411
3374
|
}
|
|
3412
|
-
var topLayerSelectors = [":popover-open", ":modal"];
|
|
3413
|
-
function isTopLayer(floating) {
|
|
3414
|
-
return topLayerSelectors.some((selector) => {
|
|
3415
|
-
try {
|
|
3416
|
-
return floating.matches(selector);
|
|
3417
|
-
} catch (e) {
|
|
3418
|
-
return false;
|
|
3419
|
-
}
|
|
3420
|
-
});
|
|
3421
|
-
}
|
|
3422
3375
|
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
3423
3376
|
let {
|
|
3424
3377
|
elements,
|
|
@@ -3578,7 +3531,7 @@ function getClippingRect(_ref) {
|
|
|
3578
3531
|
rootBoundary,
|
|
3579
3532
|
strategy
|
|
3580
3533
|
} = _ref;
|
|
3581
|
-
const elementClippingAncestors = boundary === "clippingAncestors" ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
3534
|
+
const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
3582
3535
|
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
3583
3536
|
const firstClippingAncestor = clippingAncestors[0];
|
|
3584
3537
|
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
@@ -3637,6 +3590,9 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
3637
3590
|
height: rect.height
|
|
3638
3591
|
};
|
|
3639
3592
|
}
|
|
3593
|
+
function isStaticPositioned(element) {
|
|
3594
|
+
return getComputedStyle(element).position === "static";
|
|
3595
|
+
}
|
|
3640
3596
|
function getTrueOffsetParent(element, polyfill) {
|
|
3641
3597
|
if (!isHTMLElement(element) || getComputedStyle(element).position === "fixed") {
|
|
3642
3598
|
return null;
|
|
@@ -3647,28 +3603,41 @@ function getTrueOffsetParent(element, polyfill) {
|
|
|
3647
3603
|
return element.offsetParent;
|
|
3648
3604
|
}
|
|
3649
3605
|
function getOffsetParent(element, polyfill) {
|
|
3650
|
-
const
|
|
3651
|
-
if (
|
|
3652
|
-
return
|
|
3606
|
+
const win = getWindow(element);
|
|
3607
|
+
if (isTopLayer(element)) {
|
|
3608
|
+
return win;
|
|
3609
|
+
}
|
|
3610
|
+
if (!isHTMLElement(element)) {
|
|
3611
|
+
let svgOffsetParent = getParentNode(element);
|
|
3612
|
+
while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
|
|
3613
|
+
if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
|
|
3614
|
+
return svgOffsetParent;
|
|
3615
|
+
}
|
|
3616
|
+
svgOffsetParent = getParentNode(svgOffsetParent);
|
|
3617
|
+
}
|
|
3618
|
+
return win;
|
|
3653
3619
|
}
|
|
3654
3620
|
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
3655
|
-
while (offsetParent && isTableElement(offsetParent) &&
|
|
3621
|
+
while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
|
|
3656
3622
|
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
3657
3623
|
}
|
|
3658
|
-
if (offsetParent && (
|
|
3659
|
-
return
|
|
3624
|
+
if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
|
|
3625
|
+
return win;
|
|
3660
3626
|
}
|
|
3661
|
-
return offsetParent || getContainingBlock(element) ||
|
|
3627
|
+
return offsetParent || getContainingBlock(element) || win;
|
|
3662
3628
|
}
|
|
3663
3629
|
var getElementRects = async function(data) {
|
|
3664
3630
|
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
3665
3631
|
const getDimensionsFn = this.getDimensions;
|
|
3632
|
+
const floatingDimensions = await getDimensionsFn(data.floating);
|
|
3666
3633
|
return {
|
|
3667
3634
|
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
|
|
3668
|
-
floating:
|
|
3635
|
+
floating: {
|
|
3669
3636
|
x: 0,
|
|
3670
|
-
y: 0
|
|
3671
|
-
|
|
3637
|
+
y: 0,
|
|
3638
|
+
width: floatingDimensions.width,
|
|
3639
|
+
height: floatingDimensions.height
|
|
3640
|
+
}
|
|
3672
3641
|
};
|
|
3673
3642
|
};
|
|
3674
3643
|
function isRTL(element) {
|
|
@@ -3686,6 +3655,7 @@ var platform = {
|
|
|
3686
3655
|
isElement,
|
|
3687
3656
|
isRTL
|
|
3688
3657
|
};
|
|
3658
|
+
var offset2 = offset;
|
|
3689
3659
|
var flip2 = flip;
|
|
3690
3660
|
var hide2 = hide;
|
|
3691
3661
|
var arrow2 = arrow;
|
|
@@ -3702,7 +3672,7 @@ var computePosition2 = (reference, floating, options) => {
|
|
|
3702
3672
|
}));
|
|
3703
3673
|
};
|
|
3704
3674
|
|
|
3705
|
-
// node_modules/.pnpm/@warp-ds+core@1.1.
|
|
3675
|
+
// node_modules/.pnpm/@warp-ds+core@1.1.5_@floating-ui+dom@1.6.10/node_modules/@warp-ds/core/dist/attention/utils/helpers.js
|
|
3706
3676
|
var TOP_START = "top-start";
|
|
3707
3677
|
var TOP = "top";
|
|
3708
3678
|
var TOP_END = "top-end";
|
|
@@ -3793,10 +3763,12 @@ async function useRecompute(state) {
|
|
|
3793
3763
|
computePosition2(targetEl, attentionEl, {
|
|
3794
3764
|
placement: (_a = state == null ? void 0 : state.directionName) != null ? _a : BOTTOM,
|
|
3795
3765
|
middleware: [
|
|
3796
|
-
|
|
3766
|
+
offset2({ mainAxis: (_b = state == null ? void 0 : state.distance) != null ? _b : 8, crossAxis: (_c = state == null ? void 0 : state.skidding) != null ? _c : 0 }),
|
|
3767
|
+
// offers flexibility over how to place the attentionEl towards its targetEl both on the x and y axis (horizontally and vertically).
|
|
3797
3768
|
(state == null ? void 0 : state.flip) && flip2({
|
|
3798
3769
|
// when flip is set to true it will move the attentionEl's placement to its opposite side or to the preferred placements if fallbackPlacements has a value
|
|
3799
3770
|
crossAxis: state == null ? void 0 : state.crossAxis,
|
|
3771
|
+
// checks overflow to trigger a flip. When disabled, it will ignore overflow
|
|
3800
3772
|
fallbackPlacements: state == null ? void 0 : state.fallbackPlacements
|
|
3801
3773
|
}),
|
|
3802
3774
|
!(state == null ? void 0 : state.noArrow) && (state == null ? void 0 : state.arrowEl) && arrow2({ element: state == null ? void 0 : state.arrowEl }),
|
|
@@ -3878,18 +3850,15 @@ function detectLocale7() {
|
|
|
3878
3850
|
}
|
|
3879
3851
|
}
|
|
3880
3852
|
var getMessages7 = (locale, enMsg, nbMsg, fiMsg, daMsg) => {
|
|
3881
|
-
if (locale === "nb")
|
|
3882
|
-
|
|
3883
|
-
if (locale === "
|
|
3884
|
-
return fiMsg;
|
|
3885
|
-
if (locale === "da")
|
|
3886
|
-
return daMsg;
|
|
3853
|
+
if (locale === "nb") return nbMsg;
|
|
3854
|
+
if (locale === "fi") return fiMsg;
|
|
3855
|
+
if (locale === "da") return daMsg;
|
|
3887
3856
|
return enMsg;
|
|
3888
3857
|
};
|
|
3889
3858
|
var activateI18n7 = (enMessages, nbMessages, fiMessages, daMessages) => {
|
|
3890
3859
|
const locale = detectLocale7();
|
|
3891
|
-
const
|
|
3892
|
-
i18n.load(locale,
|
|
3860
|
+
const messages52 = getMessages7(locale, enMessages, nbMessages, fiMessages, daMessages);
|
|
3861
|
+
i18n.load(locale, messages52);
|
|
3893
3862
|
i18n.activate(locale);
|
|
3894
3863
|
};
|
|
3895
3864
|
|
|
@@ -3983,11 +3952,11 @@ ${JSON.stringify(directions)}`
|
|
|
3983
3952
|
return opposites[this._actualDirection];
|
|
3984
3953
|
}
|
|
3985
3954
|
get _arrowClasses() {
|
|
3986
|
-
return
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
[this.
|
|
3990
|
-
|
|
3955
|
+
return r([
|
|
3956
|
+
attention.arrowBase,
|
|
3957
|
+
this._activeVariantClasses.arrow,
|
|
3958
|
+
attention[`arrowDirection${arrowDirectionClassname(this._arrowDirection)}`]
|
|
3959
|
+
]);
|
|
3991
3960
|
}
|
|
3992
3961
|
get _arrowHtml() {
|
|
3993
3962
|
return this.noArrow ? "" : html9`<div id="arrow" role="img" class="${this._arrowClasses}"></div>`;
|
|
@@ -4018,10 +3987,7 @@ ${JSON.stringify(directions)}`
|
|
|
4018
3987
|
return messageSlot ? messageSlot.assignedNodes()[0] : null;
|
|
4019
3988
|
}
|
|
4020
3989
|
get _wrapperClasses() {
|
|
4021
|
-
return
|
|
4022
|
-
[attention.base]: true,
|
|
4023
|
-
[this._activeVariantClasses.wrapper]: true
|
|
4024
|
-
});
|
|
3990
|
+
return r([attention.base, this._activeVariantClasses.wrapper]);
|
|
4025
3991
|
}
|
|
4026
3992
|
get _ariaClose() {
|
|
4027
3993
|
return i18n._({
|
|
@@ -4153,16 +4119,14 @@ ${JSON.stringify(directions)}`
|
|
|
4153
4119
|
this.updateComplete.then(() => this.dispatchEvent(event));
|
|
4154
4120
|
}
|
|
4155
4121
|
keypressed(e) {
|
|
4156
|
-
if (!this.canClose)
|
|
4157
|
-
return;
|
|
4122
|
+
if (!this.canClose) return;
|
|
4158
4123
|
if (e.key === "Escape") {
|
|
4159
4124
|
e.preventDefault();
|
|
4160
4125
|
this.close();
|
|
4161
4126
|
}
|
|
4162
4127
|
}
|
|
4163
4128
|
render() {
|
|
4164
|
-
if (!this.callout && this._targetEl === void 0)
|
|
4165
|
-
return html9``;
|
|
4129
|
+
if (!this.callout && this._targetEl === void 0) return html9``;
|
|
4166
4130
|
return html9`
|
|
4167
4131
|
<div class=${ifDefined2(this.className ? this.className : void 0)}>
|
|
4168
4132
|
${this.placement === "right-start" || this.placement === "right" || this.placement === "right-end" || this.placement === "bottom-start" || this.placement === "bottom" || this.placement === "bottom-end" ? html9`
|
|
@@ -4245,15 +4209,15 @@ var WarpBadge = class extends WarpElement4 {
|
|
|
4245
4209
|
this.variant = "neutral";
|
|
4246
4210
|
}
|
|
4247
4211
|
get _class() {
|
|
4248
|
-
return
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4212
|
+
return r([
|
|
4213
|
+
badge.base,
|
|
4214
|
+
badge[this.variant],
|
|
4215
|
+
!!this.position && badge.positionBase,
|
|
4216
|
+
this.position === "top-left" && badge.positionTL,
|
|
4217
|
+
this.position === "top-right" && badge.positionTR,
|
|
4218
|
+
this.position === "bottom-right" && badge.positionBR,
|
|
4219
|
+
this.position === "bottom-left" && badge.positionBL
|
|
4220
|
+
]);
|
|
4257
4221
|
}
|
|
4258
4222
|
render() {
|
|
4259
4223
|
return html10`
|
|
@@ -4281,13 +4245,13 @@ import { css as css3, html as html11, nothing as nothing2 } from "lit";
|
|
|
4281
4245
|
import WarpElement5 from "@warp-ds/elements-core";
|
|
4282
4246
|
var WarpBox = class extends WarpElement5 {
|
|
4283
4247
|
get _class() {
|
|
4284
|
-
return
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4248
|
+
return r([
|
|
4249
|
+
box.base,
|
|
4250
|
+
this.bleed && box.bleed,
|
|
4251
|
+
this.info && box.info,
|
|
4252
|
+
this.neutral && box.neutral,
|
|
4253
|
+
this.bordered && box.bordered
|
|
4254
|
+
]);
|
|
4291
4255
|
}
|
|
4292
4256
|
get _optOutRoleWithDefault() {
|
|
4293
4257
|
var _a;
|
|
@@ -4330,7 +4294,7 @@ if (!customElements.get("w-box")) {
|
|
|
4330
4294
|
// packages/breadcrumbs/index.js
|
|
4331
4295
|
import { html as html12 } from "lit";
|
|
4332
4296
|
|
|
4333
|
-
// node_modules/.pnpm/@warp-ds+core@1.1.
|
|
4297
|
+
// node_modules/.pnpm/@warp-ds+core@1.1.5_@floating-ui+dom@1.6.10/node_modules/@warp-ds/core/dist/breadcrumbs/index.js
|
|
4334
4298
|
function interleave(array, separator2) {
|
|
4335
4299
|
return array.flatMap((el) => [el, separator2]).slice(0, -1);
|
|
4336
4300
|
}
|
|
@@ -4435,11 +4399,11 @@ var WarpBroadcast = class extends WarpElement7 {
|
|
|
4435
4399
|
this._hiddenMessageIds = [.../* @__PURE__ */ new Set([...this._hiddenMessageIds, id])];
|
|
4436
4400
|
}
|
|
4437
4401
|
render() {
|
|
4438
|
-
const
|
|
4402
|
+
const messages52 = this._messages.filter((item) => !this._hiddenMessageIds.includes(item.id));
|
|
4439
4403
|
return html13`
|
|
4440
|
-
<aside class=${`${
|
|
4404
|
+
<aside class=${`${messages52.length === 0 ? "hidden" : "mb-16"}`}>
|
|
4441
4405
|
${repeat(
|
|
4442
|
-
|
|
4406
|
+
messages52,
|
|
4443
4407
|
({ id }) => `broadcast-${id}`,
|
|
4444
4408
|
({ id, message }) => html13`<w-toast id="broadcast-${id}" type="warning" text="${message}" canclose @close=${() => this._del(id)}> </w-toast>`
|
|
4445
4409
|
)}
|
|
@@ -4451,8 +4415,7 @@ __publicField(WarpBroadcast, "properties", {
|
|
|
4451
4415
|
_messages: {
|
|
4452
4416
|
state: true,
|
|
4453
4417
|
hasChanged(newVal, oldVal) {
|
|
4454
|
-
if (!oldVal || oldVal.length === 0)
|
|
4455
|
-
return true;
|
|
4418
|
+
if (!oldVal || oldVal.length === 0) return true;
|
|
4456
4419
|
const newIds = newVal.map(({ id }) => id).sort();
|
|
4457
4420
|
const oldIds = oldVal.map(({ id }) => id).sort();
|
|
4458
4421
|
return JSON.stringify(newIds) !== JSON.stringify(oldIds);
|
|
@@ -4514,59 +4477,66 @@ ${buttonTypes2.join(", ")}.`);
|
|
|
4514
4477
|
setTimeout(() => this.focus(), 0);
|
|
4515
4478
|
}
|
|
4516
4479
|
}
|
|
4480
|
+
get _primaryClasses() {
|
|
4481
|
+
return [
|
|
4482
|
+
!this.small && !this.quiet && !this.loading && button.primary,
|
|
4483
|
+
this.small && !this.quiet && !this.loading && button.primarySmall,
|
|
4484
|
+
this.small && this.quiet && !this.loading && button.primarySmallQuiet,
|
|
4485
|
+
this.small && this.loading && (this.quiet ? button.primarySmallQuietLoading : button.primarySmallLoading),
|
|
4486
|
+
!this.small && this.quiet && !this.loading && button.primaryQuiet,
|
|
4487
|
+
!this.small && this.loading && (this.quiet ? button.primaryQuietLoading : button.primaryLoading)
|
|
4488
|
+
];
|
|
4489
|
+
}
|
|
4490
|
+
get _secondaryClasses() {
|
|
4491
|
+
return [
|
|
4492
|
+
!this.small && !this.quiet && !this.loading && button.secondary,
|
|
4493
|
+
this.small && !this.quiet && !this.loading && button.secondarySmall,
|
|
4494
|
+
this.small && this.loading && (this.quiet ? button.secondarySmallQuietLoading : button.secondarySmallLoading),
|
|
4495
|
+
this.small && this.quiet && !this.loading && button.secondarySmallQuiet,
|
|
4496
|
+
!this.small && this.quiet && !this.loading && button.secondaryQuiet,
|
|
4497
|
+
!this.small && this.loading && (this.quiet ? button.secondaryQuietLoading : button.secondaryLoading)
|
|
4498
|
+
];
|
|
4499
|
+
}
|
|
4500
|
+
get _utilityClasses() {
|
|
4501
|
+
return [
|
|
4502
|
+
!this.small && !this.quiet && !this.loading && button.utility,
|
|
4503
|
+
this.small && !this.quiet && !this.loading && button.utilitySmall,
|
|
4504
|
+
this.small && this.quiet && !this.loading && button.utilitySmallQuiet,
|
|
4505
|
+
this.small && this.loading && (this.quiet ? button.utilitySmallQuietLoading : button.utilitySmallLoading),
|
|
4506
|
+
!this.small && this.quiet && !this.loading && button.utilityQuiet,
|
|
4507
|
+
!this.small && this.loading && (this.quiet ? button.utilityQuietLoading : button.utilityLoading)
|
|
4508
|
+
];
|
|
4509
|
+
}
|
|
4510
|
+
get _negativeClasses() {
|
|
4511
|
+
return [
|
|
4512
|
+
!this.small && !this.quiet && !this.loading && button.negative,
|
|
4513
|
+
this.small && !this.quiet && !this.loading && button.negativeSmall,
|
|
4514
|
+
this.small && this.quiet && !this.loading && button.negativeSmallQuiet,
|
|
4515
|
+
this.small && this.loading && (this.quiet ? button.negativeSmallQuietLoading : button.negativeSmallLoading),
|
|
4516
|
+
!this.small && this.quiet && !this.loading && button.negativeQuiet,
|
|
4517
|
+
!this.small && this.loading && (this.quiet ? button.negativeQuietLoading : button.negativeLoading)
|
|
4518
|
+
];
|
|
4519
|
+
}
|
|
4520
|
+
get _pillClasses() {
|
|
4521
|
+
return [
|
|
4522
|
+
!this.loading && (this.small ? button.pillSmall : button.pill),
|
|
4523
|
+
this.loading && (this.small ? button.pillSmallLoading : button.pillLoading)
|
|
4524
|
+
];
|
|
4525
|
+
}
|
|
4526
|
+
get _linkClasses() {
|
|
4527
|
+
return [this.small ? button.linkSmall : button.link];
|
|
4528
|
+
}
|
|
4517
4529
|
get _classes() {
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
[button.secondarySmallLoading]: secondary && this.small && !this.quiet && this.loading,
|
|
4529
|
-
[button.secondarySmallQuiet]: secondary && this.small && this.quiet && !this.loading,
|
|
4530
|
-
[button.secondarySmallQuietLoading]: secondary && this.small && this.quiet && this.loading,
|
|
4531
|
-
[button.secondaryQuiet]: secondary && !this.small && this.quiet && !this.loading,
|
|
4532
|
-
[button.secondaryQuietLoading]: secondary && !this.small && this.quiet && this.loading,
|
|
4533
|
-
[button.secondaryLoading]: secondary && !this.small && !this.quiet && this.loading,
|
|
4534
|
-
[button.primary]: primary && !this.small && !this.quiet && !this.loading,
|
|
4535
|
-
[button.primarySmall]: primary && this.small && !this.quiet && !this.loading,
|
|
4536
|
-
[button.primarySmallQuiet]: primary && this.small && this.quiet && !this.loading,
|
|
4537
|
-
[button.primarySmallLoading]: primary && this.small && !this.quiet && this.loading,
|
|
4538
|
-
[button.primarySmallQuietLoading]: primary && this.small && this.quiet && this.loading,
|
|
4539
|
-
[button.primaryQuiet]: primary && !this.small && this.quiet && !this.loading,
|
|
4540
|
-
[button.primaryQuietLoading]: primary && !this.small && this.quiet && this.loading,
|
|
4541
|
-
[button.primaryLoading]: primary && !this.small && !this.quiet && this.loading,
|
|
4542
|
-
[button.utility]: utility && !this.small && !this.quiet && !this.loading,
|
|
4543
|
-
[button.utilitySmall]: utility && this.small && !this.quiet && !this.loading,
|
|
4544
|
-
[button.utilitySmallQuiet]: utility && this.small && this.quiet && !this.loading,
|
|
4545
|
-
[button.utilitySmallLoading]: utility && this.small && !this.quiet && this.loading,
|
|
4546
|
-
[button.utilitySmallQuietLoading]: utility && this.small && this.quiet && this.loading,
|
|
4547
|
-
[button.utilityQuiet]: utility && !this.small && this.quiet && !this.loading,
|
|
4548
|
-
[button.utilityQuietLoading]: utility && !this.small && this.quiet && this.loading,
|
|
4549
|
-
[button.utilityLoading]: utility && !this.small && !this.quiet && this.loading,
|
|
4550
|
-
[button.negative]: negative && !this.small && !this.quiet && !this.loading,
|
|
4551
|
-
[button.negativeSmall]: negative && this.small && !this.quiet && !this.loading,
|
|
4552
|
-
[button.negativeSmallQuiet]: negative && this.small && this.quiet && !this.loading,
|
|
4553
|
-
[button.negativeSmallLoading]: negative && this.small && !this.quiet && this.loading,
|
|
4554
|
-
[button.negativeSmallQuietLoading]: negative && this.small && this.quiet && this.loading,
|
|
4555
|
-
[button.negativeQuiet]: negative && !this.small && this.quiet && !this.loading,
|
|
4556
|
-
[button.negativeQuietLoading]: negative && !this.small && this.quiet && this.loading,
|
|
4557
|
-
[button.negativeLoading]: negative && !this.small && !this.quiet && this.loading,
|
|
4558
|
-
[button.pill]: pill2 && !this.small && !this.loading,
|
|
4559
|
-
[button.pillSmall]: pill2 && this.small && !this.loading,
|
|
4560
|
-
[button.pillLoading]: pill2 && !this.small && this.loading,
|
|
4561
|
-
[button.pillSmallLoading]: pill2 && this.small && this.loading,
|
|
4562
|
-
[button.link]: link && !this.small,
|
|
4563
|
-
[button.linkSmall]: link && this.small,
|
|
4564
|
-
[button.linkAsButton]: !!this.href,
|
|
4565
|
-
[button.fullWidth]: this.fullWidth,
|
|
4566
|
-
[button.contentWidth]: !this.fullWidth
|
|
4567
|
-
},
|
|
4568
|
-
this.buttonClass
|
|
4569
|
-
);
|
|
4530
|
+
return r(this.buttonClass, [
|
|
4531
|
+
this.variant === "primary" && this._primaryClasses,
|
|
4532
|
+
this.variant === "secondary" && this._secondaryClasses,
|
|
4533
|
+
this.variant === "utility" && this._utilityClasses,
|
|
4534
|
+
this.variant === "negative" && this._negativeClasses,
|
|
4535
|
+
this.variant === "pill" && this._pillClasses,
|
|
4536
|
+
this.variant === "link" && this._linkClasses,
|
|
4537
|
+
this.href && button.linkAsButton,
|
|
4538
|
+
this.fullWidth ? button.fullWidth : button.contentWidth
|
|
4539
|
+
]);
|
|
4570
4540
|
}
|
|
4571
4541
|
render() {
|
|
4572
4542
|
return html14` ${this.href ? html14`<a
|
|
@@ -4606,6 +4576,20 @@ if (!customElements.get("w-button")) {
|
|
|
4606
4576
|
import { html as html15, css as css4 } from "lit";
|
|
4607
4577
|
import WarpElement9 from "@warp-ds/elements-core";
|
|
4608
4578
|
import { ifDefined as ifDefined3 } from "lit/directives/if-defined.js";
|
|
4579
|
+
|
|
4580
|
+
// packages/card/locales/da/messages.mjs
|
|
4581
|
+
var messages21 = JSON.parse('{"card.button.text":"V\xE6lg"}');
|
|
4582
|
+
|
|
4583
|
+
// packages/card/locales/en/messages.mjs
|
|
4584
|
+
var messages27 = JSON.parse('{"card.button.text":"Select"}');
|
|
4585
|
+
|
|
4586
|
+
// packages/card/locales/fi/messages.mjs
|
|
4587
|
+
var messages28 = JSON.parse('{"card.button.text":"Valitse"}');
|
|
4588
|
+
|
|
4589
|
+
// packages/card/locales/nb/messages.mjs
|
|
4590
|
+
var messages29 = JSON.parse('{"card.button.text":"Velg"}');
|
|
4591
|
+
|
|
4592
|
+
// packages/card/index.js
|
|
4609
4593
|
var keys = {
|
|
4610
4594
|
ENTER: "Enter",
|
|
4611
4595
|
SPACE: " "
|
|
@@ -4613,34 +4597,34 @@ var keys = {
|
|
|
4613
4597
|
var WarpCard = class extends WarpElement9 {
|
|
4614
4598
|
constructor() {
|
|
4615
4599
|
super();
|
|
4600
|
+
activateI18n7(messages27, messages29, messages28, messages21);
|
|
4616
4601
|
this.selected = false;
|
|
4617
4602
|
this.flat = false;
|
|
4618
4603
|
this.clickable = false;
|
|
4604
|
+
this.buttonText = i18n._({
|
|
4605
|
+
id: "card.button.text",
|
|
4606
|
+
message: "Select",
|
|
4607
|
+
comment: "Screenreader message to indicate that the card is clickable"
|
|
4608
|
+
});
|
|
4619
4609
|
}
|
|
4620
4610
|
get _containerClasses() {
|
|
4621
|
-
return
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
});
|
|
4611
|
+
return r([
|
|
4612
|
+
card.base,
|
|
4613
|
+
this.flat ? card.flat : card.shadow,
|
|
4614
|
+
this.selected && !this.flat && card.selected,
|
|
4615
|
+
this.selected && this.flat ? card.flatSelected : card.flatUnselected
|
|
4616
|
+
]);
|
|
4628
4617
|
}
|
|
4629
4618
|
get _outlineClasses() {
|
|
4630
|
-
return
|
|
4631
|
-
[card.cardOutline]: true,
|
|
4632
|
-
[this.selected ? card.cardOutlineSelected : card.cardOutlineUnselected]: true
|
|
4633
|
-
});
|
|
4634
|
-
}
|
|
4635
|
-
get uuButton() {
|
|
4636
|
-
return html15`<button class="${card.a11y}" aria-pressed="${this.selected}" tabindex="-1">Velg</button>`;
|
|
4619
|
+
return r([card.outline, this.selected ? card.outlineSelected : card.outlineUnselected]);
|
|
4637
4620
|
}
|
|
4638
|
-
get
|
|
4639
|
-
|
|
4621
|
+
get _interactiveElement() {
|
|
4622
|
+
const renderButton = () => html15`<button class="${card.a11y}" aria-pressed="${this.selected}" tabindex="-1">${this.buttonText}</button>`;
|
|
4623
|
+
const renderSpan = () => html15`<span role="checkbox" aria-checked="true" aria-disabled="true"></span>`;
|
|
4624
|
+
return this.clickable ? renderButton() : this.selected ? renderSpan() : "";
|
|
4640
4625
|
}
|
|
4641
4626
|
keypressed(e) {
|
|
4642
|
-
if (!this.clickable || e.altKey || e.ctrlKey)
|
|
4643
|
-
return;
|
|
4627
|
+
if (!this.clickable || e.altKey || e.ctrlKey) return;
|
|
4644
4628
|
if (e.key === keys.ENTER || e.key === keys.SPACE) {
|
|
4645
4629
|
e.preventDefault();
|
|
4646
4630
|
this.click();
|
|
@@ -4649,13 +4633,17 @@ var WarpCard = class extends WarpElement9 {
|
|
|
4649
4633
|
render() {
|
|
4650
4634
|
return html15`
|
|
4651
4635
|
<div tabindex=${ifDefined3(this.clickable ? "0" : void 0)} class="${this._containerClasses}" @keydown=${this.keypressed}>
|
|
4652
|
-
${this.
|
|
4653
|
-
<div class="${this._outlineClasses}"></div>
|
|
4636
|
+
${this._interactiveElement} ${this.flat ? "" : html15`<div class="${this._outlineClasses}"></div>`}
|
|
4654
4637
|
<slot></slot>
|
|
4655
4638
|
</div>
|
|
4656
4639
|
`;
|
|
4657
4640
|
}
|
|
4658
4641
|
};
|
|
4642
|
+
__publicField(WarpCard, "properties", {
|
|
4643
|
+
selected: { type: Boolean, reflect: true },
|
|
4644
|
+
flat: { type: Boolean },
|
|
4645
|
+
clickable: { type: Boolean }
|
|
4646
|
+
});
|
|
4659
4647
|
__publicField(WarpCard, "styles", [
|
|
4660
4648
|
WarpElement9.styles,
|
|
4661
4649
|
css4`
|
|
@@ -4672,11 +4660,6 @@ __publicField(WarpCard, "styles", [
|
|
|
4672
4660
|
}
|
|
4673
4661
|
`
|
|
4674
4662
|
]);
|
|
4675
|
-
__publicField(WarpCard, "properties", {
|
|
4676
|
-
selected: { type: Boolean, reflect: true },
|
|
4677
|
-
flat: { type: Boolean },
|
|
4678
|
-
clickable: { type: Boolean }
|
|
4679
|
-
});
|
|
4680
4663
|
if (!customElements.get("w-card")) {
|
|
4681
4664
|
customElements.define("w-card", WarpCard);
|
|
4682
4665
|
}
|
|
@@ -4686,11 +4669,11 @@ import { css as css5, html as html18 } from "lit";
|
|
|
4686
4669
|
import WarpElement10 from "@warp-ds/elements-core";
|
|
4687
4670
|
import { ifDefined as ifDefined4 } from "lit/directives/if-defined.js";
|
|
4688
4671
|
|
|
4689
|
-
// node_modules/.pnpm/@warp-ds+icons@2.0.
|
|
4672
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/chevron-down-16.js
|
|
4690
4673
|
import { LitElement as LitElement7 } from "lit";
|
|
4691
4674
|
import { unsafeStatic as unsafeStatic7, html as html16 } from "lit/static-html.js";
|
|
4692
|
-
var
|
|
4693
|
-
var
|
|
4675
|
+
var messages30 = JSON.parse('{"icon.title.chevron-down":"Nedoverpil"}');
|
|
4676
|
+
var messages210 = JSON.parse('{"icon.title.chevron-down":"Downward arrow"}');
|
|
4694
4677
|
var messages37 = JSON.parse('{"icon.title.chevron-down":"Nuoli alasp\xE4in"}');
|
|
4695
4678
|
var supportedLocales8 = ["en", "nb", "fi", "da", "sv"];
|
|
4696
4679
|
var defaultLocale9 = "en";
|
|
@@ -4766,7 +4749,7 @@ var activateI18n8 = (enMessages, nbMessages, fiMessages) => {
|
|
|
4766
4749
|
i18n.load(locale, messages410);
|
|
4767
4750
|
i18n.activate(locale);
|
|
4768
4751
|
};
|
|
4769
|
-
activateI18n8(
|
|
4752
|
+
activateI18n8(messages210, messages30, messages37);
|
|
4770
4753
|
var IconChevronDown16 = class extends LitElement7 {
|
|
4771
4754
|
render() {
|
|
4772
4755
|
const title = i18n.t({ message: `Downward arrow`, id: "icon.title.chevron-down", comment: "Title for chevron-down icon" });
|
|
@@ -4777,11 +4760,11 @@ if (!customElements.get("w-icon-chevron-down-16")) {
|
|
|
4777
4760
|
customElements.define("w-icon-chevron-down-16", IconChevronDown16);
|
|
4778
4761
|
}
|
|
4779
4762
|
|
|
4780
|
-
// node_modules/.pnpm/@warp-ds+icons@2.0.
|
|
4763
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/chevron-up-16.js
|
|
4781
4764
|
import { LitElement as LitElement8 } from "lit";
|
|
4782
4765
|
import { unsafeStatic as unsafeStatic8, html as html17 } from "lit/static-html.js";
|
|
4783
|
-
var
|
|
4784
|
-
var
|
|
4766
|
+
var messages31 = JSON.parse('{"icon.title.chevron-up":"Oppoverpil"}');
|
|
4767
|
+
var messages211 = JSON.parse('{"icon.title.chevron-up":"Upward arrow"}');
|
|
4785
4768
|
var messages38 = JSON.parse('{"icon.title.chevron-up":"Nuoli yl\xF6sp\xE4in"}');
|
|
4786
4769
|
var supportedLocales9 = ["en", "nb", "fi", "da", "sv"];
|
|
4787
4770
|
var defaultLocale10 = "en";
|
|
@@ -4857,7 +4840,7 @@ var activateI18n9 = (enMessages, nbMessages, fiMessages) => {
|
|
|
4857
4840
|
i18n.load(locale, messages410);
|
|
4858
4841
|
i18n.activate(locale);
|
|
4859
4842
|
};
|
|
4860
|
-
activateI18n9(
|
|
4843
|
+
activateI18n9(messages211, messages31, messages38);
|
|
4861
4844
|
var IconChevronUp16 = class extends LitElement8 {
|
|
4862
4845
|
render() {
|
|
4863
4846
|
const title = i18n.t({ message: `Upward arrow`, id: "icon.title.chevron-up", comment: "Title for chevron-up icon" });
|
|
@@ -4869,12 +4852,13 @@ if (!customElements.get("w-icon-chevron-up-16")) {
|
|
|
4869
4852
|
}
|
|
4870
4853
|
|
|
4871
4854
|
// packages/expandable/index.js
|
|
4855
|
+
var _WarpExpandable_instances, wrapperClasses_get, buttonClasses_get, chevronClasses_get, chevronIcon_get, contentClasses_get, expansionClasses_get;
|
|
4872
4856
|
var WarpExpandable = class extends kebabCaseAttributes(WarpElement10) {
|
|
4873
4857
|
constructor() {
|
|
4874
4858
|
super();
|
|
4859
|
+
__privateAdd(this, _WarpExpandable_instances);
|
|
4875
4860
|
this.expanded = false;
|
|
4876
4861
|
this.animated = false;
|
|
4877
|
-
this.info = false;
|
|
4878
4862
|
this.box = false;
|
|
4879
4863
|
this.bleed = false;
|
|
4880
4864
|
this.noChevron = false;
|
|
@@ -4892,72 +4876,60 @@ var WarpExpandable = class extends kebabCaseAttributes(WarpElement10) {
|
|
|
4892
4876
|
this._hasTitle = !!this.title || this.renderRoot.querySelector("slot[name='title']").assignedNodes().length > 0;
|
|
4893
4877
|
}
|
|
4894
4878
|
get _expandableSlot() {
|
|
4895
|
-
return html18`<div
|
|
4896
|
-
class=${fclasses({
|
|
4897
|
-
[this.contentClass || ""]: true,
|
|
4898
|
-
[box.box]: this.box,
|
|
4899
|
-
[expandable.paddingTop]: this._hasTitle && this.box
|
|
4900
|
-
})}>
|
|
4879
|
+
return html18`<div class="${__privateGet(this, _WarpExpandable_instances, contentClasses_get)}">
|
|
4901
4880
|
<slot></slot>
|
|
4902
4881
|
</div>`;
|
|
4903
4882
|
}
|
|
4904
|
-
get _chevronUpClasses() {
|
|
4905
|
-
return fclasses({
|
|
4906
|
-
[expandable.elementsTransformChevronUpPart]: true,
|
|
4907
|
-
[expandable.elementsChevronUpCollapsePart]: !this.expanded && this._showChevronUp
|
|
4908
|
-
});
|
|
4909
|
-
}
|
|
4910
|
-
get _chevronDownClasses() {
|
|
4911
|
-
return fclasses({
|
|
4912
|
-
[expandable.elementsTransformChevronDownPart]: true,
|
|
4913
|
-
[expandable.elementsChevronDownExpandPart]: this.expanded && !this._showChevronUp
|
|
4914
|
-
});
|
|
4915
|
-
}
|
|
4916
4883
|
render() {
|
|
4917
|
-
return html18` <div
|
|
4918
|
-
class=${fclasses({
|
|
4919
|
-
[expandable.expandable]: true,
|
|
4920
|
-
[expandable.expandableBox]: this.box,
|
|
4921
|
-
[expandable.expandableBleed]: this.bleed
|
|
4922
|
-
})}>
|
|
4884
|
+
return html18` <div class="${__privateGet(this, _WarpExpandable_instances, wrapperClasses_get)}">
|
|
4923
4885
|
${this._hasTitle ? html18`<w-unstyled-heading level=${this.headingLevel}>
|
|
4924
4886
|
<button
|
|
4925
4887
|
type="button"
|
|
4926
4888
|
aria-expanded="${this.expanded}"
|
|
4927
|
-
class
|
|
4928
|
-
[this.buttonClass || ""]: true,
|
|
4929
|
-
[expandable.button]: true,
|
|
4930
|
-
[expandable.buttonBox]: this.box
|
|
4931
|
-
})}
|
|
4889
|
+
class="${__privateGet(this, _WarpExpandable_instances, buttonClasses_get)}"
|
|
4932
4890
|
@click=${() => this.expanded = !this.expanded}>
|
|
4933
4891
|
<div class="${expandable.title}">
|
|
4934
4892
|
${this.title ? html18`<span class="${expandable.titleType}">${this.title}</span>` : html18`<slot name="title"></slot>`}
|
|
4935
|
-
${this.noChevron ? "" : html18`<div
|
|
4936
|
-
class=${fclasses({
|
|
4937
|
-
[expandable.chevron]: true,
|
|
4938
|
-
[expandable.chevronBox]: this.box,
|
|
4939
|
-
[expandable.chevronNonBox]: !this.box
|
|
4940
|
-
})}>
|
|
4941
|
-
${this._showChevronUp ? html18`<w-icon-chevron-up-16 class="${this._chevronUpClasses}"></w-icon-chevron-up-16>` : html18`<w-icon-chevron-down-16 class="${this._chevronDownClasses}"></w-icon-chevron-down-16>`}
|
|
4942
|
-
</div>`}
|
|
4893
|
+
${this.noChevron ? "" : html18`<div class="${__privateGet(this, _WarpExpandable_instances, chevronClasses_get)}">${__privateGet(this, _WarpExpandable_instances, chevronIcon_get)}</div>`}
|
|
4943
4894
|
</div>
|
|
4944
4895
|
</button>
|
|
4945
4896
|
</w-unstyled-heading>` : ""}
|
|
4946
|
-
${this.animated ? html18`<w-expand-transition ?show=${this.expanded}> ${this._expandableSlot} </w-expand-transition>` : html18`<div
|
|
4947
|
-
class=${fclasses({
|
|
4948
|
-
[expandable.expansion]: true,
|
|
4949
|
-
[expandable.expansionNotExpanded]: !this.expanded
|
|
4950
|
-
})}
|
|
4951
|
-
aria-hidden=${ifDefined4(!this.expanded ? true : void 0)}>
|
|
4897
|
+
${this.animated ? html18`<w-expand-transition ?show=${this.expanded}> ${this._expandableSlot} </w-expand-transition>` : html18`<div class="${__privateGet(this, _WarpExpandable_instances, expansionClasses_get)}" aria-hidden=${ifDefined4(!this.expanded ? true : void 0)}>
|
|
4952
4898
|
${this._expandableSlot}
|
|
4953
4899
|
</div>`}
|
|
4954
4900
|
</div>`;
|
|
4955
4901
|
}
|
|
4956
4902
|
};
|
|
4903
|
+
_WarpExpandable_instances = new WeakSet();
|
|
4904
|
+
wrapperClasses_get = function() {
|
|
4905
|
+
return r([expandable.wrapper, this.box && expandable.box, this.bleed && expandable.bleed]);
|
|
4906
|
+
};
|
|
4907
|
+
buttonClasses_get = function() {
|
|
4908
|
+
return r(this.buttonClass, [expandable.button, this.box && expandable.buttonBox]);
|
|
4909
|
+
};
|
|
4910
|
+
chevronClasses_get = function() {
|
|
4911
|
+
return r([expandable.chevron, !this.box && expandable.chevronNonBox]);
|
|
4912
|
+
};
|
|
4913
|
+
chevronIcon_get = function() {
|
|
4914
|
+
const upClasses = r([
|
|
4915
|
+
expandable.elementsChevronUpTransform,
|
|
4916
|
+
!this.expanded && this._showChevronUp && expandable.elementsChevronCollapse
|
|
4917
|
+
]);
|
|
4918
|
+
const downClasses = r([
|
|
4919
|
+
expandable.elementsChevronDownTransform,
|
|
4920
|
+
this.expanded && !this._showChevronUp && expandable.elementsChevronExpand
|
|
4921
|
+
]);
|
|
4922
|
+
return this._showChevronUp ? html18`<w-icon-chevron-up-16 class="${upClasses}"></w-icon-chevron-up-16>` : html18`<w-icon-chevron-down-16 class="${downClasses}"></w-icon-chevron-down-16>`;
|
|
4923
|
+
};
|
|
4924
|
+
contentClasses_get = function() {
|
|
4925
|
+
return r(this.contentClass, [this.box && box.base, this._hasTitle && this.box && expandable.contentWithTitle]);
|
|
4926
|
+
};
|
|
4927
|
+
expansionClasses_get = function() {
|
|
4928
|
+
return r([expandable.expansion, !this.expanded && expandable.expansionNotExpanded]);
|
|
4929
|
+
};
|
|
4957
4930
|
__publicField(WarpExpandable, "properties", {
|
|
4958
4931
|
expanded: { type: Boolean, reflect: true },
|
|
4959
4932
|
title: { type: String },
|
|
4960
|
-
info: { type: Boolean },
|
|
4961
4933
|
box: { type: Boolean },
|
|
4962
4934
|
bleed: { type: Boolean },
|
|
4963
4935
|
buttonClass: { type: String },
|
|
@@ -5049,8 +5021,7 @@ var windowExists2 = typeof window !== "undefined";
|
|
|
5049
5021
|
if (windowExists2) {
|
|
5050
5022
|
const query = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
5051
5023
|
const callback = ({ matches }) => reduceMotion = matches;
|
|
5052
|
-
if (query.addEventListener)
|
|
5053
|
-
query.addEventListener("change", callback);
|
|
5024
|
+
if (query.addEventListener) query.addEventListener("change", callback);
|
|
5054
5025
|
callback(query);
|
|
5055
5026
|
}
|
|
5056
5027
|
|
|
@@ -5081,8 +5052,7 @@ var Move = class {
|
|
|
5081
5052
|
}
|
|
5082
5053
|
async play() {
|
|
5083
5054
|
this.last = this.el.getBoundingClientRect();
|
|
5084
|
-
if (!this.el.animate)
|
|
5085
|
-
return;
|
|
5055
|
+
if (!this.el.animate) return;
|
|
5086
5056
|
const animation = this.el.animate(this.keyframes, this.animationOptions);
|
|
5087
5057
|
await animation.finished;
|
|
5088
5058
|
}
|
|
@@ -5096,20 +5066,18 @@ var Move = class {
|
|
|
5096
5066
|
return __spreadValues(__spreadValues({}, this.defaults), this.userAnimationOptions);
|
|
5097
5067
|
}
|
|
5098
5068
|
get animationOptions() {
|
|
5099
|
-
if (!this.shouldReduceMotion)
|
|
5100
|
-
|
|
5101
|
-
if (!reduceMotion)
|
|
5102
|
-
return this.mergedOptions;
|
|
5069
|
+
if (!this.shouldReduceMotion) return this.mergedOptions;
|
|
5070
|
+
if (!reduceMotion) return this.mergedOptions;
|
|
5103
5071
|
return __spreadProps(__spreadValues({}, this.mergedOptions), { duration: 0 });
|
|
5104
5072
|
}
|
|
5105
5073
|
};
|
|
5106
5074
|
|
|
5107
|
-
// node_modules/.pnpm/@warp-ds+icons@2.0.
|
|
5075
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/arrow-left-16.js
|
|
5108
5076
|
import { LitElement as LitElement9 } from "lit";
|
|
5109
5077
|
import { unsafeStatic as unsafeStatic9, html as html20 } from "lit/static-html.js";
|
|
5110
|
-
var
|
|
5111
|
-
var
|
|
5112
|
-
var
|
|
5078
|
+
var messages39 = JSON.parse('{"icon.title.arrow-left":"Pil som peker mot venstre"}');
|
|
5079
|
+
var messages212 = JSON.parse('{"icon.title.arrow-left":"Leftward-pointing arrow"}');
|
|
5080
|
+
var messages310 = JSON.parse('{"icon.title.arrow-left":"Vasemmalle osoittava nuoli"}');
|
|
5113
5081
|
var supportedLocales10 = ["en", "nb", "fi", "da", "sv"];
|
|
5114
5082
|
var defaultLocale11 = "en";
|
|
5115
5083
|
var detectByBrand9 = () => {
|
|
@@ -5184,7 +5152,7 @@ var activateI18n10 = (enMessages, nbMessages, fiMessages) => {
|
|
|
5184
5152
|
i18n.load(locale, messages410);
|
|
5185
5153
|
i18n.activate(locale);
|
|
5186
5154
|
};
|
|
5187
|
-
activateI18n10(
|
|
5155
|
+
activateI18n10(messages212, messages39, messages310);
|
|
5188
5156
|
var IconArrowLeft16 = class extends LitElement9 {
|
|
5189
5157
|
render() {
|
|
5190
5158
|
const title = i18n.t({ message: `Leftward-pointing arrow`, id: "icon.title.arrow-left", comment: "Title for table arrow left icon" });
|
|
@@ -5238,8 +5206,7 @@ var ModalHeader = class extends CanCloseMixin(WarpElement12) {
|
|
|
5238
5206
|
</button>` : nothing3;
|
|
5239
5207
|
}
|
|
5240
5208
|
get closeButton() {
|
|
5241
|
-
if (this[NO_CLOSE_BUTTON])
|
|
5242
|
-
return nothing3;
|
|
5209
|
+
if (this[NO_CLOSE_BUTTON]) return nothing3;
|
|
5243
5210
|
return html21` <button
|
|
5244
5211
|
type="button"
|
|
5245
5212
|
class="${modalElement.headerButton} ${this._hasTopContent ? modalElement.headerCloseButtonOnImage : modalElement.headerCloseButton}"
|
|
@@ -5376,13 +5343,11 @@ var ModalMain = class extends ProvidesCanCloseToSlotsMixin(WarpElement13) {
|
|
|
5376
5343
|
`;
|
|
5377
5344
|
}
|
|
5378
5345
|
willUpdate(changedProperties) {
|
|
5379
|
-
if (changedProperties.has("show"))
|
|
5380
|
-
this[this.show ? "open" : "close"]();
|
|
5346
|
+
if (changedProperties.has("show")) this[this.show ? "open" : "close"]();
|
|
5381
5347
|
}
|
|
5382
5348
|
handleListeners(verb = "addEventListener") {
|
|
5383
5349
|
document[verb]("keydown", this.interceptEscape);
|
|
5384
|
-
if (!this[NO_BACKDROP_CLICKS])
|
|
5385
|
-
this.dialogEl.value[verb]("mousedown", this.closeOnBackdropClick);
|
|
5350
|
+
if (!this[NO_BACKDROP_CLICKS]) this.dialogEl.value[verb]("mousedown", this.closeOnBackdropClick);
|
|
5386
5351
|
this.dialogEl.value[verb]("close", this.eventPreventer);
|
|
5387
5352
|
this.dialogEl.value[verb]("cancel", this.eventPreventer);
|
|
5388
5353
|
this.dialogInnerEl.value[verb]("transitionend", this.modifyBorderRadius);
|
|
@@ -5393,8 +5358,7 @@ var ModalMain = class extends ProvidesCanCloseToSlotsMixin(WarpElement13) {
|
|
|
5393
5358
|
}
|
|
5394
5359
|
/** @param {MouseEvent} evt */
|
|
5395
5360
|
closeOnBackdropClick(evt) {
|
|
5396
|
-
if (this.dialogEl.value === evt.target)
|
|
5397
|
-
this.close();
|
|
5361
|
+
if (this.dialogEl.value === evt.target) this.close();
|
|
5398
5362
|
}
|
|
5399
5363
|
/** @param {KeyboardEvent} evt */
|
|
5400
5364
|
interceptEscape(evt) {
|
|
@@ -5404,10 +5368,8 @@ var ModalMain = class extends ProvidesCanCloseToSlotsMixin(WarpElement13) {
|
|
|
5404
5368
|
}
|
|
5405
5369
|
}
|
|
5406
5370
|
modifyBorderRadius() {
|
|
5407
|
-
if (this.dialogInnerEl.value.scrollHeight * 1.02 > innerHeight)
|
|
5408
|
-
|
|
5409
|
-
else
|
|
5410
|
-
this.dialogInnerEl.value.style.borderRadius = null;
|
|
5371
|
+
if (this.dialogInnerEl.value.scrollHeight * 1.02 > innerHeight) this.dialogInnerEl.value.style.borderRadius = "0px";
|
|
5372
|
+
else this.dialogInnerEl.value.style.borderRadius = null;
|
|
5411
5373
|
}
|
|
5412
5374
|
};
|
|
5413
5375
|
__publicField(ModalMain, "properties", {
|
|
@@ -5490,22 +5452,22 @@ import { html as html23 } from "lit";
|
|
|
5490
5452
|
import WarpElement14 from "@warp-ds/elements-core";
|
|
5491
5453
|
|
|
5492
5454
|
// packages/pill/locales/da/messages.mjs
|
|
5493
|
-
var
|
|
5455
|
+
var messages40 = JSON.parse('{"pill.aria.openFilter":"\xC5bn filter","pill.aria.removeFilter":["Fjern filter ",["label"]]}');
|
|
5494
5456
|
|
|
5495
5457
|
// packages/pill/locales/en/messages.mjs
|
|
5496
|
-
var
|
|
5458
|
+
var messages41 = JSON.parse('{"pill.aria.openFilter":"Open filter","pill.aria.removeFilter":["Remove filter ",["label"]]}');
|
|
5497
5459
|
|
|
5498
5460
|
// packages/pill/locales/fi/messages.mjs
|
|
5499
|
-
var
|
|
5461
|
+
var messages42 = JSON.parse('{"pill.aria.openFilter":"Avaa suodatin","pill.aria.removeFilter":["Tyhjenn\xE4 suodatin ",["label"]]}');
|
|
5500
5462
|
|
|
5501
5463
|
// packages/pill/locales/nb/messages.mjs
|
|
5502
|
-
var
|
|
5464
|
+
var messages43 = JSON.parse('{"pill.aria.openFilter":"\xC5pne filter","pill.aria.removeFilter":["Fjern filter ",["label"]]}');
|
|
5503
5465
|
|
|
5504
5466
|
// packages/pill/index.js
|
|
5505
5467
|
var WarpPill = class extends kebabCaseAttributes(WarpElement14) {
|
|
5506
5468
|
constructor() {
|
|
5507
5469
|
super();
|
|
5508
|
-
activateI18n7(
|
|
5470
|
+
activateI18n7(messages41, messages43, messages42, messages40);
|
|
5509
5471
|
this.canClose = false;
|
|
5510
5472
|
this.suggestion = false;
|
|
5511
5473
|
this.openFilterSrText = i18n._({
|
|
@@ -5520,19 +5482,15 @@ var WarpPill = class extends kebabCaseAttributes(WarpElement14) {
|
|
|
5520
5482
|
});
|
|
5521
5483
|
}
|
|
5522
5484
|
get _labelClasses() {
|
|
5523
|
-
return r(
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5485
|
+
return r([
|
|
5486
|
+
pill.button,
|
|
5487
|
+
pill.label,
|
|
5488
|
+
this.suggestion ? pill.suggestion : pill.filter,
|
|
5489
|
+
this.canClose ? pill.labelWithClose : pill.labelWithoutClose
|
|
5490
|
+
]);
|
|
5529
5491
|
}
|
|
5530
5492
|
get _closeClasses() {
|
|
5531
|
-
return r(
|
|
5532
|
-
[pill.button]: true,
|
|
5533
|
-
[this.suggestion ? pill.suggestion : pill.filter]: true,
|
|
5534
|
-
[pill.close]: true
|
|
5535
|
-
});
|
|
5493
|
+
return r([pill.button, pill.close, this.suggestion ? pill.suggestion : pill.filter]);
|
|
5536
5494
|
}
|
|
5537
5495
|
_onClick() {
|
|
5538
5496
|
this.dispatchEvent(new CustomEvent("w-pill-click", { bubbles: true, composed: true }));
|
|
@@ -5542,7 +5500,7 @@ var WarpPill = class extends kebabCaseAttributes(WarpElement14) {
|
|
|
5542
5500
|
}
|
|
5543
5501
|
render() {
|
|
5544
5502
|
return html23`
|
|
5545
|
-
<div class="${pill.
|
|
5503
|
+
<div class="${pill.wrapper}">
|
|
5546
5504
|
<button type="button" class="${this._labelClasses}" @click="${this._onClick}">
|
|
5547
5505
|
<span class="${pill.a11y}">${this.openSrLabel ? this.openSrLabel : this.openFilterSrText}</span>
|
|
5548
5506
|
<slot></slot>
|
|
@@ -5574,35 +5532,36 @@ import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
|
5574
5532
|
import { when } from "lit/directives/when.js";
|
|
5575
5533
|
|
|
5576
5534
|
// packages/select/locales/da/messages.mjs
|
|
5577
|
-
var
|
|
5535
|
+
var messages44 = JSON.parse('{"select.label.optional":"(valgfrit)"}');
|
|
5578
5536
|
|
|
5579
5537
|
// packages/select/locales/en/messages.mjs
|
|
5580
|
-
var
|
|
5538
|
+
var messages45 = JSON.parse('{"select.label.optional":"(optional)"}');
|
|
5581
5539
|
|
|
5582
5540
|
// packages/select/locales/fi/messages.mjs
|
|
5583
|
-
var
|
|
5541
|
+
var messages46 = JSON.parse('{"select.label.optional":"(vapaaehtoinen)"}');
|
|
5584
5542
|
|
|
5585
5543
|
// packages/select/locales/nb/messages.mjs
|
|
5586
|
-
var
|
|
5544
|
+
var messages47 = JSON.parse('{"select.label.optional":"(valgfritt)"}');
|
|
5587
5545
|
|
|
5588
5546
|
// packages/select/index.js
|
|
5589
|
-
var
|
|
5547
|
+
var _WarpSelect_instances, classes_get, helpTextClasses_get, chevronClasses_get2, id_get, helpId_get;
|
|
5590
5548
|
var WarpSelect = class extends kebabCaseAttributes(WarpElement15) {
|
|
5591
5549
|
constructor() {
|
|
5592
5550
|
super();
|
|
5593
|
-
__privateAdd(this,
|
|
5594
|
-
|
|
5595
|
-
__privateAdd(this, _chevronClasses);
|
|
5596
|
-
__privateAdd(this, _id);
|
|
5597
|
-
__privateAdd(this, _helpId);
|
|
5598
|
-
activateI18n7(messages44, messages46, messages45, messages43);
|
|
5551
|
+
__privateAdd(this, _WarpSelect_instances);
|
|
5552
|
+
activateI18n7(messages45, messages47, messages46, messages44);
|
|
5599
5553
|
this._options = this.innerHTML;
|
|
5600
5554
|
}
|
|
5555
|
+
handleKeyDown(event) {
|
|
5556
|
+
if (this.readOnly && (event.key === " " || event.key === "ArrowDown" || event.key === "ArrowUp")) {
|
|
5557
|
+
event.preventDefault();
|
|
5558
|
+
}
|
|
5559
|
+
}
|
|
5601
5560
|
render() {
|
|
5602
5561
|
return html24`<div class="${select.wrapper}">
|
|
5603
5562
|
${when(
|
|
5604
5563
|
this.label,
|
|
5605
|
-
() => html24`<label class="${label.
|
|
5564
|
+
() => html24`<label class="${label.base}" for="${__privateGet(this, _WarpSelect_instances, id_get)}">
|
|
5606
5565
|
${this.label}
|
|
5607
5566
|
${when(
|
|
5608
5567
|
this.optional,
|
|
@@ -5618,51 +5577,45 @@ var WarpSelect = class extends kebabCaseAttributes(WarpElement15) {
|
|
|
5618
5577
|
)}
|
|
5619
5578
|
<div class="${select.selectWrapper}">
|
|
5620
5579
|
<select
|
|
5621
|
-
class="${__privateGet(this,
|
|
5622
|
-
id="${__privateGet(this,
|
|
5580
|
+
class="${__privateGet(this, _WarpSelect_instances, classes_get)}"
|
|
5581
|
+
id="${__privateGet(this, _WarpSelect_instances, id_get)}"
|
|
5623
5582
|
?autofocus=${this.autoFocus}
|
|
5624
|
-
|
|
5583
|
+
?disabled=${this.disabled}
|
|
5584
|
+
aria-describedby="${ifDefined5(__privateGet(this, _WarpSelect_instances, helpId_get))}"
|
|
5625
5585
|
aria-invalid="${ifDefined5(this.invalid)}"
|
|
5626
|
-
aria-errormessage="${ifDefined5(this.invalid && __privateGet(this,
|
|
5586
|
+
aria-errormessage="${ifDefined5(this.invalid && __privateGet(this, _WarpSelect_instances, helpId_get))}"
|
|
5587
|
+
@keydown=${this.handleKeyDown}>
|
|
5627
5588
|
${unsafeHTML(this._options)}
|
|
5628
5589
|
</select>
|
|
5629
|
-
<div class="${__privateGet(this,
|
|
5590
|
+
<div class="${__privateGet(this, _WarpSelect_instances, chevronClasses_get2)}">
|
|
5630
5591
|
<w-icon-chevron-down-16></w-icon-chevron-down-16>
|
|
5631
5592
|
</div>
|
|
5632
5593
|
</div>
|
|
5633
|
-
${when(this.always || this.invalid, () => html24`<div id="${__privateGet(this,
|
|
5594
|
+
${when(this.always || this.invalid, () => html24`<div id="${__privateGet(this, _WarpSelect_instances, helpId_get)}" class="${__privateGet(this, _WarpSelect_instances, helpTextClasses_get)}">${this.hint}</div>`)}
|
|
5634
5595
|
</div>`;
|
|
5635
5596
|
}
|
|
5636
5597
|
};
|
|
5637
|
-
|
|
5598
|
+
_WarpSelect_instances = new WeakSet();
|
|
5638
5599
|
classes_get = function() {
|
|
5639
|
-
return r(
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5600
|
+
return r([
|
|
5601
|
+
select.base,
|
|
5602
|
+
!this.invalid && !this.disabled && !this.readOnly && select.default,
|
|
5603
|
+
this.invalid && select.invalid,
|
|
5604
|
+
this.disabled && select.disabled,
|
|
5605
|
+
this.readOnly && select.readOnly
|
|
5606
|
+
]);
|
|
5643
5607
|
};
|
|
5644
|
-
_helpTextClasses = new WeakSet();
|
|
5645
5608
|
helpTextClasses_get = function() {
|
|
5646
|
-
return r(
|
|
5647
|
-
[helpText.helpText]: true,
|
|
5648
|
-
[helpText.helpTextColor]: !this.invalid,
|
|
5649
|
-
[helpText.helpTextColorInvalid]: this.invalid
|
|
5650
|
-
});
|
|
5609
|
+
return r([helpText.base, this.invalid ? helpText.colorInvalid : helpText.color]);
|
|
5651
5610
|
};
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
return r({
|
|
5655
|
-
[select.chevron]: true,
|
|
5656
|
-
[select.chevronDisabled]: this.disabled
|
|
5657
|
-
});
|
|
5611
|
+
chevronClasses_get2 = function() {
|
|
5612
|
+
return r([select.chevron, this.disabled && select.chevronDisabled]);
|
|
5658
5613
|
};
|
|
5659
|
-
_id = new WeakSet();
|
|
5660
5614
|
id_get = function() {
|
|
5661
5615
|
return "select_id";
|
|
5662
5616
|
};
|
|
5663
|
-
_helpId = new WeakSet();
|
|
5664
5617
|
helpId_get = function() {
|
|
5665
|
-
return this.hint ? `${__privateGet(this,
|
|
5618
|
+
return this.hint ? `${__privateGet(this, _WarpSelect_instances, id_get)}__hint` : void 0;
|
|
5666
5619
|
};
|
|
5667
5620
|
__publicField(WarpSelect, "properties", {
|
|
5668
5621
|
// Whether the element should receive focus on render
|
|
@@ -5677,6 +5630,10 @@ __publicField(WarpSelect, "properties", {
|
|
|
5677
5630
|
label: { type: String, reflect: true },
|
|
5678
5631
|
// Whether to show optional text
|
|
5679
5632
|
optional: { type: Boolean, reflect: true },
|
|
5633
|
+
// Renders the field in a disabled state.
|
|
5634
|
+
disabled: { type: Boolean, reflect: true },
|
|
5635
|
+
// Renders the field in a readonly state.
|
|
5636
|
+
readOnly: { type: Boolean, relfect: true },
|
|
5680
5637
|
_options: { state: true }
|
|
5681
5638
|
});
|
|
5682
5639
|
__publicField(WarpSelect, "styles", [WarpElement15.styles]);
|
|
@@ -5688,44 +5645,38 @@ if (!customElements.get("w-select")) {
|
|
|
5688
5645
|
import { css as css7, html as html25 } from "lit";
|
|
5689
5646
|
import WarpElement16 from "@warp-ds/elements-core";
|
|
5690
5647
|
import { ifDefined as ifDefined6 } from "lit/directives/if-defined.js";
|
|
5691
|
-
var WarpTextField = class extends WarpElement16 {
|
|
5648
|
+
var WarpTextField = class extends kebabCaseAttributes(WarpElement16) {
|
|
5692
5649
|
constructor() {
|
|
5693
5650
|
super();
|
|
5694
5651
|
this.type = "text";
|
|
5695
5652
|
}
|
|
5696
5653
|
get _inputStyles() {
|
|
5697
|
-
return
|
|
5698
|
-
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
|
|
5703
|
-
|
|
5704
|
-
|
|
5705
|
-
|
|
5654
|
+
return r([
|
|
5655
|
+
input.base,
|
|
5656
|
+
this._hasSuffix && input.suffix,
|
|
5657
|
+
this._hasPrefix && input.prefix,
|
|
5658
|
+
!this.invalid && !this.disabled && !this.readOnly && input.default,
|
|
5659
|
+
this.invalid && !this.disabled && !this.readOnly && input.invalid,
|
|
5660
|
+
!this.invalid && this.disabled && !this.readOnly && input.disabled,
|
|
5661
|
+
!this.invalid && !this.disabled && this.readOnly && input.readOnly
|
|
5662
|
+
]);
|
|
5706
5663
|
}
|
|
5707
5664
|
get _helpTextStyles() {
|
|
5708
|
-
return
|
|
5709
|
-
[helpText.helpText]: true,
|
|
5710
|
-
[helpText.helpTextColor]: !this.invalid,
|
|
5711
|
-
[helpText.helpTextColorInvalid]: this.invalid
|
|
5712
|
-
});
|
|
5665
|
+
return r([helpText.base, this.invalid ? helpText.colorInvalid : helpText.color]);
|
|
5713
5666
|
}
|
|
5714
5667
|
get _label() {
|
|
5715
5668
|
if (this.label) {
|
|
5716
|
-
return html25`<label for="${this._id}" class=${label.
|
|
5669
|
+
return html25`<label for="${this._id}" class=${label.base}>${this.label}</label>`;
|
|
5717
5670
|
}
|
|
5718
5671
|
}
|
|
5719
5672
|
get _helpId() {
|
|
5720
|
-
if (this.helpText)
|
|
5721
|
-
return `${this._id}__hint`;
|
|
5673
|
+
if (this.helpText) return `${this._id}__hint`;
|
|
5722
5674
|
}
|
|
5723
5675
|
get _id() {
|
|
5724
5676
|
return "textfield";
|
|
5725
5677
|
}
|
|
5726
5678
|
get _error() {
|
|
5727
|
-
if (this.invalid && this._helpId)
|
|
5728
|
-
return this._helpId;
|
|
5679
|
+
if (this.invalid && this._helpId) return this._helpId;
|
|
5729
5680
|
}
|
|
5730
5681
|
handler(e) {
|
|
5731
5682
|
const { name, value } = e.target;
|
|
@@ -5741,14 +5692,12 @@ var WarpTextField = class extends WarpElement16 {
|
|
|
5741
5692
|
prefixSlotChange(e) {
|
|
5742
5693
|
const el = this.renderRoot.querySelector("slot[name=prefix]");
|
|
5743
5694
|
const affixes = el.assignedElements();
|
|
5744
|
-
if (affixes.length)
|
|
5745
|
-
this._hasPrefix = true;
|
|
5695
|
+
if (affixes.length) this._hasPrefix = true;
|
|
5746
5696
|
}
|
|
5747
5697
|
suffixSlotChange(e) {
|
|
5748
5698
|
const el = this.renderRoot.querySelector("slot[name=suffix]");
|
|
5749
5699
|
const affixes = el.assignedElements();
|
|
5750
|
-
if (affixes.length)
|
|
5751
|
-
this._hasSuffix = true;
|
|
5700
|
+
if (affixes.length) this._hasSuffix = true;
|
|
5752
5701
|
}
|
|
5753
5702
|
render() {
|
|
5754
5703
|
return html25`
|
|
@@ -5788,16 +5737,16 @@ __publicField(WarpTextField, "properties", {
|
|
|
5788
5737
|
invalid: { type: Boolean },
|
|
5789
5738
|
id: { type: String },
|
|
5790
5739
|
label: { type: String },
|
|
5791
|
-
helpText: { type: String
|
|
5740
|
+
helpText: { type: String },
|
|
5792
5741
|
size: { type: String },
|
|
5793
5742
|
max: { type: Number },
|
|
5794
5743
|
min: { type: Number },
|
|
5795
|
-
minLength: { type: Number
|
|
5796
|
-
maxLength: { type: Number
|
|
5744
|
+
minLength: { type: Number },
|
|
5745
|
+
maxLength: { type: Number },
|
|
5797
5746
|
name: { type: String },
|
|
5798
5747
|
pattern: { type: String },
|
|
5799
5748
|
placeholder: { type: String },
|
|
5800
|
-
readOnly: { type: Boolean
|
|
5749
|
+
readOnly: { type: Boolean },
|
|
5801
5750
|
required: { type: Boolean },
|
|
5802
5751
|
type: { type: String },
|
|
5803
5752
|
value: { type: String },
|
|
@@ -5825,8 +5774,7 @@ if (!customElements.get("w-textfield")) {
|
|
|
5825
5774
|
|
|
5826
5775
|
// packages/toast/api.js
|
|
5827
5776
|
function toast2(message, options) {
|
|
5828
|
-
if (!windowExists)
|
|
5829
|
-
return;
|
|
5777
|
+
if (!windowExists) return;
|
|
5830
5778
|
const toast3 = customElements.get("w-toast-container").init();
|
|
5831
5779
|
const data = __spreadValues({
|
|
5832
5780
|
id: Date.now().toString(36) + Math.random().toString(36).slice(2, 5),
|
|
@@ -5838,14 +5786,12 @@ function toast2(message, options) {
|
|
|
5838
5786
|
return data;
|
|
5839
5787
|
}
|
|
5840
5788
|
function removeToast(id) {
|
|
5841
|
-
if (!windowExists)
|
|
5842
|
-
return;
|
|
5789
|
+
if (!windowExists) return;
|
|
5843
5790
|
const toast3 = customElements.get("w-toast-container").init();
|
|
5844
5791
|
return toast3.del(id);
|
|
5845
5792
|
}
|
|
5846
5793
|
function updateToast(id, options) {
|
|
5847
|
-
if (!windowExists)
|
|
5848
|
-
return;
|
|
5794
|
+
if (!windowExists) return;
|
|
5849
5795
|
const toast3 = customElements.get("w-toast-container").init();
|
|
5850
5796
|
toast3.set(__spreadValues(__spreadValues({}, toast3.get(id)), options));
|
|
5851
5797
|
return toast3.get(id);
|
|
@@ -5866,10 +5812,8 @@ var WarpToastContainer = class extends WarpElement17 {
|
|
|
5866
5812
|
const keep = [];
|
|
5867
5813
|
const remove = [];
|
|
5868
5814
|
for (const toast3 of this._toasts) {
|
|
5869
|
-
if (Date.now() <= toast3[1].duration)
|
|
5870
|
-
|
|
5871
|
-
else
|
|
5872
|
-
remove.push(toast3);
|
|
5815
|
+
if (Date.now() <= toast3[1].duration) keep.push(toast3);
|
|
5816
|
+
else remove.push(toast3);
|
|
5873
5817
|
}
|
|
5874
5818
|
const collapseTasks = [];
|
|
5875
5819
|
for (const [id] of remove) {
|
|
@@ -5877,15 +5821,13 @@ var WarpToastContainer = class extends WarpElement17 {
|
|
|
5877
5821
|
collapseTasks.push(el.collapse());
|
|
5878
5822
|
}
|
|
5879
5823
|
Promise.all(collapseTasks).then(() => {
|
|
5880
|
-
if (keep.length !== this._toasts.size)
|
|
5881
|
-
this._toasts = new Map(keep);
|
|
5824
|
+
if (keep.length !== this._toasts.size) this._toasts = new Map(keep);
|
|
5882
5825
|
});
|
|
5883
5826
|
}, 500);
|
|
5884
5827
|
}
|
|
5885
5828
|
disconnectedCallback() {
|
|
5886
5829
|
super.disconnectedCallback();
|
|
5887
|
-
if (this._interval)
|
|
5888
|
-
clearTimeout(this._interval);
|
|
5830
|
+
if (this._interval) clearTimeout(this._interval);
|
|
5889
5831
|
}
|
|
5890
5832
|
static init() {
|
|
5891
5833
|
let el = document.querySelector("w-toast-container");
|
|
@@ -5907,8 +5849,7 @@ var WarpToastContainer = class extends WarpElement17 {
|
|
|
5907
5849
|
if (!id) {
|
|
5908
5850
|
throw new Error('undefined "id" given when attempting to retrieve toast');
|
|
5909
5851
|
}
|
|
5910
|
-
if (typeof id !== "string" && !Number.isInteger(id))
|
|
5911
|
-
throw new Error('"id" must be number or string when attempting to retrieve toast');
|
|
5852
|
+
if (typeof id !== "string" && !Number.isInteger(id)) throw new Error('"id" must be number or string when attempting to retrieve toast');
|
|
5912
5853
|
return this._toasts.get(id);
|
|
5913
5854
|
}
|
|
5914
5855
|
/**
|
|
@@ -5917,8 +5858,7 @@ var WarpToastContainer = class extends WarpElement17 {
|
|
|
5917
5858
|
* @returns {WarpToastContainer}
|
|
5918
5859
|
*/
|
|
5919
5860
|
set(toast3) {
|
|
5920
|
-
if (!toast3.id)
|
|
5921
|
-
throw new Error('invalid or undefined "id" on toast object');
|
|
5861
|
+
if (!toast3.id) throw new Error('invalid or undefined "id" on toast object');
|
|
5922
5862
|
const result = this._toasts.set(toast3.id, __spreadProps(__spreadValues({}, toast3), {
|
|
5923
5863
|
duration: Date.now() + (toast3.duration || 5e3)
|
|
5924
5864
|
}));
|
|
@@ -5934,11 +5874,9 @@ var WarpToastContainer = class extends WarpElement17 {
|
|
|
5934
5874
|
if (!id) {
|
|
5935
5875
|
throw new Error('undefined "id" given when attempting to retrieve toast');
|
|
5936
5876
|
}
|
|
5937
|
-
if (typeof id !== "string" && !Number.isInteger(id))
|
|
5938
|
-
throw new Error('"id" must be number or string when attempting to retrieve toast');
|
|
5877
|
+
if (typeof id !== "string" && !Number.isInteger(id)) throw new Error('"id" must be number or string when attempting to retrieve toast');
|
|
5939
5878
|
const el = this.renderRoot.querySelector(`#${id}`);
|
|
5940
|
-
if (!this._toasts.has(id))
|
|
5941
|
-
return false;
|
|
5879
|
+
if (!this._toasts.has(id)) return false;
|
|
5942
5880
|
await el.collapse();
|
|
5943
5881
|
const result = this._toasts.delete(id);
|
|
5944
5882
|
this._toasts = new Map(Array.from(this._toasts));
|
|
@@ -5946,8 +5884,8 @@ var WarpToastContainer = class extends WarpElement17 {
|
|
|
5946
5884
|
}
|
|
5947
5885
|
render() {
|
|
5948
5886
|
return html26`
|
|
5949
|
-
<aside class="${toaster.
|
|
5950
|
-
<div class="${toaster.
|
|
5887
|
+
<aside class="${toaster.wrapper}">
|
|
5888
|
+
<div class="${toaster.base}" id="w-toast-container-list">
|
|
5951
5889
|
${repeat2(
|
|
5952
5890
|
this._toastsArray,
|
|
5953
5891
|
(toast3) => toast3.id,
|
|
@@ -5990,8 +5928,7 @@ var prefersMotion = true;
|
|
|
5990
5928
|
if (windowExists3) {
|
|
5991
5929
|
const query = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
5992
5930
|
const callback = ({ matches }) => prefersMotion = !matches;
|
|
5993
|
-
if (query.addEventListener)
|
|
5994
|
-
query.addEventListener("change", callback);
|
|
5931
|
+
if (query.addEventListener) query.addEventListener("change", callback);
|
|
5995
5932
|
callback(query);
|
|
5996
5933
|
}
|
|
5997
5934
|
var removeTransition = (el) => {
|
|
@@ -6008,19 +5945,16 @@ var addTransition = (el) => {
|
|
|
6008
5945
|
var getAfterExpandCallback = (el, done) => () => {
|
|
6009
5946
|
el.style.height = "auto";
|
|
6010
5947
|
el.style.overflow = null;
|
|
6011
|
-
if (done)
|
|
6012
|
-
done();
|
|
5948
|
+
if (done) done();
|
|
6013
5949
|
};
|
|
6014
5950
|
var getAfterCollapseCallback = (done) => () => {
|
|
6015
|
-
if (done)
|
|
6016
|
-
done();
|
|
5951
|
+
if (done) done();
|
|
6017
5952
|
};
|
|
6018
5953
|
var expand = (el, done) => {
|
|
6019
5954
|
const returnPromise = (() => {
|
|
6020
|
-
if (!done)
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
});
|
|
5955
|
+
if (!done) return new Promise((r3) => {
|
|
5956
|
+
done = r3;
|
|
5957
|
+
});
|
|
6024
5958
|
})();
|
|
6025
5959
|
const afterExpandCallback = getAfterExpandCallback(el, done);
|
|
6026
5960
|
removeTransition(el);
|
|
@@ -6033,15 +5967,13 @@ var expand = (el, done) => {
|
|
|
6033
5967
|
addTransition(el);
|
|
6034
5968
|
requestAnimationFrame(() => el.style.height = dest + "px");
|
|
6035
5969
|
});
|
|
6036
|
-
if (returnPromise)
|
|
6037
|
-
return returnPromise;
|
|
5970
|
+
if (returnPromise) return returnPromise;
|
|
6038
5971
|
};
|
|
6039
5972
|
var collapse = (el, done) => {
|
|
6040
5973
|
const returnPromise = (() => {
|
|
6041
|
-
if (!done)
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
});
|
|
5974
|
+
if (!done) return new Promise((r3) => {
|
|
5975
|
+
done = r3;
|
|
5976
|
+
});
|
|
6045
5977
|
})();
|
|
6046
5978
|
const afterCollapseCallback = getAfterCollapseCallback(done);
|
|
6047
5979
|
removeTransition(el);
|
|
@@ -6053,45 +5985,36 @@ var collapse = (el, done) => {
|
|
|
6053
5985
|
addTransition(el);
|
|
6054
5986
|
requestAnimationFrame(() => el.style.height = "0px");
|
|
6055
5987
|
});
|
|
6056
|
-
if (returnPromise)
|
|
6057
|
-
return returnPromise;
|
|
5988
|
+
if (returnPromise) return returnPromise;
|
|
6058
5989
|
};
|
|
6059
5990
|
|
|
6060
5991
|
// packages/toast/toast.js
|
|
6061
|
-
import { classMap as classMap2 } from "lit/directives/class-map.js";
|
|
6062
5992
|
import { when as when2 } from "lit/directives/when.js";
|
|
6063
5993
|
|
|
6064
5994
|
// packages/toast/locales/da/messages.mjs
|
|
6065
|
-
var
|
|
5995
|
+
var messages48 = JSON.parse('{"toast.aria.error":"Fejl","toast.aria.successful":"Fuldf\xF8rt","toast.aria.warning":"Advarsel"}');
|
|
6066
5996
|
|
|
6067
5997
|
// packages/toast/locales/en/messages.mjs
|
|
6068
|
-
var
|
|
5998
|
+
var messages49 = JSON.parse('{"toast.aria.error":"Error","toast.aria.successful":"Successful","toast.aria.warning":"Warning"}');
|
|
6069
5999
|
|
|
6070
6000
|
// packages/toast/locales/fi/messages.mjs
|
|
6071
|
-
var
|
|
6001
|
+
var messages50 = JSON.parse('{"toast.aria.error":"Virhe","toast.aria.successful":"Onnistui","toast.aria.warning":"Varoitus"}');
|
|
6072
6002
|
|
|
6073
6003
|
// packages/toast/locales/nb/messages.mjs
|
|
6074
|
-
var
|
|
6004
|
+
var messages51 = JSON.parse('{"toast.aria.error":"Feil","toast.aria.successful":"Vellykket","toast.aria.warning":"Advarsel"}');
|
|
6075
6005
|
|
|
6076
6006
|
// packages/toast/toast.js
|
|
6077
|
-
var classes2 = (definition) => {
|
|
6078
|
-
const defn = {};
|
|
6079
|
-
for (const [key, value] of Object.entries(definition)) {
|
|
6080
|
-
for (const className of key.split(" ")) {
|
|
6081
|
-
defn[className] = value;
|
|
6082
|
-
}
|
|
6083
|
-
}
|
|
6084
|
-
return classMap2(defn);
|
|
6085
|
-
};
|
|
6086
6007
|
var toastType = {
|
|
6087
6008
|
success: "success",
|
|
6088
6009
|
error: "error",
|
|
6089
6010
|
warning: "warning"
|
|
6090
6011
|
};
|
|
6012
|
+
var _WarpToast_instances, primaryClasses_get, iconClasses_get;
|
|
6091
6013
|
var WarpToast = class extends WarpElement18 {
|
|
6092
6014
|
constructor() {
|
|
6093
6015
|
super();
|
|
6094
|
-
|
|
6016
|
+
__privateAdd(this, _WarpToast_instances);
|
|
6017
|
+
activateI18n7(messages49, messages51, messages50, messages48);
|
|
6095
6018
|
this.id = Date.now().toString(36) + Math.random().toString(36).slice(2, 5);
|
|
6096
6019
|
this.type = "success";
|
|
6097
6020
|
this.text = "";
|
|
@@ -6104,24 +6027,7 @@ var WarpToast = class extends WarpElement18 {
|
|
|
6104
6027
|
super.disconnectedCallback();
|
|
6105
6028
|
}
|
|
6106
6029
|
updated() {
|
|
6107
|
-
if (!this._expanded && this._wrapper)
|
|
6108
|
-
expand(this._wrapper, () => this._expanded = true);
|
|
6109
|
-
}
|
|
6110
|
-
get _primaryClasses() {
|
|
6111
|
-
return classes2({
|
|
6112
|
-
[toast.toast]: true,
|
|
6113
|
-
[toast.positive]: this.type === toastType.success,
|
|
6114
|
-
[toast.warning]: this.type === toastType.warning,
|
|
6115
|
-
[toast.negative]: this.type === toastType.error
|
|
6116
|
-
});
|
|
6117
|
-
}
|
|
6118
|
-
get _iconClasses() {
|
|
6119
|
-
return classes2({
|
|
6120
|
-
[toast.icon]: true,
|
|
6121
|
-
[toast.iconPositive]: this.type === toastType.success,
|
|
6122
|
-
[toast.iconWarning]: this.type === toastType.warning,
|
|
6123
|
-
[toast.iconNegative]: this.type === toastType.error
|
|
6124
|
-
});
|
|
6030
|
+
if (!this._expanded && this._wrapper) expand(this._wrapper, () => this._expanded = true);
|
|
6125
6031
|
}
|
|
6126
6032
|
get _wrapper() {
|
|
6127
6033
|
var _a, _b;
|
|
@@ -6159,19 +6065,14 @@ var WarpToast = class extends WarpElement18 {
|
|
|
6159
6065
|
}
|
|
6160
6066
|
}
|
|
6161
6067
|
get _iconMarkup() {
|
|
6162
|
-
if (this._warning)
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
return html27`<w-icon-error-16></w-icon-error-16>`;
|
|
6166
|
-
else
|
|
6167
|
-
return html27`<w-icon-success-16></w-icon-success-16>`;
|
|
6068
|
+
if (this._warning) return html27`<w-icon-warning-16></w-icon-warning-16>`;
|
|
6069
|
+
if (this._error) return html27`<w-icon-error-16></w-icon-error-16>`;
|
|
6070
|
+
else return html27`<w-icon-success-16></w-icon-success-16>`;
|
|
6168
6071
|
}
|
|
6169
6072
|
async collapse() {
|
|
6170
6073
|
return new Promise((resolve) => {
|
|
6171
|
-
if (this._expanded && this._wrapper)
|
|
6172
|
-
|
|
6173
|
-
else
|
|
6174
|
-
resolve();
|
|
6074
|
+
if (this._expanded && this._wrapper) collapse(this._wrapper, resolve);
|
|
6075
|
+
else resolve();
|
|
6175
6076
|
});
|
|
6176
6077
|
}
|
|
6177
6078
|
close() {
|
|
@@ -6183,11 +6084,10 @@ var WarpToast = class extends WarpElement18 {
|
|
|
6183
6084
|
this.updateComplete.then(() => this.dispatchEvent(event));
|
|
6184
6085
|
}
|
|
6185
6086
|
render() {
|
|
6186
|
-
if (!this.text)
|
|
6187
|
-
return html27``;
|
|
6087
|
+
if (!this.text) return html27``;
|
|
6188
6088
|
return html27` <section class="${toast.wrapper}" aria-label="${this._typeLabel}">
|
|
6189
|
-
<div class="${this
|
|
6190
|
-
<div class="${this
|
|
6089
|
+
<div class="${__privateGet(this, _WarpToast_instances, primaryClasses_get)}">
|
|
6090
|
+
<div class="${__privateGet(this, _WarpToast_instances, iconClasses_get)}">${this._iconMarkup}</div>
|
|
6191
6091
|
<div role="${this._role}" class="${toast.content}">
|
|
6192
6092
|
<p>${this.text}</p>
|
|
6193
6093
|
</div>
|
|
@@ -6203,6 +6103,23 @@ var WarpToast = class extends WarpElement18 {
|
|
|
6203
6103
|
</section>`;
|
|
6204
6104
|
}
|
|
6205
6105
|
};
|
|
6106
|
+
_WarpToast_instances = new WeakSet();
|
|
6107
|
+
primaryClasses_get = function() {
|
|
6108
|
+
return r([
|
|
6109
|
+
toast.base,
|
|
6110
|
+
this.type === toastType.success && toast.positive,
|
|
6111
|
+
this.type === toastType.warning && toast.warning,
|
|
6112
|
+
this.type === toastType.error && toast.negative
|
|
6113
|
+
]);
|
|
6114
|
+
};
|
|
6115
|
+
iconClasses_get = function() {
|
|
6116
|
+
return r([
|
|
6117
|
+
toast.iconBase,
|
|
6118
|
+
this.type === toastType.success && toast.iconPositive,
|
|
6119
|
+
this.type === toastType.warning && toast.iconWarning,
|
|
6120
|
+
this.type === toastType.error && toast.iconNegative
|
|
6121
|
+
]);
|
|
6122
|
+
};
|
|
6206
6123
|
__publicField(WarpToast, "styles", [
|
|
6207
6124
|
WarpElement18.styles,
|
|
6208
6125
|
css9`
|
|
@@ -6241,8 +6158,7 @@ var ExpandTransition = class extends WarpElement19 {
|
|
|
6241
6158
|
}
|
|
6242
6159
|
}
|
|
6243
6160
|
updated() {
|
|
6244
|
-
if (!this._wrapper)
|
|
6245
|
-
return;
|
|
6161
|
+
if (!this._wrapper) return;
|
|
6246
6162
|
if (!this._mounted) {
|
|
6247
6163
|
this._mounted = true;
|
|
6248
6164
|
return;
|