@qualtrics/ui-react 2.18.0 → 2.19.1

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 (267) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/__shared/cjs/{index-00992312.js → index-384184bd.js} +994 -1872
  3. package/dist/__shared/cjs/{index-615ed9b2.js → index-4a5425cc.js} +10 -7
  4. package/dist/components/Accordion/Accordion.js +1 -5
  5. package/dist/components/Accordion/Accordion2.js +3 -3
  6. package/dist/components/Accordion/AccordionHeader.js +4 -8
  7. package/dist/components/Accordion/AccordionPanel.js +3 -3
  8. package/dist/components/BreakpointSwitch/Breakpoint.js +0 -2
  9. package/dist/components/BreakpointSwitch/BreakpointSwitch.js +0 -3
  10. package/dist/components/Button/Button.js +3 -3
  11. package/dist/components/Button/Button2.js +2 -7
  12. package/dist/components/ButtonGroup/ButtonGroup.js +1 -2
  13. package/dist/components/ButtonGroup/ButtonGroup2.js +3 -3
  14. package/dist/components/Checkbox/Checkbox.js +11 -11
  15. package/dist/components/Checkbox/Checkbox2.js +3 -3
  16. package/dist/components/Checkbox/VisualCheckbox.js +1 -1
  17. package/dist/components/Checkbox/VisualCheckbox2.js +3 -3
  18. package/dist/components/ColorPicker/Alpha.js +9 -30
  19. package/dist/components/ColorPicker/ColorPicker.js +33 -42
  20. package/dist/components/ColorPicker/ColorPicker2.js +3 -3
  21. package/dist/components/ColorPicker/ColorPickerFlyout.js +2 -1
  22. package/dist/components/ColorPicker/ColorPickerFlyoutInputs.js +20 -23
  23. package/dist/components/ColorPicker/Hue.js +2 -19
  24. package/dist/components/ColorPicker/Palette.js +7 -27
  25. package/dist/components/ColorPicker/Saturation.js +8 -29
  26. package/dist/components/ColorPicker/utils/calculateTargetId.js +10 -20
  27. package/dist/components/ColorPicker/utils/getMousePosition.js +4 -3
  28. package/dist/components/ColorPicker/utils/hexToHsv.js +0 -5
  29. package/dist/components/ColorPicker/utils/hexToRgbaString.js +2 -4
  30. package/dist/components/ColorPicker/utils/hsvToHex.js +0 -3
  31. package/dist/components/ColorPicker/utils/rgbToHex.js +1 -1
  32. package/dist/components/ColorPicker/utils/validateHex.js +12 -19
  33. package/dist/components/Combobox/Combobox.js +57 -127
  34. package/dist/components/Combobox/Combobox2.js +3 -3
  35. package/dist/components/Combobox/ComboboxHeader.js +1 -1
  36. package/dist/components/Combobox/ComboboxIcon.js +2 -4
  37. package/dist/components/Combobox/ComboboxInput.js +4 -5
  38. package/dist/components/Combobox/ComboboxList.js +2 -2
  39. package/dist/components/ConfigPane/ConfigPane.js +0 -7
  40. package/dist/components/ConfigPane/ConfigPane2.js +3 -3
  41. package/dist/components/Divider/Divider2.js +3 -3
  42. package/dist/components/Dropdown/ChildIndexContext/index.js +0 -1
  43. package/dist/components/Dropdown/ChildIndexContext/reach-descendants.js +34 -30
  44. package/dist/components/Dropdown/Dropdown.js +17 -68
  45. package/dist/components/Dropdown/Dropdown2.js +3 -3
  46. package/dist/components/Dropdown/DropdownButton.js +23 -33
  47. package/dist/components/Dropdown/DropdownHeader.js +2 -1
  48. package/dist/components/Dropdown/DropdownList.js +8 -7
  49. package/dist/components/Dropdown/DropdownOption.js +3 -10
  50. package/dist/components/Dropdown/DropdownSearch.js +6 -24
  51. package/dist/components/FilePicker/FilePicker.js +15 -26
  52. package/dist/components/FilePicker/FilePicker2.js +3 -3
  53. package/dist/components/FormField/Caption.js +3 -3
  54. package/dist/components/FormField/FormField.js +2 -2
  55. package/dist/components/FormField/FormField2.js +3 -3
  56. package/dist/components/FormField/FormFieldContext.js +3 -6
  57. package/dist/components/FormField/ReadOnlyText.js +2 -1
  58. package/dist/components/FullScreenTakeover/FullScreenTakeover.js +5 -11
  59. package/dist/components/FullScreenTakeover/FullScreenTakeover2.js +3 -3
  60. package/dist/components/Icon/Icon.js +3 -6
  61. package/dist/components/Icon/IconTypes.js +1 -0
  62. package/dist/components/IconButton/IconButton.js +1 -6
  63. package/dist/components/IconButton/IconButton2.js +3 -3
  64. package/dist/components/InlineInput/InlineInput.js +16 -33
  65. package/dist/components/InlineInput/InlineInput2.js +3 -3
  66. package/dist/components/Input/Input.js +3 -2
  67. package/dist/components/Input/Input2.js +3 -3
  68. package/dist/components/Input/InputField.js +2 -5
  69. package/dist/components/InputGroup/InputGroup2.js +3 -3
  70. package/dist/components/InputGroup/InputGroupProvider.js +0 -2
  71. package/dist/components/Label/Label2.js +3 -3
  72. package/dist/components/Link/Link2.js +3 -3
  73. package/dist/components/LoadingSpinner/LoadingSpinner.js +1 -1
  74. package/dist/components/LoadingSpinner/LoadingSpinner2.js +3 -3
  75. package/dist/components/LogicEditor/ConditionContainer.js +0 -2
  76. package/dist/components/LogicEditor/ConditionSet.js +8 -25
  77. package/dist/components/LogicEditor/Controls.js +2 -2
  78. package/dist/components/LogicEditor/LogicEditor.js +3 -12
  79. package/dist/components/LogicEditor/LogicEditor2.js +3 -3
  80. package/dist/components/LogicEditor/utils.js +9 -34
  81. package/dist/components/Modal/Modal.js +22 -35
  82. package/dist/components/Modal/Modal2.js +3 -3
  83. package/dist/components/NewMenu/BaseMenu.js +43 -108
  84. package/dist/components/NewMenu/NewMenu.js +3 -3
  85. package/dist/components/NewMenu/SelectMenu/SelectMenu.js +2 -3
  86. package/dist/components/NewMenu/parts/ArrowNav/ArrowNav.js +20 -32
  87. package/dist/components/NewMenu/parts/MenuItem.js +2 -3
  88. package/dist/components/NewMenu/parts/MenuSearchBox.js +2 -1
  89. package/dist/components/NumberStepper/NumberStepper.js +29 -44
  90. package/dist/components/NumberStepper/NumberStepper2.js +3 -3
  91. package/dist/components/NumberStepper/NumberStepperDecrement.js +6 -5
  92. package/dist/components/NumberStepper/NumberStepperIncrement.js +6 -5
  93. package/dist/components/NumberStepper/NumberStepperInput.js +10 -12
  94. package/dist/components/PageLayout/PageLayout.js +3 -3
  95. package/dist/components/Pagination/Pagination.js +10 -6
  96. package/dist/components/Pagination/Pagination2.js +3 -3
  97. package/dist/components/Pagination/PaginationNextButton.js +8 -8
  98. package/dist/components/Pagination/PaginationPageInput.js +17 -22
  99. package/dist/components/Pagination/PaginationPreviousButton.js +8 -8
  100. package/dist/components/Popover/Popover.js +9 -18
  101. package/dist/components/Popover/Popover2.js +3 -3
  102. package/dist/components/QuickSearch/QuickSearch.js +3 -5
  103. package/dist/components/QuickSearch/QuickSearch2.js +3 -3
  104. package/dist/components/QuickSearch/QuickSearchInput.js +6 -23
  105. package/dist/components/Radio/Radio.js +11 -13
  106. package/dist/components/Radio/Radio2.js +3 -3
  107. package/dist/components/SearchInput/SearchInput.js +5 -11
  108. package/dist/components/SearchInput/SearchInput2.js +3 -3
  109. package/dist/components/SidebarNav/ExpandCollapseButton.js +0 -2
  110. package/dist/components/SidebarNav/SidebarNav.js +5 -4
  111. package/dist/components/SidebarNav/SidebarNav2.js +3 -3
  112. package/dist/components/SidebarNav/SidebarNavLink.js +1 -4
  113. package/dist/components/Slider/RangeSlider.js +8 -22
  114. package/dist/components/Slider/Slider.js +7 -26
  115. package/dist/components/Slider/Slider2.js +3 -3
  116. package/dist/components/Slider/SliderButton.js +7 -9
  117. package/dist/components/Switch/Switch.js +11 -11
  118. package/dist/components/Switch/Switch2.js +3 -3
  119. package/dist/components/Table/Table2.js +3 -3
  120. package/dist/components/Tabs/Tab.js +3 -3
  121. package/dist/components/Tabs/TabContextProvider.js +1 -1
  122. package/dist/components/Tabs/TabList.js +9 -17
  123. package/dist/components/Tabs/TabPanel.js +3 -3
  124. package/dist/components/Tabs/TabPanels.js +0 -2
  125. package/dist/components/Tabs/Tabs2.js +3 -3
  126. package/dist/components/Tooltip/Tooltip.js +12 -41
  127. package/dist/components/Tooltip/Tooltip2.js +3 -3
  128. package/dist/components/UIProvider/PortalTargetContext.js +0 -1
  129. package/dist/components/UIProvider/UIProvider.js +2 -2
  130. package/dist/components/deprecated_ColorPicker/Alpha.js +4 -11
  131. package/dist/components/deprecated_ColorPicker/Color.js +9 -66
  132. package/dist/components/deprecated_ColorPicker/ColorPicker.js +2 -8
  133. package/dist/components/deprecated_ColorPicker/ColorPicker2.js +3 -3
  134. package/dist/components/deprecated_ColorPicker/HexInput.js +1 -7
  135. package/dist/components/deprecated_ColorPicker/Hue.js +3 -10
  136. package/dist/components/deprecated_ColorPicker/Saturation.js +7 -14
  137. package/dist/components/deprecated_ColorPicker/Swatch.js +2 -6
  138. package/dist/components/deprecated_ColorPicker/useMouseDrag.js +0 -3
  139. package/dist/components/deprecated_NumberStepper/NumberStepper.js +14 -20
  140. package/dist/components/deprecated_NumberStepper/NumberStepper2.js +3 -3
  141. package/dist/components/deprecated_NumberStepper/NumberStepperDecrement.js +7 -6
  142. package/dist/components/deprecated_NumberStepper/NumberStepperIncrement.js +7 -6
  143. package/dist/components/deprecated_NumberStepper/NumberStepperInput.js +16 -17
  144. package/dist/components/deprecated_Tabs/Tabs.js +9 -25
  145. package/dist/components/deprecated_Tabs/Tabs2.js +3 -3
  146. package/dist/components/deprecated_Toolbar/Toolbar2.js +3 -3
  147. package/dist/components/deprecated_Toolbar/ToolbarPanel.js +3 -3
  148. package/dist/components/deprecated_Toolbar/ToolbarPanels.js +3 -17
  149. package/dist/components/deprecated_Toolbar/ToolbarTab.js +10 -26
  150. package/dist/components/deprecated_Toolbar/ToolbarTabs.js +6 -18
  151. package/dist/hooks/useBreakpoints/useBreakpoints.js +3 -4
  152. package/dist/hooks/useClickOutside/useClickOutside.js +2 -7
  153. package/dist/hooks/useClickOutsidePortals/useClickOutsidePortals.js +3 -6
  154. package/dist/hooks/useControllableState/useControllableState.js +5 -10
  155. package/dist/hooks/useDidUpdate/useDidUpdate.js +2 -4
  156. package/dist/hooks/useEventCallback/useEventCallback.js +2 -1
  157. package/dist/hooks/useEventListener/useEventListener.js +1 -4
  158. package/dist/hooks/useFocusSequence/useFocusSequence.js +10 -17
  159. package/dist/hooks/useId/useId.js +1 -2
  160. package/dist/hooks/useIsFocused/useIsFocused.js +0 -1
  161. package/dist/hooks/useIsHovered/useIsHovered.js +0 -1
  162. package/dist/hooks/useIsTruncated/useIsTruncated.js +4 -3
  163. package/dist/hooks/useLatest/useLatest.js +0 -1
  164. package/dist/hooks/useMounted/useMounted.js +0 -1
  165. package/dist/hooks/useMouseDrag/useMouseDrag.js +0 -4
  166. package/dist/hooks/useOverlay/useOverlay.js +4 -10
  167. package/dist/hooks/useOverlay/useOverlay2.js +3 -3
  168. package/dist/hooks/usePrevious/usePrevious.js +0 -1
  169. package/dist/hooks/useResponsiveValue/useResponsiveValue.js +1 -4
  170. package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement.js +11 -16
  171. package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement2.js +3 -3
  172. package/dist/icons/Icon.js +3 -3
  173. package/dist/icons/components/HeadsetIcon.js +6 -0
  174. package/dist/icons/components/PauseCircleIcon.js +1 -1
  175. package/dist/icons/createIconComponent.js +2 -3
  176. package/dist/icons/index.d.ts +2 -0
  177. package/dist/icons/index.es.js +1 -0
  178. package/dist/icons/index.js +2 -1
  179. package/dist/index.d.ts +1 -0
  180. package/dist/index.es.js +4 -3
  181. package/dist/index.js +6 -5
  182. package/dist/next/AdvancedTable/AdvancedTable.js +82 -188
  183. package/dist/next/AdvancedTable/AdvancedTable2.js +3 -3
  184. package/dist/next/AdvancedTable/AdvancedTableCell.js +4 -14
  185. package/dist/next/AdvancedTable/AdvancedTableCheckbox.js +0 -1
  186. package/dist/next/AdvancedTable/AdvancedTableColumnHeader.js +11 -41
  187. package/dist/next/AdvancedTable/AdvancedTableColumnHeaderMenu.js +8 -14
  188. package/dist/next/AdvancedTable/AdvancedTableDragPreview.js +4 -6
  189. package/dist/next/AdvancedTable/AdvancedTablePagination.js +1 -4
  190. package/dist/next/AdvancedTable/AdvancedTableRowExpandButton.js +0 -1
  191. package/dist/next/AdvancedTable/AdvancedTableTypes.js +1 -3
  192. package/dist/next/AdvancedTable/useAdvancedTableDragAndDrop.js +8 -13
  193. package/dist/next/AdvancedTable/useComputedWidth.js +1 -1
  194. package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput.js +5 -20
  195. package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput2.js +3 -3
  196. package/dist/next/CollapsibleSearchInput/CollapsibleSearchInputIconButton.js +1 -1
  197. package/dist/next/Combobox/Combobox2.js +3 -3
  198. package/dist/next/Combobox/ComboboxFlyout.js +3 -3
  199. package/dist/next/Combobox/ComboboxGroup.js +1 -1
  200. package/dist/next/Combobox/ComboboxInput.js +7 -20
  201. package/dist/next/Combobox/ComboboxOption.js +5 -6
  202. package/dist/next/Combobox/hooks/useComboboxFilteredGroup/useComboboxFilteredGroup.js +4 -5
  203. package/dist/next/Combobox/hooks/useComboboxFocusSequence/useComboboxFocusSequence.js +37 -54
  204. package/dist/next/Combobox/hooks/useComboboxLoadingState/useComboboxLoadingState.js +4 -5
  205. package/dist/next/Combobox/hooks/useComboboxValue/useComboboxValue.js +5 -3
  206. package/dist/next/Combobox/hooks/useListboxFlyoutDimensions/useListboxFlyoutDimensions.js +10 -10
  207. package/dist/next/Combobox/hooks/useSelectedOptionScroll/useSelectedOptionScroll.js +1 -6
  208. package/dist/next/Combobox/hooks/useShouldRenderGroupHeader/useShouldRenderGroupHeader.js +6 -6
  209. package/dist/next/Combobox/utils/nodeRegistration/nodeRegistration.js +4 -6
  210. package/dist/next/Drawer/Drawer.js +5 -16
  211. package/dist/next/Drawer/Drawer2.js +3 -3
  212. package/dist/next/FilterAnchor/FilterAnchor.js +7 -5
  213. package/dist/next/FilterAnchor/FilterAnchor2.js +3 -3
  214. package/dist/next/Input/Input.js +5 -8
  215. package/dist/next/Input/Input2.js +3 -3
  216. package/dist/next/Menu/Menu.js +10 -23
  217. package/dist/next/Menu/Menu2.js +3 -3
  218. package/dist/next/Menu/MenuContext.js +0 -2
  219. package/dist/next/Menu/MenuItem.js +11 -15
  220. package/dist/next/Menu/MenuPane.js +11 -25
  221. package/dist/next/Menu/MenuSearch.js +15 -22
  222. package/dist/next/Menu/SubMenu.js +10 -27
  223. package/dist/next/Menu/usePaneSearch.js +2 -1
  224. package/dist/next/PhoneNumberInput/PhoneNumberInput.js +12 -19
  225. package/dist/next/PhoneNumberInput/PhoneNumberInput2.js +3 -3
  226. package/dist/next/SplitButton/SplitButton.js +6 -12
  227. package/dist/next/SplitButton/SplitButton2.js +3 -3
  228. package/dist/next/Stack/HStack.js +11 -0
  229. package/dist/next/Stack/Stack.js +95 -0
  230. package/dist/next/Stack/StackItem.js +37 -0
  231. package/dist/next/Stack/VStack.js +11 -0
  232. package/dist/next/Stack/index.js +3 -0
  233. package/dist/next/TimePicker/TimeDropdown.js +4 -5
  234. package/dist/next/TimePicker/TimeInput.js +4 -5
  235. package/dist/next/TimePicker/TimePicker.js +12 -30
  236. package/dist/next/TimePicker/TimePicker2.js +3 -3
  237. package/dist/next/TimePicker/TimePickerIcon.js +1 -3
  238. package/dist/next/TimePicker/utils.js +12 -52
  239. package/dist/next/ToggleButton/ToggleButton.js +0 -5
  240. package/dist/next/ToggleButton/ToggleButtonGroup.js +2 -1
  241. package/dist/next/ToggleButton/styles.js +3 -3
  242. package/dist/next/index.d.ts +82 -4
  243. package/dist/next/index.es.js +4 -0
  244. package/dist/next/index.js +514 -745
  245. package/dist/utils/Flyout/Flyout.js +4 -5
  246. package/dist/utils/Flyout/Flyout2.js +3 -3
  247. package/dist/utils/Popper/Popper.js +18 -25
  248. package/dist/utils/Portal/Portal.js +2 -1
  249. package/dist/utils/TextOverflowTooltip/TextOverflowTooltip.js +4 -4
  250. package/dist/utils/Translation/Translate.js +0 -4
  251. package/dist/utils/Translation/TranslationProvider.js +0 -1
  252. package/dist/utils/Translation/containsComponentOrElement.js +1 -5
  253. package/dist/utils/Translation/insertPlaceholders.js +0 -1
  254. package/dist/utils/Translation/useTranslation.js +7 -14
  255. package/dist/utils/concatIds/concatIds.js +0 -1
  256. package/dist/utils/constants.js +2 -2
  257. package/dist/utils/createContextUtilities/createContextUtilities.js +0 -4
  258. package/dist/utils/filterChildren/filterChildren.js +8 -17
  259. package/dist/utils/getSubDataTestId/getSubDataTestId.js +1 -2
  260. package/dist/utils/keyboardUser/keyboardUser.js +0 -1
  261. package/dist/utils/mediaQueryManager/mediaQueryManager.js +1 -12
  262. package/dist/utils/mergeRefs/mergeRefs.js +1 -2
  263. package/dist/utils/wrapAround/wrapAround.js +1 -2
  264. package/dist/utils/wrapEvent/wrapEvent.js +2 -4
  265. package/icons/package.json +3 -2
  266. package/next/package.json +6 -2
  267. package/package.json +10 -5
