@itwin/itwinui-react 2.0.0-dev.2 → 2.0.0-dev.3

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 (474) hide show
  1. package/README.md +10 -1
  2. package/cjs/core/Alert/Alert.js +8 -30
  3. package/cjs/core/Avatar/Avatar.js +10 -33
  4. package/cjs/core/AvatarGroup/AvatarGroup.js +18 -43
  5. package/cjs/core/Backdrop/Backdrop.js +6 -28
  6. package/cjs/core/Badge/Badge.js +13 -31
  7. package/cjs/core/Breadcrumbs/Breadcrumbs.js +14 -40
  8. package/cjs/core/ButtonGroup/ButtonGroup.js +10 -32
  9. package/cjs/core/Buttons/Button/Button.js +6 -28
  10. package/cjs/core/Buttons/DropdownButton/DropdownButton.js +14 -36
  11. package/cjs/core/Buttons/IconButton/IconButton.js +6 -28
  12. package/cjs/core/Buttons/IdeasButton/IdeasButton.js +6 -28
  13. package/cjs/core/Buttons/SplitButton/SplitButton.js +14 -36
  14. package/cjs/core/Carousel/Carousel.js +38 -63
  15. package/cjs/core/Carousel/CarouselContext.js +1 -1
  16. package/cjs/core/Carousel/CarouselDot.js +6 -28
  17. package/cjs/core/Carousel/CarouselDotsList.js +33 -60
  18. package/cjs/core/Carousel/CarouselNavigation.js +22 -44
  19. package/cjs/core/Carousel/CarouselSlide.js +12 -34
  20. package/cjs/core/Carousel/CarouselSlider.js +26 -51
  21. package/cjs/core/Checkbox/Checkbox.js +18 -42
  22. package/cjs/core/ColorPicker/ColorBuilder.js +51 -73
  23. package/cjs/core/ColorPicker/ColorInputPanel.js +64 -88
  24. package/cjs/core/ColorPicker/ColorPalette.js +26 -50
  25. package/cjs/core/ColorPicker/ColorPicker.js +25 -49
  26. package/cjs/core/ColorPicker/ColorPickerContext.js +3 -3
  27. package/cjs/core/ColorPicker/ColorSwatch.js +13 -34
  28. package/cjs/core/ComboBox/ComboBox.js +67 -93
  29. package/cjs/core/ComboBox/ComboBoxDropdown.d.ts +1 -1
  30. package/cjs/core/ComboBox/ComboBoxDropdown.js +13 -36
  31. package/cjs/core/ComboBox/ComboBoxEndIcon.js +12 -34
  32. package/cjs/core/ComboBox/ComboBoxInput.js +28 -50
  33. package/cjs/core/ComboBox/ComboBoxInputContainer.js +9 -31
  34. package/cjs/core/ComboBox/ComboBoxMenu.js +35 -60
  35. package/cjs/core/ComboBox/ComboBoxMenuItem.js +11 -33
  36. package/cjs/core/ComboBox/helpers.js +11 -19
  37. package/cjs/core/DatePicker/DatePicker.js +87 -111
  38. package/cjs/core/Dialog/Dialog.js +28 -48
  39. package/cjs/core/Dialog/DialogBackdrop.js +16 -35
  40. package/cjs/core/Dialog/DialogButtonBar.js +6 -28
  41. package/cjs/core/Dialog/DialogContent.js +6 -28
  42. package/cjs/core/Dialog/DialogContext.js +2 -2
  43. package/cjs/core/Dialog/DialogDragContext.js +6 -15
  44. package/cjs/core/Dialog/DialogMain.js +52 -59
  45. package/cjs/core/Dialog/DialogTitleBar.js +14 -36
  46. package/cjs/core/Dialog/DialogTitleBarTitle.js +6 -28
  47. package/cjs/core/DropdownMenu/DropdownMenu.js +14 -36
  48. package/cjs/core/ExpandableBlock/ExpandableBlock.js +12 -34
  49. package/cjs/core/Fieldset/Fieldset.js +9 -33
  50. package/cjs/core/FileUpload/FileUpload.js +13 -35
  51. package/cjs/core/FileUpload/FileUploadTemplate.js +4 -4
  52. package/cjs/core/Footer/Footer.js +21 -49
  53. package/cjs/core/Footer/FooterItem.js +6 -28
  54. package/cjs/core/Footer/FooterList.js +6 -28
  55. package/cjs/core/Footer/FooterSeparator.js +6 -28
  56. package/cjs/core/Header/Header.js +10 -32
  57. package/cjs/core/Header/HeaderBasicButton.js +6 -28
  58. package/cjs/core/Header/HeaderBreadcrumbs.js +9 -39
  59. package/cjs/core/Header/HeaderButton.js +22 -36
  60. package/cjs/core/Header/HeaderDropdownButton.js +14 -36
  61. package/cjs/core/Header/HeaderLogo.js +7 -29
  62. package/cjs/core/Header/HeaderSplitButton.js +13 -35
  63. package/cjs/core/InformationPanel/InformationPanel.js +15 -37
  64. package/cjs/core/InformationPanel/InformationPanelBody.js +6 -28
  65. package/cjs/core/InformationPanel/InformationPanelContent.js +6 -28
  66. package/cjs/core/InformationPanel/InformationPanelHeader.js +7 -29
  67. package/cjs/core/InformationPanel/InformationPanelWrapper.js +6 -28
  68. package/cjs/core/Input/Input.js +9 -31
  69. package/cjs/core/InputGroup/InputGroup.js +6 -28
  70. package/cjs/core/Label/Label.js +7 -29
  71. package/cjs/core/LabeledInput/LabeledInput.js +7 -29
  72. package/cjs/core/LabeledSelect/LabeledSelect.js +7 -29
  73. package/cjs/core/LabeledTextarea/LabeledTextarea.js +7 -29
  74. package/cjs/core/Menu/Menu.js +18 -40
  75. package/cjs/core/Menu/MenuDivider.js +6 -28
  76. package/cjs/core/Menu/MenuExtraContent.js +6 -28
  77. package/cjs/core/Menu/MenuItem.js +17 -39
  78. package/cjs/core/Menu/MenuItemSkeleton.js +11 -30
  79. package/cjs/core/Modal/Modal.js +12 -30
  80. package/cjs/core/Modal/ModalButtonBar.js +1 -1
  81. package/cjs/core/Modal/ModalContent.js +1 -1
  82. package/cjs/core/{ErrorPage → NonIdealState}/ErrorPage.d.ts +5 -1
  83. package/cjs/core/NonIdealState/ErrorPage.js +144 -0
  84. package/cjs/core/NonIdealState/NonIdealState.d.ts +46 -0
  85. package/cjs/core/NonIdealState/NonIdealState.js +32 -0
  86. package/{esm/core/ErrorPage → cjs/core/NonIdealState}/index.d.ts +3 -1
  87. package/cjs/core/{ErrorPage → NonIdealState}/index.js +4 -2
  88. package/cjs/core/ProgressIndicators/ProgressLinear/ProgressLinear.js +11 -34
  89. package/cjs/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +13 -37
  90. package/cjs/core/Radio/Radio.js +10 -33
  91. package/cjs/core/RadioTiles/RadioTile.js +9 -31
  92. package/cjs/core/RadioTiles/RadioTileGroup.js +6 -28
  93. package/cjs/core/Select/Select.js +59 -72
  94. package/cjs/core/Select/SelectTag.js +6 -28
  95. package/cjs/core/SideNavigation/SideNavigation.js +14 -40
  96. package/cjs/core/SideNavigation/SidenavButton.js +8 -30
  97. package/cjs/core/SideNavigation/SidenavSubmenu.js +6 -28
  98. package/cjs/core/SideNavigation/SidenavSubmenuHeader.js +6 -28
  99. package/cjs/core/SkipToContentLink/SkipToContentLink.js +6 -28
  100. package/cjs/core/Slider/Slider.js +68 -96
  101. package/cjs/core/Slider/Thumb.js +20 -39
  102. package/cjs/core/Slider/Track.js +24 -44
  103. package/cjs/core/StatusMessage/StatusMessage.js +6 -7
  104. package/cjs/core/Stepper/Stepper.js +10 -34
  105. package/cjs/core/Stepper/StepperStep.js +15 -34
  106. package/cjs/core/Stepper/Wizard.js +6 -28
  107. package/cjs/core/Stepper/WorkflowDiagram.js +6 -28
  108. package/cjs/core/Stepper/WorkflowDiagramStep.js +6 -28
  109. package/cjs/core/Surface/Surface.js +11 -30
  110. package/cjs/core/Table/SubRowExpander.js +6 -6
  111. package/cjs/core/Table/Table.d.ts +19 -24
  112. package/cjs/core/Table/Table.js +189 -195
  113. package/cjs/core/Table/TableCell.js +29 -30
  114. package/cjs/core/Table/TablePaginator.js +52 -83
  115. package/cjs/core/Table/TableRowMemoized.d.ts +6 -10
  116. package/cjs/core/Table/TableRowMemoized.js +36 -60
  117. package/cjs/core/Table/actionHandlers/expandHandler.js +3 -3
  118. package/cjs/core/Table/actionHandlers/filterHandler.js +4 -4
  119. package/cjs/core/Table/actionHandlers/resizeHandler.js +13 -15
  120. package/cjs/core/Table/actionHandlers/selectHandler.js +35 -40
  121. package/cjs/core/Table/cells/DefaultCell.js +5 -27
  122. package/cjs/core/Table/cells/EditableCell.js +16 -40
  123. package/cjs/core/Table/columns/actionColumn.js +44 -62
  124. package/cjs/core/Table/columns/expanderColumn.d.ts +2 -5
  125. package/cjs/core/Table/columns/expanderColumn.js +12 -27
  126. package/cjs/core/Table/columns/selectionColumn.d.ts +2 -5
  127. package/cjs/core/Table/columns/selectionColumn.js +16 -37
  128. package/cjs/core/Table/filters/BaseFilter.js +6 -6
  129. package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.js +19 -41
  130. package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.js +20 -31
  131. package/cjs/core/Table/filters/FilterButtonBar.js +8 -19
  132. package/cjs/core/Table/filters/FilterToggle.js +15 -37
  133. package/cjs/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +16 -29
  134. package/cjs/core/Table/filters/TextFilter/TextFilter.js +11 -11
  135. package/cjs/core/Table/filters/customFilterFunctions.js +11 -13
  136. package/cjs/core/Table/filters/defaultFilterFunctions.js +62 -64
  137. package/cjs/core/Table/filters/tableFilters.js +7 -18
  138. package/cjs/core/Table/hooks/useColumnDragAndDrop.js +41 -53
  139. package/cjs/core/Table/hooks/useExpanderCell.js +17 -33
  140. package/cjs/core/Table/hooks/useResizeColumns.js +197 -205
  141. package/cjs/core/Table/hooks/useScrollToRow.js +11 -12
  142. package/cjs/core/Table/hooks/useSelectionCell.js +7 -18
  143. package/cjs/core/Table/hooks/useStickyColumns.js +28 -33
  144. package/cjs/core/Table/hooks/useSubRowFiltering.js +37 -57
  145. package/cjs/core/Table/hooks/useSubRowSelection.js +10 -12
  146. package/cjs/core/Table/utils.js +15 -26
  147. package/cjs/core/Tabs/Tab.js +6 -28
  148. package/cjs/core/Tabs/Tabs.js +45 -67
  149. package/cjs/core/Tag/Tag.js +8 -30
  150. package/cjs/core/Tag/TagContainer.js +9 -32
  151. package/cjs/core/Textarea/Textarea.js +9 -31
  152. package/cjs/core/ThemeProvider/ThemeProvider.d.ts +1 -0
  153. package/cjs/core/ThemeProvider/ThemeProvider.js +16 -37
  154. package/cjs/core/Tile/Tile.js +29 -58
  155. package/cjs/core/TimePicker/TimePicker.js +59 -97
  156. package/cjs/core/Toast/Toast.js +45 -65
  157. package/cjs/core/Toast/ToastWrapper.js +13 -24
  158. package/cjs/core/Toast/Toaster.js +87 -137
  159. package/cjs/core/Toast/index.js +2 -2
  160. package/cjs/core/ToggleSwitch/ToggleSwitch.js +10 -32
  161. package/cjs/core/Tooltip/Tooltip.js +6 -28
  162. package/cjs/core/Tree/Tree.js +58 -80
  163. package/cjs/core/Tree/TreeContext.js +3 -3
  164. package/cjs/core/Tree/TreeNode.js +21 -43
  165. package/cjs/core/Tree/TreeNodeExpander.js +7 -29
  166. package/cjs/core/Typography/Anchor/Anchor.js +5 -28
  167. package/cjs/core/Typography/Blockquote/Blockquote.js +6 -28
  168. package/cjs/core/Typography/Body/Body.js +7 -29
  169. package/cjs/core/Typography/Code/Code.js +6 -28
  170. package/cjs/core/Typography/Headline/Headline.js +6 -28
  171. package/cjs/core/Typography/Kbd/Kbd.js +6 -28
  172. package/cjs/core/Typography/Leading/Leading.js +6 -28
  173. package/cjs/core/Typography/Small/Small.js +6 -28
  174. package/cjs/core/Typography/Subheading/Subheading.js +6 -28
  175. package/cjs/core/Typography/Text/Text.js +11 -34
  176. package/cjs/core/Typography/Title/Title.js +6 -28
  177. package/cjs/core/index.d.ts +2 -2
  178. package/cjs/core/index.js +6 -5
  179. package/cjs/core/utils/color/ColorValue.js +146 -156
  180. package/cjs/core/utils/components/FocusTrap.js +14 -14
  181. package/cjs/core/utils/components/InputContainer.js +12 -36
  182. package/cjs/core/utils/components/MiddleTextTruncation.js +15 -31
  183. package/cjs/core/utils/components/Popover.d.ts +1 -1
  184. package/cjs/core/utils/components/Popover.js +57 -60
  185. package/cjs/core/utils/components/Resizer.js +51 -51
  186. package/cjs/core/utils/components/VirtualScroll.js +72 -89
  187. package/cjs/core/utils/components/VisuallyHidden.js +6 -28
  188. package/cjs/core/utils/components/WithCSSTransition.d.ts +2 -2
  189. package/cjs/core/utils/components/WithCSSTransition.js +18 -40
  190. package/cjs/core/utils/functions/colors.js +7 -7
  191. package/cjs/core/utils/functions/dom.js +7 -8
  192. package/cjs/core/utils/functions/focusable.js +11 -15
  193. package/cjs/core/utils/functions/numbers.js +5 -6
  194. package/cjs/core/utils/functions/styles.js +3 -3
  195. package/cjs/core/utils/hooks/useContainerWidth.js +9 -13
  196. package/cjs/core/utils/hooks/useDragAndDrop.js +32 -33
  197. package/cjs/core/utils/hooks/useEventListener.js +7 -7
  198. package/cjs/core/utils/hooks/useIntersection.js +9 -12
  199. package/cjs/core/utils/hooks/useIsomorphicLayoutEffect.js +1 -1
  200. package/cjs/core/utils/hooks/useLatestRef.js +4 -4
  201. package/cjs/core/utils/hooks/useMediaQuery.js +9 -12
  202. package/cjs/core/utils/hooks/useMergedRefs.js +6 -23
  203. package/cjs/core/utils/hooks/useOverflow.js +26 -33
  204. package/cjs/core/utils/hooks/useResizeObserver.js +6 -9
  205. package/cjs/core/utils/hooks/useSafeContext.js +4 -4
  206. package/cjs/core/utils/hooks/useTheme.js +18 -20
  207. package/cjs/core/utils/icons/StatusIconMap.js +9 -20
  208. package/cjs/core/utils/icons/SvgCalendar.js +3 -14
  209. package/cjs/core/utils/icons/SvgCaretDownSmall.js +3 -14
  210. package/cjs/core/utils/icons/SvgCaretRightSmall.js +3 -14
  211. package/cjs/core/utils/icons/SvgCaretUpSmall.js +3 -14
  212. package/cjs/core/utils/icons/SvgCheckmark.js +3 -14
  213. package/cjs/core/utils/icons/SvgCheckmarkSmall.js +3 -14
  214. package/cjs/core/utils/icons/SvgChevronLeft.js +3 -14
  215. package/cjs/core/utils/icons/SvgChevronLeftDouble.js +3 -14
  216. package/cjs/core/utils/icons/SvgChevronRight.js +3 -14
  217. package/cjs/core/utils/icons/SvgChevronRightDouble.js +3 -14
  218. package/cjs/core/utils/icons/SvgClose.js +3 -14
  219. package/cjs/core/utils/icons/SvgCloseSmall.js +3 -14
  220. package/cjs/core/utils/icons/SvgColumnManager.js +3 -14
  221. package/cjs/core/utils/icons/SvgFilter.js +3 -14
  222. package/cjs/core/utils/icons/SvgFilterHollow.js +3 -14
  223. package/cjs/core/utils/icons/SvgImportantSmall.js +3 -14
  224. package/cjs/core/utils/icons/SvgInfoCircular.js +3 -14
  225. package/cjs/core/utils/icons/SvgMore.js +3 -14
  226. package/cjs/core/utils/icons/SvgMoreVertical.js +3 -14
  227. package/cjs/core/utils/icons/SvgNew.js +3 -14
  228. package/cjs/core/utils/icons/SvgSmileyHappy.js +3 -14
  229. package/cjs/core/utils/icons/SvgSortDown.js +3 -14
  230. package/cjs/core/utils/icons/SvgSortUp.js +3 -14
  231. package/cjs/core/utils/icons/SvgStatusError.js +3 -14
  232. package/cjs/core/utils/icons/SvgStatusSuccess.js +3 -14
  233. package/cjs/core/utils/icons/SvgStatusWarning.js +3 -14
  234. package/cjs/core/utils/icons/SvgSwap.js +3 -14
  235. package/cjs/core/utils/icons/SvgUpload.js +3 -14
  236. package/cjs/types/react-table-config.d.ts +1 -1
  237. package/esm/core/Alert/Alert.js +5 -27
  238. package/esm/core/Avatar/Avatar.js +9 -32
  239. package/esm/core/AvatarGroup/AvatarGroup.js +16 -41
  240. package/esm/core/Backdrop/Backdrop.js +3 -25
  241. package/esm/core/Badge/Badge.js +10 -28
  242. package/esm/core/Breadcrumbs/Breadcrumbs.js +11 -37
  243. package/esm/core/ButtonGroup/ButtonGroup.js +7 -29
  244. package/esm/core/Buttons/Button/Button.js +3 -25
  245. package/esm/core/Buttons/DropdownButton/DropdownButton.js +9 -31
  246. package/esm/core/Buttons/IconButton/IconButton.js +3 -25
  247. package/esm/core/Buttons/IdeasButton/IdeasButton.js +3 -25
  248. package/esm/core/Buttons/SplitButton/SplitButton.js +8 -30
  249. package/esm/core/Carousel/Carousel.js +29 -54
  250. package/esm/core/Carousel/CarouselContext.js +1 -1
  251. package/esm/core/Carousel/CarouselDot.js +4 -26
  252. package/esm/core/Carousel/CarouselDotsList.js +28 -55
  253. package/esm/core/Carousel/CarouselNavigation.js +16 -38
  254. package/esm/core/Carousel/CarouselSlide.js +8 -30
  255. package/esm/core/Carousel/CarouselSlider.js +22 -47
  256. package/esm/core/Checkbox/Checkbox.js +14 -38
  257. package/esm/core/ColorPicker/ColorBuilder.js +46 -68
  258. package/esm/core/ColorPicker/ColorInputPanel.js +58 -82
  259. package/esm/core/ColorPicker/ColorPalette.js +20 -44
  260. package/esm/core/ColorPicker/ColorPicker.js +21 -45
  261. package/esm/core/ColorPicker/ColorPickerContext.js +3 -3
  262. package/esm/core/ColorPicker/ColorSwatch.js +9 -30
  263. package/esm/core/ComboBox/ComboBox.js +55 -81
  264. package/esm/core/ComboBox/ComboBoxDropdown.d.ts +1 -1
  265. package/esm/core/ComboBox/ComboBoxDropdown.js +10 -33
  266. package/esm/core/ComboBox/ComboBoxEndIcon.js +8 -30
  267. package/esm/core/ComboBox/ComboBoxInput.js +24 -46
  268. package/esm/core/ComboBox/ComboBoxInputContainer.js +5 -27
  269. package/esm/core/ComboBox/ComboBoxMenu.js +29 -54
  270. package/esm/core/ComboBox/ComboBoxMenuItem.js +7 -29
  271. package/esm/core/ComboBox/helpers.js +13 -21
  272. package/esm/core/DatePicker/DatePicker.js +82 -106
  273. package/esm/core/Dialog/Dialog.js +19 -39
  274. package/esm/core/Dialog/DialogBackdrop.js +11 -30
  275. package/esm/core/Dialog/DialogButtonBar.js +3 -25
  276. package/esm/core/Dialog/DialogContent.js +3 -25
  277. package/esm/core/Dialog/DialogContext.js +2 -2
  278. package/esm/core/Dialog/DialogDragContext.js +6 -15
  279. package/esm/core/Dialog/DialogMain.js +45 -52
  280. package/esm/core/Dialog/DialogTitleBar.js +7 -29
  281. package/esm/core/Dialog/DialogTitleBarTitle.js +3 -25
  282. package/esm/core/DropdownMenu/DropdownMenu.js +11 -33
  283. package/esm/core/ExpandableBlock/ExpandableBlock.js +9 -31
  284. package/esm/core/Fieldset/Fieldset.js +6 -30
  285. package/esm/core/FileUpload/FileUpload.js +10 -32
  286. package/esm/core/FileUpload/FileUploadTemplate.js +2 -2
  287. package/esm/core/Footer/Footer.js +16 -44
  288. package/esm/core/Footer/FooterItem.js +3 -25
  289. package/esm/core/Footer/FooterList.js +3 -25
  290. package/esm/core/Footer/FooterSeparator.js +3 -25
  291. package/esm/core/Header/Header.js +5 -27
  292. package/esm/core/Header/HeaderBasicButton.js +3 -25
  293. package/esm/core/Header/HeaderBreadcrumbs.js +7 -37
  294. package/esm/core/Header/HeaderButton.js +16 -30
  295. package/esm/core/Header/HeaderDropdownButton.js +9 -31
  296. package/esm/core/Header/HeaderLogo.js +4 -26
  297. package/esm/core/Header/HeaderSplitButton.js +8 -30
  298. package/esm/core/InformationPanel/InformationPanel.js +12 -34
  299. package/esm/core/InformationPanel/InformationPanelBody.js +3 -25
  300. package/esm/core/InformationPanel/InformationPanelContent.js +3 -25
  301. package/esm/core/InformationPanel/InformationPanelHeader.js +3 -25
  302. package/esm/core/InformationPanel/InformationPanelWrapper.js +3 -25
  303. package/esm/core/Input/Input.js +6 -28
  304. package/esm/core/InputGroup/InputGroup.js +4 -26
  305. package/esm/core/Label/Label.js +4 -26
  306. package/esm/core/LabeledInput/LabeledInput.js +4 -26
  307. package/esm/core/LabeledSelect/LabeledSelect.js +4 -26
  308. package/esm/core/LabeledTextarea/LabeledTextarea.js +4 -26
  309. package/esm/core/Menu/Menu.js +15 -37
  310. package/esm/core/Menu/MenuDivider.js +3 -25
  311. package/esm/core/Menu/MenuExtraContent.js +3 -25
  312. package/esm/core/Menu/MenuItem.js +13 -35
  313. package/esm/core/Menu/MenuItemSkeleton.js +8 -27
  314. package/esm/core/Modal/Modal.js +8 -26
  315. package/esm/core/Modal/ModalButtonBar.js +1 -1
  316. package/esm/core/Modal/ModalContent.js +1 -1
  317. package/esm/core/{ErrorPage → NonIdealState}/ErrorPage.d.ts +5 -1
  318. package/esm/core/NonIdealState/ErrorPage.js +137 -0
  319. package/esm/core/NonIdealState/NonIdealState.d.ts +46 -0
  320. package/esm/core/NonIdealState/NonIdealState.js +25 -0
  321. package/{cjs/core/ErrorPage → esm/core/NonIdealState}/index.d.ts +3 -1
  322. package/esm/core/{ErrorPage → NonIdealState}/index.js +2 -1
  323. package/esm/core/ProgressIndicators/ProgressLinear/ProgressLinear.js +8 -31
  324. package/esm/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +10 -34
  325. package/esm/core/Radio/Radio.js +7 -30
  326. package/esm/core/RadioTiles/RadioTile.js +6 -28
  327. package/esm/core/RadioTiles/RadioTileGroup.js +3 -25
  328. package/esm/core/Select/Select.js +53 -66
  329. package/esm/core/Select/SelectTag.js +3 -25
  330. package/esm/core/SideNavigation/SideNavigation.js +9 -35
  331. package/esm/core/SideNavigation/SidenavButton.js +4 -26
  332. package/esm/core/SideNavigation/SidenavSubmenu.js +3 -25
  333. package/esm/core/SideNavigation/SidenavSubmenuHeader.js +3 -25
  334. package/esm/core/SkipToContentLink/SkipToContentLink.js +3 -25
  335. package/esm/core/Slider/Slider.js +63 -91
  336. package/esm/core/Slider/Thumb.js +17 -36
  337. package/esm/core/Slider/Track.js +23 -43
  338. package/esm/core/StatusMessage/StatusMessage.js +3 -4
  339. package/esm/core/Stepper/Stepper.js +7 -31
  340. package/esm/core/Stepper/StepperStep.js +12 -31
  341. package/esm/core/Stepper/Wizard.js +3 -25
  342. package/esm/core/Stepper/WorkflowDiagram.js +3 -25
  343. package/esm/core/Stepper/WorkflowDiagramStep.js +3 -25
  344. package/esm/core/Surface/Surface.js +8 -27
  345. package/esm/core/Table/SubRowExpander.js +3 -3
  346. package/esm/core/Table/Table.d.ts +19 -24
  347. package/esm/core/Table/Table.js +177 -183
  348. package/esm/core/Table/TableCell.js +23 -24
  349. package/esm/core/Table/TablePaginator.js +46 -77
  350. package/esm/core/Table/TableRowMemoized.d.ts +6 -10
  351. package/esm/core/Table/TableRowMemoized.js +32 -56
  352. package/esm/core/Table/actionHandlers/expandHandler.js +3 -3
  353. package/esm/core/Table/actionHandlers/filterHandler.js +4 -4
  354. package/esm/core/Table/actionHandlers/resizeHandler.js +13 -15
  355. package/esm/core/Table/actionHandlers/selectHandler.js +35 -40
  356. package/esm/core/Table/cells/DefaultCell.js +3 -25
  357. package/esm/core/Table/cells/EditableCell.js +14 -38
  358. package/esm/core/Table/columns/actionColumn.js +34 -52
  359. package/esm/core/Table/columns/expanderColumn.d.ts +2 -5
  360. package/esm/core/Table/columns/expanderColumn.js +9 -24
  361. package/esm/core/Table/columns/selectionColumn.d.ts +2 -5
  362. package/esm/core/Table/columns/selectionColumn.js +14 -35
  363. package/esm/core/Table/filters/BaseFilter.js +3 -3
  364. package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.js +14 -36
  365. package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.js +15 -26
  366. package/esm/core/Table/filters/FilterButtonBar.js +4 -15
  367. package/esm/core/Table/filters/FilterToggle.js +11 -33
  368. package/esm/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +11 -24
  369. package/esm/core/Table/filters/TextFilter/TextFilter.js +6 -6
  370. package/esm/core/Table/filters/customFilterFunctions.js +12 -14
  371. package/esm/core/Table/filters/defaultFilterFunctions.js +63 -65
  372. package/esm/core/Table/filters/tableFilters.js +4 -15
  373. package/esm/core/Table/hooks/useColumnDragAndDrop.js +40 -52
  374. package/esm/core/Table/hooks/useExpanderCell.js +15 -31
  375. package/esm/core/Table/hooks/useResizeColumns.js +196 -204
  376. package/esm/core/Table/hooks/useScrollToRow.js +10 -11
  377. package/esm/core/Table/hooks/useSelectionCell.js +6 -17
  378. package/esm/core/Table/hooks/useStickyColumns.js +27 -32
  379. package/esm/core/Table/hooks/useSubRowFiltering.js +35 -55
  380. package/esm/core/Table/hooks/useSubRowSelection.js +9 -11
  381. package/esm/core/Table/utils.js +15 -26
  382. package/esm/core/Tabs/Tab.js +3 -25
  383. package/esm/core/Tabs/Tabs.js +41 -63
  384. package/esm/core/Tag/Tag.js +4 -26
  385. package/esm/core/Tag/TagContainer.js +6 -29
  386. package/esm/core/Textarea/Textarea.js +6 -28
  387. package/esm/core/ThemeProvider/ThemeProvider.d.ts +1 -0
  388. package/esm/core/ThemeProvider/ThemeProvider.js +15 -36
  389. package/esm/core/Tile/Tile.js +23 -52
  390. package/esm/core/TimePicker/TimePicker.js +56 -94
  391. package/esm/core/Toast/Toast.js +41 -61
  392. package/esm/core/Toast/ToastWrapper.js +10 -21
  393. package/esm/core/Toast/Toaster.js +83 -134
  394. package/esm/core/Toast/index.js +1 -1
  395. package/esm/core/ToggleSwitch/ToggleSwitch.js +7 -29
  396. package/esm/core/Tooltip/Tooltip.js +3 -25
  397. package/esm/core/Tree/Tree.js +54 -76
  398. package/esm/core/Tree/TreeContext.js +3 -3
  399. package/esm/core/Tree/TreeNode.js +16 -38
  400. package/esm/core/Tree/TreeNodeExpander.js +3 -25
  401. package/esm/core/Typography/Anchor/Anchor.js +2 -25
  402. package/esm/core/Typography/Blockquote/Blockquote.js +3 -25
  403. package/esm/core/Typography/Body/Body.js +4 -26
  404. package/esm/core/Typography/Code/Code.js +3 -25
  405. package/esm/core/Typography/Headline/Headline.js +3 -25
  406. package/esm/core/Typography/Kbd/Kbd.js +4 -26
  407. package/esm/core/Typography/Leading/Leading.js +3 -25
  408. package/esm/core/Typography/Small/Small.js +3 -25
  409. package/esm/core/Typography/Subheading/Subheading.js +3 -25
  410. package/esm/core/Typography/Text/Text.js +8 -31
  411. package/esm/core/Typography/Title/Title.js +3 -25
  412. package/esm/core/index.d.ts +2 -2
  413. package/esm/core/index.js +1 -1
  414. package/esm/core/utils/color/ColorValue.js +145 -156
  415. package/esm/core/utils/components/FocusTrap.js +11 -11
  416. package/esm/core/utils/components/InputContainer.js +10 -34
  417. package/esm/core/utils/components/MiddleTextTruncation.js +13 -29
  418. package/esm/core/utils/components/Popover.d.ts +1 -1
  419. package/esm/core/utils/components/Popover.js +54 -57
  420. package/esm/core/utils/components/Resizer.js +49 -49
  421. package/esm/core/utils/components/VirtualScroll.js +69 -86
  422. package/esm/core/utils/components/VisuallyHidden.js +3 -25
  423. package/esm/core/utils/components/WithCSSTransition.d.ts +2 -2
  424. package/esm/core/utils/components/WithCSSTransition.js +16 -38
  425. package/esm/core/utils/functions/colors.js +8 -8
  426. package/esm/core/utils/functions/dom.js +7 -8
  427. package/esm/core/utils/functions/focusable.js +11 -15
  428. package/esm/core/utils/functions/numbers.js +5 -6
  429. package/esm/core/utils/functions/styles.js +3 -3
  430. package/esm/core/utils/hooks/useContainerWidth.js +6 -10
  431. package/esm/core/utils/hooks/useDragAndDrop.js +28 -29
  432. package/esm/core/utils/hooks/useEventListener.js +6 -6
  433. package/esm/core/utils/hooks/useIntersection.js +7 -10
  434. package/esm/core/utils/hooks/useIsomorphicLayoutEffect.js +1 -1
  435. package/esm/core/utils/hooks/useLatestRef.js +3 -3
  436. package/esm/core/utils/hooks/useMediaQuery.js +6 -9
  437. package/esm/core/utils/hooks/useMergedRefs.js +5 -22
  438. package/esm/core/utils/hooks/useOverflow.js +23 -30
  439. package/esm/core/utils/hooks/useResizeObserver.js +4 -7
  440. package/esm/core/utils/hooks/useSafeContext.js +3 -3
  441. package/esm/core/utils/hooks/useTheme.js +14 -16
  442. package/esm/core/utils/icons/StatusIconMap.js +5 -16
  443. package/esm/core/utils/icons/SvgCalendar.js +2 -13
  444. package/esm/core/utils/icons/SvgCaretDownSmall.js +2 -13
  445. package/esm/core/utils/icons/SvgCaretRightSmall.js +2 -13
  446. package/esm/core/utils/icons/SvgCaretUpSmall.js +2 -13
  447. package/esm/core/utils/icons/SvgCheckmark.js +2 -13
  448. package/esm/core/utils/icons/SvgCheckmarkSmall.js +2 -13
  449. package/esm/core/utils/icons/SvgChevronLeft.js +2 -13
  450. package/esm/core/utils/icons/SvgChevronLeftDouble.js +2 -13
  451. package/esm/core/utils/icons/SvgChevronRight.js +2 -13
  452. package/esm/core/utils/icons/SvgChevronRightDouble.js +2 -13
  453. package/esm/core/utils/icons/SvgClose.js +2 -13
  454. package/esm/core/utils/icons/SvgCloseSmall.js +2 -13
  455. package/esm/core/utils/icons/SvgColumnManager.js +2 -13
  456. package/esm/core/utils/icons/SvgFilter.js +2 -13
  457. package/esm/core/utils/icons/SvgFilterHollow.js +2 -13
  458. package/esm/core/utils/icons/SvgImportantSmall.js +2 -13
  459. package/esm/core/utils/icons/SvgInfoCircular.js +2 -13
  460. package/esm/core/utils/icons/SvgMore.js +2 -13
  461. package/esm/core/utils/icons/SvgMoreVertical.js +2 -13
  462. package/esm/core/utils/icons/SvgNew.js +2 -13
  463. package/esm/core/utils/icons/SvgSmileyHappy.js +2 -13
  464. package/esm/core/utils/icons/SvgSortDown.js +2 -13
  465. package/esm/core/utils/icons/SvgSortUp.js +2 -13
  466. package/esm/core/utils/icons/SvgStatusError.js +2 -13
  467. package/esm/core/utils/icons/SvgStatusSuccess.js +2 -13
  468. package/esm/core/utils/icons/SvgStatusWarning.js +2 -13
  469. package/esm/core/utils/icons/SvgSwap.js +2 -13
  470. package/esm/core/utils/icons/SvgUpload.js +2 -13
  471. package/esm/types/react-table-config.d.ts +1 -1
  472. package/package.json +3 -3
  473. package/cjs/core/ErrorPage/ErrorPage.js +0 -168
  474. package/esm/core/ErrorPage/ErrorPage.js +0 -161
