@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
|
@@ -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 = {}))
|
|
@@ -50,6 +53,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
50
53
|
mod
|
|
51
54
|
));
|
|
52
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);
|
|
53
59
|
|
|
54
60
|
// node_modules/.pnpm/unraw@3.0.0/node_modules/unraw/dist/errors.js
|
|
55
61
|
var require_errors = __commonJS({
|
|
@@ -1009,9 +1015,19 @@ var require_parser = __commonJS({
|
|
|
1009
1015
|
// packages/expandable/index.js
|
|
1010
1016
|
import { css, html as html3 } from "lit";
|
|
1011
1017
|
|
|
1012
|
-
// 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
|
|
1013
1029
|
var box = {
|
|
1014
|
-
|
|
1030
|
+
base: "group block relative break-words last-child:mb-0 p-16 rounded-8",
|
|
1015
1031
|
// Relative here enables w-clickable
|
|
1016
1032
|
bleed: "-mx-16 sm:mx-0 rounded-l-0 rounded-r-0 sm:rounded-8",
|
|
1017
1033
|
// We target L and R to override the default rounded-8
|
|
@@ -1019,30 +1035,27 @@ var box = {
|
|
|
1019
1035
|
neutral: "s-surface-sunken",
|
|
1020
1036
|
bordered: "border-2 s-border s-bg"
|
|
1021
1037
|
};
|
|
1022
|
-
var buttonReset = "focus:outline-none appearance-none cursor-pointer bg-transparent border-0 m-0 p-0 inline-block";
|
|
1023
1038
|
var expandable = {
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
expandableInfo: "s-bg-info-subtle! hover:s-bg-info-subtle-hover!",
|
|
1028
|
-
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",
|
|
1029
1042
|
chevron: "inline-block align-middle s-icon",
|
|
1030
1043
|
chevronNonBox: "ml-8",
|
|
1031
|
-
chevronBox: "",
|
|
1032
1044
|
chevronTransform: "transform transition-transform transform-gpu ease-in-out",
|
|
1033
1045
|
chevronExpand: "-rotate-180",
|
|
1034
1046
|
chevronCollapse: "rotate-180",
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
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",
|
|
1039
1052
|
expansion: "overflow-hidden",
|
|
1040
1053
|
expansionNotExpanded: "h-0 invisible",
|
|
1041
|
-
button:
|
|
1042
|
-
buttonBox: "w-full text-left relative inline-flex items-center justify-between
|
|
1043
|
-
|
|
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",
|
|
1044
1057
|
title: "flex w-full justify-between items-center",
|
|
1045
|
-
titleType: "
|
|
1058
|
+
titleType: "t4"
|
|
1046
1059
|
};
|
|
1047
1060
|
var buttonDefaultStyling = "font-bold focusable justify-center transition-colors ease-in-out";
|
|
1048
1061
|
var buttonColors = {
|
|
@@ -1161,7 +1174,7 @@ var button = {
|
|
|
1161
1174
|
};
|
|
1162
1175
|
var modal = {
|
|
1163
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]",
|
|
1164
|
-
|
|
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",
|
|
1165
1178
|
content: "block overflow-y-auto overflow-x-hidden last-child:mb-0 grow shrink px-16 sm:px-32 relative",
|
|
1166
1179
|
footer: "flex justify-end shrink-0 px-16 sm:px-32",
|
|
1167
1180
|
transitionTitle: "transition-all duration-300",
|
|
@@ -1175,19 +1188,15 @@ var modal = {
|
|
|
1175
1188
|
titleButtonIcon: "h-16 w-16 sm:h-24 sm:w-24",
|
|
1176
1189
|
titleButtonIconRotated: "transform rotate-90"
|
|
1177
1190
|
};
|
|
1178
|
-
var
|
|
1179
|
-
label: "antialiased block relative text-s font-bold pb-4 cursor-pointer s-text",
|
|
1180
|
-
optional: "pl-8 font-normal text-s s-text-subtle"
|
|
1181
|
-
};
|
|
1182
|
-
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 ";
|
|
1183
1192
|
var suffix = {
|
|
1184
|
-
wrapper:
|
|
1193
|
+
wrapper: prefixSuffixWrapper + "right-0",
|
|
1185
1194
|
wrapperWithLabel: "w-max pr-12",
|
|
1186
1195
|
wrapperWithIcon: "w-40",
|
|
1187
1196
|
label: "antialiased block relative cursor-default pb-0 font-bold text-xs s-text"
|
|
1188
1197
|
};
|
|
1189
1198
|
var prefix = {
|
|
1190
|
-
wrapper:
|
|
1199
|
+
wrapper: prefixSuffixWrapper + "left-0",
|
|
1191
1200
|
wrapperWithLabel: "w-max pl-12",
|
|
1192
1201
|
wrapperWithIcon: "w-40",
|
|
1193
1202
|
label: "antialiased block relative cursor-default pb-0 font-bold text-xs s-text"
|
|
@@ -1244,15 +1253,9 @@ var deadToggle = {
|
|
|
1244
1253
|
wrapper: `${toggle.wrapper} h-20 w-20 pointer-events-none`,
|
|
1245
1254
|
input: `${toggle.input} hidden`,
|
|
1246
1255
|
inputVue: "hidden",
|
|
1256
|
+
labelVue: "-mt-2",
|
|
1247
1257
|
labelRadio: `${toggle.label} ${toggle.labelBefore} ${toggle.radio}`,
|
|
1248
|
-
labelCheckbox: `${toggle.label} ${toggle.labelBefore} ${toggle.checkbox}
|
|
1249
|
-
labelVue: "-mt-2"
|
|
1250
|
-
};
|
|
1251
|
-
var clickable = {
|
|
1252
|
-
toggle: "absolute inset-0 h-full w-full appearance-none cursor-pointer focusable focusable-inset",
|
|
1253
|
-
label: `px-12 ${label.label} py-8! cursor-pointer focusable focusable-inset`,
|
|
1254
|
-
buttonOrLink: "bg-transparent focusable",
|
|
1255
|
-
buttonOrLinkStretch: "inset-0 absolute"
|
|
1258
|
+
labelCheckbox: `${toggle.label} ${toggle.labelBefore} ${toggle.checkbox}`
|
|
1256
1259
|
};
|
|
1257
1260
|
var attention = {
|
|
1258
1261
|
base: "border-2 relative flex items-start",
|
|
@@ -1302,13 +1305,6 @@ function kebabCaseAttributes(constructor) {
|
|
|
1302
1305
|
}
|
|
1303
1306
|
};
|
|
1304
1307
|
}
|
|
1305
|
-
function classes(defn) {
|
|
1306
|
-
const classes2 = [];
|
|
1307
|
-
for (const [key, value] of Object.entries(defn)) {
|
|
1308
|
-
if (value) classes2.push(key);
|
|
1309
|
-
}
|
|
1310
|
-
return classes2.join(" ");
|
|
1311
|
-
}
|
|
1312
1308
|
|
|
1313
1309
|
// node_modules/.pnpm/@warp-ds+icons@2.0.2/node_modules/@warp-ds/icons/dist/elements/chevron-down-16.js
|
|
1314
1310
|
import { LitElement } from "lit";
|
|
@@ -1861,12 +1857,13 @@ if (!customElements.get("w-icon-chevron-up-16")) {
|
|
|
1861
1857
|
}
|
|
1862
1858
|
|
|
1863
1859
|
// packages/expandable/index.js
|
|
1860
|
+
var _WarpExpandable_instances, wrapperClasses_get, buttonClasses_get, chevronClasses_get, chevronIcon_get, contentClasses_get, expansionClasses_get;
|
|
1864
1861
|
var WarpExpandable = class extends kebabCaseAttributes(WarpElement) {
|
|
1865
1862
|
constructor() {
|
|
1866
1863
|
super();
|
|
1864
|
+
__privateAdd(this, _WarpExpandable_instances);
|
|
1867
1865
|
this.expanded = false;
|
|
1868
1866
|
this.animated = false;
|
|
1869
|
-
this.info = false;
|
|
1870
1867
|
this.box = false;
|
|
1871
1868
|
this.bleed = false;
|
|
1872
1869
|
this.noChevron = false;
|
|
@@ -1884,72 +1881,60 @@ var WarpExpandable = class extends kebabCaseAttributes(WarpElement) {
|
|
|
1884
1881
|
this._hasTitle = !!this.title || this.renderRoot.querySelector("slot[name='title']").assignedNodes().length > 0;
|
|
1885
1882
|
}
|
|
1886
1883
|
get _expandableSlot() {
|
|
1887
|
-
return html3`<div
|
|
1888
|
-
class="${classes({
|
|
1889
|
-
[this.contentClass || ""]: true,
|
|
1890
|
-
[box.box]: this.box,
|
|
1891
|
-
[expandable.paddingTop]: this._hasTitle && this.box
|
|
1892
|
-
})}">
|
|
1884
|
+
return html3`<div class="${__privateGet(this, _WarpExpandable_instances, contentClasses_get)}">
|
|
1893
1885
|
<slot></slot>
|
|
1894
1886
|
</div>`;
|
|
1895
1887
|
}
|
|
1896
|
-
get _chevronUpClasses() {
|
|
1897
|
-
return classes({
|
|
1898
|
-
[expandable.elementsTransformChevronUpPart]: true,
|
|
1899
|
-
[expandable.elementsChevronUpCollapsePart]: !this.expanded && this._showChevronUp
|
|
1900
|
-
});
|
|
1901
|
-
}
|
|
1902
|
-
get _chevronDownClasses() {
|
|
1903
|
-
return classes({
|
|
1904
|
-
[expandable.elementsTransformChevronDownPart]: true,
|
|
1905
|
-
[expandable.elementsChevronDownExpandPart]: this.expanded && !this._showChevronUp
|
|
1906
|
-
});
|
|
1907
|
-
}
|
|
1908
1888
|
render() {
|
|
1909
|
-
return html3` <div
|
|
1910
|
-
class="${classes({
|
|
1911
|
-
[expandable.expandable]: true,
|
|
1912
|
-
[expandable.expandableBox]: this.box,
|
|
1913
|
-
[expandable.expandableBleed]: this.bleed
|
|
1914
|
-
})}">
|
|
1889
|
+
return html3` <div class="${__privateGet(this, _WarpExpandable_instances, wrapperClasses_get)}">
|
|
1915
1890
|
${this._hasTitle ? html3`<w-unstyled-heading level=${this.headingLevel}>
|
|
1916
1891
|
<button
|
|
1917
1892
|
type="button"
|
|
1918
1893
|
aria-expanded="${this.expanded}"
|
|
1919
|
-
class="${
|
|
1920
|
-
[this.buttonClass || ""]: true,
|
|
1921
|
-
[expandable.button]: true,
|
|
1922
|
-
[expandable.buttonBox]: this.box
|
|
1923
|
-
})}"
|
|
1894
|
+
class="${__privateGet(this, _WarpExpandable_instances, buttonClasses_get)}"
|
|
1924
1895
|
@click=${() => this.expanded = !this.expanded}>
|
|
1925
1896
|
<div class="${expandable.title}">
|
|
1926
1897
|
${this.title ? html3`<span class="${expandable.titleType}">${this.title}</span>` : html3`<slot name="title"></slot>`}
|
|
1927
|
-
${this.noChevron ? "" : html3`<div
|
|
1928
|
-
class="${classes({
|
|
1929
|
-
[expandable.chevron]: true,
|
|
1930
|
-
[expandable.chevronBox]: this.box,
|
|
1931
|
-
[expandable.chevronNonBox]: !this.box
|
|
1932
|
-
})}">
|
|
1933
|
-
${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>`}
|
|
1934
|
-
</div>`}
|
|
1898
|
+
${this.noChevron ? "" : html3`<div class="${__privateGet(this, _WarpExpandable_instances, chevronClasses_get)}">${__privateGet(this, _WarpExpandable_instances, chevronIcon_get)}</div>`}
|
|
1935
1899
|
</div>
|
|
1936
1900
|
</button>
|
|
1937
1901
|
</w-unstyled-heading>` : ""}
|
|
1938
|
-
${this.animated ? html3`<w-expand-transition ?show=${this.expanded}> ${this._expandableSlot} </w-expand-transition>` : html3`<div
|
|
1939
|
-
class="${classes({
|
|
1940
|
-
[expandable.expansion]: true,
|
|
1941
|
-
[expandable.expansionNotExpanded]: !this.expanded
|
|
1942
|
-
})}"
|
|
1943
|
-
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)}>
|
|
1944
1903
|
${this._expandableSlot}
|
|
1945
1904
|
</div>`}
|
|
1946
1905
|
</div>`;
|
|
1947
1906
|
}
|
|
1948
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
|
+
};
|
|
1949
1935
|
__publicField(WarpExpandable, "properties", {
|
|
1950
1936
|
expanded: { type: Boolean, reflect: true },
|
|
1951
1937
|
title: { type: String },
|
|
1952
|
-
info: { type: Boolean },
|
|
1953
1938
|
box: { type: Boolean },
|
|
1954
1939
|
bleed: { type: Boolean },
|
|
1955
1940
|
buttonClass: { type: String },
|