@react-md/core 6.0.1 → 6.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (763) hide show
  1. package/dist/CoreProviders.d.ts +1 -1
  2. package/dist/CoreProviders.js +1 -1
  3. package/dist/CoreProviders.js.map +1 -1
  4. package/dist/SsrProvider.d.ts +1 -1
  5. package/dist/SsrProvider.js +1 -1
  6. package/dist/SsrProvider.js.map +1 -1
  7. package/dist/autocomplete/Autocomplete.d.ts +2 -2
  8. package/dist/autocomplete/Autocomplete.js +1 -1
  9. package/dist/autocomplete/Autocomplete.js.map +1 -1
  10. package/dist/autocomplete/AutocompleteChip.d.ts +1 -1
  11. package/dist/autocomplete/AutocompleteChip.js +1 -1
  12. package/dist/autocomplete/AutocompleteChip.js.map +1 -1
  13. package/dist/autocomplete/AutocompleteCircularProgress.d.ts +1 -1
  14. package/dist/autocomplete/AutocompleteCircularProgress.js +1 -1
  15. package/dist/autocomplete/AutocompleteCircularProgress.js.map +1 -1
  16. package/dist/autocomplete/AutocompleteClearButton.d.ts +1 -1
  17. package/dist/autocomplete/AutocompleteClearButton.js +1 -1
  18. package/dist/autocomplete/AutocompleteClearButton.js.map +1 -1
  19. package/dist/autocomplete/AutocompleteDropdownButton.d.ts +1 -1
  20. package/dist/autocomplete/AutocompleteDropdownButton.js +1 -1
  21. package/dist/autocomplete/AutocompleteDropdownButton.js.map +1 -1
  22. package/dist/autocomplete/_autocomplete.scss +8 -5
  23. package/dist/autocomplete/useAutocomplete.d.ts +3 -3
  24. package/dist/autocomplete/useAutocomplete.js +2 -1
  25. package/dist/autocomplete/useAutocomplete.js.map +1 -1
  26. package/dist/avatar/Avatar.d.ts +1 -1
  27. package/dist/avatar/Avatar.js +1 -1
  28. package/dist/avatar/Avatar.js.map +1 -1
  29. package/dist/badge/Badge.d.ts +1 -1
  30. package/dist/badge/Badge.js +1 -1
  31. package/dist/badge/Badge.js.map +1 -1
  32. package/dist/box/Box.d.ts +1 -1
  33. package/dist/box/Box.js +1 -1
  34. package/dist/box/Box.js.map +1 -1
  35. package/dist/button/AsyncButton.d.ts +1 -1
  36. package/dist/button/AsyncButton.js +1 -1
  37. package/dist/button/AsyncButton.js.map +1 -1
  38. package/dist/button/Button.d.ts +1 -1
  39. package/dist/button/Button.js +1 -1
  40. package/dist/button/Button.js.map +1 -1
  41. package/dist/button/ButtonUnstyled.d.ts +1 -1
  42. package/dist/button/ButtonUnstyled.js +1 -1
  43. package/dist/button/ButtonUnstyled.js.map +1 -1
  44. package/dist/button/TooltippedButton.d.ts +1 -1
  45. package/dist/button/TooltippedButton.js +1 -1
  46. package/dist/button/TooltippedButton.js.map +1 -1
  47. package/dist/card/Card.d.ts +1 -1
  48. package/dist/card/Card.js +1 -1
  49. package/dist/card/Card.js.map +1 -1
  50. package/dist/card/CardContent.d.ts +1 -1
  51. package/dist/card/CardContent.js +1 -1
  52. package/dist/card/CardContent.js.map +1 -1
  53. package/dist/card/CardFooter.d.ts +1 -1
  54. package/dist/card/CardFooter.js +1 -1
  55. package/dist/card/CardFooter.js.map +1 -1
  56. package/dist/card/CardHeader.d.ts +1 -1
  57. package/dist/card/CardHeader.js +1 -1
  58. package/dist/card/CardHeader.js.map +1 -1
  59. package/dist/card/CardSubtitle.d.ts +1 -1
  60. package/dist/card/CardSubtitle.js +1 -1
  61. package/dist/card/CardSubtitle.js.map +1 -1
  62. package/dist/card/CardTitle.d.ts +1 -1
  63. package/dist/card/CardTitle.js +1 -1
  64. package/dist/card/CardTitle.js.map +1 -1
  65. package/dist/card/ClickableCard.d.ts +1 -1
  66. package/dist/card/ClickableCard.js +1 -1
  67. package/dist/card/ClickableCard.js.map +1 -1
  68. package/dist/chip/Chip.d.ts +1 -1
  69. package/dist/chip/Chip.js +1 -1
  70. package/dist/chip/Chip.js.map +1 -1
  71. package/dist/dialog/Dialog.d.ts +1 -1
  72. package/dist/dialog/Dialog.js +1 -1
  73. package/dist/dialog/Dialog.js.map +1 -1
  74. package/dist/dialog/DialogContent.d.ts +1 -1
  75. package/dist/dialog/DialogContent.js +1 -1
  76. package/dist/dialog/DialogContent.js.map +1 -1
  77. package/dist/dialog/DialogFooter.d.ts +1 -1
  78. package/dist/dialog/DialogFooter.js +1 -1
  79. package/dist/dialog/DialogFooter.js.map +1 -1
  80. package/dist/dialog/DialogHeader.d.ts +1 -1
  81. package/dist/dialog/DialogHeader.js +1 -1
  82. package/dist/dialog/DialogHeader.js.map +1 -1
  83. package/dist/dialog/DialogTitle.d.ts +1 -1
  84. package/dist/dialog/DialogTitle.js +1 -1
  85. package/dist/dialog/DialogTitle.js.map +1 -1
  86. package/dist/dialog/FixedDialog.d.ts +1 -1
  87. package/dist/dialog/FixedDialog.js +1 -1
  88. package/dist/dialog/FixedDialog.js.map +1 -1
  89. package/dist/divider/Divider.d.ts +1 -1
  90. package/dist/divider/Divider.js +1 -1
  91. package/dist/divider/Divider.js.map +1 -1
  92. package/dist/draggable/useDraggable.d.ts +1 -1
  93. package/dist/draggable/useDraggable.js +1 -1
  94. package/dist/draggable/useDraggable.js.map +1 -1
  95. package/dist/expansion-panel/ExpansionList.d.ts +1 -1
  96. package/dist/expansion-panel/ExpansionList.js +1 -1
  97. package/dist/expansion-panel/ExpansionList.js.map +1 -1
  98. package/dist/expansion-panel/ExpansionPanel.d.ts +1 -1
  99. package/dist/expansion-panel/ExpansionPanel.js +1 -1
  100. package/dist/expansion-panel/ExpansionPanel.js.map +1 -1
  101. package/dist/expansion-panel/ExpansionPanelHeader.d.ts +1 -1
  102. package/dist/expansion-panel/ExpansionPanelHeader.js +1 -1
  103. package/dist/expansion-panel/ExpansionPanelHeader.js.map +1 -1
  104. package/dist/expansion-panel/useExpansionList.d.ts +1 -1
  105. package/dist/expansion-panel/useExpansionList.js +1 -1
  106. package/dist/expansion-panel/useExpansionList.js.map +1 -1
  107. package/dist/expansion-panel/useExpansionPanels.d.ts +1 -1
  108. package/dist/expansion-panel/useExpansionPanels.js +1 -1
  109. package/dist/expansion-panel/useExpansionPanels.js.map +1 -1
  110. package/dist/files/FileInput.d.ts +1 -1
  111. package/dist/files/FileInput.js +1 -1
  112. package/dist/files/FileInput.js.map +1 -1
  113. package/dist/files/useFileUpload.d.ts +2 -2
  114. package/dist/files/useFileUpload.js +2 -2
  115. package/dist/files/useFileUpload.js.map +1 -1
  116. package/dist/form/Checkbox.d.ts +1 -1
  117. package/dist/form/Checkbox.js +1 -1
  118. package/dist/form/Checkbox.js.map +1 -1
  119. package/dist/form/Fieldset.d.ts +1 -1
  120. package/dist/form/Fieldset.js +1 -1
  121. package/dist/form/Fieldset.js.map +1 -1
  122. package/dist/form/Form.d.ts +1 -1
  123. package/dist/form/Form.js +1 -1
  124. package/dist/form/Form.js.map +1 -1
  125. package/dist/form/FormMessage.d.ts +1 -1
  126. package/dist/form/FormMessage.js +1 -1
  127. package/dist/form/FormMessage.js.map +1 -1
  128. package/dist/form/FormMessageContainer.d.ts +1 -1
  129. package/dist/form/FormMessageContainer.js +1 -1
  130. package/dist/form/FormMessageContainer.js.map +1 -1
  131. package/dist/form/FormMessageCounter.d.ts +2 -2
  132. package/dist/form/FormMessageCounter.js +2 -2
  133. package/dist/form/FormMessageCounter.js.map +1 -1
  134. package/dist/form/InputToggle.d.ts +2 -2
  135. package/dist/form/InputToggle.js +2 -2
  136. package/dist/form/InputToggle.js.map +1 -1
  137. package/dist/form/Label.d.ts +3 -3
  138. package/dist/form/Label.js +3 -3
  139. package/dist/form/Label.js.map +1 -1
  140. package/dist/form/Legend.d.ts +1 -1
  141. package/dist/form/Legend.js +1 -1
  142. package/dist/form/Legend.js.map +1 -1
  143. package/dist/form/NativeSelect.d.ts +1 -1
  144. package/dist/form/NativeSelect.js +1 -1
  145. package/dist/form/NativeSelect.js.map +1 -1
  146. package/dist/form/OptGroup.d.ts +1 -1
  147. package/dist/form/OptGroup.js +1 -1
  148. package/dist/form/OptGroup.js.map +1 -1
  149. package/dist/form/Option.d.ts +1 -1
  150. package/dist/form/Option.js +1 -1
  151. package/dist/form/Option.js.map +1 -1
  152. package/dist/form/Password.d.ts +1 -1
  153. package/dist/form/Password.js +1 -1
  154. package/dist/form/Password.js.map +1 -1
  155. package/dist/form/Radio.d.ts +1 -1
  156. package/dist/form/Radio.js +1 -1
  157. package/dist/form/Radio.js.map +1 -1
  158. package/dist/form/Select.d.ts +1 -1
  159. package/dist/form/Select.js +1 -1
  160. package/dist/form/Select.js.map +1 -1
  161. package/dist/form/Slider.d.ts +1 -1
  162. package/dist/form/Slider.js.map +1 -1
  163. package/dist/form/Switch.d.ts +1 -1
  164. package/dist/form/Switch.js +1 -1
  165. package/dist/form/Switch.js.map +1 -1
  166. package/dist/form/TextArea.d.ts +1 -1
  167. package/dist/form/TextArea.js +1 -1
  168. package/dist/form/TextArea.js.map +1 -1
  169. package/dist/form/TextField.d.ts +1 -1
  170. package/dist/form/TextField.js +1 -1
  171. package/dist/form/TextField.js.map +1 -1
  172. package/dist/form/useCheckboxGroup.d.ts +8 -8
  173. package/dist/form/useCheckboxGroup.js +2 -2
  174. package/dist/form/useCheckboxGroup.js.map +1 -1
  175. package/dist/form/useCombobox.js +1 -0
  176. package/dist/form/useCombobox.js.map +1 -1
  177. package/dist/form/useNumberField.d.ts +2 -2
  178. package/dist/form/useNumberField.js +2 -2
  179. package/dist/form/useNumberField.js.map +1 -1
  180. package/dist/form/useRadioGroup.d.ts +4 -4
  181. package/dist/form/useRadioGroup.js +2 -2
  182. package/dist/form/useRadioGroup.js.map +1 -1
  183. package/dist/form/useRangeSlider.d.ts +1 -1
  184. package/dist/form/useRangeSlider.js +1 -1
  185. package/dist/form/useRangeSlider.js.map +1 -1
  186. package/dist/form/useSlider.d.ts +1 -1
  187. package/dist/form/useSlider.js +1 -1
  188. package/dist/form/useSlider.js.map +1 -1
  189. package/dist/form/useTextField.d.ts +4 -4
  190. package/dist/form/useTextField.js +2 -2
  191. package/dist/form/useTextField.js.map +1 -1
  192. package/dist/icon/FontIcon.d.ts +1 -1
  193. package/dist/icon/FontIcon.js +1 -1
  194. package/dist/icon/FontIcon.js.map +1 -1
  195. package/dist/icon/IconRotator.d.ts +1 -1
  196. package/dist/icon/IconRotator.js +1 -1
  197. package/dist/icon/IconRotator.js.map +1 -1
  198. package/dist/icon/MaterialIcon.d.ts +2 -2
  199. package/dist/icon/MaterialIcon.js +2 -2
  200. package/dist/icon/MaterialIcon.js.map +1 -1
  201. package/dist/icon/MaterialSymbol.d.ts +2 -2
  202. package/dist/icon/MaterialSymbol.js +2 -2
  203. package/dist/icon/MaterialSymbol.js.map +1 -1
  204. package/dist/icon/SVGIcon.d.ts +1 -1
  205. package/dist/icon/SVGIcon.js +1 -1
  206. package/dist/icon/SVGIcon.js.map +1 -1
  207. package/dist/icon/TextIconSpacing.d.ts +1 -1
  208. package/dist/icon/TextIconSpacing.js +1 -1
  209. package/dist/icon/TextIconSpacing.js.map +1 -1
  210. package/dist/layout/LayoutAppBar.d.ts +1 -1
  211. package/dist/layout/LayoutAppBar.js +1 -1
  212. package/dist/layout/LayoutAppBar.js.map +1 -1
  213. package/dist/layout/LayoutNav.d.ts +1 -1
  214. package/dist/layout/LayoutNav.js +1 -1
  215. package/dist/layout/LayoutNav.js.map +1 -1
  216. package/dist/layout/LayoutWindowSplitter.d.ts +1 -1
  217. package/dist/layout/LayoutWindowSplitter.js +1 -1
  218. package/dist/layout/LayoutWindowSplitter.js.map +1 -1
  219. package/dist/layout/Main.d.ts +1 -1
  220. package/dist/layout/Main.js +1 -1
  221. package/dist/layout/Main.js.map +1 -1
  222. package/dist/layout/useExpandableLayout.d.ts +1 -1
  223. package/dist/layout/useExpandableLayout.js +1 -1
  224. package/dist/layout/useExpandableLayout.js.map +1 -1
  225. package/dist/layout/useHorizontalLayoutTransition.d.ts +1 -1
  226. package/dist/layout/useHorizontalLayoutTransition.js +1 -1
  227. package/dist/layout/useHorizontalLayoutTransition.js.map +1 -1
  228. package/dist/layout/useLayoutAppBarHeight.d.ts +1 -1
  229. package/dist/layout/useLayoutAppBarHeight.js +1 -1
  230. package/dist/layout/useLayoutAppBarHeight.js.map +1 -1
  231. package/dist/layout/useLayoutTree.d.ts +3 -3
  232. package/dist/layout/useLayoutTree.js +3 -3
  233. package/dist/layout/useLayoutTree.js.map +1 -1
  234. package/dist/layout/useLayoutWindowSplitter.d.ts +1 -1
  235. package/dist/layout/useLayoutWindowSplitter.js +1 -1
  236. package/dist/layout/useLayoutWindowSplitter.js.map +1 -1
  237. package/dist/layout/useResizableLayout.d.ts +1 -1
  238. package/dist/layout/useResizableLayout.js +1 -1
  239. package/dist/layout/useResizableLayout.js.map +1 -1
  240. package/dist/layout/useTemporaryLayout.d.ts +1 -1
  241. package/dist/layout/useTemporaryLayout.js +1 -1
  242. package/dist/layout/useTemporaryLayout.js.map +1 -1
  243. package/dist/link/Link.d.ts +1 -1
  244. package/dist/link/Link.js +1 -1
  245. package/dist/link/Link.js.map +1 -1
  246. package/dist/link/SkipToMainContent.d.ts +1 -1
  247. package/dist/link/SkipToMainContent.js +1 -1
  248. package/dist/link/SkipToMainContent.js.map +1 -1
  249. package/dist/list/List.d.ts +1 -1
  250. package/dist/list/List.js +1 -1
  251. package/dist/list/List.js.map +1 -1
  252. package/dist/list/ListItem.d.ts +1 -1
  253. package/dist/list/ListItem.js +1 -1
  254. package/dist/list/ListItem.js.map +1 -1
  255. package/dist/list/ListItemChildren.d.ts +1 -1
  256. package/dist/list/ListItemChildren.js +1 -1
  257. package/dist/list/ListItemChildren.js.map +1 -1
  258. package/dist/list/ListItemLink.d.ts +1 -1
  259. package/dist/list/ListItemLink.js +1 -1
  260. package/dist/list/ListItemLink.js.map +1 -1
  261. package/dist/list/ListSubheader.d.ts +1 -1
  262. package/dist/list/ListSubheader.js +1 -1
  263. package/dist/list/ListSubheader.js.map +1 -1
  264. package/dist/media-queries/AppSizeProvider.d.ts +2 -2
  265. package/dist/media-queries/AppSizeProvider.js +2 -2
  266. package/dist/media-queries/AppSizeProvider.js.map +1 -1
  267. package/dist/media-queries/useMediaQuery.d.ts +2 -2
  268. package/dist/media-queries/useMediaQuery.js +2 -2
  269. package/dist/media-queries/useMediaQuery.js.map +1 -1
  270. package/dist/menu/DropdownMenu.d.ts +1 -1
  271. package/dist/menu/DropdownMenu.js +2 -1
  272. package/dist/menu/DropdownMenu.js.map +1 -1
  273. package/dist/menu/Menu.d.ts +1 -1
  274. package/dist/menu/Menu.js +1 -1
  275. package/dist/menu/Menu.js.map +1 -1
  276. package/dist/menu/MenuBar.d.ts +1 -1
  277. package/dist/menu/MenuBar.js +1 -1
  278. package/dist/menu/MenuBar.js.map +1 -1
  279. package/dist/menu/MenuButton.d.ts +1 -1
  280. package/dist/menu/MenuButton.js +1 -1
  281. package/dist/menu/MenuButton.js.map +1 -1
  282. package/dist/menu/MenuItem.d.ts +1 -1
  283. package/dist/menu/MenuItem.js +1 -1
  284. package/dist/menu/MenuItem.js.map +1 -1
  285. package/dist/menu/MenuItemCheckbox.d.ts +1 -1
  286. package/dist/menu/MenuItemCheckbox.js +1 -1
  287. package/dist/menu/MenuItemCheckbox.js.map +1 -1
  288. package/dist/menu/MenuItemFileInput.d.ts +1 -1
  289. package/dist/menu/MenuItemFileInput.js +1 -1
  290. package/dist/menu/MenuItemFileInput.js.map +1 -1
  291. package/dist/menu/MenuItemGroup.d.ts +1 -1
  292. package/dist/menu/MenuItemGroup.js +1 -1
  293. package/dist/menu/MenuItemGroup.js.map +1 -1
  294. package/dist/menu/MenuItemInputToggle.d.ts +1 -1
  295. package/dist/menu/MenuItemInputToggle.js +1 -1
  296. package/dist/menu/MenuItemInputToggle.js.map +1 -1
  297. package/dist/menu/MenuItemRadio.d.ts +1 -1
  298. package/dist/menu/MenuItemRadio.js +1 -1
  299. package/dist/menu/MenuItemRadio.js.map +1 -1
  300. package/dist/menu/MenuItemSeparator.d.ts +1 -1
  301. package/dist/menu/MenuItemSeparator.js +1 -1
  302. package/dist/menu/MenuItemSeparator.js.map +1 -1
  303. package/dist/menu/MenuItemSwitch.d.ts +1 -1
  304. package/dist/menu/MenuItemSwitch.js +1 -1
  305. package/dist/menu/MenuItemSwitch.js.map +1 -1
  306. package/dist/menu/MenuItemTextField.d.ts +1 -1
  307. package/dist/menu/MenuItemTextField.js +1 -1
  308. package/dist/menu/MenuItemTextField.js.map +1 -1
  309. package/dist/menu/useContextMenu.d.ts +1 -1
  310. package/dist/menu/useContextMenu.js +1 -1
  311. package/dist/menu/useContextMenu.js.map +1 -1
  312. package/dist/navigation/CollapsibleNavGroup.d.ts +1 -1
  313. package/dist/navigation/CollapsibleNavGroup.js +1 -1
  314. package/dist/navigation/CollapsibleNavGroup.js.map +1 -1
  315. package/dist/navigation/DefaultNavigationRenderer.d.ts +1 -1
  316. package/dist/navigation/DefaultNavigationRenderer.js +1 -1
  317. package/dist/navigation/DefaultNavigationRenderer.js.map +1 -1
  318. package/dist/navigation/NavGroup.d.ts +1 -1
  319. package/dist/navigation/NavGroup.js +1 -1
  320. package/dist/navigation/NavGroup.js.map +1 -1
  321. package/dist/navigation/NavItem.d.ts +1 -1
  322. package/dist/navigation/NavItem.js +1 -1
  323. package/dist/navigation/NavItem.js.map +1 -1
  324. package/dist/navigation/NavItemButton.d.ts +1 -1
  325. package/dist/navigation/NavItemButton.js +1 -1
  326. package/dist/navigation/NavItemButton.js.map +1 -1
  327. package/dist/navigation/NavItemLink.d.ts +1 -1
  328. package/dist/navigation/NavItemLink.js +1 -1
  329. package/dist/navigation/NavItemLink.js.map +1 -1
  330. package/dist/navigation/NavSubheader.d.ts +1 -1
  331. package/dist/navigation/NavSubheader.js +1 -1
  332. package/dist/navigation/NavSubheader.js.map +1 -1
  333. package/dist/navigation/Navigation.d.ts +1 -1
  334. package/dist/navigation/Navigation.js +1 -1
  335. package/dist/navigation/Navigation.js.map +1 -1
  336. package/dist/navigation/useActiveHeadingId.d.ts +1 -1
  337. package/dist/navigation/useActiveHeadingId.js +1 -1
  338. package/dist/navigation/useActiveHeadingId.js.map +1 -1
  339. package/dist/navigation/useNavigationExpansion.d.ts +2 -2
  340. package/dist/navigation/useNavigationExpansion.js +2 -2
  341. package/dist/navigation/useNavigationExpansion.js.map +1 -1
  342. package/dist/navigation/useTableOfContentsHeadings.d.ts +1 -1
  343. package/dist/navigation/useTableOfContentsHeadings.js +1 -1
  344. package/dist/navigation/useTableOfContentsHeadings.js.map +1 -1
  345. package/dist/overlay/Overlay.d.ts +1 -1
  346. package/dist/overlay/Overlay.js +1 -1
  347. package/dist/overlay/Overlay.js.map +1 -1
  348. package/dist/portal/Portal.d.ts +1 -1
  349. package/dist/portal/Portal.js +1 -1
  350. package/dist/portal/Portal.js.map +1 -1
  351. package/dist/portal/PortalContainerProvider.d.ts +1 -1
  352. package/dist/portal/PortalContainerProvider.js +1 -1
  353. package/dist/portal/PortalContainerProvider.js.map +1 -1
  354. package/dist/positioning/useFixedPositioning.d.ts +1 -1
  355. package/dist/positioning/useFixedPositioning.js +1 -1
  356. package/dist/positioning/useFixedPositioning.js.map +1 -1
  357. package/dist/progress/CircularProgress.d.ts +1 -1
  358. package/dist/progress/CircularProgress.js +1 -1
  359. package/dist/progress/CircularProgress.js.map +1 -1
  360. package/dist/progress/LinearProgress.d.ts +1 -1
  361. package/dist/progress/LinearProgress.js +1 -1
  362. package/dist/progress/LinearProgress.js.map +1 -1
  363. package/dist/responsive-item/ResponsiveItem.d.ts +1 -1
  364. package/dist/responsive-item/ResponsiveItem.js +1 -1
  365. package/dist/responsive-item/ResponsiveItem.js.map +1 -1
  366. package/dist/responsive-item/ResponsiveItemOverlay.d.ts +1 -1
  367. package/dist/responsive-item/ResponsiveItemOverlay.js +1 -1
  368. package/dist/responsive-item/ResponsiveItemOverlay.js.map +1 -1
  369. package/dist/scroll/useScrollLock.d.ts +1 -1
  370. package/dist/scroll/useScrollLock.js +1 -1
  371. package/dist/scroll/useScrollLock.js.map +1 -1
  372. package/dist/segmented-button/SegmentedButton.d.ts +1 -1
  373. package/dist/segmented-button/SegmentedButton.js +1 -1
  374. package/dist/segmented-button/SegmentedButton.js.map +1 -1
  375. package/dist/segmented-button/SegmentedButtonContainer.d.ts +1 -1
  376. package/dist/segmented-button/SegmentedButtonContainer.js +1 -1
  377. package/dist/segmented-button/SegmentedButtonContainer.js.map +1 -1
  378. package/dist/sheet/Sheet.d.ts +1 -1
  379. package/dist/sheet/Sheet.js +1 -1
  380. package/dist/sheet/Sheet.js.map +1 -1
  381. package/dist/snackbar/DefaultToastRenderer.d.ts +1 -1
  382. package/dist/snackbar/DefaultToastRenderer.js +1 -1
  383. package/dist/snackbar/DefaultToastRenderer.js.map +1 -1
  384. package/dist/snackbar/Snackbar.d.ts +1 -1
  385. package/dist/snackbar/Snackbar.js +1 -1
  386. package/dist/snackbar/Snackbar.js.map +1 -1
  387. package/dist/snackbar/Toast.d.ts +1 -1
  388. package/dist/snackbar/Toast.js +1 -1
  389. package/dist/snackbar/Toast.js.map +1 -1
  390. package/dist/snackbar/ToastActionButton.d.ts +1 -1
  391. package/dist/snackbar/ToastActionButton.js +1 -1
  392. package/dist/snackbar/ToastActionButton.js.map +1 -1
  393. package/dist/snackbar/ToastCloseButton.d.ts +1 -1
  394. package/dist/snackbar/ToastCloseButton.js +1 -1
  395. package/dist/snackbar/ToastCloseButton.js.map +1 -1
  396. package/dist/snackbar/ToastContent.d.ts +1 -1
  397. package/dist/snackbar/ToastContent.js +1 -1
  398. package/dist/snackbar/ToastContent.js.map +1 -1
  399. package/dist/snackbar/ToastManager.d.ts +1 -1
  400. package/dist/snackbar/ToastManager.js +1 -1
  401. package/dist/snackbar/ToastManager.js.map +1 -1
  402. package/dist/snackbar/ToastManagerProvider.d.ts +1 -1
  403. package/dist/snackbar/ToastManagerProvider.js +1 -1
  404. package/dist/snackbar/ToastManagerProvider.js.map +1 -1
  405. package/dist/snackbar/useCurrentToastActions.d.ts +1 -1
  406. package/dist/snackbar/useCurrentToastActions.js +1 -1
  407. package/dist/snackbar/useCurrentToastActions.js.map +1 -1
  408. package/dist/storage/useStorage.d.ts +1 -1
  409. package/dist/storage/useStorage.js +1 -1
  410. package/dist/storage/useStorage.js.map +1 -1
  411. package/dist/suspense/CircularProgressSuspense.d.ts +1 -1
  412. package/dist/suspense/CircularProgressSuspense.js +1 -1
  413. package/dist/suspense/CircularProgressSuspense.js.map +1 -1
  414. package/dist/suspense/NullSuspense.d.ts +1 -1
  415. package/dist/suspense/NullSuspense.js +1 -1
  416. package/dist/suspense/NullSuspense.js.map +1 -1
  417. package/dist/table/StickyTableSection.d.ts +2 -2
  418. package/dist/table/StickyTableSection.js +2 -2
  419. package/dist/table/StickyTableSection.js.map +1 -1
  420. package/dist/table/Table.d.ts +1 -1
  421. package/dist/table/Table.js +1 -1
  422. package/dist/table/Table.js.map +1 -1
  423. package/dist/table/TableBody.d.ts +1 -1
  424. package/dist/table/TableBody.js +1 -1
  425. package/dist/table/TableBody.js.map +1 -1
  426. package/dist/table/TableCell.d.ts +1 -1
  427. package/dist/table/TableCell.js +1 -1
  428. package/dist/table/TableCell.js.map +1 -1
  429. package/dist/table/TableCheckbox.d.ts +1 -1
  430. package/dist/table/TableCheckbox.js +1 -1
  431. package/dist/table/TableCheckbox.js.map +1 -1
  432. package/dist/table/TableContainer.d.ts +1 -1
  433. package/dist/table/TableContainer.js +1 -1
  434. package/dist/table/TableContainer.js.map +1 -1
  435. package/dist/table/TableFooter.d.ts +1 -1
  436. package/dist/table/TableFooter.js +1 -1
  437. package/dist/table/TableFooter.js.map +1 -1
  438. package/dist/table/TableHeader.d.ts +1 -1
  439. package/dist/table/TableHeader.js +1 -1
  440. package/dist/table/TableHeader.js.map +1 -1
  441. package/dist/table/TableRadio.d.ts +1 -1
  442. package/dist/table/TableRadio.js +1 -1
  443. package/dist/table/TableRadio.js.map +1 -1
  444. package/dist/table/TableRow.d.ts +1 -1
  445. package/dist/table/TableRow.js +1 -1
  446. package/dist/table/TableRow.js.map +1 -1
  447. package/dist/tabs/SimpleTabPanel.d.ts +2 -2
  448. package/dist/tabs/SimpleTabPanel.js +2 -2
  449. package/dist/tabs/SimpleTabPanel.js.map +1 -1
  450. package/dist/tabs/SimpleTabPanels.d.ts +2 -2
  451. package/dist/tabs/SimpleTabPanels.js +2 -2
  452. package/dist/tabs/SimpleTabPanels.js.map +1 -1
  453. package/dist/tabs/Tab.d.ts +1 -1
  454. package/dist/tabs/Tab.js +1 -1
  455. package/dist/tabs/Tab.js.map +1 -1
  456. package/dist/tabs/TabList.d.ts +1 -1
  457. package/dist/tabs/TabList.js +1 -1
  458. package/dist/tabs/TabList.js.map +1 -1
  459. package/dist/tabs/useTabs.d.ts +4 -4
  460. package/dist/tabs/useTabs.js +2 -1
  461. package/dist/tabs/useTabs.js.map +1 -1
  462. package/dist/theme/LocalStorageColorSchemeProvider.d.ts +2 -2
  463. package/dist/theme/LocalStorageColorSchemeProvider.js +2 -2
  464. package/dist/theme/LocalStorageColorSchemeProvider.js.map +1 -1
  465. package/dist/theme/ThemeProvider.d.ts +1 -1
  466. package/dist/theme/ThemeProvider.js +1 -1
  467. package/dist/theme/ThemeProvider.js.map +1 -1
  468. package/dist/theme/useColorSchemeProvider.js +1 -0
  469. package/dist/theme/useColorSchemeProvider.js.map +1 -1
  470. package/dist/tooltip/Tooltip.d.ts +1 -1
  471. package/dist/tooltip/Tooltip.js +1 -1
  472. package/dist/tooltip/Tooltip.js.map +1 -1
  473. package/dist/tooltip/TooltipHoverModeProvider.d.ts +1 -1
  474. package/dist/tooltip/TooltipHoverModeProvider.js +1 -1
  475. package/dist/tooltip/TooltipHoverModeProvider.js.map +1 -1
  476. package/dist/tooltip/useTooltip.d.ts +1 -1
  477. package/dist/tooltip/useTooltip.js +1 -1
  478. package/dist/tooltip/useTooltip.js.map +1 -1
  479. package/dist/transition/CSSTransition.d.ts +1 -1
  480. package/dist/transition/CSSTransition.js +1 -1
  481. package/dist/transition/CSSTransition.js.map +1 -1
  482. package/dist/transition/Collapse.d.ts +1 -1
  483. package/dist/transition/Collapse.js +1 -1
  484. package/dist/transition/Collapse.js.map +1 -1
  485. package/dist/transition/CrossFade.d.ts +1 -1
  486. package/dist/transition/CrossFade.js +1 -1
  487. package/dist/transition/CrossFade.js.map +1 -1
  488. package/dist/transition/ScaleTransition.d.ts +1 -1
  489. package/dist/transition/ScaleTransition.js +1 -1
  490. package/dist/transition/ScaleTransition.js.map +1 -1
  491. package/dist/transition/SkeletonPlaceholder.d.ts +1 -1
  492. package/dist/transition/SkeletonPlaceholder.js +1 -1
  493. package/dist/transition/SkeletonPlaceholder.js.map +1 -1
  494. package/dist/transition/Slide.d.ts +1 -1
  495. package/dist/transition/Slide.js +1 -1
  496. package/dist/transition/Slide.js.map +1 -1
  497. package/dist/transition/SlideContainer.d.ts +1 -1
  498. package/dist/transition/SlideContainer.js +1 -1
  499. package/dist/transition/SlideContainer.js.map +1 -1
  500. package/dist/transition/useCSSTransition.d.ts +2 -2
  501. package/dist/transition/useCSSTransition.js +2 -2
  502. package/dist/transition/useCSSTransition.js.map +1 -1
  503. package/dist/transition/useCarousel.d.ts +1 -1
  504. package/dist/transition/useCarousel.js +1 -1
  505. package/dist/transition/useCarousel.js.map +1 -1
  506. package/dist/transition/useCollapseTransition.d.ts +2 -2
  507. package/dist/transition/useCollapseTransition.js +2 -2
  508. package/dist/transition/useCollapseTransition.js.map +1 -1
  509. package/dist/transition/useCrossFadeTransition.d.ts +2 -2
  510. package/dist/transition/useCrossFadeTransition.js +2 -2
  511. package/dist/transition/useCrossFadeTransition.js.map +1 -1
  512. package/dist/transition/useScaleTransition.d.ts +2 -2
  513. package/dist/transition/useScaleTransition.js +2 -2
  514. package/dist/transition/useScaleTransition.js.map +1 -1
  515. package/dist/transition/useSkeletonPlaceholder.d.ts +2 -2
  516. package/dist/transition/useSkeletonPlaceholder.js +2 -2
  517. package/dist/transition/useSkeletonPlaceholder.js.map +1 -1
  518. package/dist/transition/useSlideTransition.d.ts +1 -1
  519. package/dist/transition/useSlideTransition.js +1 -1
  520. package/dist/transition/useSlideTransition.js.map +1 -1
  521. package/dist/transition/useTransition.d.ts +1 -1
  522. package/dist/transition/useTransition.js +1 -1
  523. package/dist/transition/useTransition.js.map +1 -1
  524. package/dist/tree/DefaultTreeItemRenderer.d.ts +1 -1
  525. package/dist/tree/DefaultTreeItemRenderer.js +1 -1
  526. package/dist/tree/DefaultTreeItemRenderer.js.map +1 -1
  527. package/dist/tree/Tree.d.ts +1 -1
  528. package/dist/tree/Tree.js +1 -1
  529. package/dist/tree/Tree.js.map +1 -1
  530. package/dist/tree/TreeItem.d.ts +1 -1
  531. package/dist/tree/TreeItem.js +1 -1
  532. package/dist/tree/TreeItem.js.map +1 -1
  533. package/dist/tree/useTree.d.ts +1 -1
  534. package/dist/tree/useTree.js +1 -1
  535. package/dist/tree/useTree.js.map +1 -1
  536. package/dist/tree/useTreeExpansion.d.ts +1 -1
  537. package/dist/tree/useTreeExpansion.js +1 -1
  538. package/dist/tree/useTreeExpansion.js.map +1 -1
  539. package/dist/tree/useTreeItems.d.ts +1 -1
  540. package/dist/tree/useTreeItems.js +1 -1
  541. package/dist/tree/useTreeItems.js.map +1 -1
  542. package/dist/tree/useTreeSelection.d.ts +1 -1
  543. package/dist/tree/useTreeSelection.js +1 -1
  544. package/dist/tree/useTreeSelection.js.map +1 -1
  545. package/dist/typography/HighlightText.d.ts +1 -1
  546. package/dist/typography/HighlightText.js +1 -1
  547. package/dist/typography/HighlightText.js.map +1 -1
  548. package/dist/typography/Mark.d.ts +1 -1
  549. package/dist/typography/Mark.js +1 -1
  550. package/dist/typography/Mark.js.map +1 -1
  551. package/dist/typography/SrOnly.d.ts +1 -1
  552. package/dist/typography/SrOnly.js +1 -1
  553. package/dist/typography/SrOnly.js.map +1 -1
  554. package/dist/typography/TextContainer.d.ts +1 -1
  555. package/dist/typography/TextContainer.js +1 -1
  556. package/dist/typography/TextContainer.js.map +1 -1
  557. package/dist/typography/Typography.d.ts +1 -1
  558. package/dist/typography/Typography.js +1 -1
  559. package/dist/typography/Typography.js.map +1 -1
  560. package/dist/typography/WritingDirectionProvider.d.ts +1 -1
  561. package/dist/typography/WritingDirectionProvider.js +1 -1
  562. package/dist/typography/WritingDirectionProvider.js.map +1 -1
  563. package/dist/useEnsuredState.d.ts +1 -0
  564. package/dist/useEnsuredState.js +5 -3
  565. package/dist/useEnsuredState.js.map +1 -1
  566. package/dist/utils/RenderRecursively.d.ts +1 -1
  567. package/dist/utils/RenderRecursively.js +1 -1
  568. package/dist/utils/RenderRecursively.js.map +1 -1
  569. package/dist/window-splitter/WindowSplitter.d.ts +1 -1
  570. package/dist/window-splitter/WindowSplitter.js +1 -1
  571. package/dist/window-splitter/WindowSplitter.js.map +1 -1
  572. package/package.json +1 -1
  573. package/src/CoreProviders.tsx +1 -1
  574. package/src/SsrProvider.tsx +1 -1
  575. package/src/autocomplete/Autocomplete.tsx +3 -3
  576. package/src/autocomplete/AutocompleteChip.tsx +1 -1
  577. package/src/autocomplete/AutocompleteCircularProgress.tsx +1 -1
  578. package/src/autocomplete/AutocompleteClearButton.tsx +1 -1
  579. package/src/autocomplete/AutocompleteDropdownButton.tsx +1 -1
  580. package/src/autocomplete/useAutocomplete.ts +5 -4
  581. package/src/avatar/Avatar.tsx +1 -1
  582. package/src/badge/Badge.tsx +1 -1
  583. package/src/box/Box.tsx +1 -1
  584. package/src/button/AsyncButton.tsx +1 -1
  585. package/src/button/Button.tsx +1 -1
  586. package/src/button/ButtonUnstyled.tsx +1 -1
  587. package/src/button/TooltippedButton.tsx +1 -1
  588. package/src/card/Card.tsx +1 -1
  589. package/src/card/CardContent.tsx +1 -1
  590. package/src/card/CardFooter.tsx +1 -1
  591. package/src/card/CardHeader.tsx +1 -1
  592. package/src/card/CardSubtitle.tsx +1 -1
  593. package/src/card/CardTitle.tsx +1 -1
  594. package/src/card/ClickableCard.tsx +1 -1
  595. package/src/chip/Chip.tsx +1 -1
  596. package/src/dialog/Dialog.tsx +1 -1
  597. package/src/dialog/DialogContent.tsx +1 -1
  598. package/src/dialog/DialogFooter.tsx +1 -1
  599. package/src/dialog/DialogHeader.tsx +1 -1
  600. package/src/dialog/DialogTitle.tsx +1 -1
  601. package/src/dialog/FixedDialog.tsx +1 -1
  602. package/src/divider/Divider.tsx +1 -1
  603. package/src/draggable/useDraggable.ts +1 -1
  604. package/src/expansion-panel/ExpansionList.tsx +1 -1
  605. package/src/expansion-panel/ExpansionPanel.tsx +1 -1
  606. package/src/expansion-panel/ExpansionPanelHeader.tsx +1 -1
  607. package/src/expansion-panel/useExpansionList.ts +1 -1
  608. package/src/expansion-panel/useExpansionPanels.ts +1 -1
  609. package/src/files/FileInput.tsx +1 -1
  610. package/src/files/useFileUpload.ts +2 -2
  611. package/src/form/Checkbox.tsx +1 -1
  612. package/src/form/Fieldset.tsx +1 -1
  613. package/src/form/Form.tsx +1 -1
  614. package/src/form/FormMessage.tsx +1 -1
  615. package/src/form/FormMessageContainer.tsx +1 -1
  616. package/src/form/FormMessageCounter.tsx +2 -2
  617. package/src/form/InputToggle.tsx +2 -2
  618. package/src/form/Label.tsx +3 -3
  619. package/src/form/Legend.tsx +1 -1
  620. package/src/form/NativeSelect.tsx +1 -1
  621. package/src/form/OptGroup.tsx +1 -1
  622. package/src/form/Option.tsx +1 -1
  623. package/src/form/Password.tsx +1 -1
  624. package/src/form/Radio.tsx +1 -1
  625. package/src/form/Select.tsx +1 -1
  626. package/src/form/Slider.tsx +1 -1
  627. package/src/form/Switch.tsx +1 -1
  628. package/src/form/TextArea.tsx +1 -1
  629. package/src/form/TextField.tsx +1 -1
  630. package/src/form/useCheckboxGroup.ts +10 -10
  631. package/src/form/useCombobox.ts +1 -0
  632. package/src/form/useNumberField.ts +4 -4
  633. package/src/form/useRadioGroup.ts +6 -6
  634. package/src/form/useRangeSlider.ts +1 -1
  635. package/src/form/useSlider.ts +1 -1
  636. package/src/form/useTextField.ts +6 -6
  637. package/src/icon/FontIcon.tsx +1 -1
  638. package/src/icon/IconRotator.tsx +1 -1
  639. package/src/icon/MaterialIcon.tsx +2 -2
  640. package/src/icon/MaterialSymbol.tsx +2 -2
  641. package/src/icon/SVGIcon.tsx +1 -1
  642. package/src/icon/TextIconSpacing.tsx +1 -1
  643. package/src/layout/LayoutAppBar.tsx +1 -1
  644. package/src/layout/LayoutNav.tsx +1 -1
  645. package/src/layout/LayoutWindowSplitter.tsx +1 -1
  646. package/src/layout/Main.tsx +1 -1
  647. package/src/layout/useExpandableLayout.ts +1 -1
  648. package/src/layout/useHorizontalLayoutTransition.ts +1 -1
  649. package/src/layout/useLayoutAppBarHeight.ts +1 -1
  650. package/src/layout/useLayoutTree.ts +3 -3
  651. package/src/layout/useLayoutWindowSplitter.ts +1 -1
  652. package/src/layout/useResizableLayout.ts +1 -1
  653. package/src/layout/useTemporaryLayout.ts +1 -1
  654. package/src/link/Link.tsx +1 -1
  655. package/src/link/SkipToMainContent.tsx +1 -1
  656. package/src/list/List.tsx +1 -1
  657. package/src/list/ListItem.tsx +1 -1
  658. package/src/list/ListItemChildren.tsx +1 -1
  659. package/src/list/ListItemLink.tsx +1 -1
  660. package/src/list/ListSubheader.tsx +1 -1
  661. package/src/media-queries/AppSizeProvider.tsx +2 -2
  662. package/src/media-queries/useMediaQuery.ts +2 -2
  663. package/src/menu/DropdownMenu.tsx +2 -1
  664. package/src/menu/Menu.tsx +1 -1
  665. package/src/menu/MenuBar.tsx +1 -1
  666. package/src/menu/MenuButton.tsx +1 -1
  667. package/src/menu/MenuItem.tsx +1 -1
  668. package/src/menu/MenuItemCheckbox.tsx +1 -1
  669. package/src/menu/MenuItemFileInput.tsx +1 -1
  670. package/src/menu/MenuItemGroup.tsx +1 -1
  671. package/src/menu/MenuItemInputToggle.tsx +1 -1
  672. package/src/menu/MenuItemRadio.tsx +1 -1
  673. package/src/menu/MenuItemSeparator.tsx +1 -1
  674. package/src/menu/MenuItemSwitch.tsx +1 -1
  675. package/src/menu/MenuItemTextField.tsx +1 -1
  676. package/src/menu/useContextMenu.ts +1 -1
  677. package/src/navigation/CollapsibleNavGroup.tsx +1 -1
  678. package/src/navigation/DefaultNavigationRenderer.tsx +1 -1
  679. package/src/navigation/NavGroup.tsx +1 -1
  680. package/src/navigation/NavItem.tsx +1 -1
  681. package/src/navigation/NavItemButton.tsx +1 -1
  682. package/src/navigation/NavItemLink.tsx +1 -1
  683. package/src/navigation/NavSubheader.tsx +1 -1
  684. package/src/navigation/Navigation.tsx +1 -1
  685. package/src/navigation/useActiveHeadingId.ts +1 -1
  686. package/src/navigation/useNavigationExpansion.ts +2 -2
  687. package/src/navigation/useTableOfContentsHeadings.ts +1 -1
  688. package/src/overlay/Overlay.tsx +1 -1
  689. package/src/portal/Portal.tsx +1 -1
  690. package/src/portal/PortalContainerProvider.tsx +1 -1
  691. package/src/positioning/useFixedPositioning.ts +1 -1
  692. package/src/progress/CircularProgress.tsx +1 -1
  693. package/src/progress/LinearProgress.tsx +1 -1
  694. package/src/responsive-item/ResponsiveItem.tsx +1 -1
  695. package/src/responsive-item/ResponsiveItemOverlay.tsx +1 -1
  696. package/src/scroll/useScrollLock.ts +1 -1
  697. package/src/segmented-button/SegmentedButton.tsx +1 -1
  698. package/src/segmented-button/SegmentedButtonContainer.tsx +1 -1
  699. package/src/sheet/Sheet.tsx +1 -1
  700. package/src/snackbar/DefaultToastRenderer.tsx +1 -1
  701. package/src/snackbar/Snackbar.tsx +1 -1
  702. package/src/snackbar/Toast.tsx +1 -1
  703. package/src/snackbar/ToastActionButton.tsx +1 -1
  704. package/src/snackbar/ToastCloseButton.tsx +1 -1
  705. package/src/snackbar/ToastContent.tsx +1 -1
  706. package/src/snackbar/ToastManager.ts +1 -1
  707. package/src/snackbar/ToastManagerProvider.tsx +1 -1
  708. package/src/snackbar/useCurrentToastActions.ts +1 -1
  709. package/src/storage/useStorage.ts +1 -1
  710. package/src/suspense/CircularProgressSuspense.tsx +1 -1
  711. package/src/suspense/NullSuspense.tsx +1 -1
  712. package/src/table/StickyTableSection.tsx +2 -2
  713. package/src/table/Table.tsx +1 -1
  714. package/src/table/TableBody.tsx +1 -1
  715. package/src/table/TableCell.tsx +1 -1
  716. package/src/table/TableCheckbox.tsx +1 -1
  717. package/src/table/TableContainer.tsx +1 -1
  718. package/src/table/TableFooter.tsx +1 -1
  719. package/src/table/TableHeader.tsx +1 -1
  720. package/src/table/TableRadio.tsx +1 -1
  721. package/src/table/TableRow.tsx +1 -1
  722. package/src/tabs/SimpleTabPanel.tsx +2 -2
  723. package/src/tabs/SimpleTabPanels.tsx +2 -2
  724. package/src/tabs/Tab.tsx +1 -1
  725. package/src/tabs/TabList.tsx +1 -1
  726. package/src/tabs/useTabs.ts +6 -5
  727. package/src/theme/LocalStorageColorSchemeProvider.tsx +2 -2
  728. package/src/theme/ThemeProvider.tsx +1 -1
  729. package/src/theme/useColorSchemeProvider.ts +1 -0
  730. package/src/tooltip/Tooltip.tsx +1 -1
  731. package/src/tooltip/TooltipHoverModeProvider.tsx +1 -1
  732. package/src/tooltip/useTooltip.ts +1 -1
  733. package/src/transition/CSSTransition.tsx +1 -1
  734. package/src/transition/Collapse.tsx +1 -1
  735. package/src/transition/CrossFade.tsx +1 -1
  736. package/src/transition/ScaleTransition.tsx +1 -1
  737. package/src/transition/SkeletonPlaceholder.tsx +1 -1
  738. package/src/transition/Slide.tsx +1 -1
  739. package/src/transition/SlideContainer.tsx +1 -1
  740. package/src/transition/useCSSTransition.ts +2 -2
  741. package/src/transition/useCarousel.ts +1 -1
  742. package/src/transition/useCollapseTransition.ts +2 -2
  743. package/src/transition/useCrossFadeTransition.ts +2 -2
  744. package/src/transition/useScaleTransition.ts +2 -2
  745. package/src/transition/useSkeletonPlaceholder.ts +2 -2
  746. package/src/transition/useSlideTransition.ts +1 -1
  747. package/src/transition/useTransition.ts +1 -1
  748. package/src/tree/DefaultTreeItemRenderer.tsx +1 -1
  749. package/src/tree/Tree.tsx +1 -1
  750. package/src/tree/TreeItem.tsx +1 -1
  751. package/src/tree/useTree.ts +1 -1
  752. package/src/tree/useTreeExpansion.ts +1 -1
  753. package/src/tree/useTreeItems.ts +1 -1
  754. package/src/tree/useTreeSelection.ts +1 -1
  755. package/src/typography/HighlightText.tsx +1 -1
  756. package/src/typography/Mark.tsx +1 -1
  757. package/src/typography/SrOnly.tsx +1 -1
  758. package/src/typography/TextContainer.tsx +1 -1
  759. package/src/typography/Typography.tsx +1 -1
  760. package/src/typography/WritingDirectionProvider.tsx +1 -1
  761. package/src/useEnsuredState.ts +6 -3
  762. package/src/utils/RenderRecursively.tsx +1 -1
  763. package/src/window-splitter/WindowSplitter.tsx +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/tooltip/useTooltip.ts"],"sourcesContent":["\"use client\";\n\nimport { cnb } from \"cnbuilder\";\nimport {\n type CSSProperties,\n type FocusEvent,\n type MouseEvent,\n type MutableRefObject,\n type Ref,\n type RefObject,\n type TouchEvent,\n useCallback,\n useEffect,\n useId,\n useRef,\n} from \"react\";\n\nimport {\n type ControlledHoverModeImplementation,\n useHoverMode,\n} from \"../hoverMode/useHoverMode.js\";\nimport {\n type UserInteractionMode,\n useUserInteractionMode,\n} from \"../interaction/UserInteractionModeProvider.js\";\nimport { type SimplePosition } from \"../positioning/types.js\";\nimport {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n type FixedPositioningOptions,\n type FixedPositioningTransitionCallbacks,\n useFixedPositioning,\n} from \"../positioning/useFixedPositioning.js\";\nimport { type UseStateSetter } from \"../types.js\";\nimport { usePageInactive } from \"../usePageInactive.js\";\nimport { parseCssLengthUnit } from \"../utils/parseCssLengthUnit.js\";\nimport { useTooltipHoverMode } from \"./TooltipHoverModeProvider.js\";\nimport {\n DEFAULT_TOOLTIP_DENSE_SPACING,\n DEFAULT_TOOLTIP_MARGIN,\n DEFAULT_TOOLTIP_POSITION,\n DEFAULT_TOOLTIP_SPACING,\n DEFAULT_TOOLTIP_THRESHOLD,\n TOOLTIP_SPACING_VAR,\n} from \"./constants.js\";\nimport {\n type TooltipPositionHookOptions,\n useTooltipPosition,\n} from \"./useTooltipPosition.js\";\nimport { getAnchor } from \"./utils.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/** @since 2.8.0 */\nexport interface TooltipPositioningOptions {\n style?: CSSProperties;\n\n /**\n * @see {@link FixedPositioningOptions.vwMargin}\n * @defaultValue `16`\n */\n vwMargin?: number;\n\n /**\n * @see {@link FixedPositioningOptions.vhMargin}\n * @defaultValue `16`\n */\n vhMargin?: number;\n\n /**\n * Set this to `true` to reduce the font size and padding on the tooltip and\n * the amount of spacing between the tooltipped element and the tooltip.\n *\n * @defaultValue `false`\n */\n dense?: boolean;\n\n /**\n * The amount of spacing to use between the tooltipped element and the tooltip\n * when {@link disableAutoSpacing} is `false`.\n *\n * @defaultValue `\"1.5rem`\n */\n spacing?: number | string;\n\n /**\n * The amount of spacing to use between the tooltipped element and the tooltip\n * when {@link disableAutoSpacing} is `false` and {@link dense} is `true`.\n *\n * @defaultValue `\"0.875rem`\n */\n denseSpacing?: number | string;\n\n /**\n * Set this to `true` to prevent the {@link defaultPosition} to swap to the\n * other side of the tooltipped element when it is too close to the viewport\n * edge. This will always be `true` if a {@link position} is provided.\n *\n * @defaultValue `false`\n */\n disableSwapping?: boolean;\n\n /**\n * @defaultValue `false`\n */\n disableAutoSpacing?: boolean;\n}\n\n/**\n * @since 2.8.0\n * @since 6.0.0 Removed the `TooltipTouchEventHandlers` and\n * `TooltipKeyboardEventHandlers` types, removed the need for the `onKeyDown`\n * event.\n */\nexport interface TooltippedElementEventHandlers<\n E extends HTMLElement = HTMLButtonElement,\n> {\n onBlur?: (event: FocusEvent<E>) => void;\n onFocus?: (event: FocusEvent<E>) => void;\n onMouseEnter?: (event: MouseEvent<E>) => void;\n onMouseLeave?: (event: MouseEvent<E>) => void;\n onTouchStart?: (event: TouchEvent<E>) => void;\n onTouchEnd?: (event: TouchEvent<E>) => void;\n onContextMenu?: (event: MouseEvent<E>) => void;\n}\n\n/**\n * @since 2.8.0\n * @since 6.0.0 Renamed from `TooltipHookProvidedElementProps`\n */\nexport interface ProvidedTooltippedElementProps<E extends HTMLElement>\n extends Required<TooltippedElementEventHandlers<E>> {\n \"aria-describedby\": string | undefined;\n id: string;\n}\n\n/**\n * @since 2.8.0\n * @since 6.0.0 A major API change for the hover mode behavior and no longer\n * requires a `baseId`/`id` for the tooltip. Also renamed from\n * `TooltipHookOptions` to `TooltipOptions` to match other hook naming\n * conventions.\n */\nexport interface TooltipOptions<\n TooltippedElement extends HTMLElement = HTMLButtonElement,\n> extends FixedPositioningTransitionCallbacks,\n TooltippedElementEventHandlers<TooltippedElement>,\n TooltipPositioningOptions,\n TooltipPositionHookOptions {\n /**\n * @defaultValue `\"tooltip-\" + useId()`\n */\n id?: string;\n\n /**\n * An optional override for the `aria-describedby`\n */\n describedBy?: string;\n\n /**\n * Any styles to be merged with the fixed positioning styles for the tooltip.\n */\n style?: CSSProperties;\n\n /**\n * Boolean if the event handlers should no longer attempt to show a tooltip. This\n * should be set to `true` when your component might not have a tooltip associated\n * with it.\n *\n * @example Real World Example\n * ```tsx\n * // This is _almost_ the source code for the `TooltippedButton` provided by react-md\n * import { Button } from \"@react-md/core/button/Button\";\n * import { Tooltip } from \"@react-md/core/tooltip/Tooltip\";\n * import { useTooltip } from \"@react-md/core/tooltip/useTooltip\";\n * import { type ReactElement, type ReactNode } from \"react\";\n *\n * export interface TooltippedButtonProps extends ButtonProps {\n * tooltip?: ReactNode;\n * }\n *\n * export function TooltippedButton({\n * id,\n * tooltip,\n * children,\n * onBlur,\n * onFocus,\n * onMouseEnter,\n * onMouseLeave,\n * onTouchStart,\n * onTouchEnd,\n * onContextMenu,\n * ...props\n * }: TooltippedButtonProps): ReactElement {\n * const { elementProps, tooltipProps } = useTooltip({\n * id,\n * disabled: !tooltip,\n * onBlur,\n * onFocus,\n * onMouseEnter,\n * onMouseLeave,\n * onTouchStart,\n * onTouchEnd,\n * onContextMenu,\n * });\n *\n * return (\n * <>\n * <Button {...props} {...elementProps}>\n * {children}\n * </Button>\n * <Tooltip {...tooltipProps}>{tooltip}</Tooltip>\n * </>\n * );\n * }\n * ```\n *\n * @defaultValue `false`\n * @since 5.1.0\n */\n disabled?: boolean;\n\n /**\n * The amount of time (in ms) to hover an element before the tooltip becomes\n * visible.\n *\n * The default value is really the current hover timeout from the\n * `TooltipHoverModeProvider`.\n *\n * @defaultValue `1000`\n */\n hoverTimeout?: number;\n\n /**\n * The amount of time to wait before triggering the exit animation for the\n * tooltip.\n *\n * The default value is really the current leaveTimeout timeout from the\n * `TooltipHoverModeProvider`.\n *\n * @defaultValue `0`\n */\n leaveTimeout?: number;\n\n /**\n * Set this to `true` to only allow the tooltip to become visible when the\n * `event .currentTarget` or `overflowRef` has text overflow.\n *\n * @defaultValue `false`\n * @since 6.0.0\n */\n overflowOnly?: boolean;\n\n /**\n * @see {@link FixedPositioningOptions.disabled}\n * @defaultValue `false`\n */\n disableFixedPositioning?: boolean;\n}\n\n/**\n * @since 2.8.0\n * @since 6.0.0 This was renamed from `TooltipHookProvidedTooltipProps`\n */\nexport interface ProvidedTooltipProps<E extends HTMLElement = HTMLSpanElement>\n extends Required<FixedPositioningTransitionCallbacks> {\n id: string;\n ref: Ref<E>;\n dense: boolean;\n style: CSSProperties | undefined;\n visible: boolean;\n position: SimplePosition;\n}\n\n/**\n * @since 2.8.0\n * @since 6.0.0 No longer returns any properties from the hover mode provider\n * because of the major API change to hover mode.. Also renamed from\n * `TooltipHookReturnValue` to `TooltipImplementation` to match other hook\n * naming conventions.\n */\nexport interface TooltipImplementation<\n TooltippedElement extends HTMLElement = HTMLButtonElement,\n TooltipElement extends HTMLElement = HTMLSpanElement,\n> extends ControlledHoverModeImplementation {\n visible: boolean;\n setVisible: UseStateSetter<boolean>;\n animatedOnce: boolean;\n initiatedBy: MutableRefObject<UserInteractionMode | null>;\n elementProps: ProvidedTooltippedElementProps<TooltippedElement>;\n tooltipProps: ProvidedTooltipProps<TooltipElement>;\n\n /**\n * This is a wrapper around the {@link setVisible} behavior that will also\n * clear any pending timeouts.\n */\n hideTooltip: () => void;\n\n /**\n * @since 6.0.0\n */\n overflowRef: RefObject<HTMLElement>;\n}\n\n/**\n * @example Simple Usage\n * ```tsx\n * import { Button } from \"@react-md/core/button/Button\";\n * import { Tooltip } from \"@react-md/core/tooltip/Tooltip\";\n * import { useTooltip } from \"@react-md/core/tooltip/useTooltip\";\n *\n * function Example() {\n * const { elementProps, tooltipProps } = useTooltip();\n *\n * return (\n * <>\n * <Button {...elementProps}>Button</Button>\n * <Tooltip {...tooltipProps}>\n * Tooltip Content\n * </Tooltip>\n * </>\n * );\n * }\n * ```\n *\n * @example Overflow-only Tooltips\n * ```tsx\n * import { cssUtils } from \"@react-md/core/cssUtils\";\n * import { Link, type LinkProps } from \"@react-md/core/link/Link\";\n * import { Tooltip } from \"@react-md/core/tooltip/Tooltip\";\n * import { useTooltip } from \"@react-md/core/tooltip/useTooltip\";\n * import { type ReactElement } from \"react\";\n *\n * function NavigationLink(props: LinkProps): ReactElement {\n * const { children, ...remaining } = props;\n *\n * // using the `overflowRef` is optional and will default to the\n * // `event.currentTarget` when `null`\n * const { overflowRef, elementProps, tooltipProps } = useOverflowTooltip({\n * // just to pass any event handlers\n * ...remaining,\n * overflowOnly: true,\n * });\n *\n * return (\n * <Link {...remaining} {...elementProps} style={{ width: \"100%\" }}>\n * <span ref={overflowRef} className={cssUtils({ textOverflow: \"ellipsis\" })}>\n * {children}\n * </span>\n * <Tooltip {...tooltipProps}>\n * {children}\n * </Tooltip>\n * </Link>\n * );\n * }\n *\n * function Example(): ReactElement {\n * return (\n * <div style={{ width: \"10rem\", overflow: \"auto\" }}>\n * <NavigationLink href=\"/\">Home</NavigationLink>\n * <NavigationLink href=\"/some-path\">\n * Super long text that will be truncated with ellipsis and\n * have a tooltip appear\n * </NavigationLink>\n * </div>\n * );\n * }\n * ```\n *\n * ## Inspecting Tooltip Styles\n *\n * Since tooltips will disappear on blur, mouseleave, etc, it is a bit hard to\n * inspect the tooltip styles. In dev mode, you can manually set the visibility\n * to `true` through the dev tools.\n * - find your tooltip implementation\n * - expand the Tooltip hook\n * - expand the HoverMode hook\n * - set the first boolean state to `true`\n *\n * The tooltip will now remain visible allowing you to find it within the\n * \"Inspector\" tab in the dev tools.\n *\n * @see {@link https://next.react-md.dev/components/tooltip | Tooltip Demos}\n * @since 2.8.0\n * @since 6.0.0 Uses a separate `TooltipHoverModeProvider`.\n *\n * TODO: I need to fix the tooltip for click events and history changes since\n * the mouseleave event will not be correctly bubbled if hovering a child\n * element when the click or history update happens. this causes the tooltip to\n * stay visible\n */\nexport function useTooltip<\n TooltippedElement extends HTMLElement = HTMLButtonElement,\n TooltipElement extends HTMLElement = HTMLSpanElement,\n>(\n options: TooltipOptions<TooltippedElement> = {}\n): TooltipImplementation<TooltippedElement, TooltipElement> {\n const {\n id: propId,\n style: propStyle,\n disabled = false,\n describedBy,\n dense = false,\n hoverTimeout,\n leaveTimeout,\n vwMargin = DEFAULT_TOOLTIP_MARGIN,\n vhMargin = DEFAULT_TOOLTIP_MARGIN,\n spacing = DEFAULT_TOOLTIP_SPACING,\n denseSpacing = DEFAULT_TOOLTIP_DENSE_SPACING,\n disableSwapping,\n disableAutoSpacing,\n position: determinedPosition,\n defaultPosition = DEFAULT_TOOLTIP_POSITION,\n threshold = DEFAULT_TOOLTIP_THRESHOLD,\n onBlur = noop,\n onFocus = noop,\n onMouseEnter = noop,\n onMouseLeave = noop,\n onTouchStart = noop,\n onTouchEnd = noop,\n onContextMenu = noop,\n onEnter = noop,\n onEntering,\n onEntered = noop,\n onExited,\n overflowOnly,\n disableFixedPositioning,\n } = options;\n\n const fallbackId = useId();\n const id = propId || fallbackId;\n const tooltipId = `${id}-tooltip`;\n const {\n animatedOnceRef,\n hoverTimeoutRef,\n leaveTimeoutRef,\n enableHoverMode,\n disableHoverMode,\n startDisableTimer,\n clearDisableTimer,\n } = useTooltipHoverMode();\n const {\n visible,\n setVisible,\n startShowFlow,\n startHideFlow,\n clearVisibilityTimeout,\n } = useHoverMode({\n hoverTimeout,\n hoverTimeoutRef,\n leaveTimeout,\n leaveTimeoutRef,\n enableHoverMode,\n disableHoverMode,\n startDisableTimer,\n clearDisableTimer,\n });\n const [position, updatePosition] = useTooltipPosition({\n position: determinedPosition,\n defaultPosition,\n threshold,\n });\n\n const mode = useUserInteractionMode();\n const elementRef = useRef<HTMLElement | null>(null);\n const tooltipRef = useRef<TooltipElement>(null);\n const overflowRef = useRef<HTMLElement>(null);\n const initiatedBy = useRef<UserInteractionMode | null>(null);\n const { ref, style, callbacks } = useFixedPositioning({\n nodeRef: tooltipRef,\n style: propStyle,\n fixedTo: elementRef,\n anchor: getAnchor(position),\n disableSwapping: disableSwapping ?? !!determinedPosition,\n disabled: disableFixedPositioning,\n getFixedPositionOptions() {\n let tooltipSpacing = dense ? denseSpacing : spacing;\n const tooltip = tooltipRef.current;\n if (!disableAutoSpacing && tooltip) {\n tooltipSpacing =\n window\n .getComputedStyle(tooltip)\n .getPropertyValue(TOOLTIP_SPACING_VAR) || spacing;\n }\n\n const currentSpacing = parseCssLengthUnit({\n value: tooltipSpacing,\n });\n const horizontal = position === \"left\" || position === \"right\";\n\n return {\n vwMargin,\n vhMargin,\n xMargin: horizontal ? currentSpacing : undefined,\n yMargin: horizontal ? undefined : currentSpacing,\n };\n },\n onEnter(appearing) {\n onEnter(appearing);\n\n // This allows you to inspect the tooltip styles through the element\n // inspector without first hovering or focusing the tooltipped element\n // beforehand by setting the `HoverMode` hook to `true`\n if (process.env.NODE_ENV !== \"production\" && !elementRef.current) {\n elementRef.current = document.getElementById(id);\n }\n },\n onEntering,\n onEntered(appearing) {\n onEntered(appearing);\n\n animatedOnceRef.current = true;\n },\n onExited,\n });\n\n const hideTooltip = useCallback(() => {\n initiatedBy.current = null;\n disableHoverMode();\n clearVisibilityTimeout();\n setVisible(false);\n }, [clearVisibilityTimeout, disableHoverMode, setVisible]);\n\n useEffect(() => {\n if (!visible) {\n return;\n }\n\n const handleKeyDown = (event: KeyboardEvent): void => {\n if (event.key === \"Escape\") {\n hideTooltip();\n }\n };\n\n window.addEventListener(\"keydown\", handleKeyDown);\n window.addEventListener(\"scroll\", hideTooltip, true);\n window.addEventListener(\"touchend\", hideTooltip, true);\n return () => {\n window.removeEventListener(\"keydown\", handleKeyDown);\n window.removeEventListener(\"scroll\", hideTooltip, true);\n window.removeEventListener(\"touchend\", hideTooltip, true);\n };\n }, [hideTooltip, visible]);\n\n const refocusFrame = useRef(0);\n const pageInactive = useRef(false);\n usePageInactive({\n disabled,\n onDisabledCleanup: hideTooltip,\n onChange(active) {\n if (active) {\n refocusFrame.current = window.requestAnimationFrame(() => {\n pageInactive.current = false;\n });\n return;\n }\n\n pageInactive.current = true;\n hideTooltip();\n },\n });\n\n const isNotOverflown = (currentTarget: HTMLElement): boolean => {\n if (!overflowOnly) {\n return false;\n }\n\n const element = overflowRef.current || currentTarget;\n return !element || element.offsetWidth >= element.scrollWidth;\n };\n\n return {\n visible,\n setVisible,\n hideTooltip,\n animatedOnce: animatedOnceRef.current,\n initiatedBy,\n overflowRef,\n startShowFlow,\n startHideFlow,\n clearVisibilityTimeout,\n tooltipProps: {\n id: tooltipId,\n ref,\n dense,\n style,\n visible,\n position,\n ...callbacks,\n },\n elementProps: {\n \"aria-describedby\": cnb(visible && tooltipId, describedBy) || undefined,\n id,\n onMouseEnter(event) {\n onMouseEnter(event);\n if (\n disabled ||\n mode === \"touch\" ||\n initiatedBy.current !== null ||\n isNotOverflown(event.currentTarget)\n ) {\n return;\n }\n\n initiatedBy.current = \"mouse\";\n elementRef.current = event.currentTarget;\n updatePosition(event.currentTarget);\n startShowFlow(id);\n },\n onMouseLeave(event) {\n onMouseLeave(event);\n if (disabled || initiatedBy.current !== \"mouse\") {\n return;\n }\n\n startHideFlow();\n initiatedBy.current = null;\n },\n onBlur(event) {\n onBlur(event);\n if (disabled) {\n return;\n }\n\n initiatedBy.current = null;\n startHideFlow();\n },\n onFocus(event) {\n onFocus(event);\n // skip the focus events when the browser is re-focused if the user\n // pressed alt-tab, minimized the browser, etc\n if (\n disabled ||\n mode !== \"keyboard\" ||\n initiatedBy.current !== null ||\n pageInactive.current ||\n isNotOverflown(event.currentTarget)\n ) {\n pageInactive.current = false;\n return;\n }\n\n initiatedBy.current = \"keyboard\";\n elementRef.current = event.currentTarget;\n updatePosition(event.currentTarget);\n startShowFlow(id);\n },\n onTouchStart(event) {\n onTouchStart(event);\n if (\n disabled ||\n initiatedBy.current !== null ||\n isNotOverflown(event.currentTarget)\n ) {\n return;\n }\n\n initiatedBy.current = \"touch\";\n elementRef.current = event.currentTarget;\n updatePosition(event.currentTarget);\n startShowFlow(id);\n },\n onTouchEnd(event) {\n onTouchEnd(event);\n if (disabled) {\n return;\n }\n\n initiatedBy.current = null;\n startHideFlow();\n },\n onContextMenu(event) {\n onContextMenu(event);\n if (\n disabled ||\n initiatedBy.current !== \"touch\" ||\n isNotOverflown(event.currentTarget)\n ) {\n return;\n }\n\n event.preventDefault();\n const selection = window.getSelection();\n const node = selection?.anchorNode?.parentElement;\n if (node && event.currentTarget.contains(node)) {\n selection.empty();\n }\n },\n },\n };\n}\n"],"names":["cnb","useCallback","useEffect","useId","useRef","useHoverMode","useUserInteractionMode","useFixedPositioning","usePageInactive","parseCssLengthUnit","useTooltipHoverMode","DEFAULT_TOOLTIP_DENSE_SPACING","DEFAULT_TOOLTIP_MARGIN","DEFAULT_TOOLTIP_POSITION","DEFAULT_TOOLTIP_SPACING","DEFAULT_TOOLTIP_THRESHOLD","TOOLTIP_SPACING_VAR","useTooltipPosition","getAnchor","noop","useTooltip","options","id","propId","style","propStyle","disabled","describedBy","dense","hoverTimeout","leaveTimeout","vwMargin","vhMargin","spacing","denseSpacing","disableSwapping","disableAutoSpacing","position","determinedPosition","defaultPosition","threshold","onBlur","onFocus","onMouseEnter","onMouseLeave","onTouchStart","onTouchEnd","onContextMenu","onEnter","onEntering","onEntered","onExited","overflowOnly","disableFixedPositioning","fallbackId","tooltipId","animatedOnceRef","hoverTimeoutRef","leaveTimeoutRef","enableHoverMode","disableHoverMode","startDisableTimer","clearDisableTimer","visible","setVisible","startShowFlow","startHideFlow","clearVisibilityTimeout","updatePosition","mode","elementRef","tooltipRef","overflowRef","initiatedBy","ref","callbacks","nodeRef","fixedTo","anchor","getFixedPositionOptions","tooltipSpacing","tooltip","current","window","getComputedStyle","getPropertyValue","currentSpacing","value","horizontal","xMargin","undefined","yMargin","appearing","process","env","NODE_ENV","document","getElementById","hideTooltip","handleKeyDown","event","key","addEventListener","removeEventListener","refocusFrame","pageInactive","onDisabledCleanup","onChange","active","requestAnimationFrame","isNotOverflown","currentTarget","element","offsetWidth","scrollWidth","animatedOnce","tooltipProps","elementProps","preventDefault","selection","getSelection","node","anchorNode","parentElement","contains","empty"],"mappings":"AAAA;AAEA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAQEC,WAAW,EACXC,SAAS,EACTC,KAAK,EACLC,MAAM,QACD,QAAQ;AAEf,SAEEC,YAAY,QACP,+BAA+B;AACtC,SAEEC,sBAAsB,QACjB,gDAAgD;AAEvD,SAIEC,mBAAmB,QACd,wCAAwC;AAE/C,SAASC,eAAe,QAAQ,wBAAwB;AACxD,SAASC,kBAAkB,QAAQ,iCAAiC;AACpE,SAASC,mBAAmB,QAAQ,gCAAgC;AACpE,SACEC,6BAA6B,EAC7BC,sBAAsB,EACtBC,wBAAwB,EACxBC,uBAAuB,EACvBC,yBAAyB,EACzBC,mBAAmB,QACd,iBAAiB;AACxB,SAEEC,kBAAkB,QACb,0BAA0B;AACjC,SAASC,SAAS,QAAQ,aAAa;AAEvC,MAAMC,OAAO;AACX,aAAa;AACf;AA6PA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsFC,GACD,OAAO,SAASC,WAIdC,UAA6C,CAAC,CAAC;IAE/C,MAAM,EACJC,IAAIC,MAAM,EACVC,OAAOC,SAAS,EAChBC,WAAW,KAAK,EAChBC,WAAW,EACXC,QAAQ,KAAK,EACbC,YAAY,EACZC,YAAY,EACZC,WAAWnB,sBAAsB,EACjCoB,WAAWpB,sBAAsB,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gBAEA+C,YAAYS,OAAO,GAAG;gBACtBhB;YACF;YACAxB,SAAQ0D,KAAK;gBACX1D,QAAQ0D;gBACR,mEAAmE;gBACnE,8CAA8C;gBAC9C,IACE1E,YACA2C,SAAS,cACTI,YAAYS,OAAO,KAAK,QACxBuB,aAAavB,OAAO,IACpB4B,eAAeV,MAAMW,aAAa,GAClC;oBACAN,aAAavB,OAAO,GAAG;oBACvB;gBACF;gBAEAT,YAAYS,OAAO,GAAG;gBACtBZ,WAAWY,OAAO,GAAGkB,MAAMW,aAAa;gBACxC3C,eAAegC,MAAMW,aAAa;gBAClC9C,cAAc3C;YAChB;YACAuB,cAAauD,KAAK;gBAChBvD,aAAauD;gBACb,IACE1E,YACA+C,YAAYS,OAAO,KAAK,QACxB4B,eAAeV,MAAMW,aAAa,GAClC;oBACA;gBACF;gBAEAtC,YAAYS,OAAO,GAAG;gBACtBZ,WAAWY,OAAO,GAAGkB,MAAMW,aAAa;gBACxC3C,eAAegC,MAAMW,aAAa;gBAClC9C,cAAc3C;YAChB;YACAwB,YAAWsD,KAAK;gBACdtD,WAAWsD;gBACX,IAAI1E,UAAU;oBACZ;gBACF;gBAEA+C,YAAYS,OAAO,GAAG;gBACtBhB;YACF;YACAnB,eAAcqD,KAAK;gBACjBrD,cAAcqD;gBACd,IACE1E,YACA+C,YAAYS,OAAO,KAAK,WACxB4B,eAAeV,MAAMW,aAAa,GAClC;oBACA;gBACF;gBAEAX,MAAMkB,cAAc;gBACpB,MAAMC,YAAYpC,OAAOqC,YAAY;gBACrC,MAAMC,OAAOF,WAAWG,YAAYC;gBACpC,IAAIF,QAAQrB,MAAMW,aAAa,CAACa,QAAQ,CAACH,OAAO;oBAC9CF,UAAUM,KAAK;gBACjB;YACF;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/tooltip/useTooltip.ts"],"sourcesContent":["\"use client\";\n\nimport { cnb } from \"cnbuilder\";\nimport {\n type CSSProperties,\n type FocusEvent,\n type MouseEvent,\n type MutableRefObject,\n type Ref,\n type RefObject,\n type TouchEvent,\n useCallback,\n useEffect,\n useId,\n useRef,\n} from \"react\";\n\nimport {\n type ControlledHoverModeImplementation,\n useHoverMode,\n} from \"../hoverMode/useHoverMode.js\";\nimport {\n type UserInteractionMode,\n useUserInteractionMode,\n} from \"../interaction/UserInteractionModeProvider.js\";\nimport { type SimplePosition } from \"../positioning/types.js\";\nimport {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n type FixedPositioningOptions,\n type FixedPositioningTransitionCallbacks,\n useFixedPositioning,\n} from \"../positioning/useFixedPositioning.js\";\nimport { type UseStateSetter } from \"../types.js\";\nimport { usePageInactive } from \"../usePageInactive.js\";\nimport { parseCssLengthUnit } from \"../utils/parseCssLengthUnit.js\";\nimport { useTooltipHoverMode } from \"./TooltipHoverModeProvider.js\";\nimport {\n DEFAULT_TOOLTIP_DENSE_SPACING,\n DEFAULT_TOOLTIP_MARGIN,\n DEFAULT_TOOLTIP_POSITION,\n DEFAULT_TOOLTIP_SPACING,\n DEFAULT_TOOLTIP_THRESHOLD,\n TOOLTIP_SPACING_VAR,\n} from \"./constants.js\";\nimport {\n type TooltipPositionHookOptions,\n useTooltipPosition,\n} from \"./useTooltipPosition.js\";\nimport { getAnchor } from \"./utils.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/** @since 2.8.0 */\nexport interface TooltipPositioningOptions {\n style?: CSSProperties;\n\n /**\n * @see {@link FixedPositioningOptions.vwMargin}\n * @defaultValue `16`\n */\n vwMargin?: number;\n\n /**\n * @see {@link FixedPositioningOptions.vhMargin}\n * @defaultValue `16`\n */\n vhMargin?: number;\n\n /**\n * Set this to `true` to reduce the font size and padding on the tooltip and\n * the amount of spacing between the tooltipped element and the tooltip.\n *\n * @defaultValue `false`\n */\n dense?: boolean;\n\n /**\n * The amount of spacing to use between the tooltipped element and the tooltip\n * when {@link disableAutoSpacing} is `false`.\n *\n * @defaultValue `\"1.5rem`\n */\n spacing?: number | string;\n\n /**\n * The amount of spacing to use between the tooltipped element and the tooltip\n * when {@link disableAutoSpacing} is `false` and {@link dense} is `true`.\n *\n * @defaultValue `\"0.875rem`\n */\n denseSpacing?: number | string;\n\n /**\n * Set this to `true` to prevent the {@link defaultPosition} to swap to the\n * other side of the tooltipped element when it is too close to the viewport\n * edge. This will always be `true` if a {@link position} is provided.\n *\n * @defaultValue `false`\n */\n disableSwapping?: boolean;\n\n /**\n * @defaultValue `false`\n */\n disableAutoSpacing?: boolean;\n}\n\n/**\n * @since 2.8.0\n * @since 6.0.0 Removed the `TooltipTouchEventHandlers` and\n * `TooltipKeyboardEventHandlers` types, removed the need for the `onKeyDown`\n * event.\n */\nexport interface TooltippedElementEventHandlers<\n E extends HTMLElement = HTMLButtonElement,\n> {\n onBlur?: (event: FocusEvent<E>) => void;\n onFocus?: (event: FocusEvent<E>) => void;\n onMouseEnter?: (event: MouseEvent<E>) => void;\n onMouseLeave?: (event: MouseEvent<E>) => void;\n onTouchStart?: (event: TouchEvent<E>) => void;\n onTouchEnd?: (event: TouchEvent<E>) => void;\n onContextMenu?: (event: MouseEvent<E>) => void;\n}\n\n/**\n * @since 2.8.0\n * @since 6.0.0 Renamed from `TooltipHookProvidedElementProps`\n */\nexport interface ProvidedTooltippedElementProps<E extends HTMLElement>\n extends Required<TooltippedElementEventHandlers<E>> {\n \"aria-describedby\": string | undefined;\n id: string;\n}\n\n/**\n * @since 2.8.0\n * @since 6.0.0 A major API change for the hover mode behavior and no longer\n * requires a `baseId`/`id` for the tooltip. Also renamed from\n * `TooltipHookOptions` to `TooltipOptions` to match other hook naming\n * conventions.\n */\nexport interface TooltipOptions<\n TooltippedElement extends HTMLElement = HTMLButtonElement,\n> extends FixedPositioningTransitionCallbacks,\n TooltippedElementEventHandlers<TooltippedElement>,\n TooltipPositioningOptions,\n TooltipPositionHookOptions {\n /**\n * @defaultValue `\"tooltip-\" + useId()`\n */\n id?: string;\n\n /**\n * An optional override for the `aria-describedby`\n */\n describedBy?: string;\n\n /**\n * Any styles to be merged with the fixed positioning styles for the tooltip.\n */\n style?: CSSProperties;\n\n /**\n * Boolean if the event handlers should no longer attempt to show a tooltip. This\n * should be set to `true` when your component might not have a tooltip associated\n * with it.\n *\n * @example Real World Example\n * ```tsx\n * // This is _almost_ the source code for the `TooltippedButton` provided by react-md\n * import { Button } from \"@react-md/core/button/Button\";\n * import { Tooltip } from \"@react-md/core/tooltip/Tooltip\";\n * import { useTooltip } from \"@react-md/core/tooltip/useTooltip\";\n * import { type ReactElement, type ReactNode } from \"react\";\n *\n * export interface TooltippedButtonProps extends ButtonProps {\n * tooltip?: ReactNode;\n * }\n *\n * export function TooltippedButton({\n * id,\n * tooltip,\n * children,\n * onBlur,\n * onFocus,\n * onMouseEnter,\n * onMouseLeave,\n * onTouchStart,\n * onTouchEnd,\n * onContextMenu,\n * ...props\n * }: TooltippedButtonProps): ReactElement {\n * const { elementProps, tooltipProps } = useTooltip({\n * id,\n * disabled: !tooltip,\n * onBlur,\n * onFocus,\n * onMouseEnter,\n * onMouseLeave,\n * onTouchStart,\n * onTouchEnd,\n * onContextMenu,\n * });\n *\n * return (\n * <>\n * <Button {...props} {...elementProps}>\n * {children}\n * </Button>\n * <Tooltip {...tooltipProps}>{tooltip}</Tooltip>\n * </>\n * );\n * }\n * ```\n *\n * @defaultValue `false`\n * @since 5.1.0\n */\n disabled?: boolean;\n\n /**\n * The amount of time (in ms) to hover an element before the tooltip becomes\n * visible.\n *\n * The default value is really the current hover timeout from the\n * `TooltipHoverModeProvider`.\n *\n * @defaultValue `1000`\n */\n hoverTimeout?: number;\n\n /**\n * The amount of time to wait before triggering the exit animation for the\n * tooltip.\n *\n * The default value is really the current leaveTimeout timeout from the\n * `TooltipHoverModeProvider`.\n *\n * @defaultValue `0`\n */\n leaveTimeout?: number;\n\n /**\n * Set this to `true` to only allow the tooltip to become visible when the\n * `event .currentTarget` or `overflowRef` has text overflow.\n *\n * @defaultValue `false`\n * @since 6.0.0\n */\n overflowOnly?: boolean;\n\n /**\n * @see {@link FixedPositioningOptions.disabled}\n * @defaultValue `false`\n */\n disableFixedPositioning?: boolean;\n}\n\n/**\n * @since 2.8.0\n * @since 6.0.0 This was renamed from `TooltipHookProvidedTooltipProps`\n */\nexport interface ProvidedTooltipProps<E extends HTMLElement = HTMLSpanElement>\n extends Required<FixedPositioningTransitionCallbacks> {\n id: string;\n ref: Ref<E>;\n dense: boolean;\n style: CSSProperties | undefined;\n visible: boolean;\n position: SimplePosition;\n}\n\n/**\n * @since 2.8.0\n * @since 6.0.0 No longer returns any properties from the hover mode provider\n * because of the major API change to hover mode.. Also renamed from\n * `TooltipHookReturnValue` to `TooltipImplementation` to match other hook\n * naming conventions.\n */\nexport interface TooltipImplementation<\n TooltippedElement extends HTMLElement = HTMLButtonElement,\n TooltipElement extends HTMLElement = HTMLSpanElement,\n> extends ControlledHoverModeImplementation {\n visible: boolean;\n setVisible: UseStateSetter<boolean>;\n animatedOnce: boolean;\n initiatedBy: MutableRefObject<UserInteractionMode | null>;\n elementProps: ProvidedTooltippedElementProps<TooltippedElement>;\n tooltipProps: ProvidedTooltipProps<TooltipElement>;\n\n /**\n * This is a wrapper around the {@link setVisible} behavior that will also\n * clear any pending timeouts.\n */\n hideTooltip: () => void;\n\n /**\n * @since 6.0.0\n */\n overflowRef: RefObject<HTMLElement>;\n}\n\n/**\n * @example Simple Usage\n * ```tsx\n * import { Button } from \"@react-md/core/button/Button\";\n * import { Tooltip } from \"@react-md/core/tooltip/Tooltip\";\n * import { useTooltip } from \"@react-md/core/tooltip/useTooltip\";\n *\n * function Example() {\n * const { elementProps, tooltipProps } = useTooltip();\n *\n * return (\n * <>\n * <Button {...elementProps}>Button</Button>\n * <Tooltip {...tooltipProps}>\n * Tooltip Content\n * </Tooltip>\n * </>\n * );\n * }\n * ```\n *\n * @example Overflow-only Tooltips\n * ```tsx\n * import { cssUtils } from \"@react-md/core/cssUtils\";\n * import { Link, type LinkProps } from \"@react-md/core/link/Link\";\n * import { Tooltip } from \"@react-md/core/tooltip/Tooltip\";\n * import { useTooltip } from \"@react-md/core/tooltip/useTooltip\";\n * import { type ReactElement } from \"react\";\n *\n * function NavigationLink(props: LinkProps): ReactElement {\n * const { children, ...remaining } = props;\n *\n * // using the `overflowRef` is optional and will default to the\n * // `event.currentTarget` when `null`\n * const { overflowRef, elementProps, tooltipProps } = useOverflowTooltip({\n * // just to pass any event handlers\n * ...remaining,\n * overflowOnly: true,\n * });\n *\n * return (\n * <Link {...remaining} {...elementProps} style={{ width: \"100%\" }}>\n * <span ref={overflowRef} className={cssUtils({ textOverflow: \"ellipsis\" })}>\n * {children}\n * </span>\n * <Tooltip {...tooltipProps}>\n * {children}\n * </Tooltip>\n * </Link>\n * );\n * }\n *\n * function Example(): ReactElement {\n * return (\n * <div style={{ width: \"10rem\", overflow: \"auto\" }}>\n * <NavigationLink href=\"/\">Home</NavigationLink>\n * <NavigationLink href=\"/some-path\">\n * Super long text that will be truncated with ellipsis and\n * have a tooltip appear\n * </NavigationLink>\n * </div>\n * );\n * }\n * ```\n *\n * ## Inspecting Tooltip Styles\n *\n * Since tooltips will disappear on blur, mouseleave, etc, it is a bit hard to\n * inspect the tooltip styles. In dev mode, you can manually set the visibility\n * to `true` through the dev tools.\n * - find your tooltip implementation\n * - expand the Tooltip hook\n * - expand the HoverMode hook\n * - set the first boolean state to `true`\n *\n * The tooltip will now remain visible allowing you to find it within the\n * \"Inspector\" tab in the dev tools.\n *\n * @see {@link https://react-md.dev/components/tooltip | Tooltip Demos}\n * @since 2.8.0\n * @since 6.0.0 Uses a separate `TooltipHoverModeProvider`.\n *\n * TODO: I need to fix the tooltip for click events and history changes since\n * the mouseleave event will not be correctly bubbled if hovering a child\n * element when the click or history update happens. this causes the tooltip to\n * stay visible\n */\nexport function useTooltip<\n TooltippedElement extends HTMLElement = HTMLButtonElement,\n TooltipElement extends HTMLElement = HTMLSpanElement,\n>(\n options: TooltipOptions<TooltippedElement> = {}\n): TooltipImplementation<TooltippedElement, TooltipElement> {\n const {\n id: propId,\n style: propStyle,\n disabled = false,\n describedBy,\n dense = false,\n hoverTimeout,\n leaveTimeout,\n vwMargin = DEFAULT_TOOLTIP_MARGIN,\n vhMargin = DEFAULT_TOOLTIP_MARGIN,\n spacing = DEFAULT_TOOLTIP_SPACING,\n denseSpacing = DEFAULT_TOOLTIP_DENSE_SPACING,\n disableSwapping,\n disableAutoSpacing,\n position: determinedPosition,\n defaultPosition = DEFAULT_TOOLTIP_POSITION,\n threshold = DEFAULT_TOOLTIP_THRESHOLD,\n onBlur = noop,\n onFocus = noop,\n onMouseEnter = noop,\n onMouseLeave = noop,\n onTouchStart = noop,\n onTouchEnd = noop,\n onContextMenu = noop,\n onEnter = noop,\n onEntering,\n onEntered = noop,\n onExited,\n overflowOnly,\n disableFixedPositioning,\n } = options;\n\n const fallbackId = useId();\n const id = propId || fallbackId;\n const tooltipId = `${id}-tooltip`;\n const {\n animatedOnceRef,\n hoverTimeoutRef,\n leaveTimeoutRef,\n enableHoverMode,\n disableHoverMode,\n startDisableTimer,\n clearDisableTimer,\n } = useTooltipHoverMode();\n const {\n visible,\n setVisible,\n startShowFlow,\n startHideFlow,\n clearVisibilityTimeout,\n } = useHoverMode({\n hoverTimeout,\n hoverTimeoutRef,\n leaveTimeout,\n leaveTimeoutRef,\n enableHoverMode,\n disableHoverMode,\n startDisableTimer,\n clearDisableTimer,\n });\n const [position, updatePosition] = useTooltipPosition({\n position: determinedPosition,\n defaultPosition,\n threshold,\n });\n\n const mode = useUserInteractionMode();\n const elementRef = useRef<HTMLElement | null>(null);\n const tooltipRef = useRef<TooltipElement>(null);\n const overflowRef = useRef<HTMLElement>(null);\n const initiatedBy = useRef<UserInteractionMode | null>(null);\n const { ref, style, callbacks } = useFixedPositioning({\n nodeRef: tooltipRef,\n style: propStyle,\n fixedTo: elementRef,\n anchor: getAnchor(position),\n disableSwapping: disableSwapping ?? !!determinedPosition,\n disabled: disableFixedPositioning,\n getFixedPositionOptions() {\n let tooltipSpacing = dense ? denseSpacing : spacing;\n const tooltip = tooltipRef.current;\n if (!disableAutoSpacing && tooltip) {\n tooltipSpacing =\n window\n .getComputedStyle(tooltip)\n .getPropertyValue(TOOLTIP_SPACING_VAR) || spacing;\n }\n\n const currentSpacing = parseCssLengthUnit({\n value: tooltipSpacing,\n });\n const horizontal = position === \"left\" || position === \"right\";\n\n return {\n vwMargin,\n vhMargin,\n xMargin: horizontal ? currentSpacing : undefined,\n yMargin: horizontal ? undefined : currentSpacing,\n };\n },\n onEnter(appearing) {\n onEnter(appearing);\n\n // This allows you to inspect the tooltip styles through the element\n // inspector without first hovering or focusing the tooltipped element\n // beforehand by setting the `HoverMode` hook to `true`\n if (process.env.NODE_ENV !== \"production\" && !elementRef.current) {\n elementRef.current = document.getElementById(id);\n }\n },\n onEntering,\n onEntered(appearing) {\n onEntered(appearing);\n\n animatedOnceRef.current = true;\n },\n onExited,\n });\n\n const hideTooltip = useCallback(() => {\n initiatedBy.current = null;\n disableHoverMode();\n clearVisibilityTimeout();\n setVisible(false);\n }, [clearVisibilityTimeout, disableHoverMode, setVisible]);\n\n useEffect(() => {\n if (!visible) {\n return;\n }\n\n const handleKeyDown = (event: KeyboardEvent): void => {\n if (event.key === \"Escape\") {\n hideTooltip();\n }\n };\n\n window.addEventListener(\"keydown\", handleKeyDown);\n window.addEventListener(\"scroll\", hideTooltip, true);\n window.addEventListener(\"touchend\", hideTooltip, true);\n return () => {\n window.removeEventListener(\"keydown\", handleKeyDown);\n window.removeEventListener(\"scroll\", hideTooltip, true);\n window.removeEventListener(\"touchend\", hideTooltip, true);\n };\n }, [hideTooltip, visible]);\n\n const refocusFrame = useRef(0);\n const pageInactive = useRef(false);\n usePageInactive({\n disabled,\n onDisabledCleanup: hideTooltip,\n onChange(active) {\n if (active) {\n refocusFrame.current = window.requestAnimationFrame(() => {\n pageInactive.current = false;\n });\n return;\n }\n\n pageInactive.current = true;\n hideTooltip();\n },\n });\n\n const isNotOverflown = (currentTarget: HTMLElement): boolean => {\n if (!overflowOnly) {\n return false;\n }\n\n const element = overflowRef.current || currentTarget;\n return !element || element.offsetWidth >= element.scrollWidth;\n };\n\n return {\n visible,\n setVisible,\n hideTooltip,\n animatedOnce: animatedOnceRef.current,\n initiatedBy,\n overflowRef,\n startShowFlow,\n startHideFlow,\n clearVisibilityTimeout,\n tooltipProps: {\n id: tooltipId,\n ref,\n dense,\n style,\n visible,\n position,\n ...callbacks,\n },\n elementProps: {\n \"aria-describedby\": cnb(visible && tooltipId, describedBy) || undefined,\n id,\n onMouseEnter(event) {\n onMouseEnter(event);\n if (\n disabled ||\n mode === \"touch\" ||\n initiatedBy.current !== null ||\n isNotOverflown(event.currentTarget)\n ) {\n return;\n }\n\n initiatedBy.current = \"mouse\";\n elementRef.current = event.currentTarget;\n updatePosition(event.currentTarget);\n startShowFlow(id);\n },\n onMouseLeave(event) {\n onMouseLeave(event);\n if (disabled || initiatedBy.current !== \"mouse\") {\n return;\n }\n\n startHideFlow();\n initiatedBy.current = null;\n },\n onBlur(event) {\n onBlur(event);\n if (disabled) {\n return;\n }\n\n initiatedBy.current = null;\n startHideFlow();\n },\n onFocus(event) {\n onFocus(event);\n // skip the focus events when the browser is re-focused if the user\n // pressed alt-tab, minimized the browser, etc\n if (\n disabled ||\n mode !== \"keyboard\" ||\n initiatedBy.current !== null ||\n pageInactive.current ||\n isNotOverflown(event.currentTarget)\n ) {\n pageInactive.current = false;\n return;\n }\n\n initiatedBy.current = \"keyboard\";\n elementRef.current = event.currentTarget;\n updatePosition(event.currentTarget);\n startShowFlow(id);\n },\n onTouchStart(event) {\n onTouchStart(event);\n if (\n disabled ||\n initiatedBy.current !== null ||\n isNotOverflown(event.currentTarget)\n ) {\n return;\n }\n\n initiatedBy.current = \"touch\";\n elementRef.current = event.currentTarget;\n updatePosition(event.currentTarget);\n startShowFlow(id);\n },\n onTouchEnd(event) {\n onTouchEnd(event);\n if (disabled) {\n return;\n }\n\n initiatedBy.current = null;\n startHideFlow();\n },\n onContextMenu(event) {\n onContextMenu(event);\n if (\n disabled ||\n initiatedBy.current !== \"touch\" ||\n isNotOverflown(event.currentTarget)\n ) {\n return;\n }\n\n event.preventDefault();\n const selection = window.getSelection();\n const node = selection?.anchorNode?.parentElement;\n if (node && event.currentTarget.contains(node)) {\n selection.empty();\n }\n },\n },\n };\n}\n"],"names":["cnb","useCallback","useEffect","useId","useRef","useHoverMode","useUserInteractionMode","useFixedPositioning","usePageInactive","parseCssLengthUnit","useTooltipHoverMode","DEFAULT_TOOLTIP_DENSE_SPACING","DEFAULT_TOOLTIP_MARGIN","DEFAULT_TOOLTIP_POSITION","DEFAULT_TOOLTIP_SPACING","DEFAULT_TOOLTIP_THRESHOLD","TOOLTIP_SPACING_VAR","useTooltipPosition","getAnchor","noop","useTooltip","options","id","propId","style","propStyle","disabled","describedBy","dense","hoverTimeout","leaveTimeout","vwMargin","vhMargin","spacing","denseSpacing","disableSwapping","disableAutoSpacing","position","determinedPosition","defaultPosition","threshold","onBlur","onFocus","onMouseEnter","onMouseLeave","onTouchStart","onTouchEnd","onContextMenu","onEnter","onEntering","onEntered","onExited","overflowOnly","disableFixedPositioning","fallbackId","tooltipId","animatedOnceRef","hoverTimeoutRef","leaveTimeoutRef","enableHoverMode","disableHoverMode","startDisableTimer","clearDisableTimer","visible","setVisible","startShowFlow","startHideFlow","clearVisibilityTimeout","updatePosition","mode","elementRef","tooltipRef","overflowRef","initiatedBy","ref","callbacks","nodeRef","fixedTo","anchor","getFixedPositionOptions","tooltipSpacing","tooltip","current","window","getComputedStyle","getPropertyValue","currentSpacing","value","horizontal","xMargin","undefined","yMargin","appearing","process","env","NODE_ENV","document","getElementById","hideTooltip","handleKeyDown","event","key","addEventListener","removeEventListener","refocusFrame","pageInactive","onDisabledCleanup","onChange","active","requestAnimationFrame","isNotOverflown","currentTarget","element","offsetWidth","scrollWidth","animatedOnce","tooltipProps","elementProps","preventDefault","selection","getSelection","node","anchorNode","parentElement","contains","empty"],"mappings":"AAAA;AAEA,SAASA,GAAG,QAAQ,YAAY;AAChC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AAK;gBAChBvD,aAAauD;gBACb,IACE1E,YACA+C,YAAYS,OAAO,KAAK,QACxB4B,eAAeV,MAAMW,aAAa,GAClC;oBACA;gBACF;gBAEAtC,YAAYS,OAAO,GAAG;gBACtBZ,WAAWY,OAAO,GAAGkB,MAAMW,aAAa;gBACxC3C,eAAegC,MAAMW,aAAa;gBAClC9C,cAAc3C;YAChB;YACAwB,YAAWsD,KAAK;gBACdtD,WAAWsD;gBACX,IAAI1E,UAAU;oBACZ;gBACF;gBAEA+C,YAAYS,OAAO,GAAG;gBACtBhB;YACF;YACAnB,eAAcqD,KAAK;gBACjBrD,cAAcqD;gBACd,IACE1E,YACA+C,YAAYS,OAAO,KAAK,WACxB4B,eAAeV,MAAMW,aAAa,GAClC;oBACA;gBACF;gBAEAX,MAAMkB,cAAc;gBACpB,MAAMC,YAAYpC,OAAOqC,YAAY;gBACrC,MAAMC,OAAOF,WAAWG,YAAYC;gBACpC,IAAIF,QAAQrB,MAAMW,aAAa,CAACa,QAAQ,CAACH,OAAO;oBAC9CF,UAAUM,KAAK;gBACjB;YACF;QACF;IACF;AACF"}
