@itwin/itwinui-react 3.0.0-dev.8 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (677) hide show
  1. package/CHANGELOG.md +79 -762
  2. package/README.md +3 -5
  3. package/cjs/core/Alert/Alert.d.ts +1 -1
  4. package/cjs/core/Alert/Alert.js +4 -3
  5. package/cjs/core/Avatar/Avatar.js +2 -1
  6. package/cjs/core/Breadcrumbs/Breadcrumbs.js +23 -6
  7. package/cjs/core/ButtonGroup/ButtonGroup.js +6 -8
  8. package/cjs/core/Buttons/{Button/Button.d.ts → Button.d.ts} +2 -2
  9. package/cjs/core/Buttons/{Button/Button.js → Button.js} +1 -1
  10. package/{esm/core/Buttons/DropdownButton → cjs/core/Buttons}/DropdownButton.d.ts +3 -3
  11. package/cjs/core/Buttons/{DropdownButton/DropdownButton.js → DropdownButton.js} +14 -26
  12. package/{esm/core/Buttons/IconButton → cjs/core/Buttons}/IconButton.d.ts +2 -2
  13. package/cjs/core/Buttons/{IconButton/IconButton.js → IconButton.js} +6 -3
  14. package/{esm/core/Buttons/IdeasButton → cjs/core/Buttons}/IdeasButton.d.ts +1 -1
  15. package/cjs/core/Buttons/{IdeasButton/IdeasButton.js → IdeasButton.js} +3 -3
  16. package/{esm/core/Buttons/SplitButton → cjs/core/Buttons}/SplitButton.d.ts +6 -6
  17. package/cjs/core/Buttons/{SplitButton/SplitButton.js → SplitButton.js} +57 -34
  18. package/cjs/core/Carousel/Carousel.d.ts +14 -7
  19. package/cjs/core/Carousel/Carousel.js +9 -39
  20. package/cjs/core/Carousel/CarouselContext.d.ts +0 -4
  21. package/cjs/core/Carousel/CarouselDot.js +1 -1
  22. package/cjs/core/Carousel/CarouselDotsList.js +26 -2
  23. package/cjs/core/Carousel/CarouselNavigation.d.ts +3 -3
  24. package/cjs/core/Carousel/CarouselNavigation.js +13 -26
  25. package/cjs/core/Carousel/CarouselSlide.d.ts +1 -1
  26. package/cjs/core/Carousel/CarouselSlide.js +12 -2
  27. package/cjs/core/Carousel/CarouselSlider.d.ts +1 -1
  28. package/cjs/core/Carousel/CarouselSlider.js +2 -2
  29. package/cjs/core/Checkbox/Checkbox.js +7 -7
  30. package/cjs/core/ColorPicker/ColorBuilder.js +5 -3
  31. package/cjs/core/ColorPicker/ColorInputPanel.js +50 -30
  32. package/cjs/core/ColorPicker/ColorPalette.js +2 -80
  33. package/cjs/core/ColorPicker/ColorPicker.d.ts +9 -0
  34. package/cjs/core/ColorPicker/ColorPicker.js +6 -1
  35. package/cjs/core/ColorPicker/ColorSwatch.d.ts +1 -1
  36. package/cjs/core/ColorPicker/ColorSwatch.js +25 -15
  37. package/cjs/core/ComboBox/ComboBox.d.ts +8 -3
  38. package/cjs/core/ComboBox/ComboBox.js +48 -39
  39. package/cjs/core/ComboBox/ComboBoxEndIcon.js +2 -1
  40. package/cjs/core/ComboBox/ComboBoxInput.d.ts +1 -1
  41. package/cjs/core/ComboBox/ComboBoxInput.js +37 -29
  42. package/cjs/core/ComboBox/ComboBoxInputContainer.js +6 -6
  43. package/cjs/core/ComboBox/ComboBoxMenu.d.ts +1 -1
  44. package/cjs/core/ComboBox/ComboBoxMenu.js +74 -96
  45. package/cjs/core/ComboBox/helpers.d.ts +4 -1
  46. package/cjs/core/DatePicker/DatePicker.d.ts +9 -0
  47. package/cjs/core/DatePicker/DatePicker.js +13 -8
  48. package/cjs/core/Dialog/DialogBackdrop.js +4 -4
  49. package/cjs/core/Dialog/DialogTitleBar.js +2 -2
  50. package/cjs/core/{utils/components → Divider}/Divider.d.ts +1 -1
  51. package/cjs/core/{utils/components → Divider}/Divider.js +1 -1
  52. package/cjs/core/DropdownMenu/DropdownMenu.d.ts +6 -5
  53. package/cjs/core/DropdownMenu/DropdownMenu.js +61 -56
  54. package/cjs/core/ExpandableBlock/ExpandableBlock.d.ts +1 -1
  55. package/cjs/core/ExpandableBlock/ExpandableBlock.js +3 -2
  56. package/cjs/core/FileUpload/FileUploadCard.js +3 -2
  57. package/cjs/core/FileUpload/FileUploadTemplate.js +1 -1
  58. package/cjs/core/{utils/components → Flex}/Flex.d.ts +2 -2
  59. package/cjs/core/{utils/components → Flex}/Flex.js +1 -1
  60. package/cjs/core/Header/Header.js +11 -11
  61. package/cjs/core/Header/HeaderBasicButton.d.ts +1 -1
  62. package/cjs/core/Header/HeaderButton.d.ts +2 -2
  63. package/cjs/core/Header/HeaderDropdownButton.d.ts +1 -1
  64. package/cjs/core/Header/HeaderDropdownButton.js +7 -8
  65. package/cjs/core/Header/HeaderSplitButton.d.ts +1 -1
  66. package/cjs/core/Header/HeaderSplitButton.js +8 -9
  67. package/cjs/core/{utils/components → Icon}/Icon.d.ts +2 -2
  68. package/cjs/core/{utils/components → Icon}/Icon.js +1 -1
  69. package/cjs/core/InformationPanel/InformationPanelHeader.js +7 -7
  70. package/cjs/core/Input/Input.d.ts +0 -1
  71. package/cjs/core/Input/Input.js +0 -1
  72. package/cjs/core/InputGroup/InputGroup.d.ts +1 -1
  73. package/cjs/core/InputGroup/InputGroup.js +6 -6
  74. package/cjs/core/InputWithDecorations/InputWithDecorations.d.ts +1 -1
  75. package/cjs/core/InputWithDecorations/InputWithDecorations.js +2 -2
  76. package/cjs/core/LabeledInput/LabeledInput.d.ts +4 -4
  77. package/cjs/core/LabeledInput/LabeledInput.js +11 -13
  78. package/cjs/core/LabeledSelect/LabeledSelect.d.ts +2 -2
  79. package/cjs/core/LabeledSelect/LabeledSelect.js +10 -9
  80. package/cjs/core/LabeledTextarea/LabeledTextarea.d.ts +1 -1
  81. package/cjs/core/LabeledTextarea/LabeledTextarea.js +2 -2
  82. package/{esm/core/utils/components → cjs/core/LinkAction}/LinkAction.d.ts +2 -2
  83. package/cjs/core/{utils/components → LinkAction}/LinkAction.js +1 -1
  84. package/cjs/core/Menu/Menu.js +1 -1
  85. package/cjs/core/Menu/MenuItem.js +78 -55
  86. package/cjs/core/Menu/MenuItemSkeleton.js +2 -1
  87. package/cjs/core/Modal/Modal.js +5 -5
  88. package/cjs/core/NonIdealState/ErrorPage.js +17 -15
  89. package/cjs/core/Popover/Popover.d.ts +141 -0
  90. package/cjs/core/Popover/Popover.js +188 -0
  91. package/cjs/core/RadioTiles/RadioTileGroup.d.ts +1 -1
  92. package/cjs/core/RadioTiles/RadioTileGroup.js +4 -4
  93. package/cjs/core/SearchBox/SearchBox.d.ts +3 -2
  94. package/cjs/core/SearchBox/SearchBox.js +4 -3
  95. package/cjs/core/Select/Select.d.ts +6 -6
  96. package/cjs/core/Select/Select.js +95 -111
  97. package/cjs/core/Select/SelectTagContainer.js +2 -2
  98. package/cjs/core/SideNavigation/SideNavigation.js +5 -5
  99. package/cjs/core/SideNavigation/SidenavButton.d.ts +1 -1
  100. package/cjs/core/SideNavigation/SidenavButton.js +2 -2
  101. package/cjs/core/Slider/Slider.d.ts +3 -7
  102. package/cjs/core/Slider/Slider.js +8 -22
  103. package/cjs/core/Slider/Thumb.d.ts +2 -3
  104. package/cjs/core/Slider/Thumb.js +5 -9
  105. package/cjs/core/StatusMessage/StatusMessage.d.ts +1 -1
  106. package/cjs/core/StatusMessage/StatusMessage.js +2 -1
  107. package/cjs/core/Stepper/StepperStep.js +7 -7
  108. package/cjs/core/Stepper/WorkflowDiagramStep.js +5 -5
  109. package/cjs/core/Surface/Surface.d.ts +8 -0
  110. package/cjs/core/Surface/Surface.js +19 -1
  111. package/cjs/core/Table/SubRowExpander.d.ts +1 -1
  112. package/cjs/core/Table/SubRowExpander.js +2 -2
  113. package/cjs/core/Table/Table.d.ts +1 -1
  114. package/cjs/core/Table/Table.js +53 -60
  115. package/cjs/core/Table/TableCell.d.ts +1 -1
  116. package/cjs/core/Table/TablePaginator.js +27 -25
  117. package/cjs/core/Table/TableRowMemoized.d.ts +1 -1
  118. package/cjs/core/Table/actionHandlers/expandHandler.d.ts +1 -1
  119. package/cjs/core/Table/actionHandlers/filterHandler.d.ts +1 -1
  120. package/cjs/core/Table/actionHandlers/resizeHandler.d.ts +17 -17
  121. package/cjs/core/Table/actionHandlers/selectHandler.d.ts +8 -8
  122. package/cjs/core/Table/cells/DefaultCell.d.ts +1 -1
  123. package/cjs/core/Table/cells/EditableCell.d.ts +1 -1
  124. package/cjs/core/Table/columns/actionColumn.d.ts +2 -2
  125. package/cjs/core/Table/columns/actionColumn.js +13 -22
  126. package/cjs/core/Table/columns/expanderColumn.d.ts +1 -1
  127. package/cjs/core/Table/columns/expanderColumn.js +5 -4
  128. package/cjs/core/Table/columns/selectionColumn.d.ts +1 -1
  129. package/cjs/core/Table/columns/selectionColumn.js +5 -5
  130. package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.d.ts +1 -1
  131. package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.js +41 -40
  132. package/cjs/core/Table/filters/FilterButtonBar.js +3 -3
  133. package/cjs/core/Table/filters/FilterToggle.d.ts +1 -1
  134. package/cjs/core/Table/filters/FilterToggle.js +8 -5
  135. package/cjs/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +3 -3
  136. package/cjs/core/Table/filters/TextFilter/TextFilter.js +2 -2
  137. package/cjs/core/Table/filters/customFilterFunctions.d.ts +1 -1
  138. package/cjs/core/Table/filters/defaultFilterFunctions.d.ts +1 -1
  139. package/cjs/core/Table/filters/types.d.ts +2 -19
  140. package/cjs/core/Table/hooks/useColumnDragAndDrop.d.ts +1 -1
  141. package/cjs/core/Table/hooks/useExpanderCell.d.ts +1 -1
  142. package/cjs/core/Table/hooks/useResizeColumns.d.ts +1 -1
  143. package/cjs/core/Table/hooks/useScrollToRow.d.ts +1 -1
  144. package/cjs/core/Table/hooks/useScrollToRow.js +1 -1
  145. package/cjs/core/Table/hooks/useSelectionCell.d.ts +1 -1
  146. package/cjs/core/Table/hooks/useStickyColumns.d.ts +1 -1
  147. package/cjs/core/Table/hooks/useSubRowFiltering.d.ts +1 -1
  148. package/cjs/core/Table/hooks/useSubRowSelection.d.ts +1 -1
  149. package/cjs/core/Table/index.d.ts +1 -1
  150. package/cjs/core/Table/utils.d.ts +1 -1
  151. package/cjs/core/Tabs/Tabs.d.ts +222 -52
  152. package/cjs/core/Tabs/Tabs.js +429 -375
  153. package/cjs/core/Tag/Tag.js +2 -2
  154. package/cjs/core/Textarea/Textarea.js +2 -2
  155. package/cjs/core/ThemeProvider/ThemeProvider.d.ts +3 -2
  156. package/cjs/core/ThemeProvider/ThemeProvider.js +17 -8
  157. package/cjs/core/Tile/Tile.d.ts +2 -2
  158. package/cjs/core/Tile/Tile.js +40 -39
  159. package/cjs/core/Toast/Toast.js +2 -2
  160. package/cjs/core/TransferList/TransferList.d.ts +1 -1
  161. package/cjs/core/TransferList/TransferList.js +6 -5
  162. package/cjs/core/Tree/TreeNodeExpander.d.ts +1 -1
  163. package/cjs/core/Tree/TreeNodeExpander.js +2 -2
  164. package/{esm/core/Typography/Anchor → cjs/core/Typography}/Anchor.d.ts +1 -1
  165. package/cjs/core/Typography/{Anchor/Anchor.js → Anchor.js} +1 -1
  166. package/{esm/core/Typography/Blockquote → cjs/core/Typography}/Blockquote.d.ts +1 -1
  167. package/cjs/core/Typography/{Blockquote/Blockquote.js → Blockquote.js} +1 -1
  168. package/cjs/core/Typography/{Code/Code.d.ts → Code.d.ts} +1 -1
  169. package/cjs/core/Typography/{Code/Code.js → Code.js} +1 -1
  170. package/{esm/core/Typography/Kbd → cjs/core/Typography}/Kbd.d.ts +1 -1
  171. package/cjs/core/Typography/{Kbd/Kbd.js → Kbd.js} +1 -1
  172. package/{esm/core/Typography/Text → cjs/core/Typography}/Text.d.ts +1 -1
  173. package/cjs/core/Typography/{Text/Text.js → Text.js} +1 -1
  174. package/{esm/core/utils/components → cjs/core/VisuallyHidden}/VisuallyHidden.d.ts +1 -1
  175. package/cjs/core/{utils/components → VisuallyHidden}/VisuallyHidden.js +1 -1
  176. package/cjs/core/utils/components/AutoclearingHiddenLiveRegion.js +1 -1
  177. package/cjs/core/utils/components/InputContainer.d.ts +4 -4
  178. package/cjs/core/utils/components/InputContainer.js +11 -7
  179. package/cjs/core/utils/components/WithCSSTransition.js +7 -1
  180. package/cjs/core/utils/components/index.d.ts +0 -6
  181. package/cjs/core/utils/components/index.js +0 -6
  182. package/cjs/core/utils/functions/dev.d.ts +11 -0
  183. package/cjs/core/utils/functions/dev.js +34 -0
  184. package/cjs/core/utils/functions/index.d.ts +1 -0
  185. package/cjs/core/utils/functions/index.js +1 -0
  186. package/cjs/core/utils/hooks/useGlobals.d.ts +1 -1
  187. package/cjs/core/utils/hooks/useGlobals.js +3 -7
  188. package/cjs/core/utils/hooks/useOverflow.js +3 -1
  189. package/cjs/index.d.ts +112 -2
  190. package/cjs/index.js +950 -5
  191. package/cjs/react-table/react-table.d.ts +745 -0
  192. package/cjs/{core/Badge/index.js → react-table/react-table.js} +5 -10
  193. package/cjs/styles.js +15 -18
  194. package/esm/core/Alert/Alert.d.ts +1 -1
  195. package/esm/core/Alert/Alert.js +2 -2
  196. package/esm/core/Avatar/Avatar.js +2 -6
  197. package/esm/core/Breadcrumbs/Breadcrumbs.js +24 -6
  198. package/esm/core/ButtonGroup/ButtonGroup.js +6 -8
  199. package/esm/core/Buttons/{Button/Button.d.ts → Button.d.ts} +2 -2
  200. package/esm/core/Buttons/{Button/Button.js → Button.js} +1 -1
  201. package/{cjs/core/Buttons/DropdownButton → esm/core/Buttons}/DropdownButton.d.ts +3 -3
  202. package/esm/core/Buttons/{DropdownButton/DropdownButton.js → DropdownButton.js} +10 -26
  203. package/{cjs/core/Buttons/IconButton → esm/core/Buttons}/IconButton.d.ts +2 -2
  204. package/esm/core/Buttons/{IconButton/IconButton.js → IconButton.js} +3 -2
  205. package/{cjs/core/Buttons/IdeasButton → esm/core/Buttons}/IdeasButton.d.ts +1 -1
  206. package/esm/core/Buttons/{IdeasButton/IdeasButton.js → IdeasButton.js} +2 -2
  207. package/{cjs/core/Buttons/SplitButton → esm/core/Buttons}/SplitButton.d.ts +6 -6
  208. package/esm/core/Buttons/{SplitButton/SplitButton.js → SplitButton.js} +56 -31
  209. package/esm/core/Carousel/Carousel.d.ts +14 -7
  210. package/esm/core/Carousel/Carousel.js +9 -39
  211. package/esm/core/Carousel/CarouselContext.d.ts +0 -4
  212. package/esm/core/Carousel/CarouselDot.js +1 -1
  213. package/esm/core/Carousel/CarouselDotsList.js +26 -2
  214. package/esm/core/Carousel/CarouselNavigation.d.ts +3 -3
  215. package/esm/core/Carousel/CarouselNavigation.js +6 -23
  216. package/esm/core/Carousel/CarouselSlide.d.ts +1 -1
  217. package/esm/core/Carousel/CarouselSlide.js +15 -3
  218. package/esm/core/Carousel/CarouselSlider.d.ts +1 -1
  219. package/esm/core/Carousel/CarouselSlider.js +2 -2
  220. package/esm/core/Checkbox/Checkbox.js +1 -1
  221. package/esm/core/ColorPicker/ColorBuilder.js +3 -1
  222. package/esm/core/ColorPicker/ColorInputPanel.js +27 -7
  223. package/esm/core/ColorPicker/ColorPalette.js +3 -83
  224. package/esm/core/ColorPicker/ColorPicker.d.ts +9 -0
  225. package/esm/core/ColorPicker/ColorPicker.js +6 -1
  226. package/esm/core/ColorPicker/ColorSwatch.d.ts +1 -1
  227. package/esm/core/ColorPicker/ColorSwatch.js +18 -12
  228. package/esm/core/ComboBox/ComboBox.d.ts +8 -3
  229. package/esm/core/ComboBox/ComboBox.js +38 -27
  230. package/esm/core/ComboBox/ComboBoxEndIcon.js +2 -1
  231. package/esm/core/ComboBox/ComboBoxInput.d.ts +1 -1
  232. package/esm/core/ComboBox/ComboBoxInput.js +23 -22
  233. package/esm/core/ComboBox/ComboBoxInputContainer.js +1 -1
  234. package/esm/core/ComboBox/ComboBoxMenu.d.ts +1 -1
  235. package/esm/core/ComboBox/ComboBoxMenu.js +68 -90
  236. package/esm/core/ComboBox/helpers.d.ts +4 -1
  237. package/esm/core/DatePicker/DatePicker.d.ts +9 -0
  238. package/esm/core/DatePicker/DatePicker.js +12 -3
  239. package/esm/core/Dialog/DialogBackdrop.js +1 -1
  240. package/esm/core/Dialog/DialogTitleBar.js +1 -1
  241. package/esm/core/{utils/components → Divider}/Divider.d.ts +1 -1
  242. package/esm/core/{utils/components → Divider}/Divider.js +1 -1
  243. package/esm/core/DropdownMenu/DropdownMenu.d.ts +6 -5
  244. package/esm/core/DropdownMenu/DropdownMenu.js +64 -57
  245. package/esm/core/ExpandableBlock/ExpandableBlock.d.ts +1 -1
  246. package/esm/core/ExpandableBlock/ExpandableBlock.js +1 -1
  247. package/esm/core/FileUpload/FileUploadCard.js +2 -2
  248. package/esm/core/FileUpload/FileUploadTemplate.js +1 -1
  249. package/esm/core/{utils/components → Flex}/Flex.d.ts +2 -2
  250. package/esm/core/{utils/components → Flex}/Flex.js +1 -1
  251. package/esm/core/Header/Header.js +2 -2
  252. package/esm/core/Header/HeaderBasicButton.d.ts +1 -1
  253. package/esm/core/Header/HeaderButton.d.ts +2 -2
  254. package/esm/core/Header/HeaderDropdownButton.d.ts +1 -1
  255. package/esm/core/Header/HeaderDropdownButton.js +2 -3
  256. package/esm/core/Header/HeaderSplitButton.d.ts +1 -1
  257. package/esm/core/Header/HeaderSplitButton.js +2 -3
  258. package/esm/core/{utils/components → Icon}/Icon.d.ts +2 -2
  259. package/esm/core/{utils/components → Icon}/Icon.js +1 -1
  260. package/esm/core/InformationPanel/InformationPanelHeader.js +1 -1
  261. package/esm/core/Input/Input.d.ts +0 -1
  262. package/esm/core/Input/Input.js +0 -1
  263. package/esm/core/InputGroup/InputGroup.d.ts +1 -1
  264. package/esm/core/InputGroup/InputGroup.js +3 -3
  265. package/esm/core/InputWithDecorations/InputWithDecorations.d.ts +1 -1
  266. package/esm/core/InputWithDecorations/InputWithDecorations.js +1 -1
  267. package/esm/core/LabeledInput/LabeledInput.d.ts +4 -4
  268. package/esm/core/LabeledInput/LabeledInput.js +5 -4
  269. package/esm/core/LabeledSelect/LabeledSelect.d.ts +2 -2
  270. package/esm/core/LabeledSelect/LabeledSelect.js +6 -4
  271. package/esm/core/LabeledTextarea/LabeledTextarea.d.ts +1 -1
  272. package/esm/core/LabeledTextarea/LabeledTextarea.js +2 -2
  273. package/{cjs/core/utils/components → esm/core/LinkAction}/LinkAction.d.ts +2 -2
  274. package/esm/core/{utils/components → LinkAction}/LinkAction.js +1 -1
  275. package/esm/core/Menu/Menu.js +7 -2
  276. package/esm/core/Menu/MenuItem.js +84 -52
  277. package/esm/core/Menu/MenuItemSkeleton.js +2 -1
  278. package/esm/core/Modal/Modal.js +1 -1
  279. package/esm/core/NonIdealState/ErrorPage.js +2 -2
  280. package/esm/core/Popover/Popover.d.ts +141 -0
  281. package/esm/core/Popover/Popover.js +205 -0
  282. package/esm/core/RadioTiles/RadioTileGroup.d.ts +1 -1
  283. package/esm/core/RadioTiles/RadioTileGroup.js +1 -1
  284. package/esm/core/SearchBox/SearchBox.d.ts +3 -2
  285. package/esm/core/SearchBox/SearchBox.js +2 -2
  286. package/esm/core/Select/Select.d.ts +6 -6
  287. package/esm/core/Select/Select.js +81 -96
  288. package/esm/core/Select/SelectTagContainer.js +1 -1
  289. package/esm/core/SideNavigation/SideNavigation.js +2 -2
  290. package/esm/core/SideNavigation/SidenavButton.d.ts +1 -1
  291. package/esm/core/SideNavigation/SidenavButton.js +1 -1
  292. package/esm/core/Slider/Slider.d.ts +3 -7
  293. package/esm/core/Slider/Slider.js +8 -19
  294. package/esm/core/Slider/Thumb.d.ts +2 -3
  295. package/esm/core/Slider/Thumb.js +2 -6
  296. package/esm/core/StatusMessage/StatusMessage.d.ts +1 -1
  297. package/esm/core/StatusMessage/StatusMessage.js +2 -1
  298. package/esm/core/Stepper/StepperStep.js +1 -1
  299. package/esm/core/Stepper/WorkflowDiagramStep.js +1 -1
  300. package/esm/core/Surface/Surface.d.ts +8 -0
  301. package/esm/core/Surface/Surface.js +19 -1
  302. package/esm/core/Table/SubRowExpander.d.ts +1 -1
  303. package/esm/core/Table/SubRowExpander.js +1 -1
  304. package/esm/core/Table/Table.d.ts +1 -1
  305. package/esm/core/Table/Table.js +7 -13
  306. package/esm/core/Table/TableCell.d.ts +1 -1
  307. package/esm/core/Table/TablePaginator.js +5 -3
  308. package/esm/core/Table/TableRowMemoized.d.ts +1 -1
  309. package/esm/core/Table/actionHandlers/expandHandler.d.ts +1 -1
  310. package/esm/core/Table/actionHandlers/filterHandler.d.ts +1 -1
  311. package/esm/core/Table/actionHandlers/resizeHandler.d.ts +17 -17
  312. package/esm/core/Table/actionHandlers/selectHandler.d.ts +8 -8
  313. package/esm/core/Table/cells/DefaultCell.d.ts +1 -1
  314. package/esm/core/Table/cells/EditableCell.d.ts +1 -1
  315. package/esm/core/Table/columns/actionColumn.d.ts +2 -2
  316. package/esm/core/Table/columns/actionColumn.js +7 -13
  317. package/esm/core/Table/columns/expanderColumn.d.ts +1 -1
  318. package/esm/core/Table/columns/expanderColumn.js +2 -1
  319. package/esm/core/Table/columns/selectionColumn.d.ts +1 -1
  320. package/esm/core/Table/columns/selectionColumn.js +1 -1
  321. package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.d.ts +1 -1
  322. package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.js +44 -46
  323. package/esm/core/Table/filters/FilterButtonBar.js +1 -1
  324. package/esm/core/Table/filters/FilterToggle.d.ts +1 -1
  325. package/esm/core/Table/filters/FilterToggle.js +7 -9
  326. package/esm/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +1 -1
  327. package/esm/core/Table/filters/TextFilter/TextFilter.js +1 -1
  328. package/esm/core/Table/filters/customFilterFunctions.d.ts +1 -1
  329. package/esm/core/Table/filters/defaultFilterFunctions.d.ts +1 -1
  330. package/esm/core/Table/filters/types.d.ts +2 -19
  331. package/esm/core/Table/hooks/useColumnDragAndDrop.d.ts +1 -1
  332. package/esm/core/Table/hooks/useExpanderCell.d.ts +1 -1
  333. package/esm/core/Table/hooks/useResizeColumns.d.ts +1 -1
  334. package/esm/core/Table/hooks/useScrollToRow.d.ts +1 -1
  335. package/esm/core/Table/hooks/useScrollToRow.js +1 -1
  336. package/esm/core/Table/hooks/useSelectionCell.d.ts +1 -1
  337. package/esm/core/Table/hooks/useStickyColumns.d.ts +1 -1
  338. package/esm/core/Table/hooks/useSubRowFiltering.d.ts +1 -1
  339. package/esm/core/Table/hooks/useSubRowSelection.d.ts +1 -1
  340. package/esm/core/Table/index.d.ts +1 -1
  341. package/esm/core/Table/utils.d.ts +1 -1
  342. package/esm/core/Tabs/Tabs.d.ts +222 -52
  343. package/esm/core/Tabs/Tabs.js +424 -368
  344. package/esm/core/Tag/Tag.js +1 -1
  345. package/esm/core/Textarea/Textarea.js +1 -1
  346. package/esm/core/ThemeProvider/ThemeProvider.d.ts +3 -2
  347. package/esm/core/ThemeProvider/ThemeProvider.js +17 -8
  348. package/esm/core/Tile/Tile.d.ts +2 -2
  349. package/esm/core/Tile/Tile.js +36 -36
  350. package/esm/core/Toast/Toast.js +1 -1
  351. package/esm/core/TransferList/TransferList.d.ts +1 -1
  352. package/esm/core/TransferList/TransferList.js +3 -2
  353. package/esm/core/Tree/TreeNodeExpander.d.ts +1 -1
  354. package/esm/core/Tree/TreeNodeExpander.js +1 -1
  355. package/{cjs/core/Typography/Anchor → esm/core/Typography}/Anchor.d.ts +1 -1
  356. package/esm/core/Typography/{Anchor/Anchor.js → Anchor.js} +1 -1
  357. package/{cjs/core/Typography/Blockquote → esm/core/Typography}/Blockquote.d.ts +1 -1
  358. package/esm/core/Typography/{Blockquote/Blockquote.js → Blockquote.js} +1 -1
  359. package/esm/core/Typography/{Code/Code.d.ts → Code.d.ts} +1 -1
  360. package/esm/core/Typography/{Code/Code.js → Code.js} +1 -1
  361. package/{cjs/core/Typography/Kbd → esm/core/Typography}/Kbd.d.ts +1 -1
  362. package/esm/core/Typography/{Kbd/Kbd.js → Kbd.js} +1 -1
  363. package/{cjs/core/Typography/Text → esm/core/Typography}/Text.d.ts +1 -1
  364. package/esm/core/Typography/{Text/Text.js → Text.js} +1 -1
  365. package/{cjs/core/utils/components → esm/core/VisuallyHidden}/VisuallyHidden.d.ts +1 -1
  366. package/esm/core/{utils/components → VisuallyHidden}/VisuallyHidden.js +1 -1
  367. package/esm/core/utils/components/AutoclearingHiddenLiveRegion.js +1 -1
  368. package/esm/core/utils/components/InputContainer.d.ts +4 -4
  369. package/esm/core/utils/components/InputContainer.js +9 -4
  370. package/esm/core/utils/components/WithCSSTransition.js +7 -1
  371. package/esm/core/utils/components/index.d.ts +0 -6
  372. package/esm/core/utils/components/index.js +0 -6
  373. package/esm/core/utils/functions/dev.d.ts +11 -0
  374. package/esm/core/utils/functions/dev.js +29 -0
  375. package/esm/core/utils/functions/index.d.ts +1 -0
  376. package/esm/core/utils/functions/index.js +1 -0
  377. package/esm/core/utils/hooks/useGlobals.d.ts +1 -1
  378. package/esm/core/utils/hooks/useGlobals.js +1 -5
  379. package/esm/core/utils/hooks/useOverflow.js +3 -1
  380. package/esm/index.d.ts +112 -2
  381. package/esm/index.js +123 -2
  382. package/esm/react-table/react-table.d.ts +745 -0
  383. package/esm/{core/Backdrop/index.js → react-table/react-table.js} +5 -1
  384. package/esm/styles.js +15 -18
  385. package/package.json +22 -23
  386. package/react-table.d.ts +745 -0
  387. package/styles.css +58 -67
  388. package/cjs/core/Alert/index.d.ts +0 -3
  389. package/cjs/core/Alert/index.js +0 -15
  390. package/cjs/core/Avatar/index.d.ts +0 -3
  391. package/cjs/core/Avatar/index.js +0 -15
  392. package/cjs/core/AvatarGroup/index.d.ts +0 -3
  393. package/cjs/core/AvatarGroup/index.js +0 -15
  394. package/cjs/core/Backdrop/index.d.ts +0 -1
  395. package/cjs/core/Backdrop/index.js +0 -14
  396. package/cjs/core/Badge/index.d.ts +0 -3
  397. package/cjs/core/Breadcrumbs/index.d.ts +0 -3
  398. package/cjs/core/Breadcrumbs/index.js +0 -15
  399. package/cjs/core/ButtonGroup/index.d.ts +0 -3
  400. package/cjs/core/ButtonGroup/index.js +0 -15
  401. package/cjs/core/Buttons/Button/index.d.ts +0 -3
  402. package/cjs/core/Buttons/Button/index.js +0 -15
  403. package/cjs/core/Buttons/DropdownButton/index.d.ts +0 -3
  404. package/cjs/core/Buttons/DropdownButton/index.js +0 -15
  405. package/cjs/core/Buttons/IconButton/index.d.ts +0 -3
  406. package/cjs/core/Buttons/IconButton/index.js +0 -15
  407. package/cjs/core/Buttons/IdeasButton/index.d.ts +0 -3
  408. package/cjs/core/Buttons/IdeasButton/index.js +0 -15
  409. package/cjs/core/Buttons/SplitButton/index.d.ts +0 -3
  410. package/cjs/core/Buttons/SplitButton/index.js +0 -15
  411. package/cjs/core/Buttons/index.d.ts +0 -5
  412. package/cjs/core/Buttons/index.js +0 -47
  413. package/cjs/core/Carousel/index.d.ts +0 -3
  414. package/cjs/core/Carousel/index.js +0 -15
  415. package/cjs/core/Checkbox/index.d.ts +0 -3
  416. package/cjs/core/Checkbox/index.js +0 -15
  417. package/cjs/core/ColorPicker/index.d.ts +0 -7
  418. package/cjs/core/ColorPicker/index.js +0 -48
  419. package/cjs/core/ComboBox/ComboBoxDropdown.d.ts +0 -7
  420. package/cjs/core/ComboBox/ComboBoxDropdown.js +0 -43
  421. package/cjs/core/ComboBox/index.d.ts +0 -3
  422. package/cjs/core/ComboBox/index.js +0 -15
  423. package/cjs/core/DatePicker/index.d.ts +0 -3
  424. package/cjs/core/DatePicker/index.js +0 -21
  425. package/cjs/core/Dialog/index.d.ts +0 -3
  426. package/cjs/core/Dialog/index.js +0 -15
  427. package/cjs/core/DropdownMenu/index.d.ts +0 -4
  428. package/cjs/core/DropdownMenu/index.js +0 -15
  429. package/cjs/core/ExpandableBlock/index.d.ts +0 -3
  430. package/cjs/core/ExpandableBlock/index.js +0 -15
  431. package/cjs/core/Fieldset/index.d.ts +0 -3
  432. package/cjs/core/Fieldset/index.js +0 -15
  433. package/cjs/core/FileUpload/index.d.ts +0 -6
  434. package/cjs/core/FileUpload/index.js +0 -40
  435. package/cjs/core/Footer/index.d.ts +0 -4
  436. package/cjs/core/Footer/index.js +0 -21
  437. package/cjs/core/Header/index.d.ts +0 -6
  438. package/cjs/core/Header/index.js +0 -40
  439. package/cjs/core/InformationPanel/index.d.ts +0 -7
  440. package/cjs/core/InformationPanel/index.js +0 -48
  441. package/cjs/core/Input/index.d.ts +0 -3
  442. package/cjs/core/Input/index.js +0 -15
  443. package/cjs/core/InputGrid/index.d.ts +0 -3
  444. package/cjs/core/InputGrid/index.js +0 -15
  445. package/cjs/core/InputGroup/index.d.ts +0 -3
  446. package/cjs/core/InputGroup/index.js +0 -15
  447. package/cjs/core/InputWithDecorations/index.d.ts +0 -3
  448. package/cjs/core/InputWithDecorations/index.js +0 -15
  449. package/cjs/core/Label/index.d.ts +0 -3
  450. package/cjs/core/Label/index.js +0 -15
  451. package/cjs/core/LabeledInput/index.d.ts +0 -3
  452. package/cjs/core/LabeledInput/index.js +0 -15
  453. package/cjs/core/LabeledSelect/index.d.ts +0 -3
  454. package/cjs/core/LabeledSelect/index.js +0 -15
  455. package/cjs/core/LabeledTextarea/index.d.ts +0 -3
  456. package/cjs/core/LabeledTextarea/index.js +0 -15
  457. package/cjs/core/List/index.d.ts +0 -2
  458. package/cjs/core/List/index.js +0 -21
  459. package/cjs/core/Menu/index.d.ts +0 -5
  460. package/cjs/core/Menu/index.js +0 -47
  461. package/cjs/core/Modal/index.d.ts +0 -5
  462. package/cjs/core/Modal/index.js +0 -29
  463. package/cjs/core/NonIdealState/index.d.ts +0 -5
  464. package/cjs/core/NonIdealState/index.js +0 -22
  465. package/cjs/core/NotificationMarker/index.d.ts +0 -3
  466. package/cjs/core/NotificationMarker/index.js +0 -15
  467. package/cjs/core/Overlay/index.d.ts +0 -1
  468. package/cjs/core/Overlay/index.js +0 -14
  469. package/cjs/core/ProgressIndicators/index.d.ts +0 -2
  470. package/cjs/core/ProgressIndicators/index.js +0 -21
  471. package/cjs/core/Radio/index.d.ts +0 -3
  472. package/cjs/core/Radio/index.js +0 -15
  473. package/cjs/core/RadioTiles/index.d.ts +0 -4
  474. package/cjs/core/RadioTiles/index.js +0 -22
  475. package/cjs/core/SearchBox/index.d.ts +0 -3
  476. package/cjs/core/SearchBox/index.js +0 -15
  477. package/cjs/core/Select/index.d.ts +0 -4
  478. package/cjs/core/Select/index.js +0 -15
  479. package/cjs/core/SideNavigation/index.d.ts +0 -6
  480. package/cjs/core/SideNavigation/index.js +0 -40
  481. package/cjs/core/SkipToContentLink/index.d.ts +0 -3
  482. package/cjs/core/SkipToContentLink/index.js +0 -15
  483. package/cjs/core/Slider/index.d.ts +0 -3
  484. package/cjs/core/Slider/index.js +0 -15
  485. package/cjs/core/StatusMessage/index.d.ts +0 -3
  486. package/cjs/core/StatusMessage/index.js +0 -15
  487. package/cjs/core/Stepper/index.d.ts +0 -3
  488. package/cjs/core/Stepper/index.js +0 -21
  489. package/cjs/core/Surface/index.d.ts +0 -3
  490. package/cjs/core/Surface/index.js +0 -15
  491. package/cjs/core/Tabs/Tab.d.ts +0 -40
  492. package/cjs/core/Tabs/Tab.js +0 -65
  493. package/cjs/core/Tabs/index.d.ts +0 -2
  494. package/cjs/core/Tabs/index.js +0 -21
  495. package/cjs/core/Tag/index.d.ts +0 -4
  496. package/cjs/core/Tag/index.js +0 -22
  497. package/cjs/core/Textarea/index.d.ts +0 -3
  498. package/cjs/core/Textarea/index.js +0 -15
  499. package/cjs/core/ThemeProvider/index.d.ts +0 -4
  500. package/cjs/core/ThemeProvider/index.js +0 -15
  501. package/cjs/core/Tile/index.d.ts +0 -3
  502. package/cjs/core/Tile/index.js +0 -15
  503. package/cjs/core/TimePicker/index.d.ts +0 -4
  504. package/cjs/core/TimePicker/index.js +0 -15
  505. package/cjs/core/Toast/index.d.ts +0 -1
  506. package/cjs/core/Toast/index.js +0 -14
  507. package/cjs/core/ToggleSwitch/index.d.ts +0 -3
  508. package/cjs/core/ToggleSwitch/index.js +0 -15
  509. package/cjs/core/Tooltip/index.d.ts +0 -3
  510. package/cjs/core/Tooltip/index.js +0 -15
  511. package/cjs/core/TransferList/index.d.ts +0 -3
  512. package/cjs/core/TransferList/index.js +0 -15
  513. package/cjs/core/Tree/index.d.ts +0 -4
  514. package/cjs/core/Tree/index.js +0 -28
  515. package/cjs/core/Typography/Anchor/index.d.ts +0 -3
  516. package/cjs/core/Typography/Anchor/index.js +0 -15
  517. package/cjs/core/Typography/Blockquote/index.d.ts +0 -3
  518. package/cjs/core/Typography/Blockquote/index.js +0 -15
  519. package/cjs/core/Typography/Code/index.d.ts +0 -3
  520. package/cjs/core/Typography/Code/index.js +0 -15
  521. package/cjs/core/Typography/Kbd/index.d.ts +0 -3
  522. package/cjs/core/Typography/Kbd/index.js +0 -21
  523. package/cjs/core/Typography/Text/index.d.ts +0 -3
  524. package/cjs/core/Typography/Text/index.js +0 -15
  525. package/cjs/core/Typography/index.d.ts +0 -5
  526. package/cjs/core/Typography/index.js +0 -54
  527. package/cjs/core/index.d.ts +0 -68
  528. package/cjs/core/index.js +0 -909
  529. package/cjs/core/utils/components/Popover.d.ts +0 -39
  530. package/cjs/core/utils/components/Popover.js +0 -132
  531. package/cjs/types/react-table-config.d.ts +0 -135
  532. package/cjs/types/react-table-config.js +0 -2
  533. package/esm/core/Alert/index.d.ts +0 -3
  534. package/esm/core/Alert/index.js +0 -6
  535. package/esm/core/Avatar/index.d.ts +0 -3
  536. package/esm/core/Avatar/index.js +0 -6
  537. package/esm/core/AvatarGroup/index.d.ts +0 -3
  538. package/esm/core/AvatarGroup/index.js +0 -6
  539. package/esm/core/Backdrop/index.d.ts +0 -1
  540. package/esm/core/Badge/index.d.ts +0 -3
  541. package/esm/core/Badge/index.js +0 -6
  542. package/esm/core/Breadcrumbs/index.d.ts +0 -3
  543. package/esm/core/Breadcrumbs/index.js +0 -6
  544. package/esm/core/ButtonGroup/index.d.ts +0 -3
  545. package/esm/core/ButtonGroup/index.js +0 -6
  546. package/esm/core/Buttons/Button/index.d.ts +0 -3
  547. package/esm/core/Buttons/Button/index.js +0 -6
  548. package/esm/core/Buttons/DropdownButton/index.d.ts +0 -3
  549. package/esm/core/Buttons/DropdownButton/index.js +0 -6
  550. package/esm/core/Buttons/IconButton/index.d.ts +0 -3
  551. package/esm/core/Buttons/IconButton/index.js +0 -6
  552. package/esm/core/Buttons/IdeasButton/index.d.ts +0 -3
  553. package/esm/core/Buttons/IdeasButton/index.js +0 -6
  554. package/esm/core/Buttons/SplitButton/index.d.ts +0 -3
  555. package/esm/core/Buttons/SplitButton/index.js +0 -6
  556. package/esm/core/Buttons/index.d.ts +0 -5
  557. package/esm/core/Buttons/index.js +0 -9
  558. package/esm/core/Carousel/index.d.ts +0 -3
  559. package/esm/core/Carousel/index.js +0 -6
  560. package/esm/core/Checkbox/index.d.ts +0 -3
  561. package/esm/core/Checkbox/index.js +0 -6
  562. package/esm/core/ColorPicker/index.d.ts +0 -7
  563. package/esm/core/ColorPicker/index.js +0 -10
  564. package/esm/core/ComboBox/ComboBoxDropdown.d.ts +0 -7
  565. package/esm/core/ComboBox/ComboBoxDropdown.js +0 -37
  566. package/esm/core/ComboBox/index.d.ts +0 -3
  567. package/esm/core/ComboBox/index.js +0 -6
  568. package/esm/core/DatePicker/index.d.ts +0 -3
  569. package/esm/core/DatePicker/index.js +0 -6
  570. package/esm/core/Dialog/index.d.ts +0 -3
  571. package/esm/core/Dialog/index.js +0 -6
  572. package/esm/core/DropdownMenu/index.d.ts +0 -4
  573. package/esm/core/DropdownMenu/index.js +0 -6
  574. package/esm/core/ExpandableBlock/index.d.ts +0 -3
  575. package/esm/core/ExpandableBlock/index.js +0 -6
  576. package/esm/core/Fieldset/index.d.ts +0 -3
  577. package/esm/core/Fieldset/index.js +0 -6
  578. package/esm/core/FileUpload/index.d.ts +0 -6
  579. package/esm/core/FileUpload/index.js +0 -9
  580. package/esm/core/Footer/index.d.ts +0 -4
  581. package/esm/core/Footer/index.js +0 -6
  582. package/esm/core/Header/index.d.ts +0 -6
  583. package/esm/core/Header/index.js +0 -9
  584. package/esm/core/InformationPanel/index.d.ts +0 -7
  585. package/esm/core/InformationPanel/index.js +0 -10
  586. package/esm/core/Input/index.d.ts +0 -3
  587. package/esm/core/Input/index.js +0 -6
  588. package/esm/core/InputGrid/index.d.ts +0 -3
  589. package/esm/core/InputGrid/index.js +0 -6
  590. package/esm/core/InputGroup/index.d.ts +0 -3
  591. package/esm/core/InputGroup/index.js +0 -6
  592. package/esm/core/InputWithDecorations/index.d.ts +0 -3
  593. package/esm/core/InputWithDecorations/index.js +0 -6
  594. package/esm/core/Label/index.d.ts +0 -3
  595. package/esm/core/Label/index.js +0 -6
  596. package/esm/core/LabeledInput/index.d.ts +0 -3
  597. package/esm/core/LabeledInput/index.js +0 -6
  598. package/esm/core/LabeledSelect/index.d.ts +0 -3
  599. package/esm/core/LabeledSelect/index.js +0 -6
  600. package/esm/core/LabeledTextarea/index.d.ts +0 -3
  601. package/esm/core/LabeledTextarea/index.js +0 -6
  602. package/esm/core/List/index.d.ts +0 -2
  603. package/esm/core/List/index.js +0 -6
  604. package/esm/core/Menu/index.d.ts +0 -5
  605. package/esm/core/Menu/index.js +0 -9
  606. package/esm/core/Modal/index.d.ts +0 -5
  607. package/esm/core/Modal/index.js +0 -8
  608. package/esm/core/NonIdealState/index.d.ts +0 -5
  609. package/esm/core/NonIdealState/index.js +0 -7
  610. package/esm/core/NotificationMarker/index.d.ts +0 -3
  611. package/esm/core/NotificationMarker/index.js +0 -6
  612. package/esm/core/Overlay/index.d.ts +0 -1
  613. package/esm/core/Overlay/index.js +0 -5
  614. package/esm/core/ProgressIndicators/index.d.ts +0 -2
  615. package/esm/core/ProgressIndicators/index.js +0 -6
  616. package/esm/core/Radio/index.d.ts +0 -3
  617. package/esm/core/Radio/index.js +0 -6
  618. package/esm/core/RadioTiles/index.d.ts +0 -4
  619. package/esm/core/RadioTiles/index.js +0 -7
  620. package/esm/core/SearchBox/index.d.ts +0 -3
  621. package/esm/core/SearchBox/index.js +0 -6
  622. package/esm/core/Select/index.d.ts +0 -4
  623. package/esm/core/Select/index.js +0 -6
  624. package/esm/core/SideNavigation/index.d.ts +0 -6
  625. package/esm/core/SideNavigation/index.js +0 -9
  626. package/esm/core/SkipToContentLink/index.d.ts +0 -3
  627. package/esm/core/SkipToContentLink/index.js +0 -6
  628. package/esm/core/Slider/index.d.ts +0 -3
  629. package/esm/core/Slider/index.js +0 -6
  630. package/esm/core/StatusMessage/index.d.ts +0 -3
  631. package/esm/core/StatusMessage/index.js +0 -6
  632. package/esm/core/Stepper/index.d.ts +0 -3
  633. package/esm/core/Stepper/index.js +0 -6
  634. package/esm/core/Surface/index.d.ts +0 -3
  635. package/esm/core/Surface/index.js +0 -6
  636. package/esm/core/Tabs/Tab.d.ts +0 -40
  637. package/esm/core/Tabs/Tab.js +0 -57
  638. package/esm/core/Tabs/index.d.ts +0 -2
  639. package/esm/core/Tabs/index.js +0 -6
  640. package/esm/core/Tag/index.d.ts +0 -4
  641. package/esm/core/Tag/index.js +0 -7
  642. package/esm/core/Textarea/index.d.ts +0 -3
  643. package/esm/core/Textarea/index.js +0 -6
  644. package/esm/core/ThemeProvider/index.d.ts +0 -4
  645. package/esm/core/ThemeProvider/index.js +0 -6
  646. package/esm/core/Tile/index.d.ts +0 -3
  647. package/esm/core/Tile/index.js +0 -6
  648. package/esm/core/TimePicker/index.d.ts +0 -4
  649. package/esm/core/TimePicker/index.js +0 -6
  650. package/esm/core/Toast/index.d.ts +0 -1
  651. package/esm/core/Toast/index.js +0 -5
  652. package/esm/core/ToggleSwitch/index.d.ts +0 -3
  653. package/esm/core/ToggleSwitch/index.js +0 -6
  654. package/esm/core/Tooltip/index.d.ts +0 -3
  655. package/esm/core/Tooltip/index.js +0 -6
  656. package/esm/core/TransferList/index.d.ts +0 -3
  657. package/esm/core/TransferList/index.js +0 -6
  658. package/esm/core/Tree/index.d.ts +0 -4
  659. package/esm/core/Tree/index.js +0 -7
  660. package/esm/core/Typography/Anchor/index.d.ts +0 -3
  661. package/esm/core/Typography/Anchor/index.js +0 -6
  662. package/esm/core/Typography/Blockquote/index.d.ts +0 -3
  663. package/esm/core/Typography/Blockquote/index.js +0 -6
  664. package/esm/core/Typography/Code/index.d.ts +0 -3
  665. package/esm/core/Typography/Code/index.js +0 -6
  666. package/esm/core/Typography/Kbd/index.d.ts +0 -3
  667. package/esm/core/Typography/Kbd/index.js +0 -6
  668. package/esm/core/Typography/Text/index.d.ts +0 -3
  669. package/esm/core/Typography/Text/index.js +0 -6
  670. package/esm/core/Typography/index.d.ts +0 -5
  671. package/esm/core/Typography/index.js +0 -9
  672. package/esm/core/index.d.ts +0 -68
  673. package/esm/core/index.js +0 -131
  674. package/esm/core/utils/components/Popover.d.ts +0 -39
  675. package/esm/core/utils/components/Popover.js +0 -128
  676. package/esm/types/react-table-config.d.ts +0 -135
  677. package/esm/types/react-table-config.js +0 -1
