@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
@@ -1,6 +1,5 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { forwardRef } from "react";
4
3
  import { List } from "../list/List.js";
5
4
  import { useCollapseTransition } from "../transition/useCollapseTransition.js";
6
5
  import { useTreeContext } from "./TreeProvider.js";
@@ -11,8 +10,8 @@ import { treeGroup } from "./styles.js";
11
10
  * @internal
12
11
  * @since 6.0.0 Removed the collapse options and is no longer a
13
12
  * "public" component.
14
- */ export const TreeGroup = /*#__PURE__*/ forwardRef(function TreeGroup(props, ref) {
15
- const { className, collapsed, depth, onClick, onMouseDown, children, temporary: propTemporary, disableTransition = false, ...remaining } = props;
13
+ */ export function TreeGroup(props) {
14
+ const { ref, className, collapsed, depth, onClick, onMouseDown, children, temporary: propTemporary, disableTransition = false, ...remaining } = props;
16
15
  const style = {
17
16
  ...remaining.style,
18
17
  "--rmd-tree-depth": depth
@@ -51,6 +50,6 @@ import { treeGroup } from "./styles.js";
51
50
  role: "group",
52
51
  children: children
53
52
  });
54
- });
53
+ }
55
54
 
56
55
  //# sourceMappingURL=TreeGroup.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/tree/TreeGroup.tsx"],"sourcesContent":["\"use client\";\n\nimport { type CSSProperties, type ReactNode, forwardRef } from \"react\";\n\nimport { List, type ListProps } from \"../list/List.js\";\nimport { useCollapseTransition } from \"../transition/useCollapseTransition.js\";\nimport { useTreeContext } from \"./TreeProvider.js\";\nimport { treeGroup } from \"./styles.js\";\n\n/**\n * @since 6.0.0\n */\nexport interface OverridableTreeGroupProps extends ListProps {\n /** @defaultValue `false` */\n temporary?: boolean;\n\n /** @defaultValue `false` */\n disableTransition?: boolean;\n}\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport interface TreeGroupProps extends OverridableTreeGroupProps {\n children: ReactNode;\n depth: number;\n collapsed: boolean;\n}\n\n/**\n * **Client Component**\n *\n * @internal\n * @since 6.0.0 Removed the collapse options and is no longer a\n * \"public\" component.\n */\nexport const TreeGroup = forwardRef<HTMLUListElement, TreeGroupProps>(\n function TreeGroup(props, ref) {\n const {\n className,\n collapsed,\n depth,\n onClick,\n onMouseDown,\n children,\n temporary: propTemporary,\n disableTransition = false,\n ...remaining\n } = props;\n\n const style: CSSProperties = {\n ...remaining.style,\n \"--rmd-tree-depth\": depth,\n };\n\n const { temporaryChildItems } = useTreeContext();\n const temporary = propTemporary ?? temporaryChildItems;\n\n const { elementProps, rendered } = useCollapseTransition({\n style,\n nodeRef: ref,\n enter: !disableTransition,\n exit: !disableTransition,\n transitionIn: !collapsed,\n temporary,\n className: treeGroup({ className }),\n });\n\n if (!rendered || !children) {\n return null;\n }\n\n return (\n <List\n {...remaining}\n onClick={(event) => {\n onClick?.(event);\n // always stop propagation for click events and mousedown for groups\n // so that the parent child item's click and mousedown events aren't\n // also fired while there are disabled child elementsS or\n // non-interactable (like dividers or subheader)\n event.stopPropagation();\n }}\n onMouseDown={(event) => {\n onMouseDown?.(event);\n event.stopPropagation();\n }}\n {...elementProps}\n role=\"group\"\n >\n {children}\n </List>\n );\n }\n);\n"],"names":["forwardRef","List","useCollapseTransition","useTreeContext","treeGroup","TreeGroup","props","ref","className","collapsed","depth","onClick","onMouseDown","children","temporary","propTemporary","disableTransition","remaining","style","temporaryChildItems","elementProps","rendered","nodeRef","enter","exit","transitionIn","event","stopPropagation","role"],"mappings":"AAAA;;AAEA,SAA6CA,UAAU,QAAQ,QAAQ;AAEvE,SAASC,IAAI,QAAwB,kBAAkB;AACvD,SAASC,qBAAqB,QAAQ,yCAAyC;AAC/E,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,SAAS,QAAQ,cAAc;AAuBxC;;;;;;CAMC,GACD,OAAO,MAAMC,0BAAYL,WACvB,SAASK,UAAUC,KAAK,EAAEC,GAAG;IAC3B,MAAM,EACJC,SAAS,EACTC,SAAS,EACTC,KAAK,EACLC,OAAO,EACPC,WAAW,EACXC,QAAQ,EACRC,WAAWC,aAAa,EACxBC,oBAAoB,KAAK,EACzB,GAAGC,WACJ,GAAGX;IAEJ,MAAMY,QAAuB;QAC3B,GAAGD,UAAUC,KAAK;QAClB,oBAAoBR;IACtB;IAEA,MAAM,EAAES,mBAAmB,EAAE,GAAGhB;IAChC,MAAMW,YAAYC,iBAAiBI;IAEnC,MAAM,EAAEC,YAAY,EAAEC,QAAQ,EAAE,GAAGnB,sBAAsB;QACvDgB;QACAI,SAASf;QACTgB,OAAO,CAACP;QACRQ,MAAM,CAACR;QACPS,cAAc,CAAChB;QACfK;QACAN,WAAWJ,UAAU;YAAEI;QAAU;IACnC;IAEA,IAAI,CAACa,YAAY,CAACR,UAAU;QAC1B,OAAO;IACT;IAEA,qBACE,KAACZ;QACE,GAAGgB,SAAS;QACbN,SAAS,CAACe;YACRf,UAAUe;YACV,oEAAoE;YACpE,oEAAoE;YACpE,yDAAyD;YACzD,gDAAgD;YAChDA,MAAMC,eAAe;QACvB;QACAf,aAAa,CAACc;YACZd,cAAcc;YACdA,MAAMC,eAAe;QACvB;QACC,GAAGP,YAAY;QAChBQ,MAAK;kBAEJf;;AAGP,GACA"}
1
+ {"version":3,"sources":["../../src/tree/TreeGroup.tsx"],"sourcesContent":["\"use client\";\n\nimport { type CSSProperties, type ReactElement, type ReactNode } from \"react\";\n\nimport { List, type ListProps } from \"../list/List.js\";\nimport { useCollapseTransition } from \"../transition/useCollapseTransition.js\";\nimport { useTreeContext } from \"./TreeProvider.js\";\nimport { treeGroup } from \"./styles.js\";\n\n/**\n * @since 6.0.0\n */\nexport interface OverridableTreeGroupProps extends ListProps {\n /** @defaultValue `false` */\n temporary?: boolean;\n\n /** @defaultValue `false` */\n disableTransition?: boolean;\n}\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport interface TreeGroupProps extends OverridableTreeGroupProps {\n children: ReactNode;\n depth: number;\n collapsed: boolean;\n}\n\n/**\n * **Client Component**\n *\n * @internal\n * @since 6.0.0 Removed the collapse options and is no longer a\n * \"public\" component.\n */\nexport function TreeGroup(props: TreeGroupProps): ReactElement | null {\n const {\n ref,\n className,\n collapsed,\n depth,\n onClick,\n onMouseDown,\n children,\n temporary: propTemporary,\n disableTransition = false,\n ...remaining\n } = props;\n\n const style: CSSProperties = {\n ...remaining.style,\n \"--rmd-tree-depth\": depth,\n };\n\n const { temporaryChildItems } = useTreeContext();\n const temporary = propTemporary ?? temporaryChildItems;\n\n const { elementProps, rendered } = useCollapseTransition({\n style,\n nodeRef: ref,\n enter: !disableTransition,\n exit: !disableTransition,\n transitionIn: !collapsed,\n temporary,\n className: treeGroup({ className }),\n });\n\n if (!rendered || !children) {\n return null;\n }\n\n return (\n <List\n {...remaining}\n onClick={(event) => {\n onClick?.(event);\n // always stop propagation for click events and mousedown for groups\n // so that the parent child item's click and mousedown events aren't\n // also fired while there are disabled child elementsS or\n // non-interactable (like dividers or subheader)\n event.stopPropagation();\n }}\n onMouseDown={(event) => {\n onMouseDown?.(event);\n event.stopPropagation();\n }}\n {...elementProps}\n role=\"group\"\n >\n {children}\n </List>\n );\n}\n"],"names":["List","useCollapseTransition","useTreeContext","treeGroup","TreeGroup","props","ref","className","collapsed","depth","onClick","onMouseDown","children","temporary","propTemporary","disableTransition","remaining","style","temporaryChildItems","elementProps","rendered","nodeRef","enter","exit","transitionIn","event","stopPropagation","role"],"mappings":"AAAA;;AAIA,SAASA,IAAI,QAAwB,kBAAkB;AACvD,SAASC,qBAAqB,QAAQ,yCAAyC;AAC/E,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,SAAS,QAAQ,cAAc;AAuBxC;;;;;;CAMC,GACD,OAAO,SAASC,UAAUC,KAAqB;IAC7C,MAAM,EACJC,GAAG,EACHC,SAAS,EACTC,SAAS,EACTC,KAAK,EACLC,OAAO,EACPC,WAAW,EACXC,QAAQ,EACRC,WAAWC,aAAa,EACxBC,oBAAoB,KAAK,EACzB,GAAGC,WACJ,GAAGX;IAEJ,MAAMY,QAAuB;QAC3B,GAAGD,UAAUC,KAAK;QAClB,oBAAoBR;IACtB;IAEA,MAAM,EAAES,mBAAmB,EAAE,GAAGhB;IAChC,MAAMW,YAAYC,iBAAiBI;IAEnC,MAAM,EAAEC,YAAY,EAAEC,QAAQ,EAAE,GAAGnB,sBAAsB;QACvDgB;QACAI,SAASf;QACTgB,OAAO,CAACP;QACRQ,MAAM,CAACR;QACPS,cAAc,CAAChB;QACfK;QACAN,WAAWJ,UAAU;YAAEI;QAAU;IACnC;IAEA,IAAI,CAACa,YAAY,CAACR,UAAU;QAC1B,OAAO;IACT;IAEA,qBACE,KAACZ;QACE,GAAGgB,SAAS;QACbN,SAAS,CAACe;YACRf,UAAUe;YACV,oEAAoE;YACpE,oEAAoE;YACpE,yDAAyD;YACzD,gDAAgD;YAChDA,MAAMC,eAAe;QACvB;QACAf,aAAa,CAACc;YACZd,cAAcc;YACdA,MAAMC,eAAe;QACvB;QACC,GAAGP,YAAY;QAChBQ,MAAK;kBAEJf;;AAGP"}
@@ -1,6 +1,5 @@
1
- import { type ReactElement, type ReactNode } from "react";
1
+ import { type ReactElement, type ReactNode, type RefObject } from "react";
2
2
  import { type CustomLinkComponent } from "../link/Link.js";
3
- import { type NonNullRef } from "../types.js";
4
3
  import { type DefaultTreeItemNode, type TreeData, type TreeItemNode } from "./types.js";
5
4
  import { type TreeExpansion } from "./useTreeExpansion.js";
6
5
  import { type TreeSelection } from "./useTreeSelection.js";
@@ -71,7 +70,7 @@ export interface TreeContext<T extends TreeItemNode = DefaultTreeItemNode> exten
71
70
  /** @internal */
72
71
  expansionMode: TreeExpansionMode;
73
72
  /** @internal */
74
- metadataLookup: NonNullRef<TreeItemMetadataLookup>;
73
+ metadataLookup: RefObject<TreeItemMetadataLookup>;
75
74
  }
