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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +6 -2
  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 +6 -2
  472. package/package.json +4 -4
  473. package/cjs/core/ErrorPage/ErrorPage.js +0 -168
  474. package/esm/core/ErrorPage/ErrorPage.js +0 -161
@@ -1,59 +1,54 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
14
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
15
- if (ar || !(i in from)) {
16
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
17
- ar[i] = from[i];
18
- }
19
- }
20
- return to.concat(ar || Array.prototype.slice.call(from));
21
- };
22
2
  Object.defineProperty(exports, "__esModule", { value: true });
23
3
  exports.useStickyColumns = void 0;
24
4
  /*---------------------------------------------------------------------------------------------
25
5
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
26
6
  * See LICENSE.md in the project root for license terms and full copyright notice.
27
7
  *--------------------------------------------------------------------------------------------*/
28
- var react_table_1 = require("react-table");
8
+ const react_table_1 = require("react-table");
29
9
  react_table_1.actions.setScrolledLeft = 'setScrolledLeft';
30
10
  react_table_1.actions.setScrolledRight = 'setScrolledRight';
31
- var useStickyColumns = function (hooks) {
11
+ const useStickyColumns = (hooks) => {
32
12
  hooks.stateReducers.push(reducer);
33
13
  hooks.useInstance.push(useInstance);
34
14
  };
35
15
  exports.useStickyColumns = useStickyColumns;
36
- var reducer = function (newState, action) {
16
+ const reducer = (newState, action) => {
37
17
  var _a, _b;
38
18
  if (action.type === react_table_1.actions.init) {
39
- return __assign(__assign({}, newState), { sticky: {} });
19
+ return {
20
+ ...newState,
21
+ sticky: {},
22
+ };
40
23
  }
41
24
  if (action.type === react_table_1.actions.setScrolledLeft &&
42
25
  ((_a = newState.sticky) === null || _a === void 0 ? void 0 : _a.isScrolledToLeft) !== action.value // Prevents unnecessary re-render
43
26
  ) {
44
- return __assign(__assign({}, newState), { sticky: __assign(__assign({}, newState.sticky), { isScrolledToLeft: action.value }) });
27
+ return {
28
+ ...newState,
29
+ sticky: {
30
+ ...newState.sticky,
31
+ isScrolledToLeft: action.value,
32
+ },
33
+ };
45
34
  }
46
35
  if (action.type === react_table_1.actions.setScrolledRight &&
47
36
  ((_b = newState.sticky) === null || _b === void 0 ? void 0 : _b.isScrolledToRight) !== action.value // Prevents unnecessary re-render
48
37
  ) {
49
- return __assign(__assign({}, newState), { sticky: __assign(__assign({}, newState.sticky), { isScrolledToRight: action.value }) });
38
+ return {
39
+ ...newState,
40
+ sticky: {
41
+ ...newState.sticky,
42
+ isScrolledToRight: action.value,
43
+ },
44
+ };
50
45
  }
51
46
  return newState;
52
47
  };
53
- var useInstance = function (instance) {
54
- var flatHeaders = instance.flatHeaders;
48
+ const useInstance = (instance) => {
49
+ const { flatHeaders } = instance;
55
50
  // Edge case. Saving original sticky state in case sticky columns are reordered.
56
- flatHeaders.forEach(function (header) {
51
+ flatHeaders.forEach((header) => {
57
52
  var _a;
58
53
  if (!header.originalSticky) {
59
54
  header.originalSticky = (_a = header.sticky) !== null && _a !== void 0 ? _a : 'none';
@@ -62,8 +57,8 @@ var useInstance = function (instance) {
62
57
  header.originalSticky === 'none' ? undefined : header.originalSticky;
63
58
  });
64
59
  // If there is a column that is sticked to the left, make every column prior to that sticky too.
65
- var hasLeftStickyColumn = false;
66
- __spreadArray([], flatHeaders, true).reverse().forEach(function (header) {
60
+ let hasLeftStickyColumn = false;
61
+ [...flatHeaders].reverse().forEach((header) => {
67
62
  if (header.sticky === 'left') {
68
63
  hasLeftStickyColumn = true;
69
64
  }
@@ -72,8 +67,8 @@ var useInstance = function (instance) {
72
67
  }
73
68
  });
74
69
  // If there is a column that is sticked to the right, make every column after to that sticky too.
75
- var hasRightStickyColumn = false;
76
- flatHeaders.forEach(function (header) {
70
+ let hasRightStickyColumn = false;
71
+ flatHeaders.forEach((header) => {
77
72
  if (header.sticky === 'right') {
78
73
  hasRightStickyColumn = true;
79
74
  }
@@ -1,24 +1,4 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
14
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
15
- if (ar || !(i in from)) {
16
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
17
- ar[i] = from[i];
18
- }
19
- }
20
- return to.concat(ar || Array.prototype.slice.call(from));
21
- };
22
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
23
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
24
4
  };
@@ -28,18 +8,18 @@ exports.useSubRowFiltering = void 0;
28
8
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
29
9
  * See LICENSE.md in the project root for license terms and full copyright notice.
30
10
  *--------------------------------------------------------------------------------------------*/
31
- var react_1 = __importDefault(require("react"));
32
- var defaultFilterFunctions_1 = require("../filters/defaultFilterFunctions");
33
- var useSubRowFiltering = function (hasAnySubRows) { return function (hooks) {
11
+ const react_1 = __importDefault(require("react"));
12
+ const defaultFilterFunctions_1 = require("../filters/defaultFilterFunctions");
13
+ const useSubRowFiltering = (hasAnySubRows) => (hooks) => {
34
14
  hooks.useInstance.push(useInstance.bind({}, hasAnySubRows));
35
- }; };
15
+ };
36
16
  exports.useSubRowFiltering = useSubRowFiltering;
37
- var useInstance = function (hasAnySubRows, instance) {
17
+ const useInstance = (hasAnySubRows, instance) => {
38
18
  // There is a bug in react-table that filtered out sub-rows won't be shown after clearing the filter.
39
19
  // Therefore saving original sub-rows separately.
40
20
  // Related issue: https://github.com/tannerlinsley/react-table/issues/2928
41
- var setInitialSubRows = function (rows) {
42
- rows.forEach(function (row) {
21
+ const setInitialSubRows = (rows) => {
22
+ rows.forEach((row) => {
43
23
  if (!row.initialSubRows) {
44
24
  row.initialSubRows = row.subRows;
45
25
  }
@@ -47,71 +27,71 @@ var useInstance = function (hasAnySubRows, instance) {
47
27
  });
48
28
  };
49
29
  setInitialSubRows(instance.initialRows);
50
- var _a = react_1.default.useMemo(function () {
30
+ const { filteredRows = instance.filteredRows, filteredFlatRows = instance.filteredFlatRows, filteredRowsById = instance.filteredRowsById, } = react_1.default.useMemo(() => {
51
31
  if (!hasAnySubRows) {
52
32
  return {};
53
33
  }
54
34
  // Restore original sub-rows
55
- var setSubRows = function (rows) {
56
- rows.forEach(function (row) {
35
+ const setSubRows = (rows) => {
36
+ rows.forEach((row) => {
57
37
  var _a;
58
38
  row.subRows = (_a = row.initialSubRows) !== null && _a !== void 0 ? _a : [];
59
39
  setSubRows(row.subRows);
60
40
  });
61
41
  };
62
42
  setSubRows(instance.initialRows);
63
- var currentlyFilteredRows = __spreadArray([], instance.initialRows, true);
64
- instance.state.filters.forEach(function (_a) {
65
- var _b;
66
- var columnId = _a.id, filterValue = _a.value;
67
- var column = instance.allColumns.find(function (c) { return c.id === columnId; });
43
+ let currentlyFilteredRows = [...instance.initialRows];
44
+ instance.state.filters.forEach(({ id: columnId, value: filterValue }) => {
45
+ var _a;
46
+ const column = instance.allColumns.find((c) => c.id === columnId);
68
47
  if (!column) {
69
48
  return;
70
49
  }
71
- var filterTypes = __assign(__assign({}, defaultFilterFunctions_1.defaultFilterFunctions), instance.filterTypes);
72
- var filterFn = typeof column.filter === 'function'
50
+ const filterTypes = {
51
+ ...defaultFilterFunctions_1.defaultFilterFunctions,
52
+ ...instance.filterTypes,
53
+ };
54
+ const filterFn = typeof column.filter === 'function'
73
55
  ? column.filter
74
- : filterTypes[(_b = column.filter) !== null && _b !== void 0 ? _b : 'text'];
75
- currentlyFilteredRows = currentlyFilteredRows.filter(function (row) {
76
- return handleRowFiltering(row, filterFn, columnId, filterValue);
77
- });
56
+ : filterTypes[(_a = column.filter) !== null && _a !== void 0 ? _a : 'text'];
57
+ currentlyFilteredRows = currentlyFilteredRows.filter((row) => handleRowFiltering(row, filterFn, columnId, filterValue));
78
58
  });
79
- var filteredRows = [];
80
- var filteredFlatRows = [];
81
- var filteredRowsById = {};
59
+ const filteredRows = [];
60
+ const filteredFlatRows = [];
61
+ const filteredRowsById = {};
82
62
  // Setting rows here helps to keep them ordered.
83
- var populateRows = function (row) {
63
+ const populateRows = (row) => {
84
64
  if (row.depth === 0) {
85
65
  filteredRows.push(row);
86
66
  }
87
67
  filteredFlatRows.push(row);
88
68
  filteredRowsById[row.id] = row;
89
69
  if (row.subRows.length) {
90
- row.subRows.forEach(function (r) { return populateRows(r); });
70
+ row.subRows.forEach((r) => populateRows(r));
91
71
  }
92
72
  };
93
- currentlyFilteredRows.forEach(function (row) { return populateRows(row); });
94
- return { filteredRows: filteredRows, filteredFlatRows: filteredFlatRows, filteredRowsById: filteredRowsById };
73
+ currentlyFilteredRows.forEach((row) => populateRows(row));
74
+ return { filteredRows, filteredFlatRows, filteredRowsById };
95
75
  }, [
96
76
  instance.allColumns,
97
77
  instance.filterTypes,
98
78
  instance.initialRows,
99
79
  instance.state.filters,
100
80
  hasAnySubRows,
101
- ]), _b = _a.filteredRows, filteredRows = _b === void 0 ? instance.filteredRows : _b, _c = _a.filteredFlatRows, filteredFlatRows = _c === void 0 ? instance.filteredFlatRows : _c, _d = _a.filteredRowsById, filteredRowsById = _d === void 0 ? instance.filteredRowsById : _d;
81
+ ]);
102
82
  Object.assign(instance, {
103
- filteredRows: filteredRows,
104
- filteredFlatRows: filteredFlatRows,
105
- filteredRowsById: filteredRowsById,
83
+ filteredRows,
84
+ filteredFlatRows,
85
+ filteredRowsById,
106
86
  rows: filteredRows,
107
87
  flatRows: filteredFlatRows,
108
88
  rowsById: filteredRowsById,
109
89
  });
110
90
  };
111
- var handleRowFiltering = function (row, filterFn, columnId, filterValue) {
112
- var hasFilteredSubRows = false;
113
- row.subRows = row.initialSubRows.filter(function (subRow) {
114
- var result = handleRowFiltering(subRow, filterFn, columnId, filterValue);
91
+ const handleRowFiltering = (row, filterFn, columnId, filterValue) => {
92
+ let hasFilteredSubRows = false;
93
+ row.subRows = row.initialSubRows.filter((subRow) => {
94
+ const result = handleRowFiltering(subRow, filterFn, columnId, filterValue);
115
95
  if (result) {
116
96
  hasFilteredSubRows = true;
117
97
  }
@@ -122,6 +102,6 @@ var handleRowFiltering = function (row, filterFn, columnId, filterValue) {
122
102
  if (hasFilteredSubRows) {
123
103
  return true;
124
104
  }
125
- var result = filterFn([row], [columnId], filterValue);
105
+ const result = filterFn([row], [columnId], filterValue);
126
106
  return !!result.length;
127
107
  };
@@ -8,17 +8,17 @@ exports.useSubRowSelection = void 0;
8
8
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
9
9
  * See LICENSE.md in the project root for license terms and full copyright notice.
10
10
  *--------------------------------------------------------------------------------------------*/
11
- var react_1 = __importDefault(require("react"));
12
- var useSubRowSelection = function (hooks) {
11
+ const react_1 = __importDefault(require("react"));
12
+ const useSubRowSelection = (hooks) => {
13
13
  hooks.useInstance.push(useInstance);
14
14
  };
15
15
  exports.useSubRowSelection = useSubRowSelection;
16
- var useInstance = function (instance) {
17
- var selectedFlatRows = react_1.default.useMemo(function () {
18
- var selectedFlatRows = [];
19
- var setSelectionState = function (row, selectedRowIds) {
20
- var isSomeSubRowsSelected = false;
21
- row.subRows.forEach(function (subRow) {
16
+ const useInstance = (instance) => {
17
+ const selectedFlatRows = react_1.default.useMemo(() => {
18
+ const selectedFlatRows = [];
19
+ const setSelectionState = (row, selectedRowIds) => {
20
+ let isSomeSubRowsSelected = false;
21
+ row.subRows.forEach((subRow) => {
22
22
  setSelectionState(subRow, selectedRowIds);
23
23
  if (subRow.isSelected || subRow.isSomeSelected) {
24
24
  isSomeSubRowsSelected = true;
@@ -34,12 +34,10 @@ var useInstance = function (instance) {
34
34
  row.isSomeSelected = isSomeSubRowsSelected;
35
35
  }
36
36
  };
37
- instance.rows.forEach(function (row) {
38
- return setSelectionState(row, instance.state.selectedRowIds);
39
- });
37
+ instance.rows.forEach((row) => setSelectionState(row, instance.state.selectedRowIds));
40
38
  return selectedFlatRows;
41
39
  }, [instance.rows, instance.state.selectedRowIds]);
42
40
  Object.assign(instance, {
43
- selectedFlatRows: selectedFlatRows,
41
+ selectedFlatRows,
44
42
  });
45
43
  };
@@ -1,61 +1,50 @@
1
1
  "use strict";
2
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
3
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4
- if (ar || !(i in from)) {
5
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
6
- ar[i] = from[i];
7
- }
8
- }
9
- return to.concat(ar || Array.prototype.slice.call(from));
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.getStickyStyle = exports.getCellStyle = void 0;
13
- var getCellStyle = function (column, isTableResizing) {
14
- var style = {};
15
- style.flex = "1 1 145px";
4
+ const getCellStyle = (column, isTableResizing) => {
5
+ const style = {};
6
+ style.flex = `1 1 145px`;
16
7
  if (column.width) {
17
- var width = typeof column.width === 'string' ? column.width : "".concat(column.width, "px");
8
+ const width = typeof column.width === 'string' ? column.width : `${column.width}px`;
18
9
  style.width = width;
19
10
  // This allows flexbox to handle the width of the column on table resize
20
11
  if (isTableResizing && column.canResize) {
21
- style.flex = "".concat(Number(column.width), " ").concat(Number(column.width), " ").concat(width);
12
+ style.flex = `${Number(column.width)} ${Number(column.width)} ${width}`;
22
13
  }
23
14
  else {
24
- style.flex = "0 0 ".concat(width);
15
+ style.flex = `0 0 ${width}`;
25
16
  }
26
17
  }
27
18
  if (column.maxWidth) {
28
- style.maxWidth = "".concat(column.maxWidth, "px");
19
+ style.maxWidth = `${column.maxWidth}px`;
29
20
  }
30
21
  if (column.minWidth) {
31
- style.minWidth = "".concat(column.minWidth, "px");
22
+ style.minWidth = `${column.minWidth}px`;
32
23
  }
33
24
  return style;
34
25
  };
35
26
  exports.getCellStyle = getCellStyle;
36
- var getStickyStyle = function (column, columnList) {
27
+ const getStickyStyle = (column, columnList) => {
37
28
  if (!column.sticky) {
38
29
  return {};
39
30
  }
40
- var left = 0;
41
- for (var _i = 0, columnList_1 = columnList; _i < columnList_1.length; _i++) {
42
- var col = columnList_1[_i];
31
+ let left = 0;
32
+ for (const col of columnList) {
43
33
  if (col.id === column.id) {
44
34
  break;
45
35
  }
46
36
  left += Number(col.width || col.resizeWidth || 0);
47
37
  }
48
- var right = 0;
49
- for (var _a = 0, _b = __spreadArray([], columnList, true).reverse(); _a < _b.length; _a++) {
50
- var col = _b[_a];
38
+ let right = 0;
39
+ for (const col of [...columnList].reverse()) {
51
40
  if (col.id === column.id) {
52
41
  break;
53
42
  }
54
43
  right += Number(col.width || col.resizeWidth || 0);
55
44
  }
56
45
  return {
57
- '--iui-table-sticky-left': column.sticky === 'left' ? "".concat(left, "px") : undefined,
58
- '--iui-table-sticky-right': column.sticky === 'right' ? "".concat(right, "px") : undefined,
46
+ '--iui-table-sticky-left': column.sticky === 'left' ? `${left}px` : undefined,
47
+ '--iui-table-sticky-right': column.sticky === 'right' ? `${right}px` : undefined,
59
48
  };
60
49
  };
61
50
  exports.getStickyStyle = getStickyStyle;
@@ -1,26 +1,4 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __rest = (this && this.__rest) || function (s, e) {
14
- var t = {};
15
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
- t[p] = s[p];
17
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
- t[p[i]] = s[p[i]];
21
- }
22
- return t;
23
- };
24
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
25
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
26
4
  };
@@ -30,9 +8,9 @@ exports.Tab = void 0;
30
8
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
31
9
  * See LICENSE.md in the project root for license terms and full copyright notice.
32
10
  *--------------------------------------------------------------------------------------------*/
33
- var classnames_1 = __importDefault(require("classnames"));
34
- var react_1 = __importDefault(require("react"));
35
- var utils_1 = require("../utils");
11
+ const classnames_1 = __importDefault(require("classnames"));
12
+ const react_1 = __importDefault(require("react"));
13
+ const utils_1 = require("../utils");
36
14
  require("@itwin/itwinui-css/css/tabs.css");
37
15
  /**
38
16
  * Individual tab component to be used in the `labels` prop of `Tabs`.
@@ -42,10 +20,10 @@ require("@itwin/itwinui-css/css/tabs.css");
42
20
  * <Tab label='Label 2' startIcon={<SvgPlaceholder />} />,
43
21
  * ];
44
22
  */
45
- var Tab = function (props) {
46
- var label = props.label, sublabel = props.sublabel, startIcon = props.startIcon, children = props.children, className = props.className, rest = __rest(props, ["label", "sublabel", "startIcon", "children", "className"]);
23
+ const Tab = (props) => {
24
+ const { label, sublabel, startIcon, children, className, ...rest } = props;
47
25
  (0, utils_1.useTheme)();
48
- return (react_1.default.createElement("button", __assign({ className: (0, classnames_1.default)('iui-tab', className), role: 'tab', tabIndex: -1 }, rest),
26
+ return (react_1.default.createElement("button", { className: (0, classnames_1.default)('iui-tab', className), role: 'tab', tabIndex: -1, ...rest },
49
27
  startIcon &&
50
28
  react_1.default.cloneElement(startIcon, {
51
29
  className: 'iui-tab-icon',
@@ -1,26 +1,4 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __rest = (this && this.__rest) || function (s, e) {
14
- var t = {};
15
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
- t[p] = s[p];
17
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
- t[p[i]] = s[p[i]];
21
- }
22
- return t;
23
- };
24
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
25
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
26
4
  };
@@ -30,11 +8,11 @@ exports.VerticalTabs = exports.HorizontalTabs = exports.Tabs = void 0;
30
8
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
31
9
  * See LICENSE.md in the project root for license terms and full copyright notice.
32
10
  *--------------------------------------------------------------------------------------------*/
33
- var classnames_1 = __importDefault(require("classnames"));
34
- var react_1 = __importDefault(require("react"));
35
- var utils_1 = require("../utils");
11
+ const classnames_1 = __importDefault(require("classnames"));
12
+ const react_1 = __importDefault(require("react"));
13
+ const utils_1 = require("../utils");
36
14
  require("@itwin/itwinui-css/css/tabs.css");
37
- var Tab_1 = require("./Tab");
15
+ const Tab_1 = require("./Tab");
38
16
  /**
39
17
  * Tabs organize and allow navigation between groups of content that are related and at the same level of hierarchy.
40
18
  * @example
@@ -62,69 +40,69 @@ var Tab_1 = require("./Tab");
62
40
  * ];
63
41
  * <Tabs labels={tabsWithIcons} type='pill' />
64
42
  */
65
- var Tabs = function (props) {
66
- var labels = props.labels, activeIndex = props.activeIndex, onTabSelected = props.onTabSelected, _a = props.focusActivationMode, focusActivationMode = _a === void 0 ? 'auto' : _a, _b = props.type, type = _b === void 0 ? 'default' : _b, _c = props.color, color = _c === void 0 ? 'blue' : _c, _d = props.orientation, orientation = _d === void 0 ? 'horizontal' : _d, tabsClassName = props.tabsClassName, contentClassName = props.contentClassName, wrapperClassName = props.wrapperClassName, children = props.children, rest = __rest(props, ["labels", "activeIndex", "onTabSelected", "focusActivationMode", "type", "color", "orientation", "tabsClassName", "contentClassName", "wrapperClassName", "children"]);
43
+ const Tabs = (props) => {
44
+ const { labels, activeIndex, onTabSelected, focusActivationMode = 'auto', type = 'default', color = 'blue', orientation = 'horizontal', tabsClassName, contentClassName, wrapperClassName, children, ...rest } = props;
67
45
  (0, utils_1.useTheme)();
68
- var tablistRef = react_1.default.useRef(null);
69
- var _e = (0, utils_1.useContainerWidth)(type !== 'default'), tablistSizeRef = _e[0], tabsWidth = _e[1];
70
- var refs = (0, utils_1.useMergedRefs)(tablistRef, tablistSizeRef);
71
- var _f = react_1.default.useState(function () {
72
- return activeIndex != null
73
- ? (0, utils_1.getBoundedValue)(activeIndex, 0, labels.length - 1)
74
- : 0;
75
- }), currentActiveIndex = _f[0], setCurrentActiveIndex = _f[1];
76
- react_1.default.useLayoutEffect(function () {
46
+ const tablistRef = react_1.default.useRef(null);
47
+ const [tablistSizeRef, tabsWidth] = (0, utils_1.useContainerWidth)(type !== 'default');
48
+ const refs = (0, utils_1.useMergedRefs)(tablistRef, tablistSizeRef);
49
+ const [currentActiveIndex, setCurrentActiveIndex] = react_1.default.useState(() => activeIndex != null
50
+ ? (0, utils_1.getBoundedValue)(activeIndex, 0, labels.length - 1)
51
+ : 0);
52
+ react_1.default.useLayoutEffect(() => {
77
53
  if (activeIndex != null && currentActiveIndex !== activeIndex) {
78
54
  setCurrentActiveIndex((0, utils_1.getBoundedValue)(activeIndex, 0, labels.length - 1));
79
55
  }
80
56
  }, [activeIndex, currentActiveIndex, labels.length]);
81
57
  // CSS custom properties to place the active stripe
82
- var _g = react_1.default.useState({}), stripeProperties = _g[0], setStripeProperties = _g[1];
83
- react_1.default.useLayoutEffect(function () {
58
+ const [stripeProperties, setStripeProperties] = react_1.default.useState({});
59
+ react_1.default.useLayoutEffect(() => {
84
60
  if (type !== 'default' && tablistRef.current != undefined) {
85
- var activeTab = tablistRef.current.children[currentActiveIndex];
86
- var activeTabRect = activeTab.getBoundingClientRect();
87
- setStripeProperties(__assign(__assign({}, (orientation === 'horizontal' && {
88
- '--stripe-width': "".concat(activeTabRect.width, "px"),
89
- '--stripe-left': "".concat(activeTab.offsetLeft, "px"),
90
- })), (orientation === 'vertical' && {
91
- '--stripe-height': "".concat(activeTabRect.height, "px"),
92
- '--stripe-top': "".concat(activeTab.offsetTop, "px"),
93
- })));
61
+ const activeTab = tablistRef.current.children[currentActiveIndex];
62
+ const activeTabRect = activeTab.getBoundingClientRect();
63
+ setStripeProperties({
64
+ ...(orientation === 'horizontal' && {
65
+ '--stripe-width': `${activeTabRect.width}px`,
66
+ '--stripe-left': `${activeTab.offsetLeft}px`,
67
+ }),
68
+ ...(orientation === 'vertical' && {
69
+ '--stripe-height': `${activeTabRect.height}px`,
70
+ '--stripe-top': `${activeTab.offsetTop}px`,
71
+ }),
72
+ });
94
73
  }
95
74
  }, [currentActiveIndex, type, orientation, tabsWidth]);
96
- var _h = react_1.default.useState(), focusedIndex = _h[0], setFocusedIndex = _h[1];
97
- react_1.default.useEffect(function () {
75
+ const [focusedIndex, setFocusedIndex] = react_1.default.useState();
76
+ react_1.default.useEffect(() => {
98
77
  if (tablistRef.current && focusedIndex !== undefined) {
99
- var tab = tablistRef.current.querySelectorAll('.iui-tab')[focusedIndex];
78
+ const tab = tablistRef.current.querySelectorAll('.iui-tab')[focusedIndex];
100
79
  tab === null || tab === void 0 ? void 0 : tab.focus();
101
80
  }
102
81
  }, [focusedIndex]);
103
- var _j = react_1.default.useState(false), hasSublabel = _j[0], setHasSublabel = _j[1]; // used for setting size
104
- react_1.default.useLayoutEffect(function () {
82
+ const [hasSublabel, setHasSublabel] = react_1.default.useState(false); // used for setting size
83
+ react_1.default.useLayoutEffect(() => {
105
84
  var _a;
106
85
  setHasSublabel(type !== 'pill' && // pill tabs should never have sublabels
107
86
  !!((_a = tablistRef.current) === null || _a === void 0 ? void 0 : _a.querySelector('.iui-tab-description')));
108
87
  }, [type]);
109
- var onTabClick = function (index) {
88
+ const onTabClick = (index) => {
110
89
  if (onTabSelected) {
111
90
  onTabSelected(index);
112
91
  }
113
92
  setCurrentActiveIndex(index);
114
93
  };
115
- var onKeyDown = function (event) {
94
+ const onKeyDown = (event) => {
116
95
  // alt + arrow keys are used by browser / assistive technologies
117
96
  if (event.altKey) {
118
97
  return;
119
98
  }
120
- var isTabDisabled = function (index) {
121
- var tab = labels[index];
99
+ const isTabDisabled = (index) => {
100
+ const tab = labels[index];
122
101
  return react_1.default.isValidElement(tab) && tab.props.disabled;
123
102
  };
124
- var newIndex = focusedIndex !== null && focusedIndex !== void 0 ? focusedIndex : currentActiveIndex;
103
+ let newIndex = focusedIndex !== null && focusedIndex !== void 0 ? focusedIndex : currentActiveIndex;
125
104
  /** focus next tab if delta is +1, previous tab if -1 */
126
- var focusTab = function (delta) {
127
- if (delta === void 0) { delta = +1; }
105
+ const focusTab = (delta = +1) => {
128
106
  do {
129
107
  newIndex = (newIndex + delta + labels.length) % labels.length;
130
108
  } while (isTabDisabled(newIndex) && newIndex !== focusedIndex);
@@ -173,13 +151,13 @@ var Tabs = function (props) {
173
151
  break;
174
152
  }
175
153
  };
176
- return (react_1.default.createElement("div", { className: (0, classnames_1.default)('iui-tabs-wrapper', "iui-".concat(orientation), wrapperClassName), style: stripeProperties },
177
- react_1.default.createElement("ul", __assign({ className: (0, classnames_1.default)('iui-tabs', "iui-".concat(type), {
154
+ return (react_1.default.createElement("div", { className: (0, classnames_1.default)('iui-tabs-wrapper', `iui-${orientation}`, wrapperClassName), style: stripeProperties },
155
+ react_1.default.createElement("ul", { className: (0, classnames_1.default)('iui-tabs', `iui-${type}`, {
178
156
  'iui-green': color === 'green',
179
157
  'iui-animated': type !== 'default',
180
158
  'iui-large': hasSublabel,
181
- }, tabsClassName), role: 'tablist', ref: refs, onKeyDown: onKeyDown }, rest), labels.map(function (label, index) {
182
- var onClick = function () {
159
+ }, tabsClassName), role: 'tablist', ref: refs, onKeyDown: onKeyDown, ...rest }, labels.map((label, index) => {
160
+ const onClick = () => {
183
161
  setFocusedIndex(index);
184
162
  onTabClick(index);
185
163
  };
@@ -191,7 +169,7 @@ var Tabs = function (props) {
191
169
  }),
192
170
  'aria-selected': index === currentActiveIndex,
193
171
  tabIndex: index === currentActiveIndex ? 0 : -1,
194
- onClick: function (args) {
172
+ onClick: (args) => {
195
173
  var _a, _b;
196
174
  onClick();
197
175
  (_b = (_a = label.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, args);
@@ -213,7 +191,7 @@ exports.Tabs = Tabs;
213
191
  * ];
214
192
  * <HorizontalTabs labels={tabs} activeIndex={1}>Tabpanel content</HorizontalTabs>
215
193
  */
216
- var HorizontalTabs = function (props) { return (react_1.default.createElement(exports.Tabs, __assign({ orientation: 'horizontal' }, props))); };
194
+ const HorizontalTabs = (props) => (react_1.default.createElement(exports.Tabs, { orientation: 'horizontal', ...props }));
217
195
  exports.HorizontalTabs = HorizontalTabs;
218
196
  /**
219
197
  * @deprecated Since v2, directly use `Tabs` with `orientation: 'vertical'`
@@ -227,6 +205,6 @@ exports.HorizontalTabs = HorizontalTabs;
227
205
  * ];
228
206
  * <VerticalTabs labels={tabs} activeIndex={1}>Tabpanel content</VerticalTabs>
229
207
  */
230
- var VerticalTabs = function (props) { return (react_1.default.createElement(exports.Tabs, __assign({ orientation: 'vertical' }, props))); };
208
+ const VerticalTabs = (props) => (react_1.default.createElement(exports.Tabs, { orientation: 'vertical', ...props }));
231
209
  exports.VerticalTabs = VerticalTabs;
232
210
  exports.default = exports.Tabs;