@@ -64,7 +64,7 @@ export interface CSSTransitionProps<E extends HTMLElement> extends CSSTransition
64
64
  * }
65
65
  * ```
66
66
  *
67
- * @see {@link https://next.react-md.dev/components/css-transition | CSSTransition Demos}
67
+ * @see {@link https://react-md.dev/components/css-transition | CSSTransition Demos}
68
68
  * @typeParam E - An HTMLElement type used for the ref required for the
69
69
  * transition.
70
70
  * @since 4.0.0
@@ -60,7 +60,7 @@ import { useCSSTransition } from "./useCSSTransition.js";
60
60
  * }
61
61
  * ```
62
62
  *
63
- * @see {@link https://next.react-md.dev/components/css-transition | CSSTransition Demos}
63
+ * @see {@link https://react-md.dev/components/css-transition | CSSTransition Demos}
64
64
  * @typeParam E - An HTMLElement type used for the ref required for the
65
65
  * transition.
66
66
  * @since 4.0.0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/transition/CSSTransition.tsx"],"sourcesContent":["\"use client\";\n\nimport { cnb } from \"cnbuilder\";\nimport { Children, type ReactElement, cloneElement } from \"react\";\n\nimport {\n type CSSTransitionComponentImplementation,\n type CSSTransitionHookOptions,\n} from \"./types.js\";\nimport { useCSSTransition } from \"./useCSSTransition.js\";\n\n/**\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @since 4.0.0\n */\nexport interface CSSTransitionProps<E extends HTMLElement>\n extends CSSTransitionHookOptions<E>,\n CSSTransitionComponentImplementation<E> {}\n\n/**\n * **Client Component**\n *\n * This is a component implementation of the {@link useCSSTransition} hook that\n * implements the `temporary` behavior. Since this component uses the\n * `React.cloneElement` to inject the `ref` and `className` into the `children`,\n * it is recommended to use the hook instead.\n *\n * @example Simple Example\n * ```tsx\n * import { ReactElement, useState } from \"react\";\n * import { Button } from \"@react-md/core/button/Button\":\n * import { CSSTransition } from \"@react-md/core/transition/CSSTransition\":\n *\n * // pretend global styles:\n * //\n * // .opacity--enter {\n * // opacity: 0;\n * // transition: opacity .3s;\n * // }\n * //\n * // .opacity--enter-active {\n * // opacity: 1;\n * // }\n * //\n * // .opacity--exit {\n * // opacity: 1;\n * // }\n * //\n * // .opacity--exit-active {\n * // opacity: 0;\n * // transition: opacity .3s;\n * // }\n *\n * function Example(): ReactElement {\n * const [transitionIn, setTransitionIn] = useState(false);\n *\n * return (\n * <>\n * <Button onClick={() => setTransitionIn(!transitionIn)}>\n * Toggle\n * </Button>\n * <CSSTransition\n * timeout={300}\n * className=\"opacity\"\n * temporary\n * transitionIn={transitionIn}\n * >\n * <div>\n * This is some content that will animate!\n * </div>\n * </CSSTransition>\n * </>\n * );\n * }\n * ```\n *\n * @see {@link https://next.react-md.dev/components/css-transition | CSSTransition Demos}\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @since 4.0.0\n */\nexport function CSSTransition<E extends HTMLElement>(\n props: CSSTransitionProps<E>\n): ReactElement | null {\n const { children, className, ...options } = props;\n const child = Children.only(children);\n const { elementProps, rendered } = useCSSTransition({\n ...options,\n className: cnb(child.props.className, className),\n });\n\n return <>{rendered && cloneElement(children, elementProps)}</>;\n}\n"],"names":["cnb","Children","cloneElement","useCSSTransition","CSSTransition","props","children","className","options","child","only","elementProps","rendered"],"mappings":"AAAA;;AAEA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,QAAQ,EAAqBC,YAAY,QAAQ,QAAQ;AAMlE,SAASC,gBAAgB,QAAQ,wBAAwB;AAWzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6DC,GACD,OAAO,SAASC,cACdC,KAA4B;IAE5B,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGC,SAAS,GAAGH;IAC5C,MAAMI,QAAQR,SAASS,IAAI,CAACJ;IAC5B,MAAM,EAAEK,YAAY,EAAEC,QAAQ,EAAE,GAAGT,iBAAiB;QAClD,GAAGK,OAAO;QACVD,WAAWP,IAAIS,MAAMJ,KAAK,CAACE,SAAS,EAAEA;IACxC;IAEA,qBAAO;kBAAGK,0BAAYV,aAAaI,UAAUK;;AAC/C"}