@@ -32,11 +32,13 @@ const Pagination = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
32
32
  } = _ref;
33
33
  const {
34
34
  translate
35
- } = useTranslation(); // The current page (the consumer holds a current page that might be different)
35
+ } = useTranslation();
36
36
 
37
+ // The current page (the consumer holds a current page that might be different)
37
38
  const [pageInputValue, setPageInputValue] = useState(currentPage);
38
- const announceToScreenReader = useScreenReaderAnnouncement('assertive'); // Announces the new page info to the screen reader when the page info changes, but not when the component first mounts
39
+ const announceToScreenReader = useScreenReaderAnnouncement('assertive');
39
40
 
41
+ // Announces the new page info to the screen reader when the page info changes, but not when the component first mounts
40
42
  useDidUpdate(() => {
41
43
  if (numPages) {
42
44
  announceToScreenReader(translate('pagination', {
@@ -44,22 +46,24 @@ const Pagination = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
44
46
  numPages: Number(numPages)
45
47
  }));
46
48
  }
47
- }, [announceToScreenReader, translate, currentPage, numPages]); // Updates the `pageInputValue` to be `currentPage` when the `currentPage` prop changes
49
+ }, [announceToScreenReader, translate, currentPage, numPages]);
48
50
 
51
+ // Updates the `pageInputValue` to be `currentPage` when the `currentPage` prop changes
49
52
  useEffect(() => {
50
53
  setPageInputValue(currentPage);
51
54
  }, [currentPage]);
