@react-md/core 6.5.2 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (647) hide show
  1. package/dist/app-bar/AppBar.d.ts +3 -2
  2. package/dist/app-bar/AppBar.js +3 -4
  3. package/dist/app-bar/AppBar.js.map +1 -1
  4. package/dist/app-bar/AppBarTitle.d.ts +3 -1
  5. package/dist/app-bar/AppBarTitle.js +3 -4
  6. package/dist/app-bar/AppBarTitle.js.map +1 -1
  7. package/dist/autocomplete/AutocompleteChip.d.ts +2 -1
  8. package/dist/autocomplete/AutocompleteChip.js +3 -4
  9. package/dist/autocomplete/AutocompleteChip.js.map +1 -1
  10. package/dist/autocomplete/types.d.ts +1 -0
  11. package/dist/autocomplete/types.js.map +1 -1
  12. package/dist/autocomplete/utils.d.ts +4 -4
  13. package/dist/autocomplete/utils.js.map +1 -1
  14. package/dist/avatar/Avatar.d.ts +3 -2
  15. package/dist/avatar/Avatar.js +3 -4
  16. package/dist/avatar/Avatar.js.map +1 -1
  17. package/dist/badge/Badge.d.ts +3 -2
  18. package/dist/badge/Badge.js +3 -4
  19. package/dist/badge/Badge.js.map +1 -1
  20. package/dist/box/Box.d.ts +3 -2
  21. package/dist/box/Box.js +3 -4
  22. package/dist/box/Box.js.map +1 -1
  23. package/dist/button/AsyncButton.d.ts +3 -2
  24. package/dist/button/AsyncButton.js +3 -4
  25. package/dist/button/AsyncButton.js.map +1 -1
  26. package/dist/button/Button.d.ts +3 -2
  27. package/dist/button/Button.js +3 -4
  28. package/dist/button/Button.js.map +1 -1
  29. package/dist/button/ButtonUnstyled.d.ts +5 -3
  30. package/dist/button/ButtonUnstyled.js +3 -4
  31. package/dist/button/ButtonUnstyled.js.map +1 -1
  32. package/dist/button/FloatingActionButton.d.ts +3 -2
  33. package/dist/button/FloatingActionButton.js +3 -4
  34. package/dist/button/FloatingActionButton.js.map +1 -1
  35. package/dist/button/TooltippedButton.d.ts +3 -2
  36. package/dist/button/TooltippedButton.js +3 -4
  37. package/dist/button/TooltippedButton.js.map +1 -1
  38. package/dist/card/Card.d.ts +3 -2
  39. package/dist/card/Card.js +3 -4
  40. package/dist/card/Card.js.map +1 -1
  41. package/dist/card/CardContent.d.ts +3 -2
  42. package/dist/card/CardContent.js +3 -4
  43. package/dist/card/CardContent.js.map +1 -1
  44. package/dist/card/CardFooter.d.ts +3 -1
  45. package/dist/card/CardFooter.js +3 -4
  46. package/dist/card/CardFooter.js.map +1 -1
  47. package/dist/card/CardHeader.d.ts +3 -2
  48. package/dist/card/CardHeader.js +3 -4
  49. package/dist/card/CardHeader.js.map +1 -1
  50. package/dist/card/CardSubtitle.d.ts +3 -1
  51. package/dist/card/CardSubtitle.js +3 -4
  52. package/dist/card/CardSubtitle.js.map +1 -1
  53. package/dist/card/CardTitle.d.ts +3 -1
  54. package/dist/card/CardTitle.js +3 -4
  55. package/dist/card/CardTitle.js.map +1 -1
  56. package/dist/card/ClickableCard.d.ts +3 -2
  57. package/dist/card/ClickableCard.js +3 -4
  58. package/dist/card/ClickableCard.js.map +1 -1
  59. package/dist/chip/Chip.d.ts +4 -2
  60. package/dist/chip/Chip.js +4 -4
  61. package/dist/chip/Chip.js.map +1 -1
  62. package/dist/datetime/NativeDateField.d.ts +3 -1
  63. package/dist/datetime/NativeDateField.js +3 -4
  64. package/dist/datetime/NativeDateField.js.map +1 -1
  65. package/dist/datetime/NativeTimeField.d.ts +3 -1
  66. package/dist/datetime/NativeTimeField.js +3 -4
  67. package/dist/datetime/NativeTimeField.js.map +1 -1
  68. package/dist/dialog/Dialog.d.ts +3 -2
  69. package/dist/dialog/Dialog.js +4 -4
  70. package/dist/dialog/Dialog.js.map +1 -1
  71. package/dist/dialog/DialogContainer.d.ts +3 -2
  72. package/dist/dialog/DialogContainer.js +3 -4
  73. package/dist/dialog/DialogContainer.js.map +1 -1
  74. package/dist/dialog/DialogContent.d.ts +3 -2
  75. package/dist/dialog/DialogContent.js +3 -4
  76. package/dist/dialog/DialogContent.js.map +1 -1
  77. package/dist/dialog/DialogFooter.d.ts +3 -2
  78. package/dist/dialog/DialogFooter.js +3 -4
  79. package/dist/dialog/DialogFooter.js.map +1 -1
  80. package/dist/dialog/DialogHeader.d.ts +3 -1
  81. package/dist/dialog/DialogHeader.js +3 -4
  82. package/dist/dialog/DialogHeader.js.map +1 -1
  83. package/dist/dialog/DialogTitle.d.ts +3 -1
  84. package/dist/dialog/DialogTitle.js +3 -4
  85. package/dist/dialog/DialogTitle.js.map +1 -1
  86. package/dist/dialog/FixedDialog.d.ts +4 -3
  87. package/dist/dialog/FixedDialog.js +4 -4
  88. package/dist/dialog/FixedDialog.js.map +1 -1
  89. package/dist/divider/Divider.d.ts +3 -2
  90. package/dist/divider/Divider.js +3 -4
  91. package/dist/divider/Divider.js.map +1 -1
  92. package/dist/draggable/useDraggable.d.ts +3 -3
  93. package/dist/draggable/useDraggable.js.map +1 -1
  94. package/dist/draggable/utils.d.ts +1 -1
  95. package/dist/draggable/utils.js.map +1 -1
  96. package/dist/expansion-panel/ExpansionList.d.ts +3 -2
  97. package/dist/expansion-panel/ExpansionList.js +3 -4
  98. package/dist/expansion-panel/ExpansionList.js.map +1 -1
  99. package/dist/expansion-panel/ExpansionPanel.d.ts +3 -2
  100. package/dist/expansion-panel/ExpansionPanel.js +3 -4
  101. package/dist/expansion-panel/ExpansionPanel.js.map +1 -1
  102. package/dist/expansion-panel/ExpansionPanelHeader.d.ts +3 -2
  103. package/dist/expansion-panel/ExpansionPanelHeader.js +3 -4
  104. package/dist/expansion-panel/ExpansionPanelHeader.js.map +1 -1
  105. package/dist/files/FileInput.d.ts +3 -2
  106. package/dist/files/FileInput.js +3 -4
  107. package/dist/files/FileInput.js.map +1 -1
  108. package/dist/focus/useFocusContainer.d.ts +1 -1
  109. package/dist/focus/useFocusContainer.js.map +1 -1
  110. package/dist/form/Checkbox.d.ts +2 -1
  111. package/dist/form/Checkbox.js +4 -4
  112. package/dist/form/Checkbox.js.map +1 -1
  113. package/dist/form/Fieldset.d.ts +3 -2
  114. package/dist/form/Fieldset.js +3 -4
  115. package/dist/form/Fieldset.js.map +1 -1
  116. package/dist/form/Form.d.ts +3 -2
  117. package/dist/form/Form.js +3 -4
  118. package/dist/form/Form.js.map +1 -1
  119. package/dist/form/FormMessage.d.ts +8 -2
  120. package/dist/form/FormMessage.js +3 -4
  121. package/dist/form/FormMessage.js.map +1 -1
  122. package/dist/form/FormMessageContainer.d.ts +5 -4
  123. package/dist/form/FormMessageContainer.js +3 -4
  124. package/dist/form/FormMessageContainer.js.map +1 -1
  125. package/dist/form/FormMessageCounter.d.ts +3 -2
  126. package/dist/form/FormMessageCounter.js +3 -4
  127. package/dist/form/FormMessageCounter.js.map +1 -1
  128. package/dist/form/InputToggle.d.ts +3 -2
  129. package/dist/form/InputToggle.js +3 -4
  130. package/dist/form/InputToggle.js.map +1 -1
  131. package/dist/form/InputToggleIcon.d.ts +3 -2
  132. package/dist/form/InputToggleIcon.js +3 -4
  133. package/dist/form/InputToggleIcon.js.map +1 -1
  134. package/dist/form/Label.d.ts +2 -1
  135. package/dist/form/Label.js +3 -4
  136. package/dist/form/Label.js.map +1 -1
  137. package/dist/form/Legend.d.ts +3 -1
  138. package/dist/form/Legend.js +3 -4
  139. package/dist/form/Legend.js.map +1 -1
  140. package/dist/form/NativeSelect.d.ts +3 -2
  141. package/dist/form/NativeSelect.js +3 -4
  142. package/dist/form/NativeSelect.js.map +1 -1
  143. package/dist/form/OptGroup.d.ts +3 -2
  144. package/dist/form/OptGroup.js +3 -4
  145. package/dist/form/OptGroup.js.map +1 -1
  146. package/dist/form/Option.d.ts +3 -2
  147. package/dist/form/Option.js +4 -4
  148. package/dist/form/Option.js.map +1 -1
  149. package/dist/form/Password.d.ts +2 -2
  150. package/dist/form/Password.js +3 -4
  151. package/dist/form/Password.js.map +1 -1
  152. package/dist/form/Radio.d.ts +2 -1
  153. package/dist/form/Radio.js +4 -4
  154. package/dist/form/Radio.js.map +1 -1
  155. package/dist/form/ResizingTextAreaWrapper.d.ts +3 -2
  156. package/dist/form/ResizingTextAreaWrapper.js +3 -4
  157. package/dist/form/ResizingTextAreaWrapper.js.map +1 -1
  158. package/dist/form/SliderContainer.d.ts +3 -2
  159. package/dist/form/SliderContainer.js +3 -4
  160. package/dist/form/SliderContainer.js.map +1 -1
  161. package/dist/form/SliderThumb.d.ts +3 -2
  162. package/dist/form/SliderThumb.js +4 -4
  163. package/dist/form/SliderThumb.js.map +1 -1
  164. package/dist/form/SliderTrack.d.ts +3 -2
  165. package/dist/form/SliderTrack.js +3 -4
  166. package/dist/form/SliderTrack.js.map +1 -1
  167. package/dist/form/Switch.d.ts +3 -2
  168. package/dist/form/Switch.js +3 -4
  169. package/dist/form/Switch.js.map +1 -1
  170. package/dist/form/SwitchTrack.d.ts +3 -2
  171. package/dist/form/SwitchTrack.js +3 -4
  172. package/dist/form/SwitchTrack.js.map +1 -1
  173. package/dist/form/TextArea.d.ts +3 -2
  174. package/dist/form/TextArea.js +3 -4
  175. package/dist/form/TextArea.js.map +1 -1
  176. package/dist/form/TextField.d.ts +3 -2
  177. package/dist/form/TextField.js +3 -4
  178. package/dist/form/TextField.js.map +1 -1
  179. package/dist/form/TextFieldAddon.d.ts +2 -1
  180. package/dist/form/TextFieldAddon.js +3 -4
  181. package/dist/form/TextFieldAddon.js.map +1 -1
  182. package/dist/form/TextFieldContainer.d.ts +3 -2
  183. package/dist/form/TextFieldContainer.js +3 -4
  184. package/dist/form/TextFieldContainer.js.map +1 -1
  185. package/dist/form/sliderUtils.d.ts +1 -1
  186. package/dist/form/sliderUtils.js.map +1 -1
  187. package/dist/form/types.d.ts +11 -5
  188. package/dist/form/types.js.map +1 -1
  189. package/dist/form/useCombobox.d.ts +6 -6
  190. package/dist/form/useCombobox.js.map +1 -1
  191. package/dist/form/useFormReset.d.ts +1 -1
  192. package/dist/form/useFormReset.js.map +1 -1
  193. package/dist/form/useTextField.d.ts +4 -4
  194. package/dist/form/useTextField.js.map +1 -1
  195. package/dist/hoverMode/useHoverMode.js +1 -1
  196. package/dist/hoverMode/useHoverMode.js.map +1 -1
  197. package/dist/hoverMode/useHoverModeProvider.d.ts +5 -5
  198. package/dist/hoverMode/useHoverModeProvider.js +1 -1
  199. package/dist/hoverMode/useHoverModeProvider.js.map +1 -1
  200. package/dist/icon/FontIcon.d.ts +3 -2
  201. package/dist/icon/FontIcon.js +3 -4
  202. package/dist/icon/FontIcon.js.map +1 -1
  203. package/dist/icon/IconRotator.d.ts +3 -2
  204. package/dist/icon/IconRotator.js +4 -4
  205. package/dist/icon/IconRotator.js.map +1 -1
  206. package/dist/icon/MaterialIcon.d.ts +3 -2
  207. package/dist/icon/MaterialIcon.js +3 -4
  208. package/dist/icon/MaterialIcon.js.map +1 -1
  209. package/dist/icon/MaterialSymbol.d.ts +3 -2
  210. package/dist/icon/MaterialSymbol.js +3 -4
  211. package/dist/icon/MaterialSymbol.js.map +1 -1
  212. package/dist/icon/SVGIcon.d.ts +3 -2
  213. package/dist/icon/SVGIcon.js +3 -4
  214. package/dist/icon/SVGIcon.js.map +1 -1
  215. package/dist/layout/LayoutAppBar.d.ts +3 -1
  216. package/dist/layout/LayoutAppBar.js +3 -4
  217. package/dist/layout/LayoutAppBar.js.map +1 -1
  218. package/dist/layout/LayoutNav.d.ts +3 -2
  219. package/dist/layout/LayoutNav.js +3 -4
  220. package/dist/layout/LayoutNav.js.map +1 -1
  221. package/dist/layout/LayoutWindowSplitter.d.ts +4 -2
  222. package/dist/layout/LayoutWindowSplitter.js +4 -4
  223. package/dist/layout/LayoutWindowSplitter.js.map +1 -1
  224. package/dist/layout/Main.d.ts +4 -3
  225. package/dist/layout/Main.js +3 -4
  226. package/dist/layout/Main.js.map +1 -1
  227. package/dist/link/Link.d.ts +10 -2
  228. package/dist/link/Link.js +4 -4
  229. package/dist/link/Link.js.map +1 -1
  230. package/dist/link/SkipToMainContent.d.ts +3 -2
  231. package/dist/link/SkipToMainContent.js +4 -4
  232. package/dist/link/SkipToMainContent.js.map +1 -1
  233. package/dist/list/List.d.ts +3 -2
  234. package/dist/list/List.js +3 -4
  235. package/dist/list/List.js.map +1 -1
  236. package/dist/list/ListItem.d.ts +3 -2
  237. package/dist/list/ListItem.js +3 -4
  238. package/dist/list/ListItem.js.map +1 -1
  239. package/dist/list/ListItemLink.d.ts +3 -2
  240. package/dist/list/ListItemLink.js +3 -4
  241. package/dist/list/ListItemLink.js.map +1 -1
  242. package/dist/list/ListItemText.d.ts +3 -2
  243. package/dist/list/ListItemText.js +3 -4
  244. package/dist/list/ListItemText.js.map +1 -1
  245. package/dist/list/ListSubheader.d.ts +3 -2
  246. package/dist/list/ListSubheader.js +3 -4
  247. package/dist/list/ListSubheader.js.map +1 -1
  248. package/dist/menu/DropdownMenu.js.map +1 -1
  249. package/dist/menu/Menu.d.ts +4 -2
  250. package/dist/menu/Menu.js +5 -4
  251. package/dist/menu/Menu.js.map +1 -1
  252. package/dist/menu/MenuBar.d.ts +3 -1
  253. package/dist/menu/MenuBar.js +3 -4
  254. package/dist/menu/MenuBar.js.map +1 -1
  255. package/dist/menu/MenuButton.d.ts +2 -1
  256. package/dist/menu/MenuButton.js +3 -4
  257. package/dist/menu/MenuButton.js.map +1 -1
  258. package/dist/menu/MenuItem.d.ts +3 -1
  259. package/dist/menu/MenuItem.js +3 -4
  260. package/dist/menu/MenuItem.js.map +1 -1
  261. package/dist/menu/MenuItemButton.d.ts +2 -1
  262. package/dist/menu/MenuItemButton.js +4 -4
  263. package/dist/menu/MenuItemButton.js.map +1 -1
  264. package/dist/menu/MenuItemCheckbox.d.ts +2 -1
  265. package/dist/menu/MenuItemCheckbox.js +4 -4
  266. package/dist/menu/MenuItemCheckbox.js.map +1 -1
  267. package/dist/menu/MenuItemCircularProgress.d.ts +3 -2
  268. package/dist/menu/MenuItemCircularProgress.js +3 -4
  269. package/dist/menu/MenuItemCircularProgress.js.map +1 -1
  270. package/dist/menu/MenuItemFileInput.d.ts +2 -2
  271. package/dist/menu/MenuItemFileInput.js +3 -4
  272. package/dist/menu/MenuItemFileInput.js.map +1 -1
  273. package/dist/menu/MenuItemGroup.d.ts +3 -3
  274. package/dist/menu/MenuItemGroup.js +4 -4
  275. package/dist/menu/MenuItemGroup.js.map +1 -1
  276. package/dist/menu/MenuItemInputToggle.d.ts +3 -2
  277. package/dist/menu/MenuItemInputToggle.js +3 -4
  278. package/dist/menu/MenuItemInputToggle.js.map +1 -1
  279. package/dist/menu/MenuItemRadio.d.ts +3 -1
  280. package/dist/menu/MenuItemRadio.js +4 -4
  281. package/dist/menu/MenuItemRadio.js.map +1 -1
  282. package/dist/menu/MenuItemSeparator.d.ts +3 -2
  283. package/dist/menu/MenuItemSeparator.js +3 -4
  284. package/dist/menu/MenuItemSeparator.js.map +1 -1
  285. package/dist/menu/MenuItemSwitch.d.ts +2 -1
  286. package/dist/menu/MenuItemSwitch.js +4 -4
  287. package/dist/menu/MenuItemSwitch.js.map +1 -1
  288. package/dist/menu/MenuItemTextField.d.ts +2 -2
  289. package/dist/menu/MenuItemTextField.js +3 -4
  290. package/dist/menu/MenuItemTextField.js.map +1 -1
  291. package/dist/menu/MenuVisibilityProvider.d.ts +3 -3
  292. package/dist/menu/MenuVisibilityProvider.js.map +1 -1
  293. package/dist/menu/MenuWidget.d.ts +4 -4
  294. package/dist/menu/MenuWidget.js +4 -4
  295. package/dist/menu/MenuWidget.js.map +1 -1
  296. package/dist/menu/useContextMenu.d.ts +4 -4
  297. package/dist/menu/useContextMenu.js.map +1 -1
  298. package/dist/movement/types.d.ts +5 -5
  299. package/dist/movement/types.js.map +1 -1
  300. package/dist/navigation/CollapsibleNavGroup.d.ts +2 -2
  301. package/dist/navigation/CollapsibleNavGroup.js +3 -4
  302. package/dist/navigation/CollapsibleNavGroup.js.map +1 -1
  303. package/dist/navigation/NavGroup.d.ts +3 -2
  304. package/dist/navigation/NavGroup.js +3 -4
  305. package/dist/navigation/NavGroup.js.map +1 -1
  306. package/dist/navigation/NavItem.d.ts +3 -2
  307. package/dist/navigation/NavItem.js +3 -4
  308. package/dist/navigation/NavItem.js.map +1 -1
  309. package/dist/navigation/NavItemButton.d.ts +2 -2
  310. package/dist/navigation/NavItemButton.js +3 -4
  311. package/dist/navigation/NavItemButton.js.map +1 -1
  312. package/dist/navigation/NavItemLink.d.ts +3 -2
  313. package/dist/navigation/NavItemLink.js +4 -4
  314. package/dist/navigation/NavItemLink.js.map +1 -1
  315. package/dist/navigation/NavSubheader.d.ts +2 -1
  316. package/dist/navigation/NavSubheader.js +3 -4
  317. package/dist/navigation/NavSubheader.js.map +1 -1
  318. package/dist/navigation/Navigation.d.ts +1 -1
  319. package/dist/navigation/Navigation.js +1 -1
  320. package/dist/navigation/Navigation.js.map +1 -1
  321. package/dist/navigation/types.d.ts +5 -2
  322. package/dist/navigation/types.js.map +1 -1
  323. package/dist/navigation/useActiveHeadingId.js +1 -1
  324. package/dist/navigation/useActiveHeadingId.js.map +1 -1
  325. package/dist/overlay/Overlay.d.ts +3 -2
  326. package/dist/overlay/Overlay.js +3 -4
  327. package/dist/overlay/Overlay.js.map +1 -1
  328. package/dist/positioning/useFixedPositioning.d.ts +1 -1
  329. package/dist/positioning/useFixedPositioning.js.map +1 -1
  330. package/dist/progress/CircularProgress.d.ts +2 -2
  331. package/dist/progress/CircularProgress.js +4 -4
  332. package/dist/progress/CircularProgress.js.map +1 -1
  333. package/dist/progress/LinearProgress.d.ts +2 -2
  334. package/dist/progress/LinearProgress.js +4 -4
  335. package/dist/progress/LinearProgress.js.map +1 -1
  336. package/dist/progress/types.d.ts +2 -0
  337. package/dist/progress/types.js.map +1 -1
  338. package/dist/responsive-item/ResponsiveItem.d.ts +3 -2
  339. package/dist/responsive-item/ResponsiveItem.js +3 -4
  340. package/dist/responsive-item/ResponsiveItem.js.map +1 -1
  341. package/dist/responsive-item/ResponsiveItemOverlay.d.ts +3 -2
  342. package/dist/responsive-item/ResponsiveItemOverlay.js +3 -4
  343. package/dist/responsive-item/ResponsiveItemOverlay.js.map +1 -1
  344. package/dist/segmented-button/SegmentedButton.d.ts +3 -2
  345. package/dist/segmented-button/SegmentedButton.js +3 -4
  346. package/dist/segmented-button/SegmentedButton.js.map +1 -1
  347. package/dist/segmented-button/SegmentedButtonContainer.d.ts +4 -3
  348. package/dist/segmented-button/SegmentedButtonContainer.js +4 -5
  349. package/dist/segmented-button/SegmentedButtonContainer.js.map +1 -1
  350. package/dist/sheet/Sheet.d.ts +2 -1
  351. package/dist/sheet/Sheet.js +3 -4
  352. package/dist/sheet/Sheet.js.map +1 -1
  353. package/dist/snackbar/Snackbar.d.ts +3 -2
  354. package/dist/snackbar/Snackbar.js +3 -4
  355. package/dist/snackbar/Snackbar.js.map +1 -1
  356. package/dist/snackbar/Toast.d.ts +3 -2
  357. package/dist/snackbar/Toast.js +4 -4
  358. package/dist/snackbar/Toast.js.map +1 -1
  359. package/dist/snackbar/ToastActionButton.d.ts +2 -1
  360. package/dist/snackbar/ToastActionButton.js +3 -4
  361. package/dist/snackbar/ToastActionButton.js.map +1 -1
  362. package/dist/snackbar/ToastCloseButton.d.ts +2 -1
  363. package/dist/snackbar/ToastCloseButton.js +3 -4
  364. package/dist/snackbar/ToastCloseButton.js.map +1 -1
  365. package/dist/snackbar/ToastContent.d.ts +3 -2
  366. package/dist/snackbar/ToastContent.js +4 -4
  367. package/dist/snackbar/ToastContent.js.map +1 -1
  368. package/dist/spinbutton/SpinButton.d.ts +4 -3
  369. package/dist/spinbutton/SpinButton.js +3 -4
  370. package/dist/spinbutton/SpinButton.js.map +1 -1
  371. package/dist/spinbutton/types.d.ts +1 -1
  372. package/dist/spinbutton/types.js.map +1 -1
  373. package/dist/table/StickyTableSection.d.ts +3 -2
  374. package/dist/table/StickyTableSection.js +3 -4
  375. package/dist/table/StickyTableSection.js.map +1 -1
  376. package/dist/table/Table.d.ts +3 -2
  377. package/dist/table/Table.js +4 -4
  378. package/dist/table/Table.js.map +1 -1
  379. package/dist/table/TableBody.d.ts +3 -2
  380. package/dist/table/TableBody.js +4 -4
  381. package/dist/table/TableBody.js.map +1 -1
  382. package/dist/table/TableCell.d.ts +3 -2
  383. package/dist/table/TableCell.js +3 -4
  384. package/dist/table/TableCell.js.map +1 -1
  385. package/dist/table/TableCellContent.d.ts +3 -2
  386. package/dist/table/TableCellContent.js +3 -4
  387. package/dist/table/TableCellContent.js.map +1 -1
  388. package/dist/table/TableCheckbox.d.ts +3 -2
  389. package/dist/table/TableCheckbox.js +3 -4
  390. package/dist/table/TableCheckbox.js.map +1 -1
  391. package/dist/table/TableContainer.d.ts +5 -3
  392. package/dist/table/TableContainer.js +4 -4
  393. package/dist/table/TableContainer.js.map +1 -1
  394. package/dist/table/TableContainerProvider.d.ts +1 -1
  395. package/dist/table/TableContainerProvider.js.map +1 -1
  396. package/dist/table/TableFooter.d.ts +3 -2
  397. package/dist/table/TableFooter.js +4 -5
  398. package/dist/table/TableFooter.js.map +1 -1
  399. package/dist/table/TableHeader.d.ts +3 -2
  400. package/dist/table/TableHeader.js +4 -5
  401. package/dist/table/TableHeader.js.map +1 -1
  402. package/dist/table/TableRadio.d.ts +3 -2
  403. package/dist/table/TableRadio.js +3 -4
  404. package/dist/table/TableRadio.js.map +1 -1
  405. package/dist/table/TableRow.d.ts +3 -2
  406. package/dist/table/TableRow.js +3 -4
  407. package/dist/table/TableRow.js.map +1 -1
  408. package/dist/tabs/SimpleTabPanel.d.ts +3 -2
  409. package/dist/tabs/SimpleTabPanel.js +3 -4
  410. package/dist/tabs/SimpleTabPanel.js.map +1 -1
  411. package/dist/tabs/SimpleTabPanels.d.ts +3 -2
  412. package/dist/tabs/SimpleTabPanels.js +3 -4
  413. package/dist/tabs/SimpleTabPanels.js.map +1 -1
  414. package/dist/tabs/TabList.d.ts +3 -2
  415. package/dist/tabs/TabList.js +4 -4
  416. package/dist/tabs/TabList.js.map +1 -1
  417. package/dist/tabs/TabListScrollButton.d.ts +3 -2
  418. package/dist/tabs/TabListScrollButton.js +4 -4
  419. package/dist/tabs/TabListScrollButton.js.map +1 -1
  420. package/dist/tabs/useTabList.d.ts +2 -2
  421. package/dist/tabs/useTabList.js.map +1 -1
  422. package/dist/theme/useCSSVariables.d.ts +1 -1
  423. package/dist/theme/useCSSVariables.js.map +1 -1
  424. package/dist/tooltip/Tooltip.d.ts +3 -2
  425. package/dist/tooltip/Tooltip.js +3 -4
  426. package/dist/tooltip/Tooltip.js.map +1 -1
  427. package/dist/tooltip/useTooltip.d.ts +3 -3
  428. package/dist/tooltip/useTooltip.js.map +1 -1
  429. package/dist/transition/SkeletonPlaceholder.d.ts +3 -2
  430. package/dist/transition/SkeletonPlaceholder.js +3 -4
  431. package/dist/transition/SkeletonPlaceholder.js.map +1 -1
  432. package/dist/transition/Slide.d.ts +3 -2
  433. package/dist/transition/Slide.js +3 -4
  434. package/dist/transition/Slide.js.map +1 -1
  435. package/dist/transition/SlideContainer.d.ts +3 -2
  436. package/dist/transition/SlideContainer.js +3 -4
  437. package/dist/transition/SlideContainer.js.map +1 -1
  438. package/dist/tree/TreeGroup.d.ts +2 -2
  439. package/dist/tree/TreeGroup.js +3 -4
  440. package/dist/tree/TreeGroup.js.map +1 -1
  441. package/dist/tree/TreeProvider.d.ts +2 -3
  442. package/dist/tree/TreeProvider.js.map +1 -1
  443. package/dist/tree/useTreeMovement.d.ts +6 -7
  444. package/dist/tree/useTreeMovement.js.map +1 -1
  445. package/dist/types.d.ts +1 -15
  446. package/dist/types.js.map +1 -1
  447. package/dist/typography/Mark.d.ts +3 -2
  448. package/dist/typography/Mark.js +3 -4
  449. package/dist/typography/Mark.js.map +1 -1
  450. package/dist/typography/SrOnly.d.ts +3 -2
  451. package/dist/typography/SrOnly.js +3 -4
  452. package/dist/typography/SrOnly.js.map +1 -1
  453. package/dist/typography/TextContainer.d.ts +3 -2
  454. package/dist/typography/TextContainer.js +3 -4
  455. package/dist/typography/TextContainer.js.map +1 -1
  456. package/dist/typography/Typography.d.ts +3 -2
  457. package/dist/typography/Typography.js +3 -4
  458. package/dist/typography/Typography.js.map +1 -1
  459. package/dist/useAsyncFunction.d.ts +3 -2
  460. package/dist/useAsyncFunction.js.map +1 -1
  461. package/dist/useDebouncedFunction.js +1 -1
  462. package/dist/useDebouncedFunction.js.map +1 -1
  463. package/dist/useDropzone.js +1 -1
  464. package/dist/useDropzone.js.map +1 -1
  465. package/dist/useEnsuredRef.d.ts +3 -3
  466. package/dist/useEnsuredRef.js +1 -1
  467. package/dist/useEnsuredRef.js.map +1 -1
  468. package/dist/useThrottledFunction.js +3 -3
  469. package/dist/useThrottledFunction.js.map +1 -1
  470. package/dist/useUnmounted.d.ts +2 -2
  471. package/dist/useUnmounted.js.map +1 -1
  472. package/dist/utils/applyRef.d.ts +1 -1
  473. package/dist/utils/applyRef.js.map +1 -1
  474. package/dist/window-splitter/WindowSplitter.d.ts +3 -2
  475. package/dist/window-splitter/WindowSplitter.js +3 -4
  476. package/dist/window-splitter/WindowSplitter.js.map +1 -1
  477. package/package.json +9 -9
  478. package/src/app-bar/AppBar.tsx +54 -54
  479. package/src/app-bar/AppBarTitle.tsx +29 -27
  480. package/src/autocomplete/AutocompleteChip.tsx +4 -6
  481. package/src/autocomplete/types.ts +2 -0
  482. package/src/autocomplete/utils.ts +4 -4
  483. package/src/avatar/Avatar.tsx +47 -45
  484. package/src/badge/Badge.tsx +17 -11
  485. package/src/box/Box.tsx +51 -50
  486. package/src/button/AsyncButton.tsx +125 -119
  487. package/src/button/Button.tsx +74 -73
  488. package/src/button/ButtonUnstyled.tsx +9 -9
  489. package/src/button/FloatingActionButton.tsx +9 -7
  490. package/src/button/TooltippedButton.tsx +6 -6
  491. package/src/card/Card.tsx +36 -35
  492. package/src/card/CardContent.tsx +31 -28
  493. package/src/card/CardFooter.tsx +22 -16
  494. package/src/card/CardHeader.tsx +36 -30
  495. package/src/card/CardSubtitle.tsx +8 -6
  496. package/src/card/CardTitle.tsx +26 -25
  497. package/src/card/ClickableCard.tsx +57 -54
  498. package/src/chip/Chip.tsx +122 -120
  499. package/src/datetime/NativeDateField.tsx +7 -7
  500. package/src/datetime/NativeTimeField.tsx +7 -7
  501. package/src/dialog/Dialog.tsx +156 -150
  502. package/src/dialog/DialogContainer.tsx +35 -29
  503. package/src/dialog/DialogContent.tsx +26 -19
  504. package/src/dialog/DialogFooter.tsx +22 -19
  505. package/src/dialog/DialogHeader.tsx +24 -23
  506. package/src/dialog/DialogTitle.tsx +27 -26
  507. package/src/dialog/FixedDialog.tsx +70 -69
  508. package/src/divider/Divider.tsx +32 -26
  509. package/src/draggable/useDraggable.ts +3 -6
  510. package/src/draggable/utils.ts +1 -1
  511. package/src/expansion-panel/ExpansionList.tsx +24 -19
  512. package/src/expansion-panel/ExpansionPanel.tsx +11 -6
  513. package/src/expansion-panel/ExpansionPanelHeader.tsx +9 -6
  514. package/src/files/FileInput.tsx +79 -79
  515. package/src/focus/useFocusContainer.ts +1 -1
  516. package/src/form/Checkbox.tsx +6 -6
  517. package/src/form/Fieldset.tsx +33 -28
  518. package/src/form/Form.tsx +26 -25
  519. package/src/form/FormMessage.tsx +13 -7
  520. package/src/form/FormMessageContainer.tsx +12 -9
  521. package/src/form/FormMessageCounter.tsx +8 -7
  522. package/src/form/InputToggle.tsx +105 -107
  523. package/src/form/InputToggleIcon.tsx +12 -6
  524. package/src/form/Label.tsx +40 -41
  525. package/src/form/Legend.tsx +44 -43
  526. package/src/form/NativeSelect.tsx +116 -114
  527. package/src/form/OptGroup.tsx +15 -15
  528. package/src/form/Option.tsx +123 -122
  529. package/src/form/Password.tsx +66 -67
  530. package/src/form/Radio.tsx +6 -6
  531. package/src/form/ResizingTextAreaWrapper.tsx +7 -6
  532. package/src/form/SliderContainer.tsx +35 -29
  533. package/src/form/SliderThumb.tsx +8 -6
  534. package/src/form/SliderTrack.tsx +80 -80
  535. package/src/form/Switch.tsx +80 -79
  536. package/src/form/SwitchTrack.tsx +35 -34
  537. package/src/form/TextArea.tsx +167 -165
  538. package/src/form/TextField.tsx +106 -104
  539. package/src/form/TextFieldAddon.tsx +33 -32
  540. package/src/form/TextFieldContainer.tsx +8 -6
  541. package/src/form/sliderUtils.ts +1 -1
  542. package/src/form/types.ts +15 -5
  543. package/src/form/useCombobox.ts +6 -10
  544. package/src/form/useFormReset.ts +1 -1
  545. package/src/form/useTextField.ts +4 -4
  546. package/src/hoverMode/useHoverMode.ts +1 -1
  547. package/src/hoverMode/useHoverModeProvider.ts +13 -8
  548. package/src/icon/FontIcon.tsx +32 -30
  549. package/src/icon/IconRotator.tsx +30 -28
  550. package/src/icon/MaterialIcon.tsx +36 -30
  551. package/src/icon/MaterialSymbol.tsx +50 -44
  552. package/src/icon/SVGIcon.tsx +47 -41
  553. package/src/layout/LayoutAppBar.tsx +23 -28
  554. package/src/layout/LayoutNav.tsx +68 -62
  555. package/src/layout/LayoutWindowSplitter.tsx +9 -7
  556. package/src/layout/Main.tsx +30 -29
  557. package/src/link/Link.tsx +16 -11
  558. package/src/link/SkipToMainContent.tsx +6 -6
  559. package/src/list/List.tsx +31 -29
  560. package/src/list/ListItem.tsx +126 -125
  561. package/src/list/ListItemLink.tsx +128 -126
  562. package/src/list/ListItemText.tsx +42 -37
  563. package/src/list/ListSubheader.tsx +27 -26
  564. package/src/menu/DropdownMenu.tsx +2 -2
  565. package/src/menu/Menu.tsx +327 -326
  566. package/src/menu/MenuBar.tsx +51 -50
  567. package/src/menu/MenuButton.tsx +69 -70
  568. package/src/menu/MenuItem.tsx +37 -37
  569. package/src/menu/MenuItemButton.tsx +132 -133
  570. package/src/menu/MenuItemCheckbox.tsx +6 -7
  571. package/src/menu/MenuItemCircularProgress.tsx +13 -6
  572. package/src/menu/MenuItemFileInput.tsx +4 -6
  573. package/src/menu/MenuItemGroup.tsx +18 -18
  574. package/src/menu/MenuItemInputToggle.tsx +8 -6
  575. package/src/menu/MenuItemRadio.tsx +6 -6
  576. package/src/menu/MenuItemSeparator.tsx +7 -7
  577. package/src/menu/MenuItemSwitch.tsx +6 -6
  578. package/src/menu/MenuItemTextField.tsx +5 -7
  579. package/src/menu/MenuVisibilityProvider.tsx +3 -2
  580. package/src/menu/MenuWidget.tsx +123 -119
  581. package/src/menu/useContextMenu.ts +7 -4
  582. package/src/movement/types.ts +5 -9
  583. package/src/navigation/CollapsibleNavGroup.tsx +10 -6
  584. package/src/navigation/NavGroup.tsx +18 -19
  585. package/src/navigation/NavItem.tsx +16 -11
  586. package/src/navigation/NavItemButton.tsx +69 -66
  587. package/src/navigation/NavItemLink.tsx +102 -100
  588. package/src/navigation/NavSubheader.tsx +14 -16
  589. package/src/navigation/Navigation.tsx +1 -1
  590. package/src/navigation/types.ts +13 -4
  591. package/src/navigation/useActiveHeadingId.ts +1 -1
  592. package/src/overlay/Overlay.tsx +66 -65
  593. package/src/positioning/useFixedPositioning.ts +1 -1
  594. package/src/progress/CircularProgress.tsx +6 -6
  595. package/src/progress/LinearProgress.tsx +6 -6
  596. package/src/progress/types.ts +4 -0
  597. package/src/responsive-item/ResponsiveItem.tsx +29 -28
  598. package/src/responsive-item/ResponsiveItemOverlay.tsx +9 -8
  599. package/src/segmented-button/SegmentedButton.tsx +11 -6
  600. package/src/segmented-button/SegmentedButtonContainer.tsx +14 -8
  601. package/src/sheet/Sheet.tsx +42 -43
  602. package/src/snackbar/Snackbar.tsx +44 -38
  603. package/src/snackbar/Toast.tsx +110 -109
  604. package/src/snackbar/ToastActionButton.tsx +6 -6
  605. package/src/snackbar/ToastCloseButton.tsx +4 -6
  606. package/src/snackbar/ToastContent.tsx +56 -49
  607. package/src/spinbutton/SpinButton.tsx +9 -8
  608. package/src/spinbutton/types.ts +1 -1
  609. package/src/table/StickyTableSection.tsx +8 -6
  610. package/src/table/Table.tsx +47 -41
  611. package/src/table/TableBody.tsx +46 -42
  612. package/src/table/TableCell.tsx +83 -81
  613. package/src/table/TableCellContent.tsx +11 -6
  614. package/src/table/TableCheckbox.tsx +6 -6
  615. package/src/table/TableContainer.tsx +31 -26
  616. package/src/table/TableContainerProvider.ts +1 -1
  617. package/src/table/TableFooter.tsx +7 -12
  618. package/src/table/TableHeader.tsx +15 -9
  619. package/src/table/TableRadio.tsx +59 -58
  620. package/src/table/TableRow.tsx +34 -33
  621. package/src/tabs/SimpleTabPanel.tsx +18 -13
  622. package/src/tabs/SimpleTabPanels.tsx +11 -7
  623. package/src/tabs/TabList.tsx +106 -105
  624. package/src/tabs/TabListScrollButton.tsx +9 -6
  625. package/src/tabs/useTabList.ts +2 -2
  626. package/src/theme/useCSSVariables.ts +1 -1
  627. package/src/tooltip/Tooltip.tsx +61 -61
  628. package/src/tooltip/useTooltip.ts +2 -3
  629. package/src/transition/SkeletonPlaceholder.tsx +8 -6
  630. package/src/transition/Slide.tsx +54 -48
  631. package/src/transition/SlideContainer.tsx +16 -16
  632. package/src/tree/TreeGroup.tsx +54 -55
  633. package/src/tree/TreeProvider.tsx +2 -2
  634. package/src/tree/useTreeMovement.ts +6 -6
  635. package/src/types.ts +1 -16
  636. package/src/typography/Mark.tsx +16 -11
  637. package/src/typography/SrOnly.tsx +41 -35
  638. package/src/typography/TextContainer.tsx +12 -12
  639. package/src/typography/Typography.tsx +42 -41
  640. package/src/useAsyncFunction.ts +3 -3
  641. package/src/useDebouncedFunction.ts +1 -1
  642. package/src/useDropzone.ts +1 -1
  643. package/src/useEnsuredRef.ts +3 -3
  644. package/src/useThrottledFunction.ts +3 -3
  645. package/src/useUnmounted.ts +2 -4
  646. package/src/utils/applyRef.ts +2 -2
  647. package/src/window-splitter/WindowSplitter.tsx +6 -6