1
+ {"version":3,"sources":["../../src/transition/CSSTransition.tsx"],"sourcesContent":["\"use client\";\n\nimport { cnb } from \"cnbuilder\";\nimport { Children, type ReactElement, cloneElement } from \"react\";\n\nimport {\n type CSSTransitionComponentImplementation,\n type CSSTransitionHookOptions,\n} from \"./types.js\";\nimport { useCSSTransition } from \"./useCSSTransition.js\";\n\n/**\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @since 4.0.0\n */\nexport interface CSSTransitionProps<E extends HTMLElement>\n extends CSSTransitionHookOptions<E>,\n CSSTransitionComponentImplementation<E> {}\n\n/**\n * **Client Component**\n *\n * This is a component implementation of the {@link useCSSTransition} hook that\n * implements the `temporary` behavior. Since this component uses the\n * `React.cloneElement` to inject the `ref` and `className` into the `children`,\n * it is recommended to use the hook instead.\n *\n * @example Simple Example\n * ```tsx\n * import { ReactElement, useState } from \"react\";\n * import { Button } from \"@react-md/core/button/Button\":\n * import { CSSTransition } from \"@react-md/core/transition/CSSTransition\":\n *\n * // pretend global styles:\n * //\n * // .opacity--enter {\n * // opacity: 0;\n * // transition: opacity .3s;\n * // }\n * //\n * // .opacity--enter-active {\n * // opacity: 1;\n * // }\n * //\n * // .opacity--exit {\n * // opacity: 1;\n * // }\n * //\n * // .opacity--exit-active {\n * // opacity: 0;\n * // transition: opacity .3s;\n * // }\n *\n * function Example(): ReactElement {\n * const [transitionIn, setTransitionIn] = useState(false);\n *\n * return (\n * <>\n * <Button onClick={() => setTransitionIn(!transitionIn)}>\n * Toggle\n * </Button>\n * <CSSTransition\n * timeout={300}\n * className=\"opacity\"\n * temporary\n * transitionIn={transitionIn}\n * >\n * <div>\n * This is some content that will animate!\n * </div>\n * </CSSTransition>\n * </>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/css-transition | CSSTransition Demos}\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @since 4.0.0\n */\nexport function CSSTransition<E extends HTMLElement>(\n props: CSSTransitionProps<E>\n): ReactElement | null {\n const { children, className, ...options } = props;\n const child = Children.only(children);\n const { elementProps, rendered } = useCSSTransition({\n ...options,\n className: cnb(child.props.className, className),\n });\n\n return <>{rendered && cloneElement(children, elementProps)}</>;\n}\n"],"names":["cnb","Children","cloneElement","useCSSTransition","CSSTransition","props","children","className","options","child","only","elementProps","rendered"],"mappings":"AAAA;;AAEA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,QAAQ,EAAqBC,YAAY,QAAQ,QAAQ;AAMlE,SAASC,gBAAgB,QAAQ,wBAAwB;AAWzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6DC,GACD,OAAO,SAASC,cACdC,KAA4B;IAE5B,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGC,SAAS,GAAGH;IAC5C,MAAMI,QAAQR,SAASS,IAAI,CAACJ;IAC5B,MAAM,EAAEK,YAAY,EAAEC,QAAQ,EAAE,GAAGT,iBAAiB;QAClD,GAAGK,OAAO;QACVD,WAAWP,IAAIS,MAAMJ,KAAK,CAACE,SAAS,EAAEA;IACxC;IAEA,qBAAO;kBAAGK,0BAAYV,aAAaI,UAAUK;;AAC/C"}
@@ -50,7 +50,7 @@ export interface CollapseProps<E extends HTMLElement> extends Omit<CollapseTrans
50
50
  * }