76
75
  /**
77
76
  * This can be used for a custom tree item renderer.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/tree/TreeProvider.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ReactElement,\n type ReactNode,\n createContext,\n useContext,\n useMemo,\n} from \"react\";\n\nimport { type CustomLinkComponent } from \"../link/Link.js\";\nimport { type NonNullRef } from \"../types.js\";\nimport {\n type DefaultTreeItemNode,\n type TreeData,\n type TreeItemNode,\n} from \"./types.js\";\nimport { type TreeExpansion } from \"./useTreeExpansion.js\";\nimport { type TreeSelection } from \"./useTreeSelection.js\";\n\n/**\n * When this is set to `\"auto\"`, clicking on a tree item with a mouse or with\n * the Enter/Space keys will select and expand/collapse the tree item. The user\n * can still use the ArrowLeft and ArrowRight keys to expand/collapse nested\n * tree items.\n *\n * When this is set to `\"manual\"`, clicking on a tree item with a mouse or with\n * the Enter/Space keys will only select that tree item. The user must use the\n * ArrowLeft and ArrowRight keys to expand/collapse nested tree items.\n *\n * The main use-case for the `\"manual\"` setting is creating a navigation tree\n * that requires the user to click on an icon or a button to expand the child\n * items.\n *\n * @since 6.0.0\n */\nexport type TreeExpansionMode = \"auto\" | \"manual\";\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport interface TreeItemMetadataLookup {\n /**\n * This is used for the keyboard movement behavior for trees that allow the\n * `ArrowRight` key for tree items that have children.\n */\n expandable: Record<string, boolean>;\n\n /**\n * This is a quick lookup if a tree item is disabled since it's possible the\n * custom `renderer` sets the `disabled` state and not the `TreeData`.\n */\n disabledItems: Record<string, boolean>;\n\n /**\n * A lookup of element `id` (DOM id) for each tree item to the `itemId`. This\n * is a quick way to figure out which item is being interacted with from a\n * keyboard event without needed to add `data-*` attributes.\n */\n elementToItem: Record<string, string>;\n\n /**\n * A lookup of tree item `itemId` to the element `id` (DOM id). This is used\n * to be able to find a parent tree item when the `ArrowLeft` key is pressed\n * to focus that parent item.\n */\n itemToElement: Record<string, string>;\n}\n\n/**\n * The tree context is mostly a convenience API for implementing a custom tree\n * item that requires the {@link TreeExpansion}, {@link TreeSelection} and\n * {@link TreeData} to work.\n *\n * The other properties on the context are most likely for internal use only.\n *\n * @since 6.0.0\n */\nexport interface TreeContext<T extends TreeItemNode = DefaultTreeItemNode>\n extends TreeExpansion, TreeSelection {\n data: TreeData<T>;\n rootId: string | null;\n disableTransition: boolean;\n temporaryChildItems: boolean;\n\n linkComponent: CustomLinkComponent;\n\n /** @internal */\n expanderLeft: boolean;\n /** @internal */\n expanderIcon: ReactNode;\n /** @internal */\n expansionMode: TreeExpansionMode;\n /** @internal */\n metadataLookup: NonNullRef<TreeItemMetadataLookup>;\n}\n\n// Allow the hook to correct typecast this instead\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst context = createContext<TreeContext<any> | undefined>(undefined);\ncontext.displayName = \"Tree\";\nconst { Provider } = context;\n\n/**\n * This can be used for a custom tree item renderer.\n *\n * @see The `Tree` component for an example.\n * @since 6.0.0\n */\nexport function useTreeContext<\n T extends TreeItemNode = DefaultTreeItemNode,\n>(): TreeContext<T> {\n const value = useContext(context);\n if (!value) {\n throw new Error(\"Cannot find a parent Tree component\");\n }\n\n return value;\n}\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport interface TreeProviderProps<\n T extends TreeItemNode = DefaultTreeItemNode,\n> extends TreeContext<T> {\n children: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * @internal\n * @since 6.0.0\n */\nexport function TreeProvider<T extends TreeItemNode = DefaultTreeItemNode>(\n props: TreeProviderProps<T>\n): ReactElement {\n const {\n children,\n data,\n rootId,\n multiSelect,\n expanderIcon,\n expanderLeft,\n expansionMode,\n metadataLookup,\n disableTransition,\n temporaryChildItems,\n linkComponent,\n expandedIds,\n selectedIds,\n expandMultipleTreeItems,\n toggleTreeItemExpansion,\n selectMultipleTreeItems,\n toggleTreeItemSelection,\n } = props;\n const value = useMemo<TreeContext<T>>(\n () => ({\n data,\n rootId,\n multiSelect,\n expanderIcon,\n expanderLeft,\n expansionMode,\n metadataLookup,\n disableTransition,\n temporaryChildItems,\n linkComponent,\n expandedIds,\n selectedIds,\n expandMultipleTreeItems,\n toggleTreeItemExpansion,\n selectMultipleTreeItems,\n toggleTreeItemSelection,\n }),\n [\n data,\n disableTransition,\n expandMultipleTreeItems,\n expandedIds,\n expanderIcon,\n expanderLeft,\n expansionMode,\n linkComponent,\n metadataLookup,\n multiSelect,\n rootId,\n selectMultipleTreeItems,\n selectedIds,\n temporaryChildItems,\n toggleTreeItemExpansion,\n toggleTreeItemSelection,\n ]\n );\n\n return <Provider value={value}>{children}</Provider>;\n}\n"],"names":["createContext","useContext","useMemo","context","undefined","displayName","Provider","useTreeContext","value","Error","TreeProvider","props","children","data","rootId","multiSelect","expanderIcon","expanderLeft","expansionMode","metadataLookup","disableTransition","temporaryChildItems","linkComponent","expandedIds","selectedIds","expandMultipleTreeItems","toggleTreeItemExpansion","selectMultipleTreeItems","toggleTreeItemSelection"],"mappings":"AAAA;;AAEA,SAGEA,aAAa,EACbC,UAAU,EACVC,OAAO,QACF,QAAQ;AA0Ff,kDAAkD;AAClD,8DAA8D;AAC9D,MAAMC,wBAAUH,cAA4CI;AAC5DD,QAAQE,WAAW,GAAG;AACtB,MAAM,EAAEC,QAAQ,EAAE,GAAGH;AAErB;;;;;CAKC,GACD,OAAO,SAASI;IAGd,MAAMC,QAAQP,WAAWE;IACzB,IAAI,CAACK,OAAO;QACV,MAAM,IAAIC,MAAM;IAClB;IAEA,OAAOD;AACT;AAYA;;;;;CAKC,GACD,OAAO,SAASE,aACdC,KAA2B;IAE3B,MAAM,EACJC,QAAQ,EACRC,IAAI,EACJC,MAAM,EACNC,WAAW,EACXC,YAAY,EACZC,YAAY,EACZC,aAAa,EACbC,cAAc,EACdC,iBAAiB,EACjBC,mBAAmB,EACnBC,aAAa,EACbC,WAAW,EACXC,WAAW,EACXC,uBAAuB,EACvBC,uBAAuB,EACvBC,uBAAuB,EACvBC,uBAAuB,EACxB,GAAGjB;IACJ,MAAMH,QAAQN,QACZ,IAAO,CAAA;YACLW;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;QACF,CAAA,GACA;QACEf;QACAO;QACAK;QACAF;QACAP;QACAC;QACAC;QACAI;QACAH;QACAJ;QACAD;QACAa;QACAH;QACAH;QACAK;QACAE;KACD;IAGH,qBAAO,KAACtB;QAASE,OAAOA;kBAAQI;;AAClC"}
1
+ {"version":3,"sources":["../../src/tree/TreeProvider.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ReactElement,\n type ReactNode,\n type RefObject,\n createContext,\n useContext,\n useMemo,\n} from \"react\";\n\nimport { type CustomLinkComponent } from \"../link/Link.js\";\nimport {\n type DefaultTreeItemNode,\n type TreeData,\n type TreeItemNode,\n} from \"./types.js\";\nimport { type TreeExpansion } from \"./useTreeExpansion.js\";\nimport { type TreeSelection } from \"./useTreeSelection.js\";\n\n/**\n * When this is set to `\"auto\"`, clicking on a tree item with a mouse or with\n * the Enter/Space keys will select and expand/collapse the tree item. The user\n * can still use the ArrowLeft and ArrowRight keys to expand/collapse nested\n * tree items.\n *\n * When this is set to `\"manual\"`, clicking on a tree item with a mouse or with\n * the Enter/Space keys will only select that tree item. The user must use the\n * ArrowLeft and ArrowRight keys to expand/collapse nested tree items.\n *\n * The main use-case for the `\"manual\"` setting is creating a navigation tree\n * that requires the user to click on an icon or a button to expand the child\n * items.\n *\n * @since 6.0.0\n */\nexport type TreeExpansionMode = \"auto\" | \"manual\";\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport interface TreeItemMetadataLookup {\n /**\n * This is used for the keyboard movement behavior for trees that allow the\n * `ArrowRight` key for tree items that have children.\n */\n expandable: Record<string, boolean>;\n\n /**\n * This is a quick lookup if a tree item is disabled since it's possible the\n * custom `renderer` sets the `disabled` state and not the `TreeData`.\n */\n disabledItems: Record<string, boolean>;\n\n /**\n * A lookup of element `id` (DOM id) for each tree item to the `itemId`. This\n * is a quick way to figure out which item is being interacted with from a\n * keyboard event without needed to add `data-*` attributes.\n */\n elementToItem: Record<string, string>;\n\n /**\n * A lookup of tree item `itemId` to the element `id` (DOM id). This is used\n * to be able to find a parent tree item when the `ArrowLeft` key is pressed\n * to focus that parent item.\n */\n itemToElement: Record<string, string>;\n}\n\n/**\n * The tree context is mostly a convenience API for implementing a custom tree\n * item that requires the {@link TreeExpansion}, {@link TreeSelection} and\n * {@link TreeData} to work.\n *\n * The other properties on the context are most likely for internal use only.\n *\n * @since 6.0.0\n */\nexport interface TreeContext<T extends TreeItemNode = DefaultTreeItemNode>\n extends TreeExpansion, TreeSelection {\n data: TreeData<T>;\n rootId: string | null;\n disableTransition: boolean;\n temporaryChildItems: boolean;\n\n linkComponent: CustomLinkComponent;\n\n /** @internal */\n expanderLeft: boolean;\n /** @internal */\n expanderIcon: ReactNode;\n /** @internal */\n expansionMode: TreeExpansionMode;\n /** @internal */\n metadataLookup: RefObject<TreeItemMetadataLookup>;\n}\n\n// Allow the hook to correct typecast this instead\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst context = createContext<TreeContext<any> | undefined>(undefined);\ncontext.displayName = \"Tree\";\nconst { Provider } = context;\n\n/**\n * This can be used for a custom tree item renderer.\n *\n * @see The `Tree` component for an example.\n * @since 6.0.0\n */\nexport function useTreeContext<\n T extends TreeItemNode = DefaultTreeItemNode,\n>(): TreeContext<T> {\n const value = useContext(context);\n if (!value) {\n throw new Error(\"Cannot find a parent Tree component\");\n }\n\n return value;\n}\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport interface TreeProviderProps<\n T extends TreeItemNode = DefaultTreeItemNode,\n> extends TreeContext<T> {\n children: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * @internal\n * @since 6.0.0\n */\nexport function TreeProvider<T extends TreeItemNode = DefaultTreeItemNode>(\n props: TreeProviderProps<T>\n): ReactElement {\n const {\n children,\n data,\n rootId,\n multiSelect,\n expanderIcon,\n expanderLeft,\n expansionMode,\n metadataLookup,\n disableTransition,\n temporaryChildItems,\n linkComponent,\n expandedIds,\n selectedIds,\n expandMultipleTreeItems,\n toggleTreeItemExpansion,\n selectMultipleTreeItems,\n toggleTreeItemSelection,\n } = props;\n const value = useMemo<TreeContext<T>>(\n () => ({\n data,\n rootId,\n multiSelect,\n expanderIcon,\n expanderLeft,\n expansionMode,\n metadataLookup,\n disableTransition,\n temporaryChildItems,\n linkComponent,\n expandedIds,\n selectedIds,\n expandMultipleTreeItems,\n toggleTreeItemExpansion,\n selectMultipleTreeItems,\n toggleTreeItemSelection,\n }),\n [\n data,\n disableTransition,\n expandMultipleTreeItems,\n expandedIds,\n expanderIcon,\n expanderLeft,\n expansionMode,\n linkComponent,\n metadataLookup,\n multiSelect,\n rootId,\n selectMultipleTreeItems,\n selectedIds,\n temporaryChildItems,\n toggleTreeItemExpansion,\n toggleTreeItemSelection,\n ]\n );\n\n return <Provider value={value}>{children}</Provider>;\n}\n"],"names":["createContext","useContext","useMemo","context","undefined","displayName","Provider","useTreeContext","value","Error","TreeProvider","props","children","data","rootId","multiSelect","expanderIcon","expanderLeft","expansionMode","metadataLookup","disableTransition","temporaryChildItems","linkComponent","expandedIds","selectedIds","expandMultipleTreeItems","toggleTreeItemExpansion","selectMultipleTreeItems","toggleTreeItemSelection"],"mappings":"AAAA;;AAEA,SAIEA,aAAa,EACbC,UAAU,EACVC,OAAO,QACF,QAAQ;AAyFf,kDAAkD;AAClD,8DAA8D;AAC9D,MAAMC,wBAAUH,cAA4CI;AAC5DD,QAAQE,WAAW,GAAG;AACtB,MAAM,EAAEC,QAAQ,EAAE,GAAGH;AAErB;;;;;CAKC,GACD,OAAO,SAASI;IAGd,MAAMC,QAAQP,WAAWE;IACzB,IAAI,CAACK,OAAO;QACV,MAAM,IAAIC,MAAM;IAClB;IAEA,OAAOD;AACT;AAYA;;;;;CAKC,GACD,OAAO,SAASE,aACdC,KAA2B;IAE3B,MAAM,EACJC,QAAQ,EACRC,IAAI,EACJC,MAAM,EACNC,WAAW,EACXC,YAAY,EACZC,YAAY,EACZC,aAAa,EACbC,cAAc,EACdC,iBAAiB,EACjBC,mBAAmB,EACnBC,aAAa,EACbC,WAAW,EACXC,WAAW,EACXC,uBAAuB,EACvBC,uBAAuB,EACvBC,uBAAuB,EACvBC,uBAAuB,EACxB,GAAGjB;IACJ,MAAMH,QAAQN,QACZ,IAAO,CAAA;YACLW;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;QACF,CAAA,GACA;QACEf;QACAO;QACAK;QACAF;QACAP;QACAC;QACAC;QACAI;QACAH;QACAJ;QACAD;QACAa;QACAH;QACAH;QACAK;QACAE;KACD;IAGH,qBAAO,KAACtB;QAASE,OAAOA;kBAAQI;;AAClC"}
@@ -1,10 +1,9 @@
1
- import type { FocusEventHandler, KeyboardEventHandler, MouseEventHandler, Ref } from "react";
1
+ import type { FocusEventHandler, KeyboardEventHandler, MouseEventHandler, Ref, RefObject } from "react";
2
2
  import type { KeyboardMovementProviderImplementation } from "../movement/types.js";
3
- import type { NonNullMutableRef } from "../types.js";
4
- import type { TreeItemMetadataLookup } from "./TreeProvider.js";
5
- import type { TreeData, TreeItemNode } from "./types.js";
6
- import type { TreeExpansion } from "./useTreeExpansion.js";
7
- import type { TreeItemChildIds } from "./useTreeItems.js";
3
+ import { type TreeItemMetadataLookup } from "./TreeProvider.js";
4
+ import { type TreeData, type TreeItemNode } from "./types.js";
5
+ import { type TreeExpansion } from "./useTreeExpansion.js";
6
+ import { type TreeItemChildIds } from "./useTreeItems.js";
8
7
  /**
9
8
  * @since 6.0.0
10
9
  * @internal
@@ -27,7 +26,7 @@ interface TreeMovement extends KeyboardMovementProviderImplementation<HTMLUListE
27
26
  * This will be mutated by the `TreeItem` component and used to handle
28
27
  * keyboard movement.
29
28
  */
30
- metadataLookup: NonNullMutableRef<TreeItemMetadataLookup>;
29
+ metadataLookup: RefObject<TreeItemMetadataLookup>;
31
30
  }
