@react-md/core 6.5.0 → 6.5.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 (402) hide show
  1. package/dist/_utils.scss +5 -1
  2. package/dist/autocomplete/AutocompleteChip.js +2 -2
  3. package/dist/autocomplete/AutocompleteChip.js.map +1 -1
  4. package/dist/autocomplete/AutocompleteListboxChildren.js +1 -1
  5. package/dist/autocomplete/AutocompleteListboxChildren.js.map +1 -1
  6. package/dist/autocomplete/useAutocomplete.js +4 -4
  7. package/dist/autocomplete/useAutocomplete.js.map +1 -1
  8. package/dist/autocomplete/utils.js +3 -3
  9. package/dist/autocomplete/utils.js.map +1 -1
  10. package/dist/box/styles.js +2 -2
  11. package/dist/box/styles.js.map +1 -1
  12. package/dist/button/AsyncButton.js +1 -1
  13. package/dist/button/AsyncButton.js.map +1 -1
  14. package/dist/chip/Chip.js +1 -1
  15. package/dist/chip/Chip.js.map +1 -1
  16. package/dist/cssUtils.d.ts +11 -6
  17. package/dist/cssUtils.js.map +1 -1
  18. package/dist/datetime/useTimeField.js +1 -1
  19. package/dist/datetime/useTimeField.js.map +1 -1
  20. package/dist/delegateEvent.js +9 -9
  21. package/dist/delegateEvent.js.map +1 -1
  22. package/dist/draggable/useDraggable.js +4 -4
  23. package/dist/draggable/useDraggable.js.map +1 -1
  24. package/dist/draggable/utils.js +1 -1
  25. package/dist/draggable/utils.js.map +1 -1
  26. package/dist/expansion-panel/ExpansionPanel.js +1 -1
  27. package/dist/expansion-panel/ExpansionPanel.js.map +1 -1
  28. package/dist/expansion-panel/useExpansionPanels.js +1 -1
  29. package/dist/expansion-panel/useExpansionPanels.js.map +1 -1
  30. package/dist/files/FileInput.js +1 -1
  31. package/dist/files/FileInput.js.map +1 -1
  32. package/dist/files/createAcceptFromExtensions.d.ts +5 -0
  33. package/dist/files/createAcceptFromExtensions.js +15 -0
  34. package/dist/files/createAcceptFromExtensions.js.map +1 -0
  35. package/dist/files/useFileUpload.js +45 -41
  36. package/dist/files/useFileUpload.js.map +1 -1
  37. package/dist/files/utils.js +14 -10
  38. package/dist/files/utils.js.map +1 -1
  39. package/dist/files/validation.js +7 -8
  40. package/dist/files/validation.js.map +1 -1
  41. package/dist/focus/useFocusContainer.js +1 -1
  42. package/dist/focus/useFocusContainer.js.map +1 -1
  43. package/dist/focus/utils.js +12 -7
  44. package/dist/focus/utils.js.map +1 -1
  45. package/dist/form/InputToggleIcon.js +5 -1
  46. package/dist/form/InputToggleIcon.js.map +1 -1
  47. package/dist/form/NativeSelect.js +1 -1
  48. package/dist/form/NativeSelect.js.map +1 -1
  49. package/dist/form/Select.js +5 -5
  50. package/dist/form/Select.js.map +1 -1
  51. package/dist/form/formConfig.js +1 -1
  52. package/dist/form/formConfig.js.map +1 -1
  53. package/dist/form/inputToggleStyles.js +7 -1
  54. package/dist/form/inputToggleStyles.js.map +1 -1
  55. package/dist/form/selectUtils.js +2 -2
  56. package/dist/form/selectUtils.js.map +1 -1
  57. package/dist/form/useCombobox.js +1 -0
  58. package/dist/form/useCombobox.js.map +1 -1
  59. package/dist/form/useFormReset.js +2 -2
  60. package/dist/form/useFormReset.js.map +1 -1
  61. package/dist/form/useNumberField.js +1 -1
  62. package/dist/form/useNumberField.js.map +1 -1
  63. package/dist/form/useResizingTextArea.js +4 -4
  64. package/dist/form/useResizingTextArea.js.map +1 -1
  65. package/dist/form/useSelectCombobox.js +1 -1
  66. package/dist/form/useSelectCombobox.js.map +1 -1
  67. package/dist/form/validation.js +1 -1
  68. package/dist/form/validation.js.map +1 -1
  69. package/dist/hoverMode/useHoverMode.js +8 -8
  70. package/dist/hoverMode/useHoverMode.js.map +1 -1
  71. package/dist/hoverMode/useHoverModeProvider.js +3 -3
  72. package/dist/hoverMode/useHoverModeProvider.js.map +1 -1
  73. package/dist/icon/config.js +3 -3
  74. package/dist/icon/config.js.map +1 -1
  75. package/dist/icon/materialConfig.js +1 -1
  76. package/dist/icon/materialConfig.js.map +1 -1
  77. package/dist/interaction/UserInteractionModeProvider.js +11 -10
  78. package/dist/interaction/UserInteractionModeProvider.js.map +1 -1
  79. package/dist/interaction/utils.js +7 -3
  80. package/dist/interaction/utils.js.map +1 -1
  81. package/dist/layout/useExpandableLayout.js +3 -4
  82. package/dist/layout/useExpandableLayout.js.map +1 -1
  83. package/dist/layout/useMainTabIndex.js +1 -1
  84. package/dist/layout/useMainTabIndex.js.map +1 -1
  85. package/dist/list/ListItem.js +1 -1
  86. package/dist/list/ListItem.js.map +1 -1
  87. package/dist/media-queries/AppSizeProvider.js +1 -1
  88. package/dist/media-queries/AppSizeProvider.js.map +1 -1
  89. package/dist/media-queries/config.js +2 -2
  90. package/dist/media-queries/config.js.map +1 -1
  91. package/dist/media-queries/useMediaQuery.js +3 -3
  92. package/dist/media-queries/useMediaQuery.js.map +1 -1
  93. package/dist/menu/Menu.js +4 -4
  94. package/dist/menu/Menu.js.map +1 -1
  95. package/dist/menu/MenuItemButton.js +1 -1
  96. package/dist/menu/MenuItemButton.js.map +1 -1
  97. package/dist/menu/MenuItemFileInput.js +1 -1
  98. package/dist/menu/MenuItemFileInput.js.map +1 -1
  99. package/dist/menu/MenuWidget.js +2 -2
  100. package/dist/menu/MenuWidget.js.map +1 -1
  101. package/dist/movement/findMatchIndex.js +2 -2
  102. package/dist/movement/findMatchIndex.js.map +1 -1
  103. package/dist/movement/useKeyboardMovementProvider.js +2 -2
  104. package/dist/movement/useKeyboardMovementProvider.js.map +1 -1
  105. package/dist/movement/utils.js +12 -10
  106. package/dist/movement/utils.js.map +1 -1
  107. package/dist/navigation/getTableOfContentsHeadings.js +4 -3
  108. package/dist/navigation/getTableOfContentsHeadings.js.map +1 -1
  109. package/dist/navigation/useActiveHeadingId.js +9 -9
  110. package/dist/navigation/useActiveHeadingId.js.map +1 -1
  111. package/dist/navigation/useTableOfContentsHeadings.js +1 -1
  112. package/dist/navigation/useTableOfContentsHeadings.js.map +1 -1
  113. package/dist/navigation/utils.js +6 -5
  114. package/dist/navigation/utils.js.map +1 -1
  115. package/dist/portal/PortalContainerProvider.js +5 -3
  116. package/dist/portal/PortalContainerProvider.js.map +1 -1
  117. package/dist/positioning/getFixedPosition.js +2 -4
  118. package/dist/positioning/getFixedPosition.js.map +1 -1
  119. package/dist/positioning/useFixedPositioning.js +2 -2
  120. package/dist/positioning/useFixedPositioning.js.map +1 -1
  121. package/dist/positioning/utils.js +3 -3
  122. package/dist/positioning/utils.js.map +1 -1
  123. package/dist/scroll/getScrollbarWidth.js +4 -4
  124. package/dist/scroll/getScrollbarWidth.js.map +1 -1
  125. package/dist/searching/fuzzy.js +3 -2
  126. package/dist/searching/fuzzy.js.map +1 -1
  127. package/dist/searching/toSearchQuery.js +1 -1
  128. package/dist/searching/toSearchQuery.js.map +1 -1
  129. package/dist/searching/utils.js +1 -1
  130. package/dist/searching/utils.js.map +1 -1
  131. package/dist/snackbar/Toast.js +1 -1
  132. package/dist/snackbar/Toast.js.map +1 -1
  133. package/dist/snackbar/ToastContent.js +2 -2
  134. package/dist/snackbar/ToastContent.js.map +1 -1
  135. package/dist/snackbar/ToastManager.d.ts +1 -1
  136. package/dist/snackbar/ToastManager.js +11 -11
  137. package/dist/snackbar/ToastManager.js.map +1 -1
  138. package/dist/spinbutton/useSpinButton.js +1 -1
  139. package/dist/spinbutton/useSpinButton.js.map +1 -1
  140. package/dist/spinbutton/utils/deselectNode.js +1 -1
  141. package/dist/spinbutton/utils/deselectNode.js.map +1 -1
  142. package/dist/spinbutton/utils/resolveInputEvent.js +1 -1
  143. package/dist/spinbutton/utils/resolveInputEvent.js.map +1 -1
  144. package/dist/spinbutton/utils/selectNode.js +1 -1
  145. package/dist/spinbutton/utils/selectNode.js.map +1 -1
  146. package/dist/storage/useStorage.js +8 -3
  147. package/dist/storage/useStorage.js.map +1 -1
  148. package/dist/table/useStickyTableSection.js +1 -1
  149. package/dist/table/useStickyTableSection.js.map +1 -1
  150. package/dist/tabs/TabList.js +2 -2
  151. package/dist/tabs/TabList.js.map +1 -1
  152. package/dist/tabs/useMaxTabPanelHeight.js +4 -3
  153. package/dist/tabs/useMaxTabPanelHeight.js.map +1 -1
  154. package/dist/tabs/useTabList.js +1 -1
  155. package/dist/tabs/useTabList.js.map +1 -1
  156. package/dist/test-utils/jest-globals/match-media.d.ts +1 -1
  157. package/dist/test-utils/jest-globals/match-media.js +1 -1
  158. package/dist/test-utils/jest-globals/match-media.js.map +1 -1
  159. package/dist/test-utils/jest-globals/timers.js +1 -1
  160. package/dist/test-utils/jest-globals/timers.js.map +1 -1
  161. package/dist/test-utils/jest-globals/uploadMenuItemFileInput.js +1 -1
  162. package/dist/test-utils/jest-globals/uploadMenuItemFileInput.js.map +1 -1
  163. package/dist/test-utils/mocks/ResizeObserver.js +2 -2
  164. package/dist/test-utils/mocks/ResizeObserver.js.map +1 -1
  165. package/dist/test-utils/polyfills/IntersectionObserver.js +2 -2
  166. package/dist/test-utils/polyfills/IntersectionObserver.js.map +1 -1
  167. package/dist/test-utils/polyfills/ResizeObserver.js +2 -2
  168. package/dist/test-utils/polyfills/ResizeObserver.js.map +1 -1
  169. package/dist/test-utils/polyfills/TextDecoder.js +2 -2
  170. package/dist/test-utils/polyfills/TextDecoder.js.map +1 -1
  171. package/dist/test-utils/polyfills/TextEncoder.js +2 -2
  172. package/dist/test-utils/polyfills/TextEncoder.js.map +1 -1
  173. package/dist/test-utils/polyfills/matchMedia.js +2 -2
  174. package/dist/test-utils/polyfills/matchMedia.js.map +1 -1
  175. package/dist/test-utils/polyfills/offsetParent.js +2 -2
  176. package/dist/test-utils/polyfills/offsetParent.js.map +1 -1
  177. package/dist/test-utils/polyfills/scrollIntoView.js +1 -1
  178. package/dist/test-utils/polyfills/scrollIntoView.js.map +1 -1
  179. package/dist/test-utils/queries/select.js +2 -2
  180. package/dist/test-utils/queries/select.js.map +1 -1
  181. package/dist/test-utils/queries/slider.js +1 -1
  182. package/dist/test-utils/queries/slider.js.map +1 -1
  183. package/dist/test-utils/utils/createFileList.js +2 -0
  184. package/dist/test-utils/utils/createFileList.js.map +1 -1
  185. package/dist/test-utils/utils/createMatchMediaSpy.d.ts +1 -1
  186. package/dist/test-utils/utils/createMatchMediaSpy.js +3 -3
  187. package/dist/test-utils/utils/createMatchMediaSpy.js.map +1 -1
  188. package/dist/test-utils/vitest/match-media.d.ts +1 -1
  189. package/dist/test-utils/vitest/match-media.js +1 -1
  190. package/dist/test-utils/vitest/match-media.js.map +1 -1
  191. package/dist/test-utils/vitest/timers.js +1 -1
  192. package/dist/test-utils/vitest/timers.js.map +1 -1
  193. package/dist/test-utils/vitest/uploadMenuItemFileInput.js +1 -1
  194. package/dist/test-utils/vitest/uploadMenuItemFileInput.js.map +1 -1
  195. package/dist/theme/ThemeProvider.js +2 -2
  196. package/dist/theme/ThemeProvider.js.map +1 -1
  197. package/dist/theme/getDerivedTheme.js +1 -1
  198. package/dist/theme/getDerivedTheme.js.map +1 -1
  199. package/dist/theme/useCSSVariables.js +5 -5
  200. package/dist/theme/useCSSVariables.js.map +1 -1
  201. package/dist/theme/useColorSchemeMetaTag.js +2 -2
  202. package/dist/theme/useColorSchemeMetaTag.js.map +1 -1
  203. package/dist/theme/useInlineCSSVariables.js +4 -3
  204. package/dist/theme/useInlineCSSVariables.js.map +1 -1
  205. package/dist/theme/utils.js +8 -8
  206. package/dist/theme/utils.js.map +1 -1
  207. package/dist/tooltip/useTooltip.js +7 -7
  208. package/dist/tooltip/useTooltip.js.map +1 -1
  209. package/dist/tooltip/useTooltipPosition.js +1 -1
  210. package/dist/tooltip/useTooltipPosition.js.map +1 -1
  211. package/dist/transition/useCarousel.js +2 -2
  212. package/dist/transition/useCarousel.js.map +1 -1
  213. package/dist/transition/useCollapseTransition.js +1 -1
  214. package/dist/transition/useCollapseTransition.js.map +1 -1
  215. package/dist/transition/useSkeletonPlaceholder.js +4 -4
  216. package/dist/transition/useSkeletonPlaceholder.js.map +1 -1
  217. package/dist/transition/useTransition.js +2 -2
  218. package/dist/transition/useTransition.js.map +1 -1
  219. package/dist/transition/utils.js +5 -5
  220. package/dist/transition/utils.js.map +1 -1
  221. package/dist/tree/TreeItem.js +1 -1
  222. package/dist/tree/TreeItem.js.map +1 -1
  223. package/dist/tree/useTreeItems.js +7 -5
  224. package/dist/tree/useTreeItems.js.map +1 -1
  225. package/dist/tree/useTreeMovement.js +1 -1
  226. package/dist/tree/useTreeMovement.js.map +1 -1
  227. package/dist/tree/utils.js +6 -9
  228. package/dist/tree/utils.js.map +1 -1
  229. package/dist/typography/HighlightText.js +2 -1
  230. package/dist/typography/HighlightText.js.map +1 -1
  231. package/dist/typography/SrOnly.js +7 -1
  232. package/dist/typography/SrOnly.js.map +1 -1
  233. package/dist/useDebouncedFunction.js +4 -4
  234. package/dist/useDebouncedFunction.js.map +1 -1
  235. package/dist/useDropzone.js +9 -9
  236. package/dist/useDropzone.js.map +1 -1
  237. package/dist/useEnsuredState.js +5 -5
  238. package/dist/useEnsuredState.js.map +1 -1
  239. package/dist/useIntersectionObserver.js +3 -3
  240. package/dist/useIntersectionObserver.js.map +1 -1
  241. package/dist/useIsomorphicLayoutEffect.js +1 -1
  242. package/dist/useIsomorphicLayoutEffect.js.map +1 -1
  243. package/dist/useOrientation.js +1 -1
  244. package/dist/useOrientation.js.map +1 -1
  245. package/dist/useReadonlySet.js +1 -1
  246. package/dist/useReadonlySet.js.map +1 -1
  247. package/dist/useResizeListener.js +2 -2
  248. package/dist/useResizeListener.js.map +1 -1
  249. package/dist/useResizeObserver.js +3 -4
  250. package/dist/useResizeObserver.js.map +1 -1
  251. package/dist/useThrottledFunction.js +3 -3
  252. package/dist/useThrottledFunction.js.map +1 -1
  253. package/dist/useWindowSize.js +1 -1
  254. package/dist/useWindowSize.js.map +1 -1
  255. package/dist/utils/alphaNumericSort.js +3 -1
  256. package/dist/utils/alphaNumericSort.js.map +1 -1
  257. package/dist/utils/bem.js +9 -12
  258. package/dist/utils/bem.js.map +1 -1
  259. package/dist/utils/getNumberOfDigits.js +1 -0
  260. package/dist/utils/getNumberOfDigits.js.map +1 -1
  261. package/dist/utils/getRangeDefaultValue.js +1 -1
  262. package/dist/utils/getRangeDefaultValue.js.map +1 -1
  263. package/dist/utils/nearest.js +2 -2
  264. package/dist/utils/nearest.js.map +1 -1
  265. package/dist/utils/parseCssLengthUnit.js +3 -3
  266. package/dist/utils/parseCssLengthUnit.js.map +1 -1
  267. package/dist/utils/trigonometry.js +1 -1
  268. package/dist/utils/trigonometry.js.map +1 -1
  269. package/package.json +3 -1
  270. package/src/autocomplete/AutocompleteChip.tsx +2 -2
  271. package/src/autocomplete/AutocompleteListboxChildren.tsx +1 -1
  272. package/src/autocomplete/useAutocomplete.ts +4 -4
  273. package/src/autocomplete/utils.ts +3 -3
  274. package/src/box/styles.ts +2 -2
  275. package/src/button/AsyncButton.tsx +1 -3
  276. package/src/chip/Chip.tsx +1 -2
  277. package/src/cssUtils.ts +12 -6
  278. package/src/datetime/useTimeField.ts +1 -1
  279. package/src/delegateEvent.ts +9 -9
  280. package/src/draggable/useDraggable.ts +4 -4
  281. package/src/draggable/utils.ts +1 -1
  282. package/src/expansion-panel/ExpansionPanel.tsx +1 -1
  283. package/src/expansion-panel/useExpansionPanels.ts +1 -1
  284. package/src/files/FileInput.tsx +1 -1
  285. package/src/files/createAcceptFromExtensions.ts +18 -0
  286. package/src/files/useFileUpload.ts +36 -37
  287. package/src/files/utils.ts +15 -11
  288. package/src/files/validation.ts +7 -9
  289. package/src/focus/useFocusContainer.ts +1 -1
  290. package/src/focus/utils.ts +11 -6
  291. package/src/form/InputToggleIcon.tsx +5 -5
  292. package/src/form/NativeSelect.tsx +1 -1
  293. package/src/form/Select.tsx +5 -5
  294. package/src/form/formConfig.ts +1 -1
  295. package/src/form/inputToggleStyles.ts +9 -4
  296. package/src/form/selectUtils.ts +2 -2
  297. package/src/form/useCombobox.ts +1 -0
  298. package/src/form/useFormReset.ts +2 -2
  299. package/src/form/useNumberField.ts +1 -1
  300. package/src/form/useResizingTextArea.ts +5 -5
  301. package/src/form/useSelectCombobox.ts +1 -4
  302. package/src/form/validation.ts +1 -1
  303. package/src/hoverMode/useHoverMode.ts +9 -9
  304. package/src/hoverMode/useHoverModeProvider.ts +4 -4
  305. package/src/icon/config.tsx +3 -3
  306. package/src/icon/materialConfig.ts +1 -1
  307. package/src/interaction/UserInteractionModeProvider.tsx +11 -10
  308. package/src/interaction/utils.ts +3 -3
  309. package/src/layout/useExpandableLayout.ts +3 -4
  310. package/src/layout/useMainTabIndex.ts +1 -1
  311. package/src/list/ListItem.tsx +1 -1
  312. package/src/media-queries/AppSizeProvider.tsx +1 -1
  313. package/src/media-queries/config.ts +2 -2
  314. package/src/media-queries/useMediaQuery.ts +3 -3
  315. package/src/menu/Menu.tsx +4 -4
  316. package/src/menu/MenuItemButton.tsx +1 -1
  317. package/src/menu/MenuItemFileInput.tsx +1 -1
  318. package/src/menu/MenuWidget.tsx +6 -4
  319. package/src/movement/findMatchIndex.ts +2 -2
  320. package/src/movement/useKeyboardMovementProvider.ts +2 -2
  321. package/src/movement/utils.ts +15 -14
  322. package/src/navigation/getTableOfContentsHeadings.ts +4 -3
  323. package/src/navigation/useActiveHeadingId.ts +8 -8
  324. package/src/navigation/useTableOfContentsHeadings.ts +1 -1
  325. package/src/navigation/utils.ts +6 -5
  326. package/src/portal/PortalContainerProvider.tsx +5 -3
  327. package/src/positioning/getFixedPosition.ts +9 -6
  328. package/src/positioning/useFixedPositioning.ts +2 -2
  329. package/src/positioning/utils.ts +3 -3
  330. package/src/scroll/getScrollbarWidth.ts +4 -4
  331. package/src/searching/fuzzy.ts +7 -3
  332. package/src/searching/toSearchQuery.ts +1 -1
  333. package/src/searching/utils.ts +1 -1
  334. package/src/snackbar/Toast.tsx +1 -1
  335. package/src/snackbar/ToastContent.tsx +2 -2
  336. package/src/snackbar/ToastManager.ts +11 -12
  337. package/src/spinbutton/useSpinButton.ts +1 -1
  338. package/src/spinbutton/utils/deselectNode.ts +1 -1
  339. package/src/spinbutton/utils/resolveInputEvent.ts +1 -1
  340. package/src/spinbutton/utils/selectNode.ts +1 -1
  341. package/src/storage/useStorage.ts +7 -2
  342. package/src/table/useStickyTableSection.tsx +1 -1
  343. package/src/tabs/TabList.tsx +2 -2
  344. package/src/tabs/useMaxTabPanelHeight.ts +6 -3
  345. package/src/tabs/useTabList.ts +2 -2
  346. package/src/test-utils/jest-globals/match-media.ts +5 -2
  347. package/src/test-utils/jest-globals/timers.ts +1 -1
  348. package/src/test-utils/jest-globals/uploadMenuItemFileInput.ts +1 -1
  349. package/src/test-utils/mocks/ResizeObserver.ts +2 -2
  350. package/src/test-utils/polyfills/IntersectionObserver.ts +2 -2
  351. package/src/test-utils/polyfills/ResizeObserver.ts +2 -2
  352. package/src/test-utils/polyfills/TextDecoder.ts +2 -2
  353. package/src/test-utils/polyfills/TextEncoder.ts +2 -2
  354. package/src/test-utils/polyfills/matchMedia.ts +5 -2
  355. package/src/test-utils/polyfills/offsetParent.ts +2 -2
  356. package/src/test-utils/polyfills/scrollIntoView.ts +1 -1
  357. package/src/test-utils/queries/select.ts +2 -2
  358. package/src/test-utils/queries/slider.ts +1 -1
  359. package/src/test-utils/utils/createFileList.ts +2 -0
  360. package/src/test-utils/utils/createMatchMediaSpy.ts +4 -4
  361. package/src/test-utils/vitest/match-media.ts +2 -2
  362. package/src/test-utils/vitest/timers.ts +1 -1
  363. package/src/test-utils/vitest/uploadMenuItemFileInput.ts +1 -1
  364. package/src/theme/ThemeProvider.tsx +2 -2
  365. package/src/theme/getDerivedTheme.ts +1 -1
  366. package/src/theme/useCSSVariables.ts +5 -5
  367. package/src/theme/useColorSchemeMetaTag.ts +2 -2
  368. package/src/theme/useInlineCSSVariables.ts +6 -7
  369. package/src/theme/utils.ts +8 -8
  370. package/src/tooltip/useTooltip.ts +7 -7
  371. package/src/tooltip/useTooltipPosition.ts +1 -1
  372. package/src/transition/useCarousel.ts +2 -2
  373. package/src/transition/useCollapseTransition.ts +1 -1
  374. package/src/transition/useSkeletonPlaceholder.ts +4 -4
  375. package/src/transition/useTransition.ts +2 -2
  376. package/src/transition/utils.ts +5 -5
  377. package/src/tree/TreeItem.tsx +1 -1
  378. package/src/tree/useTreeItems.ts +5 -5
  379. package/src/tree/useTreeMovement.ts +1 -1
  380. package/src/tree/utils.ts +9 -9
  381. package/src/typography/HighlightText.tsx +4 -3
  382. package/src/typography/SrOnly.tsx +9 -2
  383. package/src/useDebouncedFunction.ts +5 -5
  384. package/src/useDropzone.ts +10 -10
  385. package/src/useEnsuredState.ts +5 -5
  386. package/src/useIntersectionObserver.ts +3 -3
  387. package/src/useIsomorphicLayoutEffect.ts +3 -3
  388. package/src/useOrientation.ts +1 -1
  389. package/src/useReadonlySet.ts +3 -1
  390. package/src/useResizeListener.ts +2 -2
  391. package/src/useResizeObserver.ts +3 -4
  392. package/src/useThrottledFunction.ts +4 -4
  393. package/src/useWindowSize.ts +1 -1
  394. package/src/utils/alphaNumericSort.ts +1 -1
  395. package/src/utils/bem.ts +15 -16
  396. package/src/utils/getNumberOfDigits.ts +1 -0
  397. package/src/utils/getRangeDefaultValue.ts +1 -1
  398. package/src/utils/nearest.ts +5 -2
  399. package/src/utils/parseCssLengthUnit.ts +5 -4
  400. package/src/utils/trigonometry.ts +1 -1
  401. package/dist/form/defaultGetSelectedOptionChildren.d.ts +0 -1
  402. package/dist/form/getSelectedOptionChildren.d.ts +0 -1