@@ -79,7 +79,7 @@ const noop = ()=>{
79
79
  const { onDrop, onDragOver = noop, onDragEnter = noop, onDragLeave = noop, disableDragging = false } = options;
80
80
  const [isOver, setOver] = useState(false);
81
81
  const { toggled: isDragging, enable: startDragging, disable: stopDragging } = useToggle();
82
- const draggingTimeout = useRef();
82
+ const draggingTimeout = useRef(undefined);
83
83
  // Browsers sometimes don't trigger a dragleave event for the entire
84
84
  // document, so we have to work around that by using the `dragover` event
85
85
  // instead. The `dragover` event will continually fire within the window
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/useDropzone.ts"],"sourcesContent":["\"use client\";\n\nimport {\n type DragEvent,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from \"react\";\n\nimport { useToggle } from \"./useToggle.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @since 5.1.3\n * @since 6.0.0 The element type is dynamically inferred on each handler\n * instead of the `DropzoneHandlers` type.\n */\nexport interface DropzoneHandlers {\n onDrop: <E extends HTMLElement>(event: DragEvent<E>) => void;\n onDragEnter?: <E extends HTMLElement>(event: DragEvent<E>) => void;\n onDragOver?: <E extends HTMLElement>(event: DragEvent<E>) => void;\n onDragLeave?: <E extends HTMLElement>(event: DragEvent<E>) => void;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface DropzoneOptions extends DropzoneHandlers {\n /**\n * By default, the `useDropzone` hook will listen to any `dragenter`/`dragover`\n * events on the page and enabling the {@link DragHookReturnValue.isDragging}\n * flag to show that the user is dragging _something_ and they might want to\n * drag that something into the dropzone.\n *\n * So set this option to `true` if that behavior is not required and only\n * drag events on the dropzone element need to be captured.\n *\n * @defaultValue `false`\n * @see {@link DropzoneImplementation.isDragging}\n */\n disableDragging?: boolean;\n}\n\n/**\n * @since 2.9.0\n * @since 6.0.0 Renamed from `DropzoneHookReturnValue` to\n * `DropzoneImplementation` to match other naming conventions. Returns an\n * object instead of an ordered array of `[isOver: boolean, dropzoneHandlers:\n * DropzoneHandlers]`. Also returns a new `isDragging` state.\n */\nexport interface DropzoneImplementation {\n /**\n * This will be `true` when the user is dragging something over the dropzone\n * target.\n */\n isOver: boolean;\n\n /**\n * This will be `true` when the user is dragging anything within the document.\n * The main use case for this is detecting when a user is dragging a file into\n * the document so you can help highlight the dropzone area.\n *\n * This will always be `false` if {@link DropzoneOptions.disableDragging} is\n * `true`.\n */\n isDragging: boolean;\n\n /**\n * The event handlers that should be passed to the dropzone target.\n */\n dropzoneHandlers: Required<DropzoneHandlers>;\n}\n\n/**\n * @example Simple Example\n * ```tsx\n * import { useFileUpload } from \"@react-md/core/files/useFileUpload\";\n * import { useDropzone } from \"@react-md/core/useDropzone\";\n * import { type CSSProperties, type ReactElement } from \"react\";\n *\n * const style: CSSProperties = {\n * border: '1px solid blue',\n * };\n *\n * function Example(): ReactElement {\n * const { onDrop } = useFileUpload()\n * const { isOver, dropzoneHandlers } = useDropzone({\n * onDrop(event) {\n * // normally use the `onDrop` behavior from `useFileUpload` to upload\n * // files:\n * // onDrop(event);\n * },\n * disableDragging: true,\n * });\n *\n * return (\n * <div {...dropzoneHandlers} style={isOver ? style : {}}>\n * Drag and drop some files!\n * {isOver && <UploadSVGIcon />}\n * </div>\n * );\n * }\n * ```\n *\n * @example Dragging Example\n * ```tsx\n * import { useFileUpload } from \"@react-md/core/files/useFileUpload\";\n * import { useDropzone } from \"@react-md/core/useDropzone\";\n * import { type CSSProperties, type ReactElement } from \"react\";\n *\n * const draggingStyle: CSSProperties = {\n * backgroundColor: \"orange\",\n * };\n * const overStyle: CSSProperties = {\n * border: '1px solid blue',\n * };\n *\n * function Example(): ReactElement {\n * const { onDrop } = useFileUpload()\n * const { isOver, isDragging, dropzoneHandlers } = useDropzone({\n * onDrop(event) {\n * // normally use the `onDrop` behavior from `useFileUpload` to upload\n * // files:\n * // onDrop(event);\n * },\n * });\n *\n * return (\n * <div\n * {...dropzoneHandlers}\n * style={{\n * ...(isDragging && draggingStyle),\n * ...(isOver && overStyle),\n * }}\n * >\n * Drag and drop some files!\n * {isOver && <UploadSVGIcon />}\n * </div>\n * );\n * }\n * ```\n *\n * @since 2.9.0\n * @since 6.0.0 Supports document-level dragging flag;\n */\nexport function useDropzone(options: DropzoneOptions): DropzoneImplementation {\n const {\n onDrop,\n onDragOver = noop,\n onDragEnter = noop,\n onDragLeave = noop,\n disableDragging = false,\n } = options;\n\n const [isOver, setOver] = useState(false);\n const {\n toggled: isDragging,\n enable: startDragging,\n disable: stopDragging,\n } = useToggle();\n const draggingTimeout = useRef<NodeJS.Timeout>();\n\n // Browsers sometimes don't trigger a dragleave event for the entire\n // document, so we have to work around that by using the `dragover` event\n // instead. The `dragover` event will continually fire within the window\n // until the user drops the file or moves the file outside of the window.\n const delayedStopDragging = useCallback(() => {\n globalThis.clearTimeout(draggingTimeout.current);\n draggingTimeout.current = globalThis.setTimeout(() => {\n stopDragging();\n }, 100);\n }, [stopDragging]);\n\n useEffect(() => {\n if (disableDragging) {\n return;\n }\n\n globalThis.addEventListener(\"dragenter\", startDragging);\n globalThis.addEventListener(\"dragover\", delayedStopDragging);\n return () => {\n globalThis.clearTimeout(draggingTimeout.current);\n globalThis.removeEventListener(\"dragenter\", startDragging);\n globalThis.removeEventListener(\"dragover\", delayedStopDragging);\n };\n }, [delayedStopDragging, disableDragging, startDragging]);\n\n return {\n isOver,\n isDragging,\n dropzoneHandlers: {\n // Note: need to call `event.stopPropagation()` and\n // `event.preventDefault())` for each of these handlers to prevent the\n // default browser behavior when dropping. Only calling within `onDrop`\n // does not work.\n //\n // i.e. dropping an image would preview that image in the current\n // window/tab instead of triggering the drop event.\n onDrop(event) {\n event.preventDefault();\n event.stopPropagation();\n\n globalThis.clearTimeout(draggingTimeout.current);\n onDrop(event);\n setOver(false);\n stopDragging();\n },\n onDragOver(event) {\n event.preventDefault();\n event.stopPropagation();\n\n globalThis.clearTimeout(draggingTimeout.current);\n onDragOver(event);\n setOver(true);\n },\n onDragEnter(event) {\n event.preventDefault();\n event.stopPropagation();\n\n onDragEnter(event);\n setOver(true);\n },\n onDragLeave(event) {\n event.preventDefault();\n event.stopPropagation();\n\n onDragLeave(event);\n setOver(false);\n // this stops dragging if the user's File Explorer is somewhat above the dropzone\n // and drags out into the File Explorer\n delayedStopDragging();\n },\n },\n };\n}\n"],"names":["useCallback","useEffect","useRef","useState","useToggle","noop","useDropzone","options","onDrop","onDragOver","onDragEnter","onDragLeave","disableDragging","isOver","setOver","toggled","isDragging","enable","startDragging","disable","stopDragging","draggingTimeout","delayedStopDragging","globalThis","clearTimeout","current","setTimeout","addEventListener","removeEventListener","dropzoneHandlers","event","preventDefault","stopPropagation"],"mappings":"AAAA;AAEA,SAEEA,WAAW,EACXC,SAAS,EACTC,MAAM,EACNC,QAAQ,QACH,QAAQ;AAEf,SAASC,SAAS,QAAQ,iBAAiB;AAE3C,MAAMC,OAAO;AACX,aAAa;AACf;AA+DA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuEC,GACD,OAAO,SAASC,YAAYC,OAAwB;IAClD,MAAM,EACJC,MAAM,EACNC,aAAaJ,IAAI,EACjBK,cAAcL,IAAI,EAClBM,cAAcN,IAAI,EAClBO,kBAAkB,KAAK,EACxB,GAAGL;IAEJ,MAAM,CAACM,QAAQC,QAAQ,GAAGX,SAAS;IACnC,MAAM,EACJY,SAASC,UAAU,EACnBC,QAAQC,aAAa,EACrBC,SAASC,YAAY,EACtB,GAAGhB;IACJ,MAAMiB,kBAAkBnB;IAExB,oEAAoE;IACpE,yEAAyE;IACzE,wEAAwE;IACxE,yEAAyE;IACzE,MAAMoB,sBAAsBtB,YAAY;QACtCuB,WAAWC,YAAY,CAACH,gBAAgBI,OAAO;QAC/CJ,gBAAgBI,OAAO,GAAGF,WAAWG,UAAU,CAAC;YAC9CN;QACF,GAAG;IACL,GAAG;QAACA;KAAa;IAEjBnB,UAAU;QACR,IAAIW,iBAAiB;YACnB;QACF;QAEAW,WAAWI,gBAAgB,CAAC,aAAaT;QACzCK,WAAWI,gBAAgB,CAAC,YAAYL;QACxC,OAAO;YACLC,WAAWC,YAAY,CAACH,gBAAgBI,OAAO;YAC/CF,WAAWK,mBAAmB,CAAC,aAAaV;YAC5CK,WAAWK,mBAAmB,CAAC,YAAYN;QAC7C;IACF,GAAG;QAACA;QAAqBV;QAAiBM;KAAc;IAExD,OAAO;QACLL;QACAG;QACAa,kBAAkB;YAChB,mDAAmD;YACnD,sEAAsE;YACtE,uEAAuE;YACvE,iBAAiB;YACjB,EAAE;YACF,iEAAiE;YACjE,mDAAmD;YACnDrB,QAAOsB,KAAK;gBACVA,MAAMC,cAAc;gBACpBD,MAAME,eAAe;gBAErBT,WAAWC,YAAY,CAACH,gBAAgBI,OAAO;gBAC/CjB,OAAOsB;gBACPhB,QAAQ;gBACRM;YACF;YACAX,YAAWqB,KAAK;gBACdA,MAAMC,cAAc;gBACpBD,MAAME,eAAe;gBAErBT,WAAWC,YAAY,CAACH,gBAAgBI,OAAO;gBAC/ChB,WAAWqB;gBACXhB,QAAQ;YACV;YACAJ,aAAYoB,KAAK;gBACfA,MAAMC,cAAc;gBACpBD,MAAME,eAAe;gBAErBtB,YAAYoB;gBACZhB,QAAQ;YACV;YACAH,aAAYmB,KAAK;gBACfA,MAAMC,cAAc;gBACpBD,MAAME,eAAe;gBAErBrB,YAAYmB;gBACZhB,QAAQ;gBACR,iFAAiF;gBACjF,uCAAuC;gBACvCQ;YACF;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["../src/useDropzone.ts"],"sourcesContent":["\"use client\";\n\nimport {\n type DragEvent,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from \"react\";\n\nimport { useToggle } from \"./useToggle.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @since 5.1.3\n * @since 6.0.0 The element type is dynamically inferred on each handler\n * instead of the `DropzoneHandlers` type.\n */\nexport interface DropzoneHandlers {\n onDrop: <E extends HTMLElement>(event: DragEvent<E>) => void;\n onDragEnter?: <E extends HTMLElement>(event: DragEvent<E>) => void;\n onDragOver?: <E extends HTMLElement>(event: DragEvent<E>) => void;\n onDragLeave?: <E extends HTMLElement>(event: DragEvent<E>) => void;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface DropzoneOptions extends DropzoneHandlers {\n /**\n * By default, the `useDropzone` hook will listen to any `dragenter`/`dragover`\n * events on the page and enabling the {@link DragHookReturnValue.isDragging}\n * flag to show that the user is dragging _something_ and they might want to\n * drag that something into the dropzone.\n *\n * So set this option to `true` if that behavior is not required and only\n * drag events on the dropzone element need to be captured.\n *\n * @defaultValue `false`\n * @see {@link DropzoneImplementation.isDragging}\n */\n disableDragging?: boolean;\n}\n\n/**\n * @since 2.9.0\n * @since 6.0.0 Renamed from `DropzoneHookReturnValue` to\n * `DropzoneImplementation` to match other naming conventions. Returns an\n * object instead of an ordered array of `[isOver: boolean, dropzoneHandlers:\n * DropzoneHandlers]`. Also returns a new `isDragging` state.\n */\nexport interface DropzoneImplementation {\n /**\n * This will be `true` when the user is dragging something over the dropzone\n * target.\n */\n isOver: boolean;\n\n /**\n * This will be `true` when the user is dragging anything within the document.\n * The main use case for this is detecting when a user is dragging a file into\n * the document so you can help highlight the dropzone area.\n *\n * This will always be `false` if {@link DropzoneOptions.disableDragging} is\n * `true`.\n */\n isDragging: boolean;\n\n /**\n * The event handlers that should be passed to the dropzone target.\n */\n dropzoneHandlers: Required<DropzoneHandlers>;\n}\n\n/**\n * @example Simple Example\n * ```tsx\n * import { useFileUpload } from \"@react-md/core/files/useFileUpload\";\n * import { useDropzone } from \"@react-md/core/useDropzone\";\n * import { type CSSProperties, type ReactElement } from \"react\";\n *\n * const style: CSSProperties = {\n * border: '1px solid blue',\n * };\n *\n * function Example(): ReactElement {\n * const { onDrop } = useFileUpload()\n * const { isOver, dropzoneHandlers } = useDropzone({\n * onDrop(event) {\n * // normally use the `onDrop` behavior from `useFileUpload` to upload\n * // files:\n * // onDrop(event);\n * },\n * disableDragging: true,\n * });\n *\n * return (\n * <div {...dropzoneHandlers} style={isOver ? style : {}}>\n * Drag and drop some files!\n * {isOver && <UploadSVGIcon />}\n * </div>\n * );\n * }\n * ```\n *\n * @example Dragging Example\n * ```tsx\n * import { useFileUpload } from \"@react-md/core/files/useFileUpload\";\n * import { useDropzone } from \"@react-md/core/useDropzone\";\n * import { type CSSProperties, type ReactElement } from \"react\";\n *\n * const draggingStyle: CSSProperties = {\n * backgroundColor: \"orange\",\n * };\n * const overStyle: CSSProperties = {\n * border: '1px solid blue',\n * };\n *\n * function Example(): ReactElement {\n * const { onDrop } = useFileUpload()\n * const { isOver, isDragging, dropzoneHandlers } = useDropzone({\n * onDrop(event) {\n * // normally use the `onDrop` behavior from `useFileUpload` to upload\n * // files:\n * // onDrop(event);\n * },\n * });\n *\n * return (\n * <div\n * {...dropzoneHandlers}\n * style={{\n * ...(isDragging && draggingStyle),\n * ...(isOver && overStyle),\n * }}\n * >\n * Drag and drop some files!\n * {isOver && <UploadSVGIcon />}\n * </div>\n * );\n * }\n * ```\n *\n * @since 2.9.0\n * @since 6.0.0 Supports document-level dragging flag;\n */\nexport function useDropzone(options: DropzoneOptions): DropzoneImplementation {\n const {\n onDrop,\n onDragOver = noop,\n onDragEnter = noop,\n onDragLeave = noop,\n disableDragging = false,\n } = options;\n\n const [isOver, setOver] = useState(false);\n const {\n toggled: isDragging,\n enable: startDragging,\n disable: stopDragging,\n } = useToggle();\n const draggingTimeout = useRef<NodeJS.Timeout>(undefined);\n\n // Browsers sometimes don't trigger a dragleave event for the entire\n // document, so we have to work around that by using the `dragover` event\n // instead. The `dragover` event will continually fire within the window\n // until the user drops the file or moves the file outside of the window.\n const delayedStopDragging = useCallback(() => {\n globalThis.clearTimeout(draggingTimeout.current);\n draggingTimeout.current = globalThis.setTimeout(() => {\n stopDragging();\n }, 100);\n }, [stopDragging]);\n\n useEffect(() => {\n if (disableDragging) {\n return;\n }\n\n globalThis.addEventListener(\"dragenter\", startDragging);\n globalThis.addEventListener(\"dragover\", delayedStopDragging);\n return () => {\n globalThis.clearTimeout(draggingTimeout.current);\n globalThis.removeEventListener(\"dragenter\", startDragging);\n globalThis.removeEventListener(\"dragover\", delayedStopDragging);\n };\n }, [delayedStopDragging, disableDragging, startDragging]);\n\n return {\n isOver,\n isDragging,\n dropzoneHandlers: {\n // Note: need to call `event.stopPropagation()` and\n // `event.preventDefault())` for each of these handlers to prevent the\n // default browser behavior when dropping. Only calling within `onDrop`\n // does not work.\n //\n // i.e. dropping an image would preview that image in the current\n // window/tab instead of triggering the drop event.\n onDrop(event) {\n event.preventDefault();\n event.stopPropagation();\n\n globalThis.clearTimeout(draggingTimeout.current);\n onDrop(event);\n setOver(false);\n stopDragging();\n },\n onDragOver(event) {\n event.preventDefault();\n event.stopPropagation();\n\n globalThis.clearTimeout(draggingTimeout.current);\n onDragOver(event);\n setOver(true);\n },\n onDragEnter(event) {\n event.preventDefault();\n event.stopPropagation();\n\n onDragEnter(event);\n setOver(true);\n },\n onDragLeave(event) {\n event.preventDefault();\n event.stopPropagation();\n\n onDragLeave(event);\n setOver(false);\n // this stops dragging if the user's File Explorer is somewhat above the dropzone\n // and drags out into the File Explorer\n delayedStopDragging();\n },\n },\n };\n}\n"],"names":["useCallback","useEffect","useRef","useState","useToggle","noop","useDropzone","options","onDrop","onDragOver","onDragEnter","onDragLeave","disableDragging","isOver","setOver","toggled","isDragging","enable","startDragging","disable","stopDragging","draggingTimeout","undefined","delayedStopDragging","globalThis","clearTimeout","current","setTimeout","addEventListener","removeEventListener","dropzoneHandlers","event","preventDefault","stopPropagation"],"mappings":"AAAA;AAEA,SAEEA,WAAW,EACXC,SAAS,EACTC,MAAM,EACNC,QAAQ,QACH,QAAQ;AAEf,SAASC,SAAS,QAAQ,iBAAiB;AAE3C,MAAMC,OAAO;AACX,aAAa;AACf;AA+DA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuEC,GACD,OAAO,SAASC,YAAYC,OAAwB;IAClD,MAAM,EACJC,MAAM,EACNC,aAAaJ,IAAI,EACjBK,cAAcL,IAAI,EAClBM,cAAcN,IAAI,EAClBO,kBAAkB,KAAK,EACxB,GAAGL;IAEJ,MAAM,CAACM,QAAQC,QAAQ,GAAGX,SAAS;IACnC,MAAM,EACJY,SAASC,UAAU,EACnBC,QAAQC,aAAa,EACrBC,SAASC,YAAY,EACtB,GAAGhB;IACJ,MAAMiB,kBAAkBnB,OAAuBoB;IAE/C,oEAAoE;IACpE,yEAAyE;IACzE,wEAAwE;IACxE,yEAAyE;IACzE,MAAMC,sBAAsBvB,YAAY;QACtCwB,WAAWC,YAAY,CAACJ,gBAAgBK,OAAO;QAC/CL,gBAAgBK,OAAO,GAAGF,WAAWG,UAAU,CAAC;YAC9CP;QACF,GAAG;IACL,GAAG;QAACA;KAAa;IAEjBnB,UAAU;QACR,IAAIW,iBAAiB;YACnB;QACF;QAEAY,WAAWI,gBAAgB,CAAC,aAAaV;QACzCM,WAAWI,gBAAgB,CAAC,YAAYL;QACxC,OAAO;YACLC,WAAWC,YAAY,CAACJ,gBAAgBK,OAAO;YAC/CF,WAAWK,mBAAmB,CAAC,aAAaX;YAC5CM,WAAWK,mBAAmB,CAAC,YAAYN;QAC7C;IACF,GAAG;QAACA;QAAqBX;QAAiBM;KAAc;IAExD,OAAO;QACLL;QACAG;QACAc,kBAAkB;YAChB,mDAAmD;YACnD,sEAAsE;YACtE,uEAAuE;YACvE,iBAAiB;YACjB,EAAE;YACF,iEAAiE;YACjE,mDAAmD;YACnDtB,QAAOuB,KAAK;gBACVA,MAAMC,cAAc;gBACpBD,MAAME,eAAe;gBAErBT,WAAWC,YAAY,CAACJ,gBAAgBK,OAAO;gBAC/ClB,OAAOuB;gBACPjB,QAAQ;gBACRM;YACF;YACAX,YAAWsB,KAAK;gBACdA,MAAMC,cAAc;gBACpBD,MAAME,eAAe;gBAErBT,WAAWC,YAAY,CAACJ,gBAAgBK,OAAO;gBAC/CjB,WAAWsB;gBACXjB,QAAQ;YACV;YACAJ,aAAYqB,KAAK;gBACfA,MAAMC,cAAc;gBACpBD,MAAME,eAAe;gBAErBvB,YAAYqB;gBACZjB,QAAQ;YACV;YACAH,aAAYoB,KAAK;gBACfA,MAAMC,cAAc;gBACpBD,MAAME,eAAe;gBAErBtB,YAAYoB;gBACZjB,QAAQ;gBACR,iFAAiF;gBACjF,uCAAuC;gBACvCS;YACF;QACF;IACF;AACF"}
@@ -1,16 +1,16 @@
1
- import type { MutableRefObject, Ref, RefCallback } from "react";
1
+ import type { Ref, RefCallback, RefObject } from "react";
2
2
  /**
3
3
  * @since 2.3.0
4
4
  * @internal
5
5
  */