32
31
  /**
33
32
  * @since 6.0.0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/tree/useTreeMovement.ts"],"sourcesContent":["\"use client\";\n\nimport type {\n FocusEventHandler,\n KeyboardEventHandler,\n MouseEventHandler,\n Ref,\n} from \"react\";\nimport { useRef } from \"react\";\n\nimport type { KeyboardMovementProviderImplementation } from \"../movement/types.js\";\nimport { useKeyboardMovementProvider } from \"../movement/useKeyboardMovementProvider.js\";\nimport { getNextFocusableIndex } from \"../movement/utils.js\";\nimport type { NonNullMutableRef } from \"../types.js\";\nimport type { TreeItemMetadataLookup } from \"./TreeProvider.js\";\nimport type { TreeData, TreeItemNode } from \"./types.js\";\nimport type { TreeExpansion } from \"./useTreeExpansion.js\";\nimport type { TreeItemChildIds } from \"./useTreeItems.js\";\n\n/**\n * This helps catch the edge case where the collapse transition has occurred for\n * a tree item group, but the user uses the `ArrowDown` key before it has\n * finished. So to do this:\n *\n * - find the parent group of the tree item\n * - find the tree item that controls the group (the element before the group)\n * - check if the `aria-expanded` state is `\"false\"` meaning it is considered\n * closed\n *\n * @internal\n * @since 6.0.0\n */\nconst isParentItemCollapsing = (item: HTMLElement): boolean =>\n item\n .closest(\"[role='group']\")\n ?.previousElementSibling?.getAttribute(\"aria-expanded\") === \"false\";\n\n/**\n * @since 6.0.0\n * @internal\n */\nconst getVisibleTreeItems = (\n container: HTMLElement\n): readonly HTMLElement[] => {\n const items = [\n ...container.querySelectorAll<HTMLElement>('[role=\"treeitem\"]'),\n ];\n\n return items.filter(\n (item) =>\n // do not include items that have a `hidden` parent group\n item.offsetParent &&\n // do not include items that are about to become hidden\n !isParentItemCollapsing(item)\n );\n};\n\n/**\n * @since 6.0.0\n * @internal\n */\ninterface TreeMovementOptions<T extends TreeItemNode> extends TreeExpansion {\n ref?: Ref<HTMLUListElement>;\n data: TreeData<T>;\n onClick: MouseEventHandler<HTMLUListElement> | undefined;\n onFocus: FocusEventHandler<HTMLUListElement> | undefined;\n onKeyDown: KeyboardEventHandler<HTMLUListElement> | undefined;\n selectedIds: ReadonlySet<string>;\n treeItemChildIds: TreeItemChildIds;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\ninterface TreeMovement extends KeyboardMovementProviderImplementation<HTMLUListElement> {\n /**\n * This will be mutated by the `TreeItem` component and used to handle\n * keyboard movement.\n */\n metadataLookup: NonNullMutableRef<TreeItemMetadataLookup>;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport function useTreeMovement<T extends TreeItemNode>(\n options: TreeMovementOptions<T>\n): TreeMovement {\n const {\n ref,\n onClick,\n onFocus,\n onKeyDown,\n data,\n expandedIds,\n selectedIds,\n treeItemChildIds,\n toggleTreeItemExpansion,\n expandMultipleTreeItems,\n } = options;\n\n const metadataLookup = useRef<TreeItemMetadataLookup>({\n expandable: {},\n disabledItems: {},\n elementToItem: {},\n itemToElement: {},\n });\n const movement = useKeyboardMovementProvider({\n ref,\n onClick,\n onFocus,\n onKeyDown,\n extendKeyDown(movementData) {\n const { event, activeDescendantId, currentFocusIndex, setFocusIndex } =\n movementData;\n const { expandable, disabledItems, elementToItem, itemToElement } =\n metadataLookup.current;\n const itemId = elementToItem[activeDescendantId];\n const item = data[itemId];\n\n /* c8 ignore start */\n if (!item) {\n return;\n }\n /* c8 ignore stop */\n\n const disabled = disabledItems[itemId];\n const expanded = expandedIds.has(itemId);\n\n let flagged = false;\n switch (event.key) {\n case \"ArrowLeft\":\n if (expanded && !disabled) {\n flagged = true;\n toggleTreeItemExpansion(itemId);\n } else if (item.parentId) {\n // do not flag for this case since setFocusIndex already does this\n const parentId = itemToElement[item.parentId];\n const focusables = getVisibleTreeItems(event.currentTarget);\n const index = focusables.findIndex(\n (element) => element.id === parentId\n );\n setFocusIndex(index, focusables);\n }\n\n break;\n case \"ArrowRight\":\n if (expandable[itemId] && !disabled) {\n if (!expanded) {\n flagged = true;\n toggleTreeItemExpansion(itemId);\n } else {\n // do not flag for this case since setFocusIndex already does this\n const focusables = getVisibleTreeItems(event.currentTarget);\n const index = getNextFocusableIndex({\n loopable: false,\n increment: true,\n focusables,\n includeDisabled: true,\n currentFocusIndex: currentFocusIndex.current,\n });\n\n setFocusIndex(index, focusables);\n }\n }\n\n break;\n case \"*\": {\n flagged = true;\n const itemIds = treeItemChildIds.get(item.parentId);\n if (itemIds) {\n const expandableIds = [...itemIds].filter(\n (itemId) => expandable[itemId]\n );\n if (expandableIds.length > 0) {\n expandMultipleTreeItems(\n (prev) => new Set([...prev, ...expandableIds])\n );\n currentFocusIndex.current = -1;\n }\n }\n break;\n }\n }\n\n if (flagged) {\n event.stopPropagation();\n event.preventDefault();\n }\n },\n searchable: true,\n tabIndexBehavior: \"virtual\",\n getFocusableElements: getVisibleTreeItems,\n getDefaultFocusedIndex(options) {\n const { focusables } = options;\n const { elementToItem } = metadataLookup.current;\n\n return focusables.findIndex((element) =>\n selectedIds.has(elementToItem[element.id])\n );\n },\n });\n\n return {\n metadataLookup,\n ...movement,\n };\n}\n"],"names":["useRef","useKeyboardMovementProvider","getNextFocusableIndex","isParentItemCollapsing","item","closest","previousElementSibling","getAttribute","getVisibleTreeItems","container","items","querySelectorAll","filter","offsetParent","useTreeMovement","options","ref","onClick","onFocus","onKeyDown","data","expandedIds","selectedIds","treeItemChildIds","toggleTreeItemExpansion","expandMultipleTreeItems","metadataLookup","expandable","disabledItems","elementToItem","itemToElement","movement","extendKeyDown","movementData","event","activeDescendantId","currentFocusIndex","setFocusIndex","current","itemId","disabled","expanded","has","flagged","key","parentId","focusables","currentTarget","index","findIndex","element","id","loopable","increment","includeDisabled","itemIds","get","expandableIds","length","prev","Set","stopPropagation","preventDefault","searchable","tabIndexBehavior","getFocusableElements","getDefaultFocusedIndex"],"mappings":"AAAA;AAQA,SAASA,MAAM,QAAQ,QAAQ;AAG/B,SAASC,2BAA2B,QAAQ,6CAA6C;AACzF,SAASC,qBAAqB,QAAQ,uBAAuB;AAO7D;;;;;;;;;;;;CAYC,GACD,MAAMC,yBAAyB,CAACC,OAC9BA,KACGC,OAAO,CAAC,mBACPC,wBAAwBC,aAAa,qBAAqB;AAEhE;;;CAGC,GACD,MAAMC,sBAAsB,CAC1BC;IAEA,MAAMC,QAAQ;WACTD,UAAUE,gBAAgB,CAAc;KAC5C;IAED,OAAOD,MAAME,MAAM,CACjB,CAACR,OACC,yDAAyD;QACzDA,KAAKS,YAAY,IACjB,uDAAuD;QACvD,CAACV,uBAAuBC;AAE9B;AA4BA;;;CAGC,GACD,OAAO,SAASU,gBACdC,OAA+B;IAE/B,MAAM,EACJC,GAAG,EACHC,OAAO,EACPC,OAAO,EACPC,SAAS,EACTC,IAAI,EACJC,WAAW,EACXC,WAAW,EACXC,gBAAgB,EAChBC,uBAAuB,EACvBC,uBAAuB,EACxB,GAAGV;IAEJ,MAAMW,iBAAiB1B,OAA+B;QACpD2B,YAAY,CAAC;QACbC,eAAe,CAAC;QAChBC,eAAe,CAAC;QAChBC,eAAe,CAAC;IAClB;IACA,MAAMC,WAAW9B,4BAA4B;QAC3Ce;QACAC;QACAC;QACAC;QACAa,eAAcC,YAAY;YACxB,MAAM,EAAEC,KAAK,EAAEC,kBAAkB,EAAEC,iBAAiB,EAAEC,aAAa,EAAE,GACnEJ;YACF,MAAM,EAAEN,UAAU,EAAEC,aAAa,EAAEC,aAAa,EAAEC,aAAa,EAAE,GAC/DJ,eAAeY,OAAO;YACxB,MAAMC,SAASV,aAAa,CAACM,mBAAmB;YAChD,MAAM/B,OAAOgB,IAAI,CAACmB,OAAO;YAEzB,mBAAmB,GACnB,IAAI,CAACnC,MAAM;gBACT;YACF;YACA,kBAAkB,GAElB,MAAMoC,WAAWZ,aAAa,CAACW,OAAO;YACtC,MAAME,WAAWpB,YAAYqB,GAAG,CAACH;YAEjC,IAAII,UAAU;YACd,OAAQT,MAAMU,GAAG;gBACf,KAAK;oBACH,IAAIH,YAAY,CAACD,UAAU;wBACzBG,UAAU;wBACVnB,wBAAwBe;oBAC1B,OAAO,IAAInC,KAAKyC,QAAQ,EAAE;wBACxB,kEAAkE;wBAClE,MAAMA,WAAWf,aAAa,CAAC1B,KAAKyC,QAAQ,CAAC;wBAC7C,MAAMC,aAAatC,oBAAoB0B,MAAMa,aAAa;wBAC1D,MAAMC,QAAQF,WAAWG,SAAS,CAChC,CAACC,UAAYA,QAAQC,EAAE,KAAKN;wBAE9BR,cAAcW,OAAOF;oBACvB;oBAEA;gBACF,KAAK;oBACH,IAAInB,UAAU,CAACY,OAAO,IAAI,CAACC,UAAU;wBACnC,IAAI,CAACC,UAAU;4BACbE,UAAU;4BACVnB,wBAAwBe;wBAC1B,OAAO;4BACL,kEAAkE;4BAClE,MAAMO,aAAatC,oBAAoB0B,MAAMa,aAAa;4BAC1D,MAAMC,QAAQ9C,sBAAsB;gCAClCkD,UAAU;gCACVC,WAAW;gCACXP;gCACAQ,iBAAiB;gCACjBlB,mBAAmBA,kBAAkBE,OAAO;4BAC9C;4BAEAD,cAAcW,OAAOF;wBACvB;oBACF;oBAEA;gBACF,KAAK;oBAAK;wBACRH,UAAU;wBACV,MAAMY,UAAUhC,iBAAiBiC,GAAG,CAACpD,KAAKyC,QAAQ;wBAClD,IAAIU,SAAS;4BACX,MAAME,gBAAgB;mCAAIF;6BAAQ,CAAC3C,MAAM,CACvC,CAAC2B,SAAWZ,UAAU,CAACY,OAAO;4BAEhC,IAAIkB,cAAcC,MAAM,GAAG,GAAG;gCAC5BjC,wBACE,CAACkC,OAAS,IAAIC,IAAI;2CAAID;2CAASF;qCAAc;gCAE/CrB,kBAAkBE,OAAO,GAAG,CAAC;4BAC/B;wBACF;wBACA;oBACF;YACF;YAEA,IAAIK,SAAS;gBACXT,MAAM2B,eAAe;gBACrB3B,MAAM4B,cAAc;YACtB;QACF;QACAC,YAAY;QACZC,kBAAkB;QAClBC,sBAAsBzD;QACtB0D,wBAAuBnD,OAAO;YAC5B,MAAM,EAAE+B,UAAU,EAAE,GAAG/B;YACvB,MAAM,EAAEc,aAAa,EAAE,GAAGH,eAAeY,OAAO;YAEhD,OAAOQ,WAAWG,SAAS,CAAC,CAACC,UAC3B5B,YAAYoB,GAAG,CAACb,aAAa,CAACqB,QAAQC,EAAE,CAAC;QAE7C;IACF;IAEA,OAAO;QACLzB;QACA,GAAGK,QAAQ;IACb;AACF"}
