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

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 (211) hide show
  1. package/CHANGELOG.md +18 -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.js +3 -6
  35. package/cjs/core/FileUpload/FileUploadCard.js +9 -10
  36. package/cjs/core/InformationPanel/InformationPanel.js +1 -4
  37. package/cjs/core/LabeledInput/LabeledInput.js +1 -1
  38. package/cjs/core/LabeledTextarea/LabeledTextarea.js +1 -1
  39. package/cjs/core/Menu/Menu.js +3 -4
  40. package/cjs/core/Menu/MenuItem.js +8 -11
  41. package/cjs/core/Modal/Modal.d.ts +8 -9
  42. package/cjs/core/Modal/Modal.js +7 -17
  43. package/cjs/core/SearchBox/SearchBox.js +12 -12
  44. package/cjs/core/Select/Select.js +12 -17
  45. package/cjs/core/SideNavigation/SideNavigation.js +2 -2
  46. package/cjs/core/Slider/Slider.js +16 -19
  47. package/cjs/core/Slider/Thumb.js +1 -1
  48. package/cjs/core/StatusMessage/StatusMessage.js +1 -1
  49. package/cjs/core/Stepper/Stepper.js +1 -1
  50. package/cjs/core/Stepper/StepperStep.js +1 -1
  51. package/cjs/core/Table/Table.js +15 -15
  52. package/cjs/core/Table/TablePaginator.js +2 -3
  53. package/cjs/core/Table/TableRowMemoized.js +38 -45
  54. package/cjs/core/Table/actionHandlers/expandHandler.js +3 -3
  55. package/cjs/core/Table/actionHandlers/filterHandler.js +4 -5
  56. package/cjs/core/Table/actionHandlers/selectHandler.js +6 -6
  57. package/cjs/core/Table/cells/DefaultCell.js +1 -1
  58. package/cjs/core/Table/cells/EditableCell.js +6 -12
  59. package/cjs/core/Table/columns/actionColumn.js +3 -6
  60. package/cjs/core/Table/columns/expanderColumn.js +3 -3
  61. package/cjs/core/Table/columns/selectionColumn.js +4 -4
  62. package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.js +2 -4
  63. package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.js +2 -3
  64. package/cjs/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +2 -3
  65. package/cjs/core/Table/filters/TextFilter/TextFilter.js +1 -2
  66. package/cjs/core/Table/hooks/useResizeColumns.js +16 -22
  67. package/cjs/core/Table/hooks/useScrollToRow.js +1 -2
  68. package/cjs/core/Table/hooks/useStickyColumns.js +3 -5
  69. package/cjs/core/Table/hooks/useSubRowFiltering.js +2 -4
  70. package/cjs/core/Tabs/Tabs.js +13 -16
  71. package/cjs/core/ThemeProvider/ThemeContext.d.ts +1 -1
  72. package/cjs/core/ThemeProvider/ThemeProvider.d.ts +2 -3
  73. package/cjs/core/ThemeProvider/ThemeProvider.js +11 -13
  74. package/cjs/core/Tile/Tile.js +2 -3
  75. package/cjs/core/TimePicker/TimePicker.js +13 -13
  76. package/cjs/core/Toast/Toast.js +2 -3
  77. package/cjs/core/Toast/Toaster.js +6 -11
  78. package/cjs/core/TransferList/TransferList.js +3 -4
  79. package/cjs/core/Tree/Tree.js +9 -13
  80. package/cjs/core/Tree/TreeNode.js +9 -10
  81. package/cjs/core/utils/color/ColorValue.js +9 -15
  82. package/cjs/core/utils/components/AutoclearingHiddenLiveRegion.js +2 -3
  83. package/cjs/core/utils/components/FocusTrap.js +4 -4
  84. package/cjs/core/utils/components/MiddleTextTruncation.js +1 -2
  85. package/cjs/core/utils/components/Popover.js +5 -8
  86. package/cjs/core/utils/components/Resizer.js +7 -6
  87. package/cjs/core/utils/components/VirtualScroll.js +14 -21
  88. package/cjs/core/utils/functions/dom.js +5 -5
  89. package/cjs/core/utils/functions/polymorphic.js +1 -1
  90. package/cjs/core/utils/functions/supports.js +1 -1
  91. package/cjs/core/utils/hooks/index.d.ts +0 -1
  92. package/cjs/core/utils/hooks/index.js +0 -1
  93. package/cjs/core/utils/hooks/useContainerWidth.js +1 -1
  94. package/cjs/core/utils/hooks/useDragAndDrop.js +8 -10
  95. package/cjs/core/utils/hooks/useEventListener.js +1 -1
  96. package/cjs/core/utils/hooks/useGlobals.d.ts +9 -2
  97. package/cjs/core/utils/hooks/useGlobals.js +6 -4
  98. package/cjs/core/utils/hooks/useId.js +1 -2
  99. package/cjs/core/utils/hooks/useIntersection.js +2 -3
  100. package/cjs/core/utils/hooks/useMediaQuery.js +6 -8
  101. package/cjs/core/utils/hooks/useOverflow.js +1 -2
  102. package/cjs/core/utils/hooks/useResizeObserver.js +3 -4
  103. package/cjs/styles.js +1 -4
  104. package/esm/core/Alert/Alert.d.ts +47 -28
  105. package/esm/core/Alert/Alert.js +74 -22
  106. package/esm/core/Avatar/Avatar.js +1 -1
  107. package/esm/core/AvatarGroup/AvatarGroup.js +1 -1
  108. package/esm/core/Breadcrumbs/Breadcrumbs.js +2 -3
  109. package/esm/core/ButtonGroup/ButtonGroup.js +1 -4
  110. package/esm/core/Buttons/DropdownButton/DropdownButton.js +3 -5
  111. package/esm/core/Carousel/Carousel.d.ts +2 -2
  112. package/esm/core/Carousel/Carousel.js +3 -5
  113. package/esm/core/Carousel/CarouselDotsList.js +8 -10
  114. package/esm/core/Carousel/CarouselNavigation.d.ts +2 -2
  115. package/esm/core/Carousel/CarouselNavigation.js +3 -5
  116. package/esm/core/Carousel/CarouselSlider.js +10 -15
  117. package/esm/core/ColorPicker/ColorBuilder.js +7 -10
  118. package/esm/core/ColorPicker/ColorInputPanel.js +12 -15
  119. package/esm/core/ColorPicker/ColorPalette.js +4 -6
  120. package/esm/core/ColorPicker/ColorPicker.js +3 -3
  121. package/esm/core/ComboBox/ComboBox.js +25 -32
  122. package/esm/core/ComboBox/ComboBoxDropdown.js +1 -2
  123. package/esm/core/ComboBox/ComboBoxEndIcon.js +1 -1
  124. package/esm/core/ComboBox/ComboBoxInput.js +21 -20
  125. package/esm/core/ComboBox/ComboBoxMenu.js +3 -4
  126. package/esm/core/ComboBox/ComboBoxMenuItem.js +2 -2
  127. package/esm/core/ComboBox/helpers.js +4 -5
  128. package/esm/core/DatePicker/DatePicker.js +32 -32
  129. package/esm/core/Dialog/Dialog.js +12 -5
  130. package/esm/core/Dialog/DialogBackdrop.js +1 -1
  131. package/esm/core/Dialog/DialogContext.d.ts +11 -0
  132. package/esm/core/Dialog/DialogMain.js +16 -22
  133. package/esm/core/DropdownMenu/DropdownMenu.js +6 -8
  134. package/esm/core/ExpandableBlock/ExpandableBlock.js +2 -2
  135. package/esm/core/FileUpload/FileEmptyCard.js +1 -1
  136. package/esm/core/FileUpload/FileUpload.js +3 -6
  137. package/esm/core/FileUpload/FileUploadCard.js +9 -10
  138. package/esm/core/InformationPanel/InformationPanel.js +1 -4
  139. package/esm/core/LabeledInput/LabeledInput.js +1 -1
  140. package/esm/core/LabeledTextarea/LabeledTextarea.js +1 -1
  141. package/esm/core/Menu/Menu.js +3 -4
  142. package/esm/core/Menu/MenuItem.js +8 -11
  143. package/esm/core/Modal/Modal.d.ts +8 -9
  144. package/esm/core/Modal/Modal.js +3 -10
  145. package/esm/core/SearchBox/SearchBox.js +12 -12
  146. package/esm/core/Select/Select.js +12 -17
  147. package/esm/core/SideNavigation/SideNavigation.js +2 -2
  148. package/esm/core/Slider/Slider.js +16 -19
  149. package/esm/core/Slider/Thumb.js +1 -1
  150. package/esm/core/StatusMessage/StatusMessage.js +1 -1
  151. package/esm/core/Stepper/Stepper.js +1 -1
  152. package/esm/core/Stepper/StepperStep.js +1 -1
  153. package/esm/core/Table/Table.js +15 -15
  154. package/esm/core/Table/TablePaginator.js +2 -3
  155. package/esm/core/Table/TableRowMemoized.js +38 -45
  156. package/esm/core/Table/actionHandlers/expandHandler.js +3 -3
  157. package/esm/core/Table/actionHandlers/filterHandler.js +4 -5
  158. package/esm/core/Table/actionHandlers/selectHandler.js +6 -6
  159. package/esm/core/Table/cells/DefaultCell.js +1 -1
  160. package/esm/core/Table/cells/EditableCell.js +6 -12
  161. package/esm/core/Table/columns/actionColumn.js +3 -6
  162. package/esm/core/Table/columns/expanderColumn.js +3 -3
  163. package/esm/core/Table/columns/selectionColumn.js +4 -4
  164. package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.js +2 -4
  165. package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.js +2 -3
  166. package/esm/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +2 -3
  167. package/esm/core/Table/filters/TextFilter/TextFilter.js +1 -2
  168. package/esm/core/Table/hooks/useResizeColumns.js +16 -22
  169. package/esm/core/Table/hooks/useScrollToRow.js +1 -2
  170. package/esm/core/Table/hooks/useStickyColumns.js +3 -5
  171. package/esm/core/Table/hooks/useSubRowFiltering.js +2 -4
  172. package/esm/core/Tabs/Tabs.js +13 -16
  173. package/esm/core/ThemeProvider/ThemeContext.d.ts +1 -1
  174. package/esm/core/ThemeProvider/ThemeProvider.d.ts +2 -3
  175. package/esm/core/ThemeProvider/ThemeProvider.js +12 -14
  176. package/esm/core/Tile/Tile.js +2 -3
  177. package/esm/core/TimePicker/TimePicker.js +13 -13
  178. package/esm/core/Toast/Toast.js +2 -3
  179. package/esm/core/Toast/Toaster.js +6 -11
  180. package/esm/core/TransferList/TransferList.js +3 -4
  181. package/esm/core/Tree/Tree.js +9 -13
  182. package/esm/core/Tree/TreeNode.js +9 -10
  183. package/esm/core/utils/color/ColorValue.js +9 -15
  184. package/esm/core/utils/components/AutoclearingHiddenLiveRegion.js +2 -3
  185. package/esm/core/utils/components/FocusTrap.js +4 -4
  186. package/esm/core/utils/components/MiddleTextTruncation.js +1 -2
  187. package/esm/core/utils/components/Popover.js +5 -8
  188. package/esm/core/utils/components/Resizer.js +7 -6
  189. package/esm/core/utils/components/VirtualScroll.js +14 -21
  190. package/esm/core/utils/functions/dom.js +5 -5
  191. package/esm/core/utils/functions/polymorphic.js +1 -1
  192. package/esm/core/utils/functions/supports.js +1 -1
  193. package/esm/core/utils/hooks/index.d.ts +0 -1
  194. package/esm/core/utils/hooks/index.js +0 -1
  195. package/esm/core/utils/hooks/useContainerWidth.js +1 -1
  196. package/esm/core/utils/hooks/useDragAndDrop.js +8 -10
  197. package/esm/core/utils/hooks/useEventListener.js +1 -1
  198. package/esm/core/utils/hooks/useGlobals.d.ts +9 -2
  199. package/esm/core/utils/hooks/useGlobals.js +6 -4
  200. package/esm/core/utils/hooks/useId.js +1 -2
  201. package/esm/core/utils/hooks/useIntersection.js +2 -3
  202. package/esm/core/utils/hooks/useMediaQuery.js +6 -8
  203. package/esm/core/utils/hooks/useOverflow.js +1 -2
  204. package/esm/core/utils/hooks/useResizeObserver.js +3 -4
  205. package/esm/styles.js +1 -4
  206. package/package.json +2 -2
  207. package/styles.css +18 -20
  208. package/cjs/core/utils/hooks/useIsThemeAlreadySet.d.ts +0 -7
  209. package/cjs/core/utils/hooks/useIsThemeAlreadySet.js +0 -54
  210. package/esm/core/utils/hooks/useIsThemeAlreadySet.d.ts +0 -7
  211. package/esm/core/utils/hooks/useIsThemeAlreadySet.js +0 -27