6
6
  export type EnsuredRefs<E extends HTMLElement> = readonly [
7
- MutableRefObject<E | null>,
7
+ RefObject<E | null>,
8
8
  RefCallback<E | null>
9
9
  ];
10
10
  /**
11
11
  * This is mostly an internal hook that allows for an optional ref (normally
12
12
  * from props or hook options) to be merged with a hook's required `ref`. This
13
- * will return a MutableRefObject used for DOM manipulation in a custom hook
13
+ * will return a RefObject used for DOM manipulation in a custom hook
14
14
  * followed by a ref callback function that should be passed to the DOM node
15
15
  * that will ensure that both the optional `propRef` and hook ref are updated.
16
16
  *
@@ -4,7 +4,7 @@ import { applyRef } from "./utils/applyRef.js";
4
4
  /**
5
5
  * This is mostly an internal hook that allows for an optional ref (normally
6
6
  * from props or hook options) to be merged with a hook's required `ref`. This
7
- * will return a MutableRefObject used for DOM manipulation in a custom hook
7
+ * will return a RefObject used for DOM manipulation in a custom hook
8
8
  * followed by a ref callback function that should be passed to the DOM node
9
9
  * that will ensure that both the optional `propRef` and hook ref are updated.
10
10
  *
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/useEnsuredRef.ts"],"sourcesContent":["\"use client\";\n\nimport type { MutableRefObject, Ref, RefCallback } from \"react\";\nimport { useCallback, useRef } from \"react\";\n\nimport { applyRef } from \"./utils/applyRef.js\";\n\n/**\n * @since 2.3.0\n * @internal\n */\nexport type EnsuredRefs<E extends HTMLElement> = readonly [\n MutableRefObject<E | null>,\n RefCallback<E | null>,\n];\n\n/**\n * This is mostly an internal hook that allows for an optional ref (normally\n * from props or hook options) to be merged with a hook's required `ref`. This\n * will return a MutableRefObject used for DOM manipulation in a custom hook\n * followed by a ref callback function that should be passed to the DOM node\n * that will ensure that both the optional `propRef` and hook ref are updated.\n *\n * @example Simple Example\n * ```tsx\n * import { useEnsuredRef } from \"@react-md/core/useEnsuredRef\";\n * import { HTMLAttributes, forwardRef } from \"react\";\n *\n * export type ExampleProps = HTMLAttributes<HTMLDivElement>;\n *\n * export const Example = forwardRef<HTMLDivElement, ExampleProps>(function Example(props, ref) {\n * const [nodeRef, refHandler] = useEnsuredRef(ref);\n * useEffect(() => {\n * // do something with nodeRef.current\n * }, [nodeRef])\n *\n * return <div ref={refHandler} />;\n * });\n * ```\n *\n * @since 2.3.0\n * @internal\n */\nexport function useEnsuredRef<E extends HTMLElement>(\n propRef?: Ref<E | null>\n): EnsuredRefs<E> {\n const ref = useRef<E | null>(null);\n const refHandler = useCallback(\n (instance: E | null) => {\n applyRef(instance, propRef);\n ref.current = instance;\n },\n [propRef]\n );\n\n return [ref, refHandler];\n}\n"],"names":["useCallback","useRef","applyRef","useEnsuredRef","propRef","ref","refHandler","instance","current"],"mappings":"AAAA;AAGA,SAASA,WAAW,EAAEC,MAAM,QAAQ,QAAQ;AAE5C,SAASC,QAAQ,QAAQ,sBAAsB;AAW/C;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BC,GACD,OAAO,SAASC,cACdC,OAAuB;IAEvB,MAAMC,MAAMJ,OAAiB;IAC7B,MAAMK,aAAaN,YACjB,CAACO;QACCL,SAASK,UAAUH;QACnBC,IAAIG,OAAO,GAAGD;IAChB,GACA;QAACH;KAAQ;IAGX,OAAO;QAACC;QAAKC;KAAW;AAC1B"}
1
+ {"version":3,"sources":["../src/useEnsuredRef.ts"],"sourcesContent":["\"use client\";\n\nimport type { Ref, RefCallback, RefObject } from \"react\";\nimport { useCallback, useRef } from \"react\";\n\nimport { applyRef } from \"./utils/applyRef.js\";\n\n/**\n * @since 2.3.0\n * @internal\n */\nexport type EnsuredRefs<E extends HTMLElement> = readonly [\n RefObject<E | null>,\n RefCallback<E | null>,\n];\n\n/**\n * This is mostly an internal hook that allows for an optional ref (normally\n * from props or hook options) to be merged with a hook's required `ref`. This\n * will return a RefObject used for DOM manipulation in a custom hook\n * followed by a ref callback function that should be passed to the DOM node\n * that will ensure that both the optional `propRef` and hook ref are updated.\n *\n * @example Simple Example\n * ```tsx\n * import { useEnsuredRef } from \"@react-md/core/useEnsuredRef\";\n * import { HTMLAttributes, forwardRef } from \"react\";\n *\n * export type ExampleProps = HTMLAttributes<HTMLDivElement>;\n *\n * export const Example = forwardRef<HTMLDivElement, ExampleProps>(function Example(props, ref) {\n * const [nodeRef, refHandler] = useEnsuredRef(ref);\n * useEffect(() => {\n * // do something with nodeRef.current\n * }, [nodeRef])\n *\n * return <div ref={refHandler} />;\n * });\n * ```\n *\n * @since 2.3.0\n * @internal\n */\nexport function useEnsuredRef<E extends HTMLElement>(\n propRef?: Ref<E | null>\n): EnsuredRefs<E> {\n const ref = useRef<E | null>(null);\n const refHandler = useCallback(\n (instance: E | null) => {\n applyRef(instance, propRef);\n ref.current = instance;\n },\n [propRef]\n );\n\n return [ref, refHandler];\n}\n"],"names":["useCallback","useRef","applyRef","useEnsuredRef","propRef","ref","refHandler","instance","current"],"mappings":"AAAA;AAGA,SAASA,WAAW,EAAEC,MAAM,QAAQ,QAAQ;AAE5C,SAASC,QAAQ,QAAQ,sBAAsB;AAW/C;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BC,GACD,OAAO,SAASC,cACdC,OAAuB;IAEvB,MAAMC,MAAMJ,OAAiB;IAC7B,MAAMK,aAAaN,YACjB,CAACO;QACCL,SAASK,UAAUH;QACnBC,IAAIG,OAAO,GAAGD;IAChB,GACA;QAACH;KAAQ;IAGX,OAAO;QAACC;QAAKC;KAAW;AAC1B"}
@@ -78,9 +78,9 @@ import { useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect.js";
78
78
  * function only if it has not been called again for X milliseconds).
