@helsenorge/designsystem-react 14.0.0-beta.7 → 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.
- package/lib/AnchorLink.js +2 -2
- package/lib/AnchorLink.js.map +1 -1
- package/lib/Avatar.js +2 -2
- package/lib/Avatar.js.map +1 -1
- package/lib/Badge.js +2 -2
- package/lib/Badge.js.map +1 -1
- package/lib/Button.js +6 -6
- package/lib/Button.js.map +1 -1
- package/lib/CHANGELOG.md +340 -11
- package/lib/Checkbox.js +6 -6
- package/lib/Checkbox.js.map +1 -1
- package/lib/Close.js +3 -3
- package/lib/Close.js.map +1 -1
- package/lib/DictionaryTrigger.js +2 -2
- package/lib/DictionaryTrigger.js.map +1 -1
- package/lib/DoctorSmall.js +22 -34
- package/lib/DoctorSmall.js.map +1 -1
- package/lib/Drawer.js +6 -5
- package/lib/Drawer.js.map +1 -1
- package/lib/Duolist.js +5 -5
- package/lib/Duolist.js.map +1 -1
- package/lib/ElementHeader.js +9 -9
- package/lib/ElementHeader.js.map +1 -1
- package/lib/ElementHeaderText.js +4 -4
- package/lib/ElementHeaderText.js.map +1 -1
- package/lib/ErrorWrapper.js +2 -2
- package/lib/ErrorWrapper.js.map +1 -1
- package/lib/Expander.js +8 -8
- package/lib/Expander.js.map +1 -1
- package/lib/FormFieldTag.js +2 -2
- package/lib/FormFieldTag.js.map +1 -1
- package/lib/FormGroup.js +5 -5
- package/lib/FormGroup.js.map +1 -1
- package/lib/FormLayout.js +3 -3
- package/lib/FormLayout.js.map +1 -1
- package/lib/HelpDetails.js +3 -3
- package/lib/HelpDetails.js.map +1 -1
- package/lib/HelpTriggerIcon.js +12 -8
- package/lib/HelpTriggerIcon.js.map +1 -1
- package/lib/HelpTriggerStandalone.js +2 -2
- package/lib/HelpTriggerStandalone.js.map +1 -1
- package/lib/HighlightPanel.js +3 -3
- package/lib/HighlightPanel.js.map +1 -1
- package/lib/HorizontalScroll.js +4 -4
- package/lib/HorizontalScroll.js.map +1 -1
- package/lib/Icon.js +2 -2
- package/lib/Icon.js.map +1 -1
- package/lib/IllustrationNames.js +6 -2
- package/lib/IllustrationNames.js.map +1 -1
- package/lib/InfoTeaser.js +3 -3
- package/lib/InfoTeaser.js.map +1 -1
- package/lib/Input.js +9 -7
- package/lib/Input.js.map +1 -1
- package/lib/LazyIcon.js +2 -0
- package/lib/LazyIcon.js.map +1 -1
- package/lib/LazyIllustration.js +5 -1
- package/lib/LazyIllustration.js.map +1 -1
- package/lib/LinkList.js +5 -5
- package/lib/LinkList.js.map +1 -1
- package/lib/List.js +2 -2
- package/lib/List.js.map +1 -1
- package/lib/ListEditMode.js +4 -4
- package/lib/ListEditMode.js.map +1 -1
- package/lib/MaxCharacters.js +2 -2
- package/lib/MaxCharacters.js.map +1 -1
- package/lib/PanelTitle.js +2 -2
- package/lib/PanelTitle.js.map +1 -1
- package/lib/PopOver.js +2 -2
- package/lib/PopOver.js.map +1 -1
- package/lib/Select.js +4 -4
- package/lib/Select.js.map +1 -1
- package/lib/SingleSelectItem.js +3 -3
- package/lib/SingleSelectItem.js.map +1 -1
- package/lib/Slider.js +18 -10
- package/lib/Slider.js.map +1 -1
- package/lib/Spacer.js +2 -2
- package/lib/Spacer.js.map +1 -1
- package/lib/StatusDot.js +4 -4
- package/lib/StatusDot.js.map +1 -1
- package/lib/StatusDotList.js +2 -2
- package/lib/StatusDotList.js.map +1 -1
- package/lib/StepButtons.js +5 -5
- package/lib/StepButtons.js.map +1 -1
- package/lib/StorkMedium.js +96 -0
- package/lib/StorkMedium.js.map +1 -0
- package/lib/TabList.js +8 -8
- package/lib/TabList.js.map +1 -1
- package/lib/TabPanel.js +2 -2
- package/lib/TabPanel.js.map +1 -1
- package/lib/TableBody.js +2 -2
- package/lib/TableBody.js.map +1 -1
- package/lib/TableCell.js +2 -2
- package/lib/TableCell.js.map +1 -1
- package/lib/TableExpandedRow.js +4 -4
- package/lib/TableExpandedRow.js.map +1 -1
- package/lib/TableExpanderCell.js +2 -2
- package/lib/TableExpanderCell.js.map +1 -1
- package/lib/TableHead.js +2 -2
- package/lib/TableHead.js.map +1 -1
- package/lib/TableHeadCell.js +3 -3
- package/lib/TableHeadCell.js.map +1 -1
- package/lib/TableRow.js +3 -3
- package/lib/TableRow.js.map +1 -1
- package/lib/Textarea.js +17 -16
- package/lib/Textarea.js.map +1 -1
- package/lib/ThinkingMedium.js +98 -0
- package/lib/ThinkingMedium.js.map +1 -0
- package/lib/Title.js +2 -2
- package/lib/Title.js.map +1 -1
- package/lib/Toast.js +3 -3
- package/lib/Toast.js.map +1 -1
- package/lib/components/ArticleTeaser/index.js +4 -4
- package/lib/components/ArticleTeaser/index.js.map +1 -1
- package/lib/components/Button/styles.module.scss +1 -3
- package/lib/components/Chip/index.js +2 -2
- package/lib/components/Chip/index.js.map +1 -1
- package/lib/components/Drawer/styles.module.scss +4 -21
- package/lib/components/Drawer/styles.module.scss.d.ts +1 -1
- package/lib/components/Dropdown/index.js +5 -5
- package/lib/components/Dropdown/index.js.map +1 -1
- package/lib/components/DropdownOld/index.js +3 -3
- package/lib/components/DropdownOld/index.js.map +1 -1
- package/lib/components/EmptyState/index.js +2 -2
- package/lib/components/EmptyState/index.js.map +1 -1
- package/lib/components/ExpanderHierarchy/Expander.d.ts +1 -1
- package/lib/components/ExpanderHierarchy/index.js +7 -7
- package/lib/components/ExpanderHierarchy/index.js.map +1 -1
- package/lib/components/ExpanderList/index.js +19 -10
- package/lib/components/ExpanderList/index.js.map +1 -1
- package/lib/components/FavoriteButton/index.js +2 -2
- package/lib/components/FavoriteButton/index.js.map +1 -1
- package/lib/components/HelpBubble/index.js +3 -3
- package/lib/components/HelpBubble/index.js.map +1 -1
- package/lib/components/HelpPanel/index.js +2 -2
- package/lib/components/HelpPanel/index.js.map +1 -1
- package/lib/components/HelpTriggerIcon/HelpSign.d.ts +0 -1
- package/lib/components/HelpTriggerInline/index.js +2 -2
- package/lib/components/HelpTriggerInline/index.js.map +1 -1
- package/lib/components/HelpTriggerInline/styles.module.scss +1 -0
- package/lib/components/Icons/AdditionalIconInformation.d.ts +8 -0
- package/lib/components/Icons/AdditionalIconInformation.js +8 -0
- package/lib/components/Icons/AdditionalIconInformation.js.map +1 -1
- package/lib/components/Icons/IconNames.d.ts +1 -1
- package/lib/components/Icons/IconNames.js +2 -0
- package/lib/components/Icons/IconNames.js.map +1 -1
- package/lib/components/Icons/StarFill.d.ts +4 -0
- package/lib/components/Icons/StarFill.js +16 -0
- package/lib/components/Icons/StarFill.js.map +1 -0
- package/lib/components/Icons/StarStroke.d.ts +4 -0
- package/lib/components/Icons/StarStroke.js +16 -0
- package/lib/components/Icons/StarStroke.js.map +1 -0
- package/lib/components/Illustrations/IllustrationNames.d.ts +1 -1
- package/lib/components/Illustrations/Stork.d.ts +11 -0
- package/lib/components/Illustrations/Stork.js +16 -0
- package/lib/components/Illustrations/Stork.js.map +1 -0
- package/lib/components/Illustrations/StorkMedium.d.ts +4 -0
- package/lib/components/Illustrations/StorkMedium.js +2 -0
- package/lib/components/Illustrations/Thinking.d.ts +9 -0
- package/lib/components/Illustrations/Thinking.js +16 -0
- package/lib/components/Illustrations/Thinking.js.map +1 -0
- package/lib/components/Illustrations/ThinkingMedium.d.ts +4 -0
- package/lib/components/Illustrations/ThinkingMedium.js +2 -0
- package/lib/components/Loader/index.js +19 -17
- package/lib/components/Loader/index.js.map +1 -1
- package/lib/components/Modal/index.js +9 -9
- package/lib/components/Modal/index.js.map +1 -1
- package/lib/components/NotificationPanel/index.js +6 -6
- package/lib/components/NotificationPanel/index.js.map +1 -1
- package/lib/components/Panel/index.js +12 -12
- package/lib/components/Panel/index.js.map +1 -1
- package/lib/components/PanelList/index.js +3 -3
- package/lib/components/PanelList/index.js.map +1 -1
- package/lib/components/PopMenu/index.js +3 -3
- package/lib/components/PopMenu/index.js.map +1 -1
- package/lib/components/Progressbar/index.js +2 -2
- package/lib/components/Progressbar/index.js.map +1 -1
- package/lib/components/PromoPanel/index.js +2 -2
- package/lib/components/PromoPanel/index.js.map +1 -1
- package/lib/components/ServiceMessage/ServiceMessage.d.ts +3 -0
- package/lib/components/ServiceMessage/index.js +7 -7
- package/lib/components/ServiceMessage/index.js.map +1 -1
- package/lib/components/SharingStatus/index.js +4 -4
- package/lib/components/SharingStatus/index.js.map +1 -1
- package/lib/components/Step/index.js +2 -2
- package/lib/components/Step/index.js.map +1 -1
- package/lib/components/Stepper/index.js +2 -2
- package/lib/components/Stepper/index.js.map +1 -1
- package/lib/components/StickyNote/index.js +16 -13
- package/lib/components/StickyNote/index.js.map +1 -1
- package/lib/components/Table/index.js +2 -2
- package/lib/components/Table/index.js.map +1 -1
- package/lib/components/Tabs/index.js +4 -4
- package/lib/components/Tabs/index.js.map +1 -1
- package/lib/components/Tag/index.js +2 -2
- package/lib/components/Tag/index.js.map +1 -1
- package/lib/components/Tile/index.js +4 -4
- package/lib/components/Tile/index.js.map +1 -1
- package/lib/components/Toggle/index.js +9 -9
- package/lib/components/Toggle/index.js.map +1 -1
- package/lib/components/Validation/index.js +2 -2
- package/lib/components/Validation/index.js.map +1 -1
- package/lib/floating-ui.react.js +126 -129
- package/lib/floating-ui.react.js.map +1 -1
- package/lib/hooks/useIsServerSide.d.ts +1 -1
- package/lib/resources/HN.Designsystem.ArticleTeaser.en-GB.json.d.ts +7 -0
- package/lib/resources/HN.Designsystem.ArticleTeaser.nb-NO.json.d.ts +7 -0
- package/lib/resources/HN.Designsystem.Drawer.en-GB.json.d.ts +6 -0
- package/lib/resources/HN.Designsystem.Drawer.nb-NO.json.d.ts +6 -0
- package/lib/resources/HN.Designsystem.Dropdown.en-GB.json.d.ts +6 -0
- package/lib/resources/HN.Designsystem.Dropdown.nb-NO.json.d.ts +6 -0
- package/lib/resources/HN.Designsystem.FavoriteButton.nb-NO.json.d.ts +6 -0
- package/lib/resources/HN.Designsystem.FormFieldTag.en-GB.json.d.ts +12 -0
- package/lib/resources/HN.Designsystem.FormFieldTag.nb-NO.json.d.ts +12 -0
- package/lib/resources/HN.Designsystem.FormFieldTag.nn-NO.json.d.ts +12 -0
- package/lib/resources/HN.Designsystem.FormFieldTag.se-NO.json.d.ts +12 -0
- package/lib/resources/HN.Designsystem.HelpBubble.nb-NO.json.d.ts +6 -0
- package/lib/resources/HN.Designsystem.HelpDrawer.nb-NO.json.d.ts +6 -0
- package/lib/resources/HN.Designsystem.InfoTeaser.en-GB.json.d.ts +7 -0
- package/lib/resources/HN.Designsystem.InfoTeaser.nb-NO.json.d.ts +7 -0
- package/lib/resources/HN.Designsystem.Input.en-GB.json.d.ts +6 -0
- package/lib/resources/HN.Designsystem.Input.nb-NO.json.d.ts +6 -0
- package/lib/resources/HN.Designsystem.Input.nn-NO.json.d.ts +6 -0
- package/lib/resources/HN.Designsystem.LinkList.en-GB.json.d.ts +6 -0
- package/lib/resources/HN.Designsystem.LinkList.nb-NO.json.d.ts +6 -0
- package/lib/resources/HN.Designsystem.Panel.en-GB.json.d.ts +7 -0
- package/lib/resources/HN.Designsystem.Panel.nb-NO.json.d.ts +7 -0
- package/lib/resources/HN.Designsystem.Tabs.en-GB.json.d.ts +7 -0
- package/lib/resources/HN.Designsystem.Tabs.nb-NO.json.d.ts +7 -0
- package/lib/resources/HN.Designsystem.TextArea.en-GB.json.d.ts +6 -0
- package/lib/resources/HN.Designsystem.TextArea.nb-NO.json.d.ts +6 -0
- package/lib/resources/HN.Designsystem.TextArea.nn-NO.json.d.ts +6 -0
- package/lib/resources/index.d.ts +1 -0
- package/lib/useBreakpoint.js +15 -24
- package/lib/useBreakpoint.js.map +1 -1
- package/lib/useExpand.js +5 -3
- package/lib/useExpand.js.map +1 -1
- package/lib/useIsServerSide.js +5 -6
- package/lib/useIsServerSide.js.map +1 -1
- package/lib/useToggle.js +5 -3
- package/lib/useToggle.js.map +1 -1
- package/lib/utils2.js +7 -7
- package/lib/utils2.js.map +1 -1
- package/lib/utils3.js +5 -5
- package/lib/utils3.js.map +1 -1
- package/package.json +1 -1
package/lib/floating-ui.react.js
CHANGED
|
@@ -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) &&
|
|
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
|
|
41
|
+
return /^(table|td|th)$/.test(getNodeName(element));
|
|
48
42
|
}
|
|
49
|
-
var topLayerSelectors = [":popover-open", ":modal"];
|
|
50
43
|
function isTopLayer(element) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
|
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
|
|
96
|
-
return
|
|
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
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
802
|
-
|
|
803
|
-
const
|
|
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
|
-
|
|
826
|
-
...middlewareData[name],
|
|
827
|
-
...data
|
|
828
|
-
}
|
|
792
|
+
middlewareData[name] = {
|
|
793
|
+
...middlewareData[name],
|
|
794
|
+
...data
|
|
829
795
|
};
|
|
830
|
-
if (reset && resetCount
|
|
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 (
|
|
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 &&
|
|
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
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
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:
|
|
1417
|
-
height:
|
|
1418
|
-
x:
|
|
1419
|
-
y:
|
|
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
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
}
|
|
1858
|
-
var
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
}
|
|
1866
|
-
var
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
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
|
-
|
|
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(-
|
|
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
|
-
|
|
3249
|
-
|
|
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
|