@itwin/itwinui-react 3.0.0-dev.1 → 3.0.0-dev.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (239) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/cjs/core/Alert/Alert.d.ts +47 -28
  3. package/cjs/core/Alert/Alert.js +73 -21
  4. package/cjs/core/Avatar/Avatar.js +1 -1
  5. package/cjs/core/AvatarGroup/AvatarGroup.js +1 -1
  6. package/cjs/core/Breadcrumbs/Breadcrumbs.js +2 -3
  7. package/cjs/core/ButtonGroup/ButtonGroup.js +1 -4
  8. package/cjs/core/Buttons/DropdownButton/DropdownButton.js +3 -5
  9. package/cjs/core/Carousel/Carousel.d.ts +2 -2
  10. package/cjs/core/Carousel/Carousel.js +3 -5
  11. package/cjs/core/Carousel/CarouselDotsList.js +8 -10
  12. package/cjs/core/Carousel/CarouselNavigation.d.ts +2 -2
  13. package/cjs/core/Carousel/CarouselNavigation.js +3 -5
  14. package/cjs/core/Carousel/CarouselSlider.js +10 -15
  15. package/cjs/core/ColorPicker/ColorBuilder.js +7 -10
  16. package/cjs/core/ColorPicker/ColorInputPanel.js +12 -15
  17. package/cjs/core/ColorPicker/ColorPalette.js +4 -6
  18. package/cjs/core/ColorPicker/ColorPicker.js +3 -3
  19. package/cjs/core/ComboBox/ComboBox.js +25 -32
  20. package/cjs/core/ComboBox/ComboBoxDropdown.js +1 -2
  21. package/cjs/core/ComboBox/ComboBoxEndIcon.js +1 -1
  22. package/cjs/core/ComboBox/ComboBoxInput.js +21 -20
  23. package/cjs/core/ComboBox/ComboBoxMenu.js +3 -4
  24. package/cjs/core/ComboBox/ComboBoxMenuItem.js +2 -2
  25. package/cjs/core/ComboBox/helpers.js +4 -5
  26. package/cjs/core/DatePicker/DatePicker.js +32 -32
  27. package/cjs/core/Dialog/Dialog.js +11 -4
  28. package/cjs/core/Dialog/DialogBackdrop.js +1 -1
  29. package/cjs/core/Dialog/DialogContext.d.ts +11 -0
  30. package/cjs/core/Dialog/DialogMain.js +16 -22
  31. package/cjs/core/DropdownMenu/DropdownMenu.js +6 -8
  32. package/cjs/core/ExpandableBlock/ExpandableBlock.js +2 -2
  33. package/cjs/core/FileUpload/FileEmptyCard.js +1 -1
  34. package/cjs/core/FileUpload/FileUpload.d.ts +3 -4
  35. package/cjs/core/FileUpload/FileUpload.js +5 -8
  36. package/cjs/core/FileUpload/FileUploadCard.js +9 -10
  37. package/cjs/core/FileUpload/FileUploadTemplate.d.ts +1 -0
  38. package/cjs/core/FileUpload/FileUploadTemplate.js +1 -0
  39. package/cjs/core/InformationPanel/InformationPanel.js +1 -4
  40. package/cjs/core/LabeledInput/LabeledInput.js +1 -1
  41. package/cjs/core/LabeledTextarea/LabeledTextarea.js +1 -1
  42. package/cjs/core/Menu/Menu.js +3 -4
  43. package/cjs/core/Menu/MenuItem.js +8 -11
  44. package/cjs/core/Modal/Modal.d.ts +8 -9
  45. package/cjs/core/Modal/Modal.js +7 -17
  46. package/cjs/core/SearchBox/SearchBox.js +12 -12
  47. package/cjs/core/Select/Select.js +12 -17
  48. package/cjs/core/SideNavigation/SideNavigation.js +2 -2
  49. package/cjs/core/Slider/Slider.js +16 -19
  50. package/cjs/core/Slider/Thumb.js +1 -1
  51. package/cjs/core/StatusMessage/StatusMessage.js +1 -1
  52. package/cjs/core/Stepper/Stepper.js +1 -1
  53. package/cjs/core/Stepper/StepperStep.js +1 -1
  54. package/cjs/core/Table/Table.js +15 -15
  55. package/cjs/core/Table/TablePaginator.js +2 -3
  56. package/cjs/core/Table/TableRowMemoized.js +38 -45
  57. package/cjs/core/Table/actionHandlers/expandHandler.js +3 -3
  58. package/cjs/core/Table/actionHandlers/filterHandler.js +4 -5
  59. package/cjs/core/Table/actionHandlers/selectHandler.js +6 -6
  60. package/cjs/core/Table/cells/DefaultCell.js +1 -1
  61. package/cjs/core/Table/cells/EditableCell.js +6 -12
  62. package/cjs/core/Table/columns/actionColumn.js +3 -6
  63. package/cjs/core/Table/columns/expanderColumn.js +3 -3
  64. package/cjs/core/Table/columns/selectionColumn.js +4 -4
  65. package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.js +2 -4
  66. package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.js +2 -3
  67. package/cjs/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +2 -3
  68. package/cjs/core/Table/filters/TextFilter/TextFilter.js +1 -2
  69. package/cjs/core/Table/hooks/useResizeColumns.js +16 -22
  70. package/cjs/core/Table/hooks/useScrollToRow.js +1 -2
  71. package/cjs/core/Table/hooks/useStickyColumns.js +3 -5
  72. package/cjs/core/Table/hooks/useSubRowFiltering.js +2 -4
  73. package/cjs/core/Tabs/Tabs.js +13 -16
  74. package/cjs/core/ThemeProvider/ThemeContext.d.ts +1 -1
  75. package/cjs/core/ThemeProvider/ThemeProvider.d.ts +2 -3
  76. package/cjs/core/ThemeProvider/ThemeProvider.js +14 -13
  77. package/cjs/core/Tile/Tile.js +2 -3
  78. package/cjs/core/TimePicker/TimePicker.js +13 -13
  79. package/cjs/core/Toast/Toast.d.ts +5 -10
  80. package/cjs/core/Toast/Toast.js +17 -16
  81. package/cjs/core/Toast/Toaster.d.ts +24 -26
  82. package/cjs/core/Toast/Toaster.js +91 -121
  83. package/cjs/core/Toast/index.d.ts +1 -4
  84. package/cjs/core/Toast/index.js +3 -6
  85. package/cjs/core/TransferList/TransferList.js +3 -4
  86. package/cjs/core/Tree/Tree.js +9 -13
  87. package/cjs/core/Tree/TreeNode.js +9 -10
  88. package/cjs/core/index.d.ts +1 -2
  89. package/cjs/core/index.js +2 -5
  90. package/cjs/core/utils/color/ColorValue.js +9 -15
  91. package/cjs/core/utils/components/AutoclearingHiddenLiveRegion.js +2 -3
  92. package/cjs/core/utils/components/FocusTrap.js +4 -4
  93. package/cjs/core/utils/components/MiddleTextTruncation.js +1 -2
  94. package/cjs/core/utils/components/Popover.d.ts +1 -1
  95. package/cjs/core/utils/components/Popover.js +5 -8
  96. package/cjs/core/utils/components/Resizer.js +7 -6
  97. package/cjs/core/utils/components/VirtualScroll.js +14 -21
  98. package/cjs/core/utils/functions/dom.d.ts +0 -8
  99. package/cjs/core/utils/functions/dom.js +3 -26
  100. package/cjs/core/utils/functions/polymorphic.d.ts +1 -1
  101. package/cjs/core/utils/functions/polymorphic.js +1 -1
  102. package/cjs/core/utils/functions/supports.js +1 -1
  103. package/cjs/core/utils/hooks/index.d.ts +0 -1
  104. package/cjs/core/utils/hooks/index.js +0 -1
  105. package/cjs/core/utils/hooks/useContainerWidth.js +1 -1
  106. package/cjs/core/utils/hooks/useDragAndDrop.js +8 -10
  107. package/cjs/core/utils/hooks/useEventListener.js +1 -1
  108. package/cjs/core/utils/hooks/useGlobals.d.ts +9 -2
  109. package/cjs/core/utils/hooks/useGlobals.js +6 -4
  110. package/cjs/core/utils/hooks/useId.js +1 -2
  111. package/cjs/core/utils/hooks/useIntersection.js +2 -3
  112. package/cjs/core/utils/hooks/useMediaQuery.js +6 -8
  113. package/cjs/core/utils/hooks/useOverflow.js +1 -2
  114. package/cjs/core/utils/hooks/useResizeObserver.js +3 -4
  115. package/cjs/styles.js +1 -4
  116. package/esm/core/Alert/Alert.d.ts +47 -28
  117. package/esm/core/Alert/Alert.js +74 -22
  118. package/esm/core/Avatar/Avatar.js +1 -1
  119. package/esm/core/AvatarGroup/AvatarGroup.js +1 -1
  120. package/esm/core/Breadcrumbs/Breadcrumbs.js +2 -3
  121. package/esm/core/ButtonGroup/ButtonGroup.js +1 -4
  122. package/esm/core/Buttons/DropdownButton/DropdownButton.js +3 -5
  123. package/esm/core/Carousel/Carousel.d.ts +2 -2
  124. package/esm/core/Carousel/Carousel.js +3 -5
  125. package/esm/core/Carousel/CarouselDotsList.js +8 -10
  126. package/esm/core/Carousel/CarouselNavigation.d.ts +2 -2
  127. package/esm/core/Carousel/CarouselNavigation.js +3 -5
  128. package/esm/core/Carousel/CarouselSlider.js +10 -15
  129. package/esm/core/ColorPicker/ColorBuilder.js +7 -10
  130. package/esm/core/ColorPicker/ColorInputPanel.js +12 -15
  131. package/esm/core/ColorPicker/ColorPalette.js +4 -6
  132. package/esm/core/ColorPicker/ColorPicker.js +3 -3
  133. package/esm/core/ComboBox/ComboBox.js +25 -32
  134. package/esm/core/ComboBox/ComboBoxDropdown.js +1 -2
  135. package/esm/core/ComboBox/ComboBoxEndIcon.js +1 -1
  136. package/esm/core/ComboBox/ComboBoxInput.js +21 -20
  137. package/esm/core/ComboBox/ComboBoxMenu.js +3 -4
  138. package/esm/core/ComboBox/ComboBoxMenuItem.js +2 -2
  139. package/esm/core/ComboBox/helpers.js +4 -5
  140. package/esm/core/DatePicker/DatePicker.js +32 -32
  141. package/esm/core/Dialog/Dialog.js +12 -5
  142. package/esm/core/Dialog/DialogBackdrop.js +1 -1
  143. package/esm/core/Dialog/DialogContext.d.ts +11 -0
  144. package/esm/core/Dialog/DialogMain.js +16 -22
  145. package/esm/core/DropdownMenu/DropdownMenu.js +6 -8
  146. package/esm/core/ExpandableBlock/ExpandableBlock.js +2 -2
  147. package/esm/core/FileUpload/FileEmptyCard.js +1 -1
  148. package/esm/core/FileUpload/FileUpload.d.ts +3 -4
  149. package/esm/core/FileUpload/FileUpload.js +5 -8
  150. package/esm/core/FileUpload/FileUploadCard.js +9 -10
  151. package/esm/core/FileUpload/FileUploadTemplate.d.ts +1 -0
  152. package/esm/core/FileUpload/FileUploadTemplate.js +1 -0
  153. package/esm/core/InformationPanel/InformationPanel.js +1 -4
  154. package/esm/core/LabeledInput/LabeledInput.js +1 -1
  155. package/esm/core/LabeledTextarea/LabeledTextarea.js +1 -1
  156. package/esm/core/Menu/Menu.js +3 -4
  157. package/esm/core/Menu/MenuItem.js +8 -11
  158. package/esm/core/Modal/Modal.d.ts +8 -9
  159. package/esm/core/Modal/Modal.js +3 -10
  160. package/esm/core/SearchBox/SearchBox.js +12 -12
  161. package/esm/core/Select/Select.js +12 -17
  162. package/esm/core/SideNavigation/SideNavigation.js +2 -2
  163. package/esm/core/Slider/Slider.js +16 -19
  164. package/esm/core/Slider/Thumb.js +1 -1
  165. package/esm/core/StatusMessage/StatusMessage.js +1 -1
  166. package/esm/core/Stepper/Stepper.js +1 -1
  167. package/esm/core/Stepper/StepperStep.js +1 -1
  168. package/esm/core/Table/Table.js +15 -15
  169. package/esm/core/Table/TablePaginator.js +2 -3
  170. package/esm/core/Table/TableRowMemoized.js +38 -45
  171. package/esm/core/Table/actionHandlers/expandHandler.js +3 -3
  172. package/esm/core/Table/actionHandlers/filterHandler.js +4 -5
  173. package/esm/core/Table/actionHandlers/selectHandler.js +6 -6
  174. package/esm/core/Table/cells/DefaultCell.js +1 -1
  175. package/esm/core/Table/cells/EditableCell.js +6 -12
  176. package/esm/core/Table/columns/actionColumn.js +3 -6
  177. package/esm/core/Table/columns/expanderColumn.js +3 -3
  178. package/esm/core/Table/columns/selectionColumn.js +4 -4
  179. package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.js +2 -4
  180. package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.js +2 -3
  181. package/esm/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +2 -3
  182. package/esm/core/Table/filters/TextFilter/TextFilter.js +1 -2
  183. package/esm/core/Table/hooks/useResizeColumns.js +16 -22
  184. package/esm/core/Table/hooks/useScrollToRow.js +1 -2
  185. package/esm/core/Table/hooks/useStickyColumns.js +3 -5
  186. package/esm/core/Table/hooks/useSubRowFiltering.js +2 -4
  187. package/esm/core/Tabs/Tabs.js +13 -16
  188. package/esm/core/ThemeProvider/ThemeContext.d.ts +1 -1
  189. package/esm/core/ThemeProvider/ThemeProvider.d.ts +2 -3
  190. package/esm/core/ThemeProvider/ThemeProvider.js +15 -14
  191. package/esm/core/Tile/Tile.js +2 -3
  192. package/esm/core/TimePicker/TimePicker.js +13 -13
  193. package/esm/core/Toast/Toast.d.ts +5 -10
  194. package/esm/core/Toast/Toast.js +18 -17
  195. package/esm/core/Toast/Toaster.d.ts +24 -26
  196. package/esm/core/Toast/Toaster.js +85 -121
  197. package/esm/core/Toast/index.d.ts +1 -4
  198. package/esm/core/Toast/index.js +1 -3
  199. package/esm/core/TransferList/TransferList.js +3 -4
  200. package/esm/core/Tree/Tree.js +9 -13
  201. package/esm/core/Tree/TreeNode.js +9 -10
  202. package/esm/core/index.d.ts +1 -2
  203. package/esm/core/index.js +1 -1
  204. package/esm/core/utils/color/ColorValue.js +9 -15
  205. package/esm/core/utils/components/AutoclearingHiddenLiveRegion.js +2 -3
  206. package/esm/core/utils/components/FocusTrap.js +4 -4
  207. package/esm/core/utils/components/MiddleTextTruncation.js +1 -2
  208. package/esm/core/utils/components/Popover.d.ts +1 -1
  209. package/esm/core/utils/components/Popover.js +5 -8
  210. package/esm/core/utils/components/Resizer.js +7 -6
  211. package/esm/core/utils/components/VirtualScroll.js +14 -21
  212. package/esm/core/utils/functions/dom.d.ts +0 -8
  213. package/esm/core/utils/functions/dom.js +2 -21
  214. package/esm/core/utils/functions/polymorphic.d.ts +1 -1
  215. package/esm/core/utils/functions/polymorphic.js +1 -1
  216. package/esm/core/utils/functions/supports.js +1 -1
  217. package/esm/core/utils/hooks/index.d.ts +0 -1
  218. package/esm/core/utils/hooks/index.js +0 -1
  219. package/esm/core/utils/hooks/useContainerWidth.js +1 -1
  220. package/esm/core/utils/hooks/useDragAndDrop.js +8 -10
  221. package/esm/core/utils/hooks/useEventListener.js +1 -1
  222. package/esm/core/utils/hooks/useGlobals.d.ts +9 -2
  223. package/esm/core/utils/hooks/useGlobals.js +6 -4
  224. package/esm/core/utils/hooks/useId.js +1 -2
  225. package/esm/core/utils/hooks/useIntersection.js +2 -3
  226. package/esm/core/utils/hooks/useMediaQuery.js +6 -8
  227. package/esm/core/utils/hooks/useOverflow.js +1 -2
  228. package/esm/core/utils/hooks/useResizeObserver.js +3 -4
  229. package/esm/styles.js +1 -4
  230. package/package.json +2 -2
  231. package/styles.css +19 -20
  232. package/cjs/core/Toast/ToastWrapper.d.ts +0 -10
  233. package/cjs/core/Toast/ToastWrapper.js +0 -49
  234. package/cjs/core/utils/hooks/useIsThemeAlreadySet.d.ts +0 -7
  235. package/cjs/core/utils/hooks/useIsThemeAlreadySet.js +0 -54
  236. package/esm/core/Toast/ToastWrapper.d.ts +0 -10
  237. package/esm/core/Toast/ToastWrapper.js +0 -20
  238. package/esm/core/utils/hooks/useIsThemeAlreadySet.d.ts +0 -7
  239. package/esm/core/utils/hooks/useIsThemeAlreadySet.js +0 -27