79
79
  * @since 6.0.0
80
80
  */ export function useThrottledFunction(func, wait) {
81
- const args = useRef();
82
- const result = useRef();
83
- const timeout = useRef();
81
+ const args = useRef(undefined);
82
+ const result = useRef(undefined);
83
+ const timeout = useRef(undefined);
84
84
  const funcRef = useRef(func);
85
85
  const lastCalledTime = useRef(0);
86
86
  useIsomorphicLayoutEffect(()=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/useThrottledFunction.ts"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useMemo, useRef } from \"react\";\n\nimport { type AnyFunction, type ThrottledFunction } from \"./types.js\";\nimport { useIsomorphicLayoutEffect } from \"./useIsomorphicLayoutEffect.js\";\n\n/**\n * Creates a function that will only be called once every X milliseconds.\n *\n * @example Throttling Search API Requests\n * ```tsx\n * import { TextField } from \"@react-md/core/form/TextField\";\n * import { useThrottledFunction } from \"@react-md/core/useThrottledFunction\";\n * import { useUnmounted } from \"@react-md/core/useUnmounted\";\n * import { useState } from \"react\";\n * import type { ReactElement } from \"react\";\n *\n * interface State {\n * error?: unknown\n * loading: boolean;\n * results?: {\n * // pretend some search results\n * id: string;\n * name: string;\n * }[];\n * }\n *\n * function Example(): ReactElement {\n * const [state, setState] = useState<State>({\n * loading: false,\n * });\n * // this is only required for async actions\n * const unmounted = useUnmounted();\n *\n * // A new search request will be fired once every 500ms as the user types.\n * // can't use the event here since React uses synthetic events\n * const search = useThrottledFunction(async (q: string) => {\n * setState({\n * loading: true,\n * error: undefined,\n * results: undefined,\n * });\n *\n * try {\n * const response = await fetch('/search', {\n * method: 'POST',\n * headers: {\n * 'Content-Type': 'application/json',\n * },\n * body: JSON.stringify({ q }),\n * });\n * const json = await response.json();\n *\n * if (!unmounted.current) {\n * setState({\n * loading: false,\n * results: json,\n * });\n * }\n * } catch (error) {\n * if (!unmounted.current) {\n * setState({\n * error,\n * loading: false,\n * });\n * }\n * }\n * }, 500);\n *\n * return (\n * <TextField\n * type=\"search\"\n * label=\"Search\"\n * onChange={(event) => search(event.currentTarget.value)}\n * />\n * );\n * }\n * ```\n *\n * @see `useDebouncedFunction` for debounce behavior instead. (Call a\n * function only if it has not been called again for X milliseconds).\n * @since 6.0.0\n */\nexport function useThrottledFunction<F extends AnyFunction>(\n func: F,\n wait: number\n): ThrottledFunction<F> {\n const args = useRef<Parameters<F>>();\n const result = useRef<ReturnType<F>>();\n const timeout = useRef<NodeJS.Timeout>();\n const funcRef = useRef(func);\n const lastCalledTime = useRef(0);\n\n useIsomorphicLayoutEffect(() => {\n funcRef.current = func;\n });\n\n useEffect(() => {\n return () => {\n globalThis.clearTimeout(timeout.current);\n };\n }, []);\n\n return useMemo(() => {\n const throttled: ThrottledFunction<F> = (...nextArgs) => {\n args.current = nextArgs;\n\n const now = Date.now();\n const remaining = wait - (now - lastCalledTime.current);\n if (remaining <= 0 || remaining > wait) {\n lastCalledTime.current = now;\n\n result.current = funcRef.current(...args.current);\n } else if (!timeout.current) {\n timeout.current = globalThis.setTimeout(() => {\n lastCalledTime.current = Date.now();\n timeout.current = undefined;\n // should exist by this time\n\n result.current = funcRef.current(...(args.current as Parameters<F>));\n }, remaining);\n }\n\n return result.current as ReturnType<F>;\n };\n throttled.cancel = () => {\n globalThis.clearTimeout(timeout.current);\n };\n\n return throttled;\n }, [wait]);\n}\n"],"names":["useEffect","useMemo","useRef","useIsomorphicLayoutEffect","useThrottledFunction","func","wait","args","result","timeout","funcRef","lastCalledTime","current","globalThis","clearTimeout","throttled","nextArgs","now","Date","remaining","setTimeout","undefined","cancel"],"mappings":"AAAA;AAEA,SAASA,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,QAAQ;AAGnD,SAASC,yBAAyB,QAAQ,iCAAiC;AAE3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4EC,GACD,OAAO,SAASC,qBACdC,IAAO,EACPC,IAAY;IAEZ,MAAMC,OAAOL;IACb,MAAMM,SAASN;IACf,MAAMO,UAAUP;IAChB,MAAMQ,UAAUR,OAAOG;IACvB,MAAMM,iBAAiBT,OAAO;IAE9BC,0BAA0B;QACxBO,QAAQE,OAAO,GAAGP;IACpB;IAEAL,UAAU;QACR,OAAO;YACLa,WAAWC,YAAY,CAACL,QAAQG,OAAO;QACzC;IACF,GAAG,EAAE;IAEL,OAAOX,QAAQ;QACb,MAAMc,YAAkC,CAAC,GAAGC;YAC1CT,KAAKK,OAAO,GAAGI;YAEf,MAAMC,MAAMC,KAAKD,GAAG;YACpB,MAAME,YAAYb,OAAQW,CAAAA,MAAMN,eAAeC,OAAO,AAAD;YACrD,IAAIO,aAAa,KAAKA,YAAYb,MAAM;gBACtCK,eAAeC,OAAO,GAAGK;gBAEzBT,OAAOI,OAAO,GAAGF,QAAQE,OAAO,IAAIL,KAAKK,OAAO;YAClD,OAAO,IAAI,CAACH,QAAQG,OAAO,EAAE;gBAC3BH,QAAQG,OAAO,GAAGC,WAAWO,UAAU,CAAC;oBACtCT,eAAeC,OAAO,GAAGM,KAAKD,GAAG;oBACjCR,QAAQG,OAAO,GAAGS;oBAClB,4BAA4B;oBAE5Bb,OAAOI,OAAO,GAAGF,QAAQE,OAAO,IAAKL,KAAKK,OAAO;gBACnD,GAAGO;YACL;YAEA,OAAOX,OAAOI,OAAO;QACvB;QACAG,UAAUO,MAAM,GAAG;YACjBT,WAAWC,YAAY,CAACL,QAAQG,OAAO;QACzC;QAEA,OAAOG;IACT,GAAG;QAACT;KAAK;AACX"}