1
+ {"version":3,"sources":["../../src/tree/useTreeMovement.ts"],"sourcesContent":["\"use client\";\n\nimport type {\n FocusEventHandler,\n KeyboardEventHandler,\n MouseEventHandler,\n Ref,\n RefObject,\n} from \"react\";\nimport { useRef } from \"react\";\n\nimport type { KeyboardMovementProviderImplementation } from \"../movement/types.js\";\nimport { useKeyboardMovementProvider } from \"../movement/useKeyboardMovementProvider.js\";\nimport { getNextFocusableIndex } from \"../movement/utils.js\";\nimport { type TreeItemMetadataLookup } from \"./TreeProvider.js\";\nimport { type TreeData, type TreeItemNode } from \"./types.js\";\nimport { type TreeExpansion } from \"./useTreeExpansion.js\";\nimport { type TreeItemChildIds } from \"./useTreeItems.js\";\n\n/**\n * This helps catch the edge case where the collapse transition has occurred for\n * a tree item group, but the user uses the `ArrowDown` key before it has\n * finished. So to do this:\n *\n * - find the parent group of the tree item\n * - find the tree item that controls the group (the element before the group)\n * - check if the `aria-expanded` state is `\"false\"` meaning it is considered\n * closed\n *\n * @internal\n * @since 6.0.0\n */\nconst isParentItemCollapsing = (item: HTMLElement): boolean =>\n item\n .closest(\"[role='group']\")\n ?.previousElementSibling?.getAttribute(\"aria-expanded\") === \"false\";\n\n/**\n * @since 6.0.0\n * @internal\n */\nconst getVisibleTreeItems = (\n container: HTMLElement\n): readonly HTMLElement[] => {\n const items = [\n ...container.querySelectorAll<HTMLElement>('[role=\"treeitem\"]'),\n ];\n\n return items.filter(\n (item) =>\n // do not include items that have a `hidden` parent group\n item.offsetParent &&\n // do not include items that are about to become hidden\n !isParentItemCollapsing(item)\n );\n};\n\n/**\n * @since 6.0.0\n * @internal\n */\ninterface TreeMovementOptions<T extends TreeItemNode> extends TreeExpansion {\n ref?: Ref<HTMLUListElement>;\n data: TreeData<T>;\n onClick: MouseEventHandler<HTMLUListElement> | undefined;\n onFocus: FocusEventHandler<HTMLUListElement> | undefined;\n onKeyDown: KeyboardEventHandler<HTMLUListElement> | undefined;\n selectedIds: ReadonlySet<string>;\n treeItemChildIds: TreeItemChildIds;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\ninterface TreeMovement extends KeyboardMovementProviderImplementation<HTMLUListElement> {\n /**\n * This will be mutated by the `TreeItem` component and used to handle\n * keyboard movement.\n */\n metadataLookup: RefObject<TreeItemMetadataLookup>;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport function useTreeMovement<T extends TreeItemNode>(\n options: TreeMovementOptions<T>\n): TreeMovement {\n const {\n ref,\n onClick,\n onFocus,\n onKeyDown,\n data,\n expandedIds,\n selectedIds,\n treeItemChildIds,\n toggleTreeItemExpansion,\n expandMultipleTreeItems,\n } = options;\n\n const metadataLookup = useRef<TreeItemMetadataLookup>({\n expandable: {},\n disabledItems: {},\n elementToItem: {},\n itemToElement: {},\n });\n const movement = useKeyboardMovementProvider({\n ref,\n onClick,\n onFocus,\n onKeyDown,\n extendKeyDown(movementData) {\n const { event, activeDescendantId, currentFocusIndex, setFocusIndex } =\n movementData;\n const { expandable, disabledItems, elementToItem, itemToElement } =\n metadataLookup.current;\n const itemId = elementToItem[activeDescendantId];\n const item = data[itemId];\n\n /* c8 ignore start */\n if (!item) {\n return;\n }\n /* c8 ignore stop */\n\n const disabled = disabledItems[itemId];\n const expanded = expandedIds.has(itemId);\n\n let flagged = false;\n switch (event.key) {\n case \"ArrowLeft\":\n if (expanded && !disabled) {\n flagged = true;\n toggleTreeItemExpansion(itemId);\n } else if (item.parentId) {\n // do not flag for this case since setFocusIndex already does this\n const parentId = itemToElement[item.parentId];\n const focusables = getVisibleTreeItems(event.currentTarget);\n const index = focusables.findIndex(\n (element) => element.id === parentId\n );\n setFocusIndex(index, focusables);\n }\n\n break;\n case \"ArrowRight\":\n if (expandable[itemId] && !disabled) {\n if (!expanded) {\n flagged = true;\n toggleTreeItemExpansion(itemId);\n } else {\n // do not flag for this case since setFocusIndex already does this\n const focusables = getVisibleTreeItems(event.currentTarget);\n const index = getNextFocusableIndex({\n loopable: false,\n increment: true,\n focusables,\n includeDisabled: true,\n currentFocusIndex: currentFocusIndex.current,\n });\n\n setFocusIndex(index, focusables);\n }\n }\n\n break;\n case \"*\": {\n flagged = true;\n const itemIds = treeItemChildIds.get(item.parentId);\n if (itemIds) {\n const expandableIds = [...itemIds].filter(\n (itemId) => expandable[itemId]\n );\n if (expandableIds.length > 0) {\n expandMultipleTreeItems(\n (prev) => new Set([...prev, ...expandableIds])\n );\n currentFocusIndex.current = -1;\n }\n }\n break;\n }\n }\n\n if (flagged) {\n event.stopPropagation();\n event.preventDefault();\n }\n },\n searchable: true,\n tabIndexBehavior: \"virtual\",\n getFocusableElements: getVisibleTreeItems,\n getDefaultFocusedIndex(options) {\n const { focusables } = options;\n const { elementToItem } = metadataLookup.current;\n\n return focusables.findIndex((element) =>\n selectedIds.has(elementToItem[element.id])\n );\n },\n });\n\n return {\n metadataLookup,\n ...movement,\n };\n}\n"],"names":["useRef","useKeyboardMovementProvider","getNextFocusableIndex","isParentItemCollapsing","item","closest","previousElementSibling","getAttribute","getVisibleTreeItems","container","items","querySelectorAll","filter","offsetParent","useTreeMovement","options","ref","onClick","onFocus","onKeyDown","data","expandedIds","selectedIds","treeItemChildIds","toggleTreeItemExpansion","expandMultipleTreeItems","metadataLookup","expandable","disabledItems","elementToItem","itemToElement","movement","extendKeyDown","movementData","event","activeDescendantId","currentFocusIndex","setFocusIndex","current","itemId","disabled","expanded","has","flagged","key","parentId","focusables","currentTarget","index","findIndex","element","id","loopable","increment","includeDisabled","itemIds","get","expandableIds","length","prev","Set","stopPropagation","preventDefault","searchable","tabIndexBehavior","getFocusableElements","getDefaultFocusedIndex"],"mappings":"AAAA;AASA,SAASA,MAAM,QAAQ,QAAQ;AAG/B,SAASC,2BAA2B,QAAQ,6CAA6C;AACzF,SAASC,qBAAqB,QAAQ,uBAAuB;AAM7D;;;;;;;;;;;;CAYC,GACD,MAAMC,yBAAyB,CAACC,OAC9BA,KACGC,OAAO,CAAC,mBACPC,wBAAwBC,aAAa,qBAAqB;AAEhE;;;CAGC,GACD,MAAMC,sBAAsB,CAC1BC;IAEA,MAAMC,QAAQ;WACTD,UAAUE,gBAAgB,CAAc;KAC5C;IAED,OAAOD,MAAME,MAAM,CACjB,CAACR,OACC,yDAAyD;QACzDA,KAAKS,YAAY,IACjB,uDAAuD;QACvD,CAACV,uBAAuBC;AAE9B;AA4BA;;;CAGC,GACD,OAAO,SAASU,gBACdC,OAA+B;IAE/B,MAAM,EACJC,GAAG,EACHC,OAAO,EACPC,OAAO,EACPC,SAAS,EACTC,IAAI,EACJC,WAAW,EACXC,WAAW,EACXC,gBAAgB,EAChBC,uBAAuB,EACvBC,uBAAuB,EACxB,GAAGV;IAEJ,MAAMW,iBAAiB1B,OAA+B;QACpD2B,YAAY,CAAC;QACbC,eAAe,CAAC;QAChBC,eAAe,CAAC;QAChBC,eAAe,CAAC;IAClB;IACA,MAAMC,WAAW9B,4BAA4B;QAC3Ce;QACAC;QACAC;QACAC;QACAa,eAAcC,YAAY;YACxB,MAAM,EAAEC,KAAK,EAAEC,kBAAkB,EAAEC,iBAAiB,EAAEC,aAAa,EAAE,GACnEJ;YACF,MAAM,EAAEN,UAAU,EAAEC,aAAa,EAAEC,aAAa,EAAEC,aAAa,EAAE,GAC/DJ,eAAeY,OAAO;YACxB,MAAMC,SAASV,aAAa,CAACM,mBAAmB;YAChD,MAAM/B,OAAOgB,IAAI,CAACmB,OAAO;YAEzB,mBAAmB,GACnB,IAAI,CAACnC,MAAM;gBACT;YACF;YACA,kBAAkB,GAElB,MAAMoC,WAAWZ,aAAa,CAACW,OAAO;YACtC,MAAME,WAAWpB,YAAYqB,GAAG,CAACH;YAEjC,IAAII,UAAU;YACd,OAAQT,MAAMU,GAAG;gBACf,KAAK;oBACH,IAAIH,YAAY,CAACD,UAAU;wBACzBG,UAAU;wBACVnB,wBAAwBe;oBAC1B,OAAO,IAAInC,KAAKyC,QAAQ,EAAE;wBACxB,kEAAkE;wBAClE,MAAMA,WAAWf,aAAa,CAAC1B,KAAKyC,QAAQ,CAAC;wBAC7C,MAAMC,aAAatC,oBAAoB0B,MAAMa,aAAa;wBAC1D,MAAMC,QAAQF,WAAWG,SAAS,CAChC,CAACC,UAAYA,QAAQC,EAAE,KAAKN;wBAE9BR,cAAcW,OAAOF;oBACvB;oBAEA;gBACF,KAAK;oBACH,IAAInB,UAAU,CAACY,OAAO,IAAI,CAACC,UAAU;wBACnC,IAAI,CAACC,UAAU;4BACbE,UAAU;4BACVnB,wBAAwBe;wBAC1B,OAAO;4BACL,kEAAkE;4BAClE,MAAMO,aAAatC,oBAAoB0B,MAAMa,aAAa;4BAC1D,MAAMC,QAAQ9C,sBAAsB;gCAClCkD,UAAU;gCACVC,WAAW;gCACXP;gCACAQ,iBAAiB;gCACjBlB,mBAAmBA,kBAAkBE,OAAO;4BAC9C;4BAEAD,cAAcW,OAAOF;wBACvB;oBACF;oBAEA;gBACF,KAAK;oBAAK;wBACRH,UAAU;wBACV,MAAMY,UAAUhC,iBAAiBiC,GAAG,CAACpD,KAAKyC,QAAQ;wBAClD,IAAIU,SAAS;4BACX,MAAME,gBAAgB;mCAAIF;6BAAQ,CAAC3C,MAAM,CACvC,CAAC2B,SAAWZ,UAAU,CAACY,OAAO;4BAEhC,IAAIkB,cAAcC,MAAM,GAAG,GAAG;gCAC5BjC,wBACE,CAACkC,OAAS,IAAIC,IAAI;2CAAID;2CAASF;qCAAc;gCAE/CrB,kBAAkBE,OAAO,GAAG,CAAC;4BAC/B;wBACF;wBACA;oBACF;YACF;YAEA,IAAIK,SAAS;gBACXT,MAAM2B,eAAe;gBACrB3B,MAAM4B,cAAc;YACtB;QACF;QACAC,YAAY;QACZC,kBAAkB;QAClBC,sBAAsBzD;QACtB0D,wBAAuBnD,OAAO;YAC5B,MAAM,EAAE+B,UAAU,EAAE,GAAG/B;YACvB,MAAM,EAAEc,aAAa,EAAE,GAAGH,eAAeY,OAAO;YAEhD,OAAOQ,WAAWG,SAAS,CAAC,CAACC,UAC3B5B,YAAYoB,GAAG,CAACb,aAAa,CAACqB,QAAQC,EAAE,CAAC;QAE7C;IACF;IAEA,OAAO;QACLzB;QACA,GAAGK,QAAQ;IACb;AACF"}
package/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { type Dispatch, type HTMLAttributes, type ReactElement, type Ref, type SetStateAction } from "react";
1
+ import { type Dispatch, type HTMLAttributes, type JSX, type ReactElement, type Ref, type SetStateAction } from "react";
2
2
  /**
3
3
  * A helper type that allows an optional `ref` to also be applied with a props
4
4
  * object even though a `ref` isn't a real prop.
@@ -55,20 +55,6 @@ export interface LabelA11y {
55
55
  * ```
56
56
  */
57
57
  export type LabelRequiredForA11y<Props extends LabelA11y> = RequireAtLeastOne<Props, keyof LabelA11y>;
58
- /**
59
- * @since 5.0.0
60
- * @internal
61
- */
62
- export interface NonNullRef<T> {
63
- readonly current: T;
64
- }
65
- /**
66
- * @since 6.0.0
67
- * @internal
68
- */
69
- export interface NonNullMutableRef<T> {
70
- current: T;
71
- }
72
58
  /** @since 6.0.0 */
73
59
  export type HtmlTagName = keyof JSX.IntrinsicElements;
74
60
  /**
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import {\n type Dispatch,\n type HTMLAttributes,\n type ReactElement,\n type Ref,\n type SetStateAction,\n} from \"react\";\n\n/**\n * A helper type that allows an optional `ref` to also be applied with a props\n * object even though a `ref` isn't a real prop.\n *\n * @since 6.2.0 Automatically infer the `Element` type param from the provided\n * props.\n */\nexport type PropsWithRef<\n Props extends object,\n Element extends HTMLElement = Props extends HTMLAttributes<infer E>\n ? E extends HTMLElement\n ? E\n : never\n : never,\n> = Props & {\n /**\n * An optional ref that can be applied.\n */\n ref?: Ref<Element>;\n};\n\n/**\n * A simple type that can be used for different components that clone a\n * `className` into a child component.\n */\nexport type ClassNameCloneableChild<T = object> = ReactElement<\n T & { className?: string }\n>;\n\n/**\n * This type allows you to require at least one of the provided keys. This is\n * super helpful for things like `aria-label` or `aria-labelledby` when it's\n * required for a11y.\n *\n * @see https://stackoverflow.com/questions/40510611/typescript-interface-require-one-of-two-properties-to-exist/49725198#49725198\n */\nexport type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<\n T,\n Exclude<keyof T, Keys>\n> &\n {\n [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;\n }[Keys];\n\nexport interface LabelA11y {\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n}\n\n/**\n * A small accessibility helper to ensure that either `aria-label` or\n * `aria-labelledby` have been provided to a component.\n *\n * @example Simple Example\n * ```ts\n * import type { HTMLAttributes, ReactElement } from \"react\";\n * import type { LabelRequiredForA11y } from \"@react-md/core/types\";\n *\n * type Props = LabelRequiredForA11y<HTMLAttributes<HTMLDivElement>>;\n *\n * function Component(props: Props): ReactElement {\n * return <div {...props} />;\n * }\n *\n * const test1 = <Component />\n * // ^ type error\n * const test2 = <Component aria-label=\"Label\" />\n * const test3 = <Component aria-labelledby=\"some-other-id\" />\n * ```\n */\nexport type LabelRequiredForA11y<Props extends LabelA11y> = RequireAtLeastOne<\n Props,\n keyof LabelA11y\n>;\n\n/**\n * @since 5.0.0\n * @internal\n */\nexport interface NonNullRef<T> {\n readonly current: T;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport interface NonNullMutableRef<T> {\n current: T;\n}\n\n/** @since 6.0.0 */\nexport type HtmlTagName = keyof JSX.IntrinsicElements;\n\n/**\n * A function to get a string from a generic item.\n *\n * @example Simple Example\n * ```ts\n * interface Item {\n * name: string;\n * }\n *\n * const items: Item[] = [{ name: 'Hello' }, { name: 'World' }];\n *\n * const extractor: TextExtractor<Item> = (item) => item.name;\n * ```\n * @since 6.0.0\n */\nexport type TextExtractor<T> = (item: T) => string;\n\n/**\n * - `\"some value\"` -&gt; `\"some value\"`\n * - `{ label: \"Hello, world\", value: 300 }` -&gt; `\"Hello, world!\"`\n * - `{ name: \"Hello, world\", value: 300 }` -&gt; `\"Hello, world!\"`\n *\n * @since 6.2.0\n */\nexport type AutomaticTextExtraction =\n | string\n | { label: string }\n | { name: string };\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport type UseStateSetter<T> = Dispatch<SetStateAction<T>>;\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport type UseStateInitializer<T> = T | (() => T);\n\n/**\n * @example\n * ```ts\n * type Visibility = UseStateObject<\"visible\", boolean>;\n * // type Visibility = {\n * // visible: boolean;\n * // setVisible: UseStateSetter<boolean>\n * // }\n *\n * type AnotherOne = UseStateObject<\"renderAsSheet\", RenderMenuAsSheet>;\n * // type AnotherOne = {\n * // renderAsSheet: RenderMenuAsSheet;\n * // setRenderAsSheet: UseStateSetter<RenderMenuAsSheet>;\n * // }\n * ```\n * @since 6.0.0\n * @internal\n */\nexport type UseStateObject<Name extends string, Value> = {\n [key in Name]: Value;\n} & {\n [key in `set${Capitalize<Name>}`]: UseStateSetter<Value>;\n};\n\n/**\n * @example\n * ```ts\n * interface Example {\n * value: number;\n * setValue: UseStateSetter<number>;\n * }\n *\n * type WithPrefix = RenameKeysWithPrefix<Example, \"thumb1\">;\n * // type WithPrefix = {\n * // thumb1Value: number;\n * // thumb1SetValue: UseStateSetter<number>;\n * // }\n * ```\n *\n * @since 6.0.0\n * @internal\n */\nexport type RenameKeysWithPrefix<T, Prefix extends string> = {\n [Key in keyof T & string as `${Prefix}${Capitalize<Key>}`]: T[Key];\n};\n\n/**\n * @since 6.0.0\n */\nexport type CssPosition = \"fixed\" | \"sticky\" | \"static\";\n\n/**\n * @since 6.0.0\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AnyFunction = (...args: any[]) => any;\n\n/**\n * @since 6.0.0\n */\nexport type CancelableFunction<F extends AnyFunction> = F & {\n cancel: () => void;\n};\n\n/**\n * @since 6.0.0\n */\nexport type DebouncedFunction<F extends AnyFunction> = CancelableFunction<\n (...args: Parameters<F>) => void\n>;\n\n/**\n * @since 6.0.0\n */\nexport type ThrottledFunction<F extends AnyFunction> = CancelableFunction<\n (...args: Parameters<F>) => ReturnType<F>\n>;\n\n/**\n * @since 6.0.0\n */\nexport interface ElementSize {\n height: number;\n width: number;\n}\n\n/**\n * @since 6.3.0\n */\nexport interface Point {\n x: number;\n y: number;\n}\n\n/**\n * @since 6.3.0\n */\nexport interface MinMaxRange {\n min: number;\n max: number;\n}\n\n/**\n * @since 6.2.0\n */\nexport type OverridableStringUnion<\n Defaults extends string,\n Overrides extends Partial<Record<string, boolean>>,\n> =\n | Exclude<Defaults, { [K in keyof Overrides]: K }[keyof Overrides]>\n | {\n [K in keyof Overrides]: Overrides[K] extends false ? never : K;\n }[keyof Overrides];\n\n/**\n * @since 6.2.0\n */\nexport type IsEmptyObject<T> = keyof T extends never ? true : false;\n"],"names":[],"mappings":"AAiQA;;CAEC,GACD,WAAoE"}
1
+ {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import {\n type Dispatch,\n type HTMLAttributes,\n type JSX,\n type ReactElement,\n type Ref,\n type SetStateAction,\n} from \"react\";\n\n/**\n * A helper type that allows an optional `ref` to also be applied with a props\n * object even though a `ref` isn't a real prop.\n *\n * @since 6.2.0 Automatically infer the `Element` type param from the provided\n * props.\n */\nexport type PropsWithRef<\n Props extends object,\n Element extends HTMLElement = Props extends HTMLAttributes<infer E>\n ? E extends HTMLElement\n ? E\n : never\n : never,\n> = Props & {\n /**\n * An optional ref that can be applied.\n */\n ref?: Ref<Element>;\n};\n\n/**\n * A simple type that can be used for different components that clone a\n * `className` into a child component.\n */\nexport type ClassNameCloneableChild<T = object> = ReactElement<\n T & { className?: string }\n>;\n\n/**\n * This type allows you to require at least one of the provided keys. This is\n * super helpful for things like `aria-label` or `aria-labelledby` when it's\n * required for a11y.\n *\n * @see https://stackoverflow.com/questions/40510611/typescript-interface-require-one-of-two-properties-to-exist/49725198#49725198\n */\nexport type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<\n T,\n Exclude<keyof T, Keys>\n> &\n {\n [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;\n }[Keys];\n\nexport interface LabelA11y {\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n}\n\n/**\n * A small accessibility helper to ensure that either `aria-label` or\n * `aria-labelledby` have been provided to a component.\n *\n * @example Simple Example\n * ```ts\n * import type { HTMLAttributes, ReactElement } from \"react\";\n * import type { LabelRequiredForA11y } from \"@react-md/core/types\";\n *\n * type Props = LabelRequiredForA11y<HTMLAttributes<HTMLDivElement>>;\n *\n * function Component(props: Props): ReactElement {\n * return <div {...props} />;\n * }\n *\n * const test1 = <Component />\n * // ^ type error\n * const test2 = <Component aria-label=\"Label\" />\n * const test3 = <Component aria-labelledby=\"some-other-id\" />\n * ```\n */\nexport type LabelRequiredForA11y<Props extends LabelA11y> = RequireAtLeastOne<\n Props,\n keyof LabelA11y\n>;\n\n/** @since 6.0.0 */\nexport type HtmlTagName = keyof JSX.IntrinsicElements;\n\n/**\n * A function to get a string from a generic item.\n *\n * @example Simple Example\n * ```ts\n * interface Item {\n * name: string;\n * }\n *\n * const items: Item[] = [{ name: 'Hello' }, { name: 'World' }];\n *\n * const extractor: TextExtractor<Item> = (item) => item.name;\n * ```\n * @since 6.0.0\n */\nexport type TextExtractor<T> = (item: T) => string;\n\n/**\n * - `\"some value\"` -&gt; `\"some value\"`\n * - `{ label: \"Hello, world\", value: 300 }` -&gt; `\"Hello, world!\"`\n * - `{ name: \"Hello, world\", value: 300 }` -&gt; `\"Hello, world!\"`\n *\n * @since 6.2.0\n */\nexport type AutomaticTextExtraction =\n | string\n | { label: string }\n | { name: string };\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport type UseStateSetter<T> = Dispatch<SetStateAction<T>>;\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport type UseStateInitializer<T> = T | (() => T);\n\n/**\n * @example\n * ```ts\n * type Visibility = UseStateObject<\"visible\", boolean>;\n * // type Visibility = {\n * // visible: boolean;\n * // setVisible: UseStateSetter<boolean>\n * // }\n *\n * type AnotherOne = UseStateObject<\"renderAsSheet\", RenderMenuAsSheet>;\n * // type AnotherOne = {\n * // renderAsSheet: RenderMenuAsSheet;\n * // setRenderAsSheet: UseStateSetter<RenderMenuAsSheet>;\n * // }\n * ```\n * @since 6.0.0\n * @internal\n */\nexport type UseStateObject<Name extends string, Value> = {\n [key in Name]: Value;\n} & {\n [key in `set${Capitalize<Name>}`]: UseStateSetter<Value>;\n};\n\n/**\n * @example\n * ```ts\n * interface Example {\n * value: number;\n * setValue: UseStateSetter<number>;\n * }\n *\n * type WithPrefix = RenameKeysWithPrefix<Example, \"thumb1\">;\n * // type WithPrefix = {\n * // thumb1Value: number;\n * // thumb1SetValue: UseStateSetter<number>;\n * // }\n * ```\n *\n * @since 6.0.0\n * @internal\n */\nexport type RenameKeysWithPrefix<T, Prefix extends string> = {\n [Key in keyof T & string as `${Prefix}${Capitalize<Key>}`]: T[Key];\n};\n\n/**\n * @since 6.0.0\n */\nexport type CssPosition = \"fixed\" | \"sticky\" | \"static\";\n\n/**\n * @since 6.0.0\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AnyFunction = (...args: any[]) => any;\n\n/**\n * @since 6.0.0\n */\nexport type CancelableFunction<F extends AnyFunction> = F & {\n cancel: () => void;\n};\n\n/**\n * @since 6.0.0\n */\nexport type DebouncedFunction<F extends AnyFunction> = CancelableFunction<\n (...args: Parameters<F>) => void\n>;\n\n/**\n * @since 6.0.0\n */\nexport type ThrottledFunction<F extends AnyFunction> = CancelableFunction<\n (...args: Parameters<F>) => ReturnType<F>\n>;\n\n/**\n * @since 6.0.0\n */\nexport interface ElementSize {\n height: number;\n width: number;\n}\n\n/**\n * @since 6.3.0\n */\nexport interface Point {\n x: number;\n y: number;\n}\n\n/**\n * @since 6.3.0\n */\nexport interface MinMaxRange {\n min: number;\n max: number;\n}\n\n/**\n * @since 6.2.0\n */\nexport type OverridableStringUnion<\n Defaults extends string,\n Overrides extends Partial<Record<string, boolean>>,\n> =\n | Exclude<Defaults, { [K in keyof Overrides]: K }[keyof Overrides]>\n | {\n [K in keyof Overrides]: Overrides[K] extends false ? never : K;\n }[keyof Overrides];\n\n/**\n * @since 6.2.0\n */\nexport type IsEmptyObject<T> = keyof T extends never ? true : false;\n"],"names":[],"mappings":"AAkPA;;CAEC,GACD,WAAoE"}
@@ -1,4 +1,4 @@
1
- import { type HTMLAttributes, type ReactNode } from "react";
1
+ import { type HTMLAttributes, type ReactElement, type ReactNode, type Ref } from "react";
2
2
  import { type MarkClassNameOptions } from "./markStyles.js";
