@itwin/itwinui-react 1.48.1 → 2.0.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (453) hide show
  1. package/README.md +4 -22
  2. package/cjs/core/Alert/Alert.d.ts +7 -6
  3. package/cjs/core/Alert/Alert.js +13 -8
  4. package/cjs/core/Avatar/Avatar.d.ts +69 -0
  5. package/cjs/core/{UserIcon/UserIcon.js → Avatar/Avatar.js} +15 -11
  6. package/cjs/core/Avatar/index.d.ts +4 -0
  7. package/cjs/core/{UserIcon → Avatar}/index.js +5 -4
  8. package/cjs/core/AvatarGroup/AvatarGroup.d.ts +70 -0
  9. package/cjs/core/{UserIconGroup/UserIconGroup.js → AvatarGroup/AvatarGroup.js} +23 -19
  10. package/cjs/core/AvatarGroup/index.d.ts +4 -0
  11. package/cjs/core/{UserIconGroup → AvatarGroup}/index.js +5 -4
  12. package/cjs/core/Badge/Badge.js +2 -4
  13. package/cjs/core/Breadcrumbs/Breadcrumbs.js +1 -2
  14. package/cjs/core/ButtonGroup/ButtonGroup.d.ts +1 -1
  15. package/cjs/core/Buttons/Button/Button.js +5 -14
  16. package/cjs/core/Buttons/DropdownButton/DropdownButton.js +1 -3
  17. package/cjs/core/Buttons/IconButton/IconButton.js +3 -9
  18. package/cjs/core/Buttons/IdeasButton/IdeasButton.js +1 -2
  19. package/cjs/core/Buttons/SplitButton/SplitButton.js +4 -8
  20. package/cjs/core/Carousel/CarouselNavigation.js +3 -4
  21. package/cjs/core/Checkbox/Checkbox.d.ts +1 -29
  22. package/cjs/core/Checkbox/Checkbox.js +3 -3
  23. package/cjs/core/ColorPicker/ColorBuilder.js +16 -27
  24. package/cjs/core/ColorPicker/ColorInputPanel.js +1 -2
  25. package/cjs/core/ColorPicker/ColorSwatch.d.ts +1 -1
  26. package/cjs/core/ColorPicker/ColorSwatch.js +1 -6
  27. package/cjs/core/ComboBox/ComboBoxDropdown.d.ts +1 -1
  28. package/cjs/core/ComboBox/ComboBoxEndIcon.js +1 -2
  29. package/cjs/core/ComboBox/ComboBoxMenu.js +2 -4
  30. package/cjs/core/DatePicker/DatePicker.js +4 -8
  31. package/cjs/core/Dialog/Dialog.d.ts +4 -4
  32. package/cjs/core/Dialog/Dialog.js +1 -1
  33. package/cjs/core/Dialog/DialogBackdrop.d.ts +1 -1
  34. package/cjs/core/Dialog/DialogBackdrop.js +5 -2
  35. package/cjs/core/Dialog/DialogMain.d.ts +1 -1
  36. package/cjs/core/Dialog/DialogMain.js +7 -1
  37. package/cjs/core/Dialog/DialogTitleBar.d.ts +1 -1
  38. package/cjs/core/Dialog/DialogTitleBar.js +1 -2
  39. package/cjs/core/ExpandableBlock/ExpandableBlock.js +5 -6
  40. package/cjs/core/FileUpload/FileUploadTemplate.js +1 -2
  41. package/cjs/core/Header/Header.d.ts +16 -6
  42. package/cjs/core/Header/Header.js +9 -12
  43. package/cjs/core/Header/HeaderBasicButton.d.ts +6 -0
  44. package/cjs/core/Header/HeaderBasicButton.js +52 -0
  45. package/cjs/core/Header/HeaderBreadcrumbs.js +6 -5
  46. package/cjs/core/Header/HeaderButton.d.ts +3 -2
  47. package/cjs/core/Header/HeaderButton.js +10 -18
  48. package/cjs/core/Header/HeaderDropdownButton.d.ts +6 -0
  49. package/cjs/core/Header/HeaderDropdownButton.js +53 -0
  50. package/cjs/core/Header/HeaderLogo.js +3 -3
  51. package/cjs/core/Header/HeaderSplitButton.d.ts +6 -0
  52. package/cjs/core/Header/HeaderSplitButton.js +54 -0
  53. package/cjs/core/InformationPanel/InformationPanelHeader.js +1 -2
  54. package/cjs/core/Input/Input.d.ts +1 -1
  55. package/cjs/core/Input/Input.js +3 -4
  56. package/cjs/core/InputGroup/InputGroup.d.ts +1 -1
  57. package/cjs/core/InputGroup/InputGroup.js +1 -1
  58. package/cjs/core/Label/Label.d.ts +1 -1
  59. package/cjs/core/Label/Label.js +1 -1
  60. package/cjs/core/LabeledInput/LabeledInput.d.ts +2 -2
  61. package/cjs/core/LabeledInput/LabeledInput.js +1 -1
  62. package/cjs/core/LabeledSelect/LabeledSelect.d.ts +1 -1
  63. package/cjs/core/LabeledSelect/LabeledSelect.js +1 -1
  64. package/cjs/core/LabeledTextarea/LabeledTextarea.d.ts +1 -1
  65. package/cjs/core/LabeledTextarea/LabeledTextarea.js +1 -1
  66. package/cjs/core/Menu/MenuItem.js +1 -2
  67. package/cjs/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +2 -4
  68. package/cjs/core/Radio/Radio.d.ts +1 -29
  69. package/cjs/core/Radio/Radio.js +3 -3
  70. package/cjs/core/RadioTiles/RadioTileGroup.d.ts +1 -1
  71. package/cjs/core/RadioTiles/RadioTileGroup.js +1 -1
  72. package/cjs/core/Select/Select.d.ts +1 -1
  73. package/cjs/core/Select/Select.js +10 -14
  74. package/cjs/core/Select/SelectTag.d.ts +1 -1
  75. package/cjs/core/Select/SelectTag.js +1 -1
  76. package/cjs/core/SideNavigation/SideNavigation.js +1 -2
  77. package/cjs/core/SideNavigation/SidenavButton.js +1 -2
  78. package/cjs/core/Stepper/Stepper.d.ts +40 -0
  79. package/cjs/core/{Wizard/Wizard.js → Stepper/Stepper.js} +11 -28
  80. package/cjs/core/{Wizard/Step.d.ts → Stepper/StepperStep.d.ts} +6 -7
  81. package/cjs/core/{Wizard/Step.js → Stepper/StepperStep.js} +10 -10
  82. package/cjs/core/Stepper/Wizard.d.ts +46 -0
  83. package/cjs/core/Stepper/Wizard.js +55 -0
  84. package/cjs/core/Stepper/WorkflowDiagram.d.ts +6 -0
  85. package/cjs/core/Stepper/WorkflowDiagram.js +43 -0
  86. package/cjs/core/Stepper/WorkflowDiagramStep.d.ts +5 -0
  87. package/cjs/core/Stepper/WorkflowDiagramStep.js +42 -0
  88. package/cjs/core/Stepper/index.d.ts +8 -0
  89. package/cjs/core/{Wizard → Stepper}/index.js +5 -1
  90. package/cjs/core/Surface/Surface.d.ts +0 -2
  91. package/cjs/core/Surface/Surface.js +10 -10
  92. package/cjs/core/Table/SubRowExpander.js +3 -3
  93. package/cjs/core/Table/Table.d.ts +5 -4
  94. package/cjs/core/Table/Table.js +30 -23
  95. package/cjs/core/Table/TableCell.js +4 -4
  96. package/cjs/core/Table/TablePaginator.js +16 -19
  97. package/cjs/core/Table/TableRowMemoized.d.ts +2 -0
  98. package/cjs/core/Table/TableRowMemoized.js +10 -13
  99. package/cjs/core/Table/cells/DefaultCell.js +4 -9
  100. package/cjs/core/Table/columns/actionColumn.js +3 -3
  101. package/cjs/core/Table/columns/expanderColumn.js +3 -3
  102. package/cjs/core/Table/filters/BaseFilter.js +1 -1
  103. package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.js +1 -2
  104. package/cjs/core/Table/filters/FilterToggle.js +2 -4
  105. package/cjs/core/Table/hooks/useColumnDragAndDrop.js +4 -4
  106. package/cjs/core/Table/hooks/useResizeColumns.js +110 -106
  107. package/cjs/core/Tabs/Tab.d.ts +0 -8
  108. package/cjs/core/Tabs/Tab.js +1 -5
  109. package/cjs/core/Tabs/Tabs.d.ts +32 -12
  110. package/cjs/core/Tabs/Tabs.js +16 -12
  111. package/cjs/core/Tabs/index.d.ts +4 -4
  112. package/cjs/core/Tabs/index.js +2 -2
  113. package/cjs/core/Tag/Tag.js +1 -2
  114. package/cjs/core/Textarea/Textarea.d.ts +1 -1
  115. package/cjs/core/Textarea/Textarea.js +2 -2
  116. package/cjs/core/ThemeProvider/ThemeProvider.d.ts +27 -17
  117. package/cjs/core/ThemeProvider/ThemeProvider.js +64 -7
  118. package/cjs/core/Tile/Tile.d.ts +19 -1
  119. package/cjs/core/Tile/Tile.js +36 -16
  120. package/cjs/core/Toast/Toast.d.ts +3 -3
  121. package/cjs/core/Toast/Toast.js +4 -5
  122. package/cjs/core/Toast/ToastWrapper.d.ts +1 -1
  123. package/cjs/core/Toast/ToastWrapper.js +1 -1
  124. package/cjs/core/Tree/TreeNode.js +1 -7
  125. package/cjs/core/Tree/TreeNodeExpander.js +2 -2
  126. package/cjs/core/Typography/Body/Body.d.ts +5 -3
  127. package/cjs/core/Typography/Body/Body.js +2 -3
  128. package/cjs/core/Typography/Headline/Headline.d.ts +2 -3
  129. package/cjs/core/Typography/Headline/Headline.js +2 -3
  130. package/cjs/core/Typography/Leading/Leading.d.ts +2 -3
  131. package/cjs/core/Typography/Leading/Leading.js +2 -3
  132. package/cjs/core/Typography/Small/Small.d.ts +2 -3
  133. package/cjs/core/Typography/Small/Small.js +2 -3
  134. package/cjs/core/Typography/Subheading/Subheading.d.ts +2 -3
  135. package/cjs/core/Typography/Subheading/Subheading.js +2 -3
  136. package/cjs/core/Typography/Text/Text.d.ts +2 -0
  137. package/cjs/core/Typography/Text/Text.js +2 -0
  138. package/cjs/core/Typography/Title/Title.d.ts +2 -3
  139. package/cjs/core/Typography/Title/Title.js +2 -3
  140. package/cjs/core/index.d.ts +8 -8
  141. package/cjs/core/index.js +14 -10
  142. package/cjs/core/utils/components/Popover.d.ts +2 -2
  143. package/cjs/core/utils/components/Popover.js +1 -1
  144. package/cjs/core/utils/components/Resizer.d.ts +5 -0
  145. package/cjs/core/utils/components/Resizer.js +7 -1
  146. package/cjs/core/utils/components/VisuallyHidden.d.ts +1 -0
  147. package/cjs/core/utils/components/VisuallyHidden.js +1 -0
  148. package/cjs/core/utils/components/index.d.ts +0 -1
  149. package/cjs/core/utils/components/index.js +0 -1
  150. package/cjs/core/utils/functions/colors.d.ts +12 -12
  151. package/cjs/core/utils/functions/colors.js +12 -12
  152. package/cjs/core/utils/hooks/index.d.ts +1 -0
  153. package/cjs/core/utils/hooks/index.js +1 -0
  154. package/cjs/core/utils/hooks/useIsomorphicLayoutEffect.d.ts +7 -0
  155. package/cjs/core/utils/hooks/useIsomorphicLayoutEffect.js +17 -0
  156. package/cjs/core/utils/hooks/useMediaQuery.js +2 -1
  157. package/cjs/core/utils/hooks/useTheme.d.ts +20 -3
  158. package/cjs/core/utils/hooks/useTheme.js +57 -58
  159. package/cjs/core/utils/{components/icons.d.ts → icons/StatusIconMap.d.ts} +1 -1
  160. package/cjs/core/utils/icons/StatusIconMap.js +52 -0
  161. package/cjs/core/utils/icons/SvgCalendar.d.ts +2 -0
  162. package/cjs/core/utils/icons/SvgCalendar.js +47 -0
  163. package/cjs/core/utils/icons/SvgCaretDownSmall.d.ts +2 -0
  164. package/cjs/core/utils/icons/SvgCaretDownSmall.js +47 -0
  165. package/cjs/core/utils/icons/SvgCaretRightSmall.d.ts +2 -0
  166. package/cjs/core/utils/icons/SvgCaretRightSmall.js +47 -0
  167. package/cjs/core/utils/icons/SvgCaretUpSmall.d.ts +2 -0
  168. package/cjs/core/utils/icons/SvgCaretUpSmall.js +47 -0
  169. package/cjs/core/utils/icons/SvgCheckmark.d.ts +2 -0
  170. package/cjs/core/utils/icons/SvgCheckmark.js +47 -0
  171. package/cjs/core/utils/icons/SvgCheckmarkSmall.d.ts +2 -0
  172. package/cjs/core/utils/icons/SvgCheckmarkSmall.js +47 -0
  173. package/cjs/core/utils/icons/SvgChevronLeft.d.ts +2 -0
  174. package/cjs/core/utils/icons/SvgChevronLeft.js +47 -0
  175. package/cjs/core/utils/icons/SvgChevronLeftDouble.d.ts +2 -0
  176. package/cjs/core/utils/icons/SvgChevronLeftDouble.js +47 -0
  177. package/cjs/core/utils/icons/SvgChevronRight.d.ts +2 -0
  178. package/cjs/core/utils/icons/SvgChevronRight.js +47 -0
  179. package/cjs/core/utils/icons/SvgChevronRightDouble.d.ts +2 -0
  180. package/cjs/core/utils/icons/SvgChevronRightDouble.js +47 -0
  181. package/cjs/core/utils/icons/SvgClose.d.ts +2 -0
  182. package/cjs/core/utils/icons/SvgClose.js +47 -0
  183. package/cjs/core/utils/icons/SvgCloseSmall.d.ts +2 -0
  184. package/cjs/core/utils/icons/SvgCloseSmall.js +47 -0
  185. package/cjs/core/utils/icons/SvgColumnManager.d.ts +2 -0
  186. package/cjs/core/utils/icons/SvgColumnManager.js +47 -0
  187. package/cjs/core/utils/icons/SvgFilter.d.ts +2 -0
  188. package/cjs/core/utils/icons/SvgFilter.js +47 -0
  189. package/cjs/core/utils/icons/SvgFilterHollow.d.ts +2 -0
  190. package/cjs/core/utils/icons/SvgFilterHollow.js +47 -0
  191. package/cjs/core/utils/icons/SvgImportantSmall.d.ts +2 -0
  192. package/cjs/core/utils/icons/SvgImportantSmall.js +47 -0
  193. package/cjs/core/utils/icons/SvgInfoCircular.d.ts +2 -0
  194. package/cjs/core/utils/icons/SvgInfoCircular.js +47 -0
  195. package/cjs/core/utils/icons/SvgMore.d.ts +2 -0
  196. package/cjs/core/utils/icons/SvgMore.js +47 -0
  197. package/cjs/core/utils/icons/SvgMoreVertical.d.ts +2 -0
  198. package/cjs/core/utils/icons/SvgMoreVertical.js +47 -0
  199. package/cjs/core/utils/icons/SvgNew.d.ts +2 -0
  200. package/cjs/core/utils/icons/SvgNew.js +47 -0
  201. package/cjs/core/utils/icons/SvgSmileyHappy.d.ts +2 -0
  202. package/cjs/core/utils/icons/SvgSmileyHappy.js +47 -0
  203. package/cjs/core/utils/icons/SvgSortDown.d.ts +2 -0
  204. package/cjs/core/utils/icons/SvgSortDown.js +47 -0
  205. package/cjs/core/utils/icons/SvgSortUp.d.ts +2 -0
  206. package/cjs/core/utils/icons/SvgSortUp.js +47 -0
  207. package/cjs/core/utils/icons/SvgStatusError.d.ts +2 -0
  208. package/cjs/core/utils/icons/SvgStatusError.js +47 -0
  209. package/cjs/core/utils/icons/SvgStatusSuccess.d.ts +2 -0
  210. package/cjs/core/utils/icons/SvgStatusSuccess.js +47 -0
  211. package/cjs/core/utils/icons/SvgStatusWarning.d.ts +2 -0
  212. package/cjs/core/utils/icons/SvgStatusWarning.js +47 -0
  213. package/cjs/core/utils/icons/SvgSwap.d.ts +2 -0
  214. package/cjs/core/utils/icons/SvgSwap.js +47 -0
  215. package/cjs/core/utils/icons/SvgUpload.d.ts +2 -0
  216. package/cjs/core/utils/icons/SvgUpload.js +47 -0
  217. package/cjs/core/utils/icons/index.d.ts +29 -0
  218. package/cjs/core/utils/icons/index.js +49 -0
  219. package/cjs/core/utils/index.d.ts +1 -0
  220. package/cjs/core/utils/index.js +1 -0
  221. package/esm/core/Alert/Alert.d.ts +7 -6
  222. package/esm/core/Alert/Alert.js +14 -9
  223. package/esm/core/Avatar/Avatar.d.ts +69 -0
  224. package/esm/core/{UserIcon/UserIcon.js → Avatar/Avatar.js} +13 -9
  225. package/esm/core/Avatar/index.d.ts +4 -0
  226. package/esm/core/{UserIcon → Avatar}/index.js +2 -2
  227. package/esm/core/AvatarGroup/AvatarGroup.d.ts +70 -0
  228. package/esm/core/{UserIconGroup/UserIconGroup.js → AvatarGroup/AvatarGroup.js} +21 -17
  229. package/esm/core/AvatarGroup/index.d.ts +4 -0
  230. package/esm/core/{UserIconGroup → AvatarGroup}/index.js +2 -2
  231. package/esm/core/Badge/Badge.js +3 -5
  232. package/esm/core/Breadcrumbs/Breadcrumbs.js +1 -2
  233. package/esm/core/ButtonGroup/ButtonGroup.d.ts +1 -1
  234. package/esm/core/Buttons/Button/Button.js +5 -14
  235. package/esm/core/Buttons/DropdownButton/DropdownButton.js +2 -4
  236. package/esm/core/Buttons/IconButton/IconButton.js +3 -9
  237. package/esm/core/Buttons/IdeasButton/IdeasButton.js +2 -3
  238. package/esm/core/Buttons/SplitButton/SplitButton.js +5 -9
  239. package/esm/core/Carousel/CarouselNavigation.js +1 -2
  240. package/esm/core/Checkbox/Checkbox.d.ts +1 -29
  241. package/esm/core/Checkbox/Checkbox.js +3 -3
  242. package/esm/core/ColorPicker/ColorBuilder.js +17 -28
  243. package/esm/core/ColorPicker/ColorInputPanel.js +1 -2
  244. package/esm/core/ColorPicker/ColorSwatch.d.ts +1 -1
  245. package/esm/core/ColorPicker/ColorSwatch.js +2 -7
  246. package/esm/core/ComboBox/ComboBoxDropdown.d.ts +1 -1
  247. package/esm/core/ComboBox/ComboBoxEndIcon.js +1 -2
  248. package/esm/core/ComboBox/ComboBoxMenu.js +2 -4
  249. package/esm/core/DatePicker/DatePicker.js +1 -5
  250. package/esm/core/Dialog/Dialog.d.ts +4 -4
  251. package/esm/core/Dialog/Dialog.js +1 -1
  252. package/esm/core/Dialog/DialogBackdrop.d.ts +1 -1
  253. package/esm/core/Dialog/DialogBackdrop.js +5 -2
  254. package/esm/core/Dialog/DialogMain.d.ts +1 -1
  255. package/esm/core/Dialog/DialogMain.js +7 -1
  256. package/esm/core/Dialog/DialogTitleBar.d.ts +1 -1
  257. package/esm/core/Dialog/DialogTitleBar.js +1 -2
  258. package/esm/core/ExpandableBlock/ExpandableBlock.js +5 -6
  259. package/esm/core/FileUpload/FileUploadTemplate.js +1 -2
  260. package/esm/core/Header/Header.d.ts +16 -6
  261. package/esm/core/Header/Header.js +9 -12
  262. package/esm/core/Header/HeaderBasicButton.d.ts +6 -0
  263. package/esm/core/Header/HeaderBasicButton.js +46 -0
  264. package/esm/core/Header/HeaderBreadcrumbs.js +7 -6
  265. package/esm/core/Header/HeaderButton.d.ts +3 -2
  266. package/esm/core/Header/HeaderButton.js +10 -18
  267. package/esm/core/Header/HeaderDropdownButton.d.ts +6 -0
  268. package/esm/core/Header/HeaderDropdownButton.js +47 -0
  269. package/esm/core/Header/HeaderLogo.js +3 -3
  270. package/esm/core/Header/HeaderSplitButton.d.ts +6 -0
  271. package/esm/core/Header/HeaderSplitButton.js +48 -0
  272. package/esm/core/InformationPanel/InformationPanelHeader.js +1 -2
  273. package/esm/core/Input/Input.d.ts +1 -1
  274. package/esm/core/Input/Input.js +3 -4
  275. package/esm/core/InputGroup/InputGroup.d.ts +1 -1
  276. package/esm/core/InputGroup/InputGroup.js +1 -1
  277. package/esm/core/Label/Label.d.ts +1 -1
  278. package/esm/core/Label/Label.js +1 -1
  279. package/esm/core/LabeledInput/LabeledInput.d.ts +2 -2
  280. package/esm/core/LabeledInput/LabeledInput.js +1 -1
  281. package/esm/core/LabeledSelect/LabeledSelect.d.ts +1 -1
  282. package/esm/core/LabeledSelect/LabeledSelect.js +1 -1
  283. package/esm/core/LabeledTextarea/LabeledTextarea.d.ts +1 -1
  284. package/esm/core/LabeledTextarea/LabeledTextarea.js +1 -1
  285. package/esm/core/Menu/MenuItem.js +1 -2
  286. package/esm/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +3 -5
  287. package/esm/core/Radio/Radio.d.ts +1 -29
  288. package/esm/core/Radio/Radio.js +3 -3
  289. package/esm/core/RadioTiles/RadioTileGroup.d.ts +1 -1
  290. package/esm/core/RadioTiles/RadioTileGroup.js +1 -1
  291. package/esm/core/Select/Select.d.ts +1 -1
  292. package/esm/core/Select/Select.js +10 -14
  293. package/esm/core/Select/SelectTag.d.ts +1 -1
  294. package/esm/core/Select/SelectTag.js +1 -1
  295. package/esm/core/SideNavigation/SideNavigation.js +1 -2
  296. package/esm/core/SideNavigation/SidenavButton.js +1 -2
  297. package/esm/core/Stepper/Stepper.d.ts +40 -0
  298. package/esm/core/{Wizard/Wizard.js → Stepper/Stepper.js} +10 -27
  299. package/esm/core/{Wizard/Step.d.ts → Stepper/StepperStep.d.ts} +6 -7
  300. package/esm/core/{Wizard/Step.js → Stepper/StepperStep.js} +8 -8
  301. package/esm/core/Stepper/Wizard.d.ts +46 -0
  302. package/esm/core/Stepper/Wizard.js +49 -0
  303. package/esm/core/Stepper/WorkflowDiagram.d.ts +6 -0
  304. package/esm/core/Stepper/WorkflowDiagram.js +37 -0
  305. package/esm/core/Stepper/WorkflowDiagramStep.d.ts +5 -0
  306. package/esm/core/Stepper/WorkflowDiagramStep.js +35 -0
  307. package/esm/core/Stepper/index.d.ts +8 -0
  308. package/esm/core/{Wizard → Stepper}/index.js +2 -0
  309. package/esm/core/Surface/Surface.d.ts +0 -2
  310. package/esm/core/Surface/Surface.js +11 -11
  311. package/esm/core/Table/SubRowExpander.js +2 -2
  312. package/esm/core/Table/Table.d.ts +5 -4
  313. package/esm/core/Table/Table.js +31 -24
  314. package/esm/core/Table/TableCell.js +4 -4
  315. package/esm/core/Table/TablePaginator.js +15 -18
  316. package/esm/core/Table/TableRowMemoized.d.ts +2 -0
  317. package/esm/core/Table/TableRowMemoized.js +10 -13
  318. package/esm/core/Table/cells/DefaultCell.js +4 -9
  319. package/esm/core/Table/columns/actionColumn.js +2 -2
  320. package/esm/core/Table/columns/expanderColumn.js +2 -2
  321. package/esm/core/Table/filters/BaseFilter.js +1 -1
  322. package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.js +1 -2
  323. package/esm/core/Table/filters/FilterToggle.js +2 -4
  324. package/esm/core/Table/hooks/useColumnDragAndDrop.js +4 -4
  325. package/esm/core/Table/hooks/useResizeColumns.js +110 -106
  326. package/esm/core/Tabs/Tab.d.ts +0 -8
  327. package/esm/core/Tabs/Tab.js +0 -4
  328. package/esm/core/Tabs/Tabs.d.ts +32 -12
  329. package/esm/core/Tabs/Tabs.js +17 -13
  330. package/esm/core/Tabs/index.d.ts +4 -4
  331. package/esm/core/Tabs/index.js +2 -2
  332. package/esm/core/Tag/Tag.js +1 -2
  333. package/esm/core/Textarea/Textarea.d.ts +1 -1
  334. package/esm/core/Textarea/Textarea.js +2 -2
  335. package/esm/core/ThemeProvider/ThemeProvider.d.ts +27 -17
  336. package/esm/core/ThemeProvider/ThemeProvider.js +64 -6
  337. package/esm/core/Tile/Tile.d.ts +19 -1
  338. package/esm/core/Tile/Tile.js +36 -16
  339. package/esm/core/Toast/Toast.d.ts +3 -3
  340. package/esm/core/Toast/Toast.js +4 -5
  341. package/esm/core/Toast/ToastWrapper.d.ts +1 -1
  342. package/esm/core/Toast/ToastWrapper.js +1 -1
  343. package/esm/core/Tree/TreeNode.js +2 -8
  344. package/esm/core/Tree/TreeNodeExpander.js +1 -1
  345. package/esm/core/Typography/Body/Body.d.ts +5 -3
  346. package/esm/core/Typography/Body/Body.js +2 -3
  347. package/esm/core/Typography/Headline/Headline.d.ts +2 -3
  348. package/esm/core/Typography/Headline/Headline.js +2 -3
  349. package/esm/core/Typography/Leading/Leading.d.ts +2 -3
  350. package/esm/core/Typography/Leading/Leading.js +2 -3
  351. package/esm/core/Typography/Small/Small.d.ts +2 -3
  352. package/esm/core/Typography/Small/Small.js +2 -3
  353. package/esm/core/Typography/Subheading/Subheading.d.ts +2 -3
  354. package/esm/core/Typography/Subheading/Subheading.js +2 -3
  355. package/esm/core/Typography/Text/Text.d.ts +2 -0
  356. package/esm/core/Typography/Text/Text.js +2 -0
  357. package/esm/core/Typography/Title/Title.d.ts +2 -3
  358. package/esm/core/Typography/Title/Title.js +2 -3
  359. package/esm/core/index.d.ts +8 -8
  360. package/esm/core/index.js +4 -4
  361. package/esm/core/utils/components/Popover.d.ts +2 -2
  362. package/esm/core/utils/components/Popover.js +1 -1
  363. package/esm/core/utils/components/Resizer.d.ts +5 -0
  364. package/esm/core/utils/components/Resizer.js +7 -1
  365. package/esm/core/utils/components/VisuallyHidden.d.ts +1 -0
  366. package/esm/core/utils/components/VisuallyHidden.js +1 -0
  367. package/esm/core/utils/components/index.d.ts +0 -1
  368. package/esm/core/utils/components/index.js +0 -1
  369. package/esm/core/utils/functions/colors.d.ts +12 -12
  370. package/esm/core/utils/functions/colors.js +12 -12
  371. package/esm/core/utils/hooks/index.d.ts +1 -0
  372. package/esm/core/utils/hooks/index.js +1 -0
  373. package/esm/core/utils/hooks/useIsomorphicLayoutEffect.d.ts +7 -0
  374. package/esm/core/utils/hooks/useIsomorphicLayoutEffect.js +11 -0
  375. package/esm/core/utils/hooks/useMediaQuery.js +2 -1
  376. package/esm/core/utils/hooks/useTheme.d.ts +20 -3
  377. package/esm/core/utils/hooks/useTheme.js +56 -57
  378. package/esm/core/utils/{components/icons.d.ts → icons/StatusIconMap.d.ts} +1 -1
  379. package/esm/core/utils/{components/icons.js → icons/StatusIconMap.js} +5 -5
  380. package/esm/core/utils/icons/SvgCalendar.d.ts +2 -0
  381. package/esm/core/utils/icons/SvgCalendar.js +20 -0
  382. package/esm/core/utils/icons/SvgCaretDownSmall.d.ts +2 -0
  383. package/esm/core/utils/icons/SvgCaretDownSmall.js +20 -0
  384. package/esm/core/utils/icons/SvgCaretRightSmall.d.ts +2 -0
  385. package/esm/core/utils/icons/SvgCaretRightSmall.js +20 -0
  386. package/esm/core/utils/icons/SvgCaretUpSmall.d.ts +2 -0
  387. package/esm/core/utils/icons/SvgCaretUpSmall.js +20 -0
  388. package/esm/core/utils/icons/SvgCheckmark.d.ts +2 -0
  389. package/esm/core/utils/icons/SvgCheckmark.js +20 -0
  390. package/esm/core/utils/icons/SvgCheckmarkSmall.d.ts +2 -0
  391. package/esm/core/utils/icons/SvgCheckmarkSmall.js +20 -0
  392. package/esm/core/utils/icons/SvgChevronLeft.d.ts +2 -0
  393. package/esm/core/utils/icons/SvgChevronLeft.js +20 -0
  394. package/esm/core/utils/icons/SvgChevronLeftDouble.d.ts +2 -0
  395. package/esm/core/utils/icons/SvgChevronLeftDouble.js +20 -0
  396. package/esm/core/utils/icons/SvgChevronRight.d.ts +2 -0
  397. package/esm/core/utils/icons/SvgChevronRight.js +20 -0
  398. package/esm/core/utils/icons/SvgChevronRightDouble.d.ts +2 -0
  399. package/esm/core/utils/icons/SvgChevronRightDouble.js +20 -0
  400. package/esm/core/utils/icons/SvgClose.d.ts +2 -0
  401. package/esm/core/utils/icons/SvgClose.js +20 -0
  402. package/esm/core/utils/icons/SvgCloseSmall.d.ts +2 -0
  403. package/esm/core/utils/icons/SvgCloseSmall.js +20 -0
  404. package/esm/core/utils/icons/SvgColumnManager.d.ts +2 -0
  405. package/esm/core/utils/icons/SvgColumnManager.js +20 -0
  406. package/esm/core/utils/icons/SvgFilter.d.ts +2 -0
  407. package/esm/core/utils/icons/SvgFilter.js +20 -0
  408. package/esm/core/utils/icons/SvgFilterHollow.d.ts +2 -0
  409. package/esm/core/utils/icons/SvgFilterHollow.js +20 -0
  410. package/esm/core/utils/icons/SvgImportantSmall.d.ts +2 -0
  411. package/esm/core/utils/icons/SvgImportantSmall.js +20 -0
  412. package/esm/core/utils/icons/SvgInfoCircular.d.ts +2 -0
  413. package/esm/core/utils/icons/SvgInfoCircular.js +20 -0
  414. package/esm/core/utils/icons/SvgMore.d.ts +2 -0
  415. package/esm/core/utils/icons/SvgMore.js +20 -0
  416. package/esm/core/utils/icons/SvgMoreVertical.d.ts +2 -0
  417. package/esm/core/utils/icons/SvgMoreVertical.js +20 -0
  418. package/esm/core/utils/icons/SvgNew.d.ts +2 -0
  419. package/esm/core/utils/icons/SvgNew.js +20 -0
  420. package/esm/core/utils/icons/SvgSmileyHappy.d.ts +2 -0
  421. package/esm/core/utils/icons/SvgSmileyHappy.js +20 -0
  422. package/esm/core/utils/icons/SvgSortDown.d.ts +2 -0
  423. package/esm/core/utils/icons/SvgSortDown.js +20 -0
  424. package/esm/core/utils/icons/SvgSortUp.d.ts +2 -0
  425. package/esm/core/utils/icons/SvgSortUp.js +20 -0
  426. package/esm/core/utils/icons/SvgStatusError.d.ts +2 -0
  427. package/esm/core/utils/icons/SvgStatusError.js +20 -0
  428. package/esm/core/utils/icons/SvgStatusSuccess.d.ts +2 -0
  429. package/esm/core/utils/icons/SvgStatusSuccess.js +20 -0
  430. package/esm/core/utils/icons/SvgStatusWarning.d.ts +2 -0
  431. package/esm/core/utils/icons/SvgStatusWarning.js +20 -0
  432. package/esm/core/utils/icons/SvgSwap.d.ts +2 -0
  433. package/esm/core/utils/icons/SvgSwap.js +20 -0
  434. package/esm/core/utils/icons/SvgUpload.d.ts +2 -0
  435. package/esm/core/utils/icons/SvgUpload.js +20 -0
  436. package/esm/core/utils/icons/index.d.ts +29 -0
  437. package/esm/core/utils/icons/index.js +33 -0
  438. package/esm/core/utils/index.d.ts +1 -0
  439. package/esm/core/utils/index.js +1 -0
  440. package/package.json +3 -3
  441. package/cjs/core/UserIcon/UserIcon.d.ts +0 -57
  442. package/cjs/core/UserIcon/index.d.ts +0 -4
  443. package/cjs/core/UserIconGroup/UserIconGroup.d.ts +0 -62
  444. package/cjs/core/UserIconGroup/index.d.ts +0 -4
  445. package/cjs/core/Wizard/Wizard.d.ts +0 -54
  446. package/cjs/core/Wizard/index.d.ts +0 -4
  447. package/cjs/core/utils/components/icons.js +0 -32
  448. package/esm/core/UserIcon/UserIcon.d.ts +0 -57
  449. package/esm/core/UserIcon/index.d.ts +0 -4
  450. package/esm/core/UserIconGroup/UserIconGroup.d.ts +0 -62
  451. package/esm/core/UserIconGroup/index.d.ts +0 -4
  452. package/esm/core/Wizard/Wizard.d.ts +0 -54
  453. package/esm/core/Wizard/index.d.ts +0 -4