1
+ {"version":3,"sources":["../src/useThrottledFunction.ts"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useMemo, useRef } from \"react\";\n\nimport { type AnyFunction, type ThrottledFunction } from \"./types.js\";\nimport { useIsomorphicLayoutEffect } from \"./useIsomorphicLayoutEffect.js\";\n\n/**\n * Creates a function that will only be called once every X milliseconds.\n *\n * @example Throttling Search API Requests\n * ```tsx\n * import { TextField } from \"@react-md/core/form/TextField\";\n * import { useThrottledFunction } from \"@react-md/core/useThrottledFunction\";\n * import { useUnmounted } from \"@react-md/core/useUnmounted\";\n * import { useState } from \"react\";\n * import type { ReactElement } from \"react\";\n *\n * interface State {\n * error?: unknown\n * loading: boolean;\n * results?: {\n * // pretend some search results\n * id: string;\n * name: string;\n * }[];\n * }\n *\n * function Example(): ReactElement {\n * const [state, setState] = useState<State>({\n * loading: false,\n * });\n * // this is only required for async actions\n * const unmounted = useUnmounted();\n *\n * // A new search request will be fired once every 500ms as the user types.\n * // can't use the event here since React uses synthetic events\n * const search = useThrottledFunction(async (q: string) => {\n * setState({\n * loading: true,\n * error: undefined,\n * results: undefined,\n * });\n *\n * try {\n * const response = await fetch('/search', {\n * method: 'POST',\n * headers: {\n * 'Content-Type': 'application/json',\n * },\n * body: JSON.stringify({ q }),\n * });\n * const json = await response.json();\n *\n * if (!unmounted.current) {\n * setState({\n * loading: false,\n * results: json,\n * });\n * }\n * } catch (error) {\n * if (!unmounted.current) {\n * setState({\n * error,\n * loading: false,\n * });\n * }\n * }\n * }, 500);\n *\n * return (\n * <TextField\n * type=\"search\"\n * label=\"Search\"\n * onChange={(event) => search(event.currentTarget.value)}\n * />\n * );\n * }\n * ```\n *\n * @see `useDebouncedFunction` for debounce behavior instead. (Call a\n * function only if it has not been called again for X milliseconds).\n * @since 6.0.0\n */\nexport function useThrottledFunction<F extends AnyFunction>(\n func: F,\n wait: number\n): ThrottledFunction<F> {\n const args = useRef<Parameters<F>>(undefined);\n const result = useRef<ReturnType<F>>(undefined);\n const timeout = useRef<NodeJS.Timeout>(undefined);\n const funcRef = useRef(func);\n const lastCalledTime = useRef(0);\n\n useIsomorphicLayoutEffect(() => {\n funcRef.current = func;\n });\n\n useEffect(() => {\n return () => {\n globalThis.clearTimeout(timeout.current);\n };\n }, []);\n\n return useMemo(() => {\n const throttled: ThrottledFunction<F> = (...nextArgs) => {\n args.current = nextArgs;\n\n const now = Date.now();\n const remaining = wait - (now - lastCalledTime.current);\n if (remaining <= 0 || remaining > wait) {\n lastCalledTime.current = now;\n\n result.current = funcRef.current(...args.current);\n } else if (!timeout.current) {\n timeout.current = globalThis.setTimeout(() => {\n lastCalledTime.current = Date.now();\n timeout.current = undefined;\n // should exist by this time\n\n result.current = funcRef.current(...(args.current as Parameters<F>));\n }, remaining);\n }\n\n return result.current as ReturnType<F>;\n };\n throttled.cancel = () => {\n globalThis.clearTimeout(timeout.current);\n };\n\n return throttled;\n }, [wait]);\n}\n"],"names":["useEffect","useMemo","useRef","useIsomorphicLayoutEffect","useThrottledFunction","func","wait","args","undefined","result","timeout","funcRef","lastCalledTime","current","globalThis","clearTimeout","throttled","nextArgs","now","Date","remaining","setTimeout","cancel"],"mappings":"AAAA;AAEA,SAASA,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,QAAQ;AAGnD,SAASC,yBAAyB,QAAQ,iCAAiC;AAE3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4EC,GACD,OAAO,SAASC,qBACdC,IAAO,EACPC,IAAY;IAEZ,MAAMC,OAAOL,OAAsBM;IACnC,MAAMC,SAASP,OAAsBM;IACrC,MAAME,UAAUR,OAAuBM;IACvC,MAAMG,UAAUT,OAAOG;IACvB,MAAMO,iBAAiBV,OAAO;IAE9BC,0BAA0B;QACxBQ,QAAQE,OAAO,GAAGR;IACpB;IAEAL,UAAU;QACR,OAAO;YACLc,WAAWC,YAAY,CAACL,QAAQG,OAAO;QACzC;IACF,GAAG,EAAE;IAEL,OAAOZ,QAAQ;QACb,MAAMe,YAAkC,CAAC,GAAGC;YAC1CV,KAAKM,OAAO,GAAGI;YAEf,MAAMC,MAAMC,KAAKD,GAAG;YACpB,MAAME,YAAYd,OAAQY,CAAAA,MAAMN,eAAeC,OAAO,AAAD;YACrD,IAAIO,aAAa,KAAKA,YAAYd,MAAM;gBACtCM,eAAeC,OAAO,GAAGK;gBAEzBT,OAAOI,OAAO,GAAGF,QAAQE,OAAO,IAAIN,KAAKM,OAAO;YAClD,OAAO,IAAI,CAACH,QAAQG,OAAO,EAAE;gBAC3BH,QAAQG,OAAO,GAAGC,WAAWO,UAAU,CAAC;oBACtCT,eAAeC,OAAO,GAAGM,KAAKD,GAAG;oBACjCR,QAAQG,OAAO,GAAGL;oBAClB,4BAA4B;oBAE5BC,OAAOI,OAAO,GAAGF,QAAQE,OAAO,IAAKN,KAAKM,OAAO;gBACnD,GAAGO;YACL;YAEA,OAAOX,OAAOI,OAAO;QACvB;QACAG,UAAUM,MAAM,GAAG;YACjBR,WAAWC,YAAY,CAACL,QAAQG,OAAO;QACzC;QAEA,OAAOG;IACT,GAAG;QAACV;KAAK;AACX"}
@@ -1,4 +1,4 @@
1
- import type { NonNullRef } from "./types.js";
1
+ import { type RefObject } from "react";
2
2
  /**
3
3
  * @example Simple Example
4
4
  * ```tsx
@@ -27,4 +27,4 @@ import type { NonNullRef } from "./types.js";
27
27
  * ```
28
28
  * @since 6.0.0
29
29
  */