@@ -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)));
@@ -7,7 +7,7 @@ import { Transition } from 'react-transition-group';
7
7
  import cx from 'classnames';
8
8
  import { getWindow, StatusIconMap, SvgCloseSmall, Box, } 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
+ const isMotionOk = () => getWindow()?.matchMedia?.('(prefers-reduced-motion: no-preference)')?.matches;
11
11
  /**
12
12
  * Generic Toast Component
13
13
  * @example
@@ -64,8 +64,7 @@ export const Toast = (props) => {
64
64
  }, timeout);
65
65
  };
66
66
  const clearCloseTimeout = () => {
67
- var _a;
68
- (_a = getWindow()) === null || _a === void 0 ? void 0 : _a.clearTimeout(closeTimeout.current);
67
+ getWindow()?.clearTimeout(closeTimeout.current);
69
68
  };
70
69
  const onRef = (ref) => {
71
70
  if (ref) {
@@ -20,11 +20,10 @@ export default class Toaster {
20
20
  // Create container on demand.
21
21
  // Cannot do it in constructor, because SSG/SSR apps would fail.
22
22
  this.asyncInit = async () => {
23
- var _a, _b;
24
23
  if (this.isInitialized) {
25
24
  return;
26
25
  }
27
- const container = (_a = getContainer(TOASTS_CONTAINER_ID)) !== null && _a !== void 0 ? _a : (_b = getDocument()) === null || _b === void 0 ? void 0 : _b.body;
26
+ const container = getContainer(TOASTS_CONTAINER_ID) ?? getDocument()?.body;
28
27
  if (!container) {
29
28
  return;
30
29
  }
@@ -56,15 +55,13 @@ export default class Toaster {
56
55
  * Settings will be applied to new toasts on the page.
57
56
  */
