@helsenorge/designsystem-react 14.0.0-beta.9 → 14.0.0

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 (92) hide show
  1. package/lib/CHANGELOG.md +331 -12
  2. package/lib/DoctorSmall.js +22 -34
  3. package/lib/DoctorSmall.js.map +1 -1
  4. package/lib/Drawer.js +2 -1
  5. package/lib/Drawer.js.map +1 -1
  6. package/lib/HelpTriggerIcon.js +10 -6
  7. package/lib/HelpTriggerIcon.js.map +1 -1
  8. package/lib/IllustrationNames.js +6 -2
  9. package/lib/IllustrationNames.js.map +1 -1
  10. package/lib/Input.js +5 -3
  11. package/lib/Input.js.map +1 -1
  12. package/lib/LazyIcon.js +2 -0
  13. package/lib/LazyIcon.js.map +1 -1
  14. package/lib/LazyIllustration.js +5 -1
  15. package/lib/LazyIllustration.js.map +1 -1
  16. package/lib/Slider.js +14 -6
  17. package/lib/Slider.js.map +1 -1
  18. package/lib/StorkMedium.js +96 -0
  19. package/lib/StorkMedium.js.map +1 -0
  20. package/lib/TableBody.js +2 -2
  21. package/lib/TableBody.js.map +1 -1
  22. package/lib/TableCell.js +2 -2
  23. package/lib/TableCell.js.map +1 -1
  24. package/lib/TableExpandedRow.js +4 -4
  25. package/lib/TableExpandedRow.js.map +1 -1
  26. package/lib/TableExpanderCell.js +2 -2
  27. package/lib/TableExpanderCell.js.map +1 -1
  28. package/lib/TableHead.js +6 -6
  29. package/lib/TableHead.js.map +1 -1
  30. package/lib/TableHeadCell.js +5 -5
  31. package/lib/TableHeadCell.js.map +1 -1
  32. package/lib/TableRow.js +5 -5
  33. package/lib/TableRow.js.map +1 -1
  34. package/lib/Textarea.js +13 -12
  35. package/lib/Textarea.js.map +1 -1
  36. package/lib/ThinkingMedium.js +98 -0
  37. package/lib/ThinkingMedium.js.map +1 -0
  38. package/lib/components/Button/styles.module.scss +1 -3
  39. package/lib/components/Drawer/styles.module.scss +4 -21
  40. package/lib/components/Drawer/styles.module.scss.d.ts +1 -1
  41. package/lib/components/ExpanderHierarchy/Expander.d.ts +1 -1
  42. package/lib/components/ExpanderHierarchy/index.js.map +1 -1
  43. package/lib/components/ExpanderList/index.js +13 -4
  44. package/lib/components/ExpanderList/index.js.map +1 -1
  45. package/lib/components/HelpTriggerIcon/HelpSign.d.ts +0 -1
  46. package/lib/components/HelpTriggerInline/styles.module.scss +1 -0
  47. package/lib/components/Icons/AdditionalIconInformation.d.ts +8 -0
  48. package/lib/components/Icons/AdditionalIconInformation.js +8 -0
  49. package/lib/components/Icons/AdditionalIconInformation.js.map +1 -1
  50. package/lib/components/Icons/IconNames.d.ts +1 -1
  51. package/lib/components/Icons/IconNames.js +2 -0
  52. package/lib/components/Icons/IconNames.js.map +1 -1
  53. package/lib/components/Icons/StarFill.d.ts +4 -0
  54. package/lib/components/Icons/StarFill.js +16 -0
  55. package/lib/components/Icons/StarFill.js.map +1 -0
  56. package/lib/components/Icons/StarStroke.d.ts +4 -0
  57. package/lib/components/Icons/StarStroke.js +16 -0
  58. package/lib/components/Icons/StarStroke.js.map +1 -0
  59. package/lib/components/Illustrations/IllustrationNames.d.ts +1 -1
  60. package/lib/components/Illustrations/Stork.d.ts +11 -0
  61. package/lib/components/Illustrations/Stork.js +16 -0
  62. package/lib/components/Illustrations/Stork.js.map +1 -0
  63. package/lib/components/Illustrations/StorkMedium.d.ts +4 -0
  64. package/lib/components/Illustrations/StorkMedium.js +2 -0
  65. package/lib/components/Illustrations/Thinking.d.ts +9 -0
  66. package/lib/components/Illustrations/Thinking.js +16 -0
  67. package/lib/components/Illustrations/Thinking.js.map +1 -0
  68. package/lib/components/Illustrations/ThinkingMedium.d.ts +4 -0
  69. package/lib/components/Illustrations/ThinkingMedium.js +2 -0
  70. package/lib/components/Loader/index.js +15 -13
  71. package/lib/components/Loader/index.js.map +1 -1
  72. package/lib/components/ServiceMessage/ServiceMessage.d.ts +3 -0
  73. package/lib/components/ServiceMessage/index.js +2 -2
  74. package/lib/components/ServiceMessage/index.js.map +1 -1
  75. package/lib/components/StickyNote/index.js +8 -5
  76. package/lib/components/StickyNote/index.js.map +1 -1
  77. package/lib/components/Table/index.js +2 -2
  78. package/lib/components/Table/index.js.map +1 -1
  79. package/lib/floating-ui.react.js +126 -129
  80. package/lib/floating-ui.react.js.map +1 -1
  81. package/lib/hooks/useIsServerSide.d.ts +1 -1
  82. package/lib/useBreakpoint.js +15 -24
  83. package/lib/useBreakpoint.js.map +1 -1
  84. package/lib/useExpand.js +5 -3
  85. package/lib/useExpand.js.map +1 -1
  86. package/lib/useIsServerSide.js +5 -6
  87. package/lib/useIsServerSide.js.map +1 -1
  88. package/lib/useToggle.js +5 -3
  89. package/lib/useToggle.js.map +1 -1
  90. package/lib/utils6.js +2 -2
  91. package/lib/utils6.js.map +1 -1
  92. package/package.json +1 -1
