@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.
Files changed (263) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/__shared/cjs/{index-bf07471d.js → index-579c4690.js} +10 -7
  3. package/dist/__shared/cjs/{index-4e4cc354.js → index-90d4069b.js} +999 -1875
  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 +8 -10
  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 +13 -42
  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 +4 -3
  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/MenuButton.js +13 -6
  219. package/dist/next/Menu/MenuContext.js +0 -2
  220. package/dist/next/Menu/MenuItem.js +11 -15
  221. package/dist/next/Menu/MenuPane.js +11 -25
  222. package/dist/next/Menu/MenuSearch.js +15 -22
  223. package/dist/next/Menu/SubMenu.js +10 -27
  224. package/dist/next/Menu/usePaneSearch.js +2 -1
  225. package/dist/next/PhoneNumberInput/PhoneNumberInput.js +12 -19
  226. package/dist/next/PhoneNumberInput/PhoneNumberInput2.js +3 -3
  227. package/dist/next/SplitButton/SplitButton.js +6 -12
  228. package/dist/next/SplitButton/SplitButton2.js +3 -3
  229. package/dist/next/Stack/Stack.js +0 -3
  230. package/dist/next/TimePicker/TimeDropdown.js +4 -5
  231. package/dist/next/TimePicker/TimeInput.js +4 -5
  232. package/dist/next/TimePicker/TimePicker.js +12 -30
  233. package/dist/next/TimePicker/TimePicker2.js +3 -3
  234. package/dist/next/TimePicker/TimePickerIcon.js +1 -3
  235. package/dist/next/TimePicker/utils.js +12 -52
  236. package/dist/next/ToggleButton/ToggleButton.js +0 -5
  237. package/dist/next/ToggleButton/ToggleButtonGroup.js +2 -1
  238. package/dist/next/ToggleButton/styles.js +3 -3
  239. package/dist/next/index.d.ts +5 -4
  240. package/dist/next/index.js +389 -754
  241. package/dist/utils/Flyout/Flyout.js +4 -5
  242. package/dist/utils/Flyout/Flyout2.js +3 -3
  243. package/dist/utils/Popper/Popper.js +18 -25
  244. package/dist/utils/Portal/Portal.js +2 -1
  245. package/dist/utils/TextOverflowTooltip/TextOverflowTooltip.js +4 -4
  246. package/dist/utils/Translation/Translate.js +0 -4
  247. package/dist/utils/Translation/TranslationProvider.js +0 -1
  248. package/dist/utils/Translation/containsComponentOrElement.js +1 -5
  249. package/dist/utils/Translation/insertPlaceholders.js +0 -1
  250. package/dist/utils/Translation/useTranslation.js +7 -14
  251. package/dist/utils/concatIds/concatIds.js +0 -1
  252. package/dist/utils/constants.js +2 -2
  253. package/dist/utils/createContextUtilities/createContextUtilities.js +0 -4
  254. package/dist/utils/filterChildren/filterChildren.js +8 -17
  255. package/dist/utils/getSubDataTestId/getSubDataTestId.js +1 -2
  256. package/dist/utils/keyboardUser/keyboardUser.js +0 -1
  257. package/dist/utils/mediaQueryManager/mediaQueryManager.js +1 -12
  258. package/dist/utils/mergeRefs/mergeRefs.js +1 -2
  259. package/dist/utils/wrapAround/wrapAround.js +1 -2
  260. package/dist/utils/wrapEvent/wrapEvent.js +2 -4
  261. package/icons/package.json +2 -1
  262. package/next/package.json +5 -1
  263. package/package.json +9 -4
@@ -1,8 +1,8 @@
1
1
  import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
2
2
 
