@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
|
@@ -6,6 +6,9 @@ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
8
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __typeError = (msg) => {
|
|
10
|
+
throw TypeError(msg);
|
|
11
|
+
};
|
|
9
12
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
13
|
var __spreadValues = (a, b) => {
|
|
11
14
|
for (var prop in b || (b = {}))
|
|
@@ -49,10 +52,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
49
52
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
50
53
|
mod
|
|
51
54
|
));
|
|
52
|
-
var __publicField = (obj, key, value) =>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
56
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
57
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
58
|
+
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);
|
|
56
59
|
|
|
57
60
|
// node_modules/.pnpm/unraw@3.0.0/node_modules/unraw/dist/errors.js
|
|
58
61
|
var require_errors = __commonJS({
|
|
@@ -225,8 +228,7 @@ var require_moo = __commonJS({
|
|
|
225
228
|
return "(" + s + ")";
|
|
226
229
|
}
|
|
227
230
|
function reUnion(regexps) {
|
|
228
|
-
if (!regexps.length)
|
|
229
|
-
return "(?!)";
|
|
231
|
+
if (!regexps.length) return "(?!)";
|
|
230
232
|
var source = regexps.map(function(s) {
|
|
231
233
|
return "(?:" + s + ")";
|
|
232
234
|
}).join("|");
|
|
@@ -236,14 +238,10 @@ var require_moo = __commonJS({
|
|
|
236
238
|
if (typeof obj === "string") {
|
|
237
239
|
return "(?:" + reEscape(obj) + ")";
|
|
238
240
|
} else if (isRegExp(obj)) {
|
|
239
|
-
if (obj.ignoreCase)
|
|
240
|
-
|
|
241
|
-
if (obj.
|
|
242
|
-
|
|
243
|
-
if (obj.sticky)
|
|
244
|
-
throw new Error("RegExp /y flag is implied");
|
|
245
|
-
if (obj.multiline)
|
|
246
|
-
throw new Error("RegExp /m flag is implied");
|
|
241
|
+
if (obj.ignoreCase) throw new Error("RegExp /i flag not allowed");
|
|
242
|
+
if (obj.global) throw new Error("RegExp /g flag is implied");
|
|
243
|
+
if (obj.sticky) throw new Error("RegExp /y flag is implied");
|
|
244
|
+
if (obj.multiline) throw new Error("RegExp /m flag is implied");
|
|
247
245
|
return obj.source;
|
|
248
246
|
} else {
|
|
249
247
|
throw new Error("Not a pattern: " + obj);
|
|
@@ -292,16 +290,14 @@ var require_moo = __commonJS({
|
|
|
292
290
|
var match = [];
|
|
293
291
|
rules.forEach(function(rule) {
|
|
294
292
|
if (isObject(rule)) {
|
|
295
|
-
if (match.length)
|
|
296
|
-
result.push(ruleOptions(key, match));
|
|
293
|
+
if (match.length) result.push(ruleOptions(key, match));
|
|
297
294
|
result.push(ruleOptions(key, rule));
|
|
298
295
|
match = [];
|
|
299
296
|
} else {
|
|
300
297
|
match.push(rule);
|
|
301
298
|
}
|
|
302
299
|
});
|
|
303
|
-
if (match.length)
|
|
304
|
-
result.push(ruleOptions(key, match));
|
|
300
|
+
if (match.length) result.push(ruleOptions(key, match));
|
|
305
301
|
}
|
|
306
302
|
return result;
|
|
307
303
|
}
|
|
@@ -436,8 +432,7 @@ var require_moo = __commonJS({
|
|
|
436
432
|
var fallbackRule = errorRule && errorRule.fallback;
|
|
437
433
|
var flags = hasSticky && !fallbackRule ? "ym" : "gm";
|
|
438
434
|
var suffix2 = hasSticky || fallbackRule ? "" : "|";
|
|
439
|
-
if (unicodeFlag === true)
|
|
440
|
-
flags += "u";
|
|
435
|
+
if (unicodeFlag === true) flags += "u";
|
|
441
436
|
var combined = new RegExp(reUnion(parts) + suffix2, flags);
|
|
442
437
|
return { regexp: combined, groups, fast, error: errorRule || defaultErrorRule };
|
|
443
438
|
}
|
|
@@ -458,8 +453,7 @@ var require_moo = __commonJS({
|
|
|
458
453
|
var all = states.$all ? toRules(states.$all) : [];
|
|
459
454
|
delete states.$all;
|
|
460
455
|
var keys = Object.getOwnPropertyNames(states);
|
|
461
|
-
if (!start)
|
|
462
|
-
start = keys[0];
|
|
456
|
+
if (!start) start = keys[0];
|
|
463
457
|
var ruleMap = /* @__PURE__ */ Object.create(null);
|
|
464
458
|
for (var i = 0; i < keys.length; i++) {
|
|
465
459
|
var key = keys[i];
|
|
@@ -471,8 +465,7 @@ var require_moo = __commonJS({
|
|
|
471
465
|
var included = /* @__PURE__ */ Object.create(null);
|
|
472
466
|
for (var j = 0; j < rules.length; j++) {
|
|
473
467
|
var rule = rules[j];
|
|
474
|
-
if (!rule.include)
|
|
475
|
-
continue;
|
|
468
|
+
if (!rule.include) continue;
|
|
476
469
|
var splice = [j, 1];
|
|
477
470
|
if (rule.include !== key && !included[rule.include]) {
|
|
478
471
|
included[rule.include] = true;
|
|
@@ -482,8 +475,7 @@ var require_moo = __commonJS({
|
|
|
482
475
|
}
|
|
483
476
|
for (var k = 0; k < newRules.length; k++) {
|
|
484
477
|
var newRule = newRules[k];
|
|
485
|
-
if (rules.indexOf(newRule) !== -1)
|
|
486
|
-
continue;
|
|
478
|
+
if (rules.indexOf(newRule) !== -1) continue;
|
|
487
479
|
splice.push(newRule);
|
|
488
480
|
}
|
|
489
481
|
}
|
|
@@ -564,8 +556,7 @@ var require_moo = __commonJS({
|
|
|
564
556
|
};
|
|
565
557
|
};
|
|
566
558
|
Lexer.prototype.setState = function(state) {
|
|
567
|
-
if (!state || this.state === state)
|
|
568
|
-
return;
|
|
559
|
+
if (!state || this.state === state) return;
|
|
569
560
|
this.state = state;
|
|
570
561
|
var info = this.states[state];
|
|
571
562
|
this.groups = info.groups;
|
|
@@ -669,12 +660,9 @@ var require_moo = __commonJS({
|
|
|
669
660
|
var err = new Error(this.formatError(token, "invalid syntax"));
|
|
670
661
|
throw err;
|
|
671
662
|
}
|
|
672
|
-
if (group.pop)
|
|
673
|
-
|
|
674
|
-
else if (group.
|
|
675
|
-
this.pushState(group.push);
|
|
676
|
-
else if (group.next)
|
|
677
|
-
this.setState(group.next);
|
|
663
|
+
if (group.pop) this.popState();
|
|
664
|
+
else if (group.push) this.pushState(group.push);
|
|
665
|
+
else if (group.next) this.setState(group.next);
|
|
678
666
|
return token;
|
|
679
667
|
};
|
|
680
668
|
if (typeof Symbol !== "undefined" && Symbol.iterator) {
|
|
@@ -1027,9 +1015,19 @@ var require_parser = __commonJS({
|
|
|
1027
1015
|
// packages/expandable/index.js
|
|
1028
1016
|
import { css, html as html3 } from "lit";
|
|
1029
1017
|
|
|
1030
|
-
// node_modules/.pnpm/@
|
|
1018
|
+
// node_modules/.pnpm/@chbphone55+classnames@2.0.0/node_modules/@chbphone55/classnames/dist/index.m.js
|
|
1019
|
+
var r = function() {
|
|
1020
|
+
for (var t = [], n = arguments.length; n--; ) t[n] = arguments[n];
|
|
1021
|
+
return t.reduce(function(t2, n2) {
|
|
1022
|
+
return t2.concat("string" == typeof n2 ? n2 : Array.isArray(n2) ? r.apply(void 0, n2) : "object" == typeof n2 && n2 ? Object.keys(n2).map(function(r2) {
|
|
1023
|
+
return n2[r2] ? r2 : "";
|
|
1024
|
+
}) : "");
|
|
1025
|
+
}, []).join(" ");
|
|
1026
|
+
};
|
|
1027
|
+
|
|
1028
|
+
// 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
|
|
1031
1029
|
var box = {
|
|
1032
|
-
|
|
1030
|
+
base: "group block relative break-words last-child:mb-0 p-16 rounded-8",
|
|
1033
1031
|
// Relative here enables w-clickable
|
|
1034
1032
|
bleed: "-mx-16 sm:mx-0 rounded-l-0 rounded-r-0 sm:rounded-8",
|
|
1035
1033
|
// We target L and R to override the default rounded-8
|
|
@@ -1037,30 +1035,27 @@ var box = {
|
|
|
1037
1035
|
neutral: "s-surface-sunken",
|
|
1038
1036
|
bordered: "border-2 s-border s-bg"
|
|
1039
1037
|
};
|
|
1040
|
-
var buttonReset = "focus:outline-none appearance-none cursor-pointer bg-transparent border-0 m-0 p-0 inline-block";
|
|
1041
1038
|
var expandable = {
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
expandableInfo: "s-bg-info-subtle! hover:s-bg-info-subtle-hover!",
|
|
1046
|
-
expandableBleed: box.bleed,
|
|
1039
|
+
wrapper: "will-change-height s-text",
|
|
1040
|
+
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",
|
|
1041
|
+
bleed: "-mx-16 rounded-l-0 rounded-r-0 sm:mx-0 sm:rounded-8",
|
|
1047
1042
|
chevron: "inline-block align-middle s-icon",
|
|
1048
1043
|
chevronNonBox: "ml-8",
|
|
1049
|
-
chevronBox: "",
|
|
1050
1044
|
chevronTransform: "transform transition-transform transform-gpu ease-in-out",
|
|
1051
1045
|
chevronExpand: "-rotate-180",
|
|
1052
1046
|
chevronCollapse: "rotate-180",
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1047
|
+
// These are web component specific classes, using the ::part-selector:
|
|
1048
|
+
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",
|
|
1049
|
+
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",
|
|
1050
|
+
elementsChevronExpand: "part-[w-icon-chevron-down-16-part]:-rotate-180",
|
|
1051
|
+
elementsChevronCollapse: "part-[w-icon-chevron-up-16-part]:rotate-180",
|
|
1057
1052
|
expansion: "overflow-hidden",
|
|
1058
1053
|
expansionNotExpanded: "h-0 invisible",
|
|
1059
|
-
button:
|
|
1060
|
-
buttonBox: "w-full text-left relative inline-flex items-center justify-between
|
|
1061
|
-
|
|
1054
|
+
button: "focus:outline-none appearance-none cursor-pointer bg-transparent border-0 m-0 hover:underline focus-visible:underline",
|
|
1055
|
+
buttonBox: "w-full text-left relative inline-flex items-center justify-between group relative break-words last-child:mb-0 p-16 rounded-8",
|
|
1056
|
+
contentWithTitle: "pt-0",
|
|
1062
1057
|
title: "flex w-full justify-between items-center",
|
|
1063
|
-
titleType: "
|
|
1058
|
+
titleType: "t4"
|
|
1064
1059
|
};
|
|
1065
1060
|
var buttonDefaultStyling = "font-bold focusable justify-center transition-colors ease-in-out";
|
|
1066
1061
|
var buttonColors = {
|
|
@@ -1179,7 +1174,7 @@ var button = {
|
|
|
1179
1174
|
};
|
|
1180
1175
|
var modal = {
|
|
1181
1176
|
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]",
|
|
1182
|
-
|
|
1177
|
+
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",
|
|
1183
1178
|
content: "block overflow-y-auto overflow-x-hidden last-child:mb-0 grow shrink px-16 sm:px-32 relative",
|
|
1184
1179
|
footer: "flex justify-end shrink-0 px-16 sm:px-32",
|
|
1185
1180
|
transitionTitle: "transition-all duration-300",
|
|
@@ -1193,19 +1188,15 @@ var modal = {
|
|
|
1193
1188
|
titleButtonIcon: "h-16 w-16 sm:h-24 sm:w-24",
|
|
1194
1189
|
titleButtonIconRotated: "transform rotate-90"
|
|
1195
1190
|
};
|
|
1196
|
-
var
|
|
1197
|
-
label: "antialiased block relative text-s font-bold pb-4 cursor-pointer s-text",
|
|
1198
|
-
optional: "pl-8 font-normal text-s s-text-subtle"
|
|
1199
|
-
};
|
|
1200
|
-
var prefixSuffixWrapperBase = "absolute top-0 bottom-0 flex justify-center items-center focusable rounded-4 focus:[--w-outline-offset:-2px] bg-transparent ";
|
|
1191
|
+
var prefixSuffixWrapper = "absolute top-0 bottom-0 flex justify-center items-center focusable rounded-4 focus:[--w-outline-offset:-2px] bg-transparent ";
|
|
1201
1192
|
var suffix = {
|
|
1202
|
-
wrapper:
|
|
1193
|
+
wrapper: prefixSuffixWrapper + "right-0",
|
|
1203
1194
|
wrapperWithLabel: "w-max pr-12",
|
|
1204
1195
|
wrapperWithIcon: "w-40",
|
|
1205
1196
|
label: "antialiased block relative cursor-default pb-0 font-bold text-xs s-text"
|
|
1206
1197
|
};
|
|
1207
1198
|
var prefix = {
|
|
1208
|
-
wrapper:
|
|
1199
|
+
wrapper: prefixSuffixWrapper + "left-0",
|
|
1209
1200
|
wrapperWithLabel: "w-max pl-12",
|
|
1210
1201
|
wrapperWithIcon: "w-40",
|
|
1211
1202
|
label: "antialiased block relative cursor-default pb-0 font-bold text-xs s-text"
|
|
@@ -1262,15 +1253,9 @@ var deadToggle = {
|
|
|
1262
1253
|
wrapper: `${toggle.wrapper} h-20 w-20 pointer-events-none`,
|
|
1263
1254
|
input: `${toggle.input} hidden`,
|
|
1264
1255
|
inputVue: "hidden",
|
|
1256
|
+
labelVue: "-mt-2",
|
|
1265
1257
|
labelRadio: `${toggle.label} ${toggle.labelBefore} ${toggle.radio}`,
|
|
1266
|
-
labelCheckbox: `${toggle.label} ${toggle.labelBefore} ${toggle.checkbox}
|
|
1267
|
-
labelVue: "-mt-2"
|
|
1268
|
-
};
|
|
1269
|
-
var clickable = {
|
|
1270
|
-
toggle: "absolute inset-0 h-full w-full appearance-none cursor-pointer focusable focusable-inset",
|
|
1271
|
-
label: `px-12 ${label.label} py-8! cursor-pointer focusable focusable-inset`,
|
|
1272
|
-
buttonOrLink: "bg-transparent focusable",
|
|
1273
|
-
buttonOrLinkStretch: "inset-0 absolute"
|
|
1258
|
+
labelCheckbox: `${toggle.label} ${toggle.labelBefore} ${toggle.checkbox}`
|
|
1274
1259
|
};
|
|
1275
1260
|
var attention = {
|
|
1276
1261
|
base: "border-2 relative flex items-start",
|
|
@@ -1320,24 +1305,15 @@ function kebabCaseAttributes(constructor) {
|
|
|
1320
1305
|
}
|
|
1321
1306
|
};
|
|
1322
1307
|
}
|
|
1323
|
-
function fclasses(definition) {
|
|
1324
|
-
const defn = {};
|
|
1325
|
-
for (const [key, value] of Object.entries(definition)) {
|
|
1326
|
-
for (const className of key.split(" ")) {
|
|
1327
|
-
defn[className] = value;
|
|
1328
|
-
}
|
|
1329
|
-
}
|
|
1330
|
-
return classMap(defn);
|
|
1331
|
-
}
|
|
1332
1308
|
|
|
1333
|
-
// node_modules/.pnpm/@warp-ds+icons@2.0.
|
|
1309
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/chevron-down-16.js
|
|
1334
1310
|
import { LitElement } from "lit";
|
|
1335
1311
|
import { unsafeStatic, html } from "lit/static-html.js";
|
|
1336
1312
|
|
|
1337
|
-
// node_modules/.pnpm/@lingui+core@4.
|
|
1313
|
+
// node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
|
|
1338
1314
|
var import_unraw = __toESM(require_dist(), 1);
|
|
1339
1315
|
|
|
1340
|
-
// node_modules/.pnpm/@lingui+message-utils@4.
|
|
1316
|
+
// node_modules/.pnpm/@lingui+message-utils@4.11.2/node_modules/@lingui/message-utils/dist/compileMessage.mjs
|
|
1341
1317
|
var import_parser = __toESM(require_parser(), 1);
|
|
1342
1318
|
function processTokens(tokens, mapText) {
|
|
1343
1319
|
if (!tokens.filter((token) => token.type !== "content").length) {
|
|
@@ -1361,11 +1337,9 @@ function processTokens(tokens, mapText) {
|
|
|
1361
1337
|
}
|
|
1362
1338
|
const offset = token.pluralOffset;
|
|
1363
1339
|
const formatProps = {};
|
|
1364
|
-
token.cases.forEach((
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
mapText
|
|
1368
|
-
);
|
|
1340
|
+
token.cases.forEach(({ key, tokens: tokens2 }) => {
|
|
1341
|
+
const prop = key[0] === "=" ? key.slice(1) : key;
|
|
1342
|
+
formatProps[prop] = processTokens(tokens2, mapText);
|
|
1369
1343
|
});
|
|
1370
1344
|
return [
|
|
1371
1345
|
token.arg,
|
|
@@ -1387,7 +1361,7 @@ Message: ${message}`);
|
|
|
1387
1361
|
}
|
|
1388
1362
|
}
|
|
1389
1363
|
|
|
1390
|
-
// node_modules/.pnpm/@lingui+core@4.
|
|
1364
|
+
// node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
|
|
1391
1365
|
var isString = (s) => typeof s === "string";
|
|
1392
1366
|
var isFunction = (f) => typeof f === "function";
|
|
1393
1367
|
var cache = /* @__PURE__ */ new Map();
|
|
@@ -1473,11 +1447,11 @@ var selectFormatter = (value, rules) => {
|
|
|
1473
1447
|
function interpolate(translation, locale, locales) {
|
|
1474
1448
|
return (values = {}, formats) => {
|
|
1475
1449
|
const formatters = getDefaultFormats(locale, locales, formats);
|
|
1476
|
-
const formatMessage = (tokens) => {
|
|
1450
|
+
const formatMessage = (tokens, replaceOctothorpe = false) => {
|
|
1477
1451
|
if (!Array.isArray(tokens))
|
|
1478
1452
|
return tokens;
|
|
1479
1453
|
return tokens.reduce((message, token) => {
|
|
1480
|
-
if (token === "#") {
|
|
1454
|
+
if (token === "#" && replaceOctothorpe) {
|
|
1481
1455
|
return message + OCTOTHORPE_PH;
|
|
1482
1456
|
}
|
|
1483
1457
|
if (isString(token)) {
|
|
@@ -1488,7 +1462,10 @@ function interpolate(translation, locale, locales) {
|
|
|
1488
1462
|
if (type === "plural" || type === "selectordinal" || type === "select") {
|
|
1489
1463
|
Object.entries(format).forEach(
|
|
1490
1464
|
([key, value2]) => {
|
|
1491
|
-
interpolatedFormat[key] = formatMessage(
|
|
1465
|
+
interpolatedFormat[key] = formatMessage(
|
|
1466
|
+
value2,
|
|
1467
|
+
type === "plural" || type === "selectordinal"
|
|
1468
|
+
);
|
|
1492
1469
|
}
|
|
1493
1470
|
);
|
|
1494
1471
|
} else {
|
|
@@ -1656,6 +1633,9 @@ var I18n = class extends EventEmitter {
|
|
|
1656
1633
|
}
|
|
1657
1634
|
_(id, values, options) {
|
|
1658
1635
|
let message = options == null ? void 0 : options.message;
|
|
1636
|
+
if (!id) {
|
|
1637
|
+
id = "";
|
|
1638
|
+
}
|
|
1659
1639
|
if (!isString(id)) {
|
|
1660
1640
|
values = id.values || values;
|
|
1661
1641
|
message = id.message;
|
|
@@ -1696,7 +1676,7 @@ function setupI18n(params = {}) {
|
|
|
1696
1676
|
}
|
|
1697
1677
|
var i18n = setupI18n();
|
|
1698
1678
|
|
|
1699
|
-
// node_modules/.pnpm/@warp-ds+icons@2.0.
|
|
1679
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/chevron-down-16.js
|
|
1700
1680
|
var messages = JSON.parse('{"icon.title.chevron-down":"Nedoverpil"}');
|
|
1701
1681
|
var messages2 = JSON.parse('{"icon.title.chevron-down":"Downward arrow"}');
|
|
1702
1682
|
var messages3 = JSON.parse('{"icon.title.chevron-down":"Nuoli alasp\xE4in"}');
|
|
@@ -1785,7 +1765,7 @@ if (!customElements.get("w-icon-chevron-down-16")) {
|
|
|
1785
1765
|
customElements.define("w-icon-chevron-down-16", IconChevronDown16);
|
|
1786
1766
|
}
|
|
1787
1767
|
|
|
1788
|
-
// node_modules/.pnpm/@warp-ds+icons@2.0.
|
|
1768
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/chevron-up-16.js
|
|
1789
1769
|
import { LitElement as LitElement2 } from "lit";
|
|
1790
1770
|
import { unsafeStatic as unsafeStatic2, html as html2 } from "lit/static-html.js";
|
|
1791
1771
|
var messages4 = JSON.parse('{"icon.title.chevron-up":"Oppoverpil"}');
|
|
@@ -1877,12 +1857,13 @@ if (!customElements.get("w-icon-chevron-up-16")) {
|
|
|
1877
1857
|
}
|
|
1878
1858
|
|
|
1879
1859
|
// packages/expandable/index.js
|
|
1860
|
+
var _WarpExpandable_instances, wrapperClasses_get, buttonClasses_get, chevronClasses_get, chevronIcon_get, contentClasses_get, expansionClasses_get;
|
|
1880
1861
|
var WarpExpandable = class extends kebabCaseAttributes(WarpElement) {
|
|
1881
1862
|
constructor() {
|
|
1882
1863
|
super();
|
|
1864
|
+
__privateAdd(this, _WarpExpandable_instances);
|
|
1883
1865
|
this.expanded = false;
|
|
1884
1866
|
this.animated = false;
|
|
1885
|
-
this.info = false;
|
|
1886
1867
|
this.box = false;
|
|
1887
1868
|
this.bleed = false;
|
|
1888
1869
|
this.noChevron = false;
|
|
@@ -1900,72 +1881,60 @@ var WarpExpandable = class extends kebabCaseAttributes(WarpElement) {
|
|
|
1900
1881
|
this._hasTitle = !!this.title || this.renderRoot.querySelector("slot[name='title']").assignedNodes().length > 0;
|
|
1901
1882
|
}
|
|
1902
1883
|
get _expandableSlot() {
|
|
1903
|
-
return html3`<div
|
|
1904
|
-
class=${fclasses({
|
|
1905
|
-
[this.contentClass || ""]: true,
|
|
1906
|
-
[box.box]: this.box,
|
|
1907
|
-
[expandable.paddingTop]: this._hasTitle && this.box
|
|
1908
|
-
})}>
|
|
1884
|
+
return html3`<div class="${__privateGet(this, _WarpExpandable_instances, contentClasses_get)}">
|
|
1909
1885
|
<slot></slot>
|
|
1910
1886
|
</div>`;
|
|
1911
1887
|
}
|
|
1912
|
-
get _chevronUpClasses() {
|
|
1913
|
-
return fclasses({
|
|
1914
|
-
[expandable.elementsTransformChevronUpPart]: true,
|
|
1915
|
-
[expandable.elementsChevronUpCollapsePart]: !this.expanded && this._showChevronUp
|
|
1916
|
-
});
|
|
1917
|
-
}
|
|
1918
|
-
get _chevronDownClasses() {
|
|
1919
|
-
return fclasses({
|
|
1920
|
-
[expandable.elementsTransformChevronDownPart]: true,
|
|
1921
|
-
[expandable.elementsChevronDownExpandPart]: this.expanded && !this._showChevronUp
|
|
1922
|
-
});
|
|
1923
|
-
}
|
|
1924
1888
|
render() {
|
|
1925
|
-
return html3` <div
|
|
1926
|
-
class=${fclasses({
|
|
1927
|
-
[expandable.expandable]: true,
|
|
1928
|
-
[expandable.expandableBox]: this.box,
|
|
1929
|
-
[expandable.expandableBleed]: this.bleed
|
|
1930
|
-
})}>
|
|
1889
|
+
return html3` <div class="${__privateGet(this, _WarpExpandable_instances, wrapperClasses_get)}">
|
|
1931
1890
|
${this._hasTitle ? html3`<w-unstyled-heading level=${this.headingLevel}>
|
|
1932
1891
|
<button
|
|
1933
1892
|
type="button"
|
|
1934
1893
|
aria-expanded="${this.expanded}"
|
|
1935
|
-
class
|
|
1936
|
-
[this.buttonClass || ""]: true,
|
|
1937
|
-
[expandable.button]: true,
|
|
1938
|
-
[expandable.buttonBox]: this.box
|
|
1939
|
-
})}
|
|
1894
|
+
class="${__privateGet(this, _WarpExpandable_instances, buttonClasses_get)}"
|
|
1940
1895
|
@click=${() => this.expanded = !this.expanded}>
|
|
1941
1896
|
<div class="${expandable.title}">
|
|
1942
1897
|
${this.title ? html3`<span class="${expandable.titleType}">${this.title}</span>` : html3`<slot name="title"></slot>`}
|
|
1943
|
-
${this.noChevron ? "" : html3`<div
|
|
1944
|
-
class=${fclasses({
|
|
1945
|
-
[expandable.chevron]: true,
|
|
1946
|
-
[expandable.chevronBox]: this.box,
|
|
1947
|
-
[expandable.chevronNonBox]: !this.box
|
|
1948
|
-
})}>
|
|
1949
|
-
${this._showChevronUp ? html3`<w-icon-chevron-up-16 class="${this._chevronUpClasses}"></w-icon-chevron-up-16>` : html3`<w-icon-chevron-down-16 class="${this._chevronDownClasses}"></w-icon-chevron-down-16>`}
|
|
1950
|
-
</div>`}
|
|
1898
|
+
${this.noChevron ? "" : html3`<div class="${__privateGet(this, _WarpExpandable_instances, chevronClasses_get)}">${__privateGet(this, _WarpExpandable_instances, chevronIcon_get)}</div>`}
|
|
1951
1899
|
</div>
|
|
1952
1900
|
</button>
|
|
1953
1901
|
</w-unstyled-heading>` : ""}
|
|
1954
|
-
${this.animated ? html3`<w-expand-transition ?show=${this.expanded}> ${this._expandableSlot} </w-expand-transition>` : html3`<div
|
|
1955
|
-
class=${fclasses({
|
|
1956
|
-
[expandable.expansion]: true,
|
|
1957
|
-
[expandable.expansionNotExpanded]: !this.expanded
|
|
1958
|
-
})}
|
|
1959
|
-
aria-hidden=${ifDefined(!this.expanded ? true : void 0)}>
|
|
1902
|
+
${this.animated ? html3`<w-expand-transition ?show=${this.expanded}> ${this._expandableSlot} </w-expand-transition>` : html3`<div class="${__privateGet(this, _WarpExpandable_instances, expansionClasses_get)}" aria-hidden=${ifDefined(!this.expanded ? true : void 0)}>
|
|
1960
1903
|
${this._expandableSlot}
|
|
1961
1904
|
</div>`}
|
|
1962
1905
|
</div>`;
|
|
1963
1906
|
}
|
|
1964
1907
|
};
|
|
1908
|
+
_WarpExpandable_instances = new WeakSet();
|
|
1909
|
+
wrapperClasses_get = function() {
|
|
1910
|
+
return r([expandable.wrapper, this.box && expandable.box, this.bleed && expandable.bleed]);
|
|
1911
|
+
};
|
|
1912
|
+
buttonClasses_get = function() {
|
|
1913
|
+
return r(this.buttonClass, [expandable.button, this.box && expandable.buttonBox]);
|
|
1914
|
+
};
|
|
1915
|
+
chevronClasses_get = function() {
|
|
1916
|
+
return r([expandable.chevron, !this.box && expandable.chevronNonBox]);
|
|
1917
|
+
};
|
|
1918
|
+
chevronIcon_get = function() {
|
|
1919
|
+
const upClasses = r([
|
|
1920
|
+
expandable.elementsChevronUpTransform,
|
|
1921
|
+
!this.expanded && this._showChevronUp && expandable.elementsChevronCollapse
|
|
1922
|
+
]);
|
|
1923
|
+
const downClasses = r([
|
|
1924
|
+
expandable.elementsChevronDownTransform,
|
|
1925
|
+
this.expanded && !this._showChevronUp && expandable.elementsChevronExpand
|
|
1926
|
+
]);
|
|
1927
|
+
return this._showChevronUp ? html3`<w-icon-chevron-up-16 class="${upClasses}"></w-icon-chevron-up-16>` : html3`<w-icon-chevron-down-16 class="${downClasses}"></w-icon-chevron-down-16>`;
|
|
1928
|
+
};
|
|
1929
|
+
contentClasses_get = function() {
|
|
1930
|
+
return r(this.contentClass, [this.box && box.base, this._hasTitle && this.box && expandable.contentWithTitle]);
|
|
1931
|
+
};
|
|
1932
|
+
expansionClasses_get = function() {
|
|
1933
|
+
return r([expandable.expansion, !this.expanded && expandable.expansionNotExpanded]);
|
|
1934
|
+
};
|
|
1965
1935
|
__publicField(WarpExpandable, "properties", {
|
|
1966
1936
|
expanded: { type: Boolean, reflect: true },
|
|
1967
1937
|
title: { type: String },
|
|
1968
|
-
info: { type: Boolean },
|
|
1969
1938
|
box: { type: Boolean },
|
|
1970
1939
|
bleed: { type: Boolean },
|
|
1971
1940
|
buttonClass: { type: String },
|