@warp-ds/elements 2.0.0-next.3 → 2.0.0-next.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +345 -377
- package/dist/index.js.map +4 -4
- package/dist/packages/affix/index.d.ts +13 -6
- package/dist/packages/affix/index.js +32 -65
- package/dist/packages/affix/index.js.map +4 -4
- package/dist/packages/alert/index.js +10 -60
- package/dist/packages/alert/index.js.map +3 -3
- package/dist/packages/attention/index.js +39 -80
- package/dist/packages/attention/index.js.map +4 -4
- package/dist/packages/badge/index.js +26 -72
- package/dist/packages/badge/index.js.map +4 -4
- package/dist/packages/box/index.d.ts +1 -1
- package/dist/packages/box/index.js +25 -64
- package/dist/packages/box/index.js.map +4 -4
- package/dist/packages/breadcrumbs/index.js +8 -52
- package/dist/packages/breadcrumbs/index.js.map +3 -3
- package/dist/packages/button/index.d.ts +6 -0
- package/dist/packages/button/index.js +66 -103
- package/dist/packages/button/index.js.map +3 -3
- package/dist/packages/card/index.d.ts +5 -5
- package/dist/packages/card/index.js +1461 -91
- 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 +70 -85
- package/dist/packages/expandable/index.js.map +4 -4
- package/dist/packages/modal/index.js +7 -51
- package/dist/packages/modal/index.js.map +3 -3
- package/dist/packages/pill/index.js +16 -64
- package/dist/packages/pill/index.js.map +3 -3
- package/dist/packages/select/index.d.ts +10 -0
- package/dist/packages/select/index.js +42 -72
- package/dist/packages/select/index.js.map +3 -3
- package/dist/packages/textfield/index.d.ts +9 -5
- package/dist/packages/textfield/index.js +49 -76
- package/dist/packages/textfield/index.js.map +4 -4
- package/dist/packages/toast/index.js +55 -90
- package/dist/packages/toast/index.js.map +4 -4
- 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 +4 -4
package/dist/index.js
CHANGED
|
@@ -1018,7 +1018,17 @@ var require_parser = __commonJS({
|
|
|
1018
1018
|
// packages/affix/index.js
|
|
1019
1019
|
import { html as html3 } from "lit";
|
|
1020
1020
|
|
|
1021
|
-
// 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
|
|
1022
1032
|
var badge = {
|
|
1023
1033
|
base: "py-4 px-8 border-0 rounded-4 text-xs inline-flex",
|
|
1024
1034
|
neutral: "bg-[--w-color-badge-neutral-background] s-text",
|
|
@@ -1036,7 +1046,7 @@ var badge = {
|
|
|
1036
1046
|
positionBL: "rounded-tl-0 rounded-br-0 rounded-bl-0 bottom-0 left-0"
|
|
1037
1047
|
};
|
|
1038
1048
|
var box = {
|
|
1039
|
-
|
|
1049
|
+
base: "group block relative break-words last-child:mb-0 p-16 rounded-8",
|
|
1040
1050
|
// Relative here enables w-clickable
|
|
1041
1051
|
bleed: "-mx-16 sm:mx-0 rounded-l-0 rounded-r-0 sm:rounded-8",
|
|
1042
1052
|
// We target L and R to override the default rounded-8
|
|
@@ -1045,7 +1055,7 @@ var box = {
|
|
|
1045
1055
|
bordered: "border-2 s-border s-bg"
|
|
1046
1056
|
};
|
|
1047
1057
|
var pill = {
|
|
1048
|
-
|
|
1058
|
+
wrapper: "flex items-center",
|
|
1049
1059
|
button: "inline-flex items-center focusable text-xs transition-all",
|
|
1050
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",
|
|
1051
1061
|
filter: "s-bg-primary hover:s-bg-primary-hover active:s-bg-primary-active s-text-inverted",
|
|
@@ -1056,29 +1066,29 @@ var pill = {
|
|
|
1056
1066
|
a11y: "sr-only"
|
|
1057
1067
|
};
|
|
1058
1068
|
var card = {
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
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",
|
|
1068
1078
|
a11y: "sr-only"
|
|
1069
1079
|
};
|
|
1070
1080
|
var toaster = {
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
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"
|
|
1074
1084
|
};
|
|
1075
1085
|
var toast = {
|
|
1076
1086
|
wrapper: "relative overflow-hidden w-full",
|
|
1077
|
-
|
|
1087
|
+
base: "flex group p-8 mt-16 rounded-8 border-2 pointer-events-auto transition-all",
|
|
1078
1088
|
positive: "s-bg-positive-subtle s-border-positive-subtle s-text",
|
|
1079
1089
|
warning: "s-bg-warning-subtle s-border-warning-subtle s-text",
|
|
1080
1090
|
negative: "s-bg-negative-subtle s-border-negative-subtle s-text",
|
|
1081
|
-
|
|
1091
|
+
iconBase: "shrink-0 rounded-full w-[16px] h-[16px] m-[8px]",
|
|
1082
1092
|
iconPositive: "s-icon-positive",
|
|
1083
1093
|
iconWarning: "s-icon-warning",
|
|
1084
1094
|
iconNegative: "s-icon-negative",
|
|
@@ -1086,30 +1096,27 @@ var toast = {
|
|
|
1086
1096
|
content: "self-center mr-8 py-4 last-child:mb-0",
|
|
1087
1097
|
close: "bg-transparent ml-auto p-[8px] s-icon hover:s-icon-hover active:s-icon-active"
|
|
1088
1098
|
};
|
|
1089
|
-
var buttonReset = "focus:outline-none appearance-none cursor-pointer bg-transparent border-0 m-0 p-0 inline-block";
|
|
1090
1099
|
var expandable = {
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
expandableInfo: "s-bg-info-subtle! hover:s-bg-info-subtle-hover!",
|
|
1095
|
-
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",
|
|
1096
1103
|
chevron: "inline-block align-middle s-icon",
|
|
1097
1104
|
chevronNonBox: "ml-8",
|
|
1098
|
-
chevronBox: "",
|
|
1099
1105
|
chevronTransform: "transform transition-transform transform-gpu ease-in-out",
|
|
1100
1106
|
chevronExpand: "-rotate-180",
|
|
1101
1107
|
chevronCollapse: "rotate-180",
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
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",
|
|
1106
1113
|
expansion: "overflow-hidden",
|
|
1107
1114
|
expansionNotExpanded: "h-0 invisible",
|
|
1108
|
-
button:
|
|
1109
|
-
buttonBox: "w-full text-left relative inline-flex items-center justify-between
|
|
1110
|
-
|
|
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",
|
|
1111
1118
|
title: "flex w-full justify-between items-center",
|
|
1112
|
-
titleType: "
|
|
1119
|
+
titleType: "t4"
|
|
1113
1120
|
};
|
|
1114
1121
|
var buttonDefaultStyling = "font-bold focusable justify-center transition-colors ease-in-out";
|
|
1115
1122
|
var buttonColors = {
|
|
@@ -1228,7 +1235,7 @@ var button = {
|
|
|
1228
1235
|
};
|
|
1229
1236
|
var modal = {
|
|
1230
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]",
|
|
1231
|
-
|
|
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",
|
|
1232
1239
|
content: "block overflow-y-auto overflow-x-hidden last-child:mb-0 grow shrink px-16 sm:px-32 relative",
|
|
1233
1240
|
footer: "flex justify-end shrink-0 px-16 sm:px-32",
|
|
1234
1241
|
transitionTitle: "transition-all duration-300",
|
|
@@ -1260,7 +1267,7 @@ var modalElement = {
|
|
|
1260
1267
|
footer: "flex justify-end shrink-0 px-16 sm:px-32 pt-24"
|
|
1261
1268
|
};
|
|
1262
1269
|
var alert = {
|
|
1263
|
-
|
|
1270
|
+
wrapper: "flex p-16 border border-l-4 rounded-4 s-text",
|
|
1264
1271
|
willChangeHeight: "will-change-height",
|
|
1265
1272
|
textWrapper: "last-child:mb-0 text-s",
|
|
1266
1273
|
title: "text-s",
|
|
@@ -1295,33 +1302,34 @@ var input = {
|
|
|
1295
1302
|
textArea: "min-h-[42] sm:min-h-[45]"
|
|
1296
1303
|
};
|
|
1297
1304
|
var select = {
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
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",
|
|
1302
1310
|
wrapper: "relative",
|
|
1303
1311
|
selectWrapper: `relative before:block before:absolute before:right-0 before:bottom-0 before:w-32 before:h-full before:pointer-events-none `,
|
|
1304
|
-
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",
|
|
1305
1313
|
chevronDisabled: "opacity-25"
|
|
1306
1314
|
};
|
|
1307
1315
|
var label = {
|
|
1308
|
-
|
|
1316
|
+
base: "antialiased block relative text-s font-bold pb-4 cursor-pointer s-text",
|
|
1309
1317
|
optional: "pl-8 font-normal text-s s-text-subtle"
|
|
1310
1318
|
};
|
|
1311
1319
|
var helpText = {
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1320
|
+
base: "text-xs mt-4 block",
|
|
1321
|
+
color: "s-text-subtle",
|
|
1322
|
+
colorInvalid: "s-text-negative"
|
|
1315
1323
|
};
|
|
1316
|
-
var
|
|
1324
|
+
var prefixSuffixWrapper = "absolute top-0 bottom-0 flex justify-center items-center focusable rounded-4 focus:[--w-outline-offset:-2px] bg-transparent ";
|
|
1317
1325
|
var suffix = {
|
|
1318
|
-
wrapper:
|
|
1326
|
+
wrapper: prefixSuffixWrapper + "right-0",
|
|
1319
1327
|
wrapperWithLabel: "w-max pr-12",
|
|
1320
1328
|
wrapperWithIcon: "w-40",
|
|
1321
1329
|
label: "antialiased block relative cursor-default pb-0 font-bold text-xs s-text"
|
|
1322
1330
|
};
|
|
1323
1331
|
var prefix = {
|
|
1324
|
-
wrapper:
|
|
1332
|
+
wrapper: prefixSuffixWrapper + "left-0",
|
|
1325
1333
|
wrapperWithLabel: "w-max pl-12",
|
|
1326
1334
|
wrapperWithIcon: "w-40",
|
|
1327
1335
|
label: "antialiased block relative cursor-default pb-0 font-bold text-xs s-text"
|
|
@@ -1385,15 +1393,9 @@ var deadToggle = {
|
|
|
1385
1393
|
wrapper: `${toggle.wrapper} h-20 w-20 pointer-events-none`,
|
|
1386
1394
|
input: `${toggle.input} hidden`,
|
|
1387
1395
|
inputVue: "hidden",
|
|
1396
|
+
labelVue: "-mt-2",
|
|
1388
1397
|
labelRadio: `${toggle.label} ${toggle.labelBefore} ${toggle.radio}`,
|
|
1389
|
-
labelCheckbox: `${toggle.label} ${toggle.labelBefore} ${toggle.checkbox}
|
|
1390
|
-
labelVue: "-mt-2"
|
|
1391
|
-
};
|
|
1392
|
-
var clickable = {
|
|
1393
|
-
toggle: "absolute inset-0 h-full w-full appearance-none cursor-pointer focusable focusable-inset",
|
|
1394
|
-
label: `px-12 ${label.label} py-8! cursor-pointer focusable focusable-inset`,
|
|
1395
|
-
buttonOrLink: "bg-transparent focusable",
|
|
1396
|
-
buttonOrLinkStretch: "inset-0 absolute"
|
|
1398
|
+
labelCheckbox: `${toggle.label} ${toggle.labelBefore} ${toggle.checkbox}`
|
|
1397
1399
|
};
|
|
1398
1400
|
var attention = {
|
|
1399
1401
|
base: "border-2 relative flex items-start",
|
|
@@ -1715,20 +1717,20 @@ var I18n = class extends EventEmitter {
|
|
|
1715
1717
|
}
|
|
1716
1718
|
this.emit("change");
|
|
1717
1719
|
}
|
|
1718
|
-
_load(locale,
|
|
1720
|
+
_load(locale, messages52) {
|
|
1719
1721
|
const maybeMessages = this._messages[locale];
|
|
1720
1722
|
if (!maybeMessages) {
|
|
1721
|
-
this._messages[locale] =
|
|
1723
|
+
this._messages[locale] = messages52;
|
|
1722
1724
|
} else {
|
|
1723
|
-
Object.assign(maybeMessages,
|
|
1725
|
+
Object.assign(maybeMessages, messages52);
|
|
1724
1726
|
}
|
|
1725
1727
|
}
|
|
1726
|
-
load(localeOrMessages,
|
|
1727
|
-
if (typeof localeOrMessages == "string" && typeof
|
|
1728
|
-
this._load(localeOrMessages,
|
|
1728
|
+
load(localeOrMessages, messages52) {
|
|
1729
|
+
if (typeof localeOrMessages == "string" && typeof messages52 === "object") {
|
|
1730
|
+
this._load(localeOrMessages, messages52);
|
|
1729
1731
|
} else {
|
|
1730
1732
|
Object.entries(localeOrMessages).forEach(
|
|
1731
|
-
([locale,
|
|
1733
|
+
([locale, messages213]) => this._load(locale, messages213)
|
|
1732
1734
|
);
|
|
1733
1735
|
}
|
|
1734
1736
|
this.emit("change");
|
|
@@ -1736,10 +1738,10 @@ var I18n = class extends EventEmitter {
|
|
|
1736
1738
|
/**
|
|
1737
1739
|
* @param options {@link LoadAndActivateOptions}
|
|
1738
1740
|
*/
|
|
1739
|
-
loadAndActivate({ locale, locales, messages:
|
|
1741
|
+
loadAndActivate({ locale, locales, messages: messages52 }) {
|
|
1740
1742
|
this._locale = locale;
|
|
1741
1743
|
this._locales = locales || void 0;
|
|
1742
|
-
this._messages[this._locale] =
|
|
1744
|
+
this._messages[this._locale] = messages52;
|
|
1743
1745
|
this.emit("change");
|
|
1744
1746
|
}
|
|
1745
1747
|
activate(locale, locales) {
|
|
@@ -1993,37 +1995,17 @@ function kebabCaseAttributes(constructor) {
|
|
|
1993
1995
|
}
|
|
1994
1996
|
};
|
|
1995
1997
|
}
|
|
1996
|
-
function classes(defn) {
|
|
1997
|
-
const classes3 = [];
|
|
1998
|
-
for (const [key, value] of Object.entries(defn)) {
|
|
1999
|
-
if (value) classes3.push(key);
|
|
2000
|
-
}
|
|
2001
|
-
return classes3.join(" ");
|
|
2002
|
-
}
|
|
2003
|
-
function fclasses(definition) {
|
|
2004
|
-
const defn = {};
|
|
2005
|
-
for (const [key, value] of Object.entries(definition)) {
|
|
2006
|
-
for (const className of key.split(" ")) {
|
|
2007
|
-
defn[className] = value;
|
|
2008
|
-
}
|
|
2009
|
-
}
|
|
2010
|
-
return classMap(defn);
|
|
2011
|
-
}
|
|
2012
1998
|
function generateRandomId() {
|
|
2013
1999
|
return `m${Math.random().toString(36).slice(2)}`;
|
|
2014
2000
|
}
|
|
2015
2001
|
|
|
2016
2002
|
// packages/affix/index.js
|
|
2017
|
-
var WarpAffix = class extends WarpElement {
|
|
2003
|
+
var WarpAffix = class extends kebabCaseAttributes(WarpElement) {
|
|
2018
2004
|
get _classBase() {
|
|
2019
2005
|
return this.slot === "suffix" ? suffix : prefix;
|
|
2020
2006
|
}
|
|
2021
2007
|
get _classes() {
|
|
2022
|
-
return
|
|
2023
|
-
[this._classBase.wrapper]: true,
|
|
2024
|
-
[this._classBase.wrapperWithLabel]: this.label,
|
|
2025
|
-
[this._classBase.wrapperWithIcon]: !this.label
|
|
2026
|
-
});
|
|
2008
|
+
return r([this._classBase.wrapper, this.label ? this._classBase.wrapperWithLabel : this._classBase.wrapperWithIcon]);
|
|
2027
2009
|
}
|
|
2028
2010
|
get _searchButton() {
|
|
2029
2011
|
return html3`
|
|
@@ -2059,31 +2041,19 @@ var WarpAffix = class extends WarpElement {
|
|
|
2059
2041
|
return html3`${this._markup}`;
|
|
2060
2042
|
}
|
|
2061
2043
|
};
|
|
2062
|
-
__publicField(WarpAffix, "styles", [WarpElement.styles]);
|
|
2063
2044
|
__publicField(WarpAffix, "properties", {
|
|
2064
|
-
ariaLabel: { type: String
|
|
2045
|
+
ariaLabel: { type: String },
|
|
2065
2046
|
clear: { type: Boolean },
|
|
2066
2047
|
search: { type: Boolean },
|
|
2067
2048
|
label: { type: String }
|
|
2068
2049
|
});
|
|
2050
|
+
__publicField(WarpAffix, "styles", [WarpElement.styles]);
|
|
2069
2051
|
if (!customElements.get("w-affix")) {
|
|
2070
2052
|
customElements.define("w-affix", WarpAffix);
|
|
2071
2053
|
}
|
|
2072
2054
|
|
|
2073
2055
|
// packages/alert/index.js
|
|
2074
2056
|
import { css, html as html8 } from "lit";
|
|
2075
|
-
|
|
2076
|
-
// node_modules/.pnpm/@chbphone55+classnames@2.0.0/node_modules/@chbphone55/classnames/dist/index.m.js
|
|
2077
|
-
var r = function() {
|
|
2078
|
-
for (var t = [], n2 = arguments.length; n2--; ) t[n2] = arguments[n2];
|
|
2079
|
-
return t.reduce(function(t2, n3) {
|
|
2080
|
-
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) {
|
|
2081
|
-
return n3[r3] ? r3 : "";
|
|
2082
|
-
}) : "");
|
|
2083
|
-
}, []).join(" ");
|
|
2084
|
-
};
|
|
2085
|
-
|
|
2086
|
-
// packages/alert/index.js
|
|
2087
2057
|
import WarpElement2 from "@warp-ds/elements-core";
|
|
2088
2058
|
|
|
2089
2059
|
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/info-16.js
|
|
@@ -2470,17 +2440,11 @@ var WarpAlert = class extends WarpElement2 {
|
|
|
2470
2440
|
}
|
|
2471
2441
|
}
|
|
2472
2442
|
get _wrapperClasses() {
|
|
2473
|
-
return r(
|
|
2474
|
-
[alert.alert]: true,
|
|
2475
|
-
[alert[this.variant]]: true
|
|
2476
|
-
});
|
|
2443
|
+
return r([alert.wrapper, alert[this.variant]]);
|
|
2477
2444
|
}
|
|
2478
2445
|
get _iconClasses() {
|
|
2479
2446
|
const activeIconClassNames = alert[`${this.variant}Icon`];
|
|
2480
|
-
return r(
|
|
2481
|
-
[alert.icon]: true,
|
|
2482
|
-
[activeIconClassNames]: true
|
|
2483
|
-
});
|
|
2447
|
+
return r([alert.icon, activeIconClassNames]);
|
|
2484
2448
|
}
|
|
2485
2449
|
get _icon() {
|
|
2486
2450
|
if (this.variant === variants.info) {
|
|
@@ -2539,7 +2503,7 @@ if (!customElements.get("w-alert")) {
|
|
|
2539
2503
|
// packages/attention/index.js
|
|
2540
2504
|
import { css as css2, html as html9, nothing } from "lit";
|
|
2541
2505
|
|
|
2542
|
-
// 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
|
|
2543
2507
|
var sides = ["top", "right", "bottom", "left"];
|
|
2544
2508
|
var min = Math.min;
|
|
2545
2509
|
var max = Math.max;
|
|
@@ -2668,7 +2632,7 @@ function rectToClientRect(rect) {
|
|
|
2668
2632
|
};
|
|
2669
2633
|
}
|
|
2670
2634
|
|
|
2671
|
-
// 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
|
|
2672
2636
|
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
2673
2637
|
let {
|
|
2674
2638
|
reference,
|
|
@@ -3156,7 +3120,7 @@ var offset = function(options) {
|
|
|
3156
3120
|
};
|
|
3157
3121
|
};
|
|
3158
3122
|
|
|
3159
|
-
// 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
|
|
3160
3124
|
function getNodeName(node) {
|
|
3161
3125
|
if (isNode(node)) {
|
|
3162
3126
|
return (node.nodeName || "").toLowerCase();
|
|
@@ -3207,19 +3171,18 @@ function isTopLayer(element) {
|
|
|
3207
3171
|
}
|
|
3208
3172
|
});
|
|
3209
3173
|
}
|
|
3210
|
-
function isContainingBlock(
|
|
3174
|
+
function isContainingBlock(elementOrCss) {
|
|
3211
3175
|
const webkit = isWebKit();
|
|
3212
|
-
const css11 = getComputedStyle(
|
|
3176
|
+
const css11 = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
|
|
3213
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));
|
|
3214
3178
|
}
|
|
3215
3179
|
function getContainingBlock(element) {
|
|
3216
3180
|
let currentNode = getParentNode(element);
|
|
3217
3181
|
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
3218
|
-
if (isTopLayer(currentNode)) {
|
|
3219
|
-
return null;
|
|
3220
|
-
}
|
|
3221
3182
|
if (isContainingBlock(currentNode)) {
|
|
3222
3183
|
return currentNode;
|
|
3184
|
+
} else if (isTopLayer(currentNode)) {
|
|
3185
|
+
return null;
|
|
3223
3186
|
}
|
|
3224
3187
|
currentNode = getParentNode(currentNode);
|
|
3225
3188
|
}
|
|
@@ -3282,12 +3245,16 @@ function getOverflowAncestors(node, list, traverseIframes) {
|
|
|
3282
3245
|
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
3283
3246
|
const win = getWindow(scrollableAncestor);
|
|
3284
3247
|
if (isBody) {
|
|
3285
|
-
|
|
3248
|
+
const frameElement = getFrameElement(win);
|
|
3249
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
3286
3250
|
}
|
|
3287
3251
|
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
3288
3252
|
}
|
|
3253
|
+
function getFrameElement(win) {
|
|
3254
|
+
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
3255
|
+
}
|
|
3289
3256
|
|
|
3290
|
-
// 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
|
|
3291
3258
|
function getCssDimensions(element) {
|
|
3292
3259
|
const css11 = getComputedStyle(element);
|
|
3293
3260
|
let width = parseFloat(css11.width) || 0;
|
|
@@ -3381,7 +3348,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
3381
3348
|
const win = getWindow(domElement);
|
|
3382
3349
|
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
3383
3350
|
let currentWin = win;
|
|
3384
|
-
let currentIFrame = currentWin
|
|
3351
|
+
let currentIFrame = getFrameElement(currentWin);
|
|
3385
3352
|
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
3386
3353
|
const iframeScale = getScale(currentIFrame);
|
|
3387
3354
|
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
@@ -3395,7 +3362,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
3395
3362
|
x += left;
|
|
3396
3363
|
y2 += top;
|
|
3397
3364
|
currentWin = getWindow(currentIFrame);
|
|
3398
|
-
currentIFrame = currentWin
|
|
3365
|
+
currentIFrame = getFrameElement(currentWin);
|
|
3399
3366
|
}
|
|
3400
3367
|
}
|
|
3401
3368
|
return rectToClientRect({
|
|
@@ -3705,7 +3672,7 @@ var computePosition2 = (reference, floating, options) => {
|
|
|
3705
3672
|
}));
|
|
3706
3673
|
};
|
|
3707
3674
|
|
|
3708
|
-
// node_modules/.pnpm/@warp-ds+core@1.1.5_@floating-ui+dom@1.6.
|
|
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
|
|
3709
3676
|
var TOP_START = "top-start";
|
|
3710
3677
|
var TOP = "top";
|
|
3711
3678
|
var TOP_END = "top-end";
|
|
@@ -3890,8 +3857,8 @@ var getMessages7 = (locale, enMsg, nbMsg, fiMsg, daMsg) => {
|
|
|
3890
3857
|
};
|
|
3891
3858
|
var activateI18n7 = (enMessages, nbMessages, fiMessages, daMessages) => {
|
|
3892
3859
|
const locale = detectLocale7();
|
|
3893
|
-
const
|
|
3894
|
-
i18n.load(locale,
|
|
3860
|
+
const messages52 = getMessages7(locale, enMessages, nbMessages, fiMessages, daMessages);
|
|
3861
|
+
i18n.load(locale, messages52);
|
|
3895
3862
|
i18n.activate(locale);
|
|
3896
3863
|
};
|
|
3897
3864
|
|
|
@@ -3985,11 +3952,11 @@ ${JSON.stringify(directions)}`
|
|
|
3985
3952
|
return opposites[this._actualDirection];
|
|
3986
3953
|
}
|
|
3987
3954
|
get _arrowClasses() {
|
|
3988
|
-
return
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
[this.
|
|
3992
|
-
|
|
3955
|
+
return r([
|
|
3956
|
+
attention.arrowBase,
|
|
3957
|
+
this._activeVariantClasses.arrow,
|
|
3958
|
+
attention[`arrowDirection${arrowDirectionClassname(this._arrowDirection)}`]
|
|
3959
|
+
]);
|
|
3993
3960
|
}
|
|
3994
3961
|
get _arrowHtml() {
|
|
3995
3962
|
return this.noArrow ? "" : html9`<div id="arrow" role="img" class="${this._arrowClasses}"></div>`;
|
|
@@ -4020,10 +3987,7 @@ ${JSON.stringify(directions)}`
|
|
|
4020
3987
|
return messageSlot ? messageSlot.assignedNodes()[0] : null;
|
|
4021
3988
|
}
|
|
4022
3989
|
get _wrapperClasses() {
|
|
4023
|
-
return
|
|
4024
|
-
[attention.base]: true,
|
|
4025
|
-
[this._activeVariantClasses.wrapper]: true
|
|
4026
|
-
});
|
|
3990
|
+
return r([attention.base, this._activeVariantClasses.wrapper]);
|
|
4027
3991
|
}
|
|
4028
3992
|
get _ariaClose() {
|
|
4029
3993
|
return i18n._({
|
|
@@ -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.5_@floating-ui+dom@1.6.
|
|
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
|
)}
|
|
@@ -4513,59 +4477,66 @@ ${buttonTypes2.join(", ")}.`);
|
|
|
4513
4477
|
setTimeout(() => this.focus(), 0);
|
|
4514
4478
|
}
|
|
4515
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
|
+
}
|
|
4516
4529
|
get _classes() {
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
[button.secondarySmallLoading]: secondary && this.small && !this.quiet && this.loading,
|
|
4528
|
-
[button.secondarySmallQuiet]: secondary && this.small && this.quiet && !this.loading,
|
|
4529
|
-
[button.secondarySmallQuietLoading]: secondary && this.small && this.quiet && this.loading,
|
|
4530
|
-
[button.secondaryQuiet]: secondary && !this.small && this.quiet && !this.loading,
|
|
4531
|
-
[button.secondaryQuietLoading]: secondary && !this.small && this.quiet && this.loading,
|
|
4532
|
-
[button.secondaryLoading]: secondary && !this.small && !this.quiet && this.loading,
|
|
4533
|
-
[button.primary]: primary && !this.small && !this.quiet && !this.loading,
|
|
4534
|
-
[button.primarySmall]: primary && this.small && !this.quiet && !this.loading,
|
|
4535
|
-
[button.primarySmallQuiet]: primary && this.small && this.quiet && !this.loading,
|
|
4536
|
-
[button.primarySmallLoading]: primary && this.small && !this.quiet && this.loading,
|
|
4537
|
-
[button.primarySmallQuietLoading]: primary && this.small && this.quiet && this.loading,
|
|
4538
|
-
[button.primaryQuiet]: primary && !this.small && this.quiet && !this.loading,
|
|
4539
|
-
[button.primaryQuietLoading]: primary && !this.small && this.quiet && this.loading,
|
|
4540
|
-
[button.primaryLoading]: primary && !this.small && !this.quiet && this.loading,
|
|
4541
|
-
[button.utility]: utility && !this.small && !this.quiet && !this.loading,
|
|
4542
|
-
[button.utilitySmall]: utility && this.small && !this.quiet && !this.loading,
|
|
4543
|
-
[button.utilitySmallQuiet]: utility && this.small && this.quiet && !this.loading,
|
|
4544
|
-
[button.utilitySmallLoading]: utility && this.small && !this.quiet && this.loading,
|
|
4545
|
-
[button.utilitySmallQuietLoading]: utility && this.small && this.quiet && this.loading,
|
|
4546
|
-
[button.utilityQuiet]: utility && !this.small && this.quiet && !this.loading,
|
|
4547
|
-
[button.utilityQuietLoading]: utility && !this.small && this.quiet && this.loading,
|
|
4548
|
-
[button.utilityLoading]: utility && !this.small && !this.quiet && this.loading,
|
|
4549
|
-
[button.negative]: negative && !this.small && !this.quiet && !this.loading,
|
|
4550
|
-
[button.negativeSmall]: negative && this.small && !this.quiet && !this.loading,
|
|
4551
|
-
[button.negativeSmallQuiet]: negative && this.small && this.quiet && !this.loading,
|
|
4552
|
-
[button.negativeSmallLoading]: negative && this.small && !this.quiet && this.loading,
|
|
4553
|
-
[button.negativeSmallQuietLoading]: negative && this.small && this.quiet && this.loading,
|
|
4554
|
-
[button.negativeQuiet]: negative && !this.small && this.quiet && !this.loading,
|
|
4555
|
-
[button.negativeQuietLoading]: negative && !this.small && this.quiet && this.loading,
|
|
4556
|
-
[button.negativeLoading]: negative && !this.small && !this.quiet && this.loading,
|
|
4557
|
-
[button.pill]: pill2 && !this.small && !this.loading,
|
|
4558
|
-
[button.pillSmall]: pill2 && this.small && !this.loading,
|
|
4559
|
-
[button.pillLoading]: pill2 && !this.small && this.loading,
|
|
4560
|
-
[button.pillSmallLoading]: pill2 && this.small && this.loading,
|
|
4561
|
-
[button.link]: link && !this.small,
|
|
4562
|
-
[button.linkSmall]: link && this.small,
|
|
4563
|
-
[button.linkAsButton]: !!this.href,
|
|
4564
|
-
[button.fullWidth]: this.fullWidth,
|
|
4565
|
-
[button.contentWidth]: !this.fullWidth
|
|
4566
|
-
},
|
|
4567
|
-
this.buttonClass
|
|
4568
|
-
);
|
|
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
|
+
]);
|
|
4569
4540
|
}
|
|
4570
4541
|
render() {
|
|
4571
4542
|
return html14` ${this.href ? html14`<a
|
|
@@ -4605,6 +4576,20 @@ if (!customElements.get("w-button")) {
|
|
|
4605
4576
|
import { html as html15, css as css4 } from "lit";
|
|
4606
4577
|
import WarpElement9 from "@warp-ds/elements-core";
|
|
4607
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
|
|
4608
4593
|
var keys = {
|
|
4609
4594
|
ENTER: "Enter",
|
|
4610
4595
|
SPACE: " "
|
|
@@ -4612,30 +4597,31 @@ var keys = {
|
|
|
4612
4597
|
var WarpCard = class extends WarpElement9 {
|
|
4613
4598
|
constructor() {
|
|
4614
4599
|
super();
|
|
4600
|
+
activateI18n7(messages27, messages29, messages28, messages21);
|
|
4615
4601
|
this.selected = false;
|
|
4616
4602
|
this.flat = false;
|
|
4617
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
|
+
});
|
|
4618
4609
|
}
|
|
4619
4610
|
get _containerClasses() {
|
|
4620
|
-
return
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
});
|
|
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
|
+
]);
|
|
4627
4617
|
}
|
|
4628
4618
|
get _outlineClasses() {
|
|
4629
|
-
return
|
|
4630
|
-
[card.cardOutline]: true,
|
|
4631
|
-
[this.selected ? card.cardOutlineSelected : card.cardOutlineUnselected]: true
|
|
4632
|
-
});
|
|
4619
|
+
return r([card.outline, this.selected ? card.outlineSelected : card.outlineUnselected]);
|
|
4633
4620
|
}
|
|
4634
|
-
get
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
return html15`<span role="checkbox" aria-checked="true" aria-disabled="true"></span>`;
|
|
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() : "";
|
|
4639
4625
|
}
|
|
4640
4626
|
keypressed(e) {
|
|
4641
4627
|
if (!this.clickable || e.altKey || e.ctrlKey) return;
|
|
@@ -4647,13 +4633,17 @@ var WarpCard = class extends WarpElement9 {
|
|
|
4647
4633
|
render() {
|
|
4648
4634
|
return html15`
|
|
4649
4635
|
<div tabindex=${ifDefined3(this.clickable ? "0" : void 0)} class="${this._containerClasses}" @keydown=${this.keypressed}>
|
|
4650
|
-
${this.
|
|
4651
|
-
<div class="${this._outlineClasses}"></div>
|
|
4636
|
+
${this._interactiveElement} ${this.flat ? "" : html15`<div class="${this._outlineClasses}"></div>`}
|
|
4652
4637
|
<slot></slot>
|
|
4653
4638
|
</div>
|
|
4654
4639
|
`;
|
|
4655
4640
|
}
|
|
4656
4641
|
};
|
|
4642
|
+
__publicField(WarpCard, "properties", {
|
|
4643
|
+
selected: { type: Boolean, reflect: true },
|
|
4644
|
+
flat: { type: Boolean },
|
|
4645
|
+
clickable: { type: Boolean }
|
|
4646
|
+
});
|
|
4657
4647
|
__publicField(WarpCard, "styles", [
|
|
4658
4648
|
WarpElement9.styles,
|
|
4659
4649
|
css4`
|
|
@@ -4670,11 +4660,6 @@ __publicField(WarpCard, "styles", [
|
|
|
4670
4660
|
}
|
|
4671
4661
|
`
|
|
4672
4662
|
]);
|
|
4673
|
-
__publicField(WarpCard, "properties", {
|
|
4674
|
-
selected: { type: Boolean, reflect: true },
|
|
4675
|
-
flat: { type: Boolean },
|
|
4676
|
-
clickable: { type: Boolean }
|
|
4677
|
-
});
|
|
4678
4663
|
if (!customElements.get("w-card")) {
|
|
4679
4664
|
customElements.define("w-card", WarpCard);
|
|
4680
4665
|
}
|
|
@@ -4687,8 +4672,8 @@ import { ifDefined as ifDefined4 } from "lit/directives/if-defined.js";
|
|
|
4687
4672
|
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/chevron-down-16.js
|
|
4688
4673
|
import { LitElement as LitElement7 } from "lit";
|
|
4689
4674
|
import { unsafeStatic as unsafeStatic7, html as html16 } from "lit/static-html.js";
|
|
4690
|
-
var
|
|
4691
|
-
var
|
|
4675
|
+
var messages30 = JSON.parse('{"icon.title.chevron-down":"Nedoverpil"}');
|
|
4676
|
+
var messages210 = JSON.parse('{"icon.title.chevron-down":"Downward arrow"}');
|
|
4692
4677
|
var messages37 = JSON.parse('{"icon.title.chevron-down":"Nuoli alasp\xE4in"}');
|
|
4693
4678
|
var supportedLocales8 = ["en", "nb", "fi", "da", "sv"];
|
|
4694
4679
|
var defaultLocale9 = "en";
|
|
@@ -4764,7 +4749,7 @@ var activateI18n8 = (enMessages, nbMessages, fiMessages) => {
|
|
|
4764
4749
|
i18n.load(locale, messages410);
|
|
4765
4750
|
i18n.activate(locale);
|
|
4766
4751
|
};
|
|
4767
|
-
activateI18n8(
|
|
4752
|
+
activateI18n8(messages210, messages30, messages37);
|
|
4768
4753
|
var IconChevronDown16 = class extends LitElement7 {
|
|
4769
4754
|
render() {
|
|
4770
4755
|
const title = i18n.t({ message: `Downward arrow`, id: "icon.title.chevron-down", comment: "Title for chevron-down icon" });
|
|
@@ -4778,8 +4763,8 @@ if (!customElements.get("w-icon-chevron-down-16")) {
|
|
|
4778
4763
|
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/chevron-up-16.js
|
|
4779
4764
|
import { LitElement as LitElement8 } from "lit";
|
|
4780
4765
|
import { unsafeStatic as unsafeStatic8, html as html17 } from "lit/static-html.js";
|
|
4781
|
-
var
|
|
4782
|
-
var
|
|
4766
|
+
var messages31 = JSON.parse('{"icon.title.chevron-up":"Oppoverpil"}');
|
|
4767
|
+
var messages211 = JSON.parse('{"icon.title.chevron-up":"Upward arrow"}');
|
|
4783
4768
|
var messages38 = JSON.parse('{"icon.title.chevron-up":"Nuoli yl\xF6sp\xE4in"}');
|
|
4784
4769
|
var supportedLocales9 = ["en", "nb", "fi", "da", "sv"];
|
|
4785
4770
|
var defaultLocale10 = "en";
|
|
@@ -4855,7 +4840,7 @@ var activateI18n9 = (enMessages, nbMessages, fiMessages) => {
|
|
|
4855
4840
|
i18n.load(locale, messages410);
|
|
4856
4841
|
i18n.activate(locale);
|
|
4857
4842
|
};
|
|
4858
|
-
activateI18n9(
|
|
4843
|
+
activateI18n9(messages211, messages31, messages38);
|
|
4859
4844
|
var IconChevronUp16 = class extends LitElement8 {
|
|
4860
4845
|
render() {
|
|
4861
4846
|
const title = i18n.t({ message: `Upward arrow`, id: "icon.title.chevron-up", comment: "Title for chevron-up icon" });
|
|
@@ -4867,12 +4852,13 @@ if (!customElements.get("w-icon-chevron-up-16")) {
|
|
|
4867
4852
|
}
|
|
4868
4853
|
|
|
4869
4854
|
// packages/expandable/index.js
|
|
4855
|
+
var _WarpExpandable_instances, wrapperClasses_get, buttonClasses_get, chevronClasses_get, chevronIcon_get, contentClasses_get, expansionClasses_get;
|
|
4870
4856
|
var WarpExpandable = class extends kebabCaseAttributes(WarpElement10) {
|
|
4871
4857
|
constructor() {
|
|
4872
4858
|
super();
|
|
4859
|
+
__privateAdd(this, _WarpExpandable_instances);
|
|
4873
4860
|
this.expanded = false;
|
|
4874
4861
|
this.animated = false;
|
|
4875
|
-
this.info = false;
|
|
4876
4862
|
this.box = false;
|
|
4877
4863
|
this.bleed = false;
|
|
4878
4864
|
this.noChevron = false;
|
|
@@ -4890,72 +4876,60 @@ var WarpExpandable = class extends kebabCaseAttributes(WarpElement10) {
|
|
|
4890
4876
|
this._hasTitle = !!this.title || this.renderRoot.querySelector("slot[name='title']").assignedNodes().length > 0;
|
|
4891
4877
|
}
|
|
4892
4878
|
get _expandableSlot() {
|
|
4893
|
-
return html18`<div
|
|
4894
|
-
class="${classes({
|
|
4895
|
-
[this.contentClass || ""]: true,
|
|
4896
|
-
[box.box]: this.box,
|
|
4897
|
-
[expandable.paddingTop]: this._hasTitle && this.box
|
|
4898
|
-
})}">
|
|
4879
|
+
return html18`<div class="${__privateGet(this, _WarpExpandable_instances, contentClasses_get)}">
|
|
4899
4880
|
<slot></slot>
|
|
4900
4881
|
</div>`;
|
|
4901
4882
|
}
|
|
4902
|
-
get _chevronUpClasses() {
|
|
4903
|
-
return classes({
|
|
4904
|
-
[expandable.elementsTransformChevronUpPart]: true,
|
|
4905
|
-
[expandable.elementsChevronUpCollapsePart]: !this.expanded && this._showChevronUp
|
|
4906
|
-
});
|
|
4907
|
-
}
|
|
4908
|
-
get _chevronDownClasses() {
|
|
4909
|
-
return classes({
|
|
4910
|
-
[expandable.elementsTransformChevronDownPart]: true,
|
|
4911
|
-
[expandable.elementsChevronDownExpandPart]: this.expanded && !this._showChevronUp
|
|
4912
|
-
});
|
|
4913
|
-
}
|
|
4914
4883
|
render() {
|
|
4915
|
-
return html18` <div
|
|
4916
|
-
class="${classes({
|
|
4917
|
-
[expandable.expandable]: true,
|
|
4918
|
-
[expandable.expandableBox]: this.box,
|
|
4919
|
-
[expandable.expandableBleed]: this.bleed
|
|
4920
|
-
})}">
|
|
4884
|
+
return html18` <div class="${__privateGet(this, _WarpExpandable_instances, wrapperClasses_get)}">
|
|
4921
4885
|
${this._hasTitle ? html18`<w-unstyled-heading level=${this.headingLevel}>
|
|
4922
4886
|
<button
|
|
4923
4887
|
type="button"
|
|
4924
4888
|
aria-expanded="${this.expanded}"
|
|
4925
|
-
class="${
|
|
4926
|
-
[this.buttonClass || ""]: true,
|
|
4927
|
-
[expandable.button]: true,
|
|
4928
|
-
[expandable.buttonBox]: this.box
|
|
4929
|
-
})}"
|
|
4889
|
+
class="${__privateGet(this, _WarpExpandable_instances, buttonClasses_get)}"
|
|
4930
4890
|
@click=${() => this.expanded = !this.expanded}>
|
|
4931
4891
|
<div class="${expandable.title}">
|
|
4932
4892
|
${this.title ? html18`<span class="${expandable.titleType}">${this.title}</span>` : html18`<slot name="title"></slot>`}
|
|
4933
|
-
${this.noChevron ? "" : html18`<div
|
|
4934
|
-
class="${classes({
|
|
4935
|
-
[expandable.chevron]: true,
|
|
4936
|
-
[expandable.chevronBox]: this.box,
|
|
4937
|
-
[expandable.chevronNonBox]: !this.box
|
|
4938
|
-
})}">
|
|
4939
|
-
${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>`}
|
|
4940
|
-
</div>`}
|
|
4893
|
+
${this.noChevron ? "" : html18`<div class="${__privateGet(this, _WarpExpandable_instances, chevronClasses_get)}">${__privateGet(this, _WarpExpandable_instances, chevronIcon_get)}</div>`}
|
|
4941
4894
|
</div>
|
|
4942
4895
|
</button>
|
|
4943
4896
|
</w-unstyled-heading>` : ""}
|
|
4944
|
-
${this.animated ? html18`<w-expand-transition ?show=${this.expanded}> ${this._expandableSlot} </w-expand-transition>` : html18`<div
|
|
4945
|
-
class="${classes({
|
|
4946
|
-
[expandable.expansion]: true,
|
|
4947
|
-
[expandable.expansionNotExpanded]: !this.expanded
|
|
4948
|
-
})}"
|
|
4949
|
-
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)}>
|
|
4950
4898
|
${this._expandableSlot}
|
|
4951
4899
|
</div>`}
|
|
4952
4900
|
</div>`;
|
|
4953
4901
|
}
|
|
4954
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
|
+
};
|
|
4955
4930
|
__publicField(WarpExpandable, "properties", {
|
|
4956
4931
|
expanded: { type: Boolean, reflect: true },
|
|
4957
4932
|
title: { type: String },
|
|
4958
|
-
info: { type: Boolean },
|
|
4959
4933
|
box: { type: Boolean },
|
|
4960
4934
|
bleed: { type: Boolean },
|
|
4961
4935
|
buttonClass: { type: String },
|
|
@@ -5101,9 +5075,9 @@ var Move = class {
|
|
|
5101
5075
|
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/arrow-left-16.js
|
|
5102
5076
|
import { LitElement as LitElement9 } from "lit";
|
|
5103
5077
|
import { unsafeStatic as unsafeStatic9, html as html20 } from "lit/static-html.js";
|
|
5104
|
-
var
|
|
5105
|
-
var
|
|
5106
|
-
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"}');
|
|
5107
5081
|
var supportedLocales10 = ["en", "nb", "fi", "da", "sv"];
|
|
5108
5082
|
var defaultLocale11 = "en";
|
|
5109
5083
|
var detectByBrand9 = () => {
|
|
@@ -5178,7 +5152,7 @@ var activateI18n10 = (enMessages, nbMessages, fiMessages) => {
|
|
|
5178
5152
|
i18n.load(locale, messages410);
|
|
5179
5153
|
i18n.activate(locale);
|
|
5180
5154
|
};
|
|
5181
|
-
activateI18n10(
|
|
5155
|
+
activateI18n10(messages212, messages39, messages310);
|
|
5182
5156
|
var IconArrowLeft16 = class extends LitElement9 {
|
|
5183
5157
|
render() {
|
|
5184
5158
|
const title = i18n.t({ message: `Leftward-pointing arrow`, id: "icon.title.arrow-left", comment: "Title for table arrow left icon" });
|
|
@@ -5478,22 +5452,22 @@ import { html as html23 } from "lit";
|
|
|
5478
5452
|
import WarpElement14 from "@warp-ds/elements-core";
|
|
5479
5453
|
|
|
5480
5454
|
// packages/pill/locales/da/messages.mjs
|
|
5481
|
-
var
|
|
5455
|
+
var messages40 = JSON.parse('{"pill.aria.openFilter":"\xC5bn filter","pill.aria.removeFilter":["Fjern filter ",["label"]]}');
|
|
5482
5456
|
|
|
5483
5457
|
// packages/pill/locales/en/messages.mjs
|
|
5484
|
-
var
|
|
5458
|
+
var messages41 = JSON.parse('{"pill.aria.openFilter":"Open filter","pill.aria.removeFilter":["Remove filter ",["label"]]}');
|
|
5485
5459
|
|
|
5486
5460
|
// packages/pill/locales/fi/messages.mjs
|
|
5487
|
-
var
|
|
5461
|
+
var messages42 = JSON.parse('{"pill.aria.openFilter":"Avaa suodatin","pill.aria.removeFilter":["Tyhjenn\xE4 suodatin ",["label"]]}');
|
|
5488
5462
|
|
|
5489
5463
|
// packages/pill/locales/nb/messages.mjs
|
|
5490
|
-
var
|
|
5464
|
+
var messages43 = JSON.parse('{"pill.aria.openFilter":"\xC5pne filter","pill.aria.removeFilter":["Fjern filter ",["label"]]}');
|
|
5491
5465
|
|
|
5492
5466
|
// packages/pill/index.js
|
|
5493
5467
|
var WarpPill = class extends kebabCaseAttributes(WarpElement14) {
|
|
5494
5468
|
constructor() {
|
|
5495
5469
|
super();
|
|
5496
|
-
activateI18n7(
|
|
5470
|
+
activateI18n7(messages41, messages43, messages42, messages40);
|
|
5497
5471
|
this.canClose = false;
|
|
5498
5472
|
this.suggestion = false;
|
|
5499
5473
|
this.openFilterSrText = i18n._({
|
|
@@ -5508,19 +5482,15 @@ var WarpPill = class extends kebabCaseAttributes(WarpElement14) {
|
|
|
5508
5482
|
});
|
|
5509
5483
|
}
|
|
5510
5484
|
get _labelClasses() {
|
|
5511
|
-
return r(
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5485
|
+
return r([
|
|
5486
|
+
pill.button,
|
|
5487
|
+
pill.label,
|
|
5488
|
+
this.suggestion ? pill.suggestion : pill.filter,
|
|
5489
|
+
this.canClose ? pill.labelWithClose : pill.labelWithoutClose
|
|
5490
|
+
]);
|
|
5517
5491
|
}
|
|
5518
5492
|
get _closeClasses() {
|
|
5519
|
-
return r(
|
|
5520
|
-
[pill.button]: true,
|
|
5521
|
-
[this.suggestion ? pill.suggestion : pill.filter]: true,
|
|
5522
|
-
[pill.close]: true
|
|
5523
|
-
});
|
|
5493
|
+
return r([pill.button, pill.close, this.suggestion ? pill.suggestion : pill.filter]);
|
|
5524
5494
|
}
|
|
5525
5495
|
_onClick() {
|
|
5526
5496
|
this.dispatchEvent(new CustomEvent("w-pill-click", { bubbles: true, composed: true }));
|
|
@@ -5530,7 +5500,7 @@ var WarpPill = class extends kebabCaseAttributes(WarpElement14) {
|
|
|
5530
5500
|
}
|
|
5531
5501
|
render() {
|
|
5532
5502
|
return html23`
|
|
5533
|
-
<div class="${pill.
|
|
5503
|
+
<div class="${pill.wrapper}">
|
|
5534
5504
|
<button type="button" class="${this._labelClasses}" @click="${this._onClick}">
|
|
5535
5505
|
<span class="${pill.a11y}">${this.openSrLabel ? this.openSrLabel : this.openFilterSrText}</span>
|
|
5536
5506
|
<slot></slot>
|
|
@@ -5562,31 +5532,39 @@ import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
|
5562
5532
|
import { when } from "lit/directives/when.js";
|
|
5563
5533
|
|
|
5564
5534
|
// packages/select/locales/da/messages.mjs
|
|
5565
|
-
var
|
|
5535
|
+
var messages44 = JSON.parse('{"select.label.optional":"(valgfrit)"}');
|
|
5566
5536
|
|
|
5567
5537
|
// packages/select/locales/en/messages.mjs
|
|
5568
|
-
var
|
|
5538
|
+
var messages45 = JSON.parse('{"select.label.optional":"(optional)"}');
|
|
5569
5539
|
|
|
5570
5540
|
// packages/select/locales/fi/messages.mjs
|
|
5571
|
-
var
|
|
5541
|
+
var messages46 = JSON.parse('{"select.label.optional":"(vapaaehtoinen)"}');
|
|
5572
5542
|
|
|
5573
5543
|
// packages/select/locales/nb/messages.mjs
|
|
5574
|
-
var
|
|
5544
|
+
var messages47 = JSON.parse('{"select.label.optional":"(valgfritt)"}');
|
|
5575
5545
|
|
|
5576
5546
|
// packages/select/index.js
|
|
5577
|
-
var _WarpSelect_instances, classes_get, helpTextClasses_get,
|
|
5547
|
+
var _WarpSelect_instances, classes_get, helpTextClasses_get, chevronClasses_get2, id_get, helpId_get;
|
|
5578
5548
|
var WarpSelect = class extends kebabCaseAttributes(WarpElement15) {
|
|
5579
5549
|
constructor() {
|
|
5580
5550
|
super();
|
|
5581
5551
|
__privateAdd(this, _WarpSelect_instances);
|
|
5582
|
-
activateI18n7(
|
|
5552
|
+
activateI18n7(messages45, messages47, messages46, messages44);
|
|
5583
5553
|
this._options = this.innerHTML;
|
|
5584
5554
|
}
|
|
5555
|
+
firstUpdated() {
|
|
5556
|
+
this.autoFocus && this.shadowRoot.querySelector("select").focus();
|
|
5557
|
+
}
|
|
5558
|
+
handleKeyDown(event) {
|
|
5559
|
+
if (this.readOnly && (event.key === " " || event.key === "ArrowDown" || event.key === "ArrowUp")) {
|
|
5560
|
+
event.preventDefault();
|
|
5561
|
+
}
|
|
5562
|
+
}
|
|
5585
5563
|
render() {
|
|
5586
5564
|
return html24`<div class="${select.wrapper}">
|
|
5587
5565
|
${when(
|
|
5588
5566
|
this.label,
|
|
5589
|
-
() => html24`<label class="${label.
|
|
5567
|
+
() => html24`<label class="${label.base}" for="${__privateGet(this, _WarpSelect_instances, id_get)}">
|
|
5590
5568
|
${this.label}
|
|
5591
5569
|
${when(
|
|
5592
5570
|
this.optional,
|
|
@@ -5604,13 +5582,14 @@ var WarpSelect = class extends kebabCaseAttributes(WarpElement15) {
|
|
|
5604
5582
|
<select
|
|
5605
5583
|
class="${__privateGet(this, _WarpSelect_instances, classes_get)}"
|
|
5606
5584
|
id="${__privateGet(this, _WarpSelect_instances, id_get)}"
|
|
5607
|
-
?
|
|
5585
|
+
?disabled=${this.disabled}
|
|
5608
5586
|
aria-describedby="${ifDefined5(__privateGet(this, _WarpSelect_instances, helpId_get))}"
|
|
5609
5587
|
aria-invalid="${ifDefined5(this.invalid)}"
|
|
5610
|
-
aria-errormessage="${ifDefined5(this.invalid && __privateGet(this, _WarpSelect_instances, helpId_get))}"
|
|
5588
|
+
aria-errormessage="${ifDefined5(this.invalid && __privateGet(this, _WarpSelect_instances, helpId_get))}"
|
|
5589
|
+
@keydown=${this.handleKeyDown}>
|
|
5611
5590
|
${unsafeHTML(this._options)}
|
|
5612
5591
|
</select>
|
|
5613
|
-
<div class="${__privateGet(this, _WarpSelect_instances,
|
|
5592
|
+
<div class="${__privateGet(this, _WarpSelect_instances, chevronClasses_get2)}">
|
|
5614
5593
|
<w-icon-chevron-down-16></w-icon-chevron-down-16>
|
|
5615
5594
|
</div>
|
|
5616
5595
|
</div>
|
|
@@ -5620,23 +5599,19 @@ var WarpSelect = class extends kebabCaseAttributes(WarpElement15) {
|
|
|
5620
5599
|
};
|
|
5621
5600
|
_WarpSelect_instances = new WeakSet();
|
|
5622
5601
|
classes_get = function() {
|
|
5623
|
-
return r(
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
|
|
5602
|
+
return r([
|
|
5603
|
+
select.base,
|
|
5604
|
+
!this.invalid && !this.disabled && !this.readOnly && select.default,
|
|
5605
|
+
this.invalid && select.invalid,
|
|
5606
|
+
this.disabled && select.disabled,
|
|
5607
|
+
this.readOnly && select.readOnly
|
|
5608
|
+
]);
|
|
5627
5609
|
};
|
|
5628
5610
|
helpTextClasses_get = function() {
|
|
5629
|
-
return r(
|
|
5630
|
-
[helpText.helpText]: true,
|
|
5631
|
-
[helpText.helpTextColor]: !this.invalid,
|
|
5632
|
-
[helpText.helpTextColorInvalid]: this.invalid
|
|
5633
|
-
});
|
|
5611
|
+
return r([helpText.base, this.invalid ? helpText.colorInvalid : helpText.color]);
|
|
5634
5612
|
};
|
|
5635
|
-
|
|
5636
|
-
return r(
|
|
5637
|
-
[select.chevron]: true,
|
|
5638
|
-
[select.chevronDisabled]: this.disabled
|
|
5639
|
-
});
|
|
5613
|
+
chevronClasses_get2 = function() {
|
|
5614
|
+
return r([select.chevron, this.disabled && select.chevronDisabled]);
|
|
5640
5615
|
};
|
|
5641
5616
|
id_get = function() {
|
|
5642
5617
|
return "select_id";
|
|
@@ -5657,6 +5632,10 @@ __publicField(WarpSelect, "properties", {
|
|
|
5657
5632
|
label: { type: String, reflect: true },
|
|
5658
5633
|
// Whether to show optional text
|
|
5659
5634
|
optional: { type: Boolean, reflect: true },
|
|
5635
|
+
// Renders the field in a disabled state.
|
|
5636
|
+
disabled: { type: Boolean, reflect: true },
|
|
5637
|
+
// Renders the field in a readonly state.
|
|
5638
|
+
readOnly: { type: Boolean, relfect: true },
|
|
5660
5639
|
_options: { state: true }
|
|
5661
5640
|
});
|
|
5662
5641
|
__publicField(WarpSelect, "styles", [WarpElement15.styles]);
|
|
@@ -5668,32 +5647,28 @@ if (!customElements.get("w-select")) {
|
|
|
5668
5647
|
import { css as css7, html as html25 } from "lit";
|
|
5669
5648
|
import WarpElement16 from "@warp-ds/elements-core";
|
|
5670
5649
|
import { ifDefined as ifDefined6 } from "lit/directives/if-defined.js";
|
|
5671
|
-
var WarpTextField = class extends WarpElement16 {
|
|
5650
|
+
var WarpTextField = class extends kebabCaseAttributes(WarpElement16) {
|
|
5672
5651
|
constructor() {
|
|
5673
5652
|
super();
|
|
5674
5653
|
this.type = "text";
|
|
5675
5654
|
}
|
|
5676
5655
|
get _inputStyles() {
|
|
5677
|
-
return
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5656
|
+
return r([
|
|
5657
|
+
input.base,
|
|
5658
|
+
this._hasSuffix && input.suffix,
|
|
5659
|
+
this._hasPrefix && input.prefix,
|
|
5660
|
+
!this.invalid && !this.disabled && !this.readOnly && input.default,
|
|
5661
|
+
this.invalid && !this.disabled && !this.readOnly && input.invalid,
|
|
5662
|
+
!this.invalid && this.disabled && !this.readOnly && input.disabled,
|
|
5663
|
+
!this.invalid && !this.disabled && this.readOnly && input.readOnly
|
|
5664
|
+
]);
|
|
5686
5665
|
}
|
|
5687
5666
|
get _helpTextStyles() {
|
|
5688
|
-
return
|
|
5689
|
-
[helpText.helpText]: true,
|
|
5690
|
-
[helpText.helpTextColor]: !this.invalid,
|
|
5691
|
-
[helpText.helpTextColorInvalid]: this.invalid
|
|
5692
|
-
});
|
|
5667
|
+
return r([helpText.base, this.invalid ? helpText.colorInvalid : helpText.color]);
|
|
5693
5668
|
}
|
|
5694
5669
|
get _label() {
|
|
5695
5670
|
if (this.label) {
|
|
5696
|
-
return html25`<label for="${this._id}" class=${label.
|
|
5671
|
+
return html25`<label for="${this._id}" class=${label.base}>${this.label}</label>`;
|
|
5697
5672
|
}
|
|
5698
5673
|
}
|
|
5699
5674
|
get _helpId() {
|
|
@@ -5764,16 +5739,16 @@ __publicField(WarpTextField, "properties", {
|
|
|
5764
5739
|
invalid: { type: Boolean },
|
|
5765
5740
|
id: { type: String },
|
|
5766
5741
|
label: { type: String },
|
|
5767
|
-
helpText: { type: String
|
|
5742
|
+
helpText: { type: String },
|
|
5768
5743
|
size: { type: String },
|
|
5769
5744
|
max: { type: Number },
|
|
5770
5745
|
min: { type: Number },
|
|
5771
|
-
minLength: { type: Number
|
|
5772
|
-
maxLength: { type: Number
|
|
5746
|
+
minLength: { type: Number },
|
|
5747
|
+
maxLength: { type: Number },
|
|
5773
5748
|
name: { type: String },
|
|
5774
5749
|
pattern: { type: String },
|
|
5775
5750
|
placeholder: { type: String },
|
|
5776
|
-
readOnly: { type: Boolean
|
|
5751
|
+
readOnly: { type: Boolean },
|
|
5777
5752
|
required: { type: Boolean },
|
|
5778
5753
|
type: { type: String },
|
|
5779
5754
|
value: { type: String },
|
|
@@ -5911,8 +5886,8 @@ var WarpToastContainer = class extends WarpElement17 {
|
|
|
5911
5886
|
}
|
|
5912
5887
|
render() {
|
|
5913
5888
|
return html26`
|
|
5914
|
-
<aside class="${toaster.
|
|
5915
|
-
<div class="${toaster.
|
|
5889
|
+
<aside class="${toaster.wrapper}">
|
|
5890
|
+
<div class="${toaster.base}" id="w-toast-container-list">
|
|
5916
5891
|
${repeat2(
|
|
5917
5892
|
this._toastsArray,
|
|
5918
5893
|
(toast3) => toast3.id,
|
|
@@ -6016,40 +5991,32 @@ var collapse = (el, done) => {
|
|
|
6016
5991
|
};
|
|
6017
5992
|
|
|
6018
5993
|
// packages/toast/toast.js
|
|
6019
|
-
import { classMap as classMap2 } from "lit/directives/class-map.js";
|
|
6020
5994
|
import { when as when2 } from "lit/directives/when.js";
|
|
6021
5995
|
|
|
6022
5996
|
// packages/toast/locales/da/messages.mjs
|
|
6023
|
-
var
|
|
5997
|
+
var messages48 = JSON.parse('{"toast.aria.error":"Fejl","toast.aria.successful":"Fuldf\xF8rt","toast.aria.warning":"Advarsel"}');
|
|
6024
5998
|
|
|
6025
5999
|
// packages/toast/locales/en/messages.mjs
|
|
6026
|
-
var
|
|
6000
|
+
var messages49 = JSON.parse('{"toast.aria.error":"Error","toast.aria.successful":"Successful","toast.aria.warning":"Warning"}');
|
|
6027
6001
|
|
|
6028
6002
|
// packages/toast/locales/fi/messages.mjs
|
|
6029
|
-
var
|
|
6003
|
+
var messages50 = JSON.parse('{"toast.aria.error":"Virhe","toast.aria.successful":"Onnistui","toast.aria.warning":"Varoitus"}');
|
|
6030
6004
|
|
|
6031
6005
|
// packages/toast/locales/nb/messages.mjs
|
|
6032
|
-
var
|
|
6006
|
+
var messages51 = JSON.parse('{"toast.aria.error":"Feil","toast.aria.successful":"Vellykket","toast.aria.warning":"Advarsel"}');
|
|
6033
6007
|
|
|
6034
6008
|
// packages/toast/toast.js
|
|
6035
|
-
var classes2 = (definition) => {
|
|
6036
|
-
const defn = {};
|
|
6037
|
-
for (const [key, value] of Object.entries(definition)) {
|
|
6038
|
-
for (const className of key.split(" ")) {
|
|
6039
|
-
defn[className] = value;
|
|
6040
|
-
}
|
|
6041
|
-
}
|
|
6042
|
-
return classMap2(defn);
|
|
6043
|
-
};
|
|
6044
6009
|
var toastType = {
|
|
6045
6010
|
success: "success",
|
|
6046
6011
|
error: "error",
|
|
6047
6012
|
warning: "warning"
|
|
6048
6013
|
};
|
|
6014
|
+
var _WarpToast_instances, primaryClasses_get, iconClasses_get;
|
|
6049
6015
|
var WarpToast = class extends WarpElement18 {
|
|
6050
6016
|
constructor() {
|
|
6051
6017
|
super();
|
|
6052
|
-
|
|
6018
|
+
__privateAdd(this, _WarpToast_instances);
|
|
6019
|
+
activateI18n7(messages49, messages51, messages50, messages48);
|
|
6053
6020
|
this.id = Date.now().toString(36) + Math.random().toString(36).slice(2, 5);
|
|
6054
6021
|
this.type = "success";
|
|
6055
6022
|
this.text = "";
|
|
@@ -6064,22 +6031,6 @@ var WarpToast = class extends WarpElement18 {
|
|
|
6064
6031
|
updated() {
|
|
6065
6032
|
if (!this._expanded && this._wrapper) expand(this._wrapper, () => this._expanded = true);
|
|
6066
6033
|
}
|
|
6067
|
-
get _primaryClasses() {
|
|
6068
|
-
return classes2({
|
|
6069
|
-
[toast.toast]: true,
|
|
6070
|
-
[toast.positive]: this.type === toastType.success,
|
|
6071
|
-
[toast.warning]: this.type === toastType.warning,
|
|
6072
|
-
[toast.negative]: this.type === toastType.error
|
|
6073
|
-
});
|
|
6074
|
-
}
|
|
6075
|
-
get _iconClasses() {
|
|
6076
|
-
return classes2({
|
|
6077
|
-
[toast.icon]: true,
|
|
6078
|
-
[toast.iconPositive]: this.type === toastType.success,
|
|
6079
|
-
[toast.iconWarning]: this.type === toastType.warning,
|
|
6080
|
-
[toast.iconNegative]: this.type === toastType.error
|
|
6081
|
-
});
|
|
6082
|
-
}
|
|
6083
6034
|
get _wrapper() {
|
|
6084
6035
|
var _a, _b;
|
|
6085
6036
|
return (_b = (_a = this.renderRoot) == null ? void 0 : _a.querySelector(`section`)) != null ? _b : null;
|
|
@@ -6137,8 +6088,8 @@ var WarpToast = class extends WarpElement18 {
|
|
|
6137
6088
|
render() {
|
|
6138
6089
|
if (!this.text) return html27``;
|
|
6139
6090
|
return html27` <section class="${toast.wrapper}" aria-label="${this._typeLabel}">
|
|
6140
|
-
<div class="${this
|
|
6141
|
-
<div class="${this
|
|
6091
|
+
<div class="${__privateGet(this, _WarpToast_instances, primaryClasses_get)}">
|
|
6092
|
+
<div class="${__privateGet(this, _WarpToast_instances, iconClasses_get)}">${this._iconMarkup}</div>
|
|
6142
6093
|
<div role="${this._role}" class="${toast.content}">
|
|
6143
6094
|
<p>${this.text}</p>
|
|
6144
6095
|
</div>
|
|
@@ -6154,6 +6105,23 @@ var WarpToast = class extends WarpElement18 {
|
|
|
6154
6105
|
</section>`;
|
|
6155
6106
|
}
|
|
6156
6107
|
};
|
|
6108
|
+
_WarpToast_instances = new WeakSet();
|
|
6109
|
+
primaryClasses_get = function() {
|
|
6110
|
+
return r([
|
|
6111
|
+
toast.base,
|
|
6112
|
+
this.type === toastType.success && toast.positive,
|
|
6113
|
+
this.type === toastType.warning && toast.warning,
|
|
6114
|
+
this.type === toastType.error && toast.negative
|
|
6115
|
+
]);
|
|
6116
|
+
};
|
|
6117
|
+
iconClasses_get = function() {
|
|
6118
|
+
return r([
|
|
6119
|
+
toast.iconBase,
|
|
6120
|
+
this.type === toastType.success && toast.iconPositive,
|
|
6121
|
+
this.type === toastType.warning && toast.iconWarning,
|
|
6122
|
+
this.type === toastType.error && toast.iconNegative
|
|
6123
|
+
]);
|
|
6124
|
+
};
|
|
6157
6125
|
__publicField(WarpToast, "styles", [
|
|
6158
6126
|
WarpElement18.styles,
|
|
6159
6127
|
css9`
|