@warp-ds/elements 2.0.0-next.2 → 2.0.0-next.3
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 +205 -255
- package/dist/index.js.map +4 -4
- package/dist/packages/affix/index.d.ts +1 -1
- package/dist/packages/affix/index.js +35 -49
- package/dist/packages/affix/index.js.map +3 -3
- package/dist/packages/alert/index.js +39 -55
- package/dist/packages/alert/index.js.map +3 -3
- package/dist/packages/attention/index.js +118 -109
- package/dist/packages/attention/index.js.map +4 -4
- package/dist/packages/badge/index.js +3 -7
- package/dist/packages/badge/index.js.map +2 -2
- package/dist/packages/box/index.d.ts +1 -1
- package/dist/packages/box/index.js +2 -5
- package/dist/packages/box/index.js.map +2 -2
- package/dist/packages/breadcrumbs/index.js +36 -53
- 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.js +36 -54
- package/dist/packages/button/index.js.map +3 -3
- package/dist/packages/card/index.d.ts +2 -2
- package/dist/packages/card/index.js +3 -7
- package/dist/packages/card/index.js.map +2 -2
- package/dist/packages/expandable/index.d.ts +2 -2
- package/dist/packages/expandable/index.js +52 -68
- package/dist/packages/expandable/index.js.map +4 -4
- package/dist/packages/modal/index.js +45 -69
- 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 +38 -56
- package/dist/packages/pill/index.js.map +3 -3
- package/dist/packages/select/index.js +54 -87
- package/dist/packages/select/index.js.map +3 -3
- package/dist/packages/textfield/index.js +7 -15
- package/dist/packages/textfield/index.js.map +2 -2
- package/dist/packages/toast/api.d.ts +1 -1
- package/dist/packages/toast/index.js +68 -110
- package/dist/packages/toast/index.js.map +3 -3
- package/dist/packages/toast/toast-container.d.ts +1 -1
- package/dist/packages/toast/toast.d.ts +2 -2
- package/dist/packages/utils/index.d.ts +1 -1
- package/package.json +27 -28
|
@@ -49,10 +49,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
49
49
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
50
50
|
mod
|
|
51
51
|
));
|
|
52
|
-
var __publicField = (obj, key, value) =>
|
|
53
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
54
|
-
return value;
|
|
55
|
-
};
|
|
52
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
56
53
|
|
|
57
54
|
// node_modules/.pnpm/unraw@3.0.0/node_modules/unraw/dist/errors.js
|
|
58
55
|
var require_errors = __commonJS({
|
|
@@ -225,8 +222,7 @@ var require_moo = __commonJS({
|
|
|
225
222
|
return "(" + s + ")";
|
|
226
223
|
}
|
|
227
224
|
function reUnion(regexps) {
|
|
228
|
-
if (!regexps.length)
|
|
229
|
-
return "(?!)";
|
|
225
|
+
if (!regexps.length) return "(?!)";
|
|
230
226
|
var source = regexps.map(function(s) {
|
|
231
227
|
return "(?:" + s + ")";
|
|
232
228
|
}).join("|");
|
|
@@ -236,14 +232,10 @@ var require_moo = __commonJS({
|
|
|
236
232
|
if (typeof obj === "string") {
|
|
237
233
|
return "(?:" + reEscape(obj) + ")";
|
|
238
234
|
} 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");
|
|
235
|
+
if (obj.ignoreCase) throw new Error("RegExp /i flag not allowed");
|
|
236
|
+
if (obj.global) throw new Error("RegExp /g flag is implied");
|
|
237
|
+
if (obj.sticky) throw new Error("RegExp /y flag is implied");
|
|
238
|
+
if (obj.multiline) throw new Error("RegExp /m flag is implied");
|
|
247
239
|
return obj.source;
|
|
248
240
|
} else {
|
|
249
241
|
throw new Error("Not a pattern: " + obj);
|
|
@@ -292,16 +284,14 @@ var require_moo = __commonJS({
|
|
|
292
284
|
var match = [];
|
|
293
285
|
rules.forEach(function(rule) {
|
|
294
286
|
if (isObject(rule)) {
|
|
295
|
-
if (match.length)
|
|
296
|
-
result.push(ruleOptions(key, match));
|
|
287
|
+
if (match.length) result.push(ruleOptions(key, match));
|
|
297
288
|
result.push(ruleOptions(key, rule));
|
|
298
289
|
match = [];
|
|
299
290
|
} else {
|
|
300
291
|
match.push(rule);
|
|
301
292
|
}
|
|
302
293
|
});
|
|
303
|
-
if (match.length)
|
|
304
|
-
result.push(ruleOptions(key, match));
|
|
294
|
+
if (match.length) result.push(ruleOptions(key, match));
|
|
305
295
|
}
|
|
306
296
|
return result;
|
|
307
297
|
}
|
|
@@ -436,8 +426,7 @@ var require_moo = __commonJS({
|
|
|
436
426
|
var fallbackRule = errorRule && errorRule.fallback;
|
|
437
427
|
var flags = hasSticky && !fallbackRule ? "ym" : "gm";
|
|
438
428
|
var suffix2 = hasSticky || fallbackRule ? "" : "|";
|
|
439
|
-
if (unicodeFlag === true)
|
|
440
|
-
flags += "u";
|
|
429
|
+
if (unicodeFlag === true) flags += "u";
|
|
441
430
|
var combined = new RegExp(reUnion(parts) + suffix2, flags);
|
|
442
431
|
return { regexp: combined, groups, fast, error: errorRule || defaultErrorRule };
|
|
443
432
|
}
|
|
@@ -458,8 +447,7 @@ var require_moo = __commonJS({
|
|
|
458
447
|
var all = states.$all ? toRules(states.$all) : [];
|
|
459
448
|
delete states.$all;
|
|
460
449
|
var keys = Object.getOwnPropertyNames(states);
|
|
461
|
-
if (!start)
|
|
462
|
-
start = keys[0];
|
|
450
|
+
if (!start) start = keys[0];
|
|
463
451
|
var ruleMap = /* @__PURE__ */ Object.create(null);
|
|
464
452
|
for (var i = 0; i < keys.length; i++) {
|
|
465
453
|
var key = keys[i];
|
|
@@ -471,8 +459,7 @@ var require_moo = __commonJS({
|
|
|
471
459
|
var included = /* @__PURE__ */ Object.create(null);
|
|
472
460
|
for (var j = 0; j < rules.length; j++) {
|
|
473
461
|
var rule = rules[j];
|
|
474
|
-
if (!rule.include)
|
|
475
|
-
continue;
|
|
462
|
+
if (!rule.include) continue;
|
|
476
463
|
var splice = [j, 1];
|
|
477
464
|
if (rule.include !== key && !included[rule.include]) {
|
|
478
465
|
included[rule.include] = true;
|
|
@@ -482,8 +469,7 @@ var require_moo = __commonJS({
|
|
|
482
469
|
}
|
|
483
470
|
for (var k = 0; k < newRules.length; k++) {
|
|
484
471
|
var newRule = newRules[k];
|
|
485
|
-
if (rules.indexOf(newRule) !== -1)
|
|
486
|
-
continue;
|
|
472
|
+
if (rules.indexOf(newRule) !== -1) continue;
|
|
487
473
|
splice.push(newRule);
|
|
488
474
|
}
|
|
489
475
|
}
|
|
@@ -564,8 +550,7 @@ var require_moo = __commonJS({
|
|
|
564
550
|
};
|
|
565
551
|
};
|
|
566
552
|
Lexer.prototype.setState = function(state) {
|
|
567
|
-
if (!state || this.state === state)
|
|
568
|
-
return;
|
|
553
|
+
if (!state || this.state === state) return;
|
|
569
554
|
this.state = state;
|
|
570
555
|
var info = this.states[state];
|
|
571
556
|
this.groups = info.groups;
|
|
@@ -669,12 +654,9 @@ var require_moo = __commonJS({
|
|
|
669
654
|
var err = new Error(this.formatError(token, "invalid syntax"));
|
|
670
655
|
throw err;
|
|
671
656
|
}
|
|
672
|
-
if (group.pop)
|
|
673
|
-
|
|
674
|
-
else if (group.
|
|
675
|
-
this.pushState(group.push);
|
|
676
|
-
else if (group.next)
|
|
677
|
-
this.setState(group.next);
|
|
657
|
+
if (group.pop) this.popState();
|
|
658
|
+
else if (group.push) this.pushState(group.push);
|
|
659
|
+
else if (group.next) this.setState(group.next);
|
|
678
660
|
return token;
|
|
679
661
|
};
|
|
680
662
|
if (typeof Symbol !== "undefined" && Symbol.iterator) {
|
|
@@ -1029,8 +1011,7 @@ import { css, html as html5 } from "lit";
|
|
|
1029
1011
|
|
|
1030
1012
|
// node_modules/.pnpm/@chbphone55+classnames@2.0.0/node_modules/@chbphone55/classnames/dist/index.m.js
|
|
1031
1013
|
var r = function() {
|
|
1032
|
-
for (var t = [], n = arguments.length; n--; )
|
|
1033
|
-
t[n] = arguments[n];
|
|
1014
|
+
for (var t = [], n = arguments.length; n--; ) t[n] = arguments[n];
|
|
1034
1015
|
return t.reduce(function(t2, n2) {
|
|
1035
1016
|
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) {
|
|
1036
1017
|
return n2[r2] ? r2 : "";
|
|
@@ -1038,7 +1019,7 @@ var r = function() {
|
|
|
1038
1019
|
}, []).join(" ");
|
|
1039
1020
|
};
|
|
1040
1021
|
|
|
1041
|
-
// node_modules/.pnpm/@warp-ds+css@2.0.0-next.4_@warp-ds+uno@2.0.0_unocss@0.
|
|
1022
|
+
// node_modules/.pnpm/@warp-ds+css@2.0.0-next.4_@warp-ds+uno@2.0.0_unocss@0.61.3_postcss@8.4.39_rollup@4.18.1_vite@_fn7nbuinwdlc4yeboswpxt5lie/node_modules/@warp-ds/css/component-classes/index.js
|
|
1042
1023
|
var box = {
|
|
1043
1024
|
box: "group block relative break-words last-child:mb-0 p-16 rounded-8",
|
|
1044
1025
|
// Relative here enables w-clickable
|
|
@@ -1329,14 +1310,14 @@ var attention = {
|
|
|
1329
1310
|
// packages/alert/index.js
|
|
1330
1311
|
import WarpElement from "@warp-ds/elements-core";
|
|
1331
1312
|
|
|
1332
|
-
// node_modules/.pnpm/@warp-ds+icons@2.0.
|
|
1313
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/info-16.js
|
|
1333
1314
|
import { LitElement } from "lit";
|
|
1334
1315
|
import { unsafeStatic, html } from "lit/static-html.js";
|
|
1335
1316
|
|
|
1336
|
-
// node_modules/.pnpm/@lingui+core@4.
|
|
1317
|
+
// node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
|
|
1337
1318
|
var import_unraw = __toESM(require_dist(), 1);
|
|
1338
1319
|
|
|
1339
|
-
// node_modules/.pnpm/@lingui+message-utils@4.
|
|
1320
|
+
// node_modules/.pnpm/@lingui+message-utils@4.11.2/node_modules/@lingui/message-utils/dist/compileMessage.mjs
|
|
1340
1321
|
var import_parser = __toESM(require_parser(), 1);
|
|
1341
1322
|
function processTokens(tokens, mapText) {
|
|
1342
1323
|
if (!tokens.filter((token) => token.type !== "content").length) {
|
|
@@ -1360,11 +1341,9 @@ function processTokens(tokens, mapText) {
|
|
|
1360
1341
|
}
|
|
1361
1342
|
const offset = token.pluralOffset;
|
|
1362
1343
|
const formatProps = {};
|
|
1363
|
-
token.cases.forEach((
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
mapText
|
|
1367
|
-
);
|
|
1344
|
+
token.cases.forEach(({ key, tokens: tokens2 }) => {
|
|
1345
|
+
const prop = key[0] === "=" ? key.slice(1) : key;
|
|
1346
|
+
formatProps[prop] = processTokens(tokens2, mapText);
|
|
1368
1347
|
});
|
|
1369
1348
|
return [
|
|
1370
1349
|
token.arg,
|
|
@@ -1386,7 +1365,7 @@ Message: ${message}`);
|
|
|
1386
1365
|
}
|
|
1387
1366
|
}
|
|
1388
1367
|
|
|
1389
|
-
// node_modules/.pnpm/@lingui+core@4.
|
|
1368
|
+
// node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
|
|
1390
1369
|
var isString = (s) => typeof s === "string";
|
|
1391
1370
|
var isFunction = (f) => typeof f === "function";
|
|
1392
1371
|
var cache = /* @__PURE__ */ new Map();
|
|
@@ -1472,11 +1451,11 @@ var selectFormatter = (value, rules) => {
|
|
|
1472
1451
|
function interpolate(translation, locale, locales) {
|
|
1473
1452
|
return (values = {}, formats) => {
|
|
1474
1453
|
const formatters = getDefaultFormats(locale, locales, formats);
|
|
1475
|
-
const formatMessage = (tokens) => {
|
|
1454
|
+
const formatMessage = (tokens, replaceOctothorpe = false) => {
|
|
1476
1455
|
if (!Array.isArray(tokens))
|
|
1477
1456
|
return tokens;
|
|
1478
1457
|
return tokens.reduce((message, token) => {
|
|
1479
|
-
if (token === "#") {
|
|
1458
|
+
if (token === "#" && replaceOctothorpe) {
|
|
1480
1459
|
return message + OCTOTHORPE_PH;
|
|
1481
1460
|
}
|
|
1482
1461
|
if (isString(token)) {
|
|
@@ -1487,7 +1466,10 @@ function interpolate(translation, locale, locales) {
|
|
|
1487
1466
|
if (type === "plural" || type === "selectordinal" || type === "select") {
|
|
1488
1467
|
Object.entries(format).forEach(
|
|
1489
1468
|
([key, value2]) => {
|
|
1490
|
-
interpolatedFormat[key] = formatMessage(
|
|
1469
|
+
interpolatedFormat[key] = formatMessage(
|
|
1470
|
+
value2,
|
|
1471
|
+
type === "plural" || type === "selectordinal"
|
|
1472
|
+
);
|
|
1491
1473
|
}
|
|
1492
1474
|
);
|
|
1493
1475
|
} else {
|
|
@@ -1655,6 +1637,9 @@ var I18n = class extends EventEmitter {
|
|
|
1655
1637
|
}
|
|
1656
1638
|
_(id, values, options) {
|
|
1657
1639
|
let message = options == null ? void 0 : options.message;
|
|
1640
|
+
if (!id) {
|
|
1641
|
+
id = "";
|
|
1642
|
+
}
|
|
1658
1643
|
if (!isString(id)) {
|
|
1659
1644
|
values = id.values || values;
|
|
1660
1645
|
message = id.message;
|
|
@@ -1695,7 +1680,7 @@ function setupI18n(params = {}) {
|
|
|
1695
1680
|
}
|
|
1696
1681
|
var i18n = setupI18n();
|
|
1697
1682
|
|
|
1698
|
-
// node_modules/.pnpm/@warp-ds+icons@2.0.
|
|
1683
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/info-16.js
|
|
1699
1684
|
var messages = JSON.parse('{"icon.title.info":"Informasjonssirkel"}');
|
|
1700
1685
|
var messages2 = JSON.parse('{"icon.title.info":"Information circle"}');
|
|
1701
1686
|
var messages3 = JSON.parse('{"icon.title.info":"Ympyr\xE4, jonka sis\xE4ll\xE4 on i-kirjain"}');
|
|
@@ -1784,7 +1769,7 @@ if (!customElements.get("w-icon-info-16")) {
|
|
|
1784
1769
|
customElements.define("w-icon-info-16", IconInfo16);
|
|
1785
1770
|
}
|
|
1786
1771
|
|
|
1787
|
-
// node_modules/.pnpm/@warp-ds+icons@2.0.
|
|
1772
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/warning-16.js
|
|
1788
1773
|
import { LitElement as LitElement2 } from "lit";
|
|
1789
1774
|
import { unsafeStatic as unsafeStatic2, html as html2 } from "lit/static-html.js";
|
|
1790
1775
|
var messages4 = JSON.parse('{"icon.title.warning":"Varseltrekant med utropstegn"}');
|
|
@@ -1875,7 +1860,7 @@ if (!customElements.get("w-icon-warning-16")) {
|
|
|
1875
1860
|
customElements.define("w-icon-warning-16", IconWarning16);
|
|
1876
1861
|
}
|
|
1877
1862
|
|
|
1878
|
-
// node_modules/.pnpm/@warp-ds+icons@2.0.
|
|
1863
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/error-16.js
|
|
1879
1864
|
import { LitElement as LitElement3 } from "lit";
|
|
1880
1865
|
import { unsafeStatic as unsafeStatic3, html as html3 } from "lit/static-html.js";
|
|
1881
1866
|
var messages5 = JSON.parse('{"icon.title.error":"\xC5ttekant med utropstegn"}');
|
|
@@ -1966,7 +1951,7 @@ if (!customElements.get("w-icon-error-16")) {
|
|
|
1966
1951
|
customElements.define("w-icon-error-16", IconError16);
|
|
1967
1952
|
}
|
|
1968
1953
|
|
|
1969
|
-
// node_modules/.pnpm/@warp-ds+icons@2.0.
|
|
1954
|
+
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/success-16.js
|
|
1970
1955
|
import { LitElement as LitElement4 } from "lit";
|
|
1971
1956
|
import { unsafeStatic as unsafeStatic4, html as html4 } from "lit/static-html.js";
|
|
1972
1957
|
var messages6 = JSON.parse('{"icon.title.success":"Sirkel med sjekkmerke"}');
|
|
@@ -2101,8 +2086,7 @@ var WarpAlert = class extends WarpElement {
|
|
|
2101
2086
|
}
|
|
2102
2087
|
if (this.variant === variants.positive) {
|
|
2103
2088
|
return html5`<w-icon-success-16></w-icon-success-16>`;
|
|
2104
|
-
} else
|
|
2105
|
-
return "";
|
|
2089
|
+
} else return "";
|
|
2106
2090
|
}
|
|
2107
2091
|
render() {
|
|
2108
2092
|
return html5`
|