3
3
  /**
4
4
  * @since 6.0.0
@@ -6,6 +6,7 @@ import { type MarkClassNameOptions } from "./markStyles.js";
6
6
  * augmentation.
7
7
  */
8
8
  export interface MarkProps extends HTMLAttributes<HTMLElement>, MarkClassNameOptions {
9
+ ref?: Ref<HTMLElement>;
9
10
  children: ReactNode;
10
11
  }
11
12
  /**
@@ -28,4 +29,4 @@ export interface MarkProps extends HTMLAttributes<HTMLElement>, MarkClassNameOpt
28
29
  * @see {@link https://react-md.dev/components/mark | Mark Demos}
29
30
  * @since 6.0.0
30
31
  */
31
- export declare const Mark: import("react").ForwardRefExoticComponent<MarkProps & import("react").RefAttributes<HTMLElement>>;
32
+ export declare function Mark(props: MarkProps): ReactElement;
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
2
  import { mark } from "./markStyles.js";
4
3
  /**
5
4
  * The `Mark` component can be used in place of the `mark` HTMLElement with
@@ -20,8 +19,8 @@ import { mark } from "./markStyles.js";
20
19
  *
21
20
  * @see {@link https://react-md.dev/components/mark | Mark Demos}
22
21
  * @since 6.0.0
23
- */ export const Mark = /*#__PURE__*/ forwardRef(function Mark(props, ref) {
24
- const { children, className, ...remaining } = props;
22
+ */ export function Mark(props) {
23
+ const { ref, children, className, ...remaining } = props;
25
24
  return /*#__PURE__*/ _jsx("mark", {
26
25
  ...remaining,
27
26
  ref: ref,
@@ -30,6 +29,6 @@ import { mark } from "./markStyles.js";
30
29
  }),
31
30
  children: children
32
31
  });
33
- });
32
+ }
34
33
 
35
34
  //# sourceMappingURL=Mark.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/typography/Mark.tsx"],"sourcesContent":["import { type HTMLAttributes, type ReactNode, forwardRef } from \"react\";\n\nimport { type MarkClassNameOptions, mark } from \"./markStyles.js\";\n\n/**\n * @since 6.0.0\n * @since 6.3.1 Extends MarkClassNameOptions for CSSProperties module\n * augmentation.\n */\nexport interface MarkProps\n extends HTMLAttributes<HTMLElement>, MarkClassNameOptions {\n children: ReactNode;\n}\n\n/**\n * The `Mark` component can be used in place of the `mark` HTMLElement with\n * some default styles.\n *\n * @example Simple Example\n * ```tsx\n * import { Mark } from \"@react-md/core/typography/Mark\";\n *\n * export function Example() {\n * return (\n * <>\n * Some text <Mark>that has highlights</Mark> and some other text.\n * </>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/mark | Mark Demos}\n * @since 6.0.0\n */\nexport const Mark = forwardRef<HTMLElement, MarkProps>(\n function Mark(props, ref) {\n const { children, className, ...remaining } = props;\n return (\n <mark {...remaining} ref={ref} className={mark({ className })}>\n {children}\n </mark>\n );\n }\n);\n"],"names":["forwardRef","mark","Mark","props","ref","children","className","remaining"],"mappings":";AAAA,SAA8CA,UAAU,QAAQ,QAAQ;AAExE,SAAoCC,IAAI,QAAQ,kBAAkB;AAYlE;;;;;;;;;;;;;;;;;;;CAmBC,GACD,OAAO,MAAMC,qBAAOF,WAClB,SAASE,KAAKC,KAAK,EAAEC,GAAG;IACtB,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGC,WAAW,GAAGJ;IAC9C,qBACE,KAACF;QAAM,GAAGM,SAAS;QAAEH,KAAKA;QAAKE,WAAWL,KAAK;YAAEK;QAAU;kBACxDD;;AAGP,GACA"}
1
+ {"version":3,"sources":["../../src/typography/Mark.tsx"],"sourcesContent":["import {\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from \"react\";\n\nimport { type MarkClassNameOptions, mark } from \"./markStyles.js\";\n\n/**\n * @since 6.0.0\n * @since 6.3.1 Extends MarkClassNameOptions for CSSProperties module\n * augmentation.\n */\nexport interface MarkProps\n extends HTMLAttributes<HTMLElement>, MarkClassNameOptions {\n ref?: Ref<HTMLElement>;\n children: ReactNode;\n}\n\n/**\n * The `Mark` component can be used in place of the `mark` HTMLElement with\n * some default styles.\n *\n * @example Simple Example\n * ```tsx\n * import { Mark } from \"@react-md/core/typography/Mark\";\n *\n * export function Example() {\n * return (\n * <>\n * Some text <Mark>that has highlights</Mark> and some other text.\n * </>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/mark | Mark Demos}\n * @since 6.0.0\n */\nexport function Mark(props: MarkProps): ReactElement {\n const { ref, children, className, ...remaining } = props;\n\n return (\n <mark {...remaining} ref={ref} className={mark({ className })}>\n {children}\n </mark>\n );\n}\n"],"names":["mark","Mark","props","ref","children","className","remaining"],"mappings":";AAOA,SAAoCA,IAAI,QAAQ,kBAAkB;AAalE;;;;;;;;;;;;;;;;;;;CAmBC,GACD,OAAO,SAASC,KAAKC,KAAgB;IACnC,MAAM,EAAEC,GAAG,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGC,WAAW,GAAGJ;IAEnD,qBACE,KAACF;QAAM,GAAGM,SAAS;QAAEH,KAAKA;QAAKE,WAAWL,KAAK;YAAEK;QAAU;kBACxDD;;AAGP"}
@@ -1,6 +1,7 @@
1
- import { type HTMLAttributes } from "react";
1
+ import { type HTMLAttributes, type ReactElement, type Ref } from "react";
2
2
  import { type CustomTypographyComponent, type TypographyHTMLElement } from "./Typography.js";
3
3
  export interface SrOnlyProps extends HTMLAttributes<TypographyHTMLElement> {
4
+ ref?: Ref<TypographyHTMLElement>;
4
5
  /** @defaultValue `"span"` */
5
6
  as?: CustomTypographyComponent;
6
7
  /**
@@ -43,4 +44,4 @@ export interface SrOnlyProps extends HTMLAttributes<TypographyHTMLElement> {
43
44
  *
44
45
  * @see {@link https://react-md.dev/components/sr-only | SrOnly Demos}
45
46
  */
46
- export declare const SrOnly: import("react").ForwardRefExoticComponent<SrOnlyProps & import("react").RefAttributes<TypographyHTMLElement>>;
47
+ export declare function SrOnly(props: SrOnlyProps): ReactElement;
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
2
  import { cssUtils } from "../cssUtils.js";
4
3
  /**
5
4
  * The `SrOnly` component is used to render content that is only visible to
@@ -25,8 +24,8 @@ import { cssUtils } from "../cssUtils.js";
25
24
  * ```
26
25
  *
27
26
  * @see {@link https://react-md.dev/components/sr-only | SrOnly Demos}
28
- */ export const SrOnly = /*#__PURE__*/ forwardRef(function SrOnly(props, ref) {
29
- const { as: AsComponent = "span", className, phoneOnly, focusable, children, tabIndex, ...remaining } = props;
27
+ */ export function SrOnly(props) {
28
+ const { ref, as: AsComponent = "span", className, phoneOnly, focusable, children, tabIndex, ...remaining } = props;
30
29
  // do some type-casting so ref works
31
30
  const Component = AsComponent;
32
31
  let srOnly = true;
@@ -45,6 +44,6 @@ import { cssUtils } from "../cssUtils.js";
45
44
  }),
46
45
  children: children
47
46
  });
48
- });
47
+ }
49
48
 
50
49
  //# sourceMappingURL=SrOnly.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/typography/SrOnly.tsx"],"sourcesContent":["import { type ElementType, type HTMLAttributes, forwardRef } from \"react\";\n\nimport { type SrOnlyBehavior, cssUtils } from \"../cssUtils.js\";\nimport {\n type CustomTypographyComponent,\n type TypographyHTMLElement,\n} from \"./Typography.js\";\n\nexport interface SrOnlyProps extends HTMLAttributes<TypographyHTMLElement> {\n /** @defaultValue `\"span\"` */\n as?: CustomTypographyComponent;\n\n /**\n * Set this to `true` if the content should only be screen reader only text on\n * phones. This is useful for only displaying an icon on phones when there is\n * limited space and then displaying an icon and text on larger devices.\n *\n * @defaultValue `false`\n */\n phoneOnly?: boolean;\n\n /**\n * Set this to `true` if the element should be keyboard focusable.\n *\n * @defaultValue `false`\n */\n focusable?: boolean;\n}\n\n/**\n * The `SrOnly` component is used to render content that is only visible to\n * screen readers.\n *\n * @example Simple Example\n * ```tsx\n * import { SrOnly } from \"@react-md/core/typography/SrOnly\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <>\n * <SrOnly>\n * I am only visible to screen readers.\n * </SrOnly>\n * <SrOnly focusable>\n * I am only visible to screen readers but can be focused.\n * </SrOnly>\n * </>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/sr-only | SrOnly Demos}\n */\nexport const SrOnly = forwardRef<TypographyHTMLElement, SrOnlyProps>(\n function SrOnly(props, ref) {\n const {\n as: AsComponent = \"span\",\n className,\n phoneOnly,\n focusable,\n children,\n tabIndex,\n ...remaining\n } = props;\n\n // do some type-casting so ref works\n const Component = AsComponent as ElementType;\n\n let srOnly: SrOnlyBehavior = true;\n if (focusable) {\n srOnly = \"focusable\";\n } else if (phoneOnly) {\n srOnly = \"phone\";\n }\n\n return (\n <Component\n {...remaining}\n ref={ref}\n tabIndex={tabIndex ?? (focusable ? 0 : undefined)}\n className={cssUtils({\n srOnly,\n className,\n })}\n >\n {children}\n </Component>\n );\n }\n);\n"],"names":["forwardRef","cssUtils","SrOnly","props","ref","as","AsComponent","className","phoneOnly","focusable","children","tabIndex","remaining","Component","srOnly","undefined"],"mappings":";AAAA,SAAgDA,UAAU,QAAQ,QAAQ;AAE1E,SAA8BC,QAAQ,QAAQ,iBAAiB;AA2B/D;;;;;;;;;;;;;;;;;;;;;;;;CAwBC,GACD,OAAO,MAAMC,uBAASF,WACpB,SAASE,OAAOC,KAAK,EAAEC,GAAG;IACxB,MAAM,EACJC,IAAIC,cAAc,MAAM,EACxBC,SAAS,EACTC,SAAS,EACTC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACR,GAAGC,WACJ,GAAGT;IAEJ,oCAAoC;IACpC,MAAMU,YAAYP;IAElB,IAAIQ,SAAyB;IAC7B,IAAIL,WAAW;QACbK,SAAS;IACX,OAAO,IAAIN,WAAW;QACpBM,SAAS;IACX;IAEA,qBACE,KAACD;QACE,GAAGD,SAAS;QACbR,KAAKA;QACLO,UAAUA,YAAaF,CAAAA,YAAY,IAAIM,SAAQ;QAC/CR,WAAWN,SAAS;YAClBa;YACAP;QACF;kBAECG;;AAGP,GACA"}
