@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
|
@@ -1012,6 +1012,16 @@ var require_parser = __commonJS({
|
|
|
1012
1012
|
// packages/attention/index.js
|
|
1013
1013
|
import { css, html as html2, nothing } from "lit";
|
|
1014
1014
|
|
|
1015
|
+
// node_modules/.pnpm/@chbphone55+classnames@2.0.0/node_modules/@chbphone55/classnames/dist/index.m.js
|
|
1016
|
+
var r = function() {
|
|
1017
|
+
for (var t = [], n = arguments.length; n--; ) t[n] = arguments[n];
|
|
1018
|
+
return t.reduce(function(t2, n2) {
|
|
1019
|
+
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) {
|
|
1020
|
+
return n2[r2] ? r2 : "";
|
|
1021
|
+
}) : "");
|
|
1022
|
+
}, []).join(" ");
|
|
1023
|
+
};
|
|
1024
|
+
|
|
1015
1025
|
// node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
|
|
1016
1026
|
var import_unraw = __toESM(require_dist(), 1);
|
|
1017
1027
|
|
|
@@ -1378,7 +1388,7 @@ function setupI18n(params = {}) {
|
|
|
1378
1388
|
}
|
|
1379
1389
|
var i18n = setupI18n();
|
|
1380
1390
|
|
|
1381
|
-
// node_modules/.pnpm/@floating-ui+utils@0.2.
|
|
1391
|
+
// node_modules/.pnpm/@floating-ui+utils@0.2.7/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
1382
1392
|
var sides = ["top", "right", "bottom", "left"];
|
|
1383
1393
|
var min = Math.min;
|
|
1384
1394
|
var max = Math.max;
|
|
@@ -1507,7 +1517,7 @@ function rectToClientRect(rect) {
|
|
|
1507
1517
|
};
|
|
1508
1518
|
}
|
|
1509
1519
|
|
|
1510
|
-
// node_modules/.pnpm/@floating-ui+core@1.6.
|
|
1520
|
+
// node_modules/.pnpm/@floating-ui+core@1.6.7/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
|
|
1511
1521
|
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
1512
1522
|
let {
|
|
1513
1523
|
reference,
|
|
@@ -1995,7 +2005,7 @@ var offset = function(options) {
|
|
|
1995
2005
|
};
|
|
1996
2006
|
};
|
|
1997
2007
|
|
|
1998
|
-
// node_modules/.pnpm/@floating-ui+utils@0.2.
|
|
2008
|
+
// node_modules/.pnpm/@floating-ui+utils@0.2.7/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
|
|
1999
2009
|
function getNodeName(node) {
|
|
2000
2010
|
if (isNode(node)) {
|
|
2001
2011
|
return (node.nodeName || "").toLowerCase();
|
|
@@ -2046,19 +2056,18 @@ function isTopLayer(element) {
|
|
|
2046
2056
|
}
|
|
2047
2057
|
});
|
|
2048
2058
|
}
|
|
2049
|
-
function isContainingBlock(
|
|
2059
|
+
function isContainingBlock(elementOrCss) {
|
|
2050
2060
|
const webkit = isWebKit();
|
|
2051
|
-
const css2 = getComputedStyle(
|
|
2061
|
+
const css2 = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
|
|
2052
2062
|
return css2.transform !== "none" || css2.perspective !== "none" || (css2.containerType ? css2.containerType !== "normal" : false) || !webkit && (css2.backdropFilter ? css2.backdropFilter !== "none" : false) || !webkit && (css2.filter ? css2.filter !== "none" : false) || ["transform", "perspective", "filter"].some((value) => (css2.willChange || "").includes(value)) || ["paint", "layout", "strict", "content"].some((value) => (css2.contain || "").includes(value));
|
|
2053
2063
|
}
|
|
2054
2064
|
function getContainingBlock(element) {
|
|
2055
2065
|
let currentNode = getParentNode(element);
|
|
2056
2066
|
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
2057
|
-
if (isTopLayer(currentNode)) {
|
|
2058
|
-
return null;
|
|
2059
|
-
}
|
|
2060
2067
|
if (isContainingBlock(currentNode)) {
|
|
2061
2068
|
return currentNode;
|
|
2069
|
+
} else if (isTopLayer(currentNode)) {
|
|
2070
|
+
return null;
|
|
2062
2071
|
}
|
|
2063
2072
|
currentNode = getParentNode(currentNode);
|
|
2064
2073
|
}
|
|
@@ -2121,12 +2130,16 @@ function getOverflowAncestors(node, list, traverseIframes) {
|
|
|
2121
2130
|
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
2122
2131
|
const win = getWindow(scrollableAncestor);
|
|
2123
2132
|
if (isBody) {
|
|
2124
|
-
|
|
2133
|
+
const frameElement = getFrameElement(win);
|
|
2134
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
2125
2135
|
}
|
|
2126
2136
|
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
2127
2137
|
}
|
|
2138
|
+
function getFrameElement(win) {
|
|
2139
|
+
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
2140
|
+
}
|
|
2128
2141
|
|
|
2129
|
-
// node_modules/.pnpm/@floating-ui+dom@1.6.
|
|
2142
|
+
// node_modules/.pnpm/@floating-ui+dom@1.6.10/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
|
|
2130
2143
|
function getCssDimensions(element) {
|
|
2131
2144
|
const css2 = getComputedStyle(element);
|
|
2132
2145
|
let width = parseFloat(css2.width) || 0;
|
|
@@ -2220,7 +2233,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
2220
2233
|
const win = getWindow(domElement);
|
|
2221
2234
|
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
2222
2235
|
let currentWin = win;
|
|
2223
|
-
let currentIFrame = currentWin
|
|
2236
|
+
let currentIFrame = getFrameElement(currentWin);
|
|
2224
2237
|
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
2225
2238
|
const iframeScale = getScale(currentIFrame);
|
|
2226
2239
|
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
@@ -2234,7 +2247,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
2234
2247
|
x += left;
|
|
2235
2248
|
y += top;
|
|
2236
2249
|
currentWin = getWindow(currentIFrame);
|
|
2237
|
-
currentIFrame = currentWin
|
|
2250
|
+
currentIFrame = getFrameElement(currentWin);
|
|
2238
2251
|
}
|
|
2239
2252
|
}
|
|
2240
2253
|
return rectToClientRect({
|
|
@@ -2544,7 +2557,7 @@ var computePosition2 = (reference, floating, options) => {
|
|
|
2544
2557
|
}));
|
|
2545
2558
|
};
|
|
2546
2559
|
|
|
2547
|
-
// node_modules/.pnpm/@warp-ds+core@1.1.5_@floating-ui+dom@1.6.
|
|
2560
|
+
// 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
|
|
2548
2561
|
var TOP_START = "top-start";
|
|
2549
2562
|
var TOP = "top";
|
|
2550
2563
|
var TOP_END = "top-end";
|
|
@@ -2696,41 +2709,7 @@ async function useRecompute(state) {
|
|
|
2696
2709
|
return state;
|
|
2697
2710
|
}
|
|
2698
2711
|
|
|
2699
|
-
// node_modules/.pnpm/@warp-ds+css@2.0.
|
|
2700
|
-
var box = {
|
|
2701
|
-
box: "group block relative break-words last-child:mb-0 p-16 rounded-8",
|
|
2702
|
-
// Relative here enables w-clickable
|
|
2703
|
-
bleed: "-mx-16 sm:mx-0 rounded-l-0 rounded-r-0 sm:rounded-8",
|
|
2704
|
-
// We target L and R to override the default rounded-8
|
|
2705
|
-
info: "s-bg-info-subtle",
|
|
2706
|
-
neutral: "s-surface-sunken",
|
|
2707
|
-
bordered: "border-2 s-border s-bg"
|
|
2708
|
-
};
|
|
2709
|
-
var buttonReset = "focus:outline-none appearance-none cursor-pointer bg-transparent border-0 m-0 p-0 inline-block";
|
|
2710
|
-
var expandable = {
|
|
2711
|
-
expandable: "will-change-height",
|
|
2712
|
-
expandableTitle: "font-bold s-text",
|
|
2713
|
-
expandableBox: "s-surface-sunken hover:s-bg-hover active:s-bg-active py-0 px-0 " + box.box,
|
|
2714
|
-
expandableInfo: "s-bg-info-subtle! hover:s-bg-info-subtle-hover!",
|
|
2715
|
-
expandableBleed: box.bleed,
|
|
2716
|
-
chevron: "inline-block align-middle s-icon",
|
|
2717
|
-
chevronNonBox: "ml-8",
|
|
2718
|
-
chevronBox: "",
|
|
2719
|
-
chevronTransform: "transform transition-transform transform-gpu ease-in-out",
|
|
2720
|
-
chevronExpand: "-rotate-180",
|
|
2721
|
-
chevronCollapse: "rotate-180",
|
|
2722
|
-
elementsTransformChevronDownPart: "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",
|
|
2723
|
-
elementsChevronDownExpandPart: "part-[w-icon-chevron-down-16-part]:-rotate-180",
|
|
2724
|
-
elementsTransformChevronUpPart: "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",
|
|
2725
|
-
elementsChevronUpCollapsePart: "part-[w-icon-chevron-up-16-part]:rotate-180",
|
|
2726
|
-
expansion: "overflow-hidden",
|
|
2727
|
-
expansionNotExpanded: "h-0 invisible",
|
|
2728
|
-
button: buttonReset + " hover:underline focus-visible:underline",
|
|
2729
|
-
buttonBox: "w-full text-left relative inline-flex items-center justify-between " + box.box,
|
|
2730
|
-
paddingTop: "pt-0",
|
|
2731
|
-
title: "flex w-full justify-between items-center",
|
|
2732
|
-
titleType: "h4"
|
|
2733
|
-
};
|
|
2712
|
+
// 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
|
|
2734
2713
|
var buttonDefaultStyling = "font-bold focusable justify-center transition-colors ease-in-out";
|
|
2735
2714
|
var buttonColors = {
|
|
2736
2715
|
primary: "s-text-inverted bg-[--w-color-button-primary-background] hover:bg-[--w-color-button-primary-background-hover] active:bg-[--w-color-button-primary-background-active]",
|
|
@@ -2848,7 +2827,7 @@ var button = {
|
|
|
2848
2827
|
};
|
|
2849
2828
|
var modal = {
|
|
2850
2829
|
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]",
|
|
2851
|
-
|
|
2830
|
+
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",
|
|
2852
2831
|
content: "block overflow-y-auto overflow-x-hidden last-child:mb-0 grow shrink px-16 sm:px-32 relative",
|
|
2853
2832
|
footer: "flex justify-end shrink-0 px-16 sm:px-32",
|
|
2854
2833
|
transitionTitle: "transition-all duration-300",
|
|
@@ -2862,19 +2841,15 @@ var modal = {
|
|
|
2862
2841
|
titleButtonIcon: "h-16 w-16 sm:h-24 sm:w-24",
|
|
2863
2842
|
titleButtonIconRotated: "transform rotate-90"
|
|
2864
2843
|
};
|
|
2865
|
-
var
|
|
2866
|
-
label: "antialiased block relative text-s font-bold pb-4 cursor-pointer s-text",
|
|
2867
|
-
optional: "pl-8 font-normal text-s s-text-subtle"
|
|
2868
|
-
};
|
|
2869
|
-
var prefixSuffixWrapperBase = "absolute top-0 bottom-0 flex justify-center items-center focusable rounded-4 focus:[--w-outline-offset:-2px] bg-transparent ";
|
|
2844
|
+
var prefixSuffixWrapper = "absolute top-0 bottom-0 flex justify-center items-center focusable rounded-4 focus:[--w-outline-offset:-2px] bg-transparent ";
|
|
2870
2845
|
var suffix = {
|
|
2871
|
-
wrapper:
|
|
2846
|
+
wrapper: prefixSuffixWrapper + "right-0",
|
|
2872
2847
|
wrapperWithLabel: "w-max pr-12",
|
|
2873
2848
|
wrapperWithIcon: "w-40",
|
|
2874
2849
|
label: "antialiased block relative cursor-default pb-0 font-bold text-xs s-text"
|
|
2875
2850
|
};
|
|
2876
2851
|
var prefix = {
|
|
2877
|
-
wrapper:
|
|
2852
|
+
wrapper: prefixSuffixWrapper + "left-0",
|
|
2878
2853
|
wrapperWithLabel: "w-max pl-12",
|
|
2879
2854
|
wrapperWithIcon: "w-40",
|
|
2880
2855
|
label: "antialiased block relative cursor-default pb-0 font-bold text-xs s-text"
|
|
@@ -2931,15 +2906,9 @@ var deadToggle = {
|
|
|
2931
2906
|
wrapper: `${toggle.wrapper} h-20 w-20 pointer-events-none`,
|
|
2932
2907
|
input: `${toggle.input} hidden`,
|
|
2933
2908
|
inputVue: "hidden",
|
|
2909
|
+
labelVue: "-mt-2",
|
|
2934
2910
|
labelRadio: `${toggle.label} ${toggle.labelBefore} ${toggle.radio}`,
|
|
2935
|
-
labelCheckbox: `${toggle.label} ${toggle.labelBefore} ${toggle.checkbox}
|
|
2936
|
-
labelVue: "-mt-2"
|
|
2937
|
-
};
|
|
2938
|
-
var clickable = {
|
|
2939
|
-
toggle: "absolute inset-0 h-full w-full appearance-none cursor-pointer focusable focusable-inset",
|
|
2940
|
-
label: `px-12 ${label.label} py-8! cursor-pointer focusable focusable-inset`,
|
|
2941
|
-
buttonOrLink: "bg-transparent focusable",
|
|
2942
|
-
buttonOrLinkStretch: "inset-0 absolute"
|
|
2911
|
+
labelCheckbox: `${toggle.label} ${toggle.labelBefore} ${toggle.checkbox}`
|
|
2943
2912
|
};
|
|
2944
2913
|
var attention = {
|
|
2945
2914
|
base: "border-2 relative flex items-start",
|
|
@@ -3023,13 +2992,6 @@ function kebabCaseAttributes(constructor) {
|
|
|
3023
2992
|
}
|
|
3024
2993
|
};
|
|
3025
2994
|
}
|
|
3026
|
-
function classes(defn) {
|
|
3027
|
-
const classes2 = [];
|
|
3028
|
-
for (const [key, value] of Object.entries(defn)) {
|
|
3029
|
-
if (value) classes2.push(key);
|
|
3030
|
-
}
|
|
3031
|
-
return classes2.join(" ");
|
|
3032
|
-
}
|
|
3033
2995
|
function generateRandomId() {
|
|
3034
2996
|
return `m${Math.random().toString(36).slice(2)}`;
|
|
3035
2997
|
}
|
|
@@ -3215,11 +3177,11 @@ ${JSON.stringify(directions)}`
|
|
|
3215
3177
|
return opposites[this._actualDirection];
|
|
3216
3178
|
}
|
|
3217
3179
|
get _arrowClasses() {
|
|
3218
|
-
return
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
[this.
|
|
3222
|
-
|
|
3180
|
+
return r([
|
|
3181
|
+
attention.arrowBase,
|
|
3182
|
+
this._activeVariantClasses.arrow,
|
|
3183
|
+
attention[`arrowDirection${arrowDirectionClassname(this._arrowDirection)}`]
|
|
3184
|
+
]);
|
|
3223
3185
|
}
|
|
3224
3186
|
get _arrowHtml() {
|
|
3225
3187
|
return this.noArrow ? "" : html2`<div id="arrow" role="img" class="${this._arrowClasses}"></div>`;
|
|
@@ -3250,10 +3212,7 @@ ${JSON.stringify(directions)}`
|
|
|
3250
3212
|
return messageSlot ? messageSlot.assignedNodes()[0] : null;
|
|
3251
3213
|
}
|
|
3252
3214
|
get _wrapperClasses() {
|
|
3253
|
-
return
|
|
3254
|
-
[attention.base]: true,
|
|
3255
|
-
[this._activeVariantClasses.wrapper]: true
|
|
3256
|
-
});
|
|
3215
|
+
return r([attention.base, this._activeVariantClasses.wrapper]);
|
|
3257
3216
|
}
|
|
3258
3217
|
get _ariaClose() {
|
|
3259
3218
|
return i18n._({
|