@@ -5,440 +5,496 @@
5
5
  import cx from 'classnames';
6
6
  import * as React from 'react';
7
7
  import {
8
+ useSafeContext,
9
+ Box,
10
+ polymorphic,
11
+ useIsClient,
12
+ useIsomorphicLayoutEffect,
8
13
  useMergedRefs,
9
- getBoundedValue,
10
14
  useContainerWidth,
11
- useIsomorphicLayoutEffect,
12
- useIsClient,
13
- useResizeObserver,
14
- Box,
15
+ ButtonBase,
16
+ mergeEventHandlers,
17
+ useControlledState,
18
+ useId,
19
+ useLatestRef,
15
20
  } from '../utils/index.js';
16
- import { Tab } from './Tab.js';
17
- import styles from '../../styles.js';
18
- /**
19
- * Tabs organize and allow navigation between groups of content that are related and at the same level of hierarchy.
20
- * @example
21
- * const tabs = [
22
- * <Tab label='Label 1' />,
23
- * <Tab label='Label 2' />,
24
- * <Tab label='Label 3' />,
25
- * ];
26
- * <Tabs labels={tabs} />
27
- *
28
- * @example
29
- * <Tabs orientation='vertical' labels={tabs} />
30
- *
31
- * @example
32
- * const tabsWithSublabels = [
33
- * <Tab label='Label 1' sublabel='First tab' />,
34
- * <Tab label='Label 2' sublabel='Active tab' />,
35
- * ];
36
- * <Tabs labels={tabsWithSublabels} activeIndex={1} />
37
- *
38
- * @example
39
- * const tabsWithIcons = [
40
- * <Tab label='Label 1' icon={<SvgPlaceholder />} />,
41
- * <Tab label='Label 2' icon={<SvgPlaceholder />} />,
42
- * ];
43
- * <Tabs labels={tabsWithIcons} type='pill' />
44
- */
45
- export const Tabs = (props) => {
46
- // Separate actions from props to avoid adding it to the DOM (using {...rest})
47
- let actions;
48
- if (props.type !== 'pill' && props.actions) {
49
- actions = props.actions;
50
- props = { ...props };
51
- delete props.actions;
52
- }
53
- // Separate overflowOptions from props to avoid adding it to the DOM (using {...rest})
54
- let overflowOptions;
55
- if (
56
- props.type !== 'borderless' &&
57
- props.type !== 'pill' &&
58
- props.overflowOptions
59
- ) {
60
- overflowOptions = props.overflowOptions;
61
- props = { ...props };
62
- delete props.overflowOptions;
63
- }
21
+ import { Icon } from '../Icon/Icon.js';
22
+ const TabsWrapper = React.forwardRef((props, ref) => {
64
23
  const {
65
- labels,
66
- activeIndex,
67
- onTabSelected,
68
- focusActivationMode = 'auto',
24
+ className,
25
+ children,
26
+ orientation = 'horizontal',
69
27
  type = 'default',
28
+ focusActivationMode = 'auto',
70
29
  color = 'blue',
71
- orientation = 'horizontal',
72
- tabsClassName,
73
- contentClassName,
74
- wrapperClassName,
75
- children,
30
+ defaultValue,
31
+ value: activeValueProp,
32
+ onValueChange,
76
33
  ...rest
77
34
  } = props;
35
+ const [activeValue, setActiveValue] = useControlledState(
36
+ defaultValue,
37
+ activeValueProp,
38
+ onValueChange,
39
+ );
40
+ const [stripeProperties, setStripeProperties] = React.useState({});
41
+ const [hasSublabel, setHasSublabel] = React.useState(false); // used for setting size
42
+ const idPrefix = useId();
43
+ return React.createElement(
44
+ Box,
45
+ {
46
+ className: cx('iui-tabs-wrapper', `iui-${orientation}`, className),
47
+ ...rest,
48
+ style: { ...stripeProperties, ...props?.style },
49
+ ref: ref,
50
+ },
51
+ React.createElement(
52
+ TabsContext.Provider,
53
+ {
54
+ value: {
55
+ orientation,
56
+ type,
57
+ activeValue,
58
+ setActiveValue,
59
+ setStripeProperties,
60
+ idPrefix,
61
+ focusActivationMode,
62
+ hasSublabel,
63
+ setHasSublabel,
64
+ color,
65
+ },
66
+ },
67
+ children,
68
+ ),
69
+ );
70
+ });
71
+ TabsWrapper.displayName = 'Tabs.Wrapper';
72
+ const TabList = React.forwardRef((props, ref) => {
73
+ const { className, children, ...rest } = props;
74
+ const { type, hasSublabel, color } = useSafeContext(TabsContext);
78
75
  const isClient = useIsClient();
79
76
  const tablistRef = React.useRef(null);
80
77
  const [tablistSizeRef, tabsWidth] = useContainerWidth(type !== 'default');
81
- const refs = useMergedRefs(tablistRef, tablistSizeRef);
82
- const [currentActiveIndex, setCurrentActiveIndex] = React.useState(() =>
83
- activeIndex != null
84
- ? getBoundedValue(activeIndex, 0, labels.length - 1)
85
- : 0,
78
+ const refs = useMergedRefs(ref, tablistRef, tablistSizeRef);
79
+ return React.createElement(
80
+ Box,
81
+ {
82
+ className: cx(
83
+ 'iui-tabs',
84
+ `iui-${type}`,
85
+ {
86
+ 'iui-green': color === 'green',
87
+ 'iui-animated': type !== 'default' && isClient,
88
+ 'iui-not-animated': type !== 'default' && !isClient,
89
+ 'iui-large': hasSublabel,
90
+ },
91
+ className,
92
+ ),
93
+ role: 'tablist',
94
+ ref: refs,
95
+ ...rest,
96
+ },
97
+ React.createElement(
98
+ TabListContext.Provider,
99
+ {
100
+ value: {
101
+ tabsWidth,
102
+ },
103
+ },
104
+ children,
105
+ ),
86
106
  );
107
+ });
108
+ TabList.displayName = 'Tabs.TabList';
109
+ const Tab = React.forwardRef((props, forwardedRef) => {
110
+ const { className, children, value, label, ...rest } = props;
111
+ const {
112
+ orientation,
113
+ activeValue,
114
+ setActiveValue,
115
+ type,
116
+ setStripeProperties,
117
+ idPrefix,
118
+ focusActivationMode,
119
+ } = useSafeContext(TabsContext);
120
+ const { tabsWidth } = useSafeContext(TabListContext);
121
+ const tabRef = React.useRef();
122
+ const isActive = activeValue === value;
123
+ const isActiveRef = useLatestRef(isActive);
124
+ // Scroll to active tab only on initial render
87
125
  useIsomorphicLayoutEffect(() => {
88
- if (activeIndex != null && currentActiveIndex !== activeIndex) {
89
- setCurrentActiveIndex(getBoundedValue(activeIndex, 0, labels.length - 1));
90
- }
91
- }, [activeIndex, currentActiveIndex, labels.length]);
92
- // CSS custom properties to place the active stripe
93
- const [stripeProperties, setStripeProperties] = React.useState({});
94
- useIsomorphicLayoutEffect(() => {
95
- if (type !== 'default' && tablistRef.current != undefined) {
96
- const activeTab = tablistRef.current.children[currentActiveIndex];
97
- const activeTabRect = activeTab.getBoundingClientRect();
98
- setStripeProperties({
99
- ...(orientation === 'horizontal' && {
100
- '--stripe-width': `${activeTabRect.width}px`,
101
- '--stripe-left': `${activeTab.offsetLeft}px`,
102
- }),
103
- ...(orientation === 'vertical' && {
104
- '--stripe-height': `${activeTabRect.height}px`,
105
- '--stripe-top': `${activeTab.offsetTop}px`,
106
- }),
126
+ if (isActiveRef.current) {
127
+ tabRef.current?.parentElement?.scrollTo({
128
+ [orientation === 'horizontal' ? 'left' : 'top']:
129
+ tabRef.current?.[
130
+ orientation === 'horizontal' ? 'offsetLeft' : 'offsetTop'
131
+ ] - 4,
132
+ behavior: 'instant', // not using 'smooth' to reduce layout shift on page load
107
133
  });
108
134
  }
109
- }, [currentActiveIndex, type, orientation, tabsWidth]);
110
- const [focusedIndex, setFocusedIndex] = React.useState();
111
- React.useEffect(() => {
112
- if (tablistRef.current && focusedIndex !== undefined) {
113
- const tab = tablistRef.current.querySelectorAll(`.${styles['iui-tab']}`)[
114
- focusedIndex
115
- ];
116
- tab?.focus();
117
- }
118
- }, [focusedIndex]);
119
- const [hasSublabel, setHasSublabel] = React.useState(false); // used for setting size
120
- useIsomorphicLayoutEffect(() => {
121
- setHasSublabel(
122
- type !== 'pill' && // pill tabs should never have sublabels
123
- !!tablistRef.current?.querySelector(
124
- `.${styles['iui-tab-description']}`,
125
- ),
126
- );
127
- }, [type]);
128
- const enableHorizontalScroll = React.useCallback((e) => {
129
- const ownerDoc = tablistRef.current;
130
- if (ownerDoc === null) {
131
- return;
132
- }
133
- let scrollLeft = ownerDoc?.scrollLeft ?? 0;
134
- if (e.deltaY > 0 || e.deltaX > 0) {
135
- scrollLeft += 25;
136
- } else if (e.deltaY < 0 || e.deltaX < 0) {
137
- scrollLeft -= 25;
138
- }
139
- ownerDoc.scrollLeft = scrollLeft;
140
135
  }, []);
141
- // allow normal mouse wheels to scroll horizontally for horizontal overflow
142
- React.useEffect(() => {
143
- const ownerDoc = tablistRef.current;
144
- if (ownerDoc === null) {
145
- return;
146
- }
147
- if (!overflowOptions?.useOverflow || orientation === 'vertical') {
148
- ownerDoc.removeEventListener('wheel', enableHorizontalScroll);
149
- return;
150
- }
151
- ownerDoc.addEventListener('wheel', enableHorizontalScroll);
152
- }, [overflowOptions?.useOverflow, orientation, enableHorizontalScroll]);
153
- const isTabHidden = (activeTab, isVertical) => {
154
- const ownerDoc = tablistRef.current;
155
- if (ownerDoc === null) {
156
- return;
157
- }
158
- const fadeBuffer = isVertical
159
- ? ownerDoc.offsetHeight * 0.05
160
- : ownerDoc.offsetWidth * 0.05;
161
- const visibleStart = isVertical ? ownerDoc.scrollTop : ownerDoc.scrollLeft;
162
- const visibleEnd = isVertical
163
- ? ownerDoc.scrollTop + ownerDoc.offsetHeight
164
- : ownerDoc.scrollLeft + ownerDoc.offsetWidth;
165
- const tabStart = isVertical ? activeTab.offsetTop : activeTab.offsetLeft;
166
- const tabEnd = isVertical
167
- ? activeTab.offsetTop + activeTab.offsetHeight
168
- : activeTab.offsetLeft + activeTab.offsetWidth;
169
- if (
170
- tabStart > visibleStart + fadeBuffer &&
171
- tabEnd < visibleEnd - fadeBuffer
172
- ) {
173
- return 0; // tab is visible
174
- } else if (tabStart < visibleStart + fadeBuffer) {
175
- return -1; // tab is before visible section
176
- } else {
177
- return 1; // tab is after visible section
178
- }
179
- };
180
- const easeInOutQuad = (time, beginning, change, duration) => {
181
- if ((time /= duration / 2) < 1) {
182
- return (change / 2) * time * time + beginning;
183
- }
184
- return (-change / 2) * (--time * (time - 2) - 1) + beginning;
136
+ const updateStripe = () => {
137
+ const currentTabRect = tabRef.current?.getBoundingClientRect();
138
+ setStripeProperties({
139
+ '--iui-tabs-stripe-size':
140
+ orientation === 'horizontal'
141
+ ? `${currentTabRect?.width}px`
142
+ : `${currentTabRect?.height}px`,
143
+ '--iui-tabs-stripe-position':
144
+ orientation === 'horizontal'
145
+ ? `${tabRef.current?.offsetLeft}px`
146
+ : `${tabRef.current?.offsetTop}px`,
147
+ });
185
148
  };
186
- const scrollToTab = React.useCallback(
187
- (list, activeTab, duration, isVertical, tabPlacement) => {
188
- const start = isVertical ? list.scrollTop : list.scrollLeft;
189
- let change = 0;
190
- let currentTime = 0;
191
- const increment = 20;
192
- const fadeBuffer = isVertical
193
- ? list.offsetHeight * 0.05
194
- : list.offsetWidth * 0.05;
195
- if (tabPlacement < 0) {
196
- // if tab is before visible section
197
- change = isVertical
198
- ? activeTab.offsetTop - list.scrollTop
199
- : activeTab.offsetLeft - list.scrollLeft;
200
- change -= fadeBuffer; // give some space so the active tab isn't covered by the fade
201
- } else {
202
- // tab is after visible section
203
- change = isVertical
204
- ? activeTab.offsetTop -
205
- (list.scrollTop + list.offsetHeight) +
206
- activeTab.offsetHeight
207
- : activeTab.offsetLeft -
208
- (list.scrollLeft + list.offsetWidth) +
209
- activeTab.offsetWidth;
210
- change += fadeBuffer; // give some space so the active tab isn't covered by the fade
211
- }
212
- const animateScroll = () => {
213
- currentTime += increment;
214
- const val = easeInOutQuad(currentTime, start, change, duration);
215
- if (isVertical) {
216
- list.scrollTop = val;
217
- } else {
218
- list.scrollLeft = val;
219
- }
220
- if (currentTime < duration) {
221
- setTimeout(animateScroll, increment);
222
- }
223
- };
224
- animateScroll();
225
- },
226
- [],
227
- );
228
- // scroll to active tab if it is not visible with overflow
149
+ // CSS custom properties to place the active stripe
229
150
  useIsomorphicLayoutEffect(() => {
230
- setTimeout(() => {
231
- const ownerDoc = tablistRef.current;
232
- if (
233
- ownerDoc !== null &&
234
- overflowOptions?.useOverflow &&
235
- currentActiveIndex !== undefined
236
- ) {
237
- const activeTab = ownerDoc.querySelectorAll(`.${styles['iui-tab']}`)[
238
- currentActiveIndex
239
- ];
240
- const isVertical = orientation === 'vertical';
241
- const tabPlacement = isTabHidden(activeTab, isVertical);
242
- if (tabPlacement) {
243
- scrollToTab(ownerDoc, activeTab, 100, isVertical, tabPlacement);
244
- }
245
- }
246
- }, 50);
151
+ if (type !== 'default' && isActive) {
152
+ updateStripe();
153
+ }
247
154
  }, [
248
- overflowOptions?.useOverflow,
249
- currentActiveIndex,
250
- focusedIndex,
155
+ type,
251
156
  orientation,
252
- scrollToTab,
157
+ isActive,
158
+ tabsWidth, // to fix visual artifact on initial render
253
159
  ]);
254
- const [scrollingPlacement, setScrollingPlacement] = React.useState(undefined);
255
- const determineScrollingPlacement = React.useCallback(() => {
256
- const ownerDoc = tablistRef.current;
257
- if (ownerDoc === null) {
258
- return;
259
- }
260
- const isVertical = orientation === 'vertical';
261
- const visibleStart = isVertical ? ownerDoc.scrollTop : ownerDoc.scrollLeft;
262
- const visibleEnd = isVertical
263
- ? ownerDoc.scrollTop + ownerDoc.offsetHeight
264
- : ownerDoc.scrollLeft + ownerDoc.offsetWidth;
265
- const totalTabsSpace = isVertical
266
- ? ownerDoc.scrollHeight
267
- : ownerDoc.scrollWidth;
268
- if (
269
- Math.abs(visibleStart - 0) < 1 &&
270
- Math.abs(visibleEnd - totalTabsSpace) < 1
271
- ) {
272
- setScrollingPlacement(undefined);
273
- } else if (Math.abs(visibleStart - 0) < 1) {
274
- setScrollingPlacement('start');
275
- } else if (Math.abs(visibleEnd - totalTabsSpace) < 1) {
276
- setScrollingPlacement('end');
277
- } else {
278
- setScrollingPlacement('center');
279
- }
280
- }, [orientation, setScrollingPlacement]);
281
- // apply correct mask when tabs list is resized
282
- const [resizeRef] = useResizeObserver(determineScrollingPlacement);
283
- resizeRef(tablistRef?.current);
284
- // check if overflow tabs are scrolled to far edges
285
- React.useEffect(() => {
286
- const ownerDoc = tablistRef.current;
287
- if (ownerDoc === null) {
288
- return;
289
- }
290
- if (!overflowOptions?.useOverflow) {
291
- ownerDoc.removeEventListener('scroll', determineScrollingPlacement);
292
- return;
293
- }
294
- ownerDoc.addEventListener('scroll', determineScrollingPlacement);
295
- }, [overflowOptions?.useOverflow, determineScrollingPlacement]);
296
- const onTabClick = React.useCallback(
297
- (index) => {
298
- if (onTabSelected) {
299
- onTabSelected(index);
300
- }
301
- setCurrentActiveIndex(index);
302
- },
303
- [onTabSelected],
304
- );
305
160
  const onKeyDown = (event) => {
306
- // alt + arrow keys are used by browser / assistive technologies
307
161
  if (event.altKey) {
308
162
  return;
309
163
  }
310
- const isTabDisabled = (index) => {
311
- const tab = labels[index];
312
- return React.isValidElement(tab) && tab.props.disabled;
313
- };
314
- let newIndex = focusedIndex ?? currentActiveIndex;
315
- /** focus next tab if delta is +1, previous tab if -1 */
316
- const focusTab = (delta = +1) => {
317
- do {
318
- newIndex = (newIndex + delta + labels.length) % labels.length;
319
- } while (isTabDisabled(newIndex) && newIndex !== focusedIndex);
320
- setFocusedIndex(newIndex);
321
- focusActivationMode === 'auto' && onTabClick(newIndex);
322
- };
164
+ const allTabs = Array.from(
165
+ event.currentTarget.parentElement?.children ?? [],
166
+ );
167
+ const nextTab = tabRef.current?.nextElementSibling ?? allTabs.at(0);
168
+ const previousTab =
169
+ tabRef.current?.previousElementSibling ?? allTabs.at(-1);
323
170
  switch (event.key) {
324
171
  case 'ArrowDown': {
325
172
  if (orientation === 'vertical') {
326
- focusTab(+1);
173
+ nextTab?.focus();
327
174
  event.preventDefault();
328
175
  }
329
176
  break;
330
177
  }
331
178
  case 'ArrowRight': {
332
179
  if (orientation === 'horizontal') {
333
- focusTab(+1);
180
+ nextTab?.focus();
334
181
  event.preventDefault();
335
182
  }
336
183
  break;
337
184
  }
338
185
  case 'ArrowUp': {
339
186
  if (orientation === 'vertical') {
340
- focusTab(-1);
187
+ previousTab?.focus();
341
188
  event.preventDefault();
342
189
  }
343
190
  break;
344
191
  }
345
192
  case 'ArrowLeft': {
346
193
  if (orientation === 'horizontal') {
347
- focusTab(-1);
194
+ previousTab?.focus();
348
195
  event.preventDefault();
349
196
  }
350
197
  break;
351
198
  }
352
- case 'Enter':
353
- case ' ':
354
- case 'Spacebar': {
355
- event.preventDefault();
356
- if (focusActivationMode === 'manual' && focusedIndex !== undefined) {
357
- onTabClick(focusedIndex);
358
- }
359
- break;
360
- }
361
199
  default:
362
200
  break;
363
201
  }
364
202
  };
365
- const createTab = React.useCallback(
366
- (label, index) => {
367
- const onClick = () => {
368
- setFocusedIndex(index);
369
- onTabClick(index);
370
- };
371
- return React.createElement(
372
- 'li',
373
- { key: index },
374
- !React.isValidElement(label)
375
- ? React.createElement(Tab, {
376
- label: label,
377
- className: cx({
378
- 'iui-active': index === currentActiveIndex,
379
- }),
380
- tabIndex: index === currentActiveIndex ? 0 : -1,
381
- onClick: onClick,
382
- 'aria-selected': index === currentActiveIndex,
383
- })
384
- : React.cloneElement(label, {
385
- active: index === currentActiveIndex,
386
- 'aria-selected': index === currentActiveIndex,
387
- tabIndex: index === currentActiveIndex ? 0 : -1,
388
- onClick: (args) => {
389
- onClick();
390
- label.props.onClick?.(args);
391
- },
392
- }),
393
- );
203
+ // use first tab as active if no `value` passed.
204
+ const setInitialActiveRef = React.useCallback(
205
+ (element) => {
206
+ if (activeValue !== undefined) {
207
+ return;
208
+ }
209
+ if (element?.matches(':first-of-type')) {
210
+ setActiveValue(value);
211
+ }
394
212
  },
395
- [currentActiveIndex, onTabClick],
213
+ [activeValue, setActiveValue, value],
396
214
  );
215
+ return React.createElement(
216
+ ButtonBase,
217
+ {
218
+ className: cx('iui-tab', className),
219
+ role: 'tab',
220
+ tabIndex: isActive ? 0 : -1,
221
+ 'aria-selected': isActive,
222
+ 'aria-controls': `${idPrefix}-panel-${value}`,
223
+ ref: useMergedRefs(tabRef, forwardedRef, setInitialActiveRef),
224
+ ...rest,
225
+ id: `${idPrefix}-tab-${value}`,
226
+ onClick: mergeEventHandlers(props.onClick, () => setActiveValue(value)),
227
+ onKeyDown: mergeEventHandlers(props.onKeyDown, onKeyDown),
228
+ onFocus: mergeEventHandlers(props.onFocus, () => {
229
+ tabRef.current?.scrollIntoView({ block: 'nearest', inline: 'nearest' });
230
+ if (focusActivationMode === 'auto' && !props.disabled) {
231
+ setActiveValue(value);
232
+ }
233
+ }),
234
+ },
235
+ label ? React.createElement(Tabs.TabLabel, null, label) : children,
236
+ );
237
+ });
238
+ Tab.displayName = 'Tabs.Tab';
239
+ // ----------------------------------------------------------------------------
240
+ // Tabs.TabIcon component
241
+ const TabIcon = React.forwardRef((props, ref) => {
242
+ return React.createElement(Icon, {
243
+ ...props,
244
+ className: cx('iui-tab-icon', props?.className),
245
+ ref: ref,
246
+ });
247
+ });
248
+ TabIcon.displayName = 'Tabs.TabIcon';
249
+ // ----------------------------------------------------------------------------
250
+ // Tabs.TabLabel component
251
+ const TabLabel = polymorphic.span('iui-tab-label');
252
+ TabLabel.displayName = 'Tabs.TabLabel';
253
+ // ----------------------------------------------------------------------------
254
+ // Tabs.TabDescription component
255
+ const TabDescription = React.forwardRef((props, ref) => {
256
+ const { className, children, ...rest } = props;
257
+ const { hasSublabel, setHasSublabel } = useSafeContext(TabsContext);
258
+ useIsomorphicLayoutEffect(() => {
259
+ if (!hasSublabel) {
260
+ setHasSublabel(true);
261
+ }
262
+ }, [hasSublabel, setHasSublabel]);
263
+ return React.createElement(
264
+ Box,
265
+ {
266
+ as: 'span',
267
+ className: cx('iui-tab-description', className),
268
+ ref: ref,
269
+ ...rest,
270
+ },
271
+ children,
272
+ );
273
+ });
274
+ TabDescription.displayName = 'Tabs.TabDescription';
275
+ const TabsActions = React.forwardRef((props, ref) => {
276
+ const { wrapperProps, className, children, ...rest } = props;
397
277
  return React.createElement(
398
278
  Box,
399
279
  {
400
- className: cx('iui-tabs-wrapper', `iui-${orientation}`, wrapperClassName),
401
- style: stripeProperties,
280
+ ...wrapperProps,
281
+ className: cx('iui-tabs-actions-wrapper', wrapperProps?.className),
402
282
  },
403
283
  React.createElement(
404
284
  Box,
405
- {
406
- as: 'ul',
407
- className: cx(
408
- 'iui-tabs',
409
- `iui-${type}`,
410
- {
411
- 'iui-green': color === 'green',
412
- 'iui-animated': type !== 'default' && isClient,
413
- 'iui-not-animated': type !== 'default' && !isClient,
414
- 'iui-large': hasSublabel,
415
- },
416
- tabsClassName,
417
- ),
418
- 'data-iui-overflow': overflowOptions?.useOverflow,
419
- 'data-iui-scroll-placement': scrollingPlacement,
420
- role: 'tablist',
421
- ref: refs,
422
- onKeyDown: onKeyDown,
423
- ...rest,
424
- },
425
- labels.map((label, index) => createTab(label, index)),
285
+ { className: cx('iui-tabs-actions', className), ref: ref, ...rest },
286
+ children,
426
287
  ),
427
- actions &&
428
- React.createElement(
429
- Box,
430
- { className: 'iui-tabs-actions-wrapper' },
431
- React.createElement(Box, { className: 'iui-tabs-actions' }, actions),
432
- ),
288
+ );
289
+ });
290
+ TabsActions.displayName = 'Tabs.Actions';
291
+ const TabsPanel = React.forwardRef((props, ref) => {
292
+ const { value, className, children, ...rest } = props;
293
+ const { activeValue, idPrefix } = useSafeContext(TabsContext);
294
+ return React.createElement(
295
+ Box,
296
+ {
297
+ className: cx('iui-tabs-content', className),
298
+ 'aria-labelledby': `${idPrefix}-tab-${value}`,
299
+ role: 'tabpanel',
300
+ hidden: activeValue !== value ? true : undefined,
301
+ ref: ref,
302
+ ...rest,
303
+ id: `${idPrefix}-panel-${value}`,
304
+ },
305
+ children,
306
+ );
307
+ });
308
+ TabsPanel.displayName = 'Tabs.Panel';
309
+ const LegacyTabsComponent = React.forwardRef((props, forwardedRef) => {
310
+ let actions;
311
+ if (props.type !== 'pill' && props.actions) {
312
+ actions = props.actions;
313
+ props = { ...props };
314
+ delete props.actions;
315
+ }
316
+ const {
317
+ labels,
318
+ onTabSelected,
319
+ focusActivationMode,
320
+ color,
321
+ activeIndex: activeIndexProp,
322
+ tabsClassName,
323
+ contentClassName,
324
+ wrapperClassName,
325
+ children,
326
+ ...rest
327
+ } = props;
328
+ const [activeIndex, setActiveIndex] = useControlledState(
329
+ 0,
330
+ activeIndexProp,
331
+ onTabSelected,
332
+ );
333
+ return React.createElement(
334
+ TabsWrapper,
335
+ {
336
+ className: wrapperClassName,
337
+ focusActivationMode: focusActivationMode,
338
+ color: color,
339
+ value: `${activeIndex}`,
340
+ onValueChange: (value) => setActiveIndex(Number(value)),
341
+ ...rest,
342
+ },
343
+ React.createElement(
344
+ TabList,
345
+ { className: tabsClassName, ref: forwardedRef },
346
+ labels.map((label, index) => {
347
+ const tabValue = `${index}`;
348
+ return React.isValidElement(label)
349
+ ? React.cloneElement(label, {
350
+ value: tabValue,
351
+ })
352
+ : React.createElement(LegacyTab, {
353
+ key: index,
354
+ value: tabValue,
355
+ label: label,
356
+ });
357
+ }),
358
+ ),
359
+ actions && React.createElement(TabsActions, null, actions),
433
360
  children &&
434
361
  React.createElement(
435
- Box,
436
- {
437
- className: cx('iui-tabs-content', contentClassName),
438
- role: 'tabpanel',
439
- },
362
+ TabsPanel,
363
+ { value: `${activeIndex}`, className: contentClassName },
440
364
  children,
441
365
  ),
442
366
  );
443
- };
367
+ });
368
+ LegacyTabsComponent.displayName = 'Tabs';
369
+ /**
370
+ * Legacy Tab component.
371
+ * For full functionality use composition API.
372
+ *
373
+ * Individual tab component to be used in the `labels` prop of `Tabs`.
374
+ * @example
375
+ * const tabs = [
376
+ * <Tab label='Label 1' sublabel='Description 1' />,
377
+ * <Tab label='Label 2' startIcon={<SvgPlaceholder />} />,
378
+ * ];
379
+ */
380
+ const LegacyTab = React.forwardRef((props, forwardedRef) => {
381
+ const { label, sublabel, startIcon, children, value, ...rest } = props;
382
+ return React.createElement(
383
+ React.Fragment,
384
+ null,
385
+ React.createElement(
386
+ Tab,
387
+ { ...rest, value: value, ref: forwardedRef },
388
+ startIcon && React.createElement(TabIcon, null, startIcon),
389
+ React.createElement(TabLabel, null, label),
390
+ sublabel && React.createElement(TabDescription, null, sublabel),
391
+ children,
392
+ ),
393
+ );
394
+ });
395
+ // ----------------------------------------------------------------------------
396
+ // exports
397
+ export { LegacyTab as Tab };
398
+ /**
399
+ * Tabs organize and allow navigation between groups of content that are related and at the same level of hierarchy.
400
+ * `Tabs.Tab` and `Tabs.Panel` can be associated with each other by passing them the same `value`.
401
+ * @example
402
+ * <Tabs.Wrapper>
403
+ * <Tabs.TabList>
404
+ * <Tabs.Tab value='tab1' label='Label 1' />
405
+ * <Tabs.Tab value='tab2' label='Label 2' />
406
+ * <Tabs.Tab value='tab3' label='Label 3' />
407
+ * </Tabs.TabList>
408
+ * <Tabs.ActionsWrapper>
409
+ * <Tabs.Actions>
410
+ * <Button>Sample Button</Button>
411
+ * </Tabs.Actions>
412
+ * </Tabs.ActionsWrapper>
413
+ * <Tabs.Panel value='tab1'>Content 1</Tabs.Panel>
414
+ * <Tabs.Panel value='tab2'>Content 2</Tabs.Panel>
415
+ * <Tabs.Panel value='tab3'>Content 3</Tabs.Panel>
416
+ * </Tabs.Wrapper>
417
+ *
418
+ * @example
419
+ * <Tabs orientation='vertical'/>
420
+ *
421
+ * @example
422
+ * <Tabs.Wrapper focusActivationMode='manual'>
423
+ * <Tabs.Tab value='sample'>
424
+ * <Tabs.TabIcon>
425
+ * <SvgPlaceholder />
426
+ * </Tabs.TabIcon>
427
+ * <Tabs.TabLabel>Sample Label</Tabs.TabLabel>
428
+ * <Tabs.TabDescription>Sample Description</Tabs.TabDescription>
429
+ * </Tabs.Tab>
430
+ * </Tabs.Wrapper>
431
+ */
432
+ export const Tabs = Object.assign(LegacyTabsComponent, {
433
+ /**
434
+ * A wrapper component for Tabs
435
+ */
436
+ Wrapper: TabsWrapper,
437
+ /**
438
+ * Tablist subcomponent which contains all of the tab subcomponents.
439
+ * @example
440
+ * <Tabs.TabList>
441
+ * <Tabs.Tab value='tab1' label='Label 1' />
442
+ * <Tabs.Tab value='tab2' label='Label 2' />
443
+ * <Tabs.Tab value='tab3' label='Label 3' />
444
+ * </Tabs.TabList>
445
+ *
446
+ * @example
447
+ * <Tabs.TabList>
448
+ * <Tabs.Tab value='tab1' label='Green Tab' />
449
+ * </Tabs.TabList>
450
+ *
451
+ * @example
452
+ * <Tabs.TabList focusActivationMode='manual'>
453
+ * <Tabs.Tab value='tab1' label='Manual Focus Tab' />
454
+ * </Tabs.TabList>
455
+ */
456
+ TabList: TabList,
457
+ /**
458
+ * Tab subcomponent which is used for each of the tabs.
459
+ * @example
460
+ * <Tabs.Tab value='tab1' label='Label 1' />
461
+ *
462
+ * @example
463
+ * <Tabs.Tab value='sample'>
464
+ * <Tabs.TabIcon>
465
+ * <SvgPlaceholder />
466
+ * </Tabs.TabIcon>
467
+ * <Tabs.TabLabel>Sample Label</Tabs.TabLabel>
468
+ * <Tabs.TabDescription>Sample Description</Tabs.TabDescription>
469
+ * </Tabs.Tab>
470
+ *
471
+ */
472
+ Tab: Tab,
473
+ /**
474
+ * Tab icon subcomponent which places an icon on the left side of the tab.
475
+ */
476
+ TabIcon: TabIcon,
477
+ /**
478
+ * Tab label subcomponent which holds the tab's label.
479
+ */
480
+ TabLabel: TabLabel,
481
+ /**
482
+ * Tab description subcomponent which places a description under the tab label.
483
+ */
484
+ TabDescription: TabDescription,
485
+ /**
486
+ * Tab actions subcomponent which contains action buttons that are placed at the end of the tabs.
487
+ */
488
+ Actions: TabsActions,
489
+ /**
490
+ * Tab panel subcomponent which contains the tab's content.
491
+ * @example
492
+ * <Tabs.Panel value='tab1'>
493
+ * Sample Panel
494
+ * </Tabs.Panel>
495
+ */
496
+ Panel: TabsPanel,
497
+ });
498
+ const TabsContext = React.createContext(undefined);
499
+ const TabListContext = React.createContext(undefined);
444
500
  export default Tabs;