@@ -33,54 +33,30 @@ function isShadowRoot(value) {
33
33
  if (!hasWindow() || typeof ShadowRoot === "undefined") return false;
34
34
  return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
35
35
  }
36
- var invalidOverflowDisplayValues = /* @__PURE__ */ new Set(["inline", "contents"]);
37
36
  function isOverflowElement(element) {
38
37
  const { overflow, overflowX, overflowY, display } = getComputedStyle$1(element);
39
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
38
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== "inline" && display !== "contents";
40
39
  }
41
- var tableElements = /* @__PURE__ */ new Set([
42
- "table",
43
- "td",
44
- "th"
45
- ]);
46
40
  function isTableElement(element) {
47
- return tableElements.has(getNodeName(element));
41
+ return /^(table|td|th)$/.test(getNodeName(element));
48
42
  }
49
- var topLayerSelectors = [":popover-open", ":modal"];
50
43
  function isTopLayer(element) {
51
- return topLayerSelectors.some((selector) => {
52
- try {
53
- return element.matches(selector);
54
- } catch (_e) {
55
- return false;
56
- }
57
- });
44
+ try {
45
+ if (element.matches(":popover-open")) return true;
46
+ } catch (_e) {}
47
+ try {
48
+ return element.matches(":modal");
49
+ } catch (_e) {
50
+ return false;
51
+ }
58
52
  }
59
- var transformProperties = [
60
- "transform",
61
- "translate",
62
- "scale",
63
- "rotate",
64
- "perspective"
65
- ];
66
- var willChangeValues = [
67
- "transform",
68
- "translate",
69
- "scale",
70
- "rotate",
71
- "perspective",
72
- "filter"
73
- ];
74
- var containValues = [
75
- "paint",
76
- "layout",
77
- "strict",
78
- "content"
79
- ];
53
+ var willChangeRe = /transform|translate|scale|rotate|perspective|filter/;
54
+ var containRe = /paint|layout|strict|content/;
55
+ var isNotNone = (value) => !!value && value !== "none";
56
+ var isWebKitValue;
80
57
  function isContainingBlock(elementOrCss) {
81
- const webkit = isWebKit();
82
58
  const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
83
- return transformProperties.some((value) => css[value] ? css[value] !== "none" : false) || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || willChangeValues.some((value) => (css.willChange || "").includes(value)) || containValues.some((value) => (css.contain || "").includes(value));
59
+ return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || "") || containRe.test(css.contain || "");
84
60
  }