55
+
52
56
  /**
53
57
  * Calls `onPageChange` if the function was passed in as a prop
54
58
  * @param {Number} newPage - The value entered into the input
55
59
  */
56
-
57
60
  const handlePageChange = useCallback(newPage => {
58
- onPageChange === null || onPageChange === void 0 ? void 0 : onPageChange({
61
+ onPageChange?.({
59
62
  page: newPage
60
63
  });
61
- }, [onPageChange]); // Context for the composite components
64
+ }, [onPageChange]);
62
65
 
66
+ // Context for the composite components
63
67
  const context = useMemo(() => ({
64
68
  numPages,
65
69
  pageInputValue,
@@ -1,8 +1,8 @@
1
1
  import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
2
2
 
3
- var css_248z = "._17WNW{display:flex;align-items:center;justify-content:center;font-size:14px;white-space:pre}._b-IrC{margin-right:8px}._2eBS3{margin-left:8px}._3IDaE{margin:-10px -15px}._2As2B{width:100%;text-align:center}";
4
- var styles = {"pagination":"_17WNW","previousButton":"_b-IrC","nextButton":"_2eBS3","btnIcon":"_3IDaE","input":"_2As2B"};
5
- var stylesheet="._17WNW{display:flex;align-items:center;justify-content:center;font-size:14px;white-space:pre}._b-IrC{margin-right:8px}._2eBS3{margin-left:8px}._3IDaE{margin:-10px -15px}._2As2B{width:100%;text-align:center}";
3
+ var css_248z = "._O2AG8{display:flex;align-items:center;justify-content:center;font-size:14px;white-space:pre}._kWm7D{margin-right:8px}._Q-GUV{margin-left:8px}._elY8p{margin:-10px -15px}._UGuUT{width:100%;text-align:center}";
4
+ var styles = {"pagination":"_O2AG8","previousButton":"_kWm7D","nextButton":"_Q-GUV","btnIcon":"_elY8p","input":"_UGuUT"};
5
+ var stylesheet="._O2AG8{display:flex;align-items:center;justify-content:center;font-size:14px;white-space:pre}._kWm7D{margin-right:8px}._Q-GUV{margin-left:8px}._elY8p{margin:-10px -15px}._UGuUT{width:100%;text-align:center}";
6
6
  styleInject(css_248z);
7
7
 
8
8
  export { styles as default, stylesheet };
@@ -26,8 +26,9 @@ const PaginationNextButton = /*#__PURE__*/forwardRef((_ref, ref) => {
26
26
  const {
27
27
  translate
28
28
  } = useTranslation();
29
- const buttonLabel = translate('nextPage'); // Context for Pagination
29
+ const buttonLabel = translate('nextPage');
30
30
 
31
+ // Context for Pagination
31
32
  const {
32
33
  numPages,
33
34
  pageInputValue,
@@ -35,27 +36,26 @@ const PaginationNextButton = /*#__PURE__*/forwardRef((_ref, ref) => {
35
36
  handlePageChange,
36
37
  setPageInputValue
37
38
  } = usePaginationContext();
39
+
38
40
  /**
39
41
  * Increments the `pageInputValue`.
40
42
  * Calls `handlePageChange` in order to call the `onPageChange` prop.
41
43
  */
42
-
43
44
  const increment = () => {
44
45
  const newPage = pageInputValue + 1;
45
- setPageInputValue === null || setPageInputValue === void 0 ? void 0 : setPageInputValue(newPage);
46
- handlePageChange === null || handlePageChange === void 0 ? void 0 : handlePageChange(newPage);
46
+ setPageInputValue?.(newPage);
47
+ handlePageChange?.(newPage);
47
48
  };
48
-
49
49
  return /*#__PURE__*/React__default.createElement(Button, _extends({}, rest, {
50
- disabled: disabled !== null && disabled !== void 0 ? disabled : pageInputValue === numPages,
50
+ disabled: disabled ?? pageInputValue === numPages,
51
51
  ref: ref,
52
52
  kind: "tertiary",
53
53
  onClick: e => {
54
- onClick === null || onClick === void 0 ? void 0 : onClick(e);
54
+ onClick?.(e);
55
55
  increment();
56
56
  },
57
57
  className: classNames(className, styles.nextButton),
58
- "data-testid": dataTestIdFromProps !== null && dataTestIdFromProps !== void 0 ? dataTestIdFromProps : getSubDataTestId(dataTestId, 'NextButton'),
58
+ "data-testid": dataTestIdFromProps ?? getSubDataTestId(dataTestId, 'NextButton'),
59
59
  "aria-label": buttonLabel
60
60
  }), /*#__PURE__*/React__default.createElement(ChevronRightIcon, {
61
61
  className: styles.btnIcon,
@@ -28,8 +28,9 @@ const PaginationPageInput = /*#__PURE__*/forwardRef((_ref, ref) => {
28
28
  ...rest
29
29
  } = _ref;
30
30
  // Element reference to the input
31
- const inputRef = useRef(null); // Context for Pagination
31
+ const inputRef = useRef(null);
32
32
 
33
+ // Context for Pagination
33
34
  const {
34
35
  numPages,
35
36
  pageInputValue,
@@ -41,53 +42,46 @@ const PaginationPageInput = /*#__PURE__*/forwardRef((_ref, ref) => {
41
42
  handlePageChange,
42
43
  setPageInputValue
43
44
  } = usePaginationContext();
45
+
44
46
  /**
45
47
  * Computes the width of the input based on the number of characters entered
46
48
  */
47
-
48
49
  const inputWidth = useMemo(() => {
49
- var _currentPage$toString;
50
-
51
- const numDigits = (_currentPage$toString = currentPage === null || currentPage === void 0 ? void 0 : currentPage.toString().length) !== null && _currentPage$toString !== void 0 ? _currentPage$toString : 0;
50
+ const numDigits = currentPage?.toString().length ?? 0;
52
51
  const minWidth = 36;
53
52
  return numDigits > 2 ? 9 * (numDigits - 2) + minWidth : minWidth;
54
53
  }, [currentPage]);
54
+
55
55
  /**
56
56
  * Sets the `pageInputValue` to `currentPage` if there is a discrepancy
57
57
  */
58
-
59
58
  const handleBlur = () => {
60
59
  if (pageInputValue !== currentPage && currentPage !== undefined) {
61
- setPageInputValue === null || setPageInputValue === void 0 ? void 0 : setPageInputValue(currentPage);
60
+ setPageInputValue?.(currentPage);
62
61
  }
63
62
  };
63
+
64
64
  /**
65
65
  * Updates the `pageInputValue`.
66
66
  * Calls `handlePageChange` in order to call the `onPageChange` prop (only if the input is an integer).
67
67
  * @param {String | Number} newValue - The value entered into the input
68
68
  */
69
-
70
-
71
69
  const handleInputChange = newValue => {
72
70
  if (newValue === '' || !Number.isInteger(Number(newValue))) {
73
- setPageInputValue === null || setPageInputValue === void 0 ? void 0 : setPageInputValue(newValue);
71
+ setPageInputValue?.(newValue);
74
72
  } else {
75
73
  const newPage = Math.min(Math.max(1, newValue), numPages || Number.MAX_SAFE_INTEGER);
76
- setPageInputValue === null || setPageInputValue === void 0 ? void 0 : setPageInputValue(newPage);
77
- handlePageChange === null || handlePageChange === void 0 ? void 0 : handlePageChange(newPage);
74
+ setPageInputValue?.(newPage);
75
+ handlePageChange?.(newPage);
78
76
  }
79
77
  };
78
+
80
79
  /**
81
80
  * If there is a ref to the input, selects all text within the input
82
81
  */
83
-
84
-
85
82
  const handleFocus = () => {
86
- var _inputRef$current;
87
-
88
- (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.select();
83
+ inputRef.current?.select();
89
84
  };
90
-
91
85
  return /*#__PURE__*/React__default.createElement(Translate, {
92
86
  messageKey: "pagination",
93
87
  placeholders: {
@@ -104,18 +98,19 @@ const PaginationPageInput = /*#__PURE__*/forwardRef((_ref, ref) => {
104
98
  max: numPages,
105
99
  value: pageInputValue,
106
100
  onChange: e => {
107
- onChange === null || onChange === void 0 ? void 0 : onChange(e);
101
+ onChange?.(e);
108
102
  handleInputChange(e.target.value);
109
103
  },
110
104
  onBlur: e => {
111
- onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
105
+ onBlur?.(e);
112
106
  handleBlur();
113
107
  },
114
108
  onFocus: e => {
115
- onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
109
+ onFocus?.(e);
116
110
  handleFocus();
117
111
  },
118
- style: { ...style,
112
+ style: {
113
+ ...style,
119
114
  width: inputWidth
120
115
  },
121
116
  className: classNames(className, styles.input)
@@ -26,35 +26,35 @@ const PaginationPreviousButton = /*#__PURE__*/forwardRef((_ref, ref) => {
26
26
  const {
27
27
  translate
28
28
  } = useTranslation();
29
- const buttonLabel = translate('previousPage'); // Context for Pagination
29
+ const buttonLabel = translate('previousPage');
30
30
 
31
+ // Context for Pagination
31
32
  const {
32
33
  pageInputValue,
33
34
  dataTestId,
34
35
  handlePageChange,
35
36
  setPageInputValue
36
37
  } = usePaginationContext();
38
+
37
39
  /**
38
40
  * Decrements the `pageInputValue`.
39
41
  * Calls `handlePageChange` in order to call the `onPageChange` prop.
40
42
  */
41
-
42
43
  const decrement = () => {
43
44
  const newPage = pageInputValue - 1;
44
- setPageInputValue === null || setPageInputValue === void 0 ? void 0 : setPageInputValue(newPage);
45
- handlePageChange === null || handlePageChange === void 0 ? void 0 : handlePageChange(newPage);
45
+ setPageInputValue?.(newPage);
46
+ handlePageChange?.(newPage);
46
47
  };
47
-
48
48
  return /*#__PURE__*/React__default.createElement(Button, _extends({}, rest, {
49
- disabled: disabled !== null && disabled !== void 0 ? disabled : pageInputValue === 1,
49
+ disabled: disabled ?? pageInputValue === 1,
50
50
  ref: ref,
51
51
  kind: "tertiary",
52
52
  onClick: e => {
53
- onClick === null || onClick === void 0 ? void 0 : onClick(e);
53
+ onClick?.(e);
54
54
  decrement();
55
55
  },
56
56
  className: classNames(className, styles.previousButton),
57
- "data-testid": dataTestIdFromProps !== null && dataTestIdFromProps !== void 0 ? dataTestIdFromProps : getSubDataTestId(dataTestId, 'PreviousButton'),
57
+ "data-testid": dataTestIdFromProps ?? getSubDataTestId(dataTestId, 'PreviousButton'),
58
58
  "aria-label": buttonLabel
59
59
  }), /*#__PURE__*/React__default.createElement(ChevronLeftIcon, {
60
60
  className: styles.btnIcon,
@@ -30,10 +30,11 @@ const Popover = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
30
30
  const classes = classNames(styles.popover, className);
31
31
  const anchorRef = useRef();
32
32
  const popperRef = useRef(null);
33
- const preventClickOutside = useClickOutsidePortals(e => show && (onClickOutside === null || onClickOutside === void 0 ? void 0 : onClickOutside(e)));
33
+ const preventClickOutside = useClickOutsidePortals(e => show && onClickOutside?.(e));
34
34
  const [isInDOM, setIsInDOM] = useState(false);
35
- const popoverId = useId(externalId); // Focus lock can't be enabled without `onClose` function because keyboard users need a way to exit the focus lock
35
+ const popoverId = useId(externalId);
36
36
 
37
+ // Focus lock can't be enabled without `onClose` function because keyboard users need a way to exit the focus lock
37
38
  const isFocusLockEnabled = typeof onClose === 'function';
38
39
  useEffect(() => {
39
40
  /*
@@ -46,31 +47,23 @@ const Popover = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
46
47
  * 2. A user in Safari clicks on 1 or more `Popover` anchor elements and then presses the `Escape` key. This is because buttons aren't focused on `click` or `mousedown` in Safari by default.
47
48
  */
48
49
  if (!show && isInDOM) {
49
- var _anchorRef$current;
50
-
51
50
  // Prevents scroll so that the page does not scroll to the anchor element if the anchor element is out of view
52
- (_anchorRef$current = anchorRef.current) === null || _anchorRef$current === void 0 ? void 0 : _anchorRef$current.focus({
51
+ anchorRef.current?.focus({
53
52
  preventScroll: true
54
53
  });
55
54
  }
56
-
57
55
  setIsInDOM(show);
58
56
  }, [show, isInDOM]);
59
-
60
57
  const handlePopoverContainerClick = e => {
61
- onClick === null || onClick === void 0 ? void 0 : onClick(e);
58
+ onClick?.(e);
62
59
  };
63
-
64
60
  const handlePopoverContainerKeyDown = e => {
65
61
  if (e.key === 'Escape') {
66
62
  e.stopPropagation(); // prevent event from closing modals or popovers
67
-
68
- onClose === null || onClose === void 0 ? void 0 : onClose(e);
63
+ onClose?.(e);
69
64
  }
70
-
71
- onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
65
+ onKeyDown?.(e);
72
66
  };
73
-
74
67
  return /*#__PURE__*/React__default.createElement(Popper, {
75
68
  open: show,
76
69
  isFocusLocked: true,
@@ -82,8 +75,6 @@ const Popover = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
82
75
  'aria-expanded': show,
83
76
  'aria-controls': show ? popoverId : undefined,
84
77
  onMouseDown: e => {
85
- var _children$props$onMou, _children$props;
86
-
87
78
  /*
88
79
  * Prevents the anchor element from getting focus (only in some browsers).
89
80
  * If a Popover is open and out of view, and another button is clicked, this prevents the browser from scrolling to the open Popover.
@@ -91,9 +82,9 @@ const Popover = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
91
82
  */
92
83
  e.preventDefault();
93
84
  preventClickOutside();
94
- (_children$props$onMou = (_children$props = children.props).onMouseDown) === null || _children$props$onMou === void 0 ? void 0 : _children$props$onMou.call(_children$props, e);
85
+ children.props.onMouseDown?.(e);
95
86
  },
96
- ref: mergeRefs(anchorRef, children === null || children === void 0 ? void 0 : children.ref)
87
+ ref: mergeRefs(anchorRef, children?.ref)
97
88
  }),
98
89
  popper: /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
99
90
  ref: mergeRefs(ref, popperRef),
@@ -1,8 +1,8 @@
1
1
  import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
2
2
 
3
- var css_248z = "._3MG31{position:absolute;z-index:1000;background-color:#fff;border-radius:4px;display:inline-block;box-shadow:0 3px 4px 0 rgba(0,0,0,.05),0 6px 10px 0 rgba(0,0,0,.05);border:1px solid #898989}._3MG31:focus{outline:none}._iBn7t,._iBn7t>div{position:absolute;width:8px;height:8px;background:inherit}._iBn7t{visibility:hidden;z-index:1000}._iBn7t>div{visibility:visible;border:1px solid #898989;transform:rotate(45deg)}[data-popper-placement^=top]>._iBn7t{bottom:-4px}[data-popper-placement^=top]>._iBn7t>div{border-top-color:transparent;border-left-color:transparent}[data-popper-placement^=right]>._iBn7t{left:-5px}[data-popper-placement^=right]>._iBn7t>div{border-top-color:transparent;border-right-color:transparent}[data-popper-placement^=bottom]>._iBn7t{top:-5px}[data-popper-placement^=bottom]>._iBn7t>div{border-bottom-color:transparent;border-right-color:transparent}[data-popper-placement^=left]>._iBn7t{right:-4px}[data-popper-placement^=left]>._iBn7t>div{border-bottom-color:transparent;border-left-color:transparent}";
4
- var styles = {"popover":"_3MG31","arrow":"_iBn7t"};
5
- var stylesheet="._3MG31{position:absolute;z-index:1000;background-color:#fff;border-radius:4px;display:inline-block;box-shadow:0 3px 4px 0 rgba(0,0,0,.05),0 6px 10px 0 rgba(0,0,0,.05);border:1px solid #898989}._3MG31:focus{outline:none}._iBn7t,._iBn7t>div{position:absolute;width:8px;height:8px;background:inherit}._iBn7t{visibility:hidden;z-index:1000}._iBn7t>div{visibility:visible;border:1px solid #898989;transform:rotate(45deg)}[data-popper-placement^=top]>._iBn7t{bottom:-4px}[data-popper-placement^=top]>._iBn7t>div{border-top-color:transparent;border-left-color:transparent}[data-popper-placement^=right]>._iBn7t{left:-5px}[data-popper-placement^=right]>._iBn7t>div{border-top-color:transparent;border-right-color:transparent}[data-popper-placement^=bottom]>._iBn7t{top:-5px}[data-popper-placement^=bottom]>._iBn7t>div{border-bottom-color:transparent;border-right-color:transparent}[data-popper-placement^=left]>._iBn7t{right:-4px}[data-popper-placement^=left]>._iBn7t>div{border-bottom-color:transparent;border-left-color:transparent}";
3
+ var css_248z = "._h03yL{position:absolute;z-index:1000;background-color:#fff;border-radius:4px;display:inline-block;box-shadow:0 3px 4px 0 rgba(0,0,0,.05),0 6px 10px 0 rgba(0,0,0,.05);border:1px solid #898989}._h03yL:focus{outline:none}._EERNY,._EERNY>div{position:absolute;width:8px;height:8px;background:inherit}._EERNY{visibility:hidden;z-index:1000}._EERNY>div{visibility:visible;border:1px solid #898989;transform:rotate(45deg)}[data-popper-placement^=top]>._EERNY{bottom:-4px}[data-popper-placement^=top]>._EERNY>div{border-top-color:transparent;border-left-color:transparent}[data-popper-placement^=right]>._EERNY{left:-5px}[data-popper-placement^=right]>._EERNY>div{border-top-color:transparent;border-right-color:transparent}[data-popper-placement^=bottom]>._EERNY{top:-5px}[data-popper-placement^=bottom]>._EERNY>div{border-bottom-color:transparent;border-right-color:transparent}[data-popper-placement^=left]>._EERNY{right:-4px}[data-popper-placement^=left]>._EERNY>div{border-bottom-color:transparent;border-left-color:transparent}";
4
+ var styles = {"popover":"_h03yL","arrow":"_EERNY"};
5
+ var stylesheet="._h03yL{position:absolute;z-index:1000;background-color:#fff;border-radius:4px;display:inline-block;box-shadow:0 3px 4px 0 rgba(0,0,0,.05),0 6px 10px 0 rgba(0,0,0,.05);border:1px solid #898989}._h03yL:focus{outline:none}._EERNY,._EERNY>div{position:absolute;width:8px;height:8px;background:inherit}._EERNY{visibility:hidden;z-index:1000}._EERNY>div{visibility:visible;border:1px solid #898989;transform:rotate(45deg)}[data-popper-placement^=top]>._EERNY{bottom:-4px}[data-popper-placement^=top]>._EERNY>div{border-top-color:transparent;border-left-color:transparent}[data-popper-placement^=right]>._EERNY{left:-5px}[data-popper-placement^=right]>._EERNY>div{border-top-color:transparent;border-right-color:transparent}[data-popper-placement^=bottom]>._EERNY{top:-5px}[data-popper-placement^=bottom]>._EERNY>div{border-bottom-color:transparent;border-right-color:transparent}[data-popper-placement^=left]>._EERNY{right:-4px}[data-popper-placement^=left]>._EERNY>div{border-bottom-color:transparent;border-left-color:transparent}";
6
6
  styleInject(css_248z);
7
7
 
8
8
  export { styles as default, stylesheet };
@@ -12,8 +12,6 @@ import LoadingSpinner from '../LoadingSpinner/LoadingSpinner.js';
12
12
  import MenuItem from '../NewMenu/parts/MenuItem.js';
13
13
 
14
14
  const QuickSearch = /*#__PURE__*/forwardRef((_ref, ref) => {
15
- var _anchorRef$current;
16
-
17
15
  let {
18
16
  maxHeight: externalMaxHeight,
19
17
  menuProps,
@@ -29,7 +27,7 @@ const QuickSearch = /*#__PURE__*/forwardRef((_ref, ref) => {
29
27
  const [items, setItems] = useState([]);
30
28
  const maxHeight = items.length > 10 ? 500 : undefined;
31
29
  const anchorRef = useRef(null);
32
- const anchorWidth = anchorRef === null || anchorRef === void 0 ? void 0 : (_anchorRef$current = anchorRef.current) === null || _anchorRef$current === void 0 ? void 0 : _anchorRef$current.clientWidth;
30
+ const anchorWidth = anchorRef?.current?.clientWidth;
33
31
  const {
34
32
  translate
35
33
  } = useTranslation();
@@ -42,7 +40,7 @@ const QuickSearch = /*#__PURE__*/forwardRef((_ref, ref) => {
42
40
  portalTarget: portalTarget,
43
41
  zIndex: zIndex,
44
42
  anchor: /*#__PURE__*/React__default.createElement(QuickSearchInput, _extends({}, rest, {
45
- role: role !== null && role !== void 0 ? role : 'searchbox',
43
+ role: role ?? 'searchbox',
46
44
  ref: mergeRefs(ref, anchorRef),
47
45
  setIsLoading: setIsLoading,
48
46
  items: items,
@@ -59,7 +57,7 @@ const QuickSearch = /*#__PURE__*/forwardRef((_ref, ref) => {
59
57
  return /*#__PURE__*/React__default.createElement(MenuItem, {
60
58
  key: index,
61
59
  value: value,
62
- onSelect: () => onSelect === null || onSelect === void 0 ? void 0 : onSelect(item)
60
+ onSelect: () => onSelect?.(item)
63
61
  }, label);
64
62
  }));
65
63
  });
@@ -1,8 +1,8 @@
1
1
  import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
2
2
 
3
- var css_248z = "._1CL18{display:flex;height:32px}";
4
- var styles = {"loadingSpinner":"_1CL18"};
5
- var stylesheet="._1CL18{display:flex;height:32px}";
3
+ var css_248z = "._5W-Bf{display:flex;height:32px}";
4
+ var styles = {"loadingSpinner":"_5W-Bf"};
5
+ var stylesheet="._5W-Bf{display:flex;height:32px}";
6
6
  styleInject(css_248z);
7
7
 
8
8
  export { styles as default, stylesheet };
@@ -36,22 +36,19 @@ const QuickSearchInput = /*#__PURE__*/forwardRef((_ref, ref) => {
36
36
  setIsOpen,
37
37
  closeAndFocusAnchor: internalCloseMenu,
38
38
  anchorRef,
39
- setHighlightedIndex // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
40
-
39
+ setHighlightedIndex
40
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
41
41
  } = useMenuContext();
42
-
43
42
  const openMenu = () => {
44
43
  // this prevents the "no items to display" text from appearing on initial open.
45
44
  if (!open) {
46
45
  setIsLoading(true);
47
46
  }
48
-
49
- setIsOpen === null || setIsOpen === void 0 ? void 0 : setIsOpen(true);
47
+ setIsOpen?.(true);
50
48
  };
51
-
52
49
  const closeMenu = useCallback(() => {
53
50
  setItems([]);
54
- internalCloseMenu === null || internalCloseMenu === void 0 ? void 0 : internalCloseMenu();
51
+ internalCloseMenu?.();
55
52
  setIsLoading(true);
56
53
  }, [setItems, internalCloseMenu, setIsLoading]);
57
54
  const onSearchRef = useLatest(onSearch);
@@ -59,7 +56,6 @@ const QuickSearchInput = /*#__PURE__*/forwardRef((_ref, ref) => {
59
56
  if (!isMounted.current) {
60
57
  return;
61
58
  }
62
-
63
59
  setIsLoading(true);
64
60
  Promise.resolve(onSearchRef.current && onSearchRef.current(queryValue)).then(newItems => {
65
61
  if (isMounted.current && queryValue === valueRef.current) {
@@ -69,35 +65,27 @@ const QuickSearchInput = /*#__PURE__*/forwardRef((_ref, ref) => {
69
65
  });
70
66
  }, [isMounted, onSearchRef, setIsLoading, valueRef, setItems]);
71
67
  const handleSearchThrottledDebounced = useCallback(debounce(debouncePeriod, throttle(throttlePeriod, handleSearch)), [debouncePeriod, throttlePeriod, handleSearch]);
72
-
73
68
  const handleChange = e => {
74
69
  setChanged(true);
75
-
76
70
  if (!isControlled) {
77
71
  setInternalValue(e.target.value);
78
72
  }
79
-
80
73
  if (typeof onChange === 'function') {
81
74
  onChange(e);
82
75
  }
83
76
  };
84
-
85
77
  const handleKeyDown = e => {
86
78
  if (e.key === 'Enter' || e.key === 'ArrowDown') {
87
79
  e.preventDefault(); // prevent scroll
88
-
89
80
  openMenu();
90
- setHighlightedIndex === null || setHighlightedIndex === void 0 ? void 0 : setHighlightedIndex(0);
91
-
81
+ setHighlightedIndex?.(0);
92
82
  if (!open) {
93
83
  handleSearch(value);
94
84
  }
95
85
  } else if (e.key === 'ArrowUp') {
96
86
  e.preventDefault(); // prevent scroll
97
-
98
87
  openMenu();
99
- setHighlightedIndex === null || setHighlightedIndex === void 0 ? void 0 : setHighlightedIndex(items.length - 1);
100
-
88
+ setHighlightedIndex?.(items.length - 1);
101
89
  if (!open) {
102
90
  handleSearch(value);
103
91
  }
@@ -108,10 +96,8 @@ const QuickSearchInput = /*#__PURE__*/forwardRef((_ref, ref) => {
108
96
  value: ''
109
97
  }
110
98
  });
111
-
112
99
  if (open) {
113
100
  e.stopPropagation(); // prevent event from closing modals or popovers
114
-
115
101
  closeMenu();
116
102
  }
117
103
  } else if (e.key === 'Tab') {
@@ -120,13 +106,10 @@ const QuickSearchInput = /*#__PURE__*/forwardRef((_ref, ref) => {
120
106
  }
121
107
  }
122
108
  };
123
-
124
109
  useEnhancedDidUpdate(() => {
125
110
  const shouldClose = value.length < minChars;
126
-
127
111
  if (changed) {
128
112
  setChanged(false);
129
-
130
113
  if (shouldClose) {
131
114
  setChanged(false);
132
115
  closeMenu();
@@ -8,8 +8,6 @@ import '../../utils/index.js';
8
8
  import concatIds from '../../utils/concatIds/concatIds.js';
9
9
 
10
10
  const Radio = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
11
- var _ref2;
12
-
13
11
  let {
14
12
  id,
15
13
  className,
@@ -34,25 +32,25 @@ const Radio = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
34
32
  helperTextId: formFieldHelperTextId,
35
33
  errorTextId: formFieldErrorTextId
36
34
  } = useFormFieldContext();
37
- const internalAriaDescribedby = concatIds(externalAriaDescribedBy, formFieldHelperTextId, formFieldErrorTextId, inputProps === null || inputProps === void 0 ? void 0 : inputProps['aria-describedby']);
38
- const checked = groupValue !== undefined ? value === groupValue : radioChecked !== null && radioChecked !== void 0 ? radioChecked : inputProps === null || inputProps === void 0 ? void 0 : inputProps.checked;
39
- const defaultChecked = groupDefaultValue !== undefined ? value === groupDefaultValue : radioDefaultChecked !== null && radioDefaultChecked !== void 0 ? radioDefaultChecked : inputProps === null || inputProps === void 0 ? void 0 : inputProps.defaultChecked;
40
- const onChange = (_ref2 = radioGroupOnChange !== null && radioGroupOnChange !== void 0 ? radioGroupOnChange : radioOnChange) !== null && _ref2 !== void 0 ? _ref2 : inputProps === null || inputProps === void 0 ? void 0 : inputProps.onChange;
35
+ const internalAriaDescribedby = concatIds(externalAriaDescribedBy, formFieldHelperTextId, formFieldErrorTextId, inputProps?.['aria-describedby']);
36
+ const checked = groupValue !== undefined ? value === groupValue : radioChecked ?? inputProps?.checked;
37
+ const defaultChecked = groupDefaultValue !== undefined ? value === groupDefaultValue : radioDefaultChecked ?? inputProps?.defaultChecked;
38
+ const onChange = radioGroupOnChange ?? radioOnChange ?? inputProps?.onChange;
41
39
  return /*#__PURE__*/React__default.createElement("span", _extends({}, rest, {
42
40
  ref: ref,
43
41
  className: classNames(className, styles.radio)
44
42
  }), /*#__PURE__*/React__default.createElement("input", _extends({}, inputProps, {
45
- className: classNames(styles.input, inputProps === null || inputProps === void 0 ? void 0 : inputProps.className),
43
+ className: classNames(styles.input, inputProps?.className),
46
44
  type: "radio",
47
- id: id !== null && id !== void 0 ? id : inputProps === null || inputProps === void 0 ? void 0 : inputProps.id,
45
+ id: id ?? inputProps?.id,
48
46
  checked: checked,
49
47
  defaultChecked: defaultChecked,
50
- disabled: disabled !== null && disabled !== void 0 ? disabled : inputProps === null || inputProps === void 0 ? void 0 : inputProps.disabled,
51
- name: name !== null && name !== void 0 ? name : inputProps === null || inputProps === void 0 ? void 0 : inputProps.name,
52
- value: value !== null && value !== void 0 ? value : inputProps === null || inputProps === void 0 ? void 0 : inputProps.value,
48
+ disabled: disabled ?? inputProps?.disabled,
49
+ name: name ?? inputProps?.name,
50
+ value: value ?? inputProps?.value,
53
51
  onChange: disabled ? undefined : onChange,
54
- "aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : inputProps === null || inputProps === void 0 ? void 0 : inputProps['aria-label'],
55
- "aria-labelledby": ariaLabelledBy !== null && ariaLabelledBy !== void 0 ? ariaLabelledBy : inputProps === null || inputProps === void 0 ? void 0 : inputProps['aria-labelledby'],
52
+ "aria-label": ariaLabel ?? inputProps?.['aria-label'],
53
+ "aria-labelledby": ariaLabelledBy ?? inputProps?.['aria-labelledby'],
56
54
  "aria-describedby": internalAriaDescribedby
57
55
  })), /*#__PURE__*/React__default.createElement("span", {
58
56
  className: styles.check
@@ -1,8 +1,8 @@
1
1
  import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
2
2
 
3
- var css_248z = "._1MF2L{display:inline-flex;position:relative;margin-top:6px;margin-bottom:6px}._1MF2L,._3tdav{cursor:pointer;height:16px;width:16px}._3tdav{position:absolute;opacity:0;z-index:10}._3tdav:checked~._ZrqL_>._3Kyfl{fill-opacity:1}._3tdav:checked:enabled~._ZrqL_{border-color:transparent;background-color:#0b6ed0}._3tdav:checked:enabled~._ZrqL_>._3Kyfl{fill:#fff}._3tdav:checked:enabled:hover~._ZrqL_{background-color:#085caf}._3tdav:not(:checked):enabled:hover~._ZrqL_{border-color:#0b6ed0}._3tdav:disabled{cursor:not-allowed}._3tdav:disabled~._ZrqL_{opacity:.4}._3tdav:checked~._ZrqL_:after{content:\"\"}._1SDmg{color:#32363a;display:flex;align-items:center;cursor:pointer}._2zZd1{cursor:auto;color:hsla(0,0%,53.7%,.4)}._15rZi{margin-right:12px;flex-shrink:0}._ZrqL_{display:flex;align-items:center;justify-content:center;position:absolute;top:0;left:0;height:16px;width:16px;background-color:#fff;border-radius:4px;border:1px solid #898989;z-index:0;border-radius:50%;background-color:transparent!important;border-color:#898989!important}._3Kyfl{fill:#0b6ed0;fill-opacity:0}._ZrqL_:after{position:absolute;z-index:0;background-color:#0b6ed0;border-radius:50%;height:10px;width:10px;top:2px;left:2px}._3WVFs{border:none;padding:0;margin:0}._tPr68{padding:0;margin:0 0 14px;color:#01213f}body.keyboard-user ._3tdav:active:focus~._ZrqL_,body.keyboard-user ._3tdav:focus~._ZrqL_{border-color:#0b6ed0;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
4
- var styles = {"radio":"_1MF2L","input":"_3tdav","check":"_ZrqL_","checkIcon":"_3Kyfl","label":"_1SDmg","labelDisabled":"_2zZd1","wrappedInput":"_15rZi","radioGroup":"_3WVFs","legend":"_tPr68"};
5
- var stylesheet="._1MF2L{display:inline-flex;position:relative;margin-top:6px;margin-bottom:6px}._1MF2L,._3tdav{cursor:pointer;height:16px;width:16px}._3tdav{position:absolute;opacity:0;z-index:10}._3tdav:checked~._ZrqL_>._3Kyfl{fill-opacity:1}._3tdav:checked:enabled~._ZrqL_{border-color:transparent;background-color:#0b6ed0}._3tdav:checked:enabled~._ZrqL_>._3Kyfl{fill:#fff}._3tdav:checked:enabled:hover~._ZrqL_{background-color:#085caf}._3tdav:not(:checked):enabled:hover~._ZrqL_{border-color:#0b6ed0}._3tdav:disabled{cursor:not-allowed}._3tdav:disabled~._ZrqL_{opacity:.4}._3tdav:checked~._ZrqL_:after{content:\"\"}._1SDmg{color:#32363a;display:flex;align-items:center;cursor:pointer}._2zZd1{cursor:auto;color:hsla(0,0%,53.7%,.4)}._15rZi{margin-right:12px;flex-shrink:0}._ZrqL_{display:flex;align-items:center;justify-content:center;position:absolute;top:0;left:0;height:16px;width:16px;background-color:#fff;border-radius:4px;border:1px solid #898989;z-index:0;border-radius:50%;background-color:transparent!important;border-color:#898989!important}._3Kyfl{fill:#0b6ed0;fill-opacity:0}._ZrqL_:after{position:absolute;z-index:0;background-color:#0b6ed0;border-radius:50%;height:10px;width:10px;top:2px;left:2px}._3WVFs{border:none;padding:0;margin:0}._tPr68{padding:0;margin:0 0 14px;color:#01213f}body.keyboard-user ._3tdav:active:focus~._ZrqL_,body.keyboard-user ._3tdav:focus~._ZrqL_{border-color:#0b6ed0;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
3
+ var css_248z = "._nIM-b{display:inline-flex;position:relative;margin-top:6px;margin-bottom:6px}._nIM-b,._RCji3{cursor:pointer;height:16px;width:16px}._RCji3{position:absolute;opacity:0;z-index:10}._RCji3:checked~._rLrtP>._D8tHE{fill-opacity:1}._RCji3:checked:enabled~._rLrtP{border-color:transparent;background-color:#0b6ed0}._RCji3:checked:enabled~._rLrtP>._D8tHE{fill:#fff}._RCji3:checked:enabled:hover~._rLrtP{background-color:#085caf}._RCji3:not(:checked):enabled:hover~._rLrtP{border-color:#0b6ed0}._RCji3:disabled{cursor:not-allowed}._RCji3:disabled~._rLrtP{opacity:.4}._RCji3:checked~._rLrtP:after{content:\"\"}._5t4v8{color:#32363a;display:flex;align-items:center;cursor:pointer}._Q3PRR{cursor:auto;color:hsla(0,0%,53.7%,.4)}._BBGwn{margin-right:12px;flex-shrink:0}._rLrtP{display:flex;align-items:center;justify-content:center;position:absolute;top:0;left:0;height:16px;width:16px;background-color:#fff;border-radius:4px;border:1px solid #898989;z-index:0;border-radius:50%;background-color:transparent!important;border-color:#898989!important}._D8tHE{fill:#0b6ed0;fill-opacity:0}._rLrtP:after{position:absolute;z-index:0;background-color:#0b6ed0;border-radius:50%;height:10px;width:10px;top:2px;left:2px}._Wy1cW{border:none;padding:0;margin:0}._NkFxd{padding:0;margin:0 0 14px;color:#01213f}body.keyboard-user ._RCji3:active:focus~._rLrtP,body.keyboard-user ._RCji3:focus~._rLrtP{border-color:#0b6ed0;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
4
+ var styles = {"radio":"_nIM-b","input":"_RCji3","check":"_rLrtP","checkIcon":"_D8tHE","label":"_5t4v8","labelDisabled":"_Q3PRR","wrappedInput":"_BBGwn","radioGroup":"_Wy1cW","legend":"_NkFxd"};
5
+ var stylesheet="._nIM-b{display:inline-flex;position:relative;margin-top:6px;margin-bottom:6px}._nIM-b,._RCji3{cursor:pointer;height:16px;width:16px}._RCji3{position:absolute;opacity:0;z-index:10}._RCji3:checked~._rLrtP>._D8tHE{fill-opacity:1}._RCji3:checked:enabled~._rLrtP{border-color:transparent;background-color:#0b6ed0}._RCji3:checked:enabled~._rLrtP>._D8tHE{fill:#fff}._RCji3:checked:enabled:hover~._rLrtP{background-color:#085caf}._RCji3:not(:checked):enabled:hover~._rLrtP{border-color:#0b6ed0}._RCji3:disabled{cursor:not-allowed}._RCji3:disabled~._rLrtP{opacity:.4}._RCji3:checked~._rLrtP:after{content:\"\"}._5t4v8{color:#32363a;display:flex;align-items:center;cursor:pointer}._Q3PRR{cursor:auto;color:hsla(0,0%,53.7%,.4)}._BBGwn{margin-right:12px;flex-shrink:0}._rLrtP{display:flex;align-items:center;justify-content:center;position:absolute;top:0;left:0;height:16px;width:16px;background-color:#fff;border-radius:4px;border:1px solid #898989;z-index:0;border-radius:50%;background-color:transparent!important;border-color:#898989!important}._D8tHE{fill:#0b6ed0;fill-opacity:0}._rLrtP:after{position:absolute;z-index:0;background-color:#0b6ed0;border-radius:50%;height:10px;width:10px;top:2px;left:2px}._Wy1cW{border:none;padding:0;margin:0}._NkFxd{padding:0;margin:0 0 14px;color:#01213f}body.keyboard-user ._RCji3:active:focus~._rLrtP,body.keyboard-user ._RCji3:focus~._rLrtP{border-color:#0b6ed0;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
6
6
  styleInject(css_248z);
7
7
 
8
8
  export { styles as default, stylesheet };
@@ -39,26 +39,22 @@ const SearchInput = /*#__PURE__*/forwardRef((_ref, ref) => {
39
39
  } = useTranslation();
40
40
  const clearButtonLabel = translate('clearSearchInput');
41
41
  const isClearButtonHidden = !inputValue || isDisabled;
42
- const usedWithinInputGroup = !!useInputGroupContext().className; // Focuses the input after the input value is cleared so that screen readers see that the input doesn't have a value
42
+ const usedWithinInputGroup = !!useInputGroupContext().className;
43
43
 
44
+ // Focuses the input after the input value is cleared so that screen readers see that the input doesn't have a value
44
45
  useEffect(() => {
45
46
  if (wasInputValueCleared) {
46
- var _inputRef$current;
47
-
48
- (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
47
+ inputRef.current?.focus();
49
48
  setWasInputValueCleared(false);
50
49
  }
51
50
  }, [wasInputValueCleared]);
52
-
53
51
  const clearInputText = () => {
54
52
  setInputValue('');
55
53
  setWasInputValueCleared(true);
56
54
  };
57
-
58
55
  const handleInputChange = e => {
59
56
  setInputValue(e.target.value);
60
57
  };
61
-
62
58
  const handleInputKeyDown = e => {
63
59
  if (e.key === 'Escape') {
64
60
  if (inputValue) {
@@ -67,10 +63,8 @@ const SearchInput = /*#__PURE__*/forwardRef((_ref, ref) => {
67
63
 
68
64
  clearInputText();
69
65
  }
70
-
71
- onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
66
+ onKeyDown?.(e);
72
67
  };
73
-
74
68
  return /*#__PURE__*/React__default.createElement("span", {
75
69
  className: classNames(styles.searchInput, className),
76
70
  style: style
@@ -78,7 +72,7 @@ const SearchInput = /*#__PURE__*/forwardRef((_ref, ref) => {
78
72
  role: "searchbox",
79
73
  id: id,
80
74
  className: styles.searchInputInput,
81
- placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : translate('searchText'),
75
+ placeholder: placeholder ?? translate('searchText'),
82
76
  value: inputValue,
83
77
  onChange: handleInputChange,
84
78
  onKeyDown: handleInputKeyDown,
@@ -1,8 +1,8 @@
1
1
  import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
2
2
 
3
- var css_248z = "._1xyQn{display:inline-block;position:relative}._2q1K2._2q1K2{padding-left:36px;padding-right:36px;width:100%}._2q1K2._2q1K2:disabled+._37IHO{fill-opacity:.6}._37IHO{position:absolute;top:50%;left:0;transform:translateY(-50%);margin-left:6px;fill:#515559;pointer-events:none}._37IHO._3FWxN{z-index:20}._1fXV3{position:absolute;top:0;right:0;width:36px;height:100%;background-color:transparent;line-height:0;border:none;border-radius:4px}._1fXV3:hover{cursor:pointer}._1fXV3:hover>._UwJIQ{fill:#32363a}._1fXV3:focus{outline:none;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._UwJIQ{fill:#515559}";
4
- var styles = {"searchInput":"_1xyQn","searchInputInput":"_2q1K2","searchInputSearchIcon":"_37IHO","usedWithinInputGroup":"_3FWxN","searchInputClearButton":"_1fXV3","searchInputClearButtonIcon":"_UwJIQ"};
5
- var stylesheet="._1xyQn{display:inline-block;position:relative}._2q1K2._2q1K2{padding-left:36px;padding-right:36px;width:100%}._2q1K2._2q1K2:disabled+._37IHO{fill-opacity:.6}._37IHO{position:absolute;top:50%;left:0;transform:translateY(-50%);margin-left:6px;fill:#515559;pointer-events:none}._37IHO._3FWxN{z-index:20}._1fXV3{position:absolute;top:0;right:0;width:36px;height:100%;background-color:transparent;line-height:0;border:none;border-radius:4px}._1fXV3:hover{cursor:pointer}._1fXV3:hover>._UwJIQ{fill:#32363a}._1fXV3:focus{outline:none;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._UwJIQ{fill:#515559}";
3
+ var css_248z = "._9iEPQ{display:inline-block;position:relative}._kt9z4._kt9z4{padding-left:36px;padding-right:36px;width:100%}._kt9z4._kt9z4:disabled+._0j7he{fill-opacity:.6}._0j7he{position:absolute;top:50%;left:0;transform:translateY(-50%);margin-left:6px;fill:#515559;pointer-events:none}._0j7he._w-qtH{z-index:20}._Z3JXq{position:absolute;top:0;right:0;width:36px;height:100%;background-color:transparent;line-height:0;border:none;border-radius:4px}._Z3JXq:hover{cursor:pointer}._Z3JXq:hover>._txqbP{fill:#32363a}._Z3JXq:focus{outline:none;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._txqbP{fill:#515559}";
4
+ var styles = {"searchInput":"_9iEPQ","searchInputInput":"_kt9z4","searchInputSearchIcon":"_0j7he","usedWithinInputGroup":"_w-qtH","searchInputClearButton":"_Z3JXq","searchInputClearButtonIcon":"_txqbP"};
5
+ var stylesheet="._9iEPQ{display:inline-block;position:relative}._kt9z4._kt9z4{padding-left:36px;padding-right:36px;width:100%}._kt9z4._kt9z4:disabled+._0j7he{fill-opacity:.6}._0j7he{position:absolute;top:50%;left:0;transform:translateY(-50%);margin-left:6px;fill:#515559;pointer-events:none}._0j7he._w-qtH{z-index:20}._Z3JXq{position:absolute;top:0;right:0;width:36px;height:100%;background-color:transparent;line-height:0;border:none;border-radius:4px}._Z3JXq:hover{cursor:pointer}._Z3JXq:hover>._txqbP{fill:#32363a}._Z3JXq:focus{outline:none;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._txqbP{fill:#515559}";
6
6
  styleInject(css_248z);
7
7
 
8
8
  export { styles as default, stylesheet };