1
+ {"version":3,"sources":["../../src/typography/SrOnly.tsx"],"sourcesContent":["import {\n type ElementType,\n type HTMLAttributes,\n type ReactElement,\n type Ref,\n} from \"react\";\n\nimport { type SrOnlyBehavior, cssUtils } from \"../cssUtils.js\";\nimport {\n type CustomTypographyComponent,\n type TypographyHTMLElement,\n} from \"./Typography.js\";\n\nexport interface SrOnlyProps extends HTMLAttributes<TypographyHTMLElement> {\n ref?: Ref<TypographyHTMLElement>;\n\n /** @defaultValue `\"span\"` */\n as?: CustomTypographyComponent;\n\n /**\n * Set this to `true` if the content should only be screen reader only text on\n * phones. This is useful for only displaying an icon on phones when there is\n * limited space and then displaying an icon and text on larger devices.\n *\n * @defaultValue `false`\n */\n phoneOnly?: boolean;\n\n /**\n * Set this to `true` if the element should be keyboard focusable.\n *\n * @defaultValue `false`\n */\n focusable?: boolean;\n}\n\n/**\n * The `SrOnly` component is used to render content that is only visible to\n * screen readers.\n *\n * @example Simple Example\n * ```tsx\n * import { SrOnly } from \"@react-md/core/typography/SrOnly\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <>\n * <SrOnly>\n * I am only visible to screen readers.\n * </SrOnly>\n * <SrOnly focusable>\n * I am only visible to screen readers but can be focused.\n * </SrOnly>\n * </>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/sr-only | SrOnly Demos}\n */\nexport function SrOnly(props: SrOnlyProps): ReactElement {\n const {\n ref,\n as: AsComponent = \"span\",\n className,\n phoneOnly,\n focusable,\n children,\n tabIndex,\n ...remaining\n } = props;\n\n // do some type-casting so ref works\n const Component = AsComponent as ElementType;\n\n let srOnly: SrOnlyBehavior = true;\n if (focusable) {\n srOnly = \"focusable\";\n } else if (phoneOnly) {\n srOnly = \"phone\";\n }\n\n return (\n <Component\n {...remaining}\n ref={ref}\n tabIndex={tabIndex ?? (focusable ? 0 : undefined)}\n className={cssUtils({\n srOnly,\n className,\n })}\n >\n {children}\n </Component>\n );\n}\n"],"names":["cssUtils","SrOnly","props","ref","as","AsComponent","className","phoneOnly","focusable","children","tabIndex","remaining","Component","srOnly","undefined"],"mappings":";AAOA,SAA8BA,QAAQ,QAAQ,iBAAiB;AA6B/D;;;;;;;;;;;;;;;;;;;;;;;;CAwBC,GACD,OAAO,SAASC,OAAOC,KAAkB;IACvC,MAAM,EACJC,GAAG,EACHC,IAAIC,cAAc,MAAM,EACxBC,SAAS,EACTC,SAAS,EACTC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACR,GAAGC,WACJ,GAAGT;IAEJ,oCAAoC;IACpC,MAAMU,YAAYP;IAElB,IAAIQ,SAAyB;IAC7B,IAAIL,WAAW;QACbK,SAAS;IACX,OAAO,IAAIN,WAAW;QACpBM,SAAS;IACX;IAEA,qBACE,KAACD;QACE,GAAGD,SAAS;QACbR,KAAKA;QACLO,UAAUA,YAAaF,CAAAA,YAAY,IAAIM,SAAQ;QAC/CR,WAAWN,SAAS;YAClBa;YACAP;QACF;kBAECG;;AAGP"}
@@ -1,4 +1,4 @@
1
- import { type HTMLAttributes } from "react";
1
+ import { type HTMLAttributes, type ReactElement, type Ref } from "react";
2
2
  import { type TextContainerClassNameOptions } from "./textContainerStyles.js";
3
3
  /**
4
4
  * @since 6.0.0 Removed the `size` option since there is no longer a
@@ -7,6 +7,7 @@ import { type TextContainerClassNameOptions } from "./textContainerStyles.js";
7
7
  * behavior. Use the `textContainer` class name utility instead.
8
8
  */
9
9
  export interface TextContainerProps extends HTMLAttributes<HTMLDivElement>, TextContainerClassNameOptions {
10
+ ref?: Ref<HTMLDivElement>;
10
11
  }
11
12
  /**
12
13
  * This component should be used to render text based content with an
@@ -41,4 +42,4 @@ export interface TextContainerProps extends HTMLAttributes<HTMLDivElement>, Text
41
42
  * @since 6.0.0 Removed the `clone` prop and the children render function
42
43
  * behavior. Use the `textContainer` class name utility instead.
43
44
  */
44
- export declare const TextContainer: import("react").ForwardRefExoticComponent<TextContainerProps & import("react").RefAttributes<HTMLDivElement>>;
45
+ export declare function TextContainer(props: TextContainerProps): ReactElement;
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
2
  import { textContainer } from "./textContainerStyles.js";
4
3
  /**
5
4
  * This component should be used to render text based content with an
@@ -33,8 +32,8 @@ import { textContainer } from "./textContainerStyles.js";
33
32
  * different line-length for mobile and desktop.
34
33
  * @since 6.0.0 Removed the `clone` prop and the children render function
35
34
  * behavior. Use the `textContainer` class name utility instead.
36
- */ export const TextContainer = /*#__PURE__*/ forwardRef(function TextContainer(props, ref) {
37
- const { className, children, ...remaining } = props;
35
+ */ export function TextContainer(props) {
36
+ const { ref, className, children, ...remaining } = props;
38
37
  return /*#__PURE__*/ _jsx("div", {
39
38
  ...remaining,
40
39
  ref: ref,
@@ -43,6 +42,6 @@ import { textContainer } from "./textContainerStyles.js";
43
42
  }),
44
43
  children: children
45
44
  });
46
- });
45
+ }
47
46
 
48
47
  //# sourceMappingURL=TextContainer.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/typography/TextContainer.tsx"],"sourcesContent":["import { type HTMLAttributes, forwardRef } from \"react\";\n\nimport {\n type TextContainerClassNameOptions,\n textContainer,\n} from \"./textContainerStyles.js\";\n\n/**\n * @since 6.0.0 Removed the `size` option since there is no longer a\n * different line-length for mobile and desktop.\n * @since 6.0.0 Removed the `clone` prop and the children render function\n * behavior. Use the `textContainer` class name utility instead.\n */\nexport interface TextContainerProps\n extends HTMLAttributes<HTMLDivElement>, TextContainerClassNameOptions {}\n\n/**\n * This component should be used to render text based content with an\n * appropriate max line length to optimize legibility.\n *\n * @example Simple Example\n * ```tsx\n * import { TextContainer } from \"@react-md/core/typography/TextContainer\";\n * import { Typography } from \"@react-md/core/typography/Typography\";\n *\n * function Example() {\n * return (\n * <TextContainer>\n * <Typography type=\"headline-1\">Heading</Typography>\n * <Typography>\n * Pretend this is a giant paragraph of text that wraps multiple lines.\n * </Typography>\n * <Typography>\n * Pretend this is another giant paragraph of text that wraps multiple\n * lines.\n * </Typography>\n * </TextContainer>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/text-container | TextContainer Demos}\n * @see {@link textContainer} If you only want to apply this class to an\n * element.\n * @since 6.0.0 Removed the `size` option since there is no longer a\n * different line-length for mobile and desktop.\n * @since 6.0.0 Removed the `clone` prop and the children render function\n * behavior. Use the `textContainer` class name utility instead.\n */\nexport const TextContainer = forwardRef<HTMLDivElement, TextContainerProps>(\n function TextContainer(props, ref) {\n const { className, children, ...remaining } = props;\n\n return (\n <div {...remaining} ref={ref} className={textContainer({ className })}>\n {children}\n </div>\n );\n }\n);\n"],"names":["forwardRef","textContainer","TextContainer","props","ref","className","children","remaining","div"],"mappings":";AAAA,SAA8BA,UAAU,QAAQ,QAAQ;AAExD,SAEEC,aAAa,QACR,2BAA2B;AAWlC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCC,GACD,OAAO,MAAMC,8BAAgBF,WAC3B,SAASE,cAAcC,KAAK,EAAEC,GAAG;IAC/B,MAAM,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGC,WAAW,GAAGJ;IAE9C,qBACE,KAACK;QAAK,GAAGD,SAAS;QAAEH,KAAKA;QAAKC,WAAWJ,cAAc;YAAEI;QAAU;kBAChEC;;AAGP,GACA"}
1
+ {"version":3,"sources":["../../src/typography/TextContainer.tsx"],"sourcesContent":["import { type HTMLAttributes, type ReactElement, type Ref } from \"react\";\n\nimport {\n type TextContainerClassNameOptions,\n textContainer,\n} from \"./textContainerStyles.js\";\n\n/**\n * @since 6.0.0 Removed the `size` option since there is no longer a\n * different line-length for mobile and desktop.\n * @since 6.0.0 Removed the `clone` prop and the children render function\n * behavior. Use the `textContainer` class name utility instead.\n */\nexport interface TextContainerProps\n extends HTMLAttributes<HTMLDivElement>, TextContainerClassNameOptions {\n ref?: Ref<HTMLDivElement>;\n}\n\n/**\n * This component should be used to render text based content with an\n * appropriate max line length to optimize legibility.\n *\n * @example Simple Example\n * ```tsx\n * import { TextContainer } from \"@react-md/core/typography/TextContainer\";\n * import { Typography } from \"@react-md/core/typography/Typography\";\n *\n * function Example() {\n * return (\n * <TextContainer>\n * <Typography type=\"headline-1\">Heading</Typography>\n * <Typography>\n * Pretend this is a giant paragraph of text that wraps multiple lines.\n * </Typography>\n * <Typography>\n * Pretend this is another giant paragraph of text that wraps multiple\n * lines.\n * </Typography>\n * </TextContainer>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/text-container | TextContainer Demos}\n * @see {@link textContainer} If you only want to apply this class to an\n * element.\n * @since 6.0.0 Removed the `size` option since there is no longer a\n * different line-length for mobile and desktop.\n * @since 6.0.0 Removed the `clone` prop and the children render function\n * behavior. Use the `textContainer` class name utility instead.\n */\nexport function TextContainer(props: TextContainerProps): ReactElement {\n const { ref, className, children, ...remaining } = props;\n\n return (\n <div {...remaining} ref={ref} className={textContainer({ className })}>\n {children}\n </div>\n );\n}\n"],"names":["textContainer","TextContainer","props","ref","className","children","remaining","div"],"mappings":";AAEA,SAEEA,aAAa,QACR,2BAA2B;AAalC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCC,GACD,OAAO,SAASC,cAAcC,KAAyB;IACrD,MAAM,EAAEC,GAAG,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGC,WAAW,GAAGJ;IAEnD,qBACE,KAACK;QAAK,GAAGD,SAAS;QAAEH,KAAKA;QAAKC,WAAWJ,cAAc;YAAEI;QAAU;kBAChEC;;AAGP"}
@@ -1,4 +1,4 @@
1
- import { type ElementType, type HTMLAttributes } from "react";
1
+ import { type ElementType, type HTMLAttributes, type ReactElement, type Ref } from "react";
2
2
  import { type TypographyClassNameOptions } from "./typographyStyles.js";
3
3
  /**
4
4
  * A union of the default supported elements that the `Typography` component can
@@ -18,6 +18,7 @@ export type CustomTypographyComponent = ElementType<HTMLAttributes<TypographyHTM
18
18
  * `typography` class name utility instead.
19
19
  */