@@ -6,9 +6,9 @@ import React from 'react';
6
6
  import { getTranslateValues, getWindow } from '../functions';
7
7
  import { useEventListener } from './useEventListener';
8
8
  import { useResizeObserver } from './useResizeObserver';
9
- var getContainerRect = function (containerRef) {
9
+ const getContainerRect = (containerRef) => {
10
10
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
11
- var containerRect = (_a = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
11
+ const containerRect = (_a = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
12
12
  return {
13
13
  top: (_b = containerRect === null || containerRect === void 0 ? void 0 : containerRect.top) !== null && _b !== void 0 ? _b : 0,
14
14
  right: (_e = (_c = containerRect === null || containerRect === void 0 ? void 0 : containerRect.right) !== null && _c !== void 0 ? _c : (_d = getWindow()) === null || _d === void 0 ? void 0 : _d.innerWidth) !== null && _e !== void 0 ? _e : 0,
@@ -24,20 +24,19 @@ var getContainerRect = function (containerRef) {
24
24
  * `onPointerDown` - handler that is called when pointer is down and handles all the dragging logic.
25
25
  * `transform` - current transform of the element, it is used to preserve drag position when element visibility is being toggled.
26
26
  */
27
- export var useDragAndDrop = function (elementRef, containerRef, enabled) {
28
- if (enabled === void 0) { enabled = true; }
29
- var grabOffsetX = React.useRef(0);
30
- var grabOffsetY = React.useRef(0);
31
- var translateX = React.useRef();
32
- var translateY = React.useRef();
33
- var containerRectRef = React.useRef(getContainerRect(containerRef));
34
- var adjustTransform = React.useCallback(function () {
27
+ export const useDragAndDrop = (elementRef, containerRef, enabled = true) => {
28
+ const grabOffsetX = React.useRef(0);
29
+ const grabOffsetY = React.useRef(0);
30
+ const translateX = React.useRef();
31
+ const translateY = React.useRef();
32
+ const containerRectRef = React.useRef(getContainerRect(containerRef));
33
+ const adjustTransform = React.useCallback(() => {
35
34
  var _a;
36
35
  if (!elementRef.current || !enabled) {
37
36
  return;
38
37
  }
39
- var _b = (_a = elementRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect(), top = _b.top, right = _b.right, bottom = _b.bottom, left = _b.left;
40
- var _c = getTranslateValues(elementRef.current), newTranslateX = _c[0], newTranslateY = _c[1];
38
+ const { top, right, bottom, left, } = (_a = elementRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
39
+ let [newTranslateX, newTranslateY] = getTranslateValues(elementRef.current);
41
40
  containerRectRef.current = getContainerRect(containerRef);
42
41
  if (bottom > containerRectRef.current.bottom) {
43
42
  newTranslateY -= bottom - containerRectRef.current.bottom;
@@ -53,51 +52,51 @@ export var useDragAndDrop = function (elementRef, containerRef, enabled) {
53
52
  }
54
53
  translateX.current = newTranslateX;
55
54
  translateY.current = newTranslateY;
56
- elementRef.current.style.transform = "translate(".concat(newTranslateX, "px, ").concat(newTranslateY, "px)");
55
+ elementRef.current.style.transform = `translate(${newTranslateX}px, ${newTranslateY}px)`;
57
56
  }, [containerRef, elementRef, enabled]);
58
- var _a = useResizeObserver(adjustTransform), resizeRef = _a[0], resizeObserver = _a[1];
57
+ const [resizeRef, resizeObserver] = useResizeObserver(adjustTransform);
59
58
  resizeRef(containerRef === null || containerRef === void 0 ? void 0 : containerRef.current);
60
- React.useEffect(function () {
61
- return function () {
59
+ React.useEffect(() => {
60
+ return () => {
62
61
  resizeObserver === null || resizeObserver === void 0 ? void 0 : resizeObserver.disconnect();
63
62
  };
64
63
  }, [resizeObserver]);
65
- useEventListener('resize', function () {
64
+ useEventListener('resize', () => {
66
65
  adjustTransform();
67
66
  if (translateX.current != null && translateY.current != null) {
68
- setTransform("translate(".concat(translateX.current, "px, ").concat(translateY.current, "px)"));
67
+ setTransform(`translate(${translateX.current}px, ${translateY.current}px)`);
69
68
  }
70
69
  }, getWindow());
71
- var _b = React.useState(''), transform = _b[0], setTransform = _b[1];
72
- var onPointerMove = React.useRef(function (event) {
70
+ const [transform, setTransform] = React.useState('');
71
+ const onPointerMove = React.useRef((event) => {
73
72
  if (!elementRef.current) {
74
73
  return;
75
74
  }
76
- var newTranslateX = event.clientX - grabOffsetX.current;
77
- var newTranslateY = event.clientY - grabOffsetY.current;
78
- elementRef.current.style.transform = "translate(".concat(newTranslateX, "px, ").concat(newTranslateY, "px)");
75
+ const newTranslateX = event.clientX - grabOffsetX.current;
76
+ const newTranslateY = event.clientY - grabOffsetY.current;
77
+ elementRef.current.style.transform = `translate(${newTranslateX}px, ${newTranslateY}px)`;
79
78
  adjustTransform();
80
79
  });
81
- var originalUserSelect = React.useRef('');
82
- var onPointerDown = React.useCallback(function (e) {
80
+ const originalUserSelect = React.useRef('');
81
+ const onPointerDown = React.useCallback((e) => {
83
82
  if (!elementRef.current || e.button !== 0 || !enabled) {
84
83
  return;
85
84
  }
86
- var _a = getTranslateValues(elementRef.current), x = _a[0], y = _a[1];
85
+ const [x, y] = getTranslateValues(elementRef.current);
87
86
  grabOffsetX.current = e.clientX - x;
88
87
  grabOffsetY.current = e.clientY - y;
89
88
  originalUserSelect.current = elementRef.current.style.userSelect;
90
89
  // Prevents from selecting inner content when dragging.
91
90
  elementRef.current.style.userSelect = 'none';
92
91
  elementRef.current.ownerDocument.addEventListener('pointermove', onPointerMove.current);
93
- elementRef.current.ownerDocument.addEventListener('pointerup', function () {
94
- setTransform("translate(".concat(translateX.current, "px, ").concat(translateY.current, "px)"));
92
+ elementRef.current.ownerDocument.addEventListener('pointerup', () => {
93
+ setTransform(`translate(${translateX.current}px, ${translateY.current}px)`);
95
94
  document.removeEventListener('pointermove', onPointerMove.current);
96
95
  if (elementRef.current) {
97
96
  elementRef.current.style.userSelect = originalUserSelect.current;
98
97
  }
99
98
  }, { once: true });
100
99
  }, [elementRef, enabled]);
101
- return { onPointerDown: onPointerDown, transform: transform };
100
+ return { onPointerDown, transform };
102
101
  };
103
102
  export default useDragAndDrop;
@@ -12,22 +12,22 @@ import React from 'react';
12
12
  * containerRef.current?.ownerDocument,
13
13
  * );
14
14
  */
15
- export var useEventListener = function (eventName, handler, element) {
15
+ export const useEventListener = (eventName, handler, element) => {
16
16
  // Based on published hook https://usehooks.com/useEventListener/.
17
- var savedHandler = React.useRef();
17
+ const savedHandler = React.useRef();
18
18
  // Update reference if handler changes. This allows our effect below to
19
19
  // always use latest handler without us needing to pass it in effect deps array
20
20
  // and potentially cause effect to re-run every render.
21
- React.useEffect(function () {
21
+ React.useEffect(() => {
22
22
  savedHandler.current = handler;
23
23
  }, [handler]);
24
- React.useEffect(function () {
24
+ React.useEffect(() => {
25
25
  if (!element) {
26
26
  return;
27
27
  }
28
- var eventListener = function (event) { var _a; return (_a = savedHandler.current) === null || _a === void 0 ? void 0 : _a.call(savedHandler, event); };
28
+ const eventListener = (event) => { var _a; return (_a = savedHandler.current) === null || _a === void 0 ? void 0 : _a.call(savedHandler, event); };
29
29
  element.addEventListener(eventName, eventListener);
30
- return function () {
30
+ return () => {
31
31
  element.removeEventListener(eventName, eventListener);
32
32
  };
33
33
  }, [eventName, element]);
@@ -16,12 +16,10 @@ import { getWindow } from '../functions/dom';
16
16
  * const ref = useIntersection(onIntersection);
17
17
  * return (<div ref={ref}>One of many elements</div>);
18
18
  */
19
- export var useIntersection = function (onIntersect, options, once) {
20
- if (options === void 0) { options = {}; }
21
- if (once === void 0) { once = true; }
22
- var root = options.root, rootMargin = options.rootMargin, threshold = options.threshold;
23
- var observer = React.useRef();
24
- var setRef = React.useCallback(function (node) {
19
+ export const useIntersection = (onIntersect, options = {}, once = true) => {
20
+ const { root, rootMargin, threshold } = options;
21
+ const observer = React.useRef();
22
+ const setRef = React.useCallback((node) => {
25
23
  var _a;
26
24
  if (!((_a = getWindow()) === null || _a === void 0 ? void 0 : _a.IntersectionObserver)) {
27
25
  return;
@@ -32,17 +30,16 @@ export var useIntersection = function (onIntersect, options, once) {
32
30
  if (!node) {
33
31
  return;
34
32
  }
35
- observer.current = new IntersectionObserver(function (_a, obs) {
36
- var entry = _a[0];
33
+ observer.current = new IntersectionObserver(([entry], obs) => {
37
34
  if (entry.isIntersecting) {
38
35
  if (once) {
39
36
  obs.disconnect();
40
37
  }
41
38
  onIntersect();
42
39
  }
43
- }, { root: root, rootMargin: rootMargin, threshold: threshold });
40
+ }, { root, rootMargin, threshold });
44
41
  observer.current.observe(node);
45
42
  }, [onIntersect, once, root, rootMargin, threshold]);
46
- React.useEffect(function () { return function () { var _a; return (_a = observer.current) === null || _a === void 0 ? void 0 : _a.disconnect(); }; }, []);
43
+ React.useEffect(() => () => { var _a; return (_a = observer.current) === null || _a === void 0 ? void 0 : _a.disconnect(); }, []);
47
44
  return setRef;
48
45
  };
@@ -8,4 +8,4 @@ import React from 'react';
8
8
  *
9
9
  * @see https://fb.me/react-uselayouteffect-ssr
10
10
  */
11
- export var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
11
+ export const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
@@ -10,9 +10,9 @@ import React from 'react';
10
10
  * const { value } = props;
11
11
  * const valueRef = useLatestRef(value);
12
12
  */
13
- export var useLatestRef = function (value) {
14
- var valueRef = React.useRef(value);
15
- React.useEffect(function () {
13
+ export const useLatestRef = (value) => {
14
+ const valueRef = React.useRef(value);
15
+ React.useEffect(() => {
16
16
  valueRef.current = value;
17
17
  }, [value]);
18
18
  return valueRef;
@@ -5,15 +5,12 @@
5
5
  import React from 'react';
6
6
  import { getWindow } from '../functions';
7
7
  import { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect';
8
- export var useMediaQuery = function (queryString) {
9
- var _a = React.useState(), matches = _a[0], setMatches = _a[1];
10
- useIsomorphicLayoutEffect(function () {
8
+ export const useMediaQuery = (queryString) => {
9
+ const [matches, setMatches] = React.useState();
10
+ useIsomorphicLayoutEffect(() => {
11
11
  var _a, _b, _c;
12
- var mediaQueryList = (_b = (_a = getWindow()) === null || _a === void 0 ? void 0 : _a.matchMedia) === null || _b === void 0 ? void 0 : _b.call(_a, queryString);
13
- var handleChange = function (_a) {
14
- var matches = _a.matches;
15
- return setMatches(matches);
16
- };
12
+ const mediaQueryList = (_b = (_a = getWindow()) === null || _a === void 0 ? void 0 : _a.matchMedia) === null || _b === void 0 ? void 0 : _b.call(_a, queryString);
13
+ const handleChange = ({ matches }) => setMatches(matches);
17
14
  if (mediaQueryList != undefined) {
18
15
  setMatches(mediaQueryList.matches);
19
16
  try {
@@ -24,7 +21,7 @@ export var useMediaQuery = function (queryString) {
24
21
  (_c = mediaQueryList.addListener) === null || _c === void 0 ? void 0 : _c.call(mediaQueryList, handleChange);
25
22
  }
26
23
  }
27
- return function () {
24
+ return () => {
28
25
  var _a;
29
26
  try {
30
27
  mediaQueryList === null || mediaQueryList === void 0 ? void 0 : mediaQueryList.removeEventListener('change', handleChange);
@@ -1,12 +1,3 @@
1
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
2
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
3
- if (ar || !(i in from)) {
4
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
5
- ar[i] = from[i];
6
- }
7
- }
8
- return to.concat(ar || Array.prototype.slice.call(from));
9
- };
10
1
  /*---------------------------------------------------------------------------------------------
11
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
12
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -15,13 +6,9 @@ import React from 'react';
15
6
  /**
16
7
  * Function that merges the provided refs into one.
17
8
  */
18
- export var mergeRefs = function () {
19
- var refs = [];
20
- for (var _i = 0; _i < arguments.length; _i++) {
21
- refs[_i] = arguments[_i];
22
- }
23
- return function (instance) {
24
- refs.forEach(function (ref) {
9
+ export const mergeRefs = (...refs) => {
10
+ return (instance) => {
11
+ refs.forEach((ref) => {
25
12
  if (typeof ref === 'function') {
26
13
  ref(instance);
27
14
  }
@@ -34,11 +21,7 @@ export var mergeRefs = function () {
34
21
  /**
35
22
  * Returns a ref callback that merges the provided refs using `mergeRefs`.
36
23
  */
37
- export var useMergedRefs = function () {
38
- var refs = [];
39
- for (var _i = 0; _i < arguments.length; _i++) {
40
- refs[_i] = arguments[_i];
41
- }
24
+ export const useMergedRefs = (...refs) => {
42
25
  // eslint-disable-next-line react-hooks/exhaustive-deps
43
- return React.useCallback(mergeRefs.apply(void 0, refs), __spreadArray([], refs, true));
26
+ return React.useCallback(mergeRefs(...refs), [...refs]);
44
27
  };
@@ -5,7 +5,7 @@
5
5
  import React from 'react';
6
6
  import { useMergedRefs } from './useMergedRefs';
7
7
  import { useResizeObserver } from './useResizeObserver';
8
- var STARTING_MAX_ITEMS_COUNT = 20;
8
+ const STARTING_MAX_ITEMS_COUNT = 20;
9
9
  /**
10
10
  * Hook that observes the size of an element and returns the number of items
11
11
  * that should be visible based on the size of the container element.
@@ -28,23 +28,16 @@ var STARTING_MAX_ITEMS_COUNT = 20;
28
28
  * </div>
29
29
  * );
30
30
  */
31
- export var useOverflow = function (items, disabled, orientation) {
32
- if (disabled === void 0) { disabled = false; }
33
- if (orientation === void 0) { orientation = 'horizontal'; }
34
- var containerRef = React.useRef(null);
35
- var _a = React.useState(function () {
36
- return disabled ? items.length : Math.min(items.length, STARTING_MAX_ITEMS_COUNT);
37
- }), visibleCount = _a[0], setVisibleCount = _a[1];
38
- var needsFullRerender = React.useRef(true);
39
- var _b = React.useState(0), containerSize = _b[0], setContainerSize = _b[1];
40
- var previousContainerSize = React.useRef(0);
41
- var updateContainerSize = React.useCallback(function (_a) {
42
- var width = _a.width, height = _a.height;
43
- return setContainerSize(orientation === 'horizontal' ? width : height);
44
- }, [orientation]);
45
- var _c = useResizeObserver(updateContainerSize), resizeRef = _c[0], observer = _c[1];
46
- var resizeObserverRef = React.useRef(observer);
47
- React.useLayoutEffect(function () {
31
+ export const useOverflow = (items, disabled = false, orientation = 'horizontal') => {
32
+ const containerRef = React.useRef(null);
33
+ const [visibleCount, setVisibleCount] = React.useState(() => disabled ? items.length : Math.min(items.length, STARTING_MAX_ITEMS_COUNT));
34
+ const needsFullRerender = React.useRef(true);
35
+ const [containerSize, setContainerSize] = React.useState(0);
36
+ const previousContainerSize = React.useRef(0);
37
+ const updateContainerSize = React.useCallback(({ width, height }) => setContainerSize(orientation === 'horizontal' ? width : height), [orientation]);
38
+ const [resizeRef, observer] = useResizeObserver(updateContainerSize);
39
+ const resizeObserverRef = React.useRef(observer);
40
+ React.useLayoutEffect(() => {
48
41
  if (disabled) {
49
42
  setVisibleCount(items.length);
50
43
  }
@@ -53,28 +46,28 @@ export var useOverflow = function (items, disabled, orientation) {
53
46
  needsFullRerender.current = true;
54
47
  }
55
48
  }, [containerSize, disabled, items]);
56
- var mergedRefs = useMergedRefs(containerRef, resizeRef);
57
- React.useLayoutEffect(function () {
49
+ const mergedRefs = useMergedRefs(containerRef, resizeRef);
50
+ React.useLayoutEffect(() => {
58
51
  var _a;
59
52
  if (!containerRef.current || disabled) {
60
53
  (_a = resizeObserverRef.current) === null || _a === void 0 ? void 0 : _a.disconnect();
61
54
  return;
62
55
  }
63
- var dimension = orientation === 'horizontal' ? 'Width' : 'Height';
64
- var availableSize = containerRef.current["offset".concat(dimension)];
65
- var requiredSize = containerRef.current["scroll".concat(dimension)];
56
+ const dimension = orientation === 'horizontal' ? 'Width' : 'Height';
57
+ const availableSize = containerRef.current[`offset${dimension}`];
58
+ const requiredSize = containerRef.current[`scroll${dimension}`];
66
59
  if (availableSize < requiredSize) {
67
- var avgItemSize = requiredSize / visibleCount;
68
- var visibleItems = Math.floor(availableSize / avgItemSize);
60
+ const avgItemSize = requiredSize / visibleCount;
61
+ const visibleItems = Math.floor(availableSize / avgItemSize);
69
62
  setVisibleCount(visibleItems);
70
63
  }
71
64
  else if (needsFullRerender.current) {
72
- var childrenSize = Array.from(containerRef.current.children).reduce(function (sum, child) { return sum + child["offset".concat(dimension)]; }, 0);
65
+ const childrenSize = Array.from(containerRef.current.children).reduce((sum, child) => sum + child[`offset${dimension}`], 0);
73
66
  // Previous `useEffect` might have updated visible count, but we still have old one
74
67
  // If it is 0, lets try to update it with items length.
75
- var currentVisibleCount = visibleCount || Math.min(items.length, STARTING_MAX_ITEMS_COUNT);
76
- var avgItemSize = childrenSize / currentVisibleCount;
77
- var visibleItems = Math.floor(availableSize / avgItemSize);
68
+ const currentVisibleCount = visibleCount || Math.min(items.length, STARTING_MAX_ITEMS_COUNT);
69
+ const avgItemSize = childrenSize / currentVisibleCount;
70
+ const visibleItems = Math.floor(availableSize / avgItemSize);
78
71
  if (!isNaN(visibleItems)) {
79
72
  // Doubling the visible items to overflow the container. Just to be safe.
80
73
  setVisibleCount(Math.min(items.length, visibleItems * 2));
@@ -82,7 +75,7 @@ export var useOverflow = function (items, disabled, orientation) {
82
75
  }
83
76
  needsFullRerender.current = false;
84
77
  }, [containerSize, visibleCount, disabled, items.length, orientation]);
85
- React.useLayoutEffect(function () {
78
+ React.useLayoutEffect(() => {
86
79
  previousContainerSize.current = containerSize;
87
80
  }, [containerSize]);
88
81
  return [mergedRefs, visibleCount];
@@ -16,19 +16,16 @@ import { getWindow } from '../functions/dom';
16
16
  * ...
17
17
  * return <div ref={ref}>...</div>;
18
18
  */
19
- export var useResizeObserver = function (onResize) {
20
- var resizeObserver = React.useRef();
21
- var elementRef = React.useCallback(function (element) {
19
+ export const useResizeObserver = (onResize) => {
20
+ const resizeObserver = React.useRef();
21
+ const elementRef = React.useCallback((element) => {
22
22
  var _a, _b, _c;
23
23
  if (!((_a = getWindow()) === null || _a === void 0 ? void 0 : _a.ResizeObserver)) {
24
24
  return;
25
25
  }
26
26
  (_b = resizeObserver.current) === null || _b === void 0 ? void 0 : _b.disconnect();
27
27
  if (element) {
28
- resizeObserver.current = new ResizeObserver(function (_a) {
29
- var contentRect = _a[0].contentRect;
30
- return onResize(contentRect);
31
- });
28
+ resizeObserver.current = new ResizeObserver(([{ contentRect }]) => onResize(contentRect));
32
29
  (_c = resizeObserver.current) === null || _c === void 0 ? void 0 : _c.observe(element);
33
30
  }
34
31
  }, [onResize]);
@@ -7,10 +7,10 @@ import React from 'react';
7
7
  * Wrapper hook around `useContext` that throws an error if the context is not provided.
8
8
  * @param context Context to use. Must have a `displayName` for useful errors.
9
9
  */
10
- export var useSafeContext = function (context) {
11
- var value = React.useContext(context);
10
+ export const useSafeContext = (context) => {
11
+ const value = React.useContext(context);
12
12
  if (!value) {
13
- throw new Error("".concat(context.displayName, " is undefined"));
13
+ throw new Error(`${context.displayName} is undefined`);
14
14
  }
15
15
  return value; // eslint-disable-line @typescript-eslint/no-non-null-assertion -- we already checked for undefined
16
16
  };
@@ -17,11 +17,11 @@ import '@itwin/itwinui-variables/index.css';
17
17
  * @param theme Light, dark, or based on OS setting.
18
18
  * @param themeOptions Options that override default theming behavior.
19
19
  */
20
- export var useTheme = function (theme, themeOptions) {
20
+ export const useTheme = (theme, themeOptions) => {
21
21
  var _a;
22
- var themeContext = React.useContext(ThemeContext);
23
- var ownerDocument = (_a = themeOptions === null || themeOptions === void 0 ? void 0 : themeOptions.ownerDocument) !== null && _a !== void 0 ? _a : getDocument();
24
- useIsomorphicLayoutEffect(function () {
22
+ const themeContext = React.useContext(ThemeContext);
23
+ const ownerDocument = (_a = themeOptions === null || themeOptions === void 0 ? void 0 : themeOptions.ownerDocument) !== null && _a !== void 0 ? _a : getDocument();
24
+ useIsomorphicLayoutEffect(() => {
25
25
  // exit early if theme was already set by provider
26
26
  if (themeContext || !ownerDocument) {
27
27
  return;
@@ -47,21 +47,19 @@ export var useTheme = function (theme, themeOptions) {
47
47
  * Helper function to apply the specified theme, or detect the OS theme.
48
48
  * Returns a cleanup function to remove the change handlers.
49
49
  */
50
- var handleTheme = function (theme, ownerDocument, highContrast) {
50
+ const handleTheme = (theme, ownerDocument, highContrast) => {
51
51
  var _a, _b, _c, _d, _e;
52
- var root = ownerDocument.documentElement;
53
- var _window = (_a = ownerDocument.defaultView) !== null && _a !== void 0 ? _a : getWindow();
54
- var applyThemeAttributes = function (isDark, isHC) {
55
- if (isDark === void 0) { isDark = false; }
56
- if (isHC === void 0) { isHC = false; }
52
+ const root = ownerDocument.documentElement;
53
+ const _window = (_a = ownerDocument.defaultView) !== null && _a !== void 0 ? _a : getWindow();
54
+ const applyThemeAttributes = (isDark = false, isHC = false) => {
57
55
  root.dataset.iuiTheme = isDark ? 'dark' : 'light';
58
56
  root.dataset.iuiContrast = isHC ? 'high' : 'default';
59
57
  };
60
- var prefersDarkQuery = (_b = _window === null || _window === void 0 ? void 0 : _window.matchMedia) === null || _b === void 0 ? void 0 : _b.call(_window, '(prefers-color-scheme: dark)');
61
- var prefersHCQuery = (_c = _window === null || _window === void 0 ? void 0 : _window.matchMedia) === null || _c === void 0 ? void 0 : _c.call(_window, '(prefers-contrast: more)');
62
- var changeHandler = function () {
63
- var isDark = theme === 'dark' || (theme === 'os' && (prefersDarkQuery === null || prefersDarkQuery === void 0 ? void 0 : prefersDarkQuery.matches));
64
- var isHC = highContrast !== null && highContrast !== void 0 ? highContrast : prefersHCQuery === null || prefersHCQuery === void 0 ? void 0 : prefersHCQuery.matches;
58
+ const prefersDarkQuery = (_b = _window === null || _window === void 0 ? void 0 : _window.matchMedia) === null || _b === void 0 ? void 0 : _b.call(_window, '(prefers-color-scheme: dark)');
59
+ const prefersHCQuery = (_c = _window === null || _window === void 0 ? void 0 : _window.matchMedia) === null || _c === void 0 ? void 0 : _c.call(_window, '(prefers-contrast: more)');
60
+ const changeHandler = () => {
61
+ const isDark = theme === 'dark' || (theme === 'os' && (prefersDarkQuery === null || prefersDarkQuery === void 0 ? void 0 : prefersDarkQuery.matches));
62
+ const isHC = highContrast !== null && highContrast !== void 0 ? highContrast : prefersHCQuery === null || prefersHCQuery === void 0 ? void 0 : prefersHCQuery.matches;
65
63
  applyThemeAttributes(isDark, isHC);
66
64
  };
67
65
  // call handler once to set initial theme
@@ -70,7 +68,7 @@ var handleTheme = function (theme, ownerDocument, highContrast) {
70
68
  (_d = prefersDarkQuery === null || prefersDarkQuery === void 0 ? void 0 : prefersDarkQuery.addEventListener) === null || _d === void 0 ? void 0 : _d.call(prefersDarkQuery, 'change', changeHandler);
71
69
  (_e = prefersHCQuery === null || prefersHCQuery === void 0 ? void 0 : prefersHCQuery.addEventListener) === null || _e === void 0 ? void 0 : _e.call(prefersHCQuery, 'change', changeHandler);
72
70
  // return cleanup function to remove event listeners (should be returned from useEffect)
73
- return function () {
71
+ return () => {
74
72
  var _a, _b;
75
73
  (_a = prefersDarkQuery === null || prefersDarkQuery === void 0 ? void 0 : prefersDarkQuery.removeEventListener) === null || _a === void 0 ? void 0 : _a.call(prefersDarkQuery, 'change', changeHandler);
76
74
  (_b = prefersHCQuery === null || prefersHCQuery === void 0 ? void 0 : prefersHCQuery.removeEventListener) === null || _b === void 0 ? void 0 : _b.call(prefersHCQuery, 'change', changeHandler);
@@ -1,14 +1,3 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  /*---------------------------------------------------------------------------------------------
13
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
14
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -18,9 +7,9 @@ import { SvgInfoCircular } from './SvgInfoCircular';
18
7
  import { SvgStatusError } from './SvgStatusError';
19
8
  import { SvgStatusSuccess } from './SvgStatusSuccess';
20
9
  import { SvgStatusWarning } from './SvgStatusWarning';
21
- export var StatusIconMap = {
22
- negative: function (args) { return React.createElement(SvgStatusError, __assign({ "aria-hidden": true }, args)); },
23
- positive: function (args) { return React.createElement(SvgStatusSuccess, __assign({ "aria-hidden": true }, args)); },
24
- warning: function (args) { return React.createElement(SvgStatusWarning, __assign({ "aria-hidden": true }, args)); },
25
- informational: function (args) { return (React.createElement(SvgInfoCircular, __assign({ "aria-hidden": true }, args))); },
10
+ export const StatusIconMap = {
11
+ negative: (args) => React.createElement(SvgStatusError, { "aria-hidden": true, ...args }),
12
+ positive: (args) => React.createElement(SvgStatusSuccess, { "aria-hidden": true, ...args }),
13
+ warning: (args) => React.createElement(SvgStatusWarning, { "aria-hidden": true, ...args }),
14
+ informational: (args) => (React.createElement(SvgInfoCircular, { "aria-hidden": true, ...args })),
26
15
  };
@@ -1,20 +1,9 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  /*---------------------------------------------------------------------------------------------
13
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
14
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
15
4
  *--------------------------------------------------------------------------------------------*/
16
5
  import * as React from 'react';
17
- export var SvgCalendar = function (props) {
18
- return (React.createElement("svg", __assign({ viewBox: '0 0 16 16' }, props),
6
+ export const SvgCalendar = (props) => {
7
+ return (React.createElement("svg", { viewBox: '0 0 16 16', ...props },
19
8
  React.createElement("path", { d: 'M13,13H9V10h4ZM16,3V15a1,1,0,0,1-1,1H1a1,1,0,0,1-1-1V3A1,1,0,0,1,1,2H3V0H4V2h8V0h1V2h2A1,1,0,0,1,16,3ZM15,6H1v9H15Z' })));
20
9
  };
@@ -1,20 +1,9 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  /*---------------------------------------------------------------------------------------------
13
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
14
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
15
4
  *--------------------------------------------------------------------------------------------*/
16
5
  import * as React from 'react';
17
- export var SvgCaretDownSmall = function (props) {
18
- return (React.createElement("svg", __assign({ viewBox: '0 0 16 16' }, props),
6
+ export const SvgCaretDownSmall = (props) => {
7
+ return (React.createElement("svg", { viewBox: '0 0 16 16', ...props },
19
8
  React.createElement("path", { d: 'M4.807 6h6.395a.28.28 0 0 1 .24.443L8.27 9.9a.34.34 0 0 1-.481 0L4.566 6.443A.27.27 0 0 1 4.806 6z' })));
20
9
  };
@@ -1,20 +1,9 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  /*---------------------------------------------------------------------------------------------
13
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
14
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
15
4
  *--------------------------------------------------------------------------------------------*/
16
5
  import * as React from 'react';
17
- export var SvgCaretRightSmall = function (props) {
18
- return (React.createElement("svg", __assign({ viewBox: '0 0 16 16' }, props),
6
+ export const SvgCaretRightSmall = (props) => {
7
+ return (React.createElement("svg", { viewBox: '0 0 16 16', ...props },
19
8
  React.createElement("path", { d: 'M6.003 4.807v6.4a.28.28 0 0 0 .443.24L9.9 8.27a.34.34 0 0 0 0-.48L6.446 4.566a.269.269 0 0 0-.443.24z' })));
20
9
  };
@@ -1,20 +1,9 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  /*---------------------------------------------------------------------------------------------
13
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
14
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
15
4
  *--------------------------------------------------------------------------------------------*/
16
5
  import * as React from 'react';
17
- export var SvgCaretUpSmall = function (props) {
18
- return (React.createElement("svg", __assign({ viewBox: '0 0 16 16' }, props),
6
+ export const SvgCaretUpSmall = (props) => {
7
+ return (React.createElement("svg", { viewBox: '0 0 16 16', ...props },
19
8
  React.createElement("path", { d: 'M4.807 9.997h6.395a.28.28 0 0 0 .24-.443L8.27 6.097a.34.34 0 0 0-.48 0h-.001L4.566 9.554a.27.27 0 0 0 .24.443z' })));
20
9
  };
@@ -1,20 +1,9 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  /*---------------------------------------------------------------------------------------------
13
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
14
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
15
4
  *--------------------------------------------------------------------------------------------*/
16
5
  import * as React from 'react';
17
- export var SvgCheckmark = function (props) {
18
- return (React.createElement("svg", __assign({ viewBox: '0 0 16 16' }, props),
6
+ export const SvgCheckmark = (props) => {
7
+ return (React.createElement("svg", { viewBox: '0 0 16 16', ...props },
19
8
  React.createElement("path", { d: 'M6,14L0,8l2-2l4,4l8-8l2,2L6,14z' })));
20
9
  };