@warp-ds/elements 1.4.1-next.1 → 1.5.0-next.1

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.
Files changed (37) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.js +778 -259
  3. package/dist/index.js.map +4 -4
  4. package/dist/packages/affix/index.js +4 -4
  5. package/dist/packages/affix/index.js.map +3 -3
  6. package/dist/packages/alert/index.js +6 -6
  7. package/dist/packages/alert/index.js.map +3 -3
  8. package/dist/packages/attention/index.js +48 -49
  9. package/dist/packages/attention/index.js.map +4 -4
  10. package/dist/packages/badge/index.js +1 -1
  11. package/dist/packages/badge/index.js.map +3 -3
  12. package/dist/packages/box/index.js +1 -1
  13. package/dist/packages/box/index.js.map +3 -3
  14. package/dist/packages/breadcrumbs/index.js +2 -2
  15. package/dist/packages/breadcrumbs/index.js.map +3 -3
  16. package/dist/packages/button/index.js +1 -1
  17. package/dist/packages/button/index.js.map +3 -3
  18. package/dist/packages/card/index.js +1 -1
  19. package/dist/packages/card/index.js.map +3 -3
  20. package/dist/packages/expandable/index.js +4 -4
  21. package/dist/packages/expandable/index.js.map +3 -3
  22. package/dist/packages/modal/index.d.ts +6 -0
  23. package/dist/packages/modal/index.js +2291 -0
  24. package/dist/packages/modal/index.js.map +7 -0
  25. package/dist/packages/modal/modal-footer.d.ts +14 -0
  26. package/dist/packages/modal/modal-header.d.ts +37 -0
  27. package/dist/packages/modal/modal-main.d.ts +37 -0
  28. package/dist/packages/modal/util.d.ts +17 -0
  29. package/dist/packages/pill/index.js +3 -3
  30. package/dist/packages/pill/index.js.map +3 -3
  31. package/dist/packages/select/index.js +2 -2
  32. package/dist/packages/select/index.js.map +3 -3
  33. package/dist/packages/textfield/index.js +1 -1
  34. package/dist/packages/textfield/index.js.map +3 -3
  35. package/dist/packages/toast/index.js +5 -5
  36. package/dist/packages/toast/index.js.map +3 -3
  37. package/package.json +8 -5
@@ -1392,7 +1392,7 @@ function setupI18n(params = {}) {
1392
1392
  }
1393
1393
  var i18n = setupI18n();
1394
1394
 
1395
- // node_modules/.pnpm/@floating-ui+utils@0.2.1/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
1395
+ // node_modules/.pnpm/@floating-ui+utils@0.2.2/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
1396
1396
  var sides = ["top", "right", "bottom", "left"];
1397
1397
  var min = Math.min;
1398
1398
  var max = Math.max;
@@ -1504,15 +1504,25 @@ function getPaddingObject(padding) {
1504
1504
  };
1505
1505
  }
1506
1506
  function rectToClientRect(rect) {
1507
- return __spreadProps(__spreadValues({}, rect), {
1508
- top: rect.y,
1509
- left: rect.x,
1510
- right: rect.x + rect.width,
1511
- bottom: rect.y + rect.height
1512
- });
1507
+ const {
1508
+ x,
1509
+ y,
1510
+ width,
1511
+ height
1512
+ } = rect;
1513
+ return {
1514
+ width,
1515
+ height,
1516
+ top: y,
1517
+ left: x,
1518
+ right: x + width,
1519
+ bottom: y + height,
1520
+ x,
1521
+ y
1522
+ };
1513
1523
  }
1514
1524
 
1515
- // node_modules/.pnpm/@floating-ui+core@1.6.0/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
1525
+ // node_modules/.pnpm/@floating-ui+core@1.6.2/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
1516
1526
  function computeCoordsFromPlacement(_ref, placement, rtl) {
1517
1527
  let {
1518
1528
  reference,
@@ -1676,10 +1686,12 @@ async function detectOverflow(state, options) {
1676
1686
  rootBoundary,
1677
1687
  strategy
1678
1688
  }));
