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