30
- export declare function useUnmounted(): NonNullRef<boolean>;
30
+ export declare function useUnmounted(): RefObject<boolean>;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/useUnmounted.ts"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef } from \"react\";\n\nimport type { NonNullRef } from \"./types.js\";\n\n/**\n * @example Simple Example\n * ```tsx\n * import { useUnmounted } from \"@react-md/core/useUnmounted\";\n * import { useEffect, useState } from \"react\";\n *\n * function Example(): ReactElement {\n * const [state, setState] = useState({ loading: false });\n * const unmounted = useUnmounted();\n *\n * useEffect(() => {\n * async function load(): void {\n * const result = await fetch('/some-api');\n * const json = await response.json();\n * if (!unmounted.current) {\n * setState({ loading: false, result: json });\n * }\n * }\n *\n * setState({ loading: true });\n * load();\n * }, [unmounted]);\n *\n * return null;\n * }\n * ```\n * @since 6.0.0\n */\nexport function useUnmounted(): NonNullRef<boolean> {\n const unmounted = useRef(false);\n useEffect(() => {\n unmounted.current = false;\n return () => {\n unmounted.current = true;\n };\n }, []);\n\n return unmounted;\n}\n"],"names":["useEffect","useRef","useUnmounted","unmounted","current"],"mappings":"AAAA;AAEA,SAASA,SAAS,EAAEC,MAAM,QAAQ,QAAQ;AAI1C;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BC,GACD,OAAO,SAASC;IACd,MAAMC,YAAYF,OAAO;IACzBD,UAAU;QACRG,UAAUC,OAAO,GAAG;QACpB,OAAO;YACLD,UAAUC,OAAO,GAAG;QACtB;IACF,GAAG,EAAE;IAEL,OAAOD;AACT"}
1
+ {"version":3,"sources":["../src/useUnmounted.ts"],"sourcesContent":["\"use client\";\n\nimport { type RefObject, useEffect, useRef } from \"react\";\n\n/**\n * @example Simple Example\n * ```tsx\n * import { useUnmounted } from \"@react-md/core/useUnmounted\";\n * import { useEffect, useState } from \"react\";\n *\n * function Example(): ReactElement {\n * const [state, setState] = useState({ loading: false });\n * const unmounted = useUnmounted();\n *\n * useEffect(() => {\n * async function load(): void {\n * const result = await fetch('/some-api');\n * const json = await response.json();\n * if (!unmounted.current) {\n * setState({ loading: false, result: json });\n * }\n * }\n *\n * setState({ loading: true });\n * load();\n * }, [unmounted]);\n *\n * return null;\n * }\n * ```\n * @since 6.0.0\n */\nexport function useUnmounted(): RefObject<boolean> {\n const unmounted = useRef(false);\n useEffect(() => {\n unmounted.current = false;\n return () => {\n unmounted.current = true;\n };\n }, []);\n\n return unmounted;\n}\n"],"names":["useEffect","useRef","useUnmounted","unmounted","current"],"mappings":"AAAA;AAEA,SAAyBA,SAAS,EAAEC,MAAM,QAAQ,QAAQ;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BC,GACD,OAAO,SAASC;IACd,MAAMC,YAAYF,OAAO;IACzBD,UAAU;QACRG,UAAUC,OAAO,GAAG;QACpB,OAAO;YACLD,UAAUC,OAAO,GAAG;QACtB;IACF,GAAG,EAAE;IAEL,OAAOD;AACT"}
@@ -1,4 +1,4 @@
1
- import type { Ref } from "react";
1
+ import { type Ref } from "react";
2
2
  /**
3
3
  * A small utility function that allows me to apply a passed in ref along with
4
4
  * my own custom ref logic.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/applyRef.ts"],"sourcesContent":["import type { MutableRefObject, Ref } from \"react\";\n\n/**\n * A small utility function that allows me to apply a passed in ref along with\n * my own custom ref logic.\n *\n * @example Simple Example\n * ```tsx\n * import { HTMLAttributes, forwardRef } from \"react\";\n * import { applyRef } from \"@react-md/core/utils/applyRef\";\n *\n * export type ExampleProps = HTMLAttributes<HTMLDivElement>;\n *\n * const Example = forwardRef<HTMLDivElement, ExampleProps>(function Example(props, ref) {\n * const refHandler = useCallback((instance: HTMLDivElement | null) => {\n * applyRef(instance, ref);\n * if (!instance) {\n * return;\n * }\n *\n * // do something with instance\n * });\n *\n * return <div ref={refHandler} />;\n * });\n * ```\n *\n * @param instance - The DOM Node instance\n * @param ref - The prop ref\n * @internal\n */\nexport function applyRef<E>(instance: E | null, ref: Ref<E> | undefined): void {\n if (!ref) {\n return;\n }\n\n if (typeof ref === \"function\") {\n ref(instance);\n } else if (typeof ref === \"object\") {\n (ref as MutableRefObject<E | null>).current = instance;\n }\n}\n"],"names":["applyRef","instance","ref","current"],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BC,GACD,OAAO,SAASA,SAAYC,QAAkB,EAAEC,GAAuB;IACrE,IAAI,CAACA,KAAK;QACR;IACF;IAEA,IAAI,OAAOA,QAAQ,YAAY;QAC7BA,IAAID;IACN,OAAO,IAAI,OAAOC,QAAQ,UAAU;QACjCA,IAAmCC,OAAO,GAAGF;IAChD;AACF"}
1
+ {"version":3,"sources":["../../src/utils/applyRef.ts"],"sourcesContent":["import { type Ref } from \"react\";\n\n/**\n * A small utility function that allows me to apply a passed in ref along with\n * my own custom ref logic.\n *\n * @example Simple Example\n * ```tsx\n * import { HTMLAttributes, forwardRef } from \"react\";\n * import { applyRef } from \"@react-md/core/utils/applyRef\";\n *\n * export type ExampleProps = HTMLAttributes<HTMLDivElement>;\n *\n * const Example = forwardRef<HTMLDivElement, ExampleProps>(function Example(props, ref) {\n * const refHandler = useCallback((instance: HTMLDivElement | null) => {\n * applyRef(instance, ref);\n * if (!instance) {\n * return;\n * }\n *\n * // do something with instance\n * });\n *\n * return <div ref={refHandler} />;\n * });\n * ```\n *\n * @param instance - The DOM Node instance\n * @param ref - The prop ref\n * @internal\n */\nexport function applyRef<E>(instance: E | null, ref: Ref<E> | undefined): void {\n if (!ref) {\n return;\n }\n\n if (typeof ref === \"function\") {\n ref(instance);\n } else if (typeof ref === \"object\") {\n ref.current = instance;\n }\n}\n"],"names":["applyRef","instance","ref","current"],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BC,GACD,OAAO,SAASA,SAAYC,QAAkB,EAAEC,GAAuB;IACrE,IAAI,CAACA,KAAK;QACR;IACF;IAEA,IAAI,OAAOA,QAAQ,YAAY;QAC7BA,IAAID;IACN,OAAO,IAAI,OAAOC,QAAQ,UAAU;QAClCA,IAAIC,OAAO,GAAGF;IAChB;AACF"}
@@ -1,4 +1,4 @@
1
- import { type ButtonHTMLAttributes } from "react";
1
+ import { type ButtonHTMLAttributes, type ReactElement, type Ref } from "react";
2
2
  import { type LabelRequiredForA11y } from "../types.js";
3
3
  import { type BaseWindowSplitterClassNameOptions } from "./styles.js";
4
4
  /**
@@ -8,6 +8,7 @@ import { type BaseWindowSplitterClassNameOptions } from "./styles.js";
8
8
  * module augmentation.
9
9
  */
10
10
  export interface BaseWindowSplitterProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type" | "children">, BaseWindowSplitterClassNameOptions {
11
+ ref?: Ref<HTMLButtonElement>;
11
12
  /**
12
13
  * This will be provided by the {@link useWindowSplitter} hook.
13
14
  */
@@ -69,4 +70,4 @@ export type WindowSplitterProps = LabelRequiredForA11y<BaseWindowSplitterProps>;
69
70
  * @see {@link https://react-md.dev/components/window-splitter | WindowSplitter Demos}
70
71
  * @since 6.0.0
71
72
  */
72
- export declare const WindowSplitter: import("react").ForwardRefExoticComponent<WindowSplitterProps & import("react").RefAttributes<HTMLButtonElement>>;
73
+ export declare function WindowSplitter(props: WindowSplitterProps): ReactElement;
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
2
  import { windowSplitter } from "./styles.js";
4
3
  /**
5
4
  * The `WindowSplitter` should be used with the `useWindowSplitter` hook to
@@ -44,8 +43,8 @@ import { windowSplitter } from "./styles.js";
44
43
  *
45
44
  * @see {@link https://react-md.dev/components/window-splitter | WindowSplitter Demos}
46
45
  * @since 6.0.0
47
- */ export const WindowSplitter = /*#__PURE__*/ forwardRef(function WindowSplitter(props, ref) {
48
- const { role = "separator", className, dragging, reversed, disableFixed, inactiveBackground, ...remaining } = props;
46
+ */ export function WindowSplitter(props) {
47
+ const { ref, role = "separator", className, dragging, reversed, disableFixed, inactiveBackground, ...remaining } = props;
49
48
  const vertical = props["aria-orientation"] === "vertical";
50
49
  return /*#__PURE__*/ _jsx("button", {
51
50
  ...remaining,
@@ -61,6 +60,6 @@ import { windowSplitter } from "./styles.js";
61
60
  inactiveBackground
62
61
  })
63
62
  });
64
- });
63
+ }
65
64
 
66
65
  //# sourceMappingURL=WindowSplitter.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/window-splitter/WindowSplitter.tsx"],"sourcesContent":["import { type ButtonHTMLAttributes, forwardRef } from \"react\";\n\nimport { type LabelRequiredForA11y } from \"../types.js\";\nimport {\n type BaseWindowSplitterClassNameOptions,\n windowSplitter,\n} from \"./styles.js\";\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { type useWindowSplitter } from \"./useWindowSplitter.js\";\n\n/**\n * @see {@link https://www.w3.org/WAI/ARIA/apg/patterns/windowsplitter/}\n * @since 6.0.0\n * @since 6.3.1 Extends BaseWindowSplitterClassNameOptions for CSSProperties\n * module augmentation.\n */\nexport interface BaseWindowSplitterProps\n extends\n Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"type\" | \"children\">,\n BaseWindowSplitterClassNameOptions {\n /**\n * This will be provided by the {@link useWindowSplitter} hook.\n */\n \"aria-controls\": string;\n\n /**\n * This will be provided by the {@link useWindowSplitter} hook.\n */\n dragging: boolean;\n\n /**\n * This will be provided by the {@link useWindowSplitter} hook.\n */\n reversed: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport type WindowSplitterProps = LabelRequiredForA11y<BaseWindowSplitterProps>;\n\n/**\n * The `WindowSplitter` should be used with the `useWindowSplitter` hook to\n * resize parts of a layout.\n *\n * See the `useResizableLayout` hook if the entire page layout should be\n * resizable.\n *\n * @example Simple Example\n * ```tsx\n * \"use client\";\n * import { WindowSplitter } from \"@react-md/core/window-splitter/WindowSplitter\";\n * import { useWindowSplitter } from \"@react-md/core/window-splitter/useWindowSplitter\";\n * import { useId, type ReactElement } from \"react\";\n *\n * export function Example(): ReactElement {\n * const panelId = useId();\n * const { value, splitterProps } = useWindowSplitter({\n * min: 120,\n * max: 380,\n * });\n *\n * return (\n * <div\n * style={{\n * \"--rmd-window-splitter-position\": `${value}px`,\n * display: \"grid\",\n * gridTemplateColumns: \"var(--rmd-window-splitter-position, 120px) 1fr\",\n * }}\n * >\n * <div>Panel 1</div>\n * <WindowSplitter\n * {...splitterProps}\n * aria-controls={panelId}\n * aria-labelledby={panelId}\n * />\n * <div>Panel 2</div>\n * </div>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/window-splitter | WindowSplitter Demos}\n * @since 6.0.0\n */\nexport const WindowSplitter = forwardRef<\n HTMLButtonElement,\n WindowSplitterProps\n>(function WindowSplitter(props, ref) {\n const {\n role = \"separator\",\n className,\n dragging,\n reversed,\n disableFixed,\n inactiveBackground,\n ...remaining\n } = props;\n const vertical = props[\"aria-orientation\"] === \"vertical\";\n\n return (\n <button\n {...remaining}\n ref={ref}\n type=\"button\"\n role={role}\n className={windowSplitter({\n className,\n reversed,\n dragging,\n vertical,\n disableFixed,\n inactiveBackground,\n })}\n />\n );\n});\n"],"names":["forwardRef","windowSplitter","WindowSplitter","props","ref","role","className","dragging","reversed","disableFixed","inactiveBackground","remaining","vertical","button","type"],"mappings":";AAAA,SAAoCA,UAAU,QAAQ,QAAQ;AAG9D,SAEEC,cAAc,QACT,cAAc;AAmCrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CC,GACD,OAAO,MAAMC,+BAAiBF,WAG5B,SAASE,eAAeC,KAAK,EAAEC,GAAG;IAClC,MAAM,EACJC,OAAO,WAAW,EAClBC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACRC,YAAY,EACZC,kBAAkB,EAClB,GAAGC,WACJ,GAAGR;IACJ,MAAMS,WAAWT,KAAK,CAAC,mBAAmB,KAAK;IAE/C,qBACE,KAACU;QACE,GAAGF,SAAS;QACbP,KAAKA;QACLU,MAAK;QACLT,MAAMA;QACNC,WAAWL,eAAe;YACxBK;YACAE;YACAD;YACAK;YACAH;YACAC;QACF;;AAGN,GAAG"}
1
+ {"version":3,"sources":["../../src/window-splitter/WindowSplitter.tsx"],"sourcesContent":["import { type ButtonHTMLAttributes, type ReactElement, type Ref } from \"react\";\n\nimport { type LabelRequiredForA11y } from \"../types.js\";\nimport {\n type BaseWindowSplitterClassNameOptions,\n windowSplitter,\n} from \"./styles.js\";\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { type useWindowSplitter } from \"./useWindowSplitter.js\";\n\n/**\n * @see {@link https://www.w3.org/WAI/ARIA/apg/patterns/windowsplitter/}\n * @since 6.0.0\n * @since 6.3.1 Extends BaseWindowSplitterClassNameOptions for CSSProperties\n * module augmentation.\n */\nexport interface BaseWindowSplitterProps\n extends\n Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"type\" | \"children\">,\n BaseWindowSplitterClassNameOptions {\n ref?: Ref<HTMLButtonElement>;\n\n /**\n * This will be provided by the {@link useWindowSplitter} hook.\n */\n \"aria-controls\": string;\n\n /**\n * This will be provided by the {@link useWindowSplitter} hook.\n */\n dragging: boolean;\n\n /**\n * This will be provided by the {@link useWindowSplitter} hook.\n */\n reversed: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport type WindowSplitterProps = LabelRequiredForA11y<BaseWindowSplitterProps>;\n\n/**\n * The `WindowSplitter` should be used with the `useWindowSplitter` hook to\n * resize parts of a layout.\n *\n * See the `useResizableLayout` hook if the entire page layout should be\n * resizable.\n *\n * @example Simple Example\n * ```tsx\n * \"use client\";\n * import { WindowSplitter } from \"@react-md/core/window-splitter/WindowSplitter\";\n * import { useWindowSplitter } from \"@react-md/core/window-splitter/useWindowSplitter\";\n * import { useId, type ReactElement } from \"react\";\n *\n * export function Example(): ReactElement {\n * const panelId = useId();\n * const { value, splitterProps } = useWindowSplitter({\n * min: 120,\n * max: 380,\n * });\n *\n * return (\n * <div\n * style={{\n * \"--rmd-window-splitter-position\": `${value}px`,\n * display: \"grid\",\n * gridTemplateColumns: \"var(--rmd-window-splitter-position, 120px) 1fr\",\n * }}\n * >\n * <div>Panel 1</div>\n * <WindowSplitter\n * {...splitterProps}\n * aria-controls={panelId}\n * aria-labelledby={panelId}\n * />\n * <div>Panel 2</div>\n * </div>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/window-splitter | WindowSplitter Demos}\n * @since 6.0.0\n */\nexport function WindowSplitter(props: WindowSplitterProps): ReactElement {\n const {\n ref,\n role = \"separator\",\n className,\n dragging,\n reversed,\n disableFixed,\n inactiveBackground,\n ...remaining\n } = props;\n const vertical = props[\"aria-orientation\"] === \"vertical\";\n\n return (\n <button\n {...remaining}\n ref={ref}\n type=\"button\"\n role={role}\n className={windowSplitter({\n className,\n reversed,\n dragging,\n vertical,\n disableFixed,\n inactiveBackground,\n })}\n />\n );\n}\n"],"names":["windowSplitter","WindowSplitter","props","ref","role","className","dragging","reversed","disableFixed","inactiveBackground","remaining","vertical","button","type"],"mappings":";AAGA,SAEEA,cAAc,QACT,cAAc;AAqCrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CC,GACD,OAAO,SAASC,eAAeC,KAA0B;IACvD,MAAM,EACJC,GAAG,EACHC,OAAO,WAAW,EAClBC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACRC,YAAY,EACZC,kBAAkB,EAClB,GAAGC,WACJ,GAAGR;IACJ,MAAMS,WAAWT,KAAK,CAAC,mBAAmB,KAAK;IAE/C,qBACE,KAACU;QACE,GAAGF,SAAS;QACbP,KAAKA;QACLU,MAAK;QACLT,MAAMA;QACNC,WAAWL,eAAe;YACxBK;YACAE;YACAD;YACAK;YACAH;YACAC;QACF;;AAGN"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-md/core",
3
- "version": "6.5.2",
3
+ "version": "7.0.0",
4
4
  "description": "The core components and functionality for react-md.",
5
5
  "type": "module",
6
6
  "sass": "./dist/_core.scss",
@@ -83,29 +83,29 @@
83
83
  "@jest/types": "^30.2.0",
84
84
  "@microsoft/api-extractor": "^7.55.2",
85
85
  "@swc/cli": "^0.7.9",
86
- "@swc/core": "^1.15.7",
86
+ "@swc/core": "^1.15.8",
87
87
  "@testing-library/dom": "^10.4.1",
88
88
  "@testing-library/jest-dom": "^6.9.1",
89
89
  "@testing-library/react": "^16.3.1",
90
90
  "@testing-library/user-event": "^14.6.1",
91
- "@trivago/prettier-plugin-sort-imports": "^6.0.0",
91
+ "@trivago/prettier-plugin-sort-imports": "^6.0.1",
92
92
  "@types/lodash": "^4.17.21",
93
93
  "@types/node": "^24.10.4",
94
- "@types/react": "^18.3.27",
95
- "@types/react-dom": "^18.3.7",
94
+ "@types/react": "^19.2.7",
95
+ "@types/react-dom": "^19.2.3",
96
96
  "@vitejs/plugin-react-swc": "^4.2.2",
97
97
  "@vitest/coverage-v8": "^3.2.4",
98
98
  "chokidar": "^5.0.0",
99
99
  "eslint": "^9.39.2",
100
100
  "filesize": "^11.0.13",
101
101
  "glob": "13.0.0",
102
- "jsdom": "^27.3.0",
102
+ "jsdom": "^27.4.0",
103
103
  "lodash": "^4.17.21",
104
104
  "lz-string": "^1.5.0",
105
105
  "npm-run-all2": "^8.0.2",
106
106
  "prettier": "^3.7.4",
107
- "react": "^18.3.1",
108
- "react-dom": "^18.3.1",
107
+ "react": "^19.2.3",
108
+ "react-dom": "^19.2.3",
109
109
  "stylelint": "^16.26.1",
110
110
  "ts-morph": "^27.0.2",
111
111
  "ts-node": "^10.9.2",
@@ -124,7 +124,7 @@
124
124
  "@testing-library/user-event": ">= 14",
125
125
  "react": ">= 18",
126
126
  "react-dom": ">= 18",
127
- "vitest": ">= 2"
127
+ "vitest": ">= 3"
128
128
  },
129
129
  "peerDependenciesMeta": {
130
130
  "@jest/globals": {
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  type ElementType,
3
3
  type HTMLAttributes,
4
+ type ReactElement,
4
5
  type Ref,
5
- forwardRef,
6
6
  } from "react";
7
7
 
8
8
  import { type AppBarClassNameOptions, appBar } from "./styles.js";
@@ -28,6 +28,7 @@ export type CustomAppBarComponent = ElementType<
28
28
  */
29
29
  export interface AppBarProps
30
30
  extends HTMLAttributes<HTMLDivElement>, AppBarClassNameOptions {
31
+ ref?: Ref<HTMLDivElement>;
31
32
  /** @defaultValue `fixed ? "header" : "div"` */
32
33
  as?: CustomAppBarComponent;
33
34
  }
@@ -56,57 +57,56 @@ export interface AppBarProps
56
57
  * @since 6.0.0 The `AppBar` was updated to use `gap` for spacing
57
58
  * instead of requiring the `AppBarNav` and `AppBarAction` components.
58
59
  */
59
- export const AppBar = forwardRef<HTMLDivElement, AppBarProps>(
60
- function AppBar(props, ref) {
61
- const {
62
- className,
63
- theme,
64
- stacked,
65
- height,
66
- align,
67
- grid,
68
- gridName,
69
- justify,
70
- reversed,
71
- gridColumns,
72
- disableWrap,
73
- disablePadding,
74
- position,
75
- pagePosition,
76
- surfaceColor,
77
- scrollbarOffset,
78
- disableElevation,
79
- as: Component = position ? "header" : "div",
80
- children,
81
- ...remaining
82
- } = props;
60
+ export function AppBar(props: AppBarProps): ReactElement {
61
+ const {
62
+ ref,
63
+ className,
64
+ theme,
65
+ stacked,
66
+ height,
67
+ align,
68
+ grid,
69
+ gridName,
70
+ justify,
71
+ reversed,
72
+ gridColumns,
73
+ disableWrap,
74
+ disablePadding,
75
+ position,
76
+ pagePosition,
77
+ surfaceColor,
78
+ scrollbarOffset,
79
+ disableElevation,
80
+ as: Component = position ? "header" : "div",
81
+ children,
82
+ ...remaining
83
+ } = props;
83
84
 
84
- return (
85
- <Component
86
- {...remaining}
87
- className={appBar({
88
- className,
89
- theme,
90
- position,
91
- pagePosition,
92
- disableElevation,
93
- scrollbarOffset,
94
- height,
95
- grid,
96
- gridName,
97
- gridColumns,
98
- align,
99
- stacked,
100
- justify,
101
- reversed,
102
- surfaceColor,
103
- disableWrap,
104
- disablePadding,
105
- })}
106
- ref={ref}
107
- >
108
- {children}
109
- </Component>
110
- );
111
- }
112
- );
85
+ return (
86
+ <Component
87
+ {...remaining}
88
+ className={appBar({
89
+ className,
90
+ theme,
91
+ position,
92
+ pagePosition,
93
+ disableElevation,
94
+ scrollbarOffset,
95
+ height,
96
+ grid,
97
+ gridName,
98
+ gridColumns,
99
+ align,
100
+ stacked,
101
+ justify,
102
+ reversed,
103
+ surfaceColor,
104
+ disableWrap,
105
+ disablePadding,
106
+ })}
107
+ ref={ref}
108
+ >
109
+ {children}
110
+ </Component>
111
+ );
112
+ }
@@ -1,4 +1,4 @@
1
- import { forwardRef } from "react";
1
+ import { type ReactElement, type Ref } from "react";
2
2
 
3
3
  import { type TextOverflow } from "../cssUtils.js";
4
4
  import { Typography, type TypographyProps } from "../typography/Typography.js";
@@ -14,6 +14,8 @@ import { type AppBarTitleClassNameOptions, appBarTitle } from "./styles.js";
14
14
  */
15
15
  export interface AppBarTitleProps
16
16
  extends TypographyProps, AppBarTitleClassNameOptions {
17
+ ref?: Ref<HTMLHeadingElement>;
18
+
17
19
  /** @defaultValue `"headline-6"` */
18
20
  type?: TypographyType;
19
21
 
@@ -47,29 +49,29 @@ export interface AppBarTitleProps
47
49
  * prop inherited through the base `Typography` component. The `textOverflow`
48
50
  * will default to `"ellipsis"` which is new as well.
49
51
  */
50
- export const AppBarTitle = forwardRef<HTMLHeadingElement, AppBarTitleProps>(
51
- function AppBarTitle(props, ref) {
52
- const {
53
- type = "headline-6",
54
- keyline = "small",
55
- children,
56
- className,
57
- textOverflow = "ellipsis",
58
- ...remaining
59
- } = props;
60
- return (
61
- <Typography
62
- {...remaining}
63
- ref={ref}
64
- type={type}
65
- className={appBarTitle({
66
- keyline,
67
- className,
68
- })}
69
- textOverflow={textOverflow}
70
- >
71
- {children}
72
- </Typography>
73
- );
74
- }
75
- );
52
+ export function AppBarTitle(props: AppBarTitleProps): ReactElement {
53
+ const {
54
+ ref,
55
+ type = "headline-6",
56
+ keyline = "small",
57
+ children,
58
+ className,
59
+ textOverflow = "ellipsis",
60
+ ...remaining
61
+ } = props;
62
+
63
+ return (
64
+ <Typography
65
+ {...remaining}
66
+ ref={ref}
67
+ type={type}
68
+ className={appBarTitle({
69
+ keyline,
70
+ className,
71
+ })}
72
+ textOverflow={textOverflow}
73
+ >
74
+ {children}
75
+ </Typography>
76
+ );
77
+ }
@@ -1,4 +1,4 @@
1
- import { forwardRef } from "react";
1
+ import { type ReactElement } from "react";
2
2
 
3
3
  import { Chip } from "../chip/Chip.js";
4
4
  import { getIcon } from "../icon/config.js";
@@ -12,11 +12,9 @@ import { type AutocompleteChipProps } from "./types.js";
12
12
  * @see {@link https://react-md.dev/components/autocomplete | Autocomplete Demos}
13
13
  * @since 6.0.0
14
14
  */
15
- export const AutocompleteChip = forwardRef<
16
- HTMLButtonElement,
17
- AutocompleteChipProps
18
- >(function AutocompleteChip(props, ref) {
15
+ export function AutocompleteChip(props: AutocompleteChipProps): ReactElement {
19
16
  const {
17
+ ref,
20
18
  "aria-description": propAriaDescription,
21
19
  children,
22
20
  className,
@@ -47,4 +45,4 @@ export const AutocompleteChip = forwardRef<
47
45
  {children}
48
46
  </Chip>
49
47
  );
50
- });
48
+ }
@@ -601,6 +601,8 @@ export interface AutocompleteCircularProgressProps extends CircularProgressProps
601
601
  * @since 6.0.0
602
602
  */
603
603
  export interface AutocompleteChipProps extends ChipProps {
604
+ ref?: Ref<HTMLButtonElement>;
605
+
604
606
  /**
605
607
  * @defaultValue `typeof children === "string" ? \`Remove "${children}"\` : undefined`
606
608
  */
@@ -4,7 +4,7 @@ import {
4
4
  type EditableHTMLElement,
5
5
  triggerManualChangeEvent,
6
6
  } from "../form/utils.js";
7
- import { type NonNullMutableRef, type UseStateInitializer } from "../types.js";
7
+ import { type UseStateInitializer } from "../types.js";
8
8
  import { noopAutocompleteFilter } from "./defaults.js";
9
9
  import {
10
10
  type AutocompleteFilterOptions,
@@ -130,10 +130,10 @@ export interface EnforceSelectedValueOptions<
130
130
  value: Option | readonly Option[] | null;
131
131
  visible: boolean;
132
132
  container: HTMLElement | null;
133
- popupRef: RefObject<HTMLElement>;
134
- comboboxRef: RefObject<EditableHTMLElement>;
133
+ popupRef: RefObject<HTMLElement | null>;
134
+ comboboxRef: RefObject<EditableHTMLElement | null>;
135
135
  availableOptions: readonly Option[];
136
- prevAvailableOptions: NonNullMutableRef<readonly Option[] | null>;
136
+ prevAvailableOptions: RefObject<readonly Option[] | null>;
137
137
  }
138
138
 
139
139
  /**