@@ -86,22 +86,20 @@ export const Tabs = (props) => {
86
86
  React.useEffect(() => {
87
87
  if (tablistRef.current && focusedIndex !== undefined) {
88
88
  const tab = tablistRef.current.querySelectorAll(`.${styles['iui-tab']}`)[focusedIndex];
89
- tab === null || tab === void 0 ? void 0 : tab.focus();
89
+ tab?.focus();
90
90
  }
91
91
  }, [focusedIndex]);
92
92
  const [hasSublabel, setHasSublabel] = React.useState(false); // used for setting size
93
93
  useIsomorphicLayoutEffect(() => {
94
- var _a;
95
94
  setHasSublabel(type !== 'pill' && // pill tabs should never have sublabels
96
- !!((_a = tablistRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(`.${styles['iui-tab-description']}`)));
95
+ !!tablistRef.current?.querySelector(`.${styles['iui-tab-description']}`));
97
96
  }, [type]);
98
97
  const enableHorizontalScroll = React.useCallback((e) => {
99
- var _a;
100
98
  const ownerDoc = tablistRef.current;
101
99
  if (ownerDoc === null) {
102
100
  return;
103
101
  }
104
- let scrollLeft = (_a = ownerDoc === null || ownerDoc === void 0 ? void 0 : ownerDoc.scrollLeft) !== null && _a !== void 0 ? _a : 0;
102
+ let scrollLeft = ownerDoc?.scrollLeft ?? 0;
105
103
  if (e.deltaY > 0 || e.deltaX > 0) {
106
104
  scrollLeft += 25;
107
105
  }
@@ -116,12 +114,12 @@ export const Tabs = (props) => {
116
114
  if (ownerDoc === null) {
117
115
  return;
118
116
  }
119
- if (!(overflowOptions === null || overflowOptions === void 0 ? void 0 : overflowOptions.useOverflow) || orientation === 'vertical') {
117
+ if (!overflowOptions?.useOverflow || orientation === 'vertical') {
120
118
  ownerDoc.removeEventListener('wheel', enableHorizontalScroll);
121
119
  return;
122
120
  }
123
121
  ownerDoc.addEventListener('wheel', enableHorizontalScroll);
124
- }, [overflowOptions === null || overflowOptions === void 0 ? void 0 : overflowOptions.useOverflow, orientation, enableHorizontalScroll]);
122
+ }, [overflowOptions?.useOverflow, orientation, enableHorizontalScroll]);
125
123
  const isTabHidden = (activeTab, isVertical) => {
126
124
  const ownerDoc = tablistRef.current;
127
125
  if (ownerDoc === null) {
@@ -201,7 +199,7 @@ export const Tabs = (props) => {
201
199
  setTimeout(() => {
202
200
  const ownerDoc = tablistRef.current;
203
201
  if (ownerDoc !== null &&
204
- (overflowOptions === null || overflowOptions === void 0 ? void 0 : overflowOptions.useOverflow) &&
202
+ overflowOptions?.useOverflow &&
205
203
  currentActiveIndex !== undefined) {
206
204
  const activeTab = ownerDoc.querySelectorAll(`.${styles['iui-tab']}`)[currentActiveIndex];
207
205
  const isVertical = orientation === 'vertical';
@@ -212,7 +210,7 @@ export const Tabs = (props) => {
212
210
  }
213
211
  }, 50);
214
212
  }, [
215
- overflowOptions === null || overflowOptions === void 0 ? void 0 : overflowOptions.useOverflow,
213
+ overflowOptions?.useOverflow,
216
214
  currentActiveIndex,
217
215
  focusedIndex,
218
216
  orientation,
@@ -248,19 +246,19 @@ export const Tabs = (props) => {
248
246
  }, [orientation, setScrollingPlacement]);
249
247
  // apply correct mask when tabs list is resized
250
248
  const [resizeRef] = useResizeObserver(determineScrollingPlacement);
251
- resizeRef(tablistRef === null || tablistRef === void 0 ? void 0 : tablistRef.current);
249
+ resizeRef(tablistRef?.current);
252
250
  // check if overflow tabs are scrolled to far edges
253
251
  React.useEffect(() => {
254
252
  const ownerDoc = tablistRef.current;
255
253
  if (ownerDoc === null) {
256
254
  return;
257
255
  }
258
- if (!(overflowOptions === null || overflowOptions === void 0 ? void 0 : overflowOptions.useOverflow)) {
256
+ if (!overflowOptions?.useOverflow) {
259
257
  ownerDoc.removeEventListener('scroll', determineScrollingPlacement);
260
258
  return;
261
259
  }
262
260
  ownerDoc.addEventListener('scroll', determineScrollingPlacement);
263
- }, [overflowOptions === null || overflowOptions === void 0 ? void 0 : overflowOptions.useOverflow, determineScrollingPlacement]);
261
+ }, [overflowOptions?.useOverflow, determineScrollingPlacement]);
264
262
  const onTabClick = React.useCallback((index) => {
265
263
  if (onTabSelected) {
266
264
  onTabSelected(index);
@@ -276,7 +274,7 @@ export const Tabs = (props) => {
276
274
  const tab = labels[index];
277
275
  return React.isValidElement(tab) && tab.props.disabled;
278
276
  };
279
- let newIndex = focusedIndex !== null && focusedIndex !== void 0 ? focusedIndex : currentActiveIndex;
277
+ let newIndex = focusedIndex ?? currentActiveIndex;
280
278
  /** focus next tab if delta is +1, previous tab if -1 */
281
279
  const focusTab = (delta = +1) => {
282
280
  do {
@@ -339,9 +337,8 @@ export const Tabs = (props) => {
339
337
  'aria-selected': index === currentActiveIndex,
340
338
  tabIndex: index === currentActiveIndex ? 0 : -1,
341
339
  onClick: (args) => {
342
- var _a, _b;
343
340
  onClick();
344
- (_b = (_a = label.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, args);
341
+ label.props.onClick?.(args);
345
342
  },
346
343
  }))));
347
344
  }, [currentActiveIndex, onTabClick]);
@@ -351,7 +348,7 @@ export const Tabs = (props) => {
351
348
  'iui-animated': type !== 'default' && isClient,
352
349
  'iui-not-animated': type !== 'default' && !isClient,
353
350
  'iui-large': hasSublabel,
354
- }, tabsClassName), "data-iui-overflow": overflowOptions === null || overflowOptions === void 0 ? void 0 : overflowOptions.useOverflow, "data-iui-scroll-placement": scrollingPlacement, role: 'tablist', ref: refs, onKeyDown: onKeyDown, ...rest }, labels.map((label, index) => createTab(label, index))),
351
+ }, tabsClassName), "data-iui-overflow": overflowOptions?.useOverflow, "data-iui-scroll-placement": scrollingPlacement, role: 'tablist', ref: refs, onKeyDown: onKeyDown, ...rest }, labels.map((label, index) => createTab(label, index))),
355
352
  actions && (React.createElement(Box, { className: 'iui-tabs-actions-wrapper' },
356
353
  React.createElement(Box, { className: 'iui-tabs-actions' }, actions))),