@@ -19,122 +19,126 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
19
19
  return to.concat(ar || Array.prototype.slice.call(from));
20
20
  };
21
21
  import { actions, makePropGetter, useGetLatest, } from 'react-table';
22
- export var useResizeColumns = function (ownerDocument) { return function (hooks) {
23
- hooks.getResizerProps = [defaultGetResizerProps(ownerDocument)];
24
- hooks.stateReducers.push(reducer);
25
- hooks.useInstanceBeforeDimensions.push(useInstanceBeforeDimensions);
26
- }; };
22
+ export var useResizeColumns = function (ownerDocument) {
23
+ return function (hooks) {
24
+ hooks.getResizerProps = [defaultGetResizerProps(ownerDocument)];
25
+ hooks.stateReducers.push(reducer);
26
+ hooks.useInstanceBeforeDimensions.push(useInstanceBeforeDimensions);
27
+ };
28
+ };
27
29
  var isTouchEvent = function (event) {
28
30
  return event.type === 'touchstart';
29
31
  };
30
- var defaultGetResizerProps = function (ownerDocument) { return function (props, _a) {
31
- var instance = _a.instance, header = _a.header, nextHeader = _a.nextHeader;
32
- var dispatch = instance.dispatch;
33
- var onResizeStart = function (e, header) {
34
- var _a, _b, _c;
35
- // lets not respond to multiple touches (e.g. 2 or 3 fingers)
36
- if (isTouchEvent(e) && e.touches && e.touches.length > 1) {
37
- return;
38
- }
39
- var headerIdWidths = getLeafHeaders(header).map(function (d) { return [
40
- d.id,
41
- getHeaderWidth(d),
42
- ]; });
43
- var nextHeaderIdWidths = nextHeader
44
- ? getLeafHeaders(nextHeader).map(function (d) { return [d.id, getHeaderWidth(d)]; })
45
- : [];
46
- var clientX = isTouchEvent(e)
47
- ? Math.round(e.touches[0].clientX)
48
- : e.clientX;
49
- var dispatchMove = function (clientXPos) {
50
- return dispatch({ type: actions.columnResizing, clientX: clientXPos });
51
- };
52
- var dispatchEnd = function () {
53
- return dispatch({
54
- type: actions.columnDoneResizing,
32
+ var defaultGetResizerProps = function (ownerDocument) {
33
+ return function (props, _a) {
34
+ var instance = _a.instance, header = _a.header, nextHeader = _a.nextHeader;
35
+ var dispatch = instance.dispatch;
36
+ var onResizeStart = function (e, header) {
37
+ var _a, _b, _c;
38
+ // lets not respond to multiple touches (e.g. 2 or 3 fingers)
39
+ if (isTouchEvent(e) && e.touches && e.touches.length > 1) {
40
+ return;
41
+ }
42
+ var headerIdWidths = getLeafHeaders(header).map(function (d) { return [
43
+ d.id,
44
+ getHeaderWidth(d),
45
+ ]; });
46
+ var nextHeaderIdWidths = nextHeader
47
+ ? getLeafHeaders(nextHeader).map(function (d) { return [d.id, getHeaderWidth(d)]; })
48
+ : [];
49
+ var clientX = isTouchEvent(e)
50
+ ? Math.round(e.touches[0].clientX)
51
+ : e.clientX;
52
+ var dispatchMove = function (clientXPos) {
53
+ return dispatch({ type: actions.columnResizing, clientX: clientXPos });
54
+ };
55
+ var dispatchEnd = function () {
56
+ return dispatch({
57
+ type: actions.columnDoneResizing,
58
+ });
59
+ };
60
+ var handlersAndEvents = {
61
+ mouse: {
62
+ moveEvent: 'mousemove',
63
+ moveHandler: function (e) { return dispatchMove(e.clientX); },
64
+ upEvent: 'mouseup',
65
+ upHandler: function () {
66
+ var _a, _b, _c;
67
+ (_a = ownerDocument.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('mousemove', handlersAndEvents.mouse.moveHandler);
68
+ (_b = ownerDocument.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('mouseup', handlersAndEvents.mouse.upHandler);
69
+ (_c = ownerDocument.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('mouseleave', handlersAndEvents.mouse.upHandler);
70
+ dispatchEnd();
71
+ },
72
+ },
73
+ touch: {
74
+ moveEvent: 'touchmove',
75
+ moveHandler: function (e) {
76
+ if (e.cancelable) {
77
+ e.preventDefault();
78
+ e.stopPropagation();
79
+ }
80
+ dispatchMove(e.touches[0].clientX);
81
+ },
82
+ upEvent: 'touchend',
83
+ upHandler: function () {
84
+ var _a, _b;
85
+ (_a = ownerDocument.current) === null || _a === void 0 ? void 0 : _a.removeEventListener(handlersAndEvents.touch.moveEvent, handlersAndEvents.touch.moveHandler);
86
+ (_b = ownerDocument.current) === null || _b === void 0 ? void 0 : _b.removeEventListener(handlersAndEvents.touch.upEvent, handlersAndEvents.touch.moveHandler);
87
+ dispatchEnd();
88
+ },
89
+ },
90
+ };
91
+ var events = isTouchEvent(e)
92
+ ? handlersAndEvents.touch
93
+ : handlersAndEvents.mouse;
94
+ var passiveIfSupported = passiveEventSupported()
95
+ ? { passive: false }
96
+ : false;
97
+ (_a = ownerDocument.current) === null || _a === void 0 ? void 0 : _a.addEventListener(events.moveEvent, events.moveHandler, passiveIfSupported);
98
+ (_b = ownerDocument.current) === null || _b === void 0 ? void 0 : _b.addEventListener(events.upEvent, events.upHandler, passiveIfSupported);
99
+ if (!isTouchEvent(e)) {
100
+ (_c = ownerDocument.current) === null || _c === void 0 ? void 0 : _c.addEventListener('mouseleave', handlersAndEvents.mouse.upHandler, passiveIfSupported);
101
+ }
102
+ dispatch({
103
+ type: actions.columnStartResizing,
104
+ columnId: header.id,
105
+ columnWidth: getHeaderWidth(header),
106
+ nextColumnWidth: getHeaderWidth(nextHeader),
107
+ headerIdWidths: headerIdWidths,
108
+ nextHeaderIdWidths: nextHeaderIdWidths,
109
+ clientX: clientX,
55
110
  });
56
111
  };
57
- var handlersAndEvents = {
58
- mouse: {
59
- moveEvent: 'mousemove',
60
- moveHandler: function (e) { return dispatchMove(e.clientX); },
61
- upEvent: 'mouseup',
62
- upHandler: function () {
63
- var _a, _b, _c;
64
- (_a = ownerDocument.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('mousemove', handlersAndEvents.mouse.moveHandler);
65
- (_b = ownerDocument.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('mouseup', handlersAndEvents.mouse.upHandler);
66
- (_c = ownerDocument.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('mouseleave', handlersAndEvents.mouse.upHandler);
67
- dispatchEnd();
112
+ return [
113
+ props,
114
+ {
115
+ onClick: function (e) {
116
+ // Prevents from triggering sort
117
+ e.stopPropagation();
68
118
  },
69
- },
70
- touch: {
71
- moveEvent: 'touchmove',
72
- moveHandler: function (e) {
73
- if (e.cancelable) {
74
- e.preventDefault();
75
- e.stopPropagation();
76
- }
77
- dispatchMove(e.touches[0].clientX);
119
+ onMouseDown: function (e) {
120
+ e.persist();
121
+ // Prevents from triggering drag'n'drop
122
+ e.preventDefault();
123
+ // Prevents from triggering sort
124
+ e.stopPropagation();
125
+ onResizeStart(e, header);
78
126
  },
79
- upEvent: 'touchend',
80
- upHandler: function () {
81
- var _a, _b;
82
- (_a = ownerDocument.current) === null || _a === void 0 ? void 0 : _a.removeEventListener(handlersAndEvents.touch.moveEvent, handlersAndEvents.touch.moveHandler);
83
- (_b = ownerDocument.current) === null || _b === void 0 ? void 0 : _b.removeEventListener(handlersAndEvents.touch.upEvent, handlersAndEvents.touch.moveHandler);
84
- dispatchEnd();
127
+ onTouchStart: function (e) {
128
+ e.persist();
129
+ // Prevents from triggering drag'n'drop
130
+ e.preventDefault();
131
+ onResizeStart(e, header);
85
132
  },
133
+ style: {
134
+ cursor: 'col-resize',
135
+ },
136
+ draggable: false,
137
+ role: 'separator',
86
138
  },
87
- };
88
- var events = isTouchEvent(e)
89
- ? handlersAndEvents.touch
90
- : handlersAndEvents.mouse;
91
- var passiveIfSupported = passiveEventSupported()
92
- ? { passive: false }
93
- : false;
94
- (_a = ownerDocument.current) === null || _a === void 0 ? void 0 : _a.addEventListener(events.moveEvent, events.moveHandler, passiveIfSupported);
95
- (_b = ownerDocument.current) === null || _b === void 0 ? void 0 : _b.addEventListener(events.upEvent, events.upHandler, passiveIfSupported);
96
- if (!isTouchEvent(e)) {
97
- (_c = ownerDocument.current) === null || _c === void 0 ? void 0 : _c.addEventListener('mouseleave', handlersAndEvents.mouse.upHandler, passiveIfSupported);
98
- }
99
- dispatch({
100
- type: actions.columnStartResizing,
101
- columnId: header.id,
102
- columnWidth: getHeaderWidth(header),
103
- nextColumnWidth: getHeaderWidth(nextHeader),
104
- headerIdWidths: headerIdWidths,
105
- nextHeaderIdWidths: nextHeaderIdWidths,
106
- clientX: clientX,
107
- });
139
+ ];
108
140
  };
109
- return [
110
- props,
111
- {
112
- onClick: function (e) {
113
- // Prevents from triggering sort
114
- e.stopPropagation();
115
- },
116
- onMouseDown: function (e) {
117
- e.persist();
118
- // Prevents from triggering drag'n'drop
119
- e.preventDefault();
120
- // Prevents from triggering sort
121
- e.stopPropagation();
122
- onResizeStart(e, header);
123
- },
124
- onTouchStart: function (e) {
125
- e.persist();
126
- // Prevents from triggering drag'n'drop
127
- e.preventDefault();
128
- onResizeStart(e, header);
129
- },
130
- style: {
131
- cursor: 'col-resize',
132
- },
133
- draggable: false,
134
- role: 'separator',
135
- },
136
- ];
137
- }; };
141
+ };
138
142
  useResizeColumns.pluginName = 'useResizeColumns';
139
143
  var reducer = function (newState, action, previousState, instance) {
140
144
  if (action.type === actions.init) {
@@ -22,10 +22,6 @@ export declare type TabProps = {
22
22
  */
23
23
  children?: React.ReactNode;
24
24
  } & React.HTMLAttributes<HTMLButtonElement>;
25
- /**
26
- * @deprecated Use `TabProps` instead.
27
- */
28
- export declare type HorizontalTabProps = TabProps;
29
25
  /**
30
26
  * Individual tab component to be used in the `labels` prop of `Tabs`.
31
27
  * @example
@@ -35,8 +31,4 @@ export declare type HorizontalTabProps = TabProps;
35
31
  * ];
36
32
  */
37
33
  export declare const Tab: (props: TabProps) => JSX.Element;
38
- /**
39
- * @deprecated Use `Tab` instead.
40
- */
41
- export declare const HorizontalTab: (props: TabProps) => JSX.Element;
42
34
  export default TabProps;
@@ -50,7 +50,3 @@ export var Tab = function (props) {
50
50
  sublabel && React.createElement("div", { className: 'iui-tab-description' }, sublabel))),
51
51
  children));
52
52
  };
53
- /**
54
- * @deprecated Use `Tab` instead.
55
- */
56
- export var HorizontalTab = Tab;
@@ -1,5 +1,22 @@
1
1
  import React from 'react';
2
2
  import '@itwin/itwinui-css/css/tabs.css';
3
+ declare type TabsOrientationProps = {
4
+ /**
5
+ * Orientation of the tabs.
6
+ * @default 'horizontal'
7
+ */
8
+ orientation?: 'horizontal';
9
+ /**
10
+ * Type of the tabs.
11
+ *
12
+ * If `orientation = 'vertical'`, `pill` is not applicable.
13
+ * @default 'default'
14
+ */
15
+ type?: 'default' | 'borderless' | 'pill';
16
+ } | {
17
+ orientation: 'vertical';
18
+ type?: 'default' | 'borderless';
19
+ };
3
20
  export declare type TabsProps = {
4
21
  /**
5
22
  * Elements shown for each tab.
@@ -25,16 +42,6 @@ export declare type TabsProps = {
25
42
  * @default 'blue'
26
43
  */
27
44
  color?: 'blue' | 'green';
28
- /**
29
- * Type of the tabs.
30
- * @default 'default'
31
- */
32
- type?: 'default' | 'borderless' | 'pill';
33
- /**
34
- * Orientation of the tabs.
35
- * @default 'horizontal'
36
- */
37
- orientation?: 'horizontal' | 'vertical';
38
45
  /**
39
46
  * Custom CSS class name for tabs.
40
47
  */
@@ -51,8 +58,14 @@ export declare type TabsProps = {
51
58
  * Content inside the tab panel.
52
59
  */
53
60
  children?: React.ReactNode;
54
- };
61
+ } & TabsOrientationProps;
62
+ /**
63
+ * @deprecated Since v2, use `TabProps` with `Tabs`
64
+ */
55
65
  export declare type HorizontalTabsProps = Omit<TabsProps, 'orientation'>;
66
+ /**
67
+ * @deprecated Since v2, use `TabProps` with `Tabs`
68
+ */
56
69
  export declare type VerticalTabsProps = Omit<TabsProps, 'orientation' | 'type'> & {
57
70
  type?: 'default' | 'borderless';
58
71
  };
@@ -67,6 +80,9 @@ export declare type VerticalTabsProps = Omit<TabsProps, 'orientation' | 'type'>
67
80
  * <Tabs labels={tabs} />
68
81
  *
69
82
  * @example
83
+ * <Tabs orientation='vertical' labels={tabs} />
84
+ *
85
+ * @example
70
86
  * const tabsWithSublabels = [
71
87
  * <Tab label='Label 1' sublabel='First tab' />,
72
88
  * <Tab label='Label 2' sublabel='Active tab' />,
@@ -82,6 +98,8 @@ export declare type VerticalTabsProps = Omit<TabsProps, 'orientation' | 'type'>
82
98
  */
83
99
  export declare const Tabs: (props: TabsProps) => JSX.Element;
84
100
  /**
101
+ * @deprecated Since v2, directly use `Tabs` with `orientation: 'horizontal'`
102
+ *
85
103
  * Tabs organize and allow navigation between groups of content that are related and at the same level of hierarchy.
86
104
  * @example
87
105
  * const tabs = [
@@ -93,12 +111,14 @@ export declare const Tabs: (props: TabsProps) => JSX.Element;
93
111
  */
94
112
  export declare const HorizontalTabs: (props: HorizontalTabsProps) => JSX.Element;
95
113
  /**
114
+ * @deprecated Since v2, directly use `Tabs` with `orientation: 'vertical'`
115
+ *
96
116
  * Tabs organize and allow navigation between groups of content that are related and at the same level of hierarchy.
97
117
  * @example
98
118
  * const tabs = [
99
119
  * <Tab label='Label 1' sublabel='First tab' />,
100
120
  * <Tab label='Label 2' sublabel='Active tab' />,
101
- * <Tab label='Label 3' sublabel='Disabled tab' disabled icon={<SvgPlaceholder />} />,
121
+ * <Tab label='Label 3' sublabel='Disabled tab' disabled icon={<SvgPlaceholder />} />,
102
122
  * ];
103
123
  * <VerticalTabs labels={tabs} activeIndex={1}>Tabpanel content</VerticalTabs>
104
124
  */
@@ -26,7 +26,7 @@ var __rest = (this && this.__rest) || function (s, e) {
26
26
  *--------------------------------------------------------------------------------------------*/
27
27
  import cx from 'classnames';
28
28
  import React from 'react';
29
- import { useTheme, useMergedRefs, getBoundedValue, getWindow, useContainerWidth, } from '../utils';
29
+ import { useTheme, useMergedRefs, getBoundedValue, useContainerWidth, } from '../utils';
30
30
  import '@itwin/itwinui-css/css/tabs.css';
31
31
  import { Tab } from './Tab';
32
32
  /**
@@ -40,6 +40,9 @@ import { Tab } from './Tab';
40
40
  * <Tabs labels={tabs} />
41
41
  *
42
42
  * @example
43
+ * <Tabs orientation='vertical' labels={tabs} />
44
+ *
45
+ * @example
43
46
  * const tabsWithSublabels = [
44
47
  * <Tab label='Label 1' sublabel='First tab' />,
45
48
  * <Tab label='Label 2' sublabel='Active tab' />,
@@ -54,24 +57,23 @@ import { Tab } from './Tab';
54
57
  * <Tabs labels={tabsWithIcons} type='pill' />
55
58
  */
56
59
  export var Tabs = function (props) {
57
- var _a, _b, _c;
58
- var labels = props.labels, activeIndex = props.activeIndex, onTabSelected = props.onTabSelected, _d = props.focusActivationMode, focusActivationMode = _d === void 0 ? 'auto' : _d, _e = props.type, type = _e === void 0 ? 'default' : _e, _f = props.color, color = _f === void 0 ? 'blue' : _f, _g = props.orientation, orientation = _g === void 0 ? 'horizontal' : _g, 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"]);
60
+ 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"]);
59
61
  useTheme();
60
62
  var tablistRef = React.useRef(null);
61
- var _h = useContainerWidth(type !== 'default'), tablistSizeRef = _h[0], tabsWidth = _h[1];
63
+ var _e = useContainerWidth(type !== 'default'), tablistSizeRef = _e[0], tabsWidth = _e[1];
62
64
  var refs = useMergedRefs(tablistRef, tablistSizeRef);
63
- var _j = React.useState(function () {
65
+ var _f = React.useState(function () {
64
66
  return activeIndex != null
65
67
  ? getBoundedValue(activeIndex, 0, labels.length - 1)
66
68
  : 0;
67
- }), currentActiveIndex = _j[0], setCurrentActiveIndex = _j[1];
69
+ }), currentActiveIndex = _f[0], setCurrentActiveIndex = _f[1];
68
70
  React.useLayoutEffect(function () {
69
71
  if (activeIndex != null && currentActiveIndex !== activeIndex) {
70
72
  setCurrentActiveIndex(getBoundedValue(activeIndex, 0, labels.length - 1));
71
73
  }
72
74
  }, [activeIndex, currentActiveIndex, labels.length]);
73
75
  // CSS custom properties to place the active stripe
74
- var _k = React.useState({}), stripeProperties = _k[0], setStripeProperties = _k[1];
76
+ var _g = React.useState({}), stripeProperties = _g[0], setStripeProperties = _g[1];
75
77
  React.useLayoutEffect(function () {
76
78
  if (type !== 'default' && tablistRef.current != undefined) {
77
79
  var activeTab = tablistRef.current.children[currentActiveIndex];
@@ -85,14 +87,14 @@ export var Tabs = function (props) {
85
87
  })));
86
88
  }
87
89
  }, [currentActiveIndex, type, orientation, tabsWidth]);
88
- var _l = React.useState(), focusedIndex = _l[0], setFocusedIndex = _l[1];
90
+ var _h = React.useState(), focusedIndex = _h[0], setFocusedIndex = _h[1];
89
91
  React.useEffect(function () {
90
92
  if (tablistRef.current && focusedIndex !== undefined) {
91
93
  var tab = tablistRef.current.querySelectorAll('.iui-tab')[focusedIndex];
92
94
  tab === null || tab === void 0 ? void 0 : tab.focus();
93
95
  }
94
96
  }, [focusedIndex]);
95
- var _m = React.useState(false), hasSublabel = _m[0], setHasSublabel = _m[1]; // used for setting size
97
+ var _j = React.useState(false), hasSublabel = _j[0], setHasSublabel = _j[1]; // used for setting size
96
98
  React.useLayoutEffect(function () {
97
99
  var _a;
98
100
  setHasSublabel(type !== 'pill' && // pill tabs should never have sublabels
@@ -165,12 +167,10 @@ export var Tabs = function (props) {
165
167
  break;
166
168
  }
167
169
  };
168
- var isIE = !((_c = (_b = (_a = getWindow()) === null || _a === void 0 ? void 0 : _a.CSS) === null || _b === void 0 ? void 0 : _b.supports) === null || _c === void 0 ? void 0 : _c.call(_b, '--stripe-width', '100px'));
169
170
  return (React.createElement("div", { className: cx('iui-tabs-wrapper', "iui-".concat(orientation), wrapperClassName), style: stripeProperties },
170
171
  React.createElement("ul", __assign({ className: cx('iui-tabs', "iui-".concat(type), {
171
172
  'iui-green': color === 'green',
172
- 'iui-animated': type !== 'default' && !isIE,
173
- 'iui-not-animated': isIE,
173
+ 'iui-animated': type !== 'default',
174
174
  'iui-large': hasSublabel,
175
175
  }, tabsClassName), role: 'tablist', ref: refs, onKeyDown: onKeyDown }, rest), labels.map(function (label, index) {
176
176
  var onClick = function () {
@@ -195,6 +195,8 @@ export var Tabs = function (props) {
195
195
  children && (React.createElement("div", { className: cx('iui-tabs-content', contentClassName), role: 'tabpanel' }, children))));
196
196
  };
197
197
  /**
198
+ * @deprecated Since v2, directly use `Tabs` with `orientation: 'horizontal'`
199
+ *
198
200
  * Tabs organize and allow navigation between groups of content that are related and at the same level of hierarchy.
199
201
  * @example
200
202
  * const tabs = [
@@ -206,12 +208,14 @@ export var Tabs = function (props) {
206
208
  */
207
209
  export var HorizontalTabs = function (props) { return (React.createElement(Tabs, __assign({ orientation: 'horizontal' }, props))); };
208
210
  /**
211
+ * @deprecated Since v2, directly use `Tabs` with `orientation: 'vertical'`
212
+ *
209
213
  * Tabs organize and allow navigation between groups of content that are related and at the same level of hierarchy.
210
214
  * @example
211
215
  * const tabs = [
212
216
  * <Tab label='Label 1' sublabel='First tab' />,
213
217
  * <Tab label='Label 2' sublabel='Active tab' />,
214
- * <Tab label='Label 3' sublabel='Disabled tab' disabled icon={<SvgPlaceholder />} />,
218
+ * <Tab label='Label 3' sublabel='Disabled tab' disabled icon={<SvgPlaceholder />} />,
215
219
  * ];
216
220
  * <VerticalTabs labels={tabs} activeIndex={1}>Tabpanel content</VerticalTabs>
217
221
  */
@@ -1,4 +1,4 @@
1
- export { VerticalTabs, HorizontalTabs } from './Tabs';
2
- export type { VerticalTabsProps, HorizontalTabsProps } from './Tabs';
3
- export { Tab, HorizontalTab } from './Tab';
4
- export type { TabProps, HorizontalTabProps } from './Tab';
1
+ export { Tabs, VerticalTabs, HorizontalTabs } from './Tabs';
2
+ export type { TabsProps, VerticalTabsProps, HorizontalTabsProps } from './Tabs';
3
+ export { Tab } from './Tab';
4
+ export type { TabProps } from './Tab';
@@ -2,5 +2,5 @@
2
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
- export { VerticalTabs, HorizontalTabs } from './Tabs';
6
- export { Tab, HorizontalTab } from './Tab';
5
+ export { Tabs, VerticalTabs, HorizontalTabs } from './Tabs';
6
+ export { Tab } from './Tab';
@@ -26,8 +26,7 @@ var __rest = (this && this.__rest) || function (s, e) {
26
26
  *--------------------------------------------------------------------------------------------*/
27
27
  import cx from 'classnames';
28
28
  import React from 'react';
29
- import SvgCloseSmall from '@itwin/itwinui-icons-react/cjs/icons/CloseSmall';
30
- import { useTheme } from '../utils';
29
+ import { useTheme, SvgCloseSmall } from '../utils';
31
30
  import '@itwin/itwinui-css/css/tag.css';
32
31
  import { IconButton } from '../Buttons';
33
32
  /**
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import '@itwin/itwinui-css/css/inputs.css';
2
+ import '@itwin/itwinui-css/css/input.css';
3
3
  export declare type TextareaProps = {
4
4
  /**
5
5
  * Set focus on textarea element.
@@ -27,7 +27,7 @@ var __rest = (this && this.__rest) || function (s, e) {
27
27
  import cx from 'classnames';
28
28
  import React from 'react';
29
29
  import { useMergedRefs, useTheme } from '../utils';
30
- import '@itwin/itwinui-css/css/inputs.css';
30
+ import '@itwin/itwinui-css/css/input.css';
31
31
  /**
32
32
  * Basic textarea component
33
33
  * @example
@@ -44,6 +44,6 @@ export var Textarea = React.forwardRef(function (props, ref) {
44
44
  textAreaRef.current.focus();
45
45
  }
46
46
  }, [setFocus]);
47
- return (React.createElement("textarea", __assign({ className: cx('iui-textarea', className), rows: rows, ref: refs }, rest)));
47
+ return (React.createElement("textarea", __assign({ className: cx('iui-input', className), rows: rows, ref: refs }, rest)));
48
48
  });
49
49
  export default Textarea;
@@ -1,21 +1,31 @@
1
1
  import React from 'react';
2
- import { ThemeOptions, ThemeType } from '../utils';
3
- export declare type ThemeProviderProps = {
4
- /**
5
- * Theme to be applied. If not set, light theme will be used.
6
- */
7
- theme?: ThemeType;
8
- /**
9
- * Optional children.
10
- */
11
- children?: React.ReactNode;
12
- /**
13
- * Options that can be specified to override default theming behavior.
14
- */
15
- themeOptions?: ThemeOptions;
16
- };
2
+ import type { PolymorphicComponentProps, PolymorphicForwardRefComponent, ThemeOptions, ThemeType, UseThemeProps } from '../utils';
3
+ import '@itwin/itwinui-css/css/global.css';
4
+ import '@itwin/itwinui-variables/index.css';
5
+ export declare type ThemeProviderProps<T extends React.ElementType = 'div'> = PolymorphicComponentProps<T, UseThemeProps>;
17
6
  /**
18
- * Component providing global styles that are required for all components and allows changing theme.
7
+ * This component provides global styles and applies theme to the entire tree
8
+ * that it is wrapping around. The `theme` prop is optional and defaults to the
9
+ * light theme.
10
+ *
11
+ * If you want to theme the entire app, you should use this component at the root.
12
+ * The `as` prop can be used to render a `<body>` element instead of a `<div>`.
13
+ *
14
+ * You can also use this component to apply a different theme to only a part of the tree.
15
+ *
16
+ * @example
17
+ * <ThemeProvider theme='os'>
18
+ * <App />
19
+ * </ThemeProvider>
20
+ *
21
+ * @example
22
+ * <ThemeProvider as='body'>
23
+ * <App />
24
+ * </ThemeProvider>
19
25
  */
20
- export declare const ThemeProvider: (props: ThemeProviderProps) => JSX.Element;
26
+ export declare const ThemeProvider: PolymorphicForwardRefComponent<"div", UseThemeProps>;
21
27
  export default ThemeProvider;
28
+ export declare const ThemeContext: React.Context<{
29
+ theme?: ThemeType | undefined;
30
+ themeOptions?: ThemeOptions | undefined;
31
+ } | undefined>;
@@ -1,15 +1,73 @@
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
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
1
23
  /*---------------------------------------------------------------------------------------------
2
24
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
25
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
26
  *--------------------------------------------------------------------------------------------*/
5
27
  import React from 'react';
6
- import { useTheme } from '../utils';
28
+ import cx from 'classnames';
29
+ import { useTheme, useMediaQuery } from '../utils';
30
+ import '@itwin/itwinui-css/css/global.css';
31
+ import '@itwin/itwinui-variables/index.css';
7
32
  /**
8
- * Component providing global styles that are required for all components and allows changing theme.
33
+ * This component provides global styles and applies theme to the entire tree
34
+ * that it is wrapping around. The `theme` prop is optional and defaults to the
35
+ * light theme.
36
+ *
37
+ * If you want to theme the entire app, you should use this component at the root.
38
+ * The `as` prop can be used to render a `<body>` element instead of a `<div>`.
39
+ *
40
+ * You can also use this component to apply a different theme to only a part of the tree.
41
+ *
42
+ * @example
43
+ * <ThemeProvider theme='os'>
44
+ * <App />
45
+ * </ThemeProvider>
46
+ *
47
+ * @example
48
+ * <ThemeProvider as='body'>
49
+ * <App />
50
+ * </ThemeProvider>
9
51
  */
10
- export var ThemeProvider = function (props) {
11
- var theme = props.theme, children = props.children, themeOptions = props.themeOptions;
52
+ export var ThemeProvider = React.forwardRef(function (props, ref) {
53
+ var _a;
54
+ var theme = props.theme, children = props.children, themeOptions = props.themeOptions, _b = props.as, Element = _b === void 0 ? 'div' : _b, className = props.className, rest = __rest(props, ["theme", "children", "themeOptions", "as", "className"]);
55
+ var hasChildren = React.Children.count(children) > 0;
56
+ var parentContext = React.useContext(ThemeContext);
57
+ var prefersDark = useMediaQuery('(prefers-color-scheme: dark)');
58
+ var prefersHighContrast = useMediaQuery('(prefers-contrast: more)');
59
+ var shouldApplyDark = theme === 'dark' || (theme === 'os' && prefersDark);
60
+ var shouldApplyHC = (_a = themeOptions === null || themeOptions === void 0 ? void 0 : themeOptions.highContrast) !== null && _a !== void 0 ? _a : prefersHighContrast;
61
+ // only provide context if wrapped around children
62
+ return hasChildren ? (React.createElement(ThemeContext.Provider, { value: { theme: theme, themeOptions: themeOptions } },
63
+ React.createElement(Element, __assign({ className: cx('iui-root', className), "data-iui-theme": shouldApplyDark ? 'dark' : 'light', "data-iui-contrast": shouldApplyHC ? 'high' : 'default', ref: ref }, rest), children))) : (
64
+ // otherwise just apply theme on the root using this wrapper component
65
+ React.createElement(ThemeLogicWrapper, { theme: theme !== null && theme !== void 0 ? theme : parentContext === null || parentContext === void 0 ? void 0 : parentContext.theme, themeOptions: themeOptions !== null && themeOptions !== void 0 ? themeOptions : parentContext === null || parentContext === void 0 ? void 0 : parentContext.themeOptions }));
66
+ });
67
+ export default ThemeProvider;
68
+ export var ThemeContext = React.createContext(undefined);
69
+ var ThemeLogicWrapper = function (_a) {
70
+ var theme = _a.theme, themeOptions = _a.themeOptions;
12
71
  useTheme(theme, themeOptions);
13
- return React.createElement(React.Fragment, null, children);
72
+ return React.createElement(React.Fragment, null);
14
73
  };
15
- export default ThemeProvider;