1679
- const rect = elementContext === "floating" ? __spreadProps(__spreadValues({}, rects.floating), {
1689
+ const rect = elementContext === "floating" ? {
1680
1690
  x,
1681
- y
1682
- }) : rects.reference;
1691
+ y,
1692
+ width: rects.floating.width,
1693
+ height: rects.floating.height
1694
+ } : rects.reference;
1683
1695
  const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
1684
1696
  const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
1685
1697
  x: 1,
@@ -1988,7 +2000,7 @@ var offset = function(options) {
1988
2000
  };
1989
2001
  };
1990
2002
 
1991
- // node_modules/.pnpm/@floating-ui+utils@0.2.1/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
2003
+ // node_modules/.pnpm/@floating-ui+utils@0.2.2/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
1992
2004
  function getNodeName(node) {
1993
2005
  if (isNode(node)) {
1994
2006
  return (node.nodeName || "").toLowerCase();
@@ -2040,9 +2052,8 @@ function getContainingBlock(element) {
2040
2052
  while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
2041
2053
  if (isContainingBlock(currentNode)) {
2042
2054
  return currentNode;
2043
- } else {
2044
- currentNode = getParentNode(currentNode);
2045
2055
  }
2056
+ currentNode = getParentNode(currentNode);
2046
2057
  }
2047
2058
  return null;
2048
2059
  }
@@ -2520,7 +2531,7 @@ var computePosition2 = (reference, floating, options) => {
2520
2531
  }));
2521
2532
  };
2522
2533
 
2523
- // node_modules/.pnpm/@warp-ds+core@1.1.1_@floating-ui+dom@1.6.3/node_modules/@warp-ds/core/dist/attention/utils/helpers.js
2534
+ // node_modules/.pnpm/@warp-ds+core@1.1.2_@floating-ui+dom@1.6.3/node_modules/@warp-ds/core/dist/attention/utils/helpers.js
2524
2535
  var TOP_START = "top-start";
2525
2536
  var TOP = "top";
2526
2537
  var TOP_END = "top-end";
@@ -2575,8 +2586,6 @@ var rotation = {
2575
2586
  [BOTTOM]: -135,
2576
2587
  [BOTTOM_END]: -135
2577
2588
  };
2578
- var middlePosition = "calc(50% - 7px)";
2579
- var isDirectionVertical = (name) => [TOP_START, TOP, TOP_END, BOTTOM_START, BOTTOM, BOTTOM_END].includes(name);
2580
2589
  var arrowDirectionClassname = (dir) => {
2581
2590
  let direction;
2582
2591
  if (/-/.test(dir)) {
@@ -2599,17 +2608,6 @@ var applyArrowStyles = (arrowEl, arrowRotation2, dir) => {
2599
2608
  transform: `rotate(${arrowRotation2}deg)`
2600
2609
  });
2601
2610
  };
