@qualtrics/ui-react 2.85.2 → 2.85.4
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/CHANGELOG.md +17 -0
- package/dist/__node_modules/@radix-ui/primitive/dist/index.js +14 -3
- package/dist/__node_modules/@radix-ui/primitive/dist/internal/is-development.false.js +4 -0
- package/dist/__node_modules/@radix-ui/react-arrow/dist/index.js +7 -4
- package/dist/__node_modules/@radix-ui/react-collection/dist/index.js +58 -39
- package/dist/__node_modules/@radix-ui/react-compose-refs/dist/index.js +8 -1
- package/dist/__node_modules/@radix-ui/react-context/dist/index.js +35 -12
- package/dist/__node_modules/@radix-ui/react-direction/dist/index.js +10 -3
- package/dist/__node_modules/@radix-ui/react-dismissable-layer/dist/index.js +172 -41
- package/dist/__node_modules/@radix-ui/react-dropdown-menu/dist/index.js +58 -61
- package/dist/__node_modules/@radix-ui/react-focus-guards/dist/index.js +30 -6
- package/dist/__node_modules/@radix-ui/react-focus-scope/dist/index.js +33 -9
- package/dist/__node_modules/@radix-ui/react-id/dist/index.js +6 -0
- package/dist/__node_modules/@radix-ui/react-menu/dist/index.js +107 -79
- package/dist/__node_modules/@radix-ui/react-popper/dist/index.js +79 -38
- package/dist/__node_modules/@radix-ui/react-portal/dist/index.js +9 -6
- package/dist/__node_modules/@radix-ui/react-presence/dist/index.js +71 -12
- package/dist/__node_modules/@radix-ui/react-primitive/dist/index.js +6 -0
- package/dist/__node_modules/@radix-ui/react-roving-focus/dist/index.js +36 -12
- package/dist/__node_modules/@radix-ui/react-slot/dist/index.js +85 -54
- package/dist/__node_modules/@radix-ui/react-use-callback-ref/dist/index.js +6 -1
- package/dist/__node_modules/@radix-ui/react-use-controllable-state/dist/index.js +14 -4
- package/dist/__node_modules/@radix-ui/react-use-effect-event/dist/index.js +6 -1
- package/dist/__node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +37 -0
- package/dist/__node_modules/@radix-ui/react-use-layout-effect/dist/index.js +1 -1
- package/dist/__node_modules/@radix-ui/react-use-size/dist/index.js +6 -0
- package/dist/__shared/cjs/{index-e03dac36.js → index-08198ff4.js} +140 -136
- package/dist/__shared/cjs/{index-507024ee.js → index-e51bbd75.js} +3 -3
- package/dist/components/Accordion/Accordion2.js +3 -3
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/ButtonGroup/ButtonGroup2.js +3 -3
- package/dist/components/Checkbox/Checkbox2.js +3 -3
- package/dist/components/ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/Combobox/Combobox2.js +3 -3
- package/dist/components/ConfigPane/ConfigPane.js +6 -2
- package/dist/components/ConfigPane/ConfigPane2.js +3 -3
- package/dist/components/Divider/Divider2.js +3 -3
- package/dist/components/Dropdown/ChildIndexContext/reach-descendants.js +1 -1
- package/dist/components/Dropdown/Dropdown2.js +3 -3
- package/dist/components/FilePicker/FilePicker2.js +3 -3
- package/dist/components/FormField/Caption.js +3 -3
- package/dist/components/FormField/FormField2.js +3 -3
- package/dist/components/FullScreenTakeover/FullScreenTakeover2.js +3 -3
- package/dist/components/IconButton/IconButton2.js +3 -3
- package/dist/components/InlineInput/InlineInput2.js +3 -3
- package/dist/components/Input/Input2.js +3 -3
- package/dist/components/InputGroup/InputGroup2.js +3 -3
- package/dist/components/Label/Label2.js +3 -3
- package/dist/components/Link/Link2.js +3 -3
- package/dist/components/LoadingSpinner/LoadingSpinner2.js +3 -3
- package/dist/components/LogicEditor/LogicEditor2.js +3 -3
- package/dist/components/Modal/Modal2.js +3 -3
- package/dist/components/NewMenu/NewMenu.js +3 -3
- package/dist/components/NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/PageLayout/PageLayout.js +3 -3
- package/dist/components/Pagination/Pagination2.js +3 -3
- package/dist/components/Popover/Popover2.js +3 -3
- package/dist/components/QuickSearch/QuickSearch2.js +3 -3
- package/dist/components/Radio/Radio2.js +3 -3
- package/dist/components/SearchInput/SearchInput2.js +3 -3
- package/dist/components/SidebarNav/SidebarNav2.js +3 -3
- package/dist/components/Slider/Slider2.js +3 -3
- package/dist/components/Switch/Switch2.js +3 -3
- package/dist/components/Table/Table2.js +3 -3
- package/dist/components/Tabs/Tabs2.js +3 -3
- package/dist/components/Tooltip/Tooltip2.js +3 -3
- package/dist/components/deprecated_ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/deprecated_NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/deprecated_Tabs/Tabs2.js +3 -3
- package/dist/components/deprecated_Toolbar/Toolbar2.js +3 -3
- package/dist/design-tokens/less/typography.js +3 -3
- package/dist/hooks/useOverlay/useOverlay2.js +3 -3
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement2.js +3 -3
- package/dist/icons/Icon.js +3 -3
- package/dist/icons/index.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/index.js +3 -3
- package/dist/next/AdvancedTable/AdvancedTable2.js +3 -3
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput2.js +3 -3
- package/dist/next/Combobox/Combobox2.js +3 -3
- package/dist/next/Drawer/Drawer2.js +3 -3
- package/dist/next/FilterAnchor/FilterAnchor2.js +3 -3
- package/dist/next/Form/FormFields/InputField.js +3 -3
- package/dist/next/Indicator/Indicator2.js +3 -3
- package/dist/next/Input/Input2.js +3 -3
- package/dist/next/LoadingSpinner/LoadingSpinner2.js +3 -3
- package/dist/next/Menu/Hooks/useFlyoutNode.js +48 -0
- package/dist/next/Menu/Menu2.js +3 -3
- package/dist/next/Menu/MenuButton.js +4 -3
- package/dist/next/Menu/MenuItem.js +3 -2
- package/dist/next/Menu/MenuPane.js +17 -16
- package/dist/next/Menu/PaneChildren.js +15 -10
- package/dist/next/Menu/SubMenu.js +17 -16
- package/dist/next/PhoneNumberInput/PhoneNumberInput2.js +3 -3
- package/dist/next/Select/Select2.js +3 -3
- package/dist/next/SplitButton/SplitButton2.js +3 -3
- package/dist/next/TimePicker/TimePicker2.js +3 -3
- package/dist/next/ToggleButton/styles.js +3 -3
- package/dist/next/index.js +1055 -519
- package/dist/utils/Flyout/Flyout2.js +3 -3
- package/icons/package.json +4 -4
- package/next/package.json +5 -5
- package/package.json +14 -14
- package/dist/__node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +0 -23
|
@@ -1,26 +1,49 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
3
|
"use client";
|
|
4
|
+
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", {
|
|
7
|
+
value,
|
|
8
|
+
configurable: true
|
|
9
|
+
});
|
|
4
10
|
var count = 0;
|
|
11
|
+
var guards = null;
|
|
5
12
|
function FocusGuards(props) {
|
|
6
13
|
useFocusGuards();
|
|
7
14
|
return props.children;
|
|
8
15
|
}
|
|
16
|
+
__name(FocusGuards, "FocusGuards");
|
|
9
17
|
function useFocusGuards() {
|
|
10
18
|
React.useEffect(() => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
19
|
+
if (!guards) {
|
|
20
|
+
guards = {
|
|
21
|
+
start: createFocusGuard(),
|
|
22
|
+
end: createFocusGuard()
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const _guards = guards,
|
|
26
|
+
start = _guards.start,
|
|
27
|
+
end = _guards.end;
|
|
28
|
+
if (document.body.firstElementChild !== start) {
|
|
29
|
+
document.body.insertAdjacentElement("afterbegin", start);
|
|
30
|
+
}
|
|
31
|
+
if (document.body.lastElementChild !== end) {
|
|
32
|
+
document.body.insertAdjacentElement("beforeend", end);
|
|
33
|
+
}
|
|
15
34
|
count++;
|
|
16
35
|
return () => {
|
|
17
36
|
if (count === 1) {
|
|
18
|
-
|
|
37
|
+
var _guards2, _guards3;
|
|
38
|
+
(_guards2 = guards) === null || _guards2 === void 0 || _guards2.start.remove();
|
|
39
|
+
(_guards3 = guards) === null || _guards3 === void 0 || _guards3.end.remove();
|
|
40
|
+
guards = null;
|
|
19
41
|
}
|
|
20
|
-
count
|
|
42
|
+
count = Math.max(0, count - 1);
|
|
21
43
|
};
|
|
22
44
|
}, []);
|
|
23
45
|
}
|
|
46
|
+
__name(useFocusGuards, "useFocusGuards");
|
|
24
47
|
function createFocusGuard() {
|
|
25
48
|
const element = document.createElement("span");
|
|
26
49
|
element.setAttribute("data-radix-focus-guard", "");
|
|
@@ -31,5 +54,6 @@ function createFocusGuard() {
|
|
|
31
54
|
element.style.pointerEvents = "none";
|
|
32
55
|
return element;
|
|
33
56
|
}
|
|
57
|
+
__name(createFocusGuard, "createFocusGuard");
|
|
34
58
|
|
|
35
59
|
export { FocusGuards, FocusGuards as Root, useFocusGuards };
|
|
@@ -7,14 +7,18 @@ import { useCallbackRef } from '../../react-use-callback-ref/dist/index.js';
|
|
|
7
7
|
|
|
8
8
|
"use client";
|
|
9
9
|
const _excluded = ["loop", "trapped", "onMountAutoFocus", "onUnmountAutoFocus"];
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __name = (target, value) => __defProp(target, "name", {
|
|
12
|
+
value,
|
|
13
|
+
configurable: true
|
|
14
|
+
});
|
|
10
15
|
var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
11
16
|
var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
12
17
|
var EVENT_OPTIONS = {
|
|
13
18
|
bubbles: false,
|
|
14
19
|
cancelable: true
|
|
15
20
|
};
|
|
16
|
-
var
|
|
17
|
-
var FocusScope = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
21
|
+
var FocusScope = /* @__PURE__ */React.forwardRef(/* @__PURE__ */__name(function FocusScope2(props, forwardedRef) {
|
|
18
22
|
const _props$loop = props.loop,
|
|
19
23
|
loop = _props$loop === void 0 ? false : _props$loop,
|
|
20
24
|
_props$trapped = props.trapped,
|
|
@@ -29,7 +33,7 @@ var FocusScope = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
29
33
|
const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
|
|
30
34
|
const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
|
|
31
35
|
const lastFocusedElementRef = React.useRef(null);
|
|
32
|
-
const composedRefs = useComposedRefs(forwardedRef,
|
|
36
|
+
const composedRefs = useComposedRefs(forwardedRef, setContainer);
|
|
33
37
|
const focusScope = React.useRef({
|
|
34
38
|
paused: false,
|
|
35
39
|
pause() {
|
|
@@ -72,6 +76,9 @@ var FocusScope = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
72
76
|
var handleFocusIn = handleFocusIn2,
|
|
73
77
|
handleFocusOut = handleFocusOut2,
|
|
74
78
|
handleMutations = handleMutations2;
|
|
79
|
+
__name(handleFocusIn2, "handleFocusIn");
|
|
80
|
+
__name(handleFocusOut2, "handleFocusOut");
|
|
81
|
+
__name(handleMutations2, "handleMutations");
|
|
75
82
|
document.addEventListener("focusin", handleFocusIn2);
|
|
76
83
|
document.addEventListener("focusout", handleFocusOut2);
|
|
77
84
|
const mutationObserver = new MutationObserver(handleMutations2);
|
|
@@ -156,8 +163,7 @@ var FocusScope = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
156
163
|
ref: composedRefs,
|
|
157
164
|
onKeyDown: handleKeyDown
|
|
158
165
|
});
|
|
159
|
-
});
|
|
160
|
-
FocusScope.displayName = FOCUS_SCOPE_NAME;
|
|
166
|
+
}, "FocusScope"));
|
|
161
167
|
function focusFirst(candidates) {
|
|
162
168
|
let _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
163
169
|
_ref$select = _ref.select,
|
|
@@ -170,31 +176,43 @@ function focusFirst(candidates) {
|
|
|
170
176
|
if (document.activeElement !== previouslyFocusedElement) return;
|
|
171
177
|
}
|
|
172
178
|
}
|
|
179
|
+
__name(focusFirst, "focusFirst");
|
|
173
180
|
function getTabbableEdges(container) {
|
|
174
181
|
const candidates = getTabbableCandidates(container);
|
|
175
182
|
const first = findVisible(candidates, container);
|
|
176
183
|
const last = findVisible(candidates.reverse(), container);
|
|
177
184
|
return [first, last];
|
|
178
185
|
}
|
|
186
|
+
__name(getTabbableEdges, "getTabbableEdges");
|
|
179
187
|
function getTabbableCandidates(container) {
|
|
180
188
|
const nodes = [];
|
|
181
189
|
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
182
|
-
acceptNode: node => {
|
|
190
|
+
acceptNode: /* @__PURE__ */__name(node => {
|
|
183
191
|
const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
|
|
184
192
|
if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;
|
|
185
193
|
return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
186
|
-
}
|
|
194
|
+
}, "acceptNode")
|
|
187
195
|
});
|
|
188
196
|
while (walker.nextNode()) nodes.push(walker.currentNode);
|
|
189
197
|
return nodes;
|
|
190
198
|
}
|
|
199
|
+
__name(getTabbableCandidates, "getTabbableCandidates");
|
|
191
200
|
function findVisible(elements, container) {
|
|
201
|
+
const canUseCheckVisibility = typeof container.checkVisibility === "function" && container.checkVisibility({
|
|
202
|
+
checkVisibilityCSS: true
|
|
203
|
+
});
|
|
192
204
|
for (const element of elements) {
|
|
193
|
-
|
|
205
|
+
const hidden = canUseCheckVisibility ? !element.checkVisibility({
|
|
206
|
+
checkVisibilityCSS: true
|
|
207
|
+
}) : isHidden(element, {
|
|
194
208
|
upTo: container
|
|
195
|
-
})
|
|
209
|
+
});
|
|
210
|
+
if (!hidden) {
|
|
211
|
+
return element;
|
|
212
|
+
}
|
|
196
213
|
}
|
|
197
214
|
}
|
|
215
|
+
__name(findVisible, "findVisible");
|
|
198
216
|
function isHidden(node, _ref2) {
|
|
199
217
|
let upTo = _ref2.upTo;
|
|
200
218
|
if (getComputedStyle(node).visibility === "hidden") return true;
|
|
@@ -205,9 +223,11 @@ function isHidden(node, _ref2) {
|
|
|
205
223
|
}
|
|
206
224
|
return false;
|
|
207
225
|
}
|
|
226
|
+
__name(isHidden, "isHidden");
|
|
208
227
|
function isSelectableInput(element) {
|
|
209
228
|
return element instanceof HTMLInputElement && "select" in element;
|
|
210
229
|
}
|
|
230
|
+
__name(isSelectableInput, "isSelectableInput");
|
|
211
231
|
function focus(element) {
|
|
212
232
|
let _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
213
233
|
_ref3$select = _ref3.select,
|
|
@@ -220,6 +240,7 @@ function focus(element) {
|
|
|
220
240
|
if (element !== previouslyFocusedElement && isSelectableInput(element) && select) element.select();
|
|
221
241
|
}
|
|
222
242
|
}
|
|
243
|
+
__name(focus, "focus");
|
|
223
244
|
var focusScopesStack = createFocusScopesStack();
|
|
224
245
|
function createFocusScopesStack() {
|
|
225
246
|
let stack = [];
|
|
@@ -239,6 +260,7 @@ function createFocusScopesStack() {
|
|
|
239
260
|
}
|
|
240
261
|
};
|
|
241
262
|
}
|
|
263
|
+
__name(createFocusScopesStack, "createFocusScopesStack");
|
|
242
264
|
function arrayRemove(array, item) {
|
|
243
265
|
const updatedArray = [...array];
|
|
244
266
|
const index = updatedArray.indexOf(item);
|
|
@@ -247,9 +269,11 @@ function arrayRemove(array, item) {
|
|
|
247
269
|
}
|
|
248
270
|
return updatedArray;
|
|
249
271
|
}
|
|
272
|
+
__name(arrayRemove, "arrayRemove");
|
|
250
273
|
function removeLinks(items) {
|
|
251
274
|
return items.filter(item => item.tagName !== "A");
|
|
252
275
|
}
|
|
276
|
+
__name(removeLinks, "removeLinks");
|
|
253
277
|
var Root = FocusScope;
|
|
254
278
|
|
|
255
279
|
export { FocusScope, Root };
|
|
@@ -2,6 +2,11 @@ import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useLayoutEffect as useLayoutEffect2 } from '../../react-use-layout-effect/dist/index.js';
|
|
4
4
|
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", {
|
|
7
|
+
value,
|
|
8
|
+
configurable: true
|
|
9
|
+
});
|
|
5
10
|
var useReactId = React[" useId ".trim().toString()] || (() => void 0);
|
|
6
11
|
var count = 0;
|
|
7
12
|
function useId(deterministicId) {
|
|
@@ -14,5 +19,6 @@ function useId(deterministicId) {
|
|
|
14
19
|
}, [deterministicId]);
|
|
15
20
|
return deterministicId || (id ? "radix-".concat(id) : "");
|
|
16
21
|
}
|
|
22
|
+
__name(useId, "useId");
|
|
17
23
|
|
|
18
24
|
export { useId };
|