58
57
  setSettings(newSettings) {
59
- var _a, _b, _c;
60
- (_a = newSettings.placement) !== null && _a !== void 0 ? _a : (newSettings.placement = this.settings.placement);
61
- (_b = newSettings.order) !== null && _b !== void 0 ? _b : (newSettings.order = ((_c = newSettings.placement) === null || _c === void 0 ? void 0 : _c.startsWith('bottom'))
58
+ newSettings.placement ?? (newSettings.placement = this.settings.placement);
59
+ newSettings.order ?? (newSettings.order = newSettings.placement?.startsWith('bottom')
62
60
  ? 'ascending'
63
61
  : 'descending');
64
62
  this.settings = newSettings;
65
63
  this.asyncInit().then(() => {
66
- var _a, _b;
67
- (_a = this.toastsRef.current) === null || _a === void 0 ? void 0 : _a.setPlacement((_b = this.settings.placement) !== null && _b !== void 0 ? _b : 'top');
64
+ this.toastsRef.current?.setPlacement(this.settings.placement ?? 'top');
68
65
  });
69
66
  }
70
67
  positive(content, options) {
@@ -89,9 +86,8 @@ export default class Toaster {
89
86
  content,
90
87
  category,
91
88
  onRemove: () => {
92
- var _a;
93
89
  this.removeToast(currentId);
94
- (_a = options === null || options === void 0 ? void 0 : options.onRemove) === null || _a === void 0 ? void 0 : _a.call(options);
90
+ options?.onRemove?.();
95
91
  },
96
92
  id: currentId,
97
93
  isVisible: true,
@@ -107,8 +103,7 @@ export default class Toaster {
107
103
  }
108
104
  updateView() {
109
105
  this.asyncInit().then(() => {
110
- var _a;
111
- (_a = this.toastsRef.current) === null || _a === void 0 ? void 0 : _a.setToasts(this.toasts);
106
+ this.toastsRef.current?.setToasts(this.toasts);
112
107
  });
113
108
  }
114
109
  closeToast(toastId) {
@@ -30,10 +30,9 @@ const TransferListListbox = React.forwardRef((props, ref) => {
30
30
  return focusableItems.filter((i) => !focusableItems.some((p) => p.contains(i.parentElement)));
31
31
  }, []);
32
32
  React.useEffect(() => {
33
- var _a;
34
33
  const items = getFocusableNodes();
35
34
  if (focusedIndex != null) {
36
- (_a = items === null || items === void 0 ? void 0 : items[focusedIndex]) === null || _a === void 0 ? void 0 : _a.focus();
35
+ items?.[focusedIndex]?.focus();
37
36
  return;
38
37
  }
39
38
  }, [focusedIndex, getFocusableNodes]);
@@ -42,10 +41,10 @@ const TransferListListbox = React.forwardRef((props, ref) => {
42
41
  return;
43
42
  }
44
43
  const items = getFocusableNodes();
45
- if (!(items === null || items === void 0 ? void 0 : items.length)) {
44
+ if (!items?.length) {
46
45
  return;
47
46
  }
48
- const currentIndex = focusedIndex !== null && focusedIndex !== void 0 ? focusedIndex : 0;
47
+ const currentIndex = focusedIndex ?? 0;
49
48
  switch (event.key) {
50
49
  case 'ArrowDown': {
51
50
  setFocusedIndex(Math.min(currentIndex + 1, items.length - 1));
@@ -73,10 +73,10 @@ export const Tree = (props) => {
73
73
  return;
74
74
  }
75
75
  const items = getFocusableNodes();
76
- if (!(items === null || items === void 0 ? void 0 : items.length)) {
76
+ if (!items?.length) {
77
77
  return;
78
78
  }
79
- const activeIndex = items.findIndex((el) => { var _a; return el.contains((_a = treeRef.current) === null || _a === void 0 ? void 0 : _a.ownerDocument.activeElement); });
79
+ const activeIndex = items.findIndex((el) => el.contains(treeRef.current?.ownerDocument.activeElement));
80
80
  const currentIndex = activeIndex > -1 ? activeIndex : 0;
81
81
  switch (event.key) {
82
82
  case 'ArrowUp': {
@@ -126,20 +126,18 @@ export const Tree = (props) => {
126
126
  return [flatList, firstLevelNodes];
127
127
  }, [data, getNode]);
128
128
  const itemRenderer = React.useCallback((index) => {
129
- var _a, _b, _c, _d;
130
129
  const node = flatNodesList[index];
131
130
  return (React.createElement(TreeContext.Provider, { key: node.nodeProps.nodeId, value: {
132
131
  nodeDepth: node.depth,
133
132
  subNodeIds: node.subNodeIds,
134
133
  groupSize: node.depth === 0
135
134
  ? firstLevelNodesList.length
136
- : (_c = (_b = (_a = node.parentNode) === null || _a === void 0 ? void 0 : _a.subNodeIds) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0,
135
+ : node.parentNode?.subNodeIds?.length ?? 0,
137
136
  indexInGroup: node.indexInGroup,
138
- parentNodeId: (_d = node.parentNode) === null || _d === void 0 ? void 0 : _d.nodeProps.nodeId,
137
+ parentNodeId: node.parentNode?.nodeProps.nodeId,
139
138
  scrollToParent: node.parentNode
140
139
  ? () => {
141
- var _a;
142
- const parentNodeId = (_a = node.parentNode) === null || _a === void 0 ? void 0 : _a.nodeProps.nodeId;
140
+ const parentNodeId = node.parentNode?.nodeProps.nodeId;
143
141
  const parentNodeIndex = flatNodesList.findIndex((n) => n.nodeProps.nodeId === parentNodeId);
144
142
  setScrollToIndex(parentNodeIndex);
145
143
  }
@@ -153,11 +151,10 @@ export const Tree = (props) => {
153
151
  }, [flatNodesList]);
154
152
  React.useEffect(() => {
155
153
  setTimeout(() => {
156
- var _a;
157
154
  if (scrollToIndex !== undefined) {
158
155
  const nodeId = flatNodesListRef.current[scrollToIndex].nodeProps.nodeId;
159
- const nodeElement = (_a = treeRef.current) === null || _a === void 0 ? void 0 : _a.ownerDocument.querySelector(`#${nodeId}`);
160
- nodeElement === null || nodeElement === void 0 ? void 0 : nodeElement.focus();
156
+ const nodeElement = treeRef.current?.ownerDocument.querySelector(`#${nodeId}`);
157
+ nodeElement?.focus();
161
158
  // Need to reset that if navigating with mouse and keyboard,
162
159
  // e.g. pressing arrow left to go to parent node and then with mouse
163
160
  // clicking some other child node and then pressing arrow left
@@ -166,13 +163,12 @@ export const Tree = (props) => {
166
163
  });
167
164
  }, [scrollToIndex]);
168
165
  const handleFocus = (event) => {
169
- var _a, _b;
170
- if ((_a = treeRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.relatedTarget)) {
166
+ if (treeRef.current?.contains(event.relatedTarget)) {
171
167
  return;
172
168
  }
173
169
  const items = getFocusableNodes();
174
170
  if (items.length > 0) {
175
- (_b = items[focusedIndex.current]) === null || _b === void 0 ? void 0 : _b.focus();
171
+ items[focusedIndex.current]?.focus();
176
172
  }
177
173
  };
178
174
  return (React.createElement(React.Fragment, null, enableVirtualization ? (React.createElement(VirtualizedTree, { flatNodesList: flatNodesList, itemRenderer: itemRenderer, scrollToIndex: scrollToIndex, onFocus: handleFocus, onKeyDown: handleKeyDown, ref: treeRef, className: className, style: style, ...rest })) : (React.createElement(TreeElement, { onKeyDown: handleKeyDown, onFocus: handleFocus, className: className, style: style, ref: treeRef, ...rest }, flatNodesList.map((_, i) => itemRenderer(i))))));
@@ -32,11 +32,10 @@ export const TreeNode = (props) => {
32
32
  const [isFocused, setIsFocused] = React.useState(false);
33
33
  const nodeRef = React.useRef(null);
34
34
  const onKeyDown = (event) => {
35
- var _a, _b, _c, _d, _e, _f;
36
35
  if (event.altKey) {
37
36
  return;
38
37
  }
39
- const isNodeFocused = nodeRef.current === ((_a = nodeRef.current) === null || _a === void 0 ? void 0 : _a.ownerDocument.activeElement);
38
+ const isNodeFocused = nodeRef.current === nodeRef.current?.ownerDocument.activeElement;
40
39
  switch (event.key) {
41
40
  case 'ArrowLeft': {
42
41
  event.preventDefault();
@@ -46,19 +45,19 @@ export const TreeNode = (props) => {
46
45
  break;
47
46
  }
48
47
  if (parentNodeId) {
49
- scrollToParent === null || scrollToParent === void 0 ? void 0 : scrollToParent();
48
+ scrollToParent?.();
50
49
  break;
51
50
  }
52
51
  // If it is top level node (doesn't have parent node), then do nothing.
53
52
  break;
54
53
  }
55
54
  const focusableElements = getFocusableElements(nodeRef.current);
56
- const currentIndex = focusableElements.indexOf((_b = nodeRef.current) === null || _b === void 0 ? void 0 : _b.ownerDocument.activeElement);
55
+ const currentIndex = focusableElements.indexOf(nodeRef.current?.ownerDocument.activeElement);
57
56
  if (currentIndex === 0) {
58
- (_c = nodeRef.current) === null || _c === void 0 ? void 0 : _c.focus();
57
+ nodeRef.current?.focus();
59
58
  }
60
59
  else {
61
- (_d = focusableElements[currentIndex - 1]) === null || _d === void 0 ? void 0 : _d.focus();
60
+ focusableElements[currentIndex - 1]?.focus();
62
61
  }
63
62
  break;
64
63
  }
@@ -70,10 +69,10 @@ export const TreeNode = (props) => {
70
69
  onExpanded(nodeId, true);
71
70
  break;
72
71
  }
73
- (_e = focusableElements[0]) === null || _e === void 0 ? void 0 : _e.focus();
72
+ focusableElements[0]?.focus();
74
73
  break;
75
74
  }
76
- const currentIndex = focusableElements.indexOf((_f = nodeRef.current) === null || _f === void 0 ? void 0 : _f.ownerDocument.activeElement);
75
+ const currentIndex = focusableElements.indexOf(nodeRef.current?.ownerDocument.activeElement);
77
76
  if (currentIndex < focusableElements.length - 1) {
78
77
  focusableElements[currentIndex + 1].focus();
79
78
  break;
@@ -89,7 +88,7 @@ export const TreeNode = (props) => {
89
88
  }
90
89
  event.preventDefault();
91
90
  if (!isDisabled) {
92
- onSelected === null || onSelected === void 0 ? void 0 : onSelected(nodeId, !isSelected);
91
+ onSelected?.(nodeId, !isSelected);
93
92
  }
94
93
  break;
95
94
  }
@@ -111,7 +110,7 @@ export const TreeNode = (props) => {
111
110
  React.createElement(Box, { className: cx('iui-tree-node', {
112
111
  'iui-active': isSelected,
113
112
  'iui-disabled': isDisabled,
114
- }), style: { '--level': nodeDepth }, onClick: () => !isDisabled && (onSelected === null || onSelected === void 0 ? void 0 : onSelected(nodeId, !isSelected)) },
113
+ }), style: { '--level': nodeDepth }, onClick: () => !isDisabled && onSelected?.(nodeId, !isSelected) },
115
114
  checkbox && (React.createElement(Box, { className: 'iui-tree-node-checkbox' }, React.isValidElement(checkbox)
116
115
  ? React.cloneElement(checkbox, {
117
116
  tabIndex: isFocused ? 0 : -1,
@@ -110,27 +110,24 @@ export class ColorValue {
110
110
  * This allows component builders to know if they received bad input from user.
111
111
  */
112
112
  static fromString(val, defaultColorIfNotParsed) {
113
- const [tbgr, hue] = this.computeTbgrFromString(val, defaultColorIfNotParsed === null || defaultColorIfNotParsed === void 0 ? void 0 : defaultColorIfNotParsed.toTbgr());
113
+ const [tbgr, hue] = this.computeTbgrFromString(val, defaultColorIfNotParsed?.toTbgr());
114
114
  return new ColorValue(tbgr, hue);
115
115
  }
116
116
  /** Create a ColorValue from hue, saturation, lightness values. */
117
117
  static fromHSL(hsl) {
118
- var _a;
119
- const alpha = (_a = hsl.a) !== null && _a !== void 0 ? _a : 1;
118
+ const alpha = hsl.a ?? 1;
120
119
  return new ColorValue(this.computeTbgrFromHSL(hsl.h / 360, hsl.s / 100, hsl.l / 100, Math.round((1 - alpha) * 255)), hsl.h);
121
120
  }
122
121
  /** Create a ColorValue from an RgbColor */
123
122
  static fromRGB(rgb) {
124
- var _a;
125
- const alpha = (_a = rgb.a) !== null && _a !== void 0 ? _a : 1;
123
+ const alpha = rgb.a ?? 1;
126
124
  return ColorValue.fromRgbt(rgb.r, rgb.g, rgb.b, Math.round((1 - alpha) * 255));
127
125
  }
128
126
  /**
129
127
  * Create a ColorValue from an HsvColor
130
128
  */
131
129
  static fromHSV(hsv) {
132
- var _a;
133
- const alpha = (_a = hsv.a) !== null && _a !== void 0 ? _a : 1;
130
+ const alpha = hsv.a ?? 1;
134
131
  const transparency = Math.round((1 - alpha) * 255);
135
132
  // Check for simple case first.
136
133
  if (!hsv.s || hsv.h === -1) {
@@ -481,33 +478,30 @@ export class ColorValue {
481
478
  }
482
479
  /** Convert the 0xTTBBGGRR color to a string of the form "rgba(r,g,b,a)" where the color components are specified in decimal and the alpha component is a fraction. */
483
480
  toRgbString(includeAlpha) {
484
- var _a;
485
481
  const rgb = this.toRgbColor();
486
482
  const rgbString = `${rgb.r}, ${rgb.g}, ${rgb.b}`;
487
483
  if (includeAlpha) {
488
- const alpha = (_a = rgb.a) !== null && _a !== void 0 ? _a : 1;
484
+ const alpha = rgb.a ?? 1;
489
485
  return `rgba(${rgbString}, ${ColorValue.getFormattedColorNumber(alpha, 2)})`;
490
486
  }
491
487
  return `rgb(${rgbString})`;
492
488
  }
493
489
  /** Convert this ColorValue to a string in the form "hsl(h,s,l) or hsla(h,s,l,a)" - i.e hsl(120,50%,50%). */
494
490
  toHslString(includeAlpha) {
495
- var _a, _b;
496
491
  const hsl = this.toHslColor();
497
- const hslString = `${ColorValue.getFormattedColorNumber((_a = this._hue) !== null && _a !== void 0 ? _a : hsl.h)}, ${ColorValue.getFormattedColorNumber(hsl.s)}%, ${ColorValue.getFormattedColorNumber(hsl.l)}%`;
492
+ const hslString = `${ColorValue.getFormattedColorNumber(this._hue ?? hsl.h)}, ${ColorValue.getFormattedColorNumber(hsl.s)}%, ${ColorValue.getFormattedColorNumber(hsl.l)}%`;
498
493
  if (includeAlpha) {
499
- const alpha = (_b = hsl.a) !== null && _b !== void 0 ? _b : 1;
494
+ const alpha = hsl.a ?? 1;
500
495
  return `hsla(${hslString}, ${ColorValue.getFormattedColorNumber(alpha, 2)})`;
501
496
  }
502
497
  return `hsl(${hslString})`;
503
498
  }
504
499
  /** Convert this ColorValue to a string in the form "hsv(h,s,v) or hsva(h,s,v,a)" - i.e hsv(120,50%,50%). */
505
500
  toHsvString(includeAlpha) {
506
- var _a, _b;
507
501
  const hsv = this.toHsvColor();
508
- const hsvString = `${(_a = this._hue) !== null && _a !== void 0 ? _a : hsv.h}, ${hsv.s}%, ${hsv.v}%`;
502
+ const hsvString = `${this._hue ?? hsv.h}, ${hsv.s}%, ${hsv.v}%`;
509
503
  if (includeAlpha) {
510
- const alpha = (_b = hsv.a) !== null && _b !== void 0 ? _b : 1;
504
+ const alpha = hsv.a ?? 1;
511
505
  return `hsva(${hsvString}, ${ColorValue.getFormattedColorNumber(alpha, 2)})`;
512
506
  }
513
507
  return `hsv(${hsvString})`;
@@ -16,10 +16,9 @@ import { getWindow } from '../functions/index.js';
16
16
  export const AutoclearingHiddenLiveRegion = ({ text = '' }) => {
17
17
  const [maybeText, setMaybeText] = React.useState(text);
18
18
  React.useEffect(() => {
19
- var _a;
20
19
  setMaybeText(text);
21
- const timeout = (_a = getWindow()) === null || _a === void 0 ? void 0 : _a.setTimeout(() => setMaybeText(''), 5000);
22
- return () => { var _a; return void ((_a = getWindow()) === null || _a === void 0 ? void 0 : _a.clearTimeout(timeout)); };
20
+ const timeout = getWindow()?.setTimeout(() => setMaybeText(''), 5000);
21
+ return () => void getWindow()?.clearTimeout(timeout);
23
22
  }, [text]);
24
23
  return (React.createElement(VisuallyHidden, { as: 'div', "aria-live": 'polite', "aria-atomic": 'true' }, maybeText));
25
24
  };
@@ -21,19 +21,19 @@ export const FocusTrap = (props) => {
21
21
  const onFirstFocus = (event) => {
22
22
  const [firstElement, lastElement] = getFirstLastFocusables();
23
23
  if (event.relatedTarget === firstElement) {
24
- lastElement === null || lastElement === void 0 ? void 0 : lastElement.focus();
24
+ lastElement?.focus();
25
25
  }
26
26
  else {
27
- firstElement === null || firstElement === void 0 ? void 0 : firstElement.focus();
27
+ firstElement?.focus();
28
28
  }
29
29
  };
30
30
  const onLastFocus = (event) => {
31
31
  const [firstElement, lastElement] = getFirstLastFocusables();
32
32
  if (event.relatedTarget === lastElement) {
33
- firstElement === null || firstElement === void 0 ? void 0 : firstElement.focus();
33
+ firstElement?.focus();
34
34
  }
35
35
  else {
36
- lastElement === null || lastElement === void 0 ? void 0 : lastElement.focus();
36
+ lastElement?.focus();
37
37
  }
38
38
  };
39
39
  return (React.createElement(React.Fragment, null,
@@ -22,7 +22,6 @@ const ELLIPSIS_CHAR = '…';
22
22
  * />
23
23
  */
24
24
  export const MiddleTextTruncation = (props) => {
25
- var _a;
26
25
  const { text, endCharsCount = 6, textRenderer, style, ...rest } = props;
27
26
  const [ref, visibleCount] = useOverflow(text);
28
27
  const truncatedText = React.useMemo(() => {
@@ -39,6 +38,6 @@ export const MiddleTextTruncation = (props) => {
39
38
  flexGrow: 1,
40
39
  whiteSpace: 'nowrap',
41
40
  ...style,
42
- }, ref: ref, ...rest }, (_a = textRenderer === null || textRenderer === void 0 ? void 0 : textRenderer(truncatedText, text)) !== null && _a !== void 0 ? _a : truncatedText));
41
+ }, ref: ref, ...rest }, textRenderer?.(truncatedText, text) ?? truncatedText));
43
42
  };
44
43
  export default MiddleTextTruncation;
@@ -13,7 +13,6 @@ import { ThemeContext } from '../../ThemeProvider/ThemeContext.js';
13
13
  * @private
14
14
  */
15
15
  export const Popover = React.forwardRef((props, ref) => {
16
- var _a;
17
16
  const [mounted, setMounted] = React.useState(false);
18
17
  const themeInfo = React.useContext(ThemeContext);
19
18
  const isDomAvailable = useIsClient();
@@ -30,15 +29,14 @@ export const Popover = React.forwardRef((props, ref) => {
30
29
  const removeTabIndex = {
31
30
  fn: () => ({
32
31
  onCreate: (instance) => {
33
- var _a;
34
- (_a = instance.popper.firstElementChild) === null || _a === void 0 ? void 0 : _a.removeAttribute('tabindex');
32
+ instance.popper.firstElementChild?.removeAttribute('tabindex');
35
33
  },
36
34
  }),
37
35
  };
38
36
  const computedProps = {
39
37
  allowHTML: true,
40
38
  animation: false,
41
- appendTo: (el) => (themeInfo === null || themeInfo === void 0 ? void 0 : themeInfo.rootRef.current) || el.ownerDocument.body,
39
+ appendTo: (el) => themeInfo?.portalContainerRef?.current || el.ownerDocument.body,
42
40
  arrow: false,
43
41
  duration: 0,
44
42
  interactive: true,
@@ -63,7 +61,7 @@ export const Popover = React.forwardRef((props, ref) => {
63
61
  modifiers: [
64
62
  { name: 'flip' },
65
63
  { name: 'preventOverflow', options: { padding: 0 } },
66
- ...(((_a = props.popperOptions) === null || _a === void 0 ? void 0 : _a.modifiers) || []),
64
+ ...(props.popperOptions?.modifiers || []),
67
65
  ],
68
66
  },
69
67
  };
@@ -78,9 +76,8 @@ export const Popover = React.forwardRef((props, ref) => {
78
76
  const clonedContent = React.isValidElement(props.content)
79
77
  ? React.cloneElement(props.content, {
80
78
  onClick: (e) => {
81
- var _a, _b;
82
79
  e.stopPropagation();
83
- (_b = (_a = props.content.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
80
+ props.content.props.onClick?.(e);
84
81
  },
85
82
  })
86
83
  : props.content;
@@ -97,7 +94,7 @@ export const hideOnEscOrTab = {
97
94
  /** @returns true if none of the children are tabbable */
98
95
  const shouldHideOnTab = () => {
99
96
  const descendents = Array.from(instance.popper.querySelectorAll('*'));
100
- return !descendents.some((el) => (el === null || el === void 0 ? void 0 : el.tabIndex) >= 0);
97
+ return !descendents.some((el) => el?.tabIndex >= 0);
101
98
  };
102
99
  const onKeyDown = (event) => {
103
100
  if (event.altKey) {
@@ -38,17 +38,18 @@ export const Resizer = (props) => {
38
38
  const originalUserSelect = ownerDocument.body.style.userSelect;
39
39
  ownerDocument.body.style.userSelect = 'none';
40
40
  const onResizePointerMove = (event) => {
41
- var _a, _b, _c, _d, _e, _f, _g;
42
41
  if (!elementRef.current) {
43
42
  return;
44
43
  }
45
44
  if (!isResizing.current) {
46
45
  isResizing.current = true;
47
- onResizeStart === null || onResizeStart === void 0 ? void 0 : onResizeStart();
46
+ onResizeStart?.();
48
47
  }
49
- const containerRect = (_a = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
50
- const clientX = getBoundedValue(event.clientX, (_b = containerRect === null || containerRect === void 0 ? void 0 : containerRect.left) !== null && _b !== void 0 ? _b : 0, (_d = (_c = containerRect === null || containerRect === void 0 ? void 0 : containerRect.right) !== null && _c !== void 0 ? _c : ownerDocument.documentElement.clientWidth) !== null && _d !== void 0 ? _d : 0);
51
- const clientY = getBoundedValue(event.clientY, (_e = containerRect === null || containerRect === void 0 ? void 0 : containerRect.top) !== null && _e !== void 0 ? _e : 0, (_g = (_f = containerRect === null || containerRect === void 0 ? void 0 : containerRect.bottom) !== null && _f !== void 0 ? _f : ownerDocument.documentElement.clientHeight) !== null && _g !== void 0 ? _g : 0);
48
+ const containerRect = containerRef?.current?.getBoundingClientRect();
49
+ const clientX = getBoundedValue(event.clientX, containerRect?.left ?? 0, containerRect?.right ?? ownerDocument.documentElement.clientWidth ?? 0);
50
+ const clientY = getBoundedValue(event.clientY, containerRect?.top ?? 0, containerRect?.bottom ??
51
+ ownerDocument.documentElement.clientHeight ??
52
+ 0);
52
53
  const diffX = initialPointerX - clientX;
53
54
  const diffY = initialPointerY - clientY;
54
55
  switch (resizer) {
@@ -129,7 +130,7 @@ export const Resizer = (props) => {
129
130
  if (elementRef.current) {
130
131
  ownerDocument.body.style.userSelect = originalUserSelect;
131
132
  isResizing.current = false;
132
- onResizeEnd === null || onResizeEnd === void 0 ? void 0 : onResizeEnd({
133
+ onResizeEnd?.({
133
134
  width,
134
135
  height,
135
136
  transform: `translate(${translateX}px, ${translateY}px)`,