2602
- function computeCalloutArrow({ actualDirection, directionName = BOTTOM, arrowEl }) {
2603
- if (!arrowEl)
2604
- return;
2605
- actualDirection = directionName;
2606
- const directionIsVertical = isDirectionVertical(directionName);
2607
- Object.assign((arrowEl == null ? void 0 : arrowEl.style) || {}, {
2608
- left: directionIsVertical ? middlePosition : "",
2609
- top: !directionIsVertical ? middlePosition : ""
2610
- });
2611
- applyArrowStyles(arrowEl, arrowRotation(actualDirection), actualDirection);
2612
- }
2613
2611
  async function useRecompute(state) {
2614
2612
  var _a, _b, _c;
2615
2613
  if (!(state == null ? void 0 : state.isShowing))
@@ -2617,33 +2615,34 @@ async function useRecompute(state) {
2617
2615
  if (state == null ? void 0 : state.waitForDOM) {
2618
2616
  await (state == null ? void 0 : state.waitForDOM());
2619
2617
  }
2620
- if (state == null ? void 0 : state.isCallout)
2621
- return computeCalloutArrow(state);
2622
2618
  if (!(state == null ? void 0 : state.targetEl) || !(state == null ? void 0 : state.attentionEl))
2623
2619
  return;
2624
- const targetEl = state == null ? void 0 : state.targetEl;
2625
- const attentionEl = state == null ? void 0 : state.attentionEl;
2620
+ let targetEl = state == null ? void 0 : state.targetEl;
2621
+ const attentionEl = state.attentionEl;
2626
2622
  computePosition2(targetEl, attentionEl, {
2627
2623
  placement: (_a = state == null ? void 0 : state.directionName) != null ? _a : BOTTOM,
2628
2624
  middleware: [
2629
2625
  offset({ mainAxis: (_b = state == null ? void 0 : state.distance) != null ? _b : 8, crossAxis: (_c = state == null ? void 0 : state.skidding) != null ? _c : 0 }),
2630
2626
  (state == null ? void 0 : state.flip) && flip2({
2627
+ // when flip is set to true it will move the attentionEl's placement to its opposite side or to the preferred placements if fallbackPlacements has a value
2631
2628
  crossAxis: state == null ? void 0 : state.crossAxis,
2632
2629
  fallbackPlacements: state == null ? void 0 : state.fallbackPlacements
2633
2630
  }),
2634
2631
  !(state == null ? void 0 : state.noArrow) && (state == null ? void 0 : state.arrowEl) && arrow2({ element: state == null ? void 0 : state.arrowEl }),
2635
2632
  hide2()
2636
- //will hide the attentionEl when it appears detached from the targetEl. Can be called multiple times in the middleware-array if you want to use several strategies. Default strategy is 'referenceHidden'.
2633
+ // will hide the attentionEl when it appears detached from the targetEl. Can be called multiple times in the middleware-array if you want to use several strategies. Default strategy is 'referenceHidden'.
2637
2634
  ]
2638
2635
  }).then(({ x, y, middlewareData, placement }) => {
2639
2636
  state.actualDirection = placement;
2640
- Object.assign(attentionEl == null ? void 0 : attentionEl.style, {
2641
- left: `${x}px`,
2642
- top: `${y}px`
2643
- });
2637
+ if (!(state == null ? void 0 : state.isCallout)) {
2638
+ Object.assign(attentionEl.style, {
2639
+ left: `${x}px`,
2640
+ top: `${y}px`
2641
+ });
2642
+ }
2644
2643
  if ((middlewareData == null ? void 0 : middlewareData.hide) && !(state == null ? void 0 : state.isCallout)) {
2645
- const { referenceHidden } = middlewareData == null ? void 0 : middlewareData.hide;
2646
- Object.assign(attentionEl == null ? void 0 : attentionEl.style, {
2644
+ const { referenceHidden } = middlewareData.hide;
2645
+ Object.assign(attentionEl.style, {
2647
2646
  visibility: referenceHidden ? "hidden" : ""
2648
2647
  });
2649
2648
  }
@@ -2651,26 +2650,26 @@ async function useRecompute(state) {
2651
2650
  const arrowPlacement = arrowDirection(placement).split("-")[1];
2652
2651
  if ((middlewareData == null ? void 0 : middlewareData.arrow) && (state == null ? void 0 : state.arrowEl)) {
2653
2652
  const arrowEl = state == null ? void 0 : state.arrowEl;
2654
- const { x: x2, y: y2 } = middlewareData == null ? void 0 : middlewareData.arrow;
2653
+ const { x: arrowX, y: arrowY } = middlewareData.arrow;
2655
2654
  let top = "";
2656
2655
  let right = "";
2657
2656
  let bottom = "";
2658
2657
  let left = "";
2659
2658
  if (arrowPlacement === "start") {
2660
- const value = typeof x2 === "number" ? `calc(33px - ${(arrowEl == null ? void 0 : arrowEl.offsetWidth) / 2}px)` : "";
2661
- top = typeof y2 === "number" ? `calc(33px - ${(arrowEl == null ? void 0 : arrowEl.offsetWidth) / 2}px)` : "";
2659
+ const value = typeof arrowX === "number" ? `calc(24px - ${arrowEl.offsetWidth / 2}px)` : "";
2660
+ top = typeof arrowY === "number" ? `calc(24px - ${arrowEl.offsetWidth / 2}px)` : "";
2662
2661
  right = isRtl ? value : "";
2663
2662
  left = isRtl ? "" : value;
2664
2663
  } else if (arrowPlacement === "end") {
2665
- const value = typeof x2 === "number" ? `calc(33px - ${(arrowEl == null ? void 0 : arrowEl.offsetWidth) / 2}px)` : "";
2664
+ const value = typeof arrowX === "number" ? `calc(24px - ${arrowEl.offsetWidth / 2}px)` : "";
2666
2665
  right = isRtl ? "" : value;
2667
2666
  left = isRtl ? value : "";
2668
- bottom = typeof y2 === "number" ? `calc(33px - ${(arrowEl == null ? void 0 : arrowEl.offsetWidth) / 2}px)` : "";
2667
+ bottom = typeof arrowY === "number" ? `calc(24px - ${arrowEl.offsetWidth / 2}px)` : "";
2669
2668
  } else {
2670
- left = typeof x2 === "number" ? `${x2}px` : "";
2671
- top = typeof y2 === "number" ? `${y2}px` : "";
2669
+ left = typeof arrowX === "number" ? `${arrowX}px` : "";
2670
+ top = typeof arrowY === "number" ? `${arrowY}px` : "";
2672
2671
  }
2673
- Object.assign((arrowEl == null ? void 0 : arrowEl.style) || {}, {
2672
+ Object.assign(arrowEl.style, {
2674
2673
  top,
2675
2674
  right,
2676
2675
  bottom,
@@ -2682,7 +2681,7 @@ async function useRecompute(state) {
2682
2681
  return state;
2683
2682
  }
2684
2683
 
2685
- // node_modules/.pnpm/@warp-ds+css@1.9.6/node_modules/@warp-ds/css/component-classes/index.js
2684
+ // node_modules/.pnpm/@warp-ds+css@1.10.1/node_modules/@warp-ds/css/component-classes/index.js
2686
2685
  var box = {
2687
2686
  box: "group block relative break-words last-child:mb-0 p-16 rounded-8",
2688
2687
  // Relative here enables w-clickable
@@ -3041,7 +3040,7 @@ var messages2 = JSON.parse('{"attention.aria.callout":"callout speech bubble","a
3041
3040
  // packages/attention/locales/nb/messages.mjs
3042
3041
  var messages3 = JSON.parse('{"attention.aria.callout":"callout speech bubble","attention.aria.close":"Lukk","attention.aria.highlight":"highlighted speech bubble","attention.aria.pointingDown":"pointing down","attention.aria.pointingLeft":"pointing left","attention.aria.pointingRight":"pointing right","attention.aria.pointingUp":"pointing up","attention.aria.popover":"popover speech bubble","attention.aria.tooltip":"tooltip"}');
3043
3042
 
3044
- // node_modules/.pnpm/@warp-ds+icons@2.0.0/node_modules/@warp-ds/icons/dist/elements/close-16.js
3043
+ // node_modules/.pnpm/@warp-ds+icons@2.0.1/node_modules/@warp-ds/icons/dist/elements/close-16.js
3045
3044
  import { LitElement } from "lit";
3046
3045
  import { unsafeStatic, html } from "lit/static-html.js";
3047
3046
  var messages4 = JSON.parse('{"icon.title.close":"Kryss"}');