51
51
  * ```
52
52
  *
53
- * @see {@link https://next.react-md.dev/components/collapse | Collapse Demos}
53
+ * @see {@link https://react-md.dev/components/collapse | Collapse Demos}
54
54
  * @see {@link useCollapseTransition} for additional examples
55
55
  * @typeParam E - An HTMLElement type used for the ref required for the
56
56
  * transition.
@@ -31,7 +31,7 @@ import { useCollapseTransition } from "./useCollapseTransition.js";
31
31
  * }
32
32
  * ```
33
33
  *
34
- * @see {@link https://next.react-md.dev/components/collapse | Collapse Demos}
34
+ * @see {@link https://react-md.dev/components/collapse | Collapse Demos}
35
35
  * @see {@link useCollapseTransition} for additional examples
36
36
  * @typeParam E - An HTMLElement type used for the ref required for the
37
37
  * transition.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/transition/Collapse.tsx"],"sourcesContent":["\"use client\";\n\nimport { cnb } from \"cnbuilder\";\nimport { Children, type ReactElement, cloneElement } from \"react\";\n\nimport {\n type CollapseElementProps,\n type CollapseTransitionHookOptions,\n useCollapseTransition,\n} from \"./useCollapseTransition.js\";\n\n/**\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n *\n * @since 2.0.0\n * @since 4.0.0 Updated for the new CSS Transition API.\n */\nexport interface CollapseProps<E extends HTMLElement>\n extends Omit<CollapseTransitionHookOptions<E>, \"transitionIn\"> {\n /**\n * The child element that should have a `ref` and the `style`/`className`\n * props cloned into using the `cloneElement` API. If the child is a custom\n * component, you **must** use `React.forwardRef` and pass the `ref` and the\n * other props for the transition to work correctly.\n */\n children: ReactElement<CollapseElementProps<E>>;\n\n /**\n * Boolean if the element should be collapsed.\n *\n * @see {@link CollapseTransitionHookOptions.transitionIn}\n */\n collapsed: boolean;\n}\n\n/**\n * **Client Component**\n *\n * This is a component implementation of the {@link useCollapseTransition} hook\n * that implements the `temporary` behavior. Since this component uses the\n * `React.cloneElement` to inject the `ref` and `className` into the `children`,\n * it is recommended to use the hook instead.\n *\n * @example Simple Example\n * ```tsx\n * function Example(): ReactElement {\n * const [collapsed, setCollapsed] = useState(true);\n *\n * return (\n * <>\n * <Button onClick={() => setCollapsed(!collapsed)}>\n * Toggle\n * </Button>\n * <Collapse collapsed={collapsed}>\n * <div>\n * Some content that should only be visible while not collapsed.\n * </div>\n * </Collapse>\n * </>\n * );\n * }\n * ```\n *\n * @see {@link https://next.react-md.dev/components/collapse | Collapse Demos}\n * @see {@link useCollapseTransition} for additional examples\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @since 2.0.0\n * @since 4.0.0 Updated for the new CSS Transition API.\n */\nexport function Collapse<E extends HTMLElement>(\n props: CollapseProps<E>\n): ReactElement {\n const { children, collapsed, className, ...options } = props;\n const child = Children.only(children);\n const { elementProps, rendered } = useCollapseTransition({\n ...options,\n className: cnb(child.props.className, className),\n transitionIn: !collapsed,\n });\n\n return <>{rendered && cloneElement(children, elementProps)}</>;\n}\n"],"names":["cnb","Children","cloneElement","useCollapseTransition","Collapse","props","children","collapsed","className","options","child","only","elementProps","rendered","transitionIn"],"mappings":"AAAA;;AAEA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,QAAQ,EAAqBC,YAAY,QAAQ,QAAQ;AAElE,SAGEC,qBAAqB,QAChB,6BAA6B;AA2BpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCC,GACD,OAAO,SAASC,SACdC,KAAuB;IAEvB,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,SAAS,EAAE,GAAGC,SAAS,GAAGJ;IACvD,MAAMK,QAAQT,SAASU,IAAI,CAACL;IAC5B,MAAM,EAAEM,YAAY,EAAEC,QAAQ,EAAE,GAAGV,sBAAsB;QACvD,GAAGM,OAAO;QACVD,WAAWR,IAAIU,MAAML,KAAK,CAACG,SAAS,EAAEA;QACtCM,cAAc,CAACP;IACjB;IAEA,qBAAO;kBAAGM,0BAAYX,aAAaI,UAAUM;;AAC/C"}