@@ -9,6 +9,7 @@ import {
9
9
  useReducer,
10
10
  } from "react";
11
11
 
12
+ import { createAcceptFromExtensions } from "./createAcceptFromExtensions.js";
12
13
  import {
13
14
  type CompletedFileUploadStats,
14
15
  type FileReaderResult,
@@ -259,28 +260,27 @@ export function useFileUpload<E extends HTMLElement, CustomError = never>(
259
260
  stats,
260
261
  };
261
262
  }
262
- case "queue":
263
+ case "queue": {
264
+ const nextStats: Record<string, ProcessingFileUploadStats> = {};
265
+ for (const file of action.files) {
266
+ const key = nanoid();
267
+ nextStats[key] = {
268
+ key,
269
+ file,
270
+ progress: 0,
271
+ status: "pending",
272
+ };
273
+ }
274
+
263
275
  return {
264
276
  ...state,
265
277
  stats: {
266
278
  ...state.stats,
267
- ...action.files.reduce<Record<string, ProcessingFileUploadStats>>(
268
- (files, file) => {
269
- const key = nanoid();
270
- files[key] = {
271
- key,
272
- file,
273
- progress: 0,
274
- status: "pending",
275
- };
276
-
277
- return files;
278
- },
279
- {}
280
- ),
279
+ ...nextStats,
281
280
  },
282
281
  errors: [...state.errors, ...action.errors],
283
282
  };
283
+ }
284
284
  case "start": {
285
285
  const { key, reader } = action;
286
286
  const fileStats: ProcessingFileUploadStats = {
@@ -389,14 +389,16 @@ export function useFileUpload<E extends HTMLElement, CustomError = never>(
389
389
  try {
390
390
  const files = event.dataTransfer.files;
391
391
  if (files) {
392
- queueFiles(Array.from(files));
392
+ queueFiles([...files]);
393
393
  }
394
- } catch (e) {
394
+ } catch (error) {
395
395
  dispatch({
396
396
  type: "queue",
397
397
  files: [],
398
398
  errors: [
399
- new FileAccessError(e instanceof Error ? e.message : undefined),
399
+ new FileAccessError(
400
+ error instanceof Error ? error.message : undefined
401
+ ),
400
402
  ],
401
403
  });
402
404
  }
@@ -409,16 +411,18 @@ export function useFileUpload<E extends HTMLElement, CustomError = never>(
409
411
  try {
410
412
  const files = event.currentTarget.files;
411
413
  if (files) {
412
- queueFiles(Array.from(files));
414
+ queueFiles([...files]);
413
415
  } else {
414
- throw new Error();
416
+ throw new Error("There are no files");
415
417
  }
416
- } catch (e) {
418
+ } catch (error) {
417
419
  dispatch({
418
420
  type: "queue",
419
421
  files: [],
420
422
  errors: [
421
- new FileAccessError(e instanceof Error ? e.message : undefined),
423
+ new FileAccessError(
424
+ error instanceof Error ? error.message : undefined
425
+ ),
422
426
  ],
423
427
  });
424
428
  }
@@ -429,18 +433,18 @@ export function useFileUpload<E extends HTMLElement, CustomError = never>(
429
433
  const remove = useCallback(
430
434
  (keyOrKeys: string | readonly string[]) => {
431
435
  const files = typeof keyOrKeys === "string" ? [keyOrKeys] : keyOrKeys;
432
- files.forEach((fileKey) => {
436
+ for (const fileKey of files) {
433
437
  readers[fileKey]?.abort();
434
- });
438
+ }
435
439
 
436
440
  dispatch({ type: "remove", files });
437
441
  },
438
442
  [readers]
439
443
  );
440
444
  const reset = useCallback(() => {
441
- Object.values(readers).forEach((reader) => {
445
+ for (const reader of Object.values(readers)) {
442
446
  reader.abort();
443
- });
447
+ }
444
448
 
445
449
  dispatch({ type: "reset" });
446
450
  }, [readers]);
@@ -469,24 +473,24 @@ export function useFileUpload<E extends HTMLElement, CustomError = never>(
469
473
  useEffect(() => {
470
474
  const pending: ProcessingFileUploadStats[] = [];
471
475
  const uploading: ProcessingFileUploadStats[] = [];
472
- Object.values(stats).forEach((file) => {
476
+ for (const file of Object.values(stats)) {
473
477
  if (file.status === "pending") {
474
478
  pending.push(file);
475
479
  } else if (file.status === "uploading") {
476
480
  uploading.push(file);
477
481
  }
478
- });
482
+ }
479
483
 
480
484
  const lastIndex =
481
485
  concurrency === -1
482
486
  ? pending.length
483
487
  : Math.max(0, concurrency - uploading.length);
484
488
  const queue = pending.slice(0, lastIndex);
485
- if (!queue.length) {
489
+ if (queue.length === 0) {
486
490
  return;
487
491
  }
488
492
 
489
- queue.forEach((stats) => {
493
+ for (const stats of queue) {
490
494
  const { key, file } = stats;
491
495
  const reader = new FileReader();
492
496
 
@@ -508,7 +512,7 @@ export function useFileUpload<E extends HTMLElement, CustomError = never>(
508
512
  }
509
513
 
510
514
  reader[parser](file);
511
- });
515
+ }
512
516
  }, [
513
517
  concurrency,
514
518
  stats,
@@ -518,15 +522,10 @@ export function useFileUpload<E extends HTMLElement, CustomError = never>(
518
522
  complete,
519
523
  ]);
520
524
 
521
- let accept = "";
522
- if (extensions.length) {
523
- accept = extensions.reduce((s, ext) => `${s ? `${s},` : ""}.${ext}`, "");
524
- }
525
-
526
525
  return {
527
526
  stats: statsList,
528
527
  errors,
529
- accept,
528
+ accept: createAcceptFromExtensions(extensions),
530
529
  totalBytes,
531
530
  totalFiles,
532
531
  onDrop,
@@ -247,18 +247,22 @@ export function getSplitFileUploads(
247
247
  const pending: ProcessingFileUploadStats[] = [];
248
248
  const uploading: ProcessingFileUploadStats[] = [];
249
249
  const complete: CompletedFileUploadStats[] = [];
250
- stats.forEach((stat) => {
251
- if (stat.status === "pending") {
252
- pending.push(stat);
253
- } else if (stat.status === "uploading") {
254
- uploading.push(stat);
255
- } else if (stat.status === "complete") {
256
- complete.push(stat);
257
- } else {
258
- /* istanbul ignore next */
259
- throw new Error("Invalid upload stat");
250
+ for (const stat of stats) {
251
+ switch (stat.status) {
252
+ case "pending":
253
+ pending.push(stat);
254
+ break;
255
+ case "uploading":
256
+ uploading.push(stat);
257
+ break;
258
+ case "complete":
259
+ complete.push(stat);
260
+ break;
261
+ default:
262
+ /* istanbul ignore next */
263
+ throw new Error("Invalid upload stat");
260
264
  }
261
- });
265
+ }
262
266
 
263
267
  return { pending, uploading, complete };
264
268
  }
@@ -389,7 +389,7 @@ export function validateFiles<CustomError>(
389
389
  const extraFiles: File[] = [];
390
390
  const extensionRegExp =
391
391
  extensions.length > 0
392
- ? new RegExp(`\\.(${extensions.join("|")})$`, "i")
392
+ ? new RegExp(String.raw`\.(${extensions.join("|")})$`, "i")
393
393
  : undefined;
394
394
 
395
395
  let maxFilesReached = maxFiles > 0 && totalFiles >= maxFiles;
@@ -398,9 +398,7 @@ export function validateFiles<CustomError>(
398
398
  const minErrors: File[] = [];
399
399
  const maxErrors: File[] = [];
400
400
  const totalSizeErrors: File[] = [];
401
- for (let i = 0; i < files.length; i += 1) {
402
- const file = files[i];
403
-
401
+ for (const file of files) {
404
402
  let valid = true;
405
403
  const { size } = file;
406
404
  if (!isValidFileName(file, extensionRegExp, extensions)) {
@@ -433,23 +431,23 @@ export function validateFiles<CustomError>(
433
431
  }
434
432
  }
435
433
 
436
- if (extensionErrors.length) {
434
+ if (extensionErrors.length > 0) {
437
435
  errors.push(new FileExtensionError(extensionErrors, extensions));
438
436
  }
439
437
 
440
- if (minErrors.length) {
438
+ if (minErrors.length > 0) {
441
439
  errors.push(new FileSizeError(minErrors, "min", minFileSize));
442
440
  }
443
441
 
444
- if (maxErrors.length) {
442
+ if (maxErrors.length > 0) {
445
443
  errors.push(new FileSizeError(maxErrors, "max", maxFileSize));
446
444
  }
447
445
 
448
- if (totalSizeErrors.length) {
446
+ if (totalSizeErrors.length > 0) {
449
447
  errors.push(new FileSizeError(totalSizeErrors, "total", totalFileSize));
450
448
  }
451
449
 
452
- if (extraFiles.length) {
450
+ if (extraFiles.length > 0) {
453
451
  errors.push(new TooManyFilesError(extraFiles, maxFiles));
454
452
  }
455
453
 
@@ -208,7 +208,7 @@ export function useFocusContainer<E extends HTMLElement>(
208
208
 
209
209
  // For some reason, the `"Enter"` keydown event fires at a different timing
210
210
  // than the Space keydown event.
211
- window.requestAnimationFrame(() => {
211
+ globalThis.requestAnimationFrame(() => {
212
212
  prevFocus.current?.focus();
213
213
  });
214
214
  },
@@ -34,6 +34,7 @@ export const PROGRAMMATICALLY_FOCUSABLE = queries.join(",");
34
34
  * `tabindex="-1"` applied instead of only elements that had a manual tab index
35
35
  * applied.
36
36
  */
37
+ // eslint-disable-next-line unicorn/no-array-reduce
37
38
  export const TAB_FOCUSABLE = queries.reduce((fullQuery, query) => {
38
39
  const prefix = `${fullQuery}${fullQuery ? "," : ""}`;
39
40
  const notProgrammaticQuery = `${query}:not([tabindex="-1"])`;
@@ -135,12 +136,16 @@ export function focusElementWithin(options: FocusElementWithinOptions): void {
135
136
  }
136
137
 
137
138
  let element: HTMLElement | null = null;
138
- if (type === "first") {
139
- [element] = elements;
140
- } else if (type === "last") {
141
- element = elements[elements.length - 1];
142
- } else if (type === "query") {
143
- element = document.querySelector<HTMLElement>(query);
139
+ switch (type) {
140
+ case "first":
141
+ [element] = elements;
142
+ break;
143
+ case "last":
144
+ element = elements.at(-1) ?? null;
145
+ break;
146
+ case "query":
147
+ element = document.querySelector<HTMLElement>(query);
148
+ break;
144
149
  }
145
150
 
146
151
  if (!element && isFocusable(container)) {
@@ -90,11 +90,11 @@ export const InputToggleIcon = forwardRef<
90
90
  const uncontrolled = typeof checked !== "boolean";
91
91
  if (!uncontrolled || !FORM_CONFIG.uncontrolledToggles) {
92
92
  active = !!checked && !error;
93
- icon = checked
94
- ? indeterminate
95
- ? indeterminateIcon
96
- : checkedIcon
97
- : uncheckedIcon;
93
+ if (checked) {
94
+ icon = indeterminate ? indeterminateIcon : checkedIcon;
95
+ } else {
96
+ icon = uncheckedIcon;
97
+ }
98
98
  } else {
99
99
  icon = (
100
100
  <>
@@ -156,7 +156,7 @@ export const NativeSelect = forwardRef<HTMLSelectElement, NativeSelectProps>(
156
156
  const underlined = theme === "underline" || theme === "filled";
157
157
 
158
158
  let rightAddon = propRightAddon;
159
- if (typeof propRightAddon === "undefined" && !multiple) {
159
+ if (propRightAddon === undefined && !multiple) {
160
160
  rightAddon = icon;
161
161
  }
162
162
 
@@ -333,13 +333,13 @@ export function Select<Value extends string>(
333
333
  const labelId = label ? selectLabelId : undefined;
334
334
 
335
335
  const [localValue, setLocalValue] = useState(() => {
336
- if (typeof defaultValue !== "undefined") {
336
+ if (defaultValue !== undefined) {
337
337
  return defaultValue;
338
338
  }
339
339
 
340
- return typeof value !== "undefined" ? value : EMPTY_STRING;
340
+ return value !== undefined ? value : EMPTY_STRING;
341
341
  });
342
- const currentValue = typeof value === "undefined" ? localValue : value;
342
+ const currentValue = value === undefined ? localValue : value;
343
343
  const initialValue = useRef(currentValue);
344
344
  const { options, currentOption } = extractOptionsFromChildren(
345
345
  children,
@@ -371,7 +371,7 @@ export function Select<Value extends string>(
371
371
  const icon = getIcon("dropdown", propIcon);
372
372
  const theme = getFormConfig("theme", propTheme);
373
373
  let rightAddon = propRightAddon;
374
- if (typeof rightAddon === "undefined" && icon) {
374
+ if (rightAddon === undefined && icon) {
375
375
  rightAddon = <IconRotator rotated={visible}>{icon}</IconRotator>;
376
376
  }
377
377
 
@@ -423,7 +423,7 @@ export function Select<Value extends string>(
423
423
  className={cnb(select({ theme }), textField())}
424
424
  onChange={(event) => {
425
425
  onChange(event as SelectChangeEvent<Value>);
426
- if (typeof value !== "undefined") {
426
+ if (value !== undefined) {
427
427
  return;
428
428
  }
429
429
 
@@ -41,7 +41,7 @@ export function getFormConfig<N extends keyof FormConfiguration>(
41
41
  name: N,
42
42
  override?: FormConfiguration[N]
43
43
  ): FormConfiguration[N] {
44
- if (typeof override !== "undefined") {
44
+ if (override !== undefined) {
45
45
  return override;
46
46
  }
47
47
 
@@ -1,6 +1,6 @@
1
1
  import { cnb } from "cnbuilder";
2
2
 
3
- import { cssUtils } from "../cssUtils.js";
3
+ import { type TextColor, type ThemeColor, cssUtils } from "../cssUtils.js";
4
4
  import { bem } from "../utils/bem.js";
5
5
  import { type FormComponentStates } from "./types.js";
6
6
 
@@ -60,6 +60,13 @@ export function inputToggle(options: InputToggleClassNameOptions): string {
60
60
  uncontrolled,
61
61
  } = options;
62
62
 
63
+ let textColor: TextColor | ThemeColor | undefined;
64
+ if (disabled) {
65
+ textColor = "text-disabled";
66
+ } else if (error) {
67
+ textColor = "error";
68
+ }
69
+
63
70
  return cnb(
64
71
  `rmd-${type}`,
65
72
  styles({
@@ -72,9 +79,7 @@ export function inputToggle(options: InputToggleClassNameOptions): string {
72
79
  large: size === "large",
73
80
  uncontrolled,
74
81
  }),
75
- cssUtils({
76
- textColor: disabled ? "text-disabled" : error ? "error" : undefined,
77
- }),
82
+ cssUtils({ textColor }),
78
83
  className
79
84
  );
80
85
  }
@@ -77,10 +77,10 @@ export function extractOptionsFromChildren<Value extends string | number>(
77
77
  }
78
78
 
79
79
  const { value, disabled, children } = child.props;
80
- if (typeof value !== "undefined") {
80
+ if (value !== undefined) {
81
81
  if (
82
82
  value === currentValue ||
83
- (!currentOption && typeof currentValue === "undefined")
83
+ (!currentOption && currentValue === undefined)
84
84
  ) {
85
85
  currentOption = child.props;
86
86
  }
@@ -491,6 +491,7 @@ export function useCombobox<
491
491
  // to really make sure the item is in view. An alternative would be to
492
492
  // implement a custom scrollIntoView behavior again like the previous
493
493
  // versions of react-md, but this is less lines of code
494
+ // eslint-disable-next-line unicorn/consistent-function-scoping
494
495
  const attemptScroll = (): void => {
495
496
  const activeOption = document.getElementById(activeDescendantId);
496
497
  if (activeOption) {
@@ -29,7 +29,7 @@ export function useFormReset(options: FormResetOptions): void {
29
29
 
30
30
  useEffect(() => {
31
31
  const element = elementRef.current;
32
- if (!element || (typeof defaultValue === "undefined" && !onReset)) {
32
+ if (!element || (defaultValue === undefined && !onReset)) {
33
33
  return;
34
34
  }
35
35
 
@@ -44,7 +44,7 @@ export function useFormReset(options: FormResetOptions): void {
44
44
  const handleReset = (): void => {
45
45
  if (onReset) {
46
46
  onReset();
47
- } else if (typeof defaultValue !== "undefined") {
47
+ } else if (defaultValue !== undefined) {
48
48
  triggerManualChangeEvent(element, defaultValue);
49
49
  }
50
50
  };
@@ -411,7 +411,7 @@ export function useNumberField(
411
411
  if (!Number.isNaN(value)) {
412
412
  setNumber(value);
413
413
  input.value = `${value}`;
414
- } else if (typeof initial.current === "undefined") {
414
+ } else if (initial.current === undefined) {
415
415
  setNumber(undefined);
416
416
  }
417
417
  },
@@ -112,21 +112,21 @@ export function useResizingTextArea(
112
112
  }
113
113
  /* c8 ignore stop */
114
114
 
115
- const containerStyles = window.getComputedStyle(container);
115
+ const containerStyles = globalThis.getComputedStyle(container);
116
116
  const isBorderBox = containerStyles.boxSizing === "border-box";
117
117
  let borderHeight = 0;
118
118
  if (isBorderBox) {
119
119
  borderHeight =
120
- parseFloat(containerStyles.borderTopWidth) +
121
- parseFloat(containerStyles.borderBottomWidth);
120
+ Number.parseFloat(containerStyles.borderTopWidth) +
121
+ Number.parseFloat(containerStyles.borderBottomWidth);
122
122
  }
123
123
 
124
124
  let nextHeight = mask.scrollHeight + borderHeight;
125
125
  if (maxRows > 0) {
126
126
  nextHeight -= borderHeight;
127
- const maskStyles = window.getComputedStyle(mask);
127
+ const maskStyles = globalThis.getComputedStyle(mask);
128
128
  // in tests, this is `"normal"` by default instead of a number
129
- let lineHeight = parseFloat(maskStyles.lineHeight);
129
+ let lineHeight = Number.parseFloat(maskStyles.lineHeight);
130
130
  if (Number.isNaN(lineHeight)) {
131
131
  lineHeight = DEFAULT_LINE_HEIGHT;
132
132
  }
@@ -62,10 +62,7 @@ export function useSelectCombobox<
62
62
  return values.length - 1;
63
63
  }
64
64
 
65
- return Math.max(
66
- 0,
67
- values.findIndex((option) => option === value)
68
- );
65
+ return Math.max(0, values.indexOf(value));
69
66
  },
70
67
  });
71
68
  }
@@ -181,7 +181,7 @@ export const defaultGetErrorMessage: GetErrorMessage = (options) => {
181
181
 
182
182
  const keys = typeof validate === "string" ? [validate] : validate;
183
183
 
184
- return keys.length &&
184
+ return keys.length > 0 &&
185
185
  VALIDITY_STATE_KEYS.some((key) => validity[key] && keys.includes(key))
186
186
  ? validationMessage
187
187
  : "";
@@ -166,15 +166,15 @@ export function useHoverMode(
166
166
  const state = useState(defaultVisible);
167
167
  let visible: boolean | undefined;
168
168
  let setVisible: UseStateSetter<boolean>;
169
- if (typeof propSetVisible !== "undefined") {
169
+ if (propSetVisible !== undefined) {
170
170
  setVisible = propSetVisible;
171
171
  } else {
172
172
  [visible, setVisible] = state;
173
173
  }
174
174
 
175
- const visibilityTimeout = useRef<number | undefined>();
175
+ const visibilityTimeout = useRef<NodeJS.Timeout>();
176
176
  const clearVisibilityTimeout = useCallback(() => {
177
- window.clearTimeout(visibilityTimeout.current);
177
+ globalThis.clearTimeout(visibilityTimeout.current);
178
178
  }, []);
179
179
 
180
180
  // if the element is near the viewport edge, the mouseleave event might not
@@ -187,7 +187,7 @@ export function useHoverMode(
187
187
  }
188
188
 
189
189
  const handler = (): void => {
190
- window.clearTimeout(visibilityTimeout.current);
190
+ globalThis.clearTimeout(visibilityTimeout.current);
191
191
 
192
192
  // might need to play with this more or make it configurable. if the mouse
193
193
  // leaves the window, you're _normally_ not interacting with the app
@@ -203,7 +203,7 @@ export function useHoverMode(
203
203
 
204
204
  useEffect(() => {
205
205
  return () => {
206
- window.clearTimeout(visibilityTimeout.current);
206
+ globalThis.clearTimeout(visibilityTimeout.current);
207
207
  };
208
208
  }, []);
209
209
 
@@ -213,12 +213,12 @@ export function useHoverMode(
213
213
  startShowFlow: useCallback(
214
214
  (eventOrId) => {
215
215
  const hoverTimeout = hoverTime ?? hoverTimeoutRef.current;
216
- if (disabled || typeof hoverTimeout === "undefined") {
216
+ if (disabled || hoverTimeout === undefined) {
217
217
  return;
218
218
  }
219
219
 
220
220
  let id: string;
221
- if (typeof eventOrId === "string" || typeof eventOrId === "undefined") {
221
+ if (typeof eventOrId === "string" || eventOrId === undefined) {
222
222
  id = eventOrId || "";
223
223
  } else {
224
224
  id = eventOrId.currentTarget.id;
@@ -226,7 +226,7 @@ export function useHoverMode(
226
226
 
227
227
  clearDisableTimer();
228
228
  clearVisibilityTimeout();
229
- visibilityTimeout.current = window.setTimeout(() => {
229
+ visibilityTimeout.current = globalThis.setTimeout(() => {
230
230
  enableHoverMode(id);
231
231
  setVisible(true);
232
232
  }, hoverTimeout);
@@ -248,7 +248,7 @@ export function useHoverMode(
248
248
 
249
249
  startDisableTimer();
250
250
  clearVisibilityTimeout();
251
- visibilityTimeout.current = window.setTimeout(() => {
251
+ visibilityTimeout.current = globalThis.setTimeout(() => {
252
252
  setVisible(false);
253
253
  }, leaveTime ?? leaveTimeoutRef.current);
254
254
  }, [
@@ -261,9 +261,9 @@ export function useHoverModeProvider(
261
261
  const hoverTimeoutRef = useRef(hoverTimeout);
262
262
  const leaveTimeoutRef = useRef(leaveTimeout);
263
263
  const animatedOnceRef = useRef(!!defaultActiveId);
264
- const disableHoverModeTimeout = useRef<number | undefined>();
264
+ const disableHoverModeTimeout = useRef<NodeJS.Timeout>();
265
265
  const clearDisableTimer = useCallback(() => {
266
- window.clearTimeout(disableHoverModeTimeout.current);
266
+ globalThis.clearTimeout(disableHoverModeTimeout.current);
267
267
  }, []);
268
268
  const enableHoverMode = useCallback(
269
269
  (activeId: string) => {
@@ -292,7 +292,7 @@ export function useHoverModeProvider(
292
292
  }
293
293
 
294
294
  clearDisableTimer();
295
- disableHoverModeTimeout.current = window.setTimeout(() => {
295
+ disableHoverModeTimeout.current = globalThis.setTimeout(() => {
296
296
  disableHoverMode();
297
297
  }, disableTimeout);
298
298
  }, [clearDisableTimer, disableHoverMode, disableTimeout]);
@@ -300,7 +300,7 @@ export function useHoverModeProvider(
300
300
  useEffect(() => {
301
301
  hoverTimeoutRef.current = hoverTimeout;
302
302
  return () => {
303
- window.clearTimeout(disableHoverModeTimeout.current);
303
+ globalThis.clearTimeout(disableHoverModeTimeout.current);
304
304
  };
305
305
  }, [hoverTimeout]);
306
306
 
@@ -289,13 +289,13 @@ export const ICON_CONFIG: ConfiguredIcons = {
289
289
  */
290
290
  export function configureIcons(overrides: ConfiguredIcons): void {
291
291
  if (process.env.NODE_ENV !== "production") {
292
- Object.entries(overrides).forEach(([name, value]) => {
292
+ for (const [name, value] of Object.entries(overrides)) {
293
293
  if (!(name in ICON_CONFIG)) {
294
294
  throw new Error(`${name} is an invalid react-md icon name.`);
295
295
  }
296
296
 
297
297
  ICON_CONFIG[name as keyof ConfiguredIcons] = value;
298
- });
298
+ }
299
299
  } else {
300
300
  Object.assign(ICON_CONFIG, overrides);
301
301
  }
@@ -312,7 +312,7 @@ export function getIcon(
312
312
  name: ConfigurableIconName,
313
313
  override?: ReactNode
314
314
  ): ReactNode {
315
- if (typeof override !== "undefined") {
315
+ if (override !== undefined) {
316
316
  return override;
317
317
  }
318
318
 
@@ -183,7 +183,7 @@ interface ApplyOptions {
183
183
 
184
184
  const applyVar = (options: ApplyOptions): CSSProperties | undefined => {
185
185
  const { name, value, defaultValue, style } = options;
186
- if (typeof value !== "undefined" && value !== defaultValue) {
186
+ if (value !== undefined && value !== defaultValue) {
187
187
  const varName = `--rmd-symbol-${name}` as const;
188
188
  return {
189
189
  ...style,