3
- var css_248z = "._2nTCj{margin-left:-6px;height:16px;width:16px;border-radius:2px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}._1y1gz{margin-right:-12px;margin-left:4px}._sqZPm{background-color:#fff;border-radius:4px;box-shadow:0 4px 24px -4px rgba(0,0,0,.5);width:156px}._Wbu5f{margin:8px 8px 0;display:flex}._2ffxc,._o3Df6{margin-left:4px}._375G5{margin:8px 4px 0 8px;display:flex;flex-wrap:wrap}._IYlSb{margin:0 4px 4px 0}._IYlSb:hover{width:18px;height:18px;margin:-1px 3px 3px -1px}._1Rz9p{margin:4px 8px 8px}._1HPgc{position:relative;width:96px;height:96px;outline:0}body.keyboard-user ._1HPgc:active:focus ._2VMr1,body.keyboard-user ._1HPgc:focus ._2VMr1{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._T9Pra{background:linear-gradient(90deg,#fff,transparent)}._hx9VG,._T9Pra{position:absolute;top:0;right:0;bottom:0;left:0}._hx9VG{background:linear-gradient(0deg,#000,transparent)}._2VMr1{position:absolute;border:2px solid #fff;border-radius:5px;height:8px;width:8px;margin:0 0 -4px -4px;box-shadow:0 0 1px 1px rgba(0,0,0,.4),inset 0 0 1px #000}._2z6Xz{position:relative;background:linear-gradient(0deg,red,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);width:16px;height:96px;outline:0}body.keyboard-user ._2z6Xz:active:focus ._2D2Yx,body.keyboard-user ._2z6Xz:focus ._2D2Yx{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._2D2Yx{width:16px;height:4px;background:#fff;border-radius:50%;position:absolute;box-shadow:0 0 4px 1px rgba(0,0,0,.4);transform:translateY(2px)}._4XC4e{position:relative;width:16px;height:96px}._3Ft0v{width:16px;height:4px;background:#fff;border-radius:50%;box-shadow:0 0 4px 1px rgba(0,0,0,.4);transform:translateY(2px)}._3D2p-,._3Ft0v{position:absolute}._3D2p-{top:0;right:0;bottom:0;left:0;outline:0}body.keyboard-user ._3D2p-:active:focus ._3Ft0v,body.keyboard-user ._3D2p-:focus ._3Ft0v{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._3JHAc{position:absolute;top:0;right:0;bottom:0;left:0;background-image:linear-gradient(45deg,#d9dadb 25%,transparent 0),linear-gradient(-45deg,#d9dadb 25%,transparent 0),linear-gradient(45deg,transparent 75%,#d9dadb 0),linear-gradient(-45deg,transparent 75%,#d9dadb 0);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0}._35Uk-{border-radius:2px;height:16px;width:16px;cursor:pointer;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}._35Uk-:active:focus,._35Uk-:focus{outline:none}body.keyboard-user ._35Uk-:active:focus,body.keyboard-user ._35Uk-:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._277SJ{display:flex}._277SJ ._eHQP6{position:relative;flex-shrink:0;width:26px;height:26px}._277SJ ._SeQ_q{position:absolute;top:0;right:0;bottom:0;left:0;border-top-left-radius:4px;border-bottom-left-radius:4px;border:1px solid #c6c6c6}._277SJ ._3nx8w{flex-basis:100%;min-width:0;border-top-left-radius:0;border-bottom-left-radius:0}";
4
- var styles = {"colorPickerBtnColor":"_2nTCj","colorPickerBtnIcon":"_1y1gz","colorPicker":"_sqZPm","colorPickerSliderContainer":"_Wbu5f","colorPickerHue":"_2ffxc","colorPickerAlpha":"_o3Df6","colorPickerSwatches":"_375G5","colorPickerSwatch":"_IYlSb","colorPickerHex":"_1Rz9p","saturation":"_1HPgc","saturationCircle":"_2VMr1","saturationWhite":"_T9Pra","saturationBlack":"_hx9VG","hue":"_2z6Xz","hueSlider":"_2D2Yx","alpha":"_4XC4e","alphaSlider":"_3Ft0v","alphaGradient":"_3D2p-","alphaCheckerboard":"_3JHAc","swatch":"_35Uk-","hex":"_277SJ","hexSwatch":"_eHQP6","hexSwatchColor":"_SeQ_q","hexInput":"_3nx8w"};
5
- var stylesheet="._2nTCj{margin-left:-6px;height:16px;width:16px;border-radius:2px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}._1y1gz{margin-right:-12px;margin-left:4px}._sqZPm{background-color:#fff;border-radius:4px;box-shadow:0 4px 24px -4px rgba(0,0,0,.5);width:156px}._Wbu5f{margin:8px 8px 0;display:flex}._2ffxc,._o3Df6{margin-left:4px}._375G5{margin:8px 4px 0 8px;display:flex;flex-wrap:wrap}._IYlSb{margin:0 4px 4px 0}._IYlSb:hover{width:18px;height:18px;margin:-1px 3px 3px -1px}._1Rz9p{margin:4px 8px 8px}._1HPgc{position:relative;width:96px;height:96px;outline:0}body.keyboard-user ._1HPgc:active:focus ._2VMr1,body.keyboard-user ._1HPgc:focus ._2VMr1{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._T9Pra{background:linear-gradient(90deg,#fff,transparent)}._hx9VG,._T9Pra{position:absolute;top:0;right:0;bottom:0;left:0}._hx9VG{background:linear-gradient(0deg,#000,transparent)}._2VMr1{position:absolute;border:2px solid #fff;border-radius:5px;height:8px;width:8px;margin:0 0 -4px -4px;box-shadow:0 0 1px 1px rgba(0,0,0,.4),inset 0 0 1px #000}._2z6Xz{position:relative;background:linear-gradient(0deg,red,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);width:16px;height:96px;outline:0}body.keyboard-user ._2z6Xz:active:focus ._2D2Yx,body.keyboard-user ._2z6Xz:focus ._2D2Yx{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._2D2Yx{width:16px;height:4px;background:#fff;border-radius:50%;position:absolute;box-shadow:0 0 4px 1px rgba(0,0,0,.4);transform:translateY(2px)}._4XC4e{position:relative;width:16px;height:96px}._3Ft0v{width:16px;height:4px;background:#fff;border-radius:50%;box-shadow:0 0 4px 1px rgba(0,0,0,.4);transform:translateY(2px)}._3D2p-,._3Ft0v{position:absolute}._3D2p-{top:0;right:0;bottom:0;left:0;outline:0}body.keyboard-user ._3D2p-:active:focus ._3Ft0v,body.keyboard-user ._3D2p-:focus ._3Ft0v{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._3JHAc{position:absolute;top:0;right:0;bottom:0;left:0;background-image:linear-gradient(45deg,#d9dadb 25%,transparent 0),linear-gradient(-45deg,#d9dadb 25%,transparent 0),linear-gradient(45deg,transparent 75%,#d9dadb 0),linear-gradient(-45deg,transparent 75%,#d9dadb 0);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0}._35Uk-{border-radius:2px;height:16px;width:16px;cursor:pointer;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}._35Uk-:active:focus,._35Uk-:focus{outline:none}body.keyboard-user ._35Uk-:active:focus,body.keyboard-user ._35Uk-:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._277SJ{display:flex}._277SJ ._eHQP6{position:relative;flex-shrink:0;width:26px;height:26px}._277SJ ._SeQ_q{position:absolute;top:0;right:0;bottom:0;left:0;border-top-left-radius:4px;border-bottom-left-radius:4px;border:1px solid #c6c6c6}._277SJ ._3nx8w{flex-basis:100%;min-width:0;border-top-left-radius:0;border-bottom-left-radius:0}";
3
+ var css_248z = "._sK-RJ{margin-left:-6px;height:16px;width:16px;border-radius:2px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}._uJ64f{margin-right:-12px;margin-left:4px}._uJMBh{background-color:#fff;border-radius:4px;box-shadow:0 4px 24px -4px rgba(0,0,0,.5);width:156px}._QR1hM{margin:8px 8px 0;display:flex}._nMFGw,._o1cuG{margin-left:4px}._yJ8-p{margin:8px 4px 0 8px;display:flex;flex-wrap:wrap}._vjDWP{margin:0 4px 4px 0}._vjDWP:hover{width:18px;height:18px;margin:-1px 3px 3px -1px}._3xKD3{margin:4px 8px 8px}._MiW2g{position:relative;width:96px;height:96px;outline:0}body.keyboard-user ._MiW2g:active:focus ._DkwTD,body.keyboard-user ._MiW2g:focus ._DkwTD{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._lG7T7{background:linear-gradient(90deg,#fff,transparent)}._IHy99,._lG7T7{position:absolute;top:0;right:0;bottom:0;left:0}._IHy99{background:linear-gradient(0deg,#000,transparent)}._DkwTD{position:absolute;border:2px solid #fff;border-radius:5px;height:8px;width:8px;margin:0 0 -4px -4px;box-shadow:0 0 1px 1px rgba(0,0,0,.4),inset 0 0 1px #000}._LO80Z{position:relative;background:linear-gradient(0deg,red,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);width:16px;height:96px;outline:0}body.keyboard-user ._LO80Z:active:focus ._iicaf,body.keyboard-user ._LO80Z:focus ._iicaf{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._iicaf{width:16px;height:4px;background:#fff;border-radius:50%;position:absolute;box-shadow:0 0 4px 1px rgba(0,0,0,.4);transform:translateY(2px)}._1kUR1{position:relative;width:16px;height:96px}._ybv-b{width:16px;height:4px;background:#fff;border-radius:50%;box-shadow:0 0 4px 1px rgba(0,0,0,.4);transform:translateY(2px)}._ScrTl,._ybv-b{position:absolute}._ScrTl{top:0;right:0;bottom:0;left:0;outline:0}body.keyboard-user ._ScrTl:active:focus ._ybv-b,body.keyboard-user ._ScrTl:focus ._ybv-b{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._Bogjj{position:absolute;top:0;right:0;bottom:0;left:0;background-image:linear-gradient(45deg,#d9dadb 25%,transparent 0),linear-gradient(-45deg,#d9dadb 25%,transparent 0),linear-gradient(45deg,transparent 75%,#d9dadb 0),linear-gradient(-45deg,transparent 75%,#d9dadb 0);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0}._peq6K{border-radius:2px;height:16px;width:16px;cursor:pointer;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}._peq6K:active:focus,._peq6K:focus{outline:none}body.keyboard-user ._peq6K:active:focus,body.keyboard-user ._peq6K:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._ZPVky{display:flex}._ZPVky ._G0Hee{position:relative;flex-shrink:0;width:26px;height:26px}._ZPVky ._9citq{position:absolute;top:0;right:0;bottom:0;left:0;border-top-left-radius:4px;border-bottom-left-radius:4px;border:1px solid #c6c6c6}._ZPVky ._V4laY{flex-basis:100%;min-width:0;border-top-left-radius:0;border-bottom-left-radius:0}";
4
+ var styles = {"colorPickerBtnColor":"_sK-RJ","colorPickerBtnIcon":"_uJ64f","colorPicker":"_uJMBh","colorPickerSliderContainer":"_QR1hM","colorPickerHue":"_o1cuG","colorPickerAlpha":"_nMFGw","colorPickerSwatches":"_yJ8-p","colorPickerSwatch":"_vjDWP","colorPickerHex":"_3xKD3","saturation":"_MiW2g","saturationCircle":"_DkwTD","saturationWhite":"_lG7T7","saturationBlack":"_IHy99","hue":"_LO80Z","hueSlider":"_iicaf","alpha":"_1kUR1","alphaSlider":"_ybv-b","alphaGradient":"_ScrTl","alphaCheckerboard":"_Bogjj","swatch":"_peq6K","hex":"_ZPVky","hexSwatch":"_G0Hee","hexSwatchColor":"_9citq","hexInput":"_V4laY"};
5
+ var stylesheet="._sK-RJ{margin-left:-6px;height:16px;width:16px;border-radius:2px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}._uJ64f{margin-right:-12px;margin-left:4px}._uJMBh{background-color:#fff;border-radius:4px;box-shadow:0 4px 24px -4px rgba(0,0,0,.5);width:156px}._QR1hM{margin:8px 8px 0;display:flex}._nMFGw,._o1cuG{margin-left:4px}._yJ8-p{margin:8px 4px 0 8px;display:flex;flex-wrap:wrap}._vjDWP{margin:0 4px 4px 0}._vjDWP:hover{width:18px;height:18px;margin:-1px 3px 3px -1px}._3xKD3{margin:4px 8px 8px}._MiW2g{position:relative;width:96px;height:96px;outline:0}body.keyboard-user ._MiW2g:active:focus ._DkwTD,body.keyboard-user ._MiW2g:focus ._DkwTD{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._lG7T7{background:linear-gradient(90deg,#fff,transparent)}._IHy99,._lG7T7{position:absolute;top:0;right:0;bottom:0;left:0}._IHy99{background:linear-gradient(0deg,#000,transparent)}._DkwTD{position:absolute;border:2px solid #fff;border-radius:5px;height:8px;width:8px;margin:0 0 -4px -4px;box-shadow:0 0 1px 1px rgba(0,0,0,.4),inset 0 0 1px #000}._LO80Z{position:relative;background:linear-gradient(0deg,red,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);width:16px;height:96px;outline:0}body.keyboard-user ._LO80Z:active:focus ._iicaf,body.keyboard-user ._LO80Z:focus ._iicaf{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._iicaf{width:16px;height:4px;background:#fff;border-radius:50%;position:absolute;box-shadow:0 0 4px 1px rgba(0,0,0,.4);transform:translateY(2px)}._1kUR1{position:relative;width:16px;height:96px}._ybv-b{width:16px;height:4px;background:#fff;border-radius:50%;box-shadow:0 0 4px 1px rgba(0,0,0,.4);transform:translateY(2px)}._ScrTl,._ybv-b{position:absolute}._ScrTl{top:0;right:0;bottom:0;left:0;outline:0}body.keyboard-user ._ScrTl:active:focus ._ybv-b,body.keyboard-user ._ScrTl:focus ._ybv-b{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._Bogjj{position:absolute;top:0;right:0;bottom:0;left:0;background-image:linear-gradient(45deg,#d9dadb 25%,transparent 0),linear-gradient(-45deg,#d9dadb 25%,transparent 0),linear-gradient(45deg,transparent 75%,#d9dadb 0),linear-gradient(-45deg,transparent 75%,#d9dadb 0);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0}._peq6K{border-radius:2px;height:16px;width:16px;cursor:pointer;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}._peq6K:active:focus,._peq6K:focus{outline:none}body.keyboard-user ._peq6K:active:focus,body.keyboard-user ._peq6K:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._ZPVky{display:flex}._ZPVky ._G0Hee{position:relative;flex-shrink:0;width:26px;height:26px}._ZPVky ._9citq{position:absolute;top:0;right:0;bottom:0;left:0;border-top-left-radius:4px;border-bottom-left-radius:4px;border:1px solid #c6c6c6}._ZPVky ._V4laY{flex-basis:100%;min-width:0;border-top-left-radius:0;border-bottom-left-radius:0}";
6
6
  styleInject(css_248z);