357
354
  children && (React.createElement(Box, { className: cx('iui-tabs-content', contentClassName), role: 'tabpanel' }, children))));
@@ -3,5 +3,5 @@ import type { ThemeOptions, ThemeType } from './ThemeProvider.js';
3
3
  export declare const ThemeContext: React.Context<{
4
4
  theme?: ThemeType | undefined;
5
5
  themeOptions?: ThemeOptions | undefined;
6
- rootRef: React.RefObject<HTMLElement>;
6
+ portalContainerRef?: React.RefObject<HTMLElement> | undefined;
7
7
  } | undefined>;
@@ -37,10 +37,9 @@ declare type RootProps = {
37
37
  applyBackground?: boolean;
38
38
  };
39
39
  /**
40
- * Whether theme was set to `'inherit'`.
41
- * This will be used to determine if applyBackground will default to false.
40
+ * This will be used to determine if background will be applied.
42
41
  */
43
- isInheritingTheme?: boolean;
42
+ shouldApplyBackground?: boolean;
44
43
  };
45
44
  declare type ThemeProviderOwnProps = Pick<RootProps, 'theme'> & {
46
45
  themeOptions?: RootProps['themeOptions'];
@@ -4,8 +4,9 @@
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  import * as React from 'react';
6
6
  import cx from 'classnames';
7
- import { useMediaQuery, useMergedRefs, useIsThemeAlreadySet, Box, } from '../utils/index.js';
7
+ import { useMediaQuery, useMergedRefs, Box } from '../utils/index.js';
8
8
  import { ThemeContext } from './ThemeContext.js';
9
+ import { ToastProvider, Toaster } from '../Toast/Toaster.js';
9
10
  /**
10
11
  * This component provides global styles and applies theme to the entire tree
11
12
  * that it is wrapping around. The `theme` prop is optional and defaults to the
@@ -33,28 +34,28 @@ import { ThemeContext } from './ThemeContext.js';
33
34
  * </ThemeProvider>
34
35
  */
35
36
  export const ThemeProvider = React.forwardRef((props, ref) => {
36
- var _a;
37
37
  const { theme: themeProp, children, themeOptions, ...rest } = props;
38
- const rootRef = React.useRef(null);
39
- const mergedRefs = useMergedRefs(rootRef, ref);
38
+ const portalContainerRef = React.useRef(null);
40
39
  const parentContext = React.useContext(ThemeContext);
41
- const theme = themeProp === 'inherit' ? (_a = parentContext === null || parentContext === void 0 ? void 0 : parentContext.theme) !== null && _a !== void 0 ? _a : 'light' : themeProp;
42
- const contextValue = React.useMemo(() => ({ theme, themeOptions, rootRef }), [theme, themeOptions]);
43
- // now that we know there are children, we can render the root and provide the context value
44
- return (React.createElement(Root, { theme: theme, isInheritingTheme: themeProp === 'inherit', themeOptions: themeOptions, ref: mergedRefs, ...rest },
45
- React.createElement(ThemeContext.Provider, { value: contextValue }, children)));
40
+ const theme = themeProp === 'inherit' ? parentContext?.theme ?? 'light' : themeProp;
41
+ const shouldApplyBackground = themeOptions?.applyBackground ??
42
+ (themeProp === 'inherit' ? false : !parentContext);
43
+ const contextValue = React.useMemo(() => ({ theme, themeOptions, portalContainerRef }), [theme, themeOptions]);
44
+ return (React.createElement(ThemeContext.Provider, { value: contextValue },
45
+ React.createElement(Root, { theme: theme, shouldApplyBackground: shouldApplyBackground, themeOptions: themeOptions, ref: ref, ...rest },
46
+ React.createElement(ToastProvider, null,
47
+ children,
48
+ React.createElement("div", { ref: portalContainerRef },
49
+ React.createElement(Toaster, null))))));
46
50
  });
47
51
  export default ThemeProvider;
48
52
  const Root = React.forwardRef((props, forwardedRef) => {
49
- var _a, _b, _c;
50
- const { theme, children, themeOptions, className, isInheritingTheme, ...rest } = props;
53
+ const { theme, children, themeOptions, shouldApplyBackground, className, ...rest } = props;
51
54
  const ref = React.useRef(null);
52
55
  const mergedRefs = useMergedRefs(ref, forwardedRef);
53
56
  const prefersDark = useMediaQuery('(prefers-color-scheme: dark)');
54
57
  const prefersHighContrast = useMediaQuery('(prefers-contrast: more)');
55
58
  const shouldApplyDark = theme === 'dark' || (theme === 'os' && prefersDark);
56
- const shouldApplyHC = (_a = themeOptions === null || themeOptions === void 0 ? void 0 : themeOptions.highContrast) !== null && _a !== void 0 ? _a : prefersHighContrast;
57
- const isThemeAlreadySet = useIsThemeAlreadySet((_b = ref.current) === null || _b === void 0 ? void 0 : _b.ownerDocument);
58
- const shouldApplyBackground = (_c = themeOptions === null || themeOptions === void 0 ? void 0 : themeOptions.applyBackground) !== null && _c !== void 0 ? _c : (isInheritingTheme ? false : !isThemeAlreadySet.current);
59
+ const shouldApplyHC = themeOptions?.highContrast ?? prefersHighContrast;
59
60
  return (React.createElement(Box, { className: cx('iui-root', { 'iui-root-background': shouldApplyBackground }, className), "data-iui-theme": shouldApplyDark ? 'dark' : 'light', "data-iui-contrast": shouldApplyHC ? 'high' : 'default', ref: mergedRefs, ...rest }, children));
60
61
  });
@@ -49,7 +49,7 @@ export const Tile = Object.assign(React.forwardRef((props, forwardedRef) => {
49
49
  const showMenu = React.useCallback(() => setIsMenuVisible(true), []);
50
50
  const hideMenu = React.useCallback(() => setIsMenuVisible(false), []);
51
51
  const [localActionable, setLocalActionable] = React.useState(isActionableProp);
52
- const isActionable = isActionableProp !== null && isActionableProp !== void 0 ? isActionableProp : localActionable;
52
+ const isActionable = isActionableProp ?? localActionable;
53
53
  const tileName = (React.createElement(Box, { className: 'iui-tile-name' },
54
54
  React.createElement(TitleIcon, { isLoading: isLoading, isSelected: isSelected, isNew: isNew, status: status }),
55
55
  React.createElement(Box, { as: 'span', className: 'iui-tile-name-label' }, isActionable && onClick ? (React.createElement(LinkAction, { as: 'button', onClick: !isDisabled ? onClick : undefined, "aria-disabled": isDisabled }, name)) : (name))));
@@ -84,9 +84,8 @@ export const Tile = Object.assign(React.forwardRef((props, forwardedRef) => {
84
84
  metadata != undefined && (React.createElement(Box, { className: 'iui-tile-metadata' }, metadata)),
85
85
  moreOptions && (React.createElement(DropdownMenu, { onShow: showMenu, onHide: hideMenu, menuItems: (close) => moreOptions.map((option) => React.cloneElement(option, {
86
86
  onClick: (value) => {
87
- var _a, _b;
88
87
  close();
89
- (_b = (_a = option.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, value);
88
+ option.props.onClick?.(value);
90
89
  },
91
90
  })) },
92
91
  React.createElement(Box, { className: cx('iui-tile-more-options', {
@@ -79,17 +79,17 @@ const defaultCombinedRenderer = (date, precision) => {
79
79
  export const TimePicker = React.forwardRef((props, forwardedRef) => {
80
80
  const { date, onChange, use12Hours = false, precision = 'minutes', hourStep = 1, minuteStep = 1, secondStep = 1, setFocusHour = false, hourRenderer = (date) => date.getHours().toLocaleString(undefined, { minimumIntegerDigits: 2 }), minuteRenderer = (date) => date.getMinutes().toLocaleString(undefined, { minimumIntegerDigits: 2 }), secondRenderer = (date) => date.getSeconds().toLocaleString(undefined, { minimumIntegerDigits: 2 }), meridiemRenderer = (meridiem) => meridiem, useCombinedRenderer = false, combinedRenderer = defaultCombinedRenderer, className, ...rest } = props;
81
81
  const [selectedTime, setSelectedTime] = React.useState(date);
82
- const [focusedTime, setFocusedTime] = React.useState(selectedTime !== null && selectedTime !== void 0 ? selectedTime : new Date());
83
- const [meridiem, setMeridiem] = React.useState(use12Hours ? ((focusedTime === null || focusedTime === void 0 ? void 0 : focusedTime.getHours()) > 11 ? 'PM' : 'AM') : undefined);
82
+ const [focusedTime, setFocusedTime] = React.useState(selectedTime ?? new Date());
83
+ const [meridiem, setMeridiem] = React.useState(use12Hours ? (focusedTime?.getHours() > 11 ? 'PM' : 'AM') : undefined);
84
84
  React.useEffect(() => {
85
- setFocusedTime(date !== null && date !== void 0 ? date : new Date());
85
+ setFocusedTime(date ?? new Date());
86
86
  setSelectedTime(date);
87
87
  }, [date]);
88
88
  const onHourClick = (date) => {
89
89
  const adjustedHour = use12Hours
90
90
  ? formatHourFrom12(date.getHours(), meridiem)
91
91
  : date.getHours();
92
- const adjustedSelectedTime = setHours(adjustedHour, selectedTime !== null && selectedTime !== void 0 ? selectedTime : new Date());
92
+ const adjustedSelectedTime = setHours(adjustedHour, selectedTime ?? new Date());
93
93
  updateCurrentTime(adjustedSelectedTime);
94
94
  };
95
95
  const onTimeClick = (date) => {
@@ -100,7 +100,7 @@ export const TimePicker = React.forwardRef((props, forwardedRef) => {
100
100
  updateCurrentTime(adjustedSelectedTime);
101
101
  };
102
102
  const onMeridiemClick = (value) => {
103
- let adjustedSelectedTime = selectedTime !== null && selectedTime !== void 0 ? selectedTime : new Date();
103
+ let adjustedSelectedTime = selectedTime ?? new Date();
104
104
  const currentHours = adjustedSelectedTime.getHours();
105
105
  setMeridiem(value);
106
106
  if (value === 'AM' && currentHours > 11) {
@@ -122,7 +122,7 @@ export const TimePicker = React.forwardRef((props, forwardedRef) => {
122
122
  }
123
123
  setFocusedTime(adjustedTime);
124
124
  setSelectedTime(adjustedTime);
125
- onChange === null || onChange === void 0 ? void 0 : onChange(adjustedTime);
125
+ onChange?.(adjustedTime);
126
126
  };
127
127
  const onHourFocus = (date) => {
128
128
  const adjustedHour = use12Hours
@@ -137,7 +137,7 @@ export const TimePicker = React.forwardRef((props, forwardedRef) => {
137
137
  setFocusedTime(setHours(adjustedHour, date));
138
138
  };
139
139
  const onMeridiemFocus = (value) => {
140
- let adjustedSelectedTime = selectedTime !== null && selectedTime !== void 0 ? selectedTime : new Date();
140
+ let adjustedSelectedTime = selectedTime ?? new Date();
141
141
  const currentHours = adjustedSelectedTime.getHours();
142
142
  if (value === 'AM' && currentHours > 11) {
143
143
  setMeridiem(value);
@@ -159,7 +159,7 @@ export const TimePicker = React.forwardRef((props, forwardedRef) => {
159
159
  return data;
160
160
  };
161
161
  const time = React.useMemo(() => {
162
- const time = selectedTime !== null && selectedTime !== void 0 ? selectedTime : new Date();
162
+ const time = selectedTime ?? new Date();
163
163
  const data = [];
164
164
  const hoursArray = Array.from(Array(use12Hours ? 12 : 24).keys())
165
165
  .filter((i) => i % hourStep === 0)
@@ -186,15 +186,15 @@ export const TimePicker = React.forwardRef((props, forwardedRef) => {
186
186
  return data;
187
187
  }, [hourStep, minuteStep, secondStep, selectedTime, use12Hours, precision]);
188
188
  const hours = React.useMemo(() => {
189
- const time = selectedTime !== null && selectedTime !== void 0 ? selectedTime : new Date();
189
+ const time = selectedTime ?? new Date();
190
190
  return generateDataList(use12Hours ? 12 : 24, (i) => new Date(time.getFullYear(), time.getMonth(), time.getDate(), use12Hours && i === 0 ? 12 : i, time.getMinutes(), time.getSeconds()), hourStep);
191
191
  }, [hourStep, selectedTime, use12Hours]);
192
192
  const minutes = React.useMemo(() => {
193
- const time = selectedTime !== null && selectedTime !== void 0 ? selectedTime : new Date();
193
+ const time = selectedTime ?? new Date();
194
194
  return generateDataList(60, (i) => new Date(time.getFullYear(), time.getMonth(), time.getDate(), time.getHours(), i, time.getSeconds()), minuteStep);
195
195
  }, [minuteStep, selectedTime]);
196
196
  const seconds = React.useMemo(() => {
197
- const time = selectedTime !== null && selectedTime !== void 0 ? selectedTime : new Date();
197
+ const time = selectedTime ?? new Date();
198
198
  return generateDataList(60, (i) => new Date(time.getFullYear(), time.getMonth(), time.getDate(), time.getHours(), time.getMinutes(), i), secondStep);
199
199
  }, [secondStep, selectedTime]);
200
200
  return (React.createElement(Box, { className: cx('iui-time-picker', className), ref: forwardedRef, ...rest },
@@ -215,7 +215,7 @@ const TimePickerColumn = (props) => {
215
215
  }
216
216
  });
217
217
  const scrollIntoView = (ref, isSame) => {
218
- isSame && (ref === null || ref === void 0 ? void 0 : ref.scrollIntoView({ block: 'nearest', inline: 'nearest' }));
218
+ isSame && ref?.scrollIntoView({ block: 'nearest', inline: 'nearest' });
219
219
  };
220
220
  const handleTimeKeyDown = (event, maxValue, onFocus, onSelect, currentValue) => {
221
221
  if (event.altKey) {
@@ -255,7 +255,7 @@ const TimePickerColumn = (props) => {
255
255
  'iui-selected': isSameSelected(value),
256
256
  }), key: index, tabIndex: isSameFocus ? 0 : undefined, ref: (ref) => {
257
257
  scrollIntoView(ref, isSameFocus);
258
- needFocus.current && isSameFocus && (ref === null || ref === void 0 ? void 0 : ref.focus());
258
+ needFocus.current && isSameFocus && ref?.focus();
259
259
  }, onClick: () => {
260
260
  onSelectChange(value);
261
261
  } }, valueRenderer(value, precision)));
@@ -22,10 +22,9 @@ export declare type ToastProps = {
22
22
  */
23
23
  type?: 'persisting' | 'temporary';
24
24
  /**
25
- * Boolean indicating when the toast is visible.
26
- * When false, will close the Toast and call onRemove when finished closing.
25
+ * Controlled boolean prop indicating whether the toast is visible.
27
26
  */
28
- isVisible: boolean;
27
+ isVisible?: boolean;
29
28
  /**
30
29
  * Duration of the toast in millisecond.
31
30
  * @default 7000
@@ -37,12 +36,12 @@ export declare type ToastProps = {
37
36
  */
38
37
  hasCloseButton?: boolean;
39
38
  /**
40
- * A Callback that can be used to add additional information to a Toast
39
+ * Props for a button/link that can be used to perform an action
40
+ * (e.g. to show additional information).
41
41
  */
42
42
  link?: {
43
- onClick: () => void;
44
43
  title: string;
45
- };
44
+ } & Omit<React.ComponentPropsWithoutRef<'button'>, 'children'>;
46
45
  /**
47
46
  * Function called when the toast is all the way closed.
48
47
  */
@@ -51,10 +50,6 @@ export declare type ToastProps = {
51
50
  * Element to which the toast will animate out to.
52
51
  */
53
52
  animateOutTo?: HTMLElement | null;
54
- /**
55
- * Parent toaster placement position for smoother animation.
56
- */
57
- placementPosition?: 'top' | 'bottom';
58
53
  };
59
54
  /**
60
55
  * Generic Toast Component
@@ -5,9 +5,10 @@
5
5
  import * as React from 'react';
6
6
  import { Transition } from 'react-transition-group';
7
7
  import cx from 'classnames';
8
- import { getWindow, StatusIconMap, SvgCloseSmall, Box, } from '../utils/index.js';
8
+ import { getWindow, StatusIconMap, SvgCloseSmall, Box, useSafeContext, } from '../utils/index.js';
9
9
  import { IconButton } from '../Buttons/index.js';
10
- const isMotionOk = () => { var _a, _b, _c; return (_c = (_b = (_a = getWindow()) === null || _a === void 0 ? void 0 : _a.matchMedia) === null || _b === void 0 ? void 0 : _b.call(_a, '(prefers-reduced-motion: no-preference)')) === null || _c === void 0 ? void 0 : _c.matches; };
10
+ import { ToasterStateContext } from './Toaster.js';
11
+ const isMotionOk = () => getWindow()?.matchMedia?.('(prefers-reduced-motion: no-preference)')?.matches;
11
12
  /**
12
13
  * Generic Toast Component
13
14
  * @example
@@ -17,9 +18,12 @@ const isMotionOk = () => { var _a, _b, _c; return (_c = (_b = (_a = getWindow())
17
18
  * <Toast type='persisting' content='Job processing error.' category='negative' />
18
19
  */
19
20
  export const Toast = (props) => {
20
- const { content, category, type = 'temporary', isVisible, link, duration = 7000, hasCloseButton, onRemove, animateOutTo, placementPosition = 'top', } = props;
21
+ const { content, category, type = 'temporary', isVisible: isVisibleProp, link, duration = 7000, hasCloseButton, onRemove, animateOutTo, } = props;
21
22
  const closeTimeout = React.useRef(0);
22
- const [visible, setVisible] = React.useState(isVisible);
23
+ const { placement } = useSafeContext(ToasterStateContext).settings;
24
+ const placementPosition = placement.startsWith('top') ? 'top' : 'bottom';
25
+ const [visible, setVisible] = React.useState(isVisibleProp ?? true);
26
+ const isVisible = isVisibleProp ?? visible;
23
27
  const [height, setHeight] = React.useState(0);
24
28
  const thisElement = React.useRef(null);
25
29
  const [margin, setMargin] = React.useState(0);
@@ -38,9 +42,6 @@ export const Toast = (props) => {
38
42
  };
39
43
  // eslint-disable-next-line react-hooks/exhaustive-deps
40
44
  }, [duration, type]);
41
- React.useEffect(() => {
42
- setVisible(isVisible);
43
- }, [isVisible]);
44
45
  React.useEffect(() => {
45
46
  // if we don't have animateOutTo point and not isVisible, set negative margin to move other toasts up.
46
47
  // Close all and close on toasts with no anchor.
@@ -64,8 +65,7 @@ export const Toast = (props) => {
64
65
  }, timeout);
65
66
  };
66
67
  const clearCloseTimeout = () => {
67
- var _a;
68
- (_a = getWindow()) === null || _a === void 0 ? void 0 : _a.clearTimeout(closeTimeout.current);
68
+ getWindow()?.clearTimeout(closeTimeout.current);
69
69
  };
70
70
  const onRef = (ref) => {
71
71
  if (ref) {
@@ -85,7 +85,7 @@ export const Toast = (props) => {
85
85
  }
86
86
  return { translateX, translateY };
87
87
  };
88
- return (React.createElement(Transition, { timeout: { enter: 240, exit: animateOutTo ? 400 : 120 }, in: visible, appear: true, unmountOnExit: true, onEnter: (node) => {
88
+ return (React.createElement(Transition, { timeout: { enter: 240, exit: animateOutTo ? 400 : 120 }, in: isVisible, appear: true, unmountOnExit: true, onEnter: (node) => {
89
89
  if (isMotionOk()) {
90
90
  node.style.transform = 'translateY(15%)';
91
91
  node.style.transitionTimingFunction = 'ease';
@@ -104,12 +104,13 @@ export const Toast = (props) => {
104
104
  node.style.transitionDuration = animateOutTo ? '400ms' : '120ms';
105
105
  node.style.transitionTimingFunction = 'cubic-bezier(0.4, 0, 1, 1)';
106
106
  }
107
- }, onExited: onRemove }, React.createElement(Box, { ref: thisElement, className: 'iui-toast-all', style: {
108
- height,
109
- ...marginStyle(),
110
- } },
111
- React.createElement("div", { ref: onRef },
112
- React.createElement(ToastPresentation, { category: category, content: content, link: link, type: type, hasCloseButton: hasCloseButton, onClose: close })))));
107
+ }, onExited: onRemove },
108
+ React.createElement(Box, { ref: thisElement, className: 'iui-toast-all', style: {
109
+ height,
110
+ ...marginStyle(),
111
+ } },
112
+ React.createElement("div", { ref: onRef },
113
+ React.createElement(ToastPresentation, { category: category, content: content, link: link, type: type, hasCloseButton: hasCloseButton, onClose: close })))));
113
114
  };
114
115
  /**
115
116
  * The presentational part of a toast, without any animation or logic.
@@ -121,7 +122,7 @@ export const ToastPresentation = (props) => {
121
122
  return (React.createElement(Box, { className: cx(`iui-toast iui-${category}`, className), ...rest },
122
123
  React.createElement(Box, { className: 'iui-status-area' }, React.createElement(StatusIcon, { className: 'iui-icon' })),
123
124
  React.createElement(Box, { className: 'iui-message' }, content),
124
- link && (React.createElement(Box, { as: 'a', className: 'iui-toast-anchor', onClick: link.onClick }, link.title)),
125
+ link && (React.createElement(Box, { as: 'button', className: 'iui-toast-anchor', ...link, title: undefined }, link.title)),
125
126
  (type === 'persisting' || hasCloseButton) && (React.createElement(IconButton, { size: 'small', styleType: 'borderless', onClick: onClose, "aria-label": 'Close' },
126
127
  React.createElement(SvgCloseSmall, null)))));
127
128
  };
@@ -4,45 +4,43 @@ export declare type ToasterSettings = {
4
4
  /**
5
5
  * Order of toasts.
6
6
  * When set to 'descending', most recent toasts are on top. When set to 'ascending', most recent toasts are on bottom.
7
-
8
- * When `placement` is set to a top value, order defaults to 'descending', otherwise 'ascending'.
7
+ *
8
+ * When set to `auto`, it will behave like 'descending' when `placement` is set to a top value, otherwise 'ascending'.
9
+ *
10
+ * @default 'auto'
9
11
  */
10
- order?: 'descending' | 'ascending';
12
+ order: 'descending' | 'ascending' | 'auto';
11
13
  /**
12
14
  * Placement of toasts.
13
15
  * Changes placement of toasts. Start indicates left side of viewport. End - right side of viewport.
14
16
  * @default 'top'
15
17
  */
16
- placement?: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end';
18
+ placement: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end';
17
19
  };
18
20
  export declare type ToastOptions = Omit<ToastProps, 'category' | 'isVisible' | 'id' | 'content'>;
19
- export default class Toaster {
20
- private toasts;
21
- private lastId;
22
- private settings;
23
- private toastsRef;
24
- private isInitialized;
25
- private asyncInit;
26
- /**
27
- * Set global Toaster settings for toasts order and placement.
28
- * Settings will be applied to new toasts on the page.
29
- */
30
- setSettings(newSettings: ToasterSettings): void;
31
- positive(content: React.ReactNode, options?: ToastOptions): {
21
+ export declare const useToaster: () => {
22
+ positive: (content: React.ReactNode, options?: ToastOptions) => {
32
23
  close: () => void;
33
24
  };
34
- informational(content: React.ReactNode, options?: ToastOptions): {
25
+ informational: (content: React.ReactNode, options?: ToastOptions) => {
35
26
  close: () => void;
36
27
  };
37
- negative(content: React.ReactNode, options?: ToastOptions): {
28
+ negative: (content: React.ReactNode, options?: ToastOptions) => {
38
29
  close: () => void;
39
30
  };
40
- warning(content: React.ReactNode, options?: ToastOptions): {
31
+ warning: (content: React.ReactNode, options?: ToastOptions) => {
41
32
  close: () => void;
42
33
  };
43
- private createToast;
44
- private removeToast;
45
- private updateView;
46
- private closeToast;
47
- closeAll(): void;
48
- }
34
+ closeAll: () => void;
35
+ setSettings: (settings: Partial<ToasterSettings>) => void;
36
+ };
37
+ export declare const Toaster: () => JSX.Element;
38
+ export declare const ToastProvider: ({ children }: {
39
+ children: React.ReactNode;
40
+ }) => JSX.Element;
41
+ export declare const ToasterStateContext: React.Context<ToasterState | undefined>;
42
+ declare type ToasterState = {
43
+ toasts: ToastProps[];
44
+ settings: ToasterSettings;
45
+ };
46
+ export {};