20
20
  export interface TypographyProps extends HTMLAttributes<TypographyHTMLElement>, TypographyClassNameOptions {
21
+ ref?: Ref<TypographyHTMLElement>;
21
22
  /**
22
23
  * The component to render as when the children are not a render function. If
23
24
  * this prop is omitted, the component will be determined by the `type` prop
@@ -83,4 +84,4 @@ export interface TypographyProps extends HTMLAttributes<TypographyHTMLElement>,
83
84
  * @since 6.0.0 Removed the children render function behavior . Use the
84
85
  * `typography` class name utility instead.
85
86
  */
86
- export declare const Typography: import("react").ForwardRefExoticComponent<TypographyProps & import("react").RefAttributes<TypographyHTMLElement>>;
87
+ export declare function Typography(props: TypographyProps): ReactElement;
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
2
  import { typography } from "./typographyStyles.js";
4
3
  /** @internal */ function getComponent(as, type) {
5
4
  if (as) {
@@ -71,8 +70,8 @@ import { typography } from "./typographyStyles.js";
71
70
  * @see {@link https://react-md.dev/components/typography | Typography Demos}
72
71
  * @since 6.0.0 Removed the children render function behavior . Use the
73
72
  * `typography` class name utility instead.
74
- */ export const Typography = /*#__PURE__*/ forwardRef(function Typography(props, ref) {
75
- const { as, type = "body-1", className, margin, fontStyle, fontWeight, textAlign, textColor, textDecoration, textTransform, textOverflow, children, ...remaining } = props;
73
+ */ export function Typography(props) {
74
+ const { ref, as, type = "body-1", className, margin, fontStyle, fontWeight, textAlign, textColor, textDecoration, textTransform, textOverflow, children, ...remaining } = props;
76
75
  const Component = getComponent(as, type);
77
76
  return /*#__PURE__*/ _jsx(Component, {
78
77
  ...remaining,
@@ -91,6 +90,6 @@ import { typography } from "./typographyStyles.js";
91
90
  }),
92
91
  children: children
93
92
  });
94
- });
93
+ }
95
94
 
96
95
  //# sourceMappingURL=Typography.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/typography/Typography.tsx"],"sourcesContent":["import {\n type ElementType,\n type HTMLAttributes,\n type ReactElement,\n forwardRef,\n} from \"react\";\n\nimport {\n type TypographyClassNameOptions,\n type TypographyType,\n typography,\n} from \"./typographyStyles.js\";\n\n/**\n * A union of the default supported elements that the `Typography` component can\n * be rendered as. This is mostly used for adding the correct `HTMLAttributes`\n * and enabling the forward ref.\n *\n * @since 4.0.0\n */\nexport type TypographyHTMLElement =\n | HTMLHeadingElement\n | HTMLParagraphElement\n | HTMLSpanElement\n | HTMLDivElement\n | HTMLAnchorElement\n | HTMLBodyElement\n | HTMLHtmlElement;\n\n/** @since 6.0.0 */\nexport type CustomTypographyComponent = ElementType<\n HTMLAttributes<TypographyHTMLElement> & { className: string }\n>;\n\n/** @internal */\nfunction getComponent(\n as: CustomTypographyComponent | undefined,\n type: TypographyType\n): ElementType {\n if (as) {\n return as;\n }\n\n switch (type) {\n case \"headline-1\":\n return \"h1\";\n case \"headline-2\":\n return \"h2\";\n case \"headline-3\":\n return \"h3\";\n case \"headline-4\":\n return \"h4\";\n case \"headline-5\":\n return \"h5\";\n case \"headline-6\":\n case \"subtitle-1\":\n case \"subtitle-2\":\n return \"h6\";\n case \"body-1\":\n case \"body-2\":\n return \"p\";\n case \"caption\":\n return \"caption\";\n default:\n return \"span\";\n }\n}\n\n/**\n * @since 6.0.0 Renamed `component` to `as`.\n * @since 6.0.0 Removed the children render function behavior. Use the\n * `typography` class name utility instead.\n */\nexport interface TypographyProps\n extends HTMLAttributes<TypographyHTMLElement>, TypographyClassNameOptions {\n /**\n * The component to render as when the children are not a render function. If\n * this prop is omitted, the component will be determined by the `type` prop\n * where:\n *\n * - `\"headline-1\" -> <h1>`\n * - `\"headline-2\" -> <h2>`\n * - `\"headline-3\" -> <h3>`\n * - `\"headline-4\" -> <h4>`\n * - `\"headline-5\" -> <h5>`\n * - `\"headline-6\" -> <h6>`\n * - `\"subtitle-1\" -> <h5>`\n * - `\"subtitle-2\" -> <h6>`\n * - `\"body-1\" -> <p>`\n * - `\"body-2\" -> <p>`\n * - `\"caption\" -> <caption>`\n * - `\"overline\" -> <span>`\n *\n * @since 6.0.0 Renamed from `component`\n */\n as?: CustomTypographyComponent;\n}\n\n/**\n * Render text with one of the material design typography styles applied and\n * optional styles like font-weight, font-style, text color, etc.\n *\n * @example All Example\n * ```tsx\n * import { Typography } from \"@react-md/core/typography/Typography\":\n *\n * export function Example() {\n * return (\n * <>\n * <Typography type=\"headline-1\">Headline 1</Typography>\n * <Typography type=\"headline-2\">Headline 2</Typography>\n * <Typography type=\"headline-3\">Headline 3</Typography>\n * <Typography type=\"headline-4\">Headline 4</Typography>\n * <Typography type=\"headline-5\">Headline 5</Typography>\n * <Typography type=\"headline-6\">Headline 6</Typography>\n * <Typography type=\"subtitle-1\">Subtitle 1</Typography>\n * <Typography type=\"subtitle-2\">Subtitle 2</Typography>\n * <Typography>\n * A paragraph of text.\n * </Typography>\n * <Typography type=\"body-1\">\n * A paragraph of text.\n * </Typography>\n * <Typography type=\"body-2\">\n * Another paragraph of text.\n * </Typography>\n * <Typography type=\"caption\" component=\"h5\">\n * Caption text\n * </Typography>\n * <Typography type=\"overline\" component=\"h5\">\n * Overline text\n * </Typography>\n * </>\n * ):\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/typography | Typography Demos}\n * @since 6.0.0 Removed the children render function behavior . Use the\n * `typography` class name utility instead.\n */\nexport const Typography = forwardRef<TypographyHTMLElement, TypographyProps>(\n function Typography(props, ref): ReactElement {\n const {\n as,\n type = \"body-1\",\n className,\n margin,\n fontStyle,\n fontWeight,\n textAlign,\n textColor,\n textDecoration,\n textTransform,\n textOverflow,\n children,\n ...remaining\n } = props;\n\n const Component = getComponent(as, type);\n return (\n <Component\n {...remaining}\n ref={ref}\n className={typography({\n type,\n margin,\n fontStyle,\n fontWeight,\n textAlign,\n textColor,\n textDecoration,\n textTransform,\n textOverflow,\n className,\n })}\n >\n {children}\n </Component>\n );\n }\n);\n"],"names":["forwardRef","typography","getComponent","as","type","Typography","props","ref","className","margin","fontStyle","fontWeight","textAlign","textColor","textDecoration","textTransform","textOverflow","children","remaining","Component"],"mappings":";AAAA,SAIEA,UAAU,QACL,QAAQ;AAEf,SAGEC,UAAU,QACL,wBAAwB;AAuB/B,cAAc,GACd,SAASC,aACPC,EAAyC,EACzCC,IAAoB;IAEpB,IAAID,IAAI;QACN,OAAOA;IACT;IAEA,OAAQC;QACN,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;QACL,KAAK;QACL,KAAK;YACH,OAAO;QACT,KAAK;QACL,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT;YACE,OAAO;IACX;AACF;AAgCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CC,GACD,OAAO,MAAMC,2BAAaL,WACxB,SAASK,WAAWC,KAAK,EAAEC,GAAG;IAC5B,MAAM,EACJJ,EAAE,EACFC,OAAO,QAAQ,EACfI,SAAS,EACTC,MAAM,EACNC,SAAS,EACTC,UAAU,EACVC,SAAS,EACTC,SAAS,EACTC,cAAc,EACdC,aAAa,EACbC,YAAY,EACZC,QAAQ,EACR,GAAGC,WACJ,GAAGZ;IAEJ,MAAMa,YAAYjB,aAAaC,IAAIC;IACnC,qBACE,KAACe;QACE,GAAGD,SAAS;QACbX,KAAKA;QACLC,WAAWP,WAAW;YACpBG;YACAK;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAR;QACF;kBAECS;;AAGP,GACA"}
1
+ {"version":3,"sources":["../../src/typography/Typography.tsx"],"sourcesContent":["import {\n type ElementType,\n type HTMLAttributes,\n type ReactElement,\n type Ref,\n} from \"react\";\n\nimport {\n type TypographyClassNameOptions,\n type TypographyType,\n typography,\n} from \"./typographyStyles.js\";\n\n/**\n * A union of the default supported elements that the `Typography` component can\n * be rendered as. This is mostly used for adding the correct `HTMLAttributes`\n * and enabling the forward ref.\n *\n * @since 4.0.0\n */\nexport type TypographyHTMLElement =\n | HTMLHeadingElement\n | HTMLParagraphElement\n | HTMLSpanElement\n | HTMLDivElement\n | HTMLAnchorElement\n | HTMLBodyElement\n | HTMLHtmlElement;\n\n/** @since 6.0.0 */\nexport type CustomTypographyComponent = ElementType<\n HTMLAttributes<TypographyHTMLElement> & { className: string }\n>;\n\n/** @internal */\nfunction getComponent(\n as: CustomTypographyComponent | undefined,\n type: TypographyType\n): ElementType {\n if (as) {\n return as;\n }\n\n switch (type) {\n case \"headline-1\":\n return \"h1\";\n case \"headline-2\":\n return \"h2\";\n case \"headline-3\":\n return \"h3\";\n case \"headline-4\":\n return \"h4\";\n case \"headline-5\":\n return \"h5\";\n case \"headline-6\":\n case \"subtitle-1\":\n case \"subtitle-2\":\n return \"h6\";\n case \"body-1\":\n case \"body-2\":\n return \"p\";\n case \"caption\":\n return \"caption\";\n default:\n return \"span\";\n }\n}\n\n/**\n * @since 6.0.0 Renamed `component` to `as`.\n * @since 6.0.0 Removed the children render function behavior. Use the\n * `typography` class name utility instead.\n */\nexport interface TypographyProps\n extends HTMLAttributes<TypographyHTMLElement>, TypographyClassNameOptions {\n ref?: Ref<TypographyHTMLElement>;\n\n /**\n * The component to render as when the children are not a render function. If\n * this prop is omitted, the component will be determined by the `type` prop\n * where:\n *\n * - `\"headline-1\" -> <h1>`\n * - `\"headline-2\" -> <h2>`\n * - `\"headline-3\" -> <h3>`\n * - `\"headline-4\" -> <h4>`\n * - `\"headline-5\" -> <h5>`\n * - `\"headline-6\" -> <h6>`\n * - `\"subtitle-1\" -> <h5>`\n * - `\"subtitle-2\" -> <h6>`\n * - `\"body-1\" -> <p>`\n * - `\"body-2\" -> <p>`\n * - `\"caption\" -> <caption>`\n * - `\"overline\" -> <span>`\n *\n * @since 6.0.0 Renamed from `component`\n */\n as?: CustomTypographyComponent;\n}\n\n/**\n * Render text with one of the material design typography styles applied and\n * optional styles like font-weight, font-style, text color, etc.\n *\n * @example All Example\n * ```tsx\n * import { Typography } from \"@react-md/core/typography/Typography\":\n *\n * export function Example() {\n * return (\n * <>\n * <Typography type=\"headline-1\">Headline 1</Typography>\n * <Typography type=\"headline-2\">Headline 2</Typography>\n * <Typography type=\"headline-3\">Headline 3</Typography>\n * <Typography type=\"headline-4\">Headline 4</Typography>\n * <Typography type=\"headline-5\">Headline 5</Typography>\n * <Typography type=\"headline-6\">Headline 6</Typography>\n * <Typography type=\"subtitle-1\">Subtitle 1</Typography>\n * <Typography type=\"subtitle-2\">Subtitle 2</Typography>\n * <Typography>\n * A paragraph of text.\n * </Typography>\n * <Typography type=\"body-1\">\n * A paragraph of text.\n * </Typography>\n * <Typography type=\"body-2\">\n * Another paragraph of text.\n * </Typography>\n * <Typography type=\"caption\" component=\"h5\">\n * Caption text\n * </Typography>\n * <Typography type=\"overline\" component=\"h5\">\n * Overline text\n * </Typography>\n * </>\n * ):\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/typography | Typography Demos}\n * @since 6.0.0 Removed the children render function behavior . Use the\n * `typography` class name utility instead.\n */\nexport function Typography(props: TypographyProps): ReactElement {\n const {\n ref,\n as,\n type = \"body-1\",\n className,\n margin,\n fontStyle,\n fontWeight,\n textAlign,\n textColor,\n textDecoration,\n textTransform,\n textOverflow,\n children,\n ...remaining\n } = props;\n\n const Component = getComponent(as, type);\n return (\n <Component\n {...remaining}\n ref={ref}\n className={typography({\n type,\n margin,\n fontStyle,\n fontWeight,\n textAlign,\n textColor,\n textDecoration,\n textTransform,\n textOverflow,\n className,\n })}\n >\n {children}\n </Component>\n );\n}\n"],"names":["typography","getComponent","as","type","Typography","props","ref","className","margin","fontStyle","fontWeight","textAlign","textColor","textDecoration","textTransform","textOverflow","children","remaining","Component"],"mappings":";AAOA,SAGEA,UAAU,QACL,wBAAwB;AAuB/B,cAAc,GACd,SAASC,aACPC,EAAyC,EACzCC,IAAoB;IAEpB,IAAID,IAAI;QACN,OAAOA;IACT;IAEA,OAAQC;QACN,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;QACL,KAAK;QACL,KAAK;YACH,OAAO;QACT,KAAK;QACL,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT;YACE,OAAO;IACX;AACF;AAkCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CC,GACD,OAAO,SAASC,WAAWC,KAAsB;IAC/C,MAAM,EACJC,GAAG,EACHJ,EAAE,EACFC,OAAO,QAAQ,EACfI,SAAS,EACTC,MAAM,EACNC,SAAS,EACTC,UAAU,EACVC,SAAS,EACTC,SAAS,EACTC,cAAc,EACdC,aAAa,EACbC,YAAY,EACZC,QAAQ,EACR,GAAGC,WACJ,GAAGZ;IAEJ,MAAMa,YAAYjB,aAAaC,IAAIC;IACnC,qBACE,KAACe;QACE,GAAGD,SAAS;QACbX,KAAKA;QACLC,WAAWP,WAAW;YACpBG;YACAK;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAR;QACF;kBAECS;;AAGP"}
@@ -1,4 +1,5 @@
1
- import { type NonNullRef, type UseStateSetter } from "./types.js";
1
+ import { type RefObject } from "react";
2
+ import { type UseStateSetter } from "./types.js";
2
3
  /**
3
4
  * @since 6.0.0
4
5
  */
@@ -39,7 +40,7 @@ export interface AsyncFunctionHookImplementation {
39
40
  * );
40
41
  * ```
41
42
  */
42
- unmounted: NonNullRef<boolean>;
43
+ unmounted: RefObject<boolean>;
43
44
  setPending: UseStateSetter<boolean>;
44
45
  handleAsync: HandleAsyncFunction;
45
46
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/useAsyncFunction.ts"],"sourcesContent":["\"use client\";\n\nimport { useCallback, useState } from \"react\";\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { type AsyncButton } from \"./button/AsyncButton.js\";\nimport { type NonNullRef, type UseStateSetter } from \"./types.js\";\nimport { useUnmounted } from \"./useUnmounted.js\";\n\n/**\n * @since 6.0.0\n */\nexport type AsyncFunction<Args extends unknown[]> = (\n ...args: Args\n) => Promise<void>;\n\n/**\n * @since 6.0.0\n */\nexport type HandleAsyncFunction = <Args extends unknown[]>(\n action: AsyncFunction<Args>\n) => AsyncFunction<Args>;\n\n/**\n * @since 6.0.0\n */\nexport interface AsyncFunctionHookOptions {\n /** @defaultValue `false` */\n disabled?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface AsyncFunctionHookImplementation {\n pending: boolean;\n\n /**\n * This ref can be used to prevent setting state on an unmounted component.\n * @example\n * ```tsx\n * const { handleAsync, pending, unmounted } = useAsyncFunction();\n *\n * return (\n * <Button\n * onClick={async () => {\n * await handleAsync(someAsyncTaskThatMightUnmountThisComponent);\n * if (!unmounted.current) {\n * // set some local state\n * }\n * }}\n * >\n * Button\n * </Button>\n * );\n * ```\n */\n unmounted: NonNullRef<boolean>;\n setPending: UseStateSetter<boolean>;\n handleAsync: HandleAsyncFunction;\n}\n\n/**\n * A simple utility hook for triggering a pending state while an async function\n * is running. This is really only useful if you aren't using something like\n * `react-query`, `@reduxjs/toolkit/query`, `@apollo/client`, etc for API calls\n * which have a built-in pending state for mutations.\n *\n * @see {@link AsyncButton}\n *\n * @example Confirmation Dialog with Overlay\n * ```tsx\n * import { Button } from \"@react-md/core/button/Button\";\n * import { Dialog } from \"@react-md/core/dialog/Dialog\";\n * import { DialogContent } from \"@react-md/core/dialog/DialogContent\";\n * import { DialogFooter } from \"@react-md/core/dialog/DialogFooter\";\n * import { DialogHeader } from \"@react-md/core/dialog/DialogHeader\";\n * import { Form } from \"@react-md/core/form/Form\";\n * import { useAsyncFunction } from \"@react-md/core/useAsyncFunction\";\n * import CloseIcon from \"@react-md/material-icons/CloseIcon\";\n * import { type ReactElement, useId } from \"react\";\n *\n * interface ExampleProps {\n * hide(); void;\n * submit(): Promise<void>\n * }\n *\n * function Example({ hide, submit }: ExampleProps): ReactElement {\n * const { handleAsync, pending } = useAsyncFunction();\n * const formId = useId();\n *\n * return (\n * <>\n * <DialogHeader>\n * <DialogTitle>Some Title</DialogTitle>\n * <Button aria-label=\"Close\" onClick={hide} disabled={pending}>\n * <CloseIcon />\n * </Button>\n * </DialogHeader>\n * <DialogContent>\n * <Form\n * id={formId}\n * onReset={hide}\n * onSubmit={handleAsync(submit)}\n * >\n * // pretend content\n * </Form>\n * </DialogContent>\n * <DialogFooter>\n * <Button\n * type=\"reset\"\n * form={formId}\n * disabled={pending}\n * >\n * Cancel\n * </Button>\n * <Button\n * type=\"submit\"\n * form={formId}\n * disabled={pending}\n * >\n * Confirm\n * </Button>\n * </DialogFooter>\n * </>\n * );\n * }\n * ```\n *\n * @since 6.0.0\n */\nexport function useAsyncFunction(\n options: AsyncFunctionHookOptions = {}\n): AsyncFunctionHookImplementation {\n const { disabled } = options;\n\n const [pending, setPending] = useState(false);\n const unmounted = useUnmounted();\n\n const handleAsync = useCallback<HandleAsyncFunction>(\n (action) =>\n async (...args) => {\n if (pending || disabled) {\n return;\n }\n\n setPending(true);\n try {\n await action(...args);\n } finally {\n if (!unmounted.current) {\n setPending(false);\n }\n }\n },\n [disabled, pending, unmounted]\n );\n\n return {\n pending,\n unmounted,\n setPending,\n handleAsync,\n };\n}\n"],"names":["useCallback","useState","useUnmounted","useAsyncFunction","options","disabled","pending","setPending","unmounted","handleAsync","action","args","current"],"mappings":"AAAA;AAEA,SAASA,WAAW,EAAEC,QAAQ,QAAQ,QAAQ;AAK9C,SAASC,YAAY,QAAQ,oBAAoB;AAuDjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoEC,GACD,OAAO,SAASC,iBACdC,UAAoC,CAAC,CAAC;IAEtC,MAAM,EAAEC,QAAQ,EAAE,GAAGD;IAErB,MAAM,CAACE,SAASC,WAAW,GAAGN,SAAS;IACvC,MAAMO,YAAYN;IAElB,MAAMO,cAAcT,YAClB,CAACU,SACC,OAAO,GAAGC;YACR,IAAIL,WAAWD,UAAU;gBACvB;YACF;YAEAE,WAAW;YACX,IAAI;gBACF,MAAMG,UAAUC;YAClB,SAAU;gBACR,IAAI,CAACH,UAAUI,OAAO,EAAE;oBACtBL,WAAW;gBACb;YACF;QACF,GACF;QAACF;QAAUC;QAASE;KAAU;IAGhC,OAAO;QACLF;QACAE;QACAD;QACAE;IACF;AACF"}
1
+ {"version":3,"sources":["../src/useAsyncFunction.ts"],"sourcesContent":["\"use client\";\n\nimport { type RefObject, useCallback, useState } from \"react\";\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { type AsyncButton } from \"./button/AsyncButton.js\";\nimport { type UseStateSetter } from \"./types.js\";\nimport { useUnmounted } from \"./useUnmounted.js\";\n\n/**\n * @since 6.0.0\n */\nexport type AsyncFunction<Args extends unknown[]> = (\n ...args: Args\n) => Promise<void>;\n\n/**\n * @since 6.0.0\n */\nexport type HandleAsyncFunction = <Args extends unknown[]>(\n action: AsyncFunction<Args>\n) => AsyncFunction<Args>;\n\n/**\n * @since 6.0.0\n */\nexport interface AsyncFunctionHookOptions {\n /** @defaultValue `false` */\n disabled?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface AsyncFunctionHookImplementation {\n pending: boolean;\n\n /**\n * This ref can be used to prevent setting state on an unmounted component.\n * @example\n * ```tsx\n * const { handleAsync, pending, unmounted } = useAsyncFunction();\n *\n * return (\n * <Button\n * onClick={async () => {\n * await handleAsync(someAsyncTaskThatMightUnmountThisComponent);\n * if (!unmounted.current) {\n * // set some local state\n * }\n * }}\n * >\n * Button\n * </Button>\n * );\n * ```\n */\n unmounted: RefObject<boolean>;\n setPending: UseStateSetter<boolean>;\n handleAsync: HandleAsyncFunction;\n}\n\n/**\n * A simple utility hook for triggering a pending state while an async function\n * is running. This is really only useful if you aren't using something like\n * `react-query`, `@reduxjs/toolkit/query`, `@apollo/client`, etc for API calls\n * which have a built-in pending state for mutations.\n *\n * @see {@link AsyncButton}\n *\n * @example Confirmation Dialog with Overlay\n * ```tsx\n * import { Button } from \"@react-md/core/button/Button\";\n * import { Dialog } from \"@react-md/core/dialog/Dialog\";\n * import { DialogContent } from \"@react-md/core/dialog/DialogContent\";\n * import { DialogFooter } from \"@react-md/core/dialog/DialogFooter\";\n * import { DialogHeader } from \"@react-md/core/dialog/DialogHeader\";\n * import { Form } from \"@react-md/core/form/Form\";\n * import { useAsyncFunction } from \"@react-md/core/useAsyncFunction\";\n * import CloseIcon from \"@react-md/material-icons/CloseIcon\";\n * import { type ReactElement, useId } from \"react\";\n *\n * interface ExampleProps {\n * hide(); void;\n * submit(): Promise<void>\n * }\n *\n * function Example({ hide, submit }: ExampleProps): ReactElement {\n * const { handleAsync, pending } = useAsyncFunction();\n * const formId = useId();\n *\n * return (\n * <>\n * <DialogHeader>\n * <DialogTitle>Some Title</DialogTitle>\n * <Button aria-label=\"Close\" onClick={hide} disabled={pending}>\n * <CloseIcon />\n * </Button>\n * </DialogHeader>\n * <DialogContent>\n * <Form\n * id={formId}\n * onReset={hide}\n * onSubmit={handleAsync(submit)}\n * >\n * // pretend content\n * </Form>\n * </DialogContent>\n * <DialogFooter>\n * <Button\n * type=\"reset\"\n * form={formId}\n * disabled={pending}\n * >\n * Cancel\n * </Button>\n * <Button\n * type=\"submit\"\n * form={formId}\n * disabled={pending}\n * >\n * Confirm\n * </Button>\n * </DialogFooter>\n * </>\n * );\n * }\n * ```\n *\n * @since 6.0.0\n */\nexport function useAsyncFunction(\n options: AsyncFunctionHookOptions = {}\n): AsyncFunctionHookImplementation {\n const { disabled } = options;\n\n const [pending, setPending] = useState(false);\n const unmounted = useUnmounted();\n\n const handleAsync = useCallback<HandleAsyncFunction>(\n (action) =>\n async (...args) => {\n if (pending || disabled) {\n return;\n }\n\n setPending(true);\n try {\n await action(...args);\n } finally {\n if (!unmounted.current) {\n setPending(false);\n }\n }\n },\n [disabled, pending, unmounted]\n );\n\n return {\n pending,\n unmounted,\n setPending,\n handleAsync,\n };\n}\n"],"names":["useCallback","useState","useUnmounted","useAsyncFunction","options","disabled","pending","setPending","unmounted","handleAsync","action","args","current"],"mappings":"AAAA;AAEA,SAAyBA,WAAW,EAAEC,QAAQ,QAAQ,QAAQ;AAK9D,SAASC,YAAY,QAAQ,oBAAoB;AAuDjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoEC,GACD,OAAO,SAASC,iBACdC,UAAoC,CAAC,CAAC;IAEtC,MAAM,EAAEC,QAAQ,EAAE,GAAGD;IAErB,MAAM,CAACE,SAASC,WAAW,GAAGN,SAAS;IACvC,MAAMO,YAAYN;IAElB,MAAMO,cAAcT,YAClB,CAACU,SACC,OAAO,GAAGC;YACR,IAAIL,WAAWD,UAAU;gBACvB;YACF;YAEAE,WAAW;YACX,IAAI;gBACF,MAAMG,UAAUC;YAClB,SAAU;gBACR,IAAI,CAACH,UAAUI,OAAO,EAAE;oBACtBL,WAAW;gBACb;YACF;QACF,GACF;QAACF;QAAUC;QAASE;KAAU;IAGhC,OAAO;QACLF;QACAE;QACAD;QACAE;IACF;AACF"}
@@ -79,7 +79,7 @@ import { useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect.js";
79
79
  * function at most once every X milliseconds).
80
80
  * @since 6.0.0
81
81
  */ export function useDebouncedFunction(func, wait) {
82
- const timeout = useRef();
82
+ const timeout = useRef(undefined);
83
83
  const funcRef = useRef(func);
84
84
  useIsomorphicLayoutEffect(()=>{
85
85
  funcRef.current = func;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/useDebouncedFunction.ts"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useMemo, useRef } from \"react\";\n\nimport { type AnyFunction, type DebouncedFunction } from \"./types.js\";\nimport { useIsomorphicLayoutEffect } from \"./useIsomorphicLayoutEffect.js\";\n\n/**\n * Creates a function that will only be called if it has not been called again\n * for X milliseconds.\n *\n * @example Debounced Search API Requests\n * ```tsx\n * import { TextField } from \"@react-md/core/form/TextField\";\n * import { useDebouncedFunction } from \"@react-md/core/useDebouncedFunction\";\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 = useDebouncedFunction(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 `useThrottledFunction` for throttle behavior instead. (Call a\n * function at most once every X milliseconds).\n * @since 6.0.0\n */\nexport function useDebouncedFunction<F extends AnyFunction>(\n func: F,\n wait: number\n): DebouncedFunction<F> {\n const timeout = useRef<NodeJS.Timeout>();\n const funcRef = useRef(func);\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 debounced: DebouncedFunction<F> = (...args) => {\n globalThis.clearTimeout(timeout.current);\n timeout.current = globalThis.setTimeout(() => {\n funcRef.current(...args);\n }, wait);\n };\n debounced.cancel = () => {\n globalThis.clearTimeout(timeout.current);\n };\n\n return debounced;\n }, [wait]);\n}\n"],"names":["useEffect","useMemo","useRef","useIsomorphicLayoutEffect","useDebouncedFunction","func","wait","timeout","funcRef","current","globalThis","clearTimeout","debounced","args","setTimeout","cancel"],"mappings":"AAAA;AAEA,SAASA,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,QAAQ;AAGnD,SAASC,yBAAyB,QAAQ,iCAAiC;AAE3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6EC,GACD,OAAO,SAASC,qBACdC,IAAO,EACPC,IAAY;IAEZ,MAAMC,UAAUL;IAChB,MAAMM,UAAUN,OAAOG;IACvBF,0BAA0B;QACxBK,QAAQC,OAAO,GAAGJ;IACpB;IAEAL,UAAU;QACR,OAAO;YACLU,WAAWC,YAAY,CAACJ,QAAQE,OAAO;QACzC;IACF,GAAG,EAAE;IAEL,OAAOR,QAAQ;QACb,MAAMW,YAAkC,CAAC,GAAGC;YAC1CH,WAAWC,YAAY,CAACJ,QAAQE,OAAO;YACvCF,QAAQE,OAAO,GAAGC,WAAWI,UAAU,CAAC;gBACtCN,QAAQC,OAAO,IAAII;YACrB,GAAGP;QACL;QACAM,UAAUG,MAAM,GAAG;YACjBL,WAAWC,YAAY,CAACJ,QAAQE,OAAO;QACzC;QAEA,OAAOG;IACT,GAAG;QAACN;KAAK;AACX"}
1
+ {"version":3,"sources":["../src/useDebouncedFunction.ts"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useMemo, useRef } from \"react\";\n\nimport { type AnyFunction, type DebouncedFunction } from \"./types.js\";\nimport { useIsomorphicLayoutEffect } from \"./useIsomorphicLayoutEffect.js\";\n\n/**\n * Creates a function that will only be called if it has not been called again\n * for X milliseconds.\n *\n * @example Debounced Search API Requests\n * ```tsx\n * import { TextField } from \"@react-md/core/form/TextField\";\n * import { useDebouncedFunction } from \"@react-md/core/useDebouncedFunction\";\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 = useDebouncedFunction(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 `useThrottledFunction` for throttle behavior instead. (Call a\n * function at most once every X milliseconds).\n * @since 6.0.0\n */\nexport function useDebouncedFunction<F extends AnyFunction>(\n func: F,\n wait: number\n): DebouncedFunction<F> {\n const timeout = useRef<NodeJS.Timeout>(undefined);\n const funcRef = useRef(func);\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 debounced: DebouncedFunction<F> = (...args) => {\n globalThis.clearTimeout(timeout.current);\n timeout.current = globalThis.setTimeout(() => {\n funcRef.current(...args);\n }, wait);\n };\n debounced.cancel = () => {\n globalThis.clearTimeout(timeout.current);\n };\n\n return debounced;\n }, [wait]);\n}\n"],"names":["useEffect","useMemo","useRef","useIsomorphicLayoutEffect","useDebouncedFunction","func","wait","timeout","undefined","funcRef","current","globalThis","clearTimeout","debounced","args","setTimeout","cancel"],"mappings":"AAAA;AAEA,SAASA,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,QAAQ;AAGnD,SAASC,yBAAyB,QAAQ,iCAAiC;AAE3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6EC,GACD,OAAO,SAASC,qBACdC,IAAO,EACPC,IAAY;IAEZ,MAAMC,UAAUL,OAAuBM;IACvC,MAAMC,UAAUP,OAAOG;IACvBF,0BAA0B;QACxBM,QAAQC,OAAO,GAAGL;IACpB;IAEAL,UAAU;QACR,OAAO;YACLW,WAAWC,YAAY,CAACL,QAAQG,OAAO;QACzC;IACF,GAAG,EAAE;IAEL,OAAOT,QAAQ;QACb,MAAMY,YAAkC,CAAC,GAAGC;YAC1CH,WAAWC,YAAY,CAACL,QAAQG,OAAO;YACvCH,QAAQG,OAAO,GAAGC,WAAWI,UAAU,CAAC;gBACtCN,QAAQC,OAAO,IAAII;YACrB,GAAGR;QACL;QACAO,UAAUG,MAAM,GAAG;YACjBL,WAAWC,YAAY,CAACL,QAAQG,OAAO;QACzC;QAEA,OAAOG;IACT,GAAG;QAACP;KAAK;AACX"}