7
7
 
8
8
  export { styles as default, stylesheet };
@@ -6,7 +6,6 @@ import '../Input/index.js';
6
6
  import Input from '../Input/Input.js';
7
7
 
8
8
  const HEX_REGEX = /#?[a-fA-F0-9]{3,}/;
9
-
10
9
  const HexInput = function HexInput(_ref) {
11
10
  let {
12
11
  hex,
@@ -28,26 +27,21 @@ const HexInput = function HexInput(_ref) {
28
27
  }
29
28
  }
30
29
  }, [blurValue, hex, value]);
31
-
32
30
  function isValid(val) {
33
31
  return HEX_REGEX.test(val);
34
32
  }
35
-
36
33
  function handleChange(e) {
37
34
  setValue(e.target.value);
38
-
39
35
  if (isValid(e.target.value)) {
40
- onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value, e);
36
+ onChange?.(e.target.value, e);
41
37
  }
42
38
  }
43
-
44
39
  function handleBlur() {
45
40
  if (blurValue) {
46
41
  setValue(blurValue);
47
42
  setBlurValue(null);
48
43
  }
49
44
  }
50
-
51
45
  return /*#__PURE__*/React__default.createElement("div", {
52
46
  className: classNames(styles.hex, className)
53
47
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -12,7 +12,6 @@ const getMouseChange = (e, hsb, container) => {
12
12
  const y = isMouseEvent(e) ? e.pageY : e.touches[0].pageY;
13
13
  const bottom = container.getBoundingClientRect().bottom + window.pageYOffset - y;
14
14
  let h;
15
-
16
15
  if (bottom < 0) {
17
16
  h = 0;
18
17
  } else if (bottom > containerHeight) {
@@ -21,7 +20,6 @@ const getMouseChange = (e, hsb, container) => {
21
20
  const percent = bottom / containerHeight;
22
21
  h = 360 * percent;
23
22
  }
24
-
25
23
  return {
26
24
  h: Math.round(h),
27
25
  s: hsb.s,
@@ -29,12 +27,10 @@ const getMouseChange = (e, hsb, container) => {
29
27
  a: hsb.a
30
28
  };
31
29
  };
32
-
33
30
  const KEY_CHANGES = {
34
31
  ArrowUp: 4,
35
32
  ArrowDown: -4
36
33
  };
37
-
38
34
  const getKeyChange = (e, hsb) => {
39
35
  const hueChange = KEY_CHANGES[e.key];
40
36
  const h = Math.max(0, Math.min(360, hsb.h + hueChange));
@@ -45,7 +41,6 @@ const getKeyChange = (e, hsb) => {
45
41
  a: hsb.a
46
42
  };
47
43
  };
48
-
49
44
  const Hue = function Hue(_ref) {
50
45
  let {
51
46
  hsb,
@@ -56,17 +51,15 @@ const Hue = function Hue(_ref) {
56
51
  const containerRef = React__default.useRef(null);
57
52
  const handleChange = useEventCallback(e => {
58
53
  const change = getMouseChange(e, hsb, containerRef.current);
59
- onChange === null || onChange === void 0 ? void 0 : onChange(change, e);
54
+ onChange?.(change, e);
60
55
  });
61
56
  const handleMouseDown = useMouseDrag(handleChange);
62
-
63
57
  function handleKeyDown(e) {
64
58
  if (Object.keys(KEY_CHANGES).indexOf(e.key) > -1) {
65
59
  const change = getKeyChange(e, hsb);
66
- onChange === null || onChange === void 0 ? void 0 : onChange(change, e);
60
+ onChange?.(change, e);
67
61
  }
68
62
  }
69
-
70
63
  return (
71
64
  /*#__PURE__*/
72
65
  // eslint-disable-next-line jsx-a11y/no-static-element-interactions
@@ -85,7 +78,7 @@ const Hue = function Hue(_ref) {
85
78
  }), /*#__PURE__*/React__default.createElement("div", {
86
79
  className: styles.hueSlider,
87
80
  style: {
88
- bottom: "".concat(hsb.h / 360 * 100, "%")
81
+ bottom: `${hsb.h / 360 * 100}%`
89
82
  }
90
83
  }))
91
84
  );
@@ -18,19 +18,16 @@ const getMouseChange = (e, hsb, container) => {
18
18
  const y = isMouseEvent(e) ? e.pageY : e.touches[0].pageY;
19
19
  let left = x - (containerLeft + window.pageXOffset);
20
20
  let bottom = containerBottom + window.pageYOffset - y;
21
-
22
21
  if (left < 0) {
23
22
  left = 0;
24
23
  } else if (left > containerWidth) {
25
24
  left = containerWidth;
26
25
  }
27
-
28
26
  if (bottom < 0) {
29
27
  bottom = 0;
30
28
  } else if (bottom > containerHeight) {
31
29
  bottom = containerHeight;
32
30
  }
33
-
34
31
  const saturation = left / containerWidth;
35
32
  const brightness = bottom / containerHeight;
36
33
  return {
@@ -40,7 +37,6 @@ const getMouseChange = (e, hsb, container) => {
40
37
  a: hsb.a
41
38
  };
42
39
  };
43
-
44
40
  const KEY_CHANGES = {
45
41
  ArrowUp: {
46
42
  s: 0,
@@ -59,7 +55,6 @@ const KEY_CHANGES = {
59
55
  b: 0
60
56
  }
61
57
  };
62
-
63
58
  const getKeyChange = (e, hsb) => {
64
59
  const {
65
60
  s: saturationChange,
@@ -74,7 +69,6 @@ const getKeyChange = (e, hsb) => {
74
69
  a: hsb.a
75
70
  };
76
71
  };
77
-
78
72
  const Saturation = function Saturation(_ref) {
79
73
  let {
80
74
  hsb,
@@ -84,30 +78,29 @@ const Saturation = function Saturation(_ref) {
84
78
  } = _ref;
85
79
  const containerRef = React__default.useRef(null);
86
80
  const handleChange = useEventCallback(e => {
87
- onChange === null || onChange === void 0 ? void 0 : onChange(getMouseChange(e, hsb, containerRef.current), e);
81
+ onChange?.(getMouseChange(e, hsb, containerRef.current), e);
88
82
  });
89
83
  const handleMouseDown = useMouseDrag(handleChange);
90
-
91
84
  function handleKeyDown(e) {
92
85
  if (Object.keys(KEY_CHANGES).indexOf(e.key) > -1) {
93
86
  const change = getKeyChange(e, hsb);
94
- onChange === null || onChange === void 0 ? void 0 : onChange(change, e);
87
+ onChange?.(change, e);
95
88
  }
96
89
  }
97
-
98
90
  return (
99
91
  /*#__PURE__*/
100
92
  // eslint-disable-next-line jsx-a11y/no-static-element-interactions
101
93
  React__default.createElement("div", _extends({}, rest, {
102
94
  ref: containerRef,
103
95
  style: {
104
- backgroundColor: "hsl(".concat(hsb.h, ", 100%, 50%)")
96
+ backgroundColor: `hsl(${hsb.h}, 100%, 50%)`
105
97
  },
106
98
  className: classNames(styles.saturation, className),
107
99
  onMouseDown: handleMouseDown,
108
100
  onKeyDown: handleKeyDown,
109
101
  onTouchMove: handleChange,
110
- onTouchStart: handleChange // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
102
+ onTouchStart: handleChange
103
+ // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
111
104
  ,
112
105
  tabIndex: 0
113
106
  }), /*#__PURE__*/React__default.createElement("div", {
@@ -117,8 +110,8 @@ const Saturation = function Saturation(_ref) {
117
110
  }, /*#__PURE__*/React__default.createElement("div", {
118
111
  className: styles.saturationCircle,
119
112
  style: {
120
- bottom: "".concat(hsb.b * 100, "%"),
121
- left: "".concat(hsb.s * 100, "%")
113
+ bottom: `${hsb.b * 100}%`,
114
+ left: `${hsb.s * 100}%`
122
115
  }
123
116
  }))))
124
117
  );
@@ -4,7 +4,6 @@ import classNames from 'classnames';
4
4
  import styles from './ColorPicker2.js';
5
5
 
6
6
  const ENTER = 13;
7
-
8
7
  const Swatch = function Swatch(_ref) {
9
8
  let {
10
9
  color = '#000000',
@@ -12,13 +11,10 @@ const Swatch = function Swatch(_ref) {
12
11
  className,
13
12
  ...rest
14
13
  } = _ref;
15
-
16
14
  function handleClick(e) {
17
- onClick === null || onClick === void 0 ? void 0 : onClick(color, e);
15
+ onClick?.(color, e);
18
16
  }
19
-
20
- const handleKeyDown = e => e.keyCode === ENTER && (onClick === null || onClick === void 0 ? void 0 : onClick(color, e));
21
-
17
+ const handleKeyDown = e => e.keyCode === ENTER && onClick?.(color, e);
22
18
  return /*#__PURE__*/React__default.createElement("span", _extends({}, rest, {
23
19
  role: "button",
24
20
  tabIndex: 0,
@@ -4,16 +4,13 @@ import useEventListener from '../../hooks/useEventListener/useEventListener.js';
4
4
 
5
5
  function useMouseDrag(handleChange) {
6
6
  const [isMouseDown, setIsMouseDown] = React__default.useState(false);
7
-
8
7
  function handleMouseDown(e) {
9
8
  handleChange(e);
10
9
  setIsMouseDown(true);
11
10
  }
12
-
13
11
  function handleMouseUp() {
14
12
  setIsMouseDown(false);
15
13
  }
16
-
17
14
  const isDisabled = !isMouseDown;
18
15
  useEventListener(window, 'mousemove', handleChange, {
19
16
  isDisabled
@@ -38,7 +38,6 @@ const NumberStepper = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
38
38
  onChange,
39
39
  ...rest
40
40
  } = _ref;
41
-
42
41
  /*
43
42
  * Input value that comes from:
44
43
  * (1) The `externalValue` prop, or
@@ -46,15 +45,16 @@ const NumberStepper = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
46
45
  */
47
46
  const [inputValue, setInputValue] = useControllableState(defaultValue, onChange, externalValue);
48
47
  const [wasIncrementOrDecrementButtonPressed, setWasIncrementOrDecrementButtonPressed] = useState(false);
48
+
49
49
  /**
50
50
  * Increments the `inputValue` by `step`.
51
51
  * The new value is bounded by `max` if `max` is defined.
52
52
  */
53
-
54
53
  const increment = useCallback(isTriggeredByIncrementButton => {
55
54
  setInputValue(currentValue => {
56
- const newValue = convertToNumber(currentValue) + step; // Value needs to be rounded for accuracy
55
+ const newValue = convertToNumber(currentValue) + step;
57
56
 
57
+ // Value needs to be rounded for accuracy
58
58
  const newValueRounded = Math.round(newValue * 100) / 100;
59
59
  return clampMinMax(newValueRounded, {
60
60
  max
@@ -62,15 +62,16 @@ const NumberStepper = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
62
62
  });
63
63
  setWasIncrementOrDecrementButtonPressed(isTriggeredByIncrementButton);
64
64
  }, [step, max, setInputValue]);
65
+
65
66
  /**
66
67
  * Decrements the `inputValue` by `step`.
67
68
  * The new value is bounded by `min` if `min` is defined.
68
69
  */
69
-
70
70
  const decrement = useCallback(isTriggeredByDecrementButton => {
71
71
  setInputValue(currentValue => {
72
- const newValue = convertToNumber(currentValue) - step; // Value needs to be rounded for accuracy
72
+ const newValue = convertToNumber(currentValue) - step;
73
73
 
74
+ // Value needs to be rounded for accuracy
74
75
  const newValueRounded = Math.round(newValue * 100) / 100;
75
76
  return clampMinMax(newValueRounded, {
76
77
  min
@@ -78,33 +79,32 @@ const NumberStepper = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
78
79
  });
79
80
  setWasIncrementOrDecrementButtonPressed(isTriggeredByDecrementButton);
80
81
  }, [step, min, setInputValue]);
82
+
81
83
  /**
82
84
  * Updates the `inputValue` to `max`
83
85
  */
84
-
85
86
  const increaseToMax = useCallback(() => {
86
87
  if (max !== undefined) {
87
88
  setInputValue(max);
88
89
  }
89
90
  }, [max, setInputValue]);
91
+
90
92
  /**
91
93
  * Updates the `inputValue` to `min`
92
94
  */
93
-
94
95
  const decreaseToMin = useCallback(() => {
95
96
  if (min !== undefined) {
96
97
  setInputValue(min);
97
98
  }
98
99
  }, [min, setInputValue]);
100
+
99
101
  /**
100
102
  * Updates the `inputValue` to be:
101
103
  * (1) An empty string, or
102
104
  * (2) The entered value as a number
103
105
  */
104
-
105
106
  const handleInputChange = useCallback(e => {
106
107
  const val = e.target.value;
107
-
108
108
  if (val === '') {
109
109
  setInputValue(val);
110
110
  } else {
@@ -113,19 +113,20 @@ const NumberStepper = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
113
113
  setInputValue(newValueRounded);
114
114
  }
115
115
  }, [setInputValue]);
116
+
116
117
  /**
117
118
  * Updates the `inputValue` to be:
118
119
  * (1) The entered value as a number, or
119
120
  * (2) The `min` or `max` value
120
121
  */
121
-
122
122
  const handleInputBlur = useCallback(() => {
123
123
  setInputValue(currentValue => clampMinMax(convertToNumber(currentValue), {
124
124
  min,
125
125
  max
126
126
  }));
127
- }, [max, min, setInputValue]); // NumberStepper context
127
+ }, [max, min, setInputValue]);
128
128
 
129
+ // NumberStepper context
129
130
  const context = useMemo(() => ({
130
131
  isExternallyDisabled,
131
132
  dataTestId,
@@ -159,42 +160,35 @@ const NumberStepper = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
159
160
  className: styles.inputValueAlert
160
161
  }, inputValue));
161
162
  });
163
+
162
164
  /**
163
165
  * Attempts to convert the given `value` to a number
164
166
  */
165
-
166
167
  function convertToNumber(value) {
167
168
  if (typeof value === 'number') {
168
169
  return value;
169
170
  }
170
-
171
171
  const num = Number(value);
172
-
173
172
  if (Number.isNaN(num)) {
174
173
  return 0;
175
174
  }
176
-
177
175
  return num;
178
176
  }
177
+
179
178
  /**
180
179
  * Compares the given `value` to min and/or max
181
180
  */
182
-
183
-
184
181
  function clampMinMax(value, _ref2) {
185
182
  let {
186
183
  min,
187
184
  max
188
185
  } = _ref2;
189
-
190
186
  if (typeof max === 'number' && value > max) {
191
187
  return max;
192
188
  }
193
-
194
189
  if (typeof min === 'number' && value < min) {
195
190
  return min;
196
191
  }
197
-
198
192
  return value;
199
193
  }
200
194
 
@@ -1,8 +1,8 @@
1
1
  import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
2
2
 
3
- var css_248z = "._1kBIZ{display:inline-flex}._36u7B{color:#32363a;background:#fafafa;outline:none;text-align:center;padding:0 12px;min-width:55px;width:100%;font-size:14px;border:1px solid #898989;border-radius:0;-moz-appearance:textfield}._36u7B:hover:not(._2kQQF){cursor:pointer;background:#f5f5f5}._36u7B._DoT4w{box-shadow:0 0 0 2px #fff,0 0 0 4px #900000}._36u7B._2kQQF{cursor:not-allowed;fill:#74777a;color:#74777a;border-color:#e5e5e5}._36u7B._2kQQF>svg{opacity:.4}._36u7B::-webkit-inner-spin-button,._36u7B::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}._36u7B:focus{z-index:0;border:none;border-radius:4px}._36u7B:focus:not(._DoT4w){box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._2K4fp,._36u7B:focus:not(._2kQQF){background:#fafafa}._2K4fp{padding:0;display:flex;justify-content:center;align-items:center;flex-shrink:0;width:36px;height:36px;fill:#515559;outline:none;border-radius:4px 0 0 4px;border:1px solid #898989;border-right-width:0}._2K4fp:hover:not(._2kQQF){cursor:pointer;background:#f5f5f5}._2K4fp:active:not(._2kQQF){background:#e5e5e5}._2K4fp._2kQQF{cursor:not-allowed;fill:#74777a;color:#74777a;border-color:#e5e5e5}._2K4fp._2kQQF>svg{opacity:.4}._1Eccz{padding:0;display:flex;justify-content:center;align-items:center;flex-shrink:0;width:36px;height:36px;background:#fafafa;fill:#515559;outline:none;border-radius:0 4px 4px 0;border:1px solid #898989;border-left-width:0}._1Eccz:hover:not(._2kQQF){cursor:pointer;background:#f5f5f5}._1Eccz:active:not(._2kQQF){background:#e5e5e5}._1Eccz._2kQQF{cursor:not-allowed;fill:#74777a;color:#74777a;border-color:#e5e5e5}._1Eccz._2kQQF>svg{opacity:.4}._J1TNv{position:absolute;top:0;left:0;width:0;height:0;margin:0;overflow:hidden}";
4
- var styles = {"numberStepperContainer":"_1kBIZ","numberStepperInput":"_36u7B","disabled":"_2kQQF","invalid":"_DoT4w","decrementBtn":"_2K4fp","incrementBtn":"_1Eccz","inputValueAlert":"_J1TNv"};
5
- var stylesheet="._1kBIZ{display:inline-flex}._36u7B{color:#32363a;background:#fafafa;outline:none;text-align:center;padding:0 12px;min-width:55px;width:100%;font-size:14px;border:1px solid #898989;border-radius:0;-moz-appearance:textfield}._36u7B:hover:not(._2kQQF){cursor:pointer;background:#f5f5f5}._36u7B._DoT4w{box-shadow:0 0 0 2px #fff,0 0 0 4px #900000}._36u7B._2kQQF{cursor:not-allowed;fill:#74777a;color:#74777a;border-color:#e5e5e5}._36u7B._2kQQF>svg{opacity:.4}._36u7B::-webkit-inner-spin-button,._36u7B::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}._36u7B:focus{z-index:0;border:none;border-radius:4px}._36u7B:focus:not(._DoT4w){box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._2K4fp,._36u7B:focus:not(._2kQQF){background:#fafafa}._2K4fp{padding:0;display:flex;justify-content:center;align-items:center;flex-shrink:0;width:36px;height:36px;fill:#515559;outline:none;border-radius:4px 0 0 4px;border:1px solid #898989;border-right-width:0}._2K4fp:hover:not(._2kQQF){cursor:pointer;background:#f5f5f5}._2K4fp:active:not(._2kQQF){background:#e5e5e5}._2K4fp._2kQQF{cursor:not-allowed;fill:#74777a;color:#74777a;border-color:#e5e5e5}._2K4fp._2kQQF>svg{opacity:.4}._1Eccz{padding:0;display:flex;justify-content:center;align-items:center;flex-shrink:0;width:36px;height:36px;background:#fafafa;fill:#515559;outline:none;border-radius:0 4px 4px 0;border:1px solid #898989;border-left-width:0}._1Eccz:hover:not(._2kQQF){cursor:pointer;background:#f5f5f5}._1Eccz:active:not(._2kQQF){background:#e5e5e5}._1Eccz._2kQQF{cursor:not-allowed;fill:#74777a;color:#74777a;border-color:#e5e5e5}._1Eccz._2kQQF>svg{opacity:.4}._J1TNv{position:absolute;top:0;left:0;width:0;height:0;margin:0;overflow:hidden}";
3
+ var css_248z = "._qVcn7{display:inline-flex}._HYvQZ{color:#32363a;background:#fafafa;outline:none;text-align:center;padding:0 12px;min-width:55px;width:100%;font-size:14px;border:1px solid #898989;border-radius:0;-moz-appearance:textfield}._HYvQZ:hover:not(._QetOJ){cursor:pointer;background:#f5f5f5}._HYvQZ._kKXcG{box-shadow:0 0 0 2px #fff,0 0 0 4px #900000}._HYvQZ._QetOJ{cursor:not-allowed;fill:#74777a;color:#74777a;border-color:#e5e5e5}._HYvQZ._QetOJ>svg{opacity:.4}._HYvQZ::-webkit-inner-spin-button,._HYvQZ::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}._HYvQZ:focus{z-index:0;border:none;border-radius:4px}._HYvQZ:focus:not(._kKXcG){box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._d-GH0,._HYvQZ:focus:not(._QetOJ){background:#fafafa}._d-GH0{padding:0;display:flex;justify-content:center;align-items:center;flex-shrink:0;width:36px;height:36px;fill:#515559;outline:none;border-radius:4px 0 0 4px;border:1px solid #898989;border-right-width:0}._d-GH0:hover:not(._QetOJ){cursor:pointer;background:#f5f5f5}._d-GH0:active:not(._QetOJ){background:#e5e5e5}._d-GH0._QetOJ{cursor:not-allowed;fill:#74777a;color:#74777a;border-color:#e5e5e5}._d-GH0._QetOJ>svg{opacity:.4}._JCVSo{padding:0;display:flex;justify-content:center;align-items:center;flex-shrink:0;width:36px;height:36px;background:#fafafa;fill:#515559;outline:none;border-radius:0 4px 4px 0;border:1px solid #898989;border-left-width:0}._JCVSo:hover:not(._QetOJ){cursor:pointer;background:#f5f5f5}._JCVSo:active:not(._QetOJ){background:#e5e5e5}._JCVSo._QetOJ{cursor:not-allowed;fill:#74777a;color:#74777a;border-color:#e5e5e5}._JCVSo._QetOJ>svg{opacity:.4}._wy6g8{position:absolute;top:0;left:0;width:0;height:0;margin:0;overflow:hidden}";
4
+ var styles = {"numberStepperContainer":"_qVcn7","numberStepperInput":"_HYvQZ","disabled":"_QetOJ","invalid":"_kKXcG","decrementBtn":"_d-GH0","incrementBtn":"_JCVSo","inputValueAlert":"_wy6g8"};
5
+ var stylesheet="._qVcn7{display:inline-flex}._HYvQZ{color:#32363a;background:#fafafa;outline:none;text-align:center;padding:0 12px;min-width:55px;width:100%;font-size:14px;border:1px solid #898989;border-radius:0;-moz-appearance:textfield}._HYvQZ:hover:not(._QetOJ){cursor:pointer;background:#f5f5f5}._HYvQZ._kKXcG{box-shadow:0 0 0 2px #fff,0 0 0 4px #900000}._HYvQZ._QetOJ{cursor:not-allowed;fill:#74777a;color:#74777a;border-color:#e5e5e5}._HYvQZ._QetOJ>svg{opacity:.4}._HYvQZ::-webkit-inner-spin-button,._HYvQZ::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}._HYvQZ:focus{z-index:0;border:none;border-radius:4px}._HYvQZ:focus:not(._kKXcG){box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._d-GH0,._HYvQZ:focus:not(._QetOJ){background:#fafafa}._d-GH0{padding:0;display:flex;justify-content:center;align-items:center;flex-shrink:0;width:36px;height:36px;fill:#515559;outline:none;border-radius:4px 0 0 4px;border:1px solid #898989;border-right-width:0}._d-GH0:hover:not(._QetOJ){cursor:pointer;background:#f5f5f5}._d-GH0:active:not(._QetOJ){background:#e5e5e5}._d-GH0._QetOJ{cursor:not-allowed;fill:#74777a;color:#74777a;border-color:#e5e5e5}._d-GH0._QetOJ>svg{opacity:.4}._JCVSo{padding:0;display:flex;justify-content:center;align-items:center;flex-shrink:0;width:36px;height:36px;background:#fafafa;fill:#515559;outline:none;border-radius:0 4px 4px 0;border:1px solid #898989;border-left-width:0}._JCVSo:hover:not(._QetOJ){cursor:pointer;background:#f5f5f5}._JCVSo:active:not(._QetOJ){background:#e5e5e5}._JCVSo._QetOJ{cursor:not-allowed;fill:#74777a;color:#74777a;border-color:#e5e5e5}._JCVSo._QetOJ>svg{opacity:.4}._wy6g8{position:absolute;top:0;left:0;width:0;height:0;margin:0;overflow:hidden}";
6
6
  styleInject(css_248z);
7
7
 
8
8
  export { styles as default, stylesheet };
@@ -27,31 +27,32 @@ const NumberStepperDecrement = /*#__PURE__*/React__default.forwardRef((_ref, ref
27
27
  } = _ref;
28
28
  const {
29
29
  translate
30
- } = useTranslation(); // Context from NumberStepper
30
+ } = useTranslation();
31
31
 
32
+ // Context from NumberStepper
32
33
  const {
33
34
  isExternallyDisabled,
34
35
  dataTestId,
35
36
  decrement,
36
37
  inputValue,
37
38
  min
38
- } = useNumberStepperContext(); // Indicates if the button is disabled
39
+ } = useNumberStepperContext();
39
40
 
41
+ // Indicates if the button is disabled
40
42
  const isDisabled = inputValue <= min || isExternallyDisabled;
43
+
41
44
  /**
42
45
  * Calls `onClick` if it is defined.
43
46
  * Calls `decrement`.
44
47
  */
45
-
46
48
  const handleClick = e => {
47
49
  if (!isDisabled) {
48
- onClick === null || onClick === void 0 ? void 0 : onClick(e);
50
+ onClick?.(e);
49
51
  decrement(true);
50
52
  }
51
53
  };
52
-
53
54
  return /*#__PURE__*/React__default.createElement("button", _extends({}, rest, {
54
- "data-testid": dataTestIdFromProps !== null && dataTestIdFromProps !== void 0 ? dataTestIdFromProps : getSubDataTestId(dataTestId, 'Decrement'),
55
+ "data-testid": dataTestIdFromProps ?? getSubDataTestId(dataTestId, 'Decrement'),
55
56
  ref: ref,
56
57
  type: "button",
57
58
  className: classNames(className, styles.decrementBtn, {
@@ -27,31 +27,32 @@ const NumberStepperIncrement = /*#__PURE__*/React__default.forwardRef((_ref, ref
27
27
  } = _ref;
28
28
  const {
29
29
  translate
30
- } = useTranslation(); // Context from NumberStepper
30
+ } = useTranslation();
31
31
 
32
+ // Context from NumberStepper
32
33
  const {
33
34
  isExternallyDisabled,
34
35
  dataTestId,
35
36
  increment,
36
37
  inputValue,
37
38
  max
38
- } = useNumberStepperContext(); // Indicates if the button is disabled
39
+ } = useNumberStepperContext();
39
40
 
41
+ // Indicates if the button is disabled
40
42
  const isDisabled = inputValue >= max || isExternallyDisabled;
43
+
41
44
  /**
42
45
  * Calls `onClick` if it is defined.
43
46
  * Calls `increment`.
44
47
  */
45
-
46
48
  const handleClick = e => {
47
49
  if (!isDisabled) {
48
- onClick === null || onClick === void 0 ? void 0 : onClick(e);
50
+ onClick?.(e);
49
51
  increment(true);
50
52
  }
51
53
  };
52
-
53
54
  return /*#__PURE__*/React__default.createElement("button", _extends({}, rest, {
54
- "data-testid": dataTestIdFromProps !== null && dataTestIdFromProps !== void 0 ? dataTestIdFromProps : getSubDataTestId(dataTestId, 'Increment'),
55
+ "data-testid": dataTestIdFromProps ?? getSubDataTestId(dataTestId, 'Increment'),
55
56
  ref: ref,
56
57
  type: "button",
57
58
  className: classNames(className, styles.incrementBtn, {
@@ -48,25 +48,26 @@ const NumberStepperInput = /*#__PURE__*/React__default.forwardRef((_ref, ref) =>
48
48
  ariaDescribedBy,
49
49
  handleInputChange,
50
50
  handleInputBlur
51
- } = useNumberStepperContext(); // TODO: Add proper styling for the form field label (this is a breaking change)
51
+ } = useNumberStepperContext();
52
52
 
53
+ // TODO: Add proper styling for the form field label (this is a breaking change)
53
54
  const {
54
55
  helperTextId: formFieldHelperTextId,
55
56
  errorTextId: formFieldErrorTextId
56
57
  } = useFormFieldControl();
57
- const internalAriaDescribedby = concatIds(ariaDescribedByFromProps !== null && ariaDescribedByFromProps !== void 0 ? ariaDescribedByFromProps : ariaDescribedBy, formFieldHelperTextId, formFieldErrorTextId); // Indicates if the `inputValue` is invalid
58
+ const internalAriaDescribedby = concatIds(ariaDescribedByFromProps ?? ariaDescribedBy, formFieldHelperTextId, formFieldErrorTextId);
58
59
 
60
+ // Indicates if the `inputValue` is invalid
59
61
  const isInputValueInvalid = typeof inputValue === 'number' && (inputValue > inputMax || inputValue < inputMin);
62
+
60
63
  /**
61
64
  * Calls `onKeyDown` if it is defined.
62
65
  * Calls `increment`, `decrement`, `increaseToMax`, or `decreaseToMin`
63
66
  * depending on the key that was pressed.
64
67
  */
65
-
66
68
  const handleKeyDown = e => {
67
- onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
69
+ onKeyDown?.(e);
68
70
  if (isExternallyDisabled) return;
69
-
70
71
  if (e.key === 'ArrowUp') {
71
72
  // Prevents browser's default increment
72
73
  e.preventDefault();
@@ -83,7 +84,8 @@ const NumberStepperInput = /*#__PURE__*/React__default.forwardRef((_ref, ref) =>
83
84
  // Prevents browser's default page scroll
84
85
  e.preventDefault();
85
86
  decreaseToMin();
86
- } // The w3 defines 'PageUp' and 'PageDown' as optional behavior.
87
+ }
88
+ // The w3 defines 'PageUp' and 'PageDown' as optional behavior.
87
89
  // We decided not to add this optional behavior, but still wanted to prevent default scrolling behavior.
88
90
  else if (e.key === 'PageUp') {
89
91
  // Prevents browser's default page scroll
@@ -93,34 +95,31 @@ const NumberStepperInput = /*#__PURE__*/React__default.forwardRef((_ref, ref) =>
93
95
  e.preventDefault();
94
96
  }
95
97
  };
98
+
96
99
  /**
97
100
  * Calls `onFocus` if it is defined.
98
101
  * Selects the DOM element
99
102
  */
100
-
101
-
102
103
  const handleFocus = e => {
103
- onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
104
+ onFocus?.(e);
104
105
  if (isExternallyDisabled) return;
105
106
  e.target.select();
106
107
  };
108
+
107
109
  /**
108
110
  * Calls `onBlur` if it is defined.
109
111
  * Calls `handleInputBlur`
110
112
  */
111
-
112
-
113
113
  const handleBlur = e => {
114
- onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
114
+ onBlur?.(e);
115
115
  if (isExternallyDisabled) return;
116
116
  handleInputBlur(e);
117
117
  };
118
-
119
118
  return /*#__PURE__*/React__default.createElement("input", _extends({}, rest, {
120
119
  // `type`, `step`, `min`, `max`, `onChange`, and `value` are purposely overwritten
121
120
  ref: ref,
122
- "data-testid": dataTestIdFromProps !== null && dataTestIdFromProps !== void 0 ? dataTestIdFromProps : getSubDataTestId(dataTestId, 'Input'),
123
- id: idFromProps !== null && idFromProps !== void 0 ? idFromProps : inputId,
121
+ "data-testid": dataTestIdFromProps ?? getSubDataTestId(dataTestId, 'Input'),
122
+ id: idFromProps ?? inputId,
124
123
  className: classNames(className, styles.numberStepperInput, {
125
124
  [styles.invalid]: isInputValueInvalid,
126
125
  [styles.disabled]: isExternallyDisabled
@@ -133,8 +132,8 @@ const NumberStepperInput = /*#__PURE__*/React__default.forwardRef((_ref, ref) =>
133
132
  "aria-valuemin": inputMin,
134
133
  "aria-valuemax": inputMax,
135
134
  "aria-valuenow": Number(inputValue),
136
- "aria-label": ariaLabelFromProps !== null && ariaLabelFromProps !== void 0 ? ariaLabelFromProps : ariaLabel,
137
- "aria-labelledby": ariaLabelledByFromProps !== null && ariaLabelledByFromProps !== void 0 ? ariaLabelledByFromProps : ariaLabelledBy,
135
+ "aria-label": ariaLabelFromProps ?? ariaLabel,
136
+ "aria-labelledby": ariaLabelledByFromProps ?? ariaLabelledBy,
138
137
  "aria-describedby": internalAriaDescribedby,
139
138
  "aria-invalid": isInputValueInvalid,
140
139
  "aria-disabled": isExternallyDisabled,