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

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 CHANGED
@@ -1043,7 +1043,7 @@ var require_parser = __commonJS({
1043
1043
  // packages/affix/index.js
1044
1044
  import { html as html3 } from "lit";
1045
1045
 
1046
- // node_modules/.pnpm/@warp-ds+css@1.9.6/node_modules/@warp-ds/css/component-classes/index.js
1046
+ // node_modules/.pnpm/@warp-ds+css@1.9.7/node_modules/@warp-ds/css/component-classes/index.js
1047
1047
  var badge = {
1048
1048
  base: "py-4 px-8 border-0 rounded-4 text-xs inline-flex",
1049
1049
  neutral: "bg-[--w-color-badge-neutral-background] s-text",
@@ -1452,7 +1452,7 @@ var attention = {
1452
1452
  import WarpElement from "@warp-ds/elements-core";
1453
1453
  import { ifDefined } from "lit/directives/if-defined.js";
1454
1454
 
1455
- // node_modules/.pnpm/@warp-ds+icons@2.0.0/node_modules/@warp-ds/icons/dist/elements/search-16.js
1455
+ // node_modules/.pnpm/@warp-ds+icons@2.0.1/node_modules/@warp-ds/icons/dist/elements/search-16.js
1456
1456
  import { LitElement } from "lit";
1457
1457
  import { unsafeStatic, html } from "lit/static-html.js";
1458
1458
 
@@ -1818,7 +1818,7 @@ function setupI18n(params = {}) {
1818
1818
  }
1819
1819
  var i18n = setupI18n();
1820
1820
 
1821
- // node_modules/.pnpm/@warp-ds+icons@2.0.0/node_modules/@warp-ds/icons/dist/elements/search-16.js
1821
+ // node_modules/.pnpm/@warp-ds+icons@2.0.1/node_modules/@warp-ds/icons/dist/elements/search-16.js
1822
1822
  var messages = JSON.parse('{"icon.title.search":"Forst\xF8rrelsesglass"}');
1823
1823
  var messages2 = JSON.parse('{"icon.title.search":"Magnifying glass"}');
1824
1824
  var messages3 = JSON.parse('{"icon.title.search":"Suurennuslasi"}');
@@ -1907,7 +1907,7 @@ if (!customElements.get("w-icon-search-16")) {
1907
1907
  customElements.define("w-icon-search-16", IconSearch16);
1908
1908
  }
1909
1909
 
1910
- // node_modules/.pnpm/@warp-ds+icons@2.0.0/node_modules/@warp-ds/icons/dist/elements/close-16.js
1910
+ // node_modules/.pnpm/@warp-ds+icons@2.0.1/node_modules/@warp-ds/icons/dist/elements/close-16.js
1911
1911
  import { LitElement as LitElement2 } from "lit";
1912
1912
  import { unsafeStatic as unsafeStatic2, html as html2 } from "lit/static-html.js";
1913
1913
  var messages4 = JSON.parse('{"icon.title.close":"Kryss"}');
@@ -2109,7 +2109,7 @@ var r = function() {
2109
2109
  // packages/alert/index.js
2110
2110
  import WarpElement2 from "@warp-ds/elements-core";
2111
2111
 
2112
- // node_modules/.pnpm/@warp-ds+icons@2.0.0/node_modules/@warp-ds/icons/dist/elements/info-16.js
2112
+ // node_modules/.pnpm/@warp-ds+icons@2.0.1/node_modules/@warp-ds/icons/dist/elements/info-16.js
2113
2113
  import { LitElement as LitElement3 } from "lit";
2114
2114
  import { unsafeStatic as unsafeStatic3, html as html4 } from "lit/static-html.js";
2115
2115
  var messages5 = JSON.parse('{"icon.title.info":"Informasjonssirkel"}');
@@ -2200,7 +2200,7 @@ if (!customElements.get("w-icon-info-16")) {
2200
2200
  customElements.define("w-icon-info-16", IconInfo16);
2201
2201
  }
2202
2202
 
2203
- // node_modules/.pnpm/@warp-ds+icons@2.0.0/node_modules/@warp-ds/icons/dist/elements/warning-16.js
2203
+ // node_modules/.pnpm/@warp-ds+icons@2.0.1/node_modules/@warp-ds/icons/dist/elements/warning-16.js
2204
2204
  import { LitElement as LitElement4 } from "lit";
2205
2205
  import { unsafeStatic as unsafeStatic4, html as html5 } from "lit/static-html.js";
2206
2206
  var messages6 = JSON.parse('{"icon.title.warning":"Varseltrekant med utropstegn"}');
@@ -2291,7 +2291,7 @@ if (!customElements.get("w-icon-warning-16")) {
2291
2291
  customElements.define("w-icon-warning-16", IconWarning16);
2292
2292
  }
2293
2293
 
2294
- // node_modules/.pnpm/@warp-ds+icons@2.0.0/node_modules/@warp-ds/icons/dist/elements/error-16.js
2294
+ // node_modules/.pnpm/@warp-ds+icons@2.0.1/node_modules/@warp-ds/icons/dist/elements/error-16.js
2295
2295
  import { LitElement as LitElement5 } from "lit";
2296
2296
  import { unsafeStatic as unsafeStatic5, html as html6 } from "lit/static-html.js";
2297
2297
  var messages7 = JSON.parse('{"icon.title.error":"\xC5ttekant med utropstegn"}');
@@ -2382,7 +2382,7 @@ if (!customElements.get("w-icon-error-16")) {
2382
2382
  customElements.define("w-icon-error-16", IconError16);
2383
2383
  }
2384
2384
 
2385
- // node_modules/.pnpm/@warp-ds+icons@2.0.0/node_modules/@warp-ds/icons/dist/elements/success-16.js
2385
+ // node_modules/.pnpm/@warp-ds+icons@2.0.1/node_modules/@warp-ds/icons/dist/elements/success-16.js
2386
2386
  import { LitElement as LitElement6 } from "lit";
2387
2387
  import { unsafeStatic as unsafeStatic6, html as html7 } from "lit/static-html.js";
2388
2388
  var messages8 = JSON.parse('{"icon.title.success":"Sirkel med sjekkmerke"}');
@@ -3691,7 +3691,7 @@ var computePosition2 = (reference, floating, options) => {
3691
3691
  }));
3692
3692
  };
3693
3693
 
3694
- // 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
3694
+ // 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
3695
3695
  var TOP_START = "top-start";
3696
3696
  var TOP = "top";
3697
3697
  var TOP_END = "top-end";
@@ -3746,8 +3746,6 @@ var rotation = {
3746
3746
  [BOTTOM]: -135,
3747
3747
  [BOTTOM_END]: -135
3748
3748
  };
3749
- var middlePosition = "calc(50% - 7px)";
3750
- var isDirectionVertical = (name) => [TOP_START, TOP, TOP_END, BOTTOM_START, BOTTOM, BOTTOM_END].includes(name);
3751
3749
  var arrowDirectionClassname = (dir) => {
3752
3750
  let direction;
3753
3751
  if (/-/.test(dir)) {
@@ -3770,17 +3768,6 @@ var applyArrowStyles = (arrowEl, arrowRotation2, dir) => {
3770
3768
  transform: `rotate(${arrowRotation2}deg)`
3771
3769
  });
3772
3770
  };
3773
- function computeCalloutArrow({ actualDirection, directionName = BOTTOM, arrowEl }) {
3774
- if (!arrowEl)
3775
- return;
3776
- actualDirection = directionName;
3777
- const directionIsVertical = isDirectionVertical(directionName);
3778
- Object.assign((arrowEl == null ? void 0 : arrowEl.style) || {}, {
3779
- left: directionIsVertical ? middlePosition : "",
3780
- top: !directionIsVertical ? middlePosition : ""
3781
- });
3782
- applyArrowStyles(arrowEl, arrowRotation(actualDirection), actualDirection);
3783
- }
3784
3771
  async function useRecompute(state) {
3785
3772
  var _a, _b, _c;
3786
3773
  if (!(state == null ? void 0 : state.isShowing))
@@ -3788,33 +3775,34 @@ async function useRecompute(state) {
3788
3775
  if (state == null ? void 0 : state.waitForDOM) {
3789
3776
  await (state == null ? void 0 : state.waitForDOM());
3790
3777
  }
3791
- if (state == null ? void 0 : state.isCallout)
3792
- return computeCalloutArrow(state);
3793
3778
  if (!(state == null ? void 0 : state.targetEl) || !(state == null ? void 0 : state.attentionEl))
3794
3779
  return;
3795
- const targetEl = state == null ? void 0 : state.targetEl;
3796
- const attentionEl = state == null ? void 0 : state.attentionEl;
3780
+ let targetEl = state == null ? void 0 : state.targetEl;
3781
+ const attentionEl = state.attentionEl;
3797
3782
  computePosition2(targetEl, attentionEl, {
3798
3783
  placement: (_a = state == null ? void 0 : state.directionName) != null ? _a : BOTTOM,
3799
3784
  middleware: [
3800
3785
  offset({ mainAxis: (_b = state == null ? void 0 : state.distance) != null ? _b : 8, crossAxis: (_c = state == null ? void 0 : state.skidding) != null ? _c : 0 }),
3801
3786
  (state == null ? void 0 : state.flip) && flip2({
3787
+ // 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
3802
3788
  crossAxis: state == null ? void 0 : state.crossAxis,
3803
3789
  fallbackPlacements: state == null ? void 0 : state.fallbackPlacements
3804
3790
  }),
3805
3791
  !(state == null ? void 0 : state.noArrow) && (state == null ? void 0 : state.arrowEl) && arrow2({ element: state == null ? void 0 : state.arrowEl }),
3806
3792
  hide2()
3807
- //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'.
3793
+ // 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'.
3808
3794
  ]
3809
3795
  }).then(({ x, y, middlewareData, placement }) => {
3810
3796
  state.actualDirection = placement;
3811
- Object.assign(attentionEl == null ? void 0 : attentionEl.style, {
3812
- left: `${x}px`,
3813
- top: `${y}px`
3814
- });
3797
+ if (!(state == null ? void 0 : state.isCallout)) {
3798
+ Object.assign(attentionEl.style, {
3799
+ left: `${x}px`,
3800
+ top: `${y}px`
3801
+ });
3802
+ }
3815
3803
  if ((middlewareData == null ? void 0 : middlewareData.hide) && !(state == null ? void 0 : state.isCallout)) {
3816
- const { referenceHidden } = middlewareData == null ? void 0 : middlewareData.hide;
3817
- Object.assign(attentionEl == null ? void 0 : attentionEl.style, {
3804
+ const { referenceHidden } = middlewareData.hide;
3805
+ Object.assign(attentionEl.style, {
3818
3806
  visibility: referenceHidden ? "hidden" : ""
3819
3807
  });
3820
3808
  }
@@ -3822,26 +3810,26 @@ async function useRecompute(state) {
3822
3810
  const arrowPlacement = arrowDirection(placement).split("-")[1];
3823
3811
  if ((middlewareData == null ? void 0 : middlewareData.arrow) && (state == null ? void 0 : state.arrowEl)) {
3824
3812
  const arrowEl = state == null ? void 0 : state.arrowEl;
3825
- const { x: x2, y: y2 } = middlewareData == null ? void 0 : middlewareData.arrow;
3813
+ const { x: arrowX, y: arrowY } = middlewareData.arrow;
3826
3814
  let top = "";
3827
3815
  let right = "";
3828
3816
  let bottom = "";
3829
3817
  let left = "";
3830
3818
  if (arrowPlacement === "start") {
3831
- const value = typeof x2 === "number" ? `calc(33px - ${(arrowEl == null ? void 0 : arrowEl.offsetWidth) / 2}px)` : "";
3832
- top = typeof y2 === "number" ? `calc(33px - ${(arrowEl == null ? void 0 : arrowEl.offsetWidth) / 2}px)` : "";
3819
+ const value = typeof arrowX === "number" ? `calc(24px - ${arrowEl.offsetWidth / 2}px)` : "";
3820
+ top = typeof arrowY === "number" ? `calc(24px - ${arrowEl.offsetWidth / 2}px)` : "";
3833
3821
  right = isRtl ? value : "";
3834
3822
  left = isRtl ? "" : value;
3835
3823
  } else if (arrowPlacement === "end") {
3836
- const value = typeof x2 === "number" ? `calc(33px - ${(arrowEl == null ? void 0 : arrowEl.offsetWidth) / 2}px)` : "";
3824
+ const value = typeof arrowX === "number" ? `calc(24px - ${arrowEl.offsetWidth / 2}px)` : "";
3837
3825
  right = isRtl ? "" : value;
3838
3826
  left = isRtl ? value : "";
3839
- bottom = typeof y2 === "number" ? `calc(33px - ${(arrowEl == null ? void 0 : arrowEl.offsetWidth) / 2}px)` : "";
3827
+ bottom = typeof arrowY === "number" ? `calc(24px - ${arrowEl.offsetWidth / 2}px)` : "";
3840
3828
  } else {
3841
- left = typeof x2 === "number" ? `${x2}px` : "";
3842
- top = typeof y2 === "number" ? `${y2}px` : "";
3829
+ left = typeof arrowX === "number" ? `${arrowX}px` : "";
3830
+ top = typeof arrowY === "number" ? `${arrowY}px` : "";
3843
3831
  }
3844
- Object.assign((arrowEl == null ? void 0 : arrowEl.style) || {}, {
3832
+ Object.assign(arrowEl.style, {
3845
3833
  top,
3846
3834
  right,
3847
3835
  bottom,
@@ -4326,7 +4314,7 @@ if (!customElements.get("w-box")) {
4326
4314
  // packages/breadcrumbs/index.js
4327
4315
  import { html as html12 } from "lit";
4328
4316
 
4329
- // node_modules/.pnpm/@warp-ds+core@1.1.1_@floating-ui+dom@1.6.3/node_modules/@warp-ds/core/dist/breadcrumbs/index.js
4317
+ // node_modules/.pnpm/@warp-ds+core@1.1.2_@floating-ui+dom@1.6.3/node_modules/@warp-ds/core/dist/breadcrumbs/index.js
4330
4318
  function interleave(array, separator2) {
4331
4319
  return array.flatMap((el) => [el, separator2]).slice(0, -1);
4332
4320
  }
@@ -4676,7 +4664,7 @@ import { css as css5, html as html18 } from "lit";
4676
4664
  import WarpElement10 from "@warp-ds/elements-core";
4677
4665
  import { ifDefined as ifDefined4 } from "lit/directives/if-defined.js";
4678
4666
 
4679
- // node_modules/.pnpm/@warp-ds+icons@2.0.0/node_modules/@warp-ds/icons/dist/elements/chevron-down-16.js
4667
+ // node_modules/.pnpm/@warp-ds+icons@2.0.1/node_modules/@warp-ds/icons/dist/elements/chevron-down-16.js
4680
4668
  import { LitElement as LitElement7 } from "lit";
4681
4669
  import { unsafeStatic as unsafeStatic7, html as html16 } from "lit/static-html.js";
4682
4670
  var messages18 = JSON.parse('{"icon.title.chevron-down":"Nedoverpil"}');
@@ -4767,7 +4755,7 @@ if (!customElements.get("w-icon-chevron-down-16")) {
4767
4755
  customElements.define("w-icon-chevron-down-16", IconChevronDown16);
4768
4756
  }
4769
4757
 
4770
- // node_modules/.pnpm/@warp-ds+icons@2.0.0/node_modules/@warp-ds/icons/dist/elements/chevron-up-16.js
4758
+ // node_modules/.pnpm/@warp-ds+icons@2.0.1/node_modules/@warp-ds/icons/dist/elements/chevron-up-16.js
4771
4759
  import { LitElement as LitElement8 } from "lit";
4772
4760
  import { unsafeStatic as unsafeStatic8, html as html17 } from "lit/static-html.js";
4773
4761
  var messages19 = JSON.parse('{"icon.title.chevron-up":"Oppoverpil"}');