1
+ {"version":3,"sources":["../../src/transition/Collapse.tsx"],"sourcesContent":["\"use client\";\n\nimport { cnb } from \"cnbuilder\";\nimport { Children, type ReactElement, cloneElement } from \"react\";\n\nimport {\n type CollapseElementProps,\n type CollapseTransitionHookOptions,\n useCollapseTransition,\n} from \"./useCollapseTransition.js\";\n\n/**\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n *\n * @since 2.0.0\n * @since 4.0.0 Updated for the new CSS Transition API.\n */\nexport interface CollapseProps<E extends HTMLElement>\n extends Omit<CollapseTransitionHookOptions<E>, \"transitionIn\"> {\n /**\n * The child element that should have a `ref` and the `style`/`className`\n * props cloned into using the `cloneElement` API. If the child is a custom\n * component, you **must** use `React.forwardRef` and pass the `ref` and the\n * other props for the transition to work correctly.\n */\n children: ReactElement<CollapseElementProps<E>>;\n\n /**\n * Boolean if the element should be collapsed.\n *\n * @see {@link CollapseTransitionHookOptions.transitionIn}\n */\n collapsed: boolean;\n}\n\n/**\n * **Client Component**\n *\n * This is a component implementation of the {@link useCollapseTransition} hook\n * that implements the `temporary` behavior. Since this component uses the\n * `React.cloneElement` to inject the `ref` and `className` into the `children`,\n * it is recommended to use the hook instead.\n *\n * @example Simple Example\n * ```tsx\n * function Example(): ReactElement {\n * const [collapsed, setCollapsed] = useState(true);\n *\n * return (\n * <>\n * <Button onClick={() => setCollapsed(!collapsed)}>\n * Toggle\n * </Button>\n * <Collapse collapsed={collapsed}>\n * <div>\n * Some content that should only be visible while not collapsed.\n * </div>\n * </Collapse>\n * </>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/collapse | Collapse Demos}\n * @see {@link useCollapseTransition} for additional examples\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @since 2.0.0\n * @since 4.0.0 Updated for the new CSS Transition API.\n */\nexport function Collapse<E extends HTMLElement>(\n props: CollapseProps<E>\n): ReactElement {\n const { children, collapsed, className, ...options } = props;\n const child = Children.only(children);\n const { elementProps, rendered } = useCollapseTransition({\n ...options,\n className: cnb(child.props.className, className),\n transitionIn: !collapsed,\n });\n\n return <>{rendered && cloneElement(children, elementProps)}</>;\n}\n"],"names":["cnb","Children","cloneElement","useCollapseTransition","Collapse","props","children","collapsed","className","options","child","only","elementProps","rendered","transitionIn"],"mappings":"AAAA;;AAEA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,QAAQ,EAAqBC,YAAY,QAAQ,QAAQ;AAElE,SAGEC,qBAAqB,QAChB,6BAA6B;AA2BpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCC,GACD,OAAO,SAASC,SACdC,KAAuB;IAEvB,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,SAAS,EAAE,GAAGC,SAAS,GAAGJ;IACvD,MAAMK,QAAQT,SAASU,IAAI,CAACL;IAC5B,MAAM,EAAEM,YAAY,EAAEC,QAAQ,EAAE,GAAGV,sBAAsB;QACvD,GAAGM,OAAO;QACVD,WAAWR,IAAIU,MAAML,KAAK,CAACG,SAAS,EAAEA;QACtCM,cAAc,CAACP;IACjB;IAEA,qBAAO;kBAAGM,0BAAYX,aAAaI,UAAUM;;AAC/C"}
@@ -76,7 +76,7 @@ export interface CrossFadeProps<E extends HTMLElement> extends CrossFadeTransiti
76
76
  * }
