@qualtrics/ui-react 2.19.0 → 2.20.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/CHANGELOG.md +45 -0
- package/dist/__shared/cjs/{index-bf07471d.js → index-579c4690.js} +10 -7
- package/dist/__shared/cjs/{index-4e4cc354.js → index-90d4069b.js} +999 -1875
- package/dist/components/Accordion/Accordion.js +1 -5
- package/dist/components/Accordion/Accordion2.js +3 -3
- package/dist/components/Accordion/AccordionHeader.js +8 -10
- package/dist/components/Accordion/AccordionPanel.js +3 -3
- package/dist/components/BreakpointSwitch/Breakpoint.js +0 -2
- package/dist/components/BreakpointSwitch/BreakpointSwitch.js +0 -3
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/Button/Button2.js +2 -7
- package/dist/components/ButtonGroup/ButtonGroup.js +1 -2
- package/dist/components/ButtonGroup/ButtonGroup2.js +3 -3
- package/dist/components/Checkbox/Checkbox.js +11 -11
- package/dist/components/Checkbox/Checkbox2.js +3 -3
- package/dist/components/Checkbox/VisualCheckbox.js +1 -1
- package/dist/components/Checkbox/VisualCheckbox2.js +3 -3
- package/dist/components/ColorPicker/Alpha.js +9 -30
- package/dist/components/ColorPicker/ColorPicker.js +33 -42
- package/dist/components/ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/ColorPicker/ColorPickerFlyout.js +2 -1
- package/dist/components/ColorPicker/ColorPickerFlyoutInputs.js +20 -23
- package/dist/components/ColorPicker/Hue.js +2 -19
- package/dist/components/ColorPicker/Palette.js +7 -27
- package/dist/components/ColorPicker/Saturation.js +8 -29
- package/dist/components/ColorPicker/utils/calculateTargetId.js +10 -20
- package/dist/components/ColorPicker/utils/getMousePosition.js +4 -3
- package/dist/components/ColorPicker/utils/hexToHsv.js +0 -5
- package/dist/components/ColorPicker/utils/hexToRgbaString.js +2 -4
- package/dist/components/ColorPicker/utils/hsvToHex.js +0 -3
- package/dist/components/ColorPicker/utils/rgbToHex.js +1 -1
- package/dist/components/ColorPicker/utils/validateHex.js +12 -19
- package/dist/components/Combobox/Combobox.js +57 -127
- package/dist/components/Combobox/Combobox2.js +3 -3
- package/dist/components/Combobox/ComboboxHeader.js +1 -1
- package/dist/components/Combobox/ComboboxIcon.js +2 -4
- package/dist/components/Combobox/ComboboxInput.js +4 -5
- package/dist/components/Combobox/ComboboxList.js +2 -2
- package/dist/components/ConfigPane/ConfigPane.js +0 -7
- package/dist/components/ConfigPane/ConfigPane2.js +3 -3
- package/dist/components/Divider/Divider2.js +3 -3
- package/dist/components/Dropdown/ChildIndexContext/index.js +0 -1
- package/dist/components/Dropdown/ChildIndexContext/reach-descendants.js +34 -30
- package/dist/components/Dropdown/Dropdown.js +17 -68
- package/dist/components/Dropdown/Dropdown2.js +3 -3
- package/dist/components/Dropdown/DropdownButton.js +23 -33
- package/dist/components/Dropdown/DropdownHeader.js +2 -1
- package/dist/components/Dropdown/DropdownList.js +8 -7
- package/dist/components/Dropdown/DropdownOption.js +3 -10
- package/dist/components/Dropdown/DropdownSearch.js +6 -24
- package/dist/components/FilePicker/FilePicker.js +15 -26
- package/dist/components/FilePicker/FilePicker2.js +3 -3
- package/dist/components/FormField/Caption.js +3 -3
- package/dist/components/FormField/FormField.js +2 -2
- package/dist/components/FormField/FormField2.js +3 -3
- package/dist/components/FormField/FormFieldContext.js +3 -6
- package/dist/components/FormField/ReadOnlyText.js +2 -1
- package/dist/components/FullScreenTakeover/FullScreenTakeover.js +5 -11
- package/dist/components/FullScreenTakeover/FullScreenTakeover2.js +3 -3
- package/dist/components/Icon/Icon.js +3 -6
- package/dist/components/Icon/IconTypes.js +1 -0
- package/dist/components/IconButton/IconButton.js +1 -6
- package/dist/components/IconButton/IconButton2.js +3 -3
- package/dist/components/InlineInput/InlineInput.js +16 -33
- package/dist/components/InlineInput/InlineInput2.js +3 -3
- package/dist/components/Input/Input.js +3 -2
- package/dist/components/Input/Input2.js +3 -3
- package/dist/components/Input/InputField.js +2 -5
- package/dist/components/InputGroup/InputGroup2.js +3 -3
- package/dist/components/InputGroup/InputGroupProvider.js +0 -2
- package/dist/components/Label/Label2.js +3 -3
- package/dist/components/Link/Link2.js +3 -3
- package/dist/components/LoadingSpinner/LoadingSpinner.js +1 -1
- package/dist/components/LoadingSpinner/LoadingSpinner2.js +3 -3
- package/dist/components/LogicEditor/ConditionContainer.js +0 -2
- package/dist/components/LogicEditor/ConditionSet.js +8 -25
- package/dist/components/LogicEditor/Controls.js +2 -2
- package/dist/components/LogicEditor/LogicEditor.js +3 -12
- package/dist/components/LogicEditor/LogicEditor2.js +3 -3
- package/dist/components/LogicEditor/utils.js +9 -34
- package/dist/components/Modal/Modal.js +22 -35
- package/dist/components/Modal/Modal2.js +3 -3
- package/dist/components/NewMenu/BaseMenu.js +43 -108
- package/dist/components/NewMenu/NewMenu.js +3 -3
- package/dist/components/NewMenu/SelectMenu/SelectMenu.js +2 -3
- package/dist/components/NewMenu/parts/ArrowNav/ArrowNav.js +20 -32
- package/dist/components/NewMenu/parts/MenuItem.js +2 -3
- package/dist/components/NewMenu/parts/MenuSearchBox.js +2 -1
- package/dist/components/NumberStepper/NumberStepper.js +29 -44
- package/dist/components/NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/NumberStepper/NumberStepperDecrement.js +6 -5
- package/dist/components/NumberStepper/NumberStepperIncrement.js +6 -5
- package/dist/components/NumberStepper/NumberStepperInput.js +10 -12
- package/dist/components/PageLayout/PageLayout.js +3 -3
- package/dist/components/Pagination/Pagination.js +10 -6
- package/dist/components/Pagination/Pagination2.js +3 -3
- package/dist/components/Pagination/PaginationNextButton.js +8 -8
- package/dist/components/Pagination/PaginationPageInput.js +17 -22
- package/dist/components/Pagination/PaginationPreviousButton.js +8 -8
- package/dist/components/Popover/Popover.js +9 -18
- package/dist/components/Popover/Popover2.js +3 -3
- package/dist/components/QuickSearch/QuickSearch.js +3 -5
- package/dist/components/QuickSearch/QuickSearch2.js +3 -3
- package/dist/components/QuickSearch/QuickSearchInput.js +6 -23
- package/dist/components/Radio/Radio.js +11 -13
- package/dist/components/Radio/Radio2.js +3 -3
- package/dist/components/SearchInput/SearchInput.js +5 -11
- package/dist/components/SearchInput/SearchInput2.js +3 -3
- package/dist/components/SidebarNav/ExpandCollapseButton.js +0 -2
- package/dist/components/SidebarNav/SidebarNav.js +5 -4
- package/dist/components/SidebarNav/SidebarNav2.js +3 -3
- package/dist/components/SidebarNav/SidebarNavLink.js +1 -4
- package/dist/components/Slider/RangeSlider.js +8 -22
- package/dist/components/Slider/Slider.js +7 -26
- package/dist/components/Slider/Slider2.js +3 -3
- package/dist/components/Slider/SliderButton.js +7 -9
- package/dist/components/Switch/Switch.js +11 -11
- package/dist/components/Switch/Switch2.js +3 -3
- package/dist/components/Table/Table2.js +3 -3
- package/dist/components/Tabs/Tab.js +3 -3
- package/dist/components/Tabs/TabContextProvider.js +1 -1
- package/dist/components/Tabs/TabList.js +9 -17
- package/dist/components/Tabs/TabPanel.js +3 -3
- package/dist/components/Tabs/TabPanels.js +0 -2
- package/dist/components/Tabs/Tabs2.js +3 -3
- package/dist/components/Tooltip/Tooltip.js +13 -42
- package/dist/components/Tooltip/Tooltip2.js +3 -3
- package/dist/components/UIProvider/PortalTargetContext.js +0 -1
- package/dist/components/UIProvider/UIProvider.js +2 -2
- package/dist/components/deprecated_ColorPicker/Alpha.js +4 -11
- package/dist/components/deprecated_ColorPicker/Color.js +9 -66
- package/dist/components/deprecated_ColorPicker/ColorPicker.js +2 -8
- package/dist/components/deprecated_ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/deprecated_ColorPicker/HexInput.js +1 -7
- package/dist/components/deprecated_ColorPicker/Hue.js +3 -10
- package/dist/components/deprecated_ColorPicker/Saturation.js +7 -14
- package/dist/components/deprecated_ColorPicker/Swatch.js +2 -6
- package/dist/components/deprecated_ColorPicker/useMouseDrag.js +0 -3
- package/dist/components/deprecated_NumberStepper/NumberStepper.js +14 -20
- package/dist/components/deprecated_NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/deprecated_NumberStepper/NumberStepperDecrement.js +7 -6
- package/dist/components/deprecated_NumberStepper/NumberStepperIncrement.js +7 -6
- package/dist/components/deprecated_NumberStepper/NumberStepperInput.js +16 -17
- package/dist/components/deprecated_Tabs/Tabs.js +9 -25
- package/dist/components/deprecated_Tabs/Tabs2.js +3 -3
- package/dist/components/deprecated_Toolbar/Toolbar2.js +3 -3
- package/dist/components/deprecated_Toolbar/ToolbarPanel.js +3 -3
- package/dist/components/deprecated_Toolbar/ToolbarPanels.js +3 -17
- package/dist/components/deprecated_Toolbar/ToolbarTab.js +10 -26
- package/dist/components/deprecated_Toolbar/ToolbarTabs.js +6 -18
- package/dist/hooks/useBreakpoints/useBreakpoints.js +3 -4
- package/dist/hooks/useClickOutside/useClickOutside.js +2 -7
- package/dist/hooks/useClickOutsidePortals/useClickOutsidePortals.js +3 -6
- package/dist/hooks/useControllableState/useControllableState.js +5 -10
- package/dist/hooks/useDidUpdate/useDidUpdate.js +2 -4
- package/dist/hooks/useEventCallback/useEventCallback.js +2 -1
- package/dist/hooks/useEventListener/useEventListener.js +1 -4
- package/dist/hooks/useFocusSequence/useFocusSequence.js +10 -17
- package/dist/hooks/useId/useId.js +1 -2
- package/dist/hooks/useIsFocused/useIsFocused.js +0 -1
- package/dist/hooks/useIsHovered/useIsHovered.js +0 -1
- package/dist/hooks/useIsTruncated/useIsTruncated.js +4 -3
- package/dist/hooks/useLatest/useLatest.js +0 -1
- package/dist/hooks/useMounted/useMounted.js +0 -1
- package/dist/hooks/useMouseDrag/useMouseDrag.js +0 -4
- package/dist/hooks/useOverlay/useOverlay.js +4 -10
- package/dist/hooks/useOverlay/useOverlay2.js +3 -3
- package/dist/hooks/usePrevious/usePrevious.js +0 -1
- package/dist/hooks/useResponsiveValue/useResponsiveValue.js +1 -4
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement.js +11 -16
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement2.js +3 -3
- package/dist/icons/Icon.js +3 -3
- package/dist/icons/components/HeadsetIcon.js +6 -0
- package/dist/icons/components/PauseCircleIcon.js +1 -1
- package/dist/icons/createIconComponent.js +2 -3
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.es.js +1 -0
- package/dist/icons/index.js +2 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.es.js +4 -3
- package/dist/index.js +6 -5
- package/dist/next/AdvancedTable/AdvancedTable.js +82 -188
- package/dist/next/AdvancedTable/AdvancedTable2.js +3 -3
- package/dist/next/AdvancedTable/AdvancedTableCell.js +4 -14
- package/dist/next/AdvancedTable/AdvancedTableCheckbox.js +0 -1
- package/dist/next/AdvancedTable/AdvancedTableColumnHeader.js +11 -41
- package/dist/next/AdvancedTable/AdvancedTableColumnHeaderMenu.js +8 -14
- package/dist/next/AdvancedTable/AdvancedTableDragPreview.js +4 -6
- package/dist/next/AdvancedTable/AdvancedTablePagination.js +1 -4
- package/dist/next/AdvancedTable/AdvancedTableRowExpandButton.js +0 -1
- package/dist/next/AdvancedTable/AdvancedTableTypes.js +1 -3
- package/dist/next/AdvancedTable/useAdvancedTableDragAndDrop.js +8 -13
- package/dist/next/AdvancedTable/useComputedWidth.js +1 -1
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput.js +5 -20
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput2.js +3 -3
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInputIconButton.js +1 -1
- package/dist/next/Combobox/Combobox2.js +3 -3
- package/dist/next/Combobox/ComboboxFlyout.js +3 -3
- package/dist/next/Combobox/ComboboxGroup.js +1 -1
- package/dist/next/Combobox/ComboboxInput.js +7 -20
- package/dist/next/Combobox/ComboboxOption.js +5 -6
- package/dist/next/Combobox/hooks/useComboboxFilteredGroup/useComboboxFilteredGroup.js +4 -5
- package/dist/next/Combobox/hooks/useComboboxFocusSequence/useComboboxFocusSequence.js +37 -54
- package/dist/next/Combobox/hooks/useComboboxLoadingState/useComboboxLoadingState.js +4 -5
- package/dist/next/Combobox/hooks/useComboboxValue/useComboboxValue.js +5 -3
- package/dist/next/Combobox/hooks/useListboxFlyoutDimensions/useListboxFlyoutDimensions.js +10 -10
- package/dist/next/Combobox/hooks/useSelectedOptionScroll/useSelectedOptionScroll.js +1 -6
- package/dist/next/Combobox/hooks/useShouldRenderGroupHeader/useShouldRenderGroupHeader.js +6 -6
- package/dist/next/Combobox/utils/nodeRegistration/nodeRegistration.js +4 -6
- package/dist/next/Drawer/Drawer.js +5 -16
- package/dist/next/Drawer/Drawer2.js +3 -3
- package/dist/next/FilterAnchor/FilterAnchor.js +7 -5
- package/dist/next/FilterAnchor/FilterAnchor2.js +3 -3
- package/dist/next/Input/Input.js +5 -8
- package/dist/next/Input/Input2.js +3 -3
- package/dist/next/Menu/Menu.js +10 -23
- package/dist/next/Menu/Menu2.js +3 -3
- package/dist/next/Menu/MenuButton.js +13 -6
- package/dist/next/Menu/MenuContext.js +0 -2
- package/dist/next/Menu/MenuItem.js +11 -15
- package/dist/next/Menu/MenuPane.js +11 -25
- package/dist/next/Menu/MenuSearch.js +15 -22
- package/dist/next/Menu/SubMenu.js +10 -27
- package/dist/next/Menu/usePaneSearch.js +2 -1
- package/dist/next/PhoneNumberInput/PhoneNumberInput.js +12 -19
- package/dist/next/PhoneNumberInput/PhoneNumberInput2.js +3 -3
- package/dist/next/SplitButton/SplitButton.js +6 -12
- package/dist/next/SplitButton/SplitButton2.js +3 -3
- package/dist/next/Stack/Stack.js +0 -3
- package/dist/next/TimePicker/TimeDropdown.js +4 -5
- package/dist/next/TimePicker/TimeInput.js +4 -5
- package/dist/next/TimePicker/TimePicker.js +12 -30
- package/dist/next/TimePicker/TimePicker2.js +3 -3
- package/dist/next/TimePicker/TimePickerIcon.js +1 -3
- package/dist/next/TimePicker/utils.js +12 -52
- package/dist/next/ToggleButton/ToggleButton.js +0 -5
- package/dist/next/ToggleButton/ToggleButtonGroup.js +2 -1
- package/dist/next/ToggleButton/styles.js +3 -3
- package/dist/next/index.d.ts +5 -4
- package/dist/next/index.js +389 -754
- package/dist/utils/Flyout/Flyout.js +4 -5
- package/dist/utils/Flyout/Flyout2.js +3 -3
- package/dist/utils/Popper/Popper.js +18 -25
- package/dist/utils/Portal/Portal.js +2 -1
- package/dist/utils/TextOverflowTooltip/TextOverflowTooltip.js +4 -4
- package/dist/utils/Translation/Translate.js +0 -4
- package/dist/utils/Translation/TranslationProvider.js +0 -1
- package/dist/utils/Translation/containsComponentOrElement.js +1 -5
- package/dist/utils/Translation/insertPlaceholders.js +0 -1
- package/dist/utils/Translation/useTranslation.js +7 -14
- package/dist/utils/concatIds/concatIds.js +0 -1
- package/dist/utils/constants.js +2 -2
- package/dist/utils/createContextUtilities/createContextUtilities.js +0 -4
- package/dist/utils/filterChildren/filterChildren.js +8 -17
- package/dist/utils/getSubDataTestId/getSubDataTestId.js +1 -2
- package/dist/utils/keyboardUser/keyboardUser.js +0 -1
- package/dist/utils/mediaQueryManager/mediaQueryManager.js +1 -12
- package/dist/utils/mergeRefs/mergeRefs.js +1 -2
- package/dist/utils/wrapAround/wrapAround.js +1 -2
- package/dist/utils/wrapEvent/wrapEvent.js +2 -4
- package/icons/package.json +2 -1
- package/next/package.json +5 -1
- package/package.json +9 -4
|
@@ -23,13 +23,12 @@ const Flyout = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
23
23
|
translate
|
|
24
24
|
} = useTranslation();
|
|
25
25
|
let content;
|
|
26
|
-
|
|
27
26
|
if (isLoading) {
|
|
28
27
|
content = /*#__PURE__*/React__default.createElement("div", {
|
|
29
|
-
id:
|
|
28
|
+
id: `${id}-loading-spinner`
|
|
29
|
+
// eslint-disable-next-line jsx-a11y/role-has-required-aria-props
|
|
30
30
|
,
|
|
31
31
|
role: "option" // `aria-selected` is omitted because this option is not selectable
|
|
32
|
-
|
|
33
32
|
}, /*#__PURE__*/React__default.createElement(LoadingSpinner, {
|
|
34
33
|
"aria-label": translate('loading'),
|
|
35
34
|
className: styles.flyoutSpinner,
|
|
@@ -39,7 +38,6 @@ const Flyout = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
39
38
|
} else {
|
|
40
39
|
content = children;
|
|
41
40
|
}
|
|
42
|
-
|
|
43
41
|
return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
|
44
42
|
id: id,
|
|
45
43
|
className: classNames(className, {
|
|
@@ -49,7 +47,8 @@ const Flyout = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
49
47
|
role: role,
|
|
50
48
|
style: {
|
|
51
49
|
// This logic is located here instead of DropdownList.js/ComboboxList.js so the maxHeight will update with screen resizing (Popper has a resize listener that causes this to rerender)
|
|
52
|
-
maxHeight: Math.min(350,
|
|
50
|
+
maxHeight: Math.min(350,
|
|
51
|
+
// half of window height - flyout popper offset - half of anchor height (fallback to default 18px)
|
|
53
52
|
document.documentElement.clientHeight / 2 - FLYOUT_POPPER_OFFSET[1] - (anchorRef.current ? anchorRef.current.offsetHeight / 2 : 18)),
|
|
54
53
|
...style
|
|
55
54
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"flyout":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._ku2dZ{background-color:#fff;border-radius:4px;border:4px solid transparent;border-right:none;border-left:none;box-shadow:0 0 0 1px #eee,0 8px 20px rgba(0,0,0,.1),0 4px 6px rgba(0,0,0,.05);z-index:1000;max-width:500px;overflow-x:hidden;overflow-y:auto;overflow:hidden auto}._w5670{min-height:40px;padding:10px 12px;display:flex;flex-direction:row;align-items:center;cursor:pointer;font-size:14px;color:#32363a;word-break:break-word;outline:none}._w5670._i-P0x,._w5670._JbQcj._w5670:hover{background-color:#efefef;box-shadow:inset 0 0 0 2px #0a3f88,inset 0 0 0 4px #fff;border-radius:6px}._w5670._j81SI{background-color:#ebf3fb;font-weight:500;font-family:\"72Duplex\",\"72\",\"Helvetica Neue\",Helvetica,Arial,sans-serif}._w5670._j81SI._i-P0x,._w5670._j81SI._JbQcj._w5670._j81SI:hover{background-color:#e4effa}._w5670:active:not(._j81SI):not([aria-disabled=true]){background-color:#e8e9e9}._6kSKW ._NtoCM{min-height:40px;padding:10px 12px;display:flex;flex-direction:row;align-items:center;font-size:12px;color:#32363a;font-weight:700;word-break:break-word}._6kSKW ._47JIY{display:none}._6kSKW:not(:first-child) ._47JIY{display:block;margin:3.5px 0}._A7WfV{width:100%;height:40px}";
|
|
4
|
+
var styles = {"flyout":"_ku2dZ","flyoutOption":"_w5670","highlighted":"_i-P0x","hoverHighlight":"_JbQcj","selected":"_j81SI","flyoutHeader":"_6kSKW","headerContent":"_NtoCM","headerDivider":"_47JIY","flyoutSpinner":"_A7WfV"};
|
|
5
|
+
var stylesheet="._ku2dZ{background-color:#fff;border-radius:4px;border:4px solid transparent;border-right:none;border-left:none;box-shadow:0 0 0 1px #eee,0 8px 20px rgba(0,0,0,.1),0 4px 6px rgba(0,0,0,.05);z-index:1000;max-width:500px;overflow-x:hidden;overflow-y:auto;overflow:hidden auto}._w5670{min-height:40px;padding:10px 12px;display:flex;flex-direction:row;align-items:center;cursor:pointer;font-size:14px;color:#32363a;word-break:break-word;outline:none}._w5670._i-P0x,._w5670._JbQcj._w5670:hover{background-color:#efefef;box-shadow:inset 0 0 0 2px #0a3f88,inset 0 0 0 4px #fff;border-radius:6px}._w5670._j81SI{background-color:#ebf3fb;font-weight:500;font-family:\"72Duplex\",\"72\",\"Helvetica Neue\",Helvetica,Arial,sans-serif}._w5670._j81SI._i-P0x,._w5670._j81SI._JbQcj._w5670._j81SI:hover{background-color:#e4effa}._w5670:active:not(._j81SI):not([aria-disabled=true]){background-color:#e8e9e9}._6kSKW ._NtoCM{min-height:40px;padding:10px 12px;display:flex;flex-direction:row;align-items:center;font-size:12px;color:#32363a;font-weight:700;word-break:break-word}._6kSKW ._47JIY{display:none}._6kSKW:not(:first-child) ._47JIY{display:block;margin:3.5px 0}._A7WfV{width:100%;height:40px}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -10,14 +10,12 @@ import usePopperContext, { PopperContextProvider } from './PopperContext.js';
|
|
|
10
10
|
import mergeRefs from '../mergeRefs/mergeRefs.js';
|
|
11
11
|
import Portal from '../Portal/Portal.js';
|
|
12
12
|
|
|
13
|
-
var _process$env;
|
|
14
|
-
|
|
15
13
|
function useMockedPopper(_, popperElement, _ref) {
|
|
16
14
|
let {
|
|
17
15
|
onFirstUpdate
|
|
18
16
|
} = _ref;
|
|
19
17
|
useEffect(() => {
|
|
20
|
-
onFirstUpdate
|
|
18
|
+
onFirstUpdate?.();
|
|
21
19
|
}, [onFirstUpdate, popperElement]);
|
|
22
20
|
return {
|
|
23
21
|
styles: {
|
|
@@ -29,9 +27,7 @@ function useMockedPopper(_, popperElement, _ref) {
|
|
|
29
27
|
}
|
|
30
28
|
};
|
|
31
29
|
}
|
|
32
|
-
|
|
33
|
-
const usePopper = typeof process !== 'undefined' && ((_process$env = process.env) === null || _process$env === void 0 ? void 0 : _process$env.NODE_ENV) === 'test' ? useMockedPopper : usePopper$1;
|
|
34
|
-
|
|
30
|
+
const usePopper = typeof process !== 'undefined' && process.env?.NODE_ENV === 'test' ? useMockedPopper : usePopper$1;
|
|
35
31
|
function useResizeObserver(_ref2) {
|
|
36
32
|
let {
|
|
37
33
|
element,
|
|
@@ -49,7 +45,6 @@ function useResizeObserver(_ref2) {
|
|
|
49
45
|
}
|
|
50
46
|
}, [handleResize, element, isDisabled]);
|
|
51
47
|
}
|
|
52
|
-
|
|
53
48
|
function useScroll(_ref3) {
|
|
54
49
|
let {
|
|
55
50
|
element,
|
|
@@ -59,14 +54,12 @@ function useScroll(_ref3) {
|
|
|
59
54
|
useEffect(() => {
|
|
60
55
|
if (element && !isDisabled) {
|
|
61
56
|
document.addEventListener('scroll', handleScroll, true); // useCapture needed since scroll events don't bubble to the document
|
|
62
|
-
|
|
63
57
|
return () => {
|
|
64
58
|
document.removeEventListener('scroll', handleScroll, true);
|
|
65
59
|
};
|
|
66
60
|
}
|
|
67
61
|
}, [handleScroll, element, isDisabled]);
|
|
68
62
|
}
|
|
69
|
-
|
|
70
63
|
const Popper = _ref4 => {
|
|
71
64
|
let {
|
|
72
65
|
open = false,
|
|
@@ -115,8 +108,9 @@ const Popper = _ref4 => {
|
|
|
115
108
|
options: {
|
|
116
109
|
padding: 8
|
|
117
110
|
}
|
|
118
|
-
}, ...externalModifiers];
|
|
111
|
+
}, ...externalModifiers];
|
|
119
112
|
|
|
113
|
+
// Must be memoized to avoid infinite loop
|
|
120
114
|
const onFirstUpdate = useCallback(() => {
|
|
121
115
|
setIsReady(true);
|
|
122
116
|
}, [setIsReady]);
|
|
@@ -130,17 +124,19 @@ const Popper = _ref4 => {
|
|
|
130
124
|
onFirstUpdate
|
|
131
125
|
});
|
|
132
126
|
const handleUpdate = useCallback(() => {
|
|
133
|
-
update
|
|
134
|
-
}, [update]);
|
|
135
|
-
// See CFE-1295
|
|
127
|
+
update?.();
|
|
128
|
+
}, [update]);
|
|
136
129
|
|
|
130
|
+
// Tell popper.js to update the positioning when the popper element changes size since it only listens for window resizing out of the box.
|
|
131
|
+
// See CFE-1295
|
|
137
132
|
useResizeObserver({
|
|
138
133
|
element: popperNode,
|
|
139
134
|
handleResize: handleUpdate,
|
|
140
135
|
isDisabled: !isReady
|
|
141
|
-
});
|
|
142
|
-
// Needed due to https://github.com/floating-ui/floating-ui/issues/1267. See CFE-843
|
|
136
|
+
});
|
|
143
137
|
|
|
138
|
+
// Tell popper.js to update the positioning when a scroll event occurs
|
|
139
|
+
// Needed due to https://github.com/floating-ui/floating-ui/issues/1267. See CFE-843
|
|
144
140
|
useScroll({
|
|
145
141
|
element: popperNode,
|
|
146
142
|
handleScroll: handleUpdate,
|
|
@@ -149,22 +145,19 @@ const Popper = _ref4 => {
|
|
|
149
145
|
const {
|
|
150
146
|
isParentAnchorHidden
|
|
151
147
|
} = usePopperContext();
|
|
148
|
+
|
|
152
149
|
/*
|
|
153
150
|
* If the parent anchor is hidden via CSS opacity, Popper will not consider it to be hidden.
|
|
154
151
|
* To get around this issue, we set `data-popper-reference-hidden` to `true` for all child Popper elements if any ancestor Popper has `data-popper-reference-hidden` set to `true`.
|
|
155
152
|
*/
|
|
156
|
-
|
|
157
|
-
const isAnchorHidden = useMemo(() => {
|
|
158
|
-
var _attributes$popper;
|
|
159
|
-
|
|
160
|
-
return isParentAnchorHidden || !!(attributes !== null && attributes !== void 0 && (_attributes$popper = attributes.popper) !== null && _attributes$popper !== void 0 && _attributes$popper['data-popper-reference-hidden']);
|
|
161
|
-
}, [isParentAnchorHidden, attributes]);
|
|
153
|
+
const isAnchorHidden = useMemo(() => isParentAnchorHidden || !!attributes?.popper?.['data-popper-reference-hidden'], [isParentAnchorHidden, attributes]);
|
|
162
154
|
const context = useMemo(() => ({
|
|
163
155
|
isParentAnchorHidden: isAnchorHidden
|
|
164
156
|
}), [isAnchorHidden]);
|
|
165
157
|
const popperElementWithArrow = /*#__PURE__*/React__default.cloneElement(popperElement, {
|
|
166
158
|
ref: mergeRefs(setPopperNode, popperElement.ref),
|
|
167
|
-
style: {
|
|
159
|
+
style: {
|
|
160
|
+
...styles.popper,
|
|
168
161
|
...popperElement.props.style
|
|
169
162
|
},
|
|
170
163
|
...attributes.popper,
|
|
@@ -174,7 +167,8 @@ const Popper = _ref4 => {
|
|
|
174
167
|
key: 'arrow',
|
|
175
168
|
'aria-hidden': true,
|
|
176
169
|
ref: mergeRefs(setArrowNode, arrowElement.ref),
|
|
177
|
-
style: {
|
|
170
|
+
style: {
|
|
171
|
+
...styles.arrow,
|
|
178
172
|
...arrowElement.props.style
|
|
179
173
|
}
|
|
180
174
|
})] : popperElement.props.children
|
|
@@ -186,8 +180,7 @@ const Popper = _ref4 => {
|
|
|
186
180
|
}, /*#__PURE__*/React__default.createElement(Portal, {
|
|
187
181
|
portalTarget: portalTarget
|
|
188
182
|
}, open ? isFocusLocked ? /*#__PURE__*/React__default.createElement(ReactFocusLock, _extends({}, focusLockProps, {
|
|
189
|
-
disabled: isReady ? focusLockProps
|
|
190
|
-
|
|
183
|
+
disabled: isReady ? focusLockProps?.disabled : true // Prevents unintended page scroll when popper element is not yet positioned
|
|
191
184
|
}), popperElementWithArrow) : popperElementWithArrow : null)));
|
|
192
185
|
};
|
|
193
186
|
|
|
@@ -17,8 +17,9 @@ const Portal = _ref => {
|
|
|
17
17
|
return () => {
|
|
18
18
|
target.removeChild(element);
|
|
19
19
|
};
|
|
20
|
-
}, [portalTarget, globalPortalTarget]);
|
|
20
|
+
}, [portalTarget, globalPortalTarget]);
|
|
21
21
|
|
|
22
|
+
// only render children once parent has been appended to DOM
|
|
22
23
|
return container ? /*#__PURE__*/ReactDOM.createPortal(children, container) : null;
|
|
23
24
|
};
|
|
24
25
|
|
|
@@ -18,8 +18,6 @@ import Tooltip from '../../components/Tooltip/Tooltip.js';
|
|
|
18
18
|
* Displays a tooltip containing the overflowing text if the text does not fit inside the bounds of its container.
|
|
19
19
|
*/
|
|
20
20
|
const TextOverflowTooltip = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
21
|
-
var _textParentHTMLElemen;
|
|
22
|
-
|
|
23
21
|
let {
|
|
24
22
|
lightTheme = false,
|
|
25
23
|
delayMs = 500,
|
|
@@ -29,15 +27,17 @@ const TextOverflowTooltip = /*#__PURE__*/React__default.forwardRef((_ref, ref) =
|
|
|
29
27
|
const textParentHTMLElementRef = useRef(null);
|
|
30
28
|
const textParentReactElement = /*#__PURE__*/cloneElement(children, {
|
|
31
29
|
ref: mergeRefs(children.ref, textParentHTMLElementRef)
|
|
32
|
-
});
|
|
30
|
+
});
|
|
33
31
|
|
|
32
|
+
// Updates the disabled state whevever the text parent element changes
|
|
34
33
|
useEffect(() => {
|
|
35
34
|
const textParentHTMLElement = textParentHTMLElementRef.current;
|
|
36
35
|
setIsTextOverflowing(textParentHTMLElement ? textParentHTMLElement.scrollWidth > textParentHTMLElement.clientWidth : false);
|
|
37
36
|
}, [textParentReactElement // Any time the React child changes, its width needs to be checked via its ref
|
|
38
37
|
]);
|
|
38
|
+
|
|
39
39
|
return /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
40
|
-
content:
|
|
40
|
+
content: textParentHTMLElementRef.current?.textContent,
|
|
41
41
|
disabled: !isTextOverflowing,
|
|
42
42
|
lightTheme: lightTheme,
|
|
43
43
|
delayMs: delayMs,
|
|
@@ -52,17 +52,13 @@ const Translate = _ref => {
|
|
|
52
52
|
translate
|
|
53
53
|
} = useTranslation();
|
|
54
54
|
const text = translate(messageKey);
|
|
55
|
-
|
|
56
55
|
if (placeholders) {
|
|
57
56
|
const compiledMessage = insertPlaceholders(text, placeholders);
|
|
58
|
-
|
|
59
57
|
if (containsComponentOrElement(placeholders)) {
|
|
60
58
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, insertPlaceholders(text, placeholders));
|
|
61
59
|
}
|
|
62
|
-
|
|
63
60
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, compiledMessage.join(''));
|
|
64
61
|
}
|
|
65
|
-
|
|
66
62
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, text);
|
|
67
63
|
};
|
|
68
64
|
|
|
@@ -4,23 +4,19 @@ import { isValidElement } from 'react';
|
|
|
4
4
|
function isClassComponent(component) {
|
|
5
5
|
return !!(typeof component === 'function' && !!component.prototype.isReactComponent);
|
|
6
6
|
}
|
|
7
|
-
|
|
8
7
|
function isFunctionComponent(component) {
|
|
9
8
|
var _context;
|
|
10
|
-
|
|
11
9
|
return !!(typeof component === 'function' && _includesInstanceProperty(_context = String(component)).call(_context, 'return React.createElement'));
|
|
12
10
|
}
|
|
13
|
-
|
|
14
11
|
function isReactComponent(component) {
|
|
15
12
|
return !!(isClassComponent(component) || isFunctionComponent(component));
|
|
16
13
|
}
|
|
14
|
+
|
|
17
15
|
/**
|
|
18
16
|
* Indicates if one or more translation placeholders are a React component or element.
|
|
19
17
|
* @param placeholders - The translation string placeholders.
|
|
20
18
|
* @returns - True if at least one placeholder is a React component or element; otherwise false.
|
|
21
19
|
*/
|
|
22
|
-
|
|
23
|
-
|
|
24
20
|
function containsComponentOrElement(placeholders) {
|
|
25
21
|
return Object.keys(placeholders).some(key => isReactComponent(placeholders[key]) || /*#__PURE__*/isValidElement(placeholders[key]));
|
|
26
22
|
}
|
|
@@ -4,51 +4,44 @@ import insertPlaceholders from './insertPlaceholders.js';
|
|
|
4
4
|
import containsComponentOrElement from './containsComponentOrElement.js';
|
|
5
5
|
|
|
6
6
|
/* eslint-disable babel/no-unused-expressions */
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const NO_LOCALIZED_OR_FALLBACK_TEXT_FOR_KEY = key => "There is no localized or fallback text for KEY: ".concat(key, ". \n Please refer to https://designsystem.qualtrics.com/localization for more information about localizing Qualtrics ui-react components");
|
|
11
|
-
|
|
7
|
+
const NO_LOCALIZED_TEXT_FOR_KEY = key => `There is no localized text for KEY: ${key}. Defaulting to fallback text`;
|
|
8
|
+
const NO_LOCALIZED_OR_FALLBACK_TEXT_FOR_KEY = key => `There is no localized or fallback text for KEY: ${key}.
|
|
9
|
+
Please refer to https://designsystem.qualtrics.com/localization for more information about localizing Qualtrics ui-react components`;
|
|
12
10
|
const USETRANSLATION_PLACEHOLDER_CONTAINS_ELEMENT = 'The useTranslation function cannot include React elements as placeholders.';
|
|
13
11
|
const HAS_ERROR_BEEN_LOGGED_FOR_KEY = new Set();
|
|
12
|
+
|
|
14
13
|
/**
|
|
15
14
|
* Returns a translate function.
|
|
16
15
|
* @returns A translate function.
|
|
17
16
|
*/
|
|
18
|
-
|
|
19
17
|
const useTranslation = () => {
|
|
20
18
|
const {
|
|
21
19
|
localizedText
|
|
22
20
|
} = useTranslationContext();
|
|
21
|
+
|
|
23
22
|
/**
|
|
24
23
|
* Returns a translated string given a key and placeholders.
|
|
25
24
|
* @param key - The key of the translated string.
|
|
26
25
|
* @param placeholders - A map of parameters to replace in the translated string. The string is searched for each key in the map wrapped by {{}} and then replaced with the corresponding value. *Placeholders can't be components. To use a component placeholder, use the `Translate` component.*
|
|
27
26
|
* @returns The translated string if found; otherwise `##${translation-key}##`.
|
|
28
27
|
*/
|
|
29
|
-
|
|
30
28
|
const translate = useCallback((key, placeholders) => {
|
|
31
|
-
const translatedText = localizedText
|
|
29
|
+
const translatedText = localizedText?.[key];
|
|
32
30
|
const fallbackText = fallbackLocalizedText[key];
|
|
33
|
-
|
|
34
31
|
if (!translatedText && !HAS_ERROR_BEEN_LOGGED_FOR_KEY.has(key)) {
|
|
35
32
|
HAS_ERROR_BEEN_LOGGED_FOR_KEY.add(key);
|
|
36
33
|
fallbackText ? console.warn(NO_LOCALIZED_TEXT_FOR_KEY(key)) : console.warn(NO_LOCALIZED_OR_FALLBACK_TEXT_FOR_KEY(key));
|
|
37
34
|
}
|
|
38
|
-
|
|
39
35
|
const text = translatedText || fallbackText;
|
|
40
|
-
|
|
41
36
|
if (text && placeholders) {
|
|
42
37
|
if (containsComponentOrElement(placeholders)) {
|
|
43
38
|
console.warn(USETRANSLATION_PLACEHOLDER_CONTAINS_ELEMENT);
|
|
44
39
|
return '';
|
|
45
40
|
}
|
|
46
|
-
|
|
47
41
|
const compiledMessage = insertPlaceholders(text, placeholders);
|
|
48
42
|
return compiledMessage.join('');
|
|
49
43
|
}
|
|
50
|
-
|
|
51
|
-
return text || "##".concat(key, "##");
|
|
44
|
+
return text || `##${key}##`;
|
|
52
45
|
}, [localizedText]);
|
|
53
46
|
return {
|
|
54
47
|
translate
|
package/dist/utils/constants.js
CHANGED
|
@@ -9,13 +9,13 @@ const DEFAULT_BREAKPOINTS = {
|
|
|
9
9
|
lg: 64,
|
|
10
10
|
// 1024px
|
|
11
11
|
xl: 90 // 1440px
|
|
12
|
-
|
|
13
12
|
};
|
|
13
|
+
|
|
14
14
|
const POPPER_PLACEMENTS = ['top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-start', 'bottom', 'bottom-end', 'left-start', 'left', 'left-end'];
|
|
15
|
+
|
|
15
16
|
/* Popper offset documentation: https://popper.js.org/docs/v2/modifiers/offset/
|
|
16
17
|
* Reminder that the 'placement' prop influences the direction of skidding and distance
|
|
17
18
|
*/
|
|
18
|
-
|
|
19
19
|
const SUBMENU_POPPER_OFFSET = [0, 0];
|
|
20
20
|
const FLYOUT_POPPER_OFFSET = [0, 6];
|
|
21
21
|
const TOOLTIP_POPPER_OFFSET = [0, 12]; // Distance of 12 is 6px for the half of the arrow's hypotenuse + 6px for the actual distance
|
|
@@ -2,17 +2,13 @@ import { createContext, useContext } from 'react';
|
|
|
2
2
|
|
|
3
3
|
function createContextUtilities(defaultValue) {
|
|
4
4
|
const context = /*#__PURE__*/createContext(defaultValue);
|
|
5
|
-
|
|
6
5
|
const useContextWrapper = () => {
|
|
7
6
|
const value = useContext(context);
|
|
8
|
-
|
|
9
7
|
if (value === undefined) {
|
|
10
8
|
throw new Error('useContext must be called inside a provider or be initialized with a default value');
|
|
11
9
|
}
|
|
12
|
-
|
|
13
10
|
return value;
|
|
14
11
|
};
|
|
15
|
-
|
|
16
12
|
return {
|
|
17
13
|
Provider: context.Provider,
|
|
18
14
|
// asserting so `undefined` can't be passed to provider
|
|
@@ -1,57 +1,48 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
2
|
|
|
3
3
|
/* eslint-disable no-underscore-dangle */
|
|
4
|
-
|
|
5
4
|
function _filterChildren(children) {
|
|
6
5
|
let queries = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
7
6
|
let matchesList = arguments.length > 2 ? arguments[2] : undefined;
|
|
8
|
-
|
|
9
7
|
// TODO: Add `React.isValidElement` check here and then update types in helper functions to be `ReactElement` instead of `ReactNode`. This likely will require some sort of change in `Combobox` v1.
|
|
8
|
+
|
|
10
9
|
// Single ReactChild
|
|
11
10
|
if (React__default.Children.count(children) === 1 && !Array.isArray(children)) {
|
|
12
11
|
return _findMatch(children, queries, matchesList);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
}
|
|
13
|
+
// Array of ReactChild
|
|
16
14
|
return React__default.Children.map(children, child => _findMatch(child, queries, matchesList));
|
|
17
|
-
}
|
|
18
|
-
|
|
15
|
+
}
|
|
19
16
|
|
|
17
|
+
// Returns ReactChild
|
|
20
18
|
function _findMatch(child, queries, matchesList) {
|
|
21
|
-
var _newChild, _newChild$props;
|
|
22
|
-
|
|
23
19
|
let newChild = child;
|
|
24
20
|
let foundMatch = false;
|
|
25
21
|
let i;
|
|
26
|
-
|
|
27
22
|
for (i = 0; i < queries.length; i += 1) {
|
|
28
23
|
const {
|
|
29
24
|
matcher,
|
|
30
25
|
modifier = c => c
|
|
31
26
|
} = queries[i];
|
|
32
|
-
|
|
33
27
|
if (matcher(child)) {
|
|
34
28
|
newChild = modifier(child, matchesList[i].length, matchesList);
|
|
35
29
|
foundMatch = true;
|
|
36
30
|
break;
|
|
37
31
|
}
|
|
38
32
|
}
|
|
39
|
-
|
|
40
|
-
if ((_newChild = newChild) !== null && _newChild !== void 0 && (_newChild$props = _newChild.props) !== null && _newChild$props !== void 0 && _newChild$props.children) {
|
|
33
|
+
if (newChild?.props?.children) {
|
|
41
34
|
const modifiedChildren = _filterChildren(newChild.props.children, queries, matchesList);
|
|
42
|
-
|
|
43
35
|
newChild = /*#__PURE__*/React__default.cloneElement(newChild, {
|
|
44
36
|
children: modifiedChildren
|
|
45
37
|
});
|
|
46
38
|
}
|
|
47
|
-
|
|
48
39
|
if (foundMatch && newChild) {
|
|
49
40
|
matchesList[i].push(newChild);
|
|
50
41
|
}
|
|
51
|
-
|
|
52
42
|
return newChild;
|
|
53
|
-
}
|
|
43
|
+
}
|
|
54
44
|
|
|
45
|
+
// [ReactNode[], ReactNode[][]]
|
|
55
46
|
|
|
56
47
|
function filterChildren(children, queries) {
|
|
57
48
|
const matchesList = queries.map(() => []);
|
|
@@ -1,40 +1,31 @@
|
|
|
1
1
|
const map = new Map();
|
|
2
|
-
|
|
3
2
|
function noop() {}
|
|
4
|
-
|
|
5
3
|
function subscribe(query, callback) {
|
|
6
4
|
if (typeof document === 'undefined') {
|
|
7
5
|
// don't do anything when Server Side Rendering
|
|
8
6
|
return noop;
|
|
9
7
|
}
|
|
10
|
-
|
|
11
8
|
if (!map.has(query)) {
|
|
12
9
|
const subscribers = new Set();
|
|
13
|
-
|
|
14
10
|
const globalListener = event => {
|
|
15
11
|
subscribers.forEach(cb => cb(event));
|
|
16
12
|
};
|
|
17
|
-
|
|
18
13
|
const mediaQueryList = window.matchMedia(query);
|
|
19
|
-
|
|
20
14
|
if (mediaQueryList.addListener) {
|
|
21
15
|
mediaQueryList.addListener(globalListener);
|
|
22
16
|
} else {
|
|
23
17
|
mediaQueryList.addEventListener('change', globalListener);
|
|
24
18
|
}
|
|
25
|
-
|
|
26
19
|
map.set(query, {
|
|
27
20
|
mediaQueryList,
|
|
28
21
|
globalListener,
|
|
29
22
|
subscribers
|
|
30
23
|
});
|
|
31
24
|
}
|
|
32
|
-
|
|
33
25
|
const entry = map.get(query);
|
|
34
|
-
entry
|
|
26
|
+
entry?.subscribers.add(callback);
|
|
35
27
|
return entry ? function unsubscribe() {
|
|
36
28
|
entry.subscribers.delete(callback);
|
|
37
|
-
|
|
38
29
|
if (entry.subscribers.size === 0) {
|
|
39
30
|
// if there are no more subscribers
|
|
40
31
|
if (entry.mediaQueryList.removeListener) {
|
|
@@ -42,7 +33,6 @@ function subscribe(query, callback) {
|
|
|
42
33
|
} else {
|
|
43
34
|
entry.mediaQueryList.removeEventListener('change', entry.globalListener);
|
|
44
35
|
}
|
|
45
|
-
|
|
46
36
|
map.delete(query);
|
|
47
37
|
}
|
|
48
38
|
} : noop;
|
|
@@ -52,7 +42,6 @@ function getMediaQueryValue(query) {
|
|
|
52
42
|
// default to false when Server Side Rendering
|
|
53
43
|
return false;
|
|
54
44
|
}
|
|
55
|
-
|
|
56
45
|
return window.matchMedia(query).matches;
|
|
57
46
|
}
|
|
58
47
|
|
|
@@ -8,7 +8,6 @@ function mergeRefs() {
|
|
|
8
8
|
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
9
9
|
refs[_key] = arguments[_key];
|
|
10
10
|
}
|
|
11
|
-
|
|
12
11
|
return value => {
|
|
13
12
|
refs.forEach(ref => {
|
|
14
13
|
if (typeof ref === 'function') {
|
|
@@ -18,7 +17,7 @@ function mergeRefs() {
|
|
|
18
17
|
try {
|
|
19
18
|
ref.current = value;
|
|
20
19
|
} catch (error) {
|
|
21
|
-
throw new Error(
|
|
20
|
+
throw new Error(`Cannot assign value "${value}" to ref "${ref}": ${error}`);
|
|
22
21
|
}
|
|
23
22
|
}
|
|
24
23
|
});
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
function mod(a, n) {
|
|
9
9
|
return (a % n + n) % n;
|
|
10
10
|
}
|
|
11
|
+
|
|
11
12
|
/**
|
|
12
13
|
* Restricts a number between [`min`, `max`] by wrapping it around the range.
|
|
13
14
|
* @param value - The current number.
|
|
@@ -15,8 +16,6 @@ function mod(a, n) {
|
|
|
15
16
|
* @param max - The maximum number.
|
|
16
17
|
* @returns - A number within the range [`min`, `max`] that corresponds to the provided `value`.
|
|
17
18
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
19
|
function wrapAround(value, min, max) {
|
|
21
20
|
return min + mod(value - min, max + 1 - min);
|
|
22
21
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/* eslint-disable consistent-return */
|
|
2
|
-
|
|
3
2
|
/* eslint-disable babel/no-unused-expressions */
|
|
4
3
|
|
|
5
4
|
/**
|
|
@@ -9,10 +8,9 @@
|
|
|
9
8
|
*/
|
|
10
9
|
function wrapEvent(theirHandler, ourHandler) {
|
|
11
10
|
return event => {
|
|
12
|
-
theirHandler
|
|
13
|
-
|
|
11
|
+
theirHandler?.(event);
|
|
14
12
|
if (!event.defaultPrevented) {
|
|
15
|
-
return ourHandler
|
|
13
|
+
return ourHandler?.(event);
|
|
16
14
|
}
|
|
17
15
|
};
|
|
18
16
|
}
|
package/icons/package.json
CHANGED
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@babel/runtime-corejs3": "^7.10.2",
|
|
7
7
|
"@popperjs/core": "^2.10.2",
|
|
8
|
-
"@qualtrics/component-styles": "0.141.
|
|
8
|
+
"@qualtrics/component-styles": "0.141.2",
|
|
9
9
|
"@radix-ui/react-dropdown-menu": "2.0.5",
|
|
10
10
|
"@react-hook/resize-observer": "^1.2.6",
|
|
11
|
+
"@vanilla-extract/css": "^1.9.1",
|
|
11
12
|
"classnames": "^2.2.6",
|
|
12
13
|
"core-js": "^3.6.5",
|
|
13
14
|
"libphonenumber-js": "^1.9.50",
|
package/next/package.json
CHANGED
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@babel/runtime-corejs3": "^7.10.2",
|
|
7
7
|
"@popperjs/core": "^2.10.2",
|
|
8
|
-
"@qualtrics/component-styles": "0.141.
|
|
8
|
+
"@qualtrics/component-styles": "0.141.2",
|
|
9
9
|
"@radix-ui/react-dropdown-menu": "2.0.5",
|
|
10
10
|
"@react-hook/resize-observer": "^1.2.6",
|
|
11
|
+
"@vanilla-extract/css": "^1.9.1",
|
|
11
12
|
"classnames": "^2.2.6",
|
|
12
13
|
"core-js": "^3.6.5",
|
|
13
14
|
"libphonenumber-js": "^1.9.50",
|
|
@@ -18,5 +19,8 @@
|
|
|
18
19
|
"react-popper": "^2.2.4",
|
|
19
20
|
"throttle-debounce": "^2.1.0",
|
|
20
21
|
"uuid": "^8.3.2"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"@qualtrics/ui-react": "2.20.0"
|
|
21
25
|
}
|
|
22
26
|
}
|