85
61
  function getContainingBlock(element) {
86
62
  let currentNode = getParentNode(element);
@@ -92,16 +68,11 @@ function getContainingBlock(element) {
92
68
  return null;
93
69
  }
94
70
  function isWebKit() {
95
- if (typeof CSS === "undefined" || !CSS.supports) return false;
96
- return CSS.supports("-webkit-backdrop-filter", "none");
97
- }
98
- var lastTraversableNodeNames = /* @__PURE__ */ new Set([
99
- "html",
100
- "body",
101
- "#document"
102
- ]);
71
+ if (isWebKitValue == null) isWebKitValue = typeof CSS !== "undefined" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none");
72
+ return isWebKitValue;
73
+ }
103
74
  function isLastTraversableNode(node) {
104
- return lastTraversableNodeNames.has(getNodeName(node));
75
+ return /^(html|body|#document)$/.test(getNodeName(node));
105
76
  }
106
77
  function getComputedStyle$1(element) {
107
78
  return getWindow(element).getComputedStyle(element);
@@ -137,8 +108,7 @@ function getOverflowAncestors(node, list, traverseIframes) {
137
108
  if (isBody) {
138
109
  const frameElement = getFrameElement(win);
139
110
  return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
140
- }
141
- return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
111
+ } else return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
142
112
  }
143
113
  function getFrameElement(win) {
144
114
  return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
@@ -163,10 +133,6 @@ var oppositeSideMap = {
163
133
  bottom: "top",
164
134
  top: "bottom"
165
135
  };
166
- var oppositeAlignmentMap = {
167
- start: "end",
168
- end: "start"
169
- };
170
136
  function clamp(start, value, end) {
171
137
  return max(start, min(value, end));
172
138
  }
@@ -185,9 +151,9 @@ function getOppositeAxis(axis) {
185
151
  function getAxisLength(axis) {
186
152
  return axis === "y" ? "height" : "width";
187
153
  }
188
- var yAxisSides = /* @__PURE__ */ new Set(["top", "bottom"]);
189
154
  function getSideAxis(placement) {
190
- return yAxisSides.has(getSide(placement)) ? "y" : "x";
155
+ const firstChar = placement[0];
156
+ return firstChar === "t" || firstChar === "b" ? "y" : "x";
191
157
  }
192
158
  function getAlignmentAxis(placement) {
193
159
  return getOppositeAxis(getSideAxis(placement));
@@ -210,7 +176,7 @@ function getExpandedPlacements(placement) {
210
176
  ];
211
177
  }
212
178
  function getOppositeAlignmentPlacement(placement) {
213
- return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
179
+ return placement.includes("start") ? placement.replace("start", "end") : placement.replace("end", "start");
214
180
  }
215
181
  var lrPlacement = ["left", "right"];
216
182
  var rlPlacement = ["right", "left"];
@@ -237,7 +203,8 @@ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
237
203
  return list;
238
204
  }
239
205
  function getOppositePlacement(placement) {
240
- return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
206
+ const side = getSide(placement);
207
+ return oppositeSideMap[side] + placement.slice(side.length);
241
208
  }
242
209
  function expandPaddingObject(padding) {
243
210
  return {
@@ -785,9 +752,13 @@ async function detectOverflow$1(state, options) {
785
752
  right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
786
753
  };
787
754
  }
755
+ var MAX_RESET_COUNT = 50;
788
756
  var computePosition$1 = async (reference, floating, config) => {
789
757
  const { placement = "bottom", strategy = "absolute", middleware = [], platform: platform$1 } = config;
790
- const validMiddleware = middleware.filter(Boolean);
758
+ const platformWithDetectOverflow = platform$1.detectOverflow ? platform$1 : {
759
+ ...platform$1,
760
+ detectOverflow: detectOverflow$1
761
+ };
791
762
  const rtl = await (platform$1.isRTL == null ? void 0 : platform$1.isRTL(floating));
792
763
  let rects = await platform$1.getElementRects({
793
764
  reference,
@@ -796,11 +767,12 @@ var computePosition$1 = async (reference, floating, config) => {
796
767
  });
797
768
  let { x, y } = computeCoordsFromPlacement(rects, placement, rtl);
798
769
  let statefulPlacement = placement;
799
- let middlewareData = {};
800
770
  let resetCount = 0;
801
- for (let i = 0; i < validMiddleware.length; i++) {
802
- var _platform$detectOverf;
803
- const { name, fn } = validMiddleware[i];
771
+ const middlewareData = {};
772
+ for (let i = 0; i < middleware.length; i++) {
773
+ const currentMiddleware = middleware[i];
774
+ if (!currentMiddleware) continue;
775
+ const { name, fn } = currentMiddleware;
804
776
  const { x: nextX, y: nextY, data, reset } = await fn({
805
777
  x,
806
778
  y,
@@ -809,10 +781,7 @@ var computePosition$1 = async (reference, floating, config) => {
809
781
  strategy,
810
782
  middlewareData,
811
783
  rects,
812
- platform: {
813
- ...platform$1,
814
- detectOverflow: (_platform$detectOverf = platform$1.detectOverflow) != null ? _platform$detectOverf : detectOverflow$1
815
- },
784
+ platform: platformWithDetectOverflow,
816
785
  elements: {
817
786
  reference,
818
787
  floating
@@ -820,14 +789,11 @@ var computePosition$1 = async (reference, floating, config) => {
820
789
  });
821
790
  x = nextX != null ? nextX : x;
822
791
  y = nextY != null ? nextY : y;
823
- middlewareData = {
824
- ...middlewareData,
825
- [name]: {
826
- ...middlewareData[name],
827
- ...data
828
- }
792
+ middlewareData[name] = {
793
+ ...middlewareData[name],
794
+ ...data
829
795
  };
830
- if (reset && resetCount <= 50) {
796
+ if (reset && resetCount < MAX_RESET_COUNT) {
831
797
  resetCount++;
832
798
  if (typeof reset === "object") {
833
799
  if (reset.placement) statefulPlacement = reset.placement;
@@ -1280,7 +1246,7 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
1280
1246
  const isOffsetParentAnElement = isHTMLElement(offsetParent);
1281
1247
  if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1282
1248
  if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) scroll = getNodeScroll(offsetParent);
1283
- if (isHTMLElement(offsetParent)) {
1249
+ if (isOffsetParentAnElement) {
1284
1250
  const offsetRect = getBoundingClientRect(offsetParent);
1285
1251
  scale = getScale(offsetParent);
1286
1252
  offsets.x = offsetRect.x + offsetParent.clientLeft;
@@ -1348,7 +1314,6 @@ function getViewportRect(element, strategy) {
1348
1314
  y
1349
1315
  };
1350
1316
  }
1351
- var absoluteOrFixed = /* @__PURE__ */ new Set(["absolute", "fixed"]);
1352
1317
  function getInnerBoundingClientRect(element, strategy) {
1353
1318
  const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
1354
1319
  const top = clientRect.top + element.clientTop;
@@ -1393,7 +1358,7 @@ function getClippingElementAncestors(element, cache) {
1393
1358
  const computedStyle = getComputedStyle$1(currentNode);
1394
1359
  const currentNodeIsContaining = isContainingBlock(currentNode);
1395
1360
  if (!currentNodeIsContaining && computedStyle.position === "fixed") currentContainingBlockComputedStyle = null;
1396
- if (elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode)) result = result.filter((ancestor) => ancestor !== currentNode);
1361
+ if (elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === "absolute" || currentContainingBlockComputedStyle.position === "fixed") || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode)) result = result.filter((ancestor) => ancestor !== currentNode);
1397
1362
  else currentContainingBlockComputedStyle = computedStyle;
1398
1363
  currentNode = getParentNode(currentNode);
1399
1364
  }
@@ -1403,20 +1368,23 @@ function getClippingElementAncestors(element, cache) {
1403
1368
  function getClippingRect(_ref) {
1404
1369
  let { element, boundary, rootBoundary, strategy } = _ref;
1405
1370
  const clippingAncestors = [...boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary), rootBoundary];
1406
- const firstClippingAncestor = clippingAncestors[0];
1407
- const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
1408
- const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
1409
- accRect.top = max(rect.top, accRect.top);
1410
- accRect.right = min(rect.right, accRect.right);
1411
- accRect.bottom = min(rect.bottom, accRect.bottom);
1412
- accRect.left = max(rect.left, accRect.left);
1413
- return accRect;
1414
- }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
1371
+ const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);
1372
+ let top = firstRect.top;
1373
+ let right = firstRect.right;
1374
+ let bottom = firstRect.bottom;
1375
+ let left = firstRect.left;
1376
+ for (let i = 1; i < clippingAncestors.length; i++) {
1377
+ const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy);
1378
+ top = max(rect.top, top);
1379
+ right = min(rect.right, right);
1380
+ bottom = min(rect.bottom, bottom);
1381
+ left = max(rect.left, left);
1382
+ }
1415
1383
  return {
1416
- width: clippingRect.right - clippingRect.left,
1417
- height: clippingRect.bottom - clippingRect.top,
1418
- x: clippingRect.left,
1419
- y: clippingRect.top
1384
+ width: right - left,
1385
+ height: bottom - top,
1386
+ x: left,
1387
+ y: top
1420
1388
  };
1421
1389
  }
1422
1390
  function getDimensions(element) {
@@ -1570,7 +1538,7 @@ function autoUpdate(reference, floating, update, options) {
1570
1538
  if (options === void 0) options = {};
1571
1539
  const { ancestorScroll = true, ancestorResize = true, elementResize = typeof ResizeObserver === "function", layoutShift = typeof IntersectionObserver === "function", animationFrame = false } = options;
1572
1540
  const referenceEl = unwrapElement(reference);
1573
- const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];
1541
+ const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...floating ? getOverflowAncestors(floating) : []] : [];
1574
1542
  ancestors.forEach((ancestor) => {
1575
1543
  ancestorScroll && ancestor.addEventListener("scroll", update, { passive: true });
1576
1544
  ancestorResize && ancestor.addEventListener("resize", update);
@@ -1581,7 +1549,7 @@ function autoUpdate(reference, floating, update, options) {
1581
1549
  if (elementResize) {
1582
1550
  resizeObserver = new ResizeObserver((_ref) => {
1583
1551
  let [firstEntry] = _ref;
1584
- if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
1552
+ if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {
1585
1553
  resizeObserver.unobserve(floating);
1586
1554
  cancelAnimationFrame(reobserveFrame);
1587
1555
  reobserveFrame = requestAnimationFrame(() => {
@@ -1592,7 +1560,7 @@ function autoUpdate(reference, floating, update, options) {
1592
1560
  update();
1593
1561
  });
1594
1562
  if (referenceEl && !animationFrame) resizeObserver.observe(referenceEl);
1595
- resizeObserver.observe(floating);
1563
+ if (floating) resizeObserver.observe(floating);
1596
1564
  }
1597
1565
  let frameId;
1598
1566
  let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
@@ -1847,30 +1815,54 @@ var arrow$1$1 = (options) => {
1847
1815
  }
1848
1816
  };
1849
1817
  };
1850
- var offset = (options, deps) => ({
1851
- ...offset$1(options),
1852
- options: [options, deps]
1853
- });
1854
- var shift = (options, deps) => ({
1855
- ...shift$1(options),
1856
- options: [options, deps]
1857
- });
1858
- var flip = (options, deps) => ({
1859
- ...flip$1(options),
1860
- options: [options, deps]
1861
- });
1862
- var size = (options, deps) => ({
1863
- ...size$1(options),
1864
- options: [options, deps]
1865
- });
1866
- var hide = (options, deps) => ({
1867
- ...hide$1(options),
1868
- options: [options, deps]
1869
- });
1870
- var arrow = (options, deps) => ({
1871
- ...arrow$1$1(options),
1872
- options: [options, deps]
1873
- });
1818
+ var offset = (options, deps) => {
1819
+ const result = offset$1(options);
1820
+ return {
1821
+ name: result.name,
1822
+ fn: result.fn,
1823
+ options: [options, deps]
1824
+ };
1825
+ };
1826
+ var shift = (options, deps) => {
1827
+ const result = shift$1(options);
1828
+ return {
1829
+ name: result.name,
1830
+ fn: result.fn,
1831
+ options: [options, deps]
1832
+ };
1833
+ };
1834
+ var flip = (options, deps) => {
1835
+ const result = flip$1(options);
1836
+ return {
1837
+ name: result.name,
1838
+ fn: result.fn,
1839
+ options: [options, deps]
1840
+ };
1841
+ };
1842
+ var size = (options, deps) => {
1843
+ const result = size$1(options);
1844
+ return {
1845
+ name: result.name,
1846
+ fn: result.fn,
1847
+ options: [options, deps]
1848
+ };
1849
+ };
1850
+ var hide = (options, deps) => {
1851
+ const result = hide$1(options);
1852
+ return {
1853
+ name: result.name,
1854
+ fn: result.fn,
1855
+ options: [options, deps]
1856
+ };
1857
+ };
1858
+ var arrow = (options, deps) => {
1859
+ const result = arrow$1$1(options);
1860
+ return {
1861
+ name: result.name,
1862
+ fn: result.fn,
1863
+ options: [options, deps]
1864
+ };
1865
+ };
1874
1866
  function useMergeRefs(refs) {
1875
1867
  const cleanupRef = React$1.useRef(void 0);
1876
1868
  const refEffect = React$1.useCallback((instance) => {
@@ -2423,7 +2415,10 @@ var uncontrolledElementsSet = /* @__PURE__ */ new WeakSet();
2423
2415
  var markerMap = {};
2424
2416
  var lockCount$1 = 0;
2425
2417
  var supportsInert = () => typeof HTMLElement !== "undefined" && "inert" in HTMLElement.prototype;
2426
- var unwrapHost = (node) => node && (node.host || unwrapHost(node.parentNode));
2418
+ function unwrapHost(node) {
2419
+ if (!node) return null;
2420
+ return isShadowRoot(node) ? node.host : unwrapHost(node.parentNode);
2421
+ }
2427
2422
  var correctElements = (parent, targets) => targets.map((target) => {
2428
2423
  if (parent.contains(target)) return target;
2429
2424
  const correctedTarget = unwrapHost(target);
@@ -2551,7 +2546,7 @@ function addPreviouslyFocusedElement(element) {
2551
2546
  clearDisconnectedPreviouslyFocusedElements();
2552
2547
  if (element && getNodeName(element) !== "body") {
2553
2548
  previouslyFocusedElements.push(new WeakRef(element));
2554
- if (previouslyFocusedElements.length > LIST_LIMIT) previouslyFocusedElements = previouslyFocusedElements.slice(-20);
2549
+ if (previouslyFocusedElements.length > LIST_LIMIT) previouslyFocusedElements = previouslyFocusedElements.slice(-LIST_LIMIT);
2555
2550
  }
2556
2551
  }
2557
2552
  function getPreviouslyFocusedElement() {
@@ -3244,18 +3239,20 @@ function useDismiss(context, props) {
3244
3239
  referencePress,
3245
3240
  referencePressEvent
3246
3241
  ]);
3247
- const floating = React$1.useMemo(() => ({
3248
- onKeyDown: closeOnEscapeKeyDown,
3249
- onMouseDown() {
3250
- endedOrStartedInsideRef.current = true;
3251
- },
3252
- onMouseUp() {
3242
+ const floating = React$1.useMemo(() => {
3243
+ function setMouseDownOrUpInside(event) {
3244
+ if (event.button !== 0) return;
3253
3245
  endedOrStartedInsideRef.current = true;
3254
- },
3255
- [captureHandlerKeys[outsidePressEvent]]: () => {
3256
- dataRef.current.insideReactTree = true;
3257
3246
  }
3258
- }), [
3247
+ return {
3248
+ onKeyDown: closeOnEscapeKeyDown,
3249
+ onMouseDown: setMouseDownOrUpInside,
3250
+ onMouseUp: setMouseDownOrUpInside,
3251
+ [captureHandlerKeys[outsidePressEvent]]: () => {
3252
+ dataRef.current.insideReactTree = true;
3253
+ }
3254
+ };
3255
+ }, [
3259
3256
  closeOnEscapeKeyDown,
3260
3257
  outsidePressEvent,
3261
3258
  dataRef