77
77
  * ```
78
78
  *
79
- * @see {@link https://next.react-md.dev/components/cross-fade | CrossFade Demos}
79
+ * @see {@link https://react-md.dev/components/cross-fade | CrossFade Demos}
80
80
  * @typeParam E - An HTMLElement type used for the ref required for the
81
81
  * transition.
82
82
  * @since 2.0.0
@@ -62,7 +62,7 @@ import { useCrossFadeTransition } from "./useCrossFadeTransition.js";
62
62
  * }
63
63
  * ```
64
64
  *
65
- * @see {@link https://next.react-md.dev/components/cross-fade | CrossFade Demos}
65
+ * @see {@link https://react-md.dev/components/cross-fade | CrossFade Demos}
66
66
  * @typeParam E - An HTMLElement type used for the ref required for the
67
67
  * transition.
68
68
  * @since 2.0.0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/transition/CrossFade.tsx"],"sourcesContent":["\"use client\";\n\nimport { cnb } from \"cnbuilder\";\nimport { Children, type ReactElement, cloneElement } from \"react\";\n\nimport { type CSSTransitionComponentImplementation } from \"./types.js\";\nimport {\n type CrossFadeTransitionHookOptions,\n useCrossFadeTransition,\n} from \"./useCrossFadeTransition.js\";\n\n/**\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @since 2.0.0\n * @since 4.0.0 Updated for the new CSS Transition API\n */\nexport interface CrossFadeProps<E extends HTMLElement>\n extends CrossFadeTransitionHookOptions<E>,\n CSSTransitionComponentImplementation<E> {\n /**\n * Unlike the {@link useCrossFadeTransition}, the `appear` value is defaulted\n * to `true` so that the transition can occur when the `key` changes.\n *\n * @see {@link CrossFadeTransitionHookOptions.appear}\n * @defaultValue `true`\n */\n appear?: boolean;\n}\n\n/**\n * **Client Component**\n *\n * This is a component implementation of the {@link useCrossFadeTransition} hook\n * that implements the `temporary` behavior. Since this component uses the\n * `React.cloneElement` to inject the `ref` and `className` into the `children`,\n * it is recommended to use the hook instead.\n *\n * @example Appear transitions with a React key\n * ```tsx\n * import { ReactElement, useState } from \"react\";\n * import { CrossFade } from \"@react-md/transition\";\n *\n * import Page1 from \"./Page1\";\n * import Page2 from \"./Page2\";\n * import Page3 from \"./Page3\";\n *\n * function Example(): ReactElement {\n * const [page, setPage] = useState(0):\n *\n * let content: ReactNode;\n * switch (page) {\n * case 0:\n * content = <Page1 />\n * break:\n * case 1:\n * content = <Page2 />\n * break;\n * case 2:\n * content = <Page3 />\n * break;\n * default:\n * content = null;\n * }\n *\n * return (\n * <>\n * <Button\n * onClick={() => {\n * setPage(prevPage => {\n * const nextPage = prevPage + 1;\n * if (nextPage > 2) {\n * return 0;\n * }\n *\n * return nextPage;\n * })\n * }}\n * >\n * Change Page\n * </Button>\n * <CrossFade key={page}>\n * <div>{content}</div>\n * </CrossFade>\n * </>\n * );\n * }\n * ```\n *\n * @see {@link https://next.react-md.dev/components/cross-fade | CrossFade Demos}\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @since 2.0.0\n * @since 4.0.0 Updated for the new CSS Transition API and no longer supports\n * wrapping children in a `<div>`.\n */\nexport function CrossFade<E extends HTMLElement>(\n props: CrossFadeProps<E>\n): ReactElement {\n const { appear = true, children, className, ...options } = props;\n\n const child = Children.only(children);\n const { elementProps, rendered } = useCrossFadeTransition({\n ...options,\n appear,\n className: cnb(child.props.className, className),\n });\n\n return <>{rendered && cloneElement(children, elementProps)}</>;\n}\n"],"names":["cnb","Children","cloneElement","useCrossFadeTransition","CrossFade","props","appear","children","className","options","child","only","elementProps","rendered"],"mappings":"AAAA;;AAEA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,QAAQ,EAAqBC,YAAY,QAAQ,QAAQ;AAGlE,SAEEC,sBAAsB,QACjB,8BAA8B;AAqBrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiEC,GACD,OAAO,SAASC,UACdC,KAAwB;IAExB,MAAM,EAAEC,SAAS,IAAI,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGC,SAAS,GAAGJ;IAE3D,MAAMK,QAAQT,SAASU,IAAI,CAACJ;IAC5B,MAAM,EAAEK,YAAY,EAAEC,QAAQ,EAAE,GAAGV,uBAAuB;QACxD,GAAGM,OAAO;QACVH;QACAE,WAAWR,IAAIU,MAAML,KAAK,CAACG,SAAS,EAAEA;IACxC;IAEA,qBAAO;kBAAGK,0BAAYX,aAAaK,UAAUK;;AAC/C"}
1
+ {"version":3,"sources":["../../src/transition/CrossFade.tsx"],"sourcesContent":["\"use client\";\n\nimport { cnb } from \"cnbuilder\";\nimport { Children, type ReactElement, cloneElement } from \"react\";\n\nimport { type CSSTransitionComponentImplementation } from \"./types.js\";\nimport {\n type CrossFadeTransitionHookOptions,\n useCrossFadeTransition,\n} from \"./useCrossFadeTransition.js\";\n\n/**\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @since 2.0.0\n * @since 4.0.0 Updated for the new CSS Transition API\n */\nexport interface CrossFadeProps<E extends HTMLElement>\n extends CrossFadeTransitionHookOptions<E>,\n CSSTransitionComponentImplementation<E> {\n /**\n * Unlike the {@link useCrossFadeTransition}, the `appear` value is defaulted\n * to `true` so that the transition can occur when the `key` changes.\n *\n * @see {@link CrossFadeTransitionHookOptions.appear}\n * @defaultValue `true`\n */\n appear?: boolean;\n}\n\n/**\n * **Client Component**\n *\n * This is a component implementation of the {@link useCrossFadeTransition} hook\n * that implements the `temporary` behavior. Since this component uses the\n * `React.cloneElement` to inject the `ref` and `className` into the `children`,\n * it is recommended to use the hook instead.\n *\n * @example Appear transitions with a React key\n * ```tsx\n * import { ReactElement, useState } from \"react\";\n * import { CrossFade } from \"@react-md/transition\";\n *\n * import Page1 from \"./Page1\";\n * import Page2 from \"./Page2\";\n * import Page3 from \"./Page3\";\n *\n * function Example(): ReactElement {\n * const [page, setPage] = useState(0):\n *\n * let content: ReactNode;\n * switch (page) {\n * case 0:\n * content = <Page1 />\n * break:\n * case 1:\n * content = <Page2 />\n * break;\n * case 2:\n * content = <Page3 />\n * break;\n * default:\n * content = null;\n * }\n *\n * return (\n * <>\n * <Button\n * onClick={() => {\n * setPage(prevPage => {\n * const nextPage = prevPage + 1;\n * if (nextPage > 2) {\n * return 0;\n * }\n *\n * return nextPage;\n * })\n * }}\n * >\n * Change Page\n * </Button>\n * <CrossFade key={page}>\n * <div>{content}</div>\n * </CrossFade>\n * </>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/cross-fade | CrossFade Demos}\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @since 2.0.0\n * @since 4.0.0 Updated for the new CSS Transition API and no longer supports\n * wrapping children in a `<div>`.\n */\nexport function CrossFade<E extends HTMLElement>(\n props: CrossFadeProps<E>\n): ReactElement {\n const { appear = true, children, className, ...options } = props;\n\n const child = Children.only(children);\n const { elementProps, rendered } = useCrossFadeTransition({\n ...options,\n appear,\n className: cnb(child.props.className, className),\n });\n\n return <>{rendered && cloneElement(children, elementProps)}</>;\n}\n"],"names":["cnb","Children","cloneElement","useCrossFadeTransition","CrossFade","props","appear","children","className","options","child","only","elementProps","rendered"],"mappings":"AAAA;;AAEA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,QAAQ,EAAqBC,YAAY,QAAQ,QAAQ;AAGlE,SAEEC,sBAAsB,QACjB,8BAA8B;AAqBrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiEC,GACD,OAAO,SAASC,UACdC,KAAwB;IAExB,MAAM,EAAEC,SAAS,IAAI,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGC,SAAS,GAAGJ;IAE3D,MAAMK,QAAQT,SAASU,IAAI,CAACJ;IAC5B,MAAM,EAAEK,YAAY,EAAEC,QAAQ,EAAE,GAAGV,uBAAuB;QACxD,GAAGM,OAAO;QACVH;QACAE,WAAWR,IAAIU,MAAML,KAAK,CAACG,SAAS,EAAEA;IACxC;IAEA,qBAAO;kBAAGK,0BAAYX,aAAaK,UAAUK;;AAC/C"}
@@ -51,7 +51,7 @@ export interface ScaleTransitionProps<E extends HTMLElement> extends CSSTransiti
51
51
  * }
52
52
  * ```
53
53
  *
54
- * @see {@link https://next.react-md.dev/components/scale-transition | ScaleTransition Demos}
54
+ * @see {@link https://react-md.dev/components/scale-transition | ScaleTransition Demos}
55
55
  * @typeParam E - The HTMLElement type used or the ref required for the
56
56
  * transition.
57
57
  * @since 2.0.0
@@ -44,7 +44,7 @@ import { useScaleTransition } from "./useScaleTransition.js";
44
44
  * }
45
45
  * ```
46
46
  *
47
- * @see {@link https://next.react-md.dev/components/scale-transition | ScaleTransition Demos}
47
+ * @see {@link https://react-md.dev/components/scale-transition | ScaleTransition Demos}
48
48
  * @typeParam E - The HTMLElement type used or the ref required for the
49
49
  * transition.
50
50
  * @since 2.0.0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/transition/ScaleTransition.tsx"],"sourcesContent":["\"use client\";\n\nimport { cnb } from \"cnbuilder\";\nimport { Children, type ReactElement, cloneElement } from \"react\";\n\nimport { type CSSTransitionComponentImplementation } from \"./types.js\";\nimport {\n type ScaleTransitionHookOptions,\n useScaleTransition,\n} from \"./useScaleTransition.js\";\n\n/**\n * @typeParam E - The HTMLElement type used or the ref required for the\n * transition.\n * @since 2.0.0\n * @since 4.0.0 The typeParam was added\n * @since 6.0.0 Removed portal props\n */\nexport interface ScaleTransitionProps<E extends HTMLElement>\n extends CSSTransitionComponentImplementation<E>,\n ScaleTransitionHookOptions<E> {}\n\n/**\n * **Client Component**\n *\n * A component implementation of the {@link useScaleTransition} hook that just\n * has some reasonable defaults and supports portalling the children. Since this\n * component uses the `React.cloneElement` to inject the `ref` and `className`\n * into the `children`, it is recommended to use the hook instead.\n *\n * @example Dropdown Menu Example\n * ```tsx\n * import { ReactElement, useRef, useState } from \"react\";\n * import { Button } from \"@react-md/core/button/Button\";\n * import { useFixedPositioning } from \"@react-md/core/positioning/useFixedPositioning\";\n * import { useScaleTransition } from \"@react-md/core/transition/useScaleTransition\";\n *\n * function Example(): ReactElement {\n * const buttonRef = useRef<HTMLButtonElement>(null);\n * const [transitionIn, setTransitionIn] = useState(false);\n * const { style, transitionOptions } = useFixedPositioning({\n * fixedTo: buttonRef,\n * });\n *\n * return (\n * <>\n * <Button ref={buttonRef} onClick={() => setTransitionIn(!transitionIn)}>\n * Toggle\n * </Button>\n * <ScaleTransition\n * {...transitionOptions}\n * vertical\n * transitionIn={transitionIn}\n * >\n * <div style={style}>\n * Some content within a menu\n * </div>\n * </ScaleTransition>\n * </>\n * );\n * }\n * ```\n *\n * @see {@link https://next.react-md.dev/components/scale-transition | ScaleTransition Demos}\n * @typeParam E - The HTMLElement type used or the ref required for the\n * transition.\n * @since 2.0.0\n * @since 4.0.0 The typeParam was added and the API was updated.\n * @since 6.0.0 Removed the built-in support for portalling.\n */\nexport function ScaleTransition<E extends HTMLElement>(\n props: ScaleTransitionProps<E>\n): ReactElement {\n const { children, className, ...options } = props;\n const child = Children.only(children);\n\n const { elementProps, rendered } = useScaleTransition({\n ...options,\n className: cnb(child.props.className, className),\n });\n\n return <>{rendered && cloneElement(children, elementProps)}</>;\n}\n"],"names":["cnb","Children","cloneElement","useScaleTransition","ScaleTransition","props","children","className","options","child","only","elementProps","rendered"],"mappings":"AAAA;;AAEA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,QAAQ,EAAqBC,YAAY,QAAQ,QAAQ;AAGlE,SAEEC,kBAAkB,QACb,0BAA0B;AAajC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+CC,GACD,OAAO,SAASC,gBACdC,KAA8B;IAE9B,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGC,SAAS,GAAGH;IAC5C,MAAMI,QAAQR,SAASS,IAAI,CAACJ;IAE5B,MAAM,EAAEK,YAAY,EAAEC,QAAQ,EAAE,GAAGT,mBAAmB;QACpD,GAAGK,OAAO;QACVD,WAAWP,IAAIS,MAAMJ,KAAK,CAACE,SAAS,EAAEA;IACxC;IAEA,qBAAO;kBAAGK,0BAAYV,aAAaI,UAAUK;;AAC/C"}
1
+ {"version":3,"sources":["../../src/transition/ScaleTransition.tsx"],"sourcesContent":["\"use client\";\n\nimport { cnb } from \"cnbuilder\";\nimport { Children, type ReactElement, cloneElement } from \"react\";\n\nimport { type CSSTransitionComponentImplementation } from \"./types.js\";\nimport {\n type ScaleTransitionHookOptions,\n useScaleTransition,\n} from \"./useScaleTransition.js\";\n\n/**\n * @typeParam E - The HTMLElement type used or the ref required for the\n * transition.\n * @since 2.0.0\n * @since 4.0.0 The typeParam was added\n * @since 6.0.0 Removed portal props\n */\nexport interface ScaleTransitionProps<E extends HTMLElement>\n extends CSSTransitionComponentImplementation<E>,\n ScaleTransitionHookOptions<E> {}\n\n/**\n * **Client Component**\n *\n * A component implementation of the {@link useScaleTransition} hook that just\n * has some reasonable defaults and supports portalling the children. Since this\n * component uses the `React.cloneElement` to inject the `ref` and `className`\n * into the `children`, it is recommended to use the hook instead.\n *\n * @example Dropdown Menu Example\n * ```tsx\n * import { ReactElement, useRef, useState } from \"react\";\n * import { Button } from \"@react-md/core/button/Button\";\n * import { useFixedPositioning } from \"@react-md/core/positioning/useFixedPositioning\";\n * import { useScaleTransition } from \"@react-md/core/transition/useScaleTransition\";\n *\n * function Example(): ReactElement {\n * const buttonRef = useRef<HTMLButtonElement>(null);\n * const [transitionIn, setTransitionIn] = useState(false);\n * const { style, transitionOptions } = useFixedPositioning({\n * fixedTo: buttonRef,\n * });\n *\n * return (\n * <>\n * <Button ref={buttonRef} onClick={() => setTransitionIn(!transitionIn)}>\n * Toggle\n * </Button>\n * <ScaleTransition\n * {...transitionOptions}\n * vertical\n * transitionIn={transitionIn}\n * >\n * <div style={style}>\n * Some content within a menu\n * </div>\n * </ScaleTransition>\n * </>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/scale-transition | ScaleTransition Demos}\n * @typeParam E - The HTMLElement type used or the ref required for the\n * transition.\n * @since 2.0.0\n * @since 4.0.0 The typeParam was added and the API was updated.\n * @since 6.0.0 Removed the built-in support for portalling.\n */\nexport function ScaleTransition<E extends HTMLElement>(\n props: ScaleTransitionProps<E>\n): ReactElement {\n const { children, className, ...options } = props;\n const child = Children.only(children);\n\n const { elementProps, rendered } = useScaleTransition({\n ...options,\n className: cnb(child.props.className, className),\n });\n\n return <>{rendered && cloneElement(children, elementProps)}</>;\n}\n"],"names":["cnb","Children","cloneElement","useScaleTransition","ScaleTransition","props","children","className","options","child","only","elementProps","rendered"],"mappings":"AAAA;;AAEA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,QAAQ,EAAqBC,YAAY,QAAQ,QAAQ;AAGlE,SAEEC,kBAAkB,QACb,0BAA0B;AAajC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+CC,GACD,OAAO,SAASC,gBACdC,KAA8B;IAE9B,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGC,SAAS,GAAGH;IAC5C,MAAMI,QAAQR,SAASS,IAAI,CAACJ;IAE5B,MAAM,EAAEK,YAAY,EAAEC,QAAQ,EAAE,GAAGT,mBAAmB;QACpD,GAAGK,OAAO;QACVD,WAAWP,IAAIS,MAAMJ,KAAK,CAACE,SAAS,EAAEA;IACxC;IAEA,qBAAO;kBAAGK,0BAAYV,aAAaI,UAAUK;;AAC/C"}
@@ -118,7 +118,7 @@ export interface SkeletonPlaceholderProps extends HTMLAttributes<HTMLDivElement>
118
118
  * }
119
119
  * ```
120
120
  *
121
- * @see {@link https://next.react-md.dev/components/skeleton-placeholder | SkeletonPlaceholder Demos}
121
+ * @see {@link https://react-md.dev/components/skeleton-placeholder | SkeletonPlaceholder Demos}
122
122
  * @since 6.0.0
123
123
  */
124
124
  export declare const SkeletonPlaceholder: import("react").ForwardRefExoticComponent<SkeletonPlaceholderProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -103,7 +103,7 @@ import { useSkeletonPlaceholder } from "./useSkeletonPlaceholder.js";
103
103
  * }
104
104
  * ```
105
105
  *
106
- * @see {@link https://next.react-md.dev/components/skeleton-placeholder | SkeletonPlaceholder Demos}
106
+ * @see {@link https://react-md.dev/components/skeleton-placeholder | SkeletonPlaceholder Demos}
107
107
  * @since 6.0.0
108
108
  */ export const SkeletonPlaceholder = /*#__PURE__*/ forwardRef(function SkeletonPlaceholder(props, ref) {
109
109
  const { style, className, height, width, children, disabled = !!children, delay, minDelay, maxDelay, minPercentage, maxPercentage, ...remaining } = props;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/transition/SkeletonPlaceholder.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n forwardRef,\n} from \"react\";\n\nimport {\n type SkeletonPlaceholderOptions,\n useSkeletonPlaceholder,\n} from \"./useSkeletonPlaceholder.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-skeleton-placeholder-background-color\"?: string;\n \"--rmd-skeleton-placeholder-height\"?: string | number;\n \"--rmd-skeleton-placeholder-width\"?: string | number;\n }\n}\n\n/** @since 6.0.0 */\nexport interface SkeletonPlaceholderProps\n extends HTMLAttributes<HTMLDivElement>,\n SkeletonPlaceholderOptions {\n /**\n * @defaultValue `!!children`\n * @see {@link SkeletonPlaceholderOptions.disabled}\n */\n disabled?: boolean;\n\n /** @see {@link SkeletonPlaceholderOptions.disabled} for an example */\n children?: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * @example Simple Example\n * ```tsx\n * import type { ReactElement } from \"@react\";\n * import { SkeletonPlaceholder } from \"@react-md/core/transition/SkeletonPlaceholder\";\n *\n * interface ExampleProps {\n * loading: boolean;\n * children: ReactNode;\n * }\n *\n * export default function Example({ loading, children }: ExampleProps): ReactElement {\n * if (loading) {\n * return <SkeletonPlaceholder />;\n * }\n *\n * return <>{children}</>;\n * }\n * ```\n *\n * @example Pre-rendered Layout\n * ```tsx\n * import type { ReactElement } from \"@react\";\n * import { SkeletonPlaceholder } from \"@react-md/core/transition/SkeletonPlaceholder\";\n *\n * interface Data {\n * id: string;\n * name: string;\n * createdBy: string\n * createdOn: string;\n * modifiedBy: string;\n * modifiedOn: string;\n * }\n *\n * function ShowData({\n * id,\n * name,\n * createdBy,\n * createdOn,\n * modifiedBy,\n * modifiedOn,\n * }: Partial<Data>:: ReactElement {\n * const loading =\n * !name &&\n * !createdBy &&\n * !createdOn &&\n * !modifiedBy &&\n * !modifiedOn;\n *\n * return (\n * <Box grid gridName=\"custom-class-name\">\n * <SkeletonPlaceholder disabled={!loading}>\n * {id}\n * </SkeletonPlaceholder>\n * <SkeletonPlaceholder disabled={!loading}>\n * {name}\n * </SkeletonPlaceholder>\n * <SkeletonPlaceholder disabled={!loading}>\n * {createdOn}\n * </SkeletonPlaceholder>\n * <SkeletonPlaceholder disabled={!loading}>\n * {createdBy}\n * </SkeletonPlaceholder>\n * <SkeletonPlaceholder disabled={!loading}>\n * {modifiedOn}\n * </SkeletonPlaceholder>\n * <SkeletonPlaceholder disabled={!loading}>\n * {modifiedBy}\n * </SkeletonPlaceholder>\n * </Box>\n * );\n * }\n *\n * export function Example(): ReactElement {\n * const { data } = useLoadSomeDataQuery();\n *\n * const items = useMemo(() => {\n * // if the data has been fetched, just return the data\n * if (data) {\n * return data;\n * }\n *\n * // if the data does not exist, set up a skeleton of your layout by\n * // rendering a random number of items.\n * //\n * // NOTE: This is memoized so you don't create a random length each\n * // render\n * const length = randomInt({ min: 3, max: 10 })\n * return Array.from({ length }, (_, i) => ({ id: `placeholder-${i}` }));\n * }, [data])\n *\n * return (\n * <List>\n * {items.map((item) => <ShowData {...item} />)}\n * </List>\n * );\n * }\n * ```\n *\n * @see {@link https://next.react-md.dev/components/skeleton-placeholder | SkeletonPlaceholder Demos}\n * @since 6.0.0\n */\nexport const SkeletonPlaceholder = forwardRef<\n HTMLDivElement,\n SkeletonPlaceholderProps\n>(function SkeletonPlaceholder(props, ref): ReactElement {\n const {\n style,\n className,\n height,\n width,\n children,\n disabled = !!children,\n delay,\n minDelay,\n maxDelay,\n minPercentage,\n maxPercentage,\n ...remaining\n } = props;\n const skeleton = useSkeletonPlaceholder({\n disabled,\n style,\n className,\n height,\n width,\n delay,\n minDelay,\n maxDelay,\n minPercentage,\n maxPercentage,\n });\n\n return (\n <div {...remaining} ref={ref} {...skeleton}>\n {children}\n </div>\n );\n});\n"],"names":["forwardRef","useSkeletonPlaceholder","SkeletonPlaceholder","props","ref","style","className","height","width","children","disabled","delay","minDelay","maxDelay","minPercentage","maxPercentage","remaining","skeleton","div"],"mappings":"AAAA;;AAEA,SAIEA,UAAU,QACL,QAAQ;AAEf,SAEEC,sBAAsB,QACjB,8BAA8B;AAwBrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuGC,GACD,OAAO,MAAMC,oCAAsBF,WAGjC,SAASE,oBAAoBC,KAAK,EAAEC,GAAG;IACvC,MAAM,EACJC,KAAK,EACLC,SAAS,EACTC,MAAM,EACNC,KAAK,EACLC,QAAQ,EACRC,WAAW,CAAC,CAACD,QAAQ,EACrBE,KAAK,EACLC,QAAQ,EACRC,QAAQ,EACRC,aAAa,EACbC,aAAa,EACb,GAAGC,WACJ,GAAGb;IACJ,MAAMc,WAAWhB,uBAAuB;QACtCS;QACAL;QACAC;QACAC;QACAC;QACAG;QACAC;QACAC;QACAC;QACAC;IACF;IAEA,qBACE,KAACG;QAAK,GAAGF,SAAS;QAAEZ,KAAKA;QAAM,GAAGa,QAAQ;kBACvCR;;AAGP,GAAG"}
1
+ {"version":3,"sources":["../../src/transition/SkeletonPlaceholder.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n forwardRef,\n} from \"react\";\n\nimport {\n type SkeletonPlaceholderOptions,\n useSkeletonPlaceholder,\n} from \"./useSkeletonPlaceholder.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-skeleton-placeholder-background-color\"?: string;\n \"--rmd-skeleton-placeholder-height\"?: string | number;\n \"--rmd-skeleton-placeholder-width\"?: string | number;\n }\n}\n\n/** @since 6.0.0 */\nexport interface SkeletonPlaceholderProps\n extends HTMLAttributes<HTMLDivElement>,\n SkeletonPlaceholderOptions {\n /**\n * @defaultValue `!!children`\n * @see {@link SkeletonPlaceholderOptions.disabled}\n */\n disabled?: boolean;\n\n /** @see {@link SkeletonPlaceholderOptions.disabled} for an example */\n children?: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * @example Simple Example\n * ```tsx\n * import type { ReactElement } from \"@react\";\n * import { SkeletonPlaceholder } from \"@react-md/core/transition/SkeletonPlaceholder\";\n *\n * interface ExampleProps {\n * loading: boolean;\n * children: ReactNode;\n * }\n *\n * export default function Example({ loading, children }: ExampleProps): ReactElement {\n * if (loading) {\n * return <SkeletonPlaceholder />;\n * }\n *\n * return <>{children}</>;\n * }\n * ```\n *\n * @example Pre-rendered Layout\n * ```tsx\n * import type { ReactElement } from \"@react\";\n * import { SkeletonPlaceholder } from \"@react-md/core/transition/SkeletonPlaceholder\";\n *\n * interface Data {\n * id: string;\n * name: string;\n * createdBy: string\n * createdOn: string;\n * modifiedBy: string;\n * modifiedOn: string;\n * }\n *\n * function ShowData({\n * id,\n * name,\n * createdBy,\n * createdOn,\n * modifiedBy,\n * modifiedOn,\n * }: Partial<Data>:: ReactElement {\n * const loading =\n * !name &&\n * !createdBy &&\n * !createdOn &&\n * !modifiedBy &&\n * !modifiedOn;\n *\n * return (\n * <Box grid gridName=\"custom-class-name\">\n * <SkeletonPlaceholder disabled={!loading}>\n * {id}\n * </SkeletonPlaceholder>\n * <SkeletonPlaceholder disabled={!loading}>\n * {name}\n * </SkeletonPlaceholder>\n * <SkeletonPlaceholder disabled={!loading}>\n * {createdOn}\n * </SkeletonPlaceholder>\n * <SkeletonPlaceholder disabled={!loading}>\n * {createdBy}\n * </SkeletonPlaceholder>\n * <SkeletonPlaceholder disabled={!loading}>\n * {modifiedOn}\n * </SkeletonPlaceholder>\n * <SkeletonPlaceholder disabled={!loading}>\n * {modifiedBy}\n * </SkeletonPlaceholder>\n * </Box>\n * );\n * }\n *\n * export function Example(): ReactElement {\n * const { data } = useLoadSomeDataQuery();\n *\n * const items = useMemo(() => {\n * // if the data has been fetched, just return the data\n * if (data) {\n * return data;\n * }\n *\n * // if the data does not exist, set up a skeleton of your layout by\n * // rendering a random number of items.\n * //\n * // NOTE: This is memoized so you don't create a random length each\n * // render\n * const length = randomInt({ min: 3, max: 10 })\n * return Array.from({ length }, (_, i) => ({ id: `placeholder-${i}` }));\n * }, [data])\n *\n * return (\n * <List>\n * {items.map((item) => <ShowData {...item} />)}\n * </List>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/skeleton-placeholder | SkeletonPlaceholder Demos}\n * @since 6.0.0\n */\nexport const SkeletonPlaceholder = forwardRef<\n HTMLDivElement,\n SkeletonPlaceholderProps\n>(function SkeletonPlaceholder(props, ref): ReactElement {\n const {\n style,\n className,\n height,\n width,\n children,\n disabled = !!children,\n delay,\n minDelay,\n maxDelay,\n minPercentage,\n maxPercentage,\n ...remaining\n } = props;\n const skeleton = useSkeletonPlaceholder({\n disabled,\n style,\n className,\n height,\n width,\n delay,\n minDelay,\n maxDelay,\n minPercentage,\n maxPercentage,\n });\n\n return (\n <div {...remaining} ref={ref} {...skeleton}>\n {children}\n </div>\n );\n});\n"],"names":["forwardRef","useSkeletonPlaceholder","SkeletonPlaceholder","props","ref","style","className","height","width","children","disabled","delay","minDelay","maxDelay","minPercentage","maxPercentage","remaining","skeleton","div"],"mappings":"AAAA;;AAEA,SAIEA,UAAU,QACL,QAAQ;AAEf,SAEEC,sBAAsB,QACjB,8BAA8B;AAwBrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuGC,GACD,OAAO,MAAMC,oCAAsBF,WAGjC,SAASE,oBAAoBC,KAAK,EAAEC,GAAG;IACvC,MAAM,EACJC,KAAK,EACLC,SAAS,EACTC,MAAM,EACNC,KAAK,EACLC,QAAQ,EACRC,WAAW,CAAC,CAACD,QAAQ,EACrBE,KAAK,EACLC,QAAQ,EACRC,QAAQ,EACRC,aAAa,EACbC,aAAa,EACb,GAAGC,WACJ,GAAGb;IACJ,MAAMc,WAAWhB,uBAAuB;QACtCS;QACAL;QACAC;QACAC;QACAC;QACAG;QACAC;QACAC;QACAC;QACAC;IACF;IAEA,qBACE,KAACG;QAAK,GAAGF,SAAS;QAAEZ,KAAKA;QAAM,GAAGa,QAAQ;kBACvCR;;AAGP,GAAG"}
@@ -23,7 +23,7 @@ export interface SlideProps extends HTMLAttributes<HTMLDivElement>, CSSTransitio
23
23
  * A reasonable default for handling a slide transition using
24
24
  * {@link useSlideTransition}.
25
25
  *
26
- * @see {@link https://next.react-md.dev/components/slide | Slide Demos}
26
+ * @see {@link https://react-md.dev/components/slide | Slide Demos}
27
27
  * @see {@link SlideContainer} for example usage.
28
28
  * @since 6.0.0
29
29
  */
@@ -8,7 +8,7 @@ import { DEFAULT_SLIDE_TRANSITION_TIMEOUT, useSlideTransition } from "./useSlide
8
8
  * A reasonable default for handling a slide transition using
9
9
  * {@link useSlideTransition}.
10
10
  *
11
- * @see {@link https://next.react-md.dev/components/slide | Slide Demos}
11
+ * @see {@link https://react-md.dev/components/slide | Slide Demos}
12
12
  * @see {@link SlideContainer} for example usage.
13
13
  * @since 6.0.0
14
14
  */ export const Slide = /*#__PURE__*/ forwardRef(function Slide(props, nodeRef) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/transition/Slide.tsx"],"sourcesContent":["\"use client\";\n\nimport { type HTMLAttributes, type ReactNode, forwardRef } from \"react\";\n\nimport {\n type CSSTransitionComponentProps,\n type TransitionActions,\n type TransitionTimeout,\n} from \"./types.js\";\nimport {\n DEFAULT_SLIDE_TRANSITION_TIMEOUT,\n useSlideTransition,\n} from \"./useSlideTransition.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-slide-duration\"?: string | number;\n }\n}\n\n/** @since 6.0.0 */\nexport interface SlideProps\n extends HTMLAttributes<HTMLDivElement>,\n CSSTransitionComponentProps,\n TransitionActions {\n /**\n * Set this to `true` to animate this slide into view within a\n * `SlideContainer`. When this switches from `true` to `false`, it will\n * animate out.\n */\n active: boolean;\n\n /** @defaultValue {@link DEFAULT_SLIDE_TRANSITION_DURATION} */\n timeout?: TransitionTimeout;\n children: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * A reasonable default for handling a slide transition using\n * {@link useSlideTransition}.\n *\n * @see {@link https://next.react-md.dev/components/slide | Slide Demos}\n * @see {@link SlideContainer} for example usage.\n * @since 6.0.0\n */\nexport const Slide = forwardRef<HTMLDivElement, SlideProps>(\n function Slide(props, nodeRef) {\n const {\n active,\n appear,\n enter,\n exit,\n onEnter,\n onEntering,\n onEntered,\n onExit,\n onExiting,\n onExited,\n className,\n children,\n timeout = DEFAULT_SLIDE_TRANSITION_TIMEOUT,\n temporary = false,\n exitedHidden = true,\n ...remaining\n } = props;\n\n const { rendered, elementProps } = useSlideTransition({\n nodeRef,\n appear,\n enter,\n exit,\n onEnter,\n onEntering,\n onEntered,\n onExit,\n onExiting,\n onExited,\n className,\n timeout,\n temporary,\n transitionIn: active,\n exitedHidden,\n });\n\n if (!rendered) {\n return null;\n }\n\n return (\n <div {...remaining} {...elementProps}>\n {children}\n </div>\n );\n }\n);\n"],"names":["forwardRef","DEFAULT_SLIDE_TRANSITION_TIMEOUT","useSlideTransition","Slide","props","nodeRef","active","appear","enter","exit","onEnter","onEntering","onEntered","onExit","onExiting","onExited","className","children","timeout","temporary","exitedHidden","remaining","rendered","elementProps","transitionIn","div"],"mappings":"AAAA;;AAEA,SAA8CA,UAAU,QAAQ,QAAQ;AAOxE,SACEC,gCAAgC,EAChCC,kBAAkB,QACb,0BAA0B;AAyBjC;;;;;;;;;CASC,GACD,OAAO,MAAMC,sBAAQH,WACnB,SAASG,MAAMC,KAAK,EAAEC,OAAO;IAC3B,MAAM,EACJC,MAAM,EACNC,MAAM,EACNC,KAAK,EACLC,IAAI,EACJC,OAAO,EACPC,UAAU,EACVC,SAAS,EACTC,MAAM,EACNC,SAAS,EACTC,QAAQ,EACRC,SAAS,EACTC,QAAQ,EACRC,UAAUjB,gCAAgC,EAC1CkB,YAAY,KAAK,EACjBC,eAAe,IAAI,EACnB,GAAGC,WACJ,GAAGjB;IAEJ,MAAM,EAAEkB,QAAQ,EAAEC,YAAY,EAAE,GAAGrB,mBAAmB;QACpDG;QACAE;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAE;QACAC;QACAK,cAAclB;QACdc;IACF;IAEA,IAAI,CAACE,UAAU;QACb,OAAO;IACT;IAEA,qBACE,KAACG;QAAK,GAAGJ,SAAS;QAAG,GAAGE,YAAY;kBACjCN;;AAGP,GACA"}
1
+ {"version":3,"sources":["../../src/transition/Slide.tsx"],"sourcesContent":["\"use client\";\n\nimport { type HTMLAttributes, type ReactNode, forwardRef } from \"react\";\n\nimport {\n type CSSTransitionComponentProps,\n type TransitionActions,\n type TransitionTimeout,\n} from \"./types.js\";\nimport {\n DEFAULT_SLIDE_TRANSITION_TIMEOUT,\n useSlideTransition,\n} from \"./useSlideTransition.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-slide-duration\"?: string | number;\n }\n}\n\n/** @since 6.0.0 */\nexport interface SlideProps\n extends HTMLAttributes<HTMLDivElement>,\n CSSTransitionComponentProps,\n TransitionActions {\n /**\n * Set this to `true` to animate this slide into view within a\n * `SlideContainer`. When this switches from `true` to `false`, it will\n * animate out.\n */\n active: boolean;\n\n /** @defaultValue {@link DEFAULT_SLIDE_TRANSITION_DURATION} */\n timeout?: TransitionTimeout;\n children: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * A reasonable default for handling a slide transition using\n * {@link useSlideTransition}.\n *\n * @see {@link https://react-md.dev/components/slide | Slide Demos}\n * @see {@link SlideContainer} for example usage.\n * @since 6.0.0\n */\nexport const Slide = forwardRef<HTMLDivElement, SlideProps>(\n function Slide(props, nodeRef) {\n const {\n active,\n appear,\n enter,\n exit,\n onEnter,\n onEntering,\n onEntered,\n onExit,\n onExiting,\n onExited,\n className,\n children,\n timeout = DEFAULT_SLIDE_TRANSITION_TIMEOUT,\n temporary = false,\n exitedHidden = true,\n ...remaining\n } = props;\n\n const { rendered, elementProps } = useSlideTransition({\n nodeRef,\n appear,\n enter,\n exit,\n onEnter,\n onEntering,\n onEntered,\n onExit,\n onExiting,\n onExited,\n className,\n timeout,\n temporary,\n transitionIn: active,\n exitedHidden,\n });\n\n if (!rendered) {\n return null;\n }\n\n return (\n <div {...remaining} {...elementProps}>\n {children}\n </div>\n );\n }\n);\n"],"names":["forwardRef","DEFAULT_SLIDE_TRANSITION_TIMEOUT","useSlideTransition","Slide","props","nodeRef","active","appear","enter","exit","onEnter","onEntering","onEntered","onExit","onExiting","onExited","className","children","timeout","temporary","exitedHidden","remaining","rendered","elementProps","transitionIn","div"],"mappings":"AAAA;;AAEA,SAA8CA,UAAU,QAAQ,QAAQ;AAOxE,SACEC,gCAAgC,EAChCC,kBAAkB,QACb,0BAA0B;AAyBjC;;;;;;;;;CASC,GACD,OAAO,MAAMC,sBAAQH,WACnB,SAASG,MAAMC,KAAK,EAAEC,OAAO;IAC3B,MAAM,EACJC,MAAM,EACNC,MAAM,EACNC,KAAK,EACLC,IAAI,EACJC,OAAO,EACPC,UAAU,EACVC,SAAS,EACTC,MAAM,EACNC,SAAS,EACTC,QAAQ,EACRC,SAAS,EACTC,QAAQ,EACRC,UAAUjB,gCAAgC,EAC1CkB,YAAY,KAAK,EACjBC,eAAe,IAAI,EACnB,GAAGC,WACJ,GAAGjB;IAEJ,MAAM,EAAEkB,QAAQ,EAAEC,YAAY,EAAE,GAAGrB,mBAAmB;QACpDG;QACAE;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAE;QACAC;QACAK,cAAclB;QACdc;IACF;IAEA,IAAI,CAACE,UAAU;QACb,OAAO;IACT;IAEA,qBACE,KAACG;QAAK,GAAGJ,SAAS;QAAG,GAAGE,YAAY;kBACjCN;;AAGP,GACA"}
@@ -104,7 +104,7 @@ export interface SlideContainerProps extends HTMLAttributes<HTMLDivElement>, Sli
104
104
  * }
105
105
  * ```
106
106
  *
107
- * @see {@link https://next.react-md.dev/components/slide | Slide Demos}
107
+ * @see {@link https://react-md.dev/components/slide | Slide Demos}
108
108
  * @since 6.0.0
109
109
  */
110
110
  export declare const SlideContainer: import("react").ForwardRefExoticComponent<SlideContainerProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -61,7 +61,7 @@ const styles = bem("rmd-slide-container");
61
61
  * }
62
62
  * ```
63
63
  *
64
- * @see {@link https://next.react-md.dev/components/slide | Slide Demos}
64
+ * @see {@link https://react-md.dev/components/slide | Slide Demos}
65
65
  * @since 6.0.0
66
66
  */ export const SlideContainer = /*#__PURE__*/ forwardRef(function SlideContainer(props, ref) {
67
67
  const { className, direction, vertical, children, ...remaining } = props;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/transition/SlideContainer.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { type HTMLAttributes, forwardRef } from \"react\";\n\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-slide-container\");\n\n/**\n * @example Direction \"forward\"\n * ```\n * -------------\n * | |\n * | Slide 1 | Slide 2\n * | |\n * -------------\n * -------------\n * | |\n * Slide 1 Slide 2\n * | |\n * -------------\n * -------------\n * | |\n * Slide 1 | Slide 2 |\n * | |\n * -------------\n * ```\n *\n * @example Direction \"backward\"\n * ```\n * -------------\n * | |\n * Slide 1 | Slide 2 |\n * | |\n * -------------\n * -------------\n * | |\n * Slide 1 Slide 2\n * | |\n * -------------\n * -------------\n * | |\n * | Slide 1 | Slide 2\n * | |\n * -------------\n * ```\n *\n * @since 6.0.0\n */\nexport type SlideDirection = \"backward\" | \"forward\";\n\n/** @since 6.0.0 */\nexport interface SlideContainerClassNameOptions {\n className?: string;\n\n /** @see {@link SlideDirection} */\n direction: SlideDirection;\n\n vertical?: boolean;\n}\n\n/**\n * @see {@link useSlideTransition} for an example\n * @since 6.0.0\n */\nexport function slideContainer(\n options: SlideContainerClassNameOptions\n): string {\n const { className, direction, vertical } = options;\n\n return cnb(styles({ [direction]: true, vertical }), className);\n}\n\n/** @since 6.0.0 */\nexport interface SlideContainerProps\n extends HTMLAttributes<HTMLDivElement>,\n SlideContainerClassNameOptions {}\n\n/**\n * The `SlideContainer` is used to enable a slide transition when child `Slide`\n * components change.\n *\n * @example Simple Example\n * ```tsx\n * import { Slide } from \"@react-md/core/transition/Slide\";\n * import { SlideContainer } from \"@react-md/core/transition/SlideContainer\";\n * import type { ReactElement, ReactNode } from \"react\";\n * import { useState } from \"react\";\n *\n * interface State {\n * direction: SlideDirection;\n * activeIndex: number;\n * }\n *\n * function Example(): ReactElement {\n * const [state, setState] = useState<State>({\n * direction: \"forward\",\n * activeIndex: 0,\n * });\n * const { direction, activeIndex } = state;\n *\n * // when changing a slide, `direction` should be set to \"forward\" if the\n * // previous `activeIndex` is less than the next index\n * //\n * // i.e.\n * // setState((prevState) => ({\n * // direction: prevState.activeIndex < index ? \"forward\" : \"backward\",\n * // activeIndex: index,\n * // }))\n *\n * return (\n * <SlideContainer direction={direction}>\n * <Slide active={activeIndex === 0}>\n * Slide 1\n * </Slide>\n * <Slide active={activeIndex === 1}>\n * Slide 2\n * </Slide>\n * <Slide active={activeIndex === 2}>\n * Slide 3\n * </Slide>\n * </SlideContainer>\n * );\n * }\n * ```\n *\n * @see {@link https://next.react-md.dev/components/slide | Slide Demos}\n * @since 6.0.0\n */\nexport const SlideContainer = forwardRef<HTMLDivElement, SlideContainerProps>(\n function SlideContainer(props, ref) {\n const { className, direction, vertical, children, ...remaining } = props;\n\n return (\n <div\n {...remaining}\n ref={ref}\n className={slideContainer({ className, direction, vertical })}\n >\n {children}\n </div>\n );\n }\n);\n"],"names":["cnb","forwardRef","bem","styles","slideContainer","options","className","direction","vertical","SlideContainer","props","ref","children","remaining","div"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAA8BC,UAAU,QAAQ,QAAQ;AAExD,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AAuDnB;;;CAGC,GACD,OAAO,SAASE,eACdC,OAAuC;IAEvC,MAAM,EAAEC,SAAS,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGH;IAE3C,OAAOL,IAAIG,OAAO;QAAE,CAACI,UAAU,EAAE;QAAMC;IAAS,IAAIF;AACtD;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDC,GACD,OAAO,MAAMG,+BAAiBR,WAC5B,SAASQ,eAAeC,KAAK,EAAEC,GAAG;IAChC,MAAM,EAAEL,SAAS,EAAEC,SAAS,EAAEC,QAAQ,EAAEI,QAAQ,EAAE,GAAGC,WAAW,GAAGH;IAEnE,qBACE,KAACI;QACE,GAAGD,SAAS;QACbF,KAAKA;QACLL,WAAWF,eAAe;YAAEE;YAAWC;YAAWC;QAAS;kBAE1DI;;AAGP,GACA"}
1
+ {"version":3,"sources":["../../src/transition/SlideContainer.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { type HTMLAttributes, forwardRef } from \"react\";\n\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-slide-container\");\n\n/**\n * @example Direction \"forward\"\n * ```\n * -------------\n * | |\n * | Slide 1 | Slide 2\n * | |\n * -------------\n * -------------\n * | |\n * Slide 1 Slide 2\n * | |\n * -------------\n * -------------\n * | |\n * Slide 1 | Slide 2 |\n * | |\n * -------------\n * ```\n *\n * @example Direction \"backward\"\n * ```\n * -------------\n * | |\n * Slide 1 | Slide 2 |\n * | |\n * -------------\n * -------------\n * | |\n * Slide 1 Slide 2\n * | |\n * -------------\n * -------------\n * | |\n * | Slide 1 | Slide 2\n * | |\n * -------------\n * ```\n *\n * @since 6.0.0\n */\nexport type SlideDirection = \"backward\" | \"forward\";\n\n/** @since 6.0.0 */\nexport interface SlideContainerClassNameOptions {\n className?: string;\n\n /** @see {@link SlideDirection} */\n direction: SlideDirection;\n\n vertical?: boolean;\n}\n\n/**\n * @see {@link useSlideTransition} for an example\n * @since 6.0.0\n */\nexport function slideContainer(\n options: SlideContainerClassNameOptions\n): string {\n const { className, direction, vertical } = options;\n\n return cnb(styles({ [direction]: true, vertical }), className);\n}\n\n/** @since 6.0.0 */\nexport interface SlideContainerProps\n extends HTMLAttributes<HTMLDivElement>,\n SlideContainerClassNameOptions {}\n\n/**\n * The `SlideContainer` is used to enable a slide transition when child `Slide`\n * components change.\n *\n * @example Simple Example\n * ```tsx\n * import { Slide } from \"@react-md/core/transition/Slide\";\n * import { SlideContainer } from \"@react-md/core/transition/SlideContainer\";\n * import type { ReactElement, ReactNode } from \"react\";\n * import { useState } from \"react\";\n *\n * interface State {\n * direction: SlideDirection;\n * activeIndex: number;\n * }\n *\n * function Example(): ReactElement {\n * const [state, setState] = useState<State>({\n * direction: \"forward\",\n * activeIndex: 0,\n * });\n * const { direction, activeIndex } = state;\n *\n * // when changing a slide, `direction` should be set to \"forward\" if the\n * // previous `activeIndex` is less than the next index\n * //\n * // i.e.\n * // setState((prevState) => ({\n * // direction: prevState.activeIndex < index ? \"forward\" : \"backward\",\n * // activeIndex: index,\n * // }))\n *\n * return (\n * <SlideContainer direction={direction}>\n * <Slide active={activeIndex === 0}>\n * Slide 1\n * </Slide>\n * <Slide active={activeIndex === 1}>\n * Slide 2\n * </Slide>\n * <Slide active={activeIndex === 2}>\n * Slide 3\n * </Slide>\n * </SlideContainer>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/slide | Slide Demos}\n * @since 6.0.0\n */\nexport const SlideContainer = forwardRef<HTMLDivElement, SlideContainerProps>(\n function SlideContainer(props, ref) {\n const { className, direction, vertical, children, ...remaining } = props;\n\n return (\n <div\n {...remaining}\n ref={ref}\n className={slideContainer({ className, direction, vertical })}\n >\n {children}\n </div>\n );\n }\n);\n"],"names":["cnb","forwardRef","bem","styles","slideContainer","options","className","direction","vertical","SlideContainer","props","ref","children","remaining","div"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAA8BC,UAAU,QAAQ,QAAQ;AAExD,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AAuDnB;;;CAGC,GACD,OAAO,SAASE,eACdC,OAAuC;IAEvC,MAAM,EAAEC,SAAS,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGH;IAE3C,OAAOL,IAAIG,OAAO;QAAE,CAACI,UAAU,EAAE;QAAMC;IAAS,IAAIF;AACtD;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDC,GACD,OAAO,MAAMG,+BAAiBR,WAC5B,SAASQ,eAAeC,KAAK,EAAEC,GAAG;IAChC,MAAM,EAAEL,SAAS,EAAEC,SAAS,EAAEC,QAAQ,EAAEI,QAAQ,EAAE,GAAGC,WAAW,GAAGH;IAEnE,qBACE,KAACI;QACE,GAAGD,SAAS;QACbF,KAAKA;QACLL,WAAWF,eAAe;YAAEE;YAAWC;YAAWC;QAAS;kBAE1DI;;AAGP,GACA"}
@@ -141,8 +141,8 @@ import type { CSSTransitionHookOptions, CSSTransitionHookReturnValue } from "./t
141
141
  * }
142
142
  * ```
143
143
  *
144
- * @see {@link https://next.react-md.dev/hooks/use-css-transition | useCSSTransition Demos}
145
- * @see {@link https://next.react-md.dev/components/css-transition | CSSTransition Demos}
144
+ * @see {@link https://react-md.dev/hooks/use-css-transition | useCSSTransition Demos}
145
+ * @see {@link https://react-md.dev/components/css-transition | CSSTransition Demos}
146
146
  * @typeParam E - An HTMLElement type used for the ref required for the
147
147
  * transition.
148
148
  * @since 4.0.0
@@ -145,8 +145,8 @@ import { getTransitionClassNames } from "./utils.js";
145
145
  * }
146
146
  * ```
147
147
  *
148
- * @see {@link https://next.react-md.dev/hooks/use-css-transition | useCSSTransition Demos}
149
- * @see {@link https://next.react-md.dev/components/css-transition | CSSTransition Demos}
148
+ * @see {@link https://react-md.dev/hooks/use-css-transition | useCSSTransition Demos}
149
+ * @see {@link https://react-md.dev/components/css-transition | CSSTransition Demos}
150
150
  * @typeParam E - An HTMLElement type used for the ref required for the
151
151
  * transition.
152
152
  * @since 4.0.0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/transition/useCSSTransition.ts"],"sourcesContent":["\"use client\";\n\nimport { cnb } from \"cnbuilder\";\n\nimport { DISPLAY_NONE_CLASS } from \"../utils/isElementVisible.js\";\nimport type {\n CSSTransitionElementProps,\n CSSTransitionHookOptions,\n CSSTransitionHookReturnValue,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TransitionHookOptions,\n} from \"./types.js\";\nimport { useTransition } from \"./useTransition.js\";\nimport { getTransitionClassNames } from \"./utils.js\";\n\n/**\n * This hook is used to create CSS transitions for different components whenever\n * a {@link TransitionHookOptions.transitionIn} flag is changed.\n *\n * @example Simple Transition\n * ```tsx\n * import { Button } from \"@react-md/core/button/Button\";\n * import { useCSSTransition } from \"@react-md/core/transition/useCSSTransition\";\n * import { Typography } from \"@react-md/core/typography/Typography\";\n * import { type ReactElement, useState } from \"react\";\n *\n * // Pretend styles\n * // .enter {\n * // opacity: 0.5;\n * // transition: opacity .15s;\n * // }\n * //\n * // .enter--active {\n * // opacity: 1;\n * // }\n * //\n * // .exit {\n * // opacity: 1;\n * // transition: opacity .15s;\n * // }\n * //\n * // .exit--active {\n * // opacity: 0.5;\n * // }\n *\n * function Example(): ReactElement {\n * const [transitionIn, setTransitionIn] = useState(false);\n * const { elementProps } = useCSSTransition({\n * timeout: 150,\n * classNames: {\n * enter: \"enter\",\n * enterActive: \"enter--active\",\n * exit: \"exit\",\n * exitActive: \"exit--active\",\n * },\n * transitionIn,\n * });\n *\n * return (\n * <>\n * <Button onClick={() => setTransitionIn(!transitionIn)}>\n * Toggle\n * </Button>\n * <Typography {...elementProps}>\n * Some Opacity Changing Text\n * </Typography>\n * </>\n * );\n * }\n * ```\n *\n * @example Visibility Transition\n * ```tsx\n * import { Button } from \"@react-md/core/button/Button\";\n * import { useCSSTransition } from \"@react-md/core/transition/useCSSTransition\";\n * import { Typography } from \"@react-md/core/typography/Typography\";\n * import { type ReactElement, useState } from \"react\";\n *\n * // Pretend styles\n * // .enter {\n * // opacity: 0;\n * // transition: opacity .2s;\n * // }\n * //\n * // .enter--active {\n * // opacity: 1;\n * // }\n * //\n * // .exit {\n * // opacity: 1;\n * // transition: opacity .15s;\n * // }\n * //\n * // .exit--active {\n * // opacity: 0;\n * // }\n *\n * function Example(): ReactElement {\n * const [transitionIn, setTransitionIn] = useState(false);\n * const { elementProps, rendered } = useCSSTransition({\n * timeout: {\n * enter: 200,\n * exit: 150,\n * },\n * classNames: {\n * enter: \"enter\",\n * enterActive: \"enter--active\",\n * exit: \"exit\",\n * exitActive: \"exit--active\",\n * },\n * transitionIn,\n * temporary: true,\n * });\n *\n * return (\n * <>\n * <Button onClick={() => setTransitionIn(!transitionIn)}>\n * Toggle\n * </Button>\n * {rendered && (\n * <Typography {...elementProps}>\n * Some Opacity Changing Text\n * </Typography>\n * )}\n * </>\n * );\n * }\n * ```\n *\n * @example Mount Transition\n * ```tsx\n * import type { ReactElement } from \"react\";\n * import { useCSSTransition } from \"@react-md/transition\";\n *\n * // Pretend styles\n * // .opacity {\n * // opacity: 0;\n * // transition: opacity .3s;\n * // }\n * //\n * // .opacity--active {\n * // opacity: 1;\n * // }\n * //\n *\n * function Example(): ReactElement {\n * const { elementProps } = useCSSTransition({\n * appear: true,\n * transitionIn: true,\n * timeout: 300,\n * classNames: \"opacity\",\n * })\n *\n * return <div {...elementProps}>Some Content!</div>;\n * }\n * ```\n *\n * @see {@link https://next.react-md.dev/hooks/use-css-transition | useCSSTransition Demos}\n * @see {@link https://next.react-md.dev/components/css-transition | CSSTransition Demos}\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @since 4.0.0\n */\nexport function useCSSTransition<E extends HTMLElement>(\n options: CSSTransitionHookOptions<E>\n): CSSTransitionHookReturnValue<E> {\n const {\n className,\n classNames,\n appear = false,\n enter = true,\n exit = true,\n timeout,\n temporary = false,\n exitedHidden = false,\n ...transitionOptions\n } = options;\n\n const { ref, stage, rendered, appearing, transitionTo, disablePortal } =\n useTransition({\n ...transitionOptions,\n appear,\n enter,\n exit,\n timeout,\n reflow: true,\n temporary,\n });\n const isEntering = stage === \"entering\";\n const isEnter = isEntering || stage === \"enter\";\n const isEntered = stage === \"entered\";\n const isExiting = stage === \"exiting\";\n const isExit = isExiting || stage === \"exit\";\n const isExited = stage === \"exited\";\n const transitionClassNames = getTransitionClassNames({\n timeout,\n appear,\n enter,\n exit,\n classNames,\n });\n\n const elementProps: CSSTransitionElementProps<E> = {\n ref,\n className:\n cnb(\n // always apply the provided className first since it makes snapshot\n // tests easier to parse if dynamic classes come afterwards\n className,\n !temporary && exitedHidden && stage === \"exited\" && DISPLAY_NONE_CLASS,\n appearing && isEnter && transitionClassNames.appear,\n appearing && isEntering && transitionClassNames.appearActive,\n appearing && isEntered && transitionClassNames.appearDone,\n !appearing && isEnter && transitionClassNames.enter,\n !appearing && isEntering && transitionClassNames.enterActive,\n !appearing && isEntered && transitionClassNames.enterDone,\n isExit && transitionClassNames.exit,\n isExiting && transitionClassNames.exitActive,\n isExited && transitionClassNames.exitDone\n ) || undefined,\n };\n\n return {\n ...elementProps,\n stage,\n rendered,\n appearing,\n elementProps,\n transitionTo,\n disablePortal,\n };\n}\n"],"names":["cnb","DISPLAY_NONE_CLASS","useTransition","getTransitionClassNames","useCSSTransition","options","className","classNames","appear","enter","exit","timeout","temporary","exitedHidden","transitionOptions","ref","stage","rendered","appearing","transitionTo","disablePortal","reflow","isEntering","isEnter","isEntered","isExiting","isExit","isExited","transitionClassNames","elementProps","appearActive","appearDone","enterActive","enterDone","exitActive","exitDone","undefined"],"mappings":"AAAA;AAEA,SAASA,GAAG,QAAQ,YAAY;AAEhC,SAASC,kBAAkB,QAAQ,+BAA+B;AAQlE,SAASC,aAAa,QAAQ,qBAAqB;AACnD,SAASC,uBAAuB,QAAQ,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AaG,qBAAqBM,UAAU,EAC5CP,YAAYC,qBAAqBO,QAAQ,KACtCC;IACT;IAEA,OAAO;QACL,GAAGP,YAAY;QACfb;QACAC;QACAC;QACAW;QACAV;QACAC;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/transition/useCSSTransition.ts"],"sourcesContent":["\"use client\";\n\nimport { cnb } from \"cnbuilder\";\n\nimport { DISPLAY_NONE_CLASS } from \"../utils/isElementVisible.js\";\nimport type {\n CSSTransitionElementProps,\n CSSTransitionHookOptions,\n CSSTransitionHookReturnValue,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TransitionHookOptions,\n} from \"./types.js\";\nimport { useTransition } from \"./useTransition.js\";\nimport { getTransitionClassNames } from \"./utils.js\";\n\n/**\n * This hook is used to create CSS transitions for different components whenever\n * a {@link TransitionHookOptions.transitionIn} flag is changed.\n *\n * @example Simple Transition\n * ```tsx\n * import { Button } from \"@react-md/core/button/Button\";\n * import { useCSSTransition } from \"@react-md/core/transition/useCSSTransition\";\n * import { Typography } from \"@react-md/core/typography/Typography\";\n * import { type ReactElement, useState } from \"react\";\n *\n * // Pretend styles\n * // .enter {\n * // opacity: 0.5;\n * // transition: opacity .15s;\n * // }\n * //\n * // .enter--active {\n * // opacity: 1;\n * // }\n * //\n * // .exit {\n * // opacity: 1;\n * // transition: opacity .15s;\n * // }\n * //\n * // .exit--active {\n * // opacity: 0.5;\n * // }\n *\n * function Example(): ReactElement {\n * const [transitionIn, setTransitionIn] = useState(false);\n * const { elementProps } = useCSSTransition({\n * timeout: 150,\n * classNames: {\n * enter: \"enter\",\n * enterActive: \"enter--active\",\n * exit: \"exit\",\n * exitActive: \"exit--active\",\n * },\n * transitionIn,\n * });\n *\n * return (\n * <>\n * <Button onClick={() => setTransitionIn(!transitionIn)}>\n * Toggle\n * </Button>\n * <Typography {...elementProps}>\n * Some Opacity Changing Text\n * </Typography>\n * </>\n * );\n * }\n * ```\n *\n * @example Visibility Transition\n * ```tsx\n * import { Button } from \"@react-md/core/button/Button\";\n * import { useCSSTransition } from \"@react-md/core/transition/useCSSTransition\";\n * import { Typography } from \"@react-md/core/typography/Typography\";\n * import { type ReactElement, useState } from \"react\";\n *\n * // Pretend styles\n * // .enter {\n * // opacity: 0;\n * // transition: opacity .2s;\n * // }\n * //\n * // .enter--active {\n * // opacity: 1;\n * // }\n * //\n * // .exit {\n * // opacity: 1;\n * // transition: opacity .15s;\n * // }\n * //\n * // .exit--active {\n * // opacity: 0;\n * // }\n *\n * function Example(): ReactElement {\n * const [transitionIn, setTransitionIn] = useState(false);\n * const { elementProps, rendered } = useCSSTransition({\n * timeout: {\n * enter: 200,\n * exit: 150,\n * },\n * classNames: {\n * enter: \"enter\",\n * enterActive: \"enter--active\",\n * exit: \"exit\",\n * exitActive: \"exit--active\",\n * },\n * transitionIn,\n * temporary: true,\n * });\n *\n * return (\n * <>\n * <Button onClick={() => setTransitionIn(!transitionIn)}>\n * Toggle\n * </Button>\n * {rendered && (\n * <Typography {...elementProps}>\n * Some Opacity Changing Text\n * </Typography>\n * )}\n * </>\n * );\n * }\n * ```\n *\n * @example Mount Transition\n * ```tsx\n * import type { ReactElement } from \"react\";\n * import { useCSSTransition } from \"@react-md/transition\";\n *\n * // Pretend styles\n * // .opacity {\n * // opacity: 0;\n * // transition: opacity .3s;\n * // }\n * //\n * // .opacity--active {\n * // opacity: 1;\n * // }\n * //\n *\n * function Example(): ReactElement {\n * const { elementProps } = useCSSTransition({\n * appear: true,\n * transitionIn: true,\n * timeout: 300,\n * classNames: \"opacity\",\n * })\n *\n * return <div {...elementProps}>Some Content!</div>;\n * }\n * ```\n *\n * @see {@link https://react-md.dev/hooks/use-css-transition | useCSSTransition Demos}\n * @see {@link https://react-md.dev/components/css-transition | CSSTransition Demos}\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @since 4.0.0\n */\nexport function useCSSTransition<E extends HTMLElement>(\n options: CSSTransitionHookOptions<E>\n): CSSTransitionHookReturnValue<E> {\n const {\n className,\n classNames,\n appear = false,\n enter = true,\n exit = true,\n timeout,\n temporary = false,\n exitedHidden = false,\n ...transitionOptions\n } = options;\n\n const { ref, stage, rendered, appearing, transitionTo, disablePortal } =\n useTransition({\n ...transitionOptions,\n appear,\n enter,\n exit,\n timeout,\n reflow: true,\n temporary,\n });\n const isEntering = stage === \"entering\";\n const isEnter = isEntering || stage === \"enter\";\n const isEntered = stage === \"entered\";\n const isExiting = stage === \"exiting\";\n const isExit = isExiting || stage === \"exit\";\n const isExited = stage === \"exited\";\n const transitionClassNames = getTransitionClassNames({\n timeout,\n appear,\n enter,\n exit,\n classNames,\n });\n\n const elementProps: CSSTransitionElementProps<E> = {\n ref,\n className:\n cnb(\n // always apply the provided className first since it makes snapshot\n // tests easier to parse if dynamic classes come afterwards\n className,\n !temporary && exitedHidden && stage === \"exited\" && DISPLAY_NONE_CLASS,\n appearing && isEnter && transitionClassNames.appear,\n appearing && isEntering && transitionClassNames.appearActive,\n appearing && isEntered && transitionClassNames.appearDone,\n !appearing && isEnter && transitionClassNames.enter,\n !appearing && isEntering && transitionClassNames.enterActive,\n !appearing && isEntered && transitionClassNames.enterDone,\n isExit && transitionClassNames.exit,\n isExiting && transitionClassNames.exitActive,\n isExited && transitionClassNames.exitDone\n ) || undefined,\n };\n\n return {\n ...elementProps,\n stage,\n rendered,\n appearing,\n elementProps,\n transitionTo,\n disablePortal,\n };\n}\n"],"names":["cnb","DISPLAY_NONE_CLASS","useTransition","getTransitionClassNames","useCSSTransition","options","className","classNames","appear","enter","exit","timeout","temporary","exitedHidden","transitionOptions","ref","stage","rendered","appearing","transitionTo","disablePortal","reflow","isEntering","isEnter","isEntered","isExiting","isExit","isExited","transitionClassNames","elementProps","appearActive","appearDone","enterActive","enterDone","exitActive","exitDone","undefined"],"mappings":"AAAA;AAEA,SAASA,GAAG,QAAQ,YAAY;AAEhC,SAASC,kBAAkB,QAAQ,+BAA+B;AAQlE,SAASC,aAAa,QAAQ,qBAAqB;AACnD,SAASC,uBAAuB,Q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Ce,aAAaG,qBAAqBM,UAAU,EAC5CP,YAAYC,qBAAqBO,QAAQ,KACtCC;IACT;IAEA,OAAO;QACL,GAAGP,YAAY;QACfb;QACAC;QACAC;QACAW;QACAV;QACAC;IACF;AACF"}
@@ -153,7 +153,7 @@ export interface CarouselOptions {
153
153
  * }
154
154
  * ```
155
155
  *
156
- * @see {@link https://next.react-md.dev/components/carousel | Carousel Demos}
156
+ * @see {@link https://react-md.dev/components/carousel | Carousel Demos}
157
157
  * @see {@link https://www.w3.org/WAI/ARIA/apg/patterns/carousel/}
158
158
  * @see {@link https://www.w3.org/WAI/ARIA/apg/example-index/carousel/carousel-2-tablist.html}
159
159
  * @since 6.0.0
@@ -97,7 +97,7 @@ import { loop } from "../utils/loop.js";
97
97
  * }
98
98
  * ```
99
99
  *
100
- * @see {@link https://next.react-md.dev/components/carousel | Carousel Demos}
100
+ * @see {@link https://react-md.dev/components/carousel | Carousel Demos}
101
101
  * @see {@link https://www.w3.org/WAI/ARIA/apg/patterns/carousel/}
102
102
  * @see {@link https://www.w3.org/WAI/ARIA/apg/example-index/carousel/carousel-2-tablist.